Files
lcp-visualizer/blocks/bar-graph/build/index.js
2025-01-26 14:54:52 -08:00

1 line
1.2 MiB
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(()=>{var e,t={878:(e,t,i)=>{"use strict";const s=window.wp.blocks;var o=i(609);const n=window.wp.i18n,r=window.wp.blockEditor,a=window.wp.components,l=window.wp.element;function u(e,t){let i;if(void 0===t)for(const t of e)null!=t&&(i<t||void 0===i&&t>=t)&&(i=t);else{let s=-1;for(let o of e)null!=(o=t(o,++s,e))&&(i<o||void 0===i&&o>=o)&&(i=o)}return i}function h(e){return e}var d=1e-6;function c(e){return"translate("+e+",0)"}function p(e){return"translate(0,"+e+")"}function g(e){return t=>+e(t)}function m(e,t){return t=Math.max(0,e.bandwidth()-2*t)/2,e.round()&&(t=Math.round(t)),i=>+e(i)+t}function f(){return!this.__axis}function C(e,t){var i=[],s=null,o=null,n=6,r=6,a=3,l="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,u=1===e||4===e?-1:1,C=4===e||2===e?"x":"y",v=1===e||3===e?c:p;function w(c){var p=null==s?t.ticks?t.ticks.apply(t,i):t.domain():s,w=null==o?t.tickFormat?t.tickFormat.apply(t,i):h:o,y=Math.max(n,0)+a,E=t.range(),S=+E[0]+l,b=+E[E.length-1]+l,R=(t.bandwidth?m:g)(t.copy(),l),D=c.selection?c.selection():c,T=D.selectAll(".domain").data([null]),A=D.selectAll(".tick").data(p,t).order(),P=A.exit(),F=A.enter().append("g").attr("class","tick"),M=A.select("line"),L=A.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),A=A.merge(F),M=M.merge(F.append("line").attr("stroke","currentColor").attr(C+"2",u*n)),L=L.merge(F.append("text").attr("fill","currentColor").attr(C,u*y).attr("dy",1===e?"0em":3===e?"0.71em":"0.32em")),c!==D&&(T=T.transition(c),A=A.transition(c),M=M.transition(c),L=L.transition(c),P=P.transition(c).attr("opacity",d).attr("transform",(function(e){return isFinite(e=R(e))?v(e+l):this.getAttribute("transform")})),F.attr("opacity",d).attr("transform",(function(e){var t=this.parentNode.__axis;return v((t&&isFinite(t=t(e))?t:R(e))+l)}))),P.remove(),T.attr("d",4===e||2===e?r?"M"+u*r+","+S+"H"+l+"V"+b+"H"+u*r:"M"+l+","+S+"V"+b:r?"M"+S+","+u*r+"V"+l+"H"+b+"V"+u*r:"M"+S+","+l+"H"+b),A.attr("opacity",1).attr("transform",(function(e){return v(R(e)+l)})),M.attr(C+"2",u*n),L.attr(C,u*y).text(w),D.filter(f).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===e?"start":4===e?"end":"middle"),D.each((function(){this.__axis=R}))}return w.scale=function(e){return arguments.length?(t=e,w):t},w.ticks=function(){return i=Array.from(arguments),w},w.tickArguments=function(e){return arguments.length?(i=null==e?[]:Array.from(e),w):i.slice()},w.tickValues=function(e){return arguments.length?(s=null==e?null:Array.from(e),w):s&&s.slice()},w.tickFormat=function(e){return arguments.length?(o=e,w):o},w.tickSize=function(e){return arguments.length?(n=r=+e,w):n},w.tickSizeInner=function(e){return arguments.length?(n=+e,w):n},w.tickSizeOuter=function(e){return arguments.length?(r=+e,w):r},w.tickPadding=function(e){return arguments.length?(a=+e,w):a},w.offset=function(e){return arguments.length?(l=+e,w):l},w}function v(){}function w(e){return null==e?v:function(){return this.querySelector(e)}}function y(){return[]}function E(e){return null==e?y:function(){return this.querySelectorAll(e)}}function S(e){return function(){return this.matches(e)}}function b(e){return function(t){return t.matches(e)}}var R=Array.prototype.find;function D(){return this.firstElementChild}var T=Array.prototype.filter;function A(){return Array.from(this.children)}function P(e){return new Array(e.length)}function F(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function M(e,t,i,s,o,n){for(var r,a=0,l=t.length,u=n.length;a<u;++a)(r=t[a])?(r.__data__=n[a],s[a]=r):i[a]=new F(e,n[a]);for(;a<l;++a)(r=t[a])&&(o[a]=r)}function L(e,t,i,s,o,n,r){var a,l,u,h=new Map,d=t.length,c=n.length,p=new Array(d);for(a=0;a<d;++a)(l=t[a])&&(p[a]=u=r.call(l,l.__data__,a,t)+"",h.has(u)?o[a]=l:h.set(u,l));for(a=0;a<c;++a)u=r.call(e,n[a],a,n)+"",(l=h.get(u))?(s[a]=l,l.__data__=n[a],h.delete(u)):i[a]=new F(e,n[a]);for(a=0;a<d;++a)(l=t[a])&&h.get(p[a])===l&&(o[a]=l)}function x(e){return e.__data__}function I(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function N(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}F.prototype={constructor:F,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};var _="http://www.w3.org/1999/xhtml";const O={svg:"http://www.w3.org/2000/svg",xhtml:_,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function G(e){var t=e+="",i=t.indexOf(":");return i>=0&&"xmlns"!==(t=e.slice(0,i))&&(e=e.slice(i+1)),O.hasOwnProperty(t)?{space:O[t],local:e}:e}function k(e){return function(){this.removeAttribute(e)}}function V(e){return function(){this.removeAttributeNS(e.space,e.local)}}function H(e,t){return function(){this.setAttribute(e,t)}}function B(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function W(e,t){return function(){var i=t.apply(this,arguments);null==i?this.removeAttribute(e):this.setAttribute(e,i)}}function U(e,t){return function(){var i=t.apply(this,arguments);null==i?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,i)}}function z(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function $(e){return function(){this.style.removeProperty(e)}}function K(e,t,i){return function(){this.style.setProperty(e,t,i)}}function j(e,t,i){return function(){var s=t.apply(this,arguments);null==s?this.style.removeProperty(e):this.style.setProperty(e,s,i)}}function Y(e,t){return e.style.getPropertyValue(t)||z(e).getComputedStyle(e,null).getPropertyValue(t)}function q(e){return function(){delete this[e]}}function X(e,t){return function(){this[e]=t}}function Q(e,t){return function(){var i=t.apply(this,arguments);null==i?delete this[e]:this[e]=i}}function J(e){return e.trim().split(/^|\s+/)}function Z(e){return e.classList||new ee(e)}function ee(e){this._node=e,this._names=J(e.getAttribute("class")||"")}function te(e,t){for(var i=Z(e),s=-1,o=t.length;++s<o;)i.add(t[s])}function ie(e,t){for(var i=Z(e),s=-1,o=t.length;++s<o;)i.remove(t[s])}function se(e){return function(){te(this,e)}}function oe(e){return function(){ie(this,e)}}function ne(e,t){return function(){(t.apply(this,arguments)?te:ie)(this,e)}}function re(){this.textContent=""}function ae(e){return function(){this.textContent=e}}function le(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function ue(){this.innerHTML=""}function he(e){return function(){this.innerHTML=e}}function de(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function ce(){this.nextSibling&&this.parentNode.appendChild(this)}function pe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ge(e){return function(){var t=this.ownerDocument,i=this.namespaceURI;return i===_&&t.documentElement.namespaceURI===_?t.createElement(e):t.createElementNS(i,e)}}function me(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function fe(e){var t=G(e);return(t.local?me:ge)(t)}function Ce(){return null}function ve(){var e=this.parentNode;e&&e.removeChild(this)}function we(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ye(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ee(e){return function(){var t=this.__on;if(t){for(var i,s=0,o=-1,n=t.length;s<n;++s)i=t[s],e.type&&i.type!==e.type||i.name!==e.name?t[++o]=i:this.removeEventListener(i.type,i.listener,i.options);++o?t.length=o:delete this.__on}}}function Se(e,t,i){return function(){var s,o=this.__on,n=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(o)for(var r=0,a=o.length;r<a;++r)if((s=o[r]).type===e.type&&s.name===e.name)return this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=n,s.options=i),void(s.value=t);this.addEventListener(e.type,n,i),s={type:e.type,name:e.name,value:t,listener:n,options:i},o?o.push(s):this.__on=[s]}}function be(e,t,i){var s=z(e),o=s.CustomEvent;"function"==typeof o?o=new o(t,i):(o=s.document.createEvent("Event"),i?(o.initEvent(t,i.bubbles,i.cancelable),o.detail=i.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function Re(e,t){return function(){return be(this,e,t)}}function De(e,t){return function(){return be(this,e,t.apply(this,arguments))}}ee.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var Te=[null];function Ae(e,t){this._groups=e,this._parents=t}function Pe(){return new Ae([[document.documentElement]],Te)}Ae.prototype=Pe.prototype={constructor:Ae,select:function(e){"function"!=typeof e&&(e=w(e));for(var t=this._groups,i=t.length,s=new Array(i),o=0;o<i;++o)for(var n,r,a=t[o],l=a.length,u=s[o]=new Array(l),h=0;h<l;++h)(n=a[h])&&(r=e.call(n,n.__data__,h,a))&&("__data__"in n&&(r.__data__=n.__data__),u[h]=r);return new Ae(s,this._parents)},selectAll:function(e){e="function"==typeof e?function(e){return function(){return null==(t=e.apply(this,arguments))?[]:Array.isArray(t)?t:Array.from(t);var t}}(e):E(e);for(var t=this._groups,i=t.length,s=[],o=[],n=0;n<i;++n)for(var r,a=t[n],l=a.length,u=0;u<l;++u)(r=a[u])&&(s.push(e.call(r,r.__data__,u,a)),o.push(r));return new Ae(s,o)},selectChild:function(e){return this.select(null==e?D:function(e){return function(){return R.call(this.children,e)}}("function"==typeof e?e:b(e)))},selectChildren:function(e){return this.selectAll(null==e?A:function(e){return function(){return T.call(this.children,e)}}("function"==typeof e?e:b(e)))},filter:function(e){"function"!=typeof e&&(e=S(e));for(var t=this._groups,i=t.length,s=new Array(i),o=0;o<i;++o)for(var n,r=t[o],a=r.length,l=s[o]=[],u=0;u<a;++u)(n=r[u])&&e.call(n,n.__data__,u,r)&&l.push(n);return new Ae(s,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,x);var i,s=t?L:M,o=this._parents,n=this._groups;"function"!=typeof e&&(i=e,e=function(){return i});for(var r=n.length,a=new Array(r),l=new Array(r),u=new Array(r),h=0;h<r;++h){var d=o[h],c=n[h],p=c.length,g=I(e.call(d,d&&d.__data__,h,o)),m=g.length,f=l[h]=new Array(m),C=a[h]=new Array(m);s(d,c,f,C,u[h]=new Array(p),g,t);for(var v,w,y=0,E=0;y<m;++y)if(v=f[y]){for(y>=E&&(E=y+1);!(w=C[E])&&++E<m;);v._next=w||null}}return(a=new Ae(a,o))._enter=l,a._exit=u,a},enter:function(){return new Ae(this._enter||this._groups.map(P),this._parents)},exit:function(){return new Ae(this._exit||this._groups.map(P),this._parents)},join:function(e,t,i){var s=this.enter(),o=this,n=this.exit();return"function"==typeof e?(s=e(s))&&(s=s.selection()):s=s.append(e+""),null!=t&&(o=t(o))&&(o=o.selection()),null==i?n.remove():i(n),s&&o?s.merge(o).order():o},merge:function(e){for(var t=e.selection?e.selection():e,i=this._groups,s=t._groups,o=i.length,n=s.length,r=Math.min(o,n),a=new Array(o),l=0;l<r;++l)for(var u,h=i[l],d=s[l],c=h.length,p=a[l]=new Array(c),g=0;g<c;++g)(u=h[g]||d[g])&&(p[g]=u);for(;l<o;++l)a[l]=i[l];return new Ae(a,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,i=e.length;++t<i;)for(var s,o=e[t],n=o.length-1,r=o[n];--n>=0;)(s=o[n])&&(r&&4^s.compareDocumentPosition(r)&&r.parentNode.insertBefore(s,r),r=s);return this},sort:function(e){function t(t,i){return t&&i?e(t.__data__,i.__data__):!t-!i}e||(e=N);for(var i=this._groups,s=i.length,o=new Array(s),n=0;n<s;++n){for(var r,a=i[n],l=a.length,u=o[n]=new Array(l),h=0;h<l;++h)(r=a[h])&&(u[h]=r);u.sort(t)}return new Ae(o,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,i=e.length;t<i;++t)for(var s=e[t],o=0,n=s.length;o<n;++o){var r=s[o];if(r)return r}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,i=0,s=t.length;i<s;++i)for(var o,n=t[i],r=0,a=n.length;r<a;++r)(o=n[r])&&e.call(o,o.__data__,r,n);return this},attr:function(e,t){var i=G(e);if(arguments.length<2){var s=this.node();return i.local?s.getAttributeNS(i.space,i.local):s.getAttribute(i)}return this.each((null==t?i.local?V:k:"function"==typeof t?i.local?U:W:i.local?B:H)(i,t))},style:function(e,t,i){return arguments.length>1?this.each((null==t?$:"function"==typeof t?j:K)(e,t,null==i?"":i)):Y(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?q:"function"==typeof t?Q:X)(e,t)):this.node()[e]},classed:function(e,t){var i=J(e+"");if(arguments.length<2){for(var s=Z(this.node()),o=-1,n=i.length;++o<n;)if(!s.contains(i[o]))return!1;return!0}return this.each(("function"==typeof t?ne:t?se:oe)(i,t))},text:function(e){return arguments.length?this.each(null==e?re:("function"==typeof e?le:ae)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?ue:("function"==typeof e?de:he)(e)):this.node().innerHTML},raise:function(){return this.each(ce)},lower:function(){return this.each(pe)},append:function(e){var t="function"==typeof e?e:fe(e);return this.select((function(){return this.appendChild(t.apply(this,arguments))}))},insert:function(e,t){var i="function"==typeof e?e:fe(e),s=null==t?Ce:"function"==typeof t?t:w(t);return this.select((function(){return this.insertBefore(i.apply(this,arguments),s.apply(this,arguments)||null)}))},remove:function(){return this.each(ve)},clone:function(e){return this.select(e?ye:we)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,i){var s,o,n=function(e){return e.trim().split(/^|\s+/).map((function(e){var t="",i=e.indexOf(".");return i>=0&&(t=e.slice(i+1),e=e.slice(0,i)),{type:e,name:t}}))}(e+""),r=n.length;if(!(arguments.length<2)){for(a=t?Se:Ee,s=0;s<r;++s)this.each(a(n[s],t,i));return this}var a=this.node().__on;if(a)for(var l,u=0,h=a.length;u<h;++u)for(s=0,l=a[u];s<r;++s)if((o=n[s]).type===l.type&&o.name===l.name)return l.value},dispatch:function(e,t){return this.each(("function"==typeof t?De:Re)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,i=e.length;t<i;++t)for(var s,o=e[t],n=0,r=o.length;n<r;++n)(s=o[n])&&(yield s)}};const Fe=Pe;var Me={value:()=>{}};function Le(){for(var e,t=0,i=arguments.length,s={};t<i;++t){if(!(e=arguments[t]+"")||e in s||/[\s.]/.test(e))throw new Error("illegal type: "+e);s[e]=[]}return new xe(s)}function xe(e){this._=e}function Ie(e,t){for(var i,s=0,o=e.length;s<o;++s)if((i=e[s]).name===t)return i.value}function Ne(e,t,i){for(var s=0,o=e.length;s<o;++s)if(e[s].name===t){e[s]=Me,e=e.slice(0,s).concat(e.slice(s+1));break}return null!=i&&e.push({name:t,value:i}),e}xe.prototype=Le.prototype={constructor:xe,on:function(e,t){var i,s,o=this._,n=(s=o,(e+"").trim().split(/^|\s+/).map((function(e){var t="",i=e.indexOf(".");if(i>=0&&(t=e.slice(i+1),e=e.slice(0,i)),e&&!s.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}}))),r=-1,a=n.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++r<a;)if(i=(e=n[r]).type)o[i]=Ne(o[i],e.name,t);else if(null==t)for(i in o)o[i]=Ne(o[i],e.name,null);return this}for(;++r<a;)if((i=(e=n[r]).type)&&(i=Ie(o[i],e.name)))return i},copy:function(){var e={},t=this._;for(var i in t)e[i]=t[i].slice();return new xe(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var i,s,o=new Array(i),n=0;n<i;++n)o[n]=arguments[n+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(n=0,i=(s=this._[e]).length;n<i;++n)s[n].value.apply(t,o)},apply:function(e,t,i){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],o=0,n=s.length;o<n;++o)s[o].value.apply(t,i)}};const _e=Le;var Oe,Ge,ke=0,Ve=0,He=0,Be=0,We=0,Ue=0,ze="object"==typeof performance&&performance.now?performance:Date,$e="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ke(){return We||($e(je),We=ze.now()+Ue)}function je(){We=0}function Ye(){this._call=this._time=this._next=null}function qe(e,t,i){var s=new Ye;return s.restart(e,t,i),s}function Xe(){We=(Be=ze.now())+Ue,ke=Ve=0;try{!function(){Ke(),++ke;for(var e,t=Oe;t;)(e=We-t._time)>=0&&t._call.call(void 0,e),t=t._next;--ke}()}finally{ke=0,function(){for(var e,t,i=Oe,s=1/0;i;)i._call?(s>i._time&&(s=i._time),e=i,i=i._next):(t=i._next,i._next=null,i=e?e._next=t:Oe=t);Ge=e,Je(s)}(),We=0}}function Qe(){var e=ze.now(),t=e-Be;t>1e3&&(Ue-=t,Be=e)}function Je(e){ke||(Ve&&(Ve=clearTimeout(Ve)),e-We>24?(e<1/0&&(Ve=setTimeout(Xe,e-ze.now()-Ue)),He&&(He=clearInterval(He))):(He||(Be=ze.now(),He=setInterval(Qe,1e3)),ke=1,$e(Xe)))}function Ze(e,t,i){var s=new Ye;return t=null==t?0:+t,s.restart((i=>{s.stop(),e(i+t)}),t,i),s}Ye.prototype=qe.prototype={constructor:Ye,restart:function(e,t,i){if("function"!=typeof e)throw new TypeError("callback is not a function");i=(null==i?Ke():+i)+(null==t?0:+t),this._next||Ge===this||(Ge?Ge._next=this:Oe=this,Ge=this),this._call=e,this._time=i,Je()},stop:function(){this._call&&(this._call=null,this._time=1/0,Je())}};var et=_e("start","end","cancel","interrupt"),tt=[];function it(e,t,i,s,o,n){var r=e.__transition;if(r){if(i in r)return}else e.__transition={};!function(e,t,i){var s,o=e.__transition;function n(l){var u,h,d,c;if(1!==i.state)return a();for(u in o)if((c=o[u]).name===i.name){if(3===c.state)return Ze(n);4===c.state?(c.state=6,c.timer.stop(),c.on.call("interrupt",e,e.__data__,c.index,c.group),delete o[u]):+u<t&&(c.state=6,c.timer.stop(),c.on.call("cancel",e,e.__data__,c.index,c.group),delete o[u])}if(Ze((function(){3===i.state&&(i.state=4,i.timer.restart(r,i.delay,i.time),r(l))})),i.state=2,i.on.call("start",e,e.__data__,i.index,i.group),2===i.state){for(i.state=3,s=new Array(d=i.tween.length),u=0,h=-1;u<d;++u)(c=i.tween[u].value.call(e,e.__data__,i.index,i.group))&&(s[++h]=c);s.length=h+1}}function r(t){for(var o=t<i.duration?i.ease.call(null,t/i.duration):(i.timer.restart(a),i.state=5,1),n=-1,r=s.length;++n<r;)s[n].call(e,o);5===i.state&&(i.on.call("end",e,e.__data__,i.index,i.group),a())}function a(){for(var s in i.state=6,i.timer.stop(),delete o[t],o)return;delete e.__transition}o[t]=i,i.timer=qe((function(e){i.state=1,i.timer.restart(n,i.delay,i.time),i.delay<=e&&n(e-i.delay)}),0,i.time)}(e,i,{name:t,index:s,group:o,on:et,tween:tt,time:n.time,delay:n.delay,duration:n.duration,ease:n.ease,timer:null,state:0})}function st(e,t){var i=nt(e,t);if(i.state>0)throw new Error("too late; already scheduled");return i}function ot(e,t){var i=nt(e,t);if(i.state>3)throw new Error("too late; already running");return i}function nt(e,t){var i=e.__transition;if(!i||!(i=i[t]))throw new Error("transition not found");return i}function rt(e,t){return e=+e,t=+t,function(i){return e*(1-i)+t*i}}var at,lt=180/Math.PI,ut={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ht(e,t,i,s,o,n){var r,a,l;return(r=Math.sqrt(e*e+t*t))&&(e/=r,t/=r),(l=e*i+t*s)&&(i-=e*l,s-=t*l),(a=Math.sqrt(i*i+s*s))&&(i/=a,s/=a,l/=a),e*s<t*i&&(e=-e,t=-t,l=-l,r=-r),{translateX:o,translateY:n,rotate:Math.atan2(t,e)*lt,skewX:Math.atan(l)*lt,scaleX:r,scaleY:a}}function dt(e,t,i,s){function o(e){return e.length?e.pop()+" ":""}return function(n,r){var a=[],l=[];return n=e(n),r=e(r),function(e,s,o,n,r,a){if(e!==o||s!==n){var l=r.push("translate(",null,t,null,i);a.push({i:l-4,x:rt(e,o)},{i:l-2,x:rt(s,n)})}else(o||n)&&r.push("translate("+o+t+n+i)}(n.translateX,n.translateY,r.translateX,r.translateY,a,l),function(e,t,i,n){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),n.push({i:i.push(o(i)+"rotate(",null,s)-2,x:rt(e,t)})):t&&i.push(o(i)+"rotate("+t+s)}(n.rotate,r.rotate,a,l),function(e,t,i,n){e!==t?n.push({i:i.push(o(i)+"skewX(",null,s)-2,x:rt(e,t)}):t&&i.push(o(i)+"skewX("+t+s)}(n.skewX,r.skewX,a,l),function(e,t,i,s,n,r){if(e!==i||t!==s){var a=n.push(o(n)+"scale(",null,",",null,")");r.push({i:a-4,x:rt(e,i)},{i:a-2,x:rt(t,s)})}else 1===i&&1===s||n.push(o(n)+"scale("+i+","+s+")")}(n.scaleX,n.scaleY,r.scaleX,r.scaleY,a,l),n=r=null,function(e){for(var t,i=-1,s=l.length;++i<s;)a[(t=l[i]).i]=t.x(e);return a.join("")}}}var ct=dt((function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?ut:ht(t.a,t.b,t.c,t.d,t.e,t.f)}),"px, ","px)","deg)"),pt=dt((function(e){return null==e?ut:(at||(at=document.createElementNS("http://www.w3.org/2000/svg","g")),at.setAttribute("transform",e),(e=at.transform.baseVal.consolidate())?ht((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):ut)}),", ",")",")");function gt(e,t){var i,s;return function(){var o=ot(this,e),n=o.tween;if(n!==i)for(var r=0,a=(s=i=n).length;r<a;++r)if(s[r].name===t){(s=s.slice()).splice(r,1);break}o.tween=s}}function mt(e,t,i){var s,o;if("function"!=typeof i)throw new Error;return function(){var n=ot(this,e),r=n.tween;if(r!==s){o=(s=r).slice();for(var a={name:t,value:i},l=0,u=o.length;l<u;++l)if(o[l].name===t){o[l]=a;break}l===u&&o.push(a)}n.tween=o}}function ft(e,t,i){var s=e._id;return e.each((function(){var e=ot(this,s);(e.value||(e.value={}))[t]=i.apply(this,arguments)})),function(e){return nt(e,s).value[t]}}function Ct(e,t,i){e.prototype=t.prototype=i,i.constructor=e}function vt(e,t){var i=Object.create(e.prototype);for(var s in t)i[s]=t[s];return i}function wt(){}var yt=.7,Et=1/yt,St="\\s*([+-]?\\d+)\\s*",bt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Rt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Dt=/^#([0-9a-f]{3,8})$/,Tt=new RegExp(`^rgb\\(${St},${St},${St}\\)$`),At=new RegExp(`^rgb\\(${Rt},${Rt},${Rt}\\)$`),Pt=new RegExp(`^rgba\\(${St},${St},${St},${bt}\\)$`),Ft=new RegExp(`^rgba\\(${Rt},${Rt},${Rt},${bt}\\)$`),Mt=new RegExp(`^hsl\\(${bt},${Rt},${Rt}\\)$`),Lt=new RegExp(`^hsla\\(${bt},${Rt},${Rt},${bt}\\)$`),xt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function It(){return this.rgb().formatHex()}function Nt(){return this.rgb().formatRgb()}function _t(e){var t,i;return e=(e+"").trim().toLowerCase(),(t=Dt.exec(e))?(i=t[1].length,t=parseInt(t[1],16),6===i?Ot(t):3===i?new Vt(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===i?Gt(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===i?Gt(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Tt.exec(e))?new Vt(t[1],t[2],t[3],1):(t=At.exec(e))?new Vt(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Pt.exec(e))?Gt(t[1],t[2],t[3],t[4]):(t=Ft.exec(e))?Gt(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Mt.exec(e))?$t(t[1],t[2]/100,t[3]/100,1):(t=Lt.exec(e))?$t(t[1],t[2]/100,t[3]/100,t[4]):xt.hasOwnProperty(e)?Ot(xt[e]):"transparent"===e?new Vt(NaN,NaN,NaN,0):null}function Ot(e){return new Vt(e>>16&255,e>>8&255,255&e,1)}function Gt(e,t,i,s){return s<=0&&(e=t=i=NaN),new Vt(e,t,i,s)}function kt(e,t,i,s){return 1===arguments.length?((o=e)instanceof wt||(o=_t(o)),o?new Vt((o=o.rgb()).r,o.g,o.b,o.opacity):new Vt):new Vt(e,t,i,null==s?1:s);var o}function Vt(e,t,i,s){this.r=+e,this.g=+t,this.b=+i,this.opacity=+s}function Ht(){return`#${zt(this.r)}${zt(this.g)}${zt(this.b)}`}function Bt(){const e=Wt(this.opacity);return`${1===e?"rgb(":"rgba("}${Ut(this.r)}, ${Ut(this.g)}, ${Ut(this.b)}${1===e?")":`, ${e})`}`}function Wt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ut(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function zt(e){return((e=Ut(e))<16?"0":"")+e.toString(16)}function $t(e,t,i,s){return s<=0?e=t=i=NaN:i<=0||i>=1?e=t=NaN:t<=0&&(e=NaN),new jt(e,t,i,s)}function Kt(e){if(e instanceof jt)return new jt(e.h,e.s,e.l,e.opacity);if(e instanceof wt||(e=_t(e)),!e)return new jt;if(e instanceof jt)return e;var t=(e=e.rgb()).r/255,i=e.g/255,s=e.b/255,o=Math.min(t,i,s),n=Math.max(t,i,s),r=NaN,a=n-o,l=(n+o)/2;return a?(r=t===n?(i-s)/a+6*(i<s):i===n?(s-t)/a+2:(t-i)/a+4,a/=l<.5?n+o:2-n-o,r*=60):a=l>0&&l<1?0:r,new jt(r,a,l,e.opacity)}function jt(e,t,i,s){this.h=+e,this.s=+t,this.l=+i,this.opacity=+s}function Yt(e){return(e=(e||0)%360)<0?e+360:e}function qt(e){return Math.max(0,Math.min(1,e||0))}function Xt(e,t,i){return 255*(e<60?t+(i-t)*e/60:e<180?i:e<240?t+(i-t)*(240-e)/60:t)}function Qt(e,t,i,s,o){var n=e*e,r=n*e;return((1-3*e+3*n-r)*t+(4-6*n+3*r)*i+(1+3*e+3*n-3*r)*s+r*o)/6}Ct(wt,_t,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:It,formatHex:It,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Kt(this).formatHsl()},formatRgb:Nt,toString:Nt}),Ct(Vt,kt,vt(wt,{brighter(e){return e=null==e?Et:Math.pow(Et,e),new Vt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?yt:Math.pow(yt,e),new Vt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Vt(Ut(this.r),Ut(this.g),Ut(this.b),Wt(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ht,formatHex:Ht,formatHex8:function(){return`#${zt(this.r)}${zt(this.g)}${zt(this.b)}${zt(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Bt,toString:Bt})),Ct(jt,(function(e,t,i,s){return 1===arguments.length?Kt(e):new jt(e,t,i,null==s?1:s)}),vt(wt,{brighter(e){return e=null==e?Et:Math.pow(Et,e),new jt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?yt:Math.pow(yt,e),new jt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,i=this.l,s=i+(i<.5?i:1-i)*t,o=2*i-s;return new Vt(Xt(e>=240?e-240:e+120,o,s),Xt(e,o,s),Xt(e<120?e+240:e-120,o,s),this.opacity)},clamp(){return new jt(Yt(this.h),qt(this.s),qt(this.l),Wt(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Wt(this.opacity);return`${1===e?"hsl(":"hsla("}${Yt(this.h)}, ${100*qt(this.s)}%, ${100*qt(this.l)}%${1===e?")":`, ${e})`}`}}));const Jt=e=>()=>e;function Zt(e,t){var i=t-e;return i?function(e,t){return function(i){return e+i*t}}(e,i):Jt(isNaN(e)?t:e)}const ei=function e(t){var i=function(e){return 1==(e=+e)?Zt:function(t,i){return i-t?function(e,t,i){return e=Math.pow(e,i),t=Math.pow(t,i)-e,i=1/i,function(s){return Math.pow(e+s*t,i)}}(t,i,e):Jt(isNaN(t)?i:t)}}(t);function s(e,t){var s=i((e=kt(e)).r,(t=kt(t)).r),o=i(e.g,t.g),n=i(e.b,t.b),r=Zt(e.opacity,t.opacity);return function(t){return e.r=s(t),e.g=o(t),e.b=n(t),e.opacity=r(t),e+""}}return s.gamma=e,s}(1);function ti(e){return function(t){var i,s,o=t.length,n=new Array(o),r=new Array(o),a=new Array(o);for(i=0;i<o;++i)s=kt(t[i]),n[i]=s.r||0,r[i]=s.g||0,a[i]=s.b||0;return n=e(n),r=e(r),a=e(a),s.opacity=1,function(e){return s.r=n(e),s.g=r(e),s.b=a(e),s+""}}}ti((function(e){var t=e.length-1;return function(i){var s=i<=0?i=0:i>=1?(i=1,t-1):Math.floor(i*t),o=e[s],n=e[s+1],r=s>0?e[s-1]:2*o-n,a=s<t-1?e[s+2]:2*n-o;return Qt((i-s/t)*t,r,o,n,a)}})),ti((function(e){var t=e.length;return function(i){var s=Math.floor(((i%=1)<0?++i:i)*t),o=e[(s+t-1)%t],n=e[s%t],r=e[(s+1)%t],a=e[(s+2)%t];return Qt((i-s/t)*t,o,n,r,a)}}));var ii=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,si=new RegExp(ii.source,"g");function oi(e,t){var i,s,o,n=ii.lastIndex=si.lastIndex=0,r=-1,a=[],l=[];for(e+="",t+="";(i=ii.exec(e))&&(s=si.exec(t));)(o=s.index)>n&&(o=t.slice(n,o),a[r]?a[r]+=o:a[++r]=o),(i=i[0])===(s=s[0])?a[r]?a[r]+=s:a[++r]=s:(a[++r]=null,l.push({i:r,x:rt(i,s)})),n=si.lastIndex;return n<t.length&&(o=t.slice(n),a[r]?a[r]+=o:a[++r]=o),a.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var i,s=0;s<t;++s)a[(i=l[s]).i]=i.x(e);return a.join("")})}function ni(e,t){var i;return("number"==typeof t?rt:t instanceof _t?ei:(i=_t(t))?(t=i,ei):oi)(e,t)}function ri(e){return function(){this.removeAttribute(e)}}function ai(e){return function(){this.removeAttributeNS(e.space,e.local)}}function li(e,t,i){var s,o,n=i+"";return function(){var r=this.getAttribute(e);return r===n?null:r===s?o:o=t(s=r,i)}}function ui(e,t,i){var s,o,n=i+"";return function(){var r=this.getAttributeNS(e.space,e.local);return r===n?null:r===s?o:o=t(s=r,i)}}function hi(e,t,i){var s,o,n;return function(){var r,a,l=i(this);if(null!=l)return(r=this.getAttribute(e))===(a=l+"")?null:r===s&&a===o?n:(o=a,n=t(s=r,l));this.removeAttribute(e)}}function di(e,t,i){var s,o,n;return function(){var r,a,l=i(this);if(null!=l)return(r=this.getAttributeNS(e.space,e.local))===(a=l+"")?null:r===s&&a===o?n:(o=a,n=t(s=r,l));this.removeAttributeNS(e.space,e.local)}}function ci(e,t){var i,s;function o(){var o=t.apply(this,arguments);return o!==s&&(i=(s=o)&&function(e,t){return function(i){this.setAttributeNS(e.space,e.local,t.call(this,i))}}(e,o)),i}return o._value=t,o}function pi(e,t){var i,s;function o(){var o=t.apply(this,arguments);return o!==s&&(i=(s=o)&&function(e,t){return function(i){this.setAttribute(e,t.call(this,i))}}(e,o)),i}return o._value=t,o}function gi(e,t){return function(){st(this,e).delay=+t.apply(this,arguments)}}function mi(e,t){return t=+t,function(){st(this,e).delay=t}}function fi(e,t){return function(){ot(this,e).duration=+t.apply(this,arguments)}}function Ci(e,t){return t=+t,function(){ot(this,e).duration=t}}var vi=Fe.prototype.constructor;function wi(e){return function(){this.style.removeProperty(e)}}var yi=0;function Ei(e,t,i,s){this._groups=e,this._parents=t,this._name=i,this._id=s}function Si(){return++yi}var bi=Fe.prototype;Ei.prototype=function(e){return Fe().transition(e)}.prototype={constructor:Ei,select:function(e){var t=this._name,i=this._id;"function"!=typeof e&&(e=w(e));for(var s=this._groups,o=s.length,n=new Array(o),r=0;r<o;++r)for(var a,l,u=s[r],h=u.length,d=n[r]=new Array(h),c=0;c<h;++c)(a=u[c])&&(l=e.call(a,a.__data__,c,u))&&("__data__"in a&&(l.__data__=a.__data__),d[c]=l,it(d[c],t,i,c,d,nt(a,i)));return new Ei(n,this._parents,t,i)},selectAll:function(e){var t=this._name,i=this._id;"function"!=typeof e&&(e=E(e));for(var s=this._groups,o=s.length,n=[],r=[],a=0;a<o;++a)for(var l,u=s[a],h=u.length,d=0;d<h;++d)if(l=u[d]){for(var c,p=e.call(l,l.__data__,d,u),g=nt(l,i),m=0,f=p.length;m<f;++m)(c=p[m])&&it(c,t,i,m,p,g);n.push(p),r.push(l)}return new Ei(n,r,t,i)},selectChild:bi.selectChild,selectChildren:bi.selectChildren,filter:function(e){"function"!=typeof e&&(e=S(e));for(var t=this._groups,i=t.length,s=new Array(i),o=0;o<i;++o)for(var n,r=t[o],a=r.length,l=s[o]=[],u=0;u<a;++u)(n=r[u])&&e.call(n,n.__data__,u,r)&&l.push(n);return new Ei(s,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,i=e._groups,s=t.length,o=i.length,n=Math.min(s,o),r=new Array(s),a=0;a<n;++a)for(var l,u=t[a],h=i[a],d=u.length,c=r[a]=new Array(d),p=0;p<d;++p)(l=u[p]||h[p])&&(c[p]=l);for(;a<s;++a)r[a]=t[a];return new Ei(r,this._parents,this._name,this._id)},selection:function(){return new vi(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,i=Si(),s=this._groups,o=s.length,n=0;n<o;++n)for(var r,a=s[n],l=a.length,u=0;u<l;++u)if(r=a[u]){var h=nt(r,t);it(r,e,i,u,a,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new Ei(s,this._parents,e,i)},call:bi.call,nodes:bi.nodes,node:bi.node,size:bi.size,empty:bi.empty,each:bi.each,on:function(e,t){var i=this._id;return arguments.length<2?nt(this.node(),i).on.on(e):this.each(function(e,t,i){var s,o,n=function(e){return(e+"").trim().split(/^|\s+/).every((function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e}))}(t)?st:ot;return function(){var r=n(this,e),a=r.on;a!==s&&(o=(s=a).copy()).on(t,i),r.on=o}}(i,e,t))},attr:function(e,t){var i=G(e),s="transform"===i?pt:ni;return this.attrTween(e,"function"==typeof t?(i.local?di:hi)(i,s,ft(this,"attr."+e,t)):null==t?(i.local?ai:ri)(i):(i.local?ui:li)(i,s,t))},attrTween:function(e,t){var i="attr."+e;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==t)return this.tween(i,null);if("function"!=typeof t)throw new Error;var s=G(e);return this.tween(i,(s.local?ci:pi)(s,t))},style:function(e,t,i){var s="transform"==(e+="")?ct:ni;return null==t?this.styleTween(e,function(e,t){var i,s,o;return function(){var n=Y(this,e),r=(this.style.removeProperty(e),Y(this,e));return n===r?null:n===i&&r===s?o:o=t(i=n,s=r)}}(e,s)).on("end.style."+e,wi(e)):"function"==typeof t?this.styleTween(e,function(e,t,i){var s,o,n;return function(){var r=Y(this,e),a=i(this),l=a+"";return null==a&&(this.style.removeProperty(e),l=a=Y(this,e)),r===l?null:r===s&&l===o?n:(o=l,n=t(s=r,a))}}(e,s,ft(this,"style."+e,t))).each(function(e,t){var i,s,o,n,r="style."+t,a="end."+r;return function(){var l=ot(this,e),u=l.on,h=null==l.value[r]?n||(n=wi(t)):void 0;u===i&&o===h||(s=(i=u).copy()).on(a,o=h),l.on=s}}(this._id,e)):this.styleTween(e,function(e,t,i){var s,o,n=i+"";return function(){var r=Y(this,e);return r===n?null:r===s?o:o=t(s=r,i)}}(e,s,t),i).on("end.style."+e,null)},styleTween:function(e,t,i){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(null==t)return this.tween(s,null);if("function"!=typeof t)throw new Error;return this.tween(s,function(e,t,i){var s,o;function n(){var n=t.apply(this,arguments);return n!==o&&(s=(o=n)&&function(e,t,i){return function(s){this.style.setProperty(e,t.call(this,s),i)}}(e,n,i)),s}return n._value=t,n}(e,t,null==i?"":i))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(ft(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function(e){var t,i;function s(){var s=e.apply(this,arguments);return s!==i&&(t=(i=s)&&function(e){return function(t){this.textContent=e.call(this,t)}}(s)),t}return s._value=e,s}(e))},remove:function(){return this.on("end.remove",function(e){return function(){var t=this.parentNode;for(var i in this.__transition)if(+i!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function(e,t){var i=this._id;if(e+="",arguments.length<2){for(var s,o=nt(this.node(),i).tween,n=0,r=o.length;n<r;++n)if((s=o[n]).name===e)return s.value;return null}return this.each((null==t?gt:mt)(i,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?gi:mi)(t,e)):nt(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?fi:Ci)(t,e)):nt(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw new Error;return function(){ot(this,e).ease=t}}(t,e)):nt(this.node(),t).ease},easeVarying:function(e){if("function"!=typeof e)throw new Error;return this.each(function(e,t){return function(){var i=t.apply(this,arguments);if("function"!=typeof i)throw new Error;ot(this,e).ease=i}}(this._id,e))},end:function(){var e,t,i=this,s=i._id,o=i.size();return new Promise((function(n,r){var a={value:r},l={value:function(){0==--o&&n()}};i.each((function(){var i=ot(this,s),o=i.on;o!==e&&((t=(e=o).copy())._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),i.on=t})),0===o&&n()}))},[Symbol.iterator]:bi[Symbol.iterator]};var Ri={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};function Di(e,t){for(var i;!(i=e.__transition)||!(i=i[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return i}Fe.prototype.interrupt=function(e){return this.each((function(){!function(e,t){var i,s,o,n=e.__transition,r=!0;if(n){for(o in t=null==t?null:t+"",n)(i=n[o]).name===t?(s=i.state>2&&i.state<5,i.state=6,i.timer.stop(),i.on.call(s?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete n[o]):r=!1;r&&delete e.__transition}}(this,e)}))},Fe.prototype.transition=function(e){var t,i;e instanceof Ei?(t=e._id,e=e._name):(t=Si(),(i=Ri).time=Ke(),e=null==e?null:e+"");for(var s=this._groups,o=s.length,n=0;n<o;++n)for(var r,a=s[n],l=a.length,u=0;u<l;++u)(r=a[u])&&it(r,e,t,u,a,i||Di(r,t));return new Ei(s,this._parents,e,t)};const{abs:Ti,max:Ai,min:Pi}=Math;function Fi(e){return{type:e}}function Mi(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}["w","e"].map(Fi),["n","s"].map(Fi),["n","w","e","s","nw","ne","sw","se"].map(Fi);class Li extends Map{constructor(e,t=Ii){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[t,i]of e)this.set(t,i)}get(e){return super.get(xi(this,e))}has(e){return super.has(xi(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},i){const s=t(i);return e.has(s)?e.get(s):(e.set(s,i),i)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},i){const s=t(i);return e.has(s)&&(i=e.get(s),e.delete(s)),i}(this,e))}}function xi({_intern:e,_key:t},i){const s=t(i);return e.has(s)?e.get(s):i}function Ii(e){return null!==e&&"object"==typeof e?e.valueOf():e}Set;const Ni=Symbol("implicit");function _i(){var e=new Li,t=[],i=[],s=Ni;function o(o){let n=e.get(o);if(void 0===n){if(s!==Ni)return s;e.set(o,n=t.push(o)-1)}return i[n%i.length]}return o.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new Li;for(const s of i)e.has(s)||e.set(s,t.push(s)-1);return o},o.range=function(e){return arguments.length?(i=Array.from(e),o):i.slice()},o.unknown=function(e){return arguments.length?(s=e,o):s},o.copy=function(){return _i(t,i).unknown(s)},Mi.apply(o,arguments),o}function Oi(){var e,t,i=_i().unknown(void 0),s=i.domain,o=i.range,n=0,r=1,a=!1,l=0,u=0,h=.5;function d(){var i=s().length,d=r<n,c=d?r:n,p=d?n:r;e=(p-c)/Math.max(1,i-l+2*u),a&&(e=Math.floor(e)),c+=(p-c-e*(i-l))*h,t=e*(1-l),a&&(c=Math.round(c),t=Math.round(t));var g=function(e,t,i){e=+e,t=+t,i=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+i;for(var s=-1,o=0|Math.max(0,Math.ceil((t-e)/i)),n=new Array(o);++s<o;)n[s]=e+s*i;return n}(i).map((function(t){return c+e*t}));return o(d?g.reverse():g)}return delete i.unknown,i.domain=function(e){return arguments.length?(s(e),d()):s()},i.range=function(e){return arguments.length?([n,r]=e,n=+n,r=+r,d()):[n,r]},i.rangeRound=function(e){return[n,r]=e,n=+n,r=+r,a=!0,d()},i.bandwidth=function(){return t},i.step=function(){return e},i.round=function(e){return arguments.length?(a=!!e,d()):a},i.padding=function(e){return arguments.length?(l=Math.min(1,u=+e),d()):l},i.paddingInner=function(e){return arguments.length?(l=Math.min(1,e),d()):l},i.paddingOuter=function(e){return arguments.length?(u=+e,d()):u},i.align=function(e){return arguments.length?(h=Math.max(0,Math.min(1,e)),d()):h},i.copy=function(){return Oi(s(),[n,r]).round(a).paddingInner(l).paddingOuter(u).align(h)},Mi.apply(d(),arguments)}const Gi=Math.sqrt(50),ki=Math.sqrt(10),Vi=Math.sqrt(2);function Hi(e,t,i){const s=(t-e)/Math.max(0,i),o=Math.floor(Math.log10(s)),n=s/Math.pow(10,o),r=n>=Gi?10:n>=ki?5:n>=Vi?2:1;let a,l,u;return o<0?(u=Math.pow(10,-o)/r,a=Math.round(e*u),l=Math.round(t*u),a/u<e&&++a,l/u>t&&--l,u=-u):(u=Math.pow(10,o)*r,a=Math.round(e/u),l=Math.round(t/u),a*u<e&&++a,l*u>t&&--l),l<a&&.5<=i&&i<2?Hi(e,t,2*i):[a,l,u]}function Bi(e,t,i){return Hi(e=+e,t=+t,i=+i)[2]}function Wi(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Ui(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function zi(e){let t,i,s;function o(e,s,o=0,n=e.length){if(o<n){if(0!==t(s,s))return n;do{const t=o+n>>>1;i(e[t],s)<0?o=t+1:n=t}while(o<n)}return o}return 2!==e.length?(t=Wi,i=(t,i)=>Wi(e(t),i),s=(t,i)=>e(t)-i):(t=e===Wi||e===Ui?e:$i,i=e,s=e),{left:o,center:function(e,t,i=0,n=e.length){const r=o(e,t,i,n-1);return r>i&&s(e[r-1],t)>-s(e[r],t)?r-1:r},right:function(e,s,o=0,n=e.length){if(o<n){if(0!==t(s,s))return n;do{const t=o+n>>>1;i(e[t],s)<=0?o=t+1:n=t}while(o<n)}return o}}}function $i(){return 0}const Ki=zi(Wi),ji=Ki.right,Yi=(Ki.left,zi((function(e){return null===e?NaN:+e})).center,ji);function qi(e,t){var i,s=t?t.length:0,o=e?Math.min(s,e.length):0,n=new Array(o),r=new Array(s);for(i=0;i<o;++i)n[i]=Zi(e[i],t[i]);for(;i<s;++i)r[i]=t[i];return function(e){for(i=0;i<o;++i)r[i]=n[i](e);return r}}function Xi(e,t){var i=new Date;return e=+e,t=+t,function(s){return i.setTime(e*(1-s)+t*s),i}}function Qi(e,t){var i,s={},o={};for(i in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)i in e?s[i]=Zi(e[i],t[i]):o[i]=t[i];return function(e){for(i in s)o[i]=s[i](e);return o}}function Ji(e,t){t||(t=[]);var i,s=e?Math.min(t.length,e.length):0,o=t.slice();return function(n){for(i=0;i<s;++i)o[i]=e[i]*(1-n)+t[i]*n;return o}}function Zi(e,t){var i,s,o=typeof t;return null==t||"boolean"===o?Jt(t):("number"===o?rt:"string"===o?(i=_t(t))?(t=i,ei):oi:t instanceof _t?ei:t instanceof Date?Xi:(s=t,!ArrayBuffer.isView(s)||s instanceof DataView?Array.isArray(t)?qi:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Qi:rt:Ji))(e,t)}function es(e,t){return e=+e,t=+t,function(i){return Math.round(e*(1-i)+t*i)}}function ts(e){return+e}var is=[0,1];function ss(e){return e}function os(e,t){return(t-=e=+e)?function(i){return(i-e)/t}:(i=isNaN(t)?NaN:.5,function(){return i});var i}function ns(e,t,i){var s=e[0],o=e[1],n=t[0],r=t[1];return o<s?(s=os(o,s),n=i(r,n)):(s=os(s,o),n=i(n,r)),function(e){return n(s(e))}}function rs(e,t,i){var s=Math.min(e.length,t.length)-1,o=new Array(s),n=new Array(s),r=-1;for(e[s]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++r<s;)o[r]=os(e[r],e[r+1]),n[r]=i(t[r],t[r+1]);return function(t){var i=Yi(e,t,1,s)-1;return n[i](o[i](t))}}var as,ls=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function us(e){if(!(t=ls.exec(e)))throw new Error("invalid format: "+e);var t;return new hs({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function hs(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function ds(e,t){if((i=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var i,s=e.slice(0,i);return[s.length>1?s[0]+s.slice(2):s,+e.slice(i+1)]}function cs(e){return(e=ds(Math.abs(e)))?e[1]:NaN}function ps(e,t){var i=ds(e,t);if(!i)return e+"";var s=i[0],o=i[1];return o<0?"0."+new Array(-o).join("0")+s:s.length>o+1?s.slice(0,o+1)+"."+s.slice(o+1):s+new Array(o-s.length+2).join("0")}us.prototype=hs.prototype,hs.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const gs={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>ps(100*e,t),r:ps,s:function(e,t){var i=ds(e,t);if(!i)return e+"";var s=i[0],o=i[1],n=o-(as=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,r=s.length;return n===r?s:n>r?s+new Array(n-r+1).join("0"):n>0?s.slice(0,n)+"."+s.slice(n):"0."+new Array(1-n).join("0")+ds(e,Math.max(0,t+n-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function ms(e){return e}var fs,Cs,vs,ws=Array.prototype.map,ys=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Es(e){var t=e.domain;return e.ticks=function(e){var i=t();return function(e,t,i){if(!((i=+i)>0))return[];if((e=+e)==(t=+t))return[e];const s=t<e,[o,n,r]=s?Hi(t,e,i):Hi(e,t,i);if(!(n>=o))return[];const a=n-o+1,l=new Array(a);if(s)if(r<0)for(let e=0;e<a;++e)l[e]=(n-e)/-r;else for(let e=0;e<a;++e)l[e]=(n-e)*r;else if(r<0)for(let e=0;e<a;++e)l[e]=(o+e)/-r;else for(let e=0;e<a;++e)l[e]=(o+e)*r;return l}(i[0],i[i.length-1],null==e?10:e)},e.tickFormat=function(e,i){var s=t();return function(e,t,i,s){var o,n=function(e,t,i){i=+i;const s=(t=+t)<(e=+e),o=s?Bi(t,e,i):Bi(e,t,i);return(s?-1:1)*(o<0?1/-o:o)}(e,t,i);switch((s=us(null==s?",f":s)).type){case"s":var r=Math.max(Math.abs(e),Math.abs(t));return null!=s.precision||isNaN(o=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(cs(t)/3)))-cs(Math.abs(e)))}(n,r))||(s.precision=o),vs(s,r);case"":case"e":case"g":case"p":case"r":null!=s.precision||isNaN(o=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,cs(t)-cs(e))+1}(n,Math.max(Math.abs(e),Math.abs(t))))||(s.precision=o-("e"===s.type));break;case"f":case"%":null!=s.precision||isNaN(o=function(e){return Math.max(0,-cs(Math.abs(e)))}(n))||(s.precision=o-2*("%"===s.type))}return Cs(s)}(s[0],s[s.length-1],null==e?10:e,i)},e.nice=function(i){null==i&&(i=10);var s,o,n=t(),r=0,a=n.length-1,l=n[r],u=n[a],h=10;for(u<l&&(o=l,l=u,u=o,o=r,r=a,a=o);h-- >0;){if((o=Bi(l,u,i))===s)return n[r]=l,n[a]=u,t(n);if(o>0)l=Math.floor(l/o)*o,u=Math.ceil(u/o)*o;else{if(!(o<0))break;l=Math.ceil(l*o)/o,u=Math.floor(u*o)/o}s=o}return e},e}function Ss(){var e=function(){var e,t,i,s,o,n,r=is,a=is,l=Zi,u=ss;function h(){var e,t,i,l=Math.min(r.length,a.length);return u!==ss&&(e=r[0],t=r[l-1],e>t&&(i=e,e=t,t=i),u=function(i){return Math.max(e,Math.min(t,i))}),s=l>2?rs:ns,o=n=null,d}function d(t){return null==t||isNaN(t=+t)?i:(o||(o=s(r.map(e),a,l)))(e(u(t)))}return d.invert=function(i){return u(t((n||(n=s(a,r.map(e),rt)))(i)))},d.domain=function(e){return arguments.length?(r=Array.from(e,ts),h()):r.slice()},d.range=function(e){return arguments.length?(a=Array.from(e),h()):a.slice()},d.rangeRound=function(e){return a=Array.from(e),l=es,h()},d.clamp=function(e){return arguments.length?(u=!!e||ss,h()):u!==ss},d.interpolate=function(e){return arguments.length?(l=e,h()):l},d.unknown=function(e){return arguments.length?(i=e,d):i},function(i,s){return e=i,t=s,h()}}()(ss,ss);return e.copy=function(){return t=e,Ss().domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());var t},Mi.apply(e,arguments),Es(e)}function bs(e){return"string"==typeof e?new Ae([[document.querySelector(e)]],[document.documentElement]):new Ae([[e]],Te)}function Rs(e,t,i){this.k=e,this.x=t,this.y=i}fs=function(e){var t,i,s=void 0===e.grouping||void 0===e.thousands?ms:(t=ws.call(e.grouping,Number),i=e.thousands+"",function(e,s){for(var o=e.length,n=[],r=0,a=t[0],l=0;o>0&&a>0&&(l+a+1>s&&(a=Math.max(1,s-l)),n.push(e.substring(o-=a,o+a)),!((l+=a+1)>s));)a=t[r=(r+1)%t.length];return n.reverse().join(i)}),o=void 0===e.currency?"":e.currency[0]+"",n=void 0===e.currency?"":e.currency[1]+"",r=void 0===e.decimal?".":e.decimal+"",a=void 0===e.numerals?ms:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(ws.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",u=void 0===e.minus?"":e.minus+"",h=void 0===e.nan?"NaN":e.nan+"";function d(e){var t=(e=us(e)).fill,i=e.align,d=e.sign,c=e.symbol,p=e.zero,g=e.width,m=e.comma,f=e.precision,C=e.trim,v=e.type;"n"===v?(m=!0,v="g"):gs[v]||(void 0===f&&(f=12),C=!0,v="g"),(p||"0"===t&&"="===i)&&(p=!0,t="0",i="=");var w="$"===c?o:"#"===c&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",y="$"===c?n:/[%p]/.test(v)?l:"",E=gs[v],S=/[defgprs%]/.test(v);function b(e){var o,n,l,c=w,b=y;if("c"===v)b=E(e)+b,e="";else{var R=(e=+e)<0||1/e<0;if(e=isNaN(e)?h:E(Math.abs(e),f),C&&(e=function(e){e:for(var t,i=e.length,s=1,o=-1;s<i;++s)switch(e[s]){case".":o=t=s;break;case"0":0===o&&(o=s),t=s;break;default:if(!+e[s])break e;o>0&&(o=0)}return o>0?e.slice(0,o)+e.slice(t+1):e}(e)),R&&0==+e&&"+"!==d&&(R=!1),c=(R?"("===d?d:u:"-"===d||"("===d?"":d)+c,b=("s"===v?ys[8+as/3]:"")+b+(R&&"("===d?")":""),S)for(o=-1,n=e.length;++o<n;)if(48>(l=e.charCodeAt(o))||l>57){b=(46===l?r+e.slice(o+1):e.slice(o))+b,e=e.slice(0,o);break}}m&&!p&&(e=s(e,1/0));var D=c.length+e.length+b.length,T=D<g?new Array(g-D+1).join(t):"";switch(m&&p&&(e=s(T+e,T.length?g-b.length:1/0),T=""),i){case"<":e=c+e+b+T;break;case"=":e=c+T+e+b;break;case"^":e=T.slice(0,D=T.length>>1)+c+e+b+T.slice(D);break;default:e=T+c+e+b}return a(e)}return f=void 0===f?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,f)):Math.max(0,Math.min(20,f)),b.toString=function(){return e+""},b}return{format:d,formatPrefix:function(e,t){var i=d(((e=us(e)).type="f",e)),s=3*Math.max(-8,Math.min(8,Math.floor(cs(t)/3))),o=Math.pow(10,-s),n=ys[8+s/3];return function(e){return i(o*e)+n}}}}({thousands:",",grouping:[3],currency:["$",""]}),Cs=fs.format,vs=fs.formatPrefix,Rs.prototype={constructor:Rs,scale:function(e){return 1===e?this:new Rs(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new Rs(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},new Rs(1,0,0),Rs.prototype;const Ds=({chartData:e=[],height:t="400px",width:i="100%",valueColumn:s="Value",labelsColumn:n="Label",colorColumn:r="Color",popoverColumn:h="Content",defaultBarColor:d="#4CAF50"})=>{const c=(0,l.useRef)(null),[p,g]=(0,l.useState)(null);return(0,l.useEffect)((()=>{if(!Array.isArray(e)||0===e.length||!c.current)return;const i=e[0];if(Object.keys(i).length<2)return;bs(c.current).selectAll("*").remove();const o=c.current.clientWidth,a=parseInt(t)||400,l=o-60-30,p=a-30-70,m=bs(c.current).append("svg").attr("width",o).attr("height",a).append("g").attr("transform","translate(60,30)"),f=Oi().range([0,l]).domain(e.map((e=>String(e[n])))).padding(.2);var v;m.append("g").attr("transform",`translate(0,${p})`).call((v=f,C(3,v))).selectAll("text").attr("transform","translate(-10,0)rotate(-45)").style("text-anchor","end"),m.append("text").attr("text-anchor","middle").attr("x",l/2).attr("y",p+70-10).text(n);const w=Ss().domain([0,u(e,(e=>{const t=Number(e[s]);return isNaN(t)?0:t}))]).range([p,0]);m.append("g").call(function(e){return C(4,e)}(w)),m.append("text").attr("text-anchor","middle").attr("transform","rotate(-90)").attr("y",-40).attr("x",-p/2).text(s),m.selectAll("rect").data(e).join("rect").attr("x",(e=>f(String(e[n])))).attr("y",(e=>{const t=Number(e[s]);return w(isNaN(t)?0:t)})).attr("width",f.bandwidth()).attr("height",(e=>{const t=Number(e[s]);return p-w(isNaN(t)?0:t)})).attr("fill",(e=>r&&e[r]?e[r]:d)).on("mouseover",(function(e,t){if(bs(this).transition().duration(200).attr("opacity",.8),m.append("text").attr("class","value-label").attr("x",f(String(t[n]))+f.bandwidth()/2).attr("y",w(Number(t[s]))-5).attr("text-anchor","middle").text(t[s]),h&&t[h]){const e=this.getBoundingClientRect();g({content:t[h],position:{top:e.top+window.scrollY,left:e.left+e.width/2+window.scrollX}})}})).on("mouseout",(function(){bs(this).transition().duration(200).attr("opacity",1),m.selectAll(".value-label").remove(),g(null)}))}),[e,t,i,s,n,r,h,d]),(0,o.createElement)("div",{style:{position:"relative"}},(0,o.createElement)("div",{className:"d3-container",ref:c,style:{width:i,height:t,backgroundColor:"#ffffff"}}),p&&(0,o.createElement)(a.Popover,{position:"top",focusOnMount:!1,onClose:()=>g(null),anchorRect:{top:p.position.top,left:p.position.left,bottom:p.position.top,right:p.position.left,width:0,height:0}},(0,o.createElement)("div",{style:{padding:"12px"},dangerouslySetInnerHTML:{__html:p.content}})))};var Ts=Object.defineProperty,As=Object.defineProperties,Ps=Object.getOwnPropertyDescriptor,Fs=Object.getOwnPropertyDescriptors,Ms=Object.getOwnPropertySymbols,Ls=Object.prototype.hasOwnProperty,xs=Object.prototype.propertyIsEnumerable,Is=(e,t,i)=>t in e?Ts(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Ns=(e,t)=>{for(var i in t||(t={}))Ls.call(t,i)&&Is(e,i,t[i]);if(Ms)for(var i of Ms(t))xs.call(t,i)&&Is(e,i,t[i]);return e},_s=(e,t)=>As(e,Fs(t)),Os=(e,t)=>{for(var i in t)Ts(e,i,{get:t[i],enumerable:!0})},Gs=(e,t,i,s)=>{for(var o,n=s>1?void 0:s?Ps(t,i):t,r=e.length-1;r>=0;r--)(o=e[r])&&(n=(s?o(t,i,n):o(n))||n);return s&&n&&Ts(t,i,n),n},ks=(e,t)=>(i,s)=>t(i,s,e),Vs={};function Hs(e){return null==e||""===e?null:e}function Bs(e,t=!1){return null!=e&&(""!==e||t)}function Ws(e){return!Bs(e)}function Us(e){return null==e||0===e.length}function zs(e){return null!=e&&"function"==typeof e.toString?e.toString():null}function $s(e){if(void 0===e)return;if(null===e||""===e)return null;if("number"==typeof e)return isNaN(e)?void 0:e;const t=parseInt(e,10);return isNaN(t)?void 0:t}function Ks(e){if(void 0!==e)return null!==e&&""!==e&&("boolean"==typeof e?e:/true/i.test(e))}function js(e){if(null!=e&&""!==e)return e}function Ys(e,t){return(e?JSON.stringify(e):null)===(t?JSON.stringify(t):null)}function qs(e,t,i=!1){const s=null==e,o=null==t;if(e&&e.toNumber&&(e=e.toNumber()),t&&t.toNumber&&(t=t.toNumber()),s&&o)return 0;if(s)return-1;if(o)return 1;function n(e,t){return e>t?1:e<t?-1:0}if("string"!=typeof e)return n(e,t);if(!i)return n(e,t);try{return e.localeCompare(t)}catch(i){return n(e,t)}}function Xs(e){if(e instanceof Set||e instanceof Map){const t=[];return e.forEach((e=>t.push(e))),t}return Object.values(e)}Os(Vs,{attrToBoolean:()=>Ks,attrToNumber:()=>$s,attrToString:()=>js,defaultComparator:()=>qs,exists:()=>Bs,jsonEquals:()=>Ys,makeNull:()=>Hs,missing:()=>Ws,missingOrEmpty:()=>Us,toStringOrNull:()=>zs,values:()=>Xs});var Qs=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=zs(e);let i=0;for(;;){let s;if(e?(s=e,0!==i&&(s+="_"+i)):t?(s=t,0!==i&&(s+="_"+i)):s=i,!this.existingKeys[s])return this.existingKeys[s]=!0,String(s);i++}}},Js={};Os(Js,{SKIP_JS_BUILTINS:()=>Zs,cloneObject:()=>to,deepCloneDefinition:()=>io,getAllValuesInObject:()=>so,getValueUsingField:()=>no,isNonNullObject:()=>ao,iterateObject:()=>eo,mergeDeep:()=>oo,removeAllReferences:()=>ro});var Zs=new Set(["__proto__","constructor","prototype"]);function eo(e,t){if(null!=e)if(Array.isArray(e))for(let i=0;i<e.length;i++)t(i.toString(),e[i]);else for(const[i,s]of Object.entries(e))t(i,s)}function to(e){const t={},i=Object.keys(e);for(let s=0;s<i.length;s++){if(Zs.has(i[s]))continue;const o=i[s],n=e[o];t[o]=n}return t}function io(e,t){if(!e)return;const i=e,s={};return Object.keys(i).forEach((e=>{if(t&&t.indexOf(e)>=0||Zs.has(e))return;const o=i[e],n=ao(o)&&o.constructor===Object;s[e]=n?io(o):o})),s}function so(e){if(!e)return[];const t=Object;if("function"==typeof t.values)return t.values(e);const i=[];for(const t in e)e.hasOwnProperty(t)&&e.propertyIsEnumerable(t)&&i.push(e[t]);return i}function oo(e,t,i=!0,s=!1){Bs(t)&&eo(t,((t,o)=>{if(Zs.has(t))return;let n=e[t];n!==o&&(s&&null==n&&null!=o&&"object"==typeof o&&o.constructor===Object&&(n={},e[t]=n),ao(o)&&ao(n)&&!Array.isArray(n)?oo(n,o,i,s):(i||void 0!==o)&&(e[t]=o))}))}function no(e,t,i){if(!t||!e)return;if(!i)return e[t];const s=t.split(".");let o=e;for(let e=0;e<s.length;e++){if(null==o)return;o=o[s[e]]}return o}function ro(e,t=[],i){Object.keys(e).forEach((i=>{"object"!=typeof e[i]||t.includes(i)||(e[i]=void 0)}));const s=Object.getPrototypeOf(e),o={};Object.getOwnPropertyNames(s).forEach((e=>{if("function"==typeof s[e]&&!t.includes(e)){const t=()=>{console.warn((e=>`AG Grid: Grid API function ${e}() cannot be called as the grid has been destroyed.\n It is recommended to remove local references to the grid api. Alternatively, check gridApi.isDestroyed() to avoid calling methods against a destroyed grid.\n To run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${i}`)(e))};o[e]={value:t,writable:!0}}})),Object.defineProperties(e,o)}function ao(e){return"object"==typeof e&&null!==e}var lo={};Os(lo,{compose:()=>Ro,debounce:()=>Eo,doOnce:()=>ho,errorOnce:()=>po,executeAfter:()=>yo,executeInAWhile:()=>fo,executeNextVMTurn:()=>wo,getFunctionName:()=>go,isFunction:()=>mo,noop:()=>Do,throttle:()=>So,waitUntil:()=>bo,warnOnce:()=>co});var uo={};function ho(e,t){uo[t]||(e(),uo[t]=!0)}function co(e){ho((()=>console.warn("AG Grid: "+e)),e)}function po(e){ho((()=>console.error("AG Grid: "+e)),e)}function go(e){if(e.name)return e.name;const t=/function\s+([^\(]+)/.exec(e.toString());return t&&2===t.length?t[1].trim():null}function mo(e){return!!(e&&e.constructor&&e.call&&e.apply)}function fo(e){yo(e,400)}var Co=[],vo=!1;function wo(e){Co.push(e),vo||(vo=!0,window.setTimeout((()=>{const e=Co.slice();Co.length=0,vo=!1,e.forEach((e=>e()))}),0))}function yo(e,t=0){e.length>0&&window.setTimeout((()=>e.forEach((e=>e()))),t)}function Eo(e,t){let i;return function(...s){const o=this;window.clearTimeout(i),i=window.setTimeout((function(){e.apply(o,s)}),t)}}function So(e,t){let i=0;return function(...s){const o=(new Date).getTime();o-i<t||(i=o,e.apply(this,s))}}function bo(e,t,i=100,s){const o=(new Date).getTime();let n=null,r=!1;const a=()=>{const a=(new Date).getTime()-o>i;(e()||a)&&(t(),r=!0,null!=n&&(window.clearInterval(n),n=null),a&&s&&console.warn(s))};a(),r||(n=window.setInterval(a,10))}function Ro(...e){return t=>e.reduce(((e,t)=>t(e)),t)}var Do=()=>{},To=(e=>(e.CommunityCoreModule="@ag-grid-community/core",e.InfiniteRowModelModule="@ag-grid-community/infinite-row-model",e.ClientSideRowModelModule="@ag-grid-community/client-side-row-model",e.CsvExportModule="@ag-grid-community/csv-export",e.EnterpriseCoreModule="@ag-grid-enterprise/core",e.RowGroupingModule="@ag-grid-enterprise/row-grouping",e.ColumnsToolPanelModule="@ag-grid-enterprise/column-tool-panel",e.FiltersToolPanelModule="@ag-grid-enterprise/filter-tool-panel",e.MenuModule="@ag-grid-enterprise/menu",e.SetFilterModule="@ag-grid-enterprise/set-filter",e.MultiFilterModule="@ag-grid-enterprise/multi-filter",e.StatusBarModule="@ag-grid-enterprise/status-bar",e.SideBarModule="@ag-grid-enterprise/side-bar",e.RangeSelectionModule="@ag-grid-enterprise/range-selection",e.MasterDetailModule="@ag-grid-enterprise/master-detail",e.RichSelectModule="@ag-grid-enterprise/rich-select",e.GridChartsModule="@ag-grid-enterprise/charts",e.ViewportRowModelModule="@ag-grid-enterprise/viewport-row-model",e.ServerSideRowModelModule="@ag-grid-enterprise/server-side-row-model",e.ExcelExportModule="@ag-grid-enterprise/excel-export",e.ClipboardModule="@ag-grid-enterprise/clipboard",e.SparklinesModule="@ag-grid-enterprise/sparklines",e.AdvancedFilterModule="@ag-grid-enterprise/advanced-filter",e.AngularModule="@ag-grid-community/angular",e.ReactModule="@ag-grid-community/react",e.VueModule="@ag-grid-community/vue",e))(To||{}),Ao=class e{static register(t){e.__register(t,!0,void 0)}static registerModules(t){e.__registerModules(t,!0,void 0)}static __register(t,i,s){e.runVersionChecks(t),void 0!==s?(e.areGridScopedModules=!0,void 0===e.gridModulesMap[s]&&(e.gridModulesMap[s]={}),e.gridModulesMap[s][t.moduleName]=t):e.globalModulesMap[t.moduleName]=t,e.setModuleBased(i)}static __unRegisterGridModules(t){delete e.gridModulesMap[t]}static __registerModules(t,i,s){e.setModuleBased(i),t&&t.forEach((t=>e.__register(t,i,s)))}static isValidModuleVersion(t){const[i,s]=t.version.split(".")||[],[o,n]=e.currentModuleVersion.split(".")||[];return i===o&&s===n}static runVersionChecks(t){if(e.currentModuleVersion||(e.currentModuleVersion=t.version),t.version?e.isValidModuleVersion(t)||console.error(`AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '${t.moduleName}' is version ${t.version} but the other modules are version ${this.currentModuleVersion}. Please update all modules to the same version.`):console.error(`AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '${t.moduleName}' is incompatible. Please update all modules to the same version.`),t.validate){const e=t.validate();if(!e.isValid){const t=e;console.error(`AG Grid: ${t.message}`)}}}static setModuleBased(t){void 0===e.moduleBased?e.moduleBased=t:e.moduleBased!==t&&ho((()=>{console.warn("AG Grid: You are mixing modules (i.e. @ag-grid-community/core) and packages (ag-grid-community) - you can only use one or the other of these mechanisms."),console.warn("Please see https://www.ag-grid.com/javascript-grid/modules/ for more information.")}),"ModulePackageCheck")}static __setIsBundled(){e.isBundled=!0}static __assertRegistered(t,i,s){var o;if(this.__isRegistered(t,s))return!0;const n=i+t;let r;if(e.isBundled)r=`AG Grid: unable to use ${i} as 'ag-grid-enterprise' has not been loaded. Check you are using the Enterprise bundle:\n \n <script src="https://cdn.jsdelivr.net/npm/ag-grid-enterprise@AG_GRID_VERSION/dist/ag-grid-enterprise.min.js"><\/script>\n \nFor more info see: https://ag-grid.com/javascript-data-grid/getting-started/#getting-started-with-ag-grid-enterprise`;else if(e.moduleBased||void 0===e.moduleBased){let n=null==(o=Object.entries(To).find((([e,i])=>i===t)))?void 0:o[0];r=`AG Grid: unable to use ${i} as the ${n} is not registered${e.areGridScopedModules?` for gridId: ${s}`:""}. Check if you have registered the module:\n \n import { ModuleRegistry } from '@ag-grid-community/core';\n import { ${n} } from '${t}';\n \n ModuleRegistry.registerModules([ ${n} ]);\n\nFor more info see: https://www.ag-grid.com/javascript-grid/modules/`}else r=`AG Grid: unable to use ${i} as package 'ag-grid-enterprise' has not been imported. Check that you have imported the package:\n \n import 'ag-grid-enterprise';`;return ho((()=>{console.warn(r)}),n),!1}static __isRegistered(t,i){var s;return!!e.globalModulesMap[t]||!!(null==(s=e.gridModulesMap[i])?void 0:s[t])}static __getRegisteredModules(t){return[...Xs(e.globalModulesMap),...Xs(e.gridModulesMap[t]||{})]}static __getGridRegisteredModules(t){var i;return Xs(null!=(i=e.gridModulesMap[t])?i:{})||[]}static __isPackageBased(){return!e.moduleBased}};Ao.globalModulesMap={},Ao.gridModulesMap={},Ao.areGridScopedModules=!1;var Po=Ao,Fo=class{constructor(e,t){if(this.beanWrappers={},this.destroyed=!1,!e||!e.beanClasses)return;this.contextParams=e,this.logger=t,this.logger.log(">> creating ag-Application Context"),this.createBeans();const i=this.getBeanInstances();this.wireBeans(i),this.logger.log(">> ag-Application Context ready - component is alive")}getBeanInstances(){return Xs(this.beanWrappers).map((e=>e.beanInstance))}createBean(e,t){if(!e)throw Error("Can't wire to bean since it is null");return this.wireBeans([e],t),e}wireBeans(e,t){this.autoWireBeans(e),this.methodWireBeans(e),this.callLifeCycleMethods(e,"preConstructMethods"),Bs(t)&&e.forEach(t),this.callLifeCycleMethods(e,"postConstructMethods")}createBeans(){this.contextParams.beanClasses.forEach(this.createBeanWrapper.bind(this)),eo(this.beanWrappers,((e,t)=>{let i;t.bean.__agBeanMetaData&&t.bean.__agBeanMetaData.autowireMethods&&t.bean.__agBeanMetaData.autowireMethods.agConstructor&&(i=t.bean.__agBeanMetaData.autowireMethods.agConstructor);const s=this.getBeansForParameters(i,t.bean.name),o=new(t.bean.bind.apply(t.bean,[null,...s]));t.beanInstance=o}));const e=Object.keys(this.beanWrappers).join(", ");this.logger.log(`created beans: ${e}`)}createBeanWrapper(e){const t=e.__agBeanMetaData;if(!t){let t;return t=e.prototype.constructor?go(e.prototype.constructor):""+e,void console.error(`Context item ${t} is not a bean`)}const i={bean:e,beanInstance:null,beanName:t.beanName};this.beanWrappers[t.beanName]=i}autoWireBeans(e){e.forEach((e=>{this.forEachMetaDataInHierarchy(e,((t,i)=>{const s=t.agClassAttributes;s&&s.forEach((t=>{const s=this.lookupBeanInstance(i,t.beanName,t.optional);e[t.attributeName]=s}))}))}))}methodWireBeans(e){e.forEach((e=>{this.forEachMetaDataInHierarchy(e,((t,i)=>{eo(t.autowireMethods,((t,s)=>{if("agConstructor"===t)return;const o=this.getBeansForParameters(s,i);e[t].apply(e,o)}))}))}))}forEachMetaDataInHierarchy(e,t){let i=Object.getPrototypeOf(e);for(;null!=i;){const e=i.constructor;e.hasOwnProperty("__agBeanMetaData")&&t(e.__agBeanMetaData,this.getBeanName(e)),i=Object.getPrototypeOf(i)}}getBeanName(e){if(e.__agBeanMetaData&&e.__agBeanMetaData.beanName)return e.__agBeanMetaData.beanName;const t=e.toString();return t.substring(9,t.indexOf("("))}getBeansForParameters(e,t){const i=[];return e&&eo(e,((e,s)=>{const o=this.lookupBeanInstance(t,s);i[Number(e)]=o})),i}lookupBeanInstance(e,t,i=!1){if(this.destroyed)return this.logger.log(`AG Grid: bean reference ${t} is used after the grid is destroyed!`),null;if("context"===t)return this;if(this.contextParams.providedBeanInstances&&this.contextParams.providedBeanInstances.hasOwnProperty(t))return this.contextParams.providedBeanInstances[t];const s=this.beanWrappers[t];return s?s.beanInstance:(i||console.error(`AG Grid: unable to find bean reference ${t} while initialising ${e}`),null)}callLifeCycleMethods(e,t){e.forEach((e=>this.callLifeCycleMethodsOnBean(e,t)))}callLifeCycleMethodsOnBean(e,t,i){const s={};this.forEachMetaDataInHierarchy(e,(e=>{const o=e[t];o&&o.forEach((e=>{e!=i&&(s[e]=!0)}))})),Object.keys(s).forEach((t=>e[t]()))}getBean(e){return this.lookupBeanInstance("getBean",e,!0)}destroy(){if(this.destroyed)return;this.destroyed=!0,this.logger.log(">> Shutting down ag-Application Context");const e=this.getBeanInstances();this.destroyBeans(e),this.contextParams.providedBeanInstances=null,Po.__unRegisterGridModules(this.contextParams.gridId),this.logger.log(">> ag-Application Context shut down - component is dead")}destroyBean(e){e&&this.destroyBeans([e])}destroyBeans(e){return e?(e.forEach((e=>{this.callLifeCycleMethodsOnBean(e,"preDestroyMethods","destroy");const t=e;"function"==typeof t.destroy&&t.destroy()})),[]):[]}isDestroyed(){return this.destroyed}getGridId(){return this.contextParams.gridId}};function Mo(e,t,i){const s=ko(e.constructor);s.preConstructMethods||(s.preConstructMethods=[]),s.preConstructMethods.push(t)}function Lo(e,t,i){const s=ko(e.constructor);s.postConstructMethods||(s.postConstructMethods=[]),s.postConstructMethods.push(t)}function xo(e,t,i){const s=ko(e.constructor);s.preDestroyMethods||(s.preDestroyMethods=[]),s.preDestroyMethods.push(t)}function Io(e){return t=>{ko(t).beanName=e}}function No(e){return(t,i,s)=>{Oo(t,e,!1,0,i,null)}}function _o(e){return(t,i,s)=>{Oo(t,e,!0,0,i,null)}}function Oo(e,t,i,s,o,n){if(null===t)return void console.error("AG Grid: Autowired name should not be null");if("number"==typeof n)return void console.error("AG Grid: Autowired should be on an attribute");const r=ko(e.constructor);r.agClassAttributes||(r.agClassAttributes=[]),r.agClassAttributes.push({attributeName:o,beanName:t,optional:i})}function Go(e){return(t,i,s)=>{const o="function"==typeof t?t:t.constructor;let n;if("number"==typeof s){let t;i?(n=ko(o),t=i):(n=ko(o),t="agConstructor"),n.autowireMethods||(n.autowireMethods={}),n.autowireMethods[t]||(n.autowireMethods[t]={}),n.autowireMethods[t][s]=e}}}function ko(e){return e.hasOwnProperty("__agBeanMetaData")||(e.__agBeanMetaData={}),e.__agBeanMetaData}var Vo=class{constructor(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}setBeans(e,t,i=null,s=null){if(this.frameworkOverrides=t,this.gos=e,i){const t=e.useAsyncEvents();this.addGlobalListener(i,t)}s&&this.addGlobalListener(s,!1)}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,i){const s=t?this.allAsyncListeners:this.allSyncListeners;let o=s.get(e);return!o&&i&&(o=new Set,s.set(e,o)),o}noRegisteredListenersExist(){return 0===this.allSyncListeners.size&&0===this.allAsyncListeners.size&&0===this.globalSyncListeners.size&&0===this.globalAsyncListeners.size}addEventListener(e,t,i=!1){this.getListeners(e,i,!0).add(t)}removeEventListener(e,t,i=!1){const s=this.getListeners(e,i,!1);s&&(s.delete(t),0===s.size)&&(i?this.allAsyncListeners:this.allSyncListeners).delete(e)}addGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).add(e)}removeGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).delete(e)}dispatchEvent(e){let t=e;this.gos&&this.gos.addGridCommonParams(t),this.dispatchToListeners(t,!0),this.dispatchToListeners(t,!1),this.firedEvents[t.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){var i;const s=e.type;if(t&&"event"in e){const t=e.event;t instanceof Event&&(e.eventPath=t.composedPath())}const o=null!=(i=this.getListeners(s,t,!1))?i:new Set,n=new Set(o);n.size>0&&((i,s)=>{i.forEach((i=>{if(!s.has(i))return;const o=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming((()=>i(e))):()=>i(e);t?this.dispatchAsync(o):o()}))})(n,o),new Set(t?this.globalAsyncListeners:this.globalSyncListeners).forEach((i=>{const o=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming((()=>i(s,e))):()=>i(s,e);t?this.dispatchAsync(o):o()}))}dispatchAsync(e){this.asyncFunctionsQueue.push(e),this.scheduled||(this.frameworkOverrides.wrapIncoming((()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)})),this.scheduled=!0)}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[],e.forEach((e=>e()))}};Gs([ks(0,Go("gridOptionsService")),ks(1,Go("frameworkOverrides")),ks(2,Go("globalEventListener")),ks(3,Go("globalSyncEventListener"))],Vo.prototype,"setBeans",1),Vo=Gs([Io("eventService")],Vo);var Ho=class{constructor(e){this.frameworkOverrides=e,this.wrappedListeners=new Map,this.wrappedGlobalListeners=new Map}wrap(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=t=>{this.frameworkOverrides.wrapOutgoing((()=>e(t)))},this.wrappedListeners.set(e,t)),t}wrapGlobal(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=(t,i)=>{this.frameworkOverrides.wrapOutgoing((()=>e(t,i)))},this.wrappedGlobalListeners.set(e,t)),t}unwrap(e){var t;return null!=(t=this.wrappedListeners.get(e))?t:e}unwrapGlobal(e){var t;return null!=(t=this.wrappedGlobalListeners.get(e))?t:e}},Bo={resizable:!0,sortable:!0},Wo=0;function Uo(){return Wo++}var zo=class e{constructor(e,t,i,s){this.instanceId=Uo(),this.autoHeaderHeight=null,this.moving=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.eventService=new Vo,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.colDef=e,this.userProvidedColDef=t,this.colId=i,this.primary=s,this.setState(e)}getInstanceId(){return this.instanceId}setState(e){void 0!==e.sort?"asc"!==e.sort&&"desc"!==e.sort||(this.sort=e.sort):"asc"!==e.initialSort&&"desc"!==e.initialSort||(this.sort=e.initialSort);const t=e.sortIndex,i=e.initialSortIndex;void 0!==t?null!==t&&(this.sortIndex=t):null!==i&&(this.sortIndex=i);const s=e.hide,o=e.initialHide;this.visible=void 0!==s?!s:!o,void 0!==e.pinned?this.setPinned(e.pinned):this.setPinned(e.initialPinned);const n=e.flex,r=e.initialFlex;void 0!==n?this.flex=n:void 0!==r&&(this.flex=r)}setColDef(e,t,i){this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),this.eventService.dispatchEvent(this.createColumnEvent("colDefChanged",i))}getUserProvidedColDef(){return this.userProvidedColDef}setParent(e){this.parent=e}getParent(){return this.parent}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}initialise(){this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip()}initDotNotation(){const e=this.gos.get("suppressFieldDotNotation");this.fieldContainsDots=Bs(this.colDef.field)&&this.colDef.field.indexOf(".")>=0&&!e,this.tooltipFieldContainsDots=Bs(this.colDef.tooltipField)&&this.colDef.tooltipField.indexOf(".")>=0&&!e}initMinAndMaxWidths(){var e,t;const i=this.colDef;this.minWidth=null!=(e=i.minWidth)?e:this.environment.getMinColWidth(),this.maxWidth=null!=(t=i.maxWidth)?t:Number.MAX_SAFE_INTEGER}initTooltip(){this.tooltipEnabled=Bs(this.colDef.tooltipField)||Bs(this.colDef.tooltipValueGetter)||Bs(this.colDef.tooltipComponent)}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){var t,i;const s=null!=(t=e.minWidth)?t:this.environment.getMinColWidth(),o=null!=(i=e.maxWidth)?i:Number.MAX_SAFE_INTEGER;let n;const r=$s(e.width),a=$s(e.initialWidth);return n=null!=r?r:null!=a?a:200,Math.max(Math.min(n,o),s)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){if(Ws(this.colDef)||Ws(this.colDef.showRowGroup))return!1;const t=!0===this.colDef.showRowGroup,i=this.colDef.showRowGroup===e;return t||i}isPrimary(){return this.primary}isFilterAllowed(){return!!this.colDef.filter}isFieldContainsDots(){return this.fieldContainsDots}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}addEventListener(e,t){var i,s;this.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.eventService.setFrameworkOverrides(this.frameworkOverrides),this.frameworkEventListenerService=new Ho(this.frameworkOverrides));const o=null!=(s=null==(i=this.frameworkEventListenerService)?void 0:i.wrap(t))?s:t;this.eventService.addEventListener(e,o)}removeEventListener(e,t){var i,s;const o=null!=(s=null==(i=this.frameworkEventListenerService)?void 0:i.unwrap(t))?s:t;this.eventService.removeEventListener(e,o)}createColumnFunctionCallbackParams(e){return this.gos.addGridCommonParams({node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){if("boolean"==typeof this.colDef.suppressNavigable)return this.colDef.suppressNavigable;if("function"==typeof this.colDef.suppressNavigable){const t=this.createColumnFunctionCallbackParams(e);return(0,this.colDef.suppressNavigable)(t)}return!1}isCellEditable(e){return!(e.group&&!this.gos.get("enableGroupEdit"))&&this.isColumnFunc(e,this.colDef.editable)}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(e){return this.isColumnFunc(e,this.colDef.rowDrag)}isDndSource(e){return this.isColumnFunc(e,this.colDef.dndSource)}isCellCheckboxSelection(e){return this.isColumnFunc(e,this.colDef.checkboxSelection)}isSuppressPaste(e){return this.isColumnFunc(e,this.colDef?this.colDef.suppressPaste:null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(e){var t;return null!=(t=this.colDef[e])?t:Bo[e]}isColumnFunc(e,t){return"boolean"==typeof t?t:"function"==typeof t&&t(this.createColumnFunctionCallbackParams(e))}setMoving(e,t){this.moving=e,this.eventService.dispatchEvent(this.createColumnEvent("movingChanged",t))}createColumnEvent(e,t){return this.gos.addGridCommonParams({type:e,column:this,columns:[this],source:t})}isMoving(){return this.moving}getSort(){return this.sort}setSort(e,t){this.sort!==e&&(this.sort=e,this.eventService.dispatchEvent(this.createColumnEvent("sortChanged",t))),this.dispatchStateUpdatedEvent("sort")}setMenuVisible(e,t){this.menuVisible!==e&&(this.menuVisible=e,this.eventService.dispatchEvent(this.createColumnEvent("menuVisibleChanged",t)))}isMenuVisible(){return this.menuVisible}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return"asc"===this.sort}isSortDescending(){return"desc"===this.sort}isSortNone(){return Ws(this.sort)}isSorting(){return Bs(this.sort)}getSortIndex(){return this.sortIndex}setSortIndex(e){this.sortIndex=e,this.dispatchStateUpdatedEvent("sortIndex")}setAggFunc(e){this.aggFunc=e,this.dispatchStateUpdatedEvent("aggFunc")}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(e,t){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.eventService.dispatchEvent(this.createColumnEvent("leftChanged",t)))}isFilterActive(){return this.filterActive}setFilterActive(e,t,i){this.filterActive!==e&&(this.filterActive=e,this.eventService.dispatchEvent(this.createColumnEvent("filterActiveChanged",t)));const s=this.createColumnEvent("filterChanged",t);i&&oo(s,i),this.eventService.dispatchEvent(s)}isHovered(){return this.columnHoverService.isHovered(this)}setPinned(e){this.pinned=!0===e||"left"===e?"left":"right"===e?"right":null,this.dispatchStateUpdatedEvent("pinned")}setFirstRightPinned(e,t){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.eventService.dispatchEvent(this.createColumnEvent("firstRightPinnedChanged",t)))}setLastLeftPinned(e,t){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.eventService.dispatchEvent(this.createColumnEvent("lastLeftPinnedChanged",t)))}isFirstRightPinned(){return this.firstRightPinned}isLastLeftPinned(){return this.lastLeftPinned}isPinned(){return"left"===this.pinned||"right"===this.pinned}isPinnedLeft(){return"left"===this.pinned}isPinnedRight(){return"right"===this.pinned}getPinned(){return this.pinned}setVisible(e,t){const i=!0===e;this.visible!==i&&(this.visible=i,this.eventService.dispatchEvent(this.createColumnEvent("visibleChanged",t))),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){const e=this.getColDef();return!e.suppressSpanHeaderHeight&&!e.autoHeaderHeight}getColumnGroupPaddingInfo(){let e=this.getParent();if(!e||!e.isPadding())return{numberOfParents:0,isSpanningTotal:!1};const t=e.getPaddingLevel()+1;let i=!0;for(;e;){if(!e.isPadding()){i=!1;break}e=e.getParent()}return{numberOfParents:t,isSpanningTotal:i}}getColDef(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getDefinition(){return this.colDef}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}createBaseColDefParams(e){return this.gos.addGridCommonParams({node:e,data:e.data,colDef:this.colDef,column:this})}getColSpan(e){if(Ws(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.colSpan(t);return Math.max(i,1)}getRowSpan(e){if(Ws(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.rowSpan(t);return Math.max(i,1)}setActualWidth(e,t,i=!1){null!=this.minWidth&&(e=Math.max(e,this.minWidth)),null!=this.maxWidth&&(e=Math.min(e,this.maxWidth)),this.actualWidth!==e&&(this.actualWidth=e,this.flex&&"flex"!==t&&"gridInitializing"!==t&&(this.flex=null),i||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.eventService.dispatchEvent(this.createColumnEvent("widthChanged",e))}isGreaterThanMax(e){return null!=this.maxWidth&&e>this.maxWidth}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex||0}setFlex(e){this.flex!==e&&(this.flex=e),this.dispatchStateUpdatedEvent("flex")}setMinimum(e){Bs(this.minWidth)&&this.setActualWidth(this.minWidth,e)}setRowGroupActive(e,t){this.rowGroupActive!==e&&(this.rowGroupActive=e,this.eventService.dispatchEvent(this.createColumnEvent("columnRowGroupChanged",t))),this.dispatchStateUpdatedEvent("rowGroup")}isRowGroupActive(){return this.rowGroupActive}setPivotActive(e,t){this.pivotActive!==e&&(this.pivotActive=e,this.eventService.dispatchEvent(this.createColumnEvent("columnPivotChanged",t))),this.dispatchStateUpdatedEvent("pivot")}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}setValueActive(e,t){this.aggregationActive!==e&&(this.aggregationActive=e,this.eventService.dispatchEvent(this.createColumnEvent("columnValueChanged",t)))}isValueActive(){return this.aggregationActive}isAllowPivot(){return!0===this.colDef.enablePivot}isAllowValue(){return!0===this.colDef.enableValue}isAllowRowGroup(){return!0===this.colDef.enableRowGroup}getMenuTabs(e){co("As of v31.1, 'getMenuTabs' is deprecated. Use 'getColDef().menuTabs ?? defaultValues' instead.");let t=this.getColDef().menuTabs;return null==t&&(t=e),t}dispatchStateUpdatedEvent(t){this.eventService.dispatchEvent({type:e.EVENT_STATE_UPDATED,key:t})}};zo.EVENT_MOVING_CHANGED="movingChanged",zo.EVENT_LEFT_CHANGED="leftChanged",zo.EVENT_WIDTH_CHANGED="widthChanged",zo.EVENT_LAST_LEFT_PINNED_CHANGED="lastLeftPinnedChanged",zo.EVENT_FIRST_RIGHT_PINNED_CHANGED="firstRightPinnedChanged",zo.EVENT_VISIBLE_CHANGED="visibleChanged",zo.EVENT_FILTER_CHANGED="filterChanged",zo.EVENT_FILTER_ACTIVE_CHANGED="filterActiveChanged",zo.EVENT_SORT_CHANGED="sortChanged",zo.EVENT_COL_DEF_CHANGED="colDefChanged",zo.EVENT_MENU_VISIBLE_CHANGED="menuVisibleChanged",zo.EVENT_ROW_GROUP_CHANGED="columnRowGroupChanged",zo.EVENT_PIVOT_CHANGED="columnPivotChanged",zo.EVENT_VALUE_CHANGED="columnValueChanged",zo.EVENT_STATE_UPDATED="columnStateUpdated",Gs([No("gridOptionsService")],zo.prototype,"gos",2),Gs([No("environment")],zo.prototype,"environment",2),Gs([No("columnHoverService")],zo.prototype,"columnHoverService",2),Gs([No("frameworkOverrides")],zo.prototype,"frameworkOverrides",2),Gs([Lo],zo.prototype,"initialise",1);var $o=zo,Ko=class e{constructor(e,t,i,s){this.localEventService=new Vo,this.expandable=!1,this.instanceId=Uo(),this.expandableListenerRemoveCallback=null,this.colGroupDef=e,this.groupId=t,this.expanded=!!e&&!!e.openByDefault,this.padding=i,this.level=s}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0)}reset(e,t){this.colGroupDef=e,this.level=t,this.originalParent=null,this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback(),this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){return!!this.children&&this.children.some((e=>e.isVisible()))}isPadding(){return this.padding}setExpanded(t){this.expanded=void 0!==t&&t;const i={type:e.EVENT_EXPANDED_CHANGED};this.localEventService.dispatchEvent(i)}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(e){this.children=e}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}addLeafColumns(t){this.children&&this.children.forEach((i=>{i instanceof $o?t.push(i):i instanceof e&&i.addLeafColumns(t)}))}getColumnGroupShow(){const e=this.colGroupDef;if(e)return e.columnGroupShow}setupExpandable(){this.setExpandable(),this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback();const e=this.onColumnVisibilityChanged.bind(this);this.getLeafColumns().forEach((t=>t.addEventListener("visibleChanged",e))),this.expandableListenerRemoveCallback=()=>{this.getLeafColumns().forEach((t=>t.removeEventListener("visibleChanged",e))),this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let t=!1,i=!1,s=!1;const o=this.findChildrenRemovingPadding();for(let e=0,n=o.length;e<n;e++){const n=o[e];if(!n.isVisible())continue;const r=n.getColumnGroupShow();"open"===r?(t=!0,s=!0):"closed"===r?(i=!0,s=!0):(t=!0,i=!0)}const n=t&&i&&s;if(this.expandable!==n){this.expandable=n;const t={type:e.EVENT_EXPANDABLE_CHANGED};this.localEventService.dispatchEvent(t)}}findChildrenRemovingPadding(){const t=[],i=s=>{s.forEach((s=>{s instanceof e&&s.isPadding()?i(s.children):t.push(s)}))};return i(this.children),t}onColumnVisibilityChanged(){this.setExpandable()}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}};Ko.EVENT_EXPANDED_CHANGED="expandedChanged",Ko.EVENT_EXPANDABLE_CHANGED="expandableChanged",Gs([xo],Ko.prototype,"destroy",1);var jo=Ko,Yo={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}},qo={};Os(qo,{addSafePassiveEventListener:()=>Tn,createEventPath:()=>Rn,getCtrlForEventTarget:()=>Sn,getEventPath:()=>Dn,isElementInEventPath:()=>bn,isEventSupported:()=>En,isStopPropagationForAgGrid:()=>yn,stopPropagationForAgGrid:()=>wn});var Xo={};function Qo(e){return null!=e&&e.length>0}function Jo(e){if(e&&e.length)return e[e.length-1]}function Zo(e,t,i){return null==e&&null==t||null!=e&&null!=t&&e.length===t.length&&e.every(((e,s)=>i?i(e,t[s]):t[s]===e))}function en(e,t){return Zo(e,t)}function tn(e){return e.sort(((e,t)=>e-t))}function sn(e,t){if(e)for(let i=e.length-2;i>=0;i--){const s=e[i]===t,o=e[i+1]===t;s&&o&&e.splice(i+1,1)}}function on(e,t){const i=e.indexOf(t);i>=0&&(e[i]=e[e.length-1],e.pop())}function nn(e,t){const i=e.indexOf(t);i>=0&&e.splice(i,1)}function rn(e,t){for(let i=0;i<t.length;i++)on(e,t[i])}function an(e,t){for(let i=0;i<t.length;i++)nn(e,t[i])}function ln(e,t,i){e.splice(i,0,t)}function un(e,t,i){if(null!=e&&null!=t)for(let s=t.length-1;s>=0;s--)ln(e,t[s],i)}function hn(e,t,i){an(e,t),t.slice().reverse().forEach((t=>ln(e,t,i)))}function dn(e,t){return e.indexOf(t)>-1}function cn(e){return[].concat.apply([],e)}function pn(e,t){null!=t&&null!=e&&t.forEach((t=>e.push(t)))}function gn(e){return e.map(zs)}function mn(e,t){if(null!=e)for(let i=e.length-1;i>=0;i--)t(e[i],i)}Os(Xo,{areEqual:()=>Zo,existsAndNotEmpty:()=>Qo,flatten:()=>cn,forEachReverse:()=>mn,includes:()=>dn,insertArrayIntoArray:()=>un,insertIntoArray:()=>ln,last:()=>Jo,moveInArray:()=>hn,pushAll:()=>pn,removeAllFromArray:()=>an,removeAllFromUnorderedArray:()=>rn,removeFromArray:()=>nn,removeFromUnorderedArray:()=>on,removeRepeatsFromArray:()=>sn,shallowCompare:()=>en,sortNumerically:()=>tn,toStrings:()=>gn});var fn="__ag_Grid_Stop_Propagation",Cn=["touchstart","touchend","touchmove","touchcancel","scroll"],vn={};function wn(e){e[fn]=!0}function yn(e){return!0===e[fn]}var En=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return t=>{if("boolean"==typeof vn[t])return vn[t];const i=document.createElement(e[t]||"div");return vn[t="on"+t]=t in i}})();function Sn(e,t,i){let s=t;for(;s;){const t=e.getDomData(s,i);if(t)return t;s=s.parentElement}return null}function bn(e,t){return!(!t||!e)&&Dn(t).indexOf(e)>=0}function Rn(e){const t=[];let i=e.target;for(;i;)t.push(i),i=i.parentElement;return t}function Dn(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():Rn(t)}function Tn(e,t,i,s){const o=dn(Cn,i)?{passive:!0}:void 0;e&&e.addEventListener&&e.addEventListener(t,i,s,o)}var An=class e{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.lastChangeSetIdLookup={},this.propertyListenerId=0,this.isAlive=()=>!this.destroyed}getFrameworkOverrides(){return this.frameworkOverrides}getContext(){return this.context}destroy(){for(let e=0;e<this.destroyFunctions.length;e++)this.destroyFunctions[e]();this.destroyFunctions.length=0,this.destroyed=!0,this.dispatchEvent({type:e.EVENT_DESTROYED})}addEventListener(e,t){this.localEventService||(this.localEventService=new Vo),this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService&&this.localEventService.removeEventListener(e,t)}dispatchEvent(e){this.localEventService&&this.localEventService.dispatchEvent(e)}addManagedListener(e,t,i){if(this.destroyed)return;e instanceof HTMLElement?Tn(this.getFrameworkOverrides(),e,t,i):e.addEventListener(t,i);const s=()=>(e.removeEventListener(t,i),null);return this.destroyFunctions.push(s),()=>(s(),this.destroyFunctions=this.destroyFunctions.filter((e=>e!==s)),null)}setupGridOptionListener(e,t){this.gos.addEventListener(e,t);const i=()=>(this.gos.removeEventListener(e,t),null);return this.destroyFunctions.push(i),()=>(i(),this.destroyFunctions=this.destroyFunctions.filter((e=>e!==i)),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupGridOptionListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const i=e.join("-")+this.propertyListenerId++,s=e=>{if(e.changeSet){if(e.changeSet&&e.changeSet.id===this.lastChangeSetIdLookup[i])return;this.lastChangeSetIdLookup[i]=e.changeSet.id}const s={type:"gridPropertyChanged",changeSet:e.changeSet,source:e.source};t(s)};e.forEach((e=>this.setupGridOptionListener(e,s)))}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createManagedBean(e,t){const i=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),i}createBean(e,t,i){return(t||this.getContext()).createBean(e,i)}destroyBean(e,t){return(t||this.getContext()).destroyBean(e)}destroyBeans(e,t){if(e)for(let i=0;i<e.length;i++)this.destroyBean(e[i],t);return[]}};An.EVENT_DESTROYED="destroyed",Gs([No("frameworkOverrides")],An.prototype,"frameworkOverrides",2),Gs([No("context")],An.prototype,"context",2),Gs([No("eventService")],An.prototype,"eventService",2),Gs([No("gridOptionsService")],An.prototype,"gos",2),Gs([No("localeService")],An.prototype,"localeService",2),Gs([No("environment")],An.prototype,"environment",2),Gs([xo],An.prototype,"destroy",1);var Pn=An,Fn=class extends Pn{setBeans(e){this.logger=e.create("ColumnFactory")}createColumnTree(e,t,i,s){const o=new Qs,{existingCols:n,existingGroups:r,existingColKeys:a}=this.extractExistingTreeData(i);o.addExistingKeys(a);const l=this.recursivelyCreateColumns(e,0,t,n,o,r,s),u=this.findMaxDept(l,0);this.logger.log("Number of levels for grouped columns is "+u);const h=this.balanceColumnTree(l,0,u,o);return Mn(null,h,((e,t)=>{e instanceof jo&&e.setupExpandable(),e.setOriginalParent(t)})),{columnTree:h,treeDept:u}}extractExistingTreeData(e){const t=[],i=[],s=[];return e&&Mn(null,e,(e=>{if(e instanceof jo){const t=e;i.push(t)}else{const i=e;s.push(i.getId()),t.push(i)}})),{existingCols:t,existingGroups:i,existingColKeys:s}}createForAutoGroups(e,t){return e.map((e=>this.createAutoGroupTreeItem(t,e)))}createAutoGroupTreeItem(e,t){const i=this.findDepth(e);let s=t;for(let e=i-1;e>=0;e--){const i=new jo(null,`FAKE_PATH_${t.getId()}}_${e}`,!0,e);this.createBean(i),i.setChildren([s]),s.setOriginalParent(i),s=i}return 0===i&&t.setOriginalParent(null),s}findDepth(e){let t=0,i=e;for(;i&&i[0]&&i[0]instanceof jo;)t++,i=i[0].getChildren();return t}balanceColumnTree(e,t,i,s){const o=[];for(let n=0;n<e.length;n++){const r=e[n];if(r instanceof jo){const e=r,n=this.balanceColumnTree(e.getChildren(),t+1,i,s);e.setChildren(n),o.push(e)}else{let n,a;for(let e=i-1;e>=t;e--){const e=s.getUniqueKey(null,null),i=this.createMergedColGroupDef(null),o=new jo(i,e,!0,t);this.createBean(o),a&&a.setChildren([o]),a=o,n||(n=a)}if(n&&a){if(o.push(n),e.some((e=>e instanceof jo))){a.setChildren([r]);continue}a.setChildren(e);break}o.push(r)}}return o}findMaxDept(e,t){let i=t;for(let s=0;s<e.length;s++){const o=e[s];if(o instanceof jo){const e=o,s=this.findMaxDept(e.getChildren(),t+1);i<s&&(i=s)}}return i}recursivelyCreateColumns(e,t,i,s,o,n,r){if(!e)return[];const a=new Array(e.length);for(let l=0;l<a.length;l++){const u=e[l];this.isColumnGroup(u)?a[l]=this.createColumnGroup(i,u,t,s,o,n,r):a[l]=this.createColumn(i,u,s,o,r)}return a}createColumnGroup(e,t,i,s,o,n,r){const a=this.createMergedColGroupDef(t),l=o.getUniqueKey(a.groupId||null,null),u=new jo(a,l,!1,i);this.createBean(u);const h=this.findExistingGroup(t,n);h&&n.splice(h.idx,1);let d=null==h?void 0:h.group;d&&u.setExpanded(d.isExpanded());const c=this.recursivelyCreateColumns(a.children,i+1,e,s,o,n,r);return u.setChildren(c),u}createMergedColGroupDef(e){const t={};return Object.assign(t,this.gos.get("defaultColGroupDef")),Object.assign(t,e),t}createColumn(e,t,i,s,o){const n=this.findExistingColumn(t,i);n&&(null==i||i.splice(n.idx,1));let r=null==n?void 0:n.column;if(r){const e=this.addColumnDefaultAndTypes(t,r.getColId());r.setColDef(e,t,o),this.applyColumnState(r,e,o)}else{const i=s.getUniqueKey(t.colId,t.field),o=this.addColumnDefaultAndTypes(t,i);r=new $o(o,t,i,e),this.context.createBean(r)}return this.dataTypeService.addColumnListeners(r),r}applyColumnState(e,t,i){const s=$s(t.flex);if(void 0!==s&&e.setFlex(s),e.getFlex()<=0){const s=$s(t.width);if(null!=s)e.setActualWidth(s,i);else{const t=e.getActualWidth();e.setActualWidth(t,i)}}void 0!==t.sort&&("asc"==t.sort||"desc"==t.sort?e.setSort(t.sort,i):e.setSort(void 0,i));const o=$s(t.sortIndex);void 0!==o&&e.setSortIndex(o);const n=Ks(t.hide);void 0!==n&&e.setVisible(!n,i),void 0!==t.pinned&&e.setPinned(t.pinned)}findExistingColumn(e,t){if(t)for(let i=0;i<t.length;i++){const s=t[i].getUserProvidedColDef();if(s)if(null==e.colId){if(null!=e.field){if(s.field===e.field)return{idx:i,column:t[i]}}else if(s===e)return{idx:i,column:t[i]}}else if(t[i].getId()===e.colId)return{idx:i,column:t[i]}}}findExistingGroup(e,t){if(null!=e.groupId)for(let i=0;i<t.length;i++){const s=t[i];if(s.getColGroupDef()&&s.getId()===e.groupId)return{idx:i,group:s}}}addColumnDefaultAndTypes(e,t){const i={};oo(i,this.gos.get("defaultColDef"),!1,!0);const s=this.dataTypeService.updateColDefAndGetColumnType(i,e,t);s&&this.assignColumnTypes(s,i),oo(i,e,!1,!0);const o=this.gos.get("autoGroupColumnDef"),n=this.gos.isColumnsSortingCoupledToGroup();return e.rowGroup&&o&&n&&oo(i,{sort:o.sort,initialSort:o.initialSort},!1,!0),this.dataTypeService.validateColDef(i),i}assignColumnTypes(e,t){if(!e.length)return;const i=Object.assign({},Yo);eo(this.gos.get("columnTypes")||{},((e,t)=>{e in i?console.warn(`AG Grid: the column type '${e}' is a default column type and cannot be overridden.`):(t.type&&co("Column type definitions 'columnTypes' with a 'type' attribute are not supported because a column type cannot refer to another column type. Only column definitions 'columnDefs' can use the 'type' attribute to refer to a column type."),i[e]=t)})),e.forEach((e=>{const s=i[e.trim()];s?oo(t,s,!1,!0):console.warn("AG Grid: colDef.type '"+e+"' does not correspond to defined gridOptions.columnTypes")}))}isColumnGroup(e){return void 0!==e.children}};function Mn(e,t,i){if(t)for(let s=0;s<t.length;s++){const o=t[s];o instanceof jo&&Mn(o,o.getChildren(),i),i(o,e)}}Gs([No("dataTypeService")],Fn.prototype,"dataTypeService",2),Gs([ks(0,Go("loggerFactory"))],Fn.prototype,"setBeans",1),Fn=Gs([Io("columnFactory")],Fn);var Ln=class e{constructor(e,t,i,s){this.displayedChildren=[],this.localEventService=new Vo,this.groupId=t,this.partId=i,this.providedColumnGroup=e,this.pinned=s}static createUniqueId(e,t){return e+"_"+t}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}setParent(e){this.parent=e}getUniqueId(){return e.createUniqueId(this.groupId,this.partId)}isEmptyGroup(){return 0===this.displayedChildren.length}isMoving(){const e=this.getProvidedColumnGroup().getLeafColumns();return!(!e||0===e.length)&&e.every((e=>e.isMoving()))}checkLeft(){if(this.displayedChildren.forEach((t=>{t instanceof e&&t.checkLeft()})),this.displayedChildren.length>0)if(this.gos.get("enableRtl")){const e=Jo(this.displayedChildren).getLeft();this.setLeft(e)}else{const e=this.displayedChildren[0].getLeft();this.setLeft(e)}else this.setLeft(null)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(t){this.oldLeft=this.left,this.left!==t&&(this.left=t,this.localEventService.dispatchEvent(this.createAgEvent(e.EVENT_LEFT_CHANGED)))}getPinned(){return this.pinned}createAgEvent(e){return{type:e}}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}getGroupId(){return this.groupId}getPartId(){return this.partId}isChildInThisGroupDeepSearch(t){let i=!1;return this.children.forEach((s=>{t===s&&(i=!0),s instanceof e&&s.isChildInThisGroupDeepSearch(t)&&(i=!0)})),i}getActualWidth(){let e=0;return this.displayedChildren&&this.displayedChildren.forEach((t=>{e+=t.getActualWidth()})),e}isResizable(){if(!this.displayedChildren)return!1;let e=!1;return this.displayedChildren.forEach((t=>{t.isResizable()&&(e=!0)})),e}getMinWidth(){let e=0;return this.displayedChildren.forEach((t=>{e+=t.getMinWidth()||0})),e}addChild(e){this.children||(this.children=[]),this.children.push(e)}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}getDisplayedLeafColumns(){const e=[];return this.addDisplayedLeafColumns(e),e}getDefinition(){return this.providedColumnGroup.getColGroupDef()}getColGroupDef(){return this.providedColumnGroup.getColGroupDef()}isPadding(){return this.providedColumnGroup.isPadding()}isExpandable(){return this.providedColumnGroup.isExpandable()}isExpanded(){return this.providedColumnGroup.isExpanded()}setExpanded(e){this.providedColumnGroup.setExpanded(e)}addDisplayedLeafColumns(t){this.displayedChildren.forEach((i=>{i instanceof $o?t.push(i):i instanceof e&&i.addDisplayedLeafColumns(t)}))}addLeafColumns(t){this.children.forEach((i=>{i instanceof $o?t.push(i):i instanceof e&&i.addLeafColumns(t)}))}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){const e=this.getParent();return this.isPadding()&&e&&e.isPadding()?1+e.getPaddingLevel():0}calculateDisplayedColumns(){this.displayedChildren=[];let t=this;for(;null!=t&&t.isPadding();)t=t.getParent();if(!t||!t.providedColumnGroup.isExpandable())return this.displayedChildren=this.children,void this.localEventService.dispatchEvent(this.createAgEvent(e.EVENT_DISPLAYED_CHILDREN_CHANGED));this.children.forEach((i=>{if(!(i instanceof e)||i.displayedChildren&&i.displayedChildren.length)switch(i.getColumnGroupShow()){case"open":t.providedColumnGroup.isExpanded()&&this.displayedChildren.push(i);break;case"closed":t.providedColumnGroup.isExpanded()||this.displayedChildren.push(i);break;default:this.displayedChildren.push(i)}})),this.localEventService.dispatchEvent(this.createAgEvent(e.EVENT_DISPLAYED_CHILDREN_CHANGED))}};Ln.EVENT_LEFT_CHANGED="leftChanged",Ln.EVENT_DISPLAYED_CHILDREN_CHANGED="displayedChildrenChanged",Gs([No("gridOptionsService")],Ln.prototype,"gos",2);var xn=Ln,In=class{};In.EVENT_COLUMN_EVERYTHING_CHANGED="columnEverythingChanged",In.EVENT_NEW_COLUMNS_LOADED="newColumnsLoaded",In.EVENT_COLUMN_PIVOT_MODE_CHANGED="columnPivotModeChanged",In.EVENT_PIVOT_MAX_COLUMNS_EXCEEDED="pivotMaxColumnsExceeded",In.EVENT_COLUMN_ROW_GROUP_CHANGED="columnRowGroupChanged",In.EVENT_EXPAND_COLLAPSE_ALL="expandOrCollapseAll",In.EVENT_COLUMN_PIVOT_CHANGED="columnPivotChanged",In.EVENT_GRID_COLUMNS_CHANGED="gridColumnsChanged",In.EVENT_COLUMN_VALUE_CHANGED="columnValueChanged",In.EVENT_COLUMN_MOVED="columnMoved",In.EVENT_COLUMN_VISIBLE="columnVisible",In.EVENT_COLUMN_PINNED="columnPinned",In.EVENT_COLUMN_GROUP_OPENED="columnGroupOpened",In.EVENT_COLUMN_RESIZED="columnResized",In.EVENT_DISPLAYED_COLUMNS_CHANGED="displayedColumnsChanged",In.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED="suppressMovableColumns",In.EVENT_SUPPRESS_MENU_HIDE_CHANGED="suppressMenuHide",In.EVENT_SUPPRESS_FIELD_DOT_NOTATION="suppressFieldDotNotation",In.EVENT_VIRTUAL_COLUMNS_CHANGED="virtualColumnsChanged",In.EVENT_COLUMN_HEADER_MOUSE_OVER="columnHeaderMouseOver",In.EVENT_COLUMN_HEADER_MOUSE_LEAVE="columnHeaderMouseLeave",In.EVENT_COLUMN_HEADER_CLICKED="columnHeaderClicked",In.EVENT_COLUMN_HEADER_CONTEXT_MENU="columnHeaderContextMenu",In.EVENT_ASYNC_TRANSACTIONS_FLUSHED="asyncTransactionsFlushed",In.EVENT_ROW_GROUP_OPENED="rowGroupOpened",In.EVENT_ROW_DATA_UPDATED="rowDataUpdated",In.EVENT_PINNED_ROW_DATA_CHANGED="pinnedRowDataChanged",In.EVENT_RANGE_SELECTION_CHANGED="rangeSelectionChanged",In.EVENT_CHART_CREATED="chartCreated",In.EVENT_CHART_RANGE_SELECTION_CHANGED="chartRangeSelectionChanged",In.EVENT_CHART_OPTIONS_CHANGED="chartOptionsChanged",In.EVENT_CHART_DESTROYED="chartDestroyed",In.EVENT_TOOL_PANEL_VISIBLE_CHANGED="toolPanelVisibleChanged",In.EVENT_TOOL_PANEL_SIZE_CHANGED="toolPanelSizeChanged",In.EVENT_COLUMN_PANEL_ITEM_DRAG_START="columnPanelItemDragStart",In.EVENT_COLUMN_PANEL_ITEM_DRAG_END="columnPanelItemDragEnd",In.EVENT_MODEL_UPDATED="modelUpdated",In.EVENT_CUT_START="cutStart",In.EVENT_CUT_END="cutEnd",In.EVENT_PASTE_START="pasteStart",In.EVENT_PASTE_END="pasteEnd",In.EVENT_FILL_START="fillStart",In.EVENT_FILL_END="fillEnd",In.EVENT_RANGE_DELETE_START="rangeDeleteStart",In.EVENT_RANGE_DELETE_END="rangeDeleteEnd",In.EVENT_UNDO_STARTED="undoStarted",In.EVENT_UNDO_ENDED="undoEnded",In.EVENT_REDO_STARTED="redoStarted",In.EVENT_REDO_ENDED="redoEnded",In.EVENT_KEY_SHORTCUT_CHANGED_CELL_START="keyShortcutChangedCellStart",In.EVENT_KEY_SHORTCUT_CHANGED_CELL_END="keyShortcutChangedCellEnd",In.EVENT_CELL_CLICKED="cellClicked",In.EVENT_CELL_DOUBLE_CLICKED="cellDoubleClicked",In.EVENT_CELL_MOUSE_DOWN="cellMouseDown",In.EVENT_CELL_CONTEXT_MENU="cellContextMenu",In.EVENT_CELL_VALUE_CHANGED="cellValueChanged",In.EVENT_CELL_EDIT_REQUEST="cellEditRequest",In.EVENT_ROW_VALUE_CHANGED="rowValueChanged",In.EVENT_CELL_FOCUSED="cellFocused",In.EVENT_CELL_FOCUS_CLEARED="cellFocusCleared",In.EVENT_FULL_WIDTH_ROW_FOCUSED="fullWidthRowFocused",In.EVENT_ROW_SELECTED="rowSelected",In.EVENT_SELECTION_CHANGED="selectionChanged",In.EVENT_TOOLTIP_SHOW="tooltipShow",In.EVENT_TOOLTIP_HIDE="tooltipHide",In.EVENT_CELL_KEY_DOWN="cellKeyDown",In.EVENT_CELL_MOUSE_OVER="cellMouseOver",In.EVENT_CELL_MOUSE_OUT="cellMouseOut",In.EVENT_FILTER_CHANGED="filterChanged",In.EVENT_FILTER_MODIFIED="filterModified",In.EVENT_FILTER_OPENED="filterOpened",In.EVENT_ADVANCED_FILTER_BUILDER_VISIBLE_CHANGED="advancedFilterBuilderVisibleChanged",In.EVENT_SORT_CHANGED="sortChanged",In.EVENT_VIRTUAL_ROW_REMOVED="virtualRowRemoved",In.EVENT_ROW_CLICKED="rowClicked",In.EVENT_ROW_DOUBLE_CLICKED="rowDoubleClicked",In.EVENT_GRID_READY="gridReady",In.EVENT_GRID_PRE_DESTROYED="gridPreDestroyed",In.EVENT_GRID_SIZE_CHANGED="gridSizeChanged",In.EVENT_VIEWPORT_CHANGED="viewportChanged",In.EVENT_SCROLLBAR_WIDTH_CHANGED="scrollbarWidthChanged",In.EVENT_FIRST_DATA_RENDERED="firstDataRendered",In.EVENT_DRAG_STARTED="dragStarted",In.EVENT_DRAG_STOPPED="dragStopped",In.EVENT_CHECKBOX_CHANGED="checkboxChanged",In.EVENT_ROW_EDITING_STARTED="rowEditingStarted",In.EVENT_ROW_EDITING_STOPPED="rowEditingStopped",In.EVENT_CELL_EDITING_STARTED="cellEditingStarted",In.EVENT_CELL_EDITING_STOPPED="cellEditingStopped",In.EVENT_BODY_SCROLL="bodyScroll",In.EVENT_BODY_SCROLL_END="bodyScrollEnd",In.EVENT_HEIGHT_SCALE_CHANGED="heightScaleChanged",In.EVENT_PAGINATION_CHANGED="paginationChanged",In.EVENT_COMPONENT_STATE_CHANGED="componentStateChanged",In.EVENT_STORE_REFRESHED="storeRefreshed",In.EVENT_STATE_UPDATED="stateUpdated",In.EVENT_COLUMN_MENU_VISIBLE_CHANGED="columnMenuVisibleChanged",In.EVENT_CONTEXT_MENU_VISIBLE_CHANGED="contextMenuVisibleChanged",In.EVENT_BODY_HEIGHT_CHANGED="bodyHeightChanged",In.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED="columnContainerWidthChanged",In.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED="displayedColumnsWidthChanged",In.EVENT_SCROLL_VISIBILITY_CHANGED="scrollVisibilityChanged",In.EVENT_COLUMN_HOVER_CHANGED="columnHoverChanged",In.EVENT_FLASH_CELLS="flashCells",In.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED="paginationPixelOffsetChanged",In.EVENT_DISPLAYED_ROWS_CHANGED="displayedRowsChanged",In.EVENT_LEFT_PINNED_WIDTH_CHANGED="leftPinnedWidthChanged",In.EVENT_RIGHT_PINNED_WIDTH_CHANGED="rightPinnedWidthChanged",In.EVENT_ROW_CONTAINER_HEIGHT_CHANGED="rowContainerHeightChanged",In.EVENT_HEADER_HEIGHT_CHANGED="headerHeightChanged",In.EVENT_COLUMN_HEADER_HEIGHT_CHANGED="columnHeaderHeightChanged",In.EVENT_ROW_DRAG_ENTER="rowDragEnter",In.EVENT_ROW_DRAG_MOVE="rowDragMove",In.EVENT_ROW_DRAG_LEAVE="rowDragLeave",In.EVENT_ROW_DRAG_END="rowDragEnd",In.EVENT_GRID_STYLES_CHANGED="gridStylesChanged",In.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST="columnRowGroupChangeRequest",In.EVENT_COLUMN_PIVOT_CHANGE_REQUEST="columnPivotChangeRequest",In.EVENT_COLUMN_VALUE_CHANGE_REQUEST="columnValueChangeRequest",In.EVENT_COLUMN_AGG_FUNC_CHANGE_REQUEST="columnAggFuncChangeRequest",In.EVENT_STORE_UPDATED="storeUpdated",In.EVENT_FILTER_DESTROYED="filterDestroyed",In.EVENT_ROW_DATA_UPDATE_STARTED="rowDataUpdateStarted",In.EVENT_ROW_COUNT_READY="rowCountReady",In.EVENT_ADVANCED_FILTER_ENABLED_CHANGED="advancedFilterEnabledChanged",In.EVENT_DATA_TYPES_INFERRED="dataTypesInferred",In.EVENT_FIELD_VALUE_CHANGED="fieldValueChanged",In.EVENT_FIELD_PICKER_VALUE_SELECTED="fieldPickerValueSelected",In.EVENT_SIDE_BAR_UPDATED="sideBarUpdated";var Nn=new Set([In.EVENT_GRID_PRE_DESTROYED,In.EVENT_FILL_START]),On=class{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let i;return i="number"!=typeof t?0:t+1,this.existingIds[e]=i,i}},Gn="ag-Grid-AutoColumn",kn=class extends Pn{createAutoGroupColumns(e){const t=[],i=this.gos.get("treeData");let s=this.gos.isGroupMultiAutoColumn();return i&&s&&(console.warn('AG Grid: you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data'),s=!1),s?e.forEach(((e,i)=>{t.push(this.createOneAutoGroupColumn(e,i))})):t.push(this.createOneAutoGroupColumn()),t}updateAutoGroupColumns(e,t){e.forEach(((e,i)=>this.updateOneAutoGroupColumn(e,i,t)))}createOneAutoGroupColumn(e,t){let i;i=e?`${Gn}-${e.getId()}`:Gn;const s=this.createAutoGroupColDef(i,e,t);s.colId=i;const o=new $o(s,null,i,!0);return this.context.createBean(o),o}updateOneAutoGroupColumn(e,t,i){const s=e.getColDef(),o="string"==typeof s.showRowGroup?s.showRowGroup:void 0,n=null!=o?this.columnModel.getPrimaryColumn(o):void 0,r=this.createAutoGroupColDef(e.getId(),null!=n?n:void 0,t);e.setColDef(r,null,i),this.columnFactory.applyColumnState(e,r,i)}createAutoGroupColDef(e,t,i){let s=this.createBaseColDef(t);oo(s,this.gos.get("autoGroupColumnDef")),s=this.columnFactory.addColumnDefaultAndTypes(s,e),this.gos.get("treeData")||Ws(s.field)&&Ws(s.valueGetter)&&Ws(s.filterValueGetter)&&"agGroupColumnFilter"!==s.filter&&(s.filter=!1),i&&i>0&&(s.headerCheckboxSelection=!1);const o=this.gos.isColumnsSortingCoupledToGroup(),n=s.valueGetter||null!=s.field;return o&&!n&&(s.sortIndex=void 0,s.initialSort=void 0),s}createBaseColDef(e){const t=this.gos.get("autoGroupColumnDef"),i={headerName:this.localeService.getLocaleTextFunc()("group","Group")};if(t&&(t.cellRenderer||t.cellRendererSelector)||(i.cellRenderer="agGroupCellRenderer"),e){const t=e.getColDef();Object.assign(i,{headerName:this.columnModel.getDisplayNameForColumn(e,"header"),headerValueGetter:t.headerValueGetter}),t.cellRenderer&&Object.assign(i,{cellRendererParams:{innerRenderer:t.cellRenderer,innerRendererParams:t.cellRendererParams}}),i.showRowGroup=e.getColId()}else i.showRowGroup=!0;return i}};Gs([No("columnModel")],kn.prototype,"columnModel",2),Gs([No("columnFactory")],kn.prototype,"columnFactory",2),kn=Gs([Io("autoGroupColService")],kn);var Vn={};Os(Vn,{camelCaseToHumanText:()=>$n,camelCaseToHyphenated:()=>Kn,capitalise:()=>Un,escapeString:()=>zn,utf8_encode:()=>Wn});var Hn=/[&<>"']/g,Bn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Wn(e){const t=String.fromCharCode;function i(e,i){return t(e>>i&63|128)}function s(e){if(e>=0&&e<=31&&10!==e)return`_x${e.toString(16).toUpperCase().padStart(4,"0")}_`;if(!(4294967168&e))return t(e);let s="";return 4294965248&e?4294901760&e?4292870144&e||(s=t(e>>18&7|240),s+=i(e,12),s+=i(e,6)):(function(e){if(e>=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}(e),s=t(e>>12&15|224),s+=i(e,6)):s=t(e>>6&31|192),s+=t(63&e|128),s}const o=function(e){const t=[];if(!e)return[];const i=e.length;let s,o,n=0;for(;n<i;)s=e.charCodeAt(n++),s>=55296&&s<=56319&&n<i?(o=e.charCodeAt(n++),56320==(64512&o)?t.push(((1023&s)<<10)+(1023&o)+65536):(t.push(s),n--)):t.push(s);return t}(e),n=o.length;let r,a=-1,l="";for(;++a<n;)r=o[a],l+=s(r);return l}function Un(e){return e[0].toUpperCase()+e.substring(1).toLowerCase()}function zn(e,t){if(null==e)return null;const i=e.toString().toString();return t?i:i.replace(Hn,(e=>Bn[e]))}function $n(e){return e&&null!=e?e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z])([a-z])/g,"$1 $2$3").replace(/\./g," ").split(" ").map((e=>e.substring(0,1).toUpperCase()+(e.length>1?e.substring(1,e.length):""))).join(" "):null}function Kn(e){return e.replace(/[A-Z]/g,(e=>`-${e.toLocaleLowerCase()}`))}var jn={};function Yn(e){const t=new Map;return e.forEach((e=>t.set(e[0],e[1]))),t}function qn(e,t){const i=new Map;return e.forEach((e=>i.set(t(e),e))),i}function Xn(e){const t=[];return e.forEach(((e,i)=>t.push(i))),t}Os(jn,{convertToMap:()=>Yn,keys:()=>Xn,mapById:()=>qn});var Qn=class extends Pn{constructor(){super(...arguments),this.primaryHeaderRowCount=0,this.secondaryHeaderRowCount=0,this.gridHeaderRowCount=0,this.displayedColumnsLeft=[],this.displayedColumnsRight=[],this.displayedColumnsCenter=[],this.displayedColumns=[],this.displayedColumnsAndGroupsMap={},this.viewportColumns=[],this.viewportColumnsHash="",this.headerViewportColumns=[],this.viewportColumnsCenter=[],this.headerViewportColumnsCenter=[],this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={},this.autoHeightActiveAtLeastOnce=!1,this.rowGroupColumns=[],this.valueColumns=[],this.pivotColumns=[],this.ready=!1,this.changeEventsDispatching=!1,this.autoGroupsNeedBuilding=!1,this.forceRecreateAutoGroups=!1,this.pivotMode=!1,this.bodyWidth=0,this.leftWidth=0,this.rightWidth=0,this.bodyWidthDirty=!0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}init(){this.suppressColumnVirtualisation=this.gos.get("suppressColumnVirtualisation");const e=this.gos.get("pivotMode");this.isPivotSettingAllowed(e)&&(this.pivotMode=e),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents"],(e=>this.buildAutoGroupColumns(Jn(e.source)))),this.addManagedPropertyListener("autoGroupColumnDef",(e=>this.onAutoGroupColumnDefChanged(Jn(e.source)))),this.addManagedPropertyListeners(["defaultColDef","columnTypes","suppressFieldDotNotation"],(e=>this.onSharedColDefChanged(Jn(e.source)))),this.addManagedPropertyListener("pivotMode",(e=>this.setPivotMode(this.gos.get("pivotMode"),Jn(e.source)))),this.addManagedListener(this.eventService,In.EVENT_FIRST_DATA_RENDERED,(()=>this.onFirstDataRendered()))}buildAutoGroupColumns(e){this.columnDefs&&(this.autoGroupsNeedBuilding=!0,this.forceRecreateAutoGroups=!0,this.updateGridColumns(),this.updateDisplayedColumns(e))}onAutoGroupColumnDefChanged(e){this.groupAutoColumns&&this.autoGroupColService.updateAutoGroupColumns(this.groupAutoColumns,e)}onSharedColDefChanged(e){this.gridColumns&&(this.groupAutoColumns&&this.autoGroupColService.updateAutoGroupColumns(this.groupAutoColumns,e),this.createColumnsFromColumnDefs(!0,e))}setColumnDefs(e,t){const i=!!this.columnDefs;this.columnDefs=e,this.createColumnsFromColumnDefs(i,t)}recreateColumnDefs(e){this.onSharedColDefChanged(e)}destroyOldColumns(e,t){const i={};if(!e)return;Mn(null,e,(e=>{i[e.getInstanceId()]=e})),t&&Mn(null,t,(e=>{i[e.getInstanceId()]=null}));const s=Object.values(i).filter((e=>null!=e));this.destroyBeans(s)}destroyColumns(){this.destroyOldColumns(this.primaryColumnTree),this.destroyOldColumns(this.secondaryBalancedTree),this.destroyOldColumns(this.groupAutoColsBalancedTree)}createColumnsFromColumnDefs(e,t){const i=e?this.compareColumnStatesAndDispatchEvents(t):void 0;this.valueCache.expire(),this.autoGroupsNeedBuilding=!0;const s=this.primaryColumns,o=this.primaryColumnTree,n=this.columnFactory.createColumnTree(this.columnDefs,!0,o,t);this.destroyOldColumns(this.primaryColumnTree,n.columnTree),this.primaryColumnTree=n.columnTree,this.primaryHeaderRowCount=n.treeDept+1,this.primaryColumns=this.getColumnsFromTree(this.primaryColumnTree),this.primaryColumnsMap={},this.primaryColumns.forEach((e=>this.primaryColumnsMap[e.getId()]=e)),this.extractRowGroupColumns(t,s),this.extractPivotColumns(t,s),this.extractValueColumns(t,s),this.ready=!0;const r=void 0===this.gridColsArePrimary;(this.gridColsArePrimary||r||this.autoGroupsNeedBuilding)&&(this.updateGridColumns(),e&&this.gridColsArePrimary&&!this.gos.get("maintainColumnOrder")&&this.orderGridColumnsLikePrimary(),this.updateDisplayedColumns(t),this.checkViewportColumns()),this.dispatchEverythingChanged(t),this.changeEventsDispatching=!0,i&&i(),this.changeEventsDispatching=!1,this.dispatchNewColumnsLoaded(t)}shouldRowModelIgnoreRefresh(){return this.changeEventsDispatching}dispatchNewColumnsLoaded(e){const t={type:In.EVENT_NEW_COLUMNS_LOADED,source:e};this.eventService.dispatchEvent(t),"gridInitializing"===e&&this.onColumnsReady()}dispatchEverythingChanged(e){const t={type:In.EVENT_COLUMN_EVERYTHING_CHANGED,source:e};this.eventService.dispatchEvent(t)}orderGridColumnsLikePrimary(){const e=this.primaryColumns;if(!e)return;const t=e.filter((e=>this.gridColumns.indexOf(e)>=0)),i=this.gridColumns.filter((e=>t.indexOf(e)<0));this.gridColumns=[...i,...t],this.gridColumns=this.placeLockedColumns(this.gridColumns)}getAllDisplayedAutoHeightCols(){return this.displayedAutoHeightCols}setViewport(){this.gos.get("enableRtl")?(this.viewportLeft=this.bodyWidth-this.scrollPosition-this.scrollWidth,this.viewportRight=this.bodyWidth-this.scrollPosition):(this.viewportLeft=this.scrollPosition,this.viewportRight=this.scrollWidth+this.scrollPosition)}checkViewportColumns(e=!1){if(null==this.displayedColumnsCenter)return;if(!this.extractViewport())return;const t={type:In.EVENT_VIRTUAL_COLUMNS_CHANGED,afterScroll:e};this.eventService.dispatchEvent(t)}setViewportPosition(e,t,i=!1){(e!==this.scrollWidth||t!==this.scrollPosition||this.bodyWidthDirty)&&(this.scrollWidth=e,this.scrollPosition=t,this.bodyWidthDirty=!0,this.setViewport(),this.ready&&this.checkViewportColumns(i))}isPivotMode(){return this.pivotMode}isPivotSettingAllowed(e){return!e||!this.gos.get("treeData")||(co("Pivot mode not available with treeData."),!1)}setPivotMode(e,t){if(e===this.pivotMode||!this.isPivotSettingAllowed(this.pivotMode))return;if(this.pivotMode=e,!this.gridColumns)return;this.autoGroupsNeedBuilding=!0,this.updateGridColumns(),this.updateDisplayedColumns(t);const i={type:In.EVENT_COLUMN_PIVOT_MODE_CHANGED};this.eventService.dispatchEvent(i)}getSecondaryPivotColumn(e,t){if(Ws(this.secondaryColumns))return null;const i=this.getPrimaryColumn(t);let s=null;return this.secondaryColumns.forEach((t=>{const o=t.getColDef().pivotKeys,n=t.getColDef().pivotValueColumn;Zo(o,e)&&n===i&&(s=t)})),s}setBeans(e){this.logger=e.create("columnModel")}setFirstRightAndLastLeftPinned(e){let t,i;this.gos.get("enableRtl")?(t=this.displayedColumnsLeft?this.displayedColumnsLeft[0]:null,i=this.displayedColumnsRight?Jo(this.displayedColumnsRight):null):(t=this.displayedColumnsLeft?Jo(this.displayedColumnsLeft):null,i=this.displayedColumnsRight?this.displayedColumnsRight[0]:null),this.gridColumns.forEach((s=>{s.setLastLeftPinned(s===t,e),s.setFirstRightPinned(s===i,e)}))}autoSizeColumns(e){if(this.shouldQueueResizeOperations)return void this.resizeOperationQueue.push((()=>this.autoSizeColumns(e)));const{columns:t,skipHeader:i,skipHeaderGroups:s,stopAtGroup:o,source:n="api"}=e;this.animationFrameService.flushAllFrames();const r=[];let a=-1;const l=null!=i?i:this.gos.get("skipHeaderOnAutoSize"),u=null!=s?s:l;for(;0!==a;)a=0,this.actionOnGridColumns(t,(e=>{if(r.indexOf(e)>=0)return!1;const t=this.autoWidthCalculator.getPreferredWidthForColumn(e,l);if(t>0){const i=this.normaliseColumnWidth(e,t);e.setActualWidth(i,n),r.push(e),a++}return!0}),n);u||this.autoSizeColumnGroupsByColumns(t,n,o),this.dispatchColumnResizedEvent(r,!0,"autosizeColumns")}dispatchColumnResizedEvent(e,t,i,s=null){if(e&&e.length){const o={type:In.EVENT_COLUMN_RESIZED,columns:e,column:1===e.length?e[0]:null,flexColumns:s,finished:t,source:i};this.eventService.dispatchEvent(o)}}dispatchColumnChangedEvent(e,t,i){const s={type:e,columns:t,column:t&&1==t.length?t[0]:null,source:i};this.eventService.dispatchEvent(s)}dispatchColumnMovedEvent(e){const{movedColumns:t,source:i,toIndex:s,finished:o}=e,n={type:In.EVENT_COLUMN_MOVED,columns:t,column:t&&1===t.length?t[0]:null,toIndex:s,finished:o,source:i};this.eventService.dispatchEvent(n)}dispatchColumnPinnedEvent(e,t){if(!e.length)return;const i=1===e.length?e[0]:null,s=this.getCommonValue(e,(e=>e.getPinned())),o={type:In.EVENT_COLUMN_PINNED,pinned:null!=s?s:null,columns:e,column:i,source:t};this.eventService.dispatchEvent(o)}dispatchColumnVisibleEvent(e,t){if(!e.length)return;const i=1===e.length?e[0]:null,s=this.getCommonValue(e,(e=>e.isVisible())),o={type:In.EVENT_COLUMN_VISIBLE,visible:s,columns:e,column:i,source:t};this.eventService.dispatchEvent(o)}autoSizeColumn(e,t,i){e&&this.autoSizeColumns({columns:[e],skipHeader:i,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,i){const s=new Set;let o;this.getGridColumns(e).forEach((e=>{let t=e.getParent();for(;t&&t!=i;)t.isPadding()||s.add(t),t=t.getParent()}));for(const e of s){for(const t of this.ctrlsService.getHeaderRowContainerCtrls())if(o=t.getHeaderCtrlForColumn(e),o)break;o&&o.resizeLeafColumnsToFit(t)}return[]}autoSizeAllColumns(e,t){if(this.shouldQueueResizeOperations)return void this.resizeOperationQueue.push((()=>this.autoSizeAllColumns(e,t)));const i=this.getAllDisplayedColumns();this.autoSizeColumns({columns:i,skipHeader:t,source:e})}getColumnsFromTree(e){const t=[],i=e=>{for(let s=0;s<e.length;s++){const o=e[s];o instanceof $o?t.push(o):o instanceof jo&&i(o.getChildren())}};return i(e),t}getAllDisplayedTrees(){return this.displayedTreeLeft&&this.displayedTreeRight&&this.displayedTreeCentre?this.displayedTreeLeft.concat(this.displayedTreeCentre).concat(this.displayedTreeRight):null}getPrimaryColumnTree(){return this.primaryColumnTree}getHeaderRowCount(){return this.gridHeaderRowCount}getDisplayedTreeLeft(){return this.displayedTreeLeft}getDisplayedTreeRight(){return this.displayedTreeRight}getDisplayedTreeCentre(){return this.displayedTreeCentre}isColumnDisplayed(e){return this.getAllDisplayedColumns().indexOf(e)>=0}getAllDisplayedColumns(){return this.displayedColumns}getViewportColumns(){return this.viewportColumns}getDisplayedLeftColumnsForRow(e){return this.colSpanActive?this.getDisplayedColumnsForRow(e,this.displayedColumnsLeft):this.displayedColumnsLeft}getDisplayedRightColumnsForRow(e){return this.colSpanActive?this.getDisplayedColumnsForRow(e,this.displayedColumnsRight):this.displayedColumnsRight}isColSpanActive(){return this.colSpanActive}getDisplayedColumnsForRow(e,t,i,s){const o=[];let n=null;for(let r=0;r<t.length;r++){const a=t[r],l=t.length-r,u=Math.min(a.getColSpan(e),l),h=[a];if(u>1){const e=u-1;for(let i=1;i<=e;i++)h.push(t[r+i]);r+=e}let d;i?(d=!1,h.forEach((e=>{i(e)&&(d=!0)}))):d=!0,d&&(0===o.length&&n&&s&&s(a)&&o.push(n),o.push(a)),n=a}return o}getViewportCenterColumnsForRow(e){if(!this.colSpanActive)return this.viewportColumnsCenter;const t=this.isColumnVirtualisationSuppressed()?null:this.isColumnInRowViewport.bind(this);return this.getDisplayedColumnsForRow(e,this.displayedColumnsCenter,t,(e=>{const t=e.getLeft();return Bs(t)&&t>this.viewportLeft}))}isColumnAtEdge(e,t){const i=this.getAllDisplayedColumns();if(!i.length)return!1;const s="first"===t;let o;if(e instanceof xn){const t=e.getDisplayedLeafColumns();if(!t.length)return!1;o=s?t[0]:Jo(t)}else o=e;return(s?i[0]:Jo(i))===o}getAriaColumnIndex(e){let t;return t=e instanceof xn?e.getLeafColumns()[0]:e,this.ariaOrderColumns.indexOf(t)+1}isColumnInHeaderViewport(e){return!!e.isAutoHeaderHeight()||this.isColumnInRowViewport(e)}isColumnInRowViewport(e){if(e.isAutoHeight())return!0;const t=e.getLeft()||0,i=t+e.getActualWidth(),s=this.viewportLeft-200,o=this.viewportRight+200;return!(t<s&&i<s||t>o&&i>o)}getDisplayedColumnsLeftWidth(){return this.getWidthOfColsInList(this.displayedColumnsLeft)}getDisplayedColumnsRightWidth(){return this.getWidthOfColsInList(this.displayedColumnsRight)}updatePrimaryColumnList(e,t,i,s,o,n){if(!e||Us(e))return;let r=!1;if(e.forEach((e=>{if(!e)return;const o=this.getPrimaryColumn(e);if(o){if(i){if(t.indexOf(o)>=0)return;t.push(o)}else{if(t.indexOf(o)<0)return;nn(t,o)}s(o),r=!0}})),!r)return;this.autoGroupsNeedBuilding&&this.updateGridColumns(),this.updateDisplayedColumns(n);const a={type:o,columns:t,column:1===t.length?t[0]:null,source:n};this.eventService.dispatchEvent(a)}setRowGroupColumns(e,t){this.autoGroupsNeedBuilding=!0,this.setPrimaryColumnList(e,this.rowGroupColumns,In.EVENT_COLUMN_ROW_GROUP_CHANGED,!0,this.setRowGroupActive.bind(this),t)}setRowGroupActive(e,t,i){e!==t.isRowGroupActive()&&(t.setRowGroupActive(e,i),e&&!this.gos.get("suppressRowGroupHidesColumns")&&this.setColumnsVisible([t],!1,i),e||this.gos.get("suppressMakeColumnVisibleAfterUnGroup")||this.setColumnsVisible([t],!0,i))}addRowGroupColumns(e,t){this.autoGroupsNeedBuilding=!0,this.updatePrimaryColumnList(e,this.rowGroupColumns,!0,this.setRowGroupActive.bind(this,!0),In.EVENT_COLUMN_ROW_GROUP_CHANGED,t)}removeRowGroupColumns(e,t){this.autoGroupsNeedBuilding=!0,this.updatePrimaryColumnList(e,this.rowGroupColumns,!1,this.setRowGroupActive.bind(this,!1),In.EVENT_COLUMN_ROW_GROUP_CHANGED,t)}addPivotColumns(e,t){this.updatePrimaryColumnList(e,this.pivotColumns,!0,(e=>e.setPivotActive(!0,t)),In.EVENT_COLUMN_PIVOT_CHANGED,t)}setPivotColumns(e,t){this.setPrimaryColumnList(e,this.pivotColumns,In.EVENT_COLUMN_PIVOT_CHANGED,!0,((e,i)=>{i.setPivotActive(e,t)}),t)}removePivotColumns(e,t){this.updatePrimaryColumnList(e,this.pivotColumns,!1,(e=>e.setPivotActive(!1,t)),In.EVENT_COLUMN_PIVOT_CHANGED,t)}setPrimaryColumnList(e,t,i,s,o,n){if(!this.gridColumns)return;const r=new Map;t.forEach(((e,t)=>r.set(e,t))),t.length=0,Bs(e)&&e.forEach((e=>{const i=this.getPrimaryColumn(e);i&&t.push(i)})),t.forEach(((e,t)=>{const i=r.get(e);void 0!==i?s&&i!==t||r.delete(e):r.set(e,0)})),(this.primaryColumns||[]).forEach((e=>{const i=t.indexOf(e)>=0;o(i,e)})),this.autoGroupsNeedBuilding&&this.updateGridColumns(),this.updateDisplayedColumns(n),this.dispatchColumnChangedEvent(i,[...r.keys()],n)}setValueColumns(e,t){this.setPrimaryColumnList(e,this.valueColumns,In.EVENT_COLUMN_VALUE_CHANGED,!1,this.setValueActive.bind(this),t)}setValueActive(e,t,i){if(e!==t.isValueActive()&&(t.setValueActive(e,i),e&&!t.getAggFunc()&&this.aggFuncService)){const e=this.aggFuncService.getDefaultAggFunc(t);t.setAggFunc(e)}}addValueColumns(e,t){this.updatePrimaryColumnList(e,this.valueColumns,!0,this.setValueActive.bind(this,!0),In.EVENT_COLUMN_VALUE_CHANGED,t)}removeValueColumns(e,t){this.updatePrimaryColumnList(e,this.valueColumns,!1,this.setValueActive.bind(this,!1),In.EVENT_COLUMN_VALUE_CHANGED,t)}normaliseColumnWidth(e,t){const i=e.getMinWidth();Bs(i)&&t<i&&(t=i);const s=e.getMaxWidth();return Bs(s)&&e.isGreaterThanMax(t)&&(t=s),t}getPrimaryOrGridColumn(e){return this.getPrimaryColumn(e)||this.getGridColumn(e)}setColumnWidths(e,t,i,s){const o=[];e.forEach((e=>{const i=this.getPrimaryOrGridColumn(e.key);if(i&&(o.push({width:e.newWidth,ratios:[1],columns:[i]}),"shift"===this.gos.get("colResizeDefault")&&(t=!t),t)){const t=this.getDisplayedColAfter(i);if(!t)return;const s=i.getActualWidth()-e.newWidth,n=t.getActualWidth()+s;o.push({width:n,ratios:[1],columns:[t]})}})),0!==o.length&&this.resizeColumnSets({resizeSets:o,finished:i,source:s})}checkMinAndMaxWidthsForSet(e){const{columns:t,width:i}=e;let s=0,o=0,n=!0;return t.forEach((e=>{const t=e.getMinWidth();s+=t||0;const i=e.getMaxWidth();Bs(i)&&i>0?o+=i:n=!1})),i>=s&&(!n||i<=o)}resizeColumnSets(e){const{resizeSets:t,finished:i,source:s}=e;if(t&&!t.every((e=>this.checkMinAndMaxWidthsForSet(e)))){if(i){const e=t&&t.length>0?t[0].columns:null;this.dispatchColumnResizedEvent(e,i,s)}return}const o=[],n=[];t.forEach((e=>{const{width:t,columns:i,ratios:r}=e,a={},l={};i.forEach((e=>n.push(e)));let u=!0,h=0;for(;u;){if(h++,h>1e3){console.error("AG Grid: infinite loop in resizeColumnSets");break}u=!1;const e=[];let s=0,o=t;i.forEach(((t,i)=>{if(l[t.getId()])o-=a[t.getId()];else{e.push(t);const o=r[i];s+=o}}));const n=1/s;e.forEach(((i,s)=>{let h;s===e.length-1?h=o:(h=Math.round(r[s]*t*n),o-=h);const d=i.getMinWidth(),c=i.getMaxWidth();Bs(d)&&h<d?(h=d,l[i.getId()]=!0,u=!0):Bs(c)&&c>0&&h>c&&(h=c,l[i.getId()]=!0,u=!0),a[i.getId()]=h}))}i.forEach((e=>{const t=a[e.getId()];e.getActualWidth()!==t&&(e.setActualWidth(t,s),o.push(e))}))}));const r=o.length>0;let a=[];r&&(a=this.refreshFlexedColumns({resizingCols:n,skipSetLeft:!0}),this.setLeftValues(s),this.updateBodyWidths(),this.checkViewportColumns());const l=n.concat(a);(r||i)&&this.dispatchColumnResizedEvent(l,i,s,a)}setColumnAggFunc(e,t,i){if(!e)return;const s=this.getPrimaryColumn(e);s&&(s.setAggFunc(t),this.dispatchColumnChangedEvent(In.EVENT_COLUMN_VALUE_CHANGED,[s],i))}moveRowGroupColumn(e,t,i){if(this.isRowGroupEmpty())return;const s=this.rowGroupColumns[e],o=this.rowGroupColumns.slice(e,t);this.rowGroupColumns.splice(e,1),this.rowGroupColumns.splice(t,0,s);const n={type:In.EVENT_COLUMN_ROW_GROUP_CHANGED,columns:o,column:1===o.length?o[0]:null,source:i};this.eventService.dispatchEvent(n)}moveColumns(e,t,i,s=!0){if(!this.gridColumns)return;if(this.columnAnimationService.start(),t>this.gridColumns.length-e.length)return console.warn("AG Grid: tried to insert columns in invalid location, toIndex = "+t),void console.warn("AG Grid: remember that you should not count the moving columns when calculating the new index");const o=this.getGridColumns(e);!this.doesMovePassRules(o,t)||(hn(this.gridColumns,o,t),this.updateDisplayedColumns(i),this.dispatchColumnMovedEvent({movedColumns:o,source:i,toIndex:t,finished:s}),this.columnAnimationService.finish())}doesMovePassRules(e,t){const i=this.getProposedColumnOrder(e,t);return this.doesOrderPassRules(i)}doesOrderPassRules(e){return!!this.doesMovePassMarryChildren(e)&&!!this.doesMovePassLockedPositions(e)}getProposedColumnOrder(e,t){const i=this.gridColumns.slice();return hn(i,e,t),i}sortColumnsLikeGridColumns(e){!e||e.length<=1||e.filter((e=>this.gridColumns.indexOf(e)<0)).length>0||e.sort(((e,t)=>this.gridColumns.indexOf(e)-this.gridColumns.indexOf(t)))}doesMovePassLockedPositions(e){let t=0,i=!0;return e.forEach((e=>{const s=(o=e.getColDef().lockPosition)?!0===o||"left"===o?0:2:1;var o;s<t&&(i=!1),t=s})),i}doesMovePassMarryChildren(e){let t=!0;return Mn(null,this.gridBalancedTree,(i=>{if(!(i instanceof jo))return;const s=i,o=s.getColGroupDef();if(!o||!o.marryChildren)return;const n=[];s.getLeafColumns().forEach((t=>{const i=e.indexOf(t);n.push(i)})),Math.max.apply(Math,n)-Math.min.apply(Math,n)>s.getLeafColumns().length-1&&(t=!1)})),t}moveColumnByIndex(e,t,i){if(!this.gridColumns)return;const s=this.gridColumns[e];this.moveColumns([s],t,i)}getColumnDefs(){if(!this.primaryColumns)return;const e=this.primaryColumns.slice();return this.gridColsArePrimary?e.sort(((e,t)=>this.gridColumns.indexOf(e)-this.gridColumns.indexOf(t))):this.lastPrimaryOrder&&e.sort(((e,t)=>this.lastPrimaryOrder.indexOf(e)-this.lastPrimaryOrder.indexOf(t))),this.columnDefFactory.buildColumnDefs(e,this.rowGroupColumns,this.pivotColumns)}getBodyContainerWidth(){return this.bodyWidth}getContainerWidth(e){switch(e){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}updateBodyWidths(){const e=this.getWidthOfColsInList(this.displayedColumnsCenter),t=this.getWidthOfColsInList(this.displayedColumnsLeft),i=this.getWidthOfColsInList(this.displayedColumnsRight);if(this.bodyWidthDirty=this.bodyWidth!==e,this.bodyWidth!==e||this.leftWidth!==t||this.rightWidth!==i){this.bodyWidth=e,this.leftWidth=t,this.rightWidth=i;const s={type:In.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED};this.eventService.dispatchEvent(s);const o={type:In.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED};this.eventService.dispatchEvent(o)}}getValueColumns(){return this.valueColumns?this.valueColumns:[]}getPivotColumns(){return this.pivotColumns?this.pivotColumns:[]}isPivotActive(){return this.pivotColumns&&this.pivotColumns.length>0&&this.pivotMode}getRowGroupColumns(){return this.rowGroupColumns?this.rowGroupColumns:[]}getDisplayedCenterColumns(){return this.displayedColumnsCenter}getDisplayedLeftColumns(){return this.displayedColumnsLeft}getDisplayedRightColumns(){return this.displayedColumnsRight}getAllPrimaryColumns(){return this.primaryColumns?this.primaryColumns:null}getSecondaryColumns(){return this.secondaryColumns?this.secondaryColumns:null}getAllColumnsForQuickFilter(){return this.columnsForQuickFilter}getAllGridColumns(){var e;return null!=(e=this.gridColumns)?e:[]}isRowGroupEmpty(){return Us(this.rowGroupColumns)}setColumnsVisible(e,t=!1,i){this.applyColumnState({state:e.map((e=>({colId:"string"==typeof e?e:e.getColId(),hide:!t})))},i)}setColumnsPinned(e,t,i){if(!this.gridColumns)return;if(this.gos.isDomLayout("print"))return void console.warn("AG Grid: Changing the column pinning status is not allowed with domLayout='print'");let s;this.columnAnimationService.start(),s=!0===t||"left"===t?"left":"right"===t?"right":null,this.actionOnGridColumns(e,(e=>e.getPinned()!==s&&(e.setPinned(s),!0)),i,(()=>({type:In.EVENT_COLUMN_PINNED,pinned:s,column:null,columns:null,source:i}))),this.columnAnimationService.finish()}actionOnGridColumns(e,t,i,s){if(Us(e))return;const o=[];if(e.forEach((e=>{if(!e)return;const i=this.getGridColumn(e);i&&!1!==t(i)&&o.push(i)})),o.length&&(this.updateDisplayedColumns(i),Bs(s)&&s)){const e=s();e.columns=o,e.column=1===o.length?o[0]:null,this.eventService.dispatchEvent(e)}}getDisplayedColBefore(e){const t=this.getAllDisplayedColumns(),i=t.indexOf(e);return i>0?t[i-1]:null}getDisplayedColAfter(e){const t=this.getAllDisplayedColumns(),i=t.indexOf(e);return i<t.length-1?t[i+1]:null}getDisplayedGroupAtDirection(e,t){const i=e.getProvidedColumnGroup().getLevel()+e.getPaddingLevel(),s=e.getDisplayedLeafColumns(),o="After"===t?Jo(s):s[0],n=`getDisplayedCol${t}`;for(;;){const t=this[n](o);if(!t)return null;const s=this.getColumnGroupAtLevel(t,i);if(s!==e)return s}}getColumnGroupAtLevel(e,t){let i,s,o=e.getParent();for(;i=o.getProvidedColumnGroup().getLevel(),s=o.getPaddingLevel(),!(i+s<=t);)o=o.getParent();return o}isPinningLeft(){return this.displayedColumnsLeft.length>0}isPinningRight(){return this.displayedColumnsRight.length>0}getPrimaryAndSecondaryAndAutoColumns(){return[].concat(this.primaryColumns||[],this.groupAutoColumns||[],this.secondaryColumns||[])}createStateItemFromColumn(e){const t=e.isRowGroupActive()?this.rowGroupColumns.indexOf(e):null,i=e.isPivotActive()?this.pivotColumns.indexOf(e):null,s=e.isValueActive()?e.getAggFunc():null,o=null!=e.getSort()?e.getSort():null,n=null!=e.getSortIndex()?e.getSortIndex():null,r=null!=e.getFlex()&&e.getFlex()>0?e.getFlex():null;return{colId:e.getColId(),width:e.getActualWidth(),hide:!e.isVisible(),pinned:e.getPinned(),sort:o,sortIndex:n,aggFunc:s,rowGroup:e.isRowGroupActive(),rowGroupIndex:t,pivot:e.isPivotActive(),pivotIndex:i,flex:r}}getColumnState(){if(Ws(this.primaryColumns)||!this.isAlive())return[];const e=this.getPrimaryAndSecondaryAndAutoColumns().map(this.createStateItemFromColumn.bind(this));return this.orderColumnStateList(e),e}orderColumnStateList(e){const t=Yn(this.gridColumns.map(((e,t)=>[e.getColId(),t])));e.sort(((e,i)=>(t.has(e.colId)?t.get(e.colId):-1)-(t.has(i.colId)?t.get(i.colId):-1)))}resetColumnState(e){if(Us(this.primaryColumns))return;const t=this.getColumnsFromTree(this.primaryColumnTree),i=[];let s=1e3,o=1e3,n=[];this.groupAutoColumns&&(n=n.concat(this.groupAutoColumns)),t&&(n=n.concat(t)),n.forEach((e=>{const t=this.getColumnStateFromColDef(e);Ws(t.rowGroupIndex)&&t.rowGroup&&(t.rowGroupIndex=s++),Ws(t.pivotIndex)&&t.pivot&&(t.pivotIndex=o++),i.push(t)})),this.applyColumnState({state:i,applyOrder:!0},e)}getColumnStateFromColDef(e){const t=(e,t)=>null!=e?e:null!=t?t:null,i=e.getColDef(),s=t(i.sort,i.initialSort),o=t(i.sortIndex,i.initialSortIndex),n=t(i.hide,i.initialHide),r=t(i.pinned,i.initialPinned),a=t(i.width,i.initialWidth),l=t(i.flex,i.initialFlex);let u=t(i.rowGroupIndex,i.initialRowGroupIndex),h=t(i.rowGroup,i.initialRowGroup);null!=u||null!=h&&0!=h||(u=null,h=null);let d=t(i.pivotIndex,i.initialPivotIndex),c=t(i.pivot,i.initialPivot);null!=d||null!=c&&0!=c||(d=null,c=null);const p=t(i.aggFunc,i.initialAggFunc);return{colId:e.getColId(),sort:s,sortIndex:o,hide:n,pinned:r,width:a,flex:l,rowGroup:h,rowGroupIndex:u,pivot:c,pivotIndex:d,aggFunc:p}}applyColumnState(e,t){if(Us(this.primaryColumns))return!1;if(e&&e.state&&!e.state.forEach)return console.warn("AG Grid: applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state."),!1;const i=(i,s,o)=>{const n=this.compareColumnStatesAndDispatchEvents(t);this.autoGroupsNeedBuilding=!0;const r=s.slice(),a={},l={},u=[],h=[];let d=0;const c=this.rowGroupColumns.slice(),p=this.pivotColumns.slice();i.forEach((i=>{const s=i.colId||"";if(s.startsWith(Gn))return u.push(i),void h.push(i);const n=o(s);n?(this.syncColumnWithStateItem(n,i,e.defaultState,a,l,!1,t),nn(r,n)):(h.push(i),d+=1)}));const g=i=>this.syncColumnWithStateItem(i,null,e.defaultState,a,l,!1,t);r.forEach(g);const m=(e,t,i,s)=>{const o=e[i.getId()],n=e[s.getId()],r=null!=o,a=null!=n;if(r&&a)return o-n;if(r)return-1;if(a)return 1;const l=t.indexOf(i),u=t.indexOf(s),h=l>=0;return h&&u>=0?l-u:h?-1:1};this.rowGroupColumns.sort(m.bind(this,a,c)),this.pivotColumns.sort(m.bind(this,l,p)),this.updateGridColumns();const f=this.groupAutoColumns?this.groupAutoColumns.slice():[];return u.forEach((i=>{const s=this.getAutoColumn(i.colId);nn(f,s),this.syncColumnWithStateItem(s,i,e.defaultState,null,null,!0,t)})),f.forEach(g),this.applyOrderAfterApplyState(e),this.updateDisplayedColumns(t),this.dispatchEverythingChanged(t),n(),{unmatchedAndAutoStates:h,unmatchedCount:d}};this.columnAnimationService.start();let{unmatchedAndAutoStates:s,unmatchedCount:o}=i(e.state||[],this.primaryColumns||[],(e=>this.getPrimaryColumn(e)));return(s.length>0||Bs(e.defaultState))&&(o=i(s,this.secondaryColumns||[],(e=>this.getSecondaryColumn(e))).unmatchedCount),this.columnAnimationService.finish(),0===o}applyOrderAfterApplyState(e){if(!e.applyOrder||!e.state)return;let t=[];const i={};e.state.forEach((e=>{if(!e.colId||i[e.colId])return;const s=this.gridColumnsMap[e.colId];s&&(t.push(s),i[e.colId]=!0)}));let s=0;this.gridColumns.forEach((e=>{const o=e.getColId();null==i[o]&&(o.startsWith(Gn)?ln(t,e,s++):t.push(e))})),t=this.placeLockedColumns(t),this.doesMovePassMarryChildren(t)?this.gridColumns=t:console.warn("AG Grid: Applying column order broke a group where columns should be married together. Applying new order has been discarded.")}compareColumnStatesAndDispatchEvents(e){const t={rowGroupColumns:this.rowGroupColumns.slice(),pivotColumns:this.pivotColumns.slice(),valueColumns:this.valueColumns.slice()},i=this.getColumnState(),s={};return i.forEach((e=>{s[e.colId]=e})),()=>{const o=this.getPrimaryAndSecondaryAndAutoColumns(),n=(t,i,s,o)=>{if(Zo(i.map(o),s.map(o)))return;const n=new Set(i);s.forEach((e=>{n.delete(e)||n.add(e)}));const r=[...n],a={type:t,columns:r,column:1===r.length?r[0]:null,source:e};this.eventService.dispatchEvent(a)},r=e=>{const t=[];return o.forEach((i=>{const o=s[i.getColId()];o&&e(o,i)&&t.push(i)})),t},a=e=>e.getColId();n(In.EVENT_COLUMN_ROW_GROUP_CHANGED,t.rowGroupColumns,this.rowGroupColumns,a),n(In.EVENT_COLUMN_PIVOT_CHANGED,t.pivotColumns,this.pivotColumns,a);const l=r(((e,t)=>{const i=null!=e.aggFunc,s=i!=t.isValueActive(),o=i&&e.aggFunc!=t.getAggFunc();return s||o}));l.length>0&&this.dispatchColumnChangedEvent(In.EVENT_COLUMN_VALUE_CHANGED,l,e),this.dispatchColumnResizedEvent(r(((e,t)=>e.width!=t.getActualWidth())),!0,e),this.dispatchColumnPinnedEvent(r(((e,t)=>e.pinned!=t.getPinned())),e),this.dispatchColumnVisibleEvent(r(((e,t)=>e.hide==t.isVisible())),e);const u=r(((e,t)=>e.sort!=t.getSort()||e.sortIndex!=t.getSortIndex()));u.length>0&&this.sortController.dispatchSortChangedEvents(e,u),this.normaliseColumnMovedEventForColumnState(i,e)}}getCommonValue(e,t){if(!e||0==e.length)return;const i=t(e[0]);for(let s=1;s<e.length;s++)if(i!==t(e[s]))return;return i}normaliseColumnMovedEventForColumnState(e,t){const i=this.getColumnState(),s={};i.forEach((e=>s[e.colId]=e));const o={};e.forEach((e=>{s[e.colId]&&(o[e.colId]=!0)}));const n=e.filter((e=>o[e.colId])),r=i.filter((e=>o[e.colId])),a=[];r.forEach(((e,t)=>{const i=n&&n[t];if(i&&i.colId!==e.colId){const e=this.getGridColumn(i.colId);e&&a.push(e)}})),a.length&&this.dispatchColumnMovedEvent({movedColumns:a,source:t,finished:!0})}syncColumnWithStateItem(e,t,i,s,o,n,r){var a;if(!e)return;const l=(e,s)=>{const o={value1:void 0,value2:void 0};let n=!1;return t&&(void 0!==t[e]&&(o.value1=t[e],n=!0),Bs(s)&&void 0!==t[s]&&(o.value2=t[s],n=!0)),!n&&i&&(void 0!==i[e]&&(o.value1=i[e]),Bs(s)&&void 0!==i[s]&&(o.value2=i[s])),o},u=l("hide").value1;void 0!==u&&e.setVisible(!u,r);const h=l("pinned").value1;void 0!==h&&e.setPinned(h);const d=null!=(a=e.getColDef().minWidth)?a:this.environment.getMinColWidth(),c=l("flex").value1;if(void 0!==c&&e.setFlex(c),null==c){const t=l("width").value1;null!=t&&null!=d&&t>=d&&e.setActualWidth(t,r)}const p=l("sort").value1;void 0!==p&&("desc"===p||"asc"===p?e.setSort(p,r):e.setSort(void 0,r));const g=l("sortIndex").value1;if(void 0!==g&&e.setSortIndex(g),n||!e.isPrimary())return;const m=l("aggFunc").value1;void 0!==m&&("string"==typeof m?(e.setAggFunc(m),e.isValueActive()||(e.setValueActive(!0,r),this.valueColumns.push(e))):(Bs(m)&&console.warn("AG Grid: stateItem.aggFunc must be a string. if using your own aggregation functions, register the functions first before using them in get/set state. This is because it is intended for the column state to be stored and retrieved as simple JSON."),e.isValueActive()&&(e.setValueActive(!1,r),nn(this.valueColumns,e))));const{value1:f,value2:C}=l("rowGroup","rowGroupIndex");void 0===f&&void 0===C||("number"==typeof C||f?(e.isRowGroupActive()||(e.setRowGroupActive(!0,r),this.rowGroupColumns.push(e)),s&&"number"==typeof C&&(s[e.getId()]=C)):e.isRowGroupActive()&&(e.setRowGroupActive(!1,r),nn(this.rowGroupColumns,e)));const{value1:v,value2:w}=l("pivot","pivotIndex");void 0===v&&void 0===w||("number"==typeof w||v?(e.isPivotActive()||(e.setPivotActive(!0,r),this.pivotColumns.push(e)),o&&"number"==typeof w&&(o[e.getId()]=w)):e.isPivotActive()&&(e.setPivotActive(!1,r),nn(this.pivotColumns,e)))}getGridColumns(e){return this.getColumns(e,this.getGridColumn.bind(this))}getColumns(e,t){const i=[];return e&&e.forEach((e=>{const s=t(e);s&&i.push(s)})),i}getColumnWithValidation(e){if(null==e)return null;const t=this.getGridColumn(e);return t||console.warn("AG Grid: could not find column "+e),t}getPrimaryColumn(e){return this.primaryColumns?this.getColumn(e,this.primaryColumns,this.primaryColumnsMap):null}getGridColumn(e){return this.getColumn(e,this.gridColumns,this.gridColumnsMap)}lookupGridColumn(e){return this.gridColumnsMap[e]}getSecondaryColumn(e){return this.secondaryColumns?this.getColumn(e,this.secondaryColumns,this.secondaryColumnsMap):null}getColumn(e,t,i){if(!e||!i)return null;if("string"==typeof e&&i[e])return i[e];for(let i=0;i<t.length;i++)if(this.columnsMatch(t[i],e))return t[i];return this.getAutoColumn(e)}getSourceColumnsForGroupColumn(e){const t=e.getColDef().showRowGroup;if(!t)return null;if(!0===t)return this.rowGroupColumns.slice(0);const i=this.getPrimaryColumn(t);return i?[i]:null}getAutoColumn(e){return this.groupAutoColumns&&Bs(this.groupAutoColumns)&&!Ws(this.groupAutoColumns)&&this.groupAutoColumns.find((t=>this.columnsMatch(t,e)))||null}columnsMatch(e,t){const i=e===t,s=e.getColDef()===t,o=e.getColId()==t;return i||s||o}getDisplayNameForColumn(e,t,i=!1){if(!e)return null;const s=this.getHeaderName(e.getColDef(),e,null,null,t);return i?this.wrapHeaderNameWithAggFunc(e,s):s}getDisplayNameForProvidedColumnGroup(e,t,i){const s=t?t.getColGroupDef():null;return s?this.getHeaderName(s,null,e,t,i):null}getDisplayNameForColumnGroup(e,t){return this.getDisplayNameForProvidedColumnGroup(e,e.getProvidedColumnGroup(),t)}getHeaderName(e,t,i,s,o){const n=e.headerValueGetter;if(n){const r=this.gos.addGridCommonParams({colDef:e,column:t,columnGroup:i,providedColumnGroup:s,location:o});return"function"==typeof n?n(r):"string"==typeof n?this.expressionService.evaluate(n,r):(console.warn("AG Grid: headerValueGetter must be a function or a string"),"")}return null!=e.headerName?e.headerName:e.field?$n(e.field):""}wrapHeaderNameWithAggFunc(e,t){if(this.gos.get("suppressAggFuncInHeader"))return t;const i=e.getColDef().pivotValueColumn;let s,o=null;if(Bs(i)){const n=this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&1===this.valueColumns.length,r=void 0!==e.getColDef().pivotTotalColumnIds;if(n&&!r)return t;o=i?i.getAggFunc():null,s=!0}else{const t=e.isValueActive(),i=this.pivotMode||!this.isRowGroupEmpty();t&&i?(o=e.getAggFunc(),s=!0):s=!1}if(s){const e="string"==typeof o?o:"func";return`${this.localeService.getLocaleTextFunc()(e,e)}(${t})`}return t}getColumnGroup(e,t){if(!e)return null;if(e instanceof xn)return e;const i=this.getAllDisplayedTrees(),s="number"==typeof t;let o=null;return Zn(i,!1,(i=>{if(i instanceof xn){const n=i;let r;r=s?e===n.getGroupId()&&t===n.getPartId():e===n.getGroupId(),r&&(o=n)}})),o}isReady(){return this.ready}extractValueColumns(e,t){this.valueColumns=this.extractColumns(t,this.valueColumns,((t,i)=>t.setValueActive(i,e)),(()=>{}),(()=>{}),(e=>{const t=e.aggFunc;return null===t||""===t?null:void 0!==t?!!t:void 0}),(e=>null!=e.initialAggFunc&&""!=e.initialAggFunc)),this.valueColumns.forEach((e=>{const t=e.getColDef();null!=t.aggFunc&&""!=t.aggFunc?e.setAggFunc(t.aggFunc):e.getAggFunc()||e.setAggFunc(t.initialAggFunc)}))}extractRowGroupColumns(e,t){this.rowGroupColumns=this.extractColumns(t,this.rowGroupColumns,((t,i)=>t.setRowGroupActive(i,e)),(e=>e.rowGroupIndex),(e=>e.initialRowGroupIndex),(e=>e.rowGroup),(e=>e.initialRowGroup))}extractColumns(e=[],t=[],i,s,o,n,r){const a=[],l=[];(this.primaryColumns||[]).forEach((i=>{const u=e.indexOf(i)<0,h=i.getColDef(),d=Ks(n(h)),c=Ks(r(h)),p=$s(s(h)),g=$s(o(h));let m;m=void 0!==d?d:void 0!==p?null!==p&&p>=0:u?void 0!==c?c:!(void 0===g)&&null!=g&&g>=0:t.indexOf(i)>=0,m&&((u?null!=p||null!=g:null!=p)?a.push(i):l.push(i))}));const u=e=>{const t=s(e.getColDef()),i=o(e.getColDef());return null!=t?t:i};a.sort(((e,t)=>{const i=u(e),s=u(t);return i===s?0:i<s?-1:1}));const h=[].concat(a);return t.forEach((e=>{l.indexOf(e)>=0&&h.push(e)})),l.forEach((e=>{h.indexOf(e)<0&&h.push(e)})),t.forEach((e=>{h.indexOf(e)<0&&i(e,!1)})),h.forEach((e=>{t.indexOf(e)<0&&i(e,!0)})),h}extractPivotColumns(e,t){this.pivotColumns=this.extractColumns(t,this.pivotColumns,((t,i)=>t.setPivotActive(i,e)),(e=>e.pivotIndex),(e=>e.initialPivotIndex),(e=>e.pivot),(e=>e.initialPivot))}resetColumnGroupState(e){if(!this.primaryColumnTree)return;const t=[];Mn(null,this.primaryColumnTree,(e=>{if(e instanceof jo){const i=e.getColGroupDef(),s={groupId:e.getGroupId(),open:i?i.openByDefault:void 0};t.push(s)}})),this.setColumnGroupState(t,e)}getColumnGroupState(){const e=[];return Mn(null,this.gridBalancedTree,(t=>{t instanceof jo&&e.push({groupId:t.getGroupId(),open:t.isExpanded()})})),e}setColumnGroupState(e,t){if(!this.gridBalancedTree)return;this.columnAnimationService.start();const i=[];if(e.forEach((e=>{const t=e.groupId,s=e.open,o=this.getProvidedColumnGroup(t);o&&o.isExpanded()!==s&&(this.logger.log("columnGroupOpened("+o.getGroupId()+","+s+")"),o.setExpanded(s),i.push(o))})),this.updateGroupsAndDisplayedColumns(t),this.setFirstRightAndLastLeftPinned(t),i.length){const e={type:In.EVENT_COLUMN_GROUP_OPENED,columnGroup:1===jo.length?i[0]:void 0,columnGroups:i};this.eventService.dispatchEvent(e)}this.columnAnimationService.finish()}setColumnGroupOpened(e,t,i){let s;s=e instanceof jo?e.getId():e||"",this.setColumnGroupState([{groupId:s,open:t}],i)}getProvidedColumnGroup(e){"string"!=typeof e&&console.error("AG Grid: group key must be a string");let t=null;return Mn(null,this.gridBalancedTree,(i=>{i instanceof jo&&i.getId()===e&&(t=i)})),t}calculateColumnsForDisplay(){let e;return e=this.pivotMode&&Ws(this.secondaryColumns)?this.gridColumns.filter((e=>{const t=this.groupAutoColumns&&dn(this.groupAutoColumns,e),i=this.valueColumns&&dn(this.valueColumns,e);return t||i})):this.gridColumns.filter((e=>this.groupAutoColumns&&dn(this.groupAutoColumns,e)||e.isVisible())),e}checkColSpanActiveInCols(e){let t=!1;return e.forEach((e=>{Bs(e.getColDef().colSpan)&&(t=!0)})),t}calculateColumnsForGroupDisplay(){this.groupDisplayColumns=[],this.groupDisplayColumnsMap={},this.gridColumns.forEach((e=>{const t=e.getColDef(),i=t.showRowGroup;t&&Bs(i)&&(this.groupDisplayColumns.push(e),"string"==typeof i?this.groupDisplayColumnsMap[i]=e:!0===i&&this.getRowGroupColumns().forEach((t=>{this.groupDisplayColumnsMap[t.getId()]=e})))}))}getGroupDisplayColumns(){return this.groupDisplayColumns}getGroupDisplayColumnForGroup(e){return this.groupDisplayColumnsMap[e]}updateDisplayedColumns(e){const t=this.calculateColumnsForDisplay();this.buildDisplayedTrees(t),this.updateGroupsAndDisplayedColumns(e),this.setFirstRightAndLastLeftPinned(e)}isSecondaryColumnsPresent(){return Bs(this.secondaryColumns)}setSecondaryColumns(e,t){if(!this.gridColumns)return;const i=e;if(i||!Ws(this.secondaryColumns)){if(i){this.processSecondaryColumnDefinitions(e);const i=this.columnFactory.createColumnTree(e,!1,this.secondaryBalancedTree||this.previousSecondaryColumns||void 0,t);this.destroyOldColumns(this.secondaryBalancedTree,i.columnTree),this.secondaryBalancedTree=i.columnTree,this.secondaryHeaderRowCount=i.treeDept+1,this.secondaryColumns=this.getColumnsFromTree(this.secondaryBalancedTree),this.secondaryColumnsMap={},this.secondaryColumns.forEach((e=>this.secondaryColumnsMap[e.getId()]=e)),this.previousSecondaryColumns=null}else this.previousSecondaryColumns=this.secondaryBalancedTree,this.secondaryBalancedTree=null,this.secondaryHeaderRowCount=-1,this.secondaryColumns=null,this.secondaryColumnsMap={};this.updateGridColumns(),this.updateDisplayedColumns(t)}}processSecondaryColumnDefinitions(e){const t=this.gos.get("processPivotResultColDef"),i=this.gos.get("processPivotResultColGroupDef");if(!t&&!i)return;const s=e=>{e.forEach((e=>{if(Bs(e.children)){const t=e;i&&i(t),s(t.children)}else t&&t(e)}))};e&&s(e)}updateGridColumns(){const e=this.gridBalancedTree;if(this.gridColsArePrimary?this.lastPrimaryOrder=this.gridColumns:this.lastSecondaryOrder=this.gridColumns,this.createGroupAutoColumnsIfNeeded()){const e=Yn(this.groupAutoColumns.map((e=>[e,!0])));this.lastPrimaryOrder&&(this.lastPrimaryOrder=this.lastPrimaryOrder.filter((t=>!e.has(t))),this.lastPrimaryOrder=[...this.groupAutoColumns,...this.lastPrimaryOrder]),this.lastSecondaryOrder&&(this.lastSecondaryOrder=this.lastSecondaryOrder.filter((t=>!e.has(t))),this.lastSecondaryOrder=[...this.groupAutoColumns,...this.lastSecondaryOrder])}let t;if(this.secondaryColumns&&this.secondaryBalancedTree){const e=this.secondaryColumns.some((e=>void 0!==this.gridColumnsMap[e.getColId()]));this.gridBalancedTree=this.secondaryBalancedTree.slice(),this.gridHeaderRowCount=this.secondaryHeaderRowCount,this.gridColumns=this.secondaryColumns.slice(),this.gridColsArePrimary=!1,e&&(t=this.lastSecondaryOrder)}else this.primaryColumns&&(this.gridBalancedTree=this.primaryColumnTree.slice(),this.gridHeaderRowCount=this.primaryHeaderRowCount,this.gridColumns=this.primaryColumns.slice(),this.gridColsArePrimary=!0,t=this.lastPrimaryOrder);if(this.addAutoGroupToGridColumns(),this.orderGridColsLike(t),this.gridColumns=this.placeLockedColumns(this.gridColumns),this.calculateColumnsForGroupDisplay(),this.refreshQuickFilterColumns(),this.clearDisplayedAndViewportColumns(),this.colSpanActive=this.checkColSpanActiveInCols(this.gridColumns),this.gridColumnsMap={},this.gridColumns.forEach((e=>this.gridColumnsMap[e.getId()]=e)),this.setAutoHeightActive(),!Zo(e,this.gridBalancedTree)){const e={type:In.EVENT_GRID_COLUMNS_CHANGED};this.eventService.dispatchEvent(e)}}setAutoHeightActive(){this.autoHeightActive=this.gridColumns.filter((e=>e.isAutoHeight())).length>0,this.autoHeightActive&&(this.autoHeightActiveAtLeastOnce=!0,this.gos.isRowModelType("clientSide")||this.gos.isRowModelType("serverSide")||co("autoHeight columns only work with Client Side Row Model and Server Side Row Model."))}orderGridColsLike(e){if(Ws(e))return;const t=Yn(e.map(((e,t)=>[e,t])));let i=!0;if(this.gridColumns.forEach((e=>{t.has(e)&&(i=!1)})),i)return;const s=Yn(this.gridColumns.map((e=>[e,!0]))),o=e.filter((e=>s.has(e))),n=Yn(o.map((e=>[e,!0]))),r=this.gridColumns.filter((e=>!n.has(e))),a=o.slice();r.forEach((e=>{let t=e.getOriginalParent();if(!t)return void a.push(e);const i=[];for(;!i.length&&t;)t.getLeafColumns().forEach((e=>{const t=a.indexOf(e)>=0,s=i.indexOf(e)<0;t&&s&&i.push(e)})),t=t.getOriginalParent();if(!i.length)return void a.push(e);const s=i.map((e=>a.indexOf(e))),o=Math.max(...s);ln(a,e,o+1)})),this.gridColumns=a}isPrimaryColumnGroupsPresent(){return this.primaryHeaderRowCount>1}refreshQuickFilterColumns(){var e;let t=null!=(e=this.isPivotMode()&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")?this.secondaryColumns:this.primaryColumns)?e:[];this.groupAutoColumns&&(t=t.concat(this.groupAutoColumns)),this.columnsForQuickFilter=this.gos.get("includeHiddenColumnsInQuickFilter")?t:t.filter((e=>e.isVisible()||e.isRowGroupActive()))}placeLockedColumns(e){const t=[],i=[],s=[];return e.forEach((e=>{const o=e.getColDef().lockPosition;"right"===o?s.push(e):"left"===o||!0===o?t.push(e):i.push(e)})),[...t,...i,...s]}addAutoGroupToGridColumns(){if(Ws(this.groupAutoColumns))return this.destroyOldColumns(this.groupAutoColsBalancedTree),void(this.groupAutoColsBalancedTree=null);this.gridColumns=this.groupAutoColumns?this.groupAutoColumns.concat(this.gridColumns):this.gridColumns;const e=this.columnFactory.createForAutoGroups(this.groupAutoColumns,this.gridBalancedTree);this.destroyOldColumns(this.groupAutoColsBalancedTree,e),this.groupAutoColsBalancedTree=e,this.gridBalancedTree=e.concat(this.gridBalancedTree)}clearDisplayedAndViewportColumns(){this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={},this.displayedColumnsLeft=[],this.displayedColumnsRight=[],this.displayedColumnsCenter=[],this.displayedColumns=[],this.ariaOrderColumns=[],this.viewportColumns=[],this.headerViewportColumns=[],this.viewportColumnsHash=""}updateGroupsAndDisplayedColumns(e){this.updateOpenClosedVisibilityInColumnGroups(),this.deriveDisplayedColumns(e),this.refreshFlexedColumns(),this.extractViewport(),this.updateBodyWidths();const t={type:In.EVENT_DISPLAYED_COLUMNS_CHANGED};this.eventService.dispatchEvent(t)}deriveDisplayedColumns(e){this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeLeft,this.displayedColumnsLeft),this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeCentre,this.displayedColumnsCenter),this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeRight,this.displayedColumnsRight),this.joinColumnsAriaOrder(),this.joinDisplayedColumns(),this.setLeftValues(e),this.displayedAutoHeightCols=this.displayedColumns.filter((e=>e.isAutoHeight()))}isAutoRowHeightActive(){return this.autoHeightActive}wasAutoRowHeightEverActive(){return this.autoHeightActiveAtLeastOnce}joinColumnsAriaOrder(){const e=this.getAllGridColumns(),t=[],i=[],s=[];for(const o of e){const e=o.getPinned();e?!0===e||"left"===e?t.push(o):s.push(o):i.push(o)}this.ariaOrderColumns=t.concat(i).concat(s)}joinDisplayedColumns(){this.gos.get("enableRtl")?this.displayedColumns=this.displayedColumnsRight.concat(this.displayedColumnsCenter).concat(this.displayedColumnsLeft):this.displayedColumns=this.displayedColumnsLeft.concat(this.displayedColumnsCenter).concat(this.displayedColumnsRight)}setLeftValues(e){this.setLeftValuesOfColumns(e),this.setLeftValuesOfGroups()}setLeftValuesOfColumns(e){if(!this.primaryColumns)return;const t=this.getPrimaryAndSecondaryAndAutoColumns().slice(0),i=this.gos.get("enableRtl");[this.displayedColumnsLeft,this.displayedColumnsRight,this.displayedColumnsCenter].forEach((s=>{if(i){let t=this.getWidthOfColsInList(s);s.forEach((i=>{t-=i.getActualWidth(),i.setLeft(t,e)}))}else{let t=0;s.forEach((i=>{i.setLeft(t,e),t+=i.getActualWidth()}))}rn(t,s)})),t.forEach((t=>{t.setLeft(null,e)}))}setLeftValuesOfGroups(){[this.displayedTreeLeft,this.displayedTreeRight,this.displayedTreeCentre].forEach((e=>{e.forEach((e=>{e instanceof xn&&e.checkLeft()}))}))}derivedDisplayedColumnsFromDisplayedTree(e,t){t.length=0,Zn(e,!0,(e=>{e instanceof $o&&t.push(e)}))}isColumnVirtualisationSuppressed(){return this.suppressColumnVirtualisation||0===this.viewportRight}extractViewportColumns(){this.isColumnVirtualisationSuppressed()?(this.viewportColumnsCenter=this.displayedColumnsCenter,this.headerViewportColumnsCenter=this.displayedColumnsCenter):(this.viewportColumnsCenter=this.displayedColumnsCenter.filter(this.isColumnInRowViewport.bind(this)),this.headerViewportColumnsCenter=this.displayedColumnsCenter.filter(this.isColumnInHeaderViewport.bind(this))),this.viewportColumns=this.viewportColumnsCenter.concat(this.displayedColumnsLeft).concat(this.displayedColumnsRight),this.headerViewportColumns=this.headerViewportColumnsCenter.concat(this.displayedColumnsLeft).concat(this.displayedColumnsRight)}getVirtualHeaderGroupRow(e,t){let i;switch(e){case"left":i=this.viewportRowLeft[t];break;case"right":i=this.viewportRowRight[t];break;default:i=this.viewportRowCenter[t]}return Ws(i)&&(i=[]),i}calculateHeaderRows(){this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={};const e={};this.headerViewportColumns.forEach((t=>e[t.getId()]=!0));const t=(i,s,o)=>{let n=!1;for(let r=0;r<i.length;r++){const a=i[r];let l=!1;if(a instanceof $o)l=!0===e[a.getId()];else{const e=a.getDisplayedChildren();e&&(l=t(e,s,o+1))}l&&(n=!0,s[o]||(s[o]=[]),s[o].push(a))}return n};t(this.displayedTreeLeft,this.viewportRowLeft,0),t(this.displayedTreeRight,this.viewportRowRight,0),t(this.displayedTreeCentre,this.viewportRowCenter,0)}extractViewport(){this.extractViewportColumns();const e=this.viewportColumns.map((e=>`${e.getId()}-${e.getPinned()||"normal"}`)).join("#"),t=this.viewportColumnsHash!==e;return t&&(this.viewportColumnsHash=e,this.calculateHeaderRows()),t}refreshFlexedColumns(e={}){var t;const i=e.source?e.source:"flex";if(null!=e.viewportWidth&&(this.flexViewportWidth=e.viewportWidth),!this.flexViewportWidth)return[];let s=-1;if(e.resizingCols){const t=new Set(e.resizingCols);let i=this.displayedColumnsCenter;for(let e=i.length-1;e>=0;e--)if(t.has(i[e])){s=e;break}}let o=0,n=[],r=0,a=0;for(let e=0;e<this.displayedColumnsCenter.length;e++)this.displayedColumnsCenter[e].getFlex()&&e>s?(n.push(this.displayedColumnsCenter[e]),a+=this.displayedColumnsCenter[e].getFlex(),r+=null!=(t=this.displayedColumnsCenter[e].getMinWidth())?t:0):o+=this.displayedColumnsCenter[e].getActualWidth();if(!n.length)return[];let l=[];o+r>this.flexViewportWidth&&(n.forEach((e=>{var t;return e.setActualWidth(null!=(t=e.getMinWidth())?t:0,i)})),l=n,n=[]);const u=[];let h;e:for(;;){h=this.flexViewportWidth-o;const e=h/a;for(let t=0;t<n.length;t++){const s=n[t],r=e*s.getFlex();let h=0;const d=s.getMinWidth(),c=s.getMaxWidth();if(Bs(d)&&r<d?h=d:Bs(c)&&r>c&&(h=c),h){s.setActualWidth(h,i),on(n,s),a-=s.getFlex(),l.push(s),o+=s.getActualWidth();continue e}u[t]=Math.round(r)}break}let d=h;return n.forEach(((e,t)=>{e.setActualWidth(Math.min(u[t],d),i),l.push(e),d-=u[t]})),e.skipSetLeft||this.setLeftValues(i),e.updateBodyWidths&&this.updateBodyWidths(),e.fireResizedEvent&&this.dispatchColumnResizedEvent(l,!0,i,n),n}sizeColumnsToFit(e,t="sizeColumnsToFit",i,s){var o,n,r,a,l;if(this.shouldQueueResizeOperations)return void this.resizeOperationQueue.push((()=>this.sizeColumnsToFit(e,t,i,s)));const u={};s&&(null==(o=null==s?void 0:s.columnLimits)||o.forEach((e=>{var t=e,{key:i}=t,s=((e,t)=>{var i={};for(var s in e)Ls.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&Ms)for(var s of Ms(e))t.indexOf(s)<0&&xs.call(e,s)&&(i[s]=e[s]);return i})(t,["key"]);u["string"==typeof i?i:i.getColId()]=s})));const h=this.getAllDisplayedColumns(),d=e===this.getWidthOfColsInList(h);if(e<=0||!h.length||d)return;const c=[],p=[];h.forEach((e=>{!0===e.getColDef().suppressSizeToFit?p.push(e):c.push(e)}));const g=c.slice(0);let m=!1;const f=e=>{nn(c,e),p.push(e)};for(c.forEach((e=>{var i,o;e.resetActualWidth(t);const n=null==u?void 0:u[e.getId()],r=null!=(i=null==n?void 0:n.minWidth)?i:null==s?void 0:s.defaultMinWidth,a=null!=(o=null==n?void 0:n.maxWidth)?o:null==s?void 0:s.defaultMaxWidth,l=e.getActualWidth();"number"==typeof r&&l<r?e.setActualWidth(r,t,!0):"number"==typeof a&&l>a&&e.setActualWidth(a,t,!0)}));!m;){m=!0;const i=e-this.getWidthOfColsInList(p);if(i<=0)c.forEach((e=>{var i,o;const n=null!=(o=null==(i=null==u?void 0:u[e.getId()])?void 0:i.minWidth)?o:null==s?void 0:s.defaultMinWidth;"number"!=typeof n?e.setMinimum(t):e.setActualWidth(n,t,!0)}));else{const e=i/this.getWidthOfColsInList(c);let o=i;for(let i=c.length-1;i>=0;i--){const h=c[i],d=null==u?void 0:u[h.getId()],p=null!=(n=null==d?void 0:d.minWidth)?n:null==s?void 0:s.defaultMinWidth,g=null!=(r=null==d?void 0:d.maxWidth)?r:null==s?void 0:s.defaultMaxWidth,C=null!=(a=h.getMinWidth())?a:0,v=null!=(l=h.getMaxWidth())?l:Number.MAX_VALUE,w="number"==typeof p&&p>C?p:h.getMinWidth(),y="number"==typeof g&&g<v?g:h.getMaxWidth();let E=Math.round(h.getActualWidth()*e);Bs(w)&&E<w?(E=w,f(h),m=!1):Bs(y)&&E>y?(E=y,f(h),m=!1):0===i&&(E=o),h.setActualWidth(E,t,!0),o-=E}}}g.forEach((e=>{e.fireColumnWidthChangedEvent(t)})),this.setLeftValues(t),this.updateBodyWidths(),i||this.dispatchColumnResizedEvent(g,!0,t)}buildDisplayedTrees(e){const t=[],i=[],s=[];e.forEach((e=>{switch(e.getPinned()){case"left":t.push(e);break;case"right":i.push(e);break;default:s.push(e)}}));const o=new On;this.displayedTreeLeft=this.displayedGroupCreator.createDisplayedGroups(t,o,"left",this.displayedTreeLeft),this.displayedTreeRight=this.displayedGroupCreator.createDisplayedGroups(i,o,"right",this.displayedTreeRight),this.displayedTreeCentre=this.displayedGroupCreator.createDisplayedGroups(s,o,null,this.displayedTreeCentre),this.updateDisplayedMap()}updateDisplayedMap(){this.displayedColumnsAndGroupsMap={};const e=e=>{this.displayedColumnsAndGroupsMap[e.getUniqueId()]=e};Zn(this.displayedTreeCentre,!1,e),Zn(this.displayedTreeLeft,!1,e),Zn(this.displayedTreeRight,!1,e)}isDisplayed(e){return this.displayedColumnsAndGroupsMap[e.getUniqueId()]===e}updateOpenClosedVisibilityInColumnGroups(){Zn(this.getAllDisplayedTrees(),!1,(e=>{e instanceof xn&&e.calculateDisplayedColumns()}))}getGroupAutoColumns(){return this.groupAutoColumns}createGroupAutoColumnsIfNeeded(){const e=this.forceRecreateAutoGroups;if(this.forceRecreateAutoGroups=!1,!this.autoGroupsNeedBuilding)return!1;this.autoGroupsNeedBuilding=!1;const t=this.gos.isGroupUseEntireRow(this.pivotMode),i=this.pivotMode?this.gos.get("pivotSuppressAutoColumn"):this.isGroupSuppressAutoColumn();if(!(this.rowGroupColumns.length>0||this.gos.get("treeData"))||i||t)this.groupAutoColumns=null;else{const t=this.autoGroupColService.createAutoGroupColumns(this.rowGroupColumns);if(!this.autoColsEqual(t,this.groupAutoColumns)||e)return this.groupAutoColumns=t,!0}return!1}isGroupSuppressAutoColumn(){return"custom"===this.gos.get("groupDisplayType")||"custom"===this.gos.get("treeDataDisplayType")}autoColsEqual(e,t){return Zo(e,t,((e,t)=>e.getColId()===t.getColId()))}getWidthOfColsInList(e){return e.reduce(((e,t)=>e+t.getActualWidth()),0)}getFirstDisplayedColumn(){const e=this.gos.get("enableRtl"),t=["getDisplayedLeftColumns","getDisplayedCenterColumns","getDisplayedRightColumns"];e&&t.reverse();for(let i=0;i<t.length;i++){const s=this[t[i]]();if(s.length)return e?Jo(s):s[0]}return null}setColumnHeaderHeight(e,t){if(e.setAutoHeaderHeight(t)){const t={type:In.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,column:e,columns:[e],source:"autosizeColumnHeaderHeight"};this.eventService.dispatchEvent(t)}}getColumnGroupHeaderRowHeight(){return this.isPivotMode()?this.getPivotGroupHeaderHeight():this.getGroupHeaderHeight()}getColumnHeaderRowHeight(){const e=this.isPivotMode()?this.getPivotHeaderHeight():this.getHeaderHeight(),t=this.getAllDisplayedColumns().filter((e=>e.isAutoHeaderHeight())).map((e=>e.getAutoHeaderHeight()||0));return Math.max(e,...t)}getHeaderHeight(){var e;return null!=(e=this.gos.get("headerHeight"))?e:this.environment.getFromTheme(25,"headerHeight")}getFloatingFiltersHeight(){var e;return null!=(e=this.gos.get("floatingFiltersHeight"))?e:this.getHeaderHeight()}getGroupHeaderHeight(){var e;return null!=(e=this.gos.get("groupHeaderHeight"))?e:this.getHeaderHeight()}getPivotHeaderHeight(){var e;return null!=(e=this.gos.get("pivotHeaderHeight"))?e:this.getHeaderHeight()}getPivotGroupHeaderHeight(){var e;return null!=(e=this.gos.get("pivotGroupHeaderHeight"))?e:this.getGroupHeaderHeight()}queueResizeOperations(){this.shouldQueueResizeOperations=!0}processResizeOperations(){this.shouldQueueResizeOperations=!1,this.resizeOperationQueue.forEach((e=>e())),this.resizeOperationQueue=[]}resetColumnDefIntoColumn(e,t){const i=e.getUserProvidedColDef();if(!i)return!1;const s=this.columnFactory.addColumnDefaultAndTypes(i,e.getColId());return e.setColDef(s,i,t),!0}isColumnGroupingLocked(e){const t=this.gos.get("groupLockGroupColumns");return!(!e.isRowGroupActive()||0===t)&&(-1===t||t>this.rowGroupColumns.findIndex((t=>t.getColId()===e.getColId())))}generateColumnStateForRowGroupAndPivotIndexes(e,t){let i={};const s=(e,t,s,o,n,r)=>{if(!t.length||!this.primaryColumns)return[];const a=Object.keys(e),l=new Set(a),u=new Set(a),h=new Set(t.map((e=>{const t=e.getColId();return u.delete(t),t})).concat(a)),d=[],c={};let p=0;for(let e=0;e<this.primaryColumns.length;e++){const t=this.primaryColumns[e].getColId();h.has(t)&&(d.push(t),c[t]=p++)}let g=1e3,m=!1,f=0;const C=t=>{const i=c[t];for(let t=f;t<i;t++){const i=d[t];u.has(i)&&(e[i][n]=g++,u.delete(i))}f=i};t.forEach((t=>{const a=t.getColId();if(l.has(a))C(a),e[a][n]=g++;else{const l=t.getColDef();(null===l[n]||void 0===l[n]&&null==l[r])&&(m||(l[s]||void 0===l[s]&&l[o]?C(a):(u.forEach((t=>{e[t][n]=g+c[t]})),g+=d.length,m=!0)),i[a]||(i[a]={colId:a}),i[a][n]=g++)}}))};return s(e,this.rowGroupColumns,"rowGroup","initialRowGroup","rowGroupIndex","initialRowGroupIndex"),s(t,this.pivotColumns,"pivot","initialPivot","pivotIndex","initialPivotIndex"),Object.values(i)}onColumnsReady(){const e=this.gos.get("autoSizeStrategy");if(!e)return;const{type:t}=e;setTimeout((()=>{if("fitGridWidth"===t){const{columnLimits:t,defaultMinWidth:i,defaultMaxWidth:s}=e,o=null==t?void 0:t.map((({colId:e,minWidth:t,maxWidth:i})=>({key:e,minWidth:t,maxWidth:i})));this.ctrlsService.getGridBodyCtrl().sizeColumnsToFit({defaultMinWidth:i,defaultMaxWidth:s,columnLimits:o})}else"fitProvidedWidth"===t&&this.sizeColumnsToFit(e.width,"sizeColumnsToFit")}))}onFirstDataRendered(){const e=this.gos.get("autoSizeStrategy");if("fitCellContents"!==(null==e?void 0:e.type))return;const{colIds:t,skipHeader:i}=e;setTimeout((()=>{t?this.autoSizeColumns({columns:t,skipHeader:i,source:"autosizeColumns"}):this.autoSizeAllColumns("autosizeColumns",i)}))}};function Jn(e){return"gridOptionsUpdated"===e?"gridOptionsChanged":e}function Zn(e,t,i){if(e)for(let s=0;s<e.length;s++){const o=e[s];o instanceof xn&&Zn(t?o.getDisplayedChildren():o.getChildren(),t,i),i(o)}}Gs([No("expressionService")],Qn.prototype,"expressionService",2),Gs([No("columnFactory")],Qn.prototype,"columnFactory",2),Gs([No("displayedGroupCreator")],Qn.prototype,"displayedGroupCreator",2),Gs([No("ctrlsService")],Qn.prototype,"ctrlsService",2),Gs([No("autoWidthCalculator")],Qn.prototype,"autoWidthCalculator",2),Gs([No("columnAnimationService")],Qn.prototype,"columnAnimationService",2),Gs([No("autoGroupColService")],Qn.prototype,"autoGroupColService",2),Gs([No("valueCache")],Qn.prototype,"valueCache",2),Gs([No("animationFrameService")],Qn.prototype,"animationFrameService",2),Gs([No("sortController")],Qn.prototype,"sortController",2),Gs([No("columnDefFactory")],Qn.prototype,"columnDefFactory",2),Gs([_o("aggFuncService")],Qn.prototype,"aggFuncService",2),Gs([Lo],Qn.prototype,"init",1),Gs([xo],Qn.prototype,"destroyColumns",1),Gs([ks(0,Go("loggerFactory"))],Qn.prototype,"setBeans",1),Qn=Gs([Io("columnModel")],Qn);var er=class extends Pn{createDisplayedGroups(e,t,i,s){const o=this.mapOldGroupsById(s),n=[];let r=e;for(;r.length;){const e=r;r=[];let s=0;const a=a=>{const l=s;s=a;const u=e[l],h=(u instanceof xn?u.getProvidedColumnGroup():u).getOriginalParent();if(null==h){for(let t=l;t<a;t++)n.push(e[t]);return}const d=this.createColumnGroup(h,t,o,i);for(let t=l;t<a;t++)d.addChild(e[t]);r.push(d)};for(let t=1;t<e.length;t++){const i=e[t],o=(i instanceof xn?i.getProvidedColumnGroup():i).getOriginalParent(),n=e[s];o!==(n instanceof xn?n.getProvidedColumnGroup():n).getOriginalParent()&&a(t)}s<e.length&&a(e.length)}return this.setupParentsIntoColumns(n,null),n}createColumnGroup(e,t,i,s){const o=e.getGroupId(),n=t.getInstanceIdForKey(o);let r=i[xn.createUniqueId(o,n)];return r&&r.getProvidedColumnGroup()!==e&&(r=null),Bs(r)?r.reset():(r=new xn(e,o,n,s),this.context.createBean(r)),r}mapOldGroupsById(e){const t={},i=e=>{e.forEach((e=>{if(e instanceof xn){const s=e;t[e.getUniqueId()]=s,i(s.getChildren())}}))};return e&&i(e),t}setupParentsIntoColumns(e,t){e.forEach((e=>{if(e.setParent(t),e instanceof xn){const t=e;this.setupParentsIntoColumns(t.getChildren(),t)}}))}};er=Gs([Io("displayedGroupCreator")],er);var tr={enableBrowserTooltips:!0,tooltipTrigger:!0,tooltipMouseTrack:!0,tooltipShowMode:!0,tooltipInteraction:!0,defaultColGroupDef:!0,suppressAutoSize:!0,skipHeaderOnAutoSize:!0,autoSizeStrategy:!0,components:!0,stopEditingWhenCellsLoseFocus:!0,undoRedoCellEditing:!0,undoRedoCellEditingLimit:!0,excelStyles:!0,cacheQuickFilter:!0,excludeHiddenColumnsFromQuickFilter:!0,advancedFilterModel:!0,customChartThemes:!0,chartThemeOverrides:!0,enableChartToolPanelsButton:!0,suppressChartToolPanelsButton:!0,chartToolPanelsDef:!0,loadingCellRendererSelector:!0,localeText:!0,keepDetailRows:!0,keepDetailRowsCount:!0,detailRowHeight:!0,detailRowAutoHeight:!0,tabIndex:!0,valueCache:!0,valueCacheNeverExpires:!0,enableCellExpressions:!0,suppressParentsInRowNodes:!0,suppressTouch:!0,suppressAsyncEvents:!0,suppressBrowserResizeObserver:!0,suppressPropertyNamesCheck:!0,debug:!0,loadingOverlayComponent:!0,suppressLoadingOverlay:!0,noRowsOverlayComponent:!0,paginationPageSizeSelector:!0,paginateChildRows:!0,pivotPanelShow:!0,pivotSuppressAutoColumn:!0,suppressExpandablePivotGroups:!0,aggFuncs:!0,suppressAggFuncInHeader:!0,suppressAggAtRootLevel:!0,removePivotHeaderRowWhenSingleValueColumn:!0,allowShowChangeAfterFilter:!0,ensureDomOrder:!0,enableRtl:!0,suppressColumnVirtualisation:!0,suppressMaxRenderedRowRestriction:!0,suppressRowVirtualisation:!0,rowDragText:!0,suppressGroupMaintainValueType:!0,groupLockGroupColumns:!0,rowGroupPanelSuppressSort:!0,suppressGroupRowsSticky:!0,rowModelType:!0,cacheOverflowSize:!0,infiniteInitialRowCount:!0,serverSideInitialRowCount:!0,suppressServerSideInfiniteScroll:!0,maxBlocksInCache:!0,maxConcurrentDatasourceRequests:!0,blockLoadDebounceMillis:!0,serverSideOnlyRefreshFilteredGroups:!0,serverSidePivotResultFieldSeparator:!0,viewportRowModelPageSize:!0,viewportRowModelBufferSize:!0,debounceVerticalScrollbar:!0,suppressAnimationFrame:!0,suppressPreventDefaultOnMouseWheel:!0,scrollbarWidth:!0,icons:!0,suppressRowTransform:!0,gridId:!0,functionsPassive:!0,enableGroupEdit:!0,initialState:!0,processUnpinnedColumns:!0,createChartContainer:!0,getLocaleText:!0,getRowId:!0,reactiveCustomComponents:!0,columnMenu:!0},ir=class{};ir.STRING_PROPERTIES=["rowSelection","overlayLoadingTemplate","overlayNoRowsTemplate","gridId","quickFilterText","rowModelType","editType","domLayout","clipboardDelimiter","rowGroupPanelShow","multiSortKey","pivotColumnGroupTotals","pivotRowTotals","pivotPanelShow","fillHandleDirection","groupDisplayType","treeDataDisplayType","colResizeDefault","tooltipTrigger","serverSidePivotResultFieldSeparator","columnMenu","tooltipShowMode","grandTotalRow"],ir.OBJECT_PROPERTIES=["components","rowStyle","context","autoGroupColumnDef","localeText","icons","datasource","serverSideDatasource","viewportDatasource","groupRowRendererParams","aggFuncs","fullWidthCellRendererParams","defaultColGroupDef","defaultColDef","defaultCsvExportParams","defaultExcelExportParams","columnTypes","rowClassRules","detailCellRendererParams","loadingCellRendererParams","loadingOverlayComponentParams","noRowsOverlayComponentParams","popupParent","statusBar","sideBar","chartThemeOverrides","customChartThemes","chartToolPanelsDef","dataTypeDefinitions","advancedFilterModel","advancedFilterParent","advancedFilterBuilderParams","initialState","autoSizeStrategy"],ir.ARRAY_PROPERTIES=["sortingOrder","alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData","chartThemes","rowClass","paginationPageSizeSelector"],ir.NUMBER_PROPERTIES=["rowHeight","detailRowHeight","rowBuffer","headerHeight","groupHeaderHeight","groupLockGroupColumns","floatingFiltersHeight","pivotHeaderHeight","pivotGroupHeaderHeight","groupDefaultExpanded","pivotDefaultExpanded","viewportRowModelPageSize","viewportRowModelBufferSize","autoSizePadding","maxBlocksInCache","maxConcurrentDatasourceRequests","tooltipShowDelay","tooltipHideDelay","cacheOverflowSize","paginationPageSize","cacheBlockSize","infiniteInitialRowCount","serverSideInitialRowCount","scrollbarWidth","asyncTransactionWaitMillis","blockLoadDebounceMillis","keepDetailRowsCount","undoRedoCellEditingLimit","cellFlashDelay","cellFadeDelay","cellFlashDuration","cellFadeDuration","tabIndex","pivotMaxGeneratedColumns"],ir.BOOLEAN_PROPERTIES=["suppressMakeColumnVisibleAfterUnGroup","suppressRowClickSelection","suppressCellFocus","suppressHeaderFocus","suppressHorizontalScroll","groupSelectsChildren","alwaysShowHorizontalScroll","alwaysShowVerticalScroll","debug","enableBrowserTooltips","enableCellExpressions","groupIncludeTotalFooter","groupSuppressBlankHeader","suppressMenuHide","suppressRowDeselection","unSortIcon","suppressMultiSort","alwaysMultiSort","singleClickEdit","suppressLoadingOverlay","suppressNoRowsOverlay","suppressAutoSize","skipHeaderOnAutoSize","suppressParentsInRowNodes","suppressColumnMoveAnimation","suppressMovableColumns","suppressFieldDotNotation","enableRangeSelection","enableRangeHandle","enableFillHandle","suppressClearOnFillReduction","deltaSort","suppressTouch","suppressAsyncEvents","allowContextMenuWithControlKey","suppressContextMenu","enableCellChangeFlash","suppressDragLeaveHidesColumns","suppressRowGroupHidesColumns","suppressMiddleClickScrolls","suppressPreventDefaultOnMouseWheel","suppressCopyRowsToClipboard","copyHeadersToClipboard","copyGroupHeadersToClipboard","pivotMode","suppressAggFuncInHeader","suppressColumnVirtualisation","alwaysAggregateAtRootLevel","suppressAggAtRootLevel","suppressFocusAfterRefresh","functionsPassive","functionsReadOnly","animateRows","groupSelectsFiltered","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","enableRtl","suppressClickEdit","rowDragEntireRow","rowDragManaged","suppressRowDrag","suppressMoveWhenRowDragging","rowDragMultiRow","enableGroupEdit","embedFullWidthRows","suppressPaginationPanel","groupHideOpenParents","groupAllowUnbalanced","pagination","paginationAutoPageSize","suppressScrollOnNewData","suppressScrollWhenPopupsAreOpen","purgeClosedRowNodes","cacheQuickFilter","includeHiddenColumnsInQuickFilter","excludeHiddenColumnsFromQuickFilter","ensureDomOrder","accentedSort","suppressChangeDetection","valueCache","valueCacheNeverExpires","aggregateOnlyChangedColumns","suppressAnimationFrame","suppressExcelExport","suppressCsvExport","includeHiddenColumnsInAdvancedFilter","suppressMultiRangeSelection","enterMovesDown","enterMovesDownAfterEdit","enterNavigatesVerticallyAfterEdit","enterNavigatesVertically","suppressPropertyNamesCheck","rowMultiSelectWithClick","suppressRowHoverHighlight","suppressRowTransform","suppressClipboardPaste","suppressLastEmptyLineOnPaste","enableCharts","enableChartToolPanelsButton","suppressChartToolPanelsButton","suppressMaintainUnsortedOrder","enableCellTextSelection","suppressBrowserResizeObserver","suppressMaxRenderedRowRestriction","excludeChildrenWhenTreeDataFiltering","tooltipMouseTrack","tooltipInteraction","keepDetailRows","paginateChildRows","preventDefaultOnContextMenu","undoRedoCellEditing","allowDragFromColumnsToolPanel","pivotSuppressAutoColumn","suppressExpandablePivotGroups","debounceVerticalScrollbar","detailRowAutoHeight","serverSideFilterAllLevels","serverSideSortAllLevels","serverSideEnableClientSideSort","serverSideOnlyRefreshFilteredGroups","serverSideSortOnServer","serverSideFilterOnServer","suppressAggFilteredOnly","showOpenedGroup","suppressClipboardApi","suppressModelUpdateAfterUpdateTransaction","stopEditingWhenCellsLoseFocus","maintainColumnOrder","groupMaintainOrder","columnHoverHighlight","readOnlyEdit","suppressRowVirtualisation","enableCellEditingOnBackspace","resetRowDataOnUpdate","removePivotHeaderRowWhenSingleValueColumn","suppressCopySingleCellRanges","suppressGroupRowsSticky","suppressCutToClipboard","suppressServerSideInfiniteScroll","rowGroupPanelSuppressSort","allowShowChangeAfterFilter","enableAdvancedFilter","masterDetail","treeData","suppressGroupMaintainValueType","reactiveCustomComponents","applyQuickFilterBeforePivotOrAgg","suppressServerSideFullWidthLoadingRow","suppressAdvancedFilterEval"],ir.OTHER_PROPERTIES=["suppressStickyTotalRow"],ir.FUNCTIONAL_PROPERTIES=["doesExternalFilterPass","processPivotResultColDef","processPivotResultColGroupDef","getBusinessKeyForNode","isRowSelectable","rowDragText","groupRowRenderer","fullWidthCellRenderer","loadingCellRenderer","loadingOverlayComponent","noRowsOverlayComponent","detailCellRenderer","quickFilterParser","quickFilterMatcher"],ir.CALLBACK_PROPERTIES=["getLocaleText","isExternalFilterPresent","getRowHeight","getRowClass","getRowStyle","getContextMenuItems","getMainMenuItems","processRowPostCreate","processCellForClipboard","getGroupRowAgg","isFullWidthRow","sendToClipboard","navigateToNextHeader","tabToNextHeader","navigateToNextCell","tabToNextCell","processCellFromClipboard","getDocument","postProcessPopup","getChildCount","getDataPath","isRowMaster","postSortRows","processHeaderForClipboard","processUnpinnedColumns","processGroupHeaderForClipboard","paginationNumberFormatter","processDataFromClipboard","getServerSideGroupKey","isServerSideGroup","createChartContainer","getChartToolbarItems","fillOperation","isApplyServerSideTransaction","getServerSideGroupLevelParams","isServerSideGroupOpenByDefault","isGroupOpenByDefault","initialGroupOrderComparator","groupIncludeFooter","loadingCellRendererSelector","getRowId","groupAggFiltering","chartMenuItems","groupTotalRow"],ir.FUNCTION_PROPERTIES=[...ir.FUNCTIONAL_PROPERTIES,...ir.CALLBACK_PROPERTIES],ir.ALL_PROPERTIES=[...ir.ARRAY_PROPERTIES,...ir.OBJECT_PROPERTIES,...ir.STRING_PROPERTIES,...ir.NUMBER_PROPERTIES,...ir.FUNCTION_PROPERTIES,...ir.BOOLEAN_PROPERTIES,...ir.OTHER_PROPERTIES];var sr=ir,or=class e{static getCallbackForEvent(e){return!e||e.length<2?e:"on"+e[0].toUpperCase()+e.substring(1)}static getGridOptionKeys(){return this.ALL_PROPERTIES_AND_CALLBACKS}static combineAttributesAndGridOptions(t,i){"object"!=typeof t&&(t={});const s=Ns({},t);return e.getGridOptionKeys().forEach((t=>{const o=i[t];void 0!==o&&o!==e.VUE_OMITTED_PROPERTY&&(s[t]=o)})),s}static processOnChange(t,i,s){if(!t)return;const o={};let n=!1;if(Object.keys(t).filter((t=>e.ALL_PROPERTIES_AND_CALLBACKS_SET.has(t))).forEach((e=>{o[e]=t[e],n=!0})),!n)return;i.__internalUpdateGridOptions(o,!0);const r={type:In.EVENT_COMPONENT_STATE_CHANGED};eo(o,((e,t)=>{r[e]=t})),i.dispatchEvent(r)}};or.EVENTS=Xs(In),or.VUE_OMITTED_PROPERTY="AG-VUE-OMITTED-PROPERTY",or.EXCLUDED_INTERNAL_EVENTS=[In.EVENT_SCROLLBAR_WIDTH_CHANGED,In.EVENT_CHECKBOX_CHANGED,In.EVENT_HEIGHT_SCALE_CHANGED,In.EVENT_BODY_HEIGHT_CHANGED,In.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED,In.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,In.EVENT_SCROLL_VISIBILITY_CHANGED,In.EVENT_COLUMN_HOVER_CHANGED,In.EVENT_FLASH_CELLS,In.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED,In.EVENT_DISPLAYED_ROWS_CHANGED,In.EVENT_LEFT_PINNED_WIDTH_CHANGED,In.EVENT_RIGHT_PINNED_WIDTH_CHANGED,In.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,In.EVENT_STORE_UPDATED,In.EVENT_COLUMN_PANEL_ITEM_DRAG_START,In.EVENT_COLUMN_PANEL_ITEM_DRAG_END,In.EVENT_KEY_SHORTCUT_CHANGED_CELL_START,In.EVENT_KEY_SHORTCUT_CHANGED_CELL_END,In.EVENT_FULL_WIDTH_ROW_FOCUSED,In.EVENT_HEADER_HEIGHT_CHANGED,In.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,In.EVENT_CELL_FOCUS_CLEARED,In.EVENT_GRID_STYLES_CHANGED,In.EVENT_FILTER_DESTROYED,In.EVENT_ROW_DATA_UPDATE_STARTED,In.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,In.EVENT_DATA_TYPES_INFERRED,In.EVENT_FIELD_VALUE_CHANGED,In.EVENT_FIELD_PICKER_VALUE_SELECTED,In.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED,In.EVENT_SUPPRESS_MENU_HIDE_CHANGED,In.EVENT_SUPPRESS_FIELD_DOT_NOTATION,In.EVENT_ROW_COUNT_READY,In.EVENT_SIDE_BAR_UPDATED],or.PUBLIC_EVENTS=or.EVENTS.filter((e=>!dn(or.EXCLUDED_INTERNAL_EVENTS,e))),or.EVENT_CALLBACKS=or.EVENTS.map((e=>or.getCallbackForEvent(e))),or.BOOLEAN_PROPERTIES=sr.BOOLEAN_PROPERTIES,or.ALL_PROPERTIES=sr.ALL_PROPERTIES,or.ALL_PROPERTIES_AND_CALLBACKS=[...or.ALL_PROPERTIES,...or.EVENT_CALLBACKS],or.ALL_PROPERTIES_AND_CALLBACKS_SET=new Set(or.ALL_PROPERTIES_AND_CALLBACKS);var nr=or,rr=class extends Pn{constructor(){super(...arguments),this.componentsMappedByName={}}setupComponents(e){e&&e.forEach((e=>this.addComponent(e)))}addComponent(e){const t=e.componentName.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase().toUpperCase();this.componentsMappedByName[t]=e.componentClass}getComponentClass(e){return this.componentsMappedByName[e]}};rr=Gs([Io("agStackComponentsRegistry")],rr);var ar={};function lr(e,t,i){null==i||"string"==typeof i&&""==i?hr(e,t):ur(e,t,i)}function ur(e,t,i){e.setAttribute(dr(t),i.toString())}function hr(e,t){e.removeAttribute(dr(t))}function dr(e){return`aria-${e}`}function cr(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function pr(e){let t;return t="asc"===e?"ascending":"desc"===e?"descending":"mixed"===e?"other":"none",t}function gr(e){return parseInt(e.getAttribute("aria-level"),10)}function mr(e){return parseInt(e.getAttribute("aria-posinset"),10)}function fr(e){return e.getAttribute("aria-label")}function Cr(e,t){lr(e,"label",t)}function vr(e,t){lr(e,"labelledby",t)}function wr(e,t){lr(e,"describedby",t)}function yr(e,t){lr(e,"live",t)}function Er(e,t){lr(e,"atomic",t)}function Sr(e,t){lr(e,"relevant",t)}function br(e,t){lr(e,"level",t)}function Rr(e,t){lr(e,"disabled",t)}function Dr(e,t){lr(e,"hidden",t)}function Tr(e,t){lr(e,"activedescendant",t)}function Ar(e,t){ur(e,"expanded",t)}function Pr(e){hr(e,"expanded")}function Fr(e,t){ur(e,"setsize",t)}function Mr(e,t){ur(e,"posinset",t)}function Lr(e,t){ur(e,"multiselectable",t)}function xr(e,t){ur(e,"rowcount",t)}function Ir(e,t){ur(e,"rowindex",t)}function Nr(e,t){ur(e,"colcount",t)}function _r(e,t){ur(e,"colindex",t)}function Or(e,t){ur(e,"colspan",t)}function Gr(e,t){ur(e,"sort",t)}function kr(e){hr(e,"sort")}function Vr(e,t){lr(e,"selected",t)}function Hr(e,t){ur(e,"checked",void 0===t?"mixed":t)}function Br(e,t){lr(e,"controls",t.id),vr(t,e.id)}function Wr(e,t){return void 0===t?e("ariaIndeterminate","indeterminate"):!0===t?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}Os(ar,{getAriaCheckboxStateName:()=>Wr,getAriaLabel:()=>fr,getAriaLevel:()=>gr,getAriaPosInSet:()=>mr,getAriaSortState:()=>pr,removeAriaExpanded:()=>Pr,removeAriaSort:()=>kr,setAriaActiveDescendant:()=>Tr,setAriaAtomic:()=>Er,setAriaChecked:()=>Hr,setAriaColCount:()=>Nr,setAriaColIndex:()=>_r,setAriaColSpan:()=>Or,setAriaControls:()=>Br,setAriaDescribedBy:()=>wr,setAriaDisabled:()=>Rr,setAriaExpanded:()=>Ar,setAriaHidden:()=>Dr,setAriaLabel:()=>Cr,setAriaLabelledBy:()=>vr,setAriaLevel:()=>br,setAriaLive:()=>yr,setAriaMultiSelectable:()=>Lr,setAriaPosInSet:()=>Mr,setAriaRelevant:()=>Sr,setAriaRole:()=>cr,setAriaRowCount:()=>xr,setAriaRowIndex:()=>Ir,setAriaSelected:()=>Vr,setAriaSetSize:()=>Fr,setAriaSort:()=>Gr});var Ur,zr,$r,Kr,jr,Yr,qr,Xr,Qr={};function Jr(){return void 0===Ur&&(Ur=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),Ur}function Zr(){if(void 0===zr)if(Jr()){const e=navigator.userAgent.match(/version\/(\d+)/i);e&&(zr=null!=e[1]?parseFloat(e[1]):0)}else zr=0;return zr}function ea(){if(void 0===$r){const e=window;$r=!!e.chrome&&(!!e.chrome.webstore||!!e.chrome.runtime)||/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}return $r}function ta(){return void 0===Kr&&(Kr=/(firefox)/i.test(navigator.userAgent)),Kr}function ia(){return void 0===jr&&(jr=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),jr}function sa(){return void 0===Yr&&(Yr=/iPad|iPhone|iPod/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1),Yr}function oa(){return!Jr()||Zr()>=15}function na(e){if(!e)return null;const t=e.tabIndex,i=e.getAttribute("tabIndex");return-1!==t||null!==i&&(""!==i||ta())?t.toString():null}function ra(){if(!document.body)return-1;let e=1e6;const t=navigator.userAgent.toLowerCase().match(/firefox/)?6e6:1e9,i=document.createElement("div");for(document.body.appendChild(i);;){const s=2*e;if(i.style.height=s+"px",s>t||i.clientHeight!==s)break;e=s}return document.body.removeChild(i),e}function aa(){var e,t,i;return null!=(i=null==(e=document.body)?void 0:e.clientWidth)?i:window.innerHeight||(null==(t=document.documentElement)?void 0:t.clientWidth)||-1}function la(){var e,t,i;return null!=(i=null==(e=document.body)?void 0:e.clientHeight)?i:window.innerHeight||(null==(t=document.documentElement)?void 0:t.clientHeight)||-1}function ua(){return null==Xr&&ha(),Xr}function ha(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let i=t.offsetWidth-t.clientWidth;0===i&&0===t.clientWidth&&(i=null),t.parentNode&&t.parentNode.removeChild(t),null!=i&&(Xr=i,qr=0===i)}function da(){return null==qr&&ha(),qr}Os(Qr,{browserSupportsPreventScroll:()=>oa,getBodyHeight:()=>la,getBodyWidth:()=>aa,getMaxDivHeight:()=>ra,getSafariVersion:()=>Zr,getScrollbarWidth:()=>ua,getTabIndex:()=>na,isBrowserChrome:()=>ea,isBrowserFirefox:()=>ta,isBrowserSafari:()=>Jr,isIOSUserAgent:()=>sa,isInvisibleScrollbar:()=>da,isMacOsUserAgent:()=>ia});var ca={};Os(ca,{dateToFormattedString:()=>ba,parseDateTimeFromString:()=>Ra,serialiseDate:()=>Ea});var pa={};function ga(e,t){return e.toString().padStart(t,"0")}function ma(e,t){const i=[];for(let s=e;s<=t;s++)i.push(s);return i}function fa(e){return"string"==typeof e&&(e=parseInt(e,10)),"number"==typeof e?Math.floor(e):null}function Ca(e,t){let i="";for(let s=0;s<t;s++)i+=String.fromCharCode(255&e),e>>>=8;return i}function va(e,t,i){return"number"!=typeof e?"":wa(Math.round(100*e)/100,t,i)}function wa(e,t,i){return"number"!=typeof e?"":e.toString().replace(".",i).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${t}`)}function ya(e){return null==e?null:e.reduce(((e,t)=>e+t),0)}function Ea(e,t=!0,i="-"){if(!e)return null;let s=[e.getFullYear(),e.getMonth()+1,e.getDate()].map((e=>ga(e,2))).join(i);return t&&(s+=" "+[e.getHours(),e.getMinutes(),e.getSeconds()].map((e=>ga(e,2))).join(":")),s}Os(pa,{cleanNumber:()=>fa,createArrayOfNumbers:()=>ma,decToHex:()=>Ca,formatNumberCommas:()=>wa,formatNumberTwoDecimalPlacesAndCommas:()=>va,padStartWidthZeros:()=>ga,sum:()=>ya});var Sa=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"};function ba(e,t="YYYY-MM-DD"){const i=ga(e.getFullYear(),4),s=["January","February","March","April","May","June","July","August","September","October","November","December"],o=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],n={YYYY:()=>i.slice(i.length-4,i.length),YY:()=>i.slice(i.length-2,i.length),Y:()=>`${e.getFullYear()}`,MMMM:()=>s[e.getMonth()],MMM:()=>s[e.getMonth()].slice(0,3),MM:()=>ga(e.getMonth()+1,2),Mo:()=>`${e.getMonth()+1}${Sa(e.getMonth()+1)}`,M:()=>`${e.getMonth()+1}`,Do:()=>`${e.getDate()}${Sa(e.getDate())}`,DD:()=>ga(e.getDate(),2),D:()=>`${e.getDate()}`,dddd:()=>o[e.getDay()],ddd:()=>o[e.getDay()].slice(0,3),dd:()=>o[e.getDay()].slice(0,2),do:()=>`${e.getDay()}${Sa(e.getDay())}`,d:()=>`${e.getDay()}`},r=new RegExp(Object.keys(n).join("|"),"g");return t.replace(r,(e=>e in n?n[e]():e))}function Ra(e){if(!e)return null;const[t,i]=e.split(" ");if(!t)return null;const s=t.split("-").map((e=>parseInt(e,10)));if(3!==s.filter((e=>!isNaN(e))).length)return null;const[o,n,r]=s,a=new Date(o,n-1,r);if(a.getFullYear()!==o||a.getMonth()!==n-1||a.getDate()!==r)return null;if(!i||"00:00:00"===i)return a;const[l,u,h]=i.split(":").map((e=>parseInt(e,10)));return l>=0&&l<24&&a.setHours(l),u>=0&&u<60&&a.setMinutes(u),h>=0&&h<60&&a.setSeconds(h),a}var Da,Ta={};function Aa(e,t,i){const s=e.parentElement;let o=s&&s.firstChild;for(;o;)t&&o.classList.toggle(t,o===e),i&&o.classList.toggle(i,o!==e),o=o.nextSibling}Os(Ta,{FOCUSABLE_EXCLUDE:()=>Fa,FOCUSABLE_SELECTOR:()=>Pa,addOrRemoveAttribute:()=>ul,addStylesToElement:()=>Ja,bindCellRendererToHtmlElement:()=>dl,clearElement:()=>za,copyNodeList:()=>al,ensureDomOrder:()=>qa,formatSize:()=>nl,getAbsoluteHeight:()=>ka,getAbsoluteWidth:()=>Va,getElementRectWithOffset:()=>Ha,getElementSize:()=>_a,getInnerHeight:()=>Oa,getInnerWidth:()=>Ga,getScrollLeft:()=>Wa,insertWithDomOrder:()=>Qa,isElementChildOfClass:()=>Na,isFocusableFormField:()=>Ma,isHorizontalScrollShowing:()=>Za,isInDOM:()=>Ka,isNodeOrElement:()=>rl,isRtlNegativeScroll:()=>Ba,isVerticalScrollShowing:()=>el,isVisible:()=>ja,iterateNamedNodeMap:()=>ll,loadTemplate:()=>Ya,nodeListForEach:()=>hl,radioCssClass:()=>Aa,removeFromParent:()=>$a,setDisabled:()=>Ia,setDisplayed:()=>La,setDomChildOrder:()=>Xa,setElementHeight:()=>sl,setElementWidth:()=>tl,setFixedHeight:()=>ol,setFixedWidth:()=>il,setScrollLeft:()=>Ua,setVisible:()=>xa});var Pa="[tabindex], input, select, button, textarea, [href]",Fa="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function Ma(e){const t=Element.prototype.matches||Element.prototype.msMatchesSelector,i=t.call(e,"input, select, button, textarea"),s=t.call(e,Fa),o=ja(e);return i&&!s&&o}function La(e,t,i={}){const{skipAriaHidden:s}=i;e.classList.toggle("ag-hidden",!t),s||Dr(e,!t)}function xa(e,t,i={}){const{skipAriaHidden:s}=i;e.classList.toggle("ag-invisible",!t),s||Dr(e,!t)}function Ia(e,t){const i="disabled",s=t?e=>e.setAttribute(i,""):e=>e.removeAttribute(i);s(e),hl(e.querySelectorAll("input"),(e=>s(e)))}function Na(e,t,i){let s=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,"number"==typeof i){if(++s>i)break}else if(e===i)break}return!1}function _a(e){const{height:t,width:i,borderTopWidth:s,borderRightWidth:o,borderBottomWidth:n,borderLeftWidth:r,paddingTop:a,paddingRight:l,paddingBottom:u,paddingLeft:h,marginTop:d,marginRight:c,marginBottom:p,marginLeft:g,boxSizing:m}=window.getComputedStyle(e);return{height:parseFloat(t||"0"),width:parseFloat(i||"0"),borderTopWidth:parseFloat(s||"0"),borderRightWidth:parseFloat(o||"0"),borderBottomWidth:parseFloat(n||"0"),borderLeftWidth:parseFloat(r||"0"),paddingTop:parseFloat(a||"0"),paddingRight:parseFloat(l||"0"),paddingBottom:parseFloat(u||"0"),paddingLeft:parseFloat(h||"0"),marginTop:parseFloat(d||"0"),marginRight:parseFloat(c||"0"),marginBottom:parseFloat(p||"0"),marginLeft:parseFloat(g||"0"),boxSizing:m}}function Oa(e){const t=_a(e);return"border-box"===t.boxSizing?t.height-t.paddingTop-t.paddingBottom:t.height}function Ga(e){const t=_a(e);return"border-box"===t.boxSizing?t.width-t.paddingLeft-t.paddingRight:t.width}function ka(e){const t=_a(e),i=t.marginBottom+t.marginTop;return Math.ceil(e.offsetHeight+i)}function Va(e){const t=_a(e),i=t.marginLeft+t.marginRight;return Math.ceil(e.offsetWidth+i)}function Ha(e){const t=e.getBoundingClientRect(),{borderTopWidth:i,borderLeftWidth:s,borderRightWidth:o,borderBottomWidth:n}=_a(e);return{top:t.top+(i||0),left:t.left+(s||0),right:t.right+(o||0),bottom:t.bottom+(n||0)}}function Ba(){if("boolean"==typeof Da)return Da;const e=document.createElement("div");return e.style.direction="rtl",e.style.width="1px",e.style.height="1px",e.style.position="fixed",e.style.top="0px",e.style.overflow="hidden",e.dir="rtl",e.innerHTML='<div style="width: 2px">\n <span style="display: inline-block; width: 1px"></span>\n <span style="display: inline-block; width: 1px"></span>\n </div>',document.body.appendChild(e),e.scrollLeft=1,Da=0===Math.floor(e.scrollLeft),document.body.removeChild(e),Da}function Wa(e,t){let i=e.scrollLeft;return t&&(i=Math.abs(i),ea()&&!Ba()&&(i=e.scrollWidth-e.clientWidth-i)),i}function Ua(e,t,i){i&&(Ba()?t*=-1:(Jr()||ea())&&(t=e.scrollWidth-e.clientWidth-t)),e.scrollLeft=t}function za(e){for(;e&&e.firstChild;)e.removeChild(e.firstChild)}function $a(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Ka(e){return!!e.offsetParent}function ja(e){const t=e;return t.checkVisibility?t.checkVisibility({checkVisibilityCSS:!0}):!(!Ka(e)||"visible"!==window.getComputedStyle(e).visibility)}function Ya(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function qa(e,t,i){i&&i.nextSibling===t||(i?i.nextSibling?e.insertBefore(t,i.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.insertAdjacentElement("afterbegin",t))}function Xa(e,t){for(let i=0;i<t.length;i++){const s=t[i],o=e.children[i];o!==s&&e.insertBefore(s,o)}}function Qa(e,t,i){i?i.insertAdjacentElement("afterend",t):e.firstChild?e.insertAdjacentElement("afterbegin",t):e.appendChild(t)}function Ja(e,t){if(t)for(const[i,s]of Object.entries(t)){if(!i||!i.length||null==s)continue;const t=Kn(i),o=s.toString(),n=o.replace(/\s*!important/g,""),r=n.length!=o.length?"important":void 0;e.style.setProperty(t,n,r)}}function Za(e){return e.clientWidth<e.scrollWidth}function el(e){return e.clientHeight<e.scrollHeight}function tl(e,t){"flex"===t?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):il(e,t)}function il(e,t){t=nl(t),e.style.width=t.toString(),e.style.maxWidth=t.toString(),e.style.minWidth=t.toString()}function sl(e,t){"flex"===t?(e.style.removeProperty("height"),e.style.removeProperty("minHeight"),e.style.removeProperty("maxHeight"),e.style.flex="1 1 auto"):ol(e,t)}function ol(e,t){t=nl(t),e.style.height=t.toString(),e.style.maxHeight=t.toString(),e.style.minHeight=t.toString()}function nl(e){return"number"==typeof e?`${e}px`:e}function rl(e){return e instanceof Node||e instanceof HTMLElement}function al(e){if(null==e)return[];const t=[];return hl(e,(e=>t.push(e))),t}function ll(e,t){if(e)for(let i=0;i<e.length;i++){const s=e[i];t(s.name,s.value)}}function ul(e,t,i){null==i?e.removeAttribute(t):e.setAttribute(t,i.toString())}function hl(e,t){if(null!=e)for(let i=0;i<e.length;i++)t(e[i])}function dl(e,t){e.then((e=>{const i=e.getGui();null!=i&&("object"==typeof i?t.appendChild(i):t.innerHTML=i)}))}var cl={};function pl(e,t,i){const s={},o=e.filter((e=>!t.some((t=>t===e))));return o.length>0&&o.forEach((e=>s[e]=gl(e,i).values)),s}function gl(e,t,i,s){let o=t.map(((t,i)=>({value:t,relevance:ml(e.toLowerCase(),t.toLocaleLowerCase()),idx:i})));if(o.sort(((e,t)=>t.relevance-e.relevance)),i&&(o=o.filter((e=>0!==e.relevance))),o.length>0&&s&&s>0){const e=o[0].relevance*s;o=o.filter((t=>e-t.relevance<0))}const n=[],r=[];for(const e of o)n.push(e.value),r.push(e.idx);return{values:n,indices:r}}function ml(e,t){const i=e.replace(/\s/g,""),s=t.replace(/\s/g,"");let o=0,n=-1;for(let e=0;e<i.length;e++){const t=s.indexOf(i[e],n+1);-1!==t&&(n=t,o+=100-100*n/1e4*100)}return o}Os(cl,{fuzzyCheckStrings:()=>pl,fuzzySuggestions:()=>gl});var fl={};Os(fl,{createIcon:()=>vl,createIconNoSpan:()=>wl,iconNameClassMap:()=>Cl});var Cl={columnGroupOpened:"expanded",columnGroupClosed:"contracted",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate",columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",groupContracted:"tree-closed",groupExpanded:"tree-open",setFilterGroupClosed:"tree-closed",setFilterGroupOpen:"tree-open",setFilterGroupIndeterminate:"tree-indeterminate",chart:"chart",close:"cross",cancel:"cancel",check:"tick",first:"first",previous:"previous",next:"next",last:"last",linked:"linked",unlinked:"unlinked",colorPicker:"color-picker",groupLoading:"loading",menu:"menu",menuAlt:"menu-alt",filter:"filter",columns:"columns",maximize:"maximize",minimize:"minimize",menuPin:"pin",menuValue:"aggregation",menuAddRowGroup:"group",menuRemoveRowGroup:"group",clipboardCopy:"copy",clipboardCut:"cut",clipboardPaste:"paste",pivotPanel:"pivot",rowGroupPanel:"group",valuePanel:"aggregation",columnDrag:"grip",rowDrag:"grip",save:"save",csvExport:"csv",excelExport:"excel",smallDown:"small-down",smallLeft:"small-left",smallRight:"small-right",smallUp:"small-up",sortAscending:"asc",sortDescending:"desc",sortUnSort:"none",advancedFilterBuilder:"group",advancedFilterBuilderDrag:"grip",advancedFilterBuilderInvalid:"not-allowed",advancedFilterBuilderMoveUp:"up",advancedFilterBuilderMoveDown:"down",advancedFilterBuilderAdd:"plus",advancedFilterBuilderRemove:"minus",chartsMenuEdit:"chart",chartsMenuAdvancedSettings:"settings",chartsMenuAdd:"plus"};function vl(e,t,i){const s=wl(e,t,i);if(s){const{className:e}=s;if("string"==typeof e&&e.indexOf("ag-icon")>-1||"object"==typeof e&&e["ag-icon"])return s}const o=document.createElement("span");return o.appendChild(s),o}function wl(e,t,i,s){let o=null;const n=i&&i.getColDef().icons;if(n&&(o=n[e]),t&&!o){const i=t.get("icons");i&&(o=i[e])}if(!o){const t=document.createElement("span");let i=Cl[e];return i||(s?i=e:(console.warn(`AG Grid: Did not find icon ${e}`),i="")),t.setAttribute("class",`ag-icon ag-icon-${i}`),t.setAttribute("unselectable","on"),cr(t,"presentation"),t}{let e;if("function"==typeof o)e=o();else{if("string"!=typeof o)throw new Error("icon from grid options needs to be a string or a function");e=o}if("string"==typeof e)return Ya(e);if(rl(e))return e;console.warn("AG Grid: iconRenderer should return back a string or a dom object")}}var yl={};Os(yl,{isDeleteKey:()=>xl,isEventFromPrintableCharacter:()=>Pl,isUserSuppressingHeaderKeyboardEvent:()=>Ml,isUserSuppressingKeyboardEvent:()=>Fl,normaliseQwertyAzerty:()=>Ll});var El=class{};El.BACKSPACE="Backspace",El.TAB="Tab",El.ENTER="Enter",El.ESCAPE="Escape",El.SPACE=" ",El.LEFT="ArrowLeft",El.UP="ArrowUp",El.RIGHT="ArrowRight",El.DOWN="ArrowDown",El.DELETE="Delete",El.F2="F2",El.PAGE_UP="PageUp",El.PAGE_DOWN="PageDown",El.PAGE_HOME="Home",El.PAGE_END="End",El.A="KeyA",El.C="KeyC",El.D="KeyD",El.V="KeyV",El.X="KeyX",El.Y="KeyY",El.Z="KeyZ";var Sl=65,bl=67,Rl=86,Dl=68,Tl=90,Al=89;function Pl(e){return!(e.altKey||e.ctrlKey||e.metaKey)&&1===e.key.length}function Fl(e,t,i,s,o){const n=s?s.getColDef().suppressKeyboardEvent:void 0;if(!n)return!1;const r=e.addGridCommonParams({event:t,editing:o,column:s,node:i,data:i.data,colDef:s.getColDef()});return!(!n||!n(r))}function Ml(e,t,i,s){const o=s.getDefinition(),n=o&&o.suppressHeaderKeyboardEvent;return!!Bs(n)&&!!n(e.addGridCommonParams({colDef:o,column:s,headerRowIndex:i,event:t}))}function Ll(e){const{keyCode:t}=e;let i;switch(t){case Sl:i=El.A;break;case bl:i=El.C;break;case Rl:i=El.V;break;case Dl:i=El.D;break;case Tl:i=El.Z;break;case Al:i=El.Y;break;default:i=e.code}return i}function xl(e,t=!1){return e===El.DELETE||!t&&e===El.BACKSPACE&&ia()}var Il={};function Nl(e,t,i){if(0===i)return!1;const s=Math.abs(e.clientX-t.clientX),o=Math.abs(e.clientY-t.clientY);return Math.max(s,o)<=i}Os(Il,{areEventsNear:()=>Nl});var _l={};function Ol(e,t){if(!e)return!1;const i=(e,i)=>{const s=t[e.id],o=t[i.id],n=void 0!==s,r=void 0!==o;return n&&r?s-o:n||r?n?1:-1:e.__objectId-i.__objectId};let s,o,n=!1;for(let t=0;t<e.length-1;t++)if(s=e[t],o=e[t+1],i(s,o)>0){n=!0;break}return!!n&&(e.sort(i),!0)}Os(_l,{sortRowNodesByOrder:()=>Ol});var Gl={};function kl(e){const t=new Set;return e.forEach((e=>t.add(e))),t}Os(Gl,{convertToSet:()=>kl});var Vl=Ns(Ns(Ns(Ns(Ns(Ns(Ns(Ns(Ns(Ns(Ns(Ns(Ns(Ns(Ns(Ns(Ns(Ns({},ar),Xo),Qr),ca),Ta),qo),lo),cl),Vs),fl),yl),jn),Il),pa),Js),_l),Gl),Vn),Hl=class{constructor(e=0,t=1){this.nextValue=e,this.step=t}next(){const e=this.nextValue;return this.nextValue+=this.step,e}peek(){return this.nextValue}skip(e){this.nextValue+=e}},Bl=class e{constructor(e){this.status=0,this.resolution=null,this.waiters=[],e((e=>this.onDone(e)),(e=>this.onReject(e)))}static all(t){return new e((e=>{let i=t.length;const s=new Array(i);t.forEach(((t,o)=>{t.then((t=>{s[o]=t,i--,0===i&&e(s)}))}))}))}static resolve(t=null){return new e((e=>e(t)))}then(t){return new e((e=>{1===this.status?e(t(this.resolution)):this.waiters.push((i=>e(t(i))))}))}resolveNow(e,t){return 1===this.status?t(this.resolution):e}onDone(e){this.status=1,this.resolution=e,this.waiters.forEach((t=>t(e)))}onReject(e){console.warn("TBI")}},Wl=class{constructor(e){this.cssClassStates={},this.getGui=e}addCssClass(e){const t=(e||"").split(" ");if(t.length>1)t.forEach((e=>this.addCssClass(e)));else if(!0!==this.cssClassStates[e]&&e.length){const t=this.getGui();t&&t.classList.add(e),this.cssClassStates[e]=!0}}removeCssClass(e){const t=(e||"").split(" ");if(t.length>1)t.forEach((e=>this.removeCssClass(e)));else if(!1!==this.cssClassStates[e]&&e.length){const t=this.getGui();t&&t.classList.remove(e),this.cssClassStates[e]=!1}}containsCssClass(e){const t=this.getGui();return!!t&&t.classList.contains(e)}addOrRemoveCssClass(e,t){if(e){if(e.indexOf(" ")>=0){const i=(e||"").split(" ");if(i.length>1)return void i.forEach((e=>this.addOrRemoveCssClass(e,t)))}if(this.cssClassStates[e]!==t&&e.length){const i=this.getGui();i&&i.classList.toggle(e,t),this.cssClassStates[e]=t}}}},Ul=class e extends Pn{constructor(e,t,i,s){super(),this.parentComp=e,this.tooltipShowDelayOverride=t,this.tooltipHideDelayOverride=i,this.shouldDisplayTooltip=s,this.SHOW_QUICK_TOOLTIP_DIFF=1e3,this.FADE_OUT_TOOLTIP_TIMEOUT=1e3,this.INTERACTIVE_HIDE_DELAY=100,this.interactionEnabled=!1,this.isInteractingWithTooltip=!1,this.state=0,this.tooltipInstanceCount=0,this.tooltipMouseTrack=!1}postConstruct(){this.gos.get("tooltipInteraction")&&(this.interactionEnabled=!0),this.tooltipTrigger=this.getTooltipTrigger(),this.tooltipMouseTrack=this.gos.get("tooltipMouseTrack");const e=this.parentComp.getGui();0===this.tooltipTrigger&&(this.addManagedListener(e,"mouseenter",this.onMouseEnter.bind(this)),this.addManagedListener(e,"mouseleave",this.onMouseLeave.bind(this))),1===this.tooltipTrigger&&(this.addManagedListener(e,"focusin",this.onFocusIn.bind(this)),this.addManagedListener(e,"focusout",this.onFocusOut.bind(this))),this.addManagedListener(e,"mousemove",this.onMouseMove.bind(this)),this.interactionEnabled||(this.addManagedListener(e,"mousedown",this.onMouseDown.bind(this)),this.addManagedListener(e,"keydown",this.onKeyDown.bind(this)))}getGridOptionsTooltipDelay(e){const t=this.gos.get(e);return t<0&&co(`${e} should not be lower than 0`),Math.max(200,t)}getTooltipDelay(e){var t,i;return"show"===e?null!=(t=this.tooltipShowDelayOverride)?t:this.getGridOptionsTooltipDelay("tooltipShowDelay"):null!=(i=this.tooltipHideDelayOverride)?i:this.getGridOptionsTooltipDelay("tooltipHideDelay")}destroy(){this.setToDoNothing(),super.destroy()}getTooltipTrigger(){const e=this.gos.get("tooltipTrigger");return e&&"hover"!==e?1:0}onMouseEnter(t){this.interactionEnabled&&this.interactiveTooltipTimeoutId&&(this.unlockService(),this.startHideTimeout()),sa()||(e.isLocked?this.showTooltipTimeoutId=window.setTimeout((()=>{this.prepareToShowTooltip(t)}),this.INTERACTIVE_HIDE_DELAY):this.prepareToShowTooltip(t))}onMouseMove(e){this.lastMouseEvent&&(this.lastMouseEvent=e),this.tooltipMouseTrack&&2===this.state&&this.tooltipComp&&this.positionTooltip()}onMouseDown(){this.setToDoNothing()}onMouseLeave(){this.interactionEnabled?this.lockService():this.setToDoNothing()}onFocusIn(){this.prepareToShowTooltip()}onFocusOut(e){var t;const i=e.relatedTarget,s=this.parentComp.getGui(),o=null==(t=this.tooltipComp)?void 0:t.getGui();this.isInteractingWithTooltip||s.contains(i)||this.interactionEnabled&&(null==o?void 0:o.contains(i))||this.setToDoNothing()}onKeyDown(){this.setToDoNothing()}prepareToShowTooltip(t){if(0!=this.state||e.isLocked)return;let i=0;t&&(i=this.isLastTooltipHiddenRecently()?200:this.getTooltipDelay("show")),this.lastMouseEvent=t||null,this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),i),this.state=1}isLastTooltipHiddenRecently(){return(new Date).getTime()-e.lastTooltipHideTime<this.SHOW_QUICK_TOOLTIP_DIFF}setToDoNothing(){2===this.state&&this.hideTooltip(),this.onBodyScrollEventCallback&&(this.onBodyScrollEventCallback(),this.onBodyScrollEventCallback=void 0),this.onColumnMovedEventCallback&&(this.onColumnMovedEventCallback(),this.onColumnMovedEventCallback=void 0),this.clearTimeouts(),this.state=0,this.lastMouseEvent=null}showTooltip(){const e=Ns({},this.parentComp.getTooltipParams());if(!Bs(e.value)||this.shouldDisplayTooltip&&!this.shouldDisplayTooltip())return void this.setToDoNothing();this.state=2,this.tooltipInstanceCount++;const t=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);this.userComponentFactory.getTooltipCompDetails(e).newAgStackInstance().then(t)}hideTooltip(t){if(!t&&this.isInteractingWithTooltip)return;this.tooltipComp&&(this.destroyTooltipComp(),e.lastTooltipHideTime=(new Date).getTime());const i={type:In.EVENT_TOOLTIP_HIDE,parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(i),this.state=0}newTooltipComponentCallback(e,t){if(2!==this.state||this.tooltipInstanceCount!==e)return void this.getContext().destroyBean(t);const i=t.getGui();this.tooltipComp=t,i.classList.contains("ag-tooltip")||i.classList.add("ag-tooltip-custom"),0===this.tooltipTrigger&&i.classList.add("ag-tooltip-animate"),this.interactionEnabled&&i.classList.add("ag-tooltip-interactive");const s=this.localeService.getLocaleTextFunc(),o=this.popupService.addPopup({eChild:i,ariaLabel:s("ariaLabelTooltip","Tooltip")});o&&(this.tooltipPopupDestroyFunc=o.hideFunc),this.positionTooltip(),1===this.tooltipTrigger&&(this.onBodyScrollEventCallback=this.addManagedListener(this.eventService,In.EVENT_BODY_SCROLL,this.setToDoNothing.bind(this)),this.onColumnMovedEventCallback=this.addManagedListener(this.eventService,In.EVENT_COLUMN_MOVED,this.setToDoNothing.bind(this))),this.interactionEnabled&&(0===this.tooltipTrigger?(this.tooltipMouseEnterListener=this.addManagedListener(i,"mouseenter",this.onTooltipMouseEnter.bind(this))||null,this.tooltipMouseLeaveListener=this.addManagedListener(i,"mouseleave",this.onTooltipMouseLeave.bind(this))||null):(this.tooltipFocusInListener=this.addManagedListener(i,"focusin",this.onTooltipFocusIn.bind(this))||null,this.tooltipFocusOutListener=this.addManagedListener(i,"focusout",this.onTooltipFocusOut.bind(this))||null));const n={type:In.EVENT_TOOLTIP_SHOW,tooltipGui:i,parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(n),this.startHideTimeout()}onTooltipMouseEnter(){this.isInteractingWithTooltip=!0,this.unlockService()}onTooltipMouseLeave(){this.isInteractingWithTooltip=!1,this.lockService()}onTooltipFocusIn(){this.isInteractingWithTooltip=!0}onTooltipFocusOut(e){var t;const i=this.parentComp.getGui(),s=null==(t=this.tooltipComp)?void 0:t.getGui(),o=e.relatedTarget;(null==s?void 0:s.contains(o))||(this.isInteractingWithTooltip=!1,i.contains(o)?this.startHideTimeout():this.hideTooltip())}positionTooltip(){const e={type:"tooltip",ePopup:this.tooltipComp.getGui(),nudgeY:18,skipObserver:this.tooltipMouseTrack};this.lastMouseEvent?this.popupService.positionPopupUnderMouseEvent(_s(Ns({},e),{mouseEvent:this.lastMouseEvent})):this.popupService.positionPopupByComponent(_s(Ns({},e),{eventSource:this.parentComp.getGui(),position:"under",keepWithinBounds:!0,nudgeY:5}))}destroyTooltipComp(){this.tooltipComp.getGui().classList.add("ag-tooltip-hiding");const e=this.tooltipPopupDestroyFunc,t=this.tooltipComp,i=0===this.tooltipTrigger?this.FADE_OUT_TOOLTIP_TIMEOUT:0;window.setTimeout((()=>{e(),this.getContext().destroyBean(t)}),i),this.clearTooltipListeners(),this.tooltipPopupDestroyFunc=void 0,this.tooltipComp=void 0}clearTooltipListeners(){[this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener,this.tooltipFocusInListener,this.tooltipFocusOutListener].forEach((e=>{e&&e()})),this.tooltipMouseEnterListener=this.tooltipMouseLeaveListener=this.tooltipFocusInListener=this.tooltipFocusOutListener=null}lockService(){e.isLocked=!0,this.interactiveTooltipTimeoutId=window.setTimeout((()=>{this.unlockService(),this.setToDoNothing()}),this.INTERACTIVE_HIDE_DELAY)}unlockService(){e.isLocked=!1,this.clearInteractiveTimeout()}startHideTimeout(){this.clearHideTimeout(),this.hideTooltipTimeoutId=window.setTimeout(this.hideTooltip.bind(this),this.getTooltipDelay("hide"))}clearShowTimeout(){this.showTooltipTimeoutId&&(window.clearTimeout(this.showTooltipTimeoutId),this.showTooltipTimeoutId=void 0)}clearHideTimeout(){this.hideTooltipTimeoutId&&(window.clearTimeout(this.hideTooltipTimeoutId),this.hideTooltipTimeoutId=void 0)}clearInteractiveTimeout(){this.interactiveTooltipTimeoutId&&(window.clearTimeout(this.interactiveTooltipTimeoutId),this.interactiveTooltipTimeoutId=void 0)}clearTimeouts(){this.clearShowTimeout(),this.clearHideTimeout(),this.clearInteractiveTimeout()}};Ul.isLocked=!1,Gs([No("popupService")],Ul.prototype,"popupService",2),Gs([No("userComponentFactory")],Ul.prototype,"userComponentFactory",2),Gs([Lo],Ul.prototype,"postConstruct",1);var zl=Ul,$l=class extends Pn{constructor(e,t){super(),this.ctrl=e,t&&(this.beans=t)}postConstruct(){this.refreshToolTip()}setBrowserTooltip(e){const t="title",i=this.ctrl.getGui();i&&(null!=e&&""!=e?i.setAttribute(t,e):i.removeAttribute(t))}updateTooltipText(){this.tooltip=this.ctrl.getTooltipValue()}createTooltipFeatureIfNeeded(){var e,t,i,s;if(null!=this.tooltipManager)return;const o={getTooltipParams:()=>this.getTooltipParams(),getGui:()=>this.ctrl.getGui()};this.tooltipManager=this.createBean(new zl(o,null==(t=(e=this.ctrl).getTooltipShowDelayOverride)?void 0:t.call(e),null==(s=(i=this.ctrl).getTooltipHideDelayOverride)?void 0:s.call(i),this.ctrl.shouldDisplayTooltip),this.beans.context)}refreshToolTip(){this.browserTooltips=this.beans.gos.get("enableBrowserTooltips"),this.updateTooltipText(),this.browserTooltips?(this.setBrowserTooltip(this.tooltip),this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context))):(this.setBrowserTooltip(null),this.createTooltipFeatureIfNeeded())}getTooltipParams(){const e=this.ctrl,t=e.getColumn?e.getColumn():void 0,i=e.getColDef?e.getColDef():void 0,s=e.getRowNode?e.getRowNode():void 0;return{location:e.getLocation(),colDef:i,column:t,rowIndex:e.getRowIndex?e.getRowIndex():void 0,node:s,data:s?s.data:void 0,value:this.getTooltipText(),valueFormatted:e.getValueFormatted?e.getValueFormatted():void 0,hideTooltipCallback:()=>{var e;return null==(e=this.tooltipManager)?void 0:e.hideTooltip(!0)}}}getTooltipText(){return this.tooltip}destroy(){this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context)),super.destroy()}};Gs([No("beans")],$l.prototype,"beans",2),Gs([Lo],$l.prototype,"postConstruct",1);var Kl=new Hl,jl=class e extends Pn{constructor(e){super(),this.displayed=!0,this.visible=!0,this.compId=Kl.next(),this.cssClassManager=new Wl((()=>this.eGui)),e&&this.setTemplate(e)}preConstructOnComponent(){this.usingBrowserTooltips=this.gos.get("enableBrowserTooltips")}getCompId(){return this.compId}getTooltipParams(){return{value:this.tooltipText,location:"UNKNOWN"}}setTooltip(e){const{newTooltipText:t,showDelayOverride:i,hideDelayOverride:s,location:o,shouldDisplayTooltip:n}=e||{};this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),this.tooltipText!==t&&(this.tooltipText=t);null!=t&&(this.tooltipFeature=this.createBean(new $l({getTooltipValue:()=>this.tooltipText,getGui:()=>this.getGui(),getLocation:()=>null!=o?o:"UNKNOWN",getColDef:null==e?void 0:e.getColDef,getColumn:null==e?void 0:e.getColumn,getTooltipShowDelayOverride:null!=i?()=>i:void 0,getTooltipHideDelayOverride:null!=s?()=>s:void 0,shouldDisplayTooltip:n})))}createChildComponentsFromTags(e,t){al(e.childNodes).forEach((i=>{if(!(i instanceof HTMLElement))return;const s=this.createComponentFromElement(i,(e=>{e.getGui()&&this.copyAttributesFromNode(i,e.getGui())}),t);if(s){if(s.addItems&&i.children.length){this.createChildComponentsFromTags(i,t);const e=Array.prototype.slice.call(i.children);s.addItems(e)}this.swapComponentForNode(s,e,i)}else i.childNodes&&this.createChildComponentsFromTags(i,t)}))}createComponentFromElement(t,i,s){const o=t.nodeName,n=s?s[t.getAttribute("ref")]:void 0,r=this.agStackComponentsRegistry.getComponentClass(o);if(r){e.elementGettingCreated=t;const s=new r(n);return s.setParentComponent(this),this.createBean(s,null,i),s}return null}copyAttributesFromNode(e,t){ll(e.attributes,((e,i)=>t.setAttribute(e,i)))}swapComponentForNode(e,t,i){const s=e.getGui();t.replaceChild(s,i),t.insertBefore(document.createComment(i.nodeName),s),this.addDestroyFunc(this.destroyBean.bind(this,e)),this.swapInComponentForQuerySelectors(e,i)}swapInComponentForQuerySelectors(e,t){const i=this;this.iterateOverQuerySelectors((s=>{i[s.attributeName]===t&&(i[s.attributeName]=e)}))}iterateOverQuerySelectors(e){let t=Object.getPrototypeOf(this);for(;null!=t;){const i=t.__agComponentMetaData,s=go(t.constructor);i&&i[s]&&i[s].querySelectors&&i[s].querySelectors.forEach((t=>e(t))),t=Object.getPrototypeOf(t)}}activateTabIndex(e){const t=this.gos.get("tabIndex");e||(e=[]),e.length||e.push(this.getGui()),e.forEach((e=>e.setAttribute("tabindex",t.toString())))}setTemplate(e,t){const i=Ya(e);this.setTemplateFromElement(i,t)}setTemplateFromElement(e,t){this.eGui=e,this.eGui.__agComponent=this,this.wireQuerySelectors(),this.getContext()&&this.createChildComponentsFromTags(this.getGui(),t)}createChildComponentsPreConstruct(){this.getGui()&&this.createChildComponentsFromTags(this.getGui())}wireQuerySelectors(){if(!this.eGui)return;const e=this;this.iterateOverQuerySelectors((t=>{const i=i=>e[t.attributeName]=i;if(t.refSelector&&this.getAttribute("ref")===t.refSelector)i(this.eGui);else{const e=this.eGui.querySelector(t.querySelector);e&&i(e.__agComponent||e)}}))}getGui(){return this.eGui}getFocusableElement(){return this.eGui}getAriaElement(){return this.getFocusableElement()}setParentComponent(e){this.parentComponent=e}getParentComponent(){return this.parentComponent}setGui(e){this.eGui=e}queryForHtmlElement(e){return this.eGui.querySelector(e)}queryForHtmlInputElement(e){return this.eGui.querySelector(e)}appendChild(e,t){if(null!=e)if(t||(t=this.eGui),rl(e))t.appendChild(e);else{const i=e;t.appendChild(i.getGui())}}isDisplayed(){return this.displayed}setVisible(e,t={}){if(e!==this.visible){this.visible=e;const{skipAriaHidden:i}=t;xa(this.eGui,e,{skipAriaHidden:i})}}setDisplayed(t,i={}){if(t!==this.displayed){this.displayed=t;const{skipAriaHidden:s}=i;La(this.eGui,t,{skipAriaHidden:s});const o={type:e.EVENT_DISPLAYED_CHANGED,visible:this.displayed};this.dispatchEvent(o)}}destroy(){this.parentComponent&&(this.parentComponent=void 0),this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const e=this.eGui;e&&e.__agComponent&&(e.__agComponent=void 0),super.destroy()}addGuiEventListener(e,t,i){this.eGui.addEventListener(e,t,i),this.addDestroyFunc((()=>this.eGui.removeEventListener(e,t)))}addCssClass(e){this.cssClassManager.addCssClass(e)}removeCssClass(e){this.cssClassManager.removeCssClass(e)}containsCssClass(e){return this.cssClassManager.containsCssClass(e)}addOrRemoveCssClass(e,t){this.cssClassManager.addOrRemoveCssClass(e,t)}getAttribute(e){const{eGui:t}=this;return t?t.getAttribute(e):null}getRefElement(e){return this.queryForHtmlElement(`[ref="${e}"]`)}};jl.EVENT_DISPLAYED_CHANGED="displayedChanged",Gs([No("agStackComponentsRegistry")],jl.prototype,"agStackComponentsRegistry",2),Gs([Mo],jl.prototype,"preConstructOnComponent",1),Gs([Mo],jl.prototype,"createChildComponentsPreConstruct",1);var Yl=jl;function ql(e){return Xl.bind(this,`[ref=${e}]`,e)}function Xl(e,t,i,s,o){null!==e?"number"!=typeof o?function(e,t,i){const s=function(e,t){return e.__agComponentMetaData||(e.__agComponentMetaData={}),e.__agComponentMetaData[t]||(e.__agComponentMetaData[t]={}),e.__agComponentMetaData[t]}(e,go(e.constructor));s[t]||(s[t]=[]),s[t].push(i)}(i,"querySelectors",{attributeName:s,querySelector:e,refSelector:t}):console.error("AG Grid: QuerySelector should be on an attribute"):console.error("AG Grid: QuerySelector selector should not be null")}var Ql=class extends Yl{constructor(){super('\n <div class="ag-floating-filter-input" role="presentation">\n <ag-input-text-field ref="eFloatingFilterText"></ag-input-text-field>\n </div>')}destroy(){super.destroy()}init(e){this.params=e;const t=this.columnModel.getDisplayNameForColumn(e.column,"header",!0),i=this.localeService.getLocaleTextFunc();this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${i("ariaFilterInput","Filter Input")}`)}onParentModelChanged(e){null!=e?this.params.parentFilterInstance((t=>{if(t.getModelAsString){const i=t.getModelAsString(e);this.eFloatingFilterText.setValue(i)}})):this.eFloatingFilterText.setValue("")}onParamsUpdated(e){this.refresh(e)}refresh(e){this.init(e)}};Gs([ql("eFloatingFilterText")],Ql.prototype,"eFloatingFilterText",2),Gs([No("columnModel")],Ql.prototype,"columnModel",2);var Jl=class{constructor(e,t,i,s,o){this.alive=!0,this.context=e,this.eParent=s,t.getDateCompDetails(i).newAgStackInstance().then((t=>{this.alive?(this.dateComp=t,t&&(s.appendChild(t.getGui()),t.afterGuiAttached&&t.afterGuiAttached(),this.tempValue&&t.setDate(this.tempValue),null!=this.disabled&&this.setDateCompDisabled(this.disabled),null==o||o(this))):e.destroyBean(t)}))}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){this.dateComp?this.dateComp.setDate(e):this.tempValue=e}setDisabled(e){this.dateComp?this.setDateCompDisabled(e):this.disabled=e}setDisplayed(e){La(this.eParent,e)}setInputPlaceholder(e){this.dateComp&&this.dateComp.setInputPlaceholder&&this.dateComp.setInputPlaceholder(e)}setInputAriaLabel(e){this.dateComp&&this.dateComp.setInputAriaLabel&&this.dateComp.setInputAriaLabel(e)}afterGuiAttached(e){this.dateComp&&"function"==typeof this.dateComp.afterGuiAttached&&this.dateComp.afterGuiAttached(e)}updateParams(e){var t,i;let s=!1;(null==(t=this.dateComp)?void 0:t.refresh)&&"function"==typeof this.dateComp.refresh&&null!==this.dateComp.refresh(e)&&(s=!0),!s&&(null==(i=this.dateComp)?void 0:i.onParamsUpdated)&&"function"==typeof this.dateComp.onParamsUpdated&&null!==this.dateComp.onParamsUpdated(e)&&co("Custom date component method 'onParamsUpdated' is deprecated. Use 'refresh' instead.")}setDateCompDisabled(e){null!=this.dateComp&&null!=this.dateComp.setDisabled&&this.dateComp.setDisabled(e)}},Zl=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions||t,this.mapCustomOptions(),this.selectDefaultItem(e)}getFilterOptions(){return this.filterOptions}mapCustomOptions(){this.filterOptions&&this.filterOptions.forEach((e=>{"string"!=typeof e&&([["displayKey"],["displayName"],["predicate","test"]].every((t=>!!t.some((t=>null!=e[t]))||(console.warn(`AG Grid: ignoring FilterOptionDef as it doesn't contain one of '${t}'`),!1)))?this.customFilterOptions[e.displayKey]=e:this.filterOptions=this.filterOptions.filter((t=>t===e))||[])}))}selectDefaultItem(e){if(e.defaultOption)this.defaultOption=e.defaultOption;else if(this.filterOptions.length>=1){const e=this.filterOptions[0];"string"==typeof e?this.defaultOption=e:e.displayKey?this.defaultOption=e.displayKey:console.warn("AG Grid: invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'")}else console.warn("AG Grid: no filter options for filter")}getDefaultOption(){return this.defaultOption}getCustomOption(e){return this.customFilterOptions[e]}},eu={applyFilter:"Apply",clearFilter:"Clear",resetFilter:"Reset",cancelFilter:"Cancel",textFilter:"Text Filter",numberFilter:"Number Filter",dateFilter:"Date Filter",setFilter:"Set Filter",filterOoo:"Filter...",empty:"Choose one",equals:"Equals",notEqual:"Does not equal",lessThan:"Less than",greaterThan:"Greater than",inRange:"Between",inRangeStart:"From",inRangeEnd:"To",lessThanOrEqual:"Less than or equal to",greaterThanOrEqual:"Greater than or equal to",contains:"Contains",notContains:"Does not contain",startsWith:"Begins with",endsWith:"Ends with",blank:"Blank",notBlank:"Not blank",before:"Before",after:"After",andCondition:"AND",orCondition:"OR",dateFormatOoo:"yyyy-mm-dd"},tu=class e extends Pn{constructor(e,t={}){super(),this.eFocusableElement=e,this.callbacks=t,this.callbacks=Ns({shouldStopEventPropagation:()=>!1,onTabKeyDown:e=>{if(e.defaultPrevented)return;const t=this.focusService.findNextFocusableElement(this.eFocusableElement,!1,e.shiftKey);t&&(t.focus(),e.preventDefault())}},t)}postConstruct(){this.eFocusableElement.classList.add(e.FOCUS_MANAGED_CLASS),this.addKeyDownListeners(this.eFocusableElement),this.callbacks.onFocusIn&&this.addManagedListener(this.eFocusableElement,"focusin",this.callbacks.onFocusIn),this.callbacks.onFocusOut&&this.addManagedListener(this.eFocusableElement,"focusout",this.callbacks.onFocusOut)}addKeyDownListeners(e){this.addManagedListener(e,"keydown",(e=>{e.defaultPrevented||yn(e)||(this.callbacks.shouldStopEventPropagation(e)?wn(e):e.key===El.TAB?this.callbacks.onTabKeyDown(e):this.callbacks.handleKeyDown&&this.callbacks.handleKeyDown(e))}))}};tu.FOCUS_MANAGED_CLASS="ag-focus-managed",Gs([No("focusService")],tu.prototype,"focusService",2),Gs([Lo],tu.prototype,"postConstruct",1);var iu=tu,su="ag-resizer-wrapper",ou=`<div class="${su}">\n <div ref="eTopLeftResizer" class="ag-resizer ag-resizer-topLeft"></div>\n <div ref="eTopResizer" class="ag-resizer ag-resizer-top"></div>\n <div ref="eTopRightResizer" class="ag-resizer ag-resizer-topRight"></div>\n <div ref="eRightResizer" class="ag-resizer ag-resizer-right"></div>\n <div ref="eBottomRightResizer" class="ag-resizer ag-resizer-bottomRight"></div>\n <div ref="eBottomResizer" class="ag-resizer ag-resizer-bottom"></div>\n <div ref="eBottomLeftResizer" class="ag-resizer ag-resizer-bottomLeft"></div>\n <div ref="eLeftResizer" class="ag-resizer ag-resizer-left"></div>\n </div>`,nu=class extends Pn{constructor(e,t){super(),this.element=e,this.dragStartPosition={x:0,y:0},this.position={x:0,y:0},this.lastSize={width:-1,height:-1},this.positioned=!1,this.resizersAdded=!1,this.resizeListeners=[],this.boundaryEl=null,this.isResizing=!1,this.isMoving=!1,this.resizable={},this.movable=!1,this.currentResizer=null,this.config=Object.assign({},{popup:!1},t)}center(){const{clientHeight:e,clientWidth:t}=this.offsetParent,i=t/2-this.getWidth()/2,s=e/2-this.getHeight()/2;this.offsetElement(i,s)}initialisePosition(){if(this.positioned)return;const{centered:e,forcePopupParentAsOffsetParent:t,minWidth:i,width:s,minHeight:o,height:n,x:r,y:a}=this.config;this.offsetParent||this.setOffsetParent();let l=0,u=0;const h=ja(this.element);if(h){const e=this.findBoundaryElement(),t=window.getComputedStyle(e);if(null!=t.minWidth){const i=e.offsetWidth-this.element.offsetWidth;u=parseInt(t.minWidth,10)-i}if(null!=t.minHeight){const i=e.offsetHeight-this.element.offsetHeight;l=parseInt(t.minHeight,10)-i}}if(this.minHeight=o||l,this.minWidth=i||u,s&&this.setWidth(s),n&&this.setHeight(n),s&&n||this.refreshSize(),e)this.center();else if(r||a)this.offsetElement(r,a);else if(h&&t){let e=this.boundaryEl,t=!0;if(e||(e=this.findBoundaryElement(),t=!1),e){const i=parseFloat(e.style.top),s=parseFloat(e.style.left);t?this.offsetElement(isNaN(s)?0:s,isNaN(i)?0:i):this.setPosition(s,i)}}this.positioned=!!this.offsetParent}isPositioned(){return this.positioned}getPosition(){return this.position}setMovable(e,t){if(!this.config.popup||e===this.movable)return;this.movable=e;const i=this.moveElementDragListener||{eElement:t,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};e?(this.dragService.addDragSource(i),this.moveElementDragListener=i):(this.dragService.removeDragSource(i),this.moveElementDragListener=void 0)}setResizable(e){if(this.clearResizeListeners(),e?this.addResizers():this.removeResizers(),"boolean"==typeof e){if(!1===e)return;e={topLeft:e,top:e,topRight:e,right:e,bottomRight:e,bottom:e,bottomLeft:e,left:e}}Object.keys(e).forEach((t=>{const i=!!e[t],s=this.getResizerElement(t),o={dragStartPixels:0,eElement:s,onDragStart:e=>this.onResizeStart(e,t),onDragging:this.onResize.bind(this),onDragStop:e=>this.onResizeEnd(e,t)};(i||!this.isAlive()&&!i)&&(i?(this.dragService.addDragSource(o),this.resizeListeners.push(o),s.style.pointerEvents="all"):s.style.pointerEvents="none",this.resizable[t]=i)}))}removeSizeFromEl(){this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("flex")}restoreLastSize(){this.element.style.flex="0 0 auto";const{height:e,width:t}=this.lastSize;-1!==t&&(this.element.style.width=`${t}px`),-1!==e&&(this.element.style.height=`${e}px`)}getHeight(){return this.element.offsetHeight}setHeight(e){const{popup:t}=this.config,i=this.element;let s=!1;if("string"==typeof e&&-1!==e.indexOf("%"))ol(i,e),e=ka(i),s=!0;else if(e=Math.max(this.minHeight,e),this.positioned){const t=this.getAvailableHeight();t&&e>t&&(e=t)}this.getHeight()!==e&&(s?(i.style.maxHeight="unset",i.style.minHeight="unset"):t?ol(i,e):(i.style.height=`${e}px`,i.style.flex="0 0 auto",this.lastSize.height="number"==typeof e?e:parseFloat(e)))}getAvailableHeight(){const{popup:e,forcePopupParentAsOffsetParent:t}=this.config;this.positioned||this.initialisePosition();const{clientHeight:i}=this.offsetParent;if(!i)return null;const s=this.element.getBoundingClientRect(),o=this.offsetParent.getBoundingClientRect(),n=e?this.position.y:s.top,r=e?0:o.top;let a=0;if(t){const e=this.element.parentElement;if(e){const{bottom:t}=e.getBoundingClientRect();a=t-s.bottom}}return i+r-n-a}getWidth(){return this.element.offsetWidth}setWidth(e){const t=this.element,{popup:i}=this.config;let s=!1;if("string"==typeof e&&-1!==e.indexOf("%"))il(t,e),e=Va(t),s=!0;else if(this.positioned){e=Math.max(this.minWidth,e);const{clientWidth:t}=this.offsetParent,s=i?this.position.x:this.element.getBoundingClientRect().left;t&&e+s>t&&(e=t-s)}this.getWidth()!==e&&(s?(t.style.maxWidth="unset",t.style.minWidth="unset"):this.config.popup?il(t,e):(t.style.width=`${e}px`,t.style.flex=" unset",this.lastSize.width="number"==typeof e?e:parseFloat(e)))}offsetElement(e=0,t=0){const{forcePopupParentAsOffsetParent:i}=this.config,s=i?this.boundaryEl:this.element;s&&(this.popupService.positionPopup({ePopup:s,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:e,y:t})}),this.setPosition(parseFloat(s.style.left),parseFloat(s.style.top)))}constrainSizeToAvailableHeight(e){if(!this.config.forcePopupParentAsOffsetParent)return;e?this.resizeObserverSubscriber=this.resizeObserverService.observeResize(this.popupService.getPopupParent(),(()=>{const e=this.getAvailableHeight();this.element.style.setProperty("max-height",`${e}px`)})):(this.element.style.removeProperty("max-height"),this.resizeObserverSubscriber&&(this.resizeObserverSubscriber(),this.resizeObserverSubscriber=void 0))}setPosition(e,t){this.position.x=e,this.position.y=t}updateDragStartPosition(e,t){this.dragStartPosition={x:e,y:t}}calculateMouseMovement(e){const{e:t,isLeft:i,isTop:s,anywhereWithin:o,topBuffer:n}=e,r=t.clientX-this.dragStartPosition.x,a=t.clientY-this.dragStartPosition.y;return{movementX:this.shouldSkipX(t,!!i,!!o,r)?0:r,movementY:this.shouldSkipY(t,!!s,n,a)?0:a}}shouldSkipX(e,t,i,s){const o=this.element.getBoundingClientRect(),n=this.offsetParent.getBoundingClientRect(),r=this.boundaryEl.getBoundingClientRect(),a=this.config.popup?this.position.x:o.left;let l=a<=0&&n.left>=e.clientX||n.right<=e.clientX&&n.right<=r.right;return!!l||(l=t?s<0&&e.clientX>a+n.left||s>0&&e.clientX<a+n.left:i?s<0&&e.clientX>r.right||s>0&&e.clientX<a+n.left:s<0&&e.clientX>r.right||s>0&&e.clientX<r.right,l)}shouldSkipY(e,t,i=0,s){const o=this.element.getBoundingClientRect(),n=this.offsetParent.getBoundingClientRect(),r=this.boundaryEl.getBoundingClientRect(),a=this.config.popup?this.position.y:o.top;let l=a<=0&&n.top>=e.clientY||n.bottom<=e.clientY&&n.bottom<=r.bottom;return!!l||(l=t?s<0&&e.clientY>a+n.top+i||s>0&&e.clientY<a+n.top:s<0&&e.clientY>r.bottom||s>0&&e.clientY<r.bottom,l)}createResizeMap(){const e=this.element;this.resizerMap={topLeft:{element:e.querySelector("[ref=eTopLeftResizer]")},top:{element:e.querySelector("[ref=eTopResizer]")},topRight:{element:e.querySelector("[ref=eTopRightResizer]")},right:{element:e.querySelector("[ref=eRightResizer]")},bottomRight:{element:e.querySelector("[ref=eBottomRightResizer]")},bottom:{element:e.querySelector("[ref=eBottomResizer]")},bottomLeft:{element:e.querySelector("[ref=eBottomLeftResizer]")},left:{element:e.querySelector("[ref=eLeftResizer]")}}}addResizers(){if(this.resizersAdded)return;const e=this.element;if(!e)return;const t=(new DOMParser).parseFromString(ou,"text/html").body;e.appendChild(t.firstChild),this.createResizeMap(),this.resizersAdded=!0}removeResizers(){this.resizerMap=void 0;const e=this.element.querySelector(`.${su}`);e&&this.element.removeChild(e),this.resizersAdded=!1}getResizerElement(e){return this.resizerMap[e].element}onResizeStart(e,t){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.currentResizer={isTop:!!t.match(/top/i),isRight:!!t.match(/right/i),isBottom:!!t.match(/bottom/i),isLeft:!!t.match(/left/i)},this.element.classList.add("ag-resizing"),this.resizerMap[t].element.classList.add("ag-active");const{popup:i,forcePopupParentAsOffsetParent:s}=this.config;i||s||this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop),this.isResizing=!0,this.updateDragStartPosition(e.clientX,e.clientY)}getSiblings(){const e=this.element.parentElement;return e?Array.prototype.slice.call(e.children).filter((e=>!e.classList.contains("ag-hidden"))):null}getMinSizeOfSiblings(){const e=this.getSiblings()||[];let t=0,i=0;for(let s=0;s<e.length;s++){const o=e[s],n=!!o.style.flex&&"0 0 auto"!==o.style.flex;if(o===this.element)continue;let r=this.minHeight||0,a=this.minWidth||0;if(n){const e=window.getComputedStyle(o);e.minHeight&&(r=parseInt(e.minHeight,10)),e.minWidth&&(a=parseInt(e.minWidth,10))}else r=o.offsetHeight,a=o.offsetWidth;t+=r,i+=a}return{height:t,width:i}}applySizeToSiblings(e){let t=null;const i=this.getSiblings();if(i){for(let s=0;s<i.length;s++){const o=i[s];o!==t&&(e?o.style.height=`${o.offsetHeight}px`:o.style.width=`${o.offsetWidth}px`,o.style.flex="0 0 auto",o===this.element&&(t=i[s+1]))}t&&(t.style.removeProperty("height"),t.style.removeProperty("min-height"),t.style.removeProperty("max-height"),t.style.flex="1 1 auto")}}isResizable(){return Object.values(this.resizable).some((e=>e))}onResize(e){if(!this.isResizing||!this.currentResizer)return;const{popup:t,forcePopupParentAsOffsetParent:i}=this.config,{isTop:s,isRight:o,isBottom:n,isLeft:r}=this.currentResizer,a=o||r,l=n||s,{movementX:u,movementY:h}=this.calculateMouseMovement({e,isLeft:r,isTop:s}),d=this.position.x,c=this.position.y;let p=0,g=0;if(a&&u){const e=r?-1:1,t=this.getWidth(),i=t+u*e;let s=!1;r&&(p=t-i,(d+p<=0||i<=this.minWidth)&&(s=!0,p=0)),s||this.setWidth(i)}if(l&&h){const e=s?-1:1,t=this.getHeight(),i=t+h*e;let o=!1;s?(g=t-i,(c+g<=0||i<=this.minHeight)&&(o=!0,g=0)):!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&t<i&&this.getMinSizeOfSiblings().height+i>this.element.parentElement.offsetHeight&&(o=!0),o||this.setHeight(i)}this.updateDragStartPosition(e.clientX,e.clientY),((t||i)&&p||g)&&this.offsetElement(d+p,c+g)}onResizeEnd(e,t){this.isResizing=!1,this.currentResizer=null,this.boundaryEl=null,this.element.classList.remove("ag-resizing"),this.resizerMap[t].element.classList.remove("ag-active"),this.dispatchEvent({type:"resize"})}refreshSize(){const e=this.element;this.config.popup&&(this.config.width||this.setWidth(e.offsetWidth),this.config.height||this.setHeight(e.offsetHeight))}onMoveStart(e){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.isMoving=!0,this.element.classList.add("ag-moving"),this.updateDragStartPosition(e.clientX,e.clientY)}onMove(e){if(!this.isMoving)return;const{x:t,y:i}=this.position;let s;this.config.calculateTopBuffer&&(s=this.config.calculateTopBuffer());const{movementX:o,movementY:n}=this.calculateMouseMovement({e,isTop:!0,anywhereWithin:!0,topBuffer:s});this.offsetElement(t+o,i+n),this.updateDragStartPosition(e.clientX,e.clientY)}onMoveEnd(){this.isMoving=!1,this.boundaryEl=null,this.element.classList.remove("ag-moving")}setOffsetParent(){this.config.forcePopupParentAsOffsetParent?this.offsetParent=this.popupService.getPopupParent():this.offsetParent=this.element.offsetParent}findBoundaryElement(){let e=this.element;for(;e;){if("static"!==window.getComputedStyle(e).position)return e;e=e.parentElement}return this.element}clearResizeListeners(){for(;this.resizeListeners.length;){const e=this.resizeListeners.pop();this.dragService.removeDragSource(e)}}destroy(){super.destroy(),this.moveElementDragListener&&this.dragService.removeDragSource(this.moveElementDragListener),this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}};Gs([No("popupService")],nu.prototype,"popupService",2),Gs([No("resizeObserverService")],nu.prototype,"resizeObserverService",2),Gs([No("dragService")],nu.prototype,"dragService",2);var ru=class e extends Yl{constructor(e){super(),this.filterNameKey=e,this.applyActive=!1,this.hidePopup=null,this.debouncePending=!1,this.appliedModel=null,this.buttonListeners=[]}postConstruct(){this.resetTemplate(),this.createManagedBean(new iu(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=new nu(this.getPositionableElement(),{forcePopupParentAsOffsetParent:!0}),this.createBean(this.positionableFeature)}handleKeyDown(e){}getFilterTitle(){return this.translate(this.filterNameKey)}isFilterActive(){return!!this.appliedModel}resetTemplate(e){let t=this.getGui();t&&t.removeEventListener("submit",this.onFormSubmit);const i=`\n <form class="ag-filter-wrapper">\n <div class="ag-filter-body-wrapper ag-${this.getCssIdentifier()}-body-wrapper" ref="eFilterBody">\n ${this.createBodyTemplate()}\n </div>\n </form>`;this.setTemplate(i,e),t=this.getGui(),t&&t.addEventListener("submit",this.onFormSubmit)}isReadOnly(){return!!this.providedFilterParams.readOnly}init(e){this.setParams(e),this.resetUiToDefaults(!0).then((()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()}))}setParams(t){this.providedFilterParams=t,this.applyActive=e.isUseApplyButton(t),this.resetButtonsPanel()}updateParams(t){this.providedFilterParams=t,this.applyActive=e.isUseApplyButton(t),this.resetUiToActiveModel(this.getModel(),(()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()}))}resetButtonsPanel(){const{buttons:e}=this.providedFilterParams,t=e&&e.length>0&&!this.isReadOnly();if(this.eButtonsPanel?(za(this.eButtonsPanel),this.buttonListeners.forEach((e=>null==e?void 0:e())),this.buttonListeners=[]):t&&(this.eButtonsPanel=document.createElement("div"),this.eButtonsPanel.classList.add("ag-filter-apply-panel")),!t)return void(this.eButtonsPanel&&$a(this.eButtonsPanel));const i=document.createDocumentFragment(),s=e=>{let t,s;switch(e){case"apply":t=this.translate("applyFilter"),s=e=>this.onBtApply(!1,!1,e);break;case"clear":t=this.translate("clearFilter"),s=()=>this.onBtClear();break;case"reset":t=this.translate("resetFilter"),s=()=>this.onBtReset();break;case"cancel":t=this.translate("cancelFilter"),s=e=>{this.onBtCancel(e)};break;default:return void console.warn("AG Grid: Unknown button type specified")}const o=Ya(`<button\n type="${"apply"===e?"submit":"button"}"\n ref="${e}FilterButton"\n class="ag-button ag-standard-button ag-filter-apply-panel-button"\n >${t}\n </button>`);this.buttonListeners.push(this.addManagedListener(o,"click",s)),i.append(o)};kl(e).forEach((e=>s(e))),this.eButtonsPanel.append(i),this.getGui().appendChild(this.eButtonsPanel)}getDefaultDebounceMs(){return 0}setupOnBtApplyDebounce(){const t=e.getDebounceMs(this.providedFilterParams,this.getDefaultDebounceMs()),i=Eo(this.checkApplyDebounce.bind(this),t);this.onBtApplyDebounce=()=>{this.debouncePending=!0,i()}}checkApplyDebounce(){this.debouncePending&&(this.debouncePending=!1,this.onBtApply())}getModel(){return this.appliedModel?this.appliedModel:null}setModel(e){return(null!=e?this.setModelIntoUi(e):this.resetUiToDefaults()).then((()=>{this.updateUiVisibility(),this.applyModel("api")}))}onBtCancel(e){this.resetUiToActiveModel(this.getModel(),(()=>{this.handleCancelEnd(e)}))}handleCancelEnd(e){this.providedFilterParams.closeOnApply&&this.close(e)}resetUiToActiveModel(e,t){const i=()=>{this.onUiChanged(!1,"prevent"),null==t||t()};null!=e?this.setModelIntoUi(e).then(i):this.resetUiToDefaults().then(i)}onBtClear(){this.resetUiToDefaults().then((()=>this.onUiChanged()))}onBtReset(){this.onBtClear(),this.onBtApply()}applyModel(e="api"){const t=this.getModelFromUi();if(!this.isModelValid(t))return!1;const i=this.appliedModel;return this.appliedModel=t,!this.areModelsEqual(i,t)}isModelValid(e){return!0}onFormSubmit(e){e.preventDefault()}onBtApply(e=!1,t=!1,i){if(i&&i.preventDefault(),this.applyModel(t?"rowDataUpdated":"ui")){const i="columnFilter";this.providedFilterParams.filterChangedCallback({afterFloatingFilter:e,afterDataChange:t,source:i})}const{closeOnApply:s}=this.providedFilterParams;s&&this.applyActive&&!e&&!t&&this.close(i)}onNewRowsLoaded(){}close(e){if(!this.hidePopup)return;const t=e,i=t&&t.key;let s;"Enter"!==i&&"Space"!==i||(s={keyboardEvent:t}),this.hidePopup(s),this.hidePopup=null}onUiChanged(e=!1,t){if(this.updateUiVisibility(),this.providedFilterParams.filterModifiedCallback(),this.applyActive&&!this.isReadOnly()){const e=this.isModelValid(this.getModelFromUi()),t=this.getRefElement("applyFilterButton");t&&Ia(t,!e)}e&&!t||"immediately"===t?this.onBtApply(e):(this.applyActive||t)&&"debounce"!==t||this.onBtApplyDebounce()}afterGuiAttached(e){e&&(this.hidePopup=e.hidePopup),this.refreshFilterResizer(null==e?void 0:e.container)}refreshFilterResizer(e){if(!this.positionableFeature||"toolPanel"===e)return;const t="floatingFilter"===e||"columnFilter"===e,{positionableFeature:i,gos:s}=this;t?(i.restoreLastSize(),i.setResizable(s.get("enableRtl")?{bottom:!0,bottomLeft:!0,left:!0}:{bottom:!0,bottomRight:!0,right:!0})):(this.positionableFeature.removeSizeFromEl(),this.positionableFeature.setResizable(!1)),this.positionableFeature.constrainSizeToAvailableHeight(!0)}afterGuiDetached(){this.checkApplyDebounce(),this.positionableFeature&&this.positionableFeature.constrainSizeToAvailableHeight(!1)}static getDebounceMs(t,i){return e.isUseApplyButton(t)?(null!=t.debounceMs&&console.warn("AG Grid: debounceMs is ignored when apply button is present"),0):null!=t.debounceMs?t.debounceMs:i}static isUseApplyButton(e){return!!e.buttons&&e.buttons.indexOf("apply")>=0}refresh(e){return this.providedFilterParams=e,!0}destroy(){const e=this.getGui();e&&e.removeEventListener("submit",this.onFormSubmit),this.hidePopup=null,this.positionableFeature&&(this.positionableFeature=this.destroyBean(this.positionableFeature)),this.appliedModel=null,super.destroy()}translate(e){return this.localeService.getLocaleTextFunc()(e,eu[e])}getCellValue(e){return this.providedFilterParams.getValue(e)}getPositionableElement(){return this.eFilterBody}};Gs([No("rowModel")],ru.prototype,"rowModel",2),Gs([ql("eFilterBody")],ru.prototype,"eFilterBody",2),Gs([Lo],ru.prototype,"postConstruct",1);var au=ru,lu=class extends Yl{constructor(e,t){super(t),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{}}postConstruct(){this.addCssClass("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:i,labelAlignment:s,disabled:o}=this.config;null!=o&&this.setDisabled(o),null!=e&&this.setLabelSeparator(e),null!=t&&this.setLabel(t),null!=i&&this.setLabelWidth(i),this.setLabelAlignment(s||this.labelAlignment),this.refreshLabel()}refreshLabel(){za(this.eLabel),"string"==typeof this.label?this.eLabel.innerText=this.label+this.labelSeparator:this.label&&this.eLabel.appendChild(this.label),""===this.label?(La(this.eLabel,!1),cr(this.eLabel,"presentation")):(La(this.eLabel,!0),cr(this.eLabel,null))}setLabelSeparator(e){return this.labelSeparator===e||(this.labelSeparator=e,null!=this.label&&this.refreshLabel()),this}getLabelId(){return this.eLabel.id=this.eLabel.id||`ag-${this.getCompId()}-label`,this.eLabel.id}getLabel(){return this.label}setLabel(e){return this.label===e||(this.label=e,this.refreshLabel()),this}setLabelAlignment(e){const t=this.getGui().classList;return t.toggle("ag-label-align-left","left"===e),t.toggle("ag-label-align-right","right"===e),t.toggle("ag-label-align-top","top"===e),this}setLabelEllipsis(e){return this.eLabel.classList.toggle("ag-label-ellipsis",e),this}setLabelWidth(e){return null==this.label||tl(this.eLabel,e),this}setDisabled(e){e=!!e;const t=this.getGui();return Ia(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}};Gs([Lo],lu.prototype,"postConstruct",1);var uu=class extends lu{constructor(e,t,i){super(e,t),this.className=i}postConstruct(){super.postConstruct();const{width:e,value:t,onValueChange:i}=this.config;null!=e&&this.setWidth(e),null!=t&&this.setValue(t),null!=i&&this.onValueChange(i),this.className&&this.addCssClass(this.className),this.refreshAriaLabelledBy()}refreshAriaLabelledBy(){const e=this.getAriaElement(),t=this.getLabelId();null!==fr(e)?vr(e,""):vr(e,null!=t?t:"")}setAriaLabel(e){return Cr(this.getAriaElement(),e),this.refreshAriaLabelledBy(),this}onValueChange(e){return this.addManagedListener(this,In.EVENT_FIELD_VALUE_CHANGED,(()=>e(this.getValue()))),this}getWidth(){return this.getGui().clientWidth}setWidth(e){return il(this.getGui(),e),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(e,t){return this.value===e||(this.previousValue=this.value,this.value=e,t||this.dispatchEvent({type:In.EVENT_FIELD_VALUE_CHANGED})),this}},hu=class extends uu{constructor(e){if(super(e,(null==e?void 0:e.template)||'\n <div class="ag-picker-field" role="presentation">\n <div ref="eLabel"></div>\n <div ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-picker-collapsed">\n <div ref="eDisplayField" class="ag-picker-field-display"></div>\n <div ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>\n </div>\n </div>',null==e?void 0:e.className),this.isPickerDisplayed=!1,this.skipClick=!1,this.pickerGap=4,this.hideCurrentPicker=null,this.ariaRole=null==e?void 0:e.ariaRole,this.onPickerFocusIn=this.onPickerFocusIn.bind(this),this.onPickerFocusOut=this.onPickerFocusOut.bind(this),!e)return;const{pickerGap:t,maxPickerHeight:i,variableWidth:s,minPickerWidth:o,maxPickerWidth:n}=e;null!=t&&(this.pickerGap=t),this.variableWidth=!!s,null!=i&&this.setPickerMaxHeight(i),null!=o&&this.setPickerMinWidth(o),null!=n&&this.setPickerMaxWidth(n)}postConstruct(){super.postConstruct(),this.setupAria();const e=`ag-${this.getCompId()}-display`;this.eDisplayField.setAttribute("id",e);const t=this.getAriaElement();this.addManagedListener(t,"keydown",this.onKeyDown.bind(this)),this.addManagedListener(this.eLabel,"mousedown",this.onLabelOrWrapperMouseDown.bind(this)),this.addManagedListener(this.eWrapper,"mousedown",this.onLabelOrWrapperMouseDown.bind(this));const{pickerIcon:i,inputWidth:s}=this.config;if(i){const e=wl(i,this.gos);e&&this.eIcon.appendChild(e)}null!=s&&this.setInputWidth(s)}setupAria(){const e=this.getAriaElement();e.setAttribute("tabindex",this.gos.get("tabIndex").toString()),Ar(e,!1),this.ariaRole&&cr(e,this.ariaRole)}onLabelOrWrapperMouseDown(e){if(e){const t=this.getFocusableElement();if(t!==this.eWrapper&&(null==e?void 0:e.target)===t)return;e.preventDefault(),this.getFocusableElement().focus()}this.skipClick?this.skipClick=!1:this.isDisabled()||(this.isPickerDisplayed?this.hidePicker():this.showPicker())}onKeyDown(e){switch(e.key){case El.UP:case El.DOWN:case El.ENTER:case El.SPACE:e.preventDefault(),this.onLabelOrWrapperMouseDown();break;case El.ESCAPE:this.isPickerDisplayed&&(e.preventDefault(),e.stopPropagation(),this.hideCurrentPicker&&this.hideCurrentPicker())}}showPicker(){this.isPickerDisplayed=!0,this.pickerComponent||(this.pickerComponent=this.createPickerComponent());const e=this.pickerComponent.getGui();e.addEventListener("focusin",this.onPickerFocusIn),e.addEventListener("focusout",this.onPickerFocusOut),this.hideCurrentPicker=this.renderAndPositionPicker(),this.toggleExpandedStyles(!0)}renderAndPositionPicker(){const e=this.gos.getDocument(),t=this.pickerComponent.getGui();this.gos.get("suppressScrollWhenPopupsAreOpen")||(this.destroyMouseWheelFunc=this.addManagedListener(this.eventService,In.EVENT_BODY_SCROLL,(()=>{this.hidePicker()})));const i=this.localeService.getLocaleTextFunc(),{pickerAriaLabelKey:s,pickerAriaLabelValue:o,modalPicker:n=!0}=this.config,r={modal:n,eChild:t,closeOnEsc:!0,closedCallback:()=>{const t=this.gos.getActiveDomElement(),i=!t||t===e.body;this.beforeHidePicker(),i&&this.isAlive()&&this.getFocusableElement().focus()},ariaLabel:i(s,o)},a=this.popupService.addPopup(r),{maxPickerHeight:l,minPickerWidth:u,maxPickerWidth:h,variableWidth:d}=this;d?(u&&(t.style.minWidth=u),t.style.width=nl(Va(this.eWrapper)),h&&(t.style.maxWidth=h)):tl(t,null!=h?h:Va(this.eWrapper));const c=null!=l?l:`${Oa(this.popupService.getPopupParent())}px`;return t.style.setProperty("max-height",c),t.style.position="absolute",this.alignPickerToComponent(),a.hideFunc}alignPickerToComponent(){if(!this.pickerComponent)return;const{pickerType:e}=this.config,{pickerGap:t}=this,i=this.gos.get("enableRtl")?"right":"left";this.popupService.positionPopupByComponent({type:e,eventSource:this.eWrapper,ePopup:this.pickerComponent.getGui(),position:"under",alignSide:i,keepWithinBounds:!0,nudgeY:t})}beforeHidePicker(){this.destroyMouseWheelFunc&&(this.destroyMouseWheelFunc(),this.destroyMouseWheelFunc=void 0),this.toggleExpandedStyles(!1);const e=this.pickerComponent.getGui();e.removeEventListener("focusin",this.onPickerFocusIn),e.removeEventListener("focusout",this.onPickerFocusOut),this.isPickerDisplayed=!1,this.pickerComponent=void 0,this.hideCurrentPicker=null}toggleExpandedStyles(e){this.isAlive()&&(Ar(this.getAriaElement(),e),this.eWrapper.classList.toggle("ag-picker-expanded",e),this.eWrapper.classList.toggle("ag-picker-collapsed",!e))}onPickerFocusIn(){this.togglePickerHasFocus(!0)}onPickerFocusOut(e){var t;(null==(t=this.pickerComponent)?void 0:t.getGui().contains(e.relatedTarget))||this.togglePickerHasFocus(!1)}togglePickerHasFocus(e){this.pickerComponent&&this.eWrapper.classList.toggle("ag-picker-has-focus",e)}hidePicker(){this.hideCurrentPicker&&this.hideCurrentPicker()}setInputWidth(e){return tl(this.eWrapper,e),this}getFocusableElement(){return this.eWrapper}setPickerGap(e){return this.pickerGap=e,this}setPickerMinWidth(e){return"number"==typeof e&&(e=`${e}px`),this.minPickerWidth=null==e?void 0:e,this}setPickerMaxWidth(e){return"number"==typeof e&&(e=`${e}px`),this.maxPickerWidth=null==e?void 0:e,this}setPickerMaxHeight(e){return"number"==typeof e&&(e=`${e}px`),this.maxPickerHeight=null==e?void 0:e,this}destroy(){this.hidePicker(),super.destroy()}};Gs([No("popupService")],hu.prototype,"popupService",2),Gs([ql("eLabel")],hu.prototype,"eLabel",2),Gs([ql("eWrapper")],hu.prototype,"eWrapper",2),Gs([ql("eDisplayField")],hu.prototype,"eDisplayField",2),Gs([ql("eIcon")],hu.prototype,"eIcon",2);var du=class e extends Yl{constructor(e="default",t=!1){super(`<div class="ag-list ag-${e}-list" role="listbox"></div>`),this.cssIdentifier=e,this.unFocusable=t,this.options=[],this.itemEls=[]}init(){const e=this.getGui();this.addManagedListener(e,"mouseleave",(()=>this.clearHighlighted())),this.unFocusable||this.addManagedListener(e,"keydown",this.handleKeyDown.bind(this))}handleKeyDown(e){const t=e.key;switch(t){case El.ENTER:if(this.highlightedEl){const e=this.itemEls.indexOf(this.highlightedEl);this.setValueByIndex(e)}else this.setValue(this.getValue());break;case El.DOWN:case El.UP:e.preventDefault(),this.navigate(t);break;case El.PAGE_DOWN:case El.PAGE_UP:case El.PAGE_HOME:case El.PAGE_END:e.preventDefault(),this.navigateToPage(t)}}navigate(e){const t=e===El.DOWN;let i;if(this.highlightedEl){let e=this.itemEls.indexOf(this.highlightedEl)+(t?1:-1);e=Math.min(Math.max(e,0),this.itemEls.length-1),i=this.itemEls[e]}else i=this.itemEls[t?0:this.itemEls.length-1];this.highlightItem(i)}navigateToPage(e){if(!this.highlightedEl||0===this.itemEls.length)return;const t=this.itemEls.indexOf(this.highlightedEl),i=this.options.length-1,s=this.itemEls[0].clientHeight,o=Math.floor(this.getGui().clientHeight/s);let n=-1;e===El.PAGE_HOME?n=0:e===El.PAGE_END?n=i:e===El.PAGE_DOWN?n=Math.min(t+o,i):e===El.PAGE_UP&&(n=Math.max(t-o,0)),-1!==n&&this.highlightItem(this.itemEls[n])}addOptions(e){return e.forEach((e=>this.addOption(e))),this}addOption(e){const{value:t,text:i}=e,s=i||t;return this.options.push({value:t,text:s}),this.renderOption(t,s),this.updateIndices(),this}clearOptions(){this.options=[],this.reset(!0),this.itemEls.forEach((e=>{$a(e)})),this.itemEls=[]}updateIndices(){const e=this.getGui().querySelectorAll(".ag-list-item");e.forEach(((t,i)=>{Mr(t,i+1),Fr(t,e.length)}))}renderOption(e,t){const i=this.gos.getDocument(),s=i.createElement("div");cr(s,"option"),s.classList.add("ag-list-item",`ag-${this.cssIdentifier}-list-item`);const o=i.createElement("span");s.appendChild(o),o.textContent=t,this.unFocusable||(s.tabIndex=-1),this.itemEls.push(s),this.addManagedListener(s,"mousemove",(()=>this.highlightItem(s))),this.addManagedListener(s,"mousedown",(t=>{t.preventDefault(),this.setValue(e)})),this.createManagedBean(new $l({getTooltipValue:()=>t,getGui:()=>s,getLocation:()=>"UNKNOWN",shouldDisplayTooltip:()=>o.scrollWidth>o.clientWidth})),this.getGui().appendChild(s)}setValue(e,t){if(this.value===e)return this.fireItemSelected(),this;if(null==e)return this.reset(t),this;const i=this.options.findIndex((t=>t.value===e));if(-1!==i){const e=this.options[i];this.value=e.value,this.displayValue=e.text,this.highlightItem(this.itemEls[i]),t||this.fireChangeEvent()}return this}setValueByIndex(e){return this.setValue(this.options[e].value)}getValue(){return this.value}getDisplayValue(){return this.displayValue}refreshHighlighted(){this.clearHighlighted();const e=this.options.findIndex((e=>e.value===this.value));-1!==e&&this.highlightItem(this.itemEls[e])}reset(e){this.value=null,this.displayValue=null,this.clearHighlighted(),e||this.fireChangeEvent()}highlightItem(t){if(!ja(t))return;this.clearHighlighted(),this.highlightedEl=t,this.highlightedEl.classList.add(e.ACTIVE_CLASS),Vr(this.highlightedEl,!0);const i=this.getGui(),{scrollTop:s,clientHeight:o}=i,{offsetTop:n,offsetHeight:r}=t;(n+r>s+o||n<s)&&this.highlightedEl.scrollIntoView({block:"nearest"}),this.unFocusable||this.highlightedEl.focus()}clearHighlighted(){this.highlightedEl&&ja(this.highlightedEl)&&(this.highlightedEl.classList.remove(e.ACTIVE_CLASS),Vr(this.highlightedEl,!1),this.highlightedEl=null)}fireChangeEvent(){this.dispatchEvent({type:In.EVENT_FIELD_VALUE_CHANGED}),this.fireItemSelected()}fireItemSelected(){this.dispatchEvent({type:e.EVENT_ITEM_SELECTED})}};du.EVENT_ITEM_SELECTED="selectedItem",du.ACTIVE_CLASS="ag-active-item",Gs([Lo],du.prototype,"init",1);var cu=du,pu=class e extends hu{constructor(e){super(Ns({pickerAriaLabelKey:"ariaLabelSelectField",pickerAriaLabelValue:"Select Field",pickerType:"ag-list",className:"ag-select",pickerIcon:"smallDown",ariaRole:"combobox"},e))}postConstruct(){super.postConstruct(),this.createListComponent(),this.eWrapper.tabIndex=this.gos.get("tabIndex");const{options:e,value:t,placeholder:i}=this.config;null!=e&&this.addOptions(e),null!=t&&this.setValue(t,!0),i&&null==t&&(this.eDisplayField.textContent=i),this.addManagedListener(this.eWrapper,"focusout",this.onWrapperFocusOut.bind(this))}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}createListComponent(){this.listComponent=this.createBean(new cu("select",!0)),this.listComponent.setParentComponent(this);const t=this.listComponent.getAriaElement(),i=`ag-select-list-${this.listComponent.getCompId()}`;t.setAttribute("id",i),Br(this.getAriaElement(),t),this.listComponent.addManagedListener(this.listComponent,cu.EVENT_ITEM_SELECTED,(()=>{this.hidePicker(),this.dispatchEvent({type:e.EVENT_ITEM_SELECTED})})),this.listComponent.addManagedListener(this.listComponent,In.EVENT_FIELD_VALUE_CHANGED,(()=>{this.listComponent&&(this.setValue(this.listComponent.getValue(),!1,!0),this.hidePicker())}))}createPickerComponent(){return this.listComponent}onKeyDown(e){var t;const{key:i}=e;switch(i===El.TAB&&this.hidePicker(),i){case El.ENTER:case El.UP:case El.DOWN:case El.PAGE_UP:case El.PAGE_DOWN:case El.PAGE_HOME:case El.PAGE_END:e.preventDefault(),this.isPickerDisplayed?null==(t=this.listComponent)||t.handleKeyDown(e):super.onKeyDown(e);break;case El.ESCAPE:super.onKeyDown(e)}}showPicker(){this.listComponent&&(super.showPicker(),this.listComponent.refreshHighlighted())}addOptions(e){return e.forEach((e=>this.addOption(e))),this}addOption(e){return this.listComponent.addOption(e),this}clearOptions(){var e;return null==(e=this.listComponent)||e.clearOptions(),this}setValue(e,t,i){if(this.value===e||!this.listComponent)return this;if(i||this.listComponent.setValue(e,!0),this.listComponent.getValue()===this.getValue())return this;let s=this.listComponent.getDisplayValue();return null==s&&this.config.placeholder&&(s=this.config.placeholder),this.eDisplayField.textContent=s,this.setTooltip({newTooltipText:null!=s?s:null,shouldDisplayTooltip:()=>this.eDisplayField.scrollWidth>this.eDisplayField.clientWidth}),super.setValue(e,t)}destroy(){this.listComponent&&(this.destroyBean(this.listComponent),this.listComponent=void 0),super.destroy()}};pu.EVENT_ITEM_SELECTED="selectedItem";var gu=pu,mu=class extends uu{constructor(e,t,i="text",s="input"){super(e,`\n <div role="presentation">\n <div ref="eLabel" class="ag-input-field-label"></div>\n <div ref="eWrapper" class="ag-wrapper ag-input-wrapper" role="presentation">\n <${s} ref="eInput" class="ag-input-field-input"></${s}>\n </div>\n </div>`,t),this.inputType=i,this.displayFieldTag=s}postConstruct(){super.postConstruct(),this.setInputType(),this.eLabel.classList.add(`${this.className}-label`),this.eWrapper.classList.add(`${this.className}-input-wrapper`),this.eInput.classList.add(`${this.className}-input`),this.addCssClass("ag-input-field"),this.eInput.id=this.eInput.id||`ag-${this.getCompId()}-input`;const{inputName:e,inputWidth:t}=this.config;null!=e&&this.setInputName(e),null!=t&&this.setInputWidth(t),this.addInputListeners(),this.activateTabIndex([this.eInput])}addInputListeners(){this.addManagedListener(this.eInput,"input",(e=>this.setValue(e.target.value)))}setInputType(){"input"===this.displayFieldTag&&this.eInput.setAttribute("type",this.inputType)}getInputElement(){return this.eInput}setInputWidth(e){return tl(this.eWrapper,e),this}setInputName(e){return this.getInputElement().setAttribute("name",e),this}getFocusableElement(){return this.eInput}setMaxLength(e){return this.eInput.maxLength=e,this}setInputPlaceholder(e){return ul(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return Cr(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return Ia(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){if(!0===e)ul(this.eInput,"autocomplete",null);else{const t="string"==typeof e?e:"off";ul(this.eInput,"autocomplete",t)}return this}};Gs([ql("eLabel")],mu.prototype,"eLabel",2),Gs([ql("eWrapper")],mu.prototype,"eWrapper",2),Gs([ql("eInput")],mu.prototype,"eInput",2);var fu=class extends mu{constructor(e,t="ag-checkbox",i="checkbox"){super(e,t,i),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();const{readOnly:e,passive:t}=this.config;"boolean"==typeof e&&this.setReadOnly(e),"boolean"==typeof t&&this.setPassive(t)}addInputListeners(){this.addManagedListener(this.eInput,"click",this.onCheckboxClick.bind(this)),this.addManagedListener(this.eLabel,"click",this.toggle.bind(this))}getNextValue(){return void 0===this.selected||!this.selected}setPassive(e){this.passive=e}isReadOnly(){return this.readOnly}setReadOnly(e){this.eWrapper.classList.toggle("ag-disabled",e),this.eInput.disabled=e,this.readOnly=e}setDisabled(e){return this.eWrapper.classList.toggle("ag-disabled",e),super.setDisabled(e)}toggle(){if(this.eInput.disabled)return;const e=this.isSelected(),t=this.getNextValue();this.passive?this.dispatchChange(t,e):this.setValue(t)}getValue(){return this.isSelected()}setValue(e,t){return this.refreshSelectedClass(e),this.setSelected(e,t),this}setName(e){return this.getInputElement().name=e,this}isSelected(){return this.selected}setSelected(e,t){this.isSelected()!==e&&(this.previousValue=this.isSelected(),e=this.selected="boolean"==typeof e?e:void 0,this.eInput.checked=e,this.eInput.indeterminate=void 0===e,t||this.dispatchChange(this.selected,this.previousValue))}dispatchChange(e,t,i){this.dispatchEvent({type:In.EVENT_FIELD_VALUE_CHANGED,selected:e,previousValue:t,event:i});const s=this.getInputElement(),o={type:In.EVENT_CHECKBOX_CHANGED,id:s.id,name:s.name,selected:e,previousValue:t};this.eventService.dispatchEvent(o)}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;const t=this.isSelected(),i=this.selected=e.target.checked;this.refreshSelectedClass(i),this.dispatchChange(i,t,e)}refreshSelectedClass(e){this.eWrapper.classList.toggle("ag-checked",!0===e),this.eWrapper.classList.toggle("ag-indeterminate",null==e)}},Cu=class extends fu{constructor(e){super(e,"ag-radio-button","radio")}isSelected(){return this.eInput.checked}toggle(){this.eInput.disabled||this.isSelected()||this.setValue(!0)}addInputListeners(){super.addInputListeners(),this.addManagedListener(this.eventService,In.EVENT_CHECKBOX_CHANGED,this.onChange.bind(this))}onChange(e){e.selected&&e.name&&this.eInput.name&&this.eInput.name===e.name&&e.id&&this.eInput.id!==e.id&&this.setValue(!1,!0)}},vu=class{constructor(e,t,i){this.localeService=e,this.optionsFactory=t,this.valueFormatter=i}getModelAsString(e){if(!e)return null;const t=null!=e.operator,i=this.localeService.getLocaleTextFunc();if(t){const t=e;let{conditions:s}=t;if(!s){const{condition1:e,condition2:i}=t;s=[e,i]}const o=s.map((e=>this.getModelAsString(e))),n="AND"===t.operator?"andCondition":"orCondition";return o.join(` ${i(n,eu[n])} `)}if(e.type===yu.BLANK||e.type===yu.NOT_BLANK)return i(e.type,e.type);{const t=e,s=this.optionsFactory.getCustomOption(t.type),{displayKey:o,displayName:n,numberOfInputs:r}=s||{};return o&&n&&0===r?(i(o,n),n):this.conditionToString(t,s)}}updateParams(e){this.optionsFactory=e.optionsFactory}formatValue(e){var t;return this.valueFormatter?null!=(t=this.valueFormatter(null!=e?e:null))?t:"":String(e)}},wu=class e extends au{constructor(){super(...arguments),this.eTypes=[],this.eJoinOperatorPanels=[],this.eJoinOperatorsAnd=[],this.eJoinOperatorsOr=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}getNumberOfInputs(t){const i=this.optionsFactory.getCustomOption(t);if(i){const{numberOfInputs:e}=i;return null!=e?e:1}const s=[e.EMPTY,e.NOT_BLANK,e.BLANK];return t&&s.indexOf(t)>=0?0:t===e.IN_RANGE?2:1}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged(!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach(((t,i)=>{0===i?t.setValue(e,!0):t.setValue(this.optionsFactory.getDefaultOption(),!0)}))}getModelFromUi(){const e=this.getUiCompleteConditions();return 0===e.length?null:this.maxNumConditions>1&&e.length>1?{filterType:this.getFilterType(),operator:this.getJoinOperator(),condition1:e[0],condition2:e[1],conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map((e=>e.getValue()))}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){return 0===this.eJoinOperatorsOr.length?this.defaultJoinOperator:!0===this.eJoinOperatorsOr[0].getValue()?"OR":"AND"}areModelsEqual(e,t){if(!e&&!t)return!0;if(!e&&t||e&&!t)return!1;const i=!e.operator,s=!t.operator;if(!i&&s||i&&!s)return!1;let o;if(i){const i=e,s=t;o=this.areSimpleModelsEqual(i,s)}else{const i=e,s=t;o=i.operator===s.operator&&Zo(i.conditions,s.conditions,((e,t)=>this.areSimpleModelsEqual(e,t)))}return o}shouldRefresh(e){var t,i,s;const o=this.getModel(),n=o?null!=(t=o.conditions)?t:[o]:null,r=null!=(s=null==(i=e.filterOptions)?void 0:i.map((e=>"string"==typeof e?e:e.displayKey)))?s:this.getDefaultFilterOptions();return!(n&&!n.every((e=>void 0!==r.find((t=>t===e.type))))||"number"==typeof e.maxNumConditions&&n&&n.length>e.maxNumConditions)}refresh(e){return!!this.shouldRefresh(e)&&(!!super.refresh(e)&&(this.setParams(e),this.removeConditionsAndOperators(0),this.createOption(),this.setModel(this.getModel()),!0))}setModelIntoUi(e){if(e.operator){let t=e;t.conditions||(t.conditions=[t.condition1,t.condition2]);const i=this.validateAndUpdateConditions(t.conditions),s=this.getNumConditions();if(i<s)this.removeConditionsAndOperators(i);else if(i>s)for(let e=s;e<i;e++)this.createJoinOperatorPanel(),this.createOption();const o="OR"===t.operator;this.eJoinOperatorsAnd.forEach((e=>e.setValue(!o,!0))),this.eJoinOperatorsOr.forEach((e=>e.setValue(o,!0))),t.conditions.forEach(((e,t)=>{this.eTypes[t].setValue(e.type,!0),this.setConditionIntoUi(e,t)}))}else{const t=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(t.type,!0),this.setConditionIntoUi(t,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.onUiChanged(),Bl.resolve()}validateAndUpdateConditions(e){let t=e.length;return t>this.maxNumConditions&&(e.splice(this.maxNumConditions),co('Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.'),t=this.maxNumConditions),t}doesFilterPass(e){var t;const i=this.getModel();if(null==i)return!0;const{operator:s}=i,o=[];if(s){const e=i;o.push(...null!=(t=e.conditions)?t:[])}else o.push(i);return o[s&&"OR"===s?"some":"every"]((t=>this.individualConditionPasses(e,t)))}setParams(e){super.setParams(e),this.setNumConditions(e),this.defaultJoinOperator=this.getDefaultJoinOperator(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.optionsFactory=new Zl,this.optionsFactory.init(e,this.getDefaultFilterOptions()),this.createFilterListOptions(),this.createOption(),this.createMissingConditionsAndOperators(),this.isReadOnly()&&this.eFilterBody.setAttribute("tabindex","-1")}setNumConditions(e){var t,i;null!=e.suppressAndOrCondition&&co('Since v29.2 "filterParams.suppressAndOrCondition" is deprecated. Use "filterParams.maxNumConditions = 1" instead.'),null!=e.alwaysShowBothConditions&&co('Since v29.2 "filterParams.alwaysShowBothConditions" is deprecated. Use "filterParams.numAlwaysVisibleConditions = 2" instead.'),this.maxNumConditions=null!=(t=e.maxNumConditions)?t:e.suppressAndOrCondition?1:2,this.maxNumConditions<1&&(co('"filterParams.maxNumConditions" must be greater than or equal to zero.'),this.maxNumConditions=1),this.numAlwaysVisibleConditions=null!=(i=e.numAlwaysVisibleConditions)?i:e.alwaysShowBothConditions?2:1,this.numAlwaysVisibleConditions<1&&(co('"filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.'),this.numAlwaysVisibleConditions=1),this.numAlwaysVisibleConditions>this.maxNumConditions&&(co('"filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".'),this.numAlwaysVisibleConditions=this.maxNumConditions)}createOption(){const e=this.createManagedBean(new gu);this.eTypes.push(e),e.addCssClass("ag-filter-select"),this.eFilterBody.appendChild(e.getGui());const t=this.createValueElement();this.eConditionBodies.push(t),this.eFilterBody.appendChild(t),this.putOptionsIntoDropdown(e),this.resetType(e);const i=this.getNumConditions()-1;this.forEachPositionInput(i,(e=>this.resetInput(e))),this.addChangedListeners(e,i)}createJoinOperatorPanel(){const e=document.createElement("div");this.eJoinOperatorPanels.push(e),e.classList.add("ag-filter-condition");const t=this.createJoinOperator(this.eJoinOperatorsAnd,e,"and"),i=this.createJoinOperator(this.eJoinOperatorsOr,e,"or");this.eFilterBody.appendChild(e);const s=this.eJoinOperatorPanels.length-1,o=this.joinOperatorId++;this.resetJoinOperatorAnd(t,s,o),this.resetJoinOperatorOr(i,s,o),this.isReadOnly()||(t.onValueChange(this.listener),i.onValueChange(this.listener))}createJoinOperator(e,t,i){const s=this.createManagedBean(new Cu);return e.push(s),s.addCssClass("ag-filter-condition-operator"),s.addCssClass(`ag-filter-condition-operator-${i}`),t.appendChild(s.getGui()),s}getDefaultJoinOperator(e){return"AND"===e||"OR"===e?e:"AND"}createFilterListOptions(){const e=this.optionsFactory.getFilterOptions();this.filterListOptions=e.map((e=>"string"==typeof e?this.createBoilerplateListOption(e):this.createCustomListOption(e)))}putOptionsIntoDropdown(e){this.filterListOptions.forEach((t=>{e.addOption(t)})),e.setDisabled(this.filterListOptions.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,i=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:i?this.localeService.getLocaleTextFunc()(i.displayKey,i.displayName):this.translate(t)}}isAllowTwoConditions(){return this.maxNumConditions>=2}createBodyTemplate(){return""}getCssIdentifier(){return"simple-filter"}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){var e;let t=-1,i=!0;for(let e=0;e<this.getNumConditions();e++)this.isConditionUiComplete(e)?t=e:i=!1;if(this.shouldAddNewConditionAtEnd(i))this.createJoinOperatorPanel(),this.createOption();else{const i=null!=(e=this.lastUiCompletePosition)?e:this.getNumConditions()-2;if(t<i){this.removeConditionsAndOperators(i+1);const e=t+1,s=i-e;s>0&&this.removeConditionsAndOperators(e,s),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=t}updateConditionStatusesAndValues(e,t){this.eTypes.forEach(((t,i)=>{const s=this.isConditionDisabled(i,e);t.setDisabled(s||this.filterListOptions.length<=1),1===i&&(Ia(this.eJoinOperatorPanels[0],s),this.eJoinOperatorsAnd[0].setDisabled(s),this.eJoinOperatorsOr[0].setDisabled(s))})),this.eConditionBodies.forEach(((e,t)=>{La(e,this.isConditionBodyVisible(t))}));const i="OR"===(null!=t?t:this.getJoinOperator());this.eJoinOperatorsAnd.forEach(((e,t)=>{e.setValue(!i,!0)})),this.eJoinOperatorsOr.forEach(((e,t)=>{e.setValue(i,!0)})),this.forEachInput(((t,i,s,o)=>{this.setElementDisplayed(t,i<o),this.setElementDisabled(t,this.isConditionDisabled(s,e))})),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;this.removeComponents(this.eTypes,e,t),this.removeElements(this.eConditionBodies,e,t),this.removeValueElements(e,t);const i=Math.max(e-1,0);this.removeElements(this.eJoinOperatorPanels,i,t),this.removeComponents(this.eJoinOperatorsAnd,i,t),this.removeComponents(this.eJoinOperatorsOr,i,t)}removeElements(e,t,i){this.removeItems(e,t,i).forEach((e=>$a(e)))}removeComponents(e,t,i){this.removeItems(e,t,i).forEach((e=>{$a(e.getGui()),this.destroyBean(e)}))}removeItems(e,t,i){return null==i?e.splice(t):e.splice(t,i)}afterGuiAttached(e){if(super.afterGuiAttached(e),this.resetPlaceholder(),!(null==e?void 0:e.suppressFocus))if(this.isReadOnly())this.eFilterBody.focus();else{const e=this.getInputs(0)[0];if(!e)return;e instanceof mu&&e.getInputElement().focus()}}afterGuiDetached(){super.afterGuiDetached();const e=this.getModel();this.resetUiToActiveModel(e);let t=-1,i=-1,s=!1;const o=this.getJoinOperator();for(let e=this.getNumConditions()-1;e>=0;e--)if(this.isConditionUiComplete(e))-1===t&&(t=e,i=e);else{const o=e<t;(e>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(e-1)||o)&&(this.removeConditionsAndOperators(e,1),s=!0,o&&i--)}let n=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),n=!0),this.shouldAddNewConditionAtEnd(i===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),n=!0),n&&this.updateConditionStatusesAndValues(i,o),s&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=i}getPlaceholderText(e,t){let i=this.translate(e);if(mo(this.filterPlaceholder)){const e=this.filterPlaceholder,s=this.eTypes[t].getValue();i=e({filterOptionKey:s,filterOption:this.translate(s),placeholder:i})}else"string"==typeof this.filterPlaceholder&&(i=this.filterPlaceholder);return i}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc();this.forEachInput(((t,i,s,o)=>{if(!(t instanceof mu))return;const n=0===i&&o>1?"inRangeStart":0===i?"filterOoo":"inRangeEnd",r=0===i&&o>1?e("ariaFilterFromValue","Filter from value"):0===i?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(n,s)),t.setInputAriaLabel(r)}))}setElementValue(e,t,i){e instanceof mu&&e.setValue(null!=t?String(t):null,!0)}setElementDisplayed(e,t){e instanceof Yl&&La(e.getGui(),t)}setElementDisabled(e,t){e instanceof Yl&&Ia(e.getGui(),t)}attachElementOnChange(e,t){e instanceof mu&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach(((t,i)=>{this.forEachPositionTypeInput(i,t,e)}))}forEachPositionInput(e,t){const i=this.getConditionType(e);this.forEachPositionTypeInput(e,i,t)}forEachPositionTypeInput(e,t,i){const s=this.getNumberOfInputs(t),o=this.getInputs(e);for(let t=0;t<o.length;t++){const n=o[t];null!=n&&i(n,t,e,s)}}isConditionDisabled(e,t){return!!this.isReadOnly()||0!==e&&e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return this.getNumberOfInputs(t)>0}isConditionUiComplete(t){return!(t>=this.getNumConditions())&&(this.getConditionType(t)!==e.EMPTY&&!this.getValues(t).some((e=>null==e)))}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const e=[];for(let t=0;t<this.getNumConditions();t++)this.isConditionUiComplete(t)&&e.push(this.createCondition(t));return e}createMissingConditionsAndOperators(){if(!this.isReadOnly())for(let e=this.getNumConditions();e<this.numAlwaysVisibleConditions;e++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){return this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach((e=>this.resetType(e))),this.eJoinOperatorsAnd.forEach(((e,t)=>this.resetJoinOperatorAnd(e,t,this.joinOperatorId+t))),this.eJoinOperatorsOr.forEach(((e,t)=>this.resetJoinOperatorOr(e,t,this.joinOperatorId+t))),this.joinOperatorId++,this.forEachInput((e=>this.resetInput(e))),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,e||this.onUiChanged(),Bl.resolve()}resetType(e){const t=this.localeService.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.getDefaultOption(),!0).setAriaLabel(t).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,i){this.resetJoinOperator(e,t,this.isDefaultOperator("AND"),this.translate("andCondition"),i)}resetJoinOperatorOr(e,t,i){this.resetJoinOperator(e,t,this.isDefaultOperator("OR"),this.translate("orCondition"),i)}resetJoinOperator(e,t,i,s,o){this.updateJoinOperatorDisabled(e.setValue(i,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${o}`).setLabel(s),t)}updateJoinOperatorsDisabled(){this.eJoinOperatorsAnd.forEach(((e,t)=>this.updateJoinOperatorDisabled(e,t))),this.eJoinOperatorsOr.forEach(((e,t)=>this.updateJoinOperatorDisabled(e,t)))}updateJoinOperatorDisabled(e,t){e.setDisabled(this.isReadOnly()||t>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,t){const i=this.mapValuesFromModel(e);this.forEachInput(((e,s,o,n)=>{o===t&&this.setElementValue(e,null!=i[s]?i[s]:null)}))}setValueFromFloatingFilter(e){this.forEachInput(((t,i,s,o)=>{this.setElementValue(t,0===i&&0===s?e:null,!0)}))}isDefaultOperator(e){return e===this.defaultJoinOperator}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,(e=>{this.attachElementOnChange(e,this.listener)})))}individualConditionPasses(e,t){const i=this.getCellValue(e.node),s=this.mapValuesFromModel(t),o=this.optionsFactory.getCustomOption(t.type),n=this.evaluateCustomFilter(o,s,i);return null!=n?n:null==i?this.evaluateNullValue(t.type):this.evaluateNonNullValue(s,i,t,e)}evaluateCustomFilter(e,t,i){if(null==e)return;const{predicate:s}=e;return null==s||t.some((e=>null==e))?void 0:s(t,i)}isBlank(e){return null==e||"string"==typeof e&&0===e.trim().length}hasInvalidInputs(){return!1}};wu.EMPTY="empty",wu.BLANK="blank",wu.NOT_BLANK="notBlank",wu.EQUALS="equals",wu.NOT_EQUAL="notEqual",wu.LESS_THAN="lessThan",wu.LESS_THAN_OR_EQUAL="lessThanOrEqual",wu.GREATER_THAN="greaterThan",wu.GREATER_THAN_OR_EQUAL="greaterThanOrEqual",wu.IN_RANGE="inRange",wu.CONTAINS="contains",wu.NOT_CONTAINS="notContains",wu.STARTS_WITH="startsWith",wu.ENDS_WITH="endsWith";var yu=wu,Eu=class e extends yu{setParams(e){super.setParams(e),this.scalarFilterParams=e}evaluateNullValue(t){switch(t){case e.EQUALS:case e.NOT_EQUAL:if(this.scalarFilterParams.includeBlanksInEquals)return!0;break;case e.GREATER_THAN:case e.GREATER_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInGreaterThan)return!0;break;case e.LESS_THAN:case e.LESS_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInLessThan)return!0;break;case e.IN_RANGE:if(this.scalarFilterParams.includeBlanksInRange)return!0;break;case e.BLANK:return!0;case e.NOT_BLANK:return!1}return!1}evaluateNonNullValue(t,i,s){const o=this.comparator(),n=null!=t[0]?o(t[0],i):0;switch(s.type){case e.EQUALS:return 0===n;case e.NOT_EQUAL:return 0!==n;case e.GREATER_THAN:return n>0;case e.GREATER_THAN_OR_EQUAL:return n>=0;case e.LESS_THAN:return n<0;case e.LESS_THAN_OR_EQUAL:return n<=0;case e.IN_RANGE:{const e=o(t[1],i);return this.scalarFilterParams.inRangeInclusive?n>=0&&e<=0:n>0&&e<0}case e.BLANK:return this.isBlank(i);case e.NOT_BLANK:return!this.isBlank(i);default:return console.warn('AG Grid: Unexpected type of filter "'+s.type+'", it looks like the filter was configured with incorrect Filter Options'),!0}}},Su=1/0,bu=class extends vu{constructor(e,t,i){super(t,i),this.dateFilterParams=e}conditionToString(e,t){const{type:i}=e,{numberOfInputs:s}=t||{},o=i==yu.IN_RANGE||2===s,n=Ra(e.dateFrom),r=Ra(e.dateTo),a=this.dateFilterParams.inRangeFloatingFilterDateFormat;return o?`${null!==n?ba(n,a):"null"}-${null!==r?ba(r,a):"null"}`:null!=n?ba(n,a):`${i}`}updateParams(e){super.updateParams(e),this.dateFilterParams=e.dateFilterParams}},Ru=class e extends Eu{constructor(){super("dateFilter"),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=1e3,this.maxValidYear=Su,this.minValidDate=null,this.maxValidDate=null}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}mapValuesFromModel(e){const{dateFrom:t,dateTo:i,type:s}=e||{};return[t&&Ra(t)||null,i&&Ra(i)||null].slice(0,this.getNumberOfInputs(s))}comparator(){return this.dateFilterParams.comparator?this.dateFilterParams.comparator:this.defaultComparator.bind(this)}defaultComparator(e,t){return null==t||t<e?-1:t>e?1:0}setParams(e){this.dateFilterParams=e,super.setParams(e);const t=(t,i)=>{if(null!=e[t]){if(!isNaN(e[t]))return null==e[t]?i:Number(e[t]);console.warn(`AG Grid: DateFilter ${t} is not a number`)}return i};this.minValidYear=t("minValidYear",1e3),this.maxValidYear=t("maxValidYear",Su),this.minValidYear>this.maxValidYear&&console.warn("AG Grid: DateFilter minValidYear should be <= maxValidYear"),e.minValidDate?this.minValidDate=e.minValidDate instanceof Date?e.minValidDate:Ra(e.minValidDate):this.minValidDate=null,e.maxValidDate?this.maxValidDate=e.maxValidDate instanceof Date?e.maxValidDate:Ra(e.maxValidDate):this.maxValidDate=null,this.minValidDate&&this.maxValidDate&&this.minValidDate>this.maxValidDate&&console.warn("AG Grid: DateFilter minValidDate should be <= maxValidDate"),this.filterModelFormatter=new bu(this.dateFilterParams,this.localeService,this.optionsFactory)}createDateCompWrapper(e){const t=new Jl(this.getContext(),this.userComponentFactory,{onDateChanged:()=>this.onUiChanged(),filterParams:this.dateFilterParams},e);return this.addDestroyFunc((()=>t.destroy())),t}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}getDefaultFilterOptions(){return e.DEFAULT_FILTER_OPTIONS}createValueElement(){const e=this.gos.getDocument().createElement("div");return e.classList.add("ag-filter-body"),this.createFromToElement(e,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(e,this.eConditionPanelsTo,this.dateConditionToComps,"to"),e}createFromToElement(e,t,i,s){const o=this.gos.getDocument().createElement("div");o.classList.add(`ag-filter-${s}`),o.classList.add(`ag-filter-date-${s}`),t.push(o),e.appendChild(o),i.push(this.createDateCompWrapper(o))}removeValueElements(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),this.removeItems(this.eConditionPanelsFrom,e,t),this.removeItems(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,i){this.removeItems(e,t,i).forEach((e=>e.destroy()))}isValidDateValue(e){if(null===e)return!1;if(this.minValidDate){if(e<this.minValidDate)return!1}else if(e.getUTCFullYear()<this.minValidYear)return!1;if(this.maxValidDate){if(e>this.maxValidDate)return!1}else if(e.getUTCFullYear()>this.maxValidYear)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput(((i,s,o,n)=>{o!==e||!t||s>=n||(t=t&&this.isValidDateValue(i.getDate()))})),t}areSimpleModelsEqual(e,t){return e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}getFilterType(){return"date"}createCondition(e){const t=this.getConditionType(e),i={},s=this.getValues(e);return s.length>0&&(i.dateFrom=Ea(s[0])),s.length>1&&(i.dateTo=Ea(s[1])),Ns({dateFrom:null,dateTo:null,filterType:this.getFilterType(),type:t},i)}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),i=e("ariaFilterValue","Filter Value");this.forEachInput((e=>{e.setInputPlaceholder(t),e.setInputAriaLabel(i)}))}getInputs(e){return e>=this.dateConditionFromComps.length?[null,null]:[this.dateConditionFromComps[e],this.dateConditionToComps[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,((e,i,s,o)=>{i<o&&t.push(e.getDate())})),t}translate(e){return e===Eu.LESS_THAN?super.translate("before"):e===Eu.GREATER_THAN?super.translate("after"):super.translate(e)}getModelAsString(e){var t;return null!=(t=this.filterModelFormatter.getModelAsString(e))?t:""}};Ru.DEFAULT_FILTER_OPTIONS=[Eu.EQUALS,Eu.NOT_EQUAL,Eu.LESS_THAN,Eu.GREATER_THAN,Eu.IN_RANGE,Eu.BLANK,Eu.NOT_BLANK],Gs([No("userComponentFactory")],Ru.prototype,"userComponentFactory",2);var Du=Ru,Tu=class extends Yl{getDefaultDebounceMs(){return 0}destroy(){super.destroy()}isEventFromFloatingFilter(e){return e&&e.afterFloatingFilter}isEventFromDataChange(e){return null==e?void 0:e.afterDataChange}getLastType(){return this.lastType}isReadOnly(){return this.readOnly}setLastTypeFromModel(e){if(!e)return void(this.lastType=this.optionsFactory.getDefaultOption());let t;t=e.operator?e.conditions[0]:e,this.lastType=t.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const t=e;return this.isTypeEditable(t.type)}init(e){this.setSimpleParams(e,!1)}setSimpleParams(e,t=!0){this.optionsFactory=new Zl,this.optionsFactory.init(e.filterParams,this.getDefaultFilterOptions()),t||(this.lastType=this.optionsFactory.getDefaultOption()),this.readOnly=!!e.filterParams.readOnly;const i=this.isTypeEditable(this.optionsFactory.getDefaultOption());this.setEditable(i)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.setSimpleParams(e)}doesFilterHaveSingleInput(e){const t=this.optionsFactory.getCustomOption(e),{numberOfInputs:i}=t||{};return null==i||1==i}isTypeEditable(e){const t=[yu.IN_RANGE,yu.EMPTY,yu.BLANK,yu.NOT_BLANK];return!!e&&!this.isReadOnly()&&this.doesFilterHaveSingleInput(e)&&t.indexOf(e)<0}getAriaLabel(e){return`${this.columnModel.getDisplayNameForColumn(e.column,"header",!0)} ${this.localeService.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`}};Gs([No("columnModel")],Tu.prototype,"columnModel",2);var Au=class extends Tu{constructor(){super('\n <div class="ag-floating-filter-input" role="presentation">\n <ag-input-text-field ref="eReadOnlyText"></ag-input-text-field>\n <div ref="eDateWrapper" style="display: flex;"></div>\n </div>')}getDefaultFilterOptions(){return Du.DEFAULT_FILTER_OPTIONS}init(e){super.init(e),this.params=e,this.filterParams=e.filterParams,this.createDateComponent(),this.filterModelFormatter=new bu(this.filterParams,this.localeService,this.optionsFactory);const t=this.localeService.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput","Date Filter Input"))}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.params=e,this.filterParams=e.filterParams,this.updateDateComponent(),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory,dateFilterParams:this.filterParams}),this.updateCompOnModelChange(e.currentParentModel())}updateCompOnModelChange(e){const t=!this.isReadOnly()&&this.canWeEditAfterModelFromParentFilter(e);if(this.setEditable(t),t){if(e){const t=e;this.dateComp.setDate(Ra(t.dateFrom))}else this.dateComp.setDate(null);this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){La(this.eDateWrapper,e),La(this.eReadOnlyText.getGui(),!e)}onParentModelChanged(e,t){this.isEventFromFloatingFilter(t)||this.isEventFromDataChange(t)||(super.setLastTypeFromModel(e),this.updateCompOnModelChange(e))}onDateChanged(){const e=Ea(this.dateComp.getDate());this.params.parentFilterInstance((t=>{if(t){const i=Ra(e);t.onFloatingFilterChanged(this.getLastType()||null,i)}}))}getDateComponentParams(){const e=au.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs());return{onDateChanged:Eo(this.onDateChanged.bind(this),e),filterParams:this.params.column.getColDef().filterParams}}createDateComponent(){this.dateComp=new Jl(this.getContext(),this.userComponentFactory,this.getDateComponentParams(),this.eDateWrapper,(e=>{e.setInputAriaLabel(this.getAriaLabel(this.params))})),this.addDestroyFunc((()=>this.dateComp.destroy()))}updateDateComponent(){const e=this.gos.addGridCommonParams(this.getDateComponentParams());this.dateComp.updateParams(e)}getFilterModelFormatter(){return this.filterModelFormatter}};Gs([No("userComponentFactory")],Au.prototype,"userComponentFactory",2),Gs([ql("eReadOnlyText")],Au.prototype,"eReadOnlyText",2),Gs([ql("eDateWrapper")],Au.prototype,"eDateWrapper",2);var Pu=class extends Yl{constructor(){super('\n <div class="ag-filter-filter">\n <ag-input-text-field class="ag-date-filter" ref="eDateInput"></ag-input-text-field>\n </div>')}destroy(){super.destroy()}init(e){this.params=e,this.setParams(e);const t=this.eDateInput.getInputElement();this.addManagedListener(t,"mousedown",(()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||t.focus()})),this.addManagedListener(t,"input",(e=>{e.target===this.gos.getActiveDomElement()&&(this.eDateInput.isDisabled()||this.params.onDateChanged())}))}setParams(e){const t=this.eDateInput.getInputElement(),i=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=i&&Jr(),t.type=i?"date":"text";const{minValidYear:s,maxValidYear:o,minValidDate:n,maxValidDate:r}=e.filterParams||{};if(n&&s&&co("DateFilter should not have both minValidDate and minValidYear parameters set at the same time! minValidYear will be ignored."),r&&o&&co("DateFilter should not have both maxValidDate and maxValidYear parameters set at the same time! maxValidYear will be ignored."),n&&r){const[e,t]=[n,r].map((e=>e instanceof Date?e:Ra(e)));e&&t&&e.getTime()>t.getTime()&&co("DateFilter parameter minValidDate should always be lower than or equal to parameter maxValidDate.")}n?n instanceof Date?t.min=ba(n):t.min=n:s&&(t.min=`${s}-01-01`),r?r instanceof Date?t.max=ba(r):t.max=r:o&&(t.max=`${o}-12-31`)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.params=e,this.setParams(e)}getDate(){return Ra(this.eDateInput.getValue())}setDate(e){this.eDateInput.setValue(Ea(e,!1))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setInputAriaLabel(e){this.eDateInput.setAriaLabel(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){e&&e.suppressFocus||this.eDateInput.getInputElement().focus()}shouldUseBrowserDatePicker(e){return e.filterParams&&null!=e.filterParams.browserDatePicker?e.filterParams.browserDatePicker:ea()||ta()||Jr()&&Zr()>=14.1}};Gs([ql("eDateInput")],Pu.prototype,"eDateInput",2);var Fu=class extends mu{constructor(e,t="ag-text-field",i="text"){super(e,t,i)}postConstruct(){super.postConstruct(),this.config.allowedCharPattern&&this.preventDisallowedCharacters()}setValue(e,t){return this.eInput.value!==e&&(this.eInput.value=Bs(e)?e:""),super.setValue(e,t)}setStartValue(e){this.setValue(e,!0)}preventDisallowedCharacters(){const e=new RegExp(`[${this.config.allowedCharPattern}]`);this.addManagedListener(this.eInput,"keydown",(t=>{Pl(t)&&t.key&&!e.test(t.key)&&t.preventDefault()})),this.addManagedListener(this.eInput,"paste",(t=>{var i;const s=null==(i=t.clipboardData)?void 0:i.getData("text");s&&s.split("").some((t=>!e.test(t)))&&t.preventDefault()}))}},Mu=class extends Fu{constructor(e){super(e,"ag-number-field","number")}postConstruct(){super.postConstruct(),this.addManagedListener(this.eInput,"blur",(()=>{const e=parseFloat(this.eInput.value),t=isNaN(e)?"":this.normalizeValue(e.toString());this.value!==t&&this.setValue(t)})),this.addManagedListener(this.eInput,"wheel",this.onWheel.bind(this)),this.eInput.step="any";const{precision:e,min:t,max:i,step:s}=this.config;"number"==typeof e&&this.setPrecision(e),"number"==typeof t&&this.setMin(t),"number"==typeof i&&this.setMax(i),"number"==typeof s&&this.setStep(s)}onWheel(e){this.gos.getActiveDomElement()===this.eInput&&e.preventDefault()}normalizeValue(e){if(""===e)return"";null!=this.precision&&(e=this.adjustPrecision(e));const t=parseFloat(e);return null!=this.min&&t<this.min?e=this.min.toString():null!=this.max&&t>this.max&&(e=this.max.toString()),e}adjustPrecision(e,t){if(null==this.precision)return e;if(t){const t=parseFloat(e).toFixed(this.precision);return parseFloat(t).toString()}const i=String(e).split(".");if(i.length>1){if(i[1].length<=this.precision)return e;if(this.precision>0)return`${i[0]}.${i[1].slice(0,this.precision)}`}return i[0]}setMin(e){return this.min===e||(this.min=e,ul(this.eInput,"min",e)),this}setMax(e){return this.max===e||(this.max=e,ul(this.eInput,"max",e)),this}setPrecision(e){return this.precision=e,this}setStep(e){return this.step===e||(this.step=e,ul(this.eInput,"step",e)),this}setValue(e,t){return this.setValueOrInputValue((e=>super.setValue(e,t)),(()=>this),e)}setStartValue(e){return this.setValueOrInputValue((e=>super.setValue(e,!0)),(e=>{this.eInput.value=e}),e)}setValueOrInputValue(e,t,i){if(Bs(i)){let s=this.isScientificNotation(i);if(s&&this.eInput.validity.valid)return e(i);if(s||(s=(i=this.adjustPrecision(i))!=this.normalizeValue(i)),s)return t(i)}return e(i)}getValue(){if(!this.eInput.validity.valid)return;const e=this.eInput.value;return this.isScientificNotation(e)?this.adjustPrecision(e,!0):super.getValue()}isScientificNotation(e){return"string"==typeof e&&e.includes("e")}},Lu=class extends vu{conditionToString(e,t){const{numberOfInputs:i}=t||{};return e.type==yu.IN_RANGE||2===i?`${this.formatValue(e.filter)}-${this.formatValue(e.filterTo)}`:null!=e.filter?this.formatValue(e.filter):`${e.type}`}};function xu(e){const{allowedCharPattern:t}=null!=e?e:{};return null!=t?t:null}var Iu=class e extends Eu{constructor(){super("numberFilter"),this.eValuesFrom=[],this.eValuesTo=[]}refresh(e){return this.numberFilterParams.allowedCharPattern===e.allowedCharPattern&&super.refresh(e)}mapValuesFromModel(e){const{filter:t,filterTo:i,type:s}=e||{};return[this.processValue(t),this.processValue(i)].slice(0,this.getNumberOfInputs(s))}getDefaultDebounceMs(){return 500}comparator(){return(e,t)=>e===t?0:e<t?1:-1}setParams(e){this.numberFilterParams=e,super.setParams(e),this.filterModelFormatter=new Lu(this.localeService,this.optionsFactory,this.numberFilterParams.numberFormatter)}getDefaultFilterOptions(){return e.DEFAULT_FILTER_OPTIONS}setElementValue(e,t,i){const s=!i&&this.numberFilterParams.numberFormatter?this.numberFilterParams.numberFormatter(null!=t?t:null):t;super.setElementValue(e,s)}createValueElement(){const e=xu(this.numberFilterParams),t=document.createElement("div");return t.classList.add("ag-filter-body"),cr(t,"presentation"),this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement(e,t,i,s){const o=this.createManagedBean(s?new Fu({allowedCharPattern:s}):new Mu);o.addCssClass(`ag-filter-${i}`),o.addCssClass("ag-filter-filter"),t.push(o),e.appendChild(o.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}getValues(e){const t=[];return this.forEachPositionInput(e,((e,i,s,o)=>{i<o&&t.push(this.processValue(this.stringToFloat(e.getValue())))})),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getFilterType(){return"number"}processValue(e){return null==e||isNaN(e)?null:e}stringToFloat(e){if("number"==typeof e)return e;let t=Hs(e);return null!=t&&""===t.trim()&&(t=null),this.numberFilterParams.numberParser?this.numberFilterParams.numberParser(t):null==t||"-"===t.trim()?null:parseFloat(t)}createCondition(e){const t=this.getConditionType(e),i={filterType:this.getFilterType(),type:t},s=this.getValues(e);return s.length>0&&(i.filter=s[0]),s.length>1&&(i.filterTo=s[1]),i}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getModelAsString(e){var t;return null!=(t=this.filterModelFormatter.getModelAsString(e))?t:""}hasInvalidInputs(){let e=!1;return this.forEachInput((t=>{t.getInputElement().validity.valid||(e=!0)})),e}};Iu.DEFAULT_FILTER_OPTIONS=[Eu.EQUALS,Eu.NOT_EQUAL,Eu.GREATER_THAN,Eu.GREATER_THAN_OR_EQUAL,Eu.LESS_THAN,Eu.LESS_THAN_OR_EQUAL,Eu.IN_RANGE,Eu.BLANK,Eu.NOT_BLANK];var Nu=Iu,_u=class extends vu{conditionToString(e,t){const{numberOfInputs:i}=t||{};return e.type==yu.IN_RANGE||2===i?`${e.filter}-${e.filterTo}`:null!=e.filter?`${e.filter}`:`${e.type}`}},Ou=class e extends yu{constructor(){super("textFilter"),this.eValuesFrom=[],this.eValuesTo=[]}static trimInput(e){const t=e&&e.trim();return""===t?e:t}getDefaultDebounceMs(){return 500}setParams(t){this.textFilterParams=t,super.setParams(t),this.matcher=this.getTextMatcher(),this.formatter=this.textFilterParams.textFormatter||(this.textFilterParams.caseSensitive?e.DEFAULT_FORMATTER:e.DEFAULT_LOWERCASE_FORMATTER),this.filterModelFormatter=new _u(this.localeService,this.optionsFactory)}getTextMatcher(){const t=this.textFilterParams.textCustomComparator;return t?(Vl.warnOnce("textCustomComparator is deprecated, use textMatcher instead."),({filterOption:e,value:i,filterText:s})=>t(e,i,s)):this.textFilterParams.textMatcher||e.DEFAULT_MATCHER}createCondition(e){const t=this.getConditionType(e),i={filterType:this.getFilterType(),type:t},s=this.getValuesWithSideEffects(e,!0);return s.length>0&&(i.filter=s[0]),s.length>1&&(i.filterTo=s[1]),i}getFilterType(){return"text"}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getValues(e){return this.getValuesWithSideEffects(e,!1)}getValuesWithSideEffects(t,i){const s=[];return this.forEachPositionInput(t,((t,o,n,r)=>{var a;if(o<r){let o=Hs(t.getValue());i&&this.textFilterParams.trimInput&&(o=null!=(a=e.trimInput(o))?a:null,t.setValue(o,!0)),s.push(o)}})),s}getDefaultFilterOptions(){return e.DEFAULT_FILTER_OPTIONS}createValueElement(){const e=document.createElement("div");return e.classList.add("ag-filter-body"),cr(e,"presentation"),this.createFromToElement(e,this.eValuesFrom,"from"),this.createFromToElement(e,this.eValuesTo,"to"),e}createFromToElement(e,t,i){const s=this.createManagedBean(new Fu);s.addCssClass(`ag-filter-${i}`),s.addCssClass("ag-filter-filter"),t.push(s),e.appendChild(s.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}mapValuesFromModel(e){const{filter:t,filterTo:i,type:s}=e||{};return[t||null,i||null].slice(0,this.getNumberOfInputs(s))}evaluateNullValue(e){const t=[yu.NOT_EQUAL,yu.NOT_CONTAINS,yu.BLANK];return!!e&&t.indexOf(e)>=0}evaluateNonNullValue(e,t,i,s){const o=e.map((e=>this.formatter(e)))||[],n=this.formatter(t),{api:r,colDef:a,column:l,columnApi:u,context:h,textFormatter:d}=this.textFilterParams;if(i.type===yu.BLANK)return this.isBlank(t);if(i.type===yu.NOT_BLANK)return!this.isBlank(t);const c={api:r,colDef:a,column:l,columnApi:u,context:h,node:s.node,data:s.data,filterOption:i.type,value:n,textFormatter:d};return o.some((e=>this.matcher(_s(Ns({},c),{filterText:e}))))}getModelAsString(e){var t;return null!=(t=this.filterModelFormatter.getModelAsString(e))?t:""}};Ou.DEFAULT_FILTER_OPTIONS=[yu.CONTAINS,yu.NOT_CONTAINS,yu.EQUALS,yu.NOT_EQUAL,yu.STARTS_WITH,yu.ENDS_WITH,yu.BLANK,yu.NOT_BLANK],Ou.DEFAULT_FORMATTER=e=>e,Ou.DEFAULT_LOWERCASE_FORMATTER=e=>null==e?null:e.toString().toLowerCase(),Ou.DEFAULT_MATCHER=({filterOption:e,value:t,filterText:i})=>{if(null==i)return!1;switch(e){case Ou.CONTAINS:return t.indexOf(i)>=0;case Ou.NOT_CONTAINS:return t.indexOf(i)<0;case Ou.EQUALS:return t===i;case Ou.NOT_EQUAL:return t!=i;case Ou.STARTS_WITH:return 0===t.indexOf(i);case Ou.ENDS_WITH:const e=t.lastIndexOf(i);return e>=0&&e===t.length-i.length;default:return!1}};var Gu=Ou,ku=class extends Pn{constructor(e){super(),this.params=e,this.valueChangedListener=()=>{}}setupGui(e){var t;this.eFloatingFilterTextInput=this.createManagedBean(new Fu(null==(t=this.params)?void 0:t.config));const i=this.eFloatingFilterTextInput.getGui();e.appendChild(i),this.addManagedListener(i,"input",(e=>this.valueChangedListener(e))),this.addManagedListener(i,"keydown",(e=>this.valueChangedListener(e)))}setEditable(e){this.eFloatingFilterTextInput.setDisabled(!e)}setAutoComplete(e){this.eFloatingFilterTextInput.setAutoComplete(e)}getValue(){return this.eFloatingFilterTextInput.getValue()}setValue(e,t){this.eFloatingFilterTextInput.setValue(e,t)}setValueChangedListener(e){this.valueChangedListener=e}setParams(e){this.setAriaLabel(e.ariaLabel),void 0!==e.autoComplete&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eFloatingFilterTextInput.setInputAriaLabel(e)}},Vu=class extends Tu{postConstruct(){this.setTemplate('\n <div class="ag-floating-filter-input" role="presentation" ref="eFloatingFilterInputContainer"></div>\n ')}getDefaultDebounceMs(){return 500}onParentModelChanged(e,t){this.isEventFromFloatingFilter(t)||this.isEventFromDataChange(t)||(this.setLastTypeFromModel(e),this.setEditable(this.canWeEditAfterModelFromParentFilter(e)),this.floatingFilterInputService.setValue(this.getFilterModelFormatter().getModelAsString(e)))}init(e){this.setupFloatingFilterInputService(e),super.init(e),this.setTextInputParams(e)}setupFloatingFilterInputService(e){this.floatingFilterInputService=this.createFloatingFilterInputService(e),this.floatingFilterInputService.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(e){var t;this.params=e;const i=null!=(t=e.browserAutoComplete)&&t;if(this.floatingFilterInputService.setParams({ariaLabel:this.getAriaLabel(e),autoComplete:i}),this.applyActive=au.isUseApplyButton(this.params.filterParams),!this.isReadOnly()){const e=au.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs()),t=Eo(this.syncUpWithParentFilter.bind(this),e);this.floatingFilterInputService.setValueChangedListener(t)}}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const t=this.floatingFilterInputService.getValue();za(this.eFloatingFilterInputContainer),this.destroyBean(this.floatingFilterInputService),this.setupFloatingFilterInputService(e),this.floatingFilterInputService.setValue(t,!0)}syncUpWithParentFilter(e){const t=e.key===El.ENTER;if(this.applyActive&&!t)return;let i=this.floatingFilterInputService.getValue();this.params.filterParams.trimInput&&(i=Gu.trimInput(i),this.floatingFilterInputService.setValue(i,!0)),this.params.parentFilterInstance((e=>{e&&e.onFloatingFilterChanged(this.getLastType()||null,i||null)}))}setEditable(e){this.floatingFilterInputService.setEditable(e)}};Gs([ql("eFloatingFilterInputContainer")],Vu.prototype,"eFloatingFilterInputContainer",2),Gs([Lo],Vu.prototype,"postConstruct",1);var Hu=class extends Pn{constructor(){super(...arguments),this.valueChangedListener=()=>{},this.numberInputActive=!0}setupGui(e){this.eFloatingFilterNumberInput=this.createManagedBean(new Mu),this.eFloatingFilterTextInput=this.createManagedBean(new Fu),this.eFloatingFilterTextInput.setDisabled(!0);const t=this.eFloatingFilterNumberInput.getGui(),i=this.eFloatingFilterTextInput.getGui();e.appendChild(t),e.appendChild(i),this.setupListeners(t,(e=>this.valueChangedListener(e))),this.setupListeners(i,(e=>this.valueChangedListener(e)))}setEditable(e){this.numberInputActive=e,this.eFloatingFilterNumberInput.setDisplayed(this.numberInputActive),this.eFloatingFilterTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(e){this.eFloatingFilterNumberInput.setAutoComplete(e),this.eFloatingFilterTextInput.setAutoComplete(e)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eFloatingFilterNumberInput:this.eFloatingFilterTextInput}setValueChangedListener(e){this.valueChangedListener=e}setupListeners(e,t){this.addManagedListener(e,"input",t),this.addManagedListener(e,"keydown",t)}setParams(e){this.setAriaLabel(e.ariaLabel),void 0!==e.autoComplete&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eFloatingFilterNumberInput.setInputAriaLabel(e),this.eFloatingFilterTextInput.setInputAriaLabel(e)}},Bu=class extends Vu{init(e){var t;super.init(e),this.filterModelFormatter=new Lu(this.localeService,this.optionsFactory,null==(t=e.filterParams)?void 0:t.numberFormatter)}onParamsUpdated(e){this.refresh(e)}refresh(e){xu(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.refresh(e),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return Nu.DEFAULT_FILTER_OPTIONS}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(e){return this.allowedCharPattern=xu(e.filterParams),this.allowedCharPattern?this.createManagedBean(new ku({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new Hu)}},Wu=class extends Vu{init(e){super.init(e),this.filterModelFormatter=new _u(this.localeService,this.optionsFactory)}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return Gu.DEFAULT_FILTER_OPTIONS}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(){return this.createManagedBean(new ku)}},Uu=class e{constructor(e,t=!1){this.destroyFuncs=[],this.touching=!1,this.eventService=new Vo,this.eElement=e,this.preventMouseClick=t;const i=this.onTouchStart.bind(this),s=this.onTouchMove.bind(this),o=this.onTouchEnd.bind(this);this.eElement.addEventListener("touchstart",i,{passive:!0}),this.eElement.addEventListener("touchmove",s,{passive:!0}),this.eElement.addEventListener("touchend",o,{passive:!1}),this.destroyFuncs.push((()=>{this.eElement.removeEventListener("touchstart",i,{passive:!0}),this.eElement.removeEventListener("touchmove",s,{passive:!0}),this.eElement.removeEventListener("touchend",o,{passive:!1})}))}getActiveTouch(e){for(let t=0;t<e.length;t++)if(e[t].identifier===this.touchStart.identifier)return e[t];return null}addEventListener(e,t){this.eventService.addEventListener(e,t)}removeEventListener(e,t){this.eventService.removeEventListener(e,t)}onTouchStart(t){if(this.touching)return;this.touchStart=t.touches[0],this.touching=!0,this.moved=!1;const i=this.touchStart;window.setTimeout((()=>{const s=this.touchStart===i;if(this.touching&&s&&!this.moved){this.moved=!0;const i={type:e.EVENT_LONG_TAP,touchStart:this.touchStart,touchEvent:t};this.eventService.dispatchEvent(i)}}),500)}onTouchMove(e){if(!this.touching)return;const t=this.getActiveTouch(e.touches);t&&!Nl(t,this.touchStart,4)&&(this.moved=!0)}onTouchEnd(t){if(this.touching){if(!this.moved){const t={type:e.EVENT_TAP,touchStart:this.touchStart};this.eventService.dispatchEvent(t),this.checkForDoubleTap()}this.preventMouseClick&&t.cancelable&&t.preventDefault(),this.touching=!1}}checkForDoubleTap(){const t=(new Date).getTime();if(this.lastTapTime&&this.lastTapTime>0)if(t-this.lastTapTime>e.DOUBLE_TAP_MILLIS){const t={type:e.EVENT_DOUBLE_TAP,touchStart:this.touchStart};this.eventService.dispatchEvent(t),this.lastTapTime=null}else this.lastTapTime=t;else this.lastTapTime=t}destroy(){this.destroyFuncs.forEach((e=>e()))}};Uu.EVENT_TAP="tap",Uu.EVENT_DOUBLE_TAP="doubleTap",Uu.EVENT_LONG_TAP="longTap",Uu.DOUBLE_TAP_MILLIS=500;var zu=Uu,$u=class e extends Yl{constructor(t){super(),t||this.setTemplate(e.TEMPLATE)}attachCustomElements(e,t,i,s,o){this.eSortOrder=e,this.eSortAsc=t,this.eSortDesc=i,this.eSortMixed=s,this.eSortNone=o}setupSort(e,t=!1){this.column=e,this.suppressOrder=t,this.setupMultiSortIndicator(),(this.column.isSortable()||this.column.getColDef().showRowGroup)&&(this.addInIcon("sortAscending",this.eSortAsc,e),this.addInIcon("sortDescending",this.eSortDesc,e),this.addInIcon("sortUnSort",this.eSortNone,e),this.addManagedPropertyListener("unSortIcon",(()=>this.updateIcons())),this.addManagedListener(this.eventService,In.EVENT_NEW_COLUMNS_LOADED,(()=>this.updateIcons())),this.addManagedListener(this.eventService,In.EVENT_SORT_CHANGED,(()=>this.onSortChanged())),this.addManagedListener(this.eventService,In.EVENT_COLUMN_ROW_GROUP_CHANGED,(()=>this.onSortChanged())),this.onSortChanged())}addInIcon(e,t,i){if(null==t)return;const s=wl(e,this.gos,i);s&&t.appendChild(s)}onSortChanged(){this.updateIcons(),this.suppressOrder||this.updateSortOrder()}updateIcons(){const e=this.sortController.getDisplaySortForColumn(this.column);if(this.eSortAsc){const t="asc"===e;La(this.eSortAsc,t,{skipAriaHidden:!0})}if(this.eSortDesc){const t="desc"===e;La(this.eSortDesc,t,{skipAriaHidden:!0})}if(this.eSortNone){const t=!this.column.getColDef().unSortIcon&&!this.gos.get("unSortIcon"),i=null==e;La(this.eSortNone,!t&&i,{skipAriaHidden:!0})}}setupMultiSortIndicator(){this.addInIcon("sortUnSort",this.eSortMixed,this.column);const e=this.column.getColDef().showRowGroup;this.gos.isColumnsSortingCoupledToGroup()&&e&&(this.addManagedListener(this.eventService,In.EVENT_SORT_CHANGED,(()=>this.updateMultiSortIndicator())),this.addManagedListener(this.eventService,In.EVENT_COLUMN_ROW_GROUP_CHANGED,(()=>this.updateMultiSortIndicator())),this.updateMultiSortIndicator())}updateMultiSortIndicator(){if(this.eSortMixed){const e="mixed"===this.sortController.getDisplaySortForColumn(this.column);La(this.eSortMixed,e,{skipAriaHidden:!0})}}updateSortOrder(){var e;if(!this.eSortOrder)return;const t=this.sortController.getColumnsWithSortingOrdered(),i=null!=(e=this.sortController.getDisplaySortIndexForColumn(this.column))?e:-1,s=t.some((e=>{var t;return null!=(t=this.sortController.getDisplaySortIndexForColumn(e))&&t})),o=i>=0&&s;La(this.eSortOrder,o,{skipAriaHidden:!0}),i>=0?this.eSortOrder.textContent=(i+1).toString():za(this.eSortOrder)}};$u.TEMPLATE='<span class="ag-sort-indicator-container">\n <span ref="eSortOrder" class="ag-sort-indicator-icon ag-sort-order ag-hidden" aria-hidden="true"></span>\n <span ref="eSortAsc" class="ag-sort-indicator-icon ag-sort-ascending-icon ag-hidden" aria-hidden="true"></span>\n <span ref="eSortDesc" class="ag-sort-indicator-icon ag-sort-descending-icon ag-hidden" aria-hidden="true"></span>\n <span ref="eSortMixed" class="ag-sort-indicator-icon ag-sort-mixed-icon ag-hidden" aria-hidden="true"></span>\n <span ref="eSortNone" class="ag-sort-indicator-icon ag-sort-none-icon ag-hidden" aria-hidden="true"></span>\n </span>',Gs([ql("eSortOrder")],$u.prototype,"eSortOrder",2),Gs([ql("eSortAsc")],$u.prototype,"eSortAsc",2),Gs([ql("eSortDesc")],$u.prototype,"eSortDesc",2),Gs([ql("eSortMixed")],$u.prototype,"eSortMixed",2),Gs([ql("eSortNone")],$u.prototype,"eSortNone",2),Gs([No("columnModel")],$u.prototype,"columnModel",2),Gs([No("sortController")],$u.prototype,"sortController",2);var Ku=$u,ju=class e extends Yl{constructor(){super(...arguments),this.lastMovingChanged=0}destroy(){super.destroy()}refresh(e){const t=this.params;return this.params=e,this.workOutTemplate()==this.currentTemplate&&this.workOutShowMenu()==this.currentShowMenu&&this.workOutSort()==this.currentSort&&this.shouldSuppressMenuHide()==this.currentSuppressMenuHide&&t.enableFilterButton==e.enableFilterButton&&t.enableFilterIcon==e.enableFilterIcon&&(this.setDisplayName(e),!0)}workOutTemplate(){var t;let i=null!=(t=this.params.template)?t:e.TEMPLATE;return i=i&&i.trim?i.trim():i,i}init(e){this.params=e,this.currentTemplate=this.workOutTemplate(),this.setTemplate(this.currentTemplate),this.setupTap(),this.setMenu(),this.setupSort(),this.setupFilterIcon(),this.setupFilterButton(),this.setDisplayName(e)}setDisplayName(e){if(this.currentDisplayName!=e.displayName){this.currentDisplayName=e.displayName;const t=zn(this.currentDisplayName,!0);this.eText&&(this.eText.textContent=t)}}addInIcon(e,t,i){if(null==t)return;const s=wl(e,this.gos,i);s&&t.appendChild(s)}setupTap(){const{gos:e}=this;if(e.get("suppressTouch"))return;const t=new zu(this.getGui(),!0),i=this.shouldSuppressMenuHide(),s=i&&Bs(this.eMenu),o=s?new zu(this.eMenu,!0):t;if(this.params.enableMenu){const e=s?"EVENT_TAP":"EVENT_LONG_TAP",t=e=>this.params.showColumnMenuAfterMouseClick(e.touchStart);this.addManagedListener(o,zu[e],t)}if(this.params.enableSorting){const e=e=>{var t,s;const o=e.touchStart.target;i&&((null==(t=this.eMenu)?void 0:t.contains(o))||(null==(s=this.eFilterButton)?void 0:s.contains(o)))||this.sortController.progressSort(this.params.column,!1,"uiColumnSorted")};this.addManagedListener(t,zu.EVENT_TAP,e)}if(this.params.enableFilterButton){const e=new zu(this.eFilterButton,!0);this.addManagedListener(e,"tap",(()=>this.params.showFilter(this.eFilterButton))),this.addDestroyFunc((()=>e.destroy()))}this.addDestroyFunc((()=>t.destroy())),s&&this.addDestroyFunc((()=>o.destroy()))}workOutShowMenu(){return this.params.enableMenu&&this.menuService.isHeaderMenuButtonEnabled()}shouldSuppressMenuHide(){return this.menuService.isHeaderMenuButtonAlwaysShowEnabled()}setMenu(){if(!this.eMenu)return;if(this.currentShowMenu=this.workOutShowMenu(),!this.currentShowMenu)return $a(this.eMenu),void(this.eMenu=void 0);const e=this.menuService.isLegacyMenuEnabled();this.addInIcon(e?"menu":"menuAlt",this.eMenu,this.params.column),this.eMenu.classList.toggle("ag-header-menu-icon",!e),this.currentSuppressMenuHide=this.shouldSuppressMenuHide(),this.addManagedListener(this.eMenu,"click",(()=>this.params.showColumnMenu(this.eMenu))),this.eMenu.classList.toggle("ag-header-menu-always-show",this.currentSuppressMenuHide)}onMenuKeyboardShortcut(e){var t,i,s,o;const{column:n}=this.params,r=this.menuService.isLegacyMenuEnabled();if(e&&!r){if(this.menuService.isFilterMenuInHeaderEnabled(n))return this.params.showFilter(null!=(i=null!=(t=this.eFilterButton)?t:this.eMenu)?i:this.getGui()),!0}else if(this.params.enableMenu)return this.params.showColumnMenu(null!=(o=null!=(s=this.eMenu)?s:this.eFilterButton)?o:this.getGui()),!0;return!1}workOutSort(){return this.params.enableSorting}setupSort(){if(this.currentSort=this.params.enableSorting,this.eSortIndicator||(this.eSortIndicator=this.context.createBean(new Ku(!0)),this.eSortIndicator.attachCustomElements(this.eSortOrder,this.eSortAsc,this.eSortDesc,this.eSortMixed,this.eSortNone)),this.eSortIndicator.setupSort(this.params.column),!this.currentSort)return;this.addManagedListener(this.params.column,$o.EVENT_MOVING_CHANGED,(()=>{this.lastMovingChanged=(new Date).getTime()})),this.eLabel&&this.addManagedListener(this.eLabel,"click",(e=>{const t=this.params.column.isMoving(),i=(new Date).getTime()-this.lastMovingChanged<50;if(!t&&!i){const t="ctrl"===this.gos.get("multiSortKey")?e.ctrlKey||e.metaKey:e.shiftKey;this.params.progressSort(t)}}));const e=()=>{if(this.addOrRemoveCssClass("ag-header-cell-sorted-asc",this.params.column.isSortAscending()),this.addOrRemoveCssClass("ag-header-cell-sorted-desc",this.params.column.isSortDescending()),this.addOrRemoveCssClass("ag-header-cell-sorted-none",this.params.column.isSortNone()),this.params.column.getColDef().showRowGroup){const e=this.columnModel.getSourceColumnsForGroupColumn(this.params.column),t=!(null==e?void 0:e.every((e=>this.params.column.getSort()==e.getSort())));this.addOrRemoveCssClass("ag-header-cell-sorted-mixed",t)}};this.addManagedListener(this.eventService,In.EVENT_SORT_CHANGED,e),this.addManagedListener(this.eventService,In.EVENT_COLUMN_ROW_GROUP_CHANGED,e)}setupFilterIcon(){this.eFilter&&this.configureFilter(this.params.enableFilterIcon,this.eFilter,this.onFilterChangedIcon.bind(this))}setupFilterButton(){this.eFilterButton&&(this.configureFilter(this.params.enableFilterButton,this.eFilterButton,this.onFilterChangedButton.bind(this))?this.addManagedListener(this.eFilterButton,"click",(()=>this.params.showFilter(this.eFilterButton))):this.eFilterButton=void 0)}configureFilter(e,t,i){if(!e)return $a(t),!1;const{column:s}=this.params;return this.addInIcon("filter",t,s),this.addManagedListener(s,$o.EVENT_FILTER_CHANGED,i),i(),!0}onFilterChangedIcon(){const e=this.params.column.isFilterActive();La(this.eFilter,e,{skipAriaHidden:!0})}onFilterChangedButton(){const e=this.params.column.isFilterActive();this.eFilterButton.classList.toggle("ag-filter-active",e)}getAnchorElementForMenu(e){var t,i,s,o;return e?null!=(i=null!=(t=this.eFilterButton)?t:this.eMenu)?i:this.getGui():null!=(o=null!=(s=this.eMenu)?s:this.eFilterButton)?o:this.getGui()}};ju.TEMPLATE='<div class="ag-cell-label-container" role="presentation">\n <span ref="eMenu" class="ag-header-icon ag-header-cell-menu-button" aria-hidden="true"></span>\n <span ref="eFilterButton" class="ag-header-icon ag-header-cell-filter-button" aria-hidden="true"></span>\n <div ref="eLabel" class="ag-header-cell-label" role="presentation">\n <span ref="eText" class="ag-header-cell-text"></span>\n <span ref="eFilter" class="ag-header-icon ag-header-label-icon ag-filter-icon" aria-hidden="true"></span>\n <ag-sort-indicator ref="eSortIndicator"></ag-sort-indicator>\n </div>\n </div>',Gs([No("sortController")],ju.prototype,"sortController",2),Gs([No("menuService")],ju.prototype,"menuService",2),Gs([No("columnModel")],ju.prototype,"columnModel",2),Gs([ql("eFilter")],ju.prototype,"eFilter",2),Gs([ql("eFilterButton")],ju.prototype,"eFilterButton",2),Gs([ql("eSortIndicator")],ju.prototype,"eSortIndicator",2),Gs([ql("eMenu")],ju.prototype,"eMenu",2),Gs([ql("eLabel")],ju.prototype,"eLabel",2),Gs([ql("eText")],ju.prototype,"eText",2),Gs([ql("eSortOrder")],ju.prototype,"eSortOrder",2),Gs([ql("eSortAsc")],ju.prototype,"eSortAsc",2),Gs([ql("eSortDesc")],ju.prototype,"eSortDesc",2),Gs([ql("eSortMixed")],ju.prototype,"eSortMixed",2),Gs([ql("eSortNone")],ju.prototype,"eSortNone",2);var Yu=ju,qu=class e extends Yl{constructor(){super(e.TEMPLATE)}destroy(){super.destroy()}init(e){this.params=e,this.checkWarnings(),this.setupLabel(),this.addGroupExpandIcon(),this.setupExpandIcons()}checkWarnings(){this.params.template&&co("A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)")}setupExpandIcons(){this.addInIcon("columnGroupOpened","agOpened"),this.addInIcon("columnGroupClosed","agClosed");const e=e=>{if(yn(e))return;const t=!this.params.columnGroup.isExpanded();this.columnModel.setColumnGroupOpened(this.params.columnGroup.getProvidedColumnGroup(),t,"uiColumnExpanded")};this.addTouchAndClickListeners(this.eCloseIcon,e),this.addTouchAndClickListeners(this.eOpenIcon,e);const t=e=>{wn(e)};this.addManagedListener(this.eCloseIcon,"dblclick",t),this.addManagedListener(this.eOpenIcon,"dblclick",t),this.addManagedListener(this.getGui(),"dblclick",e),this.updateIconVisibility();const i=this.params.columnGroup.getProvidedColumnGroup();this.addManagedListener(i,jo.EVENT_EXPANDED_CHANGED,this.updateIconVisibility.bind(this)),this.addManagedListener(i,jo.EVENT_EXPANDABLE_CHANGED,this.updateIconVisibility.bind(this))}addTouchAndClickListeners(e,t){const i=new zu(e,!0);this.addManagedListener(i,zu.EVENT_TAP,t),this.addDestroyFunc((()=>i.destroy())),this.addManagedListener(e,"click",t)}updateIconVisibility(){if(this.params.columnGroup.isExpandable()){const e=this.params.columnGroup.isExpanded();La(this.eOpenIcon,e),La(this.eCloseIcon,!e)}else La(this.eOpenIcon,!1),La(this.eCloseIcon,!1)}addInIcon(e,t){const i=wl(e,this.gos,null);i&&this.getRefElement(t).appendChild(i)}addGroupExpandIcon(){if(!this.params.columnGroup.isExpandable())return La(this.eOpenIcon,!1),void La(this.eCloseIcon,!1)}setupLabel(){var e;const{displayName:t,columnGroup:i}=this.params;if(Bs(t)){const e=zn(t,!0);this.getRefElement("agLabel").textContent=e}this.addOrRemoveCssClass("ag-sticky-label",!(null==(e=i.getColGroupDef())?void 0:e.suppressStickyLabel))}};qu.TEMPLATE='<div class="ag-header-group-cell-label" ref="agContainer" role="presentation">\n <span ref="agLabel" class="ag-header-group-text" role="presentation"></span>\n <span ref="agOpened" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded"></span>\n <span ref="agClosed" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed"></span>\n </div>',Gs([No("columnModel")],qu.prototype,"columnModel",2),Gs([ql("agOpened")],qu.prototype,"eOpenIcon",2),Gs([ql("agClosed")],qu.prototype,"eCloseIcon",2);var Xu=qu,Qu=class extends Yl{isPopup(){return!0}setParentComponent(e){e.addCssClass("ag-has-popup"),super.setParentComponent(e)}destroy(){const e=this.parentComponent;e&&e.isAlive()&&e.getGui().classList.remove("ag-has-popup"),super.destroy()}},Ju=class e extends Qu{constructor(){super(e.TEMPLATE)}init(e){this.params=e,this.focusAfterAttached=e.cellStartedEdit,this.eTextArea.setMaxLength(e.maxLength||200).setCols(e.cols||60).setRows(e.rows||10),Bs(e.value,!0)&&this.eTextArea.setValue(e.value.toString(),!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.activateTabIndex()}onKeyDown(e){const t=e.key;(t===El.LEFT||t===El.UP||t===El.RIGHT||t===El.DOWN||e.shiftKey&&t===El.ENTER)&&e.stopPropagation()}afterGuiAttached(){const e=this.localeService.getLocaleTextFunc();this.eTextArea.setInputAriaLabel(e("ariaInputEditor","Input Editor")),this.focusAfterAttached&&this.eTextArea.getFocusableElement().focus()}getValue(){const e=this.eTextArea.getValue();return Bs(e)||Bs(this.params.value)?this.params.parseValue(e):this.params.value}};Ju.TEMPLATE='<div class="ag-large-text">\n <ag-input-text-area ref="eTextArea" class="ag-large-text-input"></ag-input-text-area>\n </div>',Gs([ql("eTextArea")],Ju.prototype,"eTextArea",2);var Zu=Ju,eh=class extends Qu{constructor(){super('<div class="ag-cell-edit-wrapper">\n <ag-select class="ag-cell-editor" ref="eSelect"></ag-select>\n </div>'),this.startedByEnter=!1}init(e){this.focusAfterAttached=e.cellStartedEdit;const{eSelect:t,valueService:i,gos:s}=this,{values:o,value:n,eventKey:r}=e;if(Ws(o))return void console.warn("AG Grid: no values found for select cellEditor");this.startedByEnter=null!=r&&r===El.ENTER;let a=!1;o.forEach((s=>{const o={value:s},r=i.formatValue(e.column,null,s),l=null!=r;o.text=l?r:s,t.addOption(o),a=a||n===s})),a?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:l,valueListMaxWidth:u,valueListMaxHeight:h}=e;null!=l&&t.setPickerGap(l),null!=h&&t.setPickerMaxHeight(h),null!=u&&t.setPickerMaxWidth(u),"fullRow"!==s.get("editType")&&this.addManagedListener(this.eSelect,gu.EVENT_ITEM_SELECTED,(()=>e.stopEditing()))}afterGuiAttached(){this.focusAfterAttached&&this.eSelect.getFocusableElement().focus(),this.startedByEnter&&setTimeout((()=>{this.isAlive()&&this.eSelect.showPicker()}))}focusIn(){this.eSelect.getFocusableElement().focus()}getValue(){return this.eSelect.getValue()}isPopup(){return!1}};Gs([No("valueService")],eh.prototype,"valueService",2),Gs([ql("eSelect")],eh.prototype,"eSelect",2);var th=class extends Qu{constructor(e){super(`\n <div class="ag-cell-edit-wrapper">\n ${e.getTemplate()}\n </div>`),this.cellEditorInput=e}init(e){this.params=e;const t=this.eInput;let i;if(this.cellEditorInput.init(t,e),e.cellStartedEdit){this.focusAfterAttached=!0;const t=e.eventKey;t===El.BACKSPACE||e.eventKey===El.DELETE?i="":t&&1===t.length?i=t:(i=this.cellEditorInput.getStartValue(),t!==El.F2&&(this.highlightAllOnFocus=!0))}else this.focusAfterAttached=!1,i=this.cellEditorInput.getStartValue();null!=i&&t.setStartValue(i),this.addManagedListener(t.getGui(),"keydown",(e=>{const{key:t}=e;t!==El.PAGE_UP&&t!==El.PAGE_DOWN||e.preventDefault()}))}afterGuiAttached(){var e,t;const i=this.localeService.getLocaleTextFunc(),s=this.eInput;if(s.setInputAriaLabel(i("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;Jr()||s.getFocusableElement().focus();const o=s.getInputElement();this.highlightAllOnFocus?o.select():null==(t=(e=this.cellEditorInput).setCaret)||t.call(e)}focusIn(){const e=this.eInput,t=e.getFocusableElement(),i=e.getInputElement();t.focus(),i.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}};Gs([ql("eInput")],th.prototype,"eInput",2);var ih=class{getTemplate(){return'<ag-input-text-field class="ag-cell-editor" ref="eInput"></ag-input-text-field>'}init(e,t){this.eInput=e,this.params=t,null!=t.maxLength&&e.setMaxLength(t.maxLength)}getValue(){const e=this.eInput.getValue();return Bs(e)||Bs(this.params.value)?this.params.parseValue(e):this.params.value}getStartValue(){return this.params.useFormatter||this.params.column.getColDef().refData?this.params.formatValue(this.params.value):this.params.value}setCaret(){const e=this.eInput.getValue(),t=Bs(e)&&e.length||0;t&&this.eInput.getInputElement().setSelectionRange(t,t)}},sh=class extends th{constructor(){super(new ih)}},oh=class extends Yl{constructor(){super(),this.refreshCount=0;const e=document.createElement("span"),t=document.createElement("span");t.setAttribute("class","ag-value-change-delta");const i=document.createElement("span");i.setAttribute("class","ag-value-change-value"),e.appendChild(t),e.appendChild(i),this.setTemplateFromElement(e)}init(e){this.eValue=this.queryForHtmlElement(".ag-value-change-value"),this.eDelta=this.queryForHtmlElement(".ag-value-change-delta"),this.refresh(e,!0)}showDelta(e,t){const i=Math.abs(t),s=e.formatValue(i),o=Bs(s)?s:i,n=t>=0;this.eDelta.textContent=n?"↑"+o:"↓"+o,this.eDelta.classList.toggle("ag-value-change-delta-up",n),this.eDelta.classList.toggle("ag-value-change-delta-down",!n)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.getFrameworkOverrides().wrapIncoming((()=>{window.setTimeout((()=>{e===this.refreshCount&&this.hideDeltaValue()}),2e3)}))}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),za(this.eDelta)}refresh(e,t=!1){const i=e.value;if(i===this.lastValue)return!1;if(Bs(e.valueFormatted)?this.eValue.textContent=e.valueFormatted:Bs(e.value)?this.eValue.textContent=i:za(this.eValue),this.filterManager.isSuppressFlashingCellsBecauseFiltering())return!1;if("number"==typeof i&&"number"==typeof this.lastValue){const t=i-this.lastValue;this.showDelta(e,t)}return this.lastValue&&this.eValue.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=i,!0}};Gs([No("filterManager")],oh.prototype,"filterManager",2);var nh=class extends Yl{constructor(){super(),this.refreshCount=0;const e=document.createElement("span"),t=document.createElement("span");t.setAttribute("class","ag-value-slide-current"),e.appendChild(t),this.setTemplateFromElement(e),this.eCurrent=this.queryForHtmlElement(".ag-value-slide-current")}init(e){this.refresh(e,!0)}addSlideAnimation(){this.refreshCount++;const e=this.refreshCount;this.ePrevious&&this.getGui().removeChild(this.ePrevious);const t=document.createElement("span");t.setAttribute("class","ag-value-slide-previous ag-value-slide-out"),this.ePrevious=t,this.ePrevious.textContent=this.eCurrent.textContent,this.getGui().insertBefore(this.ePrevious,this.eCurrent),this.getFrameworkOverrides().wrapIncoming((()=>{window.setTimeout((()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")}),50),window.setTimeout((()=>{e===this.refreshCount&&(this.getGui().removeChild(this.ePrevious),this.ePrevious=null)}),3e3)}))}refresh(e,t=!1){let i=e.value;return Ws(i)&&(i=""),i!==this.lastValue&&!this.filterManager.isSuppressFlashingCellsBecauseFiltering()&&(t||this.addSlideAnimation(),this.lastValue=i,Bs(e.valueFormatted)?this.eCurrent.textContent=e.valueFormatted:Bs(e.value)?this.eCurrent.textContent=i:za(this.eCurrent),!0)}};Gs([No("filterManager")],nh.prototype,"filterManager",2);var rh=class e{constructor(t){this.rowIndex=null,this.key=null,this.childrenMapped={},this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=e.OBJECT_ID_SEQUENCE++,this.__autoHeights={},this.alreadyRendered=!1,this.highlighted=null,this.hovered=!1,this.selected=!1,this.beans=t}setData(e){this.setDataCommon(e,!1)}updateData(e){this.setDataCommon(e,!0)}setDataCommon(e,t){const i=this.data;this.data=e,this.beans.valueCache.onDataChanged(),this.updateDataOnDetailNode(),this.checkRowSelectable(),this.resetQuickFilterAggregateText();const s=this.createDataChangedEvent(e,i,t);this.dispatchLocalEvent(s)}updateDataOnDetailNode(){this.detailNode&&(this.detailNode.data=this.data)}createDataChangedEvent(t,i,s){return{type:e.EVENT_DATA_CHANGED,node:this,oldData:i,newData:t,update:s}}createLocalRowEvent(e){return{type:e,node:this}}getRowIndexString(){return"top"===this.rowPinned?"t-"+this.rowIndex:"bottom"===this.rowPinned?"b-"+this.rowIndex:this.rowIndex.toString()}createDaemonNode(){const t=new e(this.beans);return t.id=this.id,t.data=this.data,t.__daemon=!0,t.selected=this.selected,t.level=this.level,t}setDataAndId(e,t){const i=Bs(this.id)?this.createDaemonNode():null,s=this.data;this.data=e,this.updateDataOnDetailNode(),this.setId(t),this.checkRowSelectable(),this.beans.selectionService.syncInRowNode(this,i);const o=this.createDataChangedEvent(e,s,!1);this.dispatchLocalEvent(o)}checkRowSelectable(){const e=this.beans.gos.get("isRowSelectable");this.setRowSelectable(!e||e(this))}setRowSelectable(t,i){if(this.selectable!==t){if(this.selectable=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_SELECTABLE_CHANGED)),i)return;if(this.beans.gos.get("groupSelectsChildren")){const e=this.calculateSelectedFromChildren();return void this.setSelectedParams({newValue:null!=e&&e,source:"selectableChanged"})}this.isSelected()&&!this.selectable&&this.setSelectedParams({newValue:!1,source:"selectableChanged"})}}setId(t){const i=this.beans.gos.getCallback("getRowId");if(i)if(this.data){const t=this.getGroupKeys(!0);this.id=i({data:this.data,parentKeys:t.length>0?t:void 0,level:this.level}),null!==this.id&&"string"==typeof this.id&&this.id.startsWith(e.ID_PREFIX_ROW_GROUP)&&console.error(`AG Grid: Row IDs cannot start with ${e.ID_PREFIX_ROW_GROUP}, this is a reserved prefix for AG Grid's row grouping feature.`),null!==this.id&&"string"!=typeof this.id&&(this.id=""+this.id)}else this.id=void 0;else this.id=t}getGroupKeys(e=!1){const t=[];let i=this;for(e&&(i=i.parent);i&&i.level>=0;)t.push(i.key),i=i.parent;return t.reverse(),t}isPixelInRange(e){return!(!Bs(this.rowTop)||!Bs(this.rowHeight))&&e>=this.rowTop&&e<this.rowTop+this.rowHeight}setFirstChild(t){this.firstChild!==t&&(this.firstChild=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_FIRST_CHILD_CHANGED)))}setLastChild(t){this.lastChild!==t&&(this.lastChild=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_LAST_CHILD_CHANGED)))}setChildIndex(t){this.childIndex!==t&&(this.childIndex=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_CHILD_INDEX_CHANGED)))}setRowTop(t){this.oldRowTop=this.rowTop,this.rowTop!==t&&(this.rowTop=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_TOP_CHANGED)),this.setDisplayed(null!==t))}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setDisplayed(t){this.displayed!==t&&(this.displayed=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_DISPLAYED_CHANGED)))}setDragging(t){this.dragging!==t&&(this.dragging=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_DRAGGING_CHANGED)))}setHighlighted(t){t!==this.highlighted&&(this.highlighted=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_HIGHLIGHT_CHANGED)))}setHovered(e){this.hovered!==e&&(this.hovered=e)}isHovered(){return this.hovered}setAllChildrenCount(t){this.allChildrenCount!==t&&(this.allChildrenCount=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_ALL_CHILDREN_COUNT_CHANGED)))}setMaster(t){this.master!==t&&(this.master&&!t&&(this.expanded=!1),this.master=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_MASTER_CHANGED)))}setGroup(t){this.group!==t&&(this.group&&!t&&(this.expanded=!1),this.group=t,this.updateHasChildren(),this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_GROUP_CHANGED)))}setRowHeight(t,i=!1){this.rowHeight=t,this.rowHeightEstimated=i,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_HEIGHT_CHANGED))}setRowAutoHeight(e,t){this.__autoHeights||(this.__autoHeights={}),this.__autoHeights[t.getId()]=e,null!=e&&(null==this.checkAutoHeightsDebounced&&(this.checkAutoHeightsDebounced=Eo(this.checkAutoHeights.bind(this),1)),this.checkAutoHeightsDebounced())}checkAutoHeights(){let e=!1,t=!0,i=0;const s=this.__autoHeights;if(null==s)return;if(this.beans.columnModel.getAllDisplayedAutoHeightCols().forEach((o=>{let n=s[o.getId()];if(null==n){if(!this.beans.columnModel.isColSpanActive())return void(e=!0);{let t=[];switch(o.getPinned()){case"left":t=this.beans.columnModel.getDisplayedLeftColumnsForRow(this);break;case"right":t=this.beans.columnModel.getDisplayedRightColumnsForRow(this);break;case null:t=this.beans.columnModel.getViewportCenterColumnsForRow(this)}if(t.includes(o))return void(e=!0);n=-1}}else t=!1;n>i&&(i=n)})),e)return;if((t||i<10)&&(i=this.beans.gos.getRowHeightForNode(this).height),i==this.rowHeight)return;this.setRowHeight(i);const o=this.beans.rowModel;o.onRowHeightChangedDebounced&&o.onRowHeightChangedDebounced()}setRowIndex(t){this.rowIndex!==t&&(this.rowIndex=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_ROW_INDEX_CHANGED)))}setUiLevel(t){this.uiLevel!==t&&(this.uiLevel=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_UI_LEVEL_CHANGED)))}setExpanded(t,i,s){if(this.expanded===t)return;this.expanded=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_EXPANDED_CHANGED));const o=Object.assign({},this.createGlobalRowEvent(In.EVENT_ROW_GROUP_OPENED),{expanded:t,event:i||null});this.beans.rowNodeEventThrottle.dispatchExpanded(o,s),this.beans.rowRenderer.refreshCells({rowNodes:[this]})}createGlobalRowEvent(e){return this.beans.gos.addGridCommonParams({type:e,node:this,data:this.data,rowIndex:this.rowIndex,rowPinned:this.rowPinned})}dispatchLocalEvent(e){this.eventService&&this.eventService.dispatchEvent(e)}setDataValue(e,t,i){const s=(()=>{var t;return"string"!=typeof e?e:null!=(t=this.beans.columnModel.getGridColumn(e))?t:this.beans.columnModel.getPrimaryColumn(e)})(),o=this.getValueFromValueService(s);if(this.beans.gos.get("readOnlyEdit"))return this.dispatchEventForSaveValueReadOnly(s,o,t,i),!1;const n=this.beans.valueService.setValue(this,s,t,i);return this.dispatchCellChangedEvent(s,t,o),this.checkRowSelectable(),n}getValueFromValueService(e){var t,i;const s=this.leafGroup&&this.beans.columnModel.isPivotMode(),o=this.group&&this.expanded&&!this.footer&&!s;let n=!1;const r=null!=(t=this.beans.gos.get("groupTotalRow"))?t:this.beans.gos.get("groupIncludeFooter");n="function"!=typeof r?!!r:!!(null!=(i=this.beans.gos.getCallback("groupTotalRow"))?i:this.beans.gos.getCallback("groupIncludeFooter"))({node:this});const a=this.beans.gos.get("groupSuppressBlankHeader"),l=o&&n&&!a;return this.beans.valueService.getValue(e,this,!1,l)}dispatchEventForSaveValueReadOnly(e,t,i,s){const o=this.beans.gos.addGridCommonParams({type:In.EVENT_CELL_EDIT_REQUEST,event:null,rowIndex:this.rowIndex,rowPinned:this.rowPinned,column:e,colDef:e.getColDef(),data:this.data,node:this,oldValue:t,newValue:i,value:i,source:s});this.beans.eventService.dispatchEvent(o)}setGroupValue(e,t){const i=this.beans.columnModel.getGridColumn(e);Ws(this.groupData)&&(this.groupData={});const s=i.getColId(),o=this.groupData[s];o!==t&&(this.groupData[s]=t,this.dispatchCellChangedEvent(i,t,o))}setAggData(e){const t=this.aggData;if(this.aggData=e,this.eventService){const i=e=>{const i=this.aggData?this.aggData[e]:void 0,s=t?t[e]:void 0;if(i===s)return;const o=this.beans.columnModel.lookupGridColumn(e);o&&this.dispatchCellChangedEvent(o,i,s)};for(const e in this.aggData)i(e);for(const t in e)t in this.aggData||i(t)}}updateHasChildren(){let t=this.group&&!this.footer||this.childrenAfterGroup&&this.childrenAfterGroup.length>0;if(this.beans.gos.isRowModelType("serverSide")){const e=this.beans.gos.get("treeData"),i=this.beans.gos.get("isServerSideGroup");t=!this.stub&&!this.footer&&(e?!!i&&i(this.data):!!this.group)}t!==this.__hasChildren&&(this.__hasChildren=!!t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(e.EVENT_HAS_CHILDREN_CHANGED)))}hasChildren(){return null==this.__hasChildren&&this.updateHasChildren(),this.__hasChildren}isEmptyRowGroupNode(){return this.group&&Us(this.childrenAfterGroup)}dispatchCellChangedEvent(t,i,s){const o={type:e.EVENT_CELL_CHANGED,node:this,column:t,newValue:i,oldValue:s};this.dispatchLocalEvent(o)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return!this.footer&&(this.beans.columnModel.isPivotMode()?this.hasChildren()&&!this.leafGroup:this.hasChildren()||!!this.master)}isSelected(){return this.footer?this.sibling.isSelected():this.selected}depthFirstSearch(e){this.childrenAfterGroup&&this.childrenAfterGroup.forEach((t=>t.depthFirstSearch(e))),e(this)}calculateSelectedFromChildren(){var e;let t=!1,i=!1,s=!1;if(!(null==(e=this.childrenAfterGroup)?void 0:e.length))return this.selectable?this.selected:null;for(let e=0;e<this.childrenAfterGroup.length;e++){const o=this.childrenAfterGroup[e];let n=o.isSelected();if(!o.selectable){const e=o.calculateSelectedFromChildren();if(null===e)continue;n=e}switch(n){case!0:t=!0;break;case!1:i=!0;break;default:s=!0}}return s||t&&i?void 0:!!t||!i&&(this.selectable?this.selected:null)}setSelectedInitialValue(e){this.selected=e}selectThisNode(t,i,s="api"){const o=!this.selectable&&t,n=this.selected===t;if(o||n)return!1;this.selected=t,this.eventService&&this.dispatchLocalEvent(this.createLocalRowEvent(e.EVENT_ROW_SELECTED));const r=this.sibling;r&&r.footer&&r.eventService&&r.dispatchLocalEvent(r.createLocalRowEvent(e.EVENT_ROW_SELECTED));const a=_s(Ns({},this.createGlobalRowEvent(In.EVENT_ROW_SELECTED)),{event:i||null,source:s});return this.beans.eventService.dispatchEvent(a),!0}setSelected(e,t=!1,i="api"){"boolean"!=typeof i?this.setSelectedParams({newValue:e,clearSelection:t,rangeSelect:!1,source:i}):console.warn("AG Grid: since version v30, rowNode.setSelected() property `suppressFinishActions` has been removed, please use `gridApi.setNodesSelected()` for bulk actions, and the event `source` property for ignoring events instead.")}setSelectedParams(e){return this.rowPinned?(console.warn("AG Grid: cannot select pinned rows"),0):void 0===this.id?(console.warn("AG Grid: cannot select node until id for node is known"),0):this.beans.selectionService.setNodesSelected(_s(Ns({},e),{nodes:[this.footer?this.sibling:this]}))}isRowPinned(){return"top"===this.rowPinned||"bottom"===this.rowPinned}isParentOfNode(e){let t=this.parent;for(;t;){if(t===e)return!0;t=t.parent}return!1}addEventListener(e,t){var i,s;this.eventService||(this.eventService=new Vo),this.beans.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.eventService.setFrameworkOverrides(this.beans.frameworkOverrides),this.frameworkEventListenerService=new Ho(this.beans.frameworkOverrides));const o=null!=(s=null==(i=this.frameworkEventListenerService)?void 0:i.wrap(t))?s:t;this.eventService.addEventListener(e,o)}removeEventListener(e,t){var i,s;if(!this.eventService)return;const o=null!=(s=null==(i=this.frameworkEventListenerService)?void 0:i.unwrap(t))?s:t;this.eventService.removeEventListener(e,o),this.eventService.noRegisteredListenersExist()&&(this.eventService=null)}onMouseEnter(){this.dispatchLocalEvent(this.createLocalRowEvent(e.EVENT_MOUSE_ENTER))}onMouseLeave(){this.dispatchLocalEvent(this.createLocalRowEvent(e.EVENT_MOUSE_LEAVE))}getFirstChildOfFirstChild(e){let t=this,i=!0,s=!1,o=null;for(;i&&!s;){const n=t.parent;Bs(n)&&t.firstChild?n.rowGroupColumn===e&&(s=!0,o=n):i=!1,t=n}return s?o:null}isFullWidthCell(){if(this.detail)return!0;const e=this.beans.gos.getCallback("isFullWidthRow");return!!e&&e({rowNode:this})}getRoute(){if(null==this.key)return;const e=[];let t=this;for(;null!=t.key;)e.push(t.key),t=t.parent;return e.reverse()}createFooter(){if(this.sibling)return;const t=new Set(["eventService","__objectId","sticky"]),i=new e(this.beans);Object.keys(this).forEach((e=>{t.has(e)||(i[e]=this[e])})),i.footer=!0,i.setRowTop(null),i.setRowIndex(null),i.oldRowTop=null,i.id="rowGroupFooter_"+this.id,i.sibling=this,this.sibling=i}destroyFooter(){this.sibling&&(this.sibling.setRowTop(null),this.sibling.setRowIndex(null),this.sibling=void 0)}};rh.ID_PREFIX_ROW_GROUP="row-group-",rh.ID_PREFIX_TOP_PINNED="t-",rh.ID_PREFIX_BOTTOM_PINNED="b-",rh.OBJECT_ID_SEQUENCE=0,rh.EVENT_ROW_SELECTED="rowSelected",rh.EVENT_DATA_CHANGED="dataChanged",rh.EVENT_CELL_CHANGED="cellChanged",rh.EVENT_ALL_CHILDREN_COUNT_CHANGED="allChildrenCountChanged",rh.EVENT_MASTER_CHANGED="masterChanged",rh.EVENT_GROUP_CHANGED="groupChanged",rh.EVENT_MOUSE_ENTER="mouseEnter",rh.EVENT_MOUSE_LEAVE="mouseLeave",rh.EVENT_HEIGHT_CHANGED="heightChanged",rh.EVENT_TOP_CHANGED="topChanged",rh.EVENT_DISPLAYED_CHANGED="displayedChanged",rh.EVENT_FIRST_CHILD_CHANGED="firstChildChanged",rh.EVENT_LAST_CHILD_CHANGED="lastChildChanged",rh.EVENT_CHILD_INDEX_CHANGED="childIndexChanged",rh.EVENT_ROW_INDEX_CHANGED="rowIndexChanged",rh.EVENT_EXPANDED_CHANGED="expandedChanged",rh.EVENT_HAS_CHILDREN_CHANGED="hasChildrenChanged",rh.EVENT_SELECTABLE_CHANGED="selectableChanged",rh.EVENT_UI_LEVEL_CHANGED="uiLevelChanged",rh.EVENT_HIGHLIGHT_CHANGED="rowHighlightChanged",rh.EVENT_DRAGGING_CHANGED="draggingChanged";var ah=rh,lh=class extends Yl{constructor(){super('\n <div class="ag-selection-checkbox" role="presentation">\n <ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>\n </div>')}postConstruct(){this.eCheckbox.setPassive(!0)}getCheckboxId(){return this.eCheckbox.getInputElement().id}onDataChanged(){this.onSelectionChanged()}onSelectableChanged(){this.showOrHideSelect()}onSelectionChanged(){const e=this.localeService.getLocaleTextFunc(),t=this.rowNode.isSelected(),i=Wr(e,t),[s,o]=this.rowNode.selectable?["ariaRowToggleSelection","Press Space to toggle row selection"]:["ariaRowSelectionDisabled","Row Selection is disabled for this row"],n=e(s,o);this.eCheckbox.setValue(t,!0),this.eCheckbox.setInputAriaLabel(`${n} (${i})`)}onClicked(e,t,i){return this.rowNode.setSelectedParams({newValue:e,rangeSelect:i.shiftKey,groupSelectsFiltered:t,event:i,source:"checkboxSelected"})}init(e){if(this.rowNode=e.rowNode,this.column=e.column,this.overrides=e.overrides,this.onSelectionChanged(),this.addManagedListener(this.eCheckbox.getInputElement(),"dblclick",(e=>{wn(e)})),this.addManagedListener(this.eCheckbox.getInputElement(),"click",(e=>{wn(e);const t=this.gos.get("groupSelectsFiltered"),i=this.eCheckbox.getValue();this.shouldHandleIndeterminateState(i,t)?0===this.onClicked(!0,t,e||{})&&this.onClicked(!1,t,e):i?this.onClicked(!1,t,e):this.onClicked(!0,t,e||{})})),this.addManagedListener(this.rowNode,ah.EVENT_ROW_SELECTED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.rowNode,ah.EVENT_DATA_CHANGED,this.onDataChanged.bind(this)),this.addManagedListener(this.rowNode,ah.EVENT_SELECTABLE_CHANGED,this.onSelectableChanged.bind(this)),this.gos.get("isRowSelectable")||"function"==typeof this.getIsVisible()){const e=this.showOrHideSelect.bind(this);this.addManagedListener(this.eventService,In.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.rowNode,ah.EVENT_DATA_CHANGED,e),this.addManagedListener(this.rowNode,ah.EVENT_CELL_CHANGED,e),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")}shouldHandleIndeterminateState(e,t){return t&&(void 0===this.eCheckbox.getPreviousValue()||void 0===e)&&this.gos.isRowModelType("clientSide")}showOrHideSelect(){var e,t,i;let s=this.rowNode.selectable;const o=this.getIsVisible();if(s)if("function"==typeof o){const t=null==(e=this.overrides)?void 0:e.callbackParams;if(this.column){const e=this.column.createColumnFunctionCallbackParams(this.rowNode);s=o(Ns(Ns({},t),e))}else s=o(_s(Ns({},t),{node:this.rowNode,data:this.rowNode.data}))}else s=null!=o&&o;if(null==(t=this.column)?void 0:t.getColDef().showDisabledCheckboxes)return this.eCheckbox.setDisabled(!s),this.setVisible(!0),void this.setDisplayed(!0);(null==(i=this.overrides)?void 0:i.removeHidden)?this.setDisplayed(s):this.setVisible(s)}getIsVisible(){var e,t;return this.overrides?this.overrides.isVisible:null==(t=null==(e=this.column)?void 0:e.getColDef())?void 0:t.checkboxSelection}};Gs([ql("eCheckbox")],lh.prototype,"eCheckbox",2),Gs([Lo],lh.prototype,"postConstruct",1);var uh=(e=>(e[e.Left=0]="Left",e[e.Right=1]="Right",e))(uh||{}),hh=class extends Pn{constructor(){super(...arguments),this.dragSourceAndParamsList=[],this.dropTargets=[]}init(){this.ePinnedIcon=vl("columnMovePin",this.gos,null),this.eHideIcon=vl("columnMoveHide",this.gos,null),this.eMoveIcon=vl("columnMoveMove",this.gos,null),this.eLeftIcon=vl("columnMoveLeft",this.gos,null),this.eRightIcon=vl("columnMoveRight",this.gos,null),this.eGroupIcon=vl("columnMoveGroup",this.gos,null),this.eAggregateIcon=vl("columnMoveValue",this.gos,null),this.ePivotIcon=vl("columnMovePivot",this.gos,null),this.eDropNotAllowedIcon=vl("dropNotAllowed",this.gos,null)}addDragSource(e,t=!1){const i={eElement:e.eElement,dragStartPixels:e.dragStartPixels,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),includeTouch:t};this.dragSourceAndParamsList.push({params:i,dragSource:e}),this.dragService.addDragSource(i)}removeDragSource(e){const t=this.dragSourceAndParamsList.find((t=>t.dragSource===e));t&&(this.dragService.removeDragSource(t.params),nn(this.dragSourceAndParamsList,t))}clearDragSourceParamsList(){this.dragSourceAndParamsList.forEach((e=>this.dragService.removeDragSource(e.params))),this.dragSourceAndParamsList.length=0,this.dropTargets.length=0}nudge(){this.dragging&&this.onDragging(this.eventLastTime,!0)}onDragStart(e,t){this.dragging=!0,this.dragSource=e,this.eventLastTime=t,this.dragItem=this.dragSource.getDragItem(),this.lastDropTarget=void 0,this.dragSource.onDragStarted&&this.dragSource.onDragStarted(),this.createGhost()}onDragStop(e){if(this.eventLastTime=null,this.dragging=!1,this.dragSource.onDragStopped&&this.dragSource.onDragStopped(),this.lastDropTarget&&this.lastDropTarget.onDragStop){const t=this.createDropTargetEvent(this.lastDropTarget,e,null,null,!1);this.lastDropTarget.onDragStop(t)}this.lastDropTarget=null,this.dragItem=null,this.removeGhost()}onDragging(e,t){var i,s,o,n;const r=this.getHorizontalDirection(e),a=this.getVerticalDirection(e);this.eventLastTime=e,this.positionGhost(e);const l=this.dropTargets.filter((t=>this.isMouseOnDropTarget(e,t))),u=this.findCurrentDropTarget(e,l);if(u!==this.lastDropTarget)this.leaveLastTargetIfExists(e,r,a,t),null!==this.lastDropTarget&&null===u&&(null==(s=(i=this.dragSource).onGridExit)||s.call(i,this.dragItem)),null===this.lastDropTarget&&null!==u&&(null==(n=(o=this.dragSource).onGridEnter)||n.call(o,this.dragItem)),this.enterDragTargetIfExists(u,e,r,a,t),this.lastDropTarget=u;else if(u&&u.onDragging){const i=this.createDropTargetEvent(u,e,r,a,t);u.onDragging(i)}}getAllContainersFromDropTarget(e){const t=e.getSecondaryContainers?e.getSecondaryContainers():null,i=[[e.getContainer()]];return t?i.concat(t):i}allContainersIntersect(e,t){for(const i of t){const t=i.getBoundingClientRect();if(0===t.width||0===t.height)return!1;const s=e.clientX>=t.left&&e.clientX<t.right,o=e.clientY>=t.top&&e.clientY<t.bottom;if(!s||!o)return!1}return!0}isMouseOnDropTarget(e,t){const i=this.getAllContainersFromDropTarget(t);let s=!1;for(const t of i)if(this.allContainersIntersect(e,t)){s=!0;break}return!(t.targetContainsSource&&!t.getContainer().contains(this.dragSource.eElement))&&s&&t.isInterestedIn(this.dragSource.type,this.dragSource.eElement)}findCurrentDropTarget(e,t){const i=t.length;if(0===i)return null;if(1===i)return t[0];const s=this.gos.getRootNode().elementsFromPoint(e.clientX,e.clientY);for(const e of s)for(const i of t)if(-1!==cn(this.getAllContainersFromDropTarget(i)).indexOf(e))return i;return null}enterDragTargetIfExists(e,t,i,s,o){if(e){if(e.onDragEnter){const n=this.createDropTargetEvent(e,t,i,s,o);e.onDragEnter(n)}this.setGhostIcon(e.getIconName?e.getIconName():null)}}leaveLastTargetIfExists(e,t,i,s){if(this.lastDropTarget){if(this.lastDropTarget.onDragLeave){const o=this.createDropTargetEvent(this.lastDropTarget,e,t,i,s);this.lastDropTarget.onDragLeave(o)}this.setGhostIcon(null)}}addDropTarget(e){this.dropTargets.push(e)}removeDropTarget(e){this.dropTargets=this.dropTargets.filter((t=>t.getContainer()!==e.getContainer()))}hasExternalDropZones(){return this.dropTargets.some((e=>e.external))}findExternalZone(e){return this.dropTargets.filter((e=>e.external)).find((t=>t.getContainer()===e.getContainer()))||null}getHorizontalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientX,i=e.clientX;return t===i?null:t>i?0:1}getVerticalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientY,i=e.clientY;return t===i?null:t>i?0:1}createDropTargetEvent(e,t,i,s,o){const n=e.getContainer(),r=n.getBoundingClientRect(),{gridApi:a,columnApi:l,dragItem:u,dragSource:h}=this;return{event:t,x:t.clientX-r.left,y:t.clientY-r.top,vDirection:s,hDirection:i,dragSource:h,fromNudge:o,dragItem:u,api:a,columnApi:l,dropZoneTarget:n}}positionGhost(e){const t=this.eGhost;if(!t)return;const i=t.getBoundingClientRect().height,s=aa()-2,o=la()-2,n=Ha(t.offsetParent),{clientY:r,clientX:a}=e;let l=r-n.top-i/2,u=a-n.left-10;const h=this.gos.getDocument(),d=h.defaultView||window,c=d.pageYOffset||h.documentElement.scrollTop,p=d.pageXOffset||h.documentElement.scrollLeft;s>0&&u+t.clientWidth>s+p&&(u=s+p-t.clientWidth),u<0&&(u=0),o>0&&l+t.clientHeight>o+c&&(l=o+c-t.clientHeight),l<0&&(l=0),t.style.left=`${u}px`,t.style.top=`${l}px`}removeGhost(){this.eGhost&&this.eGhostParent&&this.eGhostParent.removeChild(this.eGhost),this.eGhost=null}createGhost(){this.eGhost=Ya(hh.GHOST_TEMPLATE),this.mouseEventService.stampTopLevelGridCompWithGridInstance(this.eGhost);const{theme:e}=this.environment.getTheme();e&&this.eGhost.classList.add(e),this.eGhostIcon=this.eGhost.querySelector(".ag-dnd-ghost-icon"),this.setGhostIcon(null);const t=this.eGhost.querySelector(".ag-dnd-ghost-label");let i=this.dragSource.dragItemName;mo(i)&&(i=i()),t.innerHTML=zn(i)||"",this.eGhost.style.height="25px",this.eGhost.style.top="20px",this.eGhost.style.left="20px";const s=this.gos.getDocument();let o=null,n=null;try{o=s.fullscreenElement}catch(e){}finally{o||(o=this.gos.getRootNode());n=o.querySelector("body")||(o instanceof ShadowRoot?o:o instanceof Document?null==o?void 0:o.documentElement:o)}this.eGhostParent=n,this.eGhostParent?this.eGhostParent.appendChild(this.eGhost):console.warn("AG Grid: could not find document body, it is needed for dragging columns")}setGhostIcon(e,t=!1){za(this.eGhostIcon);let i=null;switch(e||(e=this.dragSource.getDefaultIconName?this.dragSource.getDefaultIconName():hh.ICON_NOT_ALLOWED),e){case hh.ICON_PINNED:i=this.ePinnedIcon;break;case hh.ICON_MOVE:i=this.eMoveIcon;break;case hh.ICON_LEFT:i=this.eLeftIcon;break;case hh.ICON_RIGHT:i=this.eRightIcon;break;case hh.ICON_GROUP:i=this.eGroupIcon;break;case hh.ICON_AGGREGATE:i=this.eAggregateIcon;break;case hh.ICON_PIVOT:i=this.ePivotIcon;break;case hh.ICON_NOT_ALLOWED:i=this.eDropNotAllowedIcon;break;case hh.ICON_HIDE:i=this.eHideIcon}this.eGhostIcon.classList.toggle("ag-shake-left-to-right",t),i===this.eHideIcon&&this.gos.get("suppressDragLeaveHidesColumns")||i&&this.eGhostIcon.appendChild(i)}};hh.ICON_PINNED="pinned",hh.ICON_MOVE="move",hh.ICON_LEFT="left",hh.ICON_RIGHT="right",hh.ICON_GROUP="group",hh.ICON_AGGREGATE="aggregate",hh.ICON_PIVOT="pivot",hh.ICON_NOT_ALLOWED="notAllowed",hh.ICON_HIDE="hide",hh.GHOST_TEMPLATE='<div class="ag-dnd-ghost ag-unselectable">\n <span class="ag-dnd-ghost-icon ag-shake-left-to-right"></span>\n <div class="ag-dnd-ghost-label"></div>\n </div>',Gs([No("dragService")],hh.prototype,"dragService",2),Gs([No("mouseEventService")],hh.prototype,"mouseEventService",2),Gs([No("columnApi")],hh.prototype,"columnApi",2),Gs([No("gridApi")],hh.prototype,"gridApi",2),Gs([Lo],hh.prototype,"init",1),Gs([xo],hh.prototype,"clearDragSourceParamsList",1),hh=Gs([Io("dragAndDropService")],hh);var dh=class extends Yl{constructor(e,t,i,s,o,n){super(),this.cellValueFn=e,this.rowNode=t,this.column=i,this.customGui=s,this.dragStartPixels=o,this.suppressVisibilityChange=n,this.dragSource=null}isCustomGui(){return null!=this.customGui}postConstruct(){if(this.customGui?this.setDragElement(this.customGui,this.dragStartPixels):(this.setTemplate('<div class="ag-drag-handle ag-row-drag" aria-hidden="true"></div>'),this.getGui().appendChild(wl("rowDrag",this.gos,null)),this.addDragSource()),this.checkCompatibility(),!this.suppressVisibilityChange){const e=this.gos.get("rowDragManaged")?new gh(this,this.beans,this.rowNode,this.column):new ph(this,this.beans,this.rowNode,this.column);this.createManagedBean(e,this.beans.context)}}setDragElement(e,t){this.setTemplateFromElement(e),this.addDragSource(t)}getSelectedNodes(){if(!this.gos.get("rowDragMultiRow"))return[this.rowNode];const e=this.beans.selectionService.getSelectedNodes();return-1!==e.indexOf(this.rowNode)?e:[this.rowNode]}checkCompatibility(){const e=this.gos.get("rowDragManaged");this.gos.get("treeData")&&e&&co("If using row drag with tree data, you cannot have rowDragManaged=true")}getDragItem(){return{rowNode:this.rowNode,rowNodes:this.getSelectedNodes(),columns:this.column?[this.column]:void 0,defaultTextValue:this.cellValueFn()}}getRowDragText(e){if(e){const t=e.getColDef();if(t.rowDragText)return t.rowDragText}return this.gos.get("rowDragText")}addDragSource(e=4){this.dragSource&&this.removeDragSource();const t=this.localeService.getLocaleTextFunc();this.dragSource={type:2,eElement:this.getGui(),dragItemName:()=>{var e;const i=this.getDragItem(),s=(null==(e=i.rowNodes)?void 0:e.length)||1,o=this.getRowDragText(this.column);return o?o(i,s):1===s?this.cellValueFn():`${s} ${t("rowDragRows","rows")}`},getDragItem:()=>this.getDragItem(),dragStartPixels:e,dragSourceDomDataKey:this.gos.getDomDataKey()},this.beans.dragAndDropService.addDragSource(this.dragSource,!0)}removeDragSource(){this.dragSource&&this.beans.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null}};Gs([No("beans")],dh.prototype,"beans",2),Gs([Lo],dh.prototype,"postConstruct",1),Gs([xo],dh.prototype,"removeDragSource",1);var ch=class extends Pn{constructor(e,t,i){super(),this.parent=e,this.rowNode=t,this.column=i}setDisplayedOrVisible(e){const t={skipAriaHidden:!0};if(e)this.parent.setDisplayed(!1,t);else{let e=!0,i=!1;this.column&&(e=this.column.isRowDrag(this.rowNode)||this.parent.isCustomGui(),i=mo(this.column.getColDef().rowDrag)),i?(this.parent.setDisplayed(!0,t),this.parent.setVisible(e,t)):(this.parent.setDisplayed(e,t),this.parent.setVisible(!0,t))}}},ph=class extends ch{constructor(e,t,i,s){super(e,i,s),this.beans=t}postConstruct(){this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.addManagedListener(this.rowNode,ah.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,ah.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,ah.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,In.EVENT_NEW_COLUMNS_LOADED,this.workOutVisibility.bind(this)),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const e=this.gos.get("suppressRowDrag");this.setDisplayedOrVisible(e)}};Gs([Lo],ph.prototype,"postConstruct",1);var gh=class extends ch{constructor(e,t,i,s){super(e,i,s),this.beans=t}postConstruct(){this.addManagedListener(this.beans.eventService,In.EVENT_SORT_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,In.EVENT_FILTER_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,In.EVENT_COLUMN_ROW_GROUP_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,In.EVENT_NEW_COLUMNS_LOADED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,ah.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,ah.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const e=this.beans.ctrlsService.getGridBodyCtrl().getRowDragFeature(),t=e&&e.shouldPreventRowMove(),i=this.gos.get("suppressRowDrag"),s=this.beans.dragAndDropService.hasExternalDropZones(),o=t&&!s||i;this.setDisplayedOrVisible(o)}};Gs([Lo],gh.prototype,"postConstruct",1);var mh=class extends Pn{init(e,t,i,s,o,n,r){var a,l,u,h;this.params=r,this.eGui=t,this.eCheckbox=i,this.eExpanded=s,this.eContracted=o,this.comp=e,this.compClass=n;const{node:d,value:c,colDef:p}=r,g=this.isTopLevelFooter();if(!g){if(this.isEmbeddedRowMismatch())return;if(d.footer&&this.gos.get("groupHideOpenParents")&&(p&&p.showRowGroup)!==(d.rowGroupColumn&&d.rowGroupColumn.getColId()))return}if(this.setupShowingValueForOpenedParent(),this.findDisplayedGroupNode(),!g){const e=r.node.footer&&r.node.rowGroupIndex===this.columnModel.getRowGroupColumns().findIndex((e=>{var t;return e.getColId()===(null==(t=r.colDef)?void 0:t.showRowGroup)})),t="multipleColumns"!=this.gos.get("groupDisplayType")||this.gos.get("treeData")||this.gos.get("showOpenedGroup")&&!r.node.footer&&(!r.node.group||null!=r.node.rowGroupIndex&&r.node.rowGroupIndex>this.columnModel.getRowGroupColumns().findIndex((e=>{var t;return e.getColId()===(null==(t=r.colDef)?void 0:t.showRowGroup)}))),i=!d.group&&((null==(a=this.params.colDef)?void 0:a.field)||(null==(l=this.params.colDef)?void 0:l.valueGetter)),s=this.isExpandable(),o=this.columnModel.isPivotMode()&&d.leafGroup&&(null==(u=d.rowGroupColumn)?void 0:u.getColId())===(null==(h=r.column)?void 0:h.getColDef().showRowGroup);if(!(this.showingValueForOpenedParent||s||i||t||e||o))return}this.addExpandAndContract(),this.addFullWidthRowDraggerIfNeeded(),this.addCheckboxIfNeeded(),this.addValueElement(),this.setupIndent(),this.refreshAriaExpanded()}getCellAriaRole(){var e,t;const i=null==(e=this.params.colDef)?void 0:e.cellAriaRole,s=null==(t=this.params.column)?void 0:t.getColDef().cellAriaRole;return i||s||"gridcell"}destroy(){super.destroy(),this.expandListener=null}refreshAriaExpanded(){const{node:e,eGridCell:t}=this.params;if(this.expandListener&&(this.expandListener=this.expandListener()),!this.isExpandable())return void Pr(t);const i=()=>{Ar(t,!!e.expanded)};this.expandListener=this.addManagedListener(e,ah.EVENT_EXPANDED_CHANGED,i)||null,i()}isTopLevelFooter(){if(!this.gos.getGrandTotalRow())return!1;if(null!=this.params.value||-1!=this.params.node.level)return!1;const e=this.params.colDef;if(null==e)return!0;if(!0===e.showRowGroup)return!0;const t=this.columnModel.getRowGroupColumns();return!t||0===t.length||t[0].getId()===e.showRowGroup}isEmbeddedRowMismatch(){if(!this.params.fullWidth||!this.gos.get("embedFullWidthRows"))return!1;const e="left"===this.params.pinned,t="right"===this.params.pinned,i=!e&&!t;return this.gos.get("enableRtl")?this.columnModel.isPinningLeft()?!t:!i:this.columnModel.isPinningLeft()?!e:!i}findDisplayedGroupNode(){const e=this.params.column,t=this.params.node;if(this.showingValueForOpenedParent){let i=t.parent;for(;null!=i;){if(i.rowGroupColumn&&e.isRowGroupDisplayed(i.rowGroupColumn.getId())){this.displayedGroupNode=i;break}i=i.parent}}Ws(this.displayedGroupNode)&&(this.displayedGroupNode=t)}setupShowingValueForOpenedParent(){const e=this.params.node,t=this.params.column;if(!this.gos.get("groupHideOpenParents"))return void(this.showingValueForOpenedParent=!1);if(!e.groupData)return void(this.showingValueForOpenedParent=!1);if(null!=e.rowGroupColumn){const i=e.rowGroupColumn.getId();if(t.isRowGroupDisplayed(i))return void(this.showingValueForOpenedParent=!1)}const i=null!=e.groupData[t.getId()];this.showingValueForOpenedParent=i}addValueElement(){this.displayedGroupNode.footer?this.addFooterValue():(this.addGroupValue(),this.addChildCount())}addGroupValue(){var e;const t=this.adjustParamsWithDetailsFromRelatedColumn(),i=this.getInnerCompDetails(t),{valueFormatted:s,value:o}=t;let n=s;if(null==n){const t=this.displayedGroupNode.rowGroupColumn&&(null==(e=this.params.column)?void 0:e.isRowGroupDisplayed(this.displayedGroupNode.rowGroupColumn.getId()));n=""===this.displayedGroupNode.key&&this.displayedGroupNode.group&&t?this.localeService.getLocaleTextFunc()("blanks","(Blanks)"):null!=o?o:null}this.comp.setInnerRenderer(i,n)}adjustParamsWithDetailsFromRelatedColumn(){const e=this.displayedGroupNode.rowGroupColumn,t=this.params.column;if(!e)return this.params;if(null!=t&&!t.isRowGroupDisplayed(e.getId()))return this.params;const i=this.params,{value:s,node:o}=this.params,n=this.valueService.formatValue(e,o,s);return _s(Ns({},i),{valueFormatted:n})}addFooterValue(){let e=this.params.totalValueGetter;if(!e){const t=this.params.footerValueGetter;t&&(e=t,co("As of v31.3, footerValueGetter is deprecated. Use `totalValueGetter` instead."))}let t="";if(e){const i=to(this.params);i.value=this.params.value,"function"==typeof e?t=e(i):"string"==typeof e?t=this.expressionService.evaluate(e,i):console.warn("AG Grid: footerValueGetter should be either a function or a string (expression)")}else t=this.localeService.getLocaleTextFunc()("footerTotal","Total")+" "+(null!=this.params.value?this.params.value:"");const i=this.getInnerCompDetails(this.params);this.comp.setInnerRenderer(i,t)}getInnerCompDetails(e){if(e.fullWidth)return this.userComponentFactory.getFullWidthGroupRowInnerCellRenderer(this.gos.get("groupRowRendererParams"),e);const t=this.userComponentFactory.getInnerRendererDetails(e,e),i=e=>e&&e.componentClass==this.compClass;if(t&&!i(t))return t;const s=this.displayedGroupNode.rowGroupColumn,o=s?s.getColDef():void 0;if(!o)return;const n=this.userComponentFactory.getCellRendererDetails(o,e);return n&&!i(n)?n:i(n)&&o.cellRendererParams&&o.cellRendererParams.innerRenderer?this.userComponentFactory.getInnerRendererDetails(o.cellRendererParams,e):void 0}addChildCount(){this.params.suppressCount||(this.addManagedListener(this.displayedGroupNode,ah.EVENT_ALL_CHILDREN_COUNT_CHANGED,this.updateChildCount.bind(this)),this.updateChildCount())}updateChildCount(){const e=this.displayedGroupNode.allChildrenCount,t=this.isShowRowGroupForThisRow()&&null!=e&&e>=0?`(${e})`:"";this.comp.setChildCount(t)}isShowRowGroupForThisRow(){if(this.gos.get("treeData"))return!0;const e=this.displayedGroupNode.rowGroupColumn;if(!e)return!1;const t=this.params.column;return null==t||t.isRowGroupDisplayed(e.getId())}addExpandAndContract(){var e;const t=this.params,i=wl("groupExpanded",this.gos,null),s=wl("groupContracted",this.gos,null);i&&this.eExpanded.appendChild(i),s&&this.eContracted.appendChild(s);const o=t.eGridCell;(null==(e=this.params.column)?void 0:e.isCellEditable(t.node))&&this.gos.get("enableGroupEdit")||!this.isExpandable()||t.suppressDoubleClickExpand||this.addManagedListener(o,"dblclick",this.onCellDblClicked.bind(this)),this.addManagedListener(this.eExpanded,"click",this.onExpandClicked.bind(this)),this.addManagedListener(this.eContracted,"click",this.onExpandClicked.bind(this)),this.addManagedListener(o,"keydown",this.onKeyDown.bind(this)),this.addManagedListener(t.node,ah.EVENT_EXPANDED_CHANGED,this.showExpandAndContractIcons.bind(this)),this.showExpandAndContractIcons();const n=this.onRowNodeIsExpandableChanged.bind(this);this.addManagedListener(this.displayedGroupNode,ah.EVENT_ALL_CHILDREN_COUNT_CHANGED,n),this.addManagedListener(this.displayedGroupNode,ah.EVENT_MASTER_CHANGED,n),this.addManagedListener(this.displayedGroupNode,ah.EVENT_GROUP_CHANGED,n),this.addManagedListener(this.displayedGroupNode,ah.EVENT_HAS_CHILDREN_CHANGED,n)}onExpandClicked(e){yn(e)||(wn(e),this.onExpandOrContract(e))}onExpandOrContract(e){const t=this.displayedGroupNode,i=!t.expanded;!i&&t.sticky&&this.scrollToStickyNode(t),t.setExpanded(i,e)}scrollToStickyNode(e){this.ctrlsService.getGridBodyCtrl().getScrollFeature().setVerticalScrollPosition(e.rowTop-e.stickyRowTop)}isExpandable(){if(this.showingValueForOpenedParent)return!0;const e=this.displayedGroupNode,t=this.columnModel.isPivotMode()&&e.leafGroup;if(!e.isExpandable()||e.footer||t)return!1;const i=this.params.column;return null==i||"string"!=typeof i.getColDef().showRowGroup||this.isShowRowGroupForThisRow()}showExpandAndContractIcons(){const{params:e,displayedGroupNode:t,columnModel:i}=this,{node:s}=e,o=this.isExpandable();if(o){const e=!!this.showingValueForOpenedParent||s.expanded;this.comp.setExpandedDisplayed(e),this.comp.setContractedDisplayed(!e)}else this.comp.setExpandedDisplayed(!1),this.comp.setContractedDisplayed(!1);const n=i.isPivotMode(),r=n&&t.leafGroup,a=o&&!r,l=s.footer&&-1===s.level;this.comp.addOrRemoveCssClass("ag-cell-expandable",a),this.comp.addOrRemoveCssClass("ag-row-group",a),n?this.comp.addOrRemoveCssClass("ag-pivot-leaf-group",r):l||this.comp.addOrRemoveCssClass("ag-row-group-leaf-indent",!a)}onRowNodeIsExpandableChanged(){this.showExpandAndContractIcons(),this.setIndent(),this.refreshAriaExpanded()}setupIndent(){const e=this.params.node;this.params.suppressPadding||(this.addManagedListener(e,ah.EVENT_UI_LEVEL_CHANGED,this.setIndent.bind(this)),this.setIndent())}setIndent(){if(this.gos.get("groupHideOpenParents"))return;const e=this.params,t=e.node,i=!!e.colDef,s=this.gos.get("treeData"),o=!i||s||!0===e.colDef.showRowGroup?t.uiLevel:0;this.indentClass&&this.comp.addOrRemoveCssClass(this.indentClass,!1),this.indentClass="ag-row-group-indent-"+o,this.comp.addOrRemoveCssClass(this.indentClass,!0)}addFullWidthRowDraggerIfNeeded(){if(!this.params.fullWidth||!this.params.rowDrag)return;const e=new dh((()=>this.params.value),this.params.node);this.createManagedBean(e,this.context),this.eGui.insertAdjacentElement("afterbegin",e.getGui())}isUserWantsSelected(){const e=this.params.checkbox;return"function"==typeof e||!0===e}addCheckboxIfNeeded(){const e=this.displayedGroupNode,t=this.isUserWantsSelected()&&!e.footer&&!e.rowPinned&&!e.detail;if(t){const e=new lh;this.getContext().createBean(e),e.init({rowNode:this.params.node,column:this.params.column,overrides:{isVisible:this.params.checkbox,callbackParams:this.params,removeHidden:!0}}),this.eCheckbox.appendChild(e.getGui()),this.addDestroyFunc((()=>this.getContext().destroyBean(e)))}this.comp.setCheckboxVisible(t)}onKeyDown(e){e.key!==El.ENTER||this.params.suppressEnterExpand||this.params.column&&this.params.column.isCellEditable(this.params.node)||this.onExpandOrContract(e)}onCellDblClicked(e){yn(e)||bn(this.eExpanded,e)||bn(this.eContracted,e)||this.onExpandOrContract(e)}};Gs([No("expressionService")],mh.prototype,"expressionService",2),Gs([No("valueService")],mh.prototype,"valueService",2),Gs([No("columnModel")],mh.prototype,"columnModel",2),Gs([No("userComponentFactory")],mh.prototype,"userComponentFactory",2),Gs([No("ctrlsService")],mh.prototype,"ctrlsService",2);var fh=class e extends Yl{constructor(){super(e.TEMPLATE)}init(e){const t={setInnerRenderer:(e,t)=>this.setRenderDetails(e,t),setChildCount:e=>this.eChildCount.textContent=e,addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setContractedDisplayed:e=>La(this.eContracted,e),setExpandedDisplayed:e=>La(this.eExpanded,e),setCheckboxVisible:e=>this.eCheckbox.classList.toggle("ag-invisible",!e)},i=this.createManagedBean(new mh),s=!e.colDef,o=this.getGui();i.init(t,o,this.eCheckbox,this.eExpanded,this.eContracted,this.constructor,e),s&&cr(o,i.getCellAriaRole())}setRenderDetails(e,t){if(e){const t=e.newAgStackInstance();if(!t)return;t.then((e=>{if(!e)return;const t=()=>this.context.destroyBean(e);this.isAlive()?(this.eValue.appendChild(e.getGui()),this.addDestroyFunc(t)):t()}))}else this.eValue.innerText=t}destroy(){this.getContext().destroyBean(this.innerCellRenderer),super.destroy()}refresh(){return!1}};fh.TEMPLATE='<span class="ag-cell-wrapper">\n <span class="ag-group-expanded" ref="eExpanded"></span>\n <span class="ag-group-contracted" ref="eContracted"></span>\n <span class="ag-group-checkbox ag-invisible" ref="eCheckbox"></span>\n <span class="ag-group-value" ref="eValue"></span>\n <span class="ag-group-child-count" ref="eChildCount"></span>\n </span>',Gs([ql("eExpanded")],fh.prototype,"eExpanded",2),Gs([ql("eContracted")],fh.prototype,"eContracted",2),Gs([ql("eCheckbox")],fh.prototype,"eCheckbox",2),Gs([ql("eValue")],fh.prototype,"eValue",2),Gs([ql("eChildCount")],fh.prototype,"eChildCount",2);var Ch=fh,vh=class e extends Yl{constructor(){super(e.TEMPLATE)}init(e){e.node.failedLoad?this.setupFailed():this.setupLoading()}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=e("loadingError","ERR")}setupLoading(){const e=wl("groupLoading",this.gos,null);e&&this.eLoadingIcon.appendChild(e);const t=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=t("loadingOoo","Loading")}refresh(e){return!1}destroy(){super.destroy()}};vh.TEMPLATE='<div class="ag-loading">\n <span class="ag-loading-icon" ref="eLoadingIcon"></span>\n <span class="ag-loading-text" ref="eLoadingText"></span>\n </div>',Gs([ql("eLoadingIcon")],vh.prototype,"eLoadingIcon",2),Gs([ql("eLoadingText")],vh.prototype,"eLoadingText",2);var wh=vh,yh=class e extends Yl{constructor(){super(e.TEMPLATE)}init(e){const t=`ag-cell-skeleton-renderer-${this.getCompId()}`;this.getGui().setAttribute("id",t),this.addDestroyFunc((()=>vr(e.eParentOfValue))),vr(e.eParentOfValue,t),e.node.failedLoad?this.setupFailed():this.setupLoading()}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.getGui().innerText=e("loadingError","ERR");const t=e("ariaSkeletonCellLoadingFailed","Row failed to load");Cr(this.getGui(),t)}setupLoading(){const e=this.gos.getDocument().createElement("div");e.classList.add("ag-skeleton-effect"),this.getGui().appendChild(e);const t=this.localeService.getLocaleTextFunc()("ariaSkeletonCellLoading","Row data is loading");Cr(this.getGui(),t)}refresh(e){return!1}destroy(){super.destroy()}};yh.TEMPLATE='<div class="ag-skeleton-container"></div>';var Eh=yh,Sh=class e extends Yl{constructor(){super()}destroy(){super.destroy()}init(t){const i=this.gos.get("overlayLoadingTemplate");if(this.setTemplate(null!=i?i:e.DEFAULT_LOADING_OVERLAY_TEMPLATE),!i){const e=this.localeService.getLocaleTextFunc();setTimeout((()=>{this.getGui().textContent=e("loadingOoo","Loading...")}))}}};Sh.DEFAULT_LOADING_OVERLAY_TEMPLATE='<span aria-live="polite" aria-atomic="true" class="ag-overlay-loading-center"></span>';var bh=Sh,Rh=class e extends Yl{constructor(){super()}destroy(){super.destroy()}init(t){const i=this.gos.get("overlayNoRowsTemplate");if(this.setTemplate(null!=i?i:e.DEFAULT_NO_ROWS_TEMPLATE),!i){const e=this.localeService.getLocaleTextFunc();setTimeout((()=>{this.getGui().textContent=e("noRowsToShow","No Rows To Show")}))}}};Rh.DEFAULT_NO_ROWS_TEMPLATE='<span class="ag-overlay-no-rows-center"></span>';var Dh=Rh,Th=class extends Qu{constructor(){super('<div class="ag-tooltip"></div>')}init(e){const{value:t}=e;this.getGui().textContent=zn(t,!0)}},Ah=class{getTemplate(){return'<ag-input-number-field class="ag-cell-editor" ref="eInput"></ag-input-number-field>'}init(e,t){this.eInput=e,this.params=t,null!=t.max&&e.setMax(t.max),null!=t.min&&e.setMin(t.min),null!=t.precision&&e.setPrecision(t.precision),null!=t.step&&e.setStep(t.step);const i=e.getInputElement();t.preventStepping?e.addManagedListener(i,"keydown",this.preventStepping):t.showStepperButtons&&i.classList.add("ag-number-field-input-stepper")}preventStepping(e){e.key!==El.UP&&e.key!==El.DOWN||e.preventDefault()}getValue(){const e=this.eInput.getValue();if(!Bs(e)&&!Bs(this.params.value))return this.params.value;let t=this.params.parseValue(e);if(null==t)return t;if("string"==typeof t){if(""===t)return null;t=Number(t)}return isNaN(t)?null:t}getStartValue(){return this.params.value}},Ph=class extends th{constructor(){super(new Ah)}},Fh=class{getTemplate(){return'<ag-input-date-field class="ag-cell-editor" ref="eInput"></ag-input-date-field>'}init(e,t){this.eInput=e,this.params=t,null!=t.min&&e.setMin(t.min),null!=t.max&&e.setMax(t.max),null!=t.step&&e.setStep(t.step)}getValue(){const e=this.eInput.getDate();return Bs(e)||Bs(this.params.value)?null!=e?e:null:this.params.value}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return Ea(e,!1)}},Mh=class extends th{constructor(){super(new Fh)}},Lh=class{constructor(e){this.getDataTypeService=e}getTemplate(){return'<ag-input-date-field class="ag-cell-editor" ref="eInput"></ag-input-date-field>'}init(e,t){this.eInput=e,this.params=t,null!=t.min&&e.setMin(t.min),null!=t.max&&e.setMax(t.max),null!=t.step&&e.setStep(t.step)}getValue(){const e=this.formatDate(this.eInput.getDate());return Bs(e)||Bs(this.params.value)?this.params.parseValue(null!=e?e:""):this.params.value}getStartValue(){var e,t;return Ea(null!=(t=this.parseDate(null!=(e=this.params.value)?e:void 0))?t:null,!1)}parseDate(e){return this.getDataTypeService().getDateParserFunction(this.params.column)(e)}formatDate(e){return this.getDataTypeService().getDateFormatterFunction(this.params.column)(e)}},xh=class extends th{constructor(){super(new Lh((()=>this.dataTypeService)))}};Gs([No("dataTypeService")],xh.prototype,"dataTypeService",2);var Ih=class e extends Yl{constructor(){super(e.TEMPLATE)}init(e){this.params=e,this.updateCheckbox(e);const t=this.eCheckbox.getInputElement();t.setAttribute("tabindex","-1"),yr(t,"polite"),this.addManagedListener(t,"click",(e=>{if(wn(e),this.eCheckbox.isDisabled())return;const t=this.eCheckbox.getValue();this.onCheckboxChanged(t)})),this.addManagedListener(t,"dblclick",(e=>{wn(e)})),this.addManagedListener(this.params.eGridCell,"keydown",(e=>{if(e.key===El.SPACE&&!this.eCheckbox.isDisabled()){this.params.eGridCell===this.gos.getActiveDomElement()&&this.eCheckbox.toggle();const t=this.eCheckbox.getValue();this.onCheckboxChanged(t),e.preventDefault()}}))}refresh(e){return this.params=e,this.updateCheckbox(e),!0}updateCheckbox(e){var t,i,s;let o,n=!0;if(e.node.group&&e.column){const i=e.column.getColId();i.startsWith(Gn)?o=null==e.value||""===e.value?void 0:"true"===e.value:e.node.aggData&&void 0!==e.node.aggData[i]?o=null!=(t=e.value)?t:void 0:n=!1}else o=null!=(i=e.value)?i:void 0;if(!n)return void this.eCheckbox.setDisplayed(!1);this.eCheckbox.setValue(o);const r=null!=e.disabled?e.disabled:!(null==(s=e.column)?void 0:s.isCellEditable(e.node));this.eCheckbox.setDisabled(r);const a=this.localeService.getLocaleTextFunc(),l=Wr(a,o),u=r?l:`${a("ariaToggleCellValue","Press SPACE to toggle cell value")} (${l})`;this.eCheckbox.setInputAriaLabel(u)}onCheckboxChanged(e){const{column:t,node:i,rowIndex:s,value:o}=this.params,n={type:In.EVENT_CELL_EDITING_STARTED,column:t,colDef:null==t?void 0:t.getColDef(),data:i.data,node:i,rowIndex:s,rowPinned:i.rowPinned,value:o};this.eventService.dispatchEvent(n);const r=this.params.node.setDataValue(this.params.column,e,"edit"),a={type:In.EVENT_CELL_EDITING_STOPPED,column:t,colDef:null==t?void 0:t.getColDef(),data:i.data,node:i,rowIndex:s,rowPinned:i.rowPinned,value:o,oldValue:o,newValue:e,valueChanged:r};this.eventService.dispatchEvent(a)}};Ih.TEMPLATE='\n <div class="ag-cell-wrapper ag-checkbox-cell" role="presentation">\n <ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>\n </div>',Gs([ql("eCheckbox")],Ih.prototype,"eCheckbox",2);var Nh=Ih,_h=class extends Qu{constructor(){super('\n <div class="ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit">\n <ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>\n </div>')}init(e){var t;this.params=e;const i=null!=(t=e.value)?t:void 0;this.eCheckbox.setValue(i),this.eCheckbox.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(i),this.addManagedListener(this.eCheckbox,In.EVENT_FIELD_VALUE_CHANGED,(e=>this.setAriaLabel(e.selected)))}getValue(){return this.eCheckbox.getValue()}focusIn(){this.eCheckbox.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.localeService.getLocaleTextFunc(),i=Wr(t,e),s=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eCheckbox.setInputAriaLabel(`${s} (${i})`)}};Gs([ql("eCheckbox")],_h.prototype,"eCheckbox",2);var Oh=class extends Yl{constructor(){super(),this.setTemplate("<div></div>")}init(e){var t;this.params=e,this.cssClassPrefix=null!=(t=this.params.cssClassPrefix)?t:"ag-menu-option",this.addIcon(),this.addName(),this.addShortcut(),this.addSubMenu()}configureDefaults(){return!0}addIcon(){if(this.params.isCompact)return;const e=Ya(`<span ref="eIcon" class="${this.getClassName("part")} ${this.getClassName("icon")}" role="presentation"></span>`);this.params.checked?e.appendChild(wl("check",this.gos)):this.params.icon&&(rl(this.params.icon)?e.appendChild(this.params.icon):"string"==typeof this.params.icon?e.innerHTML=this.params.icon:console.warn("AG Grid: menu item icon must be DOM node or string")),this.getGui().appendChild(e)}addName(){const e=Ya(`<span ref="eName" class="${this.getClassName("part")} ${this.getClassName("text")}">${this.params.name||""}</span>`);this.getGui().appendChild(e)}addShortcut(){if(this.params.isCompact)return;const e=Ya(`<span ref="eShortcut" class="${this.getClassName("part")} ${this.getClassName("shortcut")}">${this.params.shortcut||""}</span>`);this.getGui().appendChild(e)}addSubMenu(){const e=Ya(`<span ref="ePopupPointer" class="${this.getClassName("part")} ${this.getClassName("popup-pointer")}"></span>`),t=this.getGui();if(this.params.subMenu){const i=this.gos.get("enableRtl")?"smallLeft":"smallRight";Ar(t,!1),e.appendChild(wl(i,this.gos))}t.appendChild(e)}getClassName(e){return`${this.cssClassPrefix}-${e}`}destroy(){super.destroy()}},Gh=class extends Pn{constructor(){super(...arguments),this.agGridDefaults={agDateInput:Pu,agColumnHeader:Yu,agColumnGroupHeader:Xu,agSortIndicator:Ku,agTextColumnFloatingFilter:Wu,agNumberColumnFloatingFilter:Bu,agDateColumnFloatingFilter:Au,agReadOnlyFloatingFilter:Ql,agAnimateShowChangeCellRenderer:oh,agAnimateSlideCellRenderer:nh,agGroupCellRenderer:Ch,agGroupRowRenderer:Ch,agLoadingCellRenderer:wh,agSkeletonCellRenderer:Eh,agCheckboxCellRenderer:Nh,agCellEditor:sh,agTextCellEditor:sh,agNumberCellEditor:Ph,agDateCellEditor:Mh,agDateStringCellEditor:xh,agSelectCellEditor:eh,agLargeTextCellEditor:Zu,agCheckboxCellEditor:_h,agTextColumnFilter:Gu,agNumberColumnFilter:Nu,agDateColumnFilter:Du,agLoadingOverlay:bh,agNoRowsOverlay:Dh,agTooltipComponent:Th,agMenuItem:Oh},this.enterpriseAgDefaultCompsModule={agSetColumnFilter:"@ag-grid-enterprise/set-filter",agSetColumnFloatingFilter:"@ag-grid-enterprise/set-filter",agMultiColumnFilter:"@ag-grid-enterprise/multi-filter",agMultiColumnFloatingFilter:"@ag-grid-enterprise/multi-filter",agGroupColumnFilter:"@ag-grid-enterprise/row-grouping",agGroupColumnFloatingFilter:"@ag-grid-enterprise/row-grouping",agRichSelect:"@ag-grid-enterprise/rich-select",agRichSelectCellEditor:"@ag-grid-enterprise/rich-select",agDetailCellRenderer:"@ag-grid-enterprise/master-detail",agSparklineCellRenderer:"@ag-grid-enterprise/sparklines"},this.jsComps={}}init(){const e=this.gos.get("components");null!=e&&eo(e,((e,t)=>this.registerJsComponent(e,t)))}registerDefaultComponent(e,t){this.agGridDefaults[e]?console.error("Trying to overwrite a default component. You should call registerComponent"):this.agGridDefaults[e]=t}registerJsComponent(e,t){this.jsComps[e]=t}retrieve(e,t){const i=(e,t)=>({componentFromFramework:t,component:e}),s=this.getFrameworkOverrides().frameworkComponent(t,this.gos.get("components"));if(null!=s)return i(s,!0);const o=this.jsComps[t];if(o)return i(o,this.getFrameworkOverrides().isFrameworkComponent(o));const n=this.agGridDefaults[t];if(n)return i(n,!1);const r=this.enterpriseAgDefaultCompsModule[t];return r?Po.__assertRegistered(r,`AG Grid '${e}' component: ${t}`,this.context.getGridId()):ho((()=>{this.warnAboutMissingComponent(e,t)}),"MissingComp"+t),null}warnAboutMissingComponent(e,t){const i=gl(t,[...Object.keys(this.agGridDefaults).filter((e=>!["agCellEditor","agGroupRowRenderer","agSortIndicator"].includes(e))),...Object.keys(this.jsComps)],!0,.8).values;console.warn(`AG Grid: Could not find '${t}' component. It was configured as "${e}: '${t}'" but it wasn't found in the list of registered components.`),i.length>0&&console.warn(` Did you mean: [${i.slice(0,3)}]?`),console.warn(`If using a custom component check it has been registered as described in: ${this.getFrameworkOverrides().getDocLink("components/")}`)}};Gs([Lo],Gh.prototype,"init",1),Gh=Gs([Io("userComponentRegistry")],Gh);var kh={propertyName:"dateComponent",cellRenderer:!1},Vh={propertyName:"headerComponent",cellRenderer:!1},Hh={propertyName:"headerGroupComponent",cellRenderer:!1},Bh={propertyName:"cellRenderer",cellRenderer:!0},Wh={propertyName:"loadingCellRenderer",cellRenderer:!0},Uh={propertyName:"cellEditor",cellRenderer:!1},zh={propertyName:"innerRenderer",cellRenderer:!0},$h={propertyName:"loadingOverlayComponent",cellRenderer:!1},Kh={propertyName:"noRowsOverlayComponent",cellRenderer:!1},jh={propertyName:"tooltipComponent",cellRenderer:!1},Yh={propertyName:"filter",cellRenderer:!1},qh={propertyName:"floatingFilterComponent",cellRenderer:!1},Xh={propertyName:"toolPanel",cellRenderer:!1},Qh={propertyName:"statusPanel",cellRenderer:!1},Jh={propertyName:"fullWidthCellRenderer",cellRenderer:!0},Zh={propertyName:"loadingCellRenderer",cellRenderer:!0},ed={propertyName:"groupRowRenderer",cellRenderer:!0},td={propertyName:"detailCellRenderer",cellRenderer:!0},id={propertyName:"menuItem",cellRenderer:!1},sd=class{static getFloatingFilterType(e){return this.filterToFloatingFilterMapping[e]}};sd.filterToFloatingFilterMapping={set:"agSetColumnFloatingFilter",agSetColumnFilter:"agSetColumnFloatingFilter",multi:"agMultiColumnFloatingFilter",agMultiColumnFilter:"agMultiColumnFloatingFilter",group:"agGroupColumnFloatingFilter",agGroupColumnFilter:"agGroupColumnFloatingFilter",number:"agNumberColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",date:"agDateColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",text:"agTextColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"};var od=class extends Pn{getHeaderCompDetails(e,t){return this.getCompDetails(e,Vh,"agColumnHeader",t)}getHeaderGroupCompDetails(e){const t=e.columnGroup.getColGroupDef();return this.getCompDetails(t,Hh,"agColumnGroupHeader",e)}getFullWidthCellRendererDetails(e){return this.getCompDetails(this.gridOptions,Jh,null,e,!0)}getFullWidthLoadingCellRendererDetails(e){return this.getCompDetails(this.gridOptions,Zh,"agLoadingCellRenderer",e,!0)}getFullWidthGroupCellRendererDetails(e){return this.getCompDetails(this.gridOptions,ed,"agGroupRowRenderer",e,!0)}getFullWidthDetailCellRendererDetails(e){return this.getCompDetails(this.gridOptions,td,"agDetailCellRenderer",e,!0)}getInnerRendererDetails(e,t){return this.getCompDetails(e,zh,null,t)}getFullWidthGroupRowInnerCellRenderer(e,t){return this.getCompDetails(e,zh,null,t)}getCellRendererDetails(e,t){return this.getCompDetails(e,Bh,null,t)}getLoadingCellRendererDetails(e,t){return this.getCompDetails(e,Wh,"agSkeletonCellRenderer",t,!0)}getCellEditorDetails(e,t){return this.getCompDetails(e,Uh,"agCellEditor",t,!0)}getFilterDetails(e,t,i){return this.getCompDetails(e,Yh,i,t,!0)}getDateCompDetails(e){return this.getCompDetails(this.gridOptions,kh,"agDateInput",e,!0)}getLoadingOverlayCompDetails(e){return this.getCompDetails(this.gridOptions,$h,"agLoadingOverlay",e,!0)}getNoRowsOverlayCompDetails(e){return this.getCompDetails(this.gridOptions,Kh,"agNoRowsOverlay",e,!0)}getTooltipCompDetails(e){return this.getCompDetails(e.colDef,jh,"agTooltipComponent",e,!0)}getSetFilterCellRendererDetails(e,t){return this.getCompDetails(e,Bh,null,t)}getFloatingFilterCompDetails(e,t,i){return this.getCompDetails(e,qh,i,t)}getToolPanelCompDetails(e,t){return this.getCompDetails(e,Xh,null,t,!0)}getStatusPanelCompDetails(e,t){return this.getCompDetails(e,Qh,null,t,!0)}getMenuItemCompDetails(e,t){return this.getCompDetails(e,id,"agMenuItem",t,!0)}getCompDetails(e,t,i,s,o=!1){const{propertyName:n,cellRenderer:r}=t;let{compName:a,jsComp:l,fwComp:u,paramsFromSelector:h,popupFromSelector:d,popupPositionFromSelector:c}=this.getCompKeys(e,t,s);const p=e=>{const t=this.userComponentRegistry.retrieve(n,e);t&&(l=t.componentFromFramework?void 0:t.component,u=t.componentFromFramework?t.component:void 0)};if(null!=a&&p(a),null==l&&null==u&&null!=i&&p(i),l&&r&&!this.agComponentUtils.doesImplementIComponent(l)&&(l=this.agComponentUtils.adaptFunction(n,l)),!l&&!u)return void(o&&console.error(`AG Grid: Could not find component ${a}, did you forget to configure this component?`));const g=this.mergeParamsWithApplicationProvidedParams(e,t,s,h),m=null==l,f=l||u;return{componentFromFramework:m,componentClass:f,params:g,type:t,popupFromSelector:d,popupPositionFromSelector:c,newAgStackInstance:()=>this.newAgStackInstance(f,m,g,t)}}getCompKeys(e,t,i){const{propertyName:s}=t;let o,n,r,a,l,u;if(e){const t=e,h=t[s+"Selector"],d=h?h(i):null,c=e=>{"string"==typeof e?o=e:null!=e&&!0!==e&&(this.getFrameworkOverrides().isFrameworkComponent(e)?r=e:n=e)};d?(c(d.component),a=d.params,l=d.popup,u=d.popupPosition):c(t[s])}return{compName:o,jsComp:n,fwComp:r,paramsFromSelector:a,popupFromSelector:l,popupPositionFromSelector:u}}newAgStackInstance(e,t,i,s){const o=s.propertyName;let n;if(t){const t=this.componentMetadataProvider.retrieve(o);n=this.frameworkComponentWrapper.wrap(e,t.mandatoryMethodList,t.optionalMethodList,s)}else n=new e;const r=this.initComponent(n,i);return null==r?Bl.resolve(n):r.then((()=>n))}mergeParamsWithApplicationProvidedParams(e,t,i,s=null){const o=this.gos.getGridCommonParams();oo(o,i);const n=e&&e[t.propertyName+"Params"];return"function"==typeof n?oo(o,n(i)):"object"==typeof n&&oo(o,n),oo(o,s),o}initComponent(e,t){if(this.context.createBean(e),null!=e.init)return e.init(t)}getDefaultFloatingFilterType(e,t){if(null==e)return null;let i=null,{compName:s,jsComp:o,fwComp:n}=this.getCompKeys(e,Yh);return s?i=sd.getFloatingFilterType(s):null==o&&null==n&&!0===e.filter&&(i=t()),i}};Gs([No("gridOptions")],od.prototype,"gridOptions",2),Gs([No("agComponentUtils")],od.prototype,"agComponentUtils",2),Gs([No("componentMetadataProvider")],od.prototype,"componentMetadataProvider",2),Gs([No("userComponentRegistry")],od.prototype,"userComponentRegistry",2),Gs([_o("frameworkComponentWrapper")],od.prototype,"frameworkComponentWrapper",2),od=Gs([Io("userComponentFactory")],od);var nd=class{constructor(e){this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=e.scrollContainer,this.scrollHorizontally=-1!==e.scrollAxis.indexOf("x"),this.scrollVertically=-1!==e.scrollAxis.indexOf("y"),this.scrollByTick=null!=e.scrollByTick?e.scrollByTick:20,e.onScrollCallback&&(this.onScrollCallback=e.onScrollCallback),this.scrollVertically&&(this.getVerticalPosition=e.getVerticalPosition,this.setVerticalPosition=e.setVerticalPosition),this.scrollHorizontally&&(this.getHorizontalPosition=e.getHorizontalPosition,this.setHorizontalPosition=e.setHorizontalPosition),this.shouldSkipVerticalScroll=e.shouldSkipVerticalScroll||(()=>!1),this.shouldSkipHorizontalScroll=e.shouldSkipHorizontalScroll||(()=>!1)}check(e,t=!1){const i=t||this.shouldSkipVerticalScroll();if(i&&this.shouldSkipHorizontalScroll())return;const s=this.scrollContainer.getBoundingClientRect(),o=this.scrollByTick;this.tickLeft=e.clientX<s.left+o,this.tickRight=e.clientX>s.right-o,this.tickUp=e.clientY<s.top+o&&!i,this.tickDown=e.clientY>s.bottom-o&&!i,this.tickLeft||this.tickRight||this.tickUp||this.tickDown?this.ensureTickingStarted():this.ensureCleared()}ensureTickingStarted(){null===this.tickingInterval&&(this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0)}doTick(){let e;if(this.tickCount++,e=this.tickCount>20?200:this.tickCount>10?80:40,this.scrollVertically){const t=this.getVerticalPosition();this.tickUp&&this.setVerticalPosition(t-e),this.tickDown&&this.setVerticalPosition(t+e)}if(this.scrollHorizontally){const t=this.getHorizontalPosition();this.tickLeft&&this.setHorizontalPosition(t-e),this.tickRight&&this.setHorizontalPosition(t+e)}this.onScrollCallback&&this.onScrollCallback()}ensureCleared(){this.tickingInterval&&(window.clearInterval(this.tickingInterval),this.tickingInterval=null)}},rd=class extends Pn{constructor(e){super(),this.eContainer=e}postConstruct(){this.gos.isRowModelType("clientSide")&&(this.clientSideRowModel=this.rowModel),this.ctrlsService.whenReady((e=>{const t=e.gridBodyCtrl;this.autoScrollService=new nd({scrollContainer:t.getBodyViewportElement(),scrollAxis:"y",getVerticalPosition:()=>t.getScrollFeature().getVScrollPosition().top,setVerticalPosition:e=>t.getScrollFeature().setVerticalScrollPosition(e),onScrollCallback:()=>{this.onDragging(this.lastDraggingEvent)}})}))}getContainer(){return this.eContainer}isInterestedIn(e){return 2===e}getIconName(){return this.gos.get("rowDragManaged")&&this.shouldPreventRowMove()?hh.ICON_NOT_ALLOWED:hh.ICON_MOVE}shouldPreventRowMove(){return!!this.columnModel.getRowGroupColumns().length||(!!this.filterManager.isAnyFilterPresent()||!!this.sortController.isSortActive())}getRowNodes(e){if(!this.isFromThisGrid(e))return e.dragItem.rowNodes||[];const t=e.dragItem.rowNode;if(this.gos.get("rowDragMultiRow")){const e=[...this.selectionService.getSelectedNodes()].sort(((e,t)=>null==e.rowIndex||null==t.rowIndex?0:this.getRowIndexNumber(e)-this.getRowIndexNumber(t)));if(-1!==e.indexOf(t))return e}return[t]}onDragEnter(e){e.dragItem.rowNodes=this.getRowNodes(e),this.dispatchGridEvent(In.EVENT_ROW_DRAG_ENTER,e),this.getRowNodes(e).forEach((e=>{e.setDragging(!0)})),this.onEnterOrDragging(e)}onDragging(e){this.onEnterOrDragging(e)}isFromThisGrid(e){const{dragSourceDomDataKey:t}=e.dragSource;return t===this.gos.getDomDataKey()}isDropZoneWithinThisGrid(e){const t=this.ctrlsService.getGridBodyCtrl().getGui(),{dropZoneTarget:i}=e;return!t.contains(i)}onEnterOrDragging(e){this.dispatchGridEvent(In.EVENT_ROW_DRAG_MOVE,e),this.lastDraggingEvent=e;const t=this.mouseEventService.getNormalisedPosition(e).y;this.gos.get("rowDragManaged")&&this.doManagedDrag(e,t),this.autoScrollService.check(e.event)}doManagedDrag(e,t){const i=this.isFromThisGrid(e),s=this.gos.get("rowDragManaged"),o=e.dragItem.rowNodes;s&&this.shouldPreventRowMove()||(this.gos.get("suppressMoveWhenRowDragging")||!i?this.isDropZoneWithinThisGrid(e)||this.clientSideRowModel.highlightRowAtPixel(o[0],t):this.moveRows(o,t))}getRowIndexNumber(e){return parseInt(Jo(e.getRowIndexString().split("-")),10)}moveRowAndClearHighlight(e){const t=this.clientSideRowModel.getLastHighlightedRowNode(),i=t&&1===t.highlighted,s=this.mouseEventService.getNormalisedPosition(e).y,o=e.dragItem.rowNodes;let n=i?1:0;if(this.isFromThisGrid(e))o.forEach((e=>{e.rowTop<s&&(n-=1)})),this.moveRows(o,s,n);else{const e=this.gos.getCallback("getRowId");let t=this.clientSideRowModel.getRowIndexAtPixel(s)+1;0===this.clientSideRowModel.getHighlightPosition(s)&&t--,this.clientSideRowModel.updateRowData({add:o.map((e=>e.data)).filter((t=>!this.clientSideRowModel.getRowNode(e?e({data:t,level:0}):t.id))),addIndex:t})}this.clearRowHighlight()}clearRowHighlight(){this.clientSideRowModel.highlightRowAtPixel(null)}moveRows(e,t,i=0){var s;this.clientSideRowModel.ensureRowsAtPixel(e,t,i)&&(this.focusService.clearFocusedCell(),null==(s=this.rangeService)||s.removeAllCellRanges())}addRowDropZone(e){if(!e.getContainer())return void co("addRowDropZone - A container target needs to be provided");if(this.dragAndDropService.findExternalZone(e))return void console.warn("AG Grid: addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.");let t={getContainer:e.getContainer};e.fromGrid?t=e:(e.onDragEnter&&(t.onDragEnter=t=>{e.onDragEnter(this.draggingToRowDragEvent(In.EVENT_ROW_DRAG_ENTER,t))}),e.onDragLeave&&(t.onDragLeave=t=>{e.onDragLeave(this.draggingToRowDragEvent(In.EVENT_ROW_DRAG_LEAVE,t))}),e.onDragging&&(t.onDragging=t=>{e.onDragging(this.draggingToRowDragEvent(In.EVENT_ROW_DRAG_MOVE,t))}),e.onDragStop&&(t.onDragStop=t=>{e.onDragStop(this.draggingToRowDragEvent(In.EVENT_ROW_DRAG_END,t))})),this.dragAndDropService.addDropTarget(Ns({isInterestedIn:e=>2===e,getIconName:()=>hh.ICON_MOVE,external:!0},t))}getRowDropZone(e){const t=this.getContainer.bind(this),i=this.onDragEnter.bind(this),s=this.onDragLeave.bind(this),o=this.onDragging.bind(this),n=this.onDragStop.bind(this);return e?{getContainer:t,onDragEnter:e.onDragEnter?t=>{i(t),e.onDragEnter(this.draggingToRowDragEvent(In.EVENT_ROW_DRAG_ENTER,t))}:i,onDragLeave:e.onDragLeave?t=>{s(t),e.onDragLeave(this.draggingToRowDragEvent(In.EVENT_ROW_DRAG_LEAVE,t))}:s,onDragging:e.onDragging?t=>{o(t),e.onDragging(this.draggingToRowDragEvent(In.EVENT_ROW_DRAG_MOVE,t))}:o,onDragStop:e.onDragStop?t=>{n(t),e.onDragStop(this.draggingToRowDragEvent(In.EVENT_ROW_DRAG_END,t))}:n,fromGrid:!0}:{getContainer:t,onDragEnter:i,onDragLeave:s,onDragging:o,onDragStop:n,fromGrid:!0}}draggingToRowDragEvent(e,t){const i=this.mouseEventService.getNormalisedPosition(t).y;let s,o,n=-1;switch(i>this.paginationProxy.getCurrentPageHeight()||(n=this.rowModel.getRowIndexAtPixel(i),s=this.rowModel.getRow(n)),t.vDirection){case 1:o="down";break;case 0:o="up";break;default:o=null}return this.gos.addGridCommonParams({type:e,event:t.event,node:t.dragItem.rowNode,nodes:t.dragItem.rowNodes,overIndex:n,overNode:s,y:i,vDirection:o})}dispatchGridEvent(e,t){const i=this.draggingToRowDragEvent(e,t);this.eventService.dispatchEvent(i)}onDragLeave(e){this.dispatchGridEvent(In.EVENT_ROW_DRAG_LEAVE,e),this.stopDragging(e),this.gos.get("rowDragManaged")&&this.clearRowHighlight()}onDragStop(e){this.dispatchGridEvent(In.EVENT_ROW_DRAG_END,e),this.stopDragging(e),!this.gos.get("rowDragManaged")||!this.gos.get("suppressMoveWhenRowDragging")&&this.isFromThisGrid(e)||this.isDropZoneWithinThisGrid(e)||this.moveRowAndClearHighlight(e)}stopDragging(e){this.autoScrollService.ensureCleared(),this.getRowNodes(e).forEach((e=>{e.setDragging(!1)}))}};Gs([No("dragAndDropService")],rd.prototype,"dragAndDropService",2),Gs([No("rowModel")],rd.prototype,"rowModel",2),Gs([No("paginationProxy")],rd.prototype,"paginationProxy",2),Gs([No("columnModel")],rd.prototype,"columnModel",2),Gs([No("focusService")],rd.prototype,"focusService",2),Gs([No("sortController")],rd.prototype,"sortController",2),Gs([No("filterManager")],rd.prototype,"filterManager",2),Gs([No("selectionService")],rd.prototype,"selectionService",2),Gs([No("mouseEventService")],rd.prototype,"mouseEventService",2),Gs([No("ctrlsService")],rd.prototype,"ctrlsService",2),Gs([_o("rangeService")],rd.prototype,"rangeService",2),Gs([Lo],rd.prototype,"postConstruct",1);var ad=class extends Pn{constructor(){super(...arguments),this.dragEndFunctions=[],this.dragSources=[]}removeAllListeners(){this.dragSources.forEach(this.removeListener.bind(this)),this.dragSources.length=0}removeListener(e){const t=e.dragSource.eElement,i=e.mouseDownListener;if(t.removeEventListener("mousedown",i),e.touchEnabled){const i=e.touchStartListener;t.removeEventListener("touchstart",i,{passive:!0})}}removeDragSource(e){const t=this.dragSources.find((t=>t.dragSource===e));t&&(this.removeListener(t),nn(this.dragSources,t))}isDragging(){return this.dragging}addDragSource(e){const t=this.onMouseDown.bind(this,e),{eElement:i,includeTouch:s,stopPropagationForTouch:o}=e;i.addEventListener("mousedown",t);let n=null;const r=this.gos.get("suppressTouch");s&&!r&&(n=t=>{Ma(t.target)||(t.cancelable&&(t.preventDefault(),o&&t.stopPropagation()),this.onTouchStart(e,t))},i.addEventListener("touchstart",n,{passive:!1})),this.dragSources.push({dragSource:e,mouseDownListener:t,touchStartListener:n,touchEnabled:!!s})}getStartTarget(){return this.startTarget}onTouchStart(e,t){this.currentDragParams=e,this.dragging=!1;const i=t.touches[0];this.touchLastTime=i,this.touchStart=i;const s=t=>this.onTouchUp(t,e.eElement),o=t.target,n=[{target:this.gos.getRootNode(),type:"touchmove",listener:e=>{e.cancelable&&e.preventDefault()},options:{passive:!1}},{target:o,type:"touchmove",listener:t=>this.onTouchMove(t,e.eElement),options:{passive:!0}},{target:o,type:"touchend",listener:s,options:{passive:!0}},{target:o,type:"touchcancel",listener:s,options:{passive:!0}}];this.addTemporaryEvents(n),0===e.dragStartPixels&&this.onCommonMove(i,this.touchStart,e.eElement)}onMouseDown(e,t){const i=t;if(e.skipMouseEvent&&e.skipMouseEvent(t))return;if(i._alreadyProcessedByDragService)return;if(i._alreadyProcessedByDragService=!0,0!==t.button)return;this.shouldPreventMouseEvent(t)&&t.preventDefault(),this.currentDragParams=e,this.dragging=!1,this.mouseStartEvent=t,this.startTarget=t.target;const s=this.gos.getRootNode(),o=[{target:s,type:"mousemove",listener:t=>this.onMouseMove(t,e.eElement)},{target:s,type:"mouseup",listener:t=>this.onMouseUp(t,e.eElement)},{target:s,type:"contextmenu",listener:e=>e.preventDefault()}];this.addTemporaryEvents(o),0===e.dragStartPixels&&this.onMouseMove(t,e.eElement)}addTemporaryEvents(e){e.forEach((e=>{const{target:t,type:i,listener:s,options:o}=e;t.addEventListener(i,s,o)})),this.dragEndFunctions.push((()=>{e.forEach((e=>{const{target:t,type:i,listener:s,options:o}=e;t.removeEventListener(i,s,o)}))}))}isEventNearStartEvent(e,t){const{dragStartPixels:i}=this.currentDragParams;return Nl(e,t,Bs(i)?i:4)}getFirstActiveTouch(e){for(let t=0;t<e.length;t++)if(e[t].identifier===this.touchStart.identifier)return e[t];return null}onCommonMove(e,t,i){if(!this.dragging){if(!this.dragging&&this.isEventNearStartEvent(e,t))return;this.dragging=!0;const s={type:In.EVENT_DRAG_STARTED,target:i};this.eventService.dispatchEvent(s),this.currentDragParams.onDragStart(t),this.currentDragParams.onDragging(t)}this.currentDragParams.onDragging(e)}onTouchMove(e,t){const i=this.getFirstActiveTouch(e.touches);i&&this.onCommonMove(i,this.touchStart,t)}onMouseMove(e,t){var i;Jr()&&(null==(i=this.gos.getDocument().getSelection())||i.removeAllRanges()),this.shouldPreventMouseEvent(e)&&e.preventDefault(),this.onCommonMove(e,this.mouseStartEvent,t)}shouldPreventMouseEvent(e){const t=this.gos.get("enableCellTextSelection"),i="mousemove"===e.type;return t&&i&&e.cancelable&&this.mouseEventService.isEventFromThisGrid(e)&&!this.isOverFormFieldElement(e)}isOverFormFieldElement(e){const t=e.target,i=null==t?void 0:t.tagName.toLocaleLowerCase();return!!(null==i?void 0:i.match("^a$|textarea|input|select|button"))}onTouchUp(e,t){let i=this.getFirstActiveTouch(e.changedTouches);i||(i=this.touchLastTime),this.onUpCommon(i,t)}onMouseUp(e,t){this.onUpCommon(e,t)}onUpCommon(e,t){if(this.dragging){this.dragging=!1,this.currentDragParams.onDragStop(e);const i={type:In.EVENT_DRAG_STOPPED,target:t};this.eventService.dispatchEvent(i)}this.mouseStartEvent=null,this.startTarget=null,this.touchStart=null,this.touchLastTime=null,this.currentDragParams=null,this.dragEndFunctions.forEach((e=>e())),this.dragEndFunctions.length=0}};Gs([No("mouseEventService")],ad.prototype,"mouseEventService",2),Gs([xo],ad.prototype,"removeAllListeners",1),ad=Gs([Io("dragService")],ad);var ld="ag-list-item-hovered",ud=class extends Pn{constructor(e,t,i){super(),this.comp=e,this.virtualList=t,this.params=i,this.currentDragValue=null,this.lastHoveredListItem=null}postConstruct(){this.addManagedListener(this.params.eventSource,this.params.listItemDragStartEvent,this.listItemDragStart.bind(this)),this.addManagedListener(this.params.eventSource,this.params.listItemDragEndEvent,this.listItemDragEnd.bind(this)),this.createDropTarget(),this.createAutoScrollService()}listItemDragStart(e){this.currentDragValue=this.params.getCurrentDragValue(e),this.moveBlocked=this.params.isMoveBlocked(this.currentDragValue)}listItemDragEnd(){window.setTimeout((()=>{this.currentDragValue=null,this.moveBlocked=!1}),10)}createDropTarget(){const e={isInterestedIn:e=>e===this.params.dragSourceType,getIconName:()=>this.moveBlocked?hh.ICON_PINNED:hh.ICON_MOVE,getContainer:()=>this.comp.getGui(),onDragging:e=>this.onDragging(e),onDragStop:()=>this.onDragStop(),onDragLeave:()=>this.onDragLeave()};this.dragAndDropService.addDropTarget(e)}createAutoScrollService(){const e=this.virtualList.getGui();this.autoScrollService=new nd({scrollContainer:e,scrollAxis:"y",getVerticalPosition:()=>e.scrollTop,setVerticalPosition:t=>e.scrollTop=t})}onDragging(e){if(!this.currentDragValue||this.moveBlocked)return;const t=this.getListDragItem(e),i=this.virtualList.getComponentAt(t.rowIndex);if(!i)return;const s=i.getGui().parentElement;this.lastHoveredListItem&&this.lastHoveredListItem.rowIndex===t.rowIndex&&this.lastHoveredListItem.position===t.position||(this.autoScrollService.check(e.event),this.clearHoveredItems(),this.lastHoveredListItem=t,Aa(s,ld),Aa(s,`ag-item-highlight-${t.position}`))}getListDragItem(e){const t=this.virtualList.getGui(),i=parseFloat(window.getComputedStyle(t).paddingTop),s=this.virtualList.getRowHeight(),o=this.virtualList.getScrollTop(),n=Math.max(0,(e.y-i+o)/s),r=this.params.getNumRows(this.comp)-1,a=0|Math.min(r,n);return{rowIndex:a,position:Math.round(n)>n||n>r?"bottom":"top",component:this.virtualList.getComponentAt(a)}}onDragStop(){this.moveBlocked||(this.params.moveItem(this.currentDragValue,this.lastHoveredListItem),this.clearHoveredItems(),this.autoScrollService.ensureCleared())}onDragLeave(){this.clearHoveredItems(),this.autoScrollService.ensureCleared()}clearHoveredItems(){this.virtualList.getGui().querySelectorAll(`.${ld}`).forEach((e=>{[ld,"ag-item-highlight-top","ag-item-highlight-bottom"].forEach((t=>{e.classList.remove(t)}))})),this.lastHoveredListItem=null}};function hd(e){const t=e;return null!=t&&null!=t.getFrameworkComponentInstance?t.getFrameworkComponentInstance():e}Gs([No("dragAndDropService")],ud.prototype,"dragAndDropService",2),Gs([Lo],ud.prototype,"postConstruct",1);var dd=class{constructor(){this.detailGridInfoMap={},this.destroyCalled=!1}init(){switch(this.rowModel.getType()){case"clientSide":this.clientSideRowModel=this.rowModel;break;case"infinite":this.infiniteRowModel=this.rowModel;break;case"serverSide":this.serverSideRowModel=this.rowModel}this.ctrlsService.whenReady((e=>{this.gridBodyCtrl=e.gridBodyCtrl}))}__getAlignedGridService(){return this.alignedGridsService}getGridId(){return this.context.getGridId()}addDetailGridInfo(e,t){this.detailGridInfoMap[e]=t}removeDetailGridInfo(e){delete this.detailGridInfoMap[e]}getDetailGridInfo(e){return this.detailGridInfoMap[e]}forEachDetailGridInfo(e){let t=0;eo(this.detailGridInfoMap,((i,s)=>{Bs(s)&&(e(s,t),t++)}))}getDataAsCsv(e){if(Po.__assertRegistered("@ag-grid-community/csv-export","api.getDataAsCsv",this.context.getGridId()))return this.csvCreator.getDataAsCsv(e)}exportDataAsCsv(e){Po.__assertRegistered("@ag-grid-community/csv-export","api.exportDataAsCsv",this.context.getGridId())&&this.csvCreator.exportDataAsCsv(e)}assertNotExcelMultiSheet(e,t){return!(!Po.__assertRegistered("@ag-grid-enterprise/excel-export","api."+e,this.context.getGridId())||1===this.excelCreator.getFactoryMode()&&(console.warn("AG Grid: The Excel Exporter is currently on Multi Sheet mode. End that operation by calling 'api.getMultipleSheetAsExcel()' or 'api.exportMultipleSheetsAsExcel()'"),1))}getDataAsExcel(e){if(this.assertNotExcelMultiSheet("getDataAsExcel",e))return this.excelCreator.getDataAsExcel(e)}exportDataAsExcel(e){this.assertNotExcelMultiSheet("exportDataAsExcel",e)&&this.excelCreator.exportDataAsExcel(e)}getSheetDataForExcel(e){if(Po.__assertRegistered("@ag-grid-enterprise/excel-export","api.getSheetDataForExcel",this.context.getGridId()))return this.excelCreator.setFactoryMode(1),this.excelCreator.getSheetDataForExcel(e)}getMultipleSheetsAsExcel(e){if(Po.__assertRegistered("@ag-grid-enterprise/excel-export","api.getMultipleSheetsAsExcel",this.context.getGridId()))return this.excelCreator.getMultipleSheetsAsExcel(e)}exportMultipleSheetsAsExcel(e){Po.__assertRegistered("@ag-grid-enterprise/excel-export","api.exportMultipleSheetsAsExcel",this.context.getGridId())&&this.excelCreator.exportMultipleSheetsAsExcel(e)}setGridAriaProperty(e,t){if(!e)return;const i=this.ctrlsService.getGridBodyCtrl().getGui(),s=`aria-${e}`;null===t?i.removeAttribute(s):i.setAttribute(s,t)}logMissingRowModel(e,...t){console.error(`AG Grid: api.${e} can only be called when gridOptions.rowModelType is ${t.join(" or ")}`)}logDeprecation(e,t,i,s){co(`Since ${e} api.${t} is deprecated. Please use ${i} instead. ${null!=s?s:""}`)}getPinnedTopRowCount(){return this.pinnedRowModel.getPinnedTopRowCount()}getPinnedBottomRowCount(){return this.pinnedRowModel.getPinnedBottomRowCount()}getPinnedTopRow(e){return this.pinnedRowModel.getPinnedTopRow(e)}getPinnedBottomRow(e){return this.pinnedRowModel.getPinnedBottomRow(e)}expireValueCache(){this.valueCache.expire()}getVerticalPixelRange(){return this.gridBodyCtrl.getScrollFeature().getVScrollPosition()}getHorizontalPixelRange(){return this.gridBodyCtrl.getScrollFeature().getHScrollPosition()}refreshCells(e={}){this.frameworkOverrides.wrapIncoming((()=>this.rowRenderer.refreshCells(e)))}flashCells(e={}){const t=e=>co(`Since v31.1 api.flashCells parameter '${e}Delay' is deprecated. Please use '${e}Duration' instead.`);Bs(e.fadeDelay)&&t("fade"),Bs(e.flashDelay)&&t("flash"),this.frameworkOverrides.wrapIncoming((()=>this.rowRenderer.flashCells(e)))}redrawRows(e={}){const t=e?e.rowNodes:void 0;this.frameworkOverrides.wrapIncoming((()=>this.rowRenderer.redrawRows(t)))}refreshHeader(){this.frameworkOverrides.wrapIncoming((()=>this.ctrlsService.getHeaderRowContainerCtrls().forEach((e=>e.refresh()))))}isAnyFilterPresent(){return this.filterManager.isAnyFilterPresent()}isColumnFilterPresent(){return this.filterManager.isColumnFilterPresent()||this.filterManager.isAggregateFilterPresent()}isQuickFilterPresent(){return this.filterManager.isQuickFilterPresent()}getModel(){return co("Since v31.1 getModel() is deprecated. Please use the appropriate grid API methods instead."),this.rowModel}setRowNodeExpanded(e,t,i,s){this.expansionService.setRowNodeExpanded(e,t,i,s)}onGroupExpandedOrCollapsed(){Ws(this.clientSideRowModel)?this.logMissingRowModel("onGroupExpandedOrCollapsed","clientSide"):this.expansionService.onGroupExpandedOrCollapsed()}refreshClientSideRowModel(e){Ws(this.clientSideRowModel)?this.logMissingRowModel("refreshClientSideRowModel","clientSide"):this.clientSideRowModel.refreshModel(e)}isAnimationFrameQueueEmpty(){return this.animationFrameService.isQueueEmpty()}flushAllAnimationFrames(){this.animationFrameService.flushAllFrames()}getRowNode(e){return this.rowModel.getRowNode(e)}getSizesForCurrentTheme(){return{rowHeight:this.gos.getRowHeightAsNumber(),headerHeight:this.columnModel.getHeaderHeight()}}expandAll(){this.clientSideRowModel||this.serverSideRowModel?this.expansionService.expandAll(!0):this.logMissingRowModel("expandAll","clientSide","serverSide")}collapseAll(){this.clientSideRowModel||this.serverSideRowModel?this.expansionService.expandAll(!1):this.logMissingRowModel("collapseAll","clientSide","serverSide")}addRenderedRowListener(e,t,i){this.rowRenderer.addRenderedRowListener(e,t,i)}getQuickFilter(){return this.gos.get("quickFilterText")}getAdvancedFilterModel(){return Po.__assertRegistered("@ag-grid-enterprise/advanced-filter","api.getAdvancedFilterModel",this.context.getGridId())?this.filterManager.getAdvancedFilterModel():null}setAdvancedFilterModel(e){this.filterManager.setAdvancedFilterModel(e)}showAdvancedFilterBuilder(){Po.__assertRegistered("@ag-grid-enterprise/advanced-filter","api.setAdvancedFilterModel",this.context.getGridId())&&this.filterManager.showAdvancedFilterBuilder("api")}setNodesSelected(e){if(!e.nodes.every((e=>e.rowPinned?(console.warn("AG Grid: cannot select pinned rows"),!1):void 0!==e.id||(console.warn("AG Grid: cannot select node until id for node is known"),!1))))return;const{nodes:t,source:i,newValue:s}=e,o=t;this.selectionService.setNodesSelected({nodes:o,source:null!=i?i:"api",newValue:s})}selectAll(e="apiSelectAll"){this.selectionService.selectAllRowNodes({source:e})}deselectAll(e="apiSelectAll"){this.selectionService.deselectAllRowNodes({source:e})}selectAllFiltered(e="apiSelectAllFiltered"){this.selectionService.selectAllRowNodes({source:e,justFiltered:!0})}deselectAllFiltered(e="apiSelectAllFiltered"){this.selectionService.deselectAllRowNodes({source:e,justFiltered:!0})}getServerSideSelectionState(){return Ws(this.serverSideRowModel)?(this.logMissingRowModel("getServerSideSelectionState","serverSide"),null):this.selectionService.getSelectionState()}setServerSideSelectionState(e){Ws(this.serverSideRowModel)?this.logMissingRowModel("setServerSideSelectionState","serverSide"):this.selectionService.setSelectionState(e,"api")}selectAllOnCurrentPage(e="apiSelectAllCurrentPage"){this.selectionService.selectAllRowNodes({source:e,justCurrentPage:!0})}deselectAllOnCurrentPage(e="apiSelectAllCurrentPage"){this.selectionService.deselectAllRowNodes({source:e,justCurrentPage:!0})}showLoadingOverlay(){this.overlayService.showLoadingOverlay()}showNoRowsOverlay(){this.overlayService.showNoRowsOverlay()}hideOverlay(){this.overlayService.hideOverlay()}getSelectedNodes(){return this.selectionService.getSelectedNodes()}getSelectedRows(){return this.selectionService.getSelectedRows()}getBestCostNodeSelection(){if(!Ws(this.clientSideRowModel))return this.selectionService.getBestCostNodeSelection();this.logMissingRowModel("getBestCostNodeSelection","clientSide")}getRenderedNodes(){return this.rowRenderer.getRenderedNodes()}ensureColumnVisible(e,t="auto"){this.frameworkOverrides.wrapIncoming((()=>this.gridBodyCtrl.getScrollFeature().ensureColumnVisible(e,t)),"ensureVisible")}ensureIndexVisible(e,t){this.frameworkOverrides.wrapIncoming((()=>this.gridBodyCtrl.getScrollFeature().ensureIndexVisible(e,t)),"ensureVisible")}ensureNodeVisible(e,t=null){this.frameworkOverrides.wrapIncoming((()=>this.gridBodyCtrl.getScrollFeature().ensureNodeVisible(e,t)),"ensureVisible")}forEachLeafNode(e){Ws(this.clientSideRowModel)?this.logMissingRowModel("forEachLeafNode","clientSide"):this.clientSideRowModel.forEachLeafNode(e)}forEachNode(e,t){this.rowModel.forEachNode(e,t)}forEachNodeAfterFilter(e){Ws(this.clientSideRowModel)?this.logMissingRowModel("forEachNodeAfterFilter","clientSide"):this.clientSideRowModel.forEachNodeAfterFilter(e)}forEachNodeAfterFilterAndSort(e){Ws(this.clientSideRowModel)?this.logMissingRowModel("forEachNodeAfterFilterAndSort","clientSide"):this.clientSideRowModel.forEachNodeAfterFilterAndSort(e)}getFilterInstance(e,t){return co("'getFilterInstance' is deprecated. To get/set individual filter models, use 'getColumnFilterModel' or 'setColumnFilterModel' instead. To get hold of the filter instance, use 'getColumnFilterInstance' which returns the instance asynchronously."),this.filterManager.getFilterInstance(e,t)}getColumnFilterInstance(e){return this.filterManager.getColumnFilterInstance(e)}destroyFilter(e){const t=this.columnModel.getPrimaryColumn(e);if(t)return this.filterManager.destroyFilter(t,"api")}getStatusPanel(e){if(Po.__assertRegistered("@ag-grid-enterprise/status-bar","api.getStatusPanel",this.context.getGridId()))return hd(this.statusBarService.getStatusPanel(e))}getColumnDef(e){const t=this.columnModel.getPrimaryColumn(e);return t?t.getColDef():null}getColumnDefs(){return this.columnModel.getColumnDefs()}onFilterChanged(e="api"){this.filterManager.onFilterChanged({source:e})}onSortChanged(){this.sortController.onSortChanged("api")}setFilterModel(e){this.frameworkOverrides.wrapIncoming((()=>this.filterManager.setFilterModel(e)))}getFilterModel(){return this.filterManager.getFilterModel()}getColumnFilterModel(e){return this.filterManager.getColumnFilterModel(e)}setColumnFilterModel(e,t){return this.filterManager.setColumnFilterModel(e,t)}getFocusedCell(){return this.focusService.getFocusedCell()}clearFocusedCell(){return this.focusService.clearFocusedCell()}setFocusedCell(e,t,i){this.focusService.setFocusedCell({rowIndex:e,column:t,rowPinned:i,forceBrowserFocus:!0})}addRowDropZone(e){this.gridBodyCtrl.getRowDragFeature().addRowDropZone(e)}removeRowDropZone(e){const t=this.dragAndDropService.findExternalZone(e);t&&this.dragAndDropService.removeDropTarget(t)}getRowDropZoneParams(e){return this.gridBodyCtrl.getRowDragFeature().getRowDropZone(e)}assertSideBarLoaded(e){return Po.__assertRegistered("@ag-grid-enterprise/side-bar","api."+e,this.context.getGridId())}isSideBarVisible(){return this.assertSideBarLoaded("isSideBarVisible")&&this.sideBarService.getSideBarComp().isDisplayed()}setSideBarVisible(e){this.assertSideBarLoaded("setSideBarVisible")&&this.sideBarService.getSideBarComp().setDisplayed(e)}setSideBarPosition(e){this.assertSideBarLoaded("setSideBarPosition")&&this.sideBarService.getSideBarComp().setSideBarPosition(e)}openToolPanel(e){this.assertSideBarLoaded("openToolPanel")&&this.sideBarService.getSideBarComp().openToolPanel(e,"api")}closeToolPanel(){this.assertSideBarLoaded("closeToolPanel")&&this.sideBarService.getSideBarComp().close("api")}getOpenedToolPanel(){return this.assertSideBarLoaded("getOpenedToolPanel")?this.sideBarService.getSideBarComp().openedItem():null}refreshToolPanel(){this.assertSideBarLoaded("refreshToolPanel")&&this.sideBarService.getSideBarComp().refresh()}isToolPanelShowing(){return this.assertSideBarLoaded("isToolPanelShowing")&&this.sideBarService.getSideBarComp().isToolPanelShowing()}getToolPanelInstance(e){if(this.assertSideBarLoaded("getToolPanelInstance"))return hd(this.sideBarService.getSideBarComp().getToolPanelInstance(e))}getSideBar(){if(this.assertSideBarLoaded("getSideBar"))return this.sideBarService.getSideBarComp().getDef()}resetRowHeights(){if(Bs(this.clientSideRowModel)){if(this.columnModel.isAutoRowHeightActive())return void console.warn("AG Grid: calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.");this.clientSideRowModel.resetRowHeights()}}setRowCount(e,t){if(this.serverSideRowModel)return this.columnModel.isRowGroupEmpty()?void this.serverSideRowModel.setRowCount(e,t):void console.error("AG Grid: setRowCount cannot be used while using row grouping.");this.infiniteRowModel?this.infiniteRowModel.setRowCount(e,t):this.logMissingRowModel("setRowCount","infinite","serverSide")}onRowHeightChanged(){this.clientSideRowModel?this.clientSideRowModel.onRowHeightChanged():this.serverSideRowModel&&this.serverSideRowModel.onRowHeightChanged()}getValue(e,t){return this.logDeprecation("31.3","getValue","getCellValue"),this.getCellValue({colKey:e,rowNode:t})}getCellValue(e){var t;const{colKey:i,rowNode:s,useFormatter:o}=e;let n=null!=(t=this.columnModel.getPrimaryColumn(i))?t:this.columnModel.getGridColumn(i);if(Ws(n))return null;const r=this.valueService.getValue(n,s);if(o){const e=this.valueService.formatValue(n,s,r);return null!=e?e:zn(r,!0)}return r}addEventListener(e,t){this.apiEventService.addEventListener(e,t)}addGlobalListener(e){this.apiEventService.addGlobalListener(e)}removeEventListener(e,t){this.apiEventService.removeEventListener(e,t)}removeGlobalListener(e){this.apiEventService.removeGlobalListener(e)}dispatchEvent(e){this.eventService.dispatchEvent(e)}destroy(){var e;const t=`See ${this.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed")}`;if(this.destroyCalled)return;const i={type:In.EVENT_GRID_PRE_DESTROYED,state:this.getState()};this.dispatchEvent(i),this.destroyCalled=!0,null==(e=this.ctrlsService.get("gridCtrl"))||e.destroyGridUi(),this.context.destroy(),this.detailGridInfoMap={},ro(this,["isDestroyed"],t)}isDestroyed(){return this.destroyCalled}resetQuickFilter(){this.filterManager.resetQuickFilterCache()}getCellRanges(){return this.rangeService?this.rangeService.getCellRanges():(Po.__assertRegistered("@ag-grid-enterprise/range-selection","api.getCellRanges",this.context.getGridId()),null)}addCellRange(e){this.rangeService?this.rangeService.addCellRange(e):Po.__assertRegistered("@ag-grid-enterprise/range-selection","api.addCellRange",this.context.getGridId())}clearRangeSelection(){this.rangeService&&this.rangeService.removeAllCellRanges(),Po.__assertRegistered("@ag-grid-enterprise/range-selection","gridApi.clearRangeSelection",this.context.getGridId())}undoCellEditing(){this.undoRedoService.undo("api")}redoCellEditing(){this.undoRedoService.redo("api")}getCurrentUndoSize(){return this.undoRedoService.getCurrentUndoStackSize()}getCurrentRedoSize(){return this.undoRedoService.getCurrentRedoStackSize()}assertChart(e,t){if(Po.__assertRegistered("@ag-grid-enterprise/charts","api."+e,this.context.getGridId()))return this.frameworkOverrides.wrapIncoming((()=>t()))}getChartModels(){return this.assertChart("getChartModels",(()=>this.chartService.getChartModels()))}getChartRef(e){return this.assertChart("getChartRef",(()=>this.chartService.getChartRef(e)))}getChartImageDataURL(e){return this.assertChart("getChartImageDataURL",(()=>this.chartService.getChartImageDataURL(e)))}downloadChart(e){return this.assertChart("downloadChart",(()=>this.chartService.downloadChart(e)))}openChartToolPanel(e){return this.assertChart("openChartToolPanel",(()=>this.chartService.openChartToolPanel(e)))}closeChartToolPanel(e){return this.assertChart("closeChartToolPanel",(()=>this.chartService.closeChartToolPanel(e.chartId)))}createRangeChart(e){return this.assertChart("createRangeChart",(()=>this.chartService.createRangeChart(e)))}createPivotChart(e){return this.assertChart("createPivotChart",(()=>this.chartService.createPivotChart(e)))}createCrossFilterChart(e){return this.assertChart("createCrossFilterChart",(()=>this.chartService.createCrossFilterChart(e)))}updateChart(e){return this.assertChart("updateChart",(()=>this.chartService.updateChart(e)))}restoreChart(e,t){return this.assertChart("restoreChart",(()=>this.chartService.restoreChart(e,t)))}assertClipboard(e,t){Po.__assertRegistered("@ag-grid-enterprise/clipboard","api"+e,this.context.getGridId())&&t()}copyToClipboard(e){this.assertClipboard("copyToClipboard",(()=>this.clipboardService.copyToClipboard(e)))}cutToClipboard(e){this.assertClipboard("cutToClipboard",(()=>this.clipboardService.cutToClipboard(e)))}copySelectedRowsToClipboard(e){this.assertClipboard("copySelectedRowsToClipboard",(()=>this.clipboardService.copySelectedRowsToClipboard(e)))}copySelectedRangeToClipboard(e){this.assertClipboard("copySelectedRangeToClipboard",(()=>this.clipboardService.copySelectedRangeToClipboard(e)))}copySelectedRangeDown(){this.assertClipboard("copySelectedRangeDown",(()=>this.clipboardService.copyRangeDown()))}pasteFromClipboard(){this.assertClipboard("pasteFromClipboard",(()=>this.clipboardService.pasteFromClipboard()))}showColumnMenuAfterButtonClick(e,t){co("'showColumnMenuAfterButtonClick' is deprecated. Use 'IHeaderParams.showColumnMenu' within a header component, or 'api.showColumnMenu' elsewhere.");const i=this.columnModel.getGridColumn(e);this.menuService.showColumnMenu({column:i,buttonElement:t,positionBy:"button"})}showColumnMenuAfterMouseClick(e,t){co("'showColumnMenuAfterMouseClick' is deprecated. Use 'IHeaderParams.showColumnMenuAfterMouseClick' within a header component, or 'api.showColumnMenu' elsewhere.");let i=this.columnModel.getGridColumn(e);i||(i=this.columnModel.getPrimaryColumn(e)),i?this.menuService.showColumnMenu({column:i,mouseEvent:t,positionBy:"mouse"}):console.error(`AG Grid: column '${e}' not found`)}showContextMenu(e){const{rowNode:t,column:i,value:s,x:o,y:n}=e||{};let{x:r,y:a}=this.menuService.getContextMenuPosition(t,i);null!=o&&(r=o),null!=n&&(a=n),this.menuService.showContextMenu({mouseEvent:new MouseEvent("mousedown",{clientX:r,clientY:a}),rowNode:t,column:i,value:s})}showColumnChooser(e){this.menuService.showColumnChooser({chooserParams:e})}showColumnFilter(e){const t=this.columnModel.getGridColumn(e);t?this.menuService.showFilterMenu({column:t,containerType:"columnFilter",positionBy:"auto"}):console.error(`AG Grid: column '${e}' not found`)}showColumnMenu(e){const t=this.columnModel.getGridColumn(e);t?this.menuService.showColumnMenu({column:t,positionBy:"auto"}):console.error(`AG Grid: column '${e}' not found`)}hidePopupMenu(){this.menuService.hidePopupMenu()}hideColumnChooser(){this.menuService.hideColumnChooser()}tabToNextCell(e){return this.navigationService.tabToNextCell(!1,e)}tabToPreviousCell(e){return this.navigationService.tabToNextCell(!0,e)}getCellRendererInstances(e={}){return this.rowRenderer.getCellRendererInstances(e).map(hd)}getCellEditorInstances(e={}){return this.rowRenderer.getCellEditorInstances(e).map(hd)}getEditingCells(){return this.rowRenderer.getEditingCells()}stopEditing(e=!1){this.rowRenderer.stopEditing(e)}startEditingCell(e){const t=this.columnModel.getGridColumn(e.colKey);if(!t)return void console.warn(`AG Grid: no column found for ${e.colKey}`);const i={rowIndex:e.rowIndex,rowPinned:e.rowPinned||null,column:t};null==e.rowPinned&&this.ensureIndexVisible(e.rowIndex),this.ensureColumnVisible(e.colKey);const s=this.navigationService.getCellByPosition(i);s&&(this.focusService.isCellFocused(i)||this.focusService.setFocusedCell(i),s.startRowOrCellEdit(e.key))}addAggFunc(e,t){this.logDeprecation("v31.1","addAggFunc(key, func)","addAggFuncs({ key: func })"),this.aggFuncService&&this.aggFuncService.addAggFuncs({key:t})}addAggFuncs(e){this.aggFuncService&&this.aggFuncService.addAggFuncs(e)}clearAggFuncs(){this.aggFuncService&&this.aggFuncService.clear()}applyServerSideTransaction(e){if(this.serverSideTransactionManager)return this.serverSideTransactionManager.applyTransaction(e);this.logMissingRowModel("applyServerSideTransaction","serverSide")}applyServerSideTransactionAsync(e,t){if(this.serverSideTransactionManager)return this.serverSideTransactionManager.applyTransactionAsync(e,t);this.logMissingRowModel("applyServerSideTransactionAsync","serverSide")}applyServerSideRowData(e){var t,i;const s=null!=(t=e.startRow)?t:0,o=null!=(i=e.route)?i:[];s<0?console.warn(`AG Grid: invalid value ${e.startRow} for startRow, the value should be >= 0`):this.serverSideRowModel?this.serverSideRowModel.applyRowData(e.successParams,s,o):this.logMissingRowModel("setServerSideDatasource","serverSide")}retryServerSideLoads(){this.serverSideRowModel?this.serverSideRowModel.retryLoads():this.logMissingRowModel("retryServerSideLoads","serverSide")}flushServerSideAsyncTransactions(){if(this.serverSideTransactionManager)return this.serverSideTransactionManager.flushAsyncTransactions();this.logMissingRowModel("flushServerSideAsyncTransactions","serverSide")}applyTransaction(e){if(this.clientSideRowModel)return this.frameworkOverrides.wrapIncoming((()=>this.clientSideRowModel.updateRowData(e)));this.logMissingRowModel("applyTransaction","clientSide")}applyTransactionAsync(e,t){this.clientSideRowModel?this.frameworkOverrides.wrapIncoming((()=>this.clientSideRowModel.batchUpdateRowData(e,t))):this.logMissingRowModel("applyTransactionAsync","clientSide")}flushAsyncTransactions(){this.clientSideRowModel?this.frameworkOverrides.wrapIncoming((()=>this.clientSideRowModel.flushAsyncTransactions())):this.logMissingRowModel("flushAsyncTransactions","clientSide")}refreshInfiniteCache(){this.infiniteRowModel?this.infiniteRowModel.refreshCache():this.logMissingRowModel("refreshInfiniteCache","infinite")}purgeInfiniteCache(){this.infiniteRowModel?this.infiniteRowModel.purgeCache():this.logMissingRowModel("purgeInfiniteCache","infinite")}refreshServerSide(e){this.serverSideRowModel?this.serverSideRowModel.refreshStore(e):this.logMissingRowModel("refreshServerSide","serverSide")}getServerSideGroupLevelState(){return this.serverSideRowModel?this.serverSideRowModel.getStoreState():(this.logMissingRowModel("getServerSideGroupLevelState","serverSide"),[])}getInfiniteRowCount(){if(this.infiniteRowModel)return this.infiniteRowModel.getRowCount();this.logMissingRowModel("getInfiniteRowCount","infinite")}isLastRowIndexKnown(){if(this.infiniteRowModel)return this.infiniteRowModel.isLastRowIndexKnown();this.logMissingRowModel("isLastRowIndexKnown","infinite")}getCacheBlockState(){return this.rowNodeBlockLoader.getBlockState()}getFirstDisplayedRow(){return this.logDeprecation("v31.1","getFirstDisplayedRow","getFirstDisplayedRowIndex"),this.getFirstDisplayedRowIndex()}getFirstDisplayedRowIndex(){return this.rowRenderer.getFirstVirtualRenderedRow()}getLastDisplayedRow(){return this.logDeprecation("v31.1","getLastDisplayedRow","getLastDisplayedRowIndex"),this.getLastDisplayedRowIndex()}getLastDisplayedRowIndex(){return this.rowRenderer.getLastVirtualRenderedRow()}getDisplayedRowAtIndex(e){return this.rowModel.getRow(e)}getDisplayedRowCount(){return this.rowModel.getRowCount()}paginationIsLastPageFound(){return this.paginationProxy.isLastPageFound()}paginationGetPageSize(){return this.paginationProxy.getPageSize()}paginationGetCurrentPage(){return this.paginationProxy.getCurrentPage()}paginationGetTotalPages(){return this.paginationProxy.getTotalPages()}paginationGetRowCount(){return this.paginationProxy.getMasterRowCount()}paginationGoToNextPage(){this.paginationProxy.goToNextPage()}paginationGoToPreviousPage(){this.paginationProxy.goToPreviousPage()}paginationGoToFirstPage(){this.paginationProxy.goToFirstPage()}paginationGoToLastPage(){this.paginationProxy.goToLastPage()}paginationGoToPage(e){this.paginationProxy.goToPage(e)}sizeColumnsToFit(e){"number"==typeof e?this.columnModel.sizeColumnsToFit(e,"api"):this.gridBodyCtrl.sizeColumnsToFit(e)}setColumnGroupOpened(e,t){this.columnModel.setColumnGroupOpened(e,t,"api")}getColumnGroup(e,t){return this.columnModel.getColumnGroup(e,t)}getProvidedColumnGroup(e){return this.columnModel.getProvidedColumnGroup(e)}getDisplayNameForColumn(e,t){return this.columnModel.getDisplayNameForColumn(e,t)||""}getDisplayNameForColumnGroup(e,t){return this.columnModel.getDisplayNameForColumnGroup(e,t)||""}getColumn(e){return this.columnModel.getPrimaryColumn(e)}getColumns(){return this.columnModel.getAllPrimaryColumns()}applyColumnState(e){return this.columnModel.applyColumnState(e,"api")}getColumnState(){return this.columnModel.getColumnState()}resetColumnState(){this.columnModel.resetColumnState("api")}getColumnGroupState(){return this.columnModel.getColumnGroupState()}setColumnGroupState(e){this.columnModel.setColumnGroupState(e,"api")}resetColumnGroupState(){this.columnModel.resetColumnGroupState("api")}isPinning(){return this.columnModel.isPinningLeft()||this.columnModel.isPinningRight()}isPinningLeft(){return this.columnModel.isPinningLeft()}isPinningRight(){return this.columnModel.isPinningRight()}getDisplayedColAfter(e){return this.columnModel.getDisplayedColAfter(e)}getDisplayedColBefore(e){return this.columnModel.getDisplayedColBefore(e)}setColumnVisible(e,t){this.logDeprecation("v31.1","setColumnVisible(key,visible)","setColumnsVisible([key],visible)"),this.columnModel.setColumnsVisible([e],t,"api")}setColumnsVisible(e,t){this.columnModel.setColumnsVisible(e,t,"api")}setColumnPinned(e,t){this.logDeprecation("v31.1","setColumnPinned(key,pinned)","setColumnsPinned([key],pinned)"),this.columnModel.setColumnsPinned([e],t,"api")}setColumnsPinned(e,t){this.columnModel.setColumnsPinned(e,t,"api")}getAllGridColumns(){return this.columnModel.getAllGridColumns()}getDisplayedLeftColumns(){return this.columnModel.getDisplayedLeftColumns()}getDisplayedCenterColumns(){return this.columnModel.getDisplayedCenterColumns()}getDisplayedRightColumns(){return this.columnModel.getDisplayedRightColumns()}getAllDisplayedColumns(){return this.columnModel.getAllDisplayedColumns()}getAllDisplayedVirtualColumns(){return this.columnModel.getViewportColumns()}moveColumn(e,t){this.logDeprecation("v31.1","moveColumn(key, toIndex)","moveColumns([key], toIndex)"),this.columnModel.moveColumns([e],t,"api")}moveColumnByIndex(e,t){this.columnModel.moveColumnByIndex(e,t,"api")}moveColumns(e,t){this.columnModel.moveColumns(e,t,"api")}moveRowGroupColumn(e,t){this.columnModel.moveRowGroupColumn(e,t,"api")}setColumnAggFunc(e,t){this.columnModel.setColumnAggFunc(e,t,"api")}setColumnWidth(e,t,i=!0,s="api"){this.logDeprecation("v31.1","setColumnWidth(col, width)","setColumnWidths([{key: col, newWidth: width}])"),this.columnModel.setColumnWidths([{key:e,newWidth:t}],!1,i,s)}setColumnWidths(e,t=!0,i="api"){this.columnModel.setColumnWidths(e,!1,t,i)}isPivotMode(){return this.columnModel.isPivotMode()}getPivotResultColumn(e,t){return this.columnModel.getSecondaryPivotColumn(e,t)}setValueColumns(e){this.columnModel.setValueColumns(e,"api")}getValueColumns(){return this.columnModel.getValueColumns()}removeValueColumn(e){this.logDeprecation("v31.1","removeValueColumn(colKey)","removeValueColumns([colKey])"),this.columnModel.removeValueColumns([e],"api")}removeValueColumns(e){this.columnModel.removeValueColumns(e,"api")}addValueColumn(e){this.logDeprecation("v31.1","addValueColumn(colKey)","addValueColumns([colKey])"),this.columnModel.addValueColumns([e],"api")}addValueColumns(e){this.columnModel.addValueColumns(e,"api")}setRowGroupColumns(e){this.columnModel.setRowGroupColumns(e,"api")}removeRowGroupColumn(e){this.logDeprecation("v31.1","removeRowGroupColumn(colKey)","removeRowGroupColumns([colKey])"),this.columnModel.removeRowGroupColumns([e],"api")}removeRowGroupColumns(e){this.columnModel.removeRowGroupColumns(e,"api")}addRowGroupColumn(e){this.logDeprecation("v31.1","addRowGroupColumn(colKey)","addRowGroupColumns([colKey])"),this.columnModel.addRowGroupColumns([e],"api")}addRowGroupColumns(e){this.columnModel.addRowGroupColumns(e,"api")}getRowGroupColumns(){return this.columnModel.getRowGroupColumns()}setPivotColumns(e){this.columnModel.setPivotColumns(e,"api")}removePivotColumn(e){this.logDeprecation("v31.1","removePivotColumn(colKey)","removePivotColumns([colKey])"),this.columnModel.removePivotColumns([e],"api")}removePivotColumns(e){this.columnModel.removePivotColumns(e,"api")}addPivotColumn(e){this.logDeprecation("v31.1","addPivotColumn(colKey)","addPivotColumns([colKey])"),this.columnModel.addPivotColumns([e],"api")}addPivotColumns(e){this.columnModel.addPivotColumns(e,"api")}getPivotColumns(){return this.columnModel.getPivotColumns()}getLeftDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeLeft()}getCenterDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeCentre()}getRightDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeRight()}getAllDisplayedColumnGroups(){return this.columnModel.getAllDisplayedTrees()}autoSizeColumn(e,t){return this.logDeprecation("v31.1","autoSizeColumn(key, skipHeader)","autoSizeColumns([key], skipHeader)"),this.columnModel.autoSizeColumns({columns:[e],skipHeader:t,source:"api"})}autoSizeColumns(e,t){this.columnModel.autoSizeColumns({columns:e,skipHeader:t,source:"api"})}autoSizeAllColumns(e){this.columnModel.autoSizeAllColumns("api",e)}setPivotResultColumns(e){this.columnModel.setSecondaryColumns(e,"api")}getPivotResultColumns(){return this.columnModel.getSecondaryColumns()}getState(){return this.stateService.getState()}getGridOption(e){return this.gos.get(e)}setGridOption(e,t){this.updateGridOptions({[e]:t})}updateGridOptions(e){this.gos.updateGridOptions({options:e})}__internalUpdateGridOptions(e,t){this.gos.updateGridOptions({options:e,force:t,source:"gridOptionsUpdated"})}deprecatedUpdateGridOption(e,t){co(`set${e.charAt(0).toUpperCase()}${e.slice(1,e.length)} is deprecated. Please use 'api.setGridOption('${e}', newValue)' or 'api.updateGridOptions({ ${e}: newValue })' instead.`),this.setGridOption(e,t)}setPivotMode(e){this.deprecatedUpdateGridOption("pivotMode",e)}setPinnedTopRowData(e){this.deprecatedUpdateGridOption("pinnedTopRowData",e)}setPinnedBottomRowData(e){this.deprecatedUpdateGridOption("pinnedBottomRowData",e)}setPopupParent(e){this.deprecatedUpdateGridOption("popupParent",e)}setSuppressModelUpdateAfterUpdateTransaction(e){this.deprecatedUpdateGridOption("suppressModelUpdateAfterUpdateTransaction",e)}setDataTypeDefinitions(e){this.deprecatedUpdateGridOption("dataTypeDefinitions",e)}setPagination(e){this.deprecatedUpdateGridOption("pagination",e)}paginationSetPageSize(e){this.deprecatedUpdateGridOption("paginationPageSize",e)}setSideBar(e){this.deprecatedUpdateGridOption("sideBar",e)}setSuppressClipboardPaste(e){this.deprecatedUpdateGridOption("suppressClipboardPaste",e)}setGroupRemoveSingleChildren(e){this.deprecatedUpdateGridOption("groupRemoveSingleChildren",e)}setGroupRemoveLowestSingleChildren(e){this.deprecatedUpdateGridOption("groupRemoveLowestSingleChildren",e)}setGroupDisplayType(e){this.deprecatedUpdateGridOption("groupDisplayType",e)}setGroupIncludeFooter(e){this.deprecatedUpdateGridOption("groupIncludeFooter",e)}setGroupIncludeTotalFooter(e){this.deprecatedUpdateGridOption("groupIncludeTotalFooter",e)}setRowClass(e){this.deprecatedUpdateGridOption("rowClass",e)}setDeltaSort(e){this.deprecatedUpdateGridOption("deltaSort",e)}setSuppressRowDrag(e){this.deprecatedUpdateGridOption("suppressRowDrag",e)}setSuppressMoveWhenRowDragging(e){this.deprecatedUpdateGridOption("suppressMoveWhenRowDragging",e)}setSuppressRowClickSelection(e){this.deprecatedUpdateGridOption("suppressRowClickSelection",e)}setEnableAdvancedFilter(e){this.deprecatedUpdateGridOption("enableAdvancedFilter",e)}setIncludeHiddenColumnsInAdvancedFilter(e){this.deprecatedUpdateGridOption("includeHiddenColumnsInAdvancedFilter",e)}setAdvancedFilterParent(e){this.deprecatedUpdateGridOption("advancedFilterParent",e)}setAdvancedFilterBuilderParams(e){this.deprecatedUpdateGridOption("advancedFilterBuilderParams",e)}setQuickFilter(e){co("setQuickFilter is deprecated. Please use 'api.setGridOption('quickFilterText', newValue)' or 'api.updateGridOptions({ quickFilterText: newValue })' instead."),this.gos.updateGridOptions({options:{quickFilterText:e}})}setExcludeHiddenColumnsFromQuickFilter(e){this.deprecatedUpdateGridOption("includeHiddenColumnsInQuickFilter",!e)}setIncludeHiddenColumnsInQuickFilter(e){this.deprecatedUpdateGridOption("includeHiddenColumnsInQuickFilter",e)}setQuickFilterParser(e){this.deprecatedUpdateGridOption("quickFilterParser",e)}setQuickFilterMatcher(e){this.deprecatedUpdateGridOption("quickFilterMatcher",e)}setAlwaysShowHorizontalScroll(e){this.deprecatedUpdateGridOption("alwaysShowHorizontalScroll",e)}setAlwaysShowVerticalScroll(e){this.deprecatedUpdateGridOption("alwaysShowVerticalScroll",e)}setFunctionsReadOnly(e){this.deprecatedUpdateGridOption("functionsReadOnly",e)}setColumnDefs(e,t="api"){co("setColumnDefs is deprecated. Please use 'api.setGridOption('columnDefs', newValue)' or 'api.updateGridOptions({ columnDefs: newValue })' instead."),this.gos.updateGridOptions({options:{columnDefs:e},source:t})}setAutoGroupColumnDef(e,t="api"){co("setAutoGroupColumnDef is deprecated. Please use 'api.setGridOption('autoGroupColumnDef', newValue)' or 'api.updateGridOptions({ autoGroupColumnDef: newValue })' instead."),this.gos.updateGridOptions({options:{autoGroupColumnDef:e},source:t})}setDefaultColDef(e,t="api"){co("setDefaultColDef is deprecated. Please use 'api.setGridOption('defaultColDef', newValue)' or 'api.updateGridOptions({ defaultColDef: newValue })' instead."),this.gos.updateGridOptions({options:{defaultColDef:e},source:t})}setColumnTypes(e,t="api"){co("setColumnTypes is deprecated. Please use 'api.setGridOption('columnTypes', newValue)' or 'api.updateGridOptions({ columnTypes: newValue })' instead."),this.gos.updateGridOptions({options:{columnTypes:e},source:t})}setTreeData(e){this.deprecatedUpdateGridOption("treeData",e)}setServerSideDatasource(e){this.deprecatedUpdateGridOption("serverSideDatasource",e)}setCacheBlockSize(e){this.deprecatedUpdateGridOption("cacheBlockSize",e)}setDatasource(e){this.deprecatedUpdateGridOption("datasource",e)}setViewportDatasource(e){this.deprecatedUpdateGridOption("viewportDatasource",e)}setRowData(e){this.deprecatedUpdateGridOption("rowData",e)}setEnableCellTextSelection(e){this.deprecatedUpdateGridOption("enableCellTextSelection",e)}setHeaderHeight(e){this.deprecatedUpdateGridOption("headerHeight",e)}setDomLayout(e){this.deprecatedUpdateGridOption("domLayout",e)}setFillHandleDirection(e){this.deprecatedUpdateGridOption("fillHandleDirection",e)}setGroupHeaderHeight(e){this.deprecatedUpdateGridOption("groupHeaderHeight",e)}setFloatingFiltersHeight(e){this.deprecatedUpdateGridOption("floatingFiltersHeight",e)}setPivotHeaderHeight(e){this.deprecatedUpdateGridOption("pivotHeaderHeight",e)}setPivotGroupHeaderHeight(e){this.deprecatedUpdateGridOption("pivotGroupHeaderHeight",e)}setAnimateRows(e){this.deprecatedUpdateGridOption("animateRows",e)}setIsExternalFilterPresent(e){this.deprecatedUpdateGridOption("isExternalFilterPresent",e)}setDoesExternalFilterPass(e){this.deprecatedUpdateGridOption("doesExternalFilterPass",e)}setNavigateToNextCell(e){this.deprecatedUpdateGridOption("navigateToNextCell",e)}setTabToNextCell(e){this.deprecatedUpdateGridOption("tabToNextCell",e)}setTabToNextHeader(e){this.deprecatedUpdateGridOption("tabToNextHeader",e)}setNavigateToNextHeader(e){this.deprecatedUpdateGridOption("navigateToNextHeader",e)}setRowGroupPanelShow(e){this.deprecatedUpdateGridOption("rowGroupPanelShow",e)}setGetGroupRowAgg(e){this.deprecatedUpdateGridOption("getGroupRowAgg",e)}setGetBusinessKeyForNode(e){this.deprecatedUpdateGridOption("getBusinessKeyForNode",e)}setGetChildCount(e){this.deprecatedUpdateGridOption("getChildCount",e)}setProcessRowPostCreate(e){this.deprecatedUpdateGridOption("processRowPostCreate",e)}setGetRowId(e){co("getRowId is a static property and can no longer be updated.")}setGetRowClass(e){this.deprecatedUpdateGridOption("getRowClass",e)}setIsFullWidthRow(e){this.deprecatedUpdateGridOption("isFullWidthRow",e)}setIsRowSelectable(e){this.deprecatedUpdateGridOption("isRowSelectable",e)}setIsRowMaster(e){this.deprecatedUpdateGridOption("isRowMaster",e)}setPostSortRows(e){this.deprecatedUpdateGridOption("postSortRows",e)}setGetDocument(e){this.deprecatedUpdateGridOption("getDocument",e)}setGetContextMenuItems(e){this.deprecatedUpdateGridOption("getContextMenuItems",e)}setGetMainMenuItems(e){this.deprecatedUpdateGridOption("getMainMenuItems",e)}setProcessCellForClipboard(e){this.deprecatedUpdateGridOption("processCellForClipboard",e)}setSendToClipboard(e){this.deprecatedUpdateGridOption("sendToClipboard",e)}setProcessCellFromClipboard(e){this.deprecatedUpdateGridOption("processCellFromClipboard",e)}setProcessPivotResultColDef(e){this.deprecatedUpdateGridOption("processPivotResultColDef",e)}setProcessPivotResultColGroupDef(e){this.deprecatedUpdateGridOption("processPivotResultColGroupDef",e)}setPostProcessPopup(e){this.deprecatedUpdateGridOption("postProcessPopup",e)}setInitialGroupOrderComparator(e){this.deprecatedUpdateGridOption("initialGroupOrderComparator",e)}setGetChartToolbarItems(e){this.deprecatedUpdateGridOption("getChartToolbarItems",e)}setPaginationNumberFormatter(e){this.deprecatedUpdateGridOption("paginationNumberFormatter",e)}setGetServerSideGroupLevelParams(e){this.deprecatedUpdateGridOption("getServerSideGroupLevelParams",e)}setIsServerSideGroupOpenByDefault(e){this.deprecatedUpdateGridOption("isServerSideGroupOpenByDefault",e)}setIsApplyServerSideTransaction(e){this.deprecatedUpdateGridOption("isApplyServerSideTransaction",e)}setIsServerSideGroup(e){this.deprecatedUpdateGridOption("isServerSideGroup",e)}setGetServerSideGroupKey(e){this.deprecatedUpdateGridOption("getServerSideGroupKey",e)}setGetRowStyle(e){this.deprecatedUpdateGridOption("getRowStyle",e)}setGetRowHeight(e){this.deprecatedUpdateGridOption("getRowHeight",e)}};Gs([No("rowRenderer")],dd.prototype,"rowRenderer",2),Gs([No("navigationService")],dd.prototype,"navigationService",2),Gs([No("filterManager")],dd.prototype,"filterManager",2),Gs([No("columnModel")],dd.prototype,"columnModel",2),Gs([No("selectionService")],dd.prototype,"selectionService",2),Gs([No("gridOptionsService")],dd.prototype,"gos",2),Gs([No("valueService")],dd.prototype,"valueService",2),Gs([No("alignedGridsService")],dd.prototype,"alignedGridsService",2),Gs([No("eventService")],dd.prototype,"eventService",2),Gs([No("pinnedRowModel")],dd.prototype,"pinnedRowModel",2),Gs([No("context")],dd.prototype,"context",2),Gs([No("rowModel")],dd.prototype,"rowModel",2),Gs([No("sortController")],dd.prototype,"sortController",2),Gs([No("paginationProxy")],dd.prototype,"paginationProxy",2),Gs([No("focusService")],dd.prototype,"focusService",2),Gs([No("dragAndDropService")],dd.prototype,"dragAndDropService",2),Gs([No("menuService")],dd.prototype,"menuService",2),Gs([No("valueCache")],dd.prototype,"valueCache",2),Gs([No("animationFrameService")],dd.prototype,"animationFrameService",2),Gs([No("ctrlsService")],dd.prototype,"ctrlsService",2),Gs([No("overlayService")],dd.prototype,"overlayService",2),Gs([No("stateService")],dd.prototype,"stateService",2),Gs([No("expansionService")],dd.prototype,"expansionService",2),Gs([No("apiEventService")],dd.prototype,"apiEventService",2),Gs([No("frameworkOverrides")],dd.prototype,"frameworkOverrides",2),Gs([No("undoRedoService")],dd.prototype,"undoRedoService",2),Gs([No("rowNodeBlockLoader")],dd.prototype,"rowNodeBlockLoader",2),Gs([_o("csvCreator")],dd.prototype,"csvCreator",2),Gs([_o("excelCreator")],dd.prototype,"excelCreator",2),Gs([_o("rangeService")],dd.prototype,"rangeService",2),Gs([_o("clipboardService")],dd.prototype,"clipboardService",2),Gs([_o("aggFuncService")],dd.prototype,"aggFuncService",2),Gs([_o("statusBarService")],dd.prototype,"statusBarService",2),Gs([_o("chartService")],dd.prototype,"chartService",2),Gs([_o("ssrmTransactionManager")],dd.prototype,"serverSideTransactionManager",2),Gs([_o("sideBarService")],dd.prototype,"sideBarService",2),Gs([Lo],dd.prototype,"init",1),dd=Gs([Io("gridApi")],dd);var cd=class extends Pn{constructor(){super(...arguments),this.quickFilter=null,this.quickFilterParts=null}postConstruct(){this.addManagedListener(this.eventService,In.EVENT_COLUMN_PIVOT_MODE_CHANGED,(()=>this.resetQuickFilterCache())),this.addManagedListener(this.eventService,In.EVENT_NEW_COLUMNS_LOADED,(()=>this.resetQuickFilterCache())),this.addManagedListener(this.eventService,In.EVENT_COLUMN_ROW_GROUP_CHANGED,(()=>this.resetQuickFilterCache())),this.addManagedListener(this.eventService,In.EVENT_COLUMN_VISIBLE,(()=>{this.gos.get("includeHiddenColumnsInQuickFilter")||this.resetQuickFilterCache()})),this.addManagedPropertyListener("quickFilterText",(e=>this.setQuickFilter(e.currentValue))),this.addManagedPropertyListeners(["includeHiddenColumnsInQuickFilter","applyQuickFilterBeforePivotOrAgg"],(()=>this.onQuickFilterColumnConfigChanged())),this.quickFilter=this.parseQuickFilter(this.gos.get("quickFilterText")),this.parser=this.gos.get("quickFilterParser"),this.matcher=this.gos.get("quickFilterMatcher"),this.setQuickFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],(()=>this.setQuickFilterParserAndMatcher()))}isQuickFilterPresent(){return null!==this.quickFilter}doesRowPassQuickFilter(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassQuickFilterMatcher(t,e):this.quickFilterParts.every((i=>t?this.doesRowPassQuickFilterCache(e,i):this.doesRowPassQuickFilterNoCache(e,i)))}resetQuickFilterCache(){this.rowModel.forEachNode((e=>e.quickFilterAggregateText=null))}setQuickFilterParts(){const{quickFilter:e,parser:t}=this;this.quickFilterParts=e?t?t(e):e.split(" "):null}parseQuickFilter(e){return Bs(e)?this.gos.isRowModelType("clientSide")?e.toUpperCase():(console.warn("AG Grid - Quick filtering only works with the Client-Side Row Model"),null):null}setQuickFilter(e){if(null!=e&&"string"!=typeof e)return void console.warn("AG Grid - Grid option quickFilterText only supports string inputs, received: "+typeof e);const t=this.parseQuickFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setQuickFilterParts(),this.dispatchEvent({type:cd.EVENT_QUICK_FILTER_CHANGED}))}setQuickFilterParserAndMatcher(){const e=this.gos.get("quickFilterParser"),t=this.gos.get("quickFilterMatcher"),i=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,i&&(this.setQuickFilterParts(),this.dispatchEvent({type:cd.EVENT_QUICK_FILTER_CHANGED}))}onQuickFilterColumnConfigChanged(){this.columnModel.refreshQuickFilterColumns(),this.resetQuickFilterCache(),this.isQuickFilterPresent()&&this.dispatchEvent({type:cd.EVENT_QUICK_FILTER_CHANGED})}doesRowPassQuickFilterNoCache(e,t){return this.columnModel.getAllColumnsForQuickFilter().some((i=>{const s=this.getQuickFilterTextForColumn(i,e);return Bs(s)&&s.indexOf(t)>=0}))}doesRowPassQuickFilterCache(e,t){return this.checkGenerateQuickFilterAggregateText(e),e.quickFilterAggregateText.indexOf(t)>=0}doesRowPassQuickFilterMatcher(e,t){let i;e?(this.checkGenerateQuickFilterAggregateText(t),i=t.quickFilterAggregateText):i=this.getQuickFilterAggregateText(t);const{quickFilterParts:s,matcher:o}=this;return o(s,i)}checkGenerateQuickFilterAggregateText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getQuickFilterAggregateText(e))}getQuickFilterTextForColumn(e,t){let i=this.valueService.getValue(e,t,!0);const s=e.getColDef();if(s.getQuickFilterText){const o=this.gos.addGridCommonParams({value:i,node:t,data:t.data,column:e,colDef:s});i=s.getQuickFilterText(o)}return Bs(i)?i.toString().toUpperCase():null}getQuickFilterAggregateText(e){const t=[];return this.columnModel.getAllColumnsForQuickFilter().forEach((i=>{const s=this.getQuickFilterTextForColumn(i,e);Bs(s)&&t.push(s)})),t.join(cd.QUICK_FILTER_SEPARATOR)}};cd.EVENT_QUICK_FILTER_CHANGED="quickFilterChanged",cd.QUICK_FILTER_SEPARATOR="\n",Gs([No("valueService")],cd.prototype,"valueService",2),Gs([No("columnModel")],cd.prototype,"columnModel",2),Gs([No("rowModel")],cd.prototype,"rowModel",2),Gs([Lo],cd.prototype,"postConstruct",1),cd=Gs([Io("quickFilterService")],cd);var pd=class extends Pn{constructor(){super(...arguments),this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue=[],this.advancedFilterModelUpdateQueue=[]}init(){var e,t,i;this.addManagedListener(this.eventService,In.EVENT_GRID_COLUMNS_CHANGED,(()=>this.onColumnsChanged())),this.addManagedListener(this.eventService,In.EVENT_COLUMN_VALUE_CHANGED,(()=>this.refreshFiltersForAggregations())),this.addManagedListener(this.eventService,In.EVENT_COLUMN_PIVOT_CHANGED,(()=>this.refreshFiltersForAggregations())),this.addManagedListener(this.eventService,In.EVENT_COLUMN_PIVOT_MODE_CHANGED,(()=>this.refreshFiltersForAggregations())),this.addManagedListener(this.eventService,In.EVENT_NEW_COLUMNS_LOADED,(()=>this.updateAdvancedFilterColumns())),this.addManagedListener(this.eventService,In.EVENT_COLUMN_VISIBLE,(()=>this.updateAdvancedFilterColumns())),this.addManagedListener(this.eventService,In.EVENT_ROW_DATA_UPDATED,(()=>this.onNewRowsLoaded("rowDataUpdated"))),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],(()=>{this.onFilterChanged({source:"api"})})),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",(()=>{this.updateAggFiltering(),this.onFilterChanged()})),this.addManagedPropertyListener("advancedFilterModel",(e=>this.setAdvancedFilterModel(e.currentValue))),this.addManagedListener(this.eventService,In.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,(({enabled:e})=>this.onAdvancedFilterEnabledChanged(e))),this.addManagedListener(this.eventService,In.EVENT_DATA_TYPES_INFERRED,(()=>this.processFilterModelUpdateQueue())),this.addManagedListener(this.quickFilterService,cd.EVENT_QUICK_FILTER_CHANGED,(()=>this.onFilterChanged({source:"quickFilter"}))),this.initialFilterModel=Ns({},null!=(i=null==(t=null==(e=this.gos.get("initialState"))?void 0:e.filter)?void 0:t.filterModel)?i:{})}isExternalFilterPresentCallback(){const e=this.gos.getCallback("isExternalFilterPresent");return"function"==typeof e&&e({})}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return"function"==typeof t&&t(e)}setFilterModel(e,t="api"){if(this.isAdvancedFilterEnabled())return void this.warnAdvancedFilters();if(this.dataTypeService.isPendingInference())return void this.filterModelUpdateQueue.push({model:e,source:t});const i=[],s=this.getFilterModel();if(e){const t=kl(Object.keys(e));this.allColumnFilters.forEach(((s,o)=>{const n=e[o];i.push(this.setModelOnFilterWrapper(s.filterPromise,n)),t.delete(o)})),t.forEach((t=>{const s=this.columnModel.getPrimaryColumn(t)||this.columnModel.getGridColumn(t);if(!s)return void console.warn("AG Grid: setFilterModel() - no column found for colId: "+t);if(!s.isFilterAllowed())return void console.warn("AG Grid: setFilterModel() - unable to fully apply model, filtering disabled for colId: "+t);const o=this.getOrCreateFilterWrapper(s,"NO_UI");o?i.push(this.setModelOnFilterWrapper(o.filterPromise,e[t])):console.warn("AG-Grid: setFilterModel() - unable to fully apply model, unable to create filter for colId: "+t)}))}else this.allColumnFilters.forEach((e=>{i.push(this.setModelOnFilterWrapper(e.filterPromise,null))}));Bl.all(i).then((()=>{const e=this.getFilterModel(),i=[];this.allColumnFilters.forEach(((t,o)=>{const n=s?s[o]:null,r=e?e[o]:null;Vl.jsonEquals(n,r)||i.push(t.column)})),i.length>0&&this.onFilterChanged({columns:i,source:t})}))}setModelOnFilterWrapper(e,t){return new Bl((i=>{e.then((e=>{"function"!=typeof e.setModel&&(console.warn("AG Grid: filter missing setModel method, which is needed for setFilterModel"),i()),(e.setModel(t)||Bl.resolve()).then((()=>i()))}))}))}getFilterModel(){const e={};return this.allColumnFilters.forEach(((t,i)=>{const s=this.getModelFromFilterWrapper(t);Bs(s)&&(e[i]=s)})),e}getModelFromFilterWrapper(e){var t;const i=e.filterPromise.resolveNow(null,(e=>e));return null==i?null!=(t=this.initialFilterModel[e.column.getColId()])?t:null:"function"!=typeof i.getModel?(console.warn("AG Grid: filter API missing getModel method, which is needed for getFilterModel"),null):i.getModel()}isColumnFilterPresent(){return this.activeColumnFilters.length>0}isAggregateFilterPresent(){return!!this.activeAggregateFilters.length}isExternalFilterPresent(){return this.externalFilterPresent}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}isAdvancedFilterPresent(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isFilterPresent()}onAdvancedFilterEnabledChanged(e){var t;e?this.allColumnFilters.size&&(this.allColumnFilters.forEach((e=>this.disposeFilterWrapper(e,"advancedFilterEnabled"))),this.onFilterChanged({source:"advancedFilter"})):(null==(t=this.advancedFilterService)?void 0:t.isFilterPresent())&&(this.advancedFilterService.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvancedFilterEnabled(){var e;return!!(null==(e=this.advancedFilterService)?void 0:e.isEnabled())}isAdvancedFilterHeaderActive(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isHeaderActive()}doAggregateFiltersPass(e,t){return this.doColumnFiltersPass(e,t,!0)}updateActiveFilters(){this.activeColumnFilters.length=0,this.activeAggregateFilters.length=0;const e=e=>!!e&&(e.isFilterActive?e.isFilterActive():(console.warn("AG Grid: Filter is missing isFilterActive() method"),!1)),t=!!this.gos.getGroupAggFiltering(),i=e=>{if(!e.isPrimary())return!0;const i=!this.columnModel.isPivotActive();return!(!e.isValueActive()||!i)&&(!!this.columnModel.isPivotMode()||t)};this.allColumnFilters.forEach((t=>{if(t.filterPromise.resolveNow(!1,e)){const e=t.filterPromise.resolveNow(null,(e=>e));i(t.column)?this.activeAggregateFilters.push(e):this.activeColumnFilters.push(e)}}))}updateFilterFlagInColumns(e,t){this.allColumnFilters.forEach((i=>{const s=i.filterPromise.resolveNow(!1,(e=>e.isFilterActive()));i.column.setFilterActive(s,e,t)}))}isAnyFilterPresent(){return this.isQuickFilterPresent()||this.isColumnFilterPresent()||this.isAggregateFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}doColumnFiltersPass(e,t,i){const{data:s,aggData:o}=e,n=i?this.activeAggregateFilters:this.activeColumnFilters,r=i?o:s;for(let i=0;i<n.length;i++){const s=n[i];if(null!=s&&s!==t){if("function"!=typeof s.doesFilterPass)throw new Error("Filter is missing method doesFilterPass");if(!s.doesFilterPass({node:e,data:r}))return!1}}return!0}resetQuickFilterCache(){this.quickFilterService.resetQuickFilterCache()}refreshFiltersForAggregations(){this.gos.getGroupAggFiltering()&&this.onFilterChanged()}callOnFilterChangedOutsideRenderCycle(e){const t=()=>this.onFilterChanged(e);this.rowRenderer.isRefreshInProgress()?setTimeout(t,0):t()}onFilterChanged(e={}){const{source:t,filterInstance:i,additionalEventAttributes:s,columns:o}=e;this.updateDependantFilters(),this.updateActiveFilters(),this.updateFilterFlagInColumns("filterChanged",s),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.allColumnFilters.forEach((e=>{e.filterPromise&&e.filterPromise.then((e=>{e&&e!==i&&e.onAnyFilterChanged&&e.onAnyFilterChanged()}))}));const n={source:t,type:In.EVENT_FILTER_CHANGED,columns:o||[]};s&&oo(n,s),this.processingFilterChange=!0,this.eventService.dispatchEvent(n),this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){var e;return!(null!=(e=this.gos.get("allowShowChangeAfterFilter"))&&e)&&this.processingFilterChange}isQuickFilterPresent(){return this.quickFilterService.isQuickFilterPresent()}updateAggFiltering(){this.aggFiltering=!!this.gos.getGroupAggFiltering()}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.columnModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(e,t){return this.doesRowPassFilter({rowNode:t,filterInstanceToSkip:e})}doesRowPassAggregateFilters(e){return!(this.isAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode)||this.isAggregateFilterPresent()&&!this.doAggregateFiltersPass(e.rowNode,e.filterInstanceToSkip))}doesRowPassFilter(e){return!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode)||this.isExternalFilterPresent()&&!this.doesExternalFilterPass(e.rowNode)||this.isColumnFilterPresent()&&!this.doColumnFiltersPass(e.rowNode,e.filterInstanceToSkip)||this.isAdvancedFilterPresent()&&!this.advancedFilterService.doesFilterPass(e.rowNode))}onNewRowsLoaded(e){this.allColumnFilters.forEach((e=>{e.filterPromise.then((e=>{e.onNewRowsLoaded&&e.onNewRowsLoaded()}))})),this.updateFilterFlagInColumns(e,{afterDataChange:!0}),this.updateActiveFilters()}createValueGetter(e){return({node:t})=>this.valueService.getValue(e,t,!0)}createGetValue(e){return(t,i)=>{const s=i?this.columnModel.getGridColumn(i):e;return s?this.valueService.getValue(s,t,!0):void 0}}getFilterComponent(e,t,i=!0){var s;if(i)return(null==(s=this.getOrCreateFilterWrapper(e,t))?void 0:s.filterPromise)||null;const o=this.cachedFilter(e);return o?o.filterPromise:null}isFilterActive(e){const t=this.cachedFilter(e);return!!t&&t.filterPromise.resolveNow(!1,(e=>e.isFilterActive()))}getOrCreateFilterWrapper(e,t){if(!e.isFilterAllowed())return null;let i=this.cachedFilter(e);return i||(i=this.createFilterWrapper(e,t),this.setColumnFilterWrapper(e,i)),i}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e){let t;if(Po.__isRegistered("@ag-grid-enterprise/set-filter",this.context.getGridId()))t="agSetColumnFilter";else{const i=this.dataTypeService.getBaseDataType(e);t="number"===i?"agNumberColumnFilter":"date"===i||"dateString"===i?"agDateColumnFilter":"agTextColumnFilter"}return t}getDefaultFloatingFilter(e){let t;if(Po.__isRegistered("@ag-grid-enterprise/set-filter",this.context.getGridId()))t="agSetColumnFloatingFilter";else{const i=this.dataTypeService.getBaseDataType(e);t="number"===i?"agNumberColumnFloatingFilter":"date"===i||"dateString"===i?"agDateColumnFloatingFilter":"agTextColumnFloatingFilter"}return t}createFilterInstance(e){const t=this.getDefaultFilter(e),i=e.getColDef();let s;const o=_s(Ns({},this.createFilterParams(e,i)),{filterModifiedCallback:()=>this.filterModifiedCallbackFactory(s,e)(),filterChangedCallback:t=>this.filterChangedCallbackFactory(s,e)(t),doesRowPassOtherFilter:e=>this.doesRowPassOtherFilters(s,e)}),n=this.userComponentFactory.getFilterDetails(i,o,t);return n?{filterPromise:()=>{const e=n.newAgStackInstance();return e&&e.then((e=>s=e)),e},compDetails:n}:{filterPromise:null,compDetails:null}}createFilterParams(e,t){return this.gos.addGridCommonParams({column:e,colDef:to(t),rowModel:this.rowModel,filterChangedCallback:()=>{},filterModifiedCallback:()=>{},valueGetter:this.createValueGetter(e),getValue:this.createGetValue(e),doesRowPassOtherFilter:()=>!0})}createFilterWrapper(e,t){var i;const s={column:e,filterPromise:null,compiledElement:null,compDetails:null},{filterPromise:o,compDetails:n}=this.createFilterInstance(e);return s.filterPromise=null!=(i=null==o?void 0:o())?i:null,s.compDetails=n,s}onColumnsChanged(){const e=[];this.allColumnFilters.forEach(((t,i)=>{let s;s=t.column.isPrimary()?this.columnModel.getPrimaryColumn(i):this.columnModel.getGridColumn(i),s&&s===t.column||(e.push(t.column),this.disposeFilterWrapper(t,"columnChanged"),this.disposeColumnListener(i))})),e.length>0?this.onFilterChanged({columns:e,source:"api"}):this.updateDependantFilters()}updateDependantFilters(){const e=this.columnModel.getGroupAutoColumns();null==e||e.forEach((e=>{"agGroupColumnFilter"===e.getColDef().filter&&this.getOrCreateFilterWrapper(e,"NO_UI")}))}isFilterAllowed(e){var t,i;if(this.isAdvancedFilterEnabled())return!1;if(!e.isFilterAllowed())return!1;const s=this.allColumnFilters.get(e.getColId());return null==(i=null==(t=null==s?void 0:s.filterPromise)?void 0:t.resolveNow(!0,(e=>"function"!=typeof(null==e?void 0:e.isFilterAllowed)||(null==e?void 0:e.isFilterAllowed()))))||i}getFloatingFilterCompDetails(e,t){const i=t=>{const i=this.getFilterComponent(e,"NO_UI");null!=i&&i.then((e=>{t(hd(e))}))},s=e.getColDef(),o=_s(Ns({},this.createFilterParams(e,s)),{filterChangedCallback:()=>i((t=>this.filterChangedCallbackFactory(t,e)()))}),n=this.userComponentFactory.mergeParamsWithApplicationProvidedParams(s,Yh,o);let r=this.userComponentFactory.getDefaultFloatingFilterType(s,(()=>this.getDefaultFloatingFilter(e)));null==r&&(r="agReadOnlyFloatingFilter");const a={column:e,filterParams:n,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:i,showParentFilter:t,suppressFilterButton:!1};return this.userComponentFactory.getFloatingFilterCompDetails(s,a,r)}getCurrentFloatingFilterParentModel(e){const t=this.getFilterComponent(e,"NO_UI",!1);return t?t.resolveNow(null,(e=>e&&e.getModel())):null}destroyFilter(e,t="api"){const i=e.getColId(),s=this.allColumnFilters.get(i);this.disposeColumnListener(i),delete this.initialFilterModel[i],s&&(this.disposeFilterWrapper(s,t),this.onFilterChanged({columns:[e],source:"api"}))}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){e.filterPromise.then((i=>{this.getContext().destroyBean(i),e.column.setFilterActive(!1,"filterDestroyed"),this.allColumnFilters.delete(e.column.getColId());const s={type:In.EVENT_FILTER_DESTROYED,source:t,column:e.column};this.eventService.dispatchEvent(s)}))}filterModifiedCallbackFactory(e,t){return()=>{const i={type:In.EVENT_FILTER_MODIFIED,column:t,filterInstance:e};this.eventService.dispatchEvent(i)}}filterChangedCallbackFactory(e,t){return i=>{var s;const o=null!=(s=null==i?void 0:i.source)?s:"api",n={filter:e,additionalEventAttributes:i,columns:[t],source:o};this.callOnFilterChangedOutsideRenderCycle(n)}}checkDestroyFilter(e){const t=this.allColumnFilters.get(e);if(!t)return;const i=t.column,{compDetails:s}=i.isFilterAllowed()?this.createFilterInstance(i):{compDetails:null};if(this.areFilterCompsDifferent(t.compDetails,s))return void this.destroyFilter(i,"paramsUpdated");const o=i.getColDef().filterParams;t.filterPromise?t.filterPromise.then((e=>{!1===(!(null==e?void 0:e.refresh)||e.refresh(Ns(_s(Ns({},this.createFilterParams(i,i.getColDef())),{filterModifiedCallback:this.filterModifiedCallbackFactory(e,i),filterChangedCallback:this.filterChangedCallbackFactory(e,i),doesRowPassOtherFilter:t=>this.doesRowPassOtherFilters(e,t)}),o)))&&this.destroyFilter(i,"paramsUpdated")})):this.destroyFilter(i,"paramsUpdated")}setColumnFilterWrapper(e,t){const i=e.getColId();this.allColumnFilters.set(i,t),this.allColumnListeners.set(i,this.addManagedListener(e,$o.EVENT_COL_DEF_CHANGED,(()=>this.checkDestroyFilter(i))))}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:i}=e,{componentClass:s}=t;return!(i===s||(null==i?void 0:i.render)&&(null==s?void 0:s.render)&&i.render===s.render)}getAdvancedFilterModel(){return this.isAdvancedFilterEnabled()?this.advancedFilterService.getModel():null}setAdvancedFilterModel(e){this.isAdvancedFilterEnabled()&&(this.dataTypeService.isPendingInference()?this.advancedFilterModelUpdateQueue.push(e):(this.advancedFilterService.setModel(null!=e?e:null),this.onFilterChanged({source:"advancedFilter"})))}showAdvancedFilterBuilder(e){this.isAdvancedFilterEnabled()&&this.advancedFilterService.getCtrl().toggleFilterBuilder(e,!0)}updateAdvancedFilterColumns(){this.isAdvancedFilterEnabled()&&this.advancedFilterService.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){return!this.isAdvancedFilterEnabled()&&this.columnModel.getAllGridColumns().some((e=>e.getColDef().floatingFilter))}getFilterInstance(e,t){if(this.isAdvancedFilterEnabled())return void this.warnAdvancedFilters();const i=this.getFilterInstanceImpl(e,(e=>{if(!t)return;const i=hd(e);t(i)}));return hd(i)}getColumnFilterInstance(e){return new Promise((t=>{this.getFilterInstance(e,(e=>{t(e)}))}))}getFilterInstanceImpl(e,t){const i=this.columnModel.getPrimaryColumn(e);if(!i)return;const s=this.getFilterComponent(i,"NO_UI"),o=s&&s.resolveNow(null,(e=>e));return o?setTimeout(t,0,o):s&&s.then((e=>{t(e)})),o}warnAdvancedFilters(){co("Column Filter API methods have been disabled as Advanced Filters are enabled.")}setupAdvancedFilterHeaderComp(e){var t;null==(t=this.advancedFilterService)||t.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvancedFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvancedFilterHeaderActive()?this.advancedFilterService.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){this.filterModelUpdateQueue.forEach((({model:e,source:t})=>this.setFilterModel(e,t))),this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue.forEach((({key:e,model:t,resolve:i})=>{this.setColumnFilterModel(e,t).then((()=>i()))})),this.columnFilterModelUpdateQueue=[],this.advancedFilterModelUpdateQueue.forEach((e=>this.setAdvancedFilterModel(e))),this.advancedFilterModelUpdateQueue=[]}getColumnFilterModel(e){const t=this.getFilterWrapper(e);return t?this.getModelFromFilterWrapper(t):null}setColumnFilterModel(e,t){if(this.isAdvancedFilterEnabled())return this.warnAdvancedFilters(),Promise.resolve();if(this.dataTypeService.isPendingInference()){let i=()=>{};const s=new Promise((e=>{i=e}));return this.columnFilterModelUpdateQueue.push({key:e,model:t,resolve:i}),s}const i=this.columnModel.getPrimaryColumn(e),s=i?this.getOrCreateFilterWrapper(i,"NO_UI"):null;return s?(o=this.setModelOnFilterWrapper(s.filterPromise,t),new Promise((e=>{o.then((t=>e(t)))}))):Promise.resolve();var o}getFilterWrapper(e){var t;const i=this.columnModel.getPrimaryColumn(e);return i&&null!=(t=this.cachedFilter(i))?t:null}destroy(){super.destroy(),this.allColumnFilters.forEach((e=>this.disposeFilterWrapper(e,"gridDestroyed"))),this.allColumnListeners.clear()}};Gs([No("valueService")],pd.prototype,"valueService",2),Gs([No("columnModel")],pd.prototype,"columnModel",2),Gs([No("rowModel")],pd.prototype,"rowModel",2),Gs([No("userComponentFactory")],pd.prototype,"userComponentFactory",2),Gs([No("rowRenderer")],pd.prototype,"rowRenderer",2),Gs([No("dataTypeService")],pd.prototype,"dataTypeService",2),Gs([No("quickFilterService")],pd.prototype,"quickFilterService",2),Gs([_o("advancedFilterService")],pd.prototype,"advancedFilterService",2),Gs([Lo],pd.prototype,"init",1),pd=Gs([Io("filterManager")],pd);var gd=class extends Yl{constructor(e,t){super('<div class="ag-filter"></div>'),this.column=e,this.source=t,this.filterWrapper=null}postConstruct(){this.createFilter(!0),this.addManagedListener(this.eventService,In.EVENT_FILTER_DESTROYED,this.onFilterDestroyed.bind(this))}hasFilter(){return!!this.filterWrapper}getFilter(){var e,t;return null!=(t=null==(e=this.filterWrapper)?void 0:e.filterPromise)?t:null}afterInit(){var e,t,i;return null!=(i=null==(t=null==(e=this.filterWrapper)?void 0:e.filterPromise)?void 0:t.then((()=>{})))?i:Bl.resolve()}afterGuiAttached(e){var t,i;null==(i=null==(t=this.filterWrapper)?void 0:t.filterPromise)||i.then((t=>{var i;null==(i=null==t?void 0:t.afterGuiAttached)||i.call(t,e)}))}afterGuiDetached(){var e,t;null==(t=null==(e=this.filterWrapper)?void 0:e.filterPromise)||t.then((e=>{var t;null==(t=null==e?void 0:e.afterGuiDetached)||t.call(e)}))}createFilter(e){var t;const{column:i,source:s}=this;this.filterWrapper=this.filterManager.getOrCreateFilterWrapper(i,s),(null==(t=this.filterWrapper)?void 0:t.filterPromise)&&this.filterWrapper.filterPromise.then((t=>{let o=t.getGui();if(Bs(o)||console.warn(`AG Grid: getGui method from filter returned ${o}, it should be a DOM element or an HTML template string.`),"string"==typeof o&&(o=Ya(o)),this.appendChild(o),e){const e={type:In.EVENT_FILTER_OPENED,column:i,source:s,eGui:this.getGui()};this.eventService.dispatchEvent(e)}}))}onFilterDestroyed(e){"api"!==e.source&&"paramsUpdated"!==e.source||e.column.getId()!==this.column.getId()||!this.columnModel.getPrimaryColumn(this.column)||(za(this.getGui()),this.createFilter())}destroy(){this.filterWrapper=null,super.destroy()}};Gs([No("filterManager")],gd.prototype,"filterManager",2),Gs([No("columnModel")],gd.prototype,"columnModel",2),Gs([Lo],gd.prototype,"postConstruct",1);var md=class extends Yl{constructor(e,t){super(e),this.ctrl=t}getCtrl(){return this.ctrl}},fd=class e extends md{constructor(t){super(e.TEMPLATE,t)}postConstruct(){const e=this.getGui(),t={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),addOrRemoveBodyCssClass:(e,t)=>this.eFloatingFilterBody.classList.toggle(e,t),setButtonWrapperDisplayed:e=>La(this.eButtonWrapper,e),setCompDetails:e=>this.setCompDetails(e),getFloatingFilterComp:()=>this.compPromise,setWidth:t=>e.style.width=t,setMenuIcon:e=>this.eButtonShowMainFilter.appendChild(e)};this.ctrl.setComp(t,e,this.eButtonShowMainFilter,this.eFloatingFilterBody)}setCompDetails(e){if(!e)return this.destroyFloatingFilterComp(),void(this.compPromise=null);this.compPromise=e.newAgStackInstance(),this.compPromise.then((e=>this.afterCompCreated(e)))}destroyFloatingFilterComp(){this.floatingFilterComp&&(this.eFloatingFilterBody.removeChild(this.floatingFilterComp.getGui()),this.floatingFilterComp=this.destroyBean(this.floatingFilterComp))}afterCompCreated(e){e&&(this.isAlive()?(this.destroyFloatingFilterComp(),this.floatingFilterComp=e,this.eFloatingFilterBody.appendChild(e.getGui()),e.afterGuiAttached&&e.afterGuiAttached()):this.destroyBean(e))}};fd.TEMPLATE='<div class="ag-header-cell ag-floating-filter" role="gridcell">\n <div ref="eFloatingFilterBody" role="presentation"></div>\n <div class="ag-floating-filter-button ag-hidden" ref="eButtonWrapper" role="presentation">\n <button type="button" class="ag-button ag-floating-filter-button-button" ref="eButtonShowMainFilter" tabindex="-1"></button>\n </div>\n </div>',Gs([ql("eFloatingFilterBody")],fd.prototype,"eFloatingFilterBody",2),Gs([ql("eButtonWrapper")],fd.prototype,"eButtonWrapper",2),Gs([ql("eButtonShowMainFilter")],fd.prototype,"eButtonShowMainFilter",2),Gs([Lo],fd.prototype,"postConstruct",1),Gs([xo],fd.prototype,"destroyFloatingFilterComp",1);var Cd=fd,vd=class extends Pn{constructor(e){super(),this.view=e}postConstruct(){this.addManagedPropertyListener("domLayout",this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()}updateLayoutClasses(){const e=this.getDomLayout(),t={autoHeight:"autoHeight"===e,normal:"normal"===e,print:"print"===e},i=t.autoHeight?"ag-layout-auto-height":t.print?"ag-layout-print":"ag-layout-normal";this.view.updateLayoutClasses(i,t)}getDomLayout(){var e;const t=null!=(e=this.gos.get("domLayout"))?e:"normal";return-1===["normal","print","autoHeight"].indexOf(t)?(co(`${t} is not valid for DOM Layout, valid values are 'normal', 'autoHeight', 'print'.`),"normal"):t}};Gs([Lo],vd.prototype,"postConstruct",1);var wd=class extends Pn{constructor(e){super(),this.lastScrollSource=[null,null],this.scrollLeft=-1,this.nextScrollTop=-1,this.scrollTop=-1,this.lastOffsetHeight=-1,this.lastScrollTop=-1,this.eBodyViewport=e,this.resetLastHScrollDebounced=Eo((()=>this.lastScrollSource[1]=null),500),this.resetLastVScrollDebounced=Eo((()=>this.lastScrollSource[0]=null),500)}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.addManagedListener(this.eventService,In.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onDisplayedColumnsWidthChanged.bind(this)),this.ctrlsService.whenReady((e=>{this.centerRowsCtrl=e.center,this.onDisplayedColumnsWidthChanged(),this.addScrollListener()}))}addScrollListener(){const{fakeHScrollComp:e,fakeVScrollComp:t}=this.ctrlsService.getParams();this.addManagedListener(this.centerRowsCtrl.getViewportElement(),"scroll",this.onHScroll.bind(this)),e.onScrollCallback(this.onFakeHScroll.bind(this));const i=this.gos.get("debounceVerticalScrollbar"),s=i?Eo(this.onVScroll.bind(this),100):this.onVScroll.bind(this),o=i?Eo(this.onFakeVScroll.bind(this),100):this.onFakeVScroll.bind(this);this.addManagedListener(this.eBodyViewport,"scroll",s),t.onScrollCallback(o)}onDisplayedColumnsWidthChanged(){this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(e){if(null==this.centerRowsCtrl)return;void 0===e&&(e=this.centerRowsCtrl.getCenterViewportScrollLeft());const t=this.enableRtl?e:-e,{topCenter:i,stickyTopCenter:s,stickyBottomCenter:o,centerHeader:n,bottomCenter:r,fakeHScrollComp:a}=this.ctrlsService.getParams();n.setHorizontalScroll(-t),r.setContainerTranslateX(t),i.setContainerTranslateX(t),s.setContainerTranslateX(t),o.setContainerTranslateX(t);const l=this.centerRowsCtrl.getViewportElement(),u=0===this.lastScrollSource[1];e=Math.abs(e),u?a.setScrollPosition(e):Ua(l,e,this.enableRtl)}isControllingScroll(e,t){return null==this.lastScrollSource[t]?(this.lastScrollSource[t]=e,!0):this.lastScrollSource[t]===e}onFakeHScroll(){this.isControllingScroll(1,1)&&this.onHScrollCommon(1)}onHScroll(){this.isControllingScroll(0,1)&&this.onHScrollCommon(0)}onHScrollCommon(e){const t=this.centerRowsCtrl.getViewportElement(),{scrollLeft:i}=t;if(this.shouldBlockScrollUpdate(1,i,!0))return;let s;s=0===e?Wa(t,this.enableRtl):this.ctrlsService.get("fakeHScrollComp").getScrollPosition(),this.doHorizontalScroll(Math.round(s)),this.resetLastHScrollDebounced()}onFakeVScroll(){this.isControllingScroll(1,0)&&this.onVScrollCommon(1)}onVScroll(){this.isControllingScroll(0,0)&&this.onVScrollCommon(0)}onVScrollCommon(e){let t;t=0===e?this.eBodyViewport.scrollTop:this.ctrlsService.get("fakeVScrollComp").getScrollPosition(),this.shouldBlockScrollUpdate(0,t,!0)||(this.animationFrameService.setScrollTop(t),this.nextScrollTop=t,0===e?this.ctrlsService.get("fakeVScrollComp").setScrollPosition(t):this.eBodyViewport.scrollTop=t,this.gos.get("suppressAnimationFrame")?this.scrollGridIfNeeded():this.animationFrameService.schedule(),this.resetLastVScrollDebounced())}doHorizontalScroll(e){const t=this.ctrlsService.get("fakeHScrollComp").getScrollPosition();this.scrollLeft===e&&e===t||(this.scrollLeft=e,this.fireScrollEvent(1),this.horizontallyScrollHeaderCenterAndFloatingCenter(e),this.centerRowsCtrl.onHorizontalViewportChanged(!0))}fireScrollEvent(e){const t={type:In.EVENT_BODY_SCROLL,direction:1===e?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.eventService.dispatchEvent(t),window.clearTimeout(this.scrollTimer),this.scrollTimer=void 0,this.scrollTimer=window.setTimeout((()=>{const e=_s(Ns({},t),{type:In.EVENT_BODY_SCROLL_END});this.eventService.dispatchEvent(e)}),100)}shouldBlockScrollUpdate(e,t,i=!1){return!(i&&!sa())&&(0===e?this.shouldBlockVerticalScroll(t):this.shouldBlockHorizontalScroll(t))}shouldBlockVerticalScroll(e){const t=Oa(this.eBodyViewport),{scrollHeight:i}=this.eBodyViewport;return e<0||e+t>i}shouldBlockHorizontalScroll(e){const t=this.centerRowsCtrl.getCenterWidth(),{scrollWidth:i}=this.centerRowsCtrl.getViewportElement();if(this.enableRtl&&Ba()){if(e>0)return!0}else if(e<0)return!0;return Math.abs(e)+t>i}redrawRowsAfterScroll(){this.fireScrollEvent(0)}checkScrollLeft(){this.scrollLeft!==this.centerRowsCtrl.getCenterViewportScrollLeft()&&this.onHScrollCommon(0)}scrollGridIfNeeded(){const e=this.scrollTop!=this.nextScrollTop;return e&&(this.scrollTop=this.nextScrollTop,this.redrawRowsAfterScroll()),e}setHorizontalScrollPosition(e,t=!1){const i=this.centerRowsCtrl.getViewportElement().scrollWidth-this.centerRowsCtrl.getCenterWidth();!t&&this.shouldBlockScrollUpdate(1,e)&&(e=this.enableRtl&&Ba()?e>0?0:i:Math.min(Math.max(e,0),i)),Ua(this.centerRowsCtrl.getViewportElement(),Math.abs(e),this.enableRtl),this.doHorizontalScroll(e)}setVerticalScrollPosition(e){this.eBodyViewport.scrollTop=e}getVScrollPosition(){return this.lastScrollTop=this.eBodyViewport.scrollTop,this.lastOffsetHeight=this.eBodyViewport.offsetHeight,{top:this.lastScrollTop,bottom:this.lastScrollTop+this.lastOffsetHeight}}getApproximateVScollPosition(){return this.lastScrollTop>=0&&this.lastOffsetHeight>=0?{top:this.scrollTop,bottom:this.scrollTop+this.lastOffsetHeight}:this.getVScrollPosition()}getHScrollPosition(){return this.centerRowsCtrl.getHScrollPosition()}isHorizontalScrollShowing(){return this.centerRowsCtrl.isHorizontalScrollShowing()}scrollHorizontally(e){const t=this.centerRowsCtrl.getViewportElement().scrollLeft;return this.setHorizontalScrollPosition(t+e),this.centerRowsCtrl.getViewportElement().scrollLeft-t}scrollToTop(){this.eBodyViewport.scrollTop=0}ensureNodeVisible(e,t=null){const i=this.rowModel.getRowCount();let s=-1;for(let t=0;t<i;t++){const i=this.rowModel.getRow(t);if("function"==typeof e){if(i&&e(i)){s=t;break}}else if(e===i||e===i.data){s=t;break}}s>=0&&this.ensureIndexVisible(s,t)}ensureIndexVisible(e,t){if(this.gos.isDomLayout("print"))return;const i=this.paginationProxy.getRowCount();if("number"!=typeof e||e<0||e>=i)return void console.warn("AG Grid: Invalid row index for ensureIndexVisible: "+e);const s=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.getFrameworkOverrides().wrapIncoming((()=>{s||this.paginationProxy.goToPageWithIndex(e);const i=this.ctrlsService.getGridBodyCtrl(),o=i.getStickyTopHeight(),n=i.getStickyBottomHeight(),r=this.paginationProxy.getRow(e);let a;do{const e=r.rowTop,i=r.rowHeight,s=this.paginationProxy.getPixelOffset(),l=r.rowTop-s,u=l+r.rowHeight,h=this.getVScrollPosition(),d=this.heightScaler.getDivStretchOffset(),c=h.top+d,p=h.bottom+d,g=p-c,m=this.heightScaler.getScrollPositionForPixel(l),f=this.heightScaler.getScrollPositionForPixel(u-g),C=Math.min((m+f)/2,l);let v=null;"top"===t?v=m:"bottom"===t?v=f:"middle"===t?v=C:c+o>l?v=m-o:p-n<u&&(v=f+n),null!==v&&(this.setVerticalScrollPosition(v),this.rowRenderer.redraw({afterScroll:!0})),a=e!==r.rowTop||i!==r.rowHeight}while(a);this.animationFrameService.flushAllFrames()}))}ensureColumnVisible(e,t="auto"){const i=this.columnModel.getGridColumn(e);if(!i)return;if(i.isPinned())return;if(!this.columnModel.isColumnDisplayed(i))return;const s=this.getPositionedHorizontalScroll(i,t);this.getFrameworkOverrides().wrapIncoming((()=>{null!==s&&this.centerRowsCtrl.setCenterViewportScrollLeft(s),this.centerRowsCtrl.onHorizontalViewportChanged(),this.animationFrameService.flushAllFrames()}))}setScrollPosition(e,t){this.getFrameworkOverrides().wrapIncoming((()=>{this.centerRowsCtrl.setCenterViewportScrollLeft(t),this.setVerticalScrollPosition(e),this.rowRenderer.redraw({afterScroll:!0}),this.animationFrameService.flushAllFrames()}))}getPositionedHorizontalScroll(e,t){const{columnBeforeStart:i,columnAfterEnd:s}=this.isColumnOutsideViewport(e),o=this.centerRowsCtrl.getCenterWidth()<e.getActualWidth(),n=this.centerRowsCtrl.getCenterWidth(),r=this.enableRtl;let a=(r?i:s)||o,l=r?s:i;"auto"!==t&&(a="start"===t,l="end"===t);const u="middle"===t;if(a||l||u){const{colLeft:t,colMiddle:i,colRight:s}=this.getColumnBounds(e);return u?i-n/2:a?r?s:t:r?t-n:s-n}return null}isColumnOutsideViewport(e){const{start:t,end:i}=this.getViewportBounds(),{colLeft:s,colRight:o}=this.getColumnBounds(e),n=this.enableRtl;return{columnBeforeStart:n?t>o:i<o,columnAfterEnd:n?i<s:t>s}}getColumnBounds(e){const t=this.enableRtl,i=this.columnModel.getBodyContainerWidth(),s=e.getActualWidth(),o=e.getLeft(),n=t?-1:1,r=t?i-o:o;return{colLeft:r,colMiddle:r+s/2*n,colRight:r+s*n}}getViewportBounds(){const e=this.centerRowsCtrl.getCenterWidth(),t=this.centerRowsCtrl.getCenterViewportScrollLeft();return{start:t,end:e+t,width:e}}};Gs([No("ctrlsService")],wd.prototype,"ctrlsService",2),Gs([No("animationFrameService")],wd.prototype,"animationFrameService",2),Gs([No("paginationProxy")],wd.prototype,"paginationProxy",2),Gs([No("rowModel")],wd.prototype,"rowModel",2),Gs([No("rowContainerHeightService")],wd.prototype,"heightScaler",2),Gs([No("rowRenderer")],wd.prototype,"rowRenderer",2),Gs([No("columnModel")],wd.prototype,"columnModel",2),Gs([Lo],wd.prototype,"postConstruct",1);var yd="ag-force-vertical-scroll",Ed=class extends Pn{constructor(){super(...arguments),this.stickyTopHeight=0,this.stickyBottomHeight=0}getScrollFeature(){return this.bodyScrollFeature}getBodyViewportElement(){return this.eBodyViewport}setComp(e,t,i,s,o,n,r){this.comp=e,this.eGridBody=t,this.eBodyViewport=i,this.eTop=s,this.eBottom=o,this.eStickyTop=n,this.eStickyBottom=r,this.setCellTextSelection(this.gos.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",(e=>this.setCellTextSelection(e.currentValue))),this.createManagedBean(new vd(this.comp)),this.bodyScrollFeature=this.createManagedBean(new wd(this.eBodyViewport)),this.addRowDragListener(),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([s,i,o,n,r]),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.filterManager.setupAdvancedFilterHeaderComp(s),this.ctrlsService.register("gridBodyCtrl",this)}getComp(){return this.comp}addEventListeners(){this.addManagedListener(this.eventService,In.EVENT_GRID_COLUMNS_CHANGED,this.onGridColumnsChanged.bind(this)),this.addManagedListener(this.eventService,In.EVENT_SCROLL_VISIBILITY_CHANGED,this.onScrollVisibilityChanged.bind(this)),this.addManagedListener(this.eventService,In.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedListener(this.eventService,In.EVENT_HEADER_HEIGHT_CHANGED,this.onHeaderHeightChanged.bind(this))}addFocusListeners(e){e.forEach((e=>{this.addManagedListener(e,"focusin",(t=>{const{target:i}=t,s=Na(i,"ag-root",e);e.classList.toggle("ag-has-focus",!s)})),this.addManagedListener(e,"focusout",(t=>{const{target:i,relatedTarget:s}=t,o=e.contains(s),n=Na(s,"ag-root",e);Na(i,"ag-root",e)||o&&!n||e.classList.remove("ag-has-focus")}))}))}setColumnMovingCss(e){this.comp.setColumnMovingCss("ag-column-moving",e)}setCellTextSelection(e=!1){this.comp.setCellSelectableCss("ag-selectable",e)}onScrollVisibilityChanged(){const e=this.scrollVisibleService.isVerticalScrollShowing();this.setVerticalScrollPaddingVisible(e),this.setStickyWidth(e),this.setStickyBottomOffsetBottom();const t=`calc(100% + ${(e&&this.gos.getScrollbarWidth()||0)+(da()?16:0)}px)`;this.animationFrameService.requestAnimationFrame((()=>this.comp.setBodyViewportWidth(t)))}onGridColumnsChanged(){const e=this.columnModel.getAllGridColumns();this.comp.setColumnCount(e.length)}disableBrowserDragging(){this.addManagedListener(this.eGridBody,"dragstart",(e=>{if(e.target instanceof HTMLImageElement)return e.preventDefault(),!1}))}addStopEditingWhenGridLosesFocus(){if(!this.gos.get("stopEditingWhenCellsLoseFocus"))return;const e=e=>{const i=e.relatedTarget;if(null===na(i))return void this.rowRenderer.stopEditing();let s=t.some((e=>e.contains(i)))&&this.mouseEventService.isElementInThisGrid(i);if(!s){const e=this.popupService;s=e.getActivePopups().some((e=>e.contains(i)))||e.isElementWithinCustomPopup(i)}s||this.rowRenderer.stopEditing()},t=[this.eBodyViewport,this.eBottom,this.eTop,this.eStickyTop,this.eStickyBottom];t.forEach((t=>this.addManagedListener(t,"focusout",e)))}updateRowCount(){const e=this.headerNavigationService.getHeaderRowCount()+this.filterManager.getHeaderRowCount(),t=this.rowModel.isLastRowIndexKnown()?this.rowModel.getRowCount():-1,i=-1===t?-1:e+t;this.comp.setRowCount(i)}registerBodyViewportResizeListener(e){this.comp.registerBodyViewportResizeListener(e)}setVerticalScrollPaddingVisible(e){const t=e?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(t)}isVerticalScrollShowing(){const e=this.gos.get("alwaysShowVerticalScroll"),t=e?yd:null,i=this.gos.isDomLayout("normal");return this.comp.setAlwaysVerticalScrollClass(t,e),e||i&&el(this.eBodyViewport)}setupRowAnimationCssClass(){const e=()=>{const e=this.gos.isAnimateRows()&&!this.rowContainerHeightService.isStretching(),t=e?"ag-row-animation":"ag-row-no-animation";this.comp.setRowAnimationCssOnBodyViewport(t,e)};e(),this.addManagedListener(this.eventService,In.EVENT_HEIGHT_SCALE_CHANGED,e),this.addManagedPropertyListener("animateRows",e)}getGridBodyElement(){return this.eGridBody}addBodyViewportListener(){const e=this.onBodyViewportContextMenu.bind(this);this.addManagedListener(this.eBodyViewport,"contextmenu",e),this.mockContextMenuForIPad(e),this.addManagedListener(this.eBodyViewport,"wheel",this.onBodyViewportWheel.bind(this)),this.addManagedListener(this.eStickyTop,"wheel",this.onStickyWheel.bind(this)),this.addManagedListener(this.eStickyBottom,"wheel",this.onStickyWheel.bind(this)),this.addFullWidthContainerWheelListener()}addFullWidthContainerWheelListener(){const e=this.eBodyViewport.querySelector(".ag-full-width-container"),t=this.eBodyViewport.querySelector(".ag-center-cols-viewport");e&&t&&this.addManagedListener(e,"wheel",(e=>this.onFullWidthContainerWheel(e,t)))}onFullWidthContainerWheel(e,t){!e.deltaX||Math.abs(e.deltaY)>Math.abs(e.deltaX)||!this.mouseEventService.isEventFromThisGrid(e)||(e.preventDefault(),t.scrollBy({left:e.deltaX}))}onBodyViewportContextMenu(e,t,i){if(!e&&!i)return;this.gos.get("preventDefaultOnContextMenu")&&(e||i).preventDefault();const{target:s}=e||t;s!==this.eBodyViewport&&s!==this.ctrlsService.get("center").getViewportElement()||this.menuService.showContextMenu({mouseEvent:e,touchEvent:i,value:null,anchorToElement:this.eGridBody})}mockContextMenuForIPad(e){if(!sa())return;const t=new zu(this.eBodyViewport);this.addManagedListener(t,zu.EVENT_LONG_TAP,(t=>{e(void 0,t.touchStart,t.touchEvent)})),this.addDestroyFunc((()=>t.destroy()))}onBodyViewportWheel(e){this.gos.get("suppressScrollWhenPopupsAreOpen")&&this.popupService.hasAnchoredPopup()&&e.preventDefault()}onStickyWheel(e){e.preventDefault(),e.offsetY&&this.scrollVertically(e.deltaY)}getGui(){return this.eGridBody}scrollVertically(e){const t=this.eBodyViewport.scrollTop;return this.bodyScrollFeature.setVerticalScrollPosition(t+e),this.eBodyViewport.scrollTop-t}addRowDragListener(){this.rowDragFeature=this.createManagedBean(new rd(this.eBodyViewport)),this.dragAndDropService.addDropTarget(this.rowDragFeature)}getRowDragFeature(){return this.rowDragFeature}onPinnedRowDataChanged(){this.setFloatingHeights()}setFloatingHeights(){const{pinnedRowModel:e}=this;let t=e.getPinnedTopTotalHeight(),i=e.getPinnedBottomTotalHeight();this.comp.setTopHeight(t),this.comp.setBottomHeight(i),this.comp.setTopDisplay(t?"inherit":"none"),this.comp.setBottomDisplay(i?"inherit":"none"),this.setStickyTopOffsetTop(),this.setStickyBottomOffsetBottom()}setStickyTopHeight(e=0){this.comp.setStickyTopHeight(`${e}px`),this.stickyTopHeight=e}getStickyTopHeight(){return this.stickyTopHeight}setStickyBottomHeight(e=0){this.comp.setStickyBottomHeight(`${e}px`),this.stickyBottomHeight=e}getStickyBottomHeight(){return this.stickyBottomHeight}setStickyWidth(e){if(e){const e=this.gos.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${e}px)`),this.comp.setStickyBottomWidth(`calc(100% - ${e}px)`)}else this.comp.setStickyTopWidth("100%"),this.comp.setStickyBottomWidth("100%")}onHeaderHeightChanged(){this.setStickyTopOffsetTop()}setStickyTopOffsetTop(){const e=this.ctrlsService.get("gridHeaderCtrl").getHeaderHeight()+this.filterManager.getHeaderHeight(),t=this.pinnedRowModel.getPinnedTopTotalHeight();let i=0;e>0&&(i+=e),t>0&&(i+=t),i>0&&(i+=1),this.comp.setStickyTopTop(`${i}px`)}setStickyBottomOffsetBottom(){const e=this.pinnedRowModel.getPinnedBottomTotalHeight()+(this.scrollVisibleService.isHorizontalScrollShowing()&&this.gos.getScrollbarWidth()||0);this.comp.setStickyBottomBottom(`${e}px`)}sizeColumnsToFit(e,t){const i=this.isVerticalScrollShowing()?this.gos.getScrollbarWidth():0,s=Ga(this.eGridBody)-i;s>0?this.columnModel.sizeColumnsToFit(s,"sizeColumnsToFit",!1,e):void 0===t?window.setTimeout((()=>{this.sizeColumnsToFit(e,100)}),0):100===t?window.setTimeout((()=>{this.sizeColumnsToFit(e,500)}),100):500===t?window.setTimeout((()=>{this.sizeColumnsToFit(e,-1)}),500):console.warn("AG Grid: tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?")}addScrollEventListener(e){this.eBodyViewport.addEventListener("scroll",e,{passive:!0})}removeScrollEventListener(e){this.eBodyViewport.removeEventListener("scroll",e)}};Gs([No("animationFrameService")],Ed.prototype,"animationFrameService",2),Gs([No("rowContainerHeightService")],Ed.prototype,"rowContainerHeightService",2),Gs([No("ctrlsService")],Ed.prototype,"ctrlsService",2),Gs([No("columnModel")],Ed.prototype,"columnModel",2),Gs([No("scrollVisibleService")],Ed.prototype,"scrollVisibleService",2),Gs([No("menuService")],Ed.prototype,"menuService",2),Gs([No("headerNavigationService")],Ed.prototype,"headerNavigationService",2),Gs([No("dragAndDropService")],Ed.prototype,"dragAndDropService",2),Gs([No("pinnedRowModel")],Ed.prototype,"pinnedRowModel",2),Gs([No("rowRenderer")],Ed.prototype,"rowRenderer",2),Gs([No("popupService")],Ed.prototype,"popupService",2),Gs([No("mouseEventService")],Ed.prototype,"mouseEventService",2),Gs([No("rowModel")],Ed.prototype,"rowModel",2),Gs([No("filterManager")],Ed.prototype,"filterManager",2);var Sd="ag-cell-range-selected",bd=class{constructor(e,t){this.beans=e,this.rangeService=e.rangeService,this.selectionHandleFactory=e.selectionHandleFactory,this.cellCtrl=t}setComp(e,t){this.cellComp=e,this.eGui=t,this.onRangeSelectionChanged()}onRangeSelectionChanged(){this.cellComp&&(this.rangeCount=this.rangeService.getCellRangeCount(this.cellCtrl.getCellPosition()),this.hasChartRange=this.getHasChartRange(),this.cellComp.addOrRemoveCssClass(Sd,0!==this.rangeCount),this.cellComp.addOrRemoveCssClass(`${Sd}-1`,1===this.rangeCount),this.cellComp.addOrRemoveCssClass(`${Sd}-2`,2===this.rangeCount),this.cellComp.addOrRemoveCssClass(`${Sd}-3`,3===this.rangeCount),this.cellComp.addOrRemoveCssClass(`${Sd}-4`,this.rangeCount>=4),this.cellComp.addOrRemoveCssClass("ag-cell-range-chart",this.hasChartRange),Vr(this.eGui,this.rangeCount>0||void 0),this.cellComp.addOrRemoveCssClass("ag-cell-range-single-cell",this.isSingleCell()),this.updateRangeBorders(),this.refreshHandle())}updateRangeBorders(){const e=this.getRangeBorders(),t=this.isSingleCell(),i=!t&&e.top,s=!t&&e.right,o=!t&&e.bottom,n=!t&&e.left;this.cellComp.addOrRemoveCssClass("ag-cell-range-top",i),this.cellComp.addOrRemoveCssClass("ag-cell-range-right",s),this.cellComp.addOrRemoveCssClass("ag-cell-range-bottom",o),this.cellComp.addOrRemoveCssClass("ag-cell-range-left",n)}isSingleCell(){const{rangeService:e}=this.beans;return 1===this.rangeCount&&!!e&&!e.isMoreThanOneCell()}getHasChartRange(){const{rangeService:e}=this.beans;if(!this.rangeCount||!e)return!1;const t=e.getCellRanges();return t.length>0&&t.every((e=>dn([1,0],e.type)))}updateRangeBordersIfRangeCount(){this.rangeCount>0&&(this.updateRangeBorders(),this.refreshHandle())}getRangeBorders(){const e=this.beans.gos.get("enableRtl");let t=!1,i=!1,s=!1,o=!1;const n=this.cellCtrl.getCellPosition().column,r=this.beans.columnModel;let a,l;e?(a=r.getDisplayedColAfter(n),l=r.getDisplayedColBefore(n)):(a=r.getDisplayedColBefore(n),l=r.getDisplayedColAfter(n));const u=this.rangeService.getCellRanges().filter((e=>this.rangeService.isCellInSpecificRange(this.cellCtrl.getCellPosition(),e)));a||(o=!0),l||(i=!0);for(let e=0;e<u.length&&!(t&&i&&s&&o);e++){const n=u[e],r=this.rangeService.getRangeStartRow(n),h=this.rangeService.getRangeEndRow(n);!t&&this.beans.rowPositionUtils.sameRow(r,this.cellCtrl.getCellPosition())&&(t=!0),!s&&this.beans.rowPositionUtils.sameRow(h,this.cellCtrl.getCellPosition())&&(s=!0),!o&&a&&n.columns.indexOf(a)<0&&(o=!0),!i&&l&&n.columns.indexOf(l)<0&&(i=!0)}return{top:t,right:i,bottom:s,left:o}}refreshHandle(){if(this.beans.context.isDestroyed())return;const e=this.shouldHaveSelectionHandle();this.selectionHandle&&!e&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),e&&this.addSelectionHandle(),this.cellComp.addOrRemoveCssClass("ag-cell-range-handle",!!this.selectionHandle)}shouldHaveSelectionHandle(){const e=this.beans.gos,t=this.rangeService.getCellRanges(),i=t.length;if(this.rangeCount<1||i<1)return!1;const s=Jo(t),o=this.cellCtrl.getCellPosition(),n=e.get("enableFillHandle")&&!this.cellCtrl.isSuppressFillHandle(),r=e.get("enableRangeHandle");let a=1===i&&!this.cellCtrl.isEditing()&&(n||r);if(this.hasChartRange){const e=1===t[0].type&&this.rangeService.isCellInSpecificRange(o,t[0]);this.cellComp.addOrRemoveCssClass("ag-cell-range-chart-category",e),a=0===s.type}return a&&null!=s.endRow&&this.rangeService.isContiguousRange(s)&&this.rangeService.isBottomRightCell(s,o)}addSelectionHandle(){const e=this.beans.gos,t=Jo(this.rangeService.getCellRanges()).type,i=e.get("enableFillHandle")&&Ws(t)?0:1;this.selectionHandle&&this.selectionHandle.getType()!==i&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),this.selectionHandle||(this.selectionHandle=this.selectionHandleFactory.createSelectionHandle(i)),this.selectionHandle.refresh(this.cellCtrl)}destroy(){this.beans.context.destroyBean(this.selectionHandle)}},Rd=class extends Pn{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setupRowSpan(){this.rowSpan=this.column.getRowSpan(this.rowNode),this.addManagedListener(this.beans.eventService,In.EVENT_NEW_COLUMNS_LOADED,(()=>this.onNewColumnsLoaded()))}setComp(e){this.eGui=e,this.setupColSpan(),this.setupRowSpan(),this.onLeftChanged(),this.onWidthChanged(),this.applyRowSpan()}onNewColumnsLoaded(){const e=this.column.getRowSpan(this.rowNode);this.rowSpan!==e&&(this.rowSpan=e,this.applyRowSpan(!0))}onDisplayColumnsChanged(){const e=this.getColSpanningList();Zo(this.colsSpanning,e)||(this.colsSpanning=e,this.onWidthChanged(),this.onLeftChanged())}setupColSpan(){null!=this.column.getColDef().colSpan&&(this.colsSpanning=this.getColSpanningList(),this.addManagedListener(this.beans.eventService,In.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayColumnsChanged.bind(this)),this.addManagedListener(this.beans.eventService,In.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onWidthChanged.bind(this)))}onWidthChanged(){if(!this.eGui)return;const e=this.getCellWidth();this.eGui.style.width=`${e}px`}getCellWidth(){return this.colsSpanning?this.colsSpanning.reduce(((e,t)=>e+t.getActualWidth()),0):this.column.getActualWidth()}getColSpanningList(){const e=this.column.getColSpan(this.rowNode),t=[];if(1===e)t.push(this.column);else{let i=this.column;const s=this.column.getPinned();for(let o=0;i&&o<e&&(t.push(i),i=this.beans.columnModel.getDisplayedColAfter(i),i&&!Ws(i))&&s===i.getPinned();o++);}return t}onLeftChanged(){if(!this.eGui)return;const e=this.modifyLeftForPrintLayout(this.getCellLeft());this.eGui.style.left=e+"px"}getCellLeft(){let e;return e=this.beans.gos.get("enableRtl")&&this.colsSpanning?Jo(this.colsSpanning):this.column,e.getLeft()}modifyLeftForPrintLayout(e){if(!this.cellCtrl.isPrintLayout()||"left"===this.column.getPinned())return e;const t=this.beans.columnModel.getDisplayedColumnsLeftWidth();return"right"===this.column.getPinned()?t+this.beans.columnModel.getBodyContainerWidth()+(e||0):t+(e||0)}applyRowSpan(e){if(1===this.rowSpan&&!e)return;const t=this.beans.gos.getRowHeightAsNumber()*this.rowSpan;this.eGui.style.height=`${t}px`,this.eGui.style.zIndex="1"}destroy(){super.destroy()}},Dd=class extends Pn{constructor(e,t){super(),this.staticClasses=[],this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const e=this.column.getColDef(),{cellClassRules:t}=e,i=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,colDef:e,column:this.column,rowIndex:this.rowNode.rowIndex});this.beans.stylingService.processClassRules(t===this.cellClassRules?void 0:this.cellClassRules,t,i,(e=>this.cellComp.addOrRemoveCssClass(e,!0)),(e=>this.cellComp.addOrRemoveCssClass(e,!1))),this.cellClassRules=t}applyUserStyles(){const e=this.column.getColDef();if(!e.cellStyle)return;let t;if("function"==typeof e.cellStyle){const i=this.beans.gos.addGridCommonParams({column:this.column,value:this.cellCtrl.getValue(),colDef:e,data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex});t=(0,e.cellStyle)(i)}else t=e.cellStyle;t&&this.cellComp.setUserStyles(t)}applyClassesFromColDef(){const e=this.column.getColDef(),t=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,column:this.column,colDef:e,rowIndex:this.rowNode.rowIndex});this.staticClasses.length&&this.staticClasses.forEach((e=>this.cellComp.addOrRemoveCssClass(e,!1))),this.staticClasses=this.beans.stylingService.getStaticCellClasses(e,t),this.staticClasses.length&&this.staticClasses.forEach((e=>this.cellComp.addOrRemoveCssClass(e,!0)))}destroy(){super.destroy()}},Td=class{postConstruct(){this.gos.isRowModelType("clientSide")&&(this.clientSideRowModel=this.rowModel),this.gos.isRowModelType("serverSide")&&(this.serverSideRowModel=this.rowModel)}};Gs([No("resizeObserverService")],Td.prototype,"resizeObserverService",2),Gs([No("paginationProxy")],Td.prototype,"paginationProxy",2),Gs([No("context")],Td.prototype,"context",2),Gs([No("gridOptionsService")],Td.prototype,"gos",2),Gs([No("environment")],Td.prototype,"environment",2),Gs([No("rowRenderer")],Td.prototype,"rowRenderer",2),Gs([No("valueService")],Td.prototype,"valueService",2),Gs([No("eventService")],Td.prototype,"eventService",2),Gs([No("columnModel")],Td.prototype,"columnModel",2),Gs([No("headerNavigationService")],Td.prototype,"headerNavigationService",2),Gs([No("navigationService")],Td.prototype,"navigationService",2),Gs([No("columnAnimationService")],Td.prototype,"columnAnimationService",2),Gs([No("focusService")],Td.prototype,"focusService",2),Gs([No("popupService")],Td.prototype,"popupService",2),Gs([No("stylingService")],Td.prototype,"stylingService",2),Gs([No("columnHoverService")],Td.prototype,"columnHoverService",2),Gs([No("userComponentFactory")],Td.prototype,"userComponentFactory",2),Gs([No("userComponentRegistry")],Td.prototype,"userComponentRegistry",2),Gs([No("animationFrameService")],Td.prototype,"animationFrameService",2),Gs([No("dragService")],Td.prototype,"dragService",2),Gs([No("dragAndDropService")],Td.prototype,"dragAndDropService",2),Gs([No("sortController")],Td.prototype,"sortController",2),Gs([No("filterManager")],Td.prototype,"filterManager",2),Gs([No("rowContainerHeightService")],Td.prototype,"rowContainerHeightService",2),Gs([No("frameworkOverrides")],Td.prototype,"frameworkOverrides",2),Gs([No("cellPositionUtils")],Td.prototype,"cellPositionUtils",2),Gs([No("rowPositionUtils")],Td.prototype,"rowPositionUtils",2),Gs([No("selectionService")],Td.prototype,"selectionService",2),Gs([No("rowCssClassCalculator")],Td.prototype,"rowCssClassCalculator",2),Gs([No("rowModel")],Td.prototype,"rowModel",2),Gs([No("ctrlsService")],Td.prototype,"ctrlsService",2),Gs([No("ctrlsFactory")],Td.prototype,"ctrlsFactory",2),Gs([No("agStackComponentsRegistry")],Td.prototype,"agStackComponentsRegistry",2),Gs([No("valueCache")],Td.prototype,"valueCache",2),Gs([No("rowNodeEventThrottle")],Td.prototype,"rowNodeEventThrottle",2),Gs([No("localeService")],Td.prototype,"localeService",2),Gs([No("syncService")],Td.prototype,"syncService",2),Gs([No("ariaAnnouncementService")],Td.prototype,"ariaAnnouncementService",2),Gs([_o("rangeService")],Td.prototype,"rangeService",2),Gs([_o("selectionHandleFactory")],Td.prototype,"selectionHandleFactory",2),Gs([Lo],Td.prototype,"postConstruct",1),Td=Gs([Io("beans")],Td);var Ad=class extends Td{constructor(e,t,i){super(),this.cellCtrl=e,this.beans=t,this.column=i}onMouseEvent(e,t){if(!yn(t))switch(e){case"click":this.onCellClicked(t);break;case"mousedown":case"touchstart":this.onMouseDown(t);break;case"dblclick":this.onCellDoubleClicked(t);break;case"mouseout":this.onMouseOut(t);break;case"mouseover":this.onMouseOver(t)}}onCellClicked(e){if(this.isDoubleClickOnIPad())return this.onCellDoubleClicked(e),void e.preventDefault();const{eventService:t,rangeService:i,gos:s}=this.beans,o=e.ctrlKey||e.metaKey;i&&o&&i.getCellRangeCount(this.cellCtrl.getCellPosition())>1&&i.intersectLastRange(!0);const n=this.cellCtrl.createEvent(e,In.EVENT_CELL_CLICKED);t.dispatchEvent(n);const r=this.column.getColDef();r.onCellClicked&&window.setTimeout((()=>{this.beans.frameworkOverrides.wrapOutgoing((()=>{r.onCellClicked(n)}))}),0),!s.get("singleClickEdit")&&!r.singleClickEdit||s.get("suppressClickEdit")||e.shiftKey&&0!=(null==i?void 0:i.getCellRanges().length)||this.cellCtrl.startRowOrCellEdit()}isDoubleClickOnIPad(){if(!sa()||En("dblclick"))return!1;const e=(new Date).getTime(),t=e-this.lastIPadMouseClickEvent<200;return this.lastIPadMouseClickEvent=e,t}onCellDoubleClicked(e){const t=this.column.getColDef(),i=this.cellCtrl.createEvent(e,In.EVENT_CELL_DOUBLE_CLICKED);this.beans.eventService.dispatchEvent(i),"function"==typeof t.onCellDoubleClicked&&window.setTimeout((()=>{this.beans.frameworkOverrides.wrapOutgoing((()=>{t.onCellDoubleClicked(i)}))}),0),!this.beans.gos.get("singleClickEdit")&&!this.beans.gos.get("suppressClickEdit")&&this.cellCtrl.startRowOrCellEdit(null,e)}onMouseDown(e){const{ctrlKey:t,metaKey:i,shiftKey:s}=e,o=e.target,{cellCtrl:n,beans:r}=this,{eventService:a,rangeService:l,focusService:u}=r;if(this.isRightClickInExistingRange(e))return;const h=l&&0!=l.getCellRanges().length;if(!s||!h){const e=Jr()&&!n.isEditing()&&!Ma(o);n.focusCell(e)}if(s&&h&&!u.isCellFocused(n.getCellPosition())){e.preventDefault();const t=u.getFocusedCell();if(t){const{column:e,rowIndex:i,rowPinned:s}=t,o=r.rowRenderer.getRowByPosition({rowIndex:i,rowPinned:s}),n=null==o?void 0:o.getCellCtrl(e);(null==n?void 0:n.isEditing())&&n.stopEditing(),u.setFocusedCell({column:e,rowIndex:i,rowPinned:s,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}}if(!this.containsWidget(o)){if(l){const e=this.cellCtrl.getCellPosition();if(s)l.extendLatestRangeToCell(e);else{const s=t||i;l.setRangeToCell(e,s)}}a.dispatchEvent(this.cellCtrl.createEvent(e,In.EVENT_CELL_MOUSE_DOWN))}}isRightClickInExistingRange(e){const{rangeService:t}=this.beans;if(t){const i=t.isCellInAnyRange(this.cellCtrl.getCellPosition()),s=2===e.button||e.ctrlKey&&this.beans.gos.get("allowContextMenuWithControlKey");if(i&&s)return!0}return!1}containsWidget(e){return Na(e,"ag-selection-checkbox",3)}onMouseOut(e){if(this.mouseStayingInsideCell(e))return;const t=this.cellCtrl.createEvent(e,In.EVENT_CELL_MOUSE_OUT);this.beans.eventService.dispatchEvent(t),this.beans.columnHoverService.clearMouseOver()}onMouseOver(e){if(this.mouseStayingInsideCell(e))return;const t=this.cellCtrl.createEvent(e,In.EVENT_CELL_MOUSE_OVER);this.beans.eventService.dispatchEvent(t),this.beans.columnHoverService.setMouseOver([this.column])}mouseStayingInsideCell(e){if(!e.target||!e.relatedTarget)return!1;const t=this.cellCtrl.getGui(),i=t.contains(e.target),s=t.contains(e.relatedTarget);return i&&s}destroy(){}},Pd=class extends Pn{constructor(e,t,i,s,o){super(),this.cellCtrl=e,this.beans=t,this.rowNode=s,this.rowCtrl=o}setComp(e){this.eGui=e}onKeyDown(e){const t=e.key;switch(t){case El.ENTER:this.onEnterKeyDown(e);break;case El.F2:this.onF2KeyDown(e);break;case El.ESCAPE:this.onEscapeKeyDown(e);break;case El.TAB:this.onTabKeyDown(e);break;case El.BACKSPACE:case El.DELETE:this.onBackspaceOrDeleteKeyDown(t,e);break;case El.DOWN:case El.UP:case El.RIGHT:case El.LEFT:this.onNavigationKeyDown(e,t)}}onNavigationKeyDown(e,t){this.cellCtrl.isEditing()||(e.shiftKey&&this.cellCtrl.isRangeSelectionEnabled()?this.onShiftRangeSelect(e):this.beans.navigationService.navigateToNextCell(e,t,this.cellCtrl.getCellPosition(),!0),e.preventDefault())}onShiftRangeSelect(e){if(!this.beans.rangeService)return;const t=this.beans.rangeService.extendLatestRangeInDirection(e);t&&this.beans.navigationService.ensureCellVisible(t)}onTabKeyDown(e){this.beans.navigationService.onTabKeyDown(this.cellCtrl,e)}onBackspaceOrDeleteKeyDown(e,t){var i;const{cellCtrl:s,beans:o,rowNode:n}=this,{gos:r,rangeService:a,eventService:l}=o;if(!s.isEditing()){if(l.dispatchEvent({type:In.EVENT_KEY_SHORTCUT_CHANGED_CELL_START}),xl(e,r.get("enableCellEditingOnBackspace"))){if(a&&r.get("enableRangeSelection"))a.clearCellRangeCellValues({dispatchWrapperEvents:!0,wrapperEventSource:"deleteKey"});else if(s.isCellEditable()){const e=s.getColumn(),t=null!=(i=this.beans.valueService.parseValue(e,n,"",n.getValueFromValueService(e)))?i:null;n.setDataValue(e,t,"cellClear")}}else s.startRowOrCellEdit(e,t);l.dispatchEvent({type:In.EVENT_KEY_SHORTCUT_CHANGED_CELL_END})}}onEnterKeyDown(e){if(this.cellCtrl.isEditing()||this.rowCtrl.isEditing())this.cellCtrl.stopEditingAndFocus(!1,e.shiftKey);else if(this.beans.gos.get("enterNavigatesVertically")){const t=e.shiftKey?El.UP:El.DOWN;this.beans.navigationService.navigateToNextCell(null,t,this.cellCtrl.getCellPosition(),!1)}else this.cellCtrl.startRowOrCellEdit(El.ENTER,e),this.cellCtrl.isEditing()&&e.preventDefault()}onF2KeyDown(e){this.cellCtrl.isEditing()||this.cellCtrl.startRowOrCellEdit(El.F2,e)}onEscapeKeyDown(e){this.cellCtrl.isEditing()&&(this.cellCtrl.stopRowOrCellEdit(!0),this.cellCtrl.focusCell(!0))}processCharacter(e){if(e.target!==this.eGui||this.cellCtrl.isEditing())return;const t=e.key;" "===t?this.onSpaceKeyDown(e):(this.cellCtrl.startRowOrCellEdit(t,e),e.preventDefault())}onSpaceKeyDown(e){const{gos:t}=this.beans;if(!this.cellCtrl.isEditing()&&t.isRowSelection()){const i=this.rowNode.isSelected(),s=!i;if(s||!t.get("suppressRowDeselection")){const t=this.beans.gos.get("groupSelectsFiltered"),o=this.rowNode.setSelectedParams({newValue:s,rangeSelect:e.shiftKey,groupSelectsFiltered:t,event:e,source:"spaceKey"});void 0===i&&0===o&&this.rowNode.setSelectedParams({newValue:!1,rangeSelect:e.shiftKey,groupSelectsFiltered:t,event:e,source:"spaceKey"})}}e.preventDefault()}destroy(){super.destroy()}},Fd=class extends Yl{constructor(e,t,i){super('<div class="ag-drag-handle ag-row-drag" draggable="true"></div>'),this.rowNode=e,this.column=t,this.eCell=i}postConstruct(){this.getGui().appendChild(wl("rowDrag",this.gos,null)),this.addGuiEventListener("mousedown",(e=>{e.stopPropagation()})),this.addDragSource(),this.checkVisibility()}addDragSource(){this.addGuiEventListener("dragstart",this.onDragStart.bind(this))}onDragStart(e){const t=this.column.getColDef().dndSourceOnRowDrag;e.dataTransfer.setDragImage(this.eCell,0,0);t?t(this.gos.addGridCommonParams({rowNode:this.rowNode,dragEvent:e})):(()=>{try{const t=JSON.stringify(this.rowNode.data);e.dataTransfer.setData("application/json",t),e.dataTransfer.setData("text/plain",t)}catch(e){}})()}checkVisibility(){const e=this.column.isDndSource(this.rowNode);this.setDisplayed(e)}};Gs([Lo],Fd.prototype,"postConstruct",1);var Md=class{static getHeaderClassesFromColDef(e,t,i,s){return Ws(e)?[]:this.getColumnClassesFromCollDef(e.headerClass,e,t,i,s)}static getToolPanelClassesFromColDef(e,t,i,s){return Ws(e)?[]:this.getColumnClassesFromCollDef(e.toolPanelClass,e,t,i,s)}static refreshFirstAndLastStyles(e,t,i){e.addOrRemoveCssClass("ag-column-first",i.isColumnAtEdge(t,"first")),e.addOrRemoveCssClass("ag-column-last",i.isColumnAtEdge(t,"last"))}static getClassParams(e,t,i,s){return t.addGridCommonParams({colDef:e,column:i,columnGroup:s})}static getColumnClassesFromCollDef(e,t,i,s,o){if(Ws(e))return[];let n;return n="function"==typeof e?e(this.getClassParams(t,i,s,o)):e,"string"==typeof n?[n]:Array.isArray(n)?[...n]:[]}},Ld=0,xd=class e extends Pn{constructor(e,t,i,s){super(),this.cellRangeFeature=null,this.cellPositionFeature=null,this.cellCustomStyleFeature=null,this.tooltipFeature=null,this.cellMouseListenerFeature=null,this.cellKeyboardListenerFeature=null,this.suppressRefreshCell=!1,this.onCellCompAttachedFuncs=[],this.column=e,this.rowNode=t,this.beans=i,this.rowCtrl=s,this.instanceId=e.getId()+"-"+Ld++,this.colIdSanitised=zn(this.column.getId()),i.gos.get("suppressCellFocus")||(this.tabIndex=-1),this.createCellPosition(),this.addFeatures(),this.updateAndFormatValue(!1)}shouldRestoreFocus(){return this.beans.focusService.shouldRestoreFocus(this.cellPosition)}addFeatures(){this.cellPositionFeature=new Rd(this,this.beans),this.addDestroyFunc((()=>{var e;null==(e=this.cellPositionFeature)||e.destroy(),this.cellPositionFeature=null})),this.cellCustomStyleFeature=new Dd(this,this.beans),this.addDestroyFunc((()=>{var e;null==(e=this.cellCustomStyleFeature)||e.destroy(),this.cellCustomStyleFeature=null})),this.cellMouseListenerFeature=new Ad(this,this.beans,this.column),this.addDestroyFunc((()=>{var e;null==(e=this.cellMouseListenerFeature)||e.destroy(),this.cellMouseListenerFeature=null})),this.cellKeyboardListenerFeature=new Pd(this,this.beans,this.column,this.rowNode,this.rowCtrl),this.addDestroyFunc((()=>{var e;null==(e=this.cellKeyboardListenerFeature)||e.destroy(),this.cellKeyboardListenerFeature=null})),this.column.isTooltipEnabled()&&(this.enableTooltipFeature(),this.addDestroyFunc((()=>{this.disableTooltipFeature()}))),this.beans.rangeService&&this.beans.gos.get("enableRangeSelection")&&(this.cellRangeFeature=new bd(this.beans,this),this.addDestroyFunc((()=>{var e;null==(e=this.cellRangeFeature)||e.destroy(),this.cellRangeFeature=null})))}enableTooltipFeature(e,t){const i="whenTruncated"===this.beans.gos.get("tooltipShowMode");t||!i||this.isCellRenderer()||(t=()=>{const e=this.getGui(),t=0===e.children.length?e:e.querySelector(".ag-cell-value");return!t||t.scrollWidth>t.clientWidth});const s={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getRowIndex:()=>this.cellPosition.rowIndex,getRowNode:()=>this.rowNode,getGui:()=>this.getGui(),getLocation:()=>"cell",getTooltipValue:null!=e?()=>e:()=>{const e=this.column.getColDef(),t=this.rowNode.data;if(e.tooltipField&&Bs(t))return no(t,e.tooltipField,this.column.isTooltipFieldContainsDots());const i=e.tooltipValueGetter;return i?i(this.beans.gos.addGridCommonParams({location:"cell",colDef:this.column.getColDef(),column:this.column,rowIndex:this.cellPosition.rowIndex,node:this.rowNode,data:this.rowNode.data,value:this.value,valueFormatted:this.valueFormatted})):null},getValueFormatted:()=>this.valueFormatted,shouldDisplayTooltip:t};this.tooltipFeature=new $l(s,this.beans)}disableTooltipFeature(){this.tooltipFeature&&(this.tooltipFeature.destroy(),this.tooltipFeature=null)}setComp(e,t,i,s,o){var n,r,a,l;this.cellComp=e,this.eGui=t,this.printLayout=s,this.addDomData(),this.onCellFocused(this.focusEventToRestore),this.applyStaticCssClasses(),this.setWrapText(),this.onFirstRightPinnedChanged(),this.onLastLeftPinnedChanged(),this.onColumnHover(),this.setupControlComps(),this.setupAutoHeight(i),this.refreshFirstAndLastStyles(),this.refreshAriaColIndex(),null==(n=this.cellPositionFeature)||n.setComp(t),null==(r=this.cellCustomStyleFeature)||r.setComp(e),null==(a=this.tooltipFeature)||a.refreshToolTip(),null==(l=this.cellKeyboardListenerFeature)||l.setComp(this.eGui),this.cellRangeFeature&&this.cellRangeFeature.setComp(e,t),o&&this.isCellEditable()?this.startEditing():this.showValue(),this.onCellCompAttachedFuncs.length&&(this.onCellCompAttachedFuncs.forEach((e=>e())),this.onCellCompAttachedFuncs=[])}setupAutoHeight(e){if(this.isAutoHeight=this.column.isAutoHeight(),!this.isAutoHeight||!e)return;const t=e.parentElement,i=this.beans.gos.getRowHeightForNode(this.rowNode).height,s=o=>{if(this.editing)return;if(!this.isAlive())return;const{paddingTop:n,paddingBottom:r,borderBottomWidth:a,borderTopWidth:l}=_a(t),u=n+r+a+l,h=e.offsetHeight+u;if(o<5){const t=this.beans.gos.getDocument();if(!t||!t.contains(e)||0==h)return void window.setTimeout((()=>s(o+1)),0)}const d=Math.max(h,i);this.rowNode.setRowAutoHeight(d,this.column)},o=()=>s(0);o();const n=this.beans.resizeObserverService.observeResize(e,o);this.addDestroyFunc((()=>{n(),this.rowNode.setRowAutoHeight(void 0,this.column)}))}getCellAriaRole(){var e;return null!=(e=this.column.getColDef().cellAriaRole)?e:"gridcell"}getInstanceId(){return this.instanceId}getColumnIdSanitised(){return this.colIdSanitised}getTabIndex(){return this.tabIndex}isCellRenderer(){const e=this.column.getColDef();return null!=e.cellRenderer||null!=e.cellRendererSelector}getValueToDisplay(){var e;return null!=(e=this.valueFormatted)?e:this.value}showValue(e=!1){var t;const i=this.getValueToDisplay();let s;if(this.rowNode.stub){const e=this.createCellRendererParams();s=this.beans.userComponentFactory.getLoadingCellRendererDetails(this.column.getColDef(),e)}else if(this.isCellRenderer()){const e=this.createCellRendererParams();s=this.beans.userComponentFactory.getCellRendererDetails(this.column.getColDef(),e)}this.cellComp.setRenderDetails(s,i,e),null==(t=this.cellRangeFeature)||t.refreshHandle()}setupControlComps(){const e=this.column.getColDef();this.includeSelection=this.isIncludeControl(e.checkboxSelection),this.includeRowDrag=this.isIncludeControl(e.rowDrag),this.includeDndSource=this.isIncludeControl(e.dndSource),this.cellComp.setIncludeSelection(this.includeSelection),this.cellComp.setIncludeDndSource(this.includeDndSource),this.cellComp.setIncludeRowDrag(this.includeRowDrag)}isForceWrapper(){return this.beans.gos.get("enableCellTextSelection")||this.column.isAutoHeight()}isIncludeControl(e){return!(null!=this.rowNode.rowPinned||"function"!=typeof e&&!0!==e)}refreshShouldDestroy(){const e=this.column.getColDef(),t=this.includeSelection!=this.isIncludeControl(e.checkboxSelection),i=this.includeRowDrag!=this.isIncludeControl(e.rowDrag),s=this.includeDndSource!=this.isIncludeControl(e.dndSource),o=this.isAutoHeight!=this.column.isAutoHeight();return t||i||s||o}startEditing(e=null,t=!1,i=null){if(!this.isCellEditable()||this.editing)return;if(!this.cellComp)return void this.onCellCompAttachedFuncs.push((()=>{this.startEditing(e,t,i)}));const s=this.createCellEditorParams(e,t),o=this.column.getColDef(),n=this.beans.userComponentFactory.getCellEditorDetails(o,s);this.editCompDetails=n;const r=null!=(null==n?void 0:n.popupFromSelector)?n.popupFromSelector:!!o.cellEditorPopup,a=null!=(null==n?void 0:n.popupPositionFromSelector)?n.popupPositionFromSelector:o.cellEditorPopupPosition;this.setEditing(!0),this.cellComp.setEditDetails(n,r,a,this.beans.gos.get("reactiveCustomComponents"));const l=this.createEvent(i,In.EVENT_CELL_EDITING_STARTED);this.beans.eventService.dispatchEvent(l)}setEditing(e){var t;this.editing!==e&&(this.editing=e,null==(t=this.cellRangeFeature)||t.refreshHandle())}stopRowOrCellEdit(e=!1){"fullRow"===this.beans.gos.get("editType")?this.rowCtrl.stopEditing(e):this.stopEditing(e)}onPopupEditorClosed(){this.isEditing()&&this.stopEditingAndFocus()}takeValueFromCellEditor(e){const t={newValueExists:!1};if(e)return t;const i=this.cellComp.getCellEditor();return i?i.isCancelAfterEnd&&i.isCancelAfterEnd()?t:{newValue:i.getValue(),newValueExists:!0}:t}saveNewValue(e,t){if(t===e)return!1;this.suppressRefreshCell=!0;const i=this.rowNode.setDataValue(this.column,t,"edit");return this.suppressRefreshCell=!1,i}stopEditing(e=!1){if(!this.editing)return!1;const{newValue:t,newValueExists:i}=this.takeValueFromCellEditor(e),s=this.rowNode.getValueFromValueService(this.column);let o=!1;return i&&(o=this.saveNewValue(s,t)),this.setEditing(!1),this.cellComp.setEditDetails(),this.editCompDetails=void 0,this.updateAndFormatValue(!1),this.refreshCell({forceRefresh:!0,suppressFlash:!0}),this.dispatchEditingStoppedEvent(s,t,!e&&!!o),o}dispatchEditingStoppedEvent(e,t,i){const s=_s(Ns({},this.createEvent(null,In.EVENT_CELL_EDITING_STOPPED)),{oldValue:e,newValue:t,valueChanged:i});this.beans.eventService.dispatchEvent(s)}createCellEditorParams(e,t){return this.beans.gos.addGridCommonParams({value:this.rowNode.getValueFromValueService(this.column),eventKey:e,column:this.column,colDef:this.column.getColDef(),rowIndex:this.getCellPosition().rowIndex,node:this.rowNode,data:this.rowNode.data,cellStartedEdit:t,onKeyDown:this.onKeyDown.bind(this),stopEditing:this.stopEditingAndFocus.bind(this),eGridCell:this.getGui(),parseValue:this.parseValue.bind(this),formatValue:this.formatValue.bind(this)})}createCellRendererParams(){const e=this.beans.gos.addGridCommonParams({value:this.value,valueFormatted:this.valueFormatted,getValue:()=>this.rowNode.getValueFromValueService(this.column),setValue:e=>this.beans.valueService.setValue(this.rowNode,this.column,e),formatValue:this.formatValue.bind(this),data:this.rowNode.data,node:this.rowNode,pinned:this.column.getPinned(),colDef:this.column.getColDef(),column:this.column,rowIndex:this.getCellPosition().rowIndex,refreshCell:this.refreshCell.bind(this),eGridCell:this.getGui(),eParentOfValue:this.cellComp.getParentOfValue(),registerRowDragger:(e,t,i,s)=>this.registerRowDragger(e,t,s),setTooltip:(e,t)=>{var i;this.tooltipFeature&&this.disableTooltipFeature(),this.enableTooltipFeature(e,t),null==(i=this.tooltipFeature)||i.refreshToolTip()}});return e}parseValue(e){return this.beans.valueService.parseValue(this.column,this.rowNode,e,this.getValue())}setFocusOutOnEditor(){if(!this.editing)return;const e=this.cellComp.getCellEditor();e&&e.focusOut&&e.focusOut()}setFocusInOnEditor(){if(!this.editing)return;const e=this.cellComp.getCellEditor();e&&e.focusIn?e.focusIn():this.focusCell(!0)}onCellChanged(e){e.column===this.column&&this.refreshCell({})}refreshOrDestroyCell(e){var t;this.refreshShouldDestroy()?null==(t=this.rowCtrl)||t.recreateCell(this):this.refreshCell(e)}refreshCell(e){var t,i,s,o;if(this.suppressRefreshCell||this.editing)return;const n=this.column.getColDef(),r=null!=e&&!!e.newData,a=null!=e&&!!e.suppressFlash||!!n.suppressCellFlash,l=null==n.field&&null==n.valueGetter&&null==n.showRowGroup,u=e&&e.forceRefresh||l||r,h=!!this.cellComp,d=this.updateAndFormatValue(h);if(h){if(u||d){this.showValue(r);const e=this.beans.filterManager.isSuppressFlashingCellsBecauseFiltering();!a&&!e&&(this.beans.gos.get("enableCellChangeFlash")||n.enableCellChangeFlash)&&this.flashCell(),null==(t=this.cellCustomStyleFeature)||t.applyUserStyles(),null==(i=this.cellCustomStyleFeature)||i.applyClassesFromColDef()}null==(s=this.tooltipFeature)||s.refreshToolTip(),null==(o=this.cellCustomStyleFeature)||o.applyCellClassRules()}}stopEditingAndFocus(e=!1,t=!1){this.stopRowOrCellEdit(),this.focusCell(!0),e||this.navigateAfterEdit(t)}navigateAfterEdit(e){if(this.beans.gos.get("enterNavigatesVerticallyAfterEdit")){const t=e?El.UP:El.DOWN;this.beans.navigationService.navigateToNextCell(null,t,this.getCellPosition(),!1)}}flashCell(e){var t,i;const s=null!=(t=null==e?void 0:e.flashDuration)?t:null==e?void 0:e.flashDelay,o=null!=(i=null==e?void 0:e.fadeDuration)?i:null==e?void 0:e.fadeDelay;this.animateCell("data-changed",s,o)}animateCell(e,t,i){if(!this.cellComp)return;const s=`ag-cell-${e}`,o=`ag-cell-${e}-animation`,{gos:n}=this.beans;t||(t=n.get("cellFlashDuration")),Bs(i)||(i=n.get("cellFadeDuration")),this.cellComp.addOrRemoveCssClass(s,!0),this.cellComp.addOrRemoveCssClass(o,!1),this.beans.frameworkOverrides.wrapIncoming((()=>{window.setTimeout((()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(s,!1),this.cellComp.addOrRemoveCssClass(o,!0),this.eGui.style.transition=`background-color ${i}ms`,window.setTimeout((()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(o,!1),this.eGui.style.transition="")}),i))}),t)}))}onFlashCells(e){if(!this.cellComp)return;const t=this.beans.cellPositionUtils.createId(this.getCellPosition());e.cells[t]&&this.animateCell("highlight")}isCellEditable(){return this.column.isCellEditable(this.rowNode)}isSuppressFillHandle(){return this.column.isSuppressFillHandle()}formatValue(e){var t;return null!=(t=this.callValueFormatter(e))?t:e}callValueFormatter(e){return this.beans.valueService.formatValue(this.column,this.rowNode,e)}updateAndFormatValue(e){const t=this.value,i=this.valueFormatted;return this.value=this.rowNode.getValueFromValueService(this.column),this.valueFormatted=this.callValueFormatter(this.value),!e||!this.valuesAreEqual(t,this.value)||this.valueFormatted!=i}valuesAreEqual(e,t){const i=this.column.getColDef();return i.equals?i.equals(e,t):e===t}getComp(){return this.cellComp}getValue(){return this.value}addDomData(){const t=this.getGui();this.beans.gos.setDomData(t,e.DOM_DATA_KEY_CELL_CTRL,this),this.addDestroyFunc((()=>this.beans.gos.setDomData(t,e.DOM_DATA_KEY_CELL_CTRL,null)))}createEvent(e,t){return this.beans.gos.addGridCommonParams({type:t,node:this.rowNode,data:this.rowNode.data,value:this.value,column:this.column,colDef:this.column.getColDef(),rowPinned:this.rowNode.rowPinned,event:e,rowIndex:this.rowNode.rowIndex})}processCharacter(e){var t;null==(t=this.cellKeyboardListenerFeature)||t.processCharacter(e)}onKeyDown(e){var t;null==(t=this.cellKeyboardListenerFeature)||t.onKeyDown(e)}onMouseEvent(e,t){var i;null==(i=this.cellMouseListenerFeature)||i.onMouseEvent(e,t)}getGui(){return this.eGui}getColSpanningList(){return this.cellPositionFeature.getColSpanningList()}onLeftChanged(){var e;this.cellComp&&(null==(e=this.cellPositionFeature)||e.onLeftChanged())}onDisplayedColumnsChanged(){this.eGui&&(this.refreshAriaColIndex(),this.refreshFirstAndLastStyles())}refreshFirstAndLastStyles(){const{cellComp:e,column:t,beans:i}=this;Md.refreshFirstAndLastStyles(e,t,i.columnModel)}refreshAriaColIndex(){const e=this.beans.columnModel.getAriaColumnIndex(this.column);_r(this.getGui(),e)}isSuppressNavigable(){return this.column.isSuppressNavigable(this.rowNode)}onWidthChanged(){var e;return null==(e=this.cellPositionFeature)?void 0:e.onWidthChanged()}getColumn(){return this.column}getRowNode(){return this.rowNode}isPrintLayout(){return this.printLayout}getCellPosition(){return this.cellPosition}isEditing(){return this.editing}startRowOrCellEdit(e,t=null){this.cellComp?"fullRow"===this.beans.gos.get("editType")?this.rowCtrl.startRowEditing(e,this):this.startEditing(e,!0,t):this.onCellCompAttachedFuncs.push((()=>{this.startRowOrCellEdit(e,t)}))}getRowCtrl(){return this.rowCtrl}getRowPosition(){return{rowIndex:this.cellPosition.rowIndex,rowPinned:this.cellPosition.rowPinned}}updateRangeBordersIfRangeCount(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.updateRangeBordersIfRangeCount()}onRangeSelectionChanged(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.onRangeSelectionChanged()}isRangeSelectionEnabled(){return null!=this.cellRangeFeature}focusCell(e=!1){this.beans.focusService.setFocusedCell({rowIndex:this.getCellPosition().rowIndex,column:this.column,rowPinned:this.rowNode.rowPinned,forceBrowserFocus:e})}onRowIndexChanged(){this.createCellPosition(),this.onCellFocused(),this.cellRangeFeature&&this.cellRangeFeature.onRangeSelectionChanged()}onFirstRightPinnedChanged(){if(!this.cellComp)return;const e=this.column.isFirstRightPinned();this.cellComp.addOrRemoveCssClass("ag-cell-first-right-pinned",e)}onLastLeftPinnedChanged(){if(!this.cellComp)return;const e=this.column.isLastLeftPinned();this.cellComp.addOrRemoveCssClass("ag-cell-last-left-pinned",e)}onCellFocused(e){if(this.beans.gos.get("suppressCellFocus"))return;const t=this.beans.focusService.isCellFocused(this.cellPosition);if(!this.cellComp)return void(t&&(null==e?void 0:e.forceBrowserFocus)&&(this.focusEventToRestore=e));this.focusEventToRestore=void 0,this.cellComp.addOrRemoveCssClass("ag-cell-focus",t),t&&e&&e.forceBrowserFocus&&this.cellComp.getFocusableElement().focus({preventScroll:!!e.preventScrollOnBrowserFocus});const i="fullRow"===this.beans.gos.get("editType");t||i||!this.editing||this.stopRowOrCellEdit(),t&&this.rowCtrl.announceDescription()}createCellPosition(){this.cellPosition={rowIndex:this.rowNode.rowIndex,rowPinned:Hs(this.rowNode.rowPinned),column:this.column}}applyStaticCssClasses(){this.cellComp.addOrRemoveCssClass("ag-cell",!0),this.cellComp.addOrRemoveCssClass("ag-cell-not-inline-editing",!0);const e=1==this.column.isAutoHeight();this.cellComp.addOrRemoveCssClass("ag-cell-auto-height",e),this.cellComp.addOrRemoveCssClass("ag-cell-normal-height",!e)}onColumnHover(){if(!this.cellComp)return;if(!this.beans.gos.get("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.cellComp.addOrRemoveCssClass("ag-column-hover",e)}onColDefChanged(){if(this.cellComp)if(this.column.isTooltipEnabled()?(this.disableTooltipFeature(),this.enableTooltipFeature()):this.disableTooltipFeature(),this.setWrapText(),this.editing){const e=this.getCellEditor();if(null==e?void 0:e.refresh){const{eventKey:t,cellStartedEdit:i}=this.editCompDetails.params,s=this.createCellEditorParams(t,i),o=this.column.getColDef(),n=this.beans.userComponentFactory.getCellEditorDetails(o,s);e.refresh(n.params)}}else this.refreshOrDestroyCell({forceRefresh:!0,suppressFlash:!0})}setWrapText(){const e=1==this.column.getColDef().wrapText;this.cellComp.addOrRemoveCssClass("ag-cell-wrap-text",e)}dispatchCellContextMenuEvent(e){const t=this.column.getColDef(),i=this.createEvent(e,In.EVENT_CELL_CONTEXT_MENU);this.beans.eventService.dispatchEvent(i),t.onCellContextMenu&&window.setTimeout((()=>{this.beans.frameworkOverrides.wrapOutgoing((()=>{t.onCellContextMenu(i)}))}),0)}getCellRenderer(){return this.cellComp?this.cellComp.getCellRenderer():null}getCellEditor(){return this.cellComp?this.cellComp.getCellEditor():null}destroy(){this.onCellCompAttachedFuncs=[],super.destroy()}createSelectionCheckbox(){const e=new lh;return this.beans.context.createBean(e),e.init({rowNode:this.rowNode,column:this.column}),e}createDndSource(){const e=new Fd(this.rowNode,this.column,this.eGui);return this.beans.context.createBean(e),e}registerRowDragger(e,t,i){if(this.customRowDragComp)return void this.customRowDragComp.setDragElement(e,t);const s=this.createRowDragComp(e,t,i);s&&(this.customRowDragComp=s,this.addDestroyFunc((()=>{this.beans.context.destroyBean(s),this.customRowDragComp=null})))}createRowDragComp(e,t,i){const s=this.beans.gos.get("pagination"),o=this.beans.gos.get("rowDragManaged"),n=this.beans.gos.isRowModelType("clientSide");if(o){if(!n)return void co("managed row dragging is only allowed in the Client Side Row Model");if(s)return void co("managed row dragging is not possible when doing pagination")}const r=new dh((()=>this.value),this.rowNode,this.column,e,t,i);return this.beans.context.createBean(r),r}};xd.DOM_DATA_KEY_CELL_CTRL="cellCtrl";var Id=xd,Nd=0,_d=class e extends Pn{constructor(e,t,i,s,o){super(),this.allRowGuis=[],this.active=!0,this.centerCellCtrls={list:[],map:{}},this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}},this.slideInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.fadeInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.rowDragComps=[],this.lastMouseDownOnDragger=!1,this.emptyStyle={},this.updateColumnListsPending=!1,this.rowId=null,this.businessKeySanitised=null,this.beans=t,this.gos=t.gos,this.rowNode=e,this.paginationPage=t.paginationProxy.getCurrentPage(),this.useAnimationFrameForCreate=s,this.printLayout=o,this.suppressRowTransform=this.gos.get("suppressRowTransform"),this.instanceId=e.id+"-"+Nd++,this.rowId=zn(e.id),this.initRowBusinessKey(),this.rowFocused=t.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned),this.rowLevel=t.rowCssClassCalculator.calculateRowLevel(this.rowNode),this.setRowType(),this.setAnimateFlags(i),this.rowStyles=this.processStylesFromGridOptions(),this.isFullWidth()&&!this.gos.get("suppressCellFocus")&&(this.tabIndex=-1),this.addListeners()}initRowBusinessKey(){this.businessKeyForNodeFunc=this.gos.get("getBusinessKeyForNode"),this.updateRowBusinessKey()}updateRowBusinessKey(){if("function"!=typeof this.businessKeyForNodeFunc)return;const e=this.businessKeyForNodeFunc(this.rowNode);this.businessKeySanitised=zn(e)}getRowId(){return this.rowId}getRowStyles(){return this.rowStyles}getTabIndex(){return this.tabIndex}isSticky(){return this.rowNode.sticky}getInstanceId(){return this.instanceId}setComp(e,t,i){const s={rowComp:e,element:t,containerType:i};this.allRowGuis.push(s),"left"===i?this.leftGui=s:"right"===i?this.rightGui=s:"fullWidth"===i?this.fullWidthGui=s:this.centerGui=s,this.initialiseRowComp(s),"FullWidthLoading"===this.rowType||this.rowNode.rowPinned||this.beans.rowRenderer.dispatchFirstDataRenderedEvent()}unsetComp(e){switch(this.allRowGuis=this.allRowGuis.filter((t=>t.containerType!==e)),e){case"left":this.leftGui=void 0;break;case"right":this.rightGui=void 0;break;case"fullWidth":this.fullWidthGui=void 0;break;case"center":this.centerGui=void 0}}isCacheable(){return"FullWidthDetail"===this.rowType&&this.gos.get("keepDetailRows")}setCached(e){const t=e?"none":"";this.allRowGuis.forEach((e=>e.element.style.display=t))}initialiseRowComp(t){const i=this.gos;this.listenOnDomOrder(t),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights(),this.onRowHeightChanged(t),this.updateRowIndexes(t),this.setFocusedClasses(t),this.setStylesFromGridOptions(!1,t),i.isRowSelection()&&this.rowNode.selectable&&this.onRowSelected(t),this.updateColumnLists(!this.useAnimationFrameForCreate);const s=t.rowComp;this.getInitialRowClasses(t.containerType).forEach((e=>s.addOrRemoveCssClass(e,!0))),this.executeSlideAndFadeAnimations(t),this.rowNode.group&&Ar(t.element,1==this.rowNode.expanded),this.setRowCompRowId(s),this.setRowCompRowBusinessKey(s),i.setDomData(t.element,e.DOM_DATA_KEY_ROW_CTRL,this),this.addDestroyFunc((()=>i.setDomData(t.element,e.DOM_DATA_KEY_ROW_CTRL,null))),this.useAnimationFrameForCreate?this.beans.animationFrameService.createTask(this.addHoverFunctionality.bind(this,t.element),this.rowNode.rowIndex,"createTasksP2"):this.addHoverFunctionality(t.element),this.isFullWidth()&&this.setupFullWidth(t),i.get("rowDragEntireRow")&&this.addRowDraggerToRow(t),this.useAnimationFrameForCreate&&this.beans.animationFrameService.addDestroyTask((()=>{this.isAlive()&&t.rowComp.addOrRemoveCssClass("ag-after-created",!0)})),this.executeProcessRowPostCreateFunc()}setRowCompRowBusinessKey(e){null!=this.businessKeySanitised&&e.setRowBusinessKey(this.businessKeySanitised)}getBusinessKey(){return this.businessKeySanitised}setRowCompRowId(e){this.rowId=zn(this.rowNode.id),null!=this.rowId&&e.setRowId(this.rowId)}executeSlideAndFadeAnimations(e){const{containerType:t}=e;this.slideInAnimation[t]&&(wo((()=>{this.onTopChanged()})),this.slideInAnimation[t]=!1),this.fadeInAnimation[t]&&(wo((()=>{e.rowComp.addOrRemoveCssClass("ag-opacity-zero",!1)})),this.fadeInAnimation[t]=!1)}addRowDraggerToRow(e){if(this.gos.get("enableRangeSelection"))return void co("Setting `rowDragEntireRow: true` in the gridOptions doesn't work with `enableRangeSelection: true`");const t=this.beans.localeService.getLocaleTextFunc(),i=new dh((()=>`1 ${t("rowDragRow","row")}`),this.rowNode,void 0,e.element,void 0,!0),s=this.createBean(i,this.beans.context);this.rowDragComps.push(s)}setupFullWidth(e){const t=this.getPinnedForContainer(e.containerType);if("FullWidthDetail"==this.rowType&&!Po.__assertRegistered("@ag-grid-enterprise/master-detail","cell renderer 'agDetailCellRenderer' (for master detail)",this.beans.context.getGridId()))return;const i=this.createFullWidthCompDetails(e.element,t);e.rowComp.showFullWidth(i)}isPrintLayout(){return this.printLayout}getFullWidthCellRenderers(){var e,t;return this.gos.get("embedFullWidthRows")?this.allRowGuis.map((e=>{var t;return null==(t=null==e?void 0:e.rowComp)?void 0:t.getFullWidthCellRenderer()})):[null==(t=null==(e=this.fullWidthGui)?void 0:e.rowComp)?void 0:t.getFullWidthCellRenderer()]}getCellElement(e){const t=this.getCellCtrl(e);return t?t.getGui():null}executeProcessRowPostCreateFunc(){const e=this.gos.getCallback("processRowPostCreate");e&&this.areAllContainersReady()&&e({eRow:this.centerGui.element,ePinnedLeftRow:this.leftGui?this.leftGui.element:void 0,ePinnedRightRow:this.rightGui?this.rightGui.element:void 0,node:this.rowNode,rowIndex:this.rowNode.rowIndex,addRenderedRowListener:this.addEventListener.bind(this)})}areAllContainersReady(){const e=!!this.leftGui||!this.beans.columnModel.isPinningLeft(),t=!!this.centerGui,i=!!this.rightGui||!this.beans.columnModel.isPinningRight();return e&&t&&i}setRowType(){const e=this.rowNode.stub&&!this.gos.get("suppressServerSideFullWidthLoadingRow"),t=this.rowNode.isFullWidthCell(),i=this.gos.get("masterDetail")&&this.rowNode.detail,s=this.beans.columnModel.isPivotMode(),o=!!this.rowNode.group&&!this.rowNode.footer&&this.gos.isGroupUseEntireRow(s);this.rowType=e?"FullWidthLoading":i?"FullWidthDetail":t?"FullWidth":o?"FullWidthGroup":"Normal"}updateColumnLists(e=!1,t=!1){this.isFullWidth()||(e||this.gos.get("suppressAnimationFrame")||this.printLayout?this.updateColumnListsImpl(t):this.updateColumnListsPending||(this.beans.animationFrameService.createTask((()=>{this.active&&this.updateColumnListsImpl(!0)}),this.rowNode.rowIndex,"createTasksP1"),this.updateColumnListsPending=!0))}createCellCtrls(e,t,i=null){const s={list:[],map:{}},o=(e,t)=>{s.list.push(t),s.map[e]=t};return t.forEach((t=>{const i=t.getInstanceId();let s=e.map[i];s||(s=new Id(t,this.rowNode,this.beans,this)),o(i,s)})),e.list.forEach((e=>{null==s.map[e.getColumn().getInstanceId()]&&(this.isCellEligibleToBeRemoved(e,i)?e.destroy():o(e.getColumn().getInstanceId(),e))})),s}updateColumnListsImpl(e){this.updateColumnListsPending=!1,this.createAllCellCtrls(),this.setCellCtrls(e)}setCellCtrls(e){this.allRowGuis.forEach((t=>{const i=this.getCellCtrlsForContainer(t.containerType);t.rowComp.setCellCtrls(i,e)}))}getCellCtrlsForContainer(e){switch(e){case"left":return this.leftCellCtrls.list;case"right":return this.rightCellCtrls.list;case"fullWidth":return[];case"center":return this.centerCellCtrls.list;default:throw new Error(`Unhandled case: ${e}`)}}createAllCellCtrls(){const e=this.beans.columnModel;if(this.printLayout)this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,e.getAllDisplayedColumns()),this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}};else{const t=e.getViewportCenterColumnsForRow(this.rowNode);this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,t);const i=e.getDisplayedLeftColumnsForRow(this.rowNode);this.leftCellCtrls=this.createCellCtrls(this.leftCellCtrls,i,"left");const s=e.getDisplayedRightColumnsForRow(this.rowNode);this.rightCellCtrls=this.createCellCtrls(this.rightCellCtrls,s,"right")}}isCellEligibleToBeRemoved(e,t){const i=!0;if(e.getColumn().getPinned()!=t)return i;const s=e.isEditing(),o=this.beans.focusService.isCellFocused(e.getCellPosition());if(s||o){const t=e.getColumn();return!(this.beans.columnModel.getAllDisplayedColumns().indexOf(t)>=0)&&i}return i}getDomOrder(){return this.gos.get("ensureDomOrder")||this.gos.isDomLayout("print")}listenOnDomOrder(e){const t=()=>{e.rowComp.setDomOrder(this.getDomOrder())};this.addManagedPropertyListener("domLayout",t),this.addManagedPropertyListener("ensureDomOrder",t)}setAnimateFlags(e){if(this.isSticky()||!e)return;const t=Bs(this.rowNode.oldRowTop),i=this.beans.columnModel.isPinningLeft(),s=this.beans.columnModel.isPinningRight();if(t){if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows"))return void(this.slideInAnimation.fullWidth=!0);this.slideInAnimation.center=!0,this.slideInAnimation.left=i,this.slideInAnimation.right=s}else{if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows"))return void(this.fadeInAnimation.fullWidth=!0);this.fadeInAnimation.center=!0,this.fadeInAnimation.left=i,this.fadeInAnimation.right=s}}isEditing(){return this.editingRow}isFullWidth(){return"Normal"!==this.rowType}refreshFullWidth(){const e=(e,t)=>!e||e.rowComp.refreshFullWidth((()=>this.createFullWidthCompDetails(e.element,t).params)),t=e(this.fullWidthGui,null),i=e(this.centerGui,null),s=e(this.leftGui,"left"),o=e(this.rightGui,"right");return t&&i&&s&&o}addListeners(){this.addManagedListener(this.rowNode,ah.EVENT_HEIGHT_CHANGED,(()=>this.onRowHeightChanged())),this.addManagedListener(this.rowNode,ah.EVENT_ROW_SELECTED,(()=>this.onRowSelected())),this.addManagedListener(this.rowNode,ah.EVENT_ROW_INDEX_CHANGED,this.onRowIndexChanged.bind(this)),this.addManagedListener(this.rowNode,ah.EVENT_TOP_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(this.rowNode,ah.EVENT_EXPANDED_CHANGED,this.updateExpandedCss.bind(this)),this.addManagedListener(this.rowNode,ah.EVENT_HAS_CHILDREN_CHANGED,this.updateExpandedCss.bind(this)),this.rowNode.detail&&this.addManagedListener(this.rowNode.parent,ah.EVENT_DATA_CHANGED,this.onRowNodeDataChanged.bind(this)),this.addManagedListener(this.rowNode,ah.EVENT_DATA_CHANGED,this.onRowNodeDataChanged.bind(this)),this.addManagedListener(this.rowNode,ah.EVENT_CELL_CHANGED,this.postProcessCss.bind(this)),this.addManagedListener(this.rowNode,ah.EVENT_HIGHLIGHT_CHANGED,this.onRowNodeHighlightChanged.bind(this)),this.addManagedListener(this.rowNode,ah.EVENT_DRAGGING_CHANGED,this.postProcessRowDragging.bind(this)),this.addManagedListener(this.rowNode,ah.EVENT_UI_LEVEL_CHANGED,this.onUiLevelChanged.bind(this));const e=this.beans.eventService;this.addManagedListener(e,In.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED,this.onPaginationPixelOffsetChanged.bind(this)),this.addManagedListener(e,In.EVENT_HEIGHT_SCALE_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(e,In.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(e,In.EVENT_VIRTUAL_COLUMNS_CHANGED,this.onVirtualColumnsChanged.bind(this)),this.addManagedListener(e,In.EVENT_CELL_FOCUSED,this.onCellFocusChanged.bind(this)),this.addManagedListener(e,In.EVENT_CELL_FOCUS_CLEARED,this.onCellFocusChanged.bind(this)),this.addManagedListener(e,In.EVENT_PAGINATION_CHANGED,this.onPaginationChanged.bind(this)),this.addManagedListener(e,In.EVENT_MODEL_UPDATED,this.refreshFirstAndLastRowStyles.bind(this)),this.addManagedListener(e,In.EVENT_COLUMN_MOVED,this.updateColumnLists.bind(this)),this.addDestroyFunc((()=>{this.destroyBeans(this.rowDragComps,this.beans.context),this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature,this.beans.context))})),this.addManagedPropertyListeners(["rowDragEntireRow"],(()=>{this.gos.get("rowDragEntireRow")?this.allRowGuis.forEach((e=>{this.addRowDraggerToRow(e)})):(this.destroyBeans(this.rowDragComps,this.beans.context),this.rowDragComps=[])})),this.addListenersForCellComps()}addListenersForCellComps(){this.addManagedListener(this.rowNode,ah.EVENT_ROW_INDEX_CHANGED,(()=>{this.getAllCellCtrls().forEach((e=>e.onRowIndexChanged()))})),this.addManagedListener(this.rowNode,ah.EVENT_CELL_CHANGED,(e=>{this.getAllCellCtrls().forEach((t=>t.onCellChanged(e)))}))}onRowNodeDataChanged(e){this.isFullWidth()!==!!this.rowNode.isFullWidthCell()?this.beans.rowRenderer.redrawRow(this.rowNode):this.isFullWidth()?this.refreshFullWidth()||this.beans.rowRenderer.redrawRow(this.rowNode):(this.getAllCellCtrls().forEach((t=>t.refreshCell({suppressFlash:!e.update,newData:!e.update}))),this.allRowGuis.forEach((e=>{this.setRowCompRowId(e.rowComp),this.updateRowBusinessKey(),this.setRowCompRowBusinessKey(e.rowComp)})),this.onRowSelected(),this.postProcessCss())}postProcessCss(){this.setStylesFromGridOptions(!0),this.postProcessClassesFromGridOptions(),this.postProcessRowClassRules(),this.postProcessRowDragging()}onRowNodeHighlightChanged(){const e=this.rowNode.highlighted;this.allRowGuis.forEach((t=>{const i=0===e,s=1===e;t.rowComp.addOrRemoveCssClass("ag-row-highlight-above",i),t.rowComp.addOrRemoveCssClass("ag-row-highlight-below",s)}))}postProcessRowDragging(){const e=this.rowNode.dragging;this.allRowGuis.forEach((t=>t.rowComp.addOrRemoveCssClass("ag-row-dragging",e)))}updateExpandedCss(){const e=this.rowNode.isExpandable(),t=1==this.rowNode.expanded;this.allRowGuis.forEach((i=>{i.rowComp.addOrRemoveCssClass("ag-row-group",e),i.rowComp.addOrRemoveCssClass("ag-row-group-expanded",e&&t),i.rowComp.addOrRemoveCssClass("ag-row-group-contracted",e&&!t),Ar(i.element,e&&t)}))}onDisplayedColumnsChanged(){this.updateColumnLists(!0),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights()}onVirtualColumnsChanged(){this.updateColumnLists(!1,!0)}getRowPosition(){return{rowPinned:Hs(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}}onKeyboardNavigate(e){const t=this.allRowGuis.find((t=>t.element.contains(e.target)));if((t?t.element:null)!==e.target)return;const i=this.rowNode,s=this.beans.focusService.getFocusedCell(),o={rowIndex:i.rowIndex,rowPinned:i.rowPinned,column:s&&s.column};this.beans.navigationService.navigateToNextCell(e,e.key,o,!0),e.preventDefault()}onTabKeyDown(e){if(e.defaultPrevented||yn(e))return;const t=this.allRowGuis.find((t=>t.element.contains(e.target))),i=t?t.element:null,s=i===e.target;let o=null;s||(o=this.beans.focusService.findNextFocusableElement(i,!1,e.shiftKey)),(this.isFullWidth()&&s||!o)&&this.beans.navigationService.onTabKeyDown(this,e)}getFullWidthElement(){return this.fullWidthGui?this.fullWidthGui.element:null}getRowYPosition(){var e;const t=null==(e=this.allRowGuis.find((e=>ja(e.element))))?void 0:e.element;return t?t.getBoundingClientRect().top:0}onFullWidthRowFocused(e){var t;const i=this.rowNode,s=!!e&&this.isFullWidth()&&e.rowIndex===i.rowIndex&&e.rowPinned==i.rowPinned,o=this.fullWidthGui?this.fullWidthGui.element:null==(t=this.centerGui)?void 0:t.element;o&&(o.classList.toggle("ag-full-width-focus",s),s&&o.focus({preventScroll:!0}))}recreateCell(e){this.centerCellCtrls=this.removeCellCtrl(this.centerCellCtrls,e),this.leftCellCtrls=this.removeCellCtrl(this.leftCellCtrls,e),this.rightCellCtrls=this.removeCellCtrl(this.rightCellCtrls,e),e.destroy(),this.updateColumnLists()}removeCellCtrl(e,t){const i={list:[],map:{}};return e.list.forEach((e=>{e!==t&&(i.list.push(e),i.map[e.getColumn().getInstanceId()]=e)})),i}onMouseEvent(e,t){switch(e){case"dblclick":this.onRowDblClick(t);break;case"click":this.onRowClick(t);break;case"touchstart":case"mousedown":this.onRowMouseDown(t)}}createRowEvent(e,t){return this.gos.addGridCommonParams({type:e,node:this.rowNode,data:this.rowNode.data,rowIndex:this.rowNode.rowIndex,rowPinned:this.rowNode.rowPinned,event:t})}createRowEventWithSource(e,t){const i=this.createRowEvent(e,t);return i.source=this,i}onRowDblClick(e){if(yn(e))return;const t=this.createRowEventWithSource(In.EVENT_ROW_DOUBLE_CLICKED,e);this.beans.eventService.dispatchEvent(t)}onRowMouseDown(e){if(this.lastMouseDownOnDragger=Na(e.target,"ag-row-drag",3),!this.isFullWidth())return;const t=this.rowNode,i=this.beans.columnModel;this.beans.rangeService&&this.beans.rangeService.removeAllCellRanges(),this.beans.focusService.setFocusedCell({rowIndex:t.rowIndex,column:i.getAllDisplayedColumns()[0],rowPinned:t.rowPinned,forceBrowserFocus:!0})}onRowClick(e){if(yn(e)||this.lastMouseDownOnDragger)return;const t=this.createRowEventWithSource(In.EVENT_ROW_CLICKED,e);this.beans.eventService.dispatchEvent(t);const i=e.ctrlKey||e.metaKey,s=e.shiftKey;if(this.gos.get("groupSelectsChildren")&&this.rowNode.group||this.isRowSelectionBlocked()||this.gos.get("suppressRowClickSelection"))return;const o=this.gos.get("rowMultiSelectWithClick"),n=!this.gos.get("suppressRowDeselection"),r="rowClicked";if(this.rowNode.isSelected())o?this.rowNode.setSelectedParams({newValue:!1,event:e,source:r}):i?n&&this.rowNode.setSelectedParams({newValue:!1,event:e,source:r}):this.rowNode.setSelectedParams({newValue:!0,clearSelection:!s,rangeSelect:s,event:e,source:r});else{const t=!o&&!i;this.rowNode.setSelectedParams({newValue:!0,clearSelection:t,rangeSelect:s,event:e,source:r})}}isRowSelectionBlocked(){return!this.rowNode.selectable||!!this.rowNode.rowPinned||!this.gos.isRowSelection()}setupDetailRowAutoHeight(e){if("FullWidthDetail"!==this.rowType)return;if(!this.gos.get("detailRowAutoHeight"))return;const t=()=>{const t=e.clientHeight;if(null!=t&&t>0){const e=()=>{this.rowNode.setRowHeight(t),this.beans.clientSideRowModel?this.beans.clientSideRowModel.onRowHeightChanged():this.beans.serverSideRowModel&&this.beans.serverSideRowModel.onRowHeightChanged()};window.setTimeout(e,0)}},i=this.beans.resizeObserverService.observeResize(e,t);this.addDestroyFunc(i),t()}createFullWidthCompDetails(e,t){const i=this.gos.addGridCommonParams({fullWidth:!0,data:this.rowNode.data,node:this.rowNode,value:this.rowNode.key,valueFormatted:this.rowNode.key,rowIndex:this.rowNode.rowIndex,eGridCell:e,eParentOfValue:e,pinned:t,addRenderedRowListener:this.addEventListener.bind(this),registerRowDragger:(e,t,i,s)=>this.addFullWidthRowDragging(e,t,i,s),setTooltip:(e,t)=>this.refreshRowTooltip(e,t)});switch(this.rowType){case"FullWidthDetail":return this.beans.userComponentFactory.getFullWidthDetailCellRendererDetails(i);case"FullWidthGroup":return this.beans.userComponentFactory.getFullWidthGroupCellRendererDetails(i);case"FullWidthLoading":return this.beans.userComponentFactory.getFullWidthLoadingCellRendererDetails(i);default:return this.beans.userComponentFactory.getFullWidthCellRendererDetails(i)}}refreshRowTooltip(e,t){if(!this.fullWidthGui)return;const i={getGui:()=>this.fullWidthGui.element,getTooltipValue:()=>e,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:t};this.tooltipFeature&&this.destroyBean(this.tooltipFeature,this.beans.context),this.tooltipFeature=this.createBean(new $l(i,this.beans))}addFullWidthRowDragging(e,t,i="",s){if(!this.isFullWidth())return;const o=new dh((()=>i),this.rowNode,void 0,e,t,s);this.createBean(o,this.beans.context),this.addDestroyFunc((()=>{this.destroyBean(o,this.beans.context)}))}onUiLevelChanged(){const e=this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode);if(this.rowLevel!=e){const t="ag-row-level-"+e,i="ag-row-level-"+this.rowLevel;this.allRowGuis.forEach((e=>{e.rowComp.addOrRemoveCssClass(t,!0),e.rowComp.addOrRemoveCssClass(i,!1)}))}this.rowLevel=e}isFirstRowOnPage(){return this.rowNode.rowIndex===this.beans.paginationProxy.getPageFirstRow()}isLastRowOnPage(){return this.rowNode.rowIndex===this.beans.paginationProxy.getPageLastRow()}refreshFirstAndLastRowStyles(){const e=this.isFirstRowOnPage(),t=this.isLastRowOnPage();this.firstRowOnPage!==e&&(this.firstRowOnPage=e,this.allRowGuis.forEach((t=>t.rowComp.addOrRemoveCssClass("ag-row-first",e)))),this.lastRowOnPage!==t&&(this.lastRowOnPage=t,this.allRowGuis.forEach((e=>e.rowComp.addOrRemoveCssClass("ag-row-last",t))))}stopEditing(e=!1){if(this.stoppingRowEdit)return;const t=this.getAllCellCtrls(),i=this.editingRow;this.stoppingRowEdit=!0;let s=!1;for(const o of t){const t=o.stopEditing(e);i&&!e&&!s&&t&&(s=!0)}if(s){const e=this.createRowEvent(In.EVENT_ROW_VALUE_CHANGED);this.beans.eventService.dispatchEvent(e)}i&&this.setEditingRow(!1),this.stoppingRowEdit=!1}setInlineEditingCss(e){this.allRowGuis.forEach((t=>{t.rowComp.addOrRemoveCssClass("ag-row-inline-editing",e),t.rowComp.addOrRemoveCssClass("ag-row-not-inline-editing",!e)}))}setEditingRow(e){this.editingRow=e,this.allRowGuis.forEach((t=>t.rowComp.addOrRemoveCssClass("ag-row-editing",e)));const t=e?this.createRowEvent(In.EVENT_ROW_EDITING_STARTED):this.createRowEvent(In.EVENT_ROW_EDITING_STOPPED);this.beans.eventService.dispatchEvent(t)}startRowEditing(e=null,t=null,i=null){this.editingRow||this.getAllCellCtrls().reduce(((s,o)=>{const n=o===t;return n?o.startEditing(e,n,i):o.startEditing(null,n,i),!!s||o.isEditing()}),!1)&&this.setEditingRow(!0)}getAllCellCtrls(){return 0===this.leftCellCtrls.list.length&&0===this.rightCellCtrls.list.length?this.centerCellCtrls.list:[...this.centerCellCtrls.list,...this.leftCellCtrls.list,...this.rightCellCtrls.list]}postProcessClassesFromGridOptions(){const e=this.beans.rowCssClassCalculator.processClassesFromGridOptions(this.rowNode);e&&e.length&&e.forEach((e=>{this.allRowGuis.forEach((t=>t.rowComp.addOrRemoveCssClass(e,!0)))}))}postProcessRowClassRules(){this.beans.rowCssClassCalculator.processRowClassRules(this.rowNode,(e=>{this.allRowGuis.forEach((t=>t.rowComp.addOrRemoveCssClass(e,!0)))}),(e=>{this.allRowGuis.forEach((t=>t.rowComp.addOrRemoveCssClass(e,!1)))}))}setStylesFromGridOptions(e,t){e&&(this.rowStyles=this.processStylesFromGridOptions()),this.forEachGui(t,(e=>e.rowComp.setUserStyles(this.rowStyles)))}getPinnedForContainer(e){return"left"===e?"left":"right"===e?"right":null}getInitialRowClasses(e){const t=this.getPinnedForContainer(e),i={rowNode:this.rowNode,rowFocused:this.rowFocused,fadeRowIn:this.fadeInAnimation[e],rowIsEven:this.rowNode.rowIndex%2==0,rowLevel:this.rowLevel,fullWidthRow:this.isFullWidth(),firstRowOnPage:this.isFirstRowOnPage(),lastRowOnPage:this.isLastRowOnPage(),printLayout:this.printLayout,expandable:this.rowNode.isExpandable(),pinned:t};return this.beans.rowCssClassCalculator.getInitialRowClasses(i)}processStylesFromGridOptions(){const e=this.gos.get("rowStyle");if(e&&"function"==typeof e)return void console.warn("AG Grid: rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead");const t=this.gos.getCallback("getRowStyle");let i;return t&&(i=t({data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex})),i||e?Object.assign({},e,i):this.emptyStyle}onRowSelected(e){const t=!!this.rowNode.isSelected();this.forEachGui(e,(e=>{e.rowComp.addOrRemoveCssClass("ag-row-selected",t),Vr(e.element,t),!e.element.contains(this.beans.gos.getActiveDomElement())||e!==this.centerGui&&e!==this.fullWidthGui||this.announceDescription()}))}announceDescription(){if(this.isRowSelectionBlocked())return;const e=this.rowNode.isSelected();if(e&&this.beans.gos.get("suppressRowDeselection"))return;const t=this.beans.localeService.getLocaleTextFunc()(e?"ariaRowDeselect":"ariaRowSelect",`Press SPACE to ${e?"deselect":"select"} this row.`);this.beans.ariaAnnouncementService.announceValue(t)}addHoverFunctionality(e){this.active&&(this.addManagedListener(e,"mouseenter",(()=>this.rowNode.onMouseEnter())),this.addManagedListener(e,"mouseleave",(()=>this.rowNode.onMouseLeave())),this.addManagedListener(this.rowNode,ah.EVENT_MOUSE_ENTER,(()=>{this.beans.dragService.isDragging()||this.gos.get("suppressRowHoverHighlight")||(e.classList.add("ag-row-hover"),this.rowNode.setHovered(!0))})),this.addManagedListener(this.rowNode,ah.EVENT_MOUSE_LEAVE,(()=>{e.classList.remove("ag-row-hover"),this.rowNode.setHovered(!1)})))}roundRowTopToBounds(e){const t=this.beans.ctrlsService.getGridBodyCtrl().getScrollFeature().getApproximateVScollPosition(),i=this.applyPaginationOffset(t.top,!0)-100,s=this.applyPaginationOffset(t.bottom,!0)+100;return Math.min(Math.max(i,e),s)}getFrameworkOverrides(){return this.beans.frameworkOverrides}forEachGui(e,t){e?t(e):this.allRowGuis.forEach(t)}onRowHeightChanged(e){if(null==this.rowNode.rowHeight)return;const t=this.rowNode.rowHeight,i=this.beans.environment.getDefaultRowHeight(),s=this.gos.isGetRowHeightFunction()?this.gos.getRowHeightForNode(this.rowNode).height:void 0,o=s?Math.min(i,s)-2+"px":void 0;this.forEachGui(e,(e=>{e.element.style.height=`${t}px`,o&&e.element.style.setProperty("--ag-line-height",o)}))}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}destroyFirstPass(e=!1){if(this.active=!1,!e&&this.gos.isAnimateRows()&&!this.isSticky())if(null!=this.rowNode.rowTop){const e=this.roundRowTopToBounds(this.rowNode.rowTop);this.setRowTop(e)}else this.allRowGuis.forEach((e=>e.rowComp.addOrRemoveCssClass("ag-opacity-zero",!0)));this.rowNode.setHovered(!1);const t=this.createRowEvent(In.EVENT_VIRTUAL_ROW_REMOVED);this.dispatchEvent(t),this.beans.eventService.dispatchEvent(t),super.destroy()}destroySecondPass(){this.allRowGuis.length=0,this.stopEditing();const e=e=>(e.list.forEach((e=>e.destroy())),{list:[],map:{}});this.centerCellCtrls=e(this.centerCellCtrls),this.leftCellCtrls=e(this.leftCellCtrls),this.rightCellCtrls=e(this.rightCellCtrls)}setFocusedClasses(e){this.forEachGui(e,(e=>{e.rowComp.addOrRemoveCssClass("ag-row-focus",this.rowFocused),e.rowComp.addOrRemoveCssClass("ag-row-no-focus",!this.rowFocused)}))}onCellFocusChanged(){const e=this.beans.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);e!==this.rowFocused&&(this.rowFocused=e,this.setFocusedClasses()),!e&&this.editingRow&&this.stopEditing(!1)}onPaginationChanged(){const e=this.beans.paginationProxy.getCurrentPage();this.paginationPage!==e&&(this.paginationPage=e,this.onTopChanged()),this.refreshFirstAndLastRowStyles()}onTopChanged(){this.setRowTop(this.rowNode.rowTop)}onPaginationPixelOffsetChanged(){this.onTopChanged()}applyPaginationOffset(e,t=!1){return this.rowNode.isRowPinned()||this.rowNode.sticky?e:e+this.beans.paginationProxy.getPixelOffset()*(t?1:-1)}setRowTop(e){if(!this.printLayout&&Bs(e)){const t=this.applyPaginationOffset(e),i=`${this.rowNode.isRowPinned()||this.rowNode.sticky?t:this.beans.rowContainerHeightService.getRealPixelPosition(t)}px`;this.setRowTopStyle(i)}}getInitialRowTop(e){return this.suppressRowTransform?this.getInitialRowTopShared(e):void 0}getInitialTransform(e){return this.suppressRowTransform?void 0:`translateY(${this.getInitialRowTopShared(e)})`}getInitialRowTopShared(e){if(this.printLayout)return"";let t;if(this.isSticky())t=this.rowNode.stickyRowTop;else{const i=this.slideInAnimation[e]?this.roundRowTopToBounds(this.rowNode.oldRowTop):this.rowNode.rowTop,s=this.applyPaginationOffset(i);t=this.rowNode.isRowPinned()?s:this.beans.rowContainerHeightService.getRealPixelPosition(s)}return t+"px"}setRowTopStyle(e){this.allRowGuis.forEach((t=>this.suppressRowTransform?t.rowComp.setTop(e):t.rowComp.setTransform(`translateY(${e})`)))}getRowNode(){return this.rowNode}getCellCtrl(e){let t=null;return this.getAllCellCtrls().forEach((i=>{i.getColumn()==e&&(t=i)})),null!=t||this.getAllCellCtrls().forEach((i=>{i.getColSpanningList().indexOf(e)>=0&&(t=i)})),t}onRowIndexChanged(){null!=this.rowNode.rowIndex&&(this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss())}getRowIndex(){return this.rowNode.getRowIndexString()}updateRowIndexes(e){const t=this.rowNode.getRowIndexString(),i=this.beans.headerNavigationService.getHeaderRowCount()+this.beans.filterManager.getHeaderRowCount(),s=this.rowNode.rowIndex%2==0,o=i+this.rowNode.rowIndex+1;this.forEachGui(e,(e=>{e.rowComp.setRowIndex(t),e.rowComp.addOrRemoveCssClass("ag-row-even",s),e.rowComp.addOrRemoveCssClass("ag-row-odd",!s),Ir(e.element,o)}))}};_d.DOM_DATA_KEY_ROW_CTRL="renderedRow";var Od=_d,Gd=class extends Pn{constructor(e){super(),this.element=e}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.mockContextMenuForIPad()}addKeyboardListeners(){const e="keydown",t=this.processKeyboardEvent.bind(this,e);this.addManagedListener(this.element,e,t)}addMouseListeners(){["dblclick","contextmenu","mouseover","mouseout","click",En("touchstart")?"touchstart":"mousedown"].forEach((e=>{const t=this.processMouseEvent.bind(this,e);this.addManagedListener(this.element,e,t)}))}processMouseEvent(e,t){if(!this.mouseEventService.isEventFromThisGrid(t)||yn(t))return;const i=this.getRowForEvent(t),s=this.mouseEventService.getRenderedCellForEvent(t);"contextmenu"===e?this.handleContextMenuMouseEvent(t,void 0,i,s):(s&&s.onMouseEvent(e,t),i&&i.onMouseEvent(e,t))}mockContextMenuForIPad(){if(!sa())return;const e=new zu(this.element);this.addManagedListener(e,zu.EVENT_LONG_TAP,(e=>{const t=this.getRowForEvent(e.touchEvent),i=this.mouseEventService.getRenderedCellForEvent(e.touchEvent);this.handleContextMenuMouseEvent(void 0,e.touchEvent,t,i)})),this.addDestroyFunc((()=>e.destroy()))}getRowForEvent(e){let t=e.target;for(;t;){const e=this.gos.getDomData(t,Od.DOM_DATA_KEY_ROW_CTRL);if(e)return e;t=t.parentElement}return null}handleContextMenuMouseEvent(e,t,i,s){const o=i?i.getRowNode():null,n=s?s.getColumn():null;let r=null;if(n){const i=e||t;s.dispatchCellContextMenuEvent(null!=i?i:null),r=this.valueService.getValue(n,o)}const a=this.ctrlsService.getGridBodyCtrl(),l=s?s.getGui():a.getGridBodyElement();this.menuService.showContextMenu({mouseEvent:e,touchEvent:t,rowNode:o,column:n,value:r,anchorToElement:l})}getControlsForEventTarget(e){return{cellCtrl:Sn(this.gos,e,Id.DOM_DATA_KEY_CELL_CTRL),rowCtrl:Sn(this.gos,e,Od.DOM_DATA_KEY_ROW_CTRL)}}processKeyboardEvent(e,t){const{cellCtrl:i,rowCtrl:s}=this.getControlsForEventTarget(t.target);t.defaultPrevented||(i?this.processCellKeyboardEvent(i,e,t):s&&s.isFullWidth()&&this.processFullWidthRowKeyboardEvent(s,e,t))}processCellKeyboardEvent(e,t,i){const s=e.getRowNode(),o=e.getColumn(),n=e.isEditing();if(Fl(this.gos,i,s,o,n)||"keydown"!==t||(!n&&this.navigationService.handlePageScrollingKey(i)||e.onKeyDown(i),this.doGridOperations(i,e.isEditing()),Pl(i)&&e.processCharacter(i)),"keydown"===t){const t=e.createEvent(i,In.EVENT_CELL_KEY_DOWN);this.eventService.dispatchEvent(t)}}processFullWidthRowKeyboardEvent(e,t,i){const s=e.getRowNode(),o=this.focusService.getFocusedCell(),n=o&&o.column;if(!Fl(this.gos,i,s,n,!1)){const s=i.key;if("keydown"===t)switch(s){case El.PAGE_HOME:case El.PAGE_END:case El.PAGE_UP:case El.PAGE_DOWN:this.navigationService.handlePageScrollingKey(i,!0);break;case El.UP:case El.DOWN:e.onKeyboardNavigate(i);break;case El.TAB:e.onTabKeyDown(i)}}if("keydown"===t){const t=e.createRowEvent(In.EVENT_CELL_KEY_DOWN,i);this.eventService.dispatchEvent(t)}}doGridOperations(e,t){if(!e.ctrlKey&&!e.metaKey)return;if(t)return;if(!this.mouseEventService.isEventFromThisGrid(e))return;const i=Ll(e);return i===El.A?this.onCtrlAndA(e):i===El.C?this.onCtrlAndC(e):i===El.D?this.onCtrlAndD(e):i===El.V?this.onCtrlAndV(e):i===El.X?this.onCtrlAndX(e):i===El.Y?this.onCtrlAndY():i===El.Z?this.onCtrlAndZ(e):void 0}onCtrlAndA(e){const{pinnedRowModel:t,paginationProxy:i,rangeService:s}=this;if(s&&i.isRowsToRender()){const[e,i]=[t.isEmpty("top"),t.isEmpty("bottom")],o=e?null:"top";let n,r;i?(n=null,r=this.paginationProxy.getRowCount()-1):(n="bottom",r=t.getPinnedBottomRowData().length-1);const a=this.columnModel.getAllDisplayedColumns();if(Us(a))return;s.setCellRange({rowStartIndex:0,rowStartPinned:o,rowEndIndex:r,rowEndPinned:n,columnStart:a[0],columnEnd:Jo(a)})}e.preventDefault()}onCtrlAndC(e){if(!this.clipboardService||this.gos.get("enableCellTextSelection"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);(null==t?void 0:t.isEditing())||(null==i?void 0:i.isEditing())||(e.preventDefault(),this.clipboardService.copyToClipboard())}onCtrlAndX(e){if(!this.clipboardService||this.gos.get("enableCellTextSelection")||this.gos.get("suppressCutToClipboard"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);(null==t?void 0:t.isEditing())||(null==i?void 0:i.isEditing())||(e.preventDefault(),this.clipboardService.cutToClipboard(void 0,"ui"))}onCtrlAndV(e){const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);(null==t?void 0:t.isEditing())||(null==i?void 0:i.isEditing())||this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.pasteFromClipboard()}onCtrlAndD(e){this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.copyRangeDown(),e.preventDefault()}onCtrlAndZ(e){this.gos.get("undoRedoCellEditing")&&(e.preventDefault(),e.shiftKey?this.undoRedoService.redo("ui"):this.undoRedoService.undo("ui"))}onCtrlAndY(){this.undoRedoService.redo("ui")}};Gs([No("mouseEventService")],Gd.prototype,"mouseEventService",2),Gs([No("valueService")],Gd.prototype,"valueService",2),Gs([No("menuService")],Gd.prototype,"menuService",2),Gs([No("ctrlsService")],Gd.prototype,"ctrlsService",2),Gs([No("navigationService")],Gd.prototype,"navigationService",2),Gs([No("focusService")],Gd.prototype,"focusService",2),Gs([No("undoRedoService")],Gd.prototype,"undoRedoService",2),Gs([No("columnModel")],Gd.prototype,"columnModel",2),Gs([No("paginationProxy")],Gd.prototype,"paginationProxy",2),Gs([No("pinnedRowModel")],Gd.prototype,"pinnedRowModel",2),Gs([_o("rangeService")],Gd.prototype,"rangeService",2),Gs([_o("clipboardService")],Gd.prototype,"clipboardService",2),Gs([Lo],Gd.prototype,"postConstruct",1);var kd=class extends Pn{constructor(e){super(),this.centerContainerCtrl=e}postConstruct(){this.ctrlsService.whenReady((e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.listenForResize()})),this.addManagedListener(this.eventService,In.EVENT_SCROLLBAR_WIDTH_CHANGED,this.onScrollbarWidthChanged.bind(this)),this.addManagedPropertyListeners(["alwaysShowHorizontalScroll","alwaysShowVerticalScroll"],(()=>{this.checkViewportAndScrolls()}))}listenForResize(){const e=()=>this.onCenterViewportResized();this.centerContainerCtrl.registerViewportResizeListener(e),this.gridBodyCtrl.registerBodyViewportResizeListener(e)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.centerContainerCtrl.isViewportInTheDOMTree()){this.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();const e=this.centerContainerCtrl.getCenterWidth();e!==this.centerWidth&&(this.centerWidth=e,this.columnModel.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0}))}else this.bodyHeight=0}keepPinnedColumnsNarrowerThanViewport(){const e=Ga(this.gridBodyCtrl.getBodyViewportElement());if(e<=50)return;let t=this.getPinnedColumnsOverflowingViewport(e-50);const i=this.gos.getCallback("processUnpinnedColumns");t.length&&(i&&(t=i({columns:t,viewportWidth:e})),this.columnModel.setColumnsPinned(t,null,"viewportSizeFeature"))}getPinnedColumnsOverflowingViewport(e){const t=this.pinnedWidthService.getPinnedRightWidth()+this.pinnedWidthService.getPinnedLeftWidth();if(t<e)return[];const i=[...this.columnModel.getDisplayedLeftColumns()],s=[...this.columnModel.getDisplayedRightColumns()];let o=0,n=0;const r=[];let a=t-0-e;for(;(n<i.length||o<s.length)&&a>0;){if(o<s.length){const e=s[o++];a-=e.getActualWidth(),r.push(e)}if(n<i.length&&a>0){const e=i[n++];a-=e.getActualWidth(),r.push(e)}}return r}checkViewportAndScrolls(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.getScrollFeature().checkScrollLeft()}getBodyHeight(){return this.bodyHeight}checkBodyHeight(){const e=Oa(this.gridBodyCtrl.getBodyViewportElement());if(this.bodyHeight!==e){this.bodyHeight=e;const t={type:In.EVENT_BODY_HEIGHT_CHANGED};this.eventService.dispatchEvent(t)}}updateScrollVisibleService(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)}updateScrollVisibleServiceImpl(){const e={horizontalScrollShowing:this.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleService.setScrollsVisible(e)}isHorizontalScrollShowing(){return this.centerContainerCtrl.isHorizontalScrollShowing()}onHorizontalViewportChanged(){const e=this.centerContainerCtrl.getCenterWidth(),t=this.centerContainerCtrl.getViewportScrollLeft();this.columnModel.setViewportPosition(e,t)}};Gs([No("ctrlsService")],kd.prototype,"ctrlsService",2),Gs([No("pinnedWidthService")],kd.prototype,"pinnedWidthService",2),Gs([No("columnModel")],kd.prototype,"columnModel",2),Gs([No("scrollVisibleService")],kd.prototype,"scrollVisibleService",2),Gs([Lo],kd.prototype,"postConstruct",1);var Vd=class extends Pn{constructor(e){super(),this.element=e}postConstruct(){this.addManagedListener(this.eventService,In.EVENT_LEFT_PINNED_WIDTH_CHANGED,this.onPinnedLeftWidthChanged.bind(this))}onPinnedLeftWidthChanged(){const e=this.pinnedWidthService.getPinnedLeftWidth(),t=e>0;La(this.element,t),il(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedLeftWidth()}};Gs([No("pinnedWidthService")],Vd.prototype,"pinnedWidthService",2),Gs([Lo],Vd.prototype,"postConstruct",1);var Hd=class extends Pn{constructor(e){super(),this.element=e}postConstruct(){this.addManagedListener(this.eventService,In.EVENT_RIGHT_PINNED_WIDTH_CHANGED,this.onPinnedRightWidthChanged.bind(this))}onPinnedRightWidthChanged(){const e=this.pinnedWidthService.getPinnedRightWidth(),t=e>0;La(this.element,t),il(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedRightWidth()}};Gs([No("pinnedWidthService")],Hd.prototype,"pinnedWidthService",2),Gs([Lo],Hd.prototype,"postConstruct",1);var Bd=class extends Pn{constructor(e,t){super(),this.eContainer=e,this.eViewport=t}postConstruct(){this.addManagedListener(this.eventService,In.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,this.onHeightChanged.bind(this))}onHeightChanged(){const e=this.maxDivHeightScaler.getUiContainerHeight(),t=null!=e?`${e}px`:"";this.eContainer.style.height=t,this.eViewport&&(this.eViewport.style.height=t)}};Gs([No("rowContainerHeightService")],Bd.prototype,"maxDivHeightScaler",2),Gs([Lo],Bd.prototype,"postConstruct",1);var Wd=class extends Pn{constructor(e){super(),this.eContainer=e}postConstruct(){this.rangeService&&(this.params={eElement:this.eContainer,onDragStart:this.rangeService.onDragStart.bind(this.rangeService),onDragStop:this.rangeService.onDragStop.bind(this.rangeService),onDragging:this.rangeService.onDragging.bind(this.rangeService)},this.addManagedPropertyListener("enableRangeSelection",(e=>{e.currentValue?this.enableFeature():this.disableFeature()})),this.addDestroyFunc((()=>this.disableFeature())),this.gos.get("enableRangeSelection")&&this.enableFeature())}enableFeature(){this.dragService.addDragSource(this.params)}disableFeature(){this.dragService.removeDragSource(this.params)}};Gs([No("dragService")],Wd.prototype,"dragService",2),Gs([_o("rangeService")],Wd.prototype,"rangeService",2),Gs([Lo],Wd.prototype,"postConstruct",1);var Ud=class extends Pn{constructor(e,t=!1){super(),this.callback=e,this.addSpacer=t}postConstruct(){const e=this.setWidth.bind(this);this.addManagedPropertyListener("domLayout",e),this.addManagedListener(this.eventService,In.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED,e),this.addManagedListener(this.eventService,In.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,In.EVENT_LEFT_PINNED_WIDTH_CHANGED,e),this.addSpacer&&(this.addManagedListener(this.eventService,In.EVENT_RIGHT_PINNED_WIDTH_CHANGED,e),this.addManagedListener(this.eventService,In.EVENT_SCROLL_VISIBILITY_CHANGED,e),this.addManagedListener(this.eventService,In.EVENT_SCROLLBAR_WIDTH_CHANGED,e)),this.setWidth()}setWidth(){const{columnModel:e}=this,t=this.gos.isDomLayout("print"),i=e.getBodyContainerWidth(),s=e.getDisplayedColumnsLeftWidth(),o=e.getDisplayedColumnsRightWidth();let n;t?n=i+s+o:(n=i,this.addSpacer&&0===(this.gos.get("enableRtl")?s:o)&&this.scrollVisibleService.isVerticalScrollShowing()&&(n+=this.gos.getScrollbarWidth())),this.callback(n)}};Gs([No("columnModel")],Ud.prototype,"columnModel",2),Gs([No("scrollVisibleService")],Ud.prototype,"scrollVisibleService",2),Gs([Lo],Ud.prototype,"postConstruct",1);var zd=(e=>(e.LEFT="left",e.RIGHT="right",e.CENTER="center",e.FULL_WIDTH="fullWidth",e.TOP_LEFT="topLeft",e.TOP_RIGHT="topRight",e.TOP_CENTER="topCenter",e.TOP_FULL_WIDTH="topFullWidth",e.STICKY_TOP_LEFT="stickyTopLeft",e.STICKY_TOP_RIGHT="stickyTopRight",e.STICKY_TOP_CENTER="stickyTopCenter",e.STICKY_TOP_FULL_WIDTH="stickyTopFullWidth",e.STICKY_BOTTOM_LEFT="stickyBottomLeft",e.STICKY_BOTTOM_RIGHT="stickyBottomRight",e.STICKY_BOTTOM_CENTER="stickyBottomCenter",e.STICKY_BOTTOM_FULL_WIDTH="stickyBottomFullWidth",e.BOTTOM_LEFT="bottomLeft",e.BOTTOM_RIGHT="bottomRight",e.BOTTOM_CENTER="bottomCenter",e.BOTTOM_FULL_WIDTH="bottomFullWidth",e))(zd||{});function $d(e){switch(e){case"center":case"topCenter":case"stickyTopCenter":case"bottomCenter":case"stickyBottomCenter":return"center";case"left":case"topLeft":case"stickyTopLeft":case"bottomLeft":case"stickyBottomLeft":return"left";case"right":case"topRight":case"stickyTopRight":case"bottomRight":case"stickyBottomRight":return"right";case"fullWidth":case"topFullWidth":case"stickyTopFullWidth":case"bottomFullWidth":case"stickyBottomFullWidth":return"fullWidth";default:throw Error("Invalid Row Container Type")}}var Kd=Yn([["center","ag-center-cols-container"],["left","ag-pinned-left-cols-container"],["right","ag-pinned-right-cols-container"],["fullWidth","ag-full-width-container"],["topCenter","ag-floating-top-container"],["topLeft","ag-pinned-left-floating-top"],["topRight","ag-pinned-right-floating-top"],["topFullWidth","ag-floating-top-full-width-container"],["stickyTopCenter","ag-sticky-top-container"],["stickyTopLeft","ag-pinned-left-sticky-top"],["stickyTopRight","ag-pinned-right-sticky-top"],["stickyTopFullWidth","ag-sticky-top-full-width-container"],["stickyBottomCenter","ag-sticky-bottom-container"],["stickyBottomLeft","ag-pinned-left-sticky-bottom"],["stickyBottomRight","ag-pinned-right-sticky-bottom"],["stickyBottomFullWidth","ag-sticky-bottom-full-width-container"],["bottomCenter","ag-floating-bottom-container"],["bottomLeft","ag-pinned-left-floating-bottom"],["bottomRight","ag-pinned-right-floating-bottom"],["bottomFullWidth","ag-floating-bottom-full-width-container"]]),jd=Yn([["center","ag-center-cols-viewport"],["topCenter","ag-floating-top-viewport"],["stickyTopCenter","ag-sticky-top-viewport"],["bottomCenter","ag-floating-bottom-viewport"],["stickyBottomCenter","ag-sticky-bottom-viewport"]]),Yd=class e extends Pn{constructor(e){super(),this.visible=!0,this.EMPTY_CTRLS=[],this.name=e,this.isFullWithContainer="topFullWidth"===this.name||"stickyTopFullWidth"===this.name||"stickyBottomFullWidth"===this.name||"bottomFullWidth"===this.name||"fullWidth"===this.name}static getRowContainerCssClasses(e){return{container:Kd.get(e),viewport:jd.get(e)}}static getPinned(e){switch(e){case"bottomLeft":case"topLeft":case"stickyTopLeft":case"stickyBottomLeft":case"left":return"left";case"bottomRight":case"topRight":case"stickyTopRight":case"stickyBottomRight":case"right":return"right";default:return null}}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.forContainers(["center"],(()=>this.viewportSizeFeature=this.createManagedBean(new kd(this))))}registerWithCtrlsService(){switch(this.name){case"fullWidth":case"topFullWidth":case"stickyTopFullWidth":case"bottomFullWidth":case"stickyBottomFullWidth":return;default:this.ctrlsService.register(this.name,this)}}forContainers(e,t){e.indexOf(this.name)>=0&&t()}getContainerElement(){return this.eContainer}getViewportSizeFeature(){return this.viewportSizeFeature}setComp(e,t,i){this.comp=e,this.eContainer=t,this.eViewport=i,this.createManagedBean(new Gd(this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder(),this.stopHScrollOnPinnedRows();this.forContainers(["left","bottomLeft","topLeft","stickyTopLeft","stickyBottomLeft"],(()=>{this.pinnedWidthFeature=this.createManagedBean(new Vd(this.eContainer)),this.addManagedListener(this.eventService,In.EVENT_LEFT_PINNED_WIDTH_CHANGED,(()=>this.onPinnedWidthChanged()))})),this.forContainers(["right","bottomRight","topRight","stickyTopRight","stickyBottomRight"],(()=>{this.pinnedWidthFeature=this.createManagedBean(new Hd(this.eContainer)),this.addManagedListener(this.eventService,In.EVENT_RIGHT_PINNED_WIDTH_CHANGED,(()=>this.onPinnedWidthChanged()))})),this.forContainers(["center","left","right","fullWidth"],(()=>this.createManagedBean(new Bd(this.eContainer,"center"===this.name?i:void 0)))),this.forContainers(["topCenter","topLeft","topRight","bottomCenter","bottomLeft","bottomRight","center","left","right","stickyTopCenter","stickyTopLeft","stickyTopRight","stickyBottomCenter","stickyBottomLeft","stickyBottomRight"],(()=>this.createManagedBean(new Wd(this.eContainer)))),this.forContainers(["center","topCenter","stickyTopCenter","bottomCenter","stickyBottomCenter"],(()=>this.createManagedBean(new Ud((e=>this.comp.setContainerWidth(`${e}px`)))))),this.addListeners(),this.registerWithCtrlsService()}addListeners(){this.addManagedListener(this.eventService,In.EVENT_DISPLAYED_COLUMNS_CHANGED,(()=>this.onDisplayedColumnsChanged())),this.addManagedListener(this.eventService,In.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,(()=>this.onDisplayedColumnsWidthChanged())),this.addManagedListener(this.eventService,In.EVENT_DISPLAYED_ROWS_CHANGED,(e=>this.onDisplayedRowsChanged(e.afterScroll))),this.onDisplayedColumnsChanged(),this.onDisplayedColumnsWidthChanged(),this.onDisplayedRowsChanged()}listenOnDomOrder(){if(["stickyTopCenter","stickyTopLeft","stickyTopRight","stickyTopFullWidth","stickyBottomCenter","stickyBottomLeft","stickyBottomRight","stickyBottomFullWidth"].indexOf(this.name)>=0)return void this.comp.setDomOrder(!0);const e=()=>{const e=this.gos.get("ensureDomOrder"),t=this.gos.isDomLayout("print");this.comp.setDomOrder(e||t)};this.addManagedPropertyListener("domLayout",e),e()}stopHScrollOnPinnedRows(){this.forContainers(["topCenter","stickyTopCenter","bottomCenter","stickyBottomCenter"],(()=>{this.addManagedListener(this.eViewport,"scroll",(()=>this.eViewport.scrollLeft=0))}))}onDisplayedColumnsChanged(){this.forContainers(["center"],(()=>this.onHorizontalViewportChanged()))}onDisplayedColumnsWidthChanged(){this.forContainers(["center"],(()=>this.onHorizontalViewportChanged()))}addPreventScrollWhileDragging(){const e=e=>{this.dragService.isDragging()&&e.cancelable&&e.preventDefault()};this.eContainer.addEventListener("touchmove",e,{passive:!1}),this.addDestroyFunc((()=>this.eContainer.removeEventListener("touchmove",e)))}onHorizontalViewportChanged(e=!1){const t=this.getCenterWidth(),i=this.getCenterViewportScrollLeft();this.columnModel.setViewportPosition(t,i,e)}getCenterWidth(){return Ga(this.eViewport)}getCenterViewportScrollLeft(){return Wa(this.eViewport,this.enableRtl)}registerViewportResizeListener(e){const t=this.resizeObserverService.observeResize(this.eViewport,e);this.addDestroyFunc((()=>t()))}isViewportInTheDOMTree(){return Ka(this.eViewport)}getViewportScrollLeft(){return Wa(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){return this.gos.get("alwaysShowHorizontalScroll")||Za(this.eViewport)}getViewportElement(){return this.eViewport}setContainerTranslateX(e){this.eContainer.style.transform=`translateX(${e}px)`}getHScrollPosition(){return{left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth}}setCenterViewportScrollLeft(e){Ua(this.eViewport,e,this.enableRtl)}isContainerVisible(){return!e.getPinned(this.name)||!!this.pinnedWidthFeature&&this.pinnedWidthFeature.getWidth()>0}onPinnedWidthChanged(){const e=this.isContainerVisible();this.visible!=e&&(this.visible=e,this.onDisplayedRowsChanged())}onDisplayedRowsChanged(e=!1){const t=this.getRowCtrls();if(!this.visible||0===t.length)return void this.comp.setRowCtrls({rowCtrls:this.EMPTY_CTRLS});const i=this.gos.isDomLayout("print"),s=this.gos.get("embedFullWidthRows")||i,o=t.filter((e=>{const t=e.isFullWidth();return this.isFullWithContainer?!s&&t:s||!t}));this.comp.setRowCtrls({rowCtrls:o,useFlushSync:e})}getRowCtrls(){switch(this.name){case"topCenter":case"topLeft":case"topRight":case"topFullWidth":return this.rowRenderer.getTopRowCtrls();case"stickyTopCenter":case"stickyTopLeft":case"stickyTopRight":case"stickyTopFullWidth":return this.rowRenderer.getStickyTopRowCtrls();case"stickyBottomCenter":case"stickyBottomLeft":case"stickyBottomRight":case"stickyBottomFullWidth":return this.rowRenderer.getStickyBottomRowCtrls();case"bottomCenter":case"bottomLeft":case"bottomRight":case"bottomFullWidth":return this.rowRenderer.getBottomRowCtrls();default:return this.rowRenderer.getCentreRowCtrls()}}};Gs([No("dragService")],Yd.prototype,"dragService",2),Gs([No("ctrlsService")],Yd.prototype,"ctrlsService",2),Gs([No("columnModel")],Yd.prototype,"columnModel",2),Gs([No("resizeObserverService")],Yd.prototype,"resizeObserverService",2),Gs([No("rowRenderer")],Yd.prototype,"rowRenderer",2),Gs([Lo],Yd.prototype,"postConstruct",1);var qd=Yd,Xd=class extends Yl{constructor(){super('<div class="ag-root ag-unselectable" role="treegrid">\n <ag-header-root ref="gridHeader"></ag-header-root>\n <div class="ag-floating-top" ref="eTop" role="presentation">\n <ag-row-container ref="topLeftContainer" name="topLeft"></ag-row-container>\n <ag-row-container ref="topCenterContainer" name="topCenter"></ag-row-container>\n <ag-row-container ref="topRightContainer" name="topRight"></ag-row-container>\n <ag-row-container ref="topFullWidthContainer" name="topFullWidth"></ag-row-container>\n </div>\n <div class="ag-body" ref="eBody" role="presentation">\n <div class="ag-body-viewport" ref="eBodyViewport" role="presentation">\n <ag-row-container ref="leftContainer" name="left"></ag-row-container>\n <ag-row-container ref="centerContainer" name="center"></ag-row-container>\n <ag-row-container ref="rightContainer" name="right"></ag-row-container>\n <ag-row-container ref="fullWidthContainer" name="fullWidth"></ag-row-container>\n </div>\n <ag-fake-vertical-scroll></ag-fake-vertical-scroll>\n </div>\n <div class="ag-sticky-top" ref="eStickyTop" role="presentation">\n <ag-row-container ref="stickyTopLeftContainer" name="stickyTopLeft"></ag-row-container>\n <ag-row-container ref="stickyTopCenterContainer" name="stickyTopCenter"></ag-row-container>\n <ag-row-container ref="stickyTopRightContainer" name="stickyTopRight"></ag-row-container>\n <ag-row-container ref="stickyTopFullWidthContainer" name="stickyTopFullWidth"></ag-row-container>\n </div>\n <div class="ag-sticky-bottom" ref="eStickyBottom" role="presentation">\n <ag-row-container ref="stickyBottomLeftContainer" name="stickyBottomLeft"></ag-row-container>\n <ag-row-container ref="stickyBottomCenterContainer" name="stickyBottomCenter"></ag-row-container>\n <ag-row-container ref="stickyBottomRightContainer" name="stickyBottomRight"></ag-row-container>\n <ag-row-container ref="stickyBottomFullWidthContainer" name="stickyBottomFullWidth"></ag-row-container>\n </div>\n <div class="ag-floating-bottom" ref="eBottom" role="presentation">\n <ag-row-container ref="bottomLeftContainer" name="bottomLeft"></ag-row-container>\n <ag-row-container ref="bottomCenterContainer" name="bottomCenter"></ag-row-container>\n <ag-row-container ref="bottomRightContainer" name="bottomRight"></ag-row-container>\n <ag-row-container ref="bottomFullWidthContainer" name="bottomFullWidth"></ag-row-container>\n </div>\n <ag-fake-horizontal-scroll></ag-fake-horizontal-scroll>\n <ag-overlay-wrapper></ag-overlay-wrapper>\n </div>')}init(){const e=(e,t)=>{const i=`${e}px`;t.style.minHeight=i,t.style.height=i},t={setRowAnimationCssOnBodyViewport:(e,t)=>this.setRowAnimationCssOnBodyViewport(e,t),setColumnCount:e=>Nr(this.getGui(),e),setRowCount:e=>xr(this.getGui(),e),setTopHeight:t=>e(t,this.eTop),setBottomHeight:t=>e(t,this.eBottom),setTopDisplay:e=>this.eTop.style.display=e,setBottomDisplay:e=>this.eBottom.style.display=e,setStickyTopHeight:e=>this.eStickyTop.style.height=e,setStickyTopTop:e=>this.eStickyTop.style.top=e,setStickyTopWidth:e=>this.eStickyTop.style.width=e,setStickyBottomHeight:e=>this.eStickyBottom.style.height=e,setStickyBottomBottom:e=>this.eStickyBottom.style.bottom=e,setStickyBottomWidth:e=>this.eStickyBottom.style.width=e,setColumnMovingCss:(e,t)=>this.addOrRemoveCssClass(e,t),updateLayoutClasses:(e,t)=>{[this.eBodyViewport.classList,this.eBody.classList].forEach((e=>{e.toggle("ag-layout-auto-height",t.autoHeight),e.toggle("ag-layout-normal",t.normal),e.toggle("ag-layout-print",t.print)})),this.addOrRemoveCssClass("ag-layout-auto-height",t.autoHeight),this.addOrRemoveCssClass("ag-layout-normal",t.normal),this.addOrRemoveCssClass("ag-layout-print",t.print)},setAlwaysVerticalScrollClass:(e,t)=>this.eBodyViewport.classList.toggle(yd,t),registerBodyViewportResizeListener:e=>{const t=this.resizeObserverService.observeResize(this.eBodyViewport,e);this.addDestroyFunc((()=>t()))},setPinnedTopBottomOverflowY:e=>this.eTop.style.overflowY=this.eBottom.style.overflowY=e,setCellSelectableCss:(e,t)=>{[this.eTop,this.eBodyViewport,this.eBottom].forEach((i=>i.classList.toggle(e,t)))},setBodyViewportWidth:e=>this.eBodyViewport.style.width=e};this.ctrl=this.createManagedBean(new Ed),this.ctrl.setComp(t,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop,this.eStickyBottom),(this.rangeService&&this.gos.get("enableRangeSelection")||"multiple"===this.gos.get("rowSelection"))&&Lr(this.getGui(),!0)}setRowAnimationCssOnBodyViewport(e,t){const i=this.eBodyViewport.classList;i.toggle("ag-row-animation",t),i.toggle("ag-row-no-animation",!t)}getFloatingTopBottom(){return[this.eTop,this.eBottom]}};Gs([No("resizeObserverService")],Xd.prototype,"resizeObserverService",2),Gs([_o("rangeService")],Xd.prototype,"rangeService",2),Gs([ql("eBodyViewport")],Xd.prototype,"eBodyViewport",2),Gs([ql("eStickyTop")],Xd.prototype,"eStickyTop",2),Gs([ql("eStickyBottom")],Xd.prototype,"eStickyBottom",2),Gs([ql("eTop")],Xd.prototype,"eTop",2),Gs([ql("eBottom")],Xd.prototype,"eBottom",2),Gs([ql("gridHeader")],Xd.prototype,"headerRootComp",2),Gs([ql("eBody")],Xd.prototype,"eBody",2),Gs([Lo],Xd.prototype,"init",1);var Qd=class extends Pn{postConstruct(){this.addManagedListener(this.eventService,In.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,In.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onDisplayedColumnsWidthChanged.bind(this))}onDisplayedColumnsChanged(){this.update()}onDisplayedColumnsWidthChanged(){this.update()}update(){this.columnAnimationService.isActive()?this.columnAnimationService.executeLaterVMTurn((()=>{this.columnAnimationService.executeLaterVMTurn((()=>this.updateImpl()))})):this.updateImpl()}updateImpl(){const e=this.ctrlsService.get("center");if(!e||this.columnAnimationService.isActive())return;const t={horizontalScrollShowing:e.isHorizontalScrollShowing(),verticalScrollShowing:this.isVerticalScrollShowing()};this.setScrollsVisible(t)}setScrollsVisible(e){if(this.horizontalScrollShowing!==e.horizontalScrollShowing||this.verticalScrollShowing!==e.verticalScrollShowing){this.horizontalScrollShowing=e.horizontalScrollShowing,this.verticalScrollShowing=e.verticalScrollShowing;const t={type:In.EVENT_SCROLL_VISIBILITY_CHANGED};this.eventService.dispatchEvent(t)}}isHorizontalScrollShowing(){return this.horizontalScrollShowing}isVerticalScrollShowing(){return this.verticalScrollShowing}};Gs([No("ctrlsService")],Qd.prototype,"ctrlsService",2),Gs([No("columnAnimationService")],Qd.prototype,"columnAnimationService",2),Gs([Lo],Qd.prototype,"postConstruct",1),Qd=Gs([Io("scrollVisibleService")],Qd);var Jd=class extends Pn{constructor(){super(...arguments),this.gridInstanceId=Jd.gridInstanceSequence.next()}stampTopLevelGridCompWithGridInstance(e){e[Jd.GRID_DOM_KEY]=this.gridInstanceId}getRenderedCellForEvent(e){return Sn(this.gos,e.target,Id.DOM_DATA_KEY_CELL_CTRL)}isEventFromThisGrid(e){return this.isElementInThisGrid(e.target)}isElementInThisGrid(e){let t=e;for(;t;){const e=t[Jd.GRID_DOM_KEY];if(Bs(e))return e===this.gridInstanceId;t=t.parentElement}return!1}getCellPositionForEvent(e){const t=this.getRenderedCellForEvent(e);return t?t.getCellPosition():null}getNormalisedPosition(e){const t=this.gos.isDomLayout("normal"),i=e;let s,o;if(null!=i.clientX||null!=i.clientY?(s=i.clientX,o=i.clientY):(s=i.x,o=i.y),t){const e=this.ctrlsService.getGridBodyCtrl(),t=e.getScrollFeature().getVScrollPosition();s+=e.getScrollFeature().getHScrollPosition().left,o+=t.top}return{x:s,y:o}}};Jd.gridInstanceSequence=new Hl,Jd.GRID_DOM_KEY="__ag_grid_instance",Gs([No("ctrlsService")],Jd.prototype,"ctrlsService",2),Jd=Gs([Io("mouseEventService")],Jd);var Zd=class extends Pn{constructor(){super(),this.onPageDown=So(this.onPageDown,100),this.onPageUp=So(this.onPageUp,100)}postConstruct(){this.ctrlsService.whenReady((e=>{this.gridBodyCon=e.gridBodyCtrl}))}handlePageScrollingKey(e,t=!1){const i=e.key,s=e.altKey,o=e.ctrlKey||e.metaKey,n=!!this.rangeService&&e.shiftKey,r=this.mouseEventService.getCellPositionForEvent(e);let a=!1;switch(i){case El.PAGE_HOME:case El.PAGE_END:o||s||(this.onHomeOrEndKey(i),a=!0);break;case El.LEFT:case El.RIGHT:case El.UP:case El.DOWN:if(!r)return!1;!o||s||n||(this.onCtrlUpDownLeftRight(i,r),a=!0);break;case El.PAGE_DOWN:case El.PAGE_UP:o||s||(a=this.handlePageUpDown(i,r,t))}return a&&e.preventDefault(),a}handlePageUpDown(e,t,i){return i&&(t=this.focusService.getFocusedCell()),!!t&&(e===El.PAGE_UP?this.onPageUp(t):this.onPageDown(t),!0)}navigateTo(e){var t;const{scrollIndex:i,scrollType:s,scrollColumn:o,focusIndex:n,focusColumn:r}=e;Bs(o)&&!o.isPinned()&&this.gridBodyCon.getScrollFeature().ensureColumnVisible(o),Bs(i)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(i,s),e.isAsync||this.gridBodyCon.getScrollFeature().ensureIndexVisible(n),this.focusService.setFocusedCell({rowIndex:n,column:r,rowPinned:null,forceBrowserFocus:!0}),null==(t=this.rangeService)||t.setRangeToCell({rowIndex:n,rowPinned:null,column:r})}onPageDown(e){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),i=this.getViewportHeight(),s=this.paginationProxy.getPixelOffset(),o=t.top+i,n=this.paginationProxy.getRowIndexAtPixel(o+s);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,n):this.navigateToNextPage(e,n)}onPageUp(e){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),i=this.paginationProxy.getPixelOffset(),s=t.top,o=this.paginationProxy.getRowIndexAtPixel(s+i);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,o,!0):this.navigateToNextPage(e,o,!0)}navigateToNextPage(e,t,i=!1){const s=this.getViewportHeight(),o=this.paginationProxy.getPageFirstRow(),n=this.paginationProxy.getPageLastRow(),r=this.paginationProxy.getPixelOffset(),a=this.paginationProxy.getRow(e.rowIndex),l=i?(null==a?void 0:a.rowHeight)-s-r:s-r,u=(null==a?void 0:a.rowTop)+l;let h,d=this.paginationProxy.getRowIndexAtPixel(u+r);if(d===e.rowIndex){const s=i?-1:1;t=d=e.rowIndex+s}i?(h="bottom",d<o&&(d=o),t<o&&(t=o)):(h="top",d>n&&(d=n),t>n&&(t=n)),this.isRowTallerThanView(d)&&(t=d,h="top"),this.navigateTo({scrollIndex:t,scrollType:h,scrollColumn:null,focusIndex:d,focusColumn:e.column})}navigateToNextPageWithAutoHeight(e,t,i=!1){this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:t,focusColumn:e.column}),setTimeout((()=>{const s=this.getNextFocusIndexForAutoHeight(e,i);this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:s,focusColumn:e.column,isAsync:!0})}),50)}getNextFocusIndexForAutoHeight(e,t=!1){var i;const s=t?-1:1,o=this.getViewportHeight(),n=this.paginationProxy.getPageLastRow();let r=0,a=e.rowIndex;for(;a>=0&&a<=n;){const e=this.paginationProxy.getRow(a);if(e){const t=null!=(i=e.rowHeight)?i:0;if(r+t>o)break;r+=t}a+=s}return Math.max(0,Math.min(a,n))}getViewportHeight(){const{gridBodyCtrl:e,center:t}=this.ctrlsService.getParams(),i=e.getScrollFeature().getVScrollPosition(),s=this.gos.getScrollbarWidth();let o=i.bottom-i.top;return t.isHorizontalScrollShowing()&&(o-=s),o}isRowTallerThanView(e){const t=this.paginationProxy.getRow(e);if(!t)return!1;const i=t.rowHeight;return"number"==typeof i&&i>this.getViewportHeight()}onCtrlUpDownLeftRight(e,t){const i=this.cellNavigationService.getNextCellToFocus(e,t,!0),{rowIndex:s,column:o}=i;this.navigateTo({scrollIndex:s,scrollType:null,scrollColumn:o,focusIndex:s,focusColumn:o})}onHomeOrEndKey(e){const t=e===El.PAGE_HOME,i=this.columnModel.getAllDisplayedColumns(),s=t?i[0]:Jo(i),o=t?this.paginationProxy.getPageFirstRow():this.paginationProxy.getPageLastRow();this.navigateTo({scrollIndex:o,scrollType:null,scrollColumn:s,focusIndex:o,focusColumn:s})}onTabKeyDown(e,t){const i=t.shiftKey,s=this.tabToNextCellCommon(e,i,t);if(!1===s)if(i){const{rowIndex:i,rowPinned:s}=e.getRowPosition();(s?0===i:i===this.paginationProxy.getPageFirstRow())&&(0===this.gos.get("headerHeight")||this.gos.get("suppressHeaderFocus")?this.focusService.focusNextGridCoreContainer(!0,!0):(t.preventDefault(),this.focusService.focusPreviousFromFirstCell(t)))}else e instanceof Id&&e.focusCell(!0),this.focusService.focusNextGridCoreContainer(i)&&t.preventDefault();else s&&t.preventDefault()}tabToNextCell(e,t){const i=this.focusService.getFocusedCell();if(!i)return!1;let s=this.getCellByPosition(i);return!!(s||(s=this.rowRenderer.getRowByPosition(i),s&&s.isFullWidth()))&&!!this.tabToNextCellCommon(s,e,t)}tabToNextCellCommon(e,t,i){let s,o=e.isEditing();if(!o&&e instanceof Id){const t=e.getRowCtrl();t&&(o=t.isEditing())}return s=o?"fullRow"===this.gos.get("editType")?this.moveToNextEditingRow(e,t,i):this.moveToNextEditingCell(e,t,i):this.moveToNextCellNotEditing(e,t),null===s?s:s||!!this.focusService.getFocusedHeader()}moveToNextEditingCell(e,t,i=null){const s=e.getCellPosition();e.getGui().focus(),e.stopEditing();const o=this.findNextCellToFocusOn(s,t,!0);return!1===o?null:null!=o&&(o.startEditing(null,!0,i),o.focusCell(!1),!0)}moveToNextEditingRow(e,t,i=null){const s=e.getCellPosition(),o=this.findNextCellToFocusOn(s,t,!0);if(!1===o)return null;if(null==o)return!1;const n=o.getCellPosition(),r=this.isCellEditable(s),a=this.isCellEditable(n),l=n&&s.rowIndex===n.rowIndex&&s.rowPinned===n.rowPinned;return r&&e.setFocusOutOnEditor(),l||(e.getRowCtrl().stopEditing(),o.getRowCtrl().startRowEditing(void 0,void 0,i)),a?(o.setFocusInOnEditor(),o.focusCell()):o.focusCell(!0),!0}moveToNextCellNotEditing(e,t){const i=this.columnModel.getAllDisplayedColumns();let s;s=e instanceof Od?_s(Ns({},e.getRowPosition()),{column:t?i[0]:Jo(i)}):e.getCellPosition();const o=this.findNextCellToFocusOn(s,t,!1);if(!1===o)return null;if(o instanceof Id)o.focusCell(!0);else if(o)return this.tryToFocusFullWidthRow(o.getRowPosition(),t);return Bs(o)}findNextCellToFocusOn(e,t,i){var s;let o=e;for(;;){e!==o&&(e=o),t||(o=this.getLastCellOfColSpan(o)),o=this.cellNavigationService.getNextTabbedCell(o,t);const n=this.gos.getCallback("tabToNextCell");if(Bs(n)){const s=n({backwards:t,editing:i,previousCellPosition:e,nextCellPosition:o||null});if(!0===s||null===s)null===s&&co("Returning `null` from tabToNextCell is deprecated. Return `true` to stay on the current cell, or `false` to let the browser handle the tab behaviour."),o=e;else{if(!1===s)return!1;s.floating&&(co("tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?"),s.rowPinned=s.floating),o={rowIndex:s.rowIndex,column:s.column,rowPinned:s.rowPinned}}}if(!o)return null;if(o.rowIndex<0){const e=this.headerNavigationService.getHeaderRowCount();return this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:e+o.rowIndex,column:o.column},fromCell:!0}),null}const r="fullRow"===this.gos.get("editType");if(i&&!r&&!this.isCellEditable(o))continue;this.ensureCellVisible(o);const a=this.getCellByPosition(o);if(!a){const e=this.rowRenderer.getRowByPosition(o);if(!e||!e.isFullWidth()||i)continue;return e}if(!a.isSuppressNavigable())return null==(s=this.rangeService)||s.setRangeToCell(o),a}}isCellEditable(e){const t=this.lookupRowNodeForCell(e);return!!t&&e.column.isCellEditable(t)}getCellByPosition(e){const t=this.rowRenderer.getRowByPosition(e);return t?t.getCellCtrl(e.column):null}lookupRowNodeForCell(e){return"top"===e.rowPinned?this.pinnedRowModel.getPinnedTopRow(e.rowIndex):"bottom"===e.rowPinned?this.pinnedRowModel.getPinnedBottomRow(e.rowIndex):this.paginationProxy.getRow(e.rowIndex)}navigateToNextCell(e,t,i,s){let o=i,n=!1;for(;o&&(o===i||!this.isValidNavigateCell(o));)this.gos.get("enableRtl")?t===El.LEFT&&(o=this.getLastCellOfColSpan(o)):t===El.RIGHT&&(o=this.getLastCellOfColSpan(o)),o=this.cellNavigationService.getNextCellToFocus(t,o),n=Ws(o);if(n&&e&&e.key===El.UP&&(o={rowIndex:-1,rowPinned:null,column:i.column}),s){const s=this.gos.getCallback("navigateToNextCell");if(Bs(s)){const n=s({key:t,previousCellPosition:i,nextCellPosition:o||null,event:e});Bs(n)?(n.floating&&(co("tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?"),n.rowPinned=n.floating),o={rowPinned:n.rowPinned,rowIndex:n.rowIndex,column:n.column}):o=null}}if(!o)return;if(o.rowIndex<0){const t=this.headerNavigationService.getHeaderRowCount();return void this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:t+o.rowIndex,column:i.column},event:e||void 0,fromCell:!0})}const r=this.getNormalisedPosition(o);r?this.focusPosition(r):this.tryToFocusFullWidthRow(o)}getNormalisedPosition(e){this.ensureCellVisible(e);const t=this.getCellByPosition(e);return t?(e=t.getCellPosition(),this.ensureCellVisible(e),e):null}tryToFocusFullWidthRow(e,t=!1){const i=this.columnModel.getAllDisplayedColumns(),s=this.rowRenderer.getRowByPosition(e);if(!s||!s.isFullWidth())return!1;const o=this.focusService.getFocusedCell(),n={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column||(t?Jo(i):i[0])};this.focusPosition(n);const r=null!=o&&this.rowPositionUtils.before(n,o),a={type:In.EVENT_FULL_WIDTH_ROW_FOCUSED,rowIndex:n.rowIndex,rowPinned:n.rowPinned,column:n.column,isFullWidthCell:!0,floating:n.rowPinned,fromBelow:r};return this.eventService.dispatchEvent(a),!0}focusPosition(e){var t;this.focusService.setFocusedCell({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0}),null==(t=this.rangeService)||t.setRangeToCell(e)}isValidNavigateCell(e){return!!this.rowPositionUtils.getRowNode(e)}getLastCellOfColSpan(e){const t=this.getCellByPosition(e);if(!t)return e;const i=t.getColSpanningList();return 1===i.length?e:{rowIndex:e.rowIndex,column:Jo(i),rowPinned:e.rowPinned}}ensureCellVisible(e){const t=this.gos.isGroupRowsSticky(),i=this.rowModel.getRow(e.rowIndex);!(t&&(null==i?void 0:i.sticky))&&Ws(e.rowPinned)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(e.rowIndex),e.column.isPinned()||this.gridBodyCon.getScrollFeature().ensureColumnVisible(e.column)}};Gs([No("mouseEventService")],Zd.prototype,"mouseEventService",2),Gs([No("paginationProxy")],Zd.prototype,"paginationProxy",2),Gs([No("focusService")],Zd.prototype,"focusService",2),Gs([No("columnModel")],Zd.prototype,"columnModel",2),Gs([No("rowModel")],Zd.prototype,"rowModel",2),Gs([No("ctrlsService")],Zd.prototype,"ctrlsService",2),Gs([No("rowRenderer")],Zd.prototype,"rowRenderer",2),Gs([No("headerNavigationService")],Zd.prototype,"headerNavigationService",2),Gs([No("rowPositionUtils")],Zd.prototype,"rowPositionUtils",2),Gs([No("cellNavigationService")],Zd.prototype,"cellNavigationService",2),Gs([No("pinnedRowModel")],Zd.prototype,"pinnedRowModel",2),Gs([_o("rangeService")],Zd.prototype,"rangeService",2),Gs([Lo],Zd.prototype,"postConstruct",1),Zd=Gs([Io("navigationService")],Zd);var ec=class e extends Qu{constructor(e){super('<div class="ag-popup-editor" tabindex="-1"/>'),this.params=e}postConstruct(){this.gos.setDomData(this.getGui(),e.DOM_KEY_POPUP_EDITOR_WRAPPER,!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params;this.addManagedListener(e,"keydown",(e=>{Fl(this.gos,e,t.node,t.column,!0)||t.onKeyDown(e)}))}};ec.DOM_KEY_POPUP_EDITOR_WRAPPER="popupEditorWrapper",Gs([Lo],ec.prototype,"postConstruct",1);var tc=ec,ic=class extends Yl{constructor(e,t,i,s,o){super(),this.rendererVersion=0,this.editorVersion=0,this.beans=e,this.column=t.getColumn(),this.rowNode=t.getRowNode(),this.rowCtrl=t.getRowCtrl(),this.eRow=s,this.cellCtrl=t;const n=document.createElement("div");n.setAttribute("comp-id",`${this.getCompId()}`),this.setTemplateFromElement(n);const r=this.getGui();this.forceWrapper=t.isForceWrapper(),this.refreshWrapper(!1);const a=(e,t)=>{null!=t&&""!=t?r.setAttribute(e,t):r.removeAttribute(e)};cr(r,t.getCellAriaRole()),a("col-id",t.getColumnIdSanitised());const l=t.getTabIndex();void 0!==l&&a("tabindex",l.toString());const u={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setUserStyles:e=>Ja(r,e),getFocusableElement:()=>this.getFocusableElement(),setIncludeSelection:e=>this.includeSelection=e,setIncludeRowDrag:e=>this.includeRowDrag=e,setIncludeDndSource:e=>this.includeDndSource=e,setRenderDetails:(e,t,i)=>this.setRenderDetails(e,t,i),setEditDetails:(e,t,i)=>this.setEditDetails(e,t,i),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue()};t.setComp(u,this.getGui(),this.eCellWrapper,i,o)}getParentOfValue(){return this.eCellValue?this.eCellValue:this.eCellWrapper?this.eCellWrapper:this.getGui()}setRenderDetails(e,t,i){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=null==this.firstRender;const s=this.refreshWrapper(!1);this.refreshEditStyles(!1),e?!i&&!s&&this.refreshCellRenderer(e)||(this.destroyRenderer(),this.createCellRendererInstance(e)):(this.destroyRenderer(),this.insertValueWithoutCellRenderer(t))}setEditDetails(e,t,i){e?this.createCellEditorInstance(e,t,i):this.destroyEditor()}removeControls(){this.checkboxSelectionComp=this.beans.context.destroyBean(this.checkboxSelectionComp),this.dndSourceComp=this.beans.context.destroyBean(this.dndSourceComp),this.rowDraggingComp=this.beans.context.destroyBean(this.rowDraggingComp)}refreshWrapper(e){const t=this.includeRowDrag||this.includeDndSource||this.includeSelection,i=t||this.forceWrapper,s=i&&null==this.eCellWrapper;if(s){const e=document.createElement("div");e.setAttribute("role","presentation"),e.setAttribute("class","ag-cell-wrapper"),this.eCellWrapper=e,this.getGui().appendChild(this.eCellWrapper)}const o=!i&&null!=this.eCellWrapper;o&&($a(this.eCellWrapper),this.eCellWrapper=void 0),this.addOrRemoveCssClass("ag-cell-value",!i);const n=!e&&i,r=n&&null==this.eCellValue;if(r){const e=document.createElement("span");e.setAttribute("role","presentation"),e.setAttribute("class","ag-cell-value"),this.eCellValue=e,this.eCellWrapper.appendChild(this.eCellValue)}const a=!n&&null!=this.eCellValue;a&&($a(this.eCellValue),this.eCellValue=void 0);const l=s||o||r||a;return l&&this.removeControls(),e||t&&this.addControls(),l}addControls(){this.includeRowDrag&&null==this.rowDraggingComp&&(this.rowDraggingComp=this.cellCtrl.createRowDragComp(),this.rowDraggingComp&&this.eCellWrapper.insertBefore(this.rowDraggingComp.getGui(),this.eCellValue)),this.includeDndSource&&null==this.dndSourceComp&&(this.dndSourceComp=this.cellCtrl.createDndSource(),this.eCellWrapper.insertBefore(this.dndSourceComp.getGui(),this.eCellValue)),this.includeSelection&&null==this.checkboxSelectionComp&&(this.checkboxSelectionComp=this.cellCtrl.createSelectionCheckbox(),this.eCellWrapper.insertBefore(this.checkboxSelectionComp.getGui(),this.eCellValue))}createCellEditorInstance(e,t,i){const s=this.editorVersion,o=e.newAgStackInstance();if(!o)return;const{params:n}=e;o.then((e=>this.afterCellEditorCreated(s,e,n,t,i))),Ws(this.cellEditor)&&n.cellStartedEdit&&this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(e){const t=this.getParentOfValue();za(t);const i=null!=e?zn(e,!0):null;null!=i&&(t.textContent=i)}destroyEditorAndRenderer(){this.destroyRenderer(),this.destroyEditor()}destroyRenderer(){const{context:e}=this.beans;this.cellRenderer=e.destroyBean(this.cellRenderer),$a(this.cellRendererGui),this.cellRendererGui=null,this.rendererVersion++}destroyEditor(){const{context:e}=this.beans;this.hideEditorPopup&&this.hideEditorPopup(),this.hideEditorPopup=void 0,this.cellEditor=e.destroyBean(this.cellEditor),this.cellEditorPopupWrapper=e.destroyBean(this.cellEditorPopupWrapper),$a(this.cellEditorGui),this.cellEditorGui=null,this.editorVersion++}refreshCellRenderer(e){if(null==this.cellRenderer||null==this.cellRenderer.refresh)return!1;if(this.cellRendererClass!==e.componentClass)return!1;const t=this.cellRenderer.refresh(e.params);return!0===t||void 0===t}createCellRendererInstance(e){const t=!this.beans.gos.get("suppressAnimationFrame"),i=this.rendererVersion,{componentClass:s}=e,o=()=>{if(this.rendererVersion!==i||!this.isAlive())return;const t=e.newAgStackInstance(),o=this.afterCellRendererCreated.bind(this,i,s);t&&t.then(o)};t&&this.firstRender?this.beans.animationFrameService.createTask(o,this.rowNode.rowIndex,"createTasksP2"):o()}getCtrl(){return this.cellCtrl}getRowCtrl(){return this.rowCtrl}getCellRenderer(){return this.cellRenderer}getCellEditor(){return this.cellEditor}afterCellRendererCreated(e,t,i){if(this.isAlive()&&e===this.rendererVersion){if(this.cellRenderer=i,this.cellRendererClass=t,this.cellRendererGui=this.cellRenderer.getGui(),null!=this.cellRendererGui){const e=this.getParentOfValue();za(e),e.appendChild(this.cellRendererGui)}}else this.beans.context.destroyBean(i)}afterCellEditorCreated(e,t,i,s,o){if(e!==this.editorVersion)return void this.beans.context.destroyBean(t);if(t.isCancelBeforeStart&&t.isCancelBeforeStart())return this.beans.context.destroyBean(t),void this.cellCtrl.stopEditing(!0);if(!t.getGui)return console.warn(`AG Grid: cellEditor for column ${this.column.getId()} is missing getGui() method`),void this.beans.context.destroyBean(t);this.cellEditor=t,this.cellEditorGui=t.getGui();const n=s||void 0!==t.isPopup&&t.isPopup();n?this.addPopupCellEditor(i,o):this.addInCellEditor(),this.refreshEditStyles(!0,n),t.afterGuiAttached&&t.afterGuiAttached()}refreshEditStyles(e,t){var i;this.addOrRemoveCssClass("ag-cell-inline-editing",e&&!t),this.addOrRemoveCssClass("ag-cell-popup-editing",e&&!!t),this.addOrRemoveCssClass("ag-cell-not-inline-editing",!e||!!t),null==(i=this.rowCtrl)||i.setInlineEditingCss(e)}addInCellEditor(){const e=this.getGui();e.contains(this.beans.gos.getActiveDomElement())&&e.focus(),this.destroyRenderer(),this.refreshWrapper(!0),this.clearParentOfValue(),this.cellEditorGui&&this.getParentOfValue().appendChild(this.cellEditorGui)}addPopupCellEditor(e,t){"fullRow"===this.beans.gos.get("editType")&&console.warn("AG Grid: popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.");const i=this.cellEditor;this.cellEditorPopupWrapper=this.beans.context.createBean(new tc(e));const s=this.cellEditorPopupWrapper.getGui();this.cellEditorGui&&s.appendChild(this.cellEditorGui);const o=this.beans.popupService,n=this.beans.gos.get("stopEditingWhenCellsLoseFocus"),r=null!=t?t:i.getPopupPosition?i.getPopupPosition():"over",a=this.beans.gos.get("enableRtl"),l={ePopup:s,column:this.column,rowNode:this.rowNode,type:"popupCellEditor",eventSource:this.getGui(),position:r,alignSide:a?"right":"left",keepWithinBounds:!0},u=o.positionPopupByComponent.bind(o,l),h=this.beans.localeService.getLocaleTextFunc(),d=o.addPopup({modal:n,eChild:s,closeOnEsc:!0,closedCallback:()=>{this.cellCtrl.onPopupEditorClosed()},anchorToElement:this.getGui(),positionCallback:u,ariaLabel:h("ariaLabelCellEditor","Cell Editor")});d&&(this.hideEditorPopup=d.hideFunc)}detach(){this.eRow.removeChild(this.getGui())}destroy(){this.cellCtrl.stopEditing(),this.destroyEditorAndRenderer(),this.removeControls(),super.destroy()}clearParentOfValue(){const e=this.getGui();e.contains(this.beans.gos.getActiveDomElement())&&oa()&&e.focus({preventScroll:!0}),za(this.getParentOfValue())}},sc=class extends Yl{constructor(e,t,i){super(),this.cellComps={},this.beans=t,this.rowCtrl=e;const s=document.createElement("div");s.setAttribute("comp-id",`${this.getCompId()}`),s.setAttribute("style",this.getInitialStyle(i)),this.setTemplateFromElement(s);const o=this.getGui(),n=o.style;this.domOrder=this.rowCtrl.getDomOrder(),cr(o,"row");const r=this.rowCtrl.getTabIndex();null!=r&&o.setAttribute("tabindex",r.toString());const a={setDomOrder:e=>this.domOrder=e,setCellCtrls:e=>this.setCellCtrls(e),showFullWidth:e=>this.showFullWidth(e),getFullWidthCellRenderer:()=>this.getFullWidthCellRenderer(),addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setUserStyles:e=>Ja(o,e),setTop:e=>n.top=e,setTransform:e=>n.transform=e,setRowIndex:e=>o.setAttribute("row-index",e),setRowId:e=>o.setAttribute("row-id",e),setRowBusinessKey:e=>o.setAttribute("row-business-key",e),refreshFullWidth:e=>this.refreshFullWidth(e)};e.setComp(a,this.getGui(),i),this.addDestroyFunc((()=>{e.unsetComp(i)}))}getInitialStyle(e){const t=this.rowCtrl.getInitialTransform(e);return t?`transform: ${t}`:`top: ${this.rowCtrl.getInitialRowTop(e)}`}showFullWidth(e){const t=e.newAgStackInstance();t&&t.then((e=>{if(this.isAlive()){const t=e.getGui();this.getGui().appendChild(t),this.rowCtrl.setupDetailRowAutoHeight(t),this.setFullWidthRowComp(e)}else this.beans.context.destroyBean(e)}))}setCellCtrls(e){const t=Object.assign({},this.cellComps);e.forEach((e=>{const i=e.getInstanceId();null==this.cellComps[i]?this.newCellComp(e):t[i]=null}));const i=so(t).filter((e=>null!=e));this.destroyCells(i),this.ensureDomOrder(e)}ensureDomOrder(e){if(!this.domOrder)return;const t=[];e.forEach((e=>{const i=this.cellComps[e.getInstanceId()];i&&t.push(i.getGui())})),Xa(this.getGui(),t)}newCellComp(e){const t=new ic(this.beans,e,this.rowCtrl.isPrintLayout(),this.getGui(),this.rowCtrl.isEditing());this.cellComps[e.getInstanceId()]=t,this.getGui().appendChild(t.getGui())}destroy(){super.destroy(),this.destroyAllCells()}destroyAllCells(){const e=so(this.cellComps).filter((e=>null!=e));this.destroyCells(e)}setFullWidthRowComp(e){this.fullWidthCellRenderer&&console.error("AG Grid - should not be setting fullWidthRowComponent twice"),this.fullWidthCellRenderer=e,this.addDestroyFunc((()=>{this.fullWidthCellRenderer=this.beans.context.destroyBean(this.fullWidthCellRenderer)}))}getFullWidthCellRenderer(){return this.fullWidthCellRenderer}destroyCells(e){e.forEach((e=>{if(!e)return;const t=e.getCtrl().getInstanceId();this.cellComps[t]===e&&(e.detach(),e.destroy(),this.cellComps[t]=null)}))}refreshFullWidth(e){const{fullWidthCellRenderer:t}=this;if(!t||!t.refresh)return!1;const i=e();return t.refresh(i)}},oc=class extends Yl{constructor(){super(function(){const e=Yl.elementGettingCreated.getAttribute("name"),t=qd.getRowContainerCssClasses(e);let i;return i="center"===e||"topCenter"===e||"stickyTopCenter"===e||"bottomCenter"===e||"stickyBottomCenter"===e?`<div class="${t.viewport}" ref="eViewport" role="presentation">\n <div class="${t.container}" ref="eContainer"></div>\n </div>`:`<div class="${t.container}" ref="eContainer"></div>`,i}()),this.rowComps={},this.name=Yl.elementGettingCreated.getAttribute("name"),this.type=$d(this.name)}postConstruct(){const e={setViewportHeight:e=>this.eViewport.style.height=e,setRowCtrls:({rowCtrls:e})=>this.setRowCtrls(e),setDomOrder:e=>{this.domOrder=e},setContainerWidth:e=>this.eContainer.style.width=e};this.createManagedBean(new qd(this.name)).setComp(e,this.eContainer,this.eViewport)}preDestroy(){this.setRowCtrls([])}setRowCtrls(e){const t=Ns({},this.rowComps);this.rowComps={},this.lastPlacedElement=null,e.forEach((e=>{const i=e.getInstanceId(),s=t[i];if(s)this.rowComps[i]=s,delete t[i],this.ensureDomOrder(s.getGui());else{if(!e.getRowNode().displayed)return;const t=new sc(e,this.beans,this.type);this.rowComps[i]=t,this.appendRow(t.getGui())}})),so(t).forEach((e=>{this.eContainer.removeChild(e.getGui()),e.destroy()})),cr(this.eContainer,"rowgroup")}appendRow(e){this.domOrder?Qa(this.eContainer,e,this.lastPlacedElement):this.eContainer.appendChild(e),this.lastPlacedElement=e}ensureDomOrder(e){this.domOrder&&(qa(this.eContainer,e,this.lastPlacedElement),this.lastPlacedElement=e)}};Gs([No("beans")],oc.prototype,"beans",2),Gs([ql("eViewport")],oc.prototype,"eViewport",2),Gs([ql("eContainer")],oc.prototype,"eContainer",2),Gs([Lo],oc.prototype,"postConstruct",1),Gs([xo],oc.prototype,"preDestroy",1);var nc=class{constructor(e){this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[],this.pinned=e}onDragEnter(e){if(this.clearColumnsList(),this.gos.get("functionsReadOnly"))return;const t=e.dragItem.columns;t&&t.forEach((e=>{e.isPrimary()&&(e.isAnyFunctionActive()||(e.isAllowValue()?this.columnsToAggregate.push(e):e.isAllowRowGroup()?this.columnsToGroup.push(e):e.isAllowPivot()&&this.columnsToPivot.push(e)))}))}getIconName(){return this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length>0?this.pinned?hh.ICON_PINNED:hh.ICON_MOVE:null}onDragLeave(e){this.clearColumnsList()}clearColumnsList(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0}onDragging(e){}onDragStop(e){this.columnsToAggregate.length>0&&this.columnModel.addValueColumns(this.columnsToAggregate,"toolPanelDragAndDrop"),this.columnsToGroup.length>0&&this.columnModel.addRowGroupColumns(this.columnsToGroup,"toolPanelDragAndDrop"),this.columnsToPivot.length>0&&this.columnModel.addPivotColumns(this.columnsToPivot,"toolPanelDragAndDrop")}};Gs([No("columnModel")],nc.prototype,"columnModel",2),Gs([No("gridOptionsService")],nc.prototype,"gos",2);var rc=class{static attemptMoveColumns(e){const{isFromHeader:t,hDirection:i,xPosition:s,fromEnter:o,fakeEvent:n,pinned:r,gos:a,columnModel:l}=e,u=0===i,h=1===i;let{allMovingColumns:d}=e;if(t){let e=[];d.forEach((t=>{var i;let s=null,o=t.getParent();for(;null!=o&&1===o.getDisplayedLeafColumns().length;)s=o,o=o.getParent();null!=s?((null==(i=s.getColGroupDef())?void 0:i.marryChildren)?s.getProvidedColumnGroup().getLeafColumns():s.getLeafColumns()).forEach((t=>{e.includes(t)||e.push(t)})):e.includes(t)||e.push(t)})),d=e}const c=d.slice();l.sortColumnsLikeGridColumns(c);const p=this.calculateValidMoves({movingCols:c,draggingRight:h,xPosition:s,pinned:r,gos:a,columnModel:l}),g=this.calculateOldIndex(c,l);if(0===p.length)return;const m=p[0];let f=null!==g&&!o;if(t&&(f=null!==g),f&&!n){if(u&&m>=g)return;if(h&&m<=g)return}const C=l.getAllDisplayedColumns();let v=[],w=null;for(let e=0;e<p.length;e++){const t=p[e],i=l.getProposedColumnOrder(c,t);if(!l.doesOrderPassRules(i))continue;const s=i.filter((e=>C.includes(e)));if(null===w)w=s;else if(!Zo(s,w))break;const o=this.groupFragCount(i);v.push({move:t,fragCount:o})}return 0!==v.length?(v.sort(((e,t)=>e.fragCount-t.fragCount)),this.moveColumns(d,v[0].move,"uiColumnMoved",!1,l)):void 0}static moveColumns(e,t,i,s,o){return o.moveColumns(e,t,i,s),s?null:{columns:e,toIndex:t}}static calculateOldIndex(e,t){const i=t.getAllGridColumns(),s=tn(e.map((e=>i.indexOf(e)))),o=s[0];return Jo(s)-o!=s.length-1?null:o}static groupFragCount(e){function t(e){let t=[],i=e.getOriginalParent();for(;null!=i;)t.push(i),i=i.getOriginalParent();return t}let i=0;for(let s=0;s<e.length-1;s++){let o=t(e[s]),n=t(e[s+1]);[o,n]=o.length>n.length?[o,n]:[n,o],o.forEach((e=>{-1===n.indexOf(e)&&i++}))}return i}static getDisplayedColumns(e,t){switch(t){case"left":return e.getDisplayedLeftColumns();case"right":return e.getDisplayedRightColumns();default:return e.getDisplayedCenterColumns()}}static calculateValidMoves(e){const{movingCols:t,draggingRight:i,xPosition:s,pinned:o,gos:n,columnModel:r}=e;if(n.get("suppressMovableColumns")||t.some((e=>e.getColDef().suppressMovable)))return[];const a=this.getDisplayedColumns(r,o),l=r.getAllGridColumns(),u=a.filter((e=>dn(t,e))),h=a.filter((e=>!dn(t,e))),d=l.filter((e=>!dn(t,e)));let c,p=0,g=s;if(i){let e=0;u.forEach((t=>e+=t.getActualWidth())),g-=e}if(g>0){for(let e=0;e<h.length&&(g-=h[e].getActualWidth(),!(g<0));e++)p++;i&&p++}if(p>0){const e=h[p-1];c=d.indexOf(e)+1}else c=d.indexOf(h[0]),-1===c&&(c=0);const m=[c],f=(e,t)=>e-t;if(i){let e=c+1;const t=l.length-1;for(;e<=t;)m.push(e),e++;m.sort(f)}else{let e=c;const t=l.length-1;let i=l[e];for(;e<=t&&a.indexOf(i)<0;)e++,m.push(e),i=l[e];e=c-1;const s=0;for(;e>=s;)m.push(e),e--;m.sort(f).reverse()}return m}static normaliseX(e,t,i,s,o){const n=o.getHeaderRowContainerCtrl(t).getViewport();return i&&(e-=n.getBoundingClientRect().left),s.get("enableRtl")&&(e=n.clientWidth-e),null==t&&(e+=o.get("center").getCenterViewportScrollLeft()),e}},ac=class{constructor(e){this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.pinned=e,this.isCenterContainer=!Bs(e)}init(){this.ctrlsService.whenReady((e=>{this.gridBodyCon=e.gridBodyCtrl}))}getIconName(){return this.pinned?hh.ICON_PINNED:hh.ICON_MOVE}onDragEnter(e){const t=e.dragItem.columns;if(0===e.dragSource.type)this.setColumnsVisible(t,!0,"uiColumnDragged");else{const i=e.dragItem.visibleState,s=(t||[]).filter((e=>i[e.getId()]));this.setColumnsVisible(s,!0,"uiColumnDragged")}this.setColumnsPinned(t,this.pinned,"uiColumnDragged"),this.onDragging(e,!0,!0)}onDragLeave(){this.ensureIntervalCleared(),this.lastMovedInfo=null}setColumnsVisible(e,t,i){if(e){const s=e.filter((e=>!e.getColDef().lockVisible));this.columnModel.setColumnsVisible(s,t,i)}}setColumnsPinned(e,t,i){if(e){const s=e.filter((e=>!e.getColDef().lockPinned));this.columnModel.setColumnsPinned(s,t,i)}}onDragStop(){this.onDragging(this.lastDraggingEvent,!1,!0,!0),this.ensureIntervalCleared(),this.lastMovedInfo=null}checkCenterForScrolling(e){if(this.isCenterContainer){const t=this.ctrlsService.get("center"),i=t.getCenterViewportScrollLeft(),s=i+t.getCenterWidth();this.gos.get("enableRtl")?(this.needToMoveRight=e<i+50,this.needToMoveLeft=e>s-50):(this.needToMoveLeft=e<i+50,this.needToMoveRight=e>s-50),this.needToMoveLeft||this.needToMoveRight?this.ensureIntervalStarted():this.ensureIntervalCleared()}}onDragging(e=this.lastDraggingEvent,t=!1,i=!1,s=!1){var o;if(s){if(this.lastMovedInfo){const{columns:e,toIndex:t}=this.lastMovedInfo;rc.moveColumns(e,t,"uiColumnMoved",!0,this.columnModel)}return}if(this.lastDraggingEvent=e,Ws(e.hDirection))return;const n=rc.normaliseX(e.x,this.pinned,!1,this.gos,this.ctrlsService);t||this.checkCenterForScrolling(n);const r=this.normaliseDirection(e.hDirection),a=e.dragSource.type,l=(null==(o=e.dragSource.getDragItem().columns)?void 0:o.filter((e=>!e.getColDef().lockPinned||e.getPinned()==this.pinned)))||[],u=rc.attemptMoveColumns({allMovingColumns:l,isFromHeader:1===a,hDirection:r,xPosition:n,pinned:this.pinned,fromEnter:t,fakeEvent:i,gos:this.gos,columnModel:this.columnModel});u&&(this.lastMovedInfo=u)}normaliseDirection(e){if(!this.gos.get("enableRtl"))return e;switch(e){case 0:return 1;case 1:return 0;default:console.error(`AG Grid: Unknown direction ${e}`)}}ensureIntervalStarted(){this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),100),this.needToMoveLeft?this.dragAndDropService.setGhostIcon(hh.ICON_LEFT,!0):this.dragAndDropService.setGhostIcon(hh.ICON_RIGHT,!0))}ensureIntervalCleared(){this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.dragAndDropService.setGhostIcon(hh.ICON_MOVE))}moveInterval(){let e;this.intervalCount++,e=10+5*this.intervalCount,e>100&&(e=100);let t=null;const i=this.gridBodyCon.getScrollFeature();if(this.needToMoveLeft?t=i.scrollHorizontally(-e):this.needToMoveRight&&(t=i.scrollHorizontally(e)),0!==t)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;const e=this.lastDraggingEvent.dragItem.columns.filter((e=>!e.getColDef().lockPinned));if(e.length>0&&(this.dragAndDropService.setGhostIcon(hh.ICON_PINNED),this.failedMoveAttempts>7)){const t=this.needToMoveLeft?"left":"right";this.setColumnsPinned(e,t,"uiColumnDragged"),this.dragAndDropService.nudge()}}}};Gs([No("columnModel")],ac.prototype,"columnModel",2),Gs([No("dragAndDropService")],ac.prototype,"dragAndDropService",2),Gs([No("gridOptionsService")],ac.prototype,"gos",2),Gs([No("ctrlsService")],ac.prototype,"ctrlsService",2),Gs([Lo],ac.prototype,"init",1);var lc=class extends Pn{constructor(e,t){super(),this.pinned=e,this.eContainer=t}postConstruct(){this.ctrlsService.whenReady((e=>{switch(this.pinned){case"left":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.left.getContainerElement()],[e.bottomLeft.getContainerElement()],[e.topLeft.getContainerElement()]];break;case"right":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.right.getContainerElement()],[e.bottomRight.getContainerElement()],[e.topRight.getContainerElement()]];break;default:this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.center.getViewportElement()],[e.bottomCenter.getViewportElement()],[e.topCenter.getViewportElement()]]}}))}isInterestedIn(e){return 1===e||0===e&&this.gos.get("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}init(){this.moveColumnFeature=this.createManagedBean(new ac(this.pinned)),this.bodyDropPivotTarget=this.createManagedBean(new nc(this.pinned)),this.dragAndDropService.addDropTarget(this)}getIconName(){return this.currentDropListener.getIconName()}isDropColumnInPivotMode(e){return this.columnModel.isPivotMode()&&0===e.dragSource.type}onDragEnter(e){this.currentDropListener=this.isDropColumnInPivotMode(e)?this.bodyDropPivotTarget:this.moveColumnFeature,this.currentDropListener.onDragEnter(e)}onDragLeave(e){this.currentDropListener.onDragLeave(e)}onDragging(e){this.currentDropListener.onDragging(e)}onDragStop(e){this.currentDropListener.onDragStop(e)}};Gs([No("dragAndDropService")],lc.prototype,"dragAndDropService",2),Gs([No("columnModel")],lc.prototype,"columnModel",2),Gs([No("ctrlsService")],lc.prototype,"ctrlsService",2),Gs([Lo],lc.prototype,"postConstruct",1),Gs([Lo],lc.prototype,"init",1);var uc=class e extends md{constructor(t){super(e.TEMPLATE,t),this.headerCompVersion=0,this.column=t.getColumnGroupChild(),this.pinned=t.getPinned()}postConstruct(){const e=this.getGui();((t,i)=>{null!=i&&""!=i?e.setAttribute(t,i):e.removeAttribute(t)})("col-id",this.column.getColId());const t={setWidth:t=>e.style.width=t,addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setAriaSort:t=>t?Gr(e,t):kr(e),setUserCompDetails:e=>this.setUserCompDetails(e),getUserCompInstance:()=>this.headerComp};this.ctrl.setComp(t,this.getGui(),this.eResize,this.eHeaderCompWrapper);const i=this.ctrl.getSelectAllGui();this.eResize.insertAdjacentElement("afterend",i)}destroyHeaderComp(){this.headerComp&&(this.eHeaderCompWrapper.removeChild(this.headerCompGui),this.headerComp=this.destroyBean(this.headerComp),this.headerCompGui=void 0)}setUserCompDetails(e){this.headerCompVersion++;const t=this.headerCompVersion;e.newAgStackInstance().then((e=>this.afterCompCreated(t,e)))}afterCompCreated(e,t){e==this.headerCompVersion&&this.isAlive()?(this.destroyHeaderComp(),this.headerComp=t,this.headerCompGui=t.getGui(),this.eHeaderCompWrapper.appendChild(this.headerCompGui),this.ctrl.setDragSource(this.getGui())):this.destroyBean(t)}};uc.TEMPLATE='<div class="ag-header-cell" role="columnheader">\n <div ref="eResize" class="ag-header-cell-resize" role="presentation"></div>\n <div ref="eHeaderCompWrapper" class="ag-header-cell-comp-wrapper" role="presentation"></div>\n </div>',Gs([ql("eResize")],uc.prototype,"eResize",2),Gs([ql("eHeaderCompWrapper")],uc.prototype,"eHeaderCompWrapper",2),Gs([Lo],uc.prototype,"postConstruct",1),Gs([xo],uc.prototype,"destroyHeaderComp",1);var hc=uc,dc=class e extends md{constructor(t){super(e.TEMPLATE,t)}postConstruct(){const e=this.getGui();e.setAttribute("col-id",this.ctrl.getColId());const t={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setResizableDisplayed:e=>La(this.eResize,e),setWidth:t=>e.style.width=t,setAriaExpanded:t=>((t,i)=>null!=i?e.setAttribute(t,i):e.removeAttribute(t))("aria-expanded",t),setUserCompDetails:e=>this.setUserCompDetails(e),getUserCompInstance:()=>this.headerGroupComp};this.ctrl.setComp(t,e,this.eResize)}setUserCompDetails(e){e.newAgStackInstance().then((e=>this.afterHeaderCompCreated(e)))}afterHeaderCompCreated(e){const t=()=>this.destroyBean(e);if(!this.isAlive())return void t();const i=this.getGui(),s=e.getGui();i.appendChild(s),this.addDestroyFunc(t),this.headerGroupComp=e,this.ctrl.setDragSource(i)}};dc.TEMPLATE='<div class="ag-header-group-cell" role="columnheader">\n <div ref="eResize" class="ag-header-cell-resize" role="presentation"></div>\n </div>',Gs([ql("eResize")],dc.prototype,"eResize",2),Gs([Lo],dc.prototype,"postConstruct",1);var cc=dc,pc=(e=>(e.COLUMN_GROUP="group",e.COLUMN="column",e.FLOATING_FILTER="filter",e))(pc||{}),gc=class extends Yl{constructor(e){super(),this.headerComps={},this.ctrl=e,this.setTemplate(`<div class="${this.ctrl.getHeaderRowClass()}" role="row"></div>`)}init(){Ir(this.getGui(),this.ctrl.getAriaRowIndex());const e={setHeight:e=>this.getGui().style.height=e,setTop:e=>this.getGui().style.top=e,setHeaderCtrls:(e,t)=>this.setHeaderCtrls(e,t),setWidth:e=>this.getGui().style.width=e};this.ctrl.setComp(e)}destroyHeaderCtrls(){this.setHeaderCtrls([],!1)}setHeaderCtrls(e,t){if(!this.isAlive())return;const i=this.headerComps;if(this.headerComps={},e.forEach((e=>{const t=e.getInstanceId();let s=i[t];delete i[t],null==s&&(s=this.createHeaderComp(e),this.getGui().appendChild(s.getGui())),this.headerComps[t]=s})),eo(i,((e,t)=>{this.getGui().removeChild(t.getGui()),this.destroyBean(t)})),t){const e=so(this.headerComps);e.sort(((e,t)=>e.getCtrl().getColumnGroupChild().getLeft()-t.getCtrl().getColumnGroupChild().getLeft()));const t=e.map((e=>e.getGui()));Xa(this.getGui(),t)}}createHeaderComp(e){let t;switch(this.ctrl.getType()){case"group":t=new cc(e);break;case"filter":t=new Cd(e);break;default:t=new hc(e)}return this.createBean(t),t.setParentComponent(this),t}};Gs([Lo],gc.prototype,"init",1),Gs([xo],gc.prototype,"destroyHeaderCtrls",1);var mc=0,fc=class e extends Pn{constructor(e,t,i){super(),this.resizeToggleTimeout=0,this.resizeMultiplier=1,this.resizeFeature=null,this.lastFocusEvent=null,this.dragSource=null,this.columnGroupChild=e,this.parentRowCtrl=i,this.beans=t,this.instanceId=e.getUniqueId()+"-"+mc++}postConstruct(){this.addManagedPropertyListeners(["suppressHeaderFocus"],(()=>this.refreshTabIndex()))}shouldStopEventPropagation(e){const{headerRowIndex:t,column:i}=this.focusService.getFocusedHeader();return Ml(this.gos,e,t,i)}getWrapperHasFocus(){return this.gos.getActiveDomElement()===this.eGui}setGui(e){this.eGui=e,this.addDomData(),this.addManagedListener(this.beans.eventService,In.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.onDisplayedColumnsChanged(),this.refreshTabIndex()}onDisplayedColumnsChanged(){this.comp&&this.column&&(this.refreshFirstAndLastStyles(),this.refreshAriaColIndex())}refreshFirstAndLastStyles(){const{comp:e,column:t,beans:i}=this;Md.refreshFirstAndLastStyles(e,t,i.columnModel)}refreshAriaColIndex(){const{beans:e,column:t}=this,i=e.columnModel.getAriaColumnIndex(t);_r(this.eGui,i)}addResizeAndMoveKeyboardListeners(){this.resizeFeature&&(this.addManagedListener(this.eGui,"keydown",this.onGuiKeyDown.bind(this)),this.addManagedListener(this.eGui,"keyup",this.onGuiKeyUp.bind(this)))}refreshTabIndex(){this.gos.get("suppressHeaderFocus")?this.eGui.removeAttribute("tabindex"):this.eGui.setAttribute("tabindex","-1")}onGuiKeyDown(e){var t;const i=this.gos.getActiveDomElement(),s=e.key===El.LEFT||e.key===El.RIGHT;if(this.isResizing&&(e.preventDefault(),e.stopImmediatePropagation()),i!==this.eGui||!e.shiftKey&&!e.altKey)return;if((this.isResizing||s)&&(e.preventDefault(),e.stopImmediatePropagation()),!s)return;const o=e.key===El.LEFT!==this.gos.get("enableRtl"),n=uh[o?"Left":"Right"];if(e.altKey){this.isResizing=!0,this.resizeMultiplier+=1;const i=this.getViewportAdjustedResizeDiff(e);this.resizeHeader(i,e.shiftKey),null==(t=this.resizeFeature)||t.toggleColumnResizing(!0)}else this.moveHeader(n)}getViewportAdjustedResizeDiff(e){let t=this.getResizeDiff(e);if(this.column.getPinned()){const e=this.pinnedWidthService.getPinnedLeftWidth(),i=this.pinnedWidthService.getPinnedRightWidth(),s=Ga(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50;if(e+i+t>s){if(!(s>e+i))return 0;t=s-e-i}}return t}getResizeDiff(e){let t=e.key===El.LEFT!==this.gos.get("enableRtl");const i=this.column.getPinned(),s=this.gos.get("enableRtl");return i&&s!==("right"===i)&&(t=!t),(t?-1:1)*this.resizeMultiplier}onGuiKeyUp(){this.isResizing&&(this.resizeToggleTimeout&&(window.clearTimeout(this.resizeToggleTimeout),this.resizeToggleTimeout=0),this.isResizing=!1,this.resizeMultiplier=1,this.resizeToggleTimeout=setTimeout((()=>{var e;null==(e=this.resizeFeature)||e.toggleColumnResizing(!1)}),150))}handleKeyDown(e){const t=this.getWrapperHasFocus();switch(e.key){case El.PAGE_DOWN:case El.PAGE_UP:case El.PAGE_HOME:case El.PAGE_END:t&&e.preventDefault()}}addDomData(){const t=e.DOM_DATA_KEY_HEADER_CTRL;this.gos.setDomData(this.eGui,t,this),this.addDestroyFunc((()=>this.gos.setDomData(this.eGui,t,null)))}getGui(){return this.eGui}focus(e){return!!this.eGui&&(this.lastFocusEvent=e||null,this.eGui.focus(),!0)}getRowIndex(){return this.parentRowCtrl.getRowIndex()}getParentRowCtrl(){return this.parentRowCtrl}getPinned(){return this.parentRowCtrl.getPinned()}getInstanceId(){return this.instanceId}getColumnGroupChild(){return this.columnGroupChild}removeDragSource(){this.dragSource&&(this.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null)}handleContextMenuMouseEvent(e,t,i){const s=null!=e?e:t;this.gos.get("preventDefaultOnContextMenu")&&s.preventDefault();const o=i instanceof $o?i:void 0;this.menuService.isHeaderContextMenuEnabled(o)&&this.menuService.showHeaderContextMenu(o,e,t),this.dispatchColumnMouseEvent(In.EVENT_COLUMN_HEADER_CONTEXT_MENU,i)}dispatchColumnMouseEvent(e,t){const i={type:e,column:t};this.eventService.dispatchEvent(i)}destroy(){super.destroy(),this.removeDragSource(),this.comp=null,this.column=null,this.resizeFeature=null,this.lastFocusEvent=null,this.columnGroupChild=null,this.parentRowCtrl=null,this.eGui=null}};fc.DOM_DATA_KEY_HEADER_CTRL="headerCtrl",Gs([No("pinnedWidthService")],fc.prototype,"pinnedWidthService",2),Gs([No("focusService")],fc.prototype,"focusService",2),Gs([No("userComponentFactory")],fc.prototype,"userComponentFactory",2),Gs([No("ctrlsService")],fc.prototype,"ctrlsService",2),Gs([No("dragAndDropService")],fc.prototype,"dragAndDropService",2),Gs([No("menuService")],fc.prototype,"menuService",2),Gs([Lo],fc.prototype,"postConstruct",1);var Cc=fc,vc=class extends Pn{constructor(e,t,i,s){super(),this.columnOrGroup=e,this.eCell=t,this.ariaEl=this.eCell.querySelector("[role=columnheader]")||this.eCell,this.colsSpanning=s,this.beans=i}setColsSpanning(e){this.colsSpanning=e,this.onLeftChanged()}getColumnOrGroup(){return this.beans.gos.get("enableRtl")&&this.colsSpanning?Jo(this.colsSpanning):this.columnOrGroup}postConstruct(){this.addManagedListener(this.columnOrGroup,$o.EVENT_LEFT_CHANGED,this.onLeftChanged.bind(this)),this.setLeftFirstTime(),this.addManagedListener(this.eventService,In.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onLeftChanged.bind(this)),this.addManagedPropertyListener("domLayout",this.onLeftChanged.bind(this))}setLeftFirstTime(){const e=this.beans.gos.get("suppressColumnMoveAnimation"),t=Bs(this.columnOrGroup.getOldLeft());this.beans.columnAnimationService.isActive()&&t&&!e?this.animateInLeft():this.onLeftChanged()}animateInLeft(){const e=this.getColumnOrGroup(),t=e.getLeft(),i=e.getOldLeft(),s=this.modifyLeftForPrintLayout(e,i),o=this.modifyLeftForPrintLayout(e,t);this.setLeft(s),this.actualLeft=o,this.beans.columnAnimationService.executeNextVMTurn((()=>{this.actualLeft===o&&this.setLeft(o)}))}onLeftChanged(){const e=this.getColumnOrGroup(),t=e.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(e,t),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(e,t){if(!this.beans.gos.isDomLayout("print"))return t;if("left"===e.getPinned())return t;const i=this.beans.columnModel.getDisplayedColumnsLeftWidth();return"right"===e.getPinned()?i+this.beans.columnModel.getBodyContainerWidth()+t:i+t}setLeft(e){let t;if(Bs(e)&&(this.eCell.style.left=`${e}px`),this.columnOrGroup instanceof $o)t=this.columnOrGroup;else{const e=this.columnOrGroup.getLeafColumns();if(!e.length)return;e.length>1&&Or(this.ariaEl,e.length),t=e[0]}}};Gs([Lo],vc.prototype,"postConstruct",1);var wc=class extends Pn{constructor(e,t){super(),this.columns=e,this.element=t}postConstruct(){this.gos.get("columnHoverHighlight")&&this.addMouseHoverListeners()}addMouseHoverListeners(){this.addManagedListener(this.element,"mouseout",this.onMouseOut.bind(this)),this.addManagedListener(this.element,"mouseover",this.onMouseOver.bind(this))}onMouseOut(){this.columnHoverService.clearMouseOver()}onMouseOver(){this.columnHoverService.setMouseOver(this.columns)}};Gs([No("columnHoverService")],wc.prototype,"columnHoverService",2),Gs([Lo],wc.prototype,"postConstruct",1);var yc=class extends Cc{constructor(e,t,i){super(e,t,i),this.iconCreated=!1,this.column=e}setComp(e,t,i,s){this.comp=e,this.eButtonShowMainFilter=i,this.eFloatingFilterBody=s,this.setGui(t),this.setupActive(),this.setupWidth(),this.setupLeft(),this.setupHover(),this.setupFocus(),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(),this.setupUi(),this.addManagedListener(this.eButtonShowMainFilter,"click",this.showParentFilter.bind(this)),this.setupFilterChangedListener(),this.addManagedListener(this.column,$o.EVENT_COL_DEF_CHANGED,this.onColDefChanged.bind(this))}resizeHeader(){}moveHeader(){}setupActive(){const e=this.column.getColDef(),t=!!e.filter,i=!!e.floatingFilter;this.active=t&&i}setupUi(){if(this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton&&this.active),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body",this.suppressFilterButton),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body",!this.suppressFilterButton),!this.active||this.iconCreated)return;const e=wl("filter",this.gos,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(){this.createManagedBean(new iu(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){const e=this.localeService.getLocaleTextFunc();Cr(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){if(this.gos.getActiveDomElement()===this.eGui)return;const t=this.focusService.findNextFocusableElement(this.eGui,null,e.shiftKey);if(t)return this.beans.headerNavigationService.scrollToColumn(this.column),e.preventDefault(),void t.focus();const i=this.findNextColumnWithFloatingFilter(e.shiftKey);i&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:this.getParentRowCtrl().getRowIndex(),column:i},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.columnModel;let i=this.column;do{if(i=e?t.getDisplayedColBefore(i):t.getDisplayedColAfter(i),!i)break}while(!i.getColDef().filter||!i.getColDef().floatingFilter);return i}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case El.UP:case El.DOWN:t||e.preventDefault();case El.LEFT:case El.RIGHT:if(t)return;e.stopPropagation();case El.ENTER:t&&this.focusService.focusInto(this.eGui)&&e.preventDefault();break;case El.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const t=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),i=!!e.relatedTarget&&Na(e.relatedTarget,"ag-floating-filter");if(t&&i&&e.target===this.eGui){const e=this.lastFocusEvent,t=!(!e||e.key!==El.TAB);if(e&&t){const t=e.shiftKey;this.focusService.focusInto(this.eGui,t)}}const s=this.getRowIndex();this.beans.focusService.setFocusedHeader(s,this.column)}setupHover(){this.createManagedBean(new wc([this.column],this.eGui));const e=()=>{if(!this.gos.get("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",e)};this.addManagedListener(this.eventService,In.EVENT_COLUMN_HOVER_CHANGED,e),e()}setupLeft(){const e=new vc(this.column,this.eGui,this.beans);this.createManagedBean(e)}setupFilterButton(){this.suppressFilterButton=!this.menuService.isFloatingFilterButtonEnabled(this.column),this.highlightFilterButtonWhenActive=!this.menuService.isLegacyMenuEnabled()}setupUserComp(){if(!this.active)return;const e=this.beans.filterManager.getFloatingFilterCompDetails(this.column,(()=>this.showParentFilter()));e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;this.menuService.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(){if(!this.active)return;const{filterManager:e}=this.beans,t=t=>{if("filterDestroyed"===(null==t?void 0:t.source)&&this.context.isDestroyed())return;const i=this.comp.getFloatingFilterComp();i&&i.then((i=>{var s;if(i){const o=e.getCurrentFloatingFilterParentModel(this.column);i.onParentModelChanged(o,t?this.gos.addGridCommonParams({columns:null!=(s=t.columns)?s:[],type:In.EVENT_FILTER_CHANGED,source:"api"===t.source?"api":"columnFilter"}):null)}}))};this.destroySyncListener=this.addManagedListener(this.column,$o.EVENT_FILTER_CHANGED,t),e.isFilterActive(this.column)&&t(null)}setupWidth(){const e=()=>{const e=`${this.column.getActualWidth()}px`;this.comp.setWidth(e)};this.addManagedListener(this.column,$o.EVENT_WIDTH_CHANGED,e),e()}setupFilterChangedListener(){this.active&&(this.destroyFilterChangedListener=this.addManagedListener(this.column,$o.EVENT_FILTER_CHANGED,this.updateFilterButton.bind(this)),this.updateFilterButton())}updateFilterButton(){if(!this.suppressFilterButton&&this.comp){const e=this.beans.filterManager.isFilterAllowed(this.column);this.comp.setButtonWrapperDisplayed(e),this.highlightFilterButtonWhenActive&&e&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(){var e,t;const i=this.active;this.setupActive();const s=!i&&this.active;i&&!this.active&&(null==(e=this.destroySyncListener)||e.call(this),null==(t=this.destroyFilterChangedListener)||t.call(this));const o=this.active?this.beans.filterManager.getFloatingFilterCompDetails(this.column,(()=>this.showParentFilter())):null,n=this.comp.getFloatingFilterComp();n&&o?n.then((e=>{var t;!e||this.beans.filterManager.areFilterCompsDifferent(null!=(t=this.userCompDetails)?t:null,o)?this.updateCompDetails(o,s):this.updateFloatingFilterParams(o)})):this.updateCompDetails(o,s)}updateCompDetails(e,t){this.isAlive()&&(this.setCompDetails(e),this.setupFilterButton(),this.setupUi(),t&&(this.setupSyncWithFilter(),this.setupFilterChangedListener()))}updateFloatingFilterParams(e){var t;if(!e)return;const i=e.params;null==(t=this.comp.getFloatingFilterComp())||t.then((e=>{let t=!1;(null==e?void 0:e.refresh)&&"function"==typeof e.refresh&&null!==e.refresh(i)&&(t=!0),!t&&(null==e?void 0:e.onParamsUpdated)&&"function"==typeof e.onParamsUpdated&&null!==e.onParamsUpdated(i)&&co("Custom floating filter method 'onParamsUpdated' is deprecated. Use 'refresh' instead.")}))}destroy(){super.destroy(),this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.destroySyncListener=null,this.destroyFilterChangedListener=null}},Ec=class extends Pn{constructor(e,t,i,s,o){super(),this.pinned=e,this.column=t,this.eResize=i,this.comp=s,this.ctrl=o}postConstruct(){const e=[];let t,i;const s=()=>{if(La(this.eResize,t),!t)return;const s=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(e.push(s),i){const t=this.gos.get("skipHeaderOnAutoSize"),i=()=>{this.columnModel.autoSizeColumn(this.column,"uiColumnResized",t)};this.eResize.addEventListener("dblclick",i);const s=new zu(this.eResize);s.addEventListener(zu.EVENT_DOUBLE_TAP,i),e.push((()=>{this.eResize.removeEventListener("dblclick",i),s.removeEventListener(zu.EVENT_DOUBLE_TAP,i),s.destroy()}))}},o=()=>{e.forEach((e=>e())),e.length=0},n=()=>{const e=this.column.isResizable(),n=!this.gos.get("suppressAutoSize")&&!this.column.getColDef().suppressAutoSize;(e!==t||n!==i)&&(t=e,i=n,o(),s())};n(),this.addDestroyFunc(o),this.ctrl.addRefreshFunction(n)}onResizing(e,t){const{column:i,lastResizeAmount:s,resizeStartWidth:o}=this,n=this.normaliseResizeAmount(t),r=[{key:i,newWidth:o+n}];this.column.getPinned()&&this.pinnedWidthService.getPinnedLeftWidth()+this.pinnedWidthService.getPinnedRightWidth()+(n-s)>Ga(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50||(this.lastResizeAmount=n,this.columnModel.setColumnWidths(r,this.resizeWithShiftKey,e,"uiColumnResized"),e&&this.toggleColumnResizing(!1))}onResizeStart(e){this.resizeStartWidth=this.column.getActualWidth(),this.lastResizeAmount=0,this.resizeWithShiftKey=e,this.toggleColumnResizing(!0)}toggleColumnResizing(e){this.comp.addOrRemoveCssClass("ag-column-resizing",e)}normaliseResizeAmount(e){let t=e;const i="left"!==this.pinned,s="right"===this.pinned;return this.gos.get("enableRtl")?i&&(t*=-1):s&&(t*=-1),t}};Gs([No("horizontalResizeService")],Ec.prototype,"horizontalResizeService",2),Gs([No("pinnedWidthService")],Ec.prototype,"pinnedWidthService",2),Gs([No("ctrlsService")],Ec.prototype,"ctrlsService",2),Gs([No("columnModel")],Ec.prototype,"columnModel",2),Gs([Lo],Ec.prototype,"postConstruct",1);var Sc=class extends Pn{constructor(e){super(),this.cbSelectAllVisible=!1,this.processingEventFromCheckbox=!1,this.column=e}onSpaceKeyDown(e){const t=this.cbSelectAll;t.isDisplayed()&&!t.getGui().contains(this.gos.getActiveDomElement())&&(e.preventDefault(),t.setValue(!t.getValue()))}getCheckboxGui(){return this.cbSelectAll.getGui()}setComp(e){this.headerCellCtrl=e,this.cbSelectAll=this.createManagedBean(new fu),this.cbSelectAll.addCssClass("ag-header-select-all"),cr(this.cbSelectAll.getGui(),"presentation"),this.showOrHideSelectAll(),this.addManagedListener(this.eventService,In.EVENT_NEW_COLUMNS_LOADED,this.onNewColumnsLoaded.bind(this)),this.addManagedListener(this.eventService,In.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,In.EVENT_SELECTION_CHANGED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.eventService,In.EVENT_PAGINATION_CHANGED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.eventService,In.EVENT_MODEL_UPDATED,this.onModelChanged.bind(this)),this.addManagedListener(this.cbSelectAll,In.EVENT_FIELD_VALUE_CHANGED,this.onCbSelectAll.bind(this)),Dr(this.cbSelectAll.getGui(),!0),this.cbSelectAll.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()}onNewColumnsLoaded(){this.showOrHideSelectAll()}onDisplayedColumnsChanged(){this.isAlive()&&this.showOrHideSelectAll()}showOrHideSelectAll(){this.cbSelectAllVisible=this.isCheckboxSelection(),this.cbSelectAll.setDisplayed(this.cbSelectAllVisible,{skipAriaHidden:!0}),this.cbSelectAllVisible&&(this.checkRightRowModelType("selectAllCheckbox"),this.checkSelectionType("selectAllCheckbox"),this.updateStateOfCheckbox()),this.refreshSelectAllLabel()}onModelChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}onSelectionChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}updateStateOfCheckbox(){if(this.processingEventFromCheckbox)return;this.processingEventFromCheckbox=!0;const e=this.selectionService.getSelectAllState(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setValue(e);const t=this.selectionService.hasNodesToSelect(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setDisabled(!t),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}refreshSelectAllLabel(){const e=this.localeService.getLocaleTextFunc(),t=this.cbSelectAll.getValue()?e("ariaChecked","checked"):e("ariaUnchecked","unchecked"),i=e("ariaRowSelectAll","Press Space to toggle all rows selection");this.cbSelectAllVisible?this.headerCellCtrl.setAriaDescriptionProperty("selectAll",`${i} (${t})`):this.headerCellCtrl.setAriaDescriptionProperty("selectAll",null),this.cbSelectAll.setInputAriaLabel(`${i} (${t})`),this.headerCellCtrl.announceAriaDescription()}checkSelectionType(e){return!("multiple"!==this.gos.get("rowSelection")&&(console.warn(`AG Grid: ${e} is only available if using 'multiple' rowSelection.`),1))}checkRightRowModelType(e){const t=this.rowModel.getType();return!("clientSide"!==t&&"serverSide"!==t&&(console.warn(`AG Grid: ${e} is only available if using 'clientSide' or 'serverSide' rowModelType, you are using ${t}.`),1))}onCbSelectAll(){if(this.processingEventFromCheckbox)return;if(!this.cbSelectAllVisible)return;const e=this.cbSelectAll.getValue(),t=this.isFilteredOnly(),i=this.isCurrentPageOnly();let s="uiSelectAll";i?s="uiSelectAllCurrentPage":t&&(s="uiSelectAllFiltered");const o={source:s,justFiltered:t,justCurrentPage:i};e?this.selectionService.selectAllRowNodes(o):this.selectionService.deselectAllRowNodes(o)}isCheckboxSelection(){let e=this.column.getColDef().headerCheckboxSelection;return"function"==typeof e&&(e=e(this.gos.addGridCommonParams({column:this.column,colDef:this.column.getColDef()}))),!!e&&this.checkRightRowModelType("headerCheckboxSelection")&&this.checkSelectionType("headerCheckboxSelection")}isFilteredOnly(){return!!this.column.getColDef().headerCheckboxSelectionFilteredOnly}isCurrentPageOnly(){return!!this.column.getColDef().headerCheckboxSelectionCurrentPageOnly}};Gs([No("rowModel")],Sc.prototype,"rowModel",2),Gs([No("selectionService")],Sc.prototype,"selectionService",2);var bc=class extends Cc{constructor(e,t,i){super(e,t,i),this.refreshFunctions=[],this.userHeaderClasses=new Set,this.ariaDescriptionProperties=new Map,this.column=e}setComp(e,t,i,s){this.comp=e,this.setGui(t),this.updateState(),this.setupWidth(),this.setupMovingCss(),this.setupMenuClass(),this.setupSortableClass(),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight(s),this.addColumnHoverListener(),this.setupFilterClass(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(),this.setupSelectAll(),this.setupUserComp(),this.refreshAria(),this.resizeFeature=this.createManagedBean(new Ec(this.getPinned(),this.column,i,e,this)),this.createManagedBean(new wc([this.column],t)),this.createManagedBean(new vc(this.column,t,this.beans)),this.createManagedBean(new iu(t,{shouldStopEventPropagation:e=>this.shouldStopEventPropagation(e),onTabKeyDown:()=>null,handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addResizeAndMoveKeyboardListeners(),this.addManagedPropertyListeners(["suppressMovableColumns","suppressMenuHide","suppressAggFuncInHeader"],this.refresh.bind(this)),this.addManagedListener(this.column,$o.EVENT_COL_DEF_CHANGED,this.refresh.bind(this)),this.addManagedListener(this.eventService,In.EVENT_COLUMN_VALUE_CHANGED,this.onColumnValueChanged.bind(this)),this.addManagedListener(this.eventService,In.EVENT_COLUMN_ROW_GROUP_CHANGED,this.onColumnRowGroupChanged.bind(this)),this.addManagedListener(this.eventService,In.EVENT_COLUMN_PIVOT_CHANGED,this.onColumnPivotChanged.bind(this)),this.addManagedListener(this.eventService,In.EVENT_HEADER_HEIGHT_CHANGED,this.onHeaderHeightChanged.bind(this))}resizeHeader(e,t){var i,s;if(!this.column.isResizable())return;const o=this.column.getActualWidth(),n=null!=(i=this.column.getMinWidth())?i:0,r=null!=(s=this.column.getMaxWidth())?s:Number.MAX_SAFE_INTEGER,a=Math.min(Math.max(o+e,n),r);this.beans.columnModel.setColumnWidths([{key:this.column,newWidth:a}],t,!0,"uiColumnResized")}moveHeader(e){const{eGui:t,column:i,gos:s,ctrlsService:o}=this,n=this.getPinned(),r=t.getBoundingClientRect().left,a=i.getActualWidth(),l=0===e!==s.get("enableRtl"),u=rc.normaliseX(l?r-20:r+a+20,n,!0,s,o);rc.attemptMoveColumns({allMovingColumns:[i],isFromHeader:!0,hDirection:e,xPosition:u,pinned:n,fromEnter:!1,fakeEvent:!1,gos:s,columnModel:this.beans.columnModel}),o.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(i,"auto")}setupUserComp(){const e=this.lookupUserCompDetails();this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setUserCompDetails(e)}lookupUserCompDetails(){const e=this.createParams(),t=this.column.getColDef();return this.userComponentFactory.getHeaderCompDetails(t,e)}createParams(){const e=this.gos.addGridCommonParams({column:this.column,displayName:this.displayName,enableSorting:this.column.isSortable(),enableMenu:this.menuEnabled,enableFilterButton:this.openFilterEnabled&&this.menuService.isHeaderFilterButtonEnabled(this.column),enableFilterIcon:!this.openFilterEnabled||this.menuService.isLegacyMenuEnabled(),showColumnMenu:e=>{this.menuService.showColumnMenu({column:this.column,buttonElement:e,positionBy:"button"})},showColumnMenuAfterMouseClick:e=>{this.menuService.showColumnMenu({column:this.column,mouseEvent:e,positionBy:"mouse"})},showFilter:e=>{this.menuService.showFilterMenu({column:this.column,buttonElement:e,containerType:"columnFilter",positionBy:"button"})},progressSort:e=>{this.beans.sortController.progressSort(this.column,!!e,"uiColumnSorted")},setSort:(e,t)=>{this.beans.sortController.setSortForColumn(this.column,e,!!t,"uiColumnSorted")},eGridHeader:this.getGui(),setTooltip:(e,t)=>{this.setupTooltip(e,t)}});return e}setupSelectAll(){this.selectAllFeature=this.createManagedBean(new Sc(this.column)),this.selectAllFeature.setComp(this)}getSelectAllGui(){return this.selectAllFeature.getCheckboxGui()}handleKeyDown(e){super.handleKeyDown(e),e.key===El.SPACE&&this.selectAllFeature.onSpaceKeyDown(e),e.key===El.ENTER&&this.onEnterKeyDown(e),e.key===El.DOWN&&e.altKey&&this.showMenuOnKeyPress(e,!1)}onEnterKeyDown(e){if(e.ctrlKey||e.metaKey)this.showMenuOnKeyPress(e,!0);else if(this.sortable){const t=e.shiftKey;this.beans.sortController.progressSort(this.column,t,"uiColumnSorted")}}showMenuOnKeyPress(e,t){const i=this.comp.getUserCompInstance();i&&i instanceof Yu&&i.onMenuKeyboardShortcut(t)&&e.preventDefault()}onFocusIn(e){if(!this.getGui().contains(e.relatedTarget)){const e=this.getRowIndex();this.focusService.setFocusedHeader(e,this.column),this.announceAriaDescription()}this.focusService.isKeyboardMode()&&this.setActiveHeader(!0)}onFocusOut(e){this.getGui().contains(e.relatedTarget)||this.setActiveHeader(!1)}setupTooltip(e,t){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const i="whenTruncated"===this.gos.get("tooltipShowMode"),s=this.eGui,o=this.column.getColDef();t||!i||o.headerComponent||(t=()=>{const e=s.querySelector(".ag-header-cell-text");return!e||e.scrollWidth>e.clientWidth});const n={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getGui:()=>s,getLocation:()=>"header",getTooltipValue:()=>null!=e?e:this.column.getColDef().headerTooltip,shouldDisplayTooltip:t},r=this.createManagedBean(new $l(n));this.refreshFunctions.push((()=>r.refreshToolTip()))}setupClassesFromColDef(){const e=()=>{const e=this.column.getColDef(),t=Md.getHeaderClassesFromColDef(e,this.gos,this.column,null),i=this.userHeaderClasses;this.userHeaderClasses=new Set(t),t.forEach((e=>{i.has(e)?i.delete(e):this.comp.addOrRemoveCssClass(e,!0)})),i.forEach((e=>this.comp.addOrRemoveCssClass(e,!1)))};this.refreshFunctions.push(e),e()}setDragSource(e){if(this.dragSourceElement=e,this.removeDragSource(),!e||!this.draggable)return;const{column:t,beans:i,displayName:s,dragAndDropService:o,gos:n}=this,{columnModel:r}=i;let a=!this.gos.get("suppressDragLeaveHidesColumns");const l=this.dragSource={type:1,eElement:e,getDefaultIconName:()=>a?hh.ICON_HIDE:hh.ICON_NOT_ALLOWED,getDragItem:()=>this.createDragItem(t),dragItemName:s,onDragStarted:()=>{a=!n.get("suppressDragLeaveHidesColumns"),t.setMoving(!0,"uiColumnMoved")},onDragStopped:()=>t.setMoving(!1,"uiColumnMoved"),onGridEnter:e=>{var t;if(a){const i=(null==(t=null==e?void 0:e.columns)?void 0:t.filter((e=>!e.getColDef().lockVisible)))||[];r.setColumnsVisible(i,!0,"uiColumnMoved")}},onGridExit:e=>{var t;if(a){const i=(null==(t=null==e?void 0:e.columns)?void 0:t.filter((e=>!e.getColDef().lockVisible)))||[];r.setColumnsVisible(i,!1,"uiColumnMoved")}}};o.addDragSource(l,!0)}createDragItem(e){const t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t}}updateState(){this.menuEnabled=this.menuService.isColumnMenuInHeaderEnabled(this.column),this.openFilterEnabled=this.menuService.isFilterMenuInHeaderEnabled(this.column),this.sortable=this.column.isSortable(),this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()}addRefreshFunction(e){this.refreshFunctions.push(e)}refresh(){this.updateState(),this.refreshHeaderComp(),this.refreshAria(),this.refreshFunctions.forEach((e=>e()))}refreshHeaderComp(){const e=this.lookupUserCompDetails();null!=this.comp.getUserCompInstance()&&this.userCompDetails.componentClass==e.componentClass&&this.attemptHeaderCompRefresh(e.params)?this.setDragSource(this.dragSourceElement):this.setCompDetails(e)}attemptHeaderCompRefresh(e){const t=this.comp.getUserCompInstance();return!!t&&(!!t.refresh&&t.refresh(e))}calculateDisplayName(){return this.beans.columnModel.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(){this.displayName!==this.calculateDisplayName()&&this.refresh()}workOutDraggable(){const e=this.column.getColDef();return!(this.gos.get("suppressMovableColumns")||e.suppressMovable||e.lockPosition)||!!e.enableRowGroup||!!e.enablePivot}onColumnRowGroupChanged(){this.checkDisplayName()}onColumnPivotChanged(){this.checkDisplayName()}onColumnValueChanged(){this.checkDisplayName()}setupWidth(){const e=()=>{const e=this.column.getActualWidth();this.comp.setWidth(`${e}px`)};this.addManagedListener(this.column,$o.EVENT_WIDTH_CHANGED,e),e()}setupMovingCss(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving())};this.addManagedListener(this.column,$o.EVENT_MOVING_CHANGED,e),e()}setupMenuClass(){const e=()=>{this.comp.addOrRemoveCssClass("ag-column-menu-visible",this.column.isMenuVisible())};this.addManagedListener(this.column,$o.EVENT_MENU_VISIBLE_CHANGED,e),e()}setupSortableClass(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-sortable",!!this.sortable)};e(),this.addRefreshFunction(e),this.addManagedListener(this.eventService,$o.EVENT_SORT_CHANGED,this.refreshAriaSort.bind(this))}setupFilterClass(){const e=()=>{const e=this.column.isFilterActive();this.comp.addOrRemoveCssClass("ag-header-cell-filtered",e),this.refreshAria()};this.addManagedListener(this.column,$o.EVENT_FILTER_ACTIVE_CHANGED,e),e()}setupWrapTextClass(){const e=()=>{const e=!!this.column.getColDef().wrapHeaderText;this.comp.addOrRemoveCssClass("ag-header-cell-wrap-text",e)};e(),this.addRefreshFunction(e)}onDisplayedColumnsChanged(){super.onDisplayedColumnsChanged(),this.isAlive()&&this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){const{eGui:e,column:t,comp:i,beans:s}=this;if(!t.isSpanHeaderHeight())return e.style.removeProperty("top"),e.style.removeProperty("height"),i.addOrRemoveCssClass("ag-header-span-height",!1),void i.addOrRemoveCssClass("ag-header-span-total",!1);const{numberOfParents:o,isSpanningTotal:n}=this.column.getColumnGroupPaddingInfo();i.addOrRemoveCssClass("ag-header-span-height",o>0);const{columnModel:r}=s,a=r.getColumnHeaderRowHeight();if(0===o)return i.addOrRemoveCssClass("ag-header-span-total",!1),e.style.setProperty("top","0px"),void e.style.setProperty("height",`${a}px`);i.addOrRemoveCssClass("ag-header-span-total",n);const l=o*(r.isPivotMode()?r.getPivotGroupHeaderHeight():r.getGroupHeaderHeight());e.style.setProperty("top",-l+"px"),e.style.setProperty("height",`${a+l}px`)}setupAutoHeight(e){const{columnModel:t,resizeObserverService:i}=this.beans,s=i=>{if(!this.isAlive())return;const{paddingTop:o,paddingBottom:n,borderBottomWidth:r,borderTopWidth:a}=_a(this.getGui()),l=o+n+r+a,u=e.offsetHeight+l;if(i<5){const t=this.beans.gos.getDocument();if(!t||!t.contains(e)||0==u)return void window.setTimeout((()=>s(i+1)),0)}t.setColumnHeaderHeight(this.column,u)};let o,n=!1;const r=()=>{const e=this.column.isAutoHeaderHeight();e&&!n&&a(),!e&&n&&l()},a=()=>{n=!0,s(0),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!0),o=i.observeResize(e,(()=>s(0)))},l=()=>{n=!1,o&&o(),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!1),o=void 0};r(),this.addDestroyFunc((()=>l())),this.addManagedListener(this.column,$o.EVENT_WIDTH_CHANGED,(()=>n&&s(0))),this.addManagedListener(this.eventService,$o.EVENT_SORT_CHANGED,(()=>{n&&window.setTimeout((()=>s(0)))})),this.addRefreshFunction(r)}refreshAriaSort(){if(this.sortable){const e=this.localeService.getLocaleTextFunc(),t=this.beans.sortController.getDisplaySortForColumn(this.column)||null;this.comp.setAriaSort(pr(t)),this.setAriaDescriptionProperty("sort",e("ariaSortableColumn","Press ENTER to sort"))}else this.comp.setAriaSort(),this.setAriaDescriptionProperty("sort",null)}refreshAriaMenu(){if(this.menuEnabled){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("menu",e("ariaMenuColumn","Press ALT DOWN to open column menu"))}else this.setAriaDescriptionProperty("menu",null)}refreshAriaFilterButton(){if(this.openFilterEnabled&&!this.menuService.isLegacyMenuEnabled()){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("filterButton",e("ariaFilterColumn","Press CTRL ENTER to open filter"))}else this.setAriaDescriptionProperty("filterButton",null)}refreshAriaFiltered(){const e=this.localeService.getLocaleTextFunc();this.column.isFilterActive()?this.setAriaDescriptionProperty("filter",e("ariaColumnFiltered","Column Filtered")):this.setAriaDescriptionProperty("filter",null)}setAriaDescriptionProperty(e,t){null!=t?this.ariaDescriptionProperties.set(e,t):this.ariaDescriptionProperties.delete(e)}announceAriaDescription(){if(!this.eGui.contains(this.beans.gos.getActiveDomElement()))return;const e=Array.from(this.ariaDescriptionProperties.keys()).sort(((e,t)=>"filter"===e?-1:t.charCodeAt(0)-e.charCodeAt(0))).map((e=>this.ariaDescriptionProperties.get(e))).join(". ");this.beans.ariaAnnouncementService.announceValue(e)}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaFilterButton(),this.refreshAriaFiltered()}addColumnHoverListener(){const e=()=>{if(!this.gos.get("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",e)};this.addManagedListener(this.eventService,In.EVENT_COLUMN_HOVER_CHANGED,e),e()}getColId(){return this.column.getColId()}addActiveHeaderMouseListeners(){const e=e=>this.handleMouseOverChange("mouseenter"===e.type);this.addManagedListener(this.getGui(),"mouseenter",e),this.addManagedListener(this.getGui(),"mouseleave",e),this.addManagedListener(this.getGui(),"click",(()=>this.dispatchColumnMouseEvent(In.EVENT_COLUMN_HEADER_CLICKED,this.column))),this.addManagedListener(this.getGui(),"contextmenu",(e=>this.handleContextMenuMouseEvent(e,void 0,this.column)))}handleMouseOverChange(e){this.setActiveHeader(e);const t={type:e?In.EVENT_COLUMN_HEADER_MOUSE_OVER:In.EVENT_COLUMN_HEADER_MOUSE_LEAVE,column:this.column};this.eventService.dispatchEvent(t)}setActiveHeader(e){this.comp.addOrRemoveCssClass("ag-header-active",e)}getAnchorElementForMenu(e){const t=this.comp.getUserCompInstance();return t instanceof Yu?t.getAnchorElementForMenu(e):this.getGui()}destroy(){super.destroy(),this.refreshFunctions=null,this.selectAllFeature=null,this.dragSourceElement=null,this.userCompDetails=null,this.userHeaderClasses=null,this.ariaDescriptionProperties=null}},Rc=class extends Pn{constructor(e,t,i,s){super(),this.eResize=t,this.comp=e,this.pinned=i,this.columnGroup=s}postConstruct(){if(!this.columnGroup.isResizable())return void this.comp.setResizableDisplayed(!1);const e=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(this.addDestroyFunc(e),!this.gos.get("suppressAutoSize")){const e=this.gos.get("skipHeaderOnAutoSize");this.eResize.addEventListener("dblclick",(()=>{const t=[];this.columnGroup.getDisplayedLeafColumns().forEach((e=>{e.getColDef().suppressAutoSize||t.push(e.getColId())})),t.length>0&&this.columnModel.autoSizeColumns({columns:t,skipHeader:e,stopAtGroup:this.columnGroup,source:"uiColumnResized"}),this.resizeLeafColumnsToFit("uiColumnResized")}))}}onResizeStart(e){const t=this.getInitialValues(e);this.storeLocalValues(t),this.toggleColumnResizing(!0)}onResizing(e,t,i="uiColumnResized"){const s=this.normaliseDragChange(t),o=this.resizeStartWidth+s;this.resizeColumnsFromLocalValues(o,i,e)}getInitialValues(e){const t=this.getColumnsToResize(),i=this.getInitialSizeOfColumns(t),s={columnsToResize:t,resizeStartWidth:i,resizeRatios:this.getSizeRatiosOfColumns(t,i)};let o=null;if(e&&(o=this.columnModel.getDisplayedGroupAtDirection(this.columnGroup,"After")),o){const e=o.getDisplayedLeafColumns(),t=s.groupAfterColumns=e.filter((e=>e.isResizable())),i=s.groupAfterStartWidth=this.getInitialSizeOfColumns(t);s.groupAfterRatios=this.getSizeRatiosOfColumns(t,i)}else s.groupAfterColumns=void 0,s.groupAfterStartWidth=void 0,s.groupAfterRatios=void 0;return s}storeLocalValues(e){const{columnsToResize:t,resizeStartWidth:i,resizeRatios:s,groupAfterColumns:o,groupAfterStartWidth:n,groupAfterRatios:r}=e;this.resizeCols=t,this.resizeStartWidth=i,this.resizeRatios=s,this.resizeTakeFromCols=o,this.resizeTakeFromStartWidth=n,this.resizeTakeFromRatios=r}clearLocalValues(){this.resizeCols=void 0,this.resizeRatios=void 0,this.resizeTakeFromCols=void 0,this.resizeTakeFromRatios=void 0}resizeLeafColumnsToFit(e){const t=this.autoWidthCalculator.getPreferredWidthForColumnGroup(this.columnGroup),i=this.getInitialValues();t>i.resizeStartWidth&&this.resizeColumns(i,t,e,!0)}resizeColumnsFromLocalValues(e,t,i=!0){var s,o,n;if(!this.resizeCols||!this.resizeRatios)return;const r={columnsToResize:this.resizeCols,resizeStartWidth:this.resizeStartWidth,resizeRatios:this.resizeRatios,groupAfterColumns:null!=(s=this.resizeTakeFromCols)?s:void 0,groupAfterStartWidth:null!=(o=this.resizeTakeFromStartWidth)?o:void 0,groupAfterRatios:null!=(n=this.resizeTakeFromRatios)?n:void 0};this.resizeColumns(r,e,t,i)}resizeColumns(e,t,i,s=!0){const{columnsToResize:o,resizeStartWidth:n,resizeRatios:r,groupAfterColumns:a,groupAfterStartWidth:l,groupAfterRatios:u}=e,h=[];if(h.push({columns:o,ratios:r,width:t}),a){const e=t-n;h.push({columns:a,ratios:u,width:l-e})}this.columnModel.resizeColumnSets({resizeSets:h,finished:s,source:i}),s&&this.toggleColumnResizing(!1)}toggleColumnResizing(e){this.comp.addOrRemoveCssClass("ag-column-resizing",e)}getColumnsToResize(){return this.columnGroup.getDisplayedLeafColumns().filter((e=>e.isResizable()))}getInitialSizeOfColumns(e){return e.reduce(((e,t)=>e+t.getActualWidth()),0)}getSizeRatiosOfColumns(e,t){return e.map((e=>e.getActualWidth()/t))}normaliseDragChange(e){let t=e;return this.gos.get("enableRtl")?"left"!==this.pinned&&(t*=-1):"right"===this.pinned&&(t*=-1),t}destroy(){super.destroy(),this.clearLocalValues()}};Gs([No("horizontalResizeService")],Rc.prototype,"horizontalResizeService",2),Gs([No("autoWidthCalculator")],Rc.prototype,"autoWidthCalculator",2),Gs([No("columnModel")],Rc.prototype,"columnModel",2),Gs([Lo],Rc.prototype,"postConstruct",1);var Dc=class extends Pn{constructor(e,t){super(),this.removeChildListenersFuncs=[],this.columnGroup=t,this.comp=e}postConstruct(){this.addListenersToChildrenColumns(),this.addManagedListener(this.columnGroup,xn.EVENT_DISPLAYED_CHILDREN_CHANGED,this.onDisplayedChildrenChanged.bind(this)),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))}addListenersToChildrenColumns(){this.removeListenersOnChildrenColumns();const e=this.onWidthChanged.bind(this);this.columnGroup.getLeafColumns().forEach((t=>{t.addEventListener("widthChanged",e),t.addEventListener("visibleChanged",e),this.removeChildListenersFuncs.push((()=>{t.removeEventListener("widthChanged",e),t.removeEventListener("visibleChanged",e)}))}))}removeListenersOnChildrenColumns(){this.removeChildListenersFuncs.forEach((e=>e())),this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){const e=this.columnGroup.getActualWidth();this.comp.setWidth(`${e}px`),this.comp.addOrRemoveCssClass("ag-hidden",0===e)}};Gs([Lo],Dc.prototype,"postConstruct",1);var Tc=class extends Cc{constructor(e,t,i){super(e,t,i),this.onSuppressColMoveChange=()=>{if(!this.isAlive()||this.isSuppressMoving())this.removeDragSource();else if(!this.dragSource){const e=this.getGui();this.setDragSource(e)}},this.column=e}setComp(e,t,i){this.comp=e,this.setGui(t),this.displayName=this.beans.columnModel.getDisplayNameForColumnGroup(this.column,"header"),this.addClasses(),this.setupMovingCss(),this.setupExpandable(),this.setupTooltip(),this.addDestroyFunc((()=>{this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature))})),this.setupUserComp(),this.addHeaderMouseListeners();const s=this.getParentRowCtrl().getPinned(),o=this.column.getProvidedColumnGroup().getLeafColumns();this.createManagedBean(new wc(o,t)),this.createManagedBean(new vc(this.column,t,this.beans)),this.createManagedBean(new Dc(e,this.column)),this.resizeFeature=this.createManagedBean(new Rc(e,i,s,this.column)),this.createManagedBean(new iu(t,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)})),this.addManagedPropertyListener(In.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED,this.onSuppressColMoveChange),this.addResizeAndMoveKeyboardListeners()}resizeHeader(e,t){if(!this.resizeFeature)return;const i=this.resizeFeature.getInitialValues(t);this.resizeFeature.resizeColumns(i,i.resizeStartWidth+e,"uiColumnResized",!0)}moveHeader(e){const{beans:t,eGui:i,column:s,gos:o,ctrlsService:n}=this,r=o.get("enableRtl"),a=0===e,l=this.getPinned(),u=i.getBoundingClientRect(),h=u.left,d=u.width,c=rc.normaliseX(a!==r?h-20:h+d+20,l,!0,o,n),p=s.getGroupId(),g=this.focusService.getFocusedHeader();rc.attemptMoveColumns({allMovingColumns:this.column.getLeafColumns(),isFromHeader:!0,hDirection:e,xPosition:c,pinned:l,fromEnter:!1,fakeEvent:!1,gos:o,columnModel:t.columnModel});const m=s.getDisplayedLeafColumns(),f=a?m[0]:Jo(m);this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(f,"auto"),!this.isAlive()&&g&&this.restoreFocus(p,s,g)}restoreFocus(e,t,i){const s=t.getLeafColumns();if(!s.length)return;const o=s[0].getParent();if(!o)return;const n=this.findGroupWidthId(o,e);n&&this.focusService.focusHeaderPosition({headerPosition:_s(Ns({},i),{column:n})})}findGroupWidthId(e,t){for(;e;){if(e.getGroupId()===t)return e;e=e.getParent()}return null}resizeLeafColumnsToFit(e){this.resizeFeature&&this.resizeFeature.resizeLeafColumnsToFit(e)}setupUserComp(){const e=this.gos.addGridCommonParams({displayName:this.displayName,columnGroup:this.column,setExpanded:e=>{this.beans.columnModel.setColumnGroupOpened(this.column.getProvidedColumnGroup(),e,"gridInitializing")},setTooltip:(e,t)=>{this.setupTooltip(e,t)}}),t=this.userComponentFactory.getHeaderGroupCompDetails(e);this.comp.setUserCompDetails(t)}addHeaderMouseListeners(){const e=e=>this.handleMouseOverChange("mouseenter"===e.type);this.addManagedListener(this.getGui(),"mouseenter",e),this.addManagedListener(this.getGui(),"mouseleave",e),this.addManagedListener(this.getGui(),"click",(()=>this.dispatchColumnMouseEvent(In.EVENT_COLUMN_HEADER_CLICKED,this.column.getProvidedColumnGroup()))),this.addManagedListener(this.getGui(),"contextmenu",(e=>this.handleContextMenuMouseEvent(e,void 0,this.column.getProvidedColumnGroup())))}handleMouseOverChange(e){const t={type:e?In.EVENT_COLUMN_HEADER_MOUSE_OVER:In.EVENT_COLUMN_HEADER_MOUSE_LEAVE,column:this.column.getProvidedColumnGroup()};this.eventService.dispatchEvent(t)}setupTooltip(e,t){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const i=this.column.getColGroupDef(),s="whenTruncated"===this.gos.get("tooltipShowMode"),o=this.eGui;t||!s||(null==i?void 0:i.headerGroupComponent)||(t=()=>{const e=o.querySelector(".ag-header-group-text");return!e||e.scrollWidth>e.clientWidth});const n={getColumn:()=>this.column,getGui:()=>o,getLocation:()=>"headerGroup",getTooltipValue:()=>null!=e?e:i&&i.headerTooltip,shouldDisplayTooltip:t};i&&(n.getColDef=()=>i),this.createBean(new $l(n))}setupExpandable(){const e=this.column.getProvidedColumnGroup();this.refreshExpanded(),this.addManagedListener(e,jo.EVENT_EXPANDABLE_CHANGED,this.refreshExpanded.bind(this)),this.addManagedListener(e,jo.EVENT_EXPANDED_CHANGED,this.refreshExpanded.bind(this))}refreshExpanded(){const e=this.column;this.expandable=e.isExpandable();const t=e.isExpanded();this.expandable?this.comp.setAriaExpanded(t?"true":"false"):this.comp.setAriaExpanded(void 0)}getColId(){return this.column.getUniqueId()}addClasses(){const e=this.column.getColGroupDef(),t=Md.getHeaderClassesFromColDef(e,this.gos,null,this.column);this.column.isPadding()?(t.push("ag-header-group-cell-no-group"),this.column.getLeafColumns().every((e=>e.isSpanHeaderHeight()))&&t.push("ag-header-span-height")):t.push("ag-header-group-cell-with-group"),t.forEach((e=>this.comp.addOrRemoveCssClass(e,!0)))}setupMovingCss(){const e=this.column.getProvidedColumnGroup().getLeafColumns(),t=()=>this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving());e.forEach((e=>{this.addManagedListener(e,$o.EVENT_MOVING_CHANGED,t)})),t()}onFocusIn(e){if(!this.eGui.contains(e.relatedTarget)){const e=this.getRowIndex();this.beans.focusService.setFocusedHeader(e,this.column)}}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();if(this.expandable&&t&&e.key===El.ENTER){const e=this.column,t=!e.isExpanded();this.beans.columnModel.setColumnGroupOpened(e.getProvidedColumnGroup(),t,"uiColumnExpanded")}}setDragSource(e){if(!this.isAlive()||this.isSuppressMoving())return;if(this.removeDragSource(),!e)return;const{beans:t,column:i,displayName:s,gos:o,dragAndDropService:n}=this,{columnModel:r}=t,a=i.getProvidedColumnGroup().getLeafColumns();let l=!o.get("suppressDragLeaveHidesColumns");const u=this.dragSource={type:1,eElement:e,getDefaultIconName:()=>l?hh.ICON_HIDE:hh.ICON_NOT_ALLOWED,dragItemName:s,getDragItem:()=>this.getDragItemForGroup(i),onDragStarted:()=>{l=!o.get("suppressDragLeaveHidesColumns"),a.forEach((e=>e.setMoving(!0,"uiColumnDragged")))},onDragStopped:()=>a.forEach((e=>e.setMoving(!1,"uiColumnDragged"))),onGridEnter:e=>{var t;if(l){const i=(null==(t=null==e?void 0:e.columns)?void 0:t.filter((e=>!e.getColDef().lockVisible)))||[];r.setColumnsVisible(i,!0,"uiColumnMoved")}},onGridExit:e=>{var t;if(l){const i=(null==(t=null==e?void 0:e.columns)?void 0:t.filter((e=>!e.getColDef().lockVisible)))||[];r.setColumnsVisible(i,!1,"uiColumnMoved")}}};n.addDragSource(u,!0)}getDragItemForGroup(e){const t=e.getProvidedColumnGroup().getLeafColumns(),i={};t.forEach((e=>i[e.getId()]=e.isVisible()));const s=[];return this.beans.columnModel.getAllDisplayedColumns().forEach((e=>{t.indexOf(e)>=0&&(s.push(e),nn(t,e))})),t.forEach((e=>s.push(e))),{columns:s,visibleState:i}}isSuppressMoving(){let e=!1;return this.column.getLeafColumns().forEach((t=>{(t.getColDef().suppressMovable||t.getColDef().lockPosition)&&(e=!0)})),e||this.gos.get("suppressMovableColumns")}},Ac=0,Pc=class extends Pn{constructor(e,t,i){super(),this.instanceId=Ac++,this.rowIndex=e,this.pinned=t,this.type=i;const s="group"==i?"ag-header-row-column-group":"filter"==i?"ag-header-row-column-filter":"ag-header-row-column";this.headerRowClass=`ag-header-row ${s}`}postConstruct(){this.isPrintLayout=this.gos.isDomLayout("print"),this.isEnsureDomOrder=this.gos.get("ensureDomOrder")}getInstanceId(){return this.instanceId}setComp(e,t=!0){this.comp=e,t&&(this.onRowHeightChanged(),this.onVirtualColumnsChanged()),this.setWidth(),this.addEventListeners()}getHeaderRowClass(){return this.headerRowClass}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(){this.addManagedListener(this.eventService,In.EVENT_COLUMN_RESIZED,this.onColumnResized.bind(this)),this.addManagedListener(this.eventService,In.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,In.EVENT_VIRTUAL_COLUMNS_CHANGED,(e=>this.onVirtualColumnsChanged(e.afterScroll))),this.addManagedListener(this.eventService,In.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.eventService,In.EVENT_GRID_STYLES_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.eventService,In.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("domLayout",this.onDisplayedColumnsChanged.bind(this)),this.addManagedPropertyListener("ensureDomOrder",(e=>this.isEnsureDomOrder=e.currentValue)),this.addManagedPropertyListener("headerHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("pivotHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("groupHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("pivotGroupHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("floatingFiltersHeight",this.onRowHeightChanged.bind(this))}getHeaderCellCtrl(e){if(this.headerCellCtrls)return Xs(this.headerCellCtrls).find((t=>t.getColumnGroupChild()===e))}onDisplayedColumnsChanged(){this.isPrintLayout=this.gos.isDomLayout("print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}getType(){return this.type}onColumnResized(){this.setWidth()}setWidth(){const e=this.getWidthForRow();this.comp.setWidth(`${e}px`)}getWidthForRow(){const{columnModel:e}=this.beans;return this.isPrintLayout?null!=this.pinned?0:e.getContainerWidth("right")+e.getContainerWidth("left")+e.getContainerWidth(null):e.getContainerWidth(this.pinned)}onRowHeightChanged(){var{topOffset:e,rowHeight:t}=this.getTopAndHeight();this.comp.setTop(e+"px"),this.comp.setHeight(t+"px")}getTopAndHeight(){const{columnModel:e,filterManager:t}=this.beans;let i=e.getHeaderRowCount();const s=[];let o=0;t.hasFloatingFilters()&&(i++,o=1);const n=e.getColumnGroupHeaderRowHeight(),r=e.getColumnHeaderRowHeight(),a=i-(1+o);for(let e=0;e<a;e++)s.push(n);s.push(r);for(let t=0;t<o;t++)s.push(e.getFloatingFiltersHeight());let l=0;for(let e=0;e<this.rowIndex;e++)l+=s[e];return{topOffset:l,rowHeight:s[this.rowIndex]}}getPinned(){return this.pinned}getRowIndex(){return this.rowIndex}onVirtualColumnsChanged(e=!1){const t=this.getHeaderCtrls(),i=this.isEnsureDomOrder||this.isPrintLayout;this.comp.setHeaderCtrls(t,i,e)}getHeaderCtrls(){const e=this.headerCellCtrls;this.headerCellCtrls=new Map;const t=this.getColumnsInViewport();for(const i of t)this.recycleAndCreateHeaderCtrls(i,e);const i=e=>{const{focusService:t,columnModel:i}=this.beans;return!!t.isHeaderWrapperFocused(e)&&i.isDisplayed(e.getColumnGroupChild())};if(e)for(const[t,s]of e)i(s)?this.headerCellCtrls.set(t,s):this.destroyBean(s);return Array.from(this.headerCellCtrls.values())}recycleAndCreateHeaderCtrls(e,t){if(!this.headerCellCtrls)return;if(e.isEmptyGroup())return;const i=e.getUniqueId();let s;if(t&&(s=t.get(i),t.delete(i)),s&&s.getColumnGroupChild()!=e&&(this.destroyBean(s),s=void 0),null==s)switch(this.type){case"filter":s=this.createBean(new yc(e,this.beans,this));break;case"group":s=this.createBean(new Tc(e,this.beans,this));break;default:s=this.createBean(new bc(e,this.beans,this))}this.headerCellCtrls.set(i,s)}getColumnsInViewport(){return this.isPrintLayout?this.getColumnsInViewportPrintLayout():this.getColumnsInViewportNormalLayout()}getColumnsInViewportPrintLayout(){if(null!=this.pinned)return[];let e=[];const t=this.getActualDepth(),{columnModel:i}=this.beans;return["left",null,"right"].forEach((s=>{const o=i.getVirtualHeaderGroupRow(s,t);e=e.concat(o)})),e}getActualDepth(){return"filter"==this.type?this.rowIndex-1:this.rowIndex}getColumnsInViewportNormalLayout(){return this.beans.columnModel.getVirtualHeaderGroupRow(this.pinned,this.getActualDepth())}focusHeader(e,t){if(!this.headerCellCtrls)return!1;const i=Array.from(this.headerCellCtrls.values()).find((t=>t.getColumnGroupChild()==e));return!!i&&i.focus(t)}destroy(){this.headerCellCtrls&&this.headerCellCtrls.forEach((e=>{this.destroyBean(e)})),this.headerCellCtrls=void 0,super.destroy()}};Gs([No("beans")],Pc.prototype,"beans",2),Gs([Lo],Pc.prototype,"postConstruct",1);var Fc=class extends Pn{constructor(e){super(),this.hidden=!1,this.includeFloatingFilter=!1,this.groupsRowCtrls=[],this.pinned=e}setComp(e,t){this.comp=e,this.eViewport=t,this.setupCenterWidth(),this.setupPinnedWidth(),this.setupDragAndDrop(this.eViewport),this.addManagedListener(this.eventService,In.EVENT_GRID_COLUMNS_CHANGED,this.onGridColumnsChanged.bind(this)),this.addManagedListener(this.eventService,In.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,In.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.ctrlsService.registerHeaderContainer(this,this.pinned),this.columnModel.isReady()&&this.refresh()}setupDragAndDrop(e){const t=new lc(this.pinned,e);this.createManagedBean(t)}refresh(e=!1){const t=new Hl,i=this.focusService.getFocusHeaderToUseAfterRefresh();(()=>{const e=this.columnModel.getHeaderRowCount()-1;this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls);for(let i=0;i<e;i++){const e=this.createBean(new Pc(t.next(),this.pinned,"group"));this.groupsRowCtrls.push(e)}})(),(()=>{const i=t.next(),s=!(this.hidden||null!=this.columnsRowCtrl&&e&&this.columnsRowCtrl.getRowIndex()===i);(s||this.hidden)&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),s&&(this.columnsRowCtrl=this.createBean(new Pc(i,this.pinned,"column")))})(),(()=>{this.includeFloatingFilter=this.filterManager.hasFloatingFilters()&&!this.hidden;const i=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter)return void i();const s=t.next();if(this.filtersRowCtrl){const t=this.filtersRowCtrl.getRowIndex()!==s;e&&!t||i()}this.filtersRowCtrl||(this.filtersRowCtrl=this.createBean(new Pc(s,this.pinned,"filter")))})();const s=this.getAllCtrls();this.comp.setCtrls(s),this.restoreFocusOnHeader(i)}restoreFocusOnHeader(e){null!=e&&e.column.getPinned()==this.pinned&&this.focusService.focusHeaderPosition({headerPosition:e})}getAllCtrls(){const e=[...this.groupsRowCtrls];return this.columnsRowCtrl&&e.push(this.columnsRowCtrl),this.filtersRowCtrl&&e.push(this.filtersRowCtrl),e}onGridColumnsChanged(){this.refresh(!0)}onDisplayedColumnsChanged(){const e=this.filterManager.hasFloatingFilters()&&!this.hidden;this.includeFloatingFilter!==e&&this.refresh(!0)}setupCenterWidth(){null==this.pinned&&this.createManagedBean(new Ud((e=>this.comp.setCenterWidth(`${e}px`)),!0))}setHorizontalScroll(e){this.comp.setViewportScrollLeft(e)}setupPinnedWidth(){if(null==this.pinned)return;const e="left"===this.pinned,t="right"===this.pinned;this.hidden=!0;const i=()=>{const i=e?this.pinnedWidthService.getPinnedLeftWidth():this.pinnedWidthService.getPinnedRightWidth();if(null==i)return;const s=0==i,o=this.hidden!==s,n=this.gos.get("enableRtl"),r=this.gos.getScrollbarWidth(),a=this.scrollVisibleService.isVerticalScrollShowing()&&(n&&e||!n&&t)?i+r:i;this.comp.setPinnedContainerWidth(`${a}px`),this.comp.setDisplayed(!s),o&&(this.hidden=s,this.refresh())};this.addManagedListener(this.eventService,In.EVENT_LEFT_PINNED_WIDTH_CHANGED,i),this.addManagedListener(this.eventService,In.EVENT_RIGHT_PINNED_WIDTH_CHANGED,i),this.addManagedListener(this.eventService,In.EVENT_SCROLL_VISIBILITY_CHANGED,i),this.addManagedListener(this.eventService,In.EVENT_SCROLLBAR_WIDTH_CHANGED,i)}getHeaderCtrlForColumn(e){if(e instanceof $o){if(!this.columnsRowCtrl)return;return this.columnsRowCtrl.getHeaderCellCtrl(e)}if(0!==this.groupsRowCtrls.length)for(let t=0;t<this.groupsRowCtrls.length;t++){const i=this.groupsRowCtrls[t].getHeaderCellCtrl(e);if(i)return i}}getHtmlElementForColumnHeader(e){const t=this.getHeaderCtrlForColumn(e);return t?t.getGui():null}getRowType(e){const t=this.getAllCtrls()[e];return t?t.getType():void 0}focusHeader(e,t,i){const s=this.getAllCtrls()[e];return!!s&&s.focusHeader(t,i)}getViewport(){return this.eViewport}getRowCount(){return this.groupsRowCtrls.length+(this.columnsRowCtrl?1:0)+(this.filtersRowCtrl?1:0)}destroy(){this.filtersRowCtrl&&(this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)),this.columnsRowCtrl&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),this.groupsRowCtrls&&this.groupsRowCtrls.length&&(this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls)),super.destroy()}};Gs([No("ctrlsService")],Fc.prototype,"ctrlsService",2),Gs([No("scrollVisibleService")],Fc.prototype,"scrollVisibleService",2),Gs([No("pinnedWidthService")],Fc.prototype,"pinnedWidthService",2),Gs([No("columnModel")],Fc.prototype,"columnModel",2),Gs([No("focusService")],Fc.prototype,"focusService",2),Gs([No("filterManager")],Fc.prototype,"filterManager",2);var Mc=class e extends Yl{constructor(e){super(),this.headerRowComps={},this.rowCompsList=[],this.pinned=e}init(){this.selectAndSetTemplate();const e={setDisplayed:e=>this.setDisplayed(e),setCtrls:e=>this.setCtrls(e),setCenterWidth:e=>this.eCenterContainer.style.width=e,setViewportScrollLeft:e=>this.getGui().scrollLeft=e,setPinnedContainerWidth:e=>{const t=this.getGui();t.style.width=e,t.style.maxWidth=e,t.style.minWidth=e}};this.createManagedBean(new Fc(this.pinned)).setComp(e,this.getGui())}selectAndSetTemplate(){const t="left"==this.pinned,i="right"==this.pinned,s=t?e.PINNED_LEFT_TEMPLATE:i?e.PINNED_RIGHT_TEMPLATE:e.CENTER_TEMPLATE;this.setTemplate(s),this.eRowContainer=this.eCenterContainer?this.eCenterContainer:this.getGui()}destroyRowComps(){this.setCtrls([])}destroyRowComp(e){this.destroyBean(e),this.eRowContainer.removeChild(e.getGui())}setCtrls(e){const t=this.headerRowComps;let i;this.headerRowComps={},this.rowCompsList=[];const s=e=>{const t=e.getGui();t.parentElement!=this.eRowContainer&&this.eRowContainer.appendChild(t),i&&qa(this.eRowContainer,t,i),i=t};e.forEach((e=>{const i=e.getInstanceId(),o=t[i];delete t[i];const n=o||this.createBean(new gc(e));this.headerRowComps[i]=n,this.rowCompsList.push(n),s(n)})),so(t).forEach((e=>this.destroyRowComp(e)))}};Mc.PINNED_LEFT_TEMPLATE='<div class="ag-pinned-left-header" role="rowgroup"></div>',Mc.PINNED_RIGHT_TEMPLATE='<div class="ag-pinned-right-header" role="rowgroup"></div>',Mc.CENTER_TEMPLATE='<div class="ag-header-viewport" role="presentation">\n <div class="ag-header-container" ref="eCenterContainer" role="rowgroup"></div>\n </div>',Gs([ql("eCenterContainer")],Mc.prototype,"eCenterContainer",2),Gs([Lo],Mc.prototype,"init",1),Gs([xo],Mc.prototype,"destroyRowComps",1);var Lc=Mc,xc=class extends Pn{constructor(){super(...arguments),this.currentHeaderRowWithoutSpan=-1}postConstruct(){this.ctrlsService.whenReady((e=>{this.gridBodyCon=e.gridBodyCtrl}));const e=this.gos.getDocument();this.addManagedListener(e,"mousedown",(()=>this.setCurrentHeaderRowWithoutSpan(-1)))}getHeaderRowCount(){const e=this.ctrlsService.getHeaderRowContainerCtrl();return e?e.getRowCount():0}navigateVertically(e,t,i){if(t||(t=this.focusService.getFocusedHeader()),!t)return!1;const{headerRowIndex:s,column:o}=t,n=this.getHeaderRowCount(),r=0===e;let{headerRowIndex:a,column:l,headerRowIndexWithoutSpan:u}=r?this.headerPositionUtils.getColumnVisibleParent(o,s):this.headerPositionUtils.getColumnVisibleChild(o,s),h=!1;return a<0&&(a=0,l=o,h=!0),a>=n?(a=-1,this.setCurrentHeaderRowWithoutSpan(-1)):void 0!==u&&(this.currentHeaderRowWithoutSpan=u),!(!h&&!l)&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:a,column:l},allowUserOverride:!0,event:i})}setCurrentHeaderRowWithoutSpan(e){this.currentHeaderRowWithoutSpan=e}navigateHorizontally(e,t=!1,i){const s=this.focusService.getFocusedHeader(),o=2===e,n=this.gos.get("enableRtl");let r,a;if(-1!==this.currentHeaderRowWithoutSpan?s.headerRowIndex=this.currentHeaderRowWithoutSpan:this.currentHeaderRowWithoutSpan=s.headerRowIndex,o!==n?(a="Before",r=this.headerPositionUtils.findHeader(s,a)):(a="After",r=this.headerPositionUtils.findHeader(s,a)),r||!t)return this.focusService.focusHeaderPosition({headerPosition:r,direction:a,fromTab:t,allowUserOverride:!0,event:i});if(t){const e=this.gos.getCallback("tabToNextHeader");if(e)return this.focusService.focusHeaderPositionFromUserFunc({userFunc:e,headerPosition:r,direction:a})}return this.focusNextHeaderRow(s,a,i)}focusNextHeaderRow(e,t,i){const s=e.headerRowIndex;let o,n=null;if("Before"===t?s>0&&(o=s-1,this.currentHeaderRowWithoutSpan-=1,n=this.headerPositionUtils.findColAtEdgeForHeaderRow(o,"end")):(o=s+1,this.currentHeaderRowWithoutSpan<this.getHeaderRowCount()?this.currentHeaderRowWithoutSpan+=1:this.setCurrentHeaderRowWithoutSpan(-1),n=this.headerPositionUtils.findColAtEdgeForHeaderRow(o,"start")),!n)return!1;const{column:r,headerRowIndex:a}=this.headerPositionUtils.getHeaderIndexToFocus(n.column,null==n?void 0:n.headerRowIndex);return this.focusService.focusHeaderPosition({headerPosition:{column:r,headerRowIndex:a},direction:t,fromTab:!0,allowUserOverride:!0,event:i})}scrollToColumn(e,t="After"){if(e.getPinned())return;let i;if(e instanceof xn){const s=e.getDisplayedLeafColumns();i="Before"===t?Jo(s):s[0]}else i=e;this.gridBodyCon.getScrollFeature().ensureColumnVisible(i)}};Gs([No("focusService")],xc.prototype,"focusService",2),Gs([No("headerPositionUtils")],xc.prototype,"headerPositionUtils",2),Gs([No("ctrlsService")],xc.prototype,"ctrlsService",2),Gs([Lo],xc.prototype,"postConstruct",1),xc=Gs([Io("headerNavigationService")],xc);var Ic=class extends Pn{setComp(e,t,i){this.comp=e,this.eGui=t,this.createManagedBean(new iu(i,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addManagedListener(this.eventService,In.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onPivotModeChanged.bind(this)),this.addManagedListener(this.eventService,In.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.onPivotModeChanged(),this.setupHeaderHeight();const s=this.onHeaderContextMenu.bind(this);this.addManagedListener(this.eGui,"contextmenu",s),this.mockContextMenuForIPad(s),this.ctrlsService.register("gridHeaderCtrl",this)}setupHeaderHeight(){const e=this.setHeaderHeight.bind(this);e(),this.addManagedPropertyListener("headerHeight",e),this.addManagedPropertyListener("pivotHeaderHeight",e),this.addManagedPropertyListener("groupHeaderHeight",e),this.addManagedPropertyListener("pivotGroupHeaderHeight",e),this.addManagedPropertyListener("floatingFiltersHeight",e),this.addManagedListener(this.eventService,In.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,In.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,e),this.addManagedListener(this.eventService,In.EVENT_GRID_STYLES_CHANGED,e),this.addManagedListener(this.eventService,In.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,e)}getHeaderHeight(){return this.headerHeight}setHeaderHeight(){const{columnModel:e}=this;let t,i=0,s=e.getHeaderRowCount();this.filterManager.hasFloatingFilters()&&(s++,i=1);const o=this.columnModel.getColumnGroupHeaderRowHeight(),n=this.columnModel.getColumnHeaderRowHeight(),r=s-(1+i);if(t=i*e.getFloatingFiltersHeight(),t+=r*o,t+=n,this.headerHeight===t)return;this.headerHeight=t;const a=`${t+1}px`;this.comp.setHeightAndMinHeight(a),this.eventService.dispatchEvent({type:In.EVENT_HEADER_HEIGHT_CHANGED})}onPivotModeChanged(){const e=this.columnModel.isPivotMode();this.comp.addOrRemoveCssClass("ag-pivot-on",e),this.comp.addOrRemoveCssClass("ag-pivot-off",!e)}onDisplayedColumnsChanged(){const e=this.columnModel.getAllDisplayedColumns().some((e=>e.isSpanHeaderHeight()));this.comp.addOrRemoveCssClass("ag-header-allow-overflow",e)}onTabKeyDown(e){const t=this.gos.get("enableRtl"),i=e.shiftKey!==t?2:3;(this.headerNavigationService.navigateHorizontally(i,!0,e)||this.focusService.focusNextGridCoreContainer(e.shiftKey))&&e.preventDefault()}handleKeyDown(e){let t=null;switch(e.key){case El.LEFT:t=2;case El.RIGHT:Bs(t)||(t=3),this.headerNavigationService.navigateHorizontally(t,!1,e);break;case El.UP:t=0;case El.DOWN:Bs(t)||(t=1),this.headerNavigationService.navigateVertically(t,null,e)&&e.preventDefault();break;default:return}}onFocusOut(e){const{relatedTarget:t}=e;!t&&this.eGui.contains(this.gos.getActiveDomElement())||this.eGui.contains(t)||this.focusService.clearFocusedHeader()}onHeaderContextMenu(e,t,i){if(!e&&!i||!this.menuService.isHeaderContextMenuEnabled())return;const{target:s}=null!=e?e:t;s!==this.eGui&&s!==this.ctrlsService.getHeaderRowContainerCtrl().getViewport()||this.menuService.showHeaderContextMenu(void 0,e,i)}mockContextMenuForIPad(e){if(!sa())return;const t=new zu(this.eGui);this.addManagedListener(t,zu.EVENT_LONG_TAP,(t=>{e(void 0,t.touchStart,t.touchEvent)})),this.addDestroyFunc((()=>t.destroy()))}};Gs([No("headerNavigationService")],Ic.prototype,"headerNavigationService",2),Gs([No("focusService")],Ic.prototype,"focusService",2),Gs([No("columnModel")],Ic.prototype,"columnModel",2),Gs([No("ctrlsService")],Ic.prototype,"ctrlsService",2),Gs([No("filterManager")],Ic.prototype,"filterManager",2),Gs([No("menuService")],Ic.prototype,"menuService",2);var Nc=class e extends Yl{constructor(){super(e.TEMPLATE)}postConstruct(){const e={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setHeightAndMinHeight:e=>{this.getGui().style.height=e,this.getGui().style.minHeight=e}};this.createManagedBean(new Ic).setComp(e,this.getGui(),this.getFocusableElement());const t=e=>{this.createManagedBean(e),this.appendChild(e)};t(new Lc("left")),t(new Lc(null)),t(new Lc("right"))}};Nc.TEMPLATE='<div class="ag-header" role="presentation"/>',Gs([Lo],Nc.prototype,"postConstruct",1);var _c=Nc,Oc=class extends Pn{addResizeBar(e){const t={dragStartPixels:e.dragStartPixels||0,eElement:e.eResizeBar,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this,e),onDragging:this.onDragging.bind(this,e),includeTouch:!0,stopPropagationForTouch:!0};return this.dragService.addDragSource(t),()=>this.dragService.removeDragSource(t)}onDragStart(e,t){this.dragStartX=t.clientX,this.setResizeIcons();const i=t instanceof MouseEvent&&!0===t.shiftKey;e.onResizeStart(i)}setResizeIcons(){const e=this.ctrlsService.get("gridCtrl");e.setResizeCursor(!0),e.disableUserSelect(!0)}onDragStop(e,t){e.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){const e=this.ctrlsService.get("gridCtrl");e.setResizeCursor(!1),e.disableUserSelect(!1)}onDragging(e,t){this.resizeAmount=t.clientX-this.dragStartX,e.onResizing(this.resizeAmount)}};Gs([No("dragService")],Oc.prototype,"dragService",2),Gs([No("ctrlsService")],Oc.prototype,"ctrlsService",2),Oc=Gs([Io("horizontalResizeService")],Oc);var Gc=class extends Pn{hideActiveMenu(){this.hidePopup&&this.hidePopup()}showMenuAfterMouseEvent(e,t,i){this.showPopup(e,(s=>{this.popupService.positionPopupUnderMouseEvent({column:e,type:i,mouseEvent:t,ePopup:s})}),i,t.target,this.menuService.isLegacyMenuEnabled())}showMenuAfterButtonClick(e,t,i){let s=-1,o="left";const n=this.menuService.isLegacyMenuEnabled();!n&&this.gos.get("enableRtl")&&(s=1,o="right");let r=n?void 0:4*s,a=n?void 0:4;this.showPopup(e,(s=>{this.popupService.positionPopupByComponent({type:i,eventSource:t,ePopup:s,nudgeX:r,nudgeY:a,alignSide:o,keepWithinBounds:!0,position:"under",column:e})}),i,t,n)}showPopup(e,t,i,s,o){const n=e?this.createBean(new gd(e,"COLUMN_MENU")):void 0;if(this.activeMenu=n,!(null==n?void 0:n.hasFilter())||!e)throw new Error("AG Grid - unable to show popup filter, filter instantiation failed");const r=document.createElement("div");let a;cr(r,"presentation"),r.classList.add("ag-menu"),o||r.classList.add("ag-filter-menu"),this.tabListener=this.addManagedListener(r,"keydown",(e=>this.trapFocusWithin(e,r))),r.appendChild(null==n?void 0:n.getGui());const l=this.menuService.isColumnMenuAnchoringEnabled()?null!=s?s:this.ctrlsService.getGridBodyCtrl().getGui():void 0,u=this.localeService.getLocaleTextFunc(),h=o&&"columnFilter"!==i?u("ariaLabelColumnMenu","Column Menu"):u("ariaLabelColumnFilter","Column Filter"),d=this.popupService.addPopup({modal:!0,eChild:r,closeOnEsc:!0,closedCallback:t=>{e.setMenuVisible(!1,"contextMenu");const o=t instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),o&&s&&ja(s)){const e=this.focusService.findTabbableParent(s);e&&e.focus()}null==n||n.afterGuiDetached(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,i,e)},positionCallback:()=>t(r),anchorToElement:l,ariaLabel:h});d&&(this.hidePopup=a=d.hideFunc),n.afterInit().then((()=>{t(r),n.afterGuiAttached({container:i,hidePopup:a})})),e.setMenuVisible(!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,i,e)}trapFocusWithin(e,t){e.key!==El.TAB||e.defaultPrevented||this.focusService.findNextFocusableElement(t,!1,e.shiftKey)||(e.preventDefault(),this.focusService.focusInto(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,i){const s={type:In.EVENT_COLUMN_MENU_VISIBLE_CHANGED,visible:e,switchingTab:!1,key:t,column:null!=i?i:null};this.eventService.dispatchEvent(s)}isMenuEnabled(e){var t;return e.isFilterAllowed()&&(null!=(t=e.getColDef().menuTabs)?t:["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}};Gs([No("filterManager")],Gc.prototype,"filterManager",2),Gs([No("popupService")],Gc.prototype,"popupService",2),Gs([No("focusService")],Gc.prototype,"focusService",2),Gs([No("ctrlsService")],Gc.prototype,"ctrlsService",2),Gs([No("menuService")],Gc.prototype,"menuService",2),Gc=Gs([Io("filterMenuFactory")],Gc);var kc=(e=>(e.TAB_GUARD="ag-tab-guard",e.TAB_GUARD_TOP="ag-tab-guard-top",e.TAB_GUARD_BOTTOM="ag-tab-guard-bottom",e))(kc||{}),Vc=class extends Pn{constructor(e){super(),this.skipTabGuardFocus=!1,this.forcingFocusOut=!1;const{comp:t,eTopGuard:i,eBottomGuard:s,focusTrapActive:o,forceFocusOutWhenTabGuardsAreEmpty:n,focusInnerElement:r,onFocusIn:a,onFocusOut:l,shouldStopEventPropagation:u,onTabKeyDown:h,handleKeyDown:d,eFocusableElement:c}=e;this.comp=t,this.eTopGuard=i,this.eBottomGuard=s,this.providedFocusInnerElement=r,this.eFocusableElement=c,this.focusTrapActive=!!o,this.forceFocusOutWhenTabGuardsAreEmpty=!!n,this.providedFocusIn=a,this.providedFocusOut=l,this.providedShouldStopEventPropagation=u,this.providedOnTabKeyDown=h,this.providedHandleKeyDown=d}postConstruct(){this.createManagedBean(new iu(this.eFocusableElement,{shouldStopEventPropagation:()=>this.shouldStopEventPropagation(),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e),onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e)})),this.activateTabGuards(),[this.eTopGuard,this.eBottomGuard].forEach((e=>this.addManagedListener(e,"focus",this.onFocus.bind(this))))}handleKeyDown(e){this.providedHandleKeyDown&&this.providedHandleKeyDown(e)}tabGuardsAreActive(){return!!this.eTopGuard&&this.eTopGuard.hasAttribute("tabIndex")}shouldStopEventPropagation(){return!!this.providedShouldStopEventPropagation&&this.providedShouldStopEventPropagation()}activateTabGuards(){if(this.forcingFocusOut)return;const e=this.gos.get("tabIndex");this.comp.setTabIndex(e.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(e){if(this.skipTabGuardFocus)return void(this.skipTabGuardFocus=!1);if(this.forceFocusOutWhenTabGuardsAreEmpty&&0===this.focusService.findFocusableElements(this.eFocusableElement,".ag-tab-guard").length)return void this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);const t=e.target===this.eBottomGuard;this.providedFocusInnerElement?this.providedFocusInnerElement(t):this.focusInnerElement(t)}findNextElementOutsideAndFocus(e){const t=this.gos.getDocument(),i=this.focusService.findFocusableElements(t.body,null,!0),s=i.indexOf(e?this.eTopGuard:this.eBottomGuard);if(-1===s)return;let o,n;e?(o=0,n=s):(o=s+1,n=i.length);const r=i.slice(o,n),a=this.gos.get("tabIndex");r.sort(((e,t)=>{const i=parseInt(e.getAttribute("tabindex")||"0"),s=parseInt(t.getAttribute("tabindex")||"0");return s===a?1:i===a?-1:0===i?1:0===s?-1:i-s})),r[e?r.length-1:0].focus()}onFocusIn(e){this.focusTrapActive||(this.providedFocusIn&&this.providedFocusIn(e),this.deactivateTabGuards())}onFocusOut(e){this.focusTrapActive||(this.providedFocusOut&&this.providedFocusOut(e),this.eFocusableElement.contains(e.relatedTarget)||this.activateTabGuards())}onTabKeyDown(e){if(this.providedOnTabKeyDown)return void this.providedOnTabKeyDown(e);if(this.focusTrapActive)return;if(e.defaultPrevented)return;const t=this.tabGuardsAreActive();t&&this.deactivateTabGuards();const i=this.getNextFocusableElement(e.shiftKey);t&&setTimeout((()=>this.activateTabGuards()),0),i&&(i.focus(),e.preventDefault())}focusInnerElement(e=!1){const t=this.focusService.findFocusableElements(this.eFocusableElement);this.tabGuardsAreActive()&&(t.splice(0,1),t.splice(t.length-1,1)),t.length&&t[e?t.length-1:0].focus({preventScroll:!0})}getNextFocusableElement(e){return this.focusService.findNextFocusableElement(this.eFocusableElement,!1,e)}forceFocusOutOfContainer(e=!1){if(this.forcingFocusOut)return;const t=e?this.eTopGuard:this.eBottomGuard;this.activateTabGuards(),this.skipTabGuardFocus=!0,this.forcingFocusOut=!0,t.focus(),window.setTimeout((()=>{this.forcingFocusOut=!1,this.activateTabGuards()}))}isTabGuard(e){return e===this.eTopGuard||e===this.eBottomGuard}};Gs([No("focusService")],Vc.prototype,"focusService",2),Gs([Lo],Vc.prototype,"postConstruct",1);var Hc=class extends Yl{initialiseTabGuard(e){this.eTopGuard=this.createTabGuard("top"),this.eBottomGuard=this.createTabGuard("bottom"),this.eFocusableElement=this.getFocusableElement();const t=[this.eTopGuard,this.eBottomGuard],i={setTabIndex:e=>{t.forEach((t=>null!=e?t.setAttribute("tabindex",e):t.removeAttribute("tabindex")))}};this.addTabGuards(this.eTopGuard,this.eBottomGuard),this.tabGuardCtrl=this.createManagedBean(new Vc({comp:i,focusTrapActive:!!e.focusTrapActive,eTopGuard:this.eTopGuard,eBottomGuard:this.eBottomGuard,eFocusableElement:this.eFocusableElement,onFocusIn:e.onFocusIn,onFocusOut:e.onFocusOut,focusInnerElement:e.focusInnerElement,handleKeyDown:e.handleKeyDown,onTabKeyDown:e.onTabKeyDown,shouldStopEventPropagation:e.shouldStopEventPropagation,forceFocusOutWhenTabGuardsAreEmpty:e.forceFocusOutWhenTabGuardsAreEmpty}))}createTabGuard(e){const t=document.createElement("div"),i="top"===e?"ag-tab-guard-top":"ag-tab-guard-bottom";return t.classList.add("ag-tab-guard",i),cr(t,"presentation"),t}addTabGuards(e,t){this.eFocusableElement.insertAdjacentElement("afterbegin",e),this.eFocusableElement.insertAdjacentElement("beforeend",t)}removeAllChildrenExceptTabGuards(){const e=[this.eTopGuard,this.eBottomGuard];za(this.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}appendChild(e,t){rl(e)||(e=e.getGui());const{eBottomGuard:i}=this;i?i.insertAdjacentElement("beforebegin",e):super.appendChild(e,t)}},Bc=class e extends Hc{constructor(t){super(e.getTemplate(t.cssClass)),this.items=[],this.tabbedItemScrollMap=new Map,this.params=t}postConstruct(){this.setupHeader(),this.params.items&&this.params.items.forEach((e=>this.addItem(e))),this.initialiseTabGuard({onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),focusInnerElement:this.focusInnerElement.bind(this),focusTrapActive:!0}),this.addDestroyFunc((()=>{var e,t,i;return null==(i=null==(t=null==(e=this.activeItem)?void 0:e.tabbedItem)?void 0:t.afterDetachedCallback)?void 0:i.call(t)}))}static getTemplate(e){return`<div class="ag-tabs ${e}">\n <div ref="eHeader"></div>\n <div ref="eBody" role="presentation" class="ag-tabs-body ${e?`${e}-body`:""}"></div>\n </div>`}setupHeader(){const{enableCloseButton:e,cssClass:t}=this.params,i=(e,i)=>{e.classList.add(`ag-tabs-${i}`),t&&e.classList.add(`${t}-${i}`)};e?(this.setupCloseButton(i),this.eTabHeader=this.gos.getDocument().createElement("div"),i(this.eHeader,"header-wrapper"),cr(this.eHeader,"presentation"),this.eHeader.appendChild(this.eTabHeader)):this.eTabHeader=this.eHeader,cr(this.eTabHeader,"tablist"),i(this.eTabHeader,"header")}setupCloseButton(e){const t=this.gos.getDocument(),i=t.createElement("button");e(i,"close-button");const s=wl("close",this.gos,void 0,!0);Cr(i,this.params.closeButtonAriaLabel),i.appendChild(s),this.addManagedListener(i,"click",(()=>{var e,t;return null==(t=(e=this.params).onCloseClicked)?void 0:t.call(e)}));const o=t.createElement("div");e(o,"close-button-wrapper"),cr(o,"presentation"),o.appendChild(i),this.eHeader.appendChild(o),this.eCloseButton=i}handleKeyDown(e){switch(e.key){case El.RIGHT:case El.LEFT:if(!this.eTabHeader.contains(this.gos.getActiveDomElement()))return;const t=e.key===El.RIGHT,i=this.gos.get("enableRtl"),s=this.items.indexOf(this.activeItem),o=t!==i?Math.min(s+1,this.items.length-1):Math.max(s-1,0);if(s===o)return;e.preventDefault();const n=this.items[o];this.showItemWrapper(n),n.eHeaderButton.focus();break;case El.UP:case El.DOWN:e.stopPropagation()}}onTabKeyDown(e){var t,i,s,o;if(e.defaultPrevented)return;const{focusService:n,eHeader:r,eBody:a,activeItem:l,params:u}=this,{suppressTrapFocus:h,enableCloseButton:d}=u,c=this.gos.getActiveDomElement(),p=e.target,g=e.shiftKey;if(r.contains(c))return e.preventDefault(),void(d&&g&&!(null==(t=this.eCloseButton)?void 0:t.contains(c))?null==(i=this.eCloseButton)||i.focus():h&&g?null==(s=this.focusService.findFocusableElementBeforeTabGuard(this.gos.getDocument().body,p))||s.focus():this.focusBody(e.shiftKey));let m=null;if(n.isTargetUnderManagedComponent(a,p)&&(g&&(m=this.focusService.findFocusableElementBeforeTabGuard(a,p)),m||h||(m=l.eHeaderButton)),!m&&a.contains(c)&&(m=n.findNextFocusableElement(a,!1,g),!m))return e.preventDefault(),void(h&&!g?this.forceFocusOutOfContainer(g):d&&!g?null==(o=this.eCloseButton)||o.focus():this.focusHeader());m&&(e.preventDefault(),m.focus())}focusInnerElement(e){e?this.focusHeader():this.focusBody(!0)}focusHeader(e){this.activeItem.eHeaderButton.focus({preventScroll:e})}focusBody(e){this.focusService.focusInto(this.eBody,e)}setAfterAttachedParams(e){this.afterAttachedParams=e}showFirstItem(){this.items.length>0&&this.showItemWrapper(this.items[0])}addItem(e){const t=document.createElement("span");cr(t,"tab"),t.setAttribute("tabindex","-1"),t.appendChild(e.title),t.classList.add("ag-tab"),this.eTabHeader.appendChild(t),Cr(t,e.titleLabel);const i={tabbedItem:e,eHeaderButton:t};this.items.push(i),t.addEventListener("click",this.showItemWrapper.bind(this,i))}showItem(e){const t=this.items.find((t=>t.tabbedItem===e));t&&this.showItemWrapper(t)}showItemWrapper(e){var t,i,s,o,n,r;const{tabbedItem:a,eHeaderButton:l}=e;null==(i=(t=this.params).onItemClicked)||i.call(t,{item:a}),this.activeItem!==e?(this.lastScrollListener&&(this.lastScrollListener=this.lastScrollListener()),za(this.eBody),a.bodyPromise.then((e=>{this.eBody.appendChild(e);const t=!this.focusService.isKeyboardMode();if(this.params.suppressFocusBodyOnOpen||this.focusService.focusInto(this.eBody,!1,t),a.afterAttachedCallback&&a.afterAttachedCallback(this.afterAttachedParams),this.params.keepScrollPosition){const t=a.getScrollableContainer&&a.getScrollableContainer()||e;this.lastScrollListener=this.addManagedListener(t,"scroll",(()=>{this.tabbedItemScrollMap.set(a.name,t.scrollTop)}));const i=this.tabbedItemScrollMap.get(a.name);void 0!==i&&setTimeout((()=>{t.scrollTop=i}),0)}})),this.activeItem&&(this.activeItem.eHeaderButton.classList.remove("ag-tab-selected"),null==(r=(n=this.activeItem.tabbedItem).afterDetachedCallback)||r.call(n)),l.classList.add("ag-tab-selected"),this.activeItem=e):null==(o=(s=this.params).onActiveItemClicked)||o.call(s)}};Gs([No("focusService")],Bc.prototype,"focusService",2),Gs([ql("eHeader")],Bc.prototype,"eHeader",2),Gs([ql("eBody")],Bc.prototype,"eBody",2),Gs([Lo],Bc.prototype,"postConstruct",1);var Wc=class extends Pn{constructor(){super(...arguments),this.polyfillFunctions=[]}observeResize(e,t){const i=this.gos.getWindow(),s=()=>{var i,s;let o=null!=(i=null==e?void 0:e.clientWidth)?i:0,n=null!=(s=null==e?void 0:e.clientHeight)?s:0,r=!0;const a=()=>{var i,s;if(r){const r=null!=(i=null==e?void 0:e.clientWidth)?i:0,l=null!=(s=null==e?void 0:e.clientHeight)?s:0;(r!==o||l!==n)&&(o=r,n=l,t()),this.doNextPolyfillTurn(a)}};return a(),()=>r=!1},o=this.gos.get("suppressBrowserResizeObserver");return i.ResizeObserver&&!o?(()=>{const s=new i.ResizeObserver(t);return s.observe(e),()=>s.disconnect()})():this.getFrameworkOverrides().wrapIncoming((()=>s()),"resize-observer")}doNextPolyfillTurn(e){this.polyfillFunctions.push(e),this.schedulePolyfill()}schedulePolyfill(){this.polyfillScheduled||(this.polyfillScheduled=!0,window.setTimeout((()=>{const e=this.polyfillFunctions;this.polyfillScheduled=!1,this.polyfillFunctions=[],e.forEach((e=>e()))}),50))}};Wc=Gs([Io("resizeObserverService")],Wc);var Uc=class extends Pn{constructor(){super(...arguments),this.createTasksP1={list:[],sorted:!1},this.createTasksP2={list:[],sorted:!1},this.destroyTasks=[],this.ticking=!1,this.scrollGoingDown=!0,this.lastPage=0,this.lastScrollTop=0,this.taskCount=0,this.cancelledTasks=new Set}setScrollTop(e){const t=this.gos.get("pagination");if(this.scrollGoingDown=e>=this.lastScrollTop,t&&0===e){const e=this.paginationProxy.getCurrentPage();e!==this.lastPage&&(this.lastPage=e,this.scrollGoingDown=!0)}this.lastScrollTop=e}init(){this.useAnimationFrame=!this.gos.get("suppressAnimationFrame")}isOn(){return this.useAnimationFrame}verifyAnimationFrameOn(e){!1===this.useAnimationFrame&&console.warn(`AG Grid: AnimationFrameService.${e} called but animation frames are off`)}createTask(e,t,i){this.verifyAnimationFrameOn(i);const s={task:e,index:t,createOrder:++this.taskCount};this.addTaskToList(this[i],s),this.schedule()}cancelTask(e){this.cancelledTasks.add(e)}addTaskToList(e,t){e.list.push(t),e.sorted=!1}sortTaskList(e){if(e.sorted)return;const t=this.scrollGoingDown?1:-1;e.list.sort(((e,i)=>e.index!==i.index?t*(i.index-e.index):i.createOrder-e.createOrder)),e.sorted=!0}addDestroyTask(e){this.verifyAnimationFrameOn("createTasksP3"),this.destroyTasks.push(e),this.schedule()}executeFrame(e){this.verifyAnimationFrameOn("executeFrame");const t=this.createTasksP1,i=t.list,s=this.createTasksP2,o=s.list,n=this.destroyTasks,r=(new Date).getTime();let a=(new Date).getTime()-r;const l=e<=0,u=this.ctrlsService.getGridBodyCtrl();for(;l||a<e;){if(!u.getScrollFeature().scrollGridIfNeeded()){let e;if(i.length)this.sortTaskList(t),e=i.pop().task;else if(o.length)this.sortTaskList(s),e=o.pop().task;else{if(!n.length){this.cancelledTasks.clear();break}e=n.pop()}this.cancelledTasks.has(e)||e()}a=(new Date).getTime()-r}i.length||o.length||n.length?this.requestFrame():this.stopTicking()}stopTicking(){this.ticking=!1}flushAllFrames(){this.useAnimationFrame&&this.executeFrame(-1)}schedule(){this.useAnimationFrame&&(this.ticking||(this.ticking=!0,this.requestFrame()))}requestFrame(){const e=this.executeFrame.bind(this,60);this.requestAnimationFrame(e)}requestAnimationFrame(e){const t=this.gos.getWindow();t.requestAnimationFrame?t.requestAnimationFrame(e):t.webkitRequestAnimationFrame?t.webkitRequestAnimationFrame(e):t.setTimeout(e,0)}isQueueEmpty(){return!this.ticking}debounce(e){let t=!1;return()=>{this.isOn()?t||(t=!0,this.addDestroyTask((()=>{t=!1,e()}))):window.setTimeout(e,0)}}};Gs([No("ctrlsService")],Uc.prototype,"ctrlsService",2),Gs([No("paginationProxy")],Uc.prototype,"paginationProxy",2),Gs([Lo],Uc.prototype,"init",1),Uc=Gs([Io("animationFrameService")],Uc);var zc=class extends Pn{postConstruct(){this.isClientSideRowModel="clientSide"===this.rowModel.getType()}expandRows(e){if(!this.isClientSideRowModel)return;const t=new Set(e);this.rowModel.forEachNode((e=>{e.id&&t.has(e.id)&&(e.expanded=!0)})),this.onGroupExpandedOrCollapsed()}getExpandedRows(){const e=[];return this.rowModel.forEachNode((({expanded:t,id:i})=>{t&&i&&e.push(i)})),e}expandAll(e){this.isClientSideRowModel&&this.rowModel.expandOrCollapseAll(e)}setRowNodeExpanded(e,t,i,s){e&&(i&&e.parent&&-1!==e.parent.level&&this.setRowNodeExpanded(e.parent,t,i,s),e.setExpanded(t,void 0,s))}onGroupExpandedOrCollapsed(){this.isClientSideRowModel&&this.rowModel.refreshModel({step:"map"})}};Gs([No("rowModel")],zc.prototype,"rowModel",2),Gs([Lo],zc.prototype,"postConstruct",1),zc=Gs([Io("expansionService")],zc);var $c=class extends Pn{postConstruct(){var e;this.activeMenuFactory=null!=(e=this.enterpriseMenuFactory)?e:this.filterMenuFactory}showColumnMenu(e){this.showColumnMenuCommon(this.activeMenuFactory,e,"columnMenu")}showFilterMenu(e){const t=this.enterpriseMenuFactory&&this.isLegacyMenuEnabled()?this.enterpriseMenuFactory:this.filterMenuFactory;this.showColumnMenuCommon(t,e,e.containerType,!0)}showHeaderContextMenu(e,t,i){this.activeMenuFactory.showMenuAfterContextMenuEvent(e,t,i)}getContextMenuPosition(e,t){const i=this.getRowCtrl(e),s=this.getCellGui(i,t);if(!s)return i?{x:0,y:i.getRowYPosition()}:{x:0,y:0};const o=s.getBoundingClientRect();return{x:o.x+o.width/2,y:o.y+o.height/2}}showContextMenu(e){var t,i,s;const{column:o,rowNode:n}=e;let{anchorToElement:r,value:a}=e;n&&o&&null==a&&(a=n.getValueFromValueService(o)),null==r&&(r=this.getContextMenuAnchorElement(n,o)),null==(s=this.contextMenuFactory)||s.onContextMenu(null!=(t=e.mouseEvent)?t:null,null!=(i=e.touchEvent)?i:null,null!=n?n:null,null!=o?o:null,a,r)}showColumnChooser(e){var t;null==(t=this.columnChooserFactory)||t.showColumnChooser(e)}hidePopupMenu(){var e;null==(e=this.contextMenuFactory)||e.hideActiveMenu(),this.activeMenuFactory.hideActiveMenu()}hideColumnChooser(){var e;null==(e=this.columnChooserFactory)||e.hideActiveColumnChooser()}isColumnMenuInHeaderEnabled(e){const{suppressMenu:t,suppressHeaderMenuButton:i}=e.getColDef();return!(null!=i?i:t)&&this.activeMenuFactory.isMenuEnabled(e)&&(this.isLegacyMenuEnabled()||!!this.enterpriseMenuFactory)}isFilterMenuInHeaderEnabled(e){return!e.getColDef().suppressHeaderFilterButton&&this.filterManager.isFilterAllowed(e)}isHeaderContextMenuEnabled(e){return!(null==e?void 0:e.getColDef().suppressHeaderContextMenu)&&"new"===this.getColumnMenuType()}isHeaderMenuButtonAlwaysShowEnabled(){return this.isSuppressMenuHide()}isHeaderMenuButtonEnabled(){const e=!this.isSuppressMenuHide();return!(sa()&&e)}isHeaderFilterButtonEnabled(e){return this.isFilterMenuInHeaderEnabled(e)&&!this.isLegacyMenuEnabled()&&!this.isFloatingFilterButtonDisplayed(e)}isFilterMenuItemEnabled(e){return this.filterManager.isFilterAllowed(e)&&!this.isLegacyMenuEnabled()&&!this.isFilterMenuInHeaderEnabled(e)&&!this.isFloatingFilterButtonDisplayed(e)}isColumnMenuAnchoringEnabled(){return!this.isLegacyMenuEnabled()}areAdditionalColumnMenuItemsEnabled(){return"new"===this.getColumnMenuType()}isLegacyMenuEnabled(){return"legacy"===this.getColumnMenuType()}isFloatingFilterButtonEnabled(e){var t;const i=e.getColDef(),s=null==(t=i.floatingFilterComponentParams)?void 0:t.suppressFilterButton;return null!=s&&co("As of v31.1, 'colDef.floatingFilterComponentParams.suppressFilterButton' is deprecated. Use 'colDef.suppressFloatingFilterButton' instead."),null==i.suppressFloatingFilterButton?!s:!i.suppressFloatingFilterButton}getColumnMenuType(){var e;return null!=(e=this.gos.get("columnMenu"))?e:"legacy"}isFloatingFilterButtonDisplayed(e){return!!e.getColDef().floatingFilter&&this.isFloatingFilterButtonEnabled(e)}isSuppressMenuHide(){const e=this.gos.get("suppressMenuHide");return this.isLegacyMenuEnabled()?e:!this.gos.exists("suppressMenuHide")||e}showColumnMenuCommon(e,t,i,s){const{column:o,positionBy:n}=t;if("button"===n){const{buttonElement:n}=t;e.showMenuAfterButtonClick(o,n,i,s)}else if("mouse"===n){const{mouseEvent:n}=t;e.showMenuAfterMouseEvent(o,n,i,s)}else o&&(this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(o,"auto"),this.animationFrameService.requestAnimationFrame((()=>{const t=this.ctrlsService.getHeaderRowContainerCtrl(o.getPinned()).getHeaderCtrlForColumn(o);e.showMenuAfterButtonClick(o,t.getAnchorElementForMenu(s),i,!0)})))}getRowCtrl(e){const{rowIndex:t,rowPinned:i}=e||{};if(null!=t)return this.rowRenderer.getRowByPosition({rowIndex:t,rowPinned:i})||void 0}getCellGui(e,t){if(!e||!t)return;const i=e.getCellCtrl(t);return(null==i?void 0:i.getGui())||void 0}getContextMenuAnchorElement(e,t){const i=this.ctrlsService.getGridBodyCtrl().getGridBodyElement(),s=this.getRowCtrl(e);if(!s)return i;return this.getCellGui(s,t)||(s.isFullWidth()?s.getFullWidthElement():i)}};Gs([No("filterMenuFactory")],$c.prototype,"filterMenuFactory",2),Gs([No("ctrlsService")],$c.prototype,"ctrlsService",2),Gs([No("animationFrameService")],$c.prototype,"animationFrameService",2),Gs([No("filterManager")],$c.prototype,"filterManager",2),Gs([No("rowRenderer")],$c.prototype,"rowRenderer",2),Gs([_o("columnChooserFactory")],$c.prototype,"columnChooserFactory",2),Gs([_o("contextMenuFactory")],$c.prototype,"contextMenuFactory",2),Gs([_o("enterpriseMenuFactory")],$c.prototype,"enterpriseMenuFactory",2),Gs([Lo],$c.prototype,"postConstruct",1),$c=Gs([Io("menuService")],$c);var Kc=class extends Pn{postConstruct(){this.ctrlsService.whenReady((e=>{this.centerRowContainerCtrl=e.center}))}getPreferredWidthForColumn(e,t){const i=this.getHeaderCellForColumn(e);if(!i)return-1;const s=this.rowRenderer.getAllCellsForColumn(e);return t||s.push(i),this.addElementsToContainerAndGetWidth(s)}getPreferredWidthForColumnGroup(e){const t=this.getHeaderCellForColumn(e);return t?this.addElementsToContainerAndGetWidth([t]):-1}addElementsToContainerAndGetWidth(e){const t=document.createElement("form");t.style.position="fixed";const i=this.centerRowContainerCtrl.getContainerElement();e.forEach((e=>this.cloneItemIntoDummy(e,t))),i.appendChild(t);const s=t.offsetWidth;return i.removeChild(t),s+this.getAutoSizePadding()}getAutoSizePadding(){return this.gos.get("autoSizePadding")}getHeaderCellForColumn(e){let t=null;return this.ctrlsService.getHeaderRowContainerCtrls().forEach((i=>{const s=i.getHtmlElementForColumnHeader(e);null!=s&&(t=s)})),t}cloneItemIntoDummy(e,t){const i=e.cloneNode(!0);i.style.width="",i.style.position="static",i.style.left="";const s=document.createElement("div"),o=s.classList;["ag-header-cell","ag-header-group-cell"].some((e=>i.classList.contains(e)))?(o.add("ag-header","ag-header-row"),s.style.position="static"):o.add("ag-row");let n=e.parentElement;for(;n;){if(["ag-header-row","ag-row"].some((e=>n.classList.contains(e)))){for(let e=0;e<n.classList.length;e++){const t=n.classList[e];"ag-row-position-absolute"!=t&&o.add(t)}break}n=n.parentElement}s.appendChild(i),t.appendChild(s)}};Gs([No("rowRenderer")],Kc.prototype,"rowRenderer",2),Gs([No("ctrlsService")],Kc.prototype,"ctrlsService",2),Gs([No("rowCssClassCalculator")],Kc.prototype,"rowCssClassCalculator",2),Gs([Lo],Kc.prototype,"postConstruct",1),Kc=Gs([Io("autoWidthCalculator")],Kc);var jc=class extends Pn{constructor(e,t){super(),this.createRowCon=e,this.destroyRowCtrls=t,this.stickyTopRowCtrls=[],this.stickyBottomRowCtrls=[],this.topContainerHeight=0,this.bottomContainerHeight=0}postConstruct(){this.isClientSide="clientSide"===this.rowModel.getType(),this.ctrlsService.whenReady((e=>{this.gridBodyCtrl=e.gridBodyCtrl}))}getStickyTopRowCtrls(){return this.stickyTopRowCtrls}getStickyBottomRowCtrls(){return this.stickyBottomRowCtrls}getLastPixelOfGroup(e){return this.isClientSide?this.getClientSideLastPixelOfGroup(e):this.getServerSideLastPixelOfGroup(e)}getFirstPixelOfGroup(e){return e.footer?e.sibling.rowTop+e.sibling.rowHeight-1:e.hasChildren()?e.rowTop-1:0}getServerSideLastPixelOfGroup(e){var t,i,s,o;if(this.isClientSide)throw new Error("This func should only be called in server side row model.");if(e.isExpandable()||e.footer){if(e.master)return e.detailNode.rowTop+e.detailNode.rowHeight;if(!e.sibling||1===Math.abs(e.sibling.rowIndex-e.rowIndex)){let n=null==(t=e.childStore)?void 0:t.getStoreBounds();return e.footer&&(n=null==(i=e.sibling.childStore)?void 0:i.getStoreBounds()),(null!=(s=null==n?void 0:n.heightPx)?s:0)+(null!=(o=null==n?void 0:n.topPx)?o:0)}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}getClientSideLastPixelOfGroup(e){if(!this.isClientSide)throw new Error("This func should only be called in client side row model.");if(e.isExpandable()||e.footer){const t=e.footer&&0===e.rowIndex,i=!e.sibling||1===Math.abs(e.sibling.rowIndex-e.rowIndex);if(t||i){let t=e.footer?e.sibling:e;for(;t.isExpandable()&&t.expanded;)if(t.master)t=t.detailNode;else if(t.childrenAfterSort){if(0===t.childrenAfterSort.length)break;t=Jo(t.childrenAfterSort)}return t.rowTop+t.rowHeight}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}updateStickyRows(e){const t="top"===e;let i=0;if(!this.canRowsBeSticky())return this.refreshNodesAndContainerHeight(e,new Set,i);const s=t?this.rowRenderer.getFirstVisibleVerticalPixel():this.rowRenderer.getLastVisibleVerticalPixel(),o=new Set,n=e=>{if(o.add(e),t){const t=this.getLastPixelOfGroup(e),o=s+i+e.rowHeight;e.stickyRowTop=t<o?i+(t-o):i}else{const t=this.getFirstPixelOfGroup(e),o=s-(i+e.rowHeight);e.stickyRowTop=t>o?i-(t-o):i}i=0,o.forEach((e=>{const t=e.stickyRowTop+e.rowHeight;i<t&&(i=t)}))},r=this.areFooterRowsStickySuppressed(),a=this.gos.get("suppressGroupRowsSticky"),l=e=>!!e.displayed&&(e.footer?!0!==r&&(("grand"!==r||-1!==e.level)&&(!("group"===r&&e.level>-1)&&!o.has(e))):!!e.isExpandable()&&(!0!==a&&(!o.has(e)&&e.expanded)));for(let e=0;e<100;e++){let e=s+i;t||(e=s-i);const o=this.rowModel.getRowIndexAtPixel(e),r=this.rowModel.getRow(o);if(null==r)break;const a=this.getStickyAncestors(r).find((e=>(t?e.rowIndex<o:e.rowIndex>o)&&l(e)));if(a)n(a);else{if(!(t?r.rowTop<e:r.rowTop+r.rowHeight>e)||!l(r))break;n(r)}}return t||o.forEach((e=>{e.stickyRowTop=i-(e.stickyRowTop+e.rowHeight)})),this.refreshNodesAndContainerHeight(e,o,i)}areFooterRowsStickySuppressed(){const e=this.gos.get("suppressStickyTotalRow");if(!0===e)return!0;const t=!!this.gos.get("groupIncludeFooter")||"group"===e,i=!!this.gos.get("groupIncludeTotalFooter")||"grand"===e;return!(!t||!i)||(i?"grand":!!t&&"group")}canRowsBeSticky(){const e=this.gos.isGroupRowsSticky(),t=this.areFooterRowsStickySuppressed(),i=this.gos.get("suppressGroupRowsSticky");return e&&(!t||!i)}getStickyAncestors(e){const t=[];let i=e.footer?e.sibling:e.parent;for(;i;)i.sibling&&t.push(i.sibling),t.push(i),i=i.parent;return t.reverse()}checkStickyRows(){const e=this.updateStickyRows("top"),t=this.updateStickyRows("bottom");return e||t}destroyStickyCtrls(){this.refreshNodesAndContainerHeight("top",new Set,0),this.refreshNodesAndContainerHeight("bottom",new Set,0)}refreshStickyNode(e){const t=new Set;if(this.stickyTopRowCtrls.some((t=>t.getRowNode()===e))){for(let i=0;i<this.stickyTopRowCtrls.length;i++){const s=this.stickyTopRowCtrls[i].getRowNode();s!==e&&t.add(s)}this.refreshNodesAndContainerHeight("top",t,this.topContainerHeight)&&this.checkStickyRows()}else{for(let i=0;i<this.stickyBottomRowCtrls.length;i++){const s=this.stickyBottomRowCtrls[i].getRowNode();s!==e&&t.add(s)}this.refreshNodesAndContainerHeight("bottom",t,this.bottomContainerHeight)&&this.checkStickyRows()}}refreshNodesAndContainerHeight(e,t,i){const s="top"===e,o=s?this.stickyTopRowCtrls:this.stickyBottomRowCtrls,n={},r=[];for(let e=0;e<o.length;e++){const i=o[e].getRowNode();t.has(i)?r.push(o[e]):(n[i.id]=o[e],i.sticky=!1)}const a=new Set;for(let e=0;e<r.length;e++)a.add(r[e].getRowNode());const l=[];t.forEach((e=>{a.has(e)||(e.sticky=!0,l.push(this.createRowCon(e,!1,!1)))}));let u=!!l.length||r.length!==o.length;s?this.topContainerHeight!==i&&(this.topContainerHeight=i,this.gridBodyCtrl.setStickyTopHeight(i),u=!0):this.bottomContainerHeight!==i&&(this.bottomContainerHeight=i,this.gridBodyCtrl.setStickyBottomHeight(i),u=!0),this.destroyRowCtrls(n,!1);const h=[...r,...l];return h.sort(((e,t)=>t.getRowNode().rowIndex-e.getRowNode().rowIndex)),s||h.reverse(),h.forEach((e=>e.setRowTop(e.getRowNode().stickyRowTop))),!!u&&(s?this.stickyTopRowCtrls=h:this.stickyBottomRowCtrls=h,!0)}};Gs([No("rowModel")],jc.prototype,"rowModel",2),Gs([No("rowRenderer")],jc.prototype,"rowRenderer",2),Gs([No("ctrlsService")],jc.prototype,"ctrlsService",2),Gs([Lo],jc.prototype,"postConstruct",1);var Yc=class extends Pn{constructor(){super(...arguments),this.destroyFuncsForColumnListeners=[],this.rowCtrlsByRowIndex={},this.zombieRowCtrls={},this.allRowCtrls=[],this.topRowCtrls=[],this.bottomRowCtrls=[],this.refreshInProgress=!1,this.dataFirstRenderedFired=!1,this.setupRangeSelectionListeners=()=>{const e=()=>{this.getAllCellCtrls().forEach((e=>e.onRangeSelectionChanged()))},t=()=>{this.getAllCellCtrls().forEach((e=>e.updateRangeBordersIfRangeCount()))},i=()=>{this.eventService.addEventListener(In.EVENT_RANGE_SELECTION_CHANGED,e),this.eventService.addEventListener(In.EVENT_COLUMN_MOVED,t),this.eventService.addEventListener(In.EVENT_COLUMN_PINNED,t),this.eventService.addEventListener(In.EVENT_COLUMN_VISIBLE,t)},s=()=>{this.eventService.removeEventListener(In.EVENT_RANGE_SELECTION_CHANGED,e),this.eventService.removeEventListener(In.EVENT_COLUMN_MOVED,t),this.eventService.removeEventListener(In.EVENT_COLUMN_PINNED,t),this.eventService.removeEventListener(In.EVENT_COLUMN_VISIBLE,t)};this.addDestroyFunc((()=>s())),this.addManagedPropertyListener("enableRangeSelection",(e=>{e.currentValue?i():s()})),this.gos.get("enableRangeSelection")&&i()}}postConstruct(){this.ctrlsService.whenReady((e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.initialise()}))}initialise(){if(this.addManagedListener(this.eventService,In.EVENT_PAGINATION_CHANGED,this.onPageLoaded.bind(this)),this.addManagedListener(this.eventService,In.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedListener(this.eventService,In.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,In.EVENT_BODY_SCROLL,this.onBodyScroll.bind(this)),this.addManagedListener(this.eventService,In.EVENT_BODY_HEIGHT_CHANGED,this.redraw.bind(this)),this.addManagedPropertyListeners(["domLayout","embedFullWidthRows"],(()=>this.onDomLayoutChanged())),this.addManagedPropertyListeners(["suppressMaxRenderedRowRestriction","rowBuffer"],(()=>this.redraw())),this.addManagedPropertyListeners(["suppressCellFocus","getBusinessKeyForNode","fullWidthCellRenderer","fullWidthCellRendererParams","rowStyle","getRowStyle","rowClass","getRowClass","rowClassRules","suppressStickyTotalRow","groupRowRenderer","groupRowRendererParams","loadingCellRenderer","loadingCellRendererParams","detailCellRenderer","detailCellRendererParams","enableRangeSelection","enableCellTextSelection"],(()=>this.redrawRows())),this.gos.isGroupRowsSticky()){const e=this.rowModel.getType();"clientSide"!==e&&"serverSide"!==e||(this.stickyRowFeature=this.createManagedBean(new jc(this.createRowCon.bind(this),this.destroyRowCtrls.bind(this))))}this.registerCellEventListeners(),this.initialiseCache(),this.printLayout=this.gos.isDomLayout("print"),this.embedFullWidthRows=this.printLayout||this.gos.get("embedFullWidthRows"),this.redrawAfterModelUpdate()}initialiseCache(){if(this.gos.get("keepDetailRows")){const e=this.getKeepDetailRowsCount(),t=null!=e?e:3;this.cachedRowCtrls=new qc(t)}}getKeepDetailRowsCount(){return this.gos.get("keepDetailRowsCount")}getStickyTopRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyTopRowCtrls():[]}getStickyBottomRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyBottomRowCtrls():[]}updateAllRowCtrls(){const e=so(this.rowCtrlsByRowIndex),t=so(this.zombieRowCtrls),i=this.cachedRowCtrls?this.cachedRowCtrls.getEntries():[];t.length>0||i.length>0?this.allRowCtrls=[...e,...t,...i]:this.allRowCtrls=e}onCellFocusChanged(e){this.getAllCellCtrls().forEach((t=>t.onCellFocused(e))),this.getFullWidthRowCtrls().forEach((t=>t.onFullWidthRowFocused(e)))}registerCellEventListeners(){this.addManagedListener(this.eventService,In.EVENT_CELL_FOCUSED,(e=>{this.onCellFocusChanged(e)})),this.addManagedListener(this.eventService,In.EVENT_CELL_FOCUS_CLEARED,(()=>{this.onCellFocusChanged()})),this.addManagedListener(this.eventService,In.EVENT_FLASH_CELLS,(e=>{this.getAllCellCtrls().forEach((t=>t.onFlashCells(e)))})),this.addManagedListener(this.eventService,In.EVENT_COLUMN_HOVER_CHANGED,(()=>{this.getAllCellCtrls().forEach((e=>e.onColumnHover()))})),this.addManagedListener(this.eventService,In.EVENT_DISPLAYED_COLUMNS_CHANGED,(()=>{this.getAllCellCtrls().forEach((e=>e.onDisplayedColumnsChanged()))})),this.addManagedListener(this.eventService,In.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,(()=>{this.printLayout&&this.getAllCellCtrls().forEach((e=>e.onLeftChanged()))})),this.setupRangeSelectionListeners(),this.refreshListenersToColumnsForCellComps(),this.addManagedListener(this.eventService,In.EVENT_GRID_COLUMNS_CHANGED,this.refreshListenersToColumnsForCellComps.bind(this)),this.addDestroyFunc(this.removeGridColumnListeners.bind(this))}removeGridColumnListeners(){this.destroyFuncsForColumnListeners.forEach((e=>e())),this.destroyFuncsForColumnListeners.length=0}refreshListenersToColumnsForCellComps(){this.removeGridColumnListeners(),this.columnModel.getAllGridColumns().forEach((e=>{const t=t=>{this.getAllCellCtrls().forEach((i=>{i.getColumn()===e&&t(i)}))},i=()=>{t((e=>e.onLeftChanged()))},s=()=>{t((e=>e.onWidthChanged()))},o=()=>{t((e=>e.onFirstRightPinnedChanged()))},n=()=>{t((e=>e.onLastLeftPinnedChanged()))},r=()=>{t((e=>e.onColDefChanged()))};e.addEventListener("leftChanged",i),e.addEventListener("widthChanged",s),e.addEventListener("firstRightPinnedChanged",o),e.addEventListener("lastLeftPinnedChanged",n),e.addEventListener("colDefChanged",r),this.destroyFuncsForColumnListeners.push((()=>{e.removeEventListener("leftChanged",i),e.removeEventListener("widthChanged",s),e.removeEventListener("firstRightPinnedChanged",o),e.removeEventListener("lastLeftPinnedChanged",n),e.removeEventListener("colDefChanged",r)}))}))}onDomLayoutChanged(){const e=this.gos.isDomLayout("print"),t=e||this.gos.get("embedFullWidthRows"),i=t!==this.embedFullWidthRows||this.printLayout!==e;this.printLayout=e,this.embedFullWidthRows=t,i&&this.redrawAfterModelUpdate({domLayoutChanged:!0})}datasourceChanged(){this.firstRenderedRow=0,this.lastRenderedRow=-1;const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e)}onPageLoaded(e){const t={recycleRows:e.keepRenderedRows,animate:e.animate,newData:e.newData,newPage:e.newPage,onlyBody:!0};this.redrawAfterModelUpdate(t)}getAllCellsForColumn(e){const t=[];return this.getAllRowCtrls().forEach((i=>{const s=i.getCellElement(e);s&&t.push(s)})),t}refreshFloatingRowComps(){this.refreshFloatingRows(this.topRowCtrls,this.pinnedRowModel.getPinnedTopRowData()),this.refreshFloatingRows(this.bottomRowCtrls,this.pinnedRowModel.getPinnedBottomRowData())}getTopRowCtrls(){return this.topRowCtrls}getCentreRowCtrls(){return this.allRowCtrls}getBottomRowCtrls(){return this.bottomRowCtrls}refreshFloatingRows(e,t){e.forEach((e=>{e.destroyFirstPass(),e.destroySecondPass()})),e.length=0,t&&t.forEach((t=>{const i=new Od(t,this.beans,!1,!1,this.printLayout);e.push(i)}))}onPinnedRowDataChanged(){this.redrawAfterModelUpdate({recycleRows:!0})}redrawRow(e,t=!1){var i;if(e.sticky)this.stickyRowFeature.refreshStickyNode(e);else{if(null==(i=this.cachedRowCtrls)?void 0:i.has(e))return void this.cachedRowCtrls.removeRow(e);{const t=t=>{const i=t[e.rowIndex];i&&i.getRowNode()===e&&(i.destroyFirstPass(),i.destroySecondPass(),t[e.rowIndex]=this.createRowCon(e,!1,!1))};switch(e.rowPinned){case"top":t(this.topRowCtrls);break;case"bottom":t(this.bottomRowCtrls);break;default:t(this.rowCtrlsByRowIndex),this.updateAllRowCtrls()}}}t||this.dispatchDisplayedRowsChanged(!1)}redrawRows(e){if(null!=e)return null==e||e.forEach((e=>this.redrawRow(e,!0))),void this.dispatchDisplayedRowsChanged(!1);this.redrawAfterModelUpdate()}getCellToRestoreFocusToAfterRefresh(e){const t=(null==e?void 0:e.suppressKeepFocus)?null:this.focusService.getFocusCellToUseAfterRefresh();if(null==t)return null;const i=this.gos.getActiveDomElement(),s=this.gos.getDomData(i,Id.DOM_DATA_KEY_CELL_CTRL),o=this.gos.getDomData(i,Od.DOM_DATA_KEY_ROW_CTRL);return s||o?t:null}redrawAfterModelUpdate(e={}){this.getLockOnRefresh();const t=this.getCellToRestoreFocusToAfterRefresh(e);this.updateContainerHeights(),this.scrollToTopIfNewData(e);const i=!e.domLayoutChanged&&!!e.recycleRows,s=e.animate&&this.gos.isAnimateRows(),o=i?this.getRowsToRecycle():null;i||this.removeAllRowComps(),this.workOutFirstAndLastRowsToRender(),this.stickyRowFeature&&this.stickyRowFeature.checkStickyRows(),this.recycleRows(o,s),this.gridBodyCtrl.updateRowCount(),e.onlyBody||this.refreshFloatingRowComps(),this.dispatchDisplayedRowsChanged(),null!=t&&this.restoreFocusedCell(t),this.releaseLockOnRefresh()}scrollToTopIfNewData(e){const t=e.newData||e.newPage,i=this.gos.get("suppressScrollOnNewData");t&&!i&&this.gridBodyCtrl.getScrollFeature().scrollToTop()}updateContainerHeights(){if(this.printLayout)return void this.rowContainerHeightService.setModelHeight(null);let e=this.paginationProxy.getCurrentPageHeight();0===e&&(e=1),this.rowContainerHeightService.setModelHeight(e)}getLockOnRefresh(){if(this.refreshInProgress)throw new Error("AG Grid: cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, e.g. instead of api.redrawRows(), call setTimeout(function() { api.redrawRows(); }, 0). To see what part of your code that caused the refresh check this stacktrace.");this.refreshInProgress=!0}releaseLockOnRefresh(){this.refreshInProgress=!1}isRefreshInProgress(){return this.refreshInProgress}restoreFocusedCell(e){e&&(this.focusService.setRestoreFocusedCell(e),this.onCellFocusChanged(this.beans.gos.addGridCommonParams({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,type:"mock"})))}stopEditing(e=!1){this.getAllRowCtrls().forEach((t=>{t.stopEditing(e)}))}getAllCellCtrls(){const e=[],t=this.getAllRowCtrls(),i=t.length;for(let s=0;s<i;s++){const i=t[s].getAllCellCtrls(),o=i.length;for(let t=0;t<o;t++)e.push(i[t])}return e}getAllRowCtrls(){const e=this.stickyRowFeature&&this.stickyRowFeature.getStickyTopRowCtrls()||[],t=this.stickyRowFeature&&this.stickyRowFeature.getStickyBottomRowCtrls()||[],i=[...this.topRowCtrls,...this.bottomRowCtrls,...e,...t];for(const e in this.rowCtrlsByRowIndex)i.push(this.rowCtrlsByRowIndex[e]);return i}addRenderedRowListener(e,t,i){const s=this.rowCtrlsByRowIndex[t];s&&s.addEventListener(e,i)}flashCells(e={}){this.getCellCtrls(e.rowNodes,e.columns).forEach((t=>t.flashCell(e)))}refreshCells(e={}){const t={forceRefresh:e.force,newData:!1,suppressFlash:e.suppressFlash};this.getCellCtrls(e.rowNodes,e.columns).forEach((e=>e.refreshOrDestroyCell(t))),e.rowNodes&&(this.getRowCtrls(e.rowNodes).forEach((e=>{e.isFullWidth()&&(e.refreshFullWidth()||this.redrawRow(e.getRowNode(),!0))})),this.dispatchDisplayedRowsChanged(!1))}getCellRendererInstances(e){var t;const i=this.getCellCtrls(e.rowNodes,e.columns).map((e=>e.getCellRenderer())).filter((e=>null!=e));if(null==(t=e.columns)?void 0:t.length)return i;const s=[],o=this.mapRowNodes(e.rowNodes);return this.getAllRowCtrls().forEach((e=>{if(o&&!this.isRowInMap(e.getRowNode(),o))return;if(!e.isFullWidth())return;const t=e.getFullWidthCellRenderers();for(let e=0;e<t.length;e++){const i=t[e];null!=i&&s.push(i)}})),[...s,...i]}getCellEditorInstances(e){const t=[];return this.getCellCtrls(e.rowNodes,e.columns).forEach((e=>{const i=e.getCellEditor();i&&t.push(i)})),t}getEditingCells(){const e=[];return this.getAllCellCtrls().forEach((t=>{if(t.isEditing()){const i=t.getCellPosition();e.push(i)}})),e}mapRowNodes(e){if(!e)return;const t={top:{},bottom:{},normal:{}};return e.forEach((e=>{const i=e.id;switch(e.rowPinned){case"top":t.top[i]=e;break;case"bottom":t.bottom[i]=e;break;default:t.normal[i]=e}})),t}isRowInMap(e,t){const i=e.id;switch(e.rowPinned){case"top":return null!=t.top[i];case"bottom":return null!=t.bottom[i];default:return null!=t.normal[i]}}getRowCtrls(e){const t=this.mapRowNodes(e),i=this.getAllRowCtrls();return e&&t?i.filter((e=>{const i=e.getRowNode();return this.isRowInMap(i,t)})):i}getCellCtrls(e,t){let i;Bs(t)&&(i={},t.forEach((e=>{const t=this.columnModel.getGridColumn(e);Bs(t)&&(i[t.getId()]=!0)})));const s=[];return this.getRowCtrls(e).forEach((e=>{e.getAllCellCtrls().forEach((e=>{const t=e.getColumn().getId();i&&!i[t]||s.push(e)}))})),s}destroy(){this.removeAllRowComps(),super.destroy()}removeAllRowComps(){const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e),this.stickyRowFeature&&this.stickyRowFeature.destroyStickyCtrls()}getRowsToRecycle(){const e=[];eo(this.rowCtrlsByRowIndex,((t,i)=>{null==i.getRowNode().id&&e.push(t)})),this.removeRowCtrls(e);const t={};return eo(this.rowCtrlsByRowIndex,((e,i)=>{const s=i.getRowNode();t[s.id]=i})),this.rowCtrlsByRowIndex={},t}removeRowCtrls(e,t=!1){e.forEach((e=>{const i=this.rowCtrlsByRowIndex[e];i&&(i.destroyFirstPass(t),i.destroySecondPass()),delete this.rowCtrlsByRowIndex[e]}))}onBodyScroll(e){"vertical"===e.direction&&this.redraw({afterScroll:!0})}redraw(e={}){const{afterScroll:t}=e;let i;this.stickyRowFeature&&oa()&&(i=this.getCellToRestoreFocusToAfterRefresh()||void 0);const s=this.firstRenderedRow,o=this.lastRenderedRow;this.workOutFirstAndLastRowsToRender();let n=!1;this.stickyRowFeature&&(n=this.stickyRowFeature.checkStickyRows());const r=this.firstRenderedRow!==s||this.lastRenderedRow!==o;if((!t||n||r)&&(this.getLockOnRefresh(),this.recycleRows(null,!1,t),this.releaseLockOnRefresh(),this.dispatchDisplayedRowsChanged(t&&!n),null!=i)){const e=this.getCellToRestoreFocusToAfterRefresh();null!=i&&null==e&&(this.animationFrameService.flushAllFrames(),this.restoreFocusedCell(i))}}removeRowCompsNotToDraw(e,t){const i={};e.forEach((e=>i[e]=!0));const s=Object.keys(this.rowCtrlsByRowIndex).filter((e=>!i[e]));this.removeRowCtrls(s,t)}calculateIndexesToDraw(e){let t=ma(this.firstRenderedRow,this.lastRenderedRow);const i=(e,i)=>{const s=i.getRowNode().rowIndex;null!=s&&(s<this.firstRenderedRow||s>this.lastRenderedRow)&&this.doNotUnVirtualiseRow(i)&&t.push(s)};eo(this.rowCtrlsByRowIndex,i),eo(e,i),t.sort(((e,t)=>e-t));const s=[];for(let e=0;e<t.length;e++){const i=t[e],o=this.paginationProxy.getRow(i);o&&!o.sticky&&s.push(i)}return s}recycleRows(e,t=!1,i=!1){const s=this.calculateIndexesToDraw(e);(this.printLayout||i)&&(t=!1),this.removeRowCompsNotToDraw(s,!t);const o=[];s.forEach((s=>{const n=this.createOrUpdateRowCtrl(s,e,t,i);Bs(n)&&o.push(n)})),e&&(!i||this.gos.get("suppressAnimationFrame")||this.printLayout?this.destroyRowCtrls(e,t):this.beans.animationFrameService.addDestroyTask((()=>{this.destroyRowCtrls(e,t),this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}))),this.updateAllRowCtrls()}dispatchDisplayedRowsChanged(e=!1){const t={type:In.EVENT_DISPLAYED_ROWS_CHANGED,afterScroll:e};this.eventService.dispatchEvent(t)}onDisplayedColumnsChanged(){const e=this.columnModel.isPinningLeft(),t=this.columnModel.isPinningRight();(this.pinningLeft!==e||t!==this.pinningRight)&&(this.pinningLeft=e,this.pinningRight=t,this.embedFullWidthRows&&this.redrawFullWidthEmbeddedRows())}redrawFullWidthEmbeddedRows(){const e=[];this.getFullWidthRowCtrls().forEach((t=>{const i=t.getRowNode().rowIndex;e.push(i.toString())})),this.refreshFloatingRowComps(),this.removeRowCtrls(e),this.redraw({afterScroll:!0})}getFullWidthRowCtrls(e){const t=this.mapRowNodes(e);return this.getAllRowCtrls().filter((e=>{if(!e.isFullWidth())return!1;const i=e.getRowNode();return!(null!=t&&!this.isRowInMap(i,t))}))}createOrUpdateRowCtrl(e,t,i,s){let o,n=this.rowCtrlsByRowIndex[e];if(n||(o=this.paginationProxy.getRow(e),Bs(o)&&Bs(t)&&t[o.id]&&o.alreadyRendered&&(n=t[o.id],t[o.id]=null)),!n){if(o||(o=this.paginationProxy.getRow(e)),!Bs(o))return;n=this.createRowCon(o,i,s)}return o&&(o.alreadyRendered=!0),this.rowCtrlsByRowIndex[e]=n,n}destroyRowCtrls(e,t){const i=[];eo(e,((e,s)=>{s&&(this.cachedRowCtrls&&s.isCacheable()?this.cachedRowCtrls.addRow(s):(s.destroyFirstPass(!t),t?(this.zombieRowCtrls[s.getInstanceId()]=s,i.push((()=>{s.destroySecondPass(),delete this.zombieRowCtrls[s.getInstanceId()]}))):s.destroySecondPass()))})),t&&(i.push((()=>{this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()})),fo(i))}getRowBuffer(){return this.gos.get("rowBuffer")}getRowBufferInPixels(){return this.getRowBuffer()*this.gos.getRowHeightAsNumber()}workOutFirstAndLastRowsToRender(){let e,t;if(this.rowContainerHeightService.updateOffset(),this.paginationProxy.isRowsToRender())if(this.printLayout)this.environment.refreshRowHeightVariable(),e=this.paginationProxy.getPageFirstRow(),t=this.paginationProxy.getPageLastRow();else{const i=this.getRowBufferInPixels(),s=this.ctrlsService.getGridBodyCtrl(),o=this.gos.get("suppressRowVirtualisation");let n,r,a=!1;do{const e=this.paginationProxy.getPixelOffset(),{pageFirstPixel:t,pageLastPixel:l}=this.paginationProxy.getCurrentPagePixelRange(),u=this.rowContainerHeightService.getDivStretchOffset(),h=s.getScrollFeature().getVScrollPosition(),d=h.top,c=h.bottom;o?(n=t+u,r=l+u):(n=Math.max(d+e-i,t)+u,r=Math.min(c+e+i,l)+u),this.firstVisibleVPixel=Math.max(d+e,t)+u,this.lastVisibleVPixel=Math.min(c+e,l)+u,a=this.ensureAllRowsInRangeHaveHeightsCalculated(n,r)}while(a);let l=this.paginationProxy.getRowIndexAtPixel(n),u=this.paginationProxy.getRowIndexAtPixel(r);const h=this.paginationProxy.getPageFirstRow(),d=this.paginationProxy.getPageLastRow();l<h&&(l=h),u>d&&(u=d),e=l,t=u}else e=0,t=-1;const i=this.gos.isDomLayout("normal"),s=this.gos.get("suppressMaxRenderedRowRestriction"),o=Math.max(this.getRowBuffer(),500);i&&!s&&t-e>o&&(t=e+o);const n=e!==this.firstRenderedRow,r=t!==this.lastRenderedRow;if(n||r){this.firstRenderedRow=e,this.lastRenderedRow=t;const i={type:In.EVENT_VIEWPORT_CHANGED,firstRow:e,lastRow:t};this.eventService.dispatchEvent(i)}}dispatchFirstDataRenderedEvent(){if(this.dataFirstRenderedFired)return;this.dataFirstRenderedFired=!0;const e={type:In.EVENT_FIRST_DATA_RENDERED,firstRow:this.firstRenderedRow,lastRow:this.lastRenderedRow};window.requestAnimationFrame((()=>{this.beans.eventService.dispatchEvent(e)}))}ensureAllRowsInRangeHaveHeightsCalculated(e,t){const i=this.paginationProxy.ensureRowHeightsValid(e,t,-1,-1);return i&&this.updateContainerHeights(),i}getFirstVisibleVerticalPixel(){return this.firstVisibleVPixel}getLastVisibleVerticalPixel(){return this.lastVisibleVPixel}getFirstVirtualRenderedRow(){return this.firstRenderedRow}getLastVirtualRenderedRow(){return this.lastRenderedRow}doNotUnVirtualiseRow(e){const t=!1,i=e.getRowNode(),s=this.focusService.isRowNodeFocused(i),o=e.isEditing(),n=i.detail;return(s||o||n)&&!!this.paginationProxy.isRowPresent(i)||t}createRowCon(e,t,i){const s=this.cachedRowCtrls?this.cachedRowCtrls.getRow(e):null;if(s)return s;const o=this.gos.get("suppressAnimationFrame"),n=i&&!o&&!this.printLayout;return new Od(e,this.beans,t,n,this.printLayout)}getRenderedNodes(){const e=this.rowCtrlsByRowIndex;return Object.values(e).map((e=>e.getRowNode()))}getRowByPosition(e){let t;const{rowIndex:i}=e;switch(e.rowPinned){case"top":t=this.topRowCtrls[i];break;case"bottom":t=this.bottomRowCtrls[i];break;default:t=this.rowCtrlsByRowIndex[i],t||(t=this.getStickyTopRowCtrls().find((e=>e.getRowNode().rowIndex===i))||null,t||(t=this.getStickyBottomRowCtrls().find((e=>e.getRowNode().rowIndex===i))||null))}return t}isRangeInRenderedViewport(e,t){if(null==e||null==t)return!1;const i=e>this.lastRenderedRow;return!(t<this.firstRenderedRow||i)}};Gs([No("animationFrameService")],Yc.prototype,"animationFrameService",2),Gs([No("paginationProxy")],Yc.prototype,"paginationProxy",2),Gs([No("columnModel")],Yc.prototype,"columnModel",2),Gs([No("pinnedRowModel")],Yc.prototype,"pinnedRowModel",2),Gs([No("rowModel")],Yc.prototype,"rowModel",2),Gs([No("focusService")],Yc.prototype,"focusService",2),Gs([No("beans")],Yc.prototype,"beans",2),Gs([No("rowContainerHeightService")],Yc.prototype,"rowContainerHeightService",2),Gs([No("ctrlsService")],Yc.prototype,"ctrlsService",2),Gs([Lo],Yc.prototype,"postConstruct",1),Yc=Gs([Io("rowRenderer")],Yc);var qc=class{constructor(e){this.entriesMap={},this.entriesList=[],this.maxCount=e}addRow(e){if(this.entriesMap[e.getRowNode().id]=e,this.entriesList.push(e),e.setCached(!0),this.entriesList.length>this.maxCount){const e=this.entriesList[0];e.destroyFirstPass(),e.destroySecondPass(),this.removeFromCache(e)}}getRow(e){if(null==e||null==e.id)return null;const t=this.entriesMap[e.id];return t?(this.removeFromCache(t),t.setCached(!1),t.getRowNode()!=e?null:t):null}has(e){return null!=this.entriesMap[e.id]}removeRow(e){const t=e.id,i=this.entriesMap[t];delete this.entriesMap[t],nn(this.entriesList,i)}removeFromCache(e){const t=e.getRowNode().id;delete this.entriesMap[t],nn(this.entriesList,e)}getEntries(){return this.entriesList}},Xc=class extends Pn{init(){this.setPinnedTopRowData(),this.setPinnedBottomRowData(),this.addManagedPropertyListener("pinnedTopRowData",(()=>this.setPinnedTopRowData())),this.addManagedPropertyListener("pinnedBottomRowData",(()=>this.setPinnedBottomRowData()))}isEmpty(e){return Us("top"===e?this.pinnedTopRows:this.pinnedBottomRows)}isRowsToRender(e){return!this.isEmpty(e)}getRowAtPixel(e,t){const i="top"===t?this.pinnedTopRows:this.pinnedBottomRows;if(Us(i))return 0;for(let t=0;t<i.length;t++){const s=i[t];if(s.rowTop+s.rowHeight-1>=e)return t}return i.length-1}setPinnedTopRowData(){const e=this.gos.get("pinnedTopRowData");this.pinnedTopRows=this.createNodesFromData(e,!0);const t={type:In.EVENT_PINNED_ROW_DATA_CHANGED};this.eventService.dispatchEvent(t)}setPinnedBottomRowData(){const e=this.gos.get("pinnedBottomRowData");this.pinnedBottomRows=this.createNodesFromData(e,!1);const t={type:In.EVENT_PINNED_ROW_DATA_CHANGED};this.eventService.dispatchEvent(t)}createNodesFromData(e,t){const i=[];if(e){let s=0;e.forEach(((e,o)=>{const n=new ah(this.beans);n.data=e;const r=t?ah.ID_PREFIX_TOP_PINNED:ah.ID_PREFIX_BOTTOM_PINNED;n.id=r+o,n.rowPinned=t?"top":"bottom",n.setRowTop(s),n.setRowHeight(this.gos.getRowHeightForNode(n).height),n.setRowIndex(o),s+=n.rowHeight,i.push(n)}))}return i}getPinnedTopRowData(){return this.pinnedTopRows}getPinnedBottomRowData(){return this.pinnedBottomRows}getPinnedTopTotalHeight(){return this.getTotalHeight(this.pinnedTopRows)}getPinnedTopRowCount(){return this.pinnedTopRows?this.pinnedTopRows.length:0}getPinnedBottomRowCount(){return this.pinnedBottomRows?this.pinnedBottomRows.length:0}getPinnedTopRow(e){return this.pinnedTopRows[e]}getPinnedBottomRow(e){return this.pinnedBottomRows[e]}forEachPinnedTopRow(e){Us(this.pinnedTopRows)||this.pinnedTopRows.forEach(e)}forEachPinnedBottomRow(e){Us(this.pinnedBottomRows)||this.pinnedBottomRows.forEach(e)}getPinnedBottomTotalHeight(){return this.getTotalHeight(this.pinnedBottomRows)}getTotalHeight(e){if(!e||0===e.length)return 0;const t=Jo(e);return t.rowTop+t.rowHeight}};Gs([No("beans")],Xc.prototype,"beans",2),Gs([Lo],Xc.prototype,"init",1),Xc=Gs([Io("pinnedRowModel")],Xc);var Qc=class{constructor(e,t){this.active=!0,this.nodeIdsToColumns={},this.mapToItems={},this.keepingColumns=e,this.pathRoot={rowNode:t,children:null},this.mapToItems[t.id]=this.pathRoot}setInactive(){this.active=!1}isActive(){return this.active}depthFirstSearchChangedPath(e,t){if(e.children)for(let i=0;i<e.children.length;i++)this.depthFirstSearchChangedPath(e.children[i],t);t(e.rowNode)}depthFirstSearchEverything(e,t,i){if(e.childrenAfterGroup)for(let s=0;s<e.childrenAfterGroup.length;s++){const o=e.childrenAfterGroup[s];o.childrenAfterGroup?this.depthFirstSearchEverything(e.childrenAfterGroup[s],t,i):i&&t(o)}t(e)}forEachChangedNodeDepthFirst(e,t=!1,i=!1){this.active&&!i?this.depthFirstSearchChangedPath(this.pathRoot,e):this.depthFirstSearchEverything(this.pathRoot.rowNode,e,t)}executeFromRootNode(e){e(this.pathRoot.rowNode)}createPathItems(e){let t=e,i=0;for(;!this.mapToItems[t.id];){const e={rowNode:t,children:null};this.mapToItems[t.id]=e,i++,t=t.parent}return i}populateColumnsMap(e,t){if(!this.keepingColumns||!t)return;let i=e;for(;i;)this.nodeIdsToColumns[i.id]||(this.nodeIdsToColumns[i.id]={}),t.forEach((e=>this.nodeIdsToColumns[i.id][e.getId()]=!0)),i=i.parent}linkPathItems(e,t){let i=e;for(let e=0;e<t;e++){const e=this.mapToItems[i.id],t=this.mapToItems[i.parent.id];t.children||(t.children=[]),t.children.push(e),i=i.parent}}addParentNode(e,t){if(!e||e.isRowPinned())return;const i=this.createPathItems(e);this.linkPathItems(e,i),this.populateColumnsMap(e,t)}canSkip(e){return this.active&&!this.mapToItems[e.id]}getValueColumnsForNode(e,t){if(!this.keepingColumns)return t;const i=this.nodeIdsToColumns[e.id];return t.filter((e=>i[e.getId()]))}getNotValueColumnsForNode(e,t){if(!this.keepingColumns)return null;const i=this.nodeIdsToColumns[e.id];return t.filter((e=>!i[e.getId()]))}},Jc=class e extends Pn{constructor(t){super(),this.state=e.STATE_WAITING_TO_LOAD,this.version=0,this.id=t}getId(){return this.id}load(){this.state=e.STATE_LOADING,this.loadFromDatasource()}getVersion(){return this.version}setStateWaitingToLoad(){this.version++,this.state=e.STATE_WAITING_TO_LOAD}getState(){return this.state}pageLoadFailed(t){this.isRequestMostRecentAndLive(t)&&(this.state=e.STATE_FAILED,this.processServerFail()),this.dispatchLoadCompleted(!1)}success(e,t){this.successCommon(e,t)}pageLoaded(e,t,i){this.successCommon(e,{rowData:t,rowCount:i})}isRequestMostRecentAndLive(e){const t=e===this.version,i=this.isAlive();return t&&i}successCommon(t,i){this.dispatchLoadCompleted(),this.isRequestMostRecentAndLive(t)&&(this.state=e.STATE_LOADED,this.processServerResult(i))}dispatchLoadCompleted(t=!0){const i={type:e.EVENT_LOAD_COMPLETE,success:t,block:this};this.dispatchEvent(i)}};Jc.EVENT_LOAD_COMPLETE="loadComplete",Jc.STATE_WAITING_TO_LOAD="needsLoading",Jc.STATE_LOADING="loading",Jc.STATE_LOADED="loaded",Jc.STATE_FAILED="failed";var Zc=Jc,ep=class extends Pn{constructor(){super(...arguments),this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=this.getMaxConcurrentDatasourceRequests();const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=Vl.debounce(this.performCheckBlocksToLoad.bind(this),e))}setBeans(e){this.logger=e.create("RowNodeBlockLoader")}getMaxConcurrentDatasourceRequests(){const e=this.gos.get("maxConcurrentDatasourceRequests");return null==e?2:e<=0?void 0:e}addBlock(e){this.blocks.push(e),e.addEventListener(Zc.EVENT_LOAD_COMPLETE,this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){Vl.removeFromArray(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad(),this.dispatchEvent({type:ep.BLOCK_LOADED_EVENT}),0==this.activeBlockLoadsCount&&this.dispatchEvent({type:ep.BLOCK_LOADER_FINISHED_EVENT})}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),null!=this.maxConcurrentRequests&&this.activeBlockLoadsCount>=this.maxConcurrentRequests)return void this.logger.log("checkBlockToLoad: max loads exceeded");const e=this.getAvailableLoadingCount(),t=this.blocks.filter((e=>e.getState()===Zc.STATE_WAITING_TO_LOAD)).slice(0,e);this.registerLoads(t.length),t.forEach((e=>e.load())),this.printCacheStatus()}getBlockState(){if(this.gos.isRowModelType("serverSide"))return this.rowModel.getBlockStates();const e={};return this.blocks.forEach((t=>{const{id:i,state:s}=t.getBlockStateJson();e[i]=s})),e}printCacheStatus(){this.logger.isLogging()&&this.logger.log(`printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}isLoading(){return this.activeBlockLoadsCount>0}registerLoads(e){this.activeBlockLoadsCount+=e}getAvailableLoadingCount(){return void 0!==this.maxConcurrentRequests?this.maxConcurrentRequests-this.activeBlockLoadsCount:void 0}};ep.BLOCK_LOADED_EVENT="blockLoaded",ep.BLOCK_LOADER_FINISHED_EVENT="blockLoaderFinished",Gs([No("rowModel")],ep.prototype,"rowModel",2),Gs([Lo],ep.prototype,"postConstruct",1),Gs([ks(0,Go("loggerFactory"))],ep.prototype,"setBeans",1),ep=Gs([Io("rowNodeBlockLoader")],ep);var tp=class extends Pn{constructor(){super(...arguments),this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.pixelOffset=0,this.masterRowCount=0}postConstruct(){this.active=this.gos.get("pagination"),this.pageSizeFromGridOptions=this.gos.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedListener(this.eventService,In.EVENT_MODEL_UPDATED,this.onModelUpdated.bind(this)),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this)),this.onModelUpdated()}ensureRowHeightsValid(e,t,i,s){const o=this.rowModel.ensureRowHeightsValid(e,t,this.getPageFirstRow(),this.getPageLastRow());return o&&this.calculatePages(),o}isPaginateChildRows(){return!(!this.gos.get("groupRemoveSingleChildren")&&!this.gos.get("groupRemoveLowestSingleChildren"))||this.gos.get("paginateChildRows")}onModelUpdated(e){this.calculatePages();const t={type:In.EVENT_PAGINATION_CHANGED,animate:!!e&&e.animate,newData:!!e&&e.newData,newPage:!!e&&e.newPage,newPageSize:!!e&&e.newPageSize,keepRenderedRows:!!e&&e.keepRenderedRows};this.eventService.dispatchEvent(t)}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages();const e={type:In.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!1,newPageSize:!1,keepRenderedRows:!0};this.eventService.dispatchEvent(e)}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){if(!this.active||this.currentPage===e||"number"!=typeof this.currentPage)return;this.currentPage=e,this.calculatePages();const t={type:In.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!0,newPageSize:!1,keepRenderedRows:!1};this.eventService.dispatchEvent(t)}getPixelOffset(){return this.pixelOffset}getRow(e){return this.rowModel.getRow(e)}getRowNode(e){return this.rowModel.getRowNode(e)}getRowIndexAtPixel(e){return this.rowModel.getRowIndexAtPixel(e)}getCurrentPageHeight(){return Ws(this.topRowBounds)||Ws(this.bottomRowBounds)?0:Math.max(this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight-this.topRowBounds.rowTop,0)}getCurrentPagePixelRange(){return{pageFirstPixel:this.topRowBounds?this.topRowBounds.rowTop:0,pageLastPixel:this.bottomRowBounds?this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight:0}}isRowPresent(e){return!!this.rowModel.isRowPresent(e)&&(e.rowIndex>=this.topDisplayedRowIndex&&e.rowIndex<=this.bottomDisplayedRowIndex)}isEmpty(){return this.rowModel.isEmpty()}isRowsToRender(){return this.rowModel.isRowsToRender()}forEachNode(e){return this.rowModel.forEachNode(e)}forEachNodeOnPage(e){const t=this.getPageFirstRow(),i=this.getPageLastRow();for(let s=t;s<=i;s++){const t=this.getRow(s);t&&e(t)}}getType(){return this.rowModel.getType()}getRowBounds(e){const t=this.rowModel.getRowBounds(e);return t.rowIndex=e,t}getPageFirstRow(){return this.topRowBounds?this.topRowBounds.rowIndex:-1}getPageLastRow(){return this.bottomRowBounds?this.bottomRowBounds.rowIndex:-1}getRowCount(){return this.rowModel.getRowCount()}getPageForIndex(e){return Math.floor(e/this.pageSize)}goToPageWithIndex(e){if(!this.active)return;const t=this.getPageForIndex(e);this.goToPage(t)}isRowInPage(e){return!this.active||this.getPageForIndex(e.rowIndex)===this.currentPage}isLastPageFound(){return this.rowModel.isLastRowIndexKnown()}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return Bs(this.pageSizeAutoCalculated)?this.pageSizeAutoCalculated:Bs(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:Bs(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:Bs(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}unsetAutoCalculatedPageSize(){if(void 0===this.pageSizeAutoCalculated)return;const e=this.pageSizeAutoCalculated;if(this.pageSizeAutoCalculated=void 0,this.pageSize===e)return;this.calculatePages();const t={type:In.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!1,newPageSize:!0,keepRenderedRows:!1};this.eventService.dispatchEvent(t)}setPageSize(e,t){const i=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,0!==this.currentPage&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,0!==this.currentPage&&this.goToFirstPage()}if(i!==this.pageSize){this.calculatePages();const e={type:In.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!1,newPageSize:!0,keepRenderedRows:!0};this.eventService.dispatchEvent(e)}}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.topRowBounds=this.rowModel.getRowBounds(this.topDisplayedRowIndex),this.topRowBounds&&(this.topRowBounds.rowIndex=this.topDisplayedRowIndex),this.bottomRowBounds=this.rowModel.getRowBounds(this.bottomDisplayedRowIndex),this.bottomRowBounds&&(this.bottomRowBounds.rowIndex=this.bottomDisplayedRowIndex),this.setPixelOffset(Bs(this.topRowBounds)?this.topRowBounds.rowTop:0)}setPixelOffset(e){this.pixelOffset!==e&&(this.pixelOffset=e,this.eventService.dispatchEvent({type:In.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){this.currentPage>=this.totalPages&&(this.currentPage=this.totalPages-1),(!isFinite(this.currentPage)||isNaN(this.currentPage)||this.currentPage<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){if(this.masterRowCount=this.rowModel.getTopLevelRowCount(),this.masterRowCount<=0)return void this.setZeroRows();const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid();const t=this.pageSize*this.currentPage;let i=this.pageSize*(this.currentPage+1)-1;if(i>e&&(i=e),this.topDisplayedRowIndex=this.rowModel.getTopLevelRowDisplayedIndex(t),i===e)this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1;else{const e=this.rowModel.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=e-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){if(this.masterRowCount=this.rowModel.getRowCount(),0===this.masterRowCount)return void this.setZeroRows();const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=this.pageSize*this.currentPage,this.bottomDisplayedRowIndex=this.pageSize*(this.currentPage+1)-1,this.bottomDisplayedRowIndex>e&&(this.bottomDisplayedRowIndex=e)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1}};Gs([No("rowModel")],tp.prototype,"rowModel",2),Gs([Lo],tp.prototype,"postConstruct",1),tp=Gs([Io("paginationProxy")],tp);var ip=class extends Pn{processAllCellClasses(e,t,i,s){this.processClassRules(void 0,e.cellClassRules,t,i,s),this.processStaticCellClasses(e,t,i)}processClassRules(e,t,i,s,o){if(null==t&&null==e)return;const n={},r={},a=(e,t)=>{e.split(" ").forEach((e=>{""!=e.trim()&&t(e)}))};if(t){const e=Object.keys(t);for(let s=0;s<e.length;s++){const o=e[s],l=t[o];let u;"string"==typeof l?u=this.expressionService.evaluate(l,i):"function"==typeof l&&(u=l(i)),a(o,(e=>{u?n[e]=!0:r[e]=!0}))}}e&&o&&Object.keys(e).forEach((e=>a(e,(e=>{n[e]||(r[e]=!0)})))),o&&Object.keys(r).forEach(o),Object.keys(n).forEach(s)}getStaticCellClasses(e,t){const{cellClass:i}=e;if(!i)return[];let s;return s="function"==typeof i?i(t):i,"string"==typeof s&&(s=[s]),s||[]}processStaticCellClasses(e,t,i){this.getStaticCellClasses(e,t).forEach((e=>{i(e)}))}};Gs([No("expressionService")],ip.prototype,"expressionService",2),ip=Gs([Io("stylingService")],ip);var sp=class extends fu{constructor(e){super(e,"ag-toggle-button")}setValue(e,t){return super.setValue(e,t),this.addOrRemoveCssClass("ag-selected",this.getValue()),this}},op=class extends mu{constructor(e){super(e,"ag-text-area",null,"textarea")}setValue(e,t){const i=super.setValue(e,t);return this.eInput.value=e,i}setCols(e){return this.eInput.cols=e,this}setRows(e){return this.eInput.rows=e,this}},np=class extends Fu{constructor(e){super(e,"ag-date-field","date")}postConstruct(){super.postConstruct(),this.addManagedListener(this.eInput,"wheel",this.onWheel.bind(this));const e=Jr();this.addManagedListener(this.eInput,"mousedown",(()=>{this.isDisabled()||e||this.eInput.focus()})),this.eInput.step="any"}onWheel(e){this.gos.getActiveDomElement()===this.eInput&&e.preventDefault()}setMin(e){var t;const i=e instanceof Date?null!=(t=Ea(null!=e?e:null,!1))?t:void 0:e;return this.min===i||(this.min=i,ul(this.eInput,"min",i)),this}setMax(e){var t;const i=e instanceof Date?null!=(t=Ea(null!=e?e:null,!1))?t:void 0:e;return this.max===i||(this.max=i,ul(this.eInput,"max",i)),this}setStep(e){return this.step===e||(this.step=e,ul(this.eInput,"step",e)),this}getDate(){var e;if(this.eInput.validity.valid)return null!=(e=Ra(this.getValue()))?e:void 0}setDate(e,t){this.setValue(Ea(null!=e?e:null,!1),t)}},rp=class extends mu{constructor(e){super(e,"ag-range-field","range")}postConstruct(){super.postConstruct();const{min:e,max:t,step:i}=this.config;null!=e&&this.setMinValue(e),null!=t&&this.setMaxValue(t),this.setStep(i||1)}addInputListeners(){this.addManagedListener(this.eInput,"input",(e=>{const t=e.target.value;this.setValue(t)}))}setMinValue(e){return this.min=e,this.eInput.setAttribute("min",e.toString()),this}setMaxValue(e){return this.max=e,this.eInput.setAttribute("max",e.toString()),this}setStep(e){return this.eInput.setAttribute("step",e.toString()),this}setValue(e,t){null!=this.min&&(e=Math.max(parseFloat(e),this.min).toString()),null!=this.max&&(e=Math.min(parseFloat(e),this.max).toString());const i=super.setValue(e,t);return this.eInput.value=e,i}},ap=class extends Yl{constructor(e,t){super('<div class="ag-rich-select-row" role="presentation"></div>'),this.params=e,this.wrapperEl=t}postConstruct(){this.addManagedListener(this.getGui(),"click",this.onClick.bind(this))}setState(e){let t="";this.params.valueFormatter&&(t=this.params.valueFormatter(e)),this.populateWithRenderer(e,t)||this.populateWithoutRenderer(e,t),this.value=e}highlightString(e){const{parsedValue:t}=this;if(this.params.cellRenderer||!Bs(t))return;let i=Bs(e);if(i){const s=null==t?void 0:t.toLocaleLowerCase().indexOf(e.toLocaleLowerCase());if(s>=0){const i=s+e.length,o=zn(t.slice(0,s),!0),n=zn(t.slice(s,i),!0),r=zn(t.slice(i));this.renderValueWithoutRenderer(`${o}<span class="ag-rich-select-row-text-highlight">${n}</span>${r}`)}else i=!1}i||this.renderValueWithoutRenderer(t)}updateHighlighted(e){var t;const i=this.getGui(),s=`ag-rich-select-row-${this.getCompId()}`;null==(t=i.parentElement)||t.setAttribute("id",s),e&&(Tr(this.getParentComponent().getAriaElement(),s),this.wrapperEl.setAttribute("data-active-option",s)),Vr(i.parentElement,e),this.addOrRemoveCssClass("ag-rich-select-row-selected",e)}populateWithoutRenderer(e,t){const i=this.gos.getDocument(),s=this.getGui(),o=i.createElement("span");o.style.overflow="hidden",o.style.textOverflow="ellipsis";const n=zn(Bs(t)?t:e,!0);this.parsedValue=Bs(n)?n:null,s.appendChild(o),this.renderValueWithoutRenderer(n),this.setTooltip({newTooltipText:this.parsedValue,shouldDisplayTooltip:()=>o.scrollWidth>o.clientWidth})}renderValueWithoutRenderer(e){const t=this.getGui().querySelector("span");t&&(t.innerHTML=Bs(e)?e:"&nbsp;")}populateWithRenderer(e,t){let i,s;return this.params.cellRenderer&&(s=this.userComponentFactory.getCellRendererDetails(this.params,{value:e,valueFormatted:t,setTooltip:(e,t)=>{this.setTooltip({newTooltipText:e,shouldDisplayTooltip:t})}})),s&&(i=s.newAgStackInstance()),i&&dl(i,this.getGui()),!!i&&(i.then((e=>{this.addDestroyFunc((()=>{this.getContext().destroyBean(e)}))})),!0)}onClick(){const e=this.getParentComponent(),t={type:In.EVENT_FIELD_PICKER_VALUE_SELECTED,fromEnterKey:!1,value:this.value};null==e||e.dispatchEvent(t)}};Gs([No("userComponentFactory")],ap.prototype,"userComponentFactory",2),Gs([Lo],ap.prototype,"postConstruct",1);var lp=class e extends Hc{constructor(t){super(e.getTemplate((null==t?void 0:t.cssIdentifier)||"default")),this.renderedRows=new Map,this.rowHeight=20,this.pageSize=-1,this.isScrolling=!1,this.isHeightFromTheme=!0;const{cssIdentifier:i="default",ariaRole:s="listbox",listName:o}=t||{};this.cssIdentifier=i,this.ariaRole=s,this.listName=o}postConstruct(){this.addScrollListener(),this.rowHeight=this.getItemHeight(),this.addResizeObserver(),this.initialiseTabGuard({onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e),focusInnerElement:e=>this.focusInnerElement(e),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)}),this.setAriaProperties(),this.addManagedListener(this.eventService,In.EVENT_GRID_STYLES_CHANGED,this.onGridStylesChanged.bind(this))}onGridStylesChanged(){this.rowHeight=this.getItemHeight(),this.refresh()}setAriaProperties(){const e=this.localeService.getLocaleTextFunc()("ariaDefaultListName",this.listName||"List"),t=this.eContainer;cr(t,this.ariaRole),Cr(t,e)}addResizeObserver(){const e=this.resizeObserverService.observeResize(this.getGui(),(()=>this.animationFrameService.requestAnimationFrame((()=>this.drawVirtualRows()))));this.addDestroyFunc(e)}focusInnerElement(e){this.focusRow(e?this.model.getRowCount()-1:0)}onFocusIn(e){const t=e.target;t.classList.contains("ag-virtual-list-item")&&(this.lastFocusedRowIndex=mr(t)-1)}onFocusOut(e){this.getFocusableElement().contains(e.relatedTarget)||(this.lastFocusedRowIndex=null)}handleKeyDown(e){switch(e.key){case El.UP:case El.DOWN:this.navigate(e.key===El.UP)&&e.preventDefault();break;case El.PAGE_HOME:case El.PAGE_END:case El.PAGE_UP:case El.PAGE_DOWN:null!==this.navigateToPage(e.key)&&e.preventDefault()}}onTabKeyDown(e){this.navigate(e.shiftKey)?e.preventDefault():(wn(e),this.forceFocusOutOfContainer(e.shiftKey))}navigate(e){if(null==this.lastFocusedRowIndex)return!1;const t=this.lastFocusedRowIndex+(e?-1:1);return!(t<0||t>=this.model.getRowCount()||(this.focusRow(t),0))}navigateToPage(e,t="focused"){let i=!1;"focused"===t&&(t=this.getLastFocusedRow(),i=!0);const s=this.model.getRowCount()-1;let o=-1;return e===El.PAGE_HOME?o=0:e===El.PAGE_END?o=s:e===El.PAGE_DOWN?o=Math.min(t+this.pageSize,s):e===El.PAGE_UP&&(o=Math.max(t-this.pageSize,0)),-1===o?null:(i?this.focusRow(o):this.ensureIndexVisible(o),o)}getLastFocusedRow(){return this.lastFocusedRowIndex}focusRow(e){this.isScrolling||(this.isScrolling=!0,this.ensureIndexVisible(e),this.animationFrameService.requestAnimationFrame((()=>{if(this.isScrolling=!1,!this.isAlive())return;const t=this.renderedRows.get(e);t&&t.eDiv.focus()})))}getComponentAt(e){const t=this.renderedRows.get(e);return t&&t.rowComponent}forEachRenderedRow(e){this.renderedRows.forEach(((t,i)=>e(t.rowComponent,i)))}static getTemplate(e){return`<div class="ag-virtual-list-viewport ag-${e}-virtual-list-viewport" role="presentation">\n <div class="ag-virtual-list-container ag-${e}-virtual-list-container" ref="eContainer"></div>\n </div>`}getItemHeight(){return this.isHeightFromTheme?this.environment.getListItemHeight():this.rowHeight}ensureIndexVisible(e,t=!0){const i=this.model.getRowCount();if("number"!=typeof e||e<0||e>=i)return console.warn("AG Grid: invalid row index for ensureIndexVisible: "+e),!1;const s=e*this.rowHeight,o=s+this.rowHeight,n=this.getGui(),r=n.scrollTop,a=n.offsetHeight,l=r+a,u=t?0:this.rowHeight,h=l<o-u;if(r>s+u)return n.scrollTop=s,!0;if(h){const e=o-a;return n.scrollTop=e,!0}return!1}setComponentCreator(e){this.componentCreator=e}setComponentUpdater(e){this.componentUpdater=e}getRowHeight(){return this.rowHeight}getScrollTop(){return this.getGui().scrollTop}setRowHeight(e){this.isHeightFromTheme=!1,this.rowHeight=e,this.refresh()}refresh(e){if(null==this.model||!this.isAlive())return;const t=this.model.getRowCount();this.eContainer.style.height=t*this.rowHeight+"px",bo((()=>this.eContainer.clientHeight>=t*this.rowHeight),(()=>{this.isAlive()&&(this.canSoftRefresh(e)?this.drawVirtualRows(!0):(this.clearVirtualRows(),this.drawVirtualRows()))}))}canSoftRefresh(e){return!!(e&&this.renderedRows.size&&"function"==typeof this.model.areRowsEqual&&this.componentUpdater)}clearVirtualRows(){this.renderedRows.forEach(((e,t)=>this.removeRow(t)))}drawVirtualRows(e){if(!this.isAlive()||!this.model)return;const t=this.getGui(),i=t.scrollTop,s=i+t.offsetHeight,o=Math.floor(i/this.rowHeight),n=Math.floor(s/this.rowHeight);this.pageSize=Math.floor((s-i)/this.rowHeight),this.ensureRowsRendered(o,n,e)}ensureRowsRendered(e,t,i){this.renderedRows.forEach(((i,s)=>{(s<e||s>t)&&s!==this.lastFocusedRowIndex&&this.removeRow(s)})),i&&this.refreshRows();for(let i=e;i<=t;i++)this.renderedRows.has(i)||i<this.model.getRowCount()&&this.insertRow(i)}insertRow(e){const t=this.model.getRow(e),i=document.createElement("div");i.classList.add("ag-virtual-list-item",`ag-${this.cssIdentifier}-virtual-list-item`),cr(i,"tree"===this.ariaRole?"treeitem":"option"),Fr(i,this.model.getRowCount()),Mr(i,e+1),i.setAttribute("tabindex","-1"),i.style.height=`${this.rowHeight}px`,i.style.top=this.rowHeight*e+"px";const s=this.componentCreator(t,i);s.addGuiEventListener("focusin",(()=>this.lastFocusedRowIndex=e)),i.appendChild(s.getGui()),this.renderedRows.has(e-1)?this.renderedRows.get(e-1).eDiv.insertAdjacentElement("afterend",i):this.renderedRows.has(e+1)?this.renderedRows.get(e+1).eDiv.insertAdjacentElement("beforebegin",i):this.eContainer.appendChild(i),this.renderedRows.set(e,{rowComponent:s,eDiv:i,value:t})}removeRow(e){const t=this.renderedRows.get(e);this.eContainer.removeChild(t.eDiv),this.destroyBean(t.rowComponent),this.renderedRows.delete(e)}refreshRows(){const e=this.model.getRowCount();this.renderedRows.forEach(((t,i)=>{var s,o;if(i>=e)this.removeRow(i);else{const e=this.model.getRow(i);(null==(o=(s=this.model).areRowsEqual)?void 0:o.call(s,t.value,e))?this.componentUpdater(e,t.rowComponent):this.removeRow(i)}}))}addScrollListener(){this.addGuiEventListener("scroll",(()=>this.drawVirtualRows()),{passive:!0})}setModel(e){this.model=e}getAriaElement(){return this.eContainer}destroy(){this.isAlive()&&(this.clearVirtualRows(),super.destroy())}};Gs([No("resizeObserverService")],lp.prototype,"resizeObserverService",2),Gs([No("animationFrameService")],lp.prototype,"animationFrameService",2),Gs([ql("eContainer")],lp.prototype,"eContainer",2),Gs([Lo],lp.prototype,"postConstruct",1);var up=lp,hp=class extends hu{constructor(e){var t,i;super(_s(Ns({pickerAriaLabelKey:"ariaLabelRichSelectField",pickerAriaLabelValue:"Rich Select Field",pickerType:"ag-list",className:"ag-rich-select",pickerIcon:"smallDown",ariaRole:"combobox",template:null!=(t=null==e?void 0:e.template)?t:'\n <div class="ag-picker-field" role="presentation">\n <div ref="eLabel"></div>\n <div ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-rich-select-value ag-picker-collapsed">\n <div ref="eDisplayField" class="ag-picker-field-display"></div>\n <ag-input-text-field ref="eInput" class="ag-rich-select-field-input"></ag-input-text-field>\n <div ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>\n </div>\n </div>',modalPicker:!1},e),{maxPickerHeight:null!=(i=null==e?void 0:e.maxPickerHeight)?i:"calc(var(--ag-row-height) * 6.5)"})),this.searchString="",this.highlightedItem=-1,this.lastRowHovered=-1,this.searchStringCreator=null;const{cellRowHeight:s,value:o,valueList:n,searchStringCreator:r}=e||{};null!=s&&(this.cellRowHeight=s),void 0!==o&&(this.value=o),null!=n&&(this.values=n),r&&(this.searchStringCreator=r)}postConstruct(){super.postConstruct(),this.createLoadingElement(),this.createListComponent();const{allowTyping:e,placeholder:t}=this.config;e?(this.eInput.setAutoComplete(!1).setInputPlaceholder(t),this.eDisplayField.classList.add("ag-hidden")):this.eInput.setDisplayed(!1),this.eWrapper.tabIndex=this.gos.get("tabIndex");const{searchDebounceDelay:i=300}=this.config;this.clearSearchString=Eo(this.clearSearchString,i),this.renderSelectedValue(),e&&(this.eInput.onValueChange((e=>this.searchTextFromString(e))),this.addManagedListener(this.eWrapper,"focus",this.onWrapperFocus.bind(this))),this.addManagedListener(this.eWrapper,"focusout",this.onWrapperFocusOut.bind(this))}createLoadingElement(){const e=this.gos.getDocument(),t=this.localeService.getLocaleTextFunc(),i=e.createElement("div");i.classList.add("ag-loading-text"),i.innerText=t("loadingOoo","Loading..."),this.eLoading=i}createListComponent(){this.listComponent=this.createBean(new up({cssIdentifier:"rich-select"})),this.listComponent.setComponentCreator(this.createRowComponent.bind(this)),this.listComponent.setComponentUpdater(((e,t)=>{})),this.listComponent.setParentComponent(this),this.addManagedListener(this.listComponent,In.EVENT_FIELD_PICKER_VALUE_SELECTED,(e=>{this.onListValueSelected(e.value,e.fromEnterKey)}));const{cellRowHeight:e}=this;e&&this.listComponent.setRowHeight(e);const t=this.listComponent.getGui(),i=this.listComponent.getAriaElement();this.addManagedListener(t,"mousemove",this.onPickerMouseMove.bind(this)),this.addManagedListener(t,"mousedown",(e=>e.preventDefault())),t.classList.add("ag-rich-select-list");const s=`ag-rich-select-list-${this.listComponent.getCompId()}`;i.setAttribute("id",s),Cr(i,this.localeService.getLocaleTextFunc()(this.config.pickerAriaLabelKey,this.config.pickerAriaLabelValue)),Br(this.eWrapper,i)}renderSelectedValue(){const{value:e,eDisplayField:t,config:i}=this,{allowTyping:s,initialInputValue:o}=this.config,n=this.config.valueFormatter?this.config.valueFormatter(e):e;if(s)return void this.eInput.setValue(null!=o?o:n);let r,a;if(i.cellRenderer&&(r=this.userComponentFactory.getCellRendererDetails(this.config,{value:e,valueFormatted:n})),r&&(a=r.newAgStackInstance()),a)za(t),dl(a,t),a.then((e=>{this.addDestroyFunc((()=>this.getContext().destroyBean(e)))}));else{if(Bs(this.value))t.innerText=n,t.classList.remove("ag-display-as-placeholder");else{const{placeholder:e}=i;Bs(e)?(t.innerHTML=`${zn(e)}`,t.classList.add("ag-display-as-placeholder")):za(t)}this.setTooltip({newTooltipText:null!=n?n:null,shouldDisplayTooltip:()=>this.eDisplayField.scrollWidth>this.eDisplayField.clientWidth})}}getCurrentValueIndex(){const{currentList:e,value:t}=this;if(null==t||!e)return-1;for(let i=0;i<e.length;i++)if(e[i]===t)return i;return-1}highlightFilterMatch(){var e;null==(e=this.listComponent)||e.forEachRenderedRow(((e,t)=>{e.highlightString(this.searchString)}))}highlightSelectedValue(e){var t;null==e&&(e=this.getCurrentValueIndex()),this.highlightedItem=e,null==(t=this.listComponent)||t.forEachRenderedRow(((t,i)=>{const s=-1!==e&&this.highlightedItem===i;t.updateHighlighted(s)}))}setRowHeight(e){e!==this.cellRowHeight&&(this.cellRowHeight=e),this.listComponent&&this.listComponent.setRowHeight(e)}createPickerComponent(){const{values:e}=this;return e&&this.setValueList({valueList:e}),this.listComponent}setSearchStringCreator(e){this.searchStringCreator=e}setValueList(e){const{valueList:t,refresh:i}=e;this.listComponent&&this.currentList!==t&&(this.currentList=t,this.listComponent.setModel({getRowCount:()=>t.length,getRow:e=>t[e],areRowsEqual:(e,t)=>e===t}),i&&(this.values?this.listComponent.refresh(!0):(this.values=t,this.isPickerDisplayed&&this.showCurrentValueInPicker())))}showPicker(){super.showPicker(),this.showCurrentValueInPicker(),this.displayOrHidePicker()}showCurrentValueInPicker(){var e,t;if(!this.listComponent)return;if(!this.currentList)return void(this.isPickerDisplayed&&this.eLoading&&this.listComponent.appendChild(this.eLoading));(null==(e=this.eLoading)?void 0:e.offsetParent)&&(null==(t=this.eLoading.parentElement)||t.removeChild(this.eLoading));const i=this.getCurrentValueIndex();-1!==i?(this.listComponent.refresh(),this.listComponent.ensureIndexVisible(i),this.listComponent.refresh(!0),this.highlightSelectedValue(i)):this.listComponent.refresh()}beforeHidePicker(){this.highlightedItem=-1,super.beforeHidePicker()}onWrapperFocus(){if(!this.eInput)return;const e=this.eInput.getFocusableElement();e.focus(),e.select()}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}buildSearchStringFromKeyboardEvent(e){let{key:t}=e;if(t===El.BACKSPACE)this.searchString=this.searchString.slice(0,-1),t="";else if(!Pl(e))return;e.preventDefault(),this.searchTextFromCharacter(t)}searchTextFromCharacter(e){this.searchString+=e,this.runSearch(),this.clearSearchString()}searchTextFromString(e){null==e&&(e=""),this.searchString=e,this.runSearch()}buildSearchStrings(e){const{valueFormatter:t=e=>e}=this.config;let i;return"number"==typeof e[0]||"string"==typeof e[0]?i=e.map((e=>t(e))):"object"==typeof e[0]&&this.searchStringCreator&&(i=this.searchStringCreator(e)),i}getSuggestionsAndFilteredValues(e,t){let i=[],s=[];if(!e.length)return{suggestions:i,filteredValues:s};const{searchType:o="fuzzy",filterList:n}=this.config;if("fuzzy"===o){const e=gl(this.searchString,t,!0);i=e.values;const o=e.indices;if(n&&o.length)for(let e=0;e<o.length;e++)s.push(this.values[o[e]])}else i=t.filter(((e,t)=>{const i=e.toLocaleLowerCase(),r=this.searchString.toLocaleLowerCase(),a="match"===o?i.startsWith(r):-1!==i.indexOf(r);return n&&a&&s.push(this.values[t]),a}));return{suggestions:i,filteredValues:s}}filterListModel(e){const{filterList:t}=this.config;t&&(this.setValueList({valueList:e,refresh:!0}),this.alignPickerToComponent())}runSearch(){var e,t;const{values:i}=this,s=this.buildSearchStrings(i);if(!s)return void this.highlightSelectedValue(-1);const{suggestions:o,filteredValues:n}=this.getSuggestionsAndFilteredValues(this.searchString,s),{filterList:r,highlightMatch:a,searchType:l="fuzzy"}=this.config,u=n.length,h=!(!r||""===this.searchString);if(this.filterListModel(h?n:i),o.length){const e=h?0:s.indexOf(o[0]);this.selectListItem(e)}else if(this.highlightSelectedValue(-1),!h||u)null==(e=this.listComponent)||e.ensureIndexVisible(0);else if(h){this.getAriaElement().removeAttribute("data-active-option");const e=null==(t=this.listComponent)?void 0:t.getAriaElement();e&&Tr(e,null)}a&&"fuzzy"!==l&&this.highlightFilterMatch(),this.displayOrHidePicker()}displayOrHidePicker(){var e;const t=null==(e=this.listComponent)?void 0:e.getGui(),i=!!this.currentList&&0===this.currentList.length;null==t||t.classList.toggle("ag-hidden",i)}clearSearchString(){this.searchString=""}selectListItem(e,t){!this.isPickerDisplayed||!this.currentList||!this.listComponent||e<0||e>=this.currentList.length||(this.listComponent.ensureIndexVisible(e,!t)&&!t&&this.listComponent.refresh(!0),this.highlightSelectedValue(e))}setValue(e,t,i){const s=this.currentList?this.currentList.indexOf(e):-1;return-1===s?this:(this.value=e,i||this.selectListItem(s),this.renderSelectedValue(),super.setValue(e,t))}createRowComponent(e){const t=new ap(this.config,this.eWrapper);t.setParentComponent(this.listComponent),this.getContext().createBean(t),t.setState(e);const{highlightMatch:i,searchType:s="fuzzy"}=this.config;return i&&"fuzzy"!==s&&t.highlightString(this.searchString),t}getRowForMouseEvent(e){const{listComponent:t}=this;if(!t)return-1;const i=(null==t?void 0:t.getGui()).getBoundingClientRect(),s=t.getScrollTop(),o=e.clientY-i.top+s;return Math.floor(o/t.getRowHeight())}onPickerMouseMove(e){if(!this.listComponent)return;const t=this.getRowForMouseEvent(e);-1!==t&&t!=this.lastRowHovered&&(this.lastRowHovered=t,this.selectListItem(t,!0))}onNavigationKeyDown(e,t){e.preventDefault();const i=t===El.DOWN;if(!this.isPickerDisplayed&&i)return void this.showPicker();const s=this.highlightedItem,o=-1===s?0:s+(i?1:-1);this.selectListItem(o)}onPageNavigation(e){var t;if(!this.isPickerDisplayed)return;const i=null==(t=this.listComponent)?void 0:t.navigateToPage(e,this.highlightedItem);null!=i&&this.animationFrameService.requestAnimationFrame((()=>{if(!this.isAlive())return null;this.highlightSelectedValue(i)}))}onEnterKeyDown(e){this.isPickerDisplayed&&(e.preventDefault(),this.currentList&&this.onListValueSelected(this.currentList[this.highlightedItem],!0))}onTabKeyDown(){this.isPickerDisplayed&&this.currentList&&this.setValue(this.currentList[this.highlightedItem],!1,!0)}onListValueSelected(e,t){this.setValue(e,!1,!0),this.dispatchPickerEvent(e,t),this.hidePicker()}dispatchPickerEvent(e,t){const i={type:In.EVENT_FIELD_PICKER_VALUE_SELECTED,fromEnterKey:t,value:e};this.dispatchEvent(i)}getFocusableElement(){const{allowTyping:e}=this.config;return e?this.eInput.getFocusableElement():super.getFocusableElement()}onKeyDown(e){const t=e.key,{allowTyping:i}=this.config;switch(t){case El.LEFT:case El.RIGHT:i||e.preventDefault();break;case El.PAGE_HOME:case El.PAGE_END:if(i){e.preventDefault();const i=this.eInput.getInputElement(),s=t===El.PAGE_HOME?0:i.value.length;i.setSelectionRange(s,s);break}case El.PAGE_UP:case El.PAGE_DOWN:e.preventDefault(),this.onPageNavigation(t);break;case El.DOWN:case El.UP:this.onNavigationKeyDown(e,t);break;case El.ESCAPE:this.isPickerDisplayed&&(ja(this.listComponent.getGui())&&(e.preventDefault(),wn(e)),this.hidePicker());break;case El.ENTER:this.onEnterKeyDown(e);break;case El.TAB:this.onTabKeyDown();break;default:i||this.buildSearchStringFromKeyboardEvent(e)}}destroy(){this.listComponent&&(this.destroyBean(this.listComponent),this.listComponent=void 0),this.eLoading=void 0,super.destroy()}};Gs([No("userComponentFactory")],hp.prototype,"userComponentFactory",2),Gs([No("animationFrameService")],hp.prototype,"animationFrameService",2),Gs([ql("eInput")],hp.prototype,"eInput",2);var dp=class e extends lu{constructor(t){super(t,e.TEMPLATE),this.labelAlignment="top"}init(){this.eSlider.addCssClass("ag-slider-field");const{minValue:e,maxValue:t,textFieldWidth:i,step:s,value:o,onValueChange:n}=this.config;null!=e&&this.setMinValue(e),null!=t&&this.setMaxValue(t),null!=i&&this.setTextFieldWidth(i),null!=s&&this.setStep(s),null!=o&&this.setValue(o),null!=n&&this.onValueChange(n)}onValueChange(e){const t=In.EVENT_FIELD_VALUE_CHANGED;return this.addManagedListener(this.eText,t,(()=>{const t=parseFloat(this.eText.getValue());this.eSlider.setValue(t.toString(),!0),e(t||0)})),this.addManagedListener(this.eSlider,t,(()=>{const t=this.eSlider.getValue();this.eText.setValue(t,!0),e(parseFloat(t))})),this}setSliderWidth(e){return this.eSlider.setWidth(e),this}setTextFieldWidth(e){return this.eText.setWidth(e),this}setMinValue(e){return this.eSlider.setMinValue(e),this.eText.setMin(e),this}setMaxValue(e){return this.eSlider.setMaxValue(e),this.eText.setMax(e),this}getValue(){return this.eText.getValue()}setValue(e,t){return this.getValue()===e||(this.eText.setValue(e,!0),this.eSlider.setValue(e,!0),t||this.dispatchEvent({type:In.EVENT_FIELD_VALUE_CHANGED})),this}setStep(e){return this.eSlider.setStep(e),this.eText.setStep(e),this}};dp.TEMPLATE='<div class="ag-slider">\n <label ref="eLabel"></label>\n <div class="ag-wrapper ag-slider-wrapper">\n <ag-input-range ref="eSlider"></ag-input-range>\n <ag-input-number-field ref="eText"></ag-input-number-field>\n </div>\n </div>',Gs([ql("eLabel")],dp.prototype,"eLabel",2),Gs([ql("eSlider")],dp.prototype,"eSlider",2),Gs([ql("eText")],dp.prototype,"eText",2),Gs([Lo],dp.prototype,"init",1);var cp=dp,pp=class e extends Yl{constructor(t={}){super(e.getTemplate(t)),this.params=t,this.suppressEnabledCheckbox=!0,this.suppressToggleExpandOnEnableChange=!1;const{enabled:i,items:s,suppressEnabledCheckbox:o,expanded:n,suppressToggleExpandOnEnableChange:r,useToggle:a}=t;this.cssIdentifier=t.cssIdentifier||"default",this.enabled=null==i||i,this.items=s||[],this.useToggle=null!=a&&a,this.alignItems=t.alignItems||"center",this.expanded=null==n||n,null!=o&&(this.suppressEnabledCheckbox=o),null!=r&&(this.suppressToggleExpandOnEnableChange=r)}static getTemplate(e){const t=e.cssIdentifier||"default";return`\n <div class="ag-group ag-${t}-group" role="presentation">\n <div ref="eToolbar" class="ag-group-toolbar ag-${t}-group-toolbar">\n <ag-checkbox ref="cbGroupEnabled"></ag-checkbox>\n </div>\n <div ref="eContainer" class="ag-group-container ag-group-container-${e.direction||"vertical"} ag-${t}-group-container"></div>\n </div>\n `}postConstruct(){if(this.setupTitleBar(),this.items.length){const e=this.items;this.items=[],this.addItems(e)}const e=this.localeService.getLocaleTextFunc();this.cbGroupEnabled.setLabel(e("enabled","Enabled")),this.enabled&&this.setEnabled(this.enabled,void 0,!0),this.setAlignItems(this.alignItems);const{onEnableChange:t,suppressOpenCloseIcons:i}=this.params;this.hideEnabledCheckbox(this.suppressEnabledCheckbox),this.hideOpenCloseIcons(null!=i&&i),this.refreshChildDisplay(),La(this.eContainer,this.expanded),this.cbGroupEnabled.onValueChange((e=>{this.setEnabled(e,!0,this.suppressToggleExpandOnEnableChange),this.dispatchEnableChangeEvent(e)})),null!=t&&this.onEnableChange(t)}refreshChildDisplay(){var e;La(this.eToolbar,this.expanded&&!this.suppressEnabledCheckbox),null==(e=this.eTitleBar)||e.refreshOnExpand(this.expanded)}isExpanded(){return this.expanded}setAlignItems(e){this.alignItems!==e&&this.removeCssClass(`ag-group-item-alignment-${this.alignItems}`),this.alignItems=e;const t=`ag-group-item-alignment-${this.alignItems}`;return this.addCssClass(t),this}toggleGroupExpand(t){var i;let s=!1;if((null==(i=this.eTitleBar)?void 0:i.isSuppressCollapse())&&!this.useToggle)t=!0,s=!0;else if(t=null!=t?t:!this.expanded,this.expanded===t)return this;return this.expanded=t,this.refreshChildDisplay(),La(this.eContainer,t),s||this.dispatchEvent({type:t?e.EVENT_EXPANDED:e.EVENT_COLLAPSED}),this}addItems(e){e.forEach((e=>this.addItem(e)))}prependItem(e){this.insertItem(e,!0)}addItem(e){this.insertItem(e,!1)}insertItem(e,t){const i=this.eContainer,s=e instanceof Yl?e.getGui():e;s.classList.add("ag-group-item",`ag-${this.cssIdentifier}-group-item`),t?(i.insertAdjacentElement("afterbegin",s),this.items.unshift(s)):(i.appendChild(s),this.items.push(s))}hideItem(e,t){La(this.items[t],!e)}getItemIndex(e){const t=e instanceof Yl?e.getGui():e;return this.items.indexOf(t)}setTitle(e){var t;return null==(t=this.eTitleBar)||t.setTitle(e),this}addTitleBarWidget(e){var t;return null==(t=this.eTitleBar)||t.addWidget(e),this}addCssClassToTitleBar(e){var t;null==(t=this.eTitleBar)||t.addCssClass(e)}dispatchEnableChangeEvent(t){const i={type:e.EVENT_ENABLE_CHANGE,enabled:t};this.dispatchEvent(i)}setEnabled(e,t,i){var s;return this.enabled=e,this.refreshDisabledStyles(),i||this.toggleGroupExpand(e),t||(this.cbGroupEnabled.setValue(e),null==(s=this.eToggle)||s.setValue(e)),this}isEnabled(){return this.enabled}onEnableChange(t){return this.addManagedListener(this,e.EVENT_ENABLE_CHANGE,(e=>t(e.enabled))),this}hideEnabledCheckbox(e){return this.suppressEnabledCheckbox=e,this.refreshChildDisplay(),this.refreshDisabledStyles(),this}hideOpenCloseIcons(e){var t;return null==(t=this.eTitleBar)||t.hideOpenCloseIcons(e),this}refreshDisabledStyles(){var e;const t=!this.enabled;this.eContainer.classList.toggle("ag-disabled",t),null==(e=this.eTitleBar)||e.refreshDisabledStyles(this.suppressEnabledCheckbox&&t),this.eContainer.classList.toggle("ag-disabled-group-container",t)}setupTitleBar(){const e=this.useToggle?this.createToggleTitleBar():this.createDefaultTitleBar();this.eToolbar.insertAdjacentElement("beforebegin",e.getGui())}createDefaultTitleBar(){const e=this.createManagedBean(new Cp(this.params));return this.eTitleBar=e,e.refreshOnExpand(this.expanded),this.addManagedListener(e,Cp.EVENT_EXPAND_CHANGED,(e=>this.toggleGroupExpand(e.expanded))),e}createToggleTitleBar(){var e;const t=this.createManagedBean(new sp({value:this.enabled,label:this.params.title,labelAlignment:"left",labelWidth:"flex",onValueChange:e=>{this.setEnabled(e,!0),this.dispatchEnableChangeEvent(e)}}));return t.addCssClass("ag-group-title-bar"),t.addCssClass(`ag-${null!=(e=this.params.cssIdentifier)?e:"default"}-group-title-bar ag-unselectable`),this.eToggle=t,this.toggleGroupExpand(this.enabled),t}};pp.EVENT_EXPANDED="expanded",pp.EVENT_COLLAPSED="collapsed",pp.EVENT_ENABLE_CHANGE="enableChange",Gs([ql("eToolbar")],pp.prototype,"eToolbar",2),Gs([ql("cbGroupEnabled")],pp.prototype,"cbGroupEnabled",2),Gs([ql("eContainer")],pp.prototype,"eContainer",2),Gs([Lo],pp.prototype,"postConstruct",1);var gp=pp,mp="ag-disabled-group-title-bar",fp=class e extends Yl{constructor(t={}){super(e.getTemplate(t)),this.suppressOpenCloseIcons=!1;const{title:i,suppressOpenCloseIcons:s}=t;i&&i.length>0&&(this.title=i),null!=s&&(this.suppressOpenCloseIcons=s)}static getTemplate(e){var t;const i=null!=(t=e.cssIdentifier)?t:"default";return`\n <div class="ag-group-title-bar ag-${i}-group-title-bar ag-unselectable" role="button">\n <span class="ag-group-title-bar-icon ag-${i}-group-title-bar-icon" ref="eGroupOpenedIcon" role="presentation"></span>\n <span class="ag-group-title-bar-icon ag-${i}-group-title-bar-icon" ref="eGroupClosedIcon" role="presentation"></span>\n <span ref="eTitle" class="ag-group-title ag-${i}-group-title"></span>\n </div>\n `}postConstruct(){this.setTitle(this.title),this.hideOpenCloseIcons(this.suppressOpenCloseIcons),this.setupExpandContract()}setupExpandContract(){this.eGroupClosedIcon.appendChild(vl("columnSelectClosed",this.gos,null)),this.eGroupOpenedIcon.appendChild(vl("columnSelectOpen",this.gos,null)),this.addManagedListener(this.getGui(),"click",(()=>this.dispatchExpandChanged())),this.addManagedListener(this.getGui(),"keydown",(e=>{switch(e.key){case El.ENTER:case El.SPACE:e.preventDefault(),this.dispatchExpandChanged();break;case El.RIGHT:case El.LEFT:e.preventDefault(),this.dispatchExpandChanged(e.key===El.RIGHT)}}))}refreshOnExpand(e){this.refreshAriaStatus(e),this.refreshOpenCloseIcons(e)}refreshAriaStatus(e){this.suppressOpenCloseIcons||Ar(this.getGui(),e)}refreshOpenCloseIcons(e){const t=!this.suppressOpenCloseIcons;La(this.eGroupOpenedIcon,t&&e),La(this.eGroupClosedIcon,t&&!e)}isSuppressCollapse(){return this.suppressOpenCloseIcons}dispatchExpandChanged(t){const i={type:e.EVENT_EXPAND_CHANGED,expanded:t};this.dispatchEvent(i)}setTitle(e){const t=this.getGui(),i=!!e&&e.length>0;e=i?e:void 0,this.eTitle.textContent=null!=e?e:"",La(t,i),e!==this.title&&(this.title=e);const s=t.classList.contains(mp);return this.refreshDisabledStyles(s),this}addWidget(e){return this.getGui().appendChild(e),this}hideOpenCloseIcons(e){return this.suppressOpenCloseIcons=e,e&&this.dispatchExpandChanged(!0),this}refreshDisabledStyles(e){const t=this.getGui();e?(t.classList.add(mp),t.removeAttribute("tabindex")):(t.classList.remove(mp),"string"==typeof this.title?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex"))}};fp.EVENT_EXPAND_CHANGED="expandedChanged",Gs([ql("eGroupOpenedIcon")],fp.prototype,"eGroupOpenedIcon",2),Gs([ql("eGroupClosedIcon")],fp.prototype,"eGroupClosedIcon",2),Gs([ql("eTitle")],fp.prototype,"eTitle",2),Gs([Lo],fp.prototype,"postConstruct",1);var Cp=fp,vp=class extends Hc{constructor(e=0,t){super('<div class="ag-menu-list" role="tree"></div>'),this.level=e,this.menuItems=[],this.params=null!=t?t:{column:null,node:null,value:null}}postConstruct(){this.initialiseTabGuard({onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e),onFocusIn:e=>this.handleFocusIn(e),onFocusOut:e=>this.handleFocusOut(e)})}onTabKeyDown(e){const t=this.getParentComponent(),i=t&&t.getGui();i&&i.classList.contains("ag-focus-managed")||e.preventDefault(),e.shiftKey&&this.closeIfIsChild(e)}handleKeyDown(e){switch(e.key){case El.UP:case El.RIGHT:case El.DOWN:case El.LEFT:e.preventDefault(),this.handleNavKey(e.key);break;case El.ESCAPE:this.closeIfIsChild()&&wn(e)}}handleFocusIn(e){var t,i;const s=e.relatedTarget;(this.tabGuardCtrl.isTabGuard(s)||!this.getGui().contains(s)&&!(null==(i=null==(t=this.activeMenuItem)?void 0:t.getSubMenuGui())?void 0:i.contains(s)))&&(this.activeMenuItem?this.activeMenuItem.activate():this.activateFirstItem())}handleFocusOut(e){var t;const i=e.relatedTarget;!this.activeMenuItem||this.getGui().contains(i)||(null==(t=this.activeMenuItem.getSubMenuGui())?void 0:t.contains(i))||this.activeMenuItem.isSubMenuOpening()||this.activeMenuItem.deactivate()}clearActiveItem(){this.activeMenuItem&&(this.activeMenuItem.deactivate(),this.activeMenuItem=null)}addMenuItems(e){null!=e&&Bl.all(e.map((e=>"separator"===e?Bl.resolve({eGui:this.createSeparator()}):"string"==typeof e?(console.warn(`AG Grid: unrecognised menu item ${e}`),Bl.resolve({eGui:null})):this.addItem(e)))).then((e=>{e.forEach((e=>{(null==e?void 0:e.eGui)&&(this.appendChild(e.eGui),e.comp&&this.menuItems.push(e.comp))}))}))}addItem(e){const t=this.createManagedBean(new Ep);return t.init({menuItemDef:e,isAnotherSubMenuOpen:()=>this.menuItems.some((e=>e.isSubMenuOpen())),level:this.level,contextParams:this.params}).then((()=>(t.setParentComponent(this),this.addManagedListener(t,Ep.EVENT_CLOSE_MENU,(e=>{this.dispatchEvent(e)})),this.addManagedListener(t,Ep.EVENT_MENU_ITEM_ACTIVATED,(e=>{this.activeMenuItem&&this.activeMenuItem!==e.menuItem&&this.activeMenuItem.deactivate(),this.activeMenuItem=e.menuItem})),{comp:t,eGui:t.getGui()})))}activateFirstItem(){const e=this.menuItems.filter((e=>!e.isDisabled()))[0];e&&e.activate()}createSeparator(){return Ya('\n <div class="ag-menu-separator" aria-hidden="true">\n <div class="ag-menu-separator-part"></div>\n <div class="ag-menu-separator-part"></div>\n <div class="ag-menu-separator-part"></div>\n <div class="ag-menu-separator-part"></div>\n </div>')}handleNavKey(e){switch(e){case El.UP:case El.DOWN:const t=this.findNextItem(e===El.UP);return void(t&&t!==this.activeMenuItem&&t.activate())}e===(this.gos.get("enableRtl")?El.RIGHT:El.LEFT)?this.closeIfIsChild():this.openChild()}closeIfIsChild(e){const t=this.getParentComponent();return!!(t&&t instanceof Ep)&&(e&&e.preventDefault(),t.closeSubMenu(),t.getGui().focus(),!0)}openChild(){this.activeMenuItem&&this.activeMenuItem.openSubMenu(!0)}findNextItem(e){const t=this.menuItems.filter((e=>!e.isDisabled()));if(!t.length)return;if(!this.activeMenuItem)return e?Jo(t):t[0];let i;e&&t.reverse();let s=!1;for(let e=0;e<t.length;e++){const o=t[e];if(s){i=o;break}o===this.activeMenuItem&&(s=!0)}return s&&!i?t[0]:i||this.activeMenuItem}destroy(){this.clearActiveItem(),super.destroy()}};Gs([No("focusService")],vp.prototype,"focusService",2),Gs([Lo],vp.prototype,"postConstruct",1);var wp=class extends Hc{constructor(e){super(),this.wrappedComponent=e,this.setTemplateFromElement(e.getGui())}postConstruct(){this.initialiseTabGuard({onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)})}handleKeyDown(e){e.key===El.ESCAPE&&this.closePanel()}onTabKeyDown(e){e.defaultPrevented||(this.closePanel(),e.preventDefault())}closePanel(){const e=this.parentComponent;e.closeSubMenu(),setTimeout((()=>e.getGui().focus()),0)}};Gs([Lo],wp.prototype,"postConstruct",1);var yp=class e extends Pn{constructor(){super(...arguments),this.isActive=!1,this.subMenuIsOpen=!1,this.subMenuIsOpening=!1,this.suppressRootStyles=!0,this.suppressAria=!0,this.suppressFocus=!0}init(e){var t,i;const{menuItemDef:s,isAnotherSubMenuOpen:o,level:n,childComponent:r,contextParams:a}=e;return this.params=e.menuItemDef,this.level=n,this.isAnotherSubMenuOpen=o,this.childComponent=r,this.contextParams=a,this.cssClassPrefix=null!=(i=null==(t=this.params.menuItemParams)?void 0:t.cssClassPrefix)?i:"ag-menu-option",this.userComponentFactory.getMenuItemCompDetails(this.params,_s(Ns({},s),{level:n,isAnotherSubMenuOpen:o,openSubMenu:e=>this.openSubMenu(e),closeSubMenu:()=>this.closeSubMenu(),closeMenu:e=>this.closeMenu(e),updateTooltip:(e,t)=>this.refreshTooltip(e,t),onItemActivated:()=>this.onItemActivated()})).newAgStackInstance().then((e=>{var t;this.menuItemComp=e;const i=null==(t=e.configureDefaults)?void 0:t.call(e);i&&this.configureDefaults(!0===i?void 0:i)}))}addListeners(e,t){(null==t?void 0:t.suppressClick)||this.addManagedListener(e,"click",(e=>this.onItemSelected(e))),(null==t?void 0:t.suppressKeyboardSelect)||this.addManagedListener(e,"keydown",(e=>{e.key!==El.ENTER&&e.key!==El.SPACE||(e.preventDefault(),this.onItemSelected(e))})),(null==t?void 0:t.suppressMouseDown)||this.addManagedListener(e,"mousedown",(e=>{e.stopPropagation(),e.preventDefault()})),(null==t?void 0:t.suppressMouseOver)||(this.addManagedListener(e,"mouseenter",(()=>this.onMouseEnter())),this.addManagedListener(e,"mouseleave",(()=>this.onMouseLeave())))}isDisabled(){return!!this.params.disabled}openSubMenu(t=!1){var i,s;if(this.closeSubMenu(),!this.params.subMenu)return;this.subMenuIsOpening=!0;const o=Ya('<div class="ag-menu" role="presentation"></div>');let n;this.eSubMenuGui=o;let r=()=>{this.subMenuIsOpening=!1};if(this.childComponent){const e=this.createBean(new wp(this.childComponent));e.setParentComponent(this);const t=e.getGui(),i="mouseenter",s=()=>this.cancelDeactivate();t.addEventListener(i,s),n=()=>t.removeEventListener(i,s),o.appendChild(t),this.childComponent.afterGuiAttached&&(r=()=>{this.childComponent.afterGuiAttached(),this.subMenuIsOpening=!1})}else if(this.params.subMenu){const i=this.createBean(new vp(this.level+1,this.contextParams));i.setParentComponent(this),i.addMenuItems(this.params.subMenu),o.appendChild(i.getGui()),this.addManagedListener(i,e.EVENT_CLOSE_MENU,(e=>this.dispatchEvent(e))),i.addGuiEventListener("mouseenter",(()=>this.cancelDeactivate())),n=()=>this.destroyBean(i),t&&(r=()=>{i.activateFirstItem(),this.subMenuIsOpening=!1})}const a=this.popupService.positionPopupForMenu.bind(this.popupService,{eventSource:this.eGui,ePopup:o}),l=this.localeService.getLocaleTextFunc(),u=this.popupService.addPopup({modal:!0,eChild:o,positionCallback:a,anchorToElement:this.eGui,ariaLabel:l("ariaLabelSubMenu","SubMenu"),afterGuiAttached:r});this.subMenuIsOpen=!0,this.setAriaExpanded(!0),this.hideSubMenu=()=>{var e,t;u&&u.hideFunc(),this.subMenuIsOpen=!1,this.setAriaExpanded(!1),n(),null==(t=(e=this.menuItemComp).setExpanded)||t.call(e,!1),this.eSubMenuGui=void 0},null==(s=(i=this.menuItemComp).setExpanded)||s.call(i,!0)}setAriaExpanded(e){this.suppressAria||Ar(this.eGui,e)}closeSubMenu(){this.hideSubMenu&&(this.hideSubMenu(),this.hideSubMenu=null,this.setAriaExpanded(!1))}isSubMenuOpen(){return this.subMenuIsOpen}isSubMenuOpening(){return this.subMenuIsOpening}activate(e){var t,i;this.cancelActivate(),this.params.disabled||(this.isActive=!0,this.suppressRootStyles||this.eGui.classList.add(`${this.cssClassPrefix}-active`),null==(i=(t=this.menuItemComp).setActive)||i.call(t,!0),this.suppressFocus||this.eGui.focus({preventScroll:!0}),e&&this.params.subMenu&&window.setTimeout((()=>{this.isAlive()&&this.isActive&&this.openSubMenu()}),300),this.onItemActivated())}deactivate(){var e,t;this.cancelDeactivate(),this.suppressRootStyles||this.eGui.classList.remove(`${this.cssClassPrefix}-active`),null==(t=(e=this.menuItemComp).setActive)||t.call(e,!1),this.isActive=!1,this.subMenuIsOpen&&this.hideSubMenu()}getGui(){return this.menuItemComp.getGui()}getParentComponent(){return this.parentComponent}setParentComponent(e){this.parentComponent=e}getSubMenuGui(){return this.eSubMenuGui}onItemSelected(e){var t,i;null==(i=(t=this.menuItemComp).select)||i.call(t),this.params.action?this.getFrameworkOverrides().wrapOutgoing((()=>this.params.action(this.gos.addGridCommonParams(Ns({},this.contextParams))))):this.openSubMenu(e&&"keydown"===e.type),this.params.subMenu&&!this.params.action||this.params.suppressCloseOnSelect||this.closeMenu(e)}closeMenu(t){const i={type:e.EVENT_CLOSE_MENU};t&&(t instanceof MouseEvent?i.mouseEvent=t:i.keyboardEvent=t),this.dispatchEvent(i)}onItemActivated(){const t={type:e.EVENT_MENU_ITEM_ACTIVATED,menuItem:this};this.dispatchEvent(t)}cancelActivate(){this.activateTimeoutId&&(window.clearTimeout(this.activateTimeoutId),this.activateTimeoutId=0)}cancelDeactivate(){this.deactivateTimeoutId&&(window.clearTimeout(this.deactivateTimeoutId),this.deactivateTimeoutId=0)}onMouseEnter(){this.cancelDeactivate(),this.isAnotherSubMenuOpen()?this.activateTimeoutId=window.setTimeout((()=>this.activate(!0)),e.ACTIVATION_DELAY):this.activate(!0)}onMouseLeave(){this.cancelActivate(),this.isSubMenuOpen()?this.deactivateTimeoutId=window.setTimeout((()=>this.deactivate()),e.ACTIVATION_DELAY):this.deactivate()}configureDefaults(e){var t,i,s;if(!this.menuItemComp)return void setTimeout((()=>this.configureDefaults(e)));let o=this.menuItemComp.getGui();const n=null==(i=(t=this.menuItemComp).getRootElement)?void 0:i.call(t);n&&((null==e?void 0:e.suppressRootStyles)||o.classList.add("ag-menu-option-custom"),o=n),this.eGui=o,this.suppressRootStyles=!!(null==e?void 0:e.suppressRootStyles),this.suppressRootStyles||(o.classList.add(this.cssClassPrefix),null==(s=this.params.cssClasses)||s.forEach((e=>o.classList.add(e))),this.params.disabled&&o.classList.add(`${this.cssClassPrefix}-disabled`)),(null==e?void 0:e.suppressTooltip)||this.refreshTooltip(this.params.tooltip),this.suppressAria=!!(null==e?void 0:e.suppressAria),this.suppressAria||(cr(o,"treeitem"),br(o,this.level+1),this.params.disabled&&Rr(o,!0)),(null==e?void 0:e.suppressTabIndex)||o.setAttribute("tabindex","-1"),this.params.disabled||this.addListeners(o,e),this.suppressFocus=!!(null==e?void 0:e.suppressFocus)}refreshTooltip(e,t){this.tooltip=e,this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),e&&this.menuItemComp&&(this.tooltipFeature=this.createBean(new $l({getGui:()=>this.getGui(),getTooltipValue:()=>this.tooltip,getLocation:()=>"menu",shouldDisplayTooltip:t})))}destroy(){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),super.destroy()}};yp.EVENT_CLOSE_MENU="closeMenu",yp.EVENT_MENU_ITEM_ACTIVATED="menuItemActivated",yp.ACTIVATION_DELAY=80,Gs([No("popupService")],yp.prototype,"popupService",2),Gs([No("userComponentFactory")],yp.prototype,"userComponentFactory",2);var Ep=yp,Sp=class e extends Yl{constructor(t){super(e.getTemplate(t)),this.config=t,this.closable=!0}static getTemplate(e){const t=e.cssIdentifier||"default";return`<div class="ag-panel ag-${t}-panel" tabindex="-1">\n <div ref="eTitleBar" class="ag-panel-title-bar ag-${t}-panel-title-bar ag-unselectable">\n <span ref="eTitle" class="ag-panel-title-bar-title ag-${t}-panel-title-bar-title"></span>\n <div ref="eTitleBarButtons" class="ag-panel-title-bar-buttons ag-${t}-panel-title-bar-buttons"></div>\n </div>\n <div ref="eContentWrapper" class="ag-panel-content-wrapper ag-${t}-panel-content-wrapper"></div>\n </div>`}postConstruct(){const{component:e,closable:t,hideTitleBar:i,title:s,minWidth:o=250,width:n,minHeight:r=250,height:a,centered:l,popup:u,x:h,y:d}=this.config;this.positionableFeature=new nu(this.getGui(),{minWidth:o,width:n,minHeight:r,height:a,centered:l,x:h,y:d,popup:u,calculateTopBuffer:()=>this.positionableFeature.getHeight()-this.getBodyHeight()}),this.createManagedBean(this.positionableFeature);const c=this.getGui();e&&this.setBodyComponent(e),i?La(this.eTitleBar,!1):(s&&this.setTitle(s),this.setClosable(null!=t?t:this.closable)),this.addManagedListener(this.eTitleBar,"mousedown",(e=>{if(c.contains(e.relatedTarget)||c.contains(this.gos.getActiveDomElement())||this.eTitleBarButtons.contains(e.target))return void e.preventDefault();const t=this.eContentWrapper.querySelector("button, [href], input, select, textarea, [tabindex]");t&&t.focus()})),u&&this.positionableFeature.isPositioned()||(this.renderComponent&&this.renderComponent(),this.positionableFeature.initialisePosition(),this.eContentWrapper.style.height="0")}renderComponent(){const e=this.getGui();e.focus(),this.close=()=>{e.parentElement.removeChild(e),this.destroy()}}getHeight(){return this.positionableFeature.getHeight()}setHeight(e){this.positionableFeature.setHeight(e)}getWidth(){return this.positionableFeature.getWidth()}setWidth(e){this.positionableFeature.setWidth(e)}setClosable(t){if(t!==this.closable&&(this.closable=t),t){const t=this.closeButtonComp=new Yl(e.CLOSE_BTN_TEMPLATE);this.getContext().createBean(t);const i=t.getGui(),s=wl("close",this.gos);s.classList.add("ag-panel-title-bar-button-icon"),i.appendChild(s),this.addTitleBarButton(t),t.addManagedListener(i,"click",this.onBtClose.bind(this))}else if(this.closeButtonComp){const e=this.closeButtonComp.getGui();e.parentElement.removeChild(e),this.closeButtonComp=this.destroyBean(this.closeButtonComp)}}setBodyComponent(e){e.setParentComponent(this),this.eContentWrapper.appendChild(e.getGui())}addTitleBarButton(e,t){const i=this.eTitleBarButtons,s=i.children,o=s.length;null==t&&(t=o),t=Math.max(0,Math.min(t,o)),e.addCssClass("ag-panel-title-bar-button");const n=e.getGui();0===t?i.insertAdjacentElement("afterbegin",n):t===o?i.insertAdjacentElement("beforeend",n):s[t-1].insertAdjacentElement("afterend",n),e.setParentComponent(this)}getBodyHeight(){return Oa(this.eContentWrapper)}getBodyWidth(){return Ga(this.eContentWrapper)}setTitle(e){this.eTitle.innerText=e}onBtClose(){this.close()}destroy(){this.closeButtonComp&&(this.closeButtonComp=this.destroyBean(this.closeButtonComp));const e=this.getGui();e&&ja(e)&&this.close(),super.destroy()}};Sp.CLOSE_BTN_TEMPLATE='<div class="ag-button"></div>',Gs([ql("eContentWrapper")],Sp.prototype,"eContentWrapper",2),Gs([ql("eTitleBar")],Sp.prototype,"eTitleBar",2),Gs([ql("eTitleBarButtons")],Sp.prototype,"eTitleBarButtons",2),Gs([ql("eTitle")],Sp.prototype,"eTitle",2),Gs([Lo],Sp.prototype,"postConstruct",1);var bp=Sp;Gs([No("popupService")],class extends bp{constructor(e){super(_s(Ns({},e),{popup:!0})),this.isMaximizable=!1,this.isMaximized=!1,this.maximizeListeners=[],this.resizeListenerDestroy=null,this.lastPosition={x:0,y:0,width:0,height:0}}postConstruct(){const e=this.getGui(),{movable:t,resizable:i,maximizable:s}=this.config;this.addCssClass("ag-dialog"),super.postConstruct(),this.addManagedListener(e,"focusin",(t=>{this.popupService.bringPopupToFront(e)})),t&&this.setMovable(t),s&&this.setMaximizable(s),i&&this.setResizable(i)}renderComponent(){const e=this.getGui(),{alwaysOnTop:t,modal:i,title:s,afterGuiAttached:o}=this.config,n=this.localeService.getLocaleTextFunc(),r=this.popupService.addPopup({modal:i,eChild:e,closeOnEsc:!0,closedCallback:this.onClosed.bind(this),alwaysOnTop:t,ariaLabel:s||n("ariaLabelDialog","Dialog"),afterGuiAttached:o});r&&(this.close=r.hideFunc)}onClosed(e){var t,i;this.destroy(),null==(i=(t=this.config).closedCallback)||i.call(t,e)}toggleMaximize(){const e=this.positionableFeature.getPosition();if(this.isMaximized){const{x:e,y:t,width:i,height:s}=this.lastPosition;this.setWidth(i),this.setHeight(s),this.positionableFeature.offsetElement(e,t)}else this.lastPosition.width=this.getWidth(),this.lastPosition.height=this.getHeight(),this.lastPosition.x=e.x,this.lastPosition.y=e.y,this.positionableFeature.offsetElement(0,0),this.setHeight("100%"),this.setWidth("100%");this.isMaximized=!this.isMaximized,this.refreshMaximizeIcon()}refreshMaximizeIcon(){La(this.maximizeIcon,!this.isMaximized),La(this.minimizeIcon,this.isMaximized)}clearMaximizebleListeners(){this.maximizeListeners.length&&(this.maximizeListeners.forEach((e=>e())),this.maximizeListeners.length=0),this.resizeListenerDestroy&&(this.resizeListenerDestroy(),this.resizeListenerDestroy=null)}destroy(){this.maximizeButtonComp=this.destroyBean(this.maximizeButtonComp),this.clearMaximizebleListeners(),super.destroy()}setResizable(e){this.positionableFeature.setResizable(e)}setMovable(e){this.positionableFeature.setMovable(e,this.eTitleBar)}setMaximizable(e){if(!e)return this.clearMaximizebleListeners(),void(this.maximizeButtonComp&&(this.destroyBean(this.maximizeButtonComp),this.maximizeButtonComp=this.maximizeIcon=this.minimizeIcon=void 0));const t=this.eTitleBar;if(!t||e===this.isMaximizable)return;const i=this.buildMaximizeAndMinimizeElements();this.refreshMaximizeIcon(),i.addManagedListener(i.getGui(),"click",this.toggleMaximize.bind(this)),this.addTitleBarButton(i,0),this.maximizeListeners.push(this.addManagedListener(t,"dblclick",this.toggleMaximize.bind(this))),this.resizeListenerDestroy=this.addManagedListener(this,"resize",(()=>{this.isMaximized=!1,this.refreshMaximizeIcon()}))}buildMaximizeAndMinimizeElements(){const e=this.maximizeButtonComp=this.createBean(new Yl('<div class="ag-dialog-button"></span>')),t=e.getGui();return this.maximizeIcon=wl("maximize",this.gos),t.appendChild(this.maximizeIcon),this.maximizeIcon.classList.add("ag-panel-title-bar-button-icon"),this.minimizeIcon=wl("minimize",this.gos),t.appendChild(this.minimizeIcon),this.minimizeIcon.classList.add("ag-panel-title-bar-button-icon"),e}}.prototype,"popupService",2);var Rp=0,Dp=class extends Pn{constructor(){super(...arguments),this.popupList=[]}postConstruct(){this.ctrlsService.whenReady((e=>{this.gridCtrl=e.gridCtrl})),this.addManagedListener(this.eventService,In.EVENT_GRID_STYLES_CHANGED,this.handleThemeChange.bind(this))}getPopupParent(){return this.gos.get("popupParent")||this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:i}=e,s=this.getPopupIndex(i);-1!==s&&(this.popupList[s].alignedToElement=t);const o=t.getBoundingClientRect(),n=this.getParentRect(),r=this.keepXYWithinBounds(i,o.top-n.top,0),a=i.clientWidth>0?i.clientWidth:200;i.style.minWidth=`${a}px`;const l=n.right-n.left-a;let u;function h(){return o.right-n.left-2}function d(){return o.left-n.left-a}this.gos.get("enableRtl")?(u=d(),u<0&&(u=h(),this.setAlignedStyles(i,"left")),u>l&&(u=0,this.setAlignedStyles(i,"right"))):(u=h(),u>l&&(u=d(),this.setAlignedStyles(i,"right")),u<0&&(u=0,this.setAlignedStyles(i,"left"))),i.style.left=`${u}px`,i.style.top=`${r}px`}positionPopupUnderMouseEvent(e){const{ePopup:t,nudgeX:i,nudgeY:s,skipObserver:o}=e;this.positionPopup({ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:!0,skipObserver:o,updatePosition:()=>this.calculatePointerAlign(e.mouseEvent),postProcessCallback:()=>this.callPostProcessPopup(e.type,e.ePopup,null,e.mouseEvent,e.column,e.rowNode)})}calculatePointerAlign(e){const t=this.getParentRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}positionPopupByComponent(e){const{ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:o,eventSource:n,alignSide:r="left",position:a="over",column:l,rowNode:u,type:h}=e,d=n.getBoundingClientRect(),c=this.getParentRect(),p=this.getPopupIndex(t);-1!==p&&(this.popupList[p].alignedToElement=n),this.positionPopup({ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:o,updatePosition:()=>{let i,o=d.left-c.left;return"right"===r&&(o-=t.offsetWidth-d.width),"over"===a?(i=d.top-c.top,this.setAlignedStyles(t,"over")):(this.setAlignedStyles(t,"under"),i="under"===this.shouldRenderUnderOrAbove(t,d,c,e.nudgeY||0)?d.top-c.top+d.height:d.top-t.offsetHeight-2*(s||0)-c.top),{x:o,y:i}},postProcessCallback:()=>this.callPostProcessPopup(h,t,n,null,l,u)})}shouldRenderUnderOrAbove(e,t,i,s){const o=i.bottom-t.bottom,n=t.top-i.top,r=e.offsetHeight+s;return o>r?"under":n>r||n>o?"above":"under"}setAlignedStyles(e,t){const i=this.getPopupIndex(e);if(-1===i)return;const s=this.popupList[i],{alignedToElement:o}=s;o&&(["right","left","over","above","under"].forEach((t=>{o.classList.remove(`ag-has-popup-positioned-${t}`),e.classList.remove(`ag-popup-positioned-${t}`)})),t&&(o.classList.add(`ag-has-popup-positioned-${t}`),e.classList.add(`ag-popup-positioned-${t}`)))}callPostProcessPopup(e,t,i,s,o,n){const r=this.gos.getCallback("postProcessPopup");r&&r({column:o,rowNode:n,ePopup:t,type:e,eventSource:i,mouseEvent:s})}positionPopup(e){const{ePopup:t,keepWithinBounds:i,nudgeX:s,nudgeY:o,skipObserver:n,updatePosition:r}=e,a={width:0,height:0},l=(n=!1)=>{let{x:l,y:u}=r();n&&t.clientWidth===a.width&&t.clientHeight===a.height||(a.width=t.clientWidth,a.height=t.clientHeight,s&&(l+=s),o&&(u+=o),i&&(l=this.keepXYWithinBounds(t,l,1),u=this.keepXYWithinBounds(t,u,0)),t.style.left=`${l}px`,t.style.top=`${u}px`,e.postProcessCallback&&e.postProcessCallback())};if(l(),!n){const e=this.resizeObserverService.observeResize(t,(()=>l(!0)));setTimeout((()=>e()),Dp.WAIT_FOR_POPUP_CONTENT_RESIZE)}}getActivePopups(){return this.popupList.map((e=>e.element))}getPopupList(){return this.popupList}getParentRect(){const e=this.gos.getDocument();let t=this.getPopupParent();return t===e.body?t=e.documentElement:"static"===getComputedStyle(t).position&&(t=t.offsetParent),Ha(t)}keepXYWithinBounds(e,t,i){const s=0===i,o=s?"clientHeight":"clientWidth",n=s?"top":"left",r=s?"offsetHeight":"offsetWidth",a=s?"scrollTop":"scrollLeft",l=this.gos.getDocument(),u=l.documentElement,h=this.getPopupParent(),d=h.getBoundingClientRect(),c=l.documentElement.getBoundingClientRect(),p=h===l.body,g=e[r];let m=p?(s?ka:Va)(u)+u[a]:h[o];p&&(m-=Math.abs(c[n]-d[n]));const f=m-g;return Math.min(Math.max(t,0),Math.abs(f))}addPopup(e){const t=this.gos.getDocument(),{eChild:i,ariaLabel:s,alwaysOnTop:o,positionCallback:n,anchorToElement:r}=e;if(!t)return console.warn("AG Grid: could not find the document, document is empty"),{hideFunc:()=>{}};const a=this.getPopupIndex(i);if(-1!==a)return{hideFunc:this.popupList[a].hideFunc};this.initialisePopupPosition(i);const l=this.createPopupWrapper(i,s,!!o),u=this.addEventListenersToPopup(_s(Ns({},e),{wrapperEl:l}));return n&&n(),this.addPopupToPopupList(i,l,u,r),{hideFunc:u}}initialisePopupPosition(e){const t=this.getPopupParent().getBoundingClientRect();Bs(e.style.top)||(e.style.top=-1*t.top+"px"),Bs(e.style.left)||(e.style.left=-1*t.left+"px")}createPopupWrapper(e,t,i){const s=this.getPopupParent(),o=document.createElement("div"),{allThemes:n}=this.environment.getTheme();return n.length&&o.classList.add(...n),o.classList.add("ag-popup"),e.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr","ag-popup-child"),e.hasAttribute("role")||cr(e,"dialog"),Cr(e,t),o.appendChild(e),s.appendChild(o),i?this.setAlwaysOnTop(e,!0):this.bringPopupToFront(e),o}handleThemeChange(){const{allThemes:e}=this.environment.getTheme();for(const t of this.popupList){for(const e of Array.from(t.wrapper.classList))e.startsWith("ag-theme-")&&t.wrapper.classList.remove(e);e.length&&t.wrapper.classList.add(...e)}}addEventListenersToPopup(e){const t=this.gos.getDocument(),i=this.getPopupParent(),{wrapperEl:s,eChild:o,closedCallback:n,afterGuiAttached:r,closeOnEsc:a,modal:l}=e;let u=!1;const h=e=>{s.contains(this.gos.getActiveDomElement())&&(e.key!==El.ESCAPE||yn(e)||p({keyboardEvent:e}))},d=e=>p({mouseEvent:e}),c=e=>p({touchEvent:e}),p=(e={})=>{const{mouseEvent:r,touchEvent:a,keyboardEvent:l,forceHide:p}=e;(p||!this.isEventFromCurrentPopup({mouseEvent:r,touchEvent:a},o)&&!u)&&(u=!0,i.removeChild(s),t.removeEventListener("keydown",h),t.removeEventListener("mousedown",d),t.removeEventListener("touchstart",c),t.removeEventListener("contextmenu",d),this.eventService.removeEventListener(In.EVENT_DRAG_STARTED,d),n&&n(r||a||l),this.removePopupFromPopupList(o))};return r&&r({hidePopup:p}),window.setTimeout((()=>{a&&t.addEventListener("keydown",h),l&&(t.addEventListener("mousedown",d),this.eventService.addEventListener(In.EVENT_DRAG_STARTED,d),t.addEventListener("touchstart",c),t.addEventListener("contextmenu",d))}),0),p}addPopupToPopupList(e,t,i,s){this.popupList.push({element:e,wrapper:t,hideFunc:i,instanceId:Rp++,isAnchored:!!s}),s&&this.setPopupPositionRelatedToElement(e,s)}getPopupIndex(e){return this.popupList.findIndex((t=>t.element===e))}setPopupPositionRelatedToElement(e,t){const i=this.getPopupIndex(e);if(-1===i)return;const s=this.popupList[i];if(s.stopAnchoringPromise&&s.stopAnchoringPromise.then((e=>e&&e())),s.stopAnchoringPromise=void 0,s.isAnchored=!1,!t)return;const o=this.keepPopupPositionedRelativeTo({element:t,ePopup:e,hidePopup:s.hideFunc});return s.stopAnchoringPromise=o,s.isAnchored=!0,o}removePopupFromPopupList(e){this.setAlignedStyles(e,null),this.setPopupPositionRelatedToElement(e,null),this.popupList=this.popupList.filter((t=>t.element!==e))}keepPopupPositionedRelativeTo(e){const t=this.getPopupParent(),i=t.getBoundingClientRect(),{element:s,ePopup:o}=e,n=s.getBoundingClientRect(),r=i.top-n.top,a=i.left-n.left;let l=r,u=a;const h=o.style.top,d=parseInt(h.substring(0,h.length-1),10),c=o.style.left,p=parseInt(c.substring(0,c.length-1),10);return new Bl((i=>{this.getFrameworkOverrides().setInterval((()=>{const i=t.getBoundingClientRect(),n=s.getBoundingClientRect();if(0==n.top&&0==n.left&&0==n.height&&0==n.width)return void e.hidePopup();const h=i.top-n.top;if(h!=l){const e=this.keepXYWithinBounds(o,d+r-h,0);o.style.top=`${e}px`}l=h;const c=i.left-n.left;if(c!=u){const e=this.keepXYWithinBounds(o,p+a-c,1);o.style.left=`${e}px`}u=c}),200).then((e=>{i((()=>{null!=e&&window.clearInterval(e)}))}))}))}hasAnchoredPopup(){return this.popupList.some((e=>e.isAnchored))}isEventFromCurrentPopup(e,t){const{mouseEvent:i,touchEvent:s}=e,o=i||s;if(!o)return!1;const n=this.getPopupIndex(t);if(-1===n)return!1;for(let e=n;e<this.popupList.length;e++)if(bn(this.popupList[e].element,o))return!0;return this.isElementWithinCustomPopup(o.target)}isElementWithinCustomPopup(e){const t=this.gos.getDocument();for(;e&&e!==t.body;){if(e.classList.contains("ag-custom-component-popup")||null===e.parentElement)return!0;e=e.parentElement}return!1}getWrapper(e){for(;!e.classList.contains("ag-popup")&&e.parentElement;)e=e.parentElement;return e.classList.contains("ag-popup")?e:null}setAlwaysOnTop(e,t){const i=this.getWrapper(e);i&&(i.classList.toggle("ag-always-on-top",!!t),t&&this.bringPopupToFront(i))}bringPopupToFront(e){const t=this.getPopupParent(),i=Array.prototype.slice.call(t.querySelectorAll(".ag-popup")),s=i.length,o=Array.prototype.slice.call(t.querySelectorAll(".ag-popup.ag-always-on-top")),n=o.length,r=this.getWrapper(e);if(!r||s<=1||!t.contains(e))return;const a=i.indexOf(r),l=r.querySelectorAll("div"),u=[];for(l.forEach((e=>{0!==e.scrollTop&&u.push([e,e.scrollTop])})),n?r.classList.contains("ag-always-on-top")?a!==s-1&&Jo(o).insertAdjacentElement("afterend",r):a!==s-n-1&&o[0].insertAdjacentElement("beforebegin",r):a!==s-1&&Jo(i).insertAdjacentElement("afterend",r);u.length;){const e=u.pop();e[0].scrollTop=e[1]}}};Dp.WAIT_FOR_POPUP_CONTENT_RESIZE=200,Gs([No("focusService")],Dp.prototype,"focusService",2),Gs([No("ctrlsService")],Dp.prototype,"ctrlsService",2),Gs([No("resizeObserverService")],Dp.prototype,"resizeObserverService",2),Gs([Lo],Dp.prototype,"postConstruct",1),Dp=Gs([Io("popupService")],Dp);var Tp=class extends Yl{constructor(){super('\n <div class="ag-autocomplete-row" role="presentation">\n <div class="ag-autocomplete-row-label"></div>\n </div>'),this.hasHighlighting=!1}setState(e,t){this.value=e,this.render(),this.updateSelected(t)}updateSelected(e){this.addOrRemoveCssClass("ag-autocomplete-row-selected",e)}setSearchString(e){var t;let i=!1;if(Bs(e)){const s=null==(t=this.value)?void 0:t.toLocaleLowerCase().indexOf(e.toLocaleLowerCase());if(s>=0){i=!0,this.hasHighlighting=!0;const t=s+e.length,o=zn(this.value.slice(0,s)),n=zn(this.value.slice(s,t)),r=zn(this.value.slice(t));this.getGui().lastElementChild.innerHTML=`${o}<b>${n}</b>${r}`}}!i&&this.hasHighlighting&&(this.hasHighlighting=!1,this.render())}render(){var e;this.getGui().lastElementChild.innerHTML=null!=(e=zn(this.value))?e:"&nbsp;"}},Ap=class e extends Qu{constructor(t){super(e.TEMPLATE),this.params=t,this.searchString=""}destroy(){super.destroy()}init(){this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList=this.createManagedBean(new up({cssIdentifier:"autocomplete"})),this.virtualList.setComponentCreator(this.createRowComponent.bind(this)),this.eList.appendChild(this.virtualList.getGui()),this.virtualList.setModel({getRowCount:()=>this.autocompleteEntries.length,getRow:e=>this.autocompleteEntries[e]});const e=this.virtualList.getGui();this.addManagedListener(e,"click",(()=>this.params.onConfirmed())),this.addManagedListener(e,"mousemove",this.onMouseMove.bind(this)),this.addManagedListener(e,"mousedown",(e=>e.preventDefault())),this.setSelectedValue(0)}onNavigationKeyDown(e,t){e.preventDefault();const i=this.autocompleteEntries.indexOf(this.selectedValue),s=t===El.UP?i-1:i+1;this.checkSetSelectedValue(s)}setSearch(e){this.searchString=e,Bs(e)?this.runSearch():(this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList.refresh(),this.checkSetSelectedValue(0)),this.updateSearchInList()}runContainsSearch(e,t){let i,s=!1;const o=e.toLocaleLowerCase(),n=t.filter((e=>{const t=e.toLocaleLowerCase().indexOf(o),n=0===t,r=t>=0;return r&&(!i||!s&&n||s===n&&e.length<i.length)&&(i=e,s=n),r}));return!i&&n.length&&(i=n[0]),{topMatch:i,allMatches:n}}runSearch(){var e,t;const{autocompleteEntries:i}=this.params,s=i.map((e=>{var t;return null!=(t=e.displayValue)?t:e.key}));let o,n;if(this.params.useFuzzySearch)o=gl(this.searchString,s,!0).values,n=o.length?o[0]:void 0;else{const e=this.runContainsSearch(this.searchString,s);o=e.allMatches,n=e.topMatch}let r=i.filter((({key:e,displayValue:t})=>o.includes(null!=t?t:e)));if(!r.length&&this.selectedValue&&(null==(t=null==(e=this.params)?void 0:e.forceLastSelection)?void 0:t.call(e,this.selectedValue,this.searchString))&&(r=[this.selectedValue]),this.autocompleteEntries=r,this.virtualList.refresh(),!n)return;const a=o.indexOf(n);this.checkSetSelectedValue(a)}updateSearchInList(){this.virtualList.forEachRenderedRow((e=>e.setSearchString(this.searchString)))}checkSetSelectedValue(e){e>=0&&e<this.autocompleteEntries.length&&this.setSelectedValue(e)}setSelectedValue(e){const t=this.autocompleteEntries[e];this.selectedValue!==t&&(this.selectedValue=t,this.virtualList.ensureIndexVisible(e),this.virtualList.forEachRenderedRow(((t,i)=>{t.updateSelected(e===i)})))}createRowComponent(e){var t;const i=new Tp;return this.getContext().createBean(i),i.setState(null!=(t=e.displayValue)?t:e.key,e===this.selectedValue),i}onMouseMove(e){const t=this.virtualList.getGui().getBoundingClientRect(),i=this.virtualList.getScrollTop(),s=e.clientY-t.top+i,o=Math.floor(s/this.virtualList.getRowHeight());this.checkSetSelectedValue(o)}afterGuiAttached(){this.virtualList.refresh()}getSelectedValue(){var e;return this.autocompleteEntries.length&&null!=(e=this.selectedValue)?e:null}};Ap.TEMPLATE='<div class="ag-autocomplete-list-popup">\n <div ref="eList" class="ag-autocomplete-list"></div>\n <div>',Gs([ql("eList")],Ap.prototype,"eList",2),Gs([Lo],Ap.prototype,"init",1);var Pp=Ap,Fp=class e extends Yl{constructor(){super('\n <div class="ag-autocomplete" role="presentation">\n <ag-input-text-field ref="eAutocompleteInput"></ag-input-text-field>\n </div>'),this.isListOpen=!1,this.lastPosition=0,this.valid=!0}postConstruct(){this.eAutocompleteInput.onValueChange((e=>this.onValueChanged(e))),this.eAutocompleteInput.getInputElement().setAttribute("autocomplete","off"),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.addGuiEventListener("click",this.updatePositionAndList.bind(this)),this.addDestroyFunc((()=>{this.destroyBean(this.autocompleteList)})),this.addGuiEventListener("focusout",(()=>this.onFocusOut()))}onValueChanged(e){const t=Hs(e);this.updateValue(t),this.updateAutocompleteList(t)}updateValue(t){this.updateLastPosition(),this.dispatchEvent({type:e.EVENT_VALUE_CHANGED,value:t}),this.validate(t)}updateAutocompleteList(e){var t,i,s,o;const n=null!=(i=null==(t=this.listGenerator)?void 0:t.call(this,e,this.lastPosition))?i:{enabled:!1};if(n.type&&n.type===(null==(s=this.autocompleteListParams)?void 0:s.type)||this.isListOpen&&this.closeList(),this.autocompleteListParams=n,null==(o=this.autocompleteListParams)?void 0:o.enabled){this.isListOpen||this.openList();const{searchString:e}=this.autocompleteListParams;this.autocompleteList.setSearch(null!=e?e:"")}else this.isListOpen&&this.closeList()}onKeyDown(e){const t=e.key;switch(this.updateLastPosition(),t){case El.ENTER:this.onEnterKeyDown(e);break;case El.TAB:this.onTabKeyDown(e);break;case El.DOWN:case El.UP:this.onUpDownKeyDown(e,t);break;case El.LEFT:case El.RIGHT:case El.PAGE_HOME:case El.PAGE_END:setTimeout((()=>{this.updatePositionAndList()}));break;case El.ESCAPE:this.onEscapeKeyDown(e);break;case El.SPACE:e.ctrlKey&&!this.isListOpen&&(e.preventDefault(),this.forceOpenList())}}confirmSelection(){var t;const i=null==(t=this.autocompleteList)?void 0:t.getSelectedValue();i&&(this.closeList(),this.dispatchEvent({type:e.EVENT_OPTION_SELECTED,value:this.getValue(),position:this.lastPosition,updateEntry:i,autocompleteType:this.autocompleteListParams.type}))}onTabKeyDown(e){this.isListOpen&&(e.preventDefault(),e.stopPropagation(),this.confirmSelection())}onEnterKeyDown(e){e.preventDefault(),this.isListOpen?this.confirmSelection():this.onCompleted()}onUpDownKeyDown(e,t){var i;e.preventDefault(),this.isListOpen?null==(i=this.autocompleteList)||i.onNavigationKeyDown(e,t):this.forceOpenList()}onEscapeKeyDown(e){this.isListOpen&&(e.preventDefault(),e.stopPropagation(),this.closeList(),this.setCaret(this.lastPosition,!0))}onFocusOut(){this.isListOpen&&this.closeList()}updatePositionAndList(){var e;this.updateLastPosition(),this.updateAutocompleteList(null!=(e=this.eAutocompleteInput.getValue())?e:null)}setCaret(e,t){const i=this.gos.getDocument(),s=this.gos.getActiveDomElement();!t||s&&s!==i.body||this.eAutocompleteInput.getFocusableElement().focus();const o=this.eAutocompleteInput.getInputElement();o.setSelectionRange(e,e),e===o.value.length&&(o.scrollLeft=o.scrollWidth)}forceOpenList(){this.onValueChanged(this.eAutocompleteInput.getValue())}updateLastPosition(){var e;this.lastPosition=null!=(e=this.eAutocompleteInput.getInputElement().selectionStart)?e:0}validate(t){var i;this.validator&&(this.validationMessage=this.validator(t),this.eAutocompleteInput.getInputElement().setCustomValidity(null!=(i=this.validationMessage)?i:""),this.valid=!this.validationMessage,this.dispatchEvent({type:e.EVENT_VALID_CHANGED,isValid:this.valid,validationMessage:this.validationMessage}))}openList(){this.isListOpen=!0,this.autocompleteList=this.createBean(new Pp({autocompleteEntries:this.autocompleteListParams.entries,onConfirmed:()=>this.confirmSelection(),forceLastSelection:this.forceLastSelection}));const e=this.autocompleteList.getGui(),t={ePopup:e,type:"autocomplete",eventSource:this.getGui(),position:"under",alignSide:this.gos.get("enableRtl")?"right":"left",keepWithinBounds:!0},i=this.popupService.addPopup({eChild:e,anchorToElement:this.getGui(),positionCallback:()=>this.popupService.positionPopupByComponent(t),ariaLabel:this.listAriaLabel});this.hidePopup=i.hideFunc,this.autocompleteList.afterGuiAttached()}closeList(){this.isListOpen=!1,this.hidePopup(),this.destroyBean(this.autocompleteList),this.autocompleteList=null}onCompleted(){this.isListOpen&&this.closeList(),this.dispatchEvent({type:e.EVENT_VALUE_CONFIRMED,value:this.getValue(),isValid:this.isValid()})}getValue(){return Hs(this.eAutocompleteInput.getValue())}setInputPlaceholder(e){return this.eAutocompleteInput.setInputPlaceholder(e),this}setInputAriaLabel(e){return this.eAutocompleteInput.setInputAriaLabel(e),this}setListAriaLabel(e){return this.listAriaLabel=e,this}setListGenerator(e){return this.listGenerator=e,this}setValidator(e){return this.validator=e,this}isValid(){return this.valid}setValue(e){const{value:t,position:i,silent:s,updateListOnlyIfOpen:o,restoreFocus:n}=e;this.eAutocompleteInput.setValue(t,!0),this.setCaret(null!=i?i:this.lastPosition,n),s||this.updateValue(t),o&&!this.isListOpen||this.updateAutocompleteList(t)}setForceLastSelection(e){return this.forceLastSelection=e,this}setInputDisabled(e){return this.eAutocompleteInput.setDisabled(e),this}};Fp.EVENT_VALUE_CHANGED="eventValueChanged",Fp.EVENT_VALUE_CONFIRMED="eventValueConfirmed",Fp.EVENT_OPTION_SELECTED="eventOptionSelected",Fp.EVENT_VALID_CHANGED="eventValidChanged",Gs([No("popupService")],Fp.prototype,"popupService",2),Gs([ql("eAutocompleteInput")],Fp.prototype,"eAutocompleteInput",2),Gs([Lo],Fp.prototype,"postConstruct",1);var Mp=Fp,Lp=class e extends Yl{constructor(e,t,i,s){super(),this.dragSourceDropTarget=e,this.ghost=t,this.horizontal=i,this.template=s}init(){var t;this.setTemplate(null!=(t=this.template)?t:e.TEMPLATE);const i=this.getGui();this.addElementClasses(i),this.addElementClasses(this.eDragHandle,"drag-handle"),this.addElementClasses(this.eText,"text"),this.addElementClasses(this.eButton,"button"),this.eDragHandle.appendChild(wl("columnDrag",this.gos)),this.eButton.appendChild(wl("cancel",this.gos)),this.setupComponents(),!this.ghost&&this.isDraggable()&&this.addDragSource(),this.setupAria(),this.setupTooltip(),this.activateTabIndex(),this.refreshDraggable()}isDraggable(){return!0}refreshDraggable(){this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!this.isDraggable())}setupAria(){const e=this.localeService.getLocaleTextFunc(),t=[this.getAriaDisplayName()];this.addAdditionalAriaInstructions(t,e),Cr(this.getGui(),t.join(". "))}addAdditionalAriaInstructions(e,t){if(this.isRemovable()){const i=t("ariaDropZoneColumnComponentDescription","Press DELETE to remove");e.push(i)}}setupTooltip(){const e=()=>{const e=this.getTooltip();this.setTooltip({newTooltipText:e})};e(),this.addManagedListener(this.eventService,In.EVENT_NEW_COLUMNS_LOADED,e)}getDragSourceId(){}getDefaultIconName(){return hh.ICON_NOT_ALLOWED}addDragSource(){const{dragAndDropService:e,eDragHandle:t}=this,i=this.createGetDragItem(),s=this.getDefaultIconName(),o={type:this.getDragSourceType(),sourceId:this.getDragSourceId(),eElement:t,getDefaultIconName:()=>s,getDragItem:i,dragItemName:this.getDisplayName()};e.addDragSource(o,!0),this.addDestroyFunc((()=>e.removeDragSource(o)))}setupComponents(){this.setTextValue(),this.setupRemove(),this.ghost&&this.addCssClass("ag-column-drop-cell-ghost")}isRemovable(){return!0}refreshRemove(){La(this.eButton,this.isRemovable())}setupRemove(){this.refreshRemove();const t={type:e.EVENT_COLUMN_REMOVE};this.addGuiEventListener("keydown",(e=>this.onKeyDown(e))),this.addManagedListener(this.eButton,"click",(e=>{this.dispatchEvent(t),e.stopPropagation()}));const i=new zu(this.eButton);this.addManagedListener(i,zu.EVENT_TAP,(()=>{this.dispatchEvent(t)})),this.addDestroyFunc(i.destroy.bind(i))}onKeyDown(t){t.key===El.DELETE&&this.isRemovable()&&(t.preventDefault(),this.dispatchEvent({type:e.EVENT_COLUMN_REMOVE}))}getDisplayValue(){return this.getDisplayName()}setTextValue(){const e=zn(this.getDisplayValue());this.eText.innerHTML=e}addElementClasses(e,t){t=t?`-${t}`:"";const i=this.horizontal?"horizontal":"vertical";e.classList.add(`ag-column-drop-cell${t}`,`ag-column-drop-${i}-cell${t}`)}destroy(){super.destroy(),this.dragSourceDropTarget=null}};Lp.EVENT_COLUMN_REMOVE="columnRemove",Lp.TEMPLATE='<span role="option">\n <span ref="eDragHandle" class="ag-drag-handle ag-column-drop-cell-drag-handle" role="presentation"></span>\n <span ref="eText" class="ag-column-drop-cell-text" aria-hidden="true"></span>\n <span ref="eButton" class="ag-column-drop-cell-button" role="presentation"></span>\n </span>',Gs([No("dragAndDropService")],Lp.prototype,"dragAndDropService",2),Gs([ql("eText")],Lp.prototype,"eText",2),Gs([ql("eDragHandle")],Lp.prototype,"eDragHandle",2),Gs([ql("eButton")],Lp.prototype,"eButton",2),Gs([Lo],Lp.prototype,"init",1);var xp=Lp,Ip=class e extends Yl{constructor(t){super('<div class="ag-unselectable" role="presentation"></div>'),this.horizontal=t,this.state=e.STATE_NOT_DRAGGING,this.guiDestroyFunctions=[],this.childPillComponents=[],this.resizeEnabled=!1,this.addElementClasses(this.getGui()),this.ePillDropList=document.createElement("div"),this.addElementClasses(this.ePillDropList,"list"),cr(this.ePillDropList,"listbox")}isHorizontal(){return this.horizontal}toggleResizable(e){this.positionableFeature.setResizable(!!e&&{bottom:!0}),this.resizeEnabled=e}isSourceEventFromTarget(e){const{dropZoneTarget:t,dragSource:i}=e;return t.contains(i.eElement)}destroy(){this.destroyGui(),super.destroy()}destroyGui(){this.guiDestroyFunctions.forEach((e=>e())),this.guiDestroyFunctions.length=0,this.childPillComponents.length=0,za(this.getGui()),za(this.ePillDropList)}init(e){this.params=null!=e?e:{},this.createManagedBean(new iu(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.setupDropTarget(),this.positionableFeature=new nu(this.getGui(),{minHeight:100}),this.createManagedBean(this.positionableFeature),this.refreshGui(),Cr(this.ePillDropList,this.getAriaLabel())}handleKeyDown(e){const t=!this.horizontal;let i=e.key===El.DOWN,s=e.key===El.UP;if(!t){const t=this.gos.get("enableRtl");i=!t&&e.key===El.RIGHT||t&&e.key===El.LEFT,s=!t&&e.key===El.LEFT||t&&e.key===El.RIGHT}if(!i&&!s)return;const o=this.focusService.findNextFocusableElement(this.getFocusableElement(),!1,s);o&&(e.preventDefault(),o.focus())}addElementClasses(e,t){t=t?`-${t}`:"";const i=this.horizontal?"horizontal":"vertical";e.classList.add(`ag-column-drop${t}`,`ag-column-drop-${i}${t}`)}setupDropTarget(){this.dropTarget={getContainer:this.getGui.bind(this),getIconName:this.getIconName.bind(this),onDragging:this.onDragging.bind(this),onDragEnter:this.onDragEnter.bind(this),onDragLeave:this.onDragLeave.bind(this),onDragStop:this.onDragStop.bind(this),isInterestedIn:this.isInterestedIn.bind(this)},this.dragAndDropService.addDropTarget(this.dropTarget)}minimumAllowedNewInsertIndex(){return 0}checkInsertIndex(e){const t=this.getNewInsertIndex(e);if(t<0)return!1;const i=this.minimumAllowedNewInsertIndex(),s=Math.max(i,t),o=s!==this.insertIndex;return o&&(this.insertIndex=s),o}getNewInsertIndex(e){const t=e.event,i=this.horizontal?t.clientX:t.clientY,s=this.childPillComponents.map((e=>e.getGui().getBoundingClientRect())),o=s.findIndex((e=>this.horizontal?e.right>i&&e.left<i:e.top<i&&e.bottom>i));if(-1===o){const e=this.gos.get("enableRtl");return s.every((e=>i>(this.horizontal?e.right:e.bottom)))?e&&this.horizontal?0:this.childPillComponents.length:s.every((e=>i<(this.horizontal?e.left:e.top)))?e&&this.horizontal?this.childPillComponents.length:0:this.insertIndex}return this.insertIndex<=o?o+1:o}checkDragStartedBySelf(t){this.state===e.STATE_NOT_DRAGGING&&(this.state=e.STATE_REARRANGE_ITEMS,this.potentialDndItems=this.getItems(t.dragSource.getDragItem()),this.refreshGui(),this.checkInsertIndex(t),this.refreshGui())}onDragging(e){this.checkDragStartedBySelf(e),this.checkInsertIndex(e)&&this.refreshGui()}handleDragEnterEnd(e){}onDragEnter(t){const i=this.getItems(t.dragSource.getDragItem());this.state=e.STATE_NEW_ITEMS_IN;const s=i.filter((e=>this.isItemDroppable(e,t))),o=s.every((e=>-1!==this.childPillComponents.map((e=>e.getItem())).indexOf(e)));0!==s.length&&(this.potentialDndItems=s,o?this.state=e.STATE_NOT_DRAGGING:(this.handleDragEnterEnd(t),this.checkInsertIndex(t),this.refreshGui()))}isPotentialDndItems(){return Qo(this.potentialDndItems)}handleDragLeaveEnd(e){}onDragLeave(t){if(this.state===e.STATE_REARRANGE_ITEMS){const e=this.getItems(t.dragSource.getDragItem());this.removeItems(e)}this.isPotentialDndItems()&&(this.handleDragLeaveEnd(t),this.potentialDndItems=[],this.refreshGui()),this.state=e.STATE_NOT_DRAGGING}refreshOnDragStop(){return!0}onDragStop(){if(this.isPotentialDndItems()){let t=!1;this.state===e.STATE_NEW_ITEMS_IN?(this.addItems(this.potentialDndItems),t=!0):t=this.rearrangeItems(this.potentialDndItems),this.potentialDndItems=[],!this.refreshOnDragStop()&&t||this.refreshGui()}this.state=e.STATE_NOT_DRAGGING}removeItems(e){const t=this.getExistingItems().filter((t=>!dn(e,t)));this.updateItems(t)}addItems(e){if(!e)return;const t=this.getExistingItems().slice(),i=e.filter((e=>t.indexOf(e)<0));un(t,i,this.insertIndex),this.updateItems(t)}addItem(e){this.insertIndex=this.getExistingItems().length,this.addItems([e]),this.refreshGui()}rearrangeItems(e){const t=this.getNonGhostItems().slice();return un(t,e,this.insertIndex),!Zo(t,this.getExistingItems())&&(this.updateItems(t),!0)}refreshGui(){const e=this.ePillDropList.scrollTop,t=this.resizeEnabled,i=this.getFocusedItem();let s=this.focusService.findNextFocusableElement();s||(s=this.focusService.findNextFocusableElement(void 0,!1,!0)),this.toggleResizable(!1),this.destroyGui(),this.addIconAndTitleToGui(),this.addEmptyMessageToGui(),this.addItemsToGui(),this.isHorizontal()||(this.ePillDropList.scrollTop=e),t&&this.toggleResizable(t),this.focusService.isKeyboardMode()&&this.restoreFocus(i,s)}getFocusedItem(){const e=this.getGui(),t=this.gos.getActiveDomElement();return e.contains(t)?Array.from(e.querySelectorAll(".ag-column-drop-cell")).indexOf(t):-1}restoreFocus(e,t){const i=this.getGui(),s=Array.from(i.querySelectorAll(".ag-column-drop-cell"));if(-1===e)return;0===s.length&&t.focus();const o=s[Math.min(s.length-1,e)];o&&o.focus()}focusList(e){const t=e?this.childPillComponents.length-1:0;this.restoreFocus(t,this.getFocusableElement())}getNonGhostItems(){const e=this.getExistingItems();return this.isPotentialDndItems()?e.filter((e=>!dn(this.potentialDndItems,e))):e}addItemsToGui(){const e=this.getNonGhostItems().map((e=>this.createItemComponent(e,!1)));if(this.isPotentialDndItems()){const t=this.potentialDndItems.map((e=>this.createItemComponent(e,!0)));this.insertIndex>=e.length?e.push(...t):e.splice(this.insertIndex,0,...t)}this.appendChild(this.ePillDropList),e.forEach(((e,t)=>{t>0&&this.addArrow(this.ePillDropList),this.ePillDropList.appendChild(e.getGui())})),this.addAriaLabelsToComponents()}addAriaLabelsToComponents(){this.childPillComponents.forEach(((e,t)=>{const i=e.getGui();Mr(i,t+1),Fr(i,this.childPillComponents.length)}))}createItemComponent(e,t){const i=this.createPillComponent(e,this.dropTarget,t,this.horizontal);return i.addEventListener(xp.EVENT_COLUMN_REMOVE,this.removeItems.bind(this,[e])),this.context.createBean(i),this.guiDestroyFunctions.push((()=>this.destroyBean(i))),t||this.childPillComponents.push(i),i}addIconAndTitleToGui(){const{title:e,icon:t}=this.params;if(!e||!t)return;const i=document.createElement("div");if(Dr(i,!0),this.addElementClasses(i,"title-bar"),this.addElementClasses(t,"icon"),this.addOrRemoveCssClass("ag-column-drop-empty",this.isExistingItemsEmpty()),i.appendChild(t),!this.horizontal){const t=document.createElement("span");this.addElementClasses(t,"title"),t.innerHTML=e,i.appendChild(t)}this.appendChild(i)}isExistingItemsEmpty(){return 0===this.getExistingItems().length}addEmptyMessageToGui(){const{emptyMessage:e}=this.params;if(!e||!this.isExistingItemsEmpty()||this.isPotentialDndItems())return;const t=document.createElement("span");t.innerHTML=e,this.addElementClasses(t,"empty-message"),this.ePillDropList.appendChild(t)}addArrow(e){if(this.horizontal){const t=wl(this.gos.get("enableRtl")?"smallLeft":"smallRight",this.gos);this.addElementClasses(t,"cell-separator"),e.appendChild(t)}}};Ip.STATE_NOT_DRAGGING="notDragging",Ip.STATE_NEW_ITEMS_IN="newItemsIn",Ip.STATE_REARRANGE_ITEMS="rearrangeItems",Gs([No("focusService")],Ip.prototype,"focusService",2),Gs([No("dragAndDropService")],Ip.prototype,"dragAndDropService",2);var Np=["touchstart","touchend","touchmove","touchcancel"],_p=class{constructor(e="javascript"){this.frameworkName=e,this.renderingEngine="vanilla",this.wrapIncoming=e=>e(),this.wrapOutgoing=e=>e()}setInterval(e,t){return new Bl((i=>{i(window.setInterval(e,t))}))}addEventListener(e,t,i,s){const o=dn(Np,t);e.addEventListener(t,i,{capture:!!s,passive:o})}get shouldWrapOutgoing(){return!1}frameworkComponent(e){return null}isFrameworkComponent(e){return!1}getDocLink(e){return`https://www.ag-grid.com/${"solid"===this.frameworkName?"react":this.frameworkName}-data-grid${e?`/${e}`:""}`}},Op=class extends Pn{getNextCellToFocus(e,t,i=!1){return i?this.getNextCellToFocusWithCtrlPressed(e,t):this.getNextCellToFocusWithoutCtrlPressed(e,t)}getNextCellToFocusWithCtrlPressed(e,t){const i=e===El.UP,s=e===El.DOWN,o=e===El.LEFT;let n,r;if(i||s)r=i?this.paginationProxy.getPageFirstRow():this.paginationProxy.getPageLastRow(),n=t.column;else{const e=this.columnModel.getAllDisplayedColumns(),i=this.gos.get("enableRtl");r=t.rowIndex,n=o!==i?e[0]:Jo(e)}return{rowIndex:r,rowPinned:null,column:n}}getNextCellToFocusWithoutCtrlPressed(e,t){let i=t,s=!1;for(;!s;){switch(e){case El.UP:i=this.getCellAbove(i);break;case El.DOWN:i=this.getCellBelow(i);break;case El.RIGHT:i=this.gos.get("enableRtl")?this.getCellToLeft(i):this.getCellToRight(i);break;case El.LEFT:i=this.gos.get("enableRtl")?this.getCellToRight(i):this.getCellToLeft(i);break;default:i=null,console.warn("AG Grid: unknown key for navigation "+e)}s=!i||this.isCellGoodToFocusOn(i)}return i}isCellGoodToFocusOn(e){const t=e.column;let i;switch(e.rowPinned){case"top":i=this.pinnedRowModel.getPinnedTopRow(e.rowIndex);break;case"bottom":i=this.pinnedRowModel.getPinnedBottomRow(e.rowIndex);break;default:i=this.rowModel.getRow(e.rowIndex)}return!!i&&!t.isSuppressNavigable(i)}getCellToLeft(e){if(!e)return null;const t=this.columnModel.getDisplayedColBefore(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getCellToRight(e){if(!e)return null;const t=this.columnModel.getDisplayedColAfter(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getRowBelow(e){const t=e.rowIndex,i=e.rowPinned;if(this.isLastRowInContainer(e))switch(i){case"bottom":return null;case"top":return this.rowModel.isRowsToRender()?{rowIndex:this.paginationProxy.getPageFirstRow(),rowPinned:null}:this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null;default:return this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null}const s=this.rowModel.getRow(e.rowIndex);return this.getNextStickyPosition(s)||{rowIndex:t+1,rowPinned:i}}getNextStickyPosition(e,t){if(!this.gos.isGroupRowsSticky()||!e||!e.sticky)return;let i=[];i=this.rowRenderer.getStickyTopRowCtrls().some((t=>t.getRowNode().rowIndex===e.rowIndex))?[...this.rowRenderer.getStickyTopRowCtrls()].sort(((e,t)=>e.getRowNode().rowIndex-t.getRowNode().rowIndex)):[...this.rowRenderer.getStickyBottomRowCtrls()].sort(((e,t)=>t.getRowNode().rowIndex-e.getRowNode().rowIndex));const s=t?-1:1,o=i.findIndex((t=>t.getRowNode().rowIndex===e.rowIndex)),n=i[o+s];return n?{rowIndex:n.getRowNode().rowIndex,rowPinned:null}:void 0}getCellBelow(e){if(!e)return null;const t=this.getRowBelow(e);return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}isLastRowInContainer(e){const t=e.rowPinned,i=e.rowIndex;return"top"===t?this.pinnedRowModel.getPinnedTopRowData().length-1<=i:"bottom"===t?this.pinnedRowModel.getPinnedBottomRowData().length-1<=i:this.paginationProxy.getPageLastRow()<=i}getRowAbove(e){const t=e.rowIndex,i=e.rowPinned;if(i?0===t:t===this.paginationProxy.getPageFirstRow())return"top"===i?null:i&&this.rowModel.isRowsToRender()?this.getLastBodyCell():this.pinnedRowModel.isRowsToRender("top")?this.getLastFloatingTopRow():null;const s=this.rowModel.getRow(e.rowIndex);return this.getNextStickyPosition(s,!0)||{rowIndex:t-1,rowPinned:i}}getCellAbove(e){if(!e)return null;const t=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}getLastBodyCell(){return{rowIndex:this.paginationProxy.getPageLastRow(),rowPinned:null}}getLastFloatingTopRow(){return{rowIndex:this.pinnedRowModel.getPinnedTopRowData().length-1,rowPinned:"top"}}getNextTabbedCell(e,t){return t?this.getNextTabbedCellBackwards(e):this.getNextTabbedCellForwards(e)}getNextTabbedCellForwards(e){const t=this.columnModel.getAllDisplayedColumns();let i=e.rowIndex,s=e.rowPinned,o=this.columnModel.getDisplayedColAfter(e.column);if(!o){o=t[0];const n=this.getRowBelow(e);if(Ws(n))return null;if(!n.rowPinned&&!this.paginationProxy.isRowInPage(n))return null;i=n?n.rowIndex:null,s=n?n.rowPinned:null}return{rowIndex:i,column:o,rowPinned:s}}getNextTabbedCellBackwards(e){const t=this.columnModel.getAllDisplayedColumns();let i=e.rowIndex,s=e.rowPinned,o=this.columnModel.getDisplayedColBefore(e.column);if(!o){o=Jo(t);const n=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});if(Ws(n))return null;if(!n.rowPinned&&!this.paginationProxy.isRowInPage(n))return null;i=n?n.rowIndex:null,s=n?n.rowPinned:null}return{rowIndex:i,column:o,rowPinned:s}}};Gs([No("columnModel")],Op.prototype,"columnModel",2),Gs([No("rowModel")],Op.prototype,"rowModel",2),Gs([No("rowRenderer")],Op.prototype,"rowRenderer",2),Gs([No("pinnedRowModel")],Op.prototype,"pinnedRowModel",2),Gs([No("paginationProxy")],Op.prototype,"paginationProxy",2),Op=Gs([Io("cellNavigationService")],Op);var Gp=class extends Pn{constructor(){super(...arguments),this.consuming=!1}setBeans(e){this.logger=e.create("AlignedGridsService")}getAlignedGridApis(){var e;let t=null!=(e=this.gos.get("alignedGrids"))?e:[];const i="function"==typeof t;"function"==typeof t&&(t=t());const s=()=>`See ${this.getFrameworkOverrides().getDocLink("aligned-grids")}`;return t.map((e=>{var t;if(!e)return po("alignedGrids contains an undefined option."),i||po('You may want to configure via a callback to avoid setup race conditions:\n "alignedGrids: () => [linkedGrid]"'),void po(s());if(e instanceof dd)return e;const o=e;return"current"in o?null==(t=o.current)?void 0:t.api:(o.api||po(`alignedGrids - No api found on the linked grid. If you are passing gridOptions to alignedGrids since v31 this is no longer valid. ${s()}`),o.api)})).filter((e=>!!e&&!e.isDestroyed()))}init(){this.addManagedListener(this.eventService,In.EVENT_COLUMN_MOVED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,In.EVENT_COLUMN_VISIBLE,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,In.EVENT_COLUMN_PINNED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,In.EVENT_COLUMN_GROUP_OPENED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,In.EVENT_COLUMN_RESIZED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,In.EVENT_BODY_SCROLL,this.fireScrollEvent.bind(this))}fireEvent(e){this.consuming||this.getAlignedGridApis().forEach((t=>{if(t.isDestroyed())return;const i=t.__getAlignedGridService();e(i)}))}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){this.fireEvent((t=>{t.onColumnEvent(e)}))}fireScrollEvent(e){"horizontal"===e.direction&&this.fireEvent((t=>{t.onScrollEvent(e)}))}onScrollEvent(e){this.onEvent((()=>{this.ctrlsService.getGridBodyCtrl().getScrollFeature().setHorizontalScrollPosition(e.left,!0)}))}getMasterColumns(e){const t=[];return e.columns?e.columns.forEach((e=>{t.push(e)})):e.column&&t.push(e.column),t}getColumnIds(e){const t=[];return e.columns?e.columns.forEach((e=>{t.push(e.getColId())})):e.column&&t.push(e.column.getColId()),t}onColumnEvent(e){this.onEvent((()=>{switch(e.type){case In.EVENT_COLUMN_MOVED:case In.EVENT_COLUMN_VISIBLE:case In.EVENT_COLUMN_PINNED:case In.EVENT_COLUMN_RESIZED:const t=e;this.processColumnEvent(t);break;case In.EVENT_COLUMN_GROUP_OPENED:const i=e;this.processGroupOpenedEvent(i);break;case In.EVENT_COLUMN_PIVOT_CHANGED:console.warn("AG Grid: pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid.")}}))}processGroupOpenedEvent(e){e.columnGroups.forEach((t=>{let i=null;if(t){const e=t.getGroupId();i=this.columnModel.getProvidedColumnGroup(e)}t&&!i||(this.logger.log("onColumnEvent-> processing "+e+" expanded = "+t.isExpanded()),this.columnModel.setColumnGroupOpened(i,t.isExpanded(),"alignedGridChanged"))}))}processColumnEvent(e){var t;const i=e.column;let s=null;if(i&&(s=this.columnModel.getPrimaryColumn(i.getColId())),i&&!s)return;const o=this.getMasterColumns(e);switch(e.type){case In.EVENT_COLUMN_MOVED:{const t=e,i=e.api.getColumnState().map((e=>({colId:e.colId})));this.columnModel.applyColumnState({state:i,applyOrder:!0},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${e.type} toIndex = ${t.toIndex}`)}break;case In.EVENT_COLUMN_VISIBLE:{const t=e,i=e.api.getColumnState().map((e=>({colId:e.colId,hide:e.hide})));this.columnModel.applyColumnState({state:i},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${e.type} visible = ${t.visible}`)}break;case In.EVENT_COLUMN_PINNED:{const t=e,i=e.api.getColumnState().map((e=>({colId:e.colId,pinned:e.pinned})));this.columnModel.applyColumnState({state:i},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${e.type} pinned = ${t.pinned}`)}break;case In.EVENT_COLUMN_RESIZED:const i=e,s={};o.forEach((t=>{this.logger.log(`onColumnEvent-> processing ${e.type} actualWidth = ${t.getActualWidth()}`),s[t.getId()]={key:t.getColId(),newWidth:t.getActualWidth()}})),null==(t=i.flexColumns)||t.forEach((e=>{s[e.getId()]&&delete s[e.getId()]})),this.columnModel.setColumnWidths(Object.values(s),!1,i.finished,"alignedGridChanged")}const n=this.ctrlsService.getGridBodyCtrl().isVerticalScrollShowing();this.getAlignedGridApis().forEach((e=>{e.setGridOption("alwaysShowVerticalScroll",n)}))}};Gs([No("columnModel")],Gp.prototype,"columnModel",2),Gs([No("ctrlsService")],Gp.prototype,"ctrlsService",2),Gs([ks(0,Go("loggerFactory"))],Gp.prototype,"setBeans",1),Gs([Lo],Gp.prototype,"init",1),Gp=Gs([Io("alignedGridsService")],Gp);var kp=class extends Pn{constructor(){super(...arguments),this.selectedNodes=new Map,this.lastRowNode=null}init(){this.rowSelection=this.gos.get("rowSelection"),this.groupSelectsChildren=this.gos.get("groupSelectsChildren"),this.addManagedPropertyListeners(["groupSelectsChildren","rowSelection"],(()=>{this.groupSelectsChildren=this.gos.get("groupSelectsChildren"),this.rowSelection=this.gos.get("rowSelection"),this.deselectAllRowNodes({source:"api"})})),this.addManagedListener(this.eventService,In.EVENT_ROW_SELECTED,this.onRowSelected.bind(this))}destroy(){super.destroy(),this.resetNodes(),this.lastRowNode=null}isMultiselect(){return"multiple"===this.rowSelection}setNodesSelected(e){var t;const{newValue:i,clearSelection:s,suppressFinishActions:o,rangeSelect:n,nodes:r,event:a,source:l="api"}=e;if(0===r.length)return 0;if(r.length>1&&!this.isMultiselect())return console.warn("AG Grid: cannot multi select while rowSelection='single'"),0;const u=this.groupSelectsChildren&&!0===e.groupSelectsFiltered,h=r.map((e=>e.footer?e.sibling:e));if(n){if(r.length>1)return console.warn("AG Grid: cannot range select while selecting multiple rows"),0;let e=null;if("checkboxSelected"===l&&!1===i&&this.lastRowNode&&(this.lastRowNode.id?e=this.lastRowNode:this.lastRowNode=null),null==e&&(e=this.getLastSelectedNode()),e){const t=h[0];if(t!==e&&this.isMultiselect())return this.selectRange(t,e,i,l)}}this.lastRowNode=i?null:h[0];let d=0;for(let e=0;e<h.length;e++){const s=h[e];u&&s.group||s.selectThisNode(i,a,l)&&d++,this.groupSelectsChildren&&(null==(t=s.childrenAfterGroup)?void 0:t.length)&&(d+=this.selectChildren(s,i,u,l))}if(!o&&(i&&(s||!this.isMultiselect())&&(d+=this.clearOtherNodes(h[0],l)),d>0)){this.updateGroupsFromChildrenSelections(l);const e={type:In.EVENT_SELECTION_CHANGED,source:l};this.eventService.dispatchEvent(e)}return d}selectRange(e,t,i=!0,s){const o=this.rowModel.getNodesInRangeForSelection(e,t);let n=0;o.forEach((e=>{e.group&&this.groupSelectsChildren||e.selectThisNode(i,void 0,s)&&n++})),this.updateGroupsFromChildrenSelections(s);const r={type:In.EVENT_SELECTION_CHANGED,source:s};return this.eventService.dispatchEvent(r),n}selectChildren(e,t,i,s){const o=i?e.childrenAfterAggFilter:e.childrenAfterGroup;return Ws(o)?0:this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,groupSelectsFiltered:i,source:s,nodes:o})}getLastSelectedNode(){const e=Array.from(this.selectedNodes.keys());if(0==e.length)return null;return this.selectedNodes.get(Jo(e))||null}getSelectedNodes(){const e=[];return this.selectedNodes.forEach((t=>{t&&e.push(t)})),e}getSelectedRows(){const e=[];return this.selectedNodes.forEach((t=>{t&&t.data&&e.push(t.data)})),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach(((i,s)=>{i&&e(i)&&t.set(s,i)})),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsChildren)return!1;if("clientSide"!==this.rowModel.getType())return!1;const i=this.rowModel.getRootNode();t||(t=new Qc(!0,i)).setInactive();let s=!1;return t.forEachChangedNodeDepthFirst((t=>{if(t!==i){const i=t.calculateSelectedFromChildren();s=t.selectThisNode(null!==i&&i,void 0,e)||s}})),s}clearOtherNodes(e,t){const i=new Map;let s=0;return this.selectedNodes.forEach((o=>{if(o&&o.id!==e.id){const e=this.selectedNodes.get(o.id);s+=e.setSelectedParams({newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:t}),this.groupSelectsChildren&&o.parent&&i.set(o.parent.id,o.parent)}})),i.forEach((e=>{const i=e.calculateSelectedFromChildren();e.selectThisNode(null!==i&&i,void 0,t)})),s}onRowSelected(e){const t=e.node;this.groupSelectsChildren&&t.group||(t.isSelected()?this.selectedNodes.set(t.id,t):this.selectedNodes.delete(t.id))}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}syncInOldRowNode(e,t){if(Bs(t)&&e.id!==t.id&&t){const i=t.id;this.selectedNodes.get(i)==e&&this.selectedNodes.set(t.id,t)}}syncInNewRowNode(e){this.selectedNodes.has(e.id)?(e.setSelectedInitialValue(!0),this.selectedNodes.set(e.id,e)):e.setSelectedInitialValue(!1)}reset(e){const t=this.getSelectionCount();if(this.resetNodes(),t){const t={type:In.EVENT_SELECTION_CHANGED,source:e};this.eventService.dispatchEvent(t)}}resetNodes(){var e;null==(e=this.selectedNodes)||e.clear()}getBestCostNodeSelection(){if("clientSide"!==this.rowModel.getType())return;const e=this.rowModel.getTopLevelNodes();if(null===e)return;const t=[];return function e(i){for(let s=0,o=i.length;s<o;s++){const o=i[s];if(o.isSelected())t.push(o);else{const t=o;t.group&&t.children&&e(t.children)}}}(e),t}isEmpty(){let e=0;return this.selectedNodes.forEach((t=>{t&&e++})),0===e}deselectAllRowNodes(e){const t=e=>e.selectThisNode(!1,void 0,s),i="clientSide"===this.rowModel.getType(),{source:s,justFiltered:o,justCurrentPage:n}=e;if(n||o){if(!i)return void console.error("AG Grid: selecting just filtered only works when gridOptions.rowModelType='clientSide'");this.getNodesToSelect(o,n).forEach(t)}else this.selectedNodes.forEach((e=>{e&&t(e)})),this.reset(s);i&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(s);const r={type:In.EVENT_SELECTION_CHANGED,source:s};this.eventService.dispatchEvent(r)}getSelectedCounts(e,t){let i=0,s=0;return this.getNodesToSelect(e,t).forEach((e=>{this.groupSelectsChildren&&e.group||(e.isSelected()?i++:e.selectable&&s++)})),{selectedCount:i,notSelectedCount:s}}getSelectAllState(e,t){const{selectedCount:i,notSelectedCount:s}=this.getSelectedCounts(e,t);return(0!==i||0!==s)&&(i>0&&s>0?null:i>0)}hasNodesToSelect(e=!1,t=!1){return this.getNodesToSelect(e,t).filter((e=>e.selectable)).length>0}getNodesToSelect(e=!1,t=!1){if("clientSide"!==this.rowModel.getType())throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`);const i=[];if(t)return this.paginationProxy.forEachNodeOnPage((e=>{if(e.group)if(e.expanded)this.groupSelectsChildren||i.push(e);else{const t=e=>{var s;i.push(e),(null==(s=e.childrenAfterFilter)?void 0:s.length)&&e.childrenAfterFilter.forEach(t)};t(e)}else i.push(e)})),i;const s=this.rowModel;return e?(s.forEachNodeAfterFilter((e=>{i.push(e)})),i):(s.forEachNode((e=>{i.push(e)})),i)}selectAllRowNodes(e){if("clientSide"!==this.rowModel.getType())throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`);const{source:t,justFiltered:i,justCurrentPage:s}=e;this.getNodesToSelect(i,s).forEach((e=>e.selectThisNode(!0,void 0,t))),"clientSide"===this.rowModel.getType()&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(t);const o={type:In.EVENT_SELECTION_CHANGED,source:t};this.eventService.dispatchEvent(o)}getSelectionState(){const e=[];return this.selectedNodes.forEach((t=>{(null==t?void 0:t.id)&&e.push(t.id)})),e.length?e:null}setSelectionState(e,t){if(!Array.isArray(e))return;const i=new Set(e),s=[];this.rowModel.forEachNode((e=>{i.has(e.id)&&s.push(e)})),this.setNodesSelected({newValue:!0,nodes:s,source:t})}};Gs([No("rowModel")],kp.prototype,"rowModel",2),Gs([No("paginationProxy")],kp.prototype,"paginationProxy",2),Gs([Lo],kp.prototype,"init",1),kp=Gs([Io("selectionService")],kp);var Vp=class{constructor(e){this.viaApi=(e,...t)=>(co(`Since v31, 'columnApi.${e}' is deprecated and moved to 'api.${e}'.`),this.api[e](...t)),this.api=e}sizeColumnsToFit(e){this.viaApi("sizeColumnsToFit",e)}setColumnGroupOpened(e,t){this.viaApi("setColumnGroupOpened",e,t)}getColumnGroup(e,t){return this.viaApi("getColumnGroup",e,t)}getProvidedColumnGroup(e){return this.viaApi("getProvidedColumnGroup",e)}getDisplayNameForColumn(e,t){return this.viaApi("getDisplayNameForColumn",e,t)}getDisplayNameForColumnGroup(e,t){return this.viaApi("getDisplayNameForColumnGroup",e,t)}getColumn(e){return this.viaApi("getColumn",e)}getColumns(){return this.viaApi("getColumns")}applyColumnState(e){return this.viaApi("applyColumnState",e)}getColumnState(){return this.viaApi("getColumnState")}resetColumnState(){this.viaApi("resetColumnState")}getColumnGroupState(){return this.viaApi("getColumnGroupState")}setColumnGroupState(e){this.viaApi("setColumnGroupState",e)}resetColumnGroupState(){this.viaApi("resetColumnGroupState")}isPinning(){return this.viaApi("isPinning")}isPinningLeft(){return this.viaApi("isPinningLeft")}isPinningRight(){return this.viaApi("isPinningRight")}getDisplayedColAfter(e){return this.viaApi("getDisplayedColAfter",e)}getDisplayedColBefore(e){return this.viaApi("getDisplayedColBefore",e)}setColumnVisible(e,t){this.viaApi("setColumnVisible",e,t)}setColumnsVisible(e,t){this.viaApi("setColumnsVisible",e,t)}setColumnPinned(e,t){this.viaApi("setColumnPinned",e,t)}setColumnsPinned(e,t){this.viaApi("setColumnsPinned",e,t)}getAllGridColumns(){return this.viaApi("getAllGridColumns")}getDisplayedLeftColumns(){return this.viaApi("getDisplayedLeftColumns")}getDisplayedCenterColumns(){return this.viaApi("getDisplayedCenterColumns")}getDisplayedRightColumns(){return this.viaApi("getDisplayedRightColumns")}getAllDisplayedColumns(){return this.viaApi("getAllDisplayedColumns")}getAllDisplayedVirtualColumns(){return this.viaApi("getAllDisplayedVirtualColumns")}moveColumn(e,t){this.viaApi("moveColumn",e,t)}moveColumnByIndex(e,t){this.viaApi("moveColumnByIndex",e,t)}moveColumns(e,t){this.viaApi("moveColumns",e,t)}moveRowGroupColumn(e,t){this.viaApi("moveRowGroupColumn",e,t)}setColumnAggFunc(e,t){this.viaApi("setColumnAggFunc",e,t)}setColumnWidth(e,t,i=!0,s){this.viaApi("setColumnWidth",e,t,i,s)}setColumnWidths(e,t=!0,i){this.viaApi("setColumnWidths",e,t,i)}setPivotMode(e){this.viaApi("setPivotMode",e)}isPivotMode(){return this.viaApi("isPivotMode")}getPivotResultColumn(e,t){return this.viaApi("getPivotResultColumn",e,t)}setValueColumns(e){this.viaApi("setValueColumns",e)}getValueColumns(){return this.viaApi("getValueColumns")}removeValueColumn(e){this.viaApi("removeValueColumn",e)}removeValueColumns(e){this.viaApi("removeValueColumns",e)}addValueColumn(e){this.viaApi("addValueColumn",e)}addValueColumns(e){this.viaApi("addValueColumns",e)}setRowGroupColumns(e){this.viaApi("setRowGroupColumns",e)}removeRowGroupColumn(e){this.viaApi("removeRowGroupColumn",e)}removeRowGroupColumns(e){this.viaApi("removeRowGroupColumns",e)}addRowGroupColumn(e){this.viaApi("addRowGroupColumn",e)}addRowGroupColumns(e){this.viaApi("addRowGroupColumns",e)}getRowGroupColumns(){return this.viaApi("getRowGroupColumns")}setPivotColumns(e){this.viaApi("setPivotColumns",e)}removePivotColumn(e){this.viaApi("removePivotColumn",e)}removePivotColumns(e){this.viaApi("removePivotColumns",e)}addPivotColumn(e){this.viaApi("addPivotColumn",e)}addPivotColumns(e){this.viaApi("addPivotColumns",e)}getPivotColumns(){return this.viaApi("getPivotColumns")}getLeftDisplayedColumnGroups(){return this.viaApi("getLeftDisplayedColumnGroups")}getCenterDisplayedColumnGroups(){return this.viaApi("getCenterDisplayedColumnGroups")}getRightDisplayedColumnGroups(){return this.viaApi("getRightDisplayedColumnGroups")}getAllDisplayedColumnGroups(){return this.viaApi("getAllDisplayedColumnGroups")}autoSizeColumn(e,t){return this.viaApi("autoSizeColumn",e,t)}autoSizeColumns(e,t){this.viaApi("autoSizeColumns",e,t)}autoSizeAllColumns(e){this.viaApi("autoSizeAllColumns",e)}setPivotResultColumns(e){this.viaApi("setPivotResultColumns",e)}getPivotResultColumns(){return this.viaApi("getPivotResultColumns")}};Gs([No("gridApi")],Vp.prototype,"api",2),Vp=Gs([Io("columnApi")],Vp);var Hp=class extends Pn{constructor(){super(...arguments),this.initialised=!1,this.isSsrm=!1}init(){this.isSsrm=this.gos.isRowModelType("serverSide"),this.cellExpressions=this.gos.get("enableCellExpressions"),this.isTreeData=this.gos.get("treeData"),this.initialised=!0;const e=e=>this.callColumnCellValueChangedHandler(e),t=this.gos.useAsyncEvents();this.eventService.addEventListener(In.EVENT_CELL_VALUE_CHANGED,e,t),this.addDestroyFunc((()=>this.eventService.removeEventListener(In.EVENT_CELL_VALUE_CHANGED,e,t))),this.addManagedPropertyListener("treeData",(e=>this.isTreeData=e.currentValue))}getValue(e,t,i=!1,s=!1){if(this.initialised||this.init(),!t)return;const o=e.getColDef(),n=o.field,r=e.getColId(),a=t.data;let l;const u=t.groupData&&void 0!==t.groupData[r],h=!s&&t.aggData&&void 0!==t.aggData[r],d=this.isSsrm&&s&&!!e.getColDef().aggFunc,c=this.isSsrm&&t.footer&&t.field&&(!0===e.getColDef().showRowGroup||e.getColDef().showRowGroup===t.field);if(i&&o.filterValueGetter?l=this.executeFilterValueGetter(o.filterValueGetter,a,e,t):this.isTreeData&&h?l=t.aggData[r]:this.isTreeData&&o.valueGetter?l=this.executeValueGetter(o.valueGetter,a,e,t):this.isTreeData&&n&&a?l=no(a,n,e.isFieldContainsDots()):u?l=t.groupData[r]:h?l=t.aggData[r]:o.valueGetter?l=this.executeValueGetter(o.valueGetter,a,e,t):c?l=no(a,t.field,e.isFieldContainsDots()):n&&a&&!d&&(l=no(a,n,e.isFieldContainsDots())),this.cellExpressions&&"string"==typeof l&&0===l.indexOf("=")){const i=l.substring(1);l=this.executeValueGetter(i,a,e,t)}if(null==l){const i=this.getOpenedGroup(t,e);if(null!=i)return i}return l}parseValue(e,t,i,s){const o=e.getColDef(),n=this.gos.addGridCommonParams({node:t,data:null==t?void 0:t.data,oldValue:s,newValue:i,colDef:o,column:e}),r=o.valueParser;return Bs(r)?"function"==typeof r?r(n):this.expressionService.evaluate(r,n):i}formatValue(e,t,i,s,o=!0){let n,r=null;const a=e.getColDef();if(s?n=s:o&&(n=a.valueFormatter),n){const s=this.gos.addGridCommonParams({value:i,node:t,data:t?t.data:null,colDef:a,column:e});r="function"==typeof n?n(s):this.expressionService.evaluate(n,s)}else if(a.refData)return a.refData[i]||"";return null==r&&Array.isArray(i)&&(r=i.join(", ")),r}getOpenedGroup(e,t){if(!this.gos.get("showOpenedGroup"))return;if(!t.getColDef().showRowGroup)return;const i=t.getColDef().showRowGroup;let s=e.parent;for(;null!=s;){if(s.rowGroupColumn&&(!0===i||i===s.rowGroupColumn.getColId()))return s.key;s=s.parent}}setValue(e,t,i,s){const o=this.columnModel.getPrimaryColumn(t);if(!e||!o)return!1;Ws(e.data)&&(e.data={});const{field:n,valueSetter:r}=o.getColDef();if(Ws(n)&&Ws(r))return console.warn("AG Grid: you need either field or valueSetter set on colDef for editing to work"),!1;if(!this.dataTypeService.checkType(o,i))return console.warn("AG Grid: Data type of the new value does not match the cell data type of the column"),!1;const a=this.gos.addGridCommonParams({node:e,data:e.data,oldValue:this.getValue(o,e),newValue:i,colDef:o.getColDef(),column:o});let l;if(a.newValue=i,l=Bs(r)?"function"==typeof r?r(a):this.expressionService.evaluate(r,a):this.setValueUsingField(e.data,n,i,o.isFieldContainsDots()),void 0===l&&(l=!0),!l)return!1;e.resetQuickFilterAggregateText(),this.valueCache.onDataChanged(),a.newValue=this.getValue(o,e);const u={type:In.EVENT_CELL_VALUE_CHANGED,event:null,rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:a.column,api:a.api,columnApi:a.columnApi,colDef:a.colDef,context:a.context,data:e.data,node:e,oldValue:a.oldValue,newValue:a.newValue,value:a.newValue,source:s};return this.eventService.dispatchEvent(u),!0}callColumnCellValueChangedHandler(e){const t=e.colDef.onCellValueChanged;"function"==typeof t&&this.getFrameworkOverrides().wrapOutgoing((()=>{t({node:e.node,data:e.data,oldValue:e.oldValue,newValue:e.newValue,colDef:e.colDef,column:e.column,api:e.api,columnApi:e.columnApi,context:e.context})}))}setValueUsingField(e,t,i,s){if(!t)return!1;let o=!1;if(s){const s=t.split(".");let n=e;for(;s.length>0&&n;){const e=s.shift();0===s.length?(o=n[e]===i,o||(n[e]=i)):n=n[e]}}else o=e[t]===i,o||(e[t]=i);return!o}executeFilterValueGetter(e,t,i,s){const o=this.gos.addGridCommonParams({data:t,node:s,column:i,colDef:i.getColDef(),getValue:this.getValueCallback.bind(this,s)});return"function"==typeof e?e(o):this.expressionService.evaluate(e,o)}executeValueGetter(e,t,i,s){const o=i.getColId(),n=this.valueCache.getValue(s,o);if(void 0!==n)return n;const r=this.gos.addGridCommonParams({data:t,node:s,column:i,colDef:i.getColDef(),getValue:this.getValueCallback.bind(this,s)});let a;return a="function"==typeof e?e(r):this.expressionService.evaluate(e,r),this.valueCache.setValue(s,o,a),a}getValueCallback(e,t){const i=this.columnModel.getPrimaryColumn(t);return i?this.getValue(i,e):null}getKeyForNode(e,t){const i=this.getValue(e,t),s=e.getColDef().keyCreator;let o=i;return s&&(o=s(this.gos.addGridCommonParams({value:i,colDef:e.getColDef(),column:e,node:t,data:t.data}))),"string"==typeof o||null==o||(o=String(o),"[object Object]"===o&&co("a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (se AG Grid docs) or b) to toString() on the object to return a key")),o}};Gs([No("expressionService")],Hp.prototype,"expressionService",2),Gs([No("columnModel")],Hp.prototype,"columnModel",2),Gs([No("valueCache")],Hp.prototype,"valueCache",2),Gs([No("dataTypeService")],Hp.prototype,"dataTypeService",2),Gs([Lo],Hp.prototype,"init",1),Hp=Gs([Io("valueService")],Hp);var Bp=class extends Pn{constructor(){super(...arguments),this.expressionToFunctionCache={}}setBeans(e){this.logger=e.create("ExpressionService")}evaluate(e,t){if("string"==typeof e)return this.evaluateExpression(e,t);console.error("AG Grid: value should be either a string or a function",e)}evaluateExpression(e,t){try{return this.createExpressionFunction(e)(t.value,t.context,t.oldValue,t.newValue,t.value,t.node,t.data,t.colDef,t.rowIndex,t.api,t.columnApi,t.getValue,t.column,t.columnGroup)}catch(i){return console.log("Processing of the expression failed"),console.log("Expression = "+e),console.log("Params =",t),console.log("Exception = "+i),null}}createExpressionFunction(e){if(this.expressionToFunctionCache[e])return this.expressionToFunctionCache[e];const t=this.createFunctionBody(e),i=new Function("x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, columnApi, getValue, column, columnGroup",t);return this.expressionToFunctionCache[e]=i,i}createFunctionBody(e){return e.indexOf("return")>=0?e:"return "+e+";"}};Gs([ks(0,Go("loggerFactory"))],Bp.prototype,"setBeans",1),Bp=Gs([Io("expressionService")],Bp);var Wp=class extends Pn{setBeans(e){this.logging=e.get("debug")}create(e){return new Up(e,this.isLogging.bind(this))}isLogging(){return this.logging}};Gs([ks(0,Go("gridOptionsService"))],Wp.prototype,"setBeans",1),Wp=Gs([Io("loggerFactory")],Wp);var Up=class{constructor(e,t){this.name=e,this.isLoggingFunc=t}isLogging(){return this.isLoggingFunc()}log(e){this.isLoggingFunc()&&console.log("AG Grid."+this.name+": "+e)}},zp=class extends Pn{setComp(e,t,i){this.view=e,this.eGridHostDiv=t,this.eGui=i,this.eGui.setAttribute("grid-id",this.context.getGridId()),this.dragAndDropService.addDropTarget({getContainer:()=>this.eGui,isInterestedIn:e=>1===e||0===e,getIconName:()=>hh.ICON_NOT_ALLOWED}),this.mouseEventService.stampTopLevelGridCompWithGridInstance(t),this.createManagedBean(new vd(this.view)),this.addRtlSupport();const s=this.resizeObserverService.observeResize(this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc((()=>s())),this.ctrlsService.register("gridCtrl",this)}isDetailGrid(){var e;const t=this.focusService.findTabbableParent(this.getGui());return(null==(e=null==t?void 0:t.getAttribute("row-id"))?void 0:e.startsWith("detail"))||!1}showDropZones(){return Po.__isRegistered("@ag-grid-enterprise/row-grouping",this.context.getGridId())}showSideBar(){return Po.__isRegistered("@ag-grid-enterprise/side-bar",this.context.getGridId())}showStatusBar(){return Po.__isRegistered("@ag-grid-enterprise/status-bar",this.context.getGridId())}showWatermark(){return Po.__isRegistered("@ag-grid-enterprise/core",this.context.getGridId())}onGridSizeChanged(){const e={type:In.EVENT_GRID_SIZE_CHANGED,clientWidth:this.eGridHostDiv.clientWidth,clientHeight:this.eGridHostDiv.clientHeight};this.eventService.dispatchEvent(e)}addRtlSupport(){const e=this.gos.get("enableRtl")?"ag-rtl":"ag-ltr";this.view.setRtlClass(e)}destroyGridUi(){this.view.destroyGridUi()}getGui(){return this.eGui}setResizeCursor(e){this.view.setCursor(e?"ew-resize":null)}disableUserSelect(e){this.view.setUserSelect(e?"none":null)}focusNextInnerContainer(e){const t=this.view.getFocusableContainers(),i=this.gos.getActiveDomElement(),s=t.findIndex((e=>e.contains(i)))+(e?-1:1);return!(s<=0||s>=t.length)&&this.focusService.focusInto(t[s])}focusInnerElement(e){const t=this.view.getFocusableContainers(),i=this.columnModel.getAllDisplayedColumns();if(e){if(t.length>1)return this.focusService.focusInto(Jo(t),!0);const e=Jo(i);if(this.focusService.focusGridView(e,!0))return!0}if(0===this.gos.get("headerHeight")||this.gos.get("suppressHeaderFocus")){if(this.focusService.focusGridView(i[0]))return!0;for(let e=1;e<t.length;e++)if(this.focusService.focusInto(t[e]))return!0;return!1}return this.focusService.focusFirstHeader()}forceFocusOutOfContainer(e=!1){this.view.forceFocusOutOfContainer(e)}};Gs([No("focusService")],zp.prototype,"focusService",2),Gs([No("resizeObserverService")],zp.prototype,"resizeObserverService",2),Gs([No("columnModel")],zp.prototype,"columnModel",2),Gs([No("ctrlsService")],zp.prototype,"ctrlsService",2),Gs([No("mouseEventService")],zp.prototype,"mouseEventService",2),Gs([No("dragAndDropService")],zp.prototype,"dragAndDropService",2);var $p=class extends Hc{constructor(e){super(),this.eGridDiv=e}postConstruct(){this.logger=this.loggerFactory.create("GridComp");const e={destroyGridUi:()=>this.destroyBean(this),setRtlClass:e=>this.addCssClass(e),forceFocusOutOfContainer:this.forceFocusOutOfContainer.bind(this),updateLayoutClasses:this.updateLayoutClasses.bind(this),getFocusableContainers:this.getFocusableContainers.bind(this),setUserSelect:e=>{this.getGui().style.userSelect=null!=e?e:"",this.getGui().style.webkitUserSelect=null!=e?e:""},setCursor:e=>{this.getGui().style.cursor=null!=e?e:""}};this.ctrl=this.createManagedBean(new zp);const t=this.createTemplate();this.setTemplate(t),this.ctrl.setComp(e,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:e=>this.ctrl.focusInnerElement(e),forceFocusOutWhenTabGuardsAreEmpty:!0})}insertGridIntoDom(){const e=this.getGui();this.eGridDiv.appendChild(e),this.addDestroyFunc((()=>{this.eGridDiv.removeChild(e),this.logger.log("Grid removed from DOM")}))}updateLayoutClasses(e,t){const i=this.eRootWrapperBody.classList;i.toggle("ag-layout-auto-height",t.autoHeight),i.toggle("ag-layout-normal",t.normal),i.toggle("ag-layout-print",t.print),this.addOrRemoveCssClass("ag-layout-auto-height",t.autoHeight),this.addOrRemoveCssClass("ag-layout-normal",t.normal),this.addOrRemoveCssClass("ag-layout-print",t.print)}createTemplate(){return`<div class="ag-root-wrapper" role="presentation">\n ${this.ctrl.showDropZones()?"<ag-grid-header-drop-zones></ag-grid-header-drop-zones>":""}\n <div class="ag-root-wrapper-body" ref="rootWrapperBody" role="presentation">\n <ag-grid-body ref="gridBody"></ag-grid-body>\n ${this.ctrl.showSideBar()?'<ag-side-bar ref="sideBar"></ag-side-bar>':""}\n </div>\n ${this.ctrl.showStatusBar()?'<ag-status-bar ref="statusBar"></ag-status-bar>':""}\n <ag-pagination></ag-pagination>\n ${this.ctrl.showWatermark()?"<ag-watermark></ag-watermark>":""}\n </div>`}getFocusableElement(){return this.eRootWrapperBody}getFocusableContainers(){const e=[this.gridBodyComp.getGui()];return this.sideBarComp&&e.push(this.sideBarComp.getGui()),e.filter((e=>ja(e)))}};Gs([No("loggerFactory")],$p.prototype,"loggerFactory",2),Gs([ql("gridBody")],$p.prototype,"gridBodyComp",2),Gs([ql("sideBar")],$p.prototype,"sideBarComp",2),Gs([ql("rootWrapperBody")],$p.prototype,"eRootWrapperBody",2),Gs([Lo],$p.prototype,"postConstruct",1);var Kp=class extends Pn{progressSort(e,t,i){const s=this.getNextSortDirection(e);this.setSortForColumn(e,s,t,i)}setSortForColumn(e,t,i,s){"asc"!==t&&"desc"!==t&&(t=null);let o=[e];if(this.gos.isColumnsSortingCoupledToGroup()&&e.getColDef().showRowGroup){const t=this.columnModel.getSourceColumnsForGroupColumn(e),i=null==t?void 0:t.filter((e=>e.isSortable()));i&&(o=[e,...i])}o.forEach((e=>e.setSort(t,s)));const n=[];if(!i&&!this.gos.get("alwaysMultiSort")||this.gos.get("suppressMultiSort")){const e=this.clearSortBarTheseColumns(o,s);n.push(...e)}this.updateSortIndex(e),n.push(...o),this.dispatchSortChangedEvents(s,n)}updateSortIndex(e){const t=this.gos.isColumnsSortingCoupledToGroup(),i=this.columnModel.getGroupDisplayColumnForGroup(e.getId()),s=t&&i||e,o=this.getColumnsWithSortingOrdered();this.columnModel.getPrimaryAndSecondaryAndAutoColumns().forEach((e=>e.setSortIndex(null)));const n=o.filter((e=>!(t&&e.getColDef().showRowGroup||e===s)));(s.getSort()?[...n,s]:n).forEach(((e,t)=>{e.setSortIndex(t)}))}onSortChanged(e,t){this.dispatchSortChangedEvents(e,t)}isSortActive(){const e=this.columnModel.getPrimaryAndSecondaryAndAutoColumns().filter((e=>!!e.getSort()));return e&&e.length>0}dispatchSortChangedEvents(e,t){const i={type:In.EVENT_SORT_CHANGED,source:e};t&&(i.columns=t),this.eventService.dispatchEvent(i)}clearSortBarTheseColumns(e,t){const i=[];return this.columnModel.getPrimaryAndSecondaryAndAutoColumns().forEach((s=>{e.includes(s)||(s.getSort()&&i.push(s),s.setSort(void 0,t))})),i}getNextSortDirection(e){let t;if(t=e.getColDef().sortingOrder?e.getColDef().sortingOrder:this.gos.get("sortingOrder")?this.gos.get("sortingOrder"):Kp.DEFAULT_SORTING_ORDER,!Array.isArray(t)||t.length<=0)return console.warn(`AG Grid: sortingOrder must be an array with at least one element, currently it's ${t}`),null;const i=t.indexOf(e.getSort()),s=i<0,o=i==t.length-1;let n;return n=s||o?t[0]:t[i+1],Kp.DEFAULT_SORTING_ORDER.indexOf(n)<0?(console.warn("AG Grid: invalid sort type "+n),null):n}getIndexedSortMap(){let e=this.columnModel.getPrimaryAndSecondaryAndAutoColumns().filter((e=>!!e.getSort()));if(this.columnModel.isPivotMode()){const t=this.gos.isColumnsSortingCoupledToGroup();e=e.filter((e=>{const i=!!e.getAggFunc(),s=!e.isPrimary(),o=t?this.columnModel.getGroupDisplayColumnForGroup(e.getId()):e.getColDef().showRowGroup;return i||s||o}))}const t=this.columnModel.getRowGroupColumns().filter((e=>!!e.getSort())),i={};e.forEach(((e,t)=>i[e.getId()]=t)),e.sort(((e,t)=>{const s=e.getSortIndex(),o=t.getSortIndex();return null!=s&&null!=o?s-o:null==s&&null==o?i[e.getId()]>i[t.getId()]?1:-1:null==o?-1:1}));const s=this.gos.isColumnsSortingCoupledToGroup()&&!!t.length;s&&(e=[...new Set(e.map((e=>{var t;return null!=(t=this.columnModel.getGroupDisplayColumnForGroup(e.getId()))?t:e})))]);const o=new Map;return e.forEach(((e,t)=>o.set(e,t))),s&&t.forEach((e=>{const t=this.columnModel.getGroupDisplayColumnForGroup(e.getId());o.set(e,o.get(t))})),o}getColumnsWithSortingOrdered(){return[...this.getIndexedSortMap().entries()].sort((([e,t],[i,s])=>t-s)).map((([e])=>e))}getSortModel(){return this.getColumnsWithSortingOrdered().filter((e=>e.getSort())).map((e=>({sort:e.getSort(),colId:e.getId()})))}getSortOptions(){return this.getColumnsWithSortingOrdered().filter((e=>e.getSort())).map((e=>({sort:e.getSort(),column:e})))}canColumnDisplayMixedSort(e){const t=this.gos.isColumnsSortingCoupledToGroup(),i=!!e.getColDef().showRowGroup;return t&&i}getDisplaySortForColumn(e){const t=this.columnModel.getSourceColumnsForGroupColumn(e);if(!this.canColumnDisplayMixedSort(e)||!(null==t?void 0:t.length))return e.getSort();const i=null!=e.getColDef().field||e.getColDef().valueGetter?[e,...t]:t,s=i[0].getSort();return i.every((e=>e.getSort()==s))?s:"mixed"}getDisplaySortIndexForColumn(e){return this.getIndexedSortMap().get(e)}};Kp.DEFAULT_SORTING_ORDER=["asc","desc",null],Gs([No("columnModel")],Kp.prototype,"columnModel",2),Kp=Gs([Io("sortController")],Kp);var jp=class extends Pn{static addKeyboardModeEvents(e){this.instanceCount>0||(e.addEventListener("keydown",jp.toggleKeyboardMode),e.addEventListener("mousedown",jp.toggleKeyboardMode))}static removeKeyboardModeEvents(e){this.instanceCount>0||(e.addEventListener("keydown",jp.toggleKeyboardMode),e.addEventListener("mousedown",jp.toggleKeyboardMode))}static toggleKeyboardMode(e){const t=jp.keyboardModeActive,i="keydown"===e.type;i&&(e.ctrlKey||e.metaKey||e.altKey)||t!==i&&(jp.keyboardModeActive=i)}static unregisterGridCompController(e){jp.removeKeyboardModeEvents(e)}init(){const e=this.clearFocusedCell.bind(this);this.addManagedListener(this.eventService,In.EVENT_COLUMN_PIVOT_MODE_CHANGED,e),this.addManagedListener(this.eventService,In.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverythingChanged.bind(this)),this.addManagedListener(this.eventService,In.EVENT_COLUMN_GROUP_OPENED,e),this.addManagedListener(this.eventService,In.EVENT_COLUMN_ROW_GROUP_CHANGED,e),this.registerKeyboardFocusEvents(),this.ctrlsService.whenReady((e=>{this.gridCtrl=e.gridCtrl}))}registerKeyboardFocusEvents(){const e=this.gos.getDocument();jp.addKeyboardModeEvents(e),jp.instanceCount++,this.addDestroyFunc((()=>{jp.instanceCount--,jp.unregisterGridCompController(e)}))}onColumnEverythingChanged(){if(!this.focusedCellPosition)return;const e=this.focusedCellPosition.column,t=this.columnModel.getGridColumn(e.getId());e!==t&&this.clearFocusedCell()}isKeyboardMode(){return jp.keyboardModeActive}getFocusCellToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedCellPosition||this.isDomDataMissingInHierarchy(this.gos.getActiveDomElement(),Od.DOM_DATA_KEY_ROW_CTRL)?null:this.focusedCellPosition}getFocusHeaderToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedHeaderPosition||this.isDomDataMissingInHierarchy(this.gos.getActiveDomElement(),Cc.DOM_DATA_KEY_HEADER_CTRL)?null:this.focusedHeaderPosition}isDomDataMissingInHierarchy(e,t){let i=e;for(;i;){if(this.gos.getDomData(i,t))return!1;i=i.parentNode}return!0}getFocusedCell(){return this.focusedCellPosition}shouldRestoreFocus(e){return!!this.isCellRestoreFocused(e)&&(setTimeout((()=>{this.restoredFocusedCellPosition=null}),0),!0)}isCellRestoreFocused(e){return null!=this.restoredFocusedCellPosition&&this.cellPositionUtils.equals(e,this.restoredFocusedCellPosition)}setRestoreFocusedCell(e){"react"===this.getFrameworkOverrides().renderingEngine&&(this.restoredFocusedCellPosition=e)}getFocusEventParams(){const{rowIndex:e,rowPinned:t,column:i}=this.focusedCellPosition,s={rowIndex:e,rowPinned:t,column:i,isFullWidthCell:!1},o=this.rowRenderer.getRowByPosition({rowIndex:e,rowPinned:t});return o&&(s.isFullWidthCell=o.isFullWidth()),s}clearFocusedCell(){if(this.restoredFocusedCellPosition=null,null==this.focusedCellPosition)return;const e=Ns({type:In.EVENT_CELL_FOCUS_CLEARED},this.getFocusEventParams());this.focusedCellPosition=null,this.eventService.dispatchEvent(e)}setFocusedCell(e){const{column:t,rowIndex:i,rowPinned:s,forceBrowserFocus:o=!1,preventScrollOnBrowserFocus:n=!1}=e,r=this.columnModel.getGridColumn(t);if(!r)return void(this.focusedCellPosition=null);this.focusedCellPosition=r?{rowIndex:i,rowPinned:Hs(s),column:r}:null;const a=_s(Ns({type:In.EVENT_CELL_FOCUSED},this.getFocusEventParams()),{forceBrowserFocus:o,preventScrollOnBrowserFocus:n,floating:null});this.eventService.dispatchEvent(a)}isCellFocused(e){return null!=this.focusedCellPosition&&this.cellPositionUtils.equals(e,this.focusedCellPosition)}isRowNodeFocused(e){return this.isRowFocused(e.rowIndex,e.rowPinned)}isHeaderWrapperFocused(e){if(null==this.focusedHeaderPosition)return!1;const t=e.getColumnGroupChild(),i=e.getRowIndex(),s=e.getPinned(),{column:o,headerRowIndex:n}=this.focusedHeaderPosition;return t===o&&i===n&&s==o.getPinned()}clearFocusedHeader(){this.focusedHeaderPosition=null}getFocusedHeader(){return this.focusedHeaderPosition}setFocusedHeader(e,t){this.focusedHeaderPosition={headerRowIndex:e,column:t}}focusHeaderPosition(e){if(this.gos.get("suppressHeaderFocus"))return!1;const{direction:t,fromTab:i,allowUserOverride:s,event:o,fromCell:n,rowWithoutSpanValue:r}=e;let{headerPosition:a}=e;if(n&&this.filterManager.isAdvancedFilterHeaderActive())return this.focusAdvancedFilter(a);if(s){const e=this.getFocusedHeader(),s=this.headerNavigationService.getHeaderRowCount();if(i){const i=this.gos.getCallback("tabToNextHeader");i&&(a=this.getHeaderPositionFromUserFunc({userFunc:i,direction:t,currentPosition:e,headerPosition:a,headerRowCount:s}))}else{const t=this.gos.getCallback("navigateToNextHeader");t&&o&&(a=t({key:o.key,previousHeaderPosition:e,nextHeaderPosition:a,headerRowCount:s,event:o}))}}return!!a&&this.focusProvidedHeaderPosition({headerPosition:a,direction:t,event:o,fromCell:n,rowWithoutSpanValue:r})}focusHeaderPositionFromUserFunc(e){if(this.gos.get("suppressHeaderFocus"))return!1;const{userFunc:t,headerPosition:i,direction:s,event:o}=e,n=this.getFocusedHeader(),r=this.headerNavigationService.getHeaderRowCount(),a=this.getHeaderPositionFromUserFunc({userFunc:t,direction:s,currentPosition:n,headerPosition:i,headerRowCount:r});return!!a&&this.focusProvidedHeaderPosition({headerPosition:a,direction:s,event:o})}getHeaderPositionFromUserFunc(e){const{userFunc:t,direction:i,currentPosition:s,headerPosition:o,headerRowCount:n}=e,r=t({backwards:"Before"===i,previousHeaderPosition:s,nextHeaderPosition:o,headerRowCount:n});return!0===r||null===r?(null===r&&co("Returning `null` from tabToNextHeader is deprecated. Return `true` to stay on the current header, or `false` to let the browser handle the tab behaviour."),s):!1===r?null:r}focusProvidedHeaderPosition(e){const{headerPosition:t,direction:i,fromCell:s,rowWithoutSpanValue:o,event:n}=e;if(-1===t.headerRowIndex)return this.filterManager.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(t):this.focusGridView(t.column);this.headerNavigationService.scrollToColumn(t.column,i);const r=this.ctrlsService.getHeaderRowContainerCtrl(t.column.getPinned()).focusHeader(t.headerRowIndex,t.column,n);return r&&(null!=o||s)&&this.headerNavigationService.setCurrentHeaderRowWithoutSpan(null!=o?o:-1),r}focusFirstHeader(){let e=this.columnModel.getAllDisplayedColumns()[0];if(!e)return!1;e.getParent()&&(e=this.columnModel.getColumnGroupAtLevel(e,0));const t=this.headerPositionUtils.getHeaderIndexToFocus(e,0);return this.focusHeaderPosition({headerPosition:t,rowWithoutSpanValue:0})}focusLastHeader(e){const t=this.headerNavigationService.getHeaderRowCount()-1,i=Jo(this.columnModel.getAllDisplayedColumns());return this.focusHeaderPosition({headerPosition:{headerRowIndex:t,column:i},rowWithoutSpanValue:-1,event:e})}focusPreviousFromFirstCell(e){return this.filterManager.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(null):this.focusLastHeader(e)}isAnyCellFocused(){return!!this.focusedCellPosition}isRowFocused(e,t){return null!=this.focusedCellPosition&&this.focusedCellPosition.rowIndex===e&&this.focusedCellPosition.rowPinned===Hs(t)}findFocusableElements(e,t,i=!1){const s=Pa;let o=Fa;t&&(o+=", "+t),i&&(o+=', [tabindex="-1"]');const n=Array.prototype.slice.apply(e.querySelectorAll(s)).filter((e=>ja(e))),r=Array.prototype.slice.apply(e.querySelectorAll(o));return r.length?(a=r,n.filter((e=>-1===a.indexOf(e)))):n;var a}focusInto(e,t=!1,i=!1){const s=this.findFocusableElements(e,null,i),o=t?Jo(s):s[0];return!!o&&(o.focus({preventScroll:!0}),!0)}findFocusableElementBeforeTabGuard(e,t){if(!t)return null;const i=this.findFocusableElements(e),s=i.indexOf(t);if(-1===s)return null;let o=-1;for(let e=s-1;e>=0;e--)if(i[e].classList.contains("ag-tab-guard-top")){o=e;break}return o<=0?null:i[o-1]}findNextFocusableElement(e=this.eGridDiv,t,i){const s=this.findFocusableElements(e,t?':not([tabindex="-1"])':null),o=this.gos.getActiveDomElement();let n;n=t?s.findIndex((e=>e.contains(o))):s.indexOf(o);const r=n+(i?-1:1);return r<0||r>=s.length?null:s[r]}isTargetUnderManagedComponent(e,t){if(!t)return!1;const i=e.querySelectorAll(`.${iu.FOCUS_MANAGED_CLASS}`);if(!i.length)return!1;for(let e=0;e<i.length;e++)if(i[e].contains(t))return!0;return!1}findTabbableParent(e,t=5){let i=0;for(;e&&null===na(e)&&++i<=t;)e=e.parentElement;return null===na(e)?null:e}focusGridView(e,t){var i;if(this.gos.get("suppressCellFocus"))return t?this.gos.get("suppressHeaderFocus")?this.focusNextGridCoreContainer(!0,!0):this.focusLastHeader():this.focusNextGridCoreContainer(!1);const s=t?this.rowPositionUtils.getLastRow():this.rowPositionUtils.getFirstRow();if(!s)return!1;const{rowIndex:o,rowPinned:n}=s,r=this.getFocusedHeader();return!e&&r&&(e=r.column),!(null==o||!e||(this.navigationService.ensureCellVisible({rowIndex:o,column:e,rowPinned:n}),this.setFocusedCell({rowIndex:o,column:e,rowPinned:Hs(n),forceBrowserFocus:!0}),null==(i=this.rangeService)||i.setRangeToCell({rowIndex:o,rowPinned:n,column:e}),0))}focusNextGridCoreContainer(e,t=!1){return!(t||!this.gridCtrl.focusNextInnerContainer(e))||((t||!e&&!this.gridCtrl.isDetailGrid())&&this.gridCtrl.forceFocusOutOfContainer(e),!1)}focusAdvancedFilter(e){var t,i;return this.advancedFilterFocusColumn=null==e?void 0:e.column,null!=(i=null==(t=this.advancedFilterService)?void 0:t.getCtrl().focusHeaderComp())&&i}focusNextFromAdvancedFilter(e,t){var i,s;const o=null!=(s=t?void 0:this.advancedFilterFocusColumn)?s:null==(i=this.columnModel.getAllDisplayedColumns())?void 0:i[0];return e?this.focusHeaderPosition({headerPosition:{column:o,headerRowIndex:this.headerNavigationService.getHeaderRowCount()-1}}):this.focusGridView(o)}clearAdvancedFilterColumn(){this.advancedFilterFocusColumn=void 0}};jp.keyboardModeActive=!1,jp.instanceCount=0,Gs([No("eGridDiv")],jp.prototype,"eGridDiv",2),Gs([No("columnModel")],jp.prototype,"columnModel",2),Gs([No("headerNavigationService")],jp.prototype,"headerNavigationService",2),Gs([No("headerPositionUtils")],jp.prototype,"headerPositionUtils",2),Gs([No("rowRenderer")],jp.prototype,"rowRenderer",2),Gs([No("rowPositionUtils")],jp.prototype,"rowPositionUtils",2),Gs([No("cellPositionUtils")],jp.prototype,"cellPositionUtils",2),Gs([No("navigationService")],jp.prototype,"navigationService",2),Gs([No("ctrlsService")],jp.prototype,"ctrlsService",2),Gs([No("filterManager")],jp.prototype,"filterManager",2),Gs([_o("rangeService")],jp.prototype,"rangeService",2),Gs([_o("advancedFilterService")],jp.prototype,"advancedFilterService",2),Gs([Lo],jp.prototype,"init",1),jp=Gs([Io("focusService")],jp);var Yp=class extends Pn{setMouseOver(e){this.selectedColumns=e;const t={type:In.EVENT_COLUMN_HOVER_CHANGED};this.eventService.dispatchEvent(t)}clearMouseOver(){this.selectedColumns=null;const e={type:In.EVENT_COLUMN_HOVER_CHANGED};this.eventService.dispatchEvent(e)}isHovered(e){return!!this.selectedColumns&&this.selectedColumns.indexOf(e)>=0}};Yp=Gs([Io("columnHoverService")],Yp);var qp=class extends Pn{constructor(){super(...arguments),this.executeNextFuncs=[],this.executeLaterFuncs=[],this.active=!1,this.suppressAnimation=!1,this.animationThreadCount=0}postConstruct(){this.ctrlsService.whenReady((e=>this.gridBodyCtrl=e.gridBodyCtrl))}isActive(){return this.active&&!this.suppressAnimation}setSuppressAnimation(e){this.suppressAnimation=e}start(){this.active||this.gos.get("suppressColumnMoveAnimation")||this.gos.get("enableRtl")||(this.ensureAnimationCssClassPresent(),this.active=!0)}finish(){this.active&&this.flush((()=>{this.active=!1}))}executeNextVMTurn(e){this.active?this.executeNextFuncs.push(e):e()}executeLaterVMTurn(e){this.active?this.executeLaterFuncs.push(e):e()}ensureAnimationCssClassPresent(){this.animationThreadCount++;const e=this.animationThreadCount;this.gridBodyCtrl.setColumnMovingCss(!0),this.executeLaterFuncs.push((()=>{this.animationThreadCount===e&&this.gridBodyCtrl.setColumnMovingCss(!1)}))}flush(e){if(0===this.executeNextFuncs.length&&0===this.executeLaterFuncs.length)return void e();const t=e=>{for(;e.length;){const t=e.pop();t&&t()}};this.getFrameworkOverrides().wrapIncoming((()=>{window.setTimeout((()=>t(this.executeNextFuncs)),0),window.setTimeout((()=>{e(),t(this.executeLaterFuncs)}),200)}))}};Gs([No("ctrlsService")],qp.prototype,"ctrlsService",2),Gs([Lo],qp.prototype,"postConstruct",1),qp=Gs([Io("columnAnimationService")],qp);var Xp=class extends Pn{postConstruct(){this.ctrlsService.whenReady((e=>{this.centerRowsCtrl=e.center,this.addManagedListener(this.eventService,In.EVENT_BODY_HEIGHT_CHANGED,this.checkPageSize.bind(this)),this.addManagedListener(this.eventService,In.EVENT_SCROLL_VISIBILITY_CHANGED,this.checkPageSize.bind(this)),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()}))}notActive(){return!this.gos.get("paginationAutoPageSize")||null==this.centerRowsCtrl}onPaginationAutoSizeChanged(){this.notActive()?this.paginationProxy.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.getViewportSizeFeature().getBodyHeight();if(e>0){const t=()=>{const t=this.gos.getRowHeightAsNumber(),i=Math.floor(e/t);this.paginationProxy.setPageSize(i,"autoCalculated")};this.isBodyRendered?Eo((()=>t()),50)():(t(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}};Gs([No("ctrlsService")],Xp.prototype,"ctrlsService",2),Gs([No("paginationProxy")],Xp.prototype,"paginationProxy",2),Gs([Lo],Xp.prototype,"postConstruct",1),Xp=Gs([Io("paginationAutoPageSizeService")],Xp);var Qp=class extends Pn{constructor(){super(...arguments),this.cacheVersion=0}init(){this.active=this.gos.get("valueCache"),this.neverExpires=this.gos.get("valueCacheNeverExpires")}onDataChanged(){this.neverExpires||this.expire()}expire(){this.cacheVersion++}setValue(e,t,i){this.active&&(e.__cacheVersion!==this.cacheVersion&&(e.__cacheVersion=this.cacheVersion,e.__cacheData={}),e.__cacheData[t]=i)}getValue(e,t){if(this.active&&e.__cacheVersion===this.cacheVersion)return e.__cacheData[t]}};Gs([Lo],Qp.prototype,"init",1),Qp=Gs([Io("valueCache")],Qp);var Jp=class extends Pn{init(){"clientSide"===this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel),this.addManagedListener(this.eventService,In.EVENT_CELL_VALUE_CHANGED,this.onCellValueChanged.bind(this))}onCellValueChanged(e){"paste"!==e.source&&this.doChangeDetection(e.node,e.column)}doChangeDetection(e,t){if(this.gos.get("suppressChangeDetection"))return;const i=[e];if(this.clientSideRowModel&&!e.isRowPinned()){const s=this.gos.get("aggregateOnlyChangedColumns"),o=new Qc(s,this.clientSideRowModel.getRootNode());o.addParentNode(e.parent,[t]),this.clientSideRowModel.doAggregate(o),o.forEachChangedNodeDepthFirst((e=>{i.push(e)}))}this.rowRenderer.refreshCells({rowNodes:i})}};Gs([No("rowModel")],Jp.prototype,"rowModel",2),Gs([No("rowRenderer")],Jp.prototype,"rowRenderer",2),Gs([Lo],Jp.prototype,"init",1),Jp=Gs([Io("changeDetectionService")],Jp);var Zp=class extends Pn{adaptFunction(e,t){const i=this.componentMetadataProvider.retrieve(e);return i&&i.functionAdapter?i.functionAdapter(t):null}adaptCellRendererFunction(e){return class{refresh(e){return!1}getGui(){return this.eGui}init(t){const i=e(t),s=typeof i;this.eGui="string"!==s&&"number"!==s&&"boolean"!==s?null!=i?i:Ya("<span></span>"):Ya("<span>"+i+"</span>")}}}doesImplementIComponent(e){return!!e&&e.prototype&&"getGui"in e.prototype}};Gs([No("componentMetadataProvider")],Zp.prototype,"componentMetadataProvider",2),Zp=Gs([Io("agComponentUtils")],Zp);var eg=class extends Pn{postConstruct(){this.componentMetaData={dateComponent:{mandatoryMethodList:["getDate","setDate"],optionalMethodList:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","onParamsUpdated","refresh"]},detailCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},headerComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},headerGroupComponent:{mandatoryMethodList:[],optionalMethodList:[]},loadingCellRenderer:{mandatoryMethodList:[],optionalMethodList:[],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},loadingOverlayComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},noRowsOverlayComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},floatingFilterComponent:{mandatoryMethodList:["onParentModelChanged"],optionalMethodList:["afterGuiAttached","onParamsUpdated","refresh"]},cellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},cellEditor:{mandatoryMethodList:["getValue"],optionalMethodList:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},innerRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},fullWidthCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},groupRowRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},filter:{mandatoryMethodList:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethodList:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},statusPanel:{mandatoryMethodList:[],optionalMethodList:["refresh"]},toolPanel:{mandatoryMethodList:[],optionalMethodList:["refresh","getState"]},tooltipComponent:{mandatoryMethodList:[],optionalMethodList:[]},menuItem:{mandatoryMethodList:[],optionalMethodList:["setActive","select","setExpanded","configureDefaults"]}}}retrieve(e){return this.componentMetaData[e]}};Gs([No("agComponentUtils")],eg.prototype,"agComponentUtils",2),Gs([Lo],eg.prototype,"postConstruct",1),eg=Gs([Io("componentMetadataProvider")],eg);var tg={"ag-theme-custom":{headerHeight:25,headerCellMinWidth:24,listItemHeight:20,rowHeight:25,chartMenuPanelWidth:220},"ag-theme-material":{headerHeight:56,headerCellMinWidth:48,listItemHeight:32,rowHeight:48,chartMenuPanelWidth:240},"ag-theme-balham":{headerHeight:32,headerCellMinWidth:24,listItemHeight:24,rowHeight:28,chartMenuPanelWidth:220},"ag-theme-alpine":{headerHeight:48,headerCellMinWidth:36,listItemHeight:24,rowHeight:42,chartMenuPanelWidth:240},"ag-theme-quartz":{headerHeight:48,headerCellMinWidth:36,listItemHeight:24,rowHeight:42,chartMenuPanelWidth:260}},ig={headerHeight:["ag-header-row"],headerCellMinWidth:["ag-header-cell"],listItemHeight:["ag-virtual-list-item"],rowHeight:["ag-row"],chartMenuPanelWidth:["ag-chart-docked-container"]},sg=class extends Pn{constructor(){super(...arguments),this.calculatedSizes={},this.calculatedTheme=null}postConstruct(){var e;const t=null!=(e=this.getTheme().el)?e:this.eGridDiv;this.addManagedPropertyListener("rowHeight",(()=>this.refreshRowHeightVariable())),this.mutationObserver=new MutationObserver((()=>{this.calculatedSizes={},this.calculatedTheme=null,this.calculatedTheme=this.getTheme(),this.fireGridStylesChangedEvent()})),this.mutationObserver.observe(t||this.eGridDiv,{attributes:!0,attributeFilter:["class"]})}fireGridStylesChangedEvent(){const e={type:In.EVENT_GRID_STYLES_CHANGED};this.eventService.dispatchEvent(e)}getSassVariable(e){const{themeFamily:t,el:i}=this.getTheme();if(!t||0!==t.indexOf("ag-theme"))return;this.calculatedSizes||(this.calculatedSizes={}),this.calculatedSizes[t]||(this.calculatedSizes[t]={});const s=this.calculatedSizes[t][e];return null!=s?s:(this.calculatedSizes[t][e]=this.calculateValueForSassProperty(e,t,i),this.calculatedSizes[t][e])}calculateValueForSassProperty(e,t,i){const s="ag-theme-"+(t.match("material")?"material":t.match("balham")?"balham":t.match("alpine")?"alpine":"custom"),o=tg[s][e],n=this.gos.getDocument();if(i||(i=this.eGridDiv),!ig[e])return o;const r=ig[e],a=n.createElement("div"),l=Array.from(i.classList);a.classList.add(t,...l),a.style.position="absolute";const u=r.reduce(((e,t)=>{const i=n.createElement("div");return i.style.position="static",i.classList.add(t),e.appendChild(i),i}),a);let h=0;if(n.body){n.body.appendChild(a);const t=-1!==e.toLowerCase().indexOf("height")?"height":"width";h=parseInt(window.getComputedStyle(u)[t],10),n.body.removeChild(a)}return h||o}isThemeDark(){const{theme:e}=this.getTheme();return!!e&&e.indexOf("dark")>=0}chartMenuPanelWidth(){return this.getSassVariable("chartMenuPanelWidth")}getTheme(){if(this.calculatedTheme)return this.calculatedTheme;const e=/\bag-(material|(?:theme-([\w\-]*)))\b/g;let t=this.eGridDiv,i=null,s=[];for(;t;){if(i=e.exec(t.className),i){const i=t.className.match(e);i&&(s=i);break}t=t.parentElement||void 0}if(!i)return{allThemes:s};const o=i[0];return this.calculatedTheme={theme:o,el:t,themeFamily:o.replace(/-dark$/,""),allThemes:s},this.calculatedTheme}getFromTheme(e,t){var i;return null!=(i=this.getSassVariable(t))?i:e}getDefaultRowHeight(){return this.getFromTheme(25,"rowHeight")}getListItemHeight(){return this.getFromTheme(20,"listItemHeight")}refreshRowHeightVariable(){const e=this.eGridDiv.style.getPropertyValue("--ag-line-height").trim(),t=this.gos.get("rowHeight");if(null==t||isNaN(t)||!isFinite(t))return null!==e&&this.eGridDiv.style.setProperty("--ag-line-height",null),-1;const i=`${t}px`;return e!=i?(this.eGridDiv.style.setProperty("--ag-line-height",i),t):""!=e?parseFloat(e):-1}getMinColWidth(){const e=this.getFromTheme(null,"headerCellMinWidth");return Bs(e)?Math.max(e,10):10}destroy(){this.calculatedSizes=null,this.mutationObserver&&this.mutationObserver.disconnect(),super.destroy()}};Gs([No("eGridDiv")],sg.prototype,"eGridDiv",2),Gs([Lo],sg.prototype,"postConstruct",1),sg=Gs([Io("environment")],sg);var og=class extends Pn{constructor(){super(...arguments),this.scrollY=0,this.uiBodyHeight=0}agWire(e){this.logger=e.create("RowContainerHeightService")}postConstruct(){this.addManagedListener(this.eventService,In.EVENT_BODY_HEIGHT_CHANGED,this.updateOffset.bind(this)),this.maxDivHeight=ra(),this.logger.log("maxDivHeight = "+this.maxDivHeight)}isStretching(){return this.stretching}getDivStretchOffset(){return this.divStretchOffset}updateOffset(){if(!this.stretching)return;const e=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition().top,t=this.getUiBodyHeight();(e!==this.scrollY||t!==this.uiBodyHeight)&&(this.scrollY=e,this.uiBodyHeight=t,this.calculateOffset())}calculateOffset(){this.setUiContainerHeight(this.maxDivHeight),this.pixelsToShave=this.modelHeight-this.uiContainerHeight,this.maxScrollY=this.uiContainerHeight-this.uiBodyHeight;const e=this.scrollY/this.maxScrollY,t=e*this.pixelsToShave;this.logger.log(`Div Stretch Offset = ${t} (${this.pixelsToShave} * ${e})`),this.setDivStretchOffset(t)}setUiContainerHeight(e){e!==this.uiContainerHeight&&(this.uiContainerHeight=e,this.eventService.dispatchEvent({type:In.EVENT_ROW_CONTAINER_HEIGHT_CHANGED}))}clearOffset(){this.setUiContainerHeight(this.modelHeight),this.pixelsToShave=0,this.setDivStretchOffset(0)}setDivStretchOffset(e){const t="number"==typeof e?Math.floor(e):null;this.divStretchOffset!==t&&(this.divStretchOffset=t,this.eventService.dispatchEvent({type:In.EVENT_HEIGHT_SCALE_CHANGED}))}setModelHeight(e){this.modelHeight=e,this.stretching=null!=e&&this.maxDivHeight>0&&e>this.maxDivHeight,this.stretching?this.calculateOffset():this.clearOffset()}getUiContainerHeight(){return this.uiContainerHeight}getRealPixelPosition(e){return e-this.divStretchOffset}getUiBodyHeight(){const e=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition();return e.bottom-e.top}getScrollPositionForPixel(e){if(this.pixelsToShave<=0)return e;const t=e/(this.modelHeight-this.getUiBodyHeight());return this.maxScrollY*t}};Gs([No("ctrlsService")],og.prototype,"ctrlsService",2),Gs([ks(0,Go("loggerFactory"))],og.prototype,"agWire",1),Gs([Lo],og.prototype,"postConstruct",1),og=Gs([Io("rowContainerHeightService")],og);var ng=class extends Pn{init(){this.addManagedPropertyListener("isRowSelectable",(()=>this.updateSelectable()))}updateSelectableAfterGrouping(){this.updateSelectable(!0)}updateSelectable(e=!1){const t=!!this.gos.get("rowSelection"),i=this.gos.get("isRowSelectable");if(!t||!i)return;const s=this.gos.get("groupSelectsChildren"),o="clientSide"===this.rowModel.getType()&&s,n=[],r=t=>{if(e&&!t.group)return;if(o&&t.group){const e=t.childrenAfterGroup.some((e=>!0===e.selectable));return void t.setRowSelectable(e,!0)}const s=!i||i(t);t.setRowSelectable(s,!0),!s&&t.isSelected()&&n.push(t)};if(o){const e=this.rowModel;new Qc(!1,e.getRootNode()).forEachChangedNodeDepthFirst(r,!0,!0)}else this.rowModel.forEachNode(r);n.length&&this.selectionService.setNodesSelected({nodes:n,newValue:!1,source:"selectableChanged"}),o&&this.selectionService instanceof kp&&this.selectionService.updateGroupsFromChildrenSelections("selectableChanged")}};Gs([No("rowModel")],ng.prototype,"rowModel",2),Gs([No("selectionService")],ng.prototype,"selectionService",2),Gs([Lo],ng.prototype,"init",1),ng=Gs([Io("selectableService")],ng);var rg=class extends Yl{constructor(){super(),this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1}postConstruct(){const e=this.gos.get("enableRtl");this.setTemplate(this.getTemplate());const{btFirst:t,btPrevious:i,btNext:s,btLast:o,pageSizeComp:n}=this;this.activateTabIndex([t,i,s,o]),t.insertAdjacentElement("afterbegin",wl(e?"last":"first",this.gos)),i.insertAdjacentElement("afterbegin",wl(e?"next":"previous",this.gos)),s.insertAdjacentElement("afterbegin",wl(e?"previous":"next",this.gos)),o.insertAdjacentElement("afterbegin",wl(e?"first":"last",this.gos)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],(()=>this.onPageSizeRelatedOptionsChange())),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.onPaginationChanged()}onPaginationChanged(){const e=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(e),e&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateRowLabels(),this.setCurrentPageLabel(),this.setTotalLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){this.areListenersSetup||(this.addManagedListener(this.eventService,In.EVENT_PAGINATION_CHANGED,this.onPaginationChanged.bind(this)),[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}].forEach((e=>{const{el:t,fn:i}=e;this.addManagedListener(t,"click",i),this.addManagedListener(t,"keydown",(e=>{e.key!==El.ENTER&&e.key!==El.SPACE||(e.preventDefault(),i())}))})),this.areListenersSetup=!0)}onBtFirst(){this.previousAndFirstButtonsDisabled||this.paginationProxy.goToFirstPage()}setCurrentPageLabel(){const e=this.paginationProxy.getTotalPages()>0,t=this.paginationProxy.getCurrentPage(),i=e?t+1:0;this.lbCurrent.textContent=this.formatNumber(i)}formatNumber(e){const t=this.gos.getCallback("paginationNumberFormatter");if(t)return t({value:e});const i=this.localeService.getLocaleTextFunc();return wa(e,i("thousandSeparator",","),i("decimalSeparator","."))}getTemplate(){const e=this.localeService.getLocaleTextFunc(),t=e("page","Page"),i=e("to","to"),s=e("of","of"),o=e("firstPage","First Page"),n=e("previousPage","Previous Page"),r=e("nextPage","Next Page"),a=e("lastPage","Last Page"),l=this.getCompId();return`<div class="ag-paging-panel ag-unselectable" id="ag-${l}">\n <ag-page-size-selector ref="pageSizeComp"></ag-page-size-selector>\n <span class="ag-paging-row-summary-panel" role="status">\n <span id="ag-${l}-first-row" ref="lbFirstRowOnPage" class="ag-paging-row-summary-panel-number"></span>\n <span id="ag-${l}-to">${i}</span>\n <span id="ag-${l}-last-row" ref="lbLastRowOnPage" class="ag-paging-row-summary-panel-number"></span>\n <span id="ag-${l}-of">${s}</span>\n <span id="ag-${l}-row-count" ref="lbRecordCount" class="ag-paging-row-summary-panel-number"></span>\n </span>\n <span class="ag-paging-page-summary-panel" role="presentation">\n <div ref="btFirst" class="ag-button ag-paging-button" role="button" aria-label="${o}"></div>\n <div ref="btPrevious" class="ag-button ag-paging-button" role="button" aria-label="${n}"></div>\n <span class="ag-paging-description" role="status">\n <span id="ag-${l}-start-page">${t}</span>\n <span id="ag-${l}-start-page-number" ref="lbCurrent" class="ag-paging-number"></span>\n <span id="ag-${l}-of-page">${s}</span>\n <span id="ag-${l}-of-page-number" ref="lbTotal" class="ag-paging-number"></span>\n </span>\n <div ref="btNext" class="ag-button ag-paging-button" role="button" aria-label="${r}"></div>\n <div ref="btLast" class="ag-button ag-paging-button" role="button" aria-label="${a}"></div>\n </span>\n </div>`}onBtNext(){this.nextButtonDisabled||this.paginationProxy.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.paginationProxy.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.paginationProxy.goToLastPage()}enableOrDisableButtons(){const e=this.paginationProxy.getCurrentPage(),t=this.paginationProxy.isLastPageFound(),i=this.paginationProxy.getTotalPages();this.previousAndFirstButtonsDisabled=0===e,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const s=this.isZeroPagesToDisplay(),o=e===i-1;this.nextButtonDisabled=o||s,this.lastButtonDisabled=!t||s||e===i-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){Rr(e,t),e.classList.toggle("ag-disabled",t)}updateRowLabels(){const e=this.paginationProxy.getCurrentPage(),t=this.paginationProxy.getPageSize(),i=this.paginationProxy.isLastPageFound(),s=this.paginationProxy.isLastPageFound()?this.paginationProxy.getMasterRowCount():null;let o,n;if(this.isZeroPagesToDisplay()?o=n=0:(o=t*e+1,n=o+t-1,i&&n>s&&(n=s)),this.lbFirstRowOnPage.textContent=this.formatNumber(o),this.rowNodeBlockLoader.isLoading()){const e=this.localeService.getLocaleTextFunc();this.lbLastRowOnPage.innerHTML=e("pageLastRowUnknown","?")}else this.lbLastRowOnPage.textContent=this.formatNumber(n)}isZeroPagesToDisplay(){const e=this.paginationProxy.isLastPageFound(),t=this.paginationProxy.getTotalPages();return e&&0===t}setTotalLabels(){const e=this.paginationProxy.isLastPageFound(),t=this.paginationProxy.getTotalPages(),i=e?this.paginationProxy.getMasterRowCount():null;if(1===i){const e=this.paginationProxy.getRow(0);if(e&&e.group&&!e.groupData&&!e.aggData)return void this.setTotalLabelsToZero()}if(e)this.lbTotal.textContent=this.formatNumber(t),this.lbRecordCount.textContent=this.formatNumber(i);else{const e=this.localeService.getLocaleTextFunc()("more","more");this.lbTotal.innerHTML=e,this.lbRecordCount.innerHTML=e}}setTotalLabelsToZero(){this.lbFirstRowOnPage.textContent=this.formatNumber(0),this.lbCurrent.textContent=this.formatNumber(0),this.lbLastRowOnPage.textContent=this.formatNumber(0),this.lbTotal.textContent=this.formatNumber(0),this.lbRecordCount.textContent=this.formatNumber(0)}};Gs([No("paginationProxy")],rg.prototype,"paginationProxy",2),Gs([No("rowNodeBlockLoader")],rg.prototype,"rowNodeBlockLoader",2),Gs([ql("btFirst")],rg.prototype,"btFirst",2),Gs([ql("btPrevious")],rg.prototype,"btPrevious",2),Gs([ql("btNext")],rg.prototype,"btNext",2),Gs([ql("btLast")],rg.prototype,"btLast",2),Gs([ql("lbRecordCount")],rg.prototype,"lbRecordCount",2),Gs([ql("lbFirstRowOnPage")],rg.prototype,"lbFirstRowOnPage",2),Gs([ql("lbLastRowOnPage")],rg.prototype,"lbLastRowOnPage",2),Gs([ql("lbCurrent")],rg.prototype,"lbCurrent",2),Gs([ql("lbTotal")],rg.prototype,"lbTotal",2),Gs([ql("pageSizeComp")],rg.prototype,"pageSizeComp",2),Gs([Lo],rg.prototype,"postConstruct",1);var ag=class e extends Yl{constructor(){super(e.TEMPLATE),this.inProgress=!1,this.destroyRequested=!1}updateLayoutClasses(e,t){const i=this.eOverlayWrapper.classList;i.toggle("ag-layout-auto-height",t.autoHeight),i.toggle("ag-layout-normal",t.normal),i.toggle("ag-layout-print",t.print)}postConstruct(){this.createManagedBean(new vd(this)),this.setDisplayed(!1,{skipAriaHidden:!0}),this.overlayService.registerOverlayWrapperComp(this)}setWrapperTypeClass(e){const t=this.eOverlayWrapper.classList;this.activeOverlayWrapperCssClass&&t.toggle(this.activeOverlayWrapperCssClass,!1),this.activeOverlayWrapperCssClass=e,t.toggle(e,!0)}showOverlay(e,t,i){this.inProgress||(this.setWrapperTypeClass(t),this.destroyActiveOverlay(),this.inProgress=!0,e&&e.then((e=>{this.inProgress=!1,this.eOverlayWrapper.appendChild(e.getGui()),this.activeOverlay=e,this.updateListenerDestroyFunc=i,this.destroyRequested&&(this.destroyRequested=!1,this.destroyActiveOverlay())})),this.setDisplayed(!0,{skipAriaHidden:!0}))}destroyActiveOverlay(){var e;this.inProgress?this.destroyRequested=!0:this.activeOverlay&&(this.activeOverlay=this.getContext().destroyBean(this.activeOverlay),null==(e=this.updateListenerDestroyFunc)||e.call(this),za(this.eOverlayWrapper))}hideOverlay(){this.destroyActiveOverlay(),this.setDisplayed(!1,{skipAriaHidden:!0})}destroy(){this.destroyActiveOverlay(),super.destroy()}};ag.TEMPLATE='\n <div class="ag-overlay" role="presentation">\n <div class="ag-overlay-panel" role="presentation">\n <div class="ag-overlay-wrapper" ref="eOverlayWrapper" role="presentation"></div>\n </div>\n </div>',Gs([No("overlayService")],ag.prototype,"overlayService",2),Gs([ql("eOverlayWrapper")],ag.prototype,"eOverlayWrapper",2),Gs([Lo],ag.prototype,"postConstruct",1);var lg=ag,ug=class extends Pn{getFirstRow(){let e,t=0;return this.pinnedRowModel.getPinnedTopRowCount()?e="top":this.rowModel.getRowCount()?(e=null,t=this.paginationProxy.getPageFirstRow()):this.pinnedRowModel.getPinnedBottomRowCount()&&(e="bottom"),void 0===e?null:{rowIndex:t,rowPinned:e}}getLastRow(){let e,t=null;const i=this.pinnedRowModel.getPinnedBottomRowCount(),s=this.pinnedRowModel.getPinnedTopRowCount();return i?(t="bottom",e=i-1):this.rowModel.getRowCount()?(t=null,e=this.paginationProxy.getPageLastRow()):s&&(t="top",e=s-1),void 0===e?null:{rowIndex:e,rowPinned:t}}getRowNode(e){switch(e.rowPinned){case"top":return this.pinnedRowModel.getPinnedTopRowData()[e.rowIndex];case"bottom":return this.pinnedRowModel.getPinnedBottomRowData()[e.rowIndex];default:return this.rowModel.getRow(e.rowIndex)}}sameRow(e,t){return!e&&!t||!(e&&!t||!e&&t)&&e.rowIndex===t.rowIndex&&e.rowPinned==t.rowPinned}before(e,t){switch(e.rowPinned){case"top":if("top"!==t.rowPinned)return!0;break;case"bottom":if("bottom"!==t.rowPinned)return!1;break;default:if(Bs(t.rowPinned))return"top"!==t.rowPinned}return e.rowIndex<t.rowIndex}};Gs([No("rowModel")],ug.prototype,"rowModel",2),Gs([No("pinnedRowModel")],ug.prototype,"pinnedRowModel",2),Gs([No("paginationProxy")],ug.prototype,"paginationProxy",2),ug=Gs([Io("rowPositionUtils")],ug);var hg=class extends Pn{createId(e){const{rowIndex:t,rowPinned:i,column:s}=e;return this.createIdFromValues({rowIndex:t,column:s,rowPinned:i})}createIdFromValues(e){const{rowIndex:t,rowPinned:i,column:s}=e;return`${t}.${null==i?"null":i}.${s.getId()}`}equals(e,t){const i=e.column===t.column,s=e.rowPinned===t.rowPinned,o=e.rowIndex===t.rowIndex;return i&&s&&o}};hg=Gs([Io("cellPositionUtils")],hg);var dg=class{constructor(e){this.cellValueChanges=e}},cg=class extends dg{constructor(e,t,i,s){super(e),this.initialRange=t,this.finalRange=i,this.ranges=s}},pg=class e{constructor(t){this.actionStack=[],this.maxStackSize=t||e.DEFAULT_STACK_SIZE,this.actionStack=new Array(this.maxStackSize)}pop(){return this.actionStack.pop()}push(e){e.cellValueChanges&&e.cellValueChanges.length>0&&(this.actionStack.length===this.maxStackSize&&this.actionStack.shift(),this.actionStack.push(e))}clear(){this.actionStack=[]}getCurrentStackSize(){return this.actionStack.length}};pg.DEFAULT_STACK_SIZE=10;var gg=pg,mg=class extends Pn{constructor(){super(...arguments),this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.onCellValueChanged=e=>{const t={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned},i=null!==this.activeCellEdit&&this.cellPositionUtils.equals(this.activeCellEdit,t),s=null!==this.activeRowEdit&&this.rowPositionUtils.sameRow(this.activeRowEdit,t);if(!(i||s||this.isPasting||this.isRangeInAction))return;const{rowPinned:o,rowIndex:n,column:r,oldValue:a,value:l}=e,u={rowPinned:o,rowIndex:n,columnId:r.getColId(),newValue:l,oldValue:a};this.cellValueChanges.push(u)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}init(){if(!this.gos.get("undoRedoCellEditing"))return;const e=this.gos.get("undoRedoCellEditingLimit");e<=0||(this.undoStack=new gg(e),this.redoStack=new gg(e),this.addRowEditingListeners(),this.addCellEditingListeners(),this.addPasteListeners(),this.addFillListeners(),this.addCellKeyListeners(),this.addManagedListener(this.eventService,In.EVENT_CELL_VALUE_CHANGED,this.onCellValueChanged),this.addManagedListener(this.eventService,In.EVENT_MODEL_UPDATED,(e=>{e.keepUndoRedoStack||this.clearStacks()})),this.addManagedListener(this.eventService,In.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.clearStacks),this.addManagedListener(this.eventService,In.EVENT_NEW_COLUMNS_LOADED,this.clearStacks),this.addManagedListener(this.eventService,In.EVENT_COLUMN_GROUP_OPENED,this.clearStacks),this.addManagedListener(this.eventService,In.EVENT_COLUMN_ROW_GROUP_CHANGED,this.clearStacks),this.addManagedListener(this.eventService,In.EVENT_COLUMN_MOVED,this.clearStacks),this.addManagedListener(this.eventService,In.EVENT_COLUMN_PINNED,this.clearStacks),this.addManagedListener(this.eventService,In.EVENT_COLUMN_VISIBLE,this.clearStacks),this.addManagedListener(this.eventService,In.EVENT_ROW_DRAG_END,this.clearStacks),this.ctrlsService.whenReady((e=>{this.gridBodyCtrl=e.gridBodyCtrl})))}getCurrentUndoStackSize(){return this.undoStack?this.undoStack.getCurrentStackSize():0}getCurrentRedoStackSize(){return this.redoStack?this.redoStack.getCurrentStackSize():0}undo(e){const t={type:In.EVENT_UNDO_STARTED,source:e};this.eventService.dispatchEvent(t);const i=this.undoRedo(this.undoStack,this.redoStack,"initialRange","oldValue","undo"),s={type:In.EVENT_UNDO_ENDED,source:e,operationPerformed:i};this.eventService.dispatchEvent(s)}redo(e){const t={type:In.EVENT_REDO_STARTED,source:e};this.eventService.dispatchEvent(t);const i=this.undoRedo(this.redoStack,this.undoStack,"finalRange","newValue","redo"),s={type:In.EVENT_REDO_ENDED,source:e,operationPerformed:i};this.eventService.dispatchEvent(s)}undoRedo(e,t,i,s,o){if(!e)return!1;const n=e.pop();return!(!n||!n.cellValueChanges||(this.processAction(n,(e=>e[s]),o),n instanceof cg?this.processRange(this.rangeService,n.ranges||[n[i]]):this.processCell(n.cellValueChanges),t.push(n),0))}processAction(e,t,i){e.cellValueChanges.forEach((e=>{const{rowIndex:s,rowPinned:o,columnId:n}=e,r={rowIndex:s,rowPinned:o},a=this.rowPositionUtils.getRowNode(r);a.displayed&&a.setDataValue(n,t(e),i)}))}processRange(e,t){let i;e.removeAllCellRanges(!0),t.forEach(((s,o)=>{if(!s)return;const n=s.startRow,r=s.endRow;o===t.length-1&&(i={rowPinned:n.rowPinned,rowIndex:n.rowIndex,columnId:s.startColumn.getColId()},this.setLastFocusedCell(i));const a={rowStartIndex:n.rowIndex,rowStartPinned:n.rowPinned,rowEndIndex:r.rowIndex,rowEndPinned:r.rowPinned,columnStart:s.startColumn,columns:s.columns};e.addCellRange(a)}))}processCell(e){const t=e[0],{rowIndex:i,rowPinned:s}=t,o={rowIndex:i,rowPinned:s},n=this.rowPositionUtils.getRowNode(o),r={rowPinned:t.rowPinned,rowIndex:n.rowIndex,columnId:t.columnId};this.setLastFocusedCell(r,this.rangeService)}setLastFocusedCell(e,t){const{rowIndex:i,columnId:s,rowPinned:o}=e,n=this.gridBodyCtrl.getScrollFeature(),r=this.columnModel.getGridColumn(s);if(!r)return;n.ensureIndexVisible(i),n.ensureColumnVisible(r);const a={rowIndex:i,column:r,rowPinned:o};this.focusService.setFocusedCell(_s(Ns({},a),{forceBrowserFocus:!0})),null==t||t.setRangeToCell(a)}addRowEditingListeners(){this.addManagedListener(this.eventService,In.EVENT_ROW_EDITING_STARTED,(e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}})),this.addManagedListener(this.eventService,In.EVENT_ROW_EDITING_STOPPED,(()=>{const e=new dg(this.cellValueChanges);this.pushActionsToUndoStack(e),this.activeRowEdit=null}))}addCellEditingListeners(){this.addManagedListener(this.eventService,In.EVENT_CELL_EDITING_STARTED,(e=>{this.activeCellEdit={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned}})),this.addManagedListener(this.eventService,In.EVENT_CELL_EDITING_STOPPED,(e=>{if(this.activeCellEdit=null,e.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const e=new dg(this.cellValueChanges);this.pushActionsToUndoStack(e)}}))}addPasteListeners(){this.addManagedListener(this.eventService,In.EVENT_PASTE_START,(()=>{this.isPasting=!0})),this.addManagedListener(this.eventService,In.EVENT_PASTE_END,(()=>{const e=new dg(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1}))}addFillListeners(){this.addManagedListener(this.eventService,In.EVENT_FILL_START,(()=>{this.isRangeInAction=!0})),this.addManagedListener(this.eventService,In.EVENT_FILL_END,(e=>{const t=new cg(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1}))}addCellKeyListeners(){this.addManagedListener(this.eventService,In.EVENT_KEY_SHORTCUT_CHANGED_CELL_START,(()=>{this.isRangeInAction=!0})),this.addManagedListener(this.eventService,In.EVENT_KEY_SHORTCUT_CHANGED_CELL_END,(()=>{let e;e=this.rangeService&&this.gos.get("enableRangeSelection")?new cg(this.cellValueChanges,void 0,void 0,[...this.rangeService.getCellRanges()]):new dg(this.cellValueChanges),this.pushActionsToUndoStack(e),this.isRangeInAction=!1}))}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}};Gs([No("focusService")],mg.prototype,"focusService",2),Gs([No("ctrlsService")],mg.prototype,"ctrlsService",2),Gs([No("cellPositionUtils")],mg.prototype,"cellPositionUtils",2),Gs([No("rowPositionUtils")],mg.prototype,"rowPositionUtils",2),Gs([No("columnModel")],mg.prototype,"columnModel",2),Gs([_o("rangeService")],mg.prototype,"rangeService",2),Gs([Lo],mg.prototype,"init",1),mg=Gs([Io("undoRedoService")],mg);var fg=class extends Pn{findHeader(e,t){let i,s;if(e.column instanceof xn?i=this.columnModel.getDisplayedGroupAtDirection(e.column,t):(s=`getDisplayedCol${t}`,i=this.columnModel[s](e.column)),!i)return;let{headerRowIndex:o}=e;if("filter"!==this.getHeaderRowType(o)){const e=[i];for(;i.getParent();)i=i.getParent(),e.push(i);i=e[e.length-1-o]}const{column:n,headerRowIndex:r}=this.getHeaderIndexToFocus(i,o);return{column:n,headerRowIndex:r}}getHeaderIndexToFocus(e,t){let i;if(e instanceof xn&&this.isAnyChildSpanningHeaderHeight(e)&&e.isPadding()){const s=e;i=s.getLeafColumns()[0];let o=i;for(;o!==s;)t++,o=o.getParent()}return{column:i||e,headerRowIndex:t}}isAnyChildSpanningHeaderHeight(e){return!!e&&e.getLeafColumns().some((e=>e.isSpanHeaderHeight()))}getColumnVisibleParent(e,t){const i=this.getHeaderRowType(t),s="column"===i;let o="filter"===i?e:e.getParent(),n=t-1,r=n;if(s&&this.isAnyChildSpanningHeaderHeight(e.getParent())){for(;o&&o.isPadding();)o=o.getParent(),n--;r=n,n<0&&(o=e,n=t,r=void 0)}return{column:o,headerRowIndex:n,headerRowIndexWithoutSpan:r}}getColumnVisibleChild(e,t,i="After"){let s=e,o=t+1,n=o;if("group"===this.getHeaderRowType(t)){const t=e.getDisplayedLeafColumns(),n="After"===i?t[0]:Jo(t),r=[];let a=n;for(;a.getParent()!==e;)a=a.getParent(),r.push(a);if(s=n,n.isSpanHeaderHeight())for(let e=r.length-1;e>=0;e--){const t=r[e];if(!t.isPadding()){s=t;break}o++}else s=Jo(r),s||(s=n)}return{column:s,headerRowIndex:o,headerRowIndexWithoutSpan:n}}getHeaderRowType(e){const t=this.ctrlsService.getHeaderRowContainerCtrl();if(t)return t.getRowType(e)}findColAtEdgeForHeaderRow(e,t){const i=this.columnModel.getAllDisplayedColumns(),s=i["start"===t?0:i.length-1];if(!s)return;const o=this.ctrlsService.getHeaderRowContainerCtrl(s.getPinned()).getRowType(e);return"group"==o?{headerRowIndex:e,column:this.columnModel.getColumnGroupAtLevel(s,e)}:{headerRowIndex:null==o?-1:e,column:s}}};Gs([No("columnModel")],fg.prototype,"columnModel",2),Gs([No("ctrlsService")],fg.prototype,"ctrlsService",2),fg=Gs([Io("headerPositionUtils")],fg);var Cg=class{buildColumnDefs(e,t,i){const s=[],o={};return e.forEach((e=>{let n=!0,r=this.createDefFromColumn(e,t,i),a=e.getOriginalParent(),l=null;for(;a;){let e=null;if(a.isPadding()){a=a.getOriginalParent();continue}const t=o[a.getGroupId()];if(t){t.children.push(r),n=!1;break}if(e=this.createDefFromGroup(a),e&&(e.children=[r],o[e.groupId]=e,r=e,a=a.getOriginalParent()),null!=a&&l===a){n=!1;break}l=a}n&&s.push(r)})),s}createDefFromGroup(e){const t=io(e.getColGroupDef(),["children"]);return t&&(t.groupId=e.getGroupId()),t}createDefFromColumn(e,t,i){const s=io(e.getColDef());return s.colId=e.getColId(),s.width=e.getActualWidth(),s.rowGroup=e.isRowGroupActive(),s.rowGroupIndex=e.isRowGroupActive()?t.indexOf(e):null,s.pivot=e.isPivotActive(),s.pivotIndex=e.isPivotActive()?i.indexOf(e):null,s.aggFunc=e.isValueActive()?e.getAggFunc():null,s.hide=!e.isVisible()||void 0,s.pinned=e.isPinned()?e.getPinned():null,s.sort=e.getSort()?e.getSort():null,s.sortIndex=null!=e.getSortIndex()?e.getSortIndex():null,s}};Cg=Gs([Io("columnDefFactory")],Cg);var vg=class{getInitialRowClasses(e){const t=[];return Bs(e.extraCssClass)&&t.push(e.extraCssClass),t.push("ag-row"),t.push(e.rowFocused?"ag-row-focus":"ag-row-no-focus"),e.fadeRowIn&&t.push("ag-opacity-zero"),t.push(e.rowIsEven?"ag-row-even":"ag-row-odd"),e.rowNode.isRowPinned()&&t.push("ag-row-pinned"),e.rowNode.isSelected()&&t.push("ag-row-selected"),e.rowNode.footer&&t.push("ag-row-footer"),t.push("ag-row-level-"+e.rowLevel),e.rowNode.stub&&t.push("ag-row-loading"),e.fullWidthRow&&t.push("ag-full-width-row"),e.expandable&&(t.push("ag-row-group"),t.push(e.rowNode.expanded?"ag-row-group-expanded":"ag-row-group-contracted")),e.rowNode.dragging&&t.push("ag-row-dragging"),pn(t,this.processClassesFromGridOptions(e.rowNode)),pn(t,this.preProcessRowClassRules(e.rowNode)),t.push(e.printLayout?"ag-row-position-relative":"ag-row-position-absolute"),e.firstRowOnPage&&t.push("ag-row-first"),e.lastRowOnPage&&t.push("ag-row-last"),e.fullWidthRow&&("left"===e.pinned&&t.push("ag-cell-last-left-pinned"),"right"===e.pinned&&t.push("ag-cell-first-right-pinned")),t}processClassesFromGridOptions(e){const t=[],i=e=>{"string"==typeof e?t.push(e):Array.isArray(e)&&e.forEach((e=>t.push(e)))},s=this.gos.get("rowClass");if(s){if("function"==typeof s)return console.warn("AG Grid: rowClass should not be a function, please use getRowClass instead"),[];i(s)}const o=this.gos.getCallback("getRowClass");return o&&i(o({data:e.data,node:e,rowIndex:e.rowIndex})),t}preProcessRowClassRules(e){const t=[];return this.processRowClassRules(e,(e=>{t.push(e)}),(e=>{})),t}processRowClassRules(e,t,i){const s=this.gos.addGridCommonParams({data:e.data,node:e,rowIndex:e.rowIndex});this.stylingService.processClassRules(void 0,this.gos.get("rowClassRules"),s,t,i)}calculateRowLevel(e){return e.group?e.level:e.parent?e.parent.level+1:0}};Gs([No("stylingService")],vg.prototype,"stylingService",2),Gs([No("gridOptionsService")],vg.prototype,"gos",2),vg=Gs([Io("rowCssClassCalculator")],vg);var wg=class extends Pn{init(){this.isAccentedSort=this.gos.get("accentedSort"),this.primaryColumnsSortGroups=this.gos.isColumnsSortingCoupledToGroup(),this.addManagedPropertyListener("accentedSort",(e=>this.isAccentedSort=e.currentValue)),this.addManagedPropertyListener("autoGroupColumnDef",(()=>this.primaryColumnsSortGroups=this.gos.isColumnsSortingCoupledToGroup()))}doFullSort(e,t){const i=e.map(((e,t)=>({currentPos:t,rowNode:e})));return i.sort(this.compareRowNodes.bind(this,t)),i.map((e=>e.rowNode))}compareRowNodes(e,t,i){const s=t.rowNode,o=i.rowNode;for(let t=0,i=e.length;t<i;t++){const i=e[t],n="desc"===i.sort,r=this.getValue(s,i.column),a=this.getValue(o,i.column);let l;const u=this.getComparator(i,s);if(l=u?u(r,a,s,o,n):Vl.defaultComparator(r,a,this.isAccentedSort),!isNaN(l)&&0!==l)return"asc"===i.sort?l:-1*l}return t.currentPos-i.currentPos}getComparator(e,t){const i=e.column,s=i.getColDef().comparator;if(null!=s)return s;if(!i.getColDef().showRowGroup)return;const o=!t.group&&i.getColDef().field;if(!o)return;const n=this.columnModel.getPrimaryColumn(o);return n?n.getColDef().comparator:void 0}getValue(e,t){var i,s;if(!this.primaryColumnsSortGroups)return this.valueService.getValue(t,e,!1,!1);if(e.rowGroupColumn===t){if(this.gos.isGroupUseEntireRow(this.columnModel.isPivotActive())){const s=null==(i=e.allLeafChildren)?void 0:i[0];return s?this.valueService.getValue(t,s,!1,!1):void 0}const o=this.columnModel.getGroupDisplayColumnForGroup(t.getId());if(!o)return;return null==(s=e.groupData)?void 0:s[o.getId()]}return e.group&&t.getColDef().showRowGroup?void 0:this.valueService.getValue(t,e,!1,!1)}};Gs([No("valueService")],wg.prototype,"valueService",2),Gs([No("columnModel")],wg.prototype,"columnModel",2),Gs([Lo],wg.prototype,"init",1),wg=Gs([Io("rowNodeSorter")],wg);var yg=class extends Pn{constructor(){super(...arguments),this.params={},this.ready=!1,this.readyCallbacks=[]}checkReady(){const e=this.params;this.ready=null!=e.gridCtrl&&null!=e.gridBodyCtrl&&null!=e.center&&null!=e.left&&null!=e.right&&null!=e.bottomCenter&&null!=e.bottomLeft&&null!=e.bottomRight&&null!=e.topCenter&&null!=e.topLeft&&null!=e.topRight&&null!=e.stickyTopCenter&&null!=e.stickyTopLeft&&null!=e.stickyTopRight&&null!=e.stickyBottomCenter&&null!=e.stickyBottomLeft&&null!=e.stickyBottomRight&&null!=e.centerHeader&&null!=e.leftHeader&&null!=e.rightHeader&&null!=e.fakeHScrollComp&&null!=e.fakeVScrollComp&&null!=e.gridHeaderCtrl,this.ready&&(this.readyCallbacks.forEach((t=>t(e))),this.readyCallbacks.length=0)}whenReady(e){this.ready?e(this.params):this.readyCallbacks.push(e)}register(e,t){this.params[e]=t,this.checkReady()}registerHeaderContainer(e,t){switch(t){case"left":this.params.leftHeader=e;break;case"right":this.params.rightHeader=e;break;default:this.params.centerHeader=e}this.checkReady()}get(e){return this.params[e]}getParams(){return this.params}getGridBodyCtrl(){return this.params.gridBodyCtrl}getHeaderRowContainerCtrls(){return[this.params.leftHeader,this.params.rightHeader,this.params.centerHeader]}getHeaderRowContainerCtrl(e){switch(e){case"left":return this.params.leftHeader;case"right":return this.params.rightHeader;default:return this.params.centerHeader}}};yg.NAME="ctrlsService",yg=Gs([Io(yg.NAME)],yg);var Eg=class extends Pn{constructor(){super(...arguments),this.registry={}}register(e){this.registry[e.controllerName]=e.controllerClass}getInstance(e){const t=this.registry[e];if(null!=t)return new t}};Eg=Gs([Io("ctrlsFactory")],Eg);var Sg=class extends Yl{constructor(e,t){super(e),this.direction=t,this.hideTimeout=null}postConstruct(){this.addManagedListener(this.eventService,In.EVENT_SCROLL_VISIBILITY_CHANGED,this.onScrollVisibilityChanged.bind(this)),this.onScrollVisibilityChanged(),this.addOrRemoveCssClass("ag-apple-scrollbar",ia()||sa())}initialiseInvisibleScrollbar(){void 0===this.invisibleScrollbar&&(this.invisibleScrollbar=da(),this.invisibleScrollbar&&(this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles()))}addActiveListenerToggles(){const e=this.getGui();["mouseenter","mousedown","touchstart"].forEach((t=>this.addManagedListener(e,t,(()=>this.addOrRemoveCssClass("ag-scrollbar-active",!0))))),["mouseleave","touchend"].forEach((t=>this.addManagedListener(e,t,(()=>this.addOrRemoveCssClass("ag-scrollbar-active",!1)))))}onScrollVisibilityChanged(){void 0===this.invisibleScrollbar&&this.initialiseInvisibleScrollbar(),this.animationFrameService.requestAnimationFrame((()=>this.setScrollVisible()))}hideAndShowInvisibleScrollAsNeeded(){this.addManagedListener(this.eventService,In.EVENT_BODY_SCROLL,(e=>{e.direction===this.direction&&(null!==this.hideTimeout&&(window.clearTimeout(this.hideTimeout),this.hideTimeout=null),this.addOrRemoveCssClass("ag-scrollbar-scrolling",!0))})),this.addManagedListener(this.eventService,In.EVENT_BODY_SCROLL_END,(()=>{this.hideTimeout=window.setTimeout((()=>{this.addOrRemoveCssClass("ag-scrollbar-scrolling",!1),this.hideTimeout=null}),400)}))}attemptSettingScrollPosition(e){const t=this.getViewport();bo((()=>ja(t)),(()=>this.setScrollPosition(e)),100)}getViewport(){return this.eViewport}getContainer(){return this.eContainer}onScrollCallback(e){this.addManagedListener(this.getViewport(),"scroll",e)}};Gs([ql("eViewport")],Sg.prototype,"eViewport",2),Gs([ql("eContainer")],Sg.prototype,"eContainer",2),Gs([No("scrollVisibleService")],Sg.prototype,"scrollVisibleService",2),Gs([No("ctrlsService")],Sg.prototype,"ctrlsService",2),Gs([No("animationFrameService")],Sg.prototype,"animationFrameService",2);var bg=class e extends Sg{constructor(){super(e.TEMPLATE,"horizontal")}postConstruct(){super.postConstruct();const e=this.setFakeHScrollSpacerWidths.bind(this);this.addManagedListener(this.eventService,In.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,In.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,e),this.addManagedListener(this.eventService,In.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedPropertyListener("domLayout",e),this.ctrlsService.register("fakeHScrollComp",this),this.createManagedBean(new Ud((e=>this.eContainer.style.width=`${e}px`))),this.addManagedPropertyListeners(["suppressHorizontalScroll"],this.onScrollVisibilityChanged.bind(this))}initialiseInvisibleScrollbar(){void 0===this.invisibleScrollbar&&(this.enableRtl=this.gos.get("enableRtl"),super.initialiseInvisibleScrollbar(),this.invisibleScrollbar&&this.refreshCompBottom())}onPinnedRowDataChanged(){this.refreshCompBottom()}refreshCompBottom(){if(!this.invisibleScrollbar)return;const e=this.pinnedRowModel.getPinnedBottomTotalHeight();this.getGui().style.bottom=`${e}px`}onScrollVisibilityChanged(){super.onScrollVisibilityChanged(),this.setFakeHScrollSpacerWidths()}setFakeHScrollSpacerWidths(){const e=this.scrollVisibleService.isVerticalScrollShowing();let t=this.columnModel.getDisplayedColumnsRightWidth();const i=!this.enableRtl&&e,s=this.gos.getScrollbarWidth();i&&(t+=s),il(this.eRightSpacer,t),this.eRightSpacer.classList.toggle("ag-scroller-corner",t<=s);let o=this.columnModel.getDisplayedColumnsLeftWidth();this.enableRtl&&e&&(o+=s),il(this.eLeftSpacer,o),this.eLeftSpacer.classList.toggle("ag-scroller-corner",o<=s)}setScrollVisible(){const e=this.scrollVisibleService.isHorizontalScrollShowing(),t=this.invisibleScrollbar,i=this.gos.get("suppressHorizontalScroll"),s=e&&this.gos.getScrollbarWidth()||0,o=i?0:0===s&&t?16:s;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),ol(this.getGui(),o),ol(this.eViewport,o),ol(this.eContainer,o),this.setDisplayed(e,{skipAriaHidden:!0})}getScrollPosition(){return Wa(this.getViewport(),this.enableRtl)}setScrollPosition(e){ja(this.getViewport())||this.attemptSettingScrollPosition(e),Ua(this.getViewport(),e,this.enableRtl)}};bg.TEMPLATE='<div class="ag-body-horizontal-scroll" aria-hidden="true">\n <div class="ag-horizontal-left-spacer" ref="eLeftSpacer"></div>\n <div class="ag-body-horizontal-scroll-viewport" ref="eViewport">\n <div class="ag-body-horizontal-scroll-container" ref="eContainer"></div>\n </div>\n <div class="ag-horizontal-right-spacer" ref="eRightSpacer"></div>\n </div>',Gs([ql("eLeftSpacer")],bg.prototype,"eLeftSpacer",2),Gs([ql("eRightSpacer")],bg.prototype,"eRightSpacer",2),Gs([No("columnModel")],bg.prototype,"columnModel",2),Gs([No("pinnedRowModel")],bg.prototype,"pinnedRowModel",2),Gs([Lo],bg.prototype,"postConstruct",1);var Rg=bg,Dg=class extends Pn{postConstruct(){const e=this.checkContainerWidths.bind(this);this.addManagedListener(this.eventService,In.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,In.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,e),this.addManagedPropertyListener("domLayout",e)}checkContainerWidths(){const e=this.gos.isDomLayout("print"),t=e?0:this.columnModel.getDisplayedColumnsLeftWidth(),i=e?0:this.columnModel.getDisplayedColumnsRightWidth();t!=this.leftWidth&&(this.leftWidth=t,this.eventService.dispatchEvent({type:In.EVENT_LEFT_PINNED_WIDTH_CHANGED})),i!=this.rightWidth&&(this.rightWidth=i,this.eventService.dispatchEvent({type:In.EVENT_RIGHT_PINNED_WIDTH_CHANGED}))}getPinnedRightWidth(){return this.rightWidth}getPinnedLeftWidth(){return this.leftWidth}};Gs([No("columnModel")],Dg.prototype,"columnModel",2),Gs([Lo],Dg.prototype,"postConstruct",1),Dg=Gs([Io("pinnedWidthService")],Dg);var Tg=class extends Pn{constructor(){super(...arguments),this.events=[]}postConstruct(){"clientSide"==this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel)}dispatchExpanded(e,t){if(null==this.clientSideRowModel)return void this.eventService.dispatchEvent(e);this.events.push(e);const i=()=>{this.clientSideRowModel&&this.clientSideRowModel.onRowGroupOpened(),this.events.forEach((e=>this.eventService.dispatchEvent(e))),this.events=[]};t?i():(null==this.dispatchExpandedDebounced&&(this.dispatchExpandedDebounced=this.animationFrameService.debounce(i)),this.dispatchExpandedDebounced())}};Gs([No("animationFrameService")],Tg.prototype,"animationFrameService",2),Gs([No("rowModel")],Tg.prototype,"rowModel",2),Gs([Lo],Tg.prototype,"postConstruct",1),Tg=Gs([Io("rowNodeEventThrottle")],Tg);var Ag=(e,t)=>{var i;return"clientSide"===(null!=(i=t.rowModelType)?i:"clientSide")?{module:"@ag-grid-enterprise/row-grouping"}:null},Pg={enableRowGroup:Ag,rowGroup:Ag,rowGroupIndex:Ag,enablePivot:Ag,enableValue:Ag,pivot:Ag,pivotIndex:Ag,aggFunc:Ag,cellEditor:e=>"agRichSelect"===e.cellEditor||"agRichSelectCellEditor"===e.cellEditor?{module:"@ag-grid-enterprise/rich-select"}:null,menuTabs:e=>{var t;const i=["columnsMenuTab","generalMenuTab"];return(null==(t=e.menuTabs)?void 0:t.some((e=>i.includes(e))))?{module:"@ag-grid-enterprise/menu"}:null},columnsMenuParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},columnChooserParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},headerCheckboxSelection:{supportedRowModels:["clientSide","serverSide"],dependencies:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelection is only supported with rowSelection=multiple"},headerCheckboxSelectionFilteredOnly:{supportedRowModels:["clientSide"],dependencies:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple"},headerCheckboxSelectionCurrentPageOnly:{supportedRowModels:["clientSide"],dependencies:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple"},children:()=>Fg},Fg={objectName:"colDef",allProperties:Object.keys({headerName:void 0,columnGroupShow:void 0,headerClass:void 0,toolPanelClass:void 0,headerValueGetter:void 0,pivotKeys:void 0,groupId:void 0,colId:void 0,sort:void 0,initialSort:void 0,field:void 0,type:void 0,cellDataType:void 0,tooltipComponent:void 0,tooltipField:void 0,headerTooltip:void 0,cellClass:void 0,showRowGroup:void 0,filter:void 0,initialAggFunc:void 0,defaultAggFunc:void 0,aggFunc:void 0,pinned:void 0,initialPinned:void 0,chartDataType:void 0,cellAriaRole:void 0,cellEditorPopupPosition:void 0,headerGroupComponent:void 0,headerGroupComponentParams:void 0,cellStyle:void 0,cellRenderer:void 0,cellRendererParams:void 0,cellEditor:void 0,cellEditorParams:void 0,filterParams:void 0,pivotValueColumn:void 0,headerComponent:void 0,headerComponentParams:void 0,floatingFilterComponent:void 0,floatingFilterComponentParams:void 0,tooltipComponentParams:void 0,refData:void 0,columnsMenuParams:void 0,columnChooserParams:void 0,children:void 0,sortingOrder:void 0,allowedAggFuncs:void 0,menuTabs:void 0,pivotTotalColumnIds:void 0,cellClassRules:void 0,icons:void 0,sortIndex:void 0,initialSortIndex:void 0,flex:void 0,initialFlex:void 0,width:void 0,initialWidth:void 0,minWidth:void 0,maxWidth:void 0,rowGroupIndex:void 0,initialRowGroupIndex:void 0,pivotIndex:void 0,initialPivotIndex:void 0,suppressCellFlash:void 0,suppressColumnsToolPanel:void 0,suppressFiltersToolPanel:void 0,openByDefault:void 0,marryChildren:void 0,suppressStickyLabel:void 0,hide:void 0,initialHide:void 0,rowGroup:void 0,initialRowGroup:void 0,pivot:void 0,initialPivot:void 0,checkboxSelection:void 0,showDisabledCheckboxes:void 0,headerCheckboxSelection:void 0,headerCheckboxSelectionFilteredOnly:void 0,headerCheckboxSelectionCurrentPageOnly:void 0,suppressMenu:void 0,suppressHeaderMenuButton:void 0,suppressMovable:void 0,lockPosition:void 0,lockVisible:void 0,lockPinned:void 0,unSortIcon:void 0,suppressSizeToFit:void 0,suppressAutoSize:void 0,enableRowGroup:void 0,enablePivot:void 0,enableValue:void 0,editable:void 0,suppressPaste:void 0,suppressNavigable:void 0,enableCellChangeFlash:void 0,rowDrag:void 0,dndSource:void 0,autoHeight:void 0,wrapText:void 0,sortable:void 0,resizable:void 0,singleClickEdit:void 0,floatingFilter:void 0,cellEditorPopup:void 0,suppressFillHandle:void 0,wrapHeaderText:void 0,autoHeaderHeight:void 0,dndSourceOnRowDrag:void 0,valueGetter:void 0,valueSetter:void 0,filterValueGetter:void 0,keyCreator:void 0,valueFormatter:void 0,valueParser:void 0,comparator:void 0,equals:void 0,pivotComparator:void 0,suppressKeyboardEvent:void 0,suppressHeaderKeyboardEvent:void 0,colSpan:void 0,rowSpan:void 0,getQuickFilterText:void 0,onCellValueChanged:void 0,onCellClicked:void 0,onCellDoubleClicked:void 0,onCellContextMenu:void 0,rowDragText:void 0,tooltipValueGetter:void 0,cellRendererSelector:void 0,cellEditorSelector:void 0,suppressSpanHeaderHeight:void 0,useValueFormatterForExport:void 0,useValueParserForImport:void 0,mainMenuItems:void 0,contextMenuItems:void 0,suppressFloatingFilterButton:void 0,suppressHeaderFilterButton:void 0,suppressHeaderContextMenu:void 0,loadingCellRenderer:void 0,loadingCellRendererParams:void 0,loadingCellRendererSelector:void 0}),docsUrl:"column-properties/",deprecations:{columnsMenuParams:{version:"31.1",message:"Use `columnChooserParams` instead."},suppressMenu:{version:"31.1",message:"Use `suppressHeaderMenuButton` instead."},suppressCellFlash:{version:"31.2",message:"Use `enableCellChangeFlash={false}` in the ColDef"},dndSource:{version:"31.2",message:"This feature has been replaced by `Row Dragging to an External DropZone`."},dndSourceOnRowDrag:{version:"31.2",message:"This feature has been replaced by `Row Dragging to an External DropZone`."}},validations:Pg},Mg={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!1,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:"\t",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,suppressChartToolPanelsButton:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressAsyncEvents:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,enableCellChangeFlash:!1,cellFlashDelay:500,cellFlashDuration:500,cellFadeDelay:1e3,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupIncludeTotalFooter:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,suppressServerSideInfiniteScroll:!1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSideSortOnServer:!1,serverSideFilterOnServer:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,suppressGroupMaintainValueType:!1,functionsPassive:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1},Lg={sideBar:{module:"@ag-grid-enterprise/side-bar"},statusBar:{module:"@ag-grid-enterprise/status-bar"},enableCharts:{module:"@ag-grid-enterprise/charts"},getMainMenuItems:{module:"@ag-grid-enterprise/menu"},getContextMenuItems:{module:"@ag-grid-enterprise/menu"},allowContextMenuWithControlKey:{module:"@ag-grid-enterprise/menu"},enableAdvancedFilter:{module:"@ag-grid-enterprise/advanced-filter"},treeData:{supportedRowModels:["clientSide","serverSide"],module:"@ag-grid-enterprise/row-grouping",dependencies:e=>{var t;const i=null!=(t=e.rowModelType)?t:"clientSide";switch(i){case"clientSide":const t=`treeData requires 'getDataPath' in the ${i} row model.`;return e.getDataPath?null:t;case"serverSide":const s=`treeData requires 'isServerSideGroup' and 'getServerSideGroupKey' in the ${i} row model.`;return e.isServerSideGroup&&e.getServerSideGroupKey?null:s}return null}},masterDetail:{module:"@ag-grid-enterprise/master-detail"},enableRangeSelection:{module:"@ag-grid-enterprise/range-selection"},enableRangeHandle:{dependencies:{enableRangeSelection:[!0]}},enableFillHandle:{dependencies:{enableRangeSelection:[!0]}},groupDefaultExpanded:{supportedRowModels:["clientSide"]},groupIncludeFooter:{supportedRowModels:["clientSide","serverSide"],dependencies:e=>{var t;switch(null!=(t=e.rowModelType)?t:"clientSide"){case"clientSide":return null;case"serverSide":const t="groupIncludeFooter is not supported alongside suppressServerSideInfiniteScroll";return e.suppressServerSideInfiniteScroll?t:null}return null}},groupIncludeTotalFooter:{supportedRowModels:["clientSide"]},groupRemoveSingleChildren:{dependencies:{groupHideOpenParents:[void 0,!1],groupRemoveLowestSingleChildren:[void 0,!1]}},groupRemoveLowestSingleChildren:{dependencies:{groupHideOpenParents:[void 0,!1],groupRemoveSingleChildren:[void 0,!1]}},groupSelectsChildren:{dependencies:{rowSelection:["multiple"]}},suppressParentsInRowNodes:{dependencies:{groupSelectsChildren:[void 0,!1]}},viewportDatasource:{supportedRowModels:["viewport"],module:"@ag-grid-enterprise/viewport-row-model"},serverSideDatasource:{supportedRowModels:["serverSide"],module:"@ag-grid-enterprise/server-side-row-model"},cacheBlockSize:{supportedRowModels:["serverSide","infinite"]},datasource:{supportedRowModels:["infinite"],module:"@ag-grid-community/infinite-row-model"},rowData:{supportedRowModels:["clientSide"],module:"@ag-grid-community/client-side-row-model"},columnDefs:()=>Fg,defaultColDef:()=>Fg,defaultColGroupDef:()=>Fg,autoGroupColumnDef:()=>Fg},xg={objectName:"gridOptions",allProperties:[...sr.ALL_PROPERTIES,...nr.EVENT_CALLBACKS],propertyExceptions:["api","columnApi"],docsUrl:"grid-options/",deprecations:{enableChartToolPanelsButton:{version:"29"},functionsPassive:{version:"29.2"},onColumnRowGroupChangeRequest:{version:"29.2"},onColumnPivotChangeRequest:{version:"29.2"},onColumnValueChangeRequest:{version:"29.2"},onColumnAggFuncChangeRequest:{version:"29.2"},serverSideFilterAllLevels:{version:"30",message:"All server-side group levels are now filtered by default. This can be toggled using `serverSideOnlyRefreshFilteredGroups`."},suppressAggAtRootLevel:{version:"30",message:"The root level aggregation is now suppressed by default. This can be toggled using `alwaysAggregateAtRootLevel`."},excludeHiddenColumnsFromQuickFilter:{version:"30",message:"Hidden columns are now excluded from the Quick Filter by default. This can be toggled using `includeHiddenColumnsInQuickFilter`."},enterMovesDown:{version:"30",renamed:"enterNavigatesVertically"},enterMovesDownAfterEdit:{version:"30",renamed:"enterNavigatesVerticallyAfterEdit"},suppressParentsInRowNodes:{version:"30.2",message:"Using suppressParentsInRowNodes is no longer recommended. To serialize nodes it is now recommended to instead remove the parent node reference before serialization."},advancedFilterModel:{version:"31",message:"Use `initialState.filter.advancedFilterModel` instead."},suppressAsyncEvents:{version:"31",message:"Events should be handled asynchronously."},cellFadeDelay:{version:"31.1",renamed:"cellFadeDuration"},cellFlashDelay:{version:"31.1",renamed:"cellFlashDuration"},suppressServerSideInfiniteScroll:{version:"31.1"},serverSideSortOnServer:{version:"31.1"},serverSideFilterOnServer:{version:"31.1"},enableCellChangeFlash:{version:"31.2",message:"Use `enableCellChangeFlash` in the `ColDef` or `defaultColDef` for all columns."},groupIncludeFooter:{version:"31.3",message:"Use `groupTotalRow` instead."},groupIncludeTotalFooter:{version:"31.3",message:"Use `grandTotalRow` instead."}},validations:Lg},Ig=class{constructor(){this.destroyed=!1,this.domDataKey="__AG_"+Math.random().toString(),this.propertyEventService=new Vo,this.globalEventHandlerFactory=e=>(t,i)=>{if(this.destroyed)return;const s=Nn.has(t);if(s&&!e||!s&&e)return;const o=nr.getCallbackForEvent(t),n=this.gridOptions[o];"function"==typeof n&&this.frameworkOverrides.wrapOutgoing((()=>{n(i)}))}}get context(){return this.gridOptions.context}init(){this.columnApi=new Vp(this.api);const e=!this.get("suppressAsyncEvents");this.eventService.addGlobalListener(this.globalEventHandlerFactory().bind(this),e),this.eventService.addGlobalListener(this.globalEventHandlerFactory(!0).bind(this),!1),this.propertyEventService.setFrameworkOverrides(this.frameworkOverrides),this.getScrollbarWidth()}destroy(){this.destroyed=!0,this.columnApi=void 0}get(e){var t;return null!=(t=this.gridOptions[e])?t:Mg[e]}getCallback(e){return this.mergeGridCommonParams(this.gridOptions[e])}exists(e){return Bs(this.gridOptions[e])}mergeGridCommonParams(e){return e?t=>{const i=t;return i.api=this.api,i.columnApi=this.columnApi,i.context=this.context,e(i)}:e}static toBoolean(e){return"boolean"==typeof e?e:"string"==typeof e&&("TRUE"===e.toUpperCase()||""==e)}static toNumber(e){if("number"==typeof e)return e;if("string"==typeof e){const t=parseInt(e);if(isNaN(t))return;return t}}static toConstrainedNum(e,t){return i=>{const s=Ig.toNumber(i);if(!(null==s||s<e||s>t))return s}}static getCoercedValue(e,t){const i=Ig.PROPERTY_COERCIONS.get(e);return i?i(t):t}static getCoercedGridOptions(e){const t={};return Object.entries(e).forEach((([e,i])=>{const s=Ig.getCoercedValue(e,i);t[e]=s})),t}updateGridOptions({options:e,force:t,source:i="api"}){const s={id:Ig.changeSetId++,properties:[]},o=[];Object.entries(e).forEach((([e,n])=>{"api"===i&&tr[e]&&co(`${e} is an initial property and cannot be updated.`);const r=Ig.getCoercedValue(e,n),a=t||"object"==typeof r&&"api"===i,l=this.gridOptions[e];if(a||l!==r){this.gridOptions[e]=r;const t={type:e,currentValue:r,previousValue:l,changeSet:s,source:i};o.push(t)}})),this.validationService.processGridOptions(this.gridOptions),s.properties=o.map((e=>e.type)),o.forEach((e=>{this.gridOptions.debug&&console.log(`AG Grid: Updated property ${e.type} from `,e.previousValue," to ",e.currentValue),this.propertyEventService.dispatchEvent(e)}))}addEventListener(e,t){this.propertyEventService.addEventListener(e,t)}removeEventListener(e,t){this.propertyEventService.removeEventListener(e,t)}getScrollbarWidth(){if(null==this.scrollbarWidth){const e="number"==typeof this.gridOptions.scrollbarWidth&&this.gridOptions.scrollbarWidth>=0?this.gridOptions.scrollbarWidth:ua();null!=e&&(this.scrollbarWidth=e,this.eventService.dispatchEvent({type:In.EVENT_SCROLLBAR_WIDTH_CHANGED}))}return this.scrollbarWidth}isRowModelType(e){return this.gridOptions.rowModelType===e||"clientSide"===e&&Ws(this.gridOptions.rowModelType)}isDomLayout(e){var t;return(null!=(t=this.gridOptions.domLayout)?t:"normal")===e}isRowSelection(){return"single"===this.gridOptions.rowSelection||"multiple"===this.gridOptions.rowSelection}useAsyncEvents(){return!this.get("suppressAsyncEvents")}isGetRowHeightFunction(){return"function"==typeof this.gridOptions.getRowHeight}getRowHeightForNode(e,t=!1,i){if(null==i&&(i=this.environment.getDefaultRowHeight()),this.isGetRowHeightFunction()){if(t)return{height:i,estimated:!0};const s={node:e,data:e.data},o=this.getCallback("getRowHeight")(s);if(this.isNumeric(o))return 0===o&&co("The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead."),{height:Math.max(1,o),estimated:!1}}return e.detail&&this.get("masterDetail")?this.getMasterDetailRowHeight():{height:this.gridOptions.rowHeight&&this.isNumeric(this.gridOptions.rowHeight)?this.gridOptions.rowHeight:i,estimated:!1}}getMasterDetailRowHeight(){return this.get("detailRowAutoHeight")?{height:1,estimated:!1}:this.isNumeric(this.gridOptions.detailRowHeight)?{height:this.gridOptions.detailRowHeight,estimated:!1}:{height:300,estimated:!1}}getRowHeightAsNumber(){if(!this.gridOptions.rowHeight||Ws(this.gridOptions.rowHeight))return this.environment.getDefaultRowHeight();const e=this.environment.refreshRowHeightVariable();return-1!==e?e:(console.warn("AG Grid row height must be a number if not using standard row model"),this.environment.getDefaultRowHeight())}isNumeric(e){return!isNaN(e)&&"number"==typeof e&&isFinite(e)}getDomDataKey(){return this.domDataKey}getDomData(e,t){const i=e[this.getDomDataKey()];return i?i[t]:void 0}setDomData(e,t,i){const s=this.getDomDataKey();let o=e[s];Ws(o)&&(o={},e[s]=o),o[t]=i}getDocument(){let e=null;return this.gridOptions.getDocument&&Bs(this.gridOptions.getDocument)?e=this.gridOptions.getDocument():this.eGridDiv&&(e=this.eGridDiv.ownerDocument),e&&Bs(e)?e:document}getWindow(){return this.getDocument().defaultView||window}getRootNode(){return this.eGridDiv.getRootNode()}getActiveDomElement(){return this.getRootNode().activeElement}getAsyncTransactionWaitMillis(){return Bs(this.gridOptions.asyncTransactionWaitMillis)?this.gridOptions.asyncTransactionWaitMillis:50}isAnimateRows(){return!this.get("ensureDomOrder")&&this.get("animateRows")}isGroupRowsSticky(){return!(this.get("paginateChildRows")||this.get("groupHideOpenParents")||this.isDomLayout("print"))}isColumnsSortingCoupledToGroup(){const e=this.gridOptions.autoGroupColumnDef;return!(null==e?void 0:e.comparator)&&!this.get("treeData")}getGroupAggFiltering(){const e=this.gridOptions.groupAggFiltering;return"function"==typeof e?this.getCallback("groupAggFiltering"):!0===e?()=>!0:void 0}getGrandTotalRow(){const e=this.gridOptions.grandTotalRow;return e||(this.gridOptions.groupIncludeTotalFooter?"bottom":void 0)}getGroupTotalRowCallback(){const e=this.get("groupTotalRow");if("function"==typeof e)return this.getCallback("groupTotalRow");if(e)return()=>e;const t=this.get("groupIncludeFooter");if("function"==typeof t){const e=this.getCallback("groupIncludeFooter");return t=>e(t)?"bottom":void 0}return()=>t?"bottom":void 0}isGroupMultiAutoColumn(){return this.gridOptions.groupDisplayType?"multipleColumns"===this.gridOptions.groupDisplayType:this.get("groupHideOpenParents")}isGroupUseEntireRow(e){return!e&&"groupRows"===this.gridOptions.groupDisplayType}getGridCommonParams(){return{api:this.api,columnApi:this.columnApi,context:this.context}}addGridCommonParams(e){const t=e;return t.api=this.api,t.columnApi=this.columnApi,t.context=this.context,t}};Ig.PROPERTY_COERCIONS=new Map([...sr.BOOLEAN_PROPERTIES.map((e=>[e,Ig.toBoolean])),...sr.NUMBER_PROPERTIES.map((e=>[e,Ig.toNumber])),["groupAggFiltering",e=>"function"==typeof e?e:Ig.toBoolean(e)],["pageSize",Ig.toConstrainedNum(1,Number.MAX_VALUE)],["autoSizePadding",Ig.toConstrainedNum(0,Number.MAX_VALUE)],["keepDetailRowsCount",Ig.toConstrainedNum(1,Number.MAX_VALUE)],["rowBuffer",Ig.toConstrainedNum(0,Number.MAX_VALUE)],["infiniteInitialRowCount",Ig.toConstrainedNum(1,Number.MAX_VALUE)],["cacheOverflowSize",Ig.toConstrainedNum(1,Number.MAX_VALUE)],["cacheBlockSize",Ig.toConstrainedNum(1,Number.MAX_VALUE)],["serverSideInitialRowCount",Ig.toConstrainedNum(1,Number.MAX_VALUE)],["viewportRowModelPageSize",Ig.toConstrainedNum(1,Number.MAX_VALUE)],["viewportRowModelBufferSize",Ig.toConstrainedNum(0,Number.MAX_VALUE)]]),Ig.changeSetId=0,Gs([No("gridOptions")],Ig.prototype,"gridOptions",2),Gs([No("eventService")],Ig.prototype,"eventService",2),Gs([No("environment")],Ig.prototype,"environment",2),Gs([No("frameworkOverrides")],Ig.prototype,"frameworkOverrides",2),Gs([No("eGridDiv")],Ig.prototype,"eGridDiv",2),Gs([No("validationService")],Ig.prototype,"validationService",2),Gs([No("gridApi")],Ig.prototype,"api",2),Gs([Lo],Ig.prototype,"init",1),Gs([xo],Ig.prototype,"destroy",1),Ig=Gs([Io("gridOptionsService")],Ig);var Ng=class extends Pn{getLocaleTextFunc(){const e=this.gos.getCallback("getLocaleText");if(e)return(t,i,s)=>e({key:t,defaultValue:i,variableValues:s});const t=this.gos.get("localeText");return(e,i,s)=>{let o=t&&t[e];if(o&&s&&s.length){let e=0;for(;!(e>=s.length)&&-1!==o.indexOf("${variable}");)o=o.replace("${variable}",s[e++])}return null!=o?o:i}}};Ng=Gs([Io("localeService")],Ng);var _g=class e extends Sg{constructor(){super(e.TEMPLATE,"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new Bd(this.eContainer)),this.ctrlsService.register("fakeVScrollComp",this),this.addManagedListener(this.eventService,In.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,this.onRowContainerHeightChanged.bind(this))}setScrollVisible(){const e=this.scrollVisibleService.isVerticalScrollShowing(),t=this.invisibleScrollbar,i=e&&this.gos.getScrollbarWidth()||0,s=0===i&&t?16:i;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),il(this.getGui(),s),il(this.eViewport,s),il(this.eContainer,s),this.setDisplayed(e,{skipAriaHidden:!0})}onRowContainerHeightChanged(){const{ctrlsService:e}=this,t=e.getGridBodyCtrl().getBodyViewportElement(),i=this.getScrollPosition(),s=t.scrollTop;i!=s&&this.setScrollPosition(s,!0)}getScrollPosition(){return this.getViewport().scrollTop}setScrollPosition(e,t){t||ja(this.getViewport())||this.attemptSettingScrollPosition(e),this.getViewport().scrollTop=e}};_g.TEMPLATE='<div class="ag-body-vertical-scroll" aria-hidden="true">\n <div class="ag-body-vertical-scroll-viewport" ref="eViewport">\n <div class="ag-body-vertical-scroll-container" ref="eContainer"></div>\n </div>\n </div>',Gs([Lo],_g.prototype,"postConstruct",1);var Og=_g,Gg={january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},kg=["january","february","march","april","may","june","july","august","september","october","november","december"],Vg=class extends Pn{constructor(){super(...arguments),this.dataTypeDefinitions={},this.isWaitingForRowData=!1,this.isColumnTypeOverrideInDataTypeDefinitions=!1,this.columnStateUpdatesPendingInference={},this.columnStateUpdateListenerDestroyFuncs=[]}init(){this.groupHideOpenParents=this.gos.get("groupHideOpenParents"),this.addManagedPropertyListener("groupHideOpenParents",(()=>{this.groupHideOpenParents=this.gos.get("groupHideOpenParents")})),this.processDataTypeDefinitions(),this.addManagedPropertyListener("dataTypeDefinitions",(e=>{this.processDataTypeDefinitions(),this.columnModel.recreateColumnDefs(Jn(e.source))}))}processDataTypeDefinitions(){var e;const t=this.getDefaultDataTypes();this.dataTypeDefinitions={},Object.entries(t).forEach((([e,t])=>{this.dataTypeDefinitions[e]=_s(Ns({},t),{groupSafeValueFormatter:this.createGroupSafeValueFormatter(t)})}));const i=null!=(e=this.gos.get("dataTypeDefinitions"))?e:{};this.dataTypeMatchers={},Object.entries(i).forEach((([e,s])=>{const o=this.processDataTypeDefinition(s,i,[e],t);o&&(this.dataTypeDefinitions[e]=o,s.dataTypeMatcher&&(this.dataTypeMatchers[e]=s.dataTypeMatcher))})),this.checkObjectValueHandlers(t),["dateString","text","number","boolean","date"].forEach((e=>{const i=this.dataTypeMatchers[e];i&&delete this.dataTypeMatchers[e],this.dataTypeMatchers[e]=null!=i?i:t[e].dataTypeMatcher}))}mergeDataTypeDefinitions(e,t){const i=Ns(Ns({},e),t);return e.columnTypes&&t.columnTypes&&t.appendColumnTypes&&(i.columnTypes=[...this.convertColumnTypes(e.columnTypes),...this.convertColumnTypes(t.columnTypes)]),i}processDataTypeDefinition(e,t,i,s){let o;const n=e.extendsDataType;if(e.columnTypes&&(this.isColumnTypeOverrideInDataTypeDefinitions=!0),e.extendsDataType===e.baseDataType){let i=s[n];const r=t[n];if(i&&r&&(i=r),!this.validateDataTypeDefinition(e,i,n))return;o=this.mergeDataTypeDefinitions(i,e)}else{if(i.includes(n))return void co('Data type definition hierarchies (via the "extendsDataType" property) cannot contain circular references.');const r=t[n];if(!this.validateDataTypeDefinition(e,r,n))return;const a=this.processDataTypeDefinition(r,t,[...i,n],s);if(!a)return;o=this.mergeDataTypeDefinitions(a,e)}return _s(Ns({},o),{groupSafeValueFormatter:this.createGroupSafeValueFormatter(o)})}validateDataTypeDefinition(e,t,i){return t?t.baseDataType===e.baseDataType||(co('The "baseDataType" property of a data type definition must match that of its parent.'),!1):(co(`The data type definition ${i} does not exist.`),!1)}createGroupSafeValueFormatter(e){if(e.valueFormatter)return t=>{var i,s;if(null==(i=t.node)?void 0:i.group){const i=t.column.getAggFunc();if(i){if("first"===i||"last"===i)return e.valueFormatter(t);if("number"===e.baseDataType&&"count"!==i){if("number"==typeof t.value)return e.valueFormatter(t);if("object"==typeof t.value){if(!t.value)return;if("toNumber"in t.value)return e.valueFormatter(_s(Ns({},t),{value:t.value.toNumber()}));if("value"in t.value)return e.valueFormatter(_s(Ns({},t),{value:t.value.value}))}}}if(!this.gos.get("suppressGroupMaintainValueType"))return}else if(this.groupHideOpenParents&&t.column.isRowGroupActive()){if("string"!=typeof t.value||(null==(s=e.dataTypeMatcher)?void 0:s.call(e,t.value)))return e.valueFormatter(t);if(!this.gos.get("suppressGroupMaintainValueType"))return}return e.valueFormatter(t)}}updateColDefAndGetDataTypeDefinitionColumnType(e,t,i){let{cellDataType:s}=t;const{field:o}=t;if(void 0===s&&(s=e.cellDataType),null!=s&&!0!==s||(s=!!this.canInferCellDataType(e,t)&&this.inferCellDataType(o,i)),!s)return void(e.cellDataType=!1);const n=this.dataTypeDefinitions[s];if(n)return e.cellDataType=s,n.groupSafeValueFormatter&&(e.valueFormatter=n.groupSafeValueFormatter),n.valueParser&&(e.valueParser=n.valueParser),n.suppressDefaultProperties||this.setColDefPropertiesForBaseDataType(e,n,i),n.columnTypes;co(`Missing data type definition - "${s}"`)}updateColDefAndGetColumnType(e,t,i){var s,o;const n=this.updateColDefAndGetDataTypeDefinitionColumnType(e,t,i),r=null!=(o=null!=(s=t.type)?s:n)?o:e.type;return e.type=r,r?this.convertColumnTypes(r):void 0}addColumnListeners(e){if(!this.isWaitingForRowData)return;const t=this.columnStateUpdatesPendingInference[e.getColId()];if(!t)return;const i=e=>{t.add(e.key)};e.addEventListener($o.EVENT_STATE_UPDATED,i),this.columnStateUpdateListenerDestroyFuncs.push((()=>e.removeEventListener($o.EVENT_STATE_UPDATED,i)))}canInferCellDataType(e,t){var i;if("clientSide"!==this.rowModel.getType())return!1;const s={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(this.doColDefPropsPreventInference(t,s))return!1;const o=null===t.type?e.type:t.type;if(o){const e=null!=(i=this.gos.get("columnTypes"))?i:{};if(this.convertColumnTypes(o).some((t=>{const i=e[t.trim()];return i&&this.doColDefPropsPreventInference(i,s)})))return!1}return!this.doColDefPropsPreventInference(e,s)}doColDefPropsPreventInference(e,t){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some((([i,s])=>this.doesColDefPropPreventInference(e,t,i,s)))}doesColDefPropPreventInference(e,t,i,s){if(!t[i])return!1;const o=e[i];return null===o?(t[i]=!1,!1):void 0===s?!!o:o===s}inferCellDataType(e,t){var i;if(!e)return;let s;const o=this.getInitialData();if(o){const t=e.indexOf(".")>=0&&!this.gos.get("suppressFieldDotNotation");s=no(o,e,t)}else this.initWaitForRowData(t);if(null==s)return;const[n]=null!=(i=Object.entries(this.dataTypeMatchers).find((([e,t])=>t(s))))?i:["object"];return n}getInitialData(){const e=this.gos.get("rowData");if(null==e?void 0:e.length)return e[0];if(this.initialData)return this.initialData;{const e=this.rowModel.getRootNode().allLeafChildren;if(null==e?void 0:e.length)return e[0].data}return null}initWaitForRowData(e){if(this.columnStateUpdatesPendingInference[e]=new Set,this.isWaitingForRowData)return;this.isWaitingForRowData=!0;const t=this.isColumnTypeOverrideInDataTypeDefinitions;t&&this.columnModel.queueResizeOperations();const i=this.addManagedListener(this.eventService,In.EVENT_ROW_DATA_UPDATE_STARTED,(e=>{const{firstRowData:s}=e;if(!s)return;null==i||i(),this.isWaitingForRowData=!1,this.processColumnsPendingInference(s,t),this.columnStateUpdatesPendingInference={},t&&this.columnModel.processResizeOperations();const o={type:In.EVENT_DATA_TYPES_INFERRED};this.eventService.dispatchEvent(o)}))}isPendingInference(){return this.isWaitingForRowData}processColumnsPendingInference(e,t){this.initialData=e;const i=[];this.columnStateUpdateListenerDestroyFuncs.forEach((e=>e())),this.columnStateUpdateListenerDestroyFuncs=[];const s={},o={};Object.entries(this.columnStateUpdatesPendingInference).forEach((([e,n])=>{const r=this.columnModel.getGridColumn(e);if(!r)return;const a=r.getColDef();if(!this.columnModel.resetColumnDefIntoColumn(r,"cellDataTypeInferred"))return;const l=r.getColDef();if(t&&l.type&&l.type!==a.type){const t=this.getUpdatedColumnState(r,n);t.rowGroup&&null==t.rowGroupIndex&&(s[e]=t),t.pivot&&null==t.pivotIndex&&(o[e]=t),i.push(t)}})),t&&i.push(...this.columnModel.generateColumnStateForRowGroupAndPivotIndexes(s,o)),i.length&&this.columnModel.applyColumnState({state:i},"cellDataTypeInferred"),this.initialData=null}getUpdatedColumnState(e,t){const i=this.columnModel.getColumnStateFromColDef(e);return t.forEach((e=>{delete i[e],"rowGroup"===e?delete i.rowGroupIndex:"pivot"===e&&delete i.pivotIndex})),i}checkObjectValueHandlers(e){const t=this.dataTypeDefinitions.object,i=e.object;this.hasObjectValueParser=t.valueParser!==i.valueParser,this.hasObjectValueFormatter=t.valueFormatter!==i.valueFormatter}convertColumnTypes(e){let t=[];return e instanceof Array?e.some((e=>"string"!=typeof e))?console.warn("if colDef.type is supplied an array it should be of type 'string[]'"):t=e:"string"==typeof e?t=e.split(","):console.warn("colDef.type should be of type 'string' | 'string[]'"),t}getDateStringTypeDefinition(e){var t;return e&&null!=(t=this.getDataTypeDefinition(e))?t:this.dataTypeDefinitions.dateString}getDateParserFunction(e){return this.getDateStringTypeDefinition(e).dateParser}getDateFormatterFunction(e){return this.getDateStringTypeDefinition(e).dateFormatter}getDataTypeDefinition(e){const t=e.getColDef();if(t.cellDataType)return this.dataTypeDefinitions[t.cellDataType]}getBaseDataType(e){var t;return null==(t=this.getDataTypeDefinition(e))?void 0:t.baseDataType}checkType(e,t){var i;if(null==t)return!0;const s=null==(i=this.getDataTypeDefinition(e))?void 0:i.dataTypeMatcher;return!s||s(t)}validateColDef(e){"object"===e.cellDataType&&(e.valueFormatter!==this.dataTypeDefinitions.object.groupSafeValueFormatter||this.hasObjectValueFormatter||co('Cell data type is "object" but no value formatter has been provided. Please either provide an object data type definition with a value formatter, or set "colDef.valueFormatter"'),e.editable&&e.valueParser===this.dataTypeDefinitions.object.valueParser&&!this.hasObjectValueParser&&co('Cell data type is "object" but no value parser has been provided. Please either provide an object data type definition with a value parser, or set "colDef.valueParser"'))}setColDefPropertiesForBaseDataType(e,t,i){const s=(e,i,s)=>{let o=e.getColDef().valueFormatter;return o===t.groupSafeValueFormatter&&(o=t.valueFormatter),this.valueService.formatValue(e,i,s,o)},o=Po.__isRegistered("@ag-grid-enterprise/set-filter",this.context.getGridId()),n=this.localeService.getLocaleTextFunc(),r=t=>{const{filterParams:i}=e;e.filterParams="object"==typeof i?Ns(Ns({},i),t):t};switch(t.baseDataType){case"number":e.cellEditor="agNumberCellEditor",o&&r({comparator:(e,t)=>{const i=null==e?0:parseInt(e),s=null==t?0:parseInt(t);return i===s?0:i>s?1:-1}});break;case"boolean":e.cellEditor="agCheckboxCellEditor",e.cellRenderer="agCheckboxCellRenderer",e.suppressKeyboardEvent=e=>!!e.colDef.editable&&e.event.key===El.SPACE,r(o?{valueFormatter:e=>Bs(e.value)?n(String(e.value),e.value?"True":"False"):n("blanks","(Blanks)")}:{maxNumConditions:1,debounceMs:0,filterOptions:["empty",{displayKey:"true",displayName:"True",predicate:(e,t)=>t,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(e,t)=>!1===t,numberOfInputs:0}]});break;case"date":e.cellEditor="agDateCellEditor",e.keyCreator=e=>s(e.column,e.node,e.value),o&&r({valueFormatter:e=>{const t=s(e.column,e.node,e.value);return Bs(t)?t:n("blanks","(Blanks)")},treeList:!0,treeListFormatter:(e,t)=>{if(1===t&&null!=e){const t=kg[Number(e)-1];return n(t,Gg[t])}return null!=e?e:n("blanks","(Blanks)")}});break;case"dateString":{e.cellEditor="agDateStringCellEditor",e.keyCreator=e=>s(e.column,e.node,e.value);const i=t.dateParser;r(o?{valueFormatter:e=>{const t=s(e.column,e.node,e.value);return Bs(t)?t:n("blanks","(Blanks)")},treeList:!0,treeListPathGetter:e=>{const t=i(null!=e?e:void 0);return t?[String(t.getFullYear()),String(t.getMonth()+1),String(t.getDate())]:null},treeListFormatter:(e,t)=>{if(1===t&&null!=e){const t=kg[Number(e)-1];return n(t,Gg[t])}return null!=e?e:n("blanks","(Blanks)")}}:{comparator:(e,t)=>{const s=i(t);return null==t||s<e?-1:s>e?1:0}});break}case"object":e.cellEditorParams={useFormatter:!0},e.comparator=(e,t)=>{const o=this.columnModel.getPrimaryColumn(i),n=null==o?void 0:o.getColDef();if(!o||!n)return 0;const r=null==e?"":s(o,null,e),a=null==t?"":s(o,null,t);return r===a?0:r>a?1:-1},e.keyCreator=e=>s(e.column,e.node,e.value),o?r({valueFormatter:e=>{const t=s(e.column,e.node,e.value);return Bs(t)?t:n("blanks","(Blanks)")}}):e.filterValueGetter=e=>s(e.column,e.node,this.valueService.getValue(e.column,e.node))}}getDefaultDataTypes(){const e=e=>!!e.match("^\\d{4}-\\d{2}-\\d{2}$"),t=this.localeService.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:e=>{var t,i;return""===(null==(i=null==(t=e.newValue)?void 0:t.trim)?void 0:i.call(t))?null:Number(e.newValue)},valueFormatter:e=>null==e.value?"":"number"!=typeof e.value||isNaN(e.value)?t("invalidNumber","Invalid Number"):String(e.value),dataTypeMatcher:e=>"number"==typeof e},text:{baseDataType:"text",valueParser:e=>""===e.newValue?null:zs(e.newValue),dataTypeMatcher:e=>"string"==typeof e},boolean:{baseDataType:"boolean",valueParser:e=>{var t,i;return null==e.newValue?e.newValue:""===(null==(i=null==(t=e.newValue)?void 0:t.trim)?void 0:i.call(t))?null:"true"===String(e.newValue).toLowerCase()},valueFormatter:e=>null==e.value?"":String(e.value),dataTypeMatcher:e=>"boolean"==typeof e},date:{baseDataType:"date",valueParser:e=>Ra(null==e.newValue?null:String(e.newValue)),valueFormatter:e=>{var i;return null==e.value?"":e.value instanceof Date&&!isNaN(e.value.getTime())?null!=(i=Ea(e.value,!1))?i:"":t("invalidDate","Invalid Date")},dataTypeMatcher:e=>e instanceof Date},dateString:{baseDataType:"dateString",dateParser:e=>{var t;return null!=(t=Ra(e))?t:void 0},dateFormatter:e=>{var t;return null!=(t=Ea(null!=e?e:null,!1))?t:void 0},valueParser:t=>e(String(t.newValue))?t.newValue:null,valueFormatter:t=>e(String(t.value))?t.value:"",dataTypeMatcher:t=>"string"==typeof t&&e(t)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:e=>{var t;return null!=(t=zs(e.value))?t:""}}}}};Gs([No("rowModel")],Vg.prototype,"rowModel",2),Gs([No("columnModel")],Vg.prototype,"columnModel",2),Gs([No("valueService")],Vg.prototype,"valueService",2),Gs([Lo],Vg.prototype,"init",1),Vg=Gs([Io("dataTypeService")],Vg);var Hg=class extends Pn{constructor(){super(...arguments),this.waitingForColumns=!1}postConstruct(){this.addManagedPropertyListener("columnDefs",(e=>this.setColumnDefs(e)))}start(){this.ctrlsService.whenReady((()=>{const e=this.gos.get("columnDefs");e?this.setColumnsAndData(e):this.waitingForColumns=!0,this.gridReady()}))}setColumnsAndData(e){this.columnModel.setColumnDefs(null!=e?e:[],"gridInitializing"),this.rowModel.start()}gridReady(){this.dispatchGridReadyEvent();const e=Po.__isRegistered("@ag-grid-enterprise/core",this.context.getGridId());new Up("AG Grid",(()=>this.gos.get("debug"))).log(`initialised successfully, enterprise = ${e}`)}dispatchGridReadyEvent(){const e={type:In.EVENT_GRID_READY};this.eventService.dispatchEvent(e)}setColumnDefs(e){const t=this.gos.get("columnDefs");if(t)return this.waitingForColumns?(this.waitingForColumns=!1,void this.setColumnsAndData(t)):void this.columnModel.setColumnDefs(t,Jn(e.source))}};Gs([No("ctrlsService")],Hg.prototype,"ctrlsService",2),Gs([No("columnModel")],Hg.prototype,"columnModel",2),Gs([No("rowModel")],Hg.prototype,"rowModel",2),Gs([Lo],Hg.prototype,"postConstruct",1),Hg=Gs([Io("syncService")],Hg);var Bg=class extends Pn{constructor(){super(...arguments),this.manuallyDisplayed=!1}postConstruct(){this.addManagedListener(this.eventService,In.EVENT_ROW_DATA_UPDATED,(()=>this.onRowDataUpdated())),this.addManagedListener(this.eventService,In.EVENT_NEW_COLUMNS_LOADED,(()=>this.onNewColumnsLoaded()))}registerOverlayWrapperComp(e){this.overlayWrapperComp=e,(!this.gos.get("columnDefs")||this.gos.isRowModelType("clientSide")&&!this.gos.get("rowData"))&&this.showLoadingOverlay()}showLoadingOverlay(){if(this.gos.get("suppressLoadingOverlay"))return;const e=this.userComponentFactory.getLoadingOverlayCompDetails({});this.showOverlay(e,"ag-overlay-loading-wrapper","loadingOverlayComponentParams")}showNoRowsOverlay(){if(this.gos.get("suppressNoRowsOverlay"))return;const e=this.userComponentFactory.getNoRowsOverlayCompDetails({});this.showOverlay(e,"ag-overlay-no-rows-wrapper","noRowsOverlayComponentParams")}showOverlay(e,t,i){const s=e.newAgStackInstance(),o=this.addManagedPropertyListener(i,(({currentValue:e})=>{s.then((t=>{t.refresh&&t.refresh(this.gos.addGridCommonParams(Ns({},null!=e?e:{})))}))}));this.manuallyDisplayed=this.columnModel.isReady()&&!this.paginationProxy.isEmpty(),this.overlayWrapperComp.showOverlay(s,t,o)}hideOverlay(){this.manuallyDisplayed=!1,this.overlayWrapperComp.hideOverlay()}showOrHideOverlay(){const e=this.paginationProxy.isEmpty(),t=this.gos.get("suppressNoRowsOverlay");e&&!t?this.showNoRowsOverlay():this.hideOverlay()}onRowDataUpdated(){this.showOrHideOverlay()}onNewColumnsLoaded(){!this.columnModel.isReady()||this.paginationProxy.isEmpty()||this.manuallyDisplayed||this.hideOverlay()}};Gs([No("userComponentFactory")],Bg.prototype,"userComponentFactory",2),Gs([No("paginationProxy")],Bg.prototype,"paginationProxy",2),Gs([No("columnModel")],Bg.prototype,"columnModel",2),Gs([Lo],Bg.prototype,"postConstruct",1),Bg=Gs([Io("overlayService")],Bg);var Wg=class extends Pn{constructor(){super(...arguments),this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Eo((()=>this.dispatchQueuedStateUpdateEvents()),0),this.onRowGroupOpenedDebounced=Eo((()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState())),0),this.onRowSelectedDebounced=Eo((()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())}),0),this.staleStateKeys=new Set}postConstruct(){var e;this.isClientSideRowModel="clientSide"===this.rowModel.getType(),this.cachedState=null!=(e=this.gos.get("initialState"))?e:{},this.ctrlsService.whenReady((()=>this.suppressEventsAndDispatchInitEvent((()=>this.setupStateOnGridReady()))));const t=this.addManagedListener(this.eventService,In.EVENT_NEW_COLUMNS_LOADED,(({source:e})=>{"gridInitializing"===e&&(null==t||t(),this.suppressEventsAndDispatchInitEvent((()=>this.setupStateOnColumnsInitialised())))})),i=this.addManagedListener(this.eventService,In.EVENT_ROW_COUNT_READY,(()=>{null==i||i(),this.suppressEventsAndDispatchInitEvent((()=>this.setupStateOnRowCountReady()))})),s=this.addManagedListener(this.eventService,In.EVENT_FIRST_DATA_RENDERED,(()=>{null==s||s(),this.suppressEventsAndDispatchInitEvent((()=>this.setupStateOnFirstDataRendered()))}))}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setupStateOnGridReady(){this.updateCachedState("sideBar",this.getSideBarState()),this.addManagedListener(this.eventService,In.EVENT_TOOL_PANEL_VISIBLE_CHANGED,(()=>this.updateCachedState("sideBar",this.getSideBarState()))),this.addManagedListener(this.eventService,In.EVENT_SIDE_BAR_UPDATED,(()=>this.updateCachedState("sideBar",this.getSideBarState())))}setupStateOnColumnsInitialised(){var e;const t=null!=(e=this.gos.get("initialState"))?e:{};this.setColumnState(t),this.setColumnGroupState(t),this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState()),this.addManagedListener(this.eventService,In.EVENT_COLUMN_VALUE_CHANGED,(()=>this.updateColumnState(["aggregation"]))),this.addManagedListener(this.eventService,In.EVENT_COLUMN_MOVED,(()=>this.updateColumnState(["columnOrder"]))),this.addManagedListener(this.eventService,In.EVENT_COLUMN_PINNED,(()=>this.updateColumnState(["columnPinning"]))),this.addManagedListener(this.eventService,In.EVENT_COLUMN_RESIZED,(()=>this.updateColumnState(["columnSizing"]))),this.addManagedListener(this.eventService,In.EVENT_COLUMN_VISIBLE,(()=>this.updateColumnState(["columnVisibility"]))),this.addManagedListener(this.eventService,In.EVENT_COLUMN_PIVOT_CHANGED,(()=>this.updateColumnState(["pivot"]))),this.addManagedListener(this.eventService,In.EVENT_COLUMN_PIVOT_MODE_CHANGED,(()=>this.updateColumnState(["pivot"]))),this.addManagedListener(this.eventService,In.EVENT_COLUMN_ROW_GROUP_CHANGED,(()=>this.updateColumnState(["rowGroup"]))),this.addManagedListener(this.eventService,In.EVENT_SORT_CHANGED,(()=>this.updateColumnState(["sort"]))),this.addManagedListener(this.eventService,In.EVENT_NEW_COLUMNS_LOADED,(()=>this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","pivot","rowGroup","sort"]))),this.addManagedListener(this.eventService,In.EVENT_COLUMN_GROUP_OPENED,(()=>this.updateCachedState("columnGroup",this.getColumnGroupState())))}setupStateOnRowCountReady(){var e;const{filter:t,rowGroupExpansion:i,rowSelection:s,pagination:o}=null!=(e=this.gos.get("initialState"))?e:{},n=this.gos.get("advancedFilterModel");(t||n)&&this.setFilterState(t,n),i&&this.setRowGroupExpansionState(i),s&&this.setRowSelectionState(s),o&&this.setPaginationState(o),this.updateCachedState("filter",this.getFilterState()),this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowSelection",this.getRowSelectionState()),this.updateCachedState("pagination",this.getPaginationState()),this.addManagedListener(this.eventService,In.EVENT_FILTER_CHANGED,(()=>this.updateCachedState("filter",this.getFilterState()))),this.addManagedListener(this.eventService,In.EVENT_ROW_GROUP_OPENED,(()=>this.onRowGroupOpenedDebounced())),this.addManagedListener(this.eventService,In.EVENT_EXPAND_COLLAPSE_ALL,(()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()))),this.addManagedListener(this.eventService,In.EVENT_SELECTION_CHANGED,(()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()})),this.addManagedListener(this.eventService,In.EVENT_PAGINATION_CHANGED,(e=>{(e.newPage||e.newPageSize)&&this.updateCachedState("pagination",this.getPaginationState())}))}setupStateOnFirstDataRendered(){var e;const{scroll:t,rangeSelection:i,focusedCell:s,columnOrder:o}=null!=(e=this.gos.get("initialState"))?e:{};s&&this.setFocusedCellState(s),i&&this.setRangeSelectionState(i),t&&this.setScrollState(t),this.setColumnPivotState(!!(null==o?void 0:o.orderedColIds)),this.updateCachedState("sideBar",this.getSideBarState()),this.updateCachedState("focusedCell",this.getFocusedCellState()),this.updateCachedState("rangeSelection",this.getRangeSelectionState()),this.updateCachedState("scroll",this.getScrollState()),this.addManagedListener(this.eventService,In.EVENT_CELL_FOCUSED,(()=>this.updateCachedState("focusedCell",this.getFocusedCellState()))),this.addManagedListener(this.eventService,In.EVENT_RANGE_SELECTION_CHANGED,(e=>{e.finished&&this.updateCachedState("rangeSelection",this.getRangeSelectionState())})),this.addManagedListener(this.eventService,In.EVENT_BODY_SCROLL_END,(()=>this.updateCachedState("scroll",this.getScrollState())))}getColumnState(){const e=this.columnModel.isPivotMode(),t=[],i=[],s=[],o=[],n=[],r=[],a=[],l=[],u=[],h=this.columnModel.getColumnState();for(let e=0;e<h.length;e++){const{colId:d,sort:c,sortIndex:p,rowGroup:g,rowGroupIndex:m,aggFunc:f,pivot:C,pivotIndex:v,pinned:w,hide:y,width:E,flex:S}=h[e];u.push(d),c&&(t[null!=p?p:0]={colId:d,sort:c}),g&&(i[null!=m?m:0]=d),"string"==typeof f&&s.push({colId:d,aggFunc:f}),C&&(o[null!=v?v:0]=d),w&&("right"===w?r:n).push(d),y&&a.push(d),(S||E)&&l.push({colId:d,flex:null!=S?S:void 0,width:E})}return{sort:t.length?{sortModel:t}:void 0,rowGroup:i.length?{groupColIds:i}:void 0,aggregation:s.length?{aggregationModel:s}:void 0,pivot:o.length||e?{pivotMode:e,pivotColIds:o}:void 0,columnPinning:n.length||r.length?{leftColIds:n,rightColIds:r}:void 0,columnVisibility:a.length?{hiddenColIds:a}:void 0,columnSizing:l.length?{columnSizingModel:l}:void 0,columnOrder:u.length?{orderedColIds:u}:void 0}}setColumnState(e){const{sort:t,rowGroup:i,aggregation:s,pivot:o,columnPinning:n,columnVisibility:r,columnSizing:a,columnOrder:l}=e,u={},h=e=>{let t=u[e];return t||(t={colId:e},u[e]=t,t)};t&&t.sortModel.forEach((({colId:e,sort:t},i)=>{const s=h(e);s.sort=t,s.sortIndex=i})),i&&i.groupColIds.forEach(((e,t)=>{const i=h(e);i.rowGroup=!0,i.rowGroupIndex=t})),s&&s.aggregationModel.forEach((({colId:e,aggFunc:t})=>{h(e).aggFunc=t})),o&&(o.pivotColIds.forEach(((e,t)=>{const i=h(e);i.pivot=!0,i.pivotIndex=t})),this.gos.updateGridOptions({options:{pivotMode:o.pivotMode},source:"gridInitializing"})),n&&(n.leftColIds.forEach((e=>{h(e).pinned="left"})),n.rightColIds.forEach((e=>{h(e).pinned="right"}))),r&&r.hiddenColIds.forEach((e=>{h(e).hide=!0})),a&&a.columnSizingModel.forEach((({colId:e,flex:t,width:i})=>{const s=h(e);s.flex=null!=t?t:null,s.width=i}));const d=null==l?void 0:l.orderedColIds,c=!!(null==d?void 0:d.length),p=c?d.map((e=>h(e))):Object.values(u);if(p.length){this.columnStates=p;const e={sort:null,sortIndex:null,rowGroup:null,rowGroupIndex:null,aggFunc:null,pivot:null,pivotIndex:null,pinned:null,hide:null,flex:null};this.columnModel.applyColumnState({state:p,applyOrder:c,defaultState:e},"gridInitializing")}}setColumnPivotState(e){const t=this.columnStates;this.columnStates=void 0;const i=this.columnGroupStates;if(this.columnGroupStates=void 0,this.columnModel.isSecondaryColumnsPresent()){if(t){let i=[];for(const e of t)this.columnModel.getSecondaryColumn(e.colId)&&i.push(e);this.columnModel.applyColumnState({state:i,applyOrder:e},"gridInitializing")}i&&this.columnModel.setColumnGroupState(i,"gridInitializing")}}getColumnGroupState(){const e=this.columnModel.getColumnGroupState(),t=[];return e.forEach((({groupId:e,open:i})=>{i&&t.push(e)})),t.length?{openColumnGroupIds:t}:void 0}setColumnGroupState(e){var t;if(!e.hasOwnProperty("columnGroup"))return;const i=new Set(null==(t=e.columnGroup)?void 0:t.openColumnGroupIds),s=this.columnModel.getColumnGroupState().map((({groupId:e})=>{const t=i.has(e);return t&&i.delete(e),{groupId:e,open:t}}));i.forEach((e=>{s.push({groupId:e,open:!0})})),s.length&&(this.columnGroupStates=s),this.columnModel.setColumnGroupState(s,"gridInitializing")}getFilterState(){var e;let t=this.filterManager.getFilterModel();t&&0===Object.keys(t).length&&(t=void 0);const i=null!=(e=this.filterManager.getAdvancedFilterModel())?e:void 0;return t||i?{filterModel:t,advancedFilterModel:i}:void 0}setFilterState(e,t){const{filterModel:i,advancedFilterModel:s}=null!=e?e:{advancedFilterModel:t};i&&this.filterManager.setFilterModel(i,"columnFilter"),s&&this.filterManager.setAdvancedFilterModel(s)}getRangeSelectionState(){var e;const t=null==(e=this.rangeService)?void 0:e.getCellRanges().map((e=>{const{id:t,type:i,startRow:s,endRow:o,columns:n,startColumn:r}=e;return{id:t,type:i,startRow:s,endRow:o,colIds:n.map((e=>e.getColId())),startColId:r.getColId()}}));return(null==t?void 0:t.length)?{cellRanges:t}:void 0}setRangeSelectionState(e){if(!this.gos.get("enableRangeSelection")||!this.rangeService)return;const t=[];e.cellRanges.forEach((e=>{const i=[];if(e.colIds.forEach((e=>{const t=this.columnModel.getGridColumn(e);t&&i.push(t)})),!i.length)return;let s=this.columnModel.getGridColumn(e.startColId);if(!s){const e=this.columnModel.getAllDisplayedColumns(),t=new Set(i);s=e.find((e=>t.has(e)))}t.push(_s(Ns({},e),{columns:i,startColumn:s}))})),this.rangeService.setCellRanges(t)}getScrollState(){var e,t,i;if(!this.isClientSideRowModel)return;const s=null==(e=this.ctrlsService.getGridBodyCtrl())?void 0:e.getScrollFeature(),{left:o}=null!=(t=null==s?void 0:s.getHScrollPosition())?t:{left:0},{top:n}=null!=(i=null==s?void 0:s.getVScrollPosition())?i:{top:0};return n||o?{top:n,left:o}:void 0}setScrollState(e){var t;if(!this.isClientSideRowModel)return;const{top:i,left:s}=e;null==(t=this.ctrlsService.getGridBodyCtrl())||t.getScrollFeature().setScrollPosition(i,s)}getSideBarState(){var e,t;return null==(t=null==(e=this.sideBarService)?void 0:e.getSideBarComp())?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.focusService.getFocusedCell();if(e){const{column:t,rowIndex:i,rowPinned:s}=e;return{colId:t.getColId(),rowIndex:i,rowPinned:s}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{colId:t,rowIndex:i,rowPinned:s}=e;this.focusService.setFocusedCell({column:this.columnModel.getGridColumn(t),rowIndex:i,rowPinned:s,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const e=this.paginationProxy.getCurrentPage(),t=this.gos.get("paginationAutoPageSize")?void 0:this.paginationProxy.getPageSize();if(e||t)return{page:e,pageSize:t}}setPaginationState(e){e.pageSize&&!this.gos.get("paginationAutoPageSize")&&this.paginationProxy.setPageSize(e.pageSize,"initialState"),"number"==typeof e.page&&this.paginationProxy.setPage(e.page)}getRowSelectionState(){var e;const t=this.selectionService.getSelectionState();return t&&(Array.isArray(t)||!1!==t.selectAll&&!1!==t.selectAllChildren||(null==(e=null==t?void 0:t.toggledNodes)?void 0:e.length))?t:void 0}setRowSelectionState(e){this.selectionService.setSelectionState(e,"gridInitializing")}getRowGroupExpansionState(){const e=this.expansionService.getExpandedRows();return e.length?{expandedRowGroupIds:e}:void 0}setRowGroupExpansionState(e){this.expansionService.expandRows(e.expandedRowGroupIds)}updateColumnState(e){const t=this.getColumnState();let i=!1;Object.entries(t).forEach((([e,t])=>{Ys(t,this.cachedState[e])||(i=!0)})),this.cachedState=Ns(Ns({},this.cachedState),t),i&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const i=this.cachedState[e];this.setCachedStateValue(e,t),Ys(t,i)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState=_s(Ns({},this.cachedState),{[e]:t})}refreshStaleState(){this.staleStateKeys.forEach((e=>{"rowSelection"===e&&this.setCachedStateValue(e,this.getRowSelectionState())})),this.staleStateKeys.clear()}dispatchStateUpdateEvent(e){this.suppressEvents||(e.forEach((e=>this.queuedUpdateSources.add(e))),this.dispatchStateUpdateEventDebounced())}dispatchQueuedStateUpdateEvents(){const e=Array.from(this.queuedUpdateSources);this.queuedUpdateSources.clear();const t={type:In.EVENT_STATE_UPDATED,sources:e,state:this.cachedState};this.eventService.dispatchEvent(t)}suppressEventsAndDispatchInitEvent(e){this.suppressEvents=!0,this.columnAnimationService.setSuppressAnimation(!0),e(),setTimeout((()=>{this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&(this.columnAnimationService.setSuppressAnimation(!1),this.dispatchStateUpdateEvent(["gridInitializing"]))}))}};Gs([No("filterManager")],Wg.prototype,"filterManager",2),Gs([No("ctrlsService")],Wg.prototype,"ctrlsService",2),Gs([No("focusService")],Wg.prototype,"focusService",2),Gs([No("columnModel")],Wg.prototype,"columnModel",2),Gs([No("paginationProxy")],Wg.prototype,"paginationProxy",2),Gs([No("rowModel")],Wg.prototype,"rowModel",2),Gs([No("selectionService")],Wg.prototype,"selectionService",2),Gs([No("expansionService")],Wg.prototype,"expansionService",2),Gs([No("columnAnimationService")],Wg.prototype,"columnAnimationService",2),Gs([_o("sideBarService")],Wg.prototype,"sideBarService",2),Gs([_o("rangeService")],Wg.prototype,"rangeService",2),Gs([Lo],Wg.prototype,"postConstruct",1),Wg=Gs([Io("stateService")],Wg);var Ug=class extends Pn{init(){this.processGridOptions(this.gridOptions)}processGridOptions(e){this.processOptions(e,xg)}processColumnDefs(e){this.processOptions(e,Fg)}processOptions(e,t){const{validations:i,deprecations:s,allProperties:o,propertyExceptions:n,objectName:r,docsUrl:a}=t;o&&!0!==this.gridOptions.suppressPropertyNamesCheck&&this.checkProperties(e,[...null!=n?n:[],...Object.keys(s)],o,r,a);const l=new Set;Object.keys(e).forEach((t=>{var o;const n=s[t];if(n)if("renamed"in n){const{renamed:i,version:s}=n;l.add(`As of v${s}, ${String(t)} is deprecated. Please use ${String(i)} instead.`),e[i]=e[t]}else{const{message:e,version:i}=n;l.add(`As of v${i}, ${String(t)} is deprecated. ${null!=e?e:""}`)}const r=e[t];if(null==r||!1===r)return;const a=i[t];let u;if(!a)return;if("function"==typeof a){const i=a(e,this.gridOptions);if(!i)return;if("objectName"in i){const s=e[t];return Array.isArray(s)?void s.forEach((e=>{this.processOptions(e,i)})):void this.processOptions(e[t],i)}u=i}else u=a;const{module:h,dependencies:d,supportedRowModels:c}=u;if(c){const e=null!=(o=this.gridOptions.rowModelType)?o:"clientSide";if(!c.includes(e))return void l.add(`${String(t)} is not supported with the '${e}' row model.`)}if(h){const e=Array.isArray(h)?h:[h];let i=!0;if(e.forEach((e=>{Po.__assertRegistered(e,String(t),this.context.getGridId())||(i=!1,l.add(`${String(t)} is only available when ${e} is loaded.`))})),!i)return}if(d){const i=this.checkForWarning(t,d,e);if(i)return void l.add(i)}})),l.size>0&&l.forEach((e=>{co(e)}))}checkForWarning(e,t,i){if("function"==typeof t)return t(i,this.gridOptions);const s=Object.entries(t).find((([e,t])=>{const s=i[e];return!t.includes(s)}));if(!s)return null;const[o,n]=s;return n.length>1?`'${String(e)}' requires '${o}' to be one of [${n.join(", ")}].`:`'${String(e)}' requires '${o}' to be ${n[0]}.`}checkProperties(e,t,i,s,o){const n=pl(Object.getOwnPropertyNames(e),["__ob__","__v_skip","__metadata__",...t,...i],i);if(eo(n,((e,t)=>{co(`invalid ${s} property '${e}' did you mean any of these: ${t.slice(0,8).join(", ")}`)})),Object.keys(n).length>0&&o){const e=this.getFrameworkOverrides().getDocLink(o);co(`to see all the valid ${s} properties please check: ${e}`)}}};Gs([No("gridOptions")],Ug.prototype,"gridOptions",2),Gs([Lo],Ug.prototype,"init",1),Ug=Gs([Io("validationService")],Ug);var zg=class extends Pn{constructor(){super(...arguments),this.syncEventListeners=new Map,this.asyncEventListeners=new Map,this.syncGlobalEventListeners=new Set,this.globalEventListenerPairs=new Map}postConstruct(){this.frameworkEventWrappingService=new Ho(this.getFrameworkOverrides())}addEventListener(e,t){const i=this.frameworkEventWrappingService.wrap(t),s=this.gos.useAsyncEvents()&&!Nn.has(e),o=s?this.asyncEventListeners:this.syncEventListeners;o.has(e)||o.set(e,new Set),o.get(e).add(i),this.eventService.addEventListener(e,i,s)}removeEventListener(e,t){var i;const s=this.frameworkEventWrappingService.unwrap(t),o=this.asyncEventListeners.get(e),n=!!(null==o?void 0:o.delete(s));n||null==(i=this.syncEventListeners.get(e))||i.delete(s),this.eventService.removeEventListener(e,s,n)}addGlobalListener(e){const t=this.frameworkEventWrappingService.wrapGlobal(e);if(this.gos.useAsyncEvents()){const i=(e,i)=>{Nn.has(e)&&t(e,i)},s=(e,i)=>{Nn.has(e)||t(e,i)};this.globalEventListenerPairs.set(e,{syncListener:i,asyncListener:s}),this.eventService.addGlobalListener(i,!1),this.eventService.addGlobalListener(s,!0)}else this.syncGlobalEventListeners.add(t),this.eventService.addGlobalListener(t,!1)}removeGlobalListener(e){const t=this.frameworkEventWrappingService.unwrapGlobal(e);if(this.globalEventListenerPairs.has(t)){const{syncListener:i,asyncListener:s}=this.globalEventListenerPairs.get(t);this.eventService.removeGlobalListener(i,!1),this.eventService.removeGlobalListener(s,!0),this.globalEventListenerPairs.delete(e)}else this.syncGlobalEventListeners.delete(t),this.eventService.removeGlobalListener(t,!1)}destroyEventListeners(e,t){e.forEach(((e,i)=>{e.forEach((e=>this.eventService.removeEventListener(i,e,t))),e.clear()})),e.clear()}destroyGlobalListeners(e,t){e.forEach((e=>this.eventService.removeGlobalListener(e,t))),e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncEventListeners,!1),this.destroyEventListeners(this.asyncEventListeners,!0),this.destroyGlobalListeners(this.syncGlobalEventListeners,!1),this.globalEventListenerPairs.forEach((({syncListener:e,asyncListener:t})=>{this.eventService.removeGlobalListener(e,!1),this.eventService.removeGlobalListener(t,!0)})),this.globalEventListenerPairs.clear()}};Gs([Lo],zg.prototype,"postConstruct",1),zg=Gs([Io("apiEventService")],zg);var $g=class extends Yl{constructor(){super('<span class="ag-paging-page-size"></span>'),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.paginationProxy.getPageSize()||(this.paginationProxy.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}init(){this.addManagedPropertyListener("paginationPageSizeSelector",(()=>{this.onPageSizeSelectorValuesChange()})),this.addManagedListener(this.eventService,In.EVENT_PAGINATION_CHANGED,(e=>this.handlePaginationChanged(e)))}handlePaginationChanged(e){if(!this.selectPageSizeComp||!(null==e?void 0:e.newPageSize))return;const t=this.paginationProxy.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp&&this.appendChild(this.selectPageSizeComp))}reset(){za(this.getGui()),this.selectPageSizeComp&&(this.destroyBean(this.selectPageSizeComp),this.selectPageSizeComp=void 0)}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel")&&!this.gos.get("paginationAutoPageSize")&&!1!==this.gos.get("paginationPageSizeSelector")}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.paginationProxy.getPageSize(),i=!t||!e.includes(t);i&&(e.unshift(""),co("The paginationPageSize grid option is set to a value that is not in the list of page size options.\n Please make sure that the paginationPageSize grid option is set to one of the values in the \n paginationPageSizeSelector array, or set the paginationPageSizeSelector to false to hide the page size selector.")),this.selectPageSizeComp&&(this.destroyBean(this.selectPageSizeComp),this.selectPageSizeComp=void 0);const s=this.localeService.getLocaleTextFunc(),o=s("pageSizeSelectorLabel","Page Size:"),n=e.map((e=>({value:String(e),text:String(e)}))),r=s("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new gu).addOptions(n).setValue(String(i?"":t)).setAriaLabel(r).setLabel(o).onValueChange((()=>this.handlePageSizeItemSelected())),this.hasEmptyOption=i}getPageSizeSelectorValues(){const e=this.gos.get("paginationPageSizeSelector");return Array.isArray(e)&&this.validateValues(e)?[...e].sort(((e,t)=>e-t)):[20,50,100]}validateValues(e){if(!e.length)return co("The paginationPageSizeSelector grid option is an empty array. This is most likely a mistake.\n If you want to hide the page size selector, please set the paginationPageSizeSelector to false."),!1;for(let t=0;t<e.length;t++){const i=e[t],s=i>0;if("number"!=typeof i)return co("The paginationPageSizeSelector grid option contains a non-numeric value.\n Please make sure that all values in the paginationPageSizeSelector array are numbers."),!1;if(!s)return co("The paginationPageSizeSelector grid option contains a negative number or zero.\n Please make sure that all values in the paginationPageSizeSelector array are positive."),!1}return!0}destroy(){this.toggleSelectDisplay(!1),super.destroy()}};Gs([No("paginationProxy")],$g.prototype,"paginationProxy",2),Gs([Lo],$g.prototype,"init",1);var Kg=class extends Pn{constructor(){super(),this.descriptionContainer=null,this.announceValue=Eo(this.announceValue.bind(this),200)}postConstruct(){const e=this.gos.getDocument(),t=this.descriptionContainer=e.createElement("div");t.classList.add("ag-aria-description-container"),yr(t,"polite"),Sr(t,"additions text"),Er(t,!0),this.eGridDiv.appendChild(t)}announceValue(e){this.descriptionContainer&&(this.descriptionContainer.textContent="",setTimeout((()=>{this.isAlive()&&this.descriptionContainer&&(this.descriptionContainer.textContent=e)}),50))}destroy(){super.destroy();const{descriptionContainer:e}=this;e&&(za(e),e.parentElement&&e.parentElement.removeChild(e)),this.descriptionContainer=null,this.eGridDiv=null}};Gs([No("eGridDiv")],Kg.prototype,"eGridDiv",2),Gs([Lo],Kg.prototype,"postConstruct",1),Kg=Gs([Io("ariaAnnouncementService")],Kg);var jg=class{};jg.gridOptions=void 0;var Yg=1,qg=class{create(e,t,i,s,o){var n;let r={};jg.gridOptions?(oo(r,jg.gridOptions,!0,!0),r=Ns(Ns({},r),t)):r=t;const a=Ig.getCoercedGridOptions(r),l=!!a.debug,u=null!=(n=a.gridId)?n:String(Yg++),h=this.getRegisteredModules(o,u),d=this.createBeansList(a.rowModelType,h,u),c=this.createProvidedBeans(e,a,o);if(!d)return void po("Failed to create grid.");const p={providedBeanInstances:c,beanClasses:d,debug:l,gridId:u},g=new Up("Context",(()=>p.debug)),m=new Fo(p,g),f=m.getBean("beans");return this.registerModuleUserComponents(f,h),this.registerStackComponents(f,h),this.registerControllers(f,h),i(m),f.syncService.start(),s&&s(m),m.getBean("gridApi")}registerControllers(e,t){t.forEach((t=>{t.controllers&&t.controllers.forEach((t=>e.ctrlsFactory.register(t)))}))}registerStackComponents(e,t){const i=this.createAgStackComponentsList(t);e.agStackComponentsRegistry.setupComponents(i)}getRegisteredModules(e,t){const i=e?e.modules:null,s=Po.__getRegisteredModules(t),o=[],n={},r=(e,t,i)=>{var s;n[(s=t).moduleName]||(n[s.moduleName]=!0,o.push(s),Po.__register(s,e,i)),t.dependantModules&&t.dependantModules.forEach((t=>r(e,t,i)))};return i&&i.forEach((e=>r(!0,e,t))),s&&s.forEach((e=>r(!Po.__isPackageBased(),e,void 0))),o}registerModuleUserComponents(e,t){this.extractModuleEntity(t,(e=>e.userComponents?e.userComponents:[])).forEach((t=>{e.userComponentRegistry.registerDefaultComponent(t.componentName,t.componentClass)}))}createProvidedBeans(e,t,i){let s=i?i.frameworkOverrides:null;Ws(s)&&(s=new _p);const o={gridOptions:t,eGridDiv:e,globalEventListener:i?i.globalEventListener:null,globalSyncEventListener:i?i.globalSyncEventListener:null,frameworkOverrides:s};return i&&i.providedBeanInstances&&Object.assign(o,i.providedBeanInstances),o}createAgStackComponentsList(e){let t=[{componentName:"AgCheckbox",componentClass:fu},{componentName:"AgRadioButton",componentClass:Cu},{componentName:"AgToggleButton",componentClass:sp},{componentName:"AgInputTextField",componentClass:Fu},{componentName:"AgInputTextArea",componentClass:op},{componentName:"AgInputNumberField",componentClass:Mu},{componentName:"AgInputDateField",componentClass:np},{componentName:"AgInputRange",componentClass:rp},{componentName:"AgRichSelect",componentClass:hp},{componentName:"AgSelect",componentClass:gu},{componentName:"AgSlider",componentClass:cp},{componentName:"AgGridBody",componentClass:Xd},{componentName:"AgHeaderRoot",componentClass:_c},{componentName:"AgSortIndicator",componentClass:Ku},{componentName:"AgPagination",componentClass:rg},{componentName:"AgPageSizeSelector",componentClass:$g},{componentName:"AgOverlayWrapper",componentClass:lg},{componentName:"AgGroupComponent",componentClass:gp},{componentName:"AgRowContainer",componentClass:oc},{componentName:"AgFakeHorizontalScroll",componentClass:Rg},{componentName:"AgFakeVerticalScroll",componentClass:Og},{componentName:"AgAutocomplete",componentClass:Mp}];const i=this.extractModuleEntity(e,(e=>e.agStackComponents?e.agStackComponents:[]));return t=t.concat(i),t}createBeansList(e="clientSide",t,i){const s=t.filter((t=>!t.rowModel||t.rowModel===e)),o={clientSide:"@ag-grid-community/client-side-row-model",infinite:"@ag-grid-community/infinite-row-model",serverSide:"@ag-grid-enterprise/server-side-row-model",viewport:"@ag-grid-enterprise/viewport-row-model"};if(!o[e])return void po("Could not find row model for rowModelType = "+e);if(!Po.__assertRegistered(o[e],`rowModelType = '${e}'`,i))return;const n=[Td,ug,hg,fg,Xp,dd,Gh,Zp,eg,Wc,od,og,Oc,Ng,Ug,Xc,ad,er,Vo,Ig,Dp,kp,pd,Qn,xc,tp,Yc,Bp,Fn,Gp,Zd,Qp,Hp,Wp,Kc,Gc,hh,Vp,jp,Jd,sg,Op,ip,Qd,Kp,Yp,qp,ng,kn,Jp,Uc,mg,rr,Cg,vg,ep,wg,yg,Dg,Tg,Eg,Vg,cd,Hg,Bg,Wg,zc,zg,Kg,$c],r=this.extractModuleEntity(s,(e=>e.beans?e.beans:[]));n.push(...r);const a=[];return n.forEach((e=>{a.indexOf(e)<0&&a.push(e)})),a}extractModuleEntity(e,t){return[].concat(...e.map(t))}},Xg=class{wrap(e,t,i=[],s){const o=this.createWrapper(e,s);return t.forEach((e=>{this.createMethod(o,e,!0)})),i.forEach((e=>{this.createMethod(o,e,!1)})),o}unwrap(e){return e}createMethod(e,t,i){e.addMethod(t,this.createMethodProxy(e,t,i))}createMethodProxy(e,t,i){return function(){return e.hasMethod(t)?e.callMethod(t,arguments):(i&&console.warn("AG Grid: Framework component is missing the method "+t+"()"),null)}}},Qg=class{};Qg.CHART_TYPE_TO_SERIES_TYPE={column:"bar",groupedColumn:"bar",stackedColumn:"bar",normalizedColumn:"bar",bar:"bar",groupedBar:"bar",stackedBar:"bar",normalizedBar:"bar",line:"line",scatter:"scatter",bubble:"bubble",pie:"pie",donut:"donut",doughnut:"donut",area:"area",stackedArea:"area",normalizedArea:"area",histogram:"histogram",radarLine:"radar-line",radarArea:"radar-area",nightingale:"nightingale",radialColumn:"radial-column",radialBar:"radial-bar",sunburst:"sunburst",rangeBar:"range-bar",rangeArea:"range-area",boxPlot:"box-plot",treemap:"treemap",heatmap:"heatmap",waterfall:"waterfall"},Qg.COMBO_CHART_TYPES=["columnLineCombo","areaColumnCombo","customCombo"],Qg.SERIES_GROUP_TYPES=["grouped","stacked","normalized"];var Jg="undefined"==typeof global?{}:global;Jg.HTMLElement="undefined"==typeof HTMLElement?{}:HTMLElement,Jg.HTMLButtonElement="undefined"==typeof HTMLButtonElement?{}:HTMLButtonElement,Jg.HTMLSelectElement="undefined"==typeof HTMLSelectElement?{}:HTMLSelectElement,Jg.HTMLInputElement="undefined"==typeof HTMLInputElement?{}:HTMLInputElement,Jg.Node="undefined"==typeof Node?{}:Node,Jg.MouseEvent="undefined"==typeof MouseEvent?{}:MouseEvent;var Zg=class e{constructor(t,i,s,o,n,r){this.nextId=0,this.rowCountReady=!1,this.allNodesMap={},this.rootNode=t,this.gos=i,this.eventService=s,this.columnModel=o,this.beans=r,this.selectionService=n,this.rootNode.group=!0,this.rootNode.level=-1,this.rootNode.id=e.ROOT_NODE_ID,this.rootNode.allLeafChildren=[],this.rootNode.childrenAfterGroup=[],this.rootNode.childrenAfterSort=[],this.rootNode.childrenAfterAggFilter=[],this.rootNode.childrenAfterFilter=[]}getCopyOfNodesMap(){return Vl.cloneObject(this.allNodesMap)}getRowNode(e){return this.allNodesMap[e]}setRowData(t){if("string"==typeof t)return void console.warn("AG Grid: rowData must be an array.");this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(t);const i=this.rootNode,s=this.rootNode.sibling;i.childrenAfterFilter=null,i.childrenAfterGroup=null,i.childrenAfterAggFilter=null,i.childrenAfterSort=null,i.childrenMapped=null,i.updateHasChildren(),this.nextId=0,this.allNodesMap={},t?i.allLeafChildren=t.map((t=>this.createNode(t,this.rootNode,e.TOP_LEVEL))):(i.allLeafChildren=[],i.childrenAfterGroup=[]),s&&(s.childrenAfterFilter=i.childrenAfterFilter,s.childrenAfterGroup=i.childrenAfterGroup,s.childrenAfterAggFilter=i.childrenAfterAggFilter,s.childrenAfterSort=i.childrenAfterSort,s.childrenMapped=i.childrenMapped,s.allLeafChildren=i.allLeafChildren)}updateRowData(e,t){this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(e.add);const i={remove:[],update:[],add:[]},s=[];return this.executeRemove(e,i,s),this.executeUpdate(e,i,s),this.executeAdd(e,i),this.updateSelection(s,"rowDataChanged"),t&&Vl.sortRowNodesByOrder(this.rootNode.allLeafChildren,t),i}isRowCountReady(){return this.rowCountReady}dispatchRowDataUpdateStartedEvent(e){const t={type:In.EVENT_ROW_DATA_UPDATE_STARTED,firstRowData:(null==e?void 0:e.length)?e[0]:null};this.eventService.dispatchEvent(t)}updateSelection(e,t){const i=e.length>0;if(i&&this.selectionService.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t}),this.selectionService.updateGroupsFromChildrenSelections(t),i){const e={type:In.EVENT_SELECTION_CHANGED,source:t};this.eventService.dispatchEvent(e)}}executeAdd(t,i){var s;const{add:o,addIndex:n}=t;if(Vl.missingOrEmpty(o))return;const r=o.map((t=>this.createNode(t,this.rootNode,e.TOP_LEVEL)));if("number"==typeof n&&n>=0){const{allLeafChildren:e}=this.rootNode,t=e.length;let i=n;if(this.gos.get("treeData")&&n>0&&t>0)for(let o=0;o<t;o++)if((null==(s=e[o])?void 0:s.rowIndex)==n-1){i=o+1;break}const o=e.slice(0,i),a=e.slice(i,e.length);this.rootNode.allLeafChildren=[...o,...r,...a]}else this.rootNode.allLeafChildren=[...this.rootNode.allLeafChildren,...r];this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren),i.add=r}executeRemove(e,t,i){const{remove:s}=e;if(Vl.missingOrEmpty(s))return;const o={};s.forEach((e=>{const s=this.lookupRowNode(e);s&&(s.isSelected()&&i.push(s),s.clearRowTopAndRowIndex(),o[s.id]=!0,delete this.allNodesMap[s.id],t.remove.push(s))})),this.rootNode.allLeafChildren=this.rootNode.allLeafChildren.filter((e=>!o[e.id])),this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren)}executeUpdate(t,i,s){const{update:o}=t;Vl.missingOrEmpty(o)||o.forEach((t=>{const o=this.lookupRowNode(t);o&&(o.updateData(t),!o.selectable&&o.isSelected()&&s.push(o),this.setMasterForRow(o,t,e.TOP_LEVEL,!1),i.update.push(o))}))}lookupRowNode(e){const t=this.gos.getCallback("getRowId");let i;if(t){const s=t({data:e,level:0});if(i=this.allNodesMap[s],!i)return console.error(`AG Grid: could not find row id=${s}, data item was not found for this id`),null}else if(i=this.rootNode.allLeafChildren.find((t=>t.data===e)),!i)return console.error("AG Grid: could not find data item as object was not found",e),console.error("Consider using getRowId to help the Grid find matching row data"),null;return i||null}createNode(e,t,i){const s=new ah(this.beans);s.group=!1,this.setMasterForRow(s,e,i,!0);const o=this.gos.get("suppressParentsInRowNodes");return t&&!o&&(s.parent=t),s.level=i,s.setDataAndId(e,this.nextId.toString()),this.allNodesMap[s.id]&&console.warn(`AG Grid: duplicate node id '${s.id}' detected from getRowId callback, this could cause issues in your grid.`),this.allNodesMap[s.id]=s,this.nextId++,s}setMasterForRow(e,t,i,s){if(this.gos.get("treeData"))e.setMaster(!1),s&&(e.expanded=!1);else{if(this.gos.get("masterDetail")){const i=this.gos.get("isRowMaster");i?e.setMaster(i(t)):e.setMaster(!0)}else e.setMaster(!1);if(s){const t=this.columnModel.getRowGroupColumns(),s=i+(t?t.length:0);e.expanded=!!e.master&&this.isExpanded(s)}}}isExpanded(e){const t=this.gos.get("groupDefaultExpanded");return-1===t||e<t}};Zg.TOP_LEVEL=0,Zg.ROOT_NODE_ID="ROOT_NODE_ID";var em=Zg,tm=class extends Pn{constructor(){super(...arguments),this.onRowHeightChanged_debounced=Vl.debounce(this.onRowHeightChanged.bind(this),100),this.rowsToDisplay=[],this.hasStarted=!1,this.shouldSkipSettingDataOnStart=!1,this.isRefreshingModel=!1,this.rowCountReady=!1}init(){const e=this.refreshModel.bind(this,{step:"group"}),t=!this.gos.get("suppressAnimationFrame"),i=this.refreshModel.bind(this,{step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:t});this.addManagedListener(this.eventService,In.EVENT_NEW_COLUMNS_LOADED,i),this.addManagedListener(this.eventService,In.EVENT_COLUMN_ROW_GROUP_CHANGED,e),this.addManagedListener(this.eventService,In.EVENT_COLUMN_VALUE_CHANGED,this.onValueChanged.bind(this)),this.addManagedListener(this.eventService,In.EVENT_COLUMN_PIVOT_CHANGED,this.refreshModel.bind(this,{step:"pivot"})),this.addManagedListener(this.eventService,In.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,In.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,In.EVENT_COLUMN_PIVOT_MODE_CHANGED,e),this.addManagedListener(this.eventService,In.EVENT_GRID_STYLES_CHANGED,this.onGridStylesChanges.bind(this)),this.addManagedListener(this.eventService,In.EVENT_GRID_READY,(()=>this.onGridReady())),this.addPropertyListeners(),this.rootNode=new ah(this.beans),this.nodeManager=new em(this.rootNode,this.gos,this.eventService,this.columnModel,this.selectionService,this.beans)}addPropertyListeners(){const e=new Set(["treeData","masterDetail"]),t=new Set(["suppressParentsInRowNodes","groupDefaultExpanded","groupAllowUnbalanced","initialGroupOrderComparator","groupHideOpenParents","groupDisplayType"]),i=new Set(["excludeChildrenWhenTreeDataFiltering"]),s=new Set(["removePivotHeaderRowWhenSingleValueColumn","pivotRowTotals","pivotColumnGroupTotals","suppressExpandablePivotGroups"]),o=new Set(["getGroupRowAgg","alwaysAggregateAtRootLevel","groupIncludeTotalFooter","suppressAggFilteredOnly","grandTotalRow"]),n=new Set(["postSortRows","groupDisplayType","accentedSort"]),r=new Set([]),a=new Set(["groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupIncludeFooter","groupTotalRow"]),l=[...e,...t,...i,...s,...s,...o,...n,...r,...a];this.addManagedPropertyListeners(l,(l=>{var u;const h=null==(u=l.changeSet)?void 0:u.properties;if(!h)return;const d=e=>h.some((t=>e.has(t)));d(e)?this.setRowData(this.rootNode.allLeafChildren.map((e=>e.data))):d(t)?this.refreshModel({step:"group"}):d(i)?this.refreshModel({step:"filter"}):d(s)?this.refreshModel({step:"pivot"}):d(o)?this.refreshModel({step:"aggregate"}):d(n)?this.refreshModel({step:"sort"}):d(r)?this.refreshModel({step:"filter_aggregates"}):d(a)&&this.refreshModel({step:"map"})})),this.addManagedPropertyListener("rowHeight",(()=>this.resetRowHeights()))}start(){this.hasStarted=!0,this.shouldSkipSettingDataOnStart?this.dispatchUpdateEventsAndRefresh():this.setInitialData()}setInitialData(){const e=this.gos.get("rowData");e&&(this.shouldSkipSettingDataOnStart=!0,this.setRowData(e))}ensureRowHeightsValid(e,t,i,s){let o,n=!1;do{o=!1;const r=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),l=Math.max(r,i),u=Math.min(a,s);for(let e=l;e<=u;e++){const t=this.getRow(e);if(t.rowHeightEstimated){const e=this.gos.getRowHeightForNode(t);t.setRowHeight(e.height),o=!0,n=!0}}o&&this.setRowTopAndRowIndex()}while(o);return n}setRowTopAndRowIndex(){const e=this.environment.getDefaultRowHeight();let t=0;const i=new Set,s=this.gos.isDomLayout("normal");for(let o=0;o<this.rowsToDisplay.length;o++){const n=this.rowsToDisplay[o];if(null!=n.id&&i.add(n.id),null==n.rowHeight){const t=this.gos.getRowHeightForNode(n,s,e);n.setRowHeight(t.height,t.estimated)}n.setRowTop(t),n.setRowIndex(o),t+=n.rowHeight}return i}clearRowTopAndRowIndex(e,t){const i=e.isActive(),s=e=>{e&&null!=e.id&&!t.has(e.id)&&e.clearRowTopAndRowIndex()},o=e=>{if(s(e),s(e.detailNode),s(e.sibling),e.hasChildren()&&e.childrenAfterGroup){const t=-1==e.level;i&&!t&&!e.expanded||e.childrenAfterGroup.forEach(o)}};o(this.rootNode)}ensureRowsAtPixel(e,t,i=0){const s=this.getRowIndexAtPixel(t),o=this.getRow(s),n=!this.gos.get("suppressAnimationFrame");return o!==e[0]&&(e.forEach((e=>{Vl.removeFromArray(this.rootNode.allLeafChildren,e)})),e.forEach(((e,t)=>{Vl.insertIntoArray(this.rootNode.allLeafChildren,e,Math.max(s+i,0)+t)})),this.refreshModel({step:"group",keepRenderedRows:!0,keepEditingRows:!0,animate:n}),!0)}highlightRowAtPixel(e,t){const i=null!=t?this.getRowIndexAtPixel(t):null,s=null!=i?this.getRow(i):null;if(!s||!e||s===e||null==t)return void(this.lastHighlightedRow&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null));const o=this.getHighlightPosition(t,s);this.lastHighlightedRow&&this.lastHighlightedRow!==s&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null),s.setHighlighted(o),this.lastHighlightedRow=s}getHighlightPosition(e,t){if(!t){const i=this.getRowIndexAtPixel(e);if(!(t=this.getRow(i||0)))return 1}const{rowTop:i,rowHeight:s}=t;return e-i<s/2?0:1}getLastHighlightedRowNode(){return this.lastHighlightedRow}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay?this.rowsToDisplay.length:0}getTopLevelRowCount(){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return 1;const e=this.rootNode.childrenAfterAggFilter;return e?e.length:0}getTopLevelRowDisplayedIndex(e){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return e;let t=this.rootNode.childrenAfterSort[e];if(this.gos.get("groupHideOpenParents"))for(;t.expanded&&t.childrenAfterSort&&t.childrenAfterSort.length>0;)t=t.childrenAfterSort[0];return t.rowIndex}getRowBounds(e){if(Vl.missing(this.rowsToDisplay))return null;const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){const e=this.gos.isAnimateRows();this.refreshModel({step:"map",keepRenderedRows:!0,animate:e})}onFilterChanged(e){if(e.afterDataChange)return;const t=this.gos.isAnimateRows(),i=0===e.columns.length||e.columns.some((e=>e.isPrimary()))?"filter":"filter_aggregates";this.refreshModel({step:i,keepRenderedRows:!0,animate:t})}onSortChanged(){const e=this.gos.isAnimateRows();this.refreshModel({step:"sort",keepRenderedRows:!0,animate:e,keepEditingRows:!0})}getType(){return"clientSide"}onValueChanged(){this.columnModel.isPivotActive()?this.refreshModel({step:"pivot"}):this.refreshModel({step:"aggregate"})}createChangePath(e){const t=Vl.missingOrEmpty(e),i=new Qc(!1,this.rootNode);return(t||this.gos.get("treeData"))&&i.setInactive(),i}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;if(null==e.rowNodeTransactions)return!1;const t=e.rowNodeTransactions.filter((e=>null!=e.add&&e.add.length>0||null!=e.remove&&e.remove.length>0));return null==t||0==t.length}buildRefreshModelParams(e){let t="group";const i={everything:"group",group:"group",filter:"filter",map:"map",aggregate:"aggregate",sort:"sort",pivot:"pivot"};if(Vl.exists(e)&&(t=i[e]),!Vl.missing(t))return{step:t,keepRenderedRows:!0,keepEditingRows:!0,animate:!this.gos.get("suppressAnimationFrame")};console.error(`AG Grid: invalid step ${e}, available steps are ${Object.keys(i).join(", ")}`)}refreshModel(e){if(!this.hasStarted||this.isRefreshingModel||this.columnModel.shouldRowModelIgnoreRefresh())return;let t="object"==typeof e&&"step"in e?e:this.buildRefreshModelParams(e);if(!t)return;if(this.isSuppressModelUpdateAfterUpdateTransaction(t))return;const i=this.createChangePath(t.rowNodeTransactions);switch(this.isRefreshingModel=!0,t.step){case"group":this.doRowGrouping(t.rowNodeTransactions,t.rowNodeOrder,i,!!t.afterColumnsChanged);case"filter":this.doFilter(i);case"pivot":this.doPivot(i);case"aggregate":this.doAggregate(i);case"filter_aggregates":this.doFilterAggregates(i);case"sort":this.doSort(t.rowNodeTransactions,i);case"map":this.doRowsToDisplay()}const s=this.setRowTopAndRowIndex();this.clearRowTopAndRowIndex(i,s),this.isRefreshingModel=!1;const o={type:In.EVENT_MODEL_UPDATED,animate:t.animate,keepRenderedRows:t.keepRenderedRows,newData:t.newData,newPage:!1,keepUndoRedoStack:t.keepUndoRedoStack};this.eventService.dispatchEvent(o)}isEmpty(){const e=Vl.missing(this.rootNode.allLeafChildren)||0===this.rootNode.allLeafChildren.length;return Vl.missing(this.rootNode)||e||!this.columnModel.isReady()}isRowsToRender(){return Vl.exists(this.rowsToDisplay)&&this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let i=!t,s=!1;const o=[],n=this.gos.get("groupSelectsChildren");return this.forEachNodeAfterFilterAndSort((r=>{if(!s)if(i&&(r===t||r===e)&&(s=!0,r.group&&n))o.push(...r.allLeafChildren);else{if(!i){if(r!==t&&r!==e)return;i=!0}(!r.group||!n)&&o.push(r)}})),o}setDatasource(e){console.error("AG Grid: should never call setDatasource on clientSideRowController")}getTopLevelNodes(){return this.rootNode?this.rootNode.childrenAfterGroup:null}getRootNode(){return this.rootNode}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){if(this.isEmpty()||0===this.rowsToDisplay.length)return-1;let t=0,i=this.rowsToDisplay.length-1;if(e<=0)return 0;if(Vl.last(this.rowsToDisplay).rowTop<=e)return this.rowsToDisplay.length-1;let s=-1,o=-1;for(;;){const n=Math.floor((t+i)/2),r=this.rowsToDisplay[n];if(this.isRowInPixel(r,e))return n;if(r.rowTop<e?t=n+1:r.rowTop>e&&(i=n-1),s===t&&o===i)return n;s=t,o=i}}isRowInPixel(e,t){const i=e.rowTop,s=e.rowTop+e.rowHeight;return i<=t&&s>t}forEachLeafNode(e){this.rootNode.allLeafChildren&&this.rootNode.allLeafChildren.forEach(((t,i)=>e(t,i)))}forEachNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterGroup||[]],callback:e,recursionType:0,index:0,includeFooterNodes:t})}forEachNodeAfterFilter(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterAggFilter||[]],callback:e,recursionType:1,index:0,includeFooterNodes:t})}forEachNodeAfterFilterAndSort(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterSort||[]],callback:e,recursionType:2,index:0,includeFooterNodes:t})}forEachPivotNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[this.rootNode],callback:e,recursionType:3,index:0,includeFooterNodes:t})}recursivelyWalkNodesAndCallback(e){const{nodes:t,callback:i,recursionType:s,includeFooterNodes:o}=e;let{index:n}=e;const r=e=>{var s;const r=null==(s=t[0])?void 0:s.parent;if(!r)return;const a=o&&this.gos.getGrandTotalRow(),l=this.gos.getGroupTotalRowCallback(),u=o&&l({node:r});r===this.rootNode?a===e&&(r.createFooter(),i(r.sibling,n++)):u===e&&(r.createFooter(),i(r.sibling,n++))};r("top");for(let e=0;e<t.length;e++){const r=t[e];if(i(r,n++),r.hasChildren()&&!r.footer){let e=null;switch(s){case 0:e=r.childrenAfterGroup;break;case 1:e=r.childrenAfterAggFilter;break;case 2:e=r.childrenAfterSort;break;case 3:e=r.leafGroup?null:r.childrenAfterSort}e&&(n=this.recursivelyWalkNodesAndCallback({nodes:[...e],callback:i,recursionType:s,index:n,includeFooterNodes:o}))}}return r("bottom"),n}doAggregate(e){var t;null==(t=this.aggregationStage)||t.execute({rowNode:this.rootNode,changedPath:e})}doFilterAggregates(e){this.filterAggregatesStage?this.filterAggregatesStage.execute({rowNode:this.rootNode,changedPath:e}):this.rootNode.childrenAfterAggFilter=this.rootNode.childrenAfterFilter}expandOrCollapseAll(e){const t=this.gos.get("treeData"),i=this.columnModel.isPivotActive(),s=o=>{o&&o.forEach((o=>{const n=()=>{o.expanded=e,s(o.childrenAfterGroup)};t?Vl.exists(o.childrenAfterGroup)&&n():i?!o.leafGroup&&n():o.group&&n()}))};this.rootNode&&s(this.rootNode.childrenAfterGroup),this.refreshModel({step:"map"});const o=e?"expandAll":"collapseAll",n={type:In.EVENT_EXPAND_COLLAPSE_ALL,source:o};this.eventService.dispatchEvent(n)}doSort(e,t){this.sortStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,changedPath:t})}doRowGrouping(e,t,i,s){if(this.groupStage){if(e?this.groupStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,rowNodeOrder:t,changedPath:i}):this.groupStage.execute({rowNode:this.rootNode,changedPath:i,afterColumnsChanged:s}),this.gos.get("groupSelectsChildren")&&this.selectionService.updateGroupsFromChildrenSelections("rowGroupChanged",i)){const e={type:In.EVENT_SELECTION_CHANGED,source:"rowGroupChanged"};this.eventService.dispatchEvent(e)}}else this.rootNode.childrenAfterGroup=this.rootNode.allLeafChildren,this.rootNode.sibling&&(this.rootNode.sibling.childrenAfterGroup=this.rootNode.childrenAfterGroup),this.rootNode.updateHasChildren();this.nodeManager.isRowCountReady()&&(this.rowCountReady=!0,this.eventService.dispatchEventOnce({type:In.EVENT_ROW_COUNT_READY}))}doFilter(e){this.filterStage.execute({rowNode:this.rootNode,changedPath:e})}doPivot(e){var t;null==(t=this.pivotStage)||t.execute({rowNode:this.rootNode,changedPath:e})}getCopyOfNodesMap(){return this.nodeManager.getCopyOfNodesMap()}getRowNode(e){if("string"==typeof e&&0==e.indexOf(ah.ID_PREFIX_ROW_GROUP)){let t;return this.forEachNode((i=>{i.id===e&&(t=i)})),t}return this.nodeManager.getRowNode(e)}setRowData(e){this.selectionService.reset("rowDataChanged"),this.nodeManager.setRowData(e),this.hasStarted&&this.dispatchUpdateEventsAndRefresh()}dispatchUpdateEventsAndRefresh(){const e={type:In.EVENT_ROW_DATA_UPDATED};this.eventService.dispatchEvent(e),this.refreshModel({step:"group",newData:!0})}batchUpdateRowData(e,t){if(null==this.applyAsyncTransactionsTimeout){this.rowDataTransactionBatch=[];const e=this.gos.getAsyncTransactionWaitMillis();this.applyAsyncTransactionsTimeout=window.setTimeout((()=>{this.executeBatchUpdateRowData()}),e)}this.rowDataTransactionBatch.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){null!=this.applyAsyncTransactionsTimeout&&(clearTimeout(this.applyAsyncTransactionsTimeout),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){this.valueCache.onDataChanged();const e=[],t=[];let i=!1;if(this.rowDataTransactionBatch&&this.rowDataTransactionBatch.forEach((s=>{const o=this.nodeManager.updateRowData(s.rowDataTransaction,void 0);t.push(o),s.callback&&e.push(s.callback.bind(null,o)),"number"==typeof s.rowDataTransaction.addIndex&&(i=!0)})),this.commonUpdateRowData(t,void 0,i),e.length>0&&window.setTimeout((()=>{e.forEach((e=>e()))}),0),t.length>0){const e={type:In.EVENT_ASYNC_TRANSACTIONS_FLUSHED,results:t};this.eventService.dispatchEvent(e)}this.rowDataTransactionBatch=null,this.applyAsyncTransactionsTimeout=void 0}updateRowData(e,t){this.valueCache.onDataChanged();const i=this.nodeManager.updateRowData(e,t),s="number"==typeof e.addIndex;return this.commonUpdateRowData([i],t,s),i}createRowNodeOrder(){if(this.gos.get("suppressMaintainUnsortedOrder"))return;const e={};if(this.rootNode&&this.rootNode.allLeafChildren)for(let t=0;t<this.rootNode.allLeafChildren.length;t++)e[this.rootNode.allLeafChildren[t].id]=t;return e}commonUpdateRowData(e,t,i){if(!this.hasStarted)return;const s=!this.gos.get("suppressAnimationFrame");i&&(t=this.createRowNodeOrder());const o={type:In.EVENT_ROW_DATA_UPDATED};this.eventService.dispatchEvent(o),this.refreshModel({step:"group",rowNodeTransactions:e,rowNodeOrder:t,keepRenderedRows:!0,keepEditingRows:!0,animate:s})}doRowsToDisplay(){this.rowsToDisplay=this.flattenStage.execute({rowNode:this.rootNode})}onRowHeightChanged(){this.refreshModel({step:"map",keepRenderedRows:!0,keepEditingRows:!0,keepUndoRedoStack:!0})}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}resetRowHeights(){const e=this.resetRowHeightsForAllRowNodes();this.rootNode.setRowHeight(this.rootNode.rowHeight,!0),this.rootNode.sibling&&this.rootNode.sibling.setRowHeight(this.rootNode.sibling.rowHeight,!0),e&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode((t=>{t.setRowHeight(t.rowHeight,!0);const i=t.detailNode;i&&i.setRowHeight(i.rowHeight,!0),t.sibling&&t.sibling.setRowHeight(t.sibling.rowHeight,!0),e=!0})),e}onGridStylesChanges(){this.columnModel.isAutoRowHeightActive()||this.resetRowHeights()}onGridReady(){this.hasStarted||this.setInitialData()}isRowDataLoaded(){return this.rowCountReady}};Gs([No("columnModel")],tm.prototype,"columnModel",2),Gs([No("selectionService")],tm.prototype,"selectionService",2),Gs([No("valueCache")],tm.prototype,"valueCache",2),Gs([No("beans")],tm.prototype,"beans",2),Gs([No("filterStage")],tm.prototype,"filterStage",2),Gs([No("sortStage")],tm.prototype,"sortStage",2),Gs([No("flattenStage")],tm.prototype,"flattenStage",2),Gs([_o("groupStage")],tm.prototype,"groupStage",2),Gs([_o("aggregationStage")],tm.prototype,"aggregationStage",2),Gs([_o("pivotStage")],tm.prototype,"pivotStage",2),Gs([_o("filterAggregatesStage")],tm.prototype,"filterAggregatesStage",2),Gs([Lo],tm.prototype,"init",1),tm=Gs([Io("rowModel")],tm);var im=class extends Pn{execute(e){const{changedPath:t}=e;this.filterService.filter(t)}};Gs([No("filterService")],im.prototype,"filterService",2),im=Gs([Io("filterStage")],im);var sm=class extends Pn{execute(e){const t=this.sortController.getSortOptions(),i=Vl.exists(t)&&t.length>0,s=i&&Vl.exists(e.rowNodeTransactions)&&this.gos.get("deltaSort"),o=t.some((e=>this.gos.isColumnsSortingCoupledToGroup()?e.column.isPrimary()&&e.column.isRowGroupActive():!!e.column.getColDef().showRowGroup));this.sortService.sort(t,i,s,e.rowNodeTransactions,e.changedPath,o)}};Gs([No("sortService")],sm.prototype,"sortService",2),Gs([No("sortController")],sm.prototype,"sortController",2),sm=Gs([Io("sortStage")],sm);var om=class extends Pn{execute(e){const t=e.rowNode,i=[],s=this.beans.columnModel.isPivotMode(),o=s&&t.leafGroup,n=o?[t]:t.childrenAfterSort,r=this.getFlattenDetails();if(this.recursivelyAddToRowsToDisplay(r,n,i,s,0),!o&&i.length>0&&r.grandTotalRow){t.createFooter();const e="top"===r.grandTotalRow;this.addRowNodeToRowsToDisplay(r,t.sibling,i,0,e)}return i}getFlattenDetails(){const e=this.gos.get("groupRemoveSingleChildren");return{groupRemoveLowestSingleChildren:!e&&this.gos.get("groupRemoveLowestSingleChildren"),groupRemoveSingleChildren:e,isGroupMultiAutoColumn:this.gos.isGroupMultiAutoColumn(),hideOpenParents:this.gos.get("groupHideOpenParents"),grandTotalRow:this.gos.getGrandTotalRow(),groupTotalRow:this.gos.getGroupTotalRowCallback()}}recursivelyAddToRowsToDisplay(e,t,i,s,o){if(!Vl.missingOrEmpty(t))for(let n=0;n<t.length;n++){const r=t[n],a=r.hasChildren(),l=s&&!a,u=e.groupRemoveSingleChildren&&a&&1===r.childrenAfterGroup.length,h=e.groupRemoveLowestSingleChildren&&a&&r.leafGroup&&1===r.childrenAfterGroup.length,d=s&&r.leafGroup,c=e.hideOpenParents&&r.expanded&&!r.master&&!d;if(!(l||c||u||h)&&this.addRowNodeToRowsToDisplay(e,r,i,o),!s||!r.leafGroup)if(a){const t=u||h;if(r.expanded||t){const n=e.groupTotalRow({node:r});n||r.destroyFooter();const a=t?o:o+1;"top"===n&&(r.createFooter(),this.addRowNodeToRowsToDisplay(e,r.sibling,i,a)),this.recursivelyAddToRowsToDisplay(e,r.childrenAfterSort,i,s,a),"bottom"===n&&(r.createFooter(),this.addRowNodeToRowsToDisplay(e,r.sibling,i,a))}}else if(r.master&&r.expanded){const t=this.createDetailNode(r);this.addRowNodeToRowsToDisplay(e,t,i,o)}}}addRowNodeToRowsToDisplay(e,t,i,s,o){o?i.unshift(t):i.push(t),t.setUiLevel(e.isGroupMultiAutoColumn?0:s)}createDetailNode(e){if(Vl.exists(e.detailNode))return e.detailNode;const t=new ah(this.beans);return t.detail=!0,t.selectable=!1,t.parent=e,Vl.exists(e.id)&&(t.id="detail_"+e.id),t.data=e.data,t.level=e.level+1,e.detailNode=t,t}};Gs([No("beans")],om.prototype,"beans",2),om=Gs([Io("flattenStage")],om);var nm=class extends Pn{sort(e,t,i,s,o,n){const r=this.gos.get("groupMaintainOrder"),a=this.columnModel.getAllGridColumns().some((e=>e.isRowGroupActive()));let l={};i&&s&&(l=this.calculateDirtyNodes(s));const u=this.columnModel.isPivotMode(),h=this.gos.getCallback("postSortRows");o&&o.forEachChangedNodeDepthFirst((s=>{var d;this.pullDownGroupDataForHideOpenParents(s.childrenAfterAggFilter,!0);const c=u&&s.leafGroup;if(r&&a&&!s.leafGroup&&!n){const e=null==(d=this.columnModel.getRowGroupColumns())?void 0:d[s.level+1],t=null===(null==e?void 0:e.getSort()),i=s.childrenAfterAggFilter.slice(0);if(s.childrenAfterSort&&!t){const e={};s.childrenAfterSort.forEach(((t,i)=>{e[t.id]=i})),i.sort(((t,i)=>{var s,o;return(null!=(s=e[t.id])?s:0)-(null!=(o=e[i.id])?o:0)}))}s.childrenAfterSort=i}else s.childrenAfterSort=!t||c?s.childrenAfterAggFilter.slice(0):i?this.doDeltaSort(s,l,o,e):this.rowNodeSorter.doFullSort(s.childrenAfterAggFilter,e);if(s.sibling&&(s.sibling.childrenAfterSort=s.childrenAfterSort),this.updateChildIndexes(s),h){const e={nodes:s.childrenAfterSort};h(e)}})),this.updateGroupDataForHideOpenParents(o)}calculateDirtyNodes(e){const t={},i=e=>{e&&e.forEach((e=>t[e.id]=!0))};return e&&e.forEach((e=>{i(e.add),i(e.update),i(e.remove)})),t}doDeltaSort(e,t,i,s){const o=e.childrenAfterAggFilter,n=e.childrenAfterSort;if(!n)return this.rowNodeSorter.doFullSort(o,s);const r={},a=[];o.forEach((e=>{t[e.id]||!i.canSkip(e)?a.push(e):r[e.id]=!0}));const l=n.filter((e=>r[e.id])),u=(e,t)=>({currentPos:t,rowNode:e}),h=a.map(u).sort(((e,t)=>this.rowNodeSorter.compareRowNodes(s,e,t)));return this.mergeSortedArrays(s,h,l.map(u)).map((({rowNode:e})=>e))}mergeSortedArrays(e,t,i){const s=[];let o=0,n=0;for(;o<t.length&&n<i.length;)this.rowNodeSorter.compareRowNodes(e,t[o],i[n])<0?s.push(t[o++]):s.push(i[n++]);for(;o<t.length;)s.push(t[o++]);for(;n<i.length;)s.push(i[n++]);return s}updateChildIndexes(e){if(Vl.missing(e.childrenAfterSort))return;const t=e.childrenAfterSort;for(let i=0;i<t.length;i++){const s=t[i],o=0===i,n=i===e.childrenAfterSort.length-1;s.setFirstChild(o),s.setLastChild(n),s.setChildIndex(i)}}updateGroupDataForHideOpenParents(e){if(!this.gos.get("groupHideOpenParents"))return;if(this.gos.get("treeData"))return Vl.warnOnce("The property hideOpenParents dose not work with Tree Data. This is because Tree Data has values at the group level, it doesn't make sense to hide them."),!1;const t=e=>{this.pullDownGroupDataForHideOpenParents(e.childrenAfterSort,!1),e.childrenAfterSort.forEach((e=>{e.hasChildren()&&t(e)}))};e&&e.executeFromRootNode((e=>t(e)))}pullDownGroupDataForHideOpenParents(e,t){this.gos.get("groupHideOpenParents")&&!Vl.missing(e)&&e.forEach((e=>{this.columnModel.getGroupDisplayColumns().forEach((i=>{const s=i.getColDef().showRowGroup;if("string"!=typeof s)return void console.error("AG Grid: groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup");const o=s,n=this.columnModel.getPrimaryColumn(o);if(n!==e.rowGroupColumn)if(t)e.setGroupValue(i.getId(),void 0);else{const t=e.getFirstChildOfFirstChild(n);t&&e.setGroupValue(i.getId(),t.key)}}))}))}};Gs([No("columnModel")],nm.prototype,"columnModel",2),Gs([No("rowNodeSorter")],nm.prototype,"rowNodeSorter",2),nm=Gs([Io("sortService")],nm);var rm=class extends Pn{filter(e){const t=this.filterManager.isChildFilterPresent();this.filterNodes(t,e)}filterNodes(e,t){const i=(t,i)=>{t.hasChildren()?t.childrenAfterFilter=e&&!i?t.childrenAfterGroup.filter((e=>{const t=e.childrenAfterFilter&&e.childrenAfterFilter.length>0,i=e.data&&this.filterManager.doesRowPassFilter({rowNode:e});return t||i})):t.childrenAfterGroup:t.childrenAfterFilter=t.childrenAfterGroup,t.sibling&&(t.sibling.childrenAfterFilter=t.childrenAfterFilter)};if(this.doingTreeDataFiltering()){const e=(t,s)=>{if(t.childrenAfterGroup)for(let o=0;o<t.childrenAfterGroup.length;o++){const n=t.childrenAfterGroup[o],r=s||this.filterManager.doesRowPassFilter({rowNode:n});n.childrenAfterGroup?e(t.childrenAfterGroup[o],r):i(n,r)}i(t,s)},s=t=>e(t,!1);t.executeFromRootNode(s)}else{const e=e=>i(e,!1);t.forEachChangedNodeDepthFirst(e,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}};Gs([No("filterManager")],rm.prototype,"filterManager",2),rm=Gs([Io("filterService")],rm);var am=class extends Pn{postConstruct(){"clientSide"===this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel,this.addManagedPropertyListener("rowData",(()=>this.onRowDataUpdated())))}isActive(){const e=this.gos.exists("getRowId");return!this.gos.get("resetRowDataOnUpdate")&&e}setRowData(e){const t=this.createTransactionForRowData(e);if(!t)return;const[i,s]=t;this.clientSideRowModel.updateRowData(i,s)}createTransactionForRowData(e){if(Vl.missing(this.clientSideRowModel))return void console.error("AG Grid: ImmutableService only works with ClientSideRowModel");const t=this.gos.getCallback("getRowId");if(null==t)return void console.error("AG Grid: ImmutableService requires getRowId() callback to be implemented, your row data needs IDs!");const i={remove:[],update:[],add:[]},s=this.clientSideRowModel.getCopyOfNodesMap(),o=this.gos.get("suppressMaintainUnsortedOrder")?void 0:{};return Vl.exists(e)&&e.forEach(((e,n)=>{const r=t({data:e,level:0}),a=s[r];o&&(o[r]=n),a?(a.data!==e&&i.update.push(e),s[r]=void 0):i.add.push(e)})),Vl.iterateObject(s,((e,t)=>{t&&i.remove.push(t.data)})),[i,o]}onRowDataUpdated(){const e=this.gos.get("rowData");e&&(this.isActive()?this.setRowData(e):(this.selectionService.reset("rowDataChanged"),this.clientSideRowModel.setRowData(e)))}};Gs([No("rowModel")],am.prototype,"rowModel",2),Gs([No("rowRenderer")],am.prototype,"rowRenderer",2),Gs([No("selectionService")],am.prototype,"selectionService",2),Gs([Lo],am.prototype,"postConstruct",1);var lm={version:"31.3.4",moduleName:"@ag-grid-community/client-side-row-model",rowModel:"clientSide",beans:[tm,im,sm,om,nm,rm,am=Gs([Io("immutableService")],am)]},um=Object.defineProperty,hm=Object.getOwnPropertyDescriptor,dm=(e,t,i,s)=>{for(var o,n=s>1?void 0:s?hm(t,i):t,r=e.length-1;r>=0;r--)(o=e[r])&&(n=(s?o(t,i,n):o(n))||n);return s&&n&&um(t,i,n),n},cm=class extends Zc{constructor(e,t,i){super(e),this.parentCache=t,this.params=i,this.startRow=e*i.blockSize,this.endRow=this.startRow+i.blockSize}postConstruct(){this.createRowNodes()}getBlockStateJson(){return{id:""+this.getId(),state:{blockNumber:this.getId(),startRow:this.getStartRow(),endRow:this.getEndRow(),pageStatus:this.getState()}}}setDataAndId(e,t,i){Vl.exists(t)?e.setDataAndId(t,i.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();Vl.missing(this.params.datasource.getRows)?console.warn("AG Grid: datasource is missing getRows method"):window.setTimeout((()=>{this.params.datasource.getRows(e)}),0)}processServerFail(){}createLoadParams(){return{startRow:this.getStartRow(),endRow:this.getEndRow(),successCallback:this.pageLoaded.bind(this,this.getVersion()),failCallback:this.pageLoadFailed.bind(this,this.getVersion()),sortModel:this.params.sortModel,filterModel:this.params.filterModel,context:this.gos.getGridCommonParams().context}}forEachNode(e,t,i){this.rowNodes.forEach(((s,o)=>{this.startRow+o<i&&e(s,t.next())}))}getLastAccessed(){return this.lastAccessed}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.next());const i=e-this.startRow;return this.rowNodes[i]}getStartRow(){return this.startRow}getEndRow(){return this.endRow}createRowNodes(){this.rowNodes=[];for(let e=0;e<this.params.blockSize;e++){const t=this.startRow+e,i=new ah(this.beans);i.setRowHeight(this.params.rowHeight),i.uiLevel=0,i.setRowIndex(t),i.setRowTop(this.params.rowHeight*t),this.rowNodes.push(i)}}processServerResult(e){this.rowNodes.forEach(((t,i)=>{const s=e.rowData?e.rowData[i]:void 0;!t.id&&t.alreadyRendered&&s&&(this.rowNodes[i]=new ah(this.beans),this.rowNodes[i].setRowIndex(t.rowIndex),this.rowNodes[i].setRowTop(t.rowTop),this.rowNodes[i].setRowHeight(t.rowHeight),t.clearRowTopAndRowIndex()),this.setDataAndId(this.rowNodes[i],s,this.startRow+i)}));const t=null!=e.rowCount&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,t)}destroyRowNodes(){this.rowNodes.forEach((e=>{e.clearRowTopAndRowIndex()}))}};dm([No("beans")],cm.prototype,"beans",2),dm([Lo],cm.prototype,"postConstruct",1),dm([xo],cm.prototype,"destroyRowNodes",1);var pm,gm=class e extends Pn{constructor(e){super(),this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount,this.params=e}setBeans(e){this.logger=e.create("InfiniteCache")}getRow(e,t=!1){const i=Math.floor(e/this.params.blockSize);let s=this.blocks[i];if(!s){if(t)return;s=this.createBlock(i)}return s.getRow(e)}createBlock(e){const t=this.createBean(new cm(e,this,this.params));return this.blocks[t.getId()]=t,this.blockCount++,this.purgeBlocksIfNeeded(t),this.params.rowNodeBlockLoader.addBlock(t),t}refreshCache(){0==this.blockCount?this.purgeCache():(this.getBlocksInOrder().forEach((e=>e.setStateWaitingToLoad())),this.params.rowNodeBlockLoader.checkBlockToLoad())}destroyAllBlocks(){this.getBlocksInOrder().forEach((e=>this.destroyBlock(e)))}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(this.logger.log(`onPageLoaded: page = ${e.getId()}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(t){const i=this.getBlocksInOrder().filter((e=>e!=t));i.sort(((e,t)=>t.getLastAccessed()-e.getLastAccessed()));const s=this.params.maxBlocksInCache>0,o=s?this.params.maxBlocksInCache-1:null,n=e.MAX_EMPTY_BLOCKS_TO_KEEP-1;i.forEach(((e,t)=>{if(e.getState()===cm.STATE_WAITING_TO_LOAD&&t>=n||s&&t>=o){if(this.isBlockCurrentlyDisplayed(e))return;if(this.isBlockFocused(e))return;this.removeBlockFromCache(e)}}))}isBlockFocused(e){const t=this.focusService.getFocusCellToUseAfterRefresh();if(!t)return!1;if(null!=t.rowPinned)return!1;const i=e.getStartRow(),s=e.getEndRow();return t.rowIndex>=i&&t.rowIndex<s}isBlockCurrentlyDisplayed(e){const t=e.getStartRow(),i=e.getEndRow()-1;return this.rowRenderer.isRangeInRenderedViewport(t,i)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if("number"==typeof t&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const t=(e.getId()+1)*this.params.blockSize+this.params.overflowSize;this.rowCount<t&&(this.rowCount=t)}}setRowCount(e,t){this.rowCount=e,Vl.exists(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize==0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t=new Hl;this.getBlocksInOrder().forEach((i=>i.forEachNode(e,t,this.rowCount)))}getBlocksInOrder(){return Vl.getAllValuesInObject(this.blocks).sort(((e,t)=>e.getId()-t.getId()))}destroyBlock(e){delete this.blocks[e.getId()],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){if(this.isAlive()){this.destroyAllBlocksPastVirtualRowCount();const e={type:In.EVENT_STORE_UPDATED};this.eventService.dispatchEvent(e)}}destroyAllBlocksPastVirtualRowCount(){const e=[];this.getBlocksInOrder().forEach((t=>{t.getId()*this.params.blockSize>=this.rowCount&&e.push(t)})),e.length>0&&e.forEach((e=>this.destroyBlock(e)))}purgeCache(){this.getBlocksInOrder().forEach((e=>this.removeBlockFromCache(e))),this.lastRowIndexKnown=!1,0===this.rowCount&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const i=[];let s=-1,o=!1;const n=new Hl;Vl.missing(e)&&(o=!0);let r=!1;return this.getBlocksInOrder().forEach((a=>{r||(o&&s+1!==a.getId()?r=!0:(s=a.getId(),a.forEachNode((s=>{const n=s===e||s===t;(o||n)&&i.push(s),n&&(o=!o)}),n,this.rowCount)))})),r||o?[]:i}};gm.MAX_EMPTY_BLOCKS_TO_KEEP=2,dm([No("rowRenderer")],gm.prototype,"rowRenderer",2),dm([No("focusService")],gm.prototype,"focusService",2),dm([(pm=Go("loggerFactory"),(e,t)=>pm(e,t,0))],gm.prototype,"setBeans",1),dm([xo],gm.prototype,"destroyAllBlocks",1);var mm=gm,fm=class extends Pn{getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(e,t,i,s){return!1}init(){this.gos.isRowModelType("infinite")&&(this.rowHeight=this.gos.getRowHeightAsNumber(),this.addEventListeners(),this.addDestroyFunc((()=>this.destroyCache())),this.verifyProps())}verifyProps(){this.gos.exists("initialGroupOrderComparator")&&Vl.warnOnce("initialGroupOrderComparator cannot be used with Infinite Row Model as sorting is done on the server side")}start(){this.setDatasource(this.gos.get("datasource"))}destroyDatasource(){this.datasource&&(this.getContext().destroyBean(this.datasource),this.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedListener(this.eventService,In.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,In.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,In.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverything.bind(this)),this.addManagedListener(this.eventService,In.EVENT_STORE_UPDATED,this.onCacheUpdated.bind(this)),this.addManagedPropertyListener("datasource",(()=>this.setDatasource(this.gos.get("datasource")))),this.addManagedPropertyListener("cacheBlockSize",(()=>this.resetCache())),this.addManagedPropertyListener("rowHeight",(()=>{this.rowHeight=this.gos.getRowHeightAsNumber(),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()}))}onFilterChanged(){this.reset()}onSortChanged(){this.reset()}onColumnEverything(){let e;e=!this.cacheParams||this.isSortModelDifferent(),e&&this.reset()}isSortModelDifferent(){return!Vl.jsonEquals(this.cacheParams.sortModel,this.sortController.getSortModel())}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){return this.infiniteCache?this.infiniteCache.getRowNodesInRange(e,t):[]}reset(){this.datasource&&(null!=this.gos.getCallback("getRowId")||this.selectionService.reset("rowDataChanged"),this.resetCache())}createModelUpdatedEvent(){return{type:In.EVENT_MODEL_UPDATED,newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1}}resetCache(){this.destroyCache(),this.cacheParams={datasource:this.datasource,filterModel:this.filterManager.getFilterModel(),sortModel:this.sortController.getSortModel(),rowNodeBlockLoader:this.rowNodeBlockLoader,initialRowCount:this.gos.get("infiniteInitialRowCount"),maxBlocksInCache:this.gos.get("maxBlocksInCache"),rowHeight:this.gos.getRowHeightAsNumber(),overflowSize:this.gos.get("cacheOverflowSize"),blockSize:this.gos.get("cacheBlockSize"),lastAccessedSequence:new Hl},this.infiniteCache=this.createBean(new mm(this.cacheParams)),this.eventService.dispatchEventOnce({type:In.EVENT_ROW_COUNT_READY});const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}updateRowHeights(){this.forEachNode((e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)}));const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}destroyCache(){this.infiniteCache&&(this.infiniteCache=this.destroyBean(this.infiniteCache))}onCacheUpdated(){const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}getRow(e){if(this.infiniteCache&&!(e>=this.infiniteCache.getRowCount()))return this.infiniteCache.getRow(e)}getRowNode(e){let t;return this.forEachNode((i=>{i.id===e&&(t=i)})),t}forEachNode(e){this.infiniteCache&&this.infiniteCache.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(0!==this.rowHeight){const t=Math.floor(e/this.rowHeight),i=this.getRowCount()-1;return t>i?i:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){this.infiniteCache&&this.infiniteCache.refreshCache()}purgeCache(){this.infiniteCache&&this.infiniteCache.purgeCache()}isLastRowIndexKnown(){return!!this.infiniteCache&&this.infiniteCache.isLastRowIndexKnown()}setRowCount(e,t){this.infiniteCache&&this.infiniteCache.setRowCount(e,t)}};dm([No("filterManager")],fm.prototype,"filterManager",2),dm([No("sortController")],fm.prototype,"sortController",2),dm([No("selectionService")],fm.prototype,"selectionService",2),dm([No("rowRenderer")],fm.prototype,"rowRenderer",2),dm([No("rowNodeBlockLoader")],fm.prototype,"rowNodeBlockLoader",2),dm([Lo],fm.prototype,"init",1),dm([xo],fm.prototype,"destroyDatasource",1);var Cm={version:"31.3.4",moduleName:"@ag-grid-community/infinite-row-model",rowModel:"infinite",beans:[fm=dm([Io("rowModel")],fm)]},vm=Object.defineProperty,wm=Object.defineProperties,ym=Object.getOwnPropertyDescriptor,Em=Object.getOwnPropertyDescriptors,Sm=Object.getOwnPropertySymbols,bm=Object.prototype.hasOwnProperty,Rm=Object.prototype.propertyIsEnumerable,Dm=(e,t,i)=>t in e?vm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Tm=(e,t)=>{for(var i in t||(t={}))bm.call(t,i)&&Dm(e,i,t[i]);if(Sm)for(var i of Sm(t))Rm.call(t,i)&&Dm(e,i,t[i]);return e},Am=(e,t)=>wm(e,Em(t)),Pm=(e,t,i,s)=>{for(var o,n=s>1?void 0:s?ym(t,i):t,r=e.length-1;r>=0;r--)(o=e[r])&&(n=(s?o(t,i,n):o(n))||n);return s&&n&&vm(t,i,n),n},Fm=(e,t,i)=>new Promise(((s,o)=>{var n=e=>{try{a(i.next(e))}catch(e){o(e)}},r=e=>{try{a(i.throw(e))}catch(e){o(e)}},a=e=>e.done?s(e.value):Promise.resolve(e.value).then(n,r);a((i=i.apply(e,t)).next())})),Mm=class{setBeans(e){this.beans=e}getFileName(e){const t=this.getDefaultFileExtension();return null!=e&&e.length||(e=this.getDefaultFileName()),-1===e.indexOf(".")?`${e}.${t}`:e}getData(e){const t=this.createSerializingSession(e);return this.beans.gridSerializer.serialize(t,e)}getDefaultFileName(){return`export.${this.getDefaultFileExtension()}`}},Lm=class{constructor(e){this.groupColumns=[];const{columnModel:t,valueService:i,gos:s,processCellCallback:o,processHeaderCallback:n,processGroupHeaderCallback:r,processRowGroupCallback:a}=e;this.columnModel=t,this.valueService=i,this.gos=s,this.processCellCallback=o,this.processHeaderCallback=n,this.processGroupHeaderCallback=r,this.processRowGroupCallback=a}prepare(e){this.groupColumns=e.filter((e=>!!e.getColDef().showRowGroup))}extractHeaderValue(e){const t=this.getHeaderName(this.processHeaderCallback,e);return null!=t?t:""}extractRowCellValue(e,t,i,s,o){const n=this.gos.get("groupHideOpenParents")&&!o.footer||!this.shouldRenderGroupSummaryCell(o,e,t)?this.valueService.getValue(e,o):this.createValueForGroupNode(e,o);return this.processCell({accumulatedRowIndex:i,rowNode:o,column:e,value:n,processCellCallback:this.processCellCallback,type:s})}shouldRenderGroupSummaryCell(e,t,i){var s;if(!e||!e.group)return!1;if(-1!==this.groupColumns.indexOf(t)){if(null!=(null==(s=e.groupData)?void 0:s[t.getId()]))return!0;if(this.gos.isRowModelType("serverSide")&&e.group)return!0;if(e.footer&&-1===e.level){const e=t.getColDef();return null==e||!0===e.showRowGroup||e.showRowGroup===this.columnModel.getRowGroupColumns()[0].getId()}}const o=this.gos.isGroupUseEntireRow(this.columnModel.isPivotMode());return 0===i&&o}getHeaderName(e,t){return e?e(this.gos.addGridCommonParams({column:t})):this.columnModel.getDisplayNameForColumn(t,"csv",!0)}createValueForGroupNode(e,t){if(this.processRowGroupCallback)return this.processRowGroupCallback(this.gos.addGridCommonParams({column:e,node:t}));const i=this.gos.get("treeData"),s=this.gos.get("suppressGroupMaintainValueType"),o=t=>{var o,n;if(i||s)return t.key;const r=null==(o=t.groupData)?void 0:o[e.getId()];return r&&t.rowGroupColumn&&!1!==t.rowGroupColumn.getColDef().useValueFormatterForExport&&null!=(n=this.valueService.formatValue(t.rowGroupColumn,t,r))?n:r},n=t.footer,r=[o(t)];if(!this.gos.isGroupMultiAutoColumn())for(;t.parent;)t=t.parent,r.push(o(t));const a=r.reverse().join(" -> ");return n?`Total ${a}`:a}processCell(e){var t;const{accumulatedRowIndex:i,rowNode:s,column:o,value:n,processCellCallback:r,type:a}=e;return r?{value:null!=(t=r(this.gos.addGridCommonParams({accumulatedRowIndex:i,column:o,node:s,value:n,type:a,parseValue:e=>this.valueService.parseValue(o,s,e,this.valueService.getValue(o,s)),formatValue:e=>{var t;return null!=(t=this.valueService.formatValue(o,s,e))?t:e}})))?t:""}:!1!==o.getColDef().useValueFormatterForExport?{value:null!=n?n:"",valueFormatted:this.valueService.formatValue(o,s,n)}:{value:null!=n?n:""}}},xm=class{static download(e,t){const i=document.defaultView||window;if(!i)return void console.warn("AG Grid: There is no `window` associated with the current `document`");const s=document.createElement("a"),o=i.URL.createObjectURL(t);s.setAttribute("href",o),s.setAttribute("download",e),s.style.display="none",document.body.appendChild(s),s.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:i})),document.body.removeChild(s),i.setTimeout((()=>{i.URL.revokeObjectURL(o)}),0)}},Im=class extends Lm{constructor(e){super(e),this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:i}=e;this.suppressQuotes=t,this.columnSeparator=i}addCustomContent(e){e&&("string"==typeof e?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,"\r\n"),this.result+=e):e.forEach((e=>{this.beginNewLine(),e.forEach(((e,t)=>{0!==t&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(e.data.value||""),e.mergeAcross&&this.appendEmptyCells(e.mergeAcross)}))})))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,i,s){0!=i&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(s)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){0!=t&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,i){var s;0!=t&&(this.result+=this.columnSeparator);const o=this.extractRowCellValue(e,t,t,"csv",i);this.result+=this.putInQuotes(null!=(s=o.valueFormatted)?s:o.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(null==e)return'""';let t;return"string"==typeof e?t=e:"function"==typeof e.toString?t=e.toString():(console.warn("AG Grid: unknown value type during csv conversion"),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+="\r\n"),this.isFirstLine=!1}},Nm=class extends Mm{postConstruct(){this.setBeans({gridSerializer:this.gridSerializer,gos:this.gos})}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed())return void console.warn("AG Grid: Export cancelled. Export is not allowed as per your configuration.");const t=this.getMergedParams(e),i=this.getData(t),s=new Blob(["\ufeff",i],{type:"text/plain"}),o="function"==typeof t.fileName?t.fileName(this.gos.getGridCommonParams()):t.fileName;xm.download(this.getFileName(o),s)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const i=t?Object.assign({},e):this.getMergedParams(e);return this.getData(i)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{columnModel:t,valueService:i,gos:s}=this,{processCellCallback:o,processHeaderCallback:n,processGroupHeaderCallback:r,processRowGroupCallback:a,suppressQuotes:l,columnSeparator:u}=e;return new Im({columnModel:t,valueService:i,gos:s,processCellCallback:o||void 0,processHeaderCallback:n||void 0,processGroupHeaderCallback:r||void 0,processRowGroupCallback:a||void 0,suppressQuotes:l||!1,columnSeparator:u||","})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};Pm([No("columnModel")],Nm.prototype,"columnModel",2),Pm([No("valueService")],Nm.prototype,"valueService",2),Pm([No("gridSerializer")],Nm.prototype,"gridSerializer",2),Pm([No("gridOptionsService")],Nm.prototype,"gos",2),Pm([Lo],Nm.prototype,"postConstruct",1),Nm=Pm([Io("csvCreator")],Nm);var _m=class extends Pn{serialize(e,t={}){const{allColumns:i,columnKeys:s,skipRowGroups:o}=t,n=this.getColumnsToExport(i,o,s);return Vl.compose(this.prepareSession(n),this.prependContent(t),this.exportColumnGroups(t,n),this.exportHeaders(t,n),this.processPinnedTopRows(t,n),this.processRows(t,n),this.processPinnedBottomRows(t,n),this.appendContent(t))(e).parse()}processRow(e,t,i,s){const o=t.shouldRowBeSkipped||(()=>!1),n=this.gos.get("groupRemoveSingleChildren"),r=this.gos.get("groupRemoveLowestSingleChildren"),a=null!=t.rowPositions||!!t.onlySelected,l=this.gos.get("groupHideOpenParents")&&!a,u=this.columnModel.isPivotMode()?s.leafGroup:!s.group,h=!!s.footer,d=(t.skipRowGroups,r&&s.leafGroup),c=1===s.allChildrenCount&&(n||d);if(!u&&!h&&(t.skipRowGroups||c||l)||t.onlySelected&&!s.isSelected()||t.skipPinnedTop&&"top"===s.rowPinned||t.skipPinnedBottom&&"bottom"===s.rowPinned)return;if(-1===s.level&&!u&&!h)return;if(o(this.gos.addGridCommonParams({node:s})))return;const p=e.onNewBodyRow(s);if(i.forEach(((e,t)=>{p.onColumn(e,t,s)})),t.getCustomContentBelowRow){const i=t.getCustomContentBelowRow(this.gos.addGridCommonParams({node:s}));i&&e.addCustomContent(i)}}appendContent(e){return t=>{const i=e.appendContent;return i&&t.addCustomContent(i),t}}prependContent(e){return t=>{const i=e.prependContent;return i&&t.addCustomContent(i),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return i=>{if(!e.skipColumnGroupHeaders){const s=new On,o=this.displayedGroupCreator.createDisplayedGroups(t,s,null);this.recursivelyAddHeaderGroups(o,i,e.processGroupHeaderCallback)}return i}}exportHeaders(e,t){return i=>{if(!e.skipColumnHeaders){const e=i.onNewHeaderRow();t.forEach(((t,i)=>{e.onColumn(t,i,void 0)}))}return i}}processPinnedTopRows(e,t){return i=>{const s=this.processRow.bind(this,i,e,t);return e.rowPositions?e.rowPositions.filter((e=>"top"===e.rowPinned)).sort(((e,t)=>e.rowIndex-t.rowIndex)).map((e=>this.pinnedRowModel.getPinnedTopRow(e.rowIndex))).forEach(s):this.pinnedRowModel.forEachPinnedTopRow(s),i}}processRows(e,t){return i=>{const s=this.rowModel,o=s.getType(),n="clientSide"===o,r="serverSide"===o,a=!n&&e.onlySelected,l=this.processRow.bind(this,i,e,t),{exportedRows:u="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter((e=>null==e.rowPinned)).sort(((e,t)=>e.rowIndex-t.rowIndex)).map((e=>s.getRow(e.rowIndex))).forEach(l);else if(this.columnModel.isPivotMode())n?s.forEachPivotNode(l,!0):r?s.forEachNodeAfterFilterAndSort(l,!0):s.forEachNode(l);else if(e.onlySelectedAllPages||a){const e=this.selectionService.getSelectedNodes();this.replicateSortedOrder(e),e.forEach(l)}else"all"===u?s.forEachNode(l):n||r?s.forEachNodeAfterFilterAndSort(l,!0):s.forEachNode(l);return i}}replicateSortedOrder(e){const t=this.sortController.getSortOptions(),i=(e,s)=>{var o,n,r,a;return null!=e.rowIndex&&null!=s.rowIndex?e.rowIndex-s.rowIndex:e.level===s.level?(null==(o=e.parent)?void 0:o.id)===(null==(n=s.parent)?void 0:n.id)?this.rowNodeSorter.compareRowNodes(t,{rowNode:e,currentPos:null!=(r=e.rowIndex)?r:-1},{rowNode:s,currentPos:null!=(a=s.rowIndex)?a:-1}):i(e.parent,s.parent):e.level>s.level?i(e.parent,s):i(e,s.parent)};e.sort(i)}processPinnedBottomRows(e,t){return i=>{const s=this.processRow.bind(this,i,e,t);return e.rowPositions?e.rowPositions.filter((e=>"bottom"===e.rowPinned)).sort(((e,t)=>e.rowIndex-t.rowIndex)).map((e=>this.pinnedRowModel.getPinnedBottomRow(e.rowIndex))).forEach(s):this.pinnedRowModel.forEachPinnedBottomRow(s),i}}getColumnsToExport(e=!1,t=!1,i){const s=this.columnModel.isPivotMode();if(i&&i.length)return this.columnModel.getGridColumns(i);const o=this.gos.get("treeData");let n=[];return n=e&&!s?this.columnModel.getAllGridColumns():this.columnModel.getAllDisplayedColumns(),t&&!o&&(n=n.filter((e=>e.getColId()!==Gn))),n}recursivelyAddHeaderGroups(e,t,i){const s=[];e.forEach((e=>{const t=e;t.getChildren&&t.getChildren().forEach((e=>s.push(e)))})),e.length>0&&e[0]instanceof xn&&this.doAddHeaderHeader(t,e,i),s&&s.length>0&&this.recursivelyAddHeaderGroups(s,t,i)}doAddHeaderHeader(e,t,i){const s=e.onNewHeaderGroupingRow();let o=0;t.forEach((e=>{const t=e;let n;n=i?i(this.gos.addGridCommonParams({columnGroup:t})):this.columnModel.getDisplayNameForColumnGroup(t,"header");const r=t.getLeafColumns().reduce(((e,t,i,s)=>{let o=Vl.last(e);return"open"===t.getColumnGroupShow()?o&&null==o[1]||(o=[i],e.push(o)):o&&null==o[1]&&(o[1]=i-1),i===s.length-1&&o&&null==o[1]&&(o[1]=i),e}),[]);s.onColumn(t,n||"",o++,t.getLeafColumns().length-1,r)}))}};Pm([No("displayedGroupCreator")],_m.prototype,"displayedGroupCreator",2),Pm([No("columnModel")],_m.prototype,"columnModel",2),Pm([No("rowModel")],_m.prototype,"rowModel",2),Pm([No("pinnedRowModel")],_m.prototype,"pinnedRowModel",2),Pm([No("selectionService")],_m.prototype,"selectionService",2),Pm([No("rowNodeSorter")],_m.prototype,"rowNodeSorter",2),Pm([No("sortController")],_m.prototype,"sortController",2);var Om={version:"31.3.4",moduleName:"@ag-grid-community/csv-export",beans:[Nm,_m=Pm([Io("gridSerializer")],_m)]};function Gm(e,t){let i="";for(let s=0;s<t;s++)i+=String.fromCharCode(255&e),e>>>=8;return i}var km=e=>e.length?(e=>{if(!e.length)return 0;let t=-1,i=0,s=0,o=0;for(let n=0;n<e.length;n++)i=e[n],s=255&(t^i),o=Vm[s],t=t>>>8^o;return~t})("string"==typeof e?(new TextEncoder).encode(e):e):0,Vm=new Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]),{utf8_encode:Hm}=Vl,Bm=(e,t)=>Fm(void 0,null,(function*(){const{content:i}=e,{size:s,content:o}=i?zm(i):{size:0,content:Uint8Array.from([])};let n,r,a=!1;if("file"===e.type&&o&&s>0){const e=yield(e=>Fm(void 0,null,(function*(){const t=new Blob([e]),{size:i,content:s}=yield(o=t,Fm(void 0,null,(function*(){let e=0;const t=[],i=new WritableStream({write:i=>{t.push(i),e+=i.length}}),s=new ReadableStream({start:e=>{const t=new FileReader;t.onload=t=>{var i;(null==(i=t.target)?void 0:i.result)&&e.enqueue(t.target.result),e.close()},t.readAsArrayBuffer(o)}}),n=new window.CompressionStream("deflate-raw");return yield s.pipeThrough(n).pipeTo(i),{size:e,content:new Blob(t)}})));var o;return{size:i,content:new Uint8Array(yield s.arrayBuffer())}})))(o);n=e.content,r=e.size,a=!0}const l=Um(e,a,t,s,o,r);return Am(Tm({},l),{content:n||o,isCompressed:a})})),Wm=(e,t)=>{const{content:i}=e,{content:s}=i?zm(i):{content:Uint8Array.from([])},o=Um(e,!1,t,s.length,s,void 0);return Am(Tm({},o),{content:s,isCompressed:!1})},Um=(e,t,i,s,o,n)=>{const{content:r,path:a,created:l}=e,u=(e=>{let t=e.getHours();return t<<=6,t|=e.getMinutes(),t<<=5,t|=e.getSeconds()/2,t})(l),h=(e=>{let t=e.getFullYear()-1980;return t<<=4,t|=e.getMonth()+1,t<<=5,t|=e.getDate(),t})(l),d=km(o),c=void 0!==n?n:s,p=Hm(a),g=p!==a;let m="";if(g){const e=Gm(1,1)+Gm(km(p),4)+p;m="up"+Gm(e.length,2)+e}const f="\0"+(g?"\0\b":"\0\0")+Gm(t?8:0,2)+Gm(u,2)+Gm(h,2)+Gm(c?d:0,4)+Gm(null!=n?n:s,4)+Gm(s,4)+Gm(p.length,2)+Gm(m.length,2),C="PK"+f+p+m,v="PK\0"+f+"\0\0\0\0\0\0"+(r?"\0\0\0\0":"\0\0\0")+Gm(i,4)+p+m;return{localFileHeader:Uint8Array.from(C,(e=>e.charCodeAt(0))),centralDirectoryHeader:Uint8Array.from(v,(e=>e.charCodeAt(0)))}},zm=e=>{let t;return t="string"==typeof e?(e=>{const t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t})(atob(e.split(";base64,")[1])):e,{size:t.length,content:t}},$m=class{static addFolders(e){e.forEach(this.addFolder.bind(this))}static addFolder(e){this.folders.push({path:e,created:new Date,isBase64:!1,type:"folder"})}static addFile(e,t,i=!1){this.files.push({path:e,created:new Date,content:i?t:(new TextEncoder).encode(t),isBase64:i,type:"file"})}static getZipFile(e="application/zip"){return Fm(this,null,(function*(){const t=yield this.buildCompressedFileStream();return this.clearStream(),new Blob([t],{type:e})}))}static getUncompressedZipFile(e="application/zip"){const t=this.buildFileStream();return this.clearStream(),new Blob([t],{type:e})}static clearStream(){this.folders=[],this.files=[]}static packageFiles(e){let t=new Uint8Array(0),i=new Uint8Array(0),s=0,o=0;for(const n of e){const{localFileHeader:e,centralDirectoryHeader:r,content:a}=n,l=new Uint8Array(t.length+e.length);l.set(t),l.set(e,t.length),t=l;const u=new Uint8Array(t.length+a.length);u.set(t),u.set(a,t.length),t=u;const h=new Uint8Array(i.length+r.length);h.set(i),h.set(r,i.length),i=h,s+=e.length+a.length,o+=r.length}const n=((e,t,i)=>{const s="PK\0\0\0\0"+Gm(e,2)+Gm(e,2)+Gm(t,4)+Gm(i,4)+"\0\0";return Uint8Array.from(s,(e=>e.charCodeAt(0)))})(e.length,o,s),r=new Uint8Array(t.length+i.length+n.length);return r.set(t),r.set(i,t.length),r.set(n,t.length+i.length),r}static buildCompressedFileStream(){return Fm(this,null,(function*(){const e=[...this.folders,...this.files],t=[];let i=0;for(const s of e){const e=yield Bm(s,i),{localFileHeader:o,content:n}=e;t.push(e),i+=o.length+n.length}return this.packageFiles(t)}))}static buildFileStream(){const e=[...this.folders,...this.files],t=[];let i=0;for(const s of e){const e=Wm(s,i),{localFileHeader:o,content:n}=e;t.push(e),i+=o.length+n.length}return this.packageFiles(t)}};$m.folders=[],$m.files=[],Po.__registerModules([lm,Cm,Om],!1,void 0);const Km=window.ReactDOM;var jm=i(852),Ym=Object.defineProperty,qm=Object.defineProperties,Xm=Object.getOwnPropertyDescriptors,Qm=Object.getOwnPropertySymbols,Jm=Object.prototype.hasOwnProperty,Zm=Object.prototype.propertyIsEnumerable,ef=(e,t,i)=>t in e?Ym(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,tf=(e,t)=>{for(var i in t||(t={}))Jm.call(t,i)&&ef(e,i,t[i]);if(Qm)for(var i of Qm(t))Zm.call(t,i)&&ef(e,i,t[i]);return e},sf=(e,t)=>qm(e,Xm(t)),of=(0,o.createContext)({setMethods:()=>{}}),nf=(0,o.memo)((e=>{const{initialProps:t,addUpdateCallback:i,CustomComponentClass:s,setMethods:n}=e,[r,a]=(0,o.useState)(t);return(0,o.useEffect)((()=>{i((e=>a(e)))}),[]),o.createElement(of.Provider,{value:{setMethods:n}},o.createElement(s,tf({},r)))})),rf=0;function af(){return"agPortalKey_"+ ++rf}var lf=class{constructor(e,t,i,s){this.portal=null,this.oldPortal=null,this.reactComponent=e,this.portalManager=t,this.componentType=i,this.suppressFallbackMethods=!!s,this.statelessComponent=this.isStateless(this.reactComponent),this.key=af(),this.portalKey=af(),this.instanceCreated=this.isStatelessComponent()?Bl.resolve(!1):new Bl((e=>{this.resolveInstanceCreated=e}))}getGui(){return this.eParentElement}getRootElement(){return this.eParentElement.firstChild}destroy(){return this.componentInstance&&"function"==typeof this.componentInstance.destroy&&this.componentInstance.destroy(),this.portalManager.destroyPortal(this.portal)}createParentElement(e){const t=this.portalManager.getComponentWrappingElement(),i=document.createElement(t||"div");return i.classList.add("ag-react-container"),e.reactContainer=i,i}addParentContainerStyleAndClasses(){this.componentInstance&&(this.componentInstance.getReactContainerStyle&&this.componentInstance.getReactContainerStyle()&&(Vl.warnOnce('Since v31.1 "getReactContainerStyle" is deprecated. Apply styling directly to ".ag-react-container" if needed.'),Object.assign(this.eParentElement.style,this.componentInstance.getReactContainerStyle())),this.componentInstance.getReactContainerClasses&&this.componentInstance.getReactContainerClasses())&&(Vl.warnOnce('Since v31.1 "getReactContainerClasses" is deprecated. Apply styling directly to ".ag-react-container" if needed.'),this.componentInstance.getReactContainerClasses().forEach((e=>this.eParentElement.classList.add(e))))}statelessComponentRendered(){return this.eParentElement.childElementCount>0||this.eParentElement.childNodes.length>0}getFrameworkComponentInstance(){return this.componentInstance}isStatelessComponent(){return this.statelessComponent}getReactComponentName(){return this.reactComponent.name}getMemoType(){return this.hasSymbol()?Symbol.for("react.memo"):60115}hasSymbol(){return"function"==typeof Symbol&&Symbol.for}isStateless(e){return"function"==typeof e&&!(e.prototype&&e.prototype.isReactComponent)||"object"==typeof e&&e.$$typeof===this.getMemoType()}hasMethod(e){const t=this.getFrameworkComponentInstance();return!!t&&null!=t[e]||this.fallbackMethodAvailable(e)}callMethod(e,t){const i=this.getFrameworkComponentInstance();if(this.isStatelessComponent())return this.fallbackMethod(e,t&&t[0]?t[0]:{});if(!i)return void setTimeout((()=>this.callMethod(e,t)));const s=i[e];return s?s.apply(i,t):this.fallbackMethodAvailable(e)?this.fallbackMethod(e,t&&t[0]?t[0]:{}):void 0}addMethod(e,t){this[e]=t}init(e){return this.eParentElement=this.createParentElement(e),this.params=e,this.createOrUpdatePortal(e),new Bl((e=>this.createReactComponent(e)))}createOrUpdatePortal(e){this.isStatelessComponent()||(this.ref=e=>{var t;this.componentInstance=e,this.addParentContainerStyleAndClasses(),null==(t=this.resolveInstanceCreated)||t.call(this,!0),this.resolveInstanceCreated=void 0},e.ref=this.ref),this.reactElement=this.createElement(this.reactComponent,sf(tf({},e),{key:this.key})),this.portal=(0,Km.createPortal)(this.reactElement,this.eParentElement,this.portalKey)}createElement(e,t){return(0,o.createElement)(e,t)}createReactComponent(e){this.portalManager.mountReactPortal(this.portal,this,(t=>{e(t)}))}isNullValue(){return this.valueRenderedIsNull(this.params)}rendered(){return this.isStatelessComponent()&&this.statelessComponentRendered()||!(this.isStatelessComponent()||!this.getFrameworkComponentInstance())}valueRenderedIsNull(e){if(!this.componentType.cellRenderer)return!1;const t=console.error;try{return console.error=()=>{},""===(0,jm.qV)((0,o.createElement)(this.reactComponent,e))}catch(e){}finally{console.error=t}return!1}refreshComponent(e){this.oldPortal=this.portal,this.createOrUpdatePortal(e),this.portalManager.updateReactPortal(this.oldPortal,this.portal)}fallbackMethod(e,t){const i=this[`${e}Component`];if(!this.suppressFallbackMethods&&i)return i.bind(this)(t)}fallbackMethodAvailable(e){return!this.suppressFallbackMethods&&!!this[`${e}Component`]}};function uf(e,t,i){e.forEach((e=>{const s=t[e];s&&(i[e]=s)}))}var hf=class extends lf{constructor(){super(...arguments),this.awaitUpdateCallback=new Bl((e=>{this.resolveUpdateCallback=e})),this.wrapperComponent=nf}init(e){return this.sourceParams=e,super.init(this.getProps())}addMethod(){}getInstance(){return this.instanceCreated.then((()=>this.componentInstance))}getFrameworkComponentInstance(){return this}createElement(e,t){return super.createElement(this.wrapperComponent,{initialProps:t,CustomComponentClass:e,setMethods:e=>this.setMethods(e),addUpdateCallback:e=>{this.updateCallback=()=>(e(this.getProps()),new Bl((e=>{setTimeout((()=>{e()}))}))),this.resolveUpdateCallback()}})}setMethods(e){this.providedMethods=e,uf(this.getOptionalMethods(),this.providedMethods,this)}getOptionalMethods(){return[]}getProps(){return sf(tf({},this.sourceParams),{key:this.key,ref:this.ref})}refreshProps(){return this.updateCallback?this.updateCallback():new Bl((e=>this.awaitUpdateCallback.then((()=>{this.updateCallback().then((()=>e()))}))))}},df=class extends hf{constructor(){super(...arguments),this.date=null,this.onDateChange=e=>this.updateDate(e)}getDate(){return this.date}setDate(e){this.date=e,this.refreshProps()}refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled"]}updateDate(e){this.setDate(e),this.sourceParams.onDateChanged()}getProps(){const e=super.getProps();return e.date=this.date,e.onDateChange=this.onDateChange,delete e.onDateChanged,e}},cf=class extends hf{constructor(){super(...arguments),this.model=null,this.onModelChange=e=>this.updateModel(e),this.onUiChange=()=>this.sourceParams.filterChangedCallback()}isFilterActive(){return null!=this.model}doesFilterPass(e){return this.providedMethods.doesFilterPass(e)}getModel(){return this.model}setModel(e){return this.model=e,this.refreshProps()}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}getOptionalMethods(){return["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onAnyFilterChanged"]}updateModel(e){this.setModel(e).then((()=>this.sourceParams.filterChangedCallback()))}getProps(){const e=super.getProps();return e.model=this.model,e.onModelChange=this.onModelChange,e.onUiChange=this.onUiChange,delete e.filterChangedCallback,delete e.filterModifiedCallback,delete e.valueGetter,e}};function pf(e,t){e.parentFilterInstance((i=>{(i.setModel(t)||Bl.resolve()).then((()=>{e.filterParams.filterChangedCallback()}))}))}var gf=class{constructor(e,t){this.floatingFilterParams=e,this.refreshProps=t,this.model=null,this.onModelChange=e=>this.updateModel(e)}getProps(){return sf(tf({},this.floatingFilterParams),{model:this.model,onModelChange:this.onModelChange})}onParentModelChanged(e){this.model=e,this.refreshProps()}refresh(e){this.floatingFilterParams=e,this.refreshProps()}setMethods(e){uf(this.getOptionalMethods(),e,this)}getOptionalMethods(){return["afterGuiAttached"]}updateModel(e){this.model=e,this.refreshProps(),pf(this.floatingFilterParams,e)}},mf=class extends hf{constructor(){super(...arguments),this.model=null,this.onModelChange=e=>this.updateModel(e)}onParentModelChanged(e){this.model=e,this.refreshProps()}refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached"]}updateModel(e){this.model=e,this.refreshProps(),pf(this.sourceParams,e)}getProps(){const e=super.getProps();return e.model=this.model,e.onModelChange=this.onModelChange,e}},ff=class extends hf{refresh(e){this.sourceParams=e,this.refreshProps()}},Cf=class extends hf{constructor(){super(...arguments),this.active=!1,this.expanded=!1,this.onActiveChange=e=>this.updateActive(e)}setActive(e){this.awaitSetActive(e)}setExpanded(e){this.expanded=e,this.refreshProps()}getOptionalMethods(){return["select","configureDefaults"]}awaitSetActive(e){return this.active=e,this.refreshProps()}updateActive(e){const t=this.awaitSetActive(e);e&&t.then((()=>this.sourceParams.onItemActivated()))}getProps(){const e=super.getProps();return e.active=this.active,e.expanded=this.expanded,e.onActiveChange=this.onActiveChange,delete e.onItemActivated,e}},vf=class extends hf{refresh(e){this.sourceParams=e,this.refreshProps()}},wf=class extends hf{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},yf=class extends hf{constructor(){super(...arguments),this.onStateChange=e=>this.updateState(e)}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}getState(){return this.state}updateState(e){this.state=e,this.refreshProps(),this.sourceParams.onStateUpdated()}getProps(){const e=super.getProps();return e.state=this.state,e.onStateChange=this.onStateChange,e}},Ef=class e{constructor(t,i,s){this.destroyed=!1,this.portals=[],this.hasPendingPortalUpdate=!1,this.wrappingElement=i||"div",this.refresher=t,this.maxComponentCreationTimeMs=s||e.MAX_COMPONENT_CREATION_TIME_IN_MS}getPortals(){return this.portals}destroy(){this.destroyed=!0}destroyPortal(e){this.portals=this.portals.filter((t=>t!==e)),this.batchUpdate()}getComponentWrappingElement(){return this.wrappingElement}mountReactPortal(e,t,i){this.portals=[...this.portals,e],this.waitForInstance(t,i),this.batchUpdate()}updateReactPortal(e,t){this.portals[this.portals.indexOf(e)]=t,this.batchUpdate()}batchUpdate(){this.hasPendingPortalUpdate||(setTimeout((()=>{this.destroyed||(this.refresher(),this.hasPendingPortalUpdate=!1)})),this.hasPendingPortalUpdate=!0)}waitForInstance(e,t,i=Date.now()){if(this.destroyed)t(null);else if(e.rendered())t(e);else{if(Date.now()-i>=this.maxComponentCreationTimeMs&&!this.hasPendingPortalUpdate)return e.isNullValue()?void t(e):(console.error(`AG Grid: React Component '${e.getReactComponentName()}' not created within ${this.maxComponentCreationTimeMs}ms.`),void console.error(" If the component is using `forwardRef` but not `useImperativeHandle`, add the following: `useImperativeHandle(ref, () => ({}));`"));window.setTimeout((()=>{this.waitForInstance(e,t,i)}))}}};Ef.MAX_COMPONENT_CREATION_TIME_IN_MS=1e3;var Sf=Ef,bf=o.createContext({}),Rf=(...e)=>e.filter((e=>null!=e&&""!==e)).join(" "),Df=class e{constructor(...e){this.classesMap={},e.forEach((e=>{this.classesMap[e]=!0}))}setClass(t,i){if(!!this.classesMap[t]==i)return this;const s=new e;return s.classesMap=tf({},this.classesMap),s.classesMap[t]=i,s}toString(){return Object.keys(this.classesMap).filter((e=>this.classesMap[e])).join(" ")}},Tf=e=>"function"==typeof e&&!(e.prototype&&e.prototype.isReactComponent)||"object"==typeof e&&e.$$typeof===("function"==typeof Symbol&&Symbol.for?Symbol.for("react.memo"):60115),Af=null!=Km.createRoot&&null!=Km.flushSync,Pf=!1,Ff=(e,t)=>{Af&&e&&!Pf?Km.flushSync(t):t()};function Mf(e,t,i){if(null==t||null==e)return t;if(e===t||0===t.length&&0===e.length)return e;if(i||0===e.length&&t.length>0||e.length>0&&0===t.length)return t;const s=[],o=[],n=new Map,r=new Map;for(let e=0;e<t.length;e++){const i=t[e];r.set(i.getInstanceId(),i)}for(let t=0;t<e.length;t++){const i=e[t];n.set(i.getInstanceId(),i),r.has(i.getInstanceId())&&s.push(i)}for(let e=0;e<t.length;e++){const i=t[e],s=i.getInstanceId();n.has(s)||o.push(i)}return s.length===e.length&&0===o.length?e:0===s.length&&o.length===t.length?t:0===s.length?o:0===o.length?s:[...s,...o]}var Lf=(e,t,i,s)=>{if(!e||e.componentFromFramework||t.isDestroyed())return;const o=e.newAgStackInstance();if(!o)return;let n,r,a=!1;return o.then((e=>{a?t.destroyBean(e):(n=e,r=n.getGui(),i.appendChild(r),xf(s,n))})),()=>{a=!0,n&&(r&&r.parentElement&&r.parentElement.removeChild(r),t.destroyBean(n),s&&xf(s,void 0))}},xf=(e,t)=>{e&&(e instanceof Function?e(t):e.current=t)},If=(0,o.forwardRef)(((e,t)=>{var i;const s=(0,o.useContext)(bf).context,n=(0,o.useRef)(null),r=(0,o.useRef)(null),a=(0,o.useRef)(null),l=(0,o.useRef)(null),u=(0,o.useRef)(null),h=(0,o.useRef)(),[d,c]=(0,o.useState)(),[p,g]=(0,o.useState)(),[m,f]=(0,o.useState)(),[C,v]=(0,o.useState)((()=>new Df)),[w,y]=(0,o.useState)((()=>new Df("ag-hidden"))),[E,S]=(0,o.useState)((()=>new Df("ag-hidden"))),[b,R]=(0,o.useState)((()=>new Df("ag-invisible")));(0,o.useImperativeHandle)(t,(()=>({refresh:()=>!1}))),(0,o.useLayoutEffect)((()=>Lf(d,s,r.current)),[d]);const D=(0,o.useCallback)((t=>{if(n.current=t,!n.current)return s.destroyBean(h.current),void(h.current=null);const i={setInnerRenderer:(e,t)=>{c(e),f(t)},setChildCount:e=>g(e),addOrRemoveCssClass:(e,t)=>v((i=>i.setClass(e,t))),setContractedDisplayed:e=>S((t=>t.setClass("ag-hidden",!e))),setExpandedDisplayed:e=>y((t=>t.setClass("ag-hidden",!e))),setCheckboxVisible:e=>R((t=>t.setClass("ag-invisible",!e)))};h.current=s.createBean(new mh),h.current.init(i,n.current,a.current,l.current,u.current,If,e)}),[]),T=(0,o.useMemo)((()=>`ag-cell-wrapper ${C.toString()}`),[C]),A=(0,o.useMemo)((()=>`ag-group-expanded ${w.toString()}`),[w]),P=(0,o.useMemo)((()=>`ag-group-contracted ${E.toString()}`),[E]),F=(0,o.useMemo)((()=>`ag-group-checkbox ${b.toString()}`),[b]),M=d&&d.componentFromFramework,L=M?d.componentClass:void 0,x=null==d&&null!=m,I=Vl.escapeString(m,!0);return o.createElement("span",tf({className:T,ref:D},e.colDef?{}:{role:null==(i=h.current)?void 0:i.getCellAriaRole()}),o.createElement("span",{className:A,ref:l}),o.createElement("span",{className:P,ref:u}),o.createElement("span",{className:F,ref:a}),o.createElement("span",{className:"ag-group-value",ref:r},x&&o.createElement(o.Fragment,null,I),M&&o.createElement(L,tf({},d.params))),o.createElement("span",{className:"ag-group-child-count"},p))})),Nf=If,_f=(0,o.memo)((e=>{const{ctrl:t}=e,i=t.isAlive(),{context:s}=(0,o.useContext)(bf),n=i?t.getColId():void 0,[r,a]=(0,o.useState)(),l=(0,o.useRef)(null),u=(0,o.useRef)(null),h=(0,o.useRef)(null),d=(0,o.useRef)();let c=(0,o.useRef)();i&&!c.current&&(c.current=new Wl((()=>l.current)));const p=(0,o.useCallback)((e=>{var s;if(l.current=e,!l.current||!i)return;const o={setWidth:e=>{l.current&&(l.current.style.width=e)},addOrRemoveCssClass:(e,t)=>c.current.addOrRemoveCssClass(e,t),setAriaSort:e=>{l.current&&(e?Vl.setAriaSort(l.current,e):Vl.removeAriaSort(l.current))},setUserCompDetails:e=>a(e),getUserCompInstance:()=>d.current||void 0};t.setComp(o,l.current,u.current,h.current);const n=t.getSelectAllGui();null==(s=u.current)||s.insertAdjacentElement("afterend",n)}),[]);(0,o.useLayoutEffect)((()=>Lf(r,s,h.current,d)),[r]),(0,o.useEffect)((()=>{t.setDragSource(l.current)}),[r]);const g=(0,o.useMemo)((()=>!(!(null==r?void 0:r.componentFromFramework)||!Tf(r.componentClass))),[r]),m=r&&r.componentFromFramework,f=r&&r.componentClass;return o.createElement("div",{ref:p,className:"ag-header-cell","col-id":n,role:"columnheader"},o.createElement("div",{ref:u,className:"ag-header-cell-resize",role:"presentation"}),o.createElement("div",{ref:h,className:"ag-header-cell-comp-wrapper",role:"presentation"},m&&g&&o.createElement(f,tf({},r.params)),m&&!g&&o.createElement(f,sf(tf({},r.params),{ref:d}))))})),Of=(0,o.memo)((e=>{const{context:t}=(0,o.useContext)(bf),{ctrl:i}=e,[s,n]=(0,o.useState)((()=>new Df)),[r,a]=(0,o.useState)((()=>new Df)),[l,u]=(0,o.useState)("false"),[h,d]=(0,o.useState)(),[c,p]=(0,o.useState)(),g=(0,o.useMemo)((()=>i.getColId()),[]),m=(0,o.useRef)(null),f=(0,o.useRef)(null),C=(0,o.useRef)(),v=(0,o.useCallback)((e=>{if(m.current=e,!m.current)return;const t={setWidth:e=>{m.current&&(m.current.style.width=e)},addOrRemoveCssClass:(e,t)=>n((i=>i.setClass(e,t))),setUserCompDetails:e=>p(e),setResizableDisplayed:e=>{a((t=>t.setClass("ag-hidden",!e))),u(e?"false":"true")},setAriaExpanded:e=>d(e),getUserCompInstance:()=>C.current||void 0};i.setComp(t,m.current,f.current)}),[]);(0,o.useLayoutEffect)((()=>Lf(c,t,m.current)),[c]),(0,o.useEffect)((()=>{m.current&&i.setDragSource(m.current)}),[c]);const w=(0,o.useMemo)((()=>!(!(null==c?void 0:c.componentFromFramework)||!Tf(c.componentClass))),[c]),y=(0,o.useMemo)((()=>"ag-header-group-cell "+s.toString()),[s]),E=(0,o.useMemo)((()=>"ag-header-cell-resize "+r.toString()),[r]),S=c&&c.componentFromFramework,b=c&&c.componentClass;return o.createElement("div",{ref:v,className:y,"col-id":g,role:"columnheader","aria-expanded":h},S&&w&&o.createElement(b,tf({},c.params)),S&&!w&&o.createElement(b,sf(tf({},c.params),{ref:C})),o.createElement("div",{ref:f,"aria-hidden":l,className:E}))}));function Gf(){Vl.warnOnce("Using custom components without `reactiveCustomComponents = true` is deprecated.")}var kf=(0,o.memo)((e=>{const{context:t,gos:i}=(0,o.useContext)(bf),[s,n]=(0,o.useState)((()=>new Df("ag-header-cell","ag-floating-filter"))),[r,a]=(0,o.useState)((()=>new Df)),[l,u]=(0,o.useState)((()=>new Df("ag-floating-filter-button","ag-hidden"))),[h,d]=(0,o.useState)("false"),[c,p]=(0,o.useState)(),[g,m]=(0,o.useState)(1),f=(0,o.useRef)(null),C=(0,o.useRef)(null),v=(0,o.useRef)(null),w=(0,o.useRef)(null),y=(0,o.useRef)(),E=(0,o.useRef)(),S=e=>{null!=e&&y.current&&y.current(e)},{ctrl:b}=e,R=(0,o.useCallback)((e=>{if(f.current=e,!f.current)return;E.current=new Bl((e=>{y.current=e}));const t={addOrRemoveCssClass:(e,t)=>n((i=>i.setClass(e,t))),addOrRemoveBodyCssClass:(e,t)=>a((i=>i.setClass(e,t))),setButtonWrapperDisplayed:e=>{u((t=>t.setClass("ag-hidden",!e))),d(e?"false":"true")},setWidth:e=>{f.current&&(f.current.style.width=e)},setCompDetails:e=>p(e),getFloatingFilterComp:()=>E.current?E.current:null,setMenuIcon:e=>{var t;return null==(t=w.current)?void 0:t.appendChild(e)}};b.setComp(t,f.current,w.current,C.current)}),[]);(0,o.useLayoutEffect)((()=>Lf(c,t,C.current,S)),[c]);const D=(0,o.useMemo)((()=>s.toString()),[s]),T=(0,o.useMemo)((()=>r.toString()),[r]),A=(0,o.useMemo)((()=>l.toString()),[l]),P=(0,o.useMemo)((()=>!!(c&&c.componentFromFramework&&Tf(c.componentClass))),[c]),F=(0,o.useMemo)((()=>i.get("reactiveCustomComponents")),[]),M=(0,o.useMemo)((()=>{if(c){if(F){const e=new gf(c.params,(()=>m((e=>e+1))));return S(e),e}c.componentFromFramework&&Gf()}}),[c]),L=null==M?void 0:M.getProps(),x=c&&c.componentFromFramework,I=c&&c.componentClass;return o.createElement("div",{ref:R,className:D,role:"gridcell"},o.createElement("div",{ref:C,className:T,role:"presentation"},x&&!F&&o.createElement(I,sf(tf({},c.params),{ref:P?()=>{}:S})),x&&F&&o.createElement(of.Provider,{value:{setMethods:e=>M.setMethods(e)}},o.createElement(I,tf({},L)))),o.createElement("div",{ref:v,"aria-hidden":h,className:A,role:"presentation"},o.createElement("button",{ref:w,type:"button",className:"ag-button ag-floating-filter-button-button",tabIndex:-1})))})),Vf=(0,o.memo)((e=>{const{ctrl:t}=e,{topOffset:i,rowHeight:s}=(0,o.useMemo)((()=>t.getTopAndHeight()),[]),n=t.getAriaRowIndex(),r=t.getHeaderRowClass(),[a,l]=(0,o.useState)((()=>s+"px")),[u,h]=(0,o.useState)((()=>i+"px")),d=(0,o.useRef)(null),c=(0,o.useRef)(null),[p,g]=(0,o.useState)((()=>t.getHeaderCtrls())),m=(0,o.useRef)(null),f=(0,o.useCallback)((e=>{if(m.current=e,!e)return;const i={setHeight:e=>l(e),setTop:e=>h(e),setHeaderCtrls:(e,t,i)=>{c.current=d.current,d.current=e;const s=Mf(c.current,e,t);s!==c.current&&Ff(i,(()=>g(s)))},setWidth:e=>{m.current&&(m.current.style.width=e)}};t.setComp(i,!1)}),[]),C=(0,o.useMemo)((()=>({height:a,top:u})),[a,u]),v=(0,o.useCallback)((e=>{switch(t.getType()){case pc.COLUMN_GROUP:return o.createElement(Of,{ctrl:e,key:e.getInstanceId()});case pc.FLOATING_FILTER:return o.createElement(kf,{ctrl:e,key:e.getInstanceId()});default:return o.createElement(_f,{ctrl:e,key:e.getInstanceId()})}}),[]);return o.createElement("div",{ref:f,className:r,role:"row",style:C,"aria-rowindex":n},p.map(v))})),Hf=(0,o.memo)((e=>{const[t,i]=(0,o.useState)(!0),[s,n]=(0,o.useState)([]),{context:r}=(0,o.useContext)(bf),a=(0,o.useRef)(null),l=(0,o.useRef)(null),u=(0,o.useRef)(null),h="left"===e.pinned,d="right"===e.pinned,c=!h&&!d,p=(0,o.useCallback)((t=>{if(a.current=t,!a.current)return r.destroyBean(u.current),void(u.current=null);const s={setDisplayed:i,setCtrls:e=>n(e),setCenterWidth:e=>{l.current&&(l.current.style.width=e)},setViewportScrollLeft:e=>{a.current&&(a.current.scrollLeft=e)},setPinnedContainerWidth:e=>{a.current&&(a.current.style.width=e,a.current.style.minWidth=e,a.current.style.maxWidth=e)}};u.current=r.createBean(new Fc(e.pinned)),u.current.setComp(s,a.current)}),[]),g=t?"":"ag-hidden",m=()=>s.map((e=>o.createElement(Vf,{ctrl:e,key:e.getInstanceId()})));return o.createElement(o.Fragment,null,h&&o.createElement("div",{ref:p,className:"ag-pinned-left-header "+g,"aria-hidden":!t,role:"rowgroup"},m()),d&&o.createElement("div",{ref:p,className:"ag-pinned-right-header "+g,"aria-hidden":!t,role:"rowgroup"},m()),c&&o.createElement("div",{ref:p,className:"ag-header-viewport "+g,role:"presentation"},o.createElement("div",{ref:l,className:"ag-header-container",role:"rowgroup"},m())))})),Bf=(0,o.memo)((()=>{const[e,t]=(0,o.useState)((()=>new Df)),[i,s]=(0,o.useState)(),{context:n}=(0,o.useContext)(bf),r=(0,o.useRef)(null),a=(0,o.useRef)(null),l=(0,o.useCallback)((e=>{if(r.current=e,!e)return n.destroyBean(a.current),void(a.current=null);const i={addOrRemoveCssClass:(e,i)=>t((t=>t.setClass(e,i))),setHeightAndMinHeight:e=>s(e)};a.current=n.createBean(new Ic),a.current.setComp(i,r.current,r.current)}),[]),u=(0,o.useMemo)((()=>"ag-header "+e.toString()),[e]),h=(0,o.useMemo)((()=>({height:i,minHeight:i})),[i]);return o.createElement("div",{ref:l,className:u,style:h,role:"presentation"},o.createElement(Hf,{pinned:"left"}),o.createElement(Hf,{pinned:null}),o.createElement(Hf,{pinned:"right"}))})),Wf=(e,t)=>{(0,o.useEffect)((()=>{const i=t.current;if(i){const t=i.parentElement;if(t){const s=document.createComment(e);return t.insertBefore(s,i),()=>{t.removeChild(s)}}}}),[e])},Uf=(0,o.memo)((e=>{const[t,i]=(0,o.useState)(),{context:s,popupService:n,localeService:r,gos:a}=(0,o.useContext)(bf);return(()=>{const t=(0,o.useRef)((()=>{const{editDetails:t,cellCtrl:o,eParentCell:l}=e,{compDetails:u}=t,h=a.get("stopEditingWhenCellsLoseFocus"),d=s.createBean(new tc(u.params)),c=d.getGui();if(e.jsChildComp){const t=e.jsChildComp.getGui();t&&c.appendChild(t)}const p={column:o.getColumn(),rowNode:o.getRowNode(),type:"popupCellEditor",eventSource:l,ePopup:c,position:t.popupPosition,keepWithinBounds:!0},g=n.positionPopupByComponent.bind(n,p),m=r.getLocaleTextFunc(),f=n.addPopup({modal:h,eChild:c,closeOnEsc:!0,closedCallback:()=>{o.onPopupEditorClosed()},anchorToElement:l,positionCallback:g,ariaLabel:m("ariaLabelCellEditor","Cell Editor")}),C=f?f.hideFunc:void 0;return i(d),e.jsChildComp&&e.jsChildComp.afterGuiAttached&&e.jsChildComp.afterGuiAttached(),()=>{null!=C&&C(),s.destroyBean(d)}})),l=(0,o.useRef)(),u=(0,o.useRef)(!1),h=(0,o.useRef)(!1),[,d]=(0,o.useState)(0);u.current&&(h.current=!0),(0,o.useEffect)((()=>(u.current||(l.current=t.current(),u.current=!0),d((e=>e+1)),()=>{h.current&&l.current&&l.current()})),[])})(),o.createElement(o.Fragment,null,t&&e.wrappedContent&&(0,Km.createPortal)(e.wrappedContent,t.getGui()))})),zf=class{constructor(e,t){this.cellEditorParams=e,this.refreshProps=t,this.instanceCreated=new Bl((e=>{this.resolveInstanceCreated=e})),this.onValueChange=e=>this.updateValue(e),this.value=e.value}getProps(){return sf(tf({},this.cellEditorParams),{initialValue:this.cellEditorParams.value,value:this.value,onValueChange:this.onValueChange})}getValue(){return this.value}refresh(e){this.cellEditorParams=e,this.refreshProps()}setMethods(e){uf(this.getOptionalMethods(),e,this)}getInstance(){return this.instanceCreated.then((()=>this.componentInstance))}setRef(e){var t;this.componentInstance=e,null==(t=this.resolveInstanceCreated)||t.call(this),this.resolveInstanceCreated=void 0}getOptionalMethods(){return["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached"]}updateValue(e){this.value=e,this.refreshProps()}},$f=(e,t,i)=>{const s=e.compProxy;return o.createElement(o.Fragment,null,!s&&o.createElement(t,sf(tf({},e.compDetails.params),{ref:i})),s&&((e,t,i)=>{const{compProxy:s}=e;i(s);const n=s.getProps(),r=Tf(t);return o.createElement(of.Provider,{value:{setMethods:e=>s.setMethods(e)}},r&&o.createElement(t,tf({},n)),!r&&o.createElement(t,sf(tf({},n),{ref:e=>s.setRef(e)})))})(e,t,i))},Kf=(0,o.memo)((e=>{const{context:t}=(0,o.useContext)(bf),{cellCtrl:i,printLayout:s,editingRow:n}=e,r=i.getTabIndex(),a=i.getColumnIdSanitised(),l=i.getInstanceId(),[u,h]=(0,o.useState)((()=>i.isCellRenderer()?void 0:{compDetails:void 0,value:i.getValueToDisplay(),force:!1})),[d,c]=(0,o.useState)(),[p,g]=(0,o.useState)(1),[m,f]=(0,o.useState)(),[C,v]=(0,o.useState)(!1),[w,y]=(0,o.useState)(!1),[E,S]=(0,o.useState)(!1),[b,R]=(0,o.useState)(),D=(0,o.useMemo)((()=>i.isForceWrapper()),[i]),T=(0,o.useMemo)((()=>i.getCellAriaRole()),[i]),A=(0,o.useRef)(null),P=(0,o.useRef)(null),F=(0,o.useRef)(),M=(0,o.useRef)(),L=(0,o.useRef)(),x=(0,o.useRef)([]),I=(0,o.useRef)(),[N,_]=(0,o.useState)(0),O=(0,o.useCallback)((e=>{I.current=e,_((e=>e+1))}),[]),G=D||null!=u&&(C||E||w),k=(0,o.useCallback)(((e,t)=>{M.current=t,t&&(((e,t,i)=>{const s=i.getColumn();if(!e&&t.isPopup&&t.isPopup()){const e=`AG Grid: Found an issue in column ${s.getColId()}. If using React, specify an editor is a popup using colDef.cellEditorPopup=true. AG Grid React cannot depend on the editor component specifying if it's in a popup (via the isPopup() method on the editor), as React needs to know this information BEFORE the component is created.`;Vl.doOnce((()=>console.warn(e)),"jsEditorComp-isPopup-"+i.getColumn().getColId())}if(e&&t.getPopupPosition&&null!=t.getPopupPosition()){const e=`AG Grid: Found an issue in column ${s.getColId()}. If using React, specify an editor popup position using colDef.cellEditorPopupPosition=true. AG Grid React cannot depend on the editor component specifying it's position (via the getPopupPosition() method on the editor), as React needs to know this information BEFORE the component is created.`;Vl.doOnce((()=>console.warn(e)),"jsEditorComp-getPopupPosition-"+i.getColumn().getColId())}})(e,t,i),t.isCancelBeforeStart&&t.isCancelBeforeStart()&&setTimeout((()=>{i.stopEditing(!0),i.focusCell(!0)})))}),[i]),V=(0,o.useCallback)((e=>k(!0,e)),[k]),H=(0,o.useCallback)((e=>k(!1,e)),[k]);let B=(0,o.useRef)();B.current||(B.current=new Wl((()=>A.current))),((e,t,i,s,n,r)=>{const{context:a}=(0,o.useContext)(bf),l=(0,o.useCallback)((()=>{const e=n.current;if(!e)return;const t=e.getGui();t&&t.parentElement&&t.parentElement.removeChild(t),a.destroyBean(e),n.current=void 0}),[]);(0,o.useEffect)((()=>{const s=null!=e,o=e&&e.compDetails&&!e.compDetails.componentFromFramework;if(!s||!o||t&&null==i)return void l();const a=e.compDetails;if(n.current){const t=n.current,i=!(null==t.refresh||0!=e.force)&&t.refresh(a.params);if(!0===i||void 0===i)return;l()}const u=a.newAgStackInstance();if(!u)return;const h=u.resolveNow(null,(e=>e));if(!h)return;const d=h.getGui();d&&((t?i:r.current).appendChild(d),n.current=h)}),[e,t,s]),(0,o.useEffect)((()=>l),[])})(u,G,I.current,N,F,A);const W=(0,o.useRef)();(0,o.useLayoutEffect)((()=>{const e=W.current,t=u;if(W.current=u,null==e||null==e.compDetails||null==t||null==t.compDetails)return;const i=e.compDetails,s=t.compDetails;i.componentClass==s.componentClass&&null!=P.current&&null!=P.current.refresh&&1!=P.current.refresh(s.params)&&g((e=>e+1))}),[u]),(0,o.useLayoutEffect)((()=>{if(!d||d.compDetails.componentFromFramework)return;const e=d.compDetails,i=!0===d.popup,s=(e=>{const t=e.newAgStackInstance();if(t)return t.resolveNow(null,(e=>e))})(e);if(!s)return;const o=s.getGui();if(k(i,s),!i){const e=(D?L:A).current;null==e||e.appendChild(o),s.afterGuiAttached&&s.afterGuiAttached()}return R(s),()=>{t.destroyBean(s),k(i,void 0),R(void 0),o&&o.parentElement&&o.parentElement.removeChild(o)}}),[d]);const U=(0,o.useCallback)((e=>{if(L.current=e,!L.current)return x.current.forEach((e=>e())),void(x.current=[]);const s=e=>{var i;if(e){const s=e.getGui();null==(i=L.current)||i.insertAdjacentElement("afterbegin",s),x.current.push((()=>{t.destroyBean(e),Vl.removeFromParent(s)}))}return e};C&&s(i.createSelectionCheckbox()),E&&s(i.createDndSource()),w&&s(i.createRowDragComp())}),[i,t,E,w,C]),z=(0,o.useCallback)((e=>{if(A.current=e,!A.current)return;if(!i)return;const t={addOrRemoveCssClass:(e,t)=>B.current.addOrRemoveCssClass(e,t),setUserStyles:e=>f(e),getFocusableElement:()=>A.current,setIncludeSelection:e=>v(e),setIncludeRowDrag:e=>y(e),setIncludeDndSource:e=>S(e),getCellEditor:()=>M.current||null,getCellRenderer:()=>P.current?P.current:F.current,getParentOfValue:()=>I.current?I.current:L.current?L.current:A.current,setRenderDetails:(e,t,i)=>{h((s=>(null==s?void 0:s.compDetails)!==e||(null==s?void 0:s.value)!==t||(null==s?void 0:s.force)!==i?{value:t,compDetails:e,force:i}:s))},setEditDetails:(e,t,i,s)=>{if(e){let o;s?o=new zf(e.params,(()=>g((e=>e+1)))):e.componentFromFramework&&Gf(),c({compDetails:e,popup:t,popupPosition:i,compProxy:o}),t||h(void 0)}else c((e=>{(null==e?void 0:e.compProxy)&&(M.current=void 0)}))}},o=L.current||void 0;i.setComp(t,A.current,o,s,n)}),[]),$=(0,o.useMemo)((()=>!!(u&&u.compDetails&&u.compDetails.componentFromFramework&&Tf(u.compDetails.componentClass))),[u]);(0,o.useLayoutEffect)((()=>{var e;A.current&&(B.current.addOrRemoveCssClass("ag-cell-value",!G),B.current.addOrRemoveCssClass("ag-cell-inline-editing",!!d&&!d.popup),B.current.addOrRemoveCssClass("ag-cell-popup-editing",!!d&&!!d.popup),B.current.addOrRemoveCssClass("ag-cell-not-inline-editing",!d||!!d.popup),null==(e=i.getRowCtrl())||e.setInlineEditingCss(!!d),i.shouldRestoreFocus()&&!i.isEditing()&&A.current.focus({preventScroll:!0}))}));const K=()=>o.createElement(o.Fragment,null,null!=u&&((e,t,i,s,n,r,a)=>{const{compDetails:l,value:u}=e,h=!l,d=l&&l.componentFromFramework,c=l&&l.componentClass,p=(null==u?void 0:u.toString)?u.toString():u,g=()=>o.createElement(o.Fragment,null,h&&o.createElement(o.Fragment,null,p),d&&!r&&o.createElement(c,sf(tf({},l.params),{key:t,ref:s})),d&&r&&o.createElement(c,sf(tf({},l.params),{key:t})));return o.createElement(o.Fragment,null,n?o.createElement("span",{role:"presentation",id:`cell-${i}`,className:"ag-cell-value",ref:a},g()):g())})(u,p,l,P,G,$,O),null!=d&&((e,t,i,s,n,r)=>{const a=e.compDetails,l=a.componentClass,u=a.componentFromFramework&&!e.popup,h=a.componentFromFramework&&e.popup,d=!a.componentFromFramework&&e.popup;return o.createElement(o.Fragment,null,u&&$f(e,l,t),h&&o.createElement(Uf,{editDetails:e,cellCtrl:n,eParentCell:s,wrappedContent:$f(e,l,i)}),d&&r&&o.createElement(Uf,{editDetails:e,cellCtrl:n,eParentCell:s,jsChildComp:r}))})(d,H,V,A.current,i,b));return o.createElement("div",{ref:z,style:m,tabIndex:r,role:T,"col-id":a},G?o.createElement("div",{className:"ag-cell-wrapper",role:"presentation",ref:U},K()):K())})),jf=(0,o.memo)((e=>{const{context:t,gos:i}=(0,o.useContext)(bf),{rowCtrl:s,containerType:n}=e,r=s.getTabIndex(),a=(0,o.useRef)(s.getDomOrder()),l=s.isFullWidth(),u=s.getRowNode().displayed,[h,d]=(0,o.useState)((()=>u?s.getRowIndex():null)),[c,p]=(0,o.useState)((()=>s.getRowId())),[g,m]=(0,o.useState)((()=>s.getBusinessKey())),[f,C]=(0,o.useState)((()=>s.getRowStyles())),v=(0,o.useRef)(null),w=(0,o.useRef)(null),[y,E]=(0,o.useState)((()=>null)),[S,b]=(0,o.useState)(),[R,D]=(0,o.useState)((()=>u?s.getInitialRowTop(n):void 0)),[T,A]=(0,o.useState)((()=>u?s.getInitialTransform(n):void 0)),P=(0,o.useRef)(null),F=(0,o.useRef)(),M=(0,o.useRef)(!1),[L,x]=(0,o.useState)(0);(0,o.useEffect)((()=>{var e;if(M.current)return;if(!S)return;if(L>10)return;const t=null==(e=P.current)?void 0:e.firstChild;t?(s.setupDetailRowAutoHeight(t),M.current=!0):x((e=>e+1))}),[S,L]);let I=(0,o.useRef)();I.current||(I.current=new Wl((()=>P.current)));const N=(0,o.useCallback)((e=>{if(P.current=e,!P.current)return void s.unsetComp(n);if(!s.isAlive())return;const t={setTop:D,setTransform:A,addOrRemoveCssClass:(e,t)=>I.current.addOrRemoveCssClass(e,t),setDomOrder:e=>a.current=e,setRowIndex:d,setRowId:p,setRowBusinessKey:m,setUserStyles:C,setCellCtrls:(e,t)=>{w.current=v.current,v.current=e;const i=Mf(w.current,e,a.current);i!==w.current&&Ff(t,(()=>E(i)))},showFullWidth:e=>b(e),getFullWidthCellRenderer:()=>F.current,refreshFullWidth:e=>V.current?(b((t=>sf(tf({},t),{params:e()}))),!0):!(!F.current||!F.current.refresh)&&F.current.refresh(e())};s.setComp(t,P.current,n)}),[]);(0,o.useLayoutEffect)((()=>Lf(S,t,P.current,F)),[S]);const _=(0,o.useMemo)((()=>{const e={top:R,transform:T};return Object.assign(e,f),e}),[R,T,f]),O=l&&S&&S.componentFromFramework,G=!l&&null!=y,k=(0,o.useMemo)((()=>!(!(null==S?void 0:S.componentFromFramework)||!Tf(S.componentClass))),[S]),V=(0,o.useRef)(!1);return(0,o.useEffect)((()=>{V.current=k&&!!S&&!!i.get("reactiveCustomComponents")}),[k,S]),o.createElement("div",{ref:N,role:"row",style:_,"row-index":h,"row-id":c,"row-business-key":g,tabIndex:r},G&&(null==y?void 0:y.map((e=>o.createElement(Kf,{cellCtrl:e,editingRow:s.isEditing(),printLayout:s.isPrintLayout(),key:e.getInstanceId()})))),O&&(()=>{const e=S.componentClass;return o.createElement(o.Fragment,null,k&&o.createElement(e,tf({},S.params)),!k&&o.createElement(e,sf(tf({},S.params),{ref:F})))})())})),Yf=(0,o.memo)((e=>{const{context:t}=(0,o.useContext)(bf),{name:i}=e,s=(0,o.useMemo)((()=>$d(i)),[i]),n=(0,o.useRef)(null),r=(0,o.useRef)(null),a=(0,o.useRef)([]),l=(0,o.useRef)([]),[u,h]=(0,o.useState)((()=>[])),d=(0,o.useRef)(!1),c=(0,o.useRef)(),p=(0,o.useMemo)((()=>qd.getRowContainerCssClasses(i)),[i]),g=(0,o.useMemo)((()=>Rf(p.viewport)),[p]),m=(0,o.useMemo)((()=>Rf(p.container)),[p]),f=i===zd.CENTER||i===zd.TOP_CENTER||i===zd.BOTTOM_CENTER||i===zd.STICKY_TOP_CENTER||i===zd.STICKY_BOTTOM_CENTER;Wf(" AG Row Container "+i+" ",f?n:r);const C=(0,o.useCallback)((()=>f?null!=n.current&&null!=r.current:null!=r.current),[]),v=(0,o.useCallback)((()=>f?null==n.current&&null==r.current:null==r.current),[]),w=(0,o.useCallback)((()=>{if(v()&&(t.destroyBean(c.current),c.current=null),C()){const e=e=>{const t=Mf(l.current,a.current,d.current);t!==l.current&&(l.current=t,Ff(e,(()=>h(t))))},s={setViewportHeight:e=>{n.current&&(n.current.style.height=e)},setRowCtrls:({rowCtrls:t,useFlushSync:i})=>{const s=!!i&&a.current.length>0&&t.length>0;a.current=t,e(s)},setDomOrder:t=>{d.current!=t&&(d.current=t,e(!1))},setContainerWidth:e=>{r.current&&(r.current.style.width=e)}};c.current=t.createBean(new qd(i)),c.current.setComp(s,r.current,n.current)}}),[C,v]),y=(0,o.useCallback)((e=>{r.current=e,w()}),[w]),E=(0,o.useCallback)((e=>{n.current=e,w()}),[w]),S=()=>o.createElement("div",{className:m,ref:y,role:"rowgroup"},u.map((e=>o.createElement(jf,{rowCtrl:e,containerType:s,key:e.getInstanceId()}))));return o.createElement(o.Fragment,null,f?o.createElement("div",{className:g,ref:E,role:"presentation"},S()):S())})),qf=(0,o.memo)((()=>{const{context:e,agStackComponentsRegistry:t,resizeObserverService:i}=(0,o.useContext)(bf),[s,n]=(0,o.useState)(""),[r,a]=(0,o.useState)(0),[l,u]=(0,o.useState)(0),[h,d]=(0,o.useState)("0px"),[c,p]=(0,o.useState)("0px"),[g,m]=(0,o.useState)("100%"),[f,C]=(0,o.useState)("0px"),[v,w]=(0,o.useState)("0px"),[y,E]=(0,o.useState)("100%"),[S,b]=(0,o.useState)(""),[R,D]=(0,o.useState)(""),[T,A]=(0,o.useState)(null),[P,F]=(0,o.useState)(""),[M,L]=(0,o.useState)(null),[x,I]=(0,o.useState)("ag-layout-normal");let N=(0,o.useRef)();N.current||(N.current=new Wl((()=>_.current)));const _=(0,o.useRef)(null),O=(0,o.useRef)(null),G=(0,o.useRef)(null),k=(0,o.useRef)(null),V=(0,o.useRef)(null),H=(0,o.useRef)(null),B=(0,o.useRef)(null),W=(0,o.useRef)([]),U=(0,o.useRef)([]);Wf(" AG Grid Body ",_),Wf(" AG Pinned Top ",O),Wf(" AG Sticky Top ",G),Wf(" AG Middle ",H),Wf(" AG Pinned Bottom ",B);const z=(0,o.useCallback)((s=>{if(_.current=s,!_.current)return e.destroyBeans(W.current),U.current.forEach((e=>e())),W.current=[],void(U.current=[]);if(!e)return;const o=i=>{const s=t.getComponentClass(i),o=e.createBean(new s);return W.current.push(o),o},r=(e,t)=>{e.appendChild(t),U.current.push((()=>e.removeChild(t)))};r(_.current,document.createComment(" AG Fake Horizontal Scroll ")),r(_.current,o("AG-FAKE-HORIZONTAL-SCROLL").getGui()),r(_.current,document.createComment(" AG Overlay Wrapper ")),r(_.current,o("AG-OVERLAY-WRAPPER").getGui()),V.current&&(r(V.current,document.createComment(" AG Fake Vertical Scroll ")),r(V.current,o("AG-FAKE-VERTICAL-SCROLL").getGui()));const l={setRowAnimationCssOnBodyViewport:n,setColumnCount:e=>{_.current&&Vl.setAriaColCount(_.current,e)},setRowCount:e=>{_.current&&Vl.setAriaRowCount(_.current,e)},setTopHeight:a,setBottomHeight:u,setStickyTopHeight:d,setStickyTopTop:p,setStickyTopWidth:m,setTopDisplay:b,setBottomDisplay:D,setColumnMovingCss:(e,t)=>N.current.addOrRemoveCssClass(e,t),updateLayoutClasses:I,setAlwaysVerticalScrollClass:A,setPinnedTopBottomOverflowY:F,setCellSelectableCss:(e,t)=>L(t?e:null),setBodyViewportWidth:e=>{H.current&&(H.current.style.width=e)},registerBodyViewportResizeListener:e=>{if(H.current){const t=i.observeResize(H.current,e);U.current.push((()=>t()))}},setStickyBottomHeight:C,setStickyBottomBottom:w,setStickyBottomWidth:E},h=e.createBean(new Ed);W.current.push(h),h.setComp(l,_.current,H.current,O.current,B.current,G.current,k.current)}),[]),$=(0,o.useMemo)((()=>Rf("ag-root","ag-unselectable",x)),[x]),K=(0,o.useMemo)((()=>Rf("ag-body-viewport",s,x,T,M)),[s,x,T,M]),j=(0,o.useMemo)((()=>Rf("ag-body",x)),[x]),Y=(0,o.useMemo)((()=>Rf("ag-floating-top",M)),[M]),q=(0,o.useMemo)((()=>Rf("ag-sticky-top",M)),[M]),X=(0,o.useMemo)((()=>Rf("ag-sticky-bottom",M)),[M]),Q=(0,o.useMemo)((()=>Rf("ag-floating-bottom",M)),[M]),J=(0,o.useMemo)((()=>({height:r,minHeight:r,display:S,overflowY:P})),[r,S,P]),Z=(0,o.useMemo)((()=>({height:h,top:c,width:g})),[h,c,g]),ee=(0,o.useMemo)((()=>({height:f,bottom:v,width:y})),[f,v,y]),te=(0,o.useMemo)((()=>({height:l,minHeight:l,display:R,overflowY:P})),[l,R,P]),ie=e=>o.createElement(Yf,{name:e,key:`${e}-container`}),se=({section:e,children:t,className:i,style:s})=>o.createElement("div",{ref:e,className:i,role:"presentation",style:s},t.map(ie));return o.createElement("div",{ref:z,className:$,role:"treegrid"},o.createElement(Bf,null),se({section:O,className:Y,style:J,children:[zd.TOP_LEFT,zd.TOP_CENTER,zd.TOP_RIGHT,zd.TOP_FULL_WIDTH]}),o.createElement("div",{className:j,ref:V,role:"presentation"},se({section:H,className:K,children:[zd.LEFT,zd.CENTER,zd.RIGHT,zd.FULL_WIDTH]})),se({section:G,className:q,style:Z,children:[zd.STICKY_TOP_LEFT,zd.STICKY_TOP_CENTER,zd.STICKY_TOP_RIGHT,zd.STICKY_TOP_FULL_WIDTH]}),se({section:k,className:X,style:ee,children:[zd.STICKY_BOTTOM_LEFT,zd.STICKY_BOTTOM_CENTER,zd.STICKY_BOTTOM_RIGHT,zd.STICKY_BOTTOM_FULL_WIDTH]}),se({section:B,className:Q,style:te,children:[zd.BOTTOM_LEFT,zd.BOTTOM_CENTER,zd.BOTTOM_RIGHT,zd.BOTTOM_FULL_WIDTH]}))})),Xf=(0,o.forwardRef)(((e,t)=>{const{children:i,eFocusableElement:s,onTabKeyDown:n,gridCtrl:r,forceFocusOutWhenTabGuardsAreEmpty:a}=e,{context:l}=(0,o.useContext)(bf),u=(0,o.useRef)(null),h=(0,o.useRef)(null),d=(0,o.useRef)(),c=e=>{const t=null==e?void 0:parseInt(e,10).toString();[u,h].forEach((e=>{var i,s;void 0===t?null==(i=e.current)||i.removeAttribute("tabindex"):null==(s=e.current)||s.setAttribute("tabindex",t)}))};(0,o.useImperativeHandle)(t,(()=>({forceFocusOutOfContainer(e){var t;null==(t=d.current)||t.forceFocusOutOfContainer(e)}})));const p=(0,o.useCallback)((()=>{if(!u.current&&!h.current)return l.destroyBean(d.current),void(d.current=null);if(u.current&&h.current){const e={setTabIndex:c};d.current=l.createBean(new Vc({comp:e,eTopGuard:u.current,eBottomGuard:h.current,eFocusableElement:s,onTabKeyDown:n,forceFocusOutWhenTabGuardsAreEmpty:a,focusInnerElement:e=>r.focusInnerElement(e)}))}}),[]),g=(0,o.useCallback)((e=>{u.current=e,p()}),[p]),m=(0,o.useCallback)((e=>{h.current=e,p()}),[p]),f=e=>{const t="top"===e?kc.TAB_GUARD_TOP:kc.TAB_GUARD_BOTTOM;return o.createElement("div",{className:`${kc.TAB_GUARD} ${t}`,role:"presentation",ref:"top"===e?g:m})};return o.createElement(o.Fragment,null,f("top"),i,f("bottom"))})),Qf=(0,o.memo)(Xf),Jf=(0,o.memo)((({context:e})=>{const[t,i]=(0,o.useState)(""),[s,n]=(0,o.useState)(""),[r,a]=(0,o.useState)(""),[l,u]=(0,o.useState)(null),[h,d]=(0,o.useState)(null),[c,p]=(0,o.useState)(!1),[g,m]=(0,o.useState)(),f=(0,o.useRef)(null),C=(0,o.useRef)(null),v=(0,o.useRef)(),[w,y]=(0,o.useState)(null),E=(0,o.useRef)((()=>{})),S=(0,o.useCallback)((()=>{}),[]),b=(0,o.useMemo)((()=>e.isDestroyed()?null:e.getBean("beans")),[e]);Wf(" AG Grid ",C);const R=(0,o.useCallback)((t=>{if(C.current=t,!C.current)return e.destroyBean(f.current),void(f.current=null);if(e.isDestroyed())return;f.current=e.createBean(new zp);const s=f.current;E.current=s.focusInnerElement.bind(s);const o={destroyGridUi:()=>{},setRtlClass:i,forceFocusOutOfContainer:e=>{var t;null==(t=v.current)||t.forceFocusOutOfContainer(e)},updateLayoutClasses:a,getFocusableContainers:()=>{var e,t;const i=[],s=null==(e=C.current)?void 0:e.querySelector(".ag-root"),o=null==(t=C.current)?void 0:t.querySelector(".ag-side-bar:not(.ag-hidden)");return s&&i.push(s),o&&i.push(o),i},setCursor:u,setUserSelect:d};s.setComp(o,C.current,C.current),p(!0)}),[]);(0,o.useEffect)((()=>{if(!(g&&b&&f.current&&w&&C.current))return;const t=f.current,i=[],{agStackComponentsRegistry:s}=b,o=s.getComponentClass("AG-GRID-HEADER-DROP-ZONES"),n=s.getComponentClass("AG-SIDE-BAR"),r=s.getComponentClass("AG-STATUS-BAR"),a=s.getComponentClass("AG-WATERMARK"),l=s.getComponentClass("AG-PAGINATION"),u=[],h=C.current;if(t.showDropZones()&&o){const t=e.createBean(new o),s=t.getGui();h.insertAdjacentElement("afterbegin",s),u.push(s),i.push(t)}if(t.showSideBar()&&n){const t=e.createBean(new n),s=t.getGui(),o=w.querySelector(".ag-tab-guard-bottom");o&&(o.insertAdjacentElement("beforebegin",s),u.push(s)),i.push(t)}if(t.showStatusBar()&&r){const t=e.createBean(new r),s=t.getGui();h.insertAdjacentElement("beforeend",s),u.push(s),i.push(t)}if(l){const t=e.createBean(new l),s=t.getGui();h.insertAdjacentElement("beforeend",s),u.push(s),i.push(t)}if(t.showWatermark()&&a){const t=e.createBean(new a),s=t.getGui();h.insertAdjacentElement("beforeend",s),u.push(s),i.push(t)}return()=>{e.destroyBeans(i),u.forEach((e=>{e.parentElement&&e.parentElement.removeChild(e)}))}}),[g,w,b]);const D=(0,o.useMemo)((()=>Rf("ag-root-wrapper",t,s,r)),[t,s,r]),T=(0,o.useMemo)((()=>Rf("ag-root-wrapper-body","ag-focus-managed",r)),[r]),A=(0,o.useMemo)((()=>({userSelect:null!=h?h:"",WebkitUserSelect:null!=h?h:"",cursor:null!=l?l:""})),[h,l]),P=(0,o.useCallback)((e=>{v.current=e,m(null!==e)}),[]);return o.createElement("div",{ref:R,className:D,style:A,role:"presentation"},o.createElement("div",{className:T,ref:y,role:"presentation"},c&&w&&b&&o.createElement(bf.Provider,{value:b},o.createElement(Qf,{ref:P,eFocusableElement:w,onTabKeyDown:S,gridCtrl:f.current,forceFocusOutWhenTabGuardsAreEmpty:!0},o.createElement(qf,null)))))})),Zf=e=>{var t,i;const s=(0,o.useRef)(),n=(0,o.useRef)(null),r=(0,o.useRef)(null),a=(0,o.useRef)([]),l=(0,o.useRef)([]),u=(0,o.useRef)(e),h=(0,o.useRef)(!1),[d,c]=(0,o.useState)(void 0),[,p]=(0,o.useState)(0),g=(0,o.useCallback)((t=>{if(n.current=t,!n.current)return a.current.forEach((e=>e())),void(a.current.length=0);const i=e.modules||[];r.current||(r.current=new Sf((()=>p((e=>e+1))),e.componentWrappingElement,e.maxComponentCreationTimeMs),a.current.push((()=>{var e;null==(e=r.current)||e.destroy(),r.current=null})));const o=nr.combineAttributesAndGridOptions(e.gridOptions,e),u={providedBeanInstances:{frameworkComponentWrapper:new eC(r.current,!!o.reactiveCustomComponents)},modules:i,frameworkOverrides:new iC},d=new qg;s.current=d.create(n.current,o,(t=>{c(t),a.current.push((()=>{t.destroy()})),t.getBean(yg.NAME).whenReady((()=>{if(t.isDestroyed())return;const i=s.current;i&&e.setGridApi&&e.setGridApi(i,new Vp(i))}))}),(e=>{e.getBean(yg.NAME).whenReady((()=>{l.current.forEach((e=>e())),l.current.length=0,h.current=!0}))}),u)}),[]),m=(0,o.useMemo)((()=>tf({height:"100%"},e.containerStyle||{})),[e.containerStyle]),f=(0,o.useCallback)((e=>{h.current?e():l.current.push(e)}),[]);return(0,o.useEffect)((()=>{const t=function(e,t){const i={};return Object.keys(t).forEach((s=>{const o=t[s];e[s]!==o&&(i[s]=o)})),i}(u.current,e);u.current=e,f((()=>{s.current&&nr.processOnChange(t,s.current)}))}),[e]),o.createElement("div",{style:m,className:e.className,ref:g},d&&!d.isDestroyed()?o.createElement(Jf,{context:d}):null,null!=(i=null==(t=r.current)?void 0:t.getPortals())?i:null)},eC=class extends Xg{constructor(e,t){super(),this.parent=e,this.reactiveCustomComponents=t}createWrapper(e,t){if(this.reactiveCustomComponents){const i=(e=>{switch(e){case"filter":return cf;case"floatingFilterComponent":return mf;case"dateComponent":return df;case"loadingOverlayComponent":return ff;case"noRowsOverlayComponent":return vf;case"statusPanel":return wf;case"toolPanel":return yf;case"menuItem":return Cf}})(t.propertyName);if(i)return new i(e,this.parent,t)}else switch(t.propertyName){case"filter":case"floatingFilterComponent":case"dateComponent":case"loadingOverlayComponent":case"noRowsOverlayComponent":case"statusPanel":case"toolPanel":case"menuItem":Gf()}const i=!t.cellRenderer&&"toolPanel"!==t.propertyName;return new lf(e,this.parent,t,i)}},tC=(0,o.forwardRef)(((e,t)=>{const{ctrlsFactory:i,context:s,gos:n,resizeObserverService:r,clientSideRowModel:a,serverSideRowModel:l}=(0,o.useContext)(bf),[u,h]=(0,o.useState)((()=>new Df)),[d,c]=(0,o.useState)((()=>new Df)),[p,g]=(0,o.useState)(),[m,f]=(0,o.useState)(),C=(0,o.useRef)(),v=(0,o.useRef)(null),w=(0,o.useRef)(),y=(0,o.useMemo)((()=>Po.__getGridRegisteredModules(e.api.getGridId())),[e]),E=(0,o.useMemo)((()=>u.toString()+" ag-details-row"),[u]),S=(0,o.useMemo)((()=>d.toString()+" ag-details-grid"),[d]);t&&(0,o.useImperativeHandle)(t,(()=>({refresh(){var e,t;return null!=(t=null==(e=C.current)?void 0:e.refresh())&&t}}))),e.template&&Vl.warnOnce("detailCellRendererParams.template is not supported by AG Grid React. To change the template, provide a Custom Detail Cell Renderer. See https://ag-grid.com/react-data-grid/master-detail-custom-detail/");const b=(0,o.useCallback)((t=>{if(v.current=t,!v.current)return s.destroyBean(C.current),void(w.current&&w.current());const o={addOrRemoveCssClass:(e,t)=>h((i=>i.setClass(e,t))),addOrRemoveDetailGridCssClass:(e,t)=>c((i=>i.setClass(e,t))),setDetailGrid:e=>g(e),setRowData:e=>f(e),getGui:()=>v.current},u=i.getInstance("detailCellRenderer");if(u&&(s.createBean(u),u.init(o,e),C.current=u,n.get("detailRowAutoHeight"))){const t=()=>{if(null==v.current)return;const t=v.current.clientHeight;null!=t&&t>0&&setTimeout((()=>{e.node.setRowHeight(t),a?a.onRowHeightChanged():l&&l.onRowHeightChanged()}),0)};w.current=r.observeResize(v.current,t),t()}}),[]),R=(0,o.useCallback)(((e,t)=>{var i;null==(i=C.current)||i.registerDetailWithMaster(e,t)}),[]);return o.createElement("div",{className:E,ref:b},p&&o.createElement(Zf,sf(tf({className:S},p),{modules:y,rowData:m,setGridApi:R})))})),iC=class extends _p{constructor(){super("react"),this.frameworkComponents={agGroupCellRenderer:Nf,agGroupRowRenderer:Nf,agDetailCellRenderer:tC},this.wrapIncoming=(e,t)=>{return"ensureVisible"===t?(i=e,Pf||setTimeout((()=>Pf=!1),0),Pf=!0,i()):e();var i},this.renderingEngine="react"}frameworkComponent(e){return this.frameworkComponents[e]}isFrameworkComponent(e){if(!e)return!1;const t=e.prototype;return!(t&&"getGui"in t)}},sC=class extends o.Component{constructor(){super(...arguments),this.apiListeners=[],this.setGridApi=(e,t)=>{this.api=e,this.columnApi=t,this.apiListeners.forEach((t=>t(e)))}}registerApiListener(e){this.apiListeners.push(e)}componentWillUnmount(){this.apiListeners.length=0}render(){return o.createElement(Zf,sf(tf({},this.props),{setGridApi:this.setGridApi}))}};const oC=({dataset:e})=>{const[t,i]=(0,l.useState)(1),[s,n]=(0,l.useState)(e.length),r=e,a=(e=>{const t=Object.keys(e[0]);let i={};return t.forEach((t=>{const s=e.every((e=>!isNaN(Number(e[t])))),o=e.every((e=>(e=>/^(#([0-9a-fA-F]{3}){1,2}|[a-zA-Z]+|rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)|rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*(0(\.\d+)?|1(\.0+)?)\)|hsl\((\d{1,3}),\s*(\d{1,3})%,\s*(\d{1,3})%\)|hsla\((\d{1,3}),\s*(\d{1,3})%,\s*(\d{1,3})%,\s*(0(\.\d+)?|1(\.0+)?)\))$/i.test(e))(e[t]))),n=e.every((e=>(e=>/<([a-z][\s\S]*)>/i.test(e))(e[t]))),r=e.every((e=>(e=>{const t=new Date(e);return!isNaN(t.getTime())})(e[t])));i[t]=s?"number":o?"color":n?"html":r?"date":"text"})),i})(r);console.log(a);const u=e=>{let t="";for(;e>=0;)t="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[e%26]+t,e=Math.floor(e/26)-1;return t};function h(e){const t=e.colDef.field,i=a[t];if(e.node.rowPinned)return e.newValue;switch(i){case"number":return Number(e.newValue);case"date":const t=new Date(e.newValue);return isNaN(t.getTime())?e.newValue:t;default:return e.newValue}}const[d,c]=(0,l.useState)([]),[p,g]=(0,l.useState)([]);(0,l.useEffect)((()=>{if(!(d.length>0)&&r.length>0){const e=Object.keys(r[0]),t=e.map(((e,t)=>({headerName:u(t),field:e,valueParser:h}))),i=e.reduce(((e,t)=>(e[t]=t,e)),{});g([i]),c([{headerName:"",valueGetter:e=>e.node.rowPinned?e.node.rowIndex+1:e.node.rowIndex+2,suppressMovable:!0,editable:!1,filter:!1,sortable:!1,width:45,resizable:!1,flex:0,cellStyle:{backgroundColor:"#e0e0e0"}},...t])}}),[r,d]);const[m]=(0,l.useState)(r),f=(0,l.useRef)(null),[C,v]=(0,l.useState)(null);return(0,o.createElement)("div",null,(0,o.createElement)("div",{id:"lcp-data-grid",className:"ag-theme-alpine",style:{width:"100%",height:"300px"}},(0,o.createElement)(sC,{ref:f,columnDefs:d,rowData:m,defaultColDef:{flex:1,minWidth:45,editable:!0,sortable:!0,filter:!0,suppressMovable:!0,cellDataType:!1,cellStyle:e=>{if(e.node.rowPinned)return{backgroundColor:"rgb(197, 219, 229)"}}},gridOptions:{rowDragManaged:!0,animateRows:!0,rowHeight:35,getRowStyle:e=>e.node.rowPinned?{backgroundColor:"rgb(197, 219, 229)"}:null},pinnedTopRowData:p,pinnedLeftColCount:1,onSortChanged:e=>{e.api.refreshCells()},onFilterChanged:e=>{e.api.refreshCells()},onGridReady:e=>{v(e.api)}})),(0,o.createElement)("div",null,(0,o.createElement)("div",null,(0,o.createElement)("input",{type:"number",value:t,onChange:e=>i(Math.max(1,parseInt(e.target.value,10))),min:"1"}),(0,o.createElement)("button",{onClick:()=>{if(C){const e=[];for(let i=0;i<t;i++)e.push({});C.applyTransaction({add:e}),n((e=>e+t))}else console.log("Grid is not ready yet")}},"Add Row(s)")),(0,o.createElement)("div",null,(0,o.createElement)("span",null,s," Rows"))))},nC=({attributes:e})=>{const[t,i]=(0,l.useState)(!1),[s,r]=(0,l.useState)(0);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(a.Button,{variant:"secondary",onClick:()=>i(!0),style:{marginBottom:"10px",width:"100%"}},(0,n.__)("Edit Dataset","lcp-visualize")),t&&(0,o.createElement)(a.Modal,{onRequestClose:()=>i(!1),title:(0,n.__)("Dataset Builder","lcp-visualize"),style:{width:"90vw",height:"90vh"}},(0,o.createElement)("div",{style:{height:"calc(90vh - 40px)",padding:"20px"}},(0,o.createElement)("div",{style:{display:"flex",marginBottom:"20px"}},e.datasets.map(((e,t)=>(0,o.createElement)("button",{key:t,onClick:()=>r(t),style:{padding:"10px 20px",margin:"0 5px",backgroundColor:s===t?"#007cba":"#f1f1f1",color:s===t?"white":"black",border:"1px solid #ccc",borderRadius:"5px",cursor:"pointer",transition:"background-color 0.3s ease"}},e.name)))),(0,o.createElement)("div",{style:{display:"flex",flexDirection:"column"}},e.datasets.map(((e,t)=>(0,o.createElement)("div",{key:t,style:{display:s===t?"block":"none",transition:"display 0.3s ease"}},(0,o.createElement)(oC,{dataset:e.data}))))))))},rC=({label:e,value:t,onChange:i,unitTypes:s})=>{const{number:n,unit:r}=(e=>{const t=e?.match(/^(\d+)(.*)$/);return t?{number:parseInt(t[1],10),unit:t[2]||"px"}:{number:300,unit:"px"}})(t),l=[{label:"Pixels (px)",value:"px"},{label:"Percentage (%)",value:"%"},{label:"Viewport Width (vw)",value:"vw"},{label:"Viewport Height (vh)",value:"vh"}],u=s&&s.length>0?l.filter((e=>s.includes(e.value))):l;return(0,o.createElement)("div",{className:"lcp-dimension-control"},(0,o.createElement)("label",{className:"components-base-control__label"},e),(0,o.createElement)("div",{style:{display:"flex",gap:"8px",alignItems:"flex-start"}},(0,o.createElement)(a.TextControl,{type:"number",value:n,onChange:e=>{i(`${e}${r}`)},min:0,style:{width:"80px"}}),(0,o.createElement)(a.SelectControl,{value:r,options:u,onChange:e=>{i(`${n}${e}`)},style:{minWidth:"100px"}})))},aC=()=>{const[e,t]=(0,l.useState)(!1),[i,s]=(0,l.useState)(""),r=()=>t(!1);return(0,o.createElement)("div",null,(0,o.createElement)(a.Button,{isPrimary:!0,onClick:()=>t(!0)},(0,n.__)("Open Modal","lcp")),e&&(0,o.createElement)(a.Modal,{title:(0,n.__)("Text Area Modal","lcp"),onRequestClose:r,className:"my-modal"},(0,o.createElement)("div",null,(0,o.createElement)(a.TextControl,{label:(0,n.__)("Enter your text:","lcp"),value:i,onChange:e=>{s(e)},placeholder:(0,n.__)("Type here...","lcp"),style:{width:"100%",minHeight:"100px"}})),(0,o.createElement)("div",{style:{marginTop:"16px",textAlign:"right"}},(0,o.createElement)(a.Button,{onClick:r},(0,n.__)("Close","lcp")))))},lC=({attributes:e,setAttributes:t})=>{const{renderLegend:i,legendLocation:s,legendAlignment:r,allowDownloadImage:l,downloadImageMaxWidth:u,allowDownloadCsv:h,allowDownloadJson:d,allowSorting:c,allowFiltering:p,footerContent:g,chartTitle:m,chartSubtitle:f,toolbarLocation:C="top",toolbarAlignment:v,showXAxisLabel:w,xAxisLabel:y,showYAxisLabel:E,yAxisLabel:S,renderXGrid:b,renderYGrid:R,xGridColor:D,yGridColor:T,legendFontSize:A,includeDataChart:P,allowChartDataDownload:F}=e,[M,L]=(0,o.useState)(s),[x,I]=(0,o.useState)(r);(0,o.useEffect)((()=>{t({legendLocation:M,legendAlignment:x})}),[M,x,t]);const[N,_]=(0,o.useState)(C),[O,G]=(0,o.useState)(v);return(0,o.useEffect)((()=>{t({toolbarLocation:N,toolbarAlignment:O})}),[N,O,t]),(0,o.createElement)("div",null,(0,o.createElement)(a.PanelBody,{title:(0,n.__)("Grid","lcp"),initialOpen:!1},(0,o.createElement)(a.ToggleControl,{label:(0,n.__)("Include Data Chart","lcp"),checked:P,onChange:e=>t({includeDataChart:e})}),(0,o.createElement)(a.ToggleControl,{label:(0,n.__)("Allow Chart Data Download","lcp"),checked:F,onChange:e=>t({allowChartDataDownload:e})})),(0,o.createElement)(a.PanelBody,{title:(0,n.__)("Grid","lcp"),initialOpen:!1},(0,o.createElement)(a.ToggleControl,{label:(0,n.__)("Show X Grid","lcp"),checked:b,onChange:e=>t({renderXGrid:e})}),(0,o.createElement)(a.ToggleControl,{label:(0,n.__)("Show Y Grid","lcp"),checked:R,onChange:e=>t({renderYGrid:e})})),(0,o.createElement)(a.PanelBody,{title:(0,n.__)("Legend","lcp"),initialOpen:!1},(0,o.createElement)(a.ToggleControl,{label:(0,n.__)("Render Legend","lcp"),checked:i,onChange:e=>t({renderLegend:e})}),i&&(0,o.createElement)("div",null,(0,o.createElement)("div",null,(0,o.createElement)(a.Button,{isPrimary:"left"===x,onClick:()=>I("left")},(0,n.__)("Left","lcp")),(0,o.createElement)(a.Button,{isPrimary:"center"===x,onClick:()=>I("center")},(0,n.__)("Center","lcp")),(0,o.createElement)(a.Button,{isPrimary:"right"===x,onClick:()=>I("right")},(0,n.__)("Right","lcp"))),(0,o.createElement)("div",null,(0,o.createElement)(a.Button,{isPrimary:"top"===M,onClick:()=>L("top")},(0,n.__)("Top","lcp")),(0,o.createElement)(a.Button,{isPrimary:"bottom"===M,onClick:()=>L("bottom")},(0,n.__)("Bottom","lcp")),(0,o.createElement)(rC,{unitTypes:["px"],label:(0,n.__)("Legend Font Size","lcp"),value:A,onChange:e=>t({legendFontSize:e})})))),(0,o.createElement)(a.PanelBody,{title:(0,n.__)("Labels","lcp"),initialOpen:!1},(0,o.createElement)(a.ToggleControl,{label:(0,n.__)("Show X-Axis","lcp"),checked:w,onChange:e=>t({showXAxisLabel:e})}),(0,o.createElement)(a.TextControl,{label:(0,n.__)("X Axis Label","lcp"),value:y,onChange:e=>t({xAxisLabel:e}),placeholder:(0,n.__)("Enter X-axis label...","lcp")}),(0,o.createElement)(a.ToggleControl,{label:(0,n.__)("Show Y-Axis Label","lcp"),checked:E,onChange:e=>t({showYAxisLabel:e})}),(0,o.createElement)(a.TextControl,{label:(0,n.__)("Y Axis Label","lcp"),value:S,onChange:e=>t({xAxisLabel:e}),placeholder:(0,n.__)("Enter X-axis label","lcp")})),(0,o.createElement)(a.PanelBody,{title:(0,n.__)("Controls","lcp"),initialOpen:!1},(0,o.createElement)("div",null,(0,o.createElement)(a.Button,{isPrimary:"top"===N,onClick:()=>_("top")},(0,n.__)("Top","lcp")),(0,o.createElement)(a.Button,{isPrimary:"bottom"===N,onClick:()=>_("bottom")},(0,n.__)("Bottom","lcp")),(0,o.createElement)(rC,{unitTypes:["px"],label:(0,n.__)("Legend Font Size","lcp"),value:A,onChange:e=>t({legendFontSize:e})})),(0,o.createElement)("div",null,(0,o.createElement)(a.Button,{isPrimary:"left"===O,onClick:()=>G("left")},(0,n.__)("Left","lcp")),(0,o.createElement)(a.Button,{isPrimary:"center"===O,onClick:()=>G("center")},(0,n.__)("Center","lcp")),(0,o.createElement)(a.Button,{isPrimary:"right"===O,onClick:()=>G("right")},(0,n.__)("Right","lcp"))),(0,o.createElement)(a.ToggleControl,{label:(0,n.__)("Allow Filtering","lcp"),checked:p,onChange:e=>t({allowFiltering:e})}),(0,o.createElement)(a.ToggleControl,{label:(0,n.__)("Allow Sorting","lcp"),checked:c,onChange:e=>t({allowSorting:e})}),(0,o.createElement)(a.ToggleControl,{label:(0,n.__)("Allow Download Image","lcp"),checked:l,onChange:e=>t({allowDownloadImage:e})}),l&&(0,o.createElement)(rC,{unitTypes:["px"],label:(0,n.__)("Download Image Max Width","lcp"),value:u,onChange:e=>t({downloadImageMaxWidth:e})}),(0,o.createElement)(a.ToggleControl,{label:(0,n.__)("Allow Download CSV","lcp"),checked:h,onChange:e=>t({allowDownloadCsv:e})}),(0,o.createElement)(a.ToggleControl,{label:(0,n.__)("Allow Download JSON","lcp"),checked:d,onChange:e=>t({allowDownloadJson:e})})),(0,o.createElement)(a.PanelBody,{title:(0,n.__)("Tooltips and Popups","lcp"),initialOpen:!1},(0,o.createElement)(aC,null)),(0,o.createElement)(a.PanelBody,{title:(0,n.__)("Header","lcp"),initialOpen:!1}),(0,o.createElement)(a.PanelBody,{title:(0,n.__)("Footer","lcp"),initialOpen:!1},(0,o.createElement)(aC,null)))};function uC(){}function hC(e){return null==e?uC:function(){return this.querySelector(e)}}function dC(){return[]}function cC(e){return null==e?dC:function(){return this.querySelectorAll(e)}}function pC(e){return function(){return this.matches(e)}}function gC(e){return function(t){return t.matches(e)}}var mC=Array.prototype.find;function fC(){return this.firstElementChild}var CC=Array.prototype.filter;function vC(){return Array.from(this.children)}function wC(e){return new Array(e.length)}function yC(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function EC(e,t,i,s,o,n){for(var r,a=0,l=t.length,u=n.length;a<u;++a)(r=t[a])?(r.__data__=n[a],s[a]=r):i[a]=new yC(e,n[a]);for(;a<l;++a)(r=t[a])&&(o[a]=r)}function SC(e,t,i,s,o,n,r){var a,l,u,h=new Map,d=t.length,c=n.length,p=new Array(d);for(a=0;a<d;++a)(l=t[a])&&(p[a]=u=r.call(l,l.__data__,a,t)+"",h.has(u)?o[a]=l:h.set(u,l));for(a=0;a<c;++a)u=r.call(e,n[a],a,n)+"",(l=h.get(u))?(s[a]=l,l.__data__=n[a],h.delete(u)):i[a]=new yC(e,n[a]);for(a=0;a<d;++a)(l=t[a])&&h.get(p[a])===l&&(o[a]=l)}function bC(e){return e.__data__}function RC(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function DC(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}yC.prototype={constructor:yC,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};var TC="http://www.w3.org/1999/xhtml";const AC={svg:"http://www.w3.org/2000/svg",xhtml:TC,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function PC(e){var t=e+="",i=t.indexOf(":");return i>=0&&"xmlns"!==(t=e.slice(0,i))&&(e=e.slice(i+1)),AC.hasOwnProperty(t)?{space:AC[t],local:e}:e}function FC(e){return function(){this.removeAttribute(e)}}function MC(e){return function(){this.removeAttributeNS(e.space,e.local)}}function LC(e,t){return function(){this.setAttribute(e,t)}}function xC(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function IC(e,t){return function(){var i=t.apply(this,arguments);null==i?this.removeAttribute(e):this.setAttribute(e,i)}}function NC(e,t){return function(){var i=t.apply(this,arguments);null==i?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,i)}}function _C(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function OC(e){return function(){this.style.removeProperty(e)}}function GC(e,t,i){return function(){this.style.setProperty(e,t,i)}}function kC(e,t,i){return function(){var s=t.apply(this,arguments);null==s?this.style.removeProperty(e):this.style.setProperty(e,s,i)}}function VC(e,t){return e.style.getPropertyValue(t)||_C(e).getComputedStyle(e,null).getPropertyValue(t)}function HC(e){return function(){delete this[e]}}function BC(e,t){return function(){this[e]=t}}function WC(e,t){return function(){var i=t.apply(this,arguments);null==i?delete this[e]:this[e]=i}}function UC(e){return e.trim().split(/^|\s+/)}function zC(e){return e.classList||new $C(e)}function $C(e){this._node=e,this._names=UC(e.getAttribute("class")||"")}function KC(e,t){for(var i=zC(e),s=-1,o=t.length;++s<o;)i.add(t[s])}function jC(e,t){for(var i=zC(e),s=-1,o=t.length;++s<o;)i.remove(t[s])}function YC(e){return function(){KC(this,e)}}function qC(e){return function(){jC(this,e)}}function XC(e,t){return function(){(t.apply(this,arguments)?KC:jC)(this,e)}}function QC(){this.textContent=""}function JC(e){return function(){this.textContent=e}}function ZC(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function ev(){this.innerHTML=""}function tv(e){return function(){this.innerHTML=e}}function iv(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function sv(){this.nextSibling&&this.parentNode.appendChild(this)}function ov(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function nv(e){return function(){var t=this.ownerDocument,i=this.namespaceURI;return i===TC&&t.documentElement.namespaceURI===TC?t.createElement(e):t.createElementNS(i,e)}}function rv(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function av(e){var t=PC(e);return(t.local?rv:nv)(t)}function lv(){return null}function uv(){var e=this.parentNode;e&&e.removeChild(this)}function hv(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function dv(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function cv(e){return function(){var t=this.__on;if(t){for(var i,s=0,o=-1,n=t.length;s<n;++s)i=t[s],e.type&&i.type!==e.type||i.name!==e.name?t[++o]=i:this.removeEventListener(i.type,i.listener,i.options);++o?t.length=o:delete this.__on}}}function pv(e,t,i){return function(){var s,o=this.__on,n=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(o)for(var r=0,a=o.length;r<a;++r)if((s=o[r]).type===e.type&&s.name===e.name)return this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=n,s.options=i),void(s.value=t);this.addEventListener(e.type,n,i),s={type:e.type,name:e.name,value:t,listener:n,options:i},o?o.push(s):this.__on=[s]}}function gv(e,t,i){var s=_C(e),o=s.CustomEvent;"function"==typeof o?o=new o(t,i):(o=s.document.createEvent("Event"),i?(o.initEvent(t,i.bubbles,i.cancelable),o.detail=i.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function mv(e,t){return function(){return gv(this,e,t)}}function fv(e,t){return function(){return gv(this,e,t.apply(this,arguments))}}$C.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var Cv=[null];function vv(e,t){this._groups=e,this._parents=t}function wv(){return new vv([[document.documentElement]],Cv)}vv.prototype=wv.prototype={constructor:vv,select:function(e){"function"!=typeof e&&(e=hC(e));for(var t=this._groups,i=t.length,s=new Array(i),o=0;o<i;++o)for(var n,r,a=t[o],l=a.length,u=s[o]=new Array(l),h=0;h<l;++h)(n=a[h])&&(r=e.call(n,n.__data__,h,a))&&("__data__"in n&&(r.__data__=n.__data__),u[h]=r);return new vv(s,this._parents)},selectAll:function(e){e="function"==typeof e?function(e){return function(){return null==(t=e.apply(this,arguments))?[]:Array.isArray(t)?t:Array.from(t);var t}}(e):cC(e);for(var t=this._groups,i=t.length,s=[],o=[],n=0;n<i;++n)for(var r,a=t[n],l=a.length,u=0;u<l;++u)(r=a[u])&&(s.push(e.call(r,r.__data__,u,a)),o.push(r));return new vv(s,o)},selectChild:function(e){return this.select(null==e?fC:function(e){return function(){return mC.call(this.children,e)}}("function"==typeof e?e:gC(e)))},selectChildren:function(e){return this.selectAll(null==e?vC:function(e){return function(){return CC.call(this.children,e)}}("function"==typeof e?e:gC(e)))},filter:function(e){"function"!=typeof e&&(e=pC(e));for(var t=this._groups,i=t.length,s=new Array(i),o=0;o<i;++o)for(var n,r=t[o],a=r.length,l=s[o]=[],u=0;u<a;++u)(n=r[u])&&e.call(n,n.__data__,u,r)&&l.push(n);return new vv(s,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,bC);var i,s=t?SC:EC,o=this._parents,n=this._groups;"function"!=typeof e&&(i=e,e=function(){return i});for(var r=n.length,a=new Array(r),l=new Array(r),u=new Array(r),h=0;h<r;++h){var d=o[h],c=n[h],p=c.length,g=RC(e.call(d,d&&d.__data__,h,o)),m=g.length,f=l[h]=new Array(m),C=a[h]=new Array(m);s(d,c,f,C,u[h]=new Array(p),g,t);for(var v,w,y=0,E=0;y<m;++y)if(v=f[y]){for(y>=E&&(E=y+1);!(w=C[E])&&++E<m;);v._next=w||null}}return(a=new vv(a,o))._enter=l,a._exit=u,a},enter:function(){return new vv(this._enter||this._groups.map(wC),this._parents)},exit:function(){return new vv(this._exit||this._groups.map(wC),this._parents)},join:function(e,t,i){var s=this.enter(),o=this,n=this.exit();return"function"==typeof e?(s=e(s))&&(s=s.selection()):s=s.append(e+""),null!=t&&(o=t(o))&&(o=o.selection()),null==i?n.remove():i(n),s&&o?s.merge(o).order():o},merge:function(e){for(var t=e.selection?e.selection():e,i=this._groups,s=t._groups,o=i.length,n=s.length,r=Math.min(o,n),a=new Array(o),l=0;l<r;++l)for(var u,h=i[l],d=s[l],c=h.length,p=a[l]=new Array(c),g=0;g<c;++g)(u=h[g]||d[g])&&(p[g]=u);for(;l<o;++l)a[l]=i[l];return new vv(a,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,i=e.length;++t<i;)for(var s,o=e[t],n=o.length-1,r=o[n];--n>=0;)(s=o[n])&&(r&&4^s.compareDocumentPosition(r)&&r.parentNode.insertBefore(s,r),r=s);return this},sort:function(e){function t(t,i){return t&&i?e(t.__data__,i.__data__):!t-!i}e||(e=DC);for(var i=this._groups,s=i.length,o=new Array(s),n=0;n<s;++n){for(var r,a=i[n],l=a.length,u=o[n]=new Array(l),h=0;h<l;++h)(r=a[h])&&(u[h]=r);u.sort(t)}return new vv(o,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,i=e.length;t<i;++t)for(var s=e[t],o=0,n=s.length;o<n;++o){var r=s[o];if(r)return r}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,i=0,s=t.length;i<s;++i)for(var o,n=t[i],r=0,a=n.length;r<a;++r)(o=n[r])&&e.call(o,o.__data__,r,n);return this},attr:function(e,t){var i=PC(e);if(arguments.length<2){var s=this.node();return i.local?s.getAttributeNS(i.space,i.local):s.getAttribute(i)}return this.each((null==t?i.local?MC:FC:"function"==typeof t?i.local?NC:IC:i.local?xC:LC)(i,t))},style:function(e,t,i){return arguments.length>1?this.each((null==t?OC:"function"==typeof t?kC:GC)(e,t,null==i?"":i)):VC(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?HC:"function"==typeof t?WC:BC)(e,t)):this.node()[e]},classed:function(e,t){var i=UC(e+"");if(arguments.length<2){for(var s=zC(this.node()),o=-1,n=i.length;++o<n;)if(!s.contains(i[o]))return!1;return!0}return this.each(("function"==typeof t?XC:t?YC:qC)(i,t))},text:function(e){return arguments.length?this.each(null==e?QC:("function"==typeof e?ZC:JC)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?ev:("function"==typeof e?iv:tv)(e)):this.node().innerHTML},raise:function(){return this.each(sv)},lower:function(){return this.each(ov)},append:function(e){var t="function"==typeof e?e:av(e);return this.select((function(){return this.appendChild(t.apply(this,arguments))}))},insert:function(e,t){var i="function"==typeof e?e:av(e),s=null==t?lv:"function"==typeof t?t:hC(t);return this.select((function(){return this.insertBefore(i.apply(this,arguments),s.apply(this,arguments)||null)}))},remove:function(){return this.each(uv)},clone:function(e){return this.select(e?dv:hv)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,i){var s,o,n=function(e){return e.trim().split(/^|\s+/).map((function(e){var t="",i=e.indexOf(".");return i>=0&&(t=e.slice(i+1),e=e.slice(0,i)),{type:e,name:t}}))}(e+""),r=n.length;if(!(arguments.length<2)){for(a=t?pv:cv,s=0;s<r;++s)this.each(a(n[s],t,i));return this}var a=this.node().__on;if(a)for(var l,u=0,h=a.length;u<h;++u)for(s=0,l=a[u];s<r;++s)if((o=n[s]).type===l.type&&o.name===l.name)return l.value},dispatch:function(e,t){return this.each(("function"==typeof t?fv:mv)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,i=e.length;t<i;++t)for(var s,o=e[t],n=0,r=o.length;n<r;++n)(s=o[n])&&(yield s)}};const yv=wv;var Ev={value:()=>{}};function Sv(){for(var e,t=0,i=arguments.length,s={};t<i;++t){if(!(e=arguments[t]+"")||e in s||/[\s.]/.test(e))throw new Error("illegal type: "+e);s[e]=[]}return new bv(s)}function bv(e){this._=e}function Rv(e,t){for(var i,s=0,o=e.length;s<o;++s)if((i=e[s]).name===t)return i.value}function Dv(e,t,i){for(var s=0,o=e.length;s<o;++s)if(e[s].name===t){e[s]=Ev,e=e.slice(0,s).concat(e.slice(s+1));break}return null!=i&&e.push({name:t,value:i}),e}bv.prototype=Sv.prototype={constructor:bv,on:function(e,t){var i,s,o=this._,n=(s=o,(e+"").trim().split(/^|\s+/).map((function(e){var t="",i=e.indexOf(".");if(i>=0&&(t=e.slice(i+1),e=e.slice(0,i)),e&&!s.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}}))),r=-1,a=n.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++r<a;)if(i=(e=n[r]).type)o[i]=Dv(o[i],e.name,t);else if(null==t)for(i in o)o[i]=Dv(o[i],e.name,null);return this}for(;++r<a;)if((i=(e=n[r]).type)&&(i=Rv(o[i],e.name)))return i},copy:function(){var e={},t=this._;for(var i in t)e[i]=t[i].slice();return new bv(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var i,s,o=new Array(i),n=0;n<i;++n)o[n]=arguments[n+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(n=0,i=(s=this._[e]).length;n<i;++n)s[n].value.apply(t,o)},apply:function(e,t,i){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],o=0,n=s.length;o<n;++o)s[o].value.apply(t,i)}};const Tv=Sv;var Av,Pv,Fv=0,Mv=0,Lv=0,xv=0,Iv=0,Nv=0,_v="object"==typeof performance&&performance.now?performance:Date,Ov="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Gv(){return Iv||(Ov(kv),Iv=_v.now()+Nv)}function kv(){Iv=0}function Vv(){this._call=this._time=this._next=null}function Hv(e,t,i){var s=new Vv;return s.restart(e,t,i),s}function Bv(){Iv=(xv=_v.now())+Nv,Fv=Mv=0;try{!function(){Gv(),++Fv;for(var e,t=Av;t;)(e=Iv-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Fv}()}finally{Fv=0,function(){for(var e,t,i=Av,s=1/0;i;)i._call?(s>i._time&&(s=i._time),e=i,i=i._next):(t=i._next,i._next=null,i=e?e._next=t:Av=t);Pv=e,Uv(s)}(),Iv=0}}function Wv(){var e=_v.now(),t=e-xv;t>1e3&&(Nv-=t,xv=e)}function Uv(e){Fv||(Mv&&(Mv=clearTimeout(Mv)),e-Iv>24?(e<1/0&&(Mv=setTimeout(Bv,e-_v.now()-Nv)),Lv&&(Lv=clearInterval(Lv))):(Lv||(xv=_v.now(),Lv=setInterval(Wv,1e3)),Fv=1,Ov(Bv)))}function zv(e,t,i){var s=new Vv;return t=null==t?0:+t,s.restart((i=>{s.stop(),e(i+t)}),t,i),s}Vv.prototype=Hv.prototype={constructor:Vv,restart:function(e,t,i){if("function"!=typeof e)throw new TypeError("callback is not a function");i=(null==i?Gv():+i)+(null==t?0:+t),this._next||Pv===this||(Pv?Pv._next=this:Av=this,Pv=this),this._call=e,this._time=i,Uv()},stop:function(){this._call&&(this._call=null,this._time=1/0,Uv())}};var $v=Tv("start","end","cancel","interrupt"),Kv=[];function jv(e,t,i,s,o,n){var r=e.__transition;if(r){if(i in r)return}else e.__transition={};!function(e,t,i){var s,o=e.__transition;function n(l){var u,h,d,c;if(1!==i.state)return a();for(u in o)if((c=o[u]).name===i.name){if(3===c.state)return zv(n);4===c.state?(c.state=6,c.timer.stop(),c.on.call("interrupt",e,e.__data__,c.index,c.group),delete o[u]):+u<t&&(c.state=6,c.timer.stop(),c.on.call("cancel",e,e.__data__,c.index,c.group),delete o[u])}if(zv((function(){3===i.state&&(i.state=4,i.timer.restart(r,i.delay,i.time),r(l))})),i.state=2,i.on.call("start",e,e.__data__,i.index,i.group),2===i.state){for(i.state=3,s=new Array(d=i.tween.length),u=0,h=-1;u<d;++u)(c=i.tween[u].value.call(e,e.__data__,i.index,i.group))&&(s[++h]=c);s.length=h+1}}function r(t){for(var o=t<i.duration?i.ease.call(null,t/i.duration):(i.timer.restart(a),i.state=5,1),n=-1,r=s.length;++n<r;)s[n].call(e,o);5===i.state&&(i.on.call("end",e,e.__data__,i.index,i.group),a())}function a(){for(var s in i.state=6,i.timer.stop(),delete o[t],o)return;delete e.__transition}o[t]=i,i.timer=Hv((function(e){i.state=1,i.timer.restart(n,i.delay,i.time),i.delay<=e&&n(e-i.delay)}),0,i.time)}(e,i,{name:t,index:s,group:o,on:$v,tween:Kv,time:n.time,delay:n.delay,duration:n.duration,ease:n.ease,timer:null,state:0})}function Yv(e,t){var i=Xv(e,t);if(i.state>0)throw new Error("too late; already scheduled");return i}function qv(e,t){var i=Xv(e,t);if(i.state>3)throw new Error("too late; already running");return i}function Xv(e,t){var i=e.__transition;if(!i||!(i=i[t]))throw new Error("transition not found");return i}function Qv(e,t){return e=+e,t=+t,function(i){return e*(1-i)+t*i}}var Jv,Zv=180/Math.PI,ew={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function tw(e,t,i,s,o,n){var r,a,l;return(r=Math.sqrt(e*e+t*t))&&(e/=r,t/=r),(l=e*i+t*s)&&(i-=e*l,s-=t*l),(a=Math.sqrt(i*i+s*s))&&(i/=a,s/=a,l/=a),e*s<t*i&&(e=-e,t=-t,l=-l,r=-r),{translateX:o,translateY:n,rotate:Math.atan2(t,e)*Zv,skewX:Math.atan(l)*Zv,scaleX:r,scaleY:a}}function iw(e,t,i,s){function o(e){return e.length?e.pop()+" ":""}return function(n,r){var a=[],l=[];return n=e(n),r=e(r),function(e,s,o,n,r,a){if(e!==o||s!==n){var l=r.push("translate(",null,t,null,i);a.push({i:l-4,x:Qv(e,o)},{i:l-2,x:Qv(s,n)})}else(o||n)&&r.push("translate("+o+t+n+i)}(n.translateX,n.translateY,r.translateX,r.translateY,a,l),function(e,t,i,n){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),n.push({i:i.push(o(i)+"rotate(",null,s)-2,x:Qv(e,t)})):t&&i.push(o(i)+"rotate("+t+s)}(n.rotate,r.rotate,a,l),function(e,t,i,n){e!==t?n.push({i:i.push(o(i)+"skewX(",null,s)-2,x:Qv(e,t)}):t&&i.push(o(i)+"skewX("+t+s)}(n.skewX,r.skewX,a,l),function(e,t,i,s,n,r){if(e!==i||t!==s){var a=n.push(o(n)+"scale(",null,",",null,")");r.push({i:a-4,x:Qv(e,i)},{i:a-2,x:Qv(t,s)})}else 1===i&&1===s||n.push(o(n)+"scale("+i+","+s+")")}(n.scaleX,n.scaleY,r.scaleX,r.scaleY,a,l),n=r=null,function(e){for(var t,i=-1,s=l.length;++i<s;)a[(t=l[i]).i]=t.x(e);return a.join("")}}}var sw=iw((function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?ew:tw(t.a,t.b,t.c,t.d,t.e,t.f)}),"px, ","px)","deg)"),ow=iw((function(e){return null==e?ew:(Jv||(Jv=document.createElementNS("http://www.w3.org/2000/svg","g")),Jv.setAttribute("transform",e),(e=Jv.transform.baseVal.consolidate())?tw((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):ew)}),", ",")",")");function nw(e,t){var i,s;return function(){var o=qv(this,e),n=o.tween;if(n!==i)for(var r=0,a=(s=i=n).length;r<a;++r)if(s[r].name===t){(s=s.slice()).splice(r,1);break}o.tween=s}}function rw(e,t,i){var s,o;if("function"!=typeof i)throw new Error;return function(){var n=qv(this,e),r=n.tween;if(r!==s){o=(s=r).slice();for(var a={name:t,value:i},l=0,u=o.length;l<u;++l)if(o[l].name===t){o[l]=a;break}l===u&&o.push(a)}n.tween=o}}function aw(e,t,i){var s=e._id;return e.each((function(){var e=qv(this,s);(e.value||(e.value={}))[t]=i.apply(this,arguments)})),function(e){return Xv(e,s).value[t]}}function lw(e,t,i){e.prototype=t.prototype=i,i.constructor=e}function uw(e,t){var i=Object.create(e.prototype);for(var s in t)i[s]=t[s];return i}function hw(){}var dw=.7,cw=1/dw,pw="\\s*([+-]?\\d+)\\s*",gw="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",mw="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",fw=/^#([0-9a-f]{3,8})$/,Cw=new RegExp(`^rgb\\(${pw},${pw},${pw}\\)$`),vw=new RegExp(`^rgb\\(${mw},${mw},${mw}\\)$`),ww=new RegExp(`^rgba\\(${pw},${pw},${pw},${gw}\\)$`),yw=new RegExp(`^rgba\\(${mw},${mw},${mw},${gw}\\)$`),Ew=new RegExp(`^hsl\\(${gw},${mw},${mw}\\)$`),Sw=new RegExp(`^hsla\\(${gw},${mw},${mw},${gw}\\)$`),bw={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Rw(){return this.rgb().formatHex()}function Dw(){return this.rgb().formatRgb()}function Tw(e){var t,i;return e=(e+"").trim().toLowerCase(),(t=fw.exec(e))?(i=t[1].length,t=parseInt(t[1],16),6===i?Aw(t):3===i?new Mw(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===i?Pw(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===i?Pw(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Cw.exec(e))?new Mw(t[1],t[2],t[3],1):(t=vw.exec(e))?new Mw(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ww.exec(e))?Pw(t[1],t[2],t[3],t[4]):(t=yw.exec(e))?Pw(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Ew.exec(e))?Ow(t[1],t[2]/100,t[3]/100,1):(t=Sw.exec(e))?Ow(t[1],t[2]/100,t[3]/100,t[4]):bw.hasOwnProperty(e)?Aw(bw[e]):"transparent"===e?new Mw(NaN,NaN,NaN,0):null}function Aw(e){return new Mw(e>>16&255,e>>8&255,255&e,1)}function Pw(e,t,i,s){return s<=0&&(e=t=i=NaN),new Mw(e,t,i,s)}function Fw(e,t,i,s){return 1===arguments.length?((o=e)instanceof hw||(o=Tw(o)),o?new Mw((o=o.rgb()).r,o.g,o.b,o.opacity):new Mw):new Mw(e,t,i,null==s?1:s);var o}function Mw(e,t,i,s){this.r=+e,this.g=+t,this.b=+i,this.opacity=+s}function Lw(){return`#${_w(this.r)}${_w(this.g)}${_w(this.b)}`}function xw(){const e=Iw(this.opacity);return`${1===e?"rgb(":"rgba("}${Nw(this.r)}, ${Nw(this.g)}, ${Nw(this.b)}${1===e?")":`, ${e})`}`}function Iw(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Nw(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function _w(e){return((e=Nw(e))<16?"0":"")+e.toString(16)}function Ow(e,t,i,s){return s<=0?e=t=i=NaN:i<=0||i>=1?e=t=NaN:t<=0&&(e=NaN),new kw(e,t,i,s)}function Gw(e){if(e instanceof kw)return new kw(e.h,e.s,e.l,e.opacity);if(e instanceof hw||(e=Tw(e)),!e)return new kw;if(e instanceof kw)return e;var t=(e=e.rgb()).r/255,i=e.g/255,s=e.b/255,o=Math.min(t,i,s),n=Math.max(t,i,s),r=NaN,a=n-o,l=(n+o)/2;return a?(r=t===n?(i-s)/a+6*(i<s):i===n?(s-t)/a+2:(t-i)/a+4,a/=l<.5?n+o:2-n-o,r*=60):a=l>0&&l<1?0:r,new kw(r,a,l,e.opacity)}function kw(e,t,i,s){this.h=+e,this.s=+t,this.l=+i,this.opacity=+s}function Vw(e){return(e=(e||0)%360)<0?e+360:e}function Hw(e){return Math.max(0,Math.min(1,e||0))}function Bw(e,t,i){return 255*(e<60?t+(i-t)*e/60:e<180?i:e<240?t+(i-t)*(240-e)/60:t)}function Ww(e,t,i,s,o){var n=e*e,r=n*e;return((1-3*e+3*n-r)*t+(4-6*n+3*r)*i+(1+3*e+3*n-3*r)*s+r*o)/6}lw(hw,Tw,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Rw,formatHex:Rw,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Gw(this).formatHsl()},formatRgb:Dw,toString:Dw}),lw(Mw,Fw,uw(hw,{brighter(e){return e=null==e?cw:Math.pow(cw,e),new Mw(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?dw:Math.pow(dw,e),new Mw(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Mw(Nw(this.r),Nw(this.g),Nw(this.b),Iw(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Lw,formatHex:Lw,formatHex8:function(){return`#${_w(this.r)}${_w(this.g)}${_w(this.b)}${_w(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:xw,toString:xw})),lw(kw,(function(e,t,i,s){return 1===arguments.length?Gw(e):new kw(e,t,i,null==s?1:s)}),uw(hw,{brighter(e){return e=null==e?cw:Math.pow(cw,e),new kw(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?dw:Math.pow(dw,e),new kw(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,i=this.l,s=i+(i<.5?i:1-i)*t,o=2*i-s;return new Mw(Bw(e>=240?e-240:e+120,o,s),Bw(e,o,s),Bw(e<120?e+240:e-120,o,s),this.opacity)},clamp(){return new kw(Vw(this.h),Hw(this.s),Hw(this.l),Iw(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Iw(this.opacity);return`${1===e?"hsl(":"hsla("}${Vw(this.h)}, ${100*Hw(this.s)}%, ${100*Hw(this.l)}%${1===e?")":`, ${e})`}`}}));const Uw=e=>()=>e;function zw(e,t){var i=t-e;return i?function(e,t){return function(i){return e+i*t}}(e,i):Uw(isNaN(e)?t:e)}const $w=function e(t){var i=function(e){return 1==(e=+e)?zw:function(t,i){return i-t?function(e,t,i){return e=Math.pow(e,i),t=Math.pow(t,i)-e,i=1/i,function(s){return Math.pow(e+s*t,i)}}(t,i,e):Uw(isNaN(t)?i:t)}}(t);function s(e,t){var s=i((e=Fw(e)).r,(t=Fw(t)).r),o=i(e.g,t.g),n=i(e.b,t.b),r=zw(e.opacity,t.opacity);return function(t){return e.r=s(t),e.g=o(t),e.b=n(t),e.opacity=r(t),e+""}}return s.gamma=e,s}(1);function Kw(e){return function(t){var i,s,o=t.length,n=new Array(o),r=new Array(o),a=new Array(o);for(i=0;i<o;++i)s=Fw(t[i]),n[i]=s.r||0,r[i]=s.g||0,a[i]=s.b||0;return n=e(n),r=e(r),a=e(a),s.opacity=1,function(e){return s.r=n(e),s.g=r(e),s.b=a(e),s+""}}}Kw((function(e){var t=e.length-1;return function(i){var s=i<=0?i=0:i>=1?(i=1,t-1):Math.floor(i*t),o=e[s],n=e[s+1],r=s>0?e[s-1]:2*o-n,a=s<t-1?e[s+2]:2*n-o;return Ww((i-s/t)*t,r,o,n,a)}})),Kw((function(e){var t=e.length;return function(i){var s=Math.floor(((i%=1)<0?++i:i)*t),o=e[(s+t-1)%t],n=e[s%t],r=e[(s+1)%t],a=e[(s+2)%t];return Ww((i-s/t)*t,o,n,r,a)}}));var jw=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Yw=new RegExp(jw.source,"g");function qw(e,t){var i,s,o,n=jw.lastIndex=Yw.lastIndex=0,r=-1,a=[],l=[];for(e+="",t+="";(i=jw.exec(e))&&(s=Yw.exec(t));)(o=s.index)>n&&(o=t.slice(n,o),a[r]?a[r]+=o:a[++r]=o),(i=i[0])===(s=s[0])?a[r]?a[r]+=s:a[++r]=s:(a[++r]=null,l.push({i:r,x:Qv(i,s)})),n=Yw.lastIndex;return n<t.length&&(o=t.slice(n),a[r]?a[r]+=o:a[++r]=o),a.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var i,s=0;s<t;++s)a[(i=l[s]).i]=i.x(e);return a.join("")})}function Xw(e,t){var i;return("number"==typeof t?Qv:t instanceof Tw?$w:(i=Tw(t))?(t=i,$w):qw)(e,t)}function Qw(e){return function(){this.removeAttribute(e)}}function Jw(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Zw(e,t,i){var s,o,n=i+"";return function(){var r=this.getAttribute(e);return r===n?null:r===s?o:o=t(s=r,i)}}function ey(e,t,i){var s,o,n=i+"";return function(){var r=this.getAttributeNS(e.space,e.local);return r===n?null:r===s?o:o=t(s=r,i)}}function ty(e,t,i){var s,o,n;return function(){var r,a,l=i(this);if(null!=l)return(r=this.getAttribute(e))===(a=l+"")?null:r===s&&a===o?n:(o=a,n=t(s=r,l));this.removeAttribute(e)}}function iy(e,t,i){var s,o,n;return function(){var r,a,l=i(this);if(null!=l)return(r=this.getAttributeNS(e.space,e.local))===(a=l+"")?null:r===s&&a===o?n:(o=a,n=t(s=r,l));this.removeAttributeNS(e.space,e.local)}}function sy(e,t){var i,s;function o(){var o=t.apply(this,arguments);return o!==s&&(i=(s=o)&&function(e,t){return function(i){this.setAttributeNS(e.space,e.local,t.call(this,i))}}(e,o)),i}return o._value=t,o}function oy(e,t){var i,s;function o(){var o=t.apply(this,arguments);return o!==s&&(i=(s=o)&&function(e,t){return function(i){this.setAttribute(e,t.call(this,i))}}(e,o)),i}return o._value=t,o}function ny(e,t){return function(){Yv(this,e).delay=+t.apply(this,arguments)}}function ry(e,t){return t=+t,function(){Yv(this,e).delay=t}}function ay(e,t){return function(){qv(this,e).duration=+t.apply(this,arguments)}}function ly(e,t){return t=+t,function(){qv(this,e).duration=t}}var uy=yv.prototype.constructor;function hy(e){return function(){this.style.removeProperty(e)}}var dy=0;function cy(e,t,i,s){this._groups=e,this._parents=t,this._name=i,this._id=s}function py(){return++dy}var gy=yv.prototype;cy.prototype=function(e){return yv().transition(e)}.prototype={constructor:cy,select:function(e){var t=this._name,i=this._id;"function"!=typeof e&&(e=hC(e));for(var s=this._groups,o=s.length,n=new Array(o),r=0;r<o;++r)for(var a,l,u=s[r],h=u.length,d=n[r]=new Array(h),c=0;c<h;++c)(a=u[c])&&(l=e.call(a,a.__data__,c,u))&&("__data__"in a&&(l.__data__=a.__data__),d[c]=l,jv(d[c],t,i,c,d,Xv(a,i)));return new cy(n,this._parents,t,i)},selectAll:function(e){var t=this._name,i=this._id;"function"!=typeof e&&(e=cC(e));for(var s=this._groups,o=s.length,n=[],r=[],a=0;a<o;++a)for(var l,u=s[a],h=u.length,d=0;d<h;++d)if(l=u[d]){for(var c,p=e.call(l,l.__data__,d,u),g=Xv(l,i),m=0,f=p.length;m<f;++m)(c=p[m])&&jv(c,t,i,m,p,g);n.push(p),r.push(l)}return new cy(n,r,t,i)},selectChild:gy.selectChild,selectChildren:gy.selectChildren,filter:function(e){"function"!=typeof e&&(e=pC(e));for(var t=this._groups,i=t.length,s=new Array(i),o=0;o<i;++o)for(var n,r=t[o],a=r.length,l=s[o]=[],u=0;u<a;++u)(n=r[u])&&e.call(n,n.__data__,u,r)&&l.push(n);return new cy(s,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,i=e._groups,s=t.length,o=i.length,n=Math.min(s,o),r=new Array(s),a=0;a<n;++a)for(var l,u=t[a],h=i[a],d=u.length,c=r[a]=new Array(d),p=0;p<d;++p)(l=u[p]||h[p])&&(c[p]=l);for(;a<s;++a)r[a]=t[a];return new cy(r,this._parents,this._name,this._id)},selection:function(){return new uy(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,i=py(),s=this._groups,o=s.length,n=0;n<o;++n)for(var r,a=s[n],l=a.length,u=0;u<l;++u)if(r=a[u]){var h=Xv(r,t);jv(r,e,i,u,a,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new cy(s,this._parents,e,i)},call:gy.call,nodes:gy.nodes,node:gy.node,size:gy.size,empty:gy.empty,each:gy.each,on:function(e,t){var i=this._id;return arguments.length<2?Xv(this.node(),i).on.on(e):this.each(function(e,t,i){var s,o,n=function(e){return(e+"").trim().split(/^|\s+/).every((function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e}))}(t)?Yv:qv;return function(){var r=n(this,e),a=r.on;a!==s&&(o=(s=a).copy()).on(t,i),r.on=o}}(i,e,t))},attr:function(e,t){var i=PC(e),s="transform"===i?ow:Xw;return this.attrTween(e,"function"==typeof t?(i.local?iy:ty)(i,s,aw(this,"attr."+e,t)):null==t?(i.local?Jw:Qw)(i):(i.local?ey:Zw)(i,s,t))},attrTween:function(e,t){var i="attr."+e;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==t)return this.tween(i,null);if("function"!=typeof t)throw new Error;var s=PC(e);return this.tween(i,(s.local?sy:oy)(s,t))},style:function(e,t,i){var s="transform"==(e+="")?sw:Xw;return null==t?this.styleTween(e,function(e,t){var i,s,o;return function(){var n=VC(this,e),r=(this.style.removeProperty(e),VC(this,e));return n===r?null:n===i&&r===s?o:o=t(i=n,s=r)}}(e,s)).on("end.style."+e,hy(e)):"function"==typeof t?this.styleTween(e,function(e,t,i){var s,o,n;return function(){var r=VC(this,e),a=i(this),l=a+"";return null==a&&(this.style.removeProperty(e),l=a=VC(this,e)),r===l?null:r===s&&l===o?n:(o=l,n=t(s=r,a))}}(e,s,aw(this,"style."+e,t))).each(function(e,t){var i,s,o,n,r="style."+t,a="end."+r;return function(){var l=qv(this,e),u=l.on,h=null==l.value[r]?n||(n=hy(t)):void 0;u===i&&o===h||(s=(i=u).copy()).on(a,o=h),l.on=s}}(this._id,e)):this.styleTween(e,function(e,t,i){var s,o,n=i+"";return function(){var r=VC(this,e);return r===n?null:r===s?o:o=t(s=r,i)}}(e,s,t),i).on("end.style."+e,null)},styleTween:function(e,t,i){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(null==t)return this.tween(s,null);if("function"!=typeof t)throw new Error;return this.tween(s,function(e,t,i){var s,o;function n(){var n=t.apply(this,arguments);return n!==o&&(s=(o=n)&&function(e,t,i){return function(s){this.style.setProperty(e,t.call(this,s),i)}}(e,n,i)),s}return n._value=t,n}(e,t,null==i?"":i))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(aw(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function(e){var t,i;function s(){var s=e.apply(this,arguments);return s!==i&&(t=(i=s)&&function(e){return function(t){this.textContent=e.call(this,t)}}(s)),t}return s._value=e,s}(e))},remove:function(){return this.on("end.remove",function(e){return function(){var t=this.parentNode;for(var i in this.__transition)if(+i!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function(e,t){var i=this._id;if(e+="",arguments.length<2){for(var s,o=Xv(this.node(),i).tween,n=0,r=o.length;n<r;++n)if((s=o[n]).name===e)return s.value;return null}return this.each((null==t?nw:rw)(i,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?ny:ry)(t,e)):Xv(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?ay:ly)(t,e)):Xv(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw new Error;return function(){qv(this,e).ease=t}}(t,e)):Xv(this.node(),t).ease},easeVarying:function(e){if("function"!=typeof e)throw new Error;return this.each(function(e,t){return function(){var i=t.apply(this,arguments);if("function"!=typeof i)throw new Error;qv(this,e).ease=i}}(this._id,e))},end:function(){var e,t,i=this,s=i._id,o=i.size();return new Promise((function(n,r){var a={value:r},l={value:function(){0==--o&&n()}};i.each((function(){var i=qv(this,s),o=i.on;o!==e&&((t=(e=o).copy())._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),i.on=t})),0===o&&n()}))},[Symbol.iterator]:gy[Symbol.iterator]};var my={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};function fy(e,t){for(var i;!(i=e.__transition)||!(i=i[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return i}yv.prototype.interrupt=function(e){return this.each((function(){!function(e,t){var i,s,o,n=e.__transition,r=!0;if(n){for(o in t=null==t?null:t+"",n)(i=n[o]).name===t?(s=i.state>2&&i.state<5,i.state=6,i.timer.stop(),i.on.call(s?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete n[o]):r=!1;r&&delete e.__transition}}(this,e)}))},yv.prototype.transition=function(e){var t,i;e instanceof cy?(t=e._id,e=e._name):(t=py(),(i=my).time=Gv(),e=null==e?null:e+"");for(var s=this._groups,o=s.length,n=0;n<o;++n)for(var r,a=s[n],l=a.length,u=0;u<l;++u)(r=a[u])&&jv(r,e,t,u,a,i||fy(r,t));return new cy(s,this._parents,e,t)};const{abs:Cy,max:vy,min:wy}=Math;function yy(e){return{type:e}}function Ey(e){return"string"==typeof e?new vv([[document.querySelector(e)]],[document.documentElement]):new vv([[e]],Cv)}function Sy(e,t,i){this.k=e,this.x=t,this.y=i}["w","e"].map(yy),["n","s"].map(yy),["n","w","e","s","nw","ne","sw","se"].map(yy),Sy.prototype={constructor:Sy,scale:function(e){return 1===e?this:new Sy(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new Sy(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},new Sy(1,0,0),Sy.prototype;var by=i(688),Ry=i.n(by);const Dy=({items:e=[],itemSize:t=20,spacing:i=5,startX:s=20,startY:n=20,fontFamily:r="Arial",fontSize:a=14})=>{const u=(0,l.useRef)(null),[h,d]=(0,l.useState)(0);return(0,l.useEffect)((()=>{const e=()=>{u.current&&d(u.current.clientWidth)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),(0,l.useEffect)((()=>{if(!e.length||!u.current||0===h)return;Ey(u.current).selectAll("*").remove();const o=e.map((e=>{const s=e.Label.length*a*.6;return t+i+s})),l=o.reduce(((e,t)=>e+t+i),0),d=h-2*s,c=Math.ceil(l/d),p=Array(c).fill().map((()=>[]));let g=Array(c).fill(0);o.forEach(((e,t)=>{const s=g.map(((e,t)=>({width:e,index:t}))).sort(((e,t)=>e.width-t.width))[0].index;p[s].push(t),g[s]+=e+i}));const m=Ey(u.current).attr("width","100%").style("overflow","visible"),f=m.append("g").attr("class","legend-group").attr("transform",`translate(${s}, ${n})`);p.forEach(((s,o)=>{let n=0;const l=o*(t+i);s.forEach((s=>{const o=e[s],u=o.Label.length*a*.6;f.append("rect").attr("x",n).attr("y",l).attr("width",t).attr("height",t).style("fill",o.color||"#cccccc"),f.append("text").attr("x",n+t+i).attr("y",l+t/2).text(o.Label||"").style("font-family",r).style("font-size",`${a}px`).style("dominant-baseline","middle").style("fill","#333333"),n+=t+i+u+i}))}));const C=c*(t+i)+2*n;m.attr("height",C)}),[e,h,t,i,s,n,r,a]),(0,o.createElement)("svg",{ref:u,className:"lcp-legend",style:{width:"100%"}})};Dy.propTypes={items:Ry().arrayOf(Ry().shape({Label:Ry().string.isRequired,color:Ry().string.isRequired})),itemSize:Ry().number,spacing:Ry().number,startX:Ry().number,startY:Ry().number,fontFamily:Ry().string,fontSize:Ry().number};const Ty=Dy,Ay=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"lcp/bar-graph","version":"1.0.0","title":"Bar Graph","category":"widgets","icon":"chart-bar","description":"Display data as a bar graph using D3.js","supports":{"html":false},"attributes":{"columnTypes":{"type":"object","default":{}},"enableStackedBars":{"type":"boolean","default":false},"enableDrillDown":{"type":"boolean","default":false},"enableHierachical":{"type":"boolean","default":false},"hierarchicalSource":{"type":"string","default":"parent"},"hierarchicalColumnOrder":{"type":"string","default":""},"hierachicalDepth":{"type":"number","default":1},"datasets":{"type":"array","default":[{"name":"Data","data":[{"Department":"Sheriffs Office","Budget":"150","MeetAt":"12/12/2025","PreferredColor":"#e0e0e0","PostContent":"<div> </div>"},{"Department":"Assessor","Budget":"100","MeetAt":"12/12/2025","PreferredColor":"#e0e0e0","PostContent":"<div> </div>"},{"Department":"Treasurer","Budget":"50","MeetAt":"12/12/2025","PreferredColor":"#e0e0e0","PostContent":"<div> </div>"}]},{"name":"Locations","data":[{"State":"California","Coordinates":"150,000","MeetAt":"12/12/2025","PreferredColor":"#e0e0e0","PostContent":"<div> </div>"},{"State":"Texas","Coordinates":"100,000","MeetAt":"12/12/2025","PreferredColor":"#e0e0e0","PostContent":"<div> </div>"},{"State":"Florida","Coordinates":"50,000","MeetAt":"12/12/2025","PreferredColor":"#e0e0e0","PostContent":"<div> </div>"}]},{"name":"Dataset 3","data":[{"ID":"lcpDatapoint-1","Label":"Sample 1","Value":100,"Color":"#007cba","Content":"<p>First item</p>","Parent":""},{"ID":"lcpDatapoint-2","Label":"Sample 2","Value":50,"Color":"#ff0000","Content":"<p>Second item</p>","Parent":"lcpDatapoint-1"}]}]},"chartData":{"type":"array","default":[{"ID":"lcpDatapoint-1","Label":"Sample 1","Value":100,"Color":"#007cba","Content":"<p>First item</p>","Parent":""},{"ID":"lcpDatapoint-2","Label":"Sample 2","Value":50,"Color":"#ff0000","Content":"<p>Second item</p>","Parent":"lcpDatapoint-1"}]},"enableGroupedBars":{"type":"boolean","default":false},"groupedBarsColumn":{"type":"string","default":""},"chartHeight":{"type":"string","default":"400px"},"chartWidth":{"type":"string","default":"100%"},"idColumn":{"type":"string","default":"ID"},"barColor":{"type":"string","default":"#007cba"},"valueColumn":{"type":"string","default":"Value"},"labelsColumn":{"type":"string","default":"Label"},"colorColumn":{"type":"string","default":"Color"},"popoverColumn":{"type":"string","default":"Content"},"renderLegend":{"type":"boolean","default":true},"legendFontSize":{"type":"string","default":"16px"},"legendLocation":{"type":"string","default":"top"},"legendAlignment":{"type":"string","default":"left"},"allowDownloadImage":{"type":"boolean","default":false},"downloadImageMaxWidth":{"type":"string","default":"2000px"},"allowDownloadCsv":{"type":"boolean","default":false},"allowDownloadJson":{"type":"boolean","default":false},"allowFilter":{"type":"boolean","default":false},"allowSorting":{"type":"boolean","default":false},"renderFooter":{"type":"boolean","default":false},"footerContent":{"type":"string","default":""},"chartTitle":{"type":"string","default":""},"chartSubtitle":{"type":"string","default":""},"toolbarLocation":{"type":"string","default":"bottom"},"toolbarAlignment":{"type":"string","default":"left"},"enableDatapointTooltip":{"type":"boolean","default":false},"enableDatapointPopup":{"type":"boolean","default":false},"showXAxisLabel":{"type":"boolean","default":true},"xAxisLabel":{"type":"string","default":""},"showYAxisLabel":{"type":"boolean","default":true},"yAxisLabel":{"type":"string","default":""},"barsColorSource":{"type":"string","default":"default"},"renderXGrid":{"type":"boolean","default":false},"xGridColor":{"type":"string","default":"blue"},"renderYGrid":{"type":"boolean","default":false},"yGridColor":{"type":"string","default":"#e0e0e0"},"includeDataChart":{"type":"boolean","default":false},"allowChartDataDownload":{"type":"boolean","default":false}},"textdomain":"lcp-visualize","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"render_block_lcp_bar_graph"}');(0,s.registerBlockType)(Ay.name,{...Ay,edit:function({attributes:e,setAttributes:t}){const{chartHeight:i="400px",chartWidth:s="100%",barColor:l="#007cba",chartData:u=[],valueColumn:h="Value",labelsColumn:d="Label",colorColumn:c="color",popoverColumn:p="content",barsColorSource:g="default",hierachicalDepth:m=1,enableDrillDown:f=!1,enableStackedBars:C=!1,hierarchicalSource:v="parent",hierarchicalColumnOrder:w="",renderLegend:y=!1,toolbarLocation:E="top",enableGroupedBars:S=!1,groupedBarsColumn:b=""}=e,R=(0,r.useBlockProps)();return(0,o.createElement)("div",{...R},(0,o.createElement)(r.InspectorControls,null,(0,o.createElement)(a.PanelBody,{title:(0,n.__)("Chart Settings","lcp")},(0,o.createElement)(nC,{chartType:"bar",chartData:u,onChange:e=>{t({chartData:e})},attributes:e,setAttributes:t}),(0,o.createElement)(a.SelectControl,{label:(0,n.__)("Color Source","lcp"),help:(0,n.__)("Select the logic for setting the colors","lcp"),value:v||"parent",options:[{label:"Parent Column",value:"parent"},{label:"Column Order",value:"columnOrder"}],onChange:e=>t({hierarchicalSource:e})}),"columnOrder"===v&&(0,o.createElement)(a.TextControl,{label:(0,n.__)("Hierarchical Column Order","lcp"),value:w,onChange:e=>t({hierarchicalColumnOrder:e})}),(0,o.createElement)(a.ToggleControl,{label:(0,n.__)("Enable Drill Down","lcp"),checked:f,onChange:e=>t({enableDrillDown:e})}),(0,o.createElement)(a.ToggleControl,{label:(0,n.__)("Enable Stacked Bars","lcp"),checked:C,onChange:e=>t({enableStackedBars:e})}),(0,o.createElement)(rC,{label:(0,n.__)("Chart Height","lcp"),value:i,onChange:e=>t({chartHeight:e})}),(0,o.createElement)(rC,{label:(0,n.__)("Chart Width","lcp"),value:s,onChange:e=>t({chartWidth:e})})),(0,o.createElement)(a.PanelBody,{title:(0,n.__)("Color Settings","lcp-visualize"),initialOpen:!0},(0,o.createElement)(a.SelectControl,{label:(0,n.__)("Color Source","lcp"),help:(0,n.__)("Select the logic for setting the colors","lcp"),value:g||"default",options:[{label:"Default",value:"default"},{label:"Swatch",value:"swatch"}],onChange:e=>t({barsColorSource:e})})),(0,o.createElement)(lC,{attributes:e,setAttributes:t})),(0,o.createElement)("div",{className:"lcp-bar-graph-container"},"top"===E&&(0,o.createElement)("div",{className:"lcp-visualizer-toolbar"},(0,o.createElement)("span",null,"Toolbar")),y&&(0,o.createElement)(Ty,{items:[{Label:"Category 1",color:"#ff0000"},{Label:"Category 2",color:"#00ff00"},{Label:"Category 1",color:"#ff0000"},{Label:"Categokhkjhkjhkjhky 2",color:"#00ff00"},{Label:"Category 1",color:"#ff0000"},{Label:"Category 2",color:"#00ff00"},{Label:"Category 1",color:"#ff0000"},{Label:"Cat 2",color:"#00ff00"},{Label:"Coy 1",color:"#ff0000"}],width:300,height:150,itemSize:15,spacing:8}),(0,o.createElement)(Ds,{chartData:u,height:i,width:s,valueColumn:h,labelsColumn:d,colorColumn:c,popoverColumn:p,defaultBarColor:l}),"bottom"===E&&(0,o.createElement)("div",{className:"lcp-visualizer-toolbar"},(0,o.createElement)("span",null,"Toolbar"))))},save:()=>null})},362:(e,t,i)=>{"use strict";var s=i(441);function o(){}function n(){}n.resetWarningCache=o,e.exports=function(){function e(e,t,i,o,n,r){if(r!==s){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var i={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:n,resetWarningCache:o};return i.PropTypes=i,i}},688:(e,t,i)=>{e.exports=i(362)()},441:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},925:(e,t,i)=>{"use strict";var s=i(609);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=Object.prototype.hasOwnProperty,r=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,a={},l={};function u(e){return!!n.call(l,e)||!n.call(a,e)&&(r.test(e)?l[e]=!0:(a[e]=!0,!1))}function h(e,t,i,s,o,n,r){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=s,this.attributeNamespace=o,this.mustUseProperty=i,this.propertyName=e,this.type=t,this.sanitizeURL=n,this.removeEmptyString=r}var d={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){d[e]=new h(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];d[t]=new h(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){d[e]=new h(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){d[e]=new h(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){d[e]=new h(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){d[e]=new h(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){d[e]=new h(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){d[e]=new h(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){d[e]=new h(e,5,!1,e.toLowerCase(),null,!1,!1)}));var c=/[\-:]([a-z])/g;function p(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(c,p);d[t]=new h(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(c,p);d[t]=new h(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(c,p);d[t]=new h(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){d[e]=new h(e,1,!1,e.toLowerCase(),null,!1,!1)})),d.xlinkHref=new h("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){d[e]=new h(e,1,!1,e.toLowerCase(),null,!0,!0)}));var g={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},m=["Webkit","ms","Moz","O"];Object.keys(g).forEach((function(e){m.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),g[t]=g[e]}))}));var f=/["'&<>]/;function C(e){if("boolean"==typeof e||"number"==typeof e)return""+e;e=""+e;var t=f.exec(e);if(t){var i,s="",o=0;for(i=t.index;i<e.length;i++){switch(e.charCodeAt(i)){case 34:t="&quot;";break;case 38:t="&amp;";break;case 39:t="&#x27;";break;case 60:t="&lt;";break;case 62:t="&gt;";break;default:continue}o!==i&&(s+=e.substring(o,i)),o=i+1,s+=t}e=o!==i?s+e.substring(o,i):s}return e}var v=/([A-Z])/g,w=/^ms-/,y=Array.isArray;function E(e,t){return{insertionMode:e,selectedValue:t}}var S=new Map;function b(e,t,i){if("object"!=typeof i)throw Error(o(62));for(var s in t=!0,i)if(n.call(i,s)){var r=i[s];if(null!=r&&"boolean"!=typeof r&&""!==r){if(0===s.indexOf("--")){var a=C(s);r=C((""+r).trim())}else{a=s;var l=S.get(a);void 0!==l||(l=C(a.replace(v,"-$1").toLowerCase().replace(w,"-ms-")),S.set(a,l)),a=l,r="number"==typeof r?0===r||n.call(g,s)?""+r:r+"px":C((""+r).trim())}t?(t=!1,e.push(' style="',a,":",r)):e.push(";",a,":",r)}}t||e.push('"')}function R(e,t,i,s){switch(i){case"style":return void b(e,t,s);case"defaultValue":case"defaultChecked":case"innerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":return}if(!(2<i.length)||"o"!==i[0]&&"O"!==i[0]||"n"!==i[1]&&"N"!==i[1])if(null!==(t=d.hasOwnProperty(i)?d[i]:null)){switch(typeof s){case"function":case"symbol":return;case"boolean":if(!t.acceptsBooleans)return}switch(i=t.attributeName,t.type){case 3:s&&e.push(" ",i,'=""');break;case 4:!0===s?e.push(" ",i,'=""'):!1!==s&&e.push(" ",i,'="',C(s),'"');break;case 5:isNaN(s)||e.push(" ",i,'="',C(s),'"');break;case 6:!isNaN(s)&&1<=s&&e.push(" ",i,'="',C(s),'"');break;default:t.sanitizeURL&&(s=""+s),e.push(" ",i,'="',C(s),'"')}}else if(u(i)){switch(typeof s){case"function":case"symbol":return;case"boolean":if("data-"!==(t=i.toLowerCase().slice(0,5))&&"aria-"!==t)return}e.push(" ",i,'="',C(s),'"')}}function D(e,t,i){if(null!=t){if(null!=i)throw Error(o(60));if("object"!=typeof t||!("__html"in t))throw Error(o(61));null!=(t=t.__html)&&e.push(""+t)}}function T(e,t,i,s){e.push(F(i));var o,r=i=null;for(o in t)if(n.call(t,o)){var a=t[o];if(null!=a)switch(o){case"children":i=a;break;case"dangerouslySetInnerHTML":r=a;break;default:R(e,s,o,a)}}return e.push(">"),D(e,r,i),"string"==typeof i?(e.push(C(i)),null):i}var A=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,P=new Map;function F(e){var t=P.get(e);if(void 0===t){if(!A.test(e))throw Error(o(65,e));t="<"+e,P.set(e,t)}return t}function M(e,t,i){if(e.push('\x3c!--$?--\x3e<template id="'),null===i)throw Error(o(395));return e.push(i),e.push('"></template>')}var L=/[<\u2028\u2029]/g;function x(e){return JSON.stringify(e).replace(L,(function(e){switch(e){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}}))}function I(e,t,i,s){return i.generateStaticMarkup?(e.push(C(t)),!1):(""===t?e=s:(s&&e.push("\x3c!-- --\x3e"),e.push(C(t)),e=!0),e)}var N=Object.assign,_=Symbol.for("react.element"),O=Symbol.for("react.portal"),G=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),V=Symbol.for("react.profiler"),H=Symbol.for("react.provider"),B=Symbol.for("react.context"),W=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),j=Symbol.for("react.scope"),Y=Symbol.for("react.debug_trace_mode"),q=Symbol.for("react.legacy_hidden"),X=Symbol.for("react.default_value"),Q=Symbol.iterator;function J(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case G:return"Fragment";case O:return"Portal";case V:return"Profiler";case k:return"StrictMode";case U:return"Suspense";case z:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case B:return(e.displayName||"Context")+".Consumer";case H:return(e._context.displayName||"Context")+".Provider";case W:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case $:return null!==(t=e.displayName||null)?t:J(e.type)||"Memo";case K:t=e._payload,e=e._init;try{return J(e(t))}catch(e){}}return null}var Z={};function ee(e,t){if(!(e=e.contextTypes))return Z;var i,s={};for(i in e)s[i]=t[i];return s}var te=null;function ie(e,t){if(e!==t){e.context._currentValue2=e.parentValue,e=e.parent;var i=t.parent;if(null===e){if(null!==i)throw Error(o(401))}else{if(null===i)throw Error(o(401));ie(e,i)}t.context._currentValue2=t.value}}function se(e){e.context._currentValue2=e.parentValue,null!==(e=e.parent)&&se(e)}function oe(e){var t=e.parent;null!==t&&oe(t),e.context._currentValue2=e.value}function ne(e,t){if(e.context._currentValue2=e.parentValue,null===(e=e.parent))throw Error(o(402));e.depth===t.depth?ie(e,t):ne(e,t)}function re(e,t){var i=t.parent;if(null===i)throw Error(o(402));e.depth===i.depth?ie(e,i):re(e,i),t.context._currentValue2=t.value}function ae(e){var t=te;t!==e&&(null===t?oe(e):null===e?se(t):t.depth===e.depth?ie(t,e):t.depth>e.depth?ne(t,e):re(t,e),te=e)}var le={isMounted:function(){return!1},enqueueSetState:function(e,t){null!==(e=e._reactInternals).queue&&e.queue.push(t)},enqueueReplaceState:function(e,t){(e=e._reactInternals).replace=!0,e.queue=[t]},enqueueForceUpdate:function(){}};function ue(e,t,i,s){var o=void 0!==e.state?e.state:null;e.updater=le,e.props=i,e.state=o;var n={queue:[],replace:!1};e._reactInternals=n;var r=t.contextType;if(e.context="object"==typeof r&&null!==r?r._currentValue2:s,"function"==typeof(r=t.getDerivedStateFromProps)&&(o=null==(r=r(i,o))?o:N({},o,r),e.state=o),"function"!=typeof t.getDerivedStateFromProps&&"function"!=typeof e.getSnapshotBeforeUpdate&&("function"==typeof e.UNSAFE_componentWillMount||"function"==typeof e.componentWillMount))if(t=e.state,"function"==typeof e.componentWillMount&&e.componentWillMount(),"function"==typeof e.UNSAFE_componentWillMount&&e.UNSAFE_componentWillMount(),t!==e.state&&le.enqueueReplaceState(e,e.state,null),null!==n.queue&&0<n.queue.length)if(t=n.queue,r=n.replace,n.queue=null,n.replace=!1,r&&1===t.length)e.state=t[0];else{for(n=r?t[0]:e.state,o=!0,r=r?1:0;r<t.length;r++){var a=t[r];null!=(a="function"==typeof a?a.call(e,n,i,s):a)&&(o?(o=!1,n=N({},n,a)):N(n,a))}e.state=n}else n.queue=null}var he={id:1,overflow:""};function de(e,t,i){var s=e.id;e=e.overflow;var o=32-ce(s)-1;s&=~(1<<o),i+=1;var n=32-ce(t)+o;if(30<n){var r=o-o%5;return n=(s&(1<<r)-1).toString(32),s>>=r,o-=r,{id:1<<32-ce(t)+o|i<<o|s,overflow:n+e}}return{id:1<<n|i<<o|s,overflow:e}}var ce=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(pe(e)/ge|0)|0},pe=Math.log,ge=Math.LN2,me="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},fe=null,Ce=null,ve=null,we=null,ye=!1,Ee=!1,Se=0,be=null,Re=0;function De(){if(null===fe)throw Error(o(321));return fe}function Te(){if(0<Re)throw Error(o(312));return{memoizedState:null,queue:null,next:null}}function Ae(){return null===we?null===ve?(ye=!1,ve=we=Te()):(ye=!0,we=ve):null===we.next?(ye=!1,we=we.next=Te()):(ye=!0,we=we.next),we}function Pe(){Ce=fe=null,Ee=!1,ve=null,Re=0,we=be=null}function Fe(e,t){return"function"==typeof t?t(e):t}function Me(e,t,i){if(fe=De(),we=Ae(),ye){var s=we.queue;if(t=s.dispatch,null!==be&&void 0!==(i=be.get(s))){be.delete(s),s=we.memoizedState;do{s=e(s,i.action),i=i.next}while(null!==i);return we.memoizedState=s,[s,t]}return[we.memoizedState,t]}return e=e===Fe?"function"==typeof t?t():t:void 0!==i?i(t):t,we.memoizedState=e,e=(e=we.queue={last:null,dispatch:null}).dispatch=xe.bind(null,fe,e),[we.memoizedState,e]}function Le(e,t){if(fe=De(),t=void 0===t?null:t,null!==(we=Ae())){var i=we.memoizedState;if(null!==i&&null!==t){var s=i[1];e:if(null===s)s=!1;else{for(var o=0;o<s.length&&o<t.length;o++)if(!me(t[o],s[o])){s=!1;break e}s=!0}if(s)return i[0]}}return e=e(),we.memoizedState=[e,t],e}function xe(e,t,i){if(25<=Re)throw Error(o(301));if(e===fe)if(Ee=!0,e={action:i,next:null},null===be&&(be=new Map),void 0===(i=be.get(t)))be.set(t,e);else{for(t=i;null!==t.next;)t=t.next;t.next=e}}function Ie(){throw Error(o(394))}function Ne(){}var _e={readContext:function(e){return e._currentValue2},useContext:function(e){return De(),e._currentValue2},useMemo:Le,useReducer:Me,useRef:function(e){fe=De();var t=(we=Ae()).memoizedState;return null===t?(e={current:e},we.memoizedState=e):t},useState:function(e){return Me(Fe,e)},useInsertionEffect:Ne,useLayoutEffect:function(){},useCallback:function(e,t){return Le((function(){return e}),t)},useImperativeHandle:Ne,useEffect:Ne,useDebugValue:Ne,useDeferredValue:function(e){return De(),e},useTransition:function(){return De(),[!1,Ie]},useId:function(){var e=Ce.treeContext,t=e.overflow;e=((e=e.id)&~(1<<32-ce(e)-1)).toString(32)+t;var i=Oe;if(null===i)throw Error(o(404));return t=Se++,e=":"+i.idPrefix+"R"+e,0<t&&(e+="H"+t.toString(32)),e+":"},useMutableSource:function(e,t){return De(),t(e._source)},useSyncExternalStore:function(e,t,i){if(void 0===i)throw Error(o(407));return i()}},Oe=null,Ge=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher;function ke(e){return console.error(e),null}function Ve(){}function He(e,t,i,s,o,n,r,a){e.allPendingTasks++,null===i?e.pendingRootTasks++:i.pendingTasks++;var l={node:t,ping:function(){var t=e.pingedTasks;t.push(l),1===t.length&&tt(e)},blockedBoundary:i,blockedSegment:s,abortSet:o,legacyContext:n,context:r,treeContext:a};return o.add(l),l}function Be(e,t,i,s,o,n){return{status:0,id:-1,index:t,parentFlushed:!1,chunks:[],children:[],formatContext:s,boundary:i,lastPushedText:o,textEmbedded:n}}function We(e,t){if(null!=(e=e.onError(t))&&"string"!=typeof e)throw Error('onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "'+typeof e+'" instead');return e}function Ue(e,t){var i=e.onShellError;i(t),(i=e.onFatalError)(t),null!==e.destination?(e.status=2,e.destination.destroy(t)):(e.status=1,e.fatalError=t)}function ze(e,t,i,s,o){for(fe={},Ce=t,Se=0,e=i(s,o);Ee;)Ee=!1,Se=0,Re+=1,we=null,e=i(s,o);return Pe(),e}function $e(e,t,i,s){var n=i.render(),r=s.childContextTypes;if(null!=r){var a=t.legacyContext;if("function"!=typeof i.getChildContext)s=a;else{for(var l in i=i.getChildContext())if(!(l in r))throw Error(o(108,J(s)||"Unknown",l));s=N({},a,i)}t.legacyContext=s,Ye(e,t,n),t.legacyContext=a}else Ye(e,t,n)}function Ke(e,t){if(e&&e.defaultProps){for(var i in t=N({},t),e=e.defaultProps)void 0===t[i]&&(t[i]=e[i]);return t}return t}function je(e,t,i,r,a){if("function"==typeof i)if(i.prototype&&i.prototype.isReactComponent){a=ee(i,t.legacyContext);var l=i.contextType;ue(l=new i(r,"object"==typeof l&&null!==l?l._currentValue2:a),i,r,a),$e(e,t,l,i)}else{a=ze(e,t,i,r,l=ee(i,t.legacyContext));var h=0!==Se;if("object"==typeof a&&null!==a&&"function"==typeof a.render&&void 0===a.$$typeof)ue(a,i,r,l),$e(e,t,a,i);else if(h){r=t.treeContext,t.treeContext=de(r,1,0);try{Ye(e,t,a)}finally{t.treeContext=r}}else Ye(e,t,a)}else{if("string"!=typeof i){switch(i){case q:case Y:case k:case V:case G:case z:return void Ye(e,t,r.children);case j:throw Error(o(343));case U:e:{i=t.blockedBoundary,a=t.blockedSegment,l=r.fallback,r=r.children;var d={id:null,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,forceClientRender:!1,completedSegments:[],byteSize:0,fallbackAbortableTasks:h=new Set,errorDigest:null},c=Be(0,a.chunks.length,d,a.formatContext,!1,!1);a.children.push(c),a.lastPushedText=!1;var p=Be(0,0,null,a.formatContext,!1,!1);p.parentFlushed=!0,t.blockedBoundary=d,t.blockedSegment=p;try{if(Xe(e,t,r),e.responseState.generateStaticMarkup||p.lastPushedText&&p.textEmbedded&&p.chunks.push("\x3c!-- --\x3e"),p.status=1,Ze(d,p),0===d.pendingTasks)break e}catch(t){p.status=4,d.forceClientRender=!0,d.errorDigest=We(e,t)}finally{t.blockedBoundary=i,t.blockedSegment=a}t=He(e,l,i,c,h,t.legacyContext,t.context,t.treeContext),e.pingedTasks.push(t)}return}if("object"==typeof i&&null!==i)switch(i.$$typeof){case W:if(r=ze(e,t,i.render,r,a),0!==Se){i=t.treeContext,t.treeContext=de(i,1,0);try{Ye(e,t,r)}finally{t.treeContext=i}}else Ye(e,t,r);return;case $:return void je(e,t,i=i.type,r=Ke(i,r),a);case H:if(a=r.children,i=i._context,r=r.value,l=i._currentValue2,i._currentValue2=r,te=r={parent:h=te,depth:null===h?0:h.depth+1,context:i,parentValue:l,value:r},t.context=r,Ye(e,t,a),null===(e=te))throw Error(o(403));return r=e.parentValue,e.context._currentValue2=r===X?e.context._defaultValue:r,e=te=e.parent,void(t.context=e);case B:return void Ye(e,t,r=(r=r.children)(i._currentValue2));case K:return void je(e,t,i=(a=i._init)(i._payload),r=Ke(i,r),void 0)}throw Error(o(130,null==i?i:typeof i,""))}switch(l=function(e,t,i,r,a){switch(t){case"select":e.push(F("select"));var l=null,h=null;for(g in i)if(n.call(i,g)){var d=i[g];if(null!=d)switch(g){case"children":l=d;break;case"dangerouslySetInnerHTML":h=d;break;case"defaultValue":case"value":break;default:R(e,r,g,d)}}return e.push(">"),D(e,h,l),l;case"option":h=a.selectedValue,e.push(F("option"));var c=d=null,p=null,g=null;for(l in i)if(n.call(i,l)){var m=i[l];if(null!=m)switch(l){case"children":d=m;break;case"selected":p=m;break;case"dangerouslySetInnerHTML":g=m;break;case"value":c=m;default:R(e,r,l,m)}}if(null!=h)if(i=null!==c?""+c:function(e){var t="";return s.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(d),y(h)){for(r=0;r<h.length;r++)if(""+h[r]===i){e.push(' selected=""');break}}else""+h===i&&e.push(' selected=""');else p&&e.push(' selected=""');return e.push(">"),D(e,g,d),d;case"textarea":for(d in e.push(F("textarea")),g=h=l=null,i)if(n.call(i,d)&&null!=(c=i[d]))switch(d){case"children":g=c;break;case"value":l=c;break;case"defaultValue":h=c;break;case"dangerouslySetInnerHTML":throw Error(o(91));default:R(e,r,d,c)}if(null===l&&null!==h&&(l=h),e.push(">"),null!=g){if(null!=l)throw Error(o(92));if(y(g)&&1<g.length)throw Error(o(93));l=""+g}return"string"==typeof l&&"\n"===l[0]&&e.push("\n"),null!==l&&e.push(C(""+l)),null;case"input":for(h in e.push(F("input")),c=g=d=l=null,i)if(n.call(i,h)&&null!=(p=i[h]))switch(h){case"children":case"dangerouslySetInnerHTML":throw Error(o(399,"input"));case"defaultChecked":c=p;break;case"defaultValue":d=p;break;case"checked":g=p;break;case"value":l=p;break;default:R(e,r,h,p)}return null!==g?R(e,r,"checked",g):null!==c&&R(e,r,"checked",c),null!==l?R(e,r,"value",l):null!==d&&R(e,r,"value",d),e.push("/>"),null;case"menuitem":for(var f in e.push(F("menuitem")),i)if(n.call(i,f)&&null!=(l=i[f]))switch(f){case"children":case"dangerouslySetInnerHTML":throw Error(o(400));default:R(e,r,f,l)}return e.push(">"),null;case"title":for(m in e.push(F("title")),l=null,i)if(n.call(i,m)&&null!=(h=i[m]))switch(m){case"children":l=h;break;case"dangerouslySetInnerHTML":throw Error(o(434));default:R(e,r,m,h)}return e.push(">"),l;case"listing":case"pre":for(c in e.push(F(t)),h=l=null,i)if(n.call(i,c)&&null!=(d=i[c]))switch(c){case"children":l=d;break;case"dangerouslySetInnerHTML":h=d;break;default:R(e,r,c,d)}if(e.push(">"),null!=h){if(null!=l)throw Error(o(60));if("object"!=typeof h||!("__html"in h))throw Error(o(61));null!=(i=h.__html)&&("string"==typeof i&&0<i.length&&"\n"===i[0]?e.push("\n",i):e.push(""+i))}return"string"==typeof l&&"\n"===l[0]&&e.push("\n"),l;case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":for(var v in e.push(F(t)),i)if(n.call(i,v)&&null!=(l=i[v]))switch(v){case"children":case"dangerouslySetInnerHTML":throw Error(o(399,t));default:R(e,r,v,l)}return e.push("/>"),null;case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return T(e,i,t,r);case"html":return 0===a.insertionMode&&e.push("<!DOCTYPE html>"),T(e,i,t,r);default:if(-1===t.indexOf("-")&&"string"!=typeof i.is)return T(e,i,t,r);for(p in e.push(F(t)),h=l=null,i)if(n.call(i,p)&&null!=(d=i[p]))switch(p){case"children":l=d;break;case"dangerouslySetInnerHTML":h=d;break;case"style":b(e,r,d);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":break;default:u(p)&&"function"!=typeof d&&"symbol"!=typeof d&&e.push(" ",p,'="',C(d),'"')}return e.push(">"),D(e,h,l),l}}((a=t.blockedSegment).chunks,i,r,e.responseState,a.formatContext),a.lastPushedText=!1,h=a.formatContext,a.formatContext=function(e,t,i){switch(t){case"select":return E(1,null!=i.value?i.value:i.defaultValue);case"svg":return E(2,null);case"math":return E(3,null);case"foreignObject":return E(1,null);case"table":return E(4,null);case"thead":case"tbody":case"tfoot":return E(5,null);case"colgroup":return E(7,null);case"tr":return E(6,null)}return 4<=e.insertionMode||0===e.insertionMode?E(1,null):e}(h,i,r),Xe(e,t,l),a.formatContext=h,i){case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"input":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":break;default:a.chunks.push("</",i,">")}a.lastPushedText=!1}}function Ye(e,t,i){if(t.node=i,"object"==typeof i&&null!==i){switch(i.$$typeof){case _:return void je(e,t,i.type,i.props,i.ref);case O:throw Error(o(257));case K:var s=i._init;return void Ye(e,t,i=s(i._payload))}if(y(i))return void qe(e,t,i);if((s=null===i||"object"!=typeof i?null:"function"==typeof(s=Q&&i[Q]||i["@@iterator"])?s:null)&&(s=s.call(i))){if(!(i=s.next()).done){var n=[];do{n.push(i.value),i=s.next()}while(!i.done);qe(e,t,n)}return}throw e=Object.prototype.toString.call(i),Error(o(31,"[object Object]"===e?"object with keys {"+Object.keys(i).join(", ")+"}":e))}"string"==typeof i?(s=t.blockedSegment).lastPushedText=I(t.blockedSegment.chunks,i,e.responseState,s.lastPushedText):"number"==typeof i&&((s=t.blockedSegment).lastPushedText=I(t.blockedSegment.chunks,""+i,e.responseState,s.lastPushedText))}function qe(e,t,i){for(var s=i.length,o=0;o<s;o++){var n=t.treeContext;t.treeContext=de(n,s,o);try{Xe(e,t,i[o])}finally{t.treeContext=n}}}function Xe(e,t,i){var s=t.blockedSegment.formatContext,o=t.legacyContext,n=t.context;try{return Ye(e,t,i)}catch(l){if(Pe(),"object"!=typeof l||null===l||"function"!=typeof l.then)throw t.blockedSegment.formatContext=s,t.legacyContext=o,t.context=n,ae(n),l;i=l;var r=t.blockedSegment,a=Be(0,r.chunks.length,null,r.formatContext,r.lastPushedText,!0);r.children.push(a),r.lastPushedText=!1,e=He(e,t.node,t.blockedBoundary,a,t.abortSet,t.legacyContext,t.context,t.treeContext).ping,i.then(e,e),t.blockedSegment.formatContext=s,t.legacyContext=o,t.context=n,ae(n)}}function Qe(e){var t=e.blockedBoundary;(e=e.blockedSegment).status=3,et(this,t,e)}function Je(e,t,i){var s=e.blockedBoundary;e.blockedSegment.status=3,null===s?(t.allPendingTasks--,2!==t.status&&(t.status=2,null!==t.destination&&t.destination.push(null))):(s.pendingTasks--,s.forceClientRender||(s.forceClientRender=!0,e=void 0===i?Error(o(432)):i,s.errorDigest=t.onError(e),s.parentFlushed&&t.clientRenderedBoundaries.push(s)),s.fallbackAbortableTasks.forEach((function(e){return Je(e,t,i)})),s.fallbackAbortableTasks.clear(),t.allPendingTasks--,0===t.allPendingTasks&&(s=t.onAllReady)())}function Ze(e,t){if(0===t.chunks.length&&1===t.children.length&&null===t.children[0].boundary){var i=t.children[0];i.id=t.id,i.parentFlushed=!0,1===i.status&&Ze(e,i)}else e.completedSegments.push(t)}function et(e,t,i){if(null===t){if(i.parentFlushed){if(null!==e.completedRootSegment)throw Error(o(389));e.completedRootSegment=i}e.pendingRootTasks--,0===e.pendingRootTasks&&(e.onShellError=Ve,(t=e.onShellReady)())}else t.pendingTasks--,t.forceClientRender||(0===t.pendingTasks?(i.parentFlushed&&1===i.status&&Ze(t,i),t.parentFlushed&&e.completedBoundaries.push(t),t.fallbackAbortableTasks.forEach(Qe,e),t.fallbackAbortableTasks.clear()):i.parentFlushed&&1===i.status&&(Ze(t,i),1===t.completedSegments.length&&t.parentFlushed&&e.partialBoundaries.push(t)));e.allPendingTasks--,0===e.allPendingTasks&&(e=e.onAllReady)()}function tt(e){if(2!==e.status){var t=te,i=Ge.current;Ge.current=_e;var s=Oe;Oe=e.responseState;try{var o,n=e.pingedTasks;for(o=0;o<n.length;o++){var r=n[o],a=e,l=r.blockedSegment;if(0===l.status){ae(r.context);try{Ye(a,r,r.node),a.responseState.generateStaticMarkup||l.lastPushedText&&l.textEmbedded&&l.chunks.push("\x3c!-- --\x3e"),r.abortSet.delete(r),l.status=1,et(a,r.blockedBoundary,l)}catch(e){if(Pe(),"object"==typeof e&&null!==e&&"function"==typeof e.then){var u=r.ping;e.then(u,u)}else{r.abortSet.delete(r),l.status=4;var h=r.blockedBoundary,d=e,c=We(a,d);null===h?Ue(a,d):(h.pendingTasks--,h.forceClientRender||(h.forceClientRender=!0,h.errorDigest=c,h.parentFlushed&&a.clientRenderedBoundaries.push(h))),a.allPendingTasks--,0===a.allPendingTasks&&(0,a.onAllReady)()}}}}n.splice(0,o),null!==e.destination&&at(e,e.destination)}catch(t){We(e,t),Ue(e,t)}finally{Oe=s,Ge.current=i,i===_e&&ae(t)}}}function it(e,t,i){switch(i.parentFlushed=!0,i.status){case 0:var s=i.id=e.nextSegmentId++;return i.lastPushedText=!1,i.textEmbedded=!1,e=e.responseState,t.push('<template id="'),t.push(e.placeholderPrefix),e=s.toString(16),t.push(e),t.push('"></template>');case 1:i.status=2;var n=!0;s=i.chunks;var r=0;i=i.children;for(var a=0;a<i.length;a++){for(n=i[a];r<n.index;r++)t.push(s[r]);n=st(e,t,n)}for(;r<s.length-1;r++)t.push(s[r]);return r<s.length&&(n=t.push(s[r])),n;default:throw Error(o(390))}}function st(e,t,i){var s=i.boundary;if(null===s)return it(e,t,i);if(s.parentFlushed=!0,s.forceClientRender)return e.responseState.generateStaticMarkup||(s=s.errorDigest,t.push("\x3c!--$!--\x3e"),t.push("<template"),s&&(t.push(' data-dgst="'),s=C(s),t.push(s),t.push('"')),t.push("></template>")),it(e,t,i),!!e.responseState.generateStaticMarkup||t.push("\x3c!--/$--\x3e");if(0<s.pendingTasks){s.rootSegmentID=e.nextSegmentId++,0<s.completedSegments.length&&e.partialBoundaries.push(s);var n=e.responseState,r=n.nextSuspenseID++;return n=n.boundaryPrefix+r.toString(16),s=s.id=n,M(t,e.responseState,s),it(e,t,i),t.push("\x3c!--/$--\x3e")}if(s.byteSize>e.progressiveChunkSize)return s.rootSegmentID=e.nextSegmentId++,e.completedBoundaries.push(s),M(t,e.responseState,s.id),it(e,t,i),t.push("\x3c!--/$--\x3e");if(e.responseState.generateStaticMarkup||t.push("\x3c!--$--\x3e"),1!==(i=s.completedSegments).length)throw Error(o(391));return st(e,t,i[0]),!!e.responseState.generateStaticMarkup||t.push("\x3c!--/$--\x3e")}function ot(e,t,i){return function(e,t,i,s){switch(i.insertionMode){case 0:case 1:return e.push('<div hidden id="'),e.push(t.segmentPrefix),t=s.toString(16),e.push(t),e.push('">');case 2:return e.push('<svg aria-hidden="true" style="display:none" id="'),e.push(t.segmentPrefix),t=s.toString(16),e.push(t),e.push('">');case 3:return e.push('<math aria-hidden="true" style="display:none" id="'),e.push(t.segmentPrefix),t=s.toString(16),e.push(t),e.push('">');case 4:return e.push('<table hidden id="'),e.push(t.segmentPrefix),t=s.toString(16),e.push(t),e.push('">');case 5:return e.push('<table hidden><tbody id="'),e.push(t.segmentPrefix),t=s.toString(16),e.push(t),e.push('">');case 6:return e.push('<table hidden><tr id="'),e.push(t.segmentPrefix),t=s.toString(16),e.push(t),e.push('">');case 7:return e.push('<table hidden><colgroup id="'),e.push(t.segmentPrefix),t=s.toString(16),e.push(t),e.push('">');default:throw Error(o(397))}}(t,e.responseState,i.formatContext,i.id),st(e,t,i),function(e,t){switch(t.insertionMode){case 0:case 1:return e.push("</div>");case 2:return e.push("</svg>");case 3:return e.push("</math>");case 4:return e.push("</table>");case 5:return e.push("</tbody></table>");case 6:return e.push("</tr></table>");case 7:return e.push("</colgroup></table>");default:throw Error(o(397))}}(t,i.formatContext)}function nt(e,t,i){for(var s=i.completedSegments,n=0;n<s.length;n++)rt(e,t,i,s[n]);if(s.length=0,e=e.responseState,s=i.id,i=i.rootSegmentID,t.push(e.startInlineScript),e.sentCompleteBoundaryFunction?t.push('$RC("'):(e.sentCompleteBoundaryFunction=!0,t.push('function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("')),null===s)throw Error(o(395));return i=i.toString(16),t.push(s),t.push('","'),t.push(e.segmentPrefix),t.push(i),t.push('")<\/script>')}function rt(e,t,i,s){if(2===s.status)return!0;var n=s.id;if(-1===n){if(-1===(s.id=i.rootSegmentID))throw Error(o(392));return ot(e,t,s)}return ot(e,t,s),e=e.responseState,t.push(e.startInlineScript),e.sentCompleteSegmentFunction?t.push('$RS("'):(e.sentCompleteSegmentFunction=!0,t.push('function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("')),t.push(e.segmentPrefix),n=n.toString(16),t.push(n),t.push('","'),t.push(e.placeholderPrefix),t.push(n),t.push('")<\/script>')}function at(e,t){try{var i=e.completedRootSegment;if(null!==i&&0===e.pendingRootTasks){st(e,t,i),e.completedRootSegment=null;var s=e.responseState.bootstrapChunks;for(i=0;i<s.length-1;i++)t.push(s[i]);i<s.length&&t.push(s[i])}var n,r=e.clientRenderedBoundaries;for(n=0;n<r.length;n++){var a=r[n];s=t;var l=e.responseState,u=a.id,h=a.errorDigest,d=a.errorMessage,c=a.errorComponentStack;if(s.push(l.startInlineScript),l.sentClientRenderFunction?s.push('$RX("'):(l.sentClientRenderFunction=!0,s.push('function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("')),null===u)throw Error(o(395));if(s.push(u),s.push('"'),h||d||c){s.push(",");var p=x(h||"");s.push(p)}if(d||c){s.push(",");var g=x(d||"");s.push(g)}if(c){s.push(",");var m=x(c);s.push(m)}if(!s.push(")<\/script>"))return e.destination=null,n++,void r.splice(0,n)}r.splice(0,n);var f=e.completedBoundaries;for(n=0;n<f.length;n++)if(!nt(e,t,f[n]))return e.destination=null,n++,void f.splice(0,n);f.splice(0,n);var C=e.partialBoundaries;for(n=0;n<C.length;n++){var v=C[n];e:{r=e,a=t;var w=v.completedSegments;for(l=0;l<w.length;l++)if(!rt(r,a,v,w[l])){l++,w.splice(0,l);var y=!1;break e}w.splice(0,l),y=!0}if(!y)return e.destination=null,n++,void C.splice(0,n)}C.splice(0,n);var E=e.completedBoundaries;for(n=0;n<E.length;n++)if(!nt(e,t,E[n]))return e.destination=null,n++,void E.splice(0,n);E.splice(0,n)}finally{0===e.allPendingTasks&&0===e.pingedTasks.length&&0===e.clientRenderedBoundaries.length&&0===e.completedBoundaries.length&&t.push(null)}}function lt(e,t){try{var i=e.abortableTasks;i.forEach((function(i){return Je(i,e,t)})),i.clear(),null!==e.destination&&at(e,e.destination)}catch(t){We(e,t),Ue(e,t)}}function ut(){}function ht(e,t,i,s){var n=!1,r=null,a="",l={push:function(e){return null!==e&&(a+=e),!0},destroy:function(e){n=!0,r=e}},u=!1;if(e=function(e,t,i,s,o,n,r){var a=[],l=new Set;return(i=Be(t={destination:null,responseState:t,progressiveChunkSize:s,status:0,fatalError:null,nextSegmentId:0,allPendingTasks:0,pendingRootTasks:0,completedRootSegment:null,abortableTasks:l,pingedTasks:a,clientRenderedBoundaries:[],completedBoundaries:[],partialBoundaries:[],onError:void 0===o?ke:o,onAllReady:Ve,onShellReady:void 0===r?Ve:r,onShellError:Ve,onFatalError:Ve},0,null,i,!1,!1)).parentFlushed=!0,e=He(t,e,null,i,l,Z,null,he),a.push(e),t}(e,function(e,t){return{bootstrapChunks:[],startInlineScript:"<script>",placeholderPrefix:(t=void 0===t?"":t)+"P:",segmentPrefix:t+"S:",boundaryPrefix:t+"B:",idPrefix:t,nextSuspenseID:0,sentCompleteSegmentFunction:!1,sentCompleteBoundaryFunction:!1,sentClientRenderFunction:!1,generateStaticMarkup:e}}(i,t?t.identifierPrefix:void 0),{insertionMode:1,selectedValue:null},1/0,ut,0,(function(){u=!0})),tt(e),lt(e,s),1===e.status)e.status=2,l.destroy(e.fatalError);else if(2!==e.status&&null===e.destination){e.destination=l;try{at(e,l)}catch(t){We(e,t),Ue(e,t)}}if(n)throw r;if(!u)throw Error(o(426));return a}t.renderToNodeStream=function(){throw Error(o(207))},t.renderToStaticMarkup=function(e,t){return ht(e,t,!0,'The server used "renderToStaticMarkup" which does not support Suspense. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server')},t.renderToStaticNodeStream=function(){throw Error(o(208))},t.renderToString=function(e,t){return ht(e,t,!1,'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server')},t.version="18.3.1"},931:(e,t,i)=>{"use strict";var s=i(609);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=null,r=0;function a(e,t){if(0!==t.length)if(512<t.length)0<r&&(e.enqueue(new Uint8Array(n.buffer,0,r)),n=new Uint8Array(512),r=0),e.enqueue(t);else{var i=n.length-r;i<t.length&&(0===i?e.enqueue(n):(n.set(t.subarray(0,i),r),e.enqueue(n),t=t.subarray(i)),n=new Uint8Array(512),r=0),n.set(t,r),r+=t.length}}function l(e,t){return a(e,t),!0}function u(e){n&&0<r&&(e.enqueue(new Uint8Array(n.buffer,0,r)),n=null,r=0)}var h=new TextEncoder;function d(e){return h.encode(e)}function c(e){return h.encode(e)}function p(e,t){"function"==typeof e.error?e.error(t):e.close()}var g=Object.prototype.hasOwnProperty,m=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f={},C={};function v(e){return!!g.call(C,e)||!g.call(f,e)&&(m.test(e)?C[e]=!0:(f[e]=!0,!1))}function w(e,t,i,s,o,n,r){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=s,this.attributeNamespace=o,this.mustUseProperty=i,this.propertyName=e,this.type=t,this.sanitizeURL=n,this.removeEmptyString=r}var y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){y[e]=new w(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];y[t]=new w(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){y[e]=new w(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){y[e]=new w(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){y[e]=new w(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){y[e]=new w(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){y[e]=new w(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){y[e]=new w(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){y[e]=new w(e,5,!1,e.toLowerCase(),null,!1,!1)}));var E=/[\-:]([a-z])/g;function S(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(E,S);y[t]=new w(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(E,S);y[t]=new w(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(E,S);y[t]=new w(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){y[e]=new w(e,1,!1,e.toLowerCase(),null,!1,!1)})),y.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){y[e]=new w(e,1,!1,e.toLowerCase(),null,!0,!0)}));var b={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},R=["Webkit","ms","Moz","O"];Object.keys(b).forEach((function(e){R.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),b[t]=b[e]}))}));var D=/["'&<>]/;function T(e){if("boolean"==typeof e||"number"==typeof e)return""+e;e=""+e;var t=D.exec(e);if(t){var i,s="",o=0;for(i=t.index;i<e.length;i++){switch(e.charCodeAt(i)){case 34:t="&quot;";break;case 38:t="&amp;";break;case 39:t="&#x27;";break;case 60:t="&lt;";break;case 62:t="&gt;";break;default:continue}o!==i&&(s+=e.substring(o,i)),o=i+1,s+=t}e=o!==i?s+e.substring(o,i):s}return e}var A=/([A-Z])/g,P=/^ms-/,F=Array.isArray,M=c("<script>"),L=c("<\/script>"),x=c('<script src="'),I=c('<script type="module" src="'),N=c('" async=""><\/script>'),_=/(<\/|<)(s)(cript)/gi;function O(e,t,i,s){return t+("s"===i?"\\u0073":"\\u0053")+s}function G(e,t){return{insertionMode:e,selectedValue:t}}var k=c("\x3c!-- --\x3e");function V(e,t,i,s){return""===t?s:(s&&e.push(k),e.push(d(T(t))),!0)}var H=new Map,B=c(' style="'),W=c(":"),U=c(";");function z(e,t,i){if("object"!=typeof i)throw Error(o(62));for(var s in t=!0,i)if(g.call(i,s)){var n=i[s];if(null!=n&&"boolean"!=typeof n&&""!==n){if(0===s.indexOf("--")){var r=d(T(s));n=d(T((""+n).trim()))}else{r=s;var a=H.get(r);void 0!==a||(a=c(T(r.replace(A,"-$1").toLowerCase().replace(P,"-ms-"))),H.set(r,a)),r=a,n="number"==typeof n?0===n||g.call(b,s)?d(""+n):d(n+"px"):d(T((""+n).trim()))}t?(t=!1,e.push(B,r,W,n)):e.push(U,r,W,n)}}t||e.push(j)}var $=c(" "),K=c('="'),j=c('"'),Y=c('=""');function q(e,t,i,s){switch(i){case"style":return void z(e,t,s);case"defaultValue":case"defaultChecked":case"innerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":return}if(!(2<i.length)||"o"!==i[0]&&"O"!==i[0]||"n"!==i[1]&&"N"!==i[1])if(null!==(t=y.hasOwnProperty(i)?y[i]:null)){switch(typeof s){case"function":case"symbol":return;case"boolean":if(!t.acceptsBooleans)return}switch(i=d(t.attributeName),t.type){case 3:s&&e.push($,i,Y);break;case 4:!0===s?e.push($,i,Y):!1!==s&&e.push($,i,K,d(T(s)),j);break;case 5:isNaN(s)||e.push($,i,K,d(T(s)),j);break;case 6:!isNaN(s)&&1<=s&&e.push($,i,K,d(T(s)),j);break;default:t.sanitizeURL&&(s=""+s),e.push($,i,K,d(T(s)),j)}}else if(v(i)){switch(typeof s){case"function":case"symbol":return;case"boolean":if("data-"!==(t=i.toLowerCase().slice(0,5))&&"aria-"!==t)return}e.push($,d(i),K,d(T(s)),j)}}var X=c(">"),Q=c("/>");function J(e,t,i){if(null!=t){if(null!=i)throw Error(o(60));if("object"!=typeof t||!("__html"in t))throw Error(o(61));null!=(t=t.__html)&&e.push(d(""+t))}}var Z=c(' selected=""');function ee(e,t,i,s){e.push(oe(i));var o,n=i=null;for(o in t)if(g.call(t,o)){var r=t[o];if(null!=r)switch(o){case"children":i=r;break;case"dangerouslySetInnerHTML":n=r;break;default:q(e,s,o,r)}}return e.push(X),J(e,n,i),"string"==typeof i?(e.push(d(T(i))),null):i}var te=c("\n"),ie=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,se=new Map;function oe(e){var t=se.get(e);if(void 0===t){if(!ie.test(e))throw Error(o(65,e));t=c("<"+e),se.set(e,t)}return t}var ne=c("<!DOCTYPE html>");var re=c("</"),ae=c(">"),le=c('<template id="'),ue=c('"></template>'),he=c("\x3c!--$--\x3e"),de=c('\x3c!--$?--\x3e<template id="'),ce=c('"></template>'),pe=c("\x3c!--$!--\x3e"),ge=c("\x3c!--/$--\x3e"),me=c("<template"),fe=c('"'),Ce=c(' data-dgst="');c(' data-msg="'),c(' data-stck="');var ve=c("></template>");function we(e,t,i){if(a(e,de),null===i)throw Error(o(395));return a(e,i),l(e,ce)}var ye=c('<div hidden id="'),Ee=c('">'),Se=c("</div>"),be=c('<svg aria-hidden="true" style="display:none" id="'),Re=c('">'),De=c("</svg>"),Te=c('<math aria-hidden="true" style="display:none" id="'),Ae=c('">'),Pe=c("</math>"),Fe=c('<table hidden id="'),Me=c('">'),Le=c("</table>"),xe=c('<table hidden><tbody id="'),Ie=c('">'),Ne=c("</tbody></table>"),_e=c('<table hidden><tr id="'),Oe=c('">'),Ge=c("</tr></table>"),ke=c('<table hidden><colgroup id="'),Ve=c('">'),He=c("</colgroup></table>"),Be=c('function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("'),We=c('$RS("'),Ue=c('","'),ze=c('")<\/script>'),$e=c('function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("'),Ke=c('$RC("'),je=c('","'),Ye=c('")<\/script>'),qe=c('function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("'),Xe=c('$RX("'),Qe=c('"'),Je=c(")<\/script>"),Ze=c(","),et=/[<\u2028\u2029]/g;function tt(e){return JSON.stringify(e).replace(et,(function(e){switch(e){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}}))}var it=Object.assign,st=Symbol.for("react.element"),ot=Symbol.for("react.portal"),nt=Symbol.for("react.fragment"),rt=Symbol.for("react.strict_mode"),at=Symbol.for("react.profiler"),lt=Symbol.for("react.provider"),ut=Symbol.for("react.context"),ht=Symbol.for("react.forward_ref"),dt=Symbol.for("react.suspense"),ct=Symbol.for("react.suspense_list"),pt=Symbol.for("react.memo"),gt=Symbol.for("react.lazy"),mt=Symbol.for("react.scope"),ft=Symbol.for("react.debug_trace_mode"),Ct=Symbol.for("react.legacy_hidden"),vt=Symbol.for("react.default_value"),wt=Symbol.iterator;function yt(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case nt:return"Fragment";case ot:return"Portal";case at:return"Profiler";case rt:return"StrictMode";case dt:return"Suspense";case ct:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case ut:return(e.displayName||"Context")+".Consumer";case lt:return(e._context.displayName||"Context")+".Provider";case ht:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case pt:return null!==(t=e.displayName||null)?t:yt(e.type)||"Memo";case gt:t=e._payload,e=e._init;try{return yt(e(t))}catch(e){}}return null}var Et={};function St(e,t){if(!(e=e.contextTypes))return Et;var i,s={};for(i in e)s[i]=t[i];return s}var bt=null;function Rt(e,t){if(e!==t){e.context._currentValue=e.parentValue,e=e.parent;var i=t.parent;if(null===e){if(null!==i)throw Error(o(401))}else{if(null===i)throw Error(o(401));Rt(e,i)}t.context._currentValue=t.value}}function Dt(e){e.context._currentValue=e.parentValue,null!==(e=e.parent)&&Dt(e)}function Tt(e){var t=e.parent;null!==t&&Tt(t),e.context._currentValue=e.value}function At(e,t){if(e.context._currentValue=e.parentValue,null===(e=e.parent))throw Error(o(402));e.depth===t.depth?Rt(e,t):At(e,t)}function Pt(e,t){var i=t.parent;if(null===i)throw Error(o(402));e.depth===i.depth?Rt(e,i):Pt(e,i),t.context._currentValue=t.value}function Ft(e){var t=bt;t!==e&&(null===t?Tt(e):null===e?Dt(t):t.depth===e.depth?Rt(t,e):t.depth>e.depth?At(t,e):Pt(t,e),bt=e)}var Mt={isMounted:function(){return!1},enqueueSetState:function(e,t){null!==(e=e._reactInternals).queue&&e.queue.push(t)},enqueueReplaceState:function(e,t){(e=e._reactInternals).replace=!0,e.queue=[t]},enqueueForceUpdate:function(){}};function Lt(e,t,i,s){var o=void 0!==e.state?e.state:null;e.updater=Mt,e.props=i,e.state=o;var n={queue:[],replace:!1};e._reactInternals=n;var r=t.contextType;if(e.context="object"==typeof r&&null!==r?r._currentValue:s,"function"==typeof(r=t.getDerivedStateFromProps)&&(o=null==(r=r(i,o))?o:it({},o,r),e.state=o),"function"!=typeof t.getDerivedStateFromProps&&"function"!=typeof e.getSnapshotBeforeUpdate&&("function"==typeof e.UNSAFE_componentWillMount||"function"==typeof e.componentWillMount))if(t=e.state,"function"==typeof e.componentWillMount&&e.componentWillMount(),"function"==typeof e.UNSAFE_componentWillMount&&e.UNSAFE_componentWillMount(),t!==e.state&&Mt.enqueueReplaceState(e,e.state,null),null!==n.queue&&0<n.queue.length)if(t=n.queue,r=n.replace,n.queue=null,n.replace=!1,r&&1===t.length)e.state=t[0];else{for(n=r?t[0]:e.state,o=!0,r=r?1:0;r<t.length;r++){var a=t[r];null!=(a="function"==typeof a?a.call(e,n,i,s):a)&&(o?(o=!1,n=it({},n,a)):it(n,a))}e.state=n}else n.queue=null}var xt={id:1,overflow:""};function It(e,t,i){var s=e.id;e=e.overflow;var o=32-Nt(s)-1;s&=~(1<<o),i+=1;var n=32-Nt(t)+o;if(30<n){var r=o-o%5;return n=(s&(1<<r)-1).toString(32),s>>=r,o-=r,{id:1<<32-Nt(t)+o|i<<o|s,overflow:n+e}}return{id:1<<n|i<<o|s,overflow:e}}var Nt=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(_t(e)/Ot|0)|0},_t=Math.log,Ot=Math.LN2,Gt="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},kt=null,Vt=null,Ht=null,Bt=null,Wt=!1,Ut=!1,zt=0,$t=null,Kt=0;function jt(){if(null===kt)throw Error(o(321));return kt}function Yt(){if(0<Kt)throw Error(o(312));return{memoizedState:null,queue:null,next:null}}function qt(){return null===Bt?null===Ht?(Wt=!1,Ht=Bt=Yt()):(Wt=!0,Bt=Ht):null===Bt.next?(Wt=!1,Bt=Bt.next=Yt()):(Wt=!0,Bt=Bt.next),Bt}function Xt(){Vt=kt=null,Ut=!1,Ht=null,Kt=0,Bt=$t=null}function Qt(e,t){return"function"==typeof t?t(e):t}function Jt(e,t,i){if(kt=jt(),Bt=qt(),Wt){var s=Bt.queue;if(t=s.dispatch,null!==$t&&void 0!==(i=$t.get(s))){$t.delete(s),s=Bt.memoizedState;do{s=e(s,i.action),i=i.next}while(null!==i);return Bt.memoizedState=s,[s,t]}return[Bt.memoizedState,t]}return e=e===Qt?"function"==typeof t?t():t:void 0!==i?i(t):t,Bt.memoizedState=e,e=(e=Bt.queue={last:null,dispatch:null}).dispatch=ei.bind(null,kt,e),[Bt.memoizedState,e]}function Zt(e,t){if(kt=jt(),t=void 0===t?null:t,null!==(Bt=qt())){var i=Bt.memoizedState;if(null!==i&&null!==t){var s=i[1];e:if(null===s)s=!1;else{for(var o=0;o<s.length&&o<t.length;o++)if(!Gt(t[o],s[o])){s=!1;break e}s=!0}if(s)return i[0]}}return e=e(),Bt.memoizedState=[e,t],e}function ei(e,t,i){if(25<=Kt)throw Error(o(301));if(e===kt)if(Ut=!0,e={action:i,next:null},null===$t&&($t=new Map),void 0===(i=$t.get(t)))$t.set(t,e);else{for(t=i;null!==t.next;)t=t.next;t.next=e}}function ti(){throw Error(o(394))}function ii(){}var si={readContext:function(e){return e._currentValue},useContext:function(e){return jt(),e._currentValue},useMemo:Zt,useReducer:Jt,useRef:function(e){kt=jt();var t=(Bt=qt()).memoizedState;return null===t?(e={current:e},Bt.memoizedState=e):t},useState:function(e){return Jt(Qt,e)},useInsertionEffect:ii,useLayoutEffect:function(){},useCallback:function(e,t){return Zt((function(){return e}),t)},useImperativeHandle:ii,useEffect:ii,useDebugValue:ii,useDeferredValue:function(e){return jt(),e},useTransition:function(){return jt(),[!1,ti]},useId:function(){var e=Vt.treeContext,t=e.overflow;e=((e=e.id)&~(1<<32-Nt(e)-1)).toString(32)+t;var i=oi;if(null===i)throw Error(o(404));return t=zt++,e=":"+i.idPrefix+"R"+e,0<t&&(e+="H"+t.toString(32)),e+":"},useMutableSource:function(e,t){return jt(),t(e._source)},useSyncExternalStore:function(e,t,i){if(void 0===i)throw Error(o(407));return i()}},oi=null,ni=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher;function ri(e){return console.error(e),null}function ai(){}function li(e,t,i,s,o,n,r,a){e.allPendingTasks++,null===i?e.pendingRootTasks++:i.pendingTasks++;var l={node:t,ping:function(){var t=e.pingedTasks;t.push(l),1===t.length&&bi(e)},blockedBoundary:i,blockedSegment:s,abortSet:o,legacyContext:n,context:r,treeContext:a};return o.add(l),l}function ui(e,t,i,s,o,n){return{status:0,id:-1,index:t,parentFlushed:!1,chunks:[],children:[],formatContext:s,boundary:i,lastPushedText:o,textEmbedded:n}}function hi(e,t){if(null!=(e=e.onError(t))&&"string"!=typeof e)throw Error('onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "'+typeof e+'" instead');return e}function di(e,t){var i=e.onShellError;i(t),(i=e.onFatalError)(t),null!==e.destination?(e.status=2,p(e.destination,t)):(e.status=1,e.fatalError=t)}function ci(e,t,i,s,o){for(kt={},Vt=t,zt=0,e=i(s,o);Ut;)Ut=!1,zt=0,Kt+=1,Bt=null,e=i(s,o);return Xt(),e}function pi(e,t,i,s){var n=i.render(),r=s.childContextTypes;if(null!=r){var a=t.legacyContext;if("function"!=typeof i.getChildContext)s=a;else{for(var l in i=i.getChildContext())if(!(l in r))throw Error(o(108,yt(s)||"Unknown",l));s=it({},a,i)}t.legacyContext=s,fi(e,t,n),t.legacyContext=a}else fi(e,t,n)}function gi(e,t){if(e&&e.defaultProps){for(var i in t=it({},t),e=e.defaultProps)void 0===t[i]&&(t[i]=e[i]);return t}return t}function mi(e,t,i,n,r){if("function"==typeof i)if(i.prototype&&i.prototype.isReactComponent){r=St(i,t.legacyContext);var a=i.contextType;Lt(a=new i(n,"object"==typeof a&&null!==a?a._currentValue:r),i,n,r),pi(e,t,a,i)}else{r=ci(e,t,i,n,a=St(i,t.legacyContext));var l=0!==zt;if("object"==typeof r&&null!==r&&"function"==typeof r.render&&void 0===r.$$typeof)Lt(r,i,n,a),pi(e,t,r,i);else if(l){n=t.treeContext,t.treeContext=It(n,1,0);try{fi(e,t,r)}finally{t.treeContext=n}}else fi(e,t,r)}else{if("string"!=typeof i){switch(i){case Ct:case ft:case rt:case at:case nt:case ct:return void fi(e,t,n.children);case mt:throw Error(o(343));case dt:e:{i=t.blockedBoundary,r=t.blockedSegment,a=n.fallback,n=n.children;var u={id:null,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,forceClientRender:!1,completedSegments:[],byteSize:0,fallbackAbortableTasks:l=new Set,errorDigest:null},h=ui(0,r.chunks.length,u,r.formatContext,!1,!1);r.children.push(h),r.lastPushedText=!1;var c=ui(0,0,null,r.formatContext,!1,!1);c.parentFlushed=!0,t.blockedBoundary=u,t.blockedSegment=c;try{if(vi(e,t,n),c.lastPushedText&&c.textEmbedded&&c.chunks.push(k),c.status=1,Ei(u,c),0===u.pendingTasks)break e}catch(t){c.status=4,u.forceClientRender=!0,u.errorDigest=hi(e,t)}finally{t.blockedBoundary=i,t.blockedSegment=r}t=li(e,a,i,h,l,t.legacyContext,t.context,t.treeContext),e.pingedTasks.push(t)}return}if("object"==typeof i&&null!==i)switch(i.$$typeof){case ht:if(n=ci(e,t,i.render,n,r),0!==zt){i=t.treeContext,t.treeContext=It(i,1,0);try{fi(e,t,n)}finally{t.treeContext=i}}else fi(e,t,n);return;case pt:return void mi(e,t,i=i.type,n=gi(i,n),r);case lt:if(r=n.children,i=i._context,n=n.value,a=i._currentValue,i._currentValue=n,bt=n={parent:l=bt,depth:null===l?0:l.depth+1,context:i,parentValue:a,value:n},t.context=n,fi(e,t,r),null===(e=bt))throw Error(o(403));return n=e.parentValue,e.context._currentValue=n===vt?e.context._defaultValue:n,e=bt=e.parent,void(t.context=e);case ut:return void fi(e,t,n=(n=n.children)(i._currentValue));case gt:return void mi(e,t,i=(r=i._init)(i._payload),n=gi(i,n),void 0)}throw Error(o(130,null==i?i:typeof i,""))}switch(a=function(e,t,i,n,r){switch(t){case"select":e.push(oe("select"));var a=null,l=null;for(p in i)if(g.call(i,p)){var u=i[p];if(null!=u)switch(p){case"children":a=u;break;case"dangerouslySetInnerHTML":l=u;break;case"defaultValue":case"value":break;default:q(e,n,p,u)}}return e.push(X),J(e,l,a),a;case"option":l=r.selectedValue,e.push(oe("option"));var h=u=null,c=null,p=null;for(a in i)if(g.call(i,a)){var m=i[a];if(null!=m)switch(a){case"children":u=m;break;case"selected":c=m;break;case"dangerouslySetInnerHTML":p=m;break;case"value":h=m;default:q(e,n,a,m)}}if(null!=l)if(i=null!==h?""+h:function(e){var t="";return s.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(u),F(l)){for(n=0;n<l.length;n++)if(""+l[n]===i){e.push(Z);break}}else""+l===i&&e.push(Z);else c&&e.push(Z);return e.push(X),J(e,p,u),u;case"textarea":for(u in e.push(oe("textarea")),p=l=a=null,i)if(g.call(i,u)&&null!=(h=i[u]))switch(u){case"children":p=h;break;case"value":a=h;break;case"defaultValue":l=h;break;case"dangerouslySetInnerHTML":throw Error(o(91));default:q(e,n,u,h)}if(null===a&&null!==l&&(a=l),e.push(X),null!=p){if(null!=a)throw Error(o(92));if(F(p)&&1<p.length)throw Error(o(93));a=""+p}return"string"==typeof a&&"\n"===a[0]&&e.push(te),null!==a&&e.push(d(T(""+a))),null;case"input":for(l in e.push(oe("input")),h=p=u=a=null,i)if(g.call(i,l)&&null!=(c=i[l]))switch(l){case"children":case"dangerouslySetInnerHTML":throw Error(o(399,"input"));case"defaultChecked":h=c;break;case"defaultValue":u=c;break;case"checked":p=c;break;case"value":a=c;break;default:q(e,n,l,c)}return null!==p?q(e,n,"checked",p):null!==h&&q(e,n,"checked",h),null!==a?q(e,n,"value",a):null!==u&&q(e,n,"value",u),e.push(Q),null;case"menuitem":for(var f in e.push(oe("menuitem")),i)if(g.call(i,f)&&null!=(a=i[f]))switch(f){case"children":case"dangerouslySetInnerHTML":throw Error(o(400));default:q(e,n,f,a)}return e.push(X),null;case"title":for(m in e.push(oe("title")),a=null,i)if(g.call(i,m)&&null!=(l=i[m]))switch(m){case"children":a=l;break;case"dangerouslySetInnerHTML":throw Error(o(434));default:q(e,n,m,l)}return e.push(X),a;case"listing":case"pre":for(h in e.push(oe(t)),l=a=null,i)if(g.call(i,h)&&null!=(u=i[h]))switch(h){case"children":a=u;break;case"dangerouslySetInnerHTML":l=u;break;default:q(e,n,h,u)}if(e.push(X),null!=l){if(null!=a)throw Error(o(60));if("object"!=typeof l||!("__html"in l))throw Error(o(61));null!=(i=l.__html)&&("string"==typeof i&&0<i.length&&"\n"===i[0]?e.push(te,d(i)):e.push(d(""+i)))}return"string"==typeof a&&"\n"===a[0]&&e.push(te),a;case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":for(var C in e.push(oe(t)),i)if(g.call(i,C)&&null!=(a=i[C]))switch(C){case"children":case"dangerouslySetInnerHTML":throw Error(o(399,t));default:q(e,n,C,a)}return e.push(Q),null;case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return ee(e,i,t,n);case"html":return 0===r.insertionMode&&e.push(ne),ee(e,i,t,n);default:if(-1===t.indexOf("-")&&"string"!=typeof i.is)return ee(e,i,t,n);for(c in e.push(oe(t)),l=a=null,i)if(g.call(i,c)&&null!=(u=i[c]))switch(c){case"children":a=u;break;case"dangerouslySetInnerHTML":l=u;break;case"style":z(e,n,u);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":break;default:v(c)&&"function"!=typeof u&&"symbol"!=typeof u&&e.push($,d(c),K,d(T(u)),j)}return e.push(X),J(e,l,a),a}}((r=t.blockedSegment).chunks,i,n,e.responseState,r.formatContext),r.lastPushedText=!1,l=r.formatContext,r.formatContext=function(e,t,i){switch(t){case"select":return G(1,null!=i.value?i.value:i.defaultValue);case"svg":return G(2,null);case"math":return G(3,null);case"foreignObject":return G(1,null);case"table":return G(4,null);case"thead":case"tbody":case"tfoot":return G(5,null);case"colgroup":return G(7,null);case"tr":return G(6,null)}return 4<=e.insertionMode||0===e.insertionMode?G(1,null):e}(l,i,n),vi(e,t,a),r.formatContext=l,i){case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"input":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":break;default:r.chunks.push(re,d(i),ae)}r.lastPushedText=!1}}function fi(e,t,i){if(t.node=i,"object"==typeof i&&null!==i){switch(i.$$typeof){case st:return void mi(e,t,i.type,i.props,i.ref);case ot:throw Error(o(257));case gt:var s=i._init;return void fi(e,t,i=s(i._payload))}if(F(i))return void Ci(e,t,i);if((s=null===i||"object"!=typeof i?null:"function"==typeof(s=wt&&i[wt]||i["@@iterator"])?s:null)&&(s=s.call(i))){if(!(i=s.next()).done){var n=[];do{n.push(i.value),i=s.next()}while(!i.done);Ci(e,t,n)}return}throw e=Object.prototype.toString.call(i),Error(o(31,"[object Object]"===e?"object with keys {"+Object.keys(i).join(", ")+"}":e))}"string"==typeof i?(s=t.blockedSegment).lastPushedText=V(t.blockedSegment.chunks,i,e.responseState,s.lastPushedText):"number"==typeof i&&((s=t.blockedSegment).lastPushedText=V(t.blockedSegment.chunks,""+i,e.responseState,s.lastPushedText))}function Ci(e,t,i){for(var s=i.length,o=0;o<s;o++){var n=t.treeContext;t.treeContext=It(n,s,o);try{vi(e,t,i[o])}finally{t.treeContext=n}}}function vi(e,t,i){var s=t.blockedSegment.formatContext,o=t.legacyContext,n=t.context;try{return fi(e,t,i)}catch(l){if(Xt(),"object"!=typeof l||null===l||"function"!=typeof l.then)throw t.blockedSegment.formatContext=s,t.legacyContext=o,t.context=n,Ft(n),l;i=l;var r=t.blockedSegment,a=ui(0,r.chunks.length,null,r.formatContext,r.lastPushedText,!0);r.children.push(a),r.lastPushedText=!1,e=li(e,t.node,t.blockedBoundary,a,t.abortSet,t.legacyContext,t.context,t.treeContext).ping,i.then(e,e),t.blockedSegment.formatContext=s,t.legacyContext=o,t.context=n,Ft(n)}}function wi(e){var t=e.blockedBoundary;(e=e.blockedSegment).status=3,Si(this,t,e)}function yi(e,t,i){var s=e.blockedBoundary;e.blockedSegment.status=3,null===s?(t.allPendingTasks--,2!==t.status&&(t.status=2,null!==t.destination&&t.destination.close())):(s.pendingTasks--,s.forceClientRender||(s.forceClientRender=!0,e=void 0===i?Error(o(432)):i,s.errorDigest=t.onError(e),s.parentFlushed&&t.clientRenderedBoundaries.push(s)),s.fallbackAbortableTasks.forEach((function(e){return yi(e,t,i)})),s.fallbackAbortableTasks.clear(),t.allPendingTasks--,0===t.allPendingTasks&&(s=t.onAllReady)())}function Ei(e,t){if(0===t.chunks.length&&1===t.children.length&&null===t.children[0].boundary){var i=t.children[0];i.id=t.id,i.parentFlushed=!0,1===i.status&&Ei(e,i)}else e.completedSegments.push(t)}function Si(e,t,i){if(null===t){if(i.parentFlushed){if(null!==e.completedRootSegment)throw Error(o(389));e.completedRootSegment=i}e.pendingRootTasks--,0===e.pendingRootTasks&&(e.onShellError=ai,(t=e.onShellReady)())}else t.pendingTasks--,t.forceClientRender||(0===t.pendingTasks?(i.parentFlushed&&1===i.status&&Ei(t,i),t.parentFlushed&&e.completedBoundaries.push(t),t.fallbackAbortableTasks.forEach(wi,e),t.fallbackAbortableTasks.clear()):i.parentFlushed&&1===i.status&&(Ei(t,i),1===t.completedSegments.length&&t.parentFlushed&&e.partialBoundaries.push(t)));e.allPendingTasks--,0===e.allPendingTasks&&(e=e.onAllReady)()}function bi(e){if(2!==e.status){var t=bt,i=ni.current;ni.current=si;var s=oi;oi=e.responseState;try{var o,n=e.pingedTasks;for(o=0;o<n.length;o++){var r=n[o],a=e,l=r.blockedSegment;if(0===l.status){Ft(r.context);try{fi(a,r,r.node),l.lastPushedText&&l.textEmbedded&&l.chunks.push(k),r.abortSet.delete(r),l.status=1,Si(a,r.blockedBoundary,l)}catch(e){if(Xt(),"object"==typeof e&&null!==e&&"function"==typeof e.then){var u=r.ping;e.then(u,u)}else{r.abortSet.delete(r),l.status=4;var h=r.blockedBoundary,d=e,c=hi(a,d);null===h?di(a,d):(h.pendingTasks--,h.forceClientRender||(h.forceClientRender=!0,h.errorDigest=c,h.parentFlushed&&a.clientRenderedBoundaries.push(h))),a.allPendingTasks--,0===a.allPendingTasks&&(0,a.onAllReady)()}}}}n.splice(0,o),null!==e.destination&&Fi(e,e.destination)}catch(t){hi(e,t),di(e,t)}finally{oi=s,ni.current=i,i===si&&Ft(t)}}}function Ri(e,t,i){switch(i.parentFlushed=!0,i.status){case 0:var s=i.id=e.nextSegmentId++;return i.lastPushedText=!1,i.textEmbedded=!1,e=e.responseState,a(t,le),a(t,e.placeholderPrefix),a(t,e=d(s.toString(16))),l(t,ue);case 1:i.status=2;var n=!0;s=i.chunks;var r=0;i=i.children;for(var u=0;u<i.length;u++){for(n=i[u];r<n.index;r++)a(t,s[r]);n=Di(e,t,n)}for(;r<s.length-1;r++)a(t,s[r]);return r<s.length&&(n=l(t,s[r])),n;default:throw Error(o(390))}}function Di(e,t,i){var s=i.boundary;if(null===s)return Ri(e,t,i);if(s.parentFlushed=!0,s.forceClientRender)s=s.errorDigest,l(t,pe),a(t,me),s&&(a(t,Ce),a(t,d(T(s))),a(t,fe)),l(t,ve),Ri(e,t,i);else if(0<s.pendingTasks){s.rootSegmentID=e.nextSegmentId++,0<s.completedSegments.length&&e.partialBoundaries.push(s);var n=e.responseState,r=n.nextSuspenseID++;n=c(n.boundaryPrefix+r.toString(16)),s=s.id=n,we(t,e.responseState,s),Ri(e,t,i)}else if(s.byteSize>e.progressiveChunkSize)s.rootSegmentID=e.nextSegmentId++,e.completedBoundaries.push(s),we(t,e.responseState,s.id),Ri(e,t,i);else{if(l(t,he),1!==(i=s.completedSegments).length)throw Error(o(391));Di(e,t,i[0])}return l(t,ge)}function Ti(e,t,i){return function(e,t,i,s){switch(i.insertionMode){case 0:case 1:return a(e,ye),a(e,t.segmentPrefix),a(e,d(s.toString(16))),l(e,Ee);case 2:return a(e,be),a(e,t.segmentPrefix),a(e,d(s.toString(16))),l(e,Re);case 3:return a(e,Te),a(e,t.segmentPrefix),a(e,d(s.toString(16))),l(e,Ae);case 4:return a(e,Fe),a(e,t.segmentPrefix),a(e,d(s.toString(16))),l(e,Me);case 5:return a(e,xe),a(e,t.segmentPrefix),a(e,d(s.toString(16))),l(e,Ie);case 6:return a(e,_e),a(e,t.segmentPrefix),a(e,d(s.toString(16))),l(e,Oe);case 7:return a(e,ke),a(e,t.segmentPrefix),a(e,d(s.toString(16))),l(e,Ve);default:throw Error(o(397))}}(t,e.responseState,i.formatContext,i.id),Di(e,t,i),function(e,t){switch(t.insertionMode){case 0:case 1:return l(e,Se);case 2:return l(e,De);case 3:return l(e,Pe);case 4:return l(e,Le);case 5:return l(e,Ne);case 6:return l(e,Ge);case 7:return l(e,He);default:throw Error(o(397))}}(t,i.formatContext)}function Ai(e,t,i){for(var s=i.completedSegments,n=0;n<s.length;n++)Pi(e,t,i,s[n]);if(s.length=0,e=e.responseState,s=i.id,i=i.rootSegmentID,a(t,e.startInlineScript),e.sentCompleteBoundaryFunction?a(t,Ke):(e.sentCompleteBoundaryFunction=!0,a(t,$e)),null===s)throw Error(o(395));return i=d(i.toString(16)),a(t,s),a(t,je),a(t,e.segmentPrefix),a(t,i),l(t,Ye)}function Pi(e,t,i,s){if(2===s.status)return!0;var n=s.id;if(-1===n){if(-1===(s.id=i.rootSegmentID))throw Error(o(392));return Ti(e,t,s)}return Ti(e,t,s),a(t,(e=e.responseState).startInlineScript),e.sentCompleteSegmentFunction?a(t,We):(e.sentCompleteSegmentFunction=!0,a(t,Be)),a(t,e.segmentPrefix),a(t,n=d(n.toString(16))),a(t,Ue),a(t,e.placeholderPrefix),a(t,n),l(t,ze)}function Fi(e,t){n=new Uint8Array(512),r=0;try{var i=e.completedRootSegment;if(null!==i&&0===e.pendingRootTasks){Di(e,t,i),e.completedRootSegment=null;var s=e.responseState.bootstrapChunks;for(i=0;i<s.length-1;i++)a(t,s[i]);i<s.length&&l(t,s[i])}var h,c=e.clientRenderedBoundaries;for(h=0;h<c.length;h++){var p=c[h];s=t;var g=e.responseState,m=p.id,f=p.errorDigest,C=p.errorMessage,v=p.errorComponentStack;if(a(s,g.startInlineScript),g.sentClientRenderFunction?a(s,Xe):(g.sentClientRenderFunction=!0,a(s,qe)),null===m)throw Error(o(395));if(a(s,m),a(s,Qe),(f||C||v)&&(a(s,Ze),a(s,d(tt(f||"")))),(C||v)&&(a(s,Ze),a(s,d(tt(C||"")))),v&&(a(s,Ze),a(s,d(tt(v)))),!l(s,Je))return e.destination=null,h++,void c.splice(0,h)}c.splice(0,h);var w=e.completedBoundaries;for(h=0;h<w.length;h++)if(!Ai(e,t,w[h]))return e.destination=null,h++,void w.splice(0,h);w.splice(0,h),u(t),n=new Uint8Array(512),r=0;var y=e.partialBoundaries;for(h=0;h<y.length;h++){var E=y[h];e:{c=e,p=t;var S=E.completedSegments;for(g=0;g<S.length;g++)if(!Pi(c,p,E,S[g])){g++,S.splice(0,g);var b=!1;break e}S.splice(0,g),b=!0}if(!b)return e.destination=null,h++,void y.splice(0,h)}y.splice(0,h);var R=e.completedBoundaries;for(h=0;h<R.length;h++)if(!Ai(e,t,R[h]))return e.destination=null,h++,void R.splice(0,h);R.splice(0,h)}finally{u(t),0===e.allPendingTasks&&0===e.pingedTasks.length&&0===e.clientRenderedBoundaries.length&&0===e.completedBoundaries.length&&t.close()}}function Mi(e,t){try{var i=e.abortableTasks;i.forEach((function(i){return yi(i,e,t)})),i.clear(),null!==e.destination&&Fi(e,e.destination)}catch(t){hi(e,t),di(e,t)}}t.renderToReadableStream=function(e,t){return new Promise((function(i,s){var o,n,r=new Promise((function(e,t){n=e,o=t})),a=function(e,t,i,s,o,n,r,a,l){var u=[],h=new Set;return(i=ui(t={destination:null,responseState:t,progressiveChunkSize:void 0===s?12800:s,status:0,fatalError:null,nextSegmentId:0,allPendingTasks:0,pendingRootTasks:0,completedRootSegment:null,abortableTasks:h,pingedTasks:u,clientRenderedBoundaries:[],completedBoundaries:[],partialBoundaries:[],onError:void 0===o?ri:o,onAllReady:void 0===n?ai:n,onShellReady:void 0===r?ai:r,onShellError:void 0===a?ai:a,onFatalError:void 0===l?ai:l},0,null,i,!1,!1)).parentFlushed=!0,e=li(t,e,null,i,h,Et,null,xt),u.push(e),t}(e,function(e,t,i,s,o){e=void 0===e?"":e,t=void 0===t?M:c('<script nonce="'+T(t)+'">');var n=[];if(void 0!==i&&n.push(t,d((""+i).replace(_,O)),L),void 0!==s)for(i=0;i<s.length;i++)n.push(x,d(T(s[i])),N);if(void 0!==o)for(s=0;s<o.length;s++)n.push(I,d(T(o[s])),N);return{bootstrapChunks:n,startInlineScript:t,placeholderPrefix:c(e+"P:"),segmentPrefix:c(e+"S:"),boundaryPrefix:e+"B:",idPrefix:e,nextSuspenseID:0,sentCompleteSegmentFunction:!1,sentCompleteBoundaryFunction:!1,sentClientRenderFunction:!1}}(t?t.identifierPrefix:void 0,t?t.nonce:void 0,t?t.bootstrapScriptContent:void 0,t?t.bootstrapScripts:void 0,t?t.bootstrapModules:void 0),function(e){return G("http://www.w3.org/2000/svg"===e?2:"http://www.w3.org/1998/Math/MathML"===e?3:0,null)}(t?t.namespaceURI:void 0),t?t.progressiveChunkSize:void 0,t?t.onError:void 0,n,(function(){var e=new ReadableStream({type:"bytes",pull:function(e){if(1===a.status)a.status=2,p(e,a.fatalError);else if(2!==a.status&&null===a.destination){a.destination=e;try{Fi(a,e)}catch(e){hi(a,e),di(a,e)}}},cancel:function(){Mi(a)}},{highWaterMark:0});e.allReady=r,i(e)}),(function(e){r.catch((function(){})),s(e)}),o);if(t&&t.signal){var l=t.signal,u=function(){Mi(a,l.reason),l.removeEventListener("abort",u)};l.addEventListener("abort",u)}bi(a)}))},t.version="18.3.1"},852:(e,t,i)=>{"use strict";var s,o;s=i(925),o=i(931),s.version,s.renderToString,t.qV=s.renderToStaticMarkup,s.renderToNodeStream,s.renderToStaticNodeStream,o.renderToReadableStream},609:e=>{"use strict";e.exports=window.React}},i={};function s(e){var o=i[e];if(void 0!==o)return o.exports;var n=i[e]={exports:{}};return t[e](n,n.exports,s),n.exports}s.m=t,e=[],s.O=(t,i,o,n)=>{if(!i){var r=1/0;for(h=0;h<e.length;h++){for(var[i,o,n]=e[h],a=!0,l=0;l<i.length;l++)(!1&n||r>=n)&&Object.keys(s.O).every((e=>s.O[e](i[l])))?i.splice(l--,1):(a=!1,n<r&&(r=n));if(a){e.splice(h--,1);var u=o();void 0!==u&&(t=u)}}return t}n=n||0;for(var h=e.length;h>0&&e[h-1][2]>n;h--)e[h]=e[h-1];e[h]=[i,o,n]},s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};s.O.j=t=>0===e[t];var t=(t,i)=>{var o,n,[r,a,l]=i,u=0;if(r.some((t=>0!==e[t]))){for(o in a)s.o(a,o)&&(s.m[o]=a[o]);if(l)var h=l(s)}for(t&&t(i);u<r.length;u++)n=r[u],s.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return s.O(h)},i=globalThis.webpackChunklcp_bar_graph=globalThis.webpackChunklcp_bar_graph||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var o=s.O(void 0,[350],(()=>s(878)));o=s.O(o)})();