var We=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={}}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,s){const i=t?this.allAsyncListeners:this.allSyncListeners;let o=i.get(e);return!o&&s&&(o=new Set,i.set(e,o)),o}noRegisteredListenersExist(){return this.allSyncListeners.size===0&&this.allAsyncListeners.size===0&&this.globalSyncListeners.size===0&&this.globalAsyncListeners.size===0}addEventListener(e,t,s=!1){this.getListeners(e,s,!0).add(t)}removeEventListener(e,t,s=!1){const i=this.getListeners(e,s,!1);i&&(i.delete(t),i.size===0&&(s?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){const t=e;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){const s=e.type;if(t&&"event"in e){const a=e.event;a instanceof Event&&(e.eventPath=a.composedPath())}const i=(a,l)=>a.forEach(d=>{if(!l.has(d))return;const c=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>d(e)):()=>d(e);t?this.dispatchAsync(c):c()}),o=this.getListeners(s,t,!1)??new Set,n=new Set(o);n.size>0&&i(n,o),new Set(t?this.globalAsyncListeners:this.globalSyncListeners).forEach(a=>{const l=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>a(s,e)):()=>a(s,e);t?this.dispatchAsync(l):l()})}dispatchAsync(e){if(this.asyncFunctionsQueue.push(e),!this.scheduled){const t=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)};this.frameworkOverrides?this.frameworkOverrides.wrapIncoming(t):t(),this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[],e.forEach(t=>t())}};function vu(e,t){return t}function Wi(e){return e?.getLocaleTextFunc()??vu}function de(e,t,s){s==null||typeof s=="string"&&s==""?_i(e,t):ce(e,t,s)}function ce(e,t,s){e.setAttribute($n(t),s.toString())}function _i(e,t){e.removeAttribute($n(t))}function $n(e){return`aria-${e}`}function X(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function wu(e){let t;return e==="asc"?t="ascending":e==="desc"?t="descending":e==="mixed"?t="other":t="none",t}function bu(e){return parseInt(e.getAttribute("aria-posinset"),10)}function Su(e){return e.getAttribute("aria-label")}function Kt(e,t){de(e,"label",t)}function Os(e,t){de(e,"labelledby",t)}function yu(e,t){de(e,"describedby",t)}function Kn(e,t){de(e,"live",t)}function Ru(e,t){de(e,"atomic",t)}function xu(e,t){de(e,"relevant",t)}function Fu(e,t){de(e,"level",t)}function jn(e,t){de(e,"disabled",t)}function Ui(e,t){de(e,"hidden",t)}function Eu(e,t){de(e,"activedescendant",t)}function Gs(e,t){ce(e,"expanded",t)}function Du(e){_i(e,"expanded")}function qn(e,t){ce(e,"setsize",t)}function Yn(e,t){ce(e,"posinset",t)}function Pu(e,t){ce(e,"multiselectable",t)}function Qn(e,t){ce(e,"rowcount",t)}function Hs(e,t){ce(e,"rowindex",t)}function Mu(e,t){ce(e,"rowspan",t)}function Zn(e,t){ce(e,"colcount",t)}function $i(e,t){ce(e,"colindex",t)}function Xn(e,t){ce(e,"colspan",t)}function Jn(e,t){ce(e,"sort",t)}function er(e){_i(e,"sort")}function Bs(e,t){de(e,"selected",t)}function Au(e,t){ce(e,"checked",t===void 0?"mixed":t)}function tr(e,t){de(e,"controls",t.id),Os(t,e.id)}function Tu(e,t){de(e,"haspopup",t===!1?null:t)}function Ki(e,t){return t===void 0?e("ariaIndeterminate","indeterminate"):t===!0?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}var ji,qi,Yi,Qi,Zi,Xi,Ji,eo;function Ie(){return ji===void 0&&(ji=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),ji}function sr(){if(qi===void 0){const e=window;qi=!!e.chrome&&(!!e.chrome.webstore||!!e.chrome.runtime)||/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}return qi}function to(){return Yi===void 0&&(Yi=/(firefox)/i.test(navigator.userAgent)),Yi}function ir(){return Qi===void 0&&(Qi=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),Qi}function _e(){return Zi===void 0&&(Zi=/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1),Zi}function so(e){if(!e)return null;const t=e.tabIndex,s=e.getAttribute("tabIndex");return t===-1&&(s===null||s===""&&!to())?null:t.toString()}function ku(){if(eo!==void 0)return eo;if(!document.body)return-1;let e=1e6;const t=to()?6e6:1e9,s=document.createElement("div");for(document.body.appendChild(s);;){const i=e*2;if(s.style.height=i+"px",i>t||s.clientHeight!==i)break;e=i}return document.body.removeChild(s),eo=e,e}function Iu(){return Ji==null&&or(),Ji}function or(){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 s=t.offsetWidth-t.clientWidth;s===0&&t.clientWidth===0&&(s=null),t.parentNode&&t.parentNode.removeChild(t),s!=null&&(Ji=s,Xi=s===0)}function nr(){return Xi==null&&or(),Xi}var Vs;function Lu(e,t,s){const i=e.parentElement;let o=i&&i.firstChild;for(;o;)t&&o.classList.toggle(t,o===e),s&&o.classList.toggle(s,o!==e),o=o.nextSibling}var Ou="[tabindex], input, select, button, textarea, [href]",rr="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function io(e){const t=Element.prototype.matches||Element.prototype.msMatchesSelector,i=t.call(e,"input, select, button, textarea"),o=t.call(e,rr),n=me(e);return i&&!o&&n}function N(e,t,s={}){const{skipAriaHidden:i}=s;e.classList.toggle("ag-hidden",!t),i||Ui(e,!t)}function ar(e,t,s={}){const{skipAriaHidden:i}=s;e.classList.toggle("ag-invisible",!t),i||Ui(e,!t)}function Pt(e,t){const s="disabled",i=t?o=>o.setAttribute(s,""):o=>o.removeAttribute(s);i(e),hr(e.querySelectorAll("input"),o=>i(o))}function st(e,t,s){let i=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,typeof s=="number"){if(++i>s)break}else if(e===s)break}return!1}function it(e){const{height:t,width:s,borderTopWidth:i,borderRightWidth:o,borderBottomWidth:n,borderLeftWidth:r,paddingTop:a,paddingRight:l,paddingBottom:d,paddingLeft:c,marginTop:u,marginRight:h,marginBottom:g,marginLeft:p,boxSizing:f}=window.getComputedStyle(e);return{height:parseFloat(t||"0"),width:parseFloat(s||"0"),borderTopWidth:parseFloat(i||"0"),borderRightWidth:parseFloat(o||"0"),borderBottomWidth:parseFloat(n||"0"),borderLeftWidth:parseFloat(r||"0"),paddingTop:parseFloat(a||"0"),paddingRight:parseFloat(l||"0"),paddingBottom:parseFloat(d||"0"),paddingLeft:parseFloat(c||"0"),marginTop:parseFloat(u||"0"),marginRight:parseFloat(h||"0"),marginBottom:parseFloat(g||"0"),marginLeft:parseFloat(p||"0"),boxSizing:f}}function Ns(e){const t=it(e);return t.boxSizing==="border-box"?t.height-t.paddingTop-t.paddingBottom:t.height}function Mt(e){const t=it(e);return t.boxSizing==="border-box"?t.width-t.paddingLeft-t.paddingRight:t.width}function oo(e){const{height:t,marginBottom:s,marginTop:i}=it(e);return Math.floor(t+s+i)}function jt(e){const{width:t,marginLeft:s,marginRight:i}=it(e);return Math.floor(t+s+i)}function lr(e){const t=e.getBoundingClientRect(),{borderTopWidth:s,borderLeftWidth:i,borderRightWidth:o,borderBottomWidth:n}=it(e);return{top:t.top+(s||0),left:t.left+(i||0),right:t.right+(o||0),bottom:t.bottom+(n||0)}}function zs(){if(typeof Vs=="boolean")return Vs;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=`
`,document.body.appendChild(e),e.scrollLeft=1,Vs=Math.floor(e.scrollLeft)===0,document.body.removeChild(e),Vs}function Ws(e,t){let s=e.scrollLeft;return t&&(s=Math.abs(s),sr()&&!zs()&&(s=e.scrollWidth-e.getBoundingClientRect().width-s)),s}function _s(e,t,s){s&&(zs()?t*=-1:(Ie()||sr())&&(t=e.scrollWidth-e.getBoundingClientRect().width-t)),e.scrollLeft=t}function Z(e){for(;e&&e.firstChild;)e.removeChild(e.firstChild)}function ve(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function dr(e){return!!e.offsetParent}function me(e){const t=e;return t.checkVisibility?t.checkVisibility({checkVisibilityCSS:!0}):!(!dr(e)||window.getComputedStyle(e).visibility!=="visible")}function At(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function cr(e,t,s){s&&s.nextSibling===t||(e.firstChild?s?s.nextSibling?e.insertBefore(t,s.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.insertAdjacentElement("afterbegin",t):e.appendChild(t))}function ur(e,t){for(let s=0;s`-${t.toLocaleLowerCase()}`)}function qt(e,t){if(t)for(const s of Object.keys(t)){const i=t[s];if(!s||!s.length||i==null)continue;const o=Gu(s),n=i.toString(),r=n.replace(/\s*!important/g,""),a=r.length!=n.length?"important":void 0;e.style.setProperty(o,r,a)}}function Hu(e){return e.clientWidtht.push(s)),t}function Nu(e,t){if(e)for(let s=0;s{const i=s.getGui();i!=null&&(typeof i=="object"?t.appendChild(i):t.innerHTML=i)})}function Le(e,t,s){const o=Dr(e).ResizeObserver,n=o?new o(s):null;return n?.observe(t),()=>n?.disconnect()}function Wu(e){const t=dt(e),s="getSelection"in t?t.getSelection():null,i=[];for(let o=0;o<(s?.rangeCount??0);o++){const n=s?.getRangeAt(o);n&&i.push(n)}return{selection:s,ranges:i}}function _u(e,t){if(!e.gos.get("enableCellTextSelection")||!to()&&!Ie())return t();const{selection:i,ranges:o}=Wu(e);t(),i?.removeAllRanges();for(const n of o)i?.addRange(n)}function Re(e){return e==null||e===""?null:e}function x(e){return e!=null&&e!==""}function V(e){return!x(e)}function Ks(e){return e!=null&&typeof e.toString=="function"?e.toString():null}function Tt(e,t){const s=e?JSON.stringify(e):null,i=t?JSON.stringify(t):null;return s===i}function gr(e,t,s=!1){const i=e==null,o=t==null;if(e&&e.toNumber&&(e=e.toNumber()),t&&t.toNumber&&(t=t.toNumber()),i&&o)return 0;if(i)return-1;if(o)return 1;function n(r,a){return r>a?1:rconsole.warn("AG Grid: "+e,...t),e+t?.join(""))}function kt(e,...t){ro(()=>console.error("AG Grid: "+e,...t),e+t?.join(""))}var ao=[],lo=!1;function mr(e){ao.push(e),!lo&&(lo=!0,window.setTimeout(()=>{const t=ao.slice();ao.length=0,lo=!1,t.forEach(s=>s())},0))}function Y(e,t,s){let i;return function(...o){const n=this;window.clearTimeout(i),i=window.setTimeout(function(){e.isAlive()&&t.apply(n,o)},s)}}function Cr(e,t){let s=0;return function(...i){const o=this,n=new Date().getTime();n-s{const l=new Date().getTime()-o>s;(e()||l)&&(t(),r=!0,n!=null&&(window.clearInterval(n),n=null),l&&i&&ot(i))};a(),r||(n=window.setInterval(a,10))}var F="33.1.1",wr=2e3,br=100,Sr="_version_",yr=null,Uu=!1,nt=`${pr}/javascript-data-grid`;function $u(e){yr=e}function Ku(e){nt=e}function Rr(e,t,s){return yr?.getConsoleMessage(e,t)??[Qu(e,t,s)]}function co(e,t,s,i){Uu||e(`error #${t}`,...Rr(t,s,i))}function ju(e){if(!e)return String(e);const t={};for(const s of Object.keys(e))typeof e[s]!="object"&&typeof e[s]!="function"&&(t[s]=e[s]);return JSON.stringify(t)}function qu(e){let t=e;return e instanceof Error?t=e.toString():typeof e=="object"&&(t=ju(e)),t}function js(e){return e===void 0?"undefined":e===null?"null":e}function uo(e,t){return`${e}?${t.toString()}`}function Yu(e,t,s){const i=Array.from(t.entries()).sort((n,r)=>r[1].length-n[1].length);let o=uo(e,t);for(const[n,r]of i){if(n===Sr)continue;const a=o.length-s;if(a<=0)break;const l="...",d=a+l.length,c=r.length-d>br?r.slice(0,r.length-d)+l:r.slice(0,br)+l;t.set(n,c),o=uo(e,t)}return o}function xr(e,t){const s=new URLSearchParams;if(s.append(Sr,F),t)for(const n of Object.keys(t))s.append(n,qu(t[n]));const i=`${nt}/errors/${e}`,o=uo(i,s);return o.length<=wr?o:Yu(i,s,wr)}var Qu=(e,t,s)=>{const i=xr(e,t);return`${s?s+` `:""}Visit ${i}${s?"":` Alternatively register the ValidationModule to see the full message in the console.`}`};function R(...e){co(ot,e[0],e[1])}function O(...e){co(kt,e[0],e[1])}function ho(e,t,s){co(kt,e,t,s)}function Fr(e,t){const s=t[0];return`error #${s} `+Rr(s,t[1],e).join(" ")}function Oe(...e){return Fr(void 0,e)}function Zu(...e){return Fr(` `,e)}function Er(e,t){return e.get("rowModelType")===t}function J(e,t){return Er(e,"clientSide")}function rt(e,t){return Er(e,"serverSide")}function Q(e,t){return e.get("domLayout")===t}function $e(e){return Zt(e)!==void 0}function go(e){return typeof e.get("getRowHeight")=="function"}function Xu(e,t){return t?!e.get("enableStrictPivotColumnOrder"):e.get("maintainColumnOrder")}function at(e,t,s=!1,i){const{gos:o,environment:n}=e;if(i==null&&(i=n.getDefaultRowHeight()),go(o)){if(s)return{height:i,estimated:!0};const l={node:t,data:t.data},d=o.getCallback("getRowHeight")(l);if(po(d))return d===0&&R(23),{height:Math.max(1,d),estimated:!1}}if(t.detail&&o.get("masterDetail"))return Ju(o);const r=o.get("rowHeight");return{height:r&&po(r)?r:i,estimated:!1}}function Ju(e){if(e.get("detailRowAutoHeight"))return{height:1,estimated:!1};const t=e.get("detailRowHeight");return po(t)?{height:t,estimated:!1}:{height:300,estimated:!1}}function Ke(e){const{environment:t,gos:s}=e,i=s.get("rowHeight");if(!i||V(i))return t.getDefaultRowHeight();const o=t.refreshRowHeightVariable();return o!==-1?o:(R(24),t.getDefaultRowHeight())}function po(e){return!isNaN(e)&&typeof e=="number"&&isFinite(e)}function qs(e,t,s){const i=t[e.getDomDataKey()];return i?i[s]:void 0}function lt(e,t,s,i){const o=e.getDomDataKey();let n=t[o];V(n)&&(n={},t[o]=n),n[s]=i}function _(e){const{gos:t,eGridDiv:s}=e;let i=null;const o=t.get("getDocument");return o&&x(o)?i=o():s&&(i=s.ownerDocument),i&&x(i)?i:document}function Dr(e){return _(e).defaultView||window}function dt(e){return e.eGridDiv.getRootNode()}function z(e){return dt(e).activeElement}function Ys(e){let t=null,s=null;try{t=_(e).fullscreenElement}catch{}finally{t||(t=dt(e));const i=t.querySelector("body");i?s=i:t instanceof ShadowRoot?s=t:t instanceof Document?s=t?.documentElement:s=t}return s}function eh(e){return Ys(e)?.clientWidth??(window.innerHeight||-1)}function th(e){return Ys(e)?.clientHeight??(window.innerHeight||-1)}function Pr(e,t,s){const o=e.getBoundingClientRect().height,n=eh(s)-2,r=th(s)-2;if(!e.offsetParent)return;const l=lr(e.offsetParent),{clientY:d,clientX:c}=t;let u=d-l.top-o/2,h=c-l.left-10;const g=_(s),p=g.defaultView||window,f=p.pageYOffset||g.documentElement.scrollTop,m=p.pageXOffset||g.documentElement.scrollLeft;n>0&&h+e.clientWidth>n+m&&(h=n+m-e.clientWidth),h<0&&(h=0),r>0&&u+e.clientHeight>r+f&&(u=r+f-e.clientHeight),u<0&&(u=0),e.style.left=`${h}px`,e.style.top=`${u}px`}function fo(e){const t=_(e),s=z(e);return s===null||s===t.body}function ct(e){return e.get("ensureDomOrder")?!1:e.get("animateRows")}function mo(e){return!(e.get("paginateChildRows")||e.get("groupHideOpenParents")||Q(e,"print"))}function be(e){return!e.get("autoGroupColumnDef")?.comparator&&!e.get("treeData")}function Qs(e){const t=e.get("groupAggFiltering");if(typeof t=="function")return e.getCallback("groupAggFiltering");if(t===!0)return()=>!0}function sh(e){return e.get("grandTotalRow")}function ih(e){const t=e.get("groupTotalRow");return typeof t=="function"?e.getCallback("groupTotalRow"):()=>t??void 0}function Mr(e){return e.exists("groupDisplayType")?e.get("groupDisplayType")==="multipleColumns":e.get("groupHideOpenParents")}function Zs(e,t){return t?!1:e.get("groupDisplayType")==="groupRows"}function ut(e){const t=e.getCallback("getRowId");return t===void 0?t:s=>{let i=t(s);return typeof i!="string"&&(R(25,{id:i}),i=String(i)),i}}function Ar(e,t){const s=e.get("groupHideParentOfSingleChild");return!!(s===!0||s==="leafGroupsOnly"&&t.leafGroup||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")&&t.leafGroup)}function Tr(e){const t=e.get("maxConcurrentDatasourceRequests");return t>0?t:void 0}function oh(e,t){const s=e.get("suppressGroupChangesColumnVisibility");if(s===!0||t&&s==="suppressHideOnGroup"||!t&&s==="suppressShowOnUngroup")return!1;const i=e.get("suppressRowGroupHidesColumns");if(t&&i===!0)return!1;const o=e.get("suppressMakeColumnVisibleAfterUnGroup");return!(!t&&o===!0)}function ht(e){return e?.checkboxes??!0}function Qt(e){return e?.mode==="multiRow"&&(e.headerCheckbox??!0)}function Xs(e){if(typeof e=="object")return e.checkboxLocation??"selectionColumn"}function Co(e){return e?.hideDisabledCheckboxes??!1}function kr(e){return typeof e.get("rowSelection")!="string"}function nh(e){return e.get("cellSelection")!==void 0}function rh(e){const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"?t?.suppressMultiRanges??!1:!1:e.get("suppressMultiRangeSelection")}function xe(e){const t=e.get("cellSelection");return t!==void 0?!!t:e.get("enableRangeSelection")}function ah(e){const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"&&t.handle?.mode==="fill"?t.handle:void 0:{mode:"fill",setFillValue:e.get("fillOperation"),direction:e.get("fillHandleDirection"),suppressClearOnFillReduction:e.get("suppressClearOnFillReduction")}}function Ir(e){const t=e.get("rowSelection")??"single";if(typeof t=="string"){const s=e.get("suppressRowClickSelection"),i=e.get("suppressRowDeselection");return s&&i?!1:s?"enableDeselection":i?"enableSelection":!0}return t.mode==="singleRow"||t.mode==="multiRow"?t.enableClickSelection??!1:!1}function lh(e){const t=Ir(e);return t===!0||t==="enableSelection"}function dh(e){const t=Ir(e);return t===!0||t==="enableDeselection"}function Js(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("isRowSelectable"):t?.isRowSelectable}function Zt(e){const t="beanName"in e&&e.beanName==="gos"?e.get("rowSelection"):e.rowSelection;if(typeof t=="string")switch(t){case"multiple":return"multiRow";case"single":return"singleRow";default:return}switch(t?.mode){case"multiRow":case"singleRow":return t.mode;default:return}}function It(e){return Zt(e)==="multiRow"}function ch(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("rowMultiSelectWithClick"):t?.enableSelectionWithoutKeys??!1}function Xt(e){const t=e.get("rowSelection");if(typeof t=="string"){const s=e.get("groupSelectsChildren"),i=e.get("groupSelectsFiltered");return s&&i?"filteredDescendants":s?"descendants":"self"}return t?.mode==="multiRow"?t.groupSelects:void 0}function Lr(e,t=!0){const s=e.get("rowSelection");return typeof s!="object"?t?"all":void 0:s.mode==="multiRow"?s.selectAll:"all"}function Lt(e){const t=Xt(e);return t==="descendants"||t==="filteredDescendants"}function Or(e){const t=e.get("rowSelection");return typeof t=="object"&&t.masterSelects||"self"}function vo(e){return e.isModuleRegistered("SetFilter")&&!e.get("suppressSetFilterByDefault")}function re(e){return e.get("columnMenu")==="legacy"}function Gr(e){return!re(e)}function wo(e){return!e||e.length<2?e:"on"+e[0].toUpperCase()+e.substring(1)}function uh(e,t,s){typeof e!="object"&&(e={});const i={...e};return s.forEach(o=>{const n=t[o];typeof n<"u"&&(i[o]=n)}),i}function hh(e,t){if(!e)return;const s={};let i=!1;if(Object.keys(e).forEach(r=>{s[r]=e[r],i=!0}),!i)return;const o={type:"gridOptionsChanged",options:s};t.dispatchEvent(o);const n={type:"componentStateChanged",...s};t.dispatchEvent(n)}function k(e,t){return e.addGridCommonParams(t)}var Hr="__ag_Grid_Stop_Propagation",gh=["touchstart","touchend","touchmove","touchcancel","scroll"],ph=["wheel"],bo={};function gt(e){e[Hr]=!0}function Fe(e){return e[Hr]===!0}var Br=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return s=>{if(typeof bo[s]=="boolean")return bo[s];const i=document.createElement(e[s]||"div");return s="on"+s,bo[s]=s in i}})();function Vr(e,t,s){let i=t;for(;i;){const o=qs(e,i,s);if(o)return o;i=i.parentElement}return null}function Nr(e,t){return!t||!e?!1:mh(t).indexOf(e)>=0}function fh(e){const t=[];let s=e.target;for(;s;)t.push(s),s=s.parentElement;return t}function mh(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():fh(t)}function Ch(e,t,s,i){const o=zr(s);let n;o!=null&&(n={passive:o}),e&&e.addEventListener&&e.addEventListener(t,s,i,n)}var zr=e=>{const t=gh.includes(e),s=ph.includes(e);if(t)return!0;if(s)return!1},b=class{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.propertyListenerId=0,this.lastChangeSetIdLookup={},this.isAlive=()=>!this.destroyed}preWireBeans(e){this.beans=e,this.stubContext=e.context,this.eventSvc=e.eventSvc,this.gos=e.gos}destroy(){const{destroyFunctions:e}=this;for(let t=0;tnull;let i;return vh(e)?(e.__addEventListener(t,s),i=()=>(e.__removeEventListener(t,s),null)):(e instanceof HTMLElement?Ch(this.beans.frameworkOverrides,e,t,s):e.addEventListener(t,s),i=()=>(e.removeEventListener(t,s),null)),this.destroyFunctions.push(i),()=>(i(),this.destroyFunctions=this.destroyFunctions.filter(o=>o!==i),null)}setupGridOptionListener(e,t){const{gos:s}=this;s.addPropertyEventListener(e,t);const i=()=>(s.removePropertyEventListener(e,t),null);return this.destroyFunctions.push(i),()=>(i(),this.destroyFunctions=this.destroyFunctions.filter(o=>o!==i),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupGridOptionListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const s=e.join("-")+this.propertyListenerId++,i=o=>{if(o.changeSet){if(o.changeSet&&o.changeSet.id===this.lastChangeSetIdLookup[s])return;this.lastChangeSetIdLookup[s]=o.changeSet.id}const n={type:"gridPropertyChanged",changeSet:o.changeSet,source:o.source};t(n)};e.forEach(o=>this.setupGridOptionListener(o,i))}getLocaleTextFunc(){return Wi(this.beans.localeSvc)}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createOptionalManagedBean(e,t){return e?this.createManagedBean(e,t):void 0}createManagedBean(e,t){const s=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),s}createBean(e,t,s){return(t||this.stubContext).createBean(e,s)}destroyBean(e,t){return(t||this.stubContext).destroyBean(e)}destroyBeans(e,t){return(t||this.stubContext).destroyBeans(e)}};function vh(e){return e.__addEventListener!==void 0}var Wr=new Set(["__proto__","constructor","prototype"]);function wh(e,t){if(e!=null){if(Array.isArray(e)){for(let s=0;s{if(Wr.has(o))return;let r=e[o];r!==n&&(i&&r==null&&n!=null&&typeof n=="object"&&n.constructor===Object&&(r={},e[o]=r),_r(n)&&_r(r)&&!Array.isArray(r)?ie(r,n,s,i):(s||n!==void 0)&&(e[o]=n))})}function Jt(e,t,s){if(!t||!e)return;if(!s)return e[t];const i=t.split(".");let o=e;for(let n=0;n"']/g,Sh={"&":"&","<":"<",">":">",'"':""","'":"'"};function Ee(e,t){if(e==null)return null;const s=e.toString().toString();return t?s:s.replace(bh,i=>Sh[i])}var yh={resizable:!0,sortable:!0},Rh=0;function Ur(){return Rh++}function Ge(e){return e instanceof ei}var ei=class extends b{constructor(e,t,s,i){super(),this.colDef=e,this.userProvidedColDef=t,this.colId=s,this.primary=i,this.isColumn=!0,this.instanceId=Ur(),this.autoHeaderHeight=null,this.moving=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.colEventSvc=new We,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.flex=null,this.colIdSanitised=Ee(s)}destroy(){super.destroy(),this.beans.rowSpanSvc?.deregister(this)}getInstanceId(){return this.instanceId}setState(){const{colDef:e,beans:{sortSvc:t,pinnedCols:s,colFlex:i}}=this;t?.initCol(this);const o=e.hide;o!==void 0?this.visible=!o:this.visible=!e.initialHide,s?.initCol(this),i?.initCol(this)}setColDef(e,t,s){const i=e.spanRows!==this.colDef.spanRows;this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),i&&(this.beans.rowSpanSvc?.deregister(this),this.initRowSpan()),this.dispatchColEvent("colDefChanged",s)}getUserProvidedColDef(){return this.userProvidedColDef}getParent(){return this.parent}getOriginalParent(){return this.originalParent}postConstruct(){this.setState(),this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip(),this.initRowSpan()}initDotNotation(){const{gos:e,colDef:{field:t,tooltipField:s}}=this,i=e.get("suppressFieldDotNotation");this.fieldContainsDots=x(t)&&t.indexOf(".")>=0&&!i,this.tooltipFieldContainsDots=x(s)&&s.indexOf(".")>=0&&!i}initMinAndMaxWidths(){const e=this.colDef;this.minWidth=e.minWidth??this.beans.environment.getDefaultColumnMinWidth(),this.maxWidth=e.maxWidth??Number.MAX_SAFE_INTEGER}initTooltip(){this.beans.tooltipSvc?.initCol(this)}initRowSpan(){this.colDef.spanRows&&this.beans.rowSpanSvc?.register(this)}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){let t;const s=e.width,i=e.initialWidth;return s!=null?t=s:i!=null?t=i:t=200,Math.max(Math.min(t,this.maxWidth),this.minWidth)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){return this.beans.showRowGroupCols?.isRowGroupDisplayed(this,e)??!1}isPrimary(){return this.primary}isFilterAllowed(){return!!this.colDef.filter}isFieldContainsDots(){return this.fieldContainsDots}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}getHighlighted(){return this.highlighted}__addEventListener(e,t){this.colEventSvc.addEventListener(e,t)}__removeEventListener(e,t){this.colEventSvc.removeEventListener(e,t)}addEventListener(e,t){this.frameworkEventListenerService=this.beans.frameworkOverrides.createLocalEventListenerWrapper?.(this.frameworkEventListenerService,this.colEventSvc);const s=this.frameworkEventListenerService?.wrap(t)??t;this.colEventSvc.addEventListener(e,s)}removeEventListener(e,t){const s=this.frameworkEventListenerService?.unwrap(t)??t;this.colEventSvc.removeEventListener(e,s)}createColumnFunctionCallbackParams(e){return k(this.gos,{node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){return this.beans.cellNavigation?.isSuppressNavigable(this,e)??!1}isCellEditable(e){return this.beans.editSvc?.isCellEditable(this,e)??!1}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.beans.selectionSvc?.isCellCheckboxSelection(this,e)??!1}isSuppressPaste(e){return this.isColumnFunc(e,this.colDef?.suppressPaste??null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(e){return this.colDef[e]??yh[e]}isColumnFunc(e,t){if(typeof t=="boolean")return t;if(typeof t=="function"){const s=this.createColumnFunctionCallbackParams(e);return t(s)}return!1}createColumnEvent(e,t){return k(this.gos,{type:e,column:this,columns:[this],source:t})}isMoving(){return this.moving}getSort(){return this.sort}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return this.sort==="asc"}isSortDescending(){return this.sort==="desc"}isSortNone(){return V(this.sort)}isSorting(){return x(this.sort)}getSortIndex(){return this.sortIndex}isMenuVisible(){return this.menuVisible}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.dispatchColEvent("leftChanged",t))}isFilterActive(){return this.filterActive}isHovered(){return R(261),!!this.beans.colHover?.isHovered(this)}setFirstRightPinned(e,t){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.dispatchColEvent("firstRightPinnedChanged",t))}setLastLeftPinned(e,t){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.dispatchColEvent("lastLeftPinnedChanged",t))}isFirstRightPinned(){return this.firstRightPinned}isLastLeftPinned(){return this.lastLeftPinned}isPinned(){return this.pinned==="left"||this.pinned==="right"}isPinnedLeft(){return this.pinned==="left"}isPinnedRight(){return this.pinned==="right"}getPinned(){return this.pinned}setVisible(e,t){const s=e===!0;this.visible!==s&&(this.visible=s,this.dispatchColEvent("visibleChanged",t)),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){return!this.getColDef().suppressSpanHeaderHeight}getColumnGroupPaddingInfo(){let e=this.getParent();if(!e||!e.isPadding())return{numberOfParents:0,isSpanningTotal:!1};const t=e.getPaddingLevel()+1;let s=!0;for(;e;){if(!e.isPadding()){s=!1;break}e=e.getParent()}return{numberOfParents:t,isSpanningTotal:s}}getColDef(){return this.colDef}getDefinition(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}createBaseColDefParams(e){return k(this.gos,{node:e,data:e.data,colDef:this.colDef,column:this})}getColSpan(e){if(V(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),s=this.colDef.colSpan(t);return Math.max(s,1)}getRowSpan(e){if(V(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),s=this.colDef.rowSpan(t);return Math.max(s,1)}setActualWidth(e,t,s=!1){e=Math.max(e,this.minWidth),e=Math.min(e,this.maxWidth),this.actualWidth!==e&&(this.actualWidth=e,this.flex!=null&&t!=="flex"&&t!=="gridInitializing"&&(this.flex=null),s||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.dispatchColEvent("widthChanged",e)}isGreaterThanMax(e){return e>this.maxWidth}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex}isRowGroupActive(){return this.rowGroupActive}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}isValueActive(){return this.aggregationActive}isAllowPivot(){return this.colDef.enablePivot===!0}isAllowValue(){return this.colDef.enableValue===!0}isAllowRowGroup(){return this.colDef.enableRowGroup===!0}dispatchColEvent(e,t,s){const i=this.createColumnEvent(e,t);s&&ie(i,s),this.colEventSvc.dispatchEvent(i)}dispatchStateUpdatedEvent(e){this.colEventSvc.dispatchEvent({type:"columnStateUpdated",key:e})}};function ee(e){return e instanceof es}var es=class extends b{constructor(e,t,s,i){super(),this.colGroupDef=e,this.groupId=t,this.padding=s,this.level=i,this.isColumn=!1,this.expandable=!1,this.instanceId=Ur(),this.expandableListenerRemoveCallback=null,this.expanded=!!e?.openByDefault}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0),super.destroy()}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}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){return this.children?this.children.some(e=>e.isVisible()):!1}isPadding(){return this.padding}setExpanded(e){this.expanded=e===void 0?!1:e,this.dispatchLocalEvent({type:"expandedChanged"})}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(e){this.children&&this.children.forEach(t=>{Ge(t)?e.push(t):ee(t)&&t.addLeafColumns(e)})}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 e=!1,t=!1,s=!1;const i=this.findChildrenRemovingPadding();for(let n=0,r=i.length;n{s.forEach(i=>{ee(i)&&i.isPadding()?t(i.children):e.push(i)})};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}},xh={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}},$r=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;ts?s(i,t[o]):t[o]===i)}function Fh(e){return e.sort((t,s)=>t-s)}function ue(e,t){const s=e.indexOf(t);s>=0&&e.splice(s,1)}function Kr(e,t,s){for(let i=0;i=0;i--)e.splice(s,0,t[i])}var ts="ag-Grid-AutoColumn",yo="ag-Grid-SelectionColumn",jr="ag-Grid-RowNumbersColumn";function Ro(e){const t=[],s=i=>{for(let o=0;ot+s.getActualWidth(),0)}function ss(e,t,s){const i={};if(!t)return;Be(null,t,n=>{i[n.getInstanceId()]=n}),s&&Be(null,s,n=>{i[n.getInstanceId()]=null});const o=Object.values(i).filter(n=>n!=null);e.context.destroyBeans(o)}function ti(e){return e.getId().startsWith(ts)}function De(e){return(typeof e=="string"?e:"getColId"in e?e.getColId():e.colId)?.startsWith(yo)??!1}function Ot(e){return(typeof e=="string"?e:"getColId"in e?e.getColId():e.colId)?.startsWith(jr)??!1}function si(e){let t=[];return e instanceof Array?t=e:typeof e=="string"&&(t=e.split(",")),t}function qr(e,t){return je(e,t,(s,i)=>s.getColId()===i.getColId())}function Yr(e){e.map={},e.list.forEach(t=>e.map[t.getId()]=t)}function pt(e){return e==="gridOptionsUpdated"?"gridOptionsChanged":e}function xo(e,t){const s=e===t,i=e.getColDef()===t,o=e.getColId()==t;return s||i||o}var Eh=(e,t)=>(s,i)=>{const o={value1:void 0,value2:void 0};let n=!1;return e&&(e[s]!==void 0&&(o.value1=e[s],n=!0),x(i)&&e[i]!==void 0&&(o.value2=e[i],n=!0)),!n&&t&&(t[s]!==void 0&&(o.value1=t[s]),x(i)&&t[i]!==void 0&&(o.value2=t[i])),o};function Qr(e,t=null,s,i,o){const n=new $r,{existingCols:r,existingGroups:a,existingColKeys:l}=Dh(i);n.addExistingKeys(l);const d=Zr(e,t,0,s,r,n,a,o),{colGroupSvc:c}=e,u=c?.findMaxDepth(d,0)??0,h=c?c.balanceColumnTree(d,0,u,n):d;return Be(null,h,(p,f)=>{ee(p)&&p.setupExpandable(),p.originalParent=f}),{columnTree:h,treeDept:u}}function Dh(e){const t=[],s=[],i=[];return e&&Be(null,e,o=>{if(ee(o)){const n=o;s.push(n)}else{const n=o;i.push(n.getId()),t.push(n)}}),{existingCols:t,existingGroups:s,existingColKeys:i}}function Zr(e,t,s,i,o,n,r,a){if(!t)return[];const{colGroupSvc:l}=e,d=new Array(t.length);for(let c=0;c0))if(s.width!=null)t.setActualWidth(s.width,i);else{const n=t.getActualWidth();t.setActualWidth(n,i)}}function Mh(e,t){if(t)for(let s=0;s{const r=i[n.trim()];r?ie(s,r,!1,!0):R(36,{t:n})})}function kh(e){return e.children!==void 0}function Be(e,t,s){if(t)for(let i=0;i{const a=r.getColDef().lockPosition;a==="right"?o.push(r):a==="left"||a===!0?s.push(r):i.push(r)}),t.get("enableRtl")?[...o,...i,...s]:[...s,...i,...o]}function ta(e,t){let s=!0;return Be(null,t,i=>{if(!ee(i))return;const o=i,n=o.getColGroupDef();if(!(n&&n.marryChildren))return;const a=[];o.getLeafColumns().forEach(h=>{const g=e.indexOf(h);a.push(g)});const l=Math.max.apply(Math,a),d=Math.min.apply(Math,a),c=l-d,u=o.getLeafColumns().length-1;c>u&&(s=!1)}),s}function sa(e,t){if(!e||e.length==0)return;const s=t(e[0]);for(let i=1;in.getPinned());e.dispatchEvent({type:"columnPinned",pinned:o??null,columns:t,column:i,source:s})}function Ih(e,t,s){if(!t.length)return;const i=t.length===1?t[0]:null,o=sa(t,n=>n.isVisible());e.dispatchEvent({type:"columnVisible",visible:o,columns:t,column:i,source:s})}function oa(e,t,s,i){e.dispatchEvent({type:t,columns:s,column:s&&s.length==1?s[0]:null,source:i})}function Gt(e,t,s,i,o=null){t?.length&&e.dispatchEvent({type:"columnResized",columns:t,column:t.length===1?t[0]:null,flexColumns:o,finished:s,source:i})}function he(e,t,s){const{colModel:i,rowGroupColsSvc:o,pivotColsSvc:n,autoColSvc:r,selectionColSvc:a,colAnimation:l,visibleCols:d,pivotResultCols:c,environment:u,valueColsSvc:h,eventSvc:g,gos:p}=e,f=i.getColDefCols()||[];if(!f?.length)return!1;if(t?.state&&!t.state.forEach)return R(32),!1;const m=(y,D,M,A,T)=>{if(!y)return;const P=Eh(D,t.defaultState),G=P("flex").value1;if(Xr(e,y,P("hide").value1,P("sort").value1,P("sortIndex").value1,P("pinned").value1,G,s),G==null){const $=P("width").value1;if($!=null){const ke=y.getColDef().minWidth??u.getDefaultColumnMinWidth();ke!=null&&$>=ke&&y.setActualWidth($,s)}}T||!y.isPrimary()||(h?.syncColumnWithState(y,s,P),o?.syncColumnWithState(y,s,P,M),n?.syncColumnWithState(y,s,P,A))},C=(y,D,M)=>{const A=ra(e,s),T=D.slice(),P={},G={},$=[],ke=[],tt=[];let ze=0;const le=o?.columns.slice()??[],Ls=n?.columns.slice()??[];y.forEach(se=>{const $t=se.colId;if($t.startsWith(ts)){$.push(se),tt.push(se);return}if(De($t)){ke.push(se),tt.push(se);return}const Dt=M($t);Dt?(m(Dt,se,P,G,!1),ue(T,Dt)):(tt.push(se),ze+=1)});const Wn=se=>m(se,null,P,G,!1);T.forEach(Wn),o?.sortColumns(la.bind(o,P,le)),n?.sortColumns(la.bind(n,G,Ls)),i.refreshCols(!1);const _n=(se,$t,zi=[])=>{$t.forEach(Dt=>{const Un=se(Dt.colId);ue(zi,Un),m(Un,Dt,null,null,!0)}),zi.forEach(Wn)};return _n(se=>r?.getColumn(se)??null,$,r?.getColumns()?.slice()),_n(se=>a?.getColumn(se)??null,ke,a?.getColumns()?.slice()),Lh(t,i,p),d.refresh(s),g.dispatchEvent({type:"columnEverythingChanged",source:s}),A(),{unmatchedAndAutoStates:tt,unmatchedCount:ze}};l?.start();let{unmatchedAndAutoStates:v,unmatchedCount:S}=C(t.state||[],f,y=>i.getColDefCol(y));if(v.length>0||x(t.defaultState)){const y=c?.getPivotResultCols()?.list??[];S=C(v,y,D=>c?.getPivotResultCol(D)??null).unmatchedCount}return l?.finish(),S===0}function na(e,t){const{colModel:s,autoColSvc:i}=e;if(!s.getColDefCols()?.length)return;const n=s.getColDefColTree(),r=Ro(n),a=[];let l=1e3,d=1e3,c=[];const u=i?.getColumns();u&&(c=c.concat(u)),r&&(c=c.concat(r)),c.forEach(h=>{const g=aa(h);V(g.rowGroupIndex)&&g.rowGroup&&(g.rowGroupIndex=l++),V(g.pivotIndex)&&g.pivot&&(g.pivotIndex=d++),a.push(g)}),he(e,{state:a,applyOrder:!0},t)}function ra(e,t){const{rowGroupColsSvc:s,pivotColsSvc:i,valueColsSvc:o,colModel:n,sortSvc:r,eventSvc:a}=e,l={rowGroupColumns:s?.columns.slice()??[],pivotColumns:i?.columns.slice()??[],valueColumns:o?.columns.slice()??[]},d=Ht(e),c={};return d.forEach(u=>{c[u.colId]=u}),()=>{const u=n.getAllCols(),h=(A,T,P,G)=>{const $=T.map(G),ke=P.map(G);if(je($,ke))return;const ze=new Set(T);P.forEach(Ls=>{ze.delete(Ls)||ze.add(Ls)});const le=[...ze];a.dispatchEvent({type:A,columns:le,column:le.length===1?le[0]:null,source:t})},g=A=>{const T=[];return u.forEach(P=>{const G=c[P.getColId()];G&&A(G,P)&&T.push(P)}),T},p=A=>A.getColId();h("columnRowGroupChanged",l.rowGroupColumns,s?.columns??[],p),h("columnPivotChanged",l.pivotColumns,i?.columns??[],p);const m=g((A,T)=>{const P=A.aggFunc!=null,G=P!=T.isValueActive(),$=P&&A.aggFunc!=T.getAggFunc();return G||$});m.length>0&&oa(a,"columnValueChanged",m,t),Gt(a,g((A,T)=>A.width!=T.getActualWidth()),!0,t),ia(a,g((A,T)=>A.pinned!=T.getPinned()),t),Ih(a,g((A,T)=>A.hide==T.isVisible()),t);const D=g((A,T)=>A.sort!=T.getSort()||A.sortIndex!=T.getSortIndex());D.length>0&&r?.dispatchSortChangedEvents(t,D);const M=Ht(e);Gh(d,M,t,n,a)}}function Ht(e){const{colModel:t,rowGroupColsSvc:s,pivotColsSvc:i}=e,o=t.getColDefCols();if(V(o)||!t.isAlive())return[];const n=t.getAllCols(),r=s?.columns,a=i?.columns,l=u=>{const h=u.isRowGroupActive()&&r?r.indexOf(u):null,g=u.isPivotActive()&&a?a.indexOf(u):null,p=u.isValueActive()?u.getAggFunc():null,f=u.getSort()!=null?u.getSort():null,m=u.getSortIndex()!=null?u.getSortIndex():null;return{colId:u.getColId(),width:u.getActualWidth(),hide:!u.isVisible(),pinned:u.getPinned(),sort:f,sortIndex:m,aggFunc:p,rowGroup:u.isRowGroupActive(),rowGroupIndex:h,pivot:u.isPivotActive(),pivotIndex:g,flex:u.getFlex()??null}},d=n.map(u=>l(u)),c=new Map(t.getCols().map((u,h)=>[u.getColId(),h]));return d.sort((u,h)=>{const g=c.has(u.colId)?c.get(u.colId):-1,p=c.has(h.colId)?c.get(h.colId):-1;return g-p}),d}function aa(e){const t=(p,f)=>p??f??null,s=e.getColDef(),i=t(s.sort,s.initialSort),o=t(s.sortIndex,s.initialSortIndex),n=t(s.hide,s.initialHide),r=t(s.pinned,s.initialPinned),a=t(s.width,s.initialWidth),l=t(s.flex,s.initialFlex);let d=t(s.rowGroupIndex,s.initialRowGroupIndex),c=t(s.rowGroup,s.initialRowGroup);d==null&&(c==null||c==!1)&&(d=null,c=null);let u=t(s.pivotIndex,s.initialPivotIndex),h=t(s.pivot,s.initialPivot);u==null&&(h==null||h==!1)&&(u=null,h=null);const g=t(s.aggFunc,s.initialAggFunc);return{colId:e.getColId(),sort:i,sortIndex:o,hide:n,pinned:r,width:a,flex:l,rowGroup:c,rowGroupIndex:d,pivot:h,pivotIndex:u,aggFunc:g}}function Lh(e,t,s){if(!e.applyOrder||!e.state)return;const i=[];e.state.forEach(o=>{o.colId!=null&&i.push(o.colId)}),Oh(t.cols,i,t,s)}function Oh(e,t,s,i){if(e==null)return;let o=[];const n={};t.forEach(a=>{if(n[a])return;const l=e.map[a];l&&(o.push(l),n[a]=!0)});let r=0;if(e.list.forEach(a=>{const l=a.getColId();if(n[l]!=null)return;l.startsWith(ts)?o.splice(r++,0,a):o.push(a)}),o=ea(o,i),!ta(o,s.getColTree())){R(39);return}e.list=o}function Gh(e,t,s,i,o){const n={};t.forEach(c=>n[c.colId]=c);const r={};e.forEach(c=>{n[c.colId]&&(r[c.colId]=!0)});const a=e.filter(c=>r[c.colId]),l=t.filter(c=>r[c.colId]),d=[];l.forEach((c,u)=>{const h=a&&a[u];if(h&&h.colId!==c.colId){const g=i.getCol(h.colId);g&&d.push(g)}}),d.length&&o.dispatchEvent({type:"columnMoved",columns:d,column:d.length===1?d[0]:null,finished:!0,source:s})}var la=(e,t,s,i)=>{const o=e[s.getId()],n=e[i.getId()],r=o!=null,a=n!=null;if(r&&a)return o-n;if(r)return-1;if(a)return 1;const l=t.indexOf(s),d=t.indexOf(i),c=l>=0,u=d>=0;return c&&u?l-d:c?-1:1},Hh=class extends b{constructor(){super(...arguments),this.beanName="colModel",this.pivotMode=!1,this.ready=!1,this.changeEventsDispatching=!1}postConstruct(){this.pivotMode=this.gos.get("pivotMode"),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents"],e=>this.refreshAll(pt(e.source))),this.addManagedPropertyListeners(["defaultColDef","defaultColGroupDef","columnTypes","suppressFieldDotNotation"],this.recreateColumnDefs.bind(this)),this.addManagedPropertyListener("pivotMode",e=>this.setPivotMode(this.gos.get("pivotMode"),pt(e.source)))}createColsFromColDefs(e){const{beans:t}=this,{valueCache:s,colAutosize:i,rowGroupColsSvc:o,pivotColsSvc:n,valueColsSvc:r,visibleCols:a,colViewport:l,eventSvc:d}=t,c=this.colDefs?ra(t,e):void 0;s?.expire();const u=this.colDefCols?.list,h=this.colDefCols?.tree,g=Qr(t,this.colDefs,!0,h,e);ss(t,this.colDefCols?.tree,g.columnTree);const p=g.columnTree,f=g.treeDept,m=Ro(p),C={};m.forEach(v=>C[v.getId()]=v),this.colDefCols={tree:p,treeDepth:f,list:m,map:C},o?.extractCols(e,u),n?.extractCols(e,u),r?.extractCols(e,u),this.ready=!0,this.refreshCols(!0),a.refresh(e),l.checkViewportColumns(),d.dispatchEvent({type:"columnEverythingChanged",source:e}),c&&(this.changeEventsDispatching=!0,c(),this.changeEventsDispatching=!1),d.dispatchEvent({type:"newColumnsLoaded",source:e}),e==="gridInitializing"&&i?.applyAutosizeStrategy()}refreshCols(e){if(!this.colDefCols)return;const t=this.cols?.tree;this.saveColOrder();const{autoColSvc:s,selectionColSvc:i,rowNumbersSvc:o,quickFilter:n,pivotResultCols:r,showRowGroupCols:a,rowAutoHeight:l,visibleCols:d,colViewport:c,eventSvc:u}=this.beans,h=this.selectCols(r,this.colDefCols);this.createColumnsForService([s,i,o],h);const g=Xu(this.gos,this.showingPivotResult);(!e||g)&&this.restoreColOrder(h),this.positionLockedCols(h),a?.refresh(),n?.refreshCols(),this.setColSpanActive(),l?.setAutoHeightActive(h),d.clear(),c.clear(),!je(t,this.cols.tree)&&u.dispatchEvent({type:"gridColumnsChanged"})}createColumnsForService(e,t){for(const s of e)s&&(s.createColumns(t,i=>{this.lastOrder=i(this.lastOrder),this.lastPivotOrder=i(this.lastPivotOrder)}),s.addColumns(t))}selectCols(e,t){const s=e?.getPivotResultCols()??null;this.showingPivotResult=s!=null;const{map:i,list:o,tree:n,treeDepth:r}=s??t;return this.cols={list:o.slice(),map:{...i},tree:n.slice(),treeDepth:r},s&&(s.list.some(l=>this.cols?.map[l.getColId()]!==void 0)||(this.lastPivotOrder=null)),this.cols}getColsToShow(){if(!this.cols)return[];const e=this.isPivotMode()&&!this.showingPivotResult,t=this.beans.valueColsSvc?.columns;return this.cols.list.filter(i=>{const o=ti(i);if(e){const n=t?.includes(i);return o||n}else return o||i.isVisible()})}refreshAll(e){this.ready&&(this.refreshCols(!1),this.beans.visibleCols.refresh(e))}setColsVisible(e,t=!1,s){he(this.beans,{state:e.map(i=>({colId:typeof i=="string"?i:i.getColId(),hide:!t}))},s)}restoreColOrder(e){const t=this.showingPivotResult?this.lastPivotOrder:this.lastOrder;if(!t)return;const s=new Map(t.map((d,c)=>[d,c]));if(!e.list.some(d=>s.has(d)))return;const o=new Map(e.list.map(d=>[d,!0])),n=t.filter(d=>o.has(d)),r=new Map(n.map(d=>[d,!0])),a=e.list.filter(d=>!r.has(d)),l=n.slice();a.forEach(d=>{let c=d.getOriginalParent();if(!c){l.push(d);return}const u=[];for(;!u.length&&c;)c.getLeafColumns().forEach(f=>{const m=l.indexOf(f)>=0,C=u.indexOf(f)<0;m&&C&&u.push(f)}),c=c.getOriginalParent();if(!u.length){l.push(d);return}const h=u.map(p=>l.indexOf(p)),g=Math.max(...h);l.splice(g+1,0,d)}),e.list=l}positionLockedCols(e){e.list=ea(e.list,this.gos)}saveColOrder(){this.showingPivotResult?this.lastPivotOrder=this.cols?.list??null:this.lastOrder=this.cols?.list??null}getColumnDefs(){return this.colDefCols?this.beans.colDefFactory?.getColumnDefs(this.colDefCols.list,this.showingPivotResult,this.lastOrder,this.cols?.list??[]):void 0}setColSpanActive(){this.colSpanActive=!!this.cols?.list.some(e=>e.getColDef().colSpan!=null)}isPivotMode(){return this.pivotMode}setPivotMode(e,t){if(e===this.pivotMode||(this.pivotMode=e,!this.ready))return;this.refreshCols(!1);const{visibleCols:s,eventSvc:i}=this.beans;s.refresh(t),i.dispatchEvent({type:"columnPivotModeChanged"})}isPivotActive(){const e=this.beans.pivotColsSvc?.columns;return this.pivotMode&&!!e?.length}recreateColumnDefs(e){if(!this.cols)return;this.beans.autoColSvc?.updateColumns(e);const t=pt(e.source);this.createColsFromColDefs(t)}setColumnDefs(e,t){this.colDefs=e,this.createColsFromColDefs(t)}destroy(){ss(this.beans,this.colDefCols?.tree),super.destroy()}getColTree(){return this.cols?.tree??[]}getColDefColTree(){return this.colDefCols?.tree??[]}getColDefCols(){return this.colDefCols?.list??null}getCols(){return this.cols?.list??[]}getAllCols(){const{pivotResultCols:e,autoColSvc:t,selectionColSvc:s}=this.beans,i=e?.getPivotResultCols()?.list;return[this.colDefCols?.list??[],t?.columns?.list??[],s?.columns?.list??[],i??[]].flat()}getColsForKeys(e){return e?e.map(t=>this.getCol(t)).filter(t=>t!=null):[]}getColDefCol(e){return this.colDefCols?.list?this.getColFromCollection(e,this.colDefCols):null}getCol(e){return e==null?null:this.getColFromCollection(e,this.cols)}getColFromCollection(e,t){if(t==null)return null;const{map:s,list:i}=t;if(typeof e=="string"&&s[e])return s[e];for(let o=0;ol.set(c,u)),t.length=0,x(e)&&e.forEach(c=>{const u=this.colModel.getColDefCol(c);u&&t.push(u)}),t.forEach((c,u)=>{const h=l.get(c);if(h===void 0){l.set(c,0);return}i&&h!==u||l.delete(c)}),(this.colModel.getColDefCols()||[]).forEach(c=>{const u=t.indexOf(c)>=0;n(c,u,r)}),o&&this.colModel.refreshCols(!1),this.visibleCols.refresh(r),this.dispatchColumnChangedEvent(this.eventSvc,s,[...l.keys()],r)}updateColList(e=[],t,s,i,o,n,r){if(!e||e.length===0)return;let a=!1;const l=new Set;if(e.forEach(c=>{if(!c)return;const u=this.colModel.getColDefCol(c);if(u){if(l.add(u),s){if(t.indexOf(u)>=0)return;t.push(u)}else{const h=t.indexOf(u);if(h<0)return;for(let g=h+1;g{const p=t.indexOf(g)<0,f=g.getColDef(),m=l(f),C=d(f),v=r(f),S=a(f);let y;m!==void 0?y=m:v!==void 0?v===null?y=!1:y=v>=0:p?C!==void 0?y=C:S!==void 0?y=S!=null&&S>=0:y=!1:y=s.indexOf(g)>=0,y&&((p?v!=null||S!=null:v!=null)?i.push(g):o.push(g))});const u=g=>{const p=r(g.getColDef()),f=a(g.getColDef());return p??f};i.sort((g,p)=>{const f=u(g),m=u(p);return f===m?0:f{o.indexOf(g)>=0&&h.push(g)}),o.forEach(g=>{h.indexOf(g)<0&&h.push(g)}),s.forEach(g=>{h.indexOf(g)<0&&n(g,!1,e)}),h.forEach(g=>{s.indexOf(g)<0&&n(g,!0,e)}),this.columns=h}restoreColumnOrder(e,t){const s=this.columns,i=this.colModel.getColDefCols();if(!s.length||!i)return e;const o=Object.keys(t),n=new Set(o),r=new Set(o),a=new Set(s.map(S=>{const y=S.getColId();return r.delete(y),y}).concat(o)),l=[],d={};let c=0;for(let S=0;S{const y=d[S];for(let D=g;D{const y=S.getColId();if(n.has(y))v(y),t[y][m]=u++;else{const D=S.getColDef();(D[m]===null||D[m]===void 0&&D[C]==null)&&(h||(D[p]||D[p]===void 0&&D[f]?v(y):(r.forEach(T=>{t[T][m]=u+d[T]}),u+=l.length,h=!0)),e[y]||(e[y]={colId:y}),e[y][m]=u++)}}),e}},Fo=class{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let s;return typeof t!="number"?s=0:s=t+1,this.existingIds[e]=s,s}},Vh=class extends b{};function is(e,t,s){return s&&e.addDestroyFunc(()=>t.destroyBean(s)),s??e}var Eo=class{constructor(e){this.cssClassStates={},this.getGui=e}addCssClass(e){this.addOrRemoveCssClass(e,!0)}removeCssClass(e){this.addOrRemoveCssClass(e,!1)}containsCssClass(e){const t=this.getGui();return t?t.classList.contains(e):!1}addOrRemoveCssClass(e,t){if(!e)return;if(e.indexOf(" ")>=0){const i=(e||"").split(" ");if(i.length>1){i.forEach(o=>this.addOrRemoveCssClass(o,t));return}}if(this.cssClassStates[e]!==t&&e.length){const i=this.getGui();i&&i.classList.toggle(e,t),this.cssClassStates[e]=t}}},Nh=0,E=null,L=class extends b{constructor(e,t){super(),this.suppressDataRefValidation=!1,this.displayed=!0,this.visible=!0,this.compId=Nh++,this.cssClassManager=new Eo(()=>this.eGui),this.componentSelectors=new Map((t??[]).map(s=>[s.selector,s])),e&&this.setTemplate(e)}preConstruct(){this.wireTemplate(this.getGui());const e="component-"+Object.getPrototypeOf(this)?.constructor?.name;this.css?.forEach(t=>this.beans.environment.addGlobalCSS(t,e))}wireTemplate(e,t){e&&this.gos&&(this.applyElementsToComponent(e),this.createChildComponentsFromTags(e,t))}getCompId(){return this.compId}getDataRefAttribute(e){return e.getAttribute?e.getAttribute("data-ref"):null}applyElementsToComponent(e,t,s,i=null){if(t===void 0&&(t=this.getDataRefAttribute(e)),t){const o=this[t];if(o===E)this[t]=i??e;else{const n=s&&s[t];if(!this.suppressDataRefValidation&&!n)throw new Error(`data-ref: ${t} on ${this.constructor.name} with ${o}`)}}}createChildComponentsFromTags(e,t){Vu(e.childNodes).forEach(i=>{if(!(i instanceof HTMLElement))return;const o=this.createComponentFromElement(i,n=>{n.getGui()&&this.copyAttributesFromNode(i,n.getGui())},t);if(o){if(o.addItems&&i.children.length){this.createChildComponentsFromTags(i,t);const n=Array.prototype.slice.call(i.children);o.addItems(n)}this.swapComponentForNode(o,e,i)}else i.childNodes&&this.createChildComponentsFromTags(i,t)})}createComponentFromElement(e,t,s){const i=e.nodeName,o=this.getDataRefAttribute(e),n=i.indexOf("AG-")===0,r=n?this.componentSelectors.get(i):null;let a=null;if(r){const l=s&&o?s[o]:void 0;a=new r.component(l),a.setParentComponent(this),this.createBean(a,null,t)}else if(n)throw new Error(`selector: ${i}`);return this.applyElementsToComponent(e,o,s,a),a}copyAttributesFromNode(e,t){Nu(e.attributes,(s,i)=>t.setAttribute(s,i))}swapComponentForNode(e,t,s){const i=e.getGui();t.replaceChild(i,s),t.insertBefore(document.createComment(s.nodeName),i),this.addDestroyFunc(this.destroyBean.bind(this,e))}activateTabIndex(e){const t=this.gos.get("tabIndex");e||(e=[]),e.length||e.push(this.getGui()),e.forEach(s=>s.setAttribute("tabindex",t.toString()))}setTemplate(e,t,s){const i=At(e);this.setTemplateFromElement(i,t,s)}setTemplateFromElement(e,t,s,i=!1){if(this.eGui=e,this.suppressDataRefValidation=i,t)for(let o=0;othis.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)}registerCSS(e){this.css||(this.css=[]),this.css.push(e)}};function zh(e){return typeof e.then=="function"}var te=class Is{constructor(t){this.status=0,this.resolution=null,this.waiters=[],t(s=>this.onDone(s),s=>this.onReject(s))}static all(t){return t.length?new Is(s=>{let i=t.length;const o=new Array(i);t.forEach((n,r)=>{n.then(a=>{o[r]=a,i--,i===0&&s(o)})})}):Is.resolve()}static resolve(t=null){return new Is(s=>s(t))}then(t){return new Is(s=>{this.status===1?s(t(this.resolution)):this.waiters.push(i=>s(t(i)))})}onDone(t){this.status=1,this.resolution=t,this.waiters.forEach(s=>s(t))}onReject(t){}};function Wh(e){return e?e.prototype&&"getGui"in e.prototype:!1}function da(e,t,s,i){const{name:o}=s;let n,r,a,l,d,c;if(t){const u=t,h=u[o+"Selector"],g=h?h(i):null,p=f=>{typeof f=="string"?n=f:f!=null&&f!==!0&&(e.isFrameworkComponent(f)?a=f:r=f)};g?(p(g.component),l=g.params,d=g.popup,c=g.popupPosition):p(u[o])}return{compName:n,jsComp:r,fwComp:a,paramsFromSelector:l,popupFromSelector:d,popupPositionFromSelector:c}}var _h=class extends b{constructor(){super(...arguments),this.beanName="userCompFactory"}wireBeans(e){this.agCompUtils=e.agCompUtils,this.registry=e.registry,this.frameworkCompWrapper=e.frameworkCompWrapper,this.gridOptions=e.gridOptions}getCompDetailsFromGridOptions(e,t,s,i=!1){return this.getCompDetails(this.gridOptions,e,t,s,i)}getCompDetails(e,t,s,i,o=!1){const{name:n,cellRenderer:r}=t;let{compName:a,jsComp:l,fwComp:d,paramsFromSelector:c,popupFromSelector:u,popupPositionFromSelector:h}=da(this.beans.frameworkOverrides,e,t,i),g;const p=v=>{const S=this.registry.getUserComponent(n,v);S&&(l=S.componentFromFramework?void 0:S.component,d=S.componentFromFramework?S.component:void 0,g=S.params)};if(a!=null&&p(a),l==null&&d==null&&s!=null&&p(s),l&&r&&!Wh(l)&&(l=this.agCompUtils?.adaptFunction(t,l)),!l&&!d){const{validation:v}=this.beans;o&&(a!==s||!s)?a?v?.isProvidedUserComp(a)||O(50,{compName:a}):s?v||O(260,{...this.gos.getModuleErrorParams(),propName:n,compName:s}):O(216,{name:n}):s&&!v&&O(146,{comp:s});return}const f=this.mergeParams(e,t,i,c,g),m=l==null,C=l??d;return{componentFromFramework:m,componentClass:C,params:f,type:t,popupFromSelector:u,popupPositionFromSelector:h,newAgStackInstance:()=>this.newAgStackInstance(C,m,f,t)}}newAgStackInstance(e,t,s,i){const o=!t;let n;o?n=new e:n=this.frameworkCompWrapper.wrap(e,i.mandatoryMethods,i.optionalMethods,i),this.createBean(n);const r=n.init?.(s);return r==null?te.resolve(n):r.then(()=>n)}mergeParams(e,t,s,i=null,o){const n={...s,...o},r=e,a=r&&r[t.name+"Params"];if(typeof a=="function"){const l=a(s);ie(n,l)}else typeof a=="object"&&ie(n,a);return ie(n,i),n}},Uh={name:"dateComponent",mandatoryMethods:["getDate","setDate"],optionalMethods:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","refresh"]},$h={name:"dragAndDropImageComponent",mandatoryMethods:["setIcon","setLabel"]},Kh={name:"headerComponent",optionalMethods:["refresh"]},jh={name:"innerHeaderComponent"},qh={name:"innerHeaderGroupComponent"},Yh={name:"headerGroupComponent"},Qh={name:"innerRenderer",cellRenderer:!0,optionalMethods:["afterGuiAttached"]},Zh={name:"cellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},Xh={name:"cellRenderer",optionalMethods:["refresh","afterGuiAttached"]},Jh={name:"loadingCellRenderer",cellRenderer:!0},eg={name:"cellEditor",mandatoryMethods:["getValue"],optionalMethods:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},tg={name:"loadingOverlayComponent",optionalMethods:["refresh"]},sg={name:"noRowsOverlayComponent",optionalMethods:["refresh"]},ig={name:"tooltipComponent"},Do={name:"filter",mandatoryMethods:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethods:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},og={name:"floatingFilterComponent",mandatoryMethods:["onParentModelChanged"],optionalMethods:["afterGuiAttached","refresh"]},ng={name:"fullWidthCellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},rg={name:"loadingCellRenderer",cellRenderer:!0},ag={name:"groupRowRenderer",optionalMethods:["afterGuiAttached"],cellRenderer:!0},lg={name:"detailCellRenderer",optionalMethods:["refresh"],cellRenderer:!0};function dg(e,t){return e.getCompDetailsFromGridOptions($h,"agDragAndDropImage",t,!0)}function cg(e,t,s){return e.getCompDetails(t,Qh,void 0,s)}function ug(e,t,s){return e.getCompDetails(t,Kh,"agColumnHeader",s)}function hg(e,t,s){return e.getCompDetails(t,jh,void 0,s)}function gg(e,t){const s=t.columnGroup.getColGroupDef();return e.getCompDetails(s,Yh,"agColumnGroupHeader",t)}function pg(e,t,s){return e.getCompDetails(t,qh,void 0,s)}function fg(e,t){return e.getCompDetailsFromGridOptions(ng,void 0,t,!0)}function mg(e,t){return e.getCompDetailsFromGridOptions(rg,"agLoadingCellRenderer",t,!0)}function Cg(e,t){return e.getCompDetailsFromGridOptions(ag,"agGroupRowRenderer",t,!0)}function vg(e,t){return e.getCompDetailsFromGridOptions(lg,"agDetailCellRenderer",t,!0)}function ca(e,t,s){return e.getCompDetails(t,Zh,void 0,s)}function wg(e,t,s){return e.getCompDetails(t,Xh,void 0,s)}function bg(e,t,s){return e.getCompDetails(t,Jh,"agSkeletonCellRenderer",s,!0)}function ua(e,t,s){return e.getCompDetails(t,eg,"agCellEditor",s,!0)}function ha(e,t,s,i){return e.getCompDetails(t,Do,i,s,!0)}function Sg(e,t){return e.getCompDetailsFromGridOptions(Uh,"agDateInput",t,!0)}function yg(e,t){return e.getCompDetailsFromGridOptions(tg,"agLoadingOverlay",t,!0)}function Rg(e,t){return e.getCompDetailsFromGridOptions(sg,"agNoRowsOverlay",t,!0)}function xg(e,t){return e.getCompDetails(t.colDef,ig,"agTooltipComponent",t,!0)}function ga(e,t,s,i){return e.getCompDetails(t,og,i,s)}function Fg(e,t){return da(e,t,Do)}function Eg(e,t,s){return e.mergeParams(t,Do,s)}function Bt(e){const t=e;return t!=null&&t.getFrameworkComponentInstance!=null?t.getFrameworkComponentInstance():e}var pa=new Set,oi={},ft={},ni,fa=!1,ma=!1;function Dg(e){const[t,s]=e.version.split(".")||[],[i,o]=ni.split(".")||[];return t===i&&s===o}function Pg(e){ni||(ni=e.version);const t=s=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${s} Please update all modules to the same version.`;if(e.version?Dg(e)||kt(t(`'${e.moduleName}' is version ${e.version} but the other modules are version ${ni}.`)):kt(t(`'${e.moduleName}' is incompatible.`)),e.validate){const s=e.validate();s.isValid||kt(`${s.message}`)}}function os(e,t){Pg(e);const s=e.rowModels??["all"];pa.add(e);let i;t!==void 0?(fa=!0,ft[t]===void 0&&(ft[t]={}),i=ft[t]):i=oi,s.forEach(o=>{i[o]===void 0&&(i[o]={}),i[o][e.moduleName]=e}),e.dependsOn&&e.dependsOn.forEach(o=>os(o,t))}function Mg(e){delete ft[e]}function Ca(e,t,s){const i=o=>!!oi[o]?.[e]||!!ft[t]?.[o]?.[e];return i(s)||i("all")}function Po(){return fa}function Ag(e,t){const s=ft[e]??{};return[...Object.values(oi.all??{}),...Object.values(s.all??{}),...Object.values(oi[t]??{}),...Object.values(s[t]??{})]}function Tg(){return new Set(pa)}function kg(e,t){const s=ft[e]??{};return[...Object.values(s.all??{}),...Object.values(s[t]??{})]}function Ig(){return ma}function Lg(){ma=!0}var Og=class{static register(e){os(e,void 0)}static registerModules(e){e.forEach(t=>os(t,void 0))}},Gg=class{constructor(e){this.beans={},this.createdBeans=[],this.destroyed=!1,!(!e||!e.beanClasses)&&(this.beanDestroyComparator=e.beanDestroyComparator,this.init(e))}init(e){for(const t of Object.keys(e.providedBeanInstances))this.beans[t]=e.providedBeanInstances[t];e.beanClasses.forEach(t=>{const s=new t;s.beanName?this.beans[s.beanName]=s:console.error(`Bean ${t.name} is missing beanName`),this.createdBeans.push(s)}),e.derivedBeans?.forEach(t=>{const{beanName:s,bean:i}=t(this);this.beans[s]=i,this.createdBeans.push(i)}),e.beanInitComparator&&this.createdBeans.sort(e.beanInitComparator),this.initBeans(this.createdBeans)}getBeanInstances(){return Object.values(this.beans)}createBean(e,t){if(!e)throw Error("null bean");return this.initBeans([e],t),e}initBeans(e,t){e.forEach(s=>{s.preWireBeans?.(this.beans),s.wireBeans?.(this.beans)}),e.forEach(s=>s.preConstruct?.()),t&&e.forEach(t),e.forEach(s=>s.postConstruct?.())}getBeans(){return this.beans}getBean(e){return this.beans[e]}destroy(){if(this.destroyed)return;this.destroyed=!0;const e=this.getBeanInstances();this.beanDestroyComparator&&e.sort(this.beanDestroyComparator),this.destroyBeans(e),this.beans={},this.createdBeans=[]}destroyBean(e){e?.destroy?.()}destroyBeans(e){if(e)for(let t=0;t=this.lastScrollTop,i&&e===0){const o=s?.getCurrentPage()??0;o!==this.lastPage&&(this.lastPage=o,this.scrollGoingDown=!0)}this.lastScrollTop=e}postConstruct(){this.active=!this.gos.get("suppressAnimationFrame")}verifyAnimationFrameOn(e){this.active===!1&&R(92,{methodName:e})}createTask(e,t,s){this.verifyAnimationFrameOn(s);const i={task:e,index:t,createOrder:++this.taskCount};this.addTaskToList(this[s],i),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((s,i)=>s.index!==i.index?t*(i.index-s.index):i.createOrder-s.createOrder),e.sorted=!0}addDestroyTask(e){this.verifyAnimationFrameOn("createTasksP3"),this.destroyTasks.push(e),this.schedule()}executeFrame(e){this.verifyAnimationFrameOn("executeFrame");const t=this.createTasksP1,s=t.list,i=this.createTasksP2,o=i.list,n=this.destroyTasks,r=new Date().getTime();let a=new Date().getTime()-r;const l=e<=0,d=this.beans.ctrlsSvc.getScrollFeature();for(;l||a0||(e.addEventListener("keydown",ai),e.addEventListener("mousedown",ai))}function Ug(e){ri>0||(e.removeEventListener("keydown",ai),e.removeEventListener("mousedown",ai))}function ai(e){const t=Ao,s=e.type==="keydown";s&&(e.ctrlKey||e.metaKey||e.altKey)||t!==s&&(Ao=s)}function $g(e){const t=_(e);return _g(t),ri++,()=>{ri--,Ug(t)}}function ba(){return Ao}function Sa(e,t,s){t.addManagedElementListeners(s,{keydown:i=>{if(!i.defaultPrevented&&i.key===w.TAB){const o=i.shiftKey;Ye(e,s,!1,o)||vt(e,o)&&i.preventDefault()}}})}function mt(e,t,s=!1){const i=Ou;let o=rr;t&&(o+=", "+t),s&&(o+=', [tabindex="-1"]');const n=Array.prototype.slice.apply(e.querySelectorAll(i)).filter(l=>me(l)),r=Array.prototype.slice.apply(e.querySelectorAll(o));return r.length?((l,d)=>l.filter(c=>d.indexOf(c)===-1))(n,r):n}function qe(e,t=!1,s=!1,i=!1){const o=mt(e,i?".ag-tab-guard":null,s),n=t?H(o):o[0];return n?(n.focus({preventScroll:!0}),!0):!1}function Ye(e,t,s,i){const o=mt(t,s?':not([tabindex="-1"])':null),n=z(e);let r;s?r=o.findIndex(l=>l.contains(n)):r=o.indexOf(n);const a=r+(i?-1:1);return a<0||a>=o.length?null:o[a]}function To(e,t=5){let s=0;for(;e&&so(e)===null&&++s<=t;)e=e.parentElement;return so(e)===null?null:e}function ya(e,t){return e.ctrlsSvc.get("gridCtrl").focusInnerElement(t)}function Ct(e){return e.gos.get("suppressHeaderFocus")||!!e.overlays?.isExclusive()}function li(e){return e.gos.get("suppressCellFocus")||!!e.overlays?.isExclusive()}function vt(e,t,s=!1){const i=e.ctrlsSvc.get("gridCtrl");return!s&&i.focusNextInnerContainer(t)?!0:((s||!t&&!i.isDetailGrid())&&i.forceFocusOutOfContainer(t),!1)}function Kg(e,t=!1){return e===w.DELETE?!0:!t&&e===w.BACKSPACE?ir():!1}var jg=class extends b{constructor(e,t,s,i){super(),this.cellCtrl=e,this.rowNode=s,this.rowCtrl=i,this.beans=t}init(){this.eGui=this.cellCtrl.eGui}onKeyDown(e){const t=e.key;switch(t){case w.ENTER:this.onEnterKeyDown(e);break;case w.F2:this.onF2KeyDown(e);break;case w.ESCAPE:this.onEscapeKeyDown(e);break;case w.TAB:this.onTabKeyDown(e);break;case w.BACKSPACE:case w.DELETE:this.onBackspaceOrDeleteKeyDown(t,e);break;case w.DOWN:case w.UP:case w.RIGHT:case w.LEFT:this.onNavigationKeyDown(e,t);break}}onNavigationKeyDown(e,t){if(!this.cellCtrl.editing){if(e.shiftKey&&this.cellCtrl.isRangeSelectionEnabled())this.onShiftRangeSelect(e);else{const s=this.cellCtrl.getFocusedCellPosition();this.beans.navigation?.navigateToNextCell(e,t,s,!0)}e.preventDefault()}}onShiftRangeSelect(e){const{rangeSvc:t,navigation:s}=this.beans;if(!t)return;const i=t.extendLatestRangeInDirection(e);i&&s?.ensureCellVisible(i)}onTabKeyDown(e){this.beans.navigation?.onTabKeyDown(this.cellCtrl,e)}onBackspaceOrDeleteKeyDown(e,t){const{cellCtrl:s,beans:i,rowNode:o}=this,{gos:n,rangeSvc:r,eventSvc:a}=i;if(!s.editing){if(a.dispatchEvent({type:"keyShortcutChangedCellStart"}),Kg(e,n.get("enableCellEditingOnBackspace"))){if(r&&xe(n))r.clearCellRangeCellValues({dispatchWrapperEvents:!0,wrapperEventSource:"deleteKey"});else if(s.isCellEditable()){const{column:l}=s,d=this.beans.valueSvc.getDeleteValue(l,o);o.setDataValue(l,d,"cellClear")}}else i.editSvc?.startRowOrCellEdit(s,e,t);a.dispatchEvent({type:"keyShortcutChangedCellEnd"})}}onEnterKeyDown(e){const{cellCtrl:t,beans:s}=this;if(t.editing||this.rowCtrl.editing)t.stopEditingAndFocus(!1,e.shiftKey);else if(s.gos.get("enterNavigatesVertically")){const i=e.shiftKey?w.UP:w.DOWN;s.navigation?.navigateToNextCell(null,i,t.cellPosition,!1)}else s.editSvc?.startRowOrCellEdit(t,w.ENTER,e),t.editing&&e.preventDefault()}onF2KeyDown(e){const{cellCtrl:t,beans:s}=this;t.editing||s.editSvc?.startRowOrCellEdit(t,w.F2,e)}onEscapeKeyDown(e){const{cellCtrl:t,beans:s}=this;t.editing&&(s.editSvc?.stopRowOrCellEdit(t,!0),t.focusCell(!0))}processCharacter(e){if(e.target!==this.eGui||this.cellCtrl.editing)return;const i=e.key;i===w.SPACE?this.onSpaceKeyDown(e):this.beans.editSvc?.startRowOrCellEdit(this.cellCtrl,i,e)&&e.preventDefault()}onSpaceKeyDown(e){const{gos:t}=this.beans;!this.cellCtrl.editing&&$e(t)&&this.beans.selectionSvc?.handleSelectionEvent(e,this.rowNode,"spaceKey"),e.preventDefault()}destroy(){super.destroy()}},qg=class extends b{constructor(e,t,s){super(),this.cellCtrl=e,this.column=s,this.beans=t}onMouseEvent(e,t){if(!Fe(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);break}}onCellClicked(e){if(this.beans.touchSvc?.handleCellDoubleClick(this,e))return;const{eventSvc:t,rangeSvc:s,gos:i,editSvc:o}=this.beans,n=e.ctrlKey||e.metaKey;s&&n&&s.getCellRangeCount(this.cellCtrl.cellPosition)>1&&s.intersectLastRange(!0);const r=this.cellCtrl.createEvent(e,"cellClicked");t.dispatchEvent(r);const a=this.column.getColDef();a.onCellClicked&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{a.onCellClicked(r)})},0),(i.get("singleClickEdit")||a.singleClickEdit)&&!i.get("suppressClickEdit")&&!(e.shiftKey&&s?.getCellRanges().length!=0)&&o?.startRowOrCellEdit(this.cellCtrl,void 0,e)}onCellDoubleClicked(e){const{column:t,beans:s,cellCtrl:i}=this,{eventSvc:o,frameworkOverrides:n,gos:r,editSvc:a}=s,l=t.getColDef(),d=i.createEvent(e,"cellDoubleClicked");o.dispatchEvent(d),typeof l.onCellDoubleClicked=="function"&&window.setTimeout(()=>{n.wrapOutgoing(()=>{l.onCellDoubleClicked(d)})},0),!r.get("singleClickEdit")&&!r.get("suppressClickEdit")&&a?.startRowOrCellEdit(i,null,e)}onMouseDown(e){const{ctrlKey:t,metaKey:s,shiftKey:i}=e,o=e.target,{cellCtrl:n,beans:r}=this,{eventSvc:a,rangeSvc:l,rowNumbersSvc:d,focusSvc:c,gos:u}=r;if(this.isRightClickInExistingRange(e))return;const h=l&&!l.isEmpty(),g=this.containsWidget(o),{cellPosition:p}=n,f=Ot(p.column);if(d&&f&&!d.handleMouseDownOnCell(p,e)){l&&e.preventDefault(),e.stopImmediatePropagation();return}if(!i||!h){const C=u.get("enableCellTextSelection")&&e.defaultPrevented,v=(Ie()||C)&&!n.editing&&!io(o)&&!g;n.focusCell(v)}if(i&&h&&!c.isCellFocused(p)){e.preventDefault();const m=c.getFocusedCell();if(m){const{column:C,rowIndex:v,rowPinned:S}=m,D=r.rowRenderer.getRowByPosition({rowIndex:v,rowPinned:S})?.getCellCtrl(C);D?.editing&&D.stopEditing(),c.setFocusedCell({column:C,rowIndex:v,rowPinned:S,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}}if(!g){if(l)if(f&&e.preventDefault(),i)l.extendLatestRangeToCell(p);else{const m=t||s;l.setRangeToCell(p,m)}a.dispatchEvent(this.cellCtrl.createEvent(e,"cellMouseDown"))}}isRightClickInExistingRange(e){const{rangeSvc:t}=this.beans;if(t){const s=t.isCellInAnyRange(this.cellCtrl.cellPosition),i=e.button===2||e.ctrlKey&&this.beans.gos.get("allowContextMenuWithControlKey");if(s&&i)return!0}return!1}containsWidget(e){return st(e,"ag-selection-checkbox",3)||st(e,"ag-drag-handle",3)}onMouseOut(e){if(this.mouseStayingInsideCell(e))return;const{eventSvc:t,colHover:s}=this.beans;t.dispatchEvent(this.cellCtrl.createEvent(e,"cellMouseOut")),s?.clearMouseOver()}onMouseOver(e){if(this.mouseStayingInsideCell(e))return;const{eventSvc:t,colHover:s}=this.beans;t.dispatchEvent(this.cellCtrl.createEvent(e,"cellMouseOver")),s?.setMouseOver([this.column])}mouseStayingInsideCell(e){if(!e.target||!e.relatedTarget)return!1;const t=this.cellCtrl.eGui,s=t.contains(e.target),i=t.contains(e.relatedTarget);return s&&i}destroy(){super.destroy()}},Yg=class extends b{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.column=e.column,this.rowNode=e.rowNode}setupRowSpan(){this.rowSpan=this.column.getRowSpan(this.rowNode),this.addManagedListeners(this.beans.eventSvc,{newColumnsLoaded:()=>this.onNewColumnsLoaded()})}init(){this.eSetLeft=this.cellCtrl.getRootElement(),this.eContent=this.cellCtrl.eGui;const e=this.cellCtrl.getCellSpan();e||(this.setupColSpan(),this.setupRowSpan()),this.onLeftChanged(),this.onWidthChanged(),e||this._legacyApplyRowSpan(),e&&(this.refreshSpanHeight(e),this.addManagedListeners(this.beans.eventSvc,{modelUpdated:this.refreshSpanHeight.bind(this,e),recalculateRowBounds:this.refreshSpanHeight.bind(this,e)}))}refreshSpanHeight(e){const t=e.getCellHeight();t!=null&&(this.eContent.style.height=`${t}px`)}onNewColumnsLoaded(){const e=this.column.getRowSpan(this.rowNode);this.rowSpan!==e&&(this.rowSpan=e,this._legacyApplyRowSpan(!0))}onDisplayColumnsChanged(){const e=this.getColSpanningList();je(this.colsSpanning,e)||(this.colsSpanning=e,this.onWidthChanged(),this.onLeftChanged())}setupColSpan(){this.column.getColDef().colSpan!=null&&(this.colsSpanning=this.getColSpanningList(),this.addManagedListeners(this.beans.eventSvc,{displayedColumnsChanged:this.onDisplayColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onWidthChanged.bind(this)}))}onWidthChanged(){if(!this.eContent)return;const e=this.getCellWidth();this.eContent.style.width=`${e}px`}getCellWidth(){return this.colsSpanning?this.colsSpanning.reduce((e,t)=>e+t.getActualWidth(),0):this.column.getActualWidth()}getColSpanningList(){const{column:e,rowNode:t}=this,s=e.getColSpan(t),i=[];if(s===1)i.push(e);else{let o=e;const n=e.getPinned();for(let r=0;o&&rthis.removeFeatures()),this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus")),this.onCellFocused(this.focusEventToRestore),this.applyStaticCssClasses(),this.setWrapText(),this.onFirstRightPinnedChanged(),this.onLastLeftPinnedChanged(),this.onColumnHover(),this.setupControlComps(),this.setupAutoHeight(i,r),this.refreshFirstAndLastStyles(),this.refreshAriaColIndex(),this.positionFeature?.init(),this.customStyleFeature?.setComp(e),this.tooltipFeature?.refreshTooltip(),this.keyboardListener?.init(),this.rangeFeature?.setComp(e),n&&this.isCellEditable()?this.beans.editSvc?.startEditing(this):this.showValue(!1,!0),this.onCompAttachedFuncs.length&&(this.onCompAttachedFuncs.forEach(a=>a()),this.onCompAttachedFuncs=[])}setupAutoHeight(e,t){this.isAutoHeight=this.beans.rowAutoHeight?.setupCellAutoHeight(this,e,t)??!1}getCellAriaRole(){return this.column.getColDef().cellAriaRole??"gridcell"}isCellRenderer(){const e=this.column.getColDef();return e.cellRenderer!=null||e.cellRendererSelector!=null}getValueToDisplay(){return this.valueFormatted??this.value}showValue(e,t){const{beans:s,column:i,rowNode:o,rangeFeature:n}=this,{userCompFactory:r}=s,a=this.getValueToDisplay();let l;if(o.stub&&o.groupData?.[i.getId()]==null){const c=this.createCellRendererParams();l=bg(r,i.getColDef(),c)}else if(this.isCellRenderer()){const c=this.createCellRendererParams();l=ca(r,i.getColDef(),c)}this.comp.setRenderDetails(l,a,e),!t&&n&&Pe(s,()=>n?.refreshHandle())}setupControlComps(){const e=this.column.getColDef();this.includeSelection=this.isIncludeControl(this.isCheckboxSelection(e)),this.includeRowDrag=this.isIncludeControl(e.rowDrag),this.includeDndSource=this.isIncludeControl(e.dndSource),this.comp.setIncludeSelection(this.includeSelection),this.comp.setIncludeDndSource(this.includeDndSource),this.comp.setIncludeRowDrag(this.includeRowDrag)}isForceWrapper(){return this.beans.gos.get("enableCellTextSelection")||this.column.isAutoHeight()}isIncludeControl(e){return this.rowNode.rowPinned!=null?!1:typeof e=="function"||e===!0}isCheckboxSelection(e){const{rowSelection:t}=this.beans.gridOptions;return e.checkboxSelection||De(this.column)&&t&&typeof t!="string"&&ht(t)}refreshShouldDestroy(){const e=this.column.getColDef(),t=this.includeSelection!=this.isIncludeControl(this.isCheckboxSelection(e)),s=this.includeRowDrag!=this.isIncludeControl(e.rowDrag),i=this.includeDndSource!=this.isIncludeControl(e.dndSource),o=this.isAutoHeight!=this.column.isAutoHeight();return t||s||i||o}onPopupEditorClosed(){this.editing&&this.stopEditingAndFocus()}stopEditing(e=!1){return this.beans.editSvc?.stopEditing(this,e)??!1}createCellRendererParams(){const{value:e,valueFormatted:t,column:s,rowNode:i,comp:o,eGui:n,beans:{valueSvc:r,gos:a}}=this;return k(a,{value:e,valueFormatted:t,getValue:()=>r.getValueForDisplay(s,i),setValue:d=>r.setValue(i,s,d),formatValue:this.formatValue.bind(this),data:i.data,node:i,pinned:s.getPinned(),colDef:s.getColDef(),column:s,refreshCell:this.refreshCell.bind(this),eGridCell:n,eParentOfValue:o.getParentOfValue(),registerRowDragger:(d,c,u,h)=>this.registerRowDragger(d,c,h),setTooltip:(d,c)=>{a.assertModuleRegistered("Tooltip",3),this.tooltipFeature&&this.disableTooltipFeature(),this.enableTooltipFeature(d,c),this.tooltipFeature?.refreshTooltip()}})}onCellChanged(e){e.column===this.column&&this.refreshCell({})}refreshOrDestroyCell(e){this.refreshShouldDestroy()?this.rowCtrl?.recreateCell(this):this.refreshCell(e)}refreshCell(e){if(this.suppressRefreshCell||this.editing)return;const t=this.column.getColDef(),s=e!=null&&!!e.newData,i=e!=null&&!!e.suppressFlash,o=t.field==null&&t.valueGetter==null&&t.showRowGroup==null,n=e&&e.forceRefresh||o||s,r=!!this.comp,a=this.updateAndFormatValue(r),l=n||a;if(r){if(l){this.showValue(s,!1);const d=this.beans.filterManager?.isSuppressFlashingCellsBecauseFiltering();!i&&!d&&t.enableCellChangeFlash&&this.beans.cellFlashSvc?.flashCell(this),this.customStyleFeature?.applyUserStyles(),this.customStyleFeature?.applyClassesFromColDef()}this.tooltipFeature?.refreshTooltip(),this.customStyleFeature?.applyCellClassRules()}}stopEditingAndFocus(e=!1,t=!1){this.beans.editSvc?.stopEditingAndFocus(this,e,t)}isCellEditable(){return this.column.isCellEditable(this.rowNode)}formatValue(e){return this.callValueFormatter(e)??e}callValueFormatter(e){return this.beans.valueSvc.formatValue(this.column,this.rowNode,e)}updateAndFormatValue(e){const t=this.value,s=this.valueFormatted;return this.value=this.beans.valueSvc.getValueForDisplay(this.column,this.rowNode),this.valueFormatted=this.callValueFormatter(this.value),e?!this.valuesAreEqual(t,this.value)||this.valueFormatted!=s:!0}valuesAreEqual(e,t){const s=this.column.getColDef();return s.equals?s.equals(e,t):e===t}addDomData(e){const t=this.eGui;lt(this.beans.gos,t,di,this),e.addDestroyFunc(()=>lt(this.beans.gos,t,di,null))}createEvent(e,t){const{rowNode:s,column:i,value:o,beans:n}=this;return k(n.gos,{type:t,node:s,data:s.data,value:o,column:i,colDef:i.getColDef(),rowPinned:s.rowPinned,event:e,rowIndex:s.rowIndex})}processCharacter(e){this.keyboardListener?.processCharacter(e)}onKeyDown(e){this.keyboardListener?.onKeyDown(e)}onMouseEvent(e,t){this.mouseListener?.onMouseEvent(e,t)}getColSpanningList(){return this.positionFeature.getColSpanningList()}onLeftChanged(){this.comp&&this.positionFeature?.onLeftChanged()}onDisplayedColumnsChanged(){this.eGui&&(this.refreshAriaColIndex(),this.refreshFirstAndLastStyles())}refreshFirstAndLastStyles(){const{comp:e,column:t,beans:s}=this;va(e,t,s.visibleCols)}refreshAriaColIndex(){const e=this.beans.visibleCols.getAriaColIndex(this.column);$i(this.eGui,e)}onWidthChanged(){return this.positionFeature?.onWidthChanged()}getRowPosition(){const{rowIndex:e,rowPinned:t}=this.cellPosition;return{rowIndex:e,rowPinned:t}}updateRangeBordersIfRangeCount(){this.comp&&this.rangeFeature?.updateRangeBordersIfRangeCount()}onCellSelectionChanged(){this.comp&&this.rangeFeature?.onCellSelectionChanged()}isRangeSelectionEnabled(){return this.rangeFeature!=null}focusCell(e=!1){this.beans.focusSvc.setFocusedCell({...this.getFocusedCellPosition(),forceBrowserFocus:e})}onRowIndexChanged(){this.createCellPosition(),this.onCellFocused(),this.rangeFeature?.onCellSelectionChanged()}onSuppressCellFocusChanged(e){const t=this.eGui;t&&(Ot(this.column)&&(e=!0),Ce(t,"tabindex",e?void 0:-1))}onFirstRightPinnedChanged(){if(!this.comp)return;const e=this.column.isFirstRightPinned();this.comp.addOrRemoveCssClass(ep,e)}onLastLeftPinnedChanged(){if(!this.comp)return;const e=this.column.isLastLeftPinned();this.comp.addOrRemoveCssClass(tp,e)}isCellFocused(){return this.beans.focusSvc.isCellFocused(this.cellPosition)}onCellFocused(e){const{beans:t}=this;if(li(t))return;const s=this.isCellFocused();if(!this.comp){s&&e?.forceBrowserFocus&&(this.focusEventToRestore=e);return}if(this.focusEventToRestore=void 0,this.comp.addOrRemoveCssClass(Jg,s),s&&e&&e.forceBrowserFocus){let o=this.comp.getFocusableElement();if(this.editing){const n=mt(o,null,!0);n.length&&(o=n[0])}o.focus({preventScroll:!!e.preventScrollOnBrowserFocus})}const i=t.gos.get("editType")==="fullRow";!s&&!i&&this.editing&&t.editSvc?.stopRowOrCellEdit(this),s&&this.rowCtrl.announceDescription()}createCellPosition(){const{rowIndex:e,rowPinned:t}=this.rowNode;this.cellPosition={rowIndex:e,rowPinned:Re(t),column:this.column}}setInlineEditingCss(){this.beans.editSvc?.setInlineEditingCss(this.rowCtrl)}applyStaticCssClasses(){const{comp:e}=this;e.addOrRemoveCssClass(Qg,!0),e.addOrRemoveCssClass(sp,!0);const t=this.column.isAutoHeight()==!0;e.addOrRemoveCssClass(Zg,t),e.addOrRemoveCssClass(Xg,!t)}onColumnHover(){this.beans.colHover?.onCellColumnHover(this.column,this.comp)}onColDefChanged(){this.comp&&(this.column.isTooltipEnabled()?(this.disableTooltipFeature(),this.enableTooltipFeature()):this.disableTooltipFeature(),this.setWrapText(),this.editing?this.beans.editSvc?.handleColDefChanged(this):this.refreshOrDestroyCell({forceRefresh:!0,suppressFlash:!0}))}setWrapText(){const e=this.column.getColDef().wrapText==!0;this.comp.addOrRemoveCssClass(ip,e)}dispatchCellContextMenuEvent(e){const t=this.column.getColDef(),s=this.createEvent(e,"cellContextMenu"),{beans:i}=this;i.eventSvc.dispatchEvent(s),t.onCellContextMenu&&window.setTimeout(()=>{i.frameworkOverrides.wrapOutgoing(()=>{t.onCellContextMenu(s)})},0)}getCellRenderer(){return this.comp?.getCellRenderer()??null}destroy(){this.onCompAttachedFuncs=[],this.onEditorAttachedFuncs=[],super.destroy()}createSelectionCheckbox(){const e=this.beans.selectionSvc?.createCheckboxSelectionComponent();if(e)return this.beans.context.createBean(e),e.init({rowNode:this.rowNode,column:this.column}),e}createDndSource(){const e=this.beans.registry.createDynamicBean("dndSourceComp",!1,this.rowNode,this.column,this.eGui);return e&&this.beans.context.createBean(e),e}registerRowDragger(e,t,s){if(this.customRowDragComp){this.customRowDragComp.setDragElement(e,t);return}const i=this.createRowDragComp(e,t,s);i&&(this.customRowDragComp=i,this.addDestroyFunc(()=>{this.beans.context.destroyBean(i),this.customRowDragComp=null}))}createRowDragComp(e,t,s){const i=this.beans.rowDragSvc?.createRowDragCompForCell(this.rowNode,this.column,()=>this.value,e,t,s);if(i)return this.beans.context.createBean(i),i}cellEditorAttached(){this.onEditorAttachedFuncs.forEach(e=>e()),this.onEditorAttachedFuncs=[]}setFocusedCellPosition(e){}getFocusedCellPosition(){return this.cellPosition}refreshAriaRowIndex(){}getRootElement(){return this.eGui}},Ra="__ag_grid_instance";function xa(e,t){t[Ra]=e.gridInstanceId}function ci(e,t){return Fa(e,t.target)}function Fa(e,t){let s=t;for(;s;){const i=s[Ra];if(x(i))return i===e.gridInstanceId;s=s.parentElement}return!1}function Ea(e,t){return ko(e,t.target)?.getFocusedCellPosition()??null}function ui(e,t){const s=Q(e.gos,"normal"),i=t;let o,n;if(i.clientX!=null||i.clientY!=null?(o=i.clientX,n=i.clientY):(o=i.x,n=i.y),s){const r=e.ctrlsSvc.getScrollFeature(),a=r.getVScrollPosition(),l=r.getHScrollPosition();o+=l.left,n+=a.top}return{x:o,y:n}}var Da=(e=>(e[e.ToolPanel=0]="ToolPanel",e[e.HeaderCell=1]="HeaderCell",e[e.RowDrag=2]="RowDrag",e[e.ChartPanel=3]="ChartPanel",e[e.AdvancedFilterBuilder=4]="AdvancedFilterBuilder",e))(Da||{}),np=class extends b{constructor(){super(...arguments),this.beanName="dragAndDrop",this.dragSourceAndParamsList=[],this.dropTargets=[]}wireBeans(e){this.ctrlsSvc=e.ctrlsSvc,this.dragSvc=e.dragSvc,this.environment=e.environment,this.userCompFactory=e.userCompFactory}addDragSource(e,t=!1){const s={eElement:e.eElement,dragStartPixels:e.dragStartPixels,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),onDragCancel:this.onDragCancel.bind(this),includeTouch:t};this.dragSourceAndParamsList.push({params:s,dragSource:e}),this.dragSvc.addDragSource(s)}getDragAndDropImageComponent(){const{dragAndDropImageComp:e}=this;return!e||!e.comp?null:e.comp}removeDragSource(e){const{dragSourceAndParamsList:t,dragSvc:s}=this,i=t.find(o=>o.dragSource===e);i&&(s.removeDragSource(i.params),ue(t,i))}destroy(){const{dragSourceAndParamsList:e,dragSvc:t,dropTargets:s}=this;e.forEach(i=>t.removeDragSource(i.params)),e.length=0,s.length=0,this.clearDragAndDropProperties(),super.destroy()}nudge(){this.dragging&&this.onDragging(this.eventLastTime,!0)}onDragStart(e,t){this.dragging=!0,this.dragSource=e,this.eventLastTime=t,this.dragItem=e.getDragItem(),e.onDragStarted?.(),this.createDragAndDropImageComponent()}onDragStop(e){this.dragSource?.onDragStopped?.();const{lastDropTarget:t}=this;if(t?.onDragStop){const s=this.createDropTargetEvent(t,e,null,null,!1);t.onDragStop(s)}this.clearDragAndDropProperties()}onDragCancel(){const{dragSource:e,lastDropTarget:t}=this;e?.onDragCancelled?.(),t?.onDragCancel&&t.onDragCancel(this.createDropTargetEvent(t,this.eventLastTime,null,null,!1)),this.clearDragAndDropProperties()}clearDragAndDropProperties(){this.eventLastTime=null,this.dragging=!1,this.lastDropTarget=void 0,this.dragItem=null,this.dragSource=null,this.removeDragAndDropImageComponent()}onDragging(e,t=!1){const s=this.getHorizontalDirection(e),i=this.getVerticalDirection(e);this.eventLastTime=e,this.positionDragAndDropImageComp(e);const o=this.dropTargets.filter(c=>this.isMouseOnDropTarget(e,c)),n=this.findCurrentDropTarget(e,o),{lastDropTarget:r,dragSource:a,dragAndDropImageComp:l,dragItem:d}=this;if(n!==r){if(this.leaveLastTargetIfExists(e,s,i,t),r!==null&&n===null&&a?.onGridExit?.(d),r===null&&n!==null&&a?.onGridEnter?.(d),this.enterDragTargetIfExists(n,e,s,i,t),n&&l){const{comp:c,promise:u}=l;c?c.setIcon(n.getIconName?n.getIconName():null,!1):u.then(h=>{h&&h.setIcon(n.getIconName?n.getIconName():null,!1)})}this.lastDropTarget=n}else if(n&&n.onDragging){const c=this.createDropTargetEvent(n,e,s,i,t);n.onDragging(c)}}getAllContainersFromDropTarget(e){const t=e.getSecondaryContainers?e.getSecondaryContainers():null,s=[[e.getContainer()]];return t?s.concat(t):s}isMouseOnDropTarget(e,t){const s=this.getAllContainersFromDropTarget(t);let i=!1;const o=(a,l)=>{for(const d of l){const{width:c,height:u,left:h,right:g,top:p,bottom:f}=d.getBoundingClientRect();if(c===0||u===0)return!1;const m=a.clientX>=h&&a.clientX=p&&a.clientYl).indexOf(n)!==-1)return r;return null}enterDragTargetIfExists(e,t,s,i,o){if(e&&e.onDragEnter){const n=this.createDropTargetEvent(e,t,s,i,o);e.onDragEnter(n)}}leaveLastTargetIfExists(e,t,s,i){const{lastDropTarget:o}=this;if(!o)return;if(o.onDragLeave){const r=this.createDropTargetEvent(o,e,t,s,i);o.onDragLeave(r)}const n=this.getDragAndDropImageComponent();n&&n.setIcon(null,!1)}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(s=>s.external).find(s=>s.getContainer()===e.getContainer())||null}isDropZoneWithinThisGrid(e){const s=this.ctrlsSvc.getGridBodyCtrl().eGridBody,{dropZoneTarget:i}=e;return s.contains(i)}getHorizontalDirection(e){const t=this.eventLastTime?.clientX,s=e.clientX;return t===s?null:t>s?"left":"right"}getVerticalDirection(e){const t=this.eventLastTime?.clientY,s=e.clientY;return t===s?null:t>s?"up":"down"}createDropTargetEvent(e,t,s,i,o){const n=e.getContainer(),r=n.getBoundingClientRect(),{dragItem:a,dragSource:l,gos:d}=this,c=t.clientX-r.left,u=t.clientY-r.top;return k(d,{event:t,x:c,y:u,vDirection:i,hDirection:s,dragSource:l,fromNudge:o,dragItem:a,dropZoneTarget:n})}positionDragAndDropImageComp(e){const t=this.getDragAndDropImageComponent();t&&Pr(t.getGui(),e,this.beans)}removeDragAndDropImageComponent(){const{dragAndDropImageComp:e}=this;if(e){const{comp:t}=e;if(t){const s=t.getGui();this.dragAndDropImageParent?.removeChild(s),this.destroyBean(t)}}this.dragAndDropImageComp=null}createDragAndDropImageComponent(){const{dragSource:e,gos:t,userCompFactory:s}=this;if(!e)return;const i=dg(s,k(t,{dragSource:e}));if(!i)return;const o=i.newAgStackInstance();this.dragAndDropImageComp={promise:o},o.then(n=>{!n||!this.isAlive()||(this.processDragAndDropImageComponent(n),this.dragAndDropImageComp.comp=n)})}processDragAndDropImageComponent(e){const{dragSource:t,environment:s}=this;if(!t)return;const i=e.getGui();i.style.setProperty("position","absolute"),i.style.setProperty("z-index","9999"),xa(this.gos,i),s.applyThemeClasses(i),e.setIcon(null,!1);let{dragItemName:o}=t;typeof o=="function"&&(o=o()),e.setLabel(o||""),i.style.top="20px",i.style.left="20px";const n=Ys(this.beans);this.dragAndDropImageParent=n,n?n.appendChild(i):R(54)}registerGridDropTarget(e,t){const s={getContainer:e,isInterestedIn:i=>i===1||i===0,getIconName:()=>"notAllowed"};this.addDropTarget(s),t.addDestroyFunc(()=>this.removeDropTarget(s))}},Pa=class{constructor(e){this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=e.scrollContainer,this.scrollHorizontally=e.scrollAxis.indexOf("x")!==-1,this.scrollVertically=e.scrollAxis.indexOf("y")!==-1,this.scrollByTick=e.scrollByTick!=null?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 s=t||this.shouldSkipVerticalScroll();if(s&&this.shouldSkipHorizontalScroll())return;const i=this.scrollContainer.getBoundingClientRect(),o=this.scrollByTick;this.tickLeft=e.clientXi.right-o,this.tickUp=e.clientYi.bottom-o&&!s,this.tickLeft||this.tickRight||this.tickUp||this.tickDown?this.ensureTickingStarted():this.ensureCleared()}ensureTickingStarted(){this.tickingInterval===null&&(this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0)}doTick(){this.tickCount++;const e=this.tickCount>20?200:this.tickCount>10?80:40;if(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)}};function Ma(e){const{rowIndex:t,rowPinned:s,column:i}=e;return`${t}.${s??"null"}.${i.getId()}`}function hi(e,t){const s=e.column===t.column,i=e.rowPinned===t.rowPinned,o=e.rowIndex===t.rowIndex;return s&&i&&o}function Aa(e,t){switch(e.rowPinned){case"top":if(t.rowPinned!=="top")return!0;break;case"bottom":if(t.rowPinned!=="bottom")return!1;break;default:if(x(t.rowPinned))return t.rowPinned!=="top";break}return e.rowIndex{const o=i.gridBodyCtrl;this.autoScrollService=new Pa({scrollContainer:o.eBodyViewport,scrollAxis:"y",getVerticalPosition:()=>o.scrollFeature.getVScrollPosition().top,setVerticalPosition:n=>o.scrollFeature.setVerticalScrollPosition(n),onScrollCallback:()=>{this.onDragging(this.lastDraggingEvent)}})})}getContainer(){return this.eContainer}isInterestedIn(e){return e===2}getIconName(){return this.gos.get("rowDragManaged")&&this.shouldPreventRowMove()?"notAllowed":"move"}shouldPreventRowMove(){const{rowGroupColsSvc:e,filterManager:t,sortSvc:s}=this.beans;return!!((e?.columns??[]).length||t?.isAnyFilterPresent()||s?.isSortActive())}getRowNodes(e){if(!this.isFromThisGrid(e))return e.dragItem.rowNodes||[];const t=e.dragItem.rowNode;if(this.gos.get("rowDragMultiRow")){const i=[...this.beans.selectionSvc?.getSelectedNodes()??[]].sort((o,n)=>o.rowIndex==null||n.rowIndex==null?0:this.getRowIndexNumber(o)-this.getRowIndexNumber(n));if(i.indexOf(t)!==-1)return i}return[t]}onDragEnter(e){e.dragItem.rowNodes=this.getRowNodes(e),this.dispatchGridEvent("rowDragEnter",e),this.getRowNodes(e).forEach(t=>{this.setRowNodeDragging(t,!0)}),this.onEnterOrDragging(e)}onDragging(e){this.onEnterOrDragging(e)}isFromThisGrid(e){const{dragSourceDomDataKey:t}=e.dragSource;return t===this.gos.getDomDataKey()}onEnterOrDragging(e){this.dispatchGridEvent("rowDragMove",e),this.lastDraggingEvent=e;const t=ui(this.beans,e).y;this.gos.get("rowDragManaged")&&this.doManagedDrag(e,t),this.autoScrollService.check(e.event)}doManagedDrag(e,t){const{dragAndDrop:s,gos:i}=this.beans,o=this.isFromThisGrid(e),n=i.get("rowDragManaged"),r=e.dragItem.rowNodes;n&&this.shouldPreventRowMove()||(i.get("suppressMoveWhenRowDragging")||!o?s.isDropZoneWithinThisGrid(e)&&this.clientSideRowModel.highlightRowAtPixel(r[0],t):this.moveRows(r,t))}getRowIndexNumber(e){const t=e.getRowIndexString();return parseInt(H(t.split("-")),10)}moveRowAndClearHighlight(e){const t=this.clientSideRowModel,s=t.getLastHighlightedRowNode(),i=s&&s.highlighted==="Below",o=ui(this.beans,e).y,n=e.dragItem.rowNodes;let r=i?1:0;if(this.isFromThisGrid(e))n.forEach(a=>{a.rowTop!t.getRowNode(a?.({data:d.data,level:0,rowPinned:d.rowPinned})??d.data.id)).map(d=>d.data),addIndex:l})}this.clearRowHighlight()}clearRowHighlight(){this.clientSideRowModel.highlightRowAtPixel(null)}moveRows(e,t,s=0){const i=this.beans.focusSvc,o=i.getFocusedCell(),n=o&&wt(this.beans,o);this.clientSideRowModel.ensureRowsAtPixel(e,t,s)&&(n?n.focusCell():i.clearFocusedCell())}addRowDropZone(e){if(!e.getContainer()){R(55);return}const t=this.beans.dragAndDrop;if(t.findExternalZone(e)){R(56);return}let s={getContainer:e.getContainer};e.fromGrid?s=e:(e.onDragEnter&&(s.onDragEnter=o=>{e.onDragEnter(this.draggingToRowDragEvent("rowDragEnter",o))}),e.onDragLeave&&(s.onDragLeave=o=>{e.onDragLeave(this.draggingToRowDragEvent("rowDragLeave",o))}),e.onDragging&&(s.onDragging=o=>{e.onDragging(this.draggingToRowDragEvent("rowDragMove",o))}),e.onDragStop&&(s.onDragStop=o=>{e.onDragStop(this.draggingToRowDragEvent("rowDragEnd",o))}),e.onDragCancel&&(s.onDragCancel=o=>{e.onDragCancel(this.draggingToRowDragEvent("rowDragCancel",o))}));const i={isInterestedIn:o=>o===2,getIconName:()=>"move",external:!0,...s};t.addDropTarget(i),this.addDestroyFunc(()=>t.removeDropTarget(i))}getRowDropZone(e){const t=this.getContainer.bind(this),s=this.onDragEnter.bind(this),i=this.onDragLeave.bind(this),o=this.onDragging.bind(this),n=this.onDragStop.bind(this),r=this.onDragCancel.bind(this);let a;return e?a={getContainer:t,onDragEnter:e.onDragEnter?l=>{s(l),e.onDragEnter(this.draggingToRowDragEvent("rowDragEnter",l))}:s,onDragLeave:e.onDragLeave?l=>{i(l),e.onDragLeave(this.draggingToRowDragEvent("rowDragLeave",l))}:i,onDragging:e.onDragging?l=>{o(l),e.onDragging(this.draggingToRowDragEvent("rowDragMove",l))}:o,onDragStop:e.onDragStop?l=>{n(l),e.onDragStop(this.draggingToRowDragEvent("rowDragEnd",l))}:n,onDragCancel:e.onDragCancel?l=>{r(l),e.onDragCancel(this.draggingToRowDragEvent("rowDragCancel",l))}:r,fromGrid:!0}:a={getContainer:t,onDragEnter:s,onDragLeave:i,onDragging:o,onDragStop:n,onDragCancel:r,fromGrid:!0},a}draggingToRowDragEvent(e,t){const s=this.beans,{pageBounds:i,rowModel:o,gos:n}=s,r=ui(s,t).y,a=r>i.getCurrentPageHeight();let l=-1,d;return a||(l=o.getRowIndexAtPixel(r),d=o.getRow(l)),k(n,{type:e,event:t.event,node:t.dragItem.rowNode,nodes:t.dragItem.rowNodes,overIndex:l,overNode:d,y:r,vDirection:t.vDirection})}dispatchGridEvent(e,t){const s=this.draggingToRowDragEvent(e,t);this.eventSvc.dispatchEvent(s)}onDragLeave(e){this.dispatchGridEvent("rowDragLeave",e),this.stopDragging(e),this.gos.get("rowDragManaged")&&this.clearRowHighlight()}onDragStop(e){this.dispatchGridEvent("rowDragEnd",e),this.stopDragging(e);const{dragAndDrop:t,gos:s}=this.beans;s.get("rowDragManaged")&&(s.get("suppressMoveWhenRowDragging")||!this.isFromThisGrid(e))&&t.isDropZoneWithinThisGrid(e)&&this.moveRowAndClearHighlight(e)}onDragCancel(e){this.dispatchGridEvent("rowDragCancel",e),this.stopDragging(e);const{dragAndDrop:t,gos:s}=this.beans;s.get("rowDragManaged")&&(s.get("suppressMoveWhenRowDragging")||!this.isFromThisGrid(e))&&t.isDropZoneWithinThisGrid(e)&&this.clearRowHighlight()}stopDragging(e){this.autoScrollService.ensureCleared(),this.getRowNodes(e).forEach(t=>{this.setRowNodeDragging(t,!1)})}setRowNodeDragging(e,t){e.dragging!==t&&(e.dragging=t,e.dispatchRowEvent("draggingChanged"))}};function ka(e,t,s){if(s===0)return!1;const i=Math.abs(e.clientX-t.clientX),o=Math.abs(e.clientY-t.clientY);return Math.max(i,o)<=s}var dp=class extends b{constructor(){super(...arguments),this.beanName="dragSvc",this.dragEndFunctions=[],this.dragSources=[]}destroy(){const{dragSources:e}=this;e.forEach(this.removeListener.bind(this)),e.length=0,super.destroy()}removeListener(e){const t=e.dragSource.eElement,s=e.mouseDownListener;if(t.removeEventListener("mousedown",s),e.touchEnabled){const i=e.touchStartListener;t.removeEventListener("touchstart",i,{passive:!0})}}removeDragSource(e){const{dragSources:t}=this,s=t.find(i=>i.dragSource===e);s&&(this.removeListener(s),ue(t,s))}addDragSource(e){const t=this.onMouseDown.bind(this,e),{eElement:s,includeTouch:i,stopPropagationForTouch:o}=e;s.addEventListener("mousedown",t);let n=null;const r=this.gos.get("suppressTouch");i&&!r&&(n=a=>{io(a.target)||(o&&a.stopPropagation(),this.onTouchStart(e,a))},s.addEventListener("touchstart",n,{passive:!1})),this.dragSources.push({dragSource:e,mouseDownListener:t,touchStartListener:n,touchEnabled:!!i})}onTouchStart(e,t){this.currentDragParams=e,this.dragging=!1;const s=t.touches[0];this.touchLastTime=s,this.touchStart=s;const i=l=>this.onTouchMove(l,e.eElement),o=l=>this.onTouchUp(l,e.eElement),n=l=>{l.cancelable&&l.preventDefault()},r=t.target,a=[{target:dt(this.beans),type:"touchmove",listener:n,options:{passive:!1}},{target:r,type:"touchmove",listener:i,options:{passive:!0}},{target:r,type:"touchend",listener:o,options:{passive:!0}},{target:r,type:"touchcancel",listener:o,options:{passive:!0}}];this.addTemporaryEvents(a),e.dragStartPixels===0&&this.onCommonMove(s,this.touchStart,e.eElement)}onMouseDown(e,t){const s=t;if(e.skipMouseEvent&&e.skipMouseEvent(t)||s._alreadyProcessedByDragService||(s._alreadyProcessedByDragService=!0,t.button!==0))return;this.shouldPreventMouseEvent(t)&&t.preventDefault(),this.currentDragParams=e,this.dragging=!1,this.mouseStartEvent=t,this.startTarget=t.target;const i=d=>this.onMouseMove(d,e.eElement),o=d=>this.onMouseUp(d,e.eElement),n=d=>d.preventDefault(),r=d=>{d.key===w.ESCAPE&&this.cancelDrag(e.eElement)},a=dt(this.beans),l=[{target:a,type:"mousemove",listener:i},{target:a,type:"mouseup",listener:o},{target:a,type:"contextmenu",listener:n},{target:a,type:"keydown",listener:r}];this.addTemporaryEvents(l),e.dragStartPixels===0&&this.onMouseMove(t,e.eElement)}addTemporaryEvents(e){e.forEach(t=>{const{target:s,type:i,listener:o,options:n}=t;s.addEventListener(i,o,n)}),this.dragEndFunctions.push(()=>{e.forEach(t=>{const{target:s,type:i,listener:o,options:n}=t;s.removeEventListener(i,o,n)})})}isEventNearStartEvent(e,t){const{dragStartPixels:s}=this.currentDragParams,i=x(s)?s:4;return ka(e,t,i)}getFirstActiveTouch(e){for(let t=0;t!!n.target?.tagName.toLocaleLowerCase()?.match("^a$|textarea|input|select|button");return s&&i&&e.cancelable&&ci(t,e)&&!o(e)}onTouchUp(e,t){let s=this.getFirstActiveTouch(e.changedTouches);s||(s=this.touchLastTime),this.onUpCommon(s,t)}onMouseUp(e,t){this.onUpCommon(e,t)}onUpCommon(e,t){this.dragging&&(this.dragging=!1,this.currentDragParams.onDragStop(e),this.eventSvc.dispatchEvent({type:"dragStopped",target:t})),this.resetDragProperties()}cancelDrag(e){this.eventSvc.dispatchEvent({type:"dragCancelled",target:e}),this.currentDragParams?.onDragCancel?.(),this.resetDragProperties()}resetDragProperties(){this.mouseStartEvent=null,this.startTarget=null,this.touchStart=null,this.touchLastTime=null,this.currentDragParams=null;const{dragEndFunctions:e}=this;e.forEach(t=>t()),e.length=0}};function Ia(e,t){return e+"_"+t}function W(e){return e instanceof Io}var Io=class extends b{constructor(e,t,s,i){super(),this.providedColumnGroup=e,this.groupId=t,this.partId=s,this.pinned=i,this.isColumn=!1,this.displayedChildren=[],this.autoHeaderHeight=null,this.parent=null}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}getUniqueId(){return Ia(this.groupId,this.partId)}isEmptyGroup(){return this.displayedChildren.length===0}isMoving(){const e=this.getProvidedColumnGroup().getLeafColumns();return!e||e.length===0?!1:e.every(t=>t.isMoving())}checkLeft(){if(this.displayedChildren.forEach(e=>{W(e)&&e.checkLeft()}),this.displayedChildren.length>0)if(this.gos.get("enableRtl")){const t=H(this.displayedChildren).getLeft();this.setLeft(t)}else{const e=this.displayedChildren[0].getLeft();this.setLeft(e)}else this.setLeft(null)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(e){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.dispatchLocalEvent({type:"leftChanged"}))}getPinned(){return this.pinned}getGroupId(){return this.groupId}getPartId(){return this.partId}getActualWidth(){let e=0;return 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()}),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)}isAutoHeaderHeight(){return!!this.getColGroupDef()?.autoHeaderHeight}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}addDisplayedLeafColumns(e){this.displayedChildren.forEach(t=>{Ge(t)?e.push(t):W(t)&&t.addDisplayedLeafColumns(e)})}addLeafColumns(e){this.children.forEach(t=>{Ge(t)?e.push(t):W(t)&&t.addLeafColumns(e)})}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){const e=this.getParent();return!this.isPadding()||!e||!e.isPadding()?0:1+e.getPaddingLevel()}calculateDisplayedColumns(){this.displayedChildren=[];let e=this;for(;e!=null&&e.isPadding();)e=e.getParent();if(!(e?e.getProvidedColumnGroup().isExpandable():!1)){this.displayedChildren=this.children,this.dispatchLocalEvent({type:"displayedChildrenChanged"});return}this.children.forEach(s=>{if(W(s)&&(!s.displayedChildren||!s.displayedChildren.length))return;switch(s.getColumnGroupShow()){case"open":e.getProvidedColumnGroup().isExpanded()&&this.displayedChildren.push(s);break;case"closed":e.getProvidedColumnGroup().isExpanded()||this.displayedChildren.push(s);break;default:this.displayedChildren.push(s);break}}),this.dispatchLocalEvent({type:"displayedChildrenChanged"})}},gi="row-group-",La="t-",Oa="b-",cp=0,bt=class{constructor(e){this.master=!1,this.detail=void 0,this.rowIndex=null,this.key=null,this.sourceRowIndex=-1,this.childrenMapped={},this.treeNode=null,this.treeNodeFlags=0,this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=cp++,this.alreadyRendered=!1,this.highlighted=null,this.hovered=!1,this.__selected=!1,this.beans=e}setData(e){this.setDataCommon(e,!1)}updateData(e){this.setDataCommon(e,!0)}setDataCommon(e,t){const{valueCache:s,selectionSvc:i,rowSpanSvc:o}=this.beans,n=this.data;this.data=e,s?.onDataChanged(),this.updateDataOnDetailNode(),i?.updateRowSelectable(this),this.resetQuickFilterAggregateText();const r=this.createDataChangedEvent(e,n,t);this.__localEventService?.dispatchEvent(r),o?.onRowDataUpdated(this)}updateDataOnDetailNode(){this.detailNode&&(this.detailNode.data=this.data)}createDataChangedEvent(e,t,s){return{type:"dataChanged",node:this,oldData:t,newData:e,update:s}}getRowIndexString(){return this.rowIndex==null?(O(13),null):this.rowPinned==="top"?La+this.rowIndex:this.rowPinned==="bottom"?Oa+this.rowIndex:this.rowIndex.toString()}setDataAndId(e,t){const{selectionSvc:s}=this.beans,i=s?.createDaemonNode?.(this),o=this.data;this.data=e,this.updateDataOnDetailNode(),this.setId(t),s&&(s.updateRowSelectable(this),s.syncInRowNode(this,i));const n=this.createDataChangedEvent(e,o,!1);this.__localEventService?.dispatchEvent(n)}setId(e){const t=ut(this.beans.gos);if(t)if(this.data){const s=this.parent?.getRoute()??[];this.id=t({data:this.data,parentKeys:s.length>0?s:void 0,level:this.level,rowPinned:this.rowPinned}),this.id.startsWith(gi)&&O(14,{groupPrefix:gi})}else this.id=void 0;else this.id=e}setRowTop(e){this.oldRowTop=this.rowTop,this.rowTop!==e&&(this.rowTop=e,this.dispatchRowEvent("topChanged"),this.setDisplayed(e!==null))}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setHovered(e){this.hovered=e}isHovered(){return this.hovered}setRowHeight(e,t=!1){this.rowHeight=e,this.rowHeightEstimated=t,this.dispatchRowEvent("heightChanged")}setExpanded(e,t,s){this.beans.expansionSvc?.setExpanded(this,e,t,s)}setDataValue(e,t,s){const{colModel:i,valueSvc:o,gos:n,selectionSvc:r,rowSpanSvc:a}=this.beans,l=typeof e!="string"?e:i.getCol(e)??i.getColDefCol(e);if(!l)return!1;const d=o.getValueForDisplay(l,this);if(n.get("readOnlyEdit")){const{beans:{eventSvc:u},data:h,rowIndex:g,rowPinned:p}=this;return u.dispatchEvent({type:"cellEditRequest",event:null,rowIndex:g,rowPinned:p,column:l,colDef:l.colDef,data:h,node:this,oldValue:d,newValue:t,value:t,source:s}),!1}const c=o.setValue(this,l,t,s);return this.dispatchCellChangedEvent(l,t,d),r?.updateRowSelectable(this),a?.onRowDataUpdated(this),c}updateHasChildren(){let e=this.group&&!this.footer||this.childrenAfterGroup&&this.childrenAfterGroup.length>0;const{rowChildrenSvc:t}=this.beans;t&&(e=t.getHasChildrenValue(this)),e!==this.__hasChildren&&(this.__hasChildren=!!e,this.dispatchRowEvent("hasChildrenChanged"))}hasChildren(){return this.__hasChildren==null&&this.updateHasChildren(),this.__hasChildren}dispatchCellChangedEvent(e,t,s){const i={type:"cellChanged",node:this,column:e,newValue:t,oldValue:s};this.__localEventService?.dispatchEvent(i)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return this.beans.expansionSvc?.isExpandable(this)??!1}isSelected(){return this.footer?this.sibling.isSelected():this.__selected}depthFirstSearch(e){this.childrenAfterGroup?.forEach(t=>t.depthFirstSearch(e)),e(this)}dispatchRowEvent(e){this.__localEventService?.dispatchEvent({type:e,node:this})}setSelected(e,t=!1,s="api"){this.beans.selectionSvc?.setNodesSelected({nodes:[this],newValue:e,clearSelection:t,source:s})}isRowPinned(){return!!this.rowPinned}__addEventListener(e,t){this.__localEventService||(this.__localEventService=new We),this.__localEventService.addEventListener(e,t)}__removeEventListener(e,t){this.removeLocalListener(e,t)}addEventListener(e,t){this.beans.validation?.checkRowEvents(e),this.__localEventService||(this.__localEventService=new We),this.frameworkEventListenerService=this.beans.frameworkOverrides.createLocalEventListenerWrapper?.(this.frameworkEventListenerService,this.__localEventService);const s=this.frameworkEventListenerService?.wrap(t)??t;this.__localEventService.addEventListener(e,s)}removeEventListener(e,t){const s=this.frameworkEventListenerService?.unwrap(t)??t;this.removeLocalListener(e,s)}removeLocalListener(e,t){this.__localEventService?.removeEventListener(e,t),this.__localEventService?.noRegisteredListenersExist()&&(this.__localEventService=null)}isFullWidthCell(){if(R(61),this.detail)return!0;const e=this.beans.gos.getCallback("isFullWidthRow");return e?e({rowNode:this}):!1}getRoute(){if(this.level===-1)return[];if(this.key==null)return;const e=[];let t=this;for(;t&&t.key!=null;)e.push(t.key),t=t.parent;return e.reverse()}setFirstChild(e){this.firstChild!==e&&(this.firstChild=e,this.dispatchRowEvent("firstChildChanged"))}setDisplayed(e){this.displayed!==e&&(this.displayed=e,this.dispatchRowEvent("displayedChanged"))}setRowIndex(e){this.rowIndex!==e&&(this.rowIndex=e,this.dispatchRowEvent("rowIndexChanged"))}setAllChildrenCount(e){this.allChildrenCount!==e&&(this.allChildrenCount=e,this.dispatchRowEvent("allChildrenCountChanged"))}setUiLevel(e){this.uiLevel!==e&&(this.uiLevel=e,this.dispatchRowEvent("uiLevelChanged"))}};function Ga(e,t,s){return k(t,{type:s,node:e,data:e.data,rowIndex:e.rowIndex,rowPinned:e.rowPinned})}var Ha=class extends L{constructor(e,t){super('
'),this.column=e,this.source=t,this.filterWrapper=null}postConstruct(){this.createFilter(!0),this.addManagedEventListeners({filterDestroyed:this.onFilterDestroyed.bind(this)})}hasFilter(){return!!this.filterWrapper}getFilter(){return this.filterWrapper?.filterPromise??null}afterInit(){return this.filterWrapper?.filterPromise?.then(()=>{})??te.resolve()}afterGuiAttached(e){this.filterWrapper?.filterPromise?.then(t=>{t?.afterGuiAttached?.(e)})}afterGuiDetached(){this.filterWrapper?.filterPromise?.then(e=>{e?.afterGuiDetached?.()})}createFilter(e){const{column:t,source:s}=this;this.filterWrapper=this.beans.filterManager?.getOrCreateFilterWrapper(t)??null,this.filterWrapper?.filterPromise&&this.filterWrapper.filterPromise.then(i=>{const o=i.getGui();x(o)||R(69,{guiFromFilter:o}),this.appendChild(o),e&&this.eventSvc.dispatchEvent({type:"filterOpened",column:t,source:s,eGui:this.getGui()})})}onFilterDestroyed(e){(e.source==="api"||e.source==="paramsUpdated")&&e.column.getId()===this.column.getId()&&this.beans.colModel.getColDefCol(this.column)&&(Z(this.getGui()),this.createFilter())}destroy(){this.filterWrapper=null,super.destroy()}},Ba="ag-resizer-wrapper",Qe=(e,t)=>`
`,up=`
${Qe("eTopLeft","topLeft")} ${Qe("eTop","top")} ${Qe("eTopRight","topRight")} ${Qe("eRight","right")} ${Qe("eBottomRight","bottomRight")} ${Qe("eBottom","bottom")} ${Qe("eBottomLeft","bottomLeft")} ${Qe("eLeft","left")}
`,Va=class extends b{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)}wireBeans(e){this.popupSvc=e.popupSvc,this.dragSvc=e.dragSvc}center(){const{clientHeight:e,clientWidth:t}=this.offsetParent,s=t/2-this.getWidth()/2,i=e/2-this.getHeight()/2;this.offsetElement(s,i)}initialisePosition(){if(this.positioned)return;const{centered:e,forcePopupParentAsOffsetParent:t,minWidth:s,width:i,minHeight:o,height:n,x:r,y:a}=this.config;this.offsetParent||this.setOffsetParent();let l=0,d=0;const c=me(this.element);if(c){const u=this.findBoundaryElement(),h=window.getComputedStyle(u);if(h.minWidth!=null){const g=u.offsetWidth-this.element.offsetWidth;d=parseInt(h.minWidth,10)-g}if(h.minHeight!=null){const g=u.offsetHeight-this.element.offsetHeight;l=parseInt(h.minHeight,10)-g}}if(this.minHeight=o||l,this.minWidth=s||d,i&&this.setWidth(i),n&&this.setHeight(n),(!i||!n)&&this.refreshSize(),e)this.center();else if(r||a)this.offsetElement(r,a);else if(c&&t){let u=this.boundaryEl,h=!0;if(u||(u=this.findBoundaryElement(),h=!1),u){const g=parseFloat(u.style.top),p=parseFloat(u.style.left);h?this.offsetElement(isNaN(p)?0:p,isNaN(g)?0:g):this.setPosition(p,g)}}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 s=this.moveElementDragListener||{eElement:t,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};e?(this.dragSvc?.addDragSource(s),this.moveElementDragListener=s):(this.dragSvc?.removeDragSource(s),this.moveElementDragListener=void 0)}setResizable(e){if(this.clearResizeListeners(),e?this.addResizers():this.removeResizers(),typeof e=="boolean"){if(e===!1)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],o=this.getResizerElement(t),n={dragStartPixels:0,eElement:o,onDragStart:r=>this.onResizeStart(r,t),onDragging:this.onResize.bind(this),onDragStop:r=>this.onResizeEnd(r,t)};(i||!this.isAlive()&&!i)&&(i?(this.dragSvc?.addDragSource(n),this.resizeListeners.push(n),o.style.pointerEvents="all"):o.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;t!==-1&&(this.element.style.width=`${t}px`),e!==-1&&(this.element.style.height=`${e}px`)}getHeight(){return this.element.offsetHeight}setHeight(e){const{popup:t}=this.config,s=this.element;let i=!1;if(typeof e=="string"&&e.indexOf("%")!==-1)Yt(s,e),e=oo(s),i=!0;else if(e=Math.max(this.minHeight,e),this.positioned){const o=this.getAvailableHeight();o&&e>o&&(e=o)}this.getHeight()!==e&&(i?(s.style.maxHeight="unset",s.style.minHeight="unset"):t?Yt(s,e):(s.style.height=`${e}px`,s.style.flex="0 0 auto",this.lastSize.height=typeof e=="number"?e:parseFloat(e)))}getAvailableHeight(){const{popup:e,forcePopupParentAsOffsetParent:t}=this.config;this.positioned||this.initialisePosition();const{clientHeight:s}=this.offsetParent;if(!s)return null;const i=this.element.getBoundingClientRect(),o=this.offsetParent.getBoundingClientRect(),n=e?this.position.y:i.top,r=e?0:o.top;let a=0;if(t){const d=this.element.parentElement;if(d){const{bottom:c}=d.getBoundingClientRect();a=c-i.bottom}}return s+r-n-a}getWidth(){return this.element.offsetWidth}setWidth(e){const t=this.element,{popup:s}=this.config;let i=!1;if(typeof e=="string"&&e.indexOf("%")!==-1)we(t,e),e=jt(t),i=!0;else if(this.positioned){e=Math.max(this.minWidth,e);const{clientWidth:o}=this.offsetParent,n=s?this.position.x:this.element.getBoundingClientRect().left;o&&e+n>o&&(e=o-n)}this.getWidth()!==e&&(i?(t.style.maxWidth="unset",t.style.minWidth="unset"):this.config.popup?we(t,e):(t.style.width=`${e}px`,t.style.flex=" unset",this.lastSize.width=typeof e=="number"?e:parseFloat(e)))}offsetElement(e=0,t=0){const{forcePopupParentAsOffsetParent:s}=this.config,i=s?this.boundaryEl:this.element;i&&(this.popupSvc?.positionPopup({ePopup:i,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:e,y:t})}),this.setPosition(parseFloat(i.style.left),parseFloat(i.style.top)))}constrainSizeToAvailableHeight(e){if(!this.config.forcePopupParentAsOffsetParent)return;const t=()=>{const s=this.getAvailableHeight();this.element.style.setProperty("max-height",`${s}px`)};e&&this.popupSvc?this.resizeObserverSubscriber=Le(this.beans,this.popupSvc?.getPopupParent(),t):(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:s,isTop:i,anywhereWithin:o,topBuffer:n}=e,r=t.clientX-this.dragStartPosition.x,a=t.clientY-this.dragStartPosition.y,l=this.shouldSkipX(t,!!s,!!o,r)?0:r,d=this.shouldSkipY(t,!!i,n,a)?0:a;return{movementX:l,movementY:d}}shouldSkipX(e,t,s,i){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?!0:(t?l=i<0&&e.clientX>a+n.left||i>0&&e.clientXr.right||i>0&&e.clientXr.right||i>0&&e.clientX=e.clientY||n.bottom<=e.clientY&&n.bottom<=r.bottom;return l?!0:(t?l=i<0&&e.clientY>a+n.top+s||i>0&&e.clientYr.bottom||i>0&&e.clientY!s.classList.contains("ag-hidden")):null}getMinSizeOfSiblings(){const e=this.getSiblings()||[];let t=0,s=0;for(let i=0;ie)}onResize(e){if(!this.isResizing||!this.currentResizer)return;const{popup:t,forcePopupParentAsOffsetParent:s}=this.config,{isTop:i,isRight:o,isBottom:n,isLeft:r}=this.currentResizer,a=o||r,l=n||i,{movementX:d,movementY:c}=this.calculateMouseMovement({e,isLeft:r,isTop:i}),u=this.position.x,h=this.position.y;let g=0,p=0;if(a&&d){const f=r?-1:1,m=this.getWidth(),C=m+d*f;let v=!1;r&&(g=m-C,(u+g<=0||C<=this.minWidth)&&(v=!0,g=0)),v||this.setWidth(C)}if(l&&c){const f=i?-1:1,m=this.getHeight(),C=m+c*f;let v=!1;i?(p=m-C,(h+p<=0||C<=this.minHeight)&&(v=!0,p=0)):!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&mthis.element.parentElement.offsetHeight&&(v=!0),v||this.setHeight(C)}this.updateDragStartPosition(e.clientX,e.clientY),((t||s)&&g||p)&&this.offsetElement(u+g,h+p)}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.dispatchLocalEvent({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:s}=this.position;let i;this.config.calculateTopBuffer&&(i=this.config.calculateTopBuffer());const{movementX:o,movementY:n}=this.calculateMouseMovement({e,isTop:!0,anywhereWithin:!0,topBuffer:i});this.offsetElement(t+o,s+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.popupSvc?this.offsetParent=this.popupSvc.getPopupParent():this.offsetParent=this.element.offsetParent}findBoundaryElement(){let e=this.element;for(;e;){if(window.getComputedStyle(e).position!=="static")return e;e=e.parentElement}return this.element}clearResizeListeners(){for(;this.resizeListeners.length;){const e=this.resizeListeners.pop();this.dragSvc?.removeDragSource(e)}}destroy(){super.destroy(),this.moveElementDragListener&&this.dragSvc?.removeDragSource(this.moveElementDragListener),this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}},Na="ag-focus-managed",St=class extends b{constructor(e,t={}){super(),this.eFocusable=e,this.callbacks=t,this.callbacks={shouldStopEventPropagation:()=>!1,onTabKeyDown:s=>{if(s.defaultPrevented)return;const i=Ye(this.beans,this.eFocusable,!1,s.shiftKey);i&&(i.focus(),s.preventDefault())},...t}}postConstruct(){const{eFocusable:e,callbacks:{onFocusIn:t,onFocusOut:s}}=this;e.classList.add(Na),this.addKeyDownListeners(e),t&&this.addManagedElementListeners(e,{focusin:t}),s&&this.addManagedElementListeners(e,{focusout:s})}addKeyDownListeners(e){this.addManagedElementListeners(e,{keydown:t=>{if(t.defaultPrevented||Fe(t))return;const{callbacks:s}=this;if(s.shouldStopEventPropagation(t)){gt(t);return}t.key===w.TAB?s.onTabKeyDown(t):s.handleKeyDown&&s.handleKeyDown(t)}})}},za={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"};function Lo(e,t){const{debounceMs:s}=e;return pi(e)?(s!=null&&R(71),0):s??t}function pi(e){return(e.buttons?.indexOf("apply")??-1)>=0}var Wa=class extends L{constructor(e){super(),this.filterNameKey=e,this.applyActive=!1,this.hidePopup=null,this.debouncePending=!1,this.appliedModel=null,this.eFilterBody=E,this.buttonListeners=[],this.defaultDebounceMs=0}postConstruct(){this.resetTemplate(),this.createManagedBean(new St(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=new Va(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 s=`
${this.createBodyTemplate()}
`;this.setTemplate(s,this.getAgComponents(),e),t=this.getGui(),t?.addEventListener("submit",this.onFormSubmit)}isReadOnly(){return!!this.params.readOnly}init(e){this.setParams(e),this.resetUiToDefaults(!0).then(()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()})}setParams(e){this.params=e,this.applyActive=pi(e),this.resetButtonsPanel(e)}updateParams(e){this.params=e,this.applyActive=pi(e),this.resetUiToActiveModel(this.getModel(),()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()})}resetButtonsPanel(e,t){const{buttons:s,readOnly:i}=t??{},{buttons:o,readOnly:n}=e;if(i===n&&Tt(s,o))return;const r=o&&o.length>0&&!this.isReadOnly();if(this.eButtonsPanel?(Z(this.eButtonsPanel),this.buttonListeners.forEach(d=>d()),this.buttonListeners=[]):r&&(this.eButtonsPanel=document.createElement("div"),this.eButtonsPanel.classList.add("ag-filter-apply-panel")),!r){this.eButtonsPanel&&ve(this.eButtonsPanel);return}const a=document.createDocumentFragment(),l=d=>{let c;const u=d?this.translate(`${d}Filter`):void 0;switch(d){case"apply":c=p=>this.onBtApply(!1,!1,p);break;case"clear":c=()=>this.onBtClear();break;case"reset":c=()=>this.onBtReset();break;case"cancel":c=p=>{this.onBtCancel(p)};break;default:R(75);return}const g=At(``);this.buttonListeners.push(...this.addManagedElementListeners(g,{click:c})),a.append(g)};o.forEach(d=>l(d)),this.eButtonsPanel.append(a),this.getGui().appendChild(this.eButtonsPanel)}setupOnBtApplyDebounce(){const e=Lo(this.params,this.defaultDebounceMs),t=Y(this,this.checkApplyDebounce.bind(this),e);this.onBtApplyDebounce=()=>{this.debouncePending=!0,t()}}checkApplyDebounce(){this.debouncePending&&(this.debouncePending=!1,this.onBtApply())}getModel(){return this.appliedModel??null}setModel(e){return(e!=null?this.setModelIntoUi(e):this.resetUiToDefaults()).then(()=>{this.updateUiVisibility(),this.applyModel("api")})}onBtCancel(e){this.resetUiToActiveModel(this.getModel(),()=>{this.handleCancelEnd(e)})}handleCancelEnd(e){this.params.closeOnApply&&this.close(e)}resetUiToActiveModel(e,t){const s=()=>{this.onUiChanged(!1,"prevent"),t?.()};e!=null?this.setModelIntoUi(e).then(s):this.resetUiToDefaults().then(s)}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 s=this.appliedModel;return this.appliedModel=t,!this.areModelsEqual(s,t)}isModelValid(e){return!0}onFormSubmit(e){e.preventDefault()}onBtApply(e=!1,t=!1,s){s&&s.preventDefault(),this.applyModel(t?"rowDataUpdated":"ui")&&this.params.filterChangedCallback({afterFloatingFilter:e,afterDataChange:t,source:"columnFilter"});const{closeOnApply:i}=this.params;i&&this.applyActive&&!e&&!t&&this.close(s)}onNewRowsLoaded(){}close(e){if(!this.hidePopup)return;const t=e,s=t&&t.key;let i;(s==="Enter"||s==="Space")&&(i={keyboardEvent:t}),this.hidePopup(i),this.hidePopup=null}onUiChanged(e=!1,t){if(this.updateUiVisibility(),this.params.filterModifiedCallback(),this.applyActive&&!this.isReadOnly()){const s=this.isModelValid(this.getModelFromUi()),i=this.queryForHtmlElement('[data-ref="applyFilterButton"]');i&&Pt(i,!s)}e&&!t||t==="immediately"?this.onBtApply(e):(!this.applyActive&&!t||t==="debounce")&&this.onBtApplyDebounce()}afterGuiAttached(e){e&&(this.hidePopup=e.hidePopup),this.refreshFilterResizer(e?.container)}refreshFilterResizer(e){const{positionableFeature:t,gos:s}=this;if(!t||e==="toolPanel")return;e==="floatingFilter"||e==="columnFilter"?(t.restoreLastSize(),t.setResizable(s.get("enableRtl")?{bottom:!0,bottomLeft:!0,left:!0}:{bottom:!0,bottomRight:!0,right:!0})):(t.removeSizeFromEl(),t.setResizable(!1)),t.constrainSizeToAvailableHeight(!0)}afterGuiDetached(){this.checkApplyDebounce(),this.positionableFeature?.constrainSizeToAvailableHeight(!1)}refresh(e){const t=this.params;return this.params=e,this.resetButtonsPanel(e,t),!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.getLocaleTextFunc()(e,za[e])}getCellValue(e){return this.params.getValue(e)}getPositionableElement(){return this.eFilterBody}};function _a(e,t,s){if(t==null)return null;let i=null;const{compName:o,jsComp:n,fwComp:r}=Fg(e,t);return o?i={agSetColumnFilter:"agSetColumnFloatingFilter",agMultiColumnFilter:"agMultiColumnFloatingFilter",agGroupColumnFilter:"agGroupColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"}[o]:n==null&&r==null&&t.filter===!0&&(i=s()),i}var Se={AUTO_HEIGHT:"ag-layout-auto-height",NORMAL:"ag-layout-normal",PRINT:"ag-layout-print"},Oo=class extends b{constructor(e){super(),this.view=e}postConstruct(){this.addManagedPropertyListener("domLayout",this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()}updateLayoutClasses(){const e=this.gos.get("domLayout"),t={autoHeight:e==="autoHeight",normal:e==="normal",print:e==="print"},s=t.autoHeight?Se.AUTO_HEIGHT:t.print?Se.PRINT:Se.NORMAL;this.view.updateLayoutClasses(s,t)}},Ze="Viewport",Ua="fakeVScrollComp",$a=["fakeHScrollComp","centerHeader","topCenter","bottomCenter","stickyTopCenter","stickyBottomCenter"],Ka=100,Go=150,hp=class extends b{constructor(e){super(),this.lastScrollSource=[null,null],this.scrollLeft=-1,this.nextScrollTop=-1,this.scrollTop=-1,this.lastOffsetHeight=-1,this.lastScrollTop=-1,this.scrollTimer=0,this.needsRefreshedScrollPosition=!0,this.eBodyViewport=e,this.resetLastHScrollDebounced=Y(this,()=>this.lastScrollSource[1]=null,Go),this.resetLastVScrollDebounced=Y(this,()=>this.lastScrollSource[0]=null,Go)}wireBeans(e){this.ctrlsSvc=e.ctrlsSvc,this.animationFrameSvc=e.animationFrameSvc,this.visibleCols=e.visibleCols}destroy(){super.destroy(),window.clearTimeout(this.scrollTimer)}postConstruct(){this.enableRtl=this.gos.get("enableRtl");const e=this.requireUpdatedScrollPosition.bind(this);this.addManagedEventListeners({displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this),gridSizeChanged:e}),this.addManagedElementListeners(this.eBodyViewport,{scroll:e}),this.ctrlsSvc.whenReady(this,t=>{this.centerRowsCtrl=t.center,this.onDisplayedColumnsWidthChanged(),this.addScrollListener()})}requireUpdatedScrollPosition(){this.needsRefreshedScrollPosition=!0}addScrollListener(){this.addHorizontalScrollListeners(),this.addVerticalScrollListeners()}addHorizontalScrollListeners(){this.addManagedElementListeners(this.centerRowsCtrl.eViewport,{scroll:this.onHScroll.bind(this,Ze)});for(const e of $a){const t=this.ctrlsSvc.get(e);this.registerScrollPartner(t,this.onHScroll.bind(this,e))}}addVerticalScrollListeners(){const e=this.ctrlsSvc.get("fakeVScrollComp"),t=this.gos.get("debounceVerticalScrollbar"),s=t?Y(this,this.onVScroll.bind(this,Ze),Ka):this.onVScroll.bind(this,Ze),i=t?Y(this,this.onVScroll.bind(this,Ua),Ka):this.onVScroll.bind(this,Ua);this.addManagedElementListeners(this.eBodyViewport,{scroll:s}),this.registerScrollPartner(e,i)}registerScrollPartner(e,t){e.onScrollCallback(t)}onDisplayedColumnsWidthChanged(){this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(e){this.centerRowsCtrl!=null&&(e===void 0&&(e=this.centerRowsCtrl.getCenterViewportScrollLeft()),this.setScrollLeftForAllContainersExceptCurrent(Math.abs(e)))}setScrollLeftForAllContainersExceptCurrent(e){for(const t of[...$a,Ze]){if(this.lastScrollSource[1]===t)continue;const s=this.getViewportForSource(t);_s(s,e,this.enableRtl)}}getViewportForSource(e){return e===Ze?this.centerRowsCtrl.eViewport:this.ctrlsSvc.get(e).eViewport}isControllingScroll(e,t){return this.lastScrollSource[t]==null?(t===0?this.lastScrollSource[0]=e:this.lastScrollSource[1]=e,!0):this.lastScrollSource[t]===e}onHScroll(e){if(!this.isControllingScroll(e,1))return;const t=this.centerRowsCtrl.eViewport,{scrollLeft:s}=t;if(this.shouldBlockScrollUpdate(1,s,!0))return;const i=Ws(this.getViewportForSource(e),this.enableRtl);this.doHorizontalScroll(i),this.resetLastHScrollDebounced()}onVScroll(e){if(!this.isControllingScroll(e,0))return;let t;if(e===Ze?t=this.eBodyViewport.scrollTop:t=this.ctrlsSvc.get("fakeVScrollComp").getScrollPosition(),this.shouldBlockScrollUpdate(0,t,!0))return;const{animationFrameSvc:s}=this;s?.setScrollTop(t),this.nextScrollTop=t,e===Ze?this.ctrlsSvc.get("fakeVScrollComp").setScrollPosition(t):this.eBodyViewport.scrollTop=t,!s||this.gos.get("suppressAnimationFrame")?this.scrollGridIfNeeded(!0):s.schedule(),this.resetLastVScrollDebounced()}doHorizontalScroll(e){const t=this.ctrlsSvc.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:"bodyScroll",direction:e===1?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.eventSvc.dispatchEvent(t),window.clearTimeout(this.scrollTimer),this.scrollTimer=window.setTimeout(()=>{this.scrollTimer=0,this.eventSvc.dispatchEvent({...t,type:"bodyScrollEnd"})},Go)}shouldBlockScrollUpdate(e,t,s=!1){return s&&!_e()?!1:e===0?this.shouldBlockVerticalScroll(t):this.shouldBlockHorizontalScroll(t)}shouldBlockVerticalScroll(e){const t=Ns(this.eBodyViewport),{scrollHeight:s}=this.eBodyViewport;return e<0||e+t>s}shouldBlockHorizontalScroll(e){const t=this.centerRowsCtrl.getCenterWidth(),{scrollWidth:s}=this.centerRowsCtrl.eViewport;if(this.enableRtl&&zs()){if(e>0)return!0}else if(e<0)return!0;return Math.abs(e)+t>s}redrawRowsAfterScroll(){this.fireScrollEvent(0)}checkScrollLeft(){this.scrollLeft!==this.centerRowsCtrl.getCenterViewportScrollLeft()&&this.onHScroll(Ze)}scrollGridIfNeeded(e=!1){const t=this.scrollTop!=this.nextScrollTop;return t&&(this.scrollTop=this.nextScrollTop,e&&this.requireUpdatedScrollPosition(),this.redrawRowsAfterScroll()),t}setHorizontalScrollPosition(e,t=!1){const i=this.centerRowsCtrl.eViewport.scrollWidth-this.centerRowsCtrl.getCenterWidth();!t&&this.shouldBlockScrollUpdate(1,e)&&(this.enableRtl&&zs()?e=e>0?0:i:e=Math.min(Math.max(e,0),i)),_s(this.centerRowsCtrl.eViewport,Math.abs(e),this.enableRtl),this.doHorizontalScroll(e)}setVerticalScrollPosition(e){this.requireUpdatedScrollPosition(),this.eBodyViewport.scrollTop=e}getVScrollPosition(){if(!this.needsRefreshedScrollPosition){const{lastOffsetHeight:s,lastScrollTop:i}=this;return{top:i,bottom:i+s}}this.needsRefreshedScrollPosition=!1;const{scrollTop:e,offsetHeight:t}=this.eBodyViewport;return this.lastScrollTop=e,this.lastOffsetHeight=t,{top:e,bottom:e+t}}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.eViewport.scrollLeft;return this.setHorizontalScrollPosition(t+e),this.centerRowsCtrl.eViewport.scrollLeft-t}scrollToTop(){this.eBodyViewport.scrollTop=0}ensureNodeVisible(e,t=null){const{rowModel:s}=this.beans,i=s.getRowCount();let o=-1;for(let n=0;n=0&&this.ensureIndexVisible(o,t)}ensureIndexVisible(e,t){if(Q(this.gos,"print"))return;const{rowModel:s}=this.beans,i=s.getRowCount();if(typeof e!="number"||e<0||e>=i){R(88,{index:e});return}const n=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel"),{frameworkOverrides:r,pagination:a,pageBounds:l,rowContainerHeight:d,rowRenderer:c}=this.beans;r.wrapIncoming(()=>{n||a?.goToPageWithIndex(e);const u=this.ctrlsSvc.getGridBodyCtrl(),h=u.stickyTopHeight,g=u.stickyBottomHeight,p=s.getRow(e);let f;do{const m=p.rowTop,C=p.rowHeight,v=l.getPixelOffset(),S=p.rowTop-v,y=S+p.rowHeight,D=this.getVScrollPosition(),M=d.divStretchOffset,A=D.top+M,T=D.bottom+M,P=T-A,G=d.getScrollPositionForPixel(S),$=d.getScrollPositionForPixel(y-P),ke=Math.min((G+$)/2,S),tt=A+h>S,ze=T-g{n!==null&&this.centerRowsCtrl.setCenterViewportScrollLeft(n),this.centerRowsCtrl.onHorizontalViewportChanged(),this.animationFrameSvc?.flushAllFrames()})}getPositionedHorizontalScroll(e,t){const{columnBeforeStart:s,columnAfterEnd:i}=this.isColumnOutsideViewport(e),o=this.centerRowsCtrl.getCenterWidth()o:si;return{columnBeforeStart:r,columnAfterEnd:a}}getColumnBounds(e){const t=this.enableRtl,s=this.visibleCols.bodyWidth,i=e.getActualWidth(),o=e.getLeft(),n=t?-1:1,r=t?s-o:o,a=r+i*n,l=r+i/2*n;return{colLeft:r,colMiddle:l,colRight:a}}getViewportBounds(){const e=this.centerRowsCtrl.getCenterWidth(),t=this.centerRowsCtrl.getCenterViewportScrollLeft(),s=t,i=e+t;return{start:s,end:i,width:e}}},Ho=class extends b{constructor(e,t=!1){super(),this.callback=e,this.addSpacer=t}postConstruct(){const e=this.setWidth.bind(this);this.addManagedPropertyListener("domLayout",e),this.addManagedEventListeners({columnContainerWidthChanged:e,displayedColumnsChanged:e,leftPinnedWidthChanged:e}),this.addSpacer&&this.addManagedEventListeners({rightPinnedWidthChanged:e,scrollVisibilityChanged:e,scrollbarWidthChanged:e}),this.setWidth()}setWidth(){const e=Q(this.gos,"print"),{visibleCols:t,scrollVisibleSvc:s}=this.beans,i=t.bodyWidth,o=t.getColsLeftWidth(),n=t.getDisplayedColumnsRightWidth();let r;e?r=i+o+n:(r=i,this.addSpacer&&(this.gos.get("enableRtl")?o:n)===0&&s.verticalScrollShowing&&(r+=s.getScrollbarWidth())),this.callback(r)}},gp=class extends b{constructor(e){super(),this.centerContainerCtrl=e}wireBeans(e){this.scrollVisibleSvc=e.scrollVisibleSvc}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.listenForResize()}),this.addManagedEventListeners({scrollbarWidthChanged:this.onScrollbarWidthChanged.bind(this)}),this.addManagedPropertyListeners(["alwaysShowHorizontalScroll","alwaysShowVerticalScroll"],()=>{this.checkViewportAndScrolls()})}listenForResize(){const{beans:e,centerContainerCtrl:t,gridBodyCtrl:s}=this,i=()=>{Pe(e,()=>{this.onCenterViewportResized()})};t.registerViewportResizeListener(i),s.registerBodyViewportResizeListener(i)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.scrollVisibleSvc.updateScrollGap(),this.centerContainerCtrl.isViewportInTheDOMTree()){const{pinnedCols:e,colFlex:t}=this.beans;e?.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();const s=this.centerContainerCtrl.getCenterWidth();s!==this.centerWidth&&(this.centerWidth=s,t?.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0}))}else this.bodyHeight=0}checkViewportAndScrolls(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.scrollFeature.checkScrollLeft()}getBodyHeight(){return this.bodyHeight}checkBodyHeight(){const e=this.gridBodyCtrl.eBodyViewport,t=Ns(e);this.bodyHeight!==t&&(this.bodyHeight=t,this.eventSvc.dispatchEvent({type:"bodyHeightChanged"}))}updateScrollVisibleService(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)}updateScrollVisibleServiceImpl(){const e={horizontalScrollShowing:this.centerContainerCtrl.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleSvc.setScrollsVisible(e)}onHorizontalViewportChanged(){const e=this.centerContainerCtrl.getCenterWidth(),t=this.centerContainerCtrl.getViewportScrollLeft();this.beans.colViewport.setScrollPosition(e,t)}};function Bo(e,t,s,i,o,n){if(s==null&&t==null)return;const r={},a={},l=(d,c)=>{d.split(" ").forEach(u=>{u.trim()!=""&&c(u)})};if(s){const d=Object.keys(s);for(let c=0;c{g?r[p]=!0:a[p]=!0})}}t&&n&&Object.keys(t).forEach(d=>l(d,c=>{r[c]||(a[c]=!0)})),n&&Object.keys(a).forEach(n),Object.keys(r).forEach(o)}function ja(e){if(e.group)return e.level;const t=e.parent;return t?t.level+1:0}var pp=class extends b{constructor(){super(...arguments),this.beanName="rowStyleSvc"}processClassesFromGridOptions(e,t){const s=this.gos,i=r=>{typeof r=="string"?e.push(r):Array.isArray(r)&&r.forEach(a=>e.push(a))},o=s.get("rowClass");o&&i(o);const n=s.getCallback("getRowClass");if(n){const r={data:t.data,node:t,rowIndex:t.rowIndex},a=n(r);i(a)}}preProcessRowClassRules(e,t){this.processRowClassRules(t,s=>{e.push(s)},()=>{})}processRowClassRules(e,t,s){const{gos:i,expressionSvc:o}=this.beans,n=k(i,{data:e.data,node:e,rowIndex:e.rowIndex});Bo(o,void 0,i.get("rowClassRules"),n,t,s)}processStylesFromGridOptions(e){const t=this.gos,s=t.get("rowStyle"),i=t.getCallback("getRowStyle");let o;if(i){const n={data:e.data,node:e,rowIndex:e.rowIndex};o=i(n)}if(o||s)return Object.assign({},s,o)}},fp=0,as="renderedRow",fi=class extends b{constructor(e,t,s,i,o){super(),this.rowNode=e,this.useAnimationFrameForCreate=i,this.printLayout=o,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.businessKey=null,this.beans=t,this.gos=t.gos,this.paginationPage=t.pagination?.getCurrentPage()??0,this.suppressRowTransform=this.gos.get("suppressRowTransform"),this.instanceId=e.id+"-"+fp++,this.rowId=Ee(e.id),this.initRowBusinessKey(),this.rowFocused=t.focusSvc.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned),this.rowLevel=ja(this.rowNode),this.setRowType(),this.setAnimateFlags(s),this.rowStyles=this.processStylesFromGridOptions(),this.addListeners()}initRowBusinessKey(){this.businessKeyForNodeFunc=this.gos.get("getBusinessKeyForNode"),this.updateRowBusinessKey()}updateRowBusinessKey(){if(typeof this.businessKeyForNodeFunc!="function")return;const e=this.businessKeyForNodeFunc(this.rowNode);this.businessKey=Ee(e)}updateGui(e,t){e==="left"?this.leftGui=t:e==="right"?this.rightGui=t:e==="fullWidth"?this.fullWidthGui=t:this.centerGui=t}setComp(e,t,s,i){i=is(this,this.beans.context,i);const o={rowComp:e,element:t,containerType:s,compBean:i};this.allRowGuis.push(o),this.updateGui(s,o),this.initialiseRowComp(o),!(this.rowType==="FullWidthLoading"||this.rowNode.stub)&&!this.rowNode.rowPinned&&this.beans.rowRenderer.dispatchFirstDataRenderedEvent()}unsetComp(e){this.allRowGuis=this.allRowGuis.filter(t=>t.containerType!==e),this.updateGui(e,void 0)}isCacheable(){return this.rowType==="FullWidthDetail"&&this.gos.get("keepDetailRows")}setCached(e){const t=e?"none":"";this.allRowGuis.forEach(s=>s.element.style.display=t)}initialiseRowComp(e){const t=this.gos;this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus")),this.listenOnDomOrder(e),this.onRowHeightChanged(e),this.updateRowIndexes(e),this.setFocusedClasses(e),this.setStylesFromGridOptions(!1,e),$e(t)&&this.rowNode.selectable&&this.onRowSelected(e),this.updateColumnLists(!this.useAnimationFrameForCreate);const s=e.rowComp;this.getInitialRowClasses(e.containerType).forEach(o=>s.addOrRemoveCssClass(o,!0)),this.executeSlideAndFadeAnimations(e),this.rowNode.group&&Gs(e.element,this.rowNode.expanded==!0),this.setRowCompRowId(s),this.setRowCompRowBusinessKey(s),lt(t,e.element,as,this),e.compBean.addDestroyFunc(()=>lt(t,e.element,as,null)),this.useAnimationFrameForCreate?this.beans.animationFrameSvc.createTask(this.addHoverFunctionality.bind(this,e),this.rowNode.rowIndex,"createTasksP2"):this.addHoverFunctionality(e),this.isFullWidth()&&this.setupFullWidth(e),t.get("rowDragEntireRow")&&this.addRowDraggerToRow(e),this.useAnimationFrameForCreate&&this.beans.animationFrameSvc.addDestroyTask(()=>{this.isAlive()&&e.rowComp.addOrRemoveCssClass("ag-after-created",!0)}),this.executeProcessRowPostCreateFunc()}setRowCompRowBusinessKey(e){this.businessKey!=null&&e.setRowBusinessKey(this.businessKey)}setRowCompRowId(e){const t=Ee(this.rowNode.id);this.rowId=t,t!=null&&e.setRowId(t)}executeSlideAndFadeAnimations(e){const{containerType:t}=e;this.slideInAnimation[t]&&(mr(()=>{this.onTopChanged()}),this.slideInAnimation[t]=!1),this.fadeInAnimation[t]&&(mr(()=>{e.rowComp.addOrRemoveCssClass("ag-opacity-zero",!1)}),this.fadeInAnimation[t]=!1)}addRowDraggerToRow(e){const t=this.beans.rowDragSvc?.createRowDragCompForRow(this.rowNode,e.element);if(!t)return;const s=this.createBean(t,this.beans.context);this.rowDragComps.push(s),e.compBean.addDestroyFunc(()=>{this.rowDragComps=this.rowDragComps.filter(i=>i!==s),this.destroyBean(s,this.beans.context)})}setupFullWidth(e){const t=this.getPinnedForContainer(e.containerType),s=this.createFullWidthCompDetails(e.element,t);e.rowComp.showFullWidth(s)}getFullWidthCellRenderers(){return this.gos.get("embedFullWidthRows")?this.allRowGuis.map(e=>e?.rowComp?.getFullWidthCellRenderer()):[this.fullWidthGui?.rowComp?.getFullWidthCellRenderer()]}executeProcessRowPostCreateFunc(){const e=this.gos.getCallback("processRowPostCreate");if(!e||!this.areAllContainersReady())return;const t={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)};e(t)}areAllContainersReady(){const{leftGui:e,centerGui:t,rightGui:s,beans:{visibleCols:i}}=this,o=!!e||!i.isPinningLeft(),n=!!t,r=!!s||!i.isPinningRight();return o&&n&&r}isNodeFullWidthCell(){if(this.rowNode.detail)return!0;const e=this.beans.gos.getCallback("isFullWidthRow");return e?e({rowNode:this.rowNode}):!1}setRowType(){const e=this.rowNode.stub&&!this.gos.get("suppressServerSideFullWidthLoadingRow")&&!this.gos.get("groupHideOpenParents"),t=this.isNodeFullWidthCell(),s=this.gos.get("masterDetail")&&this.rowNode.detail,i=this.beans.colModel.isPivotMode(),n=!!this.rowNode.group&&!this.rowNode.footer&&Zs(this.gos,i);e?this.rowType="FullWidthLoading":s?this.rowType="FullWidthDetail":t?this.rowType="FullWidth":n?this.rowType="FullWidthGroup":this.rowType="Normal"}updateColumnLists(e=!1,t=!1){if(this.isFullWidth())return;const{animationFrameSvc:s}=this.beans;if(!s||e||this.gos.get("suppressAnimationFrame")||this.printLayout){this.updateColumnListsImpl(t);return}this.updateColumnListsPending||(s.createTask(()=>{this.active&&this.updateColumnListsImpl(!0)},this.rowNode.rowIndex,"createTasksP1"),this.updateColumnListsPending=!0)}getNewCellCtrl(e){if(!this.beans.rowSpanSvc?.isCellSpanning(e,this.rowNode))return new ns(e,this.rowNode,this.beans,this)}shouldRecreateCellCtrl(e){return!!this.beans.rowSpanSvc?.isCellSpanning(e.column,this.rowNode)}createCellCtrls(e,t,s=null){const i={list:[],map:{}},o=(r,a,l)=>{l!=null?i.list.splice(l,0,a):i.list.push(a),i.map[r]=a},n=[];for(const r of t){const a=r.getInstanceId();let l=e.map[a];l&&this.shouldRecreateCellCtrl(l)&&(l.destroy(),l=void 0),l||(l=this.getNewCellCtrl(r)),l&&o(a,l)}for(const r of e.list){const a=r.column.getInstanceId();if(i.map[a]!=null)continue;!this.isCellEligibleToBeRemoved(r,s)?n.push([a,r]):r.destroy()}if(n.length)for(const[r,a]of n){const l=i.list.findIndex(c=>c.column.getLeft()>a.column.getLeft()),d=l===-1?void 0:Math.max(l-1,0);o(r,a,d)}return i}updateColumnListsImpl(e){this.updateColumnListsPending=!1,this.createAllCellCtrls(),this.setCellCtrls(e)}setCellCtrls(e){this.allRowGuis.forEach(t=>{const s=this.getCellCtrlsForContainer(t.containerType);t.rowComp.setCellCtrls(s,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}}createAllCellCtrls(){const e=this.beans.colViewport,t=this.beans.visibleCols;if(this.printLayout)this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,t.allCols),this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}};else{const s=e.getColsWithinViewport(this.rowNode);this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,s);const i=t.getLeftColsForRow(this.rowNode);this.leftCellCtrls=this.createCellCtrls(this.leftCellCtrls,i,"left");const o=t.getRightColsForRow(this.rowNode);this.rightCellCtrls=this.createCellCtrls(this.rightCellCtrls,o,"right")}}isCellEligibleToBeRemoved(e,t){const{column:o}=e;if(o.getPinned()!=t)return!0;const{editing:n,cellPosition:r}=e,{focusSvc:a,visibleCols:l}=this.beans,d=a.isCellFocused(r);return n||d?!(l.allCols.indexOf(o)>=0):!0}getDomOrder(){return this.gos.get("ensureDomOrder")||Q(this.gos,"print")}listenOnDomOrder(e){const t=()=>{e.rowComp.setDomOrder(this.getDomOrder())};e.compBean.addManagedPropertyListeners(["domLayout","ensureDomOrder"],t)}setAnimateFlags(e){if(this.rowNode.sticky||!e)return;const t=x(this.rowNode.oldRowTop),{visibleCols:s}=this.beans,i=s.isPinningLeft(),o=s.isPinningRight();if(t){const{slideInAnimation:n}=this;if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows")){n.fullWidth=!0;return}n.center=!0,n.left=i,n.right=o}else{const{fadeInAnimation:n}=this;if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows")){n.fullWidth=!0;return}n.center=!0,n.left=i,n.right=o}}isFullWidth(){return this.rowType!=="Normal"}refreshFullWidth(){const e=(r,a)=>r?r.rowComp.refreshFullWidth(()=>this.createFullWidthCompDetails(r.element,a).params):!0,t=e(this.fullWidthGui,null),s=e(this.centerGui,null),i=e(this.leftGui,"left"),o=e(this.rightGui,"right");return t&&s&&i&&o}addListeners(){this.addManagedListeners(this.rowNode,{heightChanged:()=>this.onRowHeightChanged(),rowSelected:()=>this.onRowSelected(),rowIndexChanged:this.onRowIndexChanged.bind(this),topChanged:this.onTopChanged.bind(this),...this.beans.expansionSvc?.getRowExpandedListeners(this)??{}}),this.rowNode.detail&&this.addManagedListeners(this.rowNode.parent,{dataChanged:this.onRowNodeDataChanged.bind(this)}),this.addManagedListeners(this.rowNode,{dataChanged:this.onRowNodeDataChanged.bind(this),cellChanged:this.postProcessCss.bind(this),rowHighlightChanged:this.onRowNodeHighlightChanged.bind(this),draggingChanged:this.postProcessRowDragging.bind(this),uiLevelChanged:this.onUiLevelChanged.bind(this)}),this.addManagedListeners(this.beans.eventSvc,{paginationPixelOffsetChanged:this.onPaginationPixelOffsetChanged.bind(this),heightScaleChanged:this.onTopChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),virtualColumnsChanged:this.onVirtualColumnsChanged.bind(this),cellFocused:this.onCellFocusChanged.bind(this),cellFocusCleared:this.onCellFocusChanged.bind(this),paginationChanged:this.onPaginationChanged.bind(this),modelUpdated:this.refreshFirstAndLastRowStyles.bind(this),columnMoved:()=>this.updateColumnLists()}),this.beans.rowSpanSvc&&this.addManagedListeners(this.beans.rowSpanSvc,{spannedCellsUpdated:({pinned:e})=>{e&&!this.rowNode.rowPinned||this.updateColumnLists()}}),this.addDestroyFunc(()=>{this.rowDragComps=this.destroyBeans(this.rowDragComps,this.beans.context),this.tooltipFeature=this.destroyBean(this.tooltipFeature,this.beans.context)}),this.addManagedPropertyListeners(["rowStyle","getRowStyle","rowClass","getRowClass","rowClassRules"],this.postProcessCss.bind(this)),this.addManagedPropertyListener("rowDragEntireRow",()=>{if(this.gos.get("rowDragEntireRow")){this.allRowGuis.forEach(t=>{this.addRowDraggerToRow(t)});return}this.rowDragComps=this.destroyBeans(this.rowDragComps,this.beans.context)}),this.addListenersForCellComps()}addListenersForCellComps(){this.addManagedListeners(this.rowNode,{rowIndexChanged:()=>{this.getAllCellCtrls().forEach(e=>e.onRowIndexChanged())},cellChanged:e=>{this.getAllCellCtrls().forEach(t=>t.onCellChanged(e))}})}onRowNodeDataChanged(e){if(this.isFullWidth()!==!!this.isNodeFullWidthCell()){this.beans.rowRenderer.redrawRow(this.rowNode);return}if(this.isFullWidth()){this.refreshFullWidth()||this.beans.rowRenderer.redrawRow(this.rowNode);return}this.getAllCellCtrls().forEach(s=>s.refreshCell({suppressFlash:!e.update,newData:!e.update})),this.allRowGuis.forEach(s=>{this.setRowCompRowId(s.rowComp),this.updateRowBusinessKey(),this.setRowCompRowBusinessKey(s.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 s=e==="Above",i=e==="Below";t.rowComp.addOrRemoveCssClass("ag-row-highlight-above",s),t.rowComp.addOrRemoveCssClass("ag-row-highlight-below",i)})}postProcessRowDragging(){const e=this.rowNode.dragging;this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass("ag-row-dragging",e))}verifyCells(){this.onDisplayedColumnsChanged()}onDisplayedColumnsChanged(){this.updateColumnLists(!0),this.beans.rowAutoHeight?.requestCheckAutoHeight()}onVirtualColumnsChanged(){this.updateColumnLists(!1,!0)}getRowPosition(){return{rowPinned:Re(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}}onKeyboardNavigate(e){const t=this.findFullWidthInfoForEvent(e);if(!t)return;const{rowGui:s,column:i}=t;if(!(s.element===e.target))return;const r=this.rowNode,{focusSvc:a,navigation:l}=this.beans,d=a.getFocusedCell(),c={rowIndex:r.rowIndex,rowPinned:r.rowPinned,column:d?.column??i};l?.navigateToNextCell(e,e.key,c,!0),e.preventDefault()}onTabKeyDown(e){if(e.defaultPrevented||Fe(e))return;const t=this.allRowGuis.find(a=>a.element.contains(e.target)),s=t?t.element:null,i=s===e.target,o=z(this.beans);let n=!1;s&&o&&(n=s.contains(o)&&o.classList.contains("ag-cell"));let r=null;!i&&!n&&(r=Ye(this.beans,s,!1,e.shiftKey)),(this.isFullWidth()&&i||!r)&&this.beans.navigation?.onTabKeyDown(this,e)}getFullWidthElement(){return this.fullWidthGui?this.fullWidthGui.element:null}getRowYPosition(){const e=this.allRowGuis.find(t=>me(t.element))?.element;return e?e.getBoundingClientRect().top:0}onSuppressCellFocusChanged(e){const t=this.isFullWidth()&&e?void 0:-1;this.allRowGuis.forEach(s=>{Ce(s.element,"tabindex",t)})}onFullWidthRowFocused(e){const t=this.rowNode,s=e?this.isFullWidth()&&e.rowIndex===t.rowIndex&&e.rowPinned==t.rowPinned:!1,i=this.fullWidthGui?this.fullWidthGui.element:this.centerGui?.element;i&&(i.classList.toggle("ag-full-width-focus",s),s&&e?.forceBrowserFocus&&i.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 s={list:[],map:{}};return e.list.forEach(i=>{i!==t&&(s.list.push(i),s.map[i.column.getInstanceId()]=i)}),s}onMouseEvent(e,t){switch(e){case"dblclick":this.onRowDblClick(t);break;case"click":this.onRowClick(t);break;case"touchstart":case"mousedown":this.onRowMouseDown(t);break}}createRowEvent(e,t){const{rowNode:s}=this;return k(this.gos,{type:e,node:s,data:s.data,rowIndex:s.rowIndex,rowPinned:s.rowPinned,event:t})}createRowEventWithSource(e,t){const s=this.createRowEvent(e,t);return s.source=this,s}onRowDblClick(e){Fe(e)||this.beans.eventSvc.dispatchEvent(this.createRowEventWithSource("rowDoubleClicked",e))}findFullWidthInfoForEvent(e){if(!e)return;const t=this.findFullWidthRowGui(e.target),s=this.getColumnForFullWidth(t);if(!(!t||!s))return{rowGui:t,column:s}}findFullWidthRowGui(e){return this.allRowGuis.find(t=>t.element.contains(e))}getColumnForFullWidth(e){const{visibleCols:t}=this.beans;switch(e?.containerType){case"center":return t.centerCols[0];case"left":return t.leftCols[0];case"right":return t.rightCols[0];default:return t.allCols[0]}}onRowMouseDown(e){if(this.lastMouseDownOnDragger=st(e.target,"ag-row-drag",3),!this.isFullWidth())return;const t=this.rowNode,{rangeSvc:s,focusSvc:i}=this.beans;s?.removeAllCellRanges();const o=this.findFullWidthInfoForEvent(e);if(!o)return;const{rowGui:n,column:r}=o,a=n.element,l=e.target;let d=e.defaultPrevented||Ie();a&&a.contains(l)&&io(l)&&(d=!1),i.setFocusedCell({rowIndex:t.rowIndex,column:r,rowPinned:t.rowPinned,forceBrowserFocus:d})}onRowClick(e){if(Fe(e)||this.lastMouseDownOnDragger)return;const{eventSvc:s,selectionSvc:i}=this.beans;s.dispatchEvent(this.createRowEventWithSource("rowClicked",e)),i?.handleSelectionEvent(e,this.rowNode,"rowClicked")}setupDetailRowAutoHeight(e){this.rowType==="FullWidthDetail"&&this.beans.masterDetailSvc?.setupDetailRowAutoHeight(this,e)}createFullWidthCompDetails(e,t){const{gos:s,rowNode:i}=this,o=k(s,{fullWidth:!0,data:i.data,node:i,value:i.key,valueFormatted:i.key,eGridCell:e,eParentOfValue:e,pinned:t,addRenderedRowListener:this.addEventListener.bind(this),registerRowDragger:(r,a,l,d)=>this.addFullWidthRowDragging(r,a,l,d),setTooltip:(r,a)=>{s.assertModuleRegistered("Tooltip",3),this.refreshRowTooltip(r,a)}}),n=this.beans.userCompFactory;switch(this.rowType){case"FullWidthDetail":return vg(n,o);case"FullWidthGroup":return Cg(n,o);case"FullWidthLoading":return mg(n,o);default:return fg(n,o)}}refreshRowTooltip(e,t){this.fullWidthGui&&(this.tooltipFeature=this.beans.tooltipSvc?.refreshRowTooltip(this.tooltipFeature,this,e,t))}addFullWidthRowDragging(e,t,s="",i){const{rowDragSvc:o,context:n}=this.beans;if(!o||!this.isFullWidth())return;const r=o.createRowDragComp(()=>s,this.rowNode,void 0,e,t,i);this.createBean(r,n),this.addDestroyFunc(()=>{this.destroyBean(r,n)})}onUiLevelChanged(){const e=ja(this.rowNode);if(this.rowLevel!=e){const t="ag-row-level-"+e,s="ag-row-level-"+this.rowLevel;this.allRowGuis.forEach(i=>{i.rowComp.addOrRemoveCssClass(t,!0),i.rowComp.addOrRemoveCssClass(s,!1)})}this.rowLevel=e}isFirstRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBounds.getFirstRow()}isLastRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBounds.getLastRow()}refreshFirstAndLastRowStyles(){const e=this.isFirstRowOnPage(),t=this.isLastRowOnPage();this.firstRowOnPage!==e&&(this.firstRowOnPage=e,this.allRowGuis.forEach(s=>s.rowComp.addOrRemoveCssClass("ag-row-first",e))),this.lastRowOnPage!==t&&(this.lastRowOnPage=t,this.allRowGuis.forEach(s=>s.rowComp.addOrRemoveCssClass("ag-row-last",t)))}getAllCellCtrls(){return this.leftCellCtrls.list.length===0&&this.rightCellCtrls.list.length===0?this.centerCellCtrls.list:[...this.centerCellCtrls.list,...this.leftCellCtrls.list,...this.rightCellCtrls.list]}postProcessClassesFromGridOptions(){const e=[];this.beans.rowStyleSvc?.processClassesFromGridOptions(e,this.rowNode),e.length&&e.forEach(t=>{this.allRowGuis.forEach(s=>s.rowComp.addOrRemoveCssClass(t,!0))})}postProcessRowClassRules(){this.beans.rowStyleSvc?.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,s=>s.rowComp.setUserStyles(this.rowStyles))}getPinnedForContainer(e){return e==="left"||e==="right"?e:null}getInitialRowClasses(e){const t=this.getPinnedForContainer(e),s=this.isFullWidth(),{rowNode:i,beans:o}=this,n=[];n.push("ag-row"),n.push(this.rowFocused?"ag-row-focus":"ag-row-no-focus"),this.fadeInAnimation[e]&&n.push("ag-opacity-zero"),n.push(i.rowIndex%2===0?"ag-row-even":"ag-row-odd"),i.isRowPinned()&&n.push("ag-row-pinned"),i.isSelected()&&n.push("ag-row-selected"),i.footer&&n.push("ag-row-footer"),n.push("ag-row-level-"+this.rowLevel),i.stub&&n.push("ag-row-loading"),s&&n.push("ag-full-width-row"),o.expansionSvc?.addExpandedCss(n,i),i.dragging&&n.push("ag-row-dragging");const{rowStyleSvc:r}=o;return r&&(r.processClassesFromGridOptions(n,i),r.preProcessRowClassRules(n,i)),n.push(this.printLayout?"ag-row-position-relative":"ag-row-position-absolute"),this.isFirstRowOnPage()&&n.push("ag-row-first"),this.isLastRowOnPage()&&n.push("ag-row-last"),s&&(t==="left"&&n.push("ag-cell-last-left-pinned"),t==="right"&&n.push("ag-cell-first-right-pinned")),n}processStylesFromGridOptions(){return this.beans.rowStyleSvc?.processStylesFromGridOptions(this.rowNode)??this.emptyStyle}onRowSelected(e){this.beans.selectionSvc?.onRowCtrlSelected(this,t=>{(t===this.centerGui||t===this.fullWidthGui)&&this.announceDescription()},e)}announceDescription(){this.beans.selectionSvc?.announceAriaRowSelection(this.rowNode)}addHoverFunctionality(e){if(!this.active)return;const{element:t,compBean:s}=e,{rowNode:i,beans:o,gos:n}=this;s.addManagedListeners(t,{mouseenter:()=>i.dispatchRowEvent("mouseEnter"),mouseleave:()=>i.dispatchRowEvent("mouseLeave")}),s.addManagedListeners(i,{mouseEnter:()=>{!o.dragSvc?.dragging&&!n.get("suppressRowHoverHighlight")&&(t.classList.add("ag-row-hover"),i.setHovered(!0))},mouseLeave:()=>{this.resetHoveredStatus(t)}})}resetHoveredStatus(e){const t=e?[e]:this.allRowGuis.map(s=>s.element);for(const s of t)s.classList.remove("ag-row-hover");this.rowNode.setHovered(!1)}roundRowTopToBounds(e){const t=this.beans.ctrlsSvc.getScrollFeature().getApproximateVScollPosition(),s=this.applyPaginationOffset(t.top,!0)-100,i=this.applyPaginationOffset(t.bottom,!0)+100;return Math.min(Math.max(s,e),i)}forEachGui(e,t){e?t(e):this.allRowGuis.forEach(t)}onRowHeightChanged(e){if(this.rowNode.rowHeight==null)return;const t=this.rowNode.rowHeight,s=this.beans.environment.getDefaultRowHeight(),o=go(this.gos)?at(this.beans,this.rowNode).height:void 0,n=o?`${Math.min(s,o)-2}px`:void 0;this.forEachGui(e,r=>{r.element.style.height=`${t}px`,n&&r.element.style.setProperty("--ag-line-height",n)})}destroyFirstPass(e=!1){this.active=!1;const{rowNode:t}=this;if(!e&&ct(this.gos)&&!t.sticky)if(t.rowTop!=null){const o=this.roundRowTopToBounds(t.rowTop);this.setRowTop(o)}else this.allRowGuis.forEach(o=>o.rowComp.addOrRemoveCssClass("ag-opacity-zero",!0));t.setHovered(!1);const s=this.createRowEvent("virtualRowRemoved");this.dispatchLocalEvent(s),this.beans.eventSvc.dispatchEvent(s),super.destroy()}destroySecondPass(){this.allRowGuis.length=0,this.beans.editSvc?.stopRowEditing(this);const e=t=>(t.list.forEach(s=>s.destroy()),{list:[],map:{}});this.centerCellCtrls=e(this.centerCellCtrls),this.leftCellCtrls=e(this.leftCellCtrls),this.rightCellCtrls=e(this.rightCellCtrls)}setFocusedClasses(e){this.forEachGui(e,t=>{t.rowComp.addOrRemoveCssClass("ag-row-focus",this.rowFocused),t.rowComp.addOrRemoveCssClass("ag-row-no-focus",!this.rowFocused)})}onCellFocusChanged(){const{focusSvc:e,editSvc:t}=this.beans,s=e.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);s!==this.rowFocused&&(this.rowFocused=s,this.setFocusedClasses()),!s&&this.editing&&t?.stopRowEditing(this,!1)}onPaginationChanged(){const e=this.beans.pagination?.getCurrentPage()??0;this.paginationPage!==e&&(this.paginationPage=e,this.onTopChanged()),this.refreshFirstAndLastRowStyles()}onTopChanged(){this.setRowTop(this.rowNode.rowTop)}onPaginationPixelOffsetChanged(){this.onTopChanged()}applyPaginationOffset(e,t=!1){if(this.rowNode.isRowPinned()||this.rowNode.sticky)return e;const s=this.beans.pageBounds.getPixelOffset();return e+s*(t?1:-1)}setRowTop(e){if(!this.printLayout&&x(e)){const t=this.applyPaginationOffset(e),o=`${this.rowNode.isRowPinned()||this.rowNode.sticky?t:this.beans.rowContainerHeight.getRealPixelPosition(t)}px`;this.setRowTopStyle(o)}}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"";const t=this.rowNode;let s;if(t.sticky)s=t.stickyRowTop;else{const i=this.slideInAnimation[e]?this.roundRowTopToBounds(t.oldRowTop):t.rowTop,o=this.applyPaginationOffset(i);s=t.isRowPinned()?o:this.beans.rowContainerHeight.getRealPixelPosition(o)}return s+"px"}setRowTopStyle(e){this.allRowGuis.forEach(t=>this.suppressRowTransform?t.rowComp.setTop(e):t.rowComp.setTransform(`translateY(${e})`))}getCellCtrl(e,t=!1){let s=null;return this.getAllCellCtrls().forEach(i=>{i.column==e&&(s=i)}),s!=null||t||this.getAllCellCtrls().forEach(i=>{i.getColSpanningList().indexOf(e)>=0&&(s=i)}),s}onRowIndexChanged(){this.rowNode.rowIndex!=null&&(this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss())}updateRowIndexes(e){const t=this.rowNode.getRowIndexString();if(t===null)return;const s=(this.beans.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0)+(this.beans.filterManager?.getHeaderRowCount()??0),i=this.rowNode.rowIndex%2===0,o=s+this.rowNode.rowIndex+1;this.forEachGui(e,n=>{n.rowComp.setRowIndex(t),n.rowComp.addOrRemoveCssClass("ag-row-even",i),n.rowComp.addOrRemoveCssClass("ag-row-odd",!i),Hs(n.element,o)})}};function Vo(e){return e.altKey||e.ctrlKey||e.metaKey?!1:e.key?.length===1}function No(e,t,s,i,o){const n=i?i.getColDef().suppressKeyboardEvent:void 0;if(!n)return!1;const r=k(e,{event:t,editing:o,column:i,node:s,data:s.data,colDef:i.getColDef()});return!!(n&&n(r))}function qa(e){const{pinnedRowModel:t,rowModel:s}=e,[i,o]=[t?.isEmpty("top")??!0,t?.isEmpty("bottom")??!0],n=i?null:"top";let r,a;o?(r=null,a=s.getRowCount()-1):(r="bottom",a=t?.getPinnedBottomRowCount()??-1);const{visibleCols:l,rangeSvc:d}=e,c=l.allCols;!d||!c?.length||d.setCellRange({rowStartIndex:0,rowStartPinned:n,rowEndIndex:a,rowEndPinned:r})}var mp=65,Cp=67,vp=86,wp=68,bp=90,Sp=89;function yp(e){const{keyCode:t}=e;let s;switch(t){case mp:s=w.A;break;case Cp:s=w.C;break;case vp:s=w.V;break;case wp:s=w.D;break;case bp:s=w.Z;break;case Sp:s=w.Y;break;default:s=e.code}return s}var Rp=class extends b{constructor(e){super(),this.element=e}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.beans.touchSvc?.mockRowContextMenu(this)}addKeyboardListeners(){const e="keydown",t=this.processKeyboardEvent.bind(this,e);this.addManagedElementListeners(this.element,{[e]:t})}addMouseListeners(){["dblclick","contextmenu","mouseover","mouseout","click",Br("touchstart")?"touchstart":"mousedown"].forEach(s=>{const i=this.processMouseEvent.bind(this,s);this.addManagedElementListeners(this.element,{[s]:i})})}processMouseEvent(e,t){if(!ci(this.gos,t)||Fe(t))return;const{cellCtrl:s,rowCtrl:i}=this.getControlsForEventTarget(t.target);e==="contextmenu"?(s?.column&&s.dispatchCellContextMenuEvent(t),this.beans.contextMenuSvc?.handleContextMenuMouseEvent(t,void 0,i,s)):(s&&s.onMouseEvent(e,t),i&&i.onMouseEvent(e,t))}getControlsForEventTarget(e){const{gos:t}=this;return{cellCtrl:ko(t,e),rowCtrl:Vr(t,e,as)}}processKeyboardEvent(e,t){const{cellCtrl:s,rowCtrl:i}=this.getControlsForEventTarget(t.target);t.defaultPrevented||(s?this.processCellKeyboardEvent(s,e,t):i&&i.isFullWidth()&&this.processFullWidthRowKeyboardEvent(i,e,t))}processCellKeyboardEvent(e,t,s){const{rowNode:i,column:o,editing:n}=e;!No(this.gos,s,i,o,n)&&t==="keydown"&&(!n&&this.beans.navigation?.handlePageScrollingKey(s)||e.onKeyDown(s),this.doGridOperations(s,e.editing),Vo(s)&&e.processCharacter(s)),t==="keydown"&&this.eventSvc.dispatchEvent(e.createEvent(s,"cellKeyDown"))}processFullWidthRowKeyboardEvent(e,t,s){const{rowNode:i}=e,{focusSvc:o,navigation:n}=this.beans,r=o.getFocusedCell(),a=r&&r.column;if(!No(this.gos,s,i,a,!1)){const d=s.key;if(t==="keydown")switch(d){case w.PAGE_HOME:case w.PAGE_END:case w.PAGE_UP:case w.PAGE_DOWN:n?.handlePageScrollingKey(s,!0);break;case w.UP:case w.DOWN:e.onKeyboardNavigate(s);break;case w.TAB:e.onTabKeyDown(s);break;default:}}t==="keydown"&&this.eventSvc.dispatchEvent(e.createRowEvent("cellKeyDown",s))}doGridOperations(e,t){if(!e.ctrlKey&&!e.metaKey||t||!ci(this.gos,e))return;const s=yp(e),{clipboardSvc:i,undoRedo:o}=this.beans;if(s===w.A)return this.onCtrlAndA(e);if(s===w.C)return this.onCtrlAndC(i,e);if(s===w.D)return this.onCtrlAndD(i,e);if(s===w.V)return this.onCtrlAndV(i,e);if(s===w.X)return this.onCtrlAndX(i,e);if(s===w.Y)return this.onCtrlAndY(o);if(s===w.Z)return this.onCtrlAndZ(o,e)}onCtrlAndA(e){const{beans:{rowModel:t,rangeSvc:s,selectionSvc:i},gos:o}=this;s&&xe(o)&&t.isRowsToRender()?qa(this.beans):i&&i?.selectAllRowNodes({source:"keyboardSelectAll",selectAll:Lr(o)}),e.preventDefault()}onCtrlAndC(e,t){if(!e||this.gos.get("enableCellTextSelection"))return;const{cellCtrl:s,rowCtrl:i}=this.getControlsForEventTarget(t.target);s?.editing||i?.editing||(t.preventDefault(),e.copyToClipboard())}onCtrlAndX(e,t){if(!e||this.gos.get("enableCellTextSelection")||this.gos.get("suppressCutToClipboard"))return;const{cellCtrl:s,rowCtrl:i}=this.getControlsForEventTarget(t.target);s?.editing||i?.editing||(t.preventDefault(),e.cutToClipboard(void 0,"ui"))}onCtrlAndV(e,t){const{cellCtrl:s,rowCtrl:i}=this.getControlsForEventTarget(t.target);s?.editing||i?.editing||e&&!this.gos.get("suppressClipboardPaste")&&e.pasteFromClipboard()}onCtrlAndD(e,t){e&&!this.gos.get("suppressClipboardPaste")&&e.copyRangeDown(),t.preventDefault()}onCtrlAndZ(e,t){!this.gos.get("undoRedoCellEditing")||!e||(t.preventDefault(),t.shiftKey?e.redo("ui"):e.undo("ui"))}onCtrlAndY(e){e?.redo("ui")}},Ya=class extends b{constructor(e,t){super(),this.eContainer=e,this.eViewport=t}postConstruct(){this.addManagedEventListeners({rowContainerHeightChanged:this.onHeightChanged.bind(this,this.beans.rowContainerHeight)})}onHeightChanged(e){const t=e.uiContainerHeight,s=t!=null?`${t}px`:"";this.eContainer.style.height=s,this.eViewport&&(this.eViewport.style.height=s)}},mi=e=>e.topRowCtrls,Ci=e=>e.getStickyTopRowCtrls(),vi=e=>e.getStickyBottomRowCtrls(),wi=e=>e.bottomRowCtrls,bi=e=>e.allRowCtrls,zo=e=>e.getCtrls("top"),Wo=e=>e.getCtrls("center"),_o=e=>e.getCtrls("bottom"),xp={center:{type:"center",name:"center-cols",getRowCtrls:bi,getSpannedRowCtrls:Wo},left:{type:"left",name:"pinned-left-cols",pinnedType:"left",getRowCtrls:bi,getSpannedRowCtrls:Wo},right:{type:"right",name:"pinned-right-cols",pinnedType:"right",getRowCtrls:bi,getSpannedRowCtrls:Wo},fullWidth:{type:"fullWidth",name:"full-width",fullWidth:!0,getRowCtrls:bi},topCenter:{type:"center",name:"floating-top",getRowCtrls:mi,getSpannedRowCtrls:zo},topLeft:{type:"left",name:"pinned-left-floating",container:"ag-pinned-left-floating-top",pinnedType:"left",getRowCtrls:mi,getSpannedRowCtrls:zo},topRight:{type:"right",name:"pinned-right-floating",container:"ag-pinned-right-floating-top",pinnedType:"right",getRowCtrls:mi,getSpannedRowCtrls:zo},topFullWidth:{type:"fullWidth",name:"floating-top-full-width",fullWidth:!0,getRowCtrls:mi},stickyTopCenter:{type:"center",name:"sticky-top",getRowCtrls:Ci},stickyTopLeft:{type:"left",name:"pinned-left-sticky-top",container:"ag-pinned-left-sticky-top",pinnedType:"left",getRowCtrls:Ci},stickyTopRight:{type:"right",name:"pinned-right-sticky-top",container:"ag-pinned-right-sticky-top",pinnedType:"right",getRowCtrls:Ci},stickyTopFullWidth:{type:"fullWidth",name:"sticky-top-full-width",fullWidth:!0,getRowCtrls:Ci},stickyBottomCenter:{type:"center",name:"sticky-bottom",getRowCtrls:vi},stickyBottomLeft:{type:"left",name:"pinned-left-sticky-bottom",container:"ag-pinned-left-sticky-bottom",pinnedType:"left",getRowCtrls:vi},stickyBottomRight:{type:"right",name:"pinned-right-sticky-bottom",container:"ag-pinned-right-sticky-bottom",pinnedType:"right",getRowCtrls:vi},stickyBottomFullWidth:{type:"fullWidth",name:"sticky-bottom-full-width",fullWidth:!0,getRowCtrls:vi},bottomCenter:{type:"center",name:"floating-bottom",getRowCtrls:wi,getSpannedRowCtrls:_o},bottomLeft:{type:"left",name:"pinned-left-floating-bottom",container:"ag-pinned-left-floating-bottom",pinnedType:"left",getRowCtrls:wi,getSpannedRowCtrls:_o},bottomRight:{type:"right",name:"pinned-right-floating-bottom",container:"ag-pinned-right-floating-bottom",pinnedType:"right",getRowCtrls:wi,getSpannedRowCtrls:_o},bottomFullWidth:{type:"fullWidth",name:"floating-bottom-full-width",fullWidth:!0,getRowCtrls:wi}};function Uo(e){return`ag-${Vt(e).name}-viewport`}function ls(e){const t=Vt(e);return t.container??`ag-${t.name}-container`}function Qa(e){return`ag-${Vt(e).name}-spanned-cells-container`}function Vt(e){return xp[e]}var Fp=["topCenter","topLeft","topRight"],Ep=["bottomCenter","bottomLeft","bottomRight"],Dp=["center","left","right"],Pp=["center","left","right","fullWidth"],Mp=["stickyTopCenter","stickyBottomCenter","center","topCenter","bottomCenter"],Ap=["left","bottomLeft","topLeft","stickyTopLeft","stickyBottomLeft"],Tp=["right","bottomRight","topRight","stickyTopRight","stickyBottomRight"],Za=["stickyTopCenter","stickyTopLeft","stickyTopRight"],Xa=["stickyBottomCenter","stickyBottomLeft","stickyBottomRight"],kp=[...Za,"stickyTopFullWidth",...Xa,"stickyBottomFullWidth"],Ip=[...Fp,...Ep,...Dp,...Za,...Xa],Ja=class extends b{constructor(e){super(),this.name=e,this.visible=!0,this.EMPTY_CTRLS=[],this.options=Vt(e)}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.forContainers(["center"],()=>{this.viewportSizeFeature=this.createManagedBean(new gp(this)),this.addManagedEventListeners({stickyTopOffsetChanged:this.onStickyTopOffsetChanged.bind(this)})})}onStickyTopOffsetChanged(e){this.comp.setOffsetTop(`${e.offset}px`)}registerWithCtrlsService(){this.options.fullWidth||this.beans.ctrlsSvc.register(this.name,this)}forContainers(e,t){e.indexOf(this.name)>=0&&t()}setComp(e,t,s,i){this.comp=e,this.eContainer=t,this.eSpannedContainer=s,this.eViewport=i,this.createManagedBean(new Rp(this.eViewport??this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder();const{pinnedCols:o,rangeSvc:n}=this.beans,r=()=>this.onPinnedWidthChanged();this.forContainers(Ap,()=>{this.pinnedWidthFeature=this.createOptionalManagedBean(o?.createPinnedWidthFeature(!0,this.eContainer,this.eSpannedContainer)),this.addManagedEventListeners({leftPinnedWidthChanged:r})}),this.forContainers(Tp,()=>{this.pinnedWidthFeature=this.createOptionalManagedBean(o?.createPinnedWidthFeature(!1,this.eContainer,this.eSpannedContainer)),this.addManagedEventListeners({rightPinnedWidthChanged:r})}),this.forContainers(Pp,()=>this.createManagedBean(new Ya(this.eContainer,this.name==="center"?i:void 0))),n&&this.forContainers(Ip,()=>this.createManagedBean(n.createDragListenerFeature(this.eContainer))),this.forContainers(Mp,()=>this.createManagedBean(new Ho(a=>this.comp.setContainerWidth(`${a}px`)))),this.visible=this.isContainerVisible(),this.addListeners(),this.registerWithCtrlsService()}onScrollCallback(e){this.addManagedElementListeners(this.eViewport,{scroll:e})}addListeners(){const{spannedRowRenderer:e,gos:t}=this.beans;this.addManagedEventListeners({displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onDisplayedColumnsChanged.bind(this),displayedRowsChanged:s=>this.onDisplayedRowsChanged(s.afterScroll)}),this.onDisplayedColumnsChanged(),this.onDisplayedRowsChanged(),e&&this.options.getSpannedRowCtrls&&t.get("enableCellSpan")&&this.addManagedListeners(e,{spannedRowsUpdated:()=>{const s=this.options.getSpannedRowCtrls(e);s&&this.comp.setSpannedRowCtrls(s,!1)}})}listenOnDomOrder(){if(kp.indexOf(this.name)>=0){this.comp.setDomOrder(!0);return}const t=()=>{const s=this.gos.get("ensureDomOrder"),i=Q(this.gos,"print");this.comp.setDomOrder(s||i)};this.addManagedPropertyListener("domLayout",t),t()}onDisplayedColumnsChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}addPreventScrollWhileDragging(){const{dragSvc:e}=this.beans;if(!e)return;const t=s=>{e.dragging&&s.cancelable&&s.preventDefault()};this.eContainer.addEventListener("touchmove",t,{passive:!1}),this.addDestroyFunc(()=>this.eContainer.removeEventListener("touchmove",t))}onHorizontalViewportChanged(e=!1){const t=this.getCenterWidth(),s=this.getCenterViewportScrollLeft();this.beans.colViewport.setScrollPosition(t,s,e)}hasHorizontalScrollGap(){return this.eContainer.clientWidth-this.eViewport.clientWidth<0}hasVerticalScrollGap(){return this.eContainer.clientHeight-this.eViewport.clientHeight<0}getCenterWidth(){return Mt(this.eViewport)}getCenterViewportScrollLeft(){return Ws(this.eViewport,this.enableRtl)}registerViewportResizeListener(e){const t=Le(this.beans,this.eViewport,e);this.addDestroyFunc(()=>t())}isViewportInTheDOMTree(){return dr(this.eViewport)}getViewportScrollLeft(){return Ws(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){return this.gos.get("alwaysShowHorizontalScroll")||Hu(this.eViewport)}setHorizontalScroll(e){this.comp.setHorizontalScroll(e)}getHScrollPosition(){return{left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth}}setCenterViewportScrollLeft(e){_s(this.eViewport,e,this.enableRtl)}isContainerVisible(){return!(this.options.pinnedType!=null)||!!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.options.getRowCtrls(this.beans.rowRenderer);if(!this.visible||t.length===0){this.comp.setRowCtrls({rowCtrls:this.EMPTY_CTRLS});return}const s=Q(this.gos,"print"),o=this.gos.get("embedFullWidthRows")||s,n=t.filter(r=>{const a=r.isFullWidth();return this.options.fullWidth?!o&&a:o||!a});this.comp.setRowCtrls({rowCtrls:n,useFlushSync:e})}},el="ag-force-vertical-scroll",Lp="ag-selectable",Op="ag-column-moving",tl=class extends b{constructor(){super(...arguments),this.stickyTopHeight=0,this.stickyBottomHeight=0}wireBeans(e){this.ctrlsSvc=e.ctrlsSvc,this.colModel=e.colModel,this.scrollVisibleSvc=e.scrollVisibleSvc,this.pinnedRowModel=e.pinnedRowModel,this.filterManager=e.filterManager,this.rowGroupColsSvc=e.rowGroupColsSvc}setComp(e,t,s,i,o,n,r){this.comp=e,this.eGridBody=t,this.eBodyViewport=s,this.eTop=i,this.eBottom=o,this.eStickyTop=n,this.eStickyBottom=r,this.eCenterColsViewport=s.querySelector(`.${Uo("center")}`),this.eFullWidthContainer=s.querySelector(`.${ls("fullWidth")}`),this.eStickyTopFullWidthContainer=n.querySelector(`.${ls("stickyTopFullWidth")}`),this.eStickyBottomFullWidthContainer=r.querySelector(`.${ls("stickyBottomFullWidth")}`),this.setCellTextSelection(this.gos.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",a=>this.setCellTextSelection(a.currentValue)),this.createManagedBean(new Oo(this.comp)),this.scrollFeature=this.createManagedBean(new hp(this.eBodyViewport)),this.beans.rowDragSvc?.setupRowDrag(this.eBodyViewport,this),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([i,s,o,n,r]),this.setGridRootRole(),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.updateScrollingClasses(),this.filterManager?.setupAdvFilterHeaderComp(i),this.ctrlsSvc.register("gridBodyCtrl",this)}addEventListeners(){const e=this.setFloatingHeights.bind(this),t=this.setGridRootRole.bind(this);this.addManagedEventListeners({gridColumnsChanged:this.onGridColumnsChanged.bind(this),scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this),scrollGapChanged:this.updateScrollingClasses.bind(this),pinnedRowDataChanged:e,pinnedHeightChanged:e,headerHeightChanged:this.setStickyTopOffsetTop.bind(this),columnRowGroupChanged:t,columnPivotChanged:t}),this.addManagedPropertyListener("treeData",t)}onGridColumnsChanged(){const e=this.beans.colModel.getCols();this.comp.setColumnCount(e.length)}onScrollVisibilityChanged(){const{scrollVisibleSvc:e}=this,t=e.verticalScrollShowing;this.setVerticalScrollPaddingVisible(t),this.setStickyWidth(t),this.setStickyBottomOffsetBottom();const s=t&&e.getScrollbarWidth()||0,i=nr()?16:0,o=`calc(100% + ${s+i}px)`;Pe(this.beans,()=>this.comp.setBodyViewportWidth(o)),this.updateScrollingClasses()}setGridRootRole(){const{rowGroupColsSvc:e,colModel:t}=this;let s=this.gos.get("treeData");if(!s){const i=t.isPivotMode();s=(e?e.columns.length:0)>=(i?2:1)}this.comp.setGridRootRole(s?"treegrid":"grid")}addFocusListeners(e){e.forEach(t=>{this.addManagedElementListeners(t,{focusin:s=>{const{target:i}=s,o=st(i,"ag-root",t);t.classList.toggle("ag-has-focus",!o)},focusout:s=>{const{target:i,relatedTarget:o}=s,n=t.contains(o),r=st(o,"ag-root",t);st(i,"ag-root",t)||(!n||r)&&t.classList.remove("ag-has-focus")}})})}setColumnMovingCss(e){this.comp.setColumnMovingCss(Op,e)}setCellTextSelection(e=!1){this.comp.setCellSelectableCss(Lp,e)}updateScrollingClasses(){const{eGridBody:{classList:e},scrollVisibleSvc:t}=this;e.toggle("ag-body-vertical-content-no-gap",!t.verticalScrollGap),e.toggle("ag-body-horizontal-content-no-gap",!t.horizontalScrollGap)}disableBrowserDragging(){this.addManagedElementListeners(this.eGridBody,{dragstart:e=>{if(e.target instanceof HTMLImageElement)return e.preventDefault(),!1}})}addStopEditingWhenGridLosesFocus(){this.beans.editSvc?.addStopEditingWhenGridLosesFocus([this.eBodyViewport,this.eBottom,this.eTop,this.eStickyTop,this.eStickyBottom])}updateRowCount(){const e=(this.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0)+(this.filterManager?.getHeaderRowCount()??0),{rowModel:t}=this.beans,s=t.isLastRowIndexKnown()?t.getRowCount():-1,i=s===-1?-1:e+s;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?el:null,s=Q(this.gos,"normal");return this.comp.setAlwaysVerticalScrollClass(t,e),e||s&&Bu(this.eBodyViewport)}setupRowAnimationCssClass(){const{rowContainerHeight:e,environment:t}=this.beans;let s=t.sizesMeasured;const i=()=>{const o=s&&ct(this.gos)&&!e.stretching,n=o?"ag-row-animation":"ag-row-no-animation";this.comp.setRowAnimationCssOnBodyViewport(n,o)};i(),this.addManagedEventListeners({heightScaleChanged:i}),this.addManagedPropertyListener("animateRows",i),this.addManagedEventListeners({gridStylesChanged:()=>{!s&&t.sizesMeasured&&(s=!0,i())}})}addBodyViewportListener(){const{popupSvc:e,touchSvc:t}=this.beans,s=this.onBodyViewportContextMenu.bind(this);this.addManagedElementListeners(this.eBodyViewport,{contextmenu:s}),t?.mockBodyContextMenu(this,s),this.addManagedElementListeners(this.eBodyViewport,{wheel:this.onBodyViewportWheel.bind(this,e)}),this.addManagedElementListeners(this.eStickyTop,{wheel:this.onStickyWheel.bind(this)}),this.addManagedElementListeners(this.eStickyBottom,{wheel:this.onStickyWheel.bind(this)}),this.addFullWidthContainerWheelListener()}addFullWidthContainerWheelListener(){this.addManagedElementListeners(this.eFullWidthContainer,{wheel:e=>this.onFullWidthContainerWheel(e)})}onFullWidthContainerWheel(e){const{deltaX:t,deltaY:s,shiftKey:i}=e;(i||Math.abs(t)>Math.abs(s))&&ci(this.gos,e)&&this.scrollGridBodyToMatchEvent(e)}onStickyWheel(e){const{deltaX:t,deltaY:s,shiftKey:i}=e,o=i||Math.abs(t)>Math.abs(s),n=e.target;o?(this.eStickyTopFullWidthContainer.contains(n)||this.eStickyBottomFullWidthContainer.contains(n))&&this.scrollGridBodyToMatchEvent(e):(e.preventDefault(),this.scrollVertically(s))}scrollGridBodyToMatchEvent(e){const{deltaX:t,deltaY:s}=e;e.preventDefault(),this.eCenterColsViewport.scrollBy({left:t||s})}onBodyViewportContextMenu(e,t,s){if(!e&&!s)return;this.gos.get("preventDefaultOnContextMenu")&&(e||s).preventDefault();const{target:i}=e||t;(i===this.eBodyViewport||i===this.ctrlsSvc.get("center").eViewport)&&this.beans.contextMenuSvc?.showContextMenu({mouseEvent:e,touchEvent:s,value:null,anchorToElement:this.eGridBody,source:"ui"})}onBodyViewportWheel(e,t){this.gos.get("suppressScrollWhenPopupsAreOpen")&&e?.hasAnchoredPopup()&&t.preventDefault()}scrollVertically(e){const t=this.eBodyViewport.scrollTop;return this.scrollFeature.setVerticalScrollPosition(t+e),this.eBodyViewport.scrollTop-t}setFloatingHeights(){const{pinnedRowModel:e}=this,t=e?.getPinnedTopTotalHeight()??0,s=e?.getPinnedBottomTotalHeight()??0;this.comp.setTopHeight(t),this.comp.setBottomHeight(s),this.comp.setTopDisplay(t?"inherit":"none"),this.comp.setBottomDisplay(s?"inherit":"none"),this.setStickyTopOffsetTop(),this.setStickyBottomOffsetBottom()}setStickyTopHeight(e=0){this.comp.setStickyTopHeight(`${e}px`),this.stickyTopHeight=e}setStickyBottomHeight(e=0){this.comp.setStickyBottomHeight(`${e}px`),this.stickyBottomHeight=e}setStickyWidth(e){if(!e)this.comp.setStickyTopWidth("100%"),this.comp.setStickyBottomWidth("100%");else{const t=this.scrollVisibleSvc.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${t}px)`),this.comp.setStickyBottomWidth(`calc(100% - ${t}px)`)}}setStickyTopOffsetTop(){const t=this.ctrlsSvc.get("gridHeaderCtrl").headerHeight+(this.filterManager?.getHeaderHeight()??0),s=this.pinnedRowModel?.getPinnedTopTotalHeight()??0;let i=0;t>0&&(i+=t),s>0&&(i+=s),i>0&&(i+=1),this.comp.setStickyTopTop(`${i}px`)}setStickyBottomOffsetBottom(){const{pinnedRowModel:e,scrollVisibleSvc:t,comp:s}=this,i=e?.getPinnedBottomTotalHeight()??0,n=t.horizontalScrollShowing&&t.getScrollbarWidth()||0,r=i+n;s.setStickyBottomBottom(`${r}px`)}},sl=class extends L{constructor(e,t){super(),this.direction=t,this.eViewport=E,this.eContainer=E,this.hideTimeout=0,this.setTemplate(e)}postConstruct(){this.addManagedEventListeners({scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this)}),this.onScrollVisibilityChanged(),this.addOrRemoveCssClass("ag-apple-scrollbar",ir()||_e())}destroy(){super.destroy(),window.clearTimeout(this.hideTimeout)}initialiseInvisibleScrollbar(){this.invisibleScrollbar===void 0&&(this.invisibleScrollbar=nr(),this.invisibleScrollbar&&(this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles()))}addActiveListenerToggles(){const e=this.getGui(),t=()=>this.addOrRemoveCssClass("ag-scrollbar-active",!0),s=()=>this.addOrRemoveCssClass("ag-scrollbar-active",!1);this.addManagedListeners(e,{mouseenter:t,mousedown:t,touchstart:t,mouseleave:s,touchend:s})}onScrollVisibilityChanged(){this.invisibleScrollbar===void 0&&this.initialiseInvisibleScrollbar(),Pe(this.beans,()=>this.setScrollVisible())}hideAndShowInvisibleScrollAsNeeded(){this.addManagedEventListeners({bodyScroll:e=>{e.direction===this.direction&&(this.hideTimeout&&(window.clearTimeout(this.hideTimeout),this.hideTimeout=0),this.addOrRemoveCssClass("ag-scrollbar-scrolling",!0))},bodyScrollEnd:()=>{this.hideTimeout=window.setTimeout(()=>{this.addOrRemoveCssClass("ag-scrollbar-scrolling",!1),this.hideTimeout=0},400)}})}attemptSettingScrollPosition(e){const t=this.eViewport;vr(()=>me(t),()=>this.setScrollPosition(e),100)}onScrollCallback(e){this.addManagedElementListeners(this.eViewport,{scroll:e})}},il=class extends sl{constructor(){super(``,"horizontal"),this.eLeftSpacer=E,this.eRightSpacer=E,this.setScrollVisibleDebounce=0}wireBeans(e){this.visibleCols=e.visibleCols,this.scrollVisibleSvc=e.scrollVisibleSvc}postConstruct(){super.postConstruct();const e=this.setFakeHScrollSpacerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e,displayedColumnsWidthChanged:e,pinnedRowDataChanged:this.refreshCompBottom.bind(this)}),this.addManagedPropertyListener("domLayout",e),this.beans.ctrlsSvc.register("fakeHScrollComp",this),this.createManagedBean(new Ho(t=>this.eContainer.style.width=`${t}px`)),this.addManagedPropertyListeners(["suppressHorizontalScroll"],this.onScrollVisibilityChanged.bind(this))}destroy(){window.clearTimeout(this.setScrollVisibleDebounce),super.destroy()}initialiseInvisibleScrollbar(){this.invisibleScrollbar===void 0&&(this.enableRtl=this.gos.get("enableRtl"),super.initialiseInvisibleScrollbar(),this.invisibleScrollbar&&this.refreshCompBottom())}refreshCompBottom(){if(!this.invisibleScrollbar)return;const e=this.beans.pinnedRowModel?.getPinnedBottomTotalHeight()??0;this.getGui().style.bottom=`${e}px`}onScrollVisibilityChanged(){super.onScrollVisibilityChanged(),this.setFakeHScrollSpacerWidths()}setFakeHScrollSpacerWidths(){const e=this.scrollVisibleSvc.verticalScrollShowing;let t=this.visibleCols.getDisplayedColumnsRightWidth();const s=!this.enableRtl&&e,i=this.scrollVisibleSvc.getScrollbarWidth();s&&(t+=i),we(this.eRightSpacer,t),this.eRightSpacer.classList.toggle("ag-scroller-corner",t<=i);let o=this.visibleCols.getColsLeftWidth();this.enableRtl&&e&&(o+=i),we(this.eLeftSpacer,o),this.eLeftSpacer.classList.toggle("ag-scroller-corner",o<=i)}setScrollVisible(){const e=this.scrollVisibleSvc.horizontalScrollShowing,t=this.invisibleScrollbar,s=this.gos.get("suppressHorizontalScroll"),i=e&&this.scrollVisibleSvc.getScrollbarWidth()||0,n=s?0:i===0&&t?16:i,r=()=>{this.setScrollVisibleDebounce=0,this.addOrRemoveCssClass("ag-scrollbar-invisible",t),Yt(this.getGui(),n),Yt(this.eViewport,n),Yt(this.eContainer,n),this.setDisplayed(e,{skipAriaHidden:!0})};window.clearTimeout(this.setScrollVisibleDebounce),e?this.setScrollVisibleDebounce=window.setTimeout(r,100):r()}getScrollPosition(){return Ws(this.eViewport,this.enableRtl)}setScrollPosition(e){me(this.eViewport)||this.attemptSettingScrollPosition(e),_s(this.eViewport,e,this.enableRtl)}},Gp={selector:"AG-FAKE-HORIZONTAL-SCROLL",component:il},ol=class extends sl{constructor(){super(``,"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new Ya(this.eContainer));const{ctrlsSvc:e}=this.beans;e.register("fakeVScrollComp",this),this.addManagedEventListeners({rowContainerHeightChanged:this.onRowContainerHeightChanged.bind(this,e)})}setScrollVisible(){const{scrollVisibleSvc:e}=this.beans,t=e.verticalScrollShowing,s=this.invisibleScrollbar,i=t&&e.getScrollbarWidth()||0,o=i===0&&s?16:i;this.addOrRemoveCssClass("ag-scrollbar-invisible",s),we(this.getGui(),o),we(this.eViewport,o),we(this.eContainer,o),this.setDisplayed(t,{skipAriaHidden:!0})}onRowContainerHeightChanged(e){const s=e.getGridBodyCtrl().eBodyViewport,i=this.getScrollPosition(),o=s.scrollTop;i!=o&&this.setScrollPosition(o,!0)}getScrollPosition(){return this.eViewport.scrollTop}setScrollPosition(e,t){!t&&!me(this.eViewport)&&this.attemptSettingScrollPosition(e),this.eViewport.scrollTop=e}},Hp={selector:"AG-FAKE-VERTICAL-SCROLL",component:ol};function nl(e){return e.cols?e.cols.treeDepth+1:-1}function Ve(e){return e.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0}function $o(e){const t=[],s=e.ctrlsSvc.getHeaderRowContainerCtrls();for(const i of s){if(!i)continue;const o=i.getGroupRowCount()||0;for(let n=0;na)&&(t[n]=l)}}}return t}function Bp(e,t){const s=e.colModel.isPivotMode()?Np(e):rl(e);let i=0;const o=t.getHeaderCtrls();for(const n of o){const{column:r}=n;if(r.isAutoHeaderHeight()){const a=r.getAutoHeaderHeight();a!=null&&a>i&&(i=a)}}return Math.max(s,i)}function Ko(e){const t=e.colModel.isPivotMode()?Vp(e):ds(e),i=e.visibleCols.allCols.filter(o=>o.isAutoHeaderHeight()).map(o=>o.getAutoHeaderHeight()||0);return Math.max(t,...i)}function ds(e){return e.gos.get("headerHeight")??e.environment.getDefaultHeaderHeight()}function jo(e){return e.gos.get("floatingFiltersHeight")??ds(e)}function rl(e){return e.gos.get("groupHeaderHeight")??ds(e)}function Vp(e){return e.gos.get("pivotHeaderHeight")??ds(e)}function Np(e){return e.gos.get("pivotGroupHeaderHeight")??rl(e)}var al=class extends b{setComp(e,t,s){this.comp=e,this.eGui=t;const{beans:i}=this,{headerNavigation:o,touchSvc:n,ctrlsSvc:r}=i;o&&this.createManagedBean(new St(s,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addManagedEventListeners({columnPivotModeChanged:this.onPivotModeChanged.bind(this,i),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this,i)}),this.onPivotModeChanged(i),this.setupHeaderHeight();const a=this.onHeaderContextMenu.bind(this);this.addManagedElementListeners(this.eGui,{contextmenu:a}),n?.mockHeaderContextMenu(this,a),r.register("gridHeaderCtrl",this)}setupHeaderHeight(){const e=this.setHeaderHeight.bind(this);e(),this.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],e),this.addManagedEventListeners({displayedColumnsChanged:e,columnHeaderHeightChanged:e,columnGroupHeaderHeightChanged:()=>Pe(this.beans,()=>e()),gridStylesChanged:e,advancedFilterEnabledChanged:e})}setHeaderHeight(){const{beans:e}=this;let t=0;const s=$o(e).reduce((n,r)=>n+r,0),i=Ko(e);if(e.filterManager?.hasFloatingFilters()&&(t+=jo(e)),t+=s,t+=i,this.headerHeight===t)return;this.headerHeight=t;const o=`${t+1}px`;this.comp.setHeightAndMinHeight(o),this.eventSvc.dispatchEvent({type:"headerHeightChanged"})}onPivotModeChanged(e){const t=e.colModel.isPivotMode();this.comp.addOrRemoveCssClass("ag-pivot-on",t),this.comp.addOrRemoveCssClass("ag-pivot-off",!t)}onDisplayedColumnsChanged(e){const s=e.visibleCols.allCols.some(i=>i.isSpanHeaderHeight());this.comp.addOrRemoveCssClass("ag-header-allow-overflow",s)}onTabKeyDown(e){const t=this.gos.get("enableRtl"),s=e.shiftKey,i=s!==t?"LEFT":"RIGHT",{beans:o}=this,{headerNavigation:n,focusSvc:r}=o;(n.navigateHorizontally(i,!0,e)||!s&&r.focusOverlay(!1)||vt(o,s,!0))&&e.preventDefault()}handleKeyDown(e){let t=null;const{headerNavigation:s}=this.beans;switch(e.key){case w.LEFT:t="LEFT";case w.RIGHT:{x(t)||(t="RIGHT"),s.navigateHorizontally(t,!1,e)&&e.preventDefault();break}case w.UP:t="UP";case w.DOWN:{x(t)||(t="DOWN"),s.navigateVertically(t,null,e)&&e.preventDefault();break}default:return}}onFocusOut(e){const{relatedTarget:t}=e,{eGui:s,beans:i}=this;!t&&s.contains(z(i))||s.contains(t)||(i.focusSvc.focusedHeader=null)}onHeaderContextMenu(e,t,s){const{menuSvc:i,ctrlsSvc:o}=this.beans;if(!e&&!s||!i?.isHeaderContextMenuEnabled())return;const{target:n}=e??t;(n===this.eGui||n===o.getHeaderRowContainerCtrl()?.eViewport)&&i.showHeaderContextMenu(void 0,e,s)}},qo=class extends L{constructor(e,t){super(e),this.ctrl=t}getCtrl(){return this.ctrl}},zp=class extends qo{constructor(e){super(`
`,e),this.eResize=E,this.eHeaderCompWrapper=E,this.headerCompVersion=0}postConstruct(){const e=this.getGui();((o,n)=>{n!=null&&n!=""?e.setAttribute(o,n):e.removeAttribute(o)})("col-id",this.ctrl.column.getColId());const s={setWidth:o=>e.style.width=o,addOrRemoveCssClass:(o,n)=>this.addOrRemoveCssClass(o,n),setUserStyles:o=>qt(e,o),setAriaSort:o=>o?Jn(e,o):er(e),setUserCompDetails:o=>this.setUserCompDetails(o),getUserCompInstance:()=>this.headerComp};this.ctrl.setComp(s,this.getGui(),this.eResize,this.eHeaderCompWrapper,void 0);const i=this.ctrl.getSelectAllGui();i&&this.eResize.insertAdjacentElement("afterend",i)}destroy(){this.destroyHeaderComp(),super.destroy()}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(s=>this.afterCompCreated(t,s))}afterCompCreated(e,t){if(e!=this.headerCompVersion||!this.isAlive()){this.destroyBean(t);return}this.destroyHeaderComp(),this.headerComp=t,this.headerCompGui=t.getGui(),this.eHeaderCompWrapper.appendChild(this.headerCompGui),this.ctrl.setDragSource(this.getGui())}},Wp=class extends qo{constructor(e){super(`
`,e),this.eResize=E,this.eHeaderCompWrapper=E}postConstruct(){const e=this.getGui(),t=(i,o)=>o!=null?e.setAttribute(i,o):e.removeAttribute(i);e.setAttribute("col-id",this.ctrl.column.getUniqueId());const s={addOrRemoveCssClass:(i,o)=>this.addOrRemoveCssClass(i,o),setUserStyles:i=>qt(e,i),setHeaderWrapperHidden:i=>{i?this.eHeaderCompWrapper.style.setProperty("display","none"):this.eHeaderCompWrapper.style.removeProperty("display")},setHeaderWrapperMaxHeight:i=>{i!=null?this.eHeaderCompWrapper.style.setProperty("max-height",`${i}px`):this.eHeaderCompWrapper.style.removeProperty("max-height"),this.eHeaderCompWrapper.classList.toggle("ag-header-cell-comp-wrapper-limited-height",i!=null)},setResizableDisplayed:i=>N(this.eResize,i),setWidth:i=>e.style.width=i,setAriaExpanded:i=>t("aria-expanded",i),setUserCompDetails:i=>this.setUserCompDetails(i),getUserCompInstance:()=>this.headerGroupComp};this.ctrl.setComp(s,e,this.eResize,this.eHeaderCompWrapper,void 0)}setUserCompDetails(e){e.newAgStackInstance().then(t=>this.afterHeaderCompCreated(t))}afterHeaderCompCreated(e){const t=()=>this.destroyBean(e);if(!this.isAlive()){t();return}const s=this.getGui(),i=e.getGui();this.eHeaderCompWrapper.appendChild(i),this.addDestroyFunc(t),this.headerGroupComp=e,this.ctrl.setDragSource(s)}addOrRemoveHeaderWrapperStyle(e,t){const{eHeaderCompWrapper:s}=this;t?s.style.setProperty(e,t):s.style.removeProperty(e)}},_p=class extends qo{constructor(e){super(`
`,e),this.eFloatingFilterBody=E,this.eButtonWrapper=E,this.eButtonShowMainFilter=E}postConstruct(){const e=this.getGui(),t={addOrRemoveCssClass:(s,i)=>this.addOrRemoveCssClass(s,i),setUserStyles:s=>qt(e,s),addOrRemoveBodyCssClass:(s,i)=>this.eFloatingFilterBody.classList.toggle(s,i),setButtonWrapperDisplayed:s=>N(this.eButtonWrapper,s),setCompDetails:s=>this.setCompDetails(s),getFloatingFilterComp:()=>this.compPromise,setWidth:s=>e.style.width=s,setMenuIcon:s=>this.eButtonShowMainFilter.appendChild(s)};this.ctrl.setComp(t,e,this.eButtonShowMainFilter,this.eFloatingFilterBody,void 0)}setCompDetails(e){if(!e){this.destroyFloatingFilterComp(),this.compPromise=null;return}this.compPromise=e.newAgStackInstance(),this.compPromise.then(t=>this.afterCompCreated(t))}destroy(){this.destroyFloatingFilterComp(),super.destroy()}destroyFloatingFilterComp(){this.floatingFilterComp&&(this.eFloatingFilterBody.removeChild(this.floatingFilterComp.getGui()),this.floatingFilterComp=this.destroyBean(this.floatingFilterComp))}afterCompCreated(e){if(e){if(!this.isAlive()){this.destroyBean(e);return}this.destroyFloatingFilterComp(),this.floatingFilterComp=e,this.eFloatingFilterBody.appendChild(e.getGui()),e.afterGuiAttached&&e.afterGuiAttached()}}},Up=class extends L{constructor(e){super(),this.ctrl=e,this.headerComps={},this.setTemplate(`
`)}postConstruct(){Hs(this.getGui(),this.ctrl.getAriaRowIndex());const e={setHeight:t=>this.getGui().style.height=t,setTop:t=>this.getGui().style.top=t,setHeaderCtrls:(t,s)=>this.setHeaderCtrls(t,s),setWidth:t=>this.getGui().style.width=t};this.ctrl.setComp(e,void 0)}destroy(){this.setHeaderCtrls([],!1),super.destroy()}setHeaderCtrls(e,t){if(!this.isAlive())return;const s=this.headerComps;if(this.headerComps={},e.forEach(i=>{const o=i.instanceId;let n=s[o];delete s[o],n==null&&(n=this.createHeaderComp(i),this.getGui().appendChild(n.getGui())),this.headerComps[o]=n}),Object.values(s).forEach(i=>{this.getGui().removeChild(i.getGui()),this.destroyBean(i)}),t){const i=Object.values(this.headerComps);i.sort((n,r)=>{const a=n.getCtrl().column.getLeft(),l=r.getCtrl().column.getLeft();return a-l});const o=i.map(n=>n.getGui());ur(this.getGui(),o)}}createHeaderComp(e){let t;switch(this.ctrl.type){case"group":t=new Wp(e);break;case"filter":t=new _p(e);break;default:t=new zp(e);break}return this.createBean(t),t.setParentComponent(this),t}},Yo=class extends b{constructor(e,t,s,i){super(),this.columnOrGroup=e,this.eCell=t,this.colsSpanning=i,this.columnOrGroup=e,this.ariaEl=t.querySelector("[role=columnheader]")||t,this.beans=s}setColsSpanning(e){this.colsSpanning=e,this.onLeftChanged()}getColumnOrGroup(){const{beans:e,colsSpanning:t}=this;return e.gos.get("enableRtl")&&t?H(t):this.columnOrGroup}postConstruct(){const e=this.onLeftChanged.bind(this);this.addManagedListeners(this.columnOrGroup,{leftChanged:e}),this.setLeftFirstTime(),this.addManagedEventListeners({displayedColumnsWidthChanged:e}),this.addManagedPropertyListener("domLayout",e)}setLeftFirstTime(){const{gos:e,colAnimation:t}=this.beans,s=e.get("suppressColumnMoveAnimation"),i=x(this.columnOrGroup.getOldLeft());t?.isActive()&&i&&!s?this.animateInLeft():this.onLeftChanged()}animateInLeft(){const e=this.getColumnOrGroup(),t=this.modifyLeftForPrintLayout(e,e.getOldLeft()),s=this.modifyLeftForPrintLayout(e,e.getLeft());this.setLeft(t),this.actualLeft=s,this.beans.colAnimation.executeNextVMTurn(()=>{this.actualLeft===s&&this.setLeft(s)})}onLeftChanged(){const e=this.getColumnOrGroup(),t=e.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(e,t),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(e,t){const{gos:s,visibleCols:i}=this.beans;if(!Q(s,"print")||e.getPinned()==="left")return t;const n=i.getColsLeftWidth();if(e.getPinned()==="right"){const r=i.bodyWidth;return n+r+t}return n+t}setLeft(e){if(x(e)&&(this.eCell.style.left=`${e}px`),W(this.columnOrGroup)){const t=this.columnOrGroup.getLeafColumns();if(!t.length)return;t.length>1&&Xn(this.ariaEl,t.length)}}},$p=0,ll="headerCtrl",Qo=class extends b{constructor(e,t){super(),this.column=e,this.rowCtrl=t,this.resizeToggleTimeout=0,this.resizeMultiplier=1,this.resizeFeature=null,this.lastFocusEvent=null,this.dragSource=null,this.instanceId=e.getUniqueId()+"-"+$p++}postConstruct(){const e=this.refreshTabIndex.bind(this);this.addManagedPropertyListeners(["suppressHeaderFocus"],e),this.addManagedEventListeners({overlayExclusiveChanged:e})}shouldStopEventPropagation(e){const{headerRowIndex:t,column:s}=this.beans.focusSvc.focusedHeader,i=s.getDefinition(),o=i&&i.suppressHeaderKeyboardEvent;if(!x(o))return!1;const n=k(this.gos,{colDef:i,column:s,headerRowIndex:t,event:e});return!!o(n)}getWrapperHasFocus(){return z(this.beans)===this.eGui}setGui(e,t){this.eGui=e,this.addDomData(t),t.addManagedListeners(this.beans.eventSvc,{displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this)}),t.addManagedElementListeners(this.eGui,{focus:this.onGuiFocus.bind(this)}),this.onDisplayedColumnsChanged(),this.refreshTabIndex()}refreshHeaderStyles(){const e=this.column.getDefinition();if(!e)return;const{headerStyle:t}=e;let s;if(typeof t=="function"){const i=this.getHeaderClassParams();s=t(i)}else s=t;s&&this.comp.setUserStyles(s)}onGuiFocus(){this.eventSvc.dispatchEvent({type:"headerFocused",column:this.column})}setupAutoHeight(e){const{wrapperElement:t,checkMeasuringCallback:s,compBean:i}=e,{beans:o}=this,n=u=>{if(!this.isAlive()||!i.isAlive())return;const{paddingTop:h,paddingBottom:g,borderBottomWidth:p,borderTopWidth:f}=it(this.eGui),m=h+g+p+f,v=t.offsetHeight+m;if(u<5){const S=_(o),y=!S||!S.contains(t),D=v==0;if(y||D){Pe(o,()=>n(u+1));return}}this.setColHeaderHeight(this.column,v)};let r=!1,a;const l=()=>{const u=this.column.isAutoHeaderHeight();u&&!r&&d(),!u&&r&&c()},d=()=>{r=!0,n(0),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!0),a=Le(this.beans,t,()=>n(0))},c=()=>{r=!1,a&&a(),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!1),a=void 0};l(),i.addDestroyFunc(()=>c()),i.addManagedListeners(this.column,{widthChanged:()=>r&&n(0)}),i.addManagedEventListeners({sortChanged:()=>{r&&window.setTimeout(()=>n(0))}}),s&&s(l)}onDisplayedColumnsChanged(){const{comp:e,column:t,beans:s,eGui:i}=this;!e||!t||!i||(va(e,t,s.visibleCols),$i(i,s.visibleCols.getAriaColIndex(t)))}addResizeAndMoveKeyboardListeners(e){e.addManagedListeners(this.eGui,{keydown:this.onGuiKeyDown.bind(this),keyup:this.onGuiKeyUp.bind(this)})}refreshTabIndex(){const e=Ct(this.beans);this.eGui&&Ce(this.eGui,"tabindex",e?null:"-1")}onGuiKeyDown(e){const t=z(this.beans),s=e.key===w.LEFT||e.key===w.RIGHT;if(this.isResizing&&(e.preventDefault(),e.stopImmediatePropagation()),t!==this.eGui||!e.shiftKey&&!e.altKey||((this.isResizing||s)&&(e.preventDefault(),e.stopImmediatePropagation()),!s))return;const o=e.key===w.LEFT!==this.gos.get("enableRtl")?"left":"right";if(e.altKey){this.isResizing=!0,this.resizeMultiplier+=1;const n=this.getViewportAdjustedResizeDiff(e);this.resizeHeader(n,e.shiftKey),this.resizeFeature?.toggleColumnResizing(!0)}else this.moveHeader(o)}moveHeader(e){this.beans.colMoves?.moveHeader(e,this.eGui,this.column,this.rowCtrl.pinned,this)}getViewportAdjustedResizeDiff(e){const t=this.getResizeDiff(e),{pinnedCols:s}=this.beans;return s?s.getHeaderResizeDiff(t,this.column):t}getResizeDiff(e){const{gos:t,column:s}=this;let i=e.key===w.LEFT!==t.get("enableRtl");const o=s.getPinned(),n=t.get("enableRtl");return o&&n!==(o==="right")&&(i=!i),(i?-1:1)*this.resizeMultiplier}onGuiKeyUp(){this.isResizing&&(this.resizeToggleTimeout&&(window.clearTimeout(this.resizeToggleTimeout),this.resizeToggleTimeout=0),this.isResizing=!1,this.resizeMultiplier=1,this.resizeToggleTimeout=window.setTimeout(()=>{this.resizeFeature?.toggleColumnResizing(!1)},150))}handleKeyDown(e){const t=this.getWrapperHasFocus();switch(e.key){case w.PAGE_DOWN:case w.PAGE_UP:case w.PAGE_HOME:case w.PAGE_END:t&&e.preventDefault()}}addDomData(e){const t=ll,{eGui:s,gos:i}=this;lt(i,s,t,this),e.addDestroyFunc(()=>lt(i,s,t,null))}focus(e){const{eGui:t}=this;return t?(this.lastFocusEvent=e||null,t.focus(),!0):!1}focusThis(){this.beans.focusSvc.focusedHeader={headerRowIndex:this.rowCtrl.rowIndex,column:this.column}}removeDragSource(){this.dragSource&&(this.beans.dragAndDrop?.removeDragSource(this.dragSource),this.dragSource=null)}handleContextMenuMouseEvent(e,t,s){const i=e??t,{menuSvc:o,gos:n}=this.beans;n.get("preventDefaultOnContextMenu")&&i.preventDefault(),o?.isHeaderContextMenuEnabled(s)&&o.showHeaderContextMenu(s,e,t),this.dispatchColumnMouseEvent("columnHeaderContextMenu",s)}dispatchColumnMouseEvent(e,t){this.eventSvc.dispatchEvent({type:e,column:t})}setColHeaderHeight(e,t){if(!e.setAutoHeaderHeight(t))return;const{eventSvc:s}=this;e.isColumn?s.dispatchEvent({type:"columnHeaderHeightChanged",column:e,columns:[e],source:"autosizeColumnHeaderHeight"}):s.dispatchEvent({type:"columnGroupHeaderHeightChanged",columnGroup:e,source:"autosizeColumnGroupHeaderHeight"})}clearComponent(){this.removeDragSource(),this.resizeFeature=null,this.comp=null,this.eGui=null}destroy(){super.destroy(),this.column=null,this.lastFocusEvent=null,this.rowCtrl=null}},Kp=class extends Qo{constructor(){super(...arguments),this.refreshFunctions={},this.userHeaderClasses=new Set,this.ariaDescriptionProperties=new Map}setComp(e,t,s,i,o){this.comp=e;const{rowCtrl:n,column:r,beans:a}=this,{colResize:l,context:d,colHover:c,rangeSvc:u}=a,h=is(this,d,o);this.setGui(t,h),this.updateState(),this.setupWidth(h),this.setupMovingCss(h),this.setupMenuClass(h),this.setupSortableClass(h),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight({wrapperElement:i,checkMeasuringCallback:p=>this.setRefreshFunction("measuring",p),compBean:h}),this.addColumnHoverListener(h),this.setupFilterClass(h),this.setupStylesFromColDef(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(h),this.setupSelectAll(h),this.setupUserComp(),this.refreshAria(),l?this.resizeFeature=h.createManagedBean(l.createResizeFeature(n.pinned,r,s,e,this)):N(s,!1),c?.createHoverFeature(h,[r],t),u?.createRangeHighlightFeature(h,r,e),h.createManagedBean(new Yo(r,t,a)),h.createManagedBean(new St(t,{shouldStopEventPropagation:p=>this.shouldStopEventPropagation(p),onTabKeyDown:()=>null,handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addResizeAndMoveKeyboardListeners(h),h.addManagedPropertyListeners(["suppressMovableColumns","suppressMenuHide","suppressAggFuncInHeader","enableAdvancedFilter"],()=>this.refresh()),h.addManagedListeners(r,{colDefChanged:()=>this.refresh()}),h.addManagedListeners(r,{headerHighlightChanged:this.onHeaderHighlightChanged.bind(this)});const g=()=>this.checkDisplayName();h.addManagedEventListeners({columnValueChanged:g,columnRowGroupChanged:g,columnPivotChanged:g,headerHeightChanged:this.onHeaderHeightChanged.bind(this)}),h.addDestroyFunc(()=>{this.refreshFunctions={},this.selectAllFeature=null,this.dragSourceElement=void 0,this.userCompDetails=null,this.userHeaderClasses.clear(),this.ariaDescriptionProperties.clear(),this.clearComponent()})}resizeHeader(e,t){this.beans.colResize?.resizeHeader(this.column,e,t)}getHeaderClassParams(){const{column:e,beans:t}=this,s=e.colDef;return k(t.gos,{colDef:s,column:e,floatingFilter:!1})}setupUserComp(){const e=this.lookupUserCompDetails();e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setUserCompDetails(e)}lookupUserCompDetails(){const e=this.createParams(),t=this.column.getColDef();return ug(this.beans.userCompFactory,t,e)}createParams(){const{menuSvc:e,sortSvc:t,colFilter:s,gos:i}=this.beans;return k(i,{column:this.column,displayName:this.displayName,enableSorting:this.column.isSortable(),enableMenu:this.menuEnabled,enableFilterButton:this.openFilterEnabled&&!!e?.isHeaderFilterButtonEnabled(this.column),enableFilterIcon:!!s&&(!this.openFilterEnabled||re(this.gos)),showColumnMenu:(n,r)=>{e?.showColumnMenu({column:this.column,buttonElement:n,positionBy:"button",onClosedCallback:r})},showColumnMenuAfterMouseClick:(n,r)=>{e?.showColumnMenu({column:this.column,mouseEvent:n,positionBy:"mouse",onClosedCallback:r})},showFilter:n=>{e?.showFilterMenu({column:this.column,buttonElement:n,containerType:"columnFilter",positionBy:"button"})},progressSort:n=>{t?.progressSort(this.column,!!n,"uiColumnSorted")},setSort:(n,r)=>{t?.setSortForColumn(this.column,n,!!r,"uiColumnSorted")},eGridHeader:this.eGui,setTooltip:(n,r)=>{i.assertModuleRegistered("Tooltip",3),this.setupTooltip(n,r)}})}setupSelectAll(e){const{selectionSvc:t}=this.beans;t&&(this.selectAllFeature=e.createManagedBean(t.createSelectAllFeature(this.column)),this.selectAllFeature.setComp(this))}getSelectAllGui(){return this.selectAllFeature?.getCheckboxGui()}handleKeyDown(e){super.handleKeyDown(e),e.key===w.SPACE&&this.selectAllFeature?.onSpaceKeyDown(e),e.key===w.ENTER&&this.onEnterKeyDown(e),e.key===w.DOWN&&e.altKey&&this.showMenuOnKeyPress(e,!1)}onEnterKeyDown(e){e.ctrlKey||e.metaKey?this.showMenuOnKeyPress(e,!0):this.sortable&&this.beans.sortSvc?.progressSort(this.column,e.shiftKey,"uiColumnSorted")}showMenuOnKeyPress(e,t){const s=this.comp.getUserCompInstance();dl(s)&&s.onMenuKeyboardShortcut(t)&&e.preventDefault()}onFocusIn(e){this.eGui.contains(e.relatedTarget)||(this.focusThis(),this.announceAriaDescription()),ba()&&this.setActiveHeader(!0)}onFocusOut(e){this.eGui.contains(e.relatedTarget)||this.setActiveHeader(!1)}setupTooltip(e,t){this.tooltipFeature=this.beans.tooltipSvc?.setupHeaderTooltip(this.tooltipFeature,this,e,t)}setupStylesFromColDef(){this.setRefreshFunction("headerStyles",this.refreshHeaderStyles.bind(this)),this.refreshHeaderStyles()}setupClassesFromColDef(){const e=()=>{const t=this.column.getColDef(),s=Mo(t,this.gos,this.column,null),i=this.userHeaderClasses;this.userHeaderClasses=new Set(s),s.forEach(o=>{i.has(o)?i.delete(o):this.comp.addOrRemoveCssClass(o,!0)}),i.forEach(o=>this.comp.addOrRemoveCssClass(o,!1))};this.setRefreshFunction("headerClasses",e),e()}setDragSource(e){this.dragSourceElement=e,this.removeDragSource(),!(!e||!this.draggable)&&(this.dragSource=this.beans.colMoves?.setDragSourceForHeader(e,this.column,this.displayName)??null)}updateState(){const{menuSvc:e}=this.beans;this.menuEnabled=!!e?.isColumnMenuInHeaderEnabled(this.column),this.openFilterEnabled=!!e?.isFilterMenuInHeaderEnabled(this.column),this.sortable=this.column.isSortable(),this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()}setRefreshFunction(e,t){this.refreshFunctions[e]=t}refresh(){this.updateState(),this.refreshHeaderComp(),this.refreshAria(),Object.values(this.refreshFunctions).forEach(e=>e())}refreshHeaderComp(){const e=this.lookupUserCompDetails();if(!e)return;(this.comp.getUserCompInstance()!=null&&this.userCompDetails.componentClass==e.componentClass?this.attemptHeaderCompRefresh(e.params):!1)?this.setDragSource(this.dragSourceElement):this.setCompDetails(e)}attemptHeaderCompRefresh(e){const t=this.comp.getUserCompInstance();return!t||!t.refresh?!1:t.refresh(e)}calculateDisplayName(){return this.beans.colNames.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}setupWidth(e){const t=()=>{const s=this.column.getActualWidth();this.comp.setWidth(`${s}px`)};e.addManagedListeners(this.column,{widthChanged:t}),t()}setupMovingCss(e){const t=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving())};e.addManagedListeners(this.column,{movingChanged:t}),t()}setupMenuClass(e){const t=()=>{this.comp?.addOrRemoveCssClass("ag-column-menu-visible",this.column.isMenuVisible())};e.addManagedListeners(this.column,{menuVisibleChanged:t}),t()}setupSortableClass(e){const t=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-sortable",!!this.sortable)};t(),this.setRefreshFunction("updateSortable",t),e.addManagedEventListeners({sortChanged:this.refreshAriaSort.bind(this)})}setupFilterClass(e){const t=()=>{const s=this.column.isFilterActive();this.comp.addOrRemoveCssClass("ag-header-cell-filtered",s),this.refreshAria()};e.addManagedListeners(this.column,{filterActiveChanged:t}),t()}setupWrapTextClass(){const e=()=>{const t=!!this.column.getColDef().wrapHeaderText;this.comp.addOrRemoveCssClass("ag-header-cell-wrap-text",t)};e(),this.setRefreshFunction("wrapText",e)}onHeaderHighlightChanged(){const e=this.column.getHighlighted(),t=e===0,s=e===1;this.comp.addOrRemoveCssClass("ag-header-highlight-before",t),this.comp.addOrRemoveCssClass("ag-header-highlight-after",s)}onDisplayedColumnsChanged(){super.onDisplayedColumnsChanged(),this.isAlive()&&this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){const{eGui:e,column:t,comp:s,beans:i}=this,o=$o(this.beans),n=o.reduce((c,u)=>c+=u,0)===0;if(s.addOrRemoveCssClass("ag-header-parent-hidden",n),!t.isSpanHeaderHeight()){e.style.removeProperty("top"),e.style.removeProperty("height"),s.addOrRemoveCssClass("ag-header-span-height",!1),s.addOrRemoveCssClass("ag-header-span-total",!1);return}const{numberOfParents:r,isSpanningTotal:a}=this.column.getColumnGroupPaddingInfo();s.addOrRemoveCssClass("ag-header-span-height",r>0);const l=Ko(i);if(r===0){s.addOrRemoveCssClass("ag-header-span-total",!1),e.style.setProperty("top","0px"),e.style.setProperty("height",`${l}px`);return}s.addOrRemoveCssClass("ag-header-span-total",a);let d=0;for(let c=0;ct==="filter"?-1:s.charCodeAt(0)-t.charCodeAt(0)).map(t=>this.ariaDescriptionProperties.get(t)).join(". ");this.beans.ariaAnnounce?.announceValue(e,"columnHeader")}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaFilterButton(),this.refreshAriaFiltered()}addColumnHoverListener(e){this.beans.colHover?.addHeaderColumnHoverListener(e,this.comp,this.column)}addActiveHeaderMouseListeners(e){const t=o=>this.handleMouseOverChange(o.type==="mouseenter"),s=()=>{this.setActiveHeader(!0),this.dispatchColumnMouseEvent("columnHeaderClicked",this.column)},i=o=>this.handleContextMenuMouseEvent(o,void 0,this.column);e.addManagedListeners(this.eGui,{mouseenter:t,mouseleave:t,click:s,contextmenu:i})}handleMouseOverChange(e){this.setActiveHeader(e),this.eventSvc.dispatchEvent({type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column})}setActiveHeader(e){this.comp.addOrRemoveCssClass("ag-header-active",e)}getAnchorElementForMenu(e){const t=this.comp.getUserCompInstance();return dl(t)?t.getAnchorElementForMenu(e):this.eGui}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),super.destroy()}};function dl(e){return typeof e.getAnchorElementForMenu=="function"&&typeof e.onMenuKeyboardShortcut=="function"}var jp=0,Zo=class extends b{constructor(e,t,s){super(),this.rowIndex=e,this.pinned=t,this.type=s,this.instanceId=jp++;const i=s=="group"?"ag-header-row-column-group":s=="filter"?"ag-header-row-column-filter":"ag-header-row-column";this.headerRowClass=`ag-header-row ${i}`}postConstruct(){this.isPrintLayout=Q(this.gos,"print"),this.isEnsureDomOrder=this.gos.get("ensureDomOrder")}areCellsRendered(){return this.comp?this.getHeaderCellCtrls().every(e=>e.eGui!=null):!1}setComp(e,t,s=!0){this.comp=e,t=is(this,this.beans.context,t),s&&(this.onRowHeightChanged(),this.onVirtualColumnsChanged()),this.setWidth(),this.addEventListeners(t)}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(e){const t=this.onRowHeightChanged.bind(this),s=this.onDisplayedColumnsChanged.bind(this);e.addManagedEventListeners({columnResized:this.setWidth.bind(this),displayedColumnsChanged:s,virtualColumnsChanged:i=>this.onVirtualColumnsChanged(i.afterScroll),columnGroupHeaderHeightChanged:t,columnHeaderHeightChanged:t,gridStylesChanged:t,advancedFilterEnabledChanged:t}),e.addManagedPropertyListener("domLayout",s),e.addManagedPropertyListener("ensureDomOrder",i=>this.isEnsureDomOrder=i.currentValue),e.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],t)}getHeaderCellCtrl(e){if(this.headerCellCtrls){for(const t of this.headerCellCtrls.values())if(t.column===e)return t}}onDisplayedColumnsChanged(){this.isPrintLayout=Q(this.gos,"print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}setWidth(){const e=this.getWidthForRow();this.comp.setWidth(`${e}px`)}getWidthForRow(){const{visibleCols:e}=this.beans;return this.isPrintLayout?this.pinned!=null?0:e.getContainerWidth("right")+e.getContainerWidth("left")+e.getContainerWidth(null):e.getContainerWidth(this.pinned)}onRowHeightChanged(){const{topOffset:e,rowHeight:t}=this.getTopAndHeight();this.comp.setTop(e+"px"),this.comp.setHeight(t+"px")}getTopAndHeight(){const{filterManager:e}=this.beans,t=[],s=$o(this.beans),i=Ko(this.beans);t.push(...s),t.push(i),e?.hasFloatingFilters()&&t.push(jo(this.beans));let o=0;for(let r=0;r{const{focusSvc:o,visibleCols:n}=this.beans;return o.isHeaderWrapperFocused(i)?n.isVisible(i.column):!1};if(e)for(const[i,o]of e)s(o)?this.headerCellCtrls.set(i,o):this.destroyBean(o);return this.getHeaderCellCtrls()}getHeaderCellCtrls(){return Array.from(this.headerCellCtrls?.values()??[])}recycleAndCreateHeaderCtrls(e,t){if(!this.headerCellCtrls||e.isEmptyGroup())return;const s=e.getUniqueId();let i;if(t&&(i=t.get(s),t.delete(s)),i&&i.column!=e&&(this.destroyBean(i),i=void 0),i==null)switch(this.type){case"filter":{i=this.createBean(this.beans.registry.createDynamicBean("headerFilterCellCtrl",!0,e,this));break}case"group":i=this.createBean(this.beans.registry.createDynamicBean("headerGroupCellCtrl",!0,e,this));break;default:i=this.createBean(new Kp(e,this));break}this.headerCellCtrls.set(s,i)}getColumnsInViewport(){return this.isPrintLayout?this.getColumnsInViewportPrintLayout():this.getColumnsInViewportNormalLayout()}getColumnsInViewportPrintLayout(){if(this.pinned!=null)return[];let e=[];const t=this.getActualDepth(),{colViewport:s}=this.beans;return["left",null,"right"].forEach(i=>{const o=s.getHeadersToRender(i,t);e=e.concat(o)}),e}getActualDepth(){return this.type=="filter"?this.rowIndex-1:this.rowIndex}getColumnsInViewportNormalLayout(){return this.beans.colViewport.getHeadersToRender(this.pinned,this.getActualDepth())}findHeaderCellCtrl(e){if(!this.headerCellCtrls)return;const t=this.getHeaderCellCtrls();let s;return typeof e=="function"?s=t.find(e):s=t.find(i=>i.column==e),s}focusHeader(e,t){const s=this.findHeaderCellCtrl(e);return s?s.focus(t):!1}destroy(){this.headerCellCtrls?.forEach(e=>{this.destroyBean(e)}),this.headerCellCtrls=void 0,super.destroy()}},cl=class extends b{constructor(e){super(),this.pinned=e,this.hidden=!1,this.includeFloatingFilter=!1,this.groupsRowCtrls=[]}setComp(e,t){this.comp=e,this.eViewport=t;const{pinnedCols:s,ctrlsSvc:i,colModel:o,colMoves:n,filterManager:r}=this.beans;this.setupCenterWidth(),s?.setupHeaderPinnedWidth(this),this.setupDragAndDrop(n,this.eViewport);const a=this.onDisplayedColumnsChanged.bind(this,r);this.addManagedEventListeners({gridColumnsChanged:this.onGridColumnsChanged.bind(this),displayedColumnsChanged:a,advancedFilterEnabledChanged:a});const l=`${typeof this.pinned=="string"?this.pinned:"center"}Header`;i.register(l,this),o.ready&&this.refresh()}getAllCtrls(){const e=[...this.groupsRowCtrls];return this.columnsRowCtrl&&e.push(this.columnsRowCtrl),this.filtersRowCtrl&&e.push(this.filtersRowCtrl),e}refresh(e=!1){const{focusSvc:t,colModel:s,filterManager:i}=this.beans;let o=0;const n=t.getFocusHeaderToUseAfterRefresh(),r=()=>{const c=nl(s)-1;this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls);for(let u=0;u{const c=o++,u=!this.hidden&&(this.columnsRowCtrl==null||!e||this.columnsRowCtrl.rowIndex!==c);(u||this.hidden)&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),u&&(this.columnsRowCtrl=this.createBean(new Zo(c,this.pinned,"column")))},l=()=>{this.includeFloatingFilter=!!i?.hasFloatingFilters()&&!this.hidden;const c=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter){c();return}const u=o++;if(this.filtersRowCtrl){const h=this.filtersRowCtrl.rowIndex!==u;(!e||h)&&c()}this.filtersRowCtrl||(this.filtersRowCtrl=this.createBean(new Zo(u,this.pinned,"filter")))};r(),a(),l();const d=this.getAllCtrls();this.comp.setCtrls(d),this.restoreFocusOnHeader(t,n)}getHeaderCtrlForColumn(e){if(Ge(e))return this.columnsRowCtrl?.getHeaderCellCtrl(e);if(this.groupsRowCtrls.length!==0)for(let t=0;tthis.comp.setCenterWidth(`${e}px`),!0))}},qp=class extends b{constructor(){super(...arguments),this.beanName="menuSvc"}postConstruct(){const{enterpriseMenuFactory:e,filterMenuFactory:t}=this.beans;this.activeMenuFactory=e??t}showColumnMenu(e){this.showColumnMenuCommon(this.activeMenuFactory,e,"columnMenu")}showFilterMenu(e){const{enterpriseMenuFactory:t,filterMenuFactory:s}=this.beans,i=t&&re(this.gos)?t:s;this.showColumnMenuCommon(i,e,e.containerType,!0)}showHeaderContextMenu(e,t,s){this.activeMenuFactory?.showMenuAfterContextMenuEvent(e,t,s)}hidePopupMenu(){this.beans.contextMenuSvc?.hideActiveMenu(),this.activeMenuFactory?.hideActiveMenu()}isColumnMenuInHeaderEnabled(e){const{suppressHeaderMenuButton:t}=e.getColDef();return!t&&!!this.activeMenuFactory?.isMenuEnabled(e)&&(re(this.gos)||!!this.beans.enterpriseMenuFactory)}isFilterMenuInHeaderEnabled(e){return!e.getColDef().suppressHeaderFilterButton&&!!this.beans.filterManager?.isFilterAllowed(e)}isHeaderContextMenuEnabled(e){return!(e&&Ge(e)?e.getColDef():e?.getColGroupDef())?.suppressHeaderContextMenu&&this.gos.get("columnMenu")==="new"}isHeaderMenuButtonAlwaysShowEnabled(){return this.isSuppressMenuHide()}isHeaderMenuButtonEnabled(){const e=!this.isSuppressMenuHide();return!(_e()&&e)}isHeaderFilterButtonEnabled(e){return this.isFilterMenuInHeaderEnabled(e)&&!re(this.gos)&&!this.isFloatingFilterButtonDisplayed(e)}isFilterMenuItemEnabled(e){return!!this.beans.filterManager?.isFilterAllowed(e)&&!re(this.gos)&&!this.isFilterMenuInHeaderEnabled(e)&&!this.isFloatingFilterButtonDisplayed(e)}isFloatingFilterButtonEnabled(e){return!e.getColDef().suppressFloatingFilterButton}isFloatingFilterButtonDisplayed(e){return!!e.getColDef().floatingFilter&&this.isFloatingFilterButtonEnabled(e)}isSuppressMenuHide(){const e=this.gos,t=e.get("suppressMenuHide");return re(e)?e.exists("suppressMenuHide")?t:!1:t}showColumnMenuCommon(e,t,s,i){const{positionBy:o,onClosedCallback:n}=t,r=t.column;if(o==="button"){const{buttonElement:a}=t;e?.showMenuAfterButtonClick(r,a,s,n,i)}else if(o==="mouse"){const{mouseEvent:a}=t;e?.showMenuAfterMouseEvent(r,a,s,n,i)}else if(r){const a=this.beans,l=a.ctrlsSvc;l.getScrollFeature().ensureColumnVisible(r,"auto"),Pe(a,()=>{const d=l.getHeaderRowContainerCtrl(r.getPinned())?.getHeaderCtrlForColumn(r);d&&e?.showMenuAfterButtonClick(r,d.getAnchorElementForMenu(i),s,n,!0)})}}};function Xo(e,t,s){e.menuVisible!==t&&(e.menuVisible=t,e.dispatchColEvent("menuVisibleChanged",s))}var ul=class extends L{constructor(){super()}},Yp=class extends ul{init(){const e=Re(this.gos.get("overlayLoadingTemplate")?.trim());if(this.setTemplate(e??''),!e){const t=this.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=t("loadingOoo","Loading...")})}}},Qp=class extends ul{init(){const e=Re(this.gos.get("overlayNoRowsTemplate")?.trim());if(this.setTemplate(e??''),!e){const t=this.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=t("noRowsToShow","No Rows To Show")})}}};function hl(e,t,s){const i=ge(e,t,s);if(i){const{className:n}=i;if(typeof n=="string"&&n.indexOf("ag-icon")>-1||typeof n=="object"&&n["ag-icon"])return i}const o=document.createElement("span");return o.appendChild(i),o}function ge(e,t,s){let i=null;e==="smallDown"?R(262):e==="smallLeft"?R(263):e==="smallRight"&&R(264);const o=s&&s.getColDef().icons;if(o&&(i=o[e]),t.gos&&!i){const n=t.gos.get("icons");n&&(i=n[e])}if(i){let n;if(typeof i=="function")n=i();else if(typeof i=="string")n=i;else{R(38,{iconName:e});return}if(typeof n=="string")return At(n);if($s(n))return n;R(133,{iconName:e});return}else{const n=document.createElement("span"),r=t.registry.getIcon(e);r||t.validation?.validateIcon(e);const a=r??e;return n.setAttribute("class",`ag-icon ag-icon-${a}`),n.setAttribute("unselectable","on"),X(n,"presentation"),n}}var Zp=".ag-dnd-ghost{align-items:center;background-color:var(--ag-drag-and-drop-image-background-color);border:var(--ag-drag-and-drop-image-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-drag-and-drop-image-shadow);color:var(--ag-text-color);cursor:move;display:flex;font-weight:500;gap:var(--ag-cell-widget-spacing);height:var(--ag-header-height);overflow:hidden;padding-left:var(--ag-cell-horizontal-padding);padding-right:var(--ag-cell-horizontal-padding);text-overflow:ellipsis;transform:translateY(calc(var(--ag-spacing)*2));white-space:nowrap}",Xp=class extends L{constructor(){super(),this.dragSource=null,this.eIcon=E,this.eLabel=E,this.registerCSS(Zp)}postConstruct(){const e=t=>hl(t,this.beans,null);this.dropIconMap={pinned:e("columnMovePin"),hide:e("columnMoveHide"),move:e("columnMoveMove"),left:e("columnMoveLeft"),right:e("columnMoveRight"),group:e("columnMoveGroup"),aggregate:e("columnMoveValue"),pivot:e("columnMovePivot"),notAllowed:e("dropNotAllowed")}}init(e){this.dragSource=e.dragSource,this.setTemplate(`
`)}destroy(){this.dragSource=null,super.destroy()}setIcon(e,t){const{eIcon:s,dragSource:i,dropIconMap:o,gos:n}=this;Z(s);let r=null;e||(e=i?.getDefaultIconName?i.getDefaultIconName():"notAllowed"),r=o[e],s.classList.toggle("ag-shake-left-to-right",t),!(r===o.hide&&n.get("suppressDragLeaveHidesColumns"))&&r&&s.appendChild(r)}setLabel(e){this.eLabel.textContent=e}},Jp=".ag-label{white-space:nowrap}:where(.ag-ltr) .ag-label{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-label-align-right) .ag-label{order:1}:where(.ag-ltr) :where(.ag-label-align-right) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-rtl) :where(.ag-label-align-right) .ag-label{margin-right:var(--ag-spacing)}.ag-label-align-right>*{flex:none}.ag-label-align-top{align-items:flex-start;flex-direction:column;>*{align-self:stretch}}.ag-label-ellipsis{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(.ag-label-align-top) .ag-label{margin-bottom:calc(var(--ag-spacing)*.5)}",gl=class extends L{constructor(e,t,s){super(t,s),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{},this.registerCSS(Jp)}postConstruct(){this.addCssClass("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:s,labelAlignment:i,disabled:o}=this.config;o!=null&&this.setDisabled(o),e!=null&&this.setLabelSeparator(e),t!=null&&this.setLabel(t),s!=null&&this.setLabelWidth(s),this.setLabelAlignment(i||this.labelAlignment),this.refreshLabel()}refreshLabel(){const{label:e,eLabel:t}=this;Z(t),typeof e=="string"?t.innerText=e+this.labelSeparator:e&&t.appendChild(e),e===""?(N(t,!1),X(t,"presentation")):(N(t,!0),X(t,null))}setLabelSeparator(e){return this.labelSeparator===e?this:(this.labelSeparator=e,this.label!=null&&this.refreshLabel(),this)}getLabelId(){const e=this.eLabel;return e.id=e.id||`ag-${this.getCompId()}-label`,e.id}getLabel(){return this.label}setLabel(e){return this.label===e?this:(this.label=e,this.refreshLabel(),this)}setLabelAlignment(e){const s=this.getGui().classList;return s.toggle("ag-label-align-left",e==="left"),s.toggle("ag-label-align-right",e==="right"),s.toggle("ag-label-align-top",e==="top"),this}setLabelEllipsis(e){return this.eLabel.classList.toggle("ag-label-ellipsis",e),this}setLabelWidth(e){return this.label==null?this:(Us(this.eLabel,e),this)}setDisabled(e){e=!!e;const t=this.getGui();return Pt(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}},pl=class extends gl{constructor(e,t,s,i){super(e,t,s),this.className=i}postConstruct(){super.postConstruct();const{width:e,value:t,onValueChange:s}=this.config;e!=null&&this.setWidth(e),t!=null&&this.setValue(t),s!=null&&this.onValueChange(s),this.className&&this.addCssClass(this.className),this.refreshAriaLabelledBy()}setLabel(e){return super.setLabel(e),this.refreshAriaLabelledBy(),this}refreshAriaLabelledBy(){const e=this.getAriaElement(),t=this.getLabelId(),s=this.getLabel();s==null||s==""||Su(e)!==null?Os(e,""):Os(e,t??"")}setAriaLabel(e){return Kt(this.getAriaElement(),e),this.refreshAriaLabelledBy(),this}onValueChange(e){return this.addManagedListeners(this,{fieldValueChanged:()=>e(this.getValue())}),this}getWidth(){return this.getGui().clientWidth}setWidth(e){return we(this.getGui(),e),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(e,t){return this.value===e?this:(this.previousValue=this.value,this.value=e,t||this.dispatchLocalEvent({type:"fieldValueChanged"}),this)}},Xe=class extends pl{constructor(e,t,s="text",i="input"){super(e,e?.template??`
`,[],t),this.inputType=s,this.displayFieldTag=i,this.eLabel=E,this.eWrapper=E,this.eInput=E}postConstruct(){super.postConstruct(),this.setInputType();const{eLabel:e,eWrapper:t,eInput:s,className:i}=this;e.classList.add(`${i}-label`),t.classList.add(`${i}-input-wrapper`),s.classList.add(`${i}-input`),this.addCssClass("ag-input-field"),s.id=s.id||`ag-${this.getCompId()}-input`;const{inputName:o,inputWidth:n}=this.config;o!=null&&this.setInputName(o),n!=null&&this.setInputWidth(n),this.addInputListeners(),this.activateTabIndex([s])}addInputListeners(){this.addManagedElementListeners(this.eInput,{input:e=>this.setValue(e.target.value)})}setInputType(){this.displayFieldTag==="input"&&this.eInput.setAttribute("type",this.inputType)}getInputElement(){return this.eInput}setInputWidth(e){return Us(this.eWrapper,e),this}setInputName(e){return this.getInputElement().setAttribute("name",e),this}getFocusableElement(){return this.eInput}setMaxLength(e){const t=this.eInput;return t.maxLength=e,this}setInputPlaceholder(e){return Ce(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return Kt(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return Pt(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){if(e===!0)Ce(this.eInput,"autocomplete",null);else{const t=typeof e=="string"?e:"off";Ce(this.eInput,"autocomplete",t)}return this}},cs=class extends Xe{constructor(e,t="ag-checkbox",s="checkbox"){super(e,t,s),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();const{readOnly:e,passive:t}=this.config;typeof e=="boolean"&&this.setReadOnly(e),typeof t=="boolean"&&this.setPassive(t)}addInputListeners(){this.addManagedElementListeners(this.eInput,{click:this.onCheckboxClick.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.toggle.bind(this)})}getNextValue(){return this.selected===void 0?!0:!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){const t=this.getInputElement();return t.name=e,this}isSelected(){return this.selected}setSelected(e,t){if(this.isSelected()===e)return;this.previousValue=this.isSelected(),e=this.selected=typeof e=="boolean"?e:void 0;const s=this.eInput;s.checked=e,s.indeterminate=e===void 0,t||this.dispatchChange(this.selected,this.previousValue)}dispatchChange(e,t,s){this.dispatchLocalEvent({type:"fieldValueChanged",selected:e,previousValue:t,event:s});const i=this.getInputElement();this.eventSvc.dispatchEvent({type:"checkboxChanged",id:i.id,name:i.name,selected:e,previousValue:t})}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;const t=this.isSelected(),s=this.selected=e.target.checked;this.refreshSelectedClass(s),this.dispatchChange(s,t,e)}refreshSelectedClass(e){const t=this.eWrapper.classList;t.toggle("ag-checked",e===!0),t.toggle("ag-indeterminate",e==null)}},Si={selector:"AG-CHECKBOX",component:cs},ef=".ag-checkbox-cell{height:100%}",tf=class extends L{constructor(){super(` `,[Si]),this.eCheckbox=E,this.registerCSS(ef)}init(e){this.refresh(e);const{eCheckbox:t,beans:s}=this,i=t.getInputElement();i.setAttribute("tabindex","-1"),Kn(i,"polite"),this.addManagedListeners(i,{click:o=>{if(gt(o),t.isDisabled())return;const n=t.getValue();this.onCheckboxChanged(n)},dblclick:o=>{gt(o)}}),this.addManagedElementListeners(e.eGridCell,{keydown:o=>{if(o.key===w.SPACE&&!t.isDisabled()){e.eGridCell===z(s)&&t.toggle();const n=t.getValue();this.onCheckboxChanged(n),o.preventDefault()}}})}refresh(e){return this.params=e,this.updateCheckbox(e),!0}updateCheckbox(e){let t,s=!0;const{value:i,column:o,node:n}=e;if(n.group&&o)if(typeof i=="boolean")t=i;else{const u=o.getColId();u.startsWith(ts)?t=i==null||i===""?void 0:i==="true":n.aggData&&n.aggData[u]!==void 0?t=i??void 0:s=!1}else t=i??void 0;const{eCheckbox:r}=this;if(!s){r.setDisplayed(!1);return}r.setValue(t);const a=e.disabled??!o?.isCellEditable(n);r.setDisabled(a);const l=this.getLocaleTextFunc(),d=Ki(l,t),c=a?d:`${l("ariaToggleCellValue","Press SPACE to toggle cell value")} (${d})`;r.setInputAriaLabel(c)}onCheckboxChanged(e){const{eventSvc:t,params:s}=this,{column:i,node:o,value:n}=s,r={column:i,colDef:i.getColDef(),data:o.data,node:o,rowIndex:o.rowIndex,rowPinned:o.rowPinned,value:n};t.dispatchEvent({type:"cellEditingStarted",...r});const a=o.setDataValue(i,e,"edit");t.dispatchEvent({type:"cellEditingStopped",...r,oldValue:n,newValue:e,valueChanged:a}),a||this.updateCheckbox(s)}},sf="ROOT_NODE_ID",fl=class extends b{constructor(){super(...arguments),this.nextId=0,this.allNodesMap={},this.rootNode=null}get treeData(){return!1}getRowNode(e){return this.allNodesMap[e]}extractRowData(){return this.rootNode?.allLeafChildren?.map(e=>e.data)}activate(e){this.rootNode=e,e.group=!0,e.level=-1,e.id=sf,e.allLeafChildren=[],e.childrenAfterGroup=[],e.childrenAfterSort=[],e.childrenAfterAggFilter=[],e.childrenAfterFilter=[],this.updateRootSiblingArrays(e)}deactivate(){this.rootNode&&(this.allNodesMap={},this.rootNode=null)}destroy(){super.destroy(),this.allNodesMap={},this.rootNode=null}setNewRowData(e){const t=this.rootNode;t&&(this.dispatchRowDataUpdateStartedEvent(e),t.childrenAfterFilter=null,t.childrenAfterGroup=null,t.childrenAfterAggFilter=null,t.childrenAfterSort=null,t.childrenMapped=null,t.updateHasChildren(),this.allNodesMap={},this.nextId=0,this.loadNewRowData(e),this.updateRootSiblingArrays(t))}updateRootSiblingArrays(e){const t=e.sibling;t&&(t.childrenAfterFilter=e.childrenAfterFilter,t.childrenAfterGroup=e.childrenAfterGroup,t.childrenAfterAggFilter=e.childrenAfterAggFilter,t.childrenAfterSort=e.childrenAfterSort,t.childrenMapped=e.childrenMapped,t.allLeafChildren=e.allLeafChildren)}loadNewRowData(e){this.rootNode.allLeafChildren=e?.map((t,s)=>this.createRowNode(t,s))??[]}setImmutableRowData(e,t){const s=ut(this.gos),i=!this.gos.get("suppressMaintainUnsortedOrder"),o=e.changedRowNodes,n=new Set,r=this.rootNode,a=r.allLeafChildren,l=a.length;let d=!1,c=!1,u=!1,h=!1;for(let p=0,f=-1,m=t.length;p0&&this.gos.get("treeData")&&this.gos.get("getDataPath"))){for(let u=0;u{const c=this.lookupRowNode(e,d);c&&(c.isSelected()&&o.push(c),c.clearRowTopAndRowIndex(),r[c.id]=!0,delete this.allNodesMap[c.id],i.remove.push(c),s.remove(c))});const a=this.rootNode;a.allLeafChildren=a.allLeafChildren?.filter(d=>!r[d.id])??null,a.allLeafChildren?.forEach((d,c)=>{d.sourceRowIndex=c});const l=a.sibling;l&&(l.allLeafChildren=a.allLeafChildren)}executeUpdate(e,t,{changedRowNodes:s,rowNodeTransaction:i},o){const{update:n}=t;n?.length&&n.forEach(r=>{const a=this.lookupRowNode(e,r);a&&(a.updateData(r),!a.selectable&&a.isSelected()&&o.push(a),i.update.push(a),s.update(a))})}dispatchRowDataUpdateStartedEvent(e){this.eventSvc.dispatchEvent({type:"rowDataUpdateStarted",firstRowData:e?.length?e[0]:null})}deselectNodes(e){const t="rowDataChanged",s=this.beans.selectionSvc,i=e.length>0;i&&s?.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t}),s?.updateGroupsFromChildrenSelections?.(t),i&&this.eventSvc.dispatchEvent({type:"selectionChanged",source:t})}sanitizeAddIndex(e){const t=this.rootNode.allLeafChildren?.length??0;return e<0||e>=t||Number.isNaN(e)?t:Math.ceil(e)}createRowNode(e,t){const s=new bt(this.beans);return s.parent=this.rootNode,s.level=0,s.group=!1,s.expanded=!1,s.sourceRowIndex=t,s.setDataAndId(e,String(this.nextId)),this.allNodesMap[s.id]&&R(2,{nodeId:s.id}),this.allNodesMap[s.id]=s,this.nextId++,s}lookupRowNode(e,t){let s;if(e){const i=e({data:t,level:0});if(s=this.allNodesMap[i],!s)return O(4,{id:i}),null}else if(s=this.rootNode?.allLeafChildren?.find(i=>i.data===t),!s)return O(5,{data:t}),null;return s||null}},ml=(e=>(e.Applied="Applied",e.StoreNotFound="StoreNotFound",e.StoreLoading="StoreLoading",e.StoreWaitingToLoad="StoreWaitingToLoad",e.StoreLoadingFailed="StoreLoadingFailed",e.StoreWrongType="StoreWrongType",e.Cancelled="Cancelled",e.StoreNotStarted="StoreNotStarted",e))(ml||{}),of=class extends L{constructor(){super(` `,[Si]),this.eCheckbox=E}postConstruct(){this.eCheckbox.setPassive(!0)}getCheckboxId(){return this.eCheckbox.getInputElement().id}onDataChanged(){this.onSelectionChanged()}onSelectableChanged(){this.showOrHideSelect()}onSelectionChanged(){const e=this.getLocaleTextFunc(),{rowNode:t,eCheckbox:s}=this,i=t.isSelected(),o=Ki(e,i),[n,r]=t.selectable?["ariaRowToggleSelection","Press Space to toggle row selection"]:["ariaRowSelectionDisabled","Row Selection is disabled for this row"],a=e(n,r);s.setValue(i,!0),s.setInputAriaLabel(`${a} (${o})`)}init(e){if(this.rowNode=e.rowNode,this.column=e.column,this.overrides=e.overrides,this.onSelectionChanged(),this.addManagedListeners(this.eCheckbox.getInputElement(),{dblclick:gt,click:i=>{gt(i),this.beans.selectionSvc?.handleSelectionEvent(i,this.rowNode,"checkboxSelected")}}),this.addManagedListeners(this.rowNode,{rowSelected:this.onSelectionChanged.bind(this),dataChanged:this.onDataChanged.bind(this),selectableChanged:this.onSelectableChanged.bind(this)}),this.addManagedPropertyListener("rowSelection",({currentValue:i,previousValue:o})=>{const n=typeof i=="object"?Co(i):void 0,r=typeof o=="object"?Co(o):void 0;n!==r&&this.onSelectableChanged()}),Js(this.gos)||typeof this.getIsVisible()=="function"){const i=this.showOrHideSelect.bind(this);this.addManagedEventListeners({displayedColumnsChanged:i}),this.addManagedListeners(this.rowNode,{dataChanged:i,cellChanged:i}),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")}showOrHideSelect(){const{column:e,rowNode:t,overrides:s,gos:i}=this;let o=t.selectable;const n=this.getIsVisible();if(o)if(typeof n=="function"){const l=s?.callbackParams;if(!e)o=n({...l,node:t,data:t.data});else{const d=e.createColumnFunctionCallbackParams(t);o=n({...l,...d})}}else o=n??!1;const r=i.get("rowSelection");if(r&&typeof r!="string"?!Co(r):e?.getColDef().showDisabledCheckboxes){this.eCheckbox.setDisabled(!o),this.setVisible(!0),this.setDisplayed(!0);return}if(s?.removeHidden){this.setDisplayed(o);return}this.setVisible(o)}getIsVisible(){const e=this.overrides;if(e)return e.isVisible;const t=this.gos.get("rowSelection");return t&&typeof t!="string"?ht(t):this.column?.getColDef()?.checkboxSelection}},nf=class{constructor(e){this.rowModel=e,this.selectAll=!1,this.rootId=null,this.endId=null,this.cachedRange=[]}reset(){this.rootId=null,this.endId=null,this.cachedRange.length=0}setRoot(e){this.rootId=e.id,this.endId=null,this.cachedRange.length=0}setEndRange(e){this.endId=e.id,this.cachedRange.length=0}getRange(){if(this.cachedRange.length===0){const e=this.getRoot(),t=this.getEnd();if(e==null||t==null)return this.cachedRange;this.cachedRange=this.rowModel.getNodesInRangeForSelection(e,t)??[]}return this.cachedRange}isInRange(e){return this.rootId===null?!1:this.getRange().some(t=>t.id===e.id)}getRoot(e){return this.rootId?this.rowModel.getRowNode(this.rootId)??null:e?(this.setRoot(e),e):null}getEnd(){return this.endId?this.rowModel.getRowNode(this.endId)??null:null}truncate(e){const t=this.getRange();if(t.length===0)return{keep:[],discard:[]};const s=t[0].id===this.rootId,i=t.findIndex(o=>o.id===e.id);if(i>-1){const o=t.slice(0,i),n=t.slice(i+1);return this.setEndRange(e),s?{keep:o,discard:n}:{keep:n,discard:o}}else return{keep:t,discard:[]}}extend(e,t=!1){const s=this.getRoot();if(s==null){const o=this.getRange().slice();return t&&e.depthFirstSearch(n=>!n.group&&o.push(n)),o.push(e),this.setRoot(e),{keep:o,discard:[]}}const i=this.rowModel.getNodesInRangeForSelection(s,e);if(!i)return this.setRoot(e),{keep:[e],discard:[]};if(i.find(o=>o.id===this.endId))return this.setEndRange(e),{keep:this.getRange(),discard:[]};{const o=this.getRange().slice();return this.setEndRange(e),{keep:this.getRange(),discard:o}}}},rf=class extends b{constructor(e){super(),this.column=e,this.cbSelectAllVisible=!1,this.processingEventFromCheckbox=!1}onSpaceKeyDown(e){const t=this.cbSelectAll;t.isDisplayed()&&!t.getGui().contains(z(this.beans))&&(e.preventDefault(),t.setValue(!t.getValue()))}getCheckboxGui(){return this.cbSelectAll.getGui()}setComp(e){this.headerCellCtrl=e;const t=this.createManagedBean(new cs);this.cbSelectAll=t,t.addCssClass("ag-header-select-all"),X(t.getGui(),"presentation"),this.showOrHideSelectAll(),this.addManagedEventListeners({newColumnsLoaded:()=>this.showOrHideSelectAll(),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),selectionChanged:this.onSelectionChanged.bind(this),paginationChanged:this.onSelectionChanged.bind(this),modelUpdated:this.onModelChanged.bind(this)}),this.addManagedPropertyListener("rowSelection",({currentValue:s,previousValue:i})=>{const o=n=>typeof n=="string"||!n||n.mode==="singleRow"?void 0:n.selectAll;o(s)!==o(i)&&this.showOrHideSelectAll()}),this.addManagedListeners(t,{fieldValueChanged:this.onCbSelectAll.bind(this)}),t.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()}onDisplayedColumnsChanged(e){this.isAlive()&&this.showOrHideSelectAll(e.source==="uiColumnMoved")}showOrHideSelectAll(e=!1){const t=this.isCheckboxSelection();this.cbSelectAllVisible=t,this.cbSelectAll.setDisplayed(t),t&&(this.checkRightRowModelType("selectAllCheckbox"),this.checkSelectionType("selectAllCheckbox"),this.updateStateOfCheckbox()),this.refreshSelectAllLabel(e)}onModelChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}onSelectionChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}updateStateOfCheckbox(){if(this.processingEventFromCheckbox)return;this.processingEventFromCheckbox=!0;const e=this.getSelectAllMode(),t=this.beans.selectionSvc,s=this.cbSelectAll,i=t.getSelectAllState(e);s.setValue(i);const o=t.hasNodesToSelect(e);s.setDisabled(!o),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}refreshSelectAllLabel(e=!1){const t=this.getLocaleTextFunc(),{headerCellCtrl:s,cbSelectAll:i,cbSelectAllVisible:o}=this,r=i.getValue()?t("ariaChecked","checked"):t("ariaUnchecked","unchecked"),a=t("ariaRowSelectAll","Press Space to toggle all rows selection");s.setAriaDescriptionProperty("selectAll",o?`${a} (${r})`:null),i.setInputAriaLabel(t("ariaHeaderSelection","Column with Header Selection")),e||s.announceAriaDescription()}checkSelectionType(e){return It(this.gos)?!0:(R(128,{feature:e}),!1)}checkRightRowModelType(e){const{gos:t,rowModel:s}=this.beans;return J(t)||rt(t)?!0:(R(129,{feature:e,rowModel:s.getType()}),!1)}onCbSelectAll(){if(this.processingEventFromCheckbox||!this.cbSelectAllVisible)return;const e=this.cbSelectAll.getValue(),t=this.getSelectAllMode();let s="uiSelectAll";t==="currentPage"?s="uiSelectAllCurrentPage":t==="filtered"&&(s="uiSelectAllFiltered");const i={source:s,selectAll:t},o=this.beans.selectionSvc;e?o.selectAllRowNodes(i):o.deselectAllRowNodes(i)}isCheckboxSelection(){const{column:e,gos:t,beans:s}=this,i=t.get("rowSelection"),o=e.getColDef(),{headerCheckboxSelection:n}=o;let r=!1;const a=typeof i=="object";if(a){const d=De(e),c=ti(e);(Xs(i)==="autoGroupColumn"&&c||d&&s.selectionColSvc?.isSelectionColumnEnabled())&&(r=Qt(i))}else typeof n=="function"?r=n(k(t,{column:e,colDef:o})):r=!!n;const l=a?"headerCheckbox":"headerCheckboxSelection";return r&&this.checkRightRowModelType(l)&&this.checkSelectionType(l)}getSelectAllMode(){const e=Lr(this.gos,!1);if(e)return e;const{headerCheckboxSelectionCurrentPageOnly:t,headerCheckboxSelectionFilteredOnly:s}=this.column.getColDef();return t?"currentPage":s?"filtered":"all"}},Cl=class extends b{postConstruct(){const{gos:e,beans:t}=this;this.selectionCtx=new nf(t.rowModel),this.addManagedPropertyListeners(["isRowSelectable","rowSelection"],()=>{const s=Js(e);s!==this.isRowSelectable&&(this.isRowSelectable=s,this.updateSelectable())}),this.isRowSelectable=Js(e)}destroy(){super.destroy(),this.selectionCtx.reset()}createCheckboxSelectionComponent(){return new of}createSelectAllFeature(e){return new rf(e)}isMultiSelect(){return It(this.gos)}onRowCtrlSelected(e,t,s){const i=!!e.rowNode.isSelected();e.forEachGui(s,o=>{o.rowComp.addOrRemoveCssClass("ag-row-selected",i);const n=o.element;Bs(n,i),n.contains(z(this.beans))&&t(o)})}announceAriaRowSelection(e){if(this.isRowSelectionBlocked(e))return;const t=e.isSelected();if(!e.selectable)return;const i=this.getLocaleTextFunc()(t?"ariaRowDeselect":"ariaRowSelect",`Press SPACE to ${t?"deselect":"select"} this row`);this.beans.ariaAnnounce?.announceValue(i,"rowSelection")}dispatchSelectionChanged(e){this.eventSvc.dispatchEvent({type:"selectionChanged",source:e})}isRowSelectionBlocked(e){return!e.selectable||!!e.rowPinned||!$e(this.gos)}updateRowSelectable(e,t){const s=this.isRowSelectable?.(e)??!0;return this.setRowSelectable(e,s,t),s}setRowSelectable(e,t,s){if(e.selectable!==t){if(e.selectable=t,e.dispatchRowEvent("selectableChanged"),s)return;if(Lt(this.gos)){const o=this.calculateSelectedFromChildren(e);this.setNodesSelected({nodes:[e],newValue:o??!1,source:"selectableChanged"});return}e.isSelected()&&!e.selectable&&this.setNodesSelected({nodes:[e],newValue:!1,source:"selectableChanged"})}}calculateSelectedFromChildren(e){let t=!1,s=!1;if(!e.childrenAfterGroup?.length)return e.selectable?e.__selected:null;for(let i=0;i{Vo(s)&&s.key&&!e.test(s.key)&&s.preventDefault()};this.addManagedListeners(this.eInput,{keydown:t,paste:s=>{const i=s.clipboardData?.getData("text");i&&i.split("").some(o=>!e.test(o))&&s.preventDefault()}})}},us={selector:"AG-INPUT-TEXT-FIELD",component:Je},bl=class extends Xe{constructor(e){super(e,"ag-text-area",null,"textarea")}setValue(e,t){const s=super.setValue(e,t);return this.eInput.value=e,s}setCols(e){return this.eInput.cols=e,this}setRows(e){return this.eInput.rows=e,this}},df={selector:"AG-INPUT-TEXT-AREA",component:bl},yi=class extends Je{constructor(e){super(e,"ag-number-field","number")}postConstruct(){super.postConstruct();const e=this.eInput;this.addManagedListeners(e,{blur:()=>{const n=parseFloat(e.value),r=isNaN(n)?"":this.normalizeValue(n.toString());this.value!==r&&this.setValue(r)},wheel:this.onWheel.bind(this)}),e.step="any";const{precision:t,min:s,max:i,step:o}=this.config;typeof t=="number"&&this.setPrecision(t),typeof s=="number"&&this.setMin(s),typeof i=="number"&&this.setMax(i),typeof o=="number"&&this.setStep(o)}onWheel(e){z(this.beans)===this.eInput&&e.preventDefault()}normalizeValue(e){if(e==="")return"";this.precision!=null&&(e=this.adjustPrecision(e));const t=parseFloat(e),{min:s,max:i}=this;return s!=null&&ti&&(e=i.toString()),e}adjustPrecision(e,t){const s=this.precision;if(s==null)return e;if(t){const o=parseFloat(e).toFixed(s);return parseFloat(o).toString()}const i=String(e).split(".");if(i.length>1){if(i[1].length<=s)return e;if(s>0)return`${i[0]}.${i[1].slice(0,s)}`}return i[0]}setMin(e){return this.min===e?this:(this.min=e,Ce(this.eInput,"min",e),this)}setMax(e){return this.max===e?this:(this.max=e,Ce(this.eInput,"max",e),this)}setPrecision(e){return this.precision=e,this}setStep(e){return this.step===e?this:(this.step=e,Ce(this.eInput,"step",e),this)}setValue(e,t){return this.setValueOrInputValue(s=>super.setValue(s,t),()=>this,e)}setStartValue(e){return this.setValueOrInputValue(t=>super.setValue(t,!0),t=>{this.eInput.value=t},e)}setValueOrInputValue(e,t,s){if(x(s)){let i=this.isScientificNotation(s);if(i&&this.eInput.validity.valid)return e(s);if(!i){s=this.adjustPrecision(s);const o=this.normalizeValue(s);i=s!=o}if(i)return t(s)}return e(s)}getValue(){const e=this.eInput;if(!e.validity.valid)return;const t=e.value;return this.isScientificNotation(t)?this.adjustPrecision(t,!0):super.getValue()}isScientificNotation(e){return typeof e=="string"&&e.includes("e")}},Sl={selector:"AG-INPUT-NUMBER-FIELD",component:yi};function hs(e,t){return e.toString().padStart(t,"0")}function pe(e,t=!0,s="-"){if(!e)return null;let i=[e.getFullYear(),e.getMonth()+1,e.getDate()].map(o=>hs(o,2)).join(s);return t&&(i+=" "+[e.getHours(),e.getMinutes(),e.getSeconds()].map(o=>hs(o,2)).join(":")),i}var Jo=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 gs(e,t="YYYY-MM-DD"){const s=hs(e.getFullYear(),4),i=["January","February","March","April","May","June","July","August","September","October","November","December"],o=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],n={YYYY:()=>s.slice(s.length-4,s.length),YY:()=>s.slice(s.length-2,s.length),Y:()=>`${e.getFullYear()}`,MMMM:()=>i[e.getMonth()],MMM:()=>i[e.getMonth()].slice(0,3),MM:()=>hs(e.getMonth()+1,2),Mo:()=>`${e.getMonth()+1}${Jo(e.getMonth()+1)}`,M:()=>`${e.getMonth()+1}`,Do:()=>`${e.getDate()}${Jo(e.getDate())}`,DD:()=>hs(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()}${Jo(e.getDay())}`,d:()=>`${e.getDay()}`},r=new RegExp(Object.keys(n).join("|"),"g");return t.replace(r,a=>a in n?n[a]():a)}function oe(e){if(!e)return null;const[t,s]=e.split(" ");if(!t)return null;const i=t.split("-").map(u=>parseInt(u,10));if(i.filter(u=>!isNaN(u)).length!==3)return null;const[o,n,r]=i,a=new Date(o,n-1,r);if(a.getFullYear()!==o||a.getMonth()!==n-1||a.getDate()!==r)return null;if(!s||s==="00:00:00")return a;const[l,d,c]=s.split(":").map(u=>parseInt(u,10));return l>=0&&l<24&&a.setHours(l),d>=0&&d<60&&a.setMinutes(d),c>=0&&c<60&&a.setSeconds(c),a}var yl=class extends Je{constructor(e){super(e,"ag-date-field","date")}postConstruct(){super.postConstruct();const e=Ie();this.addManagedListeners(this.eInput,{wheel:this.onWheel.bind(this),mousedown:()=>{this.isDisabled()||e||this.eInput.focus()}}),this.eInput.step="any"}onWheel(e){z(this.beans)===this.eInput&&e.preventDefault()}setMin(e){const t=e instanceof Date?pe(e??null,!1)??void 0:e;return this.min===t?this:(this.min=t,Ce(this.eInput,"min",t),this)}setMax(e){const t=e instanceof Date?pe(e??null,!1)??void 0:e;return this.max===t?this:(this.max=t,Ce(this.eInput,"max",t),this)}setStep(e){return this.step===e?this:(this.step=e,Ce(this.eInput,"step",e),this)}getDate(){if(this.eInput.validity.valid)return oe(this.getValue())??void 0}setDate(e,t){this.setValue(pe(e??null,!1),t)}},Rl={selector:"AG-INPUT-DATE-FIELD",component:yl},cf=1e3,uf=1e3,xl=100,Fl,Ri=!1,hf=class extends b{constructor(e,t){super(),this.tooltipCtrl=e,this.getTooltipValue=t,this.interactionEnabled=!1,this.isInteractingWithTooltip=!1,this.state=0,this.tooltipInstanceCount=0,this.tooltipMouseTrack=!1}wireBeans(e){this.popupSvc=e.popupSvc,this.userCompFactory=e.userCompFactory}postConstruct(){this.gos.get("tooltipInteraction")&&(this.interactionEnabled=!0),this.tooltipTrigger=this.getTooltipTrigger(),this.tooltipMouseTrack=this.gos.get("tooltipMouseTrack");const e=this.tooltipCtrl.getGui();this.tooltipTrigger===0&&this.addManagedListeners(e,{mouseenter:this.onMouseEnter.bind(this),mouseleave:this.onMouseLeave.bind(this)}),this.tooltipTrigger===1&&this.addManagedListeners(e,{focusin:this.onFocusIn.bind(this),focusout:this.onFocusOut.bind(this)}),this.addManagedListeners(e,{mousemove:this.onMouseMove.bind(this)}),this.interactionEnabled||this.addManagedListeners(e,{mousedown:this.onMouseDown.bind(this),keydown:this.onKeyDown.bind(this)})}getGridOptionsTooltipDelay(e){const t=this.gos.get(e);return Math.max(200,t)}getTooltipDelay(e){return e==="show"?this.tooltipCtrl.getTooltipShowDelayOverride?.()??this.getGridOptionsTooltipDelay("tooltipShowDelay"):this.tooltipCtrl.getTooltipHideDelayOverride?.()??this.getGridOptionsTooltipDelay("tooltipHideDelay")}destroy(){this.setToDoNothing(),super.destroy()}getTooltipTrigger(){const e=this.gos.get("tooltipTrigger");return!e||e==="hover"?0:1}onMouseEnter(e){this.interactionEnabled&&this.interactiveTooltipTimeoutId&&(this.unlockService(),this.startHideTimeout()),!_e()&&(Ri?this.showTooltipTimeoutId=window.setTimeout(()=>{this.prepareToShowTooltip(e)},xl):this.prepareToShowTooltip(e))}onMouseMove(e){this.lastMouseEvent&&(this.lastMouseEvent=e),this.tooltipMouseTrack&&this.state===2&&this.tooltipComp&&this.positionTooltip()}onMouseDown(){this.setToDoNothing()}onMouseLeave(){this.interactionEnabled?this.lockService():this.setToDoNothing()}onFocusIn(){this.prepareToShowTooltip()}onFocusOut(e){const t=e.relatedTarget,s=this.tooltipCtrl.getGui(),i=this.tooltipComp?.getGui();this.isInteractingWithTooltip||s.contains(t)||this.interactionEnabled&&i?.contains(t)||this.setToDoNothing()}onKeyDown(){this.isInteractingWithTooltip&&(this.isInteractingWithTooltip=!1),this.setToDoNothing()}prepareToShowTooltip(e){if(this.state!=0||Ri)return;let t=0;e&&(t=this.isLastTooltipHiddenRecently()?200:this.getTooltipDelay("show")),this.lastMouseEvent=e||null,this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),t),this.state=1}isLastTooltipHiddenRecently(){return new Date().getTime()-Flthis.hideTooltip(!0),...t.getAdditionalParams?.()??{}});this.state=2,this.tooltipInstanceCount++;const o=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);xg(this.userCompFactory,i)?.newAgStackInstance().then(o)}hideTooltip(e){!e&&this.isInteractingWithTooltip||(this.tooltipComp&&(this.destroyTooltipComp(),Fl=new Date().getTime()),this.eventSvc.dispatchEvent({type:"tooltipHide",parentGui:this.tooltipCtrl.getGui()}),e&&(this.isInteractingWithTooltip=!1),this.setToDoNothing(!0))}newTooltipComponentCallback(e,t){if(this.state!==2||this.tooltipInstanceCount!==e){this.destroyBean(t);return}const i=t.getGui();this.tooltipComp=t,i.classList.contains("ag-tooltip")||i.classList.add("ag-tooltip-custom"),this.tooltipTrigger===0&&i.classList.add("ag-tooltip-animate"),this.interactionEnabled&&i.classList.add("ag-tooltip-interactive");const o=this.getLocaleTextFunc(),n=this.popupSvc?.addPopup({eChild:i,ariaLabel:o("ariaLabelTooltip","Tooltip")});if(n&&(this.tooltipPopupDestroyFunc=n.hideFunc),this.positionTooltip(),this.tooltipTrigger===1){const r=()=>this.setToDoNothing();[this.onBodyScrollEventCallback,this.onColumnMovedEventCallback]=this.addManagedEventListeners({bodyScroll:r,columnMoved:r})}this.interactionEnabled&&([this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener]=this.addManagedElementListeners(i,{mouseenter:this.onTooltipMouseEnter.bind(this),mouseleave:this.onTooltipMouseLeave.bind(this)}),[this.onDocumentKeyDownCallback]=this.addManagedElementListeners(_(this.beans),{keydown:r=>{i.contains(r?.target)||this.onKeyDown()}}),this.tooltipTrigger===1&&([this.tooltipFocusInListener,this.tooltipFocusOutListener]=this.addManagedElementListeners(i,{focusin:this.onTooltipFocusIn.bind(this),focusout:this.onTooltipFocusOut.bind(this)}))),this.eventSvc.dispatchEvent({type:"tooltipShow",tooltipGui:i,parentGui:this.tooltipCtrl.getGui()}),this.startHideTimeout()}onTooltipMouseEnter(){this.isInteractingWithTooltip=!0,this.unlockService()}onTooltipMouseLeave(){this.isTooltipFocused()||(this.isInteractingWithTooltip=!1,this.lockService())}onTooltipFocusIn(){this.isInteractingWithTooltip=!0}isTooltipFocused(){const e=this.tooltipComp?.getGui(),t=z(this.beans);return!!e&&e.contains(t)}onTooltipFocusOut(e){const t=this.tooltipCtrl.getGui();this.isTooltipFocused()||(this.isInteractingWithTooltip=!1,t.contains(e.relatedTarget)?this.startHideTimeout():this.hideTooltip())}positionTooltip(){const e={type:"tooltip",ePopup:this.tooltipComp.getGui(),nudgeY:18,skipObserver:this.tooltipMouseTrack};this.lastMouseEvent?this.popupSvc?.positionPopupUnderMouseEvent({...e,mouseEvent:this.lastMouseEvent}):this.popupSvc?.positionPopupByComponent({...e,eventSource:this.tooltipCtrl.getGui(),position:"under",keepWithinBounds:!0,nudgeY:5})}destroyTooltipComp(){this.tooltipComp.getGui().classList.add("ag-tooltip-hiding");const e=this.tooltipPopupDestroyFunc,t=this.tooltipComp,s=this.tooltipTrigger===0?uf:0;window.setTimeout(()=>{e(),this.destroyBean(t)},s),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(){Ri=!0,this.interactiveTooltipTimeoutId=window.setTimeout(()=>{this.unlockService(),this.setToDoNothing()},xl)}unlockService(){Ri=!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()}};function ps(e){return e.get("tooltipShowMode")==="whenTruncated"}function gf(e,t){return ps(e)?Nt(t):void 0}function Nt(e){return()=>{const t=e();return t?t.scrollWidth>t.clientWidth:!0}}var El=class extends b{constructor(e,t){super(),this.ctrl=e,t&&(this.beans=t)}postConstruct(){this.refreshTooltip()}setBrowserTooltip(e){const t="title",s=this.ctrl.getGui();s&&(e!=null&&e!=""?s.setAttribute(t,e):s.removeAttribute(t))}updateTooltipText(){const{getTooltipValue:e}=this.ctrl;e&&(this.tooltip=e())}createTooltipFeatureIfNeeded(){this.tooltipManager==null&&(this.tooltipManager=this.createBean(new hf(this.ctrl,()=>this.tooltip),this.beans.context))}setTooltipAndRefresh(e){this.tooltip=e,this.refreshTooltip()}refreshTooltip(){this.browserTooltips=this.beans.gos.get("enableBrowserTooltips"),this.updateTooltipText(),this.browserTooltips?(this.setBrowserTooltip(this.tooltip),this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context)):(this.setBrowserTooltip(null),this.createTooltipFeatureIfNeeded())}destroy(){this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context),super.destroy()}},pf=class extends L{constructor(e="default",t=!1){super(`
`),this.cssIdentifier=e,this.unFocusable=t,this.activeClass="ag-active-item",this.options=[],this.itemEls=[]}postConstruct(){const e=this.getGui();this.addManagedElementListeners(e,{mouseleave:()=>this.clearHighlighted()}),!this.unFocusable&&this.addManagedElementListeners(e,{keydown:this.handleKeyDown.bind(this)})}handleKeyDown(e){const t=e.key;switch(t){case w.ENTER:if(!this.highlightedEl)this.setValue(this.getValue());else{const s=this.itemEls.indexOf(this.highlightedEl);this.setValueByIndex(s)}break;case w.DOWN:case w.UP:e.preventDefault(),this.navigate(t);break;case w.PAGE_DOWN:case w.PAGE_UP:case w.PAGE_HOME:case w.PAGE_END:e.preventDefault(),this.navigateToPage(t);break}}navigate(e){const t=e===w.DOWN;let s;const{itemEls:i,highlightedEl:o}=this;if(!o)s=i[t?0:i.length-1];else{let r=i.indexOf(o)+(t?1:-1);r=Math.min(Math.max(r,0),i.length-1),s=i[r]}this.highlightItem(s)}navigateToPage(e){const{itemEls:t,highlightedEl:s}=this;if(!s||t.length===0)return;const i=t.indexOf(s),o=this.options.length-1,n=t[0].clientHeight,r=Math.floor(this.getGui().clientHeight/n);let a=-1;e===w.PAGE_HOME?a=0:e===w.PAGE_END?a=o:e===w.PAGE_DOWN?a=Math.min(i+r,o):e===w.PAGE_UP&&(a=Math.max(i-r,0)),a!==-1&&this.highlightItem(t[a])}addOptions(e){return e.forEach(t=>this.addOption(t)),this}addOption(e){const{value:t,text:s}=e,i=s||t;return this.options.push({value:t,text:i}),this.renderOption(t,i),this.updateIndices(),this}clearOptions(){this.options=[],this.reset(!0),this.itemEls.forEach(e=>{ve(e)}),this.itemEls=[]}updateIndices(){const e=this.getGui().querySelectorAll(".ag-list-item");e.forEach((t,s)=>{Yn(t,s+1),qn(t,e.length)})}renderOption(e,t){const s=_(this.beans),i=s.createElement("div");X(i,"option"),i.classList.add("ag-list-item",`ag-${this.cssIdentifier}-list-item`);const o=s.createElement("span");i.appendChild(o),o.textContent=t,this.unFocusable||(i.tabIndex=-1),this.itemEls.push(i),this.addManagedListeners(i,{mouseover:()=>this.highlightItem(i),mousedown:n=>{n.preventDefault(),n.stopPropagation(),this.setValue(e)}}),this.createOptionalManagedBean(this.beans.registry.createDynamicBean("tooltipFeature",!1,{getTooltipValue:()=>t,getGui:()=>i,getLocation:()=>"UNKNOWN",shouldDisplayTooltip:()=>o.scrollWidth>o.clientWidth})),this.getGui().appendChild(i)}setValue(e,t){if(this.value===e)return this.fireItemSelected(),this;if(e==null)return this.reset(t),this;const s=this.options.findIndex(i=>i.value===e);if(s!==-1){const i=this.options[s];this.value=i.value,this.displayValue=i.text,this.highlightItem(this.itemEls[s]),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(t=>t.value===this.value);e!==-1&&this.highlightItem(this.itemEls[e])}reset(e){this.value=null,this.displayValue=null,this.clearHighlighted(),e||this.fireChangeEvent()}highlightItem(e){if(!me(e))return;this.clearHighlighted(),this.highlightedEl=e,e.classList.add(this.activeClass),Bs(e,!0);const t=this.getGui(),{scrollTop:s,clientHeight:i}=t,{offsetTop:o,offsetHeight:n}=e;(o+n>s+i||o
`,e?.agComponents||[],e?.className),this.isPickerDisplayed=!1,this.skipClick=!1,this.pickerGap=4,this.hideCurrentPicker=null,this.eLabel=E,this.eWrapper=E,this.eDisplayField=E,this.eIcon=E,this.registerCSS(ff),this.ariaRole=e?.ariaRole,this.onPickerFocusIn=this.onPickerFocusIn.bind(this),this.onPickerFocusOut=this.onPickerFocusOut.bind(this),!e)return;const{pickerGap:t,maxPickerHeight:s,variableWidth:i,minPickerWidth:o,maxPickerWidth:n}=e;t!=null&&(this.pickerGap=t),this.variableWidth=!!i,s!=null&&this.setPickerMaxHeight(s),o!=null&&this.setPickerMinWidth(o),n!=null&&this.setPickerMaxWidth(n)}postConstruct(){super.postConstruct(),this.setupAria();const e=`ag-${this.getCompId()}-display`;this.eDisplayField.setAttribute("id",e);const t=this.getAriaElement();this.addManagedElementListeners(t,{keydown:this.onKeyDown.bind(this)}),this.addManagedElementListeners(this.eLabel,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)}),this.addManagedElementListeners(this.eWrapper,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)});const{pickerIcon:s,inputWidth:i}=this.config;if(s){const o=ge(s,this.beans);o&&this.eIcon.appendChild(o)}i!=null&&this.setInputWidth(i)}setupAria(){const e=this.getAriaElement();e.setAttribute("tabindex",this.gos.get("tabIndex").toString()),Gs(e,!1),this.ariaRole&&X(e,this.ariaRole)}onLabelOrWrapperMouseDown(e){if(e){const t=this.getFocusableElement();if(t!==this.eWrapper&&e?.target===t)return;e.preventDefault(),this.getFocusableElement().focus()}if(this.skipClick){this.skipClick=!1;return}this.isDisabled()||(this.isPickerDisplayed?this.hidePicker():this.showPicker())}onKeyDown(e){switch(e.key){case w.UP:case w.DOWN:case w.ENTER:case w.SPACE:e.preventDefault(),this.onLabelOrWrapperMouseDown();break;case w.ESCAPE:this.isPickerDisplayed&&(e.preventDefault(),e.stopPropagation(),this.hideCurrentPicker&&this.hideCurrentPicker());break}}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.pickerComponent.getGui();this.gos.get("suppressScrollWhenPopupsAreOpen")||([this.destroyMouseWheelFunc]=this.addManagedEventListeners({bodyScroll:()=>{this.hidePicker()}}));const t=this.getLocaleTextFunc(),{config:{pickerAriaLabelKey:s,pickerAriaLabelValue:i,modalPicker:o=!0},maxPickerHeight:n,minPickerWidth:r,maxPickerWidth:a,variableWidth:l,beans:d,eWrapper:c}=this,u={modal:o,eChild:e,closeOnEsc:!0,closedCallback:()=>{const f=fo(d);this.beforeHidePicker(),f&&this.isAlive()&&this.getFocusableElement().focus()},ariaLabel:t(s,i),anchorToElement:c};e.style.position="absolute";const h=d.popupSvc,g=h.addPopup(u);l?(r&&(e.style.minWidth=r),e.style.width=no(jt(c)),a&&(e.style.maxWidth=a)):Us(e,a??jt(c));const p=n??`${Ns(h.getPopupParent())}px`;return e.style.setProperty("max-height",p),this.alignPickerToComponent(),g.hideFunc}alignPickerToComponent(){if(!this.pickerComponent)return;const{pickerGap:e,config:{pickerType:t},beans:{popupSvc:s,gos:i},eWrapper:o,pickerComponent:n}=this,r=i.get("enableRtl")?"right":"left";s.positionPopupByComponent({type:t,eventSource:o,ePopup:n.getGui(),position:"under",alignSide:r,keepWithinBounds:!0,nudgeY:e})}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){if(!this.isAlive())return;const t=this.getAriaElement();Gs(t,e);const s=this.eWrapper.classList;s.toggle("ag-picker-expanded",e),s.toggle("ag-picker-collapsed",!e)}onPickerFocusIn(){this.togglePickerHasFocus(!0)}onPickerFocusOut(e){this.pickerComponent?.getGui().contains(e.relatedTarget)||this.togglePickerHasFocus(!1)}togglePickerHasFocus(e){this.pickerComponent&&this.eWrapper.classList.toggle("ag-picker-has-focus",e)}hidePicker(){this.hideCurrentPicker?.()}setInputWidth(e){return Us(this.eWrapper,e),this}getFocusableElement(){return this.eWrapper}setPickerGap(e){return this.pickerGap=e,this}setPickerMinWidth(e){return typeof e=="number"&&(e=`${e}px`),this.minPickerWidth=e??void 0,this}setPickerMaxWidth(e){return typeof e=="number"&&(e=`${e}px`),this.maxPickerWidth=e??void 0,this}setPickerMaxHeight(e){return typeof e=="number"&&(e=`${e}px`),this.maxPickerHeight=e??void 0,this}destroy(){this.hidePicker(),super.destroy()}},mf=".ag-select{align-items:center;display:flex;&.ag-disabled{opacity:.5}}:where(.ag-select){.ag-picker-field-wrapper{cursor:default}&.ag-disabled .ag-picker-field-wrapper:focus{box-shadow:none}&:not(.ag-cell-editor,.ag-label-align-top){min-height:var(--ag-list-item-height)}.ag-picker-field-display{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-picker-field-icon{align-items:center;display:flex}}:where(.ag-ltr) :where(.ag-select){.ag-picker-field-wrapper{padding-left:calc(var(--ag-cell-horizontal-padding)/2);padding-right:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-select){.ag-picker-field-wrapper{padding-left:var(--ag-spacing);padding-right:calc(var(--ag-cell-horizontal-padding)/2)}}",xi=class extends Dl{constructor(e){super({pickerAriaLabelKey:"ariaLabelSelectField",pickerAriaLabelValue:"Select Field",pickerType:"ag-list",className:"ag-select",pickerIcon:"selectOpen",ariaRole:"combobox",...e}),this.registerCSS(mf)}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("tooltipFeature",!1,{shouldDisplayTooltip:Nt(()=>this.eDisplayField),getGui:()=>this.getGui()})),super.postConstruct(),this.createListComponent(),this.eWrapper.tabIndex=this.gos.get("tabIndex");const{options:e,value:t,placeholder:s}=this.config;e!=null&&this.addOptions(e),t!=null&&this.setValue(t,!0),s&&t==null&&(this.eDisplayField.textContent=s),this.addManagedElementListeners(this.eWrapper,{focusout:this.onWrapperFocusOut.bind(this)})}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}createListComponent(){const e=this.createBean(new pf("select",!0));this.listComponent=e,e.setParentComponent(this);const t=e.getAriaElement(),s=`ag-select-list-${e.getCompId()}`;t.setAttribute("id",s),tr(this.getAriaElement(),t),e.addManagedElementListeners(e.getGui(),{mousedown:i=>{i?.preventDefault()}}),e.addManagedListeners(e,{selectedItem:()=>{this.hidePicker(),this.dispatchLocalEvent({type:"selectedItem"})},fieldValueChanged:()=>{this.listComponent&&(this.setValue(this.listComponent.getValue(),!1,!0),this.hidePicker())}})}createPickerComponent(){return this.listComponent}onKeyDown(e){const{key:t}=e;switch(t===w.TAB&&this.hidePicker(),t){case w.ENTER:case w.UP:case w.DOWN:case w.PAGE_UP:case w.PAGE_DOWN:case w.PAGE_HOME:case w.PAGE_END:e.preventDefault(),this.isPickerDisplayed?this.listComponent?.handleKeyDown(e):super.onKeyDown(e);break;case w.ESCAPE:super.onKeyDown(e);break;case w.SPACE:this.isPickerDisplayed?e.preventDefault():super.onKeyDown(e);break}}showPicker(){const e=this.listComponent;e&&(super.showPicker(),e.refreshHighlighted())}addOptions(e){return e.forEach(t=>this.addOption(t)),this}addOption(e){return this.listComponent.addOption(e),this}clearOptions(){return this.listComponent?.clearOptions(),this}setValue(e,t,s){const{listComponent:i,config:{placeholder:o},eDisplayField:n,tooltipFeature:r}=this;if(this.value===e||!i)return this;if(s||i.setValue(e,!0),i.getValue()===this.getValue())return this;let l=i.getDisplayValue();return l==null&&o&&(l=o),n.textContent=l,r?.setTooltipAndRefresh(l??null),super.setValue(e,t)}destroy(){this.listComponent=this.destroyBean(this.listComponent),super.destroy()}},Pl={selector:"AG-SELECT",component:xi},Fi={TAB_GUARD:"ag-tab-guard",TAB_GUARD_TOP:"ag-tab-guard-top",TAB_GUARD_BOTTOM:"ag-tab-guard-bottom"},Ml=class extends b{constructor(e){super(),this.skipTabGuardFocus=!1,this.forcingFocusOut=!1,this.allowFocus=!1;const{comp:t,eTopGuard:s,eBottomGuard:i,focusTrapActive:o,forceFocusOutWhenTabGuardsAreEmpty:n,isFocusableContainer:r,focusInnerElement:a,onFocusIn:l,onFocusOut:d,shouldStopEventPropagation:c,onTabKeyDown:u,handleKeyDown:h,isEmpty:g,eFocusableElement:p}=e;this.comp=t,this.eTopGuard=s,this.eBottomGuard=i,this.providedFocusInnerElement=a,this.eFocusableElement=p,this.focusTrapActive=!!o,this.forceFocusOutWhenTabGuardsAreEmpty=!!n,this.isFocusableContainer=!!r,this.providedFocusIn=l,this.providedFocusOut=d,this.providedShouldStopEventPropagation=c,this.providedOnTabKeyDown=u,this.providedHandleKeyDown=h,this.providedIsEmpty=g}postConstruct(){this.createManagedBean(new St(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.addManagedElementListeners(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():!1}activateTabGuards(){if(this.forcingFocusOut)return;const e=this.gos.get("tabIndex");this.comp.setTabIndex(e.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(e){if(this.isFocusableContainer&&!this.eFocusableElement.contains(e.relatedTarget)&&!this.allowFocus){this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);return}if(this.skipTabGuardFocus){this.skipTabGuardFocus=!1;return}if(this.forceFocusOutWhenTabGuardsAreEmpty&&(this.providedIsEmpty?this.providedIsEmpty():mt(this.eFocusableElement,".ag-tab-guard").length===0)){this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);return}if(this.isFocusableContainer&&this.eFocusableElement.contains(e.relatedTarget))return;const t=e.target===this.eBottomGuard;!(this.providedFocusInnerElement?this.providedFocusInnerElement(t):this.focusInnerElement(t))&&this.forceFocusOutWhenTabGuardsAreEmpty&&this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard)}findNextElementOutsideAndFocus(e){const t=_(this.beans),s=mt(t.body,null,!0),i=s.indexOf(e?this.eTopGuard:this.eBottomGuard);if(i===-1)return;let o,n;e?(o=0,n=i):(o=i+1,n=s.length);const r=s.slice(o,n),a=this.gos.get("tabIndex");r.sort((l,d)=>{const c=parseInt(l.getAttribute("tabindex")||"0"),u=parseInt(d.getAttribute("tabindex")||"0");return u===a?1:c===a?-1:c===0?1:u===0?-1:c-u}),r[e?r.length-1:0]?.focus()}onFocusIn(e){this.focusTrapActive||this.forcingFocusOut||(this.providedFocusIn&&this.providedFocusIn(e),this.isFocusableContainer||this.deactivateTabGuards())}onFocusOut(e){this.focusTrapActive||(this.providedFocusOut&&this.providedFocusOut(e),this.eFocusableElement.contains(e.relatedTarget)||this.activateTabGuards())}onTabKeyDown(e){if(this.providedOnTabKeyDown){this.providedOnTabKeyDown(e);return}if(this.focusTrapActive||e.defaultPrevented)return;const t=this.tabGuardsAreActive();t&&this.deactivateTabGuards();const s=this.getNextFocusableElement(e.shiftKey);t&&setTimeout(()=>this.activateTabGuards(),0),s&&(s.focus(),e.preventDefault())}focusInnerElement(e=!1){const t=mt(this.eFocusableElement);return this.tabGuardsAreActive()&&(t.splice(0,1),t.splice(t.length-1,1)),t.length?(t[e?t.length-1:0].focus({preventScroll:!0}),!0):!1}getNextFocusableElement(e){return Ye(this.beans,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,t){return e===this.eTopGuard&&!t||e===this.eBottomGuard&&(t??!0)}setAllowFocus(e){this.allowFocus=e}},Al=class extends b{constructor(e){super(),this.comp=e}initialiseTabGuard(e){this.eTopGuard=this.createTabGuard("top"),this.eBottomGuard=this.createTabGuard("bottom"),this.eFocusableElement=this.comp.getFocusableElement();const{eTopGuard:t,eBottomGuard:s,eFocusableElement:i}=this,o=[t,s],n={setTabIndex:m=>{o.forEach(C=>m!=null?C.setAttribute("tabindex",m):C.removeAttribute("tabindex"))}};this.addTabGuards(t,s);const{focusTrapActive:r=!1,onFocusIn:a,onFocusOut:l,focusInnerElement:d,handleKeyDown:c,onTabKeyDown:u,shouldStopEventPropagation:h,isEmpty:g,forceFocusOutWhenTabGuardsAreEmpty:p,isFocusableContainer:f}=e;this.tabGuardCtrl=this.createManagedBean(new Ml({comp:n,focusTrapActive:r,eTopGuard:t,eBottomGuard:s,eFocusableElement:i,onFocusIn:a,onFocusOut:l,focusInnerElement:d,handleKeyDown:c,onTabKeyDown:u,shouldStopEventPropagation:h,isEmpty:g,forceFocusOutWhenTabGuardsAreEmpty:p,isFocusableContainer:f}))}getTabGuardCtrl(){return this.tabGuardCtrl}createTabGuard(e){const t=_(this.beans).createElement("div"),s=e==="top"?Fi.TAB_GUARD_TOP:Fi.TAB_GUARD_BOTTOM;return t.classList.add(Fi.TAB_GUARD,s),X(t,"presentation"),t}addTabGuards(e,t){const s=this.eFocusableElement;s.insertAdjacentElement("afterbegin",e),s.insertAdjacentElement("beforeend",t)}removeAllChildrenExceptTabGuards(){const e=[this.eTopGuard,this.eBottomGuard];Z(this.comp.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}appendChild(e,t,s){$s(t)||(t=t.getGui());const{eBottomGuard:i}=this;i?i.insertAdjacentElement("beforebegin",t):e(t,s)}destroy(){const{eFocusableElement:e,eTopGuard:t,eBottomGuard:s}=this;e.removeChild(t),e.removeChild(s),super.destroy()}},en=class extends L{initialiseTabGuard(e){this.tabGuardFeature=this.createManagedBean(new Al(this)),this.tabGuardFeature.initialiseTabGuard(e)}forceFocusOutOfContainer(e=!1){this.tabGuardFeature.forceFocusOutOfContainer(e)}appendChild(e,t){this.tabGuardFeature.appendChild(super.appendChild.bind(this),e,t)}},yt=class extends L{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()}},Rt=class{constructor(e,t=!1){this.DOUBLE_TAP_MILLIS=500,this.destroyFuncs=[],this.touching=!1,this.localEventService=new We,this.preventMouseClick=t;const s=this.onTouchStart.bind(this),i=this.onTouchMove.bind(this),o=this.onTouchEnd.bind(this);e.addEventListener("touchstart",s,{passive:!0}),e.addEventListener("touchmove",i,{passive:!0}),e.addEventListener("touchend",o,{passive:!1}),this.destroyFuncs.push(()=>{e.removeEventListener("touchstart",s,{passive:!0}),e.removeEventListener("touchmove",i,{passive:!0}),e.removeEventListener("touchend",o,{passive:!1})})}getActiveTouch(e){for(let t=0;t{const s=this.touchStart===t;if(this.touching&&s&&!this.moved){this.moved=!0;const i={type:"longTap",touchStart:this.touchStart,touchEvent:e};this.localEventService.dispatchEvent(i)}},500)}onTouchMove(e){if(!this.touching)return;const t=this.getActiveTouch(e.touches);if(!t)return;!ka(t,this.touchStart,4)&&(this.moved=!0)}onTouchEnd(e){if(this.touching){if(!this.moved){const t={type:"tap",touchStart:this.touchStart};this.localEventService.dispatchEvent(t),this.checkForDoubleTap()}this.preventMouseClick&&e.cancelable&&e.preventDefault(),this.touching=!1}}checkForDoubleTap(){const e=new Date().getTime();if(this.lastTapTime&&this.lastTapTime>0)if(e-this.lastTapTime>this.DOUBLE_TAP_MILLIS){const s={type:"doubleTap",touchStart:this.touchStart};this.localEventService.dispatchEvent(s),this.lastTapTime=null}else this.lastTapTime=e;else this.lastTapTime=e}destroy(){this.destroyFuncs.forEach(e=>e())}},Tl=(e=>(e[e.VALUE=0]="VALUE",e[e.DIMENSION=1]="DIMENSION",e))(Tl||{}),kl=class{constructor(e="javascript"){this.frameworkName=e,this.renderingEngine="vanilla",this.wrapIncoming=t=>t(),this.wrapOutgoing=t=>t(),this.baseDocLink=`${pr}/${this.frameworkName}-data-grid`,Ku(this.baseDocLink)}setInterval(e,t){return new te(s=>{s(window.setInterval(e,t))})}addEventListener(e,t,s,i){let o={};if(typeof i=="object"?o=i:typeof i=="boolean"&&(o={capture:i}),o.passive==null){const n=zr(t);n!=null&&(o.passive=n)}e.addEventListener(t,s,o)}frameworkComponent(e){return null}isFrameworkComponent(e){return!1}getDocLink(e){return`${this.baseDocLink}${e?`/${e}`:""}`}};function Cf(e){return{beanName:"gridApi",bean:e.getBean("apiFunctionSvc").api}}var vf=["licenseManager","environment","eventSvc","gos","paginationAutoPageSizeSvc","apiFunctionSvc","gridApi","registry","agCompUtils","userCompFactory","rowContainerHeight","horizontalResizeSvc","localeSvc","pinnedRowModel","dragSvc","colGroupSvc","visibleCols","popupSvc","selectionSvc","colFilter","quickFilter","filterManager","colModel","headerNavigation","pageBounds","pagination","rowSpanSvc","pageBoundsListener","stickyRowSvc","rowRenderer","expressionSvc","alignedGridsSvc","navigation","valueCache","valueSvc","autoWidthCalc","filterMenuFactory","dragAndDrop","focusSvc","cellNavigation","cellStyles","scrollVisibleSvc","sortSvc","colHover","colAnimation","autoColSvc","selectionColSvc","changeDetectionSvc","animationFrameSvc","undoRedo","colDefFactory","rowStyleSvc","rowNodeBlockLoader","rowNodeSorter","ctrlsSvc","pinnedCols","dataTypeSvc","syncSvc","overlays","stateSvc","expansionSvc","apiEventSvc","ariaAnnounce","menuSvc","colMoves","colAutosize","colFlex","colResize","pivotColsSvc","valueColsSvc","rowGroupColsSvc","funcColsSvc","colNames","colViewport","pivotResultCols","showRowGroupCols","validation"],Il=Object.fromEntries(vf.map((e,t)=>[e,t]));function wf(e,t){const s=(e.beanName?Il[e.beanName]:void 0)??Number.MAX_SAFE_INTEGER,i=(t.beanName?Il[t.beanName]:void 0)??Number.MAX_SAFE_INTEGER;return s-i}function bf(e,t){return e?.beanName==="gridDestroySvc"?-1:0}var Sf='
',yf='
',Rf=``,tn=class extends L{constructor(e){super(),this.eCenterContainer=E,this.headerRowComps={},this.rowCompsList=[],this.pinned=e}postConstruct(){this.selectAndSetTemplate();const e={setDisplayed:s=>this.setDisplayed(s),setCtrls:s=>this.setCtrls(s),setCenterWidth:s=>this.eCenterContainer.style.width=s,setViewportScrollLeft:s=>this.getGui().scrollLeft=s,setPinnedContainerWidth:s=>{const i=this.getGui();i.style.width=s,i.style.maxWidth=s,i.style.minWidth=s}};this.createManagedBean(new cl(this.pinned)).setComp(e,this.getGui())}selectAndSetTemplate(){const e=this.pinned=="left",t=this.pinned=="right",s=e?Sf:t?yf:Rf;this.setTemplate(s),this.eRowContainer=this.eCenterContainer!==E?this.eCenterContainer:this.getGui()}destroy(){this.setCtrls([]),super.destroy()}destroyRowComp(e){this.destroyBean(e),this.eRowContainer.removeChild(e.getGui())}setCtrls(e){const t=this.headerRowComps;this.headerRowComps={},this.rowCompsList=[];let s;const i=o=>{const n=o.getGui();n.parentElement!=this.eRowContainer&&this.eRowContainer.appendChild(n),s&&cr(this.eRowContainer,n,s),s=n};e.forEach(o=>{const n=o.instanceId,r=t[n];delete t[n];const a=r||this.createBean(new Up(o));this.headerRowComps[n]=a,this.rowCompsList.push(a),i(a)}),Object.values(t).forEach(o=>this.destroyRowComp(o))}},xf=class extends L{constructor(){super('