File manager - Edit - /home/autoph/public_html/projects/ahg-hr/assets/main.esm.6f68e095.js
Back
import{Q as bo,T as xn,aj as Po,a2 as An,O as Tn,e as In,ak as Ks}from"./index.15cec131.js";var ct=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,i){const s=t?this.allAsyncListeners:this.allSyncListeners;let o=s.get(e);return!o&&i&&(o=new Set,s.set(e,o)),o}noRegisteredListenersExist(){return this.allSyncListeners.size===0&&this.allAsyncListeners.size===0&&this.globalSyncListeners.size===0&&this.globalAsyncListeners.size===0}addEventListener(e,t,i=!1){this.getListeners(e,i,!0).add(t)}removeEventListener(e,t,i=!1){const s=this.getListeners(e,i,!1);s&&(s.delete(t),s.size===0&&(i?this.allAsyncListeners:this.allSyncListeners).delete(e))}addGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).add(e)}removeGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).delete(e)}dispatchEvent(e){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 i=e.type;if(t&&"event"in e){const l=e.event;l instanceof Event&&(e.eventPath=l.composedPath())}const s=(l,a)=>l.forEach(d=>{if(!a.has(d))return;const h=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>d(e)):()=>d(e);t?this.dispatchAsync(h):h()}),o=this.getListeners(i,t,!1)??new Set,r=new Set(o);r.size>0&&s(r,o),new Set(t?this.globalAsyncListeners:this.globalSyncListeners).forEach(l=>{const a=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>l(i,e)):()=>l(i,e);t?this.dispatchAsync(a):a()})}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())}},Do=(e=>(e.CommunityCoreModule="@ag-grid-community/core",e.InfiniteRowModelModule="@ag-grid-community/infinite-row-model",e.ClientSideRowModelModule="@ag-grid-community/client-side-row-model",e.CsvExportModule="@ag-grid-community/csv-export",e.EnterpriseCoreModule="@ag-grid-enterprise/core",e.RowGroupingModule="@ag-grid-enterprise/row-grouping",e.ColumnsToolPanelModule="@ag-grid-enterprise/column-tool-panel",e.FiltersToolPanelModule="@ag-grid-enterprise/filter-tool-panel",e.MenuModule="@ag-grid-enterprise/menu",e.SetFilterModule="@ag-grid-enterprise/set-filter",e.MultiFilterModule="@ag-grid-enterprise/multi-filter",e.StatusBarModule="@ag-grid-enterprise/status-bar",e.SideBarModule="@ag-grid-enterprise/side-bar",e.RangeSelectionModule="@ag-grid-enterprise/range-selection",e.MasterDetailModule="@ag-grid-enterprise/master-detail",e.RichSelectModule="@ag-grid-enterprise/rich-select",e.GridChartsModule="@ag-grid-enterprise/charts",e.ViewportRowModelModule="@ag-grid-enterprise/viewport-row-model",e.ServerSideRowModelModule="@ag-grid-enterprise/server-side-row-model",e.ExcelExportModule="@ag-grid-enterprise/excel-export",e.ClipboardModule="@ag-grid-enterprise/clipboard",e.SparklinesModule="@ag-grid-enterprise/sparklines",e.AdvancedFilterModule="@ag-grid-enterprise/advanced-filter",e.AngularModule="@ag-grid-community/angular",e.ReactModule="@ag-grid-community/react",e.VueModule="@ag-grid-community/vue",e))(Do||{}),$s={};function ls(e,t){$s[t]||(e(),$s[t]=!0)}function ne(e,...t){console.log("AG Grid: "+e,...t)}function S(e,...t){ls(()=>console.warn("AG Grid: "+e,...t),e+(t==null?void 0:t.join("")))}function O(e,...t){ls(()=>console.error("AG Grid: "+e,...t),e+(t==null?void 0:t.join("")))}function as(e){return!!(e&&e.constructor&&e.call&&e.apply)}function Ln(e){On(e,400)}var wi=[],Si=!1;function js(e){wi.push(e),!Si&&(Si=!0,window.setTimeout(()=>{const t=wi.slice();wi.length=0,Si=!1,t.forEach(i=>i())},0))}function On(e,t=0){e.length>0&&window.setTimeout(()=>e.forEach(i=>i()),t)}function Y(e,t){let i;return function(...s){const o=this;window.clearTimeout(i),i=window.setTimeout(function(){e.apply(o,s)},t)}}function qs(e,t){let i=0;return function(...s){const o=this,r=new Date().getTime();r-i<t||(i=r,e.apply(o,s))}}function Gn(e,t,i=100,s){const o=new Date().getTime();let r=null,n=!1;const l=()=>{const a=new Date().getTime()-o>i;(e()||a)&&(t(),n=!0,r!=null&&(window.clearInterval(r),r=null),a&&s&&S(s))};l(),n||(r=window.setInterval(l,10))}function kn(...e){return t=>e.reduce((i,s)=>s(i),t)}function Re(e){return e==null||e===""?null:e}function F(e,t=!1){return e!=null&&(e!==""||t)}function A(e){return!F(e)}function se(e){return e==null||e.length===0}function Hi(e){return e!=null&&typeof e.toString=="function"?e.toString():null}function Ue(e){if(e===void 0)return;if(e===null||e==="")return null;if(typeof e=="number")return isNaN(e)?void 0:e;const t=parseInt(e,10);return isNaN(t)?void 0:t}function Vi(e){if(e!==void 0)return e===null||e===""?!1:Ni(e)}function Ni(e){return typeof e=="boolean"?e:typeof e=="string"?e.toUpperCase()==="TRUE"||e=="":!1}function Mt(e,t){const i=e?JSON.stringify(e):null,s=t?JSON.stringify(t):null;return i===s}function Hn(e,t,i=!1){const s=e==null,o=t==null;if(e&&e.toNumber&&(e=e.toNumber()),t&&t.toNumber&&(t=t.toNumber()),s&&o)return 0;if(s)return-1;if(o)return 1;function r(n,l){return n>l?1:n<l?-1:0}if(typeof e!="string"||!i)return r(e,t);try{return e.localeCompare(t)}catch{return r(e,t)}}function jt(e){if(e instanceof Set||e instanceof Map){const t=[];return e.forEach(i=>t.push(i)),t}return Object.values(e)}function Eo(e,t){return e.get("rowModelType")===t}function N(e){return Eo(e,"clientSide")}function De(e){return Eo(e,"serverSide")}function z(e,t){return e.get("domLayout")===t}function Xt(e){return ei(e)!==void 0}function Jt(e){return!e.get("suppressAsyncEvents")}function Mo(e){return typeof e.get("getRowHeight")=="function"}function Vn(e,t){return t?!e.get("enableStrictPivotColumnOrder"):e.get("maintainColumnOrder")}function Le(e,t,i=!1,s){if(s==null&&(s=e.environment.getDefaultRowHeight()),Mo(e)){if(i)return{height:s,estimated:!0};const n={node:t,data:t.data},l=e.getCallback("getRowHeight")(n);if(Bi(l))return l===0&&S("The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead."),{height:Math.max(1,l),estimated:!1}}if(t.detail&&e.get("masterDetail"))return Nn(e);const o=e.get("rowHeight");return{height:o&&Bi(o)?o:s,estimated:!1}}function Nn(e){if(e.get("detailRowAutoHeight"))return{height:1,estimated:!1};const t=e.get("detailRowHeight");return Bi(t)?{height:t,estimated:!1}:{height:300,estimated:!1}}function Ke(e){const{environment:t}=e,i=e.get("rowHeight");if(!i||A(i))return t.getDefaultRowHeight();const s=t.refreshRowHeightVariable();return s!==-1?s:(S("row height must be a number if not using standard row model"),t.getDefaultRowHeight())}function Bi(e){return!isNaN(e)&&typeof e=="number"&&isFinite(e)}function xt(e,t,i){const s=t[e.getDomDataKey()];return s?s[i]:void 0}function Ye(e,t,i,s){const o=e.getDomDataKey();let r=t[o];A(r)&&(r={},t[o]=r),r[i]=s}function B(e){let t=null;const i=e.get("getDocument");return i&&F(i)?t=i():e.eGridDiv&&(t=e.eGridDiv.ownerDocument),t&&F(t)?t:document}function xo(e){return B(e).defaultView||window}function At(e){return e.eGridDiv.getRootNode()}function V(e){return At(e).activeElement}function Ao(e){const t=B(e),i=V(e);return i===null||i===t.body}function ot(e){return e.get("ensureDomOrder")?!1:e.get("animateRows")}function ci(e){return!(e.get("paginateChildRows")||e.get("groupHideOpenParents")||z(e,"print"))}function fe(e){const t=e.get("autoGroupColumnDef");return!(t!=null&&t.comparator)&&!e.get("treeData")}function Wi(e){const t=e.get("groupAggFiltering");if(typeof t=="function")return e.getCallback("groupAggFiltering");if(t===!0)return()=>!0}function To(e){const t=e.get("grandTotalRow");if(t)return t;if(e.get("groupIncludeTotalFooter"))return"bottom"}function Io(e){const t=e.get("groupTotalRow");if(typeof t=="function")return e.getCallback("groupTotalRow");if(t)return()=>t;const i=e.get("groupIncludeFooter");if(typeof i=="function"){const s=e.getCallback("groupIncludeFooter");return o=>s(o)?"bottom":void 0}return()=>i?"bottom":void 0}function Lo(e){return e.exists("groupDisplayType")?e.get("groupDisplayType")==="multipleColumns":e.get("groupHideOpenParents")}function ui(e,t){return t?!1:e.get("groupDisplayType")==="groupRows"}function ut(e){const t=e.getCallback("getRowId");return t===void 0?t:i=>{let s=t(i);return typeof s!="string"&&(S("The getRowId callback must return a string. The ID ",s," is being cast to a string."),s=String(s)),s}}function lt(e){return(e==null?void 0:e.checkboxes)??!0}function Zt(e){return(e==null?void 0:e.mode)==="multiRow"&&(e.headerCheckbox??!0)}function Bn(e){return(e==null?void 0:e.hideDisabledCheckboxes)??!1}function Wn(e){return typeof e.get("rowSelection")!="string"}function zn(e){return e.get("cellSelection")!==void 0}function _n(e){const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"?(t==null?void 0:t.suppressMultiRanges)??!1:!1:e.get("suppressMultiRangeSelection")}function ve(e){const t=e.get("cellSelection");return t!==void 0?!!t:e.get("enableRangeSelection")}function Un(e){var s;const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"?((s=t.handle)==null?void 0:s.mode)==="range":!1:e.get("enableRangeHandle")}function Ys(e){var s;const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"?((s=t.handle)==null?void 0:s.mode)==="fill":!1:e.get("enableFillHandle")}function Oo(e){const t=e.get("rowSelection")??"single";if(typeof t=="string"){const i=e.get("suppressRowClickSelection"),s=e.get("suppressRowDeselection");return i&&s?!1:i?"enableDeselection":s?"enableSelection":!0}return t.mode==="singleRow"||t.mode==="multiRow"?t.enableClickSelection??!1:!1}function Kn(e){const t=Oo(e);return t===!0||t==="enableSelection"}function Qs(e){const t=Oo(e);return t===!0||t==="enableDeselection"}function ds(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("isRowSelectable"):t==null?void 0:t.isRowSelectable}function ei(e){const t=e.get("rowSelection");if(typeof t=="string")switch(t){case"multiple":return"multiRow";case"single":return"singleRow";default:return}return t==null?void 0:t.mode}function hs(e){return ei(e)==="multiRow"}function $n(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("rowMultiSelectWithClick"):(t==null?void 0:t.enableSelectionWithoutKeys)??!1}function cs(e){const t=e.get("rowSelection");if(typeof t=="string"){const i=e.get("groupSelectsChildren"),s=e.get("groupSelectsFiltered");return i&&s?"filteredDescendants":i?"descendants":"self"}return(t==null?void 0:t.mode)==="multiRow"?t.groupSelects:void 0}function Qe(e){const t=cs(e);return t==="descendants"||t==="filteredDescendants"}function yi(e){return e.isModuleRegistered("@ag-grid-enterprise/set-filter")&&!e.get("suppressSetFilterByDefault")}function I(e){if(!(!e||!e.length))return e[e.length-1]}function ke(e,t,i){return e==null&&t==null?!0:e!=null&&t!=null&&e.length===t.length&&e.every((s,o)=>i?i(s,t[o]):t[o]===s)}function jn(e){return e.sort((t,i)=>t-i)}function Go(e,t){const i=e.indexOf(t);i>=0&&(e[i]=e[e.length-1],e.pop())}function Q(e,t){const i=e.indexOf(t);i>=0&&e.splice(i,1)}function qn(e,t){for(let i=0;i<t.length;i++)Go(e,t[i])}function Yn(e,t){for(let i=0;i<t.length;i++)Q(e,t[i])}function ti(e,t,i){e.splice(i,0,t)}function ko(e,t,i){Yn(e,t),t.slice().reverse().forEach(s=>ti(e,s,i))}function $e(e,t){return e.indexOf(t)>-1}function Qn(e){return(e==null?void 0:e.flatMap(t=>t))??[]}function Xs(e,t){t==null||e==null||t.forEach(i=>e.push(i))}var Ho="__ag_Grid_Stop_Propagation",Xn=["touchstart","touchend","touchmove","touchcancel","scroll"],Ri={};function at(e){e[Ho]=!0}function Fe(e){return e[Ho]===!0}var Vo=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return i=>{if(typeof Ri[i]=="boolean")return Ri[i];const s=document.createElement(e[i]||"div");return i="on"+i,Ri[i]=i in s}})();function zi(e,t,i){let s=t;for(;s;){const o=xt(e,s,i);if(o)return o;s=s.parentElement}return null}function Jn(e,t){return!t||!e?!1:el(t).indexOf(e)>=0}function Zn(e){const t=[];let i=e.target;for(;i;)t.push(i),i=i.parentElement;return t}function el(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():Zn(t)}function tl(e,t,i,s){const r=$e(Xn,i)?{passive:!0}:void 0;e&&e.addEventListener&&e.addEventListener(t,i,s,r)}var v=class{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.propertyListenerId=0,this.lastChangeSetIdLookup={},this.isAlive=()=>!this.destroyed}preWireBeans(e){this.frameworkOverrides=e.frameworkOverrides,this.stubContext=e.context,this.eventService=e.eventService,this.gos=e.gos,this.localeService=e.localeService}getFrameworkOverrides(){return this.frameworkOverrides}destroy(){for(let e=0;e<this.destroyFunctions.length;e++)this.destroyFunctions[e]();this.destroyFunctions.length=0,this.destroyed=!0,this.dispatchLocalEvent({type:"destroyed"})}addEventListener(e,t,i){this.localEventService||(this.localEventService=new ct),this.localEventService.addEventListener(e,t,i)}removeEventListener(e,t,i){this.localEventService&&this.localEventService.removeEventListener(e,t,i)}dispatchLocalEvent(e){this.localEventService&&this.localEventService.dispatchEvent(e)}addManagedElementListeners(e,t){return this._setupListeners(e,t)}addManagedEventListeners(e){return this._setupListeners(this.eventService,e)}addManagedListeners(e,t){return this._setupListeners(e,t)}_setupListeners(e,t){const i=[];for(const s in t){const o=t[s];o&&i.push(this._setupListener(e,s,o))}return i}_setupListener(e,t,i){if(this.destroyed)return()=>null;e instanceof HTMLElement?tl(this.getFrameworkOverrides(),e,t,i):e.addEventListener(t,i);const s=()=>(e.removeEventListener(t,i),null);return this.destroyFunctions.push(s),()=>(s(),this.destroyFunctions=this.destroyFunctions.filter(o=>o!==s),null)}setupGridOptionListener(e,t){this.gos.addPropertyEventListener(e,t);const i=()=>(this.gos.removePropertyEventListener(e,t),null);return this.destroyFunctions.push(i),()=>(i(),this.destroyFunctions=this.destroyFunctions.filter(s=>s!==i),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupGridOptionListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const i=e.join("-")+this.propertyListenerId++,s=o=>{if(o.changeSet){if(o.changeSet&&o.changeSet.id===this.lastChangeSetIdLookup[i])return;this.lastChangeSetIdLookup[i]=o.changeSet.id}const r={type:"gridPropertyChanged",changeSet:o.changeSet,source:o.source};t(r)};e.forEach(o=>this.setupGridOptionListener(o,s))}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createManagedBean(e,t){const i=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),i}createBean(e,t,i){return(t||this.stubContext).createBean(e,i)}destroyBean(e,t){return(t||this.stubContext).destroyBean(e)}destroyBeans(e,t){return(t||this.stubContext).destroyBeans(e)}};function j(e){return e instanceof qt}var qt=class extends v{constructor(e,t,i,s){super(),this.isColumn=!1,this.expandable=!1,this.instanceId=Wo(),this.expandableListenerRemoveCallback=null,this.colGroupDef=e,this.groupId=t,this.expanded=!!e&&!!e.openByDefault,this.padding=i,this.level=s}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0),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}setOriginalParent(e){this.originalParent=e}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):j(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,i=!1;const s=this.findChildrenRemovingPadding();for(let r=0,n=s.length;r<n;r++){const l=s[r];if(!l.isVisible())continue;const a=l.getColumnGroupShow();a==="open"?(e=!0,i=!0):a==="closed"?(t=!0,i=!0):(e=!0,t=!0)}const o=e&&t&&i;this.expandable!==o&&(this.expandable=o,this.dispatchLocalEvent({type:"expandableChanged"}))}findChildrenRemovingPadding(){const e=[],t=i=>{i.forEach(s=>{j(s)&&s.isPadding()?t(s.children):e.push(s)})};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}},No="ag-Grid-ControlsColumn",il=class extends v{constructor(){super(...arguments),this.beanName="controlsColService"}createControlsCols(){const{gos:e}=this,t=e.get("rowSelection");if(!t||typeof t!="object")return[];const i=lt(t),s=Zt(t);if(i||s){const o=e.get("selectionColumnDef"),n={maxWidth:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:e.get("enableRtl")?"right":"left",comparator(a,d,h,c){const u=h.isSelected(),g=c.isSelected();return u&&g?0:u?1:-1},editable:!1,suppressFillHandle:!0,...o,colId:`${No}`},l=new fs(n,null,n.colId,!1);return this.createBean(l),[l]}return[]}},gi="ag-Grid-AutoColumn";function us(e){const t=[],i=s=>{for(let o=0;o<s.length;o++){const r=s[o];Ge(r)?t.push(r):j(r)&&i(r.getChildren())}};return i(e),t}function Se(e){return e.reduce((t,i)=>t+i.getActualWidth(),0)}function Te(e,t,i){const s={};if(!t)return;Pe(null,t,r=>{s[r.getInstanceId()]=r}),i&&Pe(null,i,r=>{s[r.getInstanceId()]=null});const o=Object.values(s).filter(r=>r!=null);e.destroyBeans(o)}function _i(e){return e.getId().startsWith(gi)}function Gt(e){return e.getColId().startsWith(No)}function Yt(e){let t=[];return e instanceof Array?e.some(s=>typeof s!="string")?S("if colDef.type is supplied an array it should be of type 'string[]'"):t=e:typeof e=="string"?t=e.split(","):S("colDef.type should be of type 'string' | 'string[]'"),t}var gs=class{constructor(e){this.frameworkOverrides=e,this.wrappedListeners=new Map,this.wrappedGlobalListeners=new Map}wrap(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=i=>{this.frameworkOverrides.wrapOutgoing(()=>e(i))},this.wrappedListeners.set(e,t)),t}wrapGlobal(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=(i,s)=>{this.frameworkOverrides.wrapOutgoing(()=>e(i,s))},this.wrappedGlobalListeners.set(e,t)),t}unwrap(e){return this.wrappedListeners.get(e)??e}unwrapGlobal(e){return this.wrappedGlobalListeners.get(e)??e}},ps=new Set(["__proto__","constructor","prototype"]);function re(e,t){if(e!=null){if(Array.isArray(e)){for(let i=0;i<e.length;i++)t(i.toString(),e[i]);return}for(const[i,s]of Object.entries(e))t(i,s)}}function Bo(e){const t={},i=Object.keys(e);for(let s=0;s<i.length;s++){if(ps.has(i[s]))continue;const o=i[s],r=e[o];t[o]=r}return t}function Ui(e,t){if(!e)return;const i=e,s={};return Object.keys(i).forEach(o=>{if(t&&t.indexOf(o)>=0||ps.has(o))return;const r=i[o];Ki(r)&&r.constructor===Object?s[o]=Ui(r):s[o]=r}),s}function Oe(e){if(!e)return[];const t=Object;if(typeof t.values=="function")return t.values(e);const i=[];for(const s in e)e.hasOwnProperty(s)&&e.propertyIsEnumerable(s)&&i.push(e[s]);return i}function q(e,t,i=!0,s=!1){F(t)&&re(t,(o,r)=>{if(ps.has(o))return;let n=e[o];n!==r&&(s&&n==null&&r!=null&&typeof r=="object"&&r.constructor===Object&&(n={},e[o]=n),Ki(r)&&Ki(n)&&!Array.isArray(n)?q(n,r,i,s):(i||r!==void 0)&&(e[o]=r))})}function Rt(e,t,i){if(!t||!e)return;if(!i)return e[t];const s=t.split(".");let o=e;for(let r=0;r<s.length;r++){if(o==null)return;o=o[s[r]]}return o}function Ki(e){return typeof e=="object"&&e!==null}var sl={resizable:!0,sortable:!0},ol=0;function Wo(){return ol++}function Ge(e){return e instanceof fs}var fs=class extends v{constructor(e,t,i,s){super(),this.isColumn=!0,this.instanceId=Wo(),this.autoHeaderHeight=null,this.moving=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.columnEventService=new ct,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.colDef=e,this.userProvidedColDef=t,this.colId=i,this.primary=s,this.setState(e)}wireBeans(e){this.columnHoverService=e.columnHoverService}getInstanceId(){return this.instanceId}setState(e){e.sort!==void 0?(e.sort==="asc"||e.sort==="desc")&&(this.sort=e.sort):(e.initialSort==="asc"||e.initialSort==="desc")&&(this.sort=e.initialSort);const t=e.sortIndex,i=e.initialSortIndex;t!==void 0?t!==null&&(this.sortIndex=t):i!==null&&(this.sortIndex=i);const s=e.hide,o=e.initialHide;s!==void 0?this.visible=!s:this.visible=!o,e.pinned!==void 0?this.setPinned(e.pinned):this.setPinned(e.initialPinned);const r=e.flex,n=e.initialFlex;r!==void 0?this.flex=r:n!==void 0&&(this.flex=n)}setColDef(e,t,i){this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),this.columnEventService.dispatchEvent(this.createColumnEvent("colDefChanged",i))}getUserProvidedColDef(){return this.userProvidedColDef}setParent(e){this.parent=e}getParent(){return this.parent}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}postConstruct(){this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip()}initDotNotation(){const e=this.gos.get("suppressFieldDotNotation");this.fieldContainsDots=F(this.colDef.field)&&this.colDef.field.indexOf(".")>=0&&!e,this.tooltipFieldContainsDots=F(this.colDef.tooltipField)&&this.colDef.tooltipField.indexOf(".")>=0&&!e}initMinAndMaxWidths(){const e=this.colDef;this.minWidth=e.minWidth??this.gos.environment.getDefaultColumnMinWidth(),this.maxWidth=e.maxWidth??Number.MAX_SAFE_INTEGER}initTooltip(){this.tooltipEnabled=F(this.colDef.tooltipField)||F(this.colDef.tooltipValueGetter)||F(this.colDef.tooltipComponent)}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){let t;const i=Ue(e.width),s=Ue(e.initialWidth);return i!=null?t=i:s!=null?t=s:t=200,Math.max(Math.min(t,this.maxWidth),this.minWidth)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){if(A(this.colDef)||A(this.colDef.showRowGroup))return!1;const t=this.colDef.showRowGroup===!0,i=this.colDef.showRowGroup===e;return t||i}isPrimary(){return this.primary}isFilterAllowed(){return!!this.colDef.filter}isFieldContainsDots(){return this.fieldContainsDots}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}getHighlighted(){return this.highlighted}addEventListener(e,t){var s;this.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.columnEventService.setFrameworkOverrides(this.frameworkOverrides),this.frameworkEventListenerService=new gs(this.frameworkOverrides));const i=((s=this.frameworkEventListenerService)==null?void 0:s.wrap(t))??t;this.columnEventService.addEventListener(e,i)}removeEventListener(e,t){var s;const i=((s=this.frameworkEventListenerService)==null?void 0:s.unwrap(t))??t;this.columnEventService.removeEventListener(e,i)}createColumnFunctionCallbackParams(e){return this.gos.addGridCommonParams({node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){if(typeof this.colDef.suppressNavigable=="boolean")return this.colDef.suppressNavigable;if(typeof this.colDef.suppressNavigable=="function"){const t=this.createColumnFunctionCallbackParams(e),i=this.colDef.suppressNavigable;return i(t)}return!1}isCellEditable(e){if(e.group){if(this.gos.get("treeData")){if(!e.data&&!this.gos.get("enableGroupEdit"))return!1}else if(!this.gos.get("enableGroupEdit"))return!1}return this.isColumnFunc(e,this.colDef.editable)}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(e){return this.isColumnFunc(e,this.colDef.rowDrag)}isDndSource(e){return this.isColumnFunc(e,this.colDef.dndSource)}isCellCheckboxSelection(e){const t=this.gos.get("rowSelection");if(t&&typeof t!="string"){const i=Gt(this)&<(t);return this.isColumnFunc(e,i)}else return this.isColumnFunc(e,this.colDef.checkboxSelection)}isSuppressPaste(e){return this.isColumnFunc(e,this.colDef?this.colDef.suppressPaste:null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(e){return this.colDef[e]??sl[e]}isColumnFunc(e,t){if(typeof t=="boolean")return t;if(typeof t=="function"){const i=this.createColumnFunctionCallbackParams(e);return t(i)}return!1}setHighlighted(e){this.highlighted!==e&&(this.highlighted=e,this.columnEventService.dispatchEvent(this.createColumnEvent("headerHighlightChanged","uiColumnMoved")))}setMoving(e,t){this.moving=e,this.columnEventService.dispatchEvent(this.createColumnEvent("movingChanged",t))}createColumnEvent(e,t){return this.gos.addGridCommonParams({type:e,column:this,columns:[this],source:t})}isMoving(){return this.moving}getSort(){return this.sort}setSort(e,t){this.sort!==e&&(this.sort=e,this.columnEventService.dispatchEvent(this.createColumnEvent("sortChanged",t))),this.dispatchStateUpdatedEvent("sort")}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return this.sort==="asc"}isSortDescending(){return this.sort==="desc"}isSortNone(){return A(this.sort)}isSorting(){return F(this.sort)}getSortIndex(){return this.sortIndex}setSortIndex(e){this.sortIndex=e,this.dispatchStateUpdatedEvent("sortIndex")}setMenuVisible(e,t){this.menuVisible!==e&&(this.menuVisible=e,this.columnEventService.dispatchEvent(this.createColumnEvent("menuVisibleChanged",t)))}isMenuVisible(){return this.menuVisible}setAggFunc(e){this.aggFunc=e,this.dispatchStateUpdatedEvent("aggFunc")}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(e,t){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.columnEventService.dispatchEvent(this.createColumnEvent("leftChanged",t)))}isFilterActive(){return this.filterActive}setFilterActive(e,t,i){this.filterActive!==e&&(this.filterActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("filterActiveChanged",t)));const s=this.createColumnEvent("filterChanged",t);i&&q(s,i),this.columnEventService.dispatchEvent(s)}isHovered(){return this.columnHoverService.isHovered(this)}setPinned(e){e===!0||e==="left"?this.pinned="left":e==="right"?this.pinned="right":this.pinned=null,this.dispatchStateUpdatedEvent("pinned")}setFirstRightPinned(e,t){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.columnEventService.dispatchEvent(this.createColumnEvent("firstRightPinnedChanged",t)))}setLastLeftPinned(e,t){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.columnEventService.dispatchEvent(this.createColumnEvent("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 i=e===!0;this.visible!==i&&(this.visible=i,this.columnEventService.dispatchEvent(this.createColumnEvent("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 i=!0;for(;e;){if(!e.isPadding()){i=!1;break}e=e.getParent()}return{numberOfParents:t,isSpanningTotal:i}}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 this.gos.addGridCommonParams({node:e,data:e.data,colDef:this.colDef,column:this})}getColSpan(e){if(A(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.colSpan(t);return Math.max(i,1)}getRowSpan(e){if(A(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.rowSpan(t);return Math.max(i,1)}setActualWidth(e,t,i=!1){e=Math.max(e,this.minWidth),e=Math.min(e,this.maxWidth),this.actualWidth!==e&&(this.actualWidth=e,this.flex&&t!=="flex"&&t!=="gridInitializing"&&(this.flex=null),i||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.columnEventService.dispatchEvent(this.createColumnEvent("widthChanged",e))}isGreaterThanMax(e){return e>this.maxWidth}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex||0}setFlex(e){this.flex!==e&&(this.flex=e),this.dispatchStateUpdatedEvent("flex")}setMinimum(e){this.setActualWidth(this.minWidth,e)}setRowGroupActive(e,t){this.rowGroupActive!==e&&(this.rowGroupActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("columnRowGroupChanged",t))),this.dispatchStateUpdatedEvent("rowGroup")}isRowGroupActive(){return this.rowGroupActive}setPivotActive(e,t){this.pivotActive!==e&&(this.pivotActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("columnPivotChanged",t))),this.dispatchStateUpdatedEvent("pivot")}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}setValueActive(e,t){this.aggregationActive!==e&&(this.aggregationActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("columnValueChanged",t)))}isValueActive(){return this.aggregationActive}isAllowPivot(){return this.colDef.enablePivot===!0}isAllowValue(){return this.colDef.enableValue===!0}isAllowRowGroup(){return this.colDef.enableRowGroup===!0}dispatchStateUpdatedEvent(e){this.columnEventService.dispatchEvent({type:"columnStateUpdated",key:e})}},rl={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}},nl=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=Hi(e);let i=0;for(;;){let s;if(e?(s=e,i!==0&&(s+="_"+i)):t?(s=t,i!==0&&(s+="_"+i)):s=i,!this.existingKeys[s])return this.existingKeys[s]=!0,String(s);i++}}},ll=class extends v{constructor(){super(...arguments),this.beanName="columnFactory"}wireBeans(e){this.dataTypeService=e.dataTypeService}createColumnTree(e,t,i,s){const o=new nl,{existingCols:r,existingGroups:n,existingColKeys:l}=this.extractExistingTreeData(i);o.addExistingKeys(l);const a=this.recursivelyCreateColumns(e,0,t,r,o,n,s),d=this.findMaxDept(a,0),h=this.balanceColumnTree(a,0,d,o);return Pe(null,h,(u,g)=>{j(u)&&u.setupExpandable(),u.setOriginalParent(g)}),{columnTree:h,treeDept:d}}extractExistingTreeData(e){const t=[],i=[],s=[];return e&&Pe(null,e,o=>{if(j(o)){const r=o;i.push(r)}else{const r=o;s.push(r.getId()),t.push(r)}}),{existingCols:t,existingGroups:i,existingColKeys:s}}balanceTreeForAutoCols(e,t){const i=[],s=this.findDepth(t);return e.forEach(o=>{let r=o;for(let n=s-1;n>=0;n--){const l=new qt(null,`FAKE_PATH_${o.getId()}}_${n}`,!0,n);this.createBean(l),l.setChildren([r]),r.setOriginalParent(l),r=l}s===0&&o.setOriginalParent(null),i.push(r)}),[i,s]}findDepth(e){let t=0,i=e;for(;i&&i[0]&&j(i[0]);)t++,i=i[0].getChildren();return t}balanceColumnTree(e,t,i,s){const o=[];for(let r=0;r<e.length;r++){const n=e[r];if(j(n)){const l=n,a=this.balanceColumnTree(l.getChildren(),t+1,i,s);l.setChildren(a),o.push(l)}else{let l,a;for(let d=i-1;d>=t;d--){const h=s.getUniqueKey(null,null),c=this.createMergedColGroupDef(null),u=new qt(c,h,!0,t);this.createBean(u),a&&a.setChildren([u]),a=u,l||(l=a)}if(l&&a)if(o.push(l),e.some(h=>j(h))){a.setChildren([n]);continue}else{a.setChildren(e);break}o.push(n)}}return o}findMaxDept(e,t){let i=t;for(let s=0;s<e.length;s++){const o=e[s];if(j(o)){const r=o,n=this.findMaxDept(r.getChildren(),t+1);i<n&&(i=n)}}return i}recursivelyCreateColumns(e,t,i,s,o,r,n){if(!e)return[];const l=new Array(e.length);for(let a=0;a<l.length;a++){const d=e[a];this.isColumnGroup(d)?l[a]=this.createColumnGroup(i,d,t,s,o,r,n):l[a]=this.createColumn(i,d,s,o,n)}return l}createColumnGroup(e,t,i,s,o,r,n){const l=this.createMergedColGroupDef(t),a=o.getUniqueKey(l.groupId||null,null),d=new qt(l,a,!1,i);this.createBean(d);const h=this.findExistingGroup(t,r);h&&r.splice(h.idx,1);const c=h==null?void 0:h.group;c&&d.setExpanded(c.isExpanded());const u=this.recursivelyCreateColumns(l.children,i+1,e,s,o,r,n);return d.setChildren(u),d}createMergedColGroupDef(e){const t={};return Object.assign(t,this.gos.get("defaultColGroupDef")),Object.assign(t,e),t}createColumn(e,t,i,s,o){var l;const r=this.findExistingColumn(t,i);r&&(i==null||i.splice(r.idx,1));let n=r==null?void 0:r.column;if(n){const a=this.addColumnDefaultAndTypes(t,n.getColId());n.setColDef(a,t,o),this.applyColumnState(n,a,o)}else{const a=s.getUniqueKey(t.colId,t.field),d=this.addColumnDefaultAndTypes(t,a);n=new fs(d,t,a,e),this.createBean(n)}return(l=this.dataTypeService)==null||l.addColumnListeners(n),n}applyColumnState(e,t,i){const s=Ue(t.flex);if(s!==void 0&&e.setFlex(s),e.getFlex()<=0){const l=Ue(t.width);if(l!=null)e.setActualWidth(l,i);else{const a=e.getActualWidth();e.setActualWidth(a,i)}}t.sort!==void 0&&(t.sort=="asc"||t.sort=="desc"?e.setSort(t.sort,i):e.setSort(void 0,i));const r=Ue(t.sortIndex);r!==void 0&&e.setSortIndex(r);const n=Vi(t.hide);n!==void 0&&e.setVisible(!n,i),t.pinned!==void 0&&e.setPinned(t.pinned)}findExistingColumn(e,t){if(t)for(let i=0;i<t.length;i++){const s=t[i].getUserProvidedColDef();if(!s)continue;if(e.colId!=null){if(t[i].getId()===e.colId)return{idx:i,column:t[i]};continue}if(e.field!=null){if(s.field===e.field)return{idx:i,column:t[i]};continue}if(s===e)return{idx:i,column:t[i]}}}findExistingGroup(e,t){if(e.groupId!=null)for(let s=0;s<t.length;s++){const o=t[s];if(o.getColGroupDef()&&o.getId()===e.groupId)return{idx:s,group:o}}}addColumnDefaultAndTypes(e,t){var l;const i={},s=this.gos.get("defaultColDef");q(i,s,!1,!0);const o=this.updateColDefAndGetColumnType(i,e,t);o&&this.assignColumnTypes(o,i),q(i,e,!1,!0);const r=this.gos.get("autoGroupColumnDef"),n=fe(this.gos);return e.rowGroup&&r&&n&&q(i,{sort:r.sort,initialSort:r.initialSort},!1,!0),(l=this.dataTypeService)==null||l.validateColDef(i),i}updateColDefAndGetColumnType(e,t,i){var r;const s=(r=this.dataTypeService)==null?void 0:r.updateColDefAndGetColumnType(e,t,i),o=t.type??s??e.type;return e.type=o,o?Yt(o):void 0}assignColumnTypes(e,t){if(!e.length)return;const i=Object.assign({},rl),s=this.gos.get("columnTypes")||{};re(s,(o,r)=>{o in i?S(`the column type '${o}' is a default column type and cannot be overridden.`):(r.type&&S("Column type definitions 'columnTypes' with a 'type' attribute are not supported because a column type cannot refer to another column type. Only column definitions 'columnDefs' can use the 'type' attribute to refer to a column type."),i[o]=r)}),e.forEach(o=>{const r=i[o.trim()];r?q(t,r,!1,!0):S("colDef.type '"+o+"' does not correspond to defined gridOptions.columnTypes")})}isColumnGroup(e){return e.children!==void 0}};function Pe(e,t,i){if(t)for(let s=0;s<t.length;s++){const o=t[s];j(o)&&Pe(o,o.getChildren(),i),i(o,e)}}var al=class extends v{constructor(){super(...arguments),this.beanName="columnModel",this.pivotMode=!1,this.autoHeightActiveAtLeastOnce=!1,this.ready=!1,this.changeEventsDispatching=!1,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}wireBeans(e){this.context=e.context,this.ctrlsService=e.ctrlsService,this.columnFactory=e.columnFactory,this.columnSizeService=e.columnSizeService,this.visibleColsService=e.visibleColsService,this.columnViewportService=e.columnViewportService,this.pivotResultColsService=e.pivotResultColsService,this.columnAnimationService=e.columnAnimationService,this.autoColService=e.autoColService,this.controlsColService=e.controlsColService,this.valueCache=e.valueCache,this.columnDefFactory=e.columnDefFactory,this.columnApplyStateService=e.columnApplyStateService,this.columnGroupStateService=e.columnGroupStateService,this.eventDispatcher=e.columnEventDispatcher,this.columnMoveService=e.columnMoveService,this.columnAutosizeService=e.columnAutosizeService,this.funcColsService=e.funcColsService,this.quickFilterService=e.quickFilterService,this.showRowGroupColsService=e.showRowGroupColsService,this.environment=e.environment}postConstruct(){const e=this.gos.get("pivotMode");this.isPivotSettingAllowed(e)&&(this.pivotMode=e),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents"],t=>this.refreshAll(We(t.source))),this.addManagedPropertyListener("rowSelection",t=>{this.onSelectionOptionsChanged(t.currentValue,t.previousValue,We(t.source))}),this.addManagedPropertyListener("autoGroupColumnDef",t=>this.onAutoGroupColumnDefChanged(We(t.source))),this.addManagedPropertyListeners(["defaultColDef","defaultColGroupDef","columnTypes","suppressFieldDotNotation"],t=>this.recreateColumnDefs(We(t.source))),this.addManagedPropertyListener("pivotMode",t=>this.setPivotMode(this.gos.get("pivotMode"),We(t.source))),this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered()})}createColsFromColDefs(e){var d,h,c;const t=this.colDefs?this.columnApplyStateService.compareColumnStatesAndDispatchEvents(e):void 0;this.valueCache.expire();const i=(d=this.colDefCols)==null?void 0:d.list,s=(h=this.colDefCols)==null?void 0:h.tree,o=this.columnFactory.createColumnTree(this.colDefs,!0,s,e);Te(this.context,(c=this.colDefCols)==null?void 0:c.tree,o.columnTree);const r=o.columnTree,n=o.treeDept,l=us(r),a={};l.forEach(u=>a[u.getId()]=u),this.colDefCols={tree:r,treeDepth:n,list:l,map:a},this.funcColsService.extractCols(e,i),this.ready=!0,this.refreshCols(!0),this.visibleColsService.refresh(e),this.columnViewportService.checkViewportColumns(),this.eventDispatcher.everythingChanged(e),t&&(this.changeEventsDispatching=!0,t(),this.changeEventsDispatching=!1),this.eventDispatcher.newColumnsLoaded(e),e==="gridInitializing"&&this.columnSizeService.applyAutosizeStrategy()}refreshCols(e){var o,r,n;if(!this.colDefCols)return;const t=(o=this.cols)==null?void 0:o.tree;this.saveColOrder(),this.selectCols(),this.createAutoCols(),this.addAutoCols(),this.createControlsCols(),this.addControlsCols();const i=Vn(this.gos,this.showingPivotResult);(!e||i)&&this.restoreColOrder(),this.positionLockedCols(),(r=this.showRowGroupColsService)==null||r.refresh(),(n=this.quickFilterService)==null||n.refreshQuickFilterCols(),this.setColSpanActive(),this.setAutoHeightActive(),this.visibleColsService.clear(),this.columnViewportService.clear(),!ke(t,this.cols.tree)&&this.eventDispatcher.gridColumns()}selectCols(){const e=this.pivotResultColsService.getPivotResultCols();if(this.showingPivotResult=e!=null,e){const{map:t,list:i,tree:s,treeDepth:o}=e;this.cols={list:i.slice(),map:{...t},tree:s.slice(),treeDepth:o},e.list.some(n=>{var l;return((l=this.cols)==null?void 0:l.map[n.getColId()])!==void 0})||(this.lastPivotOrder=null)}else{const{map:t,list:i,tree:s,treeDepth:o}=this.colDefCols;this.cols={list:i.slice(),map:{...t},tree:s.slice(),treeDepth:o}}}getColsToShow(){const e=this.isPivotMode()&&!this.isShowingPivotResult(),t=this.funcColsService.getValueColumns();return this.cols.list.filter(s=>{const o=_i(s);if(e){const r=t&&$e(t,s);return o||r}else return o||s.isVisible()})}addAutoCols(){this.autoCols!=null&&(this.cols.list=this.autoCols.list.concat(this.cols.list),this.cols.tree=this.autoCols.tree.concat(this.cols.tree),Js(this.cols))}createAutoCols(){var p;const e=ui(this.gos,this.pivotMode),t=this.pivotMode?this.gos.get("pivotSuppressAutoColumn"):this.isSuppressAutoCol(),i=this.funcColsService.getRowGroupColumns(),o=!(i.length>0||this.gos.get("treeData"))||t||e,r=()=>{this.autoCols&&(Te(this.context,this.autoCols.tree),this.autoCols=null)};if(o||!this.autoColService){r();return}const n=this.autoColService.createAutoCols(i)??[],l=eo(n,((p=this.autoCols)==null?void 0:p.list)||null),a=this.cols.treeDepth,h=(this.autoCols?this.autoCols.treeDepth:-1)==a;if(l&&h)return;r();const[c,u]=this.columnFactory.balanceTreeForAutoCols(n,this.cols.tree);this.autoCols={list:n,tree:c,treeDepth:u,map:{}};const g=C=>{if(!C)return null;const f=C.filter(w=>!_i(w));return[...n,...f]};this.lastOrder=g(this.lastOrder),this.lastPivotOrder=g(this.lastPivotOrder)}createControlsCols(){var d,h,c;const e=()=>{var u;Te(this.context,(u=this.controlsCols)==null?void 0:u.tree),this.controlsCols=null};this.controlsColService||e();const t=this.cols.treeDepth,s=(((d=this.controlsCols)==null?void 0:d.treeDepth)??-1)==t,o=((h=this.controlsColService)==null?void 0:h.createControlsCols())??[];if(eo(o,((c=this.controlsCols)==null?void 0:c.list)??[])&&s)return;e();const[n,l]=this.columnFactory.balanceTreeForAutoCols(o,this.cols.tree);this.controlsCols={list:o,tree:n,treeDepth:l,map:{}};const a=u=>{if(!u)return null;const g=u.filter(p=>!Gt(p));return[...o,...g]};this.lastOrder=a(this.lastOrder),this.lastPivotOrder=a(this.lastPivotOrder)}addControlsCols(){this.controlsCols!=null&&(this.cols.list=this.controlsCols.list.concat(this.cols.list),this.cols.tree=this.controlsCols.tree.concat(this.cols.tree),Js(this.cols))}refreshAll(e){this.isReady()&&(this.refreshCols(!1),this.visibleColsService.refresh(e))}setColsVisible(e,t=!1,i){this.columnApplyStateService.applyColumnState({state:e.map(s=>({colId:typeof s=="string"?s:s.getColId(),hide:!t}))},i)}setColsPinned(e,t,i){if(!this.cols||se(e))return;if(z(this.gos,"print")){S("Changing the column pinning status is not allowed with domLayout='print'");return}this.columnAnimationService.start();let s;t===!0||t==="left"?s="left":t==="right"?s="right":s=null;const o=[];e.forEach(r=>{if(!r)return;const n=this.getCol(r);n&&n.getPinned()!==s&&(n.setPinned(s),o.push(n))}),o.length&&(this.visibleColsService.refresh(i),this.eventDispatcher.columnPinned(o,i)),this.columnAnimationService.finish()}setColumnGroupOpened(e,t,i){let s;j(e)?s=e.getId():s=e||"",this.columnGroupStateService.setColumnGroupState([{groupId:s,open:t}],i)}getProvidedColGroup(e){var i;let t=null;return Pe(null,(i=this.cols)==null?void 0:i.tree,s=>{j(s)&&s.getId()===e&&(t=s)}),t}isColGroupLocked(e){const t=this.gos.get("groupLockGroupColumns");if(!e.isRowGroupActive()||t===0)return!1;if(t===-1)return!0;const s=this.funcColsService.getRowGroupColumns().findIndex(o=>o.getColId()===e.getColId());return t>s}isSuppressAutoCol(){return this.gos.get("groupDisplayType")==="custom"?!0:this.gos.get("treeDataDisplayType")==="custom"}setAutoHeightActive(){this.autoHeightActive=this.cols.list.some(e=>e.isVisible()&&e.isAutoHeight()),this.autoHeightActive&&(this.autoHeightActiveAtLeastOnce=!0,N(this.gos)||De(this.gos)||S("autoHeight columns only work with Client Side Row Model and Server Side Row Model."))}restoreColOrder(){const e=this.showingPivotResult?this.lastPivotOrder:this.lastOrder;if(!e)return;const t=new Map(e.map((a,d)=>[a,d]));if(!this.cols.list.some(a=>t.has(a)))return;const s=new Map(this.cols.list.map(a=>[a,!0])),o=e.filter(a=>s.has(a)),r=new Map(o.map(a=>[a,!0])),n=this.cols.list.filter(a=>!r.has(a)),l=o.slice();n.forEach(a=>{let d=a.getOriginalParent();if(!d){l.push(a);return}const h=[];for(;!h.length&&d;)d.getLeafColumns().forEach(p=>{const C=l.indexOf(p)>=0,f=h.indexOf(p)<0;C&&f&&h.push(p)}),d=d.getOriginalParent();if(!h.length){l.push(a);return}const c=h.map(g=>l.indexOf(g)),u=Math.max(...c);ti(l,a,u+1)}),this.cols.list=l}sortColsLikeKeys(e){if(this.cols==null)return;let t=[];const i={};e.forEach(o=>{if(i[o])return;const r=this.cols.map[o];r&&(t.push(r),i[o]=!0)});let s=0;if(this.cols.list.forEach(o=>{const r=o.getColId();if(i[r]!=null)return;r.startsWith(gi)?ti(t,o,s++):t.push(o)}),t=this.columnMoveService.placeLockedColumns(t),!this.columnMoveService.doesMovePassMarryChildren(t)){S("Applying column order broke a group where columns should be married together. Applying new order has been discarded.");return}this.cols.list=t}sortColsLikeCols(e){!e||e.length<=1||e.filter(i=>this.cols.list.indexOf(i)<0).length>0||e.sort((i,s)=>{const o=this.cols.list.indexOf(i),r=this.cols.list.indexOf(s);return o-r})}resetColDefIntoCol(e,t){const i=e.getUserProvidedColDef();if(!i)return!1;const s=this.columnFactory.addColumnDefaultAndTypes(i,e.getColId());return e.setColDef(s,i,t),!0}queueResizeOperations(){this.shouldQueueResizeOperations=!0}isShouldQueueResizeOperations(){return this.shouldQueueResizeOperations}processResizeOperations(){this.shouldQueueResizeOperations=!1,this.resizeOperationQueue.forEach(e=>e()),this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}moveInCols(e,t,i){var s;ko((s=this.cols)==null?void 0:s.list,e,t),this.visibleColsService.refresh(i)}positionLockedCols(){this.cols.list=this.columnMoveService.placeLockedColumns(this.cols.list)}saveColOrder(){var e,t;this.showingPivotResult?this.lastPivotOrder=(e=this.cols)==null?void 0:e.list:this.lastOrder=(t=this.cols)==null?void 0:t.list}getColumnDefs(){if(!this.colDefCols)return;const e=this.colDefCols.list.slice();this.showingPivotResult?e.sort((s,o)=>this.lastOrder.indexOf(s)-this.lastOrder.indexOf(o)):this.lastOrder&&e.sort((s,o)=>this.cols.list.indexOf(s)-this.cols.list.indexOf(o));const t=this.funcColsService.getRowGroupColumns(),i=this.funcColsService.getPivotColumns();return this.columnDefFactory.buildColumnDefs(e,t,i)}isShowingPivotResult(){return this.showingPivotResult}isChangeEventsDispatching(){return this.changeEventsDispatching}isColSpanActive(){return this.colSpanActive}isProvidedColGroupsPresent(){var e;return((e=this.colDefCols)==null?void 0:e.treeDepth)>0}setColSpanActive(){this.colSpanActive=this.cols.list.some(e=>e.getColDef().colSpan!=null)}isAutoRowHeightActive(){return this.autoHeightActive}wasAutoRowHeightEverActive(){return this.autoHeightActiveAtLeastOnce}getHeaderRowCount(){return this.cols?this.cols.treeDepth+1:-1}isReady(){return this.ready}isPivotMode(){return this.pivotMode}setPivotMode(e,t){e===this.pivotMode||!this.isPivotSettingAllowed(this.pivotMode)||(this.pivotMode=e,this.ready&&(this.refreshCols(!1),this.visibleColsService.refresh(t),this.eventDispatcher.pivotModeChanged()))}isPivotSettingAllowed(e){return e&&this.gos.get("treeData")?(S("Pivot mode not available with treeData."),!1):!0}isPivotActive(){const e=this.funcColsService.getPivotColumns();return this.pivotMode&&!se(e)}recreateColumnDefs(e){this.cols&&(this.autoCols&&this.autoColService.updateAutoCols(this.autoCols.list,e),this.createColsFromColDefs(e))}setColumnDefs(e,t){this.colDefs=e,this.createColsFromColDefs(t)}destroy(){var e,t,i;Te(this.context,(e=this.colDefCols)==null?void 0:e.tree),Te(this.context,(t=this.autoCols)==null?void 0:t.tree),Te(this.context,(i=this.controlsCols)==null?void 0:i.tree),super.destroy()}getColTree(){return this.cols.tree}getColDefColTree(){return this.colDefCols.tree}getColDefCols(){var e;return(e=this.colDefCols)!=null&&e.list?this.colDefCols.list:null}getCols(){var e;return((e=this.cols)==null?void 0:e.list)??[]}getAllCols(){var i,s,o;const e=this.pivotResultColsService.getPivotResultCols(),t=e==null?void 0:e.list;return[((i=this.colDefCols)==null?void 0:i.list)??[],((s=this.autoCols)==null?void 0:s.list)??[],((o=this.controlsCols)==null?void 0:o.list)??[],t??[]].flat()}getColsForKeys(e){return e?e.map(t=>this.getCol(t)).filter(t=>t!=null):[]}getColDefCol(e){var t;return(t=this.colDefCols)!=null&&t.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:i,list:s}=t;if(typeof e=="string"&&i[e])return i[e];for(let o=0;o<s.length;o++)if(Zs(s[o],e))return s[o];return this.getAutoCol(e)}getAutoCol(e){var t;return((t=this.autoCols)==null?void 0:t.list.find(i=>Zs(i,e)))??null}getAutoCols(){var e;return((e=this.autoCols)==null?void 0:e.list)??null}setColHeaderHeight(e,t){e.setAutoHeaderHeight(t)&&(e.isColumn?this.eventDispatcher.headerHeight(e):this.eventDispatcher.groupHeaderHeight(e))}getGroupRowsHeight(){const e=[],t=this.ctrlsService.getHeaderRowContainerCtrls();for(const i of t){if(!i)continue;const s=i.getGroupRowCount()||0;for(let o=0;o<s;o++){const r=i.getGroupRowCtrlAtIndex(o),n=e[o];if(r){const l=this.getColumnGroupHeaderRowHeight(r);(n==null||l>n)&&(e[o]=l)}}}return e}getColumnGroupHeaderRowHeight(e){const t=this.isPivotMode()?this.getPivotGroupHeaderHeight():this.getGroupHeaderHeight();let i=0;const s=e.getHeaderCtrls();for(const o of s){const r=o.getColumn();if(r.isAutoHeaderHeight()){const n=r.getAutoHeaderHeight();n!=null&&n>i&&(i=n)}}return Math.max(t,i)}getColumnHeaderRowHeight(){const e=this.isPivotMode()?this.getPivotHeaderHeight():this.getHeaderHeight(),i=this.visibleColsService.getAllCols().filter(s=>s.isAutoHeaderHeight()).map(s=>s.getAutoHeaderHeight()||0);return Math.max(e,...i)}getHeaderHeight(){return this.gos.get("headerHeight")??this.environment.getDefaultHeaderHeight()}getFloatingFiltersHeight(){return this.gos.get("floatingFiltersHeight")??this.getHeaderHeight()}getGroupHeaderHeight(){return this.gos.get("groupHeaderHeight")??this.getHeaderHeight()}getPivotHeaderHeight(){return this.gos.get("pivotHeaderHeight")??this.getHeaderHeight()}getPivotGroupHeaderHeight(){return this.gos.get("pivotGroupHeaderHeight")??this.getGroupHeaderHeight()}onFirstDataRendered(){const e=this.gos.get("autoSizeStrategy");if((e==null?void 0:e.type)!=="fitCellContents")return;const{colIds:t,skipHeader:i}=e;setTimeout(()=>{t?this.columnAutosizeService.autoSizeCols({colKeys:t,skipHeader:i,source:"autosizeColumns"}):this.columnAutosizeService.autoSizeAllColumns("autosizeColumns",i)})}onAutoGroupColumnDefChanged(e){this.autoCols&&this.autoColService.updateAutoCols(this.autoCols.list,e)}onSelectionOptionsChanged(e,t,i){const s=t&&typeof t!="string"?lt(t):void 0,o=e&&typeof e!="string"?lt(e):void 0,r=s!==o,n=t&&typeof t!="string"?Zt(t):void 0,l=e&&typeof e!="string"?Zt(e):void 0;(r||n!==l)&&this.refreshAll(i)}};function We(e){return e==="gridOptionsUpdated"?"gridOptionsChanged":e}function Js(e){e.map={},e.list.forEach(t=>e.map[t.getId()]=t)}function Zs(e,t){const i=e===t,s=e.getColDef()===t,o=e.getColId()==t;return i||s||o}function eo(e,t){return ke(e,t,(i,s)=>i.getColId()===s.getColId())}var dl=class extends v{constructor(){super(...arguments),this.beanName="columnAutosizeService",this.timesDelayed=0}wireBeans(e){this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.animationFrameService=e.animationFrameService,this.autoWidthCalculator=e.autoWidthCalculator,this.eventDispatcher=e.columnEventDispatcher,this.ctrlsService=e.ctrlsService,this.renderStatusService=e.renderStatusService}autoSizeCols(e){if(this.columnModel.isShouldQueueResizeOperations()){this.columnModel.pushResizeOperation(()=>this.autoSizeCols(e));return}const{colKeys:t,skipHeader:i,skipHeaderGroups:s,stopAtGroup:o,source:r="api"}=e;if(this.animationFrameService.flushAllFrames(),this.timesDelayed<5&&this.renderStatusService&&!this.renderStatusService.areHeaderCellsRendered()){this.timesDelayed++,setTimeout(()=>this.autoSizeCols(e));return}this.timesDelayed=0;const n=[];let l=-1;const a=i??this.gos.get("skipHeaderOnAutoSize"),d=s??a;for(;l!==0;){l=0;const h=[];t.forEach(c=>{if(!c)return;const u=this.columnModel.getCol(c);if(!u||n.indexOf(u)>=0)return;const g=this.autoWidthCalculator.getPreferredWidthForColumn(u,a);if(g>0){const p=this.normaliseColumnWidth(u,g);u.setActualWidth(p,r),n.push(u),l++}h.push(u)}),h.length&&this.visibleColsService.refresh(r)}d||this.autoSizeColumnGroupsByColumns(t,r,o),this.eventDispatcher.columnResized(n,!0,"autosizeColumns")}autoSizeColumn(e,t,i){e&&this.autoSizeCols({colKeys:[e],skipHeader:i,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,i){const s=new Set;this.columnModel.getColsForKeys(e).forEach(l=>{let a=l.getParent();for(;a&&a!=i;)a.isPadding()||s.add(a),a=a.getParent()});let r;const n=[];for(const l of s){for(const a of this.ctrlsService.getHeaderRowContainerCtrls())if(r=a.getHeaderCtrlForColumn(l),r)break;r&&r.resizeLeafColumnsToFit(t)}return n}autoSizeAllColumns(e,t){if(this.columnModel.isShouldQueueResizeOperations()){this.columnModel.pushResizeOperation(()=>this.autoSizeAllColumns(e,t));return}const i=this.visibleColsService.getAllCols();this.autoSizeCols({colKeys:i,skipHeader:t,source:e})}normaliseColumnWidth(e,t){const i=e.getMinWidth();t<i&&(t=i);const s=e.getMaxWidth();return e.isGreaterThanMax(t)&&(t=s),t}},hl=class extends v{constructor(){super(...arguments),this.beanName="funcColsService",this.rowGroupCols=[],this.valueCols=[],this.pivotCols=[]}wireBeans(e){this.columnModel=e.columnModel,this.eventDispatcher=e.columnEventDispatcher,this.aggFuncService=e.aggFuncService,this.visibleColsService=e.visibleColsService}getModifyColumnsNoEventsCallbacks(){return{addGroupCol:e=>this.rowGroupCols.push(e),removeGroupCol:e=>Q(this.rowGroupCols,e),addPivotCol:e=>this.pivotCols.push(e),removePivotCol:e=>Q(this.pivotCols,e),addValueCol:e=>this.valueCols.push(e),removeValueCol:e=>Q(this.valueCols,e)}}getSourceColumnsForGroupColumn(e){const t=e.getColDef().showRowGroup;if(!t)return null;if(t===!0)return this.rowGroupCols.slice(0);const i=this.columnModel.getColDefCol(t);return i?[i]:null}sortRowGroupColumns(e){this.rowGroupCols.sort(e)}sortPivotColumns(e){this.pivotCols.sort(e)}getValueColumns(){return this.valueCols?this.valueCols:[]}getPivotColumns(){return this.pivotCols?this.pivotCols:[]}getRowGroupColumns(){return this.rowGroupCols?this.rowGroupCols:[]}isRowGroupEmpty(){return se(this.rowGroupCols)}setColumnAggFunc(e,t,i){if(!e)return;const s=this.columnModel.getColDefCol(e);s&&(s.setAggFunc(t),this.eventDispatcher.columnChanged("columnValueChanged",[s],i))}setRowGroupColumns(e,t){this.setColList(e,this.rowGroupCols,"columnRowGroupChanged",!0,!0,(i,s)=>this.setRowGroupActive(i,s,t),t)}setRowGroupActive(e,t,i){e!==t.isRowGroupActive()&&(t.setRowGroupActive(e,i),e&&!this.gos.get("suppressRowGroupHidesColumns")&&this.columnModel.setColsVisible([t],!1,i),!e&&!this.gos.get("suppressMakeColumnVisibleAfterUnGroup")&&this.columnModel.setColsVisible([t],!0,i))}addRowGroupColumns(e,t){this.updateColList(e,this.rowGroupCols,!0,!0,i=>this.setRowGroupActive(!0,i,t),"columnRowGroupChanged",t)}removeRowGroupColumns(e,t){this.updateColList(e,this.rowGroupCols,!1,!0,i=>this.setRowGroupActive(!1,i,t),"columnRowGroupChanged",t)}addPivotColumns(e,t){this.updateColList(e,this.pivotCols,!0,!1,i=>i.setPivotActive(!0,t),"columnPivotChanged",t)}setPivotColumns(e,t){this.setColList(e,this.pivotCols,"columnPivotChanged",!0,!1,(i,s)=>{s.setPivotActive(i,t)},t)}removePivotColumns(e,t){this.updateColList(e,this.pivotCols,!1,!1,i=>i.setPivotActive(!1,t),"columnPivotChanged",t)}setValueColumns(e,t){this.setColList(e,this.valueCols,"columnValueChanged",!1,!1,(i,s)=>this.setValueActive(i,s,t),t)}setValueActive(e,t,i){if(e!==t.isValueActive()&&(t.setValueActive(e,i),e&&!t.getAggFunc()&&this.aggFuncService)){const s=this.aggFuncService.getDefaultAggFunc(t);t.setAggFunc(s)}}addValueColumns(e,t){this.updateColList(e,this.valueCols,!0,!1,i=>this.setValueActive(!0,i,t),"columnValueChanged",t)}removeValueColumns(e,t){this.updateColList(e,this.valueCols,!1,!1,i=>this.setValueActive(!1,i,t),"columnValueChanged",t)}moveRowGroupColumn(e,t,i){if(this.isRowGroupEmpty())return;const s=this.rowGroupCols[e],o=this.rowGroupCols.slice(e,t);this.rowGroupCols.splice(e,1),this.rowGroupCols.splice(t,0,s),this.eventDispatcher.rowGroupChanged(o,i)}setColList(e,t,i,s,o,r,n){if(!this.columnModel.getCols())return;const l=new Map;t.forEach((d,h)=>l.set(d,h)),t.length=0,F(e)&&e.forEach(d=>{const h=this.columnModel.getColDefCol(d);h&&t.push(h)}),t.forEach((d,h)=>{const c=l.get(d);if(c===void 0){l.set(d,0);return}s&&c!==h||l.delete(d)}),(this.columnModel.getColDefCols()||[]).forEach(d=>{const h=t.indexOf(d)>=0;r(h,d)}),o&&this.columnModel.refreshCols(!1),this.visibleColsService.refresh(n),this.eventDispatcher.columnChanged(i,[...l.keys()],n)}updateColList(e,t,i,s,o,r,n){if(!e||se(e))return;let l=!1;const a=new Set;e.forEach(d=>{if(!d)return;const h=this.columnModel.getColDefCol(d);if(h){if(a.add(h),i){if(t.indexOf(h)>=0)return;t.push(h)}else{const c=t.indexOf(h);if(c<0)return;for(let u=c+1;u<t.length;u++)a.add(t[u]);Q(t,h)}o(h),l=!0}}),l&&(s&&this.columnModel.refreshCols(!1),this.visibleColsService.refresh(n),this.eventDispatcher.genericColumnEvent(r,Array.from(a),n))}extractCols(e,t){this.extractRowGroupCols(e,t),this.extractPivotCols(e,t),this.extractValueCols(e,t)}extractValueCols(e,t){this.valueCols=this.extractColsCommon(t,this.valueCols,(i,s)=>i.setValueActive(s,e),()=>{},()=>{},i=>{const s=i.aggFunc;if(s===null||s==="")return null;if(s!==void 0)return!!s},i=>i.initialAggFunc!=null&&i.initialAggFunc!=""),this.valueCols.forEach(i=>{const s=i.getColDef();s.aggFunc!=null&&s.aggFunc!=""?i.setAggFunc(s.aggFunc):i.getAggFunc()||i.setAggFunc(s.initialAggFunc)})}extractRowGroupCols(e,t){this.rowGroupCols=this.extractColsCommon(t,this.rowGroupCols,(i,s)=>i.setRowGroupActive(s,e),i=>i.rowGroupIndex,i=>i.initialRowGroupIndex,i=>i.rowGroup,i=>i.initialRowGroup)}extractPivotCols(e,t){this.pivotCols=this.extractColsCommon(t,this.pivotCols,(i,s)=>i.setPivotActive(s,e),i=>i.pivotIndex,i=>i.initialPivotIndex,i=>i.pivot,i=>i.initialPivot)}extractColsCommon(e=[],t=[],i,s,o,r,n){const l=[],a=[];(this.columnModel.getColDefCols()||[]).forEach(u=>{const g=e.indexOf(u)<0,p=u.getColDef(),C=Vi(r(p)),f=Vi(n(p)),w=Ue(s(p)),y=Ue(o(p));let R;C!==void 0?R=C:w!==void 0?w===null?R=!1:R=w>=0:g?f!==void 0?R=f:y!==void 0?R=y!=null&&y>=0:R=!1:R=t.indexOf(u)>=0,R&&((g?w!=null||y!=null:w!=null)?l.push(u):a.push(u))});const h=u=>{const g=s(u.getColDef()),p=o(u.getColDef());return g??p};l.sort((u,g)=>{const p=h(u),C=h(g);return p===C?0:p<C?-1:1});const c=[].concat(l);return t.forEach(u=>{a.indexOf(u)>=0&&c.push(u)}),a.forEach(u=>{c.indexOf(u)<0&&c.push(u)}),t.forEach(u=>{c.indexOf(u)<0&&i(u,!1)}),c.forEach(u=>{t.indexOf(u)<0&&i(u,!0)}),c}generateColumnStateForRowGroupAndPivotIndexes(e,t){const i={},s=(o,r,n,l,a,d)=>{const h=this.columnModel.getColDefCols();if(!r.length||!h)return[];const c=Object.keys(o),u=new Set(c),g=new Set(c),p=new Set(r.map(D=>{const E=D.getColId();return g.delete(E),E}).concat(c)),C=[],f={};let w=0;for(let D=0;D<h.length;D++){const E=h[D].getColId();p.has(E)&&(C.push(E),f[E]=w++)}let y=1e3,R=!1,P=0;const M=D=>{const E=f[D];for(let T=P;T<E;T++){const L=C[T];g.has(L)&&(o[L][a]=y++,g.delete(L))}P=E};r.forEach(D=>{const E=D.getColId();if(u.has(E))M(E),o[E][a]=y++;else{const T=D.getColDef();(T[a]===null||T[a]===void 0&&T[d]==null)&&(R||(T[n]||T[n]===void 0&&T[l]?M(E):(g.forEach(Ve=>{o[Ve][a]=y+f[Ve]}),y+=C.length,R=!0)),i[E]||(i[E]={colId:E}),i[E][a]=y++)}})};return s(e,this.rowGroupCols,"rowGroup","initialRowGroup","rowGroupIndex","initialRowGroupIndex"),s(t,this.pivotCols,"pivot","initialPivot","pivotIndex","initialPivotIndex"),Object.values(i)}},cl=class extends v{constructor(){super(...arguments),this.beanName="columnApplyStateService"}wireBeans(e){this.columnModel=e.columnModel,this.eventDispatcher=e.columnEventDispatcher,this.sortController=e.sortController,this.columnGetStateService=e.columnGetStateService,this.funcColsService=e.funcColsService,this.visibleColsService=e.visibleColsService,this.columnAnimationService=e.columnAnimationService,this.pivotResultColsService=e.pivotResultColsService}applyColumnState(e,t){const i=this.columnModel.getColDefCols()||[];if(se(i))return!1;if(e&&e.state&&!e.state.forEach)return S("applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state."),!1;const s=this.funcColsService.getModifyColumnsNoEventsCallbacks(),o=(l,a,d)=>{const h=this.compareColumnStatesAndDispatchEvents(t),c=a.slice(),u={},g={},p=[],C=[];let f=0;const w=this.funcColsService.getRowGroupColumns().slice(),y=this.funcColsService.getPivotColumns().slice();l.forEach(D=>{const E=D.colId||"";if(E.startsWith(gi)){p.push(D),C.push(D);return}const L=d(E);L?(this.syncColumnWithStateItem(L,D,e.defaultState,u,g,!1,t,s),Q(c,L)):(C.push(D),f+=1)});const R=D=>this.syncColumnWithStateItem(D,null,e.defaultState,u,g,!1,t,s);c.forEach(R),this.funcColsService.sortRowGroupColumns(to.bind(this,u,w)),this.funcColsService.sortPivotColumns(to.bind(this,g,y)),this.columnModel.refreshCols(!1);const M=(this.columnModel.getAutoCols()||[]).slice();return p.forEach(D=>{const E=this.columnModel.getAutoCol(D.colId);Q(M,E),this.syncColumnWithStateItem(E,D,e.defaultState,null,null,!0,t,s)}),M.forEach(R),this.orderLiveColsLikeState(e),this.visibleColsService.refresh(t),this.eventDispatcher.everythingChanged(t),h(),{unmatchedAndAutoStates:C,unmatchedCount:f}};this.columnAnimationService.start();let{unmatchedAndAutoStates:r,unmatchedCount:n}=o(e.state||[],i,l=>this.columnModel.getColDefCol(l));if(r.length>0||F(e.defaultState)){const l=this.pivotResultColsService.getPivotResultCols(),a=l==null?void 0:l.list;n=o(r,a||[],d=>this.pivotResultColsService.getPivotResultCol(d)).unmatchedCount}return this.columnAnimationService.finish(),n===0}resetColumnState(e){const t=this.columnModel.getColDefCols();if(se(t))return;const i=this.columnModel.getColDefColTree(),s=us(i),o=[];let r=1e3,n=1e3,l=[];const a=this.columnModel.getAutoCols();a&&(l=l.concat(a)),s&&(l=l.concat(s)),l.forEach(d=>{const h=this.getColumnStateFromColDef(d);A(h.rowGroupIndex)&&h.rowGroup&&(h.rowGroupIndex=r++),A(h.pivotIndex)&&h.pivot&&(h.pivotIndex=n++),o.push(h)}),this.applyColumnState({state:o,applyOrder:!0},e)}getColumnStateFromColDef(e){const t=(p,C)=>p??C??null,i=e.getColDef(),s=t(i.sort,i.initialSort),o=t(i.sortIndex,i.initialSortIndex),r=t(i.hide,i.initialHide),n=t(i.pinned,i.initialPinned),l=t(i.width,i.initialWidth),a=t(i.flex,i.initialFlex);let d=t(i.rowGroupIndex,i.initialRowGroupIndex),h=t(i.rowGroup,i.initialRowGroup);d==null&&(h==null||h==!1)&&(d=null,h=null);let c=t(i.pivotIndex,i.initialPivotIndex),u=t(i.pivot,i.initialPivot);c==null&&(u==null||u==!1)&&(c=null,u=null);const g=t(i.aggFunc,i.initialAggFunc);return{colId:e.getColId(),sort:s,sortIndex:o,hide:r,pinned:n,width:l,flex:a,rowGroup:h,rowGroupIndex:d,pivot:u,pivotIndex:c,aggFunc:g}}syncColumnWithStateItem(e,t,i,s,o,r,n,l){if(!e)return;const a=(P,M)=>{const D={value1:void 0,value2:void 0};let E=!1;return t&&(t[P]!==void 0&&(D.value1=t[P],E=!0),F(M)&&t[M]!==void 0&&(D.value2=t[M],E=!0)),!E&&i&&(i[P]!==void 0&&(D.value1=i[P]),F(M)&&i[M]!==void 0&&(D.value2=i[M])),D},d=a("hide").value1;d!==void 0&&e.setVisible(!d,n);const h=a("pinned").value1;h!==void 0&&e.setPinned(h);const c=e.getColDef().minWidth??this.gos.environment.getDefaultColumnMinWidth(),u=a("flex").value1;if(u!==void 0&&e.setFlex(u),u==null){const P=a("width").value1;P!=null&&c!=null&&P>=c&&e.setActualWidth(P,n)}const g=a("sort").value1;g!==void 0&&(g==="desc"||g==="asc"?e.setSort(g,n):e.setSort(void 0,n));const p=a("sortIndex").value1;if(p!==void 0&&e.setSortIndex(p),r||!e.isPrimary())return;const C=a("aggFunc").value1;C!==void 0&&(typeof C=="string"?(e.setAggFunc(C),e.isValueActive()||(e.setValueActive(!0,n),l.addValueCol(e))):(F(C)&&S("stateItem.aggFunc must be a string. if using your own aggregation functions, register the functions first before using them in get/set state. This is because it is intended for the column state to be stored and retrieved as simple JSON."),e.isValueActive()&&(e.setValueActive(!1,n),l.removeValueCol(e))));const{value1:f,value2:w}=a("rowGroup","rowGroupIndex");(f!==void 0||w!==void 0)&&(typeof w=="number"||f?(e.isRowGroupActive()||(e.setRowGroupActive(!0,n),l.addGroupCol(e)),s&&typeof w=="number"&&(s[e.getId()]=w)):e.isRowGroupActive()&&(e.setRowGroupActive(!1,n),l.removeGroupCol(e)));const{value1:y,value2:R}=a("pivot","pivotIndex");(y!==void 0||R!==void 0)&&(typeof R=="number"||y?(e.isPivotActive()||(e.setPivotActive(!0,n),l.addPivotCol(e)),o&&typeof R=="number"&&(o[e.getId()]=R)):e.isPivotActive()&&(e.setPivotActive(!1,n),l.removePivotCol(e)))}orderLiveColsLikeState(e){if(!e.applyOrder||!e.state)return;const t=[];e.state.forEach(i=>{i.colId!=null&&t.push(i.colId)}),this.columnModel.sortColsLikeKeys(t)}compareColumnStatesAndDispatchEvents(e){const t={rowGroupColumns:this.funcColsService.getRowGroupColumns().slice(),pivotColumns:this.funcColsService.getPivotColumns().slice(),valueColumns:this.funcColsService.getValueColumns().slice()},i=this.columnGetStateService.getColumnState(),s={};return i.forEach(o=>{s[o.colId]=o}),()=>{const o=this.columnModel.getAllCols(),r=(C,f,w,y)=>{const R=f.map(y),P=w.map(y);if(ke(R,P))return;const D=new Set(f);w.forEach(T=>{D.delete(T)||D.add(T)});const E=[...D];this.eventService.dispatchEvent({type:C,columns:E,column:E.length===1?E[0]:null,source:e})},n=C=>{const f=[];return o.forEach(w=>{const y=s[w.getColId()];y&&C(y,w)&&f.push(w)}),f},l=C=>C.getColId();r("columnRowGroupChanged",t.rowGroupColumns,this.funcColsService.getRowGroupColumns(),l),r("columnPivotChanged",t.pivotColumns,this.funcColsService.getPivotColumns(),l);const d=n((C,f)=>{const w=C.aggFunc!=null,y=w!=f.isValueActive(),R=w&&C.aggFunc!=f.getAggFunc();return y||R});d.length>0&&this.eventDispatcher.columnChanged("columnValueChanged",d,e);const h=(C,f)=>C.width!=f.getActualWidth();this.eventDispatcher.columnResized(n(h),!0,e);const c=(C,f)=>C.pinned!=f.getPinned();this.eventDispatcher.columnPinned(n(c),e);const u=(C,f)=>C.hide==f.isVisible();this.eventDispatcher.columnVisible(n(u),e);const p=n((C,f)=>C.sort!=f.getSort()||C.sortIndex!=f.getSortIndex());p.length>0&&this.sortController.dispatchSortChangedEvents(e,p),this.normaliseColumnMovedEventForColumnState(i,e)}}normaliseColumnMovedEventForColumnState(e,t){const i=this.columnGetStateService.getColumnState(),s={};i.forEach(a=>s[a.colId]=a);const o={};e.forEach(a=>{s[a.colId]&&(o[a.colId]=!0)});const r=e.filter(a=>o[a.colId]),n=i.filter(a=>o[a.colId]),l=[];n.forEach((a,d)=>{const h=r&&r[d];if(h&&h.colId!==a.colId){const c=this.columnModel.getCol(h.colId);c&&l.push(c)}}),l.length&&this.eventDispatcher.columnMoved({movedColumns:l,source:t,finished:!0})}},to=(e,t,i,s)=>{const o=e[i.getId()],r=e[s.getId()],n=o!=null,l=r!=null;if(n&&l)return o-r;if(n)return-1;if(l)return 1;const a=t.indexOf(i),d=t.indexOf(s),h=a>=0,c=d>=0;return h&&c?a-d:h?-1:1},ul=class extends v{constructor(){super(...arguments),this.beanName="columnMoveService"}wireBeans(e){this.columnModel=e.columnModel,this.columnAnimationService=e.columnAnimationService,this.eventDispatcher=e.columnEventDispatcher}moveColumnByIndex(e,t,i){const s=this.columnModel.getCols();if(!s)return;const o=s[e];this.moveColumns([o],t,i)}moveColumns(e,t,i,s=!0){const o=this.columnModel.getCols();if(!o)return;if(t>o.length-e.length){S("tried to insert columns in invalid location, toIndex = ",t),S("remember that you should not count the moving columns when calculating the new index");return}this.columnAnimationService.start();const r=this.columnModel.getColsForKeys(e);this.doesMovePassRules(r,t)&&(this.columnModel.moveInCols(r,t,i),this.eventDispatcher.columnMoved({movedColumns:r,source:i,toIndex:t,finished:s})),this.columnAnimationService.finish()}doesMovePassRules(e,t){const i=this.getProposedColumnOrder(e,t);return this.doesOrderPassRules(i)}doesOrderPassRules(e){return!(!this.doesMovePassMarryChildren(e)||!this.doesMovePassLockedPositions(e))}getProposedColumnOrder(e,t){const s=this.columnModel.getCols().slice();return ko(s,e,t),s}doesMovePassLockedPositions(e){const t=r=>r?r==="left"||r===!0?-1:1:0,i=this.gos.get("enableRtl");let s=i?1:-1,o=!0;return e.forEach(r=>{const n=t(r.getColDef().lockPosition);i?n>s&&(o=!1):n<s&&(o=!1),s=n}),o}doesMovePassMarryChildren(e){let t=!0;const i=this.columnModel.getColTree();return Pe(null,i,s=>{if(!j(s))return;const o=s,r=o.getColGroupDef();if(!(r&&r.marryChildren))return;const l=[];o.getLeafColumns().forEach(u=>{const g=e.indexOf(u);l.push(g)});const a=Math.max.apply(Math,l),d=Math.min.apply(Math,l),h=a-d,c=o.getLeafColumns().length-1;h>c&&(t=!1)}),t}placeLockedColumns(e){const t=[],i=[],s=[];return e.forEach(r=>{const n=r.getColDef().lockPosition;n==="right"?s.push(r):n==="left"||n===!0?t.push(r):i.push(r)}),this.gos.get("enableRtl")?[...s,...i,...t]:[...t,...i,...s]}},gl=/[&<>"']/g,pl={"&":"&","<":"<",">":">",'"':""","'":"'"};function me(e,t){if(e==null)return null;const i=e.toString().toString();return t?i:i.replace(gl,s=>pl[s])}function fl(e){if(!e||e==null)return null;const t=/([a-z])([A-Z])/g,i=/([A-Z]+)([A-Z])([a-z])/g;return e.replace(t,"$1 $2").replace(i,"$1 $2$3").replace(/\./g," ").split(" ").map(o=>o.substring(0,1).toUpperCase()+(o.length>1?o.substring(1,o.length):"")).join(" ")}function Cl(e){return e.replace(/[A-Z]/g,t=>`-${t.toLocaleLowerCase()}`)}var ml=class extends v{constructor(){super(...arguments),this.beanName="columnNameService"}wireBeans(e){this.expressionService=e.expressionService,this.funcColsService=e.funcColsService,this.columnModel=e.columnModel}getDisplayNameForColumn(e,t,i=!1){if(!e)return null;const s=this.getHeaderName(e.getColDef(),e,null,null,t);return i?this.wrapHeaderNameWithAggFunc(e,s):s}getDisplayNameForProvidedColumnGroup(e,t,i){const s=t?t.getColGroupDef():null;return s?this.getHeaderName(s,null,e,t,i):null}getDisplayNameForColumnGroup(e,t){return this.getDisplayNameForProvidedColumnGroup(e,e.getProvidedColumnGroup(),t)}getHeaderName(e,t,i,s,o){const r=e.headerValueGetter;if(r){const n=this.gos.addGridCommonParams({colDef:e,column:t,columnGroup:i,providedColumnGroup:s,location:o});return typeof r=="function"?r(n):typeof r=="string"?this.expressionService.evaluate(r,n):(S("headerValueGetter must be a function or a string"),"")}else{if(e.headerName!=null)return e.headerName;if(e.field)return fl(e.field)}return""}wrapHeaderNameWithAggFunc(e,t){if(this.gos.get("suppressAggFuncInHeader"))return t;const i=e.getColDef().pivotValueColumn,s=F(i);let o=null,r;if(s){const n=this.funcColsService.getValueColumns(),l=this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&n.length===1,a=e.getColDef().pivotTotalColumnIds!==void 0;if(l&&!a)return t;o=i?i.getAggFunc():null,r=!0}else{const n=e.isValueActive(),l=this.columnModel.isPivotMode()||!this.funcColsService.isRowGroupEmpty();n&&l?(o=e.getAggFunc(),r=!0):r=!1}if(r){const n=typeof o=="string"?o:"func";return`${this.localeService.getLocaleTextFunc()(n,n)}(${t})`}return t}},vl=class extends v{constructor(){super(...arguments),this.beanName="pivotResultColsService"}wireBeans(e){this.context=e.context,this.columnModel=e.columnModel,this.columnFactory=e.columnFactory,this.visibleColsService=e.visibleColsService}destroy(){var e;Te(this.context,(e=this.pivotResultCols)==null?void 0:e.tree),super.destroy()}isPivotResultColsPresent(){return this.pivotResultCols!=null}lookupPivotResultCol(e,t){if(this.pivotResultCols==null)return null;const i=this.columnModel.getColDefCol(t);let s=null;return this.pivotResultCols.list.forEach(o=>{const r=o.getColDef().pivotKeys,n=o.getColDef().pivotValueColumn;ke(r,e)&&n===i&&(s=o)}),s}getPivotResultCols(){return this.pivotResultCols}getPivotResultCol(e){return this.pivotResultCols?this.columnModel.getColFromCollection(e,this.pivotResultCols):null}setPivotResultCols(e,t){var i,s;if(this.columnModel.isReady()&&!(e==null&&this.pivotResultCols==null)){if(e){this.processPivotResultColDef(e);const o=this.columnFactory.createColumnTree(e,!1,((i=this.pivotResultCols)==null?void 0:i.tree)||this.previousPivotResultCols||void 0,t);Te(this.context,(s=this.pivotResultCols)==null?void 0:s.tree,o.columnTree);const r=o.columnTree,n=o.treeDept,l=us(r),a={};this.pivotResultCols={tree:r,treeDepth:n,list:l,map:a},this.pivotResultCols.list.forEach(h=>this.pivotResultCols.map[h.getId()]=h);const d=!!this.previousPivotResultCols;this.previousPivotResultCols=null,this.columnModel.refreshCols(!d)}else this.previousPivotResultCols=this.pivotResultCols?this.pivotResultCols.tree:null,this.pivotResultCols=null,this.columnModel.refreshCols(!1);this.visibleColsService.refresh(t)}}processPivotResultColDef(e){const t=this.gos.get("processPivotResultColDef"),i=this.gos.get("processPivotResultColGroupDef");if(!t&&!i)return;const s=o=>{o.forEach(r=>{if(F(r.children)){const l=r;i&&i(l),s(l.children)}else t&&t(r)})};e&&s(e)}},wl=class extends v{constructor(){super(...arguments),this.beanName="columnSizeService"}wireBeans(e){this.columnModel=e.columnModel,this.columnViewportService=e.columnViewportService,this.eventDispatcher=e.columnEventDispatcher,this.visibleColsService=e.visibleColsService,this.ctrlsService=e.ctrlsService}setColumnWidths(e,t,i,s){const o=[];e.forEach(r=>{const n=this.columnModel.getColDefCol(r.key)||this.columnModel.getCol(r.key);if(!n)return;if(o.push({width:r.newWidth,ratios:[1],columns:[n]}),this.gos.get("colResizeDefault")==="shift"&&(t=!t),t){const a=this.visibleColsService.getColAfter(n);if(!a)return;const d=n.getActualWidth()-r.newWidth,h=a.getActualWidth()+d;o.push({width:h,ratios:[1],columns:[a]})}}),o.length!==0&&this.resizeColumnSets({resizeSets:o,finished:i,source:s})}resizeColumnSets(e){const{resizeSets:t,finished:i,source:s}=e;if(!(!t||t.every(h=>this.checkMinAndMaxWidthsForSet(h)))){if(i){const h=t&&t.length>0?t[0].columns:null;this.eventDispatcher.columnResized(h,i,s)}return}const r=[],n=[];t.forEach(h=>{const{width:c,columns:u,ratios:g}=h,p={},C={};u.forEach(y=>n.push(y));let f=!0,w=0;for(;f;){if(w++,w>1e3){O("infinite loop in resizeColumnSets");break}f=!1;const y=[];let R=0,P=c;u.forEach((D,E)=>{if(C[D.getId()])P-=p[D.getId()];else{y.push(D);const L=g[E];R+=L}});const M=1/R;y.forEach((D,E)=>{const T=E===y.length-1;let L;T?L=P:(L=Math.round(g[E]*c*M),P-=L);const X=D.getMinWidth(),Ve=D.getMaxWidth();L<X?(L=X,C[D.getId()]=!0,f=!0):Ve>0&&L>Ve&&(L=Ve,C[D.getId()]=!0,f=!0),p[D.getId()]=L})}u.forEach(y=>{const R=p[y.getId()];y.getActualWidth()!==R&&(y.setActualWidth(R,s),r.push(y))})});const l=r.length>0;let a=[];l&&(a=this.refreshFlexedColumns({resizingCols:n,skipSetLeft:!0}),this.visibleColsService.setLeftValues(s),this.visibleColsService.updateBodyWidths(),this.columnViewportService.checkViewportColumns());const d=n.concat(a);(l||i)&&this.eventDispatcher.columnResized(d,i,s,a)}checkMinAndMaxWidthsForSet(e){const{columns:t,width:i}=e;let s=0,o=0,r=!0;t.forEach(a=>{const d=a.getMinWidth();s+=d||0;const h=a.getMaxWidth();h>0?o+=h:r=!1});const n=i>=s,l=!r||i<=o;return n&&l}refreshFlexedColumns(e={}){const t=e.source?e.source:"flex";if(e.viewportWidth!=null&&(this.flexViewportWidth=e.viewportWidth),!this.flexViewportWidth)return[];const i=this.visibleColsService.getCenterCols();let s=-1;if(e.resizingCols){const u=new Set(e.resizingCols);for(let g=i.length-1;g>=0;g--)if(u.has(i[g])){s=g;break}}let o=0,r=[],n=0,l=0;for(let u=0;u<i.length;u++)i[u].getFlex()&&u>s?(r.push(i[u]),l+=i[u].getFlex(),n+=i[u].getMinWidth()):o+=i[u].getActualWidth();if(!r.length)return[];let a=[];o+n>this.flexViewportWidth&&(r.forEach(u=>u.setActualWidth(u.getMinWidth(),t)),a=r,r=[]);const d=[];let h;e:for(;;){h=this.flexViewportWidth-o;const u=h/l;for(let g=0;g<r.length;g++){const p=r[g],C=u*p.getFlex();let f=0;const w=p.getMinWidth(),y=p.getMaxWidth();if(C<w?f=w:C>y&&(f=y),f){p.setActualWidth(f,t),Go(r,p),l-=p.getFlex(),a.push(p),o+=p.getActualWidth();continue e}d[g]=Math.floor(C)}break}let c=h;return r.forEach((u,g)=>{const p=g<r.length-1?Math.min(d[g],c):Math.max(d[g],c);u.setActualWidth(p,t),a.push(u),c-=d[g]}),e.skipSetLeft||this.visibleColsService.setLeftValues(t),e.updateBodyWidths&&this.visibleColsService.updateBodyWidths(),e.fireResizedEvent&&this.eventDispatcher.columnResized(a,!0,t,r),r}sizeColumnsToFit(e,t="sizeColumnsToFit",i,s){var u;if(this.columnModel.isShouldQueueResizeOperations()){this.columnModel.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,i,s));return}const o={};s&&((u=s==null?void 0:s.columnLimits)==null||u.forEach(({key:g,...p})=>{o[typeof g=="string"?g:g.getColId()]=p}));const r=this.visibleColsService.getAllCols(),n=e===Se(r);if(e<=0||!r.length||n)return;const l=[],a=[];r.forEach(g=>{g.getColDef().suppressSizeToFit===!0?a.push(g):l.push(g)});const d=l.slice(0);let h=!1;const c=g=>{Q(l,g),a.push(g)};for(l.forEach(g=>{g.resetActualWidth(t);const p=o==null?void 0:o[g.getId()],C=(p==null?void 0:p.minWidth)??(s==null?void 0:s.defaultMinWidth),f=(p==null?void 0:p.maxWidth)??(s==null?void 0:s.defaultMaxWidth),w=g.getActualWidth();typeof C=="number"&&w<C?g.setActualWidth(C,t,!0):typeof f=="number"&&w>f&&g.setActualWidth(f,t,!0)});!h;){h=!0;const g=e-Se(a);if(g<=0)l.forEach(p=>{var f;const C=((f=o==null?void 0:o[p.getId()])==null?void 0:f.minWidth)??(s==null?void 0:s.defaultMinWidth);if(typeof C=="number"){p.setActualWidth(C,t,!0);return}p.setMinimum(t)});else{const p=g/Se(l);let C=g;for(let f=l.length-1;f>=0;f--){const w=l[f],y=o==null?void 0:o[w.getId()],R=(y==null?void 0:y.minWidth)??(s==null?void 0:s.defaultMinWidth),P=(y==null?void 0:y.maxWidth)??(s==null?void 0:s.defaultMaxWidth),M=w.getMinWidth(),D=w.getMaxWidth(),E=typeof R=="number"&&R>M?R:M,T=typeof P=="number"&&P<D?P:D;let L=Math.round(w.getActualWidth()*p);L<E?(L=E,c(w),h=!1):L>T?(L=T,c(w),h=!1):f===0&&(L=C),w.setActualWidth(L,t,!0),C-=L}}}d.forEach(g=>{g.fireColumnWidthChangedEvent(t)}),this.visibleColsService.setLeftValues(t),this.visibleColsService.updateBodyWidths(),!i&&this.eventDispatcher.columnResized(d,!0,t)}applyAutosizeStrategy(){const e=this.gos.get("autoSizeStrategy");if(!e)return;const{type:t}=e;setTimeout(()=>{if(t==="fitGridWidth"){const{columnLimits:i,defaultMinWidth:s,defaultMaxWidth:o}=e,r=i==null?void 0:i.map(({colId:n,minWidth:l,maxWidth:a})=>({key:n,minWidth:l,maxWidth:a}));this.ctrlsService.getGridBodyCtrl().sizeColumnsToFit({defaultMinWidth:s,defaultMaxWidth:o,columnLimits:r})}else t==="fitProvidedWidth"&&this.sizeColumnsToFit(e.width,"sizeColumnsToFit")})}};function zo(e,t){return e+"_"+t}function W(e){return e instanceof _o}var _o=class extends v{constructor(e,t,i,s){super(),this.isColumn=!1,this.displayedChildren=[],this.autoHeaderHeight=null,this.parent=null,this.groupId=t,this.partId=i,this.providedColumnGroup=e,this.pinned=s}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}setParent(e){this.parent=e}getUniqueId(){return zo(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=I(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&&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(){var e;return!!((e=this.getColGroupDef())!=null&&e.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(i=>{if(W(i)&&(!i.displayedChildren||!i.displayedChildren.length))return;switch(i.getColumnGroupShow()){case"open":e.getProvidedColumnGroup().isExpanded()&&this.displayedChildren.push(i);break;case"closed":e.getProvidedColumnGroup().isExpanded()||this.displayedChildren.push(i);break;default:this.displayedChildren.push(i);break}}),this.dispatchLocalEvent({type:"displayedChildrenChanged"})}},Uo=class{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let i;return typeof t!="number"?i=0:i=t+1,this.existingIds[e]=i,i}},Sl=class extends v{constructor(){super(...arguments),this.beanName="visibleColsService",this.colsAndGroupsMap={},this.columnsLeft=[],this.columnsRight=[],this.columnsCenter=[],this.columns=[],this.bodyWidth=0,this.leftWidth=0,this.rightWidth=0,this.bodyWidthDirty=!0}wireBeans(e){this.columnModel=e.columnModel,this.columnSizeService=e.columnSizeService,this.columnViewportService=e.columnViewportService,this.eventDispatcher=e.columnEventDispatcher}refresh(e,t=!1){t||this.buildTrees(),this.updateOpenClosedVisibilityInColumnGroups(),this.columnsLeft=Fi(this.treeLeft),this.columnsCenter=Fi(this.treeCenter),this.columnsRight=Fi(this.treeRight),this.joinColsAriaOrder(),this.joinCols(),this.setLeftValues(e),this.autoHeightCols=this.columns.filter(i=>i.isAutoHeight()),this.columnSizeService.refreshFlexedColumns(),this.updateBodyWidths(),this.columnViewportService.checkViewportColumns(!1),this.setFirstRightAndLastLeftPinned(e),this.eventDispatcher.visibleCols(e)}updateBodyWidths(){const e=Se(this.columnsCenter),t=Se(this.columnsLeft),i=Se(this.columnsRight);this.bodyWidthDirty=this.bodyWidth!==e,(this.bodyWidth!==e||this.leftWidth!==t||this.rightWidth!==i)&&(this.bodyWidth=e,this.leftWidth=t,this.rightWidth=i,this.eventService.dispatchEvent({type:"columnContainerWidthChanged"}),this.eventService.dispatchEvent({type:"displayedColumnsWidthChanged"}))}setLeftValues(e){this.setLeftValuesOfCols(e),this.setLeftValuesOfGroups()}setFirstRightAndLastLeftPinned(e){let t,i;this.gos.get("enableRtl")?(t=this.columnsLeft?this.columnsLeft[0]:null,i=this.columnsRight?I(this.columnsRight):null):(t=this.columnsLeft?I(this.columnsLeft):null,i=this.columnsRight?this.columnsRight[0]:null),this.columnModel.getCols().forEach(s=>{s.setLastLeftPinned(s===t,e),s.setFirstRightPinned(s===i,e)})}buildTrees(){const e=this.columnModel.getColsToShow(),t=e.filter(r=>r.getPinned()=="left"),i=e.filter(r=>r.getPinned()=="right"),s=e.filter(r=>r.getPinned()!="left"&&r.getPinned()!="right"),o=new Uo;this.treeLeft=this.createGroups({columns:t,idCreator:o,pinned:"left",oldDisplayedGroups:this.treeLeft}),this.treeRight=this.createGroups({columns:i,idCreator:o,pinned:"right",oldDisplayedGroups:this.treeRight}),this.treeCenter=this.createGroups({columns:s,idCreator:o,pinned:null,oldDisplayedGroups:this.treeCenter}),this.updateColsAndGroupsMap()}clear(){this.columnsLeft=[],this.columnsRight=[],this.columnsCenter=[],this.columns=[],this.ariaOrderColumns=[]}joinColsAriaOrder(){const e=this.columnModel.getCols(),t=[],i=[],s=[];for(const o of e){const r=o.getPinned();r?r===!0||r==="left"?t.push(o):s.push(o):i.push(o)}this.ariaOrderColumns=t.concat(i).concat(s)}getAriaColIndex(e){let t;return W(e)?t=e.getLeafColumns()[0]:t=e,this.ariaOrderColumns.indexOf(t)+1}getAllAutoHeightCols(){return this.autoHeightCols}setLeftValuesOfGroups(){[this.treeLeft,this.treeRight,this.treeCenter].forEach(e=>{e.forEach(t=>{W(t)&&t.checkLeft()})})}setLeftValuesOfCols(e){if(!this.columnModel.getColDefCols())return;const i=this.columnModel.getCols().slice(0),s=this.gos.get("enableRtl");[this.columnsLeft,this.columnsRight,this.columnsCenter].forEach(o=>{if(s){let r=Se(o);o.forEach(n=>{r-=n.getActualWidth(),n.setLeft(r,e)})}else{let r=0;o.forEach(n=>{n.setLeft(r,e),r+=n.getActualWidth()})}qn(i,o)}),i.forEach(o=>{o.setLeft(null,e)})}joinCols(){this.gos.get("enableRtl")?this.columns=this.columnsRight.concat(this.columnsCenter).concat(this.columnsLeft):this.columns=this.columnsLeft.concat(this.columnsCenter).concat(this.columnsRight)}getColsCenter(){return this.columnsCenter}getAllTrees(){return this.treeLeft&&this.treeRight&&this.treeCenter?this.treeLeft.concat(this.treeCenter).concat(this.treeRight):null}getTreeLeft(){return this.treeLeft}getTreeRight(){return this.treeRight}getTreeCenter(){return this.treeCenter}getAllCols(){return this.columns}isColDisplayed(e){return this.getAllCols().indexOf(e)>=0}getLeftColsForRow(e){return this.columnModel.isColSpanActive()?this.getColsForRow(e,this.columnsLeft):this.columnsLeft}getRightColsForRow(e){return this.columnModel.isColSpanActive()?this.getColsForRow(e,this.columnsRight):this.columnsRight}getColsForRow(e,t,i,s){const o=[];let r=null;for(let n=0;n<t.length;n++){const l=t[n],a=t.length-n,d=Math.min(l.getColSpan(e),a),h=[l];if(d>1){const u=d-1;for(let g=1;g<=u;g++)h.push(t[n+g]);n+=u}let c;i?(c=!1,h.forEach(u=>{i(u)&&(c=!0)})):c=!0,c&&(o.length===0&&r&&(s&&s(l))&&o.push(r),o.push(l)),r=l}return o}getBodyContainerWidth(){return this.bodyWidth}getContainerWidth(e){switch(e){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}getCenterCols(){return this.columnsCenter}getLeftCols(){return this.columnsLeft}getRightCols(){return this.columnsRight}getColBefore(e){const t=this.getAllCols(),i=t.indexOf(e);return i>0?t[i-1]:null}getGroupAtDirection(e,t){const i=e.getProvidedColumnGroup().getLevel()+e.getPaddingLevel(),s=e.getDisplayedLeafColumns(),o=t==="After"?I(s):s[0],r=`getCol${t}`;for(;;){const n=this[r](o);if(!n)return null;const l=this.getColGroupAtLevel(n,i);if(l!==e)return l}}getColGroupAtLevel(e,t){let i=e.getParent(),s,o;for(;s=i.getProvidedColumnGroup().getLevel(),o=i.getPaddingLevel(),!(s+o<=t);)i=i.getParent();return i}isPinningLeft(){return this.columnsLeft.length>0}isPinningRight(){return this.columnsRight.length>0}updateColsAndGroupsMap(){this.colsAndGroupsMap={};const e=t=>{this.colsAndGroupsMap[t.getUniqueId()]=t};ze(this.treeCenter,!1,e),ze(this.treeLeft,!1,e),ze(this.treeRight,!1,e)}isVisible(e){return this.colsAndGroupsMap[e.getUniqueId()]===e}updateOpenClosedVisibilityInColumnGroups(){const e=this.getAllTrees();ze(e,!1,t=>{W(t)&&t.calculateDisplayedColumns()})}getFirstColumn(){const e=this.gos.get("enableRtl"),t=["getLeftCols","getCenterCols","getRightCols"];e&&t.reverse();for(let i=0;i<t.length;i++){const s=this[t[i]]();if(s.length)return e?I(s):s[0]}return null}getColumnGroup(e,t){if(!e)return null;if(W(e))return e;const i=this.getAllTrees(),s=typeof t=="number";let o=null;return ze(i,!1,r=>{if(W(r)){const n=r;let l;s?l=e===n.getGroupId()&&t===n.getPartId():l=e===n.getGroupId(),l&&(o=n)}}),o}getColAfter(e){const t=this.getAllCols(),i=t.indexOf(e);return i<t.length-1?t[i+1]:null}isBodyWidthDirty(){return this.bodyWidthDirty}setBodyWidthDirty(){this.bodyWidthDirty=!0}getColsLeftWidth(){return Se(this.columnsLeft)}getDisplayedColumnsRightWidth(){return Se(this.columnsRight)}isColAtEdge(e,t){const i=this.getAllCols();if(!i.length)return!1;const s=t==="first";let o;if(W(e)){const r=e.getDisplayedLeafColumns();if(!r.length)return!1;o=s?r[0]:I(r)}else o=e;return(s?i[0]:I(i))===o}createGroups(e){const{columns:t,idCreator:i,pinned:s,oldDisplayedGroups:o,isStandaloneStructure:r}=e,n=this.mapOldGroupsById(o),l=[];let a=t;for(;a.length;){const d=a;a=[];let h=0;const c=u=>{const g=h;h=u;const p=d[g],f=(W(p)?p.getProvidedColumnGroup():p).getOriginalParent();if(f==null){for(let y=g;y<u;y++)l.push(d[y]);return}const w=this.createColGroup(f,i,n,s,r);for(let y=g;y<u;y++)w.addChild(d[y]);a.push(w)};for(let u=1;u<d.length;u++){const g=d[u],C=(W(g)?g.getProvidedColumnGroup():g).getOriginalParent(),f=d[h],y=(W(f)?f.getProvidedColumnGroup():f).getOriginalParent();C!==y&&c(u)}h<d.length&&c(d.length)}return r||this.setupParentsIntoCols(l,null),l}createColGroup(e,t,i,s,o){const r=e.getGroupId(),n=t.getInstanceIdForKey(r),l=zo(r,n);let a=i[l];return a&&a.getProvidedColumnGroup()!==e&&(a=null),F(a)?a.reset():(a=new _o(e,r,n,s),o||this.createBean(a)),a}mapOldGroupsById(e){const t={},i=s=>{s.forEach(o=>{if(W(o)){const r=o;t[o.getUniqueId()]=r,i(r.getChildren())}})};return e&&i(e),t}setupParentsIntoCols(e,t){e.forEach(i=>{if(i.setParent(t),W(i)){const s=i;this.setupParentsIntoCols(s.getChildren(),s)}})}};function ze(e,t,i){if(e)for(let s=0;s<e.length;s++){const o=e[s];if(W(o)){const r=t?o.getDisplayedChildren():o.getChildren();ze(r,t,i)}i(o)}}function Fi(e){const t=[];return ze(e,!0,i=>{Ge(i)&&t.push(i)}),t}var Ko=["columnEverythingChanged","newColumnsLoaded","columnPivotModeChanged","pivotMaxColumnsExceeded","columnRowGroupChanged","expandOrCollapseAll","columnPivotChanged","gridColumnsChanged","columnValueChanged","columnMoved","columnVisible","columnPinned","columnGroupOpened","columnResized","displayedColumnsChanged","virtualColumnsChanged","columnHeaderMouseOver","columnHeaderMouseLeave","columnHeaderClicked","columnHeaderContextMenu","asyncTransactionsFlushed","rowGroupOpened","rowDataUpdated","pinnedRowDataChanged","rangeSelectionChanged","cellSelectionChanged","chartCreated","chartRangeSelectionChanged","chartOptionsChanged","chartDestroyed","toolPanelVisibleChanged","toolPanelSizeChanged","modelUpdated","cutStart","cutEnd","pasteStart","pasteEnd","fillStart","fillEnd","cellSelectionDeleteStart","cellSelectionDeleteEnd","rangeDeleteStart","rangeDeleteEnd","undoStarted","undoEnded","redoStarted","redoEnded","cellClicked","cellDoubleClicked","cellMouseDown","cellContextMenu","cellValueChanged","cellEditRequest","rowValueChanged","headerFocused","cellFocused","rowSelected","selectionChanged","tooltipShow","tooltipHide","cellKeyDown","cellMouseOver","cellMouseOut","filterChanged","filterModified","filterOpened","advancedFilterBuilderVisibleChanged","sortChanged","virtualRowRemoved","rowClicked","rowDoubleClicked","gridReady","gridPreDestroyed","gridSizeChanged","viewportChanged","firstDataRendered","dragStarted","dragStopped","dragCancelled","rowEditingStarted","rowEditingStopped","cellEditingStarted","cellEditingStopped","bodyScroll","bodyScrollEnd","paginationChanged","componentStateChanged","storeRefreshed","stateUpdated","columnMenuVisibleChanged","contextMenuVisibleChanged","rowDragEnter","rowDragMove","rowDragLeave","rowDragEnd","rowDragCancel"],yl=["scrollbarWidthChanged","keyShortcutChangedCellStart","keyShortcutChangedCellEnd","pinnedHeightChanged","cellFocusCleared","fullWidthRowFocused","checkboxChanged","heightScaleChanged","suppressMovableColumns","suppressMenuHide","suppressFieldDotNotation","columnPanelItemDragStart","columnPanelItemDragEnd","bodyHeightChanged","columnContainerWidthChanged","displayedColumnsWidthChanged","scrollVisibilityChanged","scrollGapChanged","columnHoverChanged","flashCells","paginationPixelOffsetChanged","displayedRowsChanged","leftPinnedWidthChanged","rightPinnedWidthChanged","rowContainerHeightChanged","headerHeightChanged","columnGroupHeaderHeightChanged","columnHeaderHeightChanged","gridStylesChanged","storeUpdated","filterDestroyed","rowDataUpdateStarted","rowCountReady","advancedFilterEnabledChanged","dataTypesInferred","fieldValueChanged","fieldPickerValueSelected","richSelectListRowSelected","sideBarUpdated","alignedGridScroll","alignedGridColumn","gridOptionsChanged","chartTitleEdit","recalculateRowBounds","stickyTopOffsetChanged","overlayExclusiveChanged"],Rl=[...Ko,...yl],Fl={enableBrowserTooltips:!0,tooltipTrigger:!0,tooltipMouseTrack:!0,tooltipShowMode:!0,tooltipInteraction:!0,defaultColGroupDef:!0,suppressAutoSize:!0,skipHeaderOnAutoSize:!0,autoSizeStrategy:!0,components:!0,stopEditingWhenCellsLoseFocus:!0,undoRedoCellEditing:!0,undoRedoCellEditingLimit:!0,excelStyles:!0,cacheQuickFilter:!0,advancedFilterModel:!0,customChartThemes:!0,chartThemeOverrides:!0,chartToolPanelsDef:!0,loadingCellRendererSelector:!0,localeText:!0,keepDetailRows:!0,keepDetailRowsCount:!0,detailRowHeight:!0,detailRowAutoHeight:!0,tabIndex:!0,valueCache:!0,valueCacheNeverExpires:!0,enableCellExpressions:!0,suppressTouch:!0,suppressAsyncEvents:!0,suppressBrowserResizeObserver:!0,suppressPropertyNamesCheck:!0,debug:!0,dragAndDropImageComponent:!0,loadingOverlayComponent:!0,suppressLoadingOverlay:!0,noRowsOverlayComponent:!0,paginationPageSizeSelector:!0,paginateChildRows:!0,pivotPanelShow:!0,pivotSuppressAutoColumn:!0,suppressExpandablePivotGroups:!0,aggFuncs:!0,suppressAggFuncInHeader:!0,allowShowChangeAfterFilter:!0,ensureDomOrder:!0,enableRtl:!0,suppressColumnVirtualisation:!0,suppressMaxRenderedRowRestriction:!0,suppressRowVirtualisation:!0,rowDragText:!0,suppressGroupMaintainValueType:!0,groupLockGroupColumns:!0,rowGroupPanelSuppressSort:!0,suppressGroupRowsSticky:!0,rowModelType:!0,cacheOverflowSize:!0,infiniteInitialRowCount:!0,serverSideInitialRowCount:!0,suppressServerSideInfiniteScroll:!0,maxBlocksInCache:!0,maxConcurrentDatasourceRequests:!0,blockLoadDebounceMillis:!0,serverSideOnlyRefreshFilteredGroups:!0,serverSidePivotResultFieldSeparator:!0,viewportRowModelPageSize:!0,viewportRowModelBufferSize:!0,debounceVerticalScrollbar:!0,suppressAnimationFrame:!0,suppressPreventDefaultOnMouseWheel:!0,scrollbarWidth:!0,icons:!0,suppressRowTransform:!0,gridId:!0,enableGroupEdit:!0,initialState:!0,processUnpinnedColumns:!0,createChartContainer:!0,getLocaleText:!0,getRowId:!0,reactiveCustomComponents:!0,columnMenu:!0,suppressSetFilterByDefault:!0},_=class{};_.STRING_PROPERTIES=["overlayLoadingTemplate","overlayNoRowsTemplate","gridId","quickFilterText","rowModelType","editType","domLayout","clipboardDelimiter","rowGroupPanelShow","multiSortKey","pivotColumnGroupTotals","pivotRowTotals","pivotPanelShow","fillHandleDirection","groupDisplayType","treeDataDisplayType","colResizeDefault","tooltipTrigger","serverSidePivotResultFieldSeparator","columnMenu","tooltipShowMode","grandTotalRow"];_.OBJECT_PROPERTIES=["components","rowStyle","context","autoGroupColumnDef","localeText","icons","datasource","dragAndDropImageComponentParams","serverSideDatasource","viewportDatasource","groupRowRendererParams","aggFuncs","fullWidthCellRendererParams","defaultColGroupDef","defaultColDef","defaultCsvExportParams","defaultExcelExportParams","columnTypes","rowClassRules","detailCellRendererParams","loadingCellRendererParams","loadingOverlayComponentParams","noRowsOverlayComponentParams","popupParent","statusBar","sideBar","theme","chartThemeOverrides","customChartThemes","chartToolPanelsDef","dataTypeDefinitions","advancedFilterModel","advancedFilterParent","advancedFilterBuilderParams","initialState","autoSizeStrategy","cellSelection","selectionColumnDef"];_.ARRAY_PROPERTIES=["sortingOrder","alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData","chartThemes","rowClass","paginationPageSizeSelector"];_.NUMBER_PROPERTIES=["rowHeight","detailRowHeight","rowBuffer","headerHeight","groupHeaderHeight","groupLockGroupColumns","floatingFiltersHeight","pivotHeaderHeight","pivotGroupHeaderHeight","groupDefaultExpanded","pivotDefaultExpanded","viewportRowModelPageSize","viewportRowModelBufferSize","autoSizePadding","maxBlocksInCache","maxConcurrentDatasourceRequests","tooltipShowDelay","tooltipHideDelay","cacheOverflowSize","paginationPageSize","cacheBlockSize","infiniteInitialRowCount","serverSideInitialRowCount","scrollbarWidth","asyncTransactionWaitMillis","blockLoadDebounceMillis","keepDetailRowsCount","undoRedoCellEditingLimit","cellFlashDelay","cellFadeDelay","cellFlashDuration","cellFadeDuration","tabIndex","pivotMaxGeneratedColumns"];_.BOOLEAN_PROPERTIES=["suppressMakeColumnVisibleAfterUnGroup","suppressRowClickSelection","suppressCellFocus","suppressHeaderFocus","suppressHorizontalScroll","groupSelectsChildren","alwaysShowHorizontalScroll","alwaysShowVerticalScroll","debug","enableBrowserTooltips","enableCellExpressions","groupIncludeTotalFooter","groupSuppressBlankHeader","suppressMenuHide","suppressRowDeselection","unSortIcon","suppressMultiSort","alwaysMultiSort","singleClickEdit","suppressLoadingOverlay","suppressNoRowsOverlay","suppressAutoSize","skipHeaderOnAutoSize","suppressColumnMoveAnimation","suppressMoveWhenColumnDragging","suppressMovableColumns","suppressFieldDotNotation","enableRangeSelection","enableRangeHandle","enableFillHandle","suppressClearOnFillReduction","deltaSort","suppressTouch","suppressAsyncEvents","allowContextMenuWithControlKey","suppressContextMenu","enableCellChangeFlash","suppressDragLeaveHidesColumns","suppressRowGroupHidesColumns","suppressMiddleClickScrolls","suppressPreventDefaultOnMouseWheel","suppressCopyRowsToClipboard","copyHeadersToClipboard","copyGroupHeadersToClipboard","pivotMode","suppressAggFuncInHeader","suppressColumnVirtualisation","alwaysAggregateAtRootLevel","suppressFocusAfterRefresh","functionsReadOnly","animateRows","groupSelectsFiltered","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","enableRtl","suppressClickEdit","rowDragEntireRow","rowDragManaged","suppressRowDrag","suppressMoveWhenRowDragging","rowDragMultiRow","enableGroupEdit","embedFullWidthRows","suppressPaginationPanel","groupHideOpenParents","groupAllowUnbalanced","pagination","paginationAutoPageSize","suppressScrollOnNewData","suppressScrollWhenPopupsAreOpen","purgeClosedRowNodes","cacheQuickFilter","includeHiddenColumnsInQuickFilter","ensureDomOrder","accentedSort","suppressChangeDetection","valueCache","valueCacheNeverExpires","aggregateOnlyChangedColumns","suppressAnimationFrame","suppressExcelExport","suppressCsvExport","includeHiddenColumnsInAdvancedFilter","suppressMultiRangeSelection","enterNavigatesVerticallyAfterEdit","enterNavigatesVertically","suppressPropertyNamesCheck","rowMultiSelectWithClick","suppressRowHoverHighlight","suppressRowTransform","suppressClipboardPaste","suppressLastEmptyLineOnPaste","enableCharts","suppressMaintainUnsortedOrder","enableCellTextSelection","suppressBrowserResizeObserver","suppressMaxRenderedRowRestriction","excludeChildrenWhenTreeDataFiltering","tooltipMouseTrack","tooltipInteraction","keepDetailRows","paginateChildRows","preventDefaultOnContextMenu","undoRedoCellEditing","allowDragFromColumnsToolPanel","pivotSuppressAutoColumn","suppressExpandablePivotGroups","debounceVerticalScrollbar","detailRowAutoHeight","serverSideSortAllLevels","serverSideEnableClientSideSort","serverSideOnlyRefreshFilteredGroups","serverSideSortOnServer","serverSideFilterOnServer","suppressAggFilteredOnly","showOpenedGroup","suppressClipboardApi","suppressModelUpdateAfterUpdateTransaction","stopEditingWhenCellsLoseFocus","groupMaintainOrder","columnHoverHighlight","readOnlyEdit","suppressRowVirtualisation","enableCellEditingOnBackspace","resetRowDataOnUpdate","removePivotHeaderRowWhenSingleValueColumn","suppressCopySingleCellRanges","suppressGroupRowsSticky","suppressCutToClipboard","suppressServerSideInfiniteScroll","rowGroupPanelSuppressSort","allowShowChangeAfterFilter","enableAdvancedFilter","masterDetail","treeData","suppressGroupMaintainValueType","reactiveCustomComponents","applyQuickFilterBeforePivotOrAgg","suppressServerSideFullWidthLoadingRow","suppressAdvancedFilterEval","loading","maintainColumnOrder","enableStrictPivotColumnOrder","suppressSetFilterByDefault"];_.OTHER_PROPERTIES=["suppressStickyTotalRow","loadThemeGoogleFonts","rowSelection"];_.FUNCTION_PROPERTIES=["doesExternalFilterPass","processPivotResultColDef","processPivotResultColGroupDef","getBusinessKeyForNode","isRowSelectable","rowDragText","groupRowRenderer","dragAndDropImageComponent","fullWidthCellRenderer","loadingCellRenderer","loadingOverlayComponent","noRowsOverlayComponent","detailCellRenderer","quickFilterParser","quickFilterMatcher","getLocaleText","isExternalFilterPresent","getRowHeight","getRowClass","getRowStyle","getContextMenuItems","getMainMenuItems","processRowPostCreate","processCellForClipboard","getGroupRowAgg","isFullWidthRow","sendToClipboard","focusGridInnerElement","navigateToNextHeader","tabToNextHeader","navigateToNextCell","tabToNextCell","processCellFromClipboard","getDocument","postProcessPopup","getChildCount","getDataPath","isRowMaster","postSortRows","processHeaderForClipboard","processUnpinnedColumns","processGroupHeaderForClipboard","paginationNumberFormatter","processDataFromClipboard","getServerSideGroupKey","isServerSideGroup","createChartContainer","getChartToolbarItems","fillOperation","isApplyServerSideTransaction","getServerSideGroupLevelParams","isServerSideGroupOpenByDefault","isGroupOpenByDefault","initialGroupOrderComparator","groupIncludeFooter","loadingCellRendererSelector","getRowId","groupAggFiltering","chartMenuItems","groupTotalRow"];_.ALL_PROPERTIES=[..._.ARRAY_PROPERTIES,..._.OBJECT_PROPERTIES,..._.STRING_PROPERTIES,..._.NUMBER_PROPERTIES,..._.FUNCTION_PROPERTIES,..._.BOOLEAN_PROPERTIES,..._.OTHER_PROPERTIES];var Tt=_,le=class{static getCallbackForEvent(t){return!t||t.length<2?t:"on"+t[0].toUpperCase()+t.substring(1)}};le.VUE_OMITTED_PROPERTY="AG-VUE-OMITTED-PROPERTY";le.PUBLIC_EVENTS=Ko;le.EVENT_CALLBACKS=Rl.map(e=>le.getCallbackForEvent(e));le.BOOLEAN_PROPERTIES=Tt.BOOLEAN_PROPERTIES;le.ALL_PROPERTIES=Tt.ALL_PROPERTIES;le.ALL_PROPERTIES_AND_CALLBACKS=[...le.ALL_PROPERTIES,...le.EVENT_CALLBACKS];le.ALL_PROPERTIES_AND_CALLBACKS_SET=new Set(le.ALL_PROPERTIES_AND_CALLBACKS);var he=le;function bl(e,t){typeof e!="object"&&(e={});const i={...e};return he.ALL_PROPERTIES_AND_CALLBACKS.forEach(o=>{const r=t[o];typeof r<"u"&&r!==he.VUE_OMITTED_PROPERTY&&(i[o]=r)}),i}function $i(e,t){if(!e)return;const i={};let s=!1;if(Object.keys(e).filter(n=>he.ALL_PROPERTIES_AND_CALLBACKS_SET.has(n)).forEach(n=>{i[n]=e[n],s=!0}),!s)return;const o={type:"gridOptionsChanged",options:i};t.dispatchEvent(o);const r={type:"componentStateChanged"};re(i,(n,l)=>{r[n]=l}),t.dispatchEvent(r)}function kt(e,t,i){return i&&e.addDestroyFunc(()=>t.destroyBean(i)),i??e}var Pl=class{constructor(e){this.cssClassStates={},this.getGui=e}addCssClass(e){const t=(e||"").split(" ");if(t.length>1){t.forEach(s=>this.addCssClass(s));return}if(this.cssClassStates[e]!==!0&&e.length){const s=this.getGui();s&&s.classList.add(e),this.cssClassStates[e]=!0}}removeCssClass(e){const t=(e||"").split(" ");if(t.length>1){t.forEach(s=>this.removeCssClass(s));return}if(this.cssClassStates[e]!==!1&&e.length){const s=this.getGui();s&&s.classList.remove(e),this.cssClassStates[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 s=(e||"").split(" ");if(s.length>1){s.forEach(o=>this.addOrRemoveCssClass(o,t));return}}if(this.cssClassStates[e]!==t&&e.length){const s=this.getGui();s&&s.classList.toggle(e,t),this.cssClassStates[e]=t}}};function Ee(e,t,i){i==null||typeof i=="string"&&i==""?$o(e,t):ge(e,t,i)}function ge(e,t,i){e.setAttribute(jo(t),i.toString())}function $o(e,t){e.removeAttribute(jo(t))}function jo(e){return`aria-${e}`}function ee(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function Dl(e){let t;return e==="asc"?t="ascending":e==="desc"?t="descending":e==="mixed"?t="other":t="none",t}function El(e){return e.getAttribute("aria-label")}function dt(e,t){Ee(e,"label",t)}function It(e,t){Ee(e,"labelledby",t)}function qo(e,t){Ee(e,"live",t)}function Ml(e,t){Ee(e,"atomic",t)}function xl(e,t){Ee(e,"relevant",t)}function Al(e,t){Ee(e,"disabled",t)}function Yo(e,t){Ee(e,"hidden",t)}function ii(e,t){ge(e,"expanded",t)}function Tl(e,t){ge(e,"setsize",t)}function Il(e,t){ge(e,"posinset",t)}function Ll(e,t){ge(e,"multiselectable",t)}function Ol(e,t){ge(e,"rowcount",t)}function Qo(e,t){ge(e,"rowindex",t)}function Gl(e,t){ge(e,"colcount",t)}function Xo(e,t){ge(e,"colindex",t)}function kl(e,t){ge(e,"colspan",t)}function Hl(e,t){ge(e,"sort",t)}function Vl(e){$o(e,"sort")}function si(e,t){Ee(e,"selected",t)}function Nl(e,t){Ee(e,"controls",t.id),It(t,e.id)}function Cs(e,t){return t===void 0?e("ariaIndeterminate","indeterminate"):t===!0?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}var bi,Nt,Pi,Di,Ei,Mi,ji,qi,xi;function we(){return bi===void 0&&(bi=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),bi}function Jo(){if(Nt===void 0)if(we()){const e=navigator.userAgent.match(/version\/(\d+)/i);e&&(Nt=e[1]!=null?parseFloat(e[1]):0)}else Nt=0;return Nt}function ms(){if(Pi===void 0){const e=window;Pi=!!e.chrome&&(!!e.chrome.webstore||!!e.chrome.runtime)||/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}return Pi}function vs(){return Di===void 0&&(Di=/(firefox)/i.test(navigator.userAgent)),Di}function Zo(){return Ei===void 0&&(Ei=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),Ei}function He(){return Mi===void 0&&(Mi=/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1),Mi}function Yi(){return!we()||Jo()>=15}function Qi(e){if(!e)return null;const t=e.tabIndex,i=e.getAttribute("tabIndex");return t===-1&&(i===null||i===""&&!vs())?null:t.toString()}function Bl(){if(xi!==void 0)return xi;if(!document.body)return-1;let e=1e6;const t=vs()?6e6:1e9,i=document.createElement("div");for(document.body.appendChild(i);;){const s=e*2;if(i.style.height=s+"px",s>t||i.clientHeight!==s)break;e=s}return document.body.removeChild(i),xi=e,e}function Wl(){var e,t;return((e=document.body)==null?void 0:e.clientWidth)??(window.innerHeight||((t=document.documentElement)==null?void 0:t.clientWidth)||-1)}function zl(){var e,t;return((e=document.body)==null?void 0:e.clientHeight)??(window.innerHeight||((t=document.documentElement)==null?void 0:t.clientHeight)||-1)}function _l(){return qi==null&&er(),qi}function er(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let i=t.offsetWidth-t.clientWidth;i===0&&t.clientWidth===0&&(i=null),t.parentNode&&t.parentNode.removeChild(t),i!=null&&(qi=i,ji=i===0)}function tr(){return ji==null&&er(),ji}var Bt,Ul="[tabindex], input, select, button, textarea, [href]",ir="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function ws(e){const t=Element.prototype.matches||Element.prototype.msMatchesSelector,i="input, select, button, textarea",s=t.call(e,i),o=t.call(e,ir),r=ue(e);return s&&!o&&r}function H(e,t,i={}){const{skipAriaHidden:s}=i;e.classList.toggle("ag-hidden",!t),s||Yo(e,!t)}function Kl(e,t,i={}){const{skipAriaHidden:s}=i;e.classList.toggle("ag-invisible",!t),s||Yo(e,!t)}function Lt(e,t){const i="disabled",s=t?o=>o.setAttribute(i,""):o=>o.removeAttribute(i);s(e),dr(e.querySelectorAll("input"),o=>s(o))}function rt(e,t,i){let s=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,typeof i=="number"){if(++s>i)break}else if(e===i)break}return!1}function Xe(e){const{height:t,width:i,borderTopWidth:s,borderRightWidth:o,borderBottomWidth:r,borderLeftWidth:n,paddingTop:l,paddingRight:a,paddingBottom:d,paddingLeft:h,marginTop:c,marginRight:u,marginBottom:g,marginLeft:p,boxSizing:C}=window.getComputedStyle(e);return{height:parseFloat(t||"0"),width:parseFloat(i||"0"),borderTopWidth:parseFloat(s||"0"),borderRightWidth:parseFloat(o||"0"),borderBottomWidth:parseFloat(r||"0"),borderLeftWidth:parseFloat(n||"0"),paddingTop:parseFloat(l||"0"),paddingRight:parseFloat(a||"0"),paddingBottom:parseFloat(d||"0"),paddingLeft:parseFloat(h||"0"),marginTop:parseFloat(c||"0"),marginRight:parseFloat(u||"0"),marginBottom:parseFloat(g||"0"),marginLeft:parseFloat(p||"0"),boxSizing:C}}function Ss(e){const t=Xe(e);return t.boxSizing==="border-box"?t.height-t.paddingTop-t.paddingBottom:t.height}function Ht(e){const t=Xe(e);return t.boxSizing==="border-box"?t.width-t.paddingLeft-t.paddingRight:t.width}function sr(e){const{height:t,marginBottom:i,marginTop:s}=Xe(e);return Math.floor(t+i+s)}function oi(e){const{width:t,marginLeft:i,marginRight:s}=Xe(e);return Math.floor(t+i+s)}function or(e){const t=e.getBoundingClientRect(),{borderTopWidth:i,borderLeftWidth:s,borderRightWidth:o,borderBottomWidth:r}=Xe(e);return{top:t.top+(i||0),left:t.left+(s||0),right:t.right+(o||0),bottom:t.bottom+(r||0)}}function ri(){if(typeof Bt=="boolean")return Bt;const e=document.createElement("div");return e.style.direction="rtl",e.style.width="1px",e.style.height="1px",e.style.position="fixed",e.style.top="0px",e.style.overflow="hidden",e.dir="rtl",e.innerHTML=`<div style="width: 2px"> <span style="display: inline-block; width: 1px"></span> <span style="display: inline-block; width: 1px"></span> </div>`,document.body.appendChild(e),e.scrollLeft=1,Bt=Math.floor(e.scrollLeft)===0,document.body.removeChild(e),Bt}function ni(e,t){let i=e.scrollLeft;return t&&(i=Math.abs(i),ms()&&!ri()&&(i=e.scrollWidth-e.getBoundingClientRect().width-i)),i}function li(e,t,i){i&&(ri()?t*=-1:(we()||ms())&&(t=e.scrollWidth-e.getBoundingClientRect().width-t)),e.scrollLeft=t}function U(e){for(;e&&e.firstChild;)e.removeChild(e.firstChild)}function Ce(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function rr(e){return!!e.offsetParent}function ue(e){const t=e;return t.checkVisibility?t.checkVisibility({checkVisibilityCSS:!0}):!(!rr(e)||window.getComputedStyle(e).visibility!=="visible")}function Ot(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function nr(e,t,i){i&&i.nextSibling===t||(i?i.nextSibling?e.insertBefore(t,i.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.insertAdjacentElement("afterbegin",t))}function lr(e,t){for(let i=0;i<t.length;i++){const s=t[i],o=e.children[i];o!==s&&e.insertBefore(s,o)}}function $l(e,t,i){i?i.insertAdjacentElement("afterend",t):e.firstChild?e.insertAdjacentElement("afterbegin",t):e.appendChild(t)}function ar(e,t){if(t)for(const[i,s]of Object.entries(t)){if(!i||!i.length||s==null)continue;const o=Cl(i),r=s.toString(),n=r.replace(/\s*!important/g,""),l=n.length!=r.length?"important":void 0;e.style.setProperty(o,n,l)}}function jl(e){return e.clientWidth<e.scrollWidth}function ql(e){return e.clientHeight<e.scrollHeight}function ai(e,t){t==="flex"?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):ce(e,t)}function ce(e,t){t=ys(t),e.style.width=t.toString(),e.style.maxWidth=t.toString(),e.style.minWidth=t.toString()}function Ft(e,t){t=ys(t),e.style.height=t.toString(),e.style.maxHeight=t.toString(),e.style.minHeight=t.toString()}function ys(e){return typeof e=="number"?`${e}px`:e}function Rs(e){return e instanceof Node||e instanceof HTMLElement}function Yl(e){if(e==null)return[];const t=[];return dr(e,i=>t.push(i)),t}function Ql(e,t){if(e)for(let i=0;i<e.length;i++){const s=e[i];t(s.name,s.value)}}function ae(e,t,i){i==null||i===""?e.removeAttribute(t):e.setAttribute(t,i.toString())}function dr(e,t){if(e!=null)for(let i=0;i<e.length;i++)t(e[i])}var ht=class{constructor(e=0,t=1){this.nextValue=e,this.step=t}next(){const e=this.nextValue;return this.nextValue+=this.step,e}peek(){return this.nextValue}skip(e){this.nextValue+=e}},Xl=1e3,Jl=1e3,io=100,hr=class Ne extends v{constructor(t,i,s,o){super(),this.parentComp=t,this.tooltipShowDelayOverride=i,this.tooltipHideDelayOverride=s,this.shouldDisplayTooltip=o,this.interactionEnabled=!1,this.isInteractingWithTooltip=!1,this.state=0,this.tooltipInstanceCount=0,this.tooltipMouseTrack=!1}wireBeans(t){this.popupService=t.popupService,this.userComponentFactory=t.userComponentFactory}postConstruct(){this.gos.get("tooltipInteraction")&&(this.interactionEnabled=!0),this.tooltipTrigger=this.getTooltipTrigger(),this.tooltipMouseTrack=this.gos.get("tooltipMouseTrack");const t=this.parentComp.getGui();this.tooltipTrigger===0&&this.addManagedListeners(t,{mouseenter:this.onMouseEnter.bind(this),mouseleave:this.onMouseLeave.bind(this)}),this.tooltipTrigger===1&&this.addManagedListeners(t,{focusin:this.onFocusIn.bind(this),focusout:this.onFocusOut.bind(this)}),this.addManagedListeners(t,{mousemove:this.onMouseMove.bind(this)}),this.interactionEnabled||this.addManagedListeners(t,{mousedown:this.onMouseDown.bind(this),keydown:this.onKeyDown.bind(this)})}getGridOptionsTooltipDelay(t){const i=this.gos.get(t);return i<0&&S(`${t} should not be lower than 0`),Math.max(200,i)}getTooltipDelay(t){return t==="show"?this.tooltipShowDelayOverride??this.getGridOptionsTooltipDelay("tooltipShowDelay"):this.tooltipHideDelayOverride??this.getGridOptionsTooltipDelay("tooltipHideDelay")}destroy(){this.setToDoNothing(),super.destroy()}getTooltipTrigger(){const t=this.gos.get("tooltipTrigger");return!t||t==="hover"?0:1}onMouseEnter(t){this.interactionEnabled&&this.interactiveTooltipTimeoutId&&(this.unlockService(),this.startHideTimeout()),!He()&&(Ne.isLocked?this.showTooltipTimeoutId=window.setTimeout(()=>{this.prepareToShowTooltip(t)},io):this.prepareToShowTooltip(t))}onMouseMove(t){this.lastMouseEvent&&(this.lastMouseEvent=t),this.tooltipMouseTrack&&this.state===2&&this.tooltipComp&&this.positionTooltip()}onMouseDown(){this.setToDoNothing()}onMouseLeave(){this.interactionEnabled?this.lockService():this.setToDoNothing()}onFocusIn(){this.prepareToShowTooltip()}onFocusOut(t){var r;const i=t.relatedTarget,s=this.parentComp.getGui(),o=(r=this.tooltipComp)==null?void 0:r.getGui();this.isInteractingWithTooltip||s.contains(i)||this.interactionEnabled&&(o!=null&&o.contains(i))||this.setToDoNothing()}onKeyDown(){this.isInteractingWithTooltip&&(this.isInteractingWithTooltip=!1),this.setToDoNothing()}prepareToShowTooltip(t){if(this.state!=0||Ne.isLocked)return;let i=0;t&&(i=this.isLastTooltipHiddenRecently()?200:this.getTooltipDelay("show")),this.lastMouseEvent=t||null,this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),i),this.state=1}isLastTooltipHiddenRecently(){const t=new Date().getTime(),i=Ne.lastTooltipHideTime;return t-i<Xl}setToDoNothing(t){!t&&this.state===2&&this.hideTooltip(),this.onBodyScrollEventCallback&&(this.onBodyScrollEventCallback(),this.onBodyScrollEventCallback=void 0),this.onColumnMovedEventCallback&&(this.onColumnMovedEventCallback(),this.onColumnMovedEventCallback=void 0),this.onDocumentKeyDownCallback&&(this.onDocumentKeyDownCallback(),this.onDocumentKeyDownCallback=void 0),this.clearTimeouts(),this.state=0,this.lastMouseEvent=null}showTooltip(){const t={...this.parentComp.getTooltipParams()};if(!F(t.value)||this.shouldDisplayTooltip&&!this.shouldDisplayTooltip()){this.setToDoNothing();return}this.state=2,this.tooltipInstanceCount++;const i=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);this.userComponentFactory.getTooltipCompDetails(t).newAgStackInstance().then(i)}hideTooltip(t){!t&&this.isInteractingWithTooltip||(this.tooltipComp&&(this.destroyTooltipComp(),Ne.lastTooltipHideTime=new Date().getTime()),this.eventService.dispatchEvent({type:"tooltipHide",parentGui:this.parentComp.getGui()}),t&&(this.isInteractingWithTooltip=!1),this.setToDoNothing(!0))}newTooltipComponentCallback(t,i){if(this.state!==2||this.tooltipInstanceCount!==t){this.destroyBean(i);return}const o=i.getGui();this.tooltipComp=i,o.classList.contains("ag-tooltip")||o.classList.add("ag-tooltip-custom"),this.tooltipTrigger===0&&o.classList.add("ag-tooltip-animate"),this.interactionEnabled&&o.classList.add("ag-tooltip-interactive");const r=this.localeService.getLocaleTextFunc(),n=this.popupService.addPopup({eChild:o,ariaLabel:r("ariaLabelTooltip","Tooltip")});if(n&&(this.tooltipPopupDestroyFunc=n.hideFunc),this.positionTooltip(),this.tooltipTrigger===1){const l=()=>this.setToDoNothing();[this.onBodyScrollEventCallback,this.onColumnMovedEventCallback]=this.addManagedEventListeners({bodyScroll:l,columnMoved:l})}this.interactionEnabled&&([this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener]=this.addManagedElementListeners(o,{mouseenter:this.onTooltipMouseEnter.bind(this),mouseleave:this.onTooltipMouseLeave.bind(this)}),[this.onDocumentKeyDownCallback]=this.addManagedElementListeners(B(this.gos),{keydown:l=>{o.contains(l==null?void 0:l.target)||this.onKeyDown()}}),this.tooltipTrigger===1&&([this.tooltipFocusInListener,this.tooltipFocusOutListener]=this.addManagedElementListeners(o,{focusin:this.onTooltipFocusIn.bind(this),focusout:this.onTooltipFocusOut.bind(this)}))),this.eventService.dispatchEvent({type:"tooltipShow",tooltipGui:o,parentGui:this.parentComp.getGui()}),this.startHideTimeout()}onTooltipMouseEnter(){this.isInteractingWithTooltip=!0,this.unlockService()}onTooltipMouseLeave(){this.isTooltipFocused()||(this.isInteractingWithTooltip=!1,this.lockService())}onTooltipFocusIn(){this.isInteractingWithTooltip=!0}isTooltipFocused(){var s;const t=(s=this.tooltipComp)==null?void 0:s.getGui(),i=V(this.gos);return!!t&&t.contains(i)}onTooltipFocusOut(t){const i=this.parentComp.getGui();this.isTooltipFocused()||(this.isInteractingWithTooltip=!1,i.contains(t.relatedTarget)?this.startHideTimeout():this.hideTooltip())}positionTooltip(){const t={type:"tooltip",ePopup:this.tooltipComp.getGui(),nudgeY:18,skipObserver:this.tooltipMouseTrack};this.lastMouseEvent?this.popupService.positionPopupUnderMouseEvent({...t,mouseEvent:this.lastMouseEvent}):this.popupService.positionPopupByComponent({...t,eventSource:this.parentComp.getGui(),position:"under",keepWithinBounds:!0,nudgeY:5})}destroyTooltipComp(){this.tooltipComp.getGui().classList.add("ag-tooltip-hiding");const t=this.tooltipPopupDestroyFunc,i=this.tooltipComp,s=this.tooltipTrigger===0?Jl:0;window.setTimeout(()=>{t(),this.destroyBean(i)},s),this.clearTooltipListeners(),this.tooltipPopupDestroyFunc=void 0,this.tooltipComp=void 0}clearTooltipListeners(){[this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener,this.tooltipFocusInListener,this.tooltipFocusOutListener].forEach(t=>{t&&t()}),this.tooltipMouseEnterListener=this.tooltipMouseLeaveListener=this.tooltipFocusInListener=this.tooltipFocusOutListener=null}lockService(){Ne.isLocked=!0,this.interactiveTooltipTimeoutId=window.setTimeout(()=>{this.unlockService(),this.setToDoNothing()},io)}unlockService(){Ne.isLocked=!1,this.clearInteractiveTimeout()}startHideTimeout(){this.clearHideTimeout(),this.hideTooltipTimeoutId=window.setTimeout(this.hideTooltip.bind(this),this.getTooltipDelay("hide"))}clearShowTimeout(){this.showTooltipTimeoutId&&(window.clearTimeout(this.showTooltipTimeoutId),this.showTooltipTimeoutId=void 0)}clearHideTimeout(){this.hideTooltipTimeoutId&&(window.clearTimeout(this.hideTooltipTimeoutId),this.hideTooltipTimeoutId=void 0)}clearInteractiveTimeout(){this.interactiveTooltipTimeoutId&&(window.clearTimeout(this.interactiveTooltipTimeoutId),this.interactiveTooltipTimeoutId=void 0)}clearTimeouts(){this.clearShowTimeout(),this.clearHideTimeout(),this.clearInteractiveTimeout()}};hr.isLocked=!1;var Zl=hr,gt=class extends v{constructor(e,t){super(),this.ctrl=e,t&&(this.beans=t)}wireBeans(e){this.beans=e}postConstruct(){this.refreshToolTip()}setBrowserTooltip(e){const t="title",i=this.ctrl.getGui();i&&(e!=null&&e!=""?i.setAttribute(t,e):i.removeAttribute(t))}updateTooltipText(){this.tooltip=this.ctrl.getTooltipValue()}createTooltipFeatureIfNeeded(){var t,i,s,o;if(this.tooltipManager!=null)return;const e={getTooltipParams:()=>this.getTooltipParams(),getGui:()=>this.ctrl.getGui()};this.tooltipManager=this.createBean(new Zl(e,(i=(t=this.ctrl).getTooltipShowDelayOverride)==null?void 0:i.call(t),(o=(s=this.ctrl).getTooltipHideDelayOverride)==null?void 0:o.call(s),this.ctrl.shouldDisplayTooltip),this.beans.context)}refreshToolTip(){this.browserTooltips=this.beans.gos.get("enableBrowserTooltips"),this.updateTooltipText(),this.browserTooltips?(this.setBrowserTooltip(this.tooltip),this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context))):(this.setBrowserTooltip(null),this.createTooltipFeatureIfNeeded())}getTooltipParams(){var o,r,n,l,a;const e=this.ctrl,t=(o=e.getColumn)==null?void 0:o.call(e),i=(r=e.getColDef)==null?void 0:r.call(e),s=(n=e.getRowNode)==null?void 0:n.call(e);return{location:e.getLocation(),colDef:i,column:t,rowIndex:(l=e.getRowIndex)==null?void 0:l.call(e),node:s,data:s==null?void 0:s.data,value:this.getTooltipText(),valueFormatted:(a=e.getValueFormatted)==null?void 0:a.call(e),hideTooltipCallback:()=>{var d;return(d=this.tooltipManager)==null?void 0:d.hideTooltip(!0)}}}getTooltipText(){return this.tooltip}destroy(){this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context)),super.destroy()}},ea=new ht,b=null,G=class cr extends v{constructor(t,i){super(),this.suppressDataRefValidation=!1,this.displayed=!0,this.visible=!0,this.compId=ea.next(),this.cssClassManager=new Pl(()=>this.eGui),this.componentSelectors=new Map((i??[]).map(s=>[s.selector,s])),t&&this.setTemplate(t)}preWireBeans(t){super.preWireBeans(t)}preConstruct(){this.usingBrowserTooltips=this.gos.get("enableBrowserTooltips"),this.wireTemplate(this.getGui())}wireTemplate(t,i){t&&this.gos&&(this.applyElementsToComponent(t),this.createChildComponentsFromTags(t,i))}getCompId(){return this.compId}getTooltipParams(){return{value:this.tooltipText,location:"UNKNOWN"}}setTooltip(t){const{newTooltipText:i,showDelayOverride:s,hideDelayOverride:o,location:r,shouldDisplayTooltip:n}=t||{};this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),this.tooltipText!==i&&(this.tooltipText=i);const l=()=>this.tooltipText;i!=null&&(this.tooltipFeature=this.createBean(new gt({getTooltipValue:l,getGui:()=>this.getGui(),getLocation:()=>r??"UNKNOWN",getColDef:t==null?void 0:t.getColDef,getColumn:t==null?void 0:t.getColumn,getTooltipShowDelayOverride:s!=null?()=>s:void 0,getTooltipHideDelayOverride:o!=null?()=>o:void 0,shouldDisplayTooltip:n})))}getDataRefAttribute(t){return t.getAttribute?t.getAttribute("data-ref"):null}applyElementsToComponent(t,i,s,o=null){if(i===void 0&&(i=this.getDataRefAttribute(t)),i){const r=this[i];if(r===b)this[i]=o??t;else{const n=s&&s[i];!this.suppressDataRefValidation&&!n&&S(`Issue with data-ref: ${i} on ${this.constructor.name} with ${r}`)}}}createChildComponentsFromTags(t,i){Yl(t.childNodes).forEach(o=>{if(!(o instanceof HTMLElement))return;const r=this.createComponentFromElement(o,n=>{n.getGui()&&this.copyAttributesFromNode(o,n.getGui())},i);if(r){if(r.addItems&&o.children.length){this.createChildComponentsFromTags(o,i);const n=Array.prototype.slice.call(o.children);r.addItems(n)}this.swapComponentForNode(r,t,o)}else o.childNodes&&this.createChildComponentsFromTags(o,i)})}createComponentFromElement(t,i,s){const o=t.nodeName,r=this.getDataRefAttribute(t),n=o.indexOf("AG-")===0,l=n?this.componentSelectors.get(o):null;let a=null;if(l){cr.elementGettingCreated=t;const d=s&&r?s[r]:void 0;a=new l.component(d),a.setParentComponent(this),this.createBean(a,null,i)}else n&&S(`Missing selector: ${o}`);return this.applyElementsToComponent(t,r,s,a),a}copyAttributesFromNode(t,i){Ql(t.attributes,(s,o)=>i.setAttribute(s,o))}swapComponentForNode(t,i,s){const o=t.getGui();i.replaceChild(o,s),i.insertBefore(document.createComment(s.nodeName),o),this.addDestroyFunc(this.destroyBean.bind(this,t))}activateTabIndex(t){const i=this.gos.get("tabIndex");t||(t=[]),t.length||t.push(this.getGui()),t.forEach(s=>s.setAttribute("tabindex",i.toString()))}setTemplate(t,i,s){const o=Ot(t);this.setTemplateFromElement(o,i,s)}setTemplateFromElement(t,i,s,o=!1){if(this.eGui=t,this.suppressDataRefValidation=o,i)for(let r=0;r<i.length;r++){const n=i[r];this.componentSelectors.set(n.selector,n)}this.wireTemplate(t,s)}getGui(){return this.eGui}getFocusableElement(){return this.eGui}getAriaElement(){return this.getFocusableElement()}setParentComponent(t){this.parentComponent=t}getParentComponent(){return this.parentComponent}setGui(t){this.eGui=t}queryForHtmlElement(t){return this.eGui.querySelector(t)}getContainerAndElement(t,i){let s=i;return t==null?null:(s||(s=this.eGui),Rs(t)?{element:t,parent:s}:{element:t.getGui(),parent:s})}prependChild(t,i){const{element:s,parent:o}=this.getContainerAndElement(t,i)||{};!s||!o||o.insertAdjacentElement("afterbegin",s)}appendChild(t,i){const{element:s,parent:o}=this.getContainerAndElement(t,i)||{};!s||!o||o.appendChild(s)}isDisplayed(){return this.displayed}setVisible(t,i={}){if(t!==this.visible){this.visible=t;const{skipAriaHidden:s}=i;Kl(this.eGui,t,{skipAriaHidden:s})}}setDisplayed(t,i={}){if(t!==this.displayed){this.displayed=t;const{skipAriaHidden:s}=i;H(this.eGui,t,{skipAriaHidden:s});const o={type:"displayChanged",visible:this.displayed};this.dispatchLocalEvent(o)}}destroy(){this.parentComponent&&(this.parentComponent=void 0),this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),super.destroy()}addGuiEventListener(t,i,s){this.eGui.addEventListener(t,i,s),this.addDestroyFunc(()=>this.eGui.removeEventListener(t,i))}addCssClass(t){this.cssClassManager.addCssClass(t)}removeCssClass(t){this.cssClassManager.removeCssClass(t)}containsCssClass(t){return this.cssClassManager.containsCssClass(t)}addOrRemoveCssClass(t,i){this.cssClassManager.addOrRemoveCssClass(t,i)}},ur={columnGroupOpened:"expanded",columnGroupClosed:"contracted",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate",columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",groupContracted:"tree-closed",groupExpanded:"tree-open",setFilterGroupClosed:"tree-closed",setFilterGroupOpen:"tree-open",setFilterGroupIndeterminate:"tree-indeterminate",chart:"chart",close:"cross",cancel:"cancel",check:"tick",first:"first",previous:"previous",next:"next",last:"last",linked:"linked",unlinked:"unlinked",colorPicker:"color-picker",groupLoading:"loading",menu:"menu",menuAlt:"menu-alt",filter:"filter",columns:"columns",maximize:"maximize",minimize:"minimize",menuPin:"pin",menuValue:"aggregation",menuAddRowGroup:"group",menuRemoveRowGroup:"group",clipboardCopy:"copy",clipboardCut:"cut",clipboardPaste:"paste",pivotPanel:"pivot",rowGroupPanel:"group",valuePanel:"aggregation",columnDrag:"grip",rowDrag:"grip",save:"save",csvExport:"csv",excelExport:"excel",smallDown:"small-down",smallLeft:"small-left",smallRight:"small-right",smallUp:"small-up",sortAscending:"asc",sortDescending:"desc",sortUnSort:"none",advancedFilterBuilder:"group",advancedFilterBuilderDrag:"grip",advancedFilterBuilderInvalid:"not-allowed",advancedFilterBuilderMoveUp:"up",advancedFilterBuilderMoveDown:"down",advancedFilterBuilderAdd:"plus",advancedFilterBuilderRemove:"minus",chartsMenuEdit:"chart",chartsMenuAdvancedSettings:"settings",chartsMenuAdd:"plus",checkboxChecked:"checkbox-checked",checkboxIndeterminate:"checkbox-indeterminate",checkboxUnchecked:"checkbox-unchecked",radioButtonOn:"radio-button-on",radioButtonOff:"radio-button-off"},ta=(()=>{const e=new Set(Object.values(ur));return e.add("eye"),e})();function ia(e,t,i){const s=ie(e,t,i);if(s){const{className:r}=s;if(typeof r=="string"&&r.indexOf("ag-icon")>-1||typeof r=="object"&&r["ag-icon"])return s}const o=document.createElement("span");return o.appendChild(s),o}function ie(e,t,i,s){let o=null;const r=i&&i.getColDef().icons;if(r&&(o=r[e]),t&&!o){const n=t.get("icons");n&&(o=n[e])}if(o){let n;if(typeof o=="function")n=o();else if(typeof o=="string")n=o;else throw new Error("icon from grid options needs to be a string or a function");if(typeof n=="string")return Ot(n);if(Rs(n))return n;S("iconRenderer should return back a string or a dom object")}else{const n=document.createElement("span");let l=ur[e]??(ta.has(e)?e:void 0);return l||(s?l=e:(S(`Did not find icon ${e}`),l="")),n.setAttribute("class",`ag-icon ag-icon-${l}`),n.setAttribute("unselectable","on"),ee(n,"presentation"),n}}var sa=class extends G{constructor(){super(...arguments),this.dragSource=null,this.eIcon=b,this.eLabel=b}postConstruct(){const e=t=>ia(t,this.gos,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(`<div class="ag-dnd-ghost ag-unselectable"> <span data-ref="eIcon" class="ag-dnd-ghost-icon ag-shake-left-to-right"></span> <div data-ref="eLabel" class="ag-dnd-ghost-label"></div> </div>`)}destroy(){this.dragSource=null,super.destroy()}setIcon(e,t=!1){var s,o;U(this.eIcon);let i=null;e||(e=(s=this.dragSource)!=null&&s.getDefaultIconName?(o=this.dragSource)==null?void 0:o.getDefaultIconName():"notAllowed"),i=this.dropIconMap[e],this.eIcon.classList.toggle("ag-shake-left-to-right",t),!(i===this.dropIconMap.hide&&this.gos.get("suppressDragLeaveHidesColumns"))&&i&&this.eIcon.appendChild(i)}setLabel(e){this.eLabel.textContent=me(e)}};function gr(e,t,i){if(i===0)return!1;const s=Math.abs(e.clientX-t.clientX),o=Math.abs(e.clientY-t.clientY);return Math.max(s,o)<=i}var Ie=class{constructor(e,t=!1){this.DOUBLE_TAP_MILLIS=500,this.destroyFuncs=[],this.touching=!1,this.localEventService=new ct,this.eElement=e,this.preventMouseClick=t;const i=this.onTouchStart.bind(this),s=this.onTouchMove.bind(this),o=this.onTouchEnd.bind(this);this.eElement.addEventListener("touchstart",i,{passive:!0}),this.eElement.addEventListener("touchmove",s,{passive:!0}),this.eElement.addEventListener("touchend",o,{passive:!1}),this.destroyFuncs.push(()=>{this.eElement.removeEventListener("touchstart",i,{passive:!0}),this.eElement.removeEventListener("touchmove",s,{passive:!0}),this.eElement.removeEventListener("touchend",o,{passive:!1})})}getActiveTouch(e){for(let t=0;t<e.length;t++)if(e[t].identifier===this.touchStart.identifier)return e[t];return null}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}onTouchStart(e){if(this.touching)return;this.touchStart=e.touches[0],this.touching=!0,this.moved=!1;const t=this.touchStart;window.setTimeout(()=>{const i=this.touchStart===t;if(this.touching&&i&&!this.moved){this.moved=!0;const s={type:"longTap",touchStart:this.touchStart,touchEvent:e};this.localEventService.dispatchEvent(s)}},500)}onTouchMove(e){if(!this.touching)return;const t=this.getActiveTouch(e.touches);if(!t)return;!gr(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 i={type:"doubleTap",touchStart:this.touchStart};this.localEventService.dispatchEvent(i),this.lastTapTime=null}else this.lastTapTime=e;else this.lastTapTime=e}destroy(){this.destroyFuncs.forEach(e=>e())}};function Ct(e,t){return`<span data-ref="eSort${e}" class="ag-sort-indicator-icon ag-sort-${t} ag-hidden" aria-hidden="true"></span>`}var oa=`<span class="ag-sort-indicator-container"> ${Ct("Order","order")} ${Ct("Asc","ascending-icon")} ${Ct("Desc","descending-icon")} ${Ct("Mixed","mixed-icon")} ${Ct("None","none-icon")} </span>`,Fs=class extends G{constructor(e){super(),this.eSortOrder=b,this.eSortAsc=b,this.eSortDesc=b,this.eSortMixed=b,this.eSortNone=b,e||this.setTemplate(oa)}wireBeans(e){this.sortController=e.sortController}attachCustomElements(e,t,i,s,o){this.eSortOrder=e,this.eSortAsc=t,this.eSortDesc=i,this.eSortMixed=s,this.eSortNone=o}setupSort(e,t=!1){if(this.column=e,this.suppressOrder=t,this.setupMultiSortIndicator(),!this.column.isSortable()&&!this.column.getColDef().showRowGroup)return;this.addInIcon("sortAscending",this.eSortAsc,e),this.addInIcon("sortDescending",this.eSortDesc,e),this.addInIcon("sortUnSort",this.eSortNone,e);const i=this.updateIcons.bind(this),s=this.onSortChanged.bind(this);this.addManagedPropertyListener("unSortIcon",i),this.addManagedEventListeners({newColumnsLoaded:i,sortChanged:s,columnRowGroupChanged:s}),this.onSortChanged()}addInIcon(e,t,i){if(t==null)return;const s=ie(e,this.gos,i);s&&t.appendChild(s)}onSortChanged(){this.updateIcons(),this.suppressOrder||this.updateSortOrder()}updateIcons(){const e=this.sortController.getDisplaySortForColumn(this.column);if(this.eSortAsc){const t=e==="asc";H(this.eSortAsc,t,{skipAriaHidden:!0})}if(this.eSortDesc){const t=e==="desc";H(this.eSortDesc,t,{skipAriaHidden:!0})}if(this.eSortNone){const t=!this.column.getColDef().unSortIcon&&!this.gos.get("unSortIcon"),i=e==null;H(this.eSortNone,!t&&i,{skipAriaHidden:!0})}}setupMultiSortIndicator(){this.addInIcon("sortUnSort",this.eSortMixed,this.column);const e=this.column.getColDef().showRowGroup;fe(this.gos)&&e&&(this.addManagedEventListeners({sortChanged:this.updateMultiSortIndicator.bind(this),columnRowGroupChanged:this.updateMultiSortIndicator.bind(this)}),this.updateMultiSortIndicator())}updateMultiSortIndicator(){if(this.eSortMixed){const e=this.sortController.getDisplaySortForColumn(this.column)==="mixed";H(this.eSortMixed,e,{skipAriaHidden:!0})}}updateSortOrder(){if(!this.eSortOrder)return;const e=this.sortController.getColumnsWithSortingOrdered(),t=this.sortController.getDisplaySortIndexForColumn(this.column)??-1,i=e.some(o=>this.sortController.getDisplaySortIndexForColumn(o)??-1>=1),s=t>=0&&i;H(this.eSortOrder,s,{skipAriaHidden:!0}),t>=0?this.eSortOrder.textContent=(t+1).toString():U(this.eSortOrder)}},ra={selector:"AG-SORT-INDICATOR",component:Fs},na=`<div class="ag-cell-label-container" role="presentation"> <span data-ref="eMenu" class="ag-header-icon ag-header-cell-menu-button" aria-hidden="true"></span> <span data-ref="eFilterButton" class="ag-header-icon ag-header-cell-filter-button" aria-hidden="true"></span> <div data-ref="eLabel" class="ag-header-cell-label" role="presentation"> <span data-ref="eText" class="ag-header-cell-text"></span> <span data-ref="eFilter" class="ag-header-icon ag-header-label-icon ag-filter-icon" aria-hidden="true"></span> <ag-sort-indicator data-ref="eSortIndicator"></ag-sort-indicator> </div> </div>`,Xi=class extends G{constructor(){super(...arguments),this.eFilter=b,this.eFilterButton=b,this.eSortIndicator=b,this.eMenu=b,this.eLabel=b,this.eText=b,this.eSortOrder=b,this.eSortAsc=b,this.eSortDesc=b,this.eSortMixed=b,this.eSortNone=b,this.lastMovingChanged=0}wireBeans(e){this.sortController=e.sortController,this.menuService=e.menuService,this.funcColsService=e.funcColsService}destroy(){super.destroy()}refresh(e){const t=this.params;return this.params=e,this.workOutTemplate()!=this.currentTemplate||this.workOutShowMenu()!=this.currentShowMenu||this.workOutSort()!=this.currentSort||this.shouldSuppressMenuHide()!=this.currentSuppressMenuHide||t.enableFilterButton!=e.enableFilterButton||t.enableFilterIcon!=e.enableFilterIcon?!1:(this.setDisplayName(e),!0)}workOutTemplate(){let e=this.params.template??na;return e=e&&e.trim?e.trim():e,e}init(e){this.params=e,this.currentTemplate=this.workOutTemplate(),this.setTemplate(this.currentTemplate,[ra]),this.setupTap(),this.setMenu(),this.setupSort(),this.setupFilterIcon(),this.setupFilterButton(),this.setDisplayName(e)}setDisplayName(e){if(this.currentDisplayName!=e.displayName){this.currentDisplayName=e.displayName;const t=me(this.currentDisplayName,!0);this.eText&&(this.eText.textContent=t)}}addInIcon(e,t,i){if(t==null)return;const s=ie(e,this.gos,i);s&&t.appendChild(s)}setupTap(){const{gos:e}=this;if(e.get("suppressTouch"))return;const t=new Ie(this.getGui(),!0),i=this.shouldSuppressMenuHide(),s=i&&F(this.eMenu),o=s?new Ie(this.eMenu,!0):t;if(this.params.enableMenu){const r=s?"tap":"longTap",n=l=>this.params.showColumnMenuAfterMouseClick(l.touchStart);this.addManagedListeners(o,{[r]:n})}if(this.params.enableSorting){const r=n=>{var a,d;const l=n.touchStart.target;i&&((a=this.eMenu)!=null&&a.contains(l)||(d=this.eFilterButton)!=null&&d.contains(l))||this.sortController.progressSort(this.params.column,!1,"uiColumnSorted")};this.addManagedListeners(t,{tap:r})}if(this.params.enableFilterButton){const r=new Ie(this.eFilterButton,!0);this.addManagedListeners(r,{tap:()=>this.params.showFilter(this.eFilterButton)}),this.addDestroyFunc(()=>r.destroy())}this.addDestroyFunc(()=>t.destroy()),s&&this.addDestroyFunc(()=>o.destroy())}workOutShowMenu(){return this.params.enableMenu&&this.menuService.isHeaderMenuButtonEnabled()}shouldSuppressMenuHide(){return this.menuService.isHeaderMenuButtonAlwaysShowEnabled()}setMenu(){if(!this.eMenu)return;if(this.currentShowMenu=this.workOutShowMenu(),!this.currentShowMenu){Ce(this.eMenu),this.eMenu=void 0;return}const e=this.menuService.isLegacyMenuEnabled();this.addInIcon(e?"menu":"menuAlt",this.eMenu,this.params.column),this.eMenu.classList.toggle("ag-header-menu-icon",!e),this.currentSuppressMenuHide=this.shouldSuppressMenuHide(),this.addManagedElementListeners(this.eMenu,{click:()=>this.params.showColumnMenu(this.eMenu)}),this.eMenu.classList.toggle("ag-header-menu-always-show",this.currentSuppressMenuHide)}onMenuKeyboardShortcut(e){const t=this.params.column,i=this.menuService.isLegacyMenuEnabled();if(e&&!i){if(this.menuService.isFilterMenuInHeaderEnabled(t))return this.params.showFilter(this.eFilterButton??this.eMenu??this.getGui()),!0}else if(this.params.enableMenu)return this.params.showColumnMenu(this.eMenu??this.eFilterButton??this.getGui()),!0;return!1}workOutSort(){return this.params.enableSorting}setupSort(){if(this.currentSort=this.params.enableSorting,this.eSortIndicator||(this.eSortIndicator=this.createBean(new Fs(!0)),this.eSortIndicator.attachCustomElements(this.eSortOrder,this.eSortAsc,this.eSortDesc,this.eSortMixed,this.eSortNone)),this.eSortIndicator.setupSort(this.params.column),!this.currentSort)return;this.addManagedListeners(this.params.column,{movingChanged:()=>{this.lastMovingChanged=new Date().getTime()}}),this.eLabel&&this.addManagedElementListeners(this.eLabel,{click:t=>{const i=this.params.column.isMoving(),o=new Date().getTime()-this.lastMovingChanged<50;if(!(i||o)){const l=this.gos.get("multiSortKey")==="ctrl"?t.ctrlKey||t.metaKey:t.shiftKey;this.params.progressSort(l)}}});const e=()=>{const t=this.params.column.getSort();if(this.addOrRemoveCssClass("ag-header-cell-sorted-asc",t==="asc"),this.addOrRemoveCssClass("ag-header-cell-sorted-desc",t==="desc"),this.addOrRemoveCssClass("ag-header-cell-sorted-none",!t),this.params.column.getColDef().showRowGroup){const i=this.funcColsService.getSourceColumnsForGroupColumn(this.params.column),o=!(i==null?void 0:i.every(r=>this.params.column.getSort()==r.getSort()));this.addOrRemoveCssClass("ag-header-cell-sorted-mixed",o)}};this.addManagedEventListeners({sortChanged:e,columnRowGroupChanged:e})}setupFilterIcon(){this.eFilter&&this.configureFilter(this.params.enableFilterIcon,this.eFilter,this.onFilterChangedIcon.bind(this))}setupFilterButton(){if(!this.eFilterButton)return;this.configureFilter(this.params.enableFilterButton,this.eFilterButton,this.onFilterChangedButton.bind(this))?this.addManagedElementListeners(this.eFilterButton,{click:()=>this.params.showFilter(this.eFilterButton)}):this.eFilterButton=void 0}configureFilter(e,t,i){if(!e)return Ce(t),!1;const s=this.params.column;return this.addInIcon("filter",t,s),this.addManagedListeners(s,{filterChanged:i}),i(),!0}onFilterChangedIcon(){const e=this.params.column.isFilterActive();H(this.eFilter,e,{skipAriaHidden:!0})}onFilterChangedButton(){const e=this.params.column.isFilterActive();this.eFilterButton.classList.toggle("ag-filter-active",e)}getAnchorElementForMenu(e){return e?this.eFilterButton??this.eMenu??this.getGui():this.eMenu??this.eFilterButton??this.getGui()}},la=class extends G{constructor(){super(`<div class="ag-header-group-cell-label" role="presentation"> <span data-ref="agLabel" class="ag-header-group-text" role="presentation"></span> <span data-ref="agOpened" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded"></span> <span data-ref="agClosed" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed"></span> </div>`),this.agOpened=b,this.agClosed=b,this.agLabel=b}wireBeans(e){this.columnModel=e.columnModel}destroy(){super.destroy()}init(e){this.params=e,this.checkWarnings(),this.setupLabel(),this.addGroupExpandIcon(),this.setupExpandIcons()}checkWarnings(){this.params.template&&S("A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)")}setupExpandIcons(){this.addInIcon("columnGroupOpened",this.agOpened),this.addInIcon("columnGroupClosed",this.agClosed);const e=o=>{if(Fe(o))return;const r=!this.params.columnGroup.isExpanded();this.columnModel.setColumnGroupOpened(this.params.columnGroup.getProvidedColumnGroup(),r,"uiColumnExpanded")};this.addTouchAndClickListeners(this.agClosed,e),this.addTouchAndClickListeners(this.agOpened,e);const t=o=>{at(o)};this.addManagedElementListeners(this.agClosed,{dblclick:t}),this.addManagedElementListeners(this.agOpened,{dblclick:t}),this.addManagedElementListeners(this.getGui(),{dblclick:e}),this.updateIconVisibility();const i=this.params.columnGroup.getProvidedColumnGroup(),s=this.updateIconVisibility.bind(this);this.addManagedListeners(i,{expandedChanged:s,expandableChanged:s})}addTouchAndClickListeners(e,t){const i=new Ie(e,!0);this.addManagedListeners(i,{tap:t}),this.addDestroyFunc(()=>i.destroy()),this.addManagedElementListeners(e,{click:t})}updateIconVisibility(){if(this.params.columnGroup.isExpandable()){const t=this.params.columnGroup.isExpanded();H(this.agOpened,t),H(this.agClosed,!t)}else H(this.agOpened,!1),H(this.agClosed,!1)}addInIcon(e,t){const i=ie(e,this.gos,null);i&&t.appendChild(i)}addGroupExpandIcon(){if(!this.params.columnGroup.isExpandable()){H(this.agOpened,!1),H(this.agClosed,!1);return}}setupLabel(){var i;const{displayName:e,columnGroup:t}=this.params;if(F(e)){const s=me(e,!0);this.agLabel.textContent=s}this.addOrRemoveCssClass("ag-sticky-label",!((i=t.getColGroupDef())!=null&&i.suppressStickyLabel))}},aa="↑",da="↓",ha=class extends G{constructor(){super(),this.refreshCount=0;const e=document.createElement("span"),t=document.createElement("span");t.setAttribute("class","ag-value-change-delta");const i=document.createElement("span");i.setAttribute("class","ag-value-change-value"),e.appendChild(t),e.appendChild(i),this.setTemplateFromElement(e)}wireBeans(e){this.filterManager=e.filterManager}init(e){this.eValue=this.queryForHtmlElement(".ag-value-change-value"),this.eDelta=this.queryForHtmlElement(".ag-value-change-delta"),this.refresh(e,!0)}showDelta(e,t){const i=Math.abs(t),s=e.formatValue(i),o=F(s)?s:i,r=t>=0;r?this.eDelta.textContent=aa+o:this.eDelta.textContent=da+o,this.eDelta.classList.toggle("ag-value-change-delta-up",r),this.eDelta.classList.toggle("ag-value-change-delta-down",!r)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),U(this.eDelta)}refresh(e,t=!1){var s;const i=e.value;if(i===this.lastValue||(F(e.valueFormatted)?this.eValue.textContent=e.valueFormatted:F(e.value)?this.eValue.textContent=i:U(this.eValue),(s=this.filterManager)!=null&&s.isSuppressFlashingCellsBecauseFiltering()))return!1;if(typeof i=="number"&&typeof this.lastValue=="number"){const o=i-this.lastValue;this.showDelta(e,o)}return this.lastValue&&this.eValue.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=i,!0}},ca=class extends G{constructor(){super(),this.refreshCount=0;const e=document.createElement("span"),t=document.createElement("span");t.setAttribute("class","ag-value-slide-current"),e.appendChild(t),this.setTemplateFromElement(e),this.eCurrent=this.queryForHtmlElement(".ag-value-slide-current")}wireBeans(e){this.filterManager=e.filterManager}init(e){this.refresh(e,!0)}addSlideAnimation(){this.refreshCount++;const e=this.refreshCount;this.ePrevious&&this.getGui().removeChild(this.ePrevious);const t=document.createElement("span");t.setAttribute("class","ag-value-slide-previous ag-value-slide-out"),this.ePrevious=t,this.ePrevious.textContent=this.eCurrent.textContent,this.getGui().insertBefore(this.ePrevious,this.eCurrent),this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{e===this.refreshCount&&(this.getGui().removeChild(this.ePrevious),this.ePrevious=null)},3e3)})}refresh(e,t=!1){var s;let i=e.value;return A(i)&&(i=""),i===this.lastValue||(s=this.filterManager)!=null&&s.isSuppressFlashingCellsBecauseFiltering()?!1:(t||this.addSlideAnimation(),this.lastValue=i,F(e.valueFormatted)?this.eCurrent.textContent=e.valueFormatted:F(e.value)?this.eCurrent.textContent=i:U(this.eCurrent),!0)}},m=class{};m.BACKSPACE="Backspace";m.TAB="Tab";m.ENTER="Enter";m.ESCAPE="Escape";m.SPACE=" ";m.LEFT="ArrowLeft";m.UP="ArrowUp";m.RIGHT="ArrowRight";m.DOWN="ArrowDown";m.DELETE="Delete";m.F2="F2";m.PAGE_UP="PageUp";m.PAGE_DOWN="PageDown";m.PAGE_HOME="Home";m.PAGE_END="End";m.A="KeyA";m.C="KeyC";m.D="KeyD";m.V="KeyV";m.X="KeyX";m.Y="KeyY";m.Z="KeyZ";var ua=class extends G{constructor(e,t,i){super(t,i),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{}}postConstruct(){this.addCssClass("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:i,labelAlignment:s,disabled:o}=this.config;o!=null&&this.setDisabled(o),e!=null&&this.setLabelSeparator(e),t!=null&&this.setLabel(t),i!=null&&this.setLabelWidth(i),this.setLabelAlignment(s||this.labelAlignment),this.refreshLabel()}refreshLabel(){U(this.eLabel),typeof this.label=="string"?this.eLabel.innerText=this.label+this.labelSeparator:this.label&&this.eLabel.appendChild(this.label),this.label===""?(H(this.eLabel,!1),ee(this.eLabel,"presentation")):(H(this.eLabel,!0),ee(this.eLabel,null))}setLabelSeparator(e){return this.labelSeparator===e?this:(this.labelSeparator=e,this.label!=null&&this.refreshLabel(),this)}getLabelId(){return this.eLabel.id=this.eLabel.id||`ag-${this.getCompId()}-label`,this.eLabel.id}getLabel(){return this.label}setLabel(e){return this.label===e?this:(this.label=e,this.refreshLabel(),this)}setLabelAlignment(e){const i=this.getGui().classList;return i.toggle("ag-label-align-left",e==="left"),i.toggle("ag-label-align-right",e==="right"),i.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:(ai(this.eLabel,e),this)}setDisabled(e){e=!!e;const t=this.getGui();return Lt(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}},pr=class extends ua{constructor(e,t,i,s){super(e,t,i),this.className=s}postConstruct(){super.postConstruct();const{width:e,value:t,onValueChange:i}=this.config;e!=null&&this.setWidth(e),t!=null&&this.setValue(t),i!=null&&this.onValueChange(i),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(),i=this.getLabel();i==null||i==""||El(e)!==null?It(e,""):It(e,t??"")}setAriaLabel(e){return dt(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 ce(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)}},_e=class extends pr{constructor(e,t,i="text",s="input"){super(e,(e==null?void 0:e.template)??` <div role="presentation"> <div data-ref="eLabel" class="ag-input-field-label"></div> <div data-ref="eWrapper" class="ag-wrapper ag-input-wrapper" role="presentation"> <${s} data-ref="eInput" class="ag-input-field-input"></${s}> </div> </div>`,[],t),this.inputType=i,this.displayFieldTag=s,this.eLabel=b,this.eWrapper=b,this.eInput=b}postConstruct(){super.postConstruct(),this.setInputType(),this.eLabel.classList.add(`${this.className}-label`),this.eWrapper.classList.add(`${this.className}-input-wrapper`),this.eInput.classList.add(`${this.className}-input`),this.addCssClass("ag-input-field"),this.eInput.id=this.eInput.id||`ag-${this.getCompId()}-input`;const{inputName:e,inputWidth:t}=this.config;e!=null&&this.setInputName(e),t!=null&&this.setInputWidth(t),this.addInputListeners(),this.activateTabIndex([this.eInput])}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 ai(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 ae(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return dt(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return Lt(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){if(e===!0)ae(this.eInput,"autocomplete",null);else{const t=typeof e=="string"?e:"off";ae(this.eInput,"autocomplete",t)}return this}},bs=class extends _e{constructor(e,t="ag-checkbox",i="checkbox"){super(e,t,i),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();const{readOnly:e,passive:t}=this.config;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){this.isSelected()!==e&&(this.previousValue=this.isSelected(),e=this.selected=typeof e=="boolean"?e:void 0,this.eInput.checked=e,this.eInput.indeterminate=e===void 0,t||this.dispatchChange(this.selected,this.previousValue))}dispatchChange(e,t,i){this.dispatchLocalEvent({type:"fieldValueChanged",selected:e,previousValue:t,event:i});const s=this.getInputElement();this.eventService.dispatchEvent({type:"checkboxChanged",id:s.id,name:s.name,selected:e,previousValue:t})}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;const t=this.isSelected(),i=this.selected=e.target.checked;this.refreshSelectedClass(i),this.dispatchChange(i,t,e)}refreshSelectedClass(e){this.eWrapper.classList.toggle("ag-checked",e===!0),this.eWrapper.classList.toggle("ag-indeterminate",e==null)}},Ps={selector:"AG-CHECKBOX",component:bs},ga=class extends G{constructor(){super(` <div class="ag-cell-wrapper ag-checkbox-cell" role="presentation"> <ag-checkbox role="presentation" data-ref="eCheckbox"></ag-checkbox> </div>`,[Ps]),this.eCheckbox=b}init(e){this.refresh(e);const t=this.eCheckbox.getInputElement();t.setAttribute("tabindex","-1"),qo(t,"polite"),this.addManagedListeners(t,{click:i=>{if(at(i),this.eCheckbox.isDisabled())return;const s=this.eCheckbox.getValue();this.onCheckboxChanged(s)},dblclick:i=>{at(i)}}),this.addManagedElementListeners(this.params.eGridCell,{keydown:i=>{if(i.key===m.SPACE&&!this.eCheckbox.isDisabled()){this.params.eGridCell===V(this.gos)&&this.eCheckbox.toggle();const s=this.eCheckbox.getValue();this.onCheckboxChanged(s),i.preventDefault()}}})}refresh(e){return this.params=e,this.updateCheckbox(e),!0}updateCheckbox(e){var l;let t,i=!0;if(e.node.group&&e.column)if(typeof e.value=="boolean")t=e.value;else{const a=e.column.getColId();a.startsWith(gi)?t=e.value==null||e.value===""?void 0:e.value==="true":e.node.aggData&&e.node.aggData[a]!==void 0?t=e.value??void 0:i=!1}else t=e.value??void 0;if(!i){this.eCheckbox.setDisplayed(!1);return}this.eCheckbox.setValue(t);const s=e.disabled!=null?e.disabled:!((l=e.column)!=null&&l.isCellEditable(e.node));this.eCheckbox.setDisabled(s);const o=this.localeService.getLocaleTextFunc(),r=Cs(o,t),n=s?r:`${o("ariaToggleCellValue","Press SPACE to toggle cell value")} (${r})`;this.eCheckbox.setInputAriaLabel(n)}onCheckboxChanged(e){const{column:t,node:i,value:s}=this.params;this.eventService.dispatchEvent({type:"cellEditingStarted",column:t,colDef:t==null?void 0:t.getColDef(),data:i.data,node:i,rowIndex:i.rowIndex,rowPinned:i.rowPinned,value:s});const o=this.params.node.setDataValue(this.params.column,e,"edit");this.eventService.dispatchEvent({type:"cellEditingStopped",column:t,colDef:t==null?void 0:t.getColDef(),data:i.data,node:i,rowIndex:i.rowIndex,rowPinned:i.rowPinned,value:s,oldValue:s,newValue:e,valueChanged:o}),o||this.updateCheckbox(this.params)}},pa=class extends G{constructor(){super(`<div class="ag-loading"> <span class="ag-loading-icon" data-ref="eLoadingIcon"></span> <span class="ag-loading-text" data-ref="eLoadingText"></span> </div>`),this.eLoadingIcon=b,this.eLoadingText=b}init(e){e.node.failedLoad?this.setupFailed():this.setupLoading()}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=e("loadingError","ERR")}setupLoading(){const e=ie("groupLoading",this.gos,null);e&&this.eLoadingIcon.appendChild(e);const t=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=t("loadingOoo","Loading")}refresh(e){return!1}destroy(){super.destroy()}},fa=class extends G{constructor(){super('<div class="ag-skeleton-container"></div>')}init(e){const t=`ag-cell-skeleton-renderer-${this.getCompId()}`;this.getGui().setAttribute("id",t),this.addDestroyFunc(()=>It(e.eParentOfValue)),It(e.eParentOfValue,t),e.node.failedLoad?this.setupFailed():this.setupLoading(e)}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.getGui().innerText=e("loadingError","ERR");const t=e("ariaSkeletonCellLoadingFailed","Row failed to load");dt(this.getGui(),t)}setupLoading(e){const i=B(this.gos).createElement("div");i.classList.add("ag-skeleton-effect");const s=e.node.rowIndex;if(s!=null){const n=75+25*(s%2===0?Math.sin(s):Math.cos(s));i.style.width=`${n}%`}this.getGui().appendChild(i);const r=this.localeService.getLocaleTextFunc()("ariaSkeletonCellLoading","Row data is loading");dt(this.getGui(),r)}refresh(e){return!1}destroy(){super.destroy()}},fr=class extends G{constructor(){super()}destroy(){super.destroy()}},Ca=class extends fr{init(){var t;const e=Re((t=this.gos.get("overlayLoadingTemplate"))==null?void 0:t.trim());if(this.setTemplate(e??'<span aria-live="polite" aria-atomic="true" class="ag-overlay-loading-center"></span>'),!e){const i=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=i("loadingOoo","Loading...")})}}},ma=class extends fr{init(){var t;const e=Re((t=this.gos.get("overlayNoRowsTemplate"))==null?void 0:t.trim());if(this.setTemplate(e??'<span class="ag-overlay-no-rows-center"></span>'),!e){const i=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=i("noRowsToShow","No Rows To Show")})}}},pt=class extends G{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()}},va=class extends pt{constructor(){super('<div class="ag-tooltip"></div>')}init(e){const{value:t}=e;this.getGui().textContent=me(t,!0)}};function Cr(e){const{inputValue:t,allSuggestions:i,hideIrrelevant:s,filterByPercentageOfBestMatch:o,addSequentialWeight:r}=e;let n=i.map((d,h)=>({value:d,relevance:Sa(t.toLowerCase(),d.toLocaleLowerCase(),r),idx:h}));if(n.sort((d,h)=>h.relevance-d.relevance),s&&(n=n.filter(d=>d.relevance!==0)),n.length>0&&o&&o>0){const h=n[0].relevance*o;n=n.filter(c=>h-c.relevance<0)}const l=[],a=[];for(const d of n)l.push(d.value),a.push(d.idx);return{values:l,indices:a}}function wa(e){const t=[],i=e.length;for(let s=1;s<=i;s++)for(let o=0;o<=i-s;o++){const r=o+s-1;t.push(e.slice(o,r+1))}return t}function Sa(e,t,i=!1){const s=e.replace(/\s/g,""),o=t.replace(/\s/g,""),r=s.length,n=o.length,l=new Array(r+1).fill(null).map(()=>new Array(n+1).fill(0));for(let c=0;c<=r;c+=1)l[c][0]=c;for(let c=0;c<=n;c+=1)l[0][c]=c;for(let c=1;c<=r;c++)for(let u=1;u<=n;u++)s[c-1]===o[u-1]?l[c][u]=l[c-1][u-1]:l[c][u]=1+Math.min(l[c][u-1],Math.min(l[c-1][u],l[c-1][u-1]));const a=l[r][n];let h=Math.max(r,n)-a;if(i){const c=wa(s);for(let u=0;u<c.length;u++){const g=c[u];o.indexOf(g)!==-1&&(h+=1,h*=g.length)}}return h}var ya=class extends v{constructor(){super(...arguments),this.beanName="userComponentRegistry",this.agGridDefaults={agDragAndDropImage:sa,agColumnHeader:Xi,agColumnGroupHeader:la,agSortIndicator:Fs,agAnimateShowChangeCellRenderer:ha,agAnimateSlideCellRenderer:ca,agLoadingCellRenderer:pa,agSkeletonCellRenderer:fa,agCheckboxCellRenderer:ga,agLoadingOverlay:Ca,agNoRowsOverlay:ma,agTooltipComponent:va},this.agGridDefaultParams={},this.enterpriseAgDefaultCompsModule={agSetColumnFilter:"@ag-grid-enterprise/set-filter",agSetColumnFloatingFilter:"@ag-grid-enterprise/set-filter",agMultiColumnFilter:"@ag-grid-enterprise/multi-filter",agMultiColumnFloatingFilter:"@ag-grid-enterprise/multi-filter",agGroupColumnFilter:"@ag-grid-enterprise/row-grouping",agGroupColumnFloatingFilter:"@ag-grid-enterprise/row-grouping",agGroupCellRenderer:"@ag-grid-enterprise/row-grouping",agGroupRowRenderer:"@ag-grid-enterprise/row-grouping",agRichSelect:"@ag-grid-enterprise/rich-select",agRichSelectCellEditor:"@ag-grid-enterprise/rich-select",agDetailCellRenderer:"@ag-grid-enterprise/master-detail",agSparklineCellRenderer:"@ag-grid-enterprise/sparklines"},this.jsComps={}}postConstruct(){const e=this.gos.get("components");e!=null&&re(e,(t,i)=>this.registerJsComponent(t,i))}registerDefaultComponent(e,t,i){this.agGridDefaults[e]=t,i&&(this.agGridDefaultParams[e]=i)}registerJsComponent(e,t){this.jsComps[e]=t}retrieve(e,t){const i=(l,a,d)=>({componentFromFramework:a,component:l,params:d}),s=this.getFrameworkOverrides().frameworkComponent(t,this.gos.get("components"));if(s!=null)return i(s,!0);const o=this.jsComps[t];if(o){const l=this.getFrameworkOverrides().isFrameworkComponent(o);return i(o,l)}const r=this.agGridDefaults[t];if(r)return i(r,!1,this.agGridDefaultParams[t]);const n=this.enterpriseAgDefaultCompsModule[t];return n?this.gos.assertModuleRegistered(n,`AG Grid '${e}' component: ${t}`):ls(()=>{this.warnAboutMissingComponent(e,t)},"MissingComp"+t),null}warnAboutMissingComponent(e,t){const i=[...Object.keys(this.agGridDefaults).filter(o=>!["agCellEditor","agGroupRowRenderer","agSortIndicator"].includes(o)),...Object.keys(this.jsComps)],s=Cr({inputValue:t,allSuggestions:i,hideIrrelevant:!0,filterByPercentageOfBestMatch:.8}).values;S(`Could not find '${t}' component. It was configured as "${e}: '${t}'" but it wasn't found in the list of registered components.`),s.length>0&&S(` Did you mean: [${s.slice(0,3)}]?`),S(`If using a custom component check it has been registered as described in: ${this.getFrameworkOverrides().getDocLink("components/")}`)}},te=class St{constructor(t){this.status=0,this.resolution=null,this.waiters=[],t(i=>this.onDone(i),i=>this.onReject(i))}static all(t){return t.length?new St(i=>{let s=t.length;const o=new Array(s);t.forEach((r,n)=>{r.then(l=>{o[n]=l,s--,s===0&&i(o)})})}):St.resolve()}static resolve(t=null){return new St(i=>i(t))}then(t){return new St(i=>{this.status===1?i(t(this.resolution)):this.waiters.push(s=>i(t(s)))})}onDone(t){this.status=1,this.resolution=t,this.waiters.forEach(i=>i(t))}onReject(t){}},Ra={propertyName:"dateComponent",cellRenderer:!1},Fa={propertyName:"dragAndDropImageComponent",cellRenderer:!1},ba={propertyName:"headerComponent",cellRenderer:!1},Pa={propertyName:"headerGroupComponent",cellRenderer:!1},so={propertyName:"cellRenderer",cellRenderer:!0},Da={propertyName:"cellRenderer",cellRenderer:!1},Ea={propertyName:"loadingCellRenderer",cellRenderer:!0},Ma={propertyName:"cellEditor",cellRenderer:!1},oo={propertyName:"innerRenderer",cellRenderer:!0},xa={propertyName:"loadingOverlayComponent",cellRenderer:!1},Aa={propertyName:"noRowsOverlayComponent",cellRenderer:!1},Ta={propertyName:"tooltipComponent",cellRenderer:!1},Ds={propertyName:"filter",cellRenderer:!1},Ia={propertyName:"floatingFilterComponent",cellRenderer:!1},La={propertyName:"toolPanel",cellRenderer:!1},Oa={propertyName:"statusPanel",cellRenderer:!1},Ga={propertyName:"fullWidthCellRenderer",cellRenderer:!0},ka={propertyName:"loadingCellRenderer",cellRenderer:!0},Ha={propertyName:"groupRowRenderer",cellRenderer:!0},Va={propertyName:"detailCellRenderer",cellRenderer:!0},Na={propertyName:"menuItem",cellRenderer:!1},mr=class vr extends v{constructor(){super(...arguments),this.beanName="userComponentFactory"}wireBeans(t){this.agComponentUtils=t.agComponentUtils,this.componentMetadataProvider=t.componentMetadataProvider,this.userComponentRegistry=t.userComponentRegistry,this.frameworkComponentWrapper=t.frameworkComponentWrapper,this.gridOptions=t.gridOptions}getDragAndDropImageCompDetails(t){return this.getCompDetails(this.gridOptions,Fa,"agDragAndDropImage",t,!0)}getHeaderCompDetails(t,i){return this.getCompDetails(t,ba,"agColumnHeader",i)}getHeaderGroupCompDetails(t){const i=t.columnGroup.getColGroupDef();return this.getCompDetails(i,Pa,"agColumnGroupHeader",t)}getFullWidthCellRendererDetails(t){return this.getCompDetails(this.gridOptions,Ga,null,t,!0)}getFullWidthLoadingCellRendererDetails(t){return this.getCompDetails(this.gridOptions,ka,"agLoadingCellRenderer",t,!0)}getFullWidthGroupCellRendererDetails(t){return this.getCompDetails(this.gridOptions,Ha,"agGroupRowRenderer",t,!0)}getFullWidthDetailCellRendererDetails(t){return this.getCompDetails(this.gridOptions,Va,"agDetailCellRenderer",t,!0)}getInnerRendererDetails(t,i){return this.getCompDetails(t,oo,null,i)}getFullWidthGroupRowInnerCellRenderer(t,i){return this.getCompDetails(t,oo,null,i)}getCellRendererDetails(t,i){return this.getCompDetails(t,so,null,i)}getEditorRendererDetails(t,i){return this.getCompDetails(t,Da,null,i)}getLoadingCellRendererDetails(t,i){return this.getCompDetails(t,Ea,"agSkeletonCellRenderer",i,!0)}getCellEditorDetails(t,i){return this.getCompDetails(t,Ma,"agCellEditor",i,!0)}getFilterDetails(t,i,s){return this.getCompDetails(t,Ds,s,i,!0)}getDateCompDetails(t){return this.getCompDetails(this.gridOptions,Ra,"agDateInput",t,!0)}getLoadingOverlayCompDetails(t){return this.getCompDetails(this.gridOptions,xa,"agLoadingOverlay",t,!0)}getNoRowsOverlayCompDetails(t){return this.getCompDetails(this.gridOptions,Aa,"agNoRowsOverlay",t,!0)}getTooltipCompDetails(t){return this.getCompDetails(t.colDef,Ta,"agTooltipComponent",t,!0)}getSetFilterCellRendererDetails(t,i){return this.getCompDetails(t,so,null,i)}getFloatingFilterCompDetails(t,i,s){return this.getCompDetails(t,Ia,s,i)}getToolPanelCompDetails(t,i){return this.getCompDetails(t,La,null,i,!0)}getStatusPanelCompDetails(t,i){return this.getCompDetails(t,Oa,null,i,!0)}getMenuItemCompDetails(t,i){return this.getCompDetails(t,Na,"agMenuItem",i,!0)}getCompDetails(t,i,s,o,r=!1){const{propertyName:n,cellRenderer:l}=i;let{compName:a,jsComp:d,fwComp:h,paramsFromSelector:c,popupFromSelector:u,popupPositionFromSelector:g}=vr.getCompKeys(this.frameworkOverrides,t,i,o),p;const C=R=>{const P=this.userComponentRegistry.retrieve(n,R);P&&(d=P.componentFromFramework?void 0:P.component,h=P.componentFromFramework?P.component:void 0,p=P.params)};if(a!=null&&C(a),d==null&&h==null&&s!=null&&C(s),d&&l&&!this.agComponentUtils.doesImplementIComponent(d)&&(d=this.agComponentUtils.adaptFunction(n,d)),!d&&!h){r&&O(`Could not find component ${a}, did you forget to configure this component?`);return}const f=this.mergeParamsWithApplicationProvidedParams(t,i,o,c,p),w=d==null,y=d||h;return{componentFromFramework:w,componentClass:y,params:f,type:i,popupFromSelector:u,popupPositionFromSelector:g,newAgStackInstance:()=>this.newAgStackInstance(y,w,f,i)}}static getCompKeys(t,i,s,o){const{propertyName:r}=s;let n,l,a,d,h,c;if(i){const u=i,g=u[r+"Selector"],p=g?g(o):null,C=f=>{typeof f=="string"?n=f:f!=null&&f!==!0&&(t.isFrameworkComponent(f)?a=f:l=f)};p?(C(p.component),d=p.params,h=p.popup,c=p.popupPosition):C(u[r])}return{compName:n,jsComp:l,fwComp:a,paramsFromSelector:d,popupFromSelector:h,popupPositionFromSelector:c}}newAgStackInstance(t,i,s,o){const r=o.propertyName,n=!i;let l;if(n)l=new t;else{const d=this.componentMetadataProvider.retrieve(r);l=this.frameworkComponentWrapper.wrap(t,d.mandatoryMethodList,d.optionalMethodList,o)}const a=this.initComponent(l,s);return a==null?te.resolve(l):a.then(()=>l)}mergeParamsWithApplicationProvidedParams(t,i,s,o=null,r){const n=this.gos.getGridCommonParams();q(n,s),r&&q(n,r);const l=t,a=l&&l[i.propertyName+"Params"];if(typeof a=="function"){const d=a(s);q(n,d)}else typeof a=="object"&&q(n,a);return q(n,o),n}initComponent(t,i){if(this.createBean(t),t.init!=null)return t.init(i)}};function bt(e){const t=e;return t!=null&&t.getFrameworkComponentInstance!=null?t.getFrameworkComponentInstance():e}var pi=class k{static register(t){k.__register(t,!0,void 0)}static registerModules(t){k.__registerModules(t,!0,void 0)}static __register(t,i,s){k.runVersionChecks(t),s!==void 0?(k.areGridScopedModules=!0,k.gridModulesMap[s]===void 0&&(k.gridModulesMap[s]={}),k.gridModulesMap[s][t.moduleName]=t):k.globalModulesMap[t.moduleName]=t,k.setModuleBased(i)}static __unRegisterGridModules(t){delete k.gridModulesMap[t]}static __registerModules(t,i,s){k.setModuleBased(i),t&&t.forEach(o=>k.__register(o,i,s))}static isValidModuleVersion(t){const[i,s]=t.version.split(".")||[],[o,r]=k.currentModuleVersion.split(".")||[];return i===o&&s===r}static runVersionChecks(t){k.currentModuleVersion||(k.currentModuleVersion=t.version);const i=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(t.version?k.isValidModuleVersion(t)||O(i(`'${t.moduleName}' is version ${t.version} but the other modules are version ${k.currentModuleVersion}.`)):O(i(`'${t.moduleName}' is incompatible.`)),t.validate){const s=t.validate();s.isValid||O(`${s.message}`)}}static setModuleBased(t){k.moduleBased===void 0?k.moduleBased=t:k.moduleBased!==t&&(O("AG Grid: You are mixing modules (i.e. @ag-grid-community/core) and packages (ag-grid-community) - you can only use one or the other of these mechanisms."),O("Please see https://www.ag-grid.com/javascript-grid/modules/ for more information."))}static __setIsBundled(){k.isBundled=!0}static __assertRegistered(t,i,s){var r;if(this.__isRegistered(t,s))return!0;let o;if(k.isBundled)o=`AG Grid: unable to use ${i} as 'ag-grid-enterprise' has not been loaded. Check you are using the Enterprise bundle: <script src="https://cdn.jsdelivr.net/npm/ag-grid-enterprise@AG_GRID_VERSION/dist/ag-grid-enterprise.min.js"><\/script> For more info see: https://ag-grid.com/javascript-data-grid/getting-started/#getting-started-with-ag-grid-enterprise`;else if(k.moduleBased||k.moduleBased===void 0){const n=(r=Object.entries(Do).find(([l,a])=>a===t))==null?void 0:r[0];o=`AG Grid: unable to use ${i} as the ${n} is not registered${k.areGridScopedModules?` for gridId: ${s}`:""}. Check if you have registered the module: import { ModuleRegistry } from '@ag-grid-community/core'; import { ${n} } from '${t}'; ModuleRegistry.registerModules([ ${n} ]); For more info see: https://www.ag-grid.com/javascript-grid/modules/`}else o=`AG Grid: unable to use ${i} as package 'ag-grid-enterprise' has not been imported. Check that you have imported the package: import 'ag-grid-enterprise';`;return O(o),!1}static __isRegistered(t,i){var s;return!!k.globalModulesMap[t]||!!((s=k.gridModulesMap[i])!=null&&s[t])}static __getRegisteredModules(t){return[...jt(k.globalModulesMap),...jt(k.gridModulesMap[t]||{})]}static __getGridRegisteredModules(t){return jt(k.gridModulesMap[t]??{})||[]}static __isPackageBased(){return!k.moduleBased}};pi.globalModulesMap={};pi.gridModulesMap={};pi.areGridScopedModules=!1;var ye=pi,Ba=class{constructor(e){this.beans={},this.createdBeans=[],this.destroyed=!1,!(!e||!e.beanClasses)&&(this.beanDestroyComparator=e.beanDestroyComparator,this.init(e))}init(e){var t;Object.entries(e.providedBeanInstances).forEach(([i,s])=>{this.beans[i]=s}),e.beanClasses.forEach(i=>{const s=new i;s.beanName?this.beans[s.beanName]=s:console.error(`Bean ${i.name} is missing beanName`),this.createdBeans.push(s)}),(t=e.derivedBeans)==null||t.forEach(i=>{const{beanName:s,bean:o}=i(this);this.beans[s]=o,this.createdBeans.push(o)}),e.beanInitComparator&&this.createdBeans.sort(e.beanInitComparator),this.initBeans(this.createdBeans)}getBeanInstances(){return Object.values(this.beans)}createBean(e,t){if(!e)throw Error("Can't wire to bean since it is null");return this.initBeans([e],t),e}initBeans(e,t){e.forEach(i=>{var s,o;(s=i.preWireBeans)==null||s.call(i,this.beans),(o=i.wireBeans)==null||o.call(i,this.beans)}),e.forEach(i=>{var s;return(s=i.preConstruct)==null?void 0:s.call(i)}),t&&e.forEach(t),e.forEach(i=>{var s;return(s=i.postConstruct)==null?void 0:s.call(i)})}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){var t;(t=e==null?void 0:e.destroy)==null||t.call(e)}destroyBeans(e){if(e)for(let t=0;t<e.length;t++)this.destroyBean(e[t]);return[]}isDestroyed(){return this.destroyed}},Wa=class extends Ba{init(e){this.gridId=e.gridId,this.beans.context=this,super.init(e)}destroy(){super.destroy(),ye.__unRegisterGridModules(this.gridId)}getGridId(){return this.gridId}},wr=(e=>(e[e.Left=0]="Left",e[e.Right=1]="Right",e))(wr||{}),za=class extends v{constructor(){super(...arguments),this.beanName="dragAndDropService",this.dragSourceAndParamsList=[],this.dropTargets=[]}wireBeans(e){this.ctrlsService=e.ctrlsService,this.dragService=e.dragService,this.mouseEventService=e.mouseEventService,this.environment=e.environment,this.userComponentFactory=e.userComponentFactory}addDragSource(e,t=!1){const i={eElement:e.eElement,dragStartPixels:e.dragStartPixels,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),onDragCancel:this.onDragCancel.bind(this),includeTouch:t};this.dragSourceAndParamsList.push({params:i,dragSource:e}),this.dragService.addDragSource(i)}getDragAndDropImageComponent(){const{dragAndDropImageComp:e}=this;return!e||!e.comp?null:e.comp}removeDragSource(e){const t=this.dragSourceAndParamsList.find(i=>i.dragSource===e);t&&(this.dragService.removeDragSource(t.params),Q(this.dragSourceAndParamsList,t))}destroy(){this.dragSourceAndParamsList.forEach(e=>this.dragService.removeDragSource(e.params)),this.dragSourceAndParamsList.length=0,this.dropTargets.length=0,this.clearDragAndDropProperties(),super.destroy()}nudge(){this.dragging&&this.onDragging(this.eventLastTime,!0)}onDragStart(e,t){var i,s;this.dragging=!0,this.dragSource=e,this.eventLastTime=t,this.dragItem=this.dragSource.getDragItem(),(s=(i=this.dragSource).onDragStarted)==null||s.call(i),this.createDragAndDropImageComponent()}onDragStop(e){var t,i,s;if((i=(t=this.dragSource)==null?void 0:t.onDragStopped)==null||i.call(t),(s=this.lastDropTarget)!=null&&s.onDragStop){const o=this.createDropTargetEvent(this.lastDropTarget,e,null,null,!1);this.lastDropTarget.onDragStop(o)}this.clearDragAndDropProperties()}onDragCancel(){var e,t,i;(t=(e=this.dragSource)==null?void 0:e.onDragCancelled)==null||t.call(e),(i=this.lastDropTarget)!=null&&i.onDragCancel&&this.lastDropTarget.onDragCancel(this.createDropTargetEvent(this.lastDropTarget,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){var n,l,a,d;const i=this.getHorizontalDirection(e),s=this.getVerticalDirection(e);this.eventLastTime=e,this.positionDragAndDropImageComp(e);const o=this.dropTargets.filter(h=>this.isMouseOnDropTarget(e,h)),r=this.findCurrentDropTarget(e,o);if(r!==this.lastDropTarget){if(this.leaveLastTargetIfExists(e,i,s,t),this.lastDropTarget!==null&&r===null&&((l=(n=this.dragSource)==null?void 0:n.onGridExit)==null||l.call(n,this.dragItem)),this.lastDropTarget===null&&r!==null&&((d=(a=this.dragSource)==null?void 0:a.onGridEnter)==null||d.call(a,this.dragItem)),this.enterDragTargetIfExists(r,e,i,s,t),r&&this.dragAndDropImageComp){const{comp:h,promise:c}=this.dragAndDropImageComp;h?h.setIcon(r.getIconName?r.getIconName():null):c.then(u=>{u&&u.setIcon(r.getIconName?r.getIconName():null)})}this.lastDropTarget=r}else if(r&&r.onDragging){const h=this.createDropTargetEvent(r,e,i,s,t);r.onDragging(h)}}getAllContainersFromDropTarget(e){const t=e.getSecondaryContainers?e.getSecondaryContainers():null,i=[[e.getContainer()]];return t?i.concat(t):i}allContainersIntersect(e,t){for(const i of t){const{width:s,height:o,left:r,right:n,top:l,bottom:a}=i.getBoundingClientRect();if(s===0||o===0)return!1;const d=e.clientX>=r&&e.clientX<n,h=e.clientY>=l&&e.clientY<a;if(!d||!h)return!1}return!0}isMouseOnDropTarget(e,t){const i=this.getAllContainersFromDropTarget(t);let s=!1;for(const n of i)if(this.allContainersIntersect(e,n)){s=!0;break}const{eElement:o,type:r}=this.dragSource;return t.targetContainsSource&&!t.getContainer().contains(o)?!1:s&&t.isInterestedIn(r,o)}findCurrentDropTarget(e,t){const i=t.length;if(i===0)return null;if(i===1)return t[0];const o=At(this.gos).elementsFromPoint(e.clientX,e.clientY);for(const r of o)for(const n of t)if(Qn(this.getAllContainersFromDropTarget(n)).indexOf(r)!==-1)return n;return null}enterDragTargetIfExists(e,t,i,s,o){if(e&&e.onDragEnter){const r=this.createDropTargetEvent(e,t,i,s,o);e.onDragEnter(r)}}leaveLastTargetIfExists(e,t,i,s){if(!this.lastDropTarget)return;if(this.lastDropTarget.onDragLeave){const r=this.createDropTargetEvent(this.lastDropTarget,e,t,i,s);this.lastDropTarget.onDragLeave(r)}const o=this.getDragAndDropImageComponent();o&&o.setIcon(null)}addDropTarget(e){this.dropTargets.push(e)}removeDropTarget(e){this.dropTargets=this.dropTargets.filter(t=>t.getContainer()!==e.getContainer())}hasExternalDropZones(){return this.dropTargets.some(e=>e.external)}findExternalZone(e){return this.dropTargets.filter(i=>i.external).find(i=>i.getContainer()===e.getContainer())||null}isDropZoneWithinThisGrid(e){const i=this.ctrlsService.getGridBodyCtrl().getGui(),{dropZoneTarget:s}=e;return i.contains(s)}getHorizontalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientX,i=e.clientX;return t===i?null:t>i?0:1}getVerticalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientY,i=e.clientY;return t===i?null:t>i?0:1}createDropTargetEvent(e,t,i,s,o){const r=e.getContainer(),n=r.getBoundingClientRect(),{dragItem:l,dragSource:a}=this,d=t.clientX-n.left,h=t.clientY-n.top;return this.gos.addGridCommonParams({event:t,x:d,y:h,vDirection:s,hDirection:i,dragSource:a,fromNudge:o,dragItem:l,dropZoneTarget:r})}positionDragAndDropImageComp(e){const t=this.getDragAndDropImageComponent();if(!t)return;const i=t.getGui(),o=i.getBoundingClientRect().height,r=Wl()-2,n=zl()-2;if(!i.offsetParent)return;const a=or(i.offsetParent),{clientY:d,clientX:h}=e;let c=d-a.top-o/2,u=h-a.left-10;const g=B(this.gos),p=g.defaultView||window,C=p.pageYOffset||g.documentElement.scrollTop,f=p.pageXOffset||g.documentElement.scrollLeft;r>0&&u+i.clientWidth>r+f&&(u=r+f-i.clientWidth),u<0&&(u=0),n>0&&c+i.clientHeight>n+C&&(c=n+C-i.clientHeight),c<0&&(c=0),i.style.left=`${u}px`,i.style.top=`${c}px`}removeDragAndDropImageComponent(){if(this.dragAndDropImageComp){const{comp:e}=this.dragAndDropImageComp;if(e){const t=e.getGui();this.dragAndDropImageParent&&this.dragAndDropImageParent.removeChild(t),this.destroyBean(e)}}this.dragAndDropImageComp=null}createDragAndDropImageComponent(){const{dragSource:e}=this;if(!e)return;const i=this.userComponentFactory.getDragAndDropImageCompDetails({dragSource:e}).newAgStackInstance();this.dragAndDropImageComp={promise:i},i.then(s=>{!s||!this.isAlive()||(this.processDragAndDropImageComponent(s),this.dragAndDropImageComp.comp=s)})}processDragAndDropImageComponent(e){const{dragSource:t,mouseEventService:i,environment:s}=this;if(!t)return;const o=e.getGui();o.style.setProperty("position","absolute"),o.style.setProperty("z-index","9999"),i.stampTopLevelGridCompWithGridInstance(o),s.applyThemeClasses(o),e.setIcon(null);let{dragItemName:r}=t;as(r)&&(r=r()),e.setLabel(r||""),o.style.top="20px",o.style.left="20px";const n=B(this.gos);let l=null,a=null;try{l=n.fullscreenElement}catch{}finally{l||(l=At(this.gos));const d=l.querySelector("body");d?a=d:l instanceof ShadowRoot?a=l:l instanceof Document?a=l==null?void 0:l.documentElement:a=l}this.dragAndDropImageParent=a,a?a.appendChild(o):S("Could not find document body, it is needed for drag and drop.")}},_a=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 i=t||this.shouldSkipVerticalScroll();if(i&&this.shouldSkipHorizontalScroll())return;const s=this.scrollContainer.getBoundingClientRect(),o=this.scrollByTick;this.tickLeft=e.clientX<s.left+o,this.tickRight=e.clientX>s.right-o,this.tickUp=e.clientY<s.top+o&&!i,this.tickDown=e.clientY>s.bottom-o&&!i,this.tickLeft||this.tickRight||this.tickUp||this.tickDown?this.ensureTickingStarted():this.ensureCleared()}ensureTickingStarted(){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)}},Ua=class extends v{wireBeans(e){this.dragAndDropService=e.dragAndDropService,this.rowModel=e.rowModel,this.pageBoundsService=e.pageBoundsService,this.focusService=e.focusService,this.sortController=e.sortController,this.filterManager=e.filterManager,this.selectionService=e.selectionService,this.mouseEventService=e.mouseEventService,this.ctrlsService=e.ctrlsService,this.funcColsService=e.funcColsService,this.rangeService=e.rangeService}constructor(e){super(),this.eContainer=e}postConstruct(){N(this.gos)&&(this.clientSideRowModel=this.rowModel),this.ctrlsService.whenReady(this,e=>{const t=e.gridBodyCtrl;this.autoScrollService=new _a({scrollContainer:t.getBodyViewportElement(),scrollAxis:"y",getVerticalPosition:()=>t.getScrollFeature().getVScrollPosition().top,setVerticalPosition:i=>t.getScrollFeature().setVerticalScrollPosition(i),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(){var s;return!!(this.funcColsService.getRowGroupColumns().length||((s=this.filterManager)==null?void 0:s.isAnyFilterPresent())||this.sortController.isSortActive())}getRowNodes(e){if(!this.isFromThisGrid(e))return e.dragItem.rowNodes||[];const t=e.dragItem.rowNode;if(this.gos.get("rowDragMultiRow")){const s=[...this.selectionService.getSelectedNodes()].sort((o,r)=>o.rowIndex==null||r.rowIndex==null?0:this.getRowIndexNumber(o)-this.getRowIndexNumber(r));if(s.indexOf(t)!==-1)return s}return[t]}onDragEnter(e){e.dragItem.rowNodes=this.getRowNodes(e),this.dispatchGridEvent("rowDragEnter",e),this.getRowNodes(e).forEach(t=>{t.setDragging(!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=this.mouseEventService.getNormalisedPosition(e).y;this.gos.get("rowDragManaged")&&this.doManagedDrag(e,t),this.autoScrollService.check(e.event)}doManagedDrag(e,t){const i=this.isFromThisGrid(e),s=this.gos.get("rowDragManaged"),o=e.dragItem.rowNodes;s&&this.shouldPreventRowMove()||(this.gos.get("suppressMoveWhenRowDragging")||!i?this.dragAndDropService.isDropZoneWithinThisGrid(e)&&this.clientSideRowModel.highlightRowAtPixel(o[0],t):this.moveRows(o,t))}getRowIndexNumber(e){const t=e.getRowIndexString();return parseInt(I(t.split("-")),10)}moveRowAndClearHighlight(e){const t=this.clientSideRowModel.getLastHighlightedRowNode(),i=t&&t.highlighted===1,s=this.mouseEventService.getNormalisedPosition(e).y,o=e.dragItem.rowNodes;let r=i?1:0;if(this.isFromThisGrid(e))o.forEach(n=>{n.rowTop<s&&(r-=1)}),this.moveRows(o,s,r);else{const n=ut(this.gos);let l=this.clientSideRowModel.getRowIndexAtPixel(s)+1;this.clientSideRowModel.getHighlightPosition(s)===0&&l--,this.clientSideRowModel.updateRowData({add:o.filter(a=>!this.clientSideRowModel.getRowNode((n==null?void 0:n({data:a.data,level:0,rowPinned:a.rowPinned}))??a.data.id)).map(a=>a.data),addIndex:l})}this.clearRowHighlight()}clearRowHighlight(){this.clientSideRowModel.highlightRowAtPixel(null)}moveRows(e,t,i=0){var o;this.clientSideRowModel.ensureRowsAtPixel(e,t,i)&&(this.focusService.clearFocusedCell(),(o=this.rangeService)==null||o.removeAllCellRanges())}addRowDropZone(e){if(!e.getContainer()){S("addRowDropZone - A container target needs to be provided");return}if(this.dragAndDropService.findExternalZone(e)){S("addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.");return}let t={getContainer:e.getContainer};e.fromGrid?t=e:(e.onDragEnter&&(t.onDragEnter=s=>{e.onDragEnter(this.draggingToRowDragEvent("rowDragEnter",s))}),e.onDragLeave&&(t.onDragLeave=s=>{e.onDragLeave(this.draggingToRowDragEvent("rowDragLeave",s))}),e.onDragging&&(t.onDragging=s=>{e.onDragging(this.draggingToRowDragEvent("rowDragMove",s))}),e.onDragStop&&(t.onDragStop=s=>{e.onDragStop(this.draggingToRowDragEvent("rowDragEnd",s))}),e.onDragCancel&&(t.onDragCancel=s=>{e.onDragCancel(this.draggingToRowDragEvent("rowDragCancel",s))}));const i={isInterestedIn:s=>s===2,getIconName:()=>"move",external:!0,...t};this.dragAndDropService.addDropTarget(i),this.addDestroyFunc(()=>this.dragAndDropService.removeDropTarget(i))}getRowDropZone(e){const t=this.getContainer.bind(this),i=this.onDragEnter.bind(this),s=this.onDragLeave.bind(this),o=this.onDragging.bind(this),r=this.onDragStop.bind(this),n=this.onDragCancel.bind(this);let l;return e?l={getContainer:t,onDragEnter:e.onDragEnter?a=>{i(a),e.onDragEnter(this.draggingToRowDragEvent("rowDragEnter",a))}:i,onDragLeave:e.onDragLeave?a=>{s(a),e.onDragLeave(this.draggingToRowDragEvent("rowDragLeave",a))}:s,onDragging:e.onDragging?a=>{o(a),e.onDragging(this.draggingToRowDragEvent("rowDragMove",a))}:o,onDragStop:e.onDragStop?a=>{r(a),e.onDragStop(this.draggingToRowDragEvent("rowDragEnd",a))}:r,onDragCancel:e.onDragCancel?a=>{n(a),e.onDragCancel(this.draggingToRowDragEvent("rowDragCancel",a))}:n,fromGrid:!0}:l={getContainer:t,onDragEnter:i,onDragLeave:s,onDragging:o,onDragStop:r,onDragCancel:n,fromGrid:!0},l}draggingToRowDragEvent(e,t){const i=this.mouseEventService.getNormalisedPosition(t).y,s=i>this.pageBoundsService.getCurrentPageHeight();let o=-1,r;s||(o=this.rowModel.getRowIndexAtPixel(i),r=this.rowModel.getRow(o));let n;switch(t.vDirection){case 1:n="down";break;case 0:n="up";break;default:n=null;break}return this.gos.addGridCommonParams({type:e,event:t.event,node:t.dragItem.rowNode,nodes:t.dragItem.rowNodes,overIndex:o,overNode:r,y:i,vDirection:n})}dispatchGridEvent(e,t){const i=this.draggingToRowDragEvent(e,t);this.eventService.dispatchEvent(i)}onDragLeave(e){this.dispatchGridEvent("rowDragLeave",e),this.stopDragging(e),this.gos.get("rowDragManaged")&&this.clearRowHighlight()}onDragStop(e){this.dispatchGridEvent("rowDragEnd",e),this.stopDragging(e),this.gos.get("rowDragManaged")&&(this.gos.get("suppressMoveWhenRowDragging")||!this.isFromThisGrid(e))&&this.dragAndDropService.isDropZoneWithinThisGrid(e)&&this.moveRowAndClearHighlight(e)}onDragCancel(e){this.dispatchGridEvent("rowDragCancel",e),this.stopDragging(e),this.gos.get("rowDragManaged")&&(this.gos.get("suppressMoveWhenRowDragging")||!this.isFromThisGrid(e))&&this.dragAndDropService.isDropZoneWithinThisGrid(e)&&this.clearRowHighlight()}stopDragging(e){this.autoScrollService.ensureCleared(),this.getRowNodes(e).forEach(t=>{t.setDragging(!1)})}},Ka=class extends v{constructor(){super(...arguments),this.beanName="dragService",this.dragEndFunctions=[],this.dragSources=[]}wireBeans(e){this.mouseEventService=e.mouseEventService}destroy(){this.dragSources.forEach(this.removeListener.bind(this)),this.dragSources.length=0,super.destroy()}removeListener(e){const t=e.dragSource.eElement,i=e.mouseDownListener;if(t.removeEventListener("mousedown",i),e.touchEnabled){const s=e.touchStartListener;t.removeEventListener("touchstart",s,{passive:!0})}}removeDragSource(e){const t=this.dragSources.find(i=>i.dragSource===e);t&&(this.removeListener(t),Q(this.dragSources,t))}isDragging(){return this.dragging}addDragSource(e){const t=this.onMouseDown.bind(this,e),{eElement:i,includeTouch:s,stopPropagationForTouch:o}=e;i.addEventListener("mousedown",t);let r=null;const n=this.gos.get("suppressTouch");s&&!n&&(r=l=>{ws(l.target)||(o&&l.stopPropagation(),this.onTouchStart(e,l))},i.addEventListener("touchstart",r,{passive:!1})),this.dragSources.push({dragSource:e,mouseDownListener:t,touchStartListener:r,touchEnabled:!!s})}getStartTarget(){return this.startTarget}onTouchStart(e,t){this.currentDragParams=e,this.dragging=!1;const i=t.touches[0];this.touchLastTime=i,this.touchStart=i;const s=a=>this.onTouchMove(a,e.eElement),o=a=>this.onTouchUp(a,e.eElement),r=a=>{a.cancelable&&a.preventDefault()},n=t.target,l=[{target:At(this.gos),type:"touchmove",listener:r,options:{passive:!1}},{target:n,type:"touchmove",listener:s,options:{passive:!0}},{target:n,type:"touchend",listener:o,options:{passive:!0}},{target:n,type:"touchcancel",listener:o,options:{passive:!0}}];this.addTemporaryEvents(l),e.dragStartPixels===0&&this.onCommonMove(i,this.touchStart,e.eElement)}onMouseDown(e,t){const i=t;if(e.skipMouseEvent&&e.skipMouseEvent(t)||i._alreadyProcessedByDragService||(i._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 s=d=>this.onMouseMove(d,e.eElement),o=d=>this.onMouseUp(d,e.eElement),r=d=>d.preventDefault(),n=d=>{d.key===m.ESCAPE&&this.cancelDrag(e.eElement)},l=At(this.gos),a=[{target:l,type:"mousemove",listener:s},{target:l,type:"mouseup",listener:o},{target:l,type:"contextmenu",listener:r},{target:l,type:"keydown",listener:n}];this.addTemporaryEvents(a),e.dragStartPixels===0&&this.onMouseMove(t,e.eElement)}addTemporaryEvents(e){e.forEach(t=>{const{target:i,type:s,listener:o,options:r}=t;i.addEventListener(s,o,r)}),this.dragEndFunctions.push(()=>{e.forEach(t=>{const{target:i,type:s,listener:o,options:r}=t;i.removeEventListener(s,o,r)})})}isEventNearStartEvent(e,t){const{dragStartPixels:i}=this.currentDragParams,s=F(i)?i:4;return gr(e,t,s)}getFirstActiveTouch(e){for(let t=0;t<e.length;t++)if(e[t].identifier===this.touchStart.identifier)return e[t];return null}onCommonMove(e,t,i){var s;if(!this.dragging){if(this.isEventNearStartEvent(e,t))return;if(this.dragging=!0,this.eventService.dispatchEvent({type:"dragStarted",target:i}),this.currentDragParams.onDragStart(t),!this.currentDragParams){this.dragging=!1;return}this.currentDragParams.onDragging(t)}(s=this.currentDragParams)==null||s.onDragging(e)}onTouchMove(e,t){const i=this.getFirstActiveTouch(e.touches);i&&this.onCommonMove(i,this.touchStart,t)}onMouseMove(e,t){var i;we()&&((i=B(this.gos).getSelection())==null||i.removeAllRanges()),this.shouldPreventMouseEvent(e)&&e.preventDefault(),this.onCommonMove(e,this.mouseStartEvent,t)}shouldPreventMouseEvent(e){const t=this.gos.get("enableCellTextSelection"),i=e.type==="mousemove";return t&&i&&e.cancelable&&this.mouseEventService.isEventFromThisGrid(e)&&!this.isOverFormFieldElement(e)}isOverFormFieldElement(e){const t=e.target,i=t==null?void 0:t.tagName.toLocaleLowerCase();return!!(i!=null&&i.match("^a$|textarea|input|select|button"))}onTouchUp(e,t){let i=this.getFirstActiveTouch(e.changedTouches);i||(i=this.touchLastTime),this.onUpCommon(i,t)}onMouseUp(e,t){this.onUpCommon(e,t)}onUpCommon(e,t){this.dragging&&(this.dragging=!1,this.currentDragParams.onDragStop(e),this.eventService.dispatchEvent({type:"dragStopped",target:t})),this.resetDragProperties()}cancelDrag(e){var t,i;this.eventService.dispatchEvent({type:"dragCancelled",target:e}),(i=(t=this.currentDragParams)==null?void 0:t.onDragCancel)==null||i.call(t),this.resetDragProperties()}resetDragProperties(){this.mouseStartEvent=null,this.startTarget=null,this.touchStart=null,this.touchLastTime=null,this.currentDragParams=null,this.dragEndFunctions.forEach(e=>e()),this.dragEndFunctions.length=0}},Ji=class extends G{constructor(e,t,i,s,o,r){super(),this.cellValueFn=e,this.rowNode=t,this.column=i,this.customGui=s,this.dragStartPixels=o,this.suppressVisibilityChange=r,this.dragSource=null}wireBeans(e){this.beans=e}isCustomGui(){return this.customGui!=null}postConstruct(){if(this.customGui?this.setDragElement(this.customGui,this.dragStartPixels):(this.setTemplate('<div class="ag-drag-handle ag-row-drag" aria-hidden="true"></div>'),this.getGui().appendChild(ie("rowDrag",this.gos,null)),this.addDragSource()),this.checkCompatibility(),!this.suppressVisibilityChange){const e=this.gos.get("rowDragManaged")?new ja(this,this.beans,this.rowNode,this.column):new $a(this,this.beans,this.rowNode,this.column);this.createManagedBean(e,this.beans.context)}}setDragElement(e,t){this.setTemplateFromElement(e,void 0,void 0,!0),this.addDragSource(t)}getSelectedNodes(){if(!this.gos.get("rowDragMultiRow"))return[this.rowNode];const t=this.beans.selectionService.getSelectedNodes();return t.indexOf(this.rowNode)!==-1?t:[this.rowNode]}checkCompatibility(){const e=this.gos.get("rowDragManaged");this.gos.get("treeData")&&e&&S("If using row drag with tree data, you cannot have rowDragManaged=true")}getDragItem(){return{rowNode:this.rowNode,rowNodes:this.getSelectedNodes(),columns:this.column?[this.column]:void 0,defaultTextValue:this.cellValueFn()}}getRowDragText(e){if(e){const t=e.getColDef();if(t.rowDragText)return t.rowDragText}return this.gos.get("rowDragText")}addDragSource(e=4){this.dragSource&&this.removeDragSource();const t=this.getGui();this.gos.get("enableCellTextSelection")&&(this.removeMouseDownListener(),this.mouseDownListener=this.addManagedElementListeners(t,{mousedown:s=>{s==null||s.preventDefault()}})[0]);const i=this.localeService.getLocaleTextFunc();this.dragSource={type:2,eElement:t,dragItemName:()=>{var n;const s=this.getDragItem(),o=((n=s.rowNodes)==null?void 0:n.length)||1,r=this.getRowDragText(this.column);return r?r(s,o):o===1?this.cellValueFn():`${o} ${i("rowDragRows","rows")}`},getDragItem:()=>this.getDragItem(),dragStartPixels:e,dragSourceDomDataKey:this.gos.getDomDataKey()},this.beans.dragAndDropService.addDragSource(this.dragSource,!0)}destroy(){this.removeDragSource(),this.removeMouseDownListener(),super.destroy()}removeDragSource(){this.dragSource&&(this.beans.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null)}removeMouseDownListener(){this.mouseDownListener&&(this.mouseDownListener(),this.mouseDownListener=void 0)}},Sr=class extends v{constructor(e,t,i){super(),this.parent=e,this.rowNode=t,this.column=i}setDisplayedOrVisible(e){const t={skipAriaHidden:!0};if(e)this.parent.setDisplayed(!1,t);else{let i=!0,s=!1;this.column&&(i=this.column.isRowDrag(this.rowNode)||this.parent.isCustomGui(),s=as(this.column.getColDef().rowDrag)),s?(this.parent.setDisplayed(!0,t),this.parent.setVisible(i,t)):(this.parent.setDisplayed(i,t),this.parent.setVisible(!0,t))}}},$a=class extends Sr{constructor(e,t,i,s){super(e,i,s),this.beans=t}postConstruct(){this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this));const e=this.workOutVisibility.bind(this);this.addManagedListeners(this.rowNode,{dataChanged:e,cellChanged:e}),this.addManagedListeners(this.beans.eventService,{newColumnsLoaded:e}),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const e=this.gos.get("suppressRowDrag");this.setDisplayedOrVisible(e)}},ja=class extends Sr{constructor(e,t,i,s){super(e,i,s),this.beans=t}postConstruct(){const e=this.workOutVisibility.bind(this);this.addManagedListeners(this.beans.eventService,{sortChanged:e,filterChanged:e,columnRowGroupChanged:e,newColumnsLoaded:e}),this.addManagedListeners(this.rowNode,{dataChanged:e,cellChanged:e}),this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const t=this.beans.ctrlsService.getGridBodyCtrl().getRowDragFeature(),i=t&&t.shouldPreventRowMove(),s=this.gos.get("suppressRowDrag"),o=this.beans.dragAndDropService.hasExternalDropZones(),r=i&&!o||s;this.setDisplayedOrVisible(r)}},qa=new Set(["localEventService","__objectId","sticky","__autoHeights","checkAutoHeightsDebounced"]),Vt=class Ae{constructor(t){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=Ae.OBJECT_ID_SEQUENCE++,this.__autoHeights={},this.alreadyRendered=!1,this.highlighted=null,this.hovered=!1,this.selected=!1,this.beans=t}setData(t){this.setDataCommon(t,!1)}updateData(t){this.setDataCommon(t,!0)}setDataCommon(t,i){var r;const s=this.data;this.data=t,this.beans.valueCache.onDataChanged(),this.updateDataOnDetailNode(),this.checkRowSelectable(),this.resetQuickFilterAggregateText();const o=this.createDataChangedEvent(t,s,i);(r=this.localEventService)==null||r.dispatchEvent(o)}updateDataOnDetailNode(){this.detailNode&&(this.detailNode.data=this.data)}createDataChangedEvent(t,i,s){return{type:"dataChanged",node:this,oldData:i,newData:t,update:s}}getRowIndexString(){return this.rowIndex==null?(O("Could not find rowIndex, this means tasks are being executed on a rowNode that has been removed from the grid."),null):this.rowPinned==="top"?Ae.ID_PREFIX_TOP_PINNED+this.rowIndex:this.rowPinned==="bottom"?Ae.ID_PREFIX_BOTTOM_PINNED+this.rowIndex:this.rowIndex.toString()}createDaemonNode(){const t=new Ae(this.beans);return t.id=this.id,t.data=this.data,t.__daemon=!0,t.selected=this.selected,t.level=this.level,t}setDataAndId(t,i){var n;const s=F(this.id)?this.createDaemonNode():null,o=this.data;this.data=t,this.updateDataOnDetailNode(),this.setId(i),this.checkRowSelectable(),this.beans.selectionService.syncInRowNode(this,s);const r=this.createDataChangedEvent(t,o,!1);(n=this.localEventService)==null||n.dispatchEvent(r)}checkRowSelectable(){const t=ds(this.beans.gos);this.setRowSelectable(t?t(this):!0)}setRowSelectable(t,i){if(this.selectable!==t){if(this.selectable=t,this.dispatchRowEvent("selectableChanged"),i)return;if(Qe(this.beans.gos)){const o=this.calculateSelectedFromChildren();this.setSelectedParams({newValue:o??!1,source:"selectableChanged"});return}this.isSelected()&&!this.selectable&&this.setSelectedParams({newValue:!1,source:"selectableChanged"})}}setId(t){var s;const i=ut(this.beans.gos);if(i)if(this.data){const o=((s=this.parent)==null?void 0:s.getRoute())??[];this.id=i({data:this.data,parentKeys:o.length>0?o:void 0,level:this.level,rowPinned:this.rowPinned}),this.id.startsWith(Ae.ID_PREFIX_ROW_GROUP)&&O(`Row IDs cannot start with ${Ae.ID_PREFIX_ROW_GROUP}, this is a reserved prefix for AG Grid's row grouping feature.`)}else this.id=void 0;else this.id=t}setRowTop(t){this.oldRowTop=this.rowTop,this.rowTop!==t&&(this.rowTop=t,this.dispatchRowEvent("topChanged"),this.setDisplayed(t!==null))}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setHovered(t){this.hovered=t}isHovered(){return this.hovered}setMaster(t){this.master!==t&&(this.master&&!t&&(this.expanded=!1),this.master=t,this.dispatchRowEvent("masterChanged"))}setGroup(t){this.group!==t&&(this.group&&!t&&(this.expanded=!1),this.group=t,this.updateHasChildren(),this.checkRowSelectable(),this.dispatchRowEvent("groupChanged"))}setRowHeight(t,i=!1){this.rowHeight=t,this.rowHeightEstimated=i,this.dispatchRowEvent("heightChanged")}setRowAutoHeight(t,i){this.__autoHeights||(this.__autoHeights={}),this.__autoHeights[i.getId()]=t,t!=null&&(this.checkAutoHeightsDebounced==null&&(this.checkAutoHeightsDebounced=Y(this.checkAutoHeights.bind(this),1)),this.checkAutoHeightsDebounced())}checkAutoHeights(){var l;let t=!1,i=!0,s=0;const o=this.__autoHeights;if(o==null||(this.beans.visibleColsService.getAllAutoHeightCols().forEach(a=>{let d=o[a.getId()];if(d==null)if(this.beans.columnModel.isColSpanActive()){let h=[];switch(a.getPinned()){case"left":h=this.beans.visibleColsService.getLeftColsForRow(this);break;case"right":h=this.beans.visibleColsService.getRightColsForRow(this);break;case null:h=this.beans.columnViewportService.getColsWithinViewport(this);break}if(h.includes(a)){t=!0;return}d=-1}else{t=!0;return}else i=!1;d>s&&(s=d)}),t)||((i||s<10)&&(s=Le(this.beans.gos,this).height),s==this.rowHeight))return;this.setRowHeight(s);const n=this.beans.rowModel;(l=n.onRowHeightChangedDebounced)==null||l.call(n)}setExpanded(t,i,s){if(this.expanded===t)return;this.expanded=t,this.dispatchRowEvent("expandedChanged");const o={...this.createGlobalRowEvent("rowGroupOpened"),expanded:t,event:i||null};this.beans.rowNodeEventThrottle.dispatchExpanded(o,s),this.beans.rowRenderer.refreshCells({rowNodes:[this]})}createGlobalRowEvent(t){return this.beans.gos.addGridCommonParams({type:t,node:this,data:this.data,rowIndex:this.rowIndex,rowPinned:this.rowPinned})}setDataValue(t,i,s){const r=(()=>typeof t!="string"?t:this.beans.columnModel.getCol(t)??this.beans.columnModel.getColDefCol(t))(),n=this.beans.valueService.getValueForDisplay(r,this);if(this.beans.gos.get("readOnlyEdit"))return this.beans.eventService.dispatchEvent({type:"cellEditRequest",event:null,rowIndex:this.rowIndex,rowPinned:this.rowPinned,column:r,colDef:r.getColDef(),data:this.data,node:this,oldValue:n,newValue:i,value:i,source:s}),!1;const l=this.beans.valueService.setValue(this,r,i,s);return this.dispatchCellChangedEvent(r,i,n),this.checkRowSelectable(),l}setGroupValue(t,i){const s=this.beans.columnModel.getCol(t);A(this.groupData)&&(this.groupData={});const o=s.getColId(),r=this.groupData[o];r!==i&&(this.groupData[o]=i,this.dispatchCellChangedEvent(s,i,r))}setAggData(t){const i=this.aggData;if(this.aggData=t,this.localEventService){const s=o=>{const r=this.aggData?this.aggData[o]:void 0,n=i?i[o]:void 0;if(r===n)return;const l=this.beans.columnModel.getCol(o);l&&this.dispatchCellChangedEvent(l,r,n)};for(const o in i)s(o);for(const o in t)(!i||!(o in i))&&s(o)}}updateHasChildren(){let t=this.group&&!this.footer||this.childrenAfterGroup&&this.childrenAfterGroup.length>0;if(De(this.beans.gos)){const s=this.beans.gos.get("treeData"),o=this.beans.gos.get("isServerSideGroup");t=!this.stub&&!this.footer&&(s?!!o&&o(this.data):!!this.group)}t!==this.__hasChildren&&(this.__hasChildren=!!t,this.dispatchRowEvent("hasChildrenChanged"))}hasChildren(){return this.__hasChildren==null&&this.updateHasChildren(),this.__hasChildren}dispatchCellChangedEvent(t,i,s){var r;const o={type:"cellChanged",node:this,column:t,newValue:i,oldValue:s};(r=this.localEventService)==null||r.dispatchEvent(o)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return this.footer?!1:this.beans.columnModel.isPivotMode()?this.hasChildren()&&!this.leafGroup:this.hasChildren()||!!this.master}isSelected(){return this.footer?this.sibling.isSelected():this.selected}depthFirstSearch(t){this.childrenAfterGroup&&this.childrenAfterGroup.forEach(i=>i.depthFirstSearch(t)),t(this)}calculateSelectedFromChildren(){var s;let t=!1,i=!1;if(!((s=this.childrenAfterGroup)!=null&&s.length))return this.selectable?this.selected:null;for(let o=0;o<this.childrenAfterGroup.length;o++){const r=this.childrenAfterGroup[o];let n=r.isSelected();if(!r.selectable){const l=r.calculateSelectedFromChildren();if(l===null)continue;n=l}switch(n){case!0:t=!0;break;case!1:i=!0;break;default:return}}if(!(t&&i))return t?!0:i?!1:this.selectable?this.selected:null}setSelectedInitialValue(t){this.selected=t}dispatchRowEvent(t){var i;(i=this.localEventService)==null||i.dispatchEvent({type:t,node:this})}selectThisNode(t,i,s="api"){const o=!this.selectable&&t,r=this.selected===t;if(o||r)return!1;this.selected=t,this.dispatchRowEvent("rowSelected");const n=this.sibling;return n&&n.footer&&n.localEventService&&n.dispatchRowEvent("rowSelected"),this.beans.eventService.dispatchEvent({...this.createGlobalRowEvent("rowSelected"),event:i||null,source:s}),!0}setSelected(t,i=!1,s="api"){if(typeof s=="boolean"){S("since version v30, rowNode.setSelected() property `suppressFinishActions` has been removed, please use `gridApi.setNodesSelected()` for bulk actions, and the event `source` property for ignoring events instead.");return}this.setSelectedParams({newValue:t,clearSelection:i,rangeSelect:!1,source:s})}setSelectedParams(t){return this.rowPinned?(S("cannot select pinned rows"),0):this.id===void 0?(S("cannot select node until id for node is known"),0):this.beans.selectionService.setNodesSelected({...t,nodes:[this.footer?this.sibling:this]})}isRowPinned(){return!!this.rowPinned}addEventListener(t,i){var o;this.localEventService||(this.localEventService=new ct),this.beans.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.localEventService.setFrameworkOverrides(this.beans.frameworkOverrides),this.frameworkEventListenerService=new gs(this.beans.frameworkOverrides));const s=((o=this.frameworkEventListenerService)==null?void 0:o.wrap(i))??i;this.localEventService.addEventListener(t,s)}removeEventListener(t,i){var o;if(!this.localEventService)return;const s=((o=this.frameworkEventListenerService)==null?void 0:o.unwrap(i))??i;this.localEventService.removeEventListener(t,s),this.localEventService.noRegisteredListenersExist()&&(this.localEventService=null)}onMouseEnter(){this.dispatchRowEvent("mouseEnter")}onMouseLeave(){this.dispatchRowEvent("mouseLeave")}isFullWidthCell(){if(S("since version v32.2.0, rowNode.isFullWidthCell() has been deprecated. Instead check `rowNode.detail` followed by the user provided `isFullWidthRow` grid option."),this.detail)return!0;const t=this.beans.gos.getCallback("isFullWidthRow");return t?t({rowNode:this}):!1}getRoute(){if(this.level===-1)return[];if(this.key==null)return;const t=[];let i=this;for(;i&&i.key!=null;)t.push(i.key),i=i.parent;return t.reverse()}createFooter(){if(this.sibling)return;const t=new Ae(this.beans);Object.keys(this).forEach(i=>{qa.has(i)||(t[i]=this[i])}),t.footer=!0,t.setRowTop(null),t.setRowIndex(null),t.oldRowTop=null,t.id="rowGroupFooter_"+this.id,t.sibling=this,this.sibling=t}destroyFooter(){this.sibling&&(this.sibling.setRowTop(null),this.sibling.setRowIndex(null),this.sibling=void 0)}setFirstChild(t){this.firstChild!==t&&(this.firstChild=t,this.dispatchRowEvent("firstChildChanged"))}setLastChild(t){this.lastChild!==t&&(this.lastChild=t,this.dispatchRowEvent("lastChildChanged"))}setChildIndex(t){this.childIndex!==t&&(this.childIndex=t,this.dispatchRowEvent("childIndexChanged"))}setDisplayed(t){this.displayed!==t&&(this.displayed=t,this.dispatchRowEvent("displayedChanged"))}setDragging(t){this.dragging!==t&&(this.dragging=t,this.dispatchRowEvent("draggingChanged"))}setHighlighted(t){this.highlighted!==t&&(this.highlighted=t,this.dispatchRowEvent("rowHighlightChanged"))}setAllChildrenCount(t){this.allChildrenCount!==t&&(this.allChildrenCount=t,this.dispatchRowEvent("allChildrenCountChanged"))}setRowIndex(t){this.rowIndex!==t&&(this.rowIndex=t,this.dispatchRowEvent("rowIndexChanged"))}setUiLevel(t){this.uiLevel!==t&&(this.uiLevel=t,this.dispatchRowEvent("uiLevelChanged"))}};Vt.ID_PREFIX_ROW_GROUP="row-group-";Vt.ID_PREFIX_TOP_PINNED="t-";Vt.ID_PREFIX_BOTTOM_PINNED="b-";Vt.OBJECT_ID_SEQUENCE=0;var be=Vt,Ya=class extends v{constructor(){super(...arguments),this.beanName="filterManager",this.advancedFilterModelUpdateQueue=[]}wireBeans(e){this.columnModel=e.columnModel,this.dataTypeService=e.dataTypeService,this.quickFilterService=e.quickFilterService,this.advancedFilterService=e.advancedFilterService,this.columnFilterService=e.columnFilterService}postConstruct(){const e=this.refreshFiltersForAggregations.bind(this),t=this.updateAdvancedFilterColumns.bind(this);this.addManagedEventListeners({columnValueChanged:e,columnPivotChanged:e,columnPivotModeChanged:e,newColumnsLoaded:t,columnVisible:t,advancedFilterEnabledChanged:({enabled:i})=>this.onAdvancedFilterEnabledChanged(i),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],()=>{this.onFilterChanged({source:"api"})}),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",()=>{this.updateAggFiltering(),this.onFilterChanged()}),this.addManagedPropertyListener("advancedFilterModel",i=>this.setAdvancedFilterModel(i.currentValue)),this.quickFilterService&&this.addManagedListeners(this.quickFilterService,{quickFilterChanged:()=>this.onFilterChanged({source:"quickFilter"})})}isExternalFilterPresentCallback(){const e=this.gos.getCallback("isExternalFilterPresent");return typeof e=="function"?e({}):!1}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return typeof t=="function"?t(e):!1}setFilterModel(e,t="api"){var i;if(this.isAdvancedFilterEnabled()){this.warnAdvancedFilters();return}(i=this.columnFilterService)==null||i.setFilterModel(e,t)}getFilterModel(){var e;return((e=this.columnFilterService)==null?void 0:e.getFilterModel())??{}}isColumnFilterPresent(){var e;return!!((e=this.columnFilterService)!=null&&e.isColumnFilterPresent())}isAggregateFilterPresent(){var e;return!!((e=this.columnFilterService)!=null&&e.isAggregateFilterPresent())}isExternalFilterPresent(){return this.externalFilterPresent}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}isAdvancedFilterPresent(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isFilterPresent()}onAdvancedFilterEnabledChanged(e){var t,i;e?(t=this.columnFilterService)!=null&&t.disableColumnFilters()&&this.onFilterChanged({source:"advancedFilter"}):(i=this.advancedFilterService)!=null&&i.isFilterPresent()&&(this.advancedFilterService.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvancedFilterEnabled(){var e;return!!((e=this.advancedFilterService)!=null&&e.isEnabled())}isAdvancedFilterHeaderActive(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isHeaderActive()}isAnyFilterPresent(){return this.isQuickFilterPresent()||this.isColumnFilterPresent()||this.isAggregateFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}resetQuickFilterCache(){var e;(e=this.quickFilterService)==null||e.resetQuickFilterCache()}refreshFiltersForAggregations(){Wi(this.gos)&&this.onFilterChanged()}onFilterChanged(e={}){const{source:t,additionalEventAttributes:i,columns:s=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.columnFilterService?this.columnFilterService.updateBeforeFilterChanged(e):te.resolve()).then(()=>{var r;const o={source:t,type:"filterChanged",columns:s};i&&q(o,i),this.eventService.dispatchEvent(o),(r=this.columnFilterService)==null||r.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){var e;return!!((e=this.columnFilterService)!=null&&e.isSuppressFlashingCellsBecauseFiltering())}isQuickFilterPresent(){var e;return!!((e=this.quickFilterService)!=null&&e.isQuickFilterPresent())}updateAggFiltering(){this.aggFiltering=!!Wi(this.gos)}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.columnModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(e,t){return this.doesRowPassFilter({rowNode:t,filterInstanceToSkip:e})}doesRowPassAggregateFilters(e){return!(this.isAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode)||this.isAggregateFilterPresent()&&!this.columnFilterService.doAggregateFiltersPass(e.rowNode,e.filterInstanceToSkip))}doesRowPassFilter(e){return!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode)||this.isExternalFilterPresent()&&!this.doesExternalFilterPass(e.rowNode)||this.isColumnFilterPresent()&&!this.columnFilterService.doColumnFiltersPass(e.rowNode,e.filterInstanceToSkip)||this.isAdvancedFilterPresent()&&!this.advancedFilterService.doesFilterPass(e.rowNode))}isFilterActive(e){var t;return!!((t=this.columnFilterService)!=null&&t.isFilterActive(e))}getOrCreateFilterWrapper(e){var t;return((t=this.columnFilterService)==null?void 0:t.getOrCreateFilterWrapper(e))??null}getDefaultFloatingFilter(e){return this.columnFilterService.getDefaultFloatingFilter(e)}createFilterParams(e,t){return this.columnFilterService.createFilterParams(e,t)}isFilterAllowed(e){var t;return this.isAdvancedFilterEnabled()?!1:!!((t=this.columnFilterService)!=null&&t.isFilterAllowed(e))}getFloatingFilterCompDetails(e,t){var i;return(i=this.columnFilterService)==null?void 0:i.getFloatingFilterCompDetails(e,t)}getCurrentFloatingFilterParentModel(e){var t;return(t=this.columnFilterService)==null?void 0:t.getCurrentFloatingFilterParentModel(e)}destroyFilter(e,t="api"){var i;(i=this.columnFilterService)==null||i.destroyFilter(e,t)}areFilterCompsDifferent(e,t){var i;return!!((i=this.columnFilterService)!=null&&i.areFilterCompsDifferent(e,t))}getAdvancedFilterModel(){return this.isAdvancedFilterEnabled()?this.advancedFilterService.getModel():null}setAdvancedFilterModel(e){var t;if(this.isAdvancedFilterEnabled()){if((t=this.dataTypeService)!=null&&t.isPendingInference()){this.advancedFilterModelUpdateQueue.push(e);return}this.advancedFilterService.setModel(e??null),this.onFilterChanged({source:"advancedFilter"})}}toggleAdvancedFilterBuilder(e,t){this.isAdvancedFilterEnabled()&&this.advancedFilterService.getCtrl().toggleFilterBuilder({source:t,force:e})}updateAdvancedFilterColumns(){this.isAdvancedFilterEnabled()&&this.advancedFilterService.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){var e;return this.isAdvancedFilterEnabled()?!1:!!((e=this.columnFilterService)!=null&&e.hasFloatingFilters())}getFilterInstance(e,t){var i;if(this.isAdvancedFilterEnabled()){this.warnAdvancedFilters();return}return(i=this.columnFilterService)==null?void 0:i.getFilterInstance(e,t)}getColumnFilterInstance(e){var t;return this.isAdvancedFilterEnabled()?(this.warnAdvancedFilters(),Promise.resolve(void 0)):((t=this.columnFilterService)==null?void 0:t.getColumnFilterInstance(e))??Promise.resolve(void 0)}warnAdvancedFilters(){S("Column Filter API methods have been disabled as Advanced Filters are enabled.")}setupAdvancedFilterHeaderComp(e){var t;(t=this.advancedFilterService)==null||t.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvancedFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvancedFilterHeaderActive()?this.advancedFilterService.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){this.advancedFilterModelUpdateQueue.forEach(e=>this.setAdvancedFilterModel(e)),this.advancedFilterModelUpdateQueue=[]}getColumnFilterModel(e){var t;return(t=this.columnFilterService)==null?void 0:t.getColumnFilterModel(e)}setColumnFilterModel(e,t){var i;return this.isAdvancedFilterEnabled()?(this.warnAdvancedFilters(),Promise.resolve()):((i=this.columnFilterService)==null?void 0:i.setColumnFilterModel(e,t))??Promise.resolve()}setColDefPropertiesForDataType(e,t,i){var s;(s=this.columnFilterService)==null||s.setColDefPropertiesForDataType(e,t,i)}},Qa=class extends G{constructor(e,t){super('<div class="ag-filter"></div>'),this.column=e,this.source=t,this.filterWrapper=null}wireBeans(e){this.filterManager=e.filterManager,this.columnModel=e.columnModel}postConstruct(){this.createFilter(!0),this.addManagedEventListeners({filterDestroyed:this.onFilterDestroyed.bind(this)})}hasFilter(){return!!this.filterWrapper}getFilter(){var e;return((e=this.filterWrapper)==null?void 0:e.filterPromise)??null}afterInit(){var e,t;return((t=(e=this.filterWrapper)==null?void 0:e.filterPromise)==null?void 0:t.then(()=>{}))??te.resolve()}afterGuiAttached(e){var t,i;(i=(t=this.filterWrapper)==null?void 0:t.filterPromise)==null||i.then(s=>{var o;(o=s==null?void 0:s.afterGuiAttached)==null||o.call(s,e)})}afterGuiDetached(){var e,t;(t=(e=this.filterWrapper)==null?void 0:e.filterPromise)==null||t.then(i=>{var s;(s=i==null?void 0:i.afterGuiDetached)==null||s.call(i)})}createFilter(e){var s,o;const{column:t,source:i}=this;this.filterWrapper=((s=this.filterManager)==null?void 0:s.getOrCreateFilterWrapper(t))??null,(o=this.filterWrapper)!=null&&o.filterPromise&&this.filterWrapper.filterPromise.then(r=>{const n=r.getGui();F(n)||S(`getGui method from filter returned ${n}; it should be a DOM element.`),this.appendChild(n),e&&this.eventService.dispatchEvent({type:"filterOpened",column:t,source:i,eGui:this.getGui()})})}onFilterDestroyed(e){(e.source==="api"||e.source==="paramsUpdated")&&e.column.getId()===this.column.getId()&&this.columnModel.getColDefCol(this.column)&&(U(this.getGui()),this.createFilter())}destroy(){this.filterWrapper=null,super.destroy()}},yr="ag-resizer-wrapper",Me=(e,t)=>`<div data-ref="${e}Resizer" class="ag-resizer ag-resizer-${t}"></div>`,Xa=`<div class="${yr}"> ${Me("eTopLeft","topLeft")} ${Me("eTop","top")} ${Me("eTopRight","topRight")} ${Me("eRight","right")} ${Me("eBottomRight","bottomRight")} ${Me("eBottom","bottom")} ${Me("eBottomLeft","bottomLeft")} ${Me("eLeft","left")} </div>`,Ja=class extends v{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.popupService=e.popupService,this.resizeObserverService=e.resizeObserverService,this.dragService=e.dragService}center(){const{clientHeight:e,clientWidth:t}=this.offsetParent,i=t/2-this.getWidth()/2,s=e/2-this.getHeight()/2;this.offsetElement(i,s)}initialisePosition(){if(this.positioned)return;const{centered:e,forcePopupParentAsOffsetParent:t,minWidth:i,width:s,minHeight:o,height:r,x:n,y:l}=this.config;this.offsetParent||this.setOffsetParent();let a=0,d=0;const h=ue(this.element);if(h){const c=this.findBoundaryElement(),u=window.getComputedStyle(c);if(u.minWidth!=null){const g=c.offsetWidth-this.element.offsetWidth;d=parseInt(u.minWidth,10)-g}if(u.minHeight!=null){const g=c.offsetHeight-this.element.offsetHeight;a=parseInt(u.minHeight,10)-g}}if(this.minHeight=o||a,this.minWidth=i||d,s&&this.setWidth(s),r&&this.setHeight(r),(!s||!r)&&this.refreshSize(),e)this.center();else if(n||l)this.offsetElement(n,l);else if(h&&t){let c=this.boundaryEl,u=!0;if(c||(c=this.findBoundaryElement(),u=!1),c){const g=parseFloat(c.style.top),p=parseFloat(c.style.left);u?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 i=this.moveElementDragListener||{eElement:t,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};e?(this.dragService.addDragSource(i),this.moveElementDragListener=i):(this.dragService.removeDragSource(i),this.moveElementDragListener=void 0)}setResizable(e){if(this.clearResizeListeners(),e?this.addResizers():this.removeResizers(),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 s=!!e[t],o=this.getResizerElement(t),r={dragStartPixels:0,eElement:o,onDragStart:n=>this.onResizeStart(n,t),onDragging:this.onResize.bind(this),onDragStop:n=>this.onResizeEnd(n,t)};(s||!this.isAlive()&&!s)&&(s?(this.dragService.addDragSource(r),this.resizeListeners.push(r),o.style.pointerEvents="all"):o.style.pointerEvents="none",this.resizable[t]=s)})}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,i=this.element;let s=!1;if(typeof e=="string"&&e.indexOf("%")!==-1)Ft(i,e),e=sr(i),s=!0;else if(e=Math.max(this.minHeight,e),this.positioned){const o=this.getAvailableHeight();o&&e>o&&(e=o)}this.getHeight()!==e&&(s?(i.style.maxHeight="unset",i.style.minHeight="unset"):t?Ft(i,e):(i.style.height=`${e}px`,i.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:i}=this.offsetParent;if(!i)return null;const s=this.element.getBoundingClientRect(),o=this.offsetParent.getBoundingClientRect(),r=e?this.position.y:s.top,n=e?0:o.top;let l=0;if(t){const d=this.element.parentElement;if(d){const{bottom:h}=d.getBoundingClientRect();l=h-s.bottom}}return i+n-r-l}getWidth(){return this.element.offsetWidth}setWidth(e){const t=this.element,{popup:i}=this.config;let s=!1;if(typeof e=="string"&&e.indexOf("%")!==-1)ce(t,e),e=oi(t),s=!0;else if(this.positioned){e=Math.max(this.minWidth,e);const{clientWidth:o}=this.offsetParent,r=i?this.position.x:this.element.getBoundingClientRect().left;o&&e+r>o&&(e=o-r)}this.getWidth()!==e&&(s?(t.style.maxWidth="unset",t.style.minWidth="unset"):this.config.popup?ce(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:i}=this.config,s=i?this.boundaryEl:this.element;s&&(this.popupService.positionPopup({ePopup:s,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:e,y:t})}),this.setPosition(parseFloat(s.style.left),parseFloat(s.style.top)))}constrainSizeToAvailableHeight(e){if(!this.config.forcePopupParentAsOffsetParent)return;const t=()=>{const i=this.getAvailableHeight();this.element.style.setProperty("max-height",`${i}px`)};e?this.resizeObserverSubscriber=this.resizeObserverService.observeResize(this.popupService.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:i,isTop:s,anywhereWithin:o,topBuffer:r}=e,n=t.clientX-this.dragStartPosition.x,l=t.clientY-this.dragStartPosition.y,a=this.shouldSkipX(t,!!i,!!o,n)?0:n,d=this.shouldSkipY(t,!!s,r,l)?0:l;return{movementX:a,movementY:d}}shouldSkipX(e,t,i,s){const o=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),n=this.boundaryEl.getBoundingClientRect(),l=this.config.popup?this.position.x:o.left;let a=l<=0&&r.left>=e.clientX||r.right<=e.clientX&&r.right<=n.right;return a?!0:(t?a=s<0&&e.clientX>l+r.left||s>0&&e.clientX<l+r.left:i?a=s<0&&e.clientX>n.right||s>0&&e.clientX<l+r.left:a=s<0&&e.clientX>n.right||s>0&&e.clientX<n.right,a)}shouldSkipY(e,t,i=0,s){const o=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),n=this.boundaryEl.getBoundingClientRect(),l=this.config.popup?this.position.y:o.top;let a=l<=0&&r.top>=e.clientY||r.bottom<=e.clientY&&r.bottom<=n.bottom;return a?!0:(t?a=s<0&&e.clientY>l+r.top+i||s>0&&e.clientY<l+r.top:a=s<0&&e.clientY>n.bottom||s>0&&e.clientY<n.bottom,a)}createResizeMap(){const e=this.element;this.resizerMap={topLeft:{element:e.querySelector("[data-ref=eTopLeftResizer]")},top:{element:e.querySelector("[data-ref=eTopResizer]")},topRight:{element:e.querySelector("[data-ref=eTopRightResizer]")},right:{element:e.querySelector("[data-ref=eRightResizer]")},bottomRight:{element:e.querySelector("[data-ref=eBottomRightResizer]")},bottom:{element:e.querySelector("[data-ref=eBottomResizer]")},bottomLeft:{element:e.querySelector("[data-ref=eBottomLeftResizer]")},left:{element:e.querySelector("[data-ref=eLeftResizer]")}}}addResizers(){if(this.resizersAdded)return;const e=this.element;if(!e)return;const i=new DOMParser().parseFromString(Xa,"text/html").body;e.appendChild(i.firstChild),this.createResizeMap(),this.resizersAdded=!0}removeResizers(){this.resizerMap=void 0;const e=this.element.querySelector(`.${yr}`);e&&this.element.removeChild(e),this.resizersAdded=!1}getResizerElement(e){return this.resizerMap[e].element}onResizeStart(e,t){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.currentResizer={isTop:!!t.match(/top/i),isRight:!!t.match(/right/i),isBottom:!!t.match(/bottom/i),isLeft:!!t.match(/left/i)},this.element.classList.add("ag-resizing"),this.resizerMap[t].element.classList.add("ag-active");const{popup:i,forcePopupParentAsOffsetParent:s}=this.config;!i&&!s&&this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop),this.isResizing=!0,this.updateDragStartPosition(e.clientX,e.clientY)}getSiblings(){const t=this.element.parentElement;return t?Array.prototype.slice.call(t.children).filter(i=>!i.classList.contains("ag-hidden")):null}getMinSizeOfSiblings(){const e=this.getSiblings()||[];let t=0,i=0;for(let s=0;s<e.length;s++){const o=e[s],r=!!o.style.flex&&o.style.flex!=="0 0 auto";if(o===this.element)continue;let n=this.minHeight||0,l=this.minWidth||0;if(r){const a=window.getComputedStyle(o);a.minHeight&&(n=parseInt(a.minHeight,10)),a.minWidth&&(l=parseInt(a.minWidth,10))}else n=o.offsetHeight,l=o.offsetWidth;t+=n,i+=l}return{height:t,width:i}}applySizeToSiblings(e){let t=null;const i=this.getSiblings();if(i){for(let s=0;s<i.length;s++){const o=i[s];o!==t&&(e?o.style.height=`${o.offsetHeight}px`:o.style.width=`${o.offsetWidth}px`,o.style.flex="0 0 auto",o===this.element&&(t=i[s+1]))}t&&(t.style.removeProperty("height"),t.style.removeProperty("min-height"),t.style.removeProperty("max-height"),t.style.flex="1 1 auto")}}isResizable(){return Object.values(this.resizable).some(e=>e)}onResize(e){if(!this.isResizing||!this.currentResizer)return;const{popup:t,forcePopupParentAsOffsetParent:i}=this.config,{isTop:s,isRight:o,isBottom:r,isLeft:n}=this.currentResizer,l=o||n,a=r||s,{movementX:d,movementY:h}=this.calculateMouseMovement({e,isLeft:n,isTop:s}),c=this.position.x,u=this.position.y;let g=0,p=0;if(l&&d){const C=n?-1:1,f=this.getWidth(),w=f+d*C;let y=!1;n&&(g=f-w,(c+g<=0||w<=this.minWidth)&&(y=!0,g=0)),y||this.setWidth(w)}if(a&&h){const C=s?-1:1,f=this.getHeight(),w=f+h*C;let y=!1;s?(p=f-w,(u+p<=0||w<=this.minHeight)&&(y=!0,p=0)):!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&f<w&&this.getMinSizeOfSiblings().height+w>this.element.parentElement.offsetHeight&&(y=!0),y||this.setHeight(w)}this.updateDragStartPosition(e.clientX,e.clientY),((t||i)&&g||p)&&this.offsetElement(c+g,u+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:i}=this.position;let s;this.config.calculateTopBuffer&&(s=this.config.calculateTopBuffer());const{movementX:o,movementY:r}=this.calculateMouseMovement({e,isTop:!0,anywhereWithin:!0,topBuffer:s});this.offsetElement(t+o,i+r),this.updateDragStartPosition(e.clientX,e.clientY)}onMoveEnd(){this.isMoving=!1,this.boundaryEl=null,this.element.classList.remove("ag-moving")}setOffsetParent(){this.config.forcePopupParentAsOffsetParent?this.offsetParent=this.popupService.getPopupParent():this.offsetParent=this.element.offsetParent}findBoundaryElement(){let e=this.element;for(;e;){if(window.getComputedStyle(e).position!=="static")return e;e=e.parentElement}return this.element}clearResizeListeners(){for(;this.resizeListeners.length;){const e=this.resizeListeners.pop();this.dragService.removeDragSource(e)}}destroy(){super.destroy(),this.moveElementDragListener&&this.dragService.removeDragSource(this.moveElementDragListener),this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}},Rr=class Fr extends v{constructor(t,i={}){super(),this.eFocusableElement=t,this.callbacks=i,this.callbacks={shouldStopEventPropagation:()=>!1,onTabKeyDown:s=>{if(s.defaultPrevented)return;const o=this.focusService.findNextFocusableElement(this.eFocusableElement,!1,s.shiftKey);o&&(o.focus(),s.preventDefault())},...i}}wireBeans(t){this.focusService=t.focusService}postConstruct(){this.eFocusableElement.classList.add(Fr.FOCUS_MANAGED_CLASS),this.addKeyDownListeners(this.eFocusableElement),this.callbacks.onFocusIn&&this.addManagedElementListeners(this.eFocusableElement,{focusin:this.callbacks.onFocusIn}),this.callbacks.onFocusOut&&this.addManagedElementListeners(this.eFocusableElement,{focusout:this.callbacks.onFocusOut})}addKeyDownListeners(t){this.addManagedElementListeners(t,{keydown:i=>{if(!(i.defaultPrevented||Fe(i))){if(this.callbacks.shouldStopEventPropagation(i)){at(i);return}i.key===m.TAB?this.callbacks.onTabKeyDown(i):this.callbacks.handleKeyDown&&this.callbacks.handleKeyDown(i)}}})}};Rr.FOCUS_MANAGED_CLASS="ag-focus-managed";var Je=Rr,br={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 Es(e,t){return di(e)?(e.debounceMs!=null&&S("debounceMs is ignored when apply button is present"),0):e.debounceMs!=null?e.debounceMs:t}function di(e){return!!e.buttons&&e.buttons.indexOf("apply")>=0}var Za=class extends G{constructor(e){super(),this.filterNameKey=e,this.applyActive=!1,this.hidePopup=null,this.debouncePending=!1,this.appliedModel=null,this.eFilterBody=b,this.buttonListeners=[]}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){this.resetTemplate(),this.createManagedBean(new Je(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=new Ja(this.getPositionableElement(),{forcePopupParentAsOffsetParent:!0}),this.createBean(this.positionableFeature)}handleKeyDown(e){}getFilterTitle(){return this.translate(this.filterNameKey)}isFilterActive(){return!!this.appliedModel}resetTemplate(e){let t=this.getGui();t&&t.removeEventListener("submit",this.onFormSubmit);const i=` <form class="ag-filter-wrapper"> <div class="ag-filter-body-wrapper ag-${this.getCssIdentifier()}-body-wrapper" data-ref="eFilterBody"> ${this.createBodyTemplate()} </div> </form>`;this.setTemplate(i,this.getAgComponents(),e),t=this.getGui(),t&&t.addEventListener("submit",this.onFormSubmit)}isReadOnly(){return!!this.providedFilterParams.readOnly}init(e){this.setParams(e),this.resetUiToDefaults(!0).then(()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()})}setParams(e){this.providedFilterParams=e,this.applyActive=di(e),this.resetButtonsPanel(e)}updateParams(e){this.providedFilterParams=e,this.applyActive=di(e),this.resetUiToActiveModel(this.getModel(),()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()})}resetButtonsPanel(e,t){const{buttons:i,readOnly:s}=t??{},{buttons:o,readOnly:r}=e;if(s===r&&Mt(i,o))return;const n=o&&o.length>0&&!this.isReadOnly();if(this.eButtonsPanel?(U(this.eButtonsPanel),this.buttonListeners.forEach(d=>d()),this.buttonListeners=[]):n&&(this.eButtonsPanel=document.createElement("div"),this.eButtonsPanel.classList.add("ag-filter-apply-panel")),!n){this.eButtonsPanel&&Ce(this.eButtonsPanel);return}const l=document.createDocumentFragment(),a=d=>{let h,c;switch(d){case"apply":h=this.translate("applyFilter"),c=p=>this.onBtApply(!1,!1,p);break;case"clear":h=this.translate("clearFilter"),c=()=>this.onBtClear();break;case"reset":h=this.translate("resetFilter"),c=()=>this.onBtReset();break;case"cancel":h=this.translate("cancelFilter"),c=p=>{this.onBtCancel(p)};break;default:S("Unknown button type specified");return}const g=Ot(`<button type="${d==="apply"?"submit":"button"}" data-ref="${d}FilterButton" class="ag-button ag-standard-button ag-filter-apply-panel-button" >${h} </button>`);this.buttonListeners.push(...this.addManagedElementListeners(g,{click:c})),l.append(g)};o.forEach(d=>a(d)),this.eButtonsPanel.append(l),this.getGui().appendChild(this.eButtonsPanel)}getDefaultDebounceMs(){return 0}setupOnBtApplyDebounce(){const e=Es(this.providedFilterParams,this.getDefaultDebounceMs()),t=Y(this.checkApplyDebounce.bind(this),e);this.onBtApplyDebounce=()=>{this.debouncePending=!0,t()}}checkApplyDebounce(){this.debouncePending&&(this.debouncePending=!1,this.onBtApply())}getModel(){return this.appliedModel?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.providedFilterParams.closeOnApply&&this.close(e)}resetUiToActiveModel(e,t){const i=()=>{this.onUiChanged(!1,"prevent"),t==null||t()};e!=null?this.setModelIntoUi(e).then(i):this.resetUiToDefaults().then(i)}onBtClear(){this.resetUiToDefaults().then(()=>this.onUiChanged())}onBtReset(){this.onBtClear(),this.onBtApply()}applyModel(e="api"){const t=this.getModelFromUi();if(!this.isModelValid(t))return!1;const i=this.appliedModel;return this.appliedModel=t,!this.areModelsEqual(i,t)}isModelValid(e){return!0}onFormSubmit(e){e.preventDefault()}onBtApply(e=!1,t=!1,i){if(i&&i.preventDefault(),this.applyModel(t?"rowDataUpdated":"ui")){const o="columnFilter";this.providedFilterParams.filterChangedCallback({afterFloatingFilter:e,afterDataChange:t,source:o})}const{closeOnApply:s}=this.providedFilterParams;s&&this.applyActive&&!e&&!t&&this.close(i)}onNewRowsLoaded(){}close(e){if(!this.hidePopup)return;const t=e,i=t&&t.key;let s;(i==="Enter"||i==="Space")&&(s={keyboardEvent:t}),this.hidePopup(s),this.hidePopup=null}onUiChanged(e=!1,t){if(this.updateUiVisibility(),this.providedFilterParams.filterModifiedCallback(),this.applyActive&&!this.isReadOnly()){const i=this.isModelValid(this.getModelFromUi()),s=this.queryForHtmlElement('[data-ref="applyFilterButton"]');s&&Lt(s,!i)}e&&!t||t==="immediately"?this.onBtApply(e):(!this.applyActive&&!t||t==="debounce")&&this.onBtApplyDebounce()}afterGuiAttached(e){e&&(this.hidePopup=e.hidePopup),this.refreshFilterResizer(e==null?void 0:e.container)}refreshFilterResizer(e){if(!this.positionableFeature||e==="toolPanel")return;const t=e==="floatingFilter"||e==="columnFilter",{positionableFeature:i,gos:s}=this;t?(i.restoreLastSize(),i.setResizable(s.get("enableRtl")?{bottom:!0,bottomLeft:!0,left:!0}:{bottom:!0,bottomRight:!0,right:!0})):(this.positionableFeature.removeSizeFromEl(),this.positionableFeature.setResizable(!1)),this.positionableFeature.constrainSizeToAvailableHeight(!0)}afterGuiDetached(){this.checkApplyDebounce(),this.positionableFeature&&this.positionableFeature.constrainSizeToAvailableHeight(!1)}refresh(e){const t=this.providedFilterParams;return this.providedFilterParams=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.localeService.getLocaleTextFunc()(e,br[e])}getCellValue(e){return this.providedFilterParams.getValue(e)}getPositionableElement(){return this.eFilterBody}},ed=class extends bs{constructor(e){super(e,"ag-radio-button","radio")}isSelected(){return this.eInput.checked}toggle(){this.eInput.disabled||this.isSelected()||this.setValue(!0)}addInputListeners(){super.addInputListeners(),this.addManagedEventListeners({checkboxChanged:this.onChange.bind(this)})}onChange(e){e.selected&&e.name&&this.eInput.name&&this.eInput.name===e.name&&e.id&&this.eInput.id!==e.id&&this.setValue(!1,!0)}},td=class extends G{constructor(e="default",t=!1){super(`<div class="ag-list ag-${e}-list" role="listbox"></div>`),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 m.ENTER:if(!this.highlightedEl)this.setValue(this.getValue());else{const i=this.itemEls.indexOf(this.highlightedEl);this.setValueByIndex(i)}break;case m.DOWN:case m.UP:e.preventDefault(),this.navigate(t);break;case m.PAGE_DOWN:case m.PAGE_UP:case m.PAGE_HOME:case m.PAGE_END:e.preventDefault(),this.navigateToPage(t);break}}navigate(e){const t=e===m.DOWN;let i;if(!this.highlightedEl)i=this.itemEls[t?0:this.itemEls.length-1];else{let o=this.itemEls.indexOf(this.highlightedEl)+(t?1:-1);o=Math.min(Math.max(o,0),this.itemEls.length-1),i=this.itemEls[o]}this.highlightItem(i)}navigateToPage(e){if(!this.highlightedEl||this.itemEls.length===0)return;const t=this.itemEls.indexOf(this.highlightedEl),i=this.options.length-1,s=this.itemEls[0].clientHeight,o=Math.floor(this.getGui().clientHeight/s);let r=-1;e===m.PAGE_HOME?r=0:e===m.PAGE_END?r=i:e===m.PAGE_DOWN?r=Math.min(t+o,i):e===m.PAGE_UP&&(r=Math.max(t-o,0)),r!==-1&&this.highlightItem(this.itemEls[r])}addOptions(e){return e.forEach(t=>this.addOption(t)),this}addOption(e){const{value:t,text:i}=e,s=i||t;return this.options.push({value:t,text:s}),this.renderOption(t,s),this.updateIndices(),this}clearOptions(){this.options=[],this.reset(!0),this.itemEls.forEach(e=>{Ce(e)}),this.itemEls=[]}updateIndices(){const e=this.getGui().querySelectorAll(".ag-list-item");e.forEach((t,i)=>{Il(t,i+1),Tl(t,e.length)})}renderOption(e,t){const i=B(this.gos),s=i.createElement("div");ee(s,"option"),s.classList.add("ag-list-item",`ag-${this.cssIdentifier}-list-item`);const o=i.createElement("span");s.appendChild(o),o.textContent=t,this.unFocusable||(s.tabIndex=-1),this.itemEls.push(s),this.addManagedListeners(s,{mouseover:()=>this.highlightItem(s),mousedown:r=>{r.preventDefault(),r.stopPropagation(),this.setValue(e)}}),this.createManagedBean(new gt({getTooltipValue:()=>t,getGui:()=>s,getLocation:()=>"UNKNOWN",shouldDisplayTooltip:()=>o.scrollWidth>o.clientWidth})),this.getGui().appendChild(s)}setValue(e,t){if(this.value===e)return this.fireItemSelected(),this;if(e==null)return this.reset(t),this;const i=this.options.findIndex(s=>s.value===e);if(i!==-1){const s=this.options[i];this.value=s.value,this.displayValue=s.text,this.highlightItem(this.itemEls[i]),t||this.fireChangeEvent()}return this}setValueByIndex(e){return this.setValue(this.options[e].value)}getValue(){return this.value}getDisplayValue(){return this.displayValue}refreshHighlighted(){this.clearHighlighted();const e=this.options.findIndex(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(!ue(e))return;this.clearHighlighted(),this.highlightedEl=e,this.highlightedEl.classList.add(this.activeClass),si(this.highlightedEl,!0);const t=this.getGui(),{scrollTop:i,clientHeight:s}=t,{offsetTop:o,offsetHeight:r}=e;(o+r>i+s||o<i)&&this.highlightedEl.scrollIntoView({block:"nearest"}),this.unFocusable||this.highlightedEl.focus()}clearHighlighted(){!this.highlightedEl||!ue(this.highlightedEl)||(this.highlightedEl.classList.remove(this.activeClass),si(this.highlightedEl,!1),this.highlightedEl=null)}fireChangeEvent(){this.dispatchLocalEvent({type:"fieldValueChanged"}),this.fireItemSelected()}fireItemSelected(){this.dispatchLocalEvent({type:"selectedItem"})}},id=class extends pr{constructor(e){if(super(e,(e==null?void 0:e.template)||` <div class="ag-picker-field" role="presentation"> <div data-ref="eLabel"></div> <div data-ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-picker-collapsed"> <div data-ref="eDisplayField" class="ag-picker-field-display"></div> <div data-ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div> </div> </div>`,(e==null?void 0:e.agComponents)||[],e==null?void 0:e.className),this.isPickerDisplayed=!1,this.skipClick=!1,this.pickerGap=4,this.hideCurrentPicker=null,this.eLabel=b,this.eWrapper=b,this.eDisplayField=b,this.eIcon=b,this.ariaRole=e==null?void 0:e.ariaRole,this.onPickerFocusIn=this.onPickerFocusIn.bind(this),this.onPickerFocusOut=this.onPickerFocusOut.bind(this),!e)return;const{pickerGap:t,maxPickerHeight:i,variableWidth:s,minPickerWidth:o,maxPickerWidth:r}=e;t!=null&&(this.pickerGap=t),this.variableWidth=!!s,i!=null&&this.setPickerMaxHeight(i),o!=null&&this.setPickerMinWidth(o),r!=null&&this.setPickerMaxWidth(r)}wireBeans(e){this.popupService=e.popupService}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:i,inputWidth:s}=this.config;if(i){const o=ie(i,this.gos);o&&this.eIcon.appendChild(o)}s!=null&&this.setInputWidth(s)}setupAria(){const e=this.getAriaElement();e.setAttribute("tabindex",this.gos.get("tabIndex").toString()),ii(e,!1),this.ariaRole&&ee(e,this.ariaRole)}onLabelOrWrapperMouseDown(e){if(e){const t=this.getFocusableElement();if(t!==this.eWrapper&&(e==null?void 0: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 m.UP:case m.DOWN:case m.ENTER:case m.SPACE:e.preventDefault(),this.onLabelOrWrapperMouseDown();break;case m.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.localeService.getLocaleTextFunc(),{pickerAriaLabelKey:i,pickerAriaLabelValue:s,modalPicker:o=!0}=this.config,r={modal:o,eChild:e,closeOnEsc:!0,closedCallback:()=>{const u=Ao(this.gos);this.beforeHidePicker(),u&&this.isAlive()&&this.getFocusableElement().focus()},ariaLabel:t(i,s),anchorToElement:this.eWrapper};e.style.position="absolute";const n=this.popupService.addPopup(r),{maxPickerHeight:l,minPickerWidth:a,maxPickerWidth:d,variableWidth:h}=this;h?(a&&(e.style.minWidth=a),e.style.width=ys(oi(this.eWrapper)),d&&(e.style.maxWidth=d)):ai(e,d??oi(this.eWrapper));const c=l??`${Ss(this.popupService.getPopupParent())}px`;return e.style.setProperty("max-height",c),this.alignPickerToComponent(),n.hideFunc}alignPickerToComponent(){if(!this.pickerComponent)return;const{pickerType:e}=this.config,{pickerGap:t}=this,i=this.gos.get("enableRtl")?"right":"left";this.popupService.positionPopupByComponent({type:e,eventSource:this.eWrapper,ePopup:this.pickerComponent.getGui(),position:"under",alignSide:i,keepWithinBounds:!0,nudgeY:t})}beforeHidePicker(){this.destroyMouseWheelFunc&&(this.destroyMouseWheelFunc(),this.destroyMouseWheelFunc=void 0),this.toggleExpandedStyles(!1);const e=this.pickerComponent.getGui();e.removeEventListener("focusin",this.onPickerFocusIn),e.removeEventListener("focusout",this.onPickerFocusOut),this.isPickerDisplayed=!1,this.pickerComponent=void 0,this.hideCurrentPicker=null}toggleExpandedStyles(e){if(!this.isAlive())return;const t=this.getAriaElement();ii(t,e),this.eWrapper.classList.toggle("ag-picker-expanded",e),this.eWrapper.classList.toggle("ag-picker-collapsed",!e)}onPickerFocusIn(){this.togglePickerHasFocus(!0)}onPickerFocusOut(e){var t;(t=this.pickerComponent)!=null&&t.getGui().contains(e.relatedTarget)||this.togglePickerHasFocus(!1)}togglePickerHasFocus(e){this.pickerComponent&&this.eWrapper.classList.toggle("ag-picker-has-focus",e)}hidePicker(){this.hideCurrentPicker&&this.hideCurrentPicker()}setInputWidth(e){return ai(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()}},Ms=class extends id{constructor(e){super({pickerAriaLabelKey:"ariaLabelSelectField",pickerAriaLabelValue:"Select Field",pickerType:"ag-list",className:"ag-select",pickerIcon:"smallDown",ariaRole:"combobox",...e})}postConstruct(){super.postConstruct(),this.createListComponent(),this.eWrapper.tabIndex=this.gos.get("tabIndex");const{options:e,value:t,placeholder:i}=this.config;e!=null&&this.addOptions(e),t!=null&&this.setValue(t,!0),i&&t==null&&(this.eDisplayField.textContent=i),this.addManagedElementListeners(this.eWrapper,{focusout:this.onWrapperFocusOut.bind(this)})}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}createListComponent(){this.listComponent=this.createBean(new td("select",!0)),this.listComponent.setParentComponent(this);const e=this.listComponent.getAriaElement(),t=`ag-select-list-${this.listComponent.getCompId()}`;e.setAttribute("id",t),Nl(this.getAriaElement(),e),this.listComponent.addManagedListeners(this.listComponent,{selectedItem:()=>{this.hidePicker(),this.dispatchLocalEvent({type:"selectedItem"})}}),this.listComponent.addManagedListeners(this.listComponent,{fieldValueChanged:()=>{this.listComponent&&(this.setValue(this.listComponent.getValue(),!1,!0),this.hidePicker())}})}createPickerComponent(){return this.listComponent}onKeyDown(e){var i;const{key:t}=e;switch(t===m.TAB&&this.hidePicker(),t){case m.ENTER:case m.UP:case m.DOWN:case m.PAGE_UP:case m.PAGE_DOWN:case m.PAGE_HOME:case m.PAGE_END:e.preventDefault(),this.isPickerDisplayed?(i=this.listComponent)==null||i.handleKeyDown(e):super.onKeyDown(e);break;case m.ESCAPE:super.onKeyDown(e);break;case m.SPACE:this.isPickerDisplayed?e.preventDefault():super.onKeyDown(e);break}}showPicker(){this.listComponent&&(super.showPicker(),this.listComponent.refreshHighlighted())}addOptions(e){return e.forEach(t=>this.addOption(t)),this}addOption(e){return this.listComponent.addOption(e),this}clearOptions(){var e;return(e=this.listComponent)==null||e.clearOptions(),this}setValue(e,t,i){if(this.value===e||!this.listComponent)return this;if(i||this.listComponent.setValue(e,!0),this.listComponent.getValue()===this.getValue())return this;let o=this.listComponent.getDisplayValue();return o==null&&this.config.placeholder&&(o=this.config.placeholder),this.eDisplayField.textContent=o,this.setTooltip({newTooltipText:o??null,shouldDisplayTooltip:()=>this.eDisplayField.scrollWidth>this.eDisplayField.clientWidth}),super.setValue(e,t)}destroy(){this.listComponent&&(this.listComponent=this.destroyBean(this.listComponent)),super.destroy()}},sd={selector:"AG-SELECT",component:Ms},Pr=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions||t,this.mapCustomOptions(),this.selectDefaultItem(e)}getFilterOptions(){return this.filterOptions}mapCustomOptions(){this.filterOptions&&this.filterOptions.forEach(e=>{if(typeof e=="string")return;const t=[["displayKey"],["displayName"],["predicate","test"]],i=s=>s.some(o=>e[o]!=null)?!0:(S(`ignoring FilterOptionDef as it doesn't contain one of '${s}'`),!1);if(!t.every(i)){this.filterOptions=this.filterOptions.filter(s=>s===e)||[];return}this.customFilterOptions[e.displayKey]=e})}selectDefaultItem(e){if(e.defaultOption)this.defaultOption=e.defaultOption;else if(this.filterOptions.length>=1){const t=this.filterOptions[0];typeof t=="string"?this.defaultOption=t:t.displayKey?this.defaultOption=t.displayKey:S("invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'")}else S("no filter options for filter")}getDefaultOption(){return this.defaultOption}getCustomOption(e){return this.customFilterOptions[e]}},Dr=class extends Za{constructor(){super(...arguments),this.eTypes=[],this.eJoinOperatorPanels=[],this.eJoinOperatorsAnd=[],this.eJoinOperatorsOr=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}getNumberOfInputs(e){const t=this.optionsFactory.getCustomOption(e);if(t){const{numberOfInputs:s}=t;return s??1}return e&&["empty","notBlank","blank"].indexOf(e)>=0?0:e==="inRange"?2:1}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged(!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((t,i)=>{i===0?t.setValue(e,!0):t.setValue(this.optionsFactory.getDefaultOption(),!0)})}getModelFromUi(){const e=this.getUiCompleteConditions();return e.length===0?null:this.maxNumConditions>1&&e.length>1?{filterType:this.getFilterType(),operator:this.getJoinOperator(),conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map(e=>e.getValue())}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){return this.eJoinOperatorsOr.length===0?this.defaultJoinOperator:this.eJoinOperatorsOr[0].getValue()===!0?"OR":"AND"}areModelsEqual(e,t){if(!e&&!t)return!0;if(!e&&t||e&&!t)return!1;const i=!e.operator,s=!t.operator;if(!i&&s||i&&!s)return!1;let r;if(i){const n=e,l=t;r=this.areSimpleModelsEqual(n,l)}else{const n=e,l=t;r=n.operator===l.operator&&ke(n.conditions,l.conditions,(a,d)=>this.areSimpleModelsEqual(a,d))}return r}shouldRefresh(e){var r;const t=this.getModel(),i=t?t.conditions??[t]:null,s=((r=e.filterOptions)==null?void 0:r.map(n=>typeof n=="string"?n:n.displayKey))??this.getDefaultFilterOptions();return!(!(!i||i.every(n=>s.find(l=>l===n.type)!==void 0))||typeof e.maxNumConditions=="number"&&i&&i.length>e.maxNumConditions)}refresh(e){return!this.shouldRefresh(e)||!super.refresh(e)?!1:(this.setParams(e),this.removeConditionsAndOperators(0),this.createOption(),this.setModel(this.getModel()),!0)}setModelIntoUi(e){if(e.operator){const i=e;let s=i.conditions;s==null&&(s=[],S("Filter model is missing 'conditions'"));const o=this.validateAndUpdateConditions(s),r=this.getNumConditions();if(o<r)this.removeConditionsAndOperators(o);else if(o>r)for(let l=r;l<o;l++)this.createJoinOperatorPanel(),this.createOption();const n=i.operator==="OR";this.eJoinOperatorsAnd.forEach(l=>l.setValue(!n,!0)),this.eJoinOperatorsOr.forEach(l=>l.setValue(n,!0)),s.forEach((l,a)=>{this.eTypes[a].setValue(l.type,!0),this.setConditionIntoUi(l,a)})}else{const i=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(i.type,!0),this.setConditionIntoUi(i,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.onUiChanged(),te.resolve()}validateAndUpdateConditions(e){let t=e.length;return t>this.maxNumConditions&&(e.splice(this.maxNumConditions),S('Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.'),t=this.maxNumConditions),t}doesFilterPass(e){const t=this.getModel();if(t==null)return!0;const{operator:i}=t,s=[];if(i){const r=t;s.push(...r.conditions??[])}else s.push(t);return s[i&&i==="OR"?"some":"every"](r=>this.individualConditionPasses(e,r))}setParams(e){super.setParams(e),this.setNumConditions(e),this.defaultJoinOperator=this.getDefaultJoinOperator(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.optionsFactory=new Pr,this.optionsFactory.init(e,this.getDefaultFilterOptions()),this.createFilterListOptions(),this.createOption(),this.createMissingConditionsAndOperators(),this.isReadOnly()&&this.eFilterBody.setAttribute("tabindex","-1")}setNumConditions(e){this.maxNumConditions=e.maxNumConditions??2,this.maxNumConditions<1&&(S('"filterParams.maxNumConditions" must be greater than or equal to zero.'),this.maxNumConditions=1),this.numAlwaysVisibleConditions=e.numAlwaysVisibleConditions??1,this.numAlwaysVisibleConditions<1&&(S('"filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.'),this.numAlwaysVisibleConditions=1),this.numAlwaysVisibleConditions>this.maxNumConditions&&(S('"filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".'),this.numAlwaysVisibleConditions=this.maxNumConditions)}createOption(){const e=this.createManagedBean(new Ms);this.eTypes.push(e),e.addCssClass("ag-filter-select"),this.eFilterBody.appendChild(e.getGui());const t=this.createValueElement();this.eConditionBodies.push(t),this.eFilterBody.appendChild(t),this.putOptionsIntoDropdown(e),this.resetType(e);const i=this.getNumConditions()-1;this.forEachPositionInput(i,s=>this.resetInput(s)),this.addChangedListeners(e,i)}createJoinOperatorPanel(){const e=document.createElement("div");this.eJoinOperatorPanels.push(e),e.classList.add("ag-filter-condition");const t=this.createJoinOperator(this.eJoinOperatorsAnd,e,"and"),i=this.createJoinOperator(this.eJoinOperatorsOr,e,"or");this.eFilterBody.appendChild(e);const s=this.eJoinOperatorPanels.length-1,o=this.joinOperatorId++;this.resetJoinOperatorAnd(t,s,o),this.resetJoinOperatorOr(i,s,o),this.isReadOnly()||(t.onValueChange(this.listener),i.onValueChange(this.listener))}createJoinOperator(e,t,i){const s=this.createManagedBean(new ed);return e.push(s),s.addCssClass("ag-filter-condition-operator"),s.addCssClass(`ag-filter-condition-operator-${i}`),t.appendChild(s.getGui()),s}getDefaultJoinOperator(e){return e==="AND"||e==="OR"?e:"AND"}createFilterListOptions(){const e=this.optionsFactory.getFilterOptions();this.filterListOptions=e.map(t=>typeof t=="string"?this.createBoilerplateListOption(t):this.createCustomListOption(t))}putOptionsIntoDropdown(e){this.filterListOptions.forEach(t=>{e.addOption(t)}),e.setDisabled(this.filterListOptions.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,i=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:i?this.localeService.getLocaleTextFunc()(i.displayKey,i.displayName):this.translate(t)}}createBodyTemplate(){return""}getAgComponents(){return[]}getCssIdentifier(){return"simple-filter"}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){let e=-1,t=!0;for(let i=0;i<this.getNumConditions();i++)this.isConditionUiComplete(i)?e=i:t=!1;if(this.shouldAddNewConditionAtEnd(t))this.createJoinOperatorPanel(),this.createOption();else{const i=this.lastUiCompletePosition??this.getNumConditions()-2;if(e<i){this.removeConditionsAndOperators(i+1);const s=e+1,o=i-s;o>0&&this.removeConditionsAndOperators(s,o),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=e}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((s,o)=>{const r=this.isConditionDisabled(o,e);s.setDisabled(r||this.filterListOptions.length<=1),o===1&&(Lt(this.eJoinOperatorPanels[0],r),this.eJoinOperatorsAnd[0].setDisabled(r),this.eJoinOperatorsOr[0].setDisabled(r))}),this.eConditionBodies.forEach((s,o)=>{H(s,this.isConditionBodyVisible(o))});const i=(t??this.getJoinOperator())==="OR";this.eJoinOperatorsAnd.forEach(s=>{s.setValue(!i,!0)}),this.eJoinOperatorsOr.forEach(s=>{s.setValue(i,!0)}),this.forEachInput((s,o,r,n)=>{this.setElementDisplayed(s,o<n),this.setElementDisabled(s,this.isConditionDisabled(r,e))}),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;this.removeComponents(this.eTypes,e,t),this.removeElements(this.eConditionBodies,e,t),this.removeValueElements(e,t);const i=Math.max(e-1,0);this.removeElements(this.eJoinOperatorPanels,i,t),this.removeComponents(this.eJoinOperatorsAnd,i,t),this.removeComponents(this.eJoinOperatorsOr,i,t)}removeElements(e,t,i){this.removeItems(e,t,i).forEach(o=>Ce(o))}removeComponents(e,t,i){this.removeItems(e,t,i).forEach(o=>{Ce(o.getGui()),this.destroyBean(o)})}removeItems(e,t,i){return i==null?e.splice(t):e.splice(t,i)}afterGuiAttached(e){if(super.afterGuiAttached(e),this.resetPlaceholder(),!(e!=null&&e.suppressFocus))if(this.isReadOnly())this.eFilterBody.focus();else{const t=this.getInputs(0)[0];if(!t)return;t instanceof _e&&t.getInputElement().focus()}}afterGuiDetached(){super.afterGuiDetached();const e=this.getModel();this.resetUiToActiveModel(e);let t=-1,i=-1,s=!1;const o=this.getJoinOperator();for(let n=this.getNumConditions()-1;n>=0;n--)if(this.isConditionUiComplete(n))t===-1&&(t=n,i=n);else{const l=n>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(n-1),a=n<t;(l||a)&&(this.removeConditionsAndOperators(n,1),s=!0,a&&i--)}let r=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),r=!0),this.shouldAddNewConditionAtEnd(i===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),r=!0),r&&this.updateConditionStatusesAndValues(i,o),s&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=i}getPlaceholderText(e,t){let i=this.translate(e);if(as(this.filterPlaceholder)){const s=this.filterPlaceholder,o=this.eTypes[t].getValue(),r=this.translate(o);i=s({filterOptionKey:o,filterOption:r,placeholder:i})}else typeof this.filterPlaceholder=="string"&&(i=this.filterPlaceholder);return i}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc();this.forEachInput((t,i,s,o)=>{if(!(t instanceof _e))return;const r=i===0&&o>1?"inRangeStart":i===0?"filterOoo":"inRangeEnd",n=i===0&&o>1?e("ariaFilterFromValue","Filter from value"):i===0?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(r,s)),t.setInputAriaLabel(n)})}setElementValue(e,t,i){e instanceof _e&&e.setValue(t!=null?String(t):null,!0)}setElementDisplayed(e,t){e instanceof G&&H(e.getGui(),t)}setElementDisabled(e,t){e instanceof G&&Lt(e.getGui(),t)}attachElementOnChange(e,t){e instanceof _e&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach((t,i)=>{this.forEachPositionTypeInput(i,t,e)})}forEachPositionInput(e,t){const i=this.getConditionType(e);this.forEachPositionTypeInput(e,i,t)}forEachPositionTypeInput(e,t,i){const s=this.getNumberOfInputs(t),o=this.getInputs(e);for(let r=0;r<o.length;r++){const n=o[r];n!=null&&i(n,r,e,s)}}isConditionDisabled(e,t){return this.isReadOnly()?!0:e===0?!1:e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return this.getNumberOfInputs(t)>0}isConditionUiComplete(e){return!(e>=this.getNumConditions()||this.getConditionType(e)==="empty"||this.getValues(e).some(i=>i==null))}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const e=[];for(let t=0;t<this.getNumConditions();t++)this.isConditionUiComplete(t)&&e.push(this.createCondition(t));return e}createMissingConditionsAndOperators(){if(!this.isReadOnly())for(let e=this.getNumConditions();e<this.numAlwaysVisibleConditions;e++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){return this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach(t=>this.resetType(t)),this.eJoinOperatorsAnd.forEach((t,i)=>this.resetJoinOperatorAnd(t,i,this.joinOperatorId+i)),this.eJoinOperatorsOr.forEach((t,i)=>this.resetJoinOperatorOr(t,i,this.joinOperatorId+i)),this.joinOperatorId++,this.forEachInput(t=>this.resetInput(t)),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,e||this.onUiChanged(),te.resolve()}resetType(e){const i=this.localeService.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.getDefaultOption(),!0).setAriaLabel(i).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,i){this.resetJoinOperator(e,t,this.isDefaultOperator("AND"),this.translate("andCondition"),i)}resetJoinOperatorOr(e,t,i){this.resetJoinOperator(e,t,this.isDefaultOperator("OR"),this.translate("orCondition"),i)}resetJoinOperator(e,t,i,s,o){this.updateJoinOperatorDisabled(e.setValue(i,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${o}`).setLabel(s),t)}updateJoinOperatorsDisabled(){this.eJoinOperatorsAnd.forEach((e,t)=>this.updateJoinOperatorDisabled(e,t)),this.eJoinOperatorsOr.forEach((e,t)=>this.updateJoinOperatorDisabled(e,t))}updateJoinOperatorDisabled(e,t){e.setDisabled(this.isReadOnly()||t>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,t){const i=this.mapValuesFromModel(e);this.forEachInput((s,o,r)=>{r===t&&this.setElementValue(s,i[o]!=null?i[o]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,i,s)=>{this.setElementValue(t,i===0&&s===0?e:null,!0)})}isDefaultOperator(e){return e===this.defaultJoinOperator}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,i=>{this.attachElementOnChange(i,this.listener)}))}individualConditionPasses(e,t){const i=this.getCellValue(e.node),s=this.mapValuesFromModel(t),o=this.optionsFactory.getCustomOption(t.type),r=this.evaluateCustomFilter(o,s,i);return r??(i==null?this.evaluateNullValue(t.type):this.evaluateNonNullValue(s,i,t,e))}evaluateCustomFilter(e,t,i){if(e==null)return;const{predicate:s}=e;if(s!=null&&!t.some(o=>o==null))return s(t,i)}isBlank(e){return e==null||typeof e=="string"&&e.trim().length===0}hasInvalidInputs(){return!1}},Er=class extends Dr{setParams(e){super.setParams(e),this.scalarFilterParams=e}evaluateNullValue(e){switch(e){case"equals":if(this.scalarFilterParams.includeBlanksInEquals)return!0;break;case"notEqual":if(this.scalarFilterParams.includeBlanksInNotEqual)return!0;break;case"greaterThan":case"greaterThanOrEqual":if(this.scalarFilterParams.includeBlanksInGreaterThan)return!0;break;case"lessThan":case"lessThanOrEqual":if(this.scalarFilterParams.includeBlanksInLessThan)return!0;break;case"inRange":if(this.scalarFilterParams.includeBlanksInRange)return!0;break;case"blank":return!0;case"notBlank":return!1}return!1}evaluateNonNullValue(e,t,i){const s=this.comparator(),o=e[0]!=null?s(e[0],t):0;switch(i.type){case"equals":return o===0;case"notEqual":return o!==0;case"greaterThan":return o>0;case"greaterThanOrEqual":return o>=0;case"lessThan":return o<0;case"lessThanOrEqual":return o<=0;case"inRange":{const r=s(e[1],t);return this.scalarFilterParams.inRangeInclusive?o>=0&&r<=0:o>0&&r<0}case"blank":return this.isBlank(t);case"notBlank":return!this.isBlank(t);default:return S('Unexpected type of filter "'+i.type+'", it looks like the filter was configured with incorrect Filter Options'),!0}}},od=65,rd=67,nd=86,ld=68,ad=90,dd=89;function Mr(e){var i;return e.altKey||e.ctrlKey||e.metaKey?!1:((i=e.key)==null?void 0:i.length)===1}function Zi(e,t,i,s,o){const r=s?s.getColDef().suppressKeyboardEvent:void 0;if(!r)return!1;const n=e.addGridCommonParams({event:t,editing:o,column:s,node:i,data:i.data,colDef:s.getColDef()});return!!(r&&r(n))}function hd(e,t,i,s){const o=s.getDefinition(),r=o&&o.suppressHeaderKeyboardEvent;if(!F(r))return!1;const n=e.addGridCommonParams({colDef:o,column:s,headerRowIndex:i,event:t});return!!r(n)}function cd(e){const{keyCode:t}=e;let i;switch(t){case od:i=m.A;break;case rd:i=m.C;break;case nd:i=m.V;break;case ld:i=m.D;break;case ad:i=m.Z;break;case dd:i=m.Y;break;default:i=e.code}return i}function ud(e,t=!1){return e===m.DELETE?!0:!t&&e===m.BACKSPACE?Zo():!1}var Ze=class extends _e{constructor(e,t="ag-text-field",i="text"){super(e,t,i)}postConstruct(){super.postConstruct(),this.config.allowedCharPattern&&this.preventDisallowedCharacters()}setValue(e,t){return this.eInput.value!==e&&(this.eInput.value=F(e)?e:""),super.setValue(e,t)}setStartValue(e){this.setValue(e,!0)}preventDisallowedCharacters(){const e=new RegExp(`[${this.config.allowedCharPattern}]`),t=i=>{Mr(i)&&i.key&&!e.test(i.key)&&i.preventDefault()};this.addManagedListeners(this.eInput,{keydown:t,paste:i=>{var o;const s=(o=i.clipboardData)==null?void 0:o.getData("text");s&&s.split("").some(r=>!e.test(r))&&i.preventDefault()}})}},fi={selector:"AG-INPUT-TEXT-FIELD",component:Ze},xs=class extends Ze{constructor(e){super(e,"ag-number-field","number")}postConstruct(){super.postConstruct(),this.addManagedListeners(this.eInput,{blur:()=>{const o=parseFloat(this.eInput.value),r=isNaN(o)?"":this.normalizeValue(o.toString());this.value!==r&&this.setValue(r)},wheel:this.onWheel.bind(this)}),this.eInput.step="any";const{precision:e,min:t,max:i,step:s}=this.config;typeof e=="number"&&this.setPrecision(e),typeof t=="number"&&this.setMin(t),typeof i=="number"&&this.setMax(i),typeof s=="number"&&this.setStep(s)}onWheel(e){V(this.gos)===this.eInput&&e.preventDefault()}normalizeValue(e){if(e==="")return"";this.precision!=null&&(e=this.adjustPrecision(e));const t=parseFloat(e);return this.min!=null&&t<this.min?e=this.min.toString():this.max!=null&&t>this.max&&(e=this.max.toString()),e}adjustPrecision(e,t){if(this.precision==null)return e;if(t){const s=parseFloat(e).toFixed(this.precision);return parseFloat(s).toString()}const i=String(e).split(".");if(i.length>1){if(i[1].length<=this.precision)return e;if(this.precision>0)return`${i[0]}.${i[1].slice(0,this.precision)}`}return i[0]}setMin(e){return this.min===e?this:(this.min=e,ae(this.eInput,"min",e),this)}setMax(e){return this.max===e?this:(this.max=e,ae(this.eInput,"max",e),this)}setPrecision(e){return this.precision=e,this}setStep(e){return this.step===e?this:(this.step=e,ae(this.eInput,"step",e),this)}setValue(e,t){return this.setValueOrInputValue(i=>super.setValue(i,t),()=>this,e)}setStartValue(e){return this.setValueOrInputValue(t=>super.setValue(t,!0),t=>{this.eInput.value=t},e)}setValueOrInputValue(e,t,i){if(F(i)){let s=this.isScientificNotation(i);if(s&&this.eInput.validity.valid)return e(i);if(!s){i=this.adjustPrecision(i);const o=this.normalizeValue(i);s=i!=o}if(s)return t(i)}return e(i)}getValue(){if(!this.eInput.validity.valid)return;const e=this.eInput.value;return this.isScientificNotation(e)?this.adjustPrecision(e,!0):super.getValue()}isScientificNotation(e){return typeof e=="string"&&e.includes("e")}},gd={selector:"AG-INPUT-NUMBER-FIELD",component:xs},xr=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"],As=class{constructor(e,t,i){this.localeService=e,this.optionsFactory=t,this.valueFormatter=i}getModelAsString(e){if(!e)return null;const t=e.operator!=null,i=this.localeService.getLocaleTextFunc();if(t){const s=e,r=(s.conditions??[]).map(l=>this.getModelAsString(l)),n=s.operator==="AND"?"andCondition":"orCondition";return r.join(` ${i(n,br[n])} `)}else{if(e.type==="blank"||e.type==="notBlank")return i(e.type,e.type);{const s=e,o=this.optionsFactory.getCustomOption(s.type),{displayKey:r,displayName:n,numberOfInputs:l}=o||{};return r&&n&&l===0?(i(r,n),n):this.conditionToString(s,o)}}}updateParams(e){this.optionsFactory=e.optionsFactory}formatValue(e){return this.valueFormatter?this.valueFormatter(e??null)??"":String(e)}},Ar=class extends As{conditionToString(e,t){const{numberOfInputs:i}=t||{};return e.type=="inRange"||i===2?`${this.formatValue(e.filter)}-${this.formatValue(e.filterTo)}`:e.filter!=null?this.formatValue(e.filter):`${e.type}`}};function es(e){const{allowedCharPattern:t}=e??{};return t??null}var pd=class extends Er{constructor(){super("numberFilter"),this.eValuesFrom=[],this.eValuesTo=[]}refresh(e){return this.numberFilterParams.allowedCharPattern!==e.allowedCharPattern?!1:super.refresh(e)}mapValuesFromModel(e){const{filter:t,filterTo:i,type:s}=e||{};return[this.processValue(t),this.processValue(i)].slice(0,this.getNumberOfInputs(s))}getDefaultDebounceMs(){return 500}comparator(){return(e,t)=>e===t?0:e<t?1:-1}setParams(e){this.numberFilterParams=e,super.setParams(e),this.filterModelFormatter=new Ar(this.localeService,this.optionsFactory,this.numberFilterParams.numberFormatter)}getDefaultFilterOptions(){return xr}setElementValue(e,t,i){const s=!i&&this.numberFilterParams.numberFormatter?this.numberFilterParams.numberFormatter(t??null):t;super.setElementValue(e,s)}createValueElement(){const e=es(this.numberFilterParams),t=document.createElement("div");return t.classList.add("ag-filter-body"),ee(t,"presentation"),this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement(e,t,i,s){const o=this.createManagedBean(s?new Ze({allowedCharPattern:s}):new xs);o.addCssClass(`ag-filter-${i}`),o.addCssClass("ag-filter-filter"),t.push(o),e.appendChild(o.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}getValues(e){const t=[];return this.forEachPositionInput(e,(i,s,o,r)=>{s<r&&t.push(this.processValue(this.stringToFloat(i.getValue())))}),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getFilterType(){return"number"}processValue(e){return e==null||isNaN(e)?null:e}stringToFloat(e){if(typeof e=="number")return e;let t=Re(e);return t!=null&&t.trim()===""&&(t=null),this.numberFilterParams.numberParser?this.numberFilterParams.numberParser(t):t==null||t.trim()==="-"?null:parseFloat(t)}createCondition(e){const t=this.getConditionType(e),i={filterType:this.getFilterType(),type:t},s=this.getValues(e);return s.length>0&&(i.filter=s[0]),s.length>1&&(i.filterTo=s[1]),i}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e)??""}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>{if(!t.getInputElement().validity.valid){e=!0;return}}),e}},Tr=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],Ir=class extends As{conditionToString(e,t){const{numberOfInputs:i}=t||{};return e.type=="inRange"||i===2?`${e.filter}-${e.filterTo}`:e.filter!=null?`${e.filter}`:`${e.type}`}};function Lr(e){const t=e&&e.trim();return t===""?e:t}var fd=class extends Dr{constructor(){super("textFilter"),this.defaultFormatter=e=>e,this.defaultLowercaseFormatter=e=>e==null?null:e.toString().toLowerCase(),this.defaultMatcher=({filterOption:e,value:t,filterText:i})=>{if(i==null)return!1;switch(e){case"contains":return t.indexOf(i)>=0;case"notContains":return t.indexOf(i)<0;case"equals":return t===i;case"notEqual":return t!=i;case"startsWith":return t.indexOf(i)===0;case"endsWith":{const s=t.lastIndexOf(i);return s>=0&&s===t.length-i.length}default:return!1}},this.eValuesFrom=[],this.eValuesTo=[]}getDefaultDebounceMs(){return 500}setParams(e){this.textFilterParams=e,super.setParams(e),this.matcher=this.getTextMatcher(),this.formatter=this.textFilterParams.textFormatter||(this.textFilterParams.caseSensitive?this.defaultFormatter:this.defaultLowercaseFormatter),this.filterModelFormatter=new Ir(this.localeService,this.optionsFactory)}getTextMatcher(){const e=this.textFilterParams.textCustomComparator;return e?(S("textCustomComparator is deprecated, use textMatcher instead."),({filterOption:t,value:i,filterText:s})=>e(t,i,s)):this.textFilterParams.textMatcher||this.defaultMatcher}createCondition(e){const t=this.getConditionType(e),i={filterType:this.getFilterType(),type:t},s=this.getValuesWithSideEffects(e,!0);return s.length>0&&(i.filter=s[0]),s.length>1&&(i.filterTo=s[1]),i}getFilterType(){return"text"}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getValues(e){return this.getValuesWithSideEffects(e,!1)}getValuesWithSideEffects(e,t){const i=[];return this.forEachPositionInput(e,(s,o,r,n)=>{if(o<n){let l=Re(s.getValue());t&&this.textFilterParams.trimInput&&(l=Lr(l)??null,s.setValue(l,!0)),i.push(l)}}),i}getDefaultFilterOptions(){return Tr}createValueElement(){const e=document.createElement("div");return e.classList.add("ag-filter-body"),ee(e,"presentation"),this.createFromToElement(e,this.eValuesFrom,"from"),this.createFromToElement(e,this.eValuesTo,"to"),e}createFromToElement(e,t,i){const s=this.createManagedBean(new Ze);s.addCssClass(`ag-filter-${i}`),s.addCssClass("ag-filter-filter"),t.push(s),e.appendChild(s.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}mapValuesFromModel(e){const{filter:t,filterTo:i,type:s}=e||{};return[t||null,i||null].slice(0,this.getNumberOfInputs(s))}evaluateNullValue(e){return e?["notEqual","notContains","blank"].indexOf(e)>=0:!1}evaluateNonNullValue(e,t,i,s){const o=e.map(u=>this.formatter(u))||[],r=this.formatter(t),{api:n,colDef:l,column:a,context:d,textFormatter:h}=this.textFilterParams;if(i.type==="blank")return this.isBlank(t);if(i.type==="notBlank")return!this.isBlank(t);const c={api:n,colDef:l,column:a,context:d,node:s.node,data:s.data,filterOption:i.type,value:r,textFormatter:h};return o.some(u=>this.matcher({...c,filterText:u}))}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e)??""}};function Or(e){if(typeof e=="number")return e;if(typeof e=="string"){const t=parseInt(e);return isNaN(t)?void 0:t}}function pe(e,t=Number.MAX_VALUE){return i=>{const s=Or(i);if(!(s==null||s<e||s>t))return s}}function Pt(e,t){return e.toString().padStart(t,"0")}function Cd(e,t){const i=[];for(let s=e;s<=t;s++)i.push(s);return i}function md(e,t,i){return typeof e!="number"?"":e.toString().replace(".",i).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${t}`)}function de(e,t=!0,i="-"){if(!e)return null;let s=[e.getFullYear(),e.getMonth()+1,e.getDate()].map(o=>Pt(o,2)).join(i);return t&&(s+=" "+[e.getHours(),e.getMinutes(),e.getSeconds()].map(o=>Pt(o,2)).join(":")),s}var Ai=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 Dt(e,t="YYYY-MM-DD"){const i=Pt(e.getFullYear(),4),s=["January","February","March","April","May","June","July","August","September","October","November","December"],o=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],r={YYYY:()=>i.slice(i.length-4,i.length),YY:()=>i.slice(i.length-2,i.length),Y:()=>`${e.getFullYear()}`,MMMM:()=>s[e.getMonth()],MMM:()=>s[e.getMonth()].slice(0,3),MM:()=>Pt(e.getMonth()+1,2),Mo:()=>`${e.getMonth()+1}${Ai(e.getMonth()+1)}`,M:()=>`${e.getMonth()+1}`,Do:()=>`${e.getDate()}${Ai(e.getDate())}`,DD:()=>Pt(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()}${Ai(e.getDay())}`,d:()=>`${e.getDay()}`},n=new RegExp(Object.keys(r).join("|"),"g");return t.replace(n,l=>l in r?r[l]():l)}function Z(e){if(!e)return null;const[t,i]=e.split(" ");if(!t)return null;const s=t.split("-").map(c=>parseInt(c,10));if(s.filter(c=>!isNaN(c)).length!==3)return null;const[o,r,n]=s,l=new Date(o,r-1,n);if(l.getFullYear()!==o||l.getMonth()!==r-1||l.getDate()!==n)return null;if(!i||i==="00:00:00")return l;const[a,d,h]=i.split(":").map(c=>parseInt(c,10));return a>=0&&a<24&&l.setHours(a),d>=0&&d<60&&l.setMinutes(d),h>=0&&h<60&&l.setSeconds(h),l}var Gr=class{constructor(e,t,i,s,o){this.alive=!0,this.context=e,this.eParent=s,t.getDateCompDetails(i).newAgStackInstance().then(l=>{if(!this.alive){e.destroyBean(l);return}this.dateComp=l,l&&(s.appendChild(l.getGui()),l.afterGuiAttached&&l.afterGuiAttached(),this.tempValue&&l.setDate(this.tempValue),this.disabled!=null&&this.setDateCompDisabled(this.disabled),o==null||o(this))})}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){this.dateComp?this.dateComp.setDate(e):this.tempValue=e}setDisabled(e){this.dateComp?this.setDateCompDisabled(e):this.disabled=e}setDisplayed(e){H(this.eParent,e)}setInputPlaceholder(e){this.dateComp&&this.dateComp.setInputPlaceholder&&this.dateComp.setInputPlaceholder(e)}setInputAriaLabel(e){this.dateComp&&this.dateComp.setInputAriaLabel&&this.dateComp.setInputAriaLabel(e)}afterGuiAttached(e){this.dateComp&&typeof this.dateComp.afterGuiAttached=="function"&&this.dateComp.afterGuiAttached(e)}updateParams(e){var i,s;let t=!1;(i=this.dateComp)!=null&&i.refresh&&typeof this.dateComp.refresh=="function"&&this.dateComp.refresh(e)!==null&&(t=!0),!t&&((s=this.dateComp)!=null&&s.onParamsUpdated)&&typeof this.dateComp.onParamsUpdated=="function"&&this.dateComp.onParamsUpdated(e)!==null&&S("Custom date component method 'onParamsUpdated' is deprecated. Use 'refresh' instead.")}setDateCompDisabled(e){this.dateComp!=null&&this.dateComp.setDisabled!=null&&this.dateComp.setDisabled(e)}},kr=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"],Hr=class extends As{constructor(e,t,i){super(t,i),this.dateFilterParams=e}conditionToString(e,t){const{type:i}=e,{numberOfInputs:s}=t||{},o=i=="inRange"||s===2,r=Z(e.dateFrom),n=Z(e.dateTo),l=this.dateFilterParams.inRangeFloatingFilterDateFormat;if(o){const a=r!==null?Dt(r,l):"null",d=n!==null?Dt(n,l):"null";return`${a}-${d}`}return r!=null?Dt(r,l):`${i}`}updateParams(e){super.updateParams(e),this.dateFilterParams=e.dateFilterParams}},ro=1e3,no=1/0,vd=class extends Er{constructor(){super("dateFilter"),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=ro,this.maxValidYear=no,this.minValidDate=null,this.maxValidDate=null}wireBeans(e){super.wireBeans(e),this.context=e.context,this.userComponentFactory=e.userComponentFactory}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}mapValuesFromModel(e){const{dateFrom:t,dateTo:i,type:s}=e||{};return[t&&Z(t)||null,i&&Z(i)||null].slice(0,this.getNumberOfInputs(s))}comparator(){return this.dateFilterParams.comparator?this.dateFilterParams.comparator:this.defaultComparator.bind(this)}defaultComparator(e,t){const i=t;return t==null||i<e?-1:i>e?1:0}setParams(e){this.dateFilterParams=e,super.setParams(e);const t=(i,s)=>{if(e[i]!=null)if(isNaN(e[i]))S(`DateFilter ${i} is not a number`);else return e[i]==null?s:Number(e[i]);return s};this.minValidYear=t("minValidYear",ro),this.maxValidYear=t("maxValidYear",no),this.minValidYear>this.maxValidYear&&S("DateFilter minValidYear should be <= maxValidYear"),e.minValidDate?this.minValidDate=e.minValidDate instanceof Date?e.minValidDate:Z(e.minValidDate):this.minValidDate=null,e.maxValidDate?this.maxValidDate=e.maxValidDate instanceof Date?e.maxValidDate:Z(e.maxValidDate):this.maxValidDate=null,this.minValidDate&&this.maxValidDate&&this.minValidDate>this.maxValidDate&&S("DateFilter minValidDate should be <= maxValidDate"),this.filterModelFormatter=new Hr(this.dateFilterParams,this.localeService,this.optionsFactory)}createDateCompWrapper(e){const t=new Gr(this.context,this.userComponentFactory,{onDateChanged:()=>this.onUiChanged(),filterParams:this.dateFilterParams},e);return this.addDestroyFunc(()=>t.destroy()),t}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}getDefaultFilterOptions(){return kr}createValueElement(){const t=B(this.gos).createElement("div");return t.classList.add("ag-filter-body"),this.createFromToElement(t,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(t,this.eConditionPanelsTo,this.dateConditionToComps,"to"),t}createFromToElement(e,t,i,s){const r=B(this.gos).createElement("div");r.classList.add(`ag-filter-${s}`),r.classList.add(`ag-filter-date-${s}`),t.push(r),e.appendChild(r),i.push(this.createDateCompWrapper(r))}removeValueElements(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),this.removeItems(this.eConditionPanelsFrom,e,t),this.removeItems(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,i){this.removeItems(e,t,i).forEach(o=>o.destroy())}isValidDateValue(e){if(e===null)return!1;if(this.minValidDate){if(e<this.minValidDate)return!1}else if(e.getUTCFullYear()<this.minValidYear)return!1;if(this.maxValidDate){if(e>this.maxValidDate)return!1}else if(e.getUTCFullYear()>this.maxValidYear)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput((i,s,o,r)=>{o!==e||!t||s>=r||(t=t&&this.isValidDateValue(i.getDate()))}),t}areSimpleModelsEqual(e,t){return e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}getFilterType(){return"date"}createCondition(e){const t=this.getConditionType(e),i={},s=this.getValues(e);return s.length>0&&(i.dateFrom=de(s[0])),s.length>1&&(i.dateTo=de(s[1])),{dateFrom:null,dateTo:null,filterType:this.getFilterType(),type:t,...i}}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),i=e("ariaFilterValue","Filter Value");this.forEachInput(s=>{s.setInputPlaceholder(t),s.setInputAriaLabel(i)})}getInputs(e){return e>=this.dateConditionFromComps.length?[null,null]:[this.dateConditionFromComps[e],this.dateConditionToComps[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(i,s,o,r)=>{s<r&&t.push(i.getDate())}),t}translate(e){return e==="lessThan"?super.translate("before"):e==="greaterThan"?super.translate("after"):super.translate(e)}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e)??""}},Ts=class extends v{constructor(e,t,i,s){super(),this.columnOrGroup=e,this.columnOrGroup=e,this.eCell=t,this.ariaEl=this.eCell.querySelector("[role=columnheader]")||this.eCell,this.colsSpanning=s,this.beans=i}setColsSpanning(e){this.colsSpanning=e,this.onLeftChanged()}getColumnOrGroup(){return this.beans.gos.get("enableRtl")&&this.colsSpanning?I(this.colsSpanning):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 e=this.beans.gos.get("suppressColumnMoveAnimation"),t=F(this.columnOrGroup.getOldLeft());this.beans.columnAnimationService.isActive()&&t&&!e?this.animateInLeft():this.onLeftChanged()}animateInLeft(){const e=this.getColumnOrGroup(),t=e.getLeft(),i=e.getOldLeft(),s=this.modifyLeftForPrintLayout(e,i),o=this.modifyLeftForPrintLayout(e,t);this.setLeft(s),this.actualLeft=o,this.beans.columnAnimationService.executeNextVMTurn(()=>{this.actualLeft===o&&this.setLeft(o)})}onLeftChanged(){const e=this.getColumnOrGroup(),t=e.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(e,t),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(e,t){if(!z(this.beans.gos,"print")||e.getPinned()==="left")return t;const s=this.beans.visibleColsService.getColsLeftWidth();if(e.getPinned()==="right"){const o=this.beans.visibleColsService.getBodyContainerWidth();return s+o+t}return s+t}setLeft(e){if(F(e)&&(this.eCell.style.left=`${e}px`),W(this.columnOrGroup)){const t=this.columnOrGroup.getLeafColumns();if(!t.length)return;t.length>1&&kl(this.ariaEl,t.length)}}},wd="ag-column-first",Sd="ag-column-last";function Vr(e,t,i,s){return A(e)?[]:Rd(e.headerClass,e,t,i,s)}function Nr(e,t,i){e.addOrRemoveCssClass(wd,i.isColAtEdge(t,"first")),e.addOrRemoveCssClass(Sd,i.isColAtEdge(t,"last"))}function yd(e,t,i,s){return t.addGridCommonParams({colDef:e,column:i,columnGroup:s})}function Rd(e,t,i,s,o){if(A(e))return[];let r;if(typeof e=="function"){const n=yd(t,i,s,o);r=e(n)}else r=e;return typeof r=="string"?[r]:Array.isArray(r)?[...r]:[]}var Fd=0,Br=class Wr extends v{constructor(t,i,s){super(),this.resizeToggleTimeout=0,this.resizeMultiplier=1,this.resizeFeature=null,this.lastFocusEvent=null,this.dragSource=null,this.columnGroupChild=t,this.parentRowCtrl=s,this.beans=i,this.instanceId=t.getUniqueId()+"-"+Fd++}wireBeans(t){this.pinnedWidthService=t.pinnedWidthService,this.focusService=t.focusService,this.userComponentFactory=t.userComponentFactory,this.ctrlsService=t.ctrlsService,this.dragAndDropService=t.dragAndDropService,this.menuService=t.menuService}postConstruct(){const t=this.refreshTabIndex.bind(this);this.addManagedPropertyListeners(["suppressHeaderFocus"],t),this.addManagedEventListeners({overlayExclusiveChanged:t})}shouldStopEventPropagation(t){const{headerRowIndex:i,column:s}=this.focusService.getFocusedHeader();return hd(this.gos,t,i,s)}getWrapperHasFocus(){return V(this.gos)===this.eGui}setGui(t,i){this.eGui=t,this.addDomData(i),i.addManagedListeners(this.beans.eventService,{displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this)}),i.addManagedElementListeners(this.eGui,{focus:this.onGuiFocus.bind(this)}),this.onDisplayedColumnsChanged(),this.refreshTabIndex()}onGuiFocus(){this.eventService.dispatchEvent({type:"headerFocused",column:this.column})}setupAutoHeight(t){const{wrapperElement:i,checkMeasuringCallback:s,compBean:o}=t,{animationFrameService:r,resizeObserverService:n,columnModel:l,gos:a}=this.beans,d=C=>{if(!this.isAlive()||!o.isAlive())return;const{paddingTop:f,paddingBottom:w,borderBottomWidth:y,borderTopWidth:R}=Xe(this.getGui()),P=f+w+y+R,D=i.offsetHeight+P;if(C<5){const E=B(a),T=!E||!E.contains(i),L=D==0;if(T||L){r.requestAnimationFrame(()=>d(C+1));return}}l.setColHeaderHeight(this.column,D)};let h=!1,c;const u=()=>{const C=this.column.isAutoHeaderHeight();C&&!h&&g(),!C&&h&&p()},g=()=>{h=!0,d(0),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!0),c=n.observeResize(i,()=>d(0))},p=()=>{h=!1,c&&c(),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!1),c=void 0};u(),o.addDestroyFunc(()=>p()),o.addManagedListeners(this.column,{widthChanged:()=>h&&d(0)}),o.addManagedEventListeners({sortChanged:()=>{h&&window.setTimeout(()=>d(0))}}),s&&s(u)}onDisplayedColumnsChanged(){const{comp:t,column:i,beans:s,eGui:o}=this;!t||!i||!o||(Nr(t,i,s.visibleColsService),Xo(o,s.visibleColsService.getAriaColIndex(i)))}addResizeAndMoveKeyboardListeners(t){this.resizeFeature&&t.addManagedListeners(this.eGui,{keydown:this.onGuiKeyDown.bind(this),keyup:this.onGuiKeyUp.bind(this)})}refreshTabIndex(){const t=this.focusService.isHeaderFocusSuppressed();this.eGui&&ae(this.eGui,"tabindex",t?null:"-1")}onGuiKeyDown(t){var n;const i=V(this.gos),s=t.key===m.LEFT||t.key===m.RIGHT;if(this.isResizing&&(t.preventDefault(),t.stopImmediatePropagation()),i!==this.eGui||!t.shiftKey&&!t.altKey||((this.isResizing||s)&&(t.preventDefault(),t.stopImmediatePropagation()),!s))return;const o=t.key===m.LEFT!==this.gos.get("enableRtl"),r=wr[o?"Left":"Right"];if(t.altKey){this.isResizing=!0,this.resizeMultiplier+=1;const l=this.getViewportAdjustedResizeDiff(t);this.resizeHeader(l,t.shiftKey),(n=this.resizeFeature)==null||n.toggleColumnResizing(!0)}else this.moveHeader(r)}getViewportAdjustedResizeDiff(t){let i=this.getResizeDiff(t);if(this.column.getPinned()){const o=this.pinnedWidthService.getPinnedLeftWidth(),r=this.pinnedWidthService.getPinnedRightWidth(),n=Ht(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50;if(o+r+i>n)if(n>o+r)i=n-o-r;else return 0}return i}getResizeDiff(t){let i=t.key===m.LEFT!==this.gos.get("enableRtl");const s=this.column.getPinned(),o=this.gos.get("enableRtl");return s&&o!==(s==="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(()=>{var t;(t=this.resizeFeature)==null||t.toggleColumnResizing(!1)},150))}handleKeyDown(t){const i=this.getWrapperHasFocus();switch(t.key){case m.PAGE_DOWN:case m.PAGE_UP:case m.PAGE_HOME:case m.PAGE_END:i&&t.preventDefault()}}addDomData(t){const i=Wr.DOM_DATA_KEY_HEADER_CTRL;Ye(this.gos,this.eGui,i,this),t.addDestroyFunc(()=>Ye(this.gos,this.eGui,i,null))}getGui(){return this.eGui}focus(t){return this.eGui?(this.lastFocusEvent=t||null,this.eGui.focus(),!0):!1}getRowIndex(){return this.parentRowCtrl.getRowIndex()}getParentRowCtrl(){return this.parentRowCtrl}getPinned(){return this.parentRowCtrl.getPinned()}getColumnGroupChild(){return this.columnGroupChild}removeDragSource(){this.dragSource&&(this.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null)}handleContextMenuMouseEvent(t,i,s){const o=t??i;this.gos.get("preventDefaultOnContextMenu")&&o.preventDefault(),this.menuService.isHeaderContextMenuEnabled(s)&&this.menuService.showHeaderContextMenu(s,t,i),this.dispatchColumnMouseEvent("columnHeaderContextMenu",s)}dispatchColumnMouseEvent(t,i){this.eventService.dispatchEvent({type:t,column:i})}clearComponent(){this.removeDragSource(),this.resizeFeature=null,this.comp=null,this.eGui=null}destroy(){super.destroy(),this.column=null,this.lastFocusEvent=null,this.columnGroupChild=null,this.parentRowCtrl=null}};Br.DOM_DATA_KEY_HEADER_CTRL="headerCtrl";var Ci=Br,Is=class extends v{wireBeans(e){this.columnHoverService=e.columnHoverService}constructor(e,t){super(),this.columns=e,this.element=t}postConstruct(){this.gos.get("columnHoverHighlight")&&this.addMouseHoverListeners()}addMouseHoverListeners(){this.addManagedListeners(this.element,{mouseout:this.onMouseOut.bind(this),mouseover:this.onMouseOver.bind(this)})}onMouseOut(){this.columnHoverService.clearMouseOver()}onMouseOver(){this.columnHoverService.setMouseOver(this.columns)}},bd=class extends Ci{constructor(e,t,i){super(e,t,i),this.iconCreated=!1,this.column=e}setComp(e,t,i,s,o){this.comp=e,o=kt(this,this.beans.context,o),this.eButtonShowMainFilter=i,this.eFloatingFilterBody=s,this.setGui(t,o),this.setupActive(),this.setupWidth(o),this.setupLeft(o),this.setupHover(o),this.setupFocus(o),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(o),this.setupUi(),o.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(o),o.addManagedListeners(this.column,{colDefChanged:()=>this.onColDefChanged(o)}),o.addDestroyFunc(()=>{this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.clearComponent()})}resizeHeader(){}moveHeader(){}setupActive(){const e=this.column.getColDef(),t=!!e.filter,i=!!e.floatingFilter;this.active=t&&i}setupUi(){if(this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton&&this.active),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body",this.suppressFilterButton),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body",!this.suppressFilterButton),!this.active||this.iconCreated)return;const e=ie("filter",this.gos,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(e){e.createManagedBean(new Je(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){const e=this.localeService.getLocaleTextFunc();dt(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){if(V(this.gos)===this.eGui)return;const s=this.focusService.findNextFocusableElement(this.eGui,null,e.shiftKey);if(s){this.beans.headerNavigationService.scrollToColumn(this.column),e.preventDefault(),s.focus();return}const o=this.findNextColumnWithFloatingFilter(e.shiftKey);o&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:this.getParentRowCtrl().getRowIndex(),column:o},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.visibleColsService;let i=this.column;do if(i=e?t.getColBefore(i):t.getColAfter(i),!i)break;while(!i.getColDef().filter||!i.getColDef().floatingFilter);return i}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case m.UP:case m.DOWN:t||e.preventDefault();case m.LEFT:case m.RIGHT:if(t)return;e.stopPropagation();case m.ENTER:t&&this.focusService.focusInto(this.eGui)&&e.preventDefault();break;case m.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const i=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),s=!!e.relatedTarget&&rt(e.relatedTarget,"ag-floating-filter");if(i&&s&&e.target===this.eGui){const r=this.lastFocusEvent,n=!!(r&&r.key===m.TAB);if(r&&n){const l=r.shiftKey;this.focusService.focusInto(this.eGui,l)}}const o=this.getRowIndex();this.beans.focusService.setFocusedHeader(o,this.column)}setupHover(e){e.createManagedBean(new Is([this.column],this.eGui));const t=()=>{if(!this.gos.get("columnHoverHighlight"))return;const i=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",i)};e.addManagedEventListeners({columnHoverChanged:t}),t()}setupLeft(e){const t=new Ts(this.column,this.eGui,this.beans);e.createManagedBean(t)}setupFilterButton(){this.suppressFilterButton=!this.menuService.isFloatingFilterButtonEnabled(this.column),this.highlightFilterButtonWhenActive=!this.menuService.isLegacyMenuEnabled()}setupUserComp(){var t;if(!this.active)return;const e=(t=this.beans.filterManager)==null?void 0:t.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;this.menuService.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(e){if(!this.active)return;const{filterManager:t}=this.beans,i=s=>{if((s==null?void 0:s.source)==="filterDestroyed"&&!this.isAlive())return;const o=this.comp.getFloatingFilterComp();o&&o.then(r=>{if(r){const n=t==null?void 0:t.getCurrentFloatingFilterParentModel(this.column),l=s?{...s,columns:s.columns??[],source:s.source==="api"?"api":"columnFilter"}:null;r.onParentModelChanged(n,l)}})};[this.destroySyncListener]=e.addManagedListeners(this.column,{filterChanged:i}),t!=null&&t.isFilterActive(this.column)&&i(null)}setupWidth(e){const t=()=>{const i=`${this.column.getActualWidth()}px`;this.comp.setWidth(i)};e.addManagedListeners(this.column,{widthChanged:t}),t()}setupFilterChangedListener(e){this.active&&([this.destroyFilterChangedListener]=e.addManagedListeners(this.column,{filterChanged:this.updateFilterButton.bind(this)}),this.updateFilterButton())}updateFilterButton(){var e;if(!this.suppressFilterButton&&this.comp){const t=!!((e=this.beans.filterManager)!=null&&e.isFilterAllowed(this.column));this.comp.setButtonWrapperDisplayed(t),this.highlightFilterButtonWhenActive&&t&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(e){var r;const t=this.active;this.setupActive();const i=!t&&this.active;t&&!this.active&&(this.destroySyncListener(),this.destroyFilterChangedListener());const s=this.active?(r=this.beans.filterManager)==null?void 0:r.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,o=this.comp.getFloatingFilterComp();!o||!s?this.updateCompDetails(e,s,i):o.then(n=>{var l;!n||(l=this.beans.filterManager)!=null&&l.areFilterCompsDifferent(this.userCompDetails??null,s)?this.updateCompDetails(e,s,i):this.updateFloatingFilterParams(s)})}updateCompDetails(e,t,i){this.isAlive()&&(this.setCompDetails(t),this.setupFilterButton(),this.setupUi(),i&&(this.setupSyncWithFilter(e),this.setupFilterChangedListener(e)))}updateFloatingFilterParams(e){var i;if(!e)return;const t=e.params;(i=this.comp.getFloatingFilterComp())==null||i.then(s=>{let o=!1;s!=null&&s.refresh&&typeof s.refresh=="function"&&s.refresh(t)!==null&&(o=!0),!o&&(s!=null&&s.onParamsUpdated)&&typeof s.onParamsUpdated=="function"&&s.onParamsUpdated(t)!==null&&S("Custom floating filter method 'onParamsUpdated' is deprecated. Use 'refresh' instead.")})}destroy(){super.destroy(),this.destroySyncListener=null,this.destroyFilterChangedListener=null}};var x="32.3.2";function Pd(e){var t,i;return!!((t=e.filterManager)!=null&&t.isColumnFilterPresent())||!!((i=e.filterManager)!=null&&i.isAggregateFilterPresent())}function Dd(e,t,i){var s;return(s=e.filterManager)==null?void 0:s.getFilterInstance(t,i)}function Ed(e,t){var i;return((i=e.filterManager)==null?void 0:i.getColumnFilterInstance(t))??Promise.resolve(void 0)}function Md(e,t){var s;const i=e.columnModel.getColDefCol(t);if(i)return(s=e.filterManager)==null?void 0:s.destroyFilter(i,"api")}function xd(e,t){e.frameworkOverrides.wrapIncoming(()=>{var i;return(i=e.filterManager)==null?void 0:i.setFilterModel(t)})}function Ad(e){var t;return((t=e.filterManager)==null?void 0:t.getFilterModel())??{}}function Td(e,t){var i;return((i=e.filterManager)==null?void 0:i.getColumnFilterModel(t))??null}function Id(e,t,i){var s;return((s=e.filterManager)==null?void 0:s.setColumnFilterModel(t,i))??Promise.resolve()}function Ld(e,t){const i=e.columnModel.getCol(t);if(!i){O(`column '${t}' not found`);return}e.menuService.showFilterMenu({column:i,containerType:"columnFilter",positionBy:"auto"})}function Od(e,t,i){if(t==null)return null;let s=null;const{compName:o,jsComp:r,fwComp:n}=mr.getCompKeys(e,t,Ds);return o?s={set:"agSetColumnFloatingFilter",agSetColumnFilter:"agSetColumnFloatingFilter",multi:"agMultiColumnFloatingFilter",agMultiColumnFilter:"agMultiColumnFloatingFilter",group:"agGroupColumnFloatingFilter",agGroupColumnFilter:"agGroupColumnFloatingFilter",number:"agNumberColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",date:"agDateColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",text:"agTextColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"}[o]:r==null&&n==null&&t.filter===!0&&(s=i()),s}var lo={january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},ao=["january","february","march","april","may","june","july","august","september","october","november","december"],Gd=class extends v{constructor(){super(...arguments),this.beanName="columnFilterService",this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue=[]}wireBeans(e){this.valueService=e.valueService,this.columnModel=e.columnModel,this.rowModel=e.rowModel,this.userComponentFactory=e.userComponentFactory,this.rowRenderer=e.rowRenderer,this.dataTypeService=e.dataTypeService,this.filterManager=e.filterManager}postConstruct(){var e,t;this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),rowDataUpdated:()=>this.onNewRowsLoaded("rowDataUpdated"),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.initialFilterModel={...((t=(e=this.gos.get("initialState"))==null?void 0:e.filter)==null?void 0:t.filterModel)??{}}}setFilterModel(e,t="api"){var o;if((o=this.dataTypeService)!=null&&o.isPendingInference()){this.filterModelUpdateQueue.push({model:e,source:t});return}const i=[],s=this.getFilterModel(!0);if(e){const r=new Set(Object.keys(e));this.allColumnFilters.forEach((n,l)=>{const a=e[l];i.push(this.setModelOnFilterWrapper(n.filterPromise,a)),r.delete(l)}),r.forEach(n=>{const l=this.columnModel.getColDefCol(n)||this.columnModel.getCol(n);if(!l){S("setFilterModel() - no column found for colId: "+n);return}if(!l.isFilterAllowed()){S("setFilterModel() - unable to fully apply model, filtering disabled for colId: "+n);return}const a=this.getOrCreateFilterWrapper(l);if(!a){S("setFilterModel() - unable to fully apply model, unable to create filter for colId: "+n);return}i.push(this.setModelOnFilterWrapper(a.filterPromise,e[n]))})}else this.allColumnFilters.forEach(r=>{i.push(this.setModelOnFilterWrapper(r.filterPromise,null))});te.all(i).then(()=>{var l;const r=this.getFilterModel(!0),n=[];this.allColumnFilters.forEach((a,d)=>{const h=s?s[d]:null,c=r?r[d]:null;Mt(h,c)||n.push(a.column)}),n.length>0&&((l=this.filterManager)==null||l.onFilterChanged({columns:n,source:t}))})}setModelOnFilterWrapper(e,t){return new te(i=>{e.then(s=>{typeof s.setModel!="function"&&(S("filter missing setModel method, which is needed for setFilterModel"),i()),(s.setModel(t)||te.resolve()).then(()=>i())})})}getFilterModel(e){const t={},{allColumnFilters:i,initialFilterModel:s}=this;return i.forEach((o,r)=>{const n=this.getModelFromFilterWrapper(o);F(n)&&(t[r]=n)}),e||Object.entries(s).forEach(([o,r])=>{var n;F(r)&&!i.has(o)&&((n=this.columnModel.getCol(o))!=null&&n.isFilterAllowed())&&(t[o]=r)}),t}getModelFromFilterWrapper(e){const{filter:t}=e;return t?typeof t.getModel!="function"?(S("filter API missing getModel method, which is needed for getFilterModel"),null):t.getModel():this.getModelFromInitialState(e.column)}getModelFromInitialState(e){return this.initialFilterModel[e.getColId()]??null}isColumnFilterPresent(){return this.activeColumnFilters.length>0}isAggregateFilterPresent(){return!!this.activeAggregateFilters.length}disableColumnFilters(){return this.allColumnFilters.size?(this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"advancedFilterEnabled")),!0):!1}doAggregateFiltersPass(e,t){return this.doColumnFiltersPass(e,t,!0)}updateActiveFilters(){const e=r=>r?r.isFilterActive?r.isFilterActive():(S("Filter is missing isFilterActive() method"),!1):!1,t=!!Wi(this.gos),i=r=>{if(!r.isPrimary())return!0;const l=!this.columnModel.isPivotActive();return!r.isValueActive()||!l?!1:this.columnModel.isPivotMode()?!0:t},s=[],o=[];return this.forEachColumnFilter((r,n)=>{e(r)&&(i(n.column)?s.push(r):o.push(r))}).then(()=>{this.activeAggregateFilters=s,this.activeColumnFilters=o})}updateFilterFlagInColumns(e,t){return this.forEachColumnFilter((i,s)=>s.column.setFilterActive(i.isFilterActive(),e,t))}forEachColumnFilter(e){return te.all(Array.from(this.allColumnFilters.values()).map(t=>t.filterPromise.then(i=>e(i,t))))}doColumnFiltersPass(e,t,i){const{data:s,aggData:o}=e,r=i?this.activeAggregateFilters:this.activeColumnFilters,n=i?o:s;for(let l=0;l<r.length;l++){const a=r[l];if(!(a==null||a===t)){if(typeof a.doesFilterPass!="function")throw new Error("Filter is missing method doesFilterPass");if(!a.doesFilterPass({node:e,data:n}))return!1}}return!0}callOnFilterChangedOutsideRenderCycle(e){const t=()=>{var i;return(i=this.filterManager)==null?void 0:i.onFilterChanged(e)};this.rowRenderer.isRefreshInProgress()?setTimeout(t,0):t()}updateBeforeFilterChanged(e={}){const{filterInstance:t,additionalEventAttributes:i}=e;return this.updateDependentFilters(),this.updateActiveFilters().then(()=>this.updateFilterFlagInColumns("filterChanged",i).then(()=>{this.allColumnFilters.forEach(s=>{s.filterPromise&&s.filterPromise.then(o=>{o&&o!==t&&o.onAnyFilterChanged&&o.onAnyFilterChanged()})}),this.processingFilterChange=!0}))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!(this.gos.get("allowShowChangeAfterFilter")??!1)&&this.processingFilterChange}onNewRowsLoaded(e){this.forEachColumnFilter(t=>{t.onNewRowsLoaded&&t.onNewRowsLoaded()}).then(()=>this.updateFilterFlagInColumns(e,{afterDataChange:!0})).then(()=>this.updateActiveFilters())}createValueGetter(e){return({node:t})=>this.valueService.getValue(e,t,!0)}createGetValue(e){return(t,i)=>{const s=i?this.columnModel.getCol(i):e;return s?this.valueService.getValue(s,t,!0):void 0}}isFilterActive(e){const{filter:t}=this.cachedFilter(e)??{};return t?t.isFilterActive():this.getModelFromInitialState(e)!=null}getOrCreateFilterWrapper(e){if(!e.isFilterAllowed())return null;let t=this.cachedFilter(e);return t||(t=this.createFilterWrapper(e),this.setColumnFilterWrapper(e,t)),t}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e){var i;let t;if(yi(this.gos))t="agSetColumnFilter";else{const s=(i=this.dataTypeService)==null?void 0:i.getBaseDataType(e);s==="number"?t="agNumberColumnFilter":s==="date"||s==="dateString"?t="agDateColumnFilter":t="agTextColumnFilter"}return t}getDefaultFloatingFilter(e){var i;let t;if(yi(this.gos))t="agSetColumnFloatingFilter";else{const s=(i=this.dataTypeService)==null?void 0:i.getBaseDataType(e);s==="number"?t="agNumberColumnFloatingFilter":s==="date"||s==="dateString"?t="agDateColumnFloatingFilter":t="agTextColumnFloatingFilter"}return t}createFilterInstance(e,t){const i=this.getDefaultFilter(e),s=e.getColDef();let o;const r={...this.createFilterParams(e,s),filterModifiedCallback:()=>this.filterModifiedCallbackFactory(o,e)(),filterChangedCallback:l=>this.filterChangedCallbackFactory(o,e)(l),doesRowPassOtherFilter:l=>this.filterManager?this.filterManager.doesRowPassOtherFilters(o,l):!0},n=this.userComponentFactory.getFilterDetails(s,r,i);return n?{filterPromise:()=>{const l=n.newAgStackInstance();return l!=null&&l.then(a=>{o=a,t&&(t.filter=a)}),l},compDetails:n}:{filterPromise:null,compDetails:null}}createFilterParams(e,t){return this.gos.addGridCommonParams({column:e,colDef:Bo(t),rowModel:this.rowModel,filterChangedCallback:()=>{},filterModifiedCallback:()=>{},valueGetter:this.createValueGetter(e),getValue:this.createGetValue(e),doesRowPassOtherFilter:()=>!0})}createFilterWrapper(e){const t={column:e,filterPromise:null,compiledElement:null,compDetails:null},{filterPromise:i,compDetails:s}=this.createFilterInstance(e,t);return t.filterPromise=(i==null?void 0:i())??null,t.compDetails=s,t}onColumnsChanged(){var i;const e=[];this.allColumnFilters.forEach((s,o)=>{let r;s.column.isPrimary()?r=this.columnModel.getColDefCol(o):r=this.columnModel.getCol(o),!(r&&r===s.column)&&(e.push(s.column),this.disposeFilterWrapper(s,"columnChanged"),this.disposeColumnListener(o))});const t=e.every(s=>s.getColDef().filter==="agGroupColumnFilter");e.length>0&&!t?(i=this.filterManager)==null||i.onFilterChanged({columns:e,source:"api"}):this.updateDependentFilters()}updateDependentFilters(){const e=this.columnModel.getAutoCols();e==null||e.forEach(t=>{t.getColDef().filter==="agGroupColumnFilter"&&this.getOrCreateFilterWrapper(t)})}isFilterAllowed(e){if(!e.isFilterAllowed())return!1;const{filter:i}=this.allColumnFilters.get(e.getColId())??{};return i&&typeof(i==null?void 0:i.isFilterAllowed)=="function"?i.isFilterAllowed():!0}getFloatingFilterCompDetails(e,t){const i=a=>{var h;const d=(h=this.getOrCreateFilterWrapper(e))==null?void 0:h.filterPromise;d!=null&&d.then(c=>{a(bt(c))})},s=e.getColDef(),o={...this.createFilterParams(e,s),filterChangedCallback:()=>i(a=>this.filterChangedCallbackFactory(a,e)())},r=this.userComponentFactory.mergeParamsWithApplicationProvidedParams(s,Ds,o);let n=Od(this.frameworkOverrides,s,()=>this.getDefaultFloatingFilter(e));n==null&&(n="agReadOnlyFloatingFilter");const l={column:e,filterParams:r,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:i,showParentFilter:t,suppressFilterButton:!1};return this.userComponentFactory.getFloatingFilterCompDetails(s,l,n)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilter(e,t="api"){var o;const i=e.getColId(),s=this.allColumnFilters.get(i);this.disposeColumnListener(i),delete this.initialFilterModel[i],s&&(this.disposeFilterWrapper(s,t),(o=this.filterManager)==null||o.onFilterChanged({columns:[e],source:"api"}))}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){e.filterPromise.then(i=>{this.destroyBean(i),e.column.setFilterActive(!1,"filterDestroyed"),this.allColumnFilters.delete(e.column.getColId()),this.eventService.dispatchEvent({type:"filterDestroyed",source:t,column:e.column})})}filterModifiedCallbackFactory(e,t){return()=>{this.eventService.dispatchEvent({type:"filterModified",column:t,filterInstance:e})}}filterChangedCallbackFactory(e,t){return i=>{const s=(i==null?void 0:i.source)??"columnFilter",o={filter:e,additionalEventAttributes:i,columns:[t],source:s};this.callOnFilterChangedOutsideRenderCycle(o)}}checkDestroyFilter(e){const t=this.allColumnFilters.get(e);if(!t)return;const i=t.column,{compDetails:s}=i.isFilterAllowed()?this.createFilterInstance(i):{compDetails:null};if(this.areFilterCompsDifferent(t.compDetails,s)){this.destroyFilter(i,"paramsUpdated");return}const o=i.getColDef().filterParams;if(!t.filterPromise){this.destroyFilter(i,"paramsUpdated");return}t.filterPromise.then(r=>{(r!=null&&r.refresh?r.refresh({...this.createFilterParams(i,i.getColDef()),filterModifiedCallback:this.filterModifiedCallbackFactory(r,i),filterChangedCallback:this.filterChangedCallbackFactory(r,i),doesRowPassOtherFilter:l=>this.filterManager?this.filterManager.doesRowPassOtherFilters(r,l):!0,...o}):!0)===!1&&this.destroyFilter(i,"paramsUpdated")})}setColumnFilterWrapper(e,t){const i=e.getColId();this.allColumnFilters.set(i,t),this.allColumnListeners.set(i,this.addManagedListeners(e,{colDefChanged:()=>this.checkDestroyFilter(i)})[0])}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:i}=e,{componentClass:s}=t;return!(i===s||(i==null?void 0:i.render)&&(s==null?void 0:s.render)&&i.render===s.render)}hasFloatingFilters(){return this.columnModel.getCols().some(t=>t.getColDef().floatingFilter)}getFilterInstance(e,t){t&&this.getFilterInstanceImpl(e).then(i=>{const s=bt(i);t(s)})}getColumnFilterInstance(e){return new Promise(t=>{this.getFilterInstanceImpl(e).then(i=>{t(bt(i))})})}getFilterInstanceImpl(e){var s;const t=this.columnModel.getColDefCol(e);return t?((s=this.getOrCreateFilterWrapper(t))==null?void 0:s.filterPromise)??te.resolve(null):te.resolve(void 0)}processFilterModelUpdateQueue(){this.filterModelUpdateQueue.forEach(({model:e,source:t})=>this.setFilterModel(e,t)),this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue.forEach(({key:e,model:t,resolve:i})=>{this.setColumnFilterModel(e,t).then(()=>i())}),this.columnFilterModelUpdateQueue=[]}getColumnFilterModel(e){const t=this.getFilterWrapper(e);return t?this.getModelFromFilterWrapper(t):null}setColumnFilterModel(e,t){var r;if((r=this.dataTypeService)!=null&&r.isPendingInference()){let n=()=>{};const l=new Promise(a=>{n=a});return this.columnFilterModelUpdateQueue.push({key:e,model:t,resolve:n}),l}const i=this.columnModel.getColDefCol(e),s=i?this.getOrCreateFilterWrapper(i):null;return s?(n=>new Promise(l=>{n.then(a=>l(a))}))(this.setModelOnFilterWrapper(s.filterPromise,t)):Promise.resolve()}getFilterWrapper(e){const t=this.columnModel.getColDefCol(e);return t?this.cachedFilter(t)??null:null}setColDefPropertiesForDataType(e,t,i){const s=yi(this.gos),o=this.localeService.getLocaleTextFunc(),r=n=>{const{filterParams:l}=e;e.filterParams=typeof l=="object"?{...l,...n}:n};switch(t.baseDataType){case"number":{s&&r({comparator:(n,l)=>{const a=n==null?0:parseInt(n),d=l==null?0:parseInt(l);return a===d?0:a>d?1:-1}});break}case"boolean":{r(s?{valueFormatter:n=>F(n.value)?o(String(n.value),n.value?"True":"False"):o("blanks","(Blanks)")}:{maxNumConditions:1,debounceMs:0,filterOptions:["empty",{displayKey:"true",displayName:"True",predicate:(n,l)=>l,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(n,l)=>l===!1,numberOfInputs:0}]});break}case"date":{s&&r({valueFormatter:n=>{const l=i(n);return F(l)?l:o("blanks","(Blanks)")},treeList:!0,treeListFormatter:(n,l)=>{if(l===1&&n!=null){const a=ao[Number(n)-1];return o(a,lo[a])}return n??o("blanks","(Blanks)")}});break}case"dateString":{const n=t.dateParser;r(s?{valueFormatter:l=>{const a=i(l);return F(a)?a:o("blanks","(Blanks)")},treeList:!0,treeListPathGetter:l=>{const a=n(l??void 0);return a?[String(a.getFullYear()),String(a.getMonth()+1),String(a.getDate())]:null},treeListFormatter:(l,a)=>{if(a===1&&l!=null){const d=ao[Number(l)-1];return o(d,lo[d])}return l??o("blanks","(Blanks)")}}:{comparator:(l,a)=>{const d=n(a);return a==null||d<l?-1:d>l?1:0}});break}case"object":{s?r({valueFormatter:n=>{const l=i(n);return F(l)?l:o("blanks","(Blanks)")}}):e.filterValueGetter=n=>i({column:n.column,node:n.node,value:this.valueService.getValue(n.column,n.node)});break}}}destroy(){super.destroy(),this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear()}};function kd(e){var t;return!!((t=e.filterManager)!=null&&t.isAnyFilterPresent())}function Hd(e,t="api"){var i;(i=e.filterManager)==null||i.onFilterChanged({source:t})}var Vd=class extends G{constructor(){super(` <div class="ag-floating-filter-input" role="presentation"> <ag-input-text-field data-ref="eFloatingFilterText"></ag-input-text-field> </div>`,[fi]),this.eFloatingFilterText=b}wireBeans(e){this.columnNameService=e.columnNameService}destroy(){super.destroy()}init(e){this.params=e;const t=this.columnNameService.getDisplayNameForColumn(e.column,"header",!0),i=this.localeService.getLocaleTextFunc();this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${i("ariaFilterInput","Filter Input")}`)}onParentModelChanged(e){if(e==null){this.eFloatingFilterText.setValue("");return}this.params.parentFilterInstance(t=>{if(t.getModelAsString){const i=t.getModelAsString(e);this.eFloatingFilterText.setValue(i)}})}onParamsUpdated(e){this.refresh(e)}refresh(e){this.init(e)}},zr=class extends G{wireBeans(e){this.columnNameService=e.columnNameService}getDefaultDebounceMs(){return 0}destroy(){super.destroy()}isEventFromFloatingFilter(e){return e&&e.afterFloatingFilter}isEventFromDataChange(e){return e==null?void 0:e.afterDataChange}getLastType(){return this.lastType}isReadOnly(){return this.readOnly}setLastTypeFromModel(e){if(!e){this.lastType=this.optionsFactory.getDefaultOption();return}const t=e.operator;let i;t?i=e.conditions[0]:i=e,this.lastType=i.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const i=e;return this.isTypeEditable(i.type)}init(e){this.setSimpleParams(e,!1)}setSimpleParams(e,t=!0){this.optionsFactory=new Pr,this.optionsFactory.init(e.filterParams,this.getDefaultFilterOptions()),t||(this.lastType=this.optionsFactory.getDefaultOption()),this.readOnly=!!e.filterParams.readOnly;const i=this.isTypeEditable(this.optionsFactory.getDefaultOption());this.setEditable(i)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.setSimpleParams(e)}doesFilterHaveSingleInput(e){const t=this.optionsFactory.getCustomOption(e),{numberOfInputs:i}=t||{};return i==null||i==1}isTypeEditable(e){const t=["inRange","empty","blank","notBlank"];return!!e&&!this.isReadOnly()&&this.doesFilterHaveSingleInput(e)&&t.indexOf(e)<0}getAriaLabel(e){const t=this.columnNameService.getDisplayNameForColumn(e.column,"header",!0),i=this.localeService.getLocaleTextFunc();return`${t} ${i("ariaFilterInput","Filter Input")}`}},Nd=class extends zr{constructor(){super(` <div class="ag-floating-filter-input" role="presentation"> <ag-input-text-field data-ref="eReadOnlyText"></ag-input-text-field> <div data-ref="eDateWrapper" style="display: flex;"></div> </div>`,[fi]),this.eReadOnlyText=b,this.eDateWrapper=b}wireBeans(e){super.wireBeans(e),this.context=e.context,this.userComponentFactory=e.userComponentFactory}getDefaultFilterOptions(){return kr}init(e){super.init(e),this.params=e,this.filterParams=e.filterParams,this.createDateComponent(),this.filterModelFormatter=new Hr(this.filterParams,this.localeService,this.optionsFactory);const t=this.localeService.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput","Date Filter Input"))}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.params=e,this.filterParams=e.filterParams,this.updateDateComponent(),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory,dateFilterParams:this.filterParams}),this.updateCompOnModelChange(e.currentParentModel())}updateCompOnModelChange(e){const t=!this.isReadOnly()&&this.canWeEditAfterModelFromParentFilter(e);if(this.setEditable(t),t){if(e){const i=e;this.dateComp.setDate(Z(i.dateFrom))}else this.dateComp.setDate(null);this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){H(this.eDateWrapper,e),H(this.eReadOnlyText.getGui(),!e)}onParentModelChanged(e,t){this.isEventFromFloatingFilter(t)||this.isEventFromDataChange(t)||(super.setLastTypeFromModel(e),this.updateCompOnModelChange(e))}onDateChanged(){const e=this.dateComp.getDate(),t=de(e);this.params.parentFilterInstance(i=>{if(i){const s=Z(t);i.onFloatingFilterChanged(this.getLastType()||null,s)}})}getDateComponentParams(){const e=Es(this.params.filterParams,this.getDefaultDebounceMs());return{onDateChanged:Y(this.onDateChanged.bind(this),e),filterParams:this.params.column.getColDef().filterParams}}createDateComponent(){this.dateComp=new Gr(this.context,this.userComponentFactory,this.getDateComponentParams(),this.eDateWrapper,e=>{e.setInputAriaLabel(this.getAriaLabel(this.params))}),this.addDestroyFunc(()=>this.dateComp.destroy())}updateDateComponent(){const e=this.gos.addGridCommonParams(this.getDateComponentParams());this.dateComp.updateParams(e)}getFilterModelFormatter(){return this.filterModelFormatter}},Bd=class extends G{constructor(){super(` <div class="ag-filter-filter"> <ag-input-text-field class="ag-date-filter" data-ref="eDateInput"></ag-input-text-field> </div>`,[fi]),this.eDateInput=b}destroy(){super.destroy()}init(e){this.params=e,this.setParams(e);const t=this.eDateInput.getInputElement();this.addManagedListeners(t,{mouseDown:()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||t.focus()},input:i=>{i.target===V(this.gos)&&(this.eDateInput.isDisabled()||this.params.onDateChanged())}})}setParams(e){const t=this.eDateInput.getInputElement(),i=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=i&&we(),t.type=i?"date":"text";const{minValidYear:s,maxValidYear:o,minValidDate:r,maxValidDate:n}=e.filterParams||{};if(r&&s&&S("DateFilter should not have both minValidDate and minValidYear parameters set at the same time! minValidYear will be ignored."),n&&o&&S("DateFilter should not have both maxValidDate and maxValidYear parameters set at the same time! maxValidYear will be ignored."),r&&n){const[l,a]=[r,n].map(d=>d instanceof Date?d:Z(d));l&&a&&l.getTime()>a.getTime()&&S("DateFilter parameter minValidDate should always be lower than or equal to parameter maxValidDate.")}r?r instanceof Date?t.min=Dt(r):t.min=r:s&&(t.min=`${s}-01-01`),n?n instanceof Date?t.max=Dt(n):t.max=n:o&&(t.max=`${o}-12-31`)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.params=e,this.setParams(e)}getDate(){return Z(this.eDateInput.getValue())}setDate(e){this.eDateInput.setValue(de(e,!1))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setInputAriaLabel(e){this.eDateInput.setAriaLabel(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){(!e||!e.suppressFocus)&&this.eDateInput.getInputElement().focus()}shouldUseBrowserDatePicker(e){return e.filterParams&&e.filterParams.browserDatePicker!=null?e.filterParams.browserDatePicker:ms()||vs()||we()&&Jo()>=14.1}},_r=class extends v{constructor(e){super(),this.params=e,this.eFloatingFilterTextInput=b,this.valueChangedListener=()=>{}}setupGui(e){var s;this.eFloatingFilterTextInput=this.createManagedBean(new Ze((s=this.params)==null?void 0:s.config));const t=this.eFloatingFilterTextInput.getGui();e.appendChild(t);const i=o=>this.valueChangedListener(o);this.addManagedListeners(t,{input:i,keydown:i})}setEditable(e){this.eFloatingFilterTextInput.setDisabled(!e)}setAutoComplete(e){this.eFloatingFilterTextInput.setAutoComplete(e)}getValue(){return this.eFloatingFilterTextInput.getValue()}setValue(e,t){this.eFloatingFilterTextInput.setValue(e,t)}setValueChangedListener(e){this.valueChangedListener=e}setParams(e){this.setAriaLabel(e.ariaLabel),e.autoComplete!==void 0&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eFloatingFilterTextInput.setInputAriaLabel(e)}},Ur=class extends zr{constructor(){super(...arguments),this.eFloatingFilterInputContainer=b}postConstruct(){this.setTemplate(` <div class="ag-floating-filter-input" role="presentation" data-ref="eFloatingFilterInputContainer"></div> `)}getDefaultDebounceMs(){return 500}onParentModelChanged(e,t){this.isEventFromFloatingFilter(t)||this.isEventFromDataChange(t)||(this.setLastTypeFromModel(e),this.setEditable(this.canWeEditAfterModelFromParentFilter(e)),this.floatingFilterInputService.setValue(this.getFilterModelFormatter().getModelAsString(e)))}init(e){this.setupFloatingFilterInputService(e),super.init(e),this.setTextInputParams(e)}setupFloatingFilterInputService(e){this.floatingFilterInputService=this.createFloatingFilterInputService(e),this.floatingFilterInputService.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(e){this.params=e;const t=e.browserAutoComplete??!1;if(this.floatingFilterInputService.setParams({ariaLabel:this.getAriaLabel(e),autoComplete:t}),this.applyActive=di(this.params.filterParams),!this.isReadOnly()){const i=Es(this.params.filterParams,this.getDefaultDebounceMs()),s=Y(this.syncUpWithParentFilter.bind(this),i);this.floatingFilterInputService.setValueChangedListener(s)}}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const t=this.floatingFilterInputService.getValue();U(this.eFloatingFilterInputContainer),this.destroyBean(this.floatingFilterInputService),this.setupFloatingFilterInputService(e),this.floatingFilterInputService.setValue(t,!0)}syncUpWithParentFilter(e){const t=e.key===m.ENTER;if(this.applyActive&&!t)return;let i=this.floatingFilterInputService.getValue();this.params.filterParams.trimInput&&(i=Lr(i),this.floatingFilterInputService.setValue(i,!0)),this.params.parentFilterInstance(s=>{s&&s.onFloatingFilterChanged(this.getLastType()||null,i||null)})}setEditable(e){this.floatingFilterInputService.setEditable(e)}},Wd=class extends v{constructor(){super(...arguments),this.valueChangedListener=()=>{},this.numberInputActive=!0}setupGui(e){this.eFloatingFilterNumberInput=this.createManagedBean(new xs),this.eFloatingFilterTextInput=this.createManagedBean(new Ze),this.eFloatingFilterTextInput.setDisabled(!0);const t=this.eFloatingFilterNumberInput.getGui(),i=this.eFloatingFilterTextInput.getGui();e.appendChild(t),e.appendChild(i),this.setupListeners(t,s=>this.valueChangedListener(s)),this.setupListeners(i,s=>this.valueChangedListener(s))}setEditable(e){this.numberInputActive=e,this.eFloatingFilterNumberInput.setDisplayed(this.numberInputActive),this.eFloatingFilterTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(e){this.eFloatingFilterNumberInput.setAutoComplete(e),this.eFloatingFilterTextInput.setAutoComplete(e)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eFloatingFilterNumberInput:this.eFloatingFilterTextInput}setValueChangedListener(e){this.valueChangedListener=e}setupListeners(e,t){this.addManagedListeners(e,{input:t,keydown:t})}setParams(e){this.setAriaLabel(e.ariaLabel),e.autoComplete!==void 0&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eFloatingFilterNumberInput.setInputAriaLabel(e),this.eFloatingFilterTextInput.setInputAriaLabel(e)}},zd=class extends Ur{init(e){var t;super.init(e),this.filterModelFormatter=new Ar(this.localeService,this.optionsFactory,(t=e.filterParams)==null?void 0:t.numberFormatter)}onParamsUpdated(e){this.refresh(e)}refresh(e){es(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.refresh(e),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return xr}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(e){return this.allowedCharPattern=es(e.filterParams),this.allowedCharPattern?this.createManagedBean(new _r({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new Wd)}},_d=class extends Ur{init(e){super.init(e),this.filterModelFormatter=new Ir(this.localeService,this.optionsFactory)}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return Tr}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(){return this.createManagedBean(new _r)}};function Ud(e){var t;return!!((t=e.filterManager)!=null&&t.isQuickFilterPresent())}function Kd(e){return e.gos.get("quickFilterText")}function $d(e){var t;(t=e.filterManager)==null||t.resetQuickFilterCache()}var jd=class extends v{constructor(){super(...arguments),this.beanName="quickFilterService",this.quickFilter=null,this.quickFilterParts=null}wireBeans(e){this.valueService=e.valueService,this.columnModel=e.columnModel,this.rowModel=e.rowModel,this.pivotResultColsService=e.pivotResultColsService}postConstruct(){const e=this.resetQuickFilterCache.bind(this);this.addManagedEventListeners({columnPivotModeChanged:e,newColumnsLoaded:e,columnRowGroupChanged:e,columnVisible:()=>{this.gos.get("includeHiddenColumnsInQuickFilter")||this.resetQuickFilterCache()}}),this.addManagedPropertyListener("quickFilterText",t=>this.setQuickFilter(t.currentValue)),this.addManagedPropertyListeners(["includeHiddenColumnsInQuickFilter","applyQuickFilterBeforePivotOrAgg"],()=>this.onQuickFilterColumnConfigChanged()),this.quickFilter=this.parseQuickFilter(this.gos.get("quickFilterText")),this.parser=this.gos.get("quickFilterParser"),this.matcher=this.gos.get("quickFilterMatcher"),this.setQuickFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],()=>this.setQuickFilterParserAndMatcher())}refreshQuickFilterCols(){var o;const e=this.columnModel.isPivotMode(),t=this.columnModel.getAutoCols(),i=this.columnModel.getColDefCols();let s=(e&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")?(o=this.pivotResultColsService.getPivotResultCols())==null?void 0:o.list:i)??[];t&&(s=s.concat(t)),this.colsForQuickFilter=this.gos.get("includeHiddenColumnsInQuickFilter")?s:s.filter(r=>r.isVisible()||r.isRowGroupActive())}isQuickFilterPresent(){return this.quickFilter!==null}doesRowPassQuickFilter(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassQuickFilterMatcher(t,e):this.quickFilterParts.every(i=>t?this.doesRowPassQuickFilterCache(e,i):this.doesRowPassQuickFilterNoCache(e,i))}resetQuickFilterCache(){this.rowModel.forEachNode(e=>e.quickFilterAggregateText=null)}setQuickFilterParts(){const{quickFilter:e,parser:t}=this;e?this.quickFilterParts=t?t(e):e.split(" "):this.quickFilterParts=null}parseQuickFilter(e){return F(e)?N(this.gos)?e.toUpperCase():(S("Quick filtering only works with the Client-Side Row Model"),null):null}setQuickFilter(e){if(e!=null&&typeof e!="string"){S(`Grid option quickFilterText only supports string inputs, received: ${typeof e}`);return}const t=this.parseQuickFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setQuickFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}setQuickFilterParserAndMatcher(){const e=this.gos.get("quickFilterParser"),t=this.gos.get("quickFilterMatcher"),i=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,i&&(this.setQuickFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}onQuickFilterColumnConfigChanged(){this.refreshQuickFilterCols(),this.resetQuickFilterCache(),this.isQuickFilterPresent()&&this.dispatchLocalEvent({type:"quickFilterChanged"})}doesRowPassQuickFilterNoCache(e,t){return this.colsForQuickFilter.some(i=>{const s=this.getQuickFilterTextForColumn(i,e);return F(s)&&s.indexOf(t)>=0})}doesRowPassQuickFilterCache(e,t){return this.checkGenerateQuickFilterAggregateText(e),e.quickFilterAggregateText.indexOf(t)>=0}doesRowPassQuickFilterMatcher(e,t){let i;e?(this.checkGenerateQuickFilterAggregateText(t),i=t.quickFilterAggregateText):i=this.getQuickFilterAggregateText(t);const{quickFilterParts:s,matcher:o}=this;return o(s,i)}checkGenerateQuickFilterAggregateText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getQuickFilterAggregateText(e))}getQuickFilterTextForColumn(e,t){let i=this.valueService.getValue(e,t,!0);const s=e.getColDef();if(s.getQuickFilterText){const o=this.gos.addGridCommonParams({value:i,node:t,data:t.data,column:e,colDef:s});i=s.getQuickFilterText(o)}return F(i)?i.toString().toUpperCase():null}getQuickFilterAggregateText(e){const t=[];return this.colsForQuickFilter.forEach(i=>{const s=this.getQuickFilterTextForColumn(i,e);F(s)&&t.push(s)}),t.join(` `)}},Ls={version:x,moduleName:"@ag-grid-community/filter-core",beans:[Ya]},qd={version:x,moduleName:"@ag-grid-community/filter-api",apiFunctions:{isAnyFilterPresent:kd,onFilterChanged:Hd},dependantModules:[Ls]},Os={version:x,moduleName:"@ag-grid-community/column-filter",beans:[Gd],dependantModules:[Ls]},Yd={version:x,moduleName:"@ag-grid-community/column-filter-api",apiFunctions:{isColumnFilterPresent:Pd,getFilterInstance:Dd,getColumnFilterInstance:Ed,destroyFilter:Md,setFilterModel:xd,getFilterModel:Ad,getColumnFilterModel:Td,setColumnFilterModel:Id,showColumnFilter:Ld},dependantModules:[Os,qd]},Kr={version:x,moduleName:"@ag-grid-community/floating-filter-core",controllers:[{name:"headerFilterCell",classImp:bd}],dependantModules:[Os]},Qd={version:x,moduleName:"@ag-grid-community/read-only-floating-filter",userComponents:[{name:"agReadOnlyFloatingFilter",classImp:Vd}],dependantModules:[Kr]},Xd={version:x,moduleName:"@ag-grid-community/simple-filter",dependantModules:[Os],userComponents:[{name:"agTextColumnFilter",classImp:fd},{name:"agNumberColumnFilter",classImp:pd},{name:"agDateColumnFilter",classImp:vd},{name:"agDateInput",classImp:Bd}]},Jd={version:x,moduleName:"@ag-grid-community/simple-floating-filter",dependantModules:[Xd,Kr],userComponents:[{name:"agTextColumnFloatingFilter",classImp:_d},{name:"agNumberColumnFloatingFilter",classImp:zd},{name:"agDateColumnFloatingFilter",classImp:Nd}]},$r={version:x,moduleName:"@ag-grid-community/quick-filter-core",beans:[jd],dependantModules:[Ls]},Zd={version:x,moduleName:"@ag-grid-community/quick-filter-api",apiFunctions:{isQuickFilterPresent:Ud,getQuickFilter:Kd,resetQuickFilter:$d},dependantModules:[$r]},eh={version:x,moduleName:"@ag-grid-community/quick-filter",dependantModules:[$r,Zd]},th={version:x,moduleName:"@ag-grid-community/filter",dependantModules:[Jd,Qd,eh,Yd]},Gs=class extends G{constructor(e,t){super(e),this.ctrl=t}getCtrl(){return this.ctrl}},ih=class extends Gs{constructor(e){super(`<div class="ag-header-cell ag-floating-filter" role="gridcell"> <div data-ref="eFloatingFilterBody" role="presentation"></div> <div class="ag-floating-filter-button ag-hidden" data-ref="eButtonWrapper" role="presentation"> <button type="button" class="ag-button ag-floating-filter-button-button" data-ref="eButtonShowMainFilter" tabindex="-1"></button> </div> </div>`,e),this.eFloatingFilterBody=b,this.eButtonWrapper=b,this.eButtonShowMainFilter=b}postConstruct(){const e=this.getGui(),t={addOrRemoveCssClass:(i,s)=>this.addOrRemoveCssClass(i,s),addOrRemoveBodyCssClass:(i,s)=>this.eFloatingFilterBody.classList.toggle(i,s),setButtonWrapperDisplayed:i=>H(this.eButtonWrapper,i),setCompDetails:i=>this.setCompDetails(i),getFloatingFilterComp:()=>this.compPromise,setWidth:i=>e.style.width=i,setMenuIcon:i=>this.eButtonShowMainFilter.appendChild(i)};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()}}},sh=class extends Gs{constructor(e){super(`<div class="ag-header-cell" role="columnheader"> <div data-ref="eResize" class="ag-header-cell-resize" role="presentation"></div> <div data-ref="eHeaderCompWrapper" class="ag-header-cell-comp-wrapper" role="presentation"></div> </div>`,e),this.eResize=b,this.eHeaderCompWrapper=b,this.headerCompVersion=0,this.column=e.getColumnGroupChild(),this.pinned=e.getPinned()}postConstruct(){const e=this.getGui();((o,r)=>{r!=null&&r!=""?e.setAttribute(o,r):e.removeAttribute(o)})("col-id",this.column.getColId());const i={setWidth:o=>e.style.width=o,addOrRemoveCssClass:(o,r)=>this.addOrRemoveCssClass(o,r),setAriaSort:o=>o?Hl(e,o):Vl(e),setUserCompDetails:o=>this.setUserCompDetails(o),getUserCompInstance:()=>this.headerComp};this.ctrl.setComp(i,this.getGui(),this.eResize,this.eHeaderCompWrapper,void 0);const s=this.ctrl.getSelectAllGui();this.eResize.insertAdjacentElement("afterend",s)}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(i=>this.afterCompCreated(t,i))}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())}},oh=class extends Gs{constructor(e){super(`<div class="ag-header-group-cell" role="columnheader"> <div data-ref="eHeaderCompWrapper" class="ag-header-cell-comp-wrapper" role="presentation"></div> <div data-ref="eResize" class="ag-header-cell-resize" role="presentation"></div> </div>`,e),this.eResize=b,this.eHeaderCompWrapper=b}postConstruct(){const e=this.getGui(),t=(s,o)=>o!=null?e.setAttribute(s,o):e.removeAttribute(s);e.setAttribute("col-id",this.ctrl.getColId());const i={addOrRemoveCssClass:(s,o)=>this.addOrRemoveCssClass(s,o),setHeaderWrapperHidden:s=>{s?this.eHeaderCompWrapper.style.setProperty("display","none"):this.eHeaderCompWrapper.style.removeProperty("display")},setHeaderWrapperMaxHeight:s=>{s!=null?this.eHeaderCompWrapper.style.setProperty("max-height",`${s}px`):this.eHeaderCompWrapper.style.removeProperty("max-height"),this.eHeaderCompWrapper.classList.toggle("ag-header-cell-comp-wrapper-limited-height",s!=null)},setResizableDisplayed:s=>H(this.eResize,s),setWidth:s=>e.style.width=s,setAriaExpanded:s=>t("aria-expanded",s),setUserCompDetails:s=>this.setUserCompDetails(s),getUserCompInstance:()=>this.headerGroupComp};this.ctrl.setComp(i,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 i=this.getGui(),s=e.getGui();this.eHeaderCompWrapper.appendChild(s),this.addDestroyFunc(t),this.headerGroupComp=e,this.ctrl.setDragSource(i)}addOrRemoveHeaderWrapperStyle(e,t){const{eHeaderCompWrapper:i}=this;t?i.style.setProperty(e,t):i.style.removeProperty(e)}},rh=class extends G{constructor(e){super(),this.headerComps={},this.ctrl=e,this.setTemplate(`<div class="${this.ctrl.getHeaderRowClass()}" role="row"></div>`)}postConstruct(){Qo(this.getGui(),this.ctrl.getAriaRowIndex());const e={setHeight:t=>this.getGui().style.height=t,setTop:t=>this.getGui().style.top=t,setHeaderCtrls:(t,i)=>this.setHeaderCtrls(t,i),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 i=this.headerComps;if(this.headerComps={},e.forEach(s=>{const o=s.instanceId;let r=i[o];delete i[o],r==null&&(r=this.createHeaderComp(s),this.getGui().appendChild(r.getGui())),this.headerComps[o]=r}),re(i,(s,o)=>{this.getGui().removeChild(o.getGui()),this.destroyBean(o)}),t){const s=Oe(this.headerComps);s.sort((r,n)=>{const l=r.getCtrl().getColumnGroupChild().getLeft(),a=n.getCtrl().getColumnGroupChild().getLeft();return l-a});const o=s.map(r=>r.getGui());lr(this.getGui(),o)}}createHeaderComp(e){let t;switch(this.ctrl.getType()){case"group":t=new oh(e);break;case"filter":t=new ih(e);break;default:t=new sh(e);break}return this.createBean(t),t.setParentComponent(this),t}},nh=class extends v{constructor(){super(...arguments),this.beanName="headerNavigationService",this.currentHeaderRowWithoutSpan=-1}wireBeans(e){this.focusService=e.focusService,this.headerPositionUtils=e.headerPositionUtils,this.ctrlsService=e.ctrlsService,this.columnModel=e.columnModel,this.visibleColService=e.visibleColsService}postConstruct(){this.ctrlsService.whenReady(this,t=>{this.gridBodyCon=t.gridBodyCtrl});const e=B(this.gos);this.addManagedElementListeners(e,{mousedown:()=>this.setCurrentHeaderRowWithoutSpan(-1)})}getHeaderRowCount(){var e;return((e=this.ctrlsService.getHeaderRowContainerCtrl())==null?void 0:e.getRowCount())??0}getHeaderPositionForColumn(e,t){let i;if(typeof e=="string"?(i=this.columnModel.getCol(e),i||(i=this.visibleColService.getColumnGroup(e))):i=e,!i)return null;const s=this.ctrlsService.getHeaderRowContainerCtrl(),o=s==null?void 0:s.getAllCtrls(),r=I(o||[]).getType()==="filter",n=this.getHeaderRowCount()-1;let l=-1,a=i;for(;a;)l++,a=a.getParent();let d=l;return t&&r&&d===n-1&&d++,d===-1?null:{headerRowIndex:d,column:i}}navigateVertically(e,t,i){if(t||(t=this.focusService.getFocusedHeader()),!t)return!1;const{headerRowIndex:s}=t,o=t.column,r=this.getHeaderRowCount(),n=e===0;let{headerRowIndex:l,column:a,headerRowIndexWithoutSpan:d}=n?this.headerPositionUtils.getColumnVisibleParent(o,s):this.headerPositionUtils.getColumnVisibleChild(o,s),h=!1;return l<0&&(l=0,a=o,h=!0),l>=r?(l=-1,this.setCurrentHeaderRowWithoutSpan(-1)):d!==void 0&&(this.currentHeaderRowWithoutSpan=d),!h&&!a?!1:this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:l,column:a},allowUserOverride:!0,event:i})}setCurrentHeaderRowWithoutSpan(e){this.currentHeaderRowWithoutSpan=e}navigateHorizontally(e,t=!1,i){const s=this.focusService.getFocusedHeader(),o=e===2,r=this.gos.get("enableRtl");let n,l;if(this.currentHeaderRowWithoutSpan!==-1?s.headerRowIndex=this.currentHeaderRowWithoutSpan:this.currentHeaderRowWithoutSpan=s.headerRowIndex,o!==r?(l="Before",n=this.headerPositionUtils.findHeader(s,l)):(l="After",n=this.headerPositionUtils.findHeader(s,l)),n||!t)return this.focusService.focusHeaderPosition({headerPosition:n,direction:l,fromTab:t,allowUserOverride:!0,event:i});if(t){const a=this.gos.getCallback("tabToNextHeader");if(a)return this.focusService.focusHeaderPositionFromUserFunc({userFunc:a,headerPosition:n,direction:l})}return this.focusNextHeaderRow(s,l,i)}focusNextHeaderRow(e,t,i){const s=e.headerRowIndex;let o=null,r;if(t==="Before"?s>0&&(r=s-1,this.currentHeaderRowWithoutSpan-=1,o=this.headerPositionUtils.findColAtEdgeForHeaderRow(r,"end")):(r=s+1,this.currentHeaderRowWithoutSpan<this.getHeaderRowCount()?this.currentHeaderRowWithoutSpan+=1:this.setCurrentHeaderRowWithoutSpan(-1),o=this.headerPositionUtils.findColAtEdgeForHeaderRow(r,"start")),!o)return!1;const{column:n,headerRowIndex:l}=this.headerPositionUtils.getHeaderIndexToFocus(o.column,o==null?void 0:o.headerRowIndex);return this.focusService.focusHeaderPosition({headerPosition:{column:n,headerRowIndex:l},direction:t,fromTab:!0,allowUserOverride:!0,event:i})}scrollToColumn(e,t="After"){if(e.getPinned())return;let i;if(W(e)){const s=e.getDisplayedLeafColumns();i=t==="Before"?I(s):s[0]}else i=e;this.gridBodyCon.getScrollFeature().ensureColumnVisible(i)}},lh=class extends v{wireBeans(e){this.animationFrameService=e.animationFrameService,this.headerNavigationService=e.headerNavigationService,this.focusService=e.focusService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.ctrlsService=e.ctrlsService,this.filterManager=e.filterManager,this.menuService=e.menuService}setComp(e,t,i){this.comp=e,this.eGui=t,this.createManagedBean(new Je(i,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addManagedEventListeners({columnPivotModeChanged:this.onPivotModeChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this)}),this.onPivotModeChanged(),this.setupHeaderHeight();const s=this.onHeaderContextMenu.bind(this);this.addManagedElementListeners(this.eGui,{contextmenu:s}),this.mockContextMenuForIPad(s),this.ctrlsService.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:()=>this.animationFrameService.requestAnimationFrame(()=>e()),gridStylesChanged:e,advancedFilterEnabledChanged:e})}getHeaderHeight(){return this.headerHeight}setHeaderHeight(){var r;const{columnModel:e}=this;let t=0;const i=this.columnModel.getGroupRowsHeight().reduce((n,l)=>n+l,0),s=this.columnModel.getColumnHeaderRowHeight();if((r=this.filterManager)!=null&&r.hasFloatingFilters()&&(t+=e.getFloatingFiltersHeight()),t+=i,t+=s,this.headerHeight===t)return;this.headerHeight=t;const o=`${t+1}px`;this.comp.setHeightAndMinHeight(o),this.eventService.dispatchEvent({type:"headerHeightChanged"})}onPivotModeChanged(){const e=this.columnModel.isPivotMode();this.comp.addOrRemoveCssClass("ag-pivot-on",e),this.comp.addOrRemoveCssClass("ag-pivot-off",!e)}onDisplayedColumnsChanged(){const t=this.visibleColsService.getAllCols().some(i=>i.isSpanHeaderHeight());this.comp.addOrRemoveCssClass("ag-header-allow-overflow",t)}onTabKeyDown(e){const t=this.gos.get("enableRtl"),i=e.shiftKey,s=i!==t?2:3;(this.headerNavigationService.navigateHorizontally(s,!0,e)||!i&&this.focusService.focusOverlay(!1)||this.focusService.focusNextGridCoreContainer(i,!0))&&e.preventDefault()}handleKeyDown(e){let t=null;switch(e.key){case m.LEFT:t=2;case m.RIGHT:{F(t)||(t=3),this.headerNavigationService.navigateHorizontally(t,!1,e)&&e.preventDefault();break}case m.UP:t=0;case m.DOWN:{F(t)||(t=1),this.headerNavigationService.navigateVertically(t,null,e)&&e.preventDefault();break}default:return}}onFocusOut(e){const{relatedTarget:t}=e;!t&&this.eGui.contains(V(this.gos))||this.eGui.contains(t)||this.focusService.clearFocusedHeader()}onHeaderContextMenu(e,t,i){var o;if(!e&&!i||!this.menuService.isHeaderContextMenuEnabled())return;const{target:s}=e??t;(s===this.eGui||s===((o=this.ctrlsService.getHeaderRowContainerCtrl())==null?void 0:o.getViewportElement()))&&this.menuService.showHeaderContextMenu(void 0,e,i)}mockContextMenuForIPad(e){if(!He())return;const t=new Ie(this.eGui),i=s=>{e(void 0,s.touchStart,s.touchEvent)};this.addManagedListeners(t,{longTap:i}),this.addDestroyFunc(()=>t.destroy())}},ks=class extends v{constructor(e,t=!1){super(),this.callback=e,this.addSpacer=t}wireBeans(e){this.visibleColsService=e.visibleColsService,this.scrollVisibleService=e.scrollVisibleService}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=z(this.gos,"print"),t=this.visibleColsService.getBodyContainerWidth(),i=this.visibleColsService.getColsLeftWidth(),s=this.visibleColsService.getDisplayedColumnsRightWidth();let o;e?o=t+i+s:(o=t,this.addSpacer&&(this.gos.get("enableRtl")?i:s)===0&&this.scrollVisibleService.isVerticalScrollShowing()&&(o+=this.scrollVisibleService.getScrollbarWidth())),this.callback(o)}},ah=class extends v{constructor(e){super(),this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[],this.pinned=e}wireBeans(e){this.funcColsService=e.funcColsService}onDragEnter(e){if(this.clearColumnsList(),this.gos.get("functionsReadOnly"))return;const t=e.dragItem.columns;t&&t.forEach(i=>{i.isPrimary()&&(i.isAnyFunctionActive()||(i.isAllowValue()?this.columnsToAggregate.push(i):i.isAllowRowGroup()?this.columnsToGroup.push(i):i.isAllowPivot()&&this.columnsToPivot.push(i)))})}getIconName(){return this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length>0?this.pinned?"pinned":"move":null}onDragLeave(e){this.clearColumnsList()}clearColumnsList(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0}onDragging(e){}onDragStop(e){this.columnsToAggregate.length>0&&this.funcColsService.addValueColumns(this.columnsToAggregate,"toolPanelDragAndDrop"),this.columnsToGroup.length>0&&this.funcColsService.addRowGroupColumns(this.columnsToGroup,"toolPanelDragAndDrop"),this.columnsToPivot.length>0&&this.funcColsService.addPivotColumns(this.columnsToPivot,"toolPanelDragAndDrop")}onDragCancel(){this.clearColumnsList()}};function jr(e){const{isFromHeader:t,fromLeft:i,xPosition:s,fromEnter:o,fakeEvent:r,pinned:n,gos:l,columnModel:a,columnMoveService:d,visibleColsService:h}=e;let{allMovingColumns:c}=e;if(t){const M=[];c.forEach(D=>{var L;let E=null,T=D.getParent();for(;T!=null&&T.getDisplayedLeafColumns().length===1;)E=T,T=T.getParent();E!=null?(!!((L=E.getColGroupDef())!=null&&L.marryChildren)?E.getProvidedColumnGroup().getLeafColumns():E.getLeafColumns()).forEach(Us=>{M.includes(Us)||M.push(Us)}):M.includes(D)||M.push(D)}),c=M}const u=c.slice();a.sortColsLikeCols(u);const g=uh({movingCols:u,draggingRight:i,xPosition:s,pinned:n,gos:l,columnModel:a,visibleColsService:h}),p=dh(u,a);if(g.length===0)return;const C=g[0];let f=p!==null&&!o;if(t&&(f=p!==null),f&&!r&&(!i&&C>=p||i&&C<=p))return;const w=h.getAllCols(),y=[];let R=null;for(let M=0;M<g.length;M++){const D=g[M],E=d.getProposedColumnOrder(u,D);if(!d.doesOrderPassRules(E))continue;const T=E.filter(X=>w.includes(X));if(R===null)R=T;else if(!ke(T,R))break;const L=hh(E);y.push({move:D,fragCount:L})}if(y.length===0)return;y.sort((M,D)=>M.fragCount-D.fragCount);const P=y[0].move;if(!(P>a.getCols().length-c.length))return{columns:c,toIndex:P}}function Hs(e){const{columns:t,toIndex:i}=jr(e)||{},{finished:s,columnMoveService:o}=e;return!t||i==null?null:(o.moveColumns(t,i,"uiColumnMoved",s),s?null:{columns:t,toIndex:i})}function dh(e,t){const i=t.getCols(),s=jn(e.map(a=>i.indexOf(a))),o=s[0];return I(s)-o!==s.length-1?null:o}function hh(e){function t(s){const o=[];let r=s.getOriginalParent();for(;r!=null;)o.push(r),r=r.getOriginalParent();return o}let i=0;for(let s=0;s<e.length-1;s++){let o=t(e[s]),r=t(e[s+1]);[o,r]=o.length>r.length?[o,r]:[r,o],o.forEach(n=>{r.indexOf(n)===-1&&i++})}return i}function ch(e,t){switch(t){case"left":return e.getLeftCols();case"right":return e.getRightCols();default:return e.getCenterCols()}}function uh(e){const{movingCols:t,draggingRight:i,xPosition:s,pinned:o,gos:r,columnModel:n,visibleColsService:l}=e;if(r.get("suppressMovableColumns")||t.some(R=>R.getColDef().suppressMovable))return[];const d=ch(l,o),h=n.getCols(),c=d.filter(R=>$e(t,R)),u=d.filter(R=>!$e(t,R)),g=h.filter(R=>!$e(t,R));let p=0,C=s;if(i){let R=0;c.forEach(P=>R+=P.getActualWidth()),C-=R}if(C>0){for(let R=0;R<u.length;R++){const P=u[R];if(C-=P.getActualWidth(),C<0)break;p++}i&&p++}let f;if(p>0){const R=u[p-1];f=g.indexOf(R)+1}else f=g.indexOf(u[0]),f===-1&&(f=0);const w=[f],y=(R,P)=>R-P;if(i){let R=f+1;const P=h.length-1;for(;R<=P;)w.push(R),R++;w.sort(y)}else{let R=f;const P=h.length-1;let M=h[R];for(;R<=P&&d.indexOf(M)<0;)R++,w.push(R),M=h[R];R=f-1;const D=0;for(;R>=D;)w.push(R),R--;w.sort(y).reverse()}return w}function hi(e){var d;const{pinned:t,fromKeyboard:i,gos:s,ctrlsService:o,useHeaderRow:r,skipScrollPadding:n}=e;let l=(d=o.getHeaderRowContainerCtrl(t))==null?void 0:d.getViewportElement(),{x:a}=e;return l?(i&&(a-=l.getBoundingClientRect().left),s.get("enableRtl")&&(r&&(l=l.querySelector(".ag-header-row")),a=l.clientWidth-a),t==null&&!n&&(a+=o.get("center").getCenterViewportScrollLeft()),a):0}function nt(e,t){for(const i of e)i.setMoving(t,"uiColumnMoved")}var ho=7,ts=100,Wt=ts/2,gh=5,ph=100,fh=class extends v{constructor(e){super(),this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.pinned=e,this.isCenterContainer=!F(e)}wireBeans(e){this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.columnMoveService=e.columnMoveService,this.dragAndDropService=e.dragAndDropService,this.ctrlsService=e.ctrlsService}postConstruct(){this.ctrlsService.whenReady(this,e=>{this.gridBodyCon=e.gridBodyCtrl})}getIconName(){var t;const e=((t=this.lastDraggingEvent)==null?void 0:t.dragItem.columns)??[];for(const i of e){const s=i.getPinned();if(i.getColDef().lockPinned){if(s==this.pinned)return"move";continue}if(s===this.pinned||!this.pinned)return"move";if(!s&&this.pinned)return"pinned"}return"notAllowed"}onDragEnter(e){const t=e.dragItem.columns;if(e.dragSource.type===0)this.setColumnsVisible(t,!0,"uiColumnDragged");else{const s=e.dragItem.visibleState,o=(t||[]).filter(r=>s[r.getId()]);this.setColumnsVisible(o,!0,"uiColumnDragged")}this.gos.get("suppressMoveWhenColumnDragging")||this.attemptToPinColumns(t,this.pinned),this.onDragging(e,!0,!0)}onDragging(e=this.lastDraggingEvent,t=!1,i=!1,s=!1){const o=this.gos.get("suppressMoveWhenColumnDragging");if(s&&!o){this.finishColumnMoving();return}if(this.lastDraggingEvent=e,!e||!s&&A(e.hDirection))return;const{pinned:r,gos:n,ctrlsService:l}=this,a=hi({x:e.x,pinned:r,gos:n,ctrlsService:l});t||this.checkCenterForScrolling(a),o?this.handleColumnDragWhileSuppressingMovement(e,t,i,a,s):this.handleColumnDragWhileAllowingMovement(e,t,i,a,s)}onDragLeave(){this.ensureIntervalCleared(),this.clearHighlighted(),this.lastMovedInfo=null}onDragStop(){this.onDragging(this.lastDraggingEvent,!1,!0,!0),this.ensureIntervalCleared(),this.lastMovedInfo=null}onDragCancel(){this.clearHighlighted(),this.ensureIntervalCleared(),this.lastMovedInfo=null}setColumnsVisible(e,t,i){if(!e)return;const s=e.filter(o=>!o.getColDef().lockVisible);this.columnModel.setColsVisible(s,t,i)}finishColumnMoving(){if(this.clearHighlighted(),!this.lastMovedInfo)return;const{columns:e,toIndex:t}=this.lastMovedInfo;this.columnMoveService.moveColumns(e,t,"uiColumnMoved",!0)}handleColumnDragWhileSuppressingMovement(e,t,i,s,o){const r=this.getAllMovingColumns(e,!0);if(o){const n=this.isAttemptingToPin(r);n&&this.attemptToPinColumns(r,void 0,!0);const{fromLeft:l,xPosition:a}=this.getNormalisedXPositionInfo(r,n)||{};if(l==null||a==null){this.finishColumnMoving();return}this.moveColumnsAfterHighlight({allMovingColumns:r,xPosition:a,fromEnter:t,fakeEvent:i,fromLeft:l})}else{if(!this.dragAndDropService.isDropZoneWithinThisGrid(e))return;this.highlightHoveredColumn(r,s)}}handleColumnDragWhileAllowingMovement(e,t,i,s,o){const r=this.getAllMovingColumns(e),n=this.normaliseDirection(e.hDirection)===1,l=e.dragSource.type===1,a=this.getMoveColumnParams({allMovingColumns:r,isFromHeader:l,xPosition:s,fromLeft:n,fromEnter:t,fakeEvent:i}),d=Hs({...a,finished:o});d&&(this.lastMovedInfo=d)}getAllMovingColumns(e,t=!1){const i=e.dragSource.getDragItem();let s=null;t?(s=i.columnsInSplit,s||(s=i.columns)):s=i.columns;const o=r=>r.getColDef().lockPinned?r.getPinned()==this.pinned:!0;return s?s.filter(o):[]}getMoveColumnParams(e){const{allMovingColumns:t,isFromHeader:i,xPosition:s,fromLeft:o,fromEnter:r,fakeEvent:n}=e,{pinned:l,gos:a,columnModel:d,columnMoveService:h,visibleColsService:c}=this;return{allMovingColumns:t,isFromHeader:i,fromLeft:o,xPosition:s,pinned:l,fromEnter:r,fakeEvent:n,gos:a,columnModel:d,columnMoveService:h,visibleColsService:c}}findFirstAndLastMovingColumns(e){const t=e.length;let i,s;for(let o=0;o<=t;o++){if(!i){const r=e[o];r.getLeft()!=null&&(i=r)}if(!s){const r=e[t-1-o];r.getLeft()!=null&&(s=r)}if(i&&s)break}return{firstMovingCol:i,lastMovingCol:s}}highlightHoveredColumn(e,t){var h;const{gos:i,columnModel:s}=this,o=i.get("enableRtl"),r=s.getCols().filter(c=>c.isVisible()&&c.getPinned()===this.pinned);let n=null,l=null,a=null;for(const c of r){if(l=c.getActualWidth(),n=this.getNormalisedColumnLeft(c,0,o),n!=null){const u=n+l;if(n<=t&&u>=t){a=c;break}}n=null,l=null}if(a)e.indexOf(a)!==-1&&(a=null);else{for(let c=r.length-1;c>=0;c--){const u=r[c],g=r[c].getParent();if(!g){a=u;break}const p=g==null?void 0:g.getDisplayedLeafColumns();if(p.length){a=I(p);break}}if(!a)return;n=this.getNormalisedColumnLeft(a,0,o),l=a.getActualWidth()}if(((h=this.lastHighlightedColumn)==null?void 0:h.column)!==a&&this.clearHighlighted(),a==null||n==null||l==null)return;let d;t-n<l/2!==o?d=0:d=1,a.setHighlighted(d),this.lastHighlightedColumn={column:a,position:d}}getNormalisedXPositionInfo(e,t){const{gos:i,visibleColsService:s}=this,o=i.get("enableRtl"),{firstMovingCol:r,column:n,position:l}=this.getColumnMoveAndTargetInfo(e,t,o);if(!r||!n||l==null)return;const a=s.getAllCols(),d=a.indexOf(r),h=a.indexOf(n),c=l===0!==o,u=d<h||d===h&&!c;let g=0;if(c?u&&(g-=1):u||(g+=1),h+g===d)return;const p=a[h+g];if(!p)return;const C=this.getNormalisedColumnLeft(p,20,o);return{fromLeft:u,xPosition:C}}getColumnMoveAndTargetInfo(e,t,i){const s=this.lastHighlightedColumn||{},{firstMovingCol:o,lastMovingCol:r}=this.findFirstAndLastMovingColumns(e);if(!o||!r||s.column||!t)return{firstMovingCol:o,...s};const l=this.getPinDirection()==="left";return{firstMovingCol:o,position:l?1:0,column:l!==i?o:r}}normaliseDirection(e){if(this.gos.get("enableRtl"))switch(e){case 0:return 1;case 1:return 0}return e}getNormalisedColumnLeft(e,t,i){const{gos:s,ctrlsService:o}=this,r=e.getLeft();if(r==null)return null;const n=e.getActualWidth();return hi({x:i?r+n-t:r+t,pinned:e.getPinned(),useHeaderRow:i,skipScrollPadding:!0,gos:s,ctrlsService:o})}isAttemptingToPin(e){const t=this.needToMoveLeft||this.needToMoveRight,i=this.failedMoveAttempts>ho;return t&&i||e.some(s=>s.getPinned()!==this.pinned)}moveColumnsAfterHighlight(e){const{allMovingColumns:t,xPosition:i,fromEnter:s,fakeEvent:o,fromLeft:r}=e,n=this.getMoveColumnParams({allMovingColumns:t,isFromHeader:!0,xPosition:i,fromLeft:r,fromEnter:s,fakeEvent:o}),{columns:l,toIndex:a}=jr(n)||{};l&&a!=null&&(this.lastMovedInfo={columns:l,toIndex:a}),this.finishColumnMoving()}clearHighlighted(){this.lastHighlightedColumn&&(this.lastHighlightedColumn.column.setHighlighted(null),this.lastHighlightedColumn=null)}checkCenterForScrolling(e){if(!this.isCenterContainer)return;const t=this.ctrlsService.get("center"),i=t.getCenterViewportScrollLeft(),s=i+t.getCenterWidth();this.gos.get("enableRtl")?(this.needToMoveRight=e<i+Wt,this.needToMoveLeft=e>s-Wt):(this.needToMoveLeft=e<i+Wt,this.needToMoveRight=e>s-Wt),this.needToMoveLeft||this.needToMoveRight?this.ensureIntervalStarted():this.ensureIntervalCleared()}ensureIntervalStarted(){var e;this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),ph),(e=this.dragAndDropService.getDragAndDropImageComponent())==null||e.setIcon(this.needToMoveLeft?"left":"right",!0))}ensureIntervalCleared(){var e;this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.failedMoveAttempts=0,(e=this.dragAndDropService.getDragAndDropImageComponent())==null||e.setIcon(this.getIconName()))}moveInterval(){var s,o;let e;this.intervalCount++,e=10+this.intervalCount*gh,e>ts&&(e=ts);let t=null;const i=this.gridBodyCon.getScrollFeature();if(this.needToMoveLeft?t=i.scrollHorizontally(-e):this.needToMoveRight&&(t=i.scrollHorizontally(e)),t!==0)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{if(this.failedMoveAttempts++,this.failedMoveAttempts<=ho+1)return;if((s=this.dragAndDropService.getDragAndDropImageComponent())==null||s.setIcon("pinned"),!this.gos.get("suppressMoveWhenColumnDragging")){const r=(o=this.lastDraggingEvent)==null?void 0:o.dragItem.columns;this.attemptToPinColumns(r,void 0,!0)}}}getPinDirection(){if(this.needToMoveLeft||this.pinned==="left")return"left";if(this.needToMoveRight||this.pinned==="right")return"right"}attemptToPinColumns(e,t,i=!1){const s=(e||[]).filter(o=>!o.getColDef().lockPinned);return s.length?(i&&(t=this.getPinDirection()),this.columnModel.setColsPinned(s,t,"uiColumnDragged"),i&&this.dragAndDropService.nudge(),s.length):0}destroy(){super.destroy(),this.lastDraggingEvent=null,this.clearHighlighted(),this.lastMovedInfo=null}},Ch=class extends v{wireBeans(e){this.dragAndDropService=e.dragAndDropService,this.columnModel=e.columnModel,this.ctrlsService=e.ctrlsService}constructor(e,t){super(),this.pinned=e,this.eContainer=t}postConstruct(){this.ctrlsService.whenReady(this,e=>{switch(this.pinned){case"left":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.left.getContainerElement()],[e.bottomLeft.getContainerElement()],[e.topLeft.getContainerElement()]];break;case"right":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.right.getContainerElement()],[e.bottomRight.getContainerElement()],[e.topRight.getContainerElement()]];break;default:this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.center.getViewportElement()],[e.bottomCenter.getViewportElement()],[e.topCenter.getViewportElement()]];break}}),this.moveColumnFeature=this.createManagedBean(new fh(this.pinned)),this.bodyDropPivotTarget=this.createManagedBean(new ah(this.pinned)),this.dragAndDropService.addDropTarget(this),this.addDestroyFunc(()=>this.dragAndDropService.removeDropTarget(this))}isInterestedIn(e){return e===1||e===0&&this.gos.get("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}getIconName(){return this.currentDropListener.getIconName()}isDropColumnInPivotMode(e){return this.columnModel.isPivotMode()&&e.dragSource.type===0}onDragEnter(e){this.currentDropListener=this.isDropColumnInPivotMode(e)?this.bodyDropPivotTarget:this.moveColumnFeature,this.currentDropListener.onDragEnter(e)}onDragLeave(e){this.currentDropListener.onDragLeave(e)}onDragging(e){this.currentDropListener.onDragging(e)}onDragStop(e){this.currentDropListener.onDragStop(e)}onDragCancel(){this.currentDropListener.onDragCancel()}},mh=class extends v{wireBeans(e){this.horizontalResizeService=e.horizontalResizeService,this.pinnedWidthService=e.pinnedWidthService,this.ctrlsService=e.ctrlsService,this.columnSizeService=e.columnSizeService,this.columnAutosizeService=e.columnAutosizeService}constructor(e,t,i,s,o){super(),this.pinned=e,this.column=t,this.eResize=i,this.comp=s,this.ctrl=o}postConstruct(){const e=[];let t,i;const s=()=>{if(H(this.eResize,t),!t)return;const n=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(e.push(n),i){const l=this.gos.get("skipHeaderOnAutoSize"),a=()=>{this.columnAutosizeService.autoSizeColumn(this.column,"uiColumnResized",l)};this.eResize.addEventListener("dblclick",a);const d=new Ie(this.eResize);d.addEventListener("doubleTap",a),e.push(()=>{this.eResize.removeEventListener("dblclick",a),d.removeEventListener("doubleTap",a),d.destroy()})}},o=()=>{e.forEach(n=>n()),e.length=0},r=()=>{const n=this.column.isResizable(),l=!this.gos.get("suppressAutoSize")&&!this.column.getColDef().suppressAutoSize;(n!==t||l!==i)&&(t=n,i=l,o(),s())};r(),this.addDestroyFunc(o),this.ctrl.setRefreshFunction("resize",r)}onResizing(e,t){const{column:i,lastResizeAmount:s,resizeStartWidth:o}=this,r=this.normaliseResizeAmount(t),n=o+r,l=[{key:i,newWidth:n}];if(this.column.getPinned()){const a=this.pinnedWidthService.getPinnedLeftWidth(),d=this.pinnedWidthService.getPinnedRightWidth(),h=Ht(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50;if(a+d+(r-s)>h)return}this.lastResizeAmount=r,this.columnSizeService.setColumnWidths(l,this.resizeWithShiftKey,e,"uiColumnResized"),e&&this.toggleColumnResizing(!1)}onResizeStart(e){this.resizeStartWidth=this.column.getActualWidth(),this.lastResizeAmount=0,this.resizeWithShiftKey=e,this.toggleColumnResizing(!0)}toggleColumnResizing(e){this.comp.addOrRemoveCssClass("ag-column-resizing",e)}normaliseResizeAmount(e){let t=e;const i=this.pinned!=="left",s=this.pinned==="right";return this.gos.get("enableRtl")?i&&(t*=-1):s&&(t*=-1),t}},vh=class extends v{constructor(e){super(),this.cbSelectAllVisible=!1,this.processingEventFromCheckbox=!1,this.column=e}wireBeans(e){this.rowModel=e.rowModel,this.selectionService=e.selectionService}onSpaceKeyDown(e){const t=this.cbSelectAll;t.isDisplayed()&&!t.getGui().contains(V(this.gos))&&(e.preventDefault(),t.setValue(!t.getValue()))}getCheckboxGui(){return this.cbSelectAll.getGui()}setComp(e){this.headerCellCtrl=e,this.cbSelectAll=this.createManagedBean(new bs),this.cbSelectAll.addCssClass("ag-header-select-all"),ee(this.cbSelectAll.getGui(),"presentation"),this.showOrHideSelectAll(),this.addManagedEventListeners({newColumnsLoaded:this.onNewColumnsLoaded.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),selectionChanged:this.onSelectionChanged.bind(this),paginationChanged:this.onSelectionChanged.bind(this),modelUpdated:this.onModelChanged.bind(this)}),this.addManagedListeners(this.cbSelectAll,{fieldValueChanged:this.onCbSelectAll.bind(this)}),this.cbSelectAll.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()}onNewColumnsLoaded(){this.showOrHideSelectAll()}onDisplayedColumnsChanged(){this.isAlive()&&this.showOrHideSelectAll()}showOrHideSelectAll(){this.cbSelectAllVisible=this.isCheckboxSelection(),this.cbSelectAll.setDisplayed(this.cbSelectAllVisible),this.cbSelectAllVisible&&(this.checkRightRowModelType("selectAllCheckbox"),this.checkSelectionType("selectAllCheckbox"),this.updateStateOfCheckbox()),this.refreshSelectAllLabel()}onModelChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}onSelectionChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}updateStateOfCheckbox(){if(this.processingEventFromCheckbox)return;this.processingEventFromCheckbox=!0;const e=this.selectionService.getSelectAllState(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setValue(e);const t=this.selectionService.hasNodesToSelect(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setDisabled(!t),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}refreshSelectAllLabel(){const e=this.localeService.getLocaleTextFunc(),i=this.cbSelectAll.getValue()?e("ariaChecked","checked"):e("ariaUnchecked","unchecked"),s=e("ariaRowSelectAll","Press Space to toggle all rows selection");this.cbSelectAllVisible?this.headerCellCtrl.setAriaDescriptionProperty("selectAll",`${s} (${i})`):this.headerCellCtrl.setAriaDescriptionProperty("selectAll",null),this.cbSelectAll.setInputAriaLabel(e("ariaHeaderSelection","Column with Header Selection")),this.headerCellCtrl.announceAriaDescription()}checkSelectionType(e){return hs(this.gos)?!0:(S(`${e} is only available if using 'multiRow' selection mode.`),!1)}checkRightRowModelType(e){return N(this.gos)||De(this.gos)?!0:(S(`${e} is only available if using 'clientSide' or 'serverSide' rowModelType, you are using ${this.rowModel.getType()}.`),!1)}onCbSelectAll(){if(this.processingEventFromCheckbox||!this.cbSelectAllVisible)return;const e=this.cbSelectAll.getValue(),t=this.isFilteredOnly(),i=this.isCurrentPageOnly();let s="uiSelectAll";i?s="uiSelectAllCurrentPage":t&&(s="uiSelectAllFiltered");const o={source:s,justFiltered:t,justCurrentPage:i};e?this.selectionService.selectAllRowNodes(o):this.selectionService.deselectAllRowNodes(o)}isCheckboxSelection(){const e=this.gos.get("rowSelection"),t=typeof e=="object"&&Zt(e)&&Gt(this.column),i=this.column.getColDef().headerCheckboxSelection;let s=!1;return t?s=!0:typeof i=="function"?s=i(this.gos.addGridCommonParams({column:this.column,colDef:this.column.getColDef()})):s=!!i,s&&this.checkRightRowModelType(t?"headerCheckbox":"headerCheckboxSelection")&&this.checkSelectionType(t?"headerCheckbox":"headerCheckboxSelection")}isFilteredOnly(){const e=this.gos.get("rowSelection");return typeof e=="object"?e.mode==="multiRow"&&e.selectAll==="filtered":!!this.column.getColDef().headerCheckboxSelectionFilteredOnly}isCurrentPageOnly(){const e=this.gos.get("rowSelection");return typeof e=="object"?e.mode==="multiRow"&&e.selectAll==="currentPage":!!this.column.getColDef().headerCheckboxSelectionCurrentPageOnly}},wh=class extends Ci{constructor(e,t,i){super(e,t,i),this.refreshFunctions={},this.userHeaderClasses=new Set,this.ariaDescriptionProperties=new Map,this.column=e}setComp(e,t,i,s,o){this.comp=e,o=kt(this,this.beans.context,o),this.setGui(t,o),this.updateState(),this.setupWidth(o),this.setupMovingCss(o),this.setupMenuClass(o),this.setupSortableClass(o),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight({wrapperElement:s,checkMeasuringCallback:n=>this.setRefreshFunction("measuring",n),compBean:o}),this.addColumnHoverListener(o),this.setupFilterClass(o),this.setupClassesFromColDef(),this.setupTooltip(o),this.addActiveHeaderMouseListeners(o),this.setupSelectAll(o),this.setupUserComp(o),this.refreshAria(),this.resizeFeature=o.createManagedBean(new mh(this.getPinned(),this.column,i,e,this)),o.createManagedBean(new Is([this.column],t)),o.createManagedBean(new Ts(this.column,t,this.beans)),o.createManagedBean(new Je(t,{shouldStopEventPropagation:n=>this.shouldStopEventPropagation(n),onTabKeyDown:()=>null,handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addResizeAndMoveKeyboardListeners(o),o.addManagedPropertyListeners(["suppressMovableColumns","suppressMenuHide","suppressAggFuncInHeader"],()=>this.refresh(o)),o.addManagedListeners(this.column,{colDefChanged:()=>this.refresh(o)}),o.addManagedListeners(this.column,{headerHighlightChanged:this.onHeaderHighlightChanged.bind(this)});const r=()=>this.checkDisplayName(o);o.addManagedEventListeners({columnValueChanged:r,columnRowGroupChanged:r,columnPivotChanged:r,headerHeightChanged:this.onHeaderHeightChanged.bind(this)}),o.addDestroyFunc(()=>{this.refreshFunctions={},this.selectAllFeature=null,this.dragSourceElement=void 0,this.userCompDetails=null,this.userHeaderClasses.clear(),this.ariaDescriptionProperties.clear(),this.clearComponent()})}resizeHeader(e,t){if(!this.column.isResizable())return;const i=this.column.getActualWidth(),s=this.column.getMinWidth(),o=this.column.getMaxWidth(),r=Math.min(Math.max(i+e,s),o);this.beans.columnSizeService.setColumnWidths([{key:this.column,newWidth:r}],t,!0,"uiColumnResized")}moveHeader(e){const{eGui:t,beans:i,column:s,ctrlsService:o}=this,{gos:r,columnModel:n,columnMoveService:l,visibleColsService:a}=i,d=this.getPinned(),h=t.getBoundingClientRect().left,c=s.getActualWidth(),u=r.get("enableRtl"),p=hi({x:e===0!==u?h-20:h+c+20,pinned:d,fromKeyboard:!0,gos:r,ctrlsService:o}),C=this.focusService.getFocusedHeader();Hs({allMovingColumns:[s],isFromHeader:!0,fromLeft:e===1,xPosition:p,pinned:d,fromEnter:!1,fakeEvent:!1,gos:r,columnModel:n,columnMoveService:l,visibleColsService:a,finished:!0}),o.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(s,"auto"),(!this.isAlive()||this.beans.gos.get("ensureDomOrder"))&&C&&this.restoreFocus(C)}restoreFocus(e){this.focusService.focusHeaderPosition({headerPosition:{...e,column:this.column}})}setupUserComp(e){const t=this.lookupUserCompDetails(e);this.setCompDetails(t)}setCompDetails(e){this.userCompDetails=e,this.comp.setUserCompDetails(e)}lookupUserCompDetails(e){const t=this.createParams(e),i=this.column.getColDef();return this.userComponentFactory.getHeaderCompDetails(i,t)}createParams(e){return this.gos.addGridCommonParams({column:this.column,displayName:this.displayName,enableSorting:this.column.isSortable(),enableMenu:this.menuEnabled,enableFilterButton:this.openFilterEnabled&&this.menuService.isHeaderFilterButtonEnabled(this.column),enableFilterIcon:!this.openFilterEnabled||this.menuService.isLegacyMenuEnabled(),showColumnMenu:i=>{this.menuService.showColumnMenu({column:this.column,buttonElement:i,positionBy:"button"})},showColumnMenuAfterMouseClick:i=>{this.menuService.showColumnMenu({column:this.column,mouseEvent:i,positionBy:"mouse"})},showFilter:i=>{this.menuService.showFilterMenu({column:this.column,buttonElement:i,containerType:"columnFilter",positionBy:"button"})},progressSort:i=>{this.beans.sortController.progressSort(this.column,!!i,"uiColumnSorted")},setSort:(i,s)=>{this.beans.sortController.setSortForColumn(this.column,i,!!s,"uiColumnSorted")},eGridHeader:this.getGui(),setTooltip:(i,s)=>{this.setupTooltip(e,i,s)}})}setupSelectAll(e){this.selectAllFeature=e.createManagedBean(new vh(this.column)),this.selectAllFeature.setComp(this)}getSelectAllGui(){return this.selectAllFeature.getCheckboxGui()}handleKeyDown(e){super.handleKeyDown(e),e.key===m.SPACE&&this.selectAllFeature.onSpaceKeyDown(e),e.key===m.ENTER&&this.onEnterKeyDown(e),e.key===m.DOWN&&e.altKey&&this.showMenuOnKeyPress(e,!1)}onEnterKeyDown(e){if(e.ctrlKey||e.metaKey)this.showMenuOnKeyPress(e,!0);else if(this.sortable){const t=e.shiftKey;this.beans.sortController.progressSort(this.column,t,"uiColumnSorted")}}showMenuOnKeyPress(e,t){const i=this.comp.getUserCompInstance();!i||!(i instanceof Xi)||i.onMenuKeyboardShortcut(t)&&e.preventDefault()}onFocusIn(e){if(!this.getGui().contains(e.relatedTarget)){const t=this.getRowIndex();this.focusService.setFocusedHeader(t,this.column),this.announceAriaDescription()}this.focusService.isKeyboardMode()&&this.setActiveHeader(!0)}onFocusOut(e){this.getGui().contains(e.relatedTarget)||this.setActiveHeader(!1)}setupTooltip(e,t,i){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const s=this.gos.get("tooltipShowMode")==="whenTruncated",o=this.eGui,r=this.column.getColDef();!i&&s&&!r.headerComponent&&(i=()=>{const a=o.querySelector(".ag-header-cell-text");return a?a.scrollWidth>a.clientWidth:!0});const n={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getGui:()=>o,getLocation:()=>"header",getTooltipValue:()=>t??this.column.getColDef().headerTooltip,shouldDisplayTooltip:i},l=e.createManagedBean(new gt(n));this.setRefreshFunction("tooltip",()=>l.refreshToolTip())}setupClassesFromColDef(){const e=()=>{const t=this.column.getColDef(),i=Vr(t,this.gos,this.column,null),s=this.userHeaderClasses;this.userHeaderClasses=new Set(i),i.forEach(o=>{s.has(o)?s.delete(o):this.comp.addOrRemoveCssClass(o,!0)}),s.forEach(o=>this.comp.addOrRemoveCssClass(o,!1))};this.setRefreshFunction("headerClasses",e),e()}setDragSource(e){if(this.dragSourceElement=e,this.removeDragSource(),!e||!this.draggable)return;const{column:t,beans:i,displayName:s,dragAndDropService:o,gos:r}=this,{columnModel:n}=i;let l=!this.gos.get("suppressDragLeaveHidesColumns");const a=this.dragSource={type:1,eElement:e,getDefaultIconName:()=>l?"hide":"notAllowed",getDragItem:()=>this.createDragItem(t),dragItemName:s,onDragStarted:()=>{l=!r.get("suppressDragLeaveHidesColumns"),nt([t],!0)},onDragStopped:()=>nt([t],!1),onDragCancelled:()=>nt([t],!1),onGridEnter:d=>{var h;if(l){const c=((h=d==null?void 0:d.columns)==null?void 0:h.filter(u=>!u.getColDef().lockVisible))||[];n.setColsVisible(c,!0,"uiColumnMoved")}},onGridExit:d=>{var h;if(l){const c=((h=d==null?void 0:d.columns)==null?void 0:h.filter(u=>!u.getColDef().lockVisible))||[];n.setColsVisible(c,!1,"uiColumnMoved")}}};o.addDragSource(a,!0)}createDragItem(e){const t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t}}updateState(){this.menuEnabled=this.menuService.isColumnMenuInHeaderEnabled(this.column),this.openFilterEnabled=this.menuService.isFilterMenuInHeaderEnabled(this.column),this.sortable=this.column.isSortable(),this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()}setRefreshFunction(e,t){this.refreshFunctions[e]=t}refresh(e){this.updateState(),this.refreshHeaderComp(e),this.refreshAria(),Object.values(this.refreshFunctions).forEach(t=>t())}refreshHeaderComp(e){const t=this.lookupUserCompDetails(e);(this.comp.getUserCompInstance()!=null&&this.userCompDetails.componentClass==t.componentClass?this.attemptHeaderCompRefresh(t.params):!1)?this.setDragSource(this.dragSourceElement):this.setCompDetails(t)}attemptHeaderCompRefresh(e){const t=this.comp.getUserCompInstance();return!t||!t.refresh?!1:t.refresh(e)}calculateDisplayName(){return this.beans.columnNameService.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(e){this.displayName!==this.calculateDisplayName()&&this.refresh(e)}workOutDraggable(){const e=this.column.getColDef();return!!(!this.gos.get("suppressMovableColumns")&&!e.suppressMovable&&!e.lockPosition)||!!e.enableRowGroup||!!e.enablePivot}setupWidth(e){const t=()=>{const i=this.column.getActualWidth();this.comp.setWidth(`${i}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 i=this.column.isFilterActive();this.comp.addOrRemoveCssClass("ag-header-cell-filtered",i),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,i=e===1;this.comp.addOrRemoveCssClass("ag-header-highlight-before",t),this.comp.addOrRemoveCssClass("ag-header-highlight-after",i)}onDisplayedColumnsChanged(){super.onDisplayedColumnsChanged(),this.isAlive()&&this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){const{eGui:e,column:t,comp:i,beans:s}=this,o=this.beans.columnModel.getGroupRowsHeight(),r=o.reduce((c,u)=>c+=u,0)===0;if(i.addOrRemoveCssClass("ag-header-parent-hidden",r),!t.isSpanHeaderHeight()){e.style.removeProperty("top"),e.style.removeProperty("height"),i.addOrRemoveCssClass("ag-header-span-height",!1),i.addOrRemoveCssClass("ag-header-span-total",!1);return}const{numberOfParents:n,isSpanningTotal:l}=this.column.getColumnGroupPaddingInfo();i.addOrRemoveCssClass("ag-header-span-height",n>0);const{columnModel:a}=s,d=a.getColumnHeaderRowHeight();if(n===0){i.addOrRemoveCssClass("ag-header-span-total",!1),e.style.setProperty("top","0px"),e.style.setProperty("height",`${d}px`);return}i.addOrRemoveCssClass("ag-header-span-total",l);let h=0;for(let c=0;c<n;c++)h+=o[o.length-1-c];e.style.setProperty("top",`${-h}px`),e.style.setProperty("height",`${d+h}px`)}refreshAriaSort(){if(this.sortable){const e=this.localeService.getLocaleTextFunc(),t=this.beans.sortController.getDisplaySortForColumn(this.column)||null;this.comp.setAriaSort(Dl(t)),this.setAriaDescriptionProperty("sort",e("ariaSortableColumn","Press ENTER to sort"))}else this.comp.setAriaSort(),this.setAriaDescriptionProperty("sort",null)}refreshAriaMenu(){if(this.menuEnabled){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("menu",e("ariaMenuColumn","Press ALT DOWN to open column menu"))}else this.setAriaDescriptionProperty("menu",null)}refreshAriaFilterButton(){if(this.openFilterEnabled&&!this.menuService.isLegacyMenuEnabled()){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("filterButton",e("ariaFilterColumn","Press CTRL ENTER to open filter"))}else this.setAriaDescriptionProperty("filterButton",null)}refreshAriaFiltered(){const e=this.localeService.getLocaleTextFunc();this.column.isFilterActive()?this.setAriaDescriptionProperty("filter",e("ariaColumnFiltered","Column Filtered")):this.setAriaDescriptionProperty("filter",null)}setAriaDescriptionProperty(e,t){t!=null?this.ariaDescriptionProperties.set(e,t):this.ariaDescriptionProperties.delete(e)}announceAriaDescription(){if(!this.eGui.contains(V(this.beans.gos)))return;const e=Array.from(this.ariaDescriptionProperties.keys()).sort((t,i)=>t==="filter"?-1:i.charCodeAt(0)-t.charCodeAt(0)).map(t=>this.ariaDescriptionProperties.get(t)).join(". ");this.beans.ariaAnnouncementService.announceValue(e,"columnHeader")}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaFilterButton(),this.refreshAriaFiltered()}addColumnHoverListener(e){const t=()=>{if(!this.gos.get("columnHoverHighlight"))return;const i=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",i)};e.addManagedEventListeners({columnHoverChanged:t}),t()}getColId(){return this.column.getColId()}addActiveHeaderMouseListeners(e){const t=o=>this.handleMouseOverChange(o.type==="mouseenter"),i=()=>this.dispatchColumnMouseEvent("columnHeaderClicked",this.column),s=o=>this.handleContextMenuMouseEvent(o,void 0,this.column);e.addManagedListeners(this.getGui(),{mouseenter:t,mouseleave:t,click:i,contextmenu:s})}handleMouseOverChange(e){this.setActiveHeader(e),this.eventService.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 t instanceof Xi?t.getAnchorElementForMenu(e):this.getGui()}destroy(){super.destroy()}},Sh=class extends v{wireBeans(e){this.horizontalResizeService=e.horizontalResizeService,this.autoWidthCalculator=e.autoWidthCalculator,this.visibleColsService=e.visibleColsService,this.columnSizeService=e.columnSizeService,this.columnAutosizeService=e.columnAutosizeService}constructor(e,t,i,s){super(),this.eResize=t,this.comp=e,this.pinned=i,this.columnGroup=s}postConstruct(){if(!this.columnGroup.isResizable()){this.comp.setResizableDisplayed(!1);return}const e=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(this.addDestroyFunc(e),!this.gos.get("suppressAutoSize")){const t=this.gos.get("skipHeaderOnAutoSize");this.eResize.addEventListener("dblclick",()=>{const i=[];this.columnGroup.getDisplayedLeafColumns().forEach(o=>{o.getColDef().suppressAutoSize||i.push(o.getColId())}),i.length>0&&this.columnAutosizeService.autoSizeCols({colKeys:i,skipHeader:t,stopAtGroup:this.columnGroup,source:"uiColumnResized"}),this.resizeLeafColumnsToFit("uiColumnResized")})}}onResizeStart(e){const t=this.getInitialValues(e);this.storeLocalValues(t),this.toggleColumnResizing(!0)}onResizing(e,t,i="uiColumnResized"){const s=this.normaliseDragChange(t),o=this.resizeStartWidth+s;this.resizeColumnsFromLocalValues(o,i,e)}getInitialValues(e){const t=this.getColumnsToResize(),i=this.getInitialSizeOfColumns(t),s=this.getSizeRatiosOfColumns(t,i),o={columnsToResize:t,resizeStartWidth:i,resizeRatios:s};let r=null;if(e&&(r=this.visibleColsService.getGroupAtDirection(this.columnGroup,"After")),r){const n=r.getDisplayedLeafColumns(),l=o.groupAfterColumns=n.filter(d=>d.isResizable()),a=o.groupAfterStartWidth=this.getInitialSizeOfColumns(l);o.groupAfterRatios=this.getSizeRatiosOfColumns(l,a)}else o.groupAfterColumns=void 0,o.groupAfterStartWidth=void 0,o.groupAfterRatios=void 0;return o}storeLocalValues(e){const{columnsToResize:t,resizeStartWidth:i,resizeRatios:s,groupAfterColumns:o,groupAfterStartWidth:r,groupAfterRatios:n}=e;this.resizeCols=t,this.resizeStartWidth=i,this.resizeRatios=s,this.resizeTakeFromCols=o,this.resizeTakeFromStartWidth=r,this.resizeTakeFromRatios=n}clearLocalValues(){this.resizeCols=void 0,this.resizeRatios=void 0,this.resizeTakeFromCols=void 0,this.resizeTakeFromRatios=void 0}resizeLeafColumnsToFit(e){const t=this.autoWidthCalculator.getPreferredWidthForColumnGroup(this.columnGroup),i=this.getInitialValues();t>i.resizeStartWidth&&this.resizeColumns(i,t,e,!0)}resizeColumnsFromLocalValues(e,t,i=!0){if(!this.resizeCols||!this.resizeRatios)return;const s={columnsToResize:this.resizeCols,resizeStartWidth:this.resizeStartWidth,resizeRatios:this.resizeRatios,groupAfterColumns:this.resizeTakeFromCols??void 0,groupAfterStartWidth:this.resizeTakeFromStartWidth??void 0,groupAfterRatios:this.resizeTakeFromRatios??void 0};this.resizeColumns(s,e,t,i)}resizeColumns(e,t,i,s=!0){const{columnsToResize:o,resizeStartWidth:r,resizeRatios:n,groupAfterColumns:l,groupAfterStartWidth:a,groupAfterRatios:d}=e,h=[];if(h.push({columns:o,ratios:n,width:t}),l){const c=t-r;h.push({columns:l,ratios:d,width:a-c})}this.columnSizeService.resizeColumnSets({resizeSets:h,finished:s,source:i}),s&&this.toggleColumnResizing(!1)}toggleColumnResizing(e){this.comp.addOrRemoveCssClass("ag-column-resizing",e)}getColumnsToResize(){return this.columnGroup.getDisplayedLeafColumns().filter(t=>t.isResizable())}getInitialSizeOfColumns(e){return e.reduce((t,i)=>t+i.getActualWidth(),0)}getSizeRatiosOfColumns(e,t){return e.map(i=>i.getActualWidth()/t)}normaliseDragChange(e){let t=e;return this.gos.get("enableRtl")?this.pinned!=="left"&&(t*=-1):this.pinned==="right"&&(t*=-1),t}destroy(){super.destroy(),this.clearLocalValues()}},yh=class extends v{constructor(e,t){super(),this.removeChildListenersFuncs=[],this.columnGroup=t,this.comp=e}postConstruct(){this.addListenersToChildrenColumns(),this.addManagedListeners(this.columnGroup,{displayedChildrenChanged:this.onDisplayedChildrenChanged.bind(this)}),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))}addListenersToChildrenColumns(){this.removeListenersOnChildrenColumns();const e=this.onWidthChanged.bind(this);this.columnGroup.getLeafColumns().forEach(t=>{t.addEventListener("widthChanged",e),t.addEventListener("visibleChanged",e),this.removeChildListenersFuncs.push(()=>{t.removeEventListener("widthChanged",e),t.removeEventListener("visibleChanged",e)})})}removeListenersOnChildrenColumns(){this.removeChildListenersFuncs.forEach(e=>e()),this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){const e=this.columnGroup.getActualWidth();this.comp.setWidth(`${e}px`),this.comp.addOrRemoveCssClass("ag-hidden",e===0)}},Rh=class extends Ci{constructor(e,t,i){super(e,t,i),this.onSuppressColMoveChange=()=>{if(!this.isAlive()||this.isSuppressMoving())this.removeDragSource();else if(!this.dragSource){const s=this.getGui();this.setDragSource(s)}},this.column=e}setComp(e,t,i,s,o){this.comp=e,o=kt(this,this.beans.context,o),this.setGui(t,o),this.displayName=this.beans.columnNameService.getDisplayNameForColumnGroup(this.column,"header"),this.addClasses(),this.setupMovingCss(o),this.setupExpandable(o),this.setupTooltip(o),this.setupAutoHeight({wrapperElement:s,compBean:o}),this.setupUserComp(o),this.addHeaderMouseListeners(o),this.addManagedPropertyListener("groupHeaderHeight",this.refreshMaxHeaderHeight.bind(this)),this.refreshMaxHeaderHeight();const r=this.getParentRowCtrl().getPinned(),n=this.column.getProvidedColumnGroup().getLeafColumns();o.createManagedBean(new Is(n,t)),o.createManagedBean(new Ts(this.column,t,this.beans)),o.createManagedBean(new yh(e,this.column)),this.resizeFeature=o.createManagedBean(new Sh(e,i,r,this.column)),o.createManagedBean(new Je(t,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)})),this.addHighlightListeners(o,n),o.addManagedPropertyListener("suppressMovableColumns",this.onSuppressColMoveChange),this.addResizeAndMoveKeyboardListeners(o),o.addDestroyFunc(()=>this.clearComponent())}refreshMaxHeaderHeight(){const{gos:e,comp:t}=this,i=e.get("groupHeaderHeight");i!=null?i===0?t.setHeaderWrapperHidden(!0):t.setHeaderWrapperMaxHeight(i):(t.setHeaderWrapperHidden(!1),t.setHeaderWrapperMaxHeight(null))}addHighlightListeners(e,t){if(this.beans.gos.get("suppressMoveWhenColumnDragging"))for(const i of t)e.addManagedListeners(i,{headerHighlightChanged:this.onLeafColumnHighlightChanged.bind(this,i)})}onLeafColumnHighlightChanged(e){const t=this.column.getDisplayedLeafColumns(),i=t[0]===e,s=I(t)===e;if(!i&&!s)return;const o=e.getHighlighted(),r=!!this.getParentRowCtrl().findHeaderCellCtrl(a=>a.getColumnGroupChild().isMoving());let n=!1,l=!1;if(r){const a=this.beans.gos.get("enableRtl"),d=o===1,h=o===0;i&&(a?l=d:n=h),s&&(a?n=h:l=d)}this.comp.addOrRemoveCssClass("ag-header-highlight-before",n),this.comp.addOrRemoveCssClass("ag-header-highlight-after",l)}getColumn(){return this.column}resizeHeader(e,t){if(!this.resizeFeature)return;const i=this.resizeFeature.getInitialValues(t);this.resizeFeature.resizeColumns(i,i.resizeStartWidth+e,"uiColumnResized",!0)}moveHeader(e){const{beans:t,eGui:i,column:s,ctrlsService:o}=this,{gos:r,columnModel:n,columnMoveService:l,visibleColsService:a}=t,d=r.get("enableRtl"),h=e===0,c=this.getPinned(),u=i.getBoundingClientRect(),g=u.left,p=u.width,C=hi({x:h!==d?g-20:g+p+20,pinned:c,fromKeyboard:!0,gos:r,ctrlsService:o}),f=s.getGroupId(),w=this.focusService.getFocusedHeader();Hs({allMovingColumns:this.column.getLeafColumns(),isFromHeader:!0,fromLeft:e===1,xPosition:C,pinned:c,fromEnter:!1,fakeEvent:!1,gos:r,columnModel:n,columnMoveService:l,visibleColsService:a,finished:!0});const y=s.getDisplayedLeafColumns(),R=h?y[0]:I(y);this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(R,"auto"),(!this.isAlive()||this.beans.gos.get("ensureDomOrder"))&&w&&this.restoreFocus(f,s,w)}restoreFocus(e,t,i){const s=t.getLeafColumns();if(!s.length)return;const o=s[0].getParent();if(!o)return;const r=this.findGroupWidthId(o,e);r&&this.focusService.focusHeaderPosition({headerPosition:{...i,column:r}})}findGroupWidthId(e,t){for(;e;){if(e.getGroupId()===t)return e;e=e.getParent()}return null}resizeLeafColumnsToFit(e){this.resizeFeature&&this.resizeFeature.resizeLeafColumnsToFit(e)}setupUserComp(e){const t=this.gos.addGridCommonParams({displayName:this.displayName,columnGroup:this.column,setExpanded:s=>{this.beans.columnModel.setColumnGroupOpened(this.column.getProvidedColumnGroup(),s,"gridInitializing")},setTooltip:(s,o)=>{this.setupTooltip(e,s,o)}}),i=this.userComponentFactory.getHeaderGroupCompDetails(t);this.comp.setUserCompDetails(i)}addHeaderMouseListeners(e){const t=o=>this.handleMouseOverChange(o.type==="mouseenter"),i=()=>this.dispatchColumnMouseEvent("columnHeaderClicked",this.column.getProvidedColumnGroup()),s=o=>this.handleContextMenuMouseEvent(o,void 0,this.column.getProvidedColumnGroup());e.addManagedListeners(this.getGui(),{mouseenter:t,mouseleave:t,click:i,contextmenu:s})}handleMouseOverChange(e){this.eventService.dispatchEvent({type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column.getProvidedColumnGroup()})}setupTooltip(e,t,i){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const s=this.column.getColGroupDef(),o=this.gos.get("tooltipShowMode")==="whenTruncated",r=this.eGui;!i&&o&&!(s!=null&&s.headerGroupComponent)&&(i=()=>{const l=r.querySelector(".ag-header-group-text");return l?l.scrollWidth>l.clientWidth:!0});const n={getColumn:()=>this.column,getGui:()=>r,getLocation:()=>"headerGroup",getTooltipValue:()=>t??(s&&s.headerTooltip),shouldDisplayTooltip:i};s&&(n.getColDef=()=>s),e.createManagedBean(new gt(n))}setupExpandable(e){const t=this.column.getProvidedColumnGroup();this.refreshExpanded();const i=this.refreshExpanded.bind(this);e.addManagedListeners(t,{expandedChanged:i,expandableChanged:i})}refreshExpanded(){const{column:e}=this;this.expandable=e.isExpandable();const t=e.isExpanded();this.expandable?this.comp.setAriaExpanded(t?"true":"false"):this.comp.setAriaExpanded(void 0)}getColId(){return this.column.getUniqueId()}addClasses(){const e=this.column.getColGroupDef(),t=Vr(e,this.gos,null,this.column);this.column.isPadding()?(t.push("ag-header-group-cell-no-group"),this.column.getLeafColumns().every(s=>s.isSpanHeaderHeight())&&t.push("ag-header-span-height")):(t.push("ag-header-group-cell-with-group"),e!=null&&e.wrapHeaderText&&t.push("ag-header-cell-wrap-text")),t.forEach(i=>this.comp.addOrRemoveCssClass(i,!0))}setupMovingCss(e){const i=this.column.getProvidedColumnGroup().getLeafColumns(),s=()=>this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving());i.forEach(o=>{e.addManagedListeners(o,{movingChanged:s})}),s()}onFocusIn(e){if(!this.eGui.contains(e.relatedTarget)){const t=this.getRowIndex();this.beans.focusService.setFocusedHeader(t,this.column)}}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();if(!(!this.expandable||!t)&&e.key===m.ENTER){const i=this.column,s=!i.isExpanded();this.beans.columnModel.setColumnGroupOpened(i.getProvidedColumnGroup(),s,"uiColumnExpanded")}}setDragSource(e){if(!this.isAlive()||this.isSuppressMoving()||(this.removeDragSource(),!e))return;const{beans:t,column:i,displayName:s,gos:o,dragAndDropService:r}=this,{columnModel:n}=t,l=i.getProvidedColumnGroup().getLeafColumns();let a=!o.get("suppressDragLeaveHidesColumns");const d=this.dragSource={type:1,eElement:e,getDefaultIconName:()=>a?"hide":"notAllowed",dragItemName:s,getDragItem:()=>this.getDragItemForGroup(i),onDragStarted:()=>{a=!o.get("suppressDragLeaveHidesColumns"),nt(l,!0)},onDragStopped:()=>nt(l,!1),onDragCancelled:()=>nt(l,!1),onGridEnter:h=>{if(a){const{columns:c=[],visibleState:u}=h??{},g=c.filter(p=>!p.getColDef().lockVisible&&(!u||u[p.getColId()]));n.setColsVisible(g,!0,"uiColumnMoved")}},onGridExit:h=>{var c;if(a){const u=((c=h==null?void 0:h.columns)==null?void 0:c.filter(g=>!g.getColDef().lockVisible))||[];n.setColsVisible(u,!1,"uiColumnMoved")}}};r.addDragSource(d,!0)}getDragItemForGroup(e){const t=e.getProvidedColumnGroup().getLeafColumns(),i={};t.forEach(n=>i[n.getId()]=n.isVisible());const s=[];this.beans.visibleColsService.getAllCols().forEach(n=>{t.indexOf(n)>=0&&(s.push(n),Q(t,n))}),t.forEach(n=>s.push(n));const o=[],r=e.getLeafColumns();for(const n of s)r.indexOf(n)!==-1&&o.push(n);return{columns:s,columnsInSplit:o,visibleState:i}}isSuppressMoving(){let e=!1;return this.column.getLeafColumns().forEach(i=>{(i.getColDef().suppressMovable||i.getColDef().lockPosition)&&(e=!0)}),e||this.gos.get("suppressMovableColumns")}destroy(){super.destroy()}},Fh=0,Ti=class extends v{constructor(e,t,i){super(),this.instanceId=Fh++,this.rowIndex=e,this.pinned=t,this.type=i;const s=i=="group"?"ag-header-row-column-group":i=="filter"?"ag-header-row-column-filter":"ag-header-row-column";this.headerRowClass=`ag-header-row ${s}`}wireBeans(e){this.beans=e}postConstruct(){this.isPrintLayout=z(this.gos,"print"),this.isEnsureDomOrder=this.gos.get("ensureDomOrder")}areCellsRendered(){return this.comp?this.getHeaderCellCtrls().every(e=>e.getGui()!=null):!1}setComp(e,t,i=!0){this.comp=e,t=kt(this,this.beans.context,t),i&&(this.onRowHeightChanged(),this.onVirtualColumnsChanged()),this.setWidth(),this.addEventListeners(t)}getHeaderRowClass(){return this.headerRowClass}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(e){const t=this.onRowHeightChanged.bind(this);e.addManagedEventListeners({columnResized:this.onColumnResized.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),virtualColumnsChanged:i=>this.onVirtualColumnsChanged(i.afterScroll),columnGroupHeaderHeightChanged:t,columnHeaderHeightChanged:t,gridStylesChanged:t,advancedFilterEnabledChanged:t}),e.addManagedPropertyListener("domLayout",this.onDisplayedColumnsChanged.bind(this)),e.addManagedPropertyListener("ensureDomOrder",i=>this.isEnsureDomOrder=i.currentValue),e.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],t)}getHeaderCellCtrl(e){if(this.headerCellCtrls)return jt(this.headerCellCtrls).find(t=>t.getColumnGroupChild()===e)}onDisplayedColumnsChanged(){this.isPrintLayout=z(this.gos,"print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}getType(){return this.type}onColumnResized(){this.setWidth()}setWidth(){const e=this.getWidthForRow();this.comp.setWidth(`${e}px`)}getWidthForRow(){const{visibleColsService: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{columnModel:e,filterManager:t}=this.beans,i=[],s=e.getGroupRowsHeight(),o=e.getColumnHeaderRowHeight();i.push(...s),i.push(o),t!=null&&t.hasFloatingFilters()&&i.push(e.getFloatingFiltersHeight());let r=0;for(let l=0;l<this.rowIndex;l++)r+=i[l];const n=i[this.rowIndex];return{topOffset:r,rowHeight:n}}getPinned(){return this.pinned}getRowIndex(){return this.rowIndex}onVirtualColumnsChanged(e=!1){const t=this.getHeaderCtrls(),i=this.isEnsureDomOrder||this.isPrintLayout;this.comp.setHeaderCtrls(t,i,e)}getHeaderCtrls(){const e=this.headerCellCtrls;this.headerCellCtrls=new Map;const t=this.getColumnsInViewport();for(const s of t)this.recycleAndCreateHeaderCtrls(s,e);const i=s=>{const{focusService:o,visibleColsService:r}=this.beans;return o.isHeaderWrapperFocused(s)?r.isVisible(s.getColumnGroupChild()):!1};if(e)for(const[s,o]of e)i(o)?this.headerCellCtrls.set(s,o):this.destroyBean(o);return this.getHeaderCellCtrls()}getHeaderCellCtrls(){var e;return Array.from(((e=this.headerCellCtrls)==null?void 0:e.values())??[])}recycleAndCreateHeaderCtrls(e,t){if(!this.headerCellCtrls||e.isEmptyGroup())return;const i=e.getUniqueId();let s;if(t&&(s=t.get(i),t.delete(i)),s&&s.getColumnGroupChild()!=e&&(this.destroyBean(s),s=void 0),s==null)switch(this.type){case"filter":{s=this.createBean(this.beans.ctrlsFactory.getInstance("headerFilterCell",e,this.beans,this));break}case"group":s=this.createBean(new Rh(e,this.beans,this));break;default:s=this.createBean(new wh(e,this.beans,this));break}this.headerCellCtrls.set(i,s)}getColumnsInViewport(){return this.isPrintLayout?this.getColumnsInViewportPrintLayout():this.getColumnsInViewportNormalLayout()}getColumnsInViewportPrintLayout(){if(this.pinned!=null)return[];let e=[];const t=this.getActualDepth(),{columnViewportService:i}=this.beans;return["left",null,"right"].forEach(s=>{const o=i.getHeadersToRender(s,t);e=e.concat(o)}),e}getActualDepth(){return this.type=="filter"?this.rowIndex-1:this.rowIndex}getColumnsInViewportNormalLayout(){return this.beans.columnViewportService.getHeadersToRender(this.pinned,this.getActualDepth())}findHeaderCellCtrl(e){if(!this.headerCellCtrls)return;const t=this.getHeaderCellCtrls();let i;return typeof e=="function"?i=t.find(e):i=t.find(s=>s.getColumnGroupChild()==e),i}focusHeader(e,t){const i=this.findHeaderCellCtrl(e);return i?i.focus(t):!1}destroy(){var e;(e=this.headerCellCtrls)==null||e.forEach(t=>{this.destroyBean(t)}),this.headerCellCtrls=void 0,super.destroy()}},bh=class extends v{constructor(e){super(),this.hidden=!1,this.includeFloatingFilter=!1,this.groupsRowCtrls=[],this.pinned=e}wireBeans(e){this.ctrlsService=e.ctrlsService,this.scrollVisibleService=e.scrollVisibleService,this.pinnedWidthService=e.pinnedWidthService,this.columnModel=e.columnModel,this.focusService=e.focusService,this.filterManager=e.filterManager}setComp(e,t){this.comp=e,this.eViewport=t,this.setupCenterWidth(),this.setupPinnedWidth(),this.setupDragAndDrop(this.eViewport);const i=this.onDisplayedColumnsChanged.bind(this);this.addManagedEventListeners({gridColumnsChanged:this.onGridColumnsChanged.bind(this),displayedColumnsChanged:i,advancedFilterEnabledChanged:i});const s=`${typeof this.pinned=="string"?this.pinned:"center"}Header`;this.ctrlsService.register(s,this),this.columnModel.isReady()&&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 t=new ht,i=this.focusService.getFocusHeaderToUseAfterRefresh(),s=()=>{const l=this.columnModel.getHeaderRowCount()-1;this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls);for(let a=0;a<l;a++){const d=this.createBean(new Ti(t.next(),this.pinned,"group"));this.groupsRowCtrls.push(d)}},o=()=>{const l=t.next(),a=!this.hidden&&(this.columnsRowCtrl==null||!e||this.columnsRowCtrl.getRowIndex()!==l);(a||this.hidden)&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),a&&(this.columnsRowCtrl=this.createBean(new Ti(l,this.pinned,"column")))},r=()=>{var d;this.includeFloatingFilter=!!((d=this.filterManager)!=null&&d.hasFloatingFilters())&&!this.hidden;const l=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter){l();return}const a=t.next();if(this.filtersRowCtrl){const h=this.filtersRowCtrl.getRowIndex()!==a;(!e||h)&&l()}this.filtersRowCtrl||(this.filtersRowCtrl=this.createBean(new Ti(a,this.pinned,"filter")))};s(),o(),r();const n=this.getAllCtrls();this.comp.setCtrls(n),this.restoreFocusOnHeader(i)}getHeaderCtrlForColumn(e){var t;if(Ge(e))return(t=this.columnsRowCtrl)==null?void 0:t.getHeaderCellCtrl(e);if(this.groupsRowCtrls.length!==0)for(let i=0;i<this.groupsRowCtrls.length;i++){const s=this.groupsRowCtrls[i].getHeaderCellCtrl(e);if(s)return s}}getHtmlElementForColumnHeader(e){const t=this.getHeaderCtrlForColumn(e);return t?t.getGui():null}getRowType(e){const i=this.getAllCtrls()[e];return i?i.getType():void 0}focusHeader(e,t,i){const o=this.getAllCtrls()[e];return o?o.focusHeader(t,i):!1}getViewportElement(){return this.eViewport}getGroupRowCount(){return this.groupsRowCtrls.length}getGroupRowCtrlAtIndex(e){return this.groupsRowCtrls[e]}getRowCount(){return this.groupsRowCtrls.length+(this.columnsRowCtrl?1:0)+(this.filtersRowCtrl?1:0)}setHorizontalScroll(e){this.comp.setViewportScrollLeft(e)}onScrollCallback(e){this.addManagedElementListeners(this.getViewportElement(),{scroll:e})}destroy(){this.filtersRowCtrl&&(this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)),this.columnsRowCtrl&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),this.groupsRowCtrls&&this.groupsRowCtrls.length&&(this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls)),super.destroy()}setupDragAndDrop(e){const t=new Ch(this.pinned,e);this.createManagedBean(t)}restoreFocusOnHeader(e){if(!e)return;const{column:t}=e;t.getPinned()==this.pinned&&this.focusService.focusHeaderPosition({headerPosition:e})}onGridColumnsChanged(){this.refresh(!0)}onDisplayedColumnsChanged(){var t;const e=((t=this.filterManager)==null?void 0:t.hasFloatingFilters())&&!this.hidden;this.includeFloatingFilter!==e&&this.refresh(!0)}setupCenterWidth(){this.pinned==null&&this.createManagedBean(new ks(e=>this.comp.setCenterWidth(`${e}px`),!0))}setupPinnedWidth(){if(this.pinned==null)return;const e=this.pinned==="left",t=this.pinned==="right";this.hidden=!0;const i=()=>{const s=e?this.pinnedWidthService.getPinnedLeftWidth():this.pinnedWidthService.getPinnedRightWidth();if(s==null)return;const o=s==0,r=this.hidden!==o,n=this.gos.get("enableRtl"),l=this.scrollVisibleService.getScrollbarWidth(),d=this.scrollVisibleService.isVerticalScrollShowing()&&(n&&e||!n&&t)?s+l:s;this.comp.setPinnedContainerWidth(`${d}px`),this.comp.setDisplayed(!o),r&&(this.hidden=o,this.refresh())};this.addManagedEventListeners({leftPinnedWidthChanged:i,rightPinnedWidthChanged:i,scrollVisibilityChanged:i,scrollbarWidthChanged:i})}},Ph='<div class="ag-pinned-left-header" role="rowgroup"></div>',Dh='<div class="ag-pinned-right-header" role="rowgroup"></div>',Eh=`<div class="ag-header-viewport" role="presentation"> <div class="ag-header-container" data-ref="eCenterContainer" role="rowgroup"></div> </div>`,Ii=class extends G{constructor(e){super(),this.eCenterContainer=b,this.headerRowComps={},this.rowCompsList=[],this.pinned=e}postConstruct(){this.selectAndSetTemplate();const e={setDisplayed:i=>this.setDisplayed(i),setCtrls:i=>this.setCtrls(i),setCenterWidth:i=>this.eCenterContainer.style.width=i,setViewportScrollLeft:i=>this.getGui().scrollLeft=i,setPinnedContainerWidth:i=>{const s=this.getGui();s.style.width=i,s.style.maxWidth=i,s.style.minWidth=i}};this.createManagedBean(new bh(this.pinned)).setComp(e,this.getGui())}selectAndSetTemplate(){const e=this.pinned=="left",t=this.pinned=="right",i=e?Ph:t?Dh:Eh;this.setTemplate(i),this.eRowContainer=this.eCenterContainer!==b?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 i;const s=o=>{const r=o.getGui();r.parentElement!=this.eRowContainer&&this.eRowContainer.appendChild(r),i&&nr(this.eRowContainer,r,i),i=r};e.forEach(o=>{const r=o.instanceId,n=t[r];delete t[r];const l=n||this.createBean(new rh(o));this.headerRowComps[r]=l,this.rowCompsList.push(l),s(l)}),Oe(t).forEach(o=>this.destroyRowComp(o))}},Mh=class extends G{constructor(){super('<div class="ag-header" role="presentation"/>')}postConstruct(){const e={addOrRemoveCssClass:(s,o)=>this.addOrRemoveCssClass(s,o),setHeightAndMinHeight:s=>{this.getGui().style.height=s,this.getGui().style.minHeight=s}};this.createManagedBean(new lh).setComp(e,this.getGui(),this.getFocusableElement());const i=s=>{this.createManagedBean(s),this.appendChild(s)};i(new Ii("left")),i(new Ii(null)),i(new Ii("right"))}},xh={selector:"AG-HEADER-ROOT",component:Mh},Vs=class extends v{constructor(e){super(),this.view=e}postConstruct(){this.addManagedPropertyListener("domLayout",this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()}updateLayoutClasses(){const e=this.getDomLayout(),t={autoHeight:e==="autoHeight",normal:e==="normal",print:e==="print"},i=t.autoHeight?"ag-layout-auto-height":t.print?"ag-layout-print":"ag-layout-normal";this.view.updateLayoutClasses(i,t)}getDomLayout(){const e=this.gos.get("domLayout")??"normal";return["normal","print","autoHeight"].indexOf(e)===-1?(S(`${e} is not valid for DOM Layout, valid values are 'normal', 'autoHeight', 'print'.`),"normal"):e}},Ah=class extends G{constructor(){super(` <div class="ag-overlay" role="presentation"> <div class="ag-overlay-panel" role="presentation"> <div class="ag-overlay-wrapper" data-ref="eOverlayWrapper" role="presentation"></div> </div> </div>`),this.eOverlayWrapper=b,this.activePromise=null,this.activeOverlay=null,this.updateListenerDestroyFunc=null,this.activeOverlayWrapperCssClass=null,this.elToFocusAfter=null}wireBeans(e){this.overlayService=e.overlayService,this.focusService=e.focusService,this.visibleColsService=e.visibleColsService}handleKeyDown(e){if(e.key!==m.TAB||e.defaultPrevented||Fe(e)||this.focusService.findNextFocusableElement(this.eOverlayWrapper,!1,e.shiftKey))return;let i=!1;e.shiftKey?i=this.focusService.focusGridView(I(this.visibleColsService.getAllCols()),!0,!1):i=this.focusService.focusNextGridCoreContainer(!1),i&&e.preventDefault()}updateLayoutClasses(e,t){const i=this.eOverlayWrapper.classList;i.toggle("ag-layout-auto-height",t.autoHeight),i.toggle("ag-layout-normal",t.normal),i.toggle("ag-layout-print",t.print)}postConstruct(){this.createManagedBean(new Vs(this)),this.setDisplayed(!1,{skipAriaHidden:!0}),this.overlayService.setOverlayWrapperComp(this),this.addManagedElementListeners(this.getFocusableElement(),{keydown:this.handleKeyDown.bind(this)})}setWrapperTypeClass(e){const t=this.eOverlayWrapper.classList;this.activeOverlayWrapperCssClass&&t.toggle(this.activeOverlayWrapperCssClass,!1),this.activeOverlayWrapperCssClass=e,t.toggle(e,!0)}showOverlay(e,t,i,s){if(this.setWrapperTypeClass(t),this.destroyActiveOverlay(),this.elToFocusAfter=null,this.activePromise=e,!!e){if(this.setDisplayed(!0,{skipAriaHidden:!0}),i&&this.focusService.isGridFocused()){const o=V(this.gos);o&&!Ao(this.gos)&&(this.elToFocusAfter=o)}e.then(o=>{if(this.activePromise!==e){this.activeOverlay!==o&&(this.destroyBean(o),o=null);return}if(this.activePromise=null,!o)return;if(this.activeOverlay!==o&&(this.eOverlayWrapper.appendChild(o.getGui()),this.activeOverlay=o,s)){const n=o;this.updateListenerDestroyFunc=this.addManagedPropertyListener(s,({currentValue:l})=>{var a;(a=n.refresh)==null||a.call(n,this.gos.addGridCommonParams({...l??{}}))})}const r=this.focusService;i&&r.isGridFocused()&&r.focusInto(this.eOverlayWrapper)})}}updateOverlayWrapperPaddingTop(e){this.eOverlayWrapper.style.setProperty("padding-top",`${e}px`)}destroyActiveOverlay(){var s;this.activePromise=null;const e=this.activeOverlay;if(!e)return;let t=this.elToFocusAfter;this.activeOverlay=null,this.elToFocusAfter=null,t&&!this.focusService.isGridFocused()&&(t=null);const i=this.updateListenerDestroyFunc;i&&(i(),this.updateListenerDestroyFunc=null),this.destroyBean(e),U(this.eOverlayWrapper),(s=t==null?void 0:t.focus)==null||s.call(t,{preventScroll:!0})}hideOverlay(){this.destroyActiveOverlay(),this.setDisplayed(!1,{skipAriaHidden:!0})}destroy(){this.elToFocusAfter=null,this.destroyActiveOverlay(),this.overlayService.setOverlayWrapperComp(void 0),super.destroy()}},Th={selector:"AG-OVERLAY-WRAPPER",component:Ah},qr=class extends G{constructor(e,t){super(),this.direction=t,this.eViewport=b,this.eContainer=b,this.hideTimeout=null,this.setTemplate(e)}wireBeans(e){this.animationFrameService=e.animationFrameService}postConstruct(){this.addManagedEventListeners({scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this)}),this.onScrollVisibilityChanged(),this.addOrRemoveCssClass("ag-apple-scrollbar",Zo()||He())}initialiseInvisibleScrollbar(){this.invisibleScrollbar===void 0&&(this.invisibleScrollbar=tr(),this.invisibleScrollbar&&(this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles()))}addActiveListenerToggles(){const e=this.getGui(),t=()=>this.addOrRemoveCssClass("ag-scrollbar-active",!0),i=()=>this.addOrRemoveCssClass("ag-scrollbar-active",!1);this.addManagedListeners(e,{mouseenter:t,mousedown:t,touchstart:t,mouseleave:i,touchend:i})}onScrollVisibilityChanged(){this.invisibleScrollbar===void 0&&this.initialiseInvisibleScrollbar(),this.animationFrameService.requestAnimationFrame(()=>this.setScrollVisible())}hideAndShowInvisibleScrollAsNeeded(){this.addManagedEventListeners({bodyScroll:e=>{e.direction===this.direction&&(this.hideTimeout!==null&&(window.clearTimeout(this.hideTimeout),this.hideTimeout=null),this.addOrRemoveCssClass("ag-scrollbar-scrolling",!0))},bodyScrollEnd:()=>{this.hideTimeout=window.setTimeout(()=>{this.addOrRemoveCssClass("ag-scrollbar-scrolling",!1),this.hideTimeout=null},400)}})}attemptSettingScrollPosition(e){const t=this.getViewportElement();Gn(()=>ue(t),()=>this.setScrollPosition(e),100)}getViewportElement(){return this.eViewport}getContainer(){return this.eContainer}onScrollCallback(e){this.addManagedElementListeners(this.getViewportElement(),{scroll:e})}},Ih=class extends qr{constructor(){super(`<div class="ag-body-horizontal-scroll" aria-hidden="true"> <div class="ag-horizontal-left-spacer" data-ref="eLeftSpacer"></div> <div class="ag-body-horizontal-scroll-viewport" data-ref="eViewport"> <div class="ag-body-horizontal-scroll-container" data-ref="eContainer"></div> </div> <div class="ag-horizontal-right-spacer" data-ref="eRightSpacer"></div> </div>`,"horizontal"),this.eLeftSpacer=b,this.eRightSpacer=b}wireBeans(e){super.wireBeans(e),this.visibleColsService=e.visibleColsService,this.pinnedRowModel=e.pinnedRowModel,this.ctrlsService=e.ctrlsService,this.scrollVisibleService=e.scrollVisibleService}postConstruct(){super.postConstruct();const e=this.setFakeHScrollSpacerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e,displayedColumnsWidthChanged:e,pinnedRowDataChanged:this.onPinnedRowDataChanged.bind(this)}),this.addManagedPropertyListener("domLayout",e),this.ctrlsService.register("fakeHScrollComp",this),this.createManagedBean(new ks(t=>this.eContainer.style.width=`${t}px`)),this.addManagedPropertyListeners(["suppressHorizontalScroll"],this.onScrollVisibilityChanged.bind(this))}initialiseInvisibleScrollbar(){this.invisibleScrollbar===void 0&&(this.enableRtl=this.gos.get("enableRtl"),super.initialiseInvisibleScrollbar(),this.invisibleScrollbar&&this.refreshCompBottom())}onPinnedRowDataChanged(){this.refreshCompBottom()}refreshCompBottom(){if(!this.invisibleScrollbar)return;const e=this.pinnedRowModel.getPinnedBottomTotalHeight();this.getGui().style.bottom=`${e}px`}onScrollVisibilityChanged(){super.onScrollVisibilityChanged(),this.setFakeHScrollSpacerWidths()}setFakeHScrollSpacerWidths(){const e=this.scrollVisibleService.isVerticalScrollShowing();let t=this.visibleColsService.getDisplayedColumnsRightWidth();const i=!this.enableRtl&&e,s=this.scrollVisibleService.getScrollbarWidth();i&&(t+=s),ce(this.eRightSpacer,t),this.eRightSpacer.classList.toggle("ag-scroller-corner",t<=s);let o=this.visibleColsService.getColsLeftWidth();this.enableRtl&&e&&(o+=s),ce(this.eLeftSpacer,o),this.eLeftSpacer.classList.toggle("ag-scroller-corner",o<=s)}setScrollVisible(){const e=this.scrollVisibleService.isHorizontalScrollShowing(),t=this.invisibleScrollbar,i=this.gos.get("suppressHorizontalScroll"),s=e&&this.scrollVisibleService.getScrollbarWidth()||0,r=i?0:s===0&&t?16:s;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),Ft(this.getGui(),r),Ft(this.eViewport,r),Ft(this.eContainer,r),this.setDisplayed(e,{skipAriaHidden:!0})}getScrollPosition(){return ni(this.getViewportElement(),this.enableRtl)}setScrollPosition(e){ue(this.getViewportElement())||this.attemptSettingScrollPosition(e),li(this.getViewportElement(),e,this.enableRtl)}},Lh={selector:"AG-FAKE-HORIZONTAL-SCROLL",component:Ih},Yr=class extends v{wireBeans(e){this.maxDivHeightScaler=e.rowContainerHeightService}constructor(e,t){super(),this.eContainer=e,this.eViewport=t}postConstruct(){this.addManagedEventListeners({rowContainerHeightChanged:this.onHeightChanged.bind(this)})}onHeightChanged(){const e=this.maxDivHeightScaler.getUiContainerHeight(),t=e!=null?`${e}px`:"";this.eContainer.style.height=t,this.eViewport&&(this.eViewport.style.height=t)}},Oh=class extends qr{wireBeans(e){super.wireBeans(e),this.ctrlsService=e.ctrlsService,this.scrollVisibleService=e.scrollVisibleService}constructor(){super(`<div class="ag-body-vertical-scroll" aria-hidden="true"> <div class="ag-body-vertical-scroll-viewport" data-ref="eViewport"> <div class="ag-body-vertical-scroll-container" data-ref="eContainer"></div> </div> </div>`,"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new Yr(this.eContainer)),this.ctrlsService.register("fakeVScrollComp",this),this.addManagedEventListeners({rowContainerHeightChanged:this.onRowContainerHeightChanged.bind(this)})}setScrollVisible(){const e=this.scrollVisibleService.isVerticalScrollShowing(),t=this.invisibleScrollbar,i=e&&this.scrollVisibleService.getScrollbarWidth()||0,s=i===0&&t?16:i;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),ce(this.getGui(),s),ce(this.eViewport,s),ce(this.eContainer,s),this.setDisplayed(e,{skipAriaHidden:!0})}onRowContainerHeightChanged(){const{ctrlsService:e}=this,i=e.getGridBodyCtrl().getBodyViewportElement(),s=this.getScrollPosition(),o=i.scrollTop;s!=o&&this.setScrollPosition(o,!0)}getScrollPosition(){return this.getViewportElement().scrollTop}setScrollPosition(e,t){!t&&!ue(this.getViewportElement())&&this.attemptSettingScrollPosition(e),this.getViewportElement().scrollTop=e}},Gh={selector:"AG-FAKE-VERTICAL-SCROLL",component:Oh},is=(e=>(e.FakeHScrollbar="fakeHScrollComp",e.Header="centerHeader",e.PinnedTop="topCenter",e.PinnedBottom="bottomCenter",e.StickyTop="stickyTopCenter",e.StickyBottom="stickyBottomCenter",e))(is||{}),kh=class extends v{constructor(e){super(),this.lastScrollSource=[null,null],this.scrollLeft=-1,this.nextScrollTop=-1,this.scrollTop=-1,this.lastOffsetHeight=-1,this.lastScrollTop=-1,this.eBodyViewport=e,this.resetLastHScrollDebounced=Y(()=>this.lastScrollSource[1]=null,500),this.resetLastVScrollDebounced=Y(()=>this.lastScrollSource[0]=null,500)}wireBeans(e){this.ctrlsService=e.ctrlsService,this.animationFrameService=e.animationFrameService,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService,this.rowModel=e.rowModel,this.heightScaler=e.rowContainerHeightService,this.rowRenderer=e.rowRenderer,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.addManagedEventListeners({displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this)}),this.ctrlsService.whenReady(this,e=>{this.centerRowsCtrl=e.center,this.onDisplayedColumnsWidthChanged(),this.addScrollListener()})}addScrollListener(){this.addHorizontalScrollListeners(),this.addVerticalScrollListeners()}addHorizontalScrollListeners(){this.addManagedElementListeners(this.centerRowsCtrl.getViewportElement(),{scroll:this.onHScroll.bind(this,"Viewport")});for(const e of Object.values(is)){const t=this.ctrlsService.get(e);this.registerScrollPartner(t,this.onHScroll.bind(this,e))}}addVerticalScrollListeners(){const e=this.ctrlsService.get("fakeVScrollComp"),t=this.gos.get("debounceVerticalScrollbar"),i=t?Y(this.onVScroll.bind(this,"Viewport"),100):this.onVScroll.bind(this,"Viewport"),s=t?Y(this.onVScroll.bind(this,"fakeVScrollComp"),100):this.onVScroll.bind(this,"fakeVScrollComp");this.addManagedElementListeners(this.eBodyViewport,{scroll:i}),this.registerScrollPartner(e,s)}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[...Object.values(is),"Viewport"]){if(this.lastScrollSource[1]===t)continue;const i=this.getViewportForSource(t);li(i,e,this.enableRtl)}}getViewportForSource(e){return e==="Viewport"?this.centerRowsCtrl.getViewportElement():this.ctrlsService.get(e).getViewportElement()}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.getViewportElement(),{scrollLeft:i}=t;if(this.shouldBlockScrollUpdate(1,i,!0))return;const s=ni(this.getViewportForSource(e),this.enableRtl);this.doHorizontalScroll(s),this.resetLastHScrollDebounced()}onVScroll(e){if(!this.isControllingScroll(e,0))return;let t;e==="Viewport"?t=this.eBodyViewport.scrollTop:t=this.ctrlsService.get("fakeVScrollComp").getScrollPosition(),!this.shouldBlockScrollUpdate(0,t,!0)&&(this.animationFrameService.setScrollTop(t),this.nextScrollTop=t,e==="Viewport"?this.ctrlsService.get("fakeVScrollComp").setScrollPosition(t):this.eBodyViewport.scrollTop=t,this.gos.get("suppressAnimationFrame")?this.scrollGridIfNeeded():this.animationFrameService.schedule(),this.resetLastVScrollDebounced())}doHorizontalScroll(e){const t=this.ctrlsService.get("fakeHScrollComp").getScrollPosition();this.scrollLeft===e&&e===t||(this.scrollLeft=e,this.fireScrollEvent(1),this.horizontallyScrollHeaderCenterAndFloatingCenter(e),this.centerRowsCtrl.onHorizontalViewportChanged(!0))}fireScrollEvent(e){const t={type:"bodyScroll",direction:e===1?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.eventService.dispatchEvent(t),window.clearTimeout(this.scrollTimer),this.scrollTimer=void 0,this.scrollTimer=window.setTimeout(()=>{this.eventService.dispatchEvent({...t,type:"bodyScrollEnd"})},100)}shouldBlockScrollUpdate(e,t,i=!1){return i&&!He()?!1:e===0?this.shouldBlockVerticalScroll(t):this.shouldBlockHorizontalScroll(t)}shouldBlockVerticalScroll(e){const t=Ss(this.eBodyViewport),{scrollHeight:i}=this.eBodyViewport;return e<0||e+t>i}shouldBlockHorizontalScroll(e){const t=this.centerRowsCtrl.getCenterWidth(),{scrollWidth:i}=this.centerRowsCtrl.getViewportElement();if(this.enableRtl&&ri()){if(e>0)return!0}else if(e<0)return!0;return Math.abs(e)+t>i}redrawRowsAfterScroll(){this.fireScrollEvent(0)}checkScrollLeft(){this.scrollLeft!==this.centerRowsCtrl.getCenterViewportScrollLeft()&&this.onHScroll("Viewport")}scrollGridIfNeeded(){const e=this.scrollTop!=this.nextScrollTop;return e&&(this.scrollTop=this.nextScrollTop,this.redrawRowsAfterScroll()),e}setHorizontalScrollPosition(e,t=!1){const s=this.centerRowsCtrl.getViewportElement().scrollWidth-this.centerRowsCtrl.getCenterWidth();!t&&this.shouldBlockScrollUpdate(1,e)&&(this.enableRtl&&ri()?e=e>0?0:s:e=Math.min(Math.max(e,0),s)),li(this.centerRowsCtrl.getViewportElement(),Math.abs(e),this.enableRtl),this.doHorizontalScroll(e)}setVerticalScrollPosition(e){this.eBodyViewport.scrollTop=e}getVScrollPosition(){return this.lastScrollTop=this.eBodyViewport.scrollTop,this.lastOffsetHeight=this.eBodyViewport.offsetHeight,{top:this.lastScrollTop,bottom:this.lastScrollTop+this.lastOffsetHeight}}getApproximateVScollPosition(){return this.lastScrollTop>=0&&this.lastOffsetHeight>=0?{top:this.scrollTop,bottom:this.scrollTop+this.lastOffsetHeight}:this.getVScrollPosition()}getHScrollPosition(){return this.centerRowsCtrl.getHScrollPosition()}isHorizontalScrollShowing(){return this.centerRowsCtrl.isHorizontalScrollShowing()}scrollHorizontally(e){const t=this.centerRowsCtrl.getViewportElement().scrollLeft;return this.setHorizontalScrollPosition(t+e),this.centerRowsCtrl.getViewportElement().scrollLeft-t}scrollToTop(){this.eBodyViewport.scrollTop=0}ensureNodeVisible(e,t=null){const i=this.rowModel.getRowCount();let s=-1;for(let o=0;o<i;o++){const r=this.rowModel.getRow(o);if(typeof e=="function"){if(r&&e(r)){s=o;break}}else if(e===r||e===r.data){s=o;break}}s>=0&&this.ensureIndexVisible(s,t)}ensureIndexVisible(e,t){if(z(this.gos,"print"))return;const i=this.rowModel.getRowCount();if(typeof e!="number"||e<0||e>=i){S("Invalid row index for ensureIndexVisible: "+e);return}const o=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.getFrameworkOverrides().wrapIncoming(()=>{var h;o||(h=this.paginationService)==null||h.goToPageWithIndex(e);const r=this.ctrlsService.getGridBodyCtrl(),n=r.getStickyTopHeight(),l=r.getStickyBottomHeight(),a=this.rowModel.getRow(e);let d;do{const c=a.rowTop,u=a.rowHeight,g=this.pageBoundsService.getPixelOffset(),p=a.rowTop-g,C=p+a.rowHeight,f=this.getVScrollPosition(),w=this.heightScaler.getDivStretchOffset(),y=f.top+w,R=f.bottom+w,P=R-y,M=this.heightScaler.getScrollPositionForPixel(p),D=this.heightScaler.getScrollPositionForPixel(C-P),E=Math.min((M+D)/2,p),T=y+n>p,L=R-l<C;let X=null;t==="top"?X=M:t==="bottom"?X=D:t==="middle"?X=E:T?X=M-n:L&&(X=D+l),X!==null&&(this.setVerticalScrollPosition(X),this.rowRenderer.redraw({afterScroll:!0})),d=c!==a.rowTop||u!==a.rowHeight}while(d);this.animationFrameService.flushAllFrames()})}ensureColumnVisible(e,t="auto"){const i=this.columnModel.getCol(e);if(!i||i.isPinned()||!this.visibleColsService.isColDisplayed(i))return;const s=this.getPositionedHorizontalScroll(i,t);this.getFrameworkOverrides().wrapIncoming(()=>{s!==null&&this.centerRowsCtrl.setCenterViewportScrollLeft(s),this.centerRowsCtrl.onHorizontalViewportChanged(),this.animationFrameService.flushAllFrames()})}setScrollPosition(e,t){this.getFrameworkOverrides().wrapIncoming(()=>{this.centerRowsCtrl.setCenterViewportScrollLeft(t),this.setVerticalScrollPosition(e),this.rowRenderer.redraw({afterScroll:!0}),this.animationFrameService.flushAllFrames()})}getPositionedHorizontalScroll(e,t){const{columnBeforeStart:i,columnAfterEnd:s}=this.isColumnOutsideViewport(e),o=this.centerRowsCtrl.getCenterWidth()<e.getActualWidth(),r=this.centerRowsCtrl.getCenterWidth(),n=this.enableRtl;let l=(n?i:s)||o,a=n?s:i;t!=="auto"&&(l=t==="start",a=t==="end");const d=t==="middle";if(l||a||d){const{colLeft:h,colMiddle:c,colRight:u}=this.getColumnBounds(e);return d?c-r/2:l?n?u:h:n?h-r:u-r}return null}isColumnOutsideViewport(e){const{start:t,end:i}=this.getViewportBounds(),{colLeft:s,colRight:o}=this.getColumnBounds(e),r=this.enableRtl,n=r?t>o:i<o,l=r?i<s:t>s;return{columnBeforeStart:n,columnAfterEnd:l}}getColumnBounds(e){const t=this.enableRtl,i=this.visibleColsService.getBodyContainerWidth(),s=e.getActualWidth(),o=e.getLeft(),r=t?-1:1,n=t?i-o:o,l=n+s*r,a=n+s/2*r;return{colLeft:n,colMiddle:a,colRight:l}}getViewportBounds(){const e=this.centerRowsCtrl.getCenterWidth(),t=this.centerRowsCtrl.getCenterViewportScrollLeft(),i=t,s=e+t;return{start:i,end:s,width:e}}},Hh=class extends v{wireBeans(e){this.animationFrameService=e.animationFrameService,this.ctrlsService=e.ctrlsService,this.pinnedWidthService=e.pinnedWidthService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.columnSizeService=e.columnSizeService,this.scrollVisibleService=e.scrollVisibleService,this.columnViewportService=e.columnViewportService}constructor(e){super(),this.centerContainerCtrl=e}postConstruct(){this.ctrlsService.whenReady(this,e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.listenForResize()}),this.addManagedEventListeners({scrollbarWidthChanged:this.onScrollbarWidthChanged.bind(this)}),this.addManagedPropertyListeners(["alwaysShowHorizontalScroll","alwaysShowVerticalScroll"],()=>{this.checkViewportAndScrolls()})}listenForResize(){const e=()=>{this.animationFrameService.requestAnimationFrame(()=>{this.onCenterViewportResized()})};this.centerContainerCtrl.registerViewportResizeListener(e),this.gridBodyCtrl.registerBodyViewportResizeListener(e)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.scrollVisibleService.onCentreViewportResized(),this.centerContainerCtrl.isViewportInTheDOMTree()){this.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();const e=this.centerContainerCtrl.getCenterWidth();e!==this.centerWidth&&(this.centerWidth=e,this.columnSizeService.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0}))}else this.bodyHeight=0}keepPinnedColumnsNarrowerThanViewport(){const e=this.gridBodyCtrl.getBodyViewportElement(),t=Ht(e);if(t<=50)return;let i=this.getPinnedColumnsOverflowingViewport(t-50);const s=this.gos.getCallback("processUnpinnedColumns");i.length&&(s&&(i=s({columns:i,viewportWidth:t})),this.columnModel.setColsPinned(i,null,"viewportSizeFeature"))}getPinnedColumnsOverflowingViewport(e){const t=this.pinnedWidthService.getPinnedRightWidth(),i=this.pinnedWidthService.getPinnedLeftWidth(),s=t+i;if(s<e)return[];const o=[...this.visibleColsService.getLeftCols()],r=[...this.visibleColsService.getRightCols()];let n=0,l=0;const a=0,d=[];let h=s-a-e;for(;(l<o.length||n<r.length)&&h>0;){if(n<r.length){const c=r[n++];h-=c.getActualWidth(),d.push(c)}if(l<o.length&&h>0){const c=o[l++];h-=c.getActualWidth(),d.push(c)}}return d}checkViewportAndScrolls(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.getScrollFeature().checkScrollLeft()}getBodyHeight(){return this.bodyHeight}checkBodyHeight(){const e=this.gridBodyCtrl.getBodyViewportElement(),t=Ss(e);this.bodyHeight!==t&&(this.bodyHeight=t,this.eventService.dispatchEvent({type:"bodyHeightChanged"}))}updateScrollVisibleService(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)}updateScrollVisibleServiceImpl(){const e={horizontalScrollShowing:this.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleService.setScrollsVisible(e)}isHorizontalScrollShowing(){return this.centerContainerCtrl.isHorizontalScrollShowing()}onHorizontalViewportChanged(){const e=this.centerContainerCtrl.getCenterWidth(),t=this.centerContainerCtrl.getViewportScrollLeft();this.columnViewportService.setScrollPosition(e,t)}},Vh=class extends v{wireBeans(e){this.dragService=e.dragService,this.rangeService=e.rangeService}constructor(e){super(),this.eContainer=e}postConstruct(){if(!this.rangeService)return;this.params={eElement:this.eContainer,onDragStart:this.rangeService.onDragStart.bind(this.rangeService),onDragStop:this.rangeService.onDragStop.bind(this.rangeService),onDragging:this.rangeService.onDragging.bind(this.rangeService)},this.addManagedPropertyListeners(["enableRangeSelection","cellSelection"],()=>{ve(this.gos)?this.enableFeature():this.disableFeature()}),this.addDestroyFunc(()=>this.disableFeature()),ve(this.gos)&&this.enableFeature()}enableFeature(){this.dragService.addDragSource(this.params)}disableFeature(){this.dragService.removeDragSource(this.params)}},Nh=class extends G{constructor(){super(` <div class="ag-selection-checkbox" role="presentation"> <ag-checkbox role="presentation" data-ref="eCheckbox"></ag-checkbox> </div>`,[Ps]),this.eCheckbox=b}postConstruct(){this.eCheckbox.setPassive(!0)}getCheckboxId(){return this.eCheckbox.getInputElement().id}onDataChanged(){this.onSelectionChanged()}onSelectableChanged(){this.showOrHideSelect()}onSelectionChanged(){const e=this.localeService.getLocaleTextFunc(),t=this.rowNode.isSelected(),i=Cs(e,t),[s,o]=this.rowNode.selectable?["ariaRowToggleSelection","Press Space to toggle row selection"]:["ariaRowSelectionDisabled","Row Selection is disabled for this row"],r=e(s,o);this.eCheckbox.setValue(t,!0),this.eCheckbox.setInputAriaLabel(`${r} (${i})`)}onClicked(e,t,i){return this.rowNode.setSelectedParams({newValue:e,rangeSelect:i.shiftKey,groupSelectsFiltered:t,event:i,source:"checkboxSelected"})}init(e){if(this.rowNode=e.rowNode,this.column=e.column,this.overrides=e.overrides,this.onSelectionChanged(),this.addManagedListeners(this.eCheckbox.getInputElement(),{dblclick:s=>at(s),click:s=>{at(s);const o=cs(this.gos)==="filteredDescendants",r=this.eCheckbox.getValue();this.shouldHandleIndeterminateState(r,o)?this.onClicked(!0,o,s||{})===0&&this.onClicked(!1,o,s):r?this.onClicked(!1,o,s):this.onClicked(!0,o,s||{})}}),this.addManagedListeners(this.rowNode,{rowSelected:this.onSelectionChanged.bind(this),dataChanged:this.onDataChanged.bind(this),selectableChanged:this.onSelectableChanged.bind(this)}),ds(this.gos)||typeof this.getIsVisible()=="function"){const s=this.showOrHideSelect.bind(this);this.addManagedEventListeners({displayedColumnsChanged:s}),this.addManagedListeners(this.rowNode,{dataChanged:s,cellChanged:s}),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")}shouldHandleIndeterminateState(e,t){return t&&(this.eCheckbox.getPreviousValue()===void 0||e===void 0)&&N(this.gos)}showOrHideSelect(){var o,r,n;let e=this.rowNode.selectable;const t=this.getIsVisible();if(e)if(typeof t=="function"){const l=(o=this.overrides)==null?void 0:o.callbackParams;if(!this.column)e=t({...l,node:this.rowNode,data:this.rowNode.data});else{const a=this.column.createColumnFunctionCallbackParams(this.rowNode);e=t({...l,...a})}}else e=t??!1;const i=this.gos.get("rowSelection");if(i&&typeof i!="string"?!Bn(i):(r=this.column)==null?void 0:r.getColDef().showDisabledCheckboxes){this.eCheckbox.setDisabled(!e),this.setVisible(!0),this.setDisplayed(!0);return}if((n=this.overrides)!=null&&n.removeHidden){this.setDisplayed(e);return}this.setVisible(e)}getIsVisible(){var t,i;if(this.overrides)return this.overrides.isVisible;const e=this.gos.get("rowSelection");return e&&typeof e!="string"?lt(e):(i=(t=this.column)==null?void 0:t.getColDef())==null?void 0:i.checkboxSelection}},Bh=class extends G{constructor(e,t,i){super('<div class="ag-drag-handle ag-row-drag" draggable="true"></div>'),this.rowNode=e,this.column=t,this.eCell=i}postConstruct(){this.getGui().appendChild(ie("rowDrag",this.gos,null)),this.addGuiEventListener("mousedown",t=>{t.stopPropagation()}),this.addDragSource(),this.checkVisibility()}addDragSource(){this.addGuiEventListener("dragstart",this.onDragStart.bind(this))}onDragStart(e){const t=this.column.getColDef().dndSourceOnRowDrag;e.dataTransfer.setDragImage(this.eCell,0,0);const i=()=>{try{const s=JSON.stringify(this.rowNode.data);e.dataTransfer.setData("application/json",s),e.dataTransfer.setData("text/plain",s)}catch{}};if(t){const s=this.gos.addGridCommonParams({rowNode:this.rowNode,dragEvent:e});t(s)}else i()}checkVisibility(){const e=this.column.isDndSource(this.rowNode);this.setDisplayed(e)}},Wh=class extends v{constructor(e,t){super(),this.staticClasses=[],this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const e=this.column.getColDef(),{cellClassRules:t}=e,i=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,colDef:e,column:this.column,rowIndex:this.rowNode.rowIndex});this.beans.stylingService.processClassRules(t===this.cellClassRules?void 0:this.cellClassRules,t,i,s=>this.cellComp.addOrRemoveCssClass(s,!0),s=>this.cellComp.addOrRemoveCssClass(s,!1)),this.cellClassRules=t}applyUserStyles(){const e=this.column.getColDef();if(!e.cellStyle)return;let t;if(typeof e.cellStyle=="function"){const i=this.beans.gos.addGridCommonParams({column:this.column,value:this.cellCtrl.getValue(),colDef:e,data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex}),s=e.cellStyle;t=s(i)}else t=e.cellStyle;t&&this.cellComp.setUserStyles(t)}applyClassesFromColDef(){const e=this.column.getColDef(),t=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,column:this.column,colDef:e,rowIndex:this.rowNode.rowIndex});this.staticClasses.length&&this.staticClasses.forEach(i=>this.cellComp.addOrRemoveCssClass(i,!1)),this.staticClasses=this.beans.stylingService.getStaticCellClasses(e,t),this.staticClasses.length&&this.staticClasses.forEach(i=>this.cellComp.addOrRemoveCssClass(i,!0))}destroy(){super.destroy()}},zh=class extends v{constructor(e,t,i,s,o){super(),this.cellCtrl=e,this.beans=t,this.rowNode=s,this.rowCtrl=o}setComp(e){this.eGui=e}onKeyDown(e){const t=e.key;switch(t){case m.ENTER:this.onEnterKeyDown(e);break;case m.F2:this.onF2KeyDown(e);break;case m.ESCAPE:this.onEscapeKeyDown(e);break;case m.TAB:this.onTabKeyDown(e);break;case m.BACKSPACE:case m.DELETE:this.onBackspaceOrDeleteKeyDown(t,e);break;case m.DOWN:case m.UP:case m.RIGHT:case m.LEFT:this.onNavigationKeyDown(e,t);break}}onNavigationKeyDown(e,t){this.cellCtrl.isEditing()||(e.shiftKey&&this.cellCtrl.isRangeSelectionEnabled()?this.onShiftRangeSelect(e):this.beans.navigationService.navigateToNextCell(e,t,this.cellCtrl.getCellPosition(),!0),e.preventDefault())}onShiftRangeSelect(e){if(!this.beans.rangeService)return;const t=this.beans.rangeService.extendLatestRangeInDirection(e);t&&this.beans.navigationService.ensureCellVisible(t)}onTabKeyDown(e){this.beans.navigationService.onTabKeyDown(this.cellCtrl,e)}onBackspaceOrDeleteKeyDown(e,t){const{cellCtrl:i,beans:s,rowNode:o}=this,{gos:r,rangeService:n,eventService:l}=s;if(!i.isEditing()){if(l.dispatchEvent({type:"keyShortcutChangedCellStart"}),ud(e,r.get("enableCellEditingOnBackspace"))){if(n&&ve(r))n.clearCellRangeCellValues({dispatchWrapperEvents:!0,wrapperEventSource:"deleteKey"});else if(i.isCellEditable()){const a=i.getColumn(),d=this.beans.valueService.getDeleteValue(a,o);o.setDataValue(a,d,"cellClear")}}else i.startRowOrCellEdit(e,t);l.dispatchEvent({type:"keyShortcutChangedCellEnd"})}}onEnterKeyDown(e){if(this.cellCtrl.isEditing()||this.rowCtrl.isEditing())this.cellCtrl.stopEditingAndFocus(!1,e.shiftKey);else if(this.beans.gos.get("enterNavigatesVertically")){const t=e.shiftKey?m.UP:m.DOWN;this.beans.navigationService.navigateToNextCell(null,t,this.cellCtrl.getCellPosition(),!1)}else this.cellCtrl.startRowOrCellEdit(m.ENTER,e),this.cellCtrl.isEditing()&&e.preventDefault()}onF2KeyDown(e){this.cellCtrl.isEditing()||this.cellCtrl.startRowOrCellEdit(m.F2,e)}onEscapeKeyDown(e){this.cellCtrl.isEditing()&&(this.cellCtrl.stopRowOrCellEdit(!0),this.cellCtrl.focusCell(!0))}processCharacter(e){if(e.target!==this.eGui||this.cellCtrl.isEditing())return;const s=e.key;s===" "?this.onSpaceKeyDown(e):this.cellCtrl.startRowOrCellEdit(s,e)&&e.preventDefault()}onSpaceKeyDown(e){const{gos:t}=this.beans;if(!this.cellCtrl.isEditing()&&Xt(t)){const i=this.rowNode.isSelected(),s=!i,o=cs(t)==="filteredDescendants",r=this.rowNode.setSelectedParams({newValue:s,rangeSelect:e.shiftKey,groupSelectsFiltered:o,event:e,source:"spaceKey"});i===void 0&&r===0&&this.rowNode.setSelectedParams({newValue:!1,rangeSelect:e.shiftKey,groupSelectsFiltered:o,event:e,source:"spaceKey"})}e.preventDefault()}destroy(){super.destroy()}},_h=class extends v{constructor(e,t,i){super(),this.cellCtrl=e,this.beans=t,this.column=i}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.isDoubleClickOnIPad()){this.onCellDoubleClicked(e),e.preventDefault();return}const{eventService:t,rangeService:i,gos:s}=this.beans,o=e.ctrlKey||e.metaKey;i&&o&&i.getCellRangeCount(this.cellCtrl.getCellPosition())>1&&i.intersectLastRange(!0);const r=this.cellCtrl.createEvent(e,"cellClicked");t.dispatchEvent(r);const n=this.column.getColDef();n.onCellClicked&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{n.onCellClicked(r)})},0),(s.get("singleClickEdit")||n.singleClickEdit)&&!s.get("suppressClickEdit")&&!(e.shiftKey&&(i==null?void 0:i.getCellRanges().length)!=0)&&this.cellCtrl.startRowOrCellEdit()}isDoubleClickOnIPad(){if(!He()||Vo("dblclick"))return!1;const e=new Date().getTime(),t=e-this.lastIPadMouseClickEvent<200;return this.lastIPadMouseClickEvent=e,t}onCellDoubleClicked(e){const{column:t,beans:i,cellCtrl:s}=this,{eventService:o,frameworkOverrides:r,gos:n}=i,l=t.getColDef(),a=s.createEvent(e,"cellDoubleClicked");o.dispatchEvent(a),typeof l.onCellDoubleClicked=="function"&&window.setTimeout(()=>{r.wrapOutgoing(()=>{l.onCellDoubleClicked(a)})},0),!n.get("singleClickEdit")&&!n.get("suppressClickEdit")&&s.startRowOrCellEdit(null,e)}onMouseDown(e){const{ctrlKey:t,metaKey:i,shiftKey:s}=e,o=e.target,{cellCtrl:r,beans:n}=this,{eventService:l,rangeService:a,focusService:d,gos:h}=n;if(this.isRightClickInExistingRange(e))return;const c=a&&a.getCellRanges().length!=0;if(!s||!c){const g=h.get("enableCellTextSelection")&&e.defaultPrevented,p=(we()||g)&&!r.isEditing()&&!ws(o);r.focusCell(p)}if(s&&c&&!d.isCellFocused(r.getCellPosition())){e.preventDefault();const u=d.getFocusedCell();if(u){const{column:g,rowIndex:p,rowPinned:C}=u,f=n.rowRenderer.getRowByPosition({rowIndex:p,rowPinned:C}),w=f==null?void 0:f.getCellCtrl(g);w!=null&&w.isEditing()&&w.stopEditing(),d.setFocusedCell({column:g,rowIndex:p,rowPinned:C,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}}if(!this.containsWidget(o)){if(a){const u=this.cellCtrl.getCellPosition();if(s)a.extendLatestRangeToCell(u);else{const g=t||i;a.setRangeToCell(u,g)}}l.dispatchEvent(this.cellCtrl.createEvent(e,"cellMouseDown"))}}isRightClickInExistingRange(e){const{rangeService:t}=this.beans;if(t){const i=t.isCellInAnyRange(this.cellCtrl.getCellPosition()),s=e.button===2||e.ctrlKey&&this.beans.gos.get("allowContextMenuWithControlKey");if(i&&s)return!0}return!1}containsWidget(e){return rt(e,"ag-selection-checkbox",3)}onMouseOut(e){this.mouseStayingInsideCell(e)||(this.beans.eventService.dispatchEvent(this.cellCtrl.createEvent(e,"cellMouseOut")),this.beans.columnHoverService.clearMouseOver())}onMouseOver(e){this.mouseStayingInsideCell(e)||(this.beans.eventService.dispatchEvent(this.cellCtrl.createEvent(e,"cellMouseOver")),this.beans.columnHoverService.setMouseOver([this.column]))}mouseStayingInsideCell(e){if(!e.target||!e.relatedTarget)return!1;const t=this.cellCtrl.getGui(),i=t.contains(e.target),s=t.contains(e.relatedTarget);return i&&s}destroy(){super.destroy()}},Uh=class extends v{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setupRowSpan(){this.rowSpan=this.column.getRowSpan(this.rowNode),this.addManagedListeners(this.beans.eventService,{newColumnsLoaded:()=>this.onNewColumnsLoaded()})}setComp(e){this.eGui=e,this.setupColSpan(),this.setupRowSpan(),this.onLeftChanged(),this.onWidthChanged(),this.applyRowSpan()}onNewColumnsLoaded(){const e=this.column.getRowSpan(this.rowNode);this.rowSpan!==e&&(this.rowSpan=e,this.applyRowSpan(!0))}onDisplayColumnsChanged(){const e=this.getColSpanningList();ke(this.colsSpanning,e)||(this.colsSpanning=e,this.onWidthChanged(),this.onLeftChanged())}setupColSpan(){this.column.getColDef().colSpan!=null&&(this.colsSpanning=this.getColSpanningList(),this.addManagedListeners(this.beans.eventService,{displayedColumnsChanged:this.onDisplayColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onWidthChanged.bind(this)}))}onWidthChanged(){if(!this.eGui)return;const e=this.getCellWidth();this.eGui.style.width=`${e}px`}getCellWidth(){return this.colsSpanning?this.colsSpanning.reduce((e,t)=>e+t.getActualWidth(),0):this.column.getActualWidth()}getColSpanningList(){const e=this.column.getColSpan(this.rowNode),t=[];if(e===1)t.push(this.column);else{let i=this.column;const s=this.column.getPinned();for(let o=0;i&&o<e&&(t.push(i),i=this.beans.visibleColsService.getColAfter(i),!(!i||A(i)||s!==i.getPinned()));o++);}return t}onLeftChanged(){if(!this.eGui)return;const e=this.modifyLeftForPrintLayout(this.getCellLeft());this.eGui.style.left=e+"px"}getCellLeft(){let e;return this.beans.gos.get("enableRtl")&&this.colsSpanning?e=I(this.colsSpanning):e=this.column,e.getLeft()}modifyLeftForPrintLayout(e){if(!this.cellCtrl.isPrintLayout()||this.column.getPinned()==="left")return e;const t=this.beans.visibleColsService.getColsLeftWidth();if(this.column.getPinned()==="right"){const i=this.beans.visibleColsService.getBodyContainerWidth();return t+i+(e||0)}return t+(e||0)}applyRowSpan(e){if(this.rowSpan===1&&!e)return;const i=Ke(this.beans.gos)*this.rowSpan;this.eGui.style.height=`${i}px`,this.eGui.style.zIndex="1"}destroy(){super.destroy()}},mt="ag-cell-range-selected",Kh="ag-cell-range-chart",$h="ag-cell-range-single-cell",jh="ag-cell-range-chart-category",qh="ag-cell-range-handle",Yh="ag-cell-range-top",Qh="ag-cell-range-right",Xh="ag-cell-range-bottom",Jh="ag-cell-range-left",Zh=class{constructor(e,t){this.beans=e,this.rangeService=e.rangeService,this.selectionHandleFactory=e.selectionHandleFactory,this.cellCtrl=t}setComp(e,t){this.cellComp=e,this.eGui=t,this.onCellSelectionChanged()}onCellSelectionChanged(){this.cellComp&&(this.rangeCount=this.rangeService.getCellRangeCount(this.cellCtrl.getCellPosition()),this.hasChartRange=this.getHasChartRange(),this.cellComp.addOrRemoveCssClass(mt,this.rangeCount!==0),this.cellComp.addOrRemoveCssClass(`${mt}-1`,this.rangeCount===1),this.cellComp.addOrRemoveCssClass(`${mt}-2`,this.rangeCount===2),this.cellComp.addOrRemoveCssClass(`${mt}-3`,this.rangeCount===3),this.cellComp.addOrRemoveCssClass(`${mt}-4`,this.rangeCount>=4),this.cellComp.addOrRemoveCssClass(Kh,this.hasChartRange),si(this.eGui,this.rangeCount>0?!0:void 0),this.cellComp.addOrRemoveCssClass($h,this.isSingleCell()),this.updateRangeBorders(),this.refreshHandle())}updateRangeBorders(){const e=this.getRangeBorders(),t=this.isSingleCell(),i=!t&&e.top,s=!t&&e.right,o=!t&&e.bottom,r=!t&&e.left;this.cellComp.addOrRemoveCssClass(Yh,i),this.cellComp.addOrRemoveCssClass(Qh,s),this.cellComp.addOrRemoveCssClass(Xh,o),this.cellComp.addOrRemoveCssClass(Jh,r)}isSingleCell(){const{rangeService:e}=this.beans;return this.rangeCount===1&&!!e&&!e.isMoreThanOneCell()}getHasChartRange(){const{rangeService:e}=this.beans;if(!this.rangeCount||!e)return!1;const t=e.getCellRanges();return t.length>0&&t.every(i=>$e([1,0],i.type))}updateRangeBordersIfRangeCount(){this.rangeCount>0&&(this.updateRangeBorders(),this.refreshHandle())}getRangeBorders(){const e=this.beans.gos.get("enableRtl");let t=!1,i=!1,s=!1,o=!1;const r=this.cellCtrl.getCellPosition().column,n=this.beans.visibleColsService;let l,a;e?(l=n.getColAfter(r),a=n.getColBefore(r)):(l=n.getColBefore(r),a=n.getColAfter(r));const d=this.rangeService.getCellRanges().filter(h=>this.rangeService.isCellInSpecificRange(this.cellCtrl.getCellPosition(),h));l||(o=!0),a||(i=!0);for(let h=0;h<d.length&&!(t&&i&&s&&o);h++){const c=d[h],u=this.rangeService.getRangeStartRow(c),g=this.rangeService.getRangeEndRow(c);!t&&this.beans.rowPositionUtils.sameRow(u,this.cellCtrl.getCellPosition())&&(t=!0),!s&&this.beans.rowPositionUtils.sameRow(g,this.cellCtrl.getCellPosition())&&(s=!0),!o&&l&&c.columns.indexOf(l)<0&&(o=!0),!i&&a&&c.columns.indexOf(a)<0&&(i=!0)}return{top:t,right:i,bottom:s,left:o}}refreshHandle(){if(this.beans.context.isDestroyed())return;const e=this.shouldHaveSelectionHandle();this.selectionHandle&&!e&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),e&&this.addSelectionHandle(),this.cellComp.addOrRemoveCssClass(qh,!!this.selectionHandle)}shouldHaveSelectionHandle(){const e=this.beans.gos,t=this.rangeService.getCellRanges(),i=t.length;if(this.rangeCount<1||i<1)return!1;const s=I(t),o=this.cellCtrl.getCellPosition(),r=Ys(e)&&!this.cellCtrl.isSuppressFillHandle(),n=Un(e);let l=i===1&&!this.cellCtrl.isEditing()&&(r||n);if(this.hasChartRange){const d=t[0].type===1&&this.rangeService.isCellInSpecificRange(o,t[0]);this.cellComp.addOrRemoveCssClass(jh,d),l=s.type===0}return l&&s.endRow!=null&&this.rangeService.isContiguousRange(s)&&this.rangeService.isBottomRightCell(s,o)}addSelectionHandle(){const e=I(this.rangeService.getCellRanges()).type,i=Ys(this.beans.gos)&&A(e)?0:1;this.selectionHandle&&this.selectionHandle.getType()!==i&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),this.selectionHandle||(this.selectionHandle=this.selectionHandleFactory.createSelectionHandle(i)),this.selectionHandle.refresh(this.cellCtrl)}destroy(){this.beans.context.destroyBean(this.selectionHandle)}},ec="ag-cell",tc="ag-cell-auto-height",ic="ag-cell-normal-height",sc="ag-cell-focus",oc="ag-cell-first-right-pinned",rc="ag-cell-last-left-pinned",nc="ag-cell-not-inline-editing",lc="ag-column-hover",ac="ag-cell-wrap-text",dc=0,Qr=class ss extends v{constructor(t,i,s,o){super(),this.column=t,this.rowNode=i,this.beans=s,this.rowCtrl=o,this.cellRangeFeature=void 0,this.cellPositionFeature=void 0,this.cellCustomStyleFeature=void 0,this.tooltipFeature=void 0,this.cellMouseListenerFeature=void 0,this.cellKeyboardListenerFeature=void 0,this.suppressRefreshCell=!1,this.onCellCompAttachedFuncs=[],this.onCellEditorAttachedFuncs=[],this.instanceId=t.getId()+"-"+dc++,this.colIdSanitised=me(this.column.getId()),this.createCellPosition(),this.updateAndFormatValue(!1)}shouldRestoreFocus(){return this.beans.focusService.shouldRestoreFocus(this.cellPosition)}onFocusOut(){this.beans.focusService.clearRestoreFocus()}addFeatures(){this.cellPositionFeature=new Uh(this,this.beans),this.cellCustomStyleFeature=new Wh(this,this.beans),this.cellMouseListenerFeature=new _h(this,this.beans,this.column),this.cellKeyboardListenerFeature=new zh(this,this.beans,this.column,this.rowNode,this.rowCtrl),this.column.isTooltipEnabled()&&this.enableTooltipFeature(),this.beans.rangeService&&ve(this.beans.gos)&&(this.cellRangeFeature=new Zh(this.beans,this))}removeFeatures(){const t=this.beans.context;this.cellPositionFeature=t.destroyBean(this.cellPositionFeature),this.cellCustomStyleFeature=t.destroyBean(this.cellCustomStyleFeature),this.cellMouseListenerFeature=t.destroyBean(this.cellMouseListenerFeature),this.cellKeyboardListenerFeature=t.destroyBean(this.cellKeyboardListenerFeature),this.cellRangeFeature=t.destroyBean(this.cellRangeFeature),this.disableTooltipFeature()}enableTooltipFeature(t,i){const s=()=>{const n=this.column.getColDef(),l=this.rowNode.data;if(n.tooltipField&&F(l))return Rt(l,n.tooltipField,this.column.isTooltipFieldContainsDots());const a=n.tooltipValueGetter;return a?a(this.beans.gos.addGridCommonParams({location:"cell",colDef:this.column.getColDef(),column:this.column,rowIndex:this.cellPosition.rowIndex,node:this.rowNode,data:this.rowNode.data,value:this.value,valueFormatted:this.valueFormatted})):null},o=this.beans.gos.get("tooltipShowMode")==="whenTruncated";!i&&o&&!this.isCellRenderer()&&(i=()=>{const n=this.getGui(),l=n.children.length===0?n:n.querySelector(".ag-cell-value");return l?l.scrollWidth>l.clientWidth:!0});const r={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getRowIndex:()=>this.cellPosition.rowIndex,getRowNode:()=>this.rowNode,getGui:()=>this.getGui(),getLocation:()=>"cell",getTooltipValue:t!=null?()=>t:s,getValueFormatted:()=>this.valueFormatted,shouldDisplayTooltip:i};this.tooltipFeature=new gt(r,this.beans)}disableTooltipFeature(){this.tooltipFeature=this.beans.context.destroyBean(this.tooltipFeature)}setComp(t,i,s,o,r,n){var l,a,d,h;this.cellComp=t,this.eGui=i,this.printLayout=o,n??(n=this),this.addDomData(n),this.addFeatures(),n.addDestroyFunc(()=>this.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(s,n),this.refreshFirstAndLastStyles(),this.refreshAriaColIndex(),(l=this.cellPositionFeature)==null||l.setComp(i),(a=this.cellCustomStyleFeature)==null||a.setComp(t),(d=this.tooltipFeature)==null||d.refreshToolTip(),(h=this.cellKeyboardListenerFeature)==null||h.setComp(this.eGui),this.cellRangeFeature&&this.cellRangeFeature.setComp(t,i),r&&this.isCellEditable()?this.startEditing():this.showValue(),this.onCellCompAttachedFuncs.length&&(this.onCellCompAttachedFuncs.forEach(c=>c()),this.onCellCompAttachedFuncs=[])}setupAutoHeight(t,i){if(this.isAutoHeight=this.column.isAutoHeight(),!this.isAutoHeight||!t)return;const s=t.parentElement,o=Le(this.beans.gos,this.rowNode).height,r=a=>{if(this.editing||!this.isAlive()||!i.isAlive())return;const{paddingTop:d,paddingBottom:h,borderBottomWidth:c,borderTopWidth:u}=Xe(s),g=d+h+c+u,C=t.offsetHeight+g;if(a<5){const w=B(this.beans.gos),y=!w||!w.contains(t),R=C==0;if(y||R){window.setTimeout(()=>r(a+1),0);return}}const f=Math.max(C,o);this.rowNode.setRowAutoHeight(f,this.column)},n=()=>r(0);n();const l=this.beans.resizeObserverService.observeResize(t,n);i.addDestroyFunc(()=>{l(),this.rowNode.setRowAutoHeight(void 0,this.column)})}getCellAriaRole(){return this.column.getColDef().cellAriaRole??"gridcell"}isCellRenderer(){const t=this.column.getColDef();return t.cellRenderer!=null||t.cellRendererSelector!=null}getValueToDisplay(){return this.valueFormatted??this.value}showValue(t=!1){var u;const{beans:i,column:s,rowNode:o,cellRangeFeature:r,cellComp:n}=this,{userComponentFactory:l,animationFrameService:a}=i,d=this.getValueToDisplay();let h;if(o.stub&&((u=o.groupData)==null?void 0:u[this.column.getId()])==null){const g=this.createCellRendererParams();h=l.getLoadingCellRendererDetails(s.getColDef(),g)}else if(this.isCellRenderer()){const g=this.createCellRendererParams();h=l.getCellRendererDetails(s.getColDef(),g)}n.setRenderDetails(h,d,t),a.requestAnimationFrame(()=>r==null?void 0:r.refreshHandle())}setupControlComps(){const t=this.column.getColDef();this.includeSelection=this.isIncludeControl(this.isCheckboxSelection(t)),this.includeRowDrag=this.isIncludeControl(t.rowDrag),this.includeDndSource=this.isIncludeControl(t.dndSource),this.cellComp.setIncludeSelection(this.includeSelection),this.cellComp.setIncludeDndSource(this.includeDndSource),this.cellComp.setIncludeRowDrag(this.includeRowDrag)}isForceWrapper(){return this.beans.gos.get("enableCellTextSelection")||this.column.isAutoHeight()}isIncludeControl(t){return this.rowNode.rowPinned!=null?!1:typeof t=="function"||t===!0}isCheckboxSelection(t){const{rowSelection:i}=this.beans.gridOptions;return t.checkboxSelection||Gt(this.column)&&i&&typeof i!="string"&<(i)}refreshShouldDestroy(){const t=this.column.getColDef(),i=this.includeSelection!=this.isIncludeControl(this.isCheckboxSelection(t)),s=this.includeRowDrag!=this.isIncludeControl(t.rowDrag),o=this.includeDndSource!=this.isIncludeControl(t.dndSource),r=this.isAutoHeight!=this.column.isAutoHeight();return i||s||o||r}startEditing(t=null,i=!1,s=null){const{editService:o}=this.beans;return!this.isCellEditable()||this.editing||!o?!0:this.cellComp?o.startEditing(this,t,i,s):(this.onCellCompAttachedFuncs.push(()=>{this.startEditing(t,i,s)}),!0)}setEditing(t,i){this.editCompDetails=i,this.editing!==t&&(this.editing=t)}stopRowOrCellEdit(t=!1){this.beans.gos.get("editType")==="fullRow"?this.rowCtrl.stopEditing(t):this.stopEditing(t)}onPopupEditorClosed(){this.editing&&this.stopEditingAndFocus()}stopEditing(t=!1){this.onCellEditorAttachedFuncs=[];const{editService:i}=this.beans;return!this.editing||!i?!1:i.stopEditing(this,t)}createCellRendererParams(){return this.beans.gos.addGridCommonParams({value:this.value,valueFormatted:this.valueFormatted,getValue:()=>this.beans.valueService.getValueForDisplay(this.column,this.rowNode),setValue:i=>this.beans.valueService.setValue(this.rowNode,this.column,i),formatValue:this.formatValue.bind(this),data:this.rowNode.data,node:this.rowNode,pinned:this.column.getPinned(),colDef:this.column.getColDef(),column:this.column,refreshCell:this.refreshCell.bind(this),eGridCell:this.getGui(),eParentOfValue:this.cellComp.getParentOfValue(),registerRowDragger:(i,s,o,r)=>this.registerRowDragger(i,s,r),setTooltip:(i,s)=>{var o;this.tooltipFeature&&this.disableTooltipFeature(),this.enableTooltipFeature(i,s),(o=this.tooltipFeature)==null||o.refreshToolTip()}})}setFocusOutOnEditor(){var t;this.editing&&((t=this.beans.editService)==null||t.setFocusOutOnEditor(this))}setFocusInOnEditor(){var t;this.editing&&((t=this.beans.editService)==null||t.setFocusInOnEditor(this))}onCellChanged(t){t.column===this.column&&this.refreshCell({})}refreshOrDestroyCell(t){var i;this.refreshShouldDestroy()?(i=this.rowCtrl)==null||i.recreateCell(this):this.refreshCell(t)}refreshCell(t){var h,c,u,g,p;if(this.suppressRefreshCell||this.editing)return;const i=this.column.getColDef(),s=t!=null&&!!t.newData,o=t!=null&&!!t.suppressFlash||!!i.suppressCellFlash,r=i.field==null&&i.valueGetter==null&&i.showRowGroup==null,n=t&&t.forceRefresh||r||s,l=!!this.cellComp,a=this.updateAndFormatValue(l),d=n||a;if(l){if(d){this.showValue(s);const C=(h=this.beans.filterManager)==null?void 0:h.isSuppressFlashingCellsBecauseFiltering();!o&&!C&&(this.beans.gos.get("enableCellChangeFlash")||i.enableCellChangeFlash)&&this.flashCell(),(c=this.cellCustomStyleFeature)==null||c.applyUserStyles(),(u=this.cellCustomStyleFeature)==null||u.applyClassesFromColDef()}(g=this.tooltipFeature)==null||g.refreshToolTip(),(p=this.cellCustomStyleFeature)==null||p.applyCellClassRules()}}stopEditingAndFocus(t=!1,i=!1){var s;(s=this.beans.editService)==null||s.stopEditingAndFocus(this,t,i)}flashCell(t){const i=(t==null?void 0:t.flashDuration)??(t==null?void 0:t.flashDelay),s=(t==null?void 0:t.fadeDuration)??(t==null?void 0:t.fadeDelay);this.animateCell("data-changed",i,s)}animateCell(t,i,s){if(!this.cellComp)return;const{gos:o}=this.beans;if(i||(i=o.get("cellFlashDuration")),i===0)return;F(s)||(s=o.get("cellFadeDuration"));const r=`ag-cell-${t}`,n=`ag-cell-${t}-animation`;this.cellComp.addOrRemoveCssClass(r,!0),this.cellComp.addOrRemoveCssClass(n,!1),this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(r,!1),this.cellComp.addOrRemoveCssClass(n,!0),this.eGui.style.transition=`background-color ${s}ms`,window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(n,!1),this.eGui.style.transition="")},s))},i)})}onFlashCells(t){if(!this.cellComp)return;const i=this.beans.cellPositionUtils.createId(this.getCellPosition());t.cells[i]&&this.animateCell("highlight")}isCellEditable(){return this.column.isCellEditable(this.rowNode)}isSuppressFillHandle(){return this.column.isSuppressFillHandle()}formatValue(t){return this.callValueFormatter(t)??t}callValueFormatter(t){return this.beans.valueService.formatValue(this.column,this.rowNode,t)}updateAndFormatValue(t){const i=this.value,s=this.valueFormatted;return this.value=this.beans.valueService.getValueForDisplay(this.column,this.rowNode),this.valueFormatted=this.callValueFormatter(this.value),t?!this.valuesAreEqual(i,this.value)||this.valueFormatted!=s:!0}valuesAreEqual(t,i){const s=this.column.getColDef();return s.equals?s.equals(t,i):t===i}getComp(){return this.cellComp}getValue(){return this.value}addDomData(t){const i=this.getGui();Ye(this.beans.gos,i,ss.DOM_DATA_KEY_CELL_CTRL,this),t.addDestroyFunc(()=>Ye(this.beans.gos,i,ss.DOM_DATA_KEY_CELL_CTRL,null))}createEvent(t,i){return this.beans.gos.addGridCommonParams({type:i,node:this.rowNode,data:this.rowNode.data,value:this.value,column:this.column,colDef:this.column.getColDef(),rowPinned:this.rowNode.rowPinned,event:t,rowIndex:this.rowNode.rowIndex})}processCharacter(t){var i;(i=this.cellKeyboardListenerFeature)==null||i.processCharacter(t)}onKeyDown(t){var i;(i=this.cellKeyboardListenerFeature)==null||i.onKeyDown(t)}onMouseEvent(t,i){var s;(s=this.cellMouseListenerFeature)==null||s.onMouseEvent(t,i)}getGui(){return this.eGui}getColSpanningList(){return this.cellPositionFeature.getColSpanningList()}onLeftChanged(){var t;this.cellComp&&((t=this.cellPositionFeature)==null||t.onLeftChanged())}onDisplayedColumnsChanged(){this.eGui&&(this.refreshAriaColIndex(),this.refreshFirstAndLastStyles())}refreshFirstAndLastStyles(){const{cellComp:t,column:i,beans:s}=this;Nr(t,i,s.visibleColsService)}refreshAriaColIndex(){const t=this.beans.visibleColsService.getAriaColIndex(this.column);Xo(this.getGui(),t)}isSuppressNavigable(){return this.column.isSuppressNavigable(this.rowNode)}onWidthChanged(){var t;return(t=this.cellPositionFeature)==null?void 0:t.onWidthChanged()}getColumn(){return this.column}getRowNode(){return this.rowNode}isPrintLayout(){return this.printLayout}getCellPosition(){return this.cellPosition}isEditing(){return this.editing}startRowOrCellEdit(t,i=null){return this.cellComp?this.beans.gos.get("editType")==="fullRow"?this.rowCtrl.startRowEditing(t,this):this.startEditing(t,!0,i):(this.onCellCompAttachedFuncs.push(()=>{this.startRowOrCellEdit(t,i)}),!0)}getRowCtrl(){return this.rowCtrl}getRowPosition(){return{rowIndex:this.cellPosition.rowIndex,rowPinned:this.cellPosition.rowPinned}}updateRangeBordersIfRangeCount(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.updateRangeBordersIfRangeCount()}onCellSelectionChanged(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.onCellSelectionChanged()}isRangeSelectionEnabled(){return this.cellRangeFeature!=null}focusCell(t=!1){this.beans.focusService.setFocusedCell({rowIndex:this.getCellPosition().rowIndex,column:this.column,rowPinned:this.rowNode.rowPinned,forceBrowserFocus:t})}onRowIndexChanged(){this.createCellPosition(),this.onCellFocused(),this.cellRangeFeature&&this.cellRangeFeature.onCellSelectionChanged()}onSuppressCellFocusChanged(t){this.eGui&&ae(this.eGui,"tabindex",t?void 0:-1)}onFirstRightPinnedChanged(){if(!this.cellComp)return;const t=this.column.isFirstRightPinned();this.cellComp.addOrRemoveCssClass(oc,t)}onLastLeftPinnedChanged(){if(!this.cellComp)return;const t=this.column.isLastLeftPinned();this.cellComp.addOrRemoveCssClass(rc,t)}onCellFocused(t){if(this.beans.focusService.isCellFocusSuppressed())return;const i=this.beans.focusService.isCellFocused(this.cellPosition);if(!this.cellComp){i&&(t!=null&&t.forceBrowserFocus)&&(this.focusEventToRestore=t);return}if(this.focusEventToRestore=void 0,this.cellComp.addOrRemoveCssClass(sc,i),i&&t&&t.forceBrowserFocus){let o=this.cellComp.getFocusableElement();if(this.editing){const r=this.beans.focusService.findFocusableElements(o,null,!0);r.length&&(o=r[0])}o.focus({preventScroll:!!t.preventScrollOnBrowserFocus})}const s=this.beans.gos.get("editType")==="fullRow";!i&&!s&&this.editing&&this.stopRowOrCellEdit(),i&&this.rowCtrl.announceDescription()}createCellPosition(){this.cellPosition={rowIndex:this.rowNode.rowIndex,rowPinned:Re(this.rowNode.rowPinned),column:this.column}}applyStaticCssClasses(){this.cellComp.addOrRemoveCssClass(ec,!0),this.cellComp.addOrRemoveCssClass(nc,!0);const t=this.column.isAutoHeight()==!0;this.cellComp.addOrRemoveCssClass(tc,t),this.cellComp.addOrRemoveCssClass(ic,!t)}onColumnHover(){if(!this.cellComp||!this.beans.gos.get("columnHoverHighlight"))return;const t=this.beans.columnHoverService.isHovered(this.column);this.cellComp.addOrRemoveCssClass(lc,t)}onColDefChanged(){var i;if(!this.cellComp)return;this.column.isTooltipEnabled()?(this.disableTooltipFeature(),this.enableTooltipFeature()):this.disableTooltipFeature(),this.setWrapText(),this.editing?(i=this.beans.editService)==null||i.handleColDefChanged(this):this.refreshOrDestroyCell({forceRefresh:!0,suppressFlash:!0})}setWrapText(){const t=this.column.getColDef().wrapText==!0;this.cellComp.addOrRemoveCssClass(ac,t)}dispatchCellContextMenuEvent(t){const i=this.column.getColDef(),s=this.createEvent(t,"cellContextMenu");this.beans.eventService.dispatchEvent(s),i.onCellContextMenu&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{i.onCellContextMenu(s)})},0)}getCellRenderer(){return this.cellComp?this.cellComp.getCellRenderer():null}getCellEditor(){return this.cellComp?this.cellComp.getCellEditor():null}destroy(){this.onCellCompAttachedFuncs=[],this.onCellEditorAttachedFuncs=[],super.destroy()}createSelectionCheckbox(){const t=new Nh;return this.beans.context.createBean(t),t.init({rowNode:this.rowNode,column:this.column}),t}createDndSource(){const t=new Bh(this.rowNode,this.column,this.eGui);return this.beans.context.createBean(t),t}registerRowDragger(t,i,s){if(this.customRowDragComp){this.customRowDragComp.setDragElement(t,i);return}const o=this.createRowDragComp(t,i,s);o&&(this.customRowDragComp=o,this.addDestroyFunc(()=>{this.beans.context.destroyBean(o),this.customRowDragComp=null}))}createRowDragComp(t,i,s){const o=this.beans.gos.get("pagination"),r=this.beans.gos.get("rowDragManaged"),n=N(this.beans.gos);if(r){if(!n){S("managed row dragging is only allowed in the Client Side Row Model");return}if(o){S("managed row dragging is not possible when doing pagination");return}}const l=new Ji(()=>this.value,this.rowNode,this.column,t,i,s);return this.beans.context.createBean(l),l}setSuppressRefreshCell(t){this.suppressRefreshCell=t}getEditCompDetails(){return this.editCompDetails}onCellEditorAttached(t){this.onCellEditorAttachedFuncs.push(t)}cellEditorAttached(){this.onCellEditorAttachedFuncs.forEach(t=>t()),this.onCellEditorAttachedFuncs=[]}};Qr.DOM_DATA_KEY_CELL_CTRL="cellCtrl";var je=Qr,hc=0,Xr=class os extends v{constructor(t,i,s,o,r){var n;super(),this.allRowGuis=[],this.active=!0,this.centerCellCtrls={list:[],map:{}},this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}},this.slideInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.fadeInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.rowDragComps=[],this.lastMouseDownOnDragger=!1,this.emptyStyle={},this.updateColumnListsPending=!1,this.rowId=null,this.businessKeySanitised=null,this.beans=i,this.gos=i.gos,this.rowNode=t,this.paginationPage=((n=i.paginationService)==null?void 0:n.getCurrentPage())??0,this.useAnimationFrameForCreate=o,this.printLayout=r,this.suppressRowTransform=this.gos.get("suppressRowTransform"),this.instanceId=t.id+"-"+hc++,this.rowId=me(t.id),this.initRowBusinessKey(),this.rowFocused=i.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned),this.rowLevel=i.rowCssClassCalculator.calculateRowLevel(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 t=this.businessKeyForNodeFunc(this.rowNode);this.businessKeySanitised=me(t)}getRowId(){return this.rowId}getRowStyles(){return this.rowStyles}isSticky(){return this.rowNode.sticky}updateGui(t,i){t==="left"?this.leftGui=i:t==="right"?this.rightGui=i:t==="fullWidth"?this.fullWidthGui=i:this.centerGui=i}setComp(t,i,s,o){o=kt(this,this.beans.context,o);const r={rowComp:t,element:i,containerType:s,compBean:o};this.allRowGuis.push(r),this.updateGui(s,r),this.initialiseRowComp(r),this.rowType!=="FullWidthLoading"&&!this.rowNode.rowPinned&&this.beans.rowRenderer.dispatchFirstDataRenderedEvent()}unsetComp(t){this.allRowGuis=this.allRowGuis.filter(i=>i.containerType!==t),this.updateGui(t,void 0)}isCacheable(){return this.rowType==="FullWidthDetail"&&this.gos.get("keepDetailRows")}setCached(t){const i=t?"none":"";this.allRowGuis.forEach(s=>s.element.style.display=i)}initialiseRowComp(t){const i=this.gos;this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus")),this.listenOnDomOrder(t),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights(),this.onRowHeightChanged(t),this.updateRowIndexes(t),this.setFocusedClasses(t),this.setStylesFromGridOptions(!1,t),Xt(i)&&this.rowNode.selectable&&this.onRowSelected(t),this.updateColumnLists(!this.useAnimationFrameForCreate);const s=t.rowComp;this.getInitialRowClasses(t.containerType).forEach(r=>s.addOrRemoveCssClass(r,!0)),this.executeSlideAndFadeAnimations(t),this.rowNode.group&&ii(t.element,this.rowNode.expanded==!0),this.setRowCompRowId(s),this.setRowCompRowBusinessKey(s),Ye(i,t.element,os.DOM_DATA_KEY_ROW_CTRL,this),t.compBean.addDestroyFunc(()=>Ye(i,t.element,os.DOM_DATA_KEY_ROW_CTRL,null)),this.useAnimationFrameForCreate?this.beans.animationFrameService.createTask(this.addHoverFunctionality.bind(this,t),this.rowNode.rowIndex,"createTasksP2"):this.addHoverFunctionality(t),this.isFullWidth()&&this.setupFullWidth(t),i.get("rowDragEntireRow")&&this.addRowDraggerToRow(t),this.useAnimationFrameForCreate&&this.beans.animationFrameService.addDestroyTask(()=>{this.isAlive()&&t.rowComp.addOrRemoveCssClass("ag-after-created",!0)}),this.executeProcessRowPostCreateFunc()}setRowCompRowBusinessKey(t){this.businessKeySanitised!=null&&t.setRowBusinessKey(this.businessKeySanitised)}getBusinessKey(){return this.businessKeySanitised}setRowCompRowId(t){this.rowId=me(this.rowNode.id),this.rowId!=null&&t.setRowId(this.rowId)}executeSlideAndFadeAnimations(t){const{containerType:i}=t;this.slideInAnimation[i]&&(js(()=>{this.onTopChanged()}),this.slideInAnimation[i]=!1),this.fadeInAnimation[i]&&(js(()=>{t.rowComp.addOrRemoveCssClass("ag-opacity-zero",!1)}),this.fadeInAnimation[i]=!1)}addRowDraggerToRow(t){if(ve(this.gos)){S("Setting `rowDragEntireRow: true` in the gridOptions doesn't work with `cellSelection: true`");return}const i=this.beans.localeService.getLocaleTextFunc(),s=new Ji(()=>`1 ${i("rowDragRow","row")}`,this.rowNode,void 0,t.element,void 0,!0),o=this.createBean(s,this.beans.context);this.rowDragComps.push(o),t.compBean.addDestroyFunc(()=>{this.rowDragComps=this.rowDragComps.filter(r=>r!==o),this.destroyBean(o,this.beans.context)})}setupFullWidth(t){const i=this.getPinnedForContainer(t.containerType);if(this.rowType=="FullWidthDetail"&&!this.gos.assertModuleRegistered("@ag-grid-enterprise/master-detail","cell renderer 'agDetailCellRenderer' (for master detail)"))return;const s=this.createFullWidthCompDetails(t.element,i);t.rowComp.showFullWidth(s)}isPrintLayout(){return this.printLayout}getFullWidthCellRenderers(){var t,i;return this.gos.get("embedFullWidthRows")?this.allRowGuis.map(s=>{var o;return(o=s==null?void 0:s.rowComp)==null?void 0:o.getFullWidthCellRenderer()}):[(i=(t=this.fullWidthGui)==null?void 0:t.rowComp)==null?void 0:i.getFullWidthCellRenderer()]}getCellElement(t){const i=this.getCellCtrl(t);return i?i.getGui():null}executeProcessRowPostCreateFunc(){const t=this.gos.getCallback("processRowPostCreate");if(!t||!this.areAllContainersReady())return;const i={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)};t(i)}areAllContainersReady(){const t=!!this.leftGui||!this.beans.visibleColsService.isPinningLeft(),i=!!this.centerGui,s=!!this.rightGui||!this.beans.visibleColsService.isPinningRight();return t&&i&&s}isNodeFullWidthCell(){if(this.rowNode.detail)return!0;const t=this.beans.gos.getCallback("isFullWidthRow");return t?t({rowNode:this.rowNode}):!1}setRowType(){const t=this.rowNode.stub&&!this.gos.get("suppressServerSideFullWidthLoadingRow")&&!this.gos.get("groupHideOpenParents"),i=this.isNodeFullWidthCell(),s=this.gos.get("masterDetail")&&this.rowNode.detail,o=this.beans.columnModel.isPivotMode(),n=!!this.rowNode.group&&!this.rowNode.footer&&ui(this.gos,o);t?this.rowType="FullWidthLoading":s?this.rowType="FullWidthDetail":i?this.rowType="FullWidth":n?this.rowType="FullWidthGroup":this.rowType="Normal"}updateColumnLists(t=!1,i=!1){if(this.isFullWidth())return;if(t||this.gos.get("suppressAnimationFrame")||this.printLayout){this.updateColumnListsImpl(i);return}this.updateColumnListsPending||(this.beans.animationFrameService.createTask(()=>{this.active&&this.updateColumnListsImpl(!0)},this.rowNode.rowIndex,"createTasksP1"),this.updateColumnListsPending=!0)}createCellCtrls(t,i,s=null){const o={list:[],map:{}},r=(n,l)=>{o.list.push(l),o.map[n]=l};return i.forEach(n=>{const l=n.getInstanceId();let a=t.map[l];a||(a=new je(n,this.rowNode,this.beans,this)),r(l,a)}),t.list.forEach(n=>{const l=n.getColumn().getInstanceId();if(o.map[l]!=null)return;if(!this.isCellEligibleToBeRemoved(n,s)){r(l,n);return}n.destroy()}),o}updateColumnListsImpl(t){this.updateColumnListsPending=!1,this.createAllCellCtrls(),this.setCellCtrls(t)}setCellCtrls(t){this.allRowGuis.forEach(i=>{const s=this.getCellCtrlsForContainer(i.containerType);i.rowComp.setCellCtrls(s,t)})}getCellCtrlsForContainer(t){switch(t){case"left":return this.leftCellCtrls.list;case"right":return this.rightCellCtrls.list;case"fullWidth":return[];case"center":return this.centerCellCtrls.list}}createAllCellCtrls(){const t=this.beans.columnViewportService,i=this.beans.visibleColsService;if(this.printLayout)this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,i.getAllCols()),this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}};else{const s=t.getColsWithinViewport(this.rowNode);this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,s);const o=i.getLeftColsForRow(this.rowNode);this.leftCellCtrls=this.createCellCtrls(this.leftCellCtrls,o,"left");const r=i.getRightColsForRow(this.rowNode);this.rightCellCtrls=this.createCellCtrls(this.rightCellCtrls,r,"right")}}isCellEligibleToBeRemoved(t,i){if(t.getColumn().getPinned()!=i)return!0;const n=t.isEditing(),l=this.beans.focusService.isCellFocused(t.getCellPosition());if(n||l){const d=t.getColumn();return!(this.beans.visibleColsService.getAllCols().indexOf(d)>=0)}return!0}getDomOrder(){return this.gos.get("ensureDomOrder")||z(this.gos,"print")}listenOnDomOrder(t){const i=()=>{t.rowComp.setDomOrder(this.getDomOrder())};t.compBean.addManagedPropertyListeners(["domLayout","ensureDomOrder"],i)}setAnimateFlags(t){if(this.isSticky()||!t)return;const i=F(this.rowNode.oldRowTop),s=this.beans.visibleColsService.isPinningLeft(),o=this.beans.visibleColsService.isPinningRight();if(i){if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows")){this.slideInAnimation.fullWidth=!0;return}this.slideInAnimation.center=!0,this.slideInAnimation.left=s,this.slideInAnimation.right=o}else{if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows")){this.fadeInAnimation.fullWidth=!0;return}this.fadeInAnimation.center=!0,this.fadeInAnimation.left=s,this.fadeInAnimation.right=o}}isEditing(){return this.editingRow}isFullWidth(){return this.rowType!=="Normal"}refreshFullWidth(){const t=(l,a)=>l?l.rowComp.refreshFullWidth(()=>this.createFullWidthCompDetails(l.element,a).params):!0,i=t(this.fullWidthGui,null),s=t(this.centerGui,null),o=t(this.leftGui,"left"),r=t(this.rightGui,"right");return i&&s&&o&&r}addListeners(){this.addManagedListeners(this.rowNode,{heightChanged:()=>this.onRowHeightChanged(),rowSelected:()=>this.onRowSelected(),rowIndexChanged:this.onRowIndexChanged.bind(this),topChanged:this.onTopChanged.bind(this),expandedChanged:this.updateExpandedCss.bind(this),hasChildrenChanged:this.updateExpandedCss.bind(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.eventService,{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.addDestroyFunc(()=>{this.rowDragComps=this.destroyBeans(this.rowDragComps,this.beans.context),this.tooltipFeature&&(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(i=>{this.addRowDraggerToRow(i)});return}this.rowDragComps=this.destroyBeans(this.rowDragComps,this.beans.context)}),this.addListenersForCellComps()}addListenersForCellComps(){this.addManagedListeners(this.rowNode,{rowIndexChanged:()=>{this.getAllCellCtrls().forEach(t=>t.onRowIndexChanged())},cellChanged:t=>{this.getAllCellCtrls().forEach(i=>i.onCellChanged(t))}})}onRowNodeDataChanged(t){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:!t.update,newData:!t.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 t=this.rowNode.highlighted;this.allRowGuis.forEach(i=>{const s=t===0,o=t===1;i.rowComp.addOrRemoveCssClass("ag-row-highlight-above",s),i.rowComp.addOrRemoveCssClass("ag-row-highlight-below",o)})}postProcessRowDragging(){const t=this.rowNode.dragging;this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass("ag-row-dragging",t))}updateExpandedCss(){const t=this.rowNode.isExpandable(),i=this.rowNode.expanded==!0;this.allRowGuis.forEach(s=>{s.rowComp.addOrRemoveCssClass("ag-row-group",t),s.rowComp.addOrRemoveCssClass("ag-row-group-expanded",t&&i),s.rowComp.addOrRemoveCssClass("ag-row-group-contracted",t&&!i),ii(s.element,t&&i)})}onDisplayedColumnsChanged(){this.updateColumnLists(!0),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights()}onVirtualColumnsChanged(){this.updateColumnLists(!1,!0)}getRowPosition(){return{rowPinned:Re(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}}findFullWidthRowGui(t){return this.allRowGuis.find(i=>i.element.contains(t))}onKeyboardNavigate(t){const i=this.findFullWidthRowGui(t.target);if(!((i?i.element:null)===t.target))return;const r=this.rowNode,n=this.beans.focusService.getFocusedCell(),l={rowIndex:r.rowIndex,rowPinned:r.rowPinned,column:(n==null?void 0:n.column)??this.getColumnForFullWidth(i)};this.beans.navigationService.navigateToNextCell(t,t.key,l,!0),t.preventDefault()}onTabKeyDown(t){if(t.defaultPrevented||Fe(t))return;const i=this.allRowGuis.find(a=>a.element.contains(t.target)),s=i?i.element:null,o=s===t.target,r=V(this.gos);let n=!1;s&&r&&(n=s.contains(r)&&r.classList.contains("ag-cell"));let l=null;!o&&!n&&(l=this.beans.focusService.findNextFocusableElement(s,!1,t.shiftKey)),(this.isFullWidth()&&o||!l)&&this.beans.navigationService.onTabKeyDown(this,t)}getFullWidthElement(){return this.fullWidthGui?this.fullWidthGui.element:null}getRowYPosition(){var i;const t=(i=this.allRowGuis.find(s=>ue(s.element)))==null?void 0:i.element;return t?t.getBoundingClientRect().top:0}onSuppressCellFocusChanged(t){const i=this.isFullWidth()&&t?void 0:-1;this.allRowGuis.forEach(s=>{ae(s.element,"tabindex",i)})}onFullWidthRowFocused(t){var r;const i=this.rowNode,s=t?this.isFullWidth()&&t.rowIndex===i.rowIndex&&t.rowPinned==i.rowPinned:!1,o=this.fullWidthGui?this.fullWidthGui.element:(r=this.centerGui)==null?void 0:r.element;o&&(o.classList.toggle("ag-full-width-focus",s),s&&(t!=null&&t.forceBrowserFocus)&&o.focus({preventScroll:!0}))}recreateCell(t){this.centerCellCtrls=this.removeCellCtrl(this.centerCellCtrls,t),this.leftCellCtrls=this.removeCellCtrl(this.leftCellCtrls,t),this.rightCellCtrls=this.removeCellCtrl(this.rightCellCtrls,t),t.destroy(),this.updateColumnLists()}removeCellCtrl(t,i){const s={list:[],map:{}};return t.list.forEach(o=>{o!==i&&(s.list.push(o),s.map[o.getColumn().getInstanceId()]=o)}),s}onMouseEvent(t,i){switch(t){case"dblclick":this.onRowDblClick(i);break;case"click":this.onRowClick(i);break;case"touchstart":case"mousedown":this.onRowMouseDown(i);break}}createRowEvent(t,i){return this.gos.addGridCommonParams({type:t,node:this.rowNode,data:this.rowNode.data,rowIndex:this.rowNode.rowIndex,rowPinned:this.rowNode.rowPinned,event:i})}createRowEventWithSource(t,i){const s=this.createRowEvent(t,i);return s.source=this,s}onRowDblClick(t){Fe(t)||this.beans.eventService.dispatchEvent(this.createRowEventWithSource("rowDoubleClicked",t))}getColumnForFullWidth(t){const{visibleColsService:i}=this.beans;switch(t==null?void 0:t.containerType){case"center":return i.getCenterCols()[0];case"left":return i.getLeftCols()[0];case"right":return i.getRightCols()[0];default:return i.getAllCols()[0]}}onRowMouseDown(t){if(this.lastMouseDownOnDragger=rt(t.target,"ag-row-drag",3),!this.isFullWidth())return;const i=this.rowNode;this.beans.rangeService&&this.beans.rangeService.removeAllCellRanges();const s=this.findFullWidthRowGui(t.target),o=s==null?void 0:s.element,r=t.target;let n=!0;o&&o.contains(r)&&ws(r)&&(n=!1),this.beans.focusService.setFocusedCell({rowIndex:i.rowIndex,column:this.getColumnForFullWidth(s),rowPinned:i.rowPinned,forceBrowserFocus:n})}onRowClick(t){if(Fe(t)||this.lastMouseDownOnDragger)return;const{gos:s}=this;this.beans.eventService.dispatchEvent(this.createRowEventWithSource("rowClicked",t));const o=t.ctrlKey||t.metaKey,r=t.shiftKey,n=this.rowNode.isSelected(),l=Qe(s),a=Qs(s),d=Kn(s);if(l&&this.rowNode.group||this.isRowSelectionBlocked()||!d&&!n||!a&&n)return;const h=$n(s),c="rowClicked";if(n)h?this.rowNode.setSelectedParams({newValue:!1,event:t,source:c}):o?a&&this.rowNode.setSelectedParams({newValue:!1,event:t,source:c}):d&&this.rowNode.setSelectedParams({newValue:!0,clearSelection:!r,rangeSelect:r,event:t,source:c});else{const u=h?!1:!o;this.rowNode.setSelectedParams({newValue:!0,clearSelection:u,rangeSelect:r,event:t,source:c})}}isRowSelectionBlocked(){return!this.rowNode.selectable||!!this.rowNode.rowPinned||!Xt(this.gos)}setupDetailRowAutoHeight(t){if(this.rowType!=="FullWidthDetail"||!this.gos.get("detailRowAutoHeight"))return;const i=()=>{const o=t.clientHeight;if(o!=null&&o>0){const r=()=>{this.rowNode.setRowHeight(o),(N(this.gos)||De(this.gos))&&this.beans.rowModel.onRowHeightChanged()};window.setTimeout(r,0)}},s=this.beans.resizeObserverService.observeResize(t,i);this.addDestroyFunc(s),i()}createFullWidthCompDetails(t,i){const{gos:s,rowNode:o}=this,r=s.addGridCommonParams({fullWidth:!0,data:o.data,node:o,value:o.key,valueFormatted:o.key,eGridCell:t,eParentOfValue:t,pinned:i,addRenderedRowListener:this.addEventListener.bind(this),registerRowDragger:(l,a,d,h)=>this.addFullWidthRowDragging(l,a,d,h),setTooltip:(l,a)=>this.refreshRowTooltip(l,a)}),n=this.beans.userComponentFactory;switch(this.rowType){case"FullWidthDetail":return n.getFullWidthDetailCellRendererDetails(r);case"FullWidthGroup":return n.getFullWidthGroupCellRendererDetails(r);case"FullWidthLoading":return n.getFullWidthLoadingCellRendererDetails(r);default:return n.getFullWidthCellRendererDetails(r)}}refreshRowTooltip(t,i){if(!this.fullWidthGui)return;const s={getGui:()=>this.fullWidthGui.element,getTooltipValue:()=>t,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:i};this.tooltipFeature&&this.destroyBean(this.tooltipFeature,this.beans.context),this.tooltipFeature=this.createBean(new gt(s,this.beans))}addFullWidthRowDragging(t,i,s="",o){if(!this.isFullWidth())return;const r=new Ji(()=>s,this.rowNode,void 0,t,i,o);this.createBean(r,this.beans.context),this.addDestroyFunc(()=>{this.destroyBean(r,this.beans.context)})}onUiLevelChanged(){const t=this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode);if(this.rowLevel!=t){const i="ag-row-level-"+t,s="ag-row-level-"+this.rowLevel;this.allRowGuis.forEach(o=>{o.rowComp.addOrRemoveCssClass(i,!0),o.rowComp.addOrRemoveCssClass(s,!1)})}this.rowLevel=t}isFirstRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBoundsService.getFirstRow()}isLastRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBoundsService.getLastRow()}refreshFirstAndLastRowStyles(){const t=this.isFirstRowOnPage(),i=this.isLastRowOnPage();this.firstRowOnPage!==t&&(this.firstRowOnPage=t,this.allRowGuis.forEach(s=>s.rowComp.addOrRemoveCssClass("ag-row-first",t))),this.lastRowOnPage!==i&&(this.lastRowOnPage=i,this.allRowGuis.forEach(s=>s.rowComp.addOrRemoveCssClass("ag-row-last",i)))}stopEditing(t=!1){var i;this.stoppingRowEdit||(i=this.beans.rowEditService)==null||i.stopEditing(this,t)}setInlineEditingCss(){const t=this.editingRow||this.getAllCellCtrls().some(i=>i.isEditing());this.allRowGuis.forEach(i=>{i.rowComp.addOrRemoveCssClass("ag-row-inline-editing",t),i.rowComp.addOrRemoveCssClass("ag-row-not-inline-editing",!t)})}setEditingRow(t){this.editingRow=t}startRowEditing(t=null,i=null,s=null){var o;return this.editingRow?!0:((o=this.beans.rowEditService)==null?void 0:o.startEditing(this,t,i,s))??!0}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 t=this.beans.rowCssClassCalculator.processClassesFromGridOptions(this.rowNode);!t||!t.length||t.forEach(i=>{this.allRowGuis.forEach(s=>s.rowComp.addOrRemoveCssClass(i,!0))})}postProcessRowClassRules(){this.beans.rowCssClassCalculator.processRowClassRules(this.rowNode,t=>{this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass(t,!0))},t=>{this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass(t,!1))})}setStylesFromGridOptions(t,i){t&&(this.rowStyles=this.processStylesFromGridOptions()),this.forEachGui(i,s=>s.rowComp.setUserStyles(this.rowStyles))}getPinnedForContainer(t){return t==="left"||t==="right"?t:null}getInitialRowClasses(t){const i=this.getPinnedForContainer(t),s={rowNode:this.rowNode,rowFocused:this.rowFocused,fadeRowIn:this.fadeInAnimation[t],rowIsEven:this.rowNode.rowIndex%2===0,rowLevel:this.rowLevel,fullWidthRow:this.isFullWidth(),firstRowOnPage:this.isFirstRowOnPage(),lastRowOnPage:this.isLastRowOnPage(),printLayout:this.printLayout,expandable:this.rowNode.isExpandable(),pinned:i};return this.beans.rowCssClassCalculator.getInitialRowClasses(s)}processStylesFromGridOptions(){const t=this.gos.get("rowStyle");if(t&&typeof t=="function"){S("rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead");return}const i=this.gos.getCallback("getRowStyle");let s;if(i){const o={data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex};s=i(o)}return s||t?Object.assign({},t,s):this.emptyStyle}onRowSelected(t){const i=!!this.rowNode.isSelected();this.forEachGui(t,s=>{s.rowComp.addOrRemoveCssClass("ag-row-selected",i),si(s.element,i),s.element.contains(V(this.gos))&&(s===this.centerGui||s===this.fullWidthGui)&&this.announceDescription()})}announceDescription(){if(this.isRowSelectionBlocked())return;const t=this.rowNode.isSelected();if(t&&!Qs(this.gos))return;const s=this.beans.localeService.getLocaleTextFunc()(t?"ariaRowDeselect":"ariaRowSelect",`Press SPACE to ${t?"deselect":"select"} this row.`);this.beans.ariaAnnouncementService.announceValue(s,"rowSelection")}addHoverFunctionality(t){if(!this.active)return;const{element:i,compBean:s}=t,{rowNode:o,beans:r,gos:n}=this;s.addManagedListeners(i,{mouseenter:()=>o.onMouseEnter(),mouseleave:()=>o.onMouseLeave()}),s.addManagedListeners(o,{mouseEnter:()=>{!r.dragService.isDragging()&&!n.get("suppressRowHoverHighlight")&&(i.classList.add("ag-row-hover"),o.setHovered(!0))},mouseLeave:()=>{i.classList.remove("ag-row-hover"),o.setHovered(!1)}})}roundRowTopToBounds(t){const i=this.beans.ctrlsService.getGridBodyCtrl().getScrollFeature().getApproximateVScollPosition(),s=this.applyPaginationOffset(i.top,!0)-100,o=this.applyPaginationOffset(i.bottom,!0)+100;return Math.min(Math.max(s,t),o)}getFrameworkOverrides(){return this.beans.frameworkOverrides}forEachGui(t,i){t?i(t):this.allRowGuis.forEach(i)}onRowHeightChanged(t){if(this.rowNode.rowHeight==null)return;const i=this.rowNode.rowHeight,s=this.beans.environment.getDefaultRowHeight(),r=Mo(this.gos)?Le(this.gos,this.rowNode).height:void 0,n=r?`${Math.min(s,r)-2}px`:void 0;this.forEachGui(t,l=>{l.element.style.height=`${i}px`,n&&l.element.style.setProperty("--ag-line-height",n)})}addEventListener(t,i){super.addEventListener(t,i)}removeEventListener(t,i){super.removeEventListener(t,i)}destroyFirstPass(t=!1){if(this.active=!1,!t&&ot(this.gos)&&!this.isSticky())if(this.rowNode.rowTop!=null){const o=this.roundRowTopToBounds(this.rowNode.rowTop);this.setRowTop(o)}else this.allRowGuis.forEach(o=>o.rowComp.addOrRemoveCssClass("ag-opacity-zero",!0));this.rowNode.setHovered(!1);const i=this.createRowEvent("virtualRowRemoved");this.dispatchLocalEvent(i),this.beans.eventService.dispatchEvent(i),super.destroy()}destroySecondPass(){this.allRowGuis.length=0,this.stopEditing();const t=i=>(i.list.forEach(s=>s.destroy()),{list:[],map:{}});this.centerCellCtrls=t(this.centerCellCtrls),this.leftCellCtrls=t(this.leftCellCtrls),this.rightCellCtrls=t(this.rightCellCtrls)}setFocusedClasses(t){this.forEachGui(t,i=>{i.rowComp.addOrRemoveCssClass("ag-row-focus",this.rowFocused),i.rowComp.addOrRemoveCssClass("ag-row-no-focus",!this.rowFocused)})}onCellFocusChanged(){const t=this.beans.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);t!==this.rowFocused&&(this.rowFocused=t,this.setFocusedClasses()),!t&&this.editingRow&&this.stopEditing(!1)}onPaginationChanged(){var i;const t=((i=this.beans.paginationService)==null?void 0:i.getCurrentPage())??0;this.paginationPage!==t&&(this.paginationPage=t,this.onTopChanged()),this.refreshFirstAndLastRowStyles()}onTopChanged(){this.setRowTop(this.rowNode.rowTop)}onPaginationPixelOffsetChanged(){this.onTopChanged()}applyPaginationOffset(t,i=!1){if(this.rowNode.isRowPinned()||this.rowNode.sticky)return t;const s=this.beans.pageBoundsService.getPixelOffset();return t+s*(i?1:-1)}setRowTop(t){if(!this.printLayout&&F(t)){const i=this.applyPaginationOffset(t),r=`${this.rowNode.isRowPinned()||this.rowNode.sticky?i:this.beans.rowContainerHeightService.getRealPixelPosition(i)}px`;this.setRowTopStyle(r)}}getInitialRowTop(t){return this.suppressRowTransform?this.getInitialRowTopShared(t):void 0}getInitialTransform(t){return this.suppressRowTransform?void 0:`translateY(${this.getInitialRowTopShared(t)})`}getInitialRowTopShared(t){if(this.printLayout)return"";const i=this.rowNode;let s;if(this.isSticky())s=i.stickyRowTop;else{const o=this.slideInAnimation[t]?this.roundRowTopToBounds(i.oldRowTop):i.rowTop,r=this.applyPaginationOffset(o);s=i.isRowPinned()?r:this.beans.rowContainerHeightService.getRealPixelPosition(r)}return s+"px"}setRowTopStyle(t){this.allRowGuis.forEach(i=>this.suppressRowTransform?i.rowComp.setTop(t):i.rowComp.setTransform(`translateY(${t})`))}getRowNode(){return this.rowNode}getCellCtrl(t){let i=null;return this.getAllCellCtrls().forEach(s=>{s.getColumn()==t&&(i=s)}),i!=null||this.getAllCellCtrls().forEach(s=>{s.getColSpanningList().indexOf(t)>=0&&(i=s)}),i}onRowIndexChanged(){this.rowNode.rowIndex!=null&&(this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss())}getRowIndex(){return this.rowNode.getRowIndexString()}updateRowIndexes(t){var n;const i=this.rowNode.getRowIndexString();if(i===null)return;const s=this.beans.headerNavigationService.getHeaderRowCount()+(((n=this.beans.filterManager)==null?void 0:n.getHeaderRowCount())??0),o=this.rowNode.rowIndex%2===0,r=s+this.rowNode.rowIndex+1;this.forEachGui(t,l=>{l.rowComp.setRowIndex(i),l.rowComp.addOrRemoveCssClass("ag-row-even",o),l.rowComp.addOrRemoveCssClass("ag-row-odd",!o),Qo(l.element,r)})}setStoppingRowEdit(t){this.stoppingRowEdit=t}};Xr.DOM_DATA_KEY_ROW_CTRL="renderedRow";var qe=Xr,cc=class extends v{wireBeans(e){this.mouseEventService=e.mouseEventService,this.valueService=e.valueService,this.menuService=e.menuService,this.ctrlsService=e.ctrlsService,this.navigationService=e.navigationService,this.focusService=e.focusService,this.undoRedoService=e.undoRedoService,this.visibleColsService=e.visibleColsService,this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel,this.rangeService=e.rangeService,this.clipboardService=e.clipboardService}constructor(e){super(),this.element=e}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.mockContextMenuForIPad()}addKeyboardListeners(){const e="keydown",t=this.processKeyboardEvent.bind(this,e);this.addManagedElementListeners(this.element,{[e]:t})}addMouseListeners(){["dblclick","contextmenu","mouseover","mouseout","click",Vo("touchstart")?"touchstart":"mousedown"].forEach(i=>{const s=this.processMouseEvent.bind(this,i);this.addManagedElementListeners(this.element,{[i]:s})})}processMouseEvent(e,t){if(!this.mouseEventService.isEventFromThisGrid(t)||Fe(t))return;const i=this.getRowForEvent(t),s=this.mouseEventService.getRenderedCellForEvent(t);e==="contextmenu"?this.handleContextMenuMouseEvent(t,void 0,i,s):(s&&s.onMouseEvent(e,t),i&&i.onMouseEvent(e,t))}mockContextMenuForIPad(){if(!He())return;const e=new Ie(this.element),t=i=>{const s=this.getRowForEvent(i.touchEvent),o=this.mouseEventService.getRenderedCellForEvent(i.touchEvent);this.handleContextMenuMouseEvent(void 0,i.touchEvent,s,o)};this.addManagedListeners(e,{longTap:t}),this.addDestroyFunc(()=>e.destroy())}getRowForEvent(e){let t=e.target;for(;t;){const i=xt(this.gos,t,qe.DOM_DATA_KEY_ROW_CTRL);if(i)return i;t=t.parentElement}return null}handleContextMenuMouseEvent(e,t,i,s){const o=i?i.getRowNode():null,r=s?s.getColumn():null;let n=null;if(r){const d=e||t;s.dispatchCellContextMenuEvent(d??null),n=this.valueService.getValue(r,o)}const l=this.ctrlsService.getGridBodyCtrl(),a=s?s.getGui():l.getGridBodyElement();this.menuService.showContextMenu({mouseEvent:e,touchEvent:t,rowNode:o,column:r,value:n,anchorToElement:a})}getControlsForEventTarget(e){return{cellCtrl:zi(this.gos,e,je.DOM_DATA_KEY_CELL_CTRL),rowCtrl:zi(this.gos,e,qe.DOM_DATA_KEY_ROW_CTRL)}}processKeyboardEvent(e,t){const{cellCtrl:i,rowCtrl:s}=this.getControlsForEventTarget(t.target);t.defaultPrevented||(i?this.processCellKeyboardEvent(i,e,t):s&&s.isFullWidth()&&this.processFullWidthRowKeyboardEvent(s,e,t))}processCellKeyboardEvent(e,t,i){const s=e.getRowNode(),o=e.getColumn(),r=e.isEditing();!Zi(this.gos,i,s,o,r)&&t==="keydown"&&(!r&&this.navigationService.handlePageScrollingKey(i)||e.onKeyDown(i),this.doGridOperations(i,e.isEditing()),Mr(i)&&e.processCharacter(i)),t==="keydown"&&this.eventService.dispatchEvent(e.createEvent(i,"cellKeyDown"))}processFullWidthRowKeyboardEvent(e,t,i){const s=e.getRowNode(),o=this.focusService.getFocusedCell(),r=o&&o.column;if(!Zi(this.gos,i,s,r,!1)){const l=i.key;if(t==="keydown")switch(l){case m.PAGE_HOME:case m.PAGE_END:case m.PAGE_UP:case m.PAGE_DOWN:this.navigationService.handlePageScrollingKey(i,!0);break;case m.UP:case m.DOWN:e.onKeyboardNavigate(i);break;case m.TAB:e.onTabKeyDown(i);break}}t==="keydown"&&this.eventService.dispatchEvent(e.createRowEvent("cellKeyDown",i))}doGridOperations(e,t){if(!e.ctrlKey&&!e.metaKey||t||!this.mouseEventService.isEventFromThisGrid(e))return;const i=cd(e);if(i===m.A)return this.onCtrlAndA(e);if(i===m.C)return this.onCtrlAndC(e);if(i===m.D)return this.onCtrlAndD(e);if(i===m.V)return this.onCtrlAndV(e);if(i===m.X)return this.onCtrlAndX(e);if(i===m.Y)return this.onCtrlAndY();if(i===m.Z)return this.onCtrlAndZ(e)}onCtrlAndA(e){const{pinnedRowModel:t,rowModel:i,rangeService:s}=this;if(s&&i.isRowsToRender()){const[o,r]=[t.isEmpty("top"),t.isEmpty("bottom")],n=o?null:"top";let l,a;r?(l=null,a=i.getRowCount()-1):(l="bottom",a=t.getPinnedBottomRowCount()-1);const d=this.visibleColsService.getAllCols();if(se(d))return;s.setCellRange({rowStartIndex:0,rowStartPinned:n,rowEndIndex:a,rowEndPinned:l,columnStart:d[0],columnEnd:I(d)})}e.preventDefault()}onCtrlAndC(e){if(!this.clipboardService||this.gos.get("enableCellTextSelection"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);t!=null&&t.isEditing()||i!=null&&i.isEditing()||(e.preventDefault(),this.clipboardService.copyToClipboard())}onCtrlAndX(e){if(!this.clipboardService||this.gos.get("enableCellTextSelection")||this.gos.get("suppressCutToClipboard"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);t!=null&&t.isEditing()||i!=null&&i.isEditing()||(e.preventDefault(),this.clipboardService.cutToClipboard(void 0,"ui"))}onCtrlAndV(e){const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);t!=null&&t.isEditing()||i!=null&&i.isEditing()||this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.pasteFromClipboard()}onCtrlAndD(e){this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.copyRangeDown(),e.preventDefault()}onCtrlAndZ(e){!this.gos.get("undoRedoCellEditing")||!this.undoRedoService||(e.preventDefault(),e.shiftKey?this.undoRedoService.redo("ui"):this.undoRedoService.undo("ui"))}onCtrlAndY(){var e;(e=this.undoRedoService)==null||e.redo("ui")}},uc=class extends v{wireBeans(e){this.pinnedWidthService=e.pinnedWidthService}constructor(e){super(),this.element=e}postConstruct(){this.addManagedEventListeners({leftPinnedWidthChanged:this.onPinnedLeftWidthChanged.bind(this)})}onPinnedLeftWidthChanged(){const e=this.pinnedWidthService.getPinnedLeftWidth(),t=e>0;H(this.element,t),ce(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedLeftWidth()}},gc=class extends v{wireBeans(e){this.pinnedWidthService=e.pinnedWidthService}constructor(e){super(),this.element=e}postConstruct(){this.addManagedEventListeners({rightPinnedWidthChanged:this.onPinnedRightWidthChanged.bind(this)})}onPinnedRightWidthChanged(){const e=this.pinnedWidthService.getPinnedRightWidth(),t=e>0;H(this.element,t),ce(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedRightWidth()}},zt=e=>e.getTopRowCtrls(),_t=e=>e.getStickyTopRowCtrls(),Ut=e=>e.getStickyBottomRowCtrls(),Kt=e=>e.getBottomRowCtrls(),$t=e=>e.getCentreRowCtrls(),pc={center:{type:"center",container:"ag-center-cols-container",viewport:"ag-center-cols-viewport",getRowCtrls:$t},left:{type:"left",container:"ag-pinned-left-cols-container",pinnedType:"left",getRowCtrls:$t},right:{type:"right",container:"ag-pinned-right-cols-container",pinnedType:"right",getRowCtrls:$t},fullWidth:{type:"fullWidth",container:"ag-full-width-container",fullWidth:!0,getRowCtrls:$t},topCenter:{type:"center",container:"ag-floating-top-container",viewport:"ag-floating-top-viewport",getRowCtrls:zt},topLeft:{type:"left",container:"ag-pinned-left-floating-top",pinnedType:"left",getRowCtrls:zt},topRight:{type:"right",container:"ag-pinned-right-floating-top",pinnedType:"right",getRowCtrls:zt},topFullWidth:{type:"fullWidth",container:"ag-floating-top-full-width-container",fullWidth:!0,getRowCtrls:zt},stickyTopCenter:{type:"center",container:"ag-sticky-top-container",viewport:"ag-sticky-top-viewport",getRowCtrls:_t},stickyTopLeft:{type:"left",container:"ag-pinned-left-sticky-top",pinnedType:"left",getRowCtrls:_t},stickyTopRight:{type:"right",container:"ag-pinned-right-sticky-top",pinnedType:"right",getRowCtrls:_t},stickyTopFullWidth:{type:"fullWidth",container:"ag-sticky-top-full-width-container",fullWidth:!0,getRowCtrls:_t},stickyBottomCenter:{type:"center",container:"ag-sticky-bottom-container",viewport:"ag-sticky-bottom-viewport",getRowCtrls:Ut},stickyBottomLeft:{type:"left",container:"ag-pinned-left-sticky-bottom",pinnedType:"left",getRowCtrls:Ut},stickyBottomRight:{type:"right",container:"ag-pinned-right-sticky-bottom",pinnedType:"right",getRowCtrls:Ut},stickyBottomFullWidth:{type:"fullWidth",container:"ag-sticky-bottom-full-width-container",fullWidth:!0,getRowCtrls:Ut},bottomCenter:{type:"center",container:"ag-floating-bottom-container",viewport:"ag-floating-bottom-viewport",getRowCtrls:Kt},bottomLeft:{type:"left",container:"ag-pinned-left-floating-bottom",pinnedType:"left",getRowCtrls:Kt},bottomRight:{type:"right",container:"ag-pinned-right-floating-bottom",pinnedType:"right",getRowCtrls:Kt},bottomFullWidth:{type:"fullWidth",container:"ag-floating-bottom-full-width-container",fullWidth:!0,getRowCtrls:Kt}};function st(e){return pc[e]}var fc=["topCenter","topLeft","topRight"],Cc=["bottomCenter","bottomLeft","bottomRight"],mc=["center","left","right"],vc=["center","left","right","fullWidth"],wc=["stickyTopCenter","stickyBottomCenter","center","topCenter","bottomCenter"],Sc=["left","bottomLeft","topLeft","stickyTopLeft","stickyBottomLeft"],yc=["right","bottomRight","topRight","stickyTopRight","stickyBottomRight"],Jr=["stickyTopCenter","stickyTopLeft","stickyTopRight"],Zr=["stickyBottomCenter","stickyBottomLeft","stickyBottomRight"],Rc=[...Jr,"stickyTopFullWidth",...Zr,"stickyBottomFullWidth"],Fc=[...fc,...Cc,...mc,...Jr,...Zr],bc=class extends v{constructor(e){super(),this.visible=!0,this.EMPTY_CTRLS=[],this.name=e,this.options=st(e)}wireBeans(e){this.dragService=e.dragService,this.ctrlsService=e.ctrlsService,this.columnViewportService=e.columnViewportService,this.resizeObserverService=e.resizeObserverService,this.rowRenderer=e.rowRenderer}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.forContainers(["center"],()=>{this.viewportSizeFeature=this.createManagedBean(new Hh(this)),this.addManagedEventListeners({stickyTopOffsetChanged:this.onStickyTopOffsetChanged.bind(this)})})}onStickyTopOffsetChanged(e){this.comp.setOffsetTop(`${e.offset}px`)}registerWithCtrlsService(){this.options.fullWidth||this.ctrlsService.register(this.name,this)}forContainers(e,t){e.indexOf(this.name)>=0&&t()}getContainerElement(){return this.eContainer}getViewportSizeFeature(){return this.viewportSizeFeature}setComp(e,t,i){this.comp=e,this.eContainer=t,this.eViewport=i,this.createManagedBean(new cc(this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder();const s=()=>this.onPinnedWidthChanged();this.forContainers(Sc,()=>{this.pinnedWidthFeature=this.createManagedBean(new uc(this.eContainer)),this.addManagedEventListeners({leftPinnedWidthChanged:s})}),this.forContainers(yc,()=>{this.pinnedWidthFeature=this.createManagedBean(new gc(this.eContainer)),this.addManagedEventListeners({rightPinnedWidthChanged:s})}),this.forContainers(vc,()=>this.createManagedBean(new Yr(this.eContainer,this.name==="center"?i:void 0))),this.forContainers(Fc,()=>this.createManagedBean(new Vh(this.eContainer))),this.forContainers(wc,()=>this.createManagedBean(new ks(o=>this.comp.setContainerWidth(`${o}px`)))),this.visible=this.isContainerVisible(),this.addListeners(),this.registerWithCtrlsService()}onScrollCallback(e){this.addManagedElementListeners(this.getViewportElement(),{scroll:e})}addListeners(){this.addManagedEventListeners({displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this),displayedRowsChanged:e=>this.onDisplayedRowsChanged(e.afterScroll)}),this.onDisplayedColumnsChanged(),this.onDisplayedColumnsWidthChanged(),this.onDisplayedRowsChanged()}listenOnDomOrder(){if(Rc.indexOf(this.name)>=0){this.comp.setDomOrder(!0);return}const t=()=>{const i=this.gos.get("ensureDomOrder"),s=z(this.gos,"print");this.comp.setDomOrder(i||s)};this.addManagedPropertyListener("domLayout",t),t()}onDisplayedColumnsChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}onDisplayedColumnsWidthChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}addPreventScrollWhileDragging(){const e=t=>{this.dragService.isDragging()&&t.cancelable&&t.preventDefault()};this.eContainer.addEventListener("touchmove",e,{passive:!1}),this.addDestroyFunc(()=>this.eContainer.removeEventListener("touchmove",e))}onHorizontalViewportChanged(e=!1){const t=this.getCenterWidth(),i=this.getCenterViewportScrollLeft();this.columnViewportService.setScrollPosition(t,i,e)}hasHorizontalScrollGap(){return this.eContainer.clientWidth-this.eViewport.clientWidth<0}hasVerticalScrollGap(){return this.eContainer.clientHeight-this.eViewport.clientHeight<0}getCenterWidth(){return Ht(this.eViewport)}getCenterViewportScrollLeft(){return ni(this.eViewport,this.enableRtl)}registerViewportResizeListener(e){const t=this.resizeObserverService.observeResize(this.eViewport,e);this.addDestroyFunc(()=>t())}isViewportInTheDOMTree(){return rr(this.eViewport)}getViewportScrollLeft(){return ni(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){return this.gos.get("alwaysShowHorizontalScroll")||jl(this.eViewport)}getViewportElement(){return this.eViewport}setHorizontalScroll(e){this.comp.setHorizontalScroll(e)}getHScrollPosition(){return{left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth}}setCenterViewportScrollLeft(e){li(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.rowRenderer);if(!this.visible||t.length===0){this.comp.setRowCtrls({rowCtrls:this.EMPTY_CTRLS});return}const i=z(this.gos,"print"),o=this.gos.get("embedFullWidthRows")||i,r=t.filter(n=>{const l=n.isFullWidth();return this.options.fullWidth?!o&&l:o||!l});this.comp.setRowCtrls({rowCtrls:r,useFlushSync:e})}},en="ag-force-vertical-scroll",Pc="ag-selectable",Dc="ag-column-moving",Ec=class extends v{constructor(){super(...arguments),this.stickyTopHeight=0,this.stickyBottomHeight=0}wireBeans(e){this.animationFrameService=e.animationFrameService,this.rowContainerHeightService=e.rowContainerHeightService,this.ctrlsService=e.ctrlsService,this.columnModel=e.columnModel,this.columnSizeService=e.columnSizeService,this.scrollVisibleService=e.scrollVisibleService,this.menuService=e.menuService,this.headerNavigationService=e.headerNavigationService,this.dragAndDropService=e.dragAndDropService,this.pinnedRowModel=e.pinnedRowModel,this.rowRenderer=e.rowRenderer,this.popupService=e.popupService,this.mouseEventService=e.mouseEventService,this.rowModel=e.rowModel,this.filterManager=e.filterManager,this.environment=e.environment}getScrollFeature(){return this.bodyScrollFeature}getBodyViewportElement(){return this.eBodyViewport}setComp(e,t,i,s,o,r,n){var l;this.comp=e,this.eGridBody=t,this.eBodyViewport=i,this.eTop=s,this.eBottom=o,this.eStickyTop=r,this.eStickyBottom=n,this.eCenterColsViewport=i.querySelector(`.${st("center").viewport}`),this.eFullWidthContainer=i.querySelector(`.${st("fullWidth").container}`),this.eStickyTopFullWidthContainer=r.querySelector(`.${st("stickyTopFullWidth").container}`),this.eStickyBottomFullWidthContainer=n.querySelector(`.${st("stickyBottomFullWidth").container}`),this.setCellTextSelection(this.gos.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",a=>this.setCellTextSelection(a.currentValue)),this.createManagedBean(new Vs(this.comp)),this.bodyScrollFeature=this.createManagedBean(new kh(this.eBodyViewport)),this.addRowDragListener(),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([s,i,o,r,n]),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.updateScrollingClasses(),(l=this.filterManager)==null||l.setupAdvancedFilterHeaderComp(s),this.ctrlsService.register("gridBodyCtrl",this)}getComp(){return this.comp}addEventListeners(){const e=this.setFloatingHeights.bind(this);this.addManagedEventListeners({gridColumnsChanged:this.onGridColumnsChanged.bind(this),scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this),scrollGapChanged:this.onScrollGapChanged.bind(this),pinnedRowDataChanged:e,pinnedHeightChanged:e,headerHeightChanged:this.onHeaderHeightChanged.bind(this)})}addFocusListeners(e){e.forEach(t=>{this.addManagedElementListeners(t,{focusin:i=>{const{target:s}=i,o=rt(s,"ag-root",t);t.classList.toggle("ag-has-focus",!o)},focusout:i=>{const{target:s,relatedTarget:o}=i,r=t.contains(o),n=rt(o,"ag-root",t);rt(s,"ag-root",t)||(!r||n)&&t.classList.remove("ag-has-focus")}})})}setColumnMovingCss(e){this.comp.setColumnMovingCss(Dc,e)}setCellTextSelection(e=!1){this.comp.setCellSelectableCss(Pc,e)}onScrollVisibilityChanged(){const e=this.scrollVisibleService.isVerticalScrollShowing();this.setVerticalScrollPaddingVisible(e),this.setStickyWidth(e),this.setStickyBottomOffsetBottom();const t=e&&this.scrollVisibleService.getScrollbarWidth()||0,i=tr()?16:0,s=`calc(100% + ${t+i}px)`;this.animationFrameService.requestAnimationFrame(()=>this.comp.setBodyViewportWidth(s)),this.updateScrollingClasses()}onScrollGapChanged(){this.updateScrollingClasses()}updateScrollingClasses(){this.eGridBody.classList.toggle("ag-body-vertical-content-no-gap",!this.scrollVisibleService.hasVerticalScrollGap()),this.eGridBody.classList.toggle("ag-body-horizontal-content-no-gap",!this.scrollVisibleService.hasHorizontalScrollGap())}onGridColumnsChanged(){const e=this.columnModel.getCols();this.comp.setColumnCount(e.length)}disableBrowserDragging(){this.addManagedElementListeners(this.eGridBody,{dragstart:e=>{if(e.target instanceof HTMLImageElement)return e.preventDefault(),!1}})}addStopEditingWhenGridLosesFocus(){if(!this.gos.get("stopEditingWhenCellsLoseFocus"))return;const e=i=>{const s=i.relatedTarget;if(Qi(s)===null){this.rowRenderer.stopEditing();return}let o=t.some(r=>r.contains(s))&&this.mouseEventService.isElementInThisGrid(s);if(!o){const r=this.popupService;o=r.getActivePopups().some(n=>n.contains(s))||r.isElementWithinCustomPopup(s)}o||this.rowRenderer.stopEditing()},t=[this.eBodyViewport,this.eBottom,this.eTop,this.eStickyTop,this.eStickyBottom];t.forEach(i=>this.addManagedElementListeners(i,{focusout:e}))}updateRowCount(){var s;const e=this.headerNavigationService.getHeaderRowCount()+(((s=this.filterManager)==null?void 0:s.getHeaderRowCount())??0),t=this.rowModel.isLastRowIndexKnown()?this.rowModel.getRowCount():-1,i=t===-1?-1:e+t;this.comp.setRowCount(i)}registerBodyViewportResizeListener(e){this.comp.registerBodyViewportResizeListener(e)}setVerticalScrollPaddingVisible(e){const t=e?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(t)}isVerticalScrollShowing(){const e=this.gos.get("alwaysShowVerticalScroll"),t=e?en:null,i=z(this.gos,"normal");return this.comp.setAlwaysVerticalScrollClass(t,e),e||i&&ql(this.eBodyViewport)}setupRowAnimationCssClass(){let e=this.environment.hasMeasuredSizes();const t=()=>{const i=e&&ot(this.gos)&&!this.rowContainerHeightService.isStretching(),s=i?"ag-row-animation":"ag-row-no-animation";this.comp.setRowAnimationCssOnBodyViewport(s,i)};t(),this.addManagedEventListeners({heightScaleChanged:t}),this.addManagedPropertyListener("animateRows",t),this.addManagedEventListeners({gridStylesChanged:()=>{!e&&this.environment.hasMeasuredSizes()&&(e=!0,t())}})}getGridBodyElement(){return this.eGridBody}addBodyViewportListener(){const e=this.onBodyViewportContextMenu.bind(this);this.addManagedElementListeners(this.eBodyViewport,{contextmenu:e}),this.mockContextMenuForIPad(e),this.addManagedElementListeners(this.eBodyViewport,{wheel:this.onBodyViewportWheel.bind(this)}),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:i,shiftKey:s}=e;(s||Math.abs(t)>Math.abs(i))&&this.mouseEventService.isEventFromThisGrid(e)&&this.scrollGridBodyToMatchEvent(e)}onStickyWheel(e){const{deltaX:t,deltaY:i,shiftKey:s}=e,o=s||Math.abs(t)>Math.abs(i),r=e.target;o?(this.eStickyTopFullWidthContainer.contains(r)||this.eStickyBottomFullWidthContainer.contains(r))&&this.scrollGridBodyToMatchEvent(e):(e.preventDefault(),this.scrollVertically(i))}scrollGridBodyToMatchEvent(e){const{deltaX:t,deltaY:i}=e;e.preventDefault(),this.eCenterColsViewport.scrollBy({left:t||i})}onBodyViewportContextMenu(e,t,i){if(!e&&!i)return;this.gos.get("preventDefaultOnContextMenu")&&(e||i).preventDefault();const{target:s}=e||t;(s===this.eBodyViewport||s===this.ctrlsService.get("center").getViewportElement())&&this.menuService.showContextMenu({mouseEvent:e,touchEvent:i,value:null,anchorToElement:this.eGridBody})}mockContextMenuForIPad(e){if(!He())return;const t=new Ie(this.eBodyViewport),i=s=>{e(void 0,s.touchStart,s.touchEvent)};this.addManagedListeners(t,{longTap:i}),this.addDestroyFunc(()=>t.destroy())}onBodyViewportWheel(e){this.gos.get("suppressScrollWhenPopupsAreOpen")&&this.popupService.hasAnchoredPopup()&&e.preventDefault()}getGui(){return this.eGridBody}scrollVertically(e){const t=this.eBodyViewport.scrollTop;return this.bodyScrollFeature.setVerticalScrollPosition(t+e),this.eBodyViewport.scrollTop-t}addRowDragListener(){this.rowDragFeature=this.createManagedBean(new Ua(this.eBodyViewport)),this.dragAndDropService.addDropTarget(this.rowDragFeature),this.addDestroyFunc(()=>this.dragAndDropService.removeDropTarget(this.rowDragFeature))}getRowDragFeature(){return this.rowDragFeature}setFloatingHeights(){const{pinnedRowModel:e}=this,t=e.getPinnedTopTotalHeight(),i=e.getPinnedBottomTotalHeight();this.comp.setTopHeight(t),this.comp.setBottomHeight(i),this.comp.setTopDisplay(t?"inherit":"none"),this.comp.setBottomDisplay(i?"inherit":"none"),this.setStickyTopOffsetTop(),this.setStickyBottomOffsetBottom()}setStickyTopHeight(e=0){this.comp.setStickyTopHeight(`${e}px`),this.stickyTopHeight=e}getStickyTopHeight(){return this.stickyTopHeight}setStickyBottomHeight(e=0){this.comp.setStickyBottomHeight(`${e}px`),this.stickyBottomHeight=e}getStickyBottomHeight(){return this.stickyBottomHeight}setStickyWidth(e){if(!e)this.comp.setStickyTopWidth("100%"),this.comp.setStickyBottomWidth("100%");else{const t=this.scrollVisibleService.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${t}px)`),this.comp.setStickyBottomWidth(`calc(100% - ${t}px)`)}}onHeaderHeightChanged(){this.setStickyTopOffsetTop()}setStickyTopOffsetTop(){var o;const t=this.ctrlsService.get("gridHeaderCtrl").getHeaderHeight()+(((o=this.filterManager)==null?void 0:o.getHeaderHeight())??0),i=this.pinnedRowModel.getPinnedTopTotalHeight();let s=0;t>0&&(s+=t),i>0&&(s+=i),s>0&&(s+=1),this.comp.setStickyTopTop(`${s}px`)}setStickyBottomOffsetBottom(){const e=this.pinnedRowModel.getPinnedBottomTotalHeight(),i=this.scrollVisibleService.isHorizontalScrollShowing()&&this.scrollVisibleService.getScrollbarWidth()||0,s=e+i;this.comp.setStickyBottomBottom(`${s}px`)}sizeColumnsToFit(e,t){const s=this.isVerticalScrollShowing()?this.scrollVisibleService.getScrollbarWidth():0,r=Ht(this.eGridBody)-s;if(r>0){this.columnSizeService.sizeColumnsToFit(r,"sizeColumnsToFit",!1,e);return}t===void 0?window.setTimeout(()=>{this.sizeColumnsToFit(e,100)},0):t===100?window.setTimeout(()=>{this.sizeColumnsToFit(e,500)},100):t===500?window.setTimeout(()=>{this.sizeColumnsToFit(e,-1)},500):S("tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?")}addScrollEventListener(e){this.eBodyViewport.addEventListener("scroll",e,{passive:!0})}removeScrollEventListener(e){this.eBodyViewport.removeEventListener("scroll",e)}},Mc=class extends G{constructor(e,t,i,s,o){super(),this.rendererVersion=0,this.editorVersion=0,this.beans=e,this.column=t.getColumn(),this.rowNode=t.getRowNode(),this.rowCtrl=t.getRowCtrl(),this.eRow=s,this.cellCtrl=t;const r=document.createElement("div");r.setAttribute("comp-id",`${this.getCompId()}`),this.setTemplateFromElement(r);const n=this.getGui();this.forceWrapper=t.isForceWrapper(),this.refreshWrapper(!1),ee(n,t.getCellAriaRole()),n.setAttribute("col-id",t.colIdSanitised);const l={addOrRemoveCssClass:(a,d)=>this.addOrRemoveCssClass(a,d),setUserStyles:a=>ar(n,a),getFocusableElement:()=>this.getFocusableElement(),setIncludeSelection:a=>this.includeSelection=a,setIncludeRowDrag:a=>this.includeRowDrag=a,setIncludeDndSource:a=>this.includeDndSource=a,setRenderDetails:(a,d,h)=>this.setRenderDetails(a,d,h),setEditDetails:(a,d,h)=>this.setEditDetails(a,d,h),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue()};t.setComp(l,this.getGui(),this.eCellWrapper,i,o,void 0)}getParentOfValue(){return this.eCellValue?this.eCellValue:this.eCellWrapper?this.eCellWrapper:this.getGui()}setRenderDetails(e,t,i){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=this.firstRender==null;const o=this.refreshWrapper(!1);this.refreshEditStyles(!1),e?!(i||o)&&this.refreshCellRenderer(e)||(this.destroyRenderer(),this.createCellRendererInstance(e)):(this.destroyRenderer(),this.insertValueWithoutCellRenderer(t))}setEditDetails(e,t,i){e?this.createCellEditorInstance(e,t,i):this.destroyEditor()}removeControls(){this.checkboxSelectionComp=this.beans.context.destroyBean(this.checkboxSelectionComp),this.dndSourceComp=this.beans.context.destroyBean(this.dndSourceComp),this.rowDraggingComp=this.beans.context.destroyBean(this.rowDraggingComp)}refreshWrapper(e){const t=this.includeRowDrag||this.includeDndSource||this.includeSelection,i=t||this.forceWrapper,s=i&&this.eCellWrapper==null;if(s){const d=document.createElement("div");d.setAttribute("role","presentation"),d.setAttribute("class","ag-cell-wrapper"),this.eCellWrapper=d,this.getGui().appendChild(this.eCellWrapper)}const o=!i&&this.eCellWrapper!=null;o&&(Ce(this.eCellWrapper),this.eCellWrapper=void 0),this.addOrRemoveCssClass("ag-cell-value",!i);const r=!e&&i,n=r&&this.eCellValue==null;if(n){const d=document.createElement("span");d.setAttribute("role","presentation"),d.setAttribute("class","ag-cell-value"),this.eCellValue=d,this.eCellWrapper.appendChild(this.eCellValue)}const l=!r&&this.eCellValue!=null;l&&(Ce(this.eCellValue),this.eCellValue=void 0);const a=s||o||n||l;return a&&this.removeControls(),e||t&&this.addControls(),a}addControls(){this.includeRowDrag&&this.rowDraggingComp==null&&(this.rowDraggingComp=this.cellCtrl.createRowDragComp(),this.rowDraggingComp&&this.eCellWrapper.insertBefore(this.rowDraggingComp.getGui(),this.eCellValue)),this.includeDndSource&&this.dndSourceComp==null&&(this.dndSourceComp=this.cellCtrl.createDndSource(),this.eCellWrapper.insertBefore(this.dndSourceComp.getGui(),this.eCellValue)),this.includeSelection&&this.checkboxSelectionComp==null&&(this.checkboxSelectionComp=this.cellCtrl.createSelectionCheckbox(),this.eCellWrapper.insertBefore(this.checkboxSelectionComp.getGui(),this.eCellValue))}createCellEditorInstance(e,t,i){const s=this.editorVersion,o=e.newAgStackInstance();if(o==null)return;const{params:r}=e;o.then(l=>this.afterCellEditorCreated(s,l,r,t,i)),A(this.cellEditor)&&r.cellStartedEdit&&this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(e){const t=this.getParentOfValue();U(t);const i=e!=null?me(e,!0):null;i!=null&&(t.textContent=i)}destroyEditorAndRenderer(){this.destroyRenderer(),this.destroyEditor()}destroyRenderer(){const{context:e}=this.beans;this.cellRenderer=e.destroyBean(this.cellRenderer),Ce(this.cellRendererGui),this.cellRendererGui=null,this.rendererVersion++}destroyEditor(){const{context:e}=this.beans;this.hideEditorPopup&&this.hideEditorPopup(),this.hideEditorPopup=void 0,this.cellEditor=e.destroyBean(this.cellEditor),this.cellEditorPopupWrapper=e.destroyBean(this.cellEditorPopupWrapper),Ce(this.cellEditorGui),this.cellEditorGui=null,this.editorVersion++}refreshCellRenderer(e){if(this.cellRenderer==null||this.cellRenderer.refresh==null||this.cellRendererClass!==e.componentClass)return!1;const t=this.cellRenderer.refresh(e.params);return t===!0||t===void 0}createCellRendererInstance(e){const i=!this.beans.gos.get("suppressAnimationFrame"),s=this.rendererVersion,{componentClass:o}=e,r=()=>{if(this.rendererVersion!==s||!this.isAlive())return;const l=e.newAgStackInstance(),a=this.afterCellRendererCreated.bind(this,s,o);l&&l.then(a)};i&&this.firstRender?this.beans.animationFrameService.createTask(r,this.rowNode.rowIndex,"createTasksP2"):r()}getCtrl(){return this.cellCtrl}getRowCtrl(){return this.rowCtrl}getCellRenderer(){return this.cellRenderer}getCellEditor(){return this.cellEditor}afterCellRendererCreated(e,t,i){if(!this.isAlive()||e!==this.rendererVersion){this.beans.context.destroyBean(i);return}if(this.cellRenderer=i,this.cellRendererClass=t,this.cellRendererGui=this.cellRenderer.getGui(),this.cellRendererGui!=null){const o=this.getParentOfValue();U(o),o.appendChild(this.cellRendererGui)}}afterCellEditorCreated(e,t,i,s,o){if(e!==this.editorVersion){this.beans.context.destroyBean(t);return}if(t.isCancelBeforeStart&&t.isCancelBeforeStart()){this.beans.context.destroyBean(t),this.cellCtrl.stopEditing(!0);return}if(!t.getGui){S(`cellEditor for column ${this.column.getId()} is missing getGui() method`),this.beans.context.destroyBean(t);return}this.cellEditor=t,this.cellEditorGui=t.getGui();const l=s||t.isPopup!==void 0&&t.isPopup();l?this.addPopupCellEditor(i,o):this.addInCellEditor(),this.refreshEditStyles(!0,l),t.afterGuiAttached&&t.afterGuiAttached(),this.cellCtrl.cellEditorAttached()}refreshEditStyles(e,t){var i;this.addOrRemoveCssClass("ag-cell-inline-editing",e&&!t),this.addOrRemoveCssClass("ag-cell-popup-editing",e&&!!t),this.addOrRemoveCssClass("ag-cell-not-inline-editing",!e||!!t),(i=this.rowCtrl)==null||i.setInlineEditingCss()}addInCellEditor(){const e=this.getGui();e.contains(V(this.beans.gos))&&e.focus(),this.destroyRenderer(),this.refreshWrapper(!0),this.clearParentOfValue(),this.cellEditorGui&&this.getParentOfValue().appendChild(this.cellEditorGui)}addPopupCellEditor(e,t){var u;this.beans.gos.get("editType")==="fullRow"&&S("popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.");const i=this.cellEditor;this.cellEditorPopupWrapper=this.beans.context.createBean(this.beans.editService.createPopupEditorWrapper(e));const s=this.cellEditorPopupWrapper.getGui();this.cellEditorGui&&s.appendChild(this.cellEditorGui);const o=this.beans.popupService,r=this.beans.gos.get("stopEditingWhenCellsLoseFocus"),n=t??((u=i.getPopupPosition)==null?void 0:u.call(i))??"over",l=this.beans.gos.get("enableRtl"),a={ePopup:s,column:this.column,rowNode:this.rowNode,type:"popupCellEditor",eventSource:this.getGui(),position:n,alignSide:l?"right":"left",keepWithinBounds:!0},d=o.positionPopupByComponent.bind(o,a),h=this.beans.localeService.getLocaleTextFunc(),c=o.addPopup({modal:r,eChild:s,closeOnEsc:!0,closedCallback:()=>{this.cellCtrl.onPopupEditorClosed()},anchorToElement:this.getGui(),positionCallback:d,ariaLabel:h("ariaLabelCellEditor","Cell Editor")});c&&(this.hideEditorPopup=c.hideFunc)}detach(){this.eRow.removeChild(this.getGui())}destroy(){this.cellCtrl.stopEditing(),this.destroyEditorAndRenderer(),this.removeControls(),super.destroy()}clearParentOfValue(){const e=this.getGui();e.contains(V(this.beans.gos))&&Yi()&&e.focus({preventScroll:!0}),U(this.getParentOfValue())}},xc=class extends G{constructor(e,t,i){super(),this.cellComps={},this.beans=t,this.rowCtrl=e;const s=document.createElement("div");s.setAttribute("comp-id",`${this.getCompId()}`),s.setAttribute("style",this.getInitialStyle(i)),this.setTemplateFromElement(s);const o=this.getGui(),r=o.style;this.domOrder=this.rowCtrl.getDomOrder(),ee(o,"row");const n={setDomOrder:l=>this.domOrder=l,setCellCtrls:l=>this.setCellCtrls(l),showFullWidth:l=>this.showFullWidth(l),getFullWidthCellRenderer:()=>this.fullWidthCellRenderer,addOrRemoveCssClass:(l,a)=>this.addOrRemoveCssClass(l,a),setUserStyles:l=>ar(o,l),setTop:l=>r.top=l,setTransform:l=>r.transform=l,setRowIndex:l=>o.setAttribute("row-index",l),setRowId:l=>o.setAttribute("row-id",l),setRowBusinessKey:l=>o.setAttribute("row-business-key",l),refreshFullWidth:l=>{var a,d;return((d=(a=this.fullWidthCellRenderer)==null?void 0:a.refresh)==null?void 0:d.call(a,l()))??!1}};e.setComp(n,this.getGui(),i,void 0),this.addDestroyFunc(()=>{e.unsetComp(i)})}getInitialStyle(e){const t=this.rowCtrl.getInitialTransform(e);return t?`transform: ${t}`:`top: ${this.rowCtrl.getInitialRowTop(e)}`}showFullWidth(e){const t=s=>{if(this.isAlive()){const o=s.getGui();this.getGui().appendChild(o),this.rowCtrl.setupDetailRowAutoHeight(o),this.setFullWidthRowComp(s)}else this.beans.context.destroyBean(s)},i=e.newAgStackInstance();i!=null&&i.then(t)}setCellCtrls(e){const t=Object.assign({},this.cellComps);e.forEach(s=>{const o=s.instanceId;this.cellComps[o]==null?this.newCellComp(s):t[o]=null});const i=Oe(t).filter(s=>s!=null);this.destroyCells(i),this.ensureDomOrder(e)}ensureDomOrder(e){if(!this.domOrder)return;const t=[];e.forEach(i=>{const s=this.cellComps[i.instanceId];s&&t.push(s.getGui())}),lr(this.getGui(),t)}newCellComp(e){const t=new Mc(this.beans,e,this.rowCtrl.isPrintLayout(),this.getGui(),this.rowCtrl.isEditing());this.cellComps[e.instanceId]=t,this.getGui().appendChild(t.getGui())}destroy(){super.destroy(),this.destroyAllCells()}destroyAllCells(){const e=Oe(this.cellComps).filter(t=>t!=null);this.destroyCells(e)}setFullWidthRowComp(e){this.fullWidthCellRenderer&&O("should not be setting fullWidthRowComponent twice"),this.fullWidthCellRenderer=e,this.addDestroyFunc(()=>{this.fullWidthCellRenderer=this.beans.context.destroyBean(this.fullWidthCellRenderer)})}destroyCells(e){e.forEach(t=>{if(!t)return;const i=t.getCtrl().instanceId;this.cellComps[i]===t&&(t.detach(),t.destroy(),this.cellComps[i]=null)})}};function Ac(e){let t;return e.type==="center"?t=`<div class="${e.viewport}" data-ref="eViewport" role="presentation"> <div class="${e.container}" data-ref="eContainer"></div> </div>`:t=`<div class="${e.container}" data-ref="eContainer"></div>`,t}var Tc=class extends G{constructor(){super(),this.eViewport=b,this.eContainer=b,this.rowComps={},this.name=G.elementGettingCreated.getAttribute("name"),this.options=st(this.name),this.setTemplate(Ac(this.options))}wireBeans(e){this.beans=e}postConstruct(){const e={setHorizontalScroll:i=>this.eViewport.scrollLeft=i,setViewportHeight:i=>this.eViewport.style.height=i,setRowCtrls:({rowCtrls:i})=>this.setRowCtrls(i),setDomOrder:i=>{this.domOrder=i},setContainerWidth:i=>this.eContainer.style.width=i,setOffsetTop:i=>this.eContainer.style.transform=`translateY(${i})`};this.createManagedBean(new bc(this.name)).setComp(e,this.eContainer,this.eViewport)}destroy(){this.setRowCtrls([]),super.destroy()}setRowCtrls(e){const t={...this.rowComps};this.rowComps={},this.lastPlacedElement=null;const i=s=>{const o=s.instanceId,r=t[o];if(r)this.rowComps[o]=r,delete t[o],this.ensureDomOrder(r.getGui());else{if(!s.getRowNode().displayed)return;const n=new xc(s,this.beans,this.options.type);this.rowComps[o]=n,this.appendRow(n.getGui())}};e.forEach(i),Oe(t).forEach(s=>{this.eContainer.removeChild(s.getGui()),s.destroy()}),ee(this.eContainer,"rowgroup")}appendRow(e){this.domOrder?$l(this.eContainer,e,this.lastPlacedElement):this.eContainer.appendChild(e),this.lastPlacedElement=e}ensureDomOrder(e){this.domOrder&&(nr(this.eContainer,e,this.lastPlacedElement),this.lastPlacedElement=e)}},Ic={selector:"AG-ROW-CONTAINER",component:Tc};function vt(e){return e.map(t=>`<ag-row-container name="${t}"></ag-row-container>`).join("")}var Lc=`<div class="ag-root ag-unselectable" role="treegrid"> <ag-header-root></ag-header-root> <div class="ag-floating-top" data-ref="eTop" role="presentation"> ${vt(["topLeft","topCenter","topRight","topFullWidth"])} </div> <div class="ag-body" data-ref="eBody" role="presentation"> <div class="ag-body-viewport" data-ref="eBodyViewport" role="presentation"> ${vt(["left","center","right","fullWidth"])} </div> <ag-fake-vertical-scroll></ag-fake-vertical-scroll> </div> <div class="ag-sticky-top" data-ref="eStickyTop" role="presentation"> ${vt(["stickyTopLeft","stickyTopCenter","stickyTopRight","stickyTopFullWidth"])} </div> <div class="ag-sticky-bottom" data-ref="eStickyBottom" role="presentation"> ${vt(["stickyBottomLeft","stickyBottomCenter","stickyBottomRight","stickyBottomFullWidth"])} </div> <div class="ag-floating-bottom" data-ref="eBottom" role="presentation"> ${vt(["bottomLeft","bottomCenter","bottomRight","bottomFullWidth"])} </div> <ag-fake-horizontal-scroll></ag-fake-horizontal-scroll> <ag-overlay-wrapper></ag-overlay-wrapper> </div>`,Oc=class extends G{constructor(){super(Lc,[Th,Lh,Gh,xh,Ic]),this.eBodyViewport=b,this.eStickyTop=b,this.eStickyBottom=b,this.eTop=b,this.eBottom=b,this.eBody=b}wireBeans(e){this.resizeObserverService=e.resizeObserverService,this.rangeService=e.rangeService}postConstruct(){const e=(i,s)=>{const o=`${i}px`;s.style.minHeight=o,s.style.height=o},t={setRowAnimationCssOnBodyViewport:(i,s)=>this.setRowAnimationCssOnBodyViewport(i,s),setColumnCount:i=>Gl(this.getGui(),i),setRowCount:i=>Ol(this.getGui(),i),setTopHeight:i=>e(i,this.eTop),setBottomHeight:i=>e(i,this.eBottom),setTopDisplay:i=>this.eTop.style.display=i,setBottomDisplay:i=>this.eBottom.style.display=i,setStickyTopHeight:i=>this.eStickyTop.style.height=i,setStickyTopTop:i=>this.eStickyTop.style.top=i,setStickyTopWidth:i=>this.eStickyTop.style.width=i,setStickyBottomHeight:i=>{this.eStickyBottom.style.height=i,this.eStickyBottom.classList.toggle("ag-hidden",i==="0px")},setStickyBottomBottom:i=>this.eStickyBottom.style.bottom=i,setStickyBottomWidth:i=>this.eStickyBottom.style.width=i,setColumnMovingCss:(i,s)=>this.addOrRemoveCssClass(i,s),updateLayoutClasses:(i,s)=>{[this.eBodyViewport.classList,this.eBody.classList].forEach(r=>{r.toggle("ag-layout-auto-height",s.autoHeight),r.toggle("ag-layout-normal",s.normal),r.toggle("ag-layout-print",s.print)}),this.addOrRemoveCssClass("ag-layout-auto-height",s.autoHeight),this.addOrRemoveCssClass("ag-layout-normal",s.normal),this.addOrRemoveCssClass("ag-layout-print",s.print)},setAlwaysVerticalScrollClass:(i,s)=>this.eBodyViewport.classList.toggle(en,s),registerBodyViewportResizeListener:i=>{const s=this.resizeObserverService.observeResize(this.eBodyViewport,i);this.addDestroyFunc(()=>s())},setPinnedTopBottomOverflowY:i=>this.eTop.style.overflowY=this.eBottom.style.overflowY=i,setCellSelectableCss:(i,s)=>{[this.eTop,this.eBodyViewport,this.eBottom].forEach(o=>o.classList.toggle(i,s))},setBodyViewportWidth:i=>this.eBodyViewport.style.width=i};this.ctrl=this.createManagedBean(new Ec),this.ctrl.setComp(t,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop,this.eStickyBottom),(this.rangeService&&ve(this.gos)||hs(this.gos))&&Ll(this.getGui(),!0)}setRowAnimationCssOnBodyViewport(e,t){const i=this.eBodyViewport.classList;i.toggle("ag-row-animation",t),i.toggle("ag-row-no-animation",!t)}getFloatingTopBottom(){return[this.eTop,this.eBottom]}},Gc={selector:"AG-GRID-BODY",component:Oc},kc=class extends v{constructor(){super(...arguments),this.beanName="scrollVisibleService"}wireBeans(e){this.ctrlsService=e.ctrlsService,this.columnAnimationService=e.columnAnimationService}postConstruct(){this.getScrollbarWidth(),this.addManagedEventListeners({displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this)})}onDisplayedColumnsChanged(){this.updateScrollVisible()}onDisplayedColumnsWidthChanged(){this.updateScrollVisible()}onCentreViewportResized(){this.updateScrollGap()}updateScrollVisible(){this.columnAnimationService.isActive()?this.columnAnimationService.executeLaterVMTurn(()=>{this.columnAnimationService.executeLaterVMTurn(()=>this.updateScrollVisibleImpl())}):this.updateScrollVisibleImpl()}updateScrollVisibleImpl(){const e=this.ctrlsService.get("center");if(!e||this.columnAnimationService.isActive())return;const t={horizontalScrollShowing:e.isHorizontalScrollShowing(),verticalScrollShowing:this.isVerticalScrollShowing()};this.setScrollsVisible(t),this.updateScrollGap()}updateScrollGap(){const e=this.ctrlsService.get("center"),t=e.hasHorizontalScrollGap(),i=e.hasVerticalScrollGap();(this.horizontalScrollGap!==t||this.verticalScrollGap!==i)&&(this.horizontalScrollGap=t,this.verticalScrollGap=i,this.eventService.dispatchEvent({type:"scrollGapChanged"}))}setScrollsVisible(e){(this.horizontalScrollShowing!==e.horizontalScrollShowing||this.verticalScrollShowing!==e.verticalScrollShowing)&&(this.horizontalScrollShowing=e.horizontalScrollShowing,this.verticalScrollShowing=e.verticalScrollShowing,this.eventService.dispatchEvent({type:"scrollVisibilityChanged"}))}isHorizontalScrollShowing(){return this.horizontalScrollShowing}isVerticalScrollShowing(){return this.verticalScrollShowing}hasHorizontalScrollGap(){return this.horizontalScrollGap}hasVerticalScrollGap(){return this.verticalScrollGap}getScrollbarWidth(){if(this.scrollbarWidth==null){const e=this.gos.get("scrollbarWidth"),i=typeof e=="number"&&e>=0?e:_l();i!=null&&(this.scrollbarWidth=i,this.eventService.dispatchEvent({type:"scrollbarWidthChanged"}))}return this.scrollbarWidth}},co="__ag_grid_instance",tn=class sn extends v{constructor(){super(...arguments),this.beanName="mouseEventService",this.gridInstanceId=sn.gridInstanceSequence.next()}wireBeans(t){this.ctrlsService=t.ctrlsService}stampTopLevelGridCompWithGridInstance(t){t[co]=this.gridInstanceId}getRenderedCellForEvent(t){return zi(this.gos,t.target,je.DOM_DATA_KEY_CELL_CTRL)}isEventFromThisGrid(t){return this.isElementInThisGrid(t.target)}isElementInThisGrid(t){let i=t;for(;i;){const s=i[co];if(F(s))return s===this.gridInstanceId;i=i.parentElement}return!1}getCellPositionForEvent(t){const i=this.getRenderedCellForEvent(t);return i?i.getCellPosition():null}getNormalisedPosition(t){const i=z(this.gos,"normal"),s=t;let o,r;if(s.clientX!=null||s.clientY!=null?(o=s.clientX,r=s.clientY):(o=s.x,r=s.y),i){const n=this.ctrlsService.getGridBodyCtrl(),l=n.getScrollFeature().getVScrollPosition(),a=n.getScrollFeature().getHScrollPosition();o+=a.left,r+=l.top}return{x:o,y:r}}};tn.gridInstanceSequence=new ht;var Hc=tn,Vc=class extends v{constructor(){super(),this.beanName="navigationService",this.onPageDown=qs(this.onPageDown,100),this.onPageUp=qs(this.onPageUp,100)}wireBeans(e){this.mouseEventService=e.mouseEventService,this.pageBoundsService=e.pageBoundsService,this.focusService=e.focusService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.rowModel=e.rowModel,this.ctrlsService=e.ctrlsService,this.rowRenderer=e.rowRenderer,this.headerNavigationService=e.headerNavigationService,this.rowPositionUtils=e.rowPositionUtils,this.cellNavigationService=e.cellNavigationService,this.pinnedRowModel=e.pinnedRowModel,this.scrollVisibleService=e.scrollVisibleService,this.rangeService=e.rangeService}postConstruct(){this.ctrlsService.whenReady(this,e=>{this.gridBodyCon=e.gridBodyCtrl})}handlePageScrollingKey(e,t=!1){const i=e.key,s=e.altKey,o=e.ctrlKey||e.metaKey,r=!!this.rangeService&&e.shiftKey,n=this.mouseEventService.getCellPositionForEvent(e);let l=!1;switch(i){case m.PAGE_HOME:case m.PAGE_END:!o&&!s&&(this.onHomeOrEndKey(i),l=!0);break;case m.LEFT:case m.RIGHT:case m.UP:case m.DOWN:if(!n)return!1;o&&!s&&!r&&(this.onCtrlUpDownLeftRight(i,n),l=!0);break;case m.PAGE_DOWN:case m.PAGE_UP:!o&&!s&&(l=this.handlePageUpDown(i,n,t));break}return l&&e.preventDefault(),l}handlePageUpDown(e,t,i){return i&&(t=this.focusService.getFocusedCell()),t?(e===m.PAGE_UP?this.onPageUp(t):this.onPageDown(t),!0):!1}navigateTo(e){var n;const{scrollIndex:t,scrollType:i,scrollColumn:s,focusIndex:o,focusColumn:r}=e;F(s)&&!s.isPinned()&&this.gridBodyCon.getScrollFeature().ensureColumnVisible(s),F(t)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(t,i),e.isAsync||this.gridBodyCon.getScrollFeature().ensureIndexVisible(o),this.focusService.setFocusedCell({rowIndex:o,column:r,rowPinned:null,forceBrowserFocus:!0}),(n=this.rangeService)==null||n.setRangeToCell({rowIndex:o,rowPinned:null,column:r})}onPageDown(e){const i=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),s=this.getViewportHeight(),o=this.pageBoundsService.getPixelOffset(),r=i.top+s,n=this.rowModel.getRowIndexAtPixel(r+o);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,n):this.navigateToNextPage(e,n)}onPageUp(e){const i=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),s=this.pageBoundsService.getPixelOffset(),o=i.top,r=this.rowModel.getRowIndexAtPixel(o+s);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,r,!0):this.navigateToNextPage(e,r,!0)}navigateToNextPage(e,t,i=!1){const s=this.getViewportHeight(),o=this.pageBoundsService.getFirstRow(),r=this.pageBoundsService.getLastRow(),n=this.pageBoundsService.getPixelOffset(),l=this.rowModel.getRow(e.rowIndex),a=i?(l==null?void 0:l.rowHeight)-s-n:s-n,d=(l==null?void 0:l.rowTop)+a;let h=this.rowModel.getRowIndexAtPixel(d+n);if(h===e.rowIndex){const u=i?-1:1;t=h=e.rowIndex+u}let c;i?(c="bottom",h<o&&(h=o),t<o&&(t=o)):(c="top",h>r&&(h=r),t>r&&(t=r)),this.isRowTallerThanView(h)&&(t=h,c="top"),this.navigateTo({scrollIndex:t,scrollType:c,scrollColumn:null,focusIndex:h,focusColumn:e.column})}navigateToNextPageWithAutoHeight(e,t,i=!1){this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:t,focusColumn:e.column}),setTimeout(()=>{const s=this.getNextFocusIndexForAutoHeight(e,i);this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:s,focusColumn:e.column,isAsync:!0})},50)}getNextFocusIndexForAutoHeight(e,t=!1){const i=t?-1:1,s=this.getViewportHeight(),o=this.pageBoundsService.getLastRow();let r=0,n=e.rowIndex;for(;n>=0&&n<=o;){const l=this.rowModel.getRow(n);if(l){const a=l.rowHeight??0;if(r+a>s)break;r+=a}n+=i}return Math.max(0,Math.min(n,o))}getViewportHeight(){const e=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),t=this.scrollVisibleService.getScrollbarWidth();let i=e.bottom-e.top;return this.ctrlsService.get("center").isHorizontalScrollShowing()&&(i-=t),i}isRowTallerThanView(e){const t=this.rowModel.getRow(e);if(!t)return!1;const i=t.rowHeight;return typeof i!="number"?!1:i>this.getViewportHeight()}onCtrlUpDownLeftRight(e,t){const i=this.cellNavigationService.getNextCellToFocus(e,t,!0),{rowIndex:s}=i,o=i.column;this.navigateTo({scrollIndex:s,scrollType:null,scrollColumn:o,focusIndex:s,focusColumn:o})}onHomeOrEndKey(e){const t=e===m.PAGE_HOME,i=this.visibleColsService.getAllCols(),s=t?i[0]:I(i),o=t?this.pageBoundsService.getFirstRow():this.pageBoundsService.getLastRow();this.navigateTo({scrollIndex:o,scrollType:null,scrollColumn:s,focusIndex:o,focusColumn:s})}onTabKeyDown(e,t){const i=t.shiftKey,s=this.tabToNextCellCommon(e,i,t);if(s!==!1){s?t.preventDefault():s===null&&this.focusService.allowFocusForNextGridCoreContainer(i);return}if(i){const{rowIndex:o,rowPinned:r}=e.getRowPosition();(r?o===0:o===this.pageBoundsService.getFirstRow())&&(this.gos.get("headerHeight")===0||this.focusService.isHeaderFocusSuppressed()?this.focusService.focusNextGridCoreContainer(!0,!0):(t.preventDefault(),this.focusService.focusPreviousFromFirstCell(t)))}else e instanceof je&&e.focusCell(!0),(!i&&this.focusService.focusOverlay(!1)||this.focusService.focusNextGridCoreContainer(i))&&t.preventDefault()}tabToNextCell(e,t){const i=this.focusService.getFocusedCell();if(!i)return!1;let s=this.getCellByPosition(i);return!s&&(s=this.rowRenderer.getRowByPosition(i),!s||!s.isFullWidth())?!1:!!this.tabToNextCellCommon(s,e,t)}tabToNextCellCommon(e,t,i){let s=e.isEditing();if(!s&&e instanceof je){const n=e.getRowCtrl();n&&(s=n.isEditing())}let o;return s?this.gos.get("editType")==="fullRow"?o=this.moveToNextEditingRow(e,t,i):o=this.moveToNextEditingCell(e,t,i):o=this.moveToNextCellNotEditing(e,t),o===null?o:o||!!this.focusService.getFocusedHeader()}moveToNextEditingCell(e,t,i=null){const s=e.getCellPosition();e.getGui().focus(),e.stopEditing();const o=this.findNextCellToFocusOn(s,t,!0);return o===!1?null:o==null?!1:(o.startEditing(null,!0,i),o.focusCell(!1),!0)}moveToNextEditingRow(e,t,i=null){const s=e.getCellPosition(),o=this.findNextCellToFocusOn(s,t,!0);if(o===!1)return null;if(o==null)return!1;const r=o.getCellPosition(),n=this.isCellEditable(s),l=this.isCellEditable(r),a=r&&s.rowIndex===r.rowIndex&&s.rowPinned===r.rowPinned;return n&&e.setFocusOutOnEditor(),a||(e.getRowCtrl().stopEditing(),o.getRowCtrl().startRowEditing(void 0,void 0,i)),l?(o.setFocusInOnEditor(),o.focusCell()):o.focusCell(!0),!0}moveToNextCellNotEditing(e,t){const i=this.visibleColsService.getAllCols();let s;e instanceof qe?s={...e.getRowPosition(),column:t?i[0]:I(i)}:s=e.getCellPosition();const o=this.findNextCellToFocusOn(s,t,!1);if(o===!1)return null;if(o instanceof je)o.focusCell(!0);else if(o)return this.tryToFocusFullWidthRow(o.getRowPosition(),t);return F(o)}findNextCellToFocusOn(e,t,i){var o;let s=e;for(;;){e!==s&&(e=s),t||(s=this.getLastCellOfColSpan(s)),s=this.cellNavigationService.getNextTabbedCell(s,t);const r=this.gos.getCallback("tabToNextCell");if(F(r)){const d=r({backwards:t,editing:i,previousCellPosition:e,nextCellPosition:s||null});if(d===!0||d===null)d===null&&S("Returning `null` from tabToNextCell is deprecated. Return `true` to stay on the current cell, or `false` to let the browser handle the tab behaviour."),s=e;else{if(d===!1)return!1;s={rowIndex:d.rowIndex,column:d.column,rowPinned:d.rowPinned}}}if(!s)return null;if(s.rowIndex<0){const a=this.headerNavigationService.getHeaderRowCount();return this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:a+s.rowIndex,column:s.column},fromCell:!0}),null}const n=this.gos.get("editType")==="fullRow";if(i&&!n&&!this.isCellEditable(s))continue;this.ensureCellVisible(s);const l=this.getCellByPosition(s);if(!l){const a=this.rowRenderer.getRowByPosition(s);if(!a||!a.isFullWidth()||i)continue;return a}if(!l.isSuppressNavigable())return(o=this.rangeService)==null||o.setRangeToCell(s),l}}isCellEditable(e){const t=this.lookupRowNodeForCell(e);return t?e.column.isCellEditable(t):!1}getCellByPosition(e){const t=this.rowRenderer.getRowByPosition(e);return t?t.getCellCtrl(e.column):null}lookupRowNodeForCell(e){return e.rowPinned==="top"?this.pinnedRowModel.getPinnedTopRow(e.rowIndex):e.rowPinned==="bottom"?this.pinnedRowModel.getPinnedBottomRow(e.rowIndex):this.rowModel.getRow(e.rowIndex)}navigateToNextCell(e,t,i,s){let o=i,r=!1;for(;o&&(o===i||!this.isValidNavigateCell(o));)this.gos.get("enableRtl")?t===m.LEFT&&(o=this.getLastCellOfColSpan(o)):t===m.RIGHT&&(o=this.getLastCellOfColSpan(o)),o=this.cellNavigationService.getNextCellToFocus(t,o),r=A(o);if(r&&e&&e.key===m.UP&&(o={rowIndex:-1,rowPinned:null,column:i.column}),s){const l=this.gos.getCallback("navigateToNextCell");if(F(l)){const d=l({key:t,previousCellPosition:i,nextCellPosition:o||null,event:e});F(d)?o={rowPinned:d.rowPinned,rowIndex:d.rowIndex,column:d.column}:o=null}}if(!o)return;if(o.rowIndex<0){const l=this.headerNavigationService.getHeaderRowCount();this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:l+o.rowIndex,column:i.column},event:e||void 0,fromCell:!0});return}const n=this.getNormalisedPosition(o);n?this.focusPosition(n):this.tryToFocusFullWidthRow(o)}getNormalisedPosition(e){this.ensureCellVisible(e);const t=this.getCellByPosition(e);return t?(e=t.getCellPosition(),this.ensureCellVisible(e),e):null}tryToFocusFullWidthRow(e,t){const i=this.visibleColsService.getAllCols(),s=this.rowRenderer.getRowByPosition(e);if(!s||!s.isFullWidth())return!1;const o=this.focusService.getFocusedCell(),r={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column||(t?I(i):i[0])};this.focusPosition(r);const n=t??(o!=null&&this.rowPositionUtils.before(r,o));return this.eventService.dispatchEvent({type:"fullWidthRowFocused",rowIndex:r.rowIndex,rowPinned:r.rowPinned,column:r.column,isFullWidthCell:!0,fromBelow:n}),!0}focusPosition(e){var t;this.focusService.setFocusedCell({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0}),(t=this.rangeService)==null||t.setRangeToCell(e)}isValidNavigateCell(e){return!!this.rowPositionUtils.getRowNode(e)}getLastCellOfColSpan(e){const t=this.getCellByPosition(e);if(!t)return e;const i=t.getColSpanningList();return i.length===1?e:{rowIndex:e.rowIndex,column:I(i),rowPinned:e.rowPinned}}ensureCellVisible(e){const t=ci(this.gos),i=this.rowModel.getRow(e.rowIndex);!(t&&(i==null?void 0:i.sticky))&&A(e.rowPinned)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(e.rowIndex),e.column.isPinned()||this.gridBodyCon.getScrollFeature().ensureColumnVisible(e.column)}},Nc=class extends v{constructor(){super(...arguments),this.beanName="horizontalResizeService"}wireBeans(e){this.dragService=e.dragService,this.ctrlsService=e.ctrlsService}addResizeBar(e){const t={dragStartPixels:e.dragStartPixels||0,eElement:e.eResizeBar,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this,e),onDragging:this.onDragging.bind(this,e),onDragCancel:this.onDragStop.bind(this,e),includeTouch:!0,stopPropagationForTouch:!0};return this.dragService.addDragSource(t),()=>this.dragService.removeDragSource(t)}onDragStart(e,t){this.dragStartX=t.clientX,this.setResizeIcons();const i=t instanceof MouseEvent&&t.shiftKey===!0;e.onResizeStart(i)}setResizeIcons(){const e=this.ctrlsService.get("gridCtrl");e.setResizeCursor(!0),e.disableUserSelect(!0)}onDragStop(e){e.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){const e=this.ctrlsService.get("gridCtrl");e.setResizeCursor(!1),e.disableUserSelect(!1)}onDragging(e,t){this.resizeAmount=t.clientX-this.dragStartX,e.onResizing(this.resizeAmount)}},Bc=class extends v{constructor(){super(...arguments),this.beanName="filterMenuFactory"}wireBeans(e){this.popupService=e.popupService,this.focusService=e.focusService,this.ctrlsService=e.ctrlsService,this.menuService=e.menuService}hideActiveMenu(){this.hidePopup&&this.hidePopup()}showMenuAfterMouseEvent(e,t,i){this.showPopup(e,s=>{this.popupService.positionPopupUnderMouseEvent({column:e,type:i,mouseEvent:t,ePopup:s})},i,t.target,this.menuService.isLegacyMenuEnabled())}showMenuAfterButtonClick(e,t,i){let s=-1,o="left";const r=this.menuService.isLegacyMenuEnabled();!r&&this.gos.get("enableRtl")&&(s=1,o="right");const n=r?void 0:4*s,l=r?void 0:4;this.showPopup(e,a=>{this.popupService.positionPopupByComponent({type:i,eventSource:t,ePopup:a,nudgeX:n,nudgeY:l,alignSide:o,keepWithinBounds:!0,position:"under",column:e})},i,t,r)}showPopup(e,t,i,s,o){const r=e?this.createBean(new Qa(e,"COLUMN_MENU")):void 0;if(this.activeMenu=r,!(r!=null&&r.hasFilter())||!e)throw new Error("AG Grid - unable to show popup filter, filter instantiation failed");const n=document.createElement("div");ee(n,"presentation"),n.classList.add("ag-menu"),o||n.classList.add("ag-filter-menu"),[this.tabListener]=this.addManagedElementListeners(n,{keydown:p=>this.trapFocusWithin(p,n)}),n.appendChild(r==null?void 0:r.getGui());let l;const a=()=>r==null?void 0:r.afterGuiDetached(),d=this.menuService.isColumnMenuAnchoringEnabled()?s??this.ctrlsService.getGridBodyCtrl().getGui():void 0,h=p=>{e.setMenuVisible(!1,"contextMenu");const C=p instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),C&&s&&ue(s)){const f=this.focusService.findTabbableParent(s);f&&f.focus()}a(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,i,e)},c=this.localeService.getLocaleTextFunc(),u=o&&i!=="columnFilter"?c("ariaLabelColumnMenu","Column Menu"):c("ariaLabelColumnFilter","Column Filter"),g=this.popupService.addPopup({modal:!0,eChild:n,closeOnEsc:!0,closedCallback:h,positionCallback:()=>t(n),anchorToElement:d,ariaLabel:u});g&&(this.hidePopup=l=g.hideFunc),r.afterInit().then(()=>{t(n),r.afterGuiAttached({container:i,hidePopup:l})}),e.setMenuVisible(!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,i,e)}trapFocusWithin(e,t){e.key!==m.TAB||e.defaultPrevented||this.focusService.findNextFocusableElement(t,!1,e.shiftKey)||(e.preventDefault(),this.focusService.focusInto(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,i){this.eventService.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:t,column:i??null,columnGroup:null})}isMenuEnabled(e){return e.isFilterAllowed()&&(e.getColDef().menuTabs??["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}},Wc=class extends v{constructor(){super(...arguments),this.beanName="resizeObserverService"}observeResize(e,t){const s=xo(this.gos).ResizeObserver,o=s?new s(t):null;return o==null||o.observe(e),()=>o==null?void 0:o.disconnect()}},zc=class extends v{constructor(){super(...arguments),this.beanName="animationFrameService",this.createTasksP1={list:[],sorted:!1},this.createTasksP2={list:[],sorted:!1},this.destroyTasks=[],this.ticking=!1,this.scrollGoingDown=!0,this.lastPage=0,this.lastScrollTop=0,this.taskCount=0,this.cancelledTasks=new Set}wireBeans(e){this.ctrlsService=e.ctrlsService,this.paginationService=e.paginationService}setScrollTop(e){var i;const t=this.gos.get("pagination");if(this.scrollGoingDown=e>=this.lastScrollTop,t&&e===0){const s=((i=this.paginationService)==null?void 0:i.getCurrentPage())??0;s!==this.lastPage&&(this.lastPage=s,this.scrollGoingDown=!0)}this.lastScrollTop=e}postConstruct(){this.useAnimationFrame=!this.gos.get("suppressAnimationFrame")}isOn(){return this.useAnimationFrame}verifyAnimationFrameOn(e){this.useAnimationFrame===!1&&S(`AnimationFrameService.${e} called but animation frames are off`)}createTask(e,t,i){this.verifyAnimationFrameOn(i);const s={task:e,index:t,createOrder:++this.taskCount};this.addTaskToList(this[i],s),this.schedule()}cancelTask(e){this.cancelledTasks.add(e)}addTaskToList(e,t){e.list.push(t),e.sorted=!1}sortTaskList(e){if(e.sorted)return;const t=this.scrollGoingDown?1:-1;e.list.sort((i,s)=>i.index!==s.index?t*(s.index-i.index):s.createOrder-i.createOrder),e.sorted=!0}addDestroyTask(e){this.verifyAnimationFrameOn("createTasksP3"),this.destroyTasks.push(e),this.schedule()}executeFrame(e){this.verifyAnimationFrameOn("executeFrame");const t=this.createTasksP1,i=t.list,s=this.createTasksP2,o=s.list,r=this.destroyTasks,n=new Date().getTime();let l=new Date().getTime()-n;const a=e<=0,d=this.ctrlsService.getGridBodyCtrl();for(;a||l<e;){if(!d.getScrollFeature().scrollGridIfNeeded()){let c;if(i.length)this.sortTaskList(t),c=i.pop().task;else if(o.length)this.sortTaskList(s),c=o.pop().task;else if(r.length)c=r.pop();else{this.cancelledTasks.clear();break}this.cancelledTasks.has(c)||c()}l=new Date().getTime()-n}i.length||o.length||r.length?this.requestFrame():this.stopTicking()}stopTicking(){this.ticking=!1}flushAllFrames(){this.useAnimationFrame&&this.executeFrame(-1)}schedule(){this.useAnimationFrame&&(this.ticking||(this.ticking=!0,this.requestFrame()))}requestFrame(){const e=this.executeFrame.bind(this,60);this.requestAnimationFrame(e)}requestAnimationFrame(e){const t=xo(this.gos);t.requestAnimationFrame?t.requestAnimationFrame(e):t.webkitRequestAnimationFrame?t.webkitRequestAnimationFrame(e):t.setTimeout(e,0)}isQueueEmpty(){return!this.ticking}debounce(e){let t=!1;return()=>{if(!this.isOn()){window.setTimeout(e,0);return}t||(t=!0,this.addDestroyTask(()=>{t=!1,e()}))}}},_c=class extends v{constructor(){super(...arguments),this.beanName="expansionService"}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){this.isClientSideRowModel=N(this.gos)}expandRows(e){if(!this.isClientSideRowModel)return;const t=new Set(e);this.rowModel.forEachNode(i=>{i.id&&t.has(i.id)&&(i.expanded=!0)}),this.onGroupExpandedOrCollapsed()}getExpandedRows(){const e=[];return this.rowModel.forEachNode(({expanded:t,id:i})=>{t&&i&&e.push(i)}),e}expandAll(e){this.isClientSideRowModel&&this.rowModel.expandOrCollapseAll(e)}setRowNodeExpanded(e,t,i,s){e&&(i&&e.parent&&e.parent.level!==-1&&this.setRowNodeExpanded(e.parent,t,i,s),e.setExpanded(t,void 0,s))}onGroupExpandedOrCollapsed(){this.isClientSideRowModel&&this.rowModel.refreshModel({step:"map"})}},Uc=class extends v{constructor(){super(...arguments),this.beanName="menuService"}wireBeans(e){this.valueService=e.valueService,this.filterMenuFactory=e.filterMenuFactory,this.ctrlsService=e.ctrlsService,this.animationFrameService=e.animationFrameService,this.filterManager=e.filterManager,this.rowRenderer=e.rowRenderer,this.columnChooserFactory=e.columnChooserFactory,this.contextMenuFactory=e.contextMenuFactory,this.enterpriseMenuFactory=e.enterpriseMenuFactory}postConstruct(){this.activeMenuFactory=this.enterpriseMenuFactory??this.filterMenuFactory}showColumnMenu(e){this.showColumnMenuCommon(this.activeMenuFactory,e,"columnMenu")}showFilterMenu(e){const t=this.enterpriseMenuFactory&&this.isLegacyMenuEnabled()?this.enterpriseMenuFactory:this.filterMenuFactory;this.showColumnMenuCommon(t,e,e.containerType,!0)}showHeaderContextMenu(e,t,i){this.activeMenuFactory.showMenuAfterContextMenuEvent(e,t,i)}getContextMenuPosition(e,t){const i=this.getRowCtrl(e),s=this.getCellGui(i,t);if(!s)return i?{x:0,y:i.getRowYPosition()}:{x:0,y:0};const o=s.getBoundingClientRect();return{x:o.x+o.width/2,y:o.y+o.height/2}}showContextMenu(e){var r;const t=e.rowNode,i=e.column;let{anchorToElement:s,value:o}=e;t&&i&&o==null&&(o=this.valueService.getValueForDisplay(i,t)),s==null&&(s=this.getContextMenuAnchorElement(t,i)),(r=this.contextMenuFactory)==null||r.onContextMenu(e.mouseEvent??null,e.touchEvent??null,t??null,i??null,o,s)}showColumnChooser(e){var t;(t=this.columnChooserFactory)==null||t.showColumnChooser(e)}hidePopupMenu(){var e;(e=this.contextMenuFactory)==null||e.hideActiveMenu(),this.activeMenuFactory.hideActiveMenu()}hideColumnChooser(){var e;(e=this.columnChooserFactory)==null||e.hideActiveColumnChooser()}isColumnMenuInHeaderEnabled(e){const{suppressMenu:t,suppressHeaderMenuButton:i}=e.getColDef();return!(i??t)&&this.activeMenuFactory.isMenuEnabled(e)&&(this.isLegacyMenuEnabled()||!!this.enterpriseMenuFactory)}isFilterMenuInHeaderEnabled(e){var t;return!e.getColDef().suppressHeaderFilterButton&&!!((t=this.filterManager)!=null&&t.isFilterAllowed(e))}isHeaderContextMenuEnabled(e){const t=e&&Ge(e)?e.getColDef():e==null?void 0:e.getColGroupDef();return!(t!=null&&t.suppressHeaderContextMenu)&&this.getColumnMenuType()==="new"}isHeaderMenuButtonAlwaysShowEnabled(){return this.isSuppressMenuHide()}isHeaderMenuButtonEnabled(){const e=!this.isSuppressMenuHide();return!(He()&&e)}isHeaderFilterButtonEnabled(e){return this.isFilterMenuInHeaderEnabled(e)&&!this.isLegacyMenuEnabled()&&!this.isFloatingFilterButtonDisplayed(e)}isFilterMenuItemEnabled(e){var t;return!!((t=this.filterManager)!=null&&t.isFilterAllowed(e))&&!this.isLegacyMenuEnabled()&&!this.isFilterMenuInHeaderEnabled(e)&&!this.isFloatingFilterButtonDisplayed(e)}isColumnMenuAnchoringEnabled(){return!this.isLegacyMenuEnabled()}areAdditionalColumnMenuItemsEnabled(){return this.getColumnMenuType()==="new"}isLegacyMenuEnabled(){return this.getColumnMenuType()==="legacy"}isFloatingFilterButtonEnabled(e){var s;const t=e.getColDef(),i=(s=t.floatingFilterComponentParams)==null?void 0:s.suppressFilterButton;return i!=null&&S("As of v31.1, 'colDef.floatingFilterComponentParams.suppressFilterButton' is deprecated. Use 'colDef.suppressFloatingFilterButton' instead."),t.suppressFloatingFilterButton==null?!i:!t.suppressFloatingFilterButton}getColumnMenuType(){return this.gos.get("columnMenu")}isFloatingFilterButtonDisplayed(e){return!!e.getColDef().floatingFilter&&this.isFloatingFilterButtonEnabled(e)}isSuppressMenuHide(){const e=this.gos.get("suppressMenuHide");return this.isLegacyMenuEnabled()?this.gos.exists("suppressMenuHide")?e:!1:e}showColumnMenuCommon(e,t,i,s){const{positionBy:o}=t,r=t.column;if(o==="button"){const{buttonElement:n}=t;e.showMenuAfterButtonClick(r,n,i,s)}else if(o==="mouse"){const{mouseEvent:n}=t;e.showMenuAfterMouseEvent(r,n,i,s)}else r&&(this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(r,"auto"),this.animationFrameService.requestAnimationFrame(()=>{var l;const n=(l=this.ctrlsService.getHeaderRowContainerCtrl(r.getPinned()))==null?void 0:l.getHeaderCtrlForColumn(r);n&&e.showMenuAfterButtonClick(r,n.getAnchorElementForMenu(s),i,!0)}))}getRowCtrl(e){const{rowIndex:t,rowPinned:i}=e||{};if(t!=null)return this.rowRenderer.getRowByPosition({rowIndex:t,rowPinned:i})||void 0}getCellGui(e,t){if(!e||!t)return;const i=e.getCellCtrl(t);return(i==null?void 0:i.getGui())||void 0}getContextMenuAnchorElement(e,t){const i=this.ctrlsService.getGridBodyCtrl().getGridBodyElement(),s=this.getRowCtrl(e);if(!s)return i;const o=this.getCellGui(s,t);return o||(s.isFullWidth()?s.getFullWidthElement():i)}},Kc=class extends _e{constructor(e){super(e,"ag-text-area",null,"textarea")}setValue(e,t){const i=super.setValue(e,t);return this.eInput.value=e,i}setCols(e){return this.eInput.cols=e,this}setRows(e){return this.eInput.rows=e,this}},$c={selector:"AG-INPUT-TEXT-AREA",component:Kc},jc=class extends pt{constructor(){super(`<div class="ag-large-text"> <ag-input-text-area data-ref="eTextArea" class="ag-large-text-input"></ag-input-text-area> </div>`,[$c]),this.eTextArea=b}init(e){this.params=e,this.focusAfterAttached=e.cellStartedEdit,this.eTextArea.setMaxLength(e.maxLength||200).setCols(e.cols||60).setRows(e.rows||10),F(e.value,!0)&&this.eTextArea.setValue(e.value.toString(),!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.activateTabIndex()}onKeyDown(e){const t=e.key;(t===m.LEFT||t===m.UP||t===m.RIGHT||t===m.DOWN||e.shiftKey&&t===m.ENTER)&&e.stopPropagation()}afterGuiAttached(){const e=this.localeService.getLocaleTextFunc();this.eTextArea.setInputAriaLabel(e("ariaInputEditor","Input Editor")),this.focusAfterAttached&&this.eTextArea.getFocusableElement().focus()}getValue(){const e=this.eTextArea.getValue();return!F(e)&&!F(this.params.value)?this.params.value:this.params.parseValue(e)}},qc=class extends pt{constructor(e){super('<div class="ag-popup-editor" tabindex="-1"/>'),this.params=e}postConstruct(){Ye(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params,i=s=>{Zi(this.gos,s,t.node,t.column,!0)||t.onKeyDown(s)};this.addManagedElementListeners(e,{keydown:i})}},Yc=class extends pt{constructor(){super(`<div class="ag-cell-edit-wrapper"> <ag-select class="ag-cell-editor" data-ref="eSelect"></ag-select> </div>`,[sd]),this.eSelect=b,this.startedByEnter=!1}wireBeans(e){this.valueService=e.valueService}init(e){this.focusAfterAttached=e.cellStartedEdit;const{eSelect:t,valueService:i,gos:s}=this,{values:o,value:r,eventKey:n}=e;if(A(o)){S("no values found for select cellEditor");return}this.startedByEnter=n!=null?n===m.ENTER:!1;let l=!1;o.forEach(c=>{const u={value:c},g=i.formatValue(e.column,null,c),p=g!=null;u.text=p?g:c,t.addOption(u),l=l||r===c}),l?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:a,valueListMaxWidth:d,valueListMaxHeight:h}=e;a!=null&&t.setPickerGap(a),h!=null&&t.setPickerMaxHeight(h),d!=null&&t.setPickerMaxWidth(d),s.get("editType")!=="fullRow"&&this.addManagedListeners(this.eSelect,{selectedItem:()=>e.stopEditing()})}afterGuiAttached(){this.focusAfterAttached&&this.eSelect.getFocusableElement().focus(),this.startedByEnter&&setTimeout(()=>{this.isAlive()&&this.eSelect.showPicker()})}focusIn(){this.eSelect.getFocusableElement().focus()}getValue(){return this.eSelect.getValue()}isPopup(){return!1}},mi=class extends pt{constructor(e){super(` <div class="ag-cell-edit-wrapper"> ${e.getTemplate()} </div>`,e.getAgComponents()),this.cellEditorInput=e,this.eInput=b}init(e){this.params=e;const{cellStartedEdit:t,eventKey:i,suppressPreventDefault:s}=e,o=this.eInput;this.cellEditorInput.init(o,e);let r,n=!0;t?(this.focusAfterAttached=!0,i===m.BACKSPACE||i===m.DELETE?r="":i&&i.length===1?s?n=!1:r=i:(r=this.cellEditorInput.getStartValue(),i!==m.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,r=this.cellEditorInput.getStartValue()),n&&r!=null&&o.setStartValue(r),this.addManagedElementListeners(o.getGui(),{keydown:l=>{const{key:a}=l;(a===m.PAGE_UP||a===m.PAGE_DOWN)&&l.preventDefault()}})}afterGuiAttached(){var s,o;const e=this.localeService.getLocaleTextFunc(),t=this.eInput;if(t.setInputAriaLabel(e("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;we()||t.getFocusableElement().focus();const i=t.getInputElement();this.highlightAllOnFocus?i.select():(o=(s=this.cellEditorInput).setCaret)==null||o.call(s)}focusIn(){const e=this.eInput,t=e.getFocusableElement(),i=e.getInputElement();t.focus(),i.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}},Qc=class{getTemplate(){return'<ag-input-text-field class="ag-cell-editor" data-ref="eInput"></ag-input-text-field>'}getAgComponents(){return[fi]}init(e,t){this.eInput=e,this.params=t,t.maxLength!=null&&e.setMaxLength(t.maxLength)}getValue(){const e=this.eInput.getValue();return!F(e)&&!F(this.params.value)?this.params.value:this.params.parseValue(e)}getStartValue(){return this.params.useFormatter||this.params.column.getColDef().refData?this.params.formatValue(this.params.value):this.params.value}setCaret(){const e=this.eInput.getValue(),t=F(e)&&e.length||0;t&&this.eInput.getInputElement().setSelectionRange(t,t)}},on=class extends mi{constructor(){super(new Qc)}},Xc=class{getTemplate(){return'<ag-input-number-field class="ag-cell-editor" data-ref="eInput"></ag-input-number-field>'}getAgComponents(){return[gd]}init(e,t){this.eInput=e,this.params=t,t.max!=null&&e.setMax(t.max),t.min!=null&&e.setMin(t.min),t.precision!=null&&e.setPrecision(t.precision),t.step!=null&&e.setStep(t.step);const i=e.getInputElement();t.preventStepping?e.addManagedElementListeners(i,{keydown:this.preventStepping}):t.showStepperButtons&&i.classList.add("ag-number-field-input-stepper")}preventStepping(e){(e.key===m.UP||e.key===m.DOWN)&&e.preventDefault()}getValue(){const e=this.eInput.getValue();if(!F(e)&&!F(this.params.value))return this.params.value;let t=this.params.parseValue(e);if(t==null)return t;if(typeof t=="string"){if(t==="")return null;t=Number(t)}return isNaN(t)?null:t}getStartValue(){return this.params.value}setCaret(){we()&&this.eInput.getInputElement().focus({preventScroll:!0})}},Jc=class extends mi{constructor(){super(new Xc)}},Zc=class extends Ze{constructor(e){super(e,"ag-date-field","date")}postConstruct(){super.postConstruct();const e=we();this.addManagedListeners(this.eInput,{wheel:this.onWheel.bind(this),mousedown:()=>{this.isDisabled()||e||this.eInput.focus()}}),this.eInput.step="any"}onWheel(e){V(this.gos)===this.eInput&&e.preventDefault()}setMin(e){const t=e instanceof Date?de(e??null,!1)??void 0:e;return this.min===t?this:(this.min=t,ae(this.eInput,"min",t),this)}setMax(e){const t=e instanceof Date?de(e??null,!1)??void 0:e;return this.max===t?this:(this.max=t,ae(this.eInput,"max",t),this)}setStep(e){return this.step===e?this:(this.step=e,ae(this.eInput,"step",e),this)}getDate(){if(this.eInput.validity.valid)return Z(this.getValue())??void 0}setDate(e,t){this.setValue(de(e??null,!1),t)}},rn={selector:"AG-INPUT-DATE-FIELD",component:Zc},eu=class{getTemplate(){return'<ag-input-date-field class="ag-cell-editor" data-ref="eInput"></ag-input-date-field>'}getAgComponents(){return[rn]}init(e,t){this.eInput=e,this.params=t,t.min!=null&&e.setMin(t.min),t.max!=null&&e.setMax(t.max),t.step!=null&&e.setStep(t.step)}getValue(){const e=this.eInput.getDate();return!F(e)&&!F(this.params.value)?this.params.value:e??null}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return de(e,!1)}},tu=class extends mi{constructor(){super(new eu)}},iu=class{constructor(e){this.getDataTypeService=e}getTemplate(){return'<ag-input-date-field class="ag-cell-editor" data-ref="eInput"></ag-input-date-field>'}getAgComponents(){return[rn]}init(e,t){this.eInput=e,this.params=t,t.min!=null&&e.setMin(t.min),t.max!=null&&e.setMax(t.max),t.step!=null&&e.setStep(t.step)}getValue(){const e=this.formatDate(this.eInput.getDate());return!F(e)&&!F(this.params.value)?this.params.value:this.params.parseValue(e??"")}getStartValue(){return de(this.parseDate(this.params.value??void 0)??null,!1)}parseDate(e){const t=this.getDataTypeService();return t?t.getDateParserFunction(this.params.column)(e):Z(e)??void 0}formatDate(e){const t=this.getDataTypeService();return t?t.getDateFormatterFunction(this.params.column)(e):de(e??null,!1)??void 0}},su=class extends mi{wireBeans(e){this.dataTypeService=e.dataTypeService}constructor(){super(new iu(()=>this.dataTypeService))}},ou=class extends pt{constructor(){super(` <div class="ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit"> <ag-checkbox role="presentation" data-ref="eCheckbox"></ag-checkbox> </div>`,[Ps]),this.eCheckbox=b}init(e){this.params=e;const t=e.value??void 0;this.eCheckbox.setValue(t),this.eCheckbox.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(t),this.addManagedListeners(this.eCheckbox,{fieldValueChanged:s=>this.setAriaLabel(s.selected)})}getValue(){return this.eCheckbox.getValue()}focusIn(){this.eCheckbox.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.localeService.getLocaleTextFunc(),i=Cs(t,e),s=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eCheckbox.setInputAriaLabel(`${s} (${i})`)}},yt=class{constructor(e){this.cellValueChanges=e}},Li=class extends yt{constructor(e,t,i,s){super(e),this.initialRange=t,this.finalRange=i,this.ranges=s}},ru=10,uo=class{constructor(e){this.actionStack=[],this.maxStackSize=e||ru,this.actionStack=new Array(this.maxStackSize)}pop(){return this.actionStack.pop()}push(e){e.cellValueChanges&&e.cellValueChanges.length>0&&(this.actionStack.length===this.maxStackSize&&this.actionStack.shift(),this.actionStack.push(e))}clear(){this.actionStack=[]}getCurrentStackSize(){return this.actionStack.length}},nu=class extends v{constructor(){super(...arguments),this.beanName="undoRedoService",this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.onCellValueChanged=e=>{const t={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned},i=this.activeCellEdit!==null&&this.cellPositionUtils.equals(this.activeCellEdit,t),s=this.activeRowEdit!==null&&this.rowPositionUtils.sameRow(this.activeRowEdit,t);if(!(i||s||this.isPasting||this.isRangeInAction))return;const{rowPinned:r,rowIndex:n,column:l,oldValue:a,value:d}=e,h={rowPinned:r,rowIndex:n,columnId:l.getColId(),newValue:d,oldValue:a};this.cellValueChanges.push(h)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}wireBeans(e){this.focusService=e.focusService,this.ctrlsService=e.ctrlsService,this.cellPositionUtils=e.cellPositionUtils,this.rowPositionUtils=e.rowPositionUtils,this.columnModel=e.columnModel,this.rangeService=e.rangeService}postConstruct(){if(!this.gos.get("undoRedoCellEditing"))return;const e=this.gos.get("undoRedoCellEditingLimit");if(e<=0)return;this.undoStack=new uo(e),this.redoStack=new uo(e),this.addListeners();const t=this.clearStacks.bind(this);this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this),modelUpdated:i=>{i.keepUndoRedoStack||this.clearStacks()},columnPivotModeChanged:t,newColumnsLoaded:t,columnGroupOpened:t,columnRowGroupChanged:t,columnMoved:t,columnPinned:t,columnVisible:t,rowDragEnd:t}),this.ctrlsService.whenReady(this,i=>{this.gridBodyCtrl=i.gridBodyCtrl})}getCurrentUndoStackSize(){return this.undoStack?this.undoStack.getCurrentStackSize():0}getCurrentRedoStackSize(){return this.redoStack?this.redoStack.getCurrentStackSize():0}undo(e){this.eventService.dispatchEvent({type:"undoStarted",source:e});const t=this.undoRedo(this.undoStack,this.redoStack,"initialRange","oldValue","undo");this.eventService.dispatchEvent({type:"undoEnded",source:e,operationPerformed:t})}redo(e){this.eventService.dispatchEvent({type:"redoStarted",source:e});const t=this.undoRedo(this.redoStack,this.undoStack,"finalRange","newValue","redo");this.eventService.dispatchEvent({type:"redoEnded",source:e,operationPerformed:t})}undoRedo(e,t,i,s,o){if(!e)return!1;const r=e.pop();return!r||!r.cellValueChanges?!1:(this.processAction(r,n=>n[s],o),r instanceof Li?this.processRange(this.rangeService,r.ranges||[r[i]]):this.processCell(r.cellValueChanges),t.push(r),!0)}processAction(e,t,i){e.cellValueChanges.forEach(s=>{const{rowIndex:o,rowPinned:r,columnId:n}=s,l={rowIndex:o,rowPinned:r},a=this.rowPositionUtils.getRowNode(l);a.displayed&&a.setDataValue(n,t(s),i)})}processRange(e,t){let i;e.removeAllCellRanges(!0),t.forEach((s,o)=>{if(!s)return;const r=s.startRow,n=s.endRow;o===t.length-1&&(i={rowPinned:r.rowPinned,rowIndex:r.rowIndex,columnId:s.startColumn.getColId()},this.setLastFocusedCell(i));const l={rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,rowEndIndex:n.rowIndex,rowEndPinned:n.rowPinned,columnStart:s.startColumn,columns:s.columns};e.addCellRange(l)})}processCell(e){const t=e[0],{rowIndex:i,rowPinned:s}=t,o={rowIndex:i,rowPinned:s},r=this.rowPositionUtils.getRowNode(o),n={rowPinned:t.rowPinned,rowIndex:r.rowIndex,columnId:t.columnId};this.setLastFocusedCell(n,this.rangeService)}setLastFocusedCell(e,t){const{rowIndex:i,columnId:s,rowPinned:o}=e,r=this.gridBodyCtrl.getScrollFeature(),n=this.columnModel.getCol(s);if(!n)return;r.ensureIndexVisible(i),r.ensureColumnVisible(n);const l={rowIndex:i,column:n,rowPinned:o};this.focusService.setFocusedCell({...l,forceBrowserFocus:!0}),t==null||t.setRangeToCell(l)}addListeners(){this.addManagedEventListeners({rowEditingStarted:e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}},rowEditingStopped:()=>{const e=new yt(this.cellValueChanges);this.pushActionsToUndoStack(e),this.activeRowEdit=null},cellEditingStarted:e=>{this.activeCellEdit={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned}},cellEditingStopped:e=>{if(this.activeCellEdit=null,e.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const i=new yt(this.cellValueChanges);this.pushActionsToUndoStack(i)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new yt(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new Li(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1},keyShortcutChangedCellStart:()=>{this.isRangeInAction=!0},keyShortcutChangedCellEnd:()=>{let e;this.rangeService&&ve(this.gos)?e=new Li(this.cellValueChanges,void 0,void 0,[...this.rangeService.getCellRanges()]):e=new yt(this.cellValueChanges),this.pushActionsToUndoStack(e),this.isRangeInAction=!1}})}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}};function lu(e){return e.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition()}function au(e){return e.ctrlsService.getGridBodyCtrl().getScrollFeature().getHScrollPosition()}function nn(e,t,i="auto"){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(t,i),"ensureVisible")}function ln(e,t,i){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureIndexVisible(t,i),"ensureVisible")}function du(e,t,i=null){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureNodeVisible(t,i),"ensureVisible")}function hu(e){var t;(t=e.undoRedoService)==null||t.undo("api")}function cu(e){var t;(t=e.undoRedoService)==null||t.redo("api")}function uu(e,t={}){return e.rowRenderer.getCellEditorInstances(t).map(bt)}function gu(e){return e.rowRenderer.getEditingCells()}function pu(e,t=!1){e.rowRenderer.stopEditing(t)}function fu(e,t){const i=e.columnModel.getCol(t.colKey);if(!i){S(`no column found for ${t.colKey}`);return}const s={rowIndex:t.rowIndex,rowPinned:t.rowPinned||null,column:i};t.rowPinned==null&&ln(e,t.rowIndex),nn(e,t.colKey);const r=e.navigationService.getCellByPosition(s);if(!r)return;const{focusService:n,gos:l}=e,a=()=>{const h=V(l),c=r.getGui();return h!==c&&!!(c!=null&&c.contains(h))},d=l.get("stopEditingWhenCellsLoseFocus")&&a();(d||!n.isCellFocused(s))&&n.setFocusedCell({...s,forceBrowserFocus:d,preventScrollOnBrowserFocus:!0}),r.startRowOrCellEdit(t.key)}function Cu(e){var t;return((t=e.undoRedoService)==null?void 0:t.getCurrentUndoStackSize())??0}function mu(e){var t;return((t=e.undoRedoService)==null?void 0:t.getCurrentRedoStackSize())??0}var vu=class extends v{constructor(){super(...arguments),this.beanName="editService"}wireBeans(e){this.navigationService=e.navigationService,this.userComponentFactory=e.userComponentFactory,this.valueService=e.valueService}startEditing(e,t=null,i=!1,s=null){var d;const o=this.createCellEditorParams(e,t,i),r=e.getColumn().getColDef(),n=this.userComponentFactory.getCellEditorDetails(r,o),l=(n==null?void 0:n.popupFromSelector)!=null?n.popupFromSelector:!!r.cellEditorPopup,a=(n==null?void 0:n.popupPositionFromSelector)!=null?n.popupPositionFromSelector:r.cellEditorPopupPosition;return e.setEditing(!0,n),e.getComp().setEditDetails(n,l,a,this.gos.get("reactiveCustomComponents")),this.eventService.dispatchEvent(e.createEvent(s,"cellEditingStarted")),!((d=n==null?void 0:n.params)!=null&&d.suppressPreventDefault)}stopEditing(e,t){const i=e.getComp(),{newValue:s,newValueExists:o}=this.takeValueFromCellEditor(t,i),r=e.getRowNode(),n=e.getColumn(),l=this.valueService.getValueForDisplay(n,r);let a=!1;return o&&(a=this.saveNewValue(e,l,s,r,n)),e.setEditing(!1,void 0),i.setEditDetails(),e.updateAndFormatValue(!1),e.refreshCell({forceRefresh:!0,suppressFlash:!0}),this.eventService.dispatchEvent({...e.createEvent(null,"cellEditingStopped"),oldValue:l,newValue:s,valueChanged:a}),a}handleColDefChanged(e){const t=e.getCellEditor();if(t!=null&&t.refresh){const{eventKey:i,cellStartedEdit:s}=e.getEditCompDetails().params,o=this.createCellEditorParams(e,i,s),r=e.getColumn().getColDef(),n=this.userComponentFactory.getCellEditorDetails(r,o);t.refresh(n.params)}}setFocusOutOnEditor(e){const t=e.getComp().getCellEditor();t&&t.focusOut&&t.focusOut()}setFocusInOnEditor(e){const t=e.getComp(),i=t.getCellEditor();i!=null&&i.focusIn?i.focusIn():(e.focusCell(!0),e.onCellEditorAttached(()=>{var s,o;return(o=(s=t.getCellEditor())==null?void 0:s.focusIn)==null?void 0:o.call(s)}))}stopEditingAndFocus(e,t=!1,i=!1){e.stopRowOrCellEdit(),e.focusCell(!0),t||this.navigateAfterEdit(i,e.getCellPosition())}createPopupEditorWrapper(e){return new qc(e)}takeValueFromCellEditor(e,t){const i={newValueExists:!1};if(e)return i;const s=t.getCellEditor();return!s||s.isCancelAfterEnd&&s.isCancelAfterEnd()?i:{newValue:s.getValue(),newValueExists:!0}}saveNewValue(e,t,i,s,o){if(i===t)return!1;e.setSuppressRefreshCell(!0);const r=s.setDataValue(o,i,"edit");return e.setSuppressRefreshCell(!1),r}createCellEditorParams(e,t,i){const s=e.getColumn(),o=e.getRowNode();return this.gos.addGridCommonParams({value:this.valueService.getValueForDisplay(s,o),eventKey:t,column:s,colDef:s.getColDef(),rowIndex:e.getCellPosition().rowIndex,node:o,data:o.data,cellStartedEdit:i,onKeyDown:e.onKeyDown.bind(e),stopEditing:e.stopEditingAndFocus.bind(e),eGridCell:e.getGui(),parseValue:r=>this.valueService.parseValue(s,o,r,e.getValue()),formatValue:e.formatValue.bind(e)})}navigateAfterEdit(e,t){if(this.gos.get("enterNavigatesVerticallyAfterEdit")){const s=e?m.UP:m.DOWN;this.navigationService.navigateToNextCell(null,s,t,!1)}}},wu=class extends v{constructor(){super(...arguments),this.beanName="rowEditService"}startEditing(e,t=null,i=null,s=null){let o=!0;return e.getAllCellCtrls().reduce((n,l)=>{const a=l===i;return a?o=l.startEditing(t,a,s):l.startEditing(null,a,s),n?!0:l.isEditing()},!1)&&this.setEditing(e,!0),o}stopEditing(e,t=!1){const i=e.getAllCellCtrls(),s=e.isEditing();e.setStoppingRowEdit(!0);let o=!1;for(const r of i){const n=r.stopEditing(t);s&&!t&&!o&&n&&(o=!0)}o&&this.eventService.dispatchEvent(e.createRowEvent("rowValueChanged")),s&&this.setEditing(e,!1),e.setStoppingRowEdit(!1)}setEditing(e,t){e.setEditingRow(t),e.forEachGui(void 0,s=>s.rowComp.addOrRemoveCssClass("ag-row-editing",t));const i=t?e.createRowEvent("rowEditingStarted"):e.createRowEvent("rowEditingStopped");this.eventService.dispatchEvent(i)}},et={version:x,moduleName:"@ag-grid-community/edit-core",beans:[vu]},Su={version:x,moduleName:"@ag-grid-community/edit-api",apiFunctions:{undoCellEditing:hu,redoCellEditing:cu,getCellEditorInstances:uu,getEditingCells:gu,stopEditing:pu,startEditingCell:fu,getCurrentUndoSize:Cu,getCurrentRedoSize:mu},dependantModules:[et]},yu={version:x,moduleName:"@ag-grid-community/undo-redo-edit",beans:[nu],dependantModules:[et]},Ru={version:x,moduleName:"@ag-grid-community/full-row-edit",beans:[wu],dependantModules:[et]},an={version:x,moduleName:"@ag-grid-community/default-editor",userComponents:[{name:"agCellEditor",classImp:on}],dependantModules:[et]},Fu={version:x,moduleName:"@ag-grid-community/data-type-editors",userComponents:[{name:"agTextCellEditor",classImp:on},{name:"agNumberCellEditor",classImp:Jc,params:{suppressPreventDefault:!0}},{name:"agDateCellEditor",classImp:tu},{name:"agDateStringCellEditor",classImp:su},{name:"agCheckboxCellEditor",classImp:ou}],dependantModules:[an]},bu={version:x,moduleName:"@ag-grid-community/select-editor",userComponents:[{name:"agSelectCellEditor",classImp:Yc}],dependantModules:[et]},Pu={version:x,moduleName:"@ag-grid-community/large-text-editor",userComponents:[{name:"agLargeTextCellEditor",classImp:jc}],dependantModules:[et]},Du={version:x,moduleName:"@ag-grid-community/all-editors",dependantModules:[an,Fu,bu,Pu]},Eu={version:x,moduleName:"@ag-grid-community/editing",dependantModules:[et,yu,Ru,Du,Su]},Mu=class extends v{constructor(){super(...arguments),this.beanName="autoWidthCalculator"}wireBeans(e){this.rowRenderer=e.rowRenderer,this.ctrlsService=e.ctrlsService}postConstruct(){this.ctrlsService.whenReady(this,e=>{this.centerRowContainerCtrl=e.center})}getPreferredWidthForColumn(e,t){const i=this.getHeaderCellForColumn(e);if(!i)return-1;const s=this.rowRenderer.getAllCellsForColumn(e);return t||s.push(i),this.addElementsToContainerAndGetWidth(s)}getPreferredWidthForColumnGroup(e){const t=this.getHeaderCellForColumn(e);return t?this.addElementsToContainerAndGetWidth([t]):-1}addElementsToContainerAndGetWidth(e){const t=document.createElement("form");t.style.position="fixed";const i=this.centerRowContainerCtrl.getContainerElement();e.forEach(r=>this.cloneItemIntoDummy(r,t)),i.appendChild(t);const s=t.offsetWidth;i.removeChild(t);const o=this.getAutoSizePadding();return s+o}getAutoSizePadding(){return this.gos.get("autoSizePadding")}getHeaderCellForColumn(e){let t=null;return this.ctrlsService.getHeaderRowContainerCtrls().forEach(i=>{const s=i.getHtmlElementForColumnHeader(e);s!=null&&(t=s)}),t}cloneItemIntoDummy(e,t){const i=e.cloneNode(!0);i.style.width="",i.style.position="static",i.style.left="";const s=document.createElement("div"),o=s.classList;["ag-header-cell","ag-header-group-cell"].some(l=>i.classList.contains(l))?(o.add("ag-header","ag-header-row"),s.style.position="static"):o.add("ag-row");let n=e.parentElement;for(;n;){if(["ag-header-row","ag-row"].some(a=>n.classList.contains(a))){for(let a=0;a<n.classList.length;a++){const d=n.classList[a];d!="ag-row-position-absolute"&&o.add(d)}break}n=n.parentElement}s.appendChild(i),t.appendChild(s)}},xu=class extends v{constructor(e,t){super(),this.createRowCon=e,this.destroyRowCtrls=t,this.stickyTopRowCtrls=[],this.stickyBottomRowCtrls=[],this.extraTopHeight=0,this.extraBottomHeight=0}wireBeans(e){this.rowModel=e.rowModel,this.rowRenderer=e.rowRenderer,this.ctrlsService=e.ctrlsService,this.pageBoundsService=e.pageBoundsService}postConstruct(){this.isClientSide=N(this.gos),this.ctrlsService.whenReady(this,e=>{this.gridBodyCtrl=e.gridBodyCtrl}),this.resetStickyContainers()}getStickyTopRowCtrls(){return this.stickyTopRowCtrls}getStickyBottomRowCtrls(){return this.stickyBottomRowCtrls}setOffsetTop(e){this.extraTopHeight!==e&&(this.extraTopHeight=e,this.eventService.dispatchEvent({type:"stickyTopOffsetChanged",offset:e}))}setOffsetBottom(e){this.extraBottomHeight!==e&&(this.extraBottomHeight=e)}resetOffsets(){this.setOffsetBottom(0),this.setOffsetTop(0)}getExtraTopHeight(){return this.extraTopHeight}getExtraBottomHeight(){return this.extraBottomHeight}getLastPixelOfGroup(e){return this.isClientSide?this.getClientSideLastPixelOfGroup(e):this.getServerSideLastPixelOfGroup(e)}getFirstPixelOfGroup(e){return e.footer?e.sibling.rowTop+e.sibling.rowHeight-1:e.hasChildren()?e.rowTop-1:0}getServerSideLastPixelOfGroup(e){var t,i;if(this.isClientSide)throw new Error("This func should only be called in server side row model.");if(e.isExpandable()||e.footer){if(e.master)return e.detailNode.rowTop+e.detailNode.rowHeight;if(!e.sibling||Math.abs(e.sibling.rowIndex-e.rowIndex)===1){let o=(t=e.childStore)==null?void 0:t.getStoreBounds();return e.footer&&(o=(i=e.sibling.childStore)==null?void 0:i.getStoreBounds()),((o==null?void 0:o.heightPx)??0)+((o==null?void 0:o.topPx)??0)}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}getClientSideLastPixelOfGroup(e){if(!this.isClientSide)throw new Error("This func should only be called in client side row model.");if(e.isExpandable()||e.footer){if(e.footer&&e.rowIndex===0)return Number.MAX_SAFE_INTEGER;if(!e.sibling||Math.abs(e.sibling.rowIndex-e.rowIndex)===1){let s=e.footer?e.sibling:e;for(;s.isExpandable()&&s.expanded;)if(s.master)s=s.detailNode;else if(s.childrenAfterSort){if(s.childrenAfterSort.length===0)break;s=I(s.childrenAfterSort)}return s.rowTop+s.rowHeight}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}updateStickyRows(e){const t=e==="top";let i=0;if(!this.canRowsBeSticky())return this.refreshNodesAndContainerHeight(e,new Set,i);const s=t?this.rowRenderer.getFirstVisibleVerticalPixel()-this.extraTopHeight:this.rowRenderer.getLastVisibleVerticalPixel()-this.extraTopHeight,o=new Set,r=d=>{if(o.add(d),t){const h=this.getLastPixelOfGroup(d),c=s+i+d.rowHeight;h<c?d.stickyRowTop=i+(h-c):d.stickyRowTop=i}else{const h=this.getFirstPixelOfGroup(d),c=s-(i+d.rowHeight);h>c?d.stickyRowTop=i-(h-c):d.stickyRowTop=i}i=0,o.forEach(h=>{const c=h.stickyRowTop+h.rowHeight;i<c&&(i=c)})},n=this.areFooterRowsStickySuppressed(),l=this.gos.get("suppressGroupRowsSticky"),a=d=>{if(!d.displayed)return!1;if(d.footer){if(n===!0||n==="grand"&&d.level===-1||n==="group"&&d.level>-1)return!1;const h=d.sibling.rowIndex?d.sibling.rowIndex+1===d.rowIndex:!1;return e==="bottom"&&h?!1:!o.has(d)}return d.isExpandable()?l===!0||e==="bottom"?!1:!o.has(d)&&d.expanded:!1};for(let d=0;d<100;d++){let h=s+i;t||(h=s-i);const c=this.rowModel.getRowIndexAtPixel(h),u=this.rowModel.getRow(c);if(u==null)break;const p=this.getStickyAncestors(u).find(f=>(t?f.rowIndex<c:f.rowIndex>c)&&a(f));if(p){r(p);continue}if((t?u.rowTop<h:u.rowTop+u.rowHeight>h)&&a(u)){r(u);continue}break}return t||o.forEach(d=>{d.stickyRowTop=i-(d.stickyRowTop+d.rowHeight)}),this.refreshNodesAndContainerHeight(e,o,i)}areFooterRowsStickySuppressed(){const e=this.gos.get("suppressStickyTotalRow");if(e===!0)return!0;const t=!!this.gos.get("groupIncludeFooter")||e==="group",i=!!this.gos.get("groupIncludeTotalFooter")||e==="grand";return t&&i?!0:i?"grand":t?"group":!1}canRowsBeSticky(){const e=ci(this.gos),t=this.areFooterRowsStickySuppressed(),i=this.gos.get("suppressGroupRowsSticky");return e&&(!t||!i)}getStickyAncestors(e){const t=[];let i=e.footer?e.sibling:e.parent;for(;i;)i.sibling&&t.push(i.sibling),t.push(i),i=i.parent;return t.reverse()}checkStickyRows(){const e=this.updateStickyRows("top"),t=this.updateStickyRows("bottom");return e||t}destroyStickyCtrls(){this.resetStickyContainers()}resetStickyContainers(){this.refreshNodesAndContainerHeight("top",new Set,0),this.refreshNodesAndContainerHeight("bottom",new Set,0)}refreshStickyNode(e){const t=new Set;if(this.stickyTopRowCtrls.some(i=>i.getRowNode()===e)){for(let i=0;i<this.stickyTopRowCtrls.length;i++){const s=this.stickyTopRowCtrls[i].getRowNode();s!==e&&t.add(s)}this.refreshNodesAndContainerHeight("top",t,this.topContainerHeight)&&this.checkStickyRows();return}for(let i=0;i<this.stickyBottomRowCtrls.length;i++){const s=this.stickyBottomRowCtrls[i].getRowNode();s!==e&&t.add(s)}this.refreshNodesAndContainerHeight("bottom",t,this.bottomContainerHeight)&&this.checkStickyRows()}refreshNodesAndContainerHeight(e,t,i){const s=e==="top",o=s?this.stickyTopRowCtrls:this.stickyBottomRowCtrls,r={},n=[];for(let u=0;u<o.length;u++){const g=o[u].getRowNode();if(!t.has(g)){r[g.id]=o[u],g.sticky=!1;continue}n.push(o[u])}const l=new Set;for(let u=0;u<n.length;u++)l.add(n[u].getRowNode());const a=[];t.forEach(u=>{l.has(u)||(u.sticky=!0,a.push(this.createRowCon(u,!1,!1)))});let d=!!a.length||n.length!==o.length;s?this.topContainerHeight!==i&&(this.topContainerHeight=i,this.gridBodyCtrl.setStickyTopHeight(i),d=!0):this.bottomContainerHeight!==i&&(this.bottomContainerHeight=i,this.gridBodyCtrl.setStickyBottomHeight(i),d=!0),this.destroyRowCtrls(r,!1);const h=[...n,...a];h.sort((u,g)=>g.getRowNode().rowIndex-u.getRowNode().rowIndex),s||h.reverse(),h.forEach(u=>u.setRowTop(u.getRowNode().stickyRowTop));let c=0;return s?(t.forEach(u=>{u.rowIndex<this.pageBoundsService.getFirstRow()&&(c+=u.rowHeight)}),c>this.topContainerHeight&&(c=this.topContainerHeight),this.setOffsetTop(c)):(t.forEach(u=>{u.rowIndex>this.pageBoundsService.getLastRow()&&(c+=u.rowHeight)}),c>this.bottomContainerHeight&&(c=this.bottomContainerHeight),this.setOffsetBottom(c)),d?(s?this.stickyTopRowCtrls=h:this.stickyBottomRowCtrls=h,!0):!1}ensureRowHeightsValid(){let e=!1;const t=i=>{const s=i.getRowNode();if(s.rowHeightEstimated){const o=Le(this.gos,s);s.setRowHeight(o.height),e=!0}};return this.stickyTopRowCtrls.forEach(t),this.stickyBottomRowCtrls.forEach(t),e}},Au=class extends v{constructor(){super(...arguments),this.beanName="rowRenderer",this.destroyFuncsForColumnListeners=[],this.rowCtrlsByRowIndex={},this.zombieRowCtrls={},this.allRowCtrls=[],this.topRowCtrls=[],this.bottomRowCtrls=[],this.refreshInProgress=!1,this.dataFirstRenderedFired=!1,this.setupRangeSelectionListeners=()=>{const e=()=>{this.getAllCellCtrls().forEach(r=>r.onCellSelectionChanged())},t=()=>{this.getAllCellCtrls().forEach(r=>r.updateRangeBordersIfRangeCount())},i=()=>{this.eventService.addEventListener("cellSelectionChanged",e),this.eventService.addEventListener("columnMoved",t),this.eventService.addEventListener("columnPinned",t),this.eventService.addEventListener("columnVisible",t)},s=()=>{this.eventService.removeEventListener("cellSelectionChanged",e),this.eventService.removeEventListener("columnMoved",t),this.eventService.removeEventListener("columnPinned",t),this.eventService.removeEventListener("columnVisible",t)};this.addDestroyFunc(()=>s()),this.addManagedPropertyListeners(["enableRangeSelection","cellSelection"],()=>{ve(this.gos)?i():s()}),ve(this.gos)&&i()}}wireBeans(e){this.animationFrameService=e.animationFrameService,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.pinnedRowModel=e.pinnedRowModel,this.rowModel=e.rowModel,this.focusService=e.focusService,this.beans=e,this.rowContainerHeightService=e.rowContainerHeightService,this.ctrlsService=e.ctrlsService,this.environment=e.environment}postConstruct(){this.ctrlsService.whenReady(this,e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.initialise()})}initialise(){this.addManagedEventListeners({paginationChanged:this.onPageLoaded.bind(this),pinnedRowDataChanged:this.onPinnedRowDataChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),bodyScroll:this.onBodyScroll.bind(this),bodyHeightChanged:this.redraw.bind(this,{})}),this.addManagedPropertyListeners(["domLayout","embedFullWidthRows"],()=>this.onDomLayoutChanged()),this.addManagedPropertyListeners(["suppressMaxRenderedRowRestriction","rowBuffer"],()=>this.redraw()),this.addManagedPropertyListener("suppressCellFocus",e=>this.onSuppressCellFocusChanged(e.currentValue)),this.addManagedPropertyListeners(["groupSuppressBlankHeader","getBusinessKeyForNode","fullWidthCellRenderer","fullWidthCellRendererParams","suppressStickyTotalRow","groupRowRenderer","groupRowRendererParams","loadingCellRenderer","loadingCellRendererParams","detailCellRenderer","detailCellRendererParams","enableRangeSelection","enableCellTextSelection","rowSelection"],()=>this.redrawRows()),ci(this.gos)&&(N(this.gos)||De(this.gos))&&(this.stickyRowFeature=this.createManagedBean(new xu(this.createRowCon.bind(this),this.destroyRowCtrls.bind(this)))),this.registerCellEventListeners(),this.initialiseCache(),this.printLayout=z(this.gos,"print"),this.embedFullWidthRows=this.printLayout||this.gos.get("embedFullWidthRows"),this.redrawAfterModelUpdate()}initialiseCache(){if(this.gos.get("keepDetailRows")){const e=this.getKeepDetailRowsCount(),t=e??3;this.cachedRowCtrls=new Tu(t)}}getKeepDetailRowsCount(){return this.gos.get("keepDetailRowsCount")}getStickyTopRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyTopRowCtrls():[]}getStickyBottomRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyBottomRowCtrls():[]}updateAllRowCtrls(){const e=Oe(this.rowCtrlsByRowIndex),t=Oe(this.zombieRowCtrls),i=this.cachedRowCtrls?this.cachedRowCtrls.getEntries():[];t.length>0||i.length>0?this.allRowCtrls=[...e,...t,...i]:this.allRowCtrls=e}onCellFocusChanged(e){this.getAllCellCtrls().forEach(t=>t.onCellFocused(e)),this.getFullWidthRowCtrls().forEach(t=>t.onFullWidthRowFocused(e))}onSuppressCellFocusChanged(e){this.getAllCellCtrls().forEach(t=>t.onSuppressCellFocusChanged(e)),this.getFullWidthRowCtrls().forEach(t=>t.onSuppressCellFocusChanged(e))}registerCellEventListeners(){this.addManagedEventListeners({cellFocused:e=>{this.onCellFocusChanged(e)},cellFocusCleared:()=>this.onCellFocusChanged(),flashCells:e=>{this.getAllCellCtrls().forEach(t=>t.onFlashCells(e))},columnHoverChanged:()=>{this.getAllCellCtrls().forEach(e=>e.onColumnHover())},displayedColumnsChanged:()=>{this.getAllCellCtrls().forEach(e=>e.onDisplayedColumnsChanged())},displayedColumnsWidthChanged:()=>{this.printLayout&&this.getAllCellCtrls().forEach(e=>e.onLeftChanged())}}),this.setupRangeSelectionListeners(),this.refreshListenersToColumnsForCellComps(),this.addManagedEventListeners({gridColumnsChanged:this.refreshListenersToColumnsForCellComps.bind(this)}),this.addDestroyFunc(this.removeGridColumnListeners.bind(this))}removeGridColumnListeners(){this.destroyFuncsForColumnListeners.forEach(e=>e()),this.destroyFuncsForColumnListeners.length=0}refreshListenersToColumnsForCellComps(){this.removeGridColumnListeners(),this.columnModel.getCols().forEach(t=>{const i=a=>{this.getAllCellCtrls().forEach(d=>{d.getColumn()===t&&a(d)})},s=()=>{i(a=>a.onLeftChanged())},o=()=>{i(a=>a.onWidthChanged())},r=()=>{i(a=>a.onFirstRightPinnedChanged())},n=()=>{i(a=>a.onLastLeftPinnedChanged())},l=()=>{i(a=>a.onColDefChanged())};t.addEventListener("leftChanged",s),t.addEventListener("widthChanged",o),t.addEventListener("firstRightPinnedChanged",r),t.addEventListener("lastLeftPinnedChanged",n),t.addEventListener("colDefChanged",l),this.destroyFuncsForColumnListeners.push(()=>{t.removeEventListener("leftChanged",s),t.removeEventListener("widthChanged",o),t.removeEventListener("firstRightPinnedChanged",r),t.removeEventListener("lastLeftPinnedChanged",n),t.removeEventListener("colDefChanged",l)})})}onDomLayoutChanged(){const e=z(this.gos,"print"),t=e||this.gos.get("embedFullWidthRows"),i=t!==this.embedFullWidthRows||this.printLayout!==e;this.printLayout=e,this.embedFullWidthRows=t,i&&this.redrawAfterModelUpdate({domLayoutChanged:!0})}datasourceChanged(){this.firstRenderedRow=0,this.lastRenderedRow=-1;const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e)}onPageLoaded(e){const t={recycleRows:e.keepRenderedRows,animate:e.animate,newData:e.newData,newPage:e.newPage,onlyBody:!0};this.redrawAfterModelUpdate(t)}getAllCellsForColumn(e){const t=[];return this.getAllRowCtrls().forEach(i=>{const s=i.getCellElement(e);s&&t.push(s)}),t}refreshFloatingRowComps(){this.refreshFloatingRows(this.topRowCtrls,"top"),this.refreshFloatingRows(this.bottomRowCtrls,"bottom")}getTopRowCtrls(){return this.topRowCtrls}getCentreRowCtrls(){return this.allRowCtrls}getBottomRowCtrls(){return this.bottomRowCtrls}refreshFloatingRows(e,t){const{pinnedRowModel:i,beans:s,printLayout:o}=this,r=Object.fromEntries(e.map(l=>[l.getRowNode().id,l]));i.forEachPinnedRow(t,(l,a)=>{const d=e[a];d&&i.getPinnedRowById(d.getRowNode().id,t)===void 0&&(d.destroyFirstPass(),d.destroySecondPass()),l.id in r?(e[a]=r[l.id],delete r[l.id]):e[a]=new qe(l,s,!1,!1,o)});const n=t==="top"?i.getPinnedTopRowCount():i.getPinnedBottomRowCount();e.length=n}onPinnedRowDataChanged(){const e={recycleRows:!0};this.redrawAfterModelUpdate(e)}redrawRow(e,t=!1){var i;if(e.sticky)this.stickyRowFeature.refreshStickyNode(e);else if((i=this.cachedRowCtrls)!=null&&i.has(e)){this.cachedRowCtrls.removeRow(e);return}else{const s=o=>{const r=o[e.rowIndex];r&&r.getRowNode()===e&&(r.destroyFirstPass(),r.destroySecondPass(),o[e.rowIndex]=this.createRowCon(e,!1,!1))};switch(e.rowPinned){case"top":s(this.topRowCtrls);break;case"bottom":s(this.bottomRowCtrls);break;default:s(this.rowCtrlsByRowIndex),this.updateAllRowCtrls()}}t||this.dispatchDisplayedRowsChanged(!1)}redrawRows(e){if(e!=null){e==null||e.forEach(i=>this.redrawRow(i,!0)),this.dispatchDisplayedRowsChanged(!1);return}this.redrawAfterModelUpdate()}getCellToRestoreFocusToAfterRefresh(e){const t=e!=null&&e.suppressKeepFocus?null:this.focusService.getFocusCellToUseAfterRefresh();if(t==null)return null;const i=V(this.gos),s=xt(this.gos,i,je.DOM_DATA_KEY_CELL_CTRL),o=xt(this.gos,i,qe.DOM_DATA_KEY_ROW_CTRL);return s||o?t:null}redrawAfterModelUpdate(e={}){this.getLockOnRefresh();const t=this.getCellToRestoreFocusToAfterRefresh(e);this.updateContainerHeights(),this.scrollToTopIfNewData(e);const i=!e.domLayoutChanged&&!!e.recycleRows,s=e.animate&&ot(this.gos),o=i?this.getRowsToRecycle():null;if(i||this.removeAllRowComps(),this.workOutFirstAndLastRowsToRender(),this.stickyRowFeature){this.stickyRowFeature.checkStickyRows();const r=this.stickyRowFeature.getExtraTopHeight()+this.stickyRowFeature.getExtraBottomHeight();r&&this.updateContainerHeights(r)}this.recycleRows(o,s),this.gridBodyCtrl.updateRowCount(),e.onlyBody||this.refreshFloatingRowComps(),this.dispatchDisplayedRowsChanged(),t!=null&&this.restoreFocusedCell(t),this.releaseLockOnRefresh()}scrollToTopIfNewData(e){var s;const t=e.newData||e.newPage,i=this.gos.get("suppressScrollOnNewData");t&&!i&&(this.gridBodyCtrl.getScrollFeature().scrollToTop(),(s=this.stickyRowFeature)==null||s.resetOffsets())}updateContainerHeights(e=0){if(this.printLayout){this.rowContainerHeightService.setModelHeight(null);return}let t=this.pageBoundsService.getCurrentPageHeight();t===0&&(t=1),this.rowContainerHeightService.setModelHeight(t+e)}getLockOnRefresh(){var e,t;if(this.refreshInProgress)throw new Error("AG Grid: cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, e.g. instead of api.redrawRows(), call setTimeout(function() { api.redrawRows(); }, 0). To see what part of your code that caused the refresh check this stacktrace.");this.refreshInProgress=!0,(t=(e=this.frameworkOverrides).getLockOnRefresh)==null||t.call(e)}releaseLockOnRefresh(){var e,t;this.refreshInProgress=!1,(t=(e=this.frameworkOverrides).releaseLockOnRefresh)==null||t.call(e)}isRefreshInProgress(){return this.refreshInProgress}restoreFocusedCell(e){e&&this.focusService.restoreFocusedCell(e,()=>{this.onCellFocusChanged(this.gos.addGridCommonParams({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,type:"cellFocused"}))})}stopEditing(e=!1){this.getAllRowCtrls().forEach(t=>{t.stopEditing(e)})}getAllCellCtrls(){const e=[],t=this.getAllRowCtrls(),i=t.length;for(let s=0;s<i;s++){const o=t[s].getAllCellCtrls(),r=o.length;for(let n=0;n<r;n++)e.push(o[n])}return e}getAllRowCtrls(){const e=this.stickyRowFeature&&this.stickyRowFeature.getStickyTopRowCtrls()||[],t=this.stickyRowFeature&&this.stickyRowFeature.getStickyBottomRowCtrls()||[],i=[...this.topRowCtrls,...this.bottomRowCtrls,...e,...t];for(const s in this.rowCtrlsByRowIndex)i.push(this.rowCtrlsByRowIndex[s]);return i}addRenderedRowListener(e,t,i){const s=this.rowCtrlsByRowIndex[t];s&&s.addEventListener(e,i)}flashCells(e={}){this.getCellCtrls(e.rowNodes,e.columns).forEach(t=>t.flashCell(e))}refreshCells(e={}){const t={forceRefresh:e.force,newData:!1,suppressFlash:e.suppressFlash};for(const i of this.getCellCtrls(e.rowNodes,e.columns))i.refreshOrDestroyCell(t);this.refreshFullWidth(e.rowNodes)}refreshFullWidth(e){if(!e)return;let t=null;this.stickyRowFeature&&Yi()&&(t=this.getCellToRestoreFocusToAfterRefresh()||null);for(const i of this.getRowCtrls(e)){if(!i.isFullWidth())continue;i.refreshFullWidth()||this.redrawRow(i.getRowNode(),!0)}this.dispatchDisplayedRowsChanged(!1),t&&this.restoreFocusedCell(t)}getCellRendererInstances(e){var o;const t=this.getCellCtrls(e.rowNodes,e.columns).map(r=>r.getCellRenderer()).filter(r=>r!=null);if((o=e.columns)!=null&&o.length)return t;const i=[],s=this.mapRowNodes(e.rowNodes);return this.getAllRowCtrls().forEach(r=>{if(s&&!this.isRowInMap(r.getRowNode(),s)||!r.isFullWidth())return;const n=r.getFullWidthCellRenderers();for(let l=0;l<n.length;l++){const a=n[l];a!=null&&i.push(a)}}),[...i,...t]}getCellEditorInstances(e){const t=[];return this.getCellCtrls(e.rowNodes,e.columns).forEach(i=>{const s=i.getCellEditor();s&&t.push(s)}),t}getEditingCells(){const e=[];return this.getAllCellCtrls().forEach(t=>{if(t.isEditing()){const i=t.getCellPosition();e.push(i)}}),e}mapRowNodes(e){if(!e)return;const t={top:{},bottom:{},normal:{}};return e.forEach(i=>{const s=i.id;switch(i.rowPinned){case"top":t.top[s]=i;break;case"bottom":t.bottom[s]=i;break;default:t.normal[s]=i;break}}),t}isRowInMap(e,t){const i=e.id;switch(e.rowPinned){case"top":return t.top[i]!=null;case"bottom":return t.bottom[i]!=null;default:return t.normal[i]!=null}}getRowCtrls(e){const t=this.mapRowNodes(e),i=this.getAllRowCtrls();return!e||!t?i:i.filter(s=>{const o=s.getRowNode();return this.isRowInMap(o,t)})}getCellCtrls(e,t){let i;F(t)&&(i={},t.forEach(o=>{const r=this.columnModel.getCol(o);F(r)&&(i[r.getId()]=!0)}));const s=[];return this.getRowCtrls(e).forEach(o=>{o.getAllCellCtrls().forEach(r=>{const n=r.getColumn().getId();i&&!i[n]||s.push(r)})}),s}destroy(){this.removeAllRowComps(!0),super.destroy()}removeAllRowComps(e=!1){const t=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(t,e),this.stickyRowFeature&&this.stickyRowFeature.destroyStickyCtrls()}getRowsToRecycle(){const e=[];re(this.rowCtrlsByRowIndex,(i,s)=>{s.getRowNode().id==null&&e.push(i)}),this.removeRowCtrls(e);const t={};return re(this.rowCtrlsByRowIndex,(i,s)=>{const o=s.getRowNode();t[o.id]=s}),this.rowCtrlsByRowIndex={},t}removeRowCtrls(e,t=!1){e.forEach(i=>{const s=this.rowCtrlsByRowIndex[i];s&&(s.destroyFirstPass(t),s.destroySecondPass()),delete this.rowCtrlsByRowIndex[i]})}onBodyScroll(e){e.direction==="vertical"&&this.redraw({afterScroll:!0})}redraw(e={}){const{afterScroll:t}=e;let i;this.stickyRowFeature&&Yi()&&(i=this.getCellToRestoreFocusToAfterRefresh()||void 0);const s=this.firstRenderedRow,o=this.lastRenderedRow;this.workOutFirstAndLastRowsToRender();let r=!1;if(this.stickyRowFeature){r=this.stickyRowFeature.checkStickyRows();const l=this.stickyRowFeature.getExtraTopHeight()+this.stickyRowFeature.getExtraBottomHeight();l&&this.updateContainerHeights(l)}const n=this.firstRenderedRow!==s||this.lastRenderedRow!==o;if(!(t&&!r&&!n)&&(this.getLockOnRefresh(),this.recycleRows(null,!1,t),this.releaseLockOnRefresh(),this.dispatchDisplayedRowsChanged(t&&!r),i!=null)){const l=this.getCellToRestoreFocusToAfterRefresh();i!=null&&l==null&&(this.animationFrameService.flushAllFrames(),this.restoreFocusedCell(i))}}removeRowCompsNotToDraw(e,t){const i={};e.forEach(r=>i[r]=!0);const o=Object.keys(this.rowCtrlsByRowIndex).filter(r=>!i[r]);this.removeRowCtrls(o,t)}calculateIndexesToDraw(e){const t=Cd(this.firstRenderedRow,this.lastRenderedRow),i=(o,r)=>{const n=r.getRowNode().rowIndex;n!=null&&(n<this.firstRenderedRow||n>this.lastRenderedRow)&&this.doNotUnVirtualiseRow(r)&&t.push(n)};re(this.rowCtrlsByRowIndex,i),re(e,i),t.sort((o,r)=>o-r);const s=[];for(let o=0;o<t.length;o++){const r=t[o],n=this.rowModel.getRow(r);n&&!n.sticky&&s.push(r)}return s}recycleRows(e,t=!1,i=!1){const s=this.calculateIndexesToDraw(e);(this.printLayout||i)&&(t=!1),this.removeRowCompsNotToDraw(s,!t),s.forEach(o=>{this.createOrUpdateRowCtrl(o,e,t,i)}),e&&(i&&!this.gos.get("suppressAnimationFrame")&&!this.printLayout?this.beans.animationFrameService.addDestroyTask(()=>{this.destroyRowCtrls(e,t),this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}):this.destroyRowCtrls(e,t)),this.updateAllRowCtrls()}dispatchDisplayedRowsChanged(e=!1){this.eventService.dispatchEvent({type:"displayedRowsChanged",afterScroll:e})}onDisplayedColumnsChanged(){const e=this.visibleColsService.isPinningLeft(),t=this.visibleColsService.isPinningRight();(this.pinningLeft!==e||t!==this.pinningRight)&&(this.pinningLeft=e,this.pinningRight=t,this.embedFullWidthRows&&this.redrawFullWidthEmbeddedRows())}redrawFullWidthEmbeddedRows(){const e=[];this.getFullWidthRowCtrls().forEach(t=>{const i=t.getRowNode().rowIndex;e.push(i.toString())}),this.refreshFloatingRowComps(),this.removeRowCtrls(e),this.redraw({afterScroll:!0})}getFullWidthRowCtrls(e){const t=this.mapRowNodes(e);return this.getAllRowCtrls().filter(i=>{if(!i.isFullWidth())return!1;const s=i.getRowNode();return!(t!=null&&!this.isRowInMap(s,t))})}createOrUpdateRowCtrl(e,t,i,s){let o,r=this.rowCtrlsByRowIndex[e];if(r||(o=this.rowModel.getRow(e),F(o)&&F(t)&&t[o.id]&&o.alreadyRendered&&(r=t[o.id],t[o.id]=null)),!r)if(o||(o=this.rowModel.getRow(e)),F(o))r=this.createRowCon(o,i,s);else return;return o&&(o.alreadyRendered=!0),this.rowCtrlsByRowIndex[e]=r,r}destroyRowCtrls(e,t){const i=[];re(e,(s,o)=>{if(o){if(this.cachedRowCtrls&&o.isCacheable()){this.cachedRowCtrls.addRow(o);return}if(o.destroyFirstPass(!t),t){const r=o.instanceId;this.zombieRowCtrls[r]=o,i.push(()=>{o.destroySecondPass(),delete this.zombieRowCtrls[r]})}else o.destroySecondPass()}}),t&&(i.push(()=>{this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}),Ln(i))}getRowBuffer(){return this.gos.get("rowBuffer")}getRowBufferInPixels(){const e=this.getRowBuffer(),t=Ke(this.gos);return e*t}workOutFirstAndLastRowsToRender(){this.rowContainerHeightService.updateOffset();let e,t;if(!this.rowModel.isRowsToRender())e=0,t=-1;else if(this.printLayout)this.environment.refreshRowHeightVariable(),e=this.pageBoundsService.getFirstRow(),t=this.pageBoundsService.getLastRow();else{const l=this.getRowBufferInPixels(),a=this.ctrlsService.getGridBodyCtrl(),d=this.gos.get("suppressRowVirtualisation");let h=!1,c,u;do{const w=this.pageBoundsService.getPixelOffset(),{pageFirstPixel:y,pageLastPixel:R}=this.pageBoundsService.getCurrentPagePixelRange(),P=this.rowContainerHeightService.getDivStretchOffset(),M=a.getScrollFeature().getVScrollPosition(),D=M.top,E=M.bottom;d?(c=y+P,u=R+P):(c=Math.max(D+w-l,y)+P,u=Math.min(E+w+l,R)+P),this.firstVisibleVPixel=Math.max(D+w,y)+P,this.lastVisibleVPixel=Math.min(E+w,R)+P,h=this.ensureAllRowsInRangeHaveHeightsCalculated(c,u)}while(h);let g=this.rowModel.getRowIndexAtPixel(c),p=this.rowModel.getRowIndexAtPixel(u);const C=this.pageBoundsService.getFirstRow(),f=this.pageBoundsService.getLastRow();g<C&&(g=C),p>f&&(p=f),e=g,t=p}const i=z(this.gos,"normal"),s=this.gos.get("suppressMaxRenderedRowRestriction"),o=Math.max(this.getRowBuffer(),500);i&&!s&&t-e>o&&(t=e+o);const r=e!==this.firstRenderedRow,n=t!==this.lastRenderedRow;(r||n)&&(this.firstRenderedRow=e,this.lastRenderedRow=t,this.eventService.dispatchEvent({type:"viewportChanged",firstRow:e,lastRow:t}))}dispatchFirstDataRenderedEvent(){this.dataFirstRenderedFired||(this.dataFirstRenderedFired=!0,window.requestAnimationFrame(()=>{this.beans.eventService.dispatchEvent({type:"firstDataRendered",firstRow:this.firstRenderedRow,lastRow:this.lastRenderedRow})}))}ensureAllRowsInRangeHaveHeightsCalculated(e,t){var r,n;const i=(r=this.pinnedRowModel)==null?void 0:r.ensureRowHeightsValid(),s=(n=this.stickyRowFeature)==null?void 0:n.ensureRowHeightsValid(),o=this.rowModel.ensureRowHeightsValid(e,t,this.pageBoundsService.getFirstRow(),this.pageBoundsService.getLastRow());return(o||s)&&this.eventService.dispatchEvent({type:"recalculateRowBounds"}),s||o||i?(this.updateContainerHeights(),!0):!1}getFirstVisibleVerticalPixel(){return this.firstVisibleVPixel}getLastVisibleVerticalPixel(){return this.lastVisibleVPixel}getFirstVirtualRenderedRow(){return this.firstRenderedRow}getLastVirtualRenderedRow(){return this.lastRenderedRow}doNotUnVirtualiseRow(e){const s=e.getRowNode(),o=this.focusService.isRowNodeFocused(s),r=e.isEditing(),n=s.detail;return o||r||n?!!this.isRowPresent(s):!1}isRowPresent(e){return this.rowModel.isRowPresent(e)?this.paginationService?this.paginationService.isRowPresent(e):!0:!1}createRowCon(e,t,i){const s=this.cachedRowCtrls?this.cachedRowCtrls.getRow(e):null;if(s)return s;const o=this.gos.get("suppressAnimationFrame"),r=i&&!o&&!this.printLayout;return new qe(e,this.beans,t,r,this.printLayout)}getRenderedNodes(){const e=this.rowCtrlsByRowIndex;return Object.values(e).map(t=>t.getRowNode())}getRowByPosition(e){let t;const{rowIndex:i}=e;switch(e.rowPinned){case"top":t=this.topRowCtrls[i];break;case"bottom":t=this.bottomRowCtrls[i];break;default:t=this.rowCtrlsByRowIndex[i],t||(t=this.getStickyTopRowCtrls().find(s=>s.getRowNode().rowIndex===i)||null,t||(t=this.getStickyBottomRowCtrls().find(s=>s.getRowNode().rowIndex===i)||null));break}return t}isRangeInRenderedViewport(e,t){if(e==null||t==null)return!1;const s=e>this.lastRenderedRow;return!(t<this.firstRenderedRow)&&!s}},Tu=class{constructor(e){this.entriesMap={},this.entriesList=[],this.maxCount=e}addRow(e){if(this.entriesMap[e.getRowNode().id]=e,this.entriesList.push(e),e.setCached(!0),this.entriesList.length>this.maxCount){const t=this.entriesList[0];t.destroyFirstPass(),t.destroySecondPass(),this.removeFromCache(t)}}getRow(e){if(e==null||e.id==null)return null;const t=this.entriesMap[e.id];return t?(this.removeFromCache(t),t.setCached(!1),t.getRowNode()!=e?null:t):null}has(e){return this.entriesMap[e.id]!=null}removeRow(e){const t=e.id,i=this.entriesMap[t];delete this.entriesMap[t],Q(this.entriesList,i)}removeFromCache(e){const t=e.getRowNode().id;delete this.entriesMap[t],Q(this.entriesList,e)}getEntries(){return this.entriesList}},Iu=class extends v{constructor(){super(...arguments),this.beanName="pinnedRowModel",this.nextId=0,this.pinnedTopRows=new go,this.pinnedBottomRows=new go}wireBeans(e){this.beans=e}postConstruct(){this.setPinnedRowData(this.gos.get("pinnedTopRowData"),"top"),this.setPinnedRowData(this.gos.get("pinnedBottomRowData"),"bottom"),this.addManagedPropertyListener("pinnedTopRowData",e=>this.setPinnedRowData(e.currentValue,"top")),this.addManagedPropertyListener("pinnedBottomRowData",e=>this.setPinnedRowData(e.currentValue,"bottom")),this.addManagedEventListeners({gridStylesChanged:this.onGridStylesChanges.bind(this)})}isEmpty(e){return(e==="top"?this.pinnedTopRows:this.pinnedBottomRows).isEmpty()}isRowsToRender(e){return!this.isEmpty(e)}onGridStylesChanges(e){if(e.rowHeightChanged){const t=i=>{i.setRowHeight(i.rowHeight,!0)};this.pinnedBottomRows.forEach(t),this.pinnedTopRows.forEach(t)}}ensureRowHeightsValid(){var s,o;let e=!1,t=0;const i=r=>{if(r.rowHeightEstimated){const n=Le(this.gos,r);r.setRowTop(t),r.setRowHeight(n.height),t+=n.height,e=!0}};return(s=this.pinnedBottomRows)==null||s.forEach(i),t=0,(o=this.pinnedTopRows)==null||o.forEach(i),this.eventService.dispatchEvent({type:"pinnedHeightChanged"}),e}setPinnedRowData(e,t){this.updateNodesFromRowData(e,t),this.eventService.dispatchEvent({type:"pinnedRowDataChanged"})}updateNodesFromRowData(e,t){const i=t==="top"?this.pinnedTopRows:this.pinnedBottomRows;if(e===void 0){i.clear();return}const s=ut(this.gos),o=t==="top"?be.ID_PREFIX_TOP_PINNED:be.ID_PREFIX_BOTTOM_PINNED,r=i.getIds(),n=[],l=new Set;let a=0,d=-1;for(const h of e){const c=(s==null?void 0:s({data:h,level:0,rowPinned:t}))??o+this.nextId++;if(l.has(c)){S("Duplicate ID",c,"found for pinned row with data",h,"When `getRowId` is defined, it must return unique IDs for all pinned rows. Use the `rowPinned` parameter.");continue}d++,l.add(c),n.push(c);const u=i.getById(c);if(u!==void 0)u.data!==h&&u.setData(h),a+=this.setRowTopAndRowIndex(u,a,d),r.delete(c);else{const g=new be(this.beans);g.id=c,g.data=h,g.rowPinned=t,a+=this.setRowTopAndRowIndex(g,a,d),i.push(g)}}r.forEach(h=>{var c;(c=i.getById(h))==null||c.clearRowTopAndRowIndex()}),i.removeAllById(r),i.setOrder(n)}setRowTopAndRowIndex(e,t,i){return e.setRowTop(t),e.setRowHeight(Le(this.gos,e).height),e.setRowIndex(i),e.rowHeight}getPinnedTopTotalHeight(){return this.getTotalHeight(this.pinnedTopRows)}getPinnedBottomTotalHeight(){return this.getTotalHeight(this.pinnedBottomRows)}getPinnedTopRowCount(){return this.pinnedTopRows.getSize()}getPinnedBottomRowCount(){return this.pinnedBottomRows.getSize()}getPinnedTopRow(e){return this.pinnedTopRows.getByIndex(e)}getPinnedBottomRow(e){return this.pinnedBottomRows.getByIndex(e)}getPinnedRowById(e,t){return t==="top"?this.pinnedTopRows.getById(e):this.pinnedBottomRows.getById(e)}forEachPinnedRow(e,t){return e==="top"?this.pinnedTopRows.forEach(t):this.pinnedBottomRows.forEach(t)}getTotalHeight(e){const t=e.getSize();if(t===0)return 0;const i=e.getByIndex(t-1);return i===void 0?0:i.rowTop+i.rowHeight}},go=class{constructor(){this.cache={},this.ordering=[]}getById(e){return this.cache[e]}getByIndex(e){const t=this.ordering[e];return this.cache[t]}push(e){this.cache[e.id]=e,this.ordering.push(e.id)}removeAllById(e){for(const t of e)delete this.cache[t];this.ordering=this.ordering.filter(t=>!e.has(t))}setOrder(e){this.ordering=e}forEach(e){this.ordering.forEach((t,i)=>{const s=this.cache[t];s&&e(s,i)})}clear(){this.ordering.length=0,this.cache={}}isEmpty(){return this.ordering.length===0}getSize(){return this.ordering.length}getIds(){return new Set(this.ordering)}},Lu=class extends v{constructor(e){super(),this.state="needsLoading",this.version=0,this.id=e}getId(){return this.id}load(){this.state="loading",this.loadFromDatasource()}getVersion(){return this.version}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}getState(){return this.state}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed",this.processServerFail()),this.dispatchLoadCompleted(!1)}success(e,t){this.successCommon(e,t)}pageLoaded(e,t,i){this.successCommon(e,{rowData:t,rowCount:i})}isRequestMostRecentAndLive(e){const t=e===this.version,i=this.isAlive();return t&&i}successCommon(e,t){this.dispatchLoadCompleted(),this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}dispatchLoadCompleted(e=!0){const t={type:"loadComplete",success:e,block:this};this.dispatchLocalEvent(t)}},Ou=class extends v{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){this.maxConcurrentRequests=this.getMaxConcurrentDatasourceRequests();const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=Y(this.performCheckBlocksToLoad.bind(this),e))}getMaxConcurrentDatasourceRequests(){const e=this.gos.get("maxConcurrentDatasourceRequests");if(e==null)return 2;if(!(e<=0))return e}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){Q(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad(),this.dispatchLocalEvent({type:"blockLoaded"}),this.activeBlockLoadsCount==0&&this.dispatchLocalEvent({type:"blockLoaderFinished"})}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),this.maxConcurrentRequests!=null&&this.activeBlockLoadsCount>=this.maxConcurrentRequests){this.gos.get("debug")&&ne("RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.getAvailableLoadingCount(),t=this.blocks.filter(i=>i.getState()==="needsLoading").slice(0,e);this.registerLoads(t.length),t.forEach(i=>i.load()),this.printCacheStatus()}getBlockState(){if(De(this.gos))return this.rowModel.getBlockStates();const e={};return this.blocks.forEach(t=>{const{id:i,state:s}=t.getBlockStateJson();e[i]=s}),e}printCacheStatus(){this.gos.get("debug")&&ne(`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}isLoading(){return this.activeBlockLoadsCount>0}registerLoads(e){this.activeBlockLoadsCount+=e}getAvailableLoadingCount(){return this.maxConcurrentRequests!==void 0?this.maxConcurrentRequests-this.activeBlockLoadsCount:void 0}},Gu={version:x,moduleName:"@ag-grid-community/row-node-block",beans:[Ou]},ku=class{constructor(){this.root=null,this.end=null,this.cachedRange=[]}init(e){this.rowModel=e}reset(){this.root=null,this.end=null,this.cachedRange.length=0}setRoot(e){this.root=e,this.end=null,this.cachedRange.length=0}setEndRange(e){this.end=e,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.root===null?!1:this.getRange().some(t=>t.id===e.id)}getRoot(){var e;return this.root&&((e=this.root)==null?void 0:e.key)===null&&(this.root=this.rowModel.getRowNode(this.root.id)??null),this.root}getEnd(){var e;return this.end&&((e=this.end)==null?void 0:e.key)===null&&(this.end=this.rowModel.getRowNode(this.end.id)??null),this.end}truncate(e){const t=this.getRange();if(t.length===0)return{keep:[],discard:[]};const i=t[0].id===this.root.id,s=t.findIndex(o=>o.id===e.id);if(s>-1){const o=t.slice(0,s),r=t.slice(s+1);return this.setEndRange(e),i?{keep:o,discard:r}:{keep:r,discard:o}}else return{keep:t,discard:[]}}extend(e,t=!1){const i=this.getRoot();if(i==null){const o=this.getRange().slice();return t&&e.depthFirstSearch(r=>!r.group&&o.push(r)),o.push(e),this.setRoot(e),{keep:o,discard:[]}}if(this.rowModel.getNodesInRangeForSelection(i,e).find(o=>{var r;return o.id===((r=this.end)==null?void 0:r.id)}))return this.setEndRange(e),{keep:this.getRange(),discard:[]};{const o=this.getRange().slice();return this.setEndRange(e),{keep:this.getRange(),discard:o}}}},Hu=class extends v{constructor(){super(...arguments),this.beanName="stylingService"}wireBeans(e){this.expressionService=e.expressionService}processAllCellClasses(e,t,i,s){this.processClassRules(void 0,e.cellClassRules,t,i,s),this.processStaticCellClasses(e,t,i)}processClassRules(e,t,i,s,o){if(t==null&&e==null)return;const r={},n={},l=(a,d)=>{a.split(" ").forEach(h=>{h.trim()!=""&&d(h)})};if(t){const a=Object.keys(t);for(let d=0;d<a.length;d++){const h=a[d],c=t[h];let u;typeof c=="string"?u=this.expressionService.evaluate(c,i):typeof c=="function"&&(u=c(i)),l(h,g=>{u?r[g]=!0:n[g]=!0})}}e&&o&&Object.keys(e).forEach(a=>l(a,d=>{r[d]||(n[d]=!0)})),o&&Object.keys(n).forEach(o),Object.keys(r).forEach(s)}getStaticCellClasses(e,t){const{cellClass:i}=e;if(!i)return[];let s;return typeof i=="function"?s=i(t):s=i,typeof s=="string"&&(s=[s]),s||[]}processStaticCellClasses(e,t,i){this.getStaticCellClasses(e,t).forEach(o=>{i(o)})}},Vu=class extends v{constructor(e){super(),this.skipTabGuardFocus=!1,this.forcingFocusOut=!1,this.allowFocus=!1;const{comp:t,eTopGuard:i,eBottomGuard:s,focusTrapActive:o,forceFocusOutWhenTabGuardsAreEmpty:r,isFocusableContainer:n,focusInnerElement:l,onFocusIn:a,onFocusOut:d,shouldStopEventPropagation:h,onTabKeyDown:c,handleKeyDown:u,eFocusableElement:g}=e;this.comp=t,this.eTopGuard=i,this.eBottomGuard=s,this.providedFocusInnerElement=l,this.eFocusableElement=g,this.focusTrapActive=!!o,this.forceFocusOutWhenTabGuardsAreEmpty=!!r,this.isFocusableContainer=!!n,this.providedFocusIn=a,this.providedFocusOut=d,this.providedShouldStopEventPropagation=h,this.providedOnTabKeyDown=c,this.providedHandleKeyDown=u}wireBeans(e){this.focusService=e.focusService}postConstruct(){this.createManagedBean(new Je(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.focusService.findFocusableElements(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)}findNextElementOutsideAndFocus(e){var a;const t=B(this.gos),i=this.focusService.findFocusableElements(t.body,null,!0),s=i.indexOf(e?this.eTopGuard:this.eBottomGuard);if(s===-1)return;let o,r;e?(o=0,r=s):(o=s+1,r=i.length);const n=i.slice(o,r),l=this.gos.get("tabIndex");n.sort((d,h)=>{const c=parseInt(d.getAttribute("tabindex")||"0"),u=parseInt(h.getAttribute("tabindex")||"0");return u===l?1:c===l?-1:c===0?1:u===0?-1:c-u}),(a=n[e?n.length-1:0])==null||a.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 i=this.getNextFocusableElement(e.shiftKey);t&&setTimeout(()=>this.activateTabGuards(),0),i&&(i.focus(),e.preventDefault())}focusInnerElement(e=!1){const t=this.focusService.findFocusableElements(this.eFocusableElement);this.tabGuardsAreActive()&&(t.splice(0,1),t.splice(t.length-1,1)),t.length&&t[e?t.length-1:0].focus({preventScroll:!0})}getNextFocusableElement(e){return this.focusService.findNextFocusableElement(this.eFocusableElement,!1,e)}forceFocusOutOfContainer(e=!1){if(this.forcingFocusOut)return;const t=e?this.eTopGuard:this.eBottomGuard;this.activateTabGuards(),this.skipTabGuardFocus=!0,this.forcingFocusOut=!0,t.focus(),window.setTimeout(()=>{this.forcingFocusOut=!1,this.activateTabGuards()})}isTabGuard(e,t){return e===this.eTopGuard&&!t||e===this.eBottomGuard&&(t??!0)}setAllowFocus(e){this.allowFocus=e}},Nu=class extends v{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:i,eFocusableElement:s}=this,o=[t,i],r={setTabIndex:C=>{o.forEach(f=>C!=null?f.setAttribute("tabindex",C):f.removeAttribute("tabindex"))}};this.addTabGuards(t,i);const{focusTrapActive:n=!1,onFocusIn:l,onFocusOut:a,focusInnerElement:d,handleKeyDown:h,onTabKeyDown:c,shouldStopEventPropagation:u,forceFocusOutWhenTabGuardsAreEmpty:g,isFocusableContainer:p}=e;this.tabGuardCtrl=this.createManagedBean(new Vu({comp:r,focusTrapActive:n,eTopGuard:t,eBottomGuard:i,eFocusableElement:s,onFocusIn:l,onFocusOut:a,focusInnerElement:d,handleKeyDown:h,onTabKeyDown:c,shouldStopEventPropagation:u,forceFocusOutWhenTabGuardsAreEmpty:g,isFocusableContainer:p}))}getTabGuardCtrl(){return this.tabGuardCtrl}createTabGuard(e){const t=B(this.gos).createElement("div"),i=e==="top"?"ag-tab-guard-top":"ag-tab-guard-bottom";return t.classList.add("ag-tab-guard",i),ee(t,"presentation"),t}addTabGuards(e,t){this.eFocusableElement.insertAdjacentElement("afterbegin",e),this.eFocusableElement.insertAdjacentElement("beforeend",t)}removeAllChildrenExceptTabGuards(){const e=[this.eTopGuard,this.eBottomGuard];U(this.comp.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}appendChild(e,t,i){Rs(t)||(t=t.getGui());const{eBottomGuard:s}=this;s?s.insertAdjacentElement("beforebegin",t):e(t,i)}},dn=class extends G{initialiseTabGuard(e){this.tabGuardFeature=this.createManagedBean(new Nu(this)),this.tabGuardFeature.initialiseTabGuard(e)}forceFocusOutOfContainer(e=!1){this.tabGuardFeature.forceFocusOutOfContainer(e)}appendChild(e,t){this.tabGuardFeature.appendChild(super.appendChild.bind(this),e,t)}},Bu=0,Wu=200,zu=class extends v{constructor(){super(...arguments),this.beanName="popupService",this.popupList=[]}wireBeans(e){this.ctrlsService=e.ctrlsService,this.resizeObserverService=e.resizeObserverService,this.environment=e.environment}postConstruct(){this.ctrlsService.whenReady(this,e=>{this.gridCtrl=e.gridCtrl}),this.addManagedEventListeners({gridStylesChanged:this.handleThemeChange.bind(this)})}getPopupParent(){const e=this.gos.get("popupParent");return e||this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:i}=e,s=this.getPopupIndex(i);if(s!==-1){const g=this.popupList[s];g.alignedToElement=t}const o=t.getBoundingClientRect(),r=this.getParentRect(),n=this.keepXYWithinBounds(i,o.top-r.top,0),l=i.clientWidth>0?i.clientWidth:200;i.style.minWidth=`${l}px`;const d=r.right-r.left-l;let h;this.gos.get("enableRtl")?(h=u(),h<0&&(h=c(),this.setAlignedStyles(i,"left")),h>d&&(h=0,this.setAlignedStyles(i,"right"))):(h=c(),h>d&&(h=u(),this.setAlignedStyles(i,"right")),h<0&&(h=0,this.setAlignedStyles(i,"left"))),i.style.left=`${h}px`,i.style.top=`${n}px`;function c(){return o.right-r.left-2}function u(){return o.left-r.left-l}}positionPopupUnderMouseEvent(e){const{ePopup:t,nudgeX:i,nudgeY:s,skipObserver:o}=e;this.positionPopup({ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:!0,skipObserver:o,updatePosition:()=>this.calculatePointerAlign(e.mouseEvent),postProcessCallback:()=>this.callPostProcessPopup(e.type,e.ePopup,null,e.mouseEvent,e.column,e.rowNode)})}calculatePointerAlign(e){const t=this.getParentRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}positionPopupByComponent(e){const{ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:o,eventSource:r,alignSide:n="left",position:l="over",column:a,rowNode:d,type:h}=e,c=r.getBoundingClientRect(),u=this.getParentRect(),g=this.getPopupIndex(t);if(g!==-1){const C=this.popupList[g];C.alignedToElement=r}const p=()=>{let C=c.left-u.left;n==="right"&&(C-=t.offsetWidth-c.width);let f;return l==="over"?(f=c.top-u.top,this.setAlignedStyles(t,"over")):(this.setAlignedStyles(t,"under"),this.shouldRenderUnderOrAbove(t,c,u,e.nudgeY||0)==="under"?f=c.top-u.top+c.height:f=c.top-t.offsetHeight-(s||0)*2-u.top),{x:C,y:f}};this.positionPopup({ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:o,updatePosition:p,postProcessCallback:()=>this.callPostProcessPopup(h,t,r,null,a,d)})}shouldRenderUnderOrAbove(e,t,i,s){const o=i.bottom-t.bottom,r=t.top-i.top,n=e.offsetHeight+s;return o>n?"under":r>n||r>o?"above":"under"}setAlignedStyles(e,t){const i=this.getPopupIndex(e);if(i===-1)return;const s=this.popupList[i],{alignedToElement:o}=s;!o||(["right","left","over","above","under"].forEach(n=>{o.classList.remove(`ag-has-popup-positioned-${n}`),e.classList.remove(`ag-popup-positioned-${n}`)}),!t)||(o.classList.add(`ag-has-popup-positioned-${t}`),e.classList.add(`ag-popup-positioned-${t}`))}callPostProcessPopup(e,t,i,s,o,r){const n=this.gos.getCallback("postProcessPopup");n&&n({column:o,rowNode:r,ePopup:t,type:e,eventSource:i,mouseEvent:s})}positionPopup(e){const{ePopup:t,keepWithinBounds:i,nudgeX:s,nudgeY:o,skipObserver:r,updatePosition:n}=e,l={width:0,height:0},a=(d=!1)=>{let{x:h,y:c}=n();d&&t.clientWidth===l.width&&t.clientHeight===l.height||(l.width=t.clientWidth,l.height=t.clientHeight,s&&(h+=s),o&&(c+=o),i&&(h=this.keepXYWithinBounds(t,h,1),c=this.keepXYWithinBounds(t,c,0)),t.style.left=`${h}px`,t.style.top=`${c}px`,e.postProcessCallback&&e.postProcessCallback())};if(a(),!r){const d=this.resizeObserverService.observeResize(t,()=>a(!0));setTimeout(()=>d(),Wu)}}getActivePopups(){return this.popupList.map(e=>e.element)}getPopupList(){return this.popupList}getParentRect(){const e=B(this.gos);let t=this.getPopupParent();return t===e.body?t=e.documentElement:getComputedStyle(t).position==="static"&&(t=t.offsetParent),or(t)}keepXYWithinBounds(e,t,i){const s=i===0,o=s?"clientHeight":"clientWidth",r=s?"top":"left",n=s?"height":"width",l=s?"scrollTop":"scrollLeft",a=B(this.gos),d=a.documentElement,h=this.getPopupParent(),c=e.getBoundingClientRect(),u=h.getBoundingClientRect(),g=a.documentElement.getBoundingClientRect(),p=h===a.body,C=Math.ceil(c[n]);let w=p?(s?sr:oi)(d)+d[l]:h[o];p&&(w-=Math.abs(g[r]-u[r]));const y=w-C;return Math.min(Math.max(t,0),Math.abs(y))}addPopup(e){const t=B(this.gos),{eChild:i,ariaLabel:s,alwaysOnTop:o,positionCallback:r,anchorToElement:n}=e;if(!t)return S("could not find the document, document is empty"),{hideFunc:()=>{}};const l=this.getPopupIndex(i);if(l!==-1)return{hideFunc:this.popupList[l].hideFunc};this.initialisePopupPosition(i);const a=this.createPopupWrapper(i,s,!!o),d=this.addEventListenersToPopup({...e,wrapperEl:a});return r&&r(),this.addPopupToPopupList(i,a,d,n),{hideFunc:d}}initialisePopupPosition(e){const i=this.getPopupParent().getBoundingClientRect();F(e.style.top)||(e.style.top=`${i.top*-1}px`),F(e.style.left)||(e.style.left=`${i.left*-1}px`)}createPopupWrapper(e,t,i){const s=this.getPopupParent(),o=document.createElement("div");return this.environment.applyThemeClasses(o),o.classList.add("ag-popup"),e.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr","ag-popup-child"),e.hasAttribute("role")||ee(e,"dialog"),dt(e,t),o.appendChild(e),s.appendChild(o),i?this.setAlwaysOnTop(e,!0):this.bringPopupToFront(e),o}handleThemeChange(e){if(e.themeChanged)for(const t of this.popupList)this.environment.applyThemeClasses(t.wrapper)}addEventListenersToPopup(e){const t=B(this.gos),i=this.getPopupParent(),{wrapperEl:s,eChild:o,closedCallback:r,afterGuiAttached:n,closeOnEsc:l,modal:a}=e;let d=!1;const h=p=>{if(!s.contains(V(this.gos)))return;p.key===m.ESCAPE&&!Fe(p)&&g({keyboardEvent:p})},c=p=>g({mouseEvent:p}),u=p=>g({touchEvent:p}),g=(p={})=>{const{mouseEvent:C,touchEvent:f,keyboardEvent:w,forceHide:y}=p;!y&&(this.isEventFromCurrentPopup({mouseEvent:C,touchEvent:f},o)||d)||(d=!0,i.removeChild(s),t.removeEventListener("keydown",h),t.removeEventListener("mousedown",c),t.removeEventListener("touchstart",u),t.removeEventListener("contextmenu",c),this.eventService.removeEventListener("dragStarted",c),r&&r(C||f||w),this.removePopupFromPopupList(o))};return n&&n({hidePopup:g}),window.setTimeout(()=>{l&&t.addEventListener("keydown",h),a&&(t.addEventListener("mousedown",c),this.eventService.addEventListener("dragStarted",c),t.addEventListener("touchstart",u),t.addEventListener("contextmenu",c))},0),g}addPopupToPopupList(e,t,i,s){this.popupList.push({element:e,wrapper:t,hideFunc:i,instanceId:Bu++,isAnchored:!!s}),s&&this.setPopupPositionRelatedToElement(e,s)}getPopupIndex(e){return this.popupList.findIndex(t=>t.element===e)}setPopupPositionRelatedToElement(e,t){const i=this.getPopupIndex(e);if(i===-1)return;const s=this.popupList[i];if(s.stopAnchoringPromise&&s.stopAnchoringPromise.then(r=>r&&r()),s.stopAnchoringPromise=void 0,s.isAnchored=!1,!t)return;const o=this.keepPopupPositionedRelativeTo({element:t,ePopup:e,hidePopup:s.hideFunc});return s.stopAnchoringPromise=o,s.isAnchored=!0,o}removePopupFromPopupList(e){this.setAlignedStyles(e,null),this.setPopupPositionRelatedToElement(e,null),this.popupList=this.popupList.filter(t=>t.element!==e)}keepPopupPositionedRelativeTo(e){const t=this.getPopupParent(),i=t.getBoundingClientRect(),{element:s,ePopup:o}=e,r=s.getBoundingClientRect(),n=c=>parseInt(c.substring(0,c.length-1),10),l=(c,u)=>{const g=i[c]-r[c],p=n(o.style[c]);return{initialDiff:g,lastDiff:g,initial:p,last:p,direction:u}},a=l("top",0),d=l("left",1),h=this.getFrameworkOverrides();return new te(c=>{h.wrapIncoming(()=>{h.setInterval(()=>{const u=t.getBoundingClientRect(),g=s.getBoundingClientRect();if(g.top==0&&g.left==0&&g.height==0&&g.width==0){e.hidePopup();return}const C=(f,w)=>{const y=n(o.style[w]);f.last!==y&&(f.initial=y,f.last=y);const R=u[w]-g[w];if(R!=f.lastDiff){const P=this.keepXYWithinBounds(o,f.initial+f.initialDiff-R,f.direction);o.style[w]=`${P}px`,f.last=P}f.lastDiff=R};C(a,"top"),C(d,"left")},200).then(u=>{c(()=>{u!=null&&window.clearInterval(u)})})},"popupPositioning")})}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isEventFromCurrentPopup(e,t){const{mouseEvent:i,touchEvent:s}=e,o=i||s;if(!o)return!1;const r=this.getPopupIndex(t);if(r===-1)return!1;for(let n=r;n<this.popupList.length;n++){const l=this.popupList[n];if(Jn(l.element,o))return!0}return this.isElementWithinCustomPopup(o.target)}isElementWithinCustomPopup(e){const t=B(this.gos);for(;e&&e!==t.body;){if(e.classList.contains("ag-custom-component-popup")||e.parentElement===null)return!0;e=e.parentElement}return!1}getWrapper(e){for(;!e.classList.contains("ag-popup")&&e.parentElement;)e=e.parentElement;return e.classList.contains("ag-popup")?e:null}setAlwaysOnTop(e,t){const i=this.getWrapper(e);i&&(i.classList.toggle("ag-always-on-top",!!t),t&&this.bringPopupToFront(i))}bringPopupToFront(e){const t=this.getPopupParent(),i=Array.prototype.slice.call(t.querySelectorAll(".ag-popup")),s=i.length,o=this.getWrapper(e);if(!o||s<=1||!t.contains(e))return;const r=[],n=[];for(const u of i)u!==o&&(u.classList.contains("ag-always-on-top")?n.push(u):r.push(u));const l=[],a=n.length,c=o.classList.contains("ag-always-on-top")||!a?[...r,...n,o]:[...r,o,...n];for(let u=0;u<=s;u++){const g=c[u];if(i[u]===c[u]||g===o)continue;g.querySelectorAll("div").forEach(C=>{C.scrollTop!==0&&l.push([C,C.scrollTop])}),u===0?t.insertAdjacentElement("afterbegin",g):c[u-1].insertAdjacentElement("afterend",g)}for(;l.length;){const u=l.pop();u[0].scrollTop=u[1]}}},_u=["touchstart","touchend","touchmove","touchcancel"],hn=class{constructor(e="javascript"){this.frameworkName=e,this.renderingEngine="vanilla",this.wrapIncoming=t=>t(),this.wrapOutgoing=t=>t()}setInterval(e,t){return new te(i=>{i(window.setInterval(e,t))})}addEventListener(e,t,i,s){const o=$e(_u,t);e.addEventListener(t,i,{capture:!!s,passive:o})}get shouldWrapOutgoing(){return!1}frameworkComponent(e){return null}isFrameworkComponent(e){return!1}getDocLink(e){return`https://www.ag-grid.com/${this.frameworkName==="solid"?"react":this.frameworkName}-data-grid${e?`/${e}`:""}`}},Uu=class extends v{constructor(){super(...arguments),this.beanName="cellNavigationService"}wireBeans(e){this.visibleColsService=e.visibleColsService,this.rowModel=e.rowModel,this.rowRenderer=e.rowRenderer,this.pinnedRowModel=e.pinnedRowModel,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService}getNextCellToFocus(e,t,i=!1){return i?this.getNextCellToFocusWithCtrlPressed(e,t):this.getNextCellToFocusWithoutCtrlPressed(e,t)}getNextCellToFocusWithCtrlPressed(e,t){const i=e===m.UP,s=e===m.DOWN,o=e===m.LEFT;let r,n;if(i||s)n=i?this.pageBoundsService.getFirstRow():this.pageBoundsService.getLastRow(),r=t.column;else{const l=this.visibleColsService.getAllCols(),a=this.gos.get("enableRtl");n=t.rowIndex,r=o!==a?l[0]:I(l)}return{rowIndex:n,rowPinned:null,column:r}}getNextCellToFocusWithoutCtrlPressed(e,t){let i=t,s=!1;for(;!s;){switch(e){case m.UP:i=this.getCellAbove(i);break;case m.DOWN:i=this.getCellBelow(i);break;case m.RIGHT:this.gos.get("enableRtl")?i=this.getCellToLeft(i):i=this.getCellToRight(i);break;case m.LEFT:this.gos.get("enableRtl")?i=this.getCellToRight(i):i=this.getCellToLeft(i);break;default:i=null,S("unknown key for navigation ",e);break}i?s=this.isCellGoodToFocusOn(i):s=!0}return i}isCellGoodToFocusOn(e){const t=e.column;let i;switch(e.rowPinned){case"top":i=this.pinnedRowModel.getPinnedTopRow(e.rowIndex);break;case"bottom":i=this.pinnedRowModel.getPinnedBottomRow(e.rowIndex);break;default:i=this.rowModel.getRow(e.rowIndex);break}return i?!t.isSuppressNavigable(i):!1}getCellToLeft(e){if(!e)return null;const t=this.visibleColsService.getColBefore(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getCellToRight(e){if(!e)return null;const t=this.visibleColsService.getColAfter(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getRowBelow(e){const t=e.rowIndex,i=e.rowPinned;let s=!1;if(this.isLastRowInContainer(e))switch(i){case"bottom":return null;case"top":return this.rowModel.isRowsToRender()?{rowIndex:this.pageBoundsService.getFirstRow(),rowPinned:null}:this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null;default:return this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null}else i&&(s=!0);const o=this.rowModel.getRow(e.rowIndex),r=s?void 0:this.getNextStickyPosition(o);return r||{rowIndex:t+1,rowPinned:i}}getNextStickyPosition(e,t){if(!ci(this.gos)||!e||!e.sticky)return;const i=this.rowRenderer.getStickyTopRowCtrls().some(l=>l.getRowNode().rowIndex===e.rowIndex);let s=[];i?s=[...this.rowRenderer.getStickyTopRowCtrls()].sort((l,a)=>l.getRowNode().rowIndex-a.getRowNode().rowIndex):s=[...this.rowRenderer.getStickyBottomRowCtrls()].sort((l,a)=>a.getRowNode().rowIndex-l.getRowNode().rowIndex);const o=t?-1:1,r=s.findIndex(l=>l.getRowNode().rowIndex===e.rowIndex),n=s[r+o];if(n)return{rowIndex:n.getRowNode().rowIndex,rowPinned:null}}getCellBelow(e){if(!e)return null;const t=this.getRowBelow(e);return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}isLastRowInContainer(e){const t=e.rowPinned,i=e.rowIndex;return t==="top"?this.pinnedRowModel.getPinnedTopRowCount()-1<=i:t==="bottom"?this.pinnedRowModel.getPinnedBottomRowCount()-1<=i:this.pageBoundsService.getLastRow()<=i}getRowAbove(e){const t=e.rowIndex,i=e.rowPinned,s=i?t===0:t===this.pageBoundsService.getFirstRow();let o=!1;if(s)return i==="top"?null:i?this.rowModel.isRowsToRender()?this.getLastBodyCell():this.pinnedRowModel.isRowsToRender("top")?this.getLastFloatingTopRow():null:this.pinnedRowModel.isRowsToRender("top")?this.getLastFloatingTopRow():null;i&&(o=!0);const r=this.rowModel.getRow(e.rowIndex),n=o?void 0:this.getNextStickyPosition(r,!0);return n||{rowIndex:t-1,rowPinned:i}}getCellAbove(e){if(!e)return null;const t=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}getLastBodyCell(){return{rowIndex:this.pageBoundsService.getLastRow(),rowPinned:null}}getLastFloatingTopRow(){return{rowIndex:this.pinnedRowModel.getPinnedTopRowCount()-1,rowPinned:"top"}}getNextTabbedCell(e,t){return t?this.getNextTabbedCellBackwards(e):this.getNextTabbedCellForwards(e)}getNextTabbedCellForwards(e){var r;const t=this.visibleColsService.getAllCols();let i=e.rowIndex,s=e.rowPinned,o=this.visibleColsService.getColAfter(e.column);if(!o){o=t[0];const n=this.getRowBelow(e);if(A(n)||!n.rowPinned&&!(((r=this.paginationService)==null?void 0:r.isRowInPage(n))??!0))return null;i=n?n.rowIndex:null,s=n?n.rowPinned:null}return{rowIndex:i,column:o,rowPinned:s}}getNextTabbedCellBackwards(e){var r;const t=this.visibleColsService.getAllCols();let i=e.rowIndex,s=e.rowPinned,o=this.visibleColsService.getColBefore(e.column);if(!o){o=I(t);const n=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});if(A(n)||!n.rowPinned&&!(((r=this.paginationService)==null?void 0:r.isRowInPage(n))??!0))return null;i=n?n.rowIndex:null,s=n?n.rowPinned:null}return{rowIndex:i,column:o,rowPinned:s}}},K=(e,t)=>{for(const i in t)t[i]=e;return t},po={...K("@ag-grid-community/core",{dispatchEvent:0,destroy:0,getGridId:0,getGridOption:0,isDestroyed:0,setGridOption:0,updateGridOptions:0,getState:0,setNodesSelected:0,selectAll:0,deselectAll:0,selectAllFiltered:0,deselectAllFiltered:0,selectAllOnCurrentPage:0,deselectAllOnCurrentPage:0,getSelectedNodes:0,getSelectedRows:0,redrawRows:0,setRowNodeExpanded:0,getRowNode:0,addRenderedRowListener:0,getRenderedNodes:0,forEachNode:0,getFirstDisplayedRow:0,getFirstDisplayedRowIndex:0,getLastDisplayedRow:0,getLastDisplayedRowIndex:0,getDisplayedRowAtIndex:0,getDisplayedRowCount:0,getModel:0,getVerticalPixelRange:0,getHorizontalPixelRange:0,ensureColumnVisible:0,ensureIndexVisible:0,ensureNodeVisible:0,getFocusedCell:0,clearFocusedCell:0,setFocusedCell:0,tabToNextCell:0,tabToPreviousCell:0,setFocusedHeader:0,addEventListener:0,addGlobalListener:0,removeEventListener:0,removeGlobalListener:0,expireValueCache:0,getValue:0,getCellValue:0,showColumnMenuAfterButtonClick:0,showColumnMenuAfterMouseClick:0,showColumnMenu:0,hidePopupMenu:0,onSortChanged:0,getPinnedTopRowCount:0,getPinnedBottomRowCount:0,getPinnedTopRow:0,getPinnedBottomRow:0,showLoadingOverlay:0,showNoRowsOverlay:0,hideOverlay:0,setGridAriaProperty:0,refreshCells:0,flashCells:0,refreshHeader:0,isAnimationFrameQueueEmpty:0,flushAllAnimationFrames:0,getSizesForCurrentTheme:0,getCellRendererInstances:0,addRowDropZone:0,removeRowDropZone:0,getRowDropZoneParams:0,getColumnDef:0,getColumnDefs:0,sizeColumnsToFit:0,setColumnGroupOpened:0,getColumnGroup:0,getProvidedColumnGroup:0,getDisplayNameForColumn:0,getDisplayNameForColumnGroup:0,getColumn:0,getColumns:0,applyColumnState:0,getColumnState:0,resetColumnState:0,getColumnGroupState:0,setColumnGroupState:0,resetColumnGroupState:0,isPinning:0,isPinningLeft:0,isPinningRight:0,getDisplayedColAfter:0,getDisplayedColBefore:0,setColumnVisible:0,setColumnsVisible:0,setColumnPinned:0,setColumnsPinned:0,getAllGridColumns:0,getDisplayedLeftColumns:0,getDisplayedCenterColumns:0,getDisplayedRightColumns:0,getAllDisplayedColumns:0,getAllDisplayedVirtualColumns:0,moveColumn:0,moveColumnByIndex:0,moveColumns:0,setColumnWidth:0,setColumnWidths:0,getLeftDisplayedColumnGroups:0,getCenterDisplayedColumnGroups:0,getRightDisplayedColumnGroups:0,getAllDisplayedColumnGroups:0,autoSizeColumn:0,autoSizeColumns:0,autoSizeAllColumns:0,undoCellEditing:0,redoCellEditing:0,getCellEditorInstances:0,getEditingCells:0,stopEditing:0,startEditingCell:0,getCurrentUndoSize:0,getCurrentRedoSize:0,isAnyFilterPresent:0,onFilterChanged:0,isColumnFilterPresent:0,getFilterInstance:0,getColumnFilterInstance:0,destroyFilter:0,setFilterModel:0,getFilterModel:0,getColumnFilterModel:0,setColumnFilterModel:0,showColumnFilter:0,isQuickFilterPresent:0,getQuickFilter:0,resetQuickFilter:0,paginationIsLastPageFound:0,paginationGetPageSize:0,paginationGetCurrentPage:0,paginationGetTotalPages:0,paginationGetRowCount:0,paginationGoToNextPage:0,paginationGoToPreviousPage:0,paginationGoToFirstPage:0,paginationGoToLastPage:0,paginationGoToPage:0,expandAll:0,collapseAll:0,onRowHeightChanged:0,setRowCount:0,getCacheBlockState:0,isLastRowIndexKnown:0}),...K("@ag-grid-community/client-side-row-model",{onGroupExpandedOrCollapsed:0,refreshClientSideRowModel:0,isRowDataEmpty:0,forEachLeafNode:0,forEachNodeAfterFilter:0,forEachNodeAfterFilterAndSort:0,resetRowHeights:0,applyTransaction:0,applyTransactionAsync:0,flushAsyncTransactions:0,getBestCostNodeSelection:0}),...K("@ag-grid-community/csv-export",{getDataAsCsv:0,exportDataAsCsv:0}),...K("@ag-grid-community/infinite-row-model",{refreshInfiniteCache:0,purgeInfiniteCache:0,getInfiniteRowCount:0}),...K("@ag-grid-enterprise/advanced-filter",{getAdvancedFilterModel:0,setAdvancedFilterModel:0,showAdvancedFilterBuilder:0,hideAdvancedFilterBuilder:0}),...K("@ag-grid-enterprise/charts",{getChartModels:0,getChartRef:0,getChartImageDataURL:0,downloadChart:0,openChartToolPanel:0,closeChartToolPanel:0,createRangeChart:0,createPivotChart:0,createCrossFilterChart:0,updateChart:0,restoreChart:0}),...K("@ag-grid-enterprise/clipboard",{copyToClipboard:0,cutToClipboard:0,copySelectedRowsToClipboard:0,copySelectedRangeToClipboard:0,copySelectedRangeDown:0,pasteFromClipboard:0}),...K("@ag-grid-enterprise/excel-export",{getDataAsExcel:0,exportDataAsExcel:0,getSheetDataForExcel:0,getMultipleSheetsAsExcel:0,exportMultipleSheetsAsExcel:0}),...K("@ag-grid-enterprise/master-detail",{addDetailGridInfo:0,removeDetailGridInfo:0,getDetailGridInfo:0,forEachDetailGridInfo:0}),...K("@ag-grid-enterprise/menu",{showContextMenu:0,showColumnChooser:0,hideColumnChooser:0}),...K("@ag-grid-enterprise/range-selection",{getCellRanges:0,addCellRange:0,clearRangeSelection:0,clearCellSelection:0}),...K("@ag-grid-enterprise/row-grouping",{addAggFunc:0,addAggFuncs:0,clearAggFuncs:0,setColumnAggFunc:0,isPivotMode:0,getPivotResultColumn:0,setValueColumns:0,getValueColumns:0,removeValueColumn:0,removeValueColumns:0,addValueColumn:0,addValueColumns:0,setRowGroupColumns:0,removeRowGroupColumn:0,removeRowGroupColumns:0,addRowGroupColumn:0,addRowGroupColumns:0,getRowGroupColumns:0,moveRowGroupColumn:0,setPivotColumns:0,removePivotColumn:0,removePivotColumns:0,addPivotColumn:0,addPivotColumns:0,getPivotColumns:0,setPivotResultColumns:0,getPivotResultColumns:0}),...K("@ag-grid-enterprise/server-side-row-model",{getServerSideSelectionState:0,setServerSideSelectionState:0,applyServerSideTransaction:0,applyServerSideTransactionAsync:0,applyServerSideRowData:0,retryServerSideLoads:0,flushServerSideAsyncTransactions:0,refreshServerSide:0,getServerSideGroupLevelState:0}),...K("@ag-grid-enterprise/side-bar",{isSideBarVisible:0,setSideBarVisible:0,setSideBarPosition:0,openToolPanel:0,closeToolPanel:0,getOpenedToolPanel:0,refreshToolPanel:0,isToolPanelShowing:0,getToolPanelInstance:0,getSideBar:0}),...K("@ag-grid-enterprise/status-bar",{getStatusPanel:0})},Oi={isDestroyed:()=>!0,destroy(){},preConstruct(){},postConstruct(){},preWireBeans(){},wireBeans(){}},Ku=(e,t)=>e.eventService.dispatchEvent(t),cn=class{};Reflect.defineProperty(cn,"name",{value:"GridApi"});var $u=class extends v{constructor(){super(),this.beanName="apiFunctionService",this.api=new cn,this.fns={...Oi,dispatchEvent:Ku},this.beans=null,this.preDestroyLink="";const{api:e}=this;for(const t in po)e[t]=this.makeApi(t)[t]}wireBeans(e){this.beans=e}postConstruct(){this.preDestroyLink=this.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed")}addFunction(e,t){var o;const{fns:i,beans:s}=this;i!==Oi&&(i[e]=((o=s==null?void 0:s.validationService)==null?void 0:o.validateApiFunction(e,t))??t)}makeApi(e){return{[e]:(...t)=>{const{beans:i,fns:{[e]:s}}=this;return s?s(i,...t):this.apiNotFound(e)}}}apiNotFound(e){const{beans:t,gos:i,preDestroyLink:s}=this;if(!t)S(`Grid API function ${e}() cannot be called as the grid has been destroyed. Either clear local references to the grid api, when it is destroyed, or check gridApi.isDestroyed() to avoid calling methods against a destroyed grid. To run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${s}`);else{const o=po[e];i.assertModuleRegistered(o,`api.${e}`)&&S(`API function '${e}' not registered to module '${o}'`)}}destroy(){super.destroy(),this.fns=Oi,this.beans=null}};function ju(e){return{beanName:"gridApi",bean:e.getBean("apiFunctionService").api}}var qu=class extends v{constructor(){super(...arguments),this.beanName="columnDefFactory"}buildColumnDefs(e,t,i){const s=[],o={};return e.forEach(r=>{const n=this.createDefFromColumn(r,t,i);let l=!0,a=n,d=r.getOriginalParent(),h=null;for(;d;){let c=null;if(d.isPadding()){d=d.getOriginalParent();continue}const u=o[d.getGroupId()];if(u){u.children.push(a),l=!1;break}if(c=this.createDefFromGroup(d),c&&(c.children=[a],o[c.groupId]=c,a=c,d=d.getOriginalParent()),d!=null&&h===d){l=!1;break}h=d}l&&s.push(a)}),s}createDefFromGroup(e){const t=Ui(e.getColGroupDef(),["children"]);return t&&(t.groupId=e.getGroupId()),t}createDefFromColumn(e,t,i){const s=Ui(e.getColDef());return s.colId=e.getColId(),s.width=e.getActualWidth(),s.rowGroup=e.isRowGroupActive(),s.rowGroupIndex=e.isRowGroupActive()?t.indexOf(e):null,s.pivot=e.isPivotActive(),s.pivotIndex=e.isPivotActive()?i.indexOf(e):null,s.aggFunc=e.isValueActive()?e.getAggFunc():null,s.hide=e.isVisible()?void 0:!0,s.pinned=e.isPinned()?e.getPinned():null,s.sort=e.getSort()?e.getSort():null,s.sortIndex=e.getSortIndex()!=null?e.getSortIndex():null,s}},Yu=class extends v{constructor(){super(...arguments),this.beanName="columnEventDispatcher"}visibleCols(e){this.eventService.dispatchEvent({type:"displayedColumnsChanged",source:e})}gridColumns(){this.eventService.dispatchEvent({type:"gridColumnsChanged"})}headerHeight(e){this.eventService.dispatchEvent({type:"columnHeaderHeightChanged",column:e,columns:[e],source:"autosizeColumnHeaderHeight"})}groupHeaderHeight(e){this.eventService.dispatchEvent({type:"columnGroupHeaderHeightChanged",columnGroup:e,source:"autosizeColumnGroupHeaderHeight"})}groupOpened(e){this.eventService.dispatchEvent({type:"columnGroupOpened",columnGroup:e.length===1?e[0]:void 0,columnGroups:e})}rowGroupChanged(e,t){this.eventService.dispatchEvent({type:"columnRowGroupChanged",columns:e,column:e.length===1?e[0]:null,source:t})}genericColumnEvent(e,t,i){this.eventService.dispatchEvent({type:e,columns:t,column:t.length===1?t[0]:null,source:i})}pivotModeChanged(){this.eventService.dispatchEvent({type:"columnPivotModeChanged"})}virtualColumnsChanged(e){this.eventService.dispatchEvent({type:"virtualColumnsChanged",afterScroll:e})}newColumnsLoaded(e){this.eventService.dispatchEvent({type:"newColumnsLoaded",source:e})}everythingChanged(e){this.eventService.dispatchEvent({type:"columnEverythingChanged",source:e})}columnMoved(e){const{movedColumns:t,source:i,toIndex:s,finished:o}=e;this.eventService.dispatchEvent({type:"columnMoved",columns:t,column:t&&t.length===1?t[0]:null,toIndex:s,finished:o,source:i})}columnPinned(e,t){if(!e.length)return;const i=e.length===1?e[0]:null,s=this.getCommonValue(e,o=>o.getPinned());this.eventService.dispatchEvent({type:"columnPinned",pinned:s??null,columns:e,column:i,source:t})}columnVisible(e,t){if(!e.length)return;const i=e.length===1?e[0]:null,s=this.getCommonValue(e,o=>o.isVisible());this.eventService.dispatchEvent({type:"columnVisible",visible:s,columns:e,column:i,source:t})}getCommonValue(e,t){if(!e||e.length==0)return;const i=t(e[0]);for(let s=1;s<e.length;s++)if(i!==t(e[s]))return;return i}columnChanged(e,t,i){this.eventService.dispatchEvent({type:e,columns:t,column:t&&t.length==1?t[0]:null,source:i})}columnResized(e,t,i,s=null){e&&e.length&&this.eventService.dispatchEvent({type:"columnResized",columns:e,column:e.length===1?e[0]:null,flexColumns:s,finished:t,source:i})}},Qu=class extends v{constructor(){super(...arguments),this.beanName="columnGetStateService"}wireBeans(e){this.columnModel=e.columnModel,this.funcColsService=e.funcColsService}getColumnState(){const e=this.columnModel.getColDefCols();if(A(e)||!this.columnModel.isAlive())return[];const i=this.columnModel.getAllCols().map(s=>this.createStateItemFromColumn(s));return this.orderColumnStateList(i),i}createStateItemFromColumn(e){const t=this.funcColsService.getRowGroupColumns(),i=this.funcColsService.getPivotColumns(),s=e.isRowGroupActive()?t.indexOf(e):null,o=e.isPivotActive()?i.indexOf(e):null,r=e.isValueActive()?e.getAggFunc():null,n=e.getSort()!=null?e.getSort():null,l=e.getSortIndex()!=null?e.getSortIndex():null,a=e.getFlex()!=null&&e.getFlex()>0?e.getFlex():null;return{colId:e.getColId(),width:e.getActualWidth(),hide:!e.isVisible(),pinned:e.getPinned(),sort:n,sortIndex:l,aggFunc:r,rowGroup:e.isRowGroupActive(),rowGroupIndex:s,pivot:e.isPivotActive(),pivotIndex:o,flex:a}}orderColumnStateList(e){const t=this.columnModel.getCols(),i=new Map(t.map((s,o)=>[s.getColId(),o]));e.sort((s,o)=>{const r=i.has(s.colId)?i.get(s.colId):-1,n=i.has(o.colId)?i.get(o.colId):-1;return r-n})}},Xu=class extends v{constructor(){super(...arguments),this.beanName="columnGroupStateService"}wireBeans(e){this.columnModel=e.columnModel,this.columnAnimationService=e.columnAnimationService,this.eventDispatcher=e.columnEventDispatcher,this.visibleColsService=e.visibleColsService}getColumnGroupState(){const e=[],t=this.columnModel.getColTree();return Pe(null,t,i=>{j(i)&&e.push({groupId:i.getGroupId(),open:i.isExpanded()})}),e}resetColumnGroupState(e){const t=this.columnModel.getColDefColTree();if(!t)return;const i=[];Pe(null,t,s=>{if(j(s)){const o=s.getColGroupDef(),r={groupId:s.getGroupId(),open:o?o.openByDefault:void 0};i.push(r)}}),this.setColumnGroupState(i,e)}setColumnGroupState(e,t){if(!this.columnModel.getColTree())return;this.columnAnimationService.start();const s=[];e.forEach(o=>{const r=o.groupId,n=o.open,l=this.columnModel.getProvidedColGroup(r);l&&l.isExpanded()!==n&&(l.setExpanded(n),s.push(l))}),this.visibleColsService.refresh(t,!0),s.length&&this.eventDispatcher.groupOpened(s),this.columnAnimationService.finish()}},Ju=class extends v{constructor(){super(...arguments),this.beanName="columnViewportService",this.colsWithinViewport=[],this.headerColsWithinViewport=[],this.colsWithinViewportHash="",this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={}}wireBeans(e){this.visibleColsService=e.visibleColsService,this.columnModel=e.columnModel,this.eventDispatcher=e.columnEventDispatcher}postConstruct(){this.suppressColumnVirtualisation=this.gos.get("suppressColumnVirtualisation")}setScrollPosition(e,t,i=!1){const s=this.visibleColsService.isBodyWidthDirty();if(!(e===this.scrollWidth&&t===this.scrollPosition&&!s)){if(this.scrollWidth=e,this.scrollPosition=t,this.visibleColsService.setBodyWidthDirty(),this.gos.get("enableRtl")){const r=this.visibleColsService.getBodyContainerWidth();this.viewportLeft=r-this.scrollPosition-this.scrollWidth,this.viewportRight=r-this.scrollPosition}else this.viewportLeft=this.scrollPosition,this.viewportRight=this.scrollWidth+this.scrollPosition;this.columnModel.isReady()&&this.checkViewportColumns(i)}}getHeadersToRender(e,t){let i;switch(e){case"left":i=this.rowsOfHeadersToRenderLeft[t];break;case"right":i=this.rowsOfHeadersToRenderRight[t];break;default:i=this.rowsOfHeadersToRenderCenter[t];break}return i||[]}extractViewportColumns(){const e=this.visibleColsService.getCenterCols();this.isColumnVirtualisationSuppressed()?(this.colsWithinViewport=e,this.headerColsWithinViewport=e):(this.colsWithinViewport=e.filter(this.isColumnInRowViewport.bind(this)),this.headerColsWithinViewport=e.filter(this.isColumnInHeaderViewport.bind(this)))}isColumnVirtualisationSuppressed(){return this.suppressColumnVirtualisation||this.viewportRight===0}clear(){this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={},this.colsWithinViewportHash=""}isColumnInHeaderViewport(e){return e.isAutoHeaderHeight()||this.isAnyParentAutoHeaderHeight(e)?!0:this.isColumnInRowViewport(e)}isAnyParentAutoHeaderHeight(e){for(;e;){if(e.isAutoHeaderHeight())return!0;e=e.getParent()}return!1}isColumnInRowViewport(e){if(e.isAutoHeight())return!0;const t=e.getLeft()||0,i=t+e.getActualWidth(),s=this.viewportLeft-200,o=this.viewportRight+200,r=t<s&&i<s,n=t>o&&i>o;return!r&&!n}getViewportColumns(){const e=this.visibleColsService.getLeftCols(),t=this.visibleColsService.getRightCols();return this.colsWithinViewport.concat(e).concat(t)}getColsWithinViewport(e){if(!this.columnModel.isColSpanActive())return this.colsWithinViewport;const t=o=>{const r=o.getLeft();return F(r)&&r>this.viewportLeft},i=this.isColumnVirtualisationSuppressed()?void 0:this.isColumnInRowViewport.bind(this),s=this.visibleColsService.getColsCenter();return this.visibleColsService.getColsForRow(e,s,i,t)}checkViewportColumns(e=!1){this.extractViewport()&&this.eventDispatcher.virtualColumnsChanged(e)}calculateHeaderRows(){this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={};const e={},t=this.visibleColsService.getLeftCols(),i=this.visibleColsService.getRightCols();this.headerColsWithinViewport.concat(t).concat(i).forEach(r=>e[r.getId()]=!0);const o=(r,n,l)=>{let a=!1;for(let d=0;d<r.length;d++){const h=r[d];let c=!1;if(Ge(h))c=e[h.getId()]===!0;else{const g=h.getDisplayedChildren();g&&(c=o(g,n,l+1))}c&&(a=!0,n[l]||(n[l]=[]),n[l].push(h))}return a};o(this.visibleColsService.getTreeLeft(),this.rowsOfHeadersToRenderLeft,0),o(this.visibleColsService.getTreeRight(),this.rowsOfHeadersToRenderRight,0),o(this.visibleColsService.getTreeCenter(),this.rowsOfHeadersToRenderCenter,0)}extractViewport(){const e=s=>`${s.getId()}-${s.getPinned()||"normal"}`;this.extractViewportColumns();const t=this.getViewportColumns().map(e).join("#"),i=this.colsWithinViewportHash!==t;return i&&(this.colsWithinViewportHash=t,this.calculateHeaderRows()),i}},Zu=class extends v{constructor(){super(...arguments),this.beanName="agComponentUtils"}wireBeans(e){this.componentMetadataProvider=e.componentMetadataProvider}adaptFunction(e,t){const i=this.componentMetadataProvider.retrieve(e);return i&&i.functionAdapter?i.functionAdapter(t):null}adaptCellRendererFunction(e){class t{refresh(){return!1}getGui(){return this.eGui}init(s){const o=e(s),r=typeof o;if(r==="string"||r==="number"||r==="boolean"){this.eGui=Ot("<span>"+o+"</span>");return}if(o==null){this.eGui=Ot("<span></span>");return}this.eGui=o}}return t}doesImplementIComponent(e){return e?e.prototype&&"getGui"in e.prototype:!1}},eg=class extends v{constructor(){super(...arguments),this.beanName="componentMetadataProvider"}wireBeans(e){this.agComponentUtils=e.agComponentUtils}postConstruct(){this.componentMetaData={dateComponent:{mandatoryMethodList:["getDate","setDate"],optionalMethodList:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","onParamsUpdated","refresh"]},detailCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},dragAndDropImageComponent:{mandatoryMethodList:["setIcon","setLabel"],optionalMethodList:[]},headerComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},headerGroupComponent:{mandatoryMethodList:[],optionalMethodList:[]},loadingCellRenderer:{mandatoryMethodList:[],optionalMethodList:[],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},loadingOverlayComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},noRowsOverlayComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},floatingFilterComponent:{mandatoryMethodList:["onParentModelChanged"],optionalMethodList:["afterGuiAttached","onParamsUpdated","refresh"]},cellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},cellEditor:{mandatoryMethodList:["getValue"],optionalMethodList:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},innerRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},fullWidthCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},groupRowRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},filter:{mandatoryMethodList:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethodList:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},statusPanel:{mandatoryMethodList:[],optionalMethodList:["refresh"]},toolPanel:{mandatoryMethodList:[],optionalMethodList:["refresh","getState"]},tooltipComponent:{mandatoryMethodList:[],optionalMethodList:[]},menuItem:{mandatoryMethodList:[],optionalMethodList:["setActive","select","setExpanded","configureDefaults"]}}}retrieve(e){return this.componentMetaData[e]}},tg=["rowPositionUtils","cellPositionUtils","headerPositionUtils","paginationAutoPageSizeService","apiFunctionService","gridApi","userComponentRegistry","agComponentUtils","componentMetadataProvider","resizeObserverService","userComponentFactory","rowContainerHeightService","horizontalResizeService","localeService","validationService","pinnedRowModel","dragService","visibleColsService","eventService","gos","popupService","selectionService","columnFilterService","quickFilterService","filterManager","columnModel","headerNavigationService","pageBoundsService","paginationService","pageBoundsListener","rowRenderer","expressionService","columnFactory","alignedGridsService","navigationService","valueCache","valueService","loggerFactory","autoWidthCalculator","filterMenuFactory","dragAndDropService","focusService","mouseEventService","environment","cellNavigationService","stylingService","scrollVisibleService","sortController","columnHoverService","columnAnimationService","selectableService","autoColService","controlsColService","changeDetectionService","animationFrameService","undoRedoService","columnDefFactory","rowCssClassCalculator","rowNodeBlockLoader","rowNodeSorter","ctrlsService","pinnedWidthService","rowNodeEventThrottle","ctrlsFactory","dataTypeService","syncService","overlayService","stateService","expansionService","apiEventService","ariaAnnouncementService","menuService","columnApplyStateService","columnEventDispatcher","columnMoveService","columnAutosizeService","columnGetStateService","columnGroupStateService","columnSizeService","funcColsService","columnNameService","columnViewportService","pivotResultColsService","showRowGroupColsService"],fo=Object.fromEntries(tg.map((e,t)=>[e,t]));function ig(e,t){const i=(e.beanName?fo[e.beanName]:void 0)??Number.MAX_SAFE_INTEGER,s=(t.beanName?fo[t.beanName]:void 0)??Number.MAX_SAFE_INTEGER;return i-s}function sg(e,t){return(e==null?void 0:e.beanName)==="gridDestroyService"?-1:0}var og=class extends v{constructor(){super(...arguments),this.beanName="ctrlsFactory",this.registry={}}register(e){this.registry[e.name]=e.classImp}getInstance(e,...t){const i=this.registry[e];if(i!=null)return new i(...t)}},rg=class extends v{constructor(){super(...arguments),this.beanName="ctrlsService",this.params={gridCtrl:void 0,gridBodyCtrl:void 0,center:void 0,left:void 0,right:void 0,bottomCenter:void 0,bottomLeft:void 0,bottomRight:void 0,topCenter:void 0,topLeft:void 0,topRight:void 0,stickyTopCenter:void 0,stickyTopLeft:void 0,stickyTopRight:void 0,stickyBottomCenter:void 0,stickyBottomLeft:void 0,stickyBottomRight:void 0,fakeHScrollComp:void 0,fakeVScrollComp:void 0,gridHeaderCtrl:void 0,centerHeader:void 0,leftHeader:void 0,rightHeader:void 0},this.ready=!1,this.readyCallbacks=[],this.runReadyCallbacksAsync=!1}wireBeans(e){var t,i;this.runReadyCallbacksAsync=((i=(t=e.frameworkOverrides).runWhenReadyAsync)==null?void 0:i.call(t))??!1}postConstruct(){this.addEventListener("ready",()=>{this.updateReady(),this.ready&&(this.readyCallbacks.forEach(e=>e(this.params)),this.readyCallbacks.length=0)},this.runReadyCallbacksAsync)}updateReady(){this.ready=Object.values(this.params).every(e=>(e==null?void 0:e.isAlive())??!1)}whenReady(e,t){this.ready?t(this.params):this.readyCallbacks.push(t),e.addDestroyFunc(()=>{const i=this.readyCallbacks.indexOf(t);i>=0&&this.readyCallbacks.splice(i,1)})}register(e,t){this.params[e]=t,this.updateReady(),this.ready&&this.dispatchLocalEvent({type:"ready"}),t.addDestroyFunc(()=>{this.updateReady()})}get(e){return this.params[e]}getGridBodyCtrl(){return this.params.gridBodyCtrl}getHeaderRowContainerCtrls(){const{leftHeader:e,centerHeader:t,rightHeader:i}=this.params;return[e,i,t]}getHeaderRowContainerCtrl(e){const t=this.params;switch(e){case"left":return t.leftHeader;case"right":return t.rightHeader;default:return t.centerHeader}}},ng=class extends v{constructor(){super(...arguments),this.beanName="cellPositionUtils"}createId(e){const{rowIndex:t,rowPinned:i,column:s}=e;return this.createIdFromValues({rowIndex:t,column:s,rowPinned:i})}createIdFromValues(e){const{rowIndex:t,rowPinned:i,column:s}=e;return`${t}.${i??"null"}.${s.getId()}`}equals(e,t){const i=e.column===t.column,s=e.rowPinned===t.rowPinned,o=e.rowIndex===t.rowIndex;return i&&s&&o}},lg=class extends v{constructor(){super(...arguments),this.beanName="rowNodeEventThrottle",this.events=[]}wireBeans(e){this.animationFrameService=e.animationFrameService,this.rowModel=e.rowModel}postConstruct(){N(this.gos)&&(this.clientSideRowModel=this.rowModel)}dispatchExpanded(e,t){if(this.clientSideRowModel==null){this.eventService.dispatchEvent(e);return}this.events.push(e);const i=()=>{this.clientSideRowModel&&this.clientSideRowModel.onRowGroupOpened(),this.events.forEach(s=>this.eventService.dispatchEvent(s)),this.events=[]};t?i():(this.dispatchExpandedDebounced==null&&(this.dispatchExpandedDebounced=this.animationFrameService.debounce(i)),this.dispatchExpandedDebounced())}},ag=class extends v{constructor(){super(...arguments),this.beanName="rowPositionUtils"}wireBeans(e){this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel,this.pageBoundsService=e.pageBoundsService}getFirstRow(){let e=0,t;return this.pinnedRowModel.getPinnedTopRowCount()?t="top":this.rowModel.getRowCount()?(t=null,e=this.pageBoundsService.getFirstRow()):this.pinnedRowModel.getPinnedBottomRowCount()&&(t="bottom"),t===void 0?null:{rowIndex:e,rowPinned:t}}getLastRow(){let e,t=null;const i=this.pinnedRowModel.getPinnedBottomRowCount(),s=this.pinnedRowModel.getPinnedTopRowCount();return i?(t="bottom",e=i-1):this.rowModel.getRowCount()?(t=null,e=this.pageBoundsService.getLastRow()):s&&(t="top",e=s-1),e===void 0?null:{rowIndex:e,rowPinned:t}}getRowNode(e){switch(e.rowPinned){case"top":return this.pinnedRowModel.getPinnedTopRow(e.rowIndex);case"bottom":return this.pinnedRowModel.getPinnedBottomRow(e.rowIndex);default:return this.rowModel.getRow(e.rowIndex)}}sameRow(e,t){return!e&&!t?!0:e&&!t||!e&&t?!1:e.rowIndex===t.rowIndex&&e.rowPinned==t.rowPinned}before(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(F(t.rowPinned))return t.rowPinned!=="top";break}return e.rowIndex<t.rowIndex}},Co={cssName:"--ag-row-height",changeKey:"rowHeightChanged",defaultValue:42},mo={cssName:"--ag-header-height",changeKey:"headerHeightChanged",defaultValue:48},vo={cssName:"--ag-list-item-height",changeKey:"listItemHeightChanged",defaultValue:24},dg=class extends v{constructor(){super(...arguments),this.beanName="environment",this.sizeEls=new Map,this.lastKnownValues=new Map,this.ancestorThemeClasses=[],this.sizesMeasured=!1,this.gridTheme=null}wireBeans(e){this.resizeObserverService=e.resizeObserverService,this.eGridDiv=e.eGridDiv}postConstruct(){this.addManagedPropertyListener("theme",()=>this.handleThemeGridOptionChange()),this.handleThemeGridOptionChange(),this.addDestroyFunc(()=>this.stopUsingTheme()),this.addManagedPropertyListener("rowHeight",()=>this.refreshRowHeightVariable()),this.ancestorThemeClasses=this.readAncestorThemeClasses(),this.setUpThemeClassObservers(),this.getSizeEl(Co),this.getSizeEl(mo),this.getSizeEl(vo)}getDefaultRowHeight(){return this.getCSSVariablePixelValue(Co)}getDefaultHeaderHeight(){return this.getCSSVariablePixelValue(mo)}getDefaultColumnMinWidth(){return Math.min(36,this.getDefaultRowHeight())}getDefaultListItemHeight(){return this.getCSSVariablePixelValue(vo)}hasMeasuredSizes(){return this.sizesMeasured}getGridThemeClass(){var e;return((e=this.gridTheme)==null?void 0:e.getCssClass())||null}getThemeClasses(){return this.gridTheme?[this.gridTheme.getCssClass()]:this.ancestorThemeClasses}applyThemeClasses(e){const t=this.getThemeClasses();for(const i of Array.from(e.classList))i.startsWith("ag-theme-")&&!t.includes(i)&&e.classList.remove(i);e.classList.add(...t)}refreshRowHeightVariable(){const e=this.eGridDiv.style.getPropertyValue("--ag-line-height").trim(),t=this.gos.get("rowHeight");if(t==null||isNaN(t)||!isFinite(t))return e!==null&&this.eGridDiv.style.setProperty("--ag-line-height",null),-1;const i=`${t}px`;return e!=i?(this.eGridDiv.style.setProperty("--ag-line-height",i),t):e!=""?parseFloat(e):-1}getCSSVariablePixelValue(e){const t=this.lastKnownValues.get(e);if(t!=null)return t;const i=this.measureSizeEl(e);return i==="detached"||i==="no-styles"?e.defaultValue:(this.lastKnownValues.set(e,i),i)}measureSizeEl(e){const t=this.getSizeEl(e);if(t.offsetParent==null)return"detached";const i=t.offsetWidth;return i===wo?"no-styles":(this.sizesMeasured=!0,i)}getSizeEl(e){let t=this.sizeEls.get(e);if(t)return t;let i=this.eMeasurementContainer;i||(i=this.eMeasurementContainer=document.createElement("div"),i.className="ag-measurement-container",this.gos.get("theme")&&this.applyThemeClasses(i),this.eGridDiv.appendChild(i)),t=document.createElement("div"),t.style.width=`var(${e.cssName}, ${wo}px)`,i.appendChild(t),this.sizeEls.set(e,t);let s=this.measureSizeEl(e);s==="no-styles"&&S(`no value for ${e.cssName}. This usually means that the grid has been initialised before styles have been loaded. The default value of ${e.defaultValue} will be used and updated when styles load.`);const o=this.resizeObserverService.observeResize(t,()=>{const r=this.measureSizeEl(e);r==="detached"||r==="no-styles"||(this.lastKnownValues.set(e,r),r!==s&&(s=r,this.fireGridStylesChangedEvent(e.changeKey)))});return this.addDestroyFunc(()=>o()),t}fireGridStylesChangedEvent(e){this.eventService.dispatchEvent({type:"gridStylesChanged",[e]:!0})}setUpThemeClassObservers(){const e=new MutationObserver(()=>{const i=this.readAncestorThemeClasses();hg(i,this.ancestorThemeClasses)||(this.ancestorThemeClasses=i,this.fireGridStylesChangedEvent("themeChanged"))});let t=this.eGridDiv;for(;t;)e.observe(t||this.eGridDiv,{attributes:!0,attributeFilter:["class"]}),t=t.parentElement;this.addDestroyFunc(()=>e.disconnect())}readAncestorThemeClasses(){let e=this.eGridDiv;const t=[];for(;e;){const i=Array.from(e.classList).filter(s=>s.startsWith("ag-theme-"));for(const s of i)t.includes(s)||t.unshift(s);e=e.parentElement}return Object.freeze(t)}handleThemeGridOptionChange(){const{gos:e,eMeasurementContainer:t,gridTheme:i}=this,s=e.get("theme")||null;s!==i&&(i==null||i.stopUse(),this.gridTheme=s,s==null||s.startUse({loadThemeGoogleFonts:e.get("loadThemeGoogleFonts"),container:this.eGridDiv}),t&&this.applyThemeClasses(t),this.fireGridStylesChangedEvent("themeChanged"))}stopUsingTheme(){var e;(e=this.gridTheme)==null||e.stopUse(),this.gridTheme=null}},hg=(e,t)=>e.length===t.length&&e.findIndex((i,s)=>e[s]!==t[s])===-1,wo=15538,cg=class extends v{constructor(){super(...arguments),this.beanName="eventService",this.globalEventService=new ct}wireBeans(e){this.globalEventListener=e.globalEventListener,this.globalSyncEventListener=e.globalSyncEventListener}postConstruct(){if(this.globalEventListener){const e=Jt(this.gos);this.addGlobalListener(this.globalEventListener,e)}this.globalSyncEventListener&&this.addGlobalListener(this.globalSyncEventListener,!1)}addEventListener(e,t,i){this.globalEventService.addEventListener(e,t,i)}removeEventListener(e,t,i){this.globalEventService.removeEventListener(e,t,i)}addGlobalListener(e,t=!1){this.globalEventService.addGlobalListener(e,t)}removeGlobalListener(e,t=!1){this.globalEventService.removeGlobalListener(e,t)}dispatchLocalEvent(){}dispatchEvent(e){this.globalEventService.dispatchEvent(this.gos.addGridCommonParams(e))}dispatchEventOnce(e){this.globalEventService.dispatchEventOnce(this.gos.addGridCommonParams(e))}},Ns=class oe extends v{constructor(){super(...arguments),this.beanName="focusService"}wireBeans(t){this.eGridDiv=t.eGridDiv,this.columnModel=t.columnModel,this.visibleColsService=t.visibleColsService,this.headerNavigationService=t.headerNavigationService,this.headerPositionUtils=t.headerPositionUtils,this.rowRenderer=t.rowRenderer,this.rowPositionUtils=t.rowPositionUtils,this.cellPositionUtils=t.cellPositionUtils,this.navigationService=t.navigationService,this.ctrlsService=t.ctrlsService,this.filterManager=t.filterManager,this.rangeService=t.rangeService,this.advancedFilterService=t.advancedFilterService,this.overlayService=t.overlayService}static addKeyboardModeEvents(t){this.instanceCount>0||(t.addEventListener("keydown",oe.toggleKeyboardMode),t.addEventListener("mousedown",oe.toggleKeyboardMode))}static removeKeyboardModeEvents(t){this.instanceCount>0||(t.removeEventListener("keydown",oe.toggleKeyboardMode),t.removeEventListener("mousedown",oe.toggleKeyboardMode))}static toggleKeyboardMode(t){const i=oe.keyboardModeActive,s=t.type==="keydown";s&&(t.ctrlKey||t.metaKey||t.altKey)||i!==s&&(oe.keyboardModeActive=s)}postConstruct(){const t=this.clearFocusedCell.bind(this);this.addManagedEventListeners({columnPivotModeChanged:t,newColumnsLoaded:this.onColumnEverythingChanged.bind(this),columnGroupOpened:t,columnRowGroupChanged:t}),this.registerKeyboardFocusEvents(),this.ctrlsService.whenReady(this,i=>{this.gridCtrl=i.gridCtrl})}registerKeyboardFocusEvents(){const t=B(this.gos);oe.addKeyboardModeEvents(t),oe.instanceCount++,this.addDestroyFunc(()=>{oe.instanceCount--,oe.removeKeyboardModeEvents(t)})}onColumnEverythingChanged(){if(!this.focusedCellPosition)return;const t=this.focusedCellPosition.column,i=this.columnModel.getCol(t.getId());t!==i&&this.clearFocusedCell()}isKeyboardMode(){return oe.keyboardModeActive}getFocusCellToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedCellPosition||this.isDomDataMissingInHierarchy(V(this.gos),qe.DOM_DATA_KEY_ROW_CTRL)?null:this.focusedCellPosition}getFocusHeaderToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedHeaderPosition||this.isDomDataMissingInHierarchy(V(this.gos),Ci.DOM_DATA_KEY_HEADER_CTRL)?null:this.focusedHeaderPosition}isDomDataMissingInHierarchy(t,i){let s=t;for(;s;){if(xt(this.gos,s,i))return!1;s=s.parentNode}return!0}getFocusedCell(){return this.focusedCellPosition}shouldRestoreFocus(t){return this.isCellRestoreFocused(t)?(setTimeout(()=>{this.restoredFocusedCellPosition=null},0),!0):!1}clearRestoreFocus(){this.restoredFocusedCellPosition=null,this.awaitRestoreFocusedCell=!1}restoreFocusedCell(t,i){this.awaitRestoreFocusedCell=!0,setTimeout(()=>{this.awaitRestoreFocusedCell&&(this.setRestoreFocusedCell(t),i())})}isCellRestoreFocused(t){return this.restoredFocusedCellPosition==null?!1:this.cellPositionUtils.equals(t,this.restoredFocusedCellPosition)}setRestoreFocusedCell(t){this.getFrameworkOverrides().renderingEngine==="react"&&(this.restoredFocusedCellPosition=t)}getFocusEventParams(t){const{rowIndex:i,rowPinned:s,column:o}=t,r={rowIndex:i,rowPinned:s,column:o,isFullWidthCell:!1},n=this.rowRenderer.getRowByPosition({rowIndex:i,rowPinned:s});return n&&(r.isFullWidthCell=n.isFullWidth()),r}clearFocusedCell(){if(this.restoredFocusedCellPosition=null,this.focusedCellPosition==null)return;const t=this.getFocusEventParams(this.focusedCellPosition);this.focusedCellPosition=null,this.eventService.dispatchEvent({type:"cellFocusCleared",...t})}setFocusedCell(t){const{column:i,rowIndex:s,rowPinned:o,forceBrowserFocus:r=!1,preventScrollOnBrowserFocus:n=!1}=t,l=this.columnModel.getCol(i);if(!l){this.focusedCellPosition=null;return}this.focusedCellPosition={rowIndex:s,rowPinned:Re(o),column:l},this.eventService.dispatchEvent({type:"cellFocused",...this.getFocusEventParams(this.focusedCellPosition),forceBrowserFocus:r,preventScrollOnBrowserFocus:n})}isCellFocused(t){return this.focusedCellPosition==null?!1:this.cellPositionUtils.equals(t,this.focusedCellPosition)}isRowNodeFocused(t){return this.isRowFocused(t.rowIndex,t.rowPinned)}isHeaderWrapperFocused(t){if(this.focusedHeaderPosition==null)return!1;const i=t.getColumnGroupChild(),s=t.getRowIndex(),o=t.getPinned(),{column:r,headerRowIndex:n}=this.focusedHeaderPosition;return i===r&&s===n&&o==r.getPinned()}clearFocusedHeader(){this.focusedHeaderPosition=null}getFocusedHeader(){return this.focusedHeaderPosition}setFocusedHeader(t,i){this.focusedHeaderPosition={headerRowIndex:t,column:i}}isHeaderFocusSuppressed(){return this.gos.get("suppressHeaderFocus")||this.overlayService.isExclusive()}isCellFocusSuppressed(){return this.gos.get("suppressCellFocus")||this.overlayService.isExclusive()}focusHeaderPosition(t){var d;if(this.isHeaderFocusSuppressed())return!1;const{direction:i,fromTab:s,allowUserOverride:o,event:r,fromCell:n,rowWithoutSpanValue:l}=t;let{headerPosition:a}=t;if(n&&((d=this.filterManager)!=null&&d.isAdvancedFilterHeaderActive()))return this.focusAdvancedFilter(a);if(o){const h=this.getFocusedHeader(),c=this.headerNavigationService.getHeaderRowCount();if(s){const u=this.gos.getCallback("tabToNextHeader");u&&(a=this.getHeaderPositionFromUserFunc({userFunc:u,direction:i,currentPosition:h,headerPosition:a,headerRowCount:c}))}else{const u=this.gos.getCallback("navigateToNextHeader");if(u&&r){const g={key:r.key,previousHeaderPosition:h,nextHeaderPosition:a,headerRowCount:c,event:r};a=u(g)}}}return a?this.focusProvidedHeaderPosition({headerPosition:a,direction:i,event:r,fromCell:n,rowWithoutSpanValue:l}):!1}focusHeaderPositionFromUserFunc(t){if(this.isHeaderFocusSuppressed())return!1;const{userFunc:i,headerPosition:s,direction:o,event:r}=t,n=this.getFocusedHeader(),l=this.headerNavigationService.getHeaderRowCount(),a=this.getHeaderPositionFromUserFunc({userFunc:i,direction:o,currentPosition:n,headerPosition:s,headerRowCount:l});return!!a&&this.focusProvidedHeaderPosition({headerPosition:a,direction:o,event:r})}getHeaderPositionFromUserFunc(t){const{userFunc:i,direction:s,currentPosition:o,headerPosition:r,headerRowCount:n}=t,a=i({backwards:s==="Before",previousHeaderPosition:o,nextHeaderPosition:r,headerRowCount:n});return a===!0||a===null?(a===null&&S("Since v31.3 Returning `null` from tabToNextHeader is deprecated. Return `true` to stay on the current header, or `false` to let the browser handle the tab behaviour."),o):a===!1?null:a}focusProvidedHeaderPosition(t){var c;const{headerPosition:i,direction:s,fromCell:o,rowWithoutSpanValue:r,event:n}=t,{column:l,headerRowIndex:a}=i;if(a===-1)return(c=this.filterManager)!=null&&c.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(i):this.focusGridView(l);this.headerNavigationService.scrollToColumn(l,s);const d=this.ctrlsService.getHeaderRowContainerCtrl(l.getPinned()),h=(d==null?void 0:d.focusHeader(i.headerRowIndex,l,n))||!1;return h&&(r!=null||o)&&this.headerNavigationService.setCurrentHeaderRowWithoutSpan(r??-1),h}focusFirstHeader(){if(this.overlayService.isExclusive()&&this.focusOverlay())return!0;let t=this.visibleColsService.getAllCols()[0];if(!t)return!1;t.getParent()&&(t=this.visibleColsService.getColGroupAtLevel(t,0));const i=this.headerPositionUtils.getHeaderIndexToFocus(t,0);return this.focusHeaderPosition({headerPosition:i,rowWithoutSpanValue:0})}focusLastHeader(t){if(this.overlayService.isExclusive()&&this.focusOverlay(!0))return!0;const i=this.headerNavigationService.getHeaderRowCount()-1,s=I(this.visibleColsService.getAllCols());return this.focusHeaderPosition({headerPosition:{headerRowIndex:i,column:s},rowWithoutSpanValue:-1,event:t})}focusPreviousFromFirstCell(t){var i;return(i=this.filterManager)!=null&&i.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(null):this.focusLastHeader(t)}isAnyCellFocused(){return!!this.focusedCellPosition}isRowFocused(t,i){return this.focusedCellPosition==null?!1:this.focusedCellPosition.rowIndex===t&&this.focusedCellPosition.rowPinned===Re(i)}findFocusableElements(t,i,s=!1){const o=Ul;let r=ir;i&&(r+=", "+i),s&&(r+=', [tabindex="-1"]');const n=Array.prototype.slice.apply(t.querySelectorAll(o)).filter(d=>ue(d)),l=Array.prototype.slice.apply(t.querySelectorAll(r));return l.length?((d,h)=>d.filter(c=>h.indexOf(c)===-1))(n,l):n}focusInto(t,i=!1,s=!1){const o=this.findFocusableElements(t,null,s),r=i?I(o):o[0];return r?(r.focus({preventScroll:!0}),!0):!1}findFocusableElementBeforeTabGuard(t,i){if(!i)return null;const s=this.findFocusableElements(t),o=s.indexOf(i);if(o===-1)return null;let r=-1;for(let n=o-1;n>=0;n--)if(s[n].classList.contains("ag-tab-guard-top")){r=n;break}return r<=0?null:s[r-1]}findNextFocusableElement(t=this.eGridDiv,i,s){const o=this.findFocusableElements(t,i?':not([tabindex="-1"])':null),r=V(this.gos);let n;i?n=o.findIndex(a=>a.contains(r)):n=o.indexOf(r);const l=n+(s?-1:1);return l<0||l>=o.length?null:o[l]}isTargetUnderManagedComponent(t,i){if(!i)return!1;const s=t.querySelectorAll(`.${Je.FOCUS_MANAGED_CLASS}`);if(!s.length)return!1;for(let o=0;o<s.length;o++)if(s[o].contains(i))return!0;return!1}findTabbableParent(t,i=5){let s=0;for(;t&&Qi(t)===null&&++s<=i;)t=t.parentElement;return Qi(t)===null?null:t}focusOverlay(t){var s;const i=this.overlayService.isVisible()&&((s=this.overlayService.getOverlayWrapper())==null?void 0:s.getGui());return!!i&&this.focusInto(i,t)}focusGridViewFailed(t,i){return i&&this.focusOverlay(t)||t&&this.focusLastHeader()}focusGridView(t,i=!1,s=!0){var r,n;if(this.overlayService.isExclusive())return s&&this.focusOverlay(i);if(this.isCellFocusSuppressed())return i&&!this.isHeaderFocusSuppressed()?this.focusLastHeader():s&&this.focusOverlay(i)?!0:this.focusNextGridCoreContainer(!1);const o=i?this.rowPositionUtils.getLastRow():this.rowPositionUtils.getFirstRow();if(o){const{rowIndex:l,rowPinned:a}=o;if(t??(t=(r=this.getFocusedHeader())==null?void 0:r.column),t&&l!==void 0&&l!==null){if(this.navigationService.ensureCellVisible({rowIndex:l,column:t,rowPinned:a}),i){const d=this.rowRenderer.getRowByPosition(o);if(d!=null&&d.isFullWidth()&&this.navigationService.tryToFocusFullWidthRow(o,i))return!0}return this.setFocusedCell({rowIndex:l,column:t,rowPinned:Re(a),forceBrowserFocus:!0}),(n=this.rangeService)==null||n.setRangeToCell({rowIndex:l,rowPinned:a,column:t}),!0}}return!!(s&&this.focusOverlay(i)||i&&this.focusLastHeader())}isGridFocused(){const t=V(this.gos);return!!t&&this.eGridDiv.contains(t)}focusNextGridCoreContainer(t,i=!1){return!i&&this.gridCtrl.focusNextInnerContainer(t)?!0:((i||!t&&!this.gridCtrl.isDetailGrid())&&this.gridCtrl.forceFocusOutOfContainer(t),!1)}focusAdvancedFilter(t){var i;return this.advancedFilterFocusColumn=t==null?void 0:t.column,((i=this.advancedFilterService)==null?void 0:i.getCtrl().focusHeaderComp())??!1}focusNextFromAdvancedFilter(t,i){var o;const s=(i?void 0:this.advancedFilterFocusColumn)??((o=this.visibleColsService.getAllCols())==null?void 0:o[0]);return t?this.focusHeaderPosition({headerPosition:{column:s,headerRowIndex:this.headerNavigationService.getHeaderRowCount()-1}}):this.focusGridView(s)}clearAdvancedFilterColumn(){this.advancedFilterFocusColumn=void 0}addFocusableContainer(t){this.gridCtrl.addFocusableContainer(t)}removeFocusableContainer(t){this.gridCtrl.removeFocusableContainer(t)}focusGridInnerElement(t){return this.gridCtrl.focusInnerElement(t)}allowFocusForNextGridCoreContainer(t){this.gridCtrl.allowFocusForNextCoreContainer(t)}};Ns.keyboardModeActive=!1;Ns.instanceCount=0;var ug=Ns,gg=class extends v{constructor(){super(...arguments),this.beanName="pinnedWidthService"}wireBeans(e){this.visibleColsService=e.visibleColsService}postConstruct(){const e=this.checkContainerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e,displayedColumnsWidthChanged:e}),this.addManagedPropertyListener("domLayout",e)}checkContainerWidths(){const e=z(this.gos,"print"),t=e?0:this.visibleColsService.getColsLeftWidth(),i=e?0:this.visibleColsService.getDisplayedColumnsRightWidth();t!=this.leftWidth&&(this.leftWidth=t,this.eventService.dispatchEvent({type:"leftPinnedWidthChanged"})),i!=this.rightWidth&&(this.rightWidth=i,this.eventService.dispatchEvent({type:"rightPinnedWidthChanged"}))}getPinnedRightWidth(){return this.rightWidth}getPinnedLeftWidth(){return this.leftWidth}},pg=class extends v{constructor(){super(...arguments),this.additionalFocusableContainers=new Set}wireBeans(e){this.beans=e,this.focusService=e.focusService,this.visibleColsService=e.visibleColsService}setComp(e,t,i){this.view=e,this.eGridHostDiv=t,this.eGui=i,this.eGui.setAttribute("grid-id",this.beans.context.getGridId());const{dragAndDropService:s,mouseEventService:o,ctrlsService:r,resizeObserverService:n}=this.beans,l={getContainer:()=>this.eGui,isInterestedIn:d=>d===1||d===0,getIconName:()=>"notAllowed"};s.addDropTarget(l),this.addDestroyFunc(()=>s.removeDropTarget(l)),o.stampTopLevelGridCompWithGridInstance(t),this.createManagedBean(new Vs(this.view)),this.view.setRtlClass(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr"),this.updateGridThemeClass(),this.addManagedEventListeners({gridStylesChanged:this.handleThemeChange.bind(this)});const a=n.observeResize(this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc(()=>a()),r.register("gridCtrl",this)}isDetailGrid(){var t;const e=this.focusService.findTabbableParent(this.getGui());return((t=e==null?void 0:e.getAttribute("row-id"))==null?void 0:t.startsWith("detail"))||!1}getOptionalSelectors(){var t,i,s,o,r;const e=this.beans;return{paginationSelector:(t=e.paginationService)==null?void 0:t.getPaginationSelector(),gridHeaderDropZonesSelector:(i=e.columnDropZonesService)==null?void 0:i.getDropZoneSelector(),sideBarSelector:(s=e.sideBarService)==null?void 0:s.getSideBarSelector(),statusBarSelector:(o=e.statusBarService)==null?void 0:o.getStatusPanelSelector(),watermarkSelector:(r=e.licenseManager)==null?void 0:r.getWatermarkSelector()}}onGridSizeChanged(){this.eventService.dispatchEvent({type:"gridSizeChanged",clientWidth:this.eGridHostDiv.clientWidth,clientHeight:this.eGridHostDiv.clientHeight})}destroyGridUi(){this.view.destroyGridUi()}getGui(){return this.eGui}setResizeCursor(e){this.view.setCursor(e?"ew-resize":null)}disableUserSelect(e){this.view.setUserSelect(e?"none":null)}focusNextInnerContainer(e){const t=this.getFocusableContainers(),{indexWithFocus:i,nextIndex:s}=this.getNextFocusableIndex(t,e);if(s<0||s>=t.length)return!1;if(s===0){if(i>0){const o=this.visibleColsService.getAllCols(),r=I(o);if(this.focusService.focusGridView(r,!0))return!0}return!1}return this.focusContainer(t[s],e)}focusInnerElement(e){const t=this.gos.getCallback("focusGridInnerElement");if(t&&t({fromBottom:!!e}))return!0;const i=this.getFocusableContainers(),s=this.visibleColsService.getAllCols();if(e){if(i.length>1)return this.focusContainer(I(i),!0);const o=I(s);if(this.focusService.focusGridView(o,!0))return!0}if(this.gos.get("headerHeight")===0||this.focusService.isHeaderFocusSuppressed()){if(this.focusService.focusGridView(s[0]))return!0;for(let o=1;o<i.length;o++)if(this.focusService.focusInto(i[o].getGui()))return!0;return!1}return this.focusService.focusFirstHeader()}forceFocusOutOfContainer(e=!1){this.view.forceFocusOutOfContainer(e)}addFocusableContainer(e){this.additionalFocusableContainers.add(e)}removeFocusableContainer(e){this.additionalFocusableContainers.delete(e)}allowFocusForNextCoreContainer(e){var r;const t=this.view.getFocusableContainers(),{nextIndex:i,indexWithFocus:s}=this.getNextFocusableIndex(t,e);if(s===-1||i<0||i>=t.length)return;const o=t[i];(r=o.setAllowFocus)==null||r.call(o,!0),setTimeout(()=>{var n;(n=o.setAllowFocus)==null||n.call(o,!1)})}getNextFocusableIndex(e,t){const i=V(this.gos),s=e.findIndex(r=>r.getGui().contains(i)),o=s+(t?-1:1);return{indexWithFocus:s,nextIndex:o}}focusContainer(e,t){var s,o;(s=e.setAllowFocus)==null||s.call(e,!0);const i=this.focusService.focusInto(e.getGui(),t);return(o=e.setAllowFocus)==null||o.call(e,!1),i}getFocusableContainers(){return[...this.view.getFocusableContainers(),...this.additionalFocusableContainers]}updateGridThemeClass(){const e=this.beans.environment.getGridThemeClass();e&&this.view.setGridThemeClass(e)}handleThemeChange(e){e.themeChanged&&this.updateGridThemeClass()}destroy(){this.additionalFocusableContainers.clear(),super.destroy()}},fg=class extends dn{constructor(e){super(),this.gridBody=b,this.sideBar=b,this.pagination=b,this.rootWrapperBody=b,this.eGridDiv=e}postConstruct(){const e={destroyGridUi:()=>this.destroyBean(this),setRtlClass:r=>this.addCssClass(r),setGridThemeClass:r=>this.addCssClass(r),forceFocusOutOfContainer:this.forceFocusOutOfContainer.bind(this),updateLayoutClasses:this.updateLayoutClasses.bind(this),getFocusableContainers:this.getFocusableContainers.bind(this),setUserSelect:r=>{this.getGui().style.userSelect=r??"",this.getGui().style.webkitUserSelect=r??""},setCursor:r=>{this.getGui().style.cursor=r??""}},t=this.createManagedBean(new pg),i=t.getOptionalSelectors(),s=this.createTemplate(i),o=[Gc,...Object.values(i).filter(r=>!!r)];this.setTemplate(s,o),t.setComp(e,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:r=>t.focusInnerElement(r),forceFocusOutWhenTabGuardsAreEmpty:!0})}insertGridIntoDom(){const e=this.getGui();this.eGridDiv.appendChild(e),this.addDestroyFunc(()=>{this.eGridDiv.removeChild(e),this.gos.get("debug")&&ne("Grid removed from DOM")})}updateLayoutClasses(e,t){const i=this.rootWrapperBody.classList;i.toggle("ag-layout-auto-height",t.autoHeight),i.toggle("ag-layout-normal",t.normal),i.toggle("ag-layout-print",t.print),this.addOrRemoveCssClass("ag-layout-auto-height",t.autoHeight),this.addOrRemoveCssClass("ag-layout-normal",t.normal),this.addOrRemoveCssClass("ag-layout-print",t.print)}createTemplate(e){const t=e.gridHeaderDropZonesSelector?"<ag-grid-header-drop-zones></ag-grid-header-drop-zones>":"",i=e.sideBarSelector?'<ag-side-bar data-ref="sideBar"></ag-side-bar>':"",s=e.statusBarSelector?"<ag-status-bar></ag-status-bar>":"",o=e.watermarkSelector?"<ag-watermark></ag-watermark>":"",r=e.paginationSelector?'<ag-pagination data-ref="pagination"></ag-pagination>':"";return`<div class="ag-root-wrapper" role="presentation"> ${t} <div class="ag-root-wrapper-body" data-ref="rootWrapperBody" role="presentation"> <ag-grid-body data-ref="gridBody"></ag-grid-body> ${i} </div> ${s} ${r} ${o} </div>`}getFocusableElement(){return this.rootWrapperBody}forceFocusOutOfContainer(e=!1){var t;if(!e&&((t=this.pagination)!=null&&t.isDisplayed())){this.pagination.forceFocusOutOfContainer(e);return}super.forceFocusOutOfContainer(e)}getFocusableContainers(){const e=[this.gridBody];return[this.sideBar,this.pagination].forEach(t=>{t&&e.push(t)}),e.filter(t=>ue(t.getGui()))}},Cg=class extends v{constructor(){super(...arguments),this.beanName="alignedGridsService",this.consuming=!1}wireBeans(e){this.columnModel=e.columnModel,this.columnSizeService=e.columnSizeService,this.ctrlsService=e.ctrlsService,this.columnApplyStateService=e.columnApplyStateService}getAlignedGridApis(){let e=this.gos.get("alignedGrids")??[];const t=typeof e=="function";typeof e=="function"&&(e=e());const i=()=>`See ${this.getFrameworkOverrides().getDocLink("aligned-grids")}`;return e.map(o=>{var n;if(!o){O("alignedGrids contains an undefined option."),t||O(`You may want to configure via a callback to avoid setup race conditions: "alignedGrids: () => [linkedGrid]"`),O(i());return}if(this.isGridApi(o))return o;const r=o;return"current"in r?(n=r.current)==null?void 0:n.api:(r.api||O(`alignedGrids - No api found on the linked grid. If you are passing gridOptions to alignedGrids since v31 this is no longer valid. ${i()}`),r.api)}).filter(o=>!!o&&!o.isDestroyed())}isGridApi(e){return!!e&&!!e.dispatchEvent}postConstruct(){const e=this.fireColumnEvent.bind(this);this.addManagedEventListeners({columnMoved:e,columnVisible:e,columnPinned:e,columnGroupOpened:e,columnResized:e,bodyScroll:this.fireScrollEvent.bind(this),alignedGridColumn:({event:t})=>this.onColumnEvent(t),alignedGridScroll:({event:t})=>this.onScrollEvent(t)})}fireEvent(e){this.consuming||this.getAlignedGridApis().forEach(t=>{t.isDestroyed()||t.dispatchEvent(e)})}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){this.fireEvent({type:"alignedGridColumn",event:e})}fireScrollEvent(e){e.direction==="horizontal"&&this.fireEvent({type:"alignedGridScroll",event:e})}onScrollEvent(e){this.onEvent(()=>{this.ctrlsService.getGridBodyCtrl().getScrollFeature().setHorizontalScrollPosition(e.left,!0)})}extractDataFromEvent(e,t){const i=[];return e.columns?e.columns.forEach(s=>{i.push(t(s))}):e.column&&i.push(t(e.column)),i}getMasterColumns(e){return this.extractDataFromEvent(e,t=>t)}getColumnIds(e){return this.extractDataFromEvent(e,t=>t.getColId())}onColumnEvent(e){this.onEvent(()=>{switch(e.type){case"columnMoved":case"columnVisible":case"columnPinned":case"columnResized":{this.processColumnEvent(e);break}case"columnGroupOpened":{this.processGroupOpenedEvent(e);break}case"columnPivotChanged":S("pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid.");break}})}processGroupOpenedEvent(e){const{columnModel:t}=this;e.columnGroups.forEach(i=>{let s=null;i&&(s=t.getProvidedColGroup(i.getGroupId())),!(i&&!s)&&t.setColumnGroupOpened(s,i.isExpanded(),"alignedGridChanged")})}processColumnEvent(e){var d;const t=e.column;let i=null;if(t&&(i=this.columnModel.getColDefCol(t.getColId())),t&&!i)return;const s=this.getMasterColumns(e),{columnApplyStateService:o,columnSizeService:r,ctrlsService:n}=this;switch(e.type){case"columnMoved":{const c=e.api.getColumnState().map(u=>({colId:u.colId}));o.applyColumnState({state:c,applyOrder:!0},"alignedGridChanged")}break;case"columnVisible":{const c=e.api.getColumnState().map(u=>({colId:u.colId,hide:u.hide}));o.applyColumnState({state:c},"alignedGridChanged")}break;case"columnPinned":{const c=e.api.getColumnState().map(u=>({colId:u.colId,pinned:u.pinned}));o.applyColumnState({state:c},"alignedGridChanged")}break;case"columnResized":{const h=e,c={};s.forEach(u=>{c[u.getId()]={key:u.getColId(),newWidth:u.getActualWidth()}}),(d=h.flexColumns)==null||d.forEach(u=>{c[u.getId()]&&delete c[u.getId()]}),r.setColumnWidths(Object.values(c),!1,h.finished,"alignedGridChanged");break}}const a=n.getGridBodyCtrl().isVerticalScrollShowing();this.getAlignedGridApis().forEach(h=>{h.setGridOption("alwaysShowVerticalScroll",a)})}},mg={version:x,moduleName:"@ag-grid-community/aligned-grid",beans:[Cg]};function vg(e,t){const i=e.columnModel.getColDefCol(t);return i?i.getColDef():null}function wg(e){return e.columnModel.getColumnDefs()}function Sg(e,t){typeof t=="number"?e.columnSizeService.sizeColumnsToFit(t,"api"):e.ctrlsService.getGridBodyCtrl().sizeColumnsToFit(t)}function yg(e,t,i){e.columnModel.setColumnGroupOpened(t,i,"api")}function Rg(e,t,i){return e.visibleColsService.getColumnGroup(t,i)}function Fg(e,t){return e.columnModel.getProvidedColGroup(t)}function bg(e,t,i){return e.columnNameService.getDisplayNameForColumn(t,i)||""}function Pg(e,t,i){return e.columnNameService.getDisplayNameForColumnGroup(t,i)||""}function Dg(e,t){return e.columnModel.getColDefCol(t)}function Eg(e){return e.columnModel.getColDefCols()}function Mg(e,t){return e.columnApplyStateService.applyColumnState(t,"api")}function xg(e){return e.columnGetStateService.getColumnState()}function Ag(e){e.columnApplyStateService.resetColumnState("api")}function Tg(e){return e.columnGroupStateService.getColumnGroupState()}function Ig(e,t){e.columnGroupStateService.setColumnGroupState(t,"api")}function Lg(e){e.columnGroupStateService.resetColumnGroupState("api")}function Og(e){return e.visibleColsService.isPinningLeft()||e.visibleColsService.isPinningRight()}function Gg(e){return e.visibleColsService.isPinningLeft()}function kg(e){return e.visibleColsService.isPinningRight()}function Hg(e,t){return e.visibleColsService.getColAfter(t)}function Vg(e,t){return e.visibleColsService.getColBefore(t)}function Ng(e,t,i){e.columnModel.setColsVisible([t],i,"api")}function Bg(e,t,i){e.columnModel.setColsVisible(t,i,"api")}function Wg(e,t,i){e.columnModel.setColsPinned([t],i,"api")}function zg(e,t,i){e.columnModel.setColsPinned(t,i,"api")}function _g(e){return e.columnModel.getCols()}function Ug(e){return e.visibleColsService.getLeftCols()}function Kg(e){return e.visibleColsService.getCenterCols()}function $g(e){return e.visibleColsService.getRightCols()}function jg(e){return e.visibleColsService.getAllCols()}function qg(e){return e.columnViewportService.getViewportColumns()}function Yg(e,t,i){e.columnMoveService.moveColumns([t],i,"api")}function Qg(e,t,i){e.columnMoveService.moveColumnByIndex(t,i,"api")}function Xg(e,t,i){e.columnMoveService.moveColumns(t,i,"api")}function Jg(e,t,i,s=!0,o="api"){e.columnSizeService.setColumnWidths([{key:t,newWidth:i}],!1,s,o)}function Zg(e,t,i=!0,s="api"){e.columnSizeService.setColumnWidths(t,!1,i,s)}function ep(e){return e.visibleColsService.getTreeLeft()}function tp(e){return e.visibleColsService.getTreeCenter()}function ip(e){return e.visibleColsService.getTreeRight()}function sp(e){return e.visibleColsService.getAllTrees()}function op(e,t,i){return e.columnAutosizeService.autoSizeCols({colKeys:[t],skipHeader:i,source:"api"})}function rp(e,t,i){e.columnAutosizeService.autoSizeCols({colKeys:t,skipHeader:i,source:"api"})}function np(e,t){e.columnAutosizeService.autoSizeAllColumns("api",t)}var lp=class extends v{constructor(){super(...arguments),this.beanName="dataTypeService",this.dataTypeDefinitions={},this.isWaitingForRowData=!1,this.isColumnTypeOverrideInDataTypeDefinitions=!1,this.columnStateUpdatesPendingInference={},this.columnStateUpdateListenerDestroyFuncs=[]}wireBeans(e){this.rowModel=e.rowModel,this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.valueService=e.valueService,this.columnApplyStateService=e.columnApplyStateService,this.filterManager=e.filterManager}postConstruct(){this.groupHideOpenParents=this.gos.get("groupHideOpenParents"),this.addManagedPropertyListener("groupHideOpenParents",()=>{this.groupHideOpenParents=this.gos.get("groupHideOpenParents")}),this.processDataTypeDefinitions(),this.addManagedPropertyListener("dataTypeDefinitions",e=>{this.processDataTypeDefinitions(),this.columnModel.recreateColumnDefs(We(e.source))})}processDataTypeDefinitions(){const e=this.getDefaultDataTypes();this.dataTypeDefinitions={},this.formatValueFuncs={};const t=s=>o=>{const{column:r,node:n,value:l}=o;let a=r.getColDef().valueFormatter;return a===s.groupSafeValueFormatter&&(a=s.valueFormatter),this.valueService.formatValue(r,n,l,a)};Object.entries(e).forEach(([s,o])=>{const r={...o,groupSafeValueFormatter:this.createGroupSafeValueFormatter(o)};this.dataTypeDefinitions[s]=r,this.formatValueFuncs[s]=t(r)});const i=this.gos.get("dataTypeDefinitions")??{};this.dataTypeMatchers={},Object.entries(i).forEach(([s,o])=>{const r=this.processDataTypeDefinition(o,i,[s],e);r&&(this.dataTypeDefinitions[s]=r,o.dataTypeMatcher&&(this.dataTypeMatchers[s]=o.dataTypeMatcher),this.formatValueFuncs[s]=t(r))}),this.checkObjectValueHandlers(e),["dateString","text","number","boolean","date"].forEach(s=>{const o=this.dataTypeMatchers[s];o&&delete this.dataTypeMatchers[s],this.dataTypeMatchers[s]=o??e[s].dataTypeMatcher})}mergeDataTypeDefinitions(e,t){const i={...e,...t};return e.columnTypes&&t.columnTypes&&t.appendColumnTypes&&(i.columnTypes=[...Yt(e.columnTypes),...Yt(t.columnTypes)]),i}processDataTypeDefinition(e,t,i,s){let o;const r=e.extendsDataType;if(e.columnTypes&&(this.isColumnTypeOverrideInDataTypeDefinitions=!0),e.extendsDataType===e.baseDataType){let n=s[r];const l=t[r];if(n&&l&&(n=l),!this.validateDataTypeDefinition(e,n,r))return;o=this.mergeDataTypeDefinitions(n,e)}else{if(i.includes(r)){S('Data type definition hierarchies (via the "extendsDataType" property) cannot contain circular references.');return}const n=t[r];if(!this.validateDataTypeDefinition(e,n,r))return;const l=this.processDataTypeDefinition(n,t,[...i,r],s);if(!l)return;o=this.mergeDataTypeDefinitions(l,e)}return{...o,groupSafeValueFormatter:this.createGroupSafeValueFormatter(o)}}validateDataTypeDefinition(e,t,i){return t?t.baseDataType!==e.baseDataType?(S('The "baseDataType" property of a data type definition must match that of its parent.'),!1):!0:(S(`The data type definition ${i} does not exist.`),!1)}createGroupSafeValueFormatter(e){if(e.valueFormatter)return t=>{var i,s;if((i=t.node)!=null&&i.group){const o=(t.colDef.pivotValueColumn??t.column).getAggFunc();if(o){if(o==="first"||o==="last")return e.valueFormatter(t);if(e.baseDataType==="number"&&o!=="count"){if(typeof t.value=="number")return e.valueFormatter(t);if(typeof t.value=="object"){if(!t.value)return;if("toNumber"in t.value)return e.valueFormatter({...t,value:t.value.toNumber()});if("value"in t.value)return e.valueFormatter({...t,value:t.value.value})}}return}if((this.gos.get("suppressGroupMaintainValueType")||this.gos.get("groupDisplayType")==="groupRows")&&!this.gos.get("treeData"))return}else if(this.groupHideOpenParents&&t.column.isRowGroupActive()&&typeof t.value=="string"&&!((s=e.dataTypeMatcher)!=null&&s.call(e,t.value)))return;return e.valueFormatter(t)}}updateColDefAndGetColumnType(e,t,i){let{cellDataType:s}=t;const{field:o}=t;if(s===void 0&&(s=e.cellDataType),(s==null||s===!0)&&(s=this.canInferCellDataType(e,t)?this.inferCellDataType(o,i):!1),!s){e.cellDataType=!1;return}const r=this.dataTypeDefinitions[s];if(!r){S(`Missing data type definition - "${s}"`);return}return e.cellDataType=s,r.groupSafeValueFormatter&&(e.valueFormatter=r.groupSafeValueFormatter),r.valueParser&&(e.valueParser=r.valueParser),r.suppressDefaultProperties||this.setColDefPropertiesForBaseDataType(e,s,r,i),r.columnTypes}addColumnListeners(e){if(!this.isWaitingForRowData)return;const t=this.columnStateUpdatesPendingInference[e.getColId()];if(!t)return;const i=s=>{t.add(s.key)};e.addEventListener("columnStateUpdated",i),this.columnStateUpdateListenerDestroyFuncs.push(()=>e.removeEventListener("columnStateUpdated",i))}canInferCellDataType(e,t){if(!N(this.gos))return!1;const i={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(this.doColDefPropsPreventInference(t,i))return!1;const s=t.type===null?e.type:t.type;if(s){const o=this.gos.get("columnTypes")??{};if(Yt(s).some(n=>{const l=o[n.trim()];return l&&this.doColDefPropsPreventInference(l,i)}))return!1}return!this.doColDefPropsPreventInference(e,i)}doColDefPropsPreventInference(e,t){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some(([i,s])=>this.doesColDefPropPreventInference(e,t,i,s))}doesColDefPropPreventInference(e,t,i,s){if(!t[i])return!1;const o=e[i];return o===null?(t[i]=!1,!1):s===void 0?!!o:o===s}inferCellDataType(e,t){if(!e)return;let i;const s=this.getInitialData();if(s){const r=e.indexOf(".")>=0&&!this.gos.get("suppressFieldDotNotation");i=Rt(s,e,r)}else this.initWaitForRowData(t);if(i==null)return;const[o]=Object.entries(this.dataTypeMatchers).find(([r,n])=>n(i))??["object"];return o}getInitialData(){const e=this.gos.get("rowData");if(e!=null&&e.length)return e[0];if(this.initialData)return this.initialData;{const t=this.rowModel.getRootNode().allLeafChildren;if(t!=null&&t.length)return t[0].data}return null}initWaitForRowData(e){if(this.columnStateUpdatesPendingInference[e]=new Set,this.isWaitingForRowData)return;this.isWaitingForRowData=!0;const t=this.isColumnTypeOverrideInDataTypeDefinitions;t&&this.columnModel.queueResizeOperations();const[i]=this.addManagedEventListeners({rowDataUpdateStarted:s=>{const{firstRowData:o}=s;o&&(i==null||i(),this.isWaitingForRowData=!1,this.processColumnsPendingInference(o,t),this.columnStateUpdatesPendingInference={},t&&this.columnModel.processResizeOperations(),this.eventService.dispatchEvent({type:"dataTypesInferred"}))}})}isPendingInference(){return this.isWaitingForRowData}processColumnsPendingInference(e,t){this.initialData=e;const i=[];this.destroyColumnStateUpdateListeners();const s={},o={};Object.entries(this.columnStateUpdatesPendingInference).forEach(([r,n])=>{const l=this.columnModel.getCol(r);if(!l)return;const a=l.getColDef();if(!this.columnModel.resetColDefIntoCol(l,"cellDataTypeInferred"))return;const d=l.getColDef();if(t&&d.type&&d.type!==a.type){const h=this.getUpdatedColumnState(l,n);h.rowGroup&&h.rowGroupIndex==null&&(s[r]=h),h.pivot&&h.pivotIndex==null&&(o[r]=h),i.push(h)}}),t&&i.push(...this.funcColsService.generateColumnStateForRowGroupAndPivotIndexes(s,o)),i.length&&this.columnApplyStateService.applyColumnState({state:i},"cellDataTypeInferred"),this.initialData=null}getUpdatedColumnState(e,t){const i=this.columnApplyStateService.getColumnStateFromColDef(e);return t.forEach(s=>{delete i[s],s==="rowGroup"?delete i.rowGroupIndex:s==="pivot"&&delete i.pivotIndex}),i}checkObjectValueHandlers(e){const t=this.dataTypeDefinitions.object,i=e.object;this.hasObjectValueParser=t.valueParser!==i.valueParser,this.hasObjectValueFormatter=t.valueFormatter!==i.valueFormatter}getDateStringTypeDefinition(e){return e?this.getDataTypeDefinition(e)??this.dataTypeDefinitions.dateString:this.dataTypeDefinitions.dateString}getDateParserFunction(e){return this.getDateStringTypeDefinition(e).dateParser}getDateFormatterFunction(e){return this.getDateStringTypeDefinition(e).dateFormatter}getDataTypeDefinition(e){const t=e.getColDef();if(t.cellDataType)return this.dataTypeDefinitions[t.cellDataType]}getBaseDataType(e){var t;return(t=this.getDataTypeDefinition(e))==null?void 0:t.baseDataType}checkType(e,t){var s;if(t==null)return!0;const i=(s=this.getDataTypeDefinition(e))==null?void 0:s.dataTypeMatcher;return i?i(t):!0}validateColDef(e){const t=i=>S(`Cell data type is "object" but no Value ${i} has been provided. Please either provide an object data type definition with a Value ${i}, or set "colDef.value${i}"`);e.cellDataType==="object"&&(e.valueFormatter===this.dataTypeDefinitions.object.groupSafeValueFormatter&&!this.hasObjectValueFormatter&&t("Formatter"),e.editable&&e.valueParser===this.dataTypeDefinitions.object.valueParser&&!this.hasObjectValueParser&&t("Parser"))}getFormatValue(e){return this.formatValueFuncs[e]}setColDefPropertiesForBaseDataType(e,t,i,s){var r;const o=this.formatValueFuncs[t];switch(i.baseDataType){case"number":{e.cellEditor="agNumberCellEditor";break}case"boolean":{e.cellEditor="agCheckboxCellEditor",e.cellRenderer="agCheckboxCellRenderer",e.suppressKeyboardEvent=n=>!!n.colDef.editable&&n.event.key===m.SPACE;break}case"date":{e.cellEditor="agDateCellEditor",e.keyCreator=o;break}case"dateString":{e.cellEditor="agDateStringCellEditor",e.keyCreator=o;break}case"object":{e.cellEditorParams={useFormatter:!0},e.comparator=(n,l)=>{const a=this.columnModel.getColDefCol(s),d=a==null?void 0:a.getColDef();if(!a||!d)return 0;const h=n==null?"":o({column:a,node:null,value:n}),c=l==null?"":o({column:a,node:null,value:l});return h===c?0:h>c?1:-1},e.keyCreator=o;break}}(r=this.filterManager)==null||r.setColDefPropertiesForDataType(e,i,o)}getDefaultDataTypes(){const e=i=>!!i.match("^\\d{4}-\\d{2}-\\d{2}$"),t=this.localeService.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:i=>{var s,o;return((o=(s=i.newValue)==null?void 0:s.trim)==null?void 0:o.call(s))===""?null:Number(i.newValue)},valueFormatter:i=>i.value==null?"":typeof i.value!="number"||isNaN(i.value)?t("invalidNumber","Invalid Number"):String(i.value),dataTypeMatcher:i=>typeof i=="number"},text:{baseDataType:"text",valueParser:i=>i.newValue===""?null:Hi(i.newValue),dataTypeMatcher:i=>typeof i=="string"},boolean:{baseDataType:"boolean",valueParser:i=>{var s,o;return i.newValue==null?i.newValue:((o=(s=i.newValue)==null?void 0:s.trim)==null?void 0:o.call(s))===""?null:String(i.newValue).toLowerCase()==="true"},valueFormatter:i=>i.value==null?"":String(i.value),dataTypeMatcher:i=>typeof i=="boolean"},date:{baseDataType:"date",valueParser:i=>Z(i.newValue==null?null:String(i.newValue)),valueFormatter:i=>i.value==null?"":!(i.value instanceof Date)||isNaN(i.value.getTime())?t("invalidDate","Invalid Date"):de(i.value,!1)??"",dataTypeMatcher:i=>i instanceof Date},dateString:{baseDataType:"dateString",dateParser:i=>Z(i)??void 0,dateFormatter:i=>de(i??null,!1)??void 0,valueParser:i=>e(String(i.newValue))?i.newValue:null,valueFormatter:i=>e(String(i.value))?i.value:"",dataTypeMatcher:i=>typeof i=="string"&&e(i)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:i=>Hi(i.value)??""}}}destroyColumnStateUpdateListeners(){this.columnStateUpdateListenerDestroyFuncs.forEach(e=>e()),this.columnStateUpdateListenerDestroyFuncs=[]}destroy(){this.dataTypeDefinitions={},this.dataTypeMatchers={},this.formatValueFuncs={},this.columnStateUpdatesPendingInference={},this.destroyColumnStateUpdateListeners(),super.destroy()}},ap={version:x,moduleName:"@ag-grid-community/data-type",beans:[lp]},dp={version:x,moduleName:"@ag-grid-community/column-api",apiFunctions:{getColumnDef:vg,getColumnDefs:wg,sizeColumnsToFit:Sg,setColumnGroupOpened:yg,getColumnGroup:Rg,getProvidedColumnGroup:Fg,getDisplayNameForColumn:bg,getDisplayNameForColumnGroup:Pg,getColumn:Dg,getColumns:Eg,applyColumnState:Mg,getColumnState:xg,resetColumnState:Ag,getColumnGroupState:Tg,setColumnGroupState:Ig,resetColumnGroupState:Lg,isPinning:Og,isPinningLeft:Gg,isPinningRight:kg,getDisplayedColAfter:Hg,getDisplayedColBefore:Vg,setColumnVisible:Ng,setColumnsVisible:Bg,setColumnPinned:Wg,setColumnsPinned:zg,getAllGridColumns:_g,getDisplayedLeftColumns:Ug,getDisplayedCenterColumns:Kg,getDisplayedRightColumns:$g,getAllDisplayedColumns:jg,getAllDisplayedVirtualColumns:qg,moveColumn:Yg,moveColumnByIndex:Qg,moveColumns:Xg,setColumnWidth:Jg,setColumnWidths:Zg,getLeftDisplayedColumnGroups:ep,getCenterDisplayedColumnGroups:tp,getRightDisplayedColumnGroups:ip,getAllDisplayedColumnGroups:sp,autoSizeColumn:op,autoSizeColumns:rp,autoSizeAllColumns:np}};function hp(e,t){e.ctrlsService.getGridBodyCtrl().getRowDragFeature().addRowDropZone(t)}function cp(e,t){const i=e.dragAndDropService.findExternalZone(t);i&&e.dragAndDropService.removeDropTarget(i)}function up(e,t){return e.ctrlsService.getGridBodyCtrl().getRowDragFeature().getRowDropZone(t)}var gp={version:x,moduleName:"@ag-grid-community/drag-api",apiFunctions:{addRowDropZone:hp,removeRowDropZone:cp,getRowDropZoneParams:up}};function pp(e){return e.pinnedRowModel.getPinnedTopRowCount()}function fp(e){return e.pinnedRowModel.getPinnedBottomRowCount()}function Cp(e,t){return e.pinnedRowModel.getPinnedTopRow(t)}function mp(e,t){return e.pinnedRowModel.getPinnedBottomRow(t)}var vp={version:x,moduleName:"@ag-grid-community/pinned-row-api",apiFunctions:{getPinnedTopRowCount:pp,getPinnedBottomRowCount:fp,getPinnedTopRow:Cp,getPinnedBottomRow:mp}};function wp(e){e.overlayService.showLoadingOverlay()}function Sp(e){e.overlayService.showNoRowsOverlay()}function yp(e){e.overlayService.hideOverlay()}var Rp={version:x,moduleName:"@ag-grid-community/overlay-api",apiFunctions:{showLoadingOverlay:wp,showNoRowsOverlay:Sp,hideOverlay:yp}};function Fp(e,t,i){if(!t)return;const s=e.ctrlsService.getGridBodyCtrl().getGui(),o=`aria-${t}`;i===null?s.removeAttribute(o):s.setAttribute(o,i)}function bp(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function Pp(e,t={}){const i=s=>S(`Since v31.1 api.flashCells parameter '${s}Delay' is deprecated. Please use '${s}Duration' instead.`);F(t.fadeDelay)&&i("fade"),F(t.flashDelay)&&i("flash"),e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.flashCells(t))}function Dp(e){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsService.getHeaderRowContainerCtrls().forEach(t=>t.refresh()))}function Ep(e){return e.animationFrameService.isQueueEmpty()}function Mp(e){e.animationFrameService.flushAllFrames()}function xp(e){return{rowHeight:Ke(e.gos),headerHeight:e.columnModel.getHeaderHeight()}}function Ap(e,t={}){return e.rowRenderer.getCellRendererInstances(t).map(bt)}var Tp={version:x,moduleName:"@ag-grid-community/render-api",apiFunctions:{setGridAriaProperty:Fp,refreshCells:bp,flashCells:Pp,refreshHeader:Dp,isAnimationFrameQueueEmpty:Ep,flushAllAnimationFrames:Mp,getSizesForCurrentTheme:xp,getCellRendererInstances:Ap}};function Ip(e){e.valueCache.expire()}function Lp(e,t,i){return un(e,{colKey:t,rowNode:i})}function un(e,t){const{colKey:i,rowNode:s,useFormatter:o}=t,r=e.columnModel.getColDefCol(i)??e.columnModel.getCol(i);if(A(r))return null;const n=e.valueService.getValueForDisplay(r,s);return o?e.valueService.formatValue(r,s,n)??me(n,!0):n}function Op(e){return e.context.getGridId()}function Gp(e){e.gridDestroyService.destroy()}function kp(e){return e.gridDestroyService.isDestroyCalled()}function Hp(e,t){return e.gos.get(t)}function Vp(e,t,i){gn(e,{[t]:i})}function gn(e,t){e.gos.updateGridOptions({options:t})}function Np(e,t,i){e.apiEventService.addEventListener(t,i)}function Bp(e,t,i){e.apiEventService.removeEventListener(t,i)}function Wp(e,t){e.apiEventService.addGlobalListener(t)}function zp(e,t){e.apiEventService.removeGlobalListener(t)}function _p(e){return e.focusService.getFocusedCell()}function Up(e){return e.focusService.clearFocusedCell()}function Kp(e,t,i,s){e.focusService.setFocusedCell({rowIndex:t,column:i,rowPinned:s,forceBrowserFocus:!0})}function $p(e,t){return e.navigationService.tabToNextCell(!1,t)}function jp(e,t){return e.navigationService.tabToNextCell(!0,t)}function qp(e,t,i=!1){const s=e.headerNavigationService.getHeaderPositionForColumn(t,i);s&&e.focusService.focusHeaderPosition({headerPosition:s})}function Yp(e,t,i){const s=e.columnModel.getCol(t);e.menuService.showColumnMenu({column:s,buttonElement:i,positionBy:"button"})}function Qp(e,t,i){let s=e.columnModel.getCol(t);if(s||(s=e.columnModel.getColDefCol(t)),!s){O(`column '${t}' not found`);return}e.menuService.showColumnMenu({column:s,mouseEvent:i,positionBy:"mouse"})}function Xp(e,t){const i=e.columnModel.getCol(t);if(!i){O(`column '${t}' not found`);return}e.menuService.showColumnMenu({column:i,positionBy:"auto"})}function Jp(e){e.menuService.hidePopupMenu()}function Zp(e,t={}){const i=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(i))}function ef(e,t,i,s,o){e.expansionService.setRowNodeExpanded(t,i,s,o)}function tf(e,t){return e.rowModel.getRowNode(t)}function sf(e,t,i,s){e.rowRenderer.addRenderedRowListener(t,i,s)}function of(e){return e.rowRenderer.getRenderedNodes()}function rf(e,t,i){e.rowModel.forEachNode(t,i)}function nf(e){return pn(e)}function pn(e){return e.rowRenderer.getFirstVirtualRenderedRow()}function lf(e){return fn(e)}function fn(e){return e.rowRenderer.getLastVirtualRenderedRow()}function af(e,t){return e.rowModel.getRow(t)}function df(e){return e.rowModel.getRowCount()}function hf(e){return e.rowModel}function cf(e,t){if(!t.nodes.every(l=>l.rowPinned?(S("cannot select pinned rows"),!1):l.id===void 0?(S("cannot select node until id for node is known"),!1):!0))return;const{nodes:s,source:o,newValue:r}=t,n=s;e.selectionService.setNodesSelected({nodes:n,source:o??"api",newValue:r})}function uf(e,t="apiSelectAll"){e.selectionService.selectAllRowNodes({source:t})}function gf(e,t="apiSelectAll"){e.selectionService.deselectAllRowNodes({source:t})}function pf(e,t="apiSelectAllFiltered"){e.selectionService.selectAllRowNodes({source:t,justFiltered:!0})}function ff(e,t="apiSelectAllFiltered"){e.selectionService.deselectAllRowNodes({source:t,justFiltered:!0})}function Cf(e,t="apiSelectAllCurrentPage"){e.selectionService.selectAllRowNodes({source:t,justCurrentPage:!0})}function mf(e,t="apiSelectAllCurrentPage"){e.selectionService.deselectAllRowNodes({source:t,justCurrentPage:!0})}function vf(e){return e.selectionService.getSelectedNodes()}function wf(e){return e.selectionService.getSelectedRows()}function Sf(e){e.sortController.onSortChanged("api")}var yf={version:x,moduleName:"@ag-grid-community/core-api",apiFunctions:{getGridId:Op,destroy:Gp,isDestroyed:kp,getGridOption:Hp,setGridOption:Vp,updateGridOptions:gn}},Rf={version:x,moduleName:"@ag-grid-community/row-selection-api",apiFunctions:{setNodesSelected:cf,selectAll:uf,deselectAll:gf,selectAllFiltered:pf,deselectAllFiltered:ff,selectAllOnCurrentPage:Cf,deselectAllOnCurrentPage:mf,getSelectedNodes:vf,getSelectedRows:wf}},Ff={version:x,moduleName:"@ag-grid-community/row-api",apiFunctions:{redrawRows:Zp,setRowNodeExpanded:ef,getRowNode:tf,addRenderedRowListener:sf,getRenderedNodes:of,forEachNode:rf,getFirstDisplayedRow:nf,getFirstDisplayedRowIndex:pn,getLastDisplayedRow:lf,getLastDisplayedRowIndex:fn,getDisplayedRowAtIndex:af,getDisplayedRowCount:df,getModel:hf}},bf={version:x,moduleName:"@ag-grid-community/scroll-api",apiFunctions:{getVerticalPixelRange:lu,getHorizontalPixelRange:au,ensureColumnVisible:nn,ensureIndexVisible:ln,ensureNodeVisible:du}},Pf={version:x,moduleName:"@ag-grid-community/keyboard-navigation-api",apiFunctions:{getFocusedCell:_p,clearFocusedCell:Up,setFocusedCell:Kp,setFocusedHeader:qp,tabToNextCell:$p,tabToPreviousCell:jp}},Df={version:x,moduleName:"@ag-grid-community/event-api",apiFunctions:{addEventListener:Np,addGlobalListener:Wp,removeEventListener:Bp,removeGlobalListener:zp}},Ef={version:x,moduleName:"@ag-grid-community/cell-api",apiFunctions:{expireValueCache:Ip,getValue:Lp,getCellValue:un}},Mf={version:x,moduleName:"@ag-grid-community/menu-api",apiFunctions:{showColumnMenuAfterButtonClick:Yp,showColumnMenuAfterMouseClick:Qp,showColumnMenu:Xp,hidePopupMenu:Jp}},xf={version:x,moduleName:"@ag-grid-community/sort-api",apiFunctions:{onSortChanged:Sf}},Af={version:x,moduleName:"@ag-grid-community/api",dependantModules:[yf,vp,Rf,dp,Ff,gp,bf,Rp,Pf,Df,Tp,Ef,Mf,xf]};function Tf(e){var t;return((t=e.stateService)==null?void 0:t.getState())??{}}function If(e){switch(e={...e},e.version||(e.version="32.1.0"),e.version){case"32.1.0":e=Lf(e)}return e}function Lf(e){return e.cellSelection=Of(e,"rangeSelection"),e}function Of(e,t){if(e&&typeof e=="object")return e[t]}var Gf=class extends v{constructor(){super(...arguments),this.beanName="stateService",this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Y(()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=Y(()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),0),this.onRowSelectedDebounced=Y(()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}wireBeans(e){this.filterManager=e.filterManager,this.ctrlsService=e.ctrlsService,this.pivotResultColsService=e.pivotResultColsService,this.focusService=e.focusService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.columnGroupStateService=e.columnGroupStateService,this.columnGetStateService=e.columnGetStateService,this.paginationService=e.paginationService,this.selectionService=e.selectionService,this.expansionService=e.expansionService,this.columnAnimationService=e.columnAnimationService,this.columnApplyStateService=e.columnApplyStateService,this.sideBarService=e.sideBarService,this.rangeService=e.rangeService}postConstruct(){this.isClientSideRowModel=N(this.gos),this.cachedState=this.getInitialState(),this.setCachedStateValue("version",x),this.ctrlsService.whenReady(this,()=>this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnGridReady()));const[e,t,i]=this.addManagedEventListeners({newColumnsLoaded:({source:s})=>{s==="gridInitializing"&&(e(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnColumnsInitialised()))},rowCountReady:()=>{t==null||t(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnRowCountReady())},firstDataRendered:()=>{i==null||i(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnFirstDataRendered())}})}getInitialState(){return If(this.gos.get("initialState")??{})}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setupStateOnGridReady(){this.updateCachedState("sideBar",this.getSideBarState());const e=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:e,sideBarUpdated:e})}setupStateOnColumnsInitialised(){const e=this.getInitialState();this.setColumnState(e),this.setColumnGroupState(e),this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState());const t=i=>()=>this.updateColumnState([i]);this.addManagedEventListeners({columnValueChanged:t("aggregation"),columnMoved:t("columnOrder"),columnPinned:t("columnPinning"),columnResized:t("columnSizing"),columnVisible:t("columnVisibility"),columnPivotChanged:t("pivot"),columnPivotModeChanged:t("pivot"),columnRowGroupChanged:t("rowGroup"),sortChanged:t("sort"),newColumnsLoaded:()=>this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setupStateOnRowCountReady(){const{filter:e,rowGroupExpansion:t,rowSelection:i,pagination:s}=this.getInitialState(),o=this.gos.get("advancedFilterModel");(e||o)&&this.setFilterState(e,o),t&&this.setRowGroupExpansionState(t),i&&this.setRowSelectionState(i),s&&this.setPaginationState(s),this.updateCachedState("filter",this.getFilterState()),this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowSelection",this.getRowSelectionState()),this.updateCachedState("pagination",this.getPaginationState());const r=()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState());this.addManagedEventListeners({filterChanged:()=>this.updateCachedState("filter",this.getFilterState()),rowGroupOpened:()=>this.onRowGroupOpenedDebounced(),expandOrCollapseAll:r,columnRowGroupChanged:r,rowDataUpdated:()=>{this.gos.get("groupDefaultExpanded")!==0&&setTimeout(()=>{r()})},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:n=>{(n.newPage||n.newPageSize)&&this.updateCachedState("pagination",this.getPaginationState())}})}setupStateOnFirstDataRendered(){const{scroll:e,cellSelection:t,focusedCell:i,columnOrder:s}=this.getInitialState();i&&this.setFocusedCellState(i),t&&this.setCellSelectionState(t),e&&this.setScrollState(e),this.setColumnPivotState(!!(s!=null&&s.orderedColIds)),this.updateCachedState("sideBar",this.getSideBarState()),this.updateCachedState("focusedCell",this.getFocusedCellState());const o=this.getRangeSelectionState();this.updateCachedState("rangeSelection",o),this.updateCachedState("cellSelection",o),this.updateCachedState("scroll",this.getScrollState()),this.addManagedEventListeners({cellFocused:()=>this.updateCachedState("focusedCell",this.getFocusedCellState()),cellSelectionChanged:r=>{if(r.finished){const n=this.getRangeSelectionState();this.updateCachedState("rangeSelection",n),this.updateCachedState("cellSelection",n)}},bodyScrollEnd:()=>this.updateCachedState("scroll",this.getScrollState())})}getColumnState(){const e=this.columnModel.isPivotMode(),t=[],i=[],s=[],o=[],r=[],n=[],l=[],a=[],d=[];let h=0;const c=this.columnGetStateService.getColumnState();for(let u=0;u<c.length;u++){const{colId:g,sort:p,sortIndex:C,rowGroup:f,rowGroupIndex:w,aggFunc:y,pivot:R,pivotIndex:P,pinned:M,hide:D,width:E,flex:T}=c[u];d.push(g),p&&(t[C??h++]={colId:g,sort:p}),f&&(i[w??0]=g),typeof y=="string"&&s.push({colId:g,aggFunc:y}),R&&(o[P??0]=g),M&&(M==="right"?n:r).push(g),D&&l.push(g),(T||E)&&a.push({colId:g,flex:T??void 0,width:E})}return{sort:t.length?{sortModel:t}:void 0,rowGroup:i.length?{groupColIds:i}:void 0,aggregation:s.length?{aggregationModel:s}:void 0,pivot:o.length||e?{pivotMode:e,pivotColIds:o}:void 0,columnPinning:r.length||n.length?{leftColIds:r,rightColIds:n}:void 0,columnVisibility:l.length?{hiddenColIds:l}:void 0,columnSizing:a.length?{columnSizingModel:a}:void 0,columnOrder:d.length?{orderedColIds:d}:void 0}}setColumnState(e){const{sort:t,rowGroup:i,aggregation:s,pivot:o,columnPinning:r,columnVisibility:n,columnSizing:l,columnOrder:a,partialColumnState:d}=e,h={},c=f=>{let w=h[f];return w||(w={colId:f},h[f]=w,w)},u=d?{}:{sort:null,sortIndex:null,rowGroup:null,rowGroupIndex:null,aggFunc:null,pivot:null,pivotIndex:null,pinned:null,hide:null,flex:null};t&&(t.sortModel.forEach(({colId:f,sort:w},y)=>{const R=c(f);R.sort=w,R.sortIndex=y}),u.sort=null,u.sortIndex=null),i&&(i.groupColIds.forEach((f,w)=>{const y=c(f);y.rowGroup=!0,y.rowGroupIndex=w}),u.rowGroup=null,u.rowGroupIndex=null),s&&(s.aggregationModel.forEach(({colId:f,aggFunc:w})=>{c(f).aggFunc=w}),u.aggFunc=null),o&&(o.pivotColIds.forEach((f,w)=>{const y=c(f);y.pivot=!0,y.pivotIndex=w}),this.gos.updateGridOptions({options:{pivotMode:o.pivotMode},source:"gridInitializing"}),u.pivot=null,u.pivotIndex=null),r&&(r.leftColIds.forEach(f=>{c(f).pinned="left"}),r.rightColIds.forEach(f=>{c(f).pinned="right"}),u.pinned=null),n&&(n.hiddenColIds.forEach(f=>{c(f).hide=!0}),u.hide=null),l&&(l.columnSizingModel.forEach(({colId:f,flex:w,width:y})=>{const R=c(f);R.flex=w??null,R.width=y}),u.flex=null);const g=a==null?void 0:a.orderedColIds,p=!!(g!=null&&g.length),C=p?g.map(f=>c(f)):Object.values(h);C.length&&(this.columnStates=C,this.columnApplyStateService.applyColumnState({state:C,applyOrder:p,defaultState:u},"gridInitializing"))}setColumnPivotState(e){const t=this.columnStates;this.columnStates=void 0;const i=this.columnGroupStates;if(this.columnGroupStates=void 0,!!this.pivotResultColsService.isPivotResultColsPresent()){if(t){const s=[];for(const o of t)this.pivotResultColsService.getPivotResultCol(o.colId)&&s.push(o);this.columnApplyStateService.applyColumnState({state:s,applyOrder:e},"gridInitializing")}i&&this.columnGroupStateService.setColumnGroupState(i,"gridInitializing")}}getColumnGroupState(){const e=this.columnGroupStateService.getColumnGroupState(),t=[];return e.forEach(({groupId:i,open:s})=>{s&&t.push(i)}),t.length?{openColumnGroupIds:t}:void 0}setColumnGroupState(e){var o;if(!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const t=new Set((o=e.columnGroup)==null?void 0:o.openColumnGroupIds),s=this.columnGroupStateService.getColumnGroupState().map(({groupId:r})=>{const n=t.has(r);return n&&t.delete(r),{groupId:r,open:n}});t.forEach(r=>{s.push({groupId:r,open:!0})}),s.length&&(this.columnGroupStates=s),this.columnGroupStateService.setColumnGroupState(s,"gridInitializing")}getFilterState(){var i,s;let e=(i=this.filterManager)==null?void 0:i.getFilterModel();e&&Object.keys(e).length===0&&(e=void 0);const t=((s=this.filterManager)==null?void 0:s.getAdvancedFilterModel())??void 0;return e||t?{filterModel:e,advancedFilterModel:t}:void 0}setFilterState(e,t){var o,r;const{filterModel:i,advancedFilterModel:s}=e??{advancedFilterModel:t};i&&((o=this.filterManager)==null||o.setFilterModel(i,"columnFilter")),s&&((r=this.filterManager)==null||r.setAdvancedFilterModel(s))}getRangeSelectionState(){var t;const e=(t=this.rangeService)==null?void 0:t.getCellRanges().map(i=>{const{id:s,type:o,startRow:r,endRow:n,columns:l,startColumn:a}=i;return{id:s,type:o,startRow:r,endRow:n,colIds:l.map(d=>d.getColId()),startColId:a.getColId()}});return e!=null&&e.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeService:i,columnModel:s,visibleColsService:o}=this;if(!ve(t)||!i)return;const r=[];if(e.cellRanges.forEach(n=>{const l=[];if(n.colIds.forEach(d=>{const h=s.getCol(d);h&&l.push(h)}),!l.length)return;let a=s.getCol(n.startColId);if(!a){const d=o.getAllCols(),h=new Set(l);a=d.find(c=>h.has(c))}r.push({...n,columns:l,startColumn:a})}),zn(t)&&_n(t)&&r.length>1)return S("cannot add multiple ranges when `cellSelection.suppressMultiRanges = true`");i.setCellRanges(r)}getScrollState(){var s;if(!this.isClientSideRowModel)return;const e=(s=this.ctrlsService.getGridBodyCtrl())==null?void 0:s.getScrollFeature(),{left:t}=(e==null?void 0:e.getHScrollPosition())??{left:0},{top:i}=(e==null?void 0:e.getVScrollPosition())??{top:0};return i||t?{top:i,left:t}:void 0}setScrollState(e){var s;if(!this.isClientSideRowModel)return;const{top:t,left:i}=e;(s=this.ctrlsService.getGridBodyCtrl())==null||s.getScrollFeature().setScrollPosition(t,i)}getSideBarState(){var e,t;return(t=(e=this.sideBarService)==null?void 0:e.getSideBarComp())==null?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.focusService.getFocusedCell();if(e){const{column:t,rowIndex:i,rowPinned:s}=e;return{colId:t.getColId(),rowIndex:i,rowPinned:s}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{colId:t,rowIndex:i,rowPinned:s}=e;this.focusService.setFocusedCell({column:this.columnModel.getCol(t),rowIndex:i,rowPinned:s,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){if(!this.paginationService)return;const e=this.paginationService.getCurrentPage(),t=this.gos.get("paginationAutoPageSize")?void 0:this.paginationService.getPageSize();if(!(!e&&!t))return{page:e,pageSize:t}}setPaginationState(e){this.paginationService&&(e.pageSize&&!this.gos.get("paginationAutoPageSize")&&this.paginationService.setPageSize(e.pageSize,"initialState"),typeof e.page=="number"&&this.paginationService.setPage(e.page))}getRowSelectionState(){var i;const e=this.selectionService.getSelectionState();return!e||!Array.isArray(e)&&(e.selectAll===!1||e.selectAllChildren===!1)&&!((i=e==null?void 0:e.toggledNodes)!=null&&i.length)?void 0:e}setRowSelectionState(e){this.selectionService.setSelectionState(e,"gridInitializing")}getRowGroupExpansionState(){const e=this.expansionService.getExpandedRows();return e.length?{expandedRowGroupIds:e}:void 0}setRowGroupExpansionState(e){this.expansionService.expandRows(e.expandedRowGroupIds)}updateColumnState(e){const t=this.getColumnState();let i=!1;Object.entries(t).forEach(([s,o])=>{Mt(o,this.cachedState[s])||(i=!0)}),this.cachedState={...this.cachedState,...t},i&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const i=this.cachedState[e];this.setCachedStateValue(e,t),Mt(t,i)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState={...this.cachedState,[e]:t}}refreshStaleState(){this.staleStateKeys.forEach(e=>{switch(e){case"rowSelection":this.setCachedStateValue(e,this.getRowSelectionState());break}}),this.staleStateKeys.clear()}dispatchStateUpdateEvent(e){this.suppressEvents||(e.forEach(t=>this.queuedUpdateSources.add(t)),this.dispatchStateUpdateEventDebounced())}dispatchQueuedStateUpdateEvents(){const e=Array.from(this.queuedUpdateSources);this.queuedUpdateSources.clear(),this.eventService.dispatchEvent({type:"stateUpdated",sources:e,state:this.cachedState})}suppressEventsAndDispatchInitEvent(e){this.suppressEvents=!0,this.columnAnimationService.setSuppressAnimation(!0),e(),setTimeout(()=>{this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&(this.columnAnimationService.setSuppressAnimation(!1),this.dispatchStateUpdateEvent(["gridInitializing"]))})}},Cn={version:x,moduleName:"@ag-grid-community/state-core",beans:[Gf]},kf={version:x,moduleName:"@ag-grid-community/state-api",apiFunctions:{getState:Tf},dependantModules:[Cn]},Hf={version:x,moduleName:"@ag-grid-community/state",dependantModules:[Cn,kf]};function Vf(e){return e.rowModel.isLastRowIndexKnown()}function Nf(e){var t;return((t=e.paginationService)==null?void 0:t.getPageSize())??100}function Bf(e){var t;return((t=e.paginationService)==null?void 0:t.getCurrentPage())??0}function Wf(e){var t;return((t=e.paginationService)==null?void 0:t.getTotalPages())??1}function zf(e){return e.paginationService?e.paginationService.getMasterRowCount():e.rowModel.getRowCount()}function _f(e){var t;(t=e.paginationService)==null||t.goToNextPage()}function Uf(e){var t;(t=e.paginationService)==null||t.goToPreviousPage()}function Kf(e){var t;(t=e.paginationService)==null||t.goToFirstPage()}function $f(e){var t;(t=e.paginationService)==null||t.goToLastPage()}function jf(e,t){var i;(i=e.paginationService)==null||i.goToPage(t)}var qf=class extends v{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeService"}wireBeans(e){this.ctrlsService=e.ctrlsService,this.paginationService=e.paginationService}postConstruct(){this.ctrlsService.whenReady(this,e=>{this.centerRowsCtrl=e.center;const t=this.checkPageSize.bind(this);this.addManagedEventListeners({bodyHeightChanged:t,scrollVisibilityChanged:t}),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||this.centerRowsCtrl==null}onPaginationAutoSizeChanged(){this.notActive()?this.paginationService.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.getViewportSizeFeature().getBodyHeight();if(e>0){const t=()=>{const i=Math.max(Ke(this.gos),1),s=Math.floor(e/i);this.paginationService.setPageSize(s,"autoCalculated")};this.isBodyRendered?Y(()=>t(),50)():(t(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}};function Yf(e,t,i){e.addManagedElementListeners(t,{keydown:s=>{if(!s.defaultPrevented&&s.key===m.TAB){const o=s.shiftKey;i.findNextFocusableElement(t,!1,o)||i.focusNextGridCoreContainer(o)&&s.preventDefault()}}})}var wt="paginationPageSizeSelector",Qf=class extends G{constructor(){super('<span class="ag-paging-page-size"></span>'),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.paginationService.getPageSize()||(this.paginationService.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}wireBeans(e){this.paginationService=e.paginationService}postConstruct(){this.addManagedPropertyListener(wt,()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedEventListeners({paginationChanged:e=>this.handlePaginationChanged(e)})}handlePaginationChanged(e){if(!this.selectPageSizeComp||!(e!=null&&e.newPageSize))return;const t=this.paginationService.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&!e&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp)}reset(){U(this.getGui()),this.selectPageSizeComp&&(this.selectPageSizeComp=this.destroyBean(this.selectPageSizeComp))}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel")&&!this.gos.get("paginationAutoPageSize")&&this.gos.get(wt)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.paginationService.getPageSize(),i=!t||!e.includes(t);if(i){const o=this.gos.exists("paginationPageSize"),r=this.gos.get(wt)!==!0;S(`'paginationPageSize=${t}'${o?"":" (default value)"}, but ${t} is not included in${r?"":" the default"} paginationPageSizeSelector=[${e.join(", ")}].`),r||S(`Either set '${wt}' to an array that includes ${t} or to 'false' to disable the page size selector.`),e.unshift("")}const s=String(i?"":t);this.selectPageSizeComp?(ke(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(s,!0)):this.createPageSizeSelectorComp(e,s),this.hasEmptyOption=i}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const i=this.localeService.getLocaleTextFunc(),s=i("pageSizeSelectorLabel","Page Size:"),o=i("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new Ms).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(o).setLabel(s).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(wt);return!Array.isArray(t)||se(t)?e:[...t].sort((i,s)=>i-s)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},Xf={selector:"AG-PAGE-SIZE-SELECTOR",component:Qf},Jf=class extends dn{constructor(){super(),this.btFirst=b,this.btPrevious=b,this.btNext=b,this.btLast=b,this.lbRecordCount=b,this.lbFirstRowOnPage=b,this.lbLastRowOnPage=b,this.lbCurrent=b,this.lbTotal=b,this.pageSizeComp=b,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1}wireBeans(e){this.rowModel=e.rowModel,this.paginationService=e.paginationService,this.focusService=e.focusService,this.ariaAnnouncementService=e.ariaAnnouncementService}postConstruct(){const e=this.gos.get("enableRtl");this.setTemplate(this.getTemplate(),[Xf]);const{btFirst:t,btPrevious:i,btNext:s,btLast:o}=this;this.activateTabIndex([t,i,s,o]),t.insertAdjacentElement("afterbegin",ie(e?"last":"first",this.gos)),i.insertAdjacentElement("afterbegin",ie(e?"next":"previous",this.gos)),s.insertAdjacentElement("afterbegin",ie(e?"previous":"next",this.gos)),o.insertAdjacentElement("afterbegin",ie(e?"first":"last",this.gos)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],()=>this.onPageSizeRelatedOptionsChange()),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:r=>{this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(r):this.focusService.focusGridInnerElement(r)},forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}onPaginationChanged(){const t=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(t),t&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){this.areListenersSetup||(this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)}),[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}].forEach(e=>{const{el:t,fn:i}=e;this.addManagedListeners(t,{click:i,keydown:s=>{(s.key===m.ENTER||s.key===m.SPACE)&&(s.preventDefault(),i())}})}),Yf(this,this.getGui(),this.focusService),this.areListenersSetup=!0)}onBtFirst(){this.previousAndFirstButtonsDisabled||this.paginationService.goToFirstPage()}formatNumber(e){const t=this.gos.getCallback("paginationNumberFormatter");if(t)return t({value:e});const i=this.localeService.getLocaleTextFunc(),s=i("thousandSeparator",","),o=i("decimalSeparator",".");return md(e,s,o)}getTemplate(){const e=this.localeService.getLocaleTextFunc(),t=e("page","Page"),i=e("to","to"),s=e("of","of"),o=e("firstPage","First Page"),r=e("previousPage","Previous Page"),n=e("nextPage","Next Page"),l=e("lastPage","Last Page"),a=this.getCompId();return`<div class="ag-paging-panel ag-unselectable" id="ag-${a}"> <ag-page-size-selector data-ref="pageSizeComp"></ag-page-size-selector> <span class="ag-paging-row-summary-panel"> <span id="ag-${a}-first-row" data-ref="lbFirstRowOnPage" class="ag-paging-row-summary-panel-number"></span> <span id="ag-${a}-to">${i}</span> <span id="ag-${a}-last-row" data-ref="lbLastRowOnPage" class="ag-paging-row-summary-panel-number"></span> <span id="ag-${a}-of">${s}</span> <span id="ag-${a}-row-count" data-ref="lbRecordCount" class="ag-paging-row-summary-panel-number"></span> </span> <span class="ag-paging-page-summary-panel" role="presentation"> <div data-ref="btFirst" class="ag-button ag-paging-button" role="button" aria-label="${o}"></div> <div data-ref="btPrevious" class="ag-button ag-paging-button" role="button" aria-label="${r}"></div> <span class="ag-paging-description"> <span id="ag-${a}-start-page">${t}</span> <span id="ag-${a}-start-page-number" data-ref="lbCurrent" class="ag-paging-number"></span> <span id="ag-${a}-of-page">${s}</span> <span id="ag-${a}-of-page-number" data-ref="lbTotal" class="ag-paging-number"></span> </span> <div data-ref="btNext" class="ag-button ag-paging-button" role="button" aria-label="${n}"></div> <div data-ref="btLast" class="ag-button ag-paging-button" role="button" aria-label="${l}"></div> </span> </div>`}onBtNext(){this.nextButtonDisabled||this.paginationService.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.paginationService.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.paginationService.goToLastPage()}enableOrDisableButtons(){const e=this.paginationService.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),i=this.paginationService.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const s=this.isZeroPagesToDisplay(),o=e===i-1;this.nextButtonDisabled=o||s,this.lastButtonDisabled=!t||s||e===i-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){Al(e,t),e.classList.toggle("ag-disabled",t)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.paginationService.getTotalPages();return e&&t===0}updateLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.paginationService.getTotalPages(),i=this.paginationService.getMasterRowCount(),s=e?i:null;if(s===1){const y=this.rowModel.getRow(0);if(y&&y.group&&!(y.groupData||y.aggData)){this.setTotalLabelsToZero();return}}const o=this.paginationService.getCurrentPage(),r=this.paginationService.getPageSize();let n,l;this.isZeroPagesToDisplay()?n=l=0:(n=r*o+1,l=n+r-1,e&&l>s&&(l=s));const a=n+r-1,d=!e&&i<a,h=this.formatNumber(n);this.lbFirstRowOnPage.textContent=h;let c;const u=this.localeService.getLocaleTextFunc();d?c=u("pageLastRowUnknown","?"):c=this.formatNumber(l),this.lbLastRowOnPage.textContent=c;const p=t>0?o+1:0,C=this.formatNumber(p);this.lbCurrent.textContent=C;let f,w;if(e)f=this.formatNumber(t),w=this.formatNumber(s);else{const y=u("more","more");f=y,w=y}this.lbTotal.textContent=f,this.lbRecordCount.textContent=w,this.announceAriaStatus(h,c,w,C,f)}announceAriaStatus(e,t,i,s,o){const r=this.localeService.getLocaleTextFunc(),n=r("page","Page"),l=r("to","to"),a=r("of","of"),d=`${e} ${l} ${t} ${a} ${i}`,h=`${n} ${s} ${a} ${o}`;d!==this.ariaRowStatus&&(this.ariaRowStatus=d,this.ariaAnnouncementService.announceValue(d,"paginationRow")),h!==this.ariaPageStatus&&(this.ariaPageStatus=h,this.ariaAnnouncementService.announceValue(h,"paginationPage"))}setTotalLabelsToZero(){const e=this.formatNumber(0);this.lbFirstRowOnPage.textContent=e,this.lbCurrent.textContent=e,this.lbLastRowOnPage.textContent=e,this.lbTotal.textContent=e,this.lbRecordCount.textContent=e,this.announceAriaStatus(e,e,e,e,e)}},Zf={selector:"AG-PAGINATION",component:Jf},eC=class extends v{constructor(){super(...arguments),this.beanName="paginationService",this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.masterRowCount=0}wireBeans(e){this.rowModel=e.rowModel,this.pageBoundsService=e.pageBoundsService}postConstruct(){this.active=this.gos.get("pagination"),this.pageSizeFromGridOptions=this.gos.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this))}getPaginationSelector(){return Zf}isPaginateChildRows(){return this.gos.get("groupRemoveSingleChildren")||this.gos.get("groupRemoveLowestSingleChildren")?!0:this.gos.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){!this.active||this.currentPage===e||typeof this.currentPage!="number"||(this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0}))}isRowPresent(e){return e.rowIndex>=this.topDisplayedRowIndex&&e.rowIndex<=this.bottomDisplayedRowIndex}getPageForIndex(e){return Math.floor(e/this.pageSize)}goToPageWithIndex(e){if(!this.active)return;const t=this.getPageForIndex(e);this.goToPage(t)}isRowInPage(e){return this.active?this.getPageForIndex(e.rowIndex)===this.currentPage:!0}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return F(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:F(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:F(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:F(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.pageBoundsService.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(this.pageSizeAutoCalculated===void 0)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const i=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,this.currentPage!==0&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,this.currentPage!==0&&this.goToFirstPage();break}i!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){this.currentPage>=this.totalPages&&(this.currentPage=this.totalPages-1),(!isFinite(this.currentPage)||isNaN(this.currentPage)||this.currentPage<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){if(this.masterRowCount=this.rowModel.getTopLevelRowCount(),this.masterRowCount<=0){this.setZeroRows();return}const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid();const t=this.pageSize*this.currentPage;let i=this.pageSize*(this.currentPage+1)-1;if(i>e&&(i=e),this.topDisplayedRowIndex=this.rowModel.getTopLevelRowDisplayedIndex(t),i===e)this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1;else{const s=this.rowModel.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=s-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){if(this.masterRowCount=this.rowModel.getRowCount(),this.masterRowCount===0){this.setZeroRows();return}const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=this.pageSize*this.currentPage,this.bottomDisplayedRowIndex=this.pageSize*(this.currentPage+1)-1,this.bottomDisplayedRowIndex>e&&(this.bottomDisplayedRowIndex=e)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:i=!1,newPageSize:s=!1}=e;this.eventService.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:i,newPageSize:s,keepRenderedRows:t})}},mn={version:x,moduleName:"@ag-grid-community/pagination-core",beans:[eC,qf]},tC={version:x,moduleName:"@ag-grid-community/pagination-api",dependantModules:[mn],apiFunctions:{paginationIsLastPageFound:Vf,paginationGetPageSize:Nf,paginationGetCurrentPage:Bf,paginationGetTotalPages:Wf,paginationGetRowCount:zf,paginationGoToNextPage:_f,paginationGoToPreviousPage:Uf,paginationGoToFirstPage:Kf,paginationGoToLastPage:$f,paginationGoToPage:jf}},iC={version:x,moduleName:"@ag-grid-community/pagination",dependantModules:[mn,tC]},J="clientSide",$="serverSide",tt="infinite",sC={onGroupExpandedOrCollapsed:[J],refreshClientSideRowModel:[J],isRowDataEmpty:[J],forEachLeafNode:[J],forEachNodeAfterFilter:[J],forEachNodeAfterFilterAndSort:[J],resetRowHeights:[J],applyTransaction:[J],applyTransactionAsync:[J],flushAsyncTransactions:[J],getBestCostNodeSelection:[J],getServerSideSelectionState:[$],setServerSideSelectionState:[$],applyServerSideTransaction:[$],applyServerSideTransactionAsync:[$],applyServerSideRowData:[$],retryServerSideLoads:[$],flushServerSideAsyncTransactions:[$],refreshServerSide:[$],getServerSideGroupLevelState:[$],refreshInfiniteCache:[tt],purgeInfiniteCache:[tt],getInfiniteRowCount:[tt],isLastRowIndexKnown:[tt,$],expandAll:[J,$],collapseAll:[J,$],onRowHeightChanged:[J,$],setRowCount:[tt,$],getCacheBlockState:[tt,$]},oC={getValue:{version:"v31.3",new:"getCellValue"},getFirstDisplayedRow:{version:"v31.1",new:"getFirstDisplayedRowIndex"},getLastDisplayedRow:{version:"v31.1",new:"getLastDisplayedRowIndex"},getModel:{version:"v31.1",message:"Please use the appropriate grid API methods instead."},setColumnVisible:{version:"v31.1",old:"setColumnVisible(key,visible)",new:"setColumnsVisible([key],visible)"},setColumnPinned:{version:"v31.1",old:"setColumnPinned(key,pinned)",new:"setColumnsPinned([key],pinned)"},moveColumn:{version:"v31.1",old:"moveColumn(key, toIndex)",new:"moveColumns([key], toIndex)"},setColumnWidth:{version:"v31.1",old:"setColumnWidth(col, width)",new:"setColumnWidths([{key: col, newWidth: width}])"},autoSizeColumn:{version:"v31.1",old:"autoSizeColumn(key, skipHeader)",new:"autoSizeColumns([key], skipHeader)"},addAggFunc:{version:"v31.1",old:"addAggFunc(key, func)",new:"addAggFuncs({ key: func })"},removeValueColumn:{version:"v31.1",old:"removeValueColumn(colKey)",new:"removeValueColumns([colKey])"},addValueColumn:{version:"v31.1",old:"addValueColumn(colKey)",new:"addValueColumns([colKey])"},removeRowGroupColumn:{version:"v31.1",old:"removeRowGroupColumn(colKey)",new:"removeRowGroupColumns([colKey])"},addRowGroupColumn:{version:"v31.1",old:"addRowGroupColumn(colKey)",new:"addRowGroupColumns([colKey])"},removePivotColumn:{version:"v31.1",old:"removePivotColumn(colKey)",new:"removePivotColumns([colKey])"},addPivotColumn:{version:"v31.1",old:"addPivotColumn(colKey)",new:"addPivotColumns([colKey])"},showColumnMenuAfterButtonClick:{version:"v31.1",message:"Use 'IHeaderParams.showColumnMenu' within a header component, or 'api.showColumnMenu' elsewhere."},showColumnMenuAfterMouseClick:{version:"v31.1",message:"Use 'IHeaderParams.showColumnMenuAfterMouseClick' within a header component, or 'api.showColumnMenu' elsewhere."},getFilterInstance:{version:"v31.1",message:"'getFilterInstance' is deprecated. To get/set individual filter models, use 'getColumnFilterModel' or 'setColumnFilterModel' instead. To get hold of the filter instance, use 'getColumnFilterInstance' which returns the instance asynchronously."},showLoadingOverlay:{version:"v32",message:'`showLoadingOverlay` is deprecated. Use the grid option "loading"=true instead or setGridOption("loading", true).'},clearRangeSelection:{version:"v32.2",message:"Use `clearCellSelection` instead."},getInfiniteRowCount:{version:"v32.2",old:"getInfiniteRowCount()",new:"getDisplayedRowCount()"}};function rC(e,t,i){const s=oC[e];if(s){const{version:r,new:n,old:l,message:a}=s,d=l??e;return(...h)=>{const c=n?`Please use ${n} instead. `:"";return S(`Since ${r} api.${d} is deprecated. ${c}${a??""}`),t.apply(t,h)}}const o=sC[e];return o?(...r)=>{const n=i.rowModel.getType();if(!o.includes(n)){O(`api.${e} can only be called when gridOptions.rowModelType is ${o.join(" or ")}`);return}return t.apply(t,r)}:t}var nC={columnsMenuParams:{version:"31.1",message:"Use `columnChooserParams` instead."},suppressMenu:{version:"31.1",message:"Use `suppressHeaderMenuButton` instead."},suppressCellFlash:{version:"31.2",message:"Use `enableCellChangeFlash={false}` in the ColDef"},checkboxSelection:{version:"32.2",message:"Use `rowSelection.checkboxes` in `GridOptions` instead."},headerCheckboxSelection:{version:"32.2",message:"Use `rowSelection.headerCheckbox = true` in `GridOptions` instead."},headerCheckboxSelectionFilteredOnly:{version:"32.2",message:'Use `rowSelection.selectAll = "filtered"` in `GridOptions` instead.'},headerCheckboxSelectionCurrentPageOnly:{version:"32.2",message:'Use `rowSelection.selectAll = "currentPage"` in `GridOptions` instead.'},showDisabledCheckboxes:{version:"32.2",message:"Use `rowSelection.hideDisabledCheckboxes = true` in `GridOptions` instead."}},xe=(e,t)=>{const i=t.rowModelType??"clientSide";return i==="clientSide"||i==="serverSide"?{module:"@ag-grid-enterprise/row-grouping"}:null},lC={enableRowGroup:xe,rowGroup:xe,rowGroupIndex:xe,enablePivot:xe,enableValue:xe,pivot:xe,pivotIndex:xe,aggFunc:xe,cellEditor:e=>e.cellEditor==="agRichSelect"||e.cellEditor==="agRichSelectCellEditor"?{module:"@ag-grid-enterprise/rich-select"}:null,menuTabs:e=>{var i;const t=["columnsMenuTab","generalMenuTab"];return(i=e.menuTabs)!=null&&i.some(s=>t.includes(s))?{module:"@ag-grid-enterprise/menu"}:null},columnsMenuParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},columnChooserParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},headerCheckboxSelection:{supportedRowModels:["clientSide","serverSide"],validate:(e,{rowSelection:t})=>t==="multiple"?null:"headerCheckboxSelection is only supported with rowSelection=multiple"},headerCheckboxSelectionFilteredOnly:{supportedRowModels:["clientSide"],validate:(e,{rowSelection:t})=>t==="multiple"?null:"headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple"},headerCheckboxSelectionCurrentPageOnly:{supportedRowModels:["clientSide"],validate:(e,{rowSelection:t})=>t==="multiple"?null:"headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple"},children:()=>it},aC={headerName:void 0,columnGroupShow:void 0,headerClass:void 0,toolPanelClass:void 0,headerValueGetter:void 0,pivotKeys:void 0,groupId:void 0,colId:void 0,sort:void 0,initialSort:void 0,field:void 0,type:void 0,cellDataType:void 0,tooltipComponent:void 0,tooltipField:void 0,headerTooltip:void 0,cellClass:void 0,showRowGroup:void 0,filter:void 0,initialAggFunc:void 0,defaultAggFunc:void 0,aggFunc:void 0,pinned:void 0,initialPinned:void 0,chartDataType:void 0,cellAriaRole:void 0,cellEditorPopupPosition:void 0,headerGroupComponent:void 0,headerGroupComponentParams:void 0,cellStyle:void 0,cellRenderer:void 0,cellRendererParams:void 0,cellEditor:void 0,cellEditorParams:void 0,filterParams:void 0,pivotValueColumn:void 0,headerComponent:void 0,headerComponentParams:void 0,floatingFilterComponent:void 0,floatingFilterComponentParams:void 0,tooltipComponentParams:void 0,refData:void 0,columnsMenuParams:void 0,columnChooserParams:void 0,children:void 0,sortingOrder:void 0,allowedAggFuncs:void 0,menuTabs:void 0,pivotTotalColumnIds:void 0,cellClassRules:void 0,icons:void 0,sortIndex:void 0,initialSortIndex:void 0,flex:void 0,initialFlex:void 0,width:void 0,initialWidth:void 0,minWidth:void 0,maxWidth:void 0,rowGroupIndex:void 0,initialRowGroupIndex:void 0,pivotIndex:void 0,initialPivotIndex:void 0,suppressCellFlash:void 0,suppressColumnsToolPanel:void 0,suppressFiltersToolPanel:void 0,openByDefault:void 0,marryChildren:void 0,suppressStickyLabel:void 0,hide:void 0,initialHide:void 0,rowGroup:void 0,initialRowGroup:void 0,pivot:void 0,initialPivot:void 0,checkboxSelection:void 0,showDisabledCheckboxes:void 0,headerCheckboxSelection:void 0,headerCheckboxSelectionFilteredOnly:void 0,headerCheckboxSelectionCurrentPageOnly:void 0,suppressMenu:void 0,suppressHeaderMenuButton:void 0,suppressMovable:void 0,lockPosition:void 0,lockVisible:void 0,lockPinned:void 0,unSortIcon:void 0,suppressSizeToFit:void 0,suppressAutoSize:void 0,enableRowGroup:void 0,enablePivot:void 0,enableValue:void 0,editable:void 0,suppressPaste:void 0,suppressNavigable:void 0,enableCellChangeFlash:void 0,rowDrag:void 0,dndSource:void 0,autoHeight:void 0,wrapText:void 0,sortable:void 0,resizable:void 0,singleClickEdit:void 0,floatingFilter:void 0,cellEditorPopup:void 0,suppressFillHandle:void 0,wrapHeaderText:void 0,autoHeaderHeight:void 0,dndSourceOnRowDrag:void 0,valueGetter:void 0,valueSetter:void 0,filterValueGetter:void 0,keyCreator:void 0,valueFormatter:void 0,valueParser:void 0,comparator:void 0,equals:void 0,pivotComparator:void 0,suppressKeyboardEvent:void 0,suppressHeaderKeyboardEvent:void 0,colSpan:void 0,rowSpan:void 0,getQuickFilterText:void 0,onCellValueChanged:void 0,onCellClicked:void 0,onCellDoubleClicked:void 0,onCellContextMenu:void 0,rowDragText:void 0,tooltipValueGetter:void 0,cellRendererSelector:void 0,cellEditorSelector:void 0,suppressSpanHeaderHeight:void 0,useValueFormatterForExport:void 0,useValueParserForImport:void 0,mainMenuItems:void 0,contextMenuItems:void 0,suppressFloatingFilterButton:void 0,suppressHeaderFilterButton:void 0,suppressHeaderContextMenu:void 0,loadingCellRenderer:void 0,loadingCellRendererParams:void 0,loadingCellRendererSelector:void 0,context:void 0},dC=Object.keys(aC),it={objectName:"colDef",allProperties:dC,docsUrl:"column-properties/",deprecations:nC,validations:lC},hC=()=>({advancedFilterModel:{version:"31",message:"Use `initialState.filter.advancedFilterModel` instead."},suppressAsyncEvents:{version:"31",message:"Events should be handled asynchronously."},cellFadeDelay:{version:"31.1",renamed:"cellFadeDuration"},cellFlashDelay:{version:"31.1",renamed:"cellFlashDuration"},suppressServerSideInfiniteScroll:{version:"31.1"},serverSideSortOnServer:{version:"31.1"},serverSideFilterOnServer:{version:"31.1"},enableCellChangeFlash:{version:"31.2",message:"Use `enableCellChangeFlash` in the `ColDef` or `defaultColDef` for all columns."},groupIncludeFooter:{version:"31.3",message:"Use `groupTotalRow` instead."},groupIncludeTotalFooter:{version:"31.3",message:"Use `grandTotalRow` instead."},suppressLoadingOverlay:{version:"32",message:"Use `loading`=false instead."},enableFillHandle:{version:"32.2",message:"Use `cellSelection.handle` instead."},enableRangeHandle:{version:"32.2",message:"Use `cellSelection.handle` instead."},enableRangeSelection:{version:"32.2",message:"Use `cellSelection = true` instead."},suppressMultiRangeSelection:{version:"32.2",message:"Use `cellSelection.suppressMultiRanges` instead."},suppressClearOnFillReduction:{version:"32.2",message:"Use `cellSelection.handle.suppressClearOnFillReduction` instead."},fillHandleDirection:{version:"32.2",message:"Use `cellSelection.handle.direction` instead."},fillOperation:{version:"32.2",message:"Use `cellSelection.handle.setFillValue` instead."},suppressRowClickSelection:{version:"32.2",message:"Use `rowSelection.enableClickSelection` instead."},suppressRowDeselection:{version:"32.2",message:"Use `rowSelection.enableClickSelection` instead."},rowMultiSelectWithClick:{version:"32.2",message:"Use `rowSelection.enableSelectionWithoutKeys` instead."},groupSelectsChildren:{version:"32.2",message:'Use `rowSelection.groupSelects = "descendants"` instead.'},groupSelectsFiltered:{version:"32.2",message:'Use `rowSelection.groupSelects = "filteredDescendants"` instead.'},isRowSelectable:{version:"32.2",message:"Use `selectionOptions.isRowSelectable` instead."},suppressCopySingleCellRanges:{version:"32.2",message:"Use `rowSelection.copySelectedRows` instead."},suppressCopyRowsToClipboard:{version:"32.2",message:"Use `rowSelection.copySelectedRows` instead."},onRangeSelectionChanged:{version:"32.2",message:"Use `onCellSelectionChanged` instead."},onRangeDeleteStart:{version:"32.2",message:"Use `onCellSelectionDeleteStart` instead."},onRangeDeleteEnd:{version:"32.2",message:"Use `onCellSelectionDeleteEnd` instead."},suppressBrowserResizeObserver:{version:"32.2",message:"The grid always uses the browser's ResizeObserver, this grid option has no effect."},onColumnEverythingChanged:{version:"32.2",message:"Either use `onDisplayedColumnsChanged` which is fired at the same time, or use one of the more specific column events."}}),cC={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:" ",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,enableStrictPivotColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressMoveWhenColumnDragging:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressAsyncEvents:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,enableCellChangeFlash:!1,cellFlashDelay:500,cellFlashDuration:500,cellFadeDelay:1e3,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupIncludeTotalFooter:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,suppressServerSideInfiniteScroll:!1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSideSortOnServer:!1,serverSideFilterOnServer:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,suppressGroupMaintainValueType:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1,columnMenu:"new",reactiveCustomComponents:!0,suppressSetFilterByDefault:!1},uC=()=>({sideBar:{module:"@ag-grid-enterprise/side-bar"},statusBar:{module:"@ag-grid-enterprise/status-bar"},enableCharts:{module:"@ag-grid-enterprise/charts"},getMainMenuItems:{module:"@ag-grid-enterprise/menu"},getContextMenuItems:{module:"@ag-grid-enterprise/menu"},allowContextMenuWithControlKey:{module:"@ag-grid-enterprise/menu"},enableAdvancedFilter:{module:"@ag-grid-enterprise/advanced-filter"},treeData:{supportedRowModels:["clientSide","serverSide"],module:"@ag-grid-enterprise/row-grouping",validate:e=>{const t=e.rowModelType??"clientSide";switch(t){case"clientSide":{const i=`treeData requires 'getDataPath' in the ${t} row model.`;return e.getDataPath?null:i}case"serverSide":{const i=`treeData requires 'isServerSideGroup' and 'getServerSideGroupKey' in the ${t} row model.`;return e.isServerSideGroup&&e.getServerSideGroupKey?null:i}}return null}},masterDetail:{module:"@ag-grid-enterprise/master-detail"},enableRangeSelection:{module:"@ag-grid-enterprise/range-selection"},enableRangeHandle:{dependencies:{enableRangeSelection:[!0]}},enableFillHandle:{dependencies:{enableRangeSelection:[!0]}},groupDefaultExpanded:{supportedRowModels:["clientSide"]},groupIncludeFooter:{supportedRowModels:["clientSide","serverSide"],validate:e=>{switch(e.rowModelType??"clientSide"){case"clientSide":return null;case"serverSide":{const i="groupIncludeFooter is not supported alongside suppressServerSideInfiniteScroll";return e.suppressServerSideInfiniteScroll?i:null}}return null}},groupHideOpenParents:{supportedRowModels:["clientSide","serverSide"],dependencies:{groupTotalRow:[void 0,"bottom"]}},groupIncludeTotalFooter:{supportedRowModels:["clientSide"]},groupRemoveSingleChildren:{dependencies:{groupHideOpenParents:[void 0,!1],groupRemoveLowestSingleChildren:[void 0,!1]}},groupRemoveLowestSingleChildren:{dependencies:{groupHideOpenParents:[void 0,!1],groupRemoveSingleChildren:[void 0,!1]}},groupSelectsChildren:{dependencies:{rowSelection:["multiple"]}},viewportDatasource:{supportedRowModels:["viewport"],module:"@ag-grid-enterprise/viewport-row-model"},serverSideDatasource:{supportedRowModels:["serverSide"],module:"@ag-grid-enterprise/server-side-row-model"},cacheBlockSize:{supportedRowModels:["serverSide","infinite"]},datasource:{supportedRowModels:["infinite"],module:"@ag-grid-community/infinite-row-model"},rowData:{supportedRowModels:["clientSide"],module:"@ag-grid-community/client-side-row-model"},paginationPageSizeSelector:{validate:e=>{const t=e.paginationPageSizeSelector;return typeof t=="boolean"||t==null||t.length?null:`'paginationPageSizeSelector' cannot be an empty array. If you want to hide the page size selector, set paginationPageSizeSelector to false.`}},rowSelection:{validate({rowSelection:e}){return e&&typeof e=="string"?'As of version 32.2.1, using `rowSelection` with the values "single" or "multiple" has been deprecated. Use the object value instead.':e&&typeof e!="object"?"Expected `RowSelectionOptions` object for the `rowSelection` property.":null}},cellSelection:{module:"@ag-grid-enterprise/range-selection"},columnDefs:()=>it,defaultColDef:()=>it,defaultColGroupDef:()=>it,autoGroupColumnDef:()=>it,selectionColumnDef:()=>it}),gC=()=>({objectName:"gridOptions",allProperties:[...Tt.ALL_PROPERTIES,...he.EVENT_CALLBACKS],propertyExceptions:["api"],docsUrl:"grid-options/",deprecations:hC(),validations:uC()}),pC=class extends v{constructor(){super(...arguments),this.beanName="validationService"}wireBeans(e){this.beans=e,this.gridOptions=e.gridOptions}postConstruct(){this.processGridOptions(this.gridOptions)}processGridOptions(e){this.processOptions(e,gC())}validateApiFunction(e,t){return rC(e,t,this.beans)}processOptions(e,t){const{validations:i,deprecations:s,allProperties:o,propertyExceptions:r,objectName:n,docsUrl:l}=t;o&&this.gridOptions.suppressPropertyNamesCheck!==!0&&this.checkProperties(e,[...r??[],...Object.keys(s)],o,n,l);const a=new Set;Object.keys(e).forEach(h=>{const c=s[h];if(c)if("renamed"in c){const{renamed:R,version:P}=c;a.add(`As of v${P}, ${String(h)} is deprecated. Please use ${String(R)} instead.`),e[R]=e[h]}else{const{message:R,version:P}=c;a.add(`As of v${P}, ${String(h)} is deprecated. ${R??""}`)}const u=e[h];if(u==null||u===!1)return;const g=i[h];let p;if(g)if(typeof g=="function"){const R=g(e,this.gridOptions);if(!R)return;if("objectName"in R){const P=e[h];if(Array.isArray(P)){P.forEach(M=>{this.processOptions(M,R)});return}this.processOptions(e[h],R);return}p=R}else p=g;else return;const{module:C,dependencies:f,validate:w,supportedRowModels:y}=p;if(y){const R=this.gridOptions.rowModelType??"clientSide";if(!y.includes(R)){a.add(`${String(h)} is not supported with the '${R}' row model.`);return}}if(C){const R=Array.isArray(C)?C:[C];let P=!0;if(R.forEach(M=>{this.gos.assertModuleRegistered(M,String(h))||(P=!1,a.add(`${String(h)} is only available when ${M} is loaded.`))}),!P)return}if(f){const R=this.checkForRequiredDependencies(h,f,e);if(R){a.add(R);return}}if(w){const R=w(e,this.gridOptions);if(R){a.add(R);return}}}),a.size>0&&a.forEach(h=>{S(h)})}checkForRequiredDependencies(e,t,i){const o=Object.entries(t).find(([l,a])=>{const d=i[l];return!a.includes(d)});if(!o)return null;const[r,n]=o;return n.length>1?`'${String(e)}' requires '${r}' to be one of [${n.join(", ")}].`:`'${String(e)}' requires '${r}' to be ${n[0]}.`}checkProperties(e,t,i,s,o){const r=["__ob__","__v_skip","__metadata__"],n=fC(Object.getOwnPropertyNames(e),[...r,...t,...i],i);if(re(n,(l,a)=>{let d=`invalid ${s} property '${l}' did you mean any of these: ${a.slice(0,8).join(", ")}.`;i.includes("context")&&(d+=` If you are trying to annotate ${s} with application data, use the '${s}.context' property instead.`),S(d)}),Object.keys(n).length>0&&o){const l=this.getFrameworkOverrides().getDocLink(o);S(`to see all the valid ${s} properties please check: ${l}`)}}};function fC(e,t,i){const s={},o=e.filter(r=>!t.some(n=>n===r));return o.length>0&&o.forEach(r=>s[r]=Cr({inputValue:r,allSuggestions:i}).values),s}var CC={version:x,moduleName:"@ag-grid-community/core"},mC={version:x,moduleName:"@ag-grid-community/core-validations",beans:[pC]},vn={version:x,moduleName:"@ag-grid-community/core-community-features",dependantModules:[CC,mC,Eu,th,Hf,ap,mg,iC,Af]},vC=class extends v{constructor(){super(...arguments),this.beanName="gridDestroyService",this.destroyCalled=!1}wireBeans(e){this.beans=e}destroy(){var e,t;this.destroyCalled||(this.eventService.dispatchEvent({type:"gridPreDestroyed",state:((e=this.beans.stateService)==null?void 0:e.getState())??{}}),this.destroyCalled=!0,(t=this.beans.ctrlsService.get("gridCtrl"))==null||t.destroyGridUi(),this.beans.context.destroy(),super.destroy())}isDestroyCalled(){return this.destroyCalled}},Et=new Set(["gridPreDestroyed","fillStart","pasteStart"]),wC=e=>e==="checkboxSelected"||e==="rowClicked"||e==="spaceKey"||e==="uiSelectAll"||e==="uiSelectAllCurrentPage"||e==="uiSelectAllFiltered",SC=new Map([...Tt.BOOLEAN_PROPERTIES.map(e=>[e,Ni]),...Tt.NUMBER_PROPERTIES.map(e=>[e,Or]),["groupAggFiltering",e=>typeof e=="function"?e:Ni(e)],["pageSize",pe(1)],["autoSizePadding",pe(0)],["keepDetailRowsCount",pe(1)],["rowBuffer",pe(0)],["infiniteInitialRowCount",pe(1)],["cacheOverflowSize",pe(1)],["cacheBlockSize",pe(1)],["serverSideInitialRowCount",pe(1)],["viewportRowModelPageSize",pe(1)],["viewportRowModelBufferSize",pe(0)]]);function wn(e,t){const i=SC.get(e);return i?i(t):t}function yC(e){const t={};return Object.entries(e).forEach(([i,s])=>{const o=wn(i,s);t[i]=o}),t}var Sn=class yn extends v{constructor(){super(...arguments),this.beanName="gos",this.domDataKey="__AG_"+Math.random().toString(),this.propertyEventService=new ct,this.globalEventHandlerFactory=t=>(i,s)=>{if(!this.isAlive())return;const o=Et.has(i);if(o&&!t||!o&&t)return;const r=he.getCallbackForEvent(i),n=this.gridOptions[r];typeof n=="function"&&this.frameworkOverrides.wrapOutgoing(()=>{n(s)})}}wireBeans(t){this.gridOptions=t.gridOptions,this.eGridDiv=t.eGridDiv,this.validationService=t.validationService,this.environment=t.environment,this.api=t.gridApi,this.gridId=t.context.getGridId()}get gridOptionsContext(){return this.gridOptions.context}postConstruct(){const t=!this.get("suppressAsyncEvents");this.eventService.addGlobalListener(this.globalEventHandlerFactory().bind(this),t),this.eventService.addGlobalListener(this.globalEventHandlerFactory(!0).bind(this),!1),this.propertyEventService.setFrameworkOverrides(this.frameworkOverrides),this.addManagedEventListeners({gridOptionsChanged:({options:i})=>{this.updateGridOptions({options:i,force:!0,source:"gridOptionsUpdated"})}})}get(t){return this.gridOptions[t]??cC[t]}getCallback(t){return this.mergeGridCommonParams(this.gridOptions[t])}exists(t){return F(this.gridOptions[t])}mergeGridCommonParams(t){return t&&(s=>{const o=s;return o.api=this.api,o.context=this.gridOptionsContext,t(o)})}updateGridOptions({options:t,force:i,source:s="api"}){var n;const o={id:yn.changeSetId++,properties:[]},r=[];Object.entries(t).forEach(([l,a])=>{s==="api"&&Fl[l]&&S(`${l} is an initial property and cannot be updated.`);const d=wn(l,a),h=i||typeof d=="object"&&s==="api",c=this.gridOptions[l];if(h||c!==d){this.gridOptions[l]=d;const u={type:l,currentValue:d,previousValue:c,changeSet:o,source:s};r.push(u)}}),(n=this.validationService)==null||n.processGridOptions(this.gridOptions),o.properties=r.map(l=>l.type),r.forEach(l=>{this.gridOptions.debug&&ne(`Updated property ${l.type} from`,l.previousValue," to ",l.currentValue),this.propertyEventService.dispatchEvent(l)})}addPropertyEventListener(t,i){this.propertyEventService.addEventListener(t,i)}removePropertyEventListener(t,i){this.propertyEventService.removeEventListener(t,i)}getDomDataKey(){return this.domDataKey}getGridCommonParams(){return{api:this.api,context:this.gridOptionsContext}}addGridCommonParams(t){const i=t;return i.api=this.api,i.context=this.gridOptionsContext,i}assertModuleRegistered(t,i){return ye.__assertRegistered(t,i,this.gridId)}isModuleRegistered(t){return ye.__isRegistered(t,this.gridId)}};Sn.changeSetId=0;var RC=Sn,FC=class extends v{constructor(){super(...arguments),this.beanName="headerPositionUtils"}wireBeans(e){this.visibleColsService=e.visibleColsService,this.ctrlsService=e.ctrlsService}findHeader(e,t){let i,s;if(W(e.column)?i=this.visibleColsService.getGroupAtDirection(e.column,t):(s=`getCol${t}`,i=this.visibleColsService[s](e.column)),!i)return;const{headerRowIndex:o}=e;if(this.getHeaderRowType(o)!=="filter"){const l=[i];for(;i.getParent();)i=i.getParent(),l.push(i);i=l[l.length-1-o]}const{column:r,headerRowIndex:n}=this.getHeaderIndexToFocus(i,o);return{column:r,headerRowIndex:n}}getHeaderIndexToFocus(e,t){let i;if(W(e)&&this.isAnyChildSpanningHeaderHeight(e)&&e.isPadding()){const s=e;i=s.getLeafColumns()[0];let o=i;for(;o!==s;)t++,o=o.getParent()}return{column:i||e,headerRowIndex:t}}isAnyChildSpanningHeaderHeight(e){return e?e.getLeafColumns().some(t=>t.isSpanHeaderHeight()):!1}getColumnVisibleParent(e,t){const i=this.getHeaderRowType(t),s=i==="filter",o=i==="column";let r=s?e:e.getParent(),n=t-1,l=n;if(o&&this.isAnyChildSpanningHeaderHeight(e.getParent())){for(;r&&r.isPadding();)r=r.getParent(),n--;l=n,n<0&&(r=e,n=t,l=void 0)}return{column:r,headerRowIndex:n,headerRowIndexWithoutSpan:l}}getColumnVisibleChild(e,t,i="After"){const s=this.getHeaderRowType(t);let o=e,r=t+1;const n=r;if(s==="group"){const l=e.getDisplayedLeafColumns(),a=i==="After"?l[0]:I(l),d=[];let h=a;for(;h.getParent()!==e;)h=h.getParent(),d.push(h);if(o=a,a.isSpanHeaderHeight())for(let c=d.length-1;c>=0;c--){const u=d[c];if(!u.isPadding()){o=u;break}r++}else o=I(d),o||(o=a)}return{column:o,headerRowIndex:r,headerRowIndexWithoutSpan:n}}getHeaderRowType(e){const t=this.ctrlsService.getHeaderRowContainerCtrl();if(t)return t.getRowType(e)}findColAtEdgeForHeaderRow(e,t){const i=this.visibleColsService.getAllCols(),s=i[t==="start"?0:i.length-1];if(!s)return;const o=this.ctrlsService.getHeaderRowContainerCtrl(s.getPinned()),r=o==null?void 0:o.getRowType(e);if(r=="group"){const n=this.visibleColsService.getColGroupAtLevel(s,e);return{headerRowIndex:e,column:n}}return{headerRowIndex:r==null?-1:e,column:s}}},bC=class extends v{constructor(){super(...arguments),this.beanName="localeService"}getLocaleTextFunc(){const e=this.gos.getCallback("getLocaleText");if(e)return(i,s,o)=>e({key:i,defaultValue:s,variableValues:o});const t=this.gos.get("localeText");return(i,s,o)=>{let r=t&&t[i];if(r&&o&&o.length){let n=0;for(;!(n>=o.length||r.indexOf("${variable}")===-1);)r=r.replace("${variable}",o[n++])}return r??s}}},PC=class extends v{constructor(){super(...arguments),this.beanName="apiEventService",this.syncEventListeners=new Map,this.asyncEventListeners=new Map,this.syncGlobalEventListeners=new Set,this.globalEventListenerPairs=new Map}postConstruct(){this.frameworkEventWrappingService=new gs(this.getFrameworkOverrides())}addEventListener(e,t){const i=this.frameworkEventWrappingService.wrap(t),s=Jt(this.gos)&&!Et.has(e),o=s?this.asyncEventListeners:this.syncEventListeners;o.has(e)||o.set(e,new Set),o.get(e).add(i),this.eventService.addEventListener(e,i,s)}removeEventListener(e,t){var r;const i=this.frameworkEventWrappingService.unwrap(t),s=this.asyncEventListeners.get(e),o=!!(s!=null&&s.delete(i));o||(r=this.syncEventListeners.get(e))==null||r.delete(i),this.eventService.removeEventListener(e,i,o)}addGlobalListener(e){const t=this.frameworkEventWrappingService.wrapGlobal(e);if(Jt(this.gos)){const s=(r,n)=>{Et.has(r)&&t(r,n)},o=(r,n)=>{Et.has(r)||t(r,n)};this.globalEventListenerPairs.set(e,{syncListener:s,asyncListener:o}),this.eventService.addGlobalListener(s,!1),this.eventService.addGlobalListener(o,!0)}else this.syncGlobalEventListeners.add(t),this.eventService.addGlobalListener(t,!1)}removeGlobalListener(e){const t=this.frameworkEventWrappingService.unwrapGlobal(e);if(this.globalEventListenerPairs.has(t)){const{syncListener:s,asyncListener:o}=this.globalEventListenerPairs.get(t);this.eventService.removeGlobalListener(s,!1),this.eventService.removeGlobalListener(o,!0),this.globalEventListenerPairs.delete(e)}else this.syncGlobalEventListeners.delete(t),this.eventService.removeGlobalListener(t,!1)}destroyEventListeners(e,t){e.forEach((i,s)=>{i.forEach(o=>this.eventService.removeEventListener(s,o,t)),i.clear()}),e.clear()}destroyGlobalListeners(e,t){e.forEach(i=>this.eventService.removeGlobalListener(i,t)),e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncEventListeners,!1),this.destroyEventListeners(this.asyncEventListeners,!0),this.destroyGlobalListeners(this.syncGlobalEventListeners,!1),this.globalEventListenerPairs.forEach(({syncListener:e,asyncListener:t})=>{this.eventService.removeGlobalListener(e,!1),this.eventService.removeGlobalListener(t,!0)}),this.globalEventListenerPairs.clear()}},DC=class extends v{constructor(){super(...arguments),this.beanName="pageBoundsListener"}wireBeans(e){this.rowModel=e.rowModel,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService}postConstruct(){this.addManagedEventListeners({modelUpdated:this.onModelUpdated.bind(this),recalculateRowBounds:this.calculatePages.bind(this)}),this.onModelUpdated()}onModelUpdated(e){this.calculatePages(),this.eventService.dispatchEvent({type:"paginationChanged",animate:(e==null?void 0:e.animate)??!1,newData:(e==null?void 0:e.newData)??!1,newPage:(e==null?void 0:e.newPage)??!1,newPageSize:(e==null?void 0:e.newPageSize)??!1,keepRenderedRows:(e==null?void 0:e.keepRenderedRows)??!1})}calculatePages(){this.paginationService?this.paginationService.calculatePages():this.pageBoundsService.calculateBounds(0,this.rowModel.getRowCount()-1)}},EC=class extends v{constructor(){super(...arguments),this.beanName="pageBoundsService",this.pixelOffset=0}wireBeans(e){this.rowModel=e.rowModel}getFirstRow(){return this.topRowBounds?this.topRowBounds.rowIndex:-1}getLastRow(){return this.bottomRowBounds?this.bottomRowBounds.rowIndex:-1}getCurrentPageHeight(){return A(this.topRowBounds)||A(this.bottomRowBounds)?0:Math.max(this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight-this.topRowBounds.rowTop,0)}getCurrentPagePixelRange(){const e=this.topRowBounds?this.topRowBounds.rowTop:0,t=this.bottomRowBounds?this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight:0;return{pageFirstPixel:e,pageLastPixel:t}}calculateBounds(e,t){this.topRowBounds=this.rowModel.getRowBounds(e),this.topRowBounds&&(this.topRowBounds.rowIndex=e),this.bottomRowBounds=this.rowModel.getRowBounds(t),this.bottomRowBounds&&(this.bottomRowBounds.rowIndex=t),this.calculatePixelOffset()}getPixelOffset(){return this.pixelOffset}calculatePixelOffset(){const e=F(this.topRowBounds)?this.topRowBounds.rowTop:0;this.pixelOffset!==e&&(this.pixelOffset=e,this.eventService.dispatchEvent({type:"paginationPixelOffsetChanged"}))}},MC=class extends v{constructor(){super(),this.beanName="ariaAnnouncementService",this.descriptionContainer=null,this.pendingAnnouncements=new Map,this.updateAnnouncement=Y(this.updateAnnouncement.bind(this),200)}wireBeans(e){this.eGridDiv=e.eGridDiv}postConstruct(){const e=B(this.gos),t=this.descriptionContainer=e.createElement("div");t.classList.add("ag-aria-description-container"),qo(t,"polite"),xl(t,"additions text"),Ml(t,!0),this.eGridDiv.appendChild(t)}announceValue(e,t){this.pendingAnnouncements.set(t,e),this.updateAnnouncement()}updateAnnouncement(){if(!this.descriptionContainer)return;const e=Array.from(this.pendingAnnouncements.values()).join(". ");this.pendingAnnouncements.clear(),this.descriptionContainer.textContent="",setTimeout(()=>{this.isAlive()&&this.descriptionContainer&&(this.descriptionContainer.textContent=e)},50)}destroy(){super.destroy();const{descriptionContainer:e}=this;e&&(U(e),e.parentElement&&e.parentElement.removeChild(e)),this.descriptionContainer=null,this.eGridDiv=null,this.pendingAnnouncements.clear()}},xC=class extends v{constructor(){super(...arguments),this.beanName="columnAnimationService",this.executeNextFuncs=[],this.executeLaterFuncs=[],this.active=!1,this.activeNext=!1,this.suppressAnimation=!1,this.animationThreadCount=0}wireBeans(e){this.ctrlsService=e.ctrlsService}postConstruct(){this.ctrlsService.whenReady(this,e=>this.gridBodyCtrl=e.gridBodyCtrl)}isActive(){return this.active&&!this.suppressAnimation}setSuppressAnimation(e){this.suppressAnimation=e}start(){this.active||this.gos.get("suppressColumnMoveAnimation")||this.gos.get("enableRtl")||(this.ensureAnimationCssClassPresent(),this.active=!0,this.activeNext=!0)}finish(){this.active&&this.flush(()=>this.activeNext=!1,()=>this.active=!1)}executeNextVMTurn(e){this.activeNext?this.executeNextFuncs.push(e):e()}executeLaterVMTurn(e){this.active?this.executeLaterFuncs.push(e):e()}ensureAnimationCssClassPresent(){this.animationThreadCount++;const e=this.animationThreadCount;this.gridBodyCtrl.setColumnMovingCss(!0),this.executeLaterFuncs.push(()=>{this.animationThreadCount===e&&this.gridBodyCtrl.setColumnMovingCss(!1)})}flush(e,t){if(this.executeNextFuncs.length===0&&this.executeLaterFuncs.length===0){e(),t();return}const i=s=>{for(;s.length;){const o=s.pop();o&&o()}};this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>{e(),i(this.executeNextFuncs)},0),window.setTimeout(()=>{t(),i(this.executeLaterFuncs)},200)})}},AC=class extends v{constructor(){super(...arguments),this.beanName="columnHoverService"}setMouseOver(e){this.updateState(e)}clearMouseOver(){this.updateState(null)}isHovered(e){return!!this.selectedColumns&&this.selectedColumns.indexOf(e)>=0}updateState(e){this.selectedColumns=e,this.eventService.dispatchEvent({type:"columnHoverChanged"})}},TC=class extends v{constructor(){super(...arguments),this.beanName="overlayService",this.state=0,this.showInitialOverlay=!0,this.wrapperPadding=0}wireBeans(e){this.userComponentFactory=e.userComponentFactory,this.rowModel=e.rowModel,this.columnModel=e.columnModel,this.ctrlsService=e.ctrlsService}postConstruct(){this.isClientSide=N(this.gos);const e=()=>this.updateOverlayVisibility();this.addManagedEventListeners({newColumnsLoaded:e,rowDataUpdated:e,gridSizeChanged:this.onGridSizeChanged.bind(this),rowCountReady:()=>{this.showInitialOverlay=!1,this.updateOverlayVisibility()}}),this.addManagedPropertyListener("loading",e)}setOverlayWrapperComp(e){this.overlayWrapperComp=e,this.updateOverlayVisibility()}isVisible(){return this.state!==0&&!!this.overlayWrapperComp}isExclusive(){return this.state===1&&!!this.overlayWrapperComp}getOverlayWrapper(){return this.overlayWrapperComp}showLoadingOverlay(){this.showInitialOverlay=!1;const e=this.gos.get("loading");!e&&(e!==void 0||this.gos.get("suppressLoadingOverlay"))||this.doShowLoadingOverlay()}showNoRowsOverlay(){this.showInitialOverlay=!1,!(this.gos.get("loading")||this.gos.get("suppressNoRowsOverlay"))&&this.doShowNoRowsOverlay()}hideOverlay(){if(this.showInitialOverlay=!1,this.gos.get("loading")){S("Since v32, `api.hideOverlay()` does not hide the loading overlay when `loading=true`. Set `loading=false` instead.");return}this.doHideOverlay()}updateOverlayVisibility(){if(!this.overlayWrapperComp){this.state=0;return}let e=this.gos.get("loading");this.showInitialOverlay&&e===void 0&&!this.gos.get("suppressLoadingOverlay")&&(e=!this.gos.get("columnDefs")||!this.columnModel.isReady()||!this.gos.get("rowData")&&this.isClientSide),e?this.state!==1&&this.doShowLoadingOverlay():(this.showInitialOverlay=!1,this.rowModel.isEmpty()&&!this.gos.get("suppressNoRowsOverlay")&&this.isClientSide?this.state!==2&&this.doShowNoRowsOverlay():this.state!==0&&this.doHideOverlay())}doShowLoadingOverlay(){this.overlayWrapperComp&&(this.state=1,this.showOverlay(this.userComponentFactory.getLoadingOverlayCompDetails({}),"ag-overlay-loading-wrapper","loadingOverlayComponentParams"),this.updateExclusive())}doShowNoRowsOverlay(){this.overlayWrapperComp&&(this.state=2,this.showOverlay(this.userComponentFactory.getNoRowsOverlayCompDetails({}),"ag-overlay-no-rows-wrapper","noRowsOverlayComponentParams"),this.updateExclusive())}doHideOverlay(){this.overlayWrapperComp&&(this.state=0,this.overlayWrapperComp.hideOverlay(),this.updateExclusive())}showOverlay(e,t,i){var o;const s=e.newAgStackInstance();(o=this.overlayWrapperComp)==null||o.showOverlay(s,t,this.isExclusive(),i),this.refreshWrapperPadding()}updateExclusive(){const e=this.exclusive;this.exclusive=this.isExclusive(),this.exclusive!==e&&this.eventService.dispatchEvent({type:"overlayExclusiveChanged"})}onGridSizeChanged(){this.refreshWrapperPadding()}refreshWrapperPadding(){if(!this.overlayWrapperComp)return;let e=0;if(this.state===2){const t=this.ctrlsService.get("gridHeaderCtrl");e=(t==null?void 0:t.getHeaderHeight())||0}else this.wrapperPadding!==0&&(e=0);this.wrapperPadding!==e&&(this.wrapperPadding=e,this.overlayWrapperComp.updateOverlayWrapperPaddingTop(e))}},IC=class extends v{constructor(){super(...arguments),this.beanName="rowCssClassCalculator"}wireBeans(e){this.stylingService=e.stylingService}getInitialRowClasses(e){const t=[];return F(e.extraCssClass)&&t.push(e.extraCssClass),t.push("ag-row"),t.push(e.rowFocused?"ag-row-focus":"ag-row-no-focus"),e.fadeRowIn&&t.push("ag-opacity-zero"),t.push(e.rowIsEven?"ag-row-even":"ag-row-odd"),e.rowNode.isRowPinned()&&t.push("ag-row-pinned"),e.rowNode.isSelected()&&t.push("ag-row-selected"),e.rowNode.footer&&t.push("ag-row-footer"),t.push("ag-row-level-"+e.rowLevel),e.rowNode.stub&&t.push("ag-row-loading"),e.fullWidthRow&&t.push("ag-full-width-row"),e.expandable&&(t.push("ag-row-group"),t.push(e.rowNode.expanded?"ag-row-group-expanded":"ag-row-group-contracted")),e.rowNode.dragging&&t.push("ag-row-dragging"),Xs(t,this.processClassesFromGridOptions(e.rowNode)),Xs(t,this.preProcessRowClassRules(e.rowNode)),t.push(e.printLayout?"ag-row-position-relative":"ag-row-position-absolute"),e.firstRowOnPage&&t.push("ag-row-first"),e.lastRowOnPage&&t.push("ag-row-last"),e.fullWidthRow&&(e.pinned==="left"&&t.push("ag-cell-last-left-pinned"),e.pinned==="right"&&t.push("ag-cell-first-right-pinned")),t}processClassesFromGridOptions(e){const t=[],i=r=>{typeof r=="string"?t.push(r):Array.isArray(r)&&r.forEach(n=>t.push(n))},s=this.gos.get("rowClass");if(s){if(typeof s=="function")return S("rowClass should not be a function, please use getRowClass instead"),[];i(s)}const o=this.gos.getCallback("getRowClass");if(o){const r={data:e.data,node:e,rowIndex:e.rowIndex},n=o(r);i(n)}return t}preProcessRowClassRules(e){const t=[];return this.processRowClassRules(e,i=>{t.push(i)},()=>{}),t}processRowClassRules(e,t,i){const s=this.gos.addGridCommonParams({data:e.data,node:e,rowIndex:e.rowIndex});this.stylingService.processClassRules(void 0,this.gos.get("rowClassRules"),s,t,i)}calculateRowLevel(e){return e.group?e.level:e.parent?e.parent.level+1:0}},LC=class extends v{constructor(){super(...arguments),this.beanName="rowContainerHeightService",this.scrollY=0,this.uiBodyHeight=0}wireBeans(e){this.ctrlsService=e.ctrlsService}postConstruct(){this.addManagedEventListeners({bodyHeightChanged:this.updateOffset.bind(this)}),this.maxDivHeight=Bl(),this.gos.get("debug")&&ne("RowContainerHeightService - maxDivHeight = "+this.maxDivHeight)}isStretching(){return this.stretching}getDivStretchOffset(){return this.divStretchOffset}updateOffset(){if(!this.stretching)return;const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition().top,i=this.getUiBodyHeight();(t!==this.scrollY||i!==this.uiBodyHeight)&&(this.scrollY=t,this.uiBodyHeight=i,this.calculateOffset())}calculateOffset(){this.setUiContainerHeight(this.maxDivHeight),this.pixelsToShave=this.modelHeight-this.uiContainerHeight,this.maxScrollY=this.uiContainerHeight-this.uiBodyHeight;const e=this.scrollY/this.maxScrollY,t=e*this.pixelsToShave;this.gos.get("debug")&&ne(`RowContainerHeightService - Div Stretch Offset = ${t} (${this.pixelsToShave} * ${e})`),this.setDivStretchOffset(t)}setUiContainerHeight(e){e!==this.uiContainerHeight&&(this.uiContainerHeight=e,this.eventService.dispatchEvent({type:"rowContainerHeightChanged"}))}clearOffset(){this.setUiContainerHeight(this.modelHeight),this.pixelsToShave=0,this.setDivStretchOffset(0)}setDivStretchOffset(e){const t=typeof e=="number"?Math.floor(e):null;this.divStretchOffset!==t&&(this.divStretchOffset=t,this.eventService.dispatchEvent({type:"heightScaleChanged"}))}setModelHeight(e){this.modelHeight=e,this.stretching=e!=null&&this.maxDivHeight>0&&e>this.maxDivHeight,this.stretching?this.calculateOffset():this.clearOffset()}getUiContainerHeight(){return this.uiContainerHeight}getRealPixelPosition(e){return e-this.divStretchOffset}getUiBodyHeight(){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition();return t.bottom-t.top}getScrollPositionForPixel(e){if(this.pixelsToShave<=0)return e;const t=this.modelHeight-this.getUiBodyHeight(),i=e/t;return this.maxScrollY*i}},OC=class extends v{constructor(){super(...arguments),this.beanName="rowNodeSorter"}wireBeans(e){this.valueService=e.valueService,this.columnModel=e.columnModel,this.showRowGroupColsService=e.showRowGroupColsService}postConstruct(){this.isAccentedSort=this.gos.get("accentedSort"),this.primaryColumnsSortGroups=fe(this.gos),this.addManagedPropertyListener("accentedSort",e=>this.isAccentedSort=e.currentValue),this.addManagedPropertyListener("autoGroupColumnDef",()=>this.primaryColumnsSortGroups=fe(this.gos))}doFullSort(e,t){const i=(o,r)=>({currentPos:r,rowNode:o}),s=e.map(i);return s.sort(this.compareRowNodes.bind(this,t)),s.map(o=>o.rowNode)}compareRowNodes(e,t,i){const s=t.rowNode,o=i.rowNode;for(let r=0,n=e.length;r<n;r++){const l=e[r],a=l.sort==="desc",d=this.getValue(s,l.column),h=this.getValue(o,l.column);let c;const u=this.getComparator(l,s);if(u?c=u(d,h,s,o,a):c=Hn(d,h,this.isAccentedSort),!isNaN(c)&&c!==0)return l.sort==="asc"?c:c*-1}return t.currentPos-i.currentPos}getComparator(e,t){const i=e.column,s=i.getColDef().comparator;if(s!=null)return s;if(!i.getColDef().showRowGroup)return;const o=!t.group&&i.getColDef().field;if(!o)return;const r=this.columnModel.getColDefCol(o);if(r)return r.getColDef().comparator}getValue(e,t){var s,o,r;if(!this.primaryColumnsSortGroups)return this.valueService.getValue(t,e,!1,!1);if(e.rowGroupColumn===t){if(ui(this.gos,this.columnModel.isPivotActive())){const a=(s=e.allLeafChildren)==null?void 0:s[0];return a?this.valueService.getValue(t,a,!1,!1):void 0}const l=(o=this.showRowGroupColsService)==null?void 0:o.getShowRowGroupCol(t.getId());return l?(r=e.groupData)==null?void 0:r[l.getId()]:void 0}if(!(e.group&&t.getColDef().showRowGroup))return this.valueService.getValue(t,e,!1,!1)}},vi=class{constructor(e,t){this.active=!0,this.nodeIdsToColumns={},this.mapToItems={},this.keepingColumns=e,this.pathRoot={rowNode:t,children:null},this.mapToItems[t.id]=this.pathRoot}setInactive(){this.active=!1}isActive(){return this.active}depthFirstSearchChangedPath(e,t){if(e.children)for(let i=0;i<e.children.length;i++)this.depthFirstSearchChangedPath(e.children[i],t);t(e.rowNode)}depthFirstSearchEverything(e,t,i){if(e.childrenAfterGroup)for(let s=0;s<e.childrenAfterGroup.length;s++){const o=e.childrenAfterGroup[s];o.childrenAfterGroup?this.depthFirstSearchEverything(e.childrenAfterGroup[s],t,i):i&&t(o)}t(e)}forEachChangedNodeDepthFirst(e,t=!1,i=!1){this.active&&!i?this.depthFirstSearchChangedPath(this.pathRoot,e):this.depthFirstSearchEverything(this.pathRoot.rowNode,e,t)}executeFromRootNode(e){e(this.pathRoot.rowNode)}createPathItems(e){let t=e,i=0;for(;!this.mapToItems[t.id];){const s={rowNode:t,children:null};this.mapToItems[t.id]=s,i++,t=t.parent}return i}populateColumnsMap(e,t){if(!this.keepingColumns||!t)return;let i=e;for(;i;)this.nodeIdsToColumns[i.id]||(this.nodeIdsToColumns[i.id]={}),t.forEach(s=>this.nodeIdsToColumns[i.id][s.getId()]=!0),i=i.parent}linkPathItems(e,t){let i=e;for(let s=0;s<t;s++){const o=this.mapToItems[i.id],r=this.mapToItems[i.parent.id];r.children||(r.children=[]),r.children.push(o),i=i.parent}}addParentNode(e,t){if(!e||e.isRowPinned())return;const i=this.createPathItems(e);this.linkPathItems(e,i),this.populateColumnsMap(e,t)}canSkip(e){return this.active&&!this.mapToItems[e.id]}getValueColumnsForNode(e,t){if(!this.keepingColumns)return t;const i=this.nodeIdsToColumns[e.id];return t.filter(o=>i[o.getId()])}getNotValueColumnsForNode(e,t){if(!this.keepingColumns)return null;const i=this.nodeIdsToColumns[e.id];return t.filter(o=>!i[o.getId()])}},Rn=class extends v{constructor(){super(...arguments),this.beanName="selectionService",this.selectedNodes=new Map,this.selectionCtx=new ku,this.rowSelectionMode=void 0}wireBeans(e){this.rowModel=e.rowModel,this.pageBoundsService=e.pageBoundsService}postConstruct(){const{gos:e,rowModel:t,onRowSelected:i}=this;this.selectionCtx.init(t),this.rowSelectionMode=ei(e),this.groupSelectsChildren=Qe(e),this.addManagedPropertyListeners(["groupSelectsChildren","rowSelection"],()=>{const s=Qe(e),o=ei(e);(s!==this.groupSelectsChildren||o!==this.rowSelectionMode)&&(this.groupSelectsChildren=s,this.rowSelectionMode=o,this.deselectAllRowNodes({source:"api"}))}),this.addManagedEventListeners({rowSelected:i.bind(this)})}destroy(){super.destroy(),this.resetNodes(),this.selectionCtx.reset()}isMultiSelect(){return this.rowSelectionMode==="multiRow"}overrideSelectionValue(e,t){if(!wC(t))return e;const i=this.selectionCtx.getRoot();return i?i.isSelected()??!1:!0}setNodesSelected(e){var c;const{newValue:t,clearSelection:i,suppressFinishActions:s,rangeSelect:o,nodes:r,event:n,source:l}=e;if(r.length===0)return 0;if(r.length>1&&!this.isMultiSelect())return S("cannot multi select unless selection mode is 'multiRow'"),0;const a=this.groupSelectsChildren&&e.groupSelectsFiltered===!0,d=r.map(u=>u.footer?u.sibling:u);if(o){if(d.length>1)return S("cannot range select while selecting multiple rows"),0;const u=d[0],g=this.overrideSelectionValue(t,l);if(this.isMultiSelect()){if(this.selectionCtx.isInRange(u)){const p=this.selectionCtx.truncate(u);return g&&this.selectRange(p.discard,!1,l),this.selectRange(p.keep,g,l)}else if(this.selectionCtx.getRoot()!==u){const f=this.selectionCtx.extend(u,this.groupSelectsChildren);return g&&this.selectRange(f.discard,!1,l),this.selectRange(f.keep,g,l)}}}s||this.selectionCtx.setRoot(d[0]);let h=0;for(let u=0;u<d.length;u++){const g=d[u];a&&g.group||g.selectThisNode(t,n,l)&&h++,this.groupSelectsChildren&&((c=g.childrenAfterGroup)!=null&&c.length)&&(h+=this.selectChildren(g,t,a,l))}return s||(t&&(i||!this.isMultiSelect())&&(h+=this.clearOtherNodes(d[0],l)),h>0&&(this.updateGroupsFromChildrenSelections(l),this.dispatchSelectionChanged(l))),h}selectRange(e,t,i){let s=0;return e.forEach(o=>{if(o.group&&this.groupSelectsChildren)return;o.selectThisNode(t,void 0,i)&&s++}),s>0&&(this.updateGroupsFromChildrenSelections(i),this.dispatchSelectionChanged(i)),s}selectChildren(e,t,i,s){const o=i?e.childrenAfterAggFilter:e.childrenAfterGroup;return A(o)?0:this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,groupSelectsFiltered:i,source:s,nodes:o})}getSelectedNodes(){const e=[];return this.selectedNodes.forEach(t=>{t&&e.push(t)}),e}getSelectedRows(){const e=[];return this.selectedNodes.forEach(t=>{t&&t.data&&e.push(t.data)}),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach((i,s)=>{i&&e(i)&&t.set(s,i)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsChildren||!N(this.gos))return!1;const s=this.rowModel.getRootNode();t||(t=new vi(!0,s),t.setInactive());let o=!1;return t.forEachChangedNodeDepthFirst(r=>{if(r!==s){const n=r.calculateSelectedFromChildren();o=r.selectThisNode(n===null?!1:n,void 0,e)||o}}),o}clearOtherNodes(e,t){const i=new Map;let s=0;return this.selectedNodes.forEach(o=>{if(o&&o.id!==e.id){const r=this.selectedNodes.get(o.id);s+=r.setSelectedParams({newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:t}),this.groupSelectsChildren&&o.parent&&i.set(o.parent.id,o.parent)}}),i.forEach(o=>{const r=o.calculateSelectedFromChildren();o.selectThisNode(r===null?!1:r,void 0,t)}),s}onRowSelected(e){const t=e.node;this.groupSelectsChildren&&t.group||(t.isSelected()?this.selectedNodes.set(t.id,t):this.selectedNodes.delete(t.id))}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}syncInOldRowNode(e,t){if(F(t)&&e.id!==t.id&&t){const s=t.id;this.selectedNodes.get(s)==e&&this.selectedNodes.set(t.id,t)}}syncInNewRowNode(e){this.selectedNodes.has(e.id)?(e.setSelectedInitialValue(!0),this.selectedNodes.set(e.id,e)):e.setSelectedInitialValue(!1)}reset(e){const t=this.getSelectionCount();this.resetNodes(),t&&this.dispatchSelectionChanged(e)}resetNodes(){var e;(e=this.selectedNodes)==null||e.clear()}getBestCostNodeSelection(){if(!N(this.gos))return;const t=this.rowModel.getTopLevelNodes();if(t===null)return;const i=[];function s(o){for(let r=0,n=o.length;r<n;r++){const l=o[r];if(l.isSelected())i.push(l);else{const a=l;a.group&&a.children&&s(a.children)}}}return s(t),i}isEmpty(){let e=0;return this.selectedNodes.forEach(t=>{t&&e++}),e===0}deselectAllRowNodes(e){const t=n=>n.selectThisNode(!1,void 0,s),i=N(this.gos),{source:s,justFiltered:o,justCurrentPage:r}=e;if(r||o){if(!i){O("selecting just filtered only works when gridOptions.rowModelType='clientSide'");return}this.getNodesToSelect(o,r).forEach(t)}else this.selectedNodes.forEach(n=>{n&&t(n)}),this.reset(s);this.selectionCtx.reset(),i&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(s),this.dispatchSelectionChanged(s)}getSelectedCounts(e,t){let i=0,s=0;const o=r=>{this.groupSelectsChildren&&r.group||(r.isSelected()?i++:r.selectable&&s++)};return this.getNodesToSelect(e,t).forEach(o),{selectedCount:i,notSelectedCount:s}}getSelectAllState(e,t){const{selectedCount:i,notSelectedCount:s}=this.getSelectedCounts(e,t);return i===0&&s===0?!1:i>0&&s>0?null:i>0}hasNodesToSelect(e=!1,t=!1){return this.getNodesToSelect(e,t).filter(i=>i.selectable).length>0}getNodesToSelect(e=!1,t=!1){this.validateSelectAllType();const i=[];if(t)return this.forEachNodeOnPage(o=>{if(!o.group){i.push(o);return}if(!o.expanded){const r=n=>{var l;i.push(n),(l=n.childrenAfterFilter)!=null&&l.length&&n.childrenAfterFilter.forEach(r)};r(o);return}this.groupSelectsChildren||i.push(o)}),i;const s=this.rowModel;return e?(s.forEachNodeAfterFilter(o=>{i.push(o)}),i):(s.forEachNode(o=>{i.push(o)}),i)}forEachNodeOnPage(e){const t=this.pageBoundsService.getFirstRow(),i=this.pageBoundsService.getLastRow();for(let s=t;s<=i;s++){const o=this.rowModel.getRow(s);o&&e(o)}}selectAllRowNodes(e){if(Wn(this.gos)&&!hs(this.gos))return S("cannot multi select unless selection mode is 'multiRow'");this.validateSelectAllType();const{source:t,justFiltered:i,justCurrentPage:s}=e,o=this.getNodesToSelect(i,s);o.forEach(r=>r.selectThisNode(!0,void 0,t)),this.selectionCtx.setRoot(o[0]??null),this.selectionCtx.setEndRange(I(o)??null),N(this.gos)&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(t),this.dispatchSelectionChanged(t)}getSelectionState(){const e=[];return this.selectedNodes.forEach(t=>{t!=null&&t.id&&e.push(t.id)}),e.length?e:null}setSelectionState(e,t){if(!Array.isArray(e))return O("Invalid selection state. When using client-side row model, the state must conform to `string[]`.");const i=new Set(e),s=[];this.rowModel.forEachNode(o=>{i.has(o.id)&&s.push(o)}),this.setNodesSelected({newValue:!0,nodes:s,source:t})}dispatchSelectionChanged(e){this.eventService.dispatchEvent({type:"selectionChanged",source:e})}validateSelectAllType(){if(!N(this.gos))throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`)}},GC=class extends v{constructor(){super(...arguments),this.beanName="selectableService"}wireBeans(e){this.rowModel=e.rowModel,this.selectionService=e.selectionService}postConstruct(){this.addManagedPropertyListeners(["isRowSelectable","rowSelection"],()=>this.updateSelectable())}updateSelectableAfterGrouping(){this.updateSelectable(!0)}updateSelectable(e=!1){const{gos:t}=this,i=Xt(t),s=ds(t);if(!i||!s)return;const o=Qe(t),r=N(t)&&o,n=[],l=a=>{if(e&&!a.group)return;if(r&&a.group){const h=a.childrenAfterGroup.some(c=>c.selectable===!0);a.setRowSelectable(h,!0);return}const d=(s==null?void 0:s(a))??!0;a.setRowSelectable(d,!0),!d&&a.isSelected()&&n.push(a)};if(r){const a=this.rowModel;new vi(!1,a.getRootNode()).forEachChangedNodeDepthFirst(l,!0,!0)}else this.rowModel.forEachNode(l);n.length&&this.selectionService.setNodesSelected({nodes:n,newValue:!1,source:"selectableChanged"}),r&&this.selectionService instanceof Rn&&this.selectionService.updateGroupsFromChildrenSelections("selectableChanged")}},So=["asc","desc",null],kC=class extends v{constructor(){super(...arguments),this.beanName="sortController"}wireBeans(e){this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.showRowGroupColsService=e.showRowGroupColsService}progressSort(e,t,i){const s=this.getNextSortDirection(e);this.setSortForColumn(e,s,t,i)}setSortForColumn(e,t,i,s){t!=="asc"&&t!=="desc"&&(t=null);const o=fe(this.gos);let r=[e];if(o&&e.getColDef().showRowGroup){const a=this.funcColsService.getSourceColumnsForGroupColumn(e),d=a==null?void 0:a.filter(h=>h.isSortable());d&&(r=[e,...d])}r.forEach(a=>a.setSort(t,s));const n=(i||this.gos.get("alwaysMultiSort"))&&!this.gos.get("suppressMultiSort"),l=[];if(!n){const a=this.clearSortBarTheseColumns(r,s);l.push(...a)}this.updateSortIndex(e),l.push(...r),this.dispatchSortChangedEvents(s,l)}updateSortIndex(e){var l;const t=fe(this.gos),i=(l=this.showRowGroupColsService)==null?void 0:l.getShowRowGroupCol(e.getId()),s=t&&i||e,o=this.getColumnsWithSortingOrdered();this.columnModel.getAllCols().forEach(a=>a.setSortIndex(null));const r=o.filter(a=>t&&a.getColDef().showRowGroup?!1:a!==s);(s.getSort()?[...r,s]:r).forEach((a,d)=>{a.setSortIndex(d)})}onSortChanged(e,t){this.dispatchSortChangedEvents(e,t)}isSortActive(){const t=this.columnModel.getAllCols().filter(i=>!!i.getSort());return t&&t.length>0}dispatchSortChangedEvents(e,t){const i={type:"sortChanged",source:e};t&&(i.columns=t),this.eventService.dispatchEvent(i)}clearSortBarTheseColumns(e,t){const i=[];return this.columnModel.getAllCols().forEach(s=>{e.includes(s)||(s.getSort()&&i.push(s),s.setSort(void 0,t))}),i}getNextSortDirection(e){let t;if(e.getColDef().sortingOrder?t=e.getColDef().sortingOrder:this.gos.get("sortingOrder")?t=this.gos.get("sortingOrder"):t=So,!Array.isArray(t)||t.length<=0)return S(`sortingOrder must be an array with at least one element, currently it's ${t}`),null;const i=t.indexOf(e.getSort()),s=i<0,o=i==t.length-1;let r;return s||o?r=t[0]:r=t[i+1],So.indexOf(r)<0?(S("invalid sort type ",r),null):r}getIndexedSortMap(){let e=this.columnModel.getAllCols().filter(r=>!!r.getSort());if(this.columnModel.isPivotMode()){const r=fe(this.gos);e=e.filter(n=>{var h;const l=!!n.getAggFunc(),a=!n.isPrimary(),d=r?(h=this.showRowGroupColsService)==null?void 0:h.getShowRowGroupCol(n.getId()):n.getColDef().showRowGroup;return l||a||d})}const t=this.funcColsService.getRowGroupColumns().filter(r=>!!r.getSort()),i={};e.forEach((r,n)=>i[r.getId()]=n),e.sort((r,n)=>{const l=r.getSortIndex(),a=n.getSortIndex();if(l!=null&&a!=null)return l-a;if(l==null&&a==null){const d=i[r.getId()],h=i[n.getId()];return d>h?1:-1}else return a==null?-1:1});const s=fe(this.gos)&&!!t.length;s&&(e=[...new Set(e.map(r=>{var n;return((n=this.showRowGroupColsService)==null?void 0:n.getShowRowGroupCol(r.getId()))??r}))]);const o=new Map;return e.forEach((r,n)=>o.set(r,n)),s&&t.forEach(r=>{const n=this.showRowGroupColsService.getShowRowGroupCol(r.getId());o.set(r,o.get(n))}),o}getColumnsWithSortingOrdered(){return[...this.getIndexedSortMap().entries()].sort(([e,t],[i,s])=>t-s).map(([e])=>e)}getSortModel(){return this.getColumnsWithSortingOrdered().filter(e=>e.getSort()).map(e=>({sort:e.getSort(),colId:e.getId()}))}getSortOptions(){return this.getColumnsWithSortingOrdered().filter(e=>e.getSort()).map(e=>({sort:e.getSort(),column:e}))}canColumnDisplayMixedSort(e){const t=fe(this.gos),i=!!e.getColDef().showRowGroup;return t&&i}getDisplaySortForColumn(e){const t=this.funcColsService.getSourceColumnsForGroupColumn(e);if(!this.canColumnDisplayMixedSort(e)||!(t!=null&&t.length))return e.getSort();const s=e.getColDef().field!=null||!!e.getColDef().valueGetter?[e,...t]:t,o=s[0].getSort();return s.every(n=>n.getSort()==o)?o:"mixed"}getDisplaySortIndexForColumn(e){return this.getIndexedSortMap().get(e)}},HC=class extends v{constructor(){super(...arguments),this.beanName="syncService",this.waitingForColumns=!1}wireBeans(e){this.ctrlsService=e.ctrlsService,this.columnModel=e.columnModel,this.rowModel=e.rowModel}postConstruct(){this.addManagedPropertyListener("columnDefs",e=>this.setColumnDefs(e))}start(){this.ctrlsService.whenReady(this,()=>{const e=this.gos.get("columnDefs");e?this.setColumnsAndData(e):this.waitingForColumns=!0,this.gridReady()})}setColumnsAndData(e){this.columnModel.setColumnDefs(e??[],"gridInitializing"),this.rowModel.start()}gridReady(){this.eventService.dispatchEvent({type:"gridReady"});const e=this.gos.isModuleRegistered("@ag-grid-enterprise/core");this.gos.get("debug")&&ne(`initialised successfully, enterprise = ${e}`)}setColumnDefs(e){const t=this.gos.get("columnDefs");if(t){if(this.waitingForColumns){this.waitingForColumns=!1,this.setColumnsAndData(t);return}this.columnModel.setColumnDefs(t,We(e.source))}}},VC="paste",NC=class extends v{constructor(){super(...arguments),this.beanName="changeDetectionService"}wireBeans(e){this.rowModel=e.rowModel,this.rowRenderer=e.rowRenderer}postConstruct(){N(this.gos)&&(this.clientSideRowModel=this.rowModel),this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this)})}onCellValueChanged(e){e.source!==VC&&this.doChangeDetection(e.node,e.column)}doChangeDetection(e,t){if(this.gos.get("suppressChangeDetection"))return;const i=[e];if(this.clientSideRowModel&&!e.isRowPinned()){const s=this.gos.get("aggregateOnlyChangedColumns"),o=new vi(s,this.clientSideRowModel.getRootNode());o.addParentNode(e.parent,[t]),this.clientSideRowModel.doAggregate(o),o.forEachChangedNodeDepthFirst(r=>{i.push(r)})}this.rowRenderer.refreshCells({rowNodes:i})}},BC=class extends v{constructor(){super(...arguments),this.beanName="expressionService",this.expressionToFunctionCache={}}evaluate(e,t){if(typeof e=="string")return this.evaluateExpression(e,t);O("value should be either a string or a function",e)}evaluateExpression(e,t){try{return this.createExpressionFunction(e)(t.value,t.context,t.oldValue,t.newValue,t.value,t.node,t.data,t.colDef,t.rowIndex,t.api,t.getValue,t.column,t.columnGroup)}catch(i){return ne("Processing of the expression failed"),ne("Expression = ",e),ne("Params = ",t),ne("Exception = ",i),null}}createExpressionFunction(e){if(this.expressionToFunctionCache[e])return this.expressionToFunctionCache[e];const t=this.createFunctionBody(e),i=new Function("x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, getValue, column, columnGroup",t);return this.expressionToFunctionCache[e]=i,i}createFunctionBody(e){return e.indexOf("return")>=0?e:"return "+e+";"}},WC=class extends v{constructor(){super(...arguments),this.beanName="valueCache",this.cacheVersion=0}postConstruct(){this.active=this.gos.get("valueCache"),this.neverExpires=this.gos.get("valueCacheNeverExpires")}onDataChanged(){this.neverExpires||this.expire()}expire(){this.cacheVersion++}setValue(e,t,i){this.active&&(e.__cacheVersion!==this.cacheVersion&&(e.__cacheVersion=this.cacheVersion,e.__cacheData={}),e.__cacheData[t]=i)}getValue(e,t){if(!(!this.active||e.__cacheVersion!==this.cacheVersion))return e.__cacheData[t]}},zC=class extends v{constructor(){super(...arguments),this.beanName="valueService",this.initialised=!1,this.isSsrm=!1}wireBeans(e){this.expressionService=e.expressionService,this.columnModel=e.columnModel,this.valueCache=e.valueCache,this.dataTypeService=e.dataTypeService}postConstruct(){this.initialised||this.init()}init(){this.isSsrm=De(this.gos),this.cellExpressions=this.gos.get("enableCellExpressions"),this.isTreeData=this.gos.get("treeData"),this.initialised=!0;const e=i=>this.callColumnCellValueChangedHandler(i),t=Jt(this.gos);this.eventService.addEventListener("cellValueChanged",e,t),this.addDestroyFunc(()=>this.eventService.removeEventListener("cellValueChanged",e,t)),this.addManagedPropertyListener("treeData",i=>this.isTreeData=i.currentValue)}getValueForDisplay(e,t){const i=t.leafGroup&&this.columnModel.isPivotMode(),s=t.group&&t.expanded&&!t.footer&&!i,o=this.gos.get("groupSuppressBlankHeader");if(!s||o)return this.getValue(e,t);let r=!1;const n=this.gos.get("groupTotalRow")??this.gos.get("groupIncludeFooter");typeof n!="function"?r=!!n:r=!!(this.gos.getCallback("groupTotalRow")??this.gos.getCallback("groupIncludeFooter"))({node:this});const l=s&&r;return this.getValue(e,t,!1,l)}getValue(e,t,i=!1,s=!1){if(this.initialised||this.init(),!t)return;const o=e.getColDef(),r=o.field,n=e.getColId(),l=t.data;let a;const d=t.groupData&&t.groupData[n]!==void 0,h=!s&&t.aggData&&t.aggData[n]!==void 0,c=this.isSsrm&&s&&!!e.getColDef().aggFunc,u=this.isSsrm&&t.footer&&t.field&&(e.getColDef().showRowGroup===!0||e.getColDef().showRowGroup===t.field);if(i&&o.filterValueGetter?a=this.executeFilterValueGetter(o.filterValueGetter,l,e,t):this.isTreeData&&h?a=t.aggData[n]:this.isTreeData&&o.valueGetter?a=this.executeValueGetter(o.valueGetter,l,e,t):this.isTreeData&&r&&l?a=Rt(l,r,e.isFieldContainsDots()):d?a=t.groupData[n]:h?a=t.aggData[n]:o.valueGetter?a=this.executeValueGetter(o.valueGetter,l,e,t):u?a=Rt(l,t.field,e.isFieldContainsDots()):r&&l&&!c&&(a=Rt(l,r,e.isFieldContainsDots())),this.cellExpressions&&typeof a=="string"&&a.indexOf("=")===0){const g=a.substring(1);a=this.executeValueGetter(g,l,e,t)}if(a==null){const g=this.getOpenedGroup(t,e);if(g!=null)return g}return a}parseValue(e,t,i,s){const o=e.getColDef(),r=o.valueParser;if(F(r)){const n=this.gos.addGridCommonParams({node:t,data:t==null?void 0:t.data,oldValue:s,newValue:i,colDef:o,column:e});return typeof r=="function"?r(n):this.expressionService.evaluate(r,n)}return i}getDeleteValue(e,t){return F(e.getColDef().valueParser)?this.parseValue(e,t,"",this.getValueForDisplay(e,t))??null:null}formatValue(e,t,i,s,o=!0){let r=null,n;const l=e.getColDef();if(s?n=s:o&&(n=l.valueFormatter),n){const a=this.gos.addGridCommonParams({value:i,node:t,data:t?t.data:null,colDef:l,column:e});typeof n=="function"?r=n(a):r=this.expressionService.evaluate(n,a)}else if(l.refData)return l.refData[i]||"";return r==null&&Array.isArray(i)&&(r=i.join(", ")),r}getOpenedGroup(e,t){if(!this.gos.get("showOpenedGroup")||!t.getColDef().showRowGroup)return;const s=t.getColDef().showRowGroup;let o=e.parent;for(;o!=null;){if(o.rowGroupColumn&&(s===!0||s===o.rowGroupColumn.getColId()))return o.key;o=o.parent}}setValue(e,t,i,s){const o=this.columnModel.getColDefCol(t);if(!e||!o)return!1;A(e.data)&&(e.data={});const{field:r,valueSetter:n}=o.getColDef();if(A(r)&&A(n))return S("you need either field or valueSetter set on colDef for editing to work"),!1;if(this.dataTypeService&&!this.dataTypeService.checkType(o,i))return S("Data type of the new value does not match the cell data type of the column"),!1;const l=this.gos.addGridCommonParams({node:e,data:e.data,oldValue:this.getValue(o,e),newValue:i,colDef:o.getColDef(),column:o});l.newValue=i;let a;if(F(n)?typeof n=="function"?a=n(l):a=this.expressionService.evaluate(n,l):a=this.setValueUsingField(e.data,r,i,o.isFieldContainsDots()),a===void 0&&(a=!0),!a)return!1;e.resetQuickFilterAggregateText(),this.valueCache.onDataChanged();const d=this.getValue(o,e);return this.eventService.dispatchEvent({type:"cellValueChanged",event:null,rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:l.column,colDef:l.colDef,data:e.data,node:e,oldValue:l.oldValue,newValue:d,value:d,source:s}),!0}callColumnCellValueChangedHandler(e){const t=e.colDef.onCellValueChanged;typeof t=="function"&&this.getFrameworkOverrides().wrapOutgoing(()=>{t({node:e.node,data:e.data,oldValue:e.oldValue,newValue:e.newValue,colDef:e.colDef,column:e.column,api:e.api,context:e.context})})}setValueUsingField(e,t,i,s){if(!t)return!1;let o=!1;if(!s)o=e[t]===i,o||(e[t]=i);else{const r=t.split(".");let n=e;for(;r.length>0&&n;){const l=r.shift();r.length===0?(o=n[l]===i,o||(n[l]=i)):n=n[l]}}return!o}executeFilterValueGetter(e,t,i,s){const o=this.gos.addGridCommonParams({data:t,node:s,column:i,colDef:i.getColDef(),getValue:this.getValueCallback.bind(this,s)});return typeof e=="function"?e(o):this.expressionService.evaluate(e,o)}executeValueGetter(e,t,i,s){const o=i.getColId(),r=this.valueCache.getValue(s,o);if(r!==void 0)return r;const n=this.gos.addGridCommonParams({data:t,node:s,column:i,colDef:i.getColDef(),getValue:this.getValueCallback.bind(this,s)});let l;return typeof e=="function"?l=e(n):l=this.expressionService.evaluate(e,n),this.valueCache.setValue(s,o,l),l}getValueCallback(e,t){const i=this.columnModel.getColDefCol(t);return i?this.getValue(i,e):null}getKeyForNode(e,t){const i=this.getValue(e,t),s=e.getColDef().keyCreator;let o=i;if(s){const r=this.gos.addGridCommonParams({value:i,colDef:e.getColDef(),column:e,node:t,data:t.data});o=s(r)}return typeof o=="string"||o==null||(o=String(o),o==="[object Object]"&&S("a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (se AG Grid docs) or b) to toString() on the object to return a key")),o}},Bs=class Be{static applyGlobalGridOptions(t){if(!Be.gridOptions)return t;let i={};return q(i,Be.gridOptions,!0,!0),Be.mergeStrategy==="deep"?q(i,t,!0,!0):i={...i,...t},Be.gridOptions.context&&(i.context=Be.gridOptions.context),t.context&&(Be.mergeStrategy==="deep"&&i.context&&q(t.context,i.context,!0,!0),i.context=t.context),i}};Bs.gridOptions=void 0;Bs.mergeStrategy="shallow";var _C=Bs;function UC(e,t,i){if(!t)return O("No gridOptions provided to createGrid"),{};const s=new $C().create(e,t,o=>{const r=new fg(e);o.createBean(r)},void 0,i);if(!Object.isFrozen(t)&&!(i!=null&&i.frameworkOverrides)){const o="https://ag-grid.com/javascript-data-grid/grid-interface/#grid-api";Object.defineProperty(t,"api",{get:()=>{O(`gridOptions.api is no longer supported. See ${o}.`)},configurable:!0})}return s}var KC=1,$C=class{create(e,t,i,s,o){const r=_C.applyGlobalGridOptions(t),n=yC(r),l=n.gridId??String(KC++),a=this.getRegisteredModules(o,l),d=this.createBeansList(n.rowModelType,a,l),h=this.createProvidedBeans(e,n,o);if(!d){O("Failed to create grid.");return}const c={providedBeanInstances:h,beanClasses:d,gridId:l,beanInitComparator:ig,beanDestroyComparator:sg,derivedBeans:[ju]},u=new Wa(c);return this.registerModuleUserComponents(u,a),this.registerControllers(u,a),this.registerModuleApiFunctions(u,a),i(u),u.getBean("syncService").start(),s&&s(u),u.getBean("gridApi")}registerControllers(e,t){const i=e.getBean("ctrlsFactory");t.forEach(s=>{s.controllers&&s.controllers.forEach(o=>i.register(o))})}getRegisteredModules(e,t){const i=e?e.modules:null,s=ye.__getRegisteredModules(t),o=[],r={},n=(l,a,d)=>{(c=>{r[c.moduleName]||(r[c.moduleName]=!0,o.push(c),ye.__register(c,l,d))})(a),a.dependantModules&&a.dependantModules.forEach(c=>n(l,c,d))};return n(!!(i!=null&&i.length)||!ye.__isPackageBased(),vn,void 0),i&&i.forEach(l=>n(!0,l,t)),s&&s.forEach(l=>n(!ye.__isPackageBased(),l,void 0)),o}registerModuleUserComponents(e,t){const i=this.extractModuleEntity(t,o=>o.userComponents?o.userComponents:[]),s=e.getBean("userComponentRegistry");i.forEach(({name:o,classImp:r,params:n})=>{s.registerDefaultComponent(o,r,n)})}registerModuleApiFunctions(e,t){const i=e.getBean("apiFunctionService");t.forEach(s=>{const o=s.apiFunctions;o&&Object.keys(o).forEach(n=>{i==null||i.addFunction(n,o[n])})})}createProvidedBeans(e,t,i){let s=i?i.frameworkOverrides:null;A(s)&&(s=new hn);const o={gridOptions:t,eGridDiv:e,globalEventListener:i?i.globalEventListener:null,globalSyncEventListener:i?i.globalSyncEventListener:null,frameworkOverrides:s};return i&&i.providedBeanInstances&&Object.assign(o,i.providedBeanInstances),o}createBeansList(e="clientSide",t,i){const s=t.filter(a=>!a.rowModel||a.rowModel===e),o={clientSide:"@ag-grid-community/client-side-row-model",infinite:"@ag-grid-community/infinite-row-model",serverSide:"@ag-grid-enterprise/server-side-row-model",viewport:"@ag-grid-enterprise/viewport-row-model"};if(!o[e]){O("Could not find row model for rowModelType = ",e);return}if(!ye.__assertRegistered(o[e],`rowModelType = '${e}'`,i))return;const r=[ag,ng,FC,vC,$u,ya,Zu,eg,Wc,mr,LC,Nc,bC,Iu,Ka,Sl,cg,RC,zu,Rn,al,nh,EC,DC,Au,BC,ll,Vc,WC,zC,Mu,Bc,za,ug,Hc,dg,Uu,Hu,kc,kC,AC,xC,GC,NC,zc,qu,IC,OC,rg,gg,lg,og,HC,TC,_c,PC,MC,Uc,cl,Yu,ul,dl,Qu,Xu,wl,hl,ml,Ju,vl,il],n=this.extractModuleEntity(s,a=>a.beans?a.beans:[]);r.push(...n);const l=[];return r.forEach(a=>{l.indexOf(a)<0&&l.push(a)}),l}extractModuleEntity(e,t){return[].concat(...e.map(t))}},Fn=class extends v{constructor(){super(...arguments),this.beanName="rowModelHelperService"}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){const e=this.rowModel;switch(e.getType()){case"clientSide":this.clientSideRowModel=e;break;case"infinite":this.infiniteRowModel=e;break;case"serverSide":this.serverSideRowModel=e;break}}getClientSideRowModel(){return this.clientSideRowModel}getInfiniteRowModel(){return this.infiniteRowModel}getServerSideRowModel(){return this.serverSideRowModel}};function jC(e){e.expansionService.expandAll(!0)}function qC(e){e.expansionService.expandAll(!1)}function YC(e){var s,o;const t=(s=e.rowModelHelperService)==null?void 0:s.getClientSideRowModel(),i=(o=e.rowModelHelperService)==null?void 0:o.getServerSideRowModel();t?t.onRowHeightChanged():i&&i.onRowHeightChanged()}function QC(e,t,i){var r,n;const s=(r=e.rowModelHelperService)==null?void 0:r.getServerSideRowModel();if(s){if(e.funcColsService.isRowGroupEmpty()){s.setRowCount(t,i);return}O("setRowCount cannot be used while using row grouping.");return}const o=(n=e.rowModelHelperService)==null?void 0:n.getInfiniteRowModel();if(o){o.setRowCount(t,i);return}}function XC(e){var t;return((t=e.rowNodeBlockLoader)==null?void 0:t.getBlockState())??{}}function JC(e){return e.rowModel.isLastRowIndexKnown()}var ZC={version:x,moduleName:"@ag-grid-community/csrm-ssrm-shared-api",apiFunctions:{expandAll:jC,collapseAll:qC,onRowHeightChanged:YC}},em={version:x,moduleName:"@ag-grid-community/ssrm-infinite-shared-api",apiFunctions:{setRowCount:QC,getCacheBlockState:XC,isLastRowIndexKnown:JC}},tm=class{wrap(e,t,i=[],s){const o=this.createWrapper(e,s);return t.forEach(r=>{this.createMethod(o,r,!0)}),i.forEach(r=>{this.createMethod(o,r,!1)}),o}createMethod(e,t,i){e.addMethod(t,this.createMethodProxy(e,t,i))}createMethodProxy(e,t,i){return function(){return e.hasMethod(t)?e.callMethod(t,arguments):(i&&S("Framework component is missing the method "+t+"()"),null)}}},ft=typeof global>"u"?{}:global;ft.HTMLElement=typeof HTMLElement>"u"?{}:HTMLElement;ft.HTMLButtonElement=typeof HTMLButtonElement>"u"?{}:HTMLButtonElement;ft.HTMLSelectElement=typeof HTMLSelectElement>"u"?{}:HTMLSelectElement;ft.HTMLInputElement=typeof HTMLInputElement>"u"?{}:HTMLInputElement;ft.Node=typeof Node>"u"?{}:Node;ft.MouseEvent=typeof MouseEvent>"u"?{}:MouseEvent;var im="ROOT_NODE_ID",Gi=0,sm=class{constructor(e,t,i,s,o,r){this.nextId=0,this.rowCountReady=!1,this.allNodesMap={},this.rootNode=e,this.gos=t,this.eventService=i,this.funcColsService=s,this.beans=r,this.selectionService=o,this.rootNode.group=!0,this.rootNode.level=-1,this.rootNode.id=im,this.rootNode.allLeafChildren=[],this.rootNode.childrenAfterGroup=[],this.rootNode.childrenAfterSort=[],this.rootNode.childrenAfterAggFilter=[],this.rootNode.childrenAfterFilter=[]}getCopyOfNodesMap(){return Bo(this.allNodesMap)}getRowNode(e){return this.allNodesMap[e]}setRowData(e){if(typeof e=="string"){S("rowData must be an array.");return}this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(e);const t=this.rootNode,i=this.rootNode.sibling;t.childrenAfterFilter=null,t.childrenAfterGroup=null,t.childrenAfterAggFilter=null,t.childrenAfterSort=null,t.childrenMapped=null,t.updateHasChildren(),this.nextId=0,this.allNodesMap={},e?t.allLeafChildren=e.map((s,o)=>this.createNode(s,this.rootNode,Gi,o)):(t.allLeafChildren=[],t.childrenAfterGroup=[]),i&&(i.childrenAfterFilter=t.childrenAfterFilter,i.childrenAfterGroup=t.childrenAfterGroup,i.childrenAfterAggFilter=t.childrenAfterAggFilter,i.childrenAfterSort=t.childrenAfterSort,i.childrenMapped=t.childrenMapped,i.allLeafChildren=t.allLeafChildren)}updateRowData(e){this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(e.add);const t={rowNodeTransaction:{remove:[],update:[],add:[]},rowsInserted:!1},i=[];return this.executeRemove(e,t,i),this.executeUpdate(e,t,i),this.executeAdd(e,t),this.updateSelection(i,"rowDataChanged"),t}updateRowOrderFromRowData(e){const t=this.rootNode.allLeafChildren,i=(t==null?void 0:t.length)??0,s=new Map;let o=-1,r=-1;for(let n=0;n<i;++n){const l=t[n],a=l.data;a!==e[n]&&(r<0&&(o=n),r=n,s.set(a,l))}if(o<0)return!1;for(let n=o;n<=r;++n){const l=s.get(e[n]);l!==void 0&&(t[n]=l,l.sourceRowIndex=n)}return!0}isRowCountReady(){return this.rowCountReady}dispatchRowDataUpdateStartedEvent(e){this.eventService.dispatchEvent({type:"rowDataUpdateStarted",firstRowData:e!=null&&e.length?e[0]:null})}updateSelection(e,t){const i=e.length>0;i&&this.selectionService.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t}),this.selectionService.updateGroupsFromChildrenSelections(t),i&&this.eventService.dispatchEvent({type:"selectionChanged",source:t})}executeAdd(e,t){const i=e.add;if(se(i))return;const s=this.rootNode.allLeafChildren;let o=s.length;if(typeof e.addIndex=="number"&&(o=this.sanitizeAddIndex(e.addIndex),o>0&&this.gos.get("treeData")))for(let a=0;a<s.length;a++){const d=s[a];if((d==null?void 0:d.rowIndex)==o-1){o=a+1;break}}const r=i.map((l,a)=>this.createNode(l,this.rootNode,Gi,o+a));if(o<s.length){const l=s.slice(0,o),a=s.slice(o,s.length),d=l.length+r.length;for(let h=0,c=a.length;h<c;++h)a[h].sourceRowIndex=d+h;this.rootNode.allLeafChildren=[...l,...r,...a],t.rowsInserted=!0}else this.rootNode.allLeafChildren=s.concat(r);const n=this.rootNode.sibling;n&&(n.allLeafChildren=s),t.rowNodeTransaction.add=r}sanitizeAddIndex(e){var i;const t=((i=this.rootNode.allLeafChildren)==null?void 0:i.length)??0;return e<0||e>=t||Number.isNaN(e)?t:Math.ceil(e)}executeRemove(e,{rowNodeTransaction:t},i){var n,l;const{remove:s}=e;if(se(s))return;const o={};s.forEach(a=>{const d=this.lookupRowNode(a);d&&(d.isSelected()&&i.push(d),d.clearRowTopAndRowIndex(),o[d.id]=!0,delete this.allNodesMap[d.id],t.remove.push(d))}),this.rootNode.allLeafChildren=((n=this.rootNode.allLeafChildren)==null?void 0:n.filter(a=>!o[a.id]))??null,(l=this.rootNode.allLeafChildren)==null||l.forEach((a,d)=>{a.sourceRowIndex=d});const r=this.rootNode.sibling;r&&(r.allLeafChildren=this.rootNode.allLeafChildren)}executeUpdate(e,{rowNodeTransaction:t},i){const{update:s}=e;se(s)||s.forEach(o=>{const r=this.lookupRowNode(o);r&&(r.updateData(o),!r.selectable&&r.isSelected()&&i.push(r),this.setMasterForRow(r,o,Gi,!1),t.update.push(r))})}lookupRowNode(e){var s;const t=ut(this.gos);let i;if(t){const o=t({data:e,level:0});if(i=this.allNodesMap[o],!i)return O(`could not find row id=${o}, data item was not found for this id`),null}else if(i=(s=this.rootNode.allLeafChildren)==null?void 0:s.find(o=>o.data===e),!i)return O("could not find data item as object was not found",e),O("Consider using getRowId to help the Grid find matching row data"),null;return i||null}createNode(e,t,i,s){const o=new be(this.beans);return o.sourceRowIndex=s,o.group=!1,this.setMasterForRow(o,e,i,!0),t&&(o.parent=t),o.level=i,o.setDataAndId(e,this.nextId.toString()),this.allNodesMap[o.id]&&S(`duplicate node id '${o.id}' detected from getRowId callback, this could cause issues in your grid.`),this.allNodesMap[o.id]=o,this.nextId++,o}setMasterForRow(e,t,i,s){if(this.gos.get("treeData"))e.setMaster(!1),s&&(e.expanded=!1);else{if(this.gos.get("masterDetail")){const n=this.gos.get("isRowMaster");n?e.setMaster(n(t)):e.setMaster(!0)}else e.setMaster(!1);if(s){const n=this.funcColsService.getRowGroupColumns(),l=n?n.length:0,a=i+l;e.expanded=e.master?this.isExpanded(a):!1}}}isExpanded(e){const t=this.gos.get("groupDefaultExpanded");return t===-1?!0:e<t}},om=class extends v{constructor(){super(...arguments),this.beanName="rowModel",this.onRowHeightChanged_debounced=Y(this.onRowHeightChanged.bind(this),100),this.rowsToDisplay=[],this.hasStarted=!1,this.shouldSkipSettingDataOnStart=!1,this.isRefreshingModel=!1,this.rowCountReady=!1}wireBeans(e){this.beans=e,this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.selectionService=e.selectionService,this.valueCache=e.valueCache,this.environment=e.environment,this.filterStage=e.filterStage,this.sortStage=e.sortStage,this.flattenStage=e.flattenStage,this.groupStage=e.groupStage,this.aggregationStage=e.aggregationStage,this.pivotStage=e.pivotStage,this.filterAggregatesStage=e.filterAggregatesStage}postConstruct(){const e=this.refreshModel.bind(this,{step:"group"}),t=!this.gos.get("suppressAnimationFrame"),i=this.refreshModel.bind(this,{step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:t});this.addManagedEventListeners({newColumnsLoaded:i,columnRowGroupChanged:e,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:this.refreshModel.bind(this,{step:"pivot"}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),columnPivotModeChanged:e,gridStylesChanged:this.onGridStylesChanges.bind(this),gridReady:this.onGridReady.bind(this)}),this.addPropertyListeners(),this.rootNode=new be(this.beans),this.nodeManager=new sm(this.rootNode,this.gos,this.eventService,this.funcColsService,this.selectionService,this.beans)}addPropertyListeners(){const e=new Set(["treeData","masterDetail"]),t=new Set(["groupDefaultExpanded","groupAllowUnbalanced","initialGroupOrderComparator","groupHideOpenParents","groupDisplayType"]),i=new Set(["excludeChildrenWhenTreeDataFiltering"]),s=new Set(["removePivotHeaderRowWhenSingleValueColumn","pivotRowTotals","pivotColumnGroupTotals","suppressExpandablePivotGroups"]),o=new Set(["getGroupRowAgg","alwaysAggregateAtRootLevel","groupIncludeTotalFooter","suppressAggFilteredOnly","grandTotalRow"]),r=new Set(["postSortRows","groupDisplayType","accentedSort"]),n=new Set([]),l=new Set(["groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupIncludeFooter","groupTotalRow"]),a=[...e,...t,...i,...s,...s,...o,...r,...n,...l];this.addManagedPropertyListeners(a,d=>{var u;const h=(u=d.changeSet)==null?void 0:u.properties;if(!h)return;const c=g=>h.some(p=>g.has(p));if(c(e)){this.setRowData(this.rootNode.allLeafChildren.map(g=>g.data));return}if(c(t)){this.refreshModel({step:"group"});return}if(c(i)){this.refreshModel({step:"filter"});return}if(c(s)){this.refreshModel({step:"pivot"});return}if(c(o)){this.refreshModel({step:"aggregate"});return}if(c(r)){this.refreshModel({step:"sort"});return}if(c(n)){this.refreshModel({step:"filter_aggregates"});return}c(l)&&this.refreshModel({step:"map"})}),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){this.hasStarted=!0,this.shouldSkipSettingDataOnStart?this.dispatchUpdateEventsAndRefresh():this.setInitialData()}setInitialData(){const e=this.gos.get("rowData");e&&(this.shouldSkipSettingDataOnStart=!0,this.setRowData(e))}ensureRowHeightsValid(e,t,i,s){let o,r=!1;do{o=!1;const n=this.getRowIndexAtPixel(e),l=this.getRowIndexAtPixel(t),a=Math.max(n,i),d=Math.min(l,s);for(let h=a;h<=d;h++){const c=this.getRow(h);if(c.rowHeightEstimated){const u=Le(this.gos,c);c.setRowHeight(u.height),o=!0,r=!0}}o&&this.setRowTopAndRowIndex()}while(o);return r}setRowTopAndRowIndex(){const e=this.environment.getDefaultRowHeight();let t=0;const i=new Set,s=z(this.gos,"normal");for(let o=0;o<this.rowsToDisplay.length;o++){const r=this.rowsToDisplay[o];if(r.id!=null&&i.add(r.id),r.rowHeight==null){const n=Le(this.gos,r,s,e);r.setRowHeight(n.height,n.estimated)}r.setRowTop(t),r.setRowIndex(o),t+=r.rowHeight}return i}clearRowTopAndRowIndex(e,t){const i=e.isActive(),s=r=>{r&&r.id!=null&&!t.has(r.id)&&r.clearRowTopAndRowIndex()},o=r=>{if(s(r),s(r.detailNode),s(r.sibling),r.hasChildren()&&r.childrenAfterGroup){const n=r.level==-1;i&&!n&&!r.expanded||r.childrenAfterGroup.forEach(o)}};o(this.rootNode)}ensureRowsAtPixel(e,t,i=0){const s=this.getRowIndexAtPixel(t),o=this.getRow(s),r=!this.gos.get("suppressAnimationFrame");if(o===e[0])return!1;const n=this.rootNode.allLeafChildren;return e.forEach(l=>{Q(n,l)}),e.forEach((l,a)=>{ti(n,l,Math.max(s+i,0)+a)}),e.forEach((l,a)=>{l.sourceRowIndex=a}),this.refreshModel({step:"group",keepRenderedRows:!0,keepEditingRows:!0,animate:r,rowNodesOrderChanged:!0}),!0}highlightRowAtPixel(e,t){const i=t!=null?this.getRowIndexAtPixel(t):null,s=i!=null?this.getRow(i):null;if(!s||!e||t==null){this.clearHighlightedRow();return}const o=this.getHighlightPosition(t,s),r=this.isHighlightingCurrentPosition(e,s,o),n=this.lastHighlightedRow!=null&&this.lastHighlightedRow!==s;(r||n)&&(this.clearHighlightedRow(),r)||(s.setHighlighted(o),this.lastHighlightedRow=s)}getHighlightPosition(e,t){if(!t){const o=this.getRowIndexAtPixel(e);if(t=this.getRow(o||0),!t)return 1}const{rowTop:i,rowHeight:s}=t;return e-i<s/2?0:1}getLastHighlightedRowNode(){return this.lastHighlightedRow}isHighlightingCurrentPosition(e,t,i){if(e===t)return!0;const s=i===0?-1:1;return this.getRow(t.rowIndex+s)===e}clearHighlightedRow(){this.lastHighlightedRow&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null)}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay?this.rowsToDisplay.length:0}getTopLevelRowCount(){if(this.rowsToDisplay.length===0)return 0;if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return 1;const t=this.rootNode.childrenAfterAggFilter,i=this.rootNode.sibling?1:0;return(t?t.length:0)+i}getTopLevelRowDisplayedIndex(e){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return e;let i=e;if(this.rowsToDisplay[0].footer){if(e===0)return 0;i-=1}const s=this.rowsToDisplay[this.rowsToDisplay.length-1],o=i>=this.rootNode.childrenAfterSort.length;if(s.footer&&o)return s.rowIndex;let r=this.rootNode.childrenAfterSort[i];if(this.gos.get("groupHideOpenParents"))for(;r.expanded&&r.childrenAfterSort&&r.childrenAfterSort.length>0;)r=r.childrenAfterSort[0];return r.rowIndex}getRowBounds(e){if(A(this.rowsToDisplay))return null;const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){const e=ot(this.gos);this.refreshModel({step:"map",keepRenderedRows:!0,animate:e})}onFilterChanged(e){if(e.afterDataChange)return;const t=ot(this.gos),s=e.columns.length===0||e.columns.some(o=>o.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:s,keepRenderedRows:!0,animate:t})}onSortChanged(){const e=ot(this.gos);this.refreshModel({step:"sort",keepRenderedRows:!0,animate:e,keepEditingRows:!0})}getType(){return"clientSide"}onValueChanged(){this.columnModel.isPivotActive()?this.refreshModel({step:"pivot"}):this.refreshModel({step:"aggregate"})}createChangePath(e){const t=se(e),i=new vi(!1,this.rootNode);return t&&i.setInactive(),i}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction")||e.rowNodeTransactions==null)return!1;const t=e.rowNodeTransactions.filter(s=>s.add!=null&&s.add.length>0||s.remove!=null&&s.remove.length>0);return t==null||t.length==0}buildRefreshModelParams(e){let t="group";const i={everything:"group",group:"group",filter:"filter",map:"map",aggregate:"aggregate",filter_aggregates:"filter_aggregates",sort:"sort",pivot:"pivot",nothing:"nothing"};if(F(e)&&(t=i[e]),A(t)){O(`invalid step ${e}, available steps are ${Object.keys(i).join(", ")}`);return}const s=!this.gos.get("suppressAnimationFrame");return{step:t,keepRenderedRows:!0,keepEditingRows:!0,animate:s}}refreshModel(e){if(!this.hasStarted||this.isRefreshingModel||this.columnModel.isChangeEventsDispatching())return;const t=typeof e=="object"&&"step"in e?e:this.buildRefreshModelParams(e);if(!t||this.isSuppressModelUpdateAfterUpdateTransaction(t))return;const i=this.createChangePath(t.rowNodeTransactions);switch(this.isRefreshingModel=!0,t.step){case"group":this.doRowGrouping(t.rowNodeTransactions,i,!!t.rowNodesOrderChanged,!!t.afterColumnsChanged);case"filter":this.doFilter(i);case"pivot":this.doPivot(i);case"aggregate":this.doAggregate(i);case"filter_aggregates":this.doFilterAggregates(i);case"sort":this.doSort(t.rowNodeTransactions,i);case"map":this.doRowsToDisplay()}const s=this.setRowTopAndRowIndex();this.clearRowTopAndRowIndex(i,s),this.isRefreshingModel=!1,this.eventService.dispatchEvent({type:"modelUpdated",animate:t.animate,keepRenderedRows:t.keepRenderedRows,newData:t.newData,newPage:!1,keepUndoRedoStack:t.keepUndoRedoStack})}isEmpty(){const e=A(this.rootNode.allLeafChildren)||this.rootNode.allLeafChildren.length===0;return A(this.rootNode)||e||!this.columnModel.isReady()}isRowsToRender(){return F(this.rowsToDisplay)&&this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let i=!1,s=!1;const o=[],r=Qe(this.gos);return this.forEachNodeAfterFilterAndSort(n=>{if(s)return;if(i&&(n===t||n===e)&&(s=!0,n.group&&r)){o.push(...n.allLeafChildren);return}if(!i){if(n!==t&&n!==e)return;i=!0}if(!n.group||!r){o.push(n);return}}),o}setDatasource(e){O("should never call setDatasource on clientSideRowController")}getTopLevelNodes(){return this.rootNode?this.rootNode.childrenAfterGroup:null}getRootNode(){return this.rootNode}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){if(this.isEmpty()||this.rowsToDisplay.length===0)return-1;let t=0,i=this.rowsToDisplay.length-1;if(e<=0)return 0;if(I(this.rowsToDisplay).rowTop<=e)return this.rowsToDisplay.length-1;let o=-1,r=-1;for(;;){const n=Math.floor((t+i)/2),l=this.rowsToDisplay[n];if(this.isRowInPixel(l,e)||(l.rowTop<e?t=n+1:l.rowTop>e&&(i=n-1),o===t&&r===i))return n;o=t,r=i}}isRowInPixel(e,t){const i=e.rowTop,s=e.rowTop+e.rowHeight;return i<=t&&s>t}forEachLeafNode(e){this.rootNode.allLeafChildren&&this.rootNode.allLeafChildren.forEach((t,i)=>e(t,i))}forEachNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterGroup||[]],callback:e,recursionType:0,index:0,includeFooterNodes:t})}forEachNodeAfterFilter(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterAggFilter||[]],callback:e,recursionType:1,index:0,includeFooterNodes:t})}forEachNodeAfterFilterAndSort(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterSort||[]],callback:e,recursionType:2,index:0,includeFooterNodes:t})}forEachPivotNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[this.rootNode],callback:e,recursionType:3,index:0,includeFooterNodes:t})}recursivelyWalkNodesAndCallback(e){const{nodes:t,callback:i,recursionType:s,includeFooterNodes:o}=e;let{index:r}=e;const n=l=>{var g;const a=(g=t[0])==null?void 0:g.parent;if(!a)return;const d=o&&To(this.gos),h=Io(this.gos),c=o&&h({node:a});if(a===this.rootNode){d===l&&(a.createFooter(),i(a.sibling,r++));return}c===l&&(a.createFooter(),i(a.sibling,r++))};n("top");for(let l=0;l<t.length;l++){const a=t[l];if(i(a,r++),a.hasChildren()&&!a.footer){let d=null;switch(s){case 0:d=a.childrenAfterGroup;break;case 1:d=a.childrenAfterAggFilter;break;case 2:d=a.childrenAfterSort;break;case 3:d=a.leafGroup?null:a.childrenAfterSort;break}d&&(r=this.recursivelyWalkNodesAndCallback({nodes:[...d],callback:i,recursionType:s,index:r,includeFooterNodes:o}))}}return n("bottom"),r}doAggregate(e){var t;(t=this.aggregationStage)==null||t.execute({rowNode:this.rootNode,changedPath:e})}doFilterAggregates(e){this.filterAggregatesStage?this.filterAggregatesStage.execute({rowNode:this.rootNode,changedPath:e}):this.rootNode.childrenAfterAggFilter=this.rootNode.childrenAfterFilter}expandOrCollapseAll(e){const t=this.gos.get("treeData"),i=this.columnModel.isPivotActive(),s=o=>{o&&o.forEach(r=>{const n=()=>{r.expanded=e,s(r.childrenAfterGroup)};if(t){F(r.childrenAfterGroup)&&n();return}if(i){!r.leafGroup&&n();return}r.group&&n()})};this.rootNode&&s(this.rootNode.childrenAfterGroup),this.refreshModel({step:"map"}),this.eventService.dispatchEvent({type:"expandOrCollapseAll",source:e?"expandAll":"collapseAll"})}doSort(e,t){this.sortStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,changedPath:t})}doRowGrouping(e,t,i,s){if(this.groupStage)e?this.groupStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,rowNodesOrderChanged:i,changedPath:t}):this.groupStage.execute({rowNode:this.rootNode,changedPath:t,afterColumnsChanged:s}),Qe(this.gos)&&this.selectionService.updateGroupsFromChildrenSelections("rowGroupChanged",t)&&this.eventService.dispatchEvent({type:"selectionChanged",source:"rowGroupChanged"});else{const o=this.rootNode,r=o.sibling;o.childrenAfterGroup=o.allLeafChildren,r&&(r.childrenAfterGroup=o.childrenAfterGroup),this.rootNode.updateHasChildren()}this.nodeManager.isRowCountReady()&&(this.rowCountReady=!0,this.eventService.dispatchEventOnce({type:"rowCountReady"}))}doFilter(e){this.filterStage.execute({rowNode:this.rootNode,changedPath:e})}doPivot(e){var t;(t=this.pivotStage)==null||t.execute({rowNode:this.rootNode,changedPath:e})}getNodeManager(){return this.nodeManager}getRowNode(e){if(typeof e=="string"&&e.indexOf(be.ID_PREFIX_ROW_GROUP)==0){let i;return this.forEachNode(s=>{s.id===e&&(i=s)}),i}return this.nodeManager.getRowNode(e)}setRowData(e){this.selectionService.reset("rowDataChanged"),this.nodeManager.setRowData(e),this.hasStarted&&this.dispatchUpdateEventsAndRefresh()}dispatchUpdateEventsAndRefresh(){this.eventService.dispatchEvent({type:"rowDataUpdated"}),this.refreshModel({step:"group",newData:!0})}batchUpdateRowData(e,t){if(this.applyAsyncTransactionsTimeout==null){this.rowDataTransactionBatch=[];const i=this.gos.get("asyncTransactionWaitMillis");this.applyAsyncTransactionsTimeout=window.setTimeout(()=>{this.isAlive()&&this.executeBatchUpdateRowData()},i)}this.rowDataTransactionBatch.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){this.applyAsyncTransactionsTimeout!=null&&(clearTimeout(this.applyAsyncTransactionsTimeout),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){var s;this.valueCache.onDataChanged();const e=[],t=[];let i=!1;(s=this.rowDataTransactionBatch)==null||s.forEach(o=>{const{rowNodeTransaction:r,rowsInserted:n}=this.nodeManager.updateRowData(o.rowDataTransaction);n&&(i=!0),t.push(r),o.callback&&e.push(o.callback.bind(null,r))}),this.commonUpdateRowData(t,i),e.length>0&&window.setTimeout(()=>{e.forEach(o=>o())},0),t.length>0&&this.eventService.dispatchEvent({type:"asyncTransactionsFlushed",results:t}),this.rowDataTransactionBatch=null,this.applyAsyncTransactionsTimeout=void 0}updateRowData(e){this.valueCache.onDataChanged();const{rowNodeTransaction:t,rowsInserted:i}=this.nodeManager.updateRowData(e);return this.commonUpdateRowData([t],i),t}afterImmutableDataChange(e,t){this.commonUpdateRowData([e],t)}commonUpdateRowData(e,t){if(!this.hasStarted)return;const i=!this.gos.get("suppressAnimationFrame");this.eventService.dispatchEvent({type:"rowDataUpdated"}),this.refreshModel({step:"group",rowNodeTransactions:e,rowNodesOrderChanged:t,keepRenderedRows:!0,keepEditingRows:!0,animate:i})}doRowsToDisplay(){this.rowsToDisplay=this.flattenStage.execute({rowNode:this.rootNode})}onRowHeightChanged(){this.refreshModel({step:"map",keepRenderedRows:!0,keepEditingRows:!0,keepUndoRedoStack:!0})}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}resetRowHeights(){const e=this.resetRowHeightsForAllRowNodes();this.rootNode.setRowHeight(this.rootNode.rowHeight,!0),this.rootNode.sibling&&this.rootNode.sibling.setRowHeight(this.rootNode.sibling.rowHeight,!0),e&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{t.setRowHeight(t.rowHeight,!0);const i=t.detailNode;i&&i.setRowHeight(i.rowHeight,!0),t.sibling&&t.sibling.setRowHeight(t.sibling.rowHeight,!0),e=!0}),e}onGridStylesChanges(e){if(e.rowHeightChanged){if(this.columnModel.isAutoRowHeightActive())return;this.resetRowHeights()}}onGridReady(){this.hasStarted||this.setInitialData()}isRowDataLoaded(){return this.rowCountReady}destroy(){super.destroy(),this.clearHighlightedRow()}};function rm(e){e.expansionService.onGroupExpandedOrCollapsed()}function nm(e,t){var i,s;(s=(i=e.rowModelHelperService)==null?void 0:i.getClientSideRowModel())==null||s.refreshModel(t)}function lm(e){var t,i;return((i=(t=e.rowModelHelperService)==null?void 0:t.getClientSideRowModel())==null?void 0:i.isEmpty())??!0}function am(e,t){var i,s;(s=(i=e.rowModelHelperService)==null?void 0:i.getClientSideRowModel())==null||s.forEachLeafNode(t)}function dm(e,t){var i,s;(s=(i=e.rowModelHelperService)==null?void 0:i.getClientSideRowModel())==null||s.forEachNodeAfterFilter(t)}function hm(e,t){var i,s;(s=(i=e.rowModelHelperService)==null?void 0:i.getClientSideRowModel())==null||s.forEachNodeAfterFilterAndSort(t)}function cm(e){var t,i;if(e.columnModel.isAutoRowHeightActive()){S("calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.");return}(i=(t=e.rowModelHelperService)==null?void 0:t.getClientSideRowModel())==null||i.resetRowHeights()}function um(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var i,s;return(s=(i=e.rowModelHelperService)==null?void 0:i.getClientSideRowModel())==null?void 0:s.updateRowData(t)})}function gm(e,t,i){e.frameworkOverrides.wrapIncoming(()=>{var s,o;return(o=(s=e.rowModelHelperService)==null?void 0:s.getClientSideRowModel())==null?void 0:o.batchUpdateRowData(t,i)})}function pm(e){e.frameworkOverrides.wrapIncoming(()=>{var t,i;return(i=(t=e.rowModelHelperService)==null?void 0:t.getClientSideRowModel())==null?void 0:i.flushAsyncTransactions()})}function fm(e){return e.selectionService.getBestCostNodeSelection()}var Cm=class extends v{constructor(){super(...arguments),this.beanName="filterStage"}wireBeans(e){this.filterManager=e.filterManager}execute(e){const{changedPath:t}=e;this.filter(t)}filter(e){var i;const t=!!((i=this.filterManager)!=null&&i.isChildFilterPresent());this.filterNodes(t,e)}filterNodes(e,t){const i=(s,o)=>{s.hasChildren()&&e&&!o?s.childrenAfterFilter=s.childrenAfterGroup.filter(r=>{const n=r.childrenAfterFilter&&r.childrenAfterFilter.length>0,l=r.data&&this.filterManager.doesRowPassFilter({rowNode:r});return n||l}):s.childrenAfterFilter=s.childrenAfterGroup,s.sibling&&(s.sibling.childrenAfterFilter=s.childrenAfterFilter)};if(this.doingTreeDataFiltering()){const s=(r,n)=>{if(r.childrenAfterGroup)for(let l=0;l<r.childrenAfterGroup.length;l++){const a=r.childrenAfterGroup[l],d=n||this.filterManager.doesRowPassFilter({rowNode:a});a.childrenAfterGroup?s(r.childrenAfterGroup[l],d):i(a,d)}i(r,n)},o=r=>s(r,!1);t.executeFromRootNode(o)}else{const s=o=>i(o,!1);t.forEachChangedNodeDepthFirst(s,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}},mm=class extends v{constructor(){super(...arguments),this.beanName="flattenStage"}wireBeans(e){this.beans=e,this.columnModel=e.columnModel}execute(e){const t=e.rowNode,i=[],s=this.columnModel.isPivotMode(),o=s&&t.leafGroup,r=o?[t]:t.childrenAfterSort,n=this.getFlattenDetails();this.recursivelyAddToRowsToDisplay(n,r,i,s,0);const l=i.length>0;if(!o&&l&&n.grandTotalRow){t.createFooter();const d=n.grandTotalRow==="top";this.addRowNodeToRowsToDisplay(n,t.sibling,i,0,d)}return i}getFlattenDetails(){const e=this.gos.get("groupRemoveSingleChildren");return{groupRemoveLowestSingleChildren:!e&&this.gos.get("groupRemoveLowestSingleChildren"),groupRemoveSingleChildren:e,isGroupMultiAutoColumn:Lo(this.gos),hideOpenParents:this.gos.get("groupHideOpenParents"),grandTotalRow:To(this.gos),groupTotalRow:Io(this.gos)}}recursivelyAddToRowsToDisplay(e,t,i,s,o){if(!se(t))for(let r=0;r<t.length;r++){const n=t[r],l=n.hasChildren(),a=s&&!l,d=e.groupRemoveSingleChildren&&l&&n.childrenAfterGroup.length===1,h=e.groupRemoveLowestSingleChildren&&l&&n.leafGroup&&n.childrenAfterGroup.length===1,c=s&&n.leafGroup,u=e.hideOpenParents&&n.expanded&&!n.master&&!c;if(!a&&!u&&!d&&!h&&this.addRowNodeToRowsToDisplay(e,n,i,o),!(s&&n.leafGroup)){if(l){const p=d||h;if(n.expanded||p){const C=e.groupTotalRow({node:n});C||n.destroyFooter();const f=p?o:o+1;C==="top"&&(n.createFooter(),this.addRowNodeToRowsToDisplay(e,n.sibling,i,f)),this.recursivelyAddToRowsToDisplay(e,n.childrenAfterSort,i,s,f),C==="bottom"&&(n.createFooter(),this.addRowNodeToRowsToDisplay(e,n.sibling,i,f))}}else if(n.master&&n.expanded){const p=this.createDetailNode(n);this.addRowNodeToRowsToDisplay(e,p,i,o)}}}}addRowNodeToRowsToDisplay(e,t,i,s,o){o?i.unshift(t):i.push(t),t.setUiLevel(e.isGroupMultiAutoColumn?0:s)}createDetailNode(e){if(F(e.detailNode))return e.detailNode;const t=new be(this.beans);return t.detail=!0,t.selectable=!1,t.parent=e,F(e.id)&&(t.id="detail_"+e.id),t.data=e.data,t.level=e.level+1,e.detailNode=t,t}},vm=class extends v{constructor(){super(...arguments),this.beanName="immutableService"}wireBeans(e){this.rowModel=e.rowModel,this.selectionService=e.selectionService}postConstruct(){N(this.gos)&&(this.clientSideRowModel=this.rowModel,this.addManagedPropertyListener("rowData",()=>this.onRowDataUpdated()))}isActive(){const e=this.gos.exists("getRowId");return this.gos.get("resetRowDataOnUpdate")?!1:e}setRowData(e){const t=this.createTransactionForRowData(e);if(!t)return;const i=this.clientSideRowModel.getNodeManager(),{rowNodeTransaction:s,rowsInserted:o}=i.updateRowData(t);let r=!1;this.gos.get("suppressMaintainUnsortedOrder")||(r=i.updateRowOrderFromRowData(e)),this.clientSideRowModel.afterImmutableDataChange(s,r||o)}createTransactionForRowData(e){if(!N(this.gos))return O("ImmutableService only works with ClientSideRowModel"),null;const t=ut(this.gos);if(t==null)return O("ImmutableService requires getRowId() callback to be implemented, your row data needs IDs!"),null;const i=this.clientSideRowModel.getNodeManager().getCopyOfNodesMap(),s=[],o=[],r=[];return F(e)&&e.forEach(n=>{const l=t({data:n,level:0}),a=i[l];a?(a.data!==n&&o.push(n),i[l]=void 0):r.push(n)}),re(i,(n,l)=>{l&&s.push(l.data)}),{remove:s,update:o,add:r}}onRowDataUpdated(){const e=this.gos.get("rowData");e&&(this.isActive()?this.setRowData(e):(this.selectionService.reset("rowDataChanged"),this.clientSideRowModel.setRowData(e)))}},wm=class extends v{constructor(){super(...arguments),this.beanName="sortService"}wireBeans(e){this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.rowNodeSorter=e.rowNodeSorter,this.showRowGroupColsService=e.showRowGroupColsService}sort(e,t,i,s,o,r){const n=this.gos.get("groupMaintainOrder"),l=this.columnModel.getCols().some(u=>u.isRowGroupActive());let a={};i&&s&&(a=this.calculateDirtyNodes(s));const d=this.columnModel.isPivotMode(),h=this.gos.getCallback("postSortRows"),c=u=>{var C;this.pullDownGroupDataForHideOpenParents(u.childrenAfterAggFilter,!0);const g=d&&u.leafGroup;if(n&&l&&!u.leafGroup&&!r){const f=(C=this.funcColsService.getRowGroupColumns())==null?void 0:C[u.level+1],w=(f==null?void 0:f.getSort())===null,y=u.childrenAfterAggFilter.slice(0);if(u.childrenAfterSort&&!w){const R={};u.childrenAfterSort.forEach((P,M)=>{R[P.id]=M}),y.sort((P,M)=>(R[P.id]??0)-(R[M.id]??0))}u.childrenAfterSort=y}else!t||g?u.childrenAfterSort=u.childrenAfterAggFilter.slice(0):i?u.childrenAfterSort=this.doDeltaSort(u,a,o,e):u.childrenAfterSort=this.rowNodeSorter.doFullSort(u.childrenAfterAggFilter,e);if(u.sibling&&(u.sibling.childrenAfterSort=u.childrenAfterSort),this.updateChildIndexes(u),h){const f={nodes:u.childrenAfterSort};h(f)}};o&&o.forEachChangedNodeDepthFirst(c),this.updateGroupDataForHideOpenParents(o)}calculateDirtyNodes(e){const t={},i=s=>{s&&s.forEach(o=>t[o.id]=!0)};return e&&e.forEach(s=>{i(s.add),i(s.update),i(s.remove)}),t}doDeltaSort(e,t,i,s){const o=e.childrenAfterAggFilter,r=e.childrenAfterSort;if(!r)return this.rowNodeSorter.doFullSort(o,s);const n={},l=[];o.forEach(c=>{t[c.id]||!i.canSkip(c)?l.push(c):n[c.id]=!0});const a=r.filter(c=>n[c.id]),d=(c,u)=>({currentPos:u,rowNode:c}),h=l.map(d).sort((c,u)=>this.rowNodeSorter.compareRowNodes(s,c,u));return this.mergeSortedArrays(s,h,a.map(d)).map(({rowNode:c})=>c)}mergeSortedArrays(e,t,i){const s=[];let o=0,r=0;for(;o<t.length&&r<i.length;)this.rowNodeSorter.compareRowNodes(e,t[o],i[r])<0?s.push(t[o++]):s.push(i[r++]);for(;o<t.length;)s.push(t[o++]);for(;r<i.length;)s.push(i[r++]);return s}updateChildIndexes(e){if(A(e.childrenAfterSort))return;const t=e.childrenAfterSort;for(let i=0;i<t.length;i++){const s=t[i],o=i===0,r=i===e.childrenAfterSort.length-1;s.setFirstChild(o),s.setLastChild(r),s.setChildIndex(i)}}updateGroupDataForHideOpenParents(e){if(!this.gos.get("groupHideOpenParents"))return;if(this.gos.get("treeData"))return S("The property hideOpenParents dose not work with Tree Data. This is because Tree Data has values at the group level, it doesn't make sense to hide them."),!1;const t=i=>{this.pullDownGroupDataForHideOpenParents(i.childrenAfterSort,!1),i.childrenAfterSort.forEach(s=>{s.hasChildren()&&t(s)})};e&&e.executeFromRootNode(i=>t(i))}pullDownGroupDataForHideOpenParents(e,t){!this.gos.get("groupHideOpenParents")||A(e)||e.forEach(i=>{var o;(((o=this.showRowGroupColsService)==null?void 0:o.getShowRowGroupCols())??[]).forEach(r=>{const n=r.getColDef().showRowGroup;if(typeof n!="string"){O("groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup");return}const l=n,a=this.columnModel.getColDefCol(l);if(a!==i.rowGroupColumn)if(t)i.setGroupValue(r.getId(),void 0);else{const h=this.getFirstChildOfFirstChild(i,a);h&&i.setGroupValue(r.getId(),h.key)}})})}getFirstChildOfFirstChild(e,t){let i=e;for(;i;){const s=i.parent;if(s&&i.firstChild){if(s.rowGroupColumn===t)return s}else return null;i=s}return null}},Sm=class extends v{constructor(){super(...arguments),this.beanName="sortStage"}wireBeans(e){this.sortService=e.sortService,this.sortController=e.sortController}execute(e){const t=this.sortController.getSortOptions(),i=F(t)&&t.length>0,s=i&&F(e.rowNodeTransactions)&&this.gos.get("deltaSort"),o=t.some(r=>fe(this.gos)?r.column.isPrimary()&&r.column.isRowGroupActive():!!r.column.getColDef().showRowGroup);this.sortService.sort(t,i,s,e.rowNodeTransactions,e.changedPath,o)}},Ws="32.3.2",bn={version:Ws,moduleName:"@ag-grid-community/client-side-row-model-core",rowModel:"clientSide",beans:[om,Cm,Sm,mm,wm,vm]},ym={version:Ws,moduleName:"@ag-grid-community/client-side-row-model-api",beans:[Fn],apiFunctions:{onGroupExpandedOrCollapsed:rm,refreshClientSideRowModel:nm,isRowDataEmpty:lm,forEachLeafNode:am,forEachNodeAfterFilter:dm,forEachNodeAfterFilterAndSort:hm,resetRowHeights:cm,applyTransaction:um,applyTransactionAsync:gm,flushAsyncTransactions:pm,getBestCostNodeSelection:fm},dependantModules:[bn,ZC]},Rm={version:Ws,moduleName:"@ag-grid-community/client-side-row-model",dependantModules:[bn,ym]},Fm=class extends v{setBeans(e){this.beans=e}getFileName(e){const t=this.getDefaultFileExtension();return(e==null||!e.length)&&(e=this.getDefaultFileName()),e.indexOf(".")===-1?`${e}.${t}`:e}getData(e){const t=this.createSerializingSession(e);return this.beans.gridSerializer.serialize(t,e)}getDefaultFileName(){return`export.${this.getDefaultFileExtension()}`}},bm=class{constructor(e){this.groupColumns=[];const{columnModel:t,funcColsService:i,columnNameService:s,valueService:o,gos:r,processCellCallback:n,processHeaderCallback:l,processGroupHeaderCallback:a,processRowGroupCallback:d}=e;this.columnModel=t,this.funcColsService=i,this.columnNameService=s,this.valueService=o,this.gos=r,this.processCellCallback=n,this.processHeaderCallback=l,this.processGroupHeaderCallback=a,this.processRowGroupCallback=d}prepare(e){this.groupColumns=e.filter(t=>!!t.getColDef().showRowGroup)}extractHeaderValue(e){return this.getHeaderName(this.processHeaderCallback,e)??""}extractRowCellValue(e,t,i,s,o){const n=(!this.gos.get("groupHideOpenParents")||o.footer)&&this.shouldRenderGroupSummaryCell(o,e,t)?this.createValueForGroupNode(e,o):this.valueService.getValue(e,o);return this.processCell({accumulatedRowIndex:i,rowNode:o,column:e,value:n,processCellCallback:this.processCellCallback,type:s})}shouldRenderGroupSummaryCell(e,t,i){var n;if(!(e&&e.group))return!1;if(this.groupColumns.indexOf(t)!==-1){const l=(n=e.groupData)==null?void 0:n[t.getId()],a=this.gos.get("suppressGroupMaintainValueType");if(a&&l!=null||!a&&l!==void 0||De(this.gos)&&e.group)return!0;if(e.footer&&e.level===-1){const d=t.getColDef();return d==null||d.showRowGroup===!0||d.showRowGroup===this.funcColsService.getRowGroupColumns()[0].getId()}}const r=ui(this.gos,this.columnModel.isPivotMode());return i===0&&r}getHeaderName(e,t){return e?e(this.gos.addGridCommonParams({column:t})):this.columnNameService.getDisplayNameForColumn(t,"csv",!0)}createValueForGroupNode(e,t){if(this.processRowGroupCallback)return this.processRowGroupCallback(this.gos.addGridCommonParams({column:e,node:t}));const i=this.gos.get("treeData"),s=this.gos.get("suppressGroupMaintainValueType"),o=a=>{var h;if(i||s)return a.key;const d=(h=a.groupData)==null?void 0:h[e.getId()];return!d||!a.rowGroupColumn||a.rowGroupColumn.getColDef().useValueFormatterForExport===!1?d:this.valueService.formatValue(a.rowGroupColumn,a,d)??d},r=t.footer,n=[o(t)];if(!Lo(this.gos))for(;t.parent;)t=t.parent,n.push(o(t));const l=n.reverse().join(" -> ");return r?`Total ${l}`:l}processCell(e){const{accumulatedRowIndex:t,rowNode:i,column:s,value:o,processCellCallback:r,type:n}=e;return r?{value:r(this.gos.addGridCommonParams({accumulatedRowIndex:t,column:s,node:i,value:o,type:n,parseValue:l=>this.valueService.parseValue(s,i,l,this.valueService.getValue(s,i)),formatValue:l=>this.valueService.formatValue(s,i,l)??l}))??""}:s.getColDef().useValueFormatterForExport!==!1?{value:o??"",valueFormatted:this.valueService.formatValue(s,i,o)}:{value:o??""}}},Pm=class{static download(e,t){const i=document.defaultView||window;if(!i){S("There is no `window` associated with the current `document`");return}const s=document.createElement("a"),o=i.URL.createObjectURL(t);s.setAttribute("href",o),s.setAttribute("download",e),s.style.display="none",document.body.appendChild(s),s.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:i})),document.body.removeChild(s),i.setTimeout(()=>{i.URL.revokeObjectURL(o)},0)}},yo=`\r `,Dm=class extends bm{constructor(e){super(e),this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:i}=e;this.suppressQuotes=t,this.columnSeparator=i}addCustomContent(e){e&&(typeof e=="string"?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,yo),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((i,s)=>{s!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(i.data.value||""),i.mergeAcross&&this.appendEmptyCells(i.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,i,s){i!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(s)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){t!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,i){t!=0&&(this.result+=this.columnSeparator);const s=this.extractRowCellValue(e,t,t,"csv",i);this.result+=this.putInQuotes(s.valueFormatted??s.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(e==null)return'""';let t;return typeof e=="string"?t=e:typeof e.toString=="function"?t=e.toString():(S("unknown value type during csv conversion"),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=yo),this.isFirstLine=!1}},Em=class extends Fm{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.columnModel=e.columnModel,this.columnNameService=e.columnNameService,this.funcColsService=e.funcColsService,this.valueService=e.valueService,this.gridSerializer=e.gridSerializer}postConstruct(){this.setBeans({gridSerializer:this.gridSerializer,gos:this.gos})}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){S("Export cancelled. Export is not allowed as per your configuration.");return}const t=this.getMergedParams(e),i=this.getData(t),s=new Blob(["\uFEFF",i],{type:"text/plain"}),o=typeof t.fileName=="function"?t.fileName(this.gos.getGridCommonParams()):t.fileName;Pm.download(this.getFileName(o),s)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const i=t?Object.assign({},e):this.getMergedParams(e);return this.getData(i)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{columnModel:t,columnNameService:i,funcColsService:s,valueService:o,gos:r}=this,{processCellCallback:n,processHeaderCallback:l,processGroupHeaderCallback:a,processRowGroupCallback:d,suppressQuotes:h,columnSeparator:c}=e;return new Dm({columnModel:t,columnNameService:i,funcColsService:s,valueService:o,gos:r,processCellCallback:n||void 0,processHeaderCallback:l||void 0,processGroupHeaderCallback:a||void 0,processRowGroupCallback:d||void 0,suppressQuotes:h||!1,columnSeparator:c||","})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function Mm(e,t){var i;return(i=e.csvCreator)==null?void 0:i.getDataAsCsv(t)}function xm(e,t){var i;(i=e.csvCreator)==null||i.exportDataAsCsv(t)}var Am=class extends v{constructor(){super(...arguments),this.beanName="gridSerializer"}wireBeans(e){this.visibleColsService=e.visibleColsService,this.columnModel=e.columnModel,this.columnNameService=e.columnNameService,this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel,this.selectionService=e.selectionService,this.rowNodeSorter=e.rowNodeSorter,this.sortController=e.sortController}serialize(e,t={}){const{allColumns:i,columnKeys:s,skipRowGroups:o}=t,r=this.getColumnsToExport(i,o,s);return kn(this.prepareSession(r),this.prependContent(t),this.exportColumnGroups(t,r),this.exportHeaders(t,r),this.processPinnedTopRows(t,r),this.processRows(t,r),this.processPinnedBottomRows(t,r),this.appendContent(t))(e).parse()}processRow(e,t,i,s){var w;const o=t.shouldRowBeSkipped||(()=>!1),r=this.gos.get("groupRemoveSingleChildren"),n=this.gos.get("groupRemoveLowestSingleChildren"),a=t.rowPositions!=null||!!t.onlySelected,d=this.gos.get("groupHideOpenParents")&&!a,h=this.columnModel.isPivotMode()?s.leafGroup:!s.group,c=!!s.footer,u=n&&s.leafGroup,g=s.allChildrenCount===1&&((w=s.childrenAfterGroup)==null?void 0:w.length)===1&&(r||u);if(!h&&!c&&(t.skipRowGroups||g||d)||t.onlySelected&&!s.isSelected()||t.skipPinnedTop&&s.rowPinned==="top"||t.skipPinnedBottom&&s.rowPinned==="bottom"||s.level===-1&&!h&&!c||o(this.gos.addGridCommonParams({node:s})))return;const f=e.onNewBodyRow(s);if(i.forEach((y,R)=>{f.onColumn(y,R,s)}),t.getCustomContentBelowRow){const y=t.getCustomContentBelowRow(this.gos.addGridCommonParams({node:s}));y&&e.addCustomContent(y)}}appendContent(e){return t=>{const i=e.appendContent;return i&&t.addCustomContent(i),t}}prependContent(e){return t=>{const i=e.prependContent;return i&&t.addCustomContent(i),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return i=>{if(!e.skipColumnGroupHeaders){const s=new Uo,o=this.visibleColsService.createGroups({columns:t,idCreator:s,pinned:null,isStandaloneStructure:!0});this.recursivelyAddHeaderGroups(o,i,e.processGroupHeaderCallback)}return i}}exportHeaders(e,t){return i=>{if(!e.skipColumnHeaders){const s=i.onNewHeaderRow();t.forEach((o,r)=>{s.onColumn(o,r,void 0)})}return i}}processPinnedTopRows(e,t){return i=>{const s=this.processRow.bind(this,i,e,t);return e.rowPositions?e.rowPositions.filter(o=>o.rowPinned==="top").sort((o,r)=>o.rowIndex-r.rowIndex).map(o=>this.pinnedRowModel.getPinnedTopRow(o.rowIndex)).forEach(s):this.pinnedRowModel.forEachPinnedRow("top",s),i}}processRows(e,t){return i=>{const s=this.rowModel,o=N(this.gos),r=De(this.gos),n=!o&&e.onlySelected,l=this.processRow.bind(this,i,e,t),{exportedRows:a="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(d=>d.rowPinned==null).sort((d,h)=>d.rowIndex-h.rowIndex).map(d=>s.getRow(d.rowIndex)).forEach(l);else if(this.columnModel.isPivotMode())o?s.forEachPivotNode(l,!0):r?s.forEachNodeAfterFilterAndSort(l,!0):s.forEachNode(l);else if(e.onlySelectedAllPages||n){const d=this.selectionService.getSelectedNodes();this.replicateSortedOrder(d),d.forEach(l)}else a==="all"?s.forEachNode(l):o||r?s.forEachNodeAfterFilterAndSort(l,!0):s.forEachNode(l);return i}}replicateSortedOrder(e){const t=this.sortController.getSortOptions(),i=(s,o)=>{var r,n;return s.rowIndex!=null&&o.rowIndex!=null?s.rowIndex-o.rowIndex:s.level===o.level?((r=s.parent)==null?void 0:r.id)===((n=o.parent)==null?void 0:n.id)?this.rowNodeSorter.compareRowNodes(t,{rowNode:s,currentPos:s.rowIndex??-1},{rowNode:o,currentPos:o.rowIndex??-1}):i(s.parent,o.parent):s.level>o.level?i(s.parent,o):i(s,o.parent)};e.sort(i)}processPinnedBottomRows(e,t){return i=>{const s=this.processRow.bind(this,i,e,t);return e.rowPositions?e.rowPositions.filter(o=>o.rowPinned==="bottom").sort((o,r)=>o.rowIndex-r.rowIndex).map(o=>this.pinnedRowModel.getPinnedBottomRow(o.rowIndex)).forEach(s):this.pinnedRowModel.forEachPinnedRow("bottom",s),i}}getColumnsToExport(e=!1,t=!1,i){const s=this.columnModel.isPivotMode();if(i&&i.length)return this.columnModel.getColsForKeys(i);const o=this.gos.get("treeData");let r=[];return e&&!s?r=this.columnModel.getCols():r=this.visibleColsService.getAllCols(),t&&!o&&(r=r.filter(n=>_i(n)||Gt(n))),r}recursivelyAddHeaderGroups(e,t,i){const s=[];e.forEach(o=>{const r=o;r.getChildren&&r.getChildren().forEach(n=>s.push(n))}),e.length>0&&W(e[0])&&this.doAddHeaderHeader(t,e,i),s&&s.length>0&&this.recursivelyAddHeaderGroups(s,t,i)}doAddHeaderHeader(e,t,i){const s=e.onNewHeaderGroupingRow();let o=0;t.forEach(r=>{const n=r;let l;i?l=i(this.gos.addGridCommonParams({columnGroup:n})):l=this.columnNameService.getDisplayNameForColumnGroup(n,"header");const a=n.getLeafColumns().reduce((d,h,c,u)=>{let g=I(d);return h.getColumnGroupShow()==="open"?(!g||g[1]!=null)&&(g=[c],d.push(g)):g&&g[1]==null&&(g[1]=c-1),c===u.length-1&&g&&g[1]==null&&(g[1]=c),d},[]);s.onColumn(n,l||"",o++,n.getLeafColumns().length-1,a)})}},zs="32.3.2",Pn={version:zs,moduleName:"@ag-grid-community/csv-export-core",beans:[Em,Am]},Tm={version:zs,moduleName:"@ag-grid-community/csv-export-api",apiFunctions:{getDataAsCsv:Mm,exportDataAsCsv:xm},dependantModules:[Pn]},Im={version:zs,moduleName:"@ag-grid-community/csv-export",dependantModules:[Pn,Tm]},Lm=class extends Lu{wireBeans(e){this.beans=e}constructor(e,t,i){super(e),this.parentCache=t,this.params=i,this.startRow=e*i.blockSize,this.endRow=this.startRow+i.blockSize}postConstruct(){this.createRowNodes()}getBlockStateJson(){return{id:""+this.getId(),state:{blockNumber:this.getId(),startRow:this.getStartRow(),endRow:this.getEndRow(),pageStatus:this.getState()}}}setDataAndId(e,t,i){F(t)?e.setDataAndId(t,i.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(A(this.params.datasource.getRows)){S("datasource is missing getRows method");return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}processServerFail(){}createLoadParams(){return{startRow:this.getStartRow(),endRow:this.getEndRow(),successCallback:this.pageLoaded.bind(this,this.getVersion()),failCallback:this.pageLoadFailed.bind(this,this.getVersion()),sortModel:this.params.sortModel,filterModel:this.params.filterModel,context:this.gos.getGridCommonParams().context}}forEachNode(e,t,i){this.rowNodes.forEach((s,o)=>{this.startRow+o<i&&e(s,t.next())})}getLastAccessed(){return this.lastAccessed}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.next());const i=e-this.startRow;return this.rowNodes[i]}getStartRow(){return this.startRow}getEndRow(){return this.endRow}createRowNodes(){this.rowNodes=[];for(let e=0;e<this.params.blockSize;e++){const t=this.startRow+e,i=new be(this.beans);i.setRowHeight(this.params.rowHeight),i.uiLevel=0,i.setRowIndex(t),i.setRowTop(this.params.rowHeight*t),this.rowNodes.push(i)}}processServerResult(e){this.rowNodes.forEach((i,s)=>{const o=e.rowData?e.rowData[s]:void 0;!i.id&&i.alreadyRendered&&o&&(this.rowNodes[s]=new be(this.beans),this.rowNodes[s].setRowIndex(i.rowIndex),this.rowNodes[s].setRowTop(i.rowTop),this.rowNodes[s].setRowHeight(i.rowHeight),i.clearRowTopAndRowIndex()),this.setDataAndId(this.rowNodes[s],o,this.startRow+s)});const t=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,t)}destroy(){this.rowNodes.forEach(e=>{e.clearRowTopAndRowIndex()}),super.destroy()}},Om=2,Gm=class extends v{constructor(e){super(),this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount,this.params=e}wireBeans(e){this.rowRenderer=e.rowRenderer,this.focusService=e.focusService}getRow(e,t=!1){const i=Math.floor(e/this.params.blockSize);let s=this.blocks[i];if(!s){if(t)return;s=this.createBlock(i)}return s.getRow(e)}createBlock(e){const t=this.createBean(new Lm(e,this,this.params));return this.blocks[t.getId()]=t,this.blockCount++,this.purgeBlocksIfNeeded(t),this.params.rowNodeBlockLoader.addBlock(t),t}refreshCache(){if(this.blockCount==0){this.purgeCache();return}this.getBlocksInOrder().forEach(t=>t.setStateWaitingToLoad()),this.params.rowNodeBlockLoader.checkBlockToLoad()}destroy(){this.getBlocksInOrder().forEach(e=>this.destroyBlock(e)),super.destroy()}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(this.gos.get("debug")&&ne(`InfiniteCache - onPageLoaded: page = ${e.getId()}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(n=>n!=e),i=(n,l)=>l.getLastAccessed()-n.getLastAccessed();t.sort(i);const s=this.params.maxBlocksInCache>0,o=s?this.params.maxBlocksInCache-1:null,r=Om-1;t.forEach((n,l)=>{const a=n.getState()==="needsLoading"&&l>=r,d=s?l>=o:!1;if(a||d){if(this.isBlockCurrentlyDisplayed(n)||this.isBlockFocused(n))return;this.removeBlockFromCache(n)}})}isBlockFocused(e){const t=this.focusService.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const i=e.getStartRow(),s=e.getEndRow();return t.rowIndex>=i&&t.rowIndex<s}isBlockCurrentlyDisplayed(e){const t=e.getStartRow(),i=e.getEndRow()-1;return this.rowRenderer.isRangeInRenderedViewport(t,i)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if(typeof t=="number"&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const s=(e.getId()+1)*this.params.blockSize+this.params.overflowSize;this.rowCount<s&&(this.rowCount=s)}}setRowCount(e,t){this.rowCount=e,F(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t=new ht;this.getBlocksInOrder().forEach(i=>i.forEachNode(e,t,this.rowCount))}getBlocksInOrder(){const e=(i,s)=>i.getId()-s.getId();return Oe(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.getId()],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){this.isAlive()&&(this.destroyAllBlocksPastVirtualRowCount(),this.eventService.dispatchEvent({type:"storeUpdated"}))}destroyAllBlocksPastVirtualRowCount(){const e=[];this.getBlocksInOrder().forEach(t=>{t.getId()*this.params.blockSize>=this.rowCount&&e.push(t)}),e.length>0&&e.forEach(t=>this.destroyBlock(t))}purgeCache(){this.getBlocksInOrder().forEach(e=>this.removeBlockFromCache(e)),this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const i=[];let s=-1,o=!1;const r=new ht;let n=!1;return this.getBlocksInOrder().forEach(a=>{if(!n){if(o&&s+1!==a.getId()){n=!0;return}s=a.getId(),a.forEachNode(d=>{const h=d===e||d===t;(o||h)&&i.push(d),h&&(o=!o)},r,this.rowCount)}}),n||o?[]:i}},km=class extends v{constructor(){super(...arguments),this.beanName="rowModel"}wireBeans(e){this.filterManager=e.filterManager,this.sortController=e.sortController,this.selectionService=e.selectionService,this.rowRenderer=e.rowRenderer,this.rowNodeBlockLoader=e.rowNodeBlockLoader}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(){return!1}postConstruct(){this.gos.get("rowModelType")==="infinite"&&(this.rowHeight=Ke(this.gos),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache()),this.verifyProps())}verifyProps(){this.gos.exists("initialGroupOrderComparator")&&S("initialGroupOrderComparator cannot be used with Infinite Row Model as sorting is done on the server side")}start(){this.setDatasource(this.gos.get("datasource"))}destroy(){this.destroyDatasource(),super.destroy()}destroyDatasource(){this.datasource&&(this.destroyBean(this.datasource),this.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedEventListeners({filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.onCacheUpdated.bind(this)}),this.addManagedPropertyListener("datasource",()=>this.setDatasource(this.gos.get("datasource"))),this.addManagedPropertyListener("cacheBlockSize",()=>this.resetCache()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=Ke(this.gos),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onFilterChanged(){this.reset()}onSortChanged(){this.reset()}onColumnEverything(){let e;this.cacheParams?e=this.isSortModelDifferent():e=!0,e&&this.reset()}isSortModelDifferent(){return!Mt(this.cacheParams.sortModel,this.sortController.getSortModel())}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){return this.infiniteCache?this.infiniteCache.getRowNodesInRange(e,t):[]}reset(){if(!this.datasource)return;ut(this.gos)!=null||this.selectionService.reset("rowDataChanged"),this.resetCache()}dispatchModelUpdatedEvent(){this.eventService.dispatchEvent({type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1})}resetCache(){var e;this.destroyCache(),this.cacheParams={datasource:this.datasource,filterModel:((e=this.filterManager)==null?void 0:e.getFilterModel())??{},sortModel:this.sortController.getSortModel(),rowNodeBlockLoader:this.rowNodeBlockLoader,initialRowCount:this.gos.get("infiniteInitialRowCount"),maxBlocksInCache:this.gos.get("maxBlocksInCache"),rowHeight:Ke(this.gos),overflowSize:this.gos.get("cacheOverflowSize"),blockSize:this.gos.get("cacheBlockSize"),lastAccessedSequence:new ht},this.infiniteCache=this.createBean(new Gm(this.cacheParams)),this.eventService.dispatchEventOnce({type:"rowCountReady"}),this.dispatchModelUpdatedEvent()}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)}),this.dispatchModelUpdatedEvent()}destroyCache(){this.infiniteCache&&(this.infiniteCache=this.destroyBean(this.infiniteCache))}onCacheUpdated(){this.dispatchModelUpdatedEvent()}getRow(e){if(this.infiniteCache&&!(e>=this.infiniteCache.getRowCount()))return this.infiniteCache.getRow(e)}getRowNode(e){let t;return this.forEachNode(i=>{i.id===e&&(t=i)}),t}forEachNode(e){this.infiniteCache&&this.infiniteCache.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),i=this.getRowCount()-1;return t>i?i:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){this.infiniteCache&&this.infiniteCache.refreshCache()}purgeCache(){this.infiniteCache&&this.infiniteCache.purgeCache()}isLastRowIndexKnown(){return this.infiniteCache?this.infiniteCache.isLastRowIndexKnown():!1}setRowCount(e,t){this.infiniteCache&&this.infiniteCache.setRowCount(e,t)}};function Hm(e){var t,i;(i=(t=e.rowModelHelperService)==null?void 0:t.getInfiniteRowModel())==null||i.refreshCache()}function Vm(e){var t,i;(i=(t=e.rowModelHelperService)==null?void 0:t.getInfiniteRowModel())==null||i.purgeCache()}function Nm(e){var t,i;return(i=(t=e.rowModelHelperService)==null?void 0:t.getInfiniteRowModel())==null?void 0:i.getRowCount()}var _s="32.3.2",Dn={version:_s,moduleName:"@ag-grid-community/infinite-row-model-core",rowModel:"infinite",beans:[km],dependantModules:[Gu]},Bm={version:_s,moduleName:"@ag-grid-community/infinite-row-model-api",beans:[Fn],apiFunctions:{refreshInfiniteCache:Hm,purgeInfiniteCache:Vm,getInfiniteRowCount:Nm},dependantModules:[Dn,em]},Wm={version:_s,moduleName:"@ag-grid-community/infinite-row-model",dependantModules:[Dn,Bm]};ye.__registerModules([vn,Rm,Wm,Im],!1,void 0);var zm=e=>typeof e=="symbol",_m=(e,t,i,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:i})};new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(zm));function rs(e){const t=e&&e.__v_raw;return t?rs(t):e}function ki(e){return Object.isExtensible(e)&&_m(e,"__v_skip",!0),e}var Um=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),Km=e=>`on${e.charAt(0).toUpperCase()}${e.substring(1,e.length)}`,En=e=>e&&(Object.isFrozen(e)?e:Po(An(e))),$m=()=>{const e={};he.PUBLIC_EVENTS.map(o=>Km(Um(o))).forEach(o=>e[o]=void 0);const i={},s={modelValue:{handler(o,r){!this.gridCreated||!this.api||o!==r&&(o&&r&&o.length===r.length&&o.every((n,l)=>n===r[l])||$i({rowData:o},this.api))},deep:!0}};return he.ALL_PROPERTIES.filter(o=>o!="gridOptions").forEach(o=>{e[o]={default:he.VUE_OMITTED_PROPERTY},s[o]={handler(r,n){let l=r;o==="rowData"&&r!=he.VUE_OMITTED_PROPERTY&&(l=En(r)),this.batchChanges[o]=l===he.VUE_OMITTED_PROPERTY?void 0:l,this.batchTimeout==null&&(this.batchTimeout=setTimeout(()=>{this.batchTimeout=null,$i(this.batchChanges,this.api),this.batchChanges=Po({})},0))},deep:!0}}),[e,i,s]};function Ro(e){O(`Could not find component with name of ${e}. Is it in Vue.components?`)}var ns=class Mn{static getComponentDefinition(t,i){let s;return typeof t=="string"?s=this.searchForComponentInstance(i,t):s={extends:bo({...t})},s||Ro(t),s.extends?(s.extends.setup&&(s.setup=s.extends.setup),s.extends.props=this.addParamsToProps(s.extends.props)):s.props=this.addParamsToProps(s.props),s}static addParamsToProps(t){return!t||Array.isArray(t)&&t.indexOf("params")===-1?t=["params",...t||[]]:typeof t=="object"&&!t.params&&(t.params={type:Object}),t}static createAndMountComponent(t,i,s,o){const r=Mn.getComponentDefinition(t,s);if(!r)return;const{vNode:n,destroy:l,el:a}=this.mount(r,{params:Object.freeze(i)},s,o||{});return{componentInstance:n.component.proxy,element:a,destroy:l}}static mount(t,i,s,o){let r=In(t,i);r.appContext=s.$.appContext,r.appContext.provides={...o,...r.appContext.provides?r.appContext.provides:{},...s.$parent.$options.provide?s.$parent.$options.provide:{}};let n=document.createElement("div");return Ks(r,n),{vNode:r,destroy:()=>{n&&Ks(null,n),n=null,r=null},el:n}}static searchForComponentInstance(t,i,s=10,o=!1){let r=null,n=t.$parent,l=0;for(;!r&&n&&n.$options&&++l<s;){const a=n;a.$options&&a.$options.components&&a.$options.components[i]?r=a.$options.components[i]:a[i]&&(r=a[i]),n=n.$parent}if(!r){const a=t.$.appContext.components;a&&a[i]&&(r=a[i])}return!r&&!o?(Ro(i),null):r}},jm=class Qt extends tm{constructor(t,i){super(),this.parent=t,Qt.provides||(Qt.provides=i)}createWrapper(t){const i=this;class s extends qm{init(n){super.init(n)}hasMethod(n){const l=o.getFrameworkComponentInstance();return l[n]?!0:l.$.setupState[n]!=null}callMethod(n,l){var h;const a=this.getFrameworkComponentInstance(),d=o.getFrameworkComponentInstance();return d[n]?d[n].apply(a,l):(h=d.$.setupState[n])==null?void 0:h.apply(a,l)}addMethod(n,l){o[n]=l}processMethod(n,l){return n==="refresh"&&(this.getFrameworkComponentInstance().params=l[0]),this.hasMethod(n)?this.callMethod(n,l):n==="refresh"}createComponent(n){return i.createComponent(t,n)}}const o=new s;return o}createComponent(t,i){return ns.createAndMountComponent(t,i,this.parent,Qt.provides)}createMethodProxy(t,i,s){return function(){return t.hasMethod(i)?t.callMethod(i,arguments):(s&&S("Framework component is missing the method "+i+"()"),null)}}destroy(){this.parent=null}},qm=class{getGui(){return this.element}destroy(){this.getFrameworkComponentInstance()&&typeof this.getFrameworkComponentInstance().destroy=="function"&&this.getFrameworkComponentInstance().destroy(),this.unmount()}getFrameworkComponentInstance(){return this.componentInstance}init(e){const{componentInstance:t,element:i,destroy:s}=this.createComponent(e);this.componentInstance=t,this.unmount=s,this.element=i.firstElementChild??i}},Ym=class extends hn{constructor(e){super("vue"),this.parent=e}frameworkComponent(e,t){let i=ns.searchForComponentInstance(this.parent,e,10,!0)?e:null;if(!i&&t&&t[e]){const s=t[e];i=ns.searchForComponentInstance(this.parent,s,10,!0)?s:null}return i}isFrameworkComponent(e){return typeof e=="object"}},Qm=new Set(["rowDataUpdated","cellValueChanged","rowValueChanged"]),Fo="onUpdate:modelValue",Xm="update:modelValue",[Jm,Zm,ev]=$m(),ov=bo({render(){return xn("div")},props:{gridOptions:{type:Object,default:()=>({})},componentDependencies:{type:Array,default:()=>[]},plugins:[],modules:{type:Array,default:()=>[]},modelValue:{type:Array,default:void 0,required:!1},...Jm},data(){return{api:void 0,gridCreated:!1,isDestroyed:!1,gridReadyFired:!1,emitRowModel:void 0,batchTimeout:null,batchChanges:ki({})}},computed:Zm,watch:ev,methods:{globalEventListenerFactory(e){return t=>{if(this.isDestroyed)return;t==="gridReady"&&(this.gridReadyFired=!0);const i=Et.has(t);i&&!e||!i&&e||this.updateModelIfUsed(t)}},processChanges(e,t,i){if(this.gridCreated){if(this.skipChange(e,t,i))return;const s={[e]:e==="rowData"?Object.isFrozen(t)?t:ki(rs(t)):t};$i(s,this.api)}},checkForBindingConflicts(){const e=this;(e.rowData&&e.rowData!=="AG-VUE-OMITTED-PROPERTY"||this.gridOptions.rowData)&&e.modelValue&&S("Using both rowData and v-model. rowData will be ignored.")},getRowData(){var t;const e=[];return(t=this.api)==null||t.forEachNode(i=>{e.push(i.data)}),e},updateModelIfUsed(e){this.gridReadyFired&&this.$attrs[Fo]&&Qm.has(e)&&this.emitRowModel&&this.emitRowModel()},getRowDataBasedOnBindings(){const e=this,t=e.modelValue;return t||(e.rowData?e.rowData:e.gridOptions.rowData)},getProvides(){let e=Tn(),t={};for(;e;)e&&e.provides&&(t={...t,...e.provides}),e=e.parent;return t},skipChange(e,t,i){if(this.gridReadyFired&&e==="rowData"&&this.$attrs[Fo]){if(t===i)return!0;if(t&&i){const s=t,o=i;if(s.length===o.length){for(let r=0;r<s.length;r++)if(s[r]!==o[r])return!1;return!0}}}return!1},debounce(e,t){let i;return()=>{const s=function(){e()};window.clearTimeout(i),i=window.setTimeout(s,t)}}},mounted(){this.emitRowModel=this.debounce(()=>{this.$emit(Xm,Object.freeze(this.getRowData()))},20);const e=this.getProvides(),t=new jm(this,e),i=ki(bl(rs(this.gridOptions),this));this.checkForBindingConflicts();const s=this.getRowDataBasedOnBindings();s!==he.VUE_OMITTED_PROPERTY&&(i.rowData=En(s));const o={globalEventListener:this.globalEventListenerFactory().bind(this),globalSyncEventListener:this.globalEventListenerFactory(!0).bind(this),frameworkOverrides:new Ym(this),providedBeanInstances:{frameworkComponentWrapper:t},modules:this.modules};this.api=UC(this.$el,i,o),this.gridCreated=!0},unmounted(){var e;this.gridCreated&&((e=this.api)==null||e.destroy(),this.isDestroyed=!0)}});export{ov as A};
| ver. 1.4 |
.
| PHP 8.1.32 | Generation time: 0.19 |
proxy
|
phpinfo
|
Settings