sd-webui-agent-scheduler/javascript/agent-scheduler.iife.js

345 lines
919 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

(function(){"use strict";/**
* @ag-grid-community/all-modules - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v30.0.5
* @link https://www.ag-grid.com/
* @license MIT
*/function li(l){return l==null||l===""?null:l}function R(l,e=!1){return l!=null&&(l!==""||e)}function x(l){return!R(l)}function Ve(l){return l==null||l.length===0}function zs(l){return l!=null&&typeof l.toString=="function"?l.toString():null}function Je(l){if(l===void 0)return;if(l===null||l==="")return null;if(typeof l=="number")return isNaN(l)?void 0:l;const e=parseInt(l,10);return isNaN(e)?void 0:e}function Pt(l){if(l!==void 0)return l===null||l===""?!1:typeof l=="boolean"?l:/true/i.test(l)}function au(l){if(!(l==null||l===""))return l}function du(l,e){return l==null&&e==null?!0:l==null&&e!=null||l!=null&&e==null?!1:l===e}function cu(l,e){const t=l?JSON.stringify(l):null,i=e?JSON.stringify(e):null;return t===i}function uu(l,e,t=!1){const i=l==null,s=e==null;if(l&&l.toNumber&&(l=l.toNumber()),e&&e.toNumber&&(e=e.toNumber()),i&&s)return 0;if(i)return-1;if(s)return 1;function o(n,r){return n>r?1:n<r?-1:0}if(typeof l!="string"||!t)return o(l,e);try{return l.localeCompare(e)}catch{return o(l,e)}}function Ii(l){if(l instanceof Set||l instanceof Map){const e=[];return l.forEach(t=>e.push(t)),e}return Object.values(l)}var hu=Object.freeze({__proto__:null,makeNull:li,exists:R,missing:x,missingOrEmpty:Ve,toStringOrNull:zs,attrToNumber:Je,attrToBoolean:Pt,attrToString:au,referenceCompare:du,jsonEquals:cu,defaultComparator:uu,values:Ii});class pu{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=zs(e);let i=0;for(;;){let s;if(e?(s=e,i!==0&&(s+="_"+i)):t?(s=t,i!==0&&(s+="_"+i)):s=""+i,!this.existingKeys[s])return this.existingKeys[s]=!0,s;i++}}}function se(l,e){l!=null&&(Array.isArray(l)?l.forEach((t,i)=>e(`${i}`,t)):Object.keys(l).forEach(t=>e(t,l[t])))}function Tr(l){const e={},t=Object.keys(l);for(let i=0;i<t.length;i++){const s=t[i],o=l[s];e[s]=o}return e}function gu(l){return JSON.parse(JSON.stringify(l))}function ln(l,e){if(!l)return;const t=l,i={};return Object.keys(t).forEach(s=>{if(e&&e.indexOf(s)>=0)return;const o=t[s];an(o)&&o.constructor===Object?i[s]=ln(o):i[s]=o}),i}function Fa(l,e){return l[e]}function La(l,e,t){l[e]=t}function fu(l,e,...t){t.forEach(i=>Ia(l,e,i))}function Ia(l,e,t,i){const s=Fa(l,t);s!==void 0&&La(e,t,i?i(s):s)}function Ma(l){const e={};return l.filter(t=>t!=null).forEach(t=>{Object.keys(t).forEach(i=>e[i]=null)}),Object.keys(e)}function At(l){if(!l)return[];const e=Object;if(typeof e.values=="function")return e.values(l);const t=[];for(const i in l)l.hasOwnProperty(i)&&l.propertyIsEnumerable(i)&&t.push(l[i]);return t}function Be(l,e,t=!0,i=!1){R(e)&&se(e,(s,o)=>{let n=l[s];n!==o&&(i&&n==null&&o!=null&&typeof o=="object"&&o.constructor===Object&&(n={},l[s]=n),an(o)&&an(n)&&!Array.isArray(n)?Be(n,o,t,i):(t||o!==void 0)&&(l[s]=o))})}function Cu(l){return x(l)||Object.keys(l).length===0}function mu(l,e,t){if(l==null)return t;const i=e.split(".");let s=l;for(;i.length>1;)if(s=s[i.shift()],s==null)return t;const o=s[i[0]];return o??t}function vu(l,e,t){if(l==null)return;const i=e.split(".");let s=l;i.forEach((o,n)=>{s[o]||(s[o]={}),n<i.length-1&&(s=s[o])}),s[i[i.length-1]]=t}function ss(l,e,t){if(!e||!l)return;if(!t)return l[e];const i=e.split(".");let s=l;for(let o=0;o<i.length;o++){if(s==null)return;s=s[i[o]]}return s}function Na(l,e){Object.keys(l).forEach(s=>{typeof l[s]=="object"&&(l[s]=void 0)});const t=Object.getPrototypeOf(l),i={};Object.keys(t).forEach(s=>{if(typeof t[s]=="function"){const n=()=>{console.warn(`AG Grid: ${e} function ${s}() cannot be called as the grid has been destroyed.
Please don't call grid API functions on destroyed grids - as a matter of fact you shouldn't
be keeping the API reference, your application has a memory leak! Remove the API reference
when the grid is destroyed.`)};i[s]={value:n,writable:!0}}}),Object.defineProperties(l,i)}function an(l){return typeof l=="object"&&l!==null}var wu=Object.freeze({__proto__:null,iterateObject:se,cloneObject:Tr,deepCloneObject:gu,deepCloneDefinition:ln,getProperty:Fa,setProperty:La,copyPropertiesIfPresent:fu,copyPropertyIfPresent:Ia,getAllKeysInObjects:Ma,getAllValuesInObject:At,mergeDeep:Be,missingOrEmptyObject:Cu,get:mu,set:vu,getValueUsingField:ss,removeAllReferences:Na,isNonNullObject:an});const _a={};function Y(l,e){_a[e]||(l(),_a[e]=!0)}function dn(l){if(l.name)return l.name;const e=/function\s+([^\(]+)/.exec(l.toString());return e&&e.length===2?e[1].trim():null}function cn(l){return!!(l&&l.constructor&&l.call&&l.apply)}function xa(l){Ga(l,400)}const Dr=[];let Or=!1;function Pr(l){Dr.push(l),!Or&&(Or=!0,window.setTimeout(()=>{const e=Dr.slice();Dr.length=0,Or=!1,e.forEach(t=>t())},0))}function Ga(l,e=0){l.length>0&&window.setTimeout(()=>l.forEach(t=>t()),e)}function Ft(l,e){let t;return function(...i){const s=this;window.clearTimeout(t),t=window.setTimeout(function(){l.apply(s,i)},e)}}function Ar(l,e){let t=0;return function(...i){const s=this,o=new Date().getTime();o-t<e||(t=o,l.apply(s,i))}}function Fr(l,e,t=100,i){const s=new Date().getTime();let o=null,n=!1;const r=()=>{const a=new Date().getTime()-s>t;(l()||a)&&(e(),n=!0,o!=null&&(window.clearInterval(o),o=null),a&&i&&console.warn(i))};r(),n||(o=window.setInterval(r,10))}function Su(...l){return e=>l.reduce((t,i)=>i(t),e)}function Ha(l){l&&l()}var Eu=Object.freeze({__proto__:null,doOnce:Y,getFunctionName:dn,isFunction:cn,executeInAWhile:xa,executeNextVMTurn:Pr,executeAfter:Ga,debounce:Ft,throttle:Ar,waitUntil:Fr,compose:Su,callIfPresent:Ha,noop:()=>{}}),N;(function(l){l.CommunityCoreModule="@ag-grid-community/core",l.InfiniteRowModelModule="@ag-grid-community/infinite-row-model",l.ClientSideRowModelModule="@ag-grid-community/client-side-row-model",l.CsvExportModule="@ag-grid-community/csv-export",l.EnterpriseCoreModule="@ag-grid-enterprise/core",l.RowGroupingModule="@ag-grid-enterprise/row-grouping",l.ColumnsToolPanelModule="@ag-grid-enterprise/column-tool-panel",l.FiltersToolPanelModule="@ag-grid-enterprise/filter-tool-panel",l.MenuModule="@ag-grid-enterprise/menu",l.SetFilterModule="@ag-grid-enterprise/set-filter",l.MultiFilterModule="@ag-grid-enterprise/multi-filter",l.StatusBarModule="@ag-grid-enterprise/status-bar",l.SideBarModule="@ag-grid-enterprise/side-bar",l.RangeSelectionModule="@ag-grid-enterprise/range-selection",l.MasterDetailModule="@ag-grid-enterprise/master-detail",l.RichSelectModule="@ag-grid-enterprise/rich-select",l.GridChartsModule="@ag-grid-enterprise/charts",l.ViewportRowModelModule="@ag-grid-enterprise/viewport-row-model",l.ServerSideRowModelModule="@ag-grid-enterprise/server-side-row-model",l.ExcelExportModule="@ag-grid-enterprise/excel-export",l.ClipboardModule="@ag-grid-enterprise/clipboard",l.SparklinesModule="@ag-grid-enterprise/sparklines",l.AngularModule="@ag-grid-community/angular",l.ReactModule="@ag-grid-community/react",l.VueModule="@ag-grid-community/vue"})(N||(N={}));class A{static register(e){A.__register(e,!0,void 0)}static registerModules(e){A.__registerModules(e,!0,void 0)}static __register(e,t,i){A.runVersionChecks(e),i!==void 0?(A.areGridScopedModules=!0,A.gridModulesMap[i]===void 0&&(A.gridModulesMap[i]={}),A.gridModulesMap[i][e.moduleName]=e):A.globalModulesMap[e.moduleName]=e,A.setModuleBased(t)}static __unRegisterGridModules(e){delete A.gridModulesMap[e]}static __registerModules(e,t,i){A.setModuleBased(t),e&&e.forEach(s=>A.__register(s,t,i))}static isValidModuleVersion(e){const[t,i]=e.version.split(".")||[],[s,o]=A.currentModuleVersion.split(".")||[];return t===s&&i===o}static runVersionChecks(e){if(A.currentModuleVersion||(A.currentModuleVersion=e.version),e.version?A.isValidModuleVersion(e)||console.error(`AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '${e.moduleName}' is version ${e.version} but the other modules are version ${this.currentModuleVersion}. Please update all modules to the same version.`):console.error(`AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '${e.moduleName}' is incompatible. Please update all modules to the same version.`),e.validate){const t=e.validate();t.isValid||console.error(`AG Grid: ${t.message}`)}}static setModuleBased(e){A.moduleBased===void 0?A.moduleBased=e:A.moduleBased!==e&&Y(()=>{console.warn("AG Grid: You are mixing modules (i.e. @ag-grid-community/core) and packages (ag-grid-community) - you can only use one or the other of these mechanisms."),console.warn("Please see https://www.ag-grid.com/javascript-grid/packages-modules/ for more information.")},"ModulePackageCheck")}static __setIsBundled(){A.isBundled=!0}static __assertRegistered(e,t,i){var s;if(this.__isRegistered(e,i))return!0;const o=t+e;let n;if(A.isBundled)n=`AG Grid: unable to use ${t} 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(A.moduleBased||A.moduleBased===void 0){let r=(s=Object.entries(N).find(([a,d])=>d===e))===null||s===void 0?void 0:s[0];n=`AG Grid: unable to use ${t} as the ${r} is not registered${A.areGridScopedModules?` for gridId: ${i}`:""}. Check if you have registered the module:
import { ModuleRegistry } from '@ag-grid-community/core';
import { ${r} } from '${e}';
ModuleRegistry.registerModules([ ${r} ]);
For more info see: https://www.ag-grid.com/javascript-grid/modules/`}else n=`AG Grid: unable to use ${t} as package 'ag-grid-enterprise' has not been imported. Check that you have imported the package:
import 'ag-grid-enterprise';
For more info see: https://www.ag-grid.com/javascript-grid/packages/`;return Y(()=>{console.warn(n)},o),!1}static __isRegistered(e,t){var i;return!!A.globalModulesMap[e]||!!(!((i=A.gridModulesMap[t])===null||i===void 0)&&i[e])}static __getRegisteredModules(e){return[...Ii(A.globalModulesMap),...Ii(A.gridModulesMap[e]||{})]}static __getGridRegisteredModules(e){var t;return Ii((t=A.gridModulesMap[e])!==null&&t!==void 0?t:{})||[]}static __isPackageBased(){return!A.moduleBased}}A.globalModulesMap={},A.gridModulesMap={},A.areGridScopedModules=!1;class yu{constructor(e,t){if(this.beanWrappers={},this.destroyed=!1,!e||!e.beanClasses)return;this.contextParams=e,this.logger=t,this.logger.log(">> creating ag-Application Context"),this.createBeans();const i=this.getBeanInstances();this.wireBeans(i),this.logger.log(">> ag-Application Context ready - component is alive")}getBeanInstances(){return Ii(this.beanWrappers).map(e=>e.beanInstance)}createBean(e,t){if(!e)throw Error("Can't wire to bean since it is null");return this.wireBeans([e],t),e}wireBeans(e,t){this.autoWireBeans(e),this.methodWireBeans(e),this.callLifeCycleMethods(e,"preConstructMethods"),R(t)&&e.forEach(t),this.callLifeCycleMethods(e,"postConstructMethods")}createBeans(){this.contextParams.beanClasses.forEach(this.createBeanWrapper.bind(this)),se(this.beanWrappers,(t,i)=>{let s;i.bean.__agBeanMetaData&&i.bean.__agBeanMetaData.autowireMethods&&i.bean.__agBeanMetaData.autowireMethods.agConstructor&&(s=i.bean.__agBeanMetaData.autowireMethods.agConstructor);const o=this.getBeansForParameters(s,i.bean.name),n=new(i.bean.bind.apply(i.bean,[null,...o]));i.beanInstance=n});const e=Object.keys(this.beanWrappers).join(", ");this.logger.log(`created beans: ${e}`)}createBeanWrapper(e){const t=e.__agBeanMetaData;if(!t){let s;e.prototype.constructor?s=dn(e.prototype.constructor):s=""+e,console.error(`Context item ${s} is not a bean`);return}const i={bean:e,beanInstance:null,beanName:t.beanName};this.beanWrappers[t.beanName]=i}autoWireBeans(e){e.forEach(t=>{this.forEachMetaDataInHierarchy(t,(i,s)=>{const o=i.agClassAttributes;o&&o.forEach(n=>{const r=this.lookupBeanInstance(s,n.beanName,n.optional);t[n.attributeName]=r})})})}methodWireBeans(e){e.forEach(t=>{this.forEachMetaDataInHierarchy(t,(i,s)=>{se(i.autowireMethods,(o,n)=>{if(o==="agConstructor")return;const r=this.getBeansForParameters(n,s);t[o].apply(t,r)})})})}forEachMetaDataInHierarchy(e,t){let i=Object.getPrototypeOf(e);for(;i!=null;){const s=i.constructor;if(s.hasOwnProperty("__agBeanMetaData")){const o=s.__agBeanMetaData,n=this.getBeanName(s);t(o,n)}i=Object.getPrototypeOf(i)}}getBeanName(e){if(e.__agBeanMetaData&&e.__agBeanMetaData.beanName)return e.__agBeanMetaData.beanName;const t=e.toString();return t.substring(9,t.indexOf("("))}getBeansForParameters(e,t){const i=[];return e&&se(e,(s,o)=>{const n=this.lookupBeanInstance(t,o);i[Number(s)]=n}),i}lookupBeanInstance(e,t,i=!1){if(this.destroyed)return this.logger.log(`AG Grid: bean reference ${t} is used after the grid is destroyed!`),null;if(t==="context")return this;if(this.contextParams.providedBeanInstances&&this.contextParams.providedBeanInstances.hasOwnProperty(t))return this.contextParams.providedBeanInstances[t];const s=this.beanWrappers[t];return s?s.beanInstance:(i||console.error(`AG Grid: unable to find bean reference ${t} while initialising ${e}`),null)}callLifeCycleMethods(e,t){e.forEach(i=>this.callLifeCycleMethodsOnBean(i,t))}callLifeCycleMethodsOnBean(e,t,i){const s={};this.forEachMetaDataInHierarchy(e,n=>{const r=n[t];r&&r.forEach(a=>{a!=i&&(s[a]=!0)})}),Object.keys(s).forEach(n=>e[n]())}getBean(e){return this.lookupBeanInstance("getBean",e,!0)}destroy(){if(this.destroyed)return;this.logger.log(">> Shutting down ag-Application Context");const e=this.getBeanInstances();this.destroyBeans(e),this.contextParams.providedBeanInstances=null,A.__unRegisterGridModules(this.contextParams.gridId),this.destroyed=!0,this.logger.log(">> ag-Application Context shut down - component is dead")}destroyBean(e){e&&this.destroyBeans([e])}destroyBeans(e){return e?(e.forEach(t=>{this.callLifeCycleMethodsOnBean(t,"preDestroyMethods","destroy");const i=t;typeof i.destroy=="function"&&i.destroy()}),[]):[]}isDestroyed(){return this.destroyed}getGridId(){return this.contextParams.gridId}}function Va(l,e,t){const i=Mi(l.constructor);i.preConstructMethods||(i.preConstructMethods=[]),i.preConstructMethods.push(e)}function D(l,e,t){const i=Mi(l.constructor);i.postConstructMethods||(i.postConstructMethods=[]),i.postConstructMethods.push(e)}function he(l,e,t){const i=Mi(l.constructor);i.preDestroyMethods||(i.preDestroyMethods=[]),i.preDestroyMethods.push(e)}function M(l){return e=>{const t=Mi(e);t.beanName=l}}function p(l){return(e,t,i)=>{Ba(e,l,!1,e,t,null)}}function X(l){return(e,t,i)=>{Ba(e,l,!0,e,t,null)}}function Ba(l,e,t,i,s,o){if(e===null){console.error("AG Grid: Autowired name should not be null");return}if(typeof o=="number"){console.error("AG Grid: Autowired should be on an attribute");return}const n=Mi(l.constructor);n.agClassAttributes||(n.agClassAttributes=[]),n.agClassAttributes.push({attributeName:s,beanName:e,optional:t})}function Te(l){return(e,t,i)=>{const s=typeof e=="function"?e:e.constructor;let o;if(typeof i=="number"){let n;t?(o=Mi(s),n=t):(o=Mi(s),n="agConstructor"),o.autowireMethods||(o.autowireMethods={}),o.autowireMethods[n]||(o.autowireMethods[n]={}),o.autowireMethods[n][i]=l}}}function Mi(l){return l.hasOwnProperty("__agBeanMetaData")||(l.__agBeanMetaData={}),l.__agBeanMetaData}var Wa=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},un=function(l,e){return function(t,i){e(t,i,l)}};let gt=class{constructor(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}setBeans(e,t,i,s=null){if(this.frameworkOverrides=i,this.gridOptionsService=t,s){const o=t.useAsyncEvents();this.addGlobalListener(s,o)}}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){let t=e;if(this.gridOptionsService){const{api:i,columnApi:s,context:o}=this.gridOptionsService;t.api=i,t.columnApi=s,t.context=o}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 r=e.event;r instanceof Event&&(e.eventPath=r.composedPath())}const s=r=>r.forEach(a=>{t?this.dispatchAsync(()=>a(e)):a(e)}),o=new Set(this.getListeners(i,t,!1));o&&s(o),new Set(t?this.globalAsyncListeners:this.globalSyncListeners).forEach(r=>{t?this.dispatchAsync(()=>this.frameworkOverrides.dispatchEvent(i,()=>r(i,e),!0)):this.frameworkOverrides.dispatchEvent(i,()=>r(i,e),!0)})}dispatchAsync(e){this.asyncFunctionsQueue.push(e),this.scheduled||(window.setTimeout(this.flushAsyncQueue.bind(this),0),this.scheduled=!0)}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[],e.forEach(t=>t())}};Wa([un(0,Te("loggerFactory")),un(1,Te("gridOptionsService")),un(2,Te("frameworkOverrides")),un(3,Te("globalEventListener"))],gt.prototype,"setBeans",null),gt=Wa([M("eventService")],gt);var hn=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let Ru=0;function ka(){return Ru++}class H{constructor(e,t,i,s){this.instanceId=ka(),this.autoHeaderHeight=null,this.moving=!1,this.menuVisible=!1,this.filterActive=!1,this.eventService=new gt,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.colDef=e,this.userProvidedColDef=t,this.colId=i,this.primary=s,this.setState(e)}getInstanceId(){return this.instanceId}setState(e){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=Je(e.sortIndex),i=Je(e.initialSortIndex);t!==void 0?t!==null&&(this.sortIndex=t):i!==null&&(this.sortIndex=i);const s=Pt(e.hide),o=Pt(e.initialHide);s!==void 0?this.visible=!s:this.visible=!o,e.pinned!==void 0?this.setPinned(e.pinned):this.setPinned(e.initialPinned);const n=Je(e.flex),r=Je(e.initialFlex);n!==void 0?this.flex=n:r!==void 0&&(this.flex=r)}setColDef(e,t){this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.eventService.dispatchEvent(this.createColumnEvent("colDefChanged","api"))}getUserProvidedColDef(){return this.userProvidedColDef}setParent(e){this.parent=e}getParent(){return this.parent}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}initialise(){this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip(),this.validate()}initDotNotation(){const e=this.gridOptionsService.is("suppressFieldDotNotation");this.fieldContainsDots=R(this.colDef.field)&&this.colDef.field.indexOf(".")>=0&&!e,this.tooltipFieldContainsDots=R(this.colDef.tooltipField)&&this.colDef.tooltipField.indexOf(".")>=0&&!e}initMinAndMaxWidths(){const e=this.colDef;this.minWidth=this.columnUtils.calculateColMinWidth(e),this.maxWidth=this.columnUtils.calculateColMaxWidth(e)}initTooltip(){this.tooltipEnabled=R(this.colDef.tooltipField)||R(this.colDef.tooltipValueGetter)||R(this.colDef.tooltipComponent)}resetActualWidth(e="api"){const t=this.columnUtils.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){if(x(this.colDef)||x(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}validate(){const e=this.colDef;function t(s,o,n){Y(()=>{n?console.warn(s,n):Y(()=>console.warn(s),o)},o)}if(this.gridOptionsService.isRowModelType("clientSide")&&!A.__isRegistered(N.RowGroupingModule,this.gridOptionsService.getGridId())){const o=["enableRowGroup","rowGroup","rowGroupIndex","enablePivot","enableValue","pivot","pivotIndex","aggFunc"].filter(n=>R(e[n]));o.length>0&&A.__assertRegistered(N.RowGroupingModule,o.map(n=>"colDef."+n).join(", "),this.gridOptionsService.getGridId())}if((this.colDef.cellEditor==="agRichSelect"||this.colDef.cellEditor==="agRichSelectCellEditor")&&A.__assertRegistered(N.RichSelectModule,this.colDef.cellEditor,this.gridOptionsService.getGridId()),this.gridOptionsService.isTreeData()){const o=["rowGroup","rowGroupIndex","pivot","pivotIndex"].filter(n=>R(e[n]));o.length>0&&t(`AG Grid: ${o.join()} is not possible when doing tree data, your column definition should not have ${o.join()}`,"TreeDataCannotRowGroup")}if(R(e.menuTabs))if(Array.isArray(e.menuTabs)){const s=["filterMenuTab"],o=["columnsMenuTab","generalMenuTab"],n=o.filter(r=>e.menuTabs.includes(r));n.length>0&&A.__assertRegistered(N.MenuModule,`menuTab(s): ${n.map(r=>`'${r}'`).join()}`,this.gridOptionsService.getGridId()),e.menuTabs.forEach(r=>{!o.includes(r)&&!s.includes(r)&&t(`AG Grid: '${r}' is not valid for 'colDef.menuTabs'. Valid values are: ${[...s,...o].map(a=>`'${a}'`).join()}.`,"wrongValue_menuTabs_"+r)})}else t("AG Grid: The typeof 'colDef.menuTabs' should be an array not:"+typeof e.menuTabs,"wrongType_menuTabs");R(e.columnsMenuParams)&&A.__assertRegistered(N.MenuModule,"columnsMenuParams",this.gridOptionsService.getGridId()),R(e.columnsMenuParams)&&A.__assertRegistered(N.ColumnsToolPanelModule,"columnsMenuParams",this.gridOptionsService.getGridId()),R(this.colDef.width)&&typeof this.colDef.width!="number"&&t("AG Grid: colDef.width should be a number, not "+typeof this.colDef.width,"ColumnCheck"),R(e.columnGroupShow)&&e.columnGroupShow!=="closed"&&e.columnGroupShow!=="open"&&t(`AG Grid: '${e.columnGroupShow}' is not valid for columnGroupShow. Valid values are 'open', 'closed', undefined, null`,"columnGroupShow_invalid")}addEventListener(e,t){this.eventService.addEventListener(e,t)}removeEventListener(e,t){this.eventService.removeEventListener(e,t)}createColumnFunctionCallbackParams(e){return{node:e,data:e.data,column:this,colDef:this.colDef,context:this.gridOptionsService.context,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi}}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){return e.group&&!this.gridOptionsService.is("enableGroupEdit")?!1:this.isColumnFunc(e,this.colDef.editable)}isSuppressFillHandle(){return!!Pt(this.colDef.suppressFillHandle)}isAutoHeight(){return!!Pt(this.colDef.autoHeight)}isAutoHeaderHeight(){return!!Pt(this.colDef.autoHeaderHeight)}isRowDrag(e){return this.isColumnFunc(e,this.colDef.rowDrag)}isDndSource(e){return this.isColumnFunc(e,this.colDef.dndSource)}isCellCheckboxSelection(e){return this.isColumnFunc(e,this.colDef.checkboxSelection)}isSuppressPaste(e){return this.isColumnFunc(e,this.colDef?this.colDef.suppressPaste:null)}isResizable(){return!!Pt(this.colDef.resizable)}isColumnFunc(e,t){if(typeof t=="boolean")return t;if(typeof t=="function"){const i=this.createColumnFunctionCallbackParams(e);return t(i)}return!1}setMoving(e,t="api"){this.moving=e,this.eventService.dispatchEvent(this.createColumnEvent("movingChanged",t))}createColumnEvent(e,t){return{type:e,column:this,columns:[this],source:t,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context}}isMoving(){return this.moving}getSort(){return this.sort}setSort(e,t="api"){this.sort!==e&&(this.sort=e,this.eventService.dispatchEvent(this.createColumnEvent("sortChanged",t))),this.dispatchStateUpdatedEvent("sort")}setMenuVisible(e,t="api"){this.menuVisible!==e&&(this.menuVisible=e,this.eventService.dispatchEvent(this.createColumnEvent("menuVisibleChanged",t)))}isMenuVisible(){return this.menuVisible}isSortAscending(){return this.sort==="asc"}isSortDescending(){return this.sort==="desc"}isSortNone(){return x(this.sort)}isSorting(){return R(this.sort)}getSortIndex(){return this.sortIndex}setSortIndex(e){this.sortIndex=e,this.dispatchStateUpdatedEvent("sortIndex")}setAggFunc(e){this.aggFunc=e,this.dispatchStateUpdatedEvent("aggFunc")}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(e,t="api"){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.eventService.dispatchEvent(this.createColumnEvent("leftChanged",t)))}isFilterActive(){return this.filterActive}setFilterActive(e,t="api",i){this.filterActive!==e&&(this.filterActive=e,this.eventService.dispatchEvent(this.createColumnEvent("filterActiveChanged",t)));const s=this.createColumnEvent("filterChanged",t);i&&Be(s,i),this.eventService.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="api"){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.eventService.dispatchEvent(this.createColumnEvent("firstRightPinnedChanged",t)))}setLastLeftPinned(e,t="api"){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.eventService.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="api"){const i=e===!0;this.visible!==i&&(this.visible=i,this.eventService.dispatchEvent(this.createColumnEvent("visibleChanged",t))),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){const e=this.getColDef();return!e.suppressSpanHeaderHeight&&!e.autoHeaderHeight}getColDef(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getDefinition(){return this.colDef}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}createBaseColDefParams(e){return{node:e,data:e.data,colDef:this.colDef,column:this,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context}}getColSpan(e){if(x(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.colSpan(t);return Math.max(i,1)}getRowSpan(e){if(x(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.rowSpan(t);return Math.max(i,1)}setActualWidth(e,t="api",i=!1){this.minWidth!=null&&(e=Math.max(e,this.minWidth)),this.maxWidth!=null&&(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.eventService.dispatchEvent(this.createColumnEvent("widthChanged",e))}isGreaterThanMax(e){return this.maxWidth!=null?e>this.maxWidth:!1}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="api"){R(this.minWidth)&&this.setActualWidth(this.minWidth,e)}setRowGroupActive(e,t="api"){this.rowGroupActive!==e&&(this.rowGroupActive=e,this.eventService.dispatchEvent(this.createColumnEvent("columnRowGroupChanged",t))),this.dispatchStateUpdatedEvent("rowGroup")}isRowGroupActive(){return this.rowGroupActive}setPivotActive(e,t="api"){this.pivotActive!==e&&(this.pivotActive=e,this.eventService.dispatchEvent(this.createColumnEvent("columnPivotChanged",t))),this.dispatchStateUpdatedEvent("pivot")}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}setValueActive(e,t="api"){this.aggregationActive!==e&&(this.aggregationActive=e,this.eventService.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}getMenuTabs(e){let t=this.getColDef().menuTabs;return t==null&&(t=e),t}dispatchStateUpdatedEvent(e){this.eventService.dispatchEvent({type:H.EVENT_STATE_UPDATED,key:e})}}H.EVENT_MOVING_CHANGED="movingChanged",H.EVENT_LEFT_CHANGED="leftChanged",H.EVENT_WIDTH_CHANGED="widthChanged",H.EVENT_LAST_LEFT_PINNED_CHANGED="lastLeftPinnedChanged",H.EVENT_FIRST_RIGHT_PINNED_CHANGED="firstRightPinnedChanged",H.EVENT_VISIBLE_CHANGED="visibleChanged",H.EVENT_FILTER_CHANGED="filterChanged",H.EVENT_FILTER_ACTIVE_CHANGED="filterActiveChanged",H.EVENT_SORT_CHANGED="sortChanged",H.EVENT_COL_DEF_CHANGED="colDefChanged",H.EVENT_MENU_VISIBLE_CHANGED="menuVisibleChanged",H.EVENT_ROW_GROUP_CHANGED="columnRowGroupChanged",H.EVENT_PIVOT_CHANGED="columnPivotChanged",H.EVENT_VALUE_CHANGED="columnValueChanged",H.EVENT_STATE_UPDATED="columnStateUpdated",hn([p("gridOptionsService")],H.prototype,"gridOptionsService",void 0),hn([p("columnUtils")],H.prototype,"columnUtils",void 0),hn([p("columnHoverService")],H.prototype,"columnHoverService",void 0),hn([D],H.prototype,"initialise",null);var bu=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class ee{constructor(e,t,i,s){this.localEventService=new gt,this.expandable=!1,this.instanceId=ka(),this.expandableListenerRemoveCallback=null,this.colGroupDef=e,this.groupId=t,this.expanded=!!e&&!!e.openByDefault,this.padding=i,this.level=s}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0)}reset(e,t){this.colGroupDef=e,this.level=t,this.originalParent=null,this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback(),this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){return this.children?this.children.some(e=>e.isVisible()):!1}isPadding(){return this.padding}setExpanded(e){this.expanded=e===void 0?!1:e;const t={type:ee.EVENT_EXPANDED_CHANGED};this.localEventService.dispatchEvent(t)}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=>{t instanceof H?e.push(t):t instanceof ee&&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 n=0,r=s.length;n<r;n++){const a=s[n];if(!a.isVisible())continue;const d=a.getColumnGroupShow();d==="open"?(e=!0,i=!0):d==="closed"?(t=!0,i=!0):(e=!0,t=!0)}const o=e&&t&&i;if(this.expandable!==o){this.expandable=o;const n={type:ee.EVENT_EXPANDABLE_CHANGED};this.localEventService.dispatchEvent(n)}}findChildrenRemovingPadding(){const e=[],t=i=>{i.forEach(s=>{s instanceof ee&&s.isPadding()?t(s.children):e.push(s)})};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}}ee.EVENT_EXPANDED_CHANGED="expandedChanged",ee.EVENT_EXPANDABLE_CHANGED="expandableChanged",bu([he],ee.prototype,"destroy",null);const Tu={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}};function Ua(...l){for(let e=0;e<l.length;e++){const t=l[e];if(R(t))return t}return null}function Du(l){return l!=null&&l.length>0}function Z(l){if(!(!l||!l.length))return l[l.length-1]}function ai(l,e,t){return l==null&&e==null?!0:l!=null&&e!=null&&l.length===e.length&&l.every((i,s)=>t?t(i,e[s]):e[s]===i)}function Ou(l,e){return ai(l,e)}function ja(l){return l.sort((e,t)=>e-t)}function Pu(l,e){if(l)for(let t=l.length-2;t>=0;t--){const i=l[t]===e,s=l[t+1]===e;i&&s&&l.splice(t+1,1)}}function ve(l,e){const t=l.indexOf(e);t>=0&&l.splice(t,1)}function Lr(l,e){e.forEach(t=>ve(l,t))}function $s(l,e,t){l.splice(t,0,e)}function Au(l,e,t){if(!(l==null||e==null))for(let i=e.length-1;i>=0;i--){const s=e[i];$s(l,s,t)}}function Ir(l,e,t){Lr(l,e),e.slice().reverse().forEach(i=>$s(l,i,t))}function Ze(l,e){return l.indexOf(e)>-1}function za(l){return[].concat.apply([],l)}function Mr(l,e){e==null||l==null||e.forEach(t=>l.push(t))}function Fu(l){return l.map(zs)}function Lu(l,e){if(l!=null)for(let t=l.length-1;t>=0;t--)e(l[t],t)}var Iu=Object.freeze({__proto__:null,firstExistingValue:Ua,existsAndNotEmpty:Du,last:Z,areEqual:ai,shallowCompare:Ou,sortNumerically:ja,removeRepeatsFromArray:Pu,removeFromArray:ve,removeAllFromArray:Lr,insertIntoArray:$s,insertArrayIntoArray:Au,moveInArray:Ir,includes:Ze,flatten:za,pushAll:Mr,toStrings:Fu,forEachReverse:Lu});const $a="__ag_Grid_Stop_Propagation",Mu=["touchstart","touchend","touchmove","touchcancel","scroll"],Nr={};function qt(l){l[$a]=!0}function Lt(l){return l[$a]===!0}const _r=(()=>{const l={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return t=>{if(typeof Nr[t]=="boolean")return Nr[t];const i=document.createElement(l[t]||"div");return t="on"+t,Nr[t]=t in i}})();function pn(l,e,t){let i=e;for(;i;){const s=l.getDomData(i,t);if(s)return s;i=i.parentElement}return null}function gn(l,e){return!e||!l?!1:Ya(e).indexOf(l)>=0}function Ka(l){const e=[];let t=l.target;for(;t;)e.push(t),t=t.parentElement;return e}function Ya(l){const e=l;return e.path?e.path:e.composedPath?e.composedPath():Ka(e)}function qa(l,e,t,i){const o=Ze(Mu,t)?{passive:!0}:void 0;l&&l.addEventListener&&l.addEventListener(e,t,i,o)}var Nu=Object.freeze({__proto__:null,stopPropagationForAgGrid:qt,isStopPropagationForAgGrid:Lt,isEventSupported:_r,getCtrlForEventTarget:pn,isElementInEventPath:gn,createEventPath:Ka,getEventPath:Ya,addSafePassiveEventListener:qa}),Ni=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class T{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.isAlive=()=>!this.destroyed}getFrameworkOverrides(){return this.frameworkOverrides}getContext(){return this.context}destroy(){this.destroyFunctions.forEach(e=>e()),this.destroyFunctions.length=0,this.destroyed=!0,this.dispatchEvent({type:T.EVENT_DESTROYED})}addEventListener(e,t){this.localEventService||(this.localEventService=new gt),this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService&&this.localEventService.removeEventListener(e,t)}dispatchEventAsync(e){window.setTimeout(()=>this.dispatchEvent(e),0)}dispatchEvent(e){this.localEventService&&this.localEventService.dispatchEvent(e)}addManagedListener(e,t,i){if(this.destroyed)return;e instanceof HTMLElement?qa(this.getFrameworkOverrides(),e,t,i):e.addEventListener(t,i);const s=()=>(e.removeEventListener(t,i),this.destroyFunctions=this.destroyFunctions.filter(o=>o!==s),null);return this.destroyFunctions.push(s),s}addManagedPropertyListener(e,t){if(this.destroyed)return;this.gridOptionsService.addEventListener(e,t);const i=()=>(this.gridOptionsService.removeEventListener(e,t),this.destroyFunctions=this.destroyFunctions.filter(s=>s!==i),null);return this.destroyFunctions.push(i),i}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createManagedBean(e,t){const i=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),i}createBean(e,t,i){return(t||this.getContext()).createBean(e,i)}destroyBean(e,t){return(t||this.getContext()).destroyBean(e)}destroyBeans(e,t){return e&&e.forEach(i=>this.destroyBean(i,t)),[]}}T.EVENT_DESTROYED="destroyed",Ni([p("frameworkOverrides")],T.prototype,"frameworkOverrides",void 0),Ni([p("context")],T.prototype,"context",void 0),Ni([p("eventService")],T.prototype,"eventService",void 0),Ni([p("gridOptionsService")],T.prototype,"gridOptionsService",void 0),Ni([p("localeService")],T.prototype,"localeService",void 0),Ni([p("environment")],T.prototype,"environment",void 0),Ni([he],T.prototype,"destroy",null);var fn=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},_u=function(l,e){return function(t,i){e(t,i,l)}};let os=class extends T{setBeans(e){this.logger=e.create("ColumnFactory")}createColumnTree(e,t,i){const s=new pu,{existingCols:o,existingGroups:n,existingColKeys:r}=this.extractExistingTreeData(i);s.addExistingKeys(r);const a=this.recursivelyCreateColumns(e,0,t,o,s,n),d=this.findMaxDept(a,0);this.logger.log("Number of levels for grouped columns is "+d);const c=this.balanceColumnTree(a,0,d,s),h=(g,f)=>{g instanceof ee&&g.setupExpandable(),g.setOriginalParent(f)};return this.columnUtils.depthFirstOriginalTreeSearch(null,c,h),{columnTree:c,treeDept:d}}extractExistingTreeData(e){const t=[],i=[],s=[];return e&&this.columnUtils.depthFirstOriginalTreeSearch(null,e,o=>{if(o instanceof ee){const n=o;i.push(n)}else{const n=o;s.push(n.getId()),t.push(n)}}),{existingCols:t,existingGroups:i,existingColKeys:s}}createForAutoGroups(e,t){return e.map(i=>this.createAutoGroupTreeItem(t,i))}createAutoGroupTreeItem(e,t){const i=this.findDepth(e);let s=t;for(let o=i-1;o>=0;o--){const n=new ee(null,`FAKE_PATH_${t.getId()}}_${o}`,!0,o);this.createBean(n),n.setChildren([s]),s.setOriginalParent(n),s=n}return s}findDepth(e){let t=0,i=e;for(;i&&i[0]&&i[0]instanceof ee;)t++,i=i[0].getChildren();return t}balanceColumnTree(e,t,i,s){const o=[];for(let n=0;n<e.length;n++){const r=e[n];if(r instanceof ee){const a=r,d=this.balanceColumnTree(a.getChildren(),t+1,i,s);a.setChildren(d),o.push(a)}else{let a,d;for(let c=i-1;c>=t;c--){const h=s.getUniqueKey(null,null),g=this.createMergedColGroupDef(null),f=new ee(g,h,!0,t);this.createBean(f),d&&d.setChildren([f]),d=f,a||(a=d)}if(a&&d)if(o.push(a),e.some(h=>h instanceof ee)){d.setChildren([r]);continue}else{d.setChildren(e);break}o.push(r)}}return o}findMaxDept(e,t){let i=t;for(let s=0;s<e.length;s++){const o=e[s];if(o instanceof ee){const n=o,r=this.findMaxDept(n.getChildren(),t+1);i<r&&(i=r)}}return i}recursivelyCreateColumns(e,t,i,s,o,n){return(e||[]).map(r=>this.isColumnGroup(r)?this.createColumnGroup(i,r,t,s,o,n):this.createColumn(i,r,s,o))}createColumnGroup(e,t,i,s,o,n){const r=this.createMergedColGroupDef(t),a=o.getUniqueKey(r.groupId||null,null),d=new ee(r,a,!1,i);this.createBean(d);const c=this.findExistingGroup(t,n);c&&ve(n,c),c&&c.isExpanded()&&d.setExpanded(!0);const h=this.recursivelyCreateColumns(r.children,i+1,e,s,o,n);return d.setChildren(h),d}createMergedColGroupDef(e){const t={};return Object.assign(t,this.gridOptionsService.get("defaultColGroupDef")),Object.assign(t,e),t}createColumn(e,t,i,s){let o=this.findExistingColumn(t,i);if(i&&o&&ve(i,o),o){const n=this.mergeColDefs(t,o.getColId());o.setColDef(n,t),this.applyColumnState(o,n)}else{const n=s.getUniqueKey(t.colId,t.field),r=this.mergeColDefs(t,n);o=new H(r,t,n,e),this.context.createBean(o)}return this.dataTypeService.addColumnListeners(o),o}applyColumnState(e,t){const i=Je(t.flex);if(i!==void 0&&e.setFlex(i),e.getFlex()<=0){const r=Je(t.width);if(r!=null)e.setActualWidth(r);else{const a=e.getActualWidth();e.setActualWidth(a)}}t.sort!==void 0&&(t.sort=="asc"||t.sort=="desc"?e.setSort(t.sort):e.setSort(void 0));const o=Je(t.sortIndex);o!==void 0&&e.setSortIndex(o);const n=Pt(t.hide);n!==void 0&&e.setVisible(!n),t.pinned!==void 0&&e.setPinned(t.pinned)}findExistingColumn(e,t){return(t||[]).find(i=>{const s=i.getUserProvidedColDef();if(!s)return!1;const o=e.colId!=null,n=e.field!=null;return o?i.getId()===e.colId:n?s.field===e.field:s===e})}findExistingGroup(e,t){return t.find(i=>i.getColGroupDef()&&e.groupId!=null?i.getId()===e.groupId:!1)}mergeColDefs(e,t){const i={},s=this.gridOptionsService.get("defaultColDef");Be(i,s,!1,!0);const o=this.dataTypeService.updateColDefAndGetColumnType(i,e,t);o&&this.assignColumnTypes(o,i),Be(i,e,!1,!0);const n=this.gridOptionsService.get("autoGroupColumnDef"),r=this.gridOptionsService.isColumnsSortingCoupledToGroup();return e.rowGroup&&n&&r&&Be(i,{sort:n.sort,initialSort:n.initialSort},!1,!0),this.dataTypeService.validateColDef(i),i}assignColumnTypes(e,t){if(!e.length)return;const i=Object.assign({},Tu),s=this.gridOptionsService.get("columnTypes")||{};se(s,(o,n)=>{o in i?console.warn(`AG Grid: the column type '${o}' is a default column type and cannot be overridden.`):i[o]=n}),e.forEach(o=>{const n=i[o.trim()];n?Be(t,n,!1,!0):console.warn("AG Grid: colDef.type '"+o+"' does not correspond to defined gridOptions.columnTypes")})}isColumnGroup(e){return e.children!==void 0}};fn([p("columnUtils")],os.prototype,"columnUtils",void 0),fn([p("dataTypeService")],os.prototype,"dataTypeService",void 0),fn([_u(0,Te("loggerFactory"))],os.prototype,"setBeans",null),os=fn([M("columnFactory")],os);var xu=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class te{constructor(e,t,i,s){this.displayedChildren=[],this.localEventService=new gt,this.groupId=t,this.partId=i,this.providedColumnGroup=e,this.pinned=s}static createUniqueId(e,t){return e+"_"+t}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}setParent(e){this.parent=e}getUniqueId(){return te.createUniqueId(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=>{e instanceof te&&e.checkLeft()}),this.displayedChildren.length>0)if(this.gridOptionsService.is("enableRtl")){const t=Z(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=e,this.left!==e&&(this.left=e,this.localEventService.dispatchEvent(this.createAgEvent(te.EVENT_LEFT_CHANGED)))}getPinned(){return this.pinned}createAgEvent(e){return{type:e}}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}getGroupId(){return this.groupId}getPartId(){return this.partId}isChildInThisGroupDeepSearch(e){let t=!1;return this.children.forEach(i=>{e===i&&(t=!0),i instanceof te&&i.isChildInThisGroupDeepSearch(e)&&(t=!0)}),t}getActualWidth(){let e=0;return this.displayedChildren&&this.displayedChildren.forEach(t=>{e+=t.getActualWidth()}),e}isResizable(){if(!this.displayedChildren)return!1;let e=!1;return this.displayedChildren.forEach(t=>{t.isResizable()&&(e=!0)}),e}getMinWidth(){let e=0;return this.displayedChildren.forEach(t=>{e+=t.getMinWidth()||0}),e}addChild(e){this.children||(this.children=[]),this.children.push(e)}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}getDisplayedLeafColumns(){const e=[];return this.addDisplayedLeafColumns(e),e}getDefinition(){return this.providedColumnGroup.getColGroupDef()}getColGroupDef(){return this.providedColumnGroup.getColGroupDef()}isPadding(){return this.providedColumnGroup.isPadding()}isExpandable(){return this.providedColumnGroup.isExpandable()}isExpanded(){return this.providedColumnGroup.isExpanded()}setExpanded(e){this.providedColumnGroup.setExpanded(e)}addDisplayedLeafColumns(e){this.displayedChildren.forEach(t=>{t instanceof H?e.push(t):t instanceof te&&t.addDisplayedLeafColumns(e)})}addLeafColumns(e){this.children.forEach(t=>{t instanceof H?e.push(t):t instanceof te&&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.providedColumnGroup.isExpandable():!1)){this.displayedChildren=this.children,this.localEventService.dispatchEvent(this.createAgEvent(te.EVENT_DISPLAYED_CHILDREN_CHANGED));return}this.children.forEach(i=>{if(i instanceof te&&(!i.displayedChildren||!i.displayedChildren.length))return;switch(i.getColumnGroupShow()){case"open":e.providedColumnGroup.isExpanded()&&this.displayedChildren.push(i);break;case"closed":e.providedColumnGroup.isExpanded()||this.displayedChildren.push(i);break;default:this.displayedChildren.push(i);break}}),this.localEventService.dispatchEvent(this.createAgEvent(te.EVENT_DISPLAYED_CHILDREN_CHANGED))}}te.EVENT_LEFT_CHANGED="leftChanged",te.EVENT_DISPLAYED_CHILDREN_CHANGED="displayedChildrenChanged",xu([p("gridOptionsService")],te.prototype,"gridOptionsService",void 0);class u{}u.EVENT_COLUMN_EVERYTHING_CHANGED="columnEverythingChanged",u.EVENT_NEW_COLUMNS_LOADED="newColumnsLoaded",u.EVENT_COLUMN_PIVOT_MODE_CHANGED="columnPivotModeChanged",u.EVENT_COLUMN_ROW_GROUP_CHANGED="columnRowGroupChanged",u.EVENT_EXPAND_COLLAPSE_ALL="expandOrCollapseAll",u.EVENT_COLUMN_PIVOT_CHANGED="columnPivotChanged",u.EVENT_GRID_COLUMNS_CHANGED="gridColumnsChanged",u.EVENT_COLUMN_VALUE_CHANGED="columnValueChanged",u.EVENT_COLUMN_MOVED="columnMoved",u.EVENT_COLUMN_VISIBLE="columnVisible",u.EVENT_COLUMN_PINNED="columnPinned",u.EVENT_COLUMN_GROUP_OPENED="columnGroupOpened",u.EVENT_COLUMN_RESIZED="columnResized",u.EVENT_DISPLAYED_COLUMNS_CHANGED="displayedColumnsChanged",u.EVENT_VIRTUAL_COLUMNS_CHANGED="virtualColumnsChanged",u.EVENT_ASYNC_TRANSACTIONS_FLUSHED="asyncTransactionsFlushed",u.EVENT_ROW_GROUP_OPENED="rowGroupOpened",u.EVENT_ROW_DATA_CHANGED="rowDataChanged",u.EVENT_ROW_DATA_UPDATED="rowDataUpdated",u.EVENT_PINNED_ROW_DATA_CHANGED="pinnedRowDataChanged",u.EVENT_RANGE_SELECTION_CHANGED="rangeSelectionChanged",u.EVENT_CHART_CREATED="chartCreated",u.EVENT_CHART_RANGE_SELECTION_CHANGED="chartRangeSelectionChanged",u.EVENT_CHART_OPTIONS_CHANGED="chartOptionsChanged",u.EVENT_CHART_DESTROYED="chartDestroyed",u.EVENT_TOOL_PANEL_VISIBLE_CHANGED="toolPanelVisibleChanged",u.EVENT_TOOL_PANEL_SIZE_CHANGED="toolPanelSizeChanged",u.EVENT_COLUMN_PANEL_ITEM_DRAG_START="columnPanelItemDragStart",u.EVENT_COLUMN_PANEL_ITEM_DRAG_END="columnPanelItemDragEnd",u.EVENT_MODEL_UPDATED="modelUpdated",u.EVENT_CUT_START="cutStart",u.EVENT_CUT_END="cutEnd",u.EVENT_PASTE_START="pasteStart",u.EVENT_PASTE_END="pasteEnd",u.EVENT_FILL_START="fillStart",u.EVENT_FILL_END="fillEnd",u.EVENT_RANGE_DELETE_START="rangeDeleteStart",u.EVENT_RANGE_DELETE_END="rangeDeleteEnd",u.EVENT_UNDO_STARTED="undoStarted",u.EVENT_UNDO_ENDED="undoEnded",u.EVENT_REDO_STARTED="redoStarted",u.EVENT_REDO_ENDED="redoEnded",u.EVENT_KEY_SHORTCUT_CHANGED_CELL_START="keyShortcutChangedCellStart",u.EVENT_KEY_SHORTCUT_CHANGED_CELL_END="keyShortcutChangedCellEnd",u.EVENT_CELL_CLICKED="cellClicked",u.EVENT_CELL_DOUBLE_CLICKED="cellDoubleClicked",u.EVENT_CELL_MOUSE_DOWN="cellMouseDown",u.EVENT_CELL_CONTEXT_MENU="cellContextMenu",u.EVENT_CELL_VALUE_CHANGED="cellValueChanged",u.EVENT_CELL_EDIT_REQUEST="cellEditRequest",u.EVENT_ROW_VALUE_CHANGED="rowValueChanged",u.EVENT_CELL_FOCUSED="cellFocused",u.EVENT_CELL_FOCUS_CLEARED="cellFocusCleared",u.EVENT_FULL_WIDTH_ROW_FOCUSED="fullWidthRowFocused",u.EVENT_ROW_SELECTED="rowSelected",u.EVENT_SELECTION_CHANGED="selectionChanged",u.EVENT_CELL_KEY_DOWN="cellKeyDown",u.EVENT_CELL_MOUSE_OVER="cellMouseOver",u.EVENT_CELL_MOUSE_OUT="cellMouseOut",u.EVENT_FILTER_CHANGED="filterChanged",u.EVENT_FILTER_MODIFIED="filterModified",u.EVENT_FILTER_OPENED="filterOpened",u.EVENT_SORT_CHANGED="sortChanged",u.EVENT_VIRTUAL_ROW_REMOVED="virtualRowRemoved",u.EVENT_ROW_CLICKED="rowClicked",u.EVENT_ROW_DOUBLE_CLICKED="rowDoubleClicked",u.EVENT_GRID_READY="gridReady",u.EVENT_GRID_SIZE_CHANGED="gridSizeChanged",u.EVENT_VIEWPORT_CHANGED="viewportChanged",u.EVENT_SCROLLBAR_WIDTH_CHANGED="scrollbarWidthChanged",u.EVENT_FIRST_DATA_RENDERED="firstDataRendered",u.EVENT_DRAG_STARTED="dragStarted",u.EVENT_DRAG_STOPPED="dragStopped",u.EVENT_CHECKBOX_CHANGED="checkboxChanged",u.EVENT_ROW_EDITING_STARTED="rowEditingStarted",u.EVENT_ROW_EDITING_STOPPED="rowEditingStopped",u.EVENT_CELL_EDITING_STARTED="cellEditingStarted",u.EVENT_CELL_EDITING_STOPPED="cellEditingStopped",u.EVENT_BODY_SCROLL="bodyScroll",u.EVENT_BODY_SCROLL_END="bodyScrollEnd",u.EVENT_HEIGHT_SCALE_CHANGED="heightScaleChanged",u.EVENT_PAGINATION_CHANGED="paginationChanged",u.EVENT_COMPONENT_STATE_CHANGED="componentStateChanged",u.EVENT_STORE_REFRESHED="storeRefreshed",u.EVENT_BODY_HEIGHT_CHANGED="bodyHeightChanged",u.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED="displayedColumnsWidthChanged",u.EVENT_SCROLL_VISIBILITY_CHANGED="scrollVisibilityChanged",u.EVENT_COLUMN_HOVER_CHANGED="columnHoverChanged",u.EVENT_FLASH_CELLS="flashCells",u.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED="paginationPixelOffsetChanged",u.EVENT_DISPLAYED_ROWS_CHANGED="displayedRowsChanged",u.EVENT_LEFT_PINNED_WIDTH_CHANGED="leftPinnedWidthChanged",u.EVENT_RIGHT_PINNED_WIDTH_CHANGED="rightPinnedWidthChanged",u.EVENT_ROW_CONTAINER_HEIGHT_CHANGED="rowContainerHeightChanged",u.EVENT_HEADER_HEIGHT_CHANGED="headerHeightChanged",u.EVENT_COLUMN_HEADER_HEIGHT_CHANGED="columnHeaderHeightChanged",u.EVENT_ROW_DRAG_ENTER="rowDragEnter",u.EVENT_ROW_DRAG_MOVE="rowDragMove",u.EVENT_ROW_DRAG_LEAVE="rowDragLeave",u.EVENT_ROW_DRAG_END="rowDragEnd",u.EVENT_GRID_STYLES_CHANGED="gridStylesChanged",u.EVENT_POPUP_TO_FRONT="popupToFront",u.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST="columnRowGroupChangeRequest",u.EVENT_COLUMN_PIVOT_CHANGE_REQUEST="columnPivotChangeRequest",u.EVENT_COLUMN_VALUE_CHANGE_REQUEST="columnValueChangeRequest",u.EVENT_COLUMN_AGG_FUNC_CHANGE_REQUEST="columnAggFuncChangeRequest",u.EVENT_KEYBOARD_FOCUS="keyboardFocus",u.EVENT_MOUSE_FOCUS="mouseFocus",u.EVENT_STORE_UPDATED="storeUpdated",u.EVENT_FILTER_DESTROYED="filterDestroyed",u.EVENT_ROW_DATA_UPDATE_STARTED="rowDataUpdateStarted";class Qa{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}}var xr=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};const ns="ag-Grid-AutoColumn";let Ks=class extends T{createAutoGroupColumns(e,t){const i=[],s=this.gridOptionsService.isTreeData();let o=this.gridOptionsService.isGroupMultiAutoColumn();return s&&o&&(console.warn('AG Grid: you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data'),o=!1),o?t.forEach((n,r)=>{i.push(this.createOneAutoGroupColumn(e,n,r))}):i.push(this.createOneAutoGroupColumn(e)),i}createOneAutoGroupColumn(e,t,i){let s=this.generateDefaultColDef(t),o;t?o=`${ns}-${t.getId()}`:o=ns;const n=this.gridOptionsService.get("autoGroupColumnDef");Be(s,n),s=this.columnFactory.mergeColDefs(s,o),s.colId=o,this.gridOptionsService.isTreeData()||x(s.field)&&x(s.valueGetter)&&x(s.filterValueGetter)&&s.filter!=="agGroupColumnFilter"&&(s.filter=!1),i&&i>0&&(s.headerCheckboxSelection=!1);const r=e.find(c=>c.getId()==o),a=this.gridOptionsService.isColumnsSortingCoupledToGroup();if(r)return a&&(s.sort=void 0,s.sortIndex=void 0),r.setColDef(s,null),this.columnFactory.applyColumnState(r,s),r;a&&(s.sort||s.initialSort||"sortIndex"in s)&&!s.field&&(s.sort=null,s.sortIndex=null,s.initialSort=null);const d=new H(s,null,o,!0);return this.context.createBean(d),d}generateDefaultColDef(e){const t=this.gridOptionsService.get("autoGroupColumnDef"),s={headerName:this.localeService.getLocaleTextFunc()("group","Group")};if(t&&(t.cellRenderer||t.cellRendererSelector)||(s.cellRenderer="agGroupCellRenderer"),e){const n=e.getColDef();Object.assign(s,{headerName:this.columnModel.getDisplayNameForColumn(e,"header"),headerValueGetter:n.headerValueGetter}),n.cellRenderer&&Object.assign(s,{cellRendererParams:{innerRenderer:n.cellRenderer,innerRendererParams:n.cellRendererParams}}),s.showRowGroup=e.getColId()}else s.showRowGroup=!0;return s}};xr([p("columnModel")],Ks.prototype,"columnModel",void 0),xr([p("columnFactory")],Ks.prototype,"columnFactory",void 0),Ks=xr([M("autoGroupColService")],Ks);const Gu=/[&<>"']/g,Hu={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Vu(l){const e=String.fromCharCode;function t(h){const g=[];if(!h)return[];const f=h.length;let m=0,C,y;for(;m<f;)C=h.charCodeAt(m++),C>=55296&&C<=56319&&m<f?(y=h.charCodeAt(m++),(y&64512)==56320?g.push(((C&1023)<<10)+(y&1023)+65536):(g.push(C),m--)):g.push(C);return g}function i(h){if(h>=55296&&h<=57343)throw Error("Lone surrogate U+"+h.toString(16).toUpperCase()+" is not a scalar value")}function s(h,g){return e(h>>g&63|128)}function o(h){if(h>=0&&h<=31&&h!==10)return`_x${h.toString(16).toUpperCase().padStart(4,"0")}_`;if(!(h&4294967168))return e(h);let g="";return h&4294965248?h&4294901760?h&4292870144||(g=e(h>>18&7|240),g+=s(h,12),g+=s(h,6)):(i(h),g=e(h>>12&15|224),g+=s(h,6)):g=e(h>>6&31|192),g+=e(h&63|128),g}const n=t(l),r=n.length;let a=-1,d,c="";for(;++a<r;)d=n[a],c+=o(d);return c}function Xa(l){return l[0].toUpperCase()+l.substr(1).toLowerCase()}function It(l,e){if(l==null)return null;const t=l.toString().toString();return e?t:t.replace(Gu,i=>Hu[i])}function Ja(l){if(!l||l==null)return null;const e=/([a-z])([A-Z])/g,t=/([A-Z]+)([A-Z])([a-z])/g;return l.replace(e,"$1 $2").replace(t,"$1 $2$3").replace(/\./g," ").split(" ").map(s=>s.substring(0,1).toUpperCase()+(s.length>1?s.substring(1,s.length):"")).join(" ")}function Za(l){return l.replace(/[A-Z]/g,e=>`-${e.toLocaleLowerCase()}`)}var Bu=Object.freeze({__proto__:null,utf8_encode:Vu,capitalise:Xa,escapeString:It,camelCaseToHumanText:Ja,camelCaseToHyphenated:Za});function Qt(l){const e=new Map;return l.forEach(t=>e.set(t[0],t[1])),e}function Wu(l,e){const t=new Map;return l.forEach(i=>t.set(e(i),i)),t}function ku(l){const e=[];return l.forEach((t,i)=>e.push(i)),e}var Uu=Object.freeze({__proto__:null,convertToMap:Qt,mapById:Wu,keys:ku});class Cn{}Cn.ColDefPropertyMap={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,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,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,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},Cn.ALL_PROPERTIES=Object.keys(Cn.ColDefPropertyMap);class ie{}ie.STRING_PROPERTIES=["rowSelection","overlayLoadingTemplate","overlayNoRowsTemplate","gridId","quickFilterText","rowModelType","editType","domLayout","clipboardDelimiter","rowGroupPanelShow","multiSortKey","pivotColumnGroupTotals","pivotRowTotals","pivotPanelShow","fillHandleDirection","serverSideStoreType","groupDisplayType","treeDataDisplayType","colResizeDefault"],ie.OBJECT_PROPERTIES=["components","rowStyle","context","autoGroupColumnDef","localeText","icons","datasource","serverSideDatasource","viewportDatasource","groupRowRendererParams","aggFuncs","fullWidthCellRendererParams","defaultColGroupDef","defaultColDef","defaultCsvExportParams","defaultExcelExportParams","columnTypes","rowClassRules","detailCellRendererParams","loadingCellRendererParams","loadingOverlayComponentParams","noRowsOverlayComponentParams","popupParent","statusBar","sideBar","chartThemeOverrides","customChartThemes","chartToolPanelsDef","dataTypeDefinitions"],ie.ARRAY_PROPERTIES=["sortingOrder","alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData","chartThemes","rowClass"],ie.NUMBER_PROPERTIES=["rowHeight","detailRowHeight","rowBuffer","headerHeight","groupHeaderHeight","floatingFiltersHeight","pivotHeaderHeight","pivotGroupHeaderHeight","groupDefaultExpanded","viewportRowModelPageSize","viewportRowModelBufferSize","autoSizePadding","maxBlocksInCache","maxConcurrentDatasourceRequests","tooltipShowDelay","tooltipHideDelay","cacheOverflowSize","paginationPageSize","cacheBlockSize","infiniteInitialRowCount","serverSideInitialRowCount","scrollbarWidth","asyncTransactionWaitMillis","blockLoadDebounceMillis","keepDetailRowsCount","undoRedoCellEditingLimit","cellFlashDelay","cellFadeDelay","tabIndex"],ie.BOOLEAN_PROPERTIES=["suppressMakeColumnVisibleAfterUnGroup","suppressRowClickSelection","suppressCellFocus","suppressHorizontalScroll","alwaysShowHorizontalScroll","alwaysShowVerticalScroll","debug","enableBrowserTooltips","enableCellExpressions","groupSelectsChildren","groupIncludeFooter","groupIncludeTotalFooter","groupSuppressBlankHeader","suppressMenuHide","suppressRowDeselection","unSortIcon","suppressMultiSort","alwaysMultiSort","singleClickEdit","suppressLoadingOverlay","suppressNoRowsOverlay","suppressAutoSize","skipHeaderOnAutoSize","suppressParentsInRowNodes","suppressColumnMoveAnimation","suppressMovableColumns","suppressFieldDotNotation","enableRangeSelection","enableRangeHandle","enableFillHandle","suppressClearOnFillReduction","deltaSort","suppressTouch","suppressAsyncEvents","allowContextMenuWithControlKey","suppressContextMenu","rememberGroupStateWhenNewData","enableCellChangeFlash","suppressDragLeaveHidesColumns","suppressRowGroupHidesColumns","suppressMiddleClickScrolls","suppressPreventDefaultOnMouseWheel","suppressCopyRowsToClipboard","copyHeadersToClipboard","copyGroupHeadersToClipboard","pivotMode","suppressAggFuncInHeader","suppressColumnVirtualisation","alwaysAggregateAtRootLevel","suppressAggAtRootLevel","suppressFocusAfterRefresh","functionsPassive","functionsReadOnly","animateRows","groupSelectsFiltered","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","enableRtl","suppressClickEdit","rowDragEntireRow","rowDragManaged","suppressRowDrag","suppressMoveWhenRowDragging","rowDragMultiRow","enableGroupEdit","embedFullWidthRows","suppressPaginationPanel","groupHideOpenParents","groupAllowUnbalanced","pagination","paginationAutoPageSize","suppressScrollOnNewData","suppressScrollWhenPopupsAreOpen","purgeClosedRowNodes","cacheQuickFilter","includeHiddenColumnsInQuickFilter","excludeHiddenColumnsFromQuickFilter","ensureDomOrder","accentedSort","suppressChangeDetection","valueCache","valueCacheNeverExpires","aggregateOnlyChangedColumns","suppressAnimationFrame","suppressExcelExport","suppressCsvExport","treeData","masterDetail","suppressMultiRangeSelection","enterMovesDown","enterMovesDownAfterEdit","enterNavigatesVerticallyAfterEdit","enterNavigatesVertically","suppressPropertyNamesCheck","rowMultiSelectWithClick","suppressRowHoverHighlight","suppressRowTransform","suppressClipboardPaste","suppressLastEmptyLineOnPaste","enableCharts","enableChartToolPanelsButton","suppressChartToolPanelsButton","suppressMaintainUnsortedOrder","enableCellTextSelection","suppressBrowserResizeObserver","suppressMaxRenderedRowRestriction","excludeChildrenWhenTreeDataFiltering","tooltipMouseTrack","keepDetailRows","paginateChildRows","preventDefaultOnContextMenu","undoRedoCellEditing","allowDragFromColumnsToolPanel","pivotSuppressAutoColumn","suppressExpandablePivotGroups","debounceVerticalScrollbar","detailRowAutoHeight","serverSideFilteringAlwaysResets","serverSideFilterAllLevels","serverSideSortingAlwaysResets","serverSideSortAllLevels","serverSideOnlyRefreshFilteredGroups","serverSideSortOnServer","serverSideFilterOnServer","suppressAggFilteredOnly","showOpenedGroup","suppressClipboardApi","suppressModelUpdateAfterUpdateTransaction","stopEditingWhenCellsLoseFocus","maintainColumnOrder","groupMaintainOrder","columnHoverHighlight","suppressReactUi","readOnlyEdit","suppressRowVirtualisation","enableCellEditingOnBackspace","resetRowDataOnUpdate","removePivotHeaderRowWhenSingleValueColumn","suppressCopySingleCellRanges","suppressGroupRowsSticky","suppressServerSideInfiniteScroll","rowGroupPanelSuppressSort","allowShowChangeAfterFilter","suppressCutToClipboard"],ie.FUNCTIONAL_PROPERTIES=["doesExternalFilterPass","processSecondaryColDef","processSecondaryColGroupDef","processPivotResultColDef","processPivotResultColGroupDef","getBusinessKeyForNode","isRowSelectable","rowDragText","groupRowRenderer","fullWidthCellRenderer","loadingCellRenderer","loadingOverlayComponent","noRowsOverlayComponent","detailCellRenderer"],ie.CALLBACK_PROPERTIES=["getLocaleText","isExternalFilterPresent","getRowHeight","getRowClass","getRowStyle","getContextMenuItems","getMainMenuItems","processRowPostCreate","processCellForClipboard","getGroupRowAgg","isFullWidthRow","sendToClipboard","navigateToNextHeader","tabToNextHeader","navigateToNextCell","tabToNextCell","processCellFromClipboard","getDocument","postProcessPopup","getChildCount","getDataPath","isRowMaster","postSortRows","processHeaderForClipboard","processGroupHeaderForClipboard","paginationNumberFormatter","processDataFromClipboard","getServerSideGroupKey","isServerSideGroup","createChartContainer","getChartToolbarItems","fillOperation","isApplyServerSideTransaction","getServerSideStoreParams","getServerSideGroupLevelParams","isServerSideGroupOpenByDefault","isGroupOpenByDefault","initialGroupOrderComparator","loadingCellRendererSelector","getRowId","groupAggFiltering"],ie.FUNCTION_PROPERTIES=[...ie.FUNCTIONAL_PROPERTIES,...ie.CALLBACK_PROPERTIES],ie.ALL_PROPERTIES=[...ie.ARRAY_PROPERTIES,...ie.OBJECT_PROPERTIES,...ie.STRING_PROPERTIES,...ie.NUMBER_PROPERTIES,...ie.FUNCTION_PROPERTIES,...ie.BOOLEAN_PROPERTIES];class j{static getCallbackForEvent(e){return!e||e.length<2?e:"on"+e[0].toUpperCase()+e.substr(1)}static getCoercionLookup(){let e={};return[...j.ARRAY_PROPERTIES,...j.OBJECT_PROPERTIES,...j.STRING_PROPERTIES,...j.FUNCTION_PROPERTIES,...j.EVENT_CALLBACKS].forEach(t=>e[t]="none"),j.BOOLEAN_PROPERTIES.forEach(t=>e[t]="boolean"),j.NUMBER_PROPERTIES.forEach(t=>e[t]="number"),e}static getValue(e,t){const i=j.coercionLookup[e];if(i){let s=t;switch(i){case"number":{s=j.toNumber(t);break}case"boolean":{s=j.toBoolean(t);break}case"none":{e==="groupAggFiltering"&&typeof t!="function"&&(s=j.toBoolean(t));break}}return s}}static getGridOptionKeys(e,t){return Object.keys(t?j.coercionLookup:e)}static copyAttributesToGridOptions(e,t,i=!1){typeof e!="object"&&(e={});const s=e;return j.getGridOptionKeys(t,i).forEach(n=>{const r=t[n];if(typeof r<"u"){const a=j.getValue(n,r);a!==void 0&&(s[n]=a)}}),e}static processOnChange(e,t){if(!e||Object.keys(e).length===0)return;const i=Object.assign({},e);i.columnTypes&&(t.setColumnTypes(i.columnTypes.currentValue,"gridOptionsChanged"),delete i.columnTypes),i.autoGroupColumnDef&&(t.setAutoGroupColumnDef(i.autoGroupColumnDef.currentValue,"gridOptionsChanged"),delete i.autoGroupColumnDef),i.defaultColDef&&(t.setDefaultColDef(i.defaultColDef.currentValue,"gridOptionsChanged"),delete i.defaultColDef),i.columnDefs&&(t.setColumnDefs(i.columnDefs.currentValue,"gridOptionsChanged"),delete i.columnDefs),Object.keys(i).forEach(o=>{const n=o,r=j.getValue(n,i[n].currentValue);t.__setProperty(n,r)});const s={type:u.EVENT_COMPONENT_STATE_CHANGED};se(e,(o,n)=>{s[o]=n}),t.dispatchEvent(s)}static toBoolean(e){return typeof e=="boolean"?e:typeof e=="string"?e.toUpperCase()==="TRUE"||e=="":!1}static toNumber(e){if(typeof e=="number")return e;if(typeof e=="string")return Number(e)}}j.EVENTS=Ii(u),j.EXCLUDED_INTERNAL_EVENTS=[u.EVENT_SCROLLBAR_WIDTH_CHANGED,u.EVENT_CHECKBOX_CHANGED,u.EVENT_HEIGHT_SCALE_CHANGED,u.EVENT_BODY_HEIGHT_CHANGED,u.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,u.EVENT_SCROLL_VISIBILITY_CHANGED,u.EVENT_COLUMN_HOVER_CHANGED,u.EVENT_FLASH_CELLS,u.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED,u.EVENT_DISPLAYED_ROWS_CHANGED,u.EVENT_LEFT_PINNED_WIDTH_CHANGED,u.EVENT_RIGHT_PINNED_WIDTH_CHANGED,u.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,u.EVENT_POPUP_TO_FRONT,u.EVENT_KEYBOARD_FOCUS,u.EVENT_MOUSE_FOCUS,u.EVENT_STORE_UPDATED,u.EVENT_COLUMN_PANEL_ITEM_DRAG_START,u.EVENT_COLUMN_PANEL_ITEM_DRAG_END,u.EVENT_FILL_START,u.EVENT_FILL_END,u.EVENT_KEY_SHORTCUT_CHANGED_CELL_START,u.EVENT_KEY_SHORTCUT_CHANGED_CELL_END,u.EVENT_FULL_WIDTH_ROW_FOCUSED,u.EVENT_HEADER_HEIGHT_CHANGED,u.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,u.EVENT_CELL_FOCUS_CLEARED,u.EVENT_GRID_STYLES_CHANGED,u.EVENT_FILTER_DESTROYED,u.EVENT_ROW_DATA_UPDATE_STARTED],j.PUBLIC_EVENTS=j.EVENTS.filter(l=>!Ze(j.EXCLUDED_INTERNAL_EVENTS,l)),j.EVENT_CALLBACKS=j.EVENTS.map(l=>j.getCallbackForEvent(l)),j.STRING_PROPERTIES=ie.STRING_PROPERTIES,j.OBJECT_PROPERTIES=ie.OBJECT_PROPERTIES,j.ARRAY_PROPERTIES=ie.ARRAY_PROPERTIES,j.NUMBER_PROPERTIES=ie.NUMBER_PROPERTIES,j.BOOLEAN_PROPERTIES=ie.BOOLEAN_PROPERTIES,j.FUNCTION_PROPERTIES=ie.FUNCTION_PROPERTIES,j.ALL_PROPERTIES=ie.ALL_PROPERTIES,j.ALL_PROPERTIES_SET=new Set(ie.ALL_PROPERTIES),j.coercionLookup=j.getCoercionLookup();function ed(l,e,t){const i={},s=l.filter(o=>!e.some(n=>n===o));return s.length>0&&s.forEach(o=>i[o]=Gr(o,t)),i}function Gr(l,e,t,i){let s=e.map(o=>({value:o,relevance:ju(l.toLowerCase(),o.toLocaleLowerCase())}));if(s.sort((o,n)=>n.relevance-o.relevance),t&&(s=s.filter(o=>o.relevance!==0)),i&&i>0){const n=s[0].relevance*i;s=s.filter(r=>n-r.relevance<0)}return s.map(o=>o.value)}function ju(l,e){const t=l.replace(/\s/g,""),i=e.replace(/\s/g,"");let s=0,o=-1;for(let n=0;n<t.length;n++){const r=i.indexOf(t[n],o+1);r!==-1&&(o=r,s+=100-o*100/1e4*100)}return s}var zu=Object.freeze({__proto__:null,fuzzyCheckStrings:ed,fuzzySuggestions:Gr}),mn=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};function et(l,e,t,i){const s=t?`Please use '${t}' instead. `:"";Y(()=>console.warn(`AG Grid: since v${l}, '${e}' is deprecated. ${s}${i??""}`),`Deprecated_${e}`)}const td=["__ob__","__v_skip","__metadata__"];let rs=class{constructor(){this.deprecatedProperties={rememberGroupStateWhenNewData:{version:"24",message:"Now that transaction updates are possible and they keep group state, this feature is no longer needed."},serverSideFilteringAlwaysResets:{version:"28.0",newProp:"serverSideOnlyRefreshFilteredGroups",copyToNewProp:!0},serverSideSortingAlwaysResets:{version:"28.0",newProp:"serverSideSortAllLevels",copyToNewProp:!0},suppressReactUi:{version:"28",message:"The legacy React rendering engine is deprecated and will be removed in the next major version of the grid."},processSecondaryColDef:{version:"28",newProp:"processPivotResultColDef",copyToNewProp:!0},processSecondaryColGroupDef:{version:"28",newProp:"processPivotResultColGroupDef",copyToNewProp:!0},getServerSideStoreParams:{version:"28",newProp:"getServerSideGroupLevelParams",copyToNewProp:!0},serverSideInfiniteScroll:{version:"29",message:"Infinite Scrolling is now the default behaviour. This can be suppressed with `suppressServerSideInfiniteScroll`."},enableChartToolPanelsButton:{version:"29",message:"The Chart Tool Panels button is now enabled by default. To hide the Chart Tool Panels button and display the hamburger button instead, set suppressChartToolPanelsButton=true."},functionsPassive:{version:"29.2"},onColumnRowGroupChangeRequest:{version:"29.2"},onColumnPivotChangeRequest:{version:"29.2"},onColumnValueChangeRequest:{version:"29.2"},onColumnAggFuncChangeRequest:{version:"29.2"},serverSideFilterAllLevels:{version:"30",message:"All server-side group levels are now filtered by default. This can be toggled using `serverSideOnlyRefreshFilteredGroups`."},suppressAggAtRootLevel:{version:"30",message:"The root level aggregation is now suppressed by default. This can be toggled using `alwaysAggregateAtRootLevel`."},excludeHiddenColumnsFromQuickFilter:{version:"30",message:"Hidden columns are now excluded from the Quick Filter by default. This can be toggled using `includeHiddenColumnsInQuickFilter`."},enterMovesDown:{version:"30",newProp:"enterNavigatesVertically",copyToNewProp:!0},enterMovesDownAfterEdit:{version:"30",newProp:"enterNavigatesVerticallyAfterEdit",copyToNewProp:!0}}}pickOneWarning(e,t){console.warn(`AG Grid: ${e} and ${t} do not work with each other, you need to pick one.`)}init(){if(this.checkForDeprecated(),this.checkForViolations(),this.gridOptions.suppressPropertyNamesCheck!==!0&&(this.checkGridOptionsProperties(),this.checkColumnDefProperties()),this.checkColumnDefViolations(),this.gridOptionsService.is("groupSelectsChildren")&&this.gridOptionsService.is("suppressParentsInRowNodes")&&console.warn("AG Grid: 'groupSelectsChildren' does not work with 'suppressParentsInRowNodes', this selection method needs the part in rowNode to work"),this.gridOptionsService.is("groupSelectsChildren")&&this.gridOptionsService.get("rowSelection")!=="multiple"&&console.warn("AG Grid: rowSelection must be 'multiple' for groupSelectsChildren to make sense"),this.gridOptionsService.is("groupRemoveSingleChildren")&&this.gridOptionsService.is("groupHideOpenParents")&&this.pickOneWarning("groupRemoveSingleChildren","groupHideOpenParents"),this.gridOptionsService.isRowModelType("serverSide")){const t=(i,s)=>`AG Grid: '${i}' is not supported on the Server-Side Row Model.`+(s?` Please use ${s} instead.`:"");this.gridOptionsService.exists("groupDefaultExpanded")&&console.warn(t("groupDefaultExpanded","isServerSideGroupOpenByDefault callback")),this.gridOptionsService.exists("groupIncludeFooter")&&this.gridOptionsService.is("suppressServerSideInfiniteScroll")&&console.warn(t("groupIncludeFooter")),this.gridOptionsService.exists("groupIncludeTotalFooter")&&console.warn(t("groupIncludeTotalFooter"))}this.gridOptionsService.is("enableRangeSelection")?A.__assertRegistered(N.RangeSelectionModule,"enableRangeSelection",this.gridOptionsService.getGridId()):(this.gridOptionsService.is("enableRangeHandle")||this.gridOptionsService.is("enableFillHandle"))&&console.warn("AG Grid: 'enableRangeHandle' or 'enableFillHandle' will not work unless 'enableRangeSelection' is set to true");const e=(t,i)=>this.gridOptionsService.exists(t)&&A.__assertRegistered(i,t,this.gridOptionsService.getGridId());e("sideBar",N.SideBarModule),e("statusBar",N.StatusBarModule),e("enableCharts",N.GridChartsModule),e("getMainMenuItems",N.MenuModule),e("getContextMenuItems",N.MenuModule),e("allowContextMenuWithControlKey",N.MenuModule)}checkColumnDefProperties(){if(this.gridOptions.columnDefs==null)return;const e=Cn.ALL_PROPERTIES,t=(i,s)=>{const o=Object.getOwnPropertyNames(i);this.checkProperties(o,[...e,...td],e,s,"https://www.ag-grid.com/javascript-data-grid/column-properties/"),i.children&&i.children.forEach(n=>t(n,"columnDefs.children"))};this.gridOptions.columnDefs.forEach(i=>t(i,"columnDefs")),this.gridOptions.defaultColDef&&t(this.gridOptions.defaultColDef,"defaultColDef")}checkColumnDefViolations(){var e;const t=(e=this.gridOptionsService.get("rowModelType"))!==null&&e!==void 0?e:"clientSide",s={infinite:["headerCheckboxSelection","headerCheckboxSelectionFilteredOnly","headerCheckboxSelectionCurrentPageOnly"],viewport:["headerCheckboxSelection","headerCheckboxSelectionFilteredOnly","headerCheckboxSelectionCurrentPageOnly"],serverSide:["headerCheckboxSelectionFilteredOnly","headerCheckboxSelectionCurrentPageOnly"],clientSide:[]}[t];if(!(s!=null&&s.length))return;const o=n=>{s.forEach(r=>{r in n&&n[r]&&console.warn(`AG Grid: Column property ${r} is not supported with the row model type ${t}.`)})};this.gridOptions.columnDefs!=null&&this.gridOptions.columnDefs.forEach(n=>o(n)),this.gridOptions.autoGroupColumnDef!=null&&o(this.gridOptions.autoGroupColumnDef),this.gridOptions.defaultColDef!=null&&o(this.gridOptions.defaultColDef)}checkGridOptionsProperties(){const e=Object.getOwnPropertyNames(this.gridOptions),t=[...ie.ALL_PROPERTIES,...j.EVENT_CALLBACKS],i=[...t,"api","columnApi",...td,...Object.keys(this.deprecatedProperties)];this.checkProperties(e,i,t,"gridOptions","https://www.ag-grid.com/javascript-data-grid/grid-options/")}checkProperties(e,t,i,s,o){const n=ed(e,t,i);se(n,(r,a)=>{Y(()=>console.warn(`AG Grid: invalid ${s} property '${r}' did you mean any of these: ${a.slice(0,8).join(", ")}`),"invalidProperty"+s+r)}),Object.keys(n).length>0&&Y(()=>console.warn(`AG Grid: to see all the valid ${s} properties please check: ${o}`),"invalidProperties"+s+o)}checkForDeprecated(){const e=this.gridOptions;Object.entries(this.deprecatedProperties).forEach(([t,i])=>{var s;const o=e[t];o&&(et(i.version,t,i.newProp,i.message),i.copyToNewProp&&i.newProp&&e[i.newProp]==null&&(e[i.newProp]=(s=i.newPropValue)!==null&&s!==void 0?s:o))}),e.serverSideStoreType&&(console.warn("AG Grid: since v29.0, `serverSideStoreType` has been replaced by `suppressServerSideInfiniteScroll`. Set to false to use Partial Store, and true to use Full Store."),e.suppressServerSideInfiniteScroll=e.serverSideStoreType!=="partial")}checkForViolations(){this.gridOptionsService.is("treeData")&&this.treeDataViolations()}treeDataViolations(){this.gridOptionsService.isRowModelType("clientSide")&&(this.gridOptionsService.exists("getDataPath")||console.warn("AG Grid: property usingTreeData=true with rowModel=clientSide, but you did not provide getDataPath function, please provide getDataPath function if using tree data.")),this.gridOptionsService.isRowModelType("serverSide")&&(this.gridOptionsService.exists("isServerSideGroup")||console.warn("AG Grid: property usingTreeData=true with rowModel=serverSide, but you did not provide isServerSideGroup function, please provide isServerSideGroup function if using tree data."),this.gridOptionsService.exists("getServerSideGroupKey")||console.warn("AG Grid: property usingTreeData=true with rowModel=serverSide, but you did not provide getServerSideGroupKey function, please provide getServerSideGroupKey function if using tree data."))}};mn([p("gridOptions")],rs.prototype,"gridOptions",void 0),mn([p("gridOptionsService")],rs.prototype,"gridOptionsService",void 0),mn([D],rs.prototype,"init",null),rs=mn([M("gridOptionsValidator")],rs);function Hr(l,e){const t=["groupRows","multipleColumns","custom","singleColumn"];return t.indexOf(e)<0?(console.warn(`AG Grid: '${e}' is not a valid groupDisplayType value - possible values are: '${t.join("', '")}'`),!1):e===l}function $u(l,e){const t=["auto","custom"];return t.indexOf(e)<0?(console.warn(`AG Grid: '${e}' is not a valid treeDataDisplayType value - possible values are: '${t.join("', '")}'`),!1):e===l}var ge=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ku=function(l,e){return function(t,i){e(t,i,l)}},Yu=function(l,e){var t={};for(var i in l)Object.prototype.hasOwnProperty.call(l,i)&&e.indexOf(i)<0&&(t[i]=l[i]);if(l!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(l);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(l,i[s])&&(t[i[s]]=l[i[s]]);return t};let ce=class extends T{constructor(){super(...arguments),this.primaryHeaderRowCount=0,this.secondaryHeaderRowCount=0,this.gridHeaderRowCount=0,this.displayedColumnsLeft=[],this.displayedColumnsRight=[],this.displayedColumnsCenter=[],this.displayedColumns=[],this.displayedColumnsAndGroupsMap={},this.viewportColumns=[],this.viewportColumnsHash="",this.headerViewportColumns=[],this.viewportColumnsCenter=[],this.headerViewportColumnsCenter=[],this.autoHeightActiveAtLeastOnce=!1,this.rowGroupColumns=[],this.valueColumns=[],this.pivotColumns=[],this.ready=!1,this.autoGroupsNeedBuilding=!1,this.forceRecreateAutoGroups=!1,this.pivotMode=!1,this.bodyWidth=0,this.leftWidth=0,this.rightWidth=0,this.bodyWidthDirty=!0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}init(){this.suppressColumnVirtualisation=this.gridOptionsService.is("suppressColumnVirtualisation");const e=this.gridOptionsService.is("pivotMode");this.isPivotSettingAllowed(e)&&(this.pivotMode=e),this.usingTreeData=this.gridOptionsService.isTreeData(),this.addManagedPropertyListener("groupDisplayType",()=>this.onAutoGroupColumnDefChanged()),this.addManagedPropertyListener("autoGroupColumnDef",()=>this.onAutoGroupColumnDefChanged()),this.addManagedPropertyListener("defaultColDef",t=>this.onSharedColDefChanged(t.source)),this.addManagedPropertyListener("columnTypes",t=>this.onSharedColDefChanged(t.source))}onAutoGroupColumnDefChanged(){this.columnDefs&&(this.autoGroupsNeedBuilding=!0,this.forceRecreateAutoGroups=!0,this.updateGridColumns(),this.updateDisplayedColumns("gridOptionsChanged"))}onSharedColDefChanged(e="api"){this.forceRecreateAutoGroups=!0,this.createColumnsFromColumnDefs(!0,e)}setColumnDefs(e,t="api"){const i=!!this.columnDefs;this.columnDefs=e,this.createColumnsFromColumnDefs(i,t)}recreateColumnDefs(e="api"){this.onSharedColDefChanged(e)}destroyOldColumns(e,t){const i={};if(!e)return;this.columnUtils.depthFirstOriginalTreeSearch(null,e,o=>{i[o.getInstanceId()]=o}),t&&this.columnUtils.depthFirstOriginalTreeSearch(null,t,o=>{i[o.getInstanceId()]=null});const s=Object.values(i).filter(o=>o!=null);this.destroyBeans(s)}destroyColumns(){this.destroyOldColumns(this.primaryColumnTree),this.destroyOldColumns(this.secondaryBalancedTree),this.destroyOldColumns(this.groupAutoColsBalancedTree)}createColumnsFromColumnDefs(e,t="api"){const i=e?this.compareColumnStatesAndDispatchEvents(t):void 0;this.valueCache.expire(),this.autoGroupsNeedBuilding=!0;const s=this.primaryColumns,o=this.primaryColumnTree,n=this.columnFactory.createColumnTree(this.columnDefs,!0,o);this.destroyOldColumns(this.primaryColumnTree,n.columnTree),this.primaryColumnTree=n.columnTree,this.primaryHeaderRowCount=n.treeDept+1,this.primaryColumns=this.getColumnsFromTree(this.primaryColumnTree),this.primaryColumnsMap={},this.primaryColumns.forEach(d=>this.primaryColumnsMap[d.getId()]=d),this.extractRowGroupColumns(t,s),this.extractPivotColumns(t,s),this.extractValueColumns(t,s),this.ready=!0;const r=this.gridColsArePrimary===void 0;(this.gridColsArePrimary||r)&&(this.updateGridColumns(),e&&!this.gridOptionsService.is("maintainColumnOrder")&&this.orderGridColumnsLikePrimary(),this.updateDisplayedColumns(t),this.checkViewportColumns()),this.dispatchEverythingChanged(t),i&&i(),this.dispatchNewColumnsLoaded()}dispatchNewColumnsLoaded(){const e={type:u.EVENT_NEW_COLUMNS_LOADED};this.eventService.dispatchEvent(e)}dispatchEverythingChanged(e="api"){const t={type:u.EVENT_COLUMN_EVERYTHING_CHANGED,source:e};this.eventService.dispatchEvent(t)}orderGridColumnsLikePrimary(){const e=this.primaryColumns;e&&(this.gridColumns.sort((t,i)=>{const s=e.indexOf(t),o=e.indexOf(i),n=s>=0,r=o>=0;if(n&&r)return s-o;if(n)return 1;if(r)return-1;const a=this.gridColumns.indexOf(t),d=this.gridColumns.indexOf(i);return a-d}),this.gridColumns=this.placeLockedColumns(this.gridColumns))}getAllDisplayedAutoHeightCols(){return this.displayedAutoHeightCols}setViewport(){this.gridOptionsService.is("enableRtl")?(this.viewportLeft=this.bodyWidth-this.scrollPosition-this.scrollWidth,this.viewportRight=this.bodyWidth-this.scrollPosition):(this.viewportLeft=this.scrollPosition,this.viewportRight=this.scrollWidth+this.scrollPosition)}getDisplayedColumnsStartingAt(e){let t=e;const i=[];for(;t!=null;)i.push(t),t=this.getDisplayedColAfter(t);return i}checkViewportColumns(){if(this.displayedColumnsCenter==null||!this.extractViewport())return;const t={type:u.EVENT_VIRTUAL_COLUMNS_CHANGED};this.eventService.dispatchEvent(t)}setViewportPosition(e,t){(e!==this.scrollWidth||t!==this.scrollPosition||this.bodyWidthDirty)&&(this.scrollWidth=e,this.scrollPosition=t,this.bodyWidthDirty=!0,this.setViewport(),this.ready&&this.checkViewportColumns())}isPivotMode(){return this.pivotMode}isPivotSettingAllowed(e){return e&&this.gridOptionsService.isTreeData()?(console.warn("AG Grid: Pivot mode not available in conjunction Tree Data i.e. 'gridOptions.treeData: true'"),!1):!0}setPivotMode(e,t="api"){if(e===this.pivotMode||!this.isPivotSettingAllowed(this.pivotMode))return;this.pivotMode=e,this.autoGroupsNeedBuilding=!0,this.updateGridColumns(),this.updateDisplayedColumns(t);const i={type:u.EVENT_COLUMN_PIVOT_MODE_CHANGED};this.eventService.dispatchEvent(i)}getSecondaryPivotColumn(e,t){if(x(this.secondaryColumns))return null;const i=this.getPrimaryColumn(t);let s=null;return this.secondaryColumns.forEach(o=>{const n=o.getColDef().pivotKeys,r=o.getColDef().pivotValueColumn;ai(n,e)&&r===i&&(s=o)}),s}setBeans(e){this.logger=e.create("columnModel")}setFirstRightAndLastLeftPinned(e){let t,i;this.gridOptionsService.is("enableRtl")?(t=this.displayedColumnsLeft?this.displayedColumnsLeft[0]:null,i=this.displayedColumnsRight?Z(this.displayedColumnsRight):null):(t=this.displayedColumnsLeft?Z(this.displayedColumnsLeft):null,i=this.displayedColumnsRight?this.displayedColumnsRight[0]:null),this.gridColumns.forEach(s=>{s.setLastLeftPinned(s===t,e),s.setFirstRightPinned(s===i,e)})}autoSizeColumns(e){if(this.shouldQueueResizeOperations){this.resizeOperationQueue.push(()=>this.autoSizeColumns(e));return}const{columns:t,skipHeader:i,skipHeaderGroups:s,stopAtGroup:o,source:n="api"}=e;this.animationFrameService.flushAllFrames();const r=[];let a=-1;const d=i??this.gridOptionsService.is("skipHeaderOnAutoSize"),c=s??d;for(;a!==0;)a=0,this.actionOnGridColumns(t,h=>{if(r.indexOf(h)>=0)return!1;const g=this.autoWidthCalculator.getPreferredWidthForColumn(h,d);if(g>0){const f=this.normaliseColumnWidth(h,g);h.setActualWidth(f,n),r.push(h),a++}return!0},n);c||this.autoSizeColumnGroupsByColumns(t,n,o),this.dispatchColumnResizedEvent(r,!0,"autosizeColumns")}dispatchColumnResizedEvent(e,t,i,s=null){if(e&&e.length){const o={type:u.EVENT_COLUMN_RESIZED,columns:e,column:e.length===1?e[0]:null,flexColumns:s,finished:t,source:i};this.eventService.dispatchEvent(o)}}dispatchColumnChangedEvent(e,t,i){const s={type:e,columns:t,column:t&&t.length==1?t[0]:null,source:i};this.eventService.dispatchEvent(s)}dispatchColumnMovedEvent(e){const{movedColumns:t,source:i,toIndex:s,finished:o}=e,n={type:u.EVENT_COLUMN_MOVED,columns:t,column:t&&t.length===1?t[0]:null,toIndex:s,finished:o,source:i};this.eventService.dispatchEvent(n)}dispatchColumnPinnedEvent(e,t){if(!e.length)return;const i=e.length===1?e[0]:null,s=this.getCommonValue(e,n=>n.getPinned()),o={type:u.EVENT_COLUMN_PINNED,pinned:s??null,columns:e,column:i,source:t};this.eventService.dispatchEvent(o)}dispatchColumnVisibleEvent(e,t){if(!e.length)return;const i=e.length===1?e[0]:null,s=this.getCommonValue(e,n=>n.isVisible()),o={type:u.EVENT_COLUMN_VISIBLE,visible:s,columns:e,column:i,source:t};this.eventService.dispatchEvent(o)}autoSizeColumn(e,t,i="api"){e&&this.autoSizeColumns({columns:[e],skipHeader:t,skipHeaderGroups:!0,source:i})}autoSizeColumnGroupsByColumns(e,t,i){const s=new Set;this.getGridColumns(e).forEach(a=>{let d=a.getParent();for(;d&&d!=i;)d.isPadding()||s.add(d),d=d.getParent()});let n;const r=[];for(const a of s){for(const d of this.ctrlsService.getHeaderRowContainerCtrls())if(n=d.getHeaderCtrlForColumn(a),n)break;n&&n.resizeLeafColumnsToFit(t)}return r}autoSizeAllColumns(e,t="api"){if(this.shouldQueueResizeOperations){this.resizeOperationQueue.push(()=>this.autoSizeAllColumns(e,t));return}const i=this.getAllDisplayedColumns();this.autoSizeColumns({columns:i,skipHeader:e,source:t})}getColumnsFromTree(e){const t=[],i=s=>{for(let o=0;o<s.length;o++){const n=s[o];n instanceof H?t.push(n):n instanceof ee&&i(n.getChildren())}};return i(e),t}getAllDisplayedTrees(){return this.displayedTreeLeft&&this.displayedTreeRight&&this.displayedTreeCentre?this.displayedTreeLeft.concat(this.displayedTreeCentre).concat(this.displayedTreeRight):null}getPrimaryColumnTree(){return this.primaryColumnTree}getHeaderRowCount(){return this.gridHeaderRowCount}getDisplayedTreeLeft(){return this.displayedTreeLeft}getDisplayedTreeRight(){return this.displayedTreeRight}getDisplayedTreeCentre(){return this.displayedTreeCentre}isColumnDisplayed(e){return this.getAllDisplayedColumns().indexOf(e)>=0}getAllDisplayedColumns(){return this.displayedColumns}getViewportColumns(){return this.viewportColumns}getDisplayedLeftColumnsForRow(e){return this.colSpanActive?this.getDisplayedColumnsForRow(e,this.displayedColumnsLeft):this.displayedColumnsLeft}getDisplayedRightColumnsForRow(e){return this.colSpanActive?this.getDisplayedColumnsForRow(e,this.displayedColumnsRight):this.displayedColumnsRight}isColSpanActive(){return this.colSpanActive}getDisplayedColumnsForRow(e,t,i,s){const o=[];let n=null;for(let r=0;r<t.length;r++){const a=t[r],d=t.length-r,c=Math.min(a.getColSpan(e),d),h=[a];if(c>1){const f=c-1;for(let m=1;m<=f;m++)h.push(t[r+m]);r+=f}let g;i?(g=!1,h.forEach(f=>{i(f)&&(g=!0)})):g=!0,g&&(o.length===0&&n&&(s&&s(a))&&o.push(n),o.push(a)),n=a}return o}getViewportCenterColumnsForRow(e){if(!this.colSpanActive)return this.viewportColumnsCenter;const t=s=>{const o=s.getLeft();return R(o)&&o>this.viewportLeft},i=this.suppressColumnVirtualisation?null:this.isColumnInRowViewport.bind(this);return this.getDisplayedColumnsForRow(e,this.displayedColumnsCenter,i,t)}getAriaColumnIndex(e){return this.getAllGridColumns().indexOf(e)+1}isColumnInHeaderViewport(e){return e.isAutoHeaderHeight()?!0:this.isColumnInRowViewport(e)}isColumnInRowViewport(e){if(e.isAutoHeight())return!0;const t=e.getLeft()||0,i=t+e.getActualWidth(),s=this.viewportLeft-200,o=this.viewportRight+200,n=t<s&&i<s,r=t>o&&i>o;return!n&&!r}getDisplayedColumnsLeftWidth(){return this.getWidthOfColsInList(this.displayedColumnsLeft)}getDisplayedColumnsRightWidth(){return this.getWidthOfColsInList(this.displayedColumnsRight)}updatePrimaryColumnList(e,t,i,s,o,n="api"){if(!e||Ve(e))return;let r=!1;if(e.forEach(d=>{const c=this.getPrimaryColumn(d);if(c){if(i){if(t.indexOf(c)>=0)return;t.push(c)}else{if(t.indexOf(c)<0)return;ve(t,c)}s(c),r=!0}}),!r)return;this.autoGroupsNeedBuilding&&this.updateGridColumns(),this.updateDisplayedColumns(n);const a={type:o,columns:t,column:t.length===1?t[0]:null,source:n};this.eventService.dispatchEvent(a)}setRowGroupColumns(e,t="api"){this.autoGroupsNeedBuilding=!0,this.setPrimaryColumnList(e,this.rowGroupColumns,u.EVENT_COLUMN_ROW_GROUP_CHANGED,this.setRowGroupActive.bind(this),t)}setRowGroupActive(e,t,i){e!==t.isRowGroupActive()&&(t.setRowGroupActive(e,i),e&&!this.gridOptionsService.is("suppressRowGroupHidesColumns")&&this.setColumnVisible(t,!1,i),!e&&!this.gridOptionsService.is("suppressMakeColumnVisibleAfterUnGroup")&&this.setColumnVisible(t,!0,i))}addRowGroupColumn(e,t="api"){e&&this.addRowGroupColumns([e],t)}addRowGroupColumns(e,t="api"){this.autoGroupsNeedBuilding=!0,this.updatePrimaryColumnList(e,this.rowGroupColumns,!0,this.setRowGroupActive.bind(this,!0),u.EVENT_COLUMN_ROW_GROUP_CHANGED,t)}removeRowGroupColumns(e,t="api"){this.autoGroupsNeedBuilding=!0,this.updatePrimaryColumnList(e,this.rowGroupColumns,!1,this.setRowGroupActive.bind(this,!1),u.EVENT_COLUMN_ROW_GROUP_CHANGED,t)}removeRowGroupColumn(e,t="api"){e&&this.removeRowGroupColumns([e],t)}addPivotColumns(e,t="api"){this.updatePrimaryColumnList(e,this.pivotColumns,!0,i=>i.setPivotActive(!0,t),u.EVENT_COLUMN_PIVOT_CHANGED,t)}setPivotColumns(e,t="api"){this.setPrimaryColumnList(e,this.pivotColumns,u.EVENT_COLUMN_PIVOT_CHANGED,(i,s)=>{s.setPivotActive(i,t)},t)}addPivotColumn(e,t="api"){this.addPivotColumns([e],t)}removePivotColumns(e,t="api"){this.updatePrimaryColumnList(e,this.pivotColumns,!1,i=>i.setPivotActive(!1,t),u.EVENT_COLUMN_PIVOT_CHANGED,t)}removePivotColumn(e,t="api"){this.removePivotColumns([e],t)}setPrimaryColumnList(e,t,i,s,o){t.length=0,R(e)&&e.forEach(n=>{const r=this.getPrimaryColumn(n);r&&t.push(r)}),(this.primaryColumns||[]).forEach(n=>{const r=t.indexOf(n)>=0;s(r,n)}),this.autoGroupsNeedBuilding&&this.updateGridColumns(),this.updateDisplayedColumns(o),this.dispatchColumnChangedEvent(i,t,o)}setValueColumns(e,t="api"){this.setPrimaryColumnList(e,this.valueColumns,u.EVENT_COLUMN_VALUE_CHANGED,this.setValueActive.bind(this),t)}setValueActive(e,t,i){if(e!==t.isValueActive()&&(t.setValueActive(e,i),e&&!t.getAggFunc())){const s=this.aggFuncService.getDefaultAggFunc(t);t.setAggFunc(s)}}addValueColumns(e,t="api"){this.updatePrimaryColumnList(e,this.valueColumns,!0,this.setValueActive.bind(this,!0),u.EVENT_COLUMN_VALUE_CHANGED,t)}addValueColumn(e,t="api"){e&&this.addValueColumns([e],t)}removeValueColumn(e,t="api"){this.removeValueColumns([e],t)}removeValueColumns(e,t="api"){this.updatePrimaryColumnList(e,this.valueColumns,!1,this.setValueActive.bind(this,!1),u.EVENT_COLUMN_VALUE_CHANGED,t)}normaliseColumnWidth(e,t){const i=e.getMinWidth();R(i)&&t<i&&(t=i);const s=e.getMaxWidth();return R(s)&&e.isGreaterThanMax(t)&&(t=s),t}getPrimaryOrGridColumn(e){return this.getPrimaryColumn(e)||this.getGridColumn(e)}setColumnWidths(e,t,i,s="api"){const o=[];e.forEach(n=>{const r=this.getPrimaryOrGridColumn(n.key);if(!r)return;if(o.push({width:n.newWidth,ratios:[1],columns:[r]}),this.gridOptionsService.get("colResizeDefault")==="shift"&&(t=!t),t){const d=this.getDisplayedColAfter(r);if(!d)return;const c=r.getActualWidth()-n.newWidth,h=d.getActualWidth()+c;o.push({width:h,ratios:[1],columns:[d]})}}),o.length!==0&&this.resizeColumnSets({resizeSets:o,finished:i,source:s})}checkMinAndMaxWidthsForSet(e){const{columns:t,width:i}=e;let s=0,o=0,n=!0;t.forEach(d=>{const c=d.getMinWidth();s+=c||0;const h=d.getMaxWidth();R(h)&&h>0?o+=h:n=!1});const r=i>=s,a=!n||i<=o;return r&&a}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.dispatchColumnResizedEvent(h,i,s)}return}const n=[],r=[];t.forEach(h=>{const{width:g,columns:f,ratios:m}=h,C={},y={};f.forEach(b=>r.push(b));let v=!0,E=0;for(;v;){if(E++,E>1e3){console.error("AG Grid: infinite loop in resizeColumnSets");break}v=!1;const b=[];let _=0,F=g;f.forEach((I,U)=>{if(y[I.getId()])F-=C[I.getId()];else{b.push(I);const ne=m[U];_+=ne}});const L=1/_;b.forEach((I,U)=>{const oe=U===b.length-1;let ne;oe?ne=F:(ne=Math.round(m[U]*g*L),F-=ne);const Ge=I.getMinWidth(),He=I.getMaxWidth();R(Ge)&&ne<Ge?(ne=Ge,y[I.getId()]=!0,v=!0):R(He)&&He>0&&ne>He&&(ne=He,y[I.getId()]=!0,v=!0),C[I.getId()]=ne})}f.forEach(b=>{const _=C[b.getId()];b.getActualWidth()!==_&&(b.setActualWidth(_,s),n.push(b))})});const a=n.length>0;let d=[];a&&(d=this.refreshFlexedColumns({resizingCols:r,skipSetLeft:!0}),this.setLeftValues(s),this.updateBodyWidths(),this.checkViewportColumns());const c=r.concat(d);(a||i)&&this.dispatchColumnResizedEvent(c,i,s,d)}setColumnAggFunc(e,t,i="api"){if(!e)return;const s=this.getPrimaryColumn(e);s&&(s.setAggFunc(t),this.dispatchColumnChangedEvent(u.EVENT_COLUMN_VALUE_CHANGED,[s],i))}moveRowGroupColumn(e,t,i="api"){const s=this.rowGroupColumns[e];this.rowGroupColumns.splice(e,1),this.rowGroupColumns.splice(t,0,s);const o={type:u.EVENT_COLUMN_ROW_GROUP_CHANGED,columns:this.rowGroupColumns,column:this.rowGroupColumns.length===1?this.rowGroupColumns[0]:null,source:i};this.eventService.dispatchEvent(o)}moveColumns(e,t,i="api",s=!0){if(this.columnAnimationService.start(),t>this.gridColumns.length-e.length){console.warn("AG Grid: tried to insert columns in invalid location, toIndex = "+t),console.warn("AG Grid: remember that you should not count the moving columns when calculating the new index");return}const o=this.getGridColumns(e);this.doesMovePassRules(o,t)&&(Ir(this.gridColumns,o,t),this.updateDisplayedColumns(i),this.dispatchColumnMovedEvent({movedColumns:o,source:i,toIndex:t,finished:s}),this.columnAnimationService.finish())}doesMovePassRules(e,t){const i=this.getProposedColumnOrder(e,t);return this.doesOrderPassRules(i)}doesOrderPassRules(e){return!(!this.doesMovePassMarryChildren(e)||!this.doesMovePassLockedPositions(e))}getProposedColumnOrder(e,t){const i=this.gridColumns.slice();return Ir(i,e,t),i}sortColumnsLikeGridColumns(e){!e||e.length<=1||e.filter(i=>this.gridColumns.indexOf(i)<0).length>0||e.sort((i,s)=>{const o=this.gridColumns.indexOf(i),n=this.gridColumns.indexOf(s);return o-n})}doesMovePassLockedPositions(e){let t=0,i=!0;const s=o=>o?o===!0||o==="left"?0:2:1;return e.forEach(o=>{const n=s(o.getColDef().lockPosition);n<t&&(i=!1),t=n}),i}doesMovePassMarryChildren(e){let t=!0;return this.columnUtils.depthFirstOriginalTreeSearch(null,this.gridBalancedTree,i=>{if(!(i instanceof ee))return;const s=i,o=s.getColGroupDef();if(!(o&&o.marryChildren))return;const r=[];s.getLeafColumns().forEach(g=>{const f=e.indexOf(g);r.push(f)});const a=Math.max.apply(Math,r),d=Math.min.apply(Math,r),c=a-d,h=s.getLeafColumns().length-1;c>h&&(t=!1)}),t}moveColumn(e,t,i="api"){this.moveColumns([e],t,i)}moveColumnByIndex(e,t,i="api"){const s=this.gridColumns[e];this.moveColumn(s,t,i)}getColumnDefs(){if(!this.primaryColumns)return;const e=this.primaryColumns.slice();return this.gridColsArePrimary?e.sort((t,i)=>this.gridColumns.indexOf(t)-this.gridColumns.indexOf(i)):this.lastPrimaryOrder&&e.sort((t,i)=>this.lastPrimaryOrder.indexOf(t)-this.lastPrimaryOrder.indexOf(i)),this.columnDefFactory.buildColumnDefs(e,this.rowGroupColumns,this.pivotColumns)}getBodyContainerWidth(){return this.bodyWidth}getContainerWidth(e){switch(e){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}updateBodyWidths(){const e=this.getWidthOfColsInList(this.displayedColumnsCenter),t=this.getWidthOfColsInList(this.displayedColumnsLeft),i=this.getWidthOfColsInList(this.displayedColumnsRight);if(this.bodyWidthDirty=this.bodyWidth!==e,this.bodyWidth!==e||this.leftWidth!==t||this.rightWidth!==i){this.bodyWidth=e,this.leftWidth=t,this.rightWidth=i;const o={type:u.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED};this.eventService.dispatchEvent(o)}}getValueColumns(){return this.valueColumns?this.valueColumns:[]}getPivotColumns(){return this.pivotColumns?this.pivotColumns:[]}isPivotActive(){return this.pivotColumns&&this.pivotColumns.length>0&&this.pivotMode}getRowGroupColumns(){return this.rowGroupColumns?this.rowGroupColumns:[]}getDisplayedCenterColumns(){return this.displayedColumnsCenter}getDisplayedLeftColumns(){return this.displayedColumnsLeft}getDisplayedRightColumns(){return this.displayedColumnsRight}getDisplayedColumns(e){switch(e){case"left":return this.getDisplayedLeftColumns();case"right":return this.getDisplayedRightColumns();default:return this.getDisplayedCenterColumns()}}getAllPrimaryColumns(){return this.primaryColumns?this.primaryColumns.slice():null}getSecondaryColumns(){return this.secondaryColumns?this.secondaryColumns.slice():null}getAllColumnsForQuickFilter(){return this.columnsForQuickFilter}getAllGridColumns(){return this.gridColumns}isEmpty(){return Ve(this.gridColumns)}isRowGroupEmpty(){return Ve(this.rowGroupColumns)}setColumnVisible(e,t,i="api"){this.setColumnsVisible([e],t,i)}setColumnsVisible(e,t=!1,i="api"){this.applyColumnState({state:e.map(s=>({colId:typeof s=="string"?s:s.getColId(),hide:!t}))},i)}setColumnPinned(e,t,i="api"){e&&this.setColumnsPinned([e],t,i)}setColumnsPinned(e,t,i="api"){if(this.gridOptionsService.isDomLayout("print")){console.warn("AG Grid: 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,this.actionOnGridColumns(e,o=>o.getPinned()!==s?(o.setPinned(s),!0):!1,i,()=>({type:u.EVENT_COLUMN_PINNED,pinned:s,column:null,columns:null,source:i})),this.columnAnimationService.finish()}actionOnGridColumns(e,t,i,s){if(Ve(e))return;const o=[];if(e.forEach(n=>{const r=this.getGridColumn(n);if(!r)return;t(r)!==!1&&o.push(r)}),!!o.length&&(this.updateDisplayedColumns(i),R(s)&&s)){const n=s();n.columns=o,n.column=o.length===1?o[0]:null,this.eventService.dispatchEvent(n)}}getDisplayedColBefore(e){const t=this.getAllDisplayedColumns(),i=t.indexOf(e);return i>0?t[i-1]:null}getDisplayedColAfter(e){const t=this.getAllDisplayedColumns(),i=t.indexOf(e);return i<t.length-1?t[i+1]:null}getDisplayedGroupAfter(e){return this.getDisplayedGroupAtDirection(e,"After")}getDisplayedGroupBefore(e){return this.getDisplayedGroupAtDirection(e,"Before")}getDisplayedGroupAtDirection(e,t){const i=e.getProvidedColumnGroup().getLevel()+e.getPaddingLevel(),s=e.getDisplayedLeafColumns(),o=t==="After"?Z(s):s[0],n=`getDisplayedCol${t}`;for(;;){const r=this[n](o);if(!r)return null;const a=this.getColumnGroupAtLevel(r,i);if(a!==e)return a}}getColumnGroupAtLevel(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.displayedColumnsLeft.length>0}isPinningRight(){return this.displayedColumnsRight.length>0}getPrimaryAndSecondaryAndAutoColumns(){return[].concat(this.primaryColumns||[],this.groupAutoColumns||[],this.secondaryColumns||[])}createStateItemFromColumn(e){const t=e.isRowGroupActive()?this.rowGroupColumns.indexOf(e):null,i=e.isPivotActive()?this.pivotColumns.indexOf(e):null,s=e.isValueActive()?e.getAggFunc():null,o=e.getSort()!=null?e.getSort():null,n=e.getSortIndex()!=null?e.getSortIndex():null,r=e.getFlex()!=null&&e.getFlex()>0?e.getFlex():null;return{colId:e.getColId(),width:e.getActualWidth(),hide:!e.isVisible(),pinned:e.getPinned(),sort:o,sortIndex:n,aggFunc:s,rowGroup:e.isRowGroupActive(),rowGroupIndex:t,pivot:e.isPivotActive(),pivotIndex:i,flex:r}}getColumnState(){if(x(this.primaryColumns)||!this.isAlive())return[];const t=this.getPrimaryAndSecondaryAndAutoColumns().map(this.createStateItemFromColumn.bind(this));return this.orderColumnStateList(t),t}orderColumnStateList(e){const t=Qt(this.gridColumns.map((i,s)=>[i.getColId(),s]));e.sort((i,s)=>{const o=t.has(i.colId)?t.get(i.colId):-1,n=t.has(s.colId)?t.get(s.colId):-1;return o-n})}resetColumnState(e="api"){const t=this.getColumnsFromTree(this.primaryColumnTree),i=[];let s=1e3,o=1e3,n=[];this.groupAutoColumns&&(n=n.concat(this.groupAutoColumns)),t&&(n=n.concat(t)),n.forEach(r=>{const a=this.getColumnStateFromColDef(r);x(a.rowGroupIndex)&&a.rowGroup&&(a.rowGroupIndex=s++),x(a.pivotIndex)&&a.pivot&&(a.pivotIndex=o++),i.push(a)}),this.applyColumnState({state:i,applyOrder:!0},e)}getColumnStateFromColDef(e){const t=(C,y)=>C??y??null,i=e.getColDef(),s=t(i.sort,i.initialSort),o=t(i.sortIndex,i.initialSortIndex),n=t(i.hide,i.initialHide),r=t(i.pinned,i.initialPinned),a=t(i.width,i.initialWidth),d=t(i.flex,i.initialFlex);let c=t(i.rowGroupIndex,i.initialRowGroupIndex),h=t(i.rowGroup,i.initialRowGroup);c==null&&(h==null||h==!1)&&(c=null,h=null);let g=t(i.pivotIndex,i.initialPivotIndex),f=t(i.pivot,i.initialPivot);g==null&&(f==null||f==!1)&&(g=null,f=null);const m=t(i.aggFunc,i.initialAggFunc);return{colId:e.getColId(),sort:s,sortIndex:o,hide:n,pinned:r,width:a,flex:d,rowGroup:h,rowGroupIndex:c,pivot:f,pivotIndex:g,aggFunc:m}}applyColumnState(e,t){if(Ve(this.primaryColumns))return!1;if(e&&e.state&&!e.state.forEach)return console.warn("AG Grid: applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state."),!1;const i=(n,r,a)=>{const d=this.compareColumnStatesAndDispatchEvents(t);this.autoGroupsNeedBuilding=!0;const c=r.slice(),h={},g={},f=[],m=[];let C=0;const y=this.rowGroupColumns.slice(),v=this.pivotColumns.slice();n.forEach(F=>{const L=F.colId||"";if(L.startsWith(ns)){f.push(F),m.push(F);return}const U=a(L);U?(this.syncColumnWithStateItem(U,F,e.defaultState,h,g,!1,t),ve(c,U)):(m.push(F),C+=1)});const E=F=>this.syncColumnWithStateItem(F,null,e.defaultState,h,g,!1,t);c.forEach(E);const b=(F,L,I,U)=>{const oe=F[I.getId()],ne=F[U.getId()],Ge=oe!=null,He=ne!=null;if(Ge&&He)return oe-ne;if(Ge)return-1;if(He)return 1;const Le=L.indexOf(I),pt=L.indexOf(U),lu=Le>=0,vf=pt>=0;return lu&&vf?Le-pt:lu?-1:1};this.rowGroupColumns.sort(b.bind(this,h,y)),this.pivotColumns.sort(b.bind(this,g,v)),this.updateGridColumns();const _=this.groupAutoColumns?this.groupAutoColumns.slice():[];return f.forEach(F=>{const L=this.getAutoColumn(F.colId);ve(_,L),this.syncColumnWithStateItem(L,F,e.defaultState,null,null,!0,t)}),_.forEach(E),this.applyOrderAfterApplyState(e),this.updateDisplayedColumns(t),this.dispatchEverythingChanged(t),d(),{unmatchedAndAutoStates:m,unmatchedCount:C}};this.columnAnimationService.start();let{unmatchedAndAutoStates:s,unmatchedCount:o}=i(e.state||[],this.primaryColumns||[],n=>this.getPrimaryColumn(n));return(s.length>0||R(e.defaultState))&&(o=i(s,this.secondaryColumns||[],n=>this.getSecondaryColumn(n)).unmatchedCount),this.columnAnimationService.finish(),o===0}applyOrderAfterApplyState(e){if(!e.applyOrder||!e.state)return;let t=[];const i={};e.state.forEach(o=>{if(!o.colId||i[o.colId])return;const n=this.gridColumnsMap[o.colId];n&&(t.push(n),i[o.colId]=!0)});let s=0;if(this.gridColumns.forEach(o=>{const n=o.getColId();if(i[n]!=null)return;n.startsWith(ns)?$s(t,o,s++):t.push(o)}),t=this.placeLockedColumns(t),!this.doesMovePassMarryChildren(t)){console.warn("AG Grid: Applying column order broke a group where columns should be married together. Applying new order has been discarded.");return}this.gridColumns=t}compareColumnStatesAndDispatchEvents(e){const t={rowGroupColumns:this.rowGroupColumns.slice(),pivotColumns:this.pivotColumns.slice(),valueColumns:this.valueColumns.slice()},i=this.getColumnState(),s={};return i.forEach(o=>{s[o.colId]=o}),()=>{const o=this.getPrimaryAndSecondaryAndAutoColumns(),n=(C,y,v,E)=>{const b=y.map(E),_=v.map(E);if(ai(b,_))return;const L={type:C,columns:v,column:v.length===1?v[0]:null,source:e};this.eventService.dispatchEvent(L)},r=C=>{const y=[];return o.forEach(v=>{const E=s[v.getColId()];E&&C(E,v)&&y.push(v)}),y},a=C=>C.getColId();n(u.EVENT_COLUMN_ROW_GROUP_CHANGED,t.rowGroupColumns,this.rowGroupColumns,a),n(u.EVENT_COLUMN_PIVOT_CHANGED,t.pivotColumns,this.pivotColumns,a),r((C,y)=>{const v=C.aggFunc!=null,E=v!=y.isValueActive(),b=v&&C.aggFunc!=y.getAggFunc();return E||b}).length>0&&this.dispatchColumnChangedEvent(u.EVENT_COLUMN_VALUE_CHANGED,this.valueColumns,e);const h=(C,y)=>C.width!=y.getActualWidth();this.dispatchColumnResizedEvent(r(h),!0,e);const g=(C,y)=>C.pinned!=y.getPinned();this.dispatchColumnPinnedEvent(r(g),e);const f=(C,y)=>C.hide==y.isVisible();this.dispatchColumnVisibleEvent(r(f),e),r((C,y)=>C.sort!=y.getSort()||C.sortIndex!=y.getSortIndex()).length>0&&this.sortController.dispatchSortChangedEvents(e),this.normaliseColumnMovedEventForColumnState(i,e)}}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}normaliseColumnMovedEventForColumnState(e,t){const i=this.getColumnState(),s={};i.forEach(d=>s[d.colId]=d);const o={};e.forEach(d=>{s[d.colId]&&(o[d.colId]=!0)});const n=e.filter(d=>o[d.colId]),r=i.filter(d=>o[d.colId]),a=[];r.forEach((d,c)=>{const h=n&&n[c];if(h&&h.colId!==d.colId){const g=this.getGridColumn(h.colId);g&&a.push(g)}}),a.length&&this.dispatchColumnMovedEvent({movedColumns:a,source:t,finished:!0})}syncColumnWithStateItem(e,t,i,s,o,n,r){if(!e)return;const a=(F,L)=>{const I={value1:void 0,value2:void 0};let U=!1;return t&&(t[F]!==void 0&&(I.value1=t[F],U=!0),R(L)&&t[L]!==void 0&&(I.value2=t[L],U=!0)),!U&&i&&(i[F]!==void 0&&(I.value1=i[F]),R(L)&&i[L]!==void 0&&(I.value2=i[L])),I},d=a("hide").value1;d!==void 0&&e.setVisible(!d,r);const c=a("pinned").value1;c!==void 0&&e.setPinned(c);const h=this.columnUtils.calculateColMinWidth(e.getColDef()),g=a("flex").value1;if(g!==void 0&&e.setFlex(g),e.getFlex()<=0){const F=a("width").value1;F!=null&&h!=null&&F>=h&&e.setActualWidth(F,r)}const m=a("sort").value1;m!==void 0&&(m==="desc"||m==="asc"?e.setSort(m,r):e.setSort(void 0,r));const C=a("sortIndex").value1;if(C!==void 0&&e.setSortIndex(C),n||!e.isPrimary())return;const y=a("aggFunc").value1;y!==void 0&&(typeof y=="string"?(e.setAggFunc(y),e.isValueActive()||(e.setValueActive(!0,r),this.valueColumns.push(e))):(R(y)&&console.warn("AG Grid: stateItem.aggFunc must be a string. if using your own aggregation functions, register the functions first before using them in get/set state. This is because it is intended for the column state to be stored and retrieved as simple JSON."),e.isValueActive()&&(e.setValueActive(!1,r),ve(this.valueColumns,e))));const{value1:v,value2:E}=a("rowGroup","rowGroupIndex");(v!==void 0||E!==void 0)&&(typeof E=="number"||v?(e.isRowGroupActive()||(e.setRowGroupActive(!0,r),this.rowGroupColumns.push(e)),s&&typeof E=="number"&&(s[e.getId()]=E)):e.isRowGroupActive()&&(e.setRowGroupActive(!1,r),ve(this.rowGroupColumns,e)));const{value1:b,value2:_}=a("pivot","pivotIndex");(b!==void 0||_!==void 0)&&(typeof _=="number"||b?(e.isPivotActive()||(e.setPivotActive(!0,r),this.pivotColumns.push(e)),o&&typeof _=="number"&&(o[e.getId()]=_)):e.isPivotActive()&&(e.setPivotActive(!1,r),ve(this.pivotColumns,e)))}getGridColumns(e){return this.getColumns(e,this.getGridColumn.bind(this))}getColumns(e,t){const i=[];return e&&e.forEach(s=>{const o=t(s);o&&i.push(o)}),i}getColumnWithValidation(e){if(e==null)return null;const t=this.getGridColumn(e);return t||console.warn("AG Grid: could not find column "+e),t}getPrimaryColumn(e){return this.primaryColumns?this.getColumn(e,this.primaryColumns,this.primaryColumnsMap):null}getGridColumn(e){return this.getColumn(e,this.gridColumns,this.gridColumnsMap)}getSecondaryColumn(e){return this.secondaryColumns?this.getColumn(e,this.secondaryColumns,this.secondaryColumnsMap):null}getColumn(e,t,i){if(!e)return null;if(typeof e=="string"&&i[e])return i[e];for(let s=0;s<t.length;s++)if(this.columnsMatch(t[s],e))return t[s];return this.getAutoColumn(e)}getSourceColumnsForGroupColumn(e){const t=e.getColDef().showRowGroup;if(!t)return null;if(t===!0)return this.rowGroupColumns.slice(0);const i=this.getPrimaryColumn(t);return i?[i]:null}getAutoColumn(e){return!this.groupAutoColumns||!R(this.groupAutoColumns)||x(this.groupAutoColumns)?null:this.groupAutoColumns.find(t=>this.columnsMatch(t,e))||null}columnsMatch(e,t){const i=e===t,s=e.getColDef()===t,o=e.getColId()==t;return i||s||o}getDisplayNameForColumn(e,t,i=!1){if(!e)return null;const s=this.getHeaderName(e.getColDef(),e,null,null,t);return i?this.wrapHeaderNameWithAggFunc(e,s):s}getDisplayNameForProvidedColumnGroup(e,t,i){const s=t?t.getColGroupDef():null;return s?this.getHeaderName(s,null,e,t,i):null}getDisplayNameForColumnGroup(e,t){return this.getDisplayNameForProvidedColumnGroup(e,e.getProvidedColumnGroup(),t)}getHeaderName(e,t,i,s,o){const n=e.headerValueGetter;if(n){const r={colDef:e,column:t,columnGroup:i,providedColumnGroup:s,location:o,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context};return typeof n=="function"?n(r):typeof n=="string"?this.expressionService.evaluate(n,r):(console.warn("AG Grid: headerValueGetter must be a function or a string"),"")}else{if(e.headerName!=null)return e.headerName;if(e.field)return Ja(e.field)}return""}wrapHeaderNameWithAggFunc(e,t){if(this.gridOptionsService.is("suppressAggFuncInHeader"))return t;const i=e.getColDef().pivotValueColumn,s=R(i);let o=null,n;if(s){const r=this.gridOptionsService.is("removePivotHeaderRowWhenSingleValueColumn")&&this.valueColumns.length===1,a=e.getColDef().pivotTotalColumnIds!==void 0;if(r&&!a)return t;o=i?i.getAggFunc():null,n=!0}else{const r=e.isValueActive(),a=this.pivotMode||!this.isRowGroupEmpty();r&&a?(o=e.getAggFunc(),n=!0):n=!1}if(n){const r=typeof o=="string"?o:"func";return`${this.localeService.getLocaleTextFunc()(r,r)}(${t})`}return t}getColumnGroup(e,t){if(!e)return null;if(e instanceof te)return e;const i=this.getAllDisplayedTrees(),s=typeof t=="number";let o=null;return this.columnUtils.depthFirstAllColumnTreeSearch(i,n=>{if(n instanceof te){const r=n;let a;s?a=e===r.getGroupId()&&t===r.getPartId():a=e===r.getGroupId(),a&&(o=r)}}),o}isReady(){return this.ready}extractValueColumns(e,t){this.valueColumns=this.extractColumns(t,this.valueColumns,(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.valueColumns.forEach(i=>{const s=i.getColDef();s.aggFunc!=null&&s.aggFunc!=""?i.setAggFunc(s.aggFunc):i.getAggFunc()||i.setAggFunc(s.initialAggFunc)})}extractRowGroupColumns(e,t){this.rowGroupColumns=this.extractColumns(t,this.rowGroupColumns,(i,s)=>i.setRowGroupActive(s,e),i=>i.rowGroupIndex,i=>i.initialRowGroupIndex,i=>i.rowGroup,i=>i.initialRowGroup)}extractColumns(e=[],t=[],i,s,o,n,r){const a=[],d=[];(this.primaryColumns||[]).forEach(g=>{const f=e.indexOf(g)<0,m=g.getColDef(),C=Pt(n(m)),y=Pt(r(m)),v=Je(s(m)),E=Je(o(m));let b;C!==void 0?b=C:v!==void 0?v===null?b=!1:b=v>=0:f?y!==void 0?b=y:E!==void 0?b=E!=null&&E>=0:b=!1:b=t.indexOf(g)>=0,b&&((f?v!=null||E!=null:v!=null)?a.push(g):d.push(g))});const c=g=>{const f=s(g.getColDef()),m=o(g.getColDef());return f??m};a.sort((g,f)=>{const m=c(g),C=c(f);return m===C?0:m<C?-1:1});const h=[].concat(a);return t.forEach(g=>{d.indexOf(g)>=0&&h.push(g)}),d.forEach(g=>{h.indexOf(g)<0&&h.push(g)}),t.forEach(g=>{h.indexOf(g)<0&&i(g,!1)}),h.forEach(g=>{t.indexOf(g)<0&&i(g,!0)}),h}extractPivotColumns(e,t){this.pivotColumns=this.extractColumns(t,this.pivotColumns,(i,s)=>i.setPivotActive(s,e),i=>i.pivotIndex,i=>i.initialPivotIndex,i=>i.pivot,i=>i.initialPivot)}resetColumnGroupState(e="api"){const t=[];this.columnUtils.depthFirstOriginalTreeSearch(null,this.primaryColumnTree,i=>{if(i instanceof ee){const s=i.getColGroupDef(),o={groupId:i.getGroupId(),open:s?s.openByDefault:void 0};t.push(o)}}),this.setColumnGroupState(t,e)}getColumnGroupState(){const e=[];return this.columnUtils.depthFirstOriginalTreeSearch(null,this.gridBalancedTree,t=>{t instanceof ee&&e.push({groupId:t.getGroupId(),open:t.isExpanded()})}),e}setColumnGroupState(e,t="api"){this.columnAnimationService.start();const i=[];e.forEach(s=>{const o=s.groupId,n=s.open,r=this.getProvidedColumnGroup(o);r&&r.isExpanded()!==n&&(this.logger.log("columnGroupOpened("+r.getGroupId()+","+n+")"),r.setExpanded(n),i.push(r))}),this.updateGroupsAndDisplayedColumns(t),this.setFirstRightAndLastLeftPinned(t),i.forEach(s=>{const o={type:u.EVENT_COLUMN_GROUP_OPENED,columnGroup:s};this.eventService.dispatchEvent(o)}),this.columnAnimationService.finish()}setColumnGroupOpened(e,t,i="api"){let s;e instanceof ee?s=e.getId():s=e||"",this.setColumnGroupState([{groupId:s,open:t}],i)}getProvidedColumnGroup(e){typeof e!="string"&&console.error("AG Grid: group key must be a string");let t=null;return this.columnUtils.depthFirstOriginalTreeSearch(null,this.gridBalancedTree,i=>{i instanceof ee&&i.getId()===e&&(t=i)}),t}calculateColumnsForDisplay(){let e;return this.pivotMode&&x(this.secondaryColumns)?e=this.gridColumns.filter(t=>{const i=this.groupAutoColumns&&Ze(this.groupAutoColumns,t),s=this.valueColumns&&Ze(this.valueColumns,t);return i||s}):e=this.gridColumns.filter(t=>this.groupAutoColumns&&Ze(this.groupAutoColumns,t)||t.isVisible()),e}checkColSpanActiveInCols(e){let t=!1;return e.forEach(i=>{R(i.getColDef().colSpan)&&(t=!0)}),t}calculateColumnsForGroupDisplay(){this.groupDisplayColumns=[],this.groupDisplayColumnsMap={};const e=t=>{const i=t.getColDef(),s=i.showRowGroup;i&&R(s)&&(this.groupDisplayColumns.push(t),typeof s=="string"?this.groupDisplayColumnsMap[s]=t:s===!0&&this.getRowGroupColumns().forEach(o=>{this.groupDisplayColumnsMap[o.getId()]=t}))};this.gridColumns.forEach(e)}getGroupDisplayColumns(){return this.groupDisplayColumns}getGroupDisplayColumnForGroup(e){return this.groupDisplayColumnsMap[e]}updateDisplayedColumns(e){const t=this.calculateColumnsForDisplay();this.buildDisplayedTrees(t),this.updateGroupsAndDisplayedColumns(e),this.setFirstRightAndLastLeftPinned(e)}isSecondaryColumnsPresent(){return R(this.secondaryColumns)}setSecondaryColumns(e,t="api"){const i=e&&e.length>0;if(!(!i&&x(this.secondaryColumns))){if(i){this.processSecondaryColumnDefinitions(e);const s=this.columnFactory.createColumnTree(e,!1,this.secondaryBalancedTree||this.previousSecondaryColumns||void 0);this.destroyOldColumns(this.secondaryBalancedTree,s.columnTree),this.secondaryBalancedTree=s.columnTree,this.secondaryHeaderRowCount=s.treeDept+1,this.secondaryColumns=this.getColumnsFromTree(this.secondaryBalancedTree),this.secondaryColumnsMap={},this.secondaryColumns.forEach(o=>this.secondaryColumnsMap[o.getId()]=o),this.previousSecondaryColumns=null}else this.previousSecondaryColumns=this.secondaryBalancedTree,this.secondaryBalancedTree=null,this.secondaryHeaderRowCount=-1,this.secondaryColumns=null,this.secondaryColumnsMap={};this.updateGridColumns(),this.updateDisplayedColumns(t)}}processSecondaryColumnDefinitions(e){const t=this.gridOptionsService.get("processPivotResultColDef")||this.gridOptionsService.get("processSecondaryColDef"),i=this.gridOptionsService.get("processPivotResultColGroupDef")||this.gridOptionsService.get("processSecondaryColGroupDef");if(!t&&!i)return;const s=o=>{o.forEach(n=>{if(R(n.children)){const a=n;i&&i(a),s(a.children)}else t&&t(n)})};e&&s(e)}updateGridColumns(){const e=this.gridBalancedTree;this.gridColsArePrimary?this.lastPrimaryOrder=this.gridColumns:this.lastSecondaryOrder=this.gridColumns;let t;if(this.secondaryColumns&&this.secondaryBalancedTree){const s=this.secondaryColumns.every(o=>this.gridColumnsMap[o.getColId()]!==void 0);this.gridBalancedTree=this.secondaryBalancedTree.slice(),this.gridHeaderRowCount=this.secondaryHeaderRowCount,this.gridColumns=this.secondaryColumns.slice(),this.gridColsArePrimary=!1,s&&(t=this.lastSecondaryOrder)}else this.primaryColumns&&(this.gridBalancedTree=this.primaryColumnTree.slice(),this.gridHeaderRowCount=this.primaryHeaderRowCount,this.gridColumns=this.primaryColumns.slice(),this.gridColsArePrimary=!0,t=this.lastPrimaryOrder);if(this.createGroupAutoColumnsIfNeeded()&&t){const s=Qt(this.groupAutoColumns.map(o=>[o,!0]));t=t.filter(o=>!s.has(o)),t=[...this.groupAutoColumns,...t]}if(this.addAutoGroupToGridColumns(),this.orderGridColsLike(t),this.gridColumns=this.placeLockedColumns(this.gridColumns),this.calculateColumnsForGroupDisplay(),this.refreshQuickFilterColumns(),this.clearDisplayedAndViewportColumns(),this.colSpanActive=this.checkColSpanActiveInCols(this.gridColumns),this.gridColumnsMap={},this.gridColumns.forEach(s=>this.gridColumnsMap[s.getId()]=s),this.setAutoHeightActive(),!ai(e,this.gridBalancedTree)){const s={type:u.EVENT_GRID_COLUMNS_CHANGED};this.eventService.dispatchEvent(s)}}setAutoHeightActive(){if(this.autoHeightActive=this.gridColumns.filter(e=>e.isAutoHeight()).length>0,this.autoHeightActive&&(this.autoHeightActiveAtLeastOnce=!0,!(this.gridOptionsService.isRowModelType("clientSide")||this.gridOptionsService.isRowModelType("serverSide")))){const t="AG Grid - autoHeight columns only work with Client Side Row Model and Server Side Row Model.";Y(()=>console.warn(t),"autoHeightActive.wrongRowModel")}}orderGridColsLike(e){if(x(e))return;const t=Qt(e.map((d,c)=>[d,c]));let i=!0;if(this.gridColumns.forEach(d=>{t.has(d)&&(i=!1)}),i)return;const s=Qt(this.gridColumns.map(d=>[d,!0])),o=e.filter(d=>s.has(d)),n=Qt(o.map(d=>[d,!0])),r=this.gridColumns.filter(d=>!n.has(d)),a=o.slice();r.forEach(d=>{let c=d.getOriginalParent();if(!c){a.push(d);return}const h=[];for(;!h.length&&c;)c.getLeafColumns().forEach(C=>{const y=a.indexOf(C)>=0,v=h.indexOf(C)<0;y&&v&&h.push(C)}),c=c.getOriginalParent();if(!h.length){a.push(d);return}const g=h.map(m=>a.indexOf(m)),f=Math.max(...g);$s(a,d,f+1)}),this.gridColumns=a}isPrimaryColumnGroupsPresent(){return this.primaryHeaderRowCount>1}refreshQuickFilterColumns(){var e;let t=(e=this.isPivotMode()?this.secondaryColumns:this.primaryColumns)!==null&&e!==void 0?e:[];this.groupAutoColumns&&(t=t.concat(this.groupAutoColumns)),this.columnsForQuickFilter=this.gridOptionsService.is("includeHiddenColumnsInQuickFilter")?t:t.filter(i=>i.isVisible()||i.isRowGroupActive())}placeLockedColumns(e){const t=[],i=[],s=[];return e.forEach(o=>{const n=o.getColDef().lockPosition;n==="right"?s.push(o):n==="left"||n===!0?t.push(o):i.push(o)}),[...t,...i,...s]}addAutoGroupToGridColumns(){if(x(this.groupAutoColumns)){this.destroyOldColumns(this.groupAutoColsBalancedTree),this.groupAutoColsBalancedTree=null;return}this.gridColumns=this.groupAutoColumns?this.groupAutoColumns.concat(this.gridColumns):this.gridColumns;const e=this.columnFactory.createForAutoGroups(this.groupAutoColumns,this.gridBalancedTree);this.destroyOldColumns(this.groupAutoColsBalancedTree,e),this.groupAutoColsBalancedTree=e,this.gridBalancedTree=e.concat(this.gridBalancedTree)}clearDisplayedAndViewportColumns(){this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={},this.displayedColumnsLeft=[],this.displayedColumnsRight=[],this.displayedColumnsCenter=[],this.displayedColumns=[],this.viewportColumns=[],this.headerViewportColumns=[],this.viewportColumnsHash=""}updateGroupsAndDisplayedColumns(e){this.updateOpenClosedVisibilityInColumnGroups(),this.deriveDisplayedColumns(e),this.refreshFlexedColumns(),this.extractViewport(),this.updateBodyWidths();const t={type:u.EVENT_DISPLAYED_COLUMNS_CHANGED};this.eventService.dispatchEvent(t)}deriveDisplayedColumns(e){this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeLeft,this.displayedColumnsLeft),this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeCentre,this.displayedColumnsCenter),this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeRight,this.displayedColumnsRight),this.joinDisplayedColumns(),this.setLeftValues(e),this.displayedAutoHeightCols=this.displayedColumns.filter(t=>t.isAutoHeight())}isAutoRowHeightActive(){return this.autoHeightActive}wasAutoRowHeightEverActive(){return this.autoHeightActiveAtLeastOnce}joinDisplayedColumns(){this.gridOptionsService.is("enableRtl")?this.displayedColumns=this.displayedColumnsRight.concat(this.displayedColumnsCenter).concat(this.displayedColumnsLeft):this.displayedColumns=this.displayedColumnsLeft.concat(this.displayedColumnsCenter).concat(this.displayedColumnsRight)}setLeftValues(e){this.setLeftValuesOfColumns(e),this.setLeftValuesOfGroups()}setLeftValuesOfColumns(e){if(!this.primaryColumns)return;const t=this.primaryColumns.slice(0),i=this.gridOptionsService.is("enableRtl");[this.displayedColumnsLeft,this.displayedColumnsRight,this.displayedColumnsCenter].forEach(s=>{if(i){let o=this.getWidthOfColsInList(s);s.forEach(n=>{o-=n.getActualWidth(),n.setLeft(o,e)})}else{let o=0;s.forEach(n=>{n.setLeft(o,e),o+=n.getActualWidth()})}Lr(t,s)}),t.forEach(s=>{s.setLeft(null,e)})}setLeftValuesOfGroups(){[this.displayedTreeLeft,this.displayedTreeRight,this.displayedTreeCentre].forEach(e=>{e.forEach(t=>{t instanceof te&&t.checkLeft()})})}derivedDisplayedColumnsFromDisplayedTree(e,t){t.length=0,this.columnUtils.depthFirstDisplayedColumnTreeSearch(e,i=>{i instanceof H&&t.push(i)})}extractViewportColumns(){this.suppressColumnVirtualisation?(this.viewportColumnsCenter=this.displayedColumnsCenter,this.headerViewportColumnsCenter=this.displayedColumnsCenter):(this.viewportColumnsCenter=this.displayedColumnsCenter.filter(this.isColumnInRowViewport.bind(this)),this.headerViewportColumnsCenter=this.displayedColumnsCenter.filter(this.isColumnInHeaderViewport.bind(this))),this.viewportColumns=this.viewportColumnsCenter.concat(this.displayedColumnsLeft).concat(this.displayedColumnsRight),this.headerViewportColumns=this.headerViewportColumnsCenter.concat(this.displayedColumnsLeft).concat(this.displayedColumnsRight)}getVirtualHeaderGroupRow(e,t){let i;switch(e){case"left":i=this.viewportRowLeft[t];break;case"right":i=this.viewportRowRight[t];break;default:i=this.viewportRowCenter[t];break}return x(i)&&(i=[]),i}calculateHeaderRows(){this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={};const e={};this.headerViewportColumns.forEach(i=>e[i.getId()]=!0);const t=(i,s,o)=>{let n=!1;for(let r=0;r<i.length;r++){const a=i[r];let d=!1;if(a instanceof H)d=e[a.getId()]===!0;else{const h=a.getDisplayedChildren();h&&(d=t(h,s,o+1))}d&&(n=!0,s[o]||(s[o]=[]),s[o].push(a))}return n};t(this.displayedTreeLeft,this.viewportRowLeft,0),t(this.displayedTreeRight,this.viewportRowRight,0),t(this.displayedTreeCentre,this.viewportRowCenter,0)}extractViewport(){const e=s=>`${s.getId()}-${s.getPinned()||"normal"}`;this.extractViewportColumns();const t=this.viewportColumns.map(e).join("#"),i=this.viewportColumnsHash!==t;return i&&(this.viewportColumnsHash=t,this.calculateHeaderRows()),i}refreshFlexedColumns(e={}){const t=e.source?e.source:"flex";if(e.viewportWidth!=null&&(this.flexViewportWidth=e.viewportWidth),!this.flexViewportWidth)return[];let i=-1;e.resizingCols&&e.resizingCols.forEach(h=>{const g=this.displayedColumnsCenter.indexOf(h);i<g&&(i=g)});const s=h=>{const g=this.displayedColumnsCenter.indexOf(h)>i;return h.getFlex()&&g},o=this.displayedColumnsCenter.filter(h=>!s(h)),n=this.displayedColumnsCenter.filter(h=>s(h)),r=[];if(!n.length)return[];const a=[];let d;e:for(;;){const h=n.reduce((g,f)=>g+f.getFlex(),0);d=this.flexViewportWidth-this.getWidthOfColsInList(o);for(let g=0;g<n.length;g++){const f=n[g],m=d*f.getFlex()/h;let C=0;const y=f.getMinWidth(),v=f.getMaxWidth();if(R(y)&&m<y?C=y:R(v)&&m>v&&(C=v),C){f.setActualWidth(C,t),ve(n,f),r.push(f),o.push(f);continue e}a[g]=Math.round(m)}break}let c=d;return n.forEach((h,g)=>{h.setActualWidth(Math.min(a[g],c),t),r.push(h),c-=a[g]}),e.skipSetLeft||this.setLeftValues(t),e.updateBodyWidths&&this.updateBodyWidths(),e.fireResizedEvent&&this.dispatchColumnResizedEvent(r,!0,t,n),n}sizeColumnsToFit(e,t="sizeColumnsToFit",i,s){var o,n,r,a,d;if(this.shouldQueueResizeOperations){this.resizeOperationQueue.push(()=>this.sizeColumnsToFit(e,t,i,s));return}const c={};s&&((o=s==null?void 0:s.columnLimits)===null||o===void 0||o.forEach(E=>{var{key:b}=E,_=Yu(E,["key"]);c[typeof b=="string"?b:b.getColId()]=_}));const h=this.getAllDisplayedColumns(),g=e===this.getWidthOfColsInList(h);if(e<=0||!h.length||g)return;const f=[],m=[];h.forEach(E=>{E.getColDef().suppressSizeToFit===!0?m.push(E):f.push(E)});const C=f.slice(0);let y=!1;const v=E=>{ve(f,E),m.push(E)};for(f.forEach(E=>E.resetActualWidth(t));!y;){y=!0;const E=e-this.getWidthOfColsInList(m);if(E<=0)f.forEach(b=>{var _,F;const L=(F=(_=c==null?void 0:c[b.getId()])===null||_===void 0?void 0:_.minWidth)!==null&&F!==void 0?F:s==null?void 0:s.defaultMinWidth;if(typeof L=="number"){b.setActualWidth(L);return}b.setMinimum(t)});else{const b=E/this.getWidthOfColsInList(f);let _=E;for(let F=f.length-1;F>=0;F--){const L=f[F],I=c==null?void 0:c[L.getId()],U=(n=I==null?void 0:I.minWidth)!==null&&n!==void 0?n:s==null?void 0:s.defaultMinWidth,oe=(r=I==null?void 0:I.maxWidth)!==null&&r!==void 0?r:s==null?void 0:s.defaultMaxWidth,ne=(a=L.getMinWidth())!==null&&a!==void 0?a:0,Ge=(d=L.getMaxWidth())!==null&&d!==void 0?d:Number.MAX_VALUE,He=typeof U=="number"&&U>ne?U:L.getMinWidth(),Le=typeof oe=="number"&&oe<Ge?oe:L.getMaxWidth();let pt=Math.round(L.getActualWidth()*b);R(He)&&pt<He?(pt=He,v(L),y=!1):R(Le)&&pt>Le?(pt=Le,v(L),y=!1):F===0&&(pt=_),L.setActualWidth(pt,t,!0),_-=pt}}}C.forEach(E=>{E.fireColumnWidthChangedEvent(t)}),this.setLeftValues(t),this.updateBodyWidths(),!i&&this.dispatchColumnResizedEvent(C,!0,t)}buildDisplayedTrees(e){const t=[],i=[],s=[];e.forEach(n=>{switch(n.getPinned()){case"left":t.push(n);break;case"right":i.push(n);break;default:s.push(n);break}});const o=new Qa;this.displayedTreeLeft=this.displayedGroupCreator.createDisplayedGroups(t,this.gridBalancedTree,o,"left",this.displayedTreeLeft),this.displayedTreeRight=this.displayedGroupCreator.createDisplayedGroups(i,this.gridBalancedTree,o,"right",this.displayedTreeRight),this.displayedTreeCentre=this.displayedGroupCreator.createDisplayedGroups(s,this.gridBalancedTree,o,null,this.displayedTreeCentre),this.updateDisplayedMap()}updateDisplayedMap(){this.displayedColumnsAndGroupsMap={};const e=t=>{this.displayedColumnsAndGroupsMap[t.getUniqueId()]=t};this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeCentre,e),this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeLeft,e),this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeRight,e)}isDisplayed(e){return this.displayedColumnsAndGroupsMap[e.getUniqueId()]===e}updateOpenClosedVisibilityInColumnGroups(){const e=this.getAllDisplayedTrees();this.columnUtils.depthFirstAllColumnTreeSearch(e,t=>{t instanceof te&&t.calculateDisplayedColumns()})}getGroupAutoColumns(){return this.groupAutoColumns}createGroupAutoColumnsIfNeeded(){const e=this.forceRecreateAutoGroups;if(this.forceRecreateAutoGroups=!1,!this.autoGroupsNeedBuilding)return!1;this.autoGroupsNeedBuilding=!1;const t=this.gridOptionsService.isGroupUseEntireRow(this.pivotMode),i=this.pivotMode?this.gridOptionsService.is("pivotSuppressAutoColumn"):this.isGroupSuppressAutoColumn();if((this.rowGroupColumns.length>0||this.usingTreeData)&&!i&&!t){const n=this.groupAutoColumns||[],r=this.autoGroupColService.createAutoGroupColumns(n,this.rowGroupColumns);if(!this.autoColsEqual(r,this.groupAutoColumns)||e)return this.groupAutoColumns=r,!0}else this.groupAutoColumns=null;return!1}isGroupSuppressAutoColumn(){const e=this.gridOptionsService.get("groupDisplayType");if(e?Hr("custom",e):!1)return!0;const i=this.gridOptionsService.get("treeDataDisplayType");return i?$u("custom",i):!1}autoColsEqual(e,t){return ai(e,t,(i,s)=>i.getColId()===s.getColId())}getWidthOfColsInList(e){return e.reduce((t,i)=>t+i.getActualWidth(),0)}getGridBalancedTree(){return this.gridBalancedTree}hasFloatingFilters(){return this.gridColumns?this.gridColumns.some(t=>t.getColDef().floatingFilter):!1}getFirstDisplayedColumn(){const e=this.gridOptionsService.is("enableRtl"),t=["getDisplayedLeftColumns","getDisplayedCenterColumns","getDisplayedRightColumns"];e&&t.reverse();for(let i=0;i<t.length;i++){const s=this[t[i]]();if(s.length)return e?Z(s):s[0]}return null}setColumnHeaderHeight(e,t){if(e.setAutoHeaderHeight(t)){const s={type:u.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,column:e,columns:[e],source:"autosizeColumnHeaderHeight"};this.eventService.dispatchEvent(s)}}getColumnGroupHeaderRowHeight(){return this.isPivotMode()?this.getPivotGroupHeaderHeight():this.getGroupHeaderHeight()}getColumnHeaderRowHeight(){const e=this.isPivotMode()?this.getPivotHeaderHeight():this.getHeaderHeight(),t=this.getAllDisplayedColumns().filter(i=>i.isAutoHeaderHeight()).map(i=>i.getAutoHeaderHeight()||0);return Math.max(e,...t)}getHeaderHeight(){var e;return(e=this.gridOptionsService.getNum("headerHeight"))!==null&&e!==void 0?e:this.environment.getFromTheme(25,"headerHeight")}getFloatingFiltersHeight(){var e;return(e=this.gridOptionsService.getNum("floatingFiltersHeight"))!==null&&e!==void 0?e:this.getHeaderHeight()}getGroupHeaderHeight(){var e;return(e=this.gridOptionsService.getNum("groupHeaderHeight"))!==null&&e!==void 0?e:this.getHeaderHeight()}getPivotHeaderHeight(){var e;return(e=this.gridOptionsService.getNum("pivotHeaderHeight"))!==null&&e!==void 0?e:this.getHeaderHeight()}getPivotGroupHeaderHeight(){var e;return(e=this.gridOptionsService.getNum("pivotGroupHeaderHeight"))!==null&&e!==void 0?e:this.getGroupHeaderHeight()}queueResizeOperations(){this.shouldQueueResizeOperations=!0}processResizeOperations(){this.shouldQueueResizeOperations=!1,this.resizeOperationQueue.forEach(e=>e()),this.resizeOperationQueue=[]}resetColumnDefIntoColumn(e){const t=e.getUserProvidedColDef();if(!t)return!1;const i=this.columnFactory.mergeColDefs(t,e.getColId());return e.setColDef(i,t),!0}generateColumnStateForRowGroupAndPivotIndexes(e,t){let i={};const s=(o,n,r,a,d,c)=>{if(!n.length||!this.primaryColumns)return[];const h=Object.keys(o),g=new Set(h),f=new Set(h),m=new Set(n.map(L=>{const I=L.getColId();return f.delete(I),I}).concat(h)),C=[],y={};let v=0;for(let L=0;L<this.primaryColumns.length;L++){const I=this.primaryColumns[L].getColId();m.has(I)&&(C.push(I),y[I]=v++)}let E=1e3,b=!1,_=0;const F=L=>{const I=y[L];for(let U=_;U<I;U++){const oe=C[U];f.has(oe)&&(o[oe][d]=E++,f.delete(oe))}_=I};n.forEach(L=>{const I=L.getColId();if(g.has(I))F(I),o[I][d]=E++;else{const U=L.getColDef();(U[d]===null||U[d]===void 0&&U[c]==null)&&(b||(U[r]||U[r]===void 0&&U[a]?F(I):(f.forEach(Ge=>{o[Ge][d]=E+y[Ge]}),E+=C.length,b=!0)),i[I]||(i[I]={colId:I}),i[I][d]=E++)}})};return s(e,this.rowGroupColumns,"rowGroup","initialRowGroup","rowGroupIndex","initialRowGroupIndex"),s(t,this.pivotColumns,"pivot","initialPivot","pivotIndex","initialPivotIndex"),Object.values(i)}};ge([p("expressionService")],ce.prototype,"expressionService",void 0),ge([p("columnFactory")],ce.prototype,"columnFactory",void 0),ge([p("displayedGroupCreator")],ce.prototype,"displayedGroupCreator",void 0),ge([p("ctrlsService")],ce.prototype,"ctrlsService",void 0),ge([p("autoWidthCalculator")],ce.prototype,"autoWidthCalculator",void 0),ge([p("columnUtils")],ce.prototype,"columnUtils",void 0),ge([p("columnAnimationService")],ce.prototype,"columnAnimationService",void 0),ge([p("autoGroupColService")],ce.prototype,"autoGroupColService",void 0),ge([X("aggFuncService")],ce.prototype,"aggFuncService",void 0),ge([X("valueCache")],ce.prototype,"valueCache",void 0),ge([X("animationFrameService")],ce.prototype,"animationFrameService",void 0),ge([p("sortController")],ce.prototype,"sortController",void 0),ge([p("columnDefFactory")],ce.prototype,"columnDefFactory",void 0),ge([D],ce.prototype,"init",null),ge([he],ce.prototype,"destroyColumns",null),ge([Ku(0,Te("loggerFactory"))],ce.prototype,"setBeans",null),ce=ge([M("columnModel")],ce);var qu=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let Vr=class extends T{calculateColMinWidth(e){return e.minWidth!=null?e.minWidth:this.environment.getMinColWidth()}calculateColMaxWidth(e){return e.maxWidth!=null?e.maxWidth:Number.MAX_SAFE_INTEGER}calculateColInitialWidth(e){const t=this.calculateColMinWidth(e),i=this.calculateColMaxWidth(e);let s;const o=Je(e.width),n=Je(e.initialWidth);return o!=null?s=o:n!=null?s=n:s=200,Math.max(Math.min(s,i),t)}getOriginalPathForColumn(e,t){const i=[];let s=!1;const o=(n,r)=>{for(let a=0;a<n.length;a++){if(s)return;const d=n[a];d instanceof ee?(o(d.getChildren(),r+1),i[r]=d):d===e&&(s=!0)}};return o(t,0),s?i:null}depthFirstOriginalTreeSearch(e,t,i){t&&t.forEach(s=>{s instanceof ee&&this.depthFirstOriginalTreeSearch(s,s.getChildren(),i),i(s,e)})}depthFirstAllColumnTreeSearch(e,t){e&&e.forEach(i=>{i instanceof te&&this.depthFirstAllColumnTreeSearch(i.getChildren(),t),t(i)})}depthFirstDisplayedColumnTreeSearch(e,t){e&&e.forEach(i=>{i instanceof te&&this.depthFirstDisplayedColumnTreeSearch(i.getDisplayedChildren(),t),t(i)})}};Vr=qu([M("columnUtils")],Vr);var Qu=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let Br=class extends T{createDisplayedGroups(e,t,i,s,o){const n=[];let r,a;const d=this.mapOldGroupsById(o);return e.forEach(c=>{const h=this.getOriginalPathForColumn(t,c),g=[],f=!a;for(let C=0;C<h.length;C++)if(f||h[C]!==a[C]){const y=this.createColumnGroup(h[C],i,d,s);g[C]=y,C==0?n.push(y):g[C-1].addChild(y)}else g[C]=r[C];g.length===0?n.push(c):Z(g).addChild(c),r=g,a=h}),this.setupParentsIntoColumns(n,null),n}createColumnGroup(e,t,i,s){const o=e.getGroupId(),n=t.getInstanceIdForKey(o),r=te.createUniqueId(o,n);let a=i[r];return a&&a.getProvidedColumnGroup()!==e&&(a=null),R(a)?a.reset():(a=new te(e,o,n,s),this.context.createBean(a)),a}mapOldGroupsById(e){const t={},i=s=>{s.forEach(o=>{if(o instanceof te){const n=o;t[o.getUniqueId()]=n,i(n.getChildren())}})};return e&&i(e),t}setupParentsIntoColumns(e,t){e.forEach(i=>{if(i.setParent(t),i instanceof te){const s=i;this.setupParentsIntoColumns(s.getChildren(),s)}})}getOriginalPathForColumn(e,t){const i=[];let s=!1;const o=(n,r)=>{for(let a=0;a<n.length;a++){if(s)return;const d=n[a];d instanceof ee?(o(d.getChildren(),r+1),i[r]=d):d===t&&(s=!0)}};return o(e,0),s?i:(console.warn("AG Grid: could not get path"),null)}};Br=Qu([M("displayedGroupCreator")],Br);var Xu=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let Wr=class extends T{constructor(){super(...arguments),this.componentsMappedByName={}}setupComponents(e){e&&e.forEach(t=>this.addComponent(t))}addComponent(e){const i=e.componentName.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase().toUpperCase();this.componentsMappedByName[i]=e.componentClass}getComponentClass(e){return this.componentsMappedByName[e]}};Wr=Xu([M("agStackComponentsRegistry")],Wr);function Mt(l,e,t){t==null||t==""?kr(l,e):tt(l,e,t)}function tt(l,e,t){l.setAttribute(id(e),t.toString())}function kr(l,e){l.removeAttribute(id(e))}function id(l){return`aria-${l}`}function pe(l,e){e?l.setAttribute("role",e):l.removeAttribute("role")}function sd(l){let e;return l==="asc"?e="ascending":l==="desc"?e="descending":l==="mixed"?e="other":e="none",e}function od(l){return parseInt(l.getAttribute("aria-level"),10)}function nd(l){return parseInt(l.getAttribute("aria-posinset"),10)}function Ju(l){return l.getAttribute("aria-describedby")||""}function di(l,e){Mt(l,"label",e)}function vn(l,e){Mt(l,"labelledby",e)}function rd(l,e){Mt(l,"description",e)}function ld(l,e){Mt(l,"describedby",e)}function ad(l,e){Mt(l,"live",e)}function dd(l,e){Mt(l,"level",e)}function Ur(l,e){Mt(l,"disabled",e)}function wn(l,e){Mt(l,"hidden",e)}function ft(l,e){tt(l,"expanded",e)}function cd(l){kr(l,"expanded")}function jr(l,e){tt(l,"setsize",e)}function zr(l,e){tt(l,"posinset",e)}function ud(l,e){tt(l,"multiselectable",e)}function hd(l,e){tt(l,"rowcount",e)}function $r(l,e){tt(l,"rowindex",e)}function pd(l,e){tt(l,"colcount",e)}function Kr(l,e){tt(l,"colindex",e)}function gd(l,e){tt(l,"colspan",e)}function fd(l,e){tt(l,"sort",e)}function Cd(l){kr(l,"sort")}function ls(l,e){Mt(l,"selected",e)}function md(l,e){tt(l,"checked",e===void 0?"mixed":e)}function Zu(l,e){Mt(l,"controls",e.id),vn(e,l.id)}function Sn(l,e){return e===void 0?l("ariaIndeterminate","indeterminate"):e===!0?l("ariaChecked","checked"):l("ariaUnchecked","unchecked")}var eh=Object.freeze({__proto__:null,setAriaRole:pe,getAriaSortState:sd,getAriaLevel:od,getAriaPosInSet:nd,getAriaDescribedBy:Ju,setAriaLabel:di,setAriaLabelledBy:vn,setAriaDescription:rd,setAriaDescribedBy:ld,setAriaLive:ad,setAriaLevel:dd,setAriaDisabled:Ur,setAriaHidden:wn,setAriaExpanded:ft,removeAriaExpanded:cd,setAriaSetSize:jr,setAriaPosInSet:zr,setAriaMultiSelectable:ud,setAriaRowCount:hd,setAriaRowIndex:$r,setAriaColCount:pd,setAriaColIndex:Kr,setAriaColSpan:gd,setAriaSort:fd,removeAriaSort:Cd,setAriaSelected:ls,setAriaChecked:md,setAriaControls:Zu,getAriaCheckboxStateName:Sn});let Yr,En,qr,Qr,Xr,Jr,Zr,el;function it(){return Yr===void 0&&(Yr=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),Yr}function tl(){if(En===void 0)if(it()){const l=navigator.userAgent.match(/version\/(\d+)/i);l&&(En=l[1]!=null?parseFloat(l[1]):0)}else En=0;return En}function yn(){if(qr===void 0){const l=window;qr=!!l.chrome&&(!!l.chrome.webstore||!!l.chrome.runtime)||/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}return qr}function il(){return Qr===void 0&&(Qr=/(firefox)/i.test(navigator.userAgent)),Qr}function sl(){return Xr===void 0&&(Xr=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),Xr}function ci(){return Jr===void 0&&(Jr=/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1),Jr}function Rn(){return!it()||tl()>=15}function bn(l){if(!l)return null;const e=l.tabIndex,t=l.getAttribute("tabIndex");return e===-1&&(t===null||t===""&&!il())?null:e.toString()}function vd(){if(!document.body)return-1;let l=1e6;const e=navigator.userAgent.toLowerCase().match(/firefox/)?6e6:1e9,t=document.createElement("div");for(document.body.appendChild(t);;){const i=l*2;if(t.style.height=i+"px",i>e||t.clientHeight!==i)break;l=i}return document.body.removeChild(t),l}function wd(){var l,e,t;return(e=(l=document.body)===null||l===void 0?void 0:l.clientWidth)!==null&&e!==void 0?e:window.innerHeight||((t=document.documentElement)===null||t===void 0?void 0:t.clientWidth)||-1}function Sd(){var l,e,t;return(e=(l=document.body)===null||l===void 0?void 0:l.clientHeight)!==null&&e!==void 0?e:window.innerHeight||((t=document.documentElement)===null||t===void 0?void 0:t.clientHeight)||-1}function Ed(){return el==null&&yd(),el}function yd(){const l=document.body,e=document.createElement("div");e.style.width=e.style.height="100px",e.style.opacity="0",e.style.overflow="scroll",e.style.msOverflowStyle="scrollbar",e.style.position="absolute",l.appendChild(e);let t=e.offsetWidth-e.clientWidth;t===0&&e.clientWidth===0&&(t=null),e.parentNode&&e.parentNode.removeChild(e),t!=null&&(el=t,Zr=t===0)}function as(){return Zr==null&&yd(),Zr}var th=Object.freeze({__proto__:null,isBrowserSafari:it,getSafariVersion:tl,isBrowserChrome:yn,isBrowserFirefox:il,isMacOsUserAgent:sl,isIOSUserAgent:ci,browserSupportsPreventScroll:Rn,getTabIndex:bn,getMaxDivHeight:vd,getBodyWidth:wd,getBodyHeight:Sd,getScrollbarWidth:Ed,isInvisibleScrollbar:as});function ds(l,e){return l.toString().padStart(e,"0")}function Rd(l,e){const t=[];for(let i=l;i<=e;i++)t.push(i);return t}function ih(l){return typeof l=="string"&&(l=parseInt(l,10)),typeof l=="number"?Math.floor(l):null}function sh(l,e){let t="";for(let i=0;i<e;i++)t+=String.fromCharCode(l&255),l>>>=8;return t}function oh(l,e,t){return typeof l!="number"?"":ol(Math.round(l*100)/100,e,t)}function ol(l,e,t){return typeof l!="number"?"":l.toString().replace(".",t).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${e}`)}function nh(l){return l==null?null:l.reduce((e,t)=>e+t,0)}function rh(l,e){return l>=0?l:e}function lh(l,e){const t=parseInt(l,10);return!isNaN(t)&&isFinite(t)&&t>0?t:e}var ah=Object.freeze({__proto__:null,padStartWidthZeros:ds,createArrayOfNumbers:Rd,cleanNumber:ih,decToHex:sh,formatNumberTwoDecimalPlacesAndCommas:oh,formatNumberCommas:ol,sum:nh,zeroOrGreater:rh,oneOrGreater:lh});function st(l,e=!0,t="-"){if(!l)return null;let i=[l.getFullYear(),l.getMonth()+1,l.getDate()].map(s=>ds(s,2)).join(t);return e&&(i+=" "+[l.getHours(),l.getMinutes(),l.getSeconds()].map(s=>ds(s,2)).join(":")),i}const nl=l=>{if(l>3&&l<21)return"th";switch(l%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"};function Tn(l,e="YYYY-MM-DD"){const t=ds(l.getFullYear(),4),i=["January","February","March","April","May","June","July","August","September","October","November","December"],s=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o={YYYY:()=>t.slice(t.length-4,t.length),YY:()=>t.slice(t.length-2,t.length),Y:()=>`${l.getFullYear()}`,MMMM:()=>i[l.getMonth()],MMM:()=>i[l.getMonth()].slice(0,3),MM:()=>ds(l.getMonth()+1,2),Mo:()=>`${l.getMonth()+1}${nl(l.getMonth()+1)}`,M:()=>`${l.getMonth()+1}`,Do:()=>`${l.getDate()}${nl(l.getDate())}`,DD:()=>ds(l.getDate(),2),D:()=>`${l.getDate()}`,dddd:()=>s[l.getDay()],ddd:()=>s[l.getDay()].slice(0,3),dd:()=>s[l.getDay()].slice(0,2),do:()=>`${l.getDay()}${nl(l.getDay())}`,d:()=>`${l.getDay()}`},n=new RegExp(Object.keys(o).join("|"),"g");return e.replace(n,r=>r in o?o[r]():r)}function Ct(l){if(!l)return null;const[e,t]=l.split(" ");if(!e)return null;const i=e.split("-").map(h=>parseInt(h,10));if(i.filter(h=>!isNaN(h)).length!==3)return null;const[s,o,n]=i,r=new Date(s,o-1,n);if(r.getFullYear()!==s||r.getMonth()!==o-1||r.getDate()!==n)return null;if(!t||t==="00:00:00")return r;const[a,d,c]=t.split(":").map(h=>parseInt(h,10));return a>=0&&a<24&&r.setHours(a),d>=0&&d<60&&r.setMinutes(d),c>=0&&c<60&&r.setSeconds(c),r}var dh=Object.freeze({__proto__:null,serialiseDate:st,dateToFormattedString:Tn,parseDateTimeFromString:Ct});let Dn;function ch(l,e,t){const i=l.parentElement;let s=i&&i.firstChild;for(;s;)e&&s.classList.toggle(e,s===l),t&&s.classList.toggle(t,s!==l),s=s.nextSibling}const bd="[tabindex], input, select, button, textarea, [href]",rl=".ag-hidden, .ag-hidden *, [disabled], .ag-disabled:not(.ag-button), .ag-disabled *.mjs";function ll(l){const e=Element.prototype.matches||Element.prototype.msMatchesSelector,t="input, select, button, textarea",i=e.call(l,t),s=e.call(l,rl),o=Jt(l);return i&&!s&&o}function z(l,e,t={}){const{skipAriaHidden:i}=t;l.classList.toggle("ag-hidden",!e),i||wn(l,!e)}function Td(l,e,t={}){const{skipAriaHidden:i}=t;l.classList.toggle("ag-invisible",!e),i||wn(l,!e)}function cs(l,e){const t="disabled",i=e?s=>s.setAttribute(t,""):s=>s.removeAttribute(t);i(l),Cl(l.querySelectorAll("input"),s=>i(s))}function _i(l,e,t){let i=0;for(;l;){if(l.classList.contains(e))return!0;if(l=l.parentElement,typeof t=="number"){if(++i>t)break}else if(l===t)break}return!1}function ui(l){const{height:e,width:t,borderTopWidth:i,borderRightWidth:s,borderBottomWidth:o,borderLeftWidth:n,paddingTop:r,paddingRight:a,paddingBottom:d,paddingLeft:c,marginTop:h,marginRight:g,marginBottom:f,marginLeft:m,boxSizing:C}=window.getComputedStyle(l);return{height:parseFloat(e),width:parseFloat(t),borderTopWidth:parseFloat(i),borderRightWidth:parseFloat(s),borderBottomWidth:parseFloat(o),borderLeftWidth:parseFloat(n),paddingTop:parseFloat(r),paddingRight:parseFloat(a),paddingBottom:parseFloat(d),paddingLeft:parseFloat(c),marginTop:parseFloat(h),marginRight:parseFloat(g),marginBottom:parseFloat(f),marginLeft:parseFloat(m),boxSizing:C}}function Ys(l){const e=ui(l);return e.boxSizing==="border-box"?e.height-e.paddingTop-e.paddingBottom:e.height}function On(l){const e=ui(l);return e.boxSizing==="border-box"?e.width-e.paddingLeft-e.paddingRight:e.width}function al(l){const e=ui(l),t=e.marginBottom+e.marginTop;return Math.ceil(l.offsetHeight+t)}function Pn(l){const e=ui(l),t=e.marginLeft+e.marginRight;return Math.ceil(l.offsetWidth+t)}function dl(l){const e=l.getBoundingClientRect(),{borderTopWidth:t,borderLeftWidth:i,borderRightWidth:s,borderBottomWidth:o}=ui(l);return{top:e.top+(t||0),left:e.left+(i||0),right:e.right+(s||0),bottom:e.bottom+(o||0)}}function qs(){if(typeof Dn=="boolean")return Dn;const l=document.createElement("div");return l.style.direction="rtl",l.style.width="1px",l.style.height="1px",l.style.position="fixed",l.style.top="0px",l.style.overflow="hidden",l.dir="rtl",l.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(l),l.scrollLeft=1,Dn=Math.floor(l.scrollLeft)===0,document.body.removeChild(l),Dn}function Qs(l,e){let t=l.scrollLeft;return e&&(t=Math.abs(t),yn()&&!qs()&&(t=l.scrollWidth-l.clientWidth-t)),t}function Xs(l,e,t){t&&(qs()?e*=-1:(it()||yn())&&(e=l.scrollWidth-l.clientWidth-e)),l.scrollLeft=e}function We(l){for(;l&&l.firstChild;)l.removeChild(l.firstChild)}function uh(l,e){Xt(l.querySelector(e))}function Xt(l){l&&l.parentNode&&l.parentNode.removeChild(l)}function Jt(l){return l.offsetParent!==null}function fe(l){const e=document.createElement("div");return e.innerHTML=(l||"").trim(),e.firstChild}function hh(l,e){l.lastChild?l.insertAdjacentHTML("afterbegin",e):l.innerHTML=e}function ph(l,e){return l.attributes&&l.attributes[e]?l.attributes[e].value:null}function cl(l){return l&&l.clientHeight?l.clientHeight:0}function ul(l){return l&&l.clientWidth?l.clientWidth:0}function hl(l,e,t){if(t&&t.nextSibling===e)return;const i=document.activeElement,s=e.contains(i);t?t.nextSibling?l.insertBefore(e,t.nextSibling):l.appendChild(e):l.firstChild&&l.firstChild!==e&&l.insertAdjacentElement("afterbegin",e),s&&i&&Rn()&&i.focus({preventScroll:!0})}function pl(l,e){for(let t=0;t<e.length;t++){const i=e[t],s=l.children[t];s!==i&&l.insertBefore(i,s)}}function Dd(l,e,t){t?t.insertAdjacentElement("afterend",e):l.firstChild?l.insertAdjacentElement("afterbegin",e):l.appendChild(e)}function gh(l,e){R(l.firstChild)?l.insertBefore(e,l.firstChild):l.appendChild(e)}function gl(l,e){if(e)for(const[t,i]of Object.entries(e)){if(!t||!t.length||i==null)continue;const s=Za(t),o=i.toString(),n=o.replace(/\s*!important/g,""),r=n.length!=o.length?"important":void 0;l.style.setProperty(s,n,r)}}function Od(l){return l.clientWidth<l.scrollWidth}function Pd(l){return l.clientHeight<l.scrollHeight}function Js(l,e){e==="flex"?(l.style.removeProperty("width"),l.style.removeProperty("minWidth"),l.style.removeProperty("maxWidth"),l.style.flex="1 1 auto"):ot(l,e)}function ot(l,e){e=fl(e),l.style.width=e.toString(),l.style.maxWidth=e.toString(),l.style.minWidth=e.toString()}function fh(l,e){e==="flex"?(l.style.removeProperty("height"),l.style.removeProperty("minHeight"),l.style.removeProperty("maxHeight"),l.style.flex="1 1 auto"):xi(l,e)}function xi(l,e){e=fl(e),l.style.height=e.toString(),l.style.maxHeight=e.toString(),l.style.minHeight=e.toString()}function fl(l){return typeof l=="number"?`${l}px`:l}function Zs(l){return l instanceof Node||l instanceof HTMLElement}function Ad(l){if(l==null)return[];const e=[];return Cl(l,t=>e.push(t)),e}function Fd(l,e){if(l)for(let t=0;t<l.length;t++){const i=l[t];e(i.name,i.value)}}function hi(l,e,t){t==null?l.removeAttribute(e):l.setAttribute(e,t.toString())}function Cl(l,e){if(l!=null)for(let t=0;t<l.length;t++)e(l[t])}var Ch=Object.freeze({__proto__:null,radioCssClass:ch,FOCUSABLE_SELECTOR:bd,FOCUSABLE_EXCLUDE:rl,isFocusableFormField:ll,setDisplayed:z,setVisible:Td,setDisabled:cs,isElementChildOfClass:_i,getElementSize:ui,getInnerHeight:Ys,getInnerWidth:On,getAbsoluteHeight:al,getAbsoluteWidth:Pn,getElementRectWithOffset:dl,isRtlNegativeScroll:qs,getScrollLeft:Qs,setScrollLeft:Xs,clearElement:We,removeElement:uh,removeFromParent:Xt,isVisible:Jt,loadTemplate:fe,appendHtml:hh,getElementAttribute:ph,offsetHeight:cl,offsetWidth:ul,ensureDomOrder:hl,setDomChildOrder:pl,insertWithDomOrder:Dd,prependDC:gh,addStylesToElement:gl,isHorizontalScrollShowing:Od,isVerticalScrollShowing:Pd,setElementWidth:Js,setFixedWidth:ot,setElementHeight:fh,setFixedHeight:xi,formatSize:fl,isNodeOrElement:Zs,copyNodeList:Ad,iterateNamedNodeMap:Fd,addOrRemoveAttribute:hi,nodeListForEach:Cl});const Ld={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",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"};function nt(l,e,t){const i=le(l,e,t);if(i){const{className:o}=i;if(typeof o=="string"&&o.indexOf("ag-icon")>-1||typeof o=="object"&&o["ag-icon"])return i}const s=document.createElement("span");return s.appendChild(i),s}function le(l,e,t,i){let s=null;const o=t&&t.getColDef().icons;if(o&&(s=o[l]),e&&!s){const n=e.get("icons");n&&(s=n[l])}if(s){let n;if(typeof s=="function")n=s();else if(typeof s=="string")n=s;else throw new Error("icon from grid options needs to be a string or a function");if(typeof n=="string")return fe(n);if(Zs(n))return n;console.warn("AG Grid: iconRenderer should return back a string or a dom object")}else{const n=document.createElement("span");let r=Ld[l];return r||(i?r=l:(console.warn(`AG Grid: Did not find icon ${l}`),r="")),n.setAttribute("class",`ag-icon ag-icon-${r}`),n.setAttribute("unselectable","on"),pe(n,"presentation"),n}}var mh=Object.freeze({__proto__:null,iconNameClassMap:Ld,createIcon:nt,createIconNoSpan:le});class w{}w.BACKSPACE="Backspace",w.TAB="Tab",w.ENTER="Enter",w.ESCAPE="Escape",w.SPACE=" ",w.LEFT="ArrowLeft",w.UP="ArrowUp",w.RIGHT="ArrowRight",w.DOWN="ArrowDown",w.DELETE="Delete",w.F2="F2",w.PAGE_UP="PageUp",w.PAGE_DOWN="PageDown",w.PAGE_HOME="Home",w.PAGE_END="End",w.A="KeyA",w.C="KeyC",w.D="KeyD",w.V="KeyV",w.X="KeyX",w.Y="KeyY",w.Z="KeyZ";const vh=65,wh=67,Sh=86,Eh=68,yh=90,Rh=89;function ml(l){return l.altKey||l.ctrlKey||l.metaKey?!1:l.key.length===1}function An(l,e,t,i,s){const o=i?i.getColDef().suppressKeyboardEvent:void 0;if(!o)return!1;const n={event:e,editing:s,column:i,api:l.api,node:t,data:t.data,colDef:i.getColDef(),context:l.context,columnApi:l.columnApi};return!!(o&&o(n))}function Id(l,e,t,i){const s=i.getDefinition(),o=s&&s.suppressHeaderKeyboardEvent;if(!R(o))return!1;const n={api:l.api,columnApi:l.columnApi,context:l.context,colDef:s,column:i,headerRowIndex:t,event:e};return!!o(n)}function Md(l){const{keyCode:e}=l;let t;switch(e){case vh:t=w.A;break;case wh:t=w.C;break;case Sh:t=w.V;break;case Eh:t=w.D;break;case yh:t=w.Z;break;case Rh:t=w.Y;break;default:t=l.code}return t}function Nd(l,e=!1){return l===w.DELETE?!0:!e&&l===w.BACKSPACE?sl():!1}var bh=Object.freeze({__proto__:null,isEventFromPrintableCharacter:ml,isUserSuppressingKeyboardEvent:An,isUserSuppressingHeaderKeyboardEvent:Id,normaliseQwertyAzerty:Md,isDeleteKey:Nd});function vl(l,e,t){if(t===0)return!1;const i=Math.abs(l.clientX-e.clientX),s=Math.abs(l.clientY-e.clientY);return Math.max(i,s)<=t}var Th=Object.freeze({__proto__:null,areEventsNear:vl});function Dh(l,e){if(!l)return!1;const t=(n,r)=>{const a=e[n.id],d=e[r.id],c=a!==void 0,h=d!==void 0,g=c&&h,f=!c&&!h;return g?a-d:f?n.__objectId-r.__objectId:c?1:-1};let i,s,o=!1;for(let n=0;n<l.length-1;n++)if(i=l[n],s=l[n+1],t(i,s)>0){o=!0;break}return o?(l.sort(t),!0):!1}function Oh(l,e){const t=[];i(l);function i(s){s&&s.forEach(o=>{if(o.group||o.hasChildren()){t.push(o.key);const n=t.join("|");e(o,n),i(o.childrenAfterGroup),t.pop()}})}}var Ph=Object.freeze({__proto__:null,sortRowNodesByOrder:Dh,traverseNodesWithKey:Oh});function wl(l){const e=new Set;return l.forEach(t=>e.add(t)),e}var Ah=Object.freeze({__proto__:null,convertToSet:wl});const G=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},eh),Iu),th),dh),Ch),Nu),Eu),zu),hu),mh),bh),Uu),Th),ah),wu),Ph),Ah),Bu);class us{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}}var hs;(function(l){l[l.IN_PROGRESS=0]="IN_PROGRESS",l[l.RESOLVED=1]="RESOLVED"})(hs||(hs={}));class De{constructor(e){this.status=hs.IN_PROGRESS,this.resolution=null,this.waiters=[],e(t=>this.onDone(t),t=>this.onReject(t))}static all(e){return new De(t=>{let i=e.length;const s=new Array(i);e.forEach((o,n)=>{o.then(r=>{s[n]=r,i--,i===0&&t(s)})})})}static resolve(e=null){return new De(t=>t(e))}then(e){return new De(t=>{this.status===hs.RESOLVED?t(e(this.resolution)):this.waiters.push(i=>t(e(i)))})}resolveNow(e,t){return this.status===hs.RESOLVED?t(this.resolution):e}onDone(e){this.status=hs.RESOLVED,this.resolution=e,this.waiters.forEach(t=>t(e))}onReject(e){console.warn("TBI")}}var Sl=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},mt;(function(l){l[l.NOTHING=0]="NOTHING",l[l.WAITING_TO_SHOW=1]="WAITING_TO_SHOW",l[l.SHOWING=2]="SHOWING"})(mt||(mt={}));class Zt extends T{constructor(e){super(),this.DEFAULT_SHOW_TOOLTIP_DELAY=2e3,this.DEFAULT_HIDE_TOOLTIP_DELAY=1e4,this.SHOW_QUICK_TOOLTIP_DIFF=1e3,this.FADE_OUT_TOOLTIP_TIMEOUT=1e3,this.state=mt.NOTHING,this.tooltipInstanceCount=0,this.tooltipMouseTrack=!1,this.parentComp=e}postConstruct(){this.tooltipShowDelay=this.getTooltipDelay("show")||this.DEFAULT_SHOW_TOOLTIP_DELAY,this.tooltipHideDelay=this.getTooltipDelay("hide")||this.DEFAULT_HIDE_TOOLTIP_DELAY,this.tooltipMouseTrack=this.gridOptionsService.is("tooltipMouseTrack");const e=this.parentComp.getGui();this.addManagedListener(e,"mouseenter",this.onMouseEnter.bind(this)),this.addManagedListener(e,"mouseleave",this.onMouseLeave.bind(this)),this.addManagedListener(e,"mousemove",this.onMouseMove.bind(this)),this.addManagedListener(e,"mousedown",this.onMouseDown.bind(this)),this.addManagedListener(e,"keydown",this.onKeyDown.bind(this))}destroy(){this.setToDoNothing(),super.destroy()}onMouseEnter(e){if(ci()||this.state!=mt.NOTHING)return;const t=this.isLastTooltipHiddenRecently()?200:this.tooltipShowDelay;this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),t),this.lastMouseEvent=e,this.state=mt.WAITING_TO_SHOW}onMouseLeave(){this.setToDoNothing()}onKeyDown(){this.setToDoNothing()}setToDoNothing(){this.state===mt.SHOWING&&this.hideTooltip(),this.clearTimeouts(),this.state=mt.NOTHING}onMouseMove(e){this.lastMouseEvent=e,this.tooltipMouseTrack&&this.state===mt.SHOWING&&this.tooltipComp&&this.positionTooltipUnderLastMouseEvent()}onMouseDown(){this.setToDoNothing()}getTooltipDelay(e){const t=this.gridOptionsService.getNum("tooltipShowDelay"),i=this.gridOptionsService.getNum("tooltipHideDelay"),s=e==="show"?t:i,o=Xa(e);return R(s)?(s<0&&Y(()=>console.warn(`AG Grid: tooltip${o}Delay should not be lower than 0`),`tooltip${o}DelayWarn`),Math.max(200,s)):null}hideTooltip(){this.tooltipComp&&(this.destroyTooltipComp(),Zt.lastTooltipHideTime=new Date().getTime()),this.state=mt.NOTHING}destroyTooltipComp(){this.tooltipComp.getGui().classList.add("ag-tooltip-hiding");const e=this.tooltipPopupDestroyFunc,t=this.tooltipComp;window.setTimeout(()=>{e(),this.getContext().destroyBean(t)},this.FADE_OUT_TOOLTIP_TIMEOUT),this.tooltipPopupDestroyFunc=void 0,this.tooltipComp=void 0}isLastTooltipHiddenRecently(){const e=new Date().getTime(),t=Zt.lastTooltipHideTime;return e-t<this.SHOW_QUICK_TOOLTIP_DIFF}showTooltip(){const e=Object.assign({},this.parentComp.getTooltipParams());if(!R(e.value)){this.setToDoNothing();return}this.state=mt.SHOWING,this.tooltipInstanceCount++;const t=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);this.userComponentFactory.getTooltipCompDetails(e).newAgStackInstance().then(t)}newTooltipComponentCallback(e,t){if(this.state!==mt.SHOWING||this.tooltipInstanceCount!==e){this.getContext().destroyBean(t);return}const s=t.getGui();this.tooltipComp=t,s.classList.contains("ag-tooltip")||s.classList.add("ag-tooltip-custom");const o=this.localeService.getLocaleTextFunc(),n=this.popupService.addPopup({eChild:s,ariaLabel:o("ariaLabelTooltip","Tooltip")});n&&(this.tooltipPopupDestroyFunc=n.hideFunc),this.positionTooltipUnderLastMouseEvent(),this.hideTooltipTimeoutId=window.setTimeout(this.hideTooltip.bind(this),this.tooltipHideDelay)}positionTooltipUnderLastMouseEvent(){this.popupService.positionPopupUnderMouseEvent({type:"tooltip",mouseEvent:this.lastMouseEvent,ePopup:this.tooltipComp.getGui(),nudgeY:18,skipObserver:this.tooltipMouseTrack})}clearTimeouts(){this.showTooltipTimeoutId&&(window.clearTimeout(this.showTooltipTimeoutId),this.showTooltipTimeoutId=void 0),this.hideTooltipTimeoutId&&(window.clearTimeout(this.hideTooltipTimeoutId),this.hideTooltipTimeoutId=void 0)}}Sl([p("popupService")],Zt.prototype,"popupService",void 0),Sl([p("userComponentFactory")],Zt.prototype,"userComponentFactory",void 0),Sl([D],Zt.prototype,"postConstruct",null);class Fh{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}}}var El=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};const Lh=new us;class V extends T{constructor(e){super(),this.displayed=!0,this.visible=!0,this.compId=Lh.next(),this.cssClassManager=new Fh(()=>this.eGui),e&&this.setTemplate(e)}preConstructOnComponent(){this.usingBrowserTooltips=this.gridOptionsService.is("enableBrowserTooltips")}getCompId(){return this.compId}getTooltipParams(){return{value:this.tooltipText,location:"UNKNOWN"}}setTooltip(e){const t=()=>{this.usingBrowserTooltips?this.getGui().removeAttribute("title"):this.tooltipFeature=this.destroyBean(this.tooltipFeature)},i=()=>{this.usingBrowserTooltips?this.getGui().setAttribute("title",this.tooltipText):this.tooltipFeature=this.createBean(new Zt(this))};this.tooltipText!=e&&(this.tooltipText&&t(),e!=null&&(this.tooltipText=e,this.tooltipText&&i()))}createChildComponentsFromTags(e,t){Ad(e.childNodes).forEach(s=>{if(!(s instanceof HTMLElement))return;const o=this.createComponentFromElement(s,n=>{n.getGui()&&this.copyAttributesFromNode(s,n.getGui())},t);if(o){if(o.addItems&&s.children.length){this.createChildComponentsFromTags(s,t);const n=Array.prototype.slice.call(s.children);o.addItems(n)}this.swapComponentForNode(o,e,s)}else s.childNodes&&this.createChildComponentsFromTags(s,t)})}createComponentFromElement(e,t,i){const s=e.nodeName,o=i?i[e.getAttribute("ref")]:void 0,n=this.agStackComponentsRegistry.getComponentClass(s);if(n){V.elementGettingCreated=e;const r=new n(o);return r.setParentComponent(this),this.createBean(r,null,t),r}return null}copyAttributesFromNode(e,t){Fd(e.attributes,(i,s)=>t.setAttribute(i,s))}swapComponentForNode(e,t,i){const s=e.getGui();t.replaceChild(s,i),t.insertBefore(document.createComment(i.nodeName),s),this.addDestroyFunc(this.destroyBean.bind(this,e)),this.swapInComponentForQuerySelectors(e,i)}swapInComponentForQuerySelectors(e,t){const i=this;this.iterateOverQuerySelectors(s=>{i[s.attributeName]===t&&(i[s.attributeName]=e)})}iterateOverQuerySelectors(e){let t=Object.getPrototypeOf(this);for(;t!=null;){const i=t.__agComponentMetaData,s=dn(t.constructor);i&&i[s]&&i[s].querySelectors&&i[s].querySelectors.forEach(o=>e(o)),t=Object.getPrototypeOf(t)}}activateTabIndex(e){const t=this.gridOptionsService.getNum("tabIndex")||0;e||(e=[]),e.length||e.push(this.getGui()),e.forEach(i=>i.setAttribute("tabindex",t.toString()))}setTemplate(e,t){const i=fe(e);this.setTemplateFromElement(i,t)}setTemplateFromElement(e,t){this.eGui=e,this.eGui.__agComponent=this,this.wireQuerySelectors(),this.getContext()&&this.createChildComponentsFromTags(this.getGui(),t)}createChildComponentsPreConstruct(){this.getGui()&&this.createChildComponentsFromTags(this.getGui())}wireQuerySelectors(){if(!this.eGui)return;const e=this;this.iterateOverQuerySelectors(t=>{const i=o=>e[t.attributeName]=o;if(t.refSelector&&this.getAttribute("ref")===t.refSelector)i(this.eGui);else{const o=this.eGui.querySelector(t.querySelector);o&&i(o.__agComponent||o)}})}getGui(){return this.eGui}getFocusableElement(){return this.eGui}setParentComponent(e){this.parentComponent=e}getParentComponent(){return this.parentComponent}setGui(e){this.eGui=e}queryForHtmlElement(e){return this.eGui.querySelector(e)}queryForHtmlInputElement(e){return this.eGui.querySelector(e)}appendChild(e,t){if(e!=null)if(t||(t=this.eGui),Zs(e))t.appendChild(e);else{const i=e;t.appendChild(i.getGui())}}isDisplayed(){return this.displayed}setVisible(e,t={}){if(e!==this.visible){this.visible=e;const{skipAriaHidden:i}=t;Td(this.eGui,e,{skipAriaHidden:i})}}setDisplayed(e,t={}){if(e!==this.displayed){this.displayed=e;const{skipAriaHidden:i}=t;z(this.eGui,e,{skipAriaHidden:i});const s={type:V.EVENT_DISPLAYED_CHANGED,visible:this.displayed};this.dispatchEvent(s)}}destroy(){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),this.parentComponent&&(this.parentComponent=void 0);const e=this.eGui;e&&e.__agComponent&&(e.__agComponent=void 0),super.destroy()}addGuiEventListener(e,t,i){this.eGui.addEventListener(e,t,i),this.addDestroyFunc(()=>this.eGui.removeEventListener(e,t))}addCssClass(e){this.cssClassManager.addCssClass(e)}removeCssClass(e){this.cssClassManager.removeCssClass(e)}containsCssClass(e){return this.cssClassManager.containsCssClass(e)}addOrRemoveCssClass(e,t){this.cssClassManager.addOrRemoveCssClass(e,t)}getAttribute(e){const{eGui:t}=this;return t?t.getAttribute(e):null}getRefElement(e){return this.queryForHtmlElement(`[ref="${e}"]`)}}V.EVENT_DISPLAYED_CHANGED="displayedChanged",El([p("agStackComponentsRegistry")],V.prototype,"agStackComponentsRegistry",void 0),El([Va],V.prototype,"preConstructOnComponent",null),El([Va],V.prototype,"createChildComponentsPreConstruct",null);function O(l){return Ih.bind(this,`[ref=${l}]`,l)}function Ih(l,e,t,i,s){if(l===null){console.error("AG Grid: QuerySelector selector should not be null");return}if(typeof s=="number"){console.error("AG Grid: QuerySelector should be on an attribute");return}Mh(t,"querySelectors",{attributeName:i,querySelector:l,refSelector:e})}function Mh(l,e,t){const i=Nh(l,dn(l.constructor));i[e]||(i[e]=[]),i[e].push(t)}function Nh(l,e){return l.__agComponentMetaData||(l.__agComponentMetaData={}),l.__agComponentMetaData[e]||(l.__agComponentMetaData[e]={}),l.__agComponentMetaData[e]}var _d=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class yl extends V{constructor(){super(`
<div class="ag-floating-filter-input" role="presentation">
<ag-input-text-field ref="eFloatingFilterText"></ag-input-text-field>
</div>`)}destroy(){super.destroy()}init(e){this.params=e;const t=this.columnModel.getDisplayNameForColumn(e.column,"header",!0),i=this.localeService.getLocaleTextFunc();this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${i("ariaFilterInput","Filter Input")}`)}onParentModelChanged(e){if(!e){this.eFloatingFilterText.setValue("");return}this.params.parentFilterInstance(t=>{if(t.getModelAsString){const i=t.getModelAsString(e);this.eFloatingFilterText.setValue(i)}})}}_d([O("eFloatingFilterText")],yl.prototype,"eFloatingFilterText",void 0),_d([p("columnModel")],yl.prototype,"columnModel",void 0);class xd{constructor(e,t,i,s){this.alive=!0,this.context=e,this.eParent=s,t.getDateCompDetails(i).newAgStackInstance().then(r=>{if(!this.alive){e.destroyBean(r);return}this.dateComp=r,r&&(s.appendChild(r.getGui()),r.afterGuiAttached&&r.afterGuiAttached(),this.tempValue&&r.setDate(this.tempValue),this.disabled!=null&&this.setDateCompDisabled(this.disabled))})}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){z(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)}setDateCompDisabled(e){this.dateComp!=null&&this.dateComp.setDisabled!=null&&this.dateComp.setDisabled(e)}}class Gd{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:(console.warn(`AG Grid: 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:console.warn("AG Grid: invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'")}else console.warn("AG Grid: no filter options for filter")}getDefaultOption(){return this.defaultOption}getCustomOption(e){return this.customFilterOptions[e]}}const Hd={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:"Not equal",lessThan:"Less than",greaterThan:"Greater than",inRange:"In range",inRangeStart:"From",inRangeEnd:"To",lessThanOrEqual:"Less than or equals",greaterThanOrEqual:"Greater than or equals",contains:"Contains",notContains:"Not contains",startsWith:"Starts with",endsWith:"Ends with",blank:"Blank",notBlank:"Not blank",andCondition:"AND",orCondition:"OR",dateFormatOoo:"yyyy-mm-dd"};var Vd=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class ke extends T{constructor(e,t={}){super(),this.eFocusableElement=e,this.callbacks=t,this.callbacks=Object.assign({shouldStopEventPropagation:()=>!1,onTabKeyDown:i=>{if(i.defaultPrevented)return;const s=this.focusService.findNextFocusableElement(this.eFocusableElement,!1,i.shiftKey);s&&(s.focus(),i.preventDefault())}},t)}postConstruct(){this.eFocusableElement.classList.add(ke.FOCUS_MANAGED_CLASS),this.addKeyDownListeners(this.eFocusableElement),this.callbacks.onFocusIn&&this.addManagedListener(this.eFocusableElement,"focusin",this.callbacks.onFocusIn),this.callbacks.onFocusOut&&this.addManagedListener(this.eFocusableElement,"focusout",this.callbacks.onFocusOut)}addKeyDownListeners(e){this.addManagedListener(e,"keydown",t=>{if(!(t.defaultPrevented||Lt(t))){if(this.callbacks.shouldStopEventPropagation(t)){qt(t);return}t.key===w.TAB?this.callbacks.onTabKeyDown(t):this.callbacks.handleKeyDown&&this.callbacks.handleKeyDown(t)}})}}ke.FOCUS_MANAGED_CLASS="ag-focus-managed",Vd([p("focusService")],ke.prototype,"focusService",void 0),Vd([D],ke.prototype,"postConstruct",null);var Rl=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};const Bd="ag-resizer-wrapper",_h=`<div class="${Bd}">
<div ref="eTopLeftResizer" class="ag-resizer ag-resizer-topLeft"></div>
<div ref="eTopResizer" class="ag-resizer ag-resizer-top"></div>
<div ref="eTopRightResizer" class="ag-resizer ag-resizer-topRight"></div>
<div ref="eRightResizer" class="ag-resizer ag-resizer-right"></div>
<div ref="eBottomRightResizer" class="ag-resizer ag-resizer-bottomRight"></div>
<div ref="eBottomResizer" class="ag-resizer ag-resizer-bottom"></div>
<div ref="eBottomLeftResizer" class="ag-resizer ag-resizer-bottomLeft"></div>
<div ref="eLeftResizer" class="ag-resizer ag-resizer-left"></div>
</div>`;class eo extends T{constructor(e,t){super(),this.element=e,this.dragStartPosition={x:0,y:0},this.position={x:0,y:0},this.lastSize={width:-1,height:-1},this.positioned=!1,this.resizersAdded=!1,this.resizeListeners=[],this.boundaryEl=null,this.isResizing=!1,this.isMoving=!1,this.resizable={},this.movable=!1,this.currentResizer=null,this.config=Object.assign({},{popup:!1},t)}center(){const{clientHeight:e,clientWidth:t}=this.offsetParent,i=t/2-this.getWidth()/2,s=e/2-this.getHeight()/2;this.offsetElement(i,s)}initialisePosition(){if(this.positioned)return;const{centered:e,forcePopupParentAsOffsetParent:t,minWidth:i,width:s,minHeight:o,height:n,x:r,y:a}=this.config;this.offsetParent||this.setOffsetParent();let d=0,c=0;const h=!!this.element.offsetParent;if(h){const g=this.findBoundaryElement(),f=window.getComputedStyle(g);if(f.minWidth!=null){const m=g.offsetWidth-this.element.offsetWidth;c=parseInt(f.minWidth,10)-m}if(f.minHeight!=null){const m=g.offsetHeight-this.element.offsetHeight;d=parseInt(f.minHeight,10)-m}}if(this.minHeight=o||d,this.minWidth=i||c,s&&this.setWidth(s),n&&this.setHeight(n),(!s||!n)&&this.refreshSize(),e)this.center();else if(r||a)this.offsetElement(r,a);else if(h&&t){let g=this.boundaryEl,f=!0;if(g||(g=this.findBoundaryElement(),f=!1),g){const m=parseFloat(g.style.top),C=parseFloat(g.style.left);f?this.offsetElement(isNaN(C)?0:C,isNaN(m)?0:m):this.setPosition(C,m)}}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),n={dragStartPixels:0,eElement:o,onDragStart:r=>this.onResizeStart(r,t),onDragging:this.onResize.bind(this),onDragStop:r=>this.onResizeEnd(r,t)};(s||!this.isAlive()&&!s)&&(s?(this.dragService.addDragSource(n),this.resizeListeners.push(n),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)xi(i,e),e=al(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?xi(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(),n=e?this.position.y:s.top,r=e?0:o.top;let a=0;if(t){const c=this.element.parentElement;if(c){const{bottom:h}=c.getBoundingClientRect();a=h-s.bottom}}return i+r-n-a}getWidth(){return this.element.offsetWidth}setWidth(e){const t=this.element,{popup:i}=this.config;let s=!1;if(typeof e=="string"&&e.indexOf("%")!==-1)ot(t,e),e=Pn(t),s=!0;else if(this.positioned){e=Math.max(this.minWidth,e);const{clientWidth:o}=this.offsetParent,n=i?this.position.x:this.element.getBoundingClientRect().left;o&&e+n>o&&(e=o-n)}this.getWidth()!==e&&(s?(t.style.maxWidth="unset",t.style.minWidth="unset"):this.config.popup?ot(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:n}=e,r=t.clientX-this.dragStartPosition.x,a=t.clientY-this.dragStartPosition.y,d=this.shouldSkipX(t,!!i,!!o,r)?0:r,c=this.shouldSkipY(t,!!s,n,a)?0:a;return{movementX:d,movementY:c}}shouldSkipX(e,t,i,s){const o=this.element.getBoundingClientRect(),n=this.offsetParent.getBoundingClientRect(),r=this.boundaryEl.getBoundingClientRect(),a=this.config.popup?this.position.x:o.left;let d=a<=0&&n.left>=e.clientX||n.right<=e.clientX&&n.right<=r.right;return d?!0:(t?d=s<0&&e.clientX>a+n.left||s>0&&e.clientX<a+n.left:i?d=s<0&&e.clientX>r.right||s>0&&e.clientX<a+n.left:d=s<0&&e.clientX>r.right||s>0&&e.clientX<r.right,d)}shouldSkipY(e,t,i=0,s){const o=this.element.getBoundingClientRect(),n=this.offsetParent.getBoundingClientRect(),r=this.boundaryEl.getBoundingClientRect(),a=this.config.popup?this.position.y:o.top;let d=a<=0&&n.top>=e.clientY||n.bottom<=e.clientY&&n.bottom<=r.bottom;return d?!0:(t?d=s<0&&e.clientY>a+n.top+i||s>0&&e.clientY<a+n.top:d=s<0&&e.clientY>r.bottom||s>0&&e.clientY<r.bottom,d)}createResizeMap(){const e=this.element;this.resizerMap={topLeft:{element:e.querySelector("[ref=eTopLeftResizer]")},top:{element:e.querySelector("[ref=eTopResizer]")},topRight:{element:e.querySelector("[ref=eTopRightResizer]")},right:{element:e.querySelector("[ref=eRightResizer]")},bottomRight:{element:e.querySelector("[ref=eBottomRightResizer]")},bottom:{element:e.querySelector("[ref=eBottomResizer]")},bottomLeft:{element:e.querySelector("[ref=eBottomLeftResizer]")},left:{element:e.querySelector("[ref=eLeftResizer]")}}}addResizers(){if(this.resizersAdded)return;const e=this.element;if(!e)return;const i=new DOMParser().parseFromString(_h,"text/html").body;e.appendChild(i.firstChild),this.createResizeMap(),this.resizersAdded=!0}removeResizers(){this.resizerMap=void 0;const e=this.element.querySelector(`.${Bd}`);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],n=!!o.style.flex&&o.style.flex!=="0 0 auto";if(o===this.element)continue;let r=this.minHeight||0,a=this.minWidth||0;if(n){const d=window.getComputedStyle(o);d.minHeight&&(r=parseInt(d.minHeight,10)),d.minWidth&&(a=parseInt(d.minWidth,10))}else r=o.offsetHeight,a=o.offsetWidth;t+=r,i+=a}return{height:t,width:i}}applySizeToSiblings(e){let t=null;const i=this.getSiblings();if(i){for(let s=0;s<i.length;s++){const o=i[s];o!==t&&(e?o.style.height=`${o.offsetHeight}px`:o.style.width=`${o.offsetWidth}px`,o.style.flex="0 0 auto",o===this.element&&(t=i[s+1]))}t&&(t.style.removeProperty("height"),t.style.removeProperty("min-height"),t.style.removeProperty("max-height"),t.style.flex="1 1 auto")}}isResizable(){return Object.values(this.resizable).some(e=>e)}onResize(e){if(!this.isResizing||!this.currentResizer)return;const{popup:t,forcePopupParentAsOffsetParent:i}=this.config,{isTop:s,isRight:o,isBottom:n,isLeft:r}=this.currentResizer,a=o||r,d=n||s,{movementX:c,movementY:h}=this.calculateMouseMovement({e,isLeft:r,isTop:s}),g=this.position.x,f=this.position.y;let m=0,C=0;if(a&&c){const y=r?-1:1,v=this.getWidth(),E=v+c*y;let b=!1;r&&(m=v-E,(g+m<=0||E<=this.minWidth)&&(b=!0,m=0)),b||this.setWidth(E)}if(d&&h){const y=s?-1:1,v=this.getHeight(),E=v+h*y;let b=!1;s?(C=v-E,(f+C<=0||E<=this.minHeight)&&(b=!0,C=0)):!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&v<E&&this.getMinSizeOfSiblings().height+E>this.element.parentElement.offsetHeight&&(b=!0),b||this.setHeight(E)}this.updateDragStartPosition(e.clientX,e.clientY),((t||i)&&m||C)&&this.offsetElement(g+m,f+C)}onResizeEnd(e,t){this.isResizing=!1,this.currentResizer=null,this.boundaryEl=null;const i={type:"resize",api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi};this.element.classList.remove("ag-resizing"),this.resizerMap[t].element.classList.remove("ag-active"),this.dispatchEvent(i)}refreshSize(){const e=this.element;this.config.popup&&(this.config.width||this.setWidth(e.offsetWidth),this.config.height||this.setHeight(e.offsetHeight))}onMoveStart(e){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.isMoving=!0,this.element.classList.add("ag-moving"),this.updateDragStartPosition(e.clientX,e.clientY)}onMove(e){if(!this.isMoving)return;const{x:t,y:i}=this.position;let s;this.config.calculateTopBuffer&&(s=this.config.calculateTopBuffer());const{movementX:o,movementY:n}=this.calculateMouseMovement({e,isTop:!0,anywhereWithin:!0,topBuffer:s});this.offsetElement(t+o,i+n),this.updateDragStartPosition(e.clientX,e.clientY)}onMoveEnd(){this.isMoving=!1,this.boundaryEl=null,this.element.classList.remove("ag-moving")}setOffsetParent(){this.config.forcePopupParentAsOffsetParent?this.offsetParent=this.popupService.getPopupParent():this.offsetParent=this.element.offsetParent}findBoundaryElement(){let e=this.element;for(;e;){if(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()}}Rl([p("popupService")],eo.prototype,"popupService",void 0),Rl([p("resizeObserverService")],eo.prototype,"resizeObserverService",void 0),Rl([p("dragService")],eo.prototype,"dragService",void 0);var bl=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class vt extends V{constructor(e){super(),this.filterNameKey=e,this.applyActive=!1,this.hidePopup=null,this.debouncePending=!1,this.appliedModel=null}postConstruct(){this.resetTemplate(),this.createManagedBean(new ke(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=new eo(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" ref="eFilterBody">
${this.createBodyTemplate()}
</div>
</form>`;this.setTemplate(i,e),t=this.getGui(),t&&t.addEventListener("submit",this.onFormSubmit)}isReadOnly(){return!!this.providedFilterParams.readOnly}init(e){this.setParams(e),this.resetUiToDefaults(!0).then(()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()})}setParams(e){this.providedFilterParams=e,this.applyActive=vt.isUseApplyButton(e),this.createButtonPanel()}createButtonPanel(){const{buttons:e}=this.providedFilterParams;if(!e||e.length<1||this.isReadOnly())return;const t=document.createElement("div");t.classList.add("ag-filter-apply-panel");const i=s=>{let o,n;switch(s){case"apply":o=this.translate("applyFilter"),n=d=>this.onBtApply(!1,!1,d);break;case"clear":o=this.translate("clearFilter"),n=()=>this.onBtClear();break;case"reset":o=this.translate("resetFilter"),n=()=>this.onBtReset();break;case"cancel":o=this.translate("cancelFilter"),n=d=>{this.onBtCancel(d)};break;default:console.warn("AG Grid: Unknown button type specified");return}const a=fe(`<button
type="${s==="apply"?"submit":"button"}"
ref="${s}FilterButton"
class="ag-button ag-standard-button ag-filter-apply-panel-button"
>${o}
</button>`);t.appendChild(a),this.addManagedListener(a,"click",n)};wl(e).forEach(s=>i(s)),this.getGui().appendChild(t)}getDefaultDebounceMs(){return 0}setupOnBtApplyDebounce(){const e=vt.getDebounceMs(this.providedFilterParams,this.getDefaultDebounceMs()),t=Ft(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){i&&i.preventDefault(),this.applyModel(t?"rowDataUpdated":"ui")&&this.providedFilterParams.filterChangedCallback({afterFloatingFilter:e,afterDataChange:t});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());cs(this.getRefElement("applyFilterButton"),!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",{positionableFeature:i,gridOptionsService:s}=this;t?(i.restoreLastSize(),i.setResizable(s.is("enableRtl")?{bottom:!0,bottomLeft:!0,left:!0}:{bottom:!0,bottomRight:!0,right:!0})):(this.positionableFeature.removeSizeFromEl(),this.positionableFeature.setResizable(!1)),this.positionableFeature.constrainSizeToAvailableHeight(!0)}afterGuiDetached(){this.checkApplyDebounce(),this.positionableFeature&&this.positionableFeature.constrainSizeToAvailableHeight(!1)}static getDebounceMs(e,t){return vt.isUseApplyButton(e)?(e.debounceMs!=null&&console.warn("AG Grid: debounceMs is ignored when apply button is present"),0):e.debounceMs!=null?e.debounceMs:t}static isUseApplyButton(e){return!!e.buttons&&e.buttons.indexOf("apply")>=0}destroy(){const e=this.getGui();e&&e.removeEventListener("submit",this.onFormSubmit),this.hidePopup=null,this.positionableFeature&&(this.positionableFeature=this.destroyBean(this.positionableFeature)),super.destroy()}translate(e){return this.localeService.getLocaleTextFunc()(e,Hd[e])}getCellValue(e){const{api:t,colDef:i,column:s,columnApi:o,context:n}=this.providedFilterParams;return this.providedFilterParams.valueGetter({api:t,colDef:i,column:s,columnApi:o,context:n,data:e.data,getValue:r=>e.data[r],node:e})}getPositionableElement(){return this.eFilterBody}}bl([p("rowModel")],vt.prototype,"rowModel",void 0),bl([O("eFilterBody")],vt.prototype,"eFilterBody",void 0),bl([D],vt.prototype,"postConstruct",null);var xh=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Tl extends V{constructor(e,t){super(t),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{}}postConstruct(){this.addCssClass("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:i,labelAlignment:s}=this.config;e!=null&&this.setLabelSeparator(e),t!=null&&this.setLabel(t),i!=null&&this.setLabelWidth(i),this.setLabelAlignment(s||this.labelAlignment),this.refreshLabel()}refreshLabel(){We(this.eLabel),typeof this.label=="string"?this.eLabel.innerText=this.label+this.labelSeparator:this.label&&this.eLabel.appendChild(this.label),this.label===""?(z(this.eLabel,!1),pe(this.eLabel,"presentation")):(z(this.eLabel,!0),pe(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:(Js(this.eLabel,e),this)}setDisabled(e){e=!!e;const t=this.getGui();return cs(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}}xh([D],Tl.prototype,"postConstruct",null);class Nt extends Tl{constructor(e,t,i){super(e,t),this.className=i}postConstruct(){super.postConstruct(),this.className&&this.addCssClass(this.className)}onValueChange(e){return this.addManagedListener(this,Nt.EVENT_CHANGED,()=>e(this.getValue())),this}getWidth(){return this.getGui().clientWidth}setWidth(e){return ot(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.dispatchEvent({type:Nt.EVENT_CHANGED}),this)}}Nt.EVENT_CHANGED="valueChange";var Fn=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class to extends Nt{constructor(e,t,i,s){super(e,`<div class="ag-picker-field" role="presentation">
<div ref="eLabel"></div>
<div ref="eWrapper"
class="ag-wrapper ag-picker-field-wrapper"
tabIndex="-1"
aria-expanded="false"
${s?`role="${s}"`:""}
>
<div ref="eDisplayField" class="ag-picker-field-display"></div>
<div ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>
</div>
</div>`,t),this.pickerIcon=i,this.isPickerDisplayed=!1,this.isDestroyingPicker=!1,this.skipClick=!1}postConstruct(){super.postConstruct();const e=`ag-${this.getCompId()}-display`;this.eDisplayField.setAttribute("id",e),ld(this.eWrapper,e);const t=()=>{if(this.skipClick){this.skipClick=!1;return}this.isDisabled()||(this.pickerComponent=this.showPicker())},i=this.getGui();if(this.addManagedListener(i,"mousedown",s=>{!this.skipClick&&this.pickerComponent&&this.pickerComponent.isAlive()&&Jt(this.pickerComponent.getGui())&&i.contains(s.target)&&(this.skipClick=!0)}),this.addManagedListener(i,"keydown",s=>{switch(s.key){case w.UP:case w.DOWN:case w.ENTER:case w.SPACE:t();case w.ESCAPE:this.isPickerDisplayed&&s.preventDefault();break}}),this.addManagedListener(this.eWrapper,"click",t),this.addManagedListener(this.eLabel,"click",t),this.pickerIcon){const s=le(this.pickerIcon,this.gridOptionsService);s&&this.eIcon.appendChild(s)}}refreshLabel(){R(this.getLabel())?vn(this.eWrapper,this.getLabelId()):this.eWrapper.removeAttribute("aria-labelledby"),super.refreshLabel()}setAriaLabel(e){return di(this.eWrapper,e),this}setInputWidth(e){return Js(this.eWrapper,e),this}getFocusableElement(){return this.eWrapper}}Fn([O("eLabel")],to.prototype,"eLabel",void 0),Fn([O("eWrapper")],to.prototype,"eWrapper",void 0),Fn([O("eDisplayField")],to.prototype,"eDisplayField",void 0),Fn([O("eIcon")],to.prototype,"eIcon",void 0);var Gh=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class ei extends V{constructor(e="default"){super(`<div class="ag-list ag-${e}-list" role="listbox"></div>`),this.cssIdentifier=e,this.options=[],this.itemEls=[]}init(){this.addManagedListener(this.getGui(),"keydown",this.handleKeyDown.bind(this))}handleKeyDown(e){const t=e.key;switch(t){case w.ENTER:if(!this.highlightedEl)this.setValue(this.getValue());else{const o=this.itemEls.indexOf(this.highlightedEl);this.setValueByIndex(o)}break;case w.DOWN:case w.UP:const i=t===w.DOWN;let s;if(e.preventDefault(),!this.highlightedEl)s=this.itemEls[i?0:this.itemEls.length-1];else{let n=this.itemEls.indexOf(this.highlightedEl)+(i?1:-1);n=Math.min(Math.max(n,0),this.itemEls.length-1),s=this.itemEls[n]}this.highlightItem(s);break}}addOptions(e){return e.forEach(t=>this.addOption(t)),this}addOption(e){const{value:t,text:i}=e,s=It(i||t);return this.options.push({value:t,text:s}),this.renderOption(t,s),this.updateIndices(),this}updateIndices(){const e=this.getGui().querySelectorAll(".ag-list-item");e.forEach((t,i)=>{zr(t,i+1),jr(t,e.length)})}renderOption(e,t){const i=document.createElement("div");pe(i,"option"),i.classList.add("ag-list-item",`ag-${this.cssIdentifier}-list-item`),i.innerHTML=`<span>${t}</span>`,i.tabIndex=-1,this.itemEls.push(i),this.addManagedListener(i,"mouseover",()=>this.highlightItem(i)),this.addManagedListener(i,"mouseleave",()=>this.clearHighlighted()),this.addManagedListener(i,"click",()=>this.setValue(e)),this.getGui().appendChild(i)}setValue(e,t){if(this.value===e)return this.fireItemSelected(),this;if(e==null)return this.reset(),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!=null?s.text:s.value,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(){this.value=null,this.displayValue=null,this.clearHighlighted(),this.fireChangeEvent()}highlightItem(e){e.offsetParent&&(this.clearHighlighted(),this.highlightedEl=e,this.highlightedEl.classList.add(ei.ACTIVE_CLASS),ls(this.highlightedEl,!0),this.highlightedEl.focus())}clearHighlighted(){!this.highlightedEl||!this.highlightedEl.offsetParent||(this.highlightedEl.classList.remove(ei.ACTIVE_CLASS),ls(this.highlightedEl,!1),this.highlightedEl=null)}fireChangeEvent(){this.dispatchEvent({type:Nt.EVENT_CHANGED}),this.fireItemSelected()}fireItemSelected(){this.dispatchEvent({type:ei.EVENT_ITEM_SELECTED})}}ei.EVENT_ITEM_SELECTED="selectedItem",ei.ACTIVE_CLASS="ag-active-item",Gh([D],ei.prototype,"init",null);var Wd=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class pi extends to{constructor(e){super(e,"ag-select","smallDown","listbox")}init(){this.listComponent=this.createBean(new ei("select")),this.listComponent.setParentComponent(this),this.eWrapper.tabIndex=0,this.listComponent.addManagedListener(this.listComponent,ei.EVENT_ITEM_SELECTED,()=>{this.hideList&&this.hideList(),this.dispatchEvent({type:pi.EVENT_ITEM_SELECTED})}),this.listComponent.addManagedListener(this.listComponent,Nt.EVENT_CHANGED,()=>{this.setValue(this.listComponent.getValue(),!1,!0),this.hideList&&this.hideList()})}showPicker(){const e=this.listComponent.getGui(),t=this.gridOptionsService.getDocument(),i=this.addManagedListener(t.body,"wheel",r=>{!e.contains(r.target)&&this.hideList&&this.hideList()}),s=this.addManagedListener(e,"focusout",r=>{!e.contains(r.relatedTarget)&&this.hideList&&this.hideList()}),o=this.localeService.getLocaleTextFunc(),n=this.popupService.addPopup({modal:!0,eChild:e,closeOnEsc:!0,closedCallback:()=>{this.hideList=null,this.isPickerDisplayed=!1,s(),i(),this.isAlive()&&(ft(this.eWrapper,!1),this.getFocusableElement().focus())},ariaLabel:o("ariaLabelSelectField","Select Field")});return n&&(this.hideList=n.hideFunc),this.isPickerDisplayed=!0,Js(e,Pn(this.eWrapper)),ft(this.eWrapper,!0),e.style.maxHeight=Ys(this.popupService.getPopupParent())+"px",e.style.position="absolute",this.popupService.positionPopupByComponent({type:"ag-list",eventSource:this.eWrapper,ePopup:e,position:"under",keepWithinBounds:!0}),this.listComponent.refreshHighlighted(),this.listComponent}addOptions(e){return e.forEach(t=>this.addOption(t)),this}addOption(e){return this.listComponent.addOption(e),this}setValue(e,t,i){return this.value===e?this:(i||this.listComponent.setValue(e,!0),this.listComponent.getValue()===this.getValue()?this:(this.eDisplayField.innerHTML=this.listComponent.getDisplayValue(),super.setValue(e,t)))}destroy(){this.hideList&&this.hideList(),this.destroyBean(this.listComponent),super.destroy()}}pi.EVENT_ITEM_SELECTED="selectedItem",Wd([p("popupService")],pi.prototype,"popupService",void 0),Wd([D],pi.prototype,"init",null);var Dl=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class wt extends Nt{constructor(e,t,i="text",s="input"){super(e,`
<div role="presentation">
<div ref="eLabel" class="ag-input-field-label"></div>
<div ref="eWrapper" class="ag-wrapper ag-input-wrapper" role="presentation">
<${s} ref="eInput" class="ag-input-field-input"></${s}>
</div>
</div>`,t),this.inputType=i,this.displayFieldTag=s}postConstruct(){super.postConstruct(),this.setInputType(),this.eLabel.classList.add(`${this.className}-label`),this.eWrapper.classList.add(`${this.className}-input-wrapper`),this.eInput.classList.add(`${this.className}-input`),this.addCssClass("ag-input-field"),this.eInput.id=this.eInput.id||`ag-${this.getCompId()}-input`;const{width:e,value:t}=this.config;e!=null&&this.setWidth(e),t!=null&&this.setValue(t),this.addInputListeners(),this.activateTabIndex([this.eInput])}refreshLabel(){R(this.getLabel())?vn(this.eInput,this.getLabelId()):this.eInput.removeAttribute("aria-labelledby"),super.refreshLabel()}addInputListeners(){this.addManagedListener(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 Js(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 hi(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return di(this.eInput,e),this}setDisabled(e){return cs(this.eInput,e),super.setDisabled(e)}}Dl([O("eLabel")],wt.prototype,"eLabel",void 0),Dl([O("eWrapper")],wt.prototype,"eWrapper",void 0),Dl([O("eInput")],wt.prototype,"eInput",void 0);class gi extends wt{constructor(e,t="ag-checkbox",i="checkbox"){super(e,t,i),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}addInputListeners(){this.addManagedListener(this.eInput,"click",this.onCheckboxClick.bind(this)),this.addManagedListener(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.dispatchEvent({type:gi.EVENT_CHANGED,selected:e,previousValue:t,event:i});const s=this.getInputElement(),o={type:u.EVENT_CHECKBOX_CHANGED,id:s.id,name:s.name,selected:e,previousValue:t};this.eventService.dispatchEvent(o)}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;const t=this.isSelected(),i=this.selected=e.target.checked;this.refreshSelectedClass(i),this.dispatchChange(i,t,e)}refreshSelectedClass(e){this.eWrapper.classList.toggle("ag-checked",e===!0),this.eWrapper.classList.toggle("ag-indeterminate",e==null)}}class kd extends gi{constructor(e){super(e,"ag-radio-button","radio")}isSelected(){return this.eInput.checked}toggle(){this.eInput.disabled||this.isSelected()||this.setValue(!0)}addInputListeners(){super.addInputListeners(),this.addManagedListener(this.eventService,u.EVENT_CHECKBOX_CHANGED,this.onChange.bind(this))}onChange(e){e.selected&&e.name&&this.eInput.name&&this.eInput.name===e.name&&e.id&&this.eInput.id!==e.id&&this.setValue(!1,!0)}}class Ol{constructor(e,t){this.localeService=e,this.optionsFactory=t}getModelAsString(e){if(!e)return null;const t=e.operator!=null,i=this.localeService.getLocaleTextFunc();if(t){const s=e;let{conditions:o}=s;if(!o){const{condition1:a,condition2:d}=s;o=[a,d]}const n=o.map(a=>this.getModelAsString(a)),r=s.operator==="AND"?"andCondition":"orCondition";return n.join(` ${i(r,Hd[r])} `)}else{if(e.type===k.BLANK||e.type===k.NOT_BLANK)return i(e.type,e.type);{const s=e,o=this.optionsFactory.getCustomOption(s.type),{displayKey:n,displayName:r,numberOfInputs:a}=o||{};return n&&r&&a===0?(i(n,r),r):this.conditionToString(s,o)}}}}class k extends vt{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}const i=[k.EMPTY,k.NOT_BLANK,k.BLANK];return e&&i.indexOf(e)>=0?0:e===k.IN_RANGE?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(),condition1:e[0],condition2:e[1],conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map(e=>e.getValue())}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){return 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 n;if(i){const r=e,a=t;n=this.areSimpleModelsEqual(r,a)}else{const r=e,a=t;n=r.operator===a.operator&&ai(r.conditions,a.conditions,(d,c)=>this.areSimpleModelsEqual(d,c))}return n}setModelIntoUi(e){if(e.operator){let i=e;i.conditions||(i.conditions=[i.condition1,i.condition2]);const s=this.validateAndUpdateConditions(i.conditions),o=this.getNumConditions();if(s<o)this.removeConditionsAndOperators(s);else if(s>o)for(let r=o;r<s;r++)this.createJoinOperatorPanel(),this.createOption();const n=i.operator==="OR";this.eJoinOperatorsAnd.forEach(r=>r.setValue(!n,!0)),this.eJoinOperatorsOr.forEach(r=>r.setValue(n,!0)),i.conditions.forEach((r,a)=>{this.eTypes[a].setValue(r.type,!0),this.setConditionIntoUi(r,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(),De.resolve()}validateAndUpdateConditions(e){let t=e.length;return t>this.maxNumConditions&&(e.splice(this.maxNumConditions),Y(()=>console.warn('AG Grid: Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.'),"simpleFilterSetModelMaxNumConditions"),t=this.maxNumConditions),t}doesFilterPass(e){var t;const i=this.getModel();if(i==null)return!0;const{operator:s}=i,o=[];if(s){const r=i;o.push(...(t=r.conditions)!==null&&t!==void 0?t:[])}else o.push(i);return o[s&&s==="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 Gd,this.optionsFactory.init(e,this.getDefaultFilterOptions()),this.createFilterListOptions(),this.createOption(),this.createMissingConditionsAndOperators()}setNumConditions(e){var t,i;e.suppressAndOrCondition!=null&&Y(()=>console.warn('AG Grid: Since v29.2 "filterParams.suppressAndOrCondition" is deprecated. Use "filterParams.maxNumConditions = 1" instead.'),"simpleFilterSuppressAndOrCondition"),e.alwaysShowBothConditions!=null&&Y(()=>console.warn('AG Grid: Since v29.2 "filterParams.alwaysShowBothConditions" is deprecated. Use "filterParams.numAlwaysVisibleConditions = 2" instead.'),"simpleFilterAlwaysShowBothConditions"),this.maxNumConditions=(t=e.maxNumConditions)!==null&&t!==void 0?t:e.suppressAndOrCondition?1:2,this.maxNumConditions<1&&(Y(()=>console.warn('AG Grid: "filterParams.maxNumConditions" must be greater than or equal to zero.'),"simpleFilterMaxNumConditions"),this.maxNumConditions=1),this.numAlwaysVisibleConditions=(i=e.numAlwaysVisibleConditions)!==null&&i!==void 0?i:e.alwaysShowBothConditions?2:1,this.numAlwaysVisibleConditions<1&&(Y(()=>console.warn('AG Grid: "filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.'),"simpleFilterNumAlwaysVisibleConditions"),this.numAlwaysVisibleConditions=1),this.numAlwaysVisibleConditions>this.maxNumConditions&&(Y(()=>console.warn('AG Grid: "filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".'),"simpleFilterNumAlwaysVisibleGreaterThanMaxNumConditions"),this.numAlwaysVisibleConditions=this.maxNumConditions)}createOption(){const e=this.createManagedBean(new pi);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 kd);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)}}isAllowTwoConditions(){return this.maxNumConditions>=2}createBodyTemplate(){return""}getCssIdentifier(){return"simple-filter"}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){var e;let t=-1,i=!0;for(let s=0;s<this.getNumConditions();s++)this.isConditionUiComplete(s)?t=s:i=!1;if(this.shouldAddNewConditionAtEnd(i))this.createJoinOperatorPanel(),this.createOption();else{const s=(e=this.lastUiCompletePosition)!==null&&e!==void 0?e:this.getNumConditions()-2;if(t<s){this.removeConditionsAndOperators(s+1);const o=t+1,n=s-o;n>0&&this.removeConditionsAndOperators(o,n),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=t}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((s,o)=>{const n=this.isConditionDisabled(o,e);s.setDisabled(n||this.filterListOptions.length<=1),o===1&&(cs(this.eJoinOperatorPanels[0],n),this.eJoinOperatorsAnd[0].setDisabled(n),this.eJoinOperatorsOr[0].setDisabled(n))}),this.eConditionBodies.forEach((s,o)=>{z(s,this.isConditionBodyVisible(o))});const i=(t??this.getJoinOperator())==="OR";this.eJoinOperatorsAnd.forEach((s,o)=>{s.setValue(!i,!0)}),this.eJoinOperatorsOr.forEach((s,o)=>{s.setValue(i,!0)}),this.forEachInput((s,o,n,r)=>{this.setElementDisplayed(s,o<r),this.setElementDisabled(s,this.isConditionDisabled(n,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=>Xt(o))}removeComponents(e,t,i){this.removeItems(e,t,i).forEach(o=>{Xt(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||!e.suppressFocus&&!this.isReadOnly()){const t=this.getInputs(0)[0];if(!t)return;t instanceof wt&&t.getInputElement().focus()}}afterGuiDetached(){super.afterGuiDetached();const e=this.getModel();(!this.areModelsEqual(e,this.getModelFromUi())||this.hasInvalidInputs())&&this.resetUiToActiveModel(e);let t=-1,i=-1,s=!1;const o=this.getJoinOperator();for(let r=this.getNumConditions()-1;r>=0;r--)if(this.isConditionUiComplete(r))t===-1&&(t=r,i=r);else{const a=r>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(r-1),d=r<t;(a||d)&&(this.removeConditionsAndOperators(r,1),s=!0,d&&i--)}let n=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),n=!0),this.shouldAddNewConditionAtEnd(i===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),n=!0),n&&this.updateConditionStatusesAndValues(i,o),s&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=i}getPlaceholderText(e,t){let i=this.translate(e);if(cn(this.filterPlaceholder)){const s=this.filterPlaceholder,o=this.eTypes[t].getValue(),n=this.translate(o);i=s({filterOptionKey:o,filterOption:n,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 wt))return;const n=i===0&&o>1?"inRangeStart":i===0?"filterOoo":"inRangeEnd",r=i===0&&o>1?e("ariaFilterFromValue","Filter from value"):i===0?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(n,s)),t.setInputAriaLabel(r)})}setElementValue(e,t){e instanceof wt&&e.setValue(t!=null?String(t):null,!0)}setElementDisplayed(e,t){e instanceof V&&z(e.getGui(),t)}setElementDisabled(e,t){e instanceof V&&cs(e.getGui(),t)}attachElementOnChange(e,t){e instanceof wt&&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 n=0;n<o.length;n++){const r=o[n];r!=null&&i(r,n,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)===k.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(),De.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,n,r)=>{n===t&&this.setElementValue(s,i[o]!=null?i[o]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,i,s,o)=>{this.setElementValue(t,i===0&&s===0?e:null)})}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),n=this.evaluateCustomFilter(o,s,i);return n??(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}}k.EMPTY="empty",k.BLANK="blank",k.NOT_BLANK="notBlank",k.EQUALS="equals",k.NOT_EQUAL="notEqual",k.LESS_THAN="lessThan",k.LESS_THAN_OR_EQUAL="lessThanOrEqual",k.GREATER_THAN="greaterThan",k.GREATER_THAN_OR_EQUAL="greaterThanOrEqual",k.IN_RANGE="inRange",k.CONTAINS="contains",k.NOT_CONTAINS="notContains",k.STARTS_WITH="startsWith",k.ENDS_WITH="endsWith";class $ extends k{setParams(e){super.setParams(e),this.scalarFilterParams=e}evaluateNullValue(e){switch(e){case $.EQUALS:case $.NOT_EQUAL:if(this.scalarFilterParams.includeBlanksInEquals)return!0;break;case $.GREATER_THAN:case $.GREATER_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInGreaterThan)return!0;break;case $.LESS_THAN:case $.LESS_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInLessThan)return!0;break;case $.IN_RANGE:if(this.scalarFilterParams.includeBlanksInRange)return!0;break;case $.BLANK:return!0;case $.NOT_BLANK: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 $.NOT_EQUAL:return o!==0;case $.GREATER_THAN:return o>0;case $.GREATER_THAN_OR_EQUAL:return o>=0;case $.LESS_THAN:return o<0;case $.LESS_THAN_OR_EQUAL:return o<=0;case $.IN_RANGE:{const n=s(e[1],t);return this.scalarFilterParams.inRangeInclusive?o>=0&&n<=0:o>0&&n<0}case $.BLANK:return this.isBlank(t);case $.NOT_BLANK:return!this.isBlank(t);default:return console.warn('AG Grid: Unexpected type of filter "'+i.type+'", it looks like the filter was configured with incorrect Filter Options'),!0}}}var Hh=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};const Ud=1e3,jd=1/0;class zd extends Ol{constructor(e,t,i){super(t,i),this.dateFilterParams=e}conditionToString(e,t){const{type:i}=e,{numberOfInputs:s}=t||{},o=i==k.IN_RANGE||s===2,n=Ct(e.dateFrom),r=Ct(e.dateTo),a=this.dateFilterParams.inRangeFloatingFilterDateFormat;if(o){const d=n!==null?Tn(n,a):"null",c=r!==null?Tn(r,a):"null";return`${d}-${c}`}return n!=null?Tn(n,a):`${i}`}}class ps extends ${constructor(){super("dateFilter"),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=Ud,this.maxValidYear=jd}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}mapValuesFromModel(e){const{dateFrom:t,dateTo:i,type:s}=e||{};return[t&&Ct(t)||null,i&&Ct(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]))console.warn(`AG Grid: DateFilter ${i} is not a number`);else return e[i]==null?s:Number(e[i]);return s};this.minValidYear=t("minValidYear",Ud),this.maxValidYear=t("maxValidYear",jd),this.minValidYear>this.maxValidYear&&console.warn("AG Grid: DateFilter minValidYear should be <= maxValidYear"),this.filterModelFormatter=new zd(this.dateFilterParams,this.localeService,this.optionsFactory)}createDateCompWrapper(e){const t=new xd(this.getContext(),this.userComponentFactory,{onDateChanged:()=>this.onUiChanged(),filterParams:this.dateFilterParams},e);return this.addDestroyFunc(()=>t.destroy()),t}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}getDefaultFilterOptions(){return ps.DEFAULT_FILTER_OPTIONS}createValueElement(){const e=document.createElement("div");return e.classList.add("ag-filter-body"),this.createFromToElement(e,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(e,this.eConditionPanelsTo,this.dateConditionToComps,"to"),e}createFromToElement(e,t,i,s){const o=document.createElement("div");o.classList.add(`ag-filter-${s}`),o.classList.add(`ag-filter-date-${s}`),t.push(o),e.appendChild(o),i.push(this.createDateCompWrapper(o))}removeValueElements(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),this.removeItems(this.eConditionPanelsFrom,e,t),this.removeItems(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,i){this.removeItems(e,t,i).forEach(o=>o.destroy())}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;const t=s=>s!=null&&s.getUTCFullYear()>=this.minValidYear&&s.getUTCFullYear()<=this.maxValidYear;let i=!0;return this.forEachInput((s,o,n,r)=>{n!==e||!i||o>=r||(i=i&&t(s.getDate()))}),i}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=st(s[0])),s.length>1&&(i.dateTo=st(s[1])),Object.assign({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,n)=>{s<n&&t.push(i.getDate())}),t}getModelAsString(e){var t;return(t=this.filterModelFormatter.getModelAsString(e))!==null&&t!==void 0?t:""}}ps.DEFAULT_FILTER_OPTIONS=[$.EQUALS,$.GREATER_THAN,$.LESS_THAN,$.NOT_EQUAL,$.IN_RANGE,$.BLANK,$.NOT_BLANK],Hh([p("userComponentFactory")],ps.prototype,"userComponentFactory",void 0);class $d extends V{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.optionsFactory=new Gd,this.optionsFactory.init(e.filterParams,this.getDefaultFilterOptions()),this.lastType=this.optionsFactory.getDefaultOption(),this.readOnly=!!e.filterParams.readOnly;const t=this.isTypeEditable(this.lastType);this.setEditable(t)}doesFilterHaveSingleInput(e){const t=this.optionsFactory.getCustomOption(e),{numberOfInputs:i}=t||{};return i==null||i==1}isTypeEditable(e){const t=[k.IN_RANGE,k.EMPTY,k.BLANK,k.NOT_BLANK];return!!e&&!this.isReadOnly()&&this.doesFilterHaveSingleInput(e)&&t.indexOf(e)<0}}var Pl=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Ln extends $d{constructor(){super(`
<div class="ag-floating-filter-input" role="presentation">
<ag-input-text-field ref="eReadOnlyText"></ag-input-text-field>
<div ref="eDateWrapper" style="display: flex;"></div>
</div>`)}getDefaultFilterOptions(){return ps.DEFAULT_FILTER_OPTIONS}init(e){super.init(e),this.params=e,this.filterParams=e.filterParams,this.createDateComponent();const t=this.localeService.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput","Date Filter Input")),this.filterModelFormatter=new zd(this.filterParams,this.localeService,this.optionsFactory)}setEditable(e){z(this.eDateWrapper,e),z(this.eReadOnlyText.getGui(),!e)}onParentModelChanged(e,t){if(this.isEventFromFloatingFilter(t)||this.isEventFromDataChange(t))return;super.setLastTypeFromModel(e);const i=!this.isReadOnly()&&this.canWeEditAfterModelFromParentFilter(e);if(this.setEditable(i),i){if(e){const s=e;this.dateComp.setDate(Ct(s.dateFrom))}else this.dateComp.setDate(null);this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}onDateChanged(){const e=this.dateComp.getDate(),t=st(e);this.params.parentFilterInstance(i=>{if(i){const s=Ct(t);i.onFloatingFilterChanged(this.getLastType()||null,s)}})}createDateComponent(){const e=vt.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs()),t={onDateChanged:Ft(this.onDateChanged.bind(this),e),filterParams:this.params.column.getColDef().filterParams};this.dateComp=new xd(this.getContext(),this.userComponentFactory,t,this.eDateWrapper),this.addDestroyFunc(()=>this.dateComp.destroy())}getFilterModelFormatter(){return this.filterModelFormatter}}Pl([p("userComponentFactory")],Ln.prototype,"userComponentFactory",void 0),Pl([O("eReadOnlyText")],Ln.prototype,"eReadOnlyText",void 0),Pl([O("eDateWrapper")],Ln.prototype,"eDateWrapper",void 0);var Vh=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Kd extends V{constructor(){super(`
<div class="ag-filter-filter">
<ag-input-text-field class="ag-date-filter" ref="eDateInput"></ag-input-text-field>
</div>`)}destroy(){super.destroy()}init(e){const t=this.gridOptionsService.getDocument(),i=this.eDateInput.getInputElement(),s=this.shouldUseBrowserDatePicker(e);s&&(i.type="date");const o=s&&it();this.addManagedListener(i,"mousedown",()=>{this.eDateInput.isDisabled()||o||i.focus()}),this.addManagedListener(i,"input",a=>{a.target===t.activeElement&&(this.eDateInput.isDisabled()||e.onDateChanged())});const{minValidYear:n,maxValidYear:r}=e.filterParams||{};n&&(i.min=`${n}-01-01`),r&&(i.max=`${r}-12-31`)}getDate(){return Ct(this.eDateInput.getValue())}setDate(e){this.eDateInput.setValue(st(e,!1))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(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:yn()||il()||it()&&tl()>=14.1}}Vh([O("eDateInput")],Kd.prototype,"eDateInput",void 0);class Gi extends wt{constructor(e,t="ag-text-field",i="text"){super(e,t,i)}postConstruct(){super.postConstruct(),this.config.allowedCharPattern&&this.preventDisallowedCharacters()}setValue(e,t){const i=super.setValue(e,t);return this.eInput.value!==e&&(this.eInput.value=R(e)?e:""),i}setStartValue(e){this.setValue(e,!0)}preventDisallowedCharacters(){const e=new RegExp(`[${this.config.allowedCharPattern}]`),t=i=>{ml(i)&&i.key&&!e.test(i.key)&&i.preventDefault()};this.addManagedListener(this.eInput,"keydown",t),this.addManagedListener(this.eInput,"paste",i=>{var s;const o=(s=i.clipboardData)===null||s===void 0?void 0:s.getData("text");o&&o.split("").some(n=>!e.test(n))&&i.preventDefault()})}}class Al extends Gi{constructor(e){super(e,"ag-number-field","number")}postConstruct(){super.postConstruct(),this.addManagedListener(this.eInput,"blur",()=>{const e=parseFloat(this.eInput.value),t=isNaN(e)?"":this.normalizeValue(e.toString());this.value!==t&&this.setValue(t)}),this.addManagedListener(this.eInput,"wheel",this.onWheel.bind(this)),this.eInput.step="any"}onWheel(e){document.activeElement===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,hi(this.eInput,"min",e),this)}setMax(e){return this.max===e?this:(this.max=e,hi(this.eInput,"max",e),this)}setPrecision(e){return this.precision=e,this}setStep(e){return this.step===e?this:(this.step=e,hi(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(R(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")}}class Yd extends Ol{conditionToString(e,t){const{numberOfInputs:i}=t||{};return e.type==k.IN_RANGE||i===2?`${e.filter}-${e.filterTo}`:e.filter!=null?`${e.filter}`:`${e.type}`}}function qd(l){const{allowedCharPattern:e}=l??{};return e??null}class io extends ${constructor(){super("numberFilter"),this.eValuesFrom=[],this.eValuesTo=[]}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 Yd(this.localeService,this.optionsFactory)}getDefaultFilterOptions(){return io.DEFAULT_FILTER_OPTIONS}createValueElement(){const e=qd(this.numberFilterParams),t=document.createElement("div");return t.classList.add("ag-filter-body"),pe(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 Gi({allowedCharPattern:s}):new Al);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,n)=>{s<n&&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=li(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){var t;return(t=this.filterModelFormatter.getModelAsString(e))!==null&&t!==void 0?t:""}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>{if(!t.getInputElement().validity.valid){e=!0;return}}),e}}io.DEFAULT_FILTER_OPTIONS=[$.EQUALS,$.NOT_EQUAL,$.LESS_THAN,$.LESS_THAN_OR_EQUAL,$.GREATER_THAN,$.GREATER_THAN_OR_EQUAL,$.IN_RANGE,$.BLANK,$.NOT_BLANK];class Qd extends Ol{conditionToString(e,t){const{numberOfInputs:i}=t||{};return e.type==k.IN_RANGE||i===2?`${e.filter}-${e.filterTo}`:e.filter!=null?`${e.filter}`:`${e.type}`}}class ue extends k{constructor(){super("textFilter"),this.eValuesFrom=[],this.eValuesTo=[]}static trimInput(e){const t=e&&e.trim();return t===""?e:t}getDefaultDebounceMs(){return 500}setParams(e){this.textFilterParams=e,super.setParams(e),this.matcher=this.getTextMatcher(),this.formatter=this.textFilterParams.textFormatter||(this.textFilterParams.caseSensitive?ue.DEFAULT_FORMATTER:ue.DEFAULT_LOWERCASE_FORMATTER),this.filterModelFormatter=new Qd(this.localeService,this.optionsFactory)}getTextMatcher(){const e=this.textFilterParams.textCustomComparator;return e?(G.doOnce(()=>console.warn("AG Grid - textCustomComparator is deprecated, use textMatcher instead."),"textCustomComparator.deprecated"),({filterOption:t,value:i,filterText:s})=>e(t,i,s)):this.textFilterParams.textMatcher||ue.DEFAULT_MATCHER}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}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){const t=[];return this.forEachPositionInput(e,(i,s,o,n)=>{if(s<n){const r=li(i.getValue()),a=(this.textFilterParams.trimInput?ue.trimInput(r):r)||null;t.push(a),i.setValue(a,!0)}}),t}getDefaultFilterOptions(){return ue.DEFAULT_FILTER_OPTIONS}createValueElement(){const e=document.createElement("div");return e.classList.add("ag-filter-body"),pe(e,"presentation"),this.createFromToElement(e,this.eValuesFrom,"from"),this.createFromToElement(e,this.eValuesTo,"to"),e}createFromToElement(e,t,i){const s=this.createManagedBean(new Gi);s.addCssClass(`ag-filter-${i}`),s.addCssClass("ag-filter-filter"),t.push(s),e.appendChild(s.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}mapValuesFromModel(e){const{filter:t,filterTo:i,type:s}=e||{};return[t||null,i||null].slice(0,this.getNumberOfInputs(s))}evaluateNullValue(e){const t=[k.NOT_EQUAL,k.NOT_CONTAINS,k.BLANK];return e?t.indexOf(e)>=0:!1}evaluateNonNullValue(e,t,i,s){const o=e.map(m=>this.formatter(m))||[],n=this.formatter(t),{api:r,colDef:a,column:d,columnApi:c,context:h,textFormatter:g}=this.textFilterParams;if(i.type===k.BLANK)return this.isBlank(t);if(i.type===k.NOT_BLANK)return!this.isBlank(t);const f={api:r,colDef:a,column:d,columnApi:c,context:h,node:s.node,data:s.data,filterOption:i.type,value:n,textFormatter:g};return o.some(m=>this.matcher(Object.assign(Object.assign({},f),{filterText:m})))}getModelAsString(e){var t;return(t=this.filterModelFormatter.getModelAsString(e))!==null&&t!==void 0?t:""}}ue.DEFAULT_FILTER_OPTIONS=[k.CONTAINS,k.NOT_CONTAINS,k.EQUALS,k.NOT_EQUAL,k.STARTS_WITH,k.ENDS_WITH,k.BLANK,k.NOT_BLANK],ue.DEFAULT_FORMATTER=l=>l,ue.DEFAULT_LOWERCASE_FORMATTER=l=>l==null?null:l.toString().toLowerCase(),ue.DEFAULT_MATCHER=({filterOption:l,value:e,filterText:t})=>{if(t==null)return!1;switch(l){case ue.CONTAINS:return e.indexOf(t)>=0;case ue.NOT_CONTAINS:return e.indexOf(t)<0;case ue.EQUALS:return e===t;case ue.NOT_EQUAL:return e!=t;case ue.STARTS_WITH:return e.indexOf(t)===0;case ue.ENDS_WITH:const i=e.lastIndexOf(t);return i>=0&&i===e.length-t.length;default:return!1}};var Fl=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Xd extends T{constructor(e){super(),this.params=e}setupGui(e){this.eFloatingFilterTextInput=this.createManagedBean(new Gi(this.params.config)),this.eFloatingFilterTextInput.setInputAriaLabel(this.params.ariaLabel),e.appendChild(this.eFloatingFilterTextInput.getGui())}setEditable(e){this.eFloatingFilterTextInput.setDisabled(!e)}getValue(){return this.eFloatingFilterTextInput.getValue()}setValue(e,t){this.eFloatingFilterTextInput.setValue(e,t)}addValueChangedListener(e){const t=this.eFloatingFilterTextInput.getGui();this.addManagedListener(t,"input",e),this.addManagedListener(t,"keydown",e)}}class so extends $d{postConstruct(){this.setTemplate(`
<div class="ag-floating-filter-input" role="presentation" 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.params=e;const t=this.columnModel.getDisplayNameForColumn(e.column,"header",!0),i=this.localeService.getLocaleTextFunc(),s=`${t} ${i("ariaFilterInput","Filter Input")}`;if(this.floatingFilterInputService=this.createFloatingFilterInputService(s),this.floatingFilterInputService.setupGui(this.eFloatingFilterInputContainer),super.init(e),this.applyActive=vt.isUseApplyButton(this.params.filterParams),!this.isReadOnly()){const o=vt.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs()),n=Ft(this.syncUpWithParentFilter.bind(this),o);this.floatingFilterInputService.addValueChangedListener(n)}}syncUpWithParentFilter(e){const t=e.key===w.ENTER;if(this.applyActive&&!t)return;let i=this.floatingFilterInputService.getValue();this.params.filterParams.trimInput&&(i=ue.trimInput(i),this.floatingFilterInputService.setValue(i,!0)),this.params.parentFilterInstance(s=>{s&&s.onFloatingFilterChanged(this.getLastType()||null,i||null)})}setEditable(e){this.floatingFilterInputService.setEditable(e)}}Fl([p("columnModel")],so.prototype,"columnModel",void 0),Fl([O("eFloatingFilterInputContainer")],so.prototype,"eFloatingFilterInputContainer",void 0),Fl([D],so.prototype,"postConstruct",null);class Bh extends T{constructor(e){super(),this.params=e,this.numberInputActive=!0}setupGui(e){this.eFloatingFilterNumberInput=this.createManagedBean(new Al),this.eFloatingFilterTextInput=this.createManagedBean(new Gi),this.eFloatingFilterTextInput.setDisabled(!0),this.eFloatingFilterNumberInput.setInputAriaLabel(this.params.ariaLabel),this.eFloatingFilterTextInput.setInputAriaLabel(this.params.ariaLabel),e.appendChild(this.eFloatingFilterNumberInput.getGui()),e.appendChild(this.eFloatingFilterTextInput.getGui())}setEditable(e){this.numberInputActive=e,this.eFloatingFilterNumberInput.setDisplayed(this.numberInputActive),this.eFloatingFilterTextInput.setDisplayed(!this.numberInputActive)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eFloatingFilterNumberInput:this.eFloatingFilterTextInput}addValueChangedListener(e){this.setupListeners(this.eFloatingFilterNumberInput.getGui(),e),this.setupListeners(this.eFloatingFilterTextInput.getGui(),e)}setupListeners(e,t){this.addManagedListener(e,"input",t),this.addManagedListener(e,"keydown",t)}}class Wh extends so{init(e){super.init(e),this.filterModelFormatter=new Yd(this.localeService,this.optionsFactory)}getDefaultFilterOptions(){return io.DEFAULT_FILTER_OPTIONS}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(e){const t=qd(this.params.filterParams);return t?this.createManagedBean(new Xd({config:{allowedCharPattern:t},ariaLabel:e})):this.createManagedBean(new Bh({ariaLabel:e}))}}class kh extends so{init(e){super.init(e),this.filterModelFormatter=new Qd(this.localeService,this.optionsFactory)}getDefaultFilterOptions(){return ue.DEFAULT_FILTER_OPTIONS}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(e){return this.createManagedBean(new Xd({ariaLabel:e}))}}class re{constructor(e,t=!1){this.destroyFuncs=[],this.touching=!1,this.eventService=new gt,this.eElement=e,this.preventMouseClick=t;const i=this.onTouchStart.bind(this),s=this.onTouchMove.bind(this),o=this.onTouchEnd.bind(this);this.eElement.addEventListener("touchstart",i,{passive:!0}),this.eElement.addEventListener("touchmove",s,{passive:!0}),this.eElement.addEventListener("touchend",o,{passive:!1}),this.destroyFuncs.push(()=>{this.eElement.removeEventListener("touchstart",i,{passive:!0}),this.eElement.removeEventListener("touchmove",s,{passive:!0}),this.eElement.removeEventListener("touchend",o,{passive:!1})})}getActiveTouch(e){for(let t=0;t<e.length;t++)if(e[t].identifier===this.touchStart.identifier)return e[t];return null}addEventListener(e,t){this.eventService.addEventListener(e,t)}removeEventListener(e,t){this.eventService.removeEventListener(e,t)}onTouchStart(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:re.EVENT_LONG_TAP,touchStart:this.touchStart,touchEvent:e};this.eventService.dispatchEvent(s)}},500)}onTouchMove(e){if(!this.touching)return;const t=this.getActiveTouch(e.touches);if(!t)return;!vl(t,this.touchStart,4)&&(this.moved=!0)}onTouchEnd(e){if(this.touching){if(!this.moved){const t={type:re.EVENT_TAP,touchStart:this.touchStart};this.eventService.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>re.DOUBLE_TAP_MILLIS){const i={type:re.EVENT_DOUBLE_TAP,touchStart:this.touchStart};this.eventService.dispatchEvent(i),this.lastTapTime=null}else this.lastTapTime=e;else this.lastTapTime=e}destroy(){this.destroyFuncs.forEach(e=>e())}}re.EVENT_TAP="tap",re.EVENT_DOUBLE_TAP="doubleTap",re.EVENT_LONG_TAP="longTap",re.DOUBLE_TAP_MILLIS=500;var Hi=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Ue extends V{constructor(e){super(),e||this.setTemplate(Ue.TEMPLATE)}attachCustomElements(e,t,i,s,o){this.eSortOrder=e,this.eSortAsc=t,this.eSortDesc=i,this.eSortMixed=s,this.eSortNone=o}setupSort(e,t=!1){this.column=e,this.suppressOrder=t,this.setupMultiSortIndicator(),this.column.getColDef().sortable&&(this.addInIcon("sortAscending",this.eSortAsc,e),this.addInIcon("sortDescending",this.eSortDesc,e),this.addInIcon("sortUnSort",this.eSortNone,e),this.addManagedListener(this.eventService,u.EVENT_SORT_CHANGED,()=>this.onSortChanged()),this.addManagedListener(this.eventService,u.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.onSortChanged()),this.onSortChanged())}addInIcon(e,t,i){if(t==null)return;const s=le(e,this.gridOptionsService,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";z(this.eSortAsc,t,{skipAriaHidden:!0})}if(this.eSortDesc){const t=e==="desc";z(this.eSortDesc,t,{skipAriaHidden:!0})}if(this.eSortNone){const t=!this.column.getColDef().unSortIcon&&!this.gridOptionsService.is("unSortIcon"),i=e==null;z(this.eSortNone,!t&&i,{skipAriaHidden:!0})}}setupMultiSortIndicator(){this.addInIcon("sortUnSort",this.eSortMixed,this.column);const e=this.column.getColDef().showRowGroup;this.gridOptionsService.isColumnsSortingCoupledToGroup()&&e&&(this.addManagedListener(this.eventService,u.EVENT_SORT_CHANGED,()=>this.updateMultiSortIndicator()),this.addManagedListener(this.eventService,u.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.updateMultiSortIndicator()),this.updateMultiSortIndicator())}updateMultiSortIndicator(){if(this.eSortMixed){const e=this.sortController.getDisplaySortForColumn(this.column)==="mixed";z(this.eSortMixed,e,{skipAriaHidden:!0})}}updateSortOrder(){var e;if(!this.eSortOrder)return;const t=this.sortController.getColumnsWithSortingOrdered(),i=(e=this.sortController.getDisplaySortIndexForColumn(this.column))!==null&&e!==void 0?e:-1,s=t.some(n=>{var r;return(r=this.sortController.getDisplaySortIndexForColumn(n))!==null&&r!==void 0?r:-1>=1}),o=i>=0&&s;z(this.eSortOrder,o,{skipAriaHidden:!0}),i>=0?this.eSortOrder.innerHTML=(i+1).toString():We(this.eSortOrder)}}Ue.TEMPLATE=`<span class="ag-sort-indicator-container">
<span ref="eSortOrder" class="ag-sort-indicator-icon ag-sort-order ag-hidden" aria-hidden="true"></span>
<span ref="eSortAsc" class="ag-sort-indicator-icon ag-sort-ascending-icon ag-hidden" aria-hidden="true"></span>
<span ref="eSortDesc" class="ag-sort-indicator-icon ag-sort-descending-icon ag-hidden" aria-hidden="true"></span>
<span ref="eSortMixed" class="ag-sort-indicator-icon ag-sort-mixed-icon ag-hidden" aria-hidden="true"></span>
<span ref="eSortNone" class="ag-sort-indicator-icon ag-sort-none-icon ag-hidden" aria-hidden="true"></span>
</span>`,Hi([O("eSortOrder")],Ue.prototype,"eSortOrder",void 0),Hi([O("eSortAsc")],Ue.prototype,"eSortAsc",void 0),Hi([O("eSortDesc")],Ue.prototype,"eSortDesc",void 0),Hi([O("eSortMixed")],Ue.prototype,"eSortMixed",void 0),Hi([O("eSortNone")],Ue.prototype,"eSortNone",void 0),Hi([p("columnModel")],Ue.prototype,"columnModel",void 0),Hi([p("sortController")],Ue.prototype,"sortController",void 0);var je=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Ce extends V{constructor(){super(...arguments),this.lastMovingChanged=0}destroy(){super.destroy()}refresh(e){return this.params=e,this.workOutTemplate()!=this.currentTemplate||this.workOutShowMenu()!=this.currentShowMenu||this.workOutSort()!=this.currentSort?!1:(this.setDisplayName(e),!0)}workOutTemplate(){let e=Ua(this.params.template,Ce.TEMPLATE);return e=e&&e.trim?e.trim():e,e}init(e){this.params=e,this.currentTemplate=this.workOutTemplate(),this.setTemplate(this.currentTemplate),this.setupTap(),this.setupIcons(e.column),this.setMenu(),this.setupSort(),this.setupFilterIcon(),this.setDisplayName(e)}setDisplayName(e){if(this.currentDisplayName!=e.displayName){this.currentDisplayName=e.displayName;const t=It(this.currentDisplayName);this.eText&&(this.eText.innerHTML=t)}}setupIcons(e){this.addInIcon("menu",this.eMenu,e),this.addInIcon("filter",this.eFilter,e)}addInIcon(e,t,i){if(t==null)return;const s=le(e,this.gridOptionsService,i);s&&t.appendChild(s)}setupTap(){const{gridOptionsService:e}=this;if(e.is("suppressTouch"))return;const t=new re(this.getGui(),!0),i=e.is("suppressMenuHide"),s=i&&R(this.eMenu),o=s?new re(this.eMenu,!0):t;if(this.params.enableMenu){const n=s?"EVENT_TAP":"EVENT_LONG_TAP",r=a=>{e.api.showColumnMenuAfterMouseClick(this.params.column,a.touchStart)};this.addManagedListener(o,re[n],r)}if(this.params.enableSorting){const n=r=>{const a=r.touchStart.target;i&&this.eMenu.contains(a)||this.sortController.progressSort(this.params.column,!1,"uiColumnSorted")};this.addManagedListener(t,re.EVENT_TAP,n)}this.addDestroyFunc(()=>t.destroy()),s&&this.addDestroyFunc(()=>o.destroy())}workOutShowMenu(){const e=!this.gridOptionsService.is("suppressMenuHide"),t=ci()&&e;return this.params.enableMenu&&!t}setMenu(){if(!this.eMenu)return;if(this.currentShowMenu=this.workOutShowMenu(),!this.currentShowMenu){Xt(this.eMenu);return}const e=this.gridOptionsService.is("suppressMenuHide");this.addManagedListener(this.eMenu,"click",()=>this.showMenu(this.eMenu)),this.eMenu.classList.toggle("ag-header-menu-always-show",e)}showMenu(e){e||(e=this.eMenu),this.menuFactory.showMenuAfterButtonClick(this.params.column,e,"columnMenu")}workOutSort(){return this.params.enableSorting}setupSort(){if(this.currentSort=this.params.enableSorting,this.eSortIndicator||(this.eSortIndicator=this.context.createBean(new Ue(!0)),this.eSortIndicator.attachCustomElements(this.eSortOrder,this.eSortAsc,this.eSortDesc,this.eSortMixed,this.eSortNone)),this.eSortIndicator.setupSort(this.params.column),!this.currentSort)return;const e=this.gridOptionsService.get("multiSortKey")==="ctrl";this.addManagedListener(this.params.column,H.EVENT_MOVING_CHANGED,()=>{this.lastMovingChanged=new Date().getTime()}),this.eLabel&&this.addManagedListener(this.eLabel,"click",i=>{const s=this.params.column.isMoving(),n=new Date().getTime()-this.lastMovingChanged<50;if(!(s||n)){const a=e?i.ctrlKey||i.metaKey:i.shiftKey;this.params.progressSort(a)}});const t=()=>{if(this.addOrRemoveCssClass("ag-header-cell-sorted-asc",this.params.column.isSortAscending()),this.addOrRemoveCssClass("ag-header-cell-sorted-desc",this.params.column.isSortDescending()),this.addOrRemoveCssClass("ag-header-cell-sorted-none",this.params.column.isSortNone()),this.params.column.getColDef().showRowGroup){const i=this.columnModel.getSourceColumnsForGroupColumn(this.params.column),o=!(i==null?void 0:i.every(n=>this.params.column.getSort()==n.getSort()));this.addOrRemoveCssClass("ag-header-cell-sorted-mixed",o)}};this.addManagedListener(this.eventService,u.EVENT_SORT_CHANGED,t),this.addManagedListener(this.eventService,u.EVENT_COLUMN_ROW_GROUP_CHANGED,t)}setupFilterIcon(){this.eFilter&&(this.addManagedListener(this.params.column,H.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.onFilterChanged())}onFilterChanged(){const e=this.params.column.isFilterActive();z(this.eFilter,e,{skipAriaHidden:!0})}}Ce.TEMPLATE=`<div class="ag-cell-label-container" role="presentation">
<span ref="eMenu" class="ag-header-icon ag-header-cell-menu-button" aria-hidden="true"></span>
<div ref="eLabel" class="ag-header-cell-label" role="presentation">
<span ref="eText" class="ag-header-cell-text"></span>
<span ref="eFilter" class="ag-header-icon ag-header-label-icon ag-filter-icon" aria-hidden="true"></span>
<ag-sort-indicator ref="eSortIndicator"></ag-sort-indicator>
</div>
</div>`,je([p("sortController")],Ce.prototype,"sortController",void 0),je([p("menuFactory")],Ce.prototype,"menuFactory",void 0),je([p("columnModel")],Ce.prototype,"columnModel",void 0),je([O("eFilter")],Ce.prototype,"eFilter",void 0),je([O("eSortIndicator")],Ce.prototype,"eSortIndicator",void 0),je([O("eMenu")],Ce.prototype,"eMenu",void 0),je([O("eLabel")],Ce.prototype,"eLabel",void 0),je([O("eText")],Ce.prototype,"eText",void 0),je([O("eSortOrder")],Ce.prototype,"eSortOrder",void 0),je([O("eSortAsc")],Ce.prototype,"eSortAsc",void 0),je([O("eSortDesc")],Ce.prototype,"eSortDesc",void 0),je([O("eSortMixed")],Ce.prototype,"eSortMixed",void 0),je([O("eSortNone")],Ce.prototype,"eSortNone",void 0);var Ll=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Vi extends V{constructor(){super(Vi.TEMPLATE)}destroy(){super.destroy()}init(e){this.params=e,this.checkWarnings(),this.setupLabel(),this.addGroupExpandIcon(),this.setupExpandIcons()}checkWarnings(){if(this.params.template){const t="AG Grid: A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)";Y(()=>console.warn(t),"HeaderGroupComp.templateNotSupported")}}setupExpandIcons(){this.addInIcon("columnGroupOpened","agOpened"),this.addInIcon("columnGroupClosed","agClosed");const e=s=>{if(Lt(s))return;const o=!this.params.columnGroup.isExpanded();this.columnModel.setColumnGroupOpened(this.params.columnGroup.getProvidedColumnGroup(),o,"uiColumnExpanded")};this.addTouchAndClickListeners(this.eCloseIcon,e),this.addTouchAndClickListeners(this.eOpenIcon,e);const t=s=>{qt(s)};this.addManagedListener(this.eCloseIcon,"dblclick",t),this.addManagedListener(this.eOpenIcon,"dblclick",t),this.addManagedListener(this.getGui(),"dblclick",e),this.updateIconVisibility();const i=this.params.columnGroup.getProvidedColumnGroup();this.addManagedListener(i,ee.EVENT_EXPANDED_CHANGED,this.updateIconVisibility.bind(this)),this.addManagedListener(i,ee.EVENT_EXPANDABLE_CHANGED,this.updateIconVisibility.bind(this))}addTouchAndClickListeners(e,t){const i=new re(e,!0);this.addManagedListener(i,re.EVENT_TAP,t),this.addDestroyFunc(()=>i.destroy()),this.addManagedListener(e,"click",t)}updateIconVisibility(){if(this.params.columnGroup.isExpandable()){const t=this.params.columnGroup.isExpanded();z(this.eOpenIcon,t),z(this.eCloseIcon,!t)}else z(this.eOpenIcon,!1),z(this.eCloseIcon,!1)}addInIcon(e,t){const i=le(e,this.gridOptionsService,null);i&&this.getRefElement(t).appendChild(i)}addGroupExpandIcon(){if(!this.params.columnGroup.isExpandable()){z(this.eOpenIcon,!1),z(this.eCloseIcon,!1);return}}setupLabel(){var e;const{displayName:t,columnGroup:i}=this.params;if(R(t)){const s=It(t);this.getRefElement("agLabel").innerHTML=s}this.addOrRemoveCssClass("ag-sticky-label",!(!((e=i.getColGroupDef())===null||e===void 0)&&e.suppressStickyLabel))}}Vi.TEMPLATE=`<div class="ag-header-group-cell-label" ref="agContainer" role="presentation">
<span ref="agLabel" class="ag-header-group-text" role="presentation"></span>
<span ref="agOpened" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded"></span>
<span ref="agClosed" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed"></span>
</div>`,Ll([p("columnModel")],Vi.prototype,"columnModel",void 0),Ll([O("agOpened")],Vi.prototype,"eOpenIcon",void 0),Ll([O("agClosed")],Vi.prototype,"eCloseIcon",void 0);class gs extends V{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()}}var Uh=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class oo extends gs{constructor(){super(oo.TEMPLATE)}init(e){this.params=e,this.focusAfterAttached=e.cellStartedEdit,this.eTextArea.setMaxLength(e.maxLength||200).setCols(e.cols||60).setRows(e.rows||10),R(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===w.LEFT||t===w.UP||t===w.RIGHT||t===w.DOWN||e.shiftKey&&t===w.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!R(e)&&!R(this.params.value)?this.params.value:this.params.parseValue(e)}}oo.TEMPLATE=`<div class="ag-large-text">
<ag-input-text-area ref="eTextArea" class="ag-large-text-input"></ag-input-text-area>
</div>`,Uh([O("eTextArea")],oo.prototype,"eTextArea",void 0);var Jd=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Il extends gs{constructor(){super('<div class="ag-cell-edit-wrapper"><ag-select class="ag-cell-editor" ref="eSelect"></ag-select></div>'),this.startedByEnter=!1}init(e){if(this.focusAfterAttached=e.cellStartedEdit,x(e.values)){console.warn("AG Grid: no values found for select cellEditor");return}this.startedByEnter=e.eventKey!=null?e.eventKey===w.ENTER:!1;let t=!1;e.values.forEach(i=>{const s={value:i},o=this.valueFormatterService.formatValue(e.column,null,i),n=o!=null;s.text=n?o:i,this.eSelect.addOption(s),t=t||e.value===i}),t?this.eSelect.setValue(e.value,!0):e.values.length&&this.eSelect.setValue(e.values[0],!0),this.gridOptionsService.get("editType")!=="fullRow"&&this.addManagedListener(this.eSelect,pi.EVENT_ITEM_SELECTED,()=>e.stopEditing())}afterGuiAttached(){this.focusAfterAttached&&this.eSelect.getFocusableElement().focus(),this.startedByEnter&&this.eSelect.showPicker()}focusIn(){this.eSelect.getFocusableElement().focus()}getValue(){return this.eSelect.getValue()}isPopup(){return!1}}Jd([p("valueFormatterService")],Il.prototype,"valueFormatterService",void 0),Jd([O("eSelect")],Il.prototype,"eSelect",void 0);var jh=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class no extends gs{constructor(e){super(`
<div class="ag-cell-edit-wrapper">
${e.getTemplate()}
</div>`),this.cellEditorInput=e}init(e){this.params=e;const t=this.eInput;this.cellEditorInput.init(t,e);let i;if(e.cellStartedEdit){this.focusAfterAttached=!0;const s=e.eventKey;s===w.BACKSPACE||e.eventKey===w.DELETE?i="":s&&s.length===1?i=s:(i=this.cellEditorInput.getStartValue(),s!==w.F2&&(this.highlightAllOnFocus=!0))}else this.focusAfterAttached=!1,i=this.cellEditorInput.getStartValue();i!=null&&t.setStartValue(i),this.addManagedListener(t.getGui(),"keydown",s=>{const{key:o}=s;(o===w.PAGE_UP||o===w.PAGE_DOWN)&&s.preventDefault()})}afterGuiAttached(){var e,t;const i=this.localeService.getLocaleTextFunc(),s=this.eInput;if(s.setInputAriaLabel(i("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;it()||s.getFocusableElement().focus();const o=s.getInputElement();this.highlightAllOnFocus?o.select():(t=(e=this.cellEditorInput).setCaret)===null||t===void 0||t.call(e)}focusIn(){const e=this.eInput,t=e.getFocusableElement(),i=e.getInputElement();t.focus(),i.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}}jh([O("eInput")],no.prototype,"eInput",void 0);class zh{getTemplate(){return'<ag-input-text-field class="ag-cell-editor" ref="eInput"></ag-input-text-field>'}init(e,t){this.eInput=e,this.params=t,t.maxLength!=null&&e.setMaxLength(t.maxLength)}getValue(){const e=this.eInput.getValue();return!R(e)&&!R(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=R(e)&&e.length||0;t&&this.eInput.getInputElement().setSelectionRange(t,t)}}class Zd extends no{constructor(){super(new zh)}}var $h=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};const Kh="↑",Yh="↓";class ro extends V{constructor(){super(ro.TEMPLATE),this.refreshCount=0}init(e){this.eValue=this.queryForHtmlElement(".ag-value-change-value"),this.eDelta=this.queryForHtmlElement(".ag-value-change-delta"),this.refresh(e)}showDelta(e,t){const i=Math.abs(t),s=e.formatValue(i),o=R(s)?s:i,n=t>=0;n?this.eDelta.innerHTML=Kh+o:this.eDelta.innerHTML=Yh+o,this.eDelta.classList.toggle("ag-value-change-delta-up",n),this.eDelta.classList.toggle("ag-value-change-delta-down",!n)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),We(this.eDelta)}refresh(e){const t=e.value;if(t===this.lastValue||(R(e.valueFormatted)?this.eValue.innerHTML=e.valueFormatted:R(e.value)?this.eValue.innerHTML=t:We(this.eValue),this.filterManager.isSuppressFlashingCellsBecauseFiltering()))return!1;if(typeof t=="number"&&typeof this.lastValue=="number"){const i=t-this.lastValue;this.showDelta(e,i)}return this.lastValue&&this.eValue.classList.add("ag-value-change-value-highlight"),this.setTimerToRemoveDelta(),this.lastValue=t,!0}}ro.TEMPLATE='<span><span class="ag-value-change-delta"></span><span class="ag-value-change-value"></span></span>',$h([p("filterManager")],ro.prototype,"filterManager",void 0);var qh=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class lo extends V{constructor(){super(lo.TEMPLATE),this.refreshCount=0,this.eCurrent=this.queryForHtmlElement(".ag-value-slide-current")}init(e){this.refresh(e)}addSlideAnimation(){this.refreshCount++;const e=this.refreshCount;this.ePrevious&&this.getGui().removeChild(this.ePrevious),this.ePrevious=fe('<span class="ag-value-slide-previous ag-value-slide-out"></span>'),this.ePrevious.innerHTML=this.eCurrent.innerHTML,this.getGui().insertBefore(this.ePrevious,this.eCurrent),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){let t=e.value;return x(t)&&(t=""),t===this.lastValue||this.filterManager.isSuppressFlashingCellsBecauseFiltering()?!1:(this.addSlideAnimation(),this.lastValue=t,R(e.valueFormatted)?this.eCurrent.innerHTML=e.valueFormatted:R(e.value)?this.eCurrent.innerHTML=t:We(this.eCurrent),!0)}}lo.TEMPLATE=`<span>
<span class="ag-value-slide-current"></span>
</span>`,qh([p("filterManager")],lo.prototype,"filterManager",void 0);class P{constructor(e){this.rowIndex=null,this.key=null,this.childrenMapped={},this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=P.OBJECT_ID_SEQUENCE++,this.__autoHeights={},this.alreadyRendered=!1,this.highlighted=null,this.hovered=!1,this.selected=!1,this.beans=e}setData(e){this.setDataCommon(e,!1)}updateData(e){this.setDataCommon(e,!0)}setDataCommon(e,t){const i=this.data;this.data=e,this.beans.valueCache.onDataChanged(),this.updateDataOnDetailNode(),this.checkRowSelectable(),this.resetQuickFilterAggregateText();const s=this.createDataChangedEvent(e,i,t);this.dispatchLocalEvent(s)}updateDataOnDetailNode(){this.detailNode&&(this.detailNode.data=this.data)}createDataChangedEvent(e,t,i){return{type:P.EVENT_DATA_CHANGED,node:this,oldData:t,newData:e,update:i}}createLocalRowEvent(e){return{type:e,node:this}}getRowIndexString(){return this.rowPinned==="top"?"t-"+this.rowIndex:this.rowPinned==="bottom"?"b-"+this.rowIndex:this.rowIndex.toString()}createDaemonNode(){const e=new P(this.beans);return e.id=this.id,e.data=this.data,e.__daemon=!0,e.selected=this.selected,e.level=this.level,e}setDataAndId(e,t){const i=R(this.id)?this.createDaemonNode():null,s=this.data;this.data=e,this.updateDataOnDetailNode(),this.setId(t),this.beans.selectionService.syncInRowNode(this,i),this.checkRowSelectable();const o=this.createDataChangedEvent(e,s,!1);this.dispatchLocalEvent(o)}checkRowSelectable(){const e=this.beans.gridOptionsService.get("isRowSelectable");this.setRowSelectable(e?e(this):!0)}setRowSelectable(e){if(this.selectable!==e&&(this.selectable=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(P.EVENT_SELECTABLE_CHANGED)),this.beans.gridOptionsService.is("groupSelectsChildren"))){const i=this.calculateSelectedFromChildren();this.setSelectedParams({newValue:i??!1,source:"selectableChanged"})}}setId(e){const t=this.beans.gridOptionsService.getCallback("getRowId");if(t)if(this.data){const i=this.getGroupKeys(!0);this.id=t({data:this.data,parentKeys:i.length>0?i:void 0,level:this.level}),this.id!==null&&typeof this.id=="string"&&this.id.startsWith(P.ID_PREFIX_ROW_GROUP)&&console.error(`AG Grid: Row IDs cannot start with ${P.ID_PREFIX_ROW_GROUP}, this is a reserved prefix for AG Grid's row grouping feature.`),this.id!==null&&typeof this.id!="string"&&(this.id=""+this.id)}else this.id=void 0;else this.id=e}getGroupKeys(e=!1){const t=[];let i=this;for(e&&(i=i.parent);i&&i.level>=0;)t.push(i.key),i=i.parent;return t.reverse(),t}isPixelInRange(e){return!R(this.rowTop)||!R(this.rowHeight)?!1:e>=this.rowTop&&e<this.rowTop+this.rowHeight}setFirstChild(e){this.firstChild!==e&&(this.firstChild=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(P.EVENT_FIRST_CHILD_CHANGED)))}setLastChild(e){this.lastChild!==e&&(this.lastChild=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(P.EVENT_LAST_CHILD_CHANGED)))}setChildIndex(e){this.childIndex!==e&&(this.childIndex=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(P.EVENT_CHILD_INDEX_CHANGED)))}setRowTop(e){this.oldRowTop=this.rowTop,this.rowTop!==e&&(this.rowTop=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(P.EVENT_TOP_CHANGED)),this.setDisplayed(e!==null))}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setDisplayed(e){this.displayed!==e&&(this.displayed=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(P.EVENT_DISPLAYED_CHANGED)))}setDragging(e){this.dragging!==e&&(this.dragging=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(P.EVENT_DRAGGING_CHANGED)))}setHighlighted(e){e!==this.highlighted&&(this.highlighted=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(P.EVENT_HIGHLIGHT_CHANGED)))}setHovered(e){this.hovered!==e&&(this.hovered=e)}isHovered(){return this.hovered}setAllChildrenCount(e){this.allChildrenCount!==e&&(this.allChildrenCount=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(P.EVENT_ALL_CHILDREN_COUNT_CHANGED)))}setMaster(e){this.master!==e&&(this.master&&!e&&(this.expanded=!1),this.master=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(P.EVENT_MASTER_CHANGED)))}setGroup(e){this.group!==e&&(this.group&&!e&&(this.expanded=!1),this.group=e,this.updateHasChildren(),this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(P.EVENT_GROUP_CHANGED)))}setRowHeight(e,t=!1){this.rowHeight=e,this.rowHeightEstimated=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(P.EVENT_HEIGHT_CHANGED))}setRowAutoHeight(e,t){this.__autoHeights||(this.__autoHeights={}),this.__autoHeights[t.getId()]=e,e!=null&&(this.checkAutoHeightsDebounced==null&&(this.checkAutoHeightsDebounced=Ft(this.checkAutoHeights.bind(this),1)),this.checkAutoHeightsDebounced())}checkAutoHeights(){let e=!1,t=!0,i=0;const s=this.__autoHeights;if(s==null||(this.beans.columnModel.getAllDisplayedAutoHeightCols().forEach(r=>{let a=s[r.getId()];if(a==null)if(this.beans.columnModel.isColSpanActive()){let d=[];switch(r.getPinned()){case"left":d=this.beans.columnModel.getDisplayedLeftColumnsForRow(this);break;case"right":d=this.beans.columnModel.getDisplayedRightColumnsForRow(this);break;case null:d=this.beans.columnModel.getViewportCenterColumnsForRow(this);break}if(d.includes(r)){e=!0;return}a=-1}else{e=!0;return}else t=!1;a>i&&(i=a)}),e)||((t||i<10)&&(i=this.beans.gridOptionsService.getRowHeightForNode(this).height),i==this.rowHeight))return;this.setRowHeight(i);const n=this.beans.rowModel;n.onRowHeightChangedDebounced&&n.onRowHeightChangedDebounced()}setRowIndex(e){this.rowIndex!==e&&(this.rowIndex=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(P.EVENT_ROW_INDEX_CHANGED)))}setUiLevel(e){this.uiLevel!==e&&(this.uiLevel=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(P.EVENT_UI_LEVEL_CHANGED)))}setExpanded(e,t){if(this.expanded===e)return;this.expanded=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(P.EVENT_EXPANDED_CHANGED));const i=Object.assign({},this.createGlobalRowEvent(u.EVENT_ROW_GROUP_OPENED),{expanded:e,event:t||null});this.beans.rowNodeEventThrottle.dispatchExpanded(i),this.beans.gridOptionsService.is("groupIncludeFooter")&&this.beans.rowRenderer.refreshCells({rowNodes:[this]})}createGlobalRowEvent(e){return{type:e,node:this,data:this.data,rowIndex:this.rowIndex,rowPinned:this.rowPinned,context:this.beans.gridOptionsService.context,api:this.beans.gridOptionsService.api,columnApi:this.beans.gridOptionsService.columnApi}}dispatchLocalEvent(e){this.eventService&&this.eventService.dispatchEvent(e)}setDataValue(e,t,i){const o=(()=>{var a;return typeof e!="string"?e:(a=this.beans.columnModel.getGridColumn(e))!==null&&a!==void 0?a:this.beans.columnModel.getPrimaryColumn(e)})(),n=this.getValueFromValueService(o);if(this.beans.gridOptionsService.is("readOnlyEdit"))return this.dispatchEventForSaveValueReadOnly(o,n,t,i),!1;const r=this.beans.valueService.setValue(this,o,t,i);return this.dispatchCellChangedEvent(o,t,n),this.checkRowSelectable(),r}getValueFromValueService(e){const t=this.leafGroup&&this.beans.columnModel.isPivotMode(),i=this.group&&this.expanded&&!this.footer&&!t,s=this.beans.gridOptionsService.is("groupIncludeFooter"),o=this.beans.gridOptionsService.is("groupSuppressBlankHeader"),n=i&&s&&!o;return this.beans.valueService.getValue(e,this,!1,n)}dispatchEventForSaveValueReadOnly(e,t,i,s){const o={type:u.EVENT_CELL_EDIT_REQUEST,event:null,rowIndex:this.rowIndex,rowPinned:this.rowPinned,column:e,colDef:e.getColDef(),context:this.beans.gridOptionsService.context,api:this.beans.gridOptionsService.api,columnApi:this.beans.gridOptionsService.columnApi,data:this.data,node:this,oldValue:t,newValue:i,value:i,source:s};this.beans.eventService.dispatchEvent(o)}setGroupValue(e,t){const i=this.beans.columnModel.getGridColumn(e);x(this.groupData)&&(this.groupData={});const s=i.getColId(),o=this.groupData[s];o!==t&&(this.groupData[s]=t,this.dispatchCellChangedEvent(i,t,o))}setAggData(e){const t=Ma([this.aggData,e]),i=this.aggData;this.aggData=e,this.eventService&&t.forEach(s=>{const o=this.beans.columnModel.getGridColumn(s),n=this.aggData?this.aggData[s]:void 0,r=i?i[s]:void 0;this.dispatchCellChangedEvent(o,n,r)})}updateHasChildren(){let e=this.group&&!this.footer||this.childrenAfterGroup&&this.childrenAfterGroup.length>0;if(this.beans.gridOptionsService.isRowModelType("serverSide")){const i=this.beans.gridOptionsService.isTreeData(),s=this.beans.gridOptionsService.get("isServerSideGroup");e=!this.stub&&!this.footer&&(i?!!s&&s(this.data):!!this.group)}e!==this.__hasChildren&&(this.__hasChildren=!!e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(P.EVENT_HAS_CHILDREN_CHANGED)))}hasChildren(){return this.__hasChildren==null&&this.updateHasChildren(),this.__hasChildren}isEmptyRowGroupNode(){return this.group&&Ve(this.childrenAfterGroup)}dispatchCellChangedEvent(e,t,i){const s={type:P.EVENT_CELL_CHANGED,node:this,column:e,newValue:t,oldValue:i};this.dispatchLocalEvent(s)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return!!(this.hasChildren()&&!this.footer||this.master)}isSelected(){return this.footer?this.sibling.isSelected():this.selected}depthFirstSearch(e){this.childrenAfterGroup&&this.childrenAfterGroup.forEach(t=>t.depthFirstSearch(e)),e(this)}calculateSelectedFromChildren(){var e;let t=!1,i=!1,s=!1;if(!(!((e=this.childrenAfterGroup)===null||e===void 0)&&e.length))return this.selectable?this.selected:null;for(let o=0;o<this.childrenAfterGroup.length;o++){const n=this.childrenAfterGroup[o];let r=n.isSelected();if(!n.selectable){const a=n.calculateSelectedFromChildren();if(a===null)continue;r=a}switch(r){case!0:t=!0;break;case!1:i=!0;break;default:s=!0;break}}if(!(s||t&&i))return t?!0:i?!1:this.selectable?this.selected:null}setSelectedInitialValue(e){this.selected=e}selectThisNode(e,t,i="api"){const s=!this.selectable&&e,o=this.selected===e;if(s||o)return!1;this.selected=e,this.eventService&&this.dispatchLocalEvent(this.createLocalRowEvent(P.EVENT_ROW_SELECTED));const n=Object.assign(Object.assign({},this.createGlobalRowEvent(u.EVENT_ROW_SELECTED)),{event:t||null,source:i});return this.beans.eventService.dispatchEvent(n),!0}setSelected(e,t=!1,i="api"){if(typeof i=="boolean"){console.warn("AG Grid: since version v30, rowNode.setSelected() property `suppressFinishActions` has been removed, please use `gridApi.setNodesSelected()` for bulk actions, and the event `source` property for ignoring events instead.");return}this.setSelectedParams({newValue:e,clearSelection:t,rangeSelect:!1,source:i})}setSelectedParams(e){return this.rowPinned?(console.warn("AG Grid: cannot select pinned rows"),0):this.id===void 0?(console.warn("AG Grid: cannot select node until id for node is known"),0):this.beans.selectionService.setNodesSelected(Object.assign(Object.assign({},e),{nodes:[this.footer?this.sibling:this]}))}isRowPinned(){return this.rowPinned==="top"||this.rowPinned==="bottom"}isParentOfNode(e){let t=this.parent;for(;t;){if(t===e)return!0;t=t.parent}return!1}addEventListener(e,t){this.eventService||(this.eventService=new gt),this.eventService.addEventListener(e,t)}removeEventListener(e,t){this.eventService&&(this.eventService.removeEventListener(e,t),this.eventService.noRegisteredListenersExist()&&(this.eventService=null))}onMouseEnter(){this.dispatchLocalEvent(this.createLocalRowEvent(P.EVENT_MOUSE_ENTER))}onMouseLeave(){this.dispatchLocalEvent(this.createLocalRowEvent(P.EVENT_MOUSE_LEAVE))}getFirstChildOfFirstChild(e){let t=this,i=!0,s=!1,o=null;for(;i&&!s;){const n=t.parent;R(n)&&t.firstChild?n.rowGroupColumn===e&&(s=!0,o=n):i=!1,t=n}return s?o:null}isFullWidthCell(){const e=this.beans.gridOptionsService.getCallback("isFullWidthRow");return e?e({rowNode:this}):!1}getRoute(){if(this.key==null)return;const e=[];let t=this;for(;t.key!=null;)e.push(t.key),t=t.parent;return e.reverse()}createFooter(){if(this.sibling)return;const e=new P(this.beans);Object.keys(this).forEach(t=>{e[t]=this[t]}),e.footer=!0,e.setRowTop(null),e.setRowIndex(null),e.oldRowTop=null,e.id="rowGroupFooter_"+this.id,e.sibling=this,this.sibling=e}}P.ID_PREFIX_ROW_GROUP="row-group-",P.ID_PREFIX_TOP_PINNED="t-",P.ID_PREFIX_BOTTOM_PINNED="b-",P.OBJECT_ID_SEQUENCE=0,P.EVENT_ROW_SELECTED="rowSelected",P.EVENT_DATA_CHANGED="dataChanged",P.EVENT_CELL_CHANGED="cellChanged",P.EVENT_ALL_CHILDREN_COUNT_CHANGED="allChildrenCountChanged",P.EVENT_MASTER_CHANGED="masterChanged",P.EVENT_GROUP_CHANGED="groupChanged",P.EVENT_MOUSE_ENTER="mouseEnter",P.EVENT_MOUSE_LEAVE="mouseLeave",P.EVENT_HEIGHT_CHANGED="heightChanged",P.EVENT_TOP_CHANGED="topChanged",P.EVENT_DISPLAYED_CHANGED="displayedChanged",P.EVENT_FIRST_CHILD_CHANGED="firstChildChanged",P.EVENT_LAST_CHILD_CHANGED="lastChildChanged",P.EVENT_CHILD_INDEX_CHANGED="childIndexChanged",P.EVENT_ROW_INDEX_CHANGED="rowIndexChanged",P.EVENT_EXPANDED_CHANGED="expandedChanged",P.EVENT_HAS_CHILDREN_CHANGED="hasChildrenChanged",P.EVENT_SELECTABLE_CHANGED="selectableChanged",P.EVENT_UI_LEVEL_CHANGED="uiLevelChanged",P.EVENT_HIGHLIGHT_CHANGED="rowHighlightChanged",P.EVENT_DRAGGING_CHANGED="draggingChanged";var ec=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class In extends V{constructor(){super(`
<div class="ag-selection-checkbox" role="presentation">
<ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>
</div>`)}postConstruct(){this.eCheckbox.setPassive(!0),ad(this.eCheckbox.getInputElement(),"polite")}getCheckboxId(){return this.eCheckbox.getInputElement().id}onDataChanged(){this.onSelectionChanged()}onSelectableChanged(){this.showOrHideSelect()}onSelectionChanged(){const e=this.localeService.getLocaleTextFunc(),t=this.rowNode.isSelected(),i=Sn(e,t),s=e("ariaRowToggleSelection","Press Space to toggle row selection");this.eCheckbox.setValue(t,!0),this.eCheckbox.setInputAriaLabel(`${s} (${i})`)}onClicked(e,t,i){return this.rowNode.setSelectedParams({newValue:e,rangeSelect:i.shiftKey,groupSelectsFiltered:t,event:i,source:"checkboxSelected"})}init(e){if(this.rowNode=e.rowNode,this.column=e.column,this.overrides=e.overrides,this.onSelectionChanged(),this.addManagedListener(this.eCheckbox.getInputElement(),"dblclick",s=>{qt(s)}),this.addManagedListener(this.eCheckbox.getInputElement(),"click",s=>{qt(s);const o=this.gridOptionsService.is("groupSelectsFiltered"),n=this.eCheckbox.getValue();this.shouldHandleIndeterminateState(n,o)?this.onClicked(!0,o,s||{})===0&&this.onClicked(!1,o,s):n?this.onClicked(!1,o,s):this.onClicked(!0,o,s||{})}),this.addManagedListener(this.rowNode,P.EVENT_ROW_SELECTED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.rowNode,P.EVENT_DATA_CHANGED,this.onDataChanged.bind(this)),this.addManagedListener(this.rowNode,P.EVENT_SELECTABLE_CHANGED,this.onSelectableChanged.bind(this)),this.gridOptionsService.get("isRowSelectable")||typeof this.getIsVisible()=="function"){const s=this.showOrHideSelect.bind(this);this.addManagedListener(this.eventService,u.EVENT_DISPLAYED_COLUMNS_CHANGED,s),this.addManagedListener(this.rowNode,P.EVENT_DATA_CHANGED,s),this.addManagedListener(this.rowNode,P.EVENT_CELL_CHANGED,s),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")}shouldHandleIndeterminateState(e,t){return t&&(this.eCheckbox.getPreviousValue()===void 0||e===void 0)&&this.gridOptionsService.isRowModelType("clientSide")}showOrHideSelect(){var e,t,i,s;let o=this.rowNode.selectable;const n=this.getIsVisible();if(o)if(typeof n=="function"){const a=(e=this.overrides)===null||e===void 0?void 0:e.callbackParams,d=(t=this.column)===null||t===void 0?void 0:t.createColumnFunctionCallbackParams(this.rowNode);o=d?n(Object.assign(Object.assign({},a),d)):!1}else o=n??!1;if((i=this.column)===null||i===void 0?void 0:i.getColDef().showDisabledCheckboxes){this.eCheckbox.setDisabled(!o),this.setVisible(!0),this.setDisplayed(!0);return}if(!((s=this.overrides)===null||s===void 0)&&s.removeHidden){this.setDisplayed(o);return}this.setVisible(o)}getIsVisible(){var e,t;return this.overrides?this.overrides.isVisible:(t=(e=this.column)===null||e===void 0?void 0:e.getColDef())===null||t===void 0?void 0:t.checkboxSelection}}ec([O("eCheckbox")],In.prototype,"eCheckbox",void 0),ec([D],In.prototype,"postConstruct",null);var Bi=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},ze,Oe;(function(l){l[l.ToolPanel=0]="ToolPanel",l[l.HeaderCell=1]="HeaderCell",l[l.RowDrag=2]="RowDrag",l[l.ChartPanel=3]="ChartPanel"})(Oe||(Oe={}));var fs;(function(l){l[l.Up=0]="Up",l[l.Down=1]="Down"})(fs||(fs={}));var _t;(function(l){l[l.Left=0]="Left",l[l.Right=1]="Right"})(_t||(_t={}));let q=ze=class extends T{constructor(){super(...arguments),this.dragSourceAndParamsList=[],this.dropTargets=[]}init(){this.ePinnedIcon=nt("columnMovePin",this.gridOptionsService,null),this.eHideIcon=nt("columnMoveHide",this.gridOptionsService,null),this.eMoveIcon=nt("columnMoveMove",this.gridOptionsService,null),this.eLeftIcon=nt("columnMoveLeft",this.gridOptionsService,null),this.eRightIcon=nt("columnMoveRight",this.gridOptionsService,null),this.eGroupIcon=nt("columnMoveGroup",this.gridOptionsService,null),this.eAggregateIcon=nt("columnMoveValue",this.gridOptionsService,null),this.ePivotIcon=nt("columnMovePivot",this.gridOptionsService,null),this.eDropNotAllowedIcon=nt("dropNotAllowed",this.gridOptionsService,null)}addDragSource(e,t=!1){const i={eElement:e.eElement,dragStartPixels:e.dragStartPixels,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),includeTouch:t};this.dragSourceAndParamsList.push({params:i,dragSource:e}),this.dragService.addDragSource(i)}removeDragSource(e){const t=this.dragSourceAndParamsList.find(i=>i.dragSource===e);t&&(this.dragService.removeDragSource(t.params),ve(this.dragSourceAndParamsList,t))}clearDragSourceParamsList(){this.dragSourceAndParamsList.forEach(e=>this.dragService.removeDragSource(e.params)),this.dragSourceAndParamsList.length=0,this.dropTargets.length=0}nudge(){this.dragging&&this.onDragging(this.eventLastTime,!0)}onDragStart(e,t){this.dragging=!0,this.dragSource=e,this.eventLastTime=t,this.dragItem=this.dragSource.getDragItem(),this.lastDropTarget=this.dragSource.dragSourceDropTarget,this.dragSource.onDragStarted&&this.dragSource.onDragStarted(),this.createGhost()}onDragStop(e){if(this.eventLastTime=null,this.dragging=!1,this.dragSource.onDragStopped&&this.dragSource.onDragStopped(),this.lastDropTarget&&this.lastDropTarget.onDragStop){const t=this.createDropTargetEvent(this.lastDropTarget,e,null,null,!1);this.lastDropTarget.onDragStop(t)}this.lastDropTarget=null,this.dragItem=null,this.removeGhost()}onDragging(e,t){var i,s,o,n;const r=this.getHorizontalDirection(e),a=this.getVerticalDirection(e);this.eventLastTime=e,this.positionGhost(e);const d=this.dropTargets.filter(h=>this.isMouseOnDropTarget(e,h)),c=this.findCurrentDropTarget(e,d);if(c!==this.lastDropTarget)this.leaveLastTargetIfExists(e,r,a,t),this.lastDropTarget!==null&&c===null&&((s=(i=this.dragSource).onGridExit)===null||s===void 0||s.call(i,this.dragItem)),this.lastDropTarget===null&&c!==null&&((n=(o=this.dragSource).onGridEnter)===null||n===void 0||n.call(o,this.dragItem)),this.enterDragTargetIfExists(c,e,r,a,t),this.lastDropTarget=c;else if(c&&c.onDragging){const h=this.createDropTargetEvent(c,e,r,a,t);c.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 s=i.getBoundingClientRect();if(s.width===0||s.height===0)return!1;const o=e.clientX>=s.left&&e.clientX<s.right,n=e.clientY>=s.top&&e.clientY<s.bottom;if(!o||!n)return!1}return!0}isMouseOnDropTarget(e,t){const i=this.getAllContainersFromDropTarget(t);let s=!1;for(const o of i)if(this.allContainersIntersect(e,o)){s=!0;break}return t.targetContainsSource&&!t.getContainer().contains(this.dragSource.eElement)?!1:s&&t.isInterestedIn(this.dragSource.type,this.dragSource.eElement)}findCurrentDropTarget(e,t){const i=t.length;if(i===0)return null;if(i===1)return t[0];const o=this.gridOptionsService.getRootNode().elementsFromPoint(e.clientX,e.clientY);for(const n of o)for(const r of t)if(za(this.getAllContainersFromDropTarget(r)).indexOf(n)!==-1)return r;return null}enterDragTargetIfExists(e,t,i,s,o){if(e){if(e.onDragEnter){const n=this.createDropTargetEvent(e,t,i,s,o);e.onDragEnter(n)}this.setGhostIcon(e.getIconName?e.getIconName():null)}}leaveLastTargetIfExists(e,t,i,s){if(this.lastDropTarget){if(this.lastDropTarget.onDragLeave){const o=this.createDropTargetEvent(this.lastDropTarget,e,t,i,s);this.lastDropTarget.onDragLeave(o)}this.setGhostIcon(null)}}addDropTarget(e){this.dropTargets.push(e)}removeDropTarget(e){this.dropTargets=this.dropTargets.filter(t=>t.getContainer()!==e.getContainer())}hasExternalDropZones(){return this.dropTargets.some(e=>e.external)}findExternalZone(e){return this.dropTargets.filter(i=>i.external).find(i=>i.getContainer()===e.getContainer())||null}getHorizontalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientX,i=e.clientX;return t===i?null:t>i?_t.Left:_t.Right}getVerticalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientY,i=e.clientY;return t===i?null:t>i?fs.Up:fs.Down}createDropTargetEvent(e,t,i,s,o){const n=e.getContainer(),r=n.getBoundingClientRect(),{gridApi:a,columnApi:d,dragItem:c,dragSource:h}=this,g=t.clientX-r.left,f=t.clientY-r.top;return{event:t,x:g,y:f,vDirection:s,hDirection:i,dragSource:h,fromNudge:o,dragItem:c,api:a,columnApi:d,dropZoneTarget:n}}positionGhost(e){const t=this.eGhost;if(!t)return;const s=t.getBoundingClientRect().height,o=wd()-2,n=Sd()-2,r=dl(t.offsetParent),{clientY:a,clientX:d}=e;let c=a-r.top-s/2,h=d-r.left-10;const g=this.gridOptionsService.getDocument(),f=g.defaultView||window,m=f.pageYOffset||g.documentElement.scrollTop,C=f.pageXOffset||g.documentElement.scrollLeft;o>0&&h+t.clientWidth>o+C&&(h=o+C-t.clientWidth),h<0&&(h=0),n>0&&c+t.clientHeight>n+m&&(c=n+m-t.clientHeight),c<0&&(c=0),t.style.left=`${h}px`,t.style.top=`${c}px`}removeGhost(){this.eGhost&&this.eGhostParent&&this.eGhostParent.removeChild(this.eGhost),this.eGhost=null}createGhost(){this.eGhost=fe(ze.GHOST_TEMPLATE),this.mouseEventService.stampTopLevelGridCompWithGridInstance(this.eGhost);const{theme:e}=this.environment.getTheme();e&&this.eGhost.classList.add(e),this.eGhostIcon=this.eGhost.querySelector(".ag-dnd-ghost-icon"),this.setGhostIcon(null);const t=this.eGhost.querySelector(".ag-dnd-ghost-label");let i=this.dragSource.dragItemName;cn(i)&&(i=i()),t.innerHTML=It(i)||"",this.eGhost.style.height="25px",this.eGhost.style.top="20px",this.eGhost.style.left="20px";const s=this.gridOptionsService.getDocument();let o=null;try{o=s.fullscreenElement}catch{}finally{if(!o){const n=this.gridOptionsService.getRootNode(),r=n.querySelector("body");r?o=r:n instanceof ShadowRoot?o=n:o=n==null?void 0:n.documentElement}}this.eGhostParent=o,this.eGhostParent?this.eGhostParent.appendChild(this.eGhost):console.warn("AG Grid: could not find document body, it is needed for dragging columns")}setGhostIcon(e,t=!1){We(this.eGhostIcon);let i=null;switch(e||(e=this.dragSource.defaultIconName||ze.ICON_NOT_ALLOWED),e){case ze.ICON_PINNED:i=this.ePinnedIcon;break;case ze.ICON_MOVE:i=this.eMoveIcon;break;case ze.ICON_LEFT:i=this.eLeftIcon;break;case ze.ICON_RIGHT:i=this.eRightIcon;break;case ze.ICON_GROUP:i=this.eGroupIcon;break;case ze.ICON_AGGREGATE:i=this.eAggregateIcon;break;case ze.ICON_PIVOT:i=this.ePivotIcon;break;case ze.ICON_NOT_ALLOWED:i=this.eDropNotAllowedIcon;break;case ze.ICON_HIDE:i=this.eHideIcon;break}this.eGhostIcon.classList.toggle("ag-shake-left-to-right",t),!(i===this.eHideIcon&&this.gridOptionsService.is("suppressDragLeaveHidesColumns"))&&i&&this.eGhostIcon.appendChild(i)}};q.ICON_PINNED="pinned",q.ICON_MOVE="move",q.ICON_LEFT="left",q.ICON_RIGHT="right",q.ICON_GROUP="group",q.ICON_AGGREGATE="aggregate",q.ICON_PIVOT="pivot",q.ICON_NOT_ALLOWED="notAllowed",q.ICON_HIDE="hide",q.GHOST_TEMPLATE=`<div class="ag-dnd-ghost ag-unselectable">
<span class="ag-dnd-ghost-icon ag-shake-left-to-right"></span>
<div class="ag-dnd-ghost-label"></div>
</div>`,Bi([p("dragService")],q.prototype,"dragService",void 0),Bi([p("mouseEventService")],q.prototype,"mouseEventService",void 0),Bi([p("columnApi")],q.prototype,"columnApi",void 0),Bi([p("gridApi")],q.prototype,"gridApi",void 0),Bi([D],q.prototype,"init",null),Bi([he],q.prototype,"clearDragSourceParamsList",null),q=ze=Bi([M("dragAndDropService")],q);var ao=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Wi extends V{constructor(e,t,i,s,o,n){super(),this.cellValueFn=e,this.rowNode=t,this.column=i,this.customGui=s,this.dragStartPixels=o,this.suppressVisibilityChange=n,this.dragSource=null}isCustomGui(){return 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(le("rowDrag",this.gridOptionsService,null)),this.addDragSource()),this.checkCompatibility(),!this.suppressVisibilityChange){const e=this.gridOptionsService.is("rowDragManaged")?new sc(this,this.beans,this.rowNode,this.column):new ic(this,this.beans,this.rowNode,this.column);this.createManagedBean(e,this.beans.context)}}setDragElement(e,t){this.setTemplateFromElement(e),this.addDragSource(t)}getSelectedNodes(){if(!this.gridOptionsService.is("rowDragMultiRow"))return[this.rowNode];const t=this.beans.selectionService.getSelectedNodes();return t.indexOf(this.rowNode)!==-1?t:[this.rowNode]}checkCompatibility(){const e=this.gridOptionsService.is("rowDragManaged");this.gridOptionsService.isTreeData()&&e&&Y(()=>console.warn("AG Grid: If using row drag with tree data, you cannot have rowDragManaged=true"),"RowDragComp.managedAndTreeData")}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.gridOptionsService.get("rowDragText")}addDragSource(e=4){this.dragSource&&this.removeDragSource();const t=this.getRowDragText(this.column),i=this.localeService.getLocaleTextFunc();this.dragSource={type:Oe.RowDrag,eElement:this.getGui(),dragItemName:()=>{var s;const o=this.getDragItem(),n=((s=o.rowNodes)===null||s===void 0?void 0:s.length)||1;return t?t(o,n):n===1?this.cellValueFn():`${n} ${i("rowDragRows","rows")}`},getDragItem:()=>this.getDragItem(),dragStartPixels:e,dragSourceDomDataKey:this.gridOptionsService.getDomDataKey()},this.beans.dragAndDropService.addDragSource(this.dragSource,!0)}removeDragSource(){this.dragSource&&this.beans.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null}}ao([p("beans")],Wi.prototype,"beans",void 0),ao([D],Wi.prototype,"postConstruct",null),ao([he],Wi.prototype,"removeDragSource",null);class tc extends T{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=cn(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))}}}class ic extends tc{constructor(e,t,i,s){super(e,i,s),this.beans=t}postConstruct(){this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.addManagedListener(this.rowNode,P.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,P.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,P.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,u.EVENT_NEW_COLUMNS_LOADED,this.workOutVisibility.bind(this)),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const e=this.gridOptionsService.is("suppressRowDrag");this.setDisplayedOrVisible(e)}}ao([D],ic.prototype,"postConstruct",null);class sc extends tc{constructor(e,t,i,s){super(e,i,s),this.beans=t}postConstruct(){this.addManagedListener(this.beans.eventService,u.EVENT_SORT_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,u.EVENT_FILTER_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,u.EVENT_COLUMN_ROW_GROUP_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,u.EVENT_NEW_COLUMNS_LOADED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,P.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,P.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),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.gridOptionsService.is("suppressRowDrag"),o=this.beans.dragAndDropService.hasExternalDropZones(),n=i&&!o||s;this.setDisplayedOrVisible(n)}}ao([D],sc.prototype,"postConstruct",null);var co=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Cs extends T{init(e,t,i,s,o,n,r){this.params=r,this.eGui=t,this.eCheckbox=i,this.eExpanded=s,this.eContracted=o,this.comp=e,this.compClass=n;const a=this.isTopLevelFooter(),d=this.isEmbeddedRowMismatch(),c=r.value==null&&!r.node.master;let h=!1;if(this.gridOptionsService.is("groupIncludeFooter")&&this.gridOptionsService.is("groupHideOpenParents")){const g=r.node;if(g.footer){const f=r.colDef&&r.colDef.showRowGroup,m=g.rowGroupColumn&&g.rowGroupColumn.getColId();h=f!==m}}this.cellIsBlank=a?!1:d||c&&!r.node.master||h,!this.cellIsBlank&&(this.setupShowingValueForOpenedParent(),this.findDisplayedGroupNode(),this.addFullWidthRowDraggerIfNeeded(),this.addExpandAndContract(),this.addCheckboxIfNeeded(),this.addValueElement(),this.setupIndent(),this.refreshAriaExpanded())}destroy(){super.destroy(),this.expandListener=null}refreshAriaExpanded(){const{node:e,eParentOfValue:t}=this.params;if(this.expandListener&&(this.expandListener=this.expandListener()),!this.isExpandable()){cd(t);return}const i=()=>{ft(t,!!e.expanded)};this.expandListener=this.addManagedListener(e,P.EVENT_EXPANDED_CHANGED,i)||null,i()}isTopLevelFooter(){if(!this.gridOptionsService.is("groupIncludeTotalFooter")||this.params.value!=null||this.params.node.level!=-1)return!1;const e=this.params.colDef;if(e==null||e.showRowGroup===!0)return!0;const i=this.columnModel.getRowGroupColumns();return!i||i.length===0?!0:i[0].getId()===e.showRowGroup}isEmbeddedRowMismatch(){if(!this.params.fullWidth||!this.gridOptionsService.is("embedFullWidthRows"))return!1;const e=this.params.pinned==="left",t=this.params.pinned==="right",i=!e&&!t;return this.gridOptionsService.is("enableRtl")?this.columnModel.isPinningLeft()?!t:!i:this.columnModel.isPinningLeft()?!e:!i}findDisplayedGroupNode(){const e=this.params.column,t=this.params.node;if(this.showingValueForOpenedParent){let i=t.parent;for(;i!=null;){if(i.rowGroupColumn&&e.isRowGroupDisplayed(i.rowGroupColumn.getId())){this.displayedGroupNode=i;break}i=i.parent}}x(this.displayedGroupNode)&&(this.displayedGroupNode=t)}setupShowingValueForOpenedParent(){const e=this.params.node,t=this.params.column;if(!this.gridOptionsService.is("groupHideOpenParents")){this.showingValueForOpenedParent=!1;return}if(!e.groupData){this.showingValueForOpenedParent=!1;return}if(e.rowGroupColumn!=null){const o=e.rowGroupColumn.getId();if(t.isRowGroupDisplayed(o)){this.showingValueForOpenedParent=!1;return}}const s=e.groupData[t.getId()]!=null;this.showingValueForOpenedParent=s}addValueElement(){this.displayedGroupNode.footer?this.addFooterValue():(this.addGroupValue(),this.addChildCount())}addGroupValue(){const e=this.adjustParamsWithDetailsFromRelatedColumn(),t=this.getInnerCompDetails(e),{valueFormatted:i,value:s}=e;let o=i;o==null&&(s===""&&this.params.node.group?o=this.localeService.getLocaleTextFunc()("blanks","(Blanks)"):o=s??null),this.comp.setInnerRenderer(t,o)}adjustParamsWithDetailsFromRelatedColumn(){const e=this.displayedGroupNode.rowGroupColumn,t=this.params.column;if(!e)return this.params;if(t!=null&&!t.isRowGroupDisplayed(e.getId()))return this.params;const s=this.params,{value:o,node:n}=this.params,r=this.valueFormatterService.formatValue(e,n,o);return Object.assign(Object.assign({},s),{valueFormatted:r})}addFooterValue(){const e=this.params.footerValueGetter;let t="";if(e){const s=Tr(this.params);s.value=this.params.value,typeof e=="function"?t=e(s):typeof e=="string"?t=this.expressionService.evaluate(e,s):console.warn("AG Grid: footerValueGetter should be either a function or a string (expression)")}else t="Total "+(this.params.value!=null?this.params.value:"");const i=this.getInnerCompDetails(this.params);this.comp.setInnerRenderer(i,t)}getInnerCompDetails(e){if(e.fullWidth)return this.userComponentFactory.getFullWidthGroupRowInnerCellRenderer(this.gridOptionsService.get("groupRowRendererParams"),e);const t=this.userComponentFactory.getInnerRendererDetails(e,e),i=r=>r&&r.componentClass==this.compClass;if(t&&!i(t))return t;const s=this.displayedGroupNode.rowGroupColumn,o=s?s.getColDef():void 0;if(!o)return;const n=this.userComponentFactory.getCellRendererDetails(o,e);if(n&&!i(n))return n;if(i(n)&&o.cellRendererParams&&o.cellRendererParams.innerRenderer)return this.userComponentFactory.getInnerRendererDetails(o.cellRendererParams,e)}addChildCount(){this.params.suppressCount||(this.addManagedListener(this.displayedGroupNode,P.EVENT_ALL_CHILDREN_COUNT_CHANGED,this.updateChildCount.bind(this)),this.updateChildCount())}updateChildCount(){const e=this.displayedGroupNode.allChildrenCount,s=this.isShowRowGroupForThisRow()&&e!=null&&e>=0?`(${e})`:"";this.comp.setChildCount(s)}isShowRowGroupForThisRow(){if(this.gridOptionsService.isTreeData())return!0;const e=this.displayedGroupNode.rowGroupColumn;if(!e)return!1;const t=this.params.column;return t==null||t.isRowGroupDisplayed(e.getId())}addExpandAndContract(){var e;const t=this.params,i=le("groupExpanded",this.gridOptionsService,null),s=le("groupContracted",this.gridOptionsService,null);i&&this.eExpanded.appendChild(i),s&&this.eContracted.appendChild(s);const o=t.eGridCell;!(((e=this.params.column)===null||e===void 0?void 0:e.isCellEditable(t.node))&&this.gridOptionsService.is("enableGroupEdit"))&&this.isExpandable()&&!t.suppressDoubleClickExpand&&this.addManagedListener(o,"dblclick",this.onCellDblClicked.bind(this)),this.addManagedListener(this.eExpanded,"click",this.onExpandClicked.bind(this)),this.addManagedListener(this.eContracted,"click",this.onExpandClicked.bind(this)),this.addManagedListener(o,"keydown",this.onKeyDown.bind(this)),this.addManagedListener(t.node,P.EVENT_EXPANDED_CHANGED,this.showExpandAndContractIcons.bind(this)),this.showExpandAndContractIcons();const r=this.onRowNodeIsExpandableChanged.bind(this);this.addManagedListener(this.displayedGroupNode,P.EVENT_ALL_CHILDREN_COUNT_CHANGED,r),this.addManagedListener(this.displayedGroupNode,P.EVENT_MASTER_CHANGED,r),this.addManagedListener(this.displayedGroupNode,P.EVENT_GROUP_CHANGED,r),this.addManagedListener(this.displayedGroupNode,P.EVENT_HAS_CHILDREN_CHANGED,r)}onExpandClicked(e){Lt(e)||(qt(e),this.onExpandOrContract(e))}onExpandOrContract(e){const t=this.displayedGroupNode,i=!t.expanded;!i&&t.sticky&&this.scrollToStickyNode(t),t.setExpanded(i,e)}scrollToStickyNode(e){this.ctrlsService.getGridBodyCtrl().getScrollFeature().setVerticalScrollPosition(e.rowTop-e.stickyRowTop)}isExpandable(){if(this.showingValueForOpenedParent)return!0;const e=this.displayedGroupNode,t=this.columnModel.isPivotMode()&&e.leafGroup;if(!(e.isExpandable()&&!e.footer&&!t))return!1;const s=this.params.column;return s!=null&&typeof s.getColDef().showRowGroup=="string"?this.isShowRowGroupForThisRow():!0}showExpandAndContractIcons(){const{params:e,displayedGroupNode:t,columnModel:i}=this,{node:s}=e,o=this.isExpandable();if(o){const c=this.showingValueForOpenedParent?!0:s.expanded;this.comp.setExpandedDisplayed(c),this.comp.setContractedDisplayed(!c)}else this.comp.setExpandedDisplayed(!1),this.comp.setContractedDisplayed(!1);const n=i.isPivotMode(),r=n&&t.leafGroup,a=o&&!r,d=s.footer&&s.level===-1;this.comp.addOrRemoveCssClass("ag-cell-expandable",a),this.comp.addOrRemoveCssClass("ag-row-group",a),n?this.comp.addOrRemoveCssClass("ag-pivot-leaf-group",r):d||this.comp.addOrRemoveCssClass("ag-row-group-leaf-indent",!a)}onRowNodeIsExpandableChanged(){this.showExpandAndContractIcons(),this.setIndent(),this.refreshAriaExpanded()}setupIndent(){const e=this.params.node;this.params.suppressPadding||(this.addManagedListener(e,P.EVENT_UI_LEVEL_CHANGED,this.setIndent.bind(this)),this.setIndent())}setIndent(){if(this.gridOptionsService.is("groupHideOpenParents"))return;const e=this.params,t=e.node,i=!!e.colDef,s=this.gridOptionsService.isTreeData(),n=!i||s||e.colDef.showRowGroup===!0?t.uiLevel:0;this.indentClass&&this.comp.addOrRemoveCssClass(this.indentClass,!1),this.indentClass="ag-row-group-indent-"+n,this.comp.addOrRemoveCssClass(this.indentClass,!0)}addFullWidthRowDraggerIfNeeded(){if(!this.params.fullWidth||!this.params.rowDrag)return;const e=new Wi(()=>this.params.value,this.params.node);this.createManagedBean(e,this.context),this.eGui.insertAdjacentElement("afterbegin",e.getGui())}isUserWantsSelected(){const e=this.params.checkbox;return typeof e=="function"||e===!0}addCheckboxIfNeeded(){const e=this.displayedGroupNode,t=this.isUserWantsSelected()&&!e.footer&&!e.rowPinned&&!e.detail;if(t){const i=new In;this.getContext().createBean(i),i.init({rowNode:e,column:this.params.column,overrides:{isVisible:this.params.checkbox,callbackParams:this.params,removeHidden:!0}}),this.eCheckbox.appendChild(i.getGui()),this.addDestroyFunc(()=>this.getContext().destroyBean(i))}this.comp.setCheckboxVisible(t)}onKeyDown(e){!(e.key===w.ENTER)||this.params.suppressEnterExpand||this.params.column&&this.params.column.isCellEditable(this.params.node)||this.onExpandOrContract(e)}onCellDblClicked(e){if(Lt(e))return;gn(this.eExpanded,e)||gn(this.eContracted,e)||this.onExpandOrContract(e)}}co([p("expressionService")],Cs.prototype,"expressionService",void 0),co([p("valueFormatterService")],Cs.prototype,"valueFormatterService",void 0),co([p("columnModel")],Cs.prototype,"columnModel",void 0),co([p("userComponentFactory")],Cs.prototype,"userComponentFactory",void 0),co([p("ctrlsService")],Cs.prototype,"ctrlsService",void 0);var uo=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class xt extends V{constructor(){super(xt.TEMPLATE)}init(e){const t={setInnerRenderer:(n,r)=>this.setRenderDetails(n,r),setChildCount:n=>this.eChildCount.innerHTML=n,addOrRemoveCssClass:(n,r)=>this.addOrRemoveCssClass(n,r),setContractedDisplayed:n=>z(this.eContracted,n),setExpandedDisplayed:n=>z(this.eExpanded,n),setCheckboxVisible:n=>this.eCheckbox.classList.toggle("ag-invisible",!n)},i=this.createManagedBean(new Cs),s=!e.colDef,o=this.getGui();i.init(t,o,this.eCheckbox,this.eExpanded,this.eContracted,this.constructor,e),s&&pe(o,"gridcell")}setRenderDetails(e,t){if(e){const i=e.newAgStackInstance();if(!i)return;i.then(s=>{if(!s)return;const o=()=>this.context.destroyBean(s);this.isAlive()?(this.eValue.appendChild(s.getGui()),this.addDestroyFunc(o)):o()})}else this.eValue.innerText=t}destroy(){this.getContext().destroyBean(this.innerCellRenderer),super.destroy()}refresh(){return!1}}xt.TEMPLATE=`<span class="ag-cell-wrapper">
<span class="ag-group-expanded" ref="eExpanded"></span>
<span class="ag-group-contracted" ref="eContracted"></span>
<span class="ag-group-checkbox ag-invisible" ref="eCheckbox"></span>
<span class="ag-group-value" ref="eValue"></span>
<span class="ag-group-child-count" ref="eChildCount"></span>
</span>`,uo([O("eExpanded")],xt.prototype,"eExpanded",void 0),uo([O("eContracted")],xt.prototype,"eContracted",void 0),uo([O("eCheckbox")],xt.prototype,"eCheckbox",void 0),uo([O("eValue")],xt.prototype,"eValue",void 0),uo([O("eChildCount")],xt.prototype,"eChildCount",void 0);var oc=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class ms extends V{constructor(){super(ms.TEMPLATE)}init(e){e.node.failedLoad?this.setupFailed():this.setupLoading()}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=e("loadingError","ERR")}setupLoading(){const e=le("groupLoading",this.gridOptionsService,null);e&&this.eLoadingIcon.appendChild(e);const t=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=t("loadingOoo","Loading")}refresh(e){return!1}destroy(){super.destroy()}}ms.TEMPLATE=`<div class="ag-loading">
<span class="ag-loading-icon" ref="eLoadingIcon"></span>
<span class="ag-loading-text" ref="eLoadingText"></span>
</div>`,oc([O("eLoadingIcon")],ms.prototype,"eLoadingIcon",void 0),oc([O("eLoadingText")],ms.prototype,"eLoadingText",void 0);class Mn extends V{constructor(){super()}destroy(){super.destroy()}init(e){var t;const i=(t=this.gridOptionsService.get("overlayLoadingTemplate"))!==null&&t!==void 0?t:Mn.DEFAULT_LOADING_OVERLAY_TEMPLATE,s=this.localeService.getLocaleTextFunc(),o=i.replace("[LOADING...]",s("loadingOoo","Loading..."));this.setTemplate(o)}}Mn.DEFAULT_LOADING_OVERLAY_TEMPLATE='<span class="ag-overlay-loading-center">[LOADING...]</span>';class Nn extends V{constructor(){super()}destroy(){super.destroy()}init(e){var t;const i=(t=this.gridOptionsService.get("overlayNoRowsTemplate"))!==null&&t!==void 0?t:Nn.DEFAULT_NO_ROWS_TEMPLATE,s=this.localeService.getLocaleTextFunc(),o=i.replace("[NO_ROWS_TO_SHOW]",s("noRowsToShow","No Rows To Show"));this.setTemplate(o)}}Nn.DEFAULT_NO_ROWS_TEMPLATE='<span class="ag-overlay-no-rows-center">[NO_ROWS_TO_SHOW]</span>';class Qh extends gs{constructor(){super('<div class="ag-tooltip"></div>')}init(e){const{value:t}=e;this.getGui().innerHTML=It(t)}}class Xh{getTemplate(){return'<ag-input-number-field class="ag-cell-editor" ref="eInput"></ag-input-number-field>'}init(e,t){this.eInput=e,this.params=t,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),t.showStepperButtons&&e.getInputElement().classList.add("ag-number-field-input-stepper")}getValue(){const e=this.eInput.getValue();if(!R(e)&&!R(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}}class Jh extends no{constructor(){super(new Xh)}}class Zh{getTemplate(){return'<ag-input-date-field class="ag-cell-editor" ref="eInput"></ag-input-date-field>'}init(e,t){this.eInput=e,this.params=t,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!R(e)&&!R(this.params.value)?this.params.value:e??null}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return st(e,!1)}}class ep extends no{constructor(){super(new Zh)}}var tp=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class ip{constructor(e){this.getDataTypeService=e}getTemplate(){return'<ag-input-date-field class="ag-cell-editor" ref="eInput"></ag-input-date-field>'}init(e,t){this.eInput=e,this.params=t,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!R(e)&&!R(this.params.value)?this.params.value:this.params.parseValue(e??"")}getStartValue(){var e,t;return st((t=this.parseDate((e=this.params.value)!==null&&e!==void 0?e:void 0))!==null&&t!==void 0?t:null,!1)}parseDate(e){return this.getDataTypeService().getDateParserFunction()(e)}formatDate(e){return this.getDataTypeService().getDateFormatterFunction()(e)}}class nc extends no{constructor(){super(new ip(()=>this.dataTypeService))}}tp([p("dataTypeService")],nc.prototype,"dataTypeService",void 0);var sp=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class ho extends V{constructor(){super(ho.TEMPLATE)}init(e){this.params=e,this.updateCheckbox(e),this.eCheckbox.getInputElement().setAttribute("tabindex","-1"),this.addManagedListener(this.eCheckbox.getInputElement(),"click",i=>{if(qt(i),this.eCheckbox.isDisabled())return;const s=this.eCheckbox.getValue();this.onCheckboxChanged(s)}),this.addManagedListener(this.eCheckbox.getInputElement(),"dblclick",i=>{qt(i)});const t=this.gridOptionsService.getDocument();this.addManagedListener(this.params.eGridCell,"keydown",i=>{if(i.key===w.SPACE&&!this.eCheckbox.isDisabled()){this.params.eGridCell===t.activeElement&&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 t,i,s;let o,n=!0;if(e.node.group&&e.column){const h=e.column.getColId();h.startsWith(ns)?o=e.value==null||e.value===""?void 0:e.value==="true":e.node.aggData&&e.node.aggData[h]!==void 0?o=(t=e.value)!==null&&t!==void 0?t:void 0:n=!1}else o=(i=e.value)!==null&&i!==void 0?i:void 0;if(!n){this.eCheckbox.setDisplayed(!1);return}this.eCheckbox.setValue(o);const r=e.disabled!=null?e.disabled:!(!((s=e.column)===null||s===void 0)&&s.isCellEditable(e.node));this.eCheckbox.setDisabled(r);const a=this.localeService.getLocaleTextFunc(),d=Sn(a,o),c=r?d:`${a("ariaToggleCellValue","Press SPACE to toggle cell value")} (${d})`;this.eCheckbox.setInputAriaLabel(c)}onCheckboxChanged(e){const{column:t,node:i,rowIndex:s,value:o}=this.params,n={type:u.EVENT_CELL_EDITING_STARTED,column:t,colDef:t==null?void 0:t.getColDef(),data:i.data,node:i,rowIndex:s,rowPinned:i.rowPinned,value:o};this.eventService.dispatchEvent(n);const r=this.params.node.setDataValue(this.params.column,e,"edit"),a={type:u.EVENT_CELL_EDITING_STOPPED,column:t,colDef:t==null?void 0:t.getColDef(),data:i.data,node:i,rowIndex:s,rowPinned:i.rowPinned,value:o,oldValue:o,newValue:e,valueChanged:r};this.eventService.dispatchEvent(a)}}ho.TEMPLATE=`
<div class="ag-cell-wrapper ag-checkbox-cell" role="presentation">
<ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>
</div>`,sp([O("eCheckbox")],ho.prototype,"eCheckbox",void 0);var op=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class rc extends gs{constructor(){super(`
<div class="ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit">
<ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>
</div>`)}init(e){var t;this.params=e;const i=(t=e.value)!==null&&t!==void 0?t:void 0;this.eCheckbox.setValue(i),this.eCheckbox.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(i),this.addManagedListener(this.eCheckbox,gi.EVENT_CHANGED,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=Sn(t,e),s=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eCheckbox.setInputAriaLabel(`${s} (${i})`)}}op([O("eCheckbox")],rc.prototype,"eCheckbox",void 0);var Ml=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let po=class extends T{constructor(){super(...arguments),this.agGridDefaults={agDateInput:Kd,agColumnHeader:Ce,agColumnGroupHeader:Vi,agSortIndicator:Ue,agTextColumnFloatingFilter:kh,agNumberColumnFloatingFilter:Wh,agDateColumnFloatingFilter:Ln,agReadOnlyFloatingFilter:yl,agAnimateShowChangeCellRenderer:ro,agAnimateSlideCellRenderer:lo,agGroupCellRenderer:xt,agGroupRowRenderer:xt,agLoadingCellRenderer:ms,agCheckboxCellRenderer:ho,agCellEditor:Zd,agTextCellEditor:Zd,agNumberCellEditor:Jh,agDateCellEditor:ep,agDateStringCellEditor:nc,agSelectCellEditor:Il,agLargeTextCellEditor:oo,agCheckboxCellEditor:rc,agTextColumnFilter:ue,agNumberColumnFilter:io,agDateColumnFilter:ps,agLoadingOverlay:Mn,agNoRowsOverlay:Nn,agTooltipComponent:Qh},this.enterpriseAgDefaultCompsModule={agSetColumnFilter:N.SetFilterModule,agSetColumnFloatingFilter:N.SetFilterModule,agMultiColumnFilter:N.MultiFilterModule,agMultiColumnFloatingFilter:N.MultiFilterModule,agGroupColumnFilter:N.RowGroupingModule,agGroupColumnFloatingFilter:N.RowGroupingModule,agRichSelect:N.RichSelectModule,agRichSelectCellEditor:N.RichSelectModule,agDetailCellRenderer:N.MasterDetailModule,agSparklineCellRenderer:N.SparklinesModule},this.jsComps={}}init(){this.gridOptions.components!=null&&se(this.gridOptions.components,(e,t)=>this.registerJsComponent(e,t))}registerDefaultComponent(e,t){if(this.agGridDefaults[e]){console.error("Trying to overwrite a default component. You should call registerComponent");return}this.agGridDefaults[e]=t}registerJsComponent(e,t){this.jsComps[e]=t}retrieve(e,t){const i=(a,d)=>({componentFromFramework:d,component:a}),s=this.getFrameworkOverrides().frameworkComponent(t,this.gridOptions.components);if(s!=null)return i(s,!0);const o=this.jsComps[t];if(o){const a=this.getFrameworkOverrides().isFrameworkComponent(o);return i(o,a)}const n=this.agGridDefaults[t];if(n)return i(n,!1);const r=this.enterpriseAgDefaultCompsModule[t];return r?A.__assertRegistered(r,`AG Grid '${e}' component: ${t}`,this.context.getGridId()):Y(()=>{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=Gr(t,i,!0,.8);console.warn(`AG Grid: Could not find '${t}' component. It was configured as "${e}: '${t}'" but it wasn't found in the list of registered components.`),s.length>0&&console.warn(` Did you mean: [${s.slice(0,3)}]?`),console.warn("If using a custom component check it has been registered as described in: https://ag-grid.com/javascript-data-grid/components/")}};Ml([p("gridOptions")],po.prototype,"gridOptions",void 0),Ml([D],po.prototype,"init",null),po=Ml([M("userComponentRegistry")],po);const np={propertyName:"dateComponent",cellRenderer:!1},rp={propertyName:"headerComponent",cellRenderer:!1},lp={propertyName:"headerGroupComponent",cellRenderer:!1},lc={propertyName:"cellRenderer",cellRenderer:!0},ap={propertyName:"cellEditor",cellRenderer:!1},ac={propertyName:"innerRenderer",cellRenderer:!0},dp={propertyName:"loadingOverlayComponent",cellRenderer:!1},cp={propertyName:"noRowsOverlayComponent",cellRenderer:!1},up={propertyName:"tooltipComponent",cellRenderer:!1},Nl={propertyName:"filter",cellRenderer:!1},hp={propertyName:"floatingFilterComponent",cellRenderer:!1},pp={propertyName:"toolPanel",cellRenderer:!1},gp={propertyName:"statusPanel",cellRenderer:!1},fp={propertyName:"fullWidthCellRenderer",cellRenderer:!0},Cp={propertyName:"loadingCellRenderer",cellRenderer:!0},mp={propertyName:"groupRowRenderer",cellRenderer:!0},vp={propertyName:"detailCellRenderer",cellRenderer:!0};class dc{static getFloatingFilterType(e){return this.filterToFloatingFilterMapping[e]}}dc.filterToFloatingFilterMapping={set:"agSetColumnFloatingFilter",agSetColumnFilter:"agSetColumnFloatingFilter",multi:"agMultiColumnFloatingFilter",agMultiColumnFilter:"agMultiColumnFloatingFilter",group:"agGroupColumnFloatingFilter",agGroupColumnFilter:"agGroupColumnFloatingFilter",number:"agNumberColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",date:"agDateColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",text:"agTextColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"};var vs=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let fi=class extends T{getHeaderCompDetails(e,t){return this.getCompDetails(e,rp,"agColumnHeader",t)}getHeaderGroupCompDetails(e){const t=e.columnGroup.getColGroupDef();return this.getCompDetails(t,lp,"agColumnGroupHeader",e)}getFullWidthCellRendererDetails(e){return this.getCompDetails(this.gridOptions,fp,null,e,!0)}getFullWidthLoadingCellRendererDetails(e){return this.getCompDetails(this.gridOptions,Cp,"agLoadingCellRenderer",e,!0)}getFullWidthGroupCellRendererDetails(e){return this.getCompDetails(this.gridOptions,mp,"agGroupRowRenderer",e,!0)}getFullWidthDetailCellRendererDetails(e){return this.getCompDetails(this.gridOptions,vp,"agDetailCellRenderer",e,!0)}getInnerRendererDetails(e,t){return this.getCompDetails(e,ac,null,t)}getFullWidthGroupRowInnerCellRenderer(e,t){return this.getCompDetails(e,ac,null,t)}getCellRendererDetails(e,t){return this.getCompDetails(e,lc,null,t)}getCellEditorDetails(e,t){return this.getCompDetails(e,ap,"agCellEditor",t,!0)}getFilterDetails(e,t,i){return this.getCompDetails(e,Nl,i,t,!0)}getDateCompDetails(e){return this.getCompDetails(this.gridOptions,np,"agDateInput",e,!0)}getLoadingOverlayCompDetails(e){return this.getCompDetails(this.gridOptions,dp,"agLoadingOverlay",e,!0)}getNoRowsOverlayCompDetails(e){return this.getCompDetails(this.gridOptions,cp,"agNoRowsOverlay",e,!0)}getTooltipCompDetails(e){return this.getCompDetails(e.colDef,up,"agTooltipComponent",e,!0)}getSetFilterCellRendererDetails(e,t){return this.getCompDetails(e,lc,null,t)}getFloatingFilterCompDetails(e,t,i){return this.getCompDetails(e,hp,i,t)}getToolPanelCompDetails(e,t){return this.getCompDetails(e,pp,null,t,!0)}getStatusPanelCompDetails(e,t){return this.getCompDetails(e,gp,null,t,!0)}getCompDetails(e,t,i,s,o=!1){const{propertyName:n,cellRenderer:r}=t;let{compName:a,jsComp:d,fwComp:c,paramsFromSelector:h,popupFromSelector:g,popupPositionFromSelector:f}=this.getCompKeys(e,t,s);const m=E=>{const b=this.userComponentRegistry.retrieve(n,E);b&&(d=b.componentFromFramework?void 0:b.component,c=b.componentFromFramework?b.component:void 0)};if(a!=null&&m(a),d==null&&c==null&&i!=null&&m(i),d&&r&&!this.agComponentUtils.doesImplementIComponent(d)&&(d=this.agComponentUtils.adaptFunction(n,d)),!d&&!c){o&&console.error(`AG Grid: Could not find component ${a}, did you forget to configure this component?`);return}const C=this.mergeParamsWithApplicationProvidedParams(e,t,s,h),y=d==null,v=d||c;return{componentFromFramework:y,componentClass:v,params:C,type:t,popupFromSelector:g,popupPositionFromSelector:f,newAgStackInstance:()=>this.newAgStackInstance(v,y,C,t)}}getCompKeys(e,t,i){const{propertyName:s}=t;let o,n,r,a,d,c;if(e){const h=e,g=h[s+"Selector"],f=g?g(i):null,m=C=>{typeof C=="string"?o=C:C!=null&&C!==!0&&(this.getFrameworkOverrides().isFrameworkComponent(C)?r=C:n=C)};f?(m(f.component),a=f.params,d=f.popup,c=f.popupPosition):m(h[s])}return{compName:o,jsComp:n,fwComp:r,paramsFromSelector:a,popupFromSelector:d,popupPositionFromSelector:c}}newAgStackInstance(e,t,i,s){const o=s.propertyName,n=!t;let r;if(n)r=new e;else{const d=this.componentMetadataProvider.retrieve(o);r=this.frameworkComponentWrapper.wrap(e,d.mandatoryMethodList,d.optionalMethodList,s)}const a=this.initComponent(r,i);return a==null?De.resolve(r):a.then(()=>r)}mergeParamsWithApplicationProvidedParams(e,t,i,s=null){const o={context:this.gridOptionsService.context,columnApi:this.gridOptionsService.columnApi,api:this.gridOptionsService.api};Be(o,i);const n=e,r=n&&n[t.propertyName+"Params"];if(typeof r=="function"){const a=r(i);Be(o,a)}else typeof r=="object"&&Be(o,r);return Be(o,s),o}initComponent(e,t){if(this.context.createBean(e),e.init!=null)return e.init(t)}getDefaultFloatingFilterType(e,t){if(e==null)return null;let i=null,{compName:s,jsComp:o,fwComp:n}=this.getCompKeys(e,Nl);return s?i=dc.getFloatingFilterType(s):o==null&&n==null&&e.filter===!0&&(i=t()),i}};vs([p("gridOptions")],fi.prototype,"gridOptions",void 0),vs([p("agComponentUtils")],fi.prototype,"agComponentUtils",void 0),vs([p("componentMetadataProvider")],fi.prototype,"componentMetadataProvider",void 0),vs([p("userComponentRegistry")],fi.prototype,"userComponentRegistry",void 0),vs([X("frameworkComponentWrapper")],fi.prototype,"frameworkComponentWrapper",void 0),fi=vs([M("userComponentFactory")],fi);var _n;(function(l){l[l.SINGLE_SHEET=0]="SINGLE_SHEET",l[l.MULTI_SHEET=1]="MULTI_SHEET"})(_n||(_n={}));var _l=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let go=class extends T{constructor(){super(...arguments),this.dragEndFunctions=[],this.dragSources=[]}removeAllListeners(){this.dragSources.forEach(this.removeListener.bind(this)),this.dragSources.length=0}removeListener(e){const t=e.dragSource.eElement,i=e.mouseDownListener;if(t.removeEventListener("mousedown",i),e.touchEnabled){const s=e.touchStartListener;t.removeEventListener("touchstart",s,{passive:!0})}}removeDragSource(e){const t=this.dragSources.find(i=>i.dragSource===e);t&&(this.removeListener(t),ve(this.dragSources,t))}isDragging(){return this.dragging}addDragSource(e){const t=this.onMouseDown.bind(this,e),{eElement:i,includeTouch:s,stopPropagationForTouch:o}=e;i.addEventListener("mousedown",t);let n=null;const r=this.gridOptionsService.is("suppressTouch");s&&!r&&(n=a=>{ll(a.target)||(a.cancelable&&(a.preventDefault(),o&&a.stopPropagation()),this.onTouchStart(e,a))},i.addEventListener("touchstart",n,{passive:!1})),this.dragSources.push({dragSource:e,mouseDownListener:t,touchStartListener:n,touchEnabled:!!s})}getStartTarget(){return this.startTarget}onTouchStart(e,t){this.currentDragParams=e,this.dragging=!1;const i=t.touches[0];this.touchLastTime=i,this.touchStart=i;const s=d=>this.onTouchMove(d,e.eElement),o=d=>this.onTouchUp(d,e.eElement),n=d=>{d.cancelable&&d.preventDefault()},r=t.target,a=[{target:this.gridOptionsService.getRootNode(),type:"touchmove",listener:n,options:{passive:!1}},{target:r,type:"touchmove",listener:s,options:{passive:!0}},{target:r,type:"touchend",listener:o,options:{passive:!0}},{target:r,type:"touchcancel",listener:o,options:{passive:!0}}];this.addTemporaryEvents(a),e.dragStartPixels===0&&this.onCommonMove(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),n=d=>d.preventDefault(),r=this.gridOptionsService.getRootNode(),a=[{target:r,type:"mousemove",listener:s},{target:r,type:"mouseup",listener:o},{target:r,type:"contextmenu",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:n}=t;i.addEventListener(s,o,n)}),this.dragEndFunctions.push(()=>{e.forEach(t=>{const{target:i,type:s,listener:o,options:n}=t;i.removeEventListener(s,o,n)})})}isEventNearStartEvent(e,t){const{dragStartPixels:i}=this.currentDragParams,s=R(i)?i:4;return vl(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){if(!this.dragging){if(!this.dragging&&this.isEventNearStartEvent(e,t))return;this.dragging=!0;const s={type:u.EVENT_DRAG_STARTED,target:i};this.eventService.dispatchEvent(s),this.currentDragParams.onDragStart(t),this.currentDragParams.onDragging(t)}this.currentDragParams.onDragging(e)}onTouchMove(e,t){const i=this.getFirstActiveTouch(e.touches);i&&this.onCommonMove(i,this.touchStart,t)}onMouseMove(e,t){this.shouldPreventMouseEvent(e)&&e.preventDefault(),this.onCommonMove(e,this.mouseStartEvent,t)}shouldPreventMouseEvent(e){const t=this.gridOptionsService.is("enableCellTextSelection"),i=it(),s=e.type==="mousemove";return(t&&s||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){if(this.dragging){this.dragging=!1,this.currentDragParams.onDragStop(e);const i={type:u.EVENT_DRAG_STOPPED,target:t};this.eventService.dispatchEvent(i)}this.mouseStartEvent=null,this.startTarget=null,this.touchStart=null,this.touchLastTime=null,this.currentDragParams=null,this.dragEndFunctions.forEach(i=>i()),this.dragEndFunctions.length=0}};_l([p("mouseEventService")],go.prototype,"mouseEventService",void 0),_l([he],go.prototype,"removeAllListeners",null),go=_l([M("dragService")],go);var rt;(function(l){l[l.Above=0]="Above",l[l.Below=1]="Below"})(rt||(rt={}));var J;(function(l){l.EVERYTHING="group",l.FILTER="filter",l.SORT="sort",l.MAP="map",l.AGGREGATE="aggregate",l.FILTER_AGGREGATES="filter_aggregates",l.PIVOT="pivot",l.NOTHING="nothing"})(J||(J={}));var Q=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};function ki(l){const e=l;return e!=null&&e.getFrameworkComponentInstance!=null?e.getFrameworkComponentInstance():l}let K=class{constructor(){this.detailGridInfoMap={},this.destroyCalled=!1}registerOverlayWrapperComp(e){this.overlayWrapperComp=e}registerSideBarComp(e){this.sideBarComp=e}init(){switch(this.rowModel.getType()){case"clientSide":this.clientSideRowModel=this.rowModel;break;case"infinite":this.infiniteRowModel=this.rowModel;break;case"serverSide":this.serverSideRowModel=this.rowModel;break}this.ctrlsService.whenReady(()=>{this.gridBodyCtrl=this.ctrlsService.getGridBodyCtrl()})}__getAlignedGridService(){return this.alignedGridsService}__getContext(){return this.context}getSetterMethod(e){return`set${e.charAt(0).toUpperCase()}${e.substring(1)}`}__setProperty(e,t){this.gridOptionsService.set(e,t);const i=this.getSetterMethod(e),s=this;s[i]&&s[i](t)}getGridId(){return this.context.getGridId()}addDetailGridInfo(e,t){this.detailGridInfoMap[e]=t}removeDetailGridInfo(e){this.detailGridInfoMap[e]=void 0}getDetailGridInfo(e){return this.detailGridInfoMap[e]}forEachDetailGridInfo(e){let t=0;se(this.detailGridInfoMap,(i,s)=>{R(s)&&(e(s,t),t++)})}getDataAsCsv(e){if(A.__assertRegistered(N.CsvExportModule,"api.getDataAsCsv",this.context.getGridId()))return this.csvCreator.getDataAsCsv(e)}exportDataAsCsv(e){A.__assertRegistered(N.CsvExportModule,"api.exportDataAsCSv",this.context.getGridId())&&this.csvCreator.exportDataAsCsv(e)}getExcelExportMode(e){const t=this.gridOptionsService.get("defaultExcelExportParams");return Object.assign({exportMode:"xlsx"},t,e).exportMode}assertNotExcelMultiSheet(e,t){if(!A.__assertRegistered(N.ExcelExportModule,"api."+e,this.context.getGridId()))return!1;const i=this.getExcelExportMode(t);return this.excelCreator.getFactoryMode(i)===_n.MULTI_SHEET?(console.warn("AG Grid: The Excel Exporter is currently on Multi Sheet mode. End that operation by calling 'api.getMultipleSheetAsExcel()' or 'api.exportMultipleSheetsAsExcel()'"),!1):!0}getDataAsExcel(e){if(this.assertNotExcelMultiSheet("getDataAsExcel",e))return this.excelCreator.getDataAsExcel(e)}exportDataAsExcel(e){this.assertNotExcelMultiSheet("exportDataAsExcel",e)&&this.excelCreator.exportDataAsExcel(e)}getSheetDataForExcel(e){if(!A.__assertRegistered(N.ExcelExportModule,"api.getSheetDataForExcel",this.context.getGridId()))return;const t=this.getExcelExportMode(e);return this.excelCreator.setFactoryMode(_n.MULTI_SHEET,t),this.excelCreator.getSheetDataForExcel(e)}getMultipleSheetsAsExcel(e){if(A.__assertRegistered(N.ExcelExportModule,"api.getMultipleSheetsAsExcel",this.context.getGridId()))return this.excelCreator.getMultipleSheetsAsExcel(e)}exportMultipleSheetsAsExcel(e){if(A.__assertRegistered(N.ExcelExportModule,"api.exportMultipleSheetsAsExcel",this.context.getGridId()))return this.excelCreator.exportMultipleSheetsAsExcel(e)}setGridAriaProperty(e,t){if(!e)return;const i=this.ctrlsService.getGridBodyCtrl().getGui(),s=`aria-${e}`;t===null?i.removeAttribute(s):i.setAttribute(s,t)}logMissingRowModel(e,...t){console.error(`AG Grid: api.${e} can only be called when gridOptions.rowModelType is ${t.join(" or ")}`)}setServerSideDatasource(e){this.serverSideRowModel?this.serverSideRowModel.setDatasource(e):this.logMissingRowModel("setServerSideDatasource","serverSide")}setCacheBlockSize(e){this.serverSideRowModel?(this.gridOptionsService.set("cacheBlockSize",e),this.serverSideRowModel.resetRootStore()):this.logMissingRowModel("setCacheBlockSize","serverSide")}setDatasource(e){this.gridOptionsService.isRowModelType("infinite")?this.rowModel.setDatasource(e):this.logMissingRowModel("setDatasource","infinite")}setViewportDatasource(e){this.gridOptionsService.isRowModelType("viewport")?this.rowModel.setViewportDatasource(e):this.logMissingRowModel("setViewportDatasource","viewport")}setRowData(e){if(this.immutableService==null){this.logMissingRowModel("setRowData","clientSide");return}this.immutableService.isActive()?this.immutableService.setRowData(e):(this.selectionService.reset(),this.clientSideRowModel.setRowData(e))}setPinnedTopRowData(e){this.pinnedRowModel.setPinnedTopRowData(e)}setPinnedBottomRowData(e){this.pinnedRowModel.setPinnedBottomRowData(e)}getPinnedTopRowCount(){return this.pinnedRowModel.getPinnedTopRowCount()}getPinnedBottomRowCount(){return this.pinnedRowModel.getPinnedBottomRowCount()}getPinnedTopRow(e){return this.pinnedRowModel.getPinnedTopRow(e)}getPinnedBottomRow(e){return this.pinnedRowModel.getPinnedBottomRow(e)}setColumnDefs(e,t="api"){this.columnModel.setColumnDefs(e,t),this.gridOptionsService.set("columnDefs",e,!0,{source:t})}setAutoGroupColumnDef(e,t="api"){this.gridOptionsService.set("autoGroupColumnDef",e,!0,{source:t})}setDefaultColDef(e,t="api"){this.gridOptionsService.set("defaultColDef",e,!0,{source:t})}setColumnTypes(e,t="api"){this.gridOptionsService.set("columnTypes",e,!0,{source:t})}expireValueCache(){this.valueCache.expire()}getVerticalPixelRange(){return this.gridBodyCtrl.getScrollFeature().getVScrollPosition()}getHorizontalPixelRange(){return this.gridBodyCtrl.getScrollFeature().getHScrollPosition()}setAlwaysShowHorizontalScroll(e){this.gridOptionsService.set("alwaysShowHorizontalScroll",e)}setAlwaysShowVerticalScroll(e){this.gridOptionsService.set("alwaysShowVerticalScroll",e)}refreshCells(e={}){this.rowRenderer.refreshCells(e)}flashCells(e={}){this.rowRenderer.flashCells(e)}redrawRows(e={}){const t=e?e.rowNodes:void 0;this.rowRenderer.redrawRows(t)}setFunctionsReadOnly(e){this.gridOptionsService.set("functionsReadOnly",e)}refreshHeader(){this.ctrlsService.getHeaderRowContainerCtrls().forEach(e=>e.refresh())}isAnyFilterPresent(){return this.filterManager.isAnyFilterPresent()}isColumnFilterPresent(){return this.filterManager.isColumnFilterPresent()||this.filterManager.isAggregateFilterPresent()}isQuickFilterPresent(){return this.filterManager.isQuickFilterPresent()}getModel(){return this.rowModel}setRowNodeExpanded(e,t,i){e&&(i&&e.parent&&e.parent.level!==-1&&this.setRowNodeExpanded(e.parent,t,i),e.setExpanded(t))}onGroupExpandedOrCollapsed(){if(x(this.clientSideRowModel)){this.logMissingRowModel("onGroupExpandedOrCollapsed","clientSide");return}this.clientSideRowModel.refreshModel({step:J.MAP})}refreshClientSideRowModel(e){if(x(this.clientSideRowModel)){this.logMissingRowModel("refreshClientSideRowModel","clientSide");return}this.clientSideRowModel.refreshModel(e)}isAnimationFrameQueueEmpty(){return this.animationFrameService.isQueueEmpty()}flushAllAnimationFrames(){this.animationFrameService.flushAllFrames()}getRowNode(e){return this.rowModel.getRowNode(e)}getSizesForCurrentTheme(){return{rowHeight:this.gridOptionsService.getRowHeightAsNumber(),headerHeight:this.columnModel.getHeaderHeight()}}expandAll(){this.clientSideRowModel?this.clientSideRowModel.expandOrCollapseAll(!0):this.serverSideRowModel?this.serverSideRowModel.expandAll(!0):this.logMissingRowModel("expandAll","clientSide","serverSide")}collapseAll(){this.clientSideRowModel?this.clientSideRowModel.expandOrCollapseAll(!1):this.serverSideRowModel?this.serverSideRowModel.expandAll(!1):this.logMissingRowModel("expandAll","clientSide","serverSide")}addRenderedRowListener(e,t,i){this.rowRenderer.addRenderedRowListener(e,t,i)}getQuickFilter(){return this.gridOptionsService.get("quickFilterText")}setQuickFilter(e){this.gridOptionsService.set("quickFilterText",e)}setExcludeHiddenColumnsFromQuickFilter(e){et("30","setExcludeHiddenColumnsFromQuickFilter",void 0,"Hidden columns are now excluded from the Quick Filter by default. This can be toggled using `setIncludeHiddenColumnsInQuickFilter`"),this.setIncludeHiddenColumnsInQuickFilter(!e)}setIncludeHiddenColumnsInQuickFilter(e){this.gridOptionsService.set("includeHiddenColumnsInQuickFilter",e)}setNodesSelected(e){if(!e.nodes.every(r=>r.rowPinned?(console.warn("AG Grid: cannot select pinned rows"),!1):r.id===void 0?(console.warn("AG Grid: cannot select node until id for node is known"),!1):!0))return;const{nodes:i,source:s,newValue:o}=e,n=i;this.selectionService.setNodesSelected({nodes:n,source:s??"api",newValue:o})}selectAll(e="apiSelectAll"){this.selectionService.selectAllRowNodes({source:e})}deselectAll(e="apiSelectAll"){this.selectionService.deselectAllRowNodes({source:e})}selectAllFiltered(e="apiSelectAllFiltered"){this.selectionService.selectAllRowNodes({source:e,justFiltered:!0})}deselectAllFiltered(e="apiSelectAllFiltered"){this.selectionService.deselectAllRowNodes({source:e,justFiltered:!0})}getServerSideSelectionState(){return x(this.serverSideRowModel)?(this.logMissingRowModel("getServerSideSelectionState","serverSide"),null):this.selectionService.getServerSideSelectionState()}setServerSideSelectionState(e){if(x(this.serverSideRowModel)){this.logMissingRowModel("setServerSideSelectionState","serverSide");return}this.selectionService.setServerSideSelectionState(e)}selectAllOnCurrentPage(e="apiSelectAllCurrentPage"){this.selectionService.selectAllRowNodes({source:e,justCurrentPage:!0})}deselectAllOnCurrentPage(e="apiSelectAllCurrentPage"){this.selectionService.deselectAllRowNodes({source:e,justCurrentPage:!0})}sizeColumnsToFit(e){this.gridBodyCtrl.sizeColumnsToFit(e)}showLoadingOverlay(){this.overlayWrapperComp.showLoadingOverlay()}showNoRowsOverlay(){this.overlayWrapperComp.showNoRowsOverlay()}hideOverlay(){this.overlayWrapperComp.hideOverlay()}getSelectedNodes(){return this.selectionService.getSelectedNodes()}getSelectedRows(){return this.selectionService.getSelectedRows()}getBestCostNodeSelection(){if(x(this.clientSideRowModel)){this.logMissingRowModel("getBestCostNodeSelection","clientSide");return}return this.selectionService.getBestCostNodeSelection()}getRenderedNodes(){return this.rowRenderer.getRenderedNodes()}ensureColumnVisible(e,t="auto"){this.gridBodyCtrl.getScrollFeature().ensureColumnVisible(e,t)}ensureIndexVisible(e,t){this.gridBodyCtrl.getScrollFeature().ensureIndexVisible(e,t)}ensureNodeVisible(e,t=null){this.gridBodyCtrl.getScrollFeature().ensureNodeVisible(e,t)}forEachLeafNode(e){if(x(this.clientSideRowModel)){this.logMissingRowModel("forEachLeafNode","clientSide");return}this.clientSideRowModel.forEachLeafNode(e)}forEachNode(e,t){this.rowModel.forEachNode(e,t)}forEachNodeAfterFilter(e){if(x(this.clientSideRowModel)){this.logMissingRowModel("forEachNodeAfterFilter","clientSide");return}this.clientSideRowModel.forEachNodeAfterFilter(e)}forEachNodeAfterFilterAndSort(e){if(x(this.clientSideRowModel)){this.logMissingRowModel("forEachNodeAfterFilterAndSort","clientSide");return}this.clientSideRowModel.forEachNodeAfterFilterAndSort(e)}getFilterInstance(e,t){const i=this.getFilterInstanceImpl(e,o=>{if(!t)return;const n=ki(o);t(n)});return ki(i)}getFilterInstanceImpl(e,t){const i=this.columnModel.getPrimaryColumn(e);if(!i)return;const s=this.filterManager.getFilterComponent(i,"NO_UI"),o=s&&s.resolveNow(null,n=>n);return o?setTimeout(t,0,o):s&&s.then(n=>{t(n)}),o}destroyFilter(e){const t=this.columnModel.getPrimaryColumn(e);if(t)return this.filterManager.destroyFilter(t,"api")}getStatusPanel(e){if(!A.__assertRegistered(N.StatusBarModule,"api.getStatusPanel",this.context.getGridId()))return;const t=this.statusBarService.getStatusPanel(e);return ki(t)}getColumnDef(e){const t=this.columnModel.getPrimaryColumn(e);return t?t.getColDef():null}getColumnDefs(){return this.columnModel.getColumnDefs()}onFilterChanged(){this.filterManager.onFilterChanged()}onSortChanged(){this.sortController.onSortChanged("api")}setFilterModel(e){this.filterManager.setFilterModel(e)}getFilterModel(){return this.filterManager.getFilterModel()}getFocusedCell(){return this.focusService.getFocusedCell()}clearFocusedCell(){return this.focusService.clearFocusedCell()}setFocusedCell(e,t,i){this.focusService.setFocusedCell({rowIndex:e,column:t,rowPinned:i,forceBrowserFocus:!0})}setSuppressRowDrag(e){this.gridOptionsService.set("suppressRowDrag",e)}setSuppressMoveWhenRowDragging(e){this.gridOptionsService.set("suppressMoveWhenRowDragging",e)}setSuppressRowClickSelection(e){this.gridOptionsService.set("suppressRowClickSelection",e)}addRowDropZone(e){this.gridBodyCtrl.getRowDragFeature().addRowDropZone(e)}removeRowDropZone(e){const t=this.dragAndDropService.findExternalZone(e);t&&this.dragAndDropService.removeDropTarget(t)}getRowDropZoneParams(e){return this.gridBodyCtrl.getRowDragFeature().getRowDropZone(e)}setHeaderHeight(e){this.gridOptionsService.set("headerHeight",e)}setDomLayout(e){this.gridOptionsService.set("domLayout",e)}setEnableCellTextSelection(e){this.gridBodyCtrl.setCellTextSelection(e)}setFillHandleDirection(e){this.gridOptionsService.set("fillHandleDirection",e)}setGroupHeaderHeight(e){this.gridOptionsService.set("groupHeaderHeight",e)}setFloatingFiltersHeight(e){this.gridOptionsService.set("floatingFiltersHeight",e)}setPivotHeaderHeight(e){this.gridOptionsService.set("pivotHeaderHeight",e)}setPivotGroupHeaderHeight(e){this.gridOptionsService.set("pivotGroupHeaderHeight",e)}setPivotMode(e){this.columnModel.setPivotMode(e)}setAnimateRows(e){this.gridOptionsService.set("animateRows",e)}setIsExternalFilterPresent(e){this.gridOptionsService.set("isExternalFilterPresent",e)}setDoesExternalFilterPass(e){this.gridOptionsService.set("doesExternalFilterPass",e)}setNavigateToNextCell(e){this.gridOptionsService.set("navigateToNextCell",e)}setTabToNextCell(e){this.gridOptionsService.set("tabToNextCell",e)}setTabToNextHeader(e){this.gridOptionsService.set("tabToNextHeader",e)}setNavigateToNextHeader(e){this.gridOptionsService.set("navigateToNextHeader",e)}setRowGroupPanelShow(e){this.gridOptionsService.set("rowGroupPanelShow",e)}setGetGroupRowAgg(e){this.gridOptionsService.set("getGroupRowAgg",e)}setGetBusinessKeyForNode(e){this.gridOptionsService.set("getBusinessKeyForNode",e)}setGetChildCount(e){this.gridOptionsService.set("getChildCount",e)}setProcessRowPostCreate(e){this.gridOptionsService.set("processRowPostCreate",e)}setGetRowId(e){this.gridOptionsService.set("getRowId",e)}setGetRowClass(e){this.gridOptionsService.set("getRowClass",e)}setIsFullWidthRow(e){this.gridOptionsService.set("isFullWidthRow",e)}setIsRowSelectable(e){this.gridOptionsService.set("isRowSelectable",e)}setIsRowMaster(e){this.gridOptionsService.set("isRowMaster",e)}setPostSortRows(e){this.gridOptionsService.set("postSortRows",e)}setGetDocument(e){this.gridOptionsService.set("getDocument",e)}setGetContextMenuItems(e){this.gridOptionsService.set("getContextMenuItems",e)}setGetMainMenuItems(e){this.gridOptionsService.set("getMainMenuItems",e)}setProcessCellForClipboard(e){this.gridOptionsService.set("processCellForClipboard",e)}setSendToClipboard(e){this.gridOptionsService.set("sendToClipboard",e)}setProcessCellFromClipboard(e){this.gridOptionsService.set("processCellFromClipboard",e)}setProcessSecondaryColDef(e){et("28.0","setProcessSecondaryColDef","setProcessPivotResultColDef"),this.setProcessPivotResultColDef(e)}setProcessSecondaryColGroupDef(e){et("28.0","setProcessSecondaryColGroupDef","setProcessPivotResultColGroupDef"),this.setProcessPivotResultColGroupDef(e)}setProcessPivotResultColDef(e){this.gridOptionsService.set("processPivotResultColDef",e)}setProcessPivotResultColGroupDef(e){this.gridOptionsService.set("processPivotResultColGroupDef",e)}setPostProcessPopup(e){this.gridOptionsService.set("postProcessPopup",e)}setInitialGroupOrderComparator(e){this.gridOptionsService.set("initialGroupOrderComparator",e)}setGetChartToolbarItems(e){this.gridOptionsService.set("getChartToolbarItems",e)}setPaginationNumberFormatter(e){this.gridOptionsService.set("paginationNumberFormatter",e)}setGetServerSideStoreParams(e){et("28.0","setGetServerSideStoreParams","setGetServerSideGroupLevelParams"),this.setGetServerSideGroupLevelParams(e)}setGetServerSideGroupLevelParams(e){this.gridOptionsService.set("getServerSideGroupLevelParams",e)}setIsServerSideGroupOpenByDefault(e){this.gridOptionsService.set("isServerSideGroupOpenByDefault",e)}setIsApplyServerSideTransaction(e){this.gridOptionsService.set("isApplyServerSideTransaction",e)}setIsServerSideGroup(e){this.gridOptionsService.set("isServerSideGroup",e)}setGetServerSideGroupKey(e){this.gridOptionsService.set("getServerSideGroupKey",e)}setGetRowStyle(e){this.gridOptionsService.set("getRowStyle",e)}setGetRowHeight(e){this.gridOptionsService.set("getRowHeight",e)}assertSideBarLoaded(e){return A.__assertRegistered(N.SideBarModule,"api."+e,this.context.getGridId())}isSideBarVisible(){return this.assertSideBarLoaded("isSideBarVisible")&&this.sideBarComp.isDisplayed()}setSideBarVisible(e){this.assertSideBarLoaded("setSideBarVisible")&&this.sideBarComp.setDisplayed(e)}setSideBarPosition(e){this.assertSideBarLoaded("setSideBarPosition")&&this.sideBarComp.setSideBarPosition(e)}openToolPanel(e){this.assertSideBarLoaded("openToolPanel")&&this.sideBarComp.openToolPanel(e,"api")}closeToolPanel(){this.assertSideBarLoaded("closeToolPanel")&&this.sideBarComp.close("api")}getOpenedToolPanel(){return this.assertSideBarLoaded("getOpenedToolPanel")?this.sideBarComp.openedItem():null}refreshToolPanel(){this.assertSideBarLoaded("refreshToolPanel")&&this.sideBarComp.refresh()}isToolPanelShowing(){return this.assertSideBarLoaded("isToolPanelShowing")&&this.sideBarComp.isToolPanelShowing()}getToolPanelInstance(e){if(this.assertSideBarLoaded("getToolPanelInstance")){const t=this.sideBarComp.getToolPanelInstance(e);return ki(t)}}getSideBar(){if(this.assertSideBarLoaded("getSideBar"))return this.sideBarComp.getDef()}setSideBar(e){this.gridOptionsService.set("sideBar",e)}setSuppressClipboardPaste(e){this.gridOptionsService.set("suppressClipboardPaste",e)}resetRowHeights(){if(R(this.clientSideRowModel)){if(this.columnModel.isAutoRowHeightActive()){console.warn("AG Grid: calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.");return}this.clientSideRowModel.resetRowHeights()}}setGroupRemoveSingleChildren(e){this.gridOptionsService.set("groupRemoveSingleChildren",e)}setGroupRemoveLowestSingleChildren(e){this.gridOptionsService.set("groupRemoveLowestSingleChildren",e)}setGroupDisplayType(e){this.gridOptionsService.set("groupDisplayType",e)}setRowClass(e){this.gridOptionsService.set("rowClass",e)}setDeltaSort(e){this.gridOptionsService.set("deltaSort",e)}setRowCount(e,t){if(this.serverSideRowModel){if(this.columnModel.isRowGroupEmpty()){this.serverSideRowModel.setRowCount(e,t);return}console.error("AG Grid: setRowCount cannot be used while using row grouping.");return}if(this.infiniteRowModel){this.infiniteRowModel.setRowCount(e,t);return}this.logMissingRowModel("setRowCount","infinite","serverSide")}onRowHeightChanged(){this.clientSideRowModel?this.clientSideRowModel.onRowHeightChanged():this.serverSideRowModel&&this.serverSideRowModel.onRowHeightChanged()}getValue(e,t){let i=this.columnModel.getPrimaryColumn(e);return x(i)&&(i=this.columnModel.getGridColumn(e)),x(i)?null:this.valueService.getValue(i,t)}addEventListener(e,t){const i=this.gridOptionsService.useAsyncEvents();this.eventService.addEventListener(e,t,i)}addGlobalListener(e){const t=this.gridOptionsService.useAsyncEvents();this.eventService.addGlobalListener(e,t)}removeEventListener(e,t){const i=this.gridOptionsService.useAsyncEvents();this.eventService.removeEventListener(e,t,i)}removeGlobalListener(e){const t=this.gridOptionsService.useAsyncEvents();this.eventService.removeGlobalListener(e,t)}dispatchEvent(e){this.eventService.dispatchEvent(e)}destroy(){if(this.destroyCalled)return;this.destroyCalled=!0;const e=this.ctrlsService.getGridCtrl();e&&e.destroyGridUi(),this.context.destroy()}cleanDownReferencesToAvoidMemoryLeakInCaseApplicationIsKeepingReferenceToDestroyedGrid(){setTimeout(Na.bind(window,this,"Grid API"),100)}warnIfDestroyed(e){return this.destroyCalled&&console.warn(`AG Grid: Grid API method ${e} was called on a grid that was destroyed.`),this.destroyCalled}resetQuickFilter(){this.warnIfDestroyed("resetQuickFilter")||this.filterManager.resetQuickFilterCache()}getCellRanges(){return this.rangeService?this.rangeService.getCellRanges():(A.__assertRegistered(N.RangeSelectionModule,"api.getCellRanges",this.context.getGridId()),null)}addCellRange(e){if(this.rangeService){this.rangeService.addCellRange(e);return}A.__assertRegistered(N.RangeSelectionModule,"api.addCellRange",this.context.getGridId())}clearRangeSelection(){this.rangeService&&this.rangeService.removeAllCellRanges(),A.__assertRegistered(N.RangeSelectionModule,"gridApi.clearRangeSelection",this.context.getGridId())}undoCellEditing(){this.undoRedoService.undo("api")}redoCellEditing(){this.undoRedoService.redo("api")}getCurrentUndoSize(){return this.undoRedoService.getCurrentUndoStackSize()}getCurrentRedoSize(){return this.undoRedoService.getCurrentRedoStackSize()}getChartModels(){if(A.__assertRegistered(N.GridChartsModule,"api.getChartModels",this.context.getGridId()))return this.chartService.getChartModels()}getChartRef(e){if(A.__assertRegistered(N.GridChartsModule,"api.getChartRef",this.context.getGridId()))return this.chartService.getChartRef(e)}getChartImageDataURL(e){if(A.__assertRegistered(N.GridChartsModule,"api.getChartImageDataURL",this.context.getGridId()))return this.chartService.getChartImageDataURL(e)}downloadChart(e){if(A.__assertRegistered(N.GridChartsModule,"api.downloadChart",this.context.getGridId()))return this.chartService.downloadChart(e)}openChartToolPanel(e){if(A.__assertRegistered(N.GridChartsModule,"api.openChartToolPanel",this.context.getGridId()))return this.chartService.openChartToolPanel(e)}closeChartToolPanel(e){if(A.__assertRegistered(N.GridChartsModule,"api.closeChartToolPanel",this.context.getGridId()))return this.chartService.closeChartToolPanel(e.chartId)}createRangeChart(e){if(A.__assertRegistered(N.GridChartsModule,"api.createRangeChart",this.context.getGridId()))return this.chartService.createRangeChart(e)}createPivotChart(e){if(A.__assertRegistered(N.GridChartsModule,"api.createPivotChart",this.context.getGridId()))return this.chartService.createPivotChart(e)}createCrossFilterChart(e){if(A.__assertRegistered(N.GridChartsModule,"api.createCrossFilterChart",this.context.getGridId()))return this.chartService.createCrossFilterChart(e)}updateChart(e){A.__assertRegistered(N.GridChartsModule,"api.updateChart",this.context.getGridId())&&this.chartService.updateChart(e)}restoreChart(e,t){if(A.__assertRegistered(N.GridChartsModule,"api.restoreChart",this.context.getGridId()))return this.chartService.restoreChart(e,t)}copyToClipboard(e){A.__assertRegistered(N.ClipboardModule,"api.copyToClipboard",this.context.getGridId())&&this.clipboardService.copyToClipboard(e)}cutToClipboard(e){A.__assertRegistered(N.ClipboardModule,"api.cutToClipboard",this.context.getGridId())&&this.clipboardService.cutToClipboard(e,"api")}copySelectedRowsToClipboard(e){A.__assertRegistered(N.ClipboardModule,"api.copySelectedRowsToClipboard",this.context.getGridId())&&this.clipboardService.copySelectedRowsToClipboard(e)}copySelectedRangeToClipboard(e){A.__assertRegistered(N.ClipboardModule,"api.copySelectedRangeToClipboard",this.context.getGridId())&&this.clipboardService.copySelectedRangeToClipboard(e)}copySelectedRangeDown(){A.__assertRegistered(N.ClipboardModule,"api.copySelectedRangeDown",this.context.getGridId())&&this.clipboardService.copyRangeDown()}pasteFromClipboard(){A.__assertRegistered(N.ClipboardModule,"api.pasteFromClipboard",this.context.getGridId())&&this.clipboardService.pasteFromClipboard()}showColumnMenuAfterButtonClick(e,t){const i=this.columnModel.getGridColumn(e);this.menuFactory.showMenuAfterButtonClick(i,t,"columnMenu")}showColumnMenuAfterMouseClick(e,t){let i=this.columnModel.getGridColumn(e);if(i||(i=this.columnModel.getPrimaryColumn(e)),!i){console.error(`AG Grid: column '${e}' not found`);return}this.menuFactory.showMenuAfterMouseEvent(i,t)}hidePopupMenu(){this.contextMenuFactory&&this.contextMenuFactory.hideActiveMenu(),this.menuFactory.hideActiveMenu()}setPopupParent(e){this.gridOptionsService.set("popupParent",e)}tabToNextCell(e){return this.navigationService.tabToNextCell(!1,e)}tabToPreviousCell(e){return this.navigationService.tabToNextCell(!0,e)}getCellRendererInstances(e={}){return this.rowRenderer.getCellRendererInstances(e).map(ki)}getCellEditorInstances(e={}){return this.rowRenderer.getCellEditorInstances(e).map(ki)}getEditingCells(){return this.rowRenderer.getEditingCells()}stopEditing(e=!1){this.rowRenderer.stopEditing(e)}startEditingCell(e){const t=this.columnModel.getGridColumn(e.colKey);if(!t){console.warn(`AG Grid: no column found for ${e.colKey}`);return}const i={rowIndex:e.rowIndex,rowPinned:e.rowPinned||null,column:t};e.rowPinned==null&&this.gridBodyCtrl.getScrollFeature().ensureIndexVisible(e.rowIndex);const o=this.navigationService.getCellByPosition(i);o&&o.startRowOrCellEdit(e.key)}addAggFunc(e,t){this.aggFuncService&&this.aggFuncService.addAggFunc(e,t)}addAggFuncs(e){this.aggFuncService&&this.aggFuncService.addAggFuncs(e)}clearAggFuncs(){this.aggFuncService&&this.aggFuncService.clear()}applyServerSideTransaction(e){if(!this.serverSideTransactionManager){this.logMissingRowModel("applyServerSideTransaction","serverSide");return}return this.serverSideTransactionManager.applyTransaction(e)}applyServerSideTransactionAsync(e,t){if(!this.serverSideTransactionManager){this.logMissingRowModel("applyServerSideTransactionAsync","serverSide");return}return this.serverSideTransactionManager.applyTransactionAsync(e,t)}retryServerSideLoads(){if(!this.serverSideRowModel){this.logMissingRowModel("retryServerSideLoads","serverSide");return}this.serverSideRowModel.retryLoads()}flushServerSideAsyncTransactions(){if(!this.serverSideTransactionManager){this.logMissingRowModel("flushServerSideAsyncTransactions","serverSide");return}return this.serverSideTransactionManager.flushAsyncTransactions()}applyTransaction(e){if(!this.clientSideRowModel){this.logMissingRowModel("applyTransaction","clientSide");return}return this.clientSideRowModel.updateRowData(e)}applyTransactionAsync(e,t){if(!this.clientSideRowModel){this.logMissingRowModel("applyTransactionAsync","clientSide");return}this.clientSideRowModel.batchUpdateRowData(e,t)}flushAsyncTransactions(){if(!this.clientSideRowModel){this.logMissingRowModel("flushAsyncTransactions","clientSide");return}this.clientSideRowModel.flushAsyncTransactions()}setSuppressModelUpdateAfterUpdateTransaction(e){this.gridOptionsService.set("suppressModelUpdateAfterUpdateTransaction",e)}refreshInfiniteCache(){this.infiniteRowModel?this.infiniteRowModel.refreshCache():this.logMissingRowModel("refreshInfiniteCache","infinite")}purgeInfiniteCache(){this.infiniteRowModel?this.infiniteRowModel.purgeCache():this.logMissingRowModel("purgeInfiniteCache","infinite")}refreshServerSide(e){if(!this.serverSideRowModel){this.logMissingRowModel("refreshServerSide","serverSide");return}this.serverSideRowModel.refreshStore(e)}refreshServerSideStore(e){return et("28.0","refreshServerSideStore","refreshServerSide"),this.refreshServerSide(e)}getServerSideStoreState(){return et("28.0","getServerSideStoreState","getServerSideGroupLevelState"),this.getServerSideGroupLevelState()}getServerSideGroupLevelState(){return this.serverSideRowModel?this.serverSideRowModel.getStoreState():(this.logMissingRowModel("getServerSideGroupLevelState","serverSide"),[])}getInfiniteRowCount(){if(this.infiniteRowModel)return this.infiniteRowModel.getRowCount();this.logMissingRowModel("getInfiniteRowCount","infinite")}isLastRowIndexKnown(){if(this.infiniteRowModel)return this.infiniteRowModel.isLastRowIndexKnown();this.logMissingRowModel("isLastRowIndexKnown","infinite")}getCacheBlockState(){return this.rowNodeBlockLoader.getBlockState()}getFirstDisplayedRow(){return this.rowRenderer.getFirstVirtualRenderedRow()}getLastDisplayedRow(){return this.rowRenderer.getLastVirtualRenderedRow()}getDisplayedRowAtIndex(e){return this.rowModel.getRow(e)}getDisplayedRowCount(){return this.rowModel.getRowCount()}setDataTypeDefinitions(e){this.gridOptionsService.set("dataTypeDefinitions",e)}setPagination(e){this.gridOptionsService.set("pagination",e)}paginationIsLastPageFound(){return this.paginationProxy.isLastPageFound()}paginationGetPageSize(){return this.paginationProxy.getPageSize()}paginationSetPageSize(e){this.gridOptionsService.set("paginationPageSize",e)}paginationGetCurrentPage(){return this.paginationProxy.getCurrentPage()}paginationGetTotalPages(){return this.paginationProxy.getTotalPages()}paginationGetRowCount(){return this.paginationProxy.getMasterRowCount()}paginationGoToNextPage(){this.paginationProxy.goToNextPage()}paginationGoToPreviousPage(){this.paginationProxy.goToPreviousPage()}paginationGoToFirstPage(){this.paginationProxy.goToFirstPage()}paginationGoToLastPage(){this.paginationProxy.goToLastPage()}paginationGoToPage(e){this.paginationProxy.goToPage(e)}};Q([X("immutableService")],K.prototype,"immutableService",void 0),Q([X("csvCreator")],K.prototype,"csvCreator",void 0),Q([X("excelCreator")],K.prototype,"excelCreator",void 0),Q([p("rowRenderer")],K.prototype,"rowRenderer",void 0),Q([p("navigationService")],K.prototype,"navigationService",void 0),Q([p("filterManager")],K.prototype,"filterManager",void 0),Q([p("columnModel")],K.prototype,"columnModel",void 0),Q([p("selectionService")],K.prototype,"selectionService",void 0),Q([p("gridOptionsService")],K.prototype,"gridOptionsService",void 0),Q([p("valueService")],K.prototype,"valueService",void 0),Q([p("alignedGridsService")],K.prototype,"alignedGridsService",void 0),Q([p("eventService")],K.prototype,"eventService",void 0),Q([p("pinnedRowModel")],K.prototype,"pinnedRowModel",void 0),Q([p("context")],K.prototype,"context",void 0),Q([p("rowModel")],K.prototype,"rowModel",void 0),Q([p("sortController")],K.prototype,"sortController",void 0),Q([p("paginationProxy")],K.prototype,"paginationProxy",void 0),Q([p("focusService")],K.prototype,"focusService",void 0),Q([p("dragAndDropService")],K.prototype,"dragAndDropService",void 0),Q([X("rangeService")],K.prototype,"rangeService",void 0),Q([X("clipboardService")],K.prototype,"clipboardService",void 0),Q([X("aggFuncService")],K.prototype,"aggFuncService",void 0),Q([p("menuFactory")],K.prototype,"menuFactory",void 0),Q([X("contextMenuFactory")],K.prototype,"contextMenuFactory",void 0),Q([p("valueCache")],K.prototype,"valueCache",void 0),Q([p("animationFrameService")],K.prototype,"animationFrameService",void 0),Q([X("statusBarService")],K.prototype,"statusBarService",void 0),Q([X("chartService")],K.prototype,"chartService",void 0),Q([X("undoRedoService")],K.prototype,"undoRedoService",void 0),Q([X("rowNodeBlockLoader")],K.prototype,"rowNodeBlockLoader",void 0),Q([X("ssrmTransactionManager")],K.prototype,"serverSideTransactionManager",void 0),Q([p("ctrlsService")],K.prototype,"ctrlsService",void 0),Q([D],K.prototype,"init",null),Q([he],K.prototype,"cleanDownReferencesToAvoidMemoryLeakInCaseApplicationIsKeepingReferenceToDestroyedGrid",null),K=Q([M("gridApi")],K);var Ui=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},xl;let Gt=xl=class extends T{constructor(){super(...arguments),this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.quickFilter=null,this.quickFilterParts=null,this.processingFilterChange=!1}init(){this.addManagedListener(this.eventService,u.EVENT_GRID_COLUMNS_CHANGED,()=>this.onColumnsChanged()),this.addManagedListener(this.eventService,u.EVENT_COLUMN_VALUE_CHANGED,()=>this.refreshFiltersForAggregations()),this.addManagedListener(this.eventService,u.EVENT_COLUMN_PIVOT_CHANGED,()=>this.refreshFiltersForAggregations()),this.addManagedListener(this.eventService,u.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>{this.refreshFiltersForAggregations(),this.resetQuickFilterCache()}),this.addManagedListener(this.eventService,u.EVENT_NEW_COLUMNS_LOADED,()=>this.resetQuickFilterCache()),this.addManagedListener(this.eventService,u.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.resetQuickFilterCache()),this.addManagedListener(this.eventService,u.EVENT_COLUMN_VISIBLE,()=>{this.gridOptionsService.is("includeHiddenColumnsInQuickFilter")||this.resetQuickFilterCache()}),this.addManagedPropertyListener("quickFilterText",e=>this.setQuickFilter(e.currentValue)),this.addManagedPropertyListener("includeHiddenColumnsInQuickFilter",()=>this.onIncludeHiddenColumnsInQuickFilterChanged()),this.quickFilter=this.parseQuickFilter(this.gridOptionsService.get("quickFilterText")),this.setQuickFilterParts(),this.allowShowChangeAfterFilter=this.gridOptionsService.is("allowShowChangeAfterFilter"),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",()=>this.updateAggFiltering())}isExternalFilterPresentCallback(){const e=this.gridOptionsService.getCallback("isExternalFilterPresent");return typeof e=="function"?e({}):!1}doesExternalFilterPass(e){const t=this.gridOptionsService.get("doesExternalFilterPass");return typeof t=="function"?t(e):!1}setQuickFilterParts(){this.quickFilterParts=this.quickFilter?this.quickFilter.split(" "):null}setFilterModel(e){const t=[],i=this.getFilterModel();if(e){const s=wl(Object.keys(e));this.allColumnFilters.forEach((o,n)=>{const r=e[n];t.push(this.setModelOnFilterWrapper(o.filterPromise,r)),s.delete(n)}),s.forEach(o=>{const n=this.columnModel.getPrimaryColumn(o)||this.columnModel.getGridColumn(o);if(!n){console.warn("AG Grid: setFilterModel() - no column found for colId: "+o);return}if(!n.isFilterAllowed()){console.warn("AG Grid: setFilterModel() - unable to fully apply model, filtering disabled for colId: "+o);return}const r=this.getOrCreateFilterWrapper(n,"NO_UI");if(!r){console.warn("AG-Grid: setFilterModel() - unable to fully apply model, unable to create filter for colId: "+o);return}t.push(this.setModelOnFilterWrapper(r.filterPromise,e[o]))})}else this.allColumnFilters.forEach(s=>{t.push(this.setModelOnFilterWrapper(s.filterPromise,null))});De.all(t).then(()=>{const s=this.getFilterModel(),o=[];this.allColumnFilters.forEach((n,r)=>{const a=i?i[r]:null,d=s?s[r]:null;G.jsonEquals(a,d)||o.push(n.column)}),o.length>0&&this.onFilterChanged({columns:o})})}setModelOnFilterWrapper(e,t){return new De(i=>{e.then(s=>{typeof s.setModel!="function"&&(console.warn("AG Grid: filter missing setModel method, which is needed for setFilterModel"),i()),(s.setModel(t)||De.resolve()).then(()=>i())})})}getFilterModel(){const e={};return this.allColumnFilters.forEach((t,i)=>{const o=t.filterPromise.resolveNow(null,r=>r);if(o==null)return null;if(typeof o.getModel!="function"){console.warn("AG Grid: filter API missing getModel method, which is needed for getFilterModel");return}const n=o.getModel();R(n)&&(e[i]=n)}),e}isColumnFilterPresent(){return this.activeColumnFilters.length>0}isAggregateFilterPresent(){return!!this.activeAggregateFilters.length}isExternalFilterPresent(){return this.externalFilterPresent}doAggregateFiltersPass(e,t){return this.doColumnFiltersPass(e,t,!0)}updateActiveFilters(){this.activeColumnFilters.length=0,this.activeAggregateFilters.length=0;const e=s=>s?s.isFilterActive?s.isFilterActive():(console.warn("AG Grid: Filter is missing isFilterActive() method"),!1):!1,t=!!this.gridOptionsService.getGroupAggFiltering(),i=s=>{if(!s.isPrimary())return!0;const n=!this.columnModel.isPivotActive();return!s.isValueActive()||!n?!1:this.columnModel.isPivotMode()?!0:t};this.allColumnFilters.forEach(s=>{if(s.filterPromise.resolveNow(!1,e)){const o=s.filterPromise.resolveNow(null,n=>n);i(s.column)?this.activeAggregateFilters.push(o):this.activeColumnFilters.push(o)}})}updateFilterFlagInColumns(e,t){this.allColumnFilters.forEach(i=>{const s=i.filterPromise.resolveNow(!1,o=>o.isFilterActive());i.column.setFilterActive(s,e,t)})}isAnyFilterPresent(){return this.isQuickFilterPresent()||this.isColumnFilterPresent()||this.isAggregateFilterPresent()||this.isExternalFilterPresent()}doColumnFiltersPass(e,t,i){const{data:s,aggData:o}=e,n=i?this.activeAggregateFilters:this.activeColumnFilters,r=i?o:s;for(let a=0;a<n.length;a++){const d=n[a];if(!(d==null||d===t)){if(typeof d.doesFilterPass!="function")throw new Error("Filter is missing method doesFilterPass");if(!d.doesFilterPass({node:e,data:r}))return!1}}return!0}parseQuickFilter(e){return R(e)?this.gridOptionsService.isRowModelType("clientSide")?e.toUpperCase():(console.warn("AG Grid - Quick filtering only works with the Client-Side Row Model"),null):null}setQuickFilter(e){if(e!=null&&typeof e!="string"){console.warn(`AG Grid - setQuickFilter() only supports string inputs, received: ${typeof e}`);return}const t=this.parseQuickFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setQuickFilterParts(),this.onFilterChanged())}resetQuickFilterCache(){this.rowModel.forEachNode(e=>e.quickFilterAggregateText=null)}onIncludeHiddenColumnsInQuickFilterChanged(){this.columnModel.refreshQuickFilterColumns(),this.resetQuickFilterCache(),this.isQuickFilterPresent()&&this.onFilterChanged()}refreshFiltersForAggregations(){this.gridOptionsService.getGroupAggFiltering()&&this.onFilterChanged()}callOnFilterChangedOutsideRenderCycle(e={}){const t=()=>this.onFilterChanged(e);this.rowRenderer.isRefreshInProgress()?setTimeout(t,0):t()}onFilterChanged(e={}){const{filterInstance:t,additionalEventAttributes:i,columns:s}=e;this.updateDependantFilters(),this.updateActiveFilters(),this.updateFilterFlagInColumns("filterChanged",i),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.allColumnFilters.forEach(n=>{n.filterPromise&&n.filterPromise.then(r=>{r&&r!==t&&r.onAnyFilterChanged&&r.onAnyFilterChanged()})});const o={type:u.EVENT_FILTER_CHANGED,columns:s||[]};i&&Be(o,i),this.processingFilterChange=!0,this.eventService.dispatchEvent(o),this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!this.allowShowChangeAfterFilter&&this.processingFilterChange}isQuickFilterPresent(){return this.quickFilter!==null}updateAggFiltering(){this.aggFiltering=!!this.gridOptionsService.getGroupAggFiltering()}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&(this.aggFiltering||this.columnModel.isPivotMode())}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!(this.aggFiltering||this.columnModel.isPivotMode())}doesRowPassOtherFilters(e,t){return this.doesRowPassFilter({rowNode:t,filterInstanceToSkip:e})}doesRowPassQuickFilterNoCache(e,t){return this.columnModel.getAllColumnsForQuickFilter().some(s=>{const o=this.getQuickFilterTextForColumn(s,e);return R(o)&&o.indexOf(t)>=0})}doesRowPassQuickFilterCache(e,t){return e.quickFilterAggregateText||this.aggregateRowForQuickFilter(e),e.quickFilterAggregateText.indexOf(t)>=0}doesRowPassQuickFilter(e){const t=this.gridOptionsService.is("cacheQuickFilter");return this.quickFilterParts.every(i=>t?this.doesRowPassQuickFilterCache(e,i):this.doesRowPassQuickFilterNoCache(e,i))}doesRowPassAggregateFilters(e){return!(this.isAggregateQuickFilterPresent()&&!this.doesRowPassQuickFilter(e.rowNode)||this.isAggregateFilterPresent()&&!this.doAggregateFiltersPass(e.rowNode,e.filterInstanceToSkip))}doesRowPassFilter(e){return!(this.isNonAggregateQuickFilterPresent()&&!this.doesRowPassQuickFilter(e.rowNode)||this.isExternalFilterPresent()&&!this.doesExternalFilterPass(e.rowNode)||this.isColumnFilterPresent()&&!this.doColumnFiltersPass(e.rowNode,e.filterInstanceToSkip))}getQuickFilterTextForColumn(e,t){let i=this.valueService.getValue(e,t,!0);const s=e.getColDef();if(s.getQuickFilterText){const o={value:i,node:t,data:t.data,column:e,colDef:s,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context};i=s.getQuickFilterText(o)}return R(i)?i.toString().toUpperCase():null}aggregateRowForQuickFilter(e){const t=[];this.columnModel.getAllColumnsForQuickFilter().forEach(s=>{const o=this.getQuickFilterTextForColumn(s,e);R(o)&&t.push(o)}),e.quickFilterAggregateText=t.join(xl.QUICK_FILTER_SEPARATOR)}onNewRowsLoaded(e){this.allColumnFilters.forEach(t=>{t.filterPromise.then(i=>{i.onNewRowsLoaded&&i.onNewRowsLoaded()})}),this.updateFilterFlagInColumns(e,{afterDataChange:!0}),this.updateActiveFilters()}createValueGetter(e){return({node:t})=>this.valueService.getValue(e,t,!0)}getFilterComponent(e,t,i=!0){var s;if(i)return((s=this.getOrCreateFilterWrapper(e,t))===null||s===void 0?void 0:s.filterPromise)||null;const o=this.cachedFilter(e);return o?o.filterPromise:null}isFilterActive(e){const t=this.cachedFilter(e);return!!t&&t.filterPromise.resolveNow(!1,i=>i.isFilterActive())}getOrCreateFilterWrapper(e,t){if(!e.isFilterAllowed())return null;let i=this.cachedFilter(e);if(i)t!=="NO_UI"&&this.putIntoGui(i,t);else{i=this.createFilterWrapper(e,t);const s=e.getColId();this.allColumnFilters.set(s,i),this.allColumnListeners.set(s,this.addManagedListener(e,H.EVENT_COL_DEF_CHANGED,()=>this.checkDestroyFilter(s)))}return i}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e){let t;if(A.__isRegistered(N.SetFilterModule,this.context.getGridId()))t="agSetColumnFilter";else{const i=e.getColDef().cellDataType;i==="number"?t="agNumberColumnFilter":i==="date"||i==="dateString"?t="agDateColumnFilter":t="agTextColumnFilter"}return t}getDefaultFloatingFilter(e){let t;if(A.__isRegistered(N.SetFilterModule,this.context.getGridId()))t="agSetColumnFloatingFilter";else{const i=e.getColDef().cellDataType;i==="number"?t="agNumberColumnFloatingFilter":i==="date"||i==="dateString"?t="agDateColumnFloatingFilter":t="agTextColumnFloatingFilter"}return t}createFilterInstance(e){const t=this.getDefaultFilter(e),i=e.getColDef();let s;const o=Object.assign(Object.assign({},this.createFilterParams(e,i)),{filterModifiedCallback:()=>{const r={type:u.EVENT_FILTER_MODIFIED,column:e,filterInstance:s};this.eventService.dispatchEvent(r)},filterChangedCallback:r=>{const a={filterInstance:s,additionalEventAttributes:r,columns:[e]};this.callOnFilterChangedOutsideRenderCycle(a)},doesRowPassOtherFilter:r=>this.doesRowPassOtherFilters(s,r)}),n=this.userComponentFactory.getFilterDetails(i,o,t);return n?{filterPromise:()=>{const r=n.newAgStackInstance();return r&&r.then(a=>s=a),r},compDetails:n}:{filterPromise:null,compDetails:null}}createFilterParams(e,t){return{column:e,colDef:Tr(t),rowModel:this.rowModel,filterChangedCallback:()=>{},filterModifiedCallback:()=>{},valueGetter:this.createValueGetter(e),doesRowPassOtherFilter:()=>!0,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context}}createFilterWrapper(e,t){var i;const s={column:e,filterPromise:null,compiledElement:null,guiPromise:De.resolve(null),compDetails:null},{filterPromise:o,compDetails:n}=this.createFilterInstance(e);return s.filterPromise=(i=o==null?void 0:o())!==null&&i!==void 0?i:null,s.compDetails=n,o&&this.putIntoGui(s,t),s}putIntoGui(e,t){const i=document.createElement("div");i.className="ag-filter",e.guiPromise=new De(s=>{e.filterPromise.then(o=>{let n=o.getGui();R(n)||console.warn(`AG Grid: getGui method from filter returned ${n}, it should be a DOM element or an HTML template string.`),typeof n=="string"&&(n=fe(n)),i.appendChild(n),s(i);const r={type:u.EVENT_FILTER_OPENED,column:e.column,source:t,eGui:i};this.eventService.dispatchEvent(r)})})}onColumnsChanged(){const e=[];this.allColumnFilters.forEach((t,i)=>{let s;t.column.isPrimary()?s=this.columnModel.getPrimaryColumn(i):s=this.columnModel.getGridColumn(i),!s&&(e.push(t.column),this.disposeFilterWrapper(t,"columnChanged"),this.disposeColumnListener(i))}),e.length>0?this.onFilterChanged({columns:e}):this.updateDependantFilters()}updateDependantFilters(){const e=this.columnModel.getGroupAutoColumns();e==null||e.forEach(t=>{t.getColDef().filter==="agGroupColumnFilter"&&this.getOrCreateFilterWrapper(t,"NO_UI")})}isFilterAllowed(e){var t,i;if(!e.isFilterAllowed())return!1;const o=this.allColumnFilters.get(e.getColId());return(i=(t=o==null?void 0:o.filterPromise)===null||t===void 0?void 0:t.resolveNow(!0,n=>{var r,a;return typeof((r=n)===null||r===void 0?void 0:r.isFilterAllowed)=="function"?(a=n)===null||a===void 0?void 0:a.isFilterAllowed():!0}))!==null&&i!==void 0?i:!0}getFloatingFilterCompDetails(e,t){const i=e.getColDef(),s=this.createFilterParams(e,i),o=this.userComponentFactory.mergeParamsWithApplicationProvidedParams(i,Nl,s);let n=this.userComponentFactory.getDefaultFloatingFilterType(i,()=>this.getDefaultFloatingFilter(e));n==null&&(n="agReadOnlyFloatingFilter");const a={column:e,filterParams:o,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:d=>{const c=this.getFilterComponent(e,"NO_UI");c!=null&&c.then(h=>{d(ki(h))})},showParentFilter:t,suppressFilterButton:!1};return this.userComponentFactory.getFloatingFilterCompDetails(i,a,n)}getCurrentFloatingFilterParentModel(e){const t=this.getFilterComponent(e,"NO_UI",!1);return t?t.resolveNow(null,i=>i&&i.getModel()):null}destroyFilter(e,t="api"){const i=e.getColId(),s=this.allColumnFilters.get(i);this.disposeColumnListener(i),s&&(this.disposeFilterWrapper(s,t),this.onFilterChanged({columns:[e]}))}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){e.filterPromise.then(i=>{(i.setModel(null)||De.resolve()).then(()=>{this.getContext().destroyBean(i),e.column.setFilterActive(!1,"filterDestroyed"),this.allColumnFilters.delete(e.column.getColId());const s={type:u.EVENT_FILTER_DESTROYED,source:t,column:e.column};this.eventService.dispatchEvent(s)})})}checkDestroyFilter(e){const t=this.allColumnFilters.get(e);if(!t)return;const i=t.column,{compDetails:s}=i.isFilterAllowed()?this.createFilterInstance(i):{compDetails:null};((n,r)=>{if(!r||!n)return!0;const{componentClass:a}=n,{componentClass:d}=r;return!(a===d||(a==null?void 0:a.render)&&(d==null?void 0:d.render)&&a.render===d.render)})(t.compDetails,s)&&this.destroyFilter(i,"columnChanged")}destroy(){super.destroy(),this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear()}};Gt.QUICK_FILTER_SEPARATOR=`
`,Ui([p("valueService")],Gt.prototype,"valueService",void 0),Ui([p("columnModel")],Gt.prototype,"columnModel",void 0),Ui([p("rowModel")],Gt.prototype,"rowModel",void 0),Ui([p("userComponentFactory")],Gt.prototype,"userComponentFactory",void 0),Ui([p("rowRenderer")],Gt.prototype,"rowRenderer",void 0),Ui([D],Gt.prototype,"init",null),Gt=xl=Ui([M("filterManager")],Gt);class Gl extends V{constructor(e,t){super(e),this.ctrl=t}getCtrl(){return this.ctrl}}var fo=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class ti extends Gl{constructor(e){super(ti.TEMPLATE,e)}postConstruct(){const e=this.getGui(),t={addOrRemoveCssClass:(i,s)=>this.addOrRemoveCssClass(i,s),addOrRemoveBodyCssClass:(i,s)=>this.eFloatingFilterBody.classList.toggle(i,s),setButtonWrapperDisplayed:i=>z(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)}setCompDetails(e){if(!e){this.destroyFloatingFilterComp(),this.compPromise=null;return}this.compPromise=e.newAgStackInstance(),this.compPromise.then(t=>this.afterCompCreated(t))}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()}}}ti.TEMPLATE=`<div class="ag-header-cell ag-floating-filter" role="gridcell" tabindex="-1">
<div ref="eFloatingFilterBody" role="presentation"></div>
<div class="ag-floating-filter-button ag-hidden" ref="eButtonWrapper" role="presentation">
<button type="button" class="ag-button ag-floating-filter-button-button" ref="eButtonShowMainFilter" tabindex="-1"></button>
</div>
</div>`,fo([O("eFloatingFilterBody")],ti.prototype,"eFloatingFilterBody",void 0),fo([O("eButtonWrapper")],ti.prototype,"eButtonWrapper",void 0),fo([O("eButtonShowMainFilter")],ti.prototype,"eButtonShowMainFilter",void 0),fo([D],ti.prototype,"postConstruct",null),fo([he],ti.prototype,"destroyFloatingFilterComp",null);var wp=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},de;(function(l){l.AUTO_HEIGHT="ag-layout-auto-height",l.NORMAL="ag-layout-normal",l.PRINT="ag-layout-print"})(de||(de={}));class xn extends T{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?de.AUTO_HEIGHT:t.print?de.PRINT:de.NORMAL;this.view.updateLayoutClasses(i,t)}getDomLayout(){var e;const t=(e=this.gridOptionsService.get("domLayout"))!==null&&e!==void 0?e:"normal";return["normal","print","autoHeight"].indexOf(t)===-1?(Y(()=>console.warn(`AG Grid: ${t} is not valid for DOM Layout, valid values are 'normal', 'autoHeight', 'print'.`),"warn about dom layout values"),"normal"):t}}wp([D],xn.prototype,"postConstruct",null);var Ci=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},we;(function(l){l[l.Vertical=0]="Vertical",l[l.Horizontal=1]="Horizontal"})(we||(we={}));var Pe;(function(l){l[l.Container=0]="Container",l[l.FakeContainer=1]="FakeContainer"})(Pe||(Pe={}));class ii extends T{constructor(e){super(),this.lastScrollSource=[null,null],this.scrollLeft=-1,this.nextScrollTop=-1,this.scrollTop=-1,this.eBodyViewport=e,this.resetLastHScrollDebounced=Ft(()=>this.lastScrollSource[we.Horizontal]=null,500),this.resetLastVScrollDebounced=Ft(()=>this.lastScrollSource[we.Vertical]=null,500)}postConstruct(){this.enableRtl=this.gridOptionsService.is("enableRtl"),this.addManagedListener(this.eventService,u.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onDisplayedColumnsWidthChanged.bind(this)),this.ctrlsService.whenReady(e=>{this.centerRowContainerCtrl=e.centerRowContainerCtrl,this.onDisplayedColumnsWidthChanged(),this.addScrollListener()})}addScrollListener(){const e=this.ctrlsService.getFakeHScrollComp(),t=this.ctrlsService.getFakeVScrollComp();this.addManagedListener(this.centerRowContainerCtrl.getViewportElement(),"scroll",this.onHScroll.bind(this)),e.onScrollCallback(this.onFakeHScroll.bind(this));const i=this.gridOptionsService.is("debounceVerticalScrollbar"),s=i?Ft(this.onVScroll.bind(this),100):this.onVScroll.bind(this),o=i?Ft(this.onFakeVScroll.bind(this),100):this.onFakeVScroll.bind(this);this.addManagedListener(this.eBodyViewport,"scroll",s),t.onScrollCallback(o)}onDisplayedColumnsWidthChanged(){this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(e){if(this.centerRowContainerCtrl==null)return;e===void 0&&(e=this.centerRowContainerCtrl.getCenterViewportScrollLeft());const i=this.enableRtl?e:-e,s=this.ctrlsService.getTopCenterRowContainerCtrl(),o=this.ctrlsService.getStickyTopCenterRowContainerCtrl(),n=this.ctrlsService.getBottomCenterRowContainerCtrl(),r=this.ctrlsService.getFakeHScrollComp();this.ctrlsService.getHeaderRowContainerCtrl().setHorizontalScroll(-i),n.setContainerTranslateX(i),s.setContainerTranslateX(i),o.setContainerTranslateX(i);const d=this.centerRowContainerCtrl.getViewportElement(),c=this.lastScrollSource[we.Horizontal]===Pe.Container;e=Math.abs(e),c?r.setScrollPosition(e):Xs(d,e,this.enableRtl)}isControllingScroll(e,t){return this.lastScrollSource[t]==null?(this.lastScrollSource[t]=e,!0):this.lastScrollSource[t]===e}onFakeHScroll(){this.isControllingScroll(Pe.FakeContainer,we.Horizontal)&&this.onHScrollCommon(Pe.FakeContainer)}onHScroll(){this.isControllingScroll(Pe.Container,we.Horizontal)&&this.onHScrollCommon(Pe.Container)}onHScrollCommon(e){const t=this.centerRowContainerCtrl.getViewportElement(),{scrollLeft:i}=t;if(this.shouldBlockScrollUpdate(we.Horizontal,i,!0))return;let s;e===Pe.Container?s=Qs(t,this.enableRtl):s=this.ctrlsService.getFakeHScrollComp().getScrollPosition(),this.doHorizontalScroll(Math.round(s)),this.resetLastHScrollDebounced()}onFakeVScroll(){this.isControllingScroll(Pe.FakeContainer,we.Vertical)&&this.onVScrollCommon(Pe.FakeContainer)}onVScroll(){this.isControllingScroll(Pe.Container,we.Vertical)&&this.onVScrollCommon(Pe.Container)}onVScrollCommon(e){let t;e===Pe.Container?t=this.eBodyViewport.scrollTop:t=this.ctrlsService.getFakeVScrollComp().getScrollPosition(),!this.shouldBlockScrollUpdate(we.Vertical,t,!0)&&(this.animationFrameService.setScrollTop(t),this.nextScrollTop=t,e===Pe.Container?this.ctrlsService.getFakeVScrollComp().setScrollPosition(t):this.eBodyViewport.scrollTop=t,this.gridOptionsService.is("suppressAnimationFrame")?this.scrollGridIfNeeded():this.animationFrameService.schedule(),this.resetLastVScrollDebounced())}doHorizontalScroll(e){const t=this.ctrlsService.getFakeHScrollComp().getScrollPosition();this.scrollLeft===e&&e===t||(this.scrollLeft=e,this.fireScrollEvent(we.Horizontal),this.horizontallyScrollHeaderCenterAndFloatingCenter(e),this.onHorizontalViewportChanged())}fireScrollEvent(e){const t={type:u.EVENT_BODY_SCROLL,direction:e===we.Horizontal?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.eventService.dispatchEvent(t),window.clearTimeout(this.scrollTimer),this.scrollTimer=void 0,this.scrollTimer=window.setTimeout(()=>{const i=Object.assign(Object.assign({},t),{type:u.EVENT_BODY_SCROLL_END});this.eventService.dispatchEvent(i)},100)}shouldBlockScrollUpdate(e,t,i=!1){return i&&!ci()?!1:e===we.Vertical?this.shouldBlockVerticalScroll(t):this.shouldBlockHorizontalScroll(t)}shouldBlockVerticalScroll(e){const t=Ys(this.eBodyViewport),{scrollHeight:i}=this.eBodyViewport;return e<0||e+t>i}shouldBlockHorizontalScroll(e){const t=this.centerRowContainerCtrl.getCenterWidth(),{scrollWidth:i}=this.centerRowContainerCtrl.getViewportElement();if(this.enableRtl&&qs()){if(e>0)return!0}else if(e<0)return!0;return Math.abs(e)+t>i}redrawRowsAfterScroll(){this.fireScrollEvent(we.Vertical)}onHorizontalViewportChanged(){this.centerRowContainerCtrl.onHorizontalViewportChanged()}checkScrollLeft(){this.scrollLeft!==this.centerRowContainerCtrl.getCenterViewportScrollLeft()&&this.onHScrollCommon(Pe.Container)}scrollGridIfNeeded(){const e=this.scrollTop!=this.nextScrollTop;return e&&(this.scrollTop=this.nextScrollTop,this.redrawRowsAfterScroll()),e}setHorizontalScrollPosition(e,t=!1){const s=this.centerRowContainerCtrl.getViewportElement().scrollWidth-this.centerRowContainerCtrl.getCenterWidth();!t&&this.shouldBlockScrollUpdate(we.Horizontal,e)&&(this.enableRtl&&qs()?e=e>0?0:s:e=Math.min(Math.max(e,0),s)),Xs(this.centerRowContainerCtrl.getViewportElement(),Math.abs(e),this.enableRtl),this.doHorizontalScroll(e)}setVerticalScrollPosition(e){this.eBodyViewport.scrollTop=e}getVScrollPosition(){return{top:this.eBodyViewport.scrollTop,bottom:this.eBodyViewport.scrollTop+this.eBodyViewport.offsetHeight}}getHScrollPosition(){return this.centerRowContainerCtrl.getHScrollPosition()}isHorizontalScrollShowing(){return this.centerRowContainerCtrl.isHorizontalScrollShowing()}scrollHorizontally(e){const t=this.centerRowContainerCtrl.getViewportElement().scrollLeft;return this.setHorizontalScrollPosition(t+e),this.centerRowContainerCtrl.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 n=this.rowModel.getRow(o);if(typeof e=="function"){if(n&&e(n)){s=o;break}}else if(e===n||e===n.data){s=o;break}}s>=0&&this.ensureIndexVisible(s,t)}ensureIndexVisible(e,t){if(this.gridOptionsService.isDomLayout("print"))return;const i=this.paginationProxy.getRowCount();if(typeof e!="number"||e<0||e>=i){console.warn("AG Grid: Invalid row index for ensureIndexVisible: "+e);return}this.gridOptionsService.is("pagination")&&!this.gridOptionsService.is("suppressPaginationPanel")||this.paginationProxy.goToPageWithIndex(e);const r=this.ctrlsService.getGridBodyCtrl().getStickyTopHeight(),a=this.paginationProxy.getRow(e);let d;do{const c=a.rowTop,h=a.rowHeight,g=this.paginationProxy.getPixelOffset(),f=a.rowTop-g,m=f+a.rowHeight,C=this.getVScrollPosition(),y=this.heightScaler.getDivStretchOffset(),v=C.top+y,E=C.bottom+y,b=E-v,_=this.heightScaler.getScrollPositionForPixel(f),F=this.heightScaler.getScrollPositionForPixel(m-b),L=Math.min((_+F)/2,f),I=v+r>f,U=E<m;let oe=null;t==="top"?oe=_:t==="bottom"?oe=F:t==="middle"?oe=L:I?oe=_-r:U&&(oe=F),oe!==null&&(this.setVerticalScrollPosition(oe),this.rowRenderer.redraw()),d=c!==a.rowTop||h!==a.rowHeight}while(d);this.animationFrameService.flushAllFrames()}ensureColumnVisible(e,t="auto"){const i=this.columnModel.getGridColumn(e);if(!i||i.isPinned()||!this.columnModel.isColumnDisplayed(i))return;const s=this.getPositionedHorizontalScroll(i,t);s!==null&&this.centerRowContainerCtrl.setCenterViewportScrollLeft(s),this.centerRowContainerCtrl.onHorizontalViewportChanged(),this.animationFrameService.flushAllFrames()}getPositionedHorizontalScroll(e,t){const{columnBeforeStart:i,columnAfterEnd:s}=this.isColumnOutsideViewport(e),o=this.centerRowContainerCtrl.getCenterWidth()<e.getActualWidth(),n=this.centerRowContainerCtrl.getCenterWidth(),r=this.enableRtl;let a=(r?i:s)||o,d=r?s:i;t!=="auto"&&(a=t==="start",d=t==="end");const c=t==="middle";if(a||d||c){const{colLeft:h,colMiddle:g,colRight:f}=this.getColumnBounds(e);return c?g-n/2:a?r?f:h:r?h-n:f-n}return null}isColumnOutsideViewport(e){const{start:t,end:i}=this.getViewportBounds(),{colLeft:s,colRight:o}=this.getColumnBounds(e),n=this.enableRtl,r=n?t>o:i<o,a=n?i<s:t>s;return{columnBeforeStart:r,columnAfterEnd:a}}getColumnBounds(e){const t=this.enableRtl,i=this.columnModel.getBodyContainerWidth(),s=e.getActualWidth(),o=e.getLeft(),n=t?-1:1,r=t?i-o:o,a=r+s*n,d=r+s/2*n;return{colLeft:r,colMiddle:d,colRight:a}}getViewportBounds(){const e=this.centerRowContainerCtrl.getCenterWidth(),t=this.centerRowContainerCtrl.getCenterViewportScrollLeft(),i=t,s=e+t;return{start:i,end:s,width:e}}}Ci([p("ctrlsService")],ii.prototype,"ctrlsService",void 0),Ci([p("animationFrameService")],ii.prototype,"animationFrameService",void 0),Ci([p("paginationProxy")],ii.prototype,"paginationProxy",void 0),Ci([p("rowModel")],ii.prototype,"rowModel",void 0),Ci([p("rowContainerHeightService")],ii.prototype,"heightScaler",void 0),Ci([p("rowRenderer")],ii.prototype,"rowRenderer",void 0),Ci([p("columnModel")],ii.prototype,"columnModel",void 0),Ci([D],ii.prototype,"postConstruct",null);class Sp{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++;let e;if(e=this.tickCount>20?200:this.tickCount>10?80:40,this.scrollVertically){const t=this.getVerticalPosition();this.tickUp&&this.setVerticalPosition(t-e),this.tickDown&&this.setVerticalPosition(t+e)}if(this.scrollHorizontally){const t=this.getHorizontalPosition();this.tickLeft&&this.setHorizontalPosition(t-e),this.tickRight&&this.setHorizontalPosition(t+e)}this.onScrollCallback&&this.onScrollCallback()}ensureCleared(){this.tickingInterval&&(window.clearInterval(this.tickingInterval),this.tickingInterval=null)}}var lt=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class $e extends T{constructor(e){super(),this.isMultiRowDrag=!1,this.isGridSorted=!1,this.isGridFiltered=!1,this.isRowGroupActive=!1,this.eContainer=e}postConstruct(){this.gridOptionsService.isRowModelType("clientSide")&&(this.clientSideRowModel=this.rowModel);const e=()=>{this.onSortChanged(),this.onFilterChanged(),this.onRowGroupChanged()};this.addManagedListener(this.eventService,u.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,u.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,u.EVENT_COLUMN_ROW_GROUP_CHANGED,this.onRowGroupChanged.bind(this)),this.addManagedListener(this.eventService,u.EVENT_MODEL_UPDATED,()=>{e()}),e(),this.ctrlsService.whenReady(()=>{const t=this.ctrlsService.getGridBodyCtrl();this.autoScrollService=new Sp({scrollContainer:t.getBodyViewportElement(),scrollAxis:"y",getVerticalPosition:()=>t.getScrollFeature().getVScrollPosition().top,setVerticalPosition:i=>t.getScrollFeature().setVerticalScrollPosition(i),onScrollCallback:()=>{this.onDragging(this.lastDraggingEvent)}})})}onSortChanged(){this.isGridSorted=this.sortController.isSortActive()}onFilterChanged(){this.isGridFiltered=this.filterManager.isAnyFilterPresent()}onRowGroupChanged(){const e=this.columnModel.getRowGroupColumns();this.isRowGroupActive=!Ve(e)}getContainer(){return this.eContainer}isInterestedIn(e){return e===Oe.RowDrag}getIconName(){return this.gridOptionsService.is("rowDragManaged")&&this.shouldPreventRowMove()?q.ICON_NOT_ALLOWED:q.ICON_MOVE}shouldPreventRowMove(){return this.isGridSorted||this.isGridFiltered||this.isRowGroupActive}getRowNodes(e){if(!this.isFromThisGrid(e))return e.dragItem.rowNodes||[];const t=this.gridOptionsService.is("rowDragMultiRow"),i=[...this.selectionService.getSelectedNodes()].sort((o,n)=>o.rowIndex==null||n.rowIndex==null?0:this.getRowIndexNumber(o)-this.getRowIndexNumber(n)),s=e.dragItem.rowNode;return t&&i.indexOf(s)!==-1?(this.isMultiRowDrag=!0,i):(this.isMultiRowDrag=!1,[s])}onDragEnter(e){e.dragItem.rowNodes=this.getRowNodes(e),this.dispatchGridEvent(u.EVENT_ROW_DRAG_ENTER,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.gridOptionsService.getDomDataKey()}isDropZoneWithinThisGrid(e){const i=this.ctrlsService.getGridBodyCtrl().getGui(),{dropZoneTarget:s}=e;return!i.contains(s)}onEnterOrDragging(e){this.dispatchGridEvent(u.EVENT_ROW_DRAG_MOVE,e),this.lastDraggingEvent=e;const t=this.mouseEventService.getNormalisedPosition(e).y;this.gridOptionsService.is("rowDragManaged")&&this.doManagedDrag(e,t),this.autoScrollService.check(e.event)}doManagedDrag(e,t){const i=this.isFromThisGrid(e),s=this.gridOptionsService.is("rowDragManaged"),o=e.dragItem.rowNodes;s&&this.shouldPreventRowMove()||(this.gridOptionsService.is("suppressMoveWhenRowDragging")||!i?this.isDropZoneWithinThisGrid(e)||this.clientSideRowModel.highlightRowAtPixel(o[0],t):this.moveRows(o,t))}getRowIndexNumber(e){return parseInt(Z(e.getRowIndexString().split("-")),10)}moveRowAndClearHighlight(e){const t=this.clientSideRowModel.getLastHighlightedRowNode(),i=t&&t.highlighted===rt.Below,s=this.mouseEventService.getNormalisedPosition(e).y,o=e.dragItem.rowNodes;let n=i?1:0;if(this.isFromThisGrid(e))o.forEach(r=>{r.rowTop<s&&(n-=1)}),this.moveRows(o,s,n);else{const r=this.gridOptionsService.getCallback("getRowId");let a=this.clientSideRowModel.getRowIndexAtPixel(s)+1;this.clientSideRowModel.getHighlightPosition(s)===rt.Above&&a--,this.clientSideRowModel.updateRowData({add:o.map(d=>d.data).filter(d=>!this.clientSideRowModel.getRowNode(r?r({data:d,level:0}):d.id)),addIndex:a})}this.clearRowHighlight()}clearRowHighlight(){this.clientSideRowModel.highlightRowAtPixel(null)}moveRows(e,t,i=0){this.clientSideRowModel.ensureRowsAtPixel(e,t,i)&&(this.focusService.clearFocusedCell(),this.rangeService&&this.rangeService.removeAllCellRanges())}addRowDropZone(e){if(!e.getContainer()){Y(()=>console.warn("AG Grid: addRowDropZone - A container target needs to be provided"),"add-drop-zone-empty-target");return}if(this.dragAndDropService.findExternalZone(e)){console.warn("AG Grid: addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.");return}let t={getContainer:e.getContainer};e.fromGrid?(e.fromGrid=void 0,t=e):(e.onDragEnter&&(t.onDragEnter=i=>{e.onDragEnter(this.draggingToRowDragEvent(u.EVENT_ROW_DRAG_ENTER,i))}),e.onDragLeave&&(t.onDragLeave=i=>{e.onDragLeave(this.draggingToRowDragEvent(u.EVENT_ROW_DRAG_LEAVE,i))}),e.onDragging&&(t.onDragging=i=>{e.onDragging(this.draggingToRowDragEvent(u.EVENT_ROW_DRAG_MOVE,i))}),e.onDragStop&&(t.onDragStop=i=>{e.onDragStop(this.draggingToRowDragEvent(u.EVENT_ROW_DRAG_END,i))})),this.dragAndDropService.addDropTarget(Object.assign({isInterestedIn:i=>i===Oe.RowDrag,getIconName:()=>q.ICON_MOVE,external:!0},t))}getRowDropZone(e){const t=this.getContainer.bind(this),i=this.onDragEnter.bind(this),s=this.onDragLeave.bind(this),o=this.onDragging.bind(this),n=this.onDragStop.bind(this);return e?{getContainer:t,onDragEnter:e.onDragEnter?r=>{i(r),e.onDragEnter(this.draggingToRowDragEvent(u.EVENT_ROW_DRAG_ENTER,r))}:i,onDragLeave:e.onDragLeave?r=>{s(r),e.onDragLeave(this.draggingToRowDragEvent(u.EVENT_ROW_DRAG_LEAVE,r))}:s,onDragging:e.onDragging?r=>{o(r),e.onDragging(this.draggingToRowDragEvent(u.EVENT_ROW_DRAG_MOVE,r))}:o,onDragStop:e.onDragStop?r=>{n(r),e.onDragStop(this.draggingToRowDragEvent(u.EVENT_ROW_DRAG_END,r))}:n,fromGrid:!0}:{getContainer:t,onDragEnter:i,onDragLeave:s,onDragging:o,onDragStop:n,fromGrid:!0}}draggingToRowDragEvent(e,t){const i=this.mouseEventService.getNormalisedPosition(t).y,s=i>this.paginationProxy.getCurrentPageHeight();let o=-1,n;s||(o=this.rowModel.getRowIndexAtPixel(i),n=this.rowModel.getRow(o));let r;switch(t.vDirection){case fs.Down:r="down";break;case fs.Up:r="up";break;default:r=null;break}return{type:e,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context,event:t.event,node:t.dragItem.rowNode,nodes:t.dragItem.rowNodes,overIndex:o,overNode:n,y:i,vDirection:r}}dispatchGridEvent(e,t){const i=this.draggingToRowDragEvent(e,t);this.eventService.dispatchEvent(i)}onDragLeave(e){this.dispatchGridEvent(u.EVENT_ROW_DRAG_LEAVE,e),this.stopDragging(e),this.gridOptionsService.is("rowDragManaged")&&this.clearRowHighlight(),this.isFromThisGrid(e)&&(this.isMultiRowDrag=!1)}onDragStop(e){this.dispatchGridEvent(u.EVENT_ROW_DRAG_END,e),this.stopDragging(e),this.gridOptionsService.is("rowDragManaged")&&(this.gridOptionsService.is("suppressMoveWhenRowDragging")||!this.isFromThisGrid(e))&&!this.isDropZoneWithinThisGrid(e)&&this.moveRowAndClearHighlight(e)}stopDragging(e){this.autoScrollService.ensureCleared(),this.getRowNodes(e).forEach(t=>{t.setDragging(!1)})}}lt([p("dragAndDropService")],$e.prototype,"dragAndDropService",void 0),lt([p("rowModel")],$e.prototype,"rowModel",void 0),lt([p("paginationProxy")],$e.prototype,"paginationProxy",void 0),lt([p("columnModel")],$e.prototype,"columnModel",void 0),lt([p("focusService")],$e.prototype,"focusService",void 0),lt([p("sortController")],$e.prototype,"sortController",void 0),lt([p("filterManager")],$e.prototype,"filterManager",void 0),lt([p("selectionService")],$e.prototype,"selectionService",void 0),lt([p("mouseEventService")],$e.prototype,"mouseEventService",void 0),lt([p("ctrlsService")],$e.prototype,"ctrlsService",void 0),lt([X("rangeService")],$e.prototype,"rangeService",void 0),lt([D],$e.prototype,"postConstruct",null);var Ke=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},ws;(function(l){l.ANIMATION_ON="ag-row-animation",l.ANIMATION_OFF="ag-row-no-animation"})(ws||(ws={}));const cc="ag-force-vertical-scroll",Ep="ag-selectable",yp="ag-column-moving";class Ie extends T{constructor(){super(...arguments),this.stickyTopHeight=0}getScrollFeature(){return this.bodyScrollFeature}getBodyViewportElement(){return this.eBodyViewport}setComp(e,t,i,s,o,n){this.comp=e,this.eGridBody=t,this.eBodyViewport=i,this.eTop=s,this.eBottom=o,this.eStickyTop=n,this.setCellTextSelection(this.gridOptionsService.is("enableCellTextSelection")),this.createManagedBean(new xn(this.comp)),this.bodyScrollFeature=this.createManagedBean(new ii(this.eBodyViewport)),this.addRowDragListener(),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([s,i,o,n]),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.ctrlsService.registerGridBodyCtrl(this)}getComp(){return this.comp}addEventListeners(){this.addManagedListener(this.eventService,u.EVENT_GRID_COLUMNS_CHANGED,this.onGridColumnsChanged.bind(this)),this.addManagedListener(this.eventService,u.EVENT_SCROLL_VISIBILITY_CHANGED,this.onScrollVisibilityChanged.bind(this)),this.addManagedListener(this.eventService,u.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedListener(this.eventService,u.EVENT_HEADER_HEIGHT_CHANGED,this.onHeaderHeightChanged.bind(this))}addFocusListeners(e){e.forEach(t=>{this.addManagedListener(t,"focusin",i=>{const{target:s}=i,o=_i(s,"ag-root",t);t.classList.toggle("ag-has-focus",!o)}),this.addManagedListener(t,"focusout",i=>{const{target:s,relatedTarget:o}=i,n=t.contains(o),r=_i(o,"ag-root",t);_i(s,"ag-root",t)||(!n||r)&&t.classList.remove("ag-has-focus")})})}setColumnMovingCss(e){this.comp.setColumnMovingCss(yp,e)}setCellTextSelection(e=!1){this.comp.setCellSelectableCss(Ep,e)}onScrollVisibilityChanged(){const e=this.scrollVisibleService.isVerticalScrollShowing();this.setVerticalScrollPaddingVisible(e),this.setStickyTopWidth(e);const t=e&&this.gridOptionsService.getScrollbarWidth()||0,i=as()?16:0,s=`calc(100% + ${t+i}px)`;this.animationFrameService.requestAnimationFrame(()=>this.comp.setBodyViewportWidth(s))}onGridColumnsChanged(){const e=this.columnModel.getAllGridColumns();this.comp.setColumnCount(e?e.length:0)}disableBrowserDragging(){this.addManagedListener(this.eGridBody,"dragstart",e=>{if(e.target instanceof HTMLImageElement)return e.preventDefault(),!1})}addStopEditingWhenGridLosesFocus(){if(!this.gridOptionsService.is("stopEditingWhenCellsLoseFocus"))return;const e=i=>{const s=i.relatedTarget;if(bn(s)===null){this.rowRenderer.stopEditing();return}let o=t.some(n=>n.contains(s))&&this.mouseEventService.isElementInThisGrid(s);if(!o){const n=this.popupService;o=n.getActivePopups().some(r=>r.contains(s))||n.isElementWithinCustomPopup(s)}o||this.rowRenderer.stopEditing()},t=[this.eBodyViewport,this.eBottom,this.eTop,this.eStickyTop];t.forEach(i=>this.addManagedListener(i,"focusout",e))}updateRowCount(){const e=this.headerNavigationService.getHeaderRowCount(),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.gridOptionsService.is("alwaysShowVerticalScroll"),t=e?cc:null,i=this.gridOptionsService.isDomLayout("normal");return this.comp.setAlwaysVerticalScrollClass(t,e),e||i&&Pd(this.eBodyViewport)}setupRowAnimationCssClass(){const e=()=>{const t=this.gridOptionsService.isAnimateRows()&&!this.rowContainerHeightService.isStretching(),i=t?ws.ANIMATION_ON:ws.ANIMATION_OFF;this.comp.setRowAnimationCssOnBodyViewport(i,t)};e(),this.addManagedListener(this.eventService,u.EVENT_HEIGHT_SCALE_CHANGED,e),this.addManagedPropertyListener("animateRows",e)}getGridBodyElement(){return this.eGridBody}addBodyViewportListener(){const e=this.onBodyViewportContextMenu.bind(this);this.addManagedListener(this.eBodyViewport,"contextmenu",e),this.mockContextMenuForIPad(e),this.addManagedListener(this.eBodyViewport,"wheel",this.onBodyViewportWheel.bind(this)),this.addManagedListener(this.eStickyTop,"wheel",this.onStickyTopWheel.bind(this)),this.addFullWidthContainerWheelListener()}addFullWidthContainerWheelListener(){const e=this.eBodyViewport.querySelector(".ag-full-width-container"),t=this.eBodyViewport.querySelector(".ag-center-cols-viewport");e&&t&&this.addManagedListener(e,"wheel",i=>this.onFullWidthContainerWheel(i,t))}onFullWidthContainerWheel(e,t){!e.deltaX||Math.abs(e.deltaY)>Math.abs(e.deltaX)||!this.mouseEventService.isEventFromThisGrid(e)||(e.preventDefault(),t.scrollBy({left:e.deltaX}))}onBodyViewportContextMenu(e,t,i){if(!e&&!i)return;this.gridOptionsService.is("preventDefaultOnContextMenu")&&(e||i).preventDefault();const{target:s}=e||t;if(s===this.eBodyViewport||s===this.ctrlsService.getCenterRowContainerCtrl().getViewportElement()){if(!this.contextMenuFactory)return;e?this.contextMenuFactory.onContextMenu(e,null,null,null,null,this.eGridBody):i&&this.contextMenuFactory.onContextMenu(null,i,null,null,null,this.eGridBody)}}mockContextMenuForIPad(e){if(!ci())return;const t=new re(this.eBodyViewport),i=s=>{e(void 0,s.touchStart,s.touchEvent)};this.addManagedListener(t,re.EVENT_LONG_TAP,i),this.addDestroyFunc(()=>t.destroy())}onBodyViewportWheel(e){this.gridOptionsService.is("suppressScrollWhenPopupsAreOpen")&&this.popupService.hasAnchoredPopup()&&e.preventDefault()}onStickyTopWheel(e){e.preventDefault(),e.offsetY&&this.scrollVertically(e.deltaY)}getGui(){return this.eGridBody}scrollVertically(e){const t=this.eBodyViewport.scrollTop;return this.bodyScrollFeature.setVerticalScrollPosition(t+e),this.eBodyViewport.scrollTop-t}addRowDragListener(){this.rowDragFeature=this.createManagedBean(new $e(this.eBodyViewport)),this.dragAndDropService.addDropTarget(this.rowDragFeature)}getRowDragFeature(){return this.rowDragFeature}onPinnedRowDataChanged(){this.setFloatingHeights()}setFloatingHeights(){const{pinnedRowModel:e}=this;let t=e.getPinnedTopTotalHeight();t&&(t+=1);let i=e.getPinnedBottomTotalHeight();i&&(i+=1),this.comp.setTopHeight(t),this.comp.setBottomHeight(i),this.comp.setTopDisplay(t?"inherit":"none"),this.comp.setBottomDisplay(i?"inherit":"none"),this.setStickyTopOffsetTop()}setStickyTopHeight(e=0){this.comp.setStickyTopHeight(`${e}px`),this.stickyTopHeight=e}getStickyTopHeight(){return this.stickyTopHeight}setStickyTopWidth(e){if(!e)this.comp.setStickyTopWidth("100%");else{const t=this.gridOptionsService.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${t}px)`)}}onHeaderHeightChanged(){this.setStickyTopOffsetTop()}setStickyTopOffsetTop(){const t=this.ctrlsService.getGridHeaderCtrl().getHeaderHeight(),i=this.pinnedRowModel.getPinnedTopTotalHeight();let s=0;t>0&&(s+=t+1),i>0&&(s+=i+1),this.comp.setStickyTopTop(`${s}px`)}sizeColumnsToFit(e,t){const s=this.isVerticalScrollShowing()?this.gridOptionsService.getScrollbarWidth():0,n=On(this.eGridBody)-s;if(n>0){this.columnModel.sizeColumnsToFit(n,"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):console.warn("AG Grid: tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?")}addScrollEventListener(e){this.eBodyViewport.addEventListener("scroll",e,{passive:!0})}removeScrollEventListener(e){this.eBodyViewport.removeEventListener("scroll",e)}}Ke([p("animationFrameService")],Ie.prototype,"animationFrameService",void 0),Ke([p("rowContainerHeightService")],Ie.prototype,"rowContainerHeightService",void 0),Ke([p("ctrlsService")],Ie.prototype,"ctrlsService",void 0),Ke([p("columnModel")],Ie.prototype,"columnModel",void 0),Ke([p("scrollVisibleService")],Ie.prototype,"scrollVisibleService",void 0),Ke([X("contextMenuFactory")],Ie.prototype,"contextMenuFactory",void 0),Ke([p("headerNavigationService")],Ie.prototype,"headerNavigationService",void 0),Ke([p("dragAndDropService")],Ie.prototype,"dragAndDropService",void 0),Ke([p("pinnedRowModel")],Ie.prototype,"pinnedRowModel",void 0),Ke([p("rowRenderer")],Ie.prototype,"rowRenderer",void 0),Ke([p("popupService")],Ie.prototype,"popupService",void 0),Ke([p("mouseEventService")],Ie.prototype,"mouseEventService",void 0),Ke([p("rowModel")],Ie.prototype,"rowModel",void 0);var Gn;(function(l){l[l.FILL=0]="FILL",l[l.RANGE=1]="RANGE"})(Gn||(Gn={}));var Ss;(function(l){l[l.VALUE=0]="VALUE",l[l.DIMENSION=1]="DIMENSION"})(Ss||(Ss={}));const Co="ag-cell-range-selected",Rp="ag-cell-range-chart",bp="ag-cell-range-single-cell",Tp="ag-cell-range-chart-category",Dp="ag-cell-range-handle",Op="ag-cell-range-top",Pp="ag-cell-range-right",Ap="ag-cell-range-bottom",Fp="ag-cell-range-left";class Lp{constructor(e,t){this.beans=e,this.cellCtrl=t}setComp(e,t){this.cellComp=e,this.eGui=t,this.onRangeSelectionChanged()}onRangeSelectionChanged(){this.cellComp&&(this.rangeCount=this.beans.rangeService.getCellRangeCount(this.cellCtrl.getCellPosition()),this.hasChartRange=this.getHasChartRange(),this.cellComp.addOrRemoveCssClass(Co,this.rangeCount!==0),this.cellComp.addOrRemoveCssClass(`${Co}-1`,this.rangeCount===1),this.cellComp.addOrRemoveCssClass(`${Co}-2`,this.rangeCount===2),this.cellComp.addOrRemoveCssClass(`${Co}-3`,this.rangeCount===3),this.cellComp.addOrRemoveCssClass(`${Co}-4`,this.rangeCount>=4),this.cellComp.addOrRemoveCssClass(Rp,this.hasChartRange),ls(this.eGui,this.rangeCount>0?!0:void 0),this.cellComp.addOrRemoveCssClass(bp,this.isSingleCell()),this.updateRangeBorders(),this.refreshHandle())}updateRangeBorders(){const e=this.getRangeBorders(),t=this.isSingleCell(),i=!t&&e.top,s=!t&&e.right,o=!t&&e.bottom,n=!t&&e.left;this.cellComp.addOrRemoveCssClass(Op,i),this.cellComp.addOrRemoveCssClass(Pp,s),this.cellComp.addOrRemoveCssClass(Ap,o),this.cellComp.addOrRemoveCssClass(Fp,n)}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=>Ze([Ss.DIMENSION,Ss.VALUE],i.type))}updateRangeBordersIfRangeCount(){this.rangeCount>0&&(this.updateRangeBorders(),this.refreshHandle())}getRangeBorders(){const e=this.beans.gridOptionsService.is("enableRtl");let t=!1,i=!1,s=!1,o=!1;const n=this.cellCtrl.getCellPosition().column,{rangeService:r,columnModel:a}=this.beans;let d,c;e?(d=a.getDisplayedColAfter(n),c=a.getDisplayedColBefore(n)):(d=a.getDisplayedColBefore(n),c=a.getDisplayedColAfter(n));const h=r.getCellRanges().filter(g=>r.isCellInSpecificRange(this.cellCtrl.getCellPosition(),g));d||(o=!0),c||(i=!0);for(let g=0;g<h.length&&!(t&&i&&s&&o);g++){const f=h[g],m=r.getRangeStartRow(f),C=r.getRangeEndRow(f);!t&&this.beans.rowPositionUtils.sameRow(m,this.cellCtrl.getCellPosition())&&(t=!0),!s&&this.beans.rowPositionUtils.sameRow(C,this.cellCtrl.getCellPosition())&&(s=!0),!o&&d&&f.columns.indexOf(d)<0&&(o=!0),!i&&c&&f.columns.indexOf(c)<0&&(i=!0)}return{top:t,right:i,bottom:s,left:o}}refreshHandle(){if(!this.beans.rangeService)return;const e=this.shouldHaveSelectionHandle();this.selectionHandle&&!e&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),e&&this.addSelectionHandle(),this.cellComp.addOrRemoveCssClass(Dp,!!this.selectionHandle)}shouldHaveSelectionHandle(){const{gridOptionsService:e,rangeService:t}=this.beans,i=t.getCellRanges(),s=i.length;if(this.rangeCount<1||s<1)return!1;const o=Z(i),n=this.cellCtrl.getCellPosition(),r=e.is("enableFillHandle")&&!this.cellCtrl.isSuppressFillHandle(),a=e.is("enableRangeHandle");let d=s===1&&!this.cellCtrl.isEditing()&&(r||a);if(this.hasChartRange){const h=i[0].type===Ss.DIMENSION&&t.isCellInSpecificRange(n,i[0]);this.cellComp.addOrRemoveCssClass(Tp,h),d=o.type===Ss.VALUE}return d&&o.endRow!=null&&t.isContiguousRange(o)&&t.isBottomRightCell(o,n)}addSelectionHandle(){const{gridOptionsService:e,rangeService:t}=this.beans,i=Z(t.getCellRanges()).type,o=e.is("enableFillHandle")&&x(i)?Gn.FILL:Gn.RANGE;this.selectionHandle&&this.selectionHandle.getType()!==o&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),this.selectionHandle||(this.selectionHandle=this.beans.selectionHandleFactory.createSelectionHandle(o)),this.selectionHandle.refresh(this.cellCtrl)}destroy(){this.beans.context.destroyBean(this.selectionHandle)}}class Ip extends T{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode(),this.setupColSpan(),this.setupRowSpan()}setupRowSpan(){this.rowSpan=this.column.getRowSpan(this.rowNode)}setComp(e){this.eGui=e,this.onLeftChanged(),this.onWidthChanged(),this.applyRowSpan()}onDisplayColumnsChanged(){const e=this.getColSpanningList();ai(this.colsSpanning,e)||(this.colsSpanning=e,this.onWidthChanged(),this.onLeftChanged())}setupColSpan(){this.column.getColDef().colSpan!=null&&(this.colsSpanning=this.getColSpanningList(),this.addManagedListener(this.beans.eventService,u.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayColumnsChanged.bind(this)),this.addManagedListener(this.beans.eventService,u.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onWidthChanged.bind(this)))}onWidthChanged(){if(!this.eGui)return;const e=this.getCellWidth();this.eGui.style.width=`${e}px`}getCellWidth(){return this.colsSpanning?this.colsSpanning.reduce((e,t)=>e+t.getActualWidth(),0):this.column.getActualWidth()}getColSpanningList(){const e=this.column.getColSpan(this.rowNode),t=[];if(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.columnModel.getDisplayedColAfter(i),!(!i||x(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.gridOptionsService.is("enableRtl")&&this.colsSpanning?e=Z(this.colsSpanning):e=this.column,e.getLeft()}modifyLeftForPrintLayout(e){if(!this.cellCtrl.isPrintLayout()||this.column.getPinned()==="left")return e;const t=this.beans.columnModel.getDisplayedColumnsLeftWidth();if(this.column.getPinned()==="right"){const i=this.beans.columnModel.getBodyContainerWidth();return t+i+(e||0)}return t+(e||0)}applyRowSpan(){if(this.rowSpan===1)return;const t=this.beans.gridOptionsService.getRowHeightAsNumber()*this.rowSpan;this.eGui.style.height=`${t}px`,this.eGui.style.zIndex="1"}destroy(){super.destroy()}}class Mp extends T{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(),t={value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,colDef:e,column:this.column,rowIndex:this.rowNode.rowIndex,api:this.beans.gridOptionsService.api,columnApi:this.beans.gridOptionsService.columnApi,context:this.beans.gridOptionsService.context};this.beans.stylingService.processClassRules(e.cellClassRules,t,i=>this.cellComp.addOrRemoveCssClass(i,!0),i=>this.cellComp.addOrRemoveCssClass(i,!1))}applyUserStyles(){const e=this.column.getColDef();if(!e.cellStyle)return;let t;if(typeof e.cellStyle=="function"){const i={column:this.column,value:this.cellCtrl.getValue(),colDef:e,data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex,api:this.beans.gridOptionsService.api,columnApi:this.beans.gridOptionsService.columnApi,context:this.beans.gridOptionsService.context},s=e.cellStyle;t=s(i)}else t=e.cellStyle;t&&this.cellComp.setUserStyles(t)}applyClassesFromColDef(){const e=this.column.getColDef(),t={value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,column:this.column,colDef:e,rowIndex:this.rowNode.rowIndex,api:this.beans.gridOptionsService.api,columnApi:this.beans.gridOptionsService.columnApi,context:this.beans.gridOptionsService.context};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()}}class Hl extends T{constructor(e,t){super(),this.ctrl=e,this.beans=t}setComp(e){this.comp=e,this.setupTooltip()}setupTooltip(){this.browserTooltips=this.beans.gridOptionsService.is("enableBrowserTooltips"),this.updateTooltipText(),this.browserTooltips?this.comp.setTitle(this.tooltip!=null?this.tooltip:void 0):this.createTooltipFeatureIfNeeded()}updateTooltipText(){this.tooltip=this.ctrl.getTooltipValue()}createTooltipFeatureIfNeeded(){if(this.genericTooltipFeature!=null)return;const e={getTooltipParams:()=>this.getTooltipParams(),getGui:()=>this.ctrl.getGui()};this.genericTooltipFeature=this.createManagedBean(new Zt(e),this.beans.context)}refreshToolTip(){this.updateTooltipText(),this.browserTooltips&&this.comp.setTitle(this.tooltip!=null?this.tooltip:void 0)}getTooltipParams(){const e=this.ctrl,t=e.getColumn?e.getColumn():void 0,i=e.getColDef?e.getColDef():void 0,s=e.getRowNode?e.getRowNode():void 0;return{location:e.getLocation(),colDef:i,column:t,rowIndex:e.getRowIndex?e.getRowIndex():void 0,node:s,data:s?s.data:void 0,value:this.getTooltipText(),valueFormatted:e.getValueFormatted?e.getValueFormatted():void 0}}getTooltipText(){return this.tooltip}destroy(){super.destroy()}}var W=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let B=class{postConstruct(){this.doingMasterDetail=this.gridOptionsService.isMasterDetail(),this.gridOptionsService.isRowModelType("clientSide")&&(this.clientSideRowModel=this.rowModel),this.gridOptionsService.isRowModelType("serverSide")&&(this.serverSideRowModel=this.rowModel)}};W([p("resizeObserverService")],B.prototype,"resizeObserverService",void 0),W([p("paginationProxy")],B.prototype,"paginationProxy",void 0),W([p("context")],B.prototype,"context",void 0),W([p("columnApi")],B.prototype,"columnApi",void 0),W([p("gridApi")],B.prototype,"gridApi",void 0),W([p("gridOptionsService")],B.prototype,"gridOptionsService",void 0),W([p("expressionService")],B.prototype,"expressionService",void 0),W([p("environment")],B.prototype,"environment",void 0),W([p("rowRenderer")],B.prototype,"rowRenderer",void 0),W([p("templateService")],B.prototype,"templateService",void 0),W([p("valueService")],B.prototype,"valueService",void 0),W([p("eventService")],B.prototype,"eventService",void 0),W([p("columnModel")],B.prototype,"columnModel",void 0),W([p("headerNavigationService")],B.prototype,"headerNavigationService",void 0),W([p("navigationService")],B.prototype,"navigationService",void 0),W([p("columnAnimationService")],B.prototype,"columnAnimationService",void 0),W([X("rangeService")],B.prototype,"rangeService",void 0),W([p("focusService")],B.prototype,"focusService",void 0),W([X("contextMenuFactory")],B.prototype,"contextMenuFactory",void 0),W([p("popupService")],B.prototype,"popupService",void 0),W([p("valueFormatterService")],B.prototype,"valueFormatterService",void 0),W([p("stylingService")],B.prototype,"stylingService",void 0),W([p("columnHoverService")],B.prototype,"columnHoverService",void 0),W([p("userComponentFactory")],B.prototype,"userComponentFactory",void 0),W([p("userComponentRegistry")],B.prototype,"userComponentRegistry",void 0),W([p("animationFrameService")],B.prototype,"animationFrameService",void 0),W([p("dragService")],B.prototype,"dragService",void 0),W([p("dragAndDropService")],B.prototype,"dragAndDropService",void 0),W([p("sortController")],B.prototype,"sortController",void 0),W([p("filterManager")],B.prototype,"filterManager",void 0),W([p("rowContainerHeightService")],B.prototype,"rowContainerHeightService",void 0),W([p("frameworkOverrides")],B.prototype,"frameworkOverrides",void 0),W([p("cellPositionUtils")],B.prototype,"cellPositionUtils",void 0),W([p("rowPositionUtils")],B.prototype,"rowPositionUtils",void 0),W([p("selectionService")],B.prototype,"selectionService",void 0),W([X("selectionHandleFactory")],B.prototype,"selectionHandleFactory",void 0),W([p("rowCssClassCalculator")],B.prototype,"rowCssClassCalculator",void 0),W([p("rowModel")],B.prototype,"rowModel",void 0),W([p("ctrlsService")],B.prototype,"ctrlsService",void 0),W([p("ctrlsFactory")],B.prototype,"ctrlsFactory",void 0),W([p("agStackComponentsRegistry")],B.prototype,"agStackComponentsRegistry",void 0),W([p("valueCache")],B.prototype,"valueCache",void 0),W([p("rowNodeEventThrottle")],B.prototype,"rowNodeEventThrottle",void 0),W([p("localeService")],B.prototype,"localeService",void 0),W([p("valueParserService")],B.prototype,"valueParserService",void 0),W([D],B.prototype,"postConstruct",null),B=W([M("beans")],B);class Np extends B{constructor(e,t,i){super(),this.cellCtrl=e,this.beans=t,this.column=i}onMouseEvent(e,t){if(!Lt(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,gridOptionsService:s}=this.beans,o=e.ctrlKey||e.metaKey;i&&o&&i.getCellRangeCount(this.cellCtrl.getCellPosition())>1&&i.intersectLastRange(!0);const n=this.cellCtrl.createEvent(e,u.EVENT_CELL_CLICKED);t.dispatchEvent(n);const r=this.column.getColDef();r.onCellClicked&&window.setTimeout(()=>r.onCellClicked(n),0),(s.is("singleClickEdit")||r.singleClickEdit)&&!s.is("suppressClickEdit")&&this.cellCtrl.startRowOrCellEdit()}isDoubleClickOnIPad(){if(!ci()||_r("dblclick"))return!1;const e=new Date().getTime(),t=e-this.lastIPadMouseClickEvent<200;return this.lastIPadMouseClickEvent=e,t}onCellDoubleClicked(e){const t=this.column.getColDef(),i=this.cellCtrl.createEvent(e,u.EVENT_CELL_DOUBLE_CLICKED);this.beans.eventService.dispatchEvent(i),typeof t.onCellDoubleClicked=="function"&&window.setTimeout(()=>t.onCellDoubleClicked(i),0),!this.beans.gridOptionsService.is("singleClickEdit")&&!this.beans.gridOptionsService.is("suppressClickEdit")&&this.cellCtrl.startRowOrCellEdit(null,e)}onMouseDown(e){const{ctrlKey:t,metaKey:i,shiftKey:s}=e,o=e.target,{eventService:n,rangeService:r}=this.beans;if(this.isRightClickInExistingRange(e))return;const a=r&&r.getCellRanges().length!=0;if(!s||!a){const d=it()&&!this.cellCtrl.isEditing()&&!ll(o);this.cellCtrl.focusCell(d)}if(s&&a&&e.preventDefault(),!this.containsWidget(o)){if(r){const d=this.cellCtrl.getCellPosition();if(s)r.extendLatestRangeToCell(d);else{const c=t||i;r.setRangeToCell(d,c)}}n.dispatchEvent(this.cellCtrl.createEvent(e,u.EVENT_CELL_MOUSE_DOWN))}}isRightClickInExistingRange(e){const{rangeService:t}=this.beans;return!!(t&&t.isCellInAnyRange(this.cellCtrl.getCellPosition())&&e.button===2)}containsWidget(e){return _i(e,"ag-selection-checkbox",3)}onMouseOut(e){if(this.mouseStayingInsideCell(e))return;const t=this.cellCtrl.createEvent(e,u.EVENT_CELL_MOUSE_OUT);this.beans.eventService.dispatchEvent(t),this.beans.columnHoverService.clearMouseOver()}onMouseOver(e){if(this.mouseStayingInsideCell(e))return;const t=this.cellCtrl.createEvent(e,u.EVENT_CELL_MOUSE_OVER);this.beans.eventService.dispatchEvent(t),this.beans.columnHoverService.setMouseOver([this.column])}mouseStayingInsideCell(e){if(!e.target||!e.relatedTarget)return!1;const t=this.cellCtrl.getGui(),i=t.contains(e.target),s=t.contains(e.relatedTarget);return i&&s}destroy(){}}class _p extends T{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 w.ENTER:this.onEnterKeyDown(e);break;case w.F2:this.onF2KeyDown(e);break;case w.ESCAPE:this.onEscapeKeyDown(e);break;case w.TAB:this.onTabKeyDown(e);break;case w.BACKSPACE:case w.DELETE:this.onBackspaceOrDeleteKeyDown(t,e);break;case w.DOWN:case w.UP:case w.RIGHT:case w.LEFT:this.onNavigationKeyDown(e,t);break}}onNavigationKeyDown(e,t){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,{gridOptionsService:n,rangeService:r,eventService:a}=s;i.isEditing()||(a.dispatchEvent({type:u.EVENT_KEY_SHORTCUT_CHANGED_CELL_START}),Nd(e,n.is("enableCellEditingOnBackspace"))?r&&n.isEnableRangeSelection()?r.clearCellRangeCellValues({dispatchWrapperEvents:!0,wrapperEventSource:"deleteKey"}):i.isCellEditable()&&o.setDataValue(i.getColumn(),null,"cellClear"):i.startRowOrCellEdit(e,t),a.dispatchEvent({type:u.EVENT_KEY_SHORTCUT_CHANGED_CELL_END}))}onEnterKeyDown(e){if(this.cellCtrl.isEditing()||this.rowCtrl.isEditing())this.cellCtrl.stopEditingAndFocus(!1,e.shiftKey);else if(this.beans.gridOptionsService.is("enterNavigatesVertically")){const t=e.shiftKey?w.UP:w.DOWN;this.beans.navigationService.navigateToNextCell(null,t,this.cellCtrl.getCellPosition(),!1)}else this.cellCtrl.startRowOrCellEdit(w.ENTER,e),this.cellCtrl.isEditing()&&e.preventDefault()}onF2KeyDown(e){this.cellCtrl.isEditing()||this.cellCtrl.startRowOrCellEdit(w.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{gridOptionsService:t}=this.beans;if(!this.cellCtrl.isEditing()&&t.isRowSelection()){const i=this.rowNode.isSelected(),s=!i;if(s||!t.is("suppressRowDeselection")){const o=this.beans.gridOptionsService.is("groupSelectsFiltered"),n=this.rowNode.setSelectedParams({newValue:s,rangeSelect:e.shiftKey,groupSelectsFiltered:o,event:e,source:"spaceKey"});i===void 0&&n===0&&this.rowNode.setSelectedParams({newValue:!1,rangeSelect:e.shiftKey,groupSelectsFiltered:o,event:e,source:"spaceKey"})}}e.preventDefault()}destroy(){super.destroy()}}var xp=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class uc extends V{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(le("rowDrag",this.gridOptionsService,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={rowNode:this.rowNode,dragEvent:e,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context};t(s)}else i()}checkVisibility(){const e=this.column.isDndSource(this.rowNode);this.setDisplayed(e)}}xp([D],uc.prototype,"postConstruct",null);const Gp="ag-cell",Hp="ag-cell-auto-height",Vp="ag-cell-normal-height",Bp="ag-cell-focus",Wp="ag-cell-first-right-pinned",kp="ag-cell-last-left-pinned",Up="ag-cell-not-inline-editing",jp="ag-column-hover",zp="ag-cell-wrap-text";let $p=0;class St extends T{constructor(e,t,i,s){super(),this.cellRangeFeature=null,this.cellPositionFeature=null,this.cellCustomStyleFeature=null,this.tooltipFeature=null,this.cellMouseListenerFeature=null,this.cellKeyboardListenerFeature=null,this.suppressRefreshCell=!1,this.onCellCompAttachedFuncs=[],this.column=e,this.rowNode=t,this.beans=i,this.rowCtrl=s,this.instanceId=e.getId()+"-"+$p++,this.createCellPosition(),this.addFeatures()}shouldRestoreFocus(){return this.beans.focusService.shouldRestoreFocus(this.cellPosition)}addFeatures(){this.cellPositionFeature=new Ip(this,this.beans),this.addDestroyFunc(()=>{var t;(t=this.cellPositionFeature)===null||t===void 0||t.destroy(),this.cellPositionFeature=null}),this.cellCustomStyleFeature=new Mp(this,this.beans),this.addDestroyFunc(()=>{var t;(t=this.cellCustomStyleFeature)===null||t===void 0||t.destroy(),this.cellCustomStyleFeature=null}),this.cellMouseListenerFeature=new Np(this,this.beans,this.column),this.addDestroyFunc(()=>{var t;(t=this.cellMouseListenerFeature)===null||t===void 0||t.destroy(),this.cellMouseListenerFeature=null}),this.cellKeyboardListenerFeature=new _p(this,this.beans,this.column,this.rowNode,this.rowCtrl),this.addDestroyFunc(()=>{var t;(t=this.cellKeyboardListenerFeature)===null||t===void 0||t.destroy(),this.cellKeyboardListenerFeature=null}),this.beans.rangeService&&this.beans.gridOptionsService.isEnableRangeSelection()&&(this.cellRangeFeature=new Lp(this.beans,this),this.addDestroyFunc(()=>{var t;(t=this.cellRangeFeature)===null||t===void 0||t.destroy(),this.cellRangeFeature=null})),this.column.isTooltipEnabled()&&this.addTooltipFeature()}addTooltipFeature(){const t={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getRowIndex:()=>this.cellPosition.rowIndex,getRowNode:()=>this.rowNode,getGui:()=>this.getGui(),getLocation:()=>"cell",getTooltipValue:()=>{const i=this.column.getColDef(),s=this.rowNode.data;if(i.tooltipField&&R(s))return ss(s,i.tooltipField,this.column.isTooltipFieldContainsDots());const o=i.tooltipValueGetter;return o?o({location:"cell",api:this.beans.gridOptionsService.api,columnApi:this.beans.gridOptionsService.columnApi,context:this.beans.gridOptionsService.context,colDef:this.column.getColDef(),column:this.column,rowIndex:this.cellPosition.rowIndex,node:this.rowNode,data:this.rowNode.data,value:this.value,valueFormatted:this.valueFormatted}):null},getValueFormatted:()=>this.valueFormatted};this.tooltipFeature=new Hl(t,this.beans),this.addDestroyFunc(()=>{var i;(i=this.tooltipFeature)===null||i===void 0||i.destroy(),this.tooltipFeature=null})}setComp(e,t,i,s,o){var n,r,a,d;this.cellComp=e,this.eGui=t,this.printLayout=s,this.updateAndFormatValue(!0),this.addDomData(),this.onCellFocused(),this.applyStaticCssClasses(),this.setWrapText(),this.onFirstRightPinnedChanged(),this.onLastLeftPinnedChanged(),this.onColumnHover(),this.setupControlComps(),i&&this.setupAutoHeight(i),this.setAriaColIndex(),this.beans.gridOptionsService.is("suppressCellFocus")||this.cellComp.setTabIndex(-1);const c=It(this.column.getId());this.cellComp.setColId(c),this.cellComp.setRole("gridcell"),(n=this.cellPositionFeature)===null||n===void 0||n.setComp(t),(r=this.cellCustomStyleFeature)===null||r===void 0||r.setComp(e),(a=this.tooltipFeature)===null||a===void 0||a.setComp(e),(d=this.cellKeyboardListenerFeature)===null||d===void 0||d.setComp(this.eGui),this.cellRangeFeature&&this.cellRangeFeature.setComp(e,t),o&&this.isCellEditable()?this.startEditing():this.showValue(),this.onCellCompAttachedFuncs.length&&(this.onCellCompAttachedFuncs.forEach(h=>h()),this.onCellCompAttachedFuncs=[])}setupAutoHeight(e){if(!this.column.isAutoHeight())return;const t=e.parentElement,i=this.beans.gridOptionsService.getRowHeightForNode(this.rowNode).height,s=r=>{if(this.editing||!this.isAlive())return;const{paddingTop:a,paddingBottom:d,borderBottomWidth:c,borderTopWidth:h}=ui(t),g=a+d+c+h,m=e.offsetHeight+g;if(r<5){const y=this.beans.gridOptionsService.getDocument(),v=!y||!y.contains(e),E=m==0;if(v||E){this.beans.frameworkOverrides.setTimeout(()=>s(r+1),0);return}}const C=Math.max(m,i);this.rowNode.setRowAutoHeight(C,this.column)},o=()=>s(0);o();const n=this.beans.resizeObserverService.observeResize(e,o);this.addDestroyFunc(()=>{n(),this.rowNode.setRowAutoHeight(void 0,this.column)})}getInstanceId(){return this.instanceId}showValue(e=!1){const t=this.valueFormatted!=null?this.valueFormatted:this.value,i=this.createCellRendererParams(),s=this.beans.userComponentFactory.getCellRendererDetails(this.column.getColDef(),i);this.cellComp.setRenderDetails(s,t,e),this.refreshHandle()}setupControlComps(){const e=this.column.getColDef();this.includeSelection=this.isIncludeControl(e.checkboxSelection),this.includeRowDrag=this.isIncludeControl(e.rowDrag),this.includeDndSource=this.isIncludeControl(e.dndSource),this.cellComp.setIncludeSelection(this.includeSelection),this.cellComp.setIncludeDndSource(this.includeDndSource),this.cellComp.setIncludeRowDrag(this.includeRowDrag)}isForceWrapper(){return this.beans.gridOptionsService.is("enableCellTextSelection")||this.column.isAutoHeight()}isIncludeControl(e){return this.rowNode.rowPinned!=null?!1:typeof e=="function"||e===!0}refreshShouldDestroy(){const e=this.column.getColDef(),t=this.includeSelection!=this.isIncludeControl(e.checkboxSelection),i=this.includeRowDrag!=this.isIncludeControl(e.rowDrag),s=this.includeDndSource!=this.isIncludeControl(e.dndSource);return t||i||s}startEditing(e=null,t=!1,i=null){if(!this.isCellEditable()||this.editing)return;if(!this.cellComp){this.onCellCompAttachedFuncs.push(()=>{this.startEditing(e,t,i)});return}const s=this.createCellEditorParams(e,t),o=this.column.getColDef(),n=this.beans.userComponentFactory.getCellEditorDetails(o,s),r=(n==null?void 0:n.popupFromSelector)!=null?n.popupFromSelector:!!o.cellEditorPopup,a=(n==null?void 0:n.popupPositionFromSelector)!=null?n.popupPositionFromSelector:o.cellEditorPopupPosition;this.setEditing(!0),this.cellComp.setEditDetails(n,r,a);const d=this.createEvent(i,u.EVENT_CELL_EDITING_STARTED);this.beans.eventService.dispatchEvent(d)}setEditing(e){this.editing!==e&&(this.editing=e,this.refreshHandle())}stopRowOrCellEdit(e=!1){this.beans.gridOptionsService.get("editType")==="fullRow"?this.rowCtrl.stopRowEditing(e):this.stopEditing(e)}onPopupEditorClosed(){this.isEditing()&&this.stopEditingAndFocus()}takeValueFromCellEditor(e){const t={newValueExists:!1};if(e)return t;const i=this.cellComp.getCellEditor();return!i||i.isCancelAfterEnd&&i.isCancelAfterEnd()?t:{newValue:i.getValue(),newValueExists:!0}}saveNewValue(e,t){if(t===e)return!1;this.suppressRefreshCell=!0;const i=this.rowNode.setDataValue(this.column,t,"edit");return this.suppressRefreshCell=!1,i}stopEditing(e=!1){if(!this.editing)return!1;const{newValue:t,newValueExists:i}=this.takeValueFromCellEditor(e),s=this.rowNode.getValueFromValueService(this.column);let o=!1;return i&&(o=this.saveNewValue(s,t)),this.setEditing(!1),this.cellComp.setEditDetails(),this.updateAndFormatValue(),this.refreshCell({forceRefresh:!0,suppressFlash:!0}),this.dispatchEditingStoppedEvent(s,t,!e&&!!o),o}dispatchEditingStoppedEvent(e,t,i){const s=Object.assign(Object.assign({},this.createEvent(null,u.EVENT_CELL_EDITING_STOPPED)),{oldValue:e,newValue:t,valueChanged:i});this.beans.eventService.dispatchEvent(s)}createCellEditorParams(e,t){return{value:this.rowNode.getValueFromValueService(this.column),eventKey:e,column:this.column,colDef:this.column.getColDef(),rowIndex:this.getCellPosition().rowIndex,node:this.rowNode,data:this.rowNode.data,api:this.beans.gridOptionsService.api,cellStartedEdit:t,columnApi:this.beans.gridOptionsService.columnApi,context:this.beans.gridOptionsService.context,onKeyDown:this.onKeyDown.bind(this),stopEditing:this.stopEditingAndFocus.bind(this),eGridCell:this.getGui(),parseValue:this.parseValue.bind(this),formatValue:this.formatValue.bind(this)}}createCellRendererParams(){return{value:this.value,valueFormatted:this.valueFormatted,getValue:()=>this.rowNode.getValueFromValueService(this.column),setValue:t=>this.beans.valueService.setValue(this.rowNode,this.column,t),formatValue:this.formatValue.bind(this),data:this.rowNode.data,node:this.rowNode,pinned:this.column.getPinned(),colDef:this.column.getColDef(),column:this.column,rowIndex:this.getCellPosition().rowIndex,api:this.beans.gridOptionsService.api,columnApi:this.beans.gridOptionsService.columnApi,context:this.beans.gridOptionsService.context,refreshCell:this.refreshCell.bind(this),eGridCell:this.getGui(),eParentOfValue:this.cellComp.getParentOfValue(),registerRowDragger:(t,i,s,o)=>this.registerRowDragger(t,i,o)}}parseValue(e){return this.beans.valueParserService.parseValue(this.column,this.rowNode,e,this.getValue())}setFocusOutOnEditor(){if(!this.editing)return;const e=this.cellComp.getCellEditor();e&&e.focusOut&&e.focusOut()}setFocusInOnEditor(){if(!this.editing)return;const e=this.cellComp.getCellEditor();e&&e.focusIn?e.focusIn():this.focusCell(!0)}onCellChanged(e){if(!this.cellComp)return;e.column===this.column&&this.refreshCell({})}refreshCell(e){var t,i,s;if(this.suppressRefreshCell||this.editing||!this.cellComp)return;const o=this.column.getColDef(),n=e!=null&&!!e.newData,r=e!=null&&!!e.suppressFlash||!!o.suppressCellFlash,a=o.field==null&&o.valueGetter==null&&o.showRowGroup==null,d=e&&e.forceRefresh||a||n,c=this.updateAndFormatValue();if(d||c){this.showValue(n);const g=this.beans.filterManager.isSuppressFlashingCellsBecauseFiltering();!r&&!g&&(this.beans.gridOptionsService.is("enableCellChangeFlash")||o.enableCellChangeFlash)&&this.flashCell(),(t=this.cellCustomStyleFeature)===null||t===void 0||t.applyUserStyles(),(i=this.cellCustomStyleFeature)===null||i===void 0||i.applyClassesFromColDef()}this.refreshToolTip(),(s=this.cellCustomStyleFeature)===null||s===void 0||s.applyCellClassRules()}stopEditingAndFocus(e=!1,t=!1){this.stopRowOrCellEdit(),this.focusCell(!0),e||this.navigateAfterEdit(t)}navigateAfterEdit(e){if(this.beans.gridOptionsService.is("enterNavigatesVerticallyAfterEdit")){const i=e?w.UP:w.DOWN;this.beans.navigationService.navigateToNextCell(null,i,this.getCellPosition(),!1)}}flashCell(e){const t=e&&e.flashDelay,i=e&&e.fadeDelay;this.animateCell("data-changed",t,i)}animateCell(e,t,i){var s,o;const n=`ag-cell-${e}`,r=`ag-cell-${e}-animation`,{gridOptionsService:a}=this.beans;t||(t=(s=a.getNum("cellFlashDelay"))!==null&&s!==void 0?s:500),R(i)||(i=(o=a.getNum("cellFadeDelay"))!==null&&o!==void 0?o:1e3),this.cellComp.addOrRemoveCssClass(n,!0),this.cellComp.addOrRemoveCssClass(r,!1),window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(n,!1),this.cellComp.addOrRemoveCssClass(r,!0),this.eGui.style.transition=`background-color ${i}ms`,window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(r,!1),this.eGui.style.transition="")},i))},t)}onFlashCells(e){if(!this.cellComp)return;const t=this.beans.cellPositionUtils.createId(this.getCellPosition());e.cells[t]&&this.animateCell("highlight")}isCellEditable(){return this.column.isCellEditable(this.rowNode)}isSuppressFillHandle(){return this.column.isSuppressFillHandle()}formatValue(e){const t=this.callValueFormatter(e);return t??e}callValueFormatter(e){return this.beans.valueFormatterService.formatValue(this.column,this.rowNode,e)}updateAndFormatValue(e=!1){const t=this.value,i=this.valueFormatted;return this.value=this.rowNode.getValueFromValueService(this.column),this.valueFormatted=this.callValueFormatter(this.value),e?!0:!this.valuesAreEqual(t,this.value)||this.valueFormatted!=i}valuesAreEqual(e,t){const i=this.column.getColDef();return i.equals?i.equals(e,t):e===t}getComp(){return this.cellComp}getValue(){return this.value}getValueFormatted(){return this.valueFormatted}addDomData(){const e=this.getGui();this.beans.gridOptionsService.setDomData(e,St.DOM_DATA_KEY_CELL_CTRL,this),this.addDestroyFunc(()=>this.beans.gridOptionsService.setDomData(e,St.DOM_DATA_KEY_CELL_CTRL,null))}createEvent(e,t){return{type:t,node:this.rowNode,data:this.rowNode.data,value:this.value,column:this.column,colDef:this.column.getColDef(),context:this.beans.gridOptionsService.context,api:this.beans.gridApi,columnApi:this.beans.columnApi,rowPinned:this.rowNode.rowPinned,event:e,rowIndex:this.rowNode.rowIndex}}processCharacter(e){var t;(t=this.cellKeyboardListenerFeature)===null||t===void 0||t.processCharacter(e)}onKeyDown(e){var t;(t=this.cellKeyboardListenerFeature)===null||t===void 0||t.onKeyDown(e)}onMouseEvent(e,t){var i;(i=this.cellMouseListenerFeature)===null||i===void 0||i.onMouseEvent(e,t)}getGui(){return this.eGui}refreshToolTip(){var e;(e=this.tooltipFeature)===null||e===void 0||e.refreshToolTip()}getColSpanningList(){return this.cellPositionFeature.getColSpanningList()}onLeftChanged(){var e;this.cellComp&&((e=this.cellPositionFeature)===null||e===void 0||e.onLeftChanged())}onDisplayedColumnsChanged(){this.eGui&&this.setAriaColIndex()}setAriaColIndex(){const e=this.beans.columnModel.getAriaColumnIndex(this.column);Kr(this.getGui(),e)}isSuppressNavigable(){return this.column.isSuppressNavigable(this.rowNode)}onWidthChanged(){var e;return(e=this.cellPositionFeature)===null||e===void 0?void 0:e.onWidthChanged()}getColumn(){return this.column}getRowNode(){return this.rowNode}getBeans(){return this.beans}isPrintLayout(){return this.printLayout}appendChild(e){this.eGui.appendChild(e)}refreshHandle(){this.cellRangeFeature&&this.cellRangeFeature.refreshHandle()}getCellPosition(){return this.cellPosition}isEditing(){return this.editing}startRowOrCellEdit(e,t=null){this.cellComp&&(this.beans.gridOptionsService.get("editType")==="fullRow"?this.rowCtrl.startRowEditing(e,this):this.startEditing(e,!0,t))}getRowCtrl(){return this.rowCtrl}getRowPosition(){return{rowIndex:this.cellPosition.rowIndex,rowPinned:this.cellPosition.rowPinned}}updateRangeBordersIfRangeCount(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.updateRangeBordersIfRangeCount()}onRangeSelectionChanged(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.onRangeSelectionChanged()}isRangeSelectionEnabled(){return this.cellRangeFeature!=null}focusCell(e=!1){this.beans.focusService.setFocusedCell({rowIndex:this.getCellPosition().rowIndex,column:this.column,rowPinned:this.rowNode.rowPinned,forceBrowserFocus:e})}onRowIndexChanged(){this.createCellPosition(),this.onCellFocused(),this.cellRangeFeature&&this.cellRangeFeature.onRangeSelectionChanged()}onFirstRightPinnedChanged(){if(!this.cellComp)return;const e=this.column.isFirstRightPinned();this.cellComp.addOrRemoveCssClass(Wp,e)}onLastLeftPinnedChanged(){if(!this.cellComp)return;const e=this.column.isLastLeftPinned();this.cellComp.addOrRemoveCssClass(kp,e)}onCellFocused(e){if(!this.cellComp||this.beans.gridOptionsService.is("suppressCellFocus"))return;const t=this.beans.focusService.isCellFocused(this.cellPosition);this.cellComp.addOrRemoveCssClass(Bp,t),t&&e&&e.forceBrowserFocus&&this.cellComp.getFocusableElement().focus({preventScroll:!!e.preventScrollOnBrowserFocus});const i=this.beans.gridOptionsService.get("editType")==="fullRow";!t&&!i&&this.editing&&this.stopRowOrCellEdit()}createCellPosition(){this.cellPosition={rowIndex:this.rowNode.rowIndex,rowPinned:li(this.rowNode.rowPinned),column:this.column}}applyStaticCssClasses(){this.cellComp.addOrRemoveCssClass(Gp,!0),this.cellComp.addOrRemoveCssClass(Up,!0);const e=this.column.isAutoHeight()==!0;this.cellComp.addOrRemoveCssClass(Hp,e),this.cellComp.addOrRemoveCssClass(Vp,!e)}onColumnHover(){if(!this.cellComp||!this.beans.gridOptionsService.is("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.cellComp.addOrRemoveCssClass(jp,e)}onColDefChanged(){this.cellComp&&(this.setWrapText(),this.editing||this.refreshCell({forceRefresh:!0,suppressFlash:!0}))}setWrapText(){const e=this.column.getColDef().wrapText==!0;this.cellComp.addOrRemoveCssClass(zp,e)}dispatchCellContextMenuEvent(e){const t=this.column.getColDef(),i=this.createEvent(e,u.EVENT_CELL_CONTEXT_MENU);this.beans.eventService.dispatchEvent(i),t.onCellContextMenu&&window.setTimeout(()=>t.onCellContextMenu(i),0)}getCellRenderer(){return this.cellComp?this.cellComp.getCellRenderer():null}getCellEditor(){return this.cellComp?this.cellComp.getCellEditor():null}destroy(){this.onCellCompAttachedFuncs=[],super.destroy()}createSelectionCheckbox(){const e=new In;return this.beans.context.createBean(e),e.init({rowNode:this.rowNode,column:this.column}),e}createDndSource(){const e=new uc(this.rowNode,this.column,this.eGui);return this.beans.context.createBean(e),e}registerRowDragger(e,t,i){if(this.customRowDragComp){this.customRowDragComp.setDragElement(e,t);return}const s=this.createRowDragComp(e,t,i);s&&(this.customRowDragComp=s,this.addDestroyFunc(()=>{this.beans.context.destroyBean(s),this.customRowDragComp=null}))}createRowDragComp(e,t,i){const s=this.beans.gridOptionsService.is("pagination"),o=this.beans.gridOptionsService.is("rowDragManaged"),n=this.beans.gridOptionsService.isRowModelType("clientSide");if(o){if(!n){Y(()=>console.warn("AG Grid: managed row dragging is only allowed in the Client Side Row Model"),"CellComp.addRowDragging");return}if(s){Y(()=>console.warn("AG Grid: managed row dragging is not possible when doing pagination"),"CellComp.addRowDragging");return}}const r=new Wi(()=>this.value,this.rowNode,this.column,e,t,i);return this.beans.context.createBean(r),r}}St.DOM_DATA_KEY_CELL_CTRL="cellCtrl";var Me;(function(l){l.Normal="Normal",l.FullWidth="FullWidth",l.FullWidthLoading="FullWidthLoading",l.FullWidthGroup="FullWidthGroup",l.FullWidthDetail="FullWidthDetail"})(Me||(Me={}));let Kp=0;class Et extends T{constructor(e,t,i,s,o){super(),this.allRowGuis=[],this.active=!0,this.centerCellCtrls={list:[],map:{}},this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}},this.slideInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.fadeInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.lastMouseDownOnDragger=!1,this.updateColumnListsPending=!1,this.businessKeySanitised=null,this.beans=t,this.gridOptionsService=t.gridOptionsService,this.rowNode=e,this.paginationPage=t.paginationProxy.getCurrentPage(),this.useAnimationFrameForCreate=s,this.printLayout=o,this.instanceId=e.id+"-"+Kp++,this.setAnimateFlags(i),this.initRowBusinessKey(),this.rowFocused=t.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned),this.rowLevel=t.rowCssClassCalculator.calculateRowLevel(this.rowNode),this.setRowType(),this.addListeners()}initRowBusinessKey(){this.businessKeyForNodeFunc=this.gridOptionsService.get("getBusinessKeyForNode"),this.updateRowBusinessKey()}updateRowBusinessKey(){if(typeof this.businessKeyForNodeFunc!="function")return;const e=this.businessKeyForNodeFunc(this.rowNode);this.businessKeySanitised=It(e)}isSticky(){return this.rowNode.sticky}getBeans(){return this.beans}getInstanceId(){return this.instanceId}setComp(e,t,i){const s={rowComp:e,element:t,containerType:i};this.allRowGuis.push(s),i===Se.LEFT?this.leftGui=s:i===Se.RIGHT?this.rightGui=s:i===Se.FULL_WIDTH?this.fullWidthGui=s:this.centerGui=s,this.initialiseRowComp(s),this.rowType!=="FullWidthLoading"&&!this.rowNode.rowPinned&&this.beans.rowRenderer.dispatchFirstDataRenderedEvent()}unsetComp(e){this.allRowGuis=this.allRowGuis.filter(t=>t.containerType!==e),e===Se.LEFT?this.leftGui=void 0:e===Se.RIGHT?this.rightGui=void 0:e===Se.FULL_WIDTH&&(this.fullWidthGui=void 0)}isCacheable(){return this.rowType===Me.FullWidthDetail&&this.gridOptionsService.is("keepDetailRows")}setCached(e){const t=e?"none":"";this.allRowGuis.forEach(i=>i.element.style.display=t)}initialiseRowComp(e){const t=this.gridOptionsService;this.listenOnDomOrder(e),this.onRowHeightChanged(e),this.updateRowIndexes(e),this.setFocusedClasses(e),this.setStylesFromGridOptions(e),t.isRowSelection()&&this.rowNode.selectable&&this.onRowSelected(e),this.updateColumnLists(!this.useAnimationFrameForCreate);const i=e.rowComp;i.setRole("row"),this.getInitialRowClasses(e.containerType).forEach(o=>i.addOrRemoveCssClass(o,!0)),this.executeSlideAndFadeAnimations(e),this.rowNode.group&&ft(e.element,this.rowNode.expanded==!0),this.setRowCompRowId(i),this.setRowCompRowBusinessKey(i),this.isFullWidth()&&!this.gridOptionsService.is("suppressCellFocus")&&i.setTabIndex(-1),t.setDomData(e.element,Et.DOM_DATA_KEY_ROW_CTRL,this),this.addDestroyFunc(()=>t.setDomData(e.element,Et.DOM_DATA_KEY_ROW_CTRL,null)),this.useAnimationFrameForCreate?this.beans.animationFrameService.createTask(this.addHoverFunctionality.bind(this,e.element),this.rowNode.rowIndex,"createTasksP2"):this.addHoverFunctionality(e.element),this.isFullWidth()&&this.setupFullWidth(e),t.is("rowDragEntireRow")&&this.addRowDraggerToRow(e),this.useAnimationFrameForCreate&&this.beans.animationFrameService.addDestroyTask(()=>{this.isAlive()&&e.rowComp.addOrRemoveCssClass("ag-after-created",!0)}),this.executeProcessRowPostCreateFunc()}setRowCompRowBusinessKey(e){this.businessKeySanitised!=null&&e.setRowBusinessKey(this.businessKeySanitised)}setRowCompRowId(e){const t=It(this.rowNode.id);t!=null&&e.setRowId(t)}executeSlideAndFadeAnimations(e){const{containerType:t}=e;this.slideInAnimation[t]&&(Pr(()=>{this.onTopChanged()}),this.slideInAnimation[t]=!1),this.fadeInAnimation[t]&&(Pr(()=>{e.rowComp.addOrRemoveCssClass("ag-opacity-zero",!1)}),this.fadeInAnimation[t]=!1)}addRowDraggerToRow(e){if(this.gridOptionsService.isEnableRangeSelection()){Y(()=>{console.warn("AG Grid: Setting `rowDragEntireRow: true` in the gridOptions doesn't work with `enableRangeSelection: true`")},"rowDragAndRangeSelectionEnabled");return}const t=this.beans.localeService.getLocaleTextFunc(),i=new Wi(()=>`1 ${t("rowDragRow","row")}`,this.rowNode,void 0,e.element,void 0,!0);this.createManagedBean(i,this.beans.context)}setupFullWidth(e){const t=this.getPinnedForContainer(e.containerType),i=this.createFullWidthParams(e.element,t);if(this.rowType==Me.FullWidthDetail&&!A.__assertRegistered(N.MasterDetailModule,"cell renderer 'agDetailCellRenderer' (for master detail)",this.beans.context.getGridId()))return;let s;switch(this.rowType){case Me.FullWidthDetail:s=this.beans.userComponentFactory.getFullWidthDetailCellRendererDetails(i);break;case Me.FullWidthGroup:s=this.beans.userComponentFactory.getFullWidthGroupCellRendererDetails(i);break;case Me.FullWidthLoading:s=this.beans.userComponentFactory.getFullWidthLoadingCellRendererDetails(i);break;default:s=this.beans.userComponentFactory.getFullWidthCellRendererDetails(i);break}e.rowComp.showFullWidth(s)}isPrintLayout(){return this.printLayout}getFullWidthCellRenderer(){var e,t;return(t=(e=this.fullWidthGui)===null||e===void 0?void 0:e.rowComp)===null||t===void 0?void 0:t.getFullWidthCellRenderer()}getCellElement(e){const t=this.getCellCtrl(e);return t?t.getGui():null}executeProcessRowPostCreateFunc(){var e;const t=this.gridOptionsService.getCallback("processRowPostCreate");if(!t||!this.areAllContainersReady())return;const i={eRow:(e=this.centerGui)===null||e===void 0?void 0:e.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 e=!!this.leftGui||!this.beans.columnModel.isPinningLeft(),t=!!this.centerGui,i=!!this.rightGui||!this.beans.columnModel.isPinningRight();return e&&t&&i}setRowType(){const e=this.rowNode.stub,t=this.rowNode.isFullWidthCell(),i=this.beans.doingMasterDetail&&this.rowNode.detail,s=this.beans.columnModel.isPivotMode(),n=!!this.rowNode.group&&!this.rowNode.footer&&this.gridOptionsService.isGroupUseEntireRow(s);e?this.rowType=Me.FullWidthLoading:i?this.rowType=Me.FullWidthDetail:t?this.rowType=Me.FullWidth:n?this.rowType=Me.FullWidthGroup:this.rowType=Me.Normal}updateColumnLists(e=!1,t=!1){if(this.isFullWidth())return;if(e||this.gridOptionsService.is("suppressAnimationFrame")||this.printLayout){this.updateColumnListsImpl(t);return}this.updateColumnListsPending||(this.beans.animationFrameService.createTask(()=>{this.active&&this.updateColumnListsImpl(!0)},this.rowNode.rowIndex,"createTasksP1"),this.updateColumnListsPending=!0)}createCellCtrls(e,t,i=null){const s={list:[],map:{}},o=(n,r)=>{s.list.push(r),s.map[n]=r};return t.forEach(n=>{const r=n.getInstanceId();let a=e.map[r];a||(a=new St(n,this.rowNode,this.beans,this)),o(r,a)}),e.list.forEach(n=>{if(s.map[n.getColumn().getInstanceId()]!=null)return;if(!this.isCellEligibleToBeRemoved(n,i)){o(n.getColumn().getInstanceId(),n);return}n.destroy()}),s}updateColumnListsImpl(e=!1){this.updateColumnListsPending=!1;const t=this.beans.columnModel;if(this.printLayout)this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,t.getAllDisplayedColumns()),this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}};else{const i=t.getViewportCenterColumnsForRow(this.rowNode);this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,i);const s=t.getDisplayedLeftColumnsForRow(this.rowNode);this.leftCellCtrls=this.createCellCtrls(this.leftCellCtrls,s,"left");const o=t.getDisplayedRightColumnsForRow(this.rowNode);this.rightCellCtrls=this.createCellCtrls(this.rightCellCtrls,o,"right")}this.allRowGuis.forEach(i=>{const s=i.containerType===Se.LEFT?this.leftCellCtrls:i.containerType===Se.RIGHT?this.rightCellCtrls:this.centerCellCtrls;i.rowComp.setCellCtrls(s.list,e)})}isCellEligibleToBeRemoved(e,t){if(e.getColumn().getPinned()!=t)return!0;const n=e.isEditing(),r=this.beans.focusService.isCellFocused(e.getCellPosition());if(n||r){const d=e.getColumn();return!(this.beans.columnModel.getAllDisplayedColumns().indexOf(d)>=0)}return!0}listenOnDomOrder(e){const t=()=>{const i=this.gridOptionsService.is("ensureDomOrder"),s=this.gridOptionsService.isDomLayout("print");e.rowComp.setDomOrder(i||s)};this.addManagedPropertyListener("domLayout",t),t()}setAnimateFlags(e){if(this.isSticky()||!e)return;const t=R(this.rowNode.oldRowTop),i=this.beans.columnModel.isPinningLeft(),s=this.beans.columnModel.isPinningRight();t?(this.slideInAnimation.center=!0,this.slideInAnimation.left=i,this.slideInAnimation.right=s):(this.fadeInAnimation.center=!0,this.fadeInAnimation.left=i,this.fadeInAnimation.right=s)}isEditing(){return this.editingRow}stopRowEditing(e){this.stopEditing(e)}isFullWidth(){return this.rowType!==Me.Normal}getRowType(){return this.rowType}refreshFullWidth(){const e=(r,a)=>{if(!r)return!0;const d=r.rowComp.getFullWidthCellRenderer();if(!d||!d.refresh)return!1;const c=this.createFullWidthParams(r.element,a);return d.refresh(c)},t=e(this.fullWidthGui,null),i=e(this.centerGui,null),s=e(this.leftGui,"left"),o=e(this.rightGui,"right");return t&&i&&s&&o}addListeners(){this.addManagedListener(this.rowNode,P.EVENT_HEIGHT_CHANGED,()=>this.onRowHeightChanged()),this.addManagedListener(this.rowNode,P.EVENT_ROW_SELECTED,()=>this.onRowSelected()),this.addManagedListener(this.rowNode,P.EVENT_ROW_INDEX_CHANGED,this.onRowIndexChanged.bind(this)),this.addManagedListener(this.rowNode,P.EVENT_TOP_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(this.rowNode,P.EVENT_EXPANDED_CHANGED,this.updateExpandedCss.bind(this)),this.addManagedListener(this.rowNode,P.EVENT_HAS_CHILDREN_CHANGED,this.updateExpandedCss.bind(this)),this.addManagedListener(this.rowNode,P.EVENT_DATA_CHANGED,this.onRowNodeDataChanged.bind(this)),this.addManagedListener(this.rowNode,P.EVENT_CELL_CHANGED,this.onRowNodeCellChanged.bind(this)),this.addManagedListener(this.rowNode,P.EVENT_HIGHLIGHT_CHANGED,this.onRowNodeHighlightChanged.bind(this)),this.addManagedListener(this.rowNode,P.EVENT_DRAGGING_CHANGED,this.onRowNodeDraggingChanged.bind(this)),this.addManagedListener(this.rowNode,P.EVENT_UI_LEVEL_CHANGED,this.onUiLevelChanged.bind(this));const e=this.beans.eventService;this.addManagedListener(e,u.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED,this.onPaginationPixelOffsetChanged.bind(this)),this.addManagedListener(e,u.EVENT_HEIGHT_SCALE_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(e,u.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(e,u.EVENT_VIRTUAL_COLUMNS_CHANGED,this.onVirtualColumnsChanged.bind(this)),this.addManagedListener(e,u.EVENT_CELL_FOCUSED,this.onCellFocused.bind(this)),this.addManagedListener(e,u.EVENT_CELL_FOCUS_CLEARED,this.onCellFocusCleared.bind(this)),this.addManagedListener(e,u.EVENT_PAGINATION_CHANGED,this.onPaginationChanged.bind(this)),this.addManagedListener(e,u.EVENT_MODEL_UPDATED,this.onModelUpdated.bind(this)),this.addManagedListener(e,u.EVENT_COLUMN_MOVED,this.onColumnMoved.bind(this)),this.addListenersForCellComps()}onColumnMoved(){this.updateColumnLists()}addListenersForCellComps(){this.addManagedListener(this.rowNode,P.EVENT_ROW_INDEX_CHANGED,()=>{this.getAllCellCtrls().forEach(e=>e.onRowIndexChanged())}),this.addManagedListener(this.rowNode,P.EVENT_CELL_CHANGED,e=>{this.getAllCellCtrls().forEach(t=>t.onCellChanged(e))})}onRowNodeDataChanged(e){if(this.rowNode.detailNode&&this.beans.rowRenderer.refreshFullWidthRow(this.rowNode.detailNode),this.isFullWidth()){this.beans.rowRenderer.refreshFullWidthRow(this.rowNode);return}this.getAllCellCtrls().forEach(t=>t.refreshCell({suppressFlash:!e.update,newData:!e.update})),this.allRowGuis.forEach(t=>{this.setRowCompRowId(t.rowComp),this.updateRowBusinessKey(),this.setRowCompRowBusinessKey(t.rowComp)}),this.onRowSelected(),this.postProcessCss()}onRowNodeCellChanged(){this.postProcessCss()}postProcessCss(){this.setStylesFromGridOptions(),this.postProcessClassesFromGridOptions(),this.postProcessRowClassRules(),this.postProcessRowDragging()}onRowNodeHighlightChanged(){const e=this.rowNode.highlighted;this.allRowGuis.forEach(t=>{const i=e===rt.Above,s=e===rt.Below;t.rowComp.addOrRemoveCssClass("ag-row-highlight-above",i),t.rowComp.addOrRemoveCssClass("ag-row-highlight-below",s)})}onRowNodeDraggingChanged(){this.postProcessRowDragging()}postProcessRowDragging(){const e=this.rowNode.dragging;this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass("ag-row-dragging",e))}updateExpandedCss(){const e=this.rowNode.isExpandable(),t=this.rowNode.expanded==!0;this.allRowGuis.forEach(i=>{i.rowComp.addOrRemoveCssClass("ag-row-group",e),i.rowComp.addOrRemoveCssClass("ag-row-group-expanded",e&&t),i.rowComp.addOrRemoveCssClass("ag-row-group-contracted",e&&!t),ft(i.element,e&&t)})}onDisplayedColumnsChanged(){this.updateColumnLists(!0),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights()}onVirtualColumnsChanged(){this.updateColumnLists(!1,!0)}getRowPosition(){return{rowPinned:li(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}}onKeyboardNavigate(e){const t=this.allRowGuis.find(a=>a.element.contains(e.target));if(!((t?t.element:null)===e.target))return;const o=this.rowNode,n=this.beans.focusService.getFocusedCell(),r={rowIndex:o.rowIndex,rowPinned:o.rowPinned,column:n&&n.column};this.beans.navigationService.navigateToNextCell(e,e.key,r,!0),e.preventDefault()}onTabKeyDown(e){if(e.defaultPrevented||Lt(e))return;const t=this.allRowGuis.find(n=>n.element.contains(e.target)),i=t?t.element:null,s=i===e.target;let o=null;s||(o=this.beans.focusService.findNextFocusableElement(i,!1,e.shiftKey)),(this.isFullWidth()&&s||!o)&&this.beans.navigationService.onTabKeyDown(this,e)}onFullWidthRowFocused(e){var t;const i=this.rowNode,s=e?this.isFullWidth()&&e.rowIndex===i.rowIndex&&e.rowPinned==i.rowPinned:!1,o=this.fullWidthGui?this.fullWidthGui.element:(t=this.centerGui)===null||t===void 0?void 0:t.element;o&&(o.classList.toggle("ag-full-width-focus",s),s&&o.focus({preventScroll:!0}))}refreshCell(e){this.centerCellCtrls=this.removeCellCtrl(this.centerCellCtrls,e),this.leftCellCtrls=this.removeCellCtrl(this.leftCellCtrls,e),this.rightCellCtrls=this.removeCellCtrl(this.rightCellCtrls,e),this.updateColumnLists()}removeCellCtrl(e,t){const i={list:[],map:{}};return e.list.forEach(s=>{s!==t&&(i.list.push(s),i.map[s.getInstanceId()]=s)}),i}onMouseEvent(e,t){switch(e){case"dblclick":this.onRowDblClick(t);break;case"click":this.onRowClick(t);break;case"touchstart":case"mousedown":this.onRowMouseDown(t);break}}createRowEvent(e,t){return{type:e,node:this.rowNode,data:this.rowNode.data,rowIndex:this.rowNode.rowIndex,rowPinned:this.rowNode.rowPinned,context:this.gridOptionsService.context,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,event:t}}createRowEventWithSource(e,t){const i=this.createRowEvent(e,t);return i.source=this,i}onRowDblClick(e){if(Lt(e))return;const t=this.createRowEventWithSource(u.EVENT_ROW_DOUBLE_CLICKED,e);this.beans.eventService.dispatchEvent(t)}onRowMouseDown(e){if(this.lastMouseDownOnDragger=_i(e.target,"ag-row-drag",3),!this.isFullWidth())return;const t=this.rowNode,i=this.beans.columnModel;this.beans.rangeService&&this.beans.rangeService.removeAllCellRanges(),this.beans.focusService.setFocusedCell({rowIndex:t.rowIndex,column:i.getAllDisplayedColumns()[0],rowPinned:t.rowPinned,forceBrowserFocus:!0})}onRowClick(e){if(Lt(e)||this.lastMouseDownOnDragger)return;const i=this.createRowEventWithSource(u.EVENT_ROW_CLICKED,e);this.beans.eventService.dispatchEvent(i);const s=e.ctrlKey||e.metaKey,o=e.shiftKey;if(this.gridOptionsService.is("groupSelectsChildren")&&this.rowNode.group||!this.rowNode.selectable||this.rowNode.rowPinned||!this.gridOptionsService.isRowSelection()||this.gridOptionsService.is("suppressRowClickSelection"))return;const r=this.gridOptionsService.is("rowMultiSelectWithClick"),a=!this.gridOptionsService.is("suppressRowDeselection"),d="rowClicked";if(this.rowNode.isSelected())r?this.rowNode.setSelectedParams({newValue:!1,event:e,source:d}):s?a&&this.rowNode.setSelectedParams({newValue:!1,event:e,source:d}):this.rowNode.setSelectedParams({newValue:!0,clearSelection:!o,rangeSelect:o,event:e,source:d});else{const c=r?!1:!s;this.rowNode.setSelectedParams({newValue:!0,clearSelection:c,rangeSelect:o,event:e,source:d})}}setupDetailRowAutoHeight(e){if(this.rowType!==Me.FullWidthDetail||!this.gridOptionsService.is("detailRowAutoHeight"))return;const t=()=>{const s=e.clientHeight;if(s!=null&&s>0){const o=()=>{this.rowNode.setRowHeight(s),this.beans.clientSideRowModel?this.beans.clientSideRowModel.onRowHeightChanged():this.beans.serverSideRowModel&&this.beans.serverSideRowModel.onRowHeightChanged()};this.beans.frameworkOverrides.setTimeout(o,0)}},i=this.beans.resizeObserverService.observeResize(e,t);this.addDestroyFunc(i),t()}createFullWidthParams(e,t){return{fullWidth:!0,data:this.rowNode.data,node:this.rowNode,value:this.rowNode.key,valueFormatted:this.rowNode.key,rowIndex:this.rowNode.rowIndex,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context,eGridCell:e,eParentOfValue:e,pinned:t,addRenderedRowListener:this.addEventListener.bind(this),registerRowDragger:(s,o,n,r)=>this.addFullWidthRowDragging(s,o,n,r)}}addFullWidthRowDragging(e,t,i="",s){if(!this.isFullWidth())return;const o=new Wi(()=>i,this.rowNode,void 0,e,t,s);this.createManagedBean(o,this.beans.context)}onUiLevelChanged(){const e=this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode);if(this.rowLevel!=e){const t="ag-row-level-"+e,i="ag-row-level-"+this.rowLevel;this.allRowGuis.forEach(s=>{s.rowComp.addOrRemoveCssClass(t,!0),s.rowComp.addOrRemoveCssClass(i,!1)})}this.rowLevel=e}isFirstRowOnPage(){return this.rowNode.rowIndex===this.beans.paginationProxy.getPageFirstRow()}isLastRowOnPage(){return this.rowNode.rowIndex===this.beans.paginationProxy.getPageLastRow()}onModelUpdated(){this.refreshFirstAndLastRowStyles()}refreshFirstAndLastRowStyles(){const e=this.isFirstRowOnPage(),t=this.isLastRowOnPage();this.firstRowOnPage!==e&&(this.firstRowOnPage=e,this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass("ag-row-first",e))),this.lastRowOnPage!==t&&(this.lastRowOnPage=t,this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass("ag-row-last",t)))}stopEditing(e=!1){if(this.stoppingRowEdit)return;const t=this.getAllCellCtrls(),i=this.editingRow;this.stoppingRowEdit=!0;let s=!1;for(const o of t){const n=o.stopEditing(e);i&&!e&&!s&&n&&(s=!0)}if(s){const o=this.createRowEvent(u.EVENT_ROW_VALUE_CHANGED);this.beans.eventService.dispatchEvent(o)}i&&this.setEditingRow(!1),this.stoppingRowEdit=!1}setInlineEditingCss(e){this.allRowGuis.forEach(t=>{t.rowComp.addOrRemoveCssClass("ag-row-inline-editing",e),t.rowComp.addOrRemoveCssClass("ag-row-not-inline-editing",!e)})}setEditingRow(e){this.editingRow=e,this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass("ag-row-editing",e));const t=e?this.createRowEvent(u.EVENT_ROW_EDITING_STARTED):this.createRowEvent(u.EVENT_ROW_EDITING_STOPPED);this.beans.eventService.dispatchEvent(t)}startRowEditing(e=null,t=null,i=null){if(this.editingRow)return;this.getAllCellCtrls().reduce((o,n)=>{const r=n===t;return r?n.startEditing(e,r,i):n.startEditing(null,r,i),o?!0:n.isEditing()},!1)&&this.setEditingRow(!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 e=this.beans.rowCssClassCalculator.processClassesFromGridOptions(this.rowNode);!e||!e.length||e.forEach(t=>{this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass(t,!0))})}postProcessRowClassRules(){this.beans.rowCssClassCalculator.processRowClassRules(this.rowNode,e=>{this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass(e,!0))},e=>{this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass(e,!1))})}setStylesFromGridOptions(e){const t=this.processStylesFromGridOptions();this.forEachGui(e,i=>i.rowComp.setUserStyles(t))}getPinnedForContainer(e){return e===Se.LEFT?"left":e===Se.RIGHT?"right":null}getInitialRowClasses(e){const t=this.getPinnedForContainer(e),i={rowNode:this.rowNode,rowFocused:this.rowFocused,fadeRowIn:this.fadeInAnimation[e],rowIsEven:this.rowNode.rowIndex%2===0,rowLevel:this.rowLevel,fullWidthRow:this.isFullWidth(),firstRowOnPage:this.isFirstRowOnPage(),lastRowOnPage:this.isLastRowOnPage(),printLayout:this.printLayout,expandable:this.rowNode.isExpandable(),pinned:t};return this.beans.rowCssClassCalculator.getInitialRowClasses(i)}processStylesFromGridOptions(){const e=this.gridOptionsService.get("rowStyle");if(e&&typeof e=="function"){console.warn("AG Grid: rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead");return}const t=this.gridOptionsService.getCallback("getRowStyle");let i;if(t){const s={data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex};i=t(s)}return Object.assign({},e,i)}onRowSelected(e){const t=!!this.rowNode.isSelected();this.forEachGui(e,i=>{i.rowComp.addOrRemoveCssClass("ag-row-selected",t),ls(i.element,t?!0:void 0);const s=this.createAriaLabel();di(i.element,s??"")})}createAriaLabel(){const e=this.rowNode.isSelected();return e&&this.gridOptionsService.is("suppressRowDeselection")?void 0:this.beans.localeService.getLocaleTextFunc()(e?"ariaRowDeselect":"ariaRowSelect",`Press SPACE to ${e?"deselect":"select"} this row.`)}isUseAnimationFrameForCreate(){return this.useAnimationFrameForCreate}addHoverFunctionality(e){this.active&&(this.addManagedListener(e,"mouseenter",()=>this.rowNode.onMouseEnter()),this.addManagedListener(e,"mouseleave",()=>this.rowNode.onMouseLeave()),this.addManagedListener(this.rowNode,P.EVENT_MOUSE_ENTER,()=>{!this.beans.dragService.isDragging()&&!this.gridOptionsService.is("suppressRowHoverHighlight")&&(e.classList.add("ag-row-hover"),this.rowNode.setHovered(!0))}),this.addManagedListener(this.rowNode,P.EVENT_MOUSE_LEAVE,()=>{e.classList.remove("ag-row-hover"),this.rowNode.setHovered(!1)}))}roundRowTopToBounds(e){const i=this.beans.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),s=this.applyPaginationOffset(i.top,!0)-100,o=this.applyPaginationOffset(i.bottom,!0)+100;return Math.min(Math.max(s,e),o)}getFrameworkOverrides(){return this.beans.frameworkOverrides}forEachGui(e,t){(e?[e]:this.allRowGuis).forEach(t)}onRowHeightChanged(e){if(this.rowNode.rowHeight==null)return;const t=this.rowNode.rowHeight,i=this.beans.environment.getDefaultRowHeight(),o=this.gridOptionsService.isGetRowHeightFunction()?this.gridOptionsService.getRowHeightForNode(this.rowNode).height:void 0,n=o?`${Math.min(i,o)-2}px`:void 0;this.forEachGui(e,r=>{r.element.style.height=`${t}px`,n&&r.element.style.setProperty("--ag-line-height",n)})}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}destroyFirstPass(){this.active=!1,this.gridOptionsService.isAnimateRows()&&this.setupRemoveAnimation(),this.rowNode.setHovered(!1);const e=this.createRowEvent(u.EVENT_VIRTUAL_ROW_REMOVED);this.dispatchEvent(e),this.beans.eventService.dispatchEvent(e),super.destroy()}setupRemoveAnimation(){if(this.isSticky())return;if(this.rowNode.rowTop!=null){const t=this.roundRowTopToBounds(this.rowNode.rowTop);this.setRowTop(t)}else this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass("ag-opacity-zero",!0))}destroySecondPass(){this.allRowGuis.length=0;const e=t=>(t.list.forEach(i=>i.destroy()),{list:[],map:{}});this.centerCellCtrls=e(this.centerCellCtrls),this.leftCellCtrls=e(this.leftCellCtrls),this.rightCellCtrls=e(this.rightCellCtrls)}setFocusedClasses(e){this.forEachGui(e,t=>{t.rowComp.addOrRemoveCssClass("ag-row-focus",this.rowFocused),t.rowComp.addOrRemoveCssClass("ag-row-no-focus",!this.rowFocused)})}onCellFocused(){this.onCellFocusChanged()}onCellFocusCleared(){this.onCellFocusChanged()}onCellFocusChanged(){const e=this.beans.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);e!==this.rowFocused&&(this.rowFocused=e,this.setFocusedClasses()),!e&&this.editingRow&&this.stopEditing(!1)}onPaginationChanged(){const e=this.beans.paginationProxy.getCurrentPage();this.paginationPage!==e&&(this.paginationPage=e,this.onTopChanged()),this.refreshFirstAndLastRowStyles()}onTopChanged(){this.setRowTop(this.rowNode.rowTop)}onPaginationPixelOffsetChanged(){this.onTopChanged()}applyPaginationOffset(e,t=!1){if(this.rowNode.isRowPinned()||this.rowNode.sticky)return e;const i=this.beans.paginationProxy.getPixelOffset();return e+i*(t?1:-1)}setRowTop(e){if(!this.printLayout&&R(e)){const t=this.applyPaginationOffset(e),o=`${this.rowNode.isRowPinned()||this.rowNode.sticky?t:this.beans.rowContainerHeightService.getRealPixelPosition(t)}px`;this.setRowTopStyle(o)}}getInitialRowTop(e){return this.gridOptionsService.is("suppressRowTransform")?this.getInitialRowTopShared(e):void 0}getInitialTransform(e){return this.gridOptionsService.is("suppressRowTransform")?void 0:`translateY(${this.getInitialRowTopShared(e)})`}getInitialRowTopShared(e){if(this.printLayout)return"";let t;if(this.isSticky())t=this.rowNode.stickyRowTop;else{const i=this.slideInAnimation[e]?this.roundRowTopToBounds(this.rowNode.oldRowTop):this.rowNode.rowTop,s=this.applyPaginationOffset(i);t=this.rowNode.isRowPinned()?s:this.beans.rowContainerHeightService.getRealPixelPosition(s)}return t+"px"}setRowTopStyle(e){const t=this.gridOptionsService.is("suppressRowTransform");this.allRowGuis.forEach(i=>t?i.rowComp.setTop(e):i.rowComp.setTransform(`translateY(${e})`))}getRowNode(){return this.rowNode}getCellCtrl(e){let t=null;return this.getAllCellCtrls().forEach(i=>{i.getColumn()==e&&(t=i)}),t!=null||this.getAllCellCtrls().forEach(i=>{i.getColSpanningList().indexOf(e)>=0&&(t=i)}),t}onRowIndexChanged(){this.rowNode.rowIndex!=null&&(this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss())}updateRowIndexes(e){const t=this.rowNode.getRowIndexString(),i=this.beans.headerNavigationService.getHeaderRowCount(),s=this.rowNode.rowIndex%2===0,o=i+this.rowNode.rowIndex+1;this.forEachGui(e,n=>{n.rowComp.setRowIndex(t),n.rowComp.addOrRemoveCssClass("ag-row-even",s),n.rowComp.addOrRemoveCssClass("ag-row-odd",!s),$r(n.element,o)})}getPinnedLeftRowElement(){return this.leftGui?this.leftGui.element:void 0}getPinnedRightRowElement(){return this.rightGui?this.rightGui.element:void 0}getBodyRowElement(){return this.centerGui?this.centerGui.element:void 0}getFullWidthRowElement(){return this.fullWidthGui?this.fullWidthGui.element:void 0}}Et.DOM_DATA_KEY_ROW_CTRL="renderedRow";var Ye=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Ne extends T{constructor(e){super(),this.element=e}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.mockContextMenuForIPad()}addKeyboardListeners(){const e="keydown",t=this.processKeyboardEvent.bind(this,e);this.addManagedListener(this.element,e,t)}addMouseListeners(){["dblclick","contextmenu","mouseover","mouseout","click",_r("touchstart")?"touchstart":"mousedown"].forEach(i=>{const s=this.processMouseEvent.bind(this,i);this.addManagedListener(this.element,i,s)})}processMouseEvent(e,t){if(!this.mouseEventService.isEventFromThisGrid(t)||Lt(t))return;const i=this.getRowForEvent(t),s=this.mouseEventService.getRenderedCellForEvent(t);e==="contextmenu"?this.handleContextMenuMouseEvent(t,null,i,s):(s&&s.onMouseEvent(e,t),i&&i.onMouseEvent(e,t))}mockContextMenuForIPad(){if(!ci())return;const e=new re(this.element),t=i=>{const s=this.getRowForEvent(i.touchEvent),o=this.mouseEventService.getRenderedCellForEvent(i.touchEvent);this.handleContextMenuMouseEvent(null,i.touchEvent,s,o)};this.addManagedListener(e,re.EVENT_LONG_TAP,t),this.addDestroyFunc(()=>e.destroy())}getRowForEvent(e){let t=e.target;for(;t;){const i=this.gridOptionsService.getDomData(t,Et.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,n=s?s.getColumn():null;let r=null;if(n){const c=e||t;s.dispatchCellContextMenuEvent(c),r=this.valueService.getValue(n,o)}const a=this.ctrlsService.getGridBodyCtrl(),d=s?s.getGui():a.getGridBodyElement();this.contextMenuFactory&&this.contextMenuFactory.onContextMenu(e,t,o,n,r,d)}getControlsForEventTarget(e){return{cellCtrl:pn(this.gridOptionsService,e,St.DOM_DATA_KEY_CELL_CTRL),rowCtrl:pn(this.gridOptionsService,e,Et.DOM_DATA_KEY_ROW_CTRL)}}processKeyboardEvent(e,t){const{cellCtrl:i,rowCtrl:s}=this.getControlsForEventTarget(t.target);t.defaultPrevented||(i?this.processCellKeyboardEvent(i,e,t):s&&s.isFullWidth()&&this.processFullWidthRowKeyboardEvent(s,e,t))}processCellKeyboardEvent(e,t,i){const s=e.getRowNode(),o=e.getColumn(),n=e.isEditing();if(!An(this.gridOptionsService,i,s,o,n)&&t==="keydown"&&(!n&&this.navigationService.handlePageScrollingKey(i)||e.onKeyDown(i),this.doGridOperations(i,e.isEditing()),ml(i)&&e.processCharacter(i)),t==="keydown"){const a=e.createEvent(i,u.EVENT_CELL_KEY_DOWN);this.eventService.dispatchEvent(a)}}processFullWidthRowKeyboardEvent(e,t,i){const s=e.getRowNode(),o=this.focusService.getFocusedCell(),n=o&&o.column;if(!An(this.gridOptionsService,i,s,n,!1)){const a=i.key;if(t==="keydown")switch(a){case w.PAGE_HOME:case w.PAGE_END:case w.PAGE_UP:case w.PAGE_DOWN:this.navigationService.handlePageScrollingKey(i,!0);break;case w.UP:case w.DOWN:e.onKeyboardNavigate(i);break;case w.TAB:e.onTabKeyDown(i);break}}if(t==="keydown"){const a=e.createRowEvent(u.EVENT_CELL_KEY_DOWN,i);this.eventService.dispatchEvent(a)}}doGridOperations(e,t){if(!e.ctrlKey&&!e.metaKey||t||!this.mouseEventService.isEventFromThisGrid(e))return;const i=Md(e);if(i===w.A)return this.onCtrlAndA(e);if(i===w.C)return this.onCtrlAndC(e);if(i===w.D)return this.onCtrlAndD(e);if(i===w.V)return this.onCtrlAndV(e);if(i===w.X)return this.onCtrlAndX(e);if(i===w.Y)return this.onCtrlAndY();if(i===w.Z)return this.onCtrlAndZ(e)}onCtrlAndA(e){const{pinnedRowModel:t,paginationProxy:i,rangeService:s}=this;if(s&&i.isRowsToRender()){const[o,n]=[t.isEmpty("top"),t.isEmpty("bottom")],r=o?null:"top";let a,d;n?(a=null,d=this.paginationProxy.getRowCount()-1):(a="bottom",d=t.getPinnedBottomRowData().length-1);const c=this.columnModel.getAllDisplayedColumns();if(Ve(c))return;s.setCellRange({rowStartIndex:0,rowStartPinned:r,rowEndIndex:d,rowEndPinned:a,columnStart:c[0],columnEnd:Z(c)})}e.preventDefault()}onCtrlAndC(e){if(!this.clipboardService||this.gridOptionsService.is("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.gridOptionsService.is("enableCellTextSelection")||this.gridOptionsService.is("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.gridOptionsService.is("suppressClipboardPaste")&&this.clipboardService.pasteFromClipboard()}onCtrlAndD(e){this.clipboardService&&!this.gridOptionsService.is("suppressClipboardPaste")&&this.clipboardService.copyRangeDown(),e.preventDefault()}onCtrlAndZ(e){this.gridOptionsService.is("undoRedoCellEditing")&&(e.preventDefault(),e.shiftKey?this.undoRedoService.redo("ui"):this.undoRedoService.undo("ui"))}onCtrlAndY(){this.undoRedoService.redo("ui")}}Ye([p("mouseEventService")],Ne.prototype,"mouseEventService",void 0),Ye([p("valueService")],Ne.prototype,"valueService",void 0),Ye([X("contextMenuFactory")],Ne.prototype,"contextMenuFactory",void 0),Ye([p("ctrlsService")],Ne.prototype,"ctrlsService",void 0),Ye([p("navigationService")],Ne.prototype,"navigationService",void 0),Ye([p("focusService")],Ne.prototype,"focusService",void 0),Ye([p("undoRedoService")],Ne.prototype,"undoRedoService",void 0),Ye([p("columnModel")],Ne.prototype,"columnModel",void 0),Ye([p("paginationProxy")],Ne.prototype,"paginationProxy",void 0),Ye([p("pinnedRowModel")],Ne.prototype,"pinnedRowModel",void 0),Ye([X("rangeService")],Ne.prototype,"rangeService",void 0),Ye([X("clipboardService")],Ne.prototype,"clipboardService",void 0),Ye([D],Ne.prototype,"postConstruct",null);var Hn=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class mo extends T{constructor(e){super(),this.centerContainerCtrl=e}postConstruct(){this.ctrlsService.whenReady(()=>{this.gridBodyCtrl=this.ctrlsService.getGridBodyCtrl(),this.listenForResize()}),this.addManagedListener(this.eventService,u.EVENT_SCROLLBAR_WIDTH_CHANGED,this.onScrollbarWidthChanged.bind(this))}listenForResize(){const e=()=>this.onCenterViewportResized();this.centerContainerCtrl.registerViewportResizeListener(e),this.gridBodyCtrl.registerBodyViewportResizeListener(e)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.centerContainerCtrl.isViewportVisible()){this.checkViewportAndScrolls();const e=this.centerContainerCtrl.getCenterWidth();e!==this.centerWidth&&(this.centerWidth=e,this.columnModel.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0}))}else this.bodyHeight=0}checkViewportAndScrolls(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.getScrollFeature().checkScrollLeft()}getBodyHeight(){return this.bodyHeight}checkBodyHeight(){const e=this.gridBodyCtrl.getBodyViewportElement(),t=Ys(e);if(this.bodyHeight!==t){this.bodyHeight=t;const i={type:u.EVENT_BODY_HEIGHT_CHANGED};this.eventService.dispatchEvent(i)}}updateScrollVisibleService(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)}updateScrollVisibleServiceImpl(){const e={horizontalScrollShowing:this.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleService.setScrollsVisible(e)}isHorizontalScrollShowing(){return this.centerContainerCtrl.isHorizontalScrollShowing()}onHorizontalViewportChanged(){const e=this.centerContainerCtrl.getCenterWidth(),t=this.centerContainerCtrl.getViewportScrollLeft();this.columnModel.setViewportPosition(e,t)}}Hn([p("ctrlsService")],mo.prototype,"ctrlsService",void 0),Hn([p("columnModel")],mo.prototype,"columnModel",void 0),Hn([p("scrollVisibleService")],mo.prototype,"scrollVisibleService",void 0),Hn([D],mo.prototype,"postConstruct",null);var hc=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Vl extends T{constructor(e){super(),this.element=e}postConstruct(){this.addManagedListener(this.eventService,u.EVENT_LEFT_PINNED_WIDTH_CHANGED,this.onPinnedLeftWidthChanged.bind(this))}onPinnedLeftWidthChanged(){const e=this.pinnedWidthService.getPinnedLeftWidth(),t=e>0;z(this.element,t),ot(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedLeftWidth()}}hc([p("pinnedWidthService")],Vl.prototype,"pinnedWidthService",void 0),hc([D],Vl.prototype,"postConstruct",null);var pc=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Bl extends T{constructor(e){super(),this.element=e}postConstruct(){this.addManagedListener(this.eventService,u.EVENT_RIGHT_PINNED_WIDTH_CHANGED,this.onPinnedRightWidthChanged.bind(this))}onPinnedRightWidthChanged(){const e=this.pinnedWidthService.getPinnedRightWidth(),t=e>0;z(this.element,t),ot(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedRightWidth()}}pc([p("pinnedWidthService")],Bl.prototype,"pinnedWidthService",void 0),pc([D],Bl.prototype,"postConstruct",null);var gc=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Vn extends T{constructor(e,t){super(),this.eContainer=e,this.eWrapper=t}postConstruct(){this.addManagedListener(this.eventService,u.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,this.onHeightChanged.bind(this))}onHeightChanged(){const e=this.maxDivHeightScaler.getUiContainerHeight(),t=e!=null?`${e}px`:"";this.eContainer.style.height=t,this.eWrapper&&(this.eWrapper.style.height=t)}}gc([p("rowContainerHeightService")],Vn.prototype,"maxDivHeightScaler",void 0),gc([D],Vn.prototype,"postConstruct",null);var Wl=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Bn extends T{constructor(e){super(),this.eContainer=e}postConstruct(){if(!this.gridOptionsService.isEnableRangeSelection()||x(this.rangeService))return;const e={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.dragService.addDragSource(e),this.addDestroyFunc(()=>this.dragService.removeDragSource(e))}}Wl([X("rangeService")],Bn.prototype,"rangeService",void 0),Wl([p("dragService")],Bn.prototype,"dragService",void 0),Wl([D],Bn.prototype,"postConstruct",null);var kl=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Es extends T{constructor(e,t=!1){super(),this.callback=e,this.addSpacer=t}postConstruct(){const e=this.setWidth.bind(this);this.addManagedPropertyListener("domLayout",e),this.addManagedListener(this.eventService,u.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,u.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,e),this.addManagedListener(this.eventService,u.EVENT_LEFT_PINNED_WIDTH_CHANGED,e),this.addSpacer&&(this.addManagedListener(this.eventService,u.EVENT_RIGHT_PINNED_WIDTH_CHANGED,e),this.addManagedListener(this.eventService,u.EVENT_SCROLL_VISIBILITY_CHANGED,e),this.addManagedListener(this.eventService,u.EVENT_SCROLLBAR_WIDTH_CHANGED,e)),this.setWidth()}setWidth(){const{columnModel:e}=this,t=this.gridOptionsService.isDomLayout("print"),i=e.getBodyContainerWidth(),s=e.getDisplayedColumnsLeftWidth(),o=e.getDisplayedColumnsRightWidth();let n;t?n=i+s+o:(n=i,this.addSpacer&&(this.gridOptionsService.is("enableRtl")?s:o)===0&&this.scrollVisibleService.isVerticalScrollShowing()&&(n+=this.gridOptionsService.getScrollbarWidth())),this.callback(n)}}kl([p("columnModel")],Es.prototype,"columnModel",void 0),kl([p("scrollVisibleService")],Es.prototype,"scrollVisibleService",void 0),kl([D],Es.prototype,"postConstruct",null);var mi=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},S;(function(l){l.LEFT="left",l.RIGHT="right",l.CENTER="center",l.FULL_WIDTH="fullWidth",l.TOP_LEFT="topLeft",l.TOP_RIGHT="topRight",l.TOP_CENTER="topCenter",l.TOP_FULL_WIDTH="topFullWidth",l.STICKY_TOP_LEFT="stickyTopLeft",l.STICKY_TOP_RIGHT="stickyTopRight",l.STICKY_TOP_CENTER="stickyTopCenter",l.STICKY_TOP_FULL_WIDTH="stickyTopFullWidth",l.BOTTOM_LEFT="bottomLeft",l.BOTTOM_RIGHT="bottomRight",l.BOTTOM_CENTER="bottomCenter",l.BOTTOM_FULL_WIDTH="bottomFullWidth"})(S||(S={}));var Se;(function(l){l.LEFT="left",l.RIGHT="right",l.CENTER="center",l.FULL_WIDTH="fullWidth"})(Se||(Se={}));function Yp(l){switch(l){case S.CENTER:case S.TOP_CENTER:case S.STICKY_TOP_CENTER:case S.BOTTOM_CENTER:return Se.CENTER;case S.LEFT:case S.TOP_LEFT:case S.STICKY_TOP_LEFT:case S.BOTTOM_LEFT:return Se.LEFT;case S.RIGHT:case S.TOP_RIGHT:case S.STICKY_TOP_RIGHT:case S.BOTTOM_RIGHT:return Se.RIGHT;case S.FULL_WIDTH:case S.TOP_FULL_WIDTH:case S.STICKY_TOP_FULL_WIDTH:case S.BOTTOM_FULL_WIDTH:return Se.FULL_WIDTH;default:throw Error("Invalid Row Container Type")}}const qp=Qt([[S.CENTER,"ag-center-cols-container"],[S.LEFT,"ag-pinned-left-cols-container"],[S.RIGHT,"ag-pinned-right-cols-container"],[S.FULL_WIDTH,"ag-full-width-container"],[S.TOP_CENTER,"ag-floating-top-container"],[S.TOP_LEFT,"ag-pinned-left-floating-top"],[S.TOP_RIGHT,"ag-pinned-right-floating-top"],[S.TOP_FULL_WIDTH,"ag-floating-top-full-width-container"],[S.STICKY_TOP_CENTER,"ag-sticky-top-container"],[S.STICKY_TOP_LEFT,"ag-pinned-left-sticky-top"],[S.STICKY_TOP_RIGHT,"ag-pinned-right-sticky-top"],[S.STICKY_TOP_FULL_WIDTH,"ag-sticky-top-full-width-container"],[S.BOTTOM_CENTER,"ag-floating-bottom-container"],[S.BOTTOM_LEFT,"ag-pinned-left-floating-bottom"],[S.BOTTOM_RIGHT,"ag-pinned-right-floating-bottom"],[S.BOTTOM_FULL_WIDTH,"ag-floating-bottom-full-width-container"]]),Qp=Qt([[S.CENTER,"ag-center-cols-viewport"],[S.TOP_CENTER,"ag-floating-top-viewport"],[S.STICKY_TOP_CENTER,"ag-sticky-top-viewport"],[S.BOTTOM_CENTER,"ag-floating-bottom-viewport"]]),Xp=Qt([[S.CENTER,"ag-center-cols-clipper"]]);class at extends T{constructor(e){super(),this.visible=!0,this.EMPTY_CTRLS=[],this.name=e,this.isFullWithContainer=this.name===S.TOP_FULL_WIDTH||this.name===S.STICKY_TOP_FULL_WIDTH||this.name===S.BOTTOM_FULL_WIDTH||this.name===S.FULL_WIDTH}static getRowContainerCssClasses(e){const t=qp.get(e),i=Qp.get(e),s=Xp.get(e);return{container:t,viewport:i,wrapper:s}}static getPinned(e){switch(e){case S.BOTTOM_LEFT:case S.TOP_LEFT:case S.STICKY_TOP_LEFT:case S.LEFT:return"left";case S.BOTTOM_RIGHT:case S.TOP_RIGHT:case S.STICKY_TOP_RIGHT:case S.RIGHT:return"right";default:return null}}postConstruct(){this.enableRtl=this.gridOptionsService.is("enableRtl"),this.embedFullWidthRows=this.gridOptionsService.is("embedFullWidthRows"),this.forContainers([S.CENTER],()=>this.viewportSizeFeature=this.createManagedBean(new mo(this)))}registerWithCtrlsService(){switch(this.name){case S.CENTER:this.ctrlsService.registerCenterRowContainerCtrl(this);break;case S.LEFT:this.ctrlsService.registerLeftRowContainerCtrl(this);break;case S.RIGHT:this.ctrlsService.registerRightRowContainerCtrl(this);break;case S.TOP_CENTER:this.ctrlsService.registerTopCenterRowContainerCtrl(this);break;case S.TOP_LEFT:this.ctrlsService.registerTopLeftRowContainerCon(this);break;case S.TOP_RIGHT:this.ctrlsService.registerTopRightRowContainerCtrl(this);break;case S.STICKY_TOP_CENTER:this.ctrlsService.registerStickyTopCenterRowContainerCtrl(this);break;case S.STICKY_TOP_LEFT:this.ctrlsService.registerStickyTopLeftRowContainerCon(this);break;case S.STICKY_TOP_RIGHT:this.ctrlsService.registerStickyTopRightRowContainerCtrl(this);break;case S.BOTTOM_CENTER:this.ctrlsService.registerBottomCenterRowContainerCtrl(this);break;case S.BOTTOM_LEFT:this.ctrlsService.registerBottomLeftRowContainerCtrl(this);break;case S.BOTTOM_RIGHT:this.ctrlsService.registerBottomRightRowContainerCtrl(this);break}}forContainers(e,t){e.indexOf(this.name)>=0&&t()}getContainerElement(){return this.eContainer}getViewportSizeFeature(){return this.viewportSizeFeature}setComp(e,t,i,s){this.comp=e,this.eContainer=t,this.eViewport=i,this.eWrapper=s,this.createManagedBean(new Ne(this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder(),this.stopHScrollOnPinnedRows();const o=[S.TOP_CENTER,S.TOP_LEFT,S.TOP_RIGHT],n=[S.STICKY_TOP_CENTER,S.STICKY_TOP_LEFT,S.STICKY_TOP_RIGHT],r=[S.BOTTOM_CENTER,S.BOTTOM_LEFT,S.BOTTOM_RIGHT],a=[S.CENTER,S.LEFT,S.RIGHT],d=[...o,...r,...a,...n],c=[S.CENTER,S.LEFT,S.RIGHT,S.FULL_WIDTH],h=[S.CENTER,S.TOP_CENTER,S.STICKY_TOP_CENTER,S.BOTTOM_CENTER],g=[S.LEFT,S.BOTTOM_LEFT,S.TOP_LEFT,S.STICKY_TOP_LEFT],f=[S.RIGHT,S.BOTTOM_RIGHT,S.TOP_RIGHT,S.STICKY_TOP_RIGHT];this.forContainers(g,()=>{this.pinnedWidthFeature=this.createManagedBean(new Vl(this.eContainer)),this.addManagedListener(this.eventService,u.EVENT_LEFT_PINNED_WIDTH_CHANGED,()=>this.onPinnedWidthChanged())}),this.forContainers(f,()=>{this.pinnedWidthFeature=this.createManagedBean(new Bl(this.eContainer)),this.addManagedListener(this.eventService,u.EVENT_RIGHT_PINNED_WIDTH_CHANGED,()=>this.onPinnedWidthChanged())}),this.forContainers(c,()=>this.createManagedBean(new Vn(this.eContainer,this.eWrapper))),this.forContainers(d,()=>this.createManagedBean(new Bn(this.eContainer))),this.forContainers(h,()=>this.createManagedBean(new Es(m=>this.comp.setContainerWidth(`${m}px`)))),as()&&(this.forContainers([S.CENTER],()=>{const m=this.enableRtl?u.EVENT_LEFT_PINNED_WIDTH_CHANGED:u.EVENT_RIGHT_PINNED_WIDTH_CHANGED;this.addManagedListener(this.eventService,m,()=>this.refreshPaddingForFakeScrollbar())}),this.refreshPaddingForFakeScrollbar()),this.addListeners(),this.registerWithCtrlsService()}refreshPaddingForFakeScrollbar(){const{enableRtl:e,columnModel:t,name:i,eWrapper:s,eContainer:o}=this,n=e?S.LEFT:S.RIGHT;this.forContainers([S.CENTER,n],()=>{const r=t.getContainerWidth(n),a=e?"marginLeft":"marginRight";i===S.CENTER?s.style[a]=r?"0px":"16px":o.style[a]=r?"16px":"0px"})}addListeners(){this.addManagedListener(this.eventService,u.EVENT_SCROLL_VISIBILITY_CHANGED,()=>this.onScrollVisibilityChanged()),this.addManagedListener(this.eventService,u.EVENT_DISPLAYED_COLUMNS_CHANGED,()=>this.onDisplayedColumnsChanged()),this.addManagedListener(this.eventService,u.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,()=>this.onDisplayedColumnsWidthChanged()),this.addManagedListener(this.eventService,u.EVENT_DISPLAYED_ROWS_CHANGED,e=>this.onDisplayedRowsChanged(e.afterScroll)),this.onScrollVisibilityChanged(),this.onDisplayedColumnsChanged(),this.onDisplayedColumnsWidthChanged(),this.onDisplayedRowsChanged()}listenOnDomOrder(){if([S.STICKY_TOP_CENTER,S.STICKY_TOP_LEFT,S.STICKY_TOP_RIGHT,S.STICKY_TOP_FULL_WIDTH].indexOf(this.name)>=0){this.comp.setDomOrder(!0);return}const i=()=>{const s=this.gridOptionsService.is("ensureDomOrder"),o=this.gridOptionsService.isDomLayout("print");this.comp.setDomOrder(s||o)};this.addManagedPropertyListener("domLayout",i),i()}stopHScrollOnPinnedRows(){this.forContainers([S.TOP_CENTER,S.STICKY_TOP_CENTER,S.BOTTOM_CENTER],()=>{const e=()=>this.eViewport.scrollLeft=0;this.addManagedListener(this.eViewport,"scroll",e)})}onDisplayedColumnsChanged(){this.forContainers([S.CENTER],()=>this.onHorizontalViewportChanged())}onDisplayedColumnsWidthChanged(){this.forContainers([S.CENTER],()=>this.onHorizontalViewportChanged())}onScrollVisibilityChanged(){const e=this.gridOptionsService.getScrollbarWidth()||0;if(this.name===S.CENTER){const i=this.scrollVisibleService.isHorizontalScrollShowing()?e:0,s=i==0?"100%":`calc(100% + ${i}px)`;this.animationFrameService.requestAnimationFrame(()=>this.comp.setViewportHeight(s))}if(this.name===S.FULL_WIDTH){const i=`calc(100% - ${as()?16:0}px)`;this.eContainer.style.setProperty("width",i)}}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(){const e=this.getCenterWidth(),t=this.getCenterViewportScrollLeft();this.columnModel.setViewportPosition(e,t)}getCenterWidth(){return On(this.eViewport)}getCenterViewportScrollLeft(){return Qs(this.eViewport,this.enableRtl)}registerViewportResizeListener(e){const t=this.resizeObserverService.observeResize(this.eViewport,e);this.addDestroyFunc(()=>t())}isViewportVisible(){return Jt(this.eViewport)}getViewportScrollLeft(){return Qs(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){return this.gridOptionsService.is("alwaysShowHorizontalScroll")||Od(this.eViewport)}getViewportElement(){return this.eViewport}setContainerTranslateX(e){this.eContainer.style.transform=`translateX(${e}px)`}getHScrollPosition(){return{left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth}}setCenterViewportScrollLeft(e){Xs(this.eViewport,e,this.enableRtl)}isContainerVisible(){return!at.getPinned(this.name)||!!this.pinnedWidthFeature&&this.pinnedWidthFeature.getWidth()>0}onPinnedWidthChanged(){const e=this.isContainerVisible();this.visible!=e&&(this.visible=e,this.onDisplayedRowsChanged()),as()&&this.refreshPaddingForFakeScrollbar()}onDisplayedRowsChanged(e=!1){if(this.visible){const t=this.gridOptionsService.isDomLayout("print"),i=o=>{const n=o.isFullWidth(),r=this.embedFullWidthRows||t;return this.isFullWithContainer?!r&&n:r||!n},s=this.getRowCtrls().filter(i);this.comp.setRowCtrls(s,e)}else this.comp.setRowCtrls(this.EMPTY_CTRLS,!1)}getRowCtrls(){switch(this.name){case S.TOP_CENTER:case S.TOP_LEFT:case S.TOP_RIGHT:case S.TOP_FULL_WIDTH:return this.rowRenderer.getTopRowCtrls();case S.STICKY_TOP_CENTER:case S.STICKY_TOP_LEFT:case S.STICKY_TOP_RIGHT:case S.STICKY_TOP_FULL_WIDTH:return this.rowRenderer.getStickyTopRowCtrls();case S.BOTTOM_CENTER:case S.BOTTOM_LEFT:case S.BOTTOM_RIGHT:case S.BOTTOM_FULL_WIDTH:return this.rowRenderer.getBottomRowCtrls();default:return this.rowRenderer.getRowCtrls()}}}mi([p("scrollVisibleService")],at.prototype,"scrollVisibleService",void 0),mi([p("dragService")],at.prototype,"dragService",void 0),mi([p("ctrlsService")],at.prototype,"ctrlsService",void 0),mi([p("columnModel")],at.prototype,"columnModel",void 0),mi([p("resizeObserverService")],at.prototype,"resizeObserverService",void 0),mi([p("animationFrameService")],at.prototype,"animationFrameService",void 0),mi([p("rowRenderer")],at.prototype,"rowRenderer",void 0),mi([D],at.prototype,"postConstruct",null);var Ht=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};const Jp=`<div class="ag-root ag-unselectable" role="treegrid">
<ag-header-root ref="gridHeader"></ag-header-root>
<div class="ag-floating-top" ref="eTop" role="presentation">
<ag-row-container ref="topLeftContainer" name="${S.TOP_LEFT}"></ag-row-container>
<ag-row-container ref="topCenterContainer" name="${S.TOP_CENTER}"></ag-row-container>
<ag-row-container ref="topRightContainer" name="${S.TOP_RIGHT}"></ag-row-container>
<ag-row-container ref="topFullWidthContainer" name="${S.TOP_FULL_WIDTH}"></ag-row-container>
</div>
<div class="ag-body" ref="eBody" role="presentation">
<div class="ag-body-clipper" ref="eBodyClipper" role="presentation">
<div class="ag-body-viewport" ref="eBodyViewport" role="presentation">
<ag-row-container ref="leftContainer" name="${S.LEFT}"></ag-row-container>
<ag-row-container ref="centerContainer" name="${S.CENTER}"></ag-row-container>
<ag-row-container ref="rightContainer" name="${S.RIGHT}"></ag-row-container>
<ag-row-container ref="fullWidthContainer" name="${S.FULL_WIDTH}"></ag-row-container>
</div>
</div>
<ag-fake-vertical-scroll></ag-fake-vertical-scroll>
</div>
<div class="ag-sticky-top" ref="eStickyTop" role="presentation">
<ag-row-container ref="stickyTopLeftContainer" name="${S.STICKY_TOP_LEFT}"></ag-row-container>
<ag-row-container ref="stickyTopCenterContainer" name="${S.STICKY_TOP_CENTER}"></ag-row-container>
<ag-row-container ref="stickyTopRightContainer" name="${S.STICKY_TOP_RIGHT}"></ag-row-container>
<ag-row-container ref="stickyTopFullWidthContainer" name="${S.STICKY_TOP_FULL_WIDTH}"></ag-row-container>
</div>
<div class="ag-floating-bottom" ref="eBottom" role="presentation">
<ag-row-container ref="bottomLeftContainer" name="${S.BOTTOM_LEFT}"></ag-row-container>
<ag-row-container ref="bottomCenterContainer" name="${S.BOTTOM_CENTER}"></ag-row-container>
<ag-row-container ref="bottomRightContainer" name="${S.BOTTOM_RIGHT}"></ag-row-container>
<ag-row-container ref="bottomFullWidthContainer" name="${S.BOTTOM_FULL_WIDTH}"></ag-row-container>
</div>
<ag-fake-horizontal-scroll></ag-fake-horizontal-scroll>
<ag-overlay-wrapper></ag-overlay-wrapper>
</div>`;class yt extends V{constructor(){super(Jp)}init(){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=>pd(this.getGui(),i),setRowCount:i=>hd(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,setColumnMovingCss:(i,s)=>this.addOrRemoveCssClass(i,s),updateLayoutClasses:(i,s)=>{[this.eBodyViewport.classList,this.eBodyClipper.classList,this.eBody.classList].forEach(n=>{n.toggle(de.AUTO_HEIGHT,s.autoHeight),n.toggle(de.NORMAL,s.normal),n.toggle(de.PRINT,s.print)}),this.addOrRemoveCssClass(de.AUTO_HEIGHT,s.autoHeight),this.addOrRemoveCssClass(de.NORMAL,s.normal),this.addOrRemoveCssClass(de.PRINT,s.print)},setAlwaysVerticalScrollClass:(i,s)=>this.eBodyViewport.classList.toggle(cc,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 Ie),this.ctrl.setComp(t,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop),(this.rangeService||this.gridOptionsService.get("rowSelection")==="multiple")&&ud(this.getGui(),!0)}setRowAnimationCssOnBodyViewport(e,t){const i=this.eBodyViewport.classList;i.toggle(ws.ANIMATION_ON,t),i.toggle(ws.ANIMATION_OFF,!t)}getFloatingTopBottom(){return[this.eTop,this.eBottom]}}Ht([p("resizeObserverService")],yt.prototype,"resizeObserverService",void 0),Ht([X("rangeService")],yt.prototype,"rangeService",void 0),Ht([O("eBodyViewport")],yt.prototype,"eBodyViewport",void 0),Ht([O("eStickyTop")],yt.prototype,"eStickyTop",void 0),Ht([O("eTop")],yt.prototype,"eTop",void 0),Ht([O("eBottom")],yt.prototype,"eBottom",void 0),Ht([O("gridHeader")],yt.prototype,"headerRootComp",void 0),Ht([O("eBodyClipper")],yt.prototype,"eBodyClipper",void 0),Ht([O("eBody")],yt.prototype,"eBody",void 0),Ht([D],yt.prototype,"init",null);var Ul=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let vo=class extends T{postConstruct(){this.addManagedListener(this.eventService,u.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,u.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onDisplayedColumnsWidthChanged.bind(this))}onDisplayedColumnsChanged(){this.update()}onDisplayedColumnsWidthChanged(){this.update()}update(){this.updateImpl(),setTimeout(this.updateImpl.bind(this),500)}updateImpl(){const e=this.ctrlsService.getCenterRowContainerCtrl();if(!e)return;const t={horizontalScrollShowing:e.isHorizontalScrollShowing(),verticalScrollShowing:this.isVerticalScrollShowing()};this.setScrollsVisible(t)}setScrollsVisible(e){if(this.horizontalScrollShowing!==e.horizontalScrollShowing||this.verticalScrollShowing!==e.verticalScrollShowing){this.horizontalScrollShowing=e.horizontalScrollShowing,this.verticalScrollShowing=e.verticalScrollShowing;const i={type:u.EVENT_SCROLL_VISIBILITY_CHANGED};this.eventService.dispatchEvent(i)}}isHorizontalScrollShowing(){return this.horizontalScrollShowing}isVerticalScrollShowing(){return this.verticalScrollShowing}};Ul([p("ctrlsService")],vo.prototype,"ctrlsService",void 0),Ul([D],vo.prototype,"postConstruct",null),vo=Ul([M("scrollVisibleService")],vo);var fc=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},wo;let ys=wo=class extends T{constructor(){super(...arguments),this.gridInstanceId=wo.gridInstanceSequence.next()}stampTopLevelGridCompWithGridInstance(e){e[wo.GRID_DOM_KEY]=this.gridInstanceId}getRenderedCellForEvent(e){return pn(this.gridOptionsService,e.target,St.DOM_DATA_KEY_CELL_CTRL)}isEventFromThisGrid(e){return this.isElementInThisGrid(e.target)}isElementInThisGrid(e){let t=e;for(;t;){const i=t[wo.GRID_DOM_KEY];if(R(i))return i===this.gridInstanceId;t=t.parentElement}return!1}getCellPositionForEvent(e){const t=this.getRenderedCellForEvent(e);return t?t.getCellPosition():null}getNormalisedPosition(e){const t=this.gridOptionsService.isDomLayout("normal"),i=e;let s,o;if(i.clientX!=null||i.clientY!=null?(s=i.clientX,o=i.clientY):(s=i.x,o=i.y),t){const n=this.ctrlsService.getGridBodyCtrl(),r=n.getScrollFeature().getVScrollPosition(),a=n.getScrollFeature().getHScrollPosition();s+=a.left,o+=r.top}return{x:s,y:o}}};ys.gridInstanceSequence=new us,ys.GRID_DOM_KEY="__ag_grid_instance",fc([p("ctrlsService")],ys.prototype,"ctrlsService",void 0),ys=wo=fc([M("mouseEventService")],ys);var _e=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let Ee=class extends T{constructor(){super(),this.onPageDown=Ar(this.onPageDown,100),this.onPageUp=Ar(this.onPageUp,100)}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCon=e.gridBodyCtrl})}handlePageScrollingKey(e,t=!1){const i=e.key,s=e.altKey,o=e.ctrlKey||e.metaKey,n=!!this.rangeService&&e.shiftKey,r=this.mouseEventService.getCellPositionForEvent(e);let a=!1;switch(i){case w.PAGE_HOME:case w.PAGE_END:!o&&!s&&(this.onHomeOrEndKey(i),a=!0);break;case w.LEFT:case w.RIGHT:case w.UP:case w.DOWN:if(!r)return!1;o&&!s&&!n&&(this.onCtrlUpDownLeftRight(i,r),a=!0);break;case w.PAGE_DOWN:case w.PAGE_UP:!o&&!s&&(a=this.handlePageUpDown(i,r,t));break}return a&&e.preventDefault(),a}handlePageUpDown(e,t,i){return i&&(t=this.focusService.getFocusedCell()),t?(e===w.PAGE_UP?this.onPageUp(t):this.onPageDown(t),!0):!1}navigateTo(e){const{scrollIndex:t,scrollType:i,scrollColumn:s,focusIndex:o,focusColumn:n}=e;if(R(s)&&!s.isPinned()&&this.gridBodyCon.getScrollFeature().ensureColumnVisible(s),R(t)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(t,i),e.isAsync||this.gridBodyCon.getScrollFeature().ensureIndexVisible(o),this.focusService.setFocusedCell({rowIndex:o,column:n,rowPinned:null,forceBrowserFocus:!0}),this.rangeService){const r={rowIndex:o,rowPinned:null,column:n};this.rangeService.setRangeToCell(r)}}onPageDown(e){const i=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),s=this.getViewportHeight(),o=this.paginationProxy.getPixelOffset(),n=i.top+s,r=this.paginationProxy.getRowIndexAtPixel(n+o);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,r):this.navigateToNextPage(e,r)}onPageUp(e){const i=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),s=this.paginationProxy.getPixelOffset(),o=i.top,n=this.paginationProxy.getRowIndexAtPixel(o+s);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,n,!0):this.navigateToNextPage(e,n,!0)}navigateToNextPage(e,t,i=!1){const s=this.getViewportHeight(),o=this.paginationProxy.getPageFirstRow(),n=this.paginationProxy.getPageLastRow(),r=this.paginationProxy.getPixelOffset(),a=this.paginationProxy.getRow(e.rowIndex),d=i?(a==null?void 0:a.rowHeight)-s-r:s-r,c=(a==null?void 0:a.rowTop)+d;let h=this.paginationProxy.getRowIndexAtPixel(c+r);if(h===e.rowIndex){const f=i?-1:1;t=h=e.rowIndex+f}let g;i?(g="bottom",h<o&&(h=o),t<o&&(t=o)):(g="top",h>n&&(h=n),t>n&&(t=n)),this.isRowTallerThanView(h)&&(t=h,g="top"),this.navigateTo({scrollIndex:t,scrollType:g,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){var i;const s=t?-1:1,o=this.getViewportHeight(),n=this.paginationProxy.getPageLastRow();let r=0,a=e.rowIndex;for(;a>=0&&a<=n;){const d=this.paginationProxy.getRow(a);if(d){const c=(i=d.rowHeight)!==null&&i!==void 0?i:0;if(r+c>o)break;r+=c}a+=s}return Math.max(0,Math.min(a,n))}getViewportHeight(){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),i=this.gridOptionsService.getScrollbarWidth();let s=t.bottom-t.top;return this.ctrlsService.getCenterRowContainerCtrl().isHorizontalScrollShowing()&&(s-=i),s}isRowTallerThanView(e){const t=this.paginationProxy.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,column:o}=i;this.navigateTo({scrollIndex:s,scrollType:null,scrollColumn:o,focusIndex:s,focusColumn:o})}onHomeOrEndKey(e){const t=e===w.PAGE_HOME,i=this.columnModel.getAllDisplayedColumns(),s=t?i[0]:Z(i),o=t?this.paginationProxy.getPageFirstRow():this.paginationProxy.getPageLastRow();this.navigateTo({scrollIndex:o,scrollType:null,scrollColumn:s,focusIndex:o,focusColumn:s})}onTabKeyDown(e,t){const i=t.shiftKey;if(this.tabToNextCellCommon(e,i,t)){t.preventDefault();return}if(i){const{rowIndex:o,rowPinned:n}=e.getRowPosition();(n?o===0:o===this.paginationProxy.getPageFirstRow())&&(this.gridOptionsService.getNum("headerHeight")===0?this.focusService.focusNextGridCoreContainer(!0,!0):(t.preventDefault(),this.focusService.focusLastHeader(t)))}else e instanceof St&&e.focusCell(!0),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 St){const r=e.getRowCtrl();r&&(s=r.isEditing())}let o;return s?this.gridOptionsService.get("editType")==="fullRow"?o=this.moveToNextEditingRow(e,t,i):o=this.moveToNextEditingCell(e,t,i):o=this.moveToNextCellNotEditing(e,t),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==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==null)return!1;const n=o.getCellPosition(),r=this.isCellEditable(s),a=this.isCellEditable(n),d=n&&s.rowIndex===n.rowIndex&&s.rowPinned===n.rowPinned;return r&&e.setFocusOutOnEditor(),d||(e.getRowCtrl().stopEditing(),o.getRowCtrl().startRowEditing(void 0,void 0,i)),a?(o.setFocusInOnEditor(),o.focusCell()):o.focusCell(!0),!0}moveToNextCellNotEditing(e,t){const i=this.columnModel.getAllDisplayedColumns();let s;e instanceof Et?s=Object.assign(Object.assign({},e.getRowPosition()),{column:t?i[0]:Z(i)}):s=e.getCellPosition();const o=this.findNextCellToFocusOn(s,t,!1);if(o instanceof St)o.focusCell(!0);else if(o)return this.tryToFocusFullWidthRow(o.getRowPosition(),t);return R(o)}findNextCellToFocusOn(e,t,i){let s=e;for(;;){e!==s&&(e=s),t||(s=this.getLastCellOfColSpan(s)),s=this.cellNavigationService.getNextTabbedCell(s,t);const o=this.gridOptionsService.getCallback("tabToNextCell");if(R(o)){const d=o({backwards:t,editing:i,previousCellPosition:e,nextCellPosition:s||null});R(d)?(d.floating&&(Y(()=>{console.warn("AG Grid: tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?")},"no floating in userCell"),d.rowPinned=d.floating),s={rowIndex:d.rowIndex,column:d.column,rowPinned:d.rowPinned}):s=null}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}}),null}const n=this.gridOptionsService.get("editType")==="fullRow";if(i&&!n&&!this.isCellEditable(s))continue;this.ensureCellVisible(s);const r=this.getCellByPosition(s);if(!r){const a=this.rowRenderer.getRowByPosition(s);if(!a||!a.isFullWidth()||i)continue;return a}if(!r.isSuppressNavigable())return this.rangeService&&this.rangeService.setRangeToCell(s),r}}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.paginationProxy.getRow(e.rowIndex)}navigateToNextCell(e,t,i,s){let o=i,n=!1;for(;o&&(o===i||!this.isValidNavigateCell(o));)this.gridOptionsService.is("enableRtl")?t===w.LEFT&&(o=this.getLastCellOfColSpan(o)):t===w.RIGHT&&(o=this.getLastCellOfColSpan(o)),o=this.cellNavigationService.getNextCellToFocus(t,o),n=x(o);if(n&&e&&e.key===w.UP&&(o={rowIndex:-1,rowPinned:null,column:i.column}),s){const a=this.gridOptionsService.getCallback("navigateToNextCell");if(R(a)){const c=a({key:t,previousCellPosition:i,nextCellPosition:o||null,event:e});R(c)?(c.floating&&(Y(()=>{console.warn("AG Grid: tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?")},"no floating in userCell"),c.rowPinned=c.floating),o={rowPinned:c.rowPinned,rowIndex:c.rowIndex,column:c.column}):o=null}}if(!o)return;if(o.rowIndex<0){const a=this.headerNavigationService.getHeaderRowCount();this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:a+o.rowIndex,column:i.column},event:e||void 0});return}const r=this.getNormalisedPosition(o);r?this.focusPosition(r):this.tryToFocusFullWidthRow(o)}getNormalisedPosition(e){this.ensureCellVisible(e);const t=this.getCellByPosition(e);return t?(e=t.getCellPosition(),this.ensureCellVisible(e),e):null}tryToFocusFullWidthRow(e,t=!1){const i=this.columnModel.getAllDisplayedColumns(),s=this.rowRenderer.getRowByPosition(e);if(!s||!s.isFullWidth())return!1;const o=this.focusService.getFocusedCell(),n={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column||(t?Z(i):i[0])};this.focusPosition(n);const r=o!=null?this.rowPositionUtils.before(n,o):!1,a={type:u.EVENT_FULL_WIDTH_ROW_FOCUSED,rowIndex:n.rowIndex,rowPinned:n.rowPinned,column:n.column,isFullWidthCell:!0,floating:n.rowPinned,fromBelow:r};return this.eventService.dispatchEvent(a),!0}focusPosition(e){this.focusService.setFocusedCell({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0}),this.rangeService&&this.rangeService.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:Z(i),rowPinned:e.rowPinned}}ensureCellVisible(e){const t=this.gridOptionsService.isGroupRowsSticky(),i=this.rowModel.getRow(e.rowIndex);!(t&&(i==null?void 0:i.sticky))&&x(e.rowPinned)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(e.rowIndex),e.column.isPinned()||this.gridBodyCon.getScrollFeature().ensureColumnVisible(e.column)}};_e([p("mouseEventService")],Ee.prototype,"mouseEventService",void 0),_e([p("paginationProxy")],Ee.prototype,"paginationProxy",void 0),_e([p("focusService")],Ee.prototype,"focusService",void 0),_e([X("rangeService")],Ee.prototype,"rangeService",void 0),_e([p("columnModel")],Ee.prototype,"columnModel",void 0),_e([p("rowModel")],Ee.prototype,"rowModel",void 0),_e([p("ctrlsService")],Ee.prototype,"ctrlsService",void 0),_e([p("rowRenderer")],Ee.prototype,"rowRenderer",void 0),_e([p("headerNavigationService")],Ee.prototype,"headerNavigationService",void 0),_e([p("rowPositionUtils")],Ee.prototype,"rowPositionUtils",void 0),_e([p("cellNavigationService")],Ee.prototype,"cellNavigationService",void 0),_e([p("pinnedRowModel")],Ee.prototype,"pinnedRowModel",void 0),_e([D],Ee.prototype,"postConstruct",null),Ee=_e([M("navigationService")],Ee);var Zp=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class So extends gs{constructor(e){super('<div class="ag-popup-editor" tabindex="-1"/>'),this.params=e}postConstruct(){this.gridOptionsService.setDomData(this.getGui(),So.DOM_KEY_POPUP_EDITOR_WRAPPER,!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params,i=s=>{An(this.gridOptionsService,s,t.node,t.column,!0)||t.onKeyDown(s)};this.addManagedListener(e,"keydown",i)}}So.DOM_KEY_POPUP_EDITOR_WRAPPER="popupEditorWrapper",Zp([D],So.prototype,"postConstruct",null);class eg extends V{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.setTemplate(`<div comp-id="${this.getCompId()}"/>`);const n=this.getGui();this.forceWrapper=t.isForceWrapper(),this.refreshWrapper(!1);const r=(d,c,h)=>{const g=h||n;c!=null&&c!=""?g.setAttribute(d,c):g.removeAttribute(d)},a={addOrRemoveCssClass:(d,c)=>this.addOrRemoveCssClass(d,c),setUserStyles:d=>gl(n,d),getFocusableElement:()=>this.getFocusableElement(),setTabIndex:d=>r("tabindex",d.toString()),setRole:d=>pe(n,d),setColId:d=>r("col-id",d),setTitle:d=>r("title",d),setIncludeSelection:d=>this.includeSelection=d,setIncludeRowDrag:d=>this.includeRowDrag=d,setIncludeDndSource:d=>this.includeDndSource=d,setRenderDetails:(d,c,h)=>this.setRenderDetails(d,c,h),setEditDetails:(d,c,h)=>this.setEditDetails(d,c,h),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue()};this.cellCtrl=t,t.setComp(a,this.getGui(),this.eCellWrapper,i,o)}getParentOfValue(){return this.eCellValue?this.eCellValue:this.eCellWrapper?this.eCellWrapper:this.getGui()}setRenderDetails(e,t,i){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=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;s&&(this.eCellWrapper=fe('<div class="ag-cell-wrapper" role="presentation"></div>'),this.getGui().appendChild(this.eCellWrapper));const o=!i&&this.eCellWrapper!=null;o&&(Xt(this.eCellWrapper),this.eCellWrapper=void 0),this.addOrRemoveCssClass("ag-cell-value",!i);const n=!e&&i,r=n&&this.eCellValue==null;r&&(this.eCellValue=fe('<span class="ag-cell-value" role="presentation"></span>'),this.eCellWrapper.appendChild(this.eCellValue));const a=!n&&this.eCellValue!=null;a&&(Xt(this.eCellValue),this.eCellValue=void 0);const d=s||o||r||a;return d&&this.removeControls(),e||t&&this.addControls(),d}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)return;const{params:n}=e;o.then(a=>this.afterCellEditorCreated(s,a,n,t,i)),x(this.cellEditor)&&n.cellStartedEdit&&this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(e){const t=this.getParentOfValue();We(t);const i=e!=null?It(e):null;i!=null&&(t.innerHTML=i)}destroyEditorAndRenderer(){this.destroyRenderer(),this.destroyEditor()}destroyRenderer(){const{context:e}=this.beans;this.cellRenderer=e.destroyBean(this.cellRenderer),Xt(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),Xt(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.gridOptionsService.is("suppressAnimationFrame"),s=this.rendererVersion,{componentClass:o}=e,n=()=>{if(this.rendererVersion!==s||!this.isAlive())return;const a=e.newAgStackInstance(),d=this.afterCellRendererCreated.bind(this,s,o);a&&a.then(d)};i&&this.firstRender?this.beans.animationFrameService.createTask(n,this.rowNode.rowIndex,"createTasksP2"):n()}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();We(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){console.warn(`AG Grid: cellEditor for column ${this.column.getId()} is missing getGui() method`),this.beans.context.destroyBean(t);return}this.cellEditor=t,this.cellEditorGui=t.getGui();const a=s||t.isPopup!==void 0&&t.isPopup();a?this.addPopupCellEditor(i,o):this.addInCellEditor(),this.refreshEditStyles(!0,a),t.afterGuiAttached&&t.afterGuiAttached()}refreshEditStyles(e,t){var i;this.addOrRemoveCssClass("ag-cell-inline-editing",e&&!t),this.addOrRemoveCssClass("ag-cell-popup-editing",e&&!!t),this.addOrRemoveCssClass("ag-cell-not-inline-editing",!e||!!t),(i=this.rowCtrl)===null||i===void 0||i.setInlineEditingCss(e)}addInCellEditor(){const e=this.getGui(),t=this.beans.gridOptionsService.getDocument();e.contains(t.activeElement)&&e.focus(),this.destroyRenderer(),this.refreshWrapper(!0),this.clearParentOfValue(),this.cellEditorGui&&this.getParentOfValue().appendChild(this.cellEditorGui)}addPopupCellEditor(e,t){this.beans.gridOptionsService.get("editType")==="fullRow"&&console.warn("AG Grid: popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.");const i=this.cellEditor;this.cellEditorPopupWrapper=this.beans.context.createBean(new So(e));const s=this.cellEditorPopupWrapper.getGui();this.cellEditorGui&&s.appendChild(this.cellEditorGui);const o=this.beans.popupService,n=this.beans.gridOptionsService.is("stopEditingWhenCellsLoseFocus"),r=t??(i.getPopupPosition?i.getPopupPosition():"over"),a=this.beans.gridOptionsService.is("enableRtl"),d={ePopup:s,column:this.column,rowNode:this.rowNode,type:"popupCellEditor",eventSource:this.getGui(),position:r,alignSide:a?"right":"left",keepWithinBounds:!0},c=o.positionPopupByComponent.bind(o,d),h=this.beans.localeService.getLocaleTextFunc(),g=o.addPopup({modal:n,eChild:s,closeOnEsc:!0,closedCallback:()=>{this.cellCtrl.onPopupEditorClosed()},anchorToElement:this.getGui(),positionCallback:c,ariaLabel:h("ariaLabelCellEditor","Cell Editor")});g&&(this.hideEditorPopup=g.hideFunc)}detach(){this.eRow.removeChild(this.getGui())}destroy(){this.cellCtrl.stopEditing(),this.destroyEditorAndRenderer(),this.removeControls(),super.destroy()}clearParentOfValue(){const e=this.getGui(),t=this.beans.gridOptionsService.getDocument();e.contains(t.activeElement)&&Rn()&&e.focus({preventScroll:!0}),We(this.getParentOfValue())}}class tg extends V{constructor(e,t,i){super(),this.cellComps={},this.beans=t,this.rowCtrl=e,this.setTemplate(`<div comp-id="${this.getCompId()}" style="${this.getInitialStyle(i)}"/>`);const s=this.getGui(),o=s.style,n={setDomOrder:r=>this.domOrder=r,setCellCtrls:r=>this.setCellCtrls(r),showFullWidth:r=>this.showFullWidth(r),getFullWidthCellRenderer:()=>this.getFullWidthCellRenderer(),addOrRemoveCssClass:(r,a)=>this.addOrRemoveCssClass(r,a),setUserStyles:r=>gl(s,r),setTop:r=>o.top=r,setTransform:r=>o.transform=r,setRowIndex:r=>s.setAttribute("row-index",r),setRole:r=>pe(s,r),setRowId:r=>s.setAttribute("row-id",r),setRowBusinessKey:r=>s.setAttribute("row-business-key",r),setTabIndex:r=>s.setAttribute("tabindex",r.toString())};e.setComp(n,this.getGui(),i),this.addDestroyFunc(()=>{e.unsetComp(i)})}getInitialStyle(e){const t=this.rowCtrl.getInitialTransform(e),i=this.rowCtrl.getInitialRowTop(e);return t?`transform: ${t}`:`top: ${i}`}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&&i.then(t)}setCellCtrls(e){const t=Object.assign({},this.cellComps);e.forEach(s=>{const o=s.getInstanceId();this.cellComps[o]==null?this.newCellComp(s):t[o]=null});const i=At(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.getInstanceId()];s&&t.push(s.getGui())}),pl(this.getGui(),t)}newCellComp(e){const t=new eg(this.beans,e,this.rowCtrl.isPrintLayout(),this.getGui(),this.rowCtrl.isEditing());this.cellComps[e.getInstanceId()]=t,this.getGui().appendChild(t.getGui())}destroy(){super.destroy(),this.destroyAllCells()}destroyAllCells(){const e=At(this.cellComps).filter(t=>t!=null);this.destroyCells(e)}setFullWidthRowComp(e){this.fullWidthCellRenderer&&console.error("AG Grid - should not be setting fullWidthRowComponent twice"),this.fullWidthCellRenderer=e,this.addDestroyFunc(()=>{this.fullWidthCellRenderer=this.beans.context.destroyBean(this.fullWidthCellRenderer)})}getFullWidthCellRenderer(){return this.fullWidthCellRenderer}destroyCells(e){e.forEach(t=>{if(!t)return;const i=t.getCtrl().getInstanceId();this.cellComps[i]===t&&(t.detach(),t.destroy(),this.cellComps[i]=null)})}}var Rs=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};function ig(){const l=V.elementGettingCreated.getAttribute("name"),e=at.getRowContainerCssClasses(l);let t;const i=l===S.CENTER,s=l===S.TOP_CENTER||l===S.STICKY_TOP_CENTER||l===S.BOTTOM_CENTER;return i?t=`<div class="${e.wrapper}" ref="eWrapper" role="presentation">
<div class="${e.viewport}" ref="eViewport" role="presentation">
<div class="${e.container}" ref="eContainer"></div>
</div>
</div>`:s?t=`<div class="${e.viewport}" ref="eViewport" role="presentation">
<div class="${e.container}" ref="eContainer"></div>
</div>`:t=`<div class="${e.container}" ref="eContainer"></div>`,t}class ji extends V{constructor(){super(ig()),this.rowComps={},this.name=V.elementGettingCreated.getAttribute("name"),this.type=Yp(this.name)}postConstruct(){const e={setViewportHeight:i=>this.eViewport.style.height=i,setRowCtrls:i=>this.setRowCtrls(i),setDomOrder:i=>{this.domOrder=i},setContainerWidth:i=>this.eContainer.style.width=i};this.createManagedBean(new at(this.name)).setComp(e,this.eContainer,this.eViewport,this.eWrapper)}preDestroy(){this.setRowCtrls([])}setRowCtrls(e){const t=Object.assign({},this.rowComps);this.rowComps={},this.lastPlacedElement=null;const i=s=>{const o=s.getInstanceId(),n=t[o];if(n)this.rowComps[o]=n,delete t[o],this.ensureDomOrder(n.getGui());else{if(!s.getRowNode().displayed)return;const r=new tg(s,this.beans,this.type);this.rowComps[o]=r,this.appendRow(r.getGui())}};e.forEach(i),At(t).forEach(s=>{this.eContainer.removeChild(s.getGui()),s.destroy()}),pe(this.eContainer,e.length?"rowgroup":"presentation")}appendRow(e){this.domOrder?Dd(this.eContainer,e,this.lastPlacedElement):this.eContainer.appendChild(e),this.lastPlacedElement=e}ensureDomOrder(e){this.domOrder&&(hl(this.eContainer,e,this.lastPlacedElement),this.lastPlacedElement=e)}}Rs([p("beans")],ji.prototype,"beans",void 0),Rs([O("eViewport")],ji.prototype,"eViewport",void 0),Rs([O("eContainer")],ji.prototype,"eContainer",void 0),Rs([O("eWrapper")],ji.prototype,"eWrapper",void 0),Rs([D],ji.prototype,"postConstruct",null),Rs([he],ji.prototype,"preDestroy",null);var Cc=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class jl{constructor(e){this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[],this.pinned=e}onDragEnter(e){if(this.clearColumnsList(),this.gridOptionsService.is("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?q.ICON_PINNED:q.ICON_MOVE:null}onDragLeave(e){this.clearColumnsList()}clearColumnsList(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0}onDragging(e){}onDragStop(e){this.columnsToAggregate.length>0&&this.columnModel.addValueColumns(this.columnsToAggregate,"toolPanelDragAndDrop"),this.columnsToGroup.length>0&&this.columnModel.addRowGroupColumns(this.columnsToGroup,"toolPanelDragAndDrop"),this.columnsToPivot.length>0&&this.columnModel.addPivotColumns(this.columnsToPivot,"toolPanelDragAndDrop")}}Cc([p("columnModel")],jl.prototype,"columnModel",void 0),Cc([p("gridOptionsService")],jl.prototype,"gridOptionsService",void 0);var Eo=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class bs{constructor(e,t){this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.pinned=e,this.eContainer=t,this.centerContainer=!R(e)}init(){this.ctrlsService.whenReady(()=>{this.gridBodyCon=this.ctrlsService.getGridBodyCtrl()})}getIconName(){return this.pinned?q.ICON_PINNED:q.ICON_MOVE}onDragEnter(e){const t=e.dragItem.columns;if(e.dragSource.type===Oe.ToolPanel)this.setColumnsVisible(t,!0,"uiColumnDragged");else{const s=e.dragItem.visibleState,o=(t||[]).filter(n=>s[n.getId()]);this.setColumnsVisible(o,!0,"uiColumnDragged")}this.setColumnsPinned(t,this.pinned,"uiColumnDragged"),this.onDragging(e,!0,!0)}onDragLeave(){this.ensureIntervalCleared(),this.lastMovedInfo=null}setColumnsVisible(e,t,i="api"){if(e){const s=e.filter(o=>!o.getColDef().lockVisible);this.columnModel.setColumnsVisible(s,t,i)}}setColumnsPinned(e,t,i="api"){if(e){const s=e.filter(o=>!o.getColDef().lockPinned);this.columnModel.setColumnsPinned(s,t,i)}}onDragStop(){this.onDragging(this.lastDraggingEvent,!1,!0,!0),this.ensureIntervalCleared(),this.lastMovedInfo=null}normaliseX(e){return this.gridOptionsService.is("enableRtl")&&(e=this.eContainer.clientWidth-e),this.centerContainer&&(e+=this.ctrlsService.getCenterRowContainerCtrl().getCenterViewportScrollLeft()),e}checkCenterForScrolling(e){if(this.centerContainer){const t=this.ctrlsService.getCenterRowContainerCtrl().getCenterViewportScrollLeft(),i=t+this.ctrlsService.getCenterRowContainerCtrl().getCenterWidth();this.gridOptionsService.is("enableRtl")?(this.needToMoveRight=e<t+50,this.needToMoveLeft=e>i-50):(this.needToMoveLeft=e<t+50,this.needToMoveRight=e>i-50),this.needToMoveLeft||this.needToMoveRight?this.ensureIntervalStarted():this.ensureIntervalCleared()}}onDragging(e=this.lastDraggingEvent,t=!1,i=!1,s=!1){var o;if(s){if(this.lastMovedInfo){const{columns:c,toIndex:h}=this.lastMovedInfo;this.moveColumns(c,h,"uiColumnMoved",!0)}return}if(this.lastDraggingEvent=e,x(e.hDirection))return;const n=this.normaliseX(e.x);t||this.checkCenterForScrolling(n);const r=this.normaliseDirection(e.hDirection),a=e.dragSource.type,d=((o=e.dragSource.getDragItem().columns)===null||o===void 0?void 0:o.filter(c=>c.getColDef().lockPinned?c.getPinned()==this.pinned:!0))||[];this.attemptMoveColumns({dragSourceType:a,allMovingColumns:d,hDirection:r,mouseX:n,fromEnter:t,fakeEvent:i})}normaliseDirection(e){if(this.gridOptionsService.is("enableRtl"))switch(e){case _t.Left:return _t.Right;case _t.Right:return _t.Left;default:console.error(`AG Grid: Unknown direction ${e}`)}else return e}attemptMoveColumns(e){const{dragSourceType:t,hDirection:i,mouseX:s,fromEnter:o,fakeEvent:n}=e,r=i===_t.Left,a=i===_t.Right;let{allMovingColumns:d}=e;if(t===Oe.HeaderCell){let E=[];d.forEach(b=>{let _=null,F=b.getParent();for(;F!=null&&F.getDisplayedLeafColumns().length===1;)_=F,F=F.getParent();_!=null?_.getProvidedColumnGroup().getLeafColumns().forEach(I=>{E.includes(I)||E.push(I)}):E.includes(b)||E.push(b)}),d=E}const c=d.slice();this.columnModel.sortColumnsLikeGridColumns(c);const h=this.calculateValidMoves(c,a,s),g=this.calculateOldIndex(c);if(h.length===0)return;const f=h[0];let m=g!==null&&!o;if(t==Oe.HeaderCell&&(m=g!==null),m&&!n&&(r&&f>=g||a&&f<=g))return;const C=this.columnModel.getAllDisplayedColumns();let y=[],v=null;for(let E=0;E<h.length;E++){const b=h[E],_=this.columnModel.getProposedColumnOrder(c,b);if(!this.columnModel.doesOrderPassRules(_))continue;const F=_.filter(I=>C.includes(I));if(v===null)v=F;else if(!G.areEqual(F,v))break;const L=this.groupFragCount(_);y.push({move:b,fragCount:L})}y.length!==0&&(y.sort((E,b)=>E.fragCount-b.fragCount),this.moveColumns(d,y[0].move,"uiColumnMoved",!1))}calculateOldIndex(e){const t=this.columnModel.getAllGridColumns(),i=ja(e.map(a=>t.indexOf(a))),s=i[0];return Z(i)-s!==i.length-1?null:s}moveColumns(e,t,i,s){this.columnModel.moveColumns(e,t,i,s),this.lastMovedInfo=s?null:{columns:e,toIndex:t}}groupFragCount(e){function t(s){let o=[],n=s.getOriginalParent();for(;n!=null;)o.push(n),n=n.getOriginalParent();return o}let i=0;for(let s=0;s<e.length-1;s++){let o=t(e[s]),n=t(e[s+1]);[o,n]=o.length>n.length?[o,n]:[n,o],o.forEach(r=>{n.indexOf(r)===-1&&i++})}return i}calculateValidMoves(e,t,i){if(this.gridOptionsService.is("suppressMovableColumns")||e.some(C=>C.getColDef().suppressMovable))return[];const o=this.columnModel.getDisplayedColumns(this.pinned),n=this.columnModel.getAllGridColumns(),r=o.filter(C=>Ze(e,C)),a=o.filter(C=>!Ze(e,C)),d=n.filter(C=>!Ze(e,C));let c=0,h=i;if(t){let C=0;r.forEach(y=>C+=y.getActualWidth()),h-=C}if(h>0){for(let C=0;C<a.length;C++){const y=a[C];if(h-=y.getActualWidth(),h<0)break;c++}t&&c++}let g;if(c>0){const C=a[c-1];g=d.indexOf(C)+1}else g=d.indexOf(a[0]),g===-1&&(g=0);const f=[g],m=(C,y)=>C-y;if(t){let C=g+1;const y=n.length-1;for(;C<=y;)f.push(C),C++;f.sort(m)}else{let C=g;const y=n.length-1;let v=n[C];for(;C<=y&&this.isColumnHidden(o,v);)C++,f.push(C),v=n[C];C=g-1;const E=0;for(;C>=E;)f.push(C),C--;f.sort(m).reverse()}return f}isColumnHidden(e,t){return e.indexOf(t)<0}ensureIntervalStarted(){this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),100),this.needToMoveLeft?this.dragAndDropService.setGhostIcon(q.ICON_LEFT,!0):this.dragAndDropService.setGhostIcon(q.ICON_RIGHT,!0))}ensureIntervalCleared(){this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.dragAndDropService.setGhostIcon(q.ICON_MOVE))}moveInterval(){let e;this.intervalCount++,e=10+this.intervalCount*5,e>100&&(e=100);let t=null;const i=this.gridBodyCon.getScrollFeature();if(this.needToMoveLeft?t=i.scrollHorizontally(-e):this.needToMoveRight&&(t=i.scrollHorizontally(e)),t!==0)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;const o=this.lastDraggingEvent.dragItem.columns.filter(n=>!n.getColDef().lockPinned);if(o.length>0&&(this.dragAndDropService.setGhostIcon(q.ICON_PINNED),this.failedMoveAttempts>7)){const n=this.needToMoveLeft?"left":"right";this.setColumnsPinned(o,n,"uiColumnDragged"),this.dragAndDropService.nudge()}}}}Eo([p("columnModel")],bs.prototype,"columnModel",void 0),Eo([p("dragAndDropService")],bs.prototype,"dragAndDropService",void 0),Eo([p("gridOptionsService")],bs.prototype,"gridOptionsService",void 0),Eo([p("ctrlsService")],bs.prototype,"ctrlsService",void 0),Eo([D],bs.prototype,"init",null);var yo=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Ts extends T{constructor(e,t){super(),this.pinned=e,this.eContainer=t}postConstruct(){this.ctrlsService.whenReady(e=>{switch(this.pinned){case"left":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.leftRowContainerCtrl.getContainerElement()],[e.bottomLeftRowContainerCtrl.getContainerElement()],[e.topLeftRowContainerCtrl.getContainerElement()]];break;case"right":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.rightRowContainerCtrl.getContainerElement()],[e.bottomRightRowContainerCtrl.getContainerElement()],[e.topRightRowContainerCtrl.getContainerElement()]];break;default:this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.centerRowContainerCtrl.getViewportElement()],[e.bottomCenterRowContainerCtrl.getViewportElement()],[e.topCenterRowContainerCtrl.getViewportElement()]];break}})}isInterestedIn(e){return e===Oe.HeaderCell||e===Oe.ToolPanel&&this.gridOptionsService.is("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}init(){this.moveColumnFeature=this.createManagedBean(new bs(this.pinned,this.eContainer)),this.bodyDropPivotTarget=this.createManagedBean(new jl(this.pinned)),this.dragAndDropService.addDropTarget(this)}getIconName(){return this.currentDropListener.getIconName()}isDropColumnInPivotMode(e){return this.columnModel.isPivotMode()&&e.dragSource.type===Oe.ToolPanel}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)}}yo([p("dragAndDropService")],Ts.prototype,"dragAndDropService",void 0),yo([p("columnModel")],Ts.prototype,"columnModel",void 0),yo([p("ctrlsService")],Ts.prototype,"ctrlsService",void 0),yo([D],Ts.prototype,"postConstruct",null),yo([D],Ts.prototype,"init",null);class mc{static getHeaderClassesFromColDef(e,t,i,s){return x(e)?[]:this.getColumnClassesFromCollDef(e.headerClass,e,t,i,s)}static getToolPanelClassesFromColDef(e,t,i,s){return x(e)?[]:this.getColumnClassesFromCollDef(e.toolPanelClass,e,t,i,s)}static getClassParams(e,t,i,s){return{colDef:e,column:i,columnGroup:s,api:t.api,columnApi:t.columnApi,context:t.context}}static getColumnClassesFromCollDef(e,t,i,s,o){if(x(e))return[];let n;if(typeof e=="function"){const r=this.getClassParams(t,i,s,o);n=e(r)}else n=e;return typeof n=="string"?[n]:Array.isArray(n)?[...n]:[]}}var Wn=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class vi extends Gl{constructor(e){super(vi.TEMPLATE,e),this.headerCompVersion=0,this.column=e.getColumnGroupChild(),this.pinned=e.getPinned()}postConstruct(){const e=this.getGui(),t=(o,n,r)=>{const a=r||e;n!=null&&n!=""?a.setAttribute(o,n):a.removeAttribute(o)},i={setWidth:o=>e.style.width=o,addOrRemoveCssClass:(o,n)=>this.addOrRemoveCssClass(o,n),setColId:o=>t("col-id",o),setTitle:o=>t("title",o),setAriaDescription:o=>rd(e,o),setAriaSort:o=>o?fd(e,o):Cd(e),setUserCompDetails:o=>this.setUserCompDetails(o),getUserCompInstance:()=>this.headerComp};this.ctrl.setComp(i,this.getGui(),this.eResize,this.eHeaderCompWrapper);const s=this.ctrl.getSelectAllGui();this.eResize.insertAdjacentElement("afterend",s)}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())}}vi.TEMPLATE=`<div class="ag-header-cell" role="columnheader" tabindex="-1">
<div ref="eResize" class="ag-header-cell-resize" role="presentation"></div>
<div ref="eHeaderCompWrapper" class="ag-header-cell-comp-wrapper" role="presentation"></div>
</div>`,Wn([O("eResize")],vi.prototype,"eResize",void 0),Wn([O("eHeaderCompWrapper")],vi.prototype,"eHeaderCompWrapper",void 0),Wn([D],vi.prototype,"postConstruct",null),Wn([he],vi.prototype,"destroyHeaderComp",null);var zl=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class zi extends Gl{constructor(e){super(zi.TEMPLATE,e)}postConstruct(){const e=this.getGui(),t=(s,o)=>o!=null?e.setAttribute(s,o):e.removeAttribute(s),i={addOrRemoveCssClass:(s,o)=>this.addOrRemoveCssClass(s,o),setResizableDisplayed:s=>z(this.eResize,s),setWidth:s=>e.style.width=s,setColId:s=>e.setAttribute("col-id",s),setAriaExpanded:s=>t("aria-expanded",s),setTitle:s=>t("title",s),setUserCompDetails:s=>this.setUserCompDetails(s)};this.ctrl.setComp(i,e,this.eResize)}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();i.appendChild(s),this.addDestroyFunc(t),this.ctrl.setDragSource(i)}}zi.TEMPLATE=`<div class="ag-header-group-cell" role="columnheader" tabindex="-1">
<div ref="eResize" class="ag-header-cell-resize" role="presentation"></div>
</div>`,zl([p("userComponentFactory")],zi.prototype,"userComponentFactory",void 0),zl([O("eResize")],zi.prototype,"eResize",void 0),zl([D],zi.prototype,"postConstruct",null);var vc=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},me;(function(l){l.COLUMN_GROUP="group",l.COLUMN="column",l.FLOATING_FILTER="filter"})(me||(me={}));class $l extends V{constructor(e){super(),this.headerComps={};const t=e.getType()==me.COLUMN_GROUP?"ag-header-row-column-group":e.getType()==me.FLOATING_FILTER?"ag-header-row-column-filter":"ag-header-row-column";this.setTemplate(`<div class="ag-header-row ${t}" role="row"></div>`),this.ctrl=e}init(){const e={setTransform:t=>this.getGui().style.transform=t,setHeight:t=>this.getGui().style.height=t,setTop:t=>this.getGui().style.top=t,setHeaderCtrls:t=>this.setHeaderCtrls(t),setWidth:t=>this.getGui().style.width=t,setAriaRowIndex:t=>$r(this.getGui(),t)};this.ctrl.setComp(e)}destroyHeaderCtrls(){this.setHeaderCtrls([])}setHeaderCtrls(e){if(!this.isAlive())return;const t=this.headerComps;this.headerComps={},e.forEach(o=>{const n=o.getInstanceId();let r=t[n];delete t[n],r==null&&(r=this.createHeaderComp(o),this.getGui().appendChild(r.getGui())),this.headerComps[n]=r}),se(t,(o,n)=>{this.getGui().removeChild(n.getGui()),this.destroyBean(n)});const i=this.gridOptionsService.is("ensureDomOrder"),s=this.gridOptionsService.isDomLayout("print");if(i||s){const o=At(this.headerComps);o.sort((r,a)=>{const d=r.getCtrl().getColumnGroupChild().getLeft(),c=a.getCtrl().getColumnGroupChild().getLeft();return d-c});const n=o.map(r=>r.getGui());pl(this.getGui(),n)}}createHeaderComp(e){let t;switch(this.ctrl.getType()){case me.COLUMN_GROUP:t=new zi(e);break;case me.FLOATING_FILTER:t=new ti(e);break;default:t=new vi(e);break}return this.createBean(t),t.setParentComponent(this),t}}vc([D],$l.prototype,"init",null),vc([he],$l.prototype,"destroyHeaderCtrls",null);var Kl=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let sg=0;class Vt extends T{constructor(e,t){super(),this.lastFocusEvent=null,this.columnGroupChild=e,this.parentRowCtrl=t,this.instanceId=e.getUniqueId()+"-"+sg++}shouldStopEventPropagation(e){const{headerRowIndex:t,column:i}=this.focusService.getFocusedHeader();return Id(this.gridOptionsService,e,t,i)}getWrapperHasFocus(){return this.gridOptionsService.getDocument().activeElement===this.eGui}setGui(e){this.eGui=e,this.addDomData()}handleKeyDown(e){const t=this.getWrapperHasFocus();switch(e.key){case w.PAGE_DOWN:case w.PAGE_UP:case w.PAGE_HOME:case w.PAGE_END:t&&e.preventDefault()}}addDomData(){const e=Vt.DOM_DATA_KEY_HEADER_CTRL;this.gridOptionsService.setDomData(this.eGui,e,this),this.addDestroyFunc(()=>this.gridOptionsService.setDomData(this.eGui,e,null))}getGui(){return this.eGui}focus(e){return this.eGui?(this.lastFocusEvent=e||null,this.eGui.focus(),!0):!1}getRowIndex(){return this.parentRowCtrl.getRowIndex()}getParentRowCtrl(){return this.parentRowCtrl}getPinned(){return this.parentRowCtrl.getPinned()}getInstanceId(){return this.instanceId}getColumnGroupChild(){return this.columnGroupChild}}Vt.DOM_DATA_KEY_HEADER_CTRL="headerCtrl",Kl([p("focusService")],Vt.prototype,"focusService",void 0),Kl([p("beans")],Vt.prototype,"beans",void 0),Kl([p("userComponentFactory")],Vt.prototype,"userComponentFactory",void 0);var og=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class kn extends T{constructor(e,t,i,s){super(),this.columnOrGroup=e,this.eCell=t,this.ariaEl=this.eCell.querySelector("[role=columnheader]")||this.eCell,this.colsSpanning=s,this.beans=i}setColsSpanning(e){this.colsSpanning=e,this.onLeftChanged()}getColumnOrGroup(){return this.beans.gridOptionsService.is("enableRtl")&&this.colsSpanning?Z(this.colsSpanning):this.columnOrGroup}postConstruct(){this.addManagedListener(this.columnOrGroup,H.EVENT_LEFT_CHANGED,this.onLeftChanged.bind(this)),this.setLeftFirstTime(),this.addManagedListener(this.eventService,u.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onLeftChanged.bind(this)),this.addManagedPropertyListener("domLayout",this.onLeftChanged.bind(this))}setLeftFirstTime(){const e=this.beans.gridOptionsService.is("suppressColumnMoveAnimation"),t=R(this.columnOrGroup.getOldLeft());this.beans.columnAnimationService.isActive()&&t&&!e?this.animateInLeft():this.onLeftChanged()}animateInLeft(){const e=this.getColumnOrGroup(),t=e.getLeft(),i=e.getOldLeft(),s=this.modifyLeftForPrintLayout(e,i),o=this.modifyLeftForPrintLayout(e,t);this.setLeft(s),this.actualLeft=o,this.beans.columnAnimationService.executeNextVMTurn(()=>{this.actualLeft===o&&this.setLeft(o)})}onLeftChanged(){const e=this.getColumnOrGroup(),t=e.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(e,t),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(e,t){if(!this.beans.gridOptionsService.isDomLayout("print")||e.getPinned()==="left")return t;const s=this.beans.columnModel.getDisplayedColumnsLeftWidth();if(e.getPinned()==="right"){const o=this.beans.columnModel.getBodyContainerWidth();return s+o+t}return s+t}setLeft(e){R(e)&&(this.eCell.style.left=`${e}px`);let t;if(this.columnOrGroup instanceof H)t=this.columnOrGroup;else{const o=this.columnOrGroup.getLeafColumns();if(!o.length)return;o.length>1&&gd(this.ariaEl,o.length),t=o[0]}const i=this.beans.columnModel.getAriaColumnIndex(t);Kr(this.ariaEl,i)}}og([D],kn.prototype,"postConstruct",null);var wc=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Ro extends T{constructor(e,t){super(),this.columns=e,this.element=t}postConstruct(){this.gridOptionsService.is("columnHoverHighlight")&&this.addMouseHoverListeners()}addMouseHoverListeners(){this.addManagedListener(this.element,"mouseout",this.onMouseOut.bind(this)),this.addManagedListener(this.element,"mouseover",this.onMouseOver.bind(this))}onMouseOut(){this.columnHoverService.clearMouseOver()}onMouseOver(){this.columnHoverService.setMouseOver(this.columns)}}wc([p("columnHoverService")],Ro.prototype,"columnHoverService",void 0),wc([D],Ro.prototype,"postConstruct",null);var Yl=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Un extends Vt{constructor(e,t){super(e,t),this.iconCreated=!1,this.column=e}setComp(e,t,i,s){super.setGui(t),this.comp=e,this.eButtonShowMainFilter=i,this.eFloatingFilterBody=s,this.setupActive(),this.setupWidth(),this.setupLeft(),this.setupHover(),this.setupFocus(),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(),this.setupUi(),this.addManagedListener(this.eButtonShowMainFilter,"click",this.showParentFilter.bind(this)),this.setupFilterChangedListener(),this.addManagedListener(this.column,H.EVENT_COL_DEF_CHANGED,this.onColDefChanged.bind(this))}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=le("filter",this.gridOptionsService,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(){this.createManagedBean(new ke(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();di(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){if(this.gridOptionsService.getDocument().activeElement===this.eGui)return;const o=this.focusService.findNextFocusableElement(this.eGui,null,e.shiftKey);if(o){this.beans.headerNavigationService.scrollToColumn(this.column),e.preventDefault(),o.focus();return}const n=this.findNextColumnWithFloatingFilter(e.shiftKey);n&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:this.getParentRowCtrl().getRowIndex(),column:n},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.columnModel;let i=this.column;do if(i=e?t.getDisplayedColBefore(i):t.getDisplayedColAfter(i),!i)break;while(!i.getColDef().filter||!i.getColDef().floatingFilter);return i}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case w.UP:case w.DOWN:t||e.preventDefault();case w.LEFT:case w.RIGHT:if(t)return;e.stopPropagation();case w.ENTER:t&&this.focusService.focusInto(this.eGui)&&e.preventDefault();break;case w.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&&_i(e.relatedTarget,"ag-floating-filter");if(i&&s&&e.target===this.eGui){const n=this.lastFocusEvent,r=!!(n&&n.key===w.TAB);if(n&&r){const a=n.shiftKey;this.focusService.focusInto(this.eGui,a)}}const o=this.getRowIndex();this.beans.focusService.setFocusedHeader(o,this.column)}setupHover(){this.createManagedBean(new Ro([this.column],this.eGui));const e=()=>{if(!this.gridOptionsService.is("columnHoverHighlight"))return;const t=this.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",t)};this.addManagedListener(this.eventService,u.EVENT_COLUMN_HOVER_CHANGED,e),e()}setupLeft(){const e=new kn(this.column,this.eGui,this.beans);this.createManagedBean(e)}setupFilterButton(){const e=this.column.getColDef();this.suppressFilterButton=e.floatingFilterComponentParams?!!e.floatingFilterComponentParams.suppressFilterButton:!1}setupUserComp(){if(!this.active)return;const e=this.filterManager.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;this.menuFactory.showMenuAfterButtonClick(this.column,e,"floatingFilter","filterMenuTab",["filterMenuTab"])}setupSyncWithFilter(){if(!this.active)return;const e=t=>{const i=this.comp.getFloatingFilterComp();i&&i.then(s=>{if(s){const o=this.filterManager.getCurrentFloatingFilterParentModel(this.column);s.onParentModelChanged(o,t)}})};this.destroySyncListener=this.addManagedListener(this.column,H.EVENT_FILTER_CHANGED,e),this.filterManager.isFilterActive(this.column)&&e(null)}setupWidth(){const e=()=>{const t=`${this.column.getActualWidth()}px`;this.comp.setWidth(t)};this.addManagedListener(this.column,H.EVENT_WIDTH_CHANGED,e),e()}setupFilterChangedListener(){this.active&&(this.destroyFilterChangedListener=this.addManagedListener(this.column,H.EVENT_FILTER_CHANGED,this.updateFilterButton.bind(this)))}updateFilterButton(){!this.suppressFilterButton&&this.comp&&this.comp.setButtonWrapperDisplayed(this.filterManager.isFilterAllowed(this.column))}onColDefChanged(){var e,t;const i=this.active;this.setupActive();const s=!i&&this.active;i&&!this.active&&((e=this.destroySyncListener)===null||e===void 0||e.call(this),(t=this.destroyFilterChangedListener)===null||t===void 0||t.call(this));const o=this.active?this.filterManager.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,n=this.comp.getFloatingFilterComp();!n||!o?this.updateCompDetails(o,s):n.then(r=>{var a;(!r||((a=this.userCompDetails)===null||a===void 0?void 0:a.componentClass)!==o.componentClass)&&this.updateCompDetails(o,s)})}updateCompDetails(e,t){this.setCompDetails(e),this.setupFilterButton(),this.setupUi(),t&&(this.setupSyncWithFilter(),this.setupFilterChangedListener())}}Yl([p("filterManager")],Un.prototype,"filterManager",void 0),Yl([p("columnHoverService")],Un.prototype,"columnHoverService",void 0),Yl([p("menuFactory")],Un.prototype,"menuFactory",void 0);var ql=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class jn extends T{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=this.column.getColDef(),t=[];let i,s;const o=()=>{if(z(this.eResize,i),!i)return;const a=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(t.push(a),s){const d=this.gridOptionsService.is("skipHeaderOnAutoSize"),c=()=>{this.columnModel.autoSizeColumn(this.column,d,"uiColumnResized")};this.eResize.addEventListener("dblclick",c);const h=new re(this.eResize);h.addEventListener(re.EVENT_DOUBLE_TAP,c),this.addDestroyFunc(()=>{this.eResize.removeEventListener("dblclick",c),h.removeEventListener(re.EVENT_DOUBLE_TAP,c),h.destroy()})}},n=()=>{t.forEach(a=>a()),t.length=0},r=()=>{const a=this.column.isResizable(),d=!this.gridOptionsService.is("suppressAutoSize")&&!e.suppressAutoSize;(a!==i||d!==s)&&(i=a,s=d,n(),o())};r(),this.addDestroyFunc(n),this.ctrl.addRefreshFunction(r)}onResizing(e,t){const i=this.normaliseResizeAmount(t),s=[{key:this.column,newWidth:this.resizeStartWidth+i}];this.columnModel.setColumnWidths(s,this.resizeWithShiftKey,e,"uiColumnResized"),e&&this.comp.addOrRemoveCssClass("ag-column-resizing",!1)}onResizeStart(e){this.resizeStartWidth=this.column.getActualWidth(),this.resizeWithShiftKey=e,this.comp.addOrRemoveCssClass("ag-column-resizing",!0)}normaliseResizeAmount(e){let t=e;const i=this.pinned!=="left",s=this.pinned==="right";return this.gridOptionsService.is("enableRtl")?i&&(t*=-1):s&&(t*=-1),t}}ql([p("horizontalResizeService")],jn.prototype,"horizontalResizeService",void 0),ql([p("columnModel")],jn.prototype,"columnModel",void 0),ql([D],jn.prototype,"postConstruct",null);var zn=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class bo extends T{constructor(e){super(),this.cbSelectAllVisible=!1,this.processingEventFromCheckbox=!1,this.column=e;const t=e.getColDef();this.filteredOnly=!!(t!=null&&t.headerCheckboxSelectionFilteredOnly),this.currentPageOnly=!!(t!=null&&t.headerCheckboxSelectionCurrentPageOnly)}onSpaceKeyDown(e){const t=this.cbSelectAll,i=this.gridOptionsService.getDocument();t.isDisplayed()&&!t.getGui().contains(i.activeElement)&&(e.preventDefault(),t.setValue(!t.getValue()))}getCheckboxGui(){return this.cbSelectAll.getGui()}setComp(e){this.headerCellCtrl=e,this.cbSelectAll=this.createManagedBean(new gi),this.cbSelectAll.addCssClass("ag-header-select-all"),pe(this.cbSelectAll.getGui(),"presentation"),this.showOrHideSelectAll(),this.addManagedListener(this.eventService,u.EVENT_NEW_COLUMNS_LOADED,this.showOrHideSelectAll.bind(this)),this.addManagedListener(this.eventService,u.EVENT_DISPLAYED_COLUMNS_CHANGED,this.showOrHideSelectAll.bind(this)),this.addManagedListener(this.eventService,u.EVENT_SELECTION_CHANGED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.eventService,u.EVENT_PAGINATION_CHANGED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.eventService,u.EVENT_MODEL_UPDATED,this.onModelChanged.bind(this)),this.addManagedListener(this.cbSelectAll,gi.EVENT_CHANGED,this.onCbSelectAll.bind(this)),wn(this.cbSelectAll.getGui(),!0),this.cbSelectAll.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()}showOrHideSelectAll(){this.cbSelectAllVisible=this.isCheckboxSelection(),this.cbSelectAll.setDisplayed(this.cbSelectAllVisible,{skipAriaHidden:!0}),this.cbSelectAllVisible&&(this.checkRightRowModelType("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.filteredOnly,this.currentPageOnly);this.cbSelectAll.setValue(e),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(`${s} (${i})`),this.headerCellCtrl.refreshAriaDescription()}checkRightRowModelType(e){const t=this.rowModel.getType();return t==="clientSide"||t==="serverSide"?!0:(console.warn(`AG Grid: ${e} is only available if using 'clientSide' or 'serverSide' rowModelType, you are using ${t}.`),!1)}onCbSelectAll(){if(this.processingEventFromCheckbox||!this.cbSelectAllVisible)return;const e=this.cbSelectAll.getValue();let t="uiSelectAll";this.currentPageOnly?t="uiSelectAllCurrentPage":this.filteredOnly&&(t="uiSelectAllFiltered");const i={source:t,justFiltered:this.filteredOnly,justCurrentPage:this.currentPageOnly};e?this.selectionService.selectAllRowNodes(i):this.selectionService.deselectAllRowNodes(i)}isCheckboxSelection(){let e=this.column.getColDef().headerCheckboxSelection;if(typeof e=="function"){const t=e,i={column:this.column,colDef:this.column.getColDef(),columnApi:this.columnApi,api:this.gridApi,context:this.gridOptionsService.context};e=t(i)}return e?this.checkRightRowModelType("headerCheckboxSelection"):!1}}zn([p("gridApi")],bo.prototype,"gridApi",void 0),zn([p("columnApi")],bo.prototype,"columnApi",void 0),zn([p("rowModel")],bo.prototype,"rowModel",void 0),zn([p("selectionService")],bo.prototype,"selectionService",void 0);var Sc=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ds;(function(l){l.TAB_GUARD="ag-tab-guard",l.TAB_GUARD_TOP="ag-tab-guard-top",l.TAB_GUARD_BOTTOM="ag-tab-guard-bottom"})(Ds||(Ds={}));class Ql extends T{constructor(e){super(),this.skipTabGuardFocus=!1;const{comp:t,eTopGuard:i,eBottomGuard:s,focusInnerElement:o,onFocusIn:n,onFocusOut:r,shouldStopEventPropagation:a,onTabKeyDown:d,handleKeyDown:c,eFocusableElement:h}=e;this.comp=t,this.eTopGuard=i,this.eBottomGuard=s,this.providedFocusInnerElement=o,this.eFocusableElement=h,this.providedFocusIn=n,this.providedFocusOut=r,this.providedShouldStopEventPropagation=a,this.providedOnTabKeyDown=d,this.providedHandleKeyDown=c}postConstruct(){this.createManagedBean(new ke(this.eFocusableElement,{shouldStopEventPropagation:()=>this.shouldStopEventPropagation(),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e),onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e)})),this.activateTabGuards(),[this.eTopGuard,this.eBottomGuard].forEach(e=>this.addManagedListener(e,"focus",this.onFocus.bind(this)))}handleKeyDown(e){this.providedHandleKeyDown&&this.providedHandleKeyDown(e)}tabGuardsAreActive(){return!!this.eTopGuard&&this.eTopGuard.hasAttribute("tabIndex")}shouldStopEventPropagation(){return this.providedShouldStopEventPropagation?this.providedShouldStopEventPropagation():!1}activateTabGuards(){const e=this.gridOptionsService.getNum("tabIndex")||0;this.comp.setTabIndex(e.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(e){if(this.skipTabGuardFocus){this.skipTabGuardFocus=!1;return}const t=e.target===this.eBottomGuard;this.providedFocusInnerElement?this.providedFocusInnerElement(t):this.focusInnerElement(t)}onFocusIn(e){this.providedFocusIn&&this.providedFocusIn(e)||this.deactivateTabGuards()}onFocusOut(e){this.providedFocusOut&&this.providedFocusOut(e)||this.eFocusableElement.contains(e.relatedTarget)||this.activateTabGuards()}onTabKeyDown(e){if(this.providedOnTabKeyDown){this.providedOnTabKeyDown(e);return}if(e.defaultPrevented)return;const t=this.tabGuardsAreActive();t&&this.deactivateTabGuards();const i=this.getNextFocusableElement(e.shiftKey);t&&setTimeout(()=>this.activateTabGuards(),0),i&&(i.focus(),e.preventDefault())}focusInnerElement(e=!1){const t=this.focusService.findFocusableElements(this.eFocusableElement);this.tabGuardsAreActive()&&(t.splice(0,1),t.splice(t.length-1,1)),t.length&&t[e?t.length-1:0].focus({preventScroll:!0})}getNextFocusableElement(e){return this.focusService.findNextFocusableElement(this.eFocusableElement,!1,e)}forceFocusOutOfContainer(e=!1){const t=e?this.eTopGuard:this.eBottomGuard;this.activateTabGuards(),this.skipTabGuardFocus=!0,t.focus()}}Sc([p("focusService")],Ql.prototype,"focusService",void 0),Sc([D],Ql.prototype,"postConstruct",null);var Rt=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},ye;let ae=ye=class extends T{static addKeyboardModeEvents(e,t){const i=ye.instancesMonitored.get(e);i&&i.length>0?i.indexOf(t)===-1&&i.push(t):(ye.instancesMonitored.set(e,[t]),e.addEventListener("keydown",ye.toggleKeyboardMode),e.addEventListener("mousedown",ye.toggleKeyboardMode))}static removeKeyboardModeEvents(e,t){const i=ye.instancesMonitored.get(e);let s=[];i&&i.length&&(s=[...i].filter(o=>o!==t),ye.instancesMonitored.set(e,s)),s.length===0&&(e.removeEventListener("keydown",ye.toggleKeyboardMode),e.removeEventListener("mousedown",ye.toggleKeyboardMode))}static toggleKeyboardMode(e){const t=ye.keyboardModeActive,i=e.type==="keydown";if(i&&(e.ctrlKey||e.metaKey||e.altKey)||t&&i||!t&&!i)return;ye.keyboardModeActive=i;const s=e.target.ownerDocument;if(!s)return;const o=ye.instancesMonitored.get(s);o&&o.forEach(n=>{n.dispatchEvent({type:i?u.EVENT_KEYBOARD_FOCUS:u.EVENT_MOUSE_FOCUS})})}init(){const e=this.clearFocusedCell.bind(this);this.addManagedListener(this.eventService,u.EVENT_COLUMN_PIVOT_MODE_CHANGED,e),this.addManagedListener(this.eventService,u.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverythingChanged.bind(this)),this.addManagedListener(this.eventService,u.EVENT_COLUMN_GROUP_OPENED,e),this.addManagedListener(this.eventService,u.EVENT_COLUMN_ROW_GROUP_CHANGED,e),this.ctrlsService.whenReady(t=>{this.gridCtrl=t.gridCtrl;const i=this.gridOptionsService.getDocument();ye.addKeyboardModeEvents(i,this.gridCtrl),this.addDestroyFunc(()=>this.unregisterGridCompController(this.gridCtrl))})}unregisterGridCompController(e){const t=this.gridOptionsService.getDocument();ye.removeKeyboardModeEvents(t,e)}onColumnEverythingChanged(){if(!this.focusedCellPosition)return;const e=this.focusedCellPosition.column,t=this.columnModel.getGridColumn(e.getId());e!==t&&this.clearFocusedCell()}isKeyboardMode(){return ye.keyboardModeActive}getFocusCellToUseAfterRefresh(){const e=this.gridOptionsService.getDocument();return this.gridOptionsService.is("suppressFocusAfterRefresh")||!this.focusedCellPosition||this.isDomDataMissingInHierarchy(e.activeElement,Et.DOM_DATA_KEY_ROW_CTRL)?null:this.focusedCellPosition}getFocusHeaderToUseAfterRefresh(){const e=this.gridOptionsService.getDocument();return this.gridOptionsService.is("suppressFocusAfterRefresh")||!this.focusedHeaderPosition||this.isDomDataMissingInHierarchy(e.activeElement,Vt.DOM_DATA_KEY_HEADER_CTRL)?null:this.focusedHeaderPosition}isDomDataMissingInHierarchy(e,t){let i=e;for(;i;){if(this.gridOptionsService.getDomData(i,t))return!1;i=i.parentNode}return!0}getFocusedCell(){return this.focusedCellPosition}shouldRestoreFocus(e){return this.isCellRestoreFocused(e)?(setTimeout(()=>{this.restoredFocusedCellPosition=null},0),!0):!1}isCellRestoreFocused(e){return this.restoredFocusedCellPosition==null?!1:this.cellPositionUtils.equals(e,this.restoredFocusedCellPosition)}setRestoreFocusedCell(e){this.getFrameworkOverrides().renderingEngine==="react"&&(this.restoredFocusedCellPosition=e)}getFocusEventParams(){const{rowIndex:e,rowPinned:t,column:i}=this.focusedCellPosition,s={rowIndex:e,rowPinned:t,column:i,isFullWidthCell:!1},o=this.rowRenderer.getRowByPosition({rowIndex:e,rowPinned:t});return o&&(s.isFullWidthCell=o.isFullWidth()),s}clearFocusedCell(){if(this.restoredFocusedCellPosition=null,this.focusedCellPosition==null)return;const e=Object.assign({type:u.EVENT_CELL_FOCUS_CLEARED},this.getFocusEventParams());this.focusedCellPosition=null,this.eventService.dispatchEvent(e)}setFocusedCell(e){const{column:t,rowIndex:i,rowPinned:s,forceBrowserFocus:o=!1,preventScrollOnBrowserFocus:n=!1}=e,r=this.columnModel.getGridColumn(t);if(!r){this.focusedCellPosition=null;return}this.focusedCellPosition=r?{rowIndex:i,rowPinned:li(s),column:r}:null;const a=Object.assign(Object.assign({type:u.EVENT_CELL_FOCUSED},this.getFocusEventParams()),{forceBrowserFocus:o,preventScrollOnBrowserFocus:n,floating:null});this.eventService.dispatchEvent(a)}isCellFocused(e){return this.focusedCellPosition==null?!1:this.cellPositionUtils.equals(e,this.focusedCellPosition)}isRowNodeFocused(e){return this.isRowFocused(e.rowIndex,e.rowPinned)}isHeaderWrapperFocused(e){if(this.focusedHeaderPosition==null)return!1;const t=e.getColumnGroupChild(),i=e.getRowIndex(),s=e.getPinned(),{column:o,headerRowIndex:n}=this.focusedHeaderPosition;return t===o&&i===n&&s==o.getPinned()}clearFocusedHeader(){this.focusedHeaderPosition=null}getFocusedHeader(){return this.focusedHeaderPosition}setFocusedHeader(e,t){this.focusedHeaderPosition={headerRowIndex:e,column:t}}focusHeaderPosition(e){const{direction:t,fromTab:i,allowUserOverride:s,event:o}=e;let{headerPosition:n}=e;if(s){const d=this.getFocusedHeader(),c=this.headerNavigationService.getHeaderRowCount();if(i){const h=this.gridOptionsService.getCallback("tabToNextHeader");h&&(n=h({backwards:t==="Before",previousHeaderPosition:d,nextHeaderPosition:n,headerRowCount:c}))}else{const h=this.gridOptionsService.getCallback("navigateToNextHeader");if(h&&o){const g={key:o.key,previousHeaderPosition:d,nextHeaderPosition:n,headerRowCount:c,event:o};n=h(g)}}}return n?n.headerRowIndex===-1?this.focusGridView(n.column):(this.headerNavigationService.scrollToColumn(n.column,t),this.ctrlsService.getHeaderRowContainerCtrl(n.column.getPinned()).focusHeader(n.headerRowIndex,n.column,o)):!1}focusFirstHeader(){let e=this.columnModel.getAllDisplayedColumns()[0];return e?(e.getParent()&&(e=this.columnModel.getColumnGroupAtLevel(e,0)),this.focusHeaderPosition({headerPosition:{headerRowIndex:0,column:e}})):!1}focusLastHeader(e){const t=this.headerNavigationService.getHeaderRowCount()-1,i=Z(this.columnModel.getAllDisplayedColumns());return this.focusHeaderPosition({headerPosition:{headerRowIndex:t,column:i},event:e})}isAnyCellFocused(){return!!this.focusedCellPosition}isRowFocused(e,t){return this.focusedCellPosition==null?!1:this.focusedCellPosition.rowIndex===e&&this.focusedCellPosition.rowPinned===li(t)}findFocusableElements(e,t,i=!1){const s=bd;let o=rl;t&&(o+=", "+t),i&&(o+=', [tabindex="-1"]');const n=Array.prototype.slice.apply(e.querySelectorAll(s)),r=Array.prototype.slice.apply(e.querySelectorAll(o));return r.length?((d,c)=>d.filter(h=>c.indexOf(h)===-1))(n,r):n}focusInto(e,t=!1,i=!1){const s=this.findFocusableElements(e,null,i),o=t?Z(s):s[0];return o?(o.focus({preventScroll:!0}),!0):!1}findFocusableElementBeforeTabGuard(e,t){if(!t)return null;const i=this.findFocusableElements(e),s=i.indexOf(t);if(s===-1)return null;let o=-1;for(let n=s-1;n>=0;n--)if(i[n].classList.contains(Ds.TAB_GUARD_TOP)){o=n;break}return o<=0?null:i[o-1]}findNextFocusableElement(e=this.eGridDiv,t,i){const s=this.findFocusableElements(e,t?':not([tabindex="-1"])':null),n=this.gridOptionsService.getDocument().activeElement;let r;t?r=s.findIndex(d=>d.contains(n)):r=s.indexOf(n);const a=r+(i?-1:1);return a<0||a>=s.length?null:s[a]}isTargetUnderManagedComponent(e,t){if(!t)return!1;const i=e.querySelectorAll(`.${ke.FOCUS_MANAGED_CLASS}`);if(!i.length)return!1;for(let s=0;s<i.length;s++)if(i[s].contains(t))return!0;return!1}findTabbableParent(e,t=5){let i=0;for(;e&&bn(e)===null&&++i<=t;)e=e.parentElement;return bn(e)===null?null:e}focusGridView(e,t){if(this.gridOptionsService.is("suppressCellFocus"))return t?this.focusLastHeader():this.focusNextGridCoreContainer(!1);const i=t?this.rowPositionUtils.getLastRow():this.rowPositionUtils.getFirstRow();if(!i)return!1;const{rowIndex:s,rowPinned:o}=i,n=this.getFocusedHeader();if(!e&&n&&(e=n.column),s==null||!e)return!1;if(this.navigationService.ensureCellVisible({rowIndex:s,column:e,rowPinned:o}),this.setFocusedCell({rowIndex:s,column:e,rowPinned:li(o),forceBrowserFocus:!0}),this.rangeService){const r={rowIndex:s,rowPinned:o,column:e};this.rangeService.setRangeToCell(r)}return!0}focusNextGridCoreContainer(e,t=!1){return!t&&this.gridCtrl.focusNextInnerContainer(e)?!0:((t||!e&&!this.gridCtrl.isDetailGrid())&&this.gridCtrl.forceFocusOutOfContainer(e),!1)}};ae.AG_KEYBOARD_FOCUS="ag-keyboard-focus",ae.keyboardModeActive=!1,ae.instancesMonitored=new Map,Rt([p("eGridDiv")],ae.prototype,"eGridDiv",void 0),Rt([p("columnModel")],ae.prototype,"columnModel",void 0),Rt([p("headerNavigationService")],ae.prototype,"headerNavigationService",void 0),Rt([p("rowRenderer")],ae.prototype,"rowRenderer",void 0),Rt([p("rowPositionUtils")],ae.prototype,"rowPositionUtils",void 0),Rt([p("cellPositionUtils")],ae.prototype,"cellPositionUtils",void 0),Rt([X("rangeService")],ae.prototype,"rangeService",void 0),Rt([p("navigationService")],ae.prototype,"navigationService",void 0),Rt([p("ctrlsService")],ae.prototype,"ctrlsService",void 0),Rt([D],ae.prototype,"init",null),ae=ye=Rt([M("focusService")],ae);var si=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Bt extends Vt{constructor(e,t){super(e,t),this.refreshFunctions=[],this.userHeaderClasses=new Set,this.ariaDescriptionProperties=new Map,this.column=e}setComp(e,t,i,s){super.setGui(t),this.comp=e,this.updateState(),this.setupWidth(),this.setupMovingCss(),this.setupMenuClass(),this.setupSortableClass(),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight(s),this.addColumnHoverListener(),this.setupFilterCss(),this.setupColId(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(),this.setupSelectAll(),this.setupUserComp(),this.refreshAria(),this.createManagedBean(new jn(this.getPinned(),this.column,i,e,this)),this.createManagedBean(new Ro([this.column],t)),this.createManagedBean(new kn(this.column,t,this.beans)),this.createManagedBean(new ke(t,{shouldStopEventPropagation:o=>this.shouldStopEventPropagation(o),onTabKeyDown:()=>null,handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addMouseDownListenerIfNeeded(t),this.addManagedListener(this.column,H.EVENT_COL_DEF_CHANGED,this.onColDefChanged.bind(this)),this.addManagedListener(this.eventService,u.EVENT_COLUMN_VALUE_CHANGED,this.onColumnValueChanged.bind(this)),this.addManagedListener(this.eventService,u.EVENT_COLUMN_ROW_GROUP_CHANGED,this.onColumnRowGroupChanged.bind(this)),this.addManagedListener(this.eventService,u.EVENT_COLUMN_PIVOT_CHANGED,this.onColumnPivotChanged.bind(this)),this.addManagedListener(this.eventService,u.EVENT_HEADER_HEIGHT_CHANGED,this.onHeaderHeightChanged.bind(this))}addMouseDownListenerIfNeeded(e){if(!it())return;const t=["mousedown","touchstart"],i=this.gridOptionsService.getDocument();t.forEach(s=>{this.addManagedListener(e,s,o=>{const n=i.activeElement;n!==e&&!e.contains(n)&&(e.focus(),ae.toggleKeyboardMode(o))})})}setupUserComp(){const e=this.lookupUserCompDetails();this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setUserCompDetails(e)}lookupUserCompDetails(){const e=this.createParams(),t=this.column.getColDef();return this.userComponentFactory.getHeaderCompDetails(t,e)}createParams(){const e=this.column.getColDef();return{column:this.column,displayName:this.displayName,enableSorting:e.sortable,enableMenu:this.menuEnabled,showColumnMenu:i=>{this.gridApi.showColumnMenuAfterButtonClick(this.column,i)},progressSort:i=>{this.sortController.progressSort(this.column,!!i,"uiColumnSorted")},setSort:(i,s)=>{this.sortController.setSortForColumn(this.column,i,!!s,"uiColumnSorted")},api:this.gridApi,columnApi:this.columnApi,context:this.gridOptionsService.context,eGridHeader:this.getGui()}}setupSelectAll(){this.selectAllFeature=this.createManagedBean(new bo(this.column)),this.selectAllFeature.setComp(this)}getSelectAllGui(){return this.selectAllFeature.getCheckboxGui()}handleKeyDown(e){super.handleKeyDown(e),e.key===w.SPACE&&this.selectAllFeature.onSpaceKeyDown(e),e.key===w.ENTER&&this.onEnterKeyDown(e)}onEnterKeyDown(e){const t=this.comp.getUserCompInstance();if(t){if(e.ctrlKey||e.metaKey)this.menuEnabled&&t.showMenu&&(e.preventDefault(),t.showMenu());else if(this.sortable){const i=e.shiftKey;this.sortController.progressSort(this.column,i,"uiColumnSorted")}}}isMenuEnabled(){return this.menuEnabled}onFocusIn(e){if(!this.getGui().contains(e.relatedTarget)){const t=this.getRowIndex();this.focusService.setFocusedHeader(t,this.column)}this.setActiveHeader(!0)}onFocusOut(e){this.getGui().contains(e.relatedTarget)||this.setActiveHeader(!1)}setupTooltip(){const e={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getGui:()=>this.eGui,getLocation:()=>"header",getTooltipValue:()=>this.column.getColDef().headerTooltip},t=this.createManagedBean(new Hl(e,this.beans));t.setComp(this.comp),this.refreshFunctions.push(()=>t.refreshToolTip())}setupClassesFromColDef(){const e=()=>{const t=this.column.getColDef(),i=mc.getHeaderClassesFromColDef(t,this.gridOptionsService,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.refreshFunctions.push(e),e()}setDragSource(e){if(this.dragSourceElement=e,this.removeDragSource(),!e||!this.draggable)return;const t=!this.gridOptionsService.is("suppressDragLeaveHidesColumns");this.moveDragSource={type:Oe.HeaderCell,eElement:e,defaultIconName:t?q.ICON_HIDE:q.ICON_NOT_ALLOWED,getDragItem:()=>this.createDragItem(),dragItemName:this.displayName,onDragStarted:()=>this.column.setMoving(!0,"uiColumnMoved"),onDragStopped:()=>this.column.setMoving(!1,"uiColumnMoved"),onGridEnter:i=>{var s;if(t){const o=((s=i==null?void 0:i.columns)===null||s===void 0?void 0:s.filter(n=>!n.getColDef().lockVisible))||[];this.columnModel.setColumnsVisible(o,!0,"uiColumnMoved")}},onGridExit:i=>{var s;if(t){const o=((s=i==null?void 0:i.columns)===null||s===void 0?void 0:s.filter(n=>!n.getColDef().lockVisible))||[];this.columnModel.setColumnsVisible(o,!1,"uiColumnMoved")}}},this.dragAndDropService.addDragSource(this.moveDragSource,!0)}createDragItem(){const e={};return e[this.column.getId()]=this.column.isVisible(),{columns:[this.column],visibleState:e}}removeDragSource(){this.moveDragSource&&(this.dragAndDropService.removeDragSource(this.moveDragSource),this.moveDragSource=void 0)}onColDefChanged(){this.refresh()}updateState(){const e=this.column.getColDef();this.menuEnabled=this.menuFactory.isMenuEnabled(this.column)&&!e.suppressMenu,this.sortable=e.sortable,this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()}addRefreshFunction(e){this.refreshFunctions.push(e)}refresh(){this.updateState(),this.refreshHeaderComp(),this.refreshAria(),this.refreshFunctions.forEach(e=>e())}refreshHeaderComp(){const e=this.lookupUserCompDetails();(this.comp.getUserCompInstance()!=null&&this.userCompDetails.componentClass==e.componentClass?this.attemptHeaderCompRefresh(e.params):!1)?this.setDragSource(this.dragSourceElement):this.setCompDetails(e)}attemptHeaderCompRefresh(e){const t=this.comp.getUserCompInstance();return!t||!t.refresh?!1:t.refresh(e)}calculateDisplayName(){return this.columnModel.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(){this.displayName!==this.calculateDisplayName()&&this.refresh()}workOutDraggable(){const e=this.column.getColDef();return!!(!this.gridOptionsService.is("suppressMovableColumns")&&!e.suppressMovable&&!e.lockPosition)||!!e.enableRowGroup||!!e.enablePivot}onColumnRowGroupChanged(){this.checkDisplayName()}onColumnPivotChanged(){this.checkDisplayName()}onColumnValueChanged(){this.checkDisplayName()}setupWidth(){const e=()=>{const t=this.column.getActualWidth();this.comp.setWidth(`${t}px`)};this.addManagedListener(this.column,H.EVENT_WIDTH_CHANGED,e),e()}setupMovingCss(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving())};this.addManagedListener(this.column,H.EVENT_MOVING_CHANGED,e),e()}setupMenuClass(){const e=()=>{this.comp.addOrRemoveCssClass("ag-column-menu-visible",this.column.isMenuVisible())};this.addManagedListener(this.column,H.EVENT_MENU_VISIBLE_CHANGED,e),e()}setupSortableClass(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-sortable",!!this.sortable)};e(),this.addRefreshFunction(e),this.addManagedListener(this.eventService,H.EVENT_SORT_CHANGED,this.refreshAriaSort.bind(this))}setupWrapTextClass(){const e=()=>{const t=!!this.column.getColDef().wrapHeaderText;this.comp.addOrRemoveCssClass("ag-header-cell-wrap-text",t)};e(),this.addRefreshFunction(e)}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){const{eGui:e,column:t,comp:i,columnModel:s,gridOptionsService:o}=this;if(!t.isSpanHeaderHeight())return;const{numberOfParents:n,isSpanningTotal:r}=this.getColumnGroupPaddingInfo();if(i.addOrRemoveCssClass("ag-header-span-height",n>0),n===0)return;i.addOrRemoveCssClass("ag-header-span-total",r);const d=o.is("pivotMode")?s.getPivotGroupHeaderHeight():s.getGroupHeaderHeight(),c=s.getColumnHeaderRowHeight(),h=n*d;e.style.setProperty("top",`${-h}px`),e.style.setProperty("height",`${c+h}px`)}getColumnGroupPaddingInfo(){let e=this.column.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}}setupAutoHeight(e){const t=a=>{if(!this.isAlive())return;const{paddingTop:d,paddingBottom:c,borderBottomWidth:h,borderTopWidth:g}=ui(this.getGui()),f=d+c+h+g,C=e.offsetHeight+f;if(a<5){const y=this.beans.gridOptionsService.getDocument(),v=!y||!y.contains(e),E=C==0;if(v||E){this.beans.frameworkOverrides.setTimeout(()=>t(a+1),0);return}}this.columnModel.setColumnHeaderHeight(this.column,C)};let i=!1,s;const o=()=>{const a=this.column.isAutoHeaderHeight();a&&!i&&n(),!a&&i&&r()},n=()=>{i=!0,t(0),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!0),s=this.resizeObserverService.observeResize(e,()=>t(0))},r=()=>{i=!1,s&&s(),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!1),s=void 0};o(),this.addDestroyFunc(()=>r()),this.addManagedListener(this.column,H.EVENT_WIDTH_CHANGED,()=>i&&t(0)),this.addManagedListener(this.eventService,H.EVENT_SORT_CHANGED,()=>{i&&this.beans.frameworkOverrides.setTimeout(()=>t(0))}),this.addRefreshFunction(o)}refreshAriaSort(){if(this.sortable){const e=this.localeService.getLocaleTextFunc(),t=this.sortController.getDisplaySortForColumn(this.column)||null;this.comp.setAriaSort(sd(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 CTRL ENTER to open column menu."))}else this.setAriaDescriptionProperty("menu",null)}setAriaDescriptionProperty(e,t){t!=null?this.ariaDescriptionProperties.set(e,t):this.ariaDescriptionProperties.delete(e)}refreshAriaDescription(){const e=Array.from(this.ariaDescriptionProperties.values());this.comp.setAriaDescription(e.length?e.join(" "):void 0)}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaDescription()}addColumnHoverListener(){const e=()=>{if(!this.gridOptionsService.is("columnHoverHighlight"))return;const t=this.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",t)};this.addManagedListener(this.eventService,u.EVENT_COLUMN_HOVER_CHANGED,e),e()}setupFilterCss(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-filtered",this.column.isFilterActive())};this.addManagedListener(this.column,H.EVENT_FILTER_ACTIVE_CHANGED,e),e()}setupColId(){this.comp.setColId(this.column.getColId())}addActiveHeaderMouseListeners(){const e=t=>this.setActiveHeader(t.type==="mouseenter");this.addManagedListener(this.getGui(),"mouseenter",e),this.addManagedListener(this.getGui(),"mouseleave",e)}setActiveHeader(e){this.comp.addOrRemoveCssClass("ag-header-active",e)}}si([p("columnModel")],Bt.prototype,"columnModel",void 0),si([p("columnHoverService")],Bt.prototype,"columnHoverService",void 0),si([p("sortController")],Bt.prototype,"sortController",void 0),si([p("menuFactory")],Bt.prototype,"menuFactory",void 0),si([p("dragAndDropService")],Bt.prototype,"dragAndDropService",void 0),si([p("resizeObserverService")],Bt.prototype,"resizeObserverService",void 0),si([p("gridApi")],Bt.prototype,"gridApi",void 0),si([p("columnApi")],Bt.prototype,"columnApi",void 0),si([he],Bt.prototype,"removeDragSource",null);var $n=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class To extends T{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.gridOptionsService.is("suppressAutoSize")){const t=this.gridOptionsService.is("skipHeaderOnAutoSize");this.eResize.addEventListener("dblclick",()=>{const i=[];this.columnGroup.getDisplayedLeafColumns().forEach(o=>{o.getColDef().suppressAutoSize||i.push(o.getColId())}),i.length>0&&this.columnModel.autoSizeColumns({columns:i,skipHeader:t,stopAtGroup:this.columnGroup,source:"uiColumnResized"}),this.resizeLeafColumnsToFit("uiColumnResized")})}}onResizeStart(e){this.calculateInitialValues();let t=null;if(e&&(t=this.columnModel.getDisplayedGroupAfter(this.columnGroup)),t){const i=t.getDisplayedLeafColumns();this.resizeTakeFromCols=i.filter(s=>s.isResizable()),this.resizeTakeFromStartWidth=0,this.resizeTakeFromCols.forEach(s=>this.resizeTakeFromStartWidth+=s.getActualWidth()),this.resizeTakeFromRatios=[],this.resizeTakeFromCols.forEach(s=>this.resizeTakeFromRatios.push(s.getActualWidth()/this.resizeTakeFromStartWidth))}else this.resizeTakeFromCols=null,this.resizeTakeFromStartWidth=null,this.resizeTakeFromRatios=null;this.comp.addOrRemoveCssClass("ag-column-resizing",!0)}onResizing(e,t,i="uiColumnResized"){const s=this.normaliseDragChange(t),o=this.resizeStartWidth+s;this.resizeColumns(o,i,e)}resizeLeafColumnsToFit(e){const t=this.autoWidthCalculator.getPreferredWidthForColumnGroup(this.columnGroup);this.calculateInitialValues(),t>this.resizeStartWidth&&this.resizeColumns(t,e,!0)}resizeColumns(e,t,i=!0){const s=[];if(s.push({columns:this.resizeCols,ratios:this.resizeRatios,width:e}),this.resizeTakeFromCols){const o=e-this.resizeStartWidth;s.push({columns:this.resizeTakeFromCols,ratios:this.resizeTakeFromRatios,width:this.resizeTakeFromStartWidth-o})}this.columnModel.resizeColumnSets({resizeSets:s,finished:i,source:t}),i&&this.comp.addOrRemoveCssClass("ag-column-resizing",!1)}calculateInitialValues(){const e=this.columnGroup.getDisplayedLeafColumns();this.resizeCols=e.filter(t=>t.isResizable()),this.resizeStartWidth=0,this.resizeCols.forEach(t=>this.resizeStartWidth+=t.getActualWidth()),this.resizeRatios=[],this.resizeCols.forEach(t=>this.resizeRatios.push(t.getActualWidth()/this.resizeStartWidth))}normaliseDragChange(e){let t=e;return this.gridOptionsService.is("enableRtl")?this.pinned!=="left"&&(t*=-1):this.pinned==="right"&&(t*=-1),t}}$n([p("horizontalResizeService")],To.prototype,"horizontalResizeService",void 0),$n([p("autoWidthCalculator")],To.prototype,"autoWidthCalculator",void 0),$n([p("columnModel")],To.prototype,"columnModel",void 0),$n([D],To.prototype,"postConstruct",null);var ng=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Ec extends T{constructor(e,t){super(),this.removeChildListenersFuncs=[],this.columnGroup=t,this.comp=e}postConstruct(){this.addListenersToChildrenColumns(),this.addManagedListener(this.columnGroup,te.EVENT_DISPLAYED_CHILDREN_CHANGED,this.onDisplayedChildrenChanged.bind(this)),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))}addListenersToChildrenColumns(){this.removeListenersOnChildrenColumns();const e=this.onWidthChanged.bind(this);this.columnGroup.getLeafColumns().forEach(t=>{t.addEventListener("widthChanged",e),t.addEventListener("visibleChanged",e),this.removeChildListenersFuncs.push(()=>{t.removeEventListener("widthChanged",e),t.removeEventListener("visibleChanged",e)})})}removeListenersOnChildrenColumns(){this.removeChildListenersFuncs.forEach(e=>e()),this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){const e=this.columnGroup.getActualWidth();this.comp.setWidth(`${e}px`),this.comp.addOrRemoveCssClass("ag-hidden",e===0)}}ng([D],Ec.prototype,"postConstruct",null);var Kn=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Do extends Vt{constructor(e,t){super(e,t),this.columnGroup=e}setComp(e,t,i){super.setGui(t),this.comp=e,this.displayName=this.columnModel.getDisplayNameForColumnGroup(this.columnGroup,"header"),this.addClasses(),this.addAttributes(),this.setupMovingCss(),this.setupExpandable(),this.setupTooltip(),this.setupUserComp();const s=this.getParentRowCtrl().getPinned(),o=this.columnGroup.getProvidedColumnGroup().getLeafColumns();this.createManagedBean(new Ro(o,t)),this.createManagedBean(new kn(this.columnGroup,t,this.beans)),this.createManagedBean(new Ec(e,this.columnGroup)),this.groupResizeFeature=this.createManagedBean(new To(e,i,s,this.columnGroup)),this.createManagedBean(new ke(t,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}resizeLeafColumnsToFit(e){this.groupResizeFeature&&this.groupResizeFeature.resizeLeafColumnsToFit(e)}setupUserComp(){let e=this.displayName;const t={displayName:this.displayName,columnGroup:this.columnGroup,setExpanded:s=>{this.columnModel.setColumnGroupOpened(this.columnGroup.getProvidedColumnGroup(),s,"gridInitializing")},api:this.gridApi,columnApi:this.columnApi,context:this.gridOptionsService.context};if(!e){let s=this.columnGroup;const o=s.getLeafColumns();for(;s.getParent()&&s.getParent().getLeafColumns().length===o.length;)s=s.getParent();const n=s.getColGroupDef();n&&(e=n.headerName),e||(e=o?this.columnModel.getDisplayNameForColumn(o[0],"header",!0):"")}const i=this.userComponentFactory.getHeaderGroupCompDetails(t);this.comp.setUserCompDetails(i)}setupTooltip(){const e=this.columnGroup.getColGroupDef(),t={getColumn:()=>this.columnGroup,getGui:()=>this.eGui,getLocation:()=>"headerGroup",getTooltipValue:()=>e&&e.headerTooltip};e&&(t.getColDef=()=>e),this.createManagedBean(new Hl(t,this.beans)).setComp(this.comp)}setupExpandable(){const e=this.columnGroup.getProvidedColumnGroup();this.refreshExpanded(),this.addManagedListener(e,ee.EVENT_EXPANDABLE_CHANGED,this.refreshExpanded.bind(this)),this.addManagedListener(e,ee.EVENT_EXPANDED_CHANGED,this.refreshExpanded.bind(this))}refreshExpanded(){const e=this.columnGroup;this.expandable=e.isExpandable();const t=e.isExpanded();this.expandable?this.comp.setAriaExpanded(t?"true":"false"):this.comp.setAriaExpanded(void 0)}addAttributes(){this.comp.setColId(this.columnGroup.getUniqueId())}addClasses(){const e=this.columnGroup.getColGroupDef(),t=mc.getHeaderClassesFromColDef(e,this.gridOptionsService,null,this.columnGroup);this.columnGroup.isPadding()?(t.push("ag-header-group-cell-no-group"),this.columnGroup.getLeafColumns().every(s=>s.isSpanHeaderHeight())&&t.push("ag-header-span-height")):t.push("ag-header-group-cell-with-group"),t.forEach(i=>this.comp.addOrRemoveCssClass(i,!0))}setupMovingCss(){const t=this.columnGroup.getProvidedColumnGroup().getLeafColumns(),i=()=>this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.columnGroup.isMoving());t.forEach(s=>{this.addManagedListener(s,H.EVENT_MOVING_CHANGED,i)}),i()}onFocusIn(e){if(!this.eGui.contains(e.relatedTarget)){const t=this.getRowIndex();this.beans.focusService.setFocusedHeader(t,this.columnGroup)}}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();if(!(!this.expandable||!t)&&e.key===w.ENTER){const i=this.columnGroup,s=!i.isExpanded();this.columnModel.setColumnGroupOpened(i.getProvidedColumnGroup(),s,"uiColumnExpanded")}}setDragSource(e){if(this.isSuppressMoving())return;const t=this.columnGroup.getProvidedColumnGroup().getLeafColumns(),i=!this.gridOptionsService.is("suppressDragLeaveHidesColumns"),s={type:Oe.HeaderCell,eElement:e,defaultIconName:i?q.ICON_HIDE:q.ICON_NOT_ALLOWED,dragItemName:this.displayName,getDragItem:this.getDragItemForGroup.bind(this),onDragStarted:()=>t.forEach(o=>o.setMoving(!0,"uiColumnDragged")),onDragStopped:()=>t.forEach(o=>o.setMoving(!1,"uiColumnDragged")),onGridEnter:o=>{var n;if(i){const r=((n=o==null?void 0:o.columns)===null||n===void 0?void 0:n.filter(a=>!a.getColDef().lockVisible))||[];this.columnModel.setColumnsVisible(r,!0,"uiColumnMoved")}},onGridExit:o=>{var n;if(i){const r=((n=o==null?void 0:o.columns)===null||n===void 0?void 0:n.filter(a=>!a.getColDef().lockVisible))||[];this.columnModel.setColumnsVisible(r,!1,"uiColumnMoved")}}};this.dragAndDropService.addDragSource(s,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(s))}getDragItemForGroup(){const e=this.columnGroup.getProvidedColumnGroup().getLeafColumns(),t={};e.forEach(s=>t[s.getId()]=s.isVisible());const i=[];return this.columnModel.getAllDisplayedColumns().forEach(s=>{e.indexOf(s)>=0&&(i.push(s),ve(e,s))}),e.forEach(s=>i.push(s)),{columns:i,visibleState:t}}isSuppressMoving(){let e=!1;return this.columnGroup.getLeafColumns().forEach(i=>{(i.getColDef().suppressMovable||i.getColDef().lockPosition)&&(e=!0)}),e||this.gridOptionsService.is("suppressMovableColumns")}}Kn([p("columnModel")],Do.prototype,"columnModel",void 0),Kn([p("dragAndDropService")],Do.prototype,"dragAndDropService",void 0),Kn([p("gridApi")],Do.prototype,"gridApi",void 0),Kn([p("columnApi")],Do.prototype,"columnApi",void 0);var yc=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let rg=0;class Oo extends T{constructor(e,t,i){super(),this.instanceId=rg++,this.headerCellCtrls={},this.rowIndex=e,this.pinned=t,this.type=i}getInstanceId(){return this.instanceId}setComp(e){this.comp=e,this.onRowHeightChanged(),this.onVirtualColumnsChanged(),this.setWidth(),this.addEventListeners(),it()&&this.comp.setTransform("translateZ(0)"),e.setAriaRowIndex(this.rowIndex+1)}addEventListeners(){this.addManagedListener(this.eventService,u.EVENT_COLUMN_RESIZED,this.onColumnResized.bind(this)),this.addManagedListener(this.eventService,u.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,u.EVENT_VIRTUAL_COLUMNS_CHANGED,this.onVirtualColumnsChanged.bind(this)),this.addManagedListener(this.eventService,u.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.eventService,u.EVENT_GRID_STYLES_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("domLayout",this.onDisplayedColumnsChanged.bind(this)),this.addManagedPropertyListener("headerHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("pivotHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("groupHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("pivotGroupHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("floatingFiltersHeight",this.onRowHeightChanged.bind(this))}getHeaderCellCtrl(e){return Ii(this.headerCellCtrls).find(t=>t.getColumnGroupChild()===e)}onDisplayedColumnsChanged(){this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}getType(){return this.type}onColumnResized(){this.setWidth()}setWidth(){const e=this.getWidthForRow();this.comp.setWidth(`${e}px`)}getWidthForRow(){return this.gridOptionsService.isDomLayout("print")?this.pinned!=null?0:this.columnModel.getContainerWidth("right")+this.columnModel.getContainerWidth("left")+this.columnModel.getContainerWidth(null):this.columnModel.getContainerWidth(this.pinned)}onRowHeightChanged(){let e=this.columnModel.getHeaderRowCount();const t=[];let i=0;this.columnModel.hasFloatingFilters()&&(e++,i=1);const s=this.columnModel.getColumnGroupHeaderRowHeight(),o=this.columnModel.getColumnHeaderRowHeight(),n=1+i,r=e-n;for(let c=0;c<r;c++)t.push(s);t.push(o);for(let c=0;c<i;c++)t.push(this.columnModel.getFloatingFiltersHeight());let a=0;for(let c=0;c<this.rowIndex;c++)a+=t[c];const d=t[this.rowIndex]+"px";this.comp.setTop(a+"px"),this.comp.setHeight(d)}getPinned(){return this.pinned}getRowIndex(){return this.rowIndex}onVirtualColumnsChanged(){const e=this.headerCellCtrls;this.headerCellCtrls={},this.getColumnsInViewport().forEach(o=>{if(o.isEmptyGroup())return;const n=o.getUniqueId();let r=e[n];if(delete e[n],r&&r.getColumnGroupChild()!=o&&(this.destroyBean(r),r=void 0),r==null)switch(this.type){case me.FLOATING_FILTER:r=this.createBean(new Un(o,this));break;case me.COLUMN_GROUP:r=this.createBean(new Do(o,this));break;default:r=this.createBean(new Bt(o,this));break}this.headerCellCtrls[n]=r});const i=o=>this.focusService.isHeaderWrapperFocused(o)?this.columnModel.isDisplayed(o.getColumnGroupChild()):!1;se(e,(o,n)=>{i(n)?this.headerCellCtrls[o]=n:this.destroyBean(n)});const s=At(this.headerCellCtrls);this.comp.setHeaderCtrls(s)}getColumnsInViewport(){return this.gridOptionsService.isDomLayout("print")?this.getColumnsInViewportPrintLayout():this.getColumnsInViewportNormalLayout()}getColumnsInViewportPrintLayout(){if(this.pinned!=null)return[];let e=[];const t=this.getActualDepth();return["left",null,"right"].forEach(i=>{const s=this.columnModel.getVirtualHeaderGroupRow(i,t);e=e.concat(s)}),e}getActualDepth(){return this.type==me.FLOATING_FILTER?this.rowIndex-1:this.rowIndex}getColumnsInViewportNormalLayout(){return this.columnModel.getVirtualHeaderGroupRow(this.pinned,this.getActualDepth())}focusHeader(e,t){const s=At(this.headerCellCtrls).find(o=>o.getColumnGroupChild()==e);return s?(s.focus(t),!0):!1}destroy(){se(this.headerCellCtrls,(e,t)=>{this.destroyBean(t)}),this.headerCellCtrls={},super.destroy()}}yc([p("columnModel")],Oo.prototype,"columnModel",void 0),yc([p("focusService")],Oo.prototype,"focusService",void 0);var Po=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Os extends T{constructor(e){super(),this.hidden=!1,this.includeFloatingFilter=!1,this.groupsRowCtrls=[],this.pinned=e}setComp(e,t){this.comp=e,this.eViewport=t,this.setupCenterWidth(),this.setupPinnedWidth(),this.setupDragAndDrop(this.eViewport),this.addManagedListener(this.eventService,u.EVENT_GRID_COLUMNS_CHANGED,this.onGridColumnsChanged.bind(this)),this.addManagedListener(this.eventService,u.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.ctrlsService.registerHeaderContainer(this,this.pinned),this.columnModel.isReady()&&this.refresh()}setupDragAndDrop(e){const t=new Ts(this.pinned,e);this.createManagedBean(t)}refresh(e=!1){const t=new us,i=this.focusService.getFocusHeaderToUseAfterRefresh(),s=()=>{const a=this.columnModel.getHeaderRowCount()-1;this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls);for(let d=0;d<a;d++){const c=this.createBean(new Oo(t.next(),this.pinned,me.COLUMN_GROUP));this.groupsRowCtrls.push(c)}},o=()=>{const a=t.next(),d=!this.hidden&&(this.columnsRowCtrl==null||!e||this.columnsRowCtrl.getRowIndex()!==a);(d||this.hidden)&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),d&&(this.columnsRowCtrl=this.createBean(new Oo(a,this.pinned,me.COLUMN)))},n=()=>{this.includeFloatingFilter=this.columnModel.hasFloatingFilters()&&!this.hidden;const a=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter){a();return}const d=t.next();if(this.filtersRowCtrl){const c=this.filtersRowCtrl.getRowIndex()!==d;(!e||c)&&a()}this.filtersRowCtrl||(this.filtersRowCtrl=this.createBean(new Oo(d,this.pinned,me.FLOATING_FILTER)))};s(),o(),n();const r=this.getAllCtrls();this.comp.setCtrls(r),this.restoreFocusOnHeader(i)}restoreFocusOnHeader(e){e==null||e.column.getPinned()!=this.pinned||this.focusService.focusHeaderPosition({headerPosition:e})}getAllCtrls(){const e=[...this.groupsRowCtrls];return this.columnsRowCtrl&&e.push(this.columnsRowCtrl),this.filtersRowCtrl&&e.push(this.filtersRowCtrl),e}onGridColumnsChanged(){this.refresh(!0)}onDisplayedColumnsChanged(){const e=this.columnModel.hasFloatingFilters()&&!this.hidden;this.includeFloatingFilter!==e&&this.refresh(!0)}setupCenterWidth(){this.pinned==null&&this.createManagedBean(new Es(e=>this.comp.setCenterWidth(`${e}px`),!0))}setHorizontalScroll(e){this.comp.setViewportScrollLeft(e)}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,n=this.hidden!==o,r=this.gridOptionsService.is("enableRtl"),a=this.gridOptionsService.getScrollbarWidth(),c=this.scrollVisibleService.isVerticalScrollShowing()&&(r&&e||!r&&t)?s+a:s;this.comp.setPinnedContainerWidth(`${c}px`),this.comp.setDisplayed(!o),n&&(this.hidden=o,this.refresh())};this.addManagedListener(this.eventService,u.EVENT_LEFT_PINNED_WIDTH_CHANGED,i),this.addManagedListener(this.eventService,u.EVENT_RIGHT_PINNED_WIDTH_CHANGED,i),this.addManagedListener(this.eventService,u.EVENT_SCROLL_VISIBILITY_CHANGED,i),this.addManagedListener(this.eventService,u.EVENT_SCROLLBAR_WIDTH_CHANGED,i)}getHeaderCtrlForColumn(e){if(e instanceof H)return this.columnsRowCtrl?this.columnsRowCtrl.getHeaderCellCtrl(e):void 0;if(this.groupsRowCtrls.length!==0)for(let t=0;t<this.groupsRowCtrls.length;t++){const i=this.groupsRowCtrls[t].getHeaderCellCtrl(e);if(i)return i}}getHtmlElementForColumnHeader(e){const t=this.getHeaderCtrlForColumn(e);return t?t.getGui():null}getRowType(e){const 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}getRowCount(){return this.groupsRowCtrls.length+(this.columnsRowCtrl?1:0)+(this.filtersRowCtrl?1:0)}destroy(){this.filtersRowCtrl&&(this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)),this.columnsRowCtrl&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),this.groupsRowCtrls&&this.groupsRowCtrls.length&&(this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls)),super.destroy()}}Po([p("ctrlsService")],Os.prototype,"ctrlsService",void 0),Po([p("scrollVisibleService")],Os.prototype,"scrollVisibleService",void 0),Po([p("pinnedWidthService")],Os.prototype,"pinnedWidthService",void 0),Po([p("columnModel")],Os.prototype,"columnModel",void 0),Po([p("focusService")],Os.prototype,"focusService",void 0);var Xl=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class qe extends V{constructor(e){super(),this.headerRowComps={},this.rowCompsList=[],this.pinned=e}init(){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 Os(this.pinned)).setComp(e,this.getGui())}selectAndSetTemplate(){const e=this.pinned=="left",t=this.pinned=="right",i=e?qe.PINNED_LEFT_TEMPLATE:t?qe.PINNED_RIGHT_TEMPLATE:qe.CENTER_TEMPLATE;this.setTemplate(i),this.eRowContainer=this.eCenterContainer?this.eCenterContainer:this.getGui()}destroyRowComps(){this.setCtrls([])}destroyRowComp(e){this.destroyBean(e),this.eRowContainer.removeChild(e.getGui())}setCtrls(e){const t=this.headerRowComps;this.headerRowComps={},this.rowCompsList=[];let i;const s=o=>{const n=o.getGui();n.parentElement!=this.eRowContainer&&this.eRowContainer.appendChild(n),i&&hl(this.eRowContainer,n,i),i=n};e.forEach(o=>{const n=o.getInstanceId(),r=t[n];delete t[n];const a=r||this.createBean(new $l(o));this.headerRowComps[n]=a,this.rowCompsList.push(a),s(a)}),At(t).forEach(o=>this.destroyRowComp(o))}}qe.PINNED_LEFT_TEMPLATE='<div class="ag-pinned-left-header" role="presentation"></div>',qe.PINNED_RIGHT_TEMPLATE='<div class="ag-pinned-right-header" role="presentation"></div>',qe.CENTER_TEMPLATE=`<div class="ag-header-viewport" role="presentation">
<div class="ag-header-container" ref="eCenterContainer" role="rowgroup"></div>
</div>`,Xl([O("eCenterContainer")],qe.prototype,"eCenterContainer",void 0),Xl([D],qe.prototype,"init",null),Xl([he],qe.prototype,"destroyRowComps",null);var Ao=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Wt;(function(l){l[l.UP=0]="UP",l[l.DOWN=1]="DOWN",l[l.LEFT=2]="LEFT",l[l.RIGHT=3]="RIGHT"})(Wt||(Wt={}));let $i=class extends T{postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCon=e.gridBodyCtrl})}getHeaderRowCount(){const e=this.ctrlsService.getHeaderRowContainerCtrl();return e?e.getRowCount():0}navigateVertically(e,t,i){if(t||(t=this.focusService.getFocusedHeader()),!t)return!1;const{headerRowIndex:s,column:o}=t,n=this.getHeaderRowCount(),r=e===Wt.UP;let{nextRow:a,nextFocusColumn:d}=r?this.headerPositionUtils.getColumnVisibleParent(o,s):this.headerPositionUtils.getColumnVisibleChild(o,s),c=!1;return a<0&&(a=0,d=o,c=!0),a>=n&&(a=-1),!c&&!d?!1:this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:a,column:d},allowUserOverride:!0,event:i})}navigateHorizontally(e,t=!1,i){const s=this.focusService.getFocusedHeader(),o=e===Wt.LEFT,n=this.gridOptionsService.is("enableRtl");let r,a;return o!==n?(a="Before",r=this.headerPositionUtils.findHeader(s,a)):(a="After",r=this.headerPositionUtils.findHeader(s,a)),r||!t?this.focusService.focusHeaderPosition({headerPosition:r,direction:a,fromTab:t,allowUserOverride:!0,event:i}):this.focusNextHeaderRow(s,a,i)}focusNextHeaderRow(e,t,i){const s=e.headerRowIndex;let o=null,n;return t==="Before"?s>0&&(n=s-1,o=this.headerPositionUtils.findColAtEdgeForHeaderRow(n,"end")):(n=s+1,o=this.headerPositionUtils.findColAtEdgeForHeaderRow(n,"start")),this.focusService.focusHeaderPosition({headerPosition:o,direction:t,fromTab:!0,allowUserOverride:!0,event:i})}scrollToColumn(e,t="After"){if(e.getPinned())return;let i;if(e instanceof te){const s=e.getDisplayedLeafColumns();i=t==="Before"?Z(s):s[0]}else i=e;this.gridBodyCon.getScrollFeature().ensureColumnVisible(i)}};Ao([p("focusService")],$i.prototype,"focusService",void 0),Ao([p("headerPositionUtils")],$i.prototype,"headerPositionUtils",void 0),Ao([p("ctrlsService")],$i.prototype,"ctrlsService",void 0),Ao([D],$i.prototype,"postConstruct",null),$i=Ao([M("headerNavigationService")],$i);var Yn=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Fo extends T{setComp(e,t,i){this.comp=e,this.eGui=t,this.createManagedBean(new ke(i,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addManagedListener(this.eventService,u.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onPivotModeChanged.bind(this)),this.addManagedListener(this.eventService,u.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.onPivotModeChanged(),this.setupHeaderHeight(),this.ctrlsService.registerGridHeaderCtrl(this)}setupHeaderHeight(){const e=this.setHeaderHeight.bind(this);e(),this.addManagedPropertyListener("headerHeight",e),this.addManagedPropertyListener("pivotHeaderHeight",e),this.addManagedPropertyListener("groupHeaderHeight",e),this.addManagedPropertyListener("pivotGroupHeaderHeight",e),this.addManagedPropertyListener("floatingFiltersHeight",e),this.addManagedListener(this.eventService,u.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,u.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,e),this.addManagedListener(this.eventService,u.EVENT_GRID_STYLES_CHANGED,e)}getHeaderHeight(){return this.headerHeight}setHeaderHeight(){const{columnModel:e}=this;let t=0,i=e.getHeaderRowCount(),s;e.hasFloatingFilters()&&(i++,t=1);const n=this.columnModel.getColumnGroupHeaderRowHeight(),r=this.columnModel.getColumnHeaderRowHeight(),a=1+t,d=i-a;if(s=t*e.getFloatingFiltersHeight(),s+=d*n,s+=r,this.headerHeight===s)return;this.headerHeight=s;const c=`${s+1}px`;this.comp.setHeightAndMinHeight(c),this.eventService.dispatchEvent({type:u.EVENT_HEADER_HEIGHT_CHANGED})}onPivotModeChanged(){const e=this.columnModel.isPivotMode();this.comp.addOrRemoveCssClass("ag-pivot-on",e),this.comp.addOrRemoveCssClass("ag-pivot-off",!e)}onDisplayedColumnsChanged(){const t=this.columnModel.getAllDisplayedColumns().some(i=>i.isSpanHeaderHeight());this.comp.addOrRemoveCssClass("ag-header-allow-overflow",t)}onTabKeyDown(e){const t=this.gridOptionsService.is("enableRtl"),i=e.shiftKey!==t?Wt.LEFT:Wt.RIGHT;(this.headerNavigationService.navigateHorizontally(i,!0,e)||this.focusService.focusNextGridCoreContainer(e.shiftKey))&&e.preventDefault()}handleKeyDown(e){let t=null;switch(e.key){case w.LEFT:t=Wt.LEFT;case w.RIGHT:R(t)||(t=Wt.RIGHT),this.headerNavigationService.navigateHorizontally(t,!1,e);break;case w.UP:t=Wt.UP;case w.DOWN:R(t)||(t=Wt.DOWN),this.headerNavigationService.navigateVertically(t,null,e)&&e.preventDefault();break;default:return}}onFocusOut(e){const t=this.gridOptionsService.getDocument(),{relatedTarget:i}=e;!i&&this.eGui.contains(t.activeElement)||this.eGui.contains(i)||this.focusService.clearFocusedHeader()}}Yn([p("headerNavigationService")],Fo.prototype,"headerNavigationService",void 0),Yn([p("focusService")],Fo.prototype,"focusService",void 0),Yn([p("columnModel")],Fo.prototype,"columnModel",void 0),Yn([p("ctrlsService")],Fo.prototype,"ctrlsService",void 0);var lg=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Lo extends V{constructor(){super(Lo.TEMPLATE)}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 Fo).setComp(e,this.getGui(),this.getFocusableElement());const i=s=>{this.createManagedBean(s),this.appendChild(s)};i(new qe("left")),i(new qe(null)),i(new qe("right"))}}Lo.TEMPLATE='<div class="ag-header" role="presentation"/>',lg([D],Lo.prototype,"postConstruct",null);var Jl=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let Io=class extends T{addResizeBar(e){const t={dragStartPixels:e.dragStartPixels||0,eElement:e.eResizeBar,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this,e),onDragging:this.onDragging.bind(this,e),includeTouch:!0,stopPropagationForTouch:!0};return this.dragService.addDragSource(t),()=>this.dragService.removeDragSource(t)}onDragStart(e,t){this.dragStartX=t.clientX,this.setResizeIcons();const i=t instanceof MouseEvent&&t.shiftKey===!0;e.onResizeStart(i)}setResizeIcons(){const e=this.ctrlsService.getGridCtrl();e.setResizeCursor(!0),e.disableUserSelect(!0)}onDragStop(e,t){e.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){const e=this.ctrlsService.getGridCtrl();e.setResizeCursor(!1),e.disableUserSelect(!1)}onDragging(e,t){this.resizeAmount=t.clientX-this.dragStartX,e.onResizing(this.resizeAmount)}};Jl([p("dragService")],Io.prototype,"dragService",void 0),Jl([p("ctrlsService")],Io.prototype,"ctrlsService",void 0),Io=Jl([M("horizontalResizeService")],Io);var Mo=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let Ki=class extends T{hideActiveMenu(){this.hidePopup&&this.hidePopup()}showMenuAfterMouseEvent(e,t){this.showPopup(e,i=>{this.popupService.positionPopupUnderMouseEvent({column:e,type:"columnMenu",mouseEvent:t,ePopup:i})},"columnMenu",t.target)}showMenuAfterButtonClick(e,t,i){this.showPopup(e,s=>{this.popupService.positionPopupByComponent({type:i,eventSource:t,ePopup:s,keepWithinBounds:!0,position:"under",column:e})},i,t)}showPopup(e,t,i,s){const o=this.filterManager.getOrCreateFilterWrapper(e,"COLUMN_MENU");if(!o)throw new Error("AG Grid - unable to show popup filter, filter instantiation failed");const n=document.createElement("div");pe(n,"presentation"),n.classList.add("ag-menu"),this.tabListener=this.addManagedListener(n,"keydown",f=>this.trapFocusWithin(f,n)),o.guiPromise.then(f=>n.appendChild(f));let r;const a=()=>{var f;return(f=o.filterPromise)===null||f===void 0?void 0:f.then(m=>{var C;return(C=m==null?void 0:m.afterGuiDetached)===null||C===void 0?void 0:C.call(m)})},d=s||this.ctrlsService.getGridBodyCtrl().getGui(),c=f=>{e.setMenuVisible(!1,"contextMenu");const m=f instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),m&&s&&Jt(s)){const C=this.focusService.findTabbableParent(s);C&&C.focus()}a()},h=this.localeService.getLocaleTextFunc(),g=this.popupService.addPopup({modal:!0,eChild:n,closeOnEsc:!0,closedCallback:c,positionCallback:()=>t(n),anchorToElement:d,ariaLabel:h("ariaLabelColumnMenu","Column Menu")});g&&(this.hidePopup=r=g.hideFunc),o.filterPromise.then(f=>{t(n),f.afterGuiAttached&&f.afterGuiAttached({container:i,hidePopup:r})}),e.setMenuVisible(!0,"contextMenu")}trapFocusWithin(e,t){e.key!==w.TAB||e.defaultPrevented||this.focusService.findNextFocusableElement(t,!1,e.shiftKey)||(e.preventDefault(),this.focusService.focusInto(t,e.shiftKey))}isMenuEnabled(e){return e.isFilterAllowed()&&e.getMenuTabs(["filterMenuTab"]).includes("filterMenuTab")}};Mo([p("filterManager")],Ki.prototype,"filterManager",void 0),Mo([p("popupService")],Ki.prototype,"popupService",void 0),Mo([p("focusService")],Ki.prototype,"focusService",void 0),Mo([p("ctrlsService")],Ki.prototype,"ctrlsService",void 0),Ki=Mo([M("menuFactory")],Ki);var qn=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Ps extends V{constructor(e){super(Ps.getTemplate(e.cssClass)),this.items=[],this.tabbedItemScrollMap=new Map,this.params=e,e.items&&e.items.forEach(t=>this.addItem(t))}postConstruct(){this.createManagedBean(new ke(this.getFocusableElement(),{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)})),this.addDestroyFunc(()=>{var e,t,i;return(i=(t=(e=this.activeItem)===null||e===void 0?void 0:e.tabbedItem)===null||t===void 0?void 0:t.afterDetachedCallback)===null||i===void 0?void 0:i.call(t)})}static getTemplate(e){return`<div class="ag-tabs ${e}">
<div ref="eHeader" role="tablist" class="ag-tabs-header ${e?`${e}-header`:""}"></div>
<div ref="eBody" role="presentation" class="ag-tabs-body ${e?`${e}-body`:""}"></div>
</div>`}handleKeyDown(e){const t=this.gridOptionsService.getDocument();switch(e.key){case w.RIGHT:case w.LEFT:if(!this.eHeader.contains(t.activeElement))return;const i=e.key===w.RIGHT,s=this.gridOptionsService.is("enableRtl"),o=this.items.indexOf(this.activeItem),n=i!==s?Math.min(o+1,this.items.length-1):Math.max(o-1,0);if(o===n)return;e.preventDefault();const r=this.items[n];this.showItemWrapper(r),r.eHeaderButton.focus();break;case w.UP:case w.DOWN:e.stopPropagation();break}}onTabKeyDown(e){if(e.defaultPrevented)return;const{focusService:t,eHeader:i,eBody:s,activeItem:o}=this,r=this.gridOptionsService.getDocument().activeElement,a=e.target;if(e.preventDefault(),i.contains(r)){t.focusInto(s,e.shiftKey);return}let d=null;t.isTargetUnderManagedComponent(s,a)&&(e.shiftKey&&(d=this.focusService.findFocusableElementBeforeTabGuard(s,a)),d||(d=o.eHeaderButton)),!d&&s.contains(r)&&(d=t.findNextFocusableElement(s,!1,e.shiftKey),d||(d=o.eHeaderButton)),d&&d.focus()}setAfterAttachedParams(e){this.afterAttachedParams=e}showFirstItem(){this.items.length>0&&this.showItemWrapper(this.items[0])}addItem(e){const t=document.createElement("span");pe(t,"tab"),t.setAttribute("tabindex","-1"),t.appendChild(e.title),t.classList.add("ag-tab"),this.eHeader.appendChild(t),di(t,e.titleLabel);const i={tabbedItem:e,eHeaderButton:t};this.items.push(i),t.addEventListener("click",this.showItemWrapper.bind(this,i))}showItem(e){const t=this.items.find(i=>i.tabbedItem===e);t&&this.showItemWrapper(t)}showItemWrapper(e){var t,i;const{tabbedItem:s,eHeaderButton:o}=e;if(this.params.onItemClicked&&this.params.onItemClicked({item:s}),this.activeItem===e){Ha(this.params.onActiveItemClicked);return}this.lastScrollListener&&(this.lastScrollListener=this.lastScrollListener()),We(this.eBody),s.bodyPromise.then(n=>{this.eBody.appendChild(n);const r=!this.focusService.isKeyboardMode();if(this.focusService.focusInto(this.eBody,!1,r),s.afterAttachedCallback&&s.afterAttachedCallback(this.afterAttachedParams),this.params.keepScrollPosition){const a=s.getScrollableContainer&&s.getScrollableContainer()||n;this.lastScrollListener=this.addManagedListener(a,"scroll",()=>{this.tabbedItemScrollMap.set(s.name,a.scrollTop)});const d=this.tabbedItemScrollMap.get(s.name);d!==void 0&&setTimeout(()=>{a.scrollTop=d},0)}}),this.activeItem&&(this.activeItem.eHeaderButton.classList.remove("ag-tab-selected"),(i=(t=this.activeItem.tabbedItem).afterDetachedCallback)===null||i===void 0||i.call(t)),o.classList.add("ag-tab-selected"),this.activeItem=e}}qn([p("focusService")],Ps.prototype,"focusService",void 0),qn([O("eHeader")],Ps.prototype,"eHeader",void 0),qn([O("eBody")],Ps.prototype,"eBody",void 0),qn([D],Ps.prototype,"postConstruct",null);var ag=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};const dg=50;let Zl=class extends T{constructor(){super(...arguments),this.polyfillFunctions=[]}observeResize(e,t){const i=this.gridOptionsService.getWindow(),s=()=>{const a=new i.ResizeObserver(t);return a.observe(e),()=>a.disconnect()},o=()=>{let a=ul(e),d=cl(e),c=!0;const h=()=>{if(c){const g=ul(e),f=cl(e);(g!==a||f!==d)&&(a=g,d=f,t()),this.doNextPolyfillTurn(h)}};return h(),()=>c=!1},n=this.gridOptionsService.is("suppressBrowserResizeObserver");return!!i.ResizeObserver&&!n?s():o()}doNextPolyfillTurn(e){this.polyfillFunctions.push(e),this.schedulePolyfill()}schedulePolyfill(){if(this.polyfillScheduled)return;const e=()=>{const t=this.polyfillFunctions;this.polyfillScheduled=!1,this.polyfillFunctions=[],t.forEach(i=>i())};this.polyfillScheduled=!0,this.getFrameworkOverrides().setTimeout(e,dg)}};Zl=ag([M("resizeObserverService")],Zl);var Qn=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let As=class extends T{constructor(){super(...arguments),this.createTasksP1={list:[],sorted:!1},this.createTasksP2={list:[],sorted:!1},this.destroyTasks=[],this.ticking=!1,this.scrollGoingDown=!0,this.lastPage=0,this.lastScrollTop=0,this.taskCount=0,this.cancelledTasks=new Set}setScrollTop(e){const t=this.gridOptionsService.is("pagination");if(this.scrollGoingDown=e>=this.lastScrollTop,t&&e===0){const i=this.paginationProxy.getCurrentPage();i!==this.lastPage&&(this.lastPage=i,this.scrollGoingDown=!0)}this.lastScrollTop=e}init(){this.useAnimationFrame=!this.gridOptionsService.is("suppressAnimationFrame")}isOn(){return this.useAnimationFrame}verifyAnimationFrameOn(e){this.useAnimationFrame===!1&&console.warn(`AG Grid: AnimationFrameService.${e} called but animation frames are off`)}createTask(e,t,i){this.verifyAnimationFrameOn(i);const s={task:e,index:t,createOrder:++this.taskCount};this.addTaskToList(this[i],s),this.schedule()}cancelTask(e){this.cancelledTasks.add(e)}addTaskToList(e,t){e.list.push(t),e.sorted=!1}sortTaskList(e){if(e.sorted)return;const t=this.scrollGoingDown?1:-1;e.list.sort((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,n=this.destroyTasks,r=new Date().getTime();let a=new Date().getTime()-r;const d=e<=0,c=this.ctrlsService.getGridBodyCtrl();for(;d||a<e;){if(!c.getScrollFeature().scrollGridIfNeeded()){let g;if(i.length)this.sortTaskList(t),g=i.pop().task;else if(o.length)this.sortTaskList(s),g=o.pop().task;else if(n.length)g=n.pop();else{this.cancelledTasks.clear();break}this.cancelledTasks.has(g)||g()}a=new Date().getTime()-r}i.length||o.length||n.length?this.requestFrame():this.stopTicking()}stopTicking(){this.ticking=!1}flushAllFrames(){this.useAnimationFrame&&this.executeFrame(-1)}schedule(){this.useAnimationFrame&&(this.ticking||(this.ticking=!0,this.requestFrame()))}requestFrame(){const e=this.executeFrame.bind(this,60);this.requestAnimationFrame(e)}requestAnimationFrame(e){const t=this.gridOptionsService.getWindow();t.requestAnimationFrame?t.requestAnimationFrame(e):t.webkitRequestAnimationFrame?t.webkitRequestAnimationFrame(e):t.setTimeout(e,0)}isQueueEmpty(){return!this.ticking}debounce(e){let t=!1;return()=>{if(!this.isOn()){this.getFrameworkOverrides().setTimeout(e,0);return}t||(t=!0,this.addDestroyTask(()=>{t=!1,e()}))}}};Qn([p("ctrlsService")],As.prototype,"ctrlsService",void 0),Qn([p("paginationProxy")],As.prototype,"paginationProxy",void 0),Qn([D],As.prototype,"init",null),As=Qn([M("animationFrameService")],As);var No=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let Yi=class extends T{postConstruct(){this.ctrlsService.whenReady(e=>{this.centerRowContainerCtrl=e.centerRowContainerCtrl})}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(n=>this.cloneItemIntoDummy(n,t)),i.appendChild(t);const s=t.offsetWidth;i.removeChild(t);const o=this.getAutoSizePadding();return s+o}getAutoSizePadding(){const e=this.gridOptionsService.getNum("autoSizePadding");return e!=null&&e>=0?e:20}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(a=>i.classList.contains(a))?(o.add("ag-header","ag-header-row"),s.style.position="static"):o.add("ag-row");let r=e.parentElement;for(;r;){if(["ag-header-row","ag-row"].some(d=>r.classList.contains(d))){for(let d=0;d<r.classList.length;d++){const c=r.classList[d];c!="ag-row-position-absolute"&&o.add(c)}break}r=r.parentElement}s.appendChild(i),t.appendChild(s)}};No([p("rowRenderer")],Yi.prototype,"rowRenderer",void 0),No([p("ctrlsService")],Yi.prototype,"ctrlsService",void 0),No([p("rowCssClassCalculator")],Yi.prototype,"rowCssClassCalculator",void 0),No([D],Yi.prototype,"postConstruct",null),Yi=No([M("autoWidthCalculator")],Yi);var Xn=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class _o extends T{constructor(e,t){super(),this.createRowCon=e,this.destroyRowCtrls=t,this.stickyRowCtrls=[],this.containerHeight=0}postConstruct(){this.isClientSide=this.rowModel.getType()==="clientSide",this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl})}getStickyRowCtrls(){return this.stickyRowCtrls}checkStickyRows(){let e=0;if(!this.gridOptionsService.isGroupRowsSticky()){this.refreshNodesAndContainerHeight([],e);return}const t=[],i=this.rowRenderer.getFirstVisibleVerticalPixel(),s=o=>{var n,r,a;t.push(o);let d;if(this.isClientSide){let h=o;for(;h.expanded;)if(h.master)h=h.detailNode;else if(h.childrenAfterSort){if(h.childrenAfterSort.length===0)break;h=Z(h.childrenAfterSort)}d=h.rowTop+h.rowHeight}else if(o.master)d=o.detailNode.rowTop+o.detailNode.rowHeight;else{const h=(n=o.childStore)===null||n===void 0?void 0:n.getStoreBounds();d=((r=h==null?void 0:h.heightPx)!==null&&r!==void 0?r:0)+((a=h==null?void 0:h.topPx)!==null&&a!==void 0?a:0)}const c=i+e+o.rowHeight;d<c?o.stickyRowTop=e+(d-c):o.stickyRowTop=e,e=0,t.forEach(h=>{const g=h.stickyRowTop+h.rowHeight;e<g&&(e=g)})};for(;;){const o=i+e,n=this.rowModel.getRowIndexAtPixel(o),r=this.rowModel.getRow(n);if(r==null||r.level<0)break;const a=[];let d=r.parent;for(;d.level>=0;)a.push(d),d=d.parent;const c=a.reverse().find(h=>t.indexOf(h)<0&&h.displayed);if(c){s(c);continue}if(r.isExpandable()&&r.expanded&&r.rowTop<o){s(r);continue}break}this.refreshNodesAndContainerHeight(t,e)}refreshStickyNode(e){const t=[];for(let i=0;i<this.stickyRowCtrls.length;i++){const s=this.stickyRowCtrls[i].getRowNode();s!==e&&t.push(s)}this.refreshNodesAndContainerHeight(t,this.containerHeight),this.checkStickyRows()}refreshNodesAndContainerHeight(e,t){const i=this.stickyRowCtrls.filter(r=>e.indexOf(r.getRowNode())===-1),s=e.filter(r=>this.stickyRowCtrls.findIndex(a=>a.getRowNode()===r)===-1),o={};i.forEach(r=>{o[r.getRowNode().id]=r,this.stickyRowCtrls=this.stickyRowCtrls.filter(a=>a!==r)});for(const r of Object.values(o))r.getRowNode().sticky=!1;this.destroyRowCtrls(o,!1);const n=s.map(r=>(r.sticky=!0,this.createRowCon(r,!1,!1)));this.stickyRowCtrls.push(...n),this.stickyRowCtrls.forEach(r=>r.setRowTop(r.getRowNode().stickyRowTop)),this.stickyRowCtrls.sort((r,a)=>a.getRowNode().rowIndex-r.getRowNode().rowIndex),this.containerHeight!==t&&(this.containerHeight=t,this.gridBodyCtrl.setStickyTopHeight(t))}}Xn([p("rowModel")],_o.prototype,"rowModel",void 0),Xn([p("rowRenderer")],_o.prototype,"rowRenderer",void 0),Xn([p("ctrlsService")],_o.prototype,"ctrlsService",void 0),Xn([D],_o.prototype,"postConstruct",null);var bt=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};const cg=10;let Qe=class extends T{constructor(){super(...arguments),this.destroyFuncsForColumnListeners=[],this.rowCtrlsByRowIndex={},this.zombieRowCtrls={},this.allRowCtrls=[],this.topRowCtrls=[],this.bottomRowCtrls=[],this.refreshInProgress=!1,this.dataFirstRenderedFired=!1}postConstruct(){this.ctrlsService.whenReady(()=>{this.gridBodyCtrl=this.ctrlsService.getGridBodyCtrl(),this.initialise()})}initialise(){if(this.addManagedListener(this.eventService,u.EVENT_PAGINATION_CHANGED,this.onPageLoaded.bind(this)),this.addManagedListener(this.eventService,u.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedListener(this.eventService,u.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,u.EVENT_BODY_SCROLL,this.onBodyScroll.bind(this)),this.addManagedListener(this.eventService,u.EVENT_BODY_HEIGHT_CHANGED,this.redraw.bind(this)),this.addManagedPropertyListener("domLayout",this.onDomLayoutChanged.bind(this)),this.addManagedPropertyListener("rowClass",this.redrawRows.bind(this)),this.gridOptionsService.isGroupRowsSticky()){const e=this.rowModel.getType();(e==="clientSide"||e==="serverSide")&&(this.stickyRowFeature=this.createManagedBean(new _o(this.createRowCon.bind(this),this.destroyRowCtrls.bind(this))))}this.registerCellEventListeners(),this.initialiseCache(),this.printLayout=this.gridOptionsService.isDomLayout("print"),this.embedFullWidthRows=this.printLayout||this.gridOptionsService.is("embedFullWidthRows"),this.redrawAfterModelUpdate()}initialiseCache(){if(this.gridOptionsService.is("keepDetailRows")){const e=this.getKeepDetailRowsCount(),t=e??3;this.cachedRowCtrls=new ug(t)}}getKeepDetailRowsCount(){const e=this.gridOptionsService.getNum("keepDetailRowsCount");return R(e)&&e>0?e:cg}getRowCtrls(){return this.allRowCtrls}getStickyTopRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyRowCtrls():[]}updateAllRowCtrls(){const e=At(this.rowCtrlsByRowIndex),t=this.gridOptionsService.is("ensureDomOrder"),i=this.gridOptionsService.isDomLayout("print");(t||i)&&e.sort((n,r)=>n.getRowNode().rowIndex-r.getRowNode.rowIndex);const s=At(this.zombieRowCtrls),o=this.cachedRowCtrls?this.cachedRowCtrls.getEntries():[];this.allRowCtrls=[...e,...s,...o]}onCellFocusChanged(e){this.getAllCellCtrls().forEach(t=>t.onCellFocused(e)),this.getFullWidthRowCtrls().forEach(t=>t.onFullWidthRowFocused(e))}registerCellEventListeners(){this.addManagedListener(this.eventService,u.EVENT_CELL_FOCUSED,t=>{this.onCellFocusChanged(t)}),this.addManagedListener(this.eventService,u.EVENT_CELL_FOCUS_CLEARED,()=>{this.onCellFocusChanged()}),this.addManagedListener(this.eventService,u.EVENT_FLASH_CELLS,t=>{this.getAllCellCtrls().forEach(i=>i.onFlashCells(t))}),this.addManagedListener(this.eventService,u.EVENT_COLUMN_HOVER_CHANGED,()=>{this.getAllCellCtrls().forEach(t=>t.onColumnHover())}),this.addManagedListener(this.eventService,u.EVENT_DISPLAYED_COLUMNS_CHANGED,()=>{this.getAllCellCtrls().forEach(t=>t.onDisplayedColumnsChanged())}),this.addManagedListener(this.eventService,u.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,()=>{this.printLayout&&this.getAllCellCtrls().forEach(t=>t.onLeftChanged())}),this.gridOptionsService.isEnableRangeSelection()&&(this.addManagedListener(this.eventService,u.EVENT_RANGE_SELECTION_CHANGED,()=>{this.getAllCellCtrls().forEach(t=>t.onRangeSelectionChanged())}),this.addManagedListener(this.eventService,u.EVENT_COLUMN_MOVED,()=>{this.getAllCellCtrls().forEach(t=>t.updateRangeBordersIfRangeCount())}),this.addManagedListener(this.eventService,u.EVENT_COLUMN_PINNED,()=>{this.getAllCellCtrls().forEach(t=>t.updateRangeBordersIfRangeCount())}),this.addManagedListener(this.eventService,u.EVENT_COLUMN_VISIBLE,()=>{this.getAllCellCtrls().forEach(t=>t.updateRangeBordersIfRangeCount())})),this.refreshListenersToColumnsForCellComps(),this.addManagedListener(this.eventService,u.EVENT_GRID_COLUMNS_CHANGED,this.refreshListenersToColumnsForCellComps.bind(this)),this.addDestroyFunc(this.removeGridColumnListeners.bind(this))}removeGridColumnListeners(){this.destroyFuncsForColumnListeners.forEach(e=>e()),this.destroyFuncsForColumnListeners.length=0}refreshListenersToColumnsForCellComps(){this.removeGridColumnListeners();const e=this.columnModel.getAllGridColumns();e&&e.forEach(t=>{const i=d=>{this.getAllCellCtrls().forEach(c=>{c.getColumn()===t&&d(c)})},s=()=>{i(d=>d.onLeftChanged())},o=()=>{i(d=>d.onWidthChanged())},n=()=>{i(d=>d.onFirstRightPinnedChanged())},r=()=>{i(d=>d.onLastLeftPinnedChanged())},a=()=>{i(d=>d.onColDefChanged())};t.addEventListener("leftChanged",s),t.addEventListener("widthChanged",o),t.addEventListener("firstRightPinnedChanged",n),t.addEventListener("lastLeftPinnedChanged",r),t.addEventListener("colDefChanged",a),this.destroyFuncsForColumnListeners.push(()=>{t.removeEventListener("leftChanged",s),t.removeEventListener("widthChanged",o),t.removeEventListener("firstRightPinnedChanged",n),t.removeEventListener("lastLeftPinnedChanged",r),t.removeEventListener("colDefChanged",a)})})}onDomLayoutChanged(){const e=this.gridOptionsService.isDomLayout("print"),t=e||this.gridOptionsService.is("embedFullWidthRows"),i=t!==this.embedFullWidthRows||this.printLayout!==e;this.printLayout=e,this.embedFullWidthRows=t,i&&this.redrawAfterModelUpdate({domLayoutChanged:!0})}datasourceChanged(){this.firstRenderedRow=0,this.lastRenderedRow=-1;const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e)}onPageLoaded(e){const t={recycleRows:e.keepRenderedRows,animate:e.animate,newData:e.newData,newPage:e.newPage,onlyBody:!0};this.redrawAfterModelUpdate(t)}getAllCellsForColumn(e){const t=[];return this.getAllRowCtrls().forEach(i=>{const s=i.getCellElement(e);s&&t.push(s)}),t}refreshFloatingRowComps(){this.refreshFloatingRows(this.topRowCtrls,this.pinnedRowModel.getPinnedTopRowData()),this.refreshFloatingRows(this.bottomRowCtrls,this.pinnedRowModel.getPinnedBottomRowData())}getTopRowCtrls(){return this.topRowCtrls}getBottomRowCtrls(){return this.bottomRowCtrls}refreshFloatingRows(e,t){e.forEach(i=>{i.destroyFirstPass(),i.destroySecondPass()}),e.length=0,t&&t.forEach(i=>{const s=new Et(i,this.beans,!1,!1,this.printLayout);e.push(s)})}onPinnedRowDataChanged(){const e={recycleRows:!0};this.redrawAfterModelUpdate(e)}getRenderedIndexesForRowNodes(e){const t=[];return x(e)||se(this.rowCtrlsByRowIndex,(i,s)=>{const o=s.getRowNode();e.indexOf(o)>=0&&t.push(i)}),t}redrawRows(e){const t=e!=null&&e.length>0;if(t){const i=this.getRenderedIndexesForRowNodes(e);this.removeRowCtrls(i)}this.redrawAfterModelUpdate({recycleRows:t})}getCellToRestoreFocusToAfterRefresh(e){const t=e!=null&&e.suppressKeepFocus?null:this.focusService.getFocusCellToUseAfterRefresh();if(t==null)return null;const s=this.gridOptionsService.getDocument().activeElement,o=this.gridOptionsService.getDomData(s,St.DOM_DATA_KEY_CELL_CTRL),n=this.gridOptionsService.getDomData(s,Et.DOM_DATA_KEY_ROW_CTRL);return o||n?t:null}redrawAfterModelUpdate(e={}){this.getLockOnRefresh();const t=this.getCellToRestoreFocusToAfterRefresh(e);this.updateContainerHeights(),this.scrollToTopIfNewData(e);const i=!e.domLayoutChanged&&!!e.recycleRows,s=e.animate&&this.gridOptionsService.isAnimateRows(),o=i?this.getRowsToRecycle():null;i||this.removeAllRowComps(),this.recycleRows(o,s),this.gridBodyCtrl.updateRowCount(),e.onlyBody||this.refreshFloatingRowComps(),this.dispatchDisplayedRowsChanged(),t!=null&&this.restoreFocusedCell(t),this.releaseLockOnRefresh()}scrollToTopIfNewData(e){const t=e.newData||e.newPage,i=this.gridOptionsService.is("suppressScrollOnNewData");t&&!i&&this.gridBodyCtrl.getScrollFeature().scrollToTop()}updateContainerHeights(){if(this.printLayout){this.rowContainerHeightService.setModelHeight(null);return}let e=this.paginationProxy.getCurrentPageHeight();e===0&&(e=1),this.rowContainerHeightService.setModelHeight(e)}getLockOnRefresh(){if(this.refreshInProgress)throw new Error("AG Grid: cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, e.g. instead of api.redrawRows(), call setTimeout(function() { api.redrawRows(); }, 0). To see what part of your code that caused the refresh check this stacktrace.");this.refreshInProgress=!0}releaseLockOnRefresh(){this.refreshInProgress=!1}isRefreshInProgress(){return this.refreshInProgress}restoreFocusedCell(e){e&&(this.focusService.setRestoreFocusedCell(e),this.onCellFocusChanged({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,api:this.beans.gridApi,columnApi:this.beans.columnApi,context:this.beans.gridOptionsService.context,type:"mock"}))}stopEditing(e=!1){this.getAllRowCtrls().forEach(t=>{t.stopEditing(e)})}getAllCellCtrls(){const e=[],t=this.getAllRowCtrls(),i=t.length;for(let s=0;s<i;s++){const o=t[s].getAllCellCtrls(),n=o.length;for(let r=0;r<n;r++)e.push(o[r])}return e}getAllRowCtrls(){const e=this.stickyRowFeature&&this.stickyRowFeature.getStickyRowCtrls()||[],t=[...this.topRowCtrls,...this.bottomRowCtrls,...e];for(const i of Object.keys(this.rowCtrlsByRowIndex))t.push(this.rowCtrlsByRowIndex[i]);return t}addRenderedRowListener(e,t,i){const s=this.rowCtrlsByRowIndex[t];s&&s.addEventListener(e,i)}flashCells(e={}){const{flashDelay:t,fadeDelay:i}=e;this.getCellCtrls(e.rowNodes,e.columns).forEach(s=>s.flashCell({flashDelay:t,fadeDelay:i}))}refreshCells(e={}){const t={forceRefresh:e.force,newData:!1,suppressFlash:e.suppressFlash};this.getCellCtrls(e.rowNodes,e.columns).forEach(i=>{if(i.refreshShouldDestroy()){const s=i.getRowCtrl();s&&s.refreshCell(i)}else i.refreshCell(t)}),this.refreshFullWidthRows(e.rowNodes)}getCellRendererInstances(e){var t;const i=this.getCellCtrls(e.rowNodes,e.columns).map(n=>n.getCellRenderer()).filter(n=>n!=null);if(!((t=e.columns)===null||t===void 0)&&t.length)return i;const s=[],o=this.mapRowNodes(e.rowNodes);return this.getAllRowCtrls().forEach(n=>{if(o&&!this.isRowInMap(n.getRowNode(),o)||!n.isFullWidth())return;const r=n.getFullWidthCellRenderer();r&&s.push(r)}),[...s,...i]}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;i.rowPinned==="top"?t.top[s]=i:i.rowPinned==="bottom"?t.bottom[s]=i:t.normal[s]=i}),t}isRowInMap(e,t){const i=e.id,s=e.rowPinned;return s==="bottom"?t.bottom[i]!=null:s==="top"?t.top[i]!=null:t.normal[i]!=null}getCellCtrls(e,t){const i=this.mapRowNodes(e),s=[];let o;R(t)&&(o={},t.forEach(r=>{const a=this.columnModel.getGridColumn(r);R(a)&&(o[a.getId()]=!0)}));const n=r=>{const a=r.getRowNode();i!=null&&!this.isRowInMap(a,i)||r.getAllCellCtrls().forEach(d=>{const c=d.getColumn().getId();o&&!o[c]||s.push(d)})};return this.getAllRowCtrls().forEach(r=>n(r)),s}destroy(){this.removeAllRowComps(),super.destroy()}removeAllRowComps(){const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e)}getRowsToRecycle(){const e=[];se(this.rowCtrlsByRowIndex,(i,s)=>{s.getRowNode().id==null&&e.push(i)}),this.removeRowCtrls(e);const t={};return se(this.rowCtrlsByRowIndex,(i,s)=>{const o=s.getRowNode();t[o.id]=s}),this.rowCtrlsByRowIndex={},t}removeRowCtrls(e){e.forEach(t=>{const i=this.rowCtrlsByRowIndex[t];i&&(i.destroyFirstPass(),i.destroySecondPass()),delete this.rowCtrlsByRowIndex[t]})}onBodyScroll(e){e.direction==="vertical"&&this.redraw()}redraw(e=!0){let t;if(this.stickyRowFeature&&Rn()&&(t=this.getCellToRestoreFocusToAfterRefresh()||void 0),this.getLockOnRefresh(),this.recycleRows(null,!1,e),this.releaseLockOnRefresh(),this.dispatchDisplayedRowsChanged(e),t!=null){const i=this.getCellToRestoreFocusToAfterRefresh();t!=null&&i==null&&(this.animationFrameService.flushAllFrames(),this.restoreFocusedCell(t))}}removeRowCompsNotToDraw(e){const t={};e.forEach(o=>t[o]=!0);const s=Object.keys(this.rowCtrlsByRowIndex).filter(o=>!t[o]);this.removeRowCtrls(s)}calculateIndexesToDraw(e){let t=Rd(this.firstRenderedRow,this.lastRenderedRow);const i=(s,o)=>{const n=o.getRowNode().rowIndex;n!=null&&(n<this.firstRenderedRow||n>this.lastRenderedRow)&&this.doNotUnVirtualiseRow(o)&&t.push(n)};return se(this.rowCtrlsByRowIndex,i),se(e,i),t.sort((s,o)=>s-o),t=t.filter(s=>{const o=this.paginationProxy.getRow(s);return o&&!o.sticky}),t}recycleRows(e,t=!1,i=!1){this.rowContainerHeightService.updateOffset(),this.workOutFirstAndLastRowsToRender(),this.stickyRowFeature&&this.stickyRowFeature.checkStickyRows();const s=this.calculateIndexesToDraw(e);this.removeRowCompsNotToDraw(s),this.printLayout&&(t=!1),s.forEach(o=>{this.createOrUpdateRowCtrl(o,e,t,i)}),e&&(i&&!this.gridOptionsService.is("suppressAnimationFrame")&&!this.printLayout?this.beans.animationFrameService.addDestroyTask(()=>{this.destroyRowCtrls(e,t),this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}):this.destroyRowCtrls(e,t)),this.updateAllRowCtrls()}dispatchDisplayedRowsChanged(e=!1){const t={type:u.EVENT_DISPLAYED_ROWS_CHANGED,afterScroll:e};this.eventService.dispatchEvent(t)}onDisplayedColumnsChanged(){const e=this.columnModel.isPinningLeft(),t=this.columnModel.isPinningRight();(this.pinningLeft!==e||t!==this.pinningRight)&&(this.pinningLeft=e,this.pinningRight=t,this.embedFullWidthRows&&this.redrawFullWidthEmbeddedRows())}redrawFullWidthEmbeddedRows(){const e=[];this.getFullWidthRowCtrls().forEach(t=>{const i=t.getRowNode().rowIndex;e.push(i.toString())}),this.refreshFloatingRowComps(),this.removeRowCtrls(e),this.redraw()}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))})}refreshFullWidthRow(e){this.refreshFullWidthRows([e])}refreshFullWidthRows(e){const t=this.getFullWidthRowCtrls(e);let i=!1;const s=[];t.forEach(o=>{if(o.refreshFullWidth())return;const r=o.getRowNode();r.sticky?this.stickyRowFeature.refreshStickyNode(r):s.push(r.rowIndex),i=!0}),s.length>0&&this.removeRowCtrls(s),i&&this.redraw(!1)}createOrUpdateRowCtrl(e,t,i,s){let o,n=this.rowCtrlsByRowIndex[e];if(n||(o=this.paginationProxy.getRow(e),R(o)&&R(t)&&t[o.id]&&o.alreadyRendered&&(n=t[o.id],t[o.id]=null)),!n)if(o||(o=this.paginationProxy.getRow(e)),R(o))n=this.createRowCon(o,i,s);else return;return o&&(o.alreadyRendered=!0),this.rowCtrlsByRowIndex[e]=n,n}destroyRowCtrls(e,t){const i=[];se(e,(s,o)=>{if(o){if(this.cachedRowCtrls&&o.isCacheable()){this.cachedRowCtrls.addRow(o);return}o.destroyFirstPass(),t?(this.zombieRowCtrls[o.getInstanceId()]=o,i.push(()=>{o.destroySecondPass(),delete this.zombieRowCtrls[o.getInstanceId()]})):o.destroySecondPass()}}),t&&(i.push(()=>{this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}),xa(i))}getRowBuffer(){let e=this.gridOptionsService.getNum("rowBuffer");return typeof e=="number"?e<0&&(Y(()=>console.warn("AG Grid: rowBuffer should not be negative"),"warn rowBuffer negative"),e=0,this.gridOptionsService.set("rowBuffer",0)):e=10,e}getRowBufferInPixels(){const e=this.getRowBuffer(),t=this.gridOptionsService.getRowHeightAsNumber();return e*t}workOutFirstAndLastRowsToRender(){let e,t;if(!this.paginationProxy.isRowsToRender())e=0,t=-1;else if(this.printLayout)e=this.paginationProxy.getPageFirstRow(),t=this.paginationProxy.getPageLastRow();else{const a=this.getRowBufferInPixels(),d=this.ctrlsService.getGridBodyCtrl(),c=this.gridOptionsService.is("suppressRowVirtualisation");let h=!1,g,f;do{const E=this.paginationProxy.getPixelOffset(),{pageFirstPixel:b,pageLastPixel:_}=this.paginationProxy.getCurrentPagePixelRange(),F=this.rowContainerHeightService.getDivStretchOffset(),L=d.getScrollFeature().getVScrollPosition(),I=L.top,U=L.bottom;c?(g=b+F,f=_+F):(g=Math.max(I+E-a,b)+F,f=Math.min(U+E+a,_)+F),this.firstVisibleVPixel=Math.max(I+E,b)+F,h=this.ensureAllRowsInRangeHaveHeightsCalculated(g,f)}while(h);let m=this.paginationProxy.getRowIndexAtPixel(g),C=this.paginationProxy.getRowIndexAtPixel(f);const y=this.paginationProxy.getPageFirstRow(),v=this.paginationProxy.getPageLastRow();m<y&&(m=y),C>v&&(C=v),e=m,t=C}const i=this.gridOptionsService.isDomLayout("normal"),s=this.gridOptionsService.is("suppressMaxRenderedRowRestriction"),o=Math.max(this.getRowBuffer(),500);i&&!s&&t-e>o&&(t=e+o);const n=e!==this.firstRenderedRow,r=t!==this.lastRenderedRow;if(n||r){this.firstRenderedRow=e,this.lastRenderedRow=t;const a={type:u.EVENT_VIEWPORT_CHANGED,firstRow:e,lastRow:t};this.eventService.dispatchEvent(a)}}dispatchFirstDataRenderedEvent(){if(this.dataFirstRenderedFired)return;this.dataFirstRenderedFired=!0;const e={type:u.EVENT_FIRST_DATA_RENDERED,firstRow:this.firstRenderedRow,lastRow:this.lastRenderedRow};window.requestAnimationFrame(()=>{this.beans.eventService.dispatchEvent(e)})}ensureAllRowsInRangeHaveHeightsCalculated(e,t){const i=this.paginationProxy.ensureRowHeightsValid(e,t,-1,-1);return i&&this.updateContainerHeights(),i}getFirstVisibleVerticalPixel(){return this.firstVisibleVPixel}getFirstVirtualRenderedRow(){return this.firstRenderedRow}getLastVirtualRenderedRow(){return this.lastRenderedRow}doNotUnVirtualiseRow(e){const s=e.getRowNode(),o=this.focusService.isRowNodeFocused(s),n=e.isEditing(),r=s.detail;return o||n||r?!!this.paginationProxy.isRowPresent(s):!1}createRowCon(e,t,i){const s=this.cachedRowCtrls?this.cachedRowCtrls.getRow(e):null;if(s)return s;const o=this.gridOptionsService.is("suppressAnimationFrame"),n=i&&!o&&!this.printLayout;return new Et(e,this.beans,t,n,this.printLayout)}getRenderedNodes(){const e=this.rowCtrlsByRowIndex;return Object.keys(e).map(t=>e[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);break}return t}getRowNode(e){switch(e.rowPinned){case"top":return this.pinnedRowModel.getPinnedTopRowData()[e.rowIndex];case"bottom":return this.pinnedRowModel.getPinnedBottomRowData()[e.rowIndex];default:return this.rowModel.getRow(e.rowIndex)}}isRangeInRenderedViewport(e,t){if(e==null||t==null)return!1;const s=e>this.lastRenderedRow;return!(t<this.firstRenderedRow)&&!s}};bt([p("animationFrameService")],Qe.prototype,"animationFrameService",void 0),bt([p("paginationProxy")],Qe.prototype,"paginationProxy",void 0),bt([p("columnModel")],Qe.prototype,"columnModel",void 0),bt([p("pinnedRowModel")],Qe.prototype,"pinnedRowModel",void 0),bt([p("rowModel")],Qe.prototype,"rowModel",void 0),bt([p("focusService")],Qe.prototype,"focusService",void 0),bt([p("beans")],Qe.prototype,"beans",void 0),bt([p("rowContainerHeightService")],Qe.prototype,"rowContainerHeightService",void 0),bt([p("ctrlsService")],Qe.prototype,"ctrlsService",void 0),bt([D],Qe.prototype,"postConstruct",null),Qe=bt([M("rowRenderer")],Qe);class ug{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}removeFromCache(e){const t=e.getRowNode().id;delete this.entriesMap[t],ve(this.entriesList,e)}getEntries(){return this.entriesList}}var Rc=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let Jn=class extends T{formatValue(e,t,i,s,o=!0){let n=null,r;const a=e.getColDef();if(s?r=s:o&&(r=a.valueFormatter),r){const d={value:i,node:t,data:t?t.data:null,colDef:a,column:e,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context};typeof r=="function"?n=r(d):n=this.expressionService.evaluate(r,d)}else if(a.refData)return a.refData[i]||"";return n==null&&Array.isArray(i)&&(n=i.join(", ")),n}};Rc([p("expressionService")],Jn.prototype,"expressionService",void 0),Jn=Rc([M("valueFormatterService")],Jn);var ea=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let xo=class extends T{init(){this.setPinnedTopRowData(this.gridOptionsService.get("pinnedTopRowData")),this.setPinnedBottomRowData(this.gridOptionsService.get("pinnedBottomRowData"))}isEmpty(e){const t=e==="top"?this.pinnedTopRows:this.pinnedBottomRows;return Ve(t)}isRowsToRender(e){return!this.isEmpty(e)}getRowAtPixel(e,t){const i=t==="top"?this.pinnedTopRows:this.pinnedBottomRows;if(Ve(i))return 0;for(let s=0;s<i.length;s++){const o=i[s];if(o.rowTop+o.rowHeight-1>=e)return s}return i.length-1}setPinnedTopRowData(e){this.pinnedTopRows=this.createNodesFromData(e,!0);const t={type:u.EVENT_PINNED_ROW_DATA_CHANGED};this.eventService.dispatchEvent(t)}setPinnedBottomRowData(e){this.pinnedBottomRows=this.createNodesFromData(e,!1);const t={type:u.EVENT_PINNED_ROW_DATA_CHANGED};this.eventService.dispatchEvent(t)}createNodesFromData(e,t){const i=[];if(e){let s=0;e.forEach((o,n)=>{const r=new P(this.beans);r.data=o;const a=t?P.ID_PREFIX_TOP_PINNED:P.ID_PREFIX_BOTTOM_PINNED;r.id=a+n,r.rowPinned=t?"top":"bottom",r.setRowTop(s),r.setRowHeight(this.gridOptionsService.getRowHeightForNode(r).height),r.setRowIndex(n),s+=r.rowHeight,i.push(r)})}return i}getPinnedTopRowData(){return this.pinnedTopRows}getPinnedBottomRowData(){return this.pinnedBottomRows}getPinnedTopTotalHeight(){return this.getTotalHeight(this.pinnedTopRows)}getPinnedTopRowCount(){return this.pinnedTopRows?this.pinnedTopRows.length:0}getPinnedBottomRowCount(){return this.pinnedBottomRows?this.pinnedBottomRows.length:0}getPinnedTopRow(e){return this.pinnedTopRows[e]}getPinnedBottomRow(e){return this.pinnedBottomRows[e]}forEachPinnedTopRow(e){Ve(this.pinnedTopRows)||this.pinnedTopRows.forEach(e)}forEachPinnedBottomRow(e){Ve(this.pinnedBottomRows)||this.pinnedBottomRows.forEach(e)}getPinnedBottomTotalHeight(){return this.getTotalHeight(this.pinnedBottomRows)}getTotalHeight(e){if(!e||e.length===0)return 0;const t=Z(e);return t.rowTop+t.rowHeight}};ea([p("beans")],xo.prototype,"beans",void 0),ea([D],xo.prototype,"init",null),xo=ea([M("pinnedRowModel")],xo);var bc;(function(l){l.Applied="Applied",l.StoreNotFound="StoreNotFound",l.StoreLoading="StoreLoading",l.StoreWaitingToLoad="StoreWaitingToLoad",l.StoreLoadingFailed="StoreLoadingFailed",l.StoreWrongType="StoreWrongType",l.Cancelled="Cancelled"})(bc||(bc={}));class ta{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],n=this.mapToItems[i.parent.id];n.children||(n.children=[]),n.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()])}}class Ae extends T{constructor(e){super(),this.state=Ae.STATE_WAITING_TO_LOAD,this.version=0,this.id=e}getId(){return this.id}load(){this.state=Ae.STATE_LOADING,this.loadFromDatasource()}getVersion(){return this.version}setStateWaitingToLoad(){this.version++,this.state=Ae.STATE_WAITING_TO_LOAD}getState(){return this.state}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state=Ae.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=Ae.STATE_LOADED,this.processServerResult(t))}dispatchLoadCompleted(e=!0){const t={type:Ae.EVENT_LOAD_COMPLETE,success:e,block:this};this.dispatchEvent(t)}}Ae.EVENT_LOAD_COMPLETE="loadComplete",Ae.STATE_WAITING_TO_LOAD="needsLoading",Ae.STATE_LOADING="loading",Ae.STATE_LOADED="loaded",Ae.STATE_FAILED="failed";var Zn=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},hg=function(l,e){return function(t,i){e(t,i,l)}},er;let wi=er=class extends T{constructor(){super(...arguments),this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=this.getMaxConcurrentDatasourceRequests();const e=this.gridOptionsService.getNum("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=G.debounce(this.performCheckBlocksToLoad.bind(this),e))}setBeans(e){this.logger=e.create("RowNodeBlockLoader")}getMaxConcurrentDatasourceRequests(){const e=this.gridOptionsService.getNum("maxConcurrentDatasourceRequests");if(e==null)return 2;if(!(e<=0))return e}addBlock(e){this.blocks.push(e),e.addEventListener(Ae.EVENT_LOAD_COMPLETE,this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){G.removeFromArray(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad(),this.dispatchEvent({type:er.BLOCK_LOADED_EVENT}),this.activeBlockLoadsCount==0&&this.dispatchEvent({type:er.BLOCK_LOADER_FINISHED_EVENT})}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),this.maxConcurrentRequests!=null&&this.activeBlockLoadsCount>=this.maxConcurrentRequests){this.logger.log("checkBlockToLoad: max loads exceeded");return}const e=this.getAvailableLoadingCount(),t=this.blocks.filter(i=>i.getState()===Ae.STATE_WAITING_TO_LOAD).slice(0,e);this.registerLoads(t.length),t.forEach(i=>i.load()),this.printCacheStatus()}getBlockState(){if(this.gridOptionsService.isRowModelType("serverSide"))return this.rowModel.getBlockStates();const e={};return this.blocks.forEach(t=>{const{id:i,state:s}=t.getBlockStateJson();e[i]=s}),e}printCacheStatus(){this.logger.isLogging()&&this.logger.log(`printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}isLoading(){return this.activeBlockLoadsCount>0}registerLoads(e){this.activeBlockLoadsCount+=e}getAvailableLoadingCount(){return this.maxConcurrentRequests!==void 0?this.maxConcurrentRequests-this.activeBlockLoadsCount:void 0}};wi.BLOCK_LOADED_EVENT="blockLoaded",wi.BLOCK_LOADER_FINISHED_EVENT="blockLoaderFinished",Zn([p("rowModel")],wi.prototype,"rowModel",void 0),Zn([D],wi.prototype,"postConstruct",null),Zn([hg(0,Te("loggerFactory"))],wi.prototype,"setBeans",null),wi=er=Zn([M("rowNodeBlockLoader")],wi);var ia=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let Go=class extends T{constructor(){super(...arguments),this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.pixelOffset=0,this.masterRowCount=0}postConstruct(){this.active=this.gridOptionsService.is("pagination"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedListener(this.eventService,u.EVENT_MODEL_UPDATED,this.onModelUpdated.bind(this)),this.addManagedPropertyListener("pagination",this.onPaginationPageSizeChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPaginationPageSizeChanged.bind(this)),this.onModelUpdated()}ensureRowHeightsValid(e,t,i,s){const o=this.rowModel.ensureRowHeightsValid(e,t,this.getPageFirstRow(),this.getPageLastRow());return o&&this.calculatePages(),o}isPaginateChildRows(){return this.gridOptionsService.is("groupRemoveSingleChildren")||this.gridOptionsService.is("groupRemoveLowestSingleChildren")?!0:this.gridOptionsService.is("paginateChildRows")}onModelUpdated(e){this.calculatePages();const t={type:u.EVENT_PAGINATION_CHANGED,animate:e?e.animate:!1,newData:e?e.newData:!1,newPage:e?e.newPage:!1,keepRenderedRows:e?e.keepRenderedRows:!1};this.eventService.dispatchEvent(t)}onPaginationPageSizeChanged(){this.active=this.gridOptionsService.is("pagination"),this.calculatePages();const e={type:u.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!1,keepRenderedRows:!0};this.eventService.dispatchEvent(e)}goToPage(e){if(!this.active||this.currentPage===e||typeof this.currentPage!="number")return;this.currentPage=e;const t={type:u.EVENT_MODEL_UPDATED,animate:!1,keepRenderedRows:!1,newData:!1,newPage:!0};this.onModelUpdated(t)}getPixelOffset(){return this.pixelOffset}getRow(e){return this.rowModel.getRow(e)}getRowNode(e){return this.rowModel.getRowNode(e)}getRowIndexAtPixel(e){return this.rowModel.getRowIndexAtPixel(e)}getCurrentPageHeight(){return x(this.topRowBounds)||x(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}}isRowPresent(e){return this.rowModel.isRowPresent(e)?e.rowIndex>=this.topDisplayedRowIndex&&e.rowIndex<=this.bottomDisplayedRowIndex:!1}isEmpty(){return this.rowModel.isEmpty()}isRowsToRender(){return this.rowModel.isRowsToRender()}forEachNode(e){return this.rowModel.forEachNode(e)}forEachNodeOnPage(e){const t=this.getPageFirstRow(),i=this.getPageLastRow();for(let s=t;s<=i;s++){const o=this.getRow(s);o&&e(o)}}getType(){return this.rowModel.getType()}getRowBounds(e){const t=this.rowModel.getRowBounds(e);return t.rowIndex=e,t}getPageFirstRow(){return this.topRowBounds?this.topRowBounds.rowIndex:-1}getPageLastRow(){return this.bottomRowBounds?this.bottomRowBounds.rowIndex:-1}getRowCount(){return this.rowModel.getRowCount()}getPageForIndex(e){return Math.floor(e/this.pageSize)}goToPageWithIndex(e){if(!this.active)return;const t=this.getPageForIndex(e);this.goToPage(t)}isRowInPage(e){return this.active?this.getPageForIndex(e.rowIndex)===this.currentPage:!0}isLastPageFound(){return this.rowModel.isLastRowIndexKnown()}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPageSize(){this.pageSize=this.gridOptionsService.getNum("paginationPageSize"),(this.pageSize==null||this.pageSize<1)&&(this.pageSize=100)}calculatePages(){this.active?(this.setPageSize(),this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly()):this.calculatedPagesNotActive(),this.topRowBounds=this.rowModel.getRowBounds(this.topDisplayedRowIndex),this.topRowBounds&&(this.topRowBounds.rowIndex=this.topDisplayedRowIndex),this.bottomRowBounds=this.rowModel.getRowBounds(this.bottomDisplayedRowIndex),this.bottomRowBounds&&(this.bottomRowBounds.rowIndex=this.bottomDisplayedRowIndex),this.setPixelOffset(R(this.topRowBounds)?this.topRowBounds.rowTop:0)}setPixelOffset(e){this.pixelOffset!==e&&(this.pixelOffset=e,this.eventService.dispatchEvent({type:u.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){this.currentPage>=this.totalPages&&(this.currentPage=this.totalPages-1),(!isFinite(this.currentPage)||isNaN(this.currentPage)||this.currentPage<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){if(this.masterRowCount=this.rowModel.getTopLevelRowCount(),this.masterRowCount<=0){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.pageSize=this.rowModel.getRowCount(),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1}};ia([p("rowModel")],Go.prototype,"rowModel",void 0),ia([D],Go.prototype,"postConstruct",null),Go=ia([M("paginationProxy")],Go);var Tc=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let tr=class extends T{processAllCellClasses(e,t,i,s){this.processClassRules(e.cellClassRules,t,i,s),this.processStaticCellClasses(e,t,i)}processClassRules(e,t,i,s){if(e==null)return;const o=Object.keys(e),n={},r={};for(let a=0;a<o.length;a++){const d=o[a],c=e[d];let h;typeof c=="string"?h=this.expressionService.evaluate(c,t):typeof c=="function"&&(h=c(t)),d.split(" ").forEach(g=>{g==null||g.trim()==""||(h?n[g]=!0:r[g]=!0)})}s&&Object.keys(r).forEach(s),Object.keys(n).forEach(i)}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)})}};Tc([p("expressionService")],tr.prototype,"expressionService",void 0),tr=Tc([M("stylingService")],tr);class pg extends gi{constructor(e){super(e,"ag-toggle-button")}setValue(e,t){return super.setValue(e,t),this.addOrRemoveCssClass("ag-selected",this.getValue()),this}}class gg extends wt{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}}class fg extends Gi{constructor(e){super(e,"ag-date-field","date")}postConstruct(){super.postConstruct(),this.addManagedListener(this.eInput,"wheel",this.onWheel.bind(this));const e=it();this.addManagedListener(this.eInput,"mousedown",()=>{this.isDisabled()||e||this.eInput.focus()}),this.eInput.step="any"}onWheel(e){document.activeElement===this.eInput&&e.preventDefault()}setMin(e){var t;const i=e instanceof Date?(t=st(e??null,!1))!==null&&t!==void 0?t:void 0:e;return this.min===i?this:(this.min=i,hi(this.eInput,"min",i),this)}setMax(e){var t;const i=e instanceof Date?(t=st(e??null,!1))!==null&&t!==void 0?t:void 0:e;return this.max===i?this:(this.max=i,hi(this.eInput,"max",i),this)}setStep(e){return this.step===e?this:(this.step=e,hi(this.eInput,"step",e),this)}getDate(){var e;if(this.eInput.validity.valid)return(e=Ct(this.getValue()))!==null&&e!==void 0?e:void 0}setDate(e,t){this.setValue(st(e??null,!1),t)}}class Cg extends wt{constructor(e){super(e,"ag-range-field","range")}postConstruct(){super.postConstruct();const{min:e,max:t,step:i}=this.config;e!=null&&this.setMinValue(e),t!=null&&this.setMaxValue(t),this.setStep(i||1)}addInputListeners(){this.addManagedListener(this.eInput,"input",e=>{const t=e.target.value;this.setValue(t)})}setMinValue(e){return this.min=e,this.eInput.setAttribute("min",e.toString()),this}setMaxValue(e){return this.max=e,this.eInput.setAttribute("max",e.toString()),this}setStep(e){return this.eInput.setAttribute("step",e.toString()),this}setValue(e,t){this.min!=null&&(e=Math.max(parseFloat(e),this.min).toString()),this.max!=null&&(e=Math.min(parseFloat(e),this.max).toString());const i=super.setValue(e,t);return this.eInput.value=e,i}}var ir=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Si extends Tl{constructor(e){super(e,Si.TEMPLATE),this.labelAlignment="top"}init(){this.eSlider.addCssClass("ag-slider-field")}onValueChange(e){const t=Nt.EVENT_CHANGED;return this.addManagedListener(this.eText,t,()=>{const i=parseFloat(this.eText.getValue());this.eSlider.setValue(i.toString(),!0),e(i||0)}),this.addManagedListener(this.eSlider,t,()=>{const i=this.eSlider.getValue();this.eText.setValue(i,!0),e(parseFloat(i))}),this}setSliderWidth(e){return this.eSlider.setWidth(e),this}setTextFieldWidth(e){return this.eText.setWidth(e),this}setMinValue(e){return this.eSlider.setMinValue(e),this.eText.setMin(e),this}setMaxValue(e){return this.eSlider.setMaxValue(e),this.eText.setMax(e),this}getValue(){return this.eText.getValue()}setValue(e){return this.getValue()===e?this:(this.eText.setValue(e,!0),this.eSlider.setValue(e,!0),this.dispatchEvent({type:Nt.EVENT_CHANGED}),this)}setStep(e){return this.eSlider.setStep(e),this.eText.setStep(e),this}}Si.TEMPLATE=`<div class="ag-slider">
<label ref="eLabel"></label>
<div class="ag-wrapper ag-slider-wrapper">
<ag-input-range ref="eSlider"></ag-input-range>
<ag-input-number-field ref="eText"></ag-input-number-field>
</div>
</div>`,ir([O("eLabel")],Si.prototype,"eLabel",void 0),ir([O("eSlider")],Si.prototype,"eSlider",void 0),ir([O("eText")],Si.prototype,"eText",void 0),ir([D],Si.prototype,"init",null);var Ei=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Fe extends V{constructor(e={}){super(Fe.getTemplate(e)),this.suppressEnabledCheckbox=!0,this.suppressOpenCloseIcons=!1;const{title:t,enabled:i,items:s,suppressEnabledCheckbox:o,suppressOpenCloseIcons:n}=e;this.title=t,this.cssIdentifier=e.cssIdentifier||"default",this.enabled=i??!0,this.items=s||[],this.alignItems=e.alignItems||"center",o!=null&&(this.suppressEnabledCheckbox=o),n!=null&&(this.suppressOpenCloseIcons=n)}static getTemplate(e){const t=e.cssIdentifier||"default",i=e.direction||"vertical";return`<div class="ag-group ag-${t}-group" role="presentation">
<div class="ag-group-title-bar ag-${t}-group-title-bar ag-unselectable" ref="eTitleBar" role="button">
<span class="ag-group-title-bar-icon ag-${t}-group-title-bar-icon" ref="eGroupOpenedIcon" role="presentation"></span>
<span class="ag-group-title-bar-icon ag-${t}-group-title-bar-icon" ref="eGroupClosedIcon" role="presentation"></span>
<span ref="eTitle" class="ag-group-title ag-${t}-group-title"></span>
</div>
<div ref="eToolbar" class="ag-group-toolbar ag-${t}-group-toolbar">
<ag-checkbox ref="cbGroupEnabled"></ag-checkbox>
</div>
<div ref="eContainer" class="ag-group-container ag-group-container-${i} ag-${t}-group-container"></div>
</div>`}postConstruct(){if(this.items.length){const t=this.items;this.items=[],this.addItems(t)}const e=this.localeService.getLocaleTextFunc();this.cbGroupEnabled.setLabel(e("enabled","Enabled")),this.title&&this.setTitle(this.title),this.enabled&&this.setEnabled(this.enabled),this.setAlignItems(this.alignItems),this.hideEnabledCheckbox(this.suppressEnabledCheckbox),this.hideOpenCloseIcons(this.suppressOpenCloseIcons),this.setupExpandContract(),this.refreshAriaStatus(),this.refreshChildDisplay()}setupExpandContract(){this.eGroupClosedIcon.appendChild(nt("columnSelectClosed",this.gridOptionsService,null)),this.eGroupOpenedIcon.appendChild(nt("columnSelectOpen",this.gridOptionsService,null)),this.addManagedListener(this.eTitleBar,"click",()=>this.toggleGroupExpand()),this.addManagedListener(this.eTitleBar,"keydown",e=>{switch(e.key){case w.ENTER:case w.SPACE:e.preventDefault(),this.toggleGroupExpand();break;case w.RIGHT:case w.LEFT:e.preventDefault(),this.toggleGroupExpand(e.key===w.RIGHT);break}})}refreshAriaStatus(){this.suppressOpenCloseIcons||ft(this.eTitleBar,this.expanded)}refreshChildDisplay(){const e=!this.suppressOpenCloseIcons;z(this.eToolbar,this.expanded&&!this.suppressEnabledCheckbox),z(this.eGroupOpenedIcon,e&&this.expanded),z(this.eGroupClosedIcon,e&&!this.expanded)}isExpanded(){return this.expanded}setAlignItems(e){this.alignItems!==e&&this.removeCssClass(`ag-group-item-alignment-${this.alignItems}`),this.alignItems=e;const t=`ag-group-item-alignment-${this.alignItems}`;return this.addCssClass(t),this}toggleGroupExpand(e){return this.suppressOpenCloseIcons?(this.expanded=!0,this.refreshChildDisplay(),z(this.eContainer,!0),this):(e=e??!this.expanded,this.expanded===e?this:(this.expanded=e,this.refreshAriaStatus(),this.refreshChildDisplay(),z(this.eContainer,e),this.dispatchEvent({type:this.expanded?Fe.EVENT_EXPANDED:Fe.EVENT_COLLAPSED}),this))}addItems(e){e.forEach(t=>this.addItem(t))}addItem(e){const t=this.eContainer,i=e instanceof V?e.getGui():e;i.classList.add("ag-group-item",`ag-${this.cssIdentifier}-group-item`),t.appendChild(i),this.items.push(i)}hideItem(e,t){const i=this.items[t];z(i,!e)}setTitle(e){return this.eTitle.innerText=e,this}addCssClassToTitleBar(e){this.eTitleBar.classList.add(e)}setEnabled(e,t){return this.enabled=e,this.refreshDisabledStyles(),this.toggleGroupExpand(e),t||this.cbGroupEnabled.setValue(e),this}isEnabled(){return this.enabled}onEnableChange(e){return this.cbGroupEnabled.onValueChange(t=>{this.setEnabled(t,!0),e(t)}),this}hideEnabledCheckbox(e){return this.suppressEnabledCheckbox=e,this.refreshChildDisplay(),this.refreshDisabledStyles(),this}hideOpenCloseIcons(e){return this.suppressOpenCloseIcons=e,e&&this.toggleGroupExpand(!0),this}refreshDisabledStyles(){this.addOrRemoveCssClass("ag-disabled",!this.enabled),this.suppressEnabledCheckbox&&!this.enabled?(this.eTitleBar.classList.add("ag-disabled-group-title-bar"),this.eTitleBar.removeAttribute("tabindex")):(this.eTitleBar.classList.remove("ag-disabled-group-title-bar"),this.eTitleBar.setAttribute("tabindex","0")),this.eContainer.classList.toggle("ag-disabled-group-container",!this.enabled)}}Fe.EVENT_EXPANDED="expanded",Fe.EVENT_COLLAPSED="collapsed",Ei([O("eTitleBar")],Fe.prototype,"eTitleBar",void 0),Ei([O("eGroupOpenedIcon")],Fe.prototype,"eGroupOpenedIcon",void 0),Ei([O("eGroupClosedIcon")],Fe.prototype,"eGroupClosedIcon",void 0),Ei([O("eToolbar")],Fe.prototype,"eToolbar",void 0),Ei([O("cbGroupEnabled")],Fe.prototype,"cbGroupEnabled",void 0),Ei([O("eTitle")],Fe.prototype,"eTitle",void 0),Ei([O("eContainer")],Fe.prototype,"eContainer",void 0),Ei([D],Fe.prototype,"postConstruct",null);class sr extends V{initialiseTabGuard(e){this.eTopGuard=this.createTabGuard("top"),this.eBottomGuard=this.createTabGuard("bottom"),this.eFocusableElement=this.getFocusableElement();const t=[this.eTopGuard,this.eBottomGuard],i={setTabIndex:s=>{t.forEach(o=>s!=null?o.setAttribute("tabindex",s):o.removeAttribute("tabindex"))}};this.addTabGuards(this.eTopGuard,this.eBottomGuard),this.tabGuardCtrl=this.createManagedBean(new Ql({comp:i,eTopGuard:this.eTopGuard,eBottomGuard:this.eBottomGuard,eFocusableElement:this.eFocusableElement,onFocusIn:e.onFocusIn,onFocusOut:e.onFocusOut,focusInnerElement:e.focusInnerElement,handleKeyDown:e.handleKeyDown,onTabKeyDown:e.onTabKeyDown,shouldStopEventPropagation:e.shouldStopEventPropagation}))}createTabGuard(e){const t=document.createElement("div"),i=e==="top"?Ds.TAB_GUARD_TOP:Ds.TAB_GUARD_BOTTOM;return t.classList.add(Ds.TAB_GUARD,i),pe(t,"presentation"),t}addTabGuards(e,t){this.eFocusableElement.insertAdjacentElement("afterbegin",e),this.eFocusableElement.insertAdjacentElement("beforeend",t)}removeAllChildrenExceptTabGuards(){const e=[this.eTopGuard,this.eBottomGuard];We(this.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}appendChild(e,t){Zs(e)||(e=e.getGui());const{eBottomGuard:i}=this;i?i.insertAdjacentElement("beforebegin",e):super.appendChild(e,t)}}var Dc=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class qi extends sr{constructor(e=1){super('<div class="ag-menu-list" role="tree"></div>'),this.level=e,this.menuItems=[]}postConstruct(){this.initialiseTabGuard({onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)})}onTabKeyDown(e){const t=this.getParentComponent(),i=t&&t.getGui();i&&i.classList.contains("ag-focus-managed")||e.preventDefault(),e.shiftKey&&this.closeIfIsChild(e)}handleKeyDown(e){switch(e.key){case w.UP:case w.RIGHT:case w.DOWN:case w.LEFT:e.preventDefault(),this.handleNavKey(e.key);break;case w.ESCAPE:const t=this.findTopMenu();t&&this.focusService.focusInto(t.getGui());break}}clearActiveItem(){this.activeMenuItem&&(this.activeMenuItem.deactivate(),this.activeMenuItem=null)}addMenuItems(e){e!=null&&e.forEach(t=>{t==="separator"?this.addSeparator():typeof t=="string"?console.warn(`AG Grid: unrecognised menu item ${t}`):this.addItem(t)})}addItem(e){const t=this.createManagedBean(new Re(Object.assign(Object.assign({},e),{isAnotherSubMenuOpen:()=>this.menuItems.some(i=>i.isSubMenuOpen())})));t.setParentComponent(this),dd(t.getGui(),this.level),this.menuItems.push(t),this.appendChild(t.getGui()),this.addManagedListener(t,Re.EVENT_MENU_ITEM_SELECTED,i=>{this.dispatchEvent(i)}),this.addManagedListener(t,Re.EVENT_MENU_ITEM_ACTIVATED,i=>{this.activeMenuItem&&this.activeMenuItem!==i.menuItem&&this.activeMenuItem.deactivate(),this.activeMenuItem=i.menuItem})}activateFirstItem(){const e=this.menuItems.filter(t=>!t.isDisabled())[0];e&&e.activate()}addSeparator(){const e=`
<div class="ag-menu-separator" aria-hidden="true">
<div class="ag-menu-separator-part"></div>
<div class="ag-menu-separator-part"></div>
<div class="ag-menu-separator-part"></div>
<div class="ag-menu-separator-part"></div>
</div>`;this.appendChild(fe(e))}findTopMenu(){let e=this.getParentComponent();if(!e&&this instanceof qi)return this;for(;;){const t=e&&e.getParentComponent&&e.getParentComponent();if(!t||!(t instanceof qi||t instanceof Re))break;e=t}return e instanceof qi?e:void 0}handleNavKey(e){switch(e){case w.UP:case w.DOWN:const i=this.findNextItem(e===w.UP);i&&i!==this.activeMenuItem&&i.activate();return}const t=this.gridOptionsService.is("enableRtl")?w.RIGHT:w.LEFT;e===t?this.closeIfIsChild():this.openChild()}closeIfIsChild(e){const t=this.getParentComponent();t&&t instanceof Re&&(e&&e.preventDefault(),t.closeSubMenu(),t.getGui().focus())}openChild(){this.activeMenuItem&&this.activeMenuItem.openSubMenu(!0)}findNextItem(e){const t=this.menuItems.filter(o=>!o.isDisabled());if(!t.length)return;if(!this.activeMenuItem)return e?Z(t):t[0];e&&t.reverse();let i,s=!1;for(let o=0;o<t.length;o++){const n=t[o];if(!s){n===this.activeMenuItem&&(s=!0);continue}i=n;break}return i||this.activeMenuItem}destroy(){this.clearActiveItem(),super.destroy()}}Dc([p("focusService")],qi.prototype,"focusService",void 0),Dc([D],qi.prototype,"postConstruct",null);var mg=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Oc extends sr{constructor(e){super(),this.wrappedComponent=e,this.setTemplateFromElement(e.getGui())}postConstruct(){this.initialiseTabGuard({onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)})}handleKeyDown(e){e.key===w.ESCAPE&&this.closePanel()}onTabKeyDown(e){e.defaultPrevented||(this.closePanel(),e.preventDefault())}closePanel(){const e=this.parentComponent;e.closeSubMenu(),setTimeout(()=>e.getGui().focus(),0)}}mg([D],Oc.prototype,"postConstruct",null);var Pc=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Re extends V{constructor(e){super(),this.params=e,this.isActive=!1,this.subMenuIsOpen=!1,this.setTemplate(`<div class="${this.getClassName()}" tabindex="-1" role="treeitem"></div>`)}init(){this.addIcon(),this.addName(),this.addShortcut(),this.addSubMenu(),this.addTooltip();const e=this.getGui();this.params.disabled?(this.addCssClass(this.getClassName("disabled")),Ur(e,!0)):(this.addGuiEventListener("click",t=>this.onItemSelected(t)),this.addGuiEventListener("keydown",t=>{(t.key===w.ENTER||t.key===w.SPACE)&&(t.preventDefault(),this.onItemSelected(t))}),this.addGuiEventListener("mousedown",t=>{t.stopPropagation(),t.preventDefault()}),this.addGuiEventListener("mouseenter",()=>this.onMouseEnter()),this.addGuiEventListener("mouseleave",()=>this.onMouseLeave())),this.params.cssClasses&&this.params.cssClasses.forEach(t=>this.addCssClass(t))}isDisabled(){return!!this.params.disabled}openSubMenu(e=!1){if(this.closeSubMenu(),!this.params.subMenu)return;const t=fe('<div class="ag-menu" role="presentation"></div>');let i;if(this.params.subMenu instanceof Array){const a=od(this.getGui()),d=isNaN(a)?1:a+1,c=this.createBean(new qi(d));c.setParentComponent(this),c.addMenuItems(this.params.subMenu),t.appendChild(c.getGui()),this.addManagedListener(c,Re.EVENT_MENU_ITEM_SELECTED,h=>this.dispatchEvent(h)),c.addGuiEventListener("mouseenter",()=>this.cancelDeactivate()),i=()=>this.destroyBean(c),e&&setTimeout(()=>c.activateFirstItem(),0)}else{const{subMenu:a}=this.params,d=this.createBean(new Oc(a));d.setParentComponent(this);const c=d.getGui(),h="mouseenter",g=()=>this.cancelDeactivate();c.addEventListener(h,g),i=()=>c.removeEventListener(h,g),t.appendChild(c),a.afterGuiAttached&&setTimeout(()=>a.afterGuiAttached(),0)}const s=this.getGui(),o=this.popupService.positionPopupForMenu.bind(this.popupService,{eventSource:s,ePopup:t}),n=this.localeService.getLocaleTextFunc(),r=this.popupService.addPopup({modal:!0,eChild:t,positionCallback:o,anchorToElement:s,ariaLabel:n("ariaLabelSubMenu","SubMenu")});this.subMenuIsOpen=!0,ft(s,!0),this.hideSubMenu=()=>{r&&r.hideFunc(),this.subMenuIsOpen=!1,ft(s,!1),i()}}closeSubMenu(){this.hideSubMenu&&(this.hideSubMenu(),this.hideSubMenu=null,ft(this.getGui(),!1))}isSubMenuOpen(){return this.subMenuIsOpen}activate(e){this.cancelActivate(),!this.params.disabled&&(this.isActive=!0,this.addCssClass(this.getClassName("active")),this.getGui().focus(),e&&this.params.subMenu&&window.setTimeout(()=>{this.isAlive()&&this.isActive&&this.openSubMenu()},300),this.onItemActivated())}deactivate(){this.cancelDeactivate(),this.removeCssClass(this.getClassName("active")),this.isActive=!1,this.subMenuIsOpen&&this.hideSubMenu()}addIcon(){if(!this.params.checked&&!this.params.icon&&this.params.isCompact)return;const e=fe(`<span ref="eIcon" class="${this.getClassName("part")} ${this.getClassName("icon")}" role="presentation"></span>`);this.params.checked?e.appendChild(le("check",this.gridOptionsService)):this.params.icon&&(Zs(this.params.icon)?e.appendChild(this.params.icon):typeof this.params.icon=="string"?e.innerHTML=this.params.icon:console.warn("AG Grid: menu item icon must be DOM node or string")),this.getGui().appendChild(e)}addName(){if(!this.params.name&&this.params.isCompact)return;const e=fe(`<span ref="eName" class="${this.getClassName("part")} ${this.getClassName("text")}">${this.params.name||""}</span>`);this.getGui().appendChild(e)}addTooltip(){this.params.tooltip&&(this.tooltip=this.params.tooltip,this.gridOptionsService.is("enableBrowserTooltips")?this.getGui().setAttribute("title",this.tooltip):this.createManagedBean(new Zt(this)))}getTooltipParams(){return{location:"menu",value:this.tooltip}}addShortcut(){if(!this.params.shortcut&&this.params.isCompact)return;const e=fe(`<span ref="eShortcut" class="${this.getClassName("part")} ${this.getClassName("shortcut")}">${this.params.shortcut||""}</span>`);this.getGui().appendChild(e)}addSubMenu(){if(!this.params.subMenu&&this.params.isCompact)return;const e=fe(`<span ref="ePopupPointer" class="${this.getClassName("part")} ${this.getClassName("popup-pointer")}"></span>`),t=this.getGui();if(this.params.subMenu){const i=this.gridOptionsService.is("enableRtl")?"smallLeft":"smallRight";ft(t,!1),e.appendChild(le(i,this.gridOptionsService))}t.appendChild(e)}onItemSelected(e){if(this.params.action?this.params.action():this.openSubMenu(e&&e.type==="keydown"),this.params.subMenu&&!this.params.action)return;const t={type:Re.EVENT_MENU_ITEM_SELECTED,action:this.params.action,checked:this.params.checked,cssClasses:this.params.cssClasses,disabled:this.params.disabled,icon:this.params.icon,name:this.params.name,shortcut:this.params.shortcut,subMenu:this.params.subMenu,tooltip:this.params.tooltip,event:e};this.dispatchEvent(t)}onItemActivated(){const e={type:Re.EVENT_MENU_ITEM_ACTIVATED,menuItem:this};this.dispatchEvent(e)}cancelActivate(){this.activateTimeoutId&&(window.clearTimeout(this.activateTimeoutId),this.activateTimeoutId=0)}cancelDeactivate(){this.deactivateTimeoutId&&(window.clearTimeout(this.deactivateTimeoutId),this.deactivateTimeoutId=0)}onMouseEnter(){this.cancelDeactivate(),this.params.isAnotherSubMenuOpen()?this.activateTimeoutId=window.setTimeout(()=>this.activate(!0),Re.ACTIVATION_DELAY):this.activate(!0)}onMouseLeave(){this.cancelActivate(),this.isSubMenuOpen()?this.deactivateTimeoutId=window.setTimeout(()=>this.deactivate(),Re.ACTIVATION_DELAY):this.deactivate()}getClassName(e){const t=this.params.isCompact?"ag-compact-menu-option":"ag-menu-option";return e?`${t}-${e}`:t}}Re.EVENT_MENU_ITEM_SELECTED="menuItemSelected",Re.EVENT_MENU_ITEM_ACTIVATED="menuItemActivated",Re.ACTIVATION_DELAY=80,Pc([p("popupService")],Re.prototype,"popupService",void 0),Pc([D],Re.prototype,"init",null);var Ho=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Tt extends V{constructor(e){super(Tt.getTemplate(e)),this.closable=!0,this.config=e}static getTemplate(e){const t=e&&e.cssIdentifier||"default";return`<div class="ag-panel ag-${t}-panel" tabindex="-1">
<div ref="eTitleBar" class="ag-panel-title-bar ag-${t}-panel-title-bar ag-unselectable">
<span ref="eTitle" class="ag-panel-title-bar-title ag-${t}-panel-title-bar-title"></span>
<div ref="eTitleBarButtons" class="ag-panel-title-bar-buttons ag-${t}-panel-title-bar-buttons"></div>
</div>
<div ref="eContentWrapper" class="ag-panel-content-wrapper ag-${t}-panel-content-wrapper"></div>
</div>`}postConstruct(){const{component:e,closable:t,hideTitleBar:i,title:s,minWidth:o=250,width:n,minHeight:r=250,height:a,centered:d,popup:c,x:h,y:g}=this.config;this.positionableFeature=new eo(this.getGui(),{minWidth:o,width:n,minHeight:r,height:a,centered:d,x:h,y:g,popup:c,calculateTopBuffer:()=>this.positionableFeature.getHeight()-this.getBodyHeight()}),this.createManagedBean(this.positionableFeature);const f=this.getGui();e&&this.setBodyComponent(e),i?z(this.eTitleBar,!1):(s&&this.setTitle(s),this.setClosable(t??this.closable)),this.addManagedListener(this.eTitleBar,"mousedown",m=>{const C=this.gridOptionsService.getDocument();if(f.contains(m.relatedTarget)||f.contains(C.activeElement)||this.eTitleBarButtons.contains(m.target)){m.preventDefault();return}const y=this.eContentWrapper.querySelector("button, [href], input, select, textarea, [tabindex]");y&&y.focus()}),!(c&&this.positionableFeature.isPositioned())&&(this.renderComponent&&this.renderComponent(),this.positionableFeature.initialisePosition(),this.eContentWrapper.style.height="0")}renderComponent(){const e=this.getGui();e.focus(),this.close=()=>{e.parentElement.removeChild(e),this.destroy()}}getHeight(){return this.positionableFeature.getHeight()}setHeight(e){this.positionableFeature.setHeight(e)}getWidth(){return this.positionableFeature.getWidth()}setWidth(e){this.positionableFeature.setWidth(e)}setClosable(e){if(e!==this.closable&&(this.closable=e),e){const t=this.closeButtonComp=new V(Tt.CLOSE_BTN_TEMPLATE);this.getContext().createBean(t);const i=t.getGui(),s=le("close",this.gridOptionsService);s.classList.add("ag-panel-title-bar-button-icon"),i.appendChild(s),this.addTitleBarButton(t),t.addManagedListener(i,"click",this.onBtClose.bind(this))}else if(this.closeButtonComp){const t=this.closeButtonComp.getGui();t.parentElement.removeChild(t),this.closeButtonComp=this.destroyBean(this.closeButtonComp)}}setBodyComponent(e){e.setParentComponent(this),this.eContentWrapper.appendChild(e.getGui())}addTitleBarButton(e,t){const i=this.eTitleBarButtons,s=i.children,o=s.length;t==null&&(t=o),t=Math.max(0,Math.min(t,o)),e.addCssClass("ag-panel-title-bar-button");const n=e.getGui();t===0?i.insertAdjacentElement("afterbegin",n):t===o?i.insertAdjacentElement("beforeend",n):s[t-1].insertAdjacentElement("afterend",n),e.setParentComponent(this)}getBodyHeight(){return Ys(this.eContentWrapper)}getBodyWidth(){return On(this.eContentWrapper)}setTitle(e){this.eTitle.innerText=e}onBtClose(){this.close()}destroy(){this.closeButtonComp&&(this.closeButtonComp=this.destroyBean(this.closeButtonComp));const e=this.getGui();e&&e.offsetParent&&this.close(),super.destroy()}}Tt.CLOSE_BTN_TEMPLATE='<div class="ag-button"></div>',Ho([O("eContentWrapper")],Tt.prototype,"eContentWrapper",void 0),Ho([O("eTitleBar")],Tt.prototype,"eTitleBar",void 0),Ho([O("eTitleBarButtons")],Tt.prototype,"eTitleBarButtons",void 0),Ho([O("eTitle")],Tt.prototype,"eTitle",void 0),Ho([D],Tt.prototype,"postConstruct",null);var vg=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Ac extends Tt{constructor(e){super(Object.assign(Object.assign({},e),{popup:!0})),this.isMaximizable=!1,this.isMaximized=!1,this.maximizeListeners=[],this.resizeListenerDestroy=null,this.lastPosition={x:0,y:0,width:0,height:0}}postConstruct(){const e=this.getGui(),{movable:t,resizable:i,maximizable:s}=this.config;this.addCssClass("ag-dialog"),super.postConstruct(),this.addManagedListener(e,"focusin",o=>{e.contains(o.relatedTarget)||this.popupService.bringPopupToFront(e)}),t&&this.setMovable(t),s&&this.setMaximizable(s),i&&this.setResizable(i)}renderComponent(){const e=this.getGui(),{alwaysOnTop:t,modal:i,title:s}=this.config,o=this.localeService.getLocaleTextFunc(),n=this.popupService.addPopup({modal:i,eChild:e,closeOnEsc:!0,closedCallback:this.destroy.bind(this),alwaysOnTop:t,ariaLabel:s||o("ariaLabelDialog","Dialog")});n&&(this.close=n.hideFunc)}toggleMaximize(){const e=this.positionableFeature.getPosition();if(this.isMaximized){const{x:t,y:i,width:s,height:o}=this.lastPosition;this.setWidth(s),this.setHeight(o),this.positionableFeature.offsetElement(t,i)}else this.lastPosition.width=this.getWidth(),this.lastPosition.height=this.getHeight(),this.lastPosition.x=e.x,this.lastPosition.y=e.y,this.positionableFeature.offsetElement(0,0),this.setHeight("100%"),this.setWidth("100%");this.isMaximized=!this.isMaximized,this.refreshMaximizeIcon()}refreshMaximizeIcon(){z(this.maximizeIcon,!this.isMaximized),z(this.minimizeIcon,this.isMaximized)}clearMaximizebleListeners(){this.maximizeListeners.length&&(this.maximizeListeners.forEach(e=>e()),this.maximizeListeners.length=0),this.resizeListenerDestroy&&(this.resizeListenerDestroy(),this.resizeListenerDestroy=null)}destroy(){this.maximizeButtonComp=this.destroyBean(this.maximizeButtonComp),this.clearMaximizebleListeners(),super.destroy()}setResizable(e){this.positionableFeature.setResizable(e)}setMovable(e){this.positionableFeature.setMovable(e,this.eTitleBar)}setMaximizable(e){if(!e){this.clearMaximizebleListeners(),this.maximizeButtonComp&&(this.destroyBean(this.maximizeButtonComp),this.maximizeButtonComp=this.maximizeIcon=this.minimizeIcon=void 0);return}const t=this.eTitleBar;if(!t||e===this.isMaximizable)return;const i=this.buildMaximizeAndMinimizeElements();this.refreshMaximizeIcon(),i.addManagedListener(i.getGui(),"click",this.toggleMaximize.bind(this)),this.addTitleBarButton(i,0),this.maximizeListeners.push(this.addManagedListener(t,"dblclick",this.toggleMaximize.bind(this))),this.resizeListenerDestroy=this.addManagedListener(this,"resize",()=>{this.isMaximized=!1,this.refreshMaximizeIcon()})}buildMaximizeAndMinimizeElements(){const e=this.maximizeButtonComp=this.createBean(new V('<div class="ag-dialog-button"></span>')),t=e.getGui();return this.maximizeIcon=le("maximize",this.gridOptionsService),t.appendChild(this.maximizeIcon),this.maximizeIcon.classList.add("ag-panel-title-bar-button-icon"),this.minimizeIcon=le("minimize",this.gridOptionsService),t.appendChild(this.minimizeIcon),this.minimizeIcon.classList.add("ag-panel-title-bar-button-icon"),e}}vg([p("popupService")],Ac.prototype,"popupService",void 0);var Vo=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},sa,yi;(function(l){l[l.vertical=0]="vertical",l[l.horizontal=1]="horizontal"})(yi||(yi={}));let wg=0,Ri=sa=class extends T{constructor(){super(...arguments),this.popupList=[]}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridCtrl=e.gridCtrl,this.addManagedListener(this.gridCtrl,u.EVENT_KEYBOARD_FOCUS,()=>{this.popupList.forEach(t=>t.element.classList.add(ae.AG_KEYBOARD_FOCUS))}),this.addManagedListener(this.gridCtrl,u.EVENT_MOUSE_FOCUS,()=>{this.popupList.forEach(t=>t.element.classList.remove(ae.AG_KEYBOARD_FOCUS))})})}getPopupParent(){const e=this.gridOptionsService.get("popupParent");return e||this.gridCtrl.getGui()}positionPopupForMenu(e){const t=e.eventSource.getBoundingClientRect(),i=this.getParentRect(),s=this.keepXYWithinBounds(e.ePopup,t.top-i.top,yi.vertical),o=e.ePopup.clientWidth>0?e.ePopup.clientWidth:200;e.ePopup.style.minWidth=`${o}px`;const r=i.right-i.left-o;let a;this.gridOptionsService.is("enableRtl")?(a=c(),a<0&&(a=d()),a>r&&(a=0)):(a=d(),a>r&&(a=c()),a<0&&(a=0)),e.ePopup.style.left=`${a}px`,e.ePopup.style.top=`${s}px`;function d(){return t.right-i.left-2}function c(){return t.left-i.left-o}}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 t=e.eventSource.getBoundingClientRect(),i=e.alignSide||"left",s=e.position||"over",o=this.getParentRect(),n=()=>{let r=t.left-o.left;i==="right"&&(r-=e.ePopup.offsetWidth-t.width);const a=s==="over"?t.top-o.top:t.top-o.top+t.height;return{x:r,y:a}};this.positionPopup({ePopup:e.ePopup,nudgeX:e.nudgeX,nudgeY:e.nudgeY,keepWithinBounds:e.keepWithinBounds,updatePosition:n,postProcessCallback:()=>this.callPostProcessPopup(e.type,e.ePopup,e.eventSource,null,e.column,e.rowNode)})}callPostProcessPopup(e,t,i,s,o,n){const r=this.gridOptionsService.getCallback("postProcessPopup");r&&r({column:o,rowNode:n,ePopup:t,type:e,eventSource:i,mouseEvent:s})}positionPopup(e){const{ePopup:t,keepWithinBounds:i,nudgeX:s,nudgeY:o,skipObserver:n,updatePosition:r}=e,a={width:0,height:0},d=(c=!1)=>{let{x:h,y:g}=r();c&&t.clientWidth===a.width&&t.clientHeight===a.height||(a.width=t.clientWidth,a.height=t.clientHeight,s&&(h+=s),o&&(g+=o),i&&(h=this.keepXYWithinBounds(t,h,yi.horizontal),g=this.keepXYWithinBounds(t,g,yi.vertical)),t.style.left=`${h}px`,t.style.top=`${g}px`,e.postProcessCallback&&e.postProcessCallback())};if(d(),!n){const c=this.resizeObserverService.observeResize(t,()=>d(!0));setTimeout(()=>c(),sa.WAIT_FOR_POPUP_CONTENT_RESIZE)}}getActivePopups(){return this.popupList.map(e=>e.element)}getPopupList(){return this.popupList}getParentRect(){const e=this.gridOptionsService.getDocument();let t=this.getPopupParent();return t===e.body?t=e.documentElement:getComputedStyle(t).position==="static"&&(t=t.offsetParent),dl(t)}keepXYWithinBounds(e,t,i){const s=i===yi.vertical,o=s?"clientHeight":"clientWidth",n=s?"top":"left",r=s?"offsetHeight":"offsetWidth",a=s?"scrollTop":"scrollLeft",d=this.gridOptionsService.getDocument(),c=d.documentElement,h=this.getPopupParent(),g=h.getBoundingClientRect(),f=d.documentElement.getBoundingClientRect(),m=h===d.body,C=e[r];let v=m?(s?al:Pn)(c)+c[a]:h[o];m&&(v-=Math.abs(f[n]-g[n]));const E=v-C;return Math.min(Math.max(t,0),Math.abs(E))}addPopup(e){const t=this.gridOptionsService.getDocument(),{eChild:i,ariaLabel:s,alwaysOnTop:o,positionCallback:n,anchorToElement:r}=e;if(!t)return console.warn("AG Grid: could not find the document, document is empty"),{hideFunc:()=>{}};const a=this.popupList.findIndex(h=>h.element===i);if(a!==-1)return{hideFunc:this.popupList[a].hideFunc};this.initialisePopupPosition(i);const d=this.createPopupWrapper(i,s,!!o),c=this.addEventListenersToPopup(Object.assign(Object.assign({},e),{wrapperEl:d}));return n&&n(),this.addPopupToPopupList(i,d,c,r),{hideFunc:c}}initialisePopupPosition(e){const i=this.getPopupParent().getBoundingClientRect();R(e.style.top)||(e.style.top=`${i.top*-1}px`),R(e.style.left)||(e.style.left=`${i.left*-1}px`)}createPopupWrapper(e,t,i){const s=this.getPopupParent(),o=document.createElement("div"),{allThemes:n}=this.environment.getTheme();return n.length&&o.classList.add(...n),o.classList.add("ag-popup"),e.classList.add(this.gridOptionsService.is("enableRtl")?"ag-rtl":"ag-ltr","ag-popup-child"),e.hasAttribute("role")||pe(e,"dialog"),di(e,t),this.focusService.isKeyboardMode()&&e.classList.add(ae.AG_KEYBOARD_FOCUS),o.appendChild(e),s.appendChild(o),i?this.setAlwaysOnTop(e,!0):this.bringPopupToFront(e),o}addEventListenersToPopup(e){const t=this.gridOptionsService.getDocument(),i=this.getPopupParent(),{wrapperEl:s,eChild:o,click:n,closedCallback:r,afterGuiAttached:a,closeOnEsc:d,modal:c}=e;let h=!1;const g=y=>{if(!s.contains(t.activeElement))return;y.key===w.ESCAPE&&C({keyboardEvent:y})},f=y=>C({mouseEvent:y}),m=y=>C({touchEvent:y}),C=(y={})=>{const{mouseEvent:v,touchEvent:E,keyboardEvent:b}=y;this.isEventFromCurrentPopup({mouseEvent:v,touchEvent:E},o)||this.isEventSameChainAsOriginalEvent({originalMouseEvent:n,mouseEvent:v,touchEvent:E})||h||(h=!0,i.removeChild(s),t.removeEventListener("keydown",g),t.removeEventListener("mousedown",f),t.removeEventListener("touchstart",m),t.removeEventListener("contextmenu",f),this.eventService.removeEventListener(u.EVENT_DRAG_STARTED,f),r&&r(v||E||b),this.removePopupFromPopupList(o))};return a&&a({hidePopup:C}),window.setTimeout(()=>{d&&t.addEventListener("keydown",g),c&&(t.addEventListener("mousedown",f),this.eventService.addEventListener(u.EVENT_DRAG_STARTED,f),t.addEventListener("touchstart",m),t.addEventListener("contextmenu",f))},0),C}addPopupToPopupList(e,t,i,s){this.popupList.push({element:e,wrapper:t,hideFunc:i,instanceId:wg++,isAnchored:!!s}),s&&this.setPopupPositionRelatedToElement(e,s)}setPopupPositionRelatedToElement(e,t){const i=this.popupList.find(o=>o.element===e);if(!i||(i.stopAnchoringPromise&&i.stopAnchoringPromise.then(o=>o&&o()),i.stopAnchoringPromise=void 0,i.isAnchored=!1,!t))return;const s=this.keepPopupPositionedRelativeTo({element:t,ePopup:e,hidePopup:i.hideFunc});return i.stopAnchoringPromise=s,i.isAnchored=!0,s}removePopupFromPopupList(e){this.setPopupPositionRelatedToElement(e,null),this.popupList=this.popupList.filter(t=>t.element!==e)}keepPopupPositionedRelativeTo(e){const t=this.getPopupParent(),i=t.getBoundingClientRect(),{element:s,ePopup:o}=e,n=s.getBoundingClientRect(),r=i.top-n.top,a=i.left-n.left;let d=r,c=a;const h=o.style.top,g=parseInt(h.substring(0,h.length-1),10),f=o.style.left,m=parseInt(f.substring(0,f.length-1),10);return new De(C=>{this.getFrameworkOverrides().setInterval(()=>{const y=t.getBoundingClientRect(),v=s.getBoundingClientRect();if(v.top==0&&v.left==0&&v.height==0&&v.width==0){e.hidePopup();return}const b=y.top-v.top;if(b!=d){const F=this.keepXYWithinBounds(o,g+r-b,yi.vertical);o.style.top=`${F}px`}d=b;const _=y.left-v.left;if(_!=c){const F=this.keepXYWithinBounds(o,m+a-_,yi.horizontal);o.style.left=`${F}px`}c=_},200).then(y=>{C(()=>{y!=null&&window.clearInterval(y)})})})}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isEventFromCurrentPopup(e,t){const{mouseEvent:i,touchEvent:s}=e,o=i||s;if(!o)return!1;const n=this.popupList.findIndex(r=>r.element===t);if(n===-1)return!1;for(let r=n;r<this.popupList.length;r++){const a=this.popupList[r];if(gn(a.element,o))return!0}return this.isElementWithinCustomPopup(o.target)}isElementWithinCustomPopup(e){const t=this.gridOptionsService.getDocument();for(;e&&e!==t.body;){if(e.classList.contains("ag-custom-component-popup")||e.parentElement===null)return!0;e=e.parentElement}return!1}isEventSameChainAsOriginalEvent(e){const{originalMouseEvent:t,mouseEvent:i,touchEvent:s}=e;let o=null;if(i?o=i:s&&(o=s.touches[0]),o&&t){const n=i?i.screenX:0,r=i?i.screenY:0,a=Math.abs(t.screenX-n)<5,d=Math.abs(t.screenY-r)<5;if(a&&d)return!0}return!1}getWrapper(e){for(;!e.classList.contains("ag-popup")&&e.parentElement;)e=e.parentElement;return e.classList.contains("ag-popup")?e:null}setAlwaysOnTop(e,t){const i=this.getWrapper(e);i&&(i.classList.toggle("ag-always-on-top",!!t),t&&this.bringPopupToFront(i))}bringPopupToFront(e){const t=this.getPopupParent(),i=Array.prototype.slice.call(t.querySelectorAll(".ag-popup")),s=i.length,o=Array.prototype.slice.call(t.querySelectorAll(".ag-popup.ag-always-on-top")),n=o.length,r=this.getWrapper(e);if(!r||s<=1||!t.contains(e))return;const a=i.indexOf(r),d=r.querySelectorAll("div"),c=[];for(d.forEach(g=>{g.scrollTop!==0&&c.push([g,g.scrollTop])}),n?r.classList.contains("ag-always-on-top")?a!==s-1&&Z(o).insertAdjacentElement("afterend",r):a!==s-n-1&&o[0].insertAdjacentElement("beforebegin",r):a!==s-1&&Z(i).insertAdjacentElement("afterend",r);c.length;){const g=c.pop();g[0].scrollTop=g[1]}const h={type:"popupToFront",api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,eWrapper:r};this.eventService.dispatchEvent(h)}};Ri.WAIT_FOR_POPUP_CONTENT_RESIZE=200,Vo([p("focusService")],Ri.prototype,"focusService",void 0),Vo([p("ctrlsService")],Ri.prototype,"ctrlsService",void 0),Vo([p("resizeObserverService")],Ri.prototype,"resizeObserverService",void 0),Vo([D],Ri.prototype,"postConstruct",null),Ri=sa=Vo([M("popupService")],Ri);var oa=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Bo extends sr{constructor(e="default",t="listbox",i){super(Bo.getTemplate(e)),this.cssIdentifier=e,this.ariaRole=t,this.listName=i,this.renderedRows=new Map,this.rowHeight=20}postConstruct(){this.addScrollListener(),this.rowHeight=this.getItemHeight(),this.addResizeObserver(),this.initialiseTabGuard({onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e),focusInnerElement:e=>this.focusInnerElement(e),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)}),this.setAriaProperties(),this.addManagedListener(this.eventService,u.EVENT_GRID_STYLES_CHANGED,this.onGridStylesChanged.bind(this))}onGridStylesChanged(){this.rowHeight=this.getItemHeight(),this.refresh()}setAriaProperties(){const t=this.localeService.getLocaleTextFunc()("ariaDefaultListName",this.listName||"List"),i=this.eContainer;pe(i,this.ariaRole),di(i,t)}addResizeObserver(){const e=()=>this.drawVirtualRows(),t=this.resizeObserverService.observeResize(this.getGui(),e);this.addDestroyFunc(t)}focusInnerElement(e){this.focusRow(e?this.model.getRowCount()-1:0)}onFocusIn(e){const t=e.target;return t.classList.contains("ag-virtual-list-item")&&(this.lastFocusedRowIndex=nd(t)-1),!1}onFocusOut(e){return this.getFocusableElement().contains(e.relatedTarget)||(this.lastFocusedRowIndex=null),!1}handleKeyDown(e){switch(e.key){case w.UP:case w.DOWN:this.navigate(e.key===w.UP)&&e.preventDefault();break}}onTabKeyDown(e){this.navigate(e.shiftKey)?e.preventDefault():(qt(e),this.forceFocusOutOfContainer(e.shiftKey))}navigate(e){if(this.lastFocusedRowIndex==null)return!1;const t=this.lastFocusedRowIndex+(e?-1:1);return t<0||t>=this.model.getRowCount()?!1:(this.focusRow(t),!0)}getLastFocusedRow(){return this.lastFocusedRowIndex}focusRow(e){this.ensureIndexVisible(e),window.setTimeout(()=>{if(!this.isAlive())return;const t=this.renderedRows.get(e);t&&t.eDiv.focus()},10)}getComponentAt(e){const t=this.renderedRows.get(e);return t&&t.rowComponent}forEachRenderedRow(e){this.renderedRows.forEach((t,i)=>e(t.rowComponent,i))}static getTemplate(e){return`
<div class="ag-virtual-list-viewport ag-${e}-virtual-list-viewport" role="presentation">
<div class="ag-virtual-list-container ag-${e}-virtual-list-container" ref="eContainer"></div>
</div>`}getItemHeight(){return this.environment.getListItemHeight()}ensureIndexVisible(e){const t=this.model.getRowCount();if(typeof e!="number"||e<0||e>=t){console.warn("AG Grid: invalid row index for ensureIndexVisible: "+e);return}const i=e*this.rowHeight,s=i+this.rowHeight,o=this.getGui(),n=o.scrollTop,r=o.offsetHeight,a=n+r,d=n>i,c=a<s;if(d)o.scrollTop=i;else if(c){const h=s-r;o.scrollTop=h}}setComponentCreator(e){this.componentCreator=e}setComponentUpdater(e){this.componentUpdater=e}getRowHeight(){return this.rowHeight}getScrollTop(){return this.getGui().scrollTop}setRowHeight(e){this.rowHeight=e,this.refresh()}refresh(e){if(this.model==null||!this.isAlive())return;const t=this.model.getRowCount();this.eContainer.style.height=`${t*this.rowHeight}px`,Fr(()=>this.eContainer.clientHeight>=t*this.rowHeight,()=>{this.isAlive()&&(this.canSoftRefresh(e)?this.drawVirtualRows(!0):(this.clearVirtualRows(),this.drawVirtualRows()))})}canSoftRefresh(e){return!!(e&&this.renderedRows.size&&typeof this.model.areRowsEqual=="function"&&this.componentUpdater)}clearVirtualRows(){this.renderedRows.forEach((e,t)=>this.removeRow(t))}drawVirtualRows(e){if(!this.isAlive())return;const t=this.getGui(),i=t.scrollTop,s=i+t.offsetHeight,o=Math.floor(i/this.rowHeight),n=Math.floor(s/this.rowHeight);this.ensureRowsRendered(o,n,e)}ensureRowsRendered(e,t,i){this.renderedRows.forEach((s,o)=>{(o<e||o>t)&&o!==this.lastFocusedRowIndex&&this.removeRow(o)}),i&&this.refreshRows();for(let s=e;s<=t;s++)this.renderedRows.has(s)||s<this.model.getRowCount()&&this.insertRow(s)}insertRow(e){const t=this.model.getRow(e),i=document.createElement("div");if(i.classList.add("ag-virtual-list-item",`ag-${this.cssIdentifier}-virtual-list-item`),pe(i,this.ariaRole==="tree"?"treeitem":"option"),jr(i,this.model.getRowCount()),zr(i,e+1),i.setAttribute("tabindex","-1"),typeof this.model.isRowSelected=="function"){const o=this.model.isRowSelected(e);ls(i,!!o),md(i,o)}i.style.height=`${this.rowHeight}px`,i.style.top=`${this.rowHeight*e}px`;const s=this.componentCreator(t,i);s.addGuiEventListener("focusin",()=>this.lastFocusedRowIndex=e),i.appendChild(s.getGui()),this.renderedRows.has(e-1)?this.renderedRows.get(e-1).eDiv.insertAdjacentElement("afterend",i):this.renderedRows.has(e+1)?this.renderedRows.get(e+1).eDiv.insertAdjacentElement("beforebegin",i):this.eContainer.appendChild(i),this.renderedRows.set(e,{rowComponent:s,eDiv:i,value:t})}removeRow(e){const t=this.renderedRows.get(e);this.eContainer.removeChild(t.eDiv),this.destroyBean(t.rowComponent),this.renderedRows.delete(e)}refreshRows(){const e=this.model.getRowCount();this.renderedRows.forEach((t,i)=>{var s,o;if(i>=e)this.removeRow(i);else{const n=this.model.getRow(i);!((o=(s=this.model).areRowsEqual)===null||o===void 0)&&o.call(s,t.value,n)?this.componentUpdater(n,t.rowComponent):this.removeRow(i)}})}addScrollListener(){this.addGuiEventListener("scroll",()=>this.drawVirtualRows(),{passive:!0})}setModel(e){this.model=e}destroy(){this.isAlive()&&(this.clearVirtualRows(),super.destroy())}}oa([p("resizeObserverService")],Bo.prototype,"resizeObserverService",void 0),oa([O("eContainer")],Bo.prototype,"eContainer",void 0),oa([D],Bo.prototype,"postConstruct",null);const Sg=["mouseover","mouseout","mouseenter","mouseleave","mousemove"],Eg=["touchstart","touchend","touchmove","touchcancel"];class yg{constructor(){this.renderingEngine="vanilla",this.isOutsideAngular=e=>Ze(Sg,e)}setTimeout(e,t){window.setTimeout(e,t)}setInterval(e,t){return new De(i=>{i(window.setInterval(e,t))})}addEventListener(e,t,i,s){const o=Ze(Eg,t);e.addEventListener(t,i,{capture:!!s,passive:o})}dispatchEvent(e,t,i=!1){t()}frameworkComponent(e){return null}isFrameworkComponent(e){return!1}}var Fs=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let bi=class extends T{getNextCellToFocus(e,t,i=!1){return i?this.getNextCellToFocusWithCtrlPressed(e,t):this.getNextCellToFocusWithoutCtrlPressed(e,t)}getNextCellToFocusWithCtrlPressed(e,t){const i=e===w.UP,s=e===w.DOWN,o=e===w.LEFT;let n,r;if(i||s)r=i?this.paginationProxy.getPageFirstRow():this.paginationProxy.getPageLastRow(),n=t.column;else{const a=this.columnModel.getAllDisplayedColumns(),d=this.gridOptionsService.is("enableRtl");r=t.rowIndex,n=o!==d?a[0]:Z(a)}return{rowIndex:r,rowPinned:null,column:n}}getNextCellToFocusWithoutCtrlPressed(e,t){let i=t,s=!1;for(;!s;){switch(e){case w.UP:i=this.getCellAbove(i);break;case w.DOWN:i=this.getCellBelow(i);break;case w.RIGHT:this.gridOptionsService.is("enableRtl")?i=this.getCellToLeft(i):i=this.getCellToRight(i);break;case w.LEFT:this.gridOptionsService.is("enableRtl")?i=this.getCellToRight(i):i=this.getCellToLeft(i);break;default:i=null,console.warn("AG Grid: 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.columnModel.getDisplayedColBefore(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getCellToRight(e){if(!e)return null;const t=this.columnModel.getDisplayedColAfter(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getRowBelow(e){const t=e.rowIndex,i=e.rowPinned;if(this.isLastRowInContainer(e))switch(i){case"bottom":return null;case"top":return this.rowModel.isRowsToRender()?{rowIndex:this.paginationProxy.getPageFirstRow(),rowPinned:null}:this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null;default:return this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null}const s=this.rowModel.getRow(e.rowIndex),o=this.getNextStickyPosition(s);return o||{rowIndex:t+1,rowPinned:i}}getNextStickyPosition(e,t){if(!this.gridOptionsService.isGroupRowsSticky()||!e||!e.sticky)return;const i=[...this.rowRenderer.getStickyTopRowCtrls()].sort((r,a)=>r.getRowNode().rowIndex-a.getRowNode().rowIndex),s=t?-1:1,o=i.findIndex(r=>r.getRowNode().rowIndex===e.rowIndex),n=i[o+s];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.getPinnedTopRowData().length-1<=i:t==="bottom"?this.pinnedRowModel.getPinnedBottomRowData().length-1<=i:this.paginationProxy.getPageLastRow()<=i}getRowAbove(e){const t=e.rowIndex,i=e.rowPinned;if(i?t===0:t===this.paginationProxy.getPageFirstRow())return i==="top"?null:i?this.rowModel.isRowsToRender()?this.getLastBodyCell():this.pinnedRowModel.isRowsToRender("top")?this.getLastFloatingTopRow():null:this.pinnedRowModel.isRowsToRender("top")?this.getLastFloatingTopRow():null;const o=this.rowModel.getRow(e.rowIndex),n=this.getNextStickyPosition(o,!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.paginationProxy.getPageLastRow(),rowPinned:null}}getLastFloatingTopRow(){return{rowIndex:this.pinnedRowModel.getPinnedTopRowData().length-1,rowPinned:"top"}}getNextTabbedCell(e,t){return t?this.getNextTabbedCellBackwards(e):this.getNextTabbedCellForwards(e)}getNextTabbedCellForwards(e){const t=this.columnModel.getAllDisplayedColumns();let i=e.rowIndex,s=e.rowPinned,o=this.columnModel.getDisplayedColAfter(e.column);if(!o){o=t[0];const n=this.getRowBelow(e);if(x(n)||!n.rowPinned&&!this.paginationProxy.isRowInPage(n))return null;i=n?n.rowIndex:null,s=n?n.rowPinned:null}return{rowIndex:i,column:o,rowPinned:s}}getNextTabbedCellBackwards(e){const t=this.columnModel.getAllDisplayedColumns();let i=e.rowIndex,s=e.rowPinned,o=this.columnModel.getDisplayedColBefore(e.column);if(!o){o=Z(t);const n=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});if(x(n)||!n.rowPinned&&!this.paginationProxy.isRowInPage(n))return null;i=n?n.rowIndex:null,s=n?n.rowPinned:null}return{rowIndex:i,column:o,rowPinned:s}}};Fs([p("columnModel")],bi.prototype,"columnModel",void 0),Fs([p("rowModel")],bi.prototype,"rowModel",void 0),Fs([p("rowRenderer")],bi.prototype,"rowRenderer",void 0),Fs([p("pinnedRowModel")],bi.prototype,"pinnedRowModel",void 0),Fs([p("paginationProxy")],bi.prototype,"paginationProxy",void 0),bi=Fs([M("cellNavigationService")],bi);var Wo=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Rg=function(l,e){return function(t,i){e(t,i,l)}};let Qi=class extends T{constructor(){super(...arguments),this.consuming=!1}setBeans(e){this.logger=e.create("AlignedGridsService")}init(){this.addManagedListener(this.eventService,u.EVENT_COLUMN_MOVED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,u.EVENT_COLUMN_VISIBLE,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,u.EVENT_COLUMN_PINNED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,u.EVENT_COLUMN_GROUP_OPENED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,u.EVENT_COLUMN_RESIZED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,u.EVENT_BODY_SCROLL,this.fireScrollEvent.bind(this))}fireEvent(e){if(this.consuming)return;const t=this.gridOptionsService.get("alignedGrids");t&&t.forEach(i=>{if(i.api){const s=i.api.__getAlignedGridService();e(s)}})}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){this.fireEvent(t=>{t.onColumnEvent(e)})}fireScrollEvent(e){e.direction==="horizontal"&&this.fireEvent(t=>{t.onScrollEvent(e)})}onScrollEvent(e){this.onEvent(()=>{this.ctrlsService.getGridBodyCtrl().getScrollFeature().setHorizontalScrollPosition(e.left,!0)})}getMasterColumns(e){const t=[];return e.columns?e.columns.forEach(i=>{t.push(i)}):e.column&&t.push(e.column),t}getColumnIds(e){const t=[];return e.columns?e.columns.forEach(i=>{t.push(i.getColId())}):e.column&&t.push(e.column.getColId()),t}onColumnEvent(e){this.onEvent(()=>{switch(e.type){case u.EVENT_COLUMN_MOVED:case u.EVENT_COLUMN_VISIBLE:case u.EVENT_COLUMN_PINNED:case u.EVENT_COLUMN_RESIZED:const t=e;this.processColumnEvent(t);break;case u.EVENT_COLUMN_GROUP_OPENED:const i=e;this.processGroupOpenedEvent(i);break;case u.EVENT_COLUMN_PIVOT_CHANGED:console.warn("AG Grid: pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid.");break}})}processGroupOpenedEvent(e){const t=e.columnGroup;let i=null;if(t){const s=t.getGroupId();i=this.columnModel.getProvidedColumnGroup(s)}t&&!i||(this.logger.log("onColumnEvent-> processing "+e+" expanded = "+t.isExpanded()),this.columnModel.setColumnGroupOpened(i,t.isExpanded(),"alignedGridChanged"))}processColumnEvent(e){var t;const i=e.column;let s=null;if(i&&(s=this.columnModel.getPrimaryColumn(i.getColId())),i&&!s)return;const o=this.getMasterColumns(e);switch(e.type){case u.EVENT_COLUMN_MOVED:{const h=e,f=e.columnApi.getColumnState().map(m=>({colId:m.colId}));this.columnModel.applyColumnState({state:f,applyOrder:!0},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${e.type} toIndex = ${h.toIndex}`)}break;case u.EVENT_COLUMN_VISIBLE:{const h=e,f=e.columnApi.getColumnState().map(m=>({colId:m.colId,hide:m.hide}));this.columnModel.applyColumnState({state:f},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${e.type} visible = ${h.visible}`)}break;case u.EVENT_COLUMN_PINNED:{const h=e,f=e.columnApi.getColumnState().map(m=>({colId:m.colId,pinned:m.pinned}));this.columnModel.applyColumnState({state:f},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${e.type} pinned = ${h.pinned}`)}break;case u.EVENT_COLUMN_RESIZED:const d=e,c={};o.forEach(h=>{this.logger.log(`onColumnEvent-> processing ${e.type} actualWidth = ${h.getActualWidth()}`),c[h.getId()]={key:h.getColId(),newWidth:h.getActualWidth()}}),(t=d.flexColumns)===null||t===void 0||t.forEach(h=>{c[h.getId()]&&delete c[h.getId()]}),this.columnModel.setColumnWidths(Object.values(c),!1,d.finished,"alignedGridChanged");break}const r=this.ctrlsService.getGridBodyCtrl().isVerticalScrollShowing(),a=this.gridOptionsService.get("alignedGrids");a&&a.forEach(d=>{d.api&&d.api.setAlwaysShowVerticalScroll(r)})}};Wo([p("columnModel")],Qi.prototype,"columnModel",void 0),Wo([p("ctrlsService")],Qi.prototype,"ctrlsService",void 0),Wo([Rg(0,Te("loggerFactory"))],Qi.prototype,"setBeans",null),Wo([D],Qi.prototype,"init",null),Qi=Wo([M("alignedGridsService")],Qi);var ko=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},bg=function(l,e){return function(t,i){e(t,i,l)}};let Xi=class extends T{setBeans(e){this.logger=e.create("selectionService"),this.reset()}init(){this.groupSelectsChildren=this.gridOptionsService.is("groupSelectsChildren"),this.addManagedPropertyListener("groupSelectsChildren",e=>this.groupSelectsChildren=e.currentValue),this.rowSelection=this.gridOptionsService.get("rowSelection"),this.addManagedPropertyListener("rowSelection",e=>this.rowSelection=e.currentValue),this.addManagedListener(this.eventService,u.EVENT_ROW_SELECTED,this.onRowSelected.bind(this))}isMultiselect(){return this.rowSelection==="multiple"}setNodesSelected(e){var t;if(e.nodes.length===0)return 0;const{newValue:i,clearSelection:s,suppressFinishActions:o,rangeSelect:n,event:r,source:a="api"}=e;if(e.nodes.length>1&&!this.isMultiselect())return console.warn("AG Grid: cannot multi select while rowSelection='single'"),0;const d=this.groupSelectsChildren&&e.groupSelectsFiltered===!0,c=e.nodes.map(g=>g.footer?g.sibling:g);if(n){if(e.nodes.length>1)return console.warn("AG Grid: cannot range select while selecting multiple rows"),0;const g=this.getLastSelectedNode();if(g){const f=c[0];if(g!==f&&this.isMultiselect()){const C=this.selectRange(f,g,e.newValue,a);return this.setLastSelectedNode(f),C}}}let h=0;for(let g=0;g<c.length;g++){const f=c[g];d&&f.group||f.selectThisNode(i,e.event,a)&&h++,this.groupSelectsChildren&&(!((t=f.childrenAfterGroup)===null||t===void 0)&&t.length)&&(h+=this.selectChildren(f,i,d,a))}if(!o){if(i&&(s||!this.isMultiselect())&&(h+=this.clearOtherNodes(c[0],a)),h>0){this.updateGroupsFromChildrenSelections(a);const f={type:u.EVENT_SELECTION_CHANGED,source:a};this.eventService.dispatchEvent(f)}i&&this.setLastSelectedNode(c[c.length-1])}return h}selectRange(e,t,i=!0,s){const o=this.rowModel.getNodesInRangeForSelection(e,t);let n=0;o.forEach(a=>{if(a.group&&this.groupSelectsChildren||i===!1&&e===a)return;a.selectThisNode(i,void 0,s)&&n++}),this.updateGroupsFromChildrenSelections(s);const r={type:u.EVENT_SELECTION_CHANGED,source:s};return this.eventService.dispatchEvent(r),n}selectChildren(e,t,i,s){const o=i?e.childrenAfterAggFilter:e.childrenAfterGroup;return G.missing(o)?0:this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,groupSelectsFiltered:i,source:s,nodes:o})}setLastSelectedNode(e){this.lastSelectedNode=e}getLastSelectedNode(){return this.lastSelectedNode}getSelectedNodes(){const e=[];return se(this.selectedNodes,(t,i)=>{i&&e.push(i)}),e}getSelectedRows(){const e=[];return se(this.selectedNodes,(t,i)=>{i&&i.data&&e.push(i.data)}),e}getSelectionCount(){return Object.values(this.selectedNodes).length}filterFromSelection(e){const t={};Object.entries(this.selectedNodes).forEach(([i,s])=>{s&&e(s)&&(t[i]=s)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsChildren||this.rowModel.getType()!=="clientSide")return!1;const s=this.rowModel.getRootNode();t||(t=new ta(!0,s),t.setInactive());let o=!1;return t.forEachChangedNodeDepthFirst(n=>{if(n!==s){const r=n.calculateSelectedFromChildren();o=n.selectThisNode(r===null?!1:r,void 0,e)||o}}),o}clearOtherNodes(e,t){const i={};let s=0;return se(this.selectedNodes,(o,n)=>{if(n&&n.id!==e.id){const r=this.selectedNodes[n.id];s+=r.setSelectedParams({newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:t}),this.groupSelectsChildren&&n.parent&&(i[n.parent.id]=n.parent)}}),se(i,(o,n)=>{const r=n.calculateSelectedFromChildren();n.selectThisNode(r===null?!1:r,void 0,t)}),s}onRowSelected(e){const t=e.node;this.groupSelectsChildren&&t.group||(t.isSelected()?this.selectedNodes[t.id]=t:delete this.selectedNodes[t.id])}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}syncInOldRowNode(e,t){if(R(t)&&e.id!==t.id&&t){const s=t.id;this.selectedNodes[s]==e&&(this.selectedNodes[t.id]=t)}}syncInNewRowNode(e){R(this.selectedNodes[e.id])?(e.setSelectedInitialValue(!0),this.selectedNodes[e.id]=e):e.setSelectedInitialValue(!1)}reset(){this.logger.log("reset"),this.selectedNodes={},this.lastSelectedNode=null}getBestCostNodeSelection(){if(this.rowModel.getType()!=="clientSide")return;const t=this.rowModel.getTopLevelNodes();if(t===null)return;const i=[];function s(o){for(let n=0,r=o.length;n<r;n++){const a=o[n];if(a.isSelected())i.push(a);else{const d=a;d.group&&d.children&&s(d.children)}}}return s(t),i}isEmpty(){let e=0;return se(this.selectedNodes,(t,i)=>{i&&e++}),e===0}deselectAllRowNodes(e){const t=a=>a.selectThisNode(!1,void 0,s),i=this.rowModel.getType()==="clientSide",{source:s,justFiltered:o,justCurrentPage:n}=e;if(n||o){if(!i){console.error("AG Grid: selecting just filtered only works when gridOptions.rowModelType='clientSide'");return}this.getNodesToSelect(o,n).forEach(t)}else se(this.selectedNodes,(a,d)=>{d&&t(d)}),this.reset();i&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(s);const r={type:u.EVENT_SELECTION_CHANGED,source:s};this.eventService.dispatchEvent(r)}getSelectAllState(e,t){let i=0,s=0;const o=n=>{this.groupSelectsChildren&&n.group||(n.isSelected()?i++:n.selectable&&s++)};return this.getNodesToSelect(e,t).forEach(o),i===0&&s===0?!1:i>0&&s>0?null:i>0}getNodesToSelect(e=!1,t=!1){if(this.rowModel.getType()!=="clientSide")throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`);const i=[];if(t)return this.paginationProxy.forEachNodeOnPage(o=>{if(!o.group){i.push(o);return}if(!o.expanded){const n=r=>{var a;i.push(r),!((a=r.childrenAfterFilter)===null||a===void 0)&&a.length&&r.childrenAfterFilter.forEach(n)};n(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)}selectAllRowNodes(e){if(this.rowModel.getType()!=="clientSide")throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`);const{source:t,justFiltered:i,justCurrentPage:s}=e,o=r=>r.selectThisNode(!0,void 0,t);this.getNodesToSelect(i,s).forEach(o),this.rowModel.getType()==="clientSide"&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(t);const n={type:u.EVENT_SELECTION_CHANGED,source:t};this.eventService.dispatchEvent(n)}getServerSideSelectionState(){return null}setServerSideSelectionState(e){}};ko([p("rowModel")],Xi.prototype,"rowModel",void 0),ko([p("paginationProxy")],Xi.prototype,"paginationProxy",void 0),ko([bg(0,Te("loggerFactory"))],Xi.prototype,"setBeans",null),ko([D],Xi.prototype,"init",null),Xi=ko([M("selectionService")],Xi);var na=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let Uo=class{sizeColumnsToFit(e){typeof e>"u"&&console.error("AG Grid: missing parameter to columnApi.sizeColumnsToFit(gridWidth)"),this.columnModel.sizeColumnsToFit(e,"api")}setColumnGroupOpened(e,t){this.columnModel.setColumnGroupOpened(e,t,"api")}getColumnGroup(e,t){return this.columnModel.getColumnGroup(e,t)}getProvidedColumnGroup(e){return this.columnModel.getProvidedColumnGroup(e)}getDisplayNameForColumn(e,t){return this.columnModel.getDisplayNameForColumn(e,t)||""}getDisplayNameForColumnGroup(e,t){return this.columnModel.getDisplayNameForColumnGroup(e,t)||""}getColumn(e){return this.columnModel.getPrimaryColumn(e)}getColumns(){return this.columnModel.getAllPrimaryColumns()}applyColumnState(e){return this.columnModel.applyColumnState(e,"api")}getColumnState(){return this.columnModel.getColumnState()}resetColumnState(){this.columnModel.resetColumnState("api")}getColumnGroupState(){return this.columnModel.getColumnGroupState()}setColumnGroupState(e){this.columnModel.setColumnGroupState(e,"api")}resetColumnGroupState(){this.columnModel.resetColumnGroupState("api")}isPinning(){return this.columnModel.isPinningLeft()||this.columnModel.isPinningRight()}isPinningLeft(){return this.columnModel.isPinningLeft()}isPinningRight(){return this.columnModel.isPinningRight()}getDisplayedColAfter(e){return this.columnModel.getDisplayedColAfter(e)}getDisplayedColBefore(e){return this.columnModel.getDisplayedColBefore(e)}setColumnVisible(e,t){this.columnModel.setColumnVisible(e,t,"api")}setColumnsVisible(e,t){this.columnModel.setColumnsVisible(e,t,"api")}setColumnPinned(e,t){this.columnModel.setColumnPinned(e,t,"api")}setColumnsPinned(e,t){this.columnModel.setColumnsPinned(e,t,"api")}getAllGridColumns(){return this.columnModel.getAllGridColumns()}getDisplayedLeftColumns(){return this.columnModel.getDisplayedLeftColumns()}getDisplayedCenterColumns(){return this.columnModel.getDisplayedCenterColumns()}getDisplayedRightColumns(){return this.columnModel.getDisplayedRightColumns()}getAllDisplayedColumns(){return this.columnModel.getAllDisplayedColumns()}getAllDisplayedVirtualColumns(){return this.columnModel.getViewportColumns()}moveColumn(e,t){this.columnModel.moveColumn(e,t,"api")}moveColumnByIndex(e,t){this.columnModel.moveColumnByIndex(e,t,"api")}moveColumns(e,t){this.columnModel.moveColumns(e,t,"api")}moveRowGroupColumn(e,t){this.columnModel.moveRowGroupColumn(e,t)}setColumnAggFunc(e,t){this.columnModel.setColumnAggFunc(e,t)}setColumnWidth(e,t,i=!0,s){this.columnModel.setColumnWidths([{key:e,newWidth:t}],!1,i,s)}setColumnWidths(e,t=!0,i){this.columnModel.setColumnWidths(e,!1,t,i)}setPivotMode(e){this.columnModel.setPivotMode(e)}isPivotMode(){return this.columnModel.isPivotMode()}getPivotResultColumn(e,t){return this.columnModel.getSecondaryPivotColumn(e,t)}setValueColumns(e){this.columnModel.setValueColumns(e,"api")}getValueColumns(){return this.columnModel.getValueColumns()}removeValueColumn(e){this.columnModel.removeValueColumn(e,"api")}removeValueColumns(e){this.columnModel.removeValueColumns(e,"api")}addValueColumn(e){this.columnModel.addValueColumn(e,"api")}addValueColumns(e){this.columnModel.addValueColumns(e,"api")}setRowGroupColumns(e){this.columnModel.setRowGroupColumns(e,"api")}removeRowGroupColumn(e){this.columnModel.removeRowGroupColumn(e,"api")}removeRowGroupColumns(e){this.columnModel.removeRowGroupColumns(e,"api")}addRowGroupColumn(e){this.columnModel.addRowGroupColumn(e,"api")}addRowGroupColumns(e){this.columnModel.addRowGroupColumns(e,"api")}getRowGroupColumns(){return this.columnModel.getRowGroupColumns()}setPivotColumns(e){this.columnModel.setPivotColumns(e,"api")}removePivotColumn(e){this.columnModel.removePivotColumn(e,"api")}removePivotColumns(e){this.columnModel.removePivotColumns(e,"api")}addPivotColumn(e){this.columnModel.addPivotColumn(e,"api")}addPivotColumns(e){this.columnModel.addPivotColumns(e,"api")}getPivotColumns(){return this.columnModel.getPivotColumns()}getLeftDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeLeft()}getCenterDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeCentre()}getRightDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeRight()}getAllDisplayedColumnGroups(){return this.columnModel.getAllDisplayedTrees()}autoSizeColumn(e,t){return this.columnModel.autoSizeColumn(e,t,"api")}autoSizeColumns(e,t){this.columnModel.autoSizeColumns({columns:e,skipHeader:t})}autoSizeAllColumns(e){this.columnModel.autoSizeAllColumns(e,"api")}setPivotResultColumns(e){this.columnModel.setSecondaryColumns(e,"api")}getPivotResultColumns(){return this.columnModel.getSecondaryColumns()}cleanDownReferencesToAvoidMemoryLeakInCaseApplicationIsKeepingReferenceToDestroyedGrid(){setTimeout(G.removeAllReferences.bind(window,this,"Column API"),100)}getAllColumns(){return et("28.0","getAllColumns","getColumns"),this.getColumns()}getPrimaryColumns(){return et("28.0","getPrimaryColumns","getColumns"),this.getColumns()}getSecondaryColumns(){return et("28.0","getSecondaryColumns","getPivotResultColumns"),this.getPivotResultColumns()}setSecondaryColumns(e){et("28.0","setSecondaryColumns","setPivotResultColumns"),this.setPivotResultColumns(e)}getSecondaryPivotColumn(e,t){return et("28.0","getSecondaryPivotColumn","getPivotResultColumn"),this.getPivotResultColumn(e,t)}};na([p("columnModel")],Uo.prototype,"columnModel",void 0),na([he],Uo.prototype,"cleanDownReferencesToAvoidMemoryLeakInCaseApplicationIsKeepingReferenceToDestroyedGrid",null),Uo=na([M("columnApi")],Uo);var Ls=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let Ti=class extends T{constructor(){super(...arguments),this.initialised=!1,this.isSsrm=!1}init(){this.isSsrm=this.gridOptionsService.isRowModelType("serverSide"),this.cellExpressions=this.gridOptionsService.is("enableCellExpressions"),this.isTreeData=this.gridOptionsService.is("treeData"),this.initialised=!0,this.eventService.addEventListener(u.EVENT_CELL_VALUE_CHANGED,e=>this.callColumnCellValueChangedHandler(e),this.gridOptionsService.useAsyncEvents()),this.addManagedPropertyListener("treeData",e=>this.isTreeData=e.currentValue)}getValue(e,t,i=!1,s=!1){if(this.initialised||this.init(),!t)return;const o=e.getColDef(),n=o.field,r=e.getColId(),a=t.data;let d;const c=t.groupData&&t.groupData[r]!==void 0,h=!s&&t.aggData&&t.aggData[r]!==void 0,g=this.isSsrm&&s&&!!e.getColDef().aggFunc,f=this.isSsrm&&t.footer&&t.field&&(e.getColDef().showRowGroup===!0||e.getColDef().showRowGroup===t.field);if(i&&o.filterValueGetter?d=this.executeFilterValueGetter(o.filterValueGetter,a,e,t):this.isTreeData&&h?d=t.aggData[r]:this.isTreeData&&o.valueGetter?d=this.executeValueGetter(o.valueGetter,a,e,t):this.isTreeData&&n&&a?d=ss(a,n,e.isFieldContainsDots()):c?d=t.groupData[r]:h?d=t.aggData[r]:o.valueGetter?d=this.executeValueGetter(o.valueGetter,a,e,t):f?d=ss(a,t.field,e.isFieldContainsDots()):n&&a&&!g&&(d=ss(a,n,e.isFieldContainsDots())),this.cellExpressions&&typeof d=="string"&&d.indexOf("=")===0){const m=d.substring(1);d=this.executeValueGetter(m,a,e,t)}if(d==null){const m=this.getOpenedGroup(t,e);if(m!=null)return m}return d}getOpenedGroup(e,t){if(!this.gridOptionsService.is("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.getPrimaryColumn(t);if(!e||!o)return!1;x(e.data)&&(e.data={});const{field:n,valueSetter:r}=o.getColDef();if(x(n)&&x(r))return console.warn("AG Grid: you need either field or valueSetter set on colDef for editing to work"),!1;if(!this.dataTypeService.checkType(o,i))return console.warn("AG Grid: Data type of the new value does not match the cell data type of the column"),!1;const a={node:e,data:e.data,oldValue:this.getValue(o,e),newValue:i,colDef:o.getColDef(),column:o,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context};a.newValue=i;let d;if(R(r)?typeof r=="function"?d=r(a):d=this.expressionService.evaluate(r,a):d=this.setValueUsingField(e.data,n,i,o.isFieldContainsDots()),d===void 0&&(d=!0),!d)return!1;e.resetQuickFilterAggregateText(),this.valueCache.onDataChanged(),a.newValue=this.getValue(o,e);const c={type:u.EVENT_CELL_VALUE_CHANGED,event:null,rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:a.column,api:a.api,columnApi:a.columnApi,colDef:a.colDef,context:a.context,data:e.data,node:e,oldValue:a.oldValue,newValue:a.newValue,value:a.newValue,source:s};return this.eventService.dispatchEvent(c),!0}callColumnCellValueChangedHandler(e){const t=e.colDef.onCellValueChanged;typeof t=="function"&&t({node:e.node,data:e.data,oldValue:e.oldValue,newValue:e.newValue,colDef:e.colDef,column:e.column,api:e.api,columnApi:e.columnApi,context:e.context})}setValueUsingField(e,t,i,s){if(!t)return!1;let o=!1;if(!s)o=e[t]==i,o||(e[t]=i);else{const n=t.split(".");let r=e;for(;n.length>0&&r;){const a=n.shift();n.length===0?(o=r[a]==i,o||(r[a]=i)):r=r[a]}}return!o}executeFilterValueGetter(e,t,i,s){const o={data:t,node:s,column:i,colDef:i.getColDef(),api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context,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(),n=this.valueCache.getValue(s,o);if(n!==void 0)return n;const r={data:t,node:s,column:i,colDef:i.getColDef(),api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context,getValue:this.getValueCallback.bind(this,s)};let a;return typeof e=="function"?a=e(r):a=this.expressionService.evaluate(e,r),this.valueCache.setValue(s,o,a),a}getValueCallback(e,t){const i=this.columnModel.getPrimaryColumn(t);return i?this.getValue(i,e):null}getKeyForNode(e,t){const i=this.getValue(e,t),s=e.getColDef().keyCreator;let o=i;if(s){const n={value:i,colDef:e.getColDef(),column:e,node:t,data:t.data,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context};o=s(n)}return typeof o=="string"||o==null||(o=String(o),o==="[object Object]"&&Y(()=>{console.warn("AG Grid: 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")},"getKeyForNode - warn about [object,object]")),o}};Ls([p("expressionService")],Ti.prototype,"expressionService",void 0),Ls([p("columnModel")],Ti.prototype,"columnModel",void 0),Ls([p("valueCache")],Ti.prototype,"valueCache",void 0),Ls([p("dataTypeService")],Ti.prototype,"dataTypeService",void 0),Ls([D],Ti.prototype,"init",null),Ti=Ls([M("valueService")],Ti);var Fc=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Tg=function(l,e){return function(t,i){e(t,i,l)}};let or=class extends T{constructor(){super(...arguments),this.expressionToFunctionCache={}}setBeans(e){this.logger=e.create("ExpressionService")}evaluate(e,t){if(typeof e=="string")return this.evaluateExpression(e,t);console.error("AG Grid: value should be either a string or a function",e)}evaluateExpression(e,t){try{return this.createExpressionFunction(e)(t.value,t.context,t.oldValue,t.newValue,t.value,t.node,t.data,t.colDef,t.rowIndex,t.api,t.columnApi,t.getValue,t.column,t.columnGroup)}catch(i){return console.log("Processing of the expression failed"),console.log("Expression = "+e),console.log("Params =",t),console.log("Exception = "+i),null}}createExpressionFunction(e){if(this.expressionToFunctionCache[e])return this.expressionToFunctionCache[e];const t=this.createFunctionBody(e),i=new Function("x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, columnApi, getValue, column, columnGroup",t);return this.expressionToFunctionCache[e]=i,i}createFunctionBody(e){return e.indexOf("return")>=0?e:"return "+e+";"}};Fc([Tg(0,Te("loggerFactory"))],or.prototype,"setBeans",null),or=Fc([M("expressionService")],or);var Dg=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let ra=class extends T{constructor(){super(...arguments),this.templateCache={},this.waitingCallbacks={}}getTemplate(e,t){const i=this.templateCache[e];if(i)return i;let s=this.waitingCallbacks[e];const o=this;if(!s){s=[],this.waitingCallbacks[e]=s;const n=new XMLHttpRequest;n.onload=function(){o.handleHttpResult(this,e)},n.open("GET",e),n.send()}return t&&s.push(t),null}handleHttpResult(e,t){if(e.status!==200||e.response===null){console.warn(`AG Grid: Unable to get template error ${e.status} - ${t}`);return}this.templateCache[t]=e.response||e.responseText;const i=this.waitingCallbacks[t];for(let s=0;s<i.length;s++){const o=i[s];o()}}};ra=Dg([M("templateService")],ra);var Lc=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Og=function(l,e){return function(t,i){e(t,i,l)}};let nr=class extends T{setBeans(e){this.logging=e.is("debug")}create(e){return new la(e,this.isLogging.bind(this))}isLogging(){return this.logging}};Lc([Og(0,Te("gridOptionsService"))],nr.prototype,"setBeans",null),nr=Lc([M("loggerFactory")],nr);class la{constructor(e,t){this.name=e,this.isLoggingFunc=t}isLogging(){return this.isLoggingFunc()}log(e){this.isLoggingFunc()&&console.log("AG Grid."+this.name+": "+e)}}var Is=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Ji extends T{setComp(e,t,i){this.view=e,this.eGridHostDiv=t,this.eGui=i,this.eGui.setAttribute("grid-id",this.context.getGridId()),this.dragAndDropService.addDropTarget({getContainer:()=>this.eGui,isInterestedIn:o=>o===Oe.HeaderCell||o===Oe.ToolPanel,getIconName:()=>q.ICON_NOT_ALLOWED}),this.mouseEventService.stampTopLevelGridCompWithGridInstance(t),this.createManagedBean(new xn(this.view)),this.addRtlSupport(),this.addManagedListener(this,u.EVENT_KEYBOARD_FOCUS,()=>{this.view.addOrRemoveKeyboardFocusClass(!0)}),this.addManagedListener(this,u.EVENT_MOUSE_FOCUS,()=>{this.view.addOrRemoveKeyboardFocusClass(!1)});const s=this.resizeObserverService.observeResize(this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc(()=>s()),this.ctrlsService.registerGridCtrl(this)}isDetailGrid(){var e;const t=this.focusService.findTabbableParent(this.getGui());return((e=t==null?void 0:t.getAttribute("row-id"))===null||e===void 0?void 0:e.startsWith("detail"))||!1}showDropZones(){return A.__isRegistered(N.RowGroupingModule,this.context.getGridId())}showSideBar(){return A.__isRegistered(N.SideBarModule,this.context.getGridId())}showStatusBar(){return A.__isRegistered(N.StatusBarModule,this.context.getGridId())}showWatermark(){return A.__isRegistered(N.EnterpriseCoreModule,this.context.getGridId())}onGridSizeChanged(){const e={type:u.EVENT_GRID_SIZE_CHANGED,clientWidth:this.eGridHostDiv.clientWidth,clientHeight:this.eGridHostDiv.clientHeight};this.eventService.dispatchEvent(e)}addRtlSupport(){const e=this.gridOptionsService.is("enableRtl")?"ag-rtl":"ag-ltr";this.view.setRtlClass(e)}destroyGridUi(){this.view.destroyGridUi()}getGui(){return this.eGui}setResizeCursor(e){this.view.setCursor(e?"ew-resize":null)}disableUserSelect(e){this.view.setUserSelect(e?"none":null)}focusNextInnerContainer(e){const t=this.gridOptionsService.getDocument(),i=this.view.getFocusableContainers(),o=i.findIndex(n=>n.contains(t.activeElement))+(e?-1:1);return o<=0||o>=i.length?!1:this.focusService.focusInto(i[o])}focusInnerElement(e){const t=this.view.getFocusableContainers(),i=this.columnModel.getAllDisplayedColumns();if(e){if(t.length>1)return this.focusService.focusInto(Z(t),!0);const s=Z(i);if(this.focusService.focusGridView(s,!0))return!0}return this.gridOptionsService.getNum("headerHeight")===0?this.focusService.focusGridView(i[0]):this.focusService.focusFirstHeader()}forceFocusOutOfContainer(e=!1){this.view.forceFocusOutOfContainer(e)}}Is([p("focusService")],Ji.prototype,"focusService",void 0),Is([p("resizeObserverService")],Ji.prototype,"resizeObserverService",void 0),Is([p("columnModel")],Ji.prototype,"columnModel",void 0),Is([p("ctrlsService")],Ji.prototype,"ctrlsService",void 0),Is([p("mouseEventService")],Ji.prototype,"mouseEventService",void 0),Is([p("dragAndDropService")],Ji.prototype,"dragAndDropService",void 0);var jo=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Ms extends sr{constructor(e){super(),this.eGridDiv=e}postConstruct(){this.logger=this.loggerFactory.create("GridComp");const e={destroyGridUi:()=>this.destroyBean(this),setRtlClass:i=>this.addCssClass(i),addOrRemoveKeyboardFocusClass:i=>this.addOrRemoveCssClass(ae.AG_KEYBOARD_FOCUS,i),forceFocusOutOfContainer:this.forceFocusOutOfContainer.bind(this),updateLayoutClasses:this.updateLayoutClasses.bind(this),getFocusableContainers:this.getFocusableContainers.bind(this),setUserSelect:i=>{this.getGui().style.userSelect=i??"",this.getGui().style.webkitUserSelect=i??""},setCursor:i=>{this.getGui().style.cursor=i??""}};this.ctrl=this.createManagedBean(new Ji);const t=this.createTemplate();this.setTemplate(t),this.ctrl.setComp(e,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:i=>this.ctrl.focusInnerElement(i)})}insertGridIntoDom(){const e=this.getGui();this.eGridDiv.appendChild(e),this.addDestroyFunc(()=>{this.eGridDiv.removeChild(e),this.logger.log("Grid removed from DOM")})}updateLayoutClasses(e,t){const i=this.eRootWrapperBody.classList;i.toggle(de.AUTO_HEIGHT,t.autoHeight),i.toggle(de.NORMAL,t.normal),i.toggle(de.PRINT,t.print),this.addOrRemoveCssClass(de.AUTO_HEIGHT,t.autoHeight),this.addOrRemoveCssClass(de.NORMAL,t.normal),this.addOrRemoveCssClass(de.PRINT,t.print)}createTemplate(){const e=this.ctrl.showDropZones()?"<ag-grid-header-drop-zones></ag-grid-header-drop-zones>":"",t=this.ctrl.showSideBar()?'<ag-side-bar ref="sideBar"></ag-side-bar>':"",i=this.ctrl.showStatusBar()?'<ag-status-bar ref="statusBar"></ag-status-bar>':"",s=this.ctrl.showWatermark()?"<ag-watermark></ag-watermark>":"";return`<div class="ag-root-wrapper" role="presentation">
${e}
<div class="ag-root-wrapper-body" ref="rootWrapperBody" role="presentation">
<ag-grid-body ref="gridBody"></ag-grid-body>
${t}
</div>
${i}
<ag-pagination></ag-pagination>
${s}
</div>`}getFocusableElement(){return this.eRootWrapperBody}getFocusableContainers(){const e=[this.gridBodyComp.getGui()];return this.sideBarComp&&e.push(this.sideBarComp.getGui()),e.filter(t=>Jt(t))}}jo([p("loggerFactory")],Ms.prototype,"loggerFactory",void 0),jo([O("gridBody")],Ms.prototype,"gridBodyComp",void 0),jo([O("sideBar")],Ms.prototype,"sideBarComp",void 0),jo([O("rootWrapperBody")],Ms.prototype,"eRootWrapperBody",void 0),jo([D],Ms.prototype,"postConstruct",null);var Ic=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},rr;let zo=rr=class extends T{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=this.gridOptionsService.isColumnsSortingCoupledToGroup();let n=[e];if(o&&e.getColDef().showRowGroup){const a=this.columnModel.getSourceColumnsForGroupColumn(e),d=a==null?void 0:a.filter(c=>c.getColDef().sortable);d&&(n=[e,...d])}n.forEach(a=>a.setSort(t,s)),(i||this.gridOptionsService.is("alwaysMultiSort"))&&!this.gridOptionsService.is("suppressMultiSort")||this.clearSortBarTheseColumns(n,s),this.updateSortIndex(e),this.dispatchSortChangedEvents(s)}updateSortIndex(e){const t=this.gridOptionsService.isColumnsSortingCoupledToGroup(),i=this.columnModel.getGroupDisplayColumnForGroup(e.getId()),s=t&&i||e,o=this.getColumnsWithSortingOrdered();this.columnModel.getPrimaryAndSecondaryAndAutoColumns().forEach(a=>a.setSortIndex(null));const n=o.filter(a=>a!==s);(s.getSort()?[...n,s]:n).forEach((a,d)=>a.setSortIndex(d))}onSortChanged(e){this.dispatchSortChangedEvents(e)}isSortActive(){const t=this.columnModel.getPrimaryAndSecondaryAndAutoColumns().filter(i=>!!i.getSort());return t&&t.length>0}dispatchSortChangedEvents(e){const t={type:u.EVENT_SORT_CHANGED,source:e};this.eventService.dispatchEvent(t)}clearSortBarTheseColumns(e,t){this.columnModel.getPrimaryAndSecondaryAndAutoColumns().forEach(i=>{e.includes(i)||i.setSort(void 0,t)})}getNextSortDirection(e){let t;if(e.getColDef().sortingOrder?t=e.getColDef().sortingOrder:this.gridOptionsService.get("sortingOrder")?t=this.gridOptionsService.get("sortingOrder"):t=rr.DEFAULT_SORTING_ORDER,!Array.isArray(t)||t.length<=0)return console.warn(`AG Grid: sortingOrder must be an array with at least one element, currently it's ${t}`),null;const i=t.indexOf(e.getSort()),s=i<0,o=i==t.length-1;let n;return s||o?n=t[0]:n=t[i+1],rr.DEFAULT_SORTING_ORDER.indexOf(n)<0?(console.warn("AG Grid: invalid sort type "+n),null):n}getIndexedSortMap(){let e=this.columnModel.getPrimaryAndSecondaryAndAutoColumns().filter(n=>!!n.getSort());if(this.columnModel.isPivotMode()){const n=this.gridOptionsService.isColumnsSortingCoupledToGroup();e=e.filter(r=>{const a=!!r.getAggFunc(),d=!r.isPrimary(),c=n?this.columnModel.getGroupDisplayColumnForGroup(r.getId()):r.getColDef().showRowGroup;return a||d||c})}const t=this.columnModel.getRowGroupColumns().filter(n=>!!n.getSort()),i=this.gridOptionsService.isColumnsSortingCoupledToGroup()&&!!t.length;i&&(e=[...new Set(e.map(n=>{var r;return(r=this.columnModel.getGroupDisplayColumnForGroup(n.getId()))!==null&&r!==void 0?r:n}))]);const s={};e.forEach((n,r)=>s[n.getId()]=r),e.sort((n,r)=>{const a=n.getSortIndex(),d=r.getSortIndex();if(a!=null&&d!=null)return a-d;if(a==null&&d==null){const c=s[n.getId()],h=s[r.getId()];return c>h?1:-1}else return d==null?-1:1});const o=new Map;return e.forEach((n,r)=>o.set(n,r)),i&&t.forEach(n=>{const r=this.columnModel.getGroupDisplayColumnForGroup(n.getId());o.set(n,o.get(r))}),o}getColumnsWithSortingOrdered(){return[...this.getIndexedSortMap().entries()].sort(([e,t],[i,s])=>t-s).map(([e])=>e)}getSortModel(){return this.getColumnsWithSortingOrdered().map(e=>({sort:e.getSort(),colId:e.getId()}))}getSortOptions(){return this.getColumnsWithSortingOrdered().map(e=>({sort:e.getSort(),column:e}))}canColumnDisplayMixedSort(e){const t=this.gridOptionsService.isColumnsSortingCoupledToGroup(),i=!!e.getColDef().showRowGroup;return t&&i}getDisplaySortForColumn(e){const t=this.columnModel.getSourceColumnsForGroupColumn(e);if(!this.canColumnDisplayMixedSort(e)||!(t!=null&&t.length))return e.getSort();const s=!!e.getColDef().field?[e,...t]:t,o=s[0].getSort();return s.every(r=>r.getSort()==o)?o:"mixed"}getDisplaySortIndexForColumn(e){return this.getIndexedSortMap().get(e)}};zo.DEFAULT_SORTING_ORDER=["asc","desc",null],Ic([p("columnModel")],zo.prototype,"columnModel",void 0),zo=rr=Ic([M("sortController")],zo);var Pg=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let aa=class extends T{setMouseOver(e){this.selectedColumns=e;const t={type:u.EVENT_COLUMN_HOVER_CHANGED};this.eventService.dispatchEvent(t)}clearMouseOver(){this.selectedColumns=null;const e={type:u.EVENT_COLUMN_HOVER_CHANGED};this.eventService.dispatchEvent(e)}isHovered(e){return!!this.selectedColumns&&this.selectedColumns.indexOf(e)>=0}};aa=Pg([M("columnHoverService")],aa);var da=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let $o=class extends T{constructor(){super(...arguments),this.executeNextFuncs=[],this.executeLaterFuncs=[],this.active=!1,this.animationThreadCount=0}postConstruct(){this.ctrlsService.whenReady(e=>this.gridBodyCtrl=e.gridBodyCtrl)}isActive(){return this.active}start(){this.active||this.gridOptionsService.is("suppressColumnMoveAnimation")||this.gridOptionsService.is("enableRtl")||(this.ensureAnimationCssClassPresent(),this.active=!0)}finish(){this.active&&(this.flush(),this.active=!1)}executeNextVMTurn(e){this.active?this.executeNextFuncs.push(e):e()}executeLaterVMTurn(e){this.active?this.executeLaterFuncs.push(e):e()}ensureAnimationCssClassPresent(){this.animationThreadCount++;const e=this.animationThreadCount;this.gridBodyCtrl.setColumnMovingCss(!0),this.executeLaterFuncs.push(()=>{this.animationThreadCount===e&&this.gridBodyCtrl.setColumnMovingCss(!1)})}flush(){const e=this.executeNextFuncs;this.executeNextFuncs=[];const t=this.executeLaterFuncs;this.executeLaterFuncs=[],!(e.length===0&&t.length===0)&&(window.setTimeout(()=>e.forEach(i=>i()),0),window.setTimeout(()=>t.forEach(i=>i()),300))}};da([p("ctrlsService")],$o.prototype,"ctrlsService",void 0),da([D],$o.prototype,"postConstruct",null),$o=da([M("columnAnimationService")],$o);var ca=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let Ko=class extends T{postConstruct(){this.ctrlsService.whenReady(e=>{this.centerRowContainerCon=e.centerRowContainerCtrl,this.addManagedListener(this.eventService,u.EVENT_BODY_HEIGHT_CHANGED,this.checkPageSize.bind(this)),this.addManagedListener(this.eventService,u.EVENT_SCROLL_VISIBILITY_CHANGED,this.checkPageSize.bind(this)),this.checkPageSize()})}notActive(){return!this.gridOptionsService.is("paginationAutoPageSize")||this.centerRowContainerCon==null}checkPageSize(){if(this.notActive())return;const e=this.centerRowContainerCon.getViewportSizeFeature().getBodyHeight();if(e>0){const t=()=>{const i=this.gridOptionsService.getRowHeightAsNumber(),s=Math.floor(e/i);this.gridOptionsService.set("paginationPageSize",s)};this.isBodyRendered?Ft(()=>t(),50)():(t(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}};ca([p("ctrlsService")],Ko.prototype,"ctrlsService",void 0),ca([D],Ko.prototype,"postConstruct",null),Ko=ca([M("paginationAutoPageSizeService")],Ko);var Mc=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let lr=class extends T{constructor(){super(...arguments),this.cacheVersion=0}init(){this.active=this.gridOptionsService.is("valueCache"),this.neverExpires=this.gridOptionsService.is("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]}};Mc([D],lr.prototype,"init",null),lr=Mc([M("valueCache")],lr);var ar=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};const Ag="paste";let Ns=class extends T{init(){this.rowModel.getType()==="clientSide"&&(this.clientSideRowModel=this.rowModel),this.addManagedListener(this.eventService,u.EVENT_CELL_VALUE_CHANGED,this.onCellValueChanged.bind(this))}onCellValueChanged(e){e.source!==Ag&&this.doChangeDetection(e.node,e.column)}doChangeDetection(e,t){if(this.gridOptionsService.is("suppressChangeDetection"))return;const i=[e];if(this.clientSideRowModel&&!e.isRowPinned()){const s=this.gridOptionsService.is("aggregateOnlyChangedColumns"),o=new ta(s,this.clientSideRowModel.getRootNode());o.addParentNode(e.parent,[t]),this.clientSideRowModel.doAggregate(o),o.forEachChangedNodeDepthFirst(n=>{i.push(n)})}this.rowRenderer.refreshCells({rowNodes:i})}};ar([p("rowModel")],Ns.prototype,"rowModel",void 0),ar([p("rowRenderer")],Ns.prototype,"rowRenderer",void 0),ar([D],Ns.prototype,"init",null),Ns=ar([M("changeDetectionService")],Ns);var Nc=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let dr=class extends T{adaptFunction(e,t){const i=this.componentMetadataProvider.retrieve(e);return i&&i.functionAdapter?i.functionAdapter(t):null}adaptCellRendererFunction(e){class t{refresh(s){return!1}getGui(){return this.eGui}init(s){const o=e(s),n=typeof o;if(n==="string"||n==="number"||n==="boolean"){this.eGui=fe("<span>"+o+"</span>");return}if(o==null){this.eGui=fe("<span></span>");return}this.eGui=o}}return t}doesImplementIComponent(e){return e?e.prototype&&"getGui"in e.prototype:!1}};Nc([p("componentMetadataProvider")],dr.prototype,"componentMetadataProvider",void 0),dr=Nc([M("agComponentUtils")],dr);var ua=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let Yo=class extends T{postConstruct(){this.componentMetaData={dateComponent:{mandatoryMethodList:["getDate","setDate"],optionalMethodList:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel"]},detailCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},headerComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},headerGroupComponent:{mandatoryMethodList:[],optionalMethodList:[]},loadingCellRenderer:{mandatoryMethodList:[],optionalMethodList:[]},loadingOverlayComponent:{mandatoryMethodList:[],optionalMethodList:[]},noRowsOverlayComponent:{mandatoryMethodList:[],optionalMethodList:[]},floatingFilterComponent:{mandatoryMethodList:["onParentModelChanged"],optionalMethodList:["afterGuiAttached"]},floatingFilterWrapperComponent:{mandatoryMethodList:[],optionalMethodList:[]},cellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},cellEditor:{mandatoryMethodList:["getValue"],optionalMethodList:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached"]},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"]},filterComponent:{mandatoryMethodList:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethodList:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged"]},statusPanel:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"]},toolPanel:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"]},tooltipComponent:{mandatoryMethodList:[],optionalMethodList:[]}}}retrieve(e){return this.componentMetaData[e]}};ua([p("agComponentUtils")],Yo.prototype,"agComponentUtils",void 0),ua([D],Yo.prototype,"postConstruct",null),Yo=ua([M("componentMetadataProvider")],Yo);var ha=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};const Fg=25,_c=10,pa=8,Lg=4,ga=4,fa=6,Ig={"ag-theme-custom":{headerHeight:25,headerCellMinWidth:24,listItemHeight:Lg*5,rowHeight:25,chartMenuPanelWidth:220},"ag-theme-material":{headerHeight:pa*7,headerCellMinWidth:48,listItemHeight:pa*4,rowHeight:pa*6,chartMenuPanelWidth:240},"ag-theme-balham":{headerHeight:ga*8,headerCellMinWidth:24,listItemHeight:ga*6,rowHeight:ga*7,chartMenuPanelWidth:220},"ag-theme-alpine":{headerHeight:fa*8,headerCellMinWidth:36,listItemHeight:fa*4,rowHeight:fa*7,chartMenuPanelWidth:240}},xc={headerHeight:["ag-header-row"],headerCellMinWidth:["ag-header-cell"],listItemHeight:["ag-virtual-list-item"],rowHeight:["ag-row"],chartMenuPanelWidth:["ag-chart-docked-container"]};let qo=class extends T{constructor(){super(...arguments),this.calculatedSizes={}}postConstruct(){var e;const t=(e=this.getTheme().el)!==null&&e!==void 0?e:this.eGridDiv;this.mutationObserver=new MutationObserver(()=>{this.calculatedSizes={},this.fireGridStylesChangedEvent()}),this.mutationObserver.observe(t||this.eGridDiv,{attributes:!0,attributeFilter:["class"]})}fireGridStylesChangedEvent(){const e={type:u.EVENT_GRID_STYLES_CHANGED};this.eventService.dispatchEvent(e)}getSassVariable(e){const{themeFamily:t,el:i}=this.getTheme();if(!t||t.indexOf("ag-theme")!==0)return;this.calculatedSizes||(this.calculatedSizes={}),this.calculatedSizes[t]||(this.calculatedSizes[t]={});const s=this.calculatedSizes[t][e];return s??(this.calculatedSizes[t][e]=this.calculateValueForSassProperty(e,t,i),this.calculatedSizes[t][e])}calculateValueForSassProperty(e,t,i){const s="ag-theme-"+(t.match("material")?"material":t.match("balham")?"balham":t.match("alpine")?"alpine":"custom"),o=Ig[s][e],n=this.gridOptionsService.getDocument();if(i||(i=this.eGridDiv),!xc[e])return o;const r=xc[e],a=n.createElement("div"),d=Array.from(i.classList);a.classList.add(t,...d),a.style.position="absolute";const c=r.reduce((g,f)=>{const m=n.createElement("div");return m.style.position="static",m.classList.add(f),g.appendChild(m),m},a);let h=0;if(n.body){n.body.appendChild(a);const g=e.toLowerCase().indexOf("height")!==-1?"height":"width";h=parseInt(window.getComputedStyle(c)[g],10),n.body.removeChild(a)}return h||o}isThemeDark(){const{theme:e}=this.getTheme();return!!e&&e.indexOf("dark")>=0}chartMenuPanelWidth(){return this.getSassVariable("chartMenuPanelWidth")}getTheme(){const e=/\bag-(material|(?:theme-([\w\-]*)))\b/g;let t=this.eGridDiv,i=null,s=[];for(;t;)if(i=e.exec(t.className),!i)t=t.parentElement||void 0;else{const n=t.className.match(e);n&&(s=n);break}if(!i)return{allThemes:s};const o=i[0];return{theme:o,el:t,themeFamily:o.replace(/-dark$/,""),allThemes:s}}getFromTheme(e,t){var i;return(i=this.getSassVariable(t))!==null&&i!==void 0?i:e}getDefaultRowHeight(){return this.getFromTheme(Fg,"rowHeight")}getListItemHeight(){return this.getFromTheme(20,"listItemHeight")}setRowHeightVariable(e){const t=this.eGridDiv.style.getPropertyValue("--ag-line-height").trim(),i=`${e}px`;t!=i&&this.eGridDiv.style.setProperty("--ag-line-height",i)}getMinColWidth(){const e=this.getFromTheme(null,"headerCellMinWidth");return R(e)?Math.max(e,_c):_c}destroy(){this.calculatedSizes=null,this.mutationObserver&&this.mutationObserver.disconnect(),super.destroy()}};ha([p("eGridDiv")],qo.prototype,"eGridDiv",void 0),ha([D],qo.prototype,"postConstruct",null),qo=ha([M("environment")],qo);var cr=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Mg=function(l,e){return function(t,i){e(t,i,l)}};let _s=class extends T{constructor(){super(...arguments),this.scrollY=0,this.uiBodyHeight=0}agWire(e){this.logger=e.create("RowContainerHeightService")}postConstruct(){this.addManagedListener(this.eventService,u.EVENT_BODY_HEIGHT_CHANGED,this.updateOffset.bind(this)),this.maxDivHeight=vd(),this.logger.log("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.logger.log(`Div Stretch Offset = ${t} (${this.pixelsToShave} * ${e})`),this.setDivStretchOffset(t)}setUiContainerHeight(e){e!==this.uiContainerHeight&&(this.uiContainerHeight=e,this.eventService.dispatchEvent({type:u.EVENT_ROW_CONTAINER_HEIGHT_CHANGED}))}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:u.EVENT_HEIGHT_SCALE_CHANGED}))}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}};cr([p("ctrlsService")],_s.prototype,"ctrlsService",void 0),cr([Mg(0,Te("loggerFactory"))],_s.prototype,"agWire",null),cr([D],_s.prototype,"postConstruct",null),_s=cr([M("rowContainerHeightService")],_s);var Gc=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let ur=class extends T{init(){this.groupSelectsChildren=this.gridOptionsService.is("groupSelectsChildren"),this.isRowSelectableFunc=this.gridOptionsService.get("isRowSelectable")}updateSelectableAfterGrouping(e){if(this.isRowSelectableFunc){const t=i=>i.childrenAfterGroup;this.recurseDown(e.childrenAfterGroup,t)}}recurseDown(e,t){e&&e.forEach(i=>{if(!i.group)return;i.hasChildren()&&this.recurseDown(t(i),t);let s;if(this.groupSelectsChildren){const o=(t(i)||[]).find(n=>n.selectable===!0);s=R(o)}else s=this.isRowSelectableFunc?this.isRowSelectableFunc(i):!1;i.setRowSelectable(s)})}};Gc([D],ur.prototype,"init",null),ur=Gc([M("selectableService")],ur);var dt=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Xe extends V{constructor(){super(),this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1}postConstruct(){const e=this.gridOptionsService.is("enableRtl");this.setTemplate(this.getTemplate());const{btFirst:t,btPrevious:i,btNext:s,btLast:o}=this;this.activateTabIndex([t,i,s,o]),t.insertAdjacentElement("afterbegin",le(e?"last":"first",this.gridOptionsService)),i.insertAdjacentElement("afterbegin",le(e?"next":"previous",this.gridOptionsService)),s.insertAdjacentElement("afterbegin",le(e?"previous":"next",this.gridOptionsService)),o.insertAdjacentElement("afterbegin",le(e?"first":"last",this.gridOptionsService)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.onPaginationChanged()}onPaginationChanged(){const t=this.gridOptionsService.is("pagination")&&!this.gridOptionsService.is("suppressPaginationPanel");this.setDisplayed(t),t&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateRowLabels(),this.setCurrentPageLabel(),this.setTotalLabels())}setupListeners(){this.areListenersSetup||(this.addManagedListener(this.eventService,u.EVENT_PAGINATION_CHANGED,this.onPaginationChanged.bind(this)),[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}].forEach(e=>{const{el:t,fn:i}=e;this.addManagedListener(t,"click",i),this.addManagedListener(t,"keydown",s=>{(s.key===w.ENTER||s.key===w.SPACE)&&(s.preventDefault(),i())})}),this.areListenersSetup=!0)}onBtFirst(){this.previousAndFirstButtonsDisabled||this.paginationProxy.goToFirstPage()}setCurrentPageLabel(){const e=this.paginationProxy.getTotalPages()>0,t=this.paginationProxy.getCurrentPage(),i=e?t+1:0;this.lbCurrent.innerHTML=this.formatNumber(i)}formatNumber(e){const t=this.gridOptionsService.getCallback("paginationNumberFormatter");if(t)return t({value:e});const i=this.localeService.getLocaleTextFunc(),s=i("thousandSeparator",","),o=i("decimalSeparator",".");return ol(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"),n=e("previousPage","Previous Page"),r=e("nextPage","Next Page"),a=e("lastPage","Last Page"),d=this.getCompId();return`<div class="ag-paging-panel ag-unselectable" id="ag-${d}">
<span class="ag-paging-row-summary-panel" role="status">
<span id="ag-${d}-first-row" ref="lbFirstRowOnPage" class="ag-paging-row-summary-panel-number"></span>
<span id="ag-${d}-to">${i}</span>
<span id="ag-${d}-last-row" ref="lbLastRowOnPage" class="ag-paging-row-summary-panel-number"></span>
<span id="ag-${d}-of">${s}</span>
<span id="ag-${d}-row-count" ref="lbRecordCount" class="ag-paging-row-summary-panel-number"></span>
</span>
<span class="ag-paging-page-summary-panel" role="presentation">
<div ref="btFirst" class="ag-button ag-paging-button" role="button" aria-label="${o}"></div>
<div ref="btPrevious" class="ag-button ag-paging-button" role="button" aria-label="${n}"></div>
<span class="ag-paging-description" role="status">
<span id="ag-${d}-start-page">${t}</span>
<span id="ag-${d}-start-page-number" ref="lbCurrent" class="ag-paging-number"></span>
<span id="ag-${d}-of-page">${s}</span>
<span id="ag-${d}-of-page-number" ref="lbTotal" class="ag-paging-number"></span>
</span>
<div ref="btNext" class="ag-button ag-paging-button" role="button" aria-label="${r}"></div>
<div ref="btLast" class="ag-button ag-paging-button" role="button" aria-label="${a}"></div>
</span>
</div>`}onBtNext(){this.nextButtonDisabled||this.paginationProxy.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.paginationProxy.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.paginationProxy.goToLastPage()}enableOrDisableButtons(){const e=this.paginationProxy.getCurrentPage(),t=this.paginationProxy.isLastPageFound(),i=this.paginationProxy.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const s=this.isZeroPagesToDisplay(),o=t&&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){Ur(e,t),e.classList.toggle("ag-disabled",t)}updateRowLabels(){const e=this.paginationProxy.getCurrentPage(),t=this.paginationProxy.getPageSize(),i=this.paginationProxy.isLastPageFound(),s=this.paginationProxy.isLastPageFound()?this.paginationProxy.getMasterRowCount():null;let o,n;if(this.isZeroPagesToDisplay()?o=n=0:(o=t*e+1,n=o+t-1,i&&n>s&&(n=s)),this.lbFirstRowOnPage.innerHTML=this.formatNumber(o),this.rowNodeBlockLoader.isLoading()){const r=this.localeService.getLocaleTextFunc();this.lbLastRowOnPage.innerHTML=r("pageLastRowUnknown","?")}else this.lbLastRowOnPage.innerHTML=this.formatNumber(n)}isZeroPagesToDisplay(){const e=this.paginationProxy.isLastPageFound(),t=this.paginationProxy.getTotalPages();return e&&t===0}setTotalLabels(){const e=this.paginationProxy.isLastPageFound(),t=this.paginationProxy.getTotalPages(),i=e?this.paginationProxy.getMasterRowCount():null;if(i===1){const s=this.paginationProxy.getRow(0);if(s&&s.group&&!(s.groupData||s.aggData)){this.setTotalLabelsToZero();return}}if(e)this.lbTotal.innerHTML=this.formatNumber(t),this.lbRecordCount.innerHTML=this.formatNumber(i);else{const s=this.localeService.getLocaleTextFunc()("more","more");this.lbTotal.innerHTML=s,this.lbRecordCount.innerHTML=s}}setTotalLabelsToZero(){this.lbFirstRowOnPage.innerHTML=this.formatNumber(0),this.lbCurrent.innerHTML=this.formatNumber(0),this.lbLastRowOnPage.innerHTML=this.formatNumber(0),this.lbTotal.innerHTML=this.formatNumber(0),this.lbRecordCount.innerHTML=this.formatNumber(0)}}dt([p("paginationProxy")],Xe.prototype,"paginationProxy",void 0),dt([p("rowNodeBlockLoader")],Xe.prototype,"rowNodeBlockLoader",void 0),dt([O("btFirst")],Xe.prototype,"btFirst",void 0),dt([O("btPrevious")],Xe.prototype,"btPrevious",void 0),dt([O("btNext")],Xe.prototype,"btNext",void 0),dt([O("btLast")],Xe.prototype,"btLast",void 0),dt([O("lbRecordCount")],Xe.prototype,"lbRecordCount",void 0),dt([O("lbFirstRowOnPage")],Xe.prototype,"lbFirstRowOnPage",void 0),dt([O("lbLastRowOnPage")],Xe.prototype,"lbLastRowOnPage",void 0),dt([O("lbCurrent")],Xe.prototype,"lbCurrent",void 0),dt([O("lbTotal")],Xe.prototype,"lbTotal",void 0),dt([D],Xe.prototype,"postConstruct",null);var xs=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Gs;(function(l){l[l.Loading=0]="Loading",l[l.NoRows=1]="NoRows"})(Gs||(Gs={}));class kt extends V{constructor(){super(kt.TEMPLATE),this.inProgress=!1,this.destroyRequested=!1,this.manuallyDisplayed=!1}updateLayoutClasses(e,t){const i=this.eOverlayWrapper.classList;i.toggle(de.AUTO_HEIGHT,t.autoHeight),i.toggle(de.NORMAL,t.normal),i.toggle(de.PRINT,t.print)}postConstruct(){this.createManagedBean(new xn(this)),this.setDisplayed(!1,{skipAriaHidden:!0}),this.addManagedListener(this.eventService,u.EVENT_ROW_DATA_UPDATED,this.onRowDataUpdated.bind(this)),this.addManagedListener(this.eventService,u.EVENT_NEW_COLUMNS_LOADED,this.onNewColumnsLoaded.bind(this)),this.gridOptionsService.isRowModelType("clientSide")&&!this.gridOptionsService.get("rowData")&&this.showLoadingOverlay(),this.gridApi.registerOverlayWrapperComp(this)}setWrapperTypeClass(e){const t=this.eOverlayWrapper.classList;t.toggle("ag-overlay-loading-wrapper",e===Gs.Loading),t.toggle("ag-overlay-no-rows-wrapper",e===Gs.NoRows)}showLoadingOverlay(){if(this.gridOptionsService.is("suppressLoadingOverlay"))return;const e={},i=this.userComponentFactory.getLoadingOverlayCompDetails(e).newAgStackInstance();this.showOverlay(i,Gs.Loading)}showNoRowsOverlay(){if(this.gridOptionsService.is("suppressNoRowsOverlay"))return;const e={},i=this.userComponentFactory.getNoRowsOverlayCompDetails(e).newAgStackInstance();this.showOverlay(i,Gs.NoRows)}showOverlay(e,t){this.inProgress||(this.setWrapperTypeClass(t),this.destroyActiveOverlay(),this.inProgress=!0,e&&e.then(i=>{this.inProgress=!1,this.eOverlayWrapper.appendChild(i.getGui()),this.activeOverlay=i,this.destroyRequested&&(this.destroyRequested=!1,this.destroyActiveOverlay())}),this.manuallyDisplayed=this.columnModel.isReady()&&!this.paginationProxy.isEmpty(),this.setDisplayed(!0,{skipAriaHidden:!0}))}destroyActiveOverlay(){if(this.inProgress){this.destroyRequested=!0;return}this.activeOverlay&&(this.activeOverlay=this.getContext().destroyBean(this.activeOverlay),We(this.eOverlayWrapper))}hideOverlay(){this.manuallyDisplayed=!1,this.destroyActiveOverlay(),this.setDisplayed(!1,{skipAriaHidden:!0})}destroy(){this.destroyActiveOverlay(),super.destroy()}showOrHideOverlay(){const e=this.paginationProxy.isEmpty(),t=this.gridOptionsService.is("suppressNoRowsOverlay");e&&!t?this.showNoRowsOverlay():this.hideOverlay()}onRowDataUpdated(){this.showOrHideOverlay()}onNewColumnsLoaded(){this.columnModel.isReady()&&!this.paginationProxy.isEmpty()&&!this.manuallyDisplayed&&this.hideOverlay()}}kt.TEMPLATE=`
<div class="ag-overlay" aria-hidden="true">
<div class="ag-overlay-panel">
<div class="ag-overlay-wrapper" ref="eOverlayWrapper"></div>
</div>
</div>`,xs([p("userComponentFactory")],kt.prototype,"userComponentFactory",void 0),xs([p("paginationProxy")],kt.prototype,"paginationProxy",void 0),xs([p("gridApi")],kt.prototype,"gridApi",void 0),xs([p("columnModel")],kt.prototype,"columnModel",void 0),xs([O("eOverlayWrapper")],kt.prototype,"eOverlayWrapper",void 0),xs([D],kt.prototype,"postConstruct",null);var hr=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let Hs=class extends T{getFirstRow(){let e=0,t;return this.pinnedRowModel.getPinnedTopRowCount()?t="top":this.rowModel.getRowCount()?(t=null,e=this.paginationProxy.getPageFirstRow()):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.paginationProxy.getPageLastRow()):s&&(t="top",e=s-1),e===void 0?null:{rowIndex:e,rowPinned:t}}getRowNode(e){switch(e.rowPinned){case"top":return this.pinnedRowModel.getPinnedTopRowData()[e.rowIndex];case"bottom":return this.pinnedRowModel.getPinnedBottomRowData()[e.rowIndex];default:return this.rowModel.getRow(e.rowIndex)}}sameRow(e,t){return!e&&!t?!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(R(t.rowPinned))return t.rowPinned!=="top";break}return e.rowIndex<t.rowIndex}rowMax(e){let t;return e.forEach(i=>{(t===void 0||this.before(t,i))&&(t=i)}),t}rowMin(e){let t;return e.forEach(i=>{(t===void 0||this.before(i,t))&&(t=i)}),t}};hr([p("rowModel")],Hs.prototype,"rowModel",void 0),hr([p("pinnedRowModel")],Hs.prototype,"pinnedRowModel",void 0),hr([p("paginationProxy")],Hs.prototype,"paginationProxy",void 0),Hs=hr([M("rowPositionUtils")],Hs);var Ng=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let Ca=class extends T{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}};Ca=Ng([M("cellPositionUtils")],Ca);class Qo{constructor(e){this.cellValueChanges=e}}class ma extends Qo{constructor(e,t,i,s){super(e),this.initialRange=t,this.finalRange=i,this.ranges=s}}class Xo{constructor(e){this.actionStack=[],this.maxStackSize=e||Xo.DEFAULT_STACK_SIZE,this.actionStack=new Array(this.maxStackSize)}pop(){return this.actionStack.pop()}push(e){e.cellValueChanges&&e.cellValueChanges.length>0&&(this.actionStack.length===this.maxStackSize&&this.actionStack.shift(),this.actionStack.push(e))}clear(){this.actionStack=[]}getCurrentStackSize(){return this.actionStack.length}}Xo.DEFAULT_STACK_SIZE=10;var Ut=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let ct=class extends T{constructor(){super(...arguments),this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.onCellValueChanged=e=>{const t={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned},i=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:n,rowIndex:r,column:a,oldValue:d,value:c}=e,h={rowPinned:n,rowIndex:r,columnId:a.getColId(),newValue:c,oldValue:d};this.cellValueChanges.push(h)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}init(){if(!this.gridOptionsService.is("undoRedoCellEditing"))return;const e=this.gridOptionsService.getNum("undoRedoCellEditingLimit");e<=0||(this.undoStack=new Xo(e),this.redoStack=new Xo(e),this.addRowEditingListeners(),this.addCellEditingListeners(),this.addPasteListeners(),this.addFillListeners(),this.addCellKeyListeners(),this.addManagedListener(this.eventService,u.EVENT_CELL_VALUE_CHANGED,this.onCellValueChanged),this.addManagedListener(this.eventService,u.EVENT_MODEL_UPDATED,t=>{t.keepUndoRedoStack||this.clearStacks()}),this.addManagedListener(this.eventService,u.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.clearStacks),this.addManagedListener(this.eventService,u.EVENT_NEW_COLUMNS_LOADED,this.clearStacks),this.addManagedListener(this.eventService,u.EVENT_COLUMN_GROUP_OPENED,this.clearStacks),this.addManagedListener(this.eventService,u.EVENT_COLUMN_ROW_GROUP_CHANGED,this.clearStacks),this.addManagedListener(this.eventService,u.EVENT_COLUMN_MOVED,this.clearStacks),this.addManagedListener(this.eventService,u.EVENT_COLUMN_PINNED,this.clearStacks),this.addManagedListener(this.eventService,u.EVENT_COLUMN_VISIBLE,this.clearStacks),this.addManagedListener(this.eventService,u.EVENT_ROW_DRAG_END,this.clearStacks),this.ctrlsService.whenReady(()=>{this.gridBodyCtrl=this.ctrlsService.getGridBodyCtrl()}))}getCurrentUndoStackSize(){return this.undoStack?this.undoStack.getCurrentStackSize():0}getCurrentRedoStackSize(){return this.redoStack?this.redoStack.getCurrentStackSize():0}undo(e){const t={type:u.EVENT_UNDO_STARTED,source:e};this.eventService.dispatchEvent(t);const i=this.undoRedo(this.undoStack,this.redoStack,"initialRange","oldValue","undo"),s={type:u.EVENT_UNDO_ENDED,source:e,operationPerformed:i};this.eventService.dispatchEvent(s)}redo(e){const t={type:u.EVENT_REDO_STARTED,source:e};this.eventService.dispatchEvent(t);const i=this.undoRedo(this.redoStack,this.undoStack,"finalRange","newValue","redo"),s={type:u.EVENT_REDO_ENDED,source:e,operationPerformed:i};this.eventService.dispatchEvent(s)}undoRedo(e,t,i,s,o){if(!e)return!1;const n=e.pop();return!n||!n.cellValueChanges?!1:(this.processAction(n,r=>r[s],o),n instanceof ma?this.processRange(n.ranges||[n[i]]):this.processCell(n.cellValueChanges),t.push(n),!0)}processAction(e,t,i){e.cellValueChanges.forEach(s=>{const{rowIndex:o,rowPinned:n,columnId:r}=s,a={rowIndex:o,rowPinned:n},d=this.getRowNode(a);d.displayed&&d.setDataValue(r,t(s),i)})}processRange(e){let t;this.rangeService.removeAllCellRanges(!0),e.forEach((i,s)=>{if(!i)return;const o=i.startRow,n=i.endRow;s===e.length-1&&(t={rowPinned:o.rowPinned,rowIndex:o.rowIndex,columnId:i.startColumn.getColId()},this.setLastFocusedCell(t));const r={rowStartIndex:o.rowIndex,rowStartPinned:o.rowPinned,rowEndIndex:n.rowIndex,rowEndPinned:n.rowPinned,columnStart:i.startColumn,columns:i.columns};this.rangeService.addCellRange(r)})}processCell(e){const t=e[0],{rowIndex:i,rowPinned:s}=t,o={rowIndex:i,rowPinned:s},n=this.getRowNode(o),r={rowPinned:t.rowPinned,rowIndex:n.rowIndex,columnId:t.columnId};this.setLastFocusedCell(r,!!this.rangeService)}setLastFocusedCell(e,t){const{rowIndex:i,columnId:s,rowPinned:o}=e,n=this.gridBodyCtrl.getScrollFeature(),r=this.columnModel.getGridColumn(s);if(!r)return;n.ensureIndexVisible(i),n.ensureColumnVisible(r);const a={rowIndex:i,column:r,rowPinned:o};this.focusService.setFocusedCell(Object.assign(Object.assign({},a),{forceBrowserFocus:!0})),t&&this.rangeService.setRangeToCell(a)}addRowEditingListeners(){this.addManagedListener(this.eventService,u.EVENT_ROW_EDITING_STARTED,e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}}),this.addManagedListener(this.eventService,u.EVENT_ROW_EDITING_STOPPED,()=>{const e=new Qo(this.cellValueChanges);this.pushActionsToUndoStack(e),this.activeRowEdit=null})}addCellEditingListeners(){this.addManagedListener(this.eventService,u.EVENT_CELL_EDITING_STARTED,e=>{this.activeCellEdit={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned}}),this.addManagedListener(this.eventService,u.EVENT_CELL_EDITING_STOPPED,e=>{if(this.activeCellEdit=null,e.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const i=new Qo(this.cellValueChanges);this.pushActionsToUndoStack(i)}})}addPasteListeners(){this.addManagedListener(this.eventService,u.EVENT_PASTE_START,()=>{this.isPasting=!0}),this.addManagedListener(this.eventService,u.EVENT_PASTE_END,()=>{const e=new Qo(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1})}addFillListeners(){this.addManagedListener(this.eventService,u.EVENT_FILL_START,()=>{this.isRangeInAction=!0}),this.addManagedListener(this.eventService,u.EVENT_FILL_END,e=>{const t=new ma(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1})}addCellKeyListeners(){this.addManagedListener(this.eventService,u.EVENT_KEY_SHORTCUT_CHANGED_CELL_START,()=>{this.isRangeInAction=!0}),this.addManagedListener(this.eventService,u.EVENT_KEY_SHORTCUT_CHANGED_CELL_END,()=>{let e;this.rangeService&&this.gridOptionsService.isEnableRangeSelection()?e=new ma(this.cellValueChanges,void 0,void 0,[...this.rangeService.getCellRanges()]):e=new Qo(this.cellValueChanges),this.pushActionsToUndoStack(e),this.isRangeInAction=!1})}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}getRowNode(e){switch(e.rowPinned){case"top":return this.pinnedRowModel.getPinnedTopRowData()[e.rowIndex];case"bottom":return this.pinnedRowModel.getPinnedBottomRowData()[e.rowIndex];default:return this.rowModel.getRow(e.rowIndex)}}};Ut([p("focusService")],ct.prototype,"focusService",void 0),Ut([p("ctrlsService")],ct.prototype,"ctrlsService",void 0),Ut([p("rowModel")],ct.prototype,"rowModel",void 0),Ut([p("pinnedRowModel")],ct.prototype,"pinnedRowModel",void 0),Ut([p("cellPositionUtils")],ct.prototype,"cellPositionUtils",void 0),Ut([p("rowPositionUtils")],ct.prototype,"rowPositionUtils",void 0),Ut([p("columnModel")],ct.prototype,"columnModel",void 0),Ut([X("rangeService")],ct.prototype,"rangeService",void 0),Ut([D],ct.prototype,"init",null),ct=Ut([M("undoRedoService")],ct);var va=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let Jo=class extends T{findHeader(e,t){let i,s,o;if(e.column instanceof te?(s=`getDisplayedGroup${t}`,i=this.columnModel[s](e.column)):(o=`getDisplayedCol${t}`,i=this.columnModel[o](e.column)),!i)return;let{headerRowIndex:n}=e;if(this.getHeaderRowType(n)===me.COLUMN_GROUP){const a=i;if(a.isPadding()&&this.isAnyChildSpanningHeaderHeight(a)){const{nextFocusColumn:d,nextRow:c}=this.getColumnVisibleChild(a,n,t);d&&(i=d,n=c)}}return{column:i,headerRowIndex:n}}isAnyChildSpanningHeaderHeight(e){return e?e.getLeafColumns().some(t=>t.isSpanHeaderHeight()):!1}getColumnVisibleParent(e,t){const i=this.getHeaderRowType(t),s=i===me.FLOATING_FILTER,o=i===me.COLUMN;let n=s?e:e.getParent(),r=t-1;if(o&&this.isAnyChildSpanningHeaderHeight(e.getParent())){for(;n&&n.isPadding();)n=n.getParent(),r--;r<0&&(n=e,r=t)}return{nextFocusColumn:n,nextRow:r}}getColumnVisibleChild(e,t,i="After"){const s=this.getHeaderRowType(t);let o=e,n=t+1;if(s===me.COLUMN_GROUP){const r=e.getLeafColumns(),a=i==="After"?r[0]:Z(r);if(this.isAnyChildSpanningHeaderHeight(a.getParent())){o=a;let d=a.getParent();for(;d&&d!==e;)d=d.getParent(),n++}else o=e.getDisplayedChildren()[0]}return{nextFocusColumn:o,nextRow:n}}getHeaderRowType(e){const t=this.ctrlsService.getHeaderRowContainerCtrl();if(t)return t.getRowType(e)}findColAtEdgeForHeaderRow(e,t){const i=this.columnModel.getAllDisplayedColumns(),s=i[t==="start"?0:i.length-1];if(!s)return;const n=this.ctrlsService.getHeaderRowContainerCtrl(s.getPinned()).getRowType(e);if(n==me.COLUMN_GROUP){const r=this.columnModel.getColumnGroupAtLevel(s,e);return{headerRowIndex:e,column:r}}return{headerRowIndex:n==null?-1:e,column:s}}};va([p("columnModel")],Jo.prototype,"columnModel",void 0),va([p("ctrlsService")],Jo.prototype,"ctrlsService",void 0),Jo=va([M("headerPositionUtils")],Jo);var _g=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let wa=class{buildColumnDefs(e,t,i){const s=[],o={};return e.forEach(n=>{const r=this.createDefFromColumn(n,t,i);let a=!0,d=r,c=n.getOriginalParent(),h=null;for(;c;){let g=null;if(c.isPadding()){c=c.getOriginalParent();continue}const f=o[c.getGroupId()];if(f){f.children.push(d),a=!1;break}if(g=this.createDefFromGroup(c),g&&(g.children=[d],o[g.groupId]=g,d=g,c=c.getOriginalParent()),c!=null&&h===c){a=!1;break}h=c}a&&s.push(d)}),s}createDefFromGroup(e){const t=ln(e.getColGroupDef(),["children"]);return t&&(t.groupId=e.getGroupId()),t}createDefFromColumn(e,t,i){const s=ln(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}};wa=_g([M("columnDefFactory")],wa);var Sa=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let Zo=class{getInitialRowClasses(e){const t=[];return R(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"),Mr(t,this.processClassesFromGridOptions(e.rowNode)),Mr(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=n=>{typeof n=="string"?t.push(n):Array.isArray(n)&&n.forEach(r=>t.push(r))},s=this.gridOptionsService.get("rowClass");if(s){if(typeof s=="function")return console.warn("AG Grid: rowClass should not be a function, please use getRowClass instead"),[];i(s)}const o=this.gridOptionsService.getCallback("getRowClass");if(o){const n={data:e.data,node:e,rowIndex:e.rowIndex},r=o(n);i(r)}return t}preProcessRowClassRules(e){const t=[];return this.processRowClassRules(e,i=>{t.push(i)},i=>{}),t}processRowClassRules(e,t,i){const s={data:e.data,node:e,rowIndex:e.rowIndex,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context};this.stylingService.processClassRules(this.gridOptionsService.get("rowClassRules"),s,t,i)}calculateRowLevel(e){return e.group?e.level:e.parent?e.parent.level+1:0}};Sa([p("stylingService")],Zo.prototype,"stylingService",void 0),Sa([p("gridOptionsService")],Zo.prototype,"gridOptionsService",void 0),Zo=Sa([M("rowCssClassCalculator")],Zo);var pr=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let Vs=class extends T{init(){this.isAccentedSort=this.gridOptionsService.is("accentedSort"),this.primaryColumnsSortGroups=this.gridOptionsService.isColumnsSortingCoupledToGroup(),this.addManagedPropertyListener("accentedSort",e=>this.isAccentedSort=e.currentValue),this.addManagedPropertyListener("autoGroupColumnDef",()=>this.primaryColumnsSortGroups=this.gridOptionsService.isColumnsSortingCoupledToGroup())}doFullSort(e,t){const i=(o,n)=>({currentPos:n,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 n=0,r=e.length;n<r;n++){const a=e[n],d=a.sort==="desc",c=this.getValue(s,a.column),h=this.getValue(o,a.column);let g;const f=this.getComparator(a,s);if(f?g=f(c,h,s,o,d):g=G.defaultComparator(c,h,this.isAccentedSort),!isNaN(g)&&g!==0)return a.sort==="asc"?g:g*-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 n=this.columnModel.getPrimaryColumn(o);if(n)return n.getColDef().comparator}getValue(e,t){var i,s;if(!this.primaryColumnsSortGroups)return this.valueService.getValue(t,e,!1,!1);if(e.rowGroupColumn===t){if(this.gridOptionsService.isGroupUseEntireRow(this.columnModel.isPivotActive())){if(t.getColDef().keyCreator)return e.key;const d=(i=e.allLeafChildren)===null||i===void 0?void 0:i[0];return d?this.valueService.getValue(t,d,!1,!1):void 0}const r=this.columnModel.getGroupDisplayColumnForGroup(t.getId());return r?(s=e.groupData)===null||s===void 0?void 0:s[r.getId()]:void 0}if(!(e.group&&t.getColDef().showRowGroup))return this.valueService.getValue(t,e,!1,!1)}};pr([p("valueService")],Vs.prototype,"valueService",void 0),pr([p("columnModel")],Vs.prototype,"columnModel",void 0),pr([D],Vs.prototype,"init",null),Vs=pr([M("rowNodeSorter")],Vs);var xg=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ea;let gr=Ea=class extends T{constructor(){super(...arguments),this.ready=!1,this.readyCallbacks=[]}checkReady(){if(this.ready=this.gridCtrl!=null&&this.gridBodyCtrl!=null&&this.centerRowContainerCtrl!=null&&this.leftRowContainerCtrl!=null&&this.rightRowContainerCtrl!=null&&this.bottomCenterRowContainerCtrl!=null&&this.bottomLeftRowContainerCtrl!=null&&this.bottomRightRowContainerCtrl!=null&&this.topCenterRowContainerCtrl!=null&&this.topLeftRowContainerCtrl!=null&&this.topRightRowContainerCtrl!=null&&this.stickyTopCenterRowContainerCtrl!=null&&this.stickyTopLeftRowContainerCtrl!=null&&this.stickyTopRightRowContainerCtrl!=null&&this.centerHeaderRowContainerCtrl!=null&&this.leftHeaderRowContainerCtrl!=null&&this.rightHeaderRowContainerCtrl!=null&&this.fakeHScrollComp!=null&&this.fakeVScrollComp!=null&&this.gridHeaderCtrl!=null,this.ready){const e=this.createReadyParams();this.readyCallbacks.forEach(t=>t(e)),this.readyCallbacks.length=0}}whenReady(e){this.ready?e(this.createReadyParams()):this.readyCallbacks.push(e)}createReadyParams(){return{centerRowContainerCtrl:this.centerRowContainerCtrl,leftRowContainerCtrl:this.leftRowContainerCtrl,rightRowContainerCtrl:this.rightRowContainerCtrl,bottomCenterRowContainerCtrl:this.bottomCenterRowContainerCtrl,bottomLeftRowContainerCtrl:this.bottomLeftRowContainerCtrl,bottomRightRowContainerCtrl:this.bottomRightRowContainerCtrl,topCenterRowContainerCtrl:this.topCenterRowContainerCtrl,topLeftRowContainerCtrl:this.topLeftRowContainerCtrl,topRightRowContainerCtrl:this.topRightRowContainerCtrl,stickyTopCenterRowContainerCtrl:this.stickyTopCenterRowContainerCtrl,stickyTopLeftRowContainerCtrl:this.stickyTopLeftRowContainerCtrl,stickyTopRightRowContainerCtrl:this.stickyTopRightRowContainerCtrl,centerHeaderRowContainerCtrl:this.centerHeaderRowContainerCtrl,leftHeaderRowContainerCtrl:this.leftHeaderRowContainerCtrl,rightHeaderRowContainerCtrl:this.rightHeaderRowContainerCtrl,fakeHScrollComp:this.fakeHScrollComp,fakeVScrollComp:this.fakeVScrollComp,gridBodyCtrl:this.gridBodyCtrl,gridCtrl:this.gridCtrl,gridHeaderCtrl:this.gridHeaderCtrl}}registerFakeHScrollComp(e){this.fakeHScrollComp=e,this.checkReady()}registerFakeVScrollComp(e){this.fakeVScrollComp=e,this.checkReady()}registerGridHeaderCtrl(e){this.gridHeaderCtrl=e,this.checkReady()}registerCenterRowContainerCtrl(e){this.centerRowContainerCtrl=e,this.checkReady()}registerLeftRowContainerCtrl(e){this.leftRowContainerCtrl=e,this.checkReady()}registerRightRowContainerCtrl(e){this.rightRowContainerCtrl=e,this.checkReady()}registerTopCenterRowContainerCtrl(e){this.topCenterRowContainerCtrl=e,this.checkReady()}registerTopLeftRowContainerCon(e){this.topLeftRowContainerCtrl=e,this.checkReady()}registerTopRightRowContainerCtrl(e){this.topRightRowContainerCtrl=e,this.checkReady()}registerStickyTopCenterRowContainerCtrl(e){this.stickyTopCenterRowContainerCtrl=e,this.checkReady()}registerStickyTopLeftRowContainerCon(e){this.stickyTopLeftRowContainerCtrl=e,this.checkReady()}registerStickyTopRightRowContainerCtrl(e){this.stickyTopRightRowContainerCtrl=e,this.checkReady()}registerBottomCenterRowContainerCtrl(e){this.bottomCenterRowContainerCtrl=e,this.checkReady()}registerBottomLeftRowContainerCtrl(e){this.bottomLeftRowContainerCtrl=e,this.checkReady()}registerBottomRightRowContainerCtrl(e){this.bottomRightRowContainerCtrl=e,this.checkReady()}registerHeaderContainer(e,t){switch(t){case"left":this.leftHeaderRowContainerCtrl=e;break;case"right":this.rightHeaderRowContainerCtrl=e;break;default:this.centerHeaderRowContainerCtrl=e;break}this.checkReady()}registerGridBodyCtrl(e){this.gridBodyCtrl=e,this.checkReady()}registerGridCtrl(e){this.gridCtrl=e,this.checkReady()}getFakeHScrollComp(){return this.fakeHScrollComp}getFakeVScrollComp(){return this.fakeVScrollComp}getGridHeaderCtrl(){return this.gridHeaderCtrl}getGridCtrl(){return this.gridCtrl}getCenterRowContainerCtrl(){return this.centerRowContainerCtrl}getTopCenterRowContainerCtrl(){return this.topCenterRowContainerCtrl}getBottomCenterRowContainerCtrl(){return this.bottomCenterRowContainerCtrl}getStickyTopCenterRowContainerCtrl(){return this.stickyTopCenterRowContainerCtrl}getGridBodyCtrl(){return this.gridBodyCtrl}getHeaderRowContainerCtrls(){return[this.leftHeaderRowContainerCtrl,this.rightHeaderRowContainerCtrl,this.centerHeaderRowContainerCtrl]}getHeaderRowContainerCtrl(e){switch(e){case"left":return this.leftHeaderRowContainerCtrl;case"right":return this.rightHeaderRowContainerCtrl;default:return this.centerHeaderRowContainerCtrl}}};gr.NAME="ctrlsService",gr=Ea=xg([M(Ea.NAME)],gr);var Gg=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let ya=class extends T{constructor(){super(...arguments),this.registry={}}register(e){this.registry[e.controllerName]=e.controllerClass}getInstance(e){const t=this.registry[e];if(t!=null)return new t}};ya=Gg([M("ctrlsFactory")],ya);var en=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Zi extends V{constructor(e,t){super(e),this.direction=t,this.hideTimeout=null}postConstruct(){this.addManagedListener(this.eventService,u.EVENT_SCROLL_VISIBILITY_CHANGED,this.onScrollVisibilityChanged.bind(this)),this.onScrollVisibilityChanged(),this.addOrRemoveCssClass("ag-apple-scrollbar",sl()||ci())}initialiseInvisibleScrollbar(){this.invisibleScrollbar===void 0&&(this.invisibleScrollbar=as(),this.invisibleScrollbar&&(this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles()))}addActiveListenerToggles(){const e=["mouseenter","mousedown","touchstart"],t=["mouseleave","touchend"],i=this.getGui();e.forEach(s=>this.addManagedListener(i,s,()=>this.addOrRemoveCssClass("ag-scrollbar-active",!0))),t.forEach(s=>this.addManagedListener(i,s,()=>this.addOrRemoveCssClass("ag-scrollbar-active",!1)))}onScrollVisibilityChanged(){this.invisibleScrollbar===void 0&&this.initialiseInvisibleScrollbar(),this.animationFrameService.requestAnimationFrame(()=>this.setScrollVisible())}hideAndShowInvisibleScrollAsNeeded(){this.addManagedListener(this.eventService,u.EVENT_BODY_SCROLL,e=>{e.direction===this.direction&&(this.hideTimeout!==null&&(window.clearTimeout(this.hideTimeout),this.hideTimeout=null),this.addOrRemoveCssClass("ag-scrollbar-scrolling",!0))}),this.addManagedListener(this.eventService,u.EVENT_BODY_SCROLL_END,()=>{this.hideTimeout=window.setTimeout(()=>{this.addOrRemoveCssClass("ag-scrollbar-scrolling",!1),this.hideTimeout=null},400)})}attemptSettingScrollPosition(e){const t=this.getViewport();Fr(()=>Jt(t),()=>this.setScrollPosition(e),100)}getViewport(){return this.eViewport}getContainer(){return this.eContainer}onScrollCallback(e){this.addManagedListener(this.getViewport(),"scroll",e)}}en([O("eViewport")],Zi.prototype,"eViewport",void 0),en([O("eContainer")],Zi.prototype,"eContainer",void 0),en([p("scrollVisibleService")],Zi.prototype,"scrollVisibleService",void 0),en([p("ctrlsService")],Zi.prototype,"ctrlsService",void 0),en([p("animationFrameService")],Zi.prototype,"animationFrameService",void 0);var tn=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class oi extends Zi{constructor(){super(oi.TEMPLATE,"horizontal")}postConstruct(){super.postConstruct();const e=this.setFakeHScrollSpacerWidths.bind(this);this.addManagedListener(this.eventService,u.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,u.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,e),this.addManagedListener(this.eventService,u.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedPropertyListener("domLayout",e),this.ctrlsService.registerFakeHScrollComp(this),this.createManagedBean(new Es(t=>this.eContainer.style.width=`${t}px`))}initialiseInvisibleScrollbar(){this.invisibleScrollbar===void 0&&(this.enableRtl=this.gridOptionsService.is("enableRtl"),super.initialiseInvisibleScrollbar(),this.invisibleScrollbar&&this.refreshCompBottom())}onPinnedRowDataChanged(){this.refreshCompBottom()}refreshCompBottom(){if(!this.invisibleScrollbar)return;const e=this.pinnedRowModel.getPinnedBottomTotalHeight();this.getGui().style.bottom=`${e}px`}onScrollVisibilityChanged(){super.onScrollVisibilityChanged(),this.setFakeHScrollSpacerWidths()}setFakeHScrollSpacerWidths(){const e=this.scrollVisibleService.isVerticalScrollShowing();let t=this.columnModel.getDisplayedColumnsRightWidth();const i=!this.enableRtl&&e,s=this.gridOptionsService.getScrollbarWidth();i&&(t+=s),ot(this.eRightSpacer,t),this.eRightSpacer.classList.toggle("ag-scroller-corner",t<=s);let o=this.columnModel.getDisplayedColumnsLeftWidth();this.enableRtl&&e&&(o+=s),ot(this.eLeftSpacer,o),this.eLeftSpacer.classList.toggle("ag-scroller-corner",o<=s)}setScrollVisible(){const e=this.scrollVisibleService.isHorizontalScrollShowing(),t=this.invisibleScrollbar,i=this.gridOptionsService.is("suppressHorizontalScroll"),s=e&&this.gridOptionsService.getScrollbarWidth()||0,n=i?0:s===0&&t?16:s;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),xi(this.getGui(),n),xi(this.eViewport,n),xi(this.eContainer,n),this.setDisplayed(e,{skipAriaHidden:!0})}getScrollPosition(){return Qs(this.getViewport(),this.enableRtl)}setScrollPosition(e){Jt(this.getViewport())||this.attemptSettingScrollPosition(e),Xs(this.getViewport(),e,this.enableRtl)}}oi.TEMPLATE=`<div class="ag-body-horizontal-scroll" aria-hidden="true">
<div class="ag-horizontal-left-spacer" ref="eLeftSpacer"></div>
<div class="ag-body-horizontal-scroll-viewport" ref="eViewport">
<div class="ag-body-horizontal-scroll-container" ref="eContainer"></div>
</div>
<div class="ag-horizontal-right-spacer" ref="eRightSpacer"></div>
</div>`,tn([O("eLeftSpacer")],oi.prototype,"eLeftSpacer",void 0),tn([O("eRightSpacer")],oi.prototype,"eRightSpacer",void 0),tn([p("columnModel")],oi.prototype,"columnModel",void 0),tn([p("pinnedRowModel")],oi.prototype,"pinnedRowModel",void 0),tn([D],oi.prototype,"postConstruct",null);var Ra=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let sn=class extends T{postConstruct(){const e=this.checkContainerWidths.bind(this);this.addManagedListener(this.eventService,u.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,u.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,e),this.addManagedPropertyListener("domLayout",e)}checkContainerWidths(){const e=this.gridOptionsService.isDomLayout("print"),t=e?0:this.columnModel.getDisplayedColumnsLeftWidth(),i=e?0:this.columnModel.getDisplayedColumnsRightWidth();t!=this.leftWidth&&(this.leftWidth=t,this.eventService.dispatchEvent({type:u.EVENT_LEFT_PINNED_WIDTH_CHANGED})),i!=this.rightWidth&&(this.rightWidth=i,this.eventService.dispatchEvent({type:u.EVENT_RIGHT_PINNED_WIDTH_CHANGED}))}getPinnedRightWidth(){return this.rightWidth}getPinnedLeftWidth(){return this.leftWidth}};Ra([p("columnModel")],sn.prototype,"columnModel",void 0),Ra([D],sn.prototype,"postConstruct",null),sn=Ra([M("pinnedWidthService")],sn);var fr=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let Bs=class extends T{constructor(){super(...arguments),this.events=[]}postConstruct(){this.rowModel.getType()=="clientSide"&&(this.clientSideRowModel=this.rowModel)}dispatchExpanded(e){if(this.clientSideRowModel==null){this.eventService.dispatchEvent(e);return}this.events.push(e);const t=()=>{this.clientSideRowModel&&this.clientSideRowModel.onRowGroupOpened(),this.events.forEach(i=>this.eventService.dispatchEvent(i)),this.events=[]};this.dispatchExpandedDebounced==null&&(this.dispatchExpandedDebounced=this.animationFrameService.debounce(t)),this.dispatchExpandedDebounced()}};fr([p("animationFrameService")],Bs.prototype,"animationFrameService",void 0),fr([p("rowModel")],Bs.prototype,"rowModel",void 0),fr([D],Bs.prototype,"postConstruct",null),Bs=fr([M("rowNodeEventThrottle")],Bs);var Di=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Hc=function(l,e){return function(t,i){e(t,i,l)}};function Hg(l){if(typeof l=="number")return l;if(typeof l=="string")return parseInt(l,10)}function Vc(l){return l===!0||l==="true"}let jt=class{constructor(){this.destroyed=!1,this.domDataKey="__AG_"+Math.random().toString(),this.propertyEventService=new gt}get context(){return this.gridOptions.context}agWire(e,t){this.gridOptions.api=e,this.gridOptions.columnApi=t,this.api=e,this.columnApi=t}init(){this.gridOptionLookup=new Set([...j.ALL_PROPERTIES,...j.EVENT_CALLBACKS]);const e=!this.is("suppressAsyncEvents");this.eventService.addGlobalListener(this.globalEventHandler.bind(this),e),this.getScrollbarWidth()}destroy(){this.gridOptions.api=null,this.gridOptions.columnApi=null,this.destroyed=!0}is(e){return Vc(this.gridOptions[e])}get(e){return this.gridOptions[e]}getNum(e){return Hg(this.gridOptions[e])}getCallback(e){return this.mergeGridCommonParams(this.gridOptions[e])}exists(e){return R(this.gridOptions[e])}mergeGridCommonParams(e){return e&&(i=>{const s=i;return s.api=this.api,s.columnApi=this.columnApi,s.context=this.context,e(s)})}set(e,t,i=!1,s={}){if(this.gridOptionLookup.has(e)){const o=this.gridOptions[e];if(i||o!==t){this.gridOptions[e]=t;const n=Object.assign({type:e,currentValue:t,previousValue:o},s);this.propertyEventService.dispatchEvent(n)}}}addEventListener(e,t){this.propertyEventService.addEventListener(e,t)}removeEventListener(e,t){this.propertyEventService.removeEventListener(e,t)}globalEventHandler(e,t){if(this.destroyed)return;const i=j.getCallbackForEvent(e);typeof this.gridOptions[i]=="function"&&this.gridOptions[i](t)}getGridId(){return this.api.getGridId()}getScrollbarWidth(){if(this.scrollbarWidth==null){const t=typeof this.gridOptions.scrollbarWidth=="number"&&this.gridOptions.scrollbarWidth>=0?this.gridOptions.scrollbarWidth:Ed();t!=null&&(this.scrollbarWidth=t,this.eventService.dispatchEvent({type:u.EVENT_SCROLLBAR_WIDTH_CHANGED}))}return this.scrollbarWidth}isRowModelType(e){return this.gridOptions.rowModelType===e||e==="clientSide"&&x(this.gridOptions.rowModelType)}isDomLayout(e){var t;return((t=this.gridOptions.domLayout)!==null&&t!==void 0?t:"normal")===e}isRowSelection(){return this.gridOptions.rowSelection==="single"||this.gridOptions.rowSelection==="multiple"}useAsyncEvents(){return!this.is("suppressAsyncEvents")}isGetRowHeightFunction(){return typeof this.gridOptions.getRowHeight=="function"}getRowHeightForNode(e,t=!1,i){if(i==null&&(i=this.environment.getDefaultRowHeight()),this.isGetRowHeightFunction()){if(t)return{height:i,estimated:!0};const o={node:e,data:e.data},n=this.getCallback("getRowHeight")(o);if(this.isNumeric(n))return n===0&&Y(()=>console.warn("AG Grid: The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead."),"invalidRowHeight"),{height:Math.max(1,n),estimated:!1}}return e.detail&&this.is("masterDetail")?this.getMasterDetailRowHeight():{height:this.gridOptions.rowHeight&&this.isNumeric(this.gridOptions.rowHeight)?this.gridOptions.rowHeight:i,estimated:!1}}getMasterDetailRowHeight(){return this.is("detailRowAutoHeight")?{height:1,estimated:!1}:this.isNumeric(this.gridOptions.detailRowHeight)?{height:this.gridOptions.detailRowHeight,estimated:!1}:{height:300,estimated:!1}}getRowHeightAsNumber(){if(!this.gridOptions.rowHeight||x(this.gridOptions.rowHeight))return this.environment.getDefaultRowHeight();const e=this.gridOptions.rowHeight;return e&&this.isNumeric(e)?(this.environment.setRowHeightVariable(e),e):(console.warn("AG Grid row height must be a number if not using standard row model"),this.environment.getDefaultRowHeight())}isNumeric(e){return!isNaN(e)&&typeof e=="number"&&isFinite(e)}getDomDataKey(){return this.domDataKey}getDomData(e,t){const i=e[this.getDomDataKey()];return i?i[t]:void 0}setDomData(e,t,i){const s=this.getDomDataKey();let o=e[s];x(o)&&(o={},e[s]=o),o[t]=i}getDocument(){let e=null;return this.gridOptions.getDocument&&R(this.gridOptions.getDocument)?e=this.gridOptions.getDocument():this.eGridDiv&&(e=this.eGridDiv.ownerDocument),e&&R(e)?e:document}getWindow(){return this.getDocument().defaultView||window}getRootNode(){return this.eGridDiv.getRootNode()}getAsyncTransactionWaitMillis(){return R(this.gridOptions.asyncTransactionWaitMillis)?this.gridOptions.asyncTransactionWaitMillis:50}isAnimateRows(){return this.is("ensureDomOrder")?!1:this.is("animateRows")}isGroupRowsSticky(){return!(this.is("suppressGroupRowsSticky")||this.is("paginateChildRows")||this.is("groupHideOpenParents"))}isTreeData(){return this.is("treeData")&&A.__assertRegistered(N.RowGroupingModule,"Tree Data",this.api.getGridId())}isMasterDetail(){return this.is("masterDetail")&&A.__assertRegistered(N.MasterDetailModule,"masterDetail",this.api.getGridId())}isEnableRangeSelection(){return this.is("enableRangeSelection")&&A.__isRegistered(N.RangeSelectionModule,this.api.getGridId())}isColumnsSortingCoupledToGroup(){const e=this.gridOptions.autoGroupColumnDef;return this.isRowModelType("clientSide")&&!(e!=null&&e.comparator)&&!this.isTreeData()}getGroupAggFiltering(){const e=this.gridOptions.groupAggFiltering;if(typeof e=="function")return this.getCallback("groupAggFiltering");if(Vc(e))return()=>!0}isGroupMultiAutoColumn(){return this.gridOptions.groupDisplayType?Hr("multipleColumns",this.gridOptions.groupDisplayType):this.is("groupHideOpenParents")}isGroupUseEntireRow(e){return e?!1:this.gridOptions.groupDisplayType?Hr("groupRows",this.gridOptions.groupDisplayType):!1}};Di([p("gridOptions")],jt.prototype,"gridOptions",void 0),Di([p("eventService")],jt.prototype,"eventService",void 0),Di([p("environment")],jt.prototype,"environment",void 0),Di([p("eGridDiv")],jt.prototype,"eGridDiv",void 0),Di([Hc(0,Te("gridApi")),Hc(1,Te("columnApi"))],jt.prototype,"agWire",null),Di([D],jt.prototype,"init",null),Di([he],jt.prototype,"destroy",null),jt=Di([M("gridOptionsService")],jt);var Vg=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let ba=class extends T{getLocaleTextFunc(){const e=this.gridOptionsService.getCallback("getLocaleText");if(e)return(i,s,o)=>e({key:i,defaultValue:s,variableValues:o});const t=this.gridOptionsService.get("localeText");return(i,s,o)=>{let n=t&&t[i];if(n&&o&&o.length){let r=0;for(;!(r>=o.length||n.indexOf("${variable}")===-1);)n=n.replace("${variable}",o[r++])}return n??s}}};ba=Vg([M("localeService")],ba);var Bg=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class on extends Zi{constructor(){super(on.TEMPLATE,"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new Vn(this.eContainer)),this.ctrlsService.registerFakeVScrollComp(this),this.addManagedListener(this.eventService,u.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,this.onRowContainerHeightChanged.bind(this))}setScrollVisible(){const e=this.scrollVisibleService.isVerticalScrollShowing(),t=this.invisibleScrollbar,i=e&&this.gridOptionsService.getScrollbarWidth()||0,s=i===0&&t?16:i;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),ot(this.getGui(),s),ot(this.eViewport,s),ot(this.eContainer,s),this.setDisplayed(e,{skipAriaHidden:!0})}onRowContainerHeightChanged(){const t=this.ctrlsService.getGridBodyCtrl().getBodyViewportElement();this.eViewport.scrollTop!=t.scrollTop&&(this.eViewport.scrollTop=t.scrollTop)}getScrollPosition(){return this.getViewport().scrollTop}setScrollPosition(e){Jt(this.getViewport())||this.attemptSettingScrollPosition(e),this.getViewport().scrollTop=e}}on.TEMPLATE=`<div class="ag-body-vertical-scroll" aria-hidden="true">
<div class="ag-body-vertical-scroll-viewport" ref="eViewport">
<div class="ag-body-vertical-scroll-container" ref="eContainer"></div>
</div>
</div>`,Bg([D],on.prototype,"postConstruct",null);var es=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};const Bc={january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},Wc=["january","february","march","april","may","june","july","august","september","october","november","december"];let ni=class extends T{constructor(){super(...arguments),this.dataTypeDefinitions={},this.isWaitingForRowData=!1,this.isColumnTypeOverrideInDataTypeDefinitions=!1,this.columnStateUpdatesPendingInference={},this.columnStateUpdateListenerDestroyFuncs=[]}init(){this.groupHideOpenParents=this.gridOptionsService.is("groupHideOpenParents"),this.addManagedPropertyListener("groupHideOpenParents",()=>{this.groupHideOpenParents=this.gridOptionsService.is("groupHideOpenParents")}),this.processDataTypeDefinitions(),this.addManagedPropertyListener("dataTypeDefinitions",()=>{this.processDataTypeDefinitions(),this.columnModel.recreateColumnDefs("gridOptionsChanged")})}processDataTypeDefinitions(){var e;const t=this.getDefaultDataTypes();this.dataTypeDefinitions={},Object.entries(t).forEach(([s,o])=>{this.dataTypeDefinitions[s]=Object.assign(Object.assign({},o),{groupSafeValueFormatter:this.createGroupSafeValueFormatter(o)})});const i=(e=this.gridOptionsService.get("dataTypeDefinitions"))!==null&&e!==void 0?e:{};this.dataTypeMatchers={},Object.entries(i).forEach(([s,o])=>{const n=this.processDataTypeDefinition(o,i,[s],t);n&&(this.dataTypeDefinitions[s]=n,o.dataTypeMatcher&&(this.dataTypeMatchers[s]=o.dataTypeMatcher))}),this.checkObjectValueHandlers(t),["dateString","text","number","boolean","date"].forEach(s=>{const o=this.dataTypeMatchers[s];o&&delete this.dataTypeMatchers[s],this.dataTypeMatchers[s]=o??t[s].dataTypeMatcher})}mergeDataTypeDefinitions(e,t){const i=Object.assign(Object.assign({},e),t);return e.columnTypes&&t.columnTypes&&t.appendColumnTypes&&(i.columnTypes=[...this.convertColumnTypes(e.columnTypes),...this.convertColumnTypes(t.columnTypes)]),i}processDataTypeDefinition(e,t,i,s){let o;const n=e.extendsDataType;if(e.columnTypes&&(this.isColumnTypeOverrideInDataTypeDefinitions=!0),e.extendsDataType===e.baseDataType){const r=s[n];if(!this.validateDataTypeDefinition(e,r,n))return;o=this.mergeDataTypeDefinitions(r,e)}else{if(i.includes(n)){Y(()=>console.warn('AG Grid: Data type definition hierarchies (via the "extendsDataType" property) cannot contain circular references.'),"dataTypeExtendsCircularRef");return}const r=t[n];if(!this.validateDataTypeDefinition(e,r,n))return;const a=this.processDataTypeDefinition(r,t,[...i,n],s);if(!a)return;o=this.mergeDataTypeDefinitions(a,e)}return Object.assign(Object.assign({},o),{groupSafeValueFormatter:this.createGroupSafeValueFormatter(o)})}validateDataTypeDefinition(e,t,i){return t?t.baseDataType!==e.baseDataType?(Y(()=>console.warn('AG Grid: The "baseDataType" property of a data type definition must match that of its parent.'),"dataTypeBaseTypesMatch"),!1):!0:(Y(()=>console.warn(`AG Grid: The data type definition ${i} does not exist.`),"dataTypeDefMissing"+i),!1)}createGroupSafeValueFormatter(e){if(e.valueFormatter)return t=>{var i,s;if(!((i=t.node)===null||i===void 0)&&i.group){const o=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(Object.assign(Object.assign({},t),{value:t.value.toNumber()}));if("value"in t.value)return e.valueFormatter(Object.assign(Object.assign({},t),{value:t.value.value}))}}}return}else if(this.groupHideOpenParents&&t.column.isRowGroupActive())return typeof t.value!="string"||!((s=e.dataTypeMatcher)===null||s===void 0)&&s.call(e,t.value)?e.valueFormatter(t):void 0;return e.valueFormatter(t)}}updateColDefAndGetDataTypeDefinitionColumnType(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 n=this.dataTypeDefinitions[s];if(!n){Y(()=>console.warn(`AG Grid: Missing data type definition - "${s}"`),"dataTypeMissing"+s);return}return e.cellDataType=s,n.groupSafeValueFormatter&&(e.valueFormatter=n.groupSafeValueFormatter),n.valueParser&&(e.valueParser=n.valueParser),n.suppressDefaultProperties||this.setColDefPropertiesForBaseDataType(e,n,i),n.columnTypes}updateColDefAndGetColumnType(e,t,i){var s,o;const n=this.updateColDefAndGetDataTypeDefinitionColumnType(e,t,i),r=(o=(s=t.type)!==null&&s!==void 0?s:n)!==null&&o!==void 0?o:e.type;return e.type=r,r?this.convertColumnTypes(r):void 0}addColumnListeners(e){if(!this.isWaitingForRowData)return;const t=this.columnStateUpdatesPendingInference[e.getColId()];if(!t)return;const i=s=>{t.add(s.key)};e.addEventListener(H.EVENT_STATE_UPDATED,i),this.columnStateUpdateListenerDestroyFuncs.push(()=>e.removeEventListener(H.EVENT_STATE_UPDATED,i))}canInferCellDataType(e,t){var i;if(this.rowModel.getType()!=="clientSide")return!1;const s={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(this.doColDefPropsPreventInference(t,s))return!1;const o=t.type===null?e.type:t.type;if(o){const n=(i=this.gridOptionsService.get("columnTypes"))!==null&&i!==void 0?i:{};if(this.convertColumnTypes(o).some(a=>{const d=n[a.trim()];return d&&this.doColDefPropsPreventInference(d,s)}))return!1}return!this.doColDefPropsPreventInference(e,s)}doColDefPropsPreventInference(e,t){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some(([i,s])=>this.doesColDefPropPreventInference(e,t,i,s))}doesColDefPropPreventInference(e,t,i,s){if(!t[i])return!1;const o=e[i];return o===null?(t[i]=!1,!1):s===void 0?!!o:o===s}inferCellDataType(e,t){var i;if(!e)return;let s;const o=this.getInitialData();if(o){const r=e.indexOf(".")>=0&&!this.gridOptionsService.is("suppressFieldDotNotation");s=ss(o,e,r)}else this.initWaitForRowData(t);if(s==null)return;const[n]=(i=Object.entries(this.dataTypeMatchers).find(([r,a])=>a(s)))!==null&&i!==void 0?i:["object"];return n}getInitialData(){const e=this.gridOptionsService.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.addManagedListener(this.eventService,u.EVENT_ROW_DATA_UPDATE_STARTED,s=>{const{firstRowData:o}=s;o&&(i==null||i(),this.isWaitingForRowData=!1,this.processColumnsPendingInference(o,t),this.columnStateUpdatesPendingInference={},t&&this.columnModel.processResizeOperations())})}processColumnsPendingInference(e,t){this.initialData=e;const i=[];this.columnStateUpdateListenerDestroyFuncs.forEach(n=>n()),this.columnStateUpdateListenerDestroyFuncs=[];const s={},o={};Object.entries(this.columnStateUpdatesPendingInference).forEach(([n,r])=>{const a=this.columnModel.getGridColumn(n);if(!a)return;const d=a.getColDef();if(!this.columnModel.resetColumnDefIntoColumn(a))return;const c=a.getColDef();if(t&&c.type&&c.type!==d.type){const h=this.getUpdatedColumnState(a,r);h.rowGroup&&h.rowGroupIndex==null&&(s[n]=h),h.pivot&&h.pivotIndex==null&&(o[n]=h),i.push(h)}}),t&&i.push(...this.columnModel.generateColumnStateForRowGroupAndPivotIndexes(s,o)),i.length&&this.columnModel.applyColumnState({state:i},"cellDataTypeInferred"),this.initialData=null}getUpdatedColumnState(e,t){const i=this.columnModel.getColumnStateFromColDef(e);return t.forEach(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}convertColumnTypes(e){let t=[];return e instanceof Array?e.some(s=>typeof s!="string")?console.warn("AG Grid: if colDef.type is supplied an array it should be of type 'string[]'"):t=e:typeof e=="string"?t=e.split(","):console.warn("AG Grid: colDef.type should be of type 'string' | 'string[]'"),t}getDateStringTypeDefinition(){return this.dataTypeDefinitions.dateString}getDateParserFunction(){return this.getDateStringTypeDefinition().dateParser}getDateFormatterFunction(){return this.getDateStringTypeDefinition().dateFormatter}checkType(e,t){var i;const s=e.getColDef();if(!s.cellDataType||t==null)return!0;const o=(i=this.dataTypeDefinitions[s.cellDataType])===null||i===void 0?void 0:i.dataTypeMatcher;return o?o(t):!0}validateColDef(e){e.cellDataType==="object"&&(e.valueFormatter===this.dataTypeDefinitions.object.groupSafeValueFormatter&&!this.hasObjectValueFormatter&&Y(()=>console.warn('AG Grid: Cell data type is "object" but no value formatter has been provided. Please either provide an object data type definition with a value formatter, or set "colDef.valueFormatter"'),"dataTypeObjectValueFormatter"),e.editable&&e.valueParser===this.dataTypeDefinitions.object.valueParser&&!this.hasObjectValueParser&&Y(()=>console.warn('AG Grid: Cell data type is "object" but no value parser has been provided. Please either provide an object data type definition with a value parser, or set "colDef.valueParser"'),"dataTypeObjectValueParser"))}setColDefPropertiesForBaseDataType(e,t,i){const s=(a,d,c)=>{let h=a.getColDef().valueFormatter;return h===t.groupSafeValueFormatter&&(h=t.valueFormatter),this.valueFormatterService.formatValue(a,d,c,h)},o=A.__isRegistered(N.SetFilterModule,this.context.getGridId()),n=this.localeService.getLocaleTextFunc(),r=a=>{const{filterParams:d}=e;e.filterParams=typeof d=="object"?Object.assign(Object.assign({},d),a):a};switch(e.useValueFormatterForExport=!0,e.useValueParserForImport=!0,t.baseDataType){case"number":{e.cellEditor="agNumberCellEditor",o&&r({comparator:(a,d)=>{const c=a==null?0:parseInt(a),h=d==null?0:parseInt(d);return c===h?0:c>h?1:-1}});break}case"boolean":{e.cellEditor="agCheckboxCellEditor",e.cellRenderer="agCheckboxCellRenderer",e.suppressKeyboardEvent=a=>!!a.colDef.editable&&a.event.key===w.SPACE,r(o?{valueFormatter:a=>R(a.value)?n(String(a.value),a.value?"True":"False"):n("blanks","(Blanks)")}:{maxNumConditions:1,filterOptions:["empty",{displayKey:"true",displayName:"True",predicate:(a,d)=>d,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(a,d)=>d===!1,numberOfInputs:0}]});break}case"date":{e.cellEditor="agDateCellEditor",e.keyCreator=a=>s(a.column,a.node,a.value),o&&r({valueFormatter:a=>{const d=s(a.column,a.node,a.value);return R(d)?d:n("blanks","(Blanks)")},treeList:!0,treeListFormatter:(a,d)=>{if(d===1&&a!=null){const c=Wc[Number(a)-1];return n(c,Bc[c])}return a??n("blanks","(Blanks)")}});break}case"dateString":{e.cellEditor="agDateStringCellEditor",e.keyCreator=d=>s(d.column,d.node,d.value);const a=this.getDateParserFunction();r(o?{valueFormatter:d=>{const c=s(d.column,d.node,d.value);return R(c)?c:n("blanks","(Blanks)")},treeList:!0,treeListPathGetter:d=>{const c=a(d??void 0);return c?[String(c.getFullYear()),String(c.getMonth()+1),String(c.getDate())]:null},treeListFormatter:(d,c)=>{if(c===1&&d!=null){const h=Wc[Number(d)-1];return n(h,Bc[h])}return d??n("blanks","(Blanks)")}}:{comparator:(d,c)=>{const h=a(c);return c==null||h<d?-1:h>d?1:0}});break}case"object":{e.cellEditorParams={useFormatter:!0},e.comparator=(a,d)=>{const c=this.columnModel.getPrimaryColumn(i),h=c==null?void 0:c.getColDef();if(!c||!h)return 0;const g=a==null?"":s(c,null,a),f=d==null?"":s(c,null,d);return g===f?0:g>f?1:-1},e.keyCreator=a=>s(a.column,a.node,a.value),o?r({valueFormatter:a=>{const d=s(a.column,a.node,a.value);return R(d)?d:n("blanks","(Blanks)")}}):e.filterValueGetter=a=>s(a.column,a.node,this.valueService.getValue(a.column,a.node));break}}}getDefaultDataTypes(){const e=i=>!!i.match("^\\d{4}-\\d{2}-\\d{2}$"),t=this.localeService.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:i=>i.newValue===""?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:zs(i.newValue),dataTypeMatcher:i=>typeof i=="string"},boolean:{baseDataType:"boolean",valueParser:i=>i.newValue===""?null:String(i.newValue).toLowerCase()==="true",valueFormatter:i=>i.value==null?"":String(i.value),dataTypeMatcher:i=>typeof i=="boolean"},date:{baseDataType:"date",valueParser:i=>Ct(i.newValue==null?null:String(i.newValue)),valueFormatter:i=>{var s;return i.value==null?"":!(i.value instanceof Date)||isNaN(i.value.getTime())?t("invalidDate","Invalid Date"):(s=st(i.value,!1))!==null&&s!==void 0?s:""},dataTypeMatcher:i=>i instanceof Date},dateString:{baseDataType:"dateString",dateParser:i=>{var s;return(s=Ct(i))!==null&&s!==void 0?s:void 0},dateFormatter:i=>{var s;return(s=st(i??null,!1))!==null&&s!==void 0?s: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=>{var s;return(s=zs(i.value))!==null&&s!==void 0?s:""}}}}};es([p("rowModel")],ni.prototype,"rowModel",void 0),es([p("columnModel")],ni.prototype,"columnModel",void 0),es([p("columnUtils")],ni.prototype,"columnUtils",void 0),es([p("valueService")],ni.prototype,"valueService",void 0),es([p("valueFormatterService")],ni.prototype,"valueFormatterService",void 0),es([D],ni.prototype,"init",null),ni=es([M("dataTypeService")],ni);var kc=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let Cr=class extends T{parseValue(e,t,i,s){const o=e.getColDef(),n={node:t,data:t==null?void 0:t.data,oldValue:s,newValue:i,colDef:o,column:e,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context},r=o.valueParser;return R(r)?typeof r=="function"?r(n):this.expressionService.evaluate(r,n):i}};kc([p("expressionService")],Cr.prototype,"expressionService",void 0),Cr=kc([M("valueParserService")],Cr);class Uc{constructor(e,t,i){if(!t){console.error("AG Grid: no gridOptions provided to the grid");return}this.gridOptions=t,new kg().create(e,t,s=>{const o=new Ms(e);s.createBean(o)},void 0,i)}destroy(){this.gridOptions&&this.gridOptions.api&&this.gridOptions.api.destroy()}}let Wg=1;class kg{create(e,t,i,s,o){var n;const r=!!t.debug,a=(n=t.gridId)!==null&&n!==void 0?n:String(Wg++),d=this.getRegisteredModules(o,a),c=this.createBeansList(t.rowModelType,d,a),h=this.createProvidedBeans(e,t,o);if(!c)return;const g={providedBeanInstances:h,beanClasses:c,debug:r,gridId:a},f=new la("AG Grid",()=>t.debug),m=new la("Context",()=>g.debug),C=new yu(g,m),y=C.getBean("beans");this.registerModuleUserComponents(y,d),this.registerStackComponents(y,d),this.registerControllers(y,d),i(C),y.ctrlsService.whenReady(()=>{this.setColumnsAndData(y),this.dispatchGridReadyEvent(y);const v=A.__isRegistered(N.EnterpriseCoreModule,a);f.log(`initialised successfully, enterprise = ${v}`)}),s&&s(C)}registerControllers(e,t){t.forEach(i=>{i.controllers&&i.controllers.forEach(s=>e.ctrlsFactory.register(s))})}registerStackComponents(e,t){const i=this.createAgStackComponentsList(t);e.agStackComponentsRegistry.setupComponents(i)}getRegisteredModules(e,t){const i=e?e.modules:null,s=A.__getRegisteredModules(t),o=[],n={},r=(a,d,c)=>{(g=>{n[g.moduleName]||(n[g.moduleName]=!0,o.push(g),A.__register(g,a,c))})(d),d.dependantModules&&d.dependantModules.forEach(g=>r(a,g,c))};return i&&i.forEach(a=>r(!0,a,t)),s&&s.forEach(a=>r(!A.__isPackageBased(),a,void 0)),o}registerModuleUserComponents(e,t){this.extractModuleEntity(t,s=>s.userComponents?s.userComponents:[]).forEach(s=>{e.userComponentRegistry.registerDefaultComponent(s.componentName,s.componentClass)})}createProvidedBeans(e,t,i){let s=i?i.frameworkOverrides:null;x(s)&&(s=new yg);const o={gridOptions:t,eGridDiv:e,globalEventListener:i?i.globalEventListener:null,frameworkOverrides:s};return i&&i.providedBeanInstances&&Object.assign(o,i.providedBeanInstances),o}createAgStackComponentsList(e){let t=[{componentName:"AgCheckbox",componentClass:gi},{componentName:"AgRadioButton",componentClass:kd},{componentName:"AgToggleButton",componentClass:pg},{componentName:"AgInputTextField",componentClass:Gi},{componentName:"AgInputTextArea",componentClass:gg},{componentName:"AgInputNumberField",componentClass:Al},{componentName:"AgInputDateField",componentClass:fg},{componentName:"AgInputRange",componentClass:Cg},{componentName:"AgSelect",componentClass:pi},{componentName:"AgSlider",componentClass:Si},{componentName:"AgGridBody",componentClass:yt},{componentName:"AgHeaderRoot",componentClass:Lo},{componentName:"AgSortIndicator",componentClass:Ue},{componentName:"AgPagination",componentClass:Xe},{componentName:"AgOverlayWrapper",componentClass:kt},{componentName:"AgGroupComponent",componentClass:Fe},{componentName:"AgPanel",componentClass:Tt},{componentName:"AgDialog",componentClass:Ac},{componentName:"AgRowContainer",componentClass:ji},{componentName:"AgFakeHorizontalScroll",componentClass:oi},{componentName:"AgFakeVerticalScroll",componentClass:on}];const i=this.extractModuleEntity(e,s=>s.agStackComponents?s.agStackComponents:[]);return t=t.concat(i),t}createBeansList(e="clientSide",t,i){const s=t.filter(d=>!d.rowModel||d.rowModel===e),o={clientSide:N.ClientSideRowModelModule,infinite:N.InfiniteRowModelModule,serverSide:N.ServerSideRowModelModule,viewport:N.ViewportRowModelModule};if(!o[e]){console.error("AG Grid: could not find row model for rowModelType = "+e);return}if(!A.__assertRegistered(o[e],`rowModelType = '${e}'`,i))return;const n=[B,Hs,Ca,Jo,Ko,K,po,dr,Yo,Zl,fi,_s,Io,ba,rs,xo,go,Br,gt,jt,Ri,Xi,Gt,ce,$i,Go,Qe,or,os,ra,Qi,Ee,lr,Ti,nr,Vr,Yi,Ki,q,Uo,ae,ys,qo,bi,Jn,tr,vo,zo,aa,$o,ur,Ks,Ns,As,ct,Wr,wa,Zo,wi,Vs,gr,sn,Bs,ya,ni,Cr],r=this.extractModuleEntity(s,d=>d.beans?d.beans:[]);n.push(...r);const a=[];return n.forEach(d=>{a.indexOf(d)<0&&a.push(d)}),a}extractModuleEntity(e,t){return[].concat(...e.map(t))}setColumnsAndData(e){const t=e.gridOptionsService.get("columnDefs");e.columnModel.setColumnDefs(t||[],"gridInitializing"),e.rowModel.start()}dispatchGridReadyEvent(e){const t={type:u.EVENT_GRID_READY};e.eventService.dispatchEvent(t)}}var jc;(function(l){l.InsideBase="insideBase",l.InsideEnd="insideEnd",l.Center="center",l.OutsideEnd="outsideEnd"})(jc||(jc={}));/**
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue
* @version v30.0.5
* @link https://www.ag-grid.com/
* @license MIT
*/const Ws=typeof global>"u"?{}:global;Ws.HTMLElement=typeof HTMLElement>"u"?{}:HTMLElement,Ws.HTMLButtonElement=typeof HTMLButtonElement>"u"?{}:HTMLButtonElement,Ws.HTMLSelectElement=typeof HTMLSelectElement>"u"?{}:HTMLSelectElement,Ws.HTMLInputElement=typeof HTMLInputElement>"u"?{}:HTMLInputElement,Ws.Node=typeof Node>"u"?{}:Node,Ws.MouseEvent=typeof MouseEvent>"u"?{}:MouseEvent;class Oi{constructor(e,t,i,s,o,n){this.nextId=0,this.allNodesMap={},this.rootNode=e,this.gridOptionsService=t,this.eventService=i,this.columnModel=s,this.beans=n,this.selectionService=o,this.rootNode.group=!0,this.rootNode.level=-1,this.rootNode.id=Oi.ROOT_NODE_ID,this.rootNode.allLeafChildren=[],this.rootNode.childrenAfterGroup=[],this.rootNode.childrenAfterSort=[],this.rootNode.childrenAfterAggFilter=[],this.rootNode.childrenAfterFilter=[],this.postConstruct()}postConstruct(){this.suppressParentsInRowNodes=this.gridOptionsService.is("suppressParentsInRowNodes"),this.isRowMasterFunc=this.gridOptionsService.get("isRowMaster"),this.doingTreeData=this.gridOptionsService.isTreeData(),this.doingMasterDetail=this.gridOptionsService.isMasterDetail()}getCopyOfNodesMap(){return G.cloneObject(this.allNodesMap)}getRowNode(e){return this.allNodesMap[e]}setRowData(e){if(typeof e=="string"){console.warn("AG Grid: rowData must be an array, however you passed in a string. If you are loading JSON, make sure you convert the JSON string to JavaScript objects first");return}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=>this.createNode(s,this.rootNode,Oi.TOP_LEVEL)):(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,t){this.dispatchRowDataUpdateStartedEvent(e.add);const i={remove:[],update:[],add:[]},s=[];return this.executeRemove(e,i,s),this.executeUpdate(e,i,s),this.executeAdd(e,i),this.updateSelection(s,"rowDataChanged"),t&&G.sortRowNodesByOrder(this.rootNode.allLeafChildren,t),i}dispatchRowDataUpdateStartedEvent(e){const t={type:u.EVENT_ROW_DATA_UPDATE_STARTED,firstRowData:e!=null&&e.length?e[0]:null};this.eventService.dispatchEvent(t)}updateSelection(e,t){const i=e.length>0;if(i&&this.selectionService.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t}),this.selectionService.updateGroupsFromChildrenSelections(t),i){const s={type:u.EVENT_SELECTION_CHANGED,source:t};this.eventService.dispatchEvent(s)}}executeAdd(e,t){var i;const{add:s,addIndex:o}=e;if(G.missingOrEmpty(s))return;const n=s.map(r=>this.createNode(r,this.rootNode,Oi.TOP_LEVEL));if(typeof o=="number"&&o>=0){const{allLeafChildren:r}=this.rootNode,a=r.length;let d=o;if(this.doingTreeData&&o>0&&a>0){for(let g=0;g<a;g++)if(((i=r[g])===null||i===void 0?void 0:i.rowIndex)==o-1){d=g+1;break}}const c=r.slice(0,d),h=r.slice(d,r.length);this.rootNode.allLeafChildren=[...c,...n,...h]}else this.rootNode.allLeafChildren=[...this.rootNode.allLeafChildren,...n];this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren),t.add=n}executeRemove(e,t,i){const{remove:s}=e;if(G.missingOrEmpty(s))return;const o={};s.forEach(n=>{const r=this.lookupRowNode(n);r&&(r.isSelected()&&i.push(r),r.clearRowTopAndRowIndex(),o[r.id]=!0,delete this.allNodesMap[r.id],t.remove.push(r))}),this.rootNode.allLeafChildren=this.rootNode.allLeafChildren.filter(n=>!o[n.id]),this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren)}executeUpdate(e,t,i){const{update:s}=e;G.missingOrEmpty(s)||s.forEach(o=>{const n=this.lookupRowNode(o);n&&(n.updateData(o),!n.selectable&&n.isSelected()&&i.push(n),this.setMasterForRow(n,o,Oi.TOP_LEVEL,!1),t.update.push(n))})}lookupRowNode(e){const t=this.gridOptionsService.getCallback("getRowId");let i;if(t){const s=t({data:e,level:0});if(i=this.allNodesMap[s],!i)return console.error(`AG Grid: could not find row id=${s}, data item was not found for this id`),null}else if(i=this.rootNode.allLeafChildren.find(s=>s.data===e),!i)return console.error("AG Grid: could not find data item as object was not found",e),console.error("Consider using getRowId to help the Grid find matching row data"),null;return i||null}createNode(e,t,i){const s=new P(this.beans);return s.group=!1,this.setMasterForRow(s,e,i,!0),t&&!this.suppressParentsInRowNodes&&(s.parent=t),s.level=i,s.setDataAndId(e,this.nextId.toString()),this.allNodesMap[s.id]&&console.warn(`AG Grid: duplicate node id '${s.id}' detected from getRowId callback, this could cause issues in your grid.`),this.allNodesMap[s.id]=s,this.nextId++,s}setMasterForRow(e,t,i,s){if(this.doingTreeData)e.setMaster(!1),s&&(e.expanded=!1);else if(this.doingMasterDetail?this.isRowMasterFunc?e.setMaster(this.isRowMasterFunc(t)):e.setMaster(!0):e.setMaster(!1),s){const o=this.columnModel.getRowGroupColumns(),n=o?o.length:0,r=i+n;e.expanded=e.master?this.isExpanded(r):!1}}isExpanded(e){const t=this.gridOptionsService.getNum("groupDefaultExpanded");return t===-1?!0:e<t}}Oi.TOP_LEVEL=0,Oi.ROOT_NODE_ID="ROOT_NODE_ID";var xe=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},zt;(function(l){l[l.Normal=0]="Normal",l[l.AfterFilter=1]="AfterFilter",l[l.AfterFilterAndSort=2]="AfterFilterAndSort",l[l.PivotNodes=3]="PivotNodes"})(zt||(zt={}));let be=class extends T{constructor(){super(...arguments),this.onRowHeightChanged_debounced=G.debounce(this.onRowHeightChanged.bind(this),100),this.rowsToDisplay=[]}init(){const e=this.refreshModel.bind(this,{step:J.EVERYTHING}),t=!this.gridOptionsService.is("suppressAnimationFrame"),i=this.refreshModel.bind(this,{step:J.EVERYTHING,afterColumnsChanged:!0,keepRenderedRows:!0,animate:t});this.addManagedListener(this.eventService,u.EVENT_NEW_COLUMNS_LOADED,i),this.addManagedListener(this.eventService,u.EVENT_COLUMN_ROW_GROUP_CHANGED,e),this.addManagedListener(this.eventService,u.EVENT_COLUMN_VALUE_CHANGED,this.onValueChanged.bind(this)),this.addManagedListener(this.eventService,u.EVENT_COLUMN_PIVOT_CHANGED,this.refreshModel.bind(this,{step:J.PIVOT})),this.addManagedListener(this.eventService,u.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,u.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,u.EVENT_COLUMN_PIVOT_MODE_CHANGED,e),this.addManagedListener(this.eventService,u.EVENT_GRID_STYLES_CHANGED,this.onGridStylesChanges.bind(this));const s=this.refreshModel.bind(this,{step:J.MAP,keepRenderedRows:!0,animate:t});this.addManagedPropertyListener("groupRemoveSingleChildren",s),this.addManagedPropertyListener("groupRemoveLowestSingleChildren",s),this.rootNode=new P(this.beans),this.nodeManager=new Oi(this.rootNode,this.gridOptionsService,this.eventService,this.columnModel,this.selectionService,this.beans)}start(){const e=this.gridOptionsService.get("rowData");e&&this.setRowData(e)}ensureRowHeightsValid(e,t,i,s){let o,n=!1;do{o=!1;const r=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),d=Math.max(r,i),c=Math.min(a,s);for(let h=d;h<=c;h++){const g=this.getRow(h);if(g.rowHeightEstimated){const f=this.gridOptionsService.getRowHeightForNode(g);g.setRowHeight(f.height),o=!0,n=!0}}o&&this.setRowTopAndRowIndex()}while(o);return n}setRowTopAndRowIndex(){const e=this.environment.getDefaultRowHeight();let t=0;const i=new Set,s=this.gridOptionsService.isDomLayout("normal");for(let o=0;o<this.rowsToDisplay.length;o++){const n=this.rowsToDisplay[o];if(n.id!=null&&i.add(n.id),n.rowHeight==null){const r=this.gridOptionsService.getRowHeightForNode(n,s,e);n.setRowHeight(r.height,r.estimated)}n.setRowTop(t),n.setRowIndex(o),t+=n.rowHeight}return i}clearRowTopAndRowIndex(e,t){const i=e.isActive(),s=n=>{n&&n.id!=null&&!t.has(n.id)&&n.clearRowTopAndRowIndex()},o=n=>{if(s(n),s(n.detailNode),s(n.sibling),n.hasChildren()&&n.childrenAfterGroup){const r=n.level==-1;i&&!r&&!n.expanded||n.childrenAfterGroup.forEach(o)}};o(this.rootNode)}ensureRowsAtPixel(e,t,i=0){const s=this.getRowIndexAtPixel(t),o=this.getRow(s),n=!this.gridOptionsService.is("suppressAnimationFrame");return o===e[0]?!1:(e.forEach(r=>{G.removeFromArray(this.rootNode.allLeafChildren,r)}),e.forEach((r,a)=>{G.insertIntoArray(this.rootNode.allLeafChildren,r,Math.max(s+i,0)+a)}),this.refreshModel({step:J.EVERYTHING,keepRenderedRows:!0,keepEditingRows:!0,animate:n}),!0)}highlightRowAtPixel(e,t){const i=t!=null?this.getRowIndexAtPixel(t):null,s=i!=null?this.getRow(i):null;if(!s||!e||s===e||t==null){this.lastHighlightedRow&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null);return}const o=this.getHighlightPosition(t,s);this.lastHighlightedRow&&this.lastHighlightedRow!==s&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null),s.setHighlighted(o),this.lastHighlightedRow=s}getHighlightPosition(e,t){if(!t){const o=this.getRowIndexAtPixel(e);if(t=this.getRow(o||0),!t)return rt.Below}const{rowTop:i,rowHeight:s}=t;return e-i<s/2?rt.Above:rt.Below}getLastHighlightedRowNode(){return this.lastHighlightedRow}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay?this.rowsToDisplay.length:0}getTopLevelRowCount(){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return 1;const t=this.rootNode.childrenAfterAggFilter;return t?t.length:0}getTopLevelRowDisplayedIndex(e){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return e;let i=this.rootNode.childrenAfterSort[e];if(this.gridOptionsService.is("groupHideOpenParents"))for(;i.expanded&&i.childrenAfterSort&&i.childrenAfterSort.length>0;)i=i.childrenAfterSort[0];return i.rowIndex}getRowBounds(e){if(G.missing(this.rowsToDisplay))return null;const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){const e=this.gridOptionsService.isAnimateRows();this.refreshModel({step:J.MAP,keepRenderedRows:!0,animate:e})}onFilterChanged(e){if(e.afterDataChange)return;const t=this.gridOptionsService.isAnimateRows(),s=e.columns.length===0||e.columns.some(o=>o.isPrimary())?J.FILTER:J.FILTER_AGGREGATES;this.refreshModel({step:s,keepRenderedRows:!0,animate:t})}onSortChanged(){const e=this.gridOptionsService.isAnimateRows();this.refreshModel({step:J.SORT,keepRenderedRows:!0,animate:e,keepEditingRows:!0})}getType(){return"clientSide"}onValueChanged(){this.columnModel.isPivotActive()?this.refreshModel({step:J.PIVOT}):this.refreshModel({step:J.AGGREGATE})}createChangePath(e){const t=G.missingOrEmpty(e),i=new ta(!1,this.rootNode);return(t||this.gridOptionsService.isTreeData())&&i.setInactive(),i}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gridOptionsService.is("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=J.EVERYTHING;const i={everything:J.EVERYTHING,group:J.EVERYTHING,filter:J.FILTER,map:J.MAP,aggregate:J.AGGREGATE,sort:J.SORT,pivot:J.PIVOT};if(G.exists(e)&&(t=i[e]),G.missing(t)){console.error(`AG Grid: invalid step ${e}, available steps are ${Object.keys(i).join(", ")}`);return}const s=!this.gridOptionsService.is("suppressAnimationFrame");return{step:t,keepRenderedRows:!0,keepEditingRows:!0,animate:s}}refreshModel(e){let t=typeof e=="object"&&"step"in e?e:this.buildRefreshModelParams(e);if(!t||this.isSuppressModelUpdateAfterUpdateTransaction(t))return;const i=this.createChangePath(t.rowNodeTransactions);switch(t.step){case J.EVERYTHING:this.doRowGrouping(t.groupState,t.rowNodeTransactions,t.rowNodeOrder,i,!!t.afterColumnsChanged);case J.FILTER:this.doFilter(i);case J.PIVOT:this.doPivot(i);case J.AGGREGATE:this.doAggregate(i);case J.FILTER_AGGREGATES:this.doFilterAggregates(i);case J.SORT:this.doSort(t.rowNodeTransactions,i);case J.MAP:this.doRowsToDisplay()}const s=this.setRowTopAndRowIndex();this.clearRowTopAndRowIndex(i,s);const o={type:u.EVENT_MODEL_UPDATED,animate:t.animate,keepRenderedRows:t.keepRenderedRows,newData:t.newData,newPage:!1,keepUndoRedoStack:t.keepUndoRedoStack};this.eventService.dispatchEvent(o)}isEmpty(){const e=G.missing(this.rootNode.allLeafChildren)||this.rootNode.allLeafChildren.length===0;return G.missing(this.rootNode)||e||!this.columnModel.isReady()}isRowsToRender(){return G.exists(this.rowsToDisplay)&&this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let i=!t,s=!1;const o=[],n=this.gridOptionsService.is("groupSelectsChildren");return this.forEachNodeAfterFilterAndSort(r=>{if(s)return;if(i&&(r===t||r===e)&&(s=!0,r.group&&n)){o.push(...r.allLeafChildren);return}if(!i){if(r!==t&&r!==e)return;i=!0}if(!r.group||!n){o.push(r);return}}),o}setDatasource(e){console.error("AG Grid: should never call setDatasource on clientSideRowController")}getTopLevelNodes(){return this.rootNode?this.rootNode.childrenAfterGroup:null}getRootNode(){return this.rootNode}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){if(this.isEmpty()||this.rowsToDisplay.length===0)return-1;let t=0,i=this.rowsToDisplay.length-1;if(e<=0)return 0;if(G.last(this.rowsToDisplay).rowTop<=e)return this.rowsToDisplay.length-1;let o=-1,n=-1;for(;;){const r=Math.floor((t+i)/2),a=this.rowsToDisplay[r];if(this.isRowInPixel(a,e)||(a.rowTop<e?t=r+1:a.rowTop>e&&(i=r-1),o===t&&n===i))return r;o=t,n=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:zt.Normal,index:0,includeFooterNodes:t})}forEachNodeAfterFilter(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterAggFilter||[]],callback:e,recursionType:zt.AfterFilter,index:0,includeFooterNodes:t})}forEachNodeAfterFilterAndSort(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterSort||[]],callback:e,recursionType:zt.AfterFilterAndSort,index:0,includeFooterNodes:t})}forEachPivotNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[this.rootNode],callback:e,recursionType:zt.PivotNodes,index:0,includeFooterNodes:t})}recursivelyWalkNodesAndCallback(e){var t;const{nodes:i,callback:s,recursionType:o,includeFooterNodes:n}=e;let{index:r}=e;const a=i[0];n&&(!((t=a==null?void 0:a.parent)===null||t===void 0)&&t.sibling)&&i.push(a.parent.sibling);for(let d=0;d<i.length;d++){const c=i[d];if(s(c,r++),c.hasChildren()&&!c.footer){let h=null;switch(o){case zt.Normal:h=c.childrenAfterGroup;break;case zt.AfterFilter:h=c.childrenAfterAggFilter;break;case zt.AfterFilterAndSort:h=c.childrenAfterSort;break;case zt.PivotNodes:h=c.leafGroup?null:c.childrenAfterSort;break}h&&(r=this.recursivelyWalkNodesAndCallback({nodes:[...h],callback:s,recursionType:o,index:r,includeFooterNodes:n}))}}return r}doAggregate(e){this.aggregationStage&&this.aggregationStage.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.gridOptionsService.isTreeData(),i=this.columnModel.isPivotActive(),s=r=>{r&&r.forEach(a=>{const d=()=>{a.expanded=e,s(a.childrenAfterGroup)};if(t){G.exists(a.childrenAfterGroup)&&d();return}if(i){!a.leafGroup&&d();return}a.group&&d()})};this.rootNode&&s(this.rootNode.childrenAfterGroup),this.refreshModel({step:J.MAP});const o=e?"expandAll":"collapseAll",n={type:u.EVENT_EXPAND_COLLAPSE_ALL,source:o};this.eventService.dispatchEvent(n)}doSort(e,t){this.sortStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,changedPath:t})}doRowGrouping(e,t,i,s,o){if(this.groupStage){if(t?this.groupStage.execute({rowNode:this.rootNode,rowNodeTransactions:t,rowNodeOrder:i,changedPath:s}):(this.groupStage.execute({rowNode:this.rootNode,changedPath:s,afterColumnsChanged:o}),this.restoreGroupState(e)),this.gridOptionsService.is("groupSelectsChildren")&&this.selectionService.updateGroupsFromChildrenSelections("rowGroupChanged",s)){const r={type:u.EVENT_SELECTION_CHANGED,source:"rowGroupChanged"};this.eventService.dispatchEvent(r)}}else this.rootNode.childrenAfterGroup=this.rootNode.allLeafChildren,this.rootNode.sibling&&(this.rootNode.sibling.childrenAfterGroup=this.rootNode.childrenAfterGroup),this.rootNode.updateHasChildren()}restoreGroupState(e){e&&G.traverseNodesWithKey(this.rootNode.childrenAfterGroup,(t,i)=>{typeof e[i]=="boolean"&&(t.expanded=e[i])})}doFilter(e){this.filterStage.execute({rowNode:this.rootNode,changedPath:e})}doPivot(e){this.pivotStage&&this.pivotStage.execute({rowNode:this.rootNode,changedPath:e})}getGroupState(){if(!this.rootNode.childrenAfterGroup||!this.gridOptionsService.is("rememberGroupStateWhenNewData"))return null;const e={};return G.traverseNodesWithKey(this.rootNode.childrenAfterGroup,(t,i)=>e[i]=t.expanded),e}getCopyOfNodesMap(){return this.nodeManager.getCopyOfNodesMap()}getRowNode(e){if(typeof e=="string"&&e.indexOf(P.ID_PREFIX_ROW_GROUP)==0){let i;return this.forEachNode(s=>{s.id===e&&(i=s)}),i}return this.nodeManager.getRowNode(e)}setRowData(e){const t=this.getGroupState();this.nodeManager.setRowData(e),this.selectionService.reset(),this.filterManager.onNewRowsLoaded("rowDataUpdated");const i={type:u.EVENT_ROW_DATA_UPDATED};this.eventService.dispatchEvent(i),this.refreshModel({step:J.EVERYTHING,groupState:t,newData:!0})}batchUpdateRowData(e,t){if(this.applyAsyncTransactionsTimeout==null){this.rowDataTransactionBatch=[];const i=this.gridOptionsService.getAsyncTransactionWaitMillis();this.applyAsyncTransactionsTimeout=window.setTimeout(()=>{this.executeBatchUpdateRowData()},i)}this.rowDataTransactionBatch.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){this.applyAsyncTransactionsTimeout!=null&&(clearTimeout(this.applyAsyncTransactionsTimeout),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){this.valueCache.onDataChanged();const e=[],t=[];let i=!1;if(this.rowDataTransactionBatch&&this.rowDataTransactionBatch.forEach(s=>{const o=this.nodeManager.updateRowData(s.rowDataTransaction,void 0);t.push(o),s.callback&&e.push(s.callback.bind(null,o)),typeof s.rowDataTransaction.addIndex=="number"&&(i=!0)}),this.commonUpdateRowData(t,void 0,i),e.length>0&&window.setTimeout(()=>{e.forEach(s=>s())},0),t.length>0){const s={type:u.EVENT_ASYNC_TRANSACTIONS_FLUSHED,results:t};this.eventService.dispatchEvent(s)}this.rowDataTransactionBatch=null,this.applyAsyncTransactionsTimeout=void 0}updateRowData(e,t){this.valueCache.onDataChanged();const i=this.nodeManager.updateRowData(e,t),s=typeof e.addIndex=="number";return this.commonUpdateRowData([i],t,s),i}createRowNodeOrder(){if(this.gridOptionsService.is("suppressMaintainUnsortedOrder"))return;const t={};if(this.rootNode&&this.rootNode.allLeafChildren)for(let i=0;i<this.rootNode.allLeafChildren.length;i++){const s=this.rootNode.allLeafChildren[i];t[s.id]=i}return t}commonUpdateRowData(e,t,i){const s=!this.gridOptionsService.is("suppressAnimationFrame");i&&(t=this.createRowNodeOrder()),this.refreshModel({step:J.EVERYTHING,rowNodeTransactions:e,rowNodeOrder:t,keepRenderedRows:!0,keepEditingRows:!0,animate:s}),this.filterManager.onNewRowsLoaded("rowDataUpdated");const o={type:u.EVENT_ROW_DATA_UPDATED};this.eventService.dispatchEvent(o)}doRowsToDisplay(){this.rowsToDisplay=this.flattenStage.execute({rowNode:this.rootNode})}onRowHeightChanged(){this.refreshModel({step:J.MAP,keepRenderedRows:!0,keepEditingRows:!0,keepUndoRedoStack:!0})}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}resetRowHeights(){const e=this.resetRowHeightsForAllRowNodes();this.rootNode.setRowHeight(this.rootNode.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),e=!0}),e}onGridStylesChanges(){this.columnModel.isAutoRowHeightActive()||this.resetRowHeights()}};xe([p("columnModel")],be.prototype,"columnModel",void 0),xe([p("selectionService")],be.prototype,"selectionService",void 0),xe([p("filterManager")],be.prototype,"filterManager",void 0),xe([p("valueCache")],be.prototype,"valueCache",void 0),xe([p("beans")],be.prototype,"beans",void 0),xe([p("filterStage")],be.prototype,"filterStage",void 0),xe([p("sortStage")],be.prototype,"sortStage",void 0),xe([p("flattenStage")],be.prototype,"flattenStage",void 0),xe([X("groupStage")],be.prototype,"groupStage",void 0),xe([X("aggregationStage")],be.prototype,"aggregationStage",void 0),xe([X("pivotStage")],be.prototype,"pivotStage",void 0),xe([X("filterAggregatesStage")],be.prototype,"filterAggregatesStage",void 0),xe([D],be.prototype,"init",null),be=xe([M("rowModel")],be);var zc=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let mr=class extends T{execute(e){const{changedPath:t}=e;this.filterService.filter(t)}};zc([p("filterService")],mr.prototype,"filterService",void 0),mr=zc([M("filterStage")],mr);var vr=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let ks=class extends T{execute(e){const t=this.sortController.getSortOptions(),i=G.exists(t)&&t.length>0,s=i&&G.exists(e.rowNodeTransactions)&&this.gridOptionsService.is("deltaSort"),o=t.some(n=>!!this.columnModel.getGroupDisplayColumnForGroup(n.column.getId()));this.sortService.sort(t,i,s,e.rowNodeTransactions,e.changedPath,o)}};vr([p("sortService")],ks.prototype,"sortService",void 0),vr([p("sortController")],ks.prototype,"sortController",void 0),vr([p("columnModel")],ks.prototype,"columnModel",void 0),ks=vr([M("sortStage")],ks);var Ta=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let nn=class extends T{execute(e){const t=e.rowNode,i=[],s={value:0},o=this.columnModel.isPivotMode(),n=o&&t.leafGroup,r=n?[t]:t.childrenAfterSort;this.recursivelyAddToRowsToDisplay(r,i,s,o,0);const a=i.length>0;return!n&&a&&this.gridOptionsService.is("groupIncludeTotalFooter")&&(t.createFooter(),this.addRowNodeToRowsToDisplay(t.sibling,i,s,0)),i}recursivelyAddToRowsToDisplay(e,t,i,s,o){if(G.missingOrEmpty(e))return;const n=this.gridOptionsService.is("groupHideOpenParents"),r=this.gridOptionsService.is("groupRemoveSingleChildren"),a=!r&&this.gridOptionsService.is("groupRemoveLowestSingleChildren");for(let d=0;d<e.length;d++){const c=e[d],h=c.hasChildren(),g=s&&!h,f=r&&h&&c.childrenAfterGroup.length===1,m=a&&h&&c.leafGroup&&c.childrenAfterGroup.length===1,C=s&&c.leafGroup,y=n&&c.expanded&&!c.master&&!C;if(!g&&!y&&!f&&!m&&this.addRowNodeToRowsToDisplay(c,t,i,o),!(s&&c.leafGroup)){if(h){const E=f||m;if(c.expanded||E){const b=E?o:o+1;this.recursivelyAddToRowsToDisplay(c.childrenAfterSort,t,i,s,b),this.gridOptionsService.is("groupIncludeFooter")&&this.addRowNodeToRowsToDisplay(c.sibling,t,i,b)}}else if(c.master&&c.expanded){const E=this.createDetailNode(c);this.addRowNodeToRowsToDisplay(E,t,i,o)}}}}addRowNodeToRowsToDisplay(e,t,i,s){const o=this.gridOptionsService.isGroupMultiAutoColumn();t.push(e),e.setUiLevel(o?0:s)}createDetailNode(e){if(G.exists(e.detailNode))return e.detailNode;const t=new P(this.beans);return t.detail=!0,t.selectable=!1,t.parent=e,G.exists(e.id)&&(t.id="detail_"+e.id),t.data=e.data,t.level=e.level+1,e.detailNode=t,t}};Ta([p("columnModel")],nn.prototype,"columnModel",void 0),Ta([p("beans")],nn.prototype,"beans",void 0),nn=Ta([M("flattenStage")],nn);var wr=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let Us=class extends T{init(){this.postSortFunc=this.gridOptionsService.getCallback("postSortRows")}sort(e,t,i,s,o,n){const r=this.gridOptionsService.is("groupMaintainOrder"),a=this.columnModel.getAllGridColumns().some(g=>g.isRowGroupActive());let d={};i&&s&&(d=this.calculateDirtyNodes(s));const c=this.columnModel.isPivotMode(),h=g=>{this.pullDownGroupDataForHideOpenParents(g.childrenAfterAggFilter,!0);const f=c&&g.leafGroup;if(r&&a&&!g.leafGroup&&!n){const C=g.childrenAfterAggFilter.slice(0);if(g.childrenAfterSort){const y={};g.childrenAfterSort.forEach((v,E)=>{y[v.id]=E}),C.sort((v,E)=>{var b,_;return((b=y[v.id])!==null&&b!==void 0?b:0)-((_=y[E.id])!==null&&_!==void 0?_:0)})}g.childrenAfterSort=C}else!t||f?g.childrenAfterSort=g.childrenAfterAggFilter.slice(0):i?g.childrenAfterSort=this.doDeltaSort(g,d,o,e):g.childrenAfterSort=this.rowNodeSorter.doFullSort(g.childrenAfterAggFilter,e);if(g.sibling&&(g.sibling.childrenAfterSort=g.childrenAfterSort),this.updateChildIndexes(g),this.postSortFunc){const C={nodes:g.childrenAfterSort};this.postSortFunc(C)}};o&&o.forEachChangedNodeDepthFirst(h),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,n=e.childrenAfterSort;if(!n)return this.rowNodeSorter.doFullSort(o,s);const r={},a=[];o.forEach(g=>{t[g.id]||!i.canSkip(g)?a.push(g):r[g.id]=!0});const d=n.filter(g=>r[g.id]),c=(g,f)=>({currentPos:f,rowNode:g}),h=a.map(c).sort((g,f)=>this.rowNodeSorter.compareRowNodes(s,g,f));return this.mergeSortedArrays(s,h,d.map(c)).map(({rowNode:g})=>g)}mergeSortedArrays(e,t,i){const s=[];let o=0,n=0;for(;o<t.length&&n<i.length;)this.rowNodeSorter.compareRowNodes(e,t[o],i[n])<0?s.push(t[o++]):s.push(i[n++]);for(;o<t.length;)s.push(t[o++]);for(;n<i.length;)s.push(i[n++]);return s}updateChildIndexes(e){if(G.missing(e.childrenAfterSort))return;const t=e.childrenAfterSort;for(let i=0;i<t.length;i++){const s=t[i],o=i===0,n=i===e.childrenAfterSort.length-1;s.setFirstChild(o),s.setLastChild(n),s.setChildIndex(i)}}updateGroupDataForHideOpenParents(e){if(!this.gridOptionsService.is("groupHideOpenParents"))return;if(this.gridOptionsService.isTreeData()){const i="AG Grid: 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 (as opposed to Row Grouping, which only has Aggregated Values at the group level).";return G.doOnce(()=>console.warn(i),"sortService.hideOpenParentsWithTreeData"),!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.gridOptionsService.is("groupHideOpenParents")||G.missing(e)||e.forEach(i=>{this.columnModel.getGroupDisplayColumns().forEach(o=>{const n=o.getColDef().showRowGroup;if(typeof n!="string"){console.error("AG Grid: groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup");return}const r=n,a=this.columnModel.getPrimaryColumn(r);if(a!==i.rowGroupColumn)if(t)i.setGroupValue(o.getId(),void 0);else{const c=i.getFirstChildOfFirstChild(a);c&&i.setGroupValue(o.getId(),c.key)}})})}};wr([p("columnModel")],Us.prototype,"columnModel",void 0),wr([p("rowNodeSorter")],Us.prototype,"rowNodeSorter",void 0),wr([D],Us.prototype,"init",null),Us=wr([M("sortService")],Us);var $c=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let Sr=class extends T{filter(e){const t=this.filterManager.isColumnFilterPresent()||this.filterManager.isQuickFilterPresent()||this.filterManager.isExternalFilterPresent();this.filterNodes(t,e)}filterNodes(e,t){const i=(s,o)=>{s.hasChildren()&&e&&!o?s.childrenAfterFilter=s.childrenAfterGroup.filter(n=>{const r=n.childrenAfterFilter&&n.childrenAfterFilter.length>0,a=n.data&&this.filterManager.doesRowPassFilter({rowNode:n});return r||a}):s.childrenAfterFilter=s.childrenAfterGroup,s.sibling&&(s.sibling.childrenAfterFilter=s.childrenAfterFilter)};if(this.doingTreeDataFiltering()){const s=(n,r)=>{if(n.childrenAfterGroup)for(let a=0;a<n.childrenAfterGroup.length;a++){const d=n.childrenAfterGroup[a],c=r||this.filterManager.doesRowPassFilter({rowNode:d});d.childrenAfterGroup?s(n.childrenAfterGroup[a],c):i(d,c)}i(n,r)},o=n=>s(n,!1);t.executeFromRootNode(o)}else{const s=o=>i(o,!1);t.forEachChangedNodeDepthFirst(s,!0)}}doingTreeDataFiltering(){return this.gridOptionsService.isTreeData()&&!this.gridOptionsService.is("excludeChildrenWhenTreeDataFiltering")}};$c([p("filterManager")],Sr.prototype,"filterManager",void 0),Sr=$c([M("filterService")],Sr);var Er=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let js=class extends T{postConstruct(){this.rowModel.getType()==="clientSide"&&(this.clientSideRowModel=this.rowModel)}isActive(){const e=this.gridOptionsService.exists("getRowId");return this.gridOptionsService.is("resetRowDataOnUpdate")?!1:e}setRowData(e){const t=this.createTransactionForRowData(e);if(!t)return;const[i,s]=t;this.clientSideRowModel.updateRowData(i,s)}createTransactionForRowData(e){if(G.missing(this.clientSideRowModel)){console.error("AG Grid: ImmutableService only works with ClientSideRowModel");return}const t=this.gridOptionsService.getCallback("getRowId");if(t==null){console.error("AG Grid: ImmutableService requires getRowId() callback to be implemented, your row data needs IDs!");return}const i={remove:[],update:[],add:[]},s=this.clientSideRowModel.getCopyOfNodesMap(),n=this.gridOptionsService.is("suppressMaintainUnsortedOrder")?void 0:{};return G.exists(e)&&e.forEach((r,a)=>{const d=t({data:r,level:0}),c=s[d];n&&(n[d]=a),c?(c.data!==r&&i.update.push(r),s[d]=void 0):i.add.push(r)}),G.iterateObject(s,(r,a)=>{a&&i.remove.push(a.data)}),[i,n]}};Er([p("rowModel")],js.prototype,"rowModel",void 0),Er([p("rowRenderer")],js.prototype,"rowRenderer",void 0),Er([D],js.prototype,"postConstruct",null),js=Er([M("immutableService")],js);const Ug={version:"30.0.5",moduleName:N.ClientSideRowModelModule,rowModel:"clientSide",beans:[be,mr,ks,nn,Us,Sr,js]};var Da=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class rn extends Ae{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){G.exists(t)?e.setDataAndId(t,i.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(G.missing(this.params.datasource.getRows)){console.warn("AG Grid: 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.gridOptionsService.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 P(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 P(this.beans),this.rowNodes[s].setRowIndex(i.rowIndex),this.rowNodes[s].setRowTop(i.rowTop),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)}destroyRowNodes(){this.rowNodes.forEach(e=>{e.clearRowTopAndRowIndex()})}}Da([p("beans")],rn.prototype,"beans",void 0),Da([D],rn.prototype,"postConstruct",null),Da([he],rn.prototype,"destroyRowNodes",null);var yr=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},jg=function(l,e){return function(t,i){e(t,i,l)}};class Pi extends T{constructor(e){super(),this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount,this.params=e}setBeans(e){this.logger=e.create("InfiniteCache")}getRow(e,t=!1){const i=Math.floor(e/this.params.blockSize);let s=this.blocks[i];if(!s){if(t)return;s=this.createBlock(i)}return s.getRow(e)}createBlock(e){const t=this.createBean(new rn(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()}destroyAllBlocks(){this.getBlocksInOrder().forEach(e=>this.destroyBlock(e))}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(this.logger.log(`onPageLoaded: page = ${e.getId()}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(r=>r!=e),i=(r,a)=>a.getLastAccessed()-r.getLastAccessed();t.sort(i);const s=this.params.maxBlocksInCache>0,o=s?this.params.maxBlocksInCache-1:null,n=Pi.MAX_EMPTY_BLOCKS_TO_KEEP-1;t.forEach((r,a)=>{const d=r.getState()===rn.STATE_WAITING_TO_LOAD&&a>=n,c=s?a>=o:!1;if(d||c){if(this.isBlockCurrentlyDisplayed(r)||this.isBlockFocused(r))return;this.removeBlockFromCache(r)}})}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,G.exists(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t=new us;this.getBlocksInOrder().forEach(i=>i.forEachNode(e,t,this.rowCount))}getBlocksInOrder(){const e=(i,s)=>i.getId()-s.getId();return G.getAllValuesInObject(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.getId()],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){if(this.isAlive()){this.destroyAllBlocksPastVirtualRowCount();const e={type:u.EVENT_STORE_UPDATED};this.eventService.dispatchEvent(e)}}destroyAllBlocksPastVirtualRowCount(){const e=[];this.getBlocksInOrder().forEach(t=>{t.getId()*this.params.blockSize>=this.rowCount&&e.push(t)}),e.length>0&&e.forEach(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 n=new us;G.missing(e)&&(o=!0);let r=!1;return this.getBlocksInOrder().forEach(d=>{if(!r){if(o&&s+1!==d.getId()){r=!0;return}s=d.getId(),d.forEachNode(c=>{const h=c===e||c===t;(o||h)&&i.push(c),h&&(o=!o)},n,this.rowCount)}}),r||o?[]:i}}Pi.MAX_EMPTY_BLOCKS_TO_KEEP=2,yr([p("rowRenderer")],Pi.prototype,"rowRenderer",void 0),yr([p("focusService")],Pi.prototype,"focusService",void 0),yr([jg(0,Te("loggerFactory"))],Pi.prototype,"setBeans",null),yr([he],Pi.prototype,"destroyAllBlocks",null);var Ai=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let $t=class extends T{getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(e,t,i,s){return!1}init(){this.gridOptionsService.isRowModelType("infinite")&&(this.rowHeight=this.gridOptionsService.getRowHeightAsNumber(),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache()),this.verifyProps())}verifyProps(){if(this.gridOptionsService.exists("initialGroupOrderComparator")){const e="AG Grid: initialGroupOrderComparator cannot be used with Infinite Row Model. If using Infinite Row Model, then sorting is done on the server side, nothing to do with the client.";G.doOnce(()=>console.warn(e),"IRM.InitialGroupOrderComparator")}}start(){this.setDatasource(this.gridOptionsService.get("datasource"))}destroyDatasource(){this.datasource&&(this.getContext().destroyBean(this.datasource),this.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedListener(this.eventService,u.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,u.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,u.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverything.bind(this)),this.addManagedListener(this.eventService,u.EVENT_STORE_UPDATED,this.onCacheUpdated.bind(this))}onFilterChanged(){this.reset()}onSortChanged(){this.reset()}onColumnEverything(){let e;this.cacheParams?e=this.isSortModelDifferent():e=!0,e&&this.reset()}isSortModelDifferent(){return!G.jsonEquals(this.cacheParams.sortModel,this.sortController.getSortModel())}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){return this.infiniteCache?this.infiniteCache.getRowNodesInRange(e,t):[]}reset(){if(!this.datasource)return;this.gridOptionsService.getCallback("getRowId")!=null||this.selectionService.reset(),this.resetCache();const i=this.createModelUpdatedEvent();this.eventService.dispatchEvent(i)}createModelUpdatedEvent(){return{type:u.EVENT_MODEL_UPDATED,newPage:!1,newData:!1,keepRenderedRows:!0,animate:!1}}resetCache(){this.destroyCache(),this.cacheParams={datasource:this.datasource,filterModel:this.filterManager.getFilterModel(),sortModel:this.sortController.getSortModel(),rowNodeBlockLoader:this.rowNodeBlockLoader,initialRowCount:this.defaultIfInvalid(this.gridOptionsService.getNum("infiniteInitialRowCount"),1),maxBlocksInCache:this.gridOptionsService.getNum("maxBlocksInCache"),rowHeight:this.gridOptionsService.getRowHeightAsNumber(),overflowSize:this.defaultIfInvalid(this.gridOptionsService.getNum("cacheOverflowSize"),1),blockSize:this.defaultIfInvalid(this.gridOptionsService.getNum("cacheBlockSize"),100),lastAccessedSequence:new us},this.infiniteCache=this.createBean(new Pi(this.cacheParams))}defaultIfInvalid(e,t){return e>0?e:t}destroyCache(){this.infiniteCache&&(this.infiniteCache=this.destroyBean(this.infiniteCache))}onCacheUpdated(){const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}getRow(e){if(this.infiniteCache&&!(e>=this.infiniteCache.getRowCount()))return this.infiniteCache.getRow(e)}getRowNode(e){let t;return this.forEachNode(i=>{i.id===e&&(t=i)}),t}forEachNode(e){this.infiniteCache&&this.infiniteCache.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(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)}};Ai([p("filterManager")],$t.prototype,"filterManager",void 0),Ai([p("sortController")],$t.prototype,"sortController",void 0),Ai([p("selectionService")],$t.prototype,"selectionService",void 0),Ai([p("rowRenderer")],$t.prototype,"rowRenderer",void 0),Ai([p("rowNodeBlockLoader")],$t.prototype,"rowNodeBlockLoader",void 0),Ai([D],$t.prototype,"init",null),Ai([he],$t.prototype,"destroyDatasource",null),$t=Ai([M("rowModel")],$t);const zg={version:"30.0.5",moduleName:N.InfiniteRowModelModule,rowModel:"infinite",beans:[$t]};class $g{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)}}class Kg{constructor(e){this.groupColumns=[];const{columnModel:t,valueService:i,gridOptionsService:s,valueFormatterService:o,valueParserService:n,processCellCallback:r,processHeaderCallback:a,processGroupHeaderCallback:d,processRowGroupCallback:c}=e;this.columnModel=t,this.valueService=i,this.gridOptionsService=s,this.valueFormatterService=o,this.valueParserService=n,this.processCellCallback=r,this.processHeaderCallback=a,this.processGroupHeaderCallback=d,this.processRowGroupCallback=c}prepare(e){this.groupColumns=e.filter(t=>!!t.getColDef().showRowGroup)}extractHeaderValue(e){const t=this.getHeaderName(this.processHeaderCallback,e);return t??""}extractRowCellValue(e,t,i,s,o){const r=(!this.gridOptionsService.is("groupHideOpenParents")||o.footer)&&this.shouldRenderGroupSummaryCell(o,e,t)?this.createValueForGroupNode(o):this.valueService.getValue(e,o);return this.processCell({accumulatedRowIndex:i,rowNode:o,column:e,value:r,processCellCallback:this.processCellCallback,type:s})}shouldRenderGroupSummaryCell(e,t,i){var s;if(!(e&&e.group))return!1;if(this.groupColumns.indexOf(t)!==-1){if(((s=e.groupData)===null||s===void 0?void 0:s[t.getId()])!=null)return!0;if(e.footer&&e.level===-1){const a=t.getColDef();return a==null||a.showRowGroup===!0||a.showRowGroup===this.columnModel.getRowGroupColumns()[0].getId()}}const r=this.gridOptionsService.isGroupUseEntireRow(this.columnModel.isPivotMode());return i===0&&r}getHeaderName(e,t){return e?e({column:t,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context}):this.columnModel.getDisplayNameForColumn(t,"csv",!0)}createValueForGroupNode(e){if(this.processRowGroupCallback)return this.processRowGroupCallback({node:e,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context});const t=e.footer,i=[e.key];if(!this.gridOptionsService.isGroupMultiAutoColumn())for(;e.parent;)e=e.parent,i.push(e.key);const s=i.reverse().join(" -> ");return t?`Total ${s}`:s}processCell(e){var t;const{accumulatedRowIndex:i,rowNode:s,column:o,value:n,processCellCallback:r,type:a}=e;return r?{value:(t=r({accumulatedRowIndex:i,column:o,node:s,value:n,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context,type:a,parseValue:d=>this.valueParserService.parseValue(o,s,d,this.valueService.getValue(o,s)),formatValue:d=>{var c;return(c=this.valueFormatterService.formatValue(o,s,d))!==null&&c!==void 0?c:d}}))!==null&&t!==void 0?t:""}:o.getColDef().useValueFormatterForExport?{value:n??"",valueFormatted:this.valueFormatterService.formatValue(o,s,n)}:{value:n??""}}}class Yg{static download(e,t){const i=document.defaultView||window;if(!i){console.warn("AG Grid: 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)}}const Kc=`\r
`;class qg extends Kg{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,Kc),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){var s;t!=0&&(this.result+=this.columnSeparator);const o=this.extractRowCellValue(e,t,t,"csv",i);this.result+=this.putInQuotes((s=o.valueFormatted)!==null&&s!==void 0?s:o.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():(console.warn("AG Grid: unknown value type during csv conversion"),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=Kc),this.isFirstLine=!1}}var Fi=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};let Kt=class extends $g{postConstruct(){this.setBeans({gridSerializer:this.gridSerializer,gridOptionsService:this.gridOptionsService})}getMergedParams(e){const t=this.gridOptionsService.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed())return console.warn("AG Grid: Export cancelled. Export is not allowed as per your configuration."),"";const t=this.getMergedParams(e),i=this.getData(t),s=new Blob(["\uFEFF",i],{type:"text/plain"});return Yg.download(this.getFileName(t.fileName),s),i}exportDataAsCsv(e){return this.export(e)}getDataAsCsv(e,t=!1){const i=t?Object.assign({},e):this.getMergedParams(e);return this.getData(i)}getDefaultFileName(){return"export.csv"}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{columnModel:t,valueService:i,gridOptionsService:s,valueFormatterService:o,valueParserService:n}=this,{processCellCallback:r,processHeaderCallback:a,processGroupHeaderCallback:d,processRowGroupCallback:c,suppressQuotes:h,columnSeparator:g}=e;return new qg({columnModel:t,valueService:i,gridOptionsService:s,valueFormatterService:o,valueParserService:n,processCellCallback:r||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:d||void 0,processRowGroupCallback:c||void 0,suppressQuotes:h||!1,columnSeparator:g||","})}isExportSuppressed(){return this.gridOptionsService.is("suppressCsvExport")}};Fi([p("columnModel")],Kt.prototype,"columnModel",void 0),Fi([p("valueService")],Kt.prototype,"valueService",void 0),Fi([p("gridSerializer")],Kt.prototype,"gridSerializer",void 0),Fi([p("gridOptionsService")],Kt.prototype,"gridOptionsService",void 0),Fi([p("valueFormatterService")],Kt.prototype,"valueFormatterService",void 0),Fi([p("valueParserService")],Kt.prototype,"valueParserService",void 0),Fi([D],Kt.prototype,"postConstruct",null),Kt=Fi([M("csvCreator")],Kt);var Li=function(l,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,i);else for(var r=l.length-1;r>=0;r--)(n=l[r])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Yc;(function(l){l[l.HEADER_GROUPING=0]="HEADER_GROUPING",l[l.HEADER=1]="HEADER",l[l.BODY=2]="BODY"})(Yc||(Yc={}));let Yt=class extends T{serialize(e,t={}){const i=this.getColumnsToExport(t.allColumns,t.columnKeys);return G.compose(this.prepareSession(i),this.prependContent(t),this.exportColumnGroups(t,i),this.exportHeaders(t,i),this.processPinnedTopRows(t,i),this.processRows(t,i),this.processPinnedBottomRows(t,i),this.appendContent(t))(e).parse()}processRow(e,t,i,s){const o=t.shouldRowBeSkipped||(()=>!1),n=this.gridOptionsService.context,r=this.gridOptionsService.api,a=this.gridOptionsService.columnApi,d=this.gridOptionsService.is("groupRemoveSingleChildren"),c=this.gridOptionsService.is("groupRemoveLowestSingleChildren"),g=t.rowPositions!=null||!!t.onlySelected,f=this.gridOptionsService.is("groupHideOpenParents")&&!g,m=this.columnModel.isPivotMode()?s.leafGroup:!s.group,C=!!s.footer,y=t.skipGroups||t.skipRowGroups,v=c&&s.leafGroup,E=s.allChildrenCount===1&&(d||v);if(y&&t.skipGroups&&G.doOnce(()=>console.warn("AG Grid: Since v25.2 `skipGroups` has been renamed to `skipRowGroups`."),"gridSerializer-skipGroups"),!m&&!C&&(t.skipRowGroups||E||f)||t.onlySelected&&!s.isSelected()||t.skipPinnedTop&&s.rowPinned==="top"||t.skipPinnedBottom&&s.rowPinned==="bottom"||s.level===-1&&!m&&!C||o({node:s,api:r,columnApi:a,context:n}))return;const F=e.onNewBodyRow(s);if(i.forEach((L,I)=>{F.onColumn(L,I,s)}),t.getCustomContentBelowRow){const L=t.getCustomContentBelowRow({node:s,api:r,columnApi:a,context:n});L&&e.addCustomContent(L)}}appendContent(e){return t=>{const i=e.customFooter||e.appendContent;return i&&(e.customFooter&&G.doOnce(()=>console.warn("AG Grid: Since version 25.2.0 the `customFooter` param has been deprecated. Use `appendContent` instead."),"gridSerializer-customFooter"),t.addCustomContent(i)),t}}prependContent(e){return t=>{const i=e.customHeader||e.prependContent;return i&&(e.customHeader&&G.doOnce(()=>console.warn("AG Grid: Since version 25.2.0 the `customHeader` param has been deprecated. Use `prependContent` instead."),"gridSerializer-customHeader"),t.addCustomContent(i)),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return i=>{if(e.skipColumnGroupHeaders)e.columnGroups&&G.doOnce(()=>console.warn("AG Grid: Since v25.2 the `columnGroups` param has deprecated, and groups are exported by default."),"gridSerializer-columnGroups");else{const s=new Qa,o=this.displayedGroupCreator.createDisplayedGroups(t,this.columnModel.getGridBalancedTree(),s,null);this.recursivelyAddHeaderGroups(o,i,e.processGroupHeaderCallback)}return i}}exportHeaders(e,t){return i=>{if(!e.skipHeader&&!e.skipColumnHeaders){const s=i.onNewHeaderRow();t.forEach((o,n)=>{s.onColumn(o,n,void 0)})}else e.skipHeader&&G.doOnce(()=>console.warn("AG Grid: Since v25.2 the `skipHeader` param has been renamed to `skipColumnHeaders`."),"gridSerializer-skipHeader");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,n)=>o.rowIndex-n.rowIndex).map(o=>this.pinnedRowModel.getPinnedTopRow(o.rowIndex)).forEach(s):this.pinnedRowModel.forEachPinnedTopRow(s),i}}processRows(e,t){return i=>{const s=this.rowModel,o=s.getType(),n=o==="clientSide",r=o==="serverSide",a=!n&&e.onlySelected,d=this.processRow.bind(this,i,e,t),{exportedRows:c="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(h=>h.rowPinned==null).sort((h,g)=>h.rowIndex-g.rowIndex).map(h=>s.getRow(h.rowIndex)).forEach(d);else if(this.columnModel.isPivotMode())n?s.forEachPivotNode(d,!0):s.forEachNode(d);else if(e.onlySelectedAllPages||a){const h=this.selectionService.getSelectedNodes();this.replicateSortedOrder(h),h.forEach(d)}else c==="all"?s.forEachNode(d):n?s.forEachNodeAfterFilterAndSort(d,!0):r?s.forEachNodeAfterFilterAndSort(d):s.forEachNode(d);return i}}replicateSortedOrder(e){const t=this.sortController.getSortOptions(),i=(s,o)=>{var n,r,a,d;return s.rowIndex!=null&&o.rowIndex!=null?s.rowIndex-o.rowIndex:s.level===o.level?((n=s.parent)===null||n===void 0?void 0:n.id)===((r=o.parent)===null||r===void 0?void 0:r.id)?this.rowNodeSorter.compareRowNodes(t,{rowNode:s,currentPos:(a=s.rowIndex)!==null&&a!==void 0?a:-1},{rowNode:o,currentPos:(d=o.rowIndex)!==null&&d!==void 0?d:-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,n)=>o.rowIndex-n.rowIndex).map(o=>this.pinnedRowModel.getPinnedBottomRow(o.rowIndex)).forEach(s):this.pinnedRowModel.forEachPinnedBottomRow(s),i}}getColumnsToExport(e=!1,t){const i=this.columnModel.isPivotMode();return t&&t.length?this.columnModel.getGridColumns(t):e&&!i?(this.gridOptionsService.isTreeData()?this.columnModel.getGridColumns([ns]):[]).concat(this.columnModel.getAllGridColumns()||[]):this.columnModel.getAllDisplayedColumns()}recursivelyAddHeaderGroups(e,t,i){const s=[];e.forEach(o=>{const n=o;n.getChildren&&n.getChildren().forEach(r=>s.push(r))}),e.length>0&&e[0]instanceof te&&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(n=>{const r=n;let a;i?a=i({columnGroup:r,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context}):a=this.columnModel.getDisplayNameForColumnGroup(r,"header");const d=r.getLeafColumns().reduce((c,h,g,f)=>{let m=G.last(c);return h.getColumnGroupShow()==="open"?(!m||m[1]!=null)&&(m=[g],c.push(m)):m&&m[1]==null&&(m[1]=g-1),g===f.length-1&&m&&m[1]==null&&(m[1]=g),c},[]);s.onColumn(r,a||"",o++,r.getLeafColumns().length-1,d)})}};Li([p("displayedGroupCreator")],Yt.prototype,"displayedGroupCreator",void 0),Li([p("columnModel")],Yt.prototype,"columnModel",void 0),Li([p("rowModel")],Yt.prototype,"rowModel",void 0),Li([p("pinnedRowModel")],Yt.prototype,"pinnedRowModel",void 0),Li([p("selectionService")],Yt.prototype,"selectionService",void 0),Li([p("rowNodeSorter")],Yt.prototype,"rowNodeSorter",void 0),Li([p("sortController")],Yt.prototype,"sortController",void 0),Yt=Li([M("gridSerializer")],Yt);const Qg={version:"30.0.5",moduleName:N.CsvExportModule,beans:[Kt,Yt]},Xg=[Ug,zg,Qg];A.registerModules(Xg);const Jg=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M9 4h6a2 2 0 0 1 2 2v14l-5 -3l-5 3v-14a2 2 0 0 1 2 -2"></path>
</svg>`,Zg=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M15 3a3 3 0 0 1 2.995 2.824l.005 .176v14a1 1 0 0 1 -1.413 .911l-.101 -.054l-4.487 -2.691l-4.485 2.691a1 1 0 0 1 -1.508 -.743l-.006 -.114v-14a3 3 0 0 1 2.824 -2.995l.176 -.005h6z" stroke-width="0" fill="currentColor"></path>
</svg>`,qc=`<svg width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<path d="M18 6l-12 12"/>
<path d="M6 6l12 12"/>
</svg>`,Qc=`<svg width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<path d="M4 7l16 0"/>
<path d="M10 11l0 6"/>
<path d="M14 11l0 6"/>
<path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"/>
<path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"/>
</svg>`,ef=`<svg
width="24"
height="24"
viewBox="0 0 24 24"
stroke-width="2"
stroke="currentColor"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M7 4v16l13 -8z" />
</svg>
`,tf=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M9 4.55a8 8 0 0 1 6 14.9m0 -4.45v5h5"></path>
<path d="M5.63 7.16l0 .01"></path>
<path d="M4.06 11l0 .01"></path>
<path d="M4.63 15.1l0 .01"></path>
<path d="M7.16 18.37l0 .01"></path>
<path d="M11 19.94l0 .01"></path>
</svg>`,sf=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2"></path>
<path d="M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path>
<path d="M14 4l0 4l-6 0l0 -4"></path>
</svg>`,of=`<svg width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<path d="M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"/>
<path d="M21 21l-6 -6"/>
</svg>`,Xc=(l,e=300)=>{let t;return function(...i){clearTimeout(t),t=setTimeout(()=>l.apply(this,i),e)}},nf=l=>(l+"").replace(/[/][/].*$/gm,"").replace(/\s+/g,"").replace(/[/][*][^/*]*[*][/]/g,"").split("){",1)[0].replace(/^[^(]*[(]/,"").replace(/=[^,]+/g,"").split(",").filter(Boolean);function Jc(l){const e=l.getFullYear(),t=(l.getMonth()+1).toString().padStart(2,"0"),i=l.getDate().toString().padStart(2,"0"),s=l.getHours().toString().padStart(2,"0"),o=l.getMinutes().toString().padStart(2,"0"),n=l.getSeconds().toString().padStart(2,"0");return`${e}-${t}-${i} ${s}:${o}:${n}`}const rf=(l,e)=>{if(l.getDisplayedRowCount()<=0)return;const t=l.paginationGetPageSize()*l.paginationGetCurrentPage(),s=l.getDisplayedRowAtIndex(t).rowTop,o=Math.min(l.paginationGetPageSize()*(l.paginationGetCurrentPage()+1)-1,l.getDisplayedRowCount()-1),n=l.getDisplayedRowAtIndex(o),r=n.rowTop+n.rowHeight;let a;return l.forEachNodeAfterFilterAndSort((d,c)=>{const h=d.rowTop,g=d.rowHeight;if(h<r){const f=e-(h-s);f>0&&f<g&&(a=d)}}),a},Oa=(l,e,t)=>{const i=l.paginationGetPageSize()*l.paginationGetCurrentPage(),o=l.getDisplayedRowAtIndex(i).rowTop;return t-(e.rowTop-o)},lf=(l,e,t)=>Oa(l,e,t)<e.rowHeight/2?rt.Above:rt.Below,Zc=l=>{let e;const t=new Set,i=(a,d)=>{const c=typeof a=="function"?a(e):a;if(!Object.is(c,e)){const h=e;e=d??typeof c!="object"?c:Object.assign({},e,c),t.forEach(g=>g(e,h))}},s=()=>e,r={setState:i,getState:s,subscribe:a=>(t.add(a),()=>t.delete(a)),destroy:()=>{({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1}&&"production")!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}};return e=l(i,s,r),r},Pa=l=>l?Zc(l):Zc,af=l=>{const e=Pa()(()=>l),{getState:t,setState:i,subscribe:s}=e,o={refresh:async n=>{const{limit:r=1e3,offset:a=0}=n??{},d=t().status??"";return fetch(`/agent-scheduler/v1/history?status=${d}&limit=${r}&offset=${a}`).then(c=>c.json()).then(c=>(i({...c}),c))},onFilterStatus:n=>{i({status:n}),o.refresh()},bookmarkTask:async(n,r)=>fetch(`/agent-scheduler/v1/task/${n}/${r?"bookmark":"unbookmark"}`,{method:"POST"}).then(a=>a.json()),renameTask:async(n,r)=>fetch(`/agent-scheduler/v1/task/${n}/rename?name=${encodeURIComponent(r)}`,{method:"POST",headers:{"Content-Type":"application/json"}}).then(a=>a.json()),requeueTask:async n=>fetch(`/agent-scheduler/v1/task/${n}/requeue`,{method:"POST"}).then(r=>r.json()),clearHistory:async()=>fetch("/agent-scheduler/v1/history/clear",{method:"POST"}).then(n=>(o.refresh(),n.json()))};return{getState:t,setState:i,subscribe:s,...o}},df=l=>{const e=Pa()(()=>l),{getState:t,setState:i,subscribe:s}=e,o={refresh:async()=>fetch("/agent-scheduler/v1/queue?limit=1000").then(n=>n.json()).then(n=>{i(n)}),pauseQueue:async()=>fetch("/agent-scheduler/v1/queue/pause",{method:"POST"}).then(n=>n.json()).then(n=>(setTimeout(()=>{o.refresh()},500),n)),resumeQueue:async()=>fetch("/agent-scheduler/v1/queue/resume",{method:"POST"}).then(n=>n.json()).then(n=>(setTimeout(()=>{o.refresh()},500),n)),clearQueue:async()=>fetch("/agent-scheduler/v1/queue/clear",{method:"POST"}).then(n=>n.json()).then(n=>(o.refresh(),n)),runTask:async n=>fetch(`/agent-scheduler/v1/task/${n}/run`,{method:"POST"}).then(r=>r.json()).then(r=>(setTimeout(()=>{o.refresh()},500),r)),moveTask:async(n,r)=>fetch(`/agent-scheduler/v1/task/${n}/move/${r}`,{method:"POST"}).then(a=>a.json()).then(a=>(o.refresh(),a)),updateTask:async(n,r)=>{const a={name:r.name,checkpoint:r.params.checkpoint,params:{prompt:r.params.prompt,negative_prompt:r.params.negative_prompt,sampler_name:r.params.sampler_name,steps:r.params.steps,cfg_scale:r.params.cfg_scale}};return fetch(`/agent-scheduler/v1/task/${n}`,{method:"PUT",body:JSON.stringify(a),headers:{"Content-Type":"application/json"}}).then(d=>d.json())},deleteTask:async n=>fetch(`/agent-scheduler/v1/task/${n}`,{method:"DELETE"}).then(r=>r.json())};return{getState:t,setState:i,subscribe:s,...o}},cf=l=>{const e=Pa(()=>l),{getState:t,setState:i,subscribe:s}=e;return{getState:t,setState:i,subscribe:s,...{setSelectedTab:n=>{i({selectedTab:n})},getSamplers:async()=>fetch("/sdapi/v1/samplers").then(n=>n.json()).then(n=>n.map(r=>r.name)),getCheckpoints:async()=>fetch("/sdapi/v1/sd-models").then(n=>n.json()).then(n=>n.map(r=>r.title))}}},bf="",Tf="",Df="",Of="";let Rr;const Dt=cf({uiAsTab:!0,selectedTab:"pending"}),Ot=df({current_task_id:null,total_pending_tasks:0,pending_tasks:[],paused:!1}),br=af({total:0,tasks:[]}),eu=[],tu=["System"];Dt.getSamplers().then(l=>{eu.push(...l)}),Dt.getCheckpoints().then(l=>{tu.push(...l)});const ts={defaultColDef:{sortable:!1,filter:!0,resizable:!0,suppressMenu:!0},columnDefs:[{field:"name",headerName:"Task Id",cellDataType:"text",minWidth:240,maxWidth:240,pinned:"left",rowDrag:!0,valueGetter:({data:l})=>(l==null?void 0:l.name)??(l==null?void 0:l.id),cellClass:({data:l})=>["cursor-pointer",(l==null?void 0:l.status)==="pending"?"task-pending":"",(l==null?void 0:l.status)==="running"?"task-running":"",(l==null?void 0:l.status)==="done"?"task-done":"",(l==null?void 0:l.status)==="failed"?"task-failed":"",(l==null?void 0:l.status)==="interrupted"?"task-interrupted":""]},{field:"type",headerName:"Type",minWidth:80,maxWidth:80,editable:!1},{field:"editing",editable:!1,hide:!0},{headerName:"Params",children:[{field:"params.prompt",headerName:"Prompt",cellDataType:"text",minWidth:200,maxWidth:400,autoHeight:!0,wrapText:!0,cellStyle:{"line-height":"24px","padding-top":"8px","padding-bottom":"8px"}},{field:"params.negative_prompt",headerName:"Negative Prompt",cellDataType:"text",minWidth:200,maxWidth:400,autoHeight:!0,wrapText:!0,cellStyle:{"line-height":"24px","padding-top":"8px","padding-bottom":"8px"}},{field:"params.checkpoint",headerName:"Checkpoint",cellDataType:"text",minWidth:150,maxWidth:300,valueFormatter:({value:l})=>l||"System",cellEditor:"agSelectCellEditor",cellEditorParams:()=>({values:tu})},{field:"params.sampler_name",headerName:"Sampler",cellDataType:"text",width:150,minWidth:150,cellEditor:"agSelectCellEditor",cellEditorParams:()=>({values:eu})},{field:"params.steps",headerName:"Steps",cellDataType:"number",minWidth:80,maxWidth:80,filter:"agNumberColumnFilter",cellEditor:"agNumberCellEditor",cellEditorParams:{min:1,max:150,precision:0,step:1}},{field:"params.cfg_scale",headerName:"CFG Scale",cellDataType:"number",width:100,minWidth:100,filter:"agNumberColumnFilter",cellEditor:"agNumberCellEditor",cellEditorParams:{min:1,max:30,precision:1,step:.5}},{field:"params.size",headerName:"Size",minWidth:110,maxWidth:110,editable:!1,valueGetter:({data:l})=>{var e;return(e=l==null?void 0:l.params)!=null&&e.width?`${l.params.width}×${l.params.height}`:""}},{field:"params.batch",headerName:"Batching",minWidth:100,maxWidth:100,editable:!1,valueGetter:({data:l})=>{var e;return(e=l==null?void 0:l.params)!=null&&e.n_iter?`${l.params.batch_size}×${l.params.n_iter}`:"1×1"}}]},{field:"created_at",headerName:"Queued At",minWidth:170,editable:!1,valueGetter:({data:l})=>l&&l.created_at-new Date().getTimezoneOffset()*6e4,valueFormatter:({value:l})=>l&&Jc(new Date(l))},{field:"updated_at",headerName:"Updated At",minWidth:170,editable:!1,valueGetter:({data:l})=>l&&l.created_at-new Date().getTimezoneOffset()*6e4,valueFormatter:({value:l})=>l&&Jc(new Date(l))}],getRowId:({data:l})=>l.id,rowSelection:"single",animateRows:!0,pagination:!0,paginationAutoPageSize:!0,suppressCopyRowsToClipboard:!0,suppressRowTransform:!0,enableBrowserTooltips:!0};function iu(l){const e=gradioApp().querySelector(l);if(!e)throw new Error(`search container ${l} not found`);const t=e.getElementsByTagName("input")[0];if(!t)throw new Error("search input not found");t.classList.add("ts-search-input");const i=document.createElement("div");return i.className="ts-search-icon",i.innerHTML=of,t.parentNode.appendChild(i),t}async function ut(l){if(!Rr){const e=await Promise.resolve().then(()=>mf);Rr=new e.Notyf({position:{x:"center",y:"bottom"},duration:3e3})}l.success?Rr.success(l.message):Rr.error(l.message)}window.notify=ut,window.origRandomId=window.randomId;function uf(l,e,t){var o;const i=nf(requestProgress),s=gradioApp().querySelector("#agent_scheduler_current_task_images");if(i.includes("progressbarContainer"))requestProgress(l,s,s,t);else{const n=document.createElement("div");n.className="progressDiv",(o=s.parentNode)==null||o.insertBefore(n,s),requestProgress(l,s,s,()=>{var r;(r=s.parentNode)==null||r.removeChild(n),t()},r=>{if(!r)return;const a=r?`${Math.round(((r==null?void 0:r.progress)||0)*100)}%`:"",d=r!=null&&r.paused?" Paused":` ETA: ${Math.round((r==null?void 0:r.eta)||0)}s`;n.innerText=`${a}${d}`,n.style.background=r?`linear-gradient(to right, var(--primary-500) 0%, var(--primary-800) ${a}, var(--neutral-700) ${a})`:"var(--button-primary-background-fill)"})}window.randomId=()=>l,e==="txt2img"?window.submit():e==="img2img"&&window.submit_img2img(),window.randomId=window.origRandomId}function hf(){const l=a=>{const d=a?"img2img_enqueue_wrapper":"txt2img_enqueue_wrapper",c=gradioApp().querySelector(`#${d} input`);if(c){const g=c.value;if(g=="Runtime Checkpoint"||g!="Current Checkpoint")return g}const h=gradioApp().querySelector("#setting_sd_model_checkpoint input");return h?h.value:"Current Checkpoint"},e=document.querySelector("#txt2img_enqueue");window.submit_enqueue=function(...d){const c=create_submit_args(d);return c[0]=l(),c[1]=randomId(),window.randomId=window.origRandomId,e&&(e.innerHTML="Queued",setTimeout(()=>{e.innerHTML="Enqueue",Dt.getState().uiAsTab||Dt.getState().selectedTab==="pending"&&Ot.refresh()},1e3)),c};const t=document.querySelector("#img2img_enqueue");window.submit_enqueue_img2img=function(...d){const c=create_submit_args(d);return c[0]=l(!0),c[1]=randomId(),c[2]=get_tab_index("mode_img2img"),window.randomId=window.origRandomId,t&&(t.innerHTML="Queued",setTimeout(()=>{t.innerHTML="Enqueue",Dt.getState().uiAsTab||Dt.getState().selectedTab==="pending"&&Ot.refresh()},1e3)),c};const i=gradioApp().querySelector(".interrogate-col");i&&i.childElementCount>2&&i.classList.add("has-queue-button");const s=gradioApp().querySelector("#setting_queue_keyboard_shortcut textarea");if(s!=null&&s.value&&!s.value.includes("Disabled")){const a=s.value.split("+"),d=a.pop(),c=f=>{if(f.code!==d||a.includes("Shift")&&!f.shiftKey||a.includes("Alt")&&!f.altKey||a.includes("Command")&&!f.metaKey||(a.includes("Control")||a.includes("Ctrl"))&&!f.ctrlKey)return;f.preventDefault(),f.stopPropagation();const m=get_tab_index("tabs");if(m===0){const C=gradioApp().querySelector("#txt2img_enqueue");C==null||C.click()}else if(m===1){const C=gradioApp().querySelector("#img2img_enqueue");C==null||C.click()}};window.addEventListener("keydown",c);const h=gradioApp().querySelector("#txt2img_prompt textarea");h&&h.addEventListener("keydown",c);const g=gradioApp().querySelector("#img2img_prompt textarea");g&&g.addEventListener("keydown",c)}const o=a=>{if(!a)return;const d=Ot.getState().pending_tasks.find(c=>c.id===a);uf(a,d==null?void 0:d.type,Ot.refresh)};Ot.subscribe((a,d)=>{d.current_task_id!==a.current_task_id&&o(a.current_task_id)});const n=(a=!1)=>{const d=prompt("Enter task name");window.randomId=()=>d||window.origRandomId(),a?t==null||t.click():e==null||e.click()},r=(a=!1)=>{window.randomId=()=>"$$_queue_with_all_checkpoints_$$",a?t==null||t.click():e==null||e.click()};appendContextMenuOption("#txt2img_enqueue","Queue with task name",()=>n()),appendContextMenuOption("#txt2img_enqueue","Queue with all checkpoints",()=>r()),appendContextMenuOption("#img2img_enqueue","Queue with task name",()=>n(!0)),appendContextMenuOption("#img2img_enqueue","Queue with all checkpoints",()=>r(!0))}function pf(){Dt.subscribe((e,t)=>{(!e.uiAsTab||e.selectedTab!==t.selectedTab)&&(e.selectedTab==="pending"?Ot.refresh():br.refresh())});const l=new MutationObserver(function(e){e.forEach(t=>{const i=t.target;i.style.display==="block"&&(i.id==="tab_agent_scheduler"?Dt.getState().selectedTab==="pending"?Ot.refresh():br.refresh():i.id==="agent_scheduler_pending_tasks_tab"?Dt.setSelectedTab("pending"):i.id==="agent_scheduler_history_tab"&&Dt.setSelectedTab("history"))})});document.getElementById("tab_agent_scheduler")?l.observe(document.getElementById("tab_agent_scheduler"),{attributeFilter:["style"]}):Dt.setState({uiAsTab:!1}),l.observe(document.getElementById("agent_scheduler_pending_tasks_tab"),{attributeFilter:["style"]}),l.observe(document.getElementById("agent_scheduler_history_tab"),{attributeFilter:["style"]})}function gf(){const l=Ot,e=gradioApp().querySelector("#agent_scheduler_action_reload"),t=gradioApp().querySelector("#agent_scheduler_action_pause"),i=gradioApp().querySelector("#agent_scheduler_action_resume"),s=gradioApp().querySelector("#agent_scheduler_action_clear_queue");e.addEventListener("click",l.refresh),t.addEventListener("click",()=>l.pauseQueue().then(ut)),i.addEventListener("click",()=>l.resumeQueue().then(ut)),s.addEventListener("click",()=>{confirm("Are you sure you want to clear the queue?")&&l.clearQueue().then(ut)});const o=v=>{v.paused?(t.classList.add("hide","hidden"),i.classList.remove("hide","hidden")):(t.classList.remove("hide","hidden"),i.classList.add("hide","hidden"))};l.subscribe(o),o(l.getState());let n,r;const a=1.5*1e3,d=45/2,c=()=>{r!=null&&(clearTimeout(r),r=null)},h=(v,E)=>{if(!n){c();return}const b=v.paginationGetPageSize()*v.paginationGetCurrentPage(),_=Math.min(v.paginationGetPageSize()*(v.paginationGetCurrentPage()+1)-1,v.getDisplayedRowCount()-1),F=n.rowIndex;if(F===b){if(Oa(v,n,E)>d){c();return}r==null&&(r=setTimeout(()=>{v.paginationGetCurrentPage()>0&&(v.paginationGoToPreviousPage(),m(v)),r=null},a))}else if(F===_){if(Oa(v,n,E)<n.rowHeight-d){c();return}r==null&&(r=setTimeout(()=>{v.paginationGetCurrentPage()<v.paginationGetTotalPages()-1&&(v.paginationGoToNextPage(),m(v)),r=null},a))}};let g;const f=()=>{c(),g=null,n&&(n.setHighlighted(null),n=null)},m=(v,E)=>{if(E==null){if(g==null)return;E=g}else g=E;const b=rf(v,E);if(!b)return;const _=lf(v,b,E);n&&b.id!==n.id&&f(),b.setHighlighted(_),n=b,h(v,E)},C={...ts,editType:"fullRow",defaultColDef:{...ts.defaultColDef,editable:({data:v})=>(v==null?void 0:v.status)==="pending",cellDataType:!1},columnDefs:[{field:"priority",hide:!0,sort:"asc"},...ts.columnDefs||[],{headerName:"Action",pinned:"right",minWidth:110,maxWidth:110,resizable:!1,editable:!1,valueGetter:({data:v})=>v==null?void 0:v.id,cellClass:({data:v})=>v!=null&&v.editing?"pending-actions editing":"pending-actions",cellRenderer:({api:v,value:E,data:b})=>{if(!b)return;const _=`
<div class="inline-flex mt-1 edit-actions" role="group">
<button type="button" title="Save" class="ts-btn-action primary ts-btn-save">
${sf}
</button>
<button type="button" title="Cancel"
class="ts-btn-action secondary ts-btn-cancel">
${qc}
</button>
</div>
<div class="inline-flex mt-1 control-actions" role="group">
<button type="button" title="Run" class="ts-btn-action primary ts-btn-run"
${b.status==="running"?"disabled":""}>
${ef}
</button>
<button type="button" title="${b.status==="pending"?"Delete":"Interrupt"}"
class="ts-btn-action stop ts-btn-delete">
${b.status==="pending"?Qc:qc}
</button>
</div>
`,F=document.createElement("div");return F.innerHTML=_,F.querySelector("button.ts-btn-save").addEventListener("click",()=>{v.showLoadingOverlay(),Ot.updateTask(b.id,b).then(ne=>{ut(ne),v.hideOverlay(),v.stopEditing(!1)})}),F.querySelector("button.ts-btn-cancel").addEventListener("click",()=>{v.stopEditing(!0)}),F.querySelector("button.ts-btn-run").addEventListener("click",()=>{v.showLoadingOverlay(),l.runTask(E).then(()=>v.hideOverlay())}),F.querySelector("button.ts-btn-delete").addEventListener("click",()=>{v.showLoadingOverlay(),l.deleteTask(E).then(ne=>{ut(ne),v.applyTransaction({remove:[b]}),v.hideOverlay()})}),F}}],onColumnMoved({columnApi:v}){const E=v.getColumnState(),b=JSON.stringify(E);localStorage.setItem("agent_scheduler:queue_col_state",b)},onSortChanged({columnApi:v}){const E=v.getColumnState(),b=JSON.stringify(E);localStorage.setItem("agent_scheduler:queue_col_state",b)},onColumnResized({columnApi:v}){const E=v.getColumnState(),b=JSON.stringify(E);localStorage.setItem("agent_scheduler:queue_col_state",b)},onGridReady:({api:v,columnApi:E})=>{iu("#agent_scheduler_action_search").addEventListener("keyup",Xc(L=>{v.setQuickFilter(L.target.value)},200));const _=L=>{if(v.setRowData(L.pending_tasks),L.current_task_id){const I=v.getRowNode(L.current_task_id);I&&v.refreshCells({rowNodes:[I],force:!0})}v.clearFocusedCell(),E.autoSizeAllColumns()};l.subscribe(_),_(l.getState());const F=localStorage.getItem("agent_scheduler:queue_col_state");if(F){const L=JSON.parse(F);E.applyColumnState({state:L,applyOrder:!0})}},onRowDragEnter:({api:v,y:E})=>m(v,E),onRowDragMove:({api:v,y:E})=>m(v,E),onRowDragLeave:v=>f(),onRowDragEnd:({api:v,node:E})=>{var ne,Ge,He;const b=n;if(!b){f();return}const _=(ne=E.data)==null?void 0:ne.id,F=(Ge=b.data)==null?void 0:Ge.id;if(!_||!F||_===F){f();return}let L=-1,I=-1;const U=[...l.getState().pending_tasks].sort((Le,pt)=>Le.priority-pt.priority);for(let Le=0;Le<U.length&&(U[Le].id===_&&(L=Le),U[Le].id===F&&(I=Le),!(L!==-1&&I!==-1));Le++);if(L===-1||I===-1){f();return}if(b.highlighted===rt.Below&&(I+=1),I===L||I===L+1){f();return}const oe=((He=U[I])==null?void 0:He.id)??"bottom";v.showLoadingOverlay(),l.moveTask(_,oe).then(()=>{f(),v.hideOverlay()})},onRowEditingStarted:({api:v,data:E,node:b})=>{E&&(b.setDataValue("editing",!0),v.refreshCells({rowNodes:[b],force:!0}))},onRowEditingStopped:({api:v,data:E,node:b})=>{E&&(b.setDataValue("editing",!1),v.refreshCells({rowNodes:[b],force:!0}))},onRowValueChanged:({data:v,api:E})=>{v&&(E.showLoadingOverlay(),Ot.updateTask(v.id,v).then(b=>{ut(b),E.hideOverlay()}))}},y=gradioApp().querySelector("#agent_scheduler_pending_tasks_grid");new Uc(y,C)}function ff(){const l=br,e=gradioApp().querySelector("#agent_scheduler_action_refresh_history"),t=gradioApp().querySelector("#agent_scheduler_action_clear_history");e.addEventListener("click",()=>{l.refresh()}),t.addEventListener("click",()=>{confirm("Are you sure you want to clear the history?")&&l.clearHistory().then(ut)});const i=gradioApp().querySelector("#agent_scheduler_history_selected_task textarea"),s=gradioApp().querySelector("#agent_scheduler_history_selected_image textarea");gradioApp().querySelector("#agent_scheduler_history_gallery").addEventListener("click",a=>{var c,h;const d=a.target;if(d.tagName==="IMG"){const g=Array.prototype.indexOf.call(((h=(c=d.parentNode)==null?void 0:c.parentNode)==null?void 0:h.childNodes)??[],d.parentNode);s.value=g.toString(),s.dispatchEvent(new Event("input",{bubbles:!0}))}}),window.agent_scheduler_status_filter_changed=function(a){l.onFilterStatus(a==null?void 0:a.toLowerCase())};const n={...ts,readOnlyEdit:!0,defaultColDef:{...ts.defaultColDef,sortable:!0,editable:({colDef:a})=>(a==null?void 0:a.field)==="name"},columnDefs:[{headerName:"",field:"bookmarked",minWidth:55,maxWidth:55,pinned:"left",sort:"desc",cellClass:"cursor-pointer pt-3",cellRenderer:({data:a,value:d})=>{if(a)return d?`<span class="ts-bookmarked">${Zg}</span>`:`<span class="ts-bookmark">${Jg}</span>`},onCellClicked:({data:a,event:d,api:c})=>{a&&(d==null||d.stopPropagation(),d==null||d.preventDefault(),l.bookmarkTask(a.id,!a.bookmarked).then(h=>{ut(h),c.applyTransaction({update:[{...a,bookmarked:!a.bookmarked}]})}))}},{field:"priority",hide:!0,sort:"desc"},{...(ts.columnDefs||[])[0],rowDrag:!1},...(ts.columnDefs||[]).slice(1),{headerName:"Action",pinned:"right",minWidth:110,maxWidth:110,resizable:!1,valueGetter:({data:a})=>a==null?void 0:a.id,cellRenderer:({api:a,data:d,value:c})=>{if(!d)return;const h=`
<div class="inline-flex mt-1" role="group">
<button type="button" title="Requeue" class="ts-btn-action primary ts-btn-run">
${tf}
</button>
<button type="button" title="Delete" class="ts-btn-action stop ts-btn-delete">
${Qc}
</button>
</div>
`,g=document.createElement("div");g.innerHTML=h;const f=g.firstElementChild;return f.querySelector("button.ts-btn-run").addEventListener("click",y=>{y.preventDefault(),y.stopPropagation(),l.requeueTask(c).then(v=>{ut(v)})}),f.querySelector("button.ts-btn-delete").addEventListener("click",y=>{y.preventDefault(),y.stopPropagation(),a.showLoadingOverlay(),Ot.deleteTask(c).then(v=>{ut(v),a.applyTransaction({remove:[d]}),a.hideOverlay()})}),f}}],rowSelection:"single",suppressRowDeselection:!0,onColumnMoved({columnApi:a}){const d=a.getColumnState(),c=JSON.stringify(d);localStorage.setItem("agent_scheduler:history_col_state",c)},onSortChanged({columnApi:a}){const d=a.getColumnState(),c=JSON.stringify(d);localStorage.setItem("agent_scheduler:history_col_state",c)},onColumnResized({columnApi:a}){const d=a.getColumnState(),c=JSON.stringify(d);localStorage.setItem("agent_scheduler:history_col_state",c)},onGridReady:({api:a,columnApi:d})=>{iu("#agent_scheduler_action_search_history").addEventListener("keyup",Xc(f=>{a.setQuickFilter(f.target.value)},200));const h=f=>{a.setRowData(f.tasks),a.clearFocusedCell(),d.autoSizeAllColumns()};l.subscribe(h),h(l.getState());const g=localStorage.getItem("agent_scheduler:history_col_state");if(g){const f=JSON.parse(g);d.applyColumnState({state:f,applyOrder:!0})}},onSelectionChanged:a=>{const[d]=a.api.getSelectedRows();d&&(i.value=d.id,i.dispatchEvent(new Event("input",{bubbles:!0})))},onCellEditRequest:({data:a,newValue:d,api:c,colDef:h})=>{h.field==="name"&&d&&(c.showLoadingOverlay(),br.renameTask(a.id,d).then(g=>{ut(g);const m={update:[{...a,name:d}]};c.applyTransaction(m),c.hideOverlay()}))}},r=gradioApp().querySelector("#agent_scheduler_history_tasks_grid");new Uc(r,n)}let su=!1;onUiLoaded(function l(){if(!document.getElementById("agent_scheduler_tabs")){setTimeout(l,500);return}su||(hf(),pf(),gf(),ff(),su=!0)});/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var ht=function(){return ht=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++){t=arguments[i];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},ht.apply(this,arguments)},ou=function(){function l(e){this.options=e,this.listeners={}}return l.prototype.on=function(e,t){var i=this.listeners[e]||[];this.listeners[e]=i.concat([t])},l.prototype.triggerEvent=function(e,t){var i=this,s=this.listeners[e]||[];s.forEach(function(o){return o({target:i,event:t})})},l}(),is;(function(l){l[l.Add=0]="Add",l[l.Remove=1]="Remove"})(is||(is={}));var nu=function(){function l(){this.notifications=[]}return l.prototype.push=function(e){this.notifications.push(e),this.updateFn(e,is.Add,this.notifications)},l.prototype.splice=function(e,t){var i=this.notifications.splice(e,t)[0];return this.updateFn(i,is.Remove,this.notifications),i},l.prototype.indexOf=function(e){return this.notifications.indexOf(e)},l.prototype.onUpdate=function(e){this.updateFn=e},l}(),ri;(function(l){l.Dismiss="dismiss",l.Click="click"})(ri||(ri={}));var Aa={types:[{type:"success",className:"notyf__toast--success",backgroundColor:"#3dc763",icon:{className:"notyf__icon--success",tagName:"i"}},{type:"error",className:"notyf__toast--error",backgroundColor:"#ed3d3d",icon:{className:"notyf__icon--error",tagName:"i"}}],duration:2e3,ripple:!0,position:{x:"right",y:"bottom"},dismissible:!1},ru=function(){function l(){this.notifications=[],this.events={},this.X_POSITION_FLEX_MAP={left:"flex-start",center:"center",right:"flex-end"},this.Y_POSITION_FLEX_MAP={top:"flex-start",center:"center",bottom:"flex-end"};var e=document.createDocumentFragment(),t=this._createHTMLElement({tagName:"div",className:"notyf"});e.appendChild(t),document.body.appendChild(e),this.container=t,this.animationEndEventName=this._getAnimationEndEventName(),this._createA11yContainer()}return l.prototype.on=function(e,t){var i;this.events=ht(ht({},this.events),(i={},i[e]=t,i))},l.prototype.update=function(e,t){t===is.Add?this.addNotification(e):t===is.Remove&&this.removeNotification(e)},l.prototype.removeNotification=function(e){var t=this,i=this._popRenderedNotification(e),s;if(i){s=i.node,s.classList.add("notyf__toast--disappear");var o;s.addEventListener(this.animationEndEventName,o=function(n){n.target===s&&(s.removeEventListener(t.animationEndEventName,o),t.container.removeChild(s))})}},l.prototype.addNotification=function(e){var t=this._renderNotification(e);this.notifications.push({notification:e,node:t}),this._announce(e.options.message||"Notification")},l.prototype._renderNotification=function(e){var t,i=this._buildNotificationCard(e),s=e.options.className;return s&&(t=i.classList).add.apply(t,s.split(" ")),this.container.appendChild(i),i},l.prototype._popRenderedNotification=function(e){for(var t=-1,i=0;i<this.notifications.length&&t<0;i++)this.notifications[i].notification===e&&(t=i);if(t!==-1)return this.notifications.splice(t,1)[0]},l.prototype.getXPosition=function(e){var t;return((t=e==null?void 0:e.position)===null||t===void 0?void 0:t.x)||"right"},l.prototype.getYPosition=function(e){var t;return((t=e==null?void 0:e.position)===null||t===void 0?void 0:t.y)||"bottom"},l.prototype.adjustContainerAlignment=function(e){var t=this.X_POSITION_FLEX_MAP[this.getXPosition(e)],i=this.Y_POSITION_FLEX_MAP[this.getYPosition(e)],s=this.container.style;s.setProperty("justify-content",i),s.setProperty("align-items",t)},l.prototype._buildNotificationCard=function(e){var t=this,i=e.options,s=i.icon;this.adjustContainerAlignment(i);var o=this._createHTMLElement({tagName:"div",className:"notyf__toast"}),n=this._createHTMLElement({tagName:"div",className:"notyf__ripple"}),r=this._createHTMLElement({tagName:"div",className:"notyf__wrapper"}),a=this._createHTMLElement({tagName:"div",className:"notyf__message"});a.innerHTML=i.message||"";var d=i.background||i.backgroundColor;if(s){var c=this._createHTMLElement({tagName:"div",className:"notyf__icon"});if((typeof s=="string"||s instanceof String)&&(c.innerHTML=new String(s).valueOf()),typeof s=="object"){var h=s.tagName,g=h===void 0?"i":h,f=s.className,m=s.text,C=s.color,y=C===void 0?d:C,v=this._createHTMLElement({tagName:g,className:f,text:m});y&&(v.style.color=y),c.appendChild(v)}r.appendChild(c)}if(r.appendChild(a),o.appendChild(r),d&&(i.ripple?(n.style.background=d,o.appendChild(n)):o.style.background=d),i.dismissible){var E=this._createHTMLElement({tagName:"div",className:"notyf__dismiss"}),b=this._createHTMLElement({tagName:"button",className:"notyf__dismiss-btn"});E.appendChild(b),r.appendChild(E),o.classList.add("notyf__toast--dismissible"),b.addEventListener("click",function(F){var L,I;(I=(L=t.events)[ri.Dismiss])===null||I===void 0||I.call(L,{target:e,event:F}),F.stopPropagation()})}o.addEventListener("click",function(F){var L,I;return(I=(L=t.events)[ri.Click])===null||I===void 0?void 0:I.call(L,{target:e,event:F})});var _=this.getYPosition(i)==="top"?"upper":"lower";return o.classList.add("notyf__toast--"+_),o},l.prototype._createHTMLElement=function(e){var t=e.tagName,i=e.className,s=e.text,o=document.createElement(t);return i&&(o.className=i),o.textContent=s||null,o},l.prototype._createA11yContainer=function(){var e=this._createHTMLElement({tagName:"div",className:"notyf-announcer"});e.setAttribute("aria-atomic","true"),e.setAttribute("aria-live","polite"),e.style.border="0",e.style.clip="rect(0 0 0 0)",e.style.height="1px",e.style.margin="-1px",e.style.overflow="hidden",e.style.padding="0",e.style.position="absolute",e.style.width="1px",e.style.outline="0",document.body.appendChild(e),this.a11yContainer=e},l.prototype._announce=function(e){var t=this;this.a11yContainer.textContent="",setTimeout(function(){t.a11yContainer.textContent=e},100)},l.prototype._getAnimationEndEventName=function(){var e=document.createElement("_fake"),t={MozTransition:"animationend",OTransition:"oAnimationEnd",WebkitTransition:"webkitAnimationEnd",transition:"animationend"},i;for(i in t)if(e.style[i]!==void 0)return t[i];return"animationend"},l}(),Cf=function(){function l(e){var t=this;this.dismiss=this._removeNotification,this.notifications=new nu,this.view=new ru;var i=this.registerTypes(e);this.options=ht(ht({},Aa),e),this.options.types=i,this.notifications.onUpdate(function(s,o){return t.view.update(s,o)}),this.view.on(ri.Dismiss,function(s){var o=s.target,n=s.event;t._removeNotification(o),o.triggerEvent(ri.Dismiss,n)}),this.view.on(ri.Click,function(s){var o=s.target,n=s.event;return o.triggerEvent(ri.Click,n)})}return l.prototype.error=function(e){var t=this.normalizeOptions("error",e);return this.open(t)},l.prototype.success=function(e){var t=this.normalizeOptions("success",e);return this.open(t)},l.prototype.open=function(e){var t=this.options.types.find(function(o){var n=o.type;return n===e.type})||{},i=ht(ht({},t),e);this.assignProps(["ripple","position","dismissible"],i);var s=new ou(i);return this._pushNotification(s),s},l.prototype.dismissAll=function(){for(;this.notifications.splice(0,1););},l.prototype.assignProps=function(e,t){var i=this;e.forEach(function(s){t[s]=t[s]==null?i.options[s]:t[s]})},l.prototype._pushNotification=function(e){var t=this;this.notifications.push(e);var i=e.options.duration!==void 0?e.options.duration:this.options.duration;i&&setTimeout(function(){return t._removeNotification(e)},i)},l.prototype._removeNotification=function(e){var t=this.notifications.indexOf(e);t!==-1&&this.notifications.splice(t,1)},l.prototype.normalizeOptions=function(e,t){var i={type:e};return typeof t=="string"?i.message=t:typeof t=="object"&&(i=ht(ht({},i),t)),i},l.prototype.registerTypes=function(e){var t=(e&&e.types||[]).slice(),i=Aa.types.map(function(s){var o=-1;t.forEach(function(r,a){r.type===s.type&&(o=a)});var n=o!==-1?t.splice(o,1)[0]:{};return ht(ht({},s),n)});return i.concat(t)},l}();const mf=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_OPTIONS:Aa,Notyf:Cf,NotyfArray:nu,get NotyfArrayEvent(){return is},get NotyfEvent(){return ri},NotyfNotification:ou,NotyfView:ru},Symbol.toStringTag,{value:"Module"}))})();