@arbocollab/arbo-plugin-item-table 0.1.166 → 0.1.167
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/es/index.es.js +4 -4
- package/lib/style.css +1 -1
- package/lib/umd/index.umd.js +3 -3
- package/package.json +1 -1
package/lib/umd/index.umd.js
CHANGED
|
@@ -257,7 +257,7 @@ See ${jL(e,t)}`;return Array.isArray(o)?o.concat(r):[o,r]}var Fve={1:"Charting A
|
|
|
257
257
|
`)}checkProperties(e,t,n,o,s){const r=["__ob__","__v_skip","__metadata__"],i=Xve(Object.getOwnPropertyNames(e),[...r,...t,...n],n),a=Object.keys(i);for(const l of a){const c=i[l];let u=`invalid ${o} property '${l}' did you mean any of these: ${c.slice(0,8).join(", ")}.`;n.includes("context")&&(u+=`
|
|
258
258
|
If you are trying to annotate ${o} with application data, use the '${o}.context' property instead.`),ip(u)}if(a.length>0&&s){const l=this.beans.frameworkOverrides.getDocLink(s);ip(`to see all the valid ${o} properties please check: ${l}`)}}};function Xve(e,t,n){const o={},s=e.filter(r=>!t.some(i=>i===r));if(s.length>0)for(const r of s)o[r]=O0({inputValue:r,allSuggestions:n}).values;return o}var Jve=new Set(["firstChildChanged","lastChildChanged","childIndexChanged"]),Qve={moduleName:"Validation",version:dt,beans:[Zve]};function zB(e){const t=e.sibling;t&&(t.childrenAfterFilter=e.childrenAfterFilter)}var eye=class extends We{constructor(){super(...arguments),this.beanName="filterStage",this.step="filter",this.refreshProps=["excludeChildrenWhenTreeDataFiltering"]}wireBeans(e){this.filterManager=e.filterManager}execute(e){const{changedPath:t}=e;this.filter(t)}filter(e){var n;const t=!!((n=this.filterManager)!=null&&n.isChildFilterPresent());this.filterNodes(t,e)}filterNodes(e,t){const n=(o,s)=>{o.hasChildren()&&e&&!s?o.childrenAfterFilter=o.childrenAfterGroup.filter(r=>{const i=r.childrenAfterFilter&&r.childrenAfterFilter.length>0,a=r.data&&this.filterManager.doesRowPassFilter({rowNode:r});return i||a}):o.childrenAfterFilter=o.childrenAfterGroup,zB(o)};if(this.doingTreeDataFiltering()){const o=(r,i)=>{if(r.childrenAfterGroup)for(let a=0;a<r.childrenAfterGroup.length;a++){const l=r.childrenAfterGroup[a],c=i||this.filterManager.doesRowPassFilter({rowNode:l});l.childrenAfterGroup?o(r.childrenAfterGroup[a],c):n(l,c)}n(r,i)},s=r=>o(r,!1);t.executeFromRootNode(s)}else{const o=s=>n(s,!1);t.forEachChangedNodeDepthFirst(o,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}},tye=class extends u_{constructor(){super(...arguments),this.iconCreated=!1}wireComp(e,t,n,o,s){this.comp=e;const r=fp(this,this.beans.context,s);this.eButtonShowMainFilter=n,this.eFloatingFilterBody=o,this.setGui(t,r),this.setupActive(),this.refreshHeaderStyles(),this.setupWidth(r),this.setupLeft(r),this.setupHover(r),this.setupFocus(r),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(r),this.setupUi(),r.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(r);const i=()=>this.onColDefChanged(r);r.addManagedListeners(this.column,{colDefChanged:i}),r.addManagedEventListeners({filterSwitched:({column:a})=>{a===this.column&&i()}}),r.addDestroyFunc(()=>{this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.clearComponent()})}resizeHeader(){}moveHeader(){}getHeaderClassParams(){const{column:e,beans:t}=this,n=e.colDef;return Pt(t.gos,{colDef:n,column:e,floatingFilter:!0})}setupActive(){const e=this.column.getColDef(),t=!!e.filter,n=!!e.floatingFilter;this.active=t&&n}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=hr("filter",this.beans,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(e){e.createManagedBean(new Ad(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.getLocaleTextFunc();yd(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){var i;const{beans:t}=this;if(Wn(t)===this.eGui)return;const s=Fc(t,this.eGui,null,e.shiftKey);if(s){(i=t.headerNavigation)==null||i.scrollToColumn(this.column),e.preventDefault(),s.focus();return}const r=this.findNextColumnWithFloatingFilter(e.shiftKey);r&&t.focusSvc.focusHeaderPosition({headerPosition:{headerRowIndex:this.rowCtrl.rowIndex,column:r},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.visibleCols;let n=this.column;do if(n=e?t.getColBefore(n):t.getColAfter(n),!n)break;while(!n.getColDef().filter||!n.getColDef().floatingFilter);return n}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case Oe.UP:case Oe.DOWN:case Oe.LEFT:case Oe.RIGHT:if(t)return;Ac(e);case Oe.ENTER:t&&xc(this.eGui)&&e.preventDefault();break;case Oe.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const n=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),o=!!e.relatedTarget&&Sc(e.relatedTarget,"ag-floating-filter");if(n&&o&&e.target===this.eGui){const s=this.lastFocusEvent,r=!!(s&&s.key===Oe.TAB);if(s&&r){const i=s.shiftKey;xc(this.eGui,i)}}this.focusThis()}setupHover(e){var t;(t=this.beans.colHover)==null||t.addHeaderFilterColumnHoverListener(e,this.comp,this.column,this.eGui)}setupLeft(e){const t=new c_(this.column,this.eGui,this.beans);e.createManagedBean(t)}setupFilterButton(){var e;this.suppressFilterButton=!((e=this.beans.menuSvc)!=null&&e.isFloatingFilterButtonEnabled(this.column)),this.highlightFilterButtonWhenActive=!Hs(this.gos)}setupUserComp(){var t;if(!this.active)return;const e=(t=this.beans.colFilter)==null?void 0:t.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){var t;const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;(t=this.beans.menuSvc)==null||t.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(e){if(!this.active)return;const{beans:{colFilter:t},column:n,gos:o}=this,s=r=>{if((r==null?void 0:r.source)==="filterDestroyed"&&(!this.isAlive()||!(t!=null&&t.isAlive())))return;const i=this.comp.getFloatingFilterComp();i&&i.then(a=>{if(a){if(o.get("enableFilterHandlers")){const u=r;let d="filter";u!=null&&u.afterFloatingFilter?d="ui":u!=null&&u.afterDataChange?d="dataChanged":(r==null?void 0:r.source)==="api"&&(d="api"),this.updateFloatingFilterParams(this.userCompDetails,d);return}const l=t==null?void 0:t.getCurrentFloatingFilterParentModel(n),c=r?{...r,columns:r.columns??[],source:r.source==="api"?"api":"columnFilter"}:null;a.onParentModelChanged(l,c)}})};[this.destroySyncListener]=e.addManagedListeners(n,{filterChanged:s}),t!=null&&t.isFilterActive(n)&&s(null)}setupWidth(e){const t=()=>{const n=`${this.column.getActualWidth()}px`;this.comp.setWidth(n)};e.addManagedListeners(this.column,{widthChanged:t}),t()}setupFilterChangedListener(e){this.active&&([this.destroyFilterChangedListener]=e.addManagedListeners(this.column,{filterChanged:this.updateFilterButton.bind(this)}),this.updateFilterButton())}updateFilterButton(){var e;if(!this.suppressFilterButton&&this.comp){const t=!!((e=this.beans.filterManager)!=null&&e.isFilterAllowed(this.column));this.comp.setButtonWrapperDisplayed(t),this.highlightFilterButtonWhenActive&&t&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(e){const t=this.active;this.setupActive();const n=!t&&this.active;t&&!this.active&&(this.destroySyncListener(),this.destroyFilterChangedListener());const o=this.beans.colFilter,s=this.active?o==null?void 0:o.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,r=this.comp.getFloatingFilterComp();!r||!s?this.updateCompDetails(e,s,n):r.then(i=>{!i||o!=null&&o.areFilterCompsDifferent(this.userCompDetails??null,s)?this.updateCompDetails(e,s,n):this.updateFloatingFilterParams(s,"colDef")})}updateCompDetails(e,t,n){this.isAlive()&&(this.setCompDetails(t),this.setupFilterButton(),this.setupUi(),n&&(this.setupSyncWithFilter(e),this.setupFilterChangedListener(e)))}updateFloatingFilterParams(e,t){var o;if(!e)return;let n=e.params;(o=this.comp.getFloatingFilterComp())==null||o.then(s=>{var r;typeof(s==null?void 0:s.refresh)=="function"&&(this.gos.get("enableFilterHandlers")&&(n={...n,model:xo(((r=this.beans.colFilter)==null?void 0:r.model)??{},this.column.getColId()),source:t}),s.refresh(n))})}addResizeAndMoveKeyboardListeners(){}destroy(){super.destroy(),this.destroySyncListener=null,this.destroyFilterChangedListener=null}};function nye(e,t){var o;const n=e.colModel.getCol(t);if(!n){_n(12,{colKey:t});return}(o=e.menuSvc)==null||o.showColumnMenu({column:n,positionBy:"auto"})}function oye(e){var t;(t=e.menuSvc)==null||t.hidePopupMenu()}var sye={moduleName:"SharedMenu",version:dt,beans:[gde],apiFunctions:{showColumnMenu:nye,hidePopupMenu:oye}},rye=class extends Nce{postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridCtrl=e.gridCtrl}),this.addManagedEventListeners({gridStylesChanged:this.handleThemeChange.bind(this)})}getDefaultPopupParent(){return this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:n,event:o}=e,s=t.getBoundingClientRect(),r=this.getParentRect();this.setAlignedTo(t,n);let i=!1;const a=()=>{const l=this.keepXYWithinBounds(n,s.top-r.top,0),c=n.clientWidth>0?n.clientWidth:200;i||(n.style.minWidth=`${c}px`,i=!0);const d=r.right-r.left-c;let h;return this.gos.get("enableRtl")?(h=p(),h<0&&(h=f(),this.setAlignedStyles(n,"left")),h>d&&(h=0,this.setAlignedStyles(n,"right"))):(h=f(),h>d&&(h=p(),this.setAlignedStyles(n,"right")),h<0&&(h=0,this.setAlignedStyles(n,"left"))),{x:h,y:l};function f(){return s.right-r.left-2}function p(){return s.left-r.left-c}};this.positionPopup({ePopup:n,keepWithinBounds:!0,updatePosition:a,postProcessCallback:()=>this.callPostProcessPopup(e,"subMenu",n,t,o instanceof MouseEvent?o:void 0)})}callPostProcessPopup(e,t,n,o,s){const r=this.gos.getCallback("postProcessPopup");if(r){const{column:i,rowNode:a}=e;r({column:i,rowNode:a,ePopup:n,type:t,eventSource:o,mouseEvent:s})}}getActivePopups(){return this.popupList.map(e=>e.element)}handleThemeChange(e){if(e.themeChanged){const t=this.beans.environment;for(const n of this.popupList)t.applyThemeClasses(n.wrapper)}}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isStopPropagation(e){return wa(e)}},Uy={moduleName:"Popup",version:dt,beans:[rye]},iye=".ag-set-filter{--ag-indentation-level:0}.ag-set-filter-item{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-set-filter-item{padding-left:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}:where(.ag-rtl) .ag-set-filter-item{padding-right:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}.ag-set-filter-item-checkbox{display:flex;height:100%;width:100%}.ag-set-filter-group-icons{display:block;>*{cursor:pointer}}:where(.ag-ltr) .ag-set-filter-group-icons{margin-right:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-set-filter-group-icons{margin-left:var(--ag-widget-container-horizontal-padding)}.ag-filter-body-wrapper{display:flex;flex-direction:column}:where(.ag-menu:not(.ag-tabs) .ag-filter) .ag-filter-body-wrapper,:where(.ag-menu:not(.ag-tabs) .ag-filter)>:not(.ag-filter-wrapper){min-width:180px}.ag-filter-filter{flex:1 1 0px}.ag-filter-condition{display:flex;justify-content:center}.ag-floating-filter-body{display:flex;flex:1 1 auto;height:100%;position:relative}.ag-floating-filter-full-body{align-items:center;display:flex;flex:1 1 auto;height:100%;overflow:hidden;width:100%}:where(.ag-floating-filter-full-body)>div{flex:1 1 auto}.ag-floating-filter-input{align-items:center;display:flex;width:100%;>*{flex:1 1 auto}:where(.ag-input-field-input[type=date]),:where(.ag-input-field-input[type=datetime-local]){width:1px}}.ag-floating-filter-button{display:flex;flex:none}.ag-date-floating-filter-wrapper{display:flex}.ag-set-floating-filter-input :where(input)[disabled]{pointer-events:none}.ag-floating-filter-button-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;height:var(--ag-icon-size);width:var(--ag-icon-size)}.ag-filter-loading{align-items:unset;background-color:var(--ag-chrome-background-color);height:100%;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;width:100%;z-index:1;:where(.ag-menu) &{background-color:var(--ag-menu-background-color)}}.ag-filter-separator{border-top:solid var(--ag-border-width) var(--menu-separator-color)}:where(.ag-filter-select) .ag-picker-field-wrapper{width:0}.ag-filter-condition-operator{height:17px}:where(.ag-ltr) .ag-filter-condition-operator-or{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-condition-operator-or{margin-right:calc(var(--ag-spacing)*2)}.ag-set-filter-select-all{padding-top:var(--ag-widget-container-vertical-padding)}.ag-filter-no-matches,.ag-set-filter-list{height:calc(var(--ag-list-item-height)*6)}.ag-filter-no-matches{padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}.ag-set-filter-tree-list{height:calc(var(--ag-list-item-height)*10)}.ag-set-filter-filter{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding);margin-top:var(--ag-widget-container-vertical-padding)}.ag-filter-to{margin-top:var(--ag-widget-vertical-spacing)}.ag-mini-filter{margin:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-set-filter-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-rtl) .ag-set-filter-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-filter-menu) .ag-set-filter-list{min-width:200px}.ag-filter-virtual-list-item:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-filter-apply-panel{display:flex;justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-vertical-spacing) var(--ag-widget-container-horizontal-padding) var(--ag-widget-container-vertical-padding)}.ag-filter-apply-panel-button{line-height:1.5}:where(.ag-ltr) .ag-filter-apply-panel-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-apply-panel-button{margin-right:calc(var(--ag-spacing)*2)}.ag-simple-filter-body-wrapper{display:flex;flex-direction:column;min-height:calc(var(--ag-list-item-height) + var(--ag-widget-container-vertical-padding) + var(--ag-widget-vertical-spacing));overflow-y:auto;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);padding-bottom:calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing));&>*{margin-bottom:var(--ag-widget-vertical-spacing)}:where(.ag-resizer-wrapper){margin:0}}.ag-multi-filter-menu-item{margin:var(--ag-spacing) 0}.ag-multi-filter-group-title-bar{background-color:transparent;color:var(--ag-header-text-color);font-weight:500;padding:calc(var(--ag-spacing)*1.5) var(--ag-spacing)}.ag-group-filter-field-select-wrapper{display:flex;flex-direction:column;gap:var(--ag-widget-vertical-spacing);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}";function aye(e){const t=e.filterManager;return!!(t!=null&&t.isColumnFilterPresent())||!!(t!=null&&t.isAggregateFilterPresent())}function lye(e,t){var n;return((n=e.filterManager)==null?void 0:n.getColumnFilterInstance(t))??Promise.resolve(void 0)}function cye(e,t){var o;const n=e.colModel.getColDefCol(t);if(n)return(o=e.colFilter)==null?void 0:o.destroyFilter(n,"api")}function uye(e,t){e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=e.filterManager)==null?void 0:n.setFilterModel(t)})}function dye(e){var t;return((t=e.filterManager)==null?void 0:t.getFilterModel())??{}}function hye(e,t,n){const{gos:o,colModel:s,colFilter:r}=e;n&&!o.get("enableFilterHandlers")&&(Je(288),n=!1);const i=s.getColDefCol(t);return i?(r==null?void 0:r.getModelForColumn(i,n))??null:null}function fye(e,t,n){var o;return((o=e.filterManager)==null?void 0:o.setColumnFilterModel(t,n))??Promise.resolve()}function pye(e,t){var o;const n=e.colModel.getCol(t);if(!n){_n(12,{colKey:t});return}(o=e.menuSvc)==null||o.showFilterMenu({column:n,containerType:"columnFilter",positionBy:"auto"})}function gye(e){var t;(t=e.menuSvc)==null||t.hideFilterMenu()}function mye(e,t){var o;const n=e.colModel.getCol(t);if(!n){_n(12,{colKey:t});return}return(o=e.colFilter)==null?void 0:o.getHandler(n,!0)}function vye(e,t){const{colModel:n,colFilter:o,gos:s}=e;if(!s.get("enableFilterHandlers")){Je(287);return}const{colId:r,action:i}=t;if(r){const a=n.getColById(r);a&&(o==null||o.updateModel(a,i))}else o==null||o.updateAllModels(i)}var yye={filterHandler:()=>({doesFilterPass:()=>!0})},wye=class extends We{constructor(){super(...arguments),this.beanName="colFilter",this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.modelUpdates=[],this.columnModelUpdates=[],this.state=new Map,this.handlerMap={...nV},this.isGlobalButtons=!1,this.activeFilterComps=new Set}postConstruct(){var n,o;this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)});const e=this.gos,t={...((o=(n=e.get("initialState"))==null?void 0:n.filter)==null?void 0:o.filterModel)??{}};this.initialModel=t,this.model={...t},e.get("enableFilterHandlers")||delete this.handlerMap.agMultiColumnFilter}refreshModel(){this.onNewRowsLoaded("rowDataUpdated")}setModel(e,t="api",n){const{colModel:o,dataTypeSvc:s,filterManager:r}=this.beans;if(s!=null&&s.isPendingInference){this.modelUpdates.push({model:e,source:t});return}const i=[],a=this.getModel(!0);if(e){const l=new Set(Object.keys(e));this.allColumnFilters.forEach((c,u)=>{const d=e[u];i.push(this.setModelOnFilterWrapper(c,d)),l.delete(u)}),l.forEach(c=>{const u=o.getColDefCol(c)||o.getCol(c);if(!u){Je(62,{colId:c});return}if(!u.isFilterAllowed()){Je(63,{colId:c});return}const d=this.getOrCreateFilterWrapper(u,!0);if(!d){Je(64,{colId:c});return}i.push(this.setModelOnFilterWrapper(d,e[c],!0))})}else this.model={},this.allColumnFilters.forEach(l=>{i.push(this.setModelOnFilterWrapper(l,null))});Kn.all(i).then(()=>{const l=this.getModel(!0),c=[];this.allColumnFilters.forEach((u,d)=>{const h=a?a[d]:null,f=l?l[d]:null;Yf(h,f)||c.push(u.column)}),c.length>0?r==null||r.onFilterChanged({columns:c,source:t}):n&&this.updateActive("filterChanged")})}getModel(e){var r;const t={},{allColumnFilters:n,initialModel:o,beans:{colModel:s}}=this;if(n.forEach((i,a)=>{const l=this.getModelFromFilterWrapper(i);ft(l)&&(t[a]=l)}),!e)for(const i of Object.keys(o)){const a=o[i];ft(a)&&!n.has(i)&&((r=s.getCol(i))!=null&&r.isFilterAllowed())&&(t[i]=a)}return t}setState(e,t,n="api"){if(this.state.clear(),t)for(const o of Object.keys(t)){const s=t[o];this.state.set(o,{model:xo(this.model,o),state:s})}this.setModel(e,n,!0)}getState(){const e=this.state;if(!e.size)return;const t={};let n=!1;return e.forEach((o,s)=>{const r=o.state;r!=null&&(n=!0,t[s]=r)}),n?t:void 0}getModelFromFilterWrapper(e){const n=e.column.getColId();if(e.isHandler)return xo(this.model,n);const o=e.filter;return o?typeof o.getModel!="function"?(Je(66),null):o.getModel():xo(this.initialModel,n)}isFilterPresent(){return this.activeColumnFilters.length>0}isAggFilterPresent(){return!!this.activeAggregateFilters.length}disableFilters(){this.initialModel={};const{allColumnFilters:e}=this;return e.size?(e.forEach(t=>this.disposeFilterWrapper(t,"advancedFilterEnabled")),!0):!1}updateActiveFilters(){const e=c=>c?c.isFilterActive?c.isFilterActive():(Je(67),!1):!1,{colModel:t,gos:n}=this.beans,o=!!p0(n),s=c=>{if(!c.isPrimary())return!0;const d=!t.isPivotActive();return!c.isValueActive()||!d?!1:t.isPivotMode()?!0:o},r=[],i=[],a=(c,u,d)=>{u&&(s(c)?r.push(d):i.push(d))},l=[];return this.allColumnFilters.forEach(c=>{const u=c.column,d=u.getColId();if(c.isHandler)l.push(Kn.resolve().then(()=>{a(u,this.isHandlerActive(u),{colId:d,isHandler:!0,handler:c.handler,handlerParams:c.handlerParams})}));else{const h=gl(c);h&&l.push(h.then(f=>{a(u,e(f),{colId:d,isHandler:!1,comp:f})}))}}),Kn.all(l).then(()=>{this.activeAggregateFilters=r,this.activeColumnFilters=i})}updateFilterFlagInColumns(e,t){var o;const n=[];return this.allColumnFilters.forEach(s=>{const r=s.column;if(s.isHandler)n.push(Kn.resolve().then(()=>{this.setColFilterActive(r,this.isHandlerActive(r),e,t)}));else{const i=gl(s);i&&n.push(i.then(a=>{this.setColFilterActive(r,a.isFilterActive(),e,t)}))}}),(o=this.beans.groupFilter)==null||o.updateFilterFlags(e,t),Kn.all(n)}doFiltersPass(e,t,n){const{data:o,aggData:s}=e,r=n?this.activeAggregateFilters:this.activeColumnFilters,i=n?s:o,a=this.model;for(let l=0;l<r.length;l++){const c=r[l],{colId:u,isHandler:d}=c;if(u!==t)if(d){const{handler:h,handlerParams:f}=c;if(!h.doesFilterPass({node:e,data:i,model:xo(a,u),handlerParams:f}))return!1}else{const h=c.comp;if(typeof h.doesFilterPass!="function"){_n(91);continue}if(!h.doesFilterPass({node:e,data:i}))return!1}}return!0}getHandlerParams(e){const t=this.allColumnFilters.get(e.getColId());return t!=null&&t.isHandler?t.handlerParams:void 0}callOnFilterChangedOutsideRenderCycle(e){const{rowRenderer:t,filterManager:n}=this.beans,o=()=>{this.isAlive()&&(n==null||n.onFilterChanged(e))};t.isRefreshInProgress()?setTimeout(o,0):o()}updateBeforeFilterChanged(e={}){const{column:t,additionalEventAttributes:n}=e,o=t==null?void 0:t.getColId();return this.updateActiveFilters().then(()=>this.updateFilterFlagInColumns("filterChanged",n).then(()=>{this.allColumnFilters.forEach(s=>{var a,l,c;const{column:r,isHandler:i}=s;o!==r.getColId()&&(i&&((l=(a=s.handler).onAnyFilterChanged)==null||l.call(a)),(c=gl(s,i))==null||c.then(u=>{typeof(u==null?void 0:u.onAnyFilterChanged)=="function"&&u.onAnyFilterChanged()}))}),this.processingFilterChange=!0}))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!(this.gos.get("allowShowChangeAfterFilter")??!1)&&this.processingFilterChange}onNewRowsLoaded(e){const t=[];this.allColumnFilters.forEach(n=>{var r,i;const o=n.isHandler;o&&((i=(r=n.handler).onNewRowsLoaded)==null||i.call(r));const s=gl(n,o);s&&t.push(s.then(a=>{var l;(l=a.onNewRowsLoaded)==null||l.call(a)}))}),Kn.all(t).then(()=>this.updateActive(e,{afterDataChange:!0}))}updateActive(e,t){this.updateFilterFlagInColumns(e,t).then(()=>this.updateActiveFilters())}createGetValue(e,t){const{filterValueSvc:n,colModel:o}=this.beans;return(s,r)=>{const i=r?o.getCol(r):e;return i?n.getValue(i,s,t):void 0}}isFilterActive(e){const t=this.cachedFilter(e);if(t!=null&&t.isHandler)return this.isHandlerActive(e);const n=t==null?void 0:t.filter;return n?n.isFilterActive():xo(this.initialModel,e.getColId())!=null}isHandlerActive(e){const t=ft(xo(this.model,e.getColId()));if(t)return t;const n=this.beans.groupFilter;return n!=null&&n.isGroupFilter(e)?n.isFilterActive(e):!1}getOrCreateFilterUi(e){const t=this.getOrCreateFilterWrapper(e,!0);return t?gl(t):null}getFilterUiForDisplay(e){const t=this.getOrCreateFilterWrapper(e,!0);if(!t)return null;const n=gl(t);return n?n.then(o=>({comp:o,params:t.filterUi.filterParams,isHandler:t.isHandler})):null}getHandler(e,t){const n=this.getOrCreateFilterWrapper(e,t);return n!=null&&n.isHandler?n.handler:void 0}getOrCreateFilterWrapper(e,t){if(!e.isFilterAllowed())return;let n=this.cachedFilter(e);return!n&&t&&(n=this.createFilterWrapper(e),this.setColumnFilterWrapper(e,n)),n}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e,t=!1){return this.getDefaultFilterFromDataType(()=>{var n;return(n=this.beans.dataTypeSvc)==null?void 0:n.getBaseDataType(e)},t)}getDefaultFilterFromDataType(e,t=!1){return yae(this.gos)?t?"agSetColumnFloatingFilter":"agSetColumnFilter":iue(e(),t)}getDefaultFloatingFilter(e){return this.getDefaultFilter(e,!0)}createFilterComp(e,t,n,o,s,r){const i=()=>{const c=this.createFilterCompParams(e,s,r),u=o(c,s);return ble(this.beans.userCompFactory,t,u,n)},a=i();return a?{compDetails:a,createFilterUi:c=>(c?i():a).newAgStackInstance()}:null}createFilterInstance(e,t,n,o){var d,h;const s=this.beans.selectableFilter;s!=null&&s.isSelectable(t)&&(t=s.getFilterDef(e,t));const{handler:r,handlerParams:i,handlerGenerator:a}=this.createHandler(e,t,n)??{},l=this.createFilterComp(e,t,n,o,!!r,"init");if(!l)return{compDetails:null,createFilterUi:null,handler:r,handlerGenerator:a,handlerParams:i};const{compDetails:c,createFilterUi:u}=l;return this.isGlobalButtons&&((h=(d=c.params)==null?void 0:d.buttons)!=null&&h.length||Je(281,{colId:e.getColId()})),{compDetails:c,handler:r,handlerGenerator:a,handlerParams:i,createFilterUi:u}}createBaseFilterParams(e,t){const{filterManager:n,rowModel:o}=this.beans;return Pt(this.gos,{column:e,colDef:e.getColDef(),getValue:this.createGetValue(e),doesRowPassOtherFilter:t?()=>!0:s=>(n==null?void 0:n.doesRowPassOtherFilters(e.getColId(),s))??!0,rowModel:o})}createFilterCompParams(e,t,n,o){const s=this.filterChangedCallbackFactory(e),r=this.createBaseFilterParams(e,o);if(r.filterChangedCallback=s,r.filterModifiedCallback=o?()=>{}:i=>this.filterModified(e,i),t){const i=r,a=e.getColId(),l=xo(this.model,a);i.model=l,i.state=this.state.get(a)??{model:l},i.onModelChange=(c,u)=>{this.updateStoredModel(a,c),this.refreshHandlerAndUi(e,c,"ui",!1,u).then(()=>{s({...u,source:"columnFilter"})})},i.onStateChange=c=>{this.updateState(e,c),this.updateOrRefreshFilterUi(e)},i.onAction=(c,u,d)=>{this.updateModel(e,c,u),this.dispatchLocalEvent({type:"filterAction",column:e,action:c,event:d})},i.getHandler=()=>this.getHandler(e,!0),i.onUiChange=c=>this.filterUiChanged(e,c),i.source=n}return r}createFilterUiForHandler(e,t){return t?{created:!1,create:t,filterParams:e.params,compDetails:e}:null}createFilterUiLegacy(e,t,n){const o=t(),s={created:!0,create:t,filterParams:e.params,compDetails:e,promise:o};return o.then(n),s}createFilterWrapper(e){var a;const{compDetails:t,handler:n,handlerGenerator:o,handlerParams:s,createFilterUi:r}=this.createFilterInstance(e,e.getColDef(),this.getDefaultFilter(e),l=>l),i=e.getColId();if(n)return delete this.initialModel[i],(a=n.init)==null||a.call(n,{...s,source:"init",model:xo(this.model,i)}),{column:e,isHandler:!0,handler:n,handlerGenerator:o,handlerParams:s,filterUi:this.createFilterUiForHandler(t,r)};if(r){const l={column:e,filterUi:null,isHandler:!1};return l.filterUi=this.createFilterUiLegacy(t,r,c=>{l.filter=c??void 0}),l}return{column:e,filterUi:null,isHandler:!1}}createHandlerFunc(e,t,n){var f;const{gos:o,frameworkOverrides:s,registry:r}=this.beans;let i;const a=p=>{const g=p.filter;if(S2(g)){const v=g.handler;return v||(i=g.doesFilterPass,i?()=>({doesFilterPass:i}):void 0)}return typeof g=="string"?g:void 0},l=o.get("enableFilterHandlers"),c=l?a(t):void 0,u=p=>()=>this.createBean(r.createDynamicBean(p,!0));let d,h;if(typeof c=="string"){const p=(f=o.get("filterHandlers"))==null?void 0:f[c];p!=null?d=p:qce.has(c)&&(d=u(c),h=c)}else d=c;if(!d){let p;const{compName:g,jsComp:v,fwComp:w}=T2(s,t);g?p=g:v==null&&w==null&&t.filter===!0&&(p=n),h=this.handlerMap[p],h&&(d=u(h))}return d?{filterHandler:d,handlerNameOrCallback:i??h}:l?(ro(o)&&Je(277,{colId:e.getColId()}),yye):void 0}createHandler(e,t,n){const o=this.createHandlerFunc(e,t,n);if(!o)return;const s=C0(this.beans.userCompFactory,t,this.createFilterCompParams(e,!0,"init")),{handlerNameOrCallback:r,filterHandler:i}=o,{handler:a,handlerParams:l}=this.createHandlerFromFunc(e,i,s);return{handler:a,handlerParams:l,handlerGenerator:r??i}}createHandlerFromFunc(e,t,n){const o=e.getColDef(),s=t(Pt(this.gos,{column:e,colDef:o})),r=this.createHandlerParams(e,n);return{handler:s,handlerParams:r}}createHandlerParams(e,t){const n=e.getColDef(),o=e.getColId(),s=this.filterChangedCallbackFactory(e);return Pt(this.gos,{colDef:n,column:e,getValue:this.createGetValue(e),doesRowPassOtherFilter:r=>{var i;return((i=this.beans.filterManager)==null?void 0:i.doesRowPassOtherFilters(o,r))??!0},onModelChange:(r,i)=>{this.updateStoredModel(o,r),this.refreshHandlerAndUi(e,r,"handler",!1,i).then(()=>{s({...i,source:"columnFilter"})})},filterParams:t})}onColumnsChanged(){const e=[],{colModel:t,filterManager:n,groupFilter:o}=this.beans;this.allColumnFilters.forEach((r,i)=>{let a;r.column.isPrimary()?a=t.getColDefCol(i):a=t.getCol(i),!(a&&a===r.column)&&(e.push(r.column),this.disposeFilterWrapper(r,"columnChanged"),this.disposeColumnListener(i))});const s=o&&e.every(r=>o.isGroupFilter(r));e.length>0&&!s&&(n==null||n.onFilterChanged({columns:e,source:"api"}))}isFilterAllowed(e){if(!e.isFilterAllowed())return!1;const n=this.beans.groupFilter;return n!=null&&n.isGroupFilter(e)?n.isFilterAllowed(e):!0}getFloatingFilterCompDetails(e,t){const{userCompFactory:n,frameworkOverrides:o,selectableFilter:s}=this.beans,r=h=>{const f=this.getOrCreateFilterUi(e);f!=null&&f.then(p=>{h(gp(p))})},i=e.getColDef(),a=s!=null&&s.isSelectable(i)?s.getFilterDef(e,i):i,l=due(o,a,()=>this.getDefaultFloatingFilter(e))??"agReadOnlyFloatingFilter",c=this.gos.get("enableFilterHandlers"),u=C0(n,a,this.createFilterCompParams(e,c,"init",!0)),d=Pt(this.gos,{column:e,filterParams:u,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:r,showParentFilter:t});if(c){const h=d,f=e.getColId(),p=this.filterChangedCallbackFactory(e);h.onUiChange=g=>this.floatingFilterUiChanged(e,g),h.model=xo(this.model,f),h.onModelChange=(g,v)=>{this.updateStoredModel(f,g),this.refreshHandlerAndUi(e,g,"floating",!0,v).then(()=>{p({...v,source:"columnFilter"})})},h.getHandler=()=>this.getHandler(e,!0),h.source="init"}return Dle(n,i,d,l)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilterUi(e,t,n,o){const s="paramsUpdated";if(e.isHandler){const r=t.getColId();delete this.initialModel[r],this.state.delete(r);const i=e.filterUi,a=this.createFilterUiForHandler(n,o);e.filterUi=a;const l=this.eventSvc;i!=null&&i.created?i.promise.then(c=>{this.destroyBean(c),l.dispatchEvent({type:"filterDestroyed",source:s,column:t})}):l.dispatchEvent({type:"filterHandlerDestroyed",source:s,column:t})}else this.destroyFilter(t,s)}destroyFilter(e,t="api"){const n=e.getColId(),o=this.allColumnFilters.get(n);this.disposeColumnListener(n),delete this.initialModel[n],o&&this.disposeFilterWrapper(o,t).then(s=>{var r;s&&this.isAlive()&&((r=this.beans.filterManager)==null||r.onFilterChanged({columns:[e],source:"api"}))})}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){let n=!1;const{column:o,isHandler:s,filterUi:r}=e,i=o.getColId();s&&(n=this.isHandlerActive(o),this.destroyBean(e.handler),delete this.model[i],this.state.delete(i));const a=()=>{this.setColFilterActive(o,!1,"filterDestroyed"),this.allColumnFilters.delete(i),this.eventSvc.dispatchEvent({type:"filterDestroyed",source:t,column:o})};if(r){if(r.created)return r.promise.then(l=>(n=s?n:!!(l!=null&&l.isFilterActive()),this.destroyBean(l),a(),n));a()}return Kn.resolve(n)}filterChangedCallbackFactory(e){return t=>{this.callOnFilterChangedOutsideRenderCycle({additionalEventAttributes:t,columns:[e],column:e,source:(t==null?void 0:t.source)??"columnFilter"})}}filterParamsChanged(e,t="api"){var v,w,S,b,C,_;const n=this.allColumnFilters.get(e);if(!n)return;const o=this.beans,s=n.column,r=s.getColDef(),i=s.isFilterAllowed(),a=this.getDefaultFilter(s),l=o.selectableFilter,c=l!=null&&l.isSelectable(r)?l.getFilterDef(s,r):r,u=i?this.createHandlerFunc(s,c,this.getDefaultFilter(s)):void 0,d=!!u,h=n.isHandler;if(h!=d){this.destroyFilter(s,"paramsUpdated");return}const{compDetails:f,createFilterUi:p}=(i?this.createFilterComp(s,c,a,E=>E,d,"colDef"):null)??{compDetails:null,createFilterUi:null},g=(f==null?void 0:f.params)??C0(o.userCompFactory,c,this.createFilterCompParams(s,d,"colDef"));if(h){const E=(u==null?void 0:u.handlerNameOrCallback)??(u==null?void 0:u.filterHandler),x=xo(this.model,e);if(n.handlerGenerator!=E){const I=n.handler,{handler:F,handlerParams:M}=this.createHandlerFromFunc(s,u.filterHandler,g);n.handler=F,n.handlerParams=M,n.handlerGenerator=E,delete this.model[e],(v=F.init)==null||v.call(F,{...M,source:"init",model:null}),this.destroyBean(I),x!=null&&((w=this.beans.filterManager)==null||w.onFilterChanged({columns:[s],source:t}))}else{const I=this.createHandlerParams(s,f==null?void 0:f.params);n.handlerParams=I,(b=(S=n.handler).refresh)==null||b.call(S,{...I,source:"colDef",model:x})}}if(this.areFilterCompsDifferent(((C=n.filterUi)==null?void 0:C.compDetails)??null,f)||!n.filterUi||!f){this.destroyFilterUi(n,s,f,p);return}n.filterUi.filterParams=g,(_=gl(n,h))==null||_.then(E=>{(E!=null&&E.refresh?E.refresh(g):!0)===!1?this.destroyFilterUi(n,s,f,p):this.dispatchLocalEvent({type:"filterParamsChanged",column:s,params:g})})}refreshHandlerAndUi(e,t,n,o,s){const r=this.cachedFilter(e);if(!r)return o&&this.getOrCreateFilterWrapper(e,!0),Kn.resolve();if(!r.isHandler)return Kn.resolve();const{filterUi:i,handler:a,handlerParams:l}=r;return Yce(()=>{if(i){const{created:c,filterParams:u}=i;if(c)return i.promise.then(d=>d?{filter:d,filterParams:u}:void 0);i.refreshed=!0}return Kn.resolve(void 0)},a,l,t,this.state.get(e.getColId())??{model:t},n,s)}setColumnFilterWrapper(e,t){const n=e.getColId();this.allColumnFilters.set(n,t),this.allColumnListeners.set(n,this.addManagedListeners(e,{colDefChanged:()=>this.filterParamsChanged(n)})[0])}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:n}=e,{componentClass:o}=t;return!(n===o||(n==null?void 0:n.render)&&(o==null?void 0:o.render)&&n.render===o.render)}hasFloatingFilters(){return this.beans.colModel.getCols().some(t=>t.getColDef().floatingFilter)}getFilterInstance(e){const t=this.beans.colModel.getColDefCol(e);if(!t)return Promise.resolve(void 0);const n=this.getOrCreateFilterUi(t);return n?new Promise(o=>{n.then(s=>{o(gp(s))})}):Promise.resolve(null)}processFilterModelUpdateQueue(){this.modelUpdates.forEach(({model:e,source:t})=>this.setModel(e,t)),this.modelUpdates=[],this.columnModelUpdates.forEach(({key:e,model:t,resolve:n})=>{this.setModelForColumn(e,t).then(()=>n())}),this.columnModelUpdates=[]}getModelForColumn(e,t){if(t){const{state:o,model:s}=this,r=e.getColId(),i=o.get(r);return i?i.model??null:xo(s,r)}const n=this.cachedFilter(e);return n?this.getModelFromFilterWrapper(n):null}setModelForColumn(e,t){var n;if((n=this.beans.dataTypeSvc)!=null&&n.isPendingInference){let o=()=>{};const s=new Promise(r=>{o=r});return this.columnModelUpdates.push({key:e,model:t,resolve:o}),s}return new Promise(o=>{this.setModelForColumnLegacy(e,t).then(s=>o(s))})}getStateForColumn(e){return this.state.get(e)??{model:xo(this.model,e)}}setModelForColumnLegacy(e,t){const n=this.beans.colModel.getColDefCol(e),o=n?this.getOrCreateFilterWrapper(n,!0):null;return o?this.setModelOnFilterWrapper(o,t):Kn.resolve()}setColDefPropsForDataType(e,t,n){var u;const o=e.filter,s=o===!0?this.getDefaultFilterFromDataType(()=>t.baseDataType):o;if(typeof s!="string")return;let r,i;const a=this.beans,{filterParams:l,filterValueGetter:c}=e;s==="agMultiColumnFilter"?{filterParams:r,filterValueGetter:i}=((u=a.multiFilter)==null?void 0:u.getParamsForDataType(l,c,t,n))??{}:{filterParams:r,filterValueGetter:i}=oue(s,l,c,t,n,a,this.getLocaleTextFunc()),e.filterParams=r,i&&(e.filterValueGetter=i)}setColFilterActive(e,t,n,o){e.filterActive!==t&&(e.filterActive=t,e.dispatchColEvent("filterActiveChanged",n)),e.dispatchColEvent("filterChanged",n,o)}setModelOnFilterWrapper(e,t,n){return new Kn(o=>{if(e.isHandler){const r=e.column,i=r.getColId(),a=this.model[i];if(this.updateStoredModel(i,t),n&&t===a){o();return}this.refreshHandlerAndUi(r,t,"api").then(()=>o());return}const s=gl(e);if(s){s.then(r=>{if(typeof(r==null?void 0:r.setModel)!="function"){Je(65),o();return}(r.setModel(t)||Kn.resolve()).then(()=>o())});return}o()})}updateStoredModel(e,t){ft(t)?this.model[e]=t:delete this.model[e];const n=this.state.get(e),o={model:t,state:n==null?void 0:n.state};this.state.set(e,o)}filterModified(e,t){var n;(n=this.getOrCreateFilterUi(e))==null||n.then(o=>{this.eventSvc.dispatchEvent({type:"filterModified",column:e,filterInstance:o,...t})})}filterUiChanged(e,t){this.gos.get("enableFilterHandlers")&&this.eventSvc.dispatchEvent({type:"filterUiChanged",column:e,...t})}floatingFilterUiChanged(e,t){this.gos.get("enableFilterHandlers")&&this.eventSvc.dispatchEvent({type:"floatingFilterUiChanged",column:e,...t})}updateModel(e,t,n){var i;const o=e.getColId(),s=this.cachedFilter(e),r=()=>s==null?void 0:s.filterUi;rV(t,r,()=>xo(this.model,o),()=>this.state.get(o),a=>this.updateState(e,a),a=>{var l,c;return(c=(l=r())==null?void 0:l.filterParams)==null?void 0:c.onModelChange(a,n)},s!=null&&s.isHandler?(i=s.handler.processModelToApply)==null?void 0:i.bind(s.handler):void 0)}updateAllModels(e,t){const n=[];this.allColumnFilters.forEach((o,s)=>{var i;const r=this.beans.colModel.getColDefCol(s);r&&rV(e,()=>o.filterUi,()=>xo(this.model,s),()=>this.state.get(s),a=>this.updateState(r,a),a=>{this.updateStoredModel(s,a),this.dispatchLocalEvent({type:"filterAction",column:r,action:e}),n.push(this.refreshHandlerAndUi(r,a,"ui"))},o!=null&&o.isHandler?(i=o.handler.processModelToApply)==null?void 0:i.bind(o.handler):void 0)}),n.length&&Kn.all(n).then(()=>{this.callOnFilterChangedOutsideRenderCycle({source:"columnFilter",additionalEventAttributes:t,columns:[]})})}updateOrRefreshFilterUi(e){const t=e.getColId();sV(()=>{var n;return(n=this.cachedFilter(e))==null?void 0:n.filterUi},()=>xo(this.model,t),()=>this.state.get(t))}updateState(e,t){this.state.set(e.getColId(),t),this.dispatchLocalEvent({type:"filterStateChanged",column:e,state:t})}canApplyAll(){const{state:e,model:t,activeFilterComps:n}=this;for(const s of n)if(s.source==="COLUMN_MENU")return!1;let o=!1;for(const s of e.keys()){const r=e.get(s);if(r.valid===!1)return!1;(r.model??null)!==xo(t,s)&&(o=!0)}return o}hasUnappliedModel(e){var o;const{model:t,state:n}=this;return(((o=n.get(e))==null?void 0:o.model)??null)!==xo(t,e)}setGlobalButtons(e){this.isGlobalButtons=e,this.dispatchLocalEvent({type:"filterGlobalButtons",isGlobal:e})}shouldKeepStateOnDetach(e,t){if(t==="newFiltersToolPanel")return!0;const n=this.beans.filterPanelSvc;return n!=null&&n.isActive?!!n.getState(e.getColId()):!1}destroy(){super.destroy(),this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear(),this.state.clear(),this.activeFilterComps.clear()}};function Cye(e){var t;return!!((t=e.filterManager)!=null&&t.isAnyFilterPresent())}function bye(e,t="api"){var n;(n=e.filterManager)==null||n.onFilterChanged({source:t})}var Sye=class extends We{constructor(){super(...arguments),this.beanName="filterManager",this.advFilterModelUpdateQueue=[]}wireBeans(e){this.quickFilter=e.quickFilter,this.advancedFilter=e.advancedFilter,this.colFilter=e.colFilter}postConstruct(){const e=this.refreshFiltersForAggregations.bind(this),t=this.updateAdvFilterColumns.bind(this);this.addManagedEventListeners({columnValueChanged:e,columnPivotChanged:e,columnPivotModeChanged:e,newColumnsLoaded:t,columnVisible:t,advancedFilterEnabledChanged:({enabled:o})=>this.onAdvFilterEnabledChanged(o),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],()=>{this.onFilterChanged({source:"api"})}),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",()=>{this.updateAggFiltering(),this.onFilterChanged()}),this.quickFilter&&this.addManagedListeners(this.quickFilter,{quickFilterChanged:()=>this.onFilterChanged({source:"quickFilter"})});const{gos:n}=this;this.alwaysPassFilter=n.get("alwaysPassFilter"),this.addManagedPropertyListener("alwaysPassFilter",()=>{this.alwaysPassFilter=n.get("alwaysPassFilter"),this.onFilterChanged({source:"api"})})}isExternalFilterPresentCallback(){const e=this.gos.getCallback("isExternalFilterPresent");return typeof e=="function"&&e({})}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return typeof t=="function"&&t(e)}setFilterState(e,t,n="api"){var o;this.isAdvFilterEnabled()||(o=this.colFilter)==null||o.setState(e,t,n)}setFilterModel(e,t="api",n){var o;if(this.isAdvFilterEnabled()){n||this.warnAdvFilters();return}(o=this.colFilter)==null||o.setModel(e,t)}getFilterModel(){var e;return((e=this.colFilter)==null?void 0:e.getModel())??{}}getFilterState(){var e;return(e=this.colFilter)==null?void 0:e.getState()}isColumnFilterPresent(){var e;return!!((e=this.colFilter)!=null&&e.isFilterPresent())}isAggregateFilterPresent(){var e;return!!((e=this.colFilter)!=null&&e.isAggFilterPresent())}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.externalFilterPresent||this.isAdvFilterPresent()}isAnyFilterPresent(){return this.isChildFilterPresent()||this.isAggregateFilterPresent()}isAdvFilterPresent(){return this.isAdvFilterEnabled()&&this.advancedFilter.isFilterPresent()}onAdvFilterEnabledChanged(e){var t,n;e?(t=this.colFilter)!=null&&t.disableFilters()&&this.onFilterChanged({source:"advancedFilter"}):(n=this.advancedFilter)!=null&&n.isFilterPresent()&&(this.advancedFilter.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvFilterEnabled(){var e;return!!((e=this.advancedFilter)!=null&&e.isEnabled())}isAdvFilterHeaderActive(){return this.isAdvFilterEnabled()&&this.advancedFilter.isHeaderActive()}refreshFiltersForAggregations(){p0(this.gos)&&this.isAnyFilterPresent()&&this.onFilterChanged()}onFilterChanged(e={}){const{source:t,additionalEventAttributes:n,columns:o=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.colFilter?this.colFilter.updateBeforeFilterChanged(e):Kn.resolve()).then(()=>{var r;const s={source:t,type:"filterChanged",columns:o};n&&is(s,n),this.eventSvc.dispatchEvent(s),(r=this.colFilter)==null||r.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){var e;return!!((e=this.colFilter)!=null&&e.isSuppressFlashingCellsBecauseFiltering())}isQuickFilterPresent(){var e;return!!((e=this.quickFilter)!=null&&e.isFilterPresent())}updateAggFiltering(){this.aggFiltering=!!p0(this.gos)}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.beans.colModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(e,t){return this.doesRowPassFilter({rowNode:t,colIdToSkip:e})}doesRowPassAggregateFilters(e){var n;const{rowNode:t}=e;return(n=this.alwaysPassFilter)!=null&&n.call(this,t)?!0:!(this.isAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.isAggregateFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip,!0))}doesRowPassFilter(e){var n;const{rowNode:t}=e;return(n=this.alwaysPassFilter)!=null&&n.call(this,t)?!0:!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.externalFilterPresent&&!this.doesExternalFilterPass(t)||this.isColumnFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip)||this.isAdvFilterPresent()&&!this.advancedFilter.doesFilterPass(t))}isFilterAllowed(e){var t;return this.isAdvFilterEnabled()?!1:!!((t=this.colFilter)!=null&&t.isFilterAllowed(e))}getAdvFilterModel(){return this.isAdvFilterEnabled()?this.advancedFilter.getModel():null}setAdvFilterModel(e,t="api"){var n;if(this.isAdvFilterEnabled()){if((n=this.beans.dataTypeSvc)!=null&&n.isPendingInference){this.advFilterModelUpdateQueue.push(e);return}this.advancedFilter.setModel(e??null),this.onFilterChanged({source:t})}}toggleAdvFilterBuilder(e,t){this.isAdvFilterEnabled()&&this.advancedFilter.getCtrl().toggleFilterBuilder({source:t,force:e})}updateAdvFilterColumns(){this.isAdvFilterEnabled()&&this.advancedFilter.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){var e;return this.isAdvFilterEnabled()?!1:!!((e=this.colFilter)!=null&&e.hasFloatingFilters())}getColumnFilterInstance(e){var t;return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve(void 0)):((t=this.colFilter)==null?void 0:t.getFilterInstance(e))??Promise.resolve(void 0)}warnAdvFilters(){Je(68)}setupAdvFilterHeaderComp(e){var t;(t=this.advancedFilter)==null||t.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvFilterHeaderActive()?this.advancedFilter.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){for(const e of this.advFilterModelUpdateQueue)this.setAdvFilterModel(e);this.advFilterModelUpdateQueue=[]}setColumnFilterModel(e,t){var n;return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve()):((n=this.colFilter)==null?void 0:n.setModelForColumn(e,t))??Promise.resolve()}},Eye=class extends We{constructor(){super(...arguments),this.beanName="filterMenuFactory"}wireBeans(e){this.popupSvc=e.popupSvc}hideActiveMenu(){var e;(e=this.hidePopup)==null||e.call(this)}showMenuAfterMouseEvent(e,t,n,o){e&&!e.isColumn||this.showPopup(e,s=>{var r;(r=this.popupSvc)==null||r.positionPopupUnderMouseEvent({column:e,type:n,mouseEvent:t,ePopup:s})},n,t.target,Hs(this.gos),o)}showMenuAfterButtonClick(e,t,n,o){if(e&&!e.isColumn)return;let s=-1,r="left";const i=Hs(this.gos);!i&&this.gos.get("enableRtl")&&(s=1,r="right");const a=i?void 0:4*s,l=i?void 0:4;this.showPopup(e,c=>{var u;(u=this.popupSvc)==null||u.positionPopupByComponent({type:n,eventSource:t,ePopup:c,nudgeX:a,nudgeY:l,alignSide:r,keepWithinBounds:!0,position:"under",column:e})},n,t,i,o)}showPopup(e,t,n,o,s,r){var g;const i=e?this.createBean(new tue(e,"COLUMN_MENU")):void 0;if(this.activeMenu=i,!(i!=null&&i.hasFilter())||!e){_n(57);return}const a=ao({tag:"div",cls:`ag-menu${s?"":" ag-filter-menu"}`,role:"presentation"});[this.tabListener]=this.addManagedElementListeners(a,{keydown:v=>this.trapFocusWithin(v,a)}),a.appendChild(i==null?void 0:i.getGui());let l;const c=()=>i==null?void 0:i.afterGuiDetached(),u=wae(this.gos)?o??this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody:void 0,d=v=>{xV(e,!1,"contextMenu");const w=v instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),w&&o&&yi(o)){const S=O2(o);S==null||S.focus({preventScroll:!0})}c(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,n,e),r==null||r()},h=this.getLocaleTextFunc(),f=s&&n!=="columnFilter"?h("ariaLabelColumnMenu","Column Menu"):h("ariaLabelColumnFilter","Column Filter"),p=(g=this.popupSvc)==null?void 0:g.addPopup({modal:!0,eChild:a,closeOnEsc:!0,closedCallback:d,positionCallback:()=>t(a),anchorToElement:u,ariaLabel:f});p&&(this.hidePopup=l=p.hideFunc),i.afterInit().then(()=>{t(a),i.afterGuiAttached({container:n,hidePopup:l})}),xV(e,!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,n,e)}trapFocusWithin(e,t){e.key!==Oe.TAB||e.defaultPrevented||Fc(this.beans,t,!1,e.shiftKey)||(e.preventDefault(),xc(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,n){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:t,column:n??null,columnGroup:null})}isMenuEnabled(e){return e.isFilterAllowed()&&(e.getColDef().menuTabs??["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}},_ye=class extends We{constructor(){super(...arguments),this.beanName="filterValueSvc"}getValue(e,t,n){if(!t)return;const o=e.getColDef(),{selectableFilter:s,valueSvc:r}=this.beans,i=n??(s==null?void 0:s.getFilterValueGetter(e.getColId()))??o.filterValueGetter;return i?this.executeFilterValueGetter(i,t.data,e,t,o):r.getValue(e,t)}executeFilterValueGetter(e,t,n,o,s){const{expressionSvc:r,valueSvc:i}=this.beans,a=Pt(this.gos,{data:t,node:o,column:n,colDef:s,getValue:i.getValueCallback.bind(i,o)});return typeof e=="function"?e(a):r==null?void 0:r.evaluate(e,a)}},Rye={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eFloatingFilterText"}]},Dye=class extends bn{constructor(){super(Rye,[my]),this.eFloatingFilterText=ht}init(e){this.params=e;const t=this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0);if(this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`),this.gos.get("enableFilterHandlers")){const n=e,o=n.getHandler();if(o.getModelAsString){const s=o.getModelAsString(n.model);this.eFloatingFilterText.setValue(s)}}}onParentModelChanged(e){if(e==null){this.eFloatingFilterText.setValue("");return}this.params.parentFilterInstance(t=>{if(t.getModelAsString){const n=t.getModelAsString(e);this.eFloatingFilterText.setValue(n)}})}refresh(e){this.init(e)}},H_=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions??t,this.mapCustomOptions(),this.defaultOption=this.getDefaultItem(e.defaultOption)}refresh(e,t){const n=e.filterOptions??t;this.filterOptions!==n&&(this.filterOptions=n,this.customFilterOptions={},this.mapCustomOptions()),this.defaultOption=this.getDefaultItem(e.defaultOption)}mapCustomOptions(){const{filterOptions:e}=this;if(e)for(const t of e){if(typeof t=="string")continue;const n=[["displayKey"],["displayName"],["predicate","test"]],o=s=>s.some(r=>t[r]!=null)?!0:(Je(72,{keys:s}),!1);if(!n.every(o)){this.filterOptions=e.filter(s=>s===t)||[];continue}this.customFilterOptions[t.displayKey]=t}}getDefaultItem(e){const{filterOptions:t}=this;if(e)return e;if(t.length>=1){const n=t[0];if(typeof n=="string")return n;if(n.displayKey)return n.displayKey;Je(73)}else Je(74)}getCustomOption(e){return this.customFilterOptions[e]}};function Ip(e,t,n){return n==null?e.splice(t):e.splice(t,n)}function Wy(e){return e==null||typeof e=="string"&&e.trim().length===0}function Tye(e){return e==="AND"||e==="OR"?e:"AND"}function Iye(e,t,n){if(e==null)return;const{predicate:o}=e;if(o!=null&&!t.some(s=>s==null))return o(t,n)}function xye(e,t){let n=e.length;return n>t&&(e.splice(t),Je(78),n=t),n}function xp(e,t){const n=t.getCustomOption(e);if(n){const{numberOfInputs:s}=n;return s??1}return e&&["empty","notBlank","blank"].indexOf(e)>=0?0:e==="inRange"?2:1}var G_=class extends uue{constructor(e,t,n){super(e,"simple-filter"),this.mapValuesFromModel=t,this.defaultOptions=n,this.eTypes=[],this.eJoinPanels=[],this.eJoinAnds=[],this.eJoinOrs=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}setParams(e){super.setParams(e);const t=new H_;this.optionsFactory=t,t.init(e,this.defaultOptions),this.commonUpdateSimpleParams(e),this.createOption(),this.createMissingConditionsAndOperators()}updateParams(e,t){this.optionsFactory.refresh(e,this.defaultOptions),super.updateParams(e,t),this.commonUpdateSimpleParams(e)}commonUpdateSimpleParams(e){this.setNumConditions(e),this.defaultJoinOperator=Tye(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.createFilterListOptions();const t=this.getGui();this.isReadOnly()?t.setAttribute("tabindex","-1"):t.removeAttribute("tabindex")}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged("immediately",!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((t,n)=>{const o=n===0?e:this.optionsFactory.defaultOption;t.setValue(o,!0)})}getModelFromUi(){const e=this.getUiCompleteConditions();return e.length===0?null:this.maxNumConditions>1&&e.length>1?{filterType:this.filterType,operator:this.getJoinOperator(),conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map(e=>e.getValue())}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){const{eJoinOrs:e,defaultJoinOperator:t}=this;return e.length===0?t:e[0].getValue()===!0?"OR":"AND"}areNonNullModelsEqual(e,t){const n=!e.operator,o=!t.operator;if(!n&&o||n&&!o)return!1;let r;if(n){const i=e,a=t;r=this.areSimpleModelsEqual(i,a)}else{const i=e,a=t;r=i.operator===a.operator&&dl(i.conditions,a.conditions,(l,c)=>this.areSimpleModelsEqual(l,c))}return r}setModelIntoUi(e,t){if(e==null)return this.resetUiToDefaults(t),Kn.resolve();if(e.operator){const o=e;let s=o.conditions;s==null&&(s=[],Je(77));const r=xye(s,this.maxNumConditions),i=this.getNumConditions();if(r<i)this.removeConditionsAndOperators(r);else if(r>i)for(let l=i;l<r;l++)this.createJoinOperatorPanel(),this.createOption();const a=o.operator==="OR";this.eJoinAnds.forEach(l=>l.setValue(!a,!0)),this.eJoinOrs.forEach(l=>l.setValue(a,!0)),s.forEach((l,c)=>{this.eTypes[c].setValue(l.type,!0),this.setConditionIntoUi(l,c)})}else{const o=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(o.type,!0),this.setConditionIntoUi(o,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.updateUiVisibility(),t||this.params.onUiChange(this.getUiChangeEventParams()),Kn.resolve()}setNumConditions(e){let t=e.maxNumConditions??2;t<1&&(Je(79),t=1),this.maxNumConditions=t;let n=e.numAlwaysVisibleConditions??1;n<1&&(Je(80),n=1),n>t&&(Je(81),n=t),this.numAlwaysVisibleConditions=n}createOption(){const e=this.getGui(),t=this.createManagedBean(new B0);this.eTypes.push(t),t.addCss("ag-filter-select"),e.appendChild(t.getGui());const n=this.createEValue();this.eConditionBodies.push(n),e.appendChild(n),this.putOptionsIntoDropdown(t),this.resetType(t);const o=this.getNumConditions()-1;this.forEachPositionInput(o,s=>this.resetInput(s)),this.addChangedListeners(t,o)}createJoinOperatorPanel(){const e=ao({tag:"div",cls:"ag-filter-condition"});this.eJoinPanels.push(e);const t=this.createJoinOperator(this.eJoinAnds,e,"and"),n=this.createJoinOperator(this.eJoinOrs,e,"or");this.getGui().appendChild(e);const o=this.eJoinPanels.length-1,s=this.joinOperatorId++;this.resetJoinOperatorAnd(t,o,s),this.resetJoinOperatorOr(n,o,s),this.isReadOnly()||(t.onValueChange(this.listener),n.onValueChange(this.listener))}createJoinOperator(e,t,n){const o=this.createManagedBean(new Hle);e.push(o);const s="ag-filter-condition-operator";return o.addCss(s),o.addCss(`${s}-${n}`),t.appendChild(o.getGui()),o}createFilterListOptions(){this.filterListOptions=this.optionsFactory.filterOptions.map(e=>typeof e=="string"?this.createBoilerplateListOption(e):this.createCustomListOption(e))}putOptionsIntoDropdown(e){const{filterListOptions:t}=this;for(const n of t)e.addOption(n);e.setDisabled(t.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,n=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:n?this.getLocaleTextFunc()(n.displayKey,n.displayName):this.translate(t)}}createBodyTemplate(){return null}getAgComponents(){return[]}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){let e=-1,t=!0;for(let n=0;n<this.getNumConditions();n++)this.isConditionUiComplete(n)?e=n:t=!1;if(this.shouldAddNewConditionAtEnd(t))this.createJoinOperatorPanel(),this.createOption();else{const n=this.lastUiCompletePosition??this.getNumConditions()-2;if(e<n){this.removeConditionsAndOperators(n+1);const o=e+1,s=n-o;s>0&&this.removeConditionsAndOperators(o,s),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=e}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((o,s)=>{const r=this.isConditionDisabled(s,e);o.setDisabled(r||this.filterListOptions.length<=1),s===1&&(Qf(this.eJoinPanels[0],r),this.eJoinAnds[0].setDisabled(r),this.eJoinOrs[0].setDisabled(r))}),this.eConditionBodies.forEach((o,s)=>{$n(o,this.isConditionBodyVisible(s))});const n=(t??this.getJoinOperator())==="OR";for(const o of this.eJoinAnds)o.setValue(!n,!0);for(const o of this.eJoinOrs)o.setValue(n,!0);this.forEachInput((o,s,r,i)=>{this.setElementDisplayed(o,s<i),this.setElementDisabled(o,this.isConditionDisabled(r,e))}),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;const{eTypes:n,eConditionBodies:o,eJoinPanels:s,eJoinAnds:r,eJoinOrs:i}=this;this.removeComponents(n,e,t),this.removeElements(o,e,t),this.removeEValues(e,t);const a=Math.max(e-1,0);this.removeElements(s,a,t),this.removeComponents(r,a,t),this.removeComponents(i,a,t)}removeElements(e,t,n){const o=Ip(e,t,n);for(const s of o)Hr(s)}removeComponents(e,t,n){const o=Ip(e,t,n);for(const s of o)Hr(s.getGui()),this.destroyBean(s)}afterGuiAttached(e){var t;if(super.afterGuiAttached(e),this.resetPlaceholder(),!(e!=null&&e.suppressFocus)){let n;if(!this.isReadOnly()){const o=this.getInputs(0)[0];o instanceof Pc&&this.isConditionBodyVisible(0)?n=o.getInputElement():n=(t=this.eTypes[0])==null?void 0:t.getFocusableElement()}(n??this.getGui()).focus({preventScroll:!0})}}afterGuiDetached(){var i;super.afterGuiDetached();const e=this.params;if((i=this.beans.colFilter)!=null&&i.shouldKeepStateOnDetach(e.column))return;e.onStateChange({model:e.model});let t=-1,n=-1,o=!1;const s=this.getJoinOperator();for(let a=this.getNumConditions()-1;a>=0;a--)if(this.isConditionUiComplete(a))t===-1&&(t=a,n=a);else{const l=a>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(a-1),c=a<t;(l||c)&&(this.removeConditionsAndOperators(a,1),o=!0,c&&n--)}let r=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),r=!0),this.shouldAddNewConditionAtEnd(n===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),r=!0),r&&this.updateConditionStatusesAndValues(n,s),o&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=n}getModelAsString(e){var t,n;return((n=(t=this.params.getHandler())==null?void 0:t.getModelAsString)==null?void 0:n.call(t,e))??""}getPlaceholderText(e,t){let n=this.translate(e);if(typeof this.filterPlaceholder=="function"){const o=this.eTypes[t].getValue(),s=this.translate(o);n=this.filterPlaceholder({filterOptionKey:o,filterOption:s,placeholder:n})}else typeof this.filterPlaceholder=="string"&&(n=this.filterPlaceholder);return n}resetPlaceholder(){const e=this.getLocaleTextFunc();this.forEachInput((t,n,o,s)=>{if(!(t instanceof Pc))return;const r=n===0&&s>1?"inRangeStart":n===0?"filterOoo":"inRangeEnd",i=n===0&&s>1?e("ariaFilterFromValue","Filter from value"):n===0?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(r,o)),t.setInputAriaLabel(i)})}setElementValue(e,t,n){e instanceof Pc&&e.setValue(t!=null?String(t):null,!0)}setElementDisplayed(e,t){C2(e)&&$n(e.getGui(),t)}setElementDisabled(e,t){C2(e)&&Qf(e.getGui(),t)}attachElementOnChange(e,t){e instanceof Pc&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach((t,n)=>{this.forEachPositionTypeInput(n,t,e)})}forEachPositionInput(e,t){const n=this.getConditionType(e);this.forEachPositionTypeInput(e,n,t)}forEachPositionTypeInput(e,t,n){const o=xp(t,this.optionsFactory),s=this.getInputs(e);for(let r=0;r<s.length;r++){const i=s[r];i!=null&&n(i,r,e,o)}}isConditionDisabled(e,t){return this.isReadOnly()?!0:e===0?!1:e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return xp(t,this.optionsFactory)>0}isConditionUiComplete(e){return!(e>=this.getNumConditions()||this.getConditionType(e)==="empty"||this.getValues(e).some(n=>n==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){this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach(t=>this.resetType(t)),this.eJoinAnds.forEach((t,n)=>this.resetJoinOperatorAnd(t,n,this.joinOperatorId+n)),this.eJoinOrs.forEach((t,n)=>this.resetJoinOperatorOr(t,n,this.joinOperatorId+n)),this.joinOperatorId++,this.forEachInput(t=>this.resetInput(t)),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,this.updateUiVisibility(),e||this.params.onUiChange(this.getUiChangeEventParams())}resetType(e){const n=this.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.defaultOption,!0).setAriaLabel(n).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,n){this.resetJoinOperator(e,t,this.defaultJoinOperator==="AND",this.translate("andCondition"),n)}resetJoinOperatorOr(e,t,n){this.resetJoinOperator(e,t,this.defaultJoinOperator==="OR",this.translate("orCondition"),n)}resetJoinOperator(e,t,n,o,s){this.updateJoinOperatorDisabled(e.setValue(n,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${s}`).setLabel(o),t)}updateJoinOperatorsDisabled(){const e=(t,n)=>this.updateJoinOperatorDisabled(t,n);this.eJoinAnds.forEach(e),this.eJoinOrs.forEach(e)}updateJoinOperatorDisabled(e,t){e.setDisabled(this.isReadOnly()||t>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,t){const n=this.mapValuesFromModel(e,this.optionsFactory);this.forEachInput((o,s,r)=>{r===t&&this.setElementValue(o,n[s]!=null?n[s]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,n,o)=>{this.setElementValue(t,n===0&&o===0?e:null,!0)})}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,n=>{this.attachElementOnChange(n,this.listener)}))}hasInvalidInputs(){return!1}isReadOnly(){return!!this.params.readOnly}},jB=class{constructor(e,t,n,o,s,r){this.alive=!0,this.context=e,this.eParent=s;const i=Sle(t,n,o);i&&i.newAgStackInstance().then(a=>{var u,d;if(!this.alive){e.destroyBean(a);return}if(this.dateComp=a,!a)return;s.appendChild(a.getGui()),(u=a==null?void 0:a.afterGuiAttached)==null||u.call(a);const{tempValue:l,disabled:c}=this;l&&a.setDate(l),c!=null&&((d=a.setDisabled)==null||d.call(a,c)),r==null||r(this)})}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){const t=this.dateComp;t?t.setDate(e):this.tempValue=e}setDisabled(e){var n;const t=this.dateComp;t?(n=t.setDisabled)==null||n.call(t,e):this.disabled=e}setDisplayed(e){$n(this.eParent,e)}setInputPlaceholder(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.setInputPlaceholder)==null||n.call(t,e)}setInputAriaLabel(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.setInputAriaLabel)==null||n.call(t,e)}afterGuiAttached(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.afterGuiAttached)==null||n.call(t,e)}updateParams(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.refresh)==null||n.call(t,e)}},U_=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"];function KB(e,t){const{dateFrom:n,dateTo:o,type:s}=e||{};return[n&&Cs(n,void 0,!0)||null,o&&Cs(o,void 0,!0)||null].slice(0,xp(s,t))}var qB=1e3,YB=1/0,Fye=class extends G_{constructor(){super("dateFilter",KB,U_),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=qB,this.maxValidYear=YB,this.minValidDate=null,this.maxValidDate=null,this.filterType="date"}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}commonUpdateSimpleParams(e){super.commonUpdateSimpleParams(e);const t=(l,c)=>{const u=e[l];if(u!=null)if(isNaN(u))Je(82,{param:l});else return u==null?c:Number(u);return c},n=t("minValidYear",qB),o=t("maxValidYear",YB);this.minValidYear=n,this.maxValidYear=o,n>o&&Je(83);const{minValidDate:s,maxValidDate:r}=e,i=s instanceof Date?s:Cs(s);this.minValidDate=i;const a=r instanceof Date?r:Cs(r);this.maxValidDate=a,i&&a&&i>a&&Je(84)}createDateCompWrapper(e){const{beans:{userCompFactory:t,context:n,gos:o},params:s}=this,r=new jB(n,t,s.colDef,Pt(o,{onDateChanged:()=>this.onUiChanged(),filterParams:s,location:"filter"}),e);return this.addDestroyFunc(()=>r.destroy()),r}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}createEValue(){const e=ao({tag:"div",cls:"ag-filter-body"});return this.createFromToElement(e,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(e,this.eConditionPanelsTo,this.dateConditionToComps,"to"),e}createFromToElement(e,t,n,o){const s=ao({tag:"div",cls:`ag-filter-${o} ag-filter-date-${o}`});t.push(s),e.appendChild(s),n.push(this.createDateCompWrapper(s))}removeEValues(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),Ip(this.eConditionPanelsFrom,e,t),Ip(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,n){const o=Ip(e,t,n);for(const s of o)s.destroy()}isValidDateValue(e){if(e===null)return!1;const{minValidDate:t,maxValidDate:n,minValidYear:o,maxValidYear:s}=this;if(t){if(e<t)return!1}else if(e.getUTCFullYear()<o)return!1;if(n){if(e>n)return!1}else if(e.getUTCFullYear()>s)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput((n,o,s,r)=>{s!==e||!t||o>=r||(t=t&&this.isValidDateValue(n.getDate()))}),t}areSimpleModelsEqual(e,t){return e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}createCondition(e){const t=this.getConditionType(e),n={},o=this.getValues(e),s=this.params.useIsoSeparator?"T":" ";return o.length>0&&(n.dateFrom=Gs(o[0],!0,s)),o.length>1&&(n.dateTo=Gs(o[1],!0,s)),{dateFrom:null,dateTo:null,filterType:this.filterType,type:t,...n}}resetPlaceholder(){const e=this.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),n=e("ariaFilterValue","Filter Value");this.forEachInput(o=>{o.setInputPlaceholder(t),o.setInputAriaLabel(n)})}getInputs(e){const{dateConditionFromComps:t,dateConditionToComps:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(n,o,s,r)=>{o<r&&t.push(n.getDate())}),t}translate(e){return e==="lessThan"?super.translate("before"):e==="greaterThan"?super.translate("after"):super.translate(e)}},ZB=class extends We{constructor(e,t){super(),this.mapValuesFromModel=e,this.defaultOptions=t}init(e){const t=e.filterParams,n=new H_;this.optionsFactory=n,n.init(t,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(n,t)),this.updateParams(e),this.validateModel(e)}refresh(e){if(e.source==="colDef"){const t=e.filterParams,n=this.optionsFactory;n.refresh(t,this.defaultOptions),this.filterModelFormatter.updateParams({optionsFactory:n,filterParams:t}),this.updateParams(e)}this.validateModel(e)}updateParams(e){this.params=e}doesFilterPass(e){const t=e.model;if(t==null)return!0;const{operator:n}=t,o=[];if(n){const i=t;o.push(...i.conditions??[])}else o.push(t);const s=n&&n==="OR"?"some":"every",r=this.params.getValue(e.node);return o[s](i=>this.individualConditionPasses(e,i,r))}getModelAsString(e,t){return this.filterModelFormatter.getModelAsString(e,t)??""}validateModel(e){const{model:t,filterParams:{filterOptions:n,maxNumConditions:o}}=e;if(t==null)return;let r=dV(t)?t.conditions:[t];const i=(n==null?void 0:n.map(u=>typeof u=="string"?u:u.displayKey))??this.defaultOptions;if(!(!r||r.every(u=>i.find(d=>d===u.type)!==void 0))){this.params={...e,model:null},e.onModelChange(null);return}let l=!1;const c=this.filterType;if((r&&!r.every(u=>u.filterType===c)||t.filterType!==c)&&(r=r.map(u=>({...u,filterType:c})),l=!0),typeof o=="number"&&r&&r.length>o&&(r=r.slice(0,o),l=!0),l){const u=r.length>1?{...t,filterType:c,conditions:r}:{...r[0],filterType:c};this.params={...e,model:u},e.onModelChange(u)}}individualConditionPasses(e,t,n){const o=this.optionsFactory,s=this.mapValuesFromModel(t,o),r=o.getCustomOption(t.type),i=Iye(r,s,n);return i??(n==null?this.evaluateNullValue(t.type):this.evaluateNonNullValue(s,n,t,e))}},XB=class extends ZB{evaluateNullValue(e){const{includeBlanksInEquals:t,includeBlanksInNotEqual:n,includeBlanksInGreaterThan:o,includeBlanksInLessThan:s,includeBlanksInRange:r}=this.params.filterParams;switch(e){case"equals":if(t)return!0;break;case"notEqual":if(n)return!0;break;case"greaterThan":case"greaterThanOrEqual":if(o)return!0;break;case"lessThan":case"lessThanOrEqual":if(s)return!0;break;case"inRange":if(r)return!0;break;case"blank":return!0;case"notBlank":return!1}return!1}evaluateNonNullValue(e,t,n){const o=n.type;if(!this.isValid(t))return o==="notEqual"||o==="notBlank";const s=this.comparator(),r=e[0]!=null?s(e[0],t):0;switch(o){case"equals":return r===0;case"notEqual":return r!==0;case"greaterThan":return r>0;case"greaterThanOrEqual":return r>=0;case"lessThan":return r<0;case"lessThanOrEqual":return r<=0;case"inRange":{const i=s(e[1],t);return this.params.filterParams.inRangeInclusive?r>=0&&i<=0:r>0&&i<0}case"blank":return Wy(t);case"notBlank":return!Wy(t);default:return Je(76,{filterModelType:o}),!0}}},JB={equals:"Equals",notEqual:"NotEqual",greaterThan:"GreaterThan",greaterThanOrEqual:"GreaterThanOrEqual",lessThan:"LessThan",lessThanOrEqual:"LessThanOrEqual",inRange:"InRange"},Pye={contains:"Contains",notContains:"NotContains",equals:"TextEquals",notEqual:"TextNotEqual",startsWith:"StartsWith",endsWith:"EndsWith",inRange:"InRange"},W_=class extends We{constructor(e,t,n){super(),this.optionsFactory=e,this.filterParams=t,this.valueFormatter=n}getModelAsString(e,t){const n=this.getLocaleTextFunc(),o=t==="filterToolPanel";if(!e)return o?ml(this,"filterSummaryInactive"):null;if(e.operator!=null){const r=e,a=(r.conditions??[]).map(c=>this.getModelAsString(c,t)),l=r.operator==="AND"?"andCondition":"orCondition";return a.join(` ${ml(this,l)} `)}else{if(e.type==="blank"||e.type==="notBlank")return o?ml(this,e.type==="blank"?"filterSummaryBlank":"filterSummaryNotBlank"):n(e.type,e.type);{const r=e,i=this.optionsFactory.getCustomOption(r.type),{displayKey:a,displayName:l,numberOfInputs:c}=i||{};return a&&l&&c===0?n(a,l):this.conditionToString(r,o,r.type==="inRange"||c===2,a,l)}}}updateParams(e){const{optionsFactory:t,filterParams:n}=e;this.optionsFactory=t,this.filterParams=n}conditionForToolPanel(e,t,n,o,s,r){let i;const a=this.getTypeKey(e);return a&&(i=ml(this,a)),s&&r&&(i=this.getLocaleTextFunc()(s,r)),i!=null?t?`${i} ${ml(this,"filterSummaryInRangeValues",[n(),o()])}`:`${i} ${n()}`:null}getTypeKey(e){const t=this.filterTypeKeys[e];return t?`filterSummary${t}`:null}formatValue(e){const t=this.valueFormatter;return t?t(e??null)??"":String(e)}},QB=class extends W_{constructor(e,t){super(e,t,n=>{const{dataTypeSvc:o,valueSvc:s}=this.beans,r=t.column,i=o==null?void 0:o.getDateFormatterFunction(r),a=i?i(n??void 0):n;return s.formatValue(r,null,a)}),this.filterTypeKeys=JB}conditionToString(e,t,n,o,s){const{type:r}=e,i=Cs(e.dateFrom),a=Cs(e.dateTo),l=this.filterParams.inRangeFloatingFilterDateFormat,c=t?this.formatValue.bind(this):h=>A0(h,l),u=()=>i!==null?c(i):"null",d=()=>a!==null?c(a):"null";if(t){const h=this.conditionForToolPanel(r,n,u,d,o,s);if(h!=null)return h}return n?`${u()}-${d()}`:i!=null?c(i):`${r}`}};function kye(e,t){const n=t;return n<e?-1:n>e?1:0}var Aye=class extends XB{constructor(){super(KB,U_),this.filterType="date",this.FilterModelFormatterClass=QB}comparator(){return this.params.filterParams.comparator??kye}isValid(e){const t=this.params.filterParams.isValidDate;return!t||t(e)}},e$=class extends bn{constructor(){super(...arguments),this.defaultDebounceMs=0}setLastTypeFromModel(e){if(!e){this.lastType=this.optionsFactory.defaultOption;return}const t=e.operator;let n;t?n=e.conditions[0]:n=e,this.lastType=n.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const n=e;return this.isTypeEditable(n.type)}init(e){this.params=e;const t=this.gos.get("enableFilterHandlers");if(this.reactive=t,this.setParams(e),t){const n=e;this.onModelUpdated(n.model)}}setParams(e){const t=new H_;this.optionsFactory=t,t.init(e.filterParams,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(t,e.filterParams)),this.setSimpleParams(e,!1)}setSimpleParams(e,t=!0){const n=this.optionsFactory.defaultOption;t||(this.lastType=n),this.readOnly=!!e.filterParams.readOnly;const o=this.isTypeEditable(n);this.setEditable(o)}refresh(e){this.params=e;const t=e,n=this.reactive;if((!n||t.source==="colDef")&&this.updateParams(e),n){const{source:o,model:s}=t;if(o==="dataChanged"||o==="ui")return;this.onModelUpdated(s)}}updateParams(e){const t=this.optionsFactory;t.refresh(e.filterParams,this.defaultOptions),this.setSimpleParams(e),this.filterModelFormatter.updateParams({optionsFactory:t,filterParams:e.filterParams})}onParentModelChanged(e,t){t!=null&&t.afterFloatingFilter||t!=null&&t.afterDataChange||this.onModelUpdated(e)}hasSingleInput(e){var n;const t=(n=this.optionsFactory.getCustomOption(e))==null?void 0:n.numberOfInputs;return t==null||t==1}isTypeEditable(e){const t=["inRange","empty","blank","notBlank"];return!!e&&!this.readOnly&&this.hasSingleInput(e)&&t.indexOf(e)<0}getAriaLabel(e){return`${this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0)} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`}},Oye={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eReadOnlyText"},{tag:"div",ref:"eDateWrapper",cls:"ag-date-floating-filter-wrapper"}]},Mye=class extends e${constructor(){super(Oye,[my]),this.eReadOnlyText=ht,this.eDateWrapper=ht,this.FilterModelFormatterClass=QB,this.filterType="date",this.defaultOptions=U_}setParams(e){super.setParams(e),this.createDateComponent();const t=this.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput","Date Filter Input"))}updateParams(e){super.updateParams(e),this.dateComp.updateParams(this.getDateComponentParams()),this.updateCompOnModelChange(e.currentParentModel())}updateCompOnModelChange(e){const t=!this.readOnly&&this.canWeEditAfterModelFromParentFilter(e);if(this.setEditable(t),t){const n=e?Cs(e.dateFrom):null;this.dateComp.setDate(n),this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){$n(this.eDateWrapper,e),$n(this.eReadOnlyText.getGui(),!e)}onModelUpdated(e){super.setLastTypeFromModel(e),this.updateCompOnModelChange(e)}onDateChanged(){const e=this.dateComp.getDate();if(this.reactive){const t=this.params;t.onUiChange();const n=t.model,o=Gs(e),s=o==null?null:{...n??{filterType:this.filterType,type:this.lastType??this.optionsFactory.defaultOption},dateFrom:o};t.onModelChange(s,{afterFloatingFilter:!0})}else this.params.parentFilterInstance(t=>{t==null||t.onFloatingFilterChanged(this.lastType||null,e)})}getDateComponentParams(){const{filterParams:e}=this.params,t=q0(e,this.defaultDebounceMs);return Pt(this.gos,{onDateChanged:Lo(this,this.onDateChanged.bind(this),t),filterParams:e,location:"floatingFilter"})}createDateComponent(){const{beans:{context:e,userCompFactory:t},eDateWrapper:n,params:o}=this;this.dateComp=new jB(e,t,o.column.getColDef(),this.getDateComponentParams(),n,s=>{s.setInputAriaLabel(this.getAriaLabel(o))}),this.addDestroyFunc(()=>this.dateComp.destroy())}},Nye={tag:"div",cls:"ag-filter-filter",children:[{tag:"ag-input-text-field",ref:"eDateInput",cls:"ag-date-filter"}]},Lye=class extends bn{constructor(){super(Nye,[my]),this.eDateInput=ht,this.isApply=!1,this.applyOnFocusOut=!1}init(e){this.params=e,this.setParams(e);const t=this.eDateInput.getInputElement();this.addManagedListeners(t,{mouseDown:()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||t.focus({preventScroll:!0})},input:this.handleInput.bind(this,!1),change:this.handleInput.bind(this,!0),focusout:this.handleFocusOut.bind(this)})}handleInput(e){if(!this.eDateInput.isDisabled()){if(this.isApply){this.applyOnFocusOut=!e,e&&this.params.onDateChanged();return}e||this.params.onDateChanged()}}handleFocusOut(){this.applyOnFocusOut&&(this.applyOnFocusOut=!1,this.params.onDateChanged())}setParams(e){var h;const t=this.eDateInput.getInputElement(),n=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=n&&hl();const{minValidYear:o,maxValidYear:s,minValidDate:r,maxValidDate:i,buttons:a,includeTime:l,colDef:c}=e.filterParams||{},u=this.beans.dataTypeSvc,d=l??((h=u==null?void 0:u.getDateIncludesTimeFlag)==null?void 0:h.call(u,c.cellDataType))??!1;if(n?d?(t.type="datetime-local",t.step="1"):t.type="date":t.type="text",r&&o&&Je(85),i&&s&&Je(86),r&&i){const[f,p]=[r,i].map(g=>g instanceof Date?g:Cs(g));f&&p&&f.getTime()>p.getTime()&&Je(87)}r?r instanceof Date?t.min=A0(r):t.min=r:o&&(t.min=`${o}-01-01`),i?i instanceof Date?t.max=A0(i):t.max=i:s&&(t.max=`${s}-12-31`),this.isApply=e.location==="floatingFilter"&&!!(a!=null&&a.includes("apply"))}refresh(e){this.params=e,this.setParams(e)}getDate(){return Cs(this.eDateInput.getValue())}setDate(e){var o;const t=this.params.filterParams.colDef.cellDataType,n=((o=this.beans.dataTypeSvc)==null?void 0:o.getDateIncludesTimeFlag(t))??!1;this.eDateInput.setValue(Gs(e,n))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setInputAriaLabel(e){this.eDateInput.setAriaLabel(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){e!=null&&e.suppressFocus||this.eDateInput.getInputElement().focus({preventScroll:!0})}shouldUseBrowserDatePicker(e){var t;return((t=e==null?void 0:e.filterParams)==null?void 0:t.browserDatePicker)??!0}},z_=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"];function j_(e){const{allowedCharPattern:t}=e??{};return t??null}function K_(e){return e==null||isNaN(e)?null:e}function t$(e,t){const{filter:n,filterTo:o,type:s}=e||{};return[K_(n),K_(o)].slice(0,xp(s,t))}var Vye=class extends G_{constructor(){super("numberFilter",t$,z_),this.eValuesFrom=[],this.eValuesTo=[],this.filterType="number",this.defaultDebounceMs=500}setElementValue(e,t,n){const{numberFormatter:o}=this.params,s=!n&&o?o(t??null):t;super.setElementValue(e,s)}createEValue(){const e=j_(this.params),t=ao({tag:"div",cls:"ag-filter-body",role:"presentation"});return this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement(e,t,n,o){const s=this.createManagedBean(o?new kc({allowedCharPattern:o}):new V0);s.addCss(`ag-filter-${n}`),s.addCss("ag-filter-filter"),t.push(s),e.appendChild(s.getGui())}removeEValues(e,t){const n=o=>this.removeComponents(o,e,t);n(this.eValuesFrom),n(this.eValuesTo)}getValues(e){const t=[];return this.forEachPositionInput(e,(n,o,s,r)=>{o<r&&t.push(K_(this.stringToFloat(n.getValue())))}),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}stringToFloat(e){if(typeof e=="number")return e;let t=ua(e);t!=null&&t.trim()===""&&(t=null);const n=this.params.numberParser;return n?n(t):t==null||t.trim()==="-"?null:Number.parseFloat(t)}createCondition(e){const t=this.getConditionType(e),n={filterType:this.filterType,type:t},o=this.getValues(e);return o.length>0&&(n.filter=o[0]),o.length>1&&(n.filterTo=o[1]),n}getInputs(e){const{eValuesFrom:t,eValuesTo:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>{t.getInputElement().validity.valid||(e=!0)}),e}},n$=class extends W_{constructor(e,t){super(e,t,t.numberFormatter),this.filterTypeKeys=JB}conditionToString(e,t,n,o,s){const{filter:r,filterTo:i,type:a}=e,l=this.formatValue.bind(this);if(t){const c=this.conditionForToolPanel(a,n,()=>l(r),()=>l(i),o,s);if(c!=null)return c}return n?`${l(r)}-${l(i)}`:r!=null?l(r):`${a}`}},Bye=class extends XB{constructor(){super(t$,z_),this.filterType="number",this.FilterModelFormatterClass=n$}comparator(){return(e,t)=>e===t?0:e<t?1:-1}isValid(e){return!isNaN(e)}},o$=class extends We{constructor(e){super(),this.params=e,this.eInput=ht,this.onValueChanged=()=>{}}setupGui(e){var o;this.eInput=this.createManagedBean(new kc((o=this.params)==null?void 0:o.config));const t=this.eInput.getGui();e.appendChild(t);const n=s=>this.onValueChanged(s);this.addManagedListeners(t,{input:n,keydown:n})}setEditable(e){this.eInput.setDisabled(!e)}getValue(){return this.eInput.getValue()}setValue(e,t){this.eInput.setValue(e,t)}setValueChangedListener(e){this.onValueChanged=e}setParams({ariaLabel:e,autoComplete:t}){const{eInput:n}=this;n.setInputAriaLabel(e),t!==void 0&&n.setAutoComplete(t)}};function q_(e){const t=e==null?void 0:e.trim();return t===""?e:t}function s$(e,t){const{filter:n,filterTo:o,type:s}=e||{};return[n||null,o||null].slice(0,xp(s,t))}var $ye={tag:"div",ref:"eFloatingFilterInputContainer",cls:"ag-floating-filter-input",role:"presentation"},r$=class extends e${constructor(){super(...arguments),this.eFloatingFilterInputContainer=ht,this.defaultDebounceMs=500}postConstruct(){this.setTemplate($ye)}onModelUpdated(e){this.setLastTypeFromModel(e),this.setEditable(this.canWeEditAfterModelFromParentFilter(e)),this.inputSvc.setValue(this.filterModelFormatter.getModelAsString(e))}setParams(e){this.setupFloatingFilterInputService(e),super.setParams(e),this.setTextInputParams(e)}setupFloatingFilterInputService(e){this.inputSvc=this.createFloatingFilterInputService(e),this.inputSvc.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(e){const t=e.browserAutoComplete??!1,{inputSvc:n,defaultDebounceMs:o,readOnly:s}=this;if(n.setParams({ariaLabel:this.getAriaLabel(e),autoComplete:t}),this.applyActive=by(e.filterParams),!s){const r=q0(e.filterParams,o),i=Lo(this,this.syncUpWithParentFilter.bind(this),r);n.setValueChangedListener(i)}}updateParams(e){super.updateParams(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const{inputSvc:t}=this,n=t.getValue();No(this.eFloatingFilterInputContainer),this.destroyBean(t),this.setupFloatingFilterInputService(e),t.setValue(n,!0)}syncUpWithParentFilter(e){const t=e.key===Oe.ENTER,n=this.reactive;if(n&&this.params.onUiChange(),this.applyActive&&!t)return;const{inputSvc:o,params:s,lastType:r}=this;let i=o.getValue();if(s.filterParams.trimInput&&(i=q_(i),o.setValue(i,!0)),n){const a=s,l=a.model,c=this.convertValue(i),u=c==null?null:{...l??{filterType:this.filterType,type:r??this.optionsFactory.defaultOption},filter:c};a.onModelChange(u,{afterFloatingFilter:!0})}else s.parentFilterInstance(a=>{a==null||a.onFloatingFilterChanged(r||null,i||null)})}convertValue(e){return e||null}setEditable(e){this.inputSvc.setEditable(e)}},Hye=class extends We{constructor(){super(...arguments),this.onValueChanged=()=>{},this.numberInputActive=!0}setupGui(e){this.eNumberInput=this.createManagedBean(new V0),this.eTextInput=this.createManagedBean(new kc),this.eTextInput.setDisabled(!0);const t=this.eNumberInput.getGui(),n=this.eTextInput.getGui();e.appendChild(t),e.appendChild(n),this.setupListeners(t,o=>this.onValueChanged(o)),this.setupListeners(n,o=>this.onValueChanged(o))}setEditable(e){this.numberInputActive=e,this.eNumberInput.setDisplayed(this.numberInputActive),this.eTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(e){this.eNumberInput.setAutoComplete(e),this.eTextInput.setAutoComplete(e)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eNumberInput:this.eTextInput}setValueChangedListener(e){this.onValueChanged=e}setupListeners(e,t){this.addManagedListeners(e,{input:t,keydown:t})}setParams(e){this.setAriaLabel(e.ariaLabel),e.autoComplete!==void 0&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eNumberInput.setInputAriaLabel(e),this.eTextInput.setInputAriaLabel(e)}},Gye=class extends r${constructor(){super(...arguments),this.FilterModelFormatterClass=n$,this.filterType="number",this.defaultOptions=z_}updateParams(e){j_(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.updateParams(e)}createFloatingFilterInputService(e){return this.allowedCharPattern=j_(e.filterParams),this.allowedCharPattern?this.createManagedBean(new o$({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new Hye)}convertValue(e){return e?Number(e):null}},Y_=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],Uye=class extends G_{constructor(){super("textFilter",s$,Y_),this.filterType="text",this.eValuesFrom=[],this.eValuesTo=[],this.defaultDebounceMs=500}createCondition(e){const t=this.getConditionType(e),n={filterType:this.filterType,type:t},o=this.getValues(e);return o.length>0&&(n.filter=o[0]),o.length>1&&(n.filterTo=o[1]),n}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){const{eValuesFrom:t,eValuesTo:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(n,o,s,r)=>{o<r&&t.push(ua(n.getValue()))}),t}createEValue(){const e=ao({tag:"div",cls:"ag-filter-body",role:"presentation"}),{eValuesFrom:t,eValuesTo:n}=this;return this.createFromToElement(e,t,"from"),this.createFromToElement(e,n,"to"),e}createFromToElement(e,t,n){const o=this.createManagedBean(new kc);o.addCss(`ag-filter-${n}`),o.addCss("ag-filter-filter"),t.push(o),e.appendChild(o.getGui())}removeEValues(e,t){const n=r=>this.removeComponents(r,e,t),{eValuesFrom:o,eValuesTo:s}=this;n(o),n(s)}},i$=class extends W_{constructor(){super(...arguments),this.filterTypeKeys=Pye}conditionToString(e,t,n,o,s){const{filter:r,filterTo:i,type:a}=e;if(t){const l=u=>()=>ml(this,"filterSummaryTextQuote",[u]),c=this.conditionForToolPanel(a,n,l(r),l(i),o,s);if(c!=null)return c}return n?`${r}-${i}`:r!=null?`${r}`:`${a}`}},Wye=({filterOption:e,value:t,filterText:n})=>{if(n==null)return!1;switch(e){case"contains":return t.includes(n);case"notContains":return!t.includes(n);case"equals":return t===n;case"notEqual":return t!=n;case"startsWith":return t.indexOf(n)===0;case"endsWith":{const o=t.lastIndexOf(n);return o>=0&&o===t.length-n.length}default:return!1}},zye=e=>e,jye=e=>e==null?null:e.toString().toLowerCase(),Kye=class extends ZB{constructor(){super(s$,Y_),this.filterType="text",this.FilterModelFormatterClass=i$}updateParams(e){super.updateParams(e);const t=e.filterParams;this.matcher=t.textMatcher??Wye,this.formatter=t.textFormatter??(t.caseSensitive?zye:jye)}evaluateNullValue(e){return e?["notEqual","notContains","blank"].indexOf(e)>=0:!1}evaluateNonNullValue(e,t,n,o){const s=e.map(h=>this.formatter(h))||[],r=this.formatter(t),{api:i,colDef:a,column:l,context:c,filterParams:{textFormatter:u}}=this.params;if(n.type==="blank")return Wy(t);if(n.type==="notBlank")return!Wy(t);const d={api:i,colDef:a,column:l,context:c,node:o.node,data:o.data,filterOption:n.type,value:r,textFormatter:u};return s.some(h=>this.matcher({...d,filterText:h}))}processModelToApply(e){if(e&&this.params.filterParams.trimInput){const t=n=>{const o={...n},{filter:s,filterTo:r}=n;return s&&(o.filter=q_(s)??null),r&&(o.filterTo=q_(r)??null),o};return dV(e)?{...e,conditions:e.conditions.map(t)}:t(e)}return e}},qye=class extends r${constructor(){super(...arguments),this.FilterModelFormatterClass=i$,this.filterType="text",this.defaultOptions=Y_}createFloatingFilterInputService(){return this.createManagedBean(new o$)}};function Yye(e){var t;return!!((t=e.quickFilter)!=null&&t.isFilterPresent())}function Zye(e){var t;return(t=e.quickFilter)==null?void 0:t.getText()}function Xye(e){var t;(t=e.quickFilter)==null||t.resetCache()}var Jye=class extends We{constructor(){super(...arguments),this.beanName="quickFilter",this.quickFilter=null,this.quickFilterParts=null}postConstruct(){const e=this.resetCache.bind(this),t=this.gos;this.addManagedEventListeners({columnPivotModeChanged:e,newColumnsLoaded:e,columnRowGroupChanged:e,columnVisible:()=>{t.get("includeHiddenColumnsInQuickFilter")||this.resetCache()}}),this.addManagedPropertyListener("quickFilterText",n=>this.setFilter(n.currentValue)),this.addManagedPropertyListeners(["includeHiddenColumnsInQuickFilter","applyQuickFilterBeforePivotOrAgg"],()=>this.onColumnConfigChanged()),this.quickFilter=this.parseFilter(t.get("quickFilterText")),this.parser=t.get("quickFilterParser"),this.matcher=t.get("quickFilterMatcher"),this.setFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],()=>this.setParserAndMatcher())}refreshCols(){var l;const{autoColSvc:e,colModel:t,gos:n,pivotResultCols:o}=this.beans,s=t.isPivotMode(),r=e==null?void 0:e.getColumns(),i=t.getColDefCols();let a=(s&&!n.get("applyQuickFilterBeforePivotOrAgg")?(l=o==null?void 0:o.getPivotResultCols())==null?void 0:l.list:i)??[];r&&(a=a.concat(r)),this.colsToUse=n.get("includeHiddenColumnsInQuickFilter")?a:a.filter(c=>c.isVisible()||c.isRowGroupActive())}isFilterPresent(){return this.quickFilter!==null}doesRowPass(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassMatcher(t,e):this.quickFilterParts.every(n=>t?this.doesRowPassCache(e,n):this.doesRowPassNoCache(e,n))}resetCache(){this.beans.rowModel.forEachNode(e=>e.quickFilterAggregateText=null)}getText(){return this.gos.get("quickFilterText")}setFilterParts(){const{quickFilter:e,parser:t}=this;e?this.quickFilterParts=t?t(e):e.split(" "):this.quickFilterParts=null}parseFilter(e){return ft(e)?e.toUpperCase():null}setFilter(e){if(e!=null&&typeof e!="string"){Je(70,{newFilter:e});return}const t=this.parseFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}setParserAndMatcher(){const e=this.gos.get("quickFilterParser"),t=this.gos.get("quickFilterMatcher"),n=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,n&&(this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}onColumnConfigChanged(){this.refreshCols(),this.resetCache(),this.isFilterPresent()&&this.dispatchLocalEvent({type:"quickFilterChanged"})}doesRowPassNoCache(e,t){return this.colsToUse.some(n=>{const o=this.getTextForColumn(n,e);return ft(o)&&o.includes(t)})}doesRowPassCache(e,t){return this.checkGenerateAggText(e),e.quickFilterAggregateText.includes(t)}doesRowPassMatcher(e,t){let n;e?(this.checkGenerateAggText(t),n=t.quickFilterAggregateText):n=this.getAggText(t);const{quickFilterParts:o,matcher:s}=this;return s(o,n)}checkGenerateAggText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getAggText(e))}getTextForColumn(e,t){let n=this.beans.filterValueSvc.getValue(e,t);const o=e.getColDef();if(o.getQuickFilterText){const s=Pt(this.gos,{value:n,node:t,data:t.data,column:e,colDef:o});n=o.getQuickFilterText(s)}return ft(n)?n.toString().toUpperCase():null}getAggText(e){const t=[];for(const n of this.colsToUse){const o=this.getTextForColumn(n,e);ft(o)&&t.push(o)}return t.join(`
|
|
259
259
|
`)}},Qye={moduleName:"ClientSideRowModelFilter",version:dt,rowModels:["clientSide"],beans:[eye]},Z_={moduleName:"FilterCore",version:dt,beans:[Sye],apiFunctions:{isAnyFilterPresent:Cye,onFilterChanged:bye},css:[iye],dependsOn:[Qye]},a$={moduleName:"FilterValue",version:dt,beans:[_ye]},zy={moduleName:"ColumnFilter",version:dt,beans:[wye,Eye],dynamicBeans:{headerFilterCellCtrl:tye},icons:{filter:"filter",filterActive:"filter"},apiFunctions:{isColumnFilterPresent:aye,getColumnFilterInstance:lye,destroyFilter:cye,setFilterModel:uye,getFilterModel:dye,getColumnFilterModel:hye,setColumnFilterModel:fye,showColumnFilter:pye,hideColumnFilter:gye,getColumnFilterHandler:mye,doFilterAction:vye},dependsOn:[Z_,Uy,a$,sye]},ewe={moduleName:"CustomFilter",version:dt,userComponents:{agReadOnlyFloatingFilter:Dye},dependsOn:[zy]},twe={moduleName:"TextFilter",version:dt,dependsOn:[zy],userComponents:{agTextColumnFilter:{classImp:Uye,params:{useForm:!0}},agTextColumnFloatingFilter:qye},dynamicBeans:{agTextColumnFilterHandler:Kye}},nwe={moduleName:"NumberFilter",version:dt,dependsOn:[zy],userComponents:{agNumberColumnFilter:{classImp:Vye,params:{useForm:!0}},agNumberColumnFloatingFilter:Gye},dynamicBeans:{agNumberColumnFilterHandler:Bye}},owe={moduleName:"DateFilter",version:dt,dependsOn:[zy],userComponents:{agDateColumnFilter:{classImp:Fye,params:{useForm:!0}},agDateInput:Lye,agDateColumnFloatingFilter:Mye},dynamicBeans:{agDateColumnFilterHandler:Aye}},swe={moduleName:"QuickFilterCore",version:dt,rowModels:["clientSide"],beans:[Jye],dependsOn:[Z_,a$]},rwe={moduleName:"QuickFilter",version:dt,apiFunctions:{isQuickFilterPresent:Yye,getQuickFilter:Zye,resetQuickFilter:Xye},dependsOn:[swe]},iwe={moduleName:"ExternalFilter",version:dt,dependsOn:[Z_]},awe=".ag-tooltip{background-color:var(--ag-tooltip-background-color);border:var(--ag-tooltip-border);border-radius:var(--ag-border-radius);color:var(--ag-tooltip-text-color);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;white-space:normal;z-index:99999;&:where(.ag-cell-editor-tooltip){background-color:var(--ag-tooltip-error-background-color);border:var(--ag-tooltip-error-border);color:var(--ag-tooltip-error-text-color);font-weight:500}}.ag-tooltip-custom{position:absolute;z-index:99999}.ag-tooltip-custom:where(:not(.ag-tooltip-interactive)),.ag-tooltip:where(:not(.ag-tooltip-interactive)){pointer-events:none}.ag-tooltip-animate{transition:opacity 1s;&:where(.ag-tooltip-hiding){opacity:0}}",X_=(e,t,n)=>{var a,l,c;const{editModelSvc:o}=e,s=(l=(a=o==null?void 0:o.getCellValidationModel())==null?void 0:a.getCellValidation(t))==null?void 0:l.errorMessages,r=(c=o==null?void 0:o.getRowValidationModel().getRowValidation(t))==null?void 0:c.errorMessages,i=s||r;return i!=null&&i.length?i.join(n("tooltipValidationErrorSeparator",". ")):void 0},lwe=class extends We{constructor(){super(...arguments),this.beanName="tooltipSvc"}setupHeaderTooltip(e,t,n,o){e&&t.destroyBean(e);const s=this.gos,r=$_(s),{column:i,eGui:a}=t,l=i.getColDef();!o&&r&&!l.headerComponent&&(o=Zv(()=>a.querySelector(".ag-header-cell-text")));const c="header",d=this.beans.colNames.getDisplayNameForColumn(i,"header",!0),h=n??d,f={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,Pt(s,{location:c,colDef:l,column:i,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:o,getAdditionalParams:()=>({column:i,colDef:i.getColDef()})};let p=this.createTooltipFeature(f);return p&&(p=t.createBean(p),t.setRefreshFunction("tooltip",()=>p.refreshTooltip())),p}setupHeaderGroupTooltip(e,t,n,o){e&&t.destroyBean(e);const s=this.gos,r=$_(s),{column:i,eGui:a}=t,l=i.getColGroupDef();!o&&r&&!(l!=null&&l.headerGroupComponent)&&(o=Zv(()=>a.querySelector(".ag-header-group-text")));const c="headerGroup",d=this.beans.colNames.getDisplayNameForColumnGroup(i,"header"),h=n??d,f={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,Pt(s,{location:c,colDef:l,column:i,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:o,getAdditionalParams:()=>{const g={column:i};return l&&(g.colDef=l),g}},p=this.createTooltipFeature(f);return p&&t.createBean(p)}enableCellTooltipFeature(e,t,n){const{beans:o}=this,{gos:s,editSvc:r}=o,{column:i,rowNode:a}=e;let l="cell";const c=()=>{const f=!!!(r!=null&&r.isEditing(e))&&X_(o,e,this.getLocaleTextFunc());if(f)return l="cellEditor",f;l="cell";const p=i.getColDef(),g=a.data;if(p.tooltipField&&ft(g))return _p(g,p.tooltipField,i.isTooltipFieldContainsDots());const v=p.tooltipValueGetter;return v?v(Pt(s,{location:"cell",colDef:i.getColDef(),column:i,rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,value:e.value,valueFormatted:e.valueFormatted})):null},u=$_(s);n||(u&&!e.isCellRenderer()?n=()=>{const h=!!(r!=null&&r.isEditing(e));if(!h&&X_(o,e,this.getLocaleTextFunc()))return!0;if(!i.isTooltipEnabled())return!1;const g=Zv(()=>{const v=e.eGui;return v.children.length===0?v:v.querySelector(".ag-cell-value")});return!h&&g()}:n=()=>!(r!=null&&r.isEditing(e)));const d={getGui:()=>e.eGui,getLocation:()=>l,getTooltipValue:t!=null?()=>t:c,shouldDisplayTooltip:n,getAdditionalParams:()=>({column:i,colDef:i.getColDef(),rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,valueFormatted:e.valueFormatted})};return this.createTooltipFeature(d,o)}setupFullWidthRowTooltip(e,t,n,o){const s={getGui:()=>t.getFullWidthElement(),getTooltipValue:()=>n,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:o},r=this.beans,i=r.context;e&&t.destroyBean(e,i);const a=this.createTooltipFeature(s,r);if(a)return t.createBean(a,i)}setupCellEditorTooltip(e,t){var a,l;const{beans:n}=this,{context:o}=n,s=((a=t.getValidationElement)==null?void 0:a.call(t,!0))||!((l=t.isPopup)!=null&&l.call(t))&&e.eGui;if(!s)return;const r={getGui:()=>s,getTooltipValue:()=>X_(n,e,this.getLocaleTextFunc()),getLocation:()=>"cellEditor",shouldDisplayTooltip:()=>{var p,g;const{editModelSvc:c}=n,u=(p=c==null?void 0:c.getRowValidationModel())==null?void 0:p.getRowValidationMap(),d=(g=c==null?void 0:c.getCellValidationModel())==null?void 0:g.getCellValidationMap(),h=!!u&&u.size>0,f=!!d&&d.size>0;return h||f}},i=this.createTooltipFeature(r,n);if(i)return e.createBean(i,o)}initCol(e){const{colDef:t}=e;e.tooltipEnabled=ft(t.tooltipField)||ft(t.tooltipValueGetter)||ft(t.tooltipComponent)}createTooltipFeature(e,t){return this.beans.registry.createDynamicBean("tooltipFeature",!1,e,t)}},cwe=class extends Ace{createTooltipComp(e,t){const n=Rle(this.beans.userCompFactory,e);n==null||n.newAgStackInstance().then(t)}setEventHandlers(e){[this.onColumnMovedEventCallback]=this.addManagedEventListeners({columnMoved:e})}clearEventHandlers(){var e;(e=this.onColumnMovedEventCallback)==null||e.call(this),this.onColumnMovedEventCallback=void 0}},l$={moduleName:"Tooltip",version:dt,beans:[lwe],dynamicBeans:{tooltipFeature:q2,highlightTooltipFeature:Oce,tooltipStateManager:cwe},userComponents:{agTooltipComponent:Lce},dependsOn:[Uy],css:[awe]},Hd=class{constructor(e){this.cellValueChanges=e}},J_=class extends Hd{constructor(e,t,n,o){super(e),this.initialRange=t,this.finalRange=n,this.ranges=o}},uwe=10,c$=class{constructor(e){this.actionStack=[],this.maxStackSize=e||uwe,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}},dwe=class extends We{constructor(){super(...arguments),this.beanName="undoRedo",this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.batchEditing=!1,this.bulkEditing=!1,this.onCellValueChanged=e=>{const t={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned},n=this.activeCellEdit!==null&&zV(this.activeCellEdit,t),o=this.activeRowEdit!==null&&Ohe(this.activeRowEdit,t);if(!(n||o||this.isPasting||this.isRangeInAction))return;const{rowPinned:r,rowIndex:i,column:a,oldValue:l,value:c}=e,u={rowPinned:r,rowIndex:i,columnId:a.getColId(),newValue:c,oldValue:l};this.cellValueChanges.push(u)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}postConstruct(){const{gos:e,ctrlsSvc:t}=this.beans;if(!e.get("undoRedoCellEditing"))return;const n=e.get("undoRedoCellEditingLimit");if(n<=0)return;this.undoStack=new c$(n),this.redoStack=new c$(n),this.addListeners();const o=this.clearStacks.bind(this);this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this),modelUpdated:s=>{s.keepUndoRedoStack||this.clearStacks()},columnPivotModeChanged:o,newColumnsLoaded:o,columnGroupOpened:o,columnRowGroupChanged:o,columnMoved:o,columnPinned:o,columnVisible:o,rowDragEnd:o}),t.whenReady(this,s=>{this.gridBodyCtrl=s.gridBodyCtrl})}getCurrentUndoStackSize(){var e;return((e=this.undoStack)==null?void 0:e.getCurrentStackSize())??0}getCurrentRedoStackSize(){var e;return((e=this.redoStack)==null?void 0:e.getCurrentStackSize())??0}undo(e){const{eventSvc:t,undoStack:n,redoStack:o}=this;t.dispatchEvent({type:"undoStarted",source:e});const s=this.undoRedo(n,o,"initialRange","oldValue","undo");t.dispatchEvent({type:"undoEnded",source:e,operationPerformed:s})}redo(e){const{eventSvc:t,undoStack:n,redoStack:o}=this;t.dispatchEvent({type:"redoStarted",source:e});const s=this.undoRedo(o,n,"finalRange","newValue","redo");t.dispatchEvent({type:"redoEnded",source:e,operationPerformed:s})}undoRedo(e,t,n,o,s){if(!e)return!1;const r=e.pop();return r!=null&&r.cellValueChanges?(this.processAction(r,i=>i[o],s),r instanceof J_?this.processRange(r.ranges||[r[n]]):this.processCell(r.cellValueChanges),t.push(r),!0):!1}processAction(e,t,n){for(const o of e.cellValueChanges){const{rowIndex:s,rowPinned:r,columnId:i}=o,a={rowIndex:s,rowPinned:r},l=Ca(this.beans,a);l.displayed&&l.setDataValue(i,t(o),n)}}processRange(e){let t;const n=this.beans.rangeSvc;n.removeAllCellRanges(!0),e.forEach((o,s)=>{if(!o)return;const r=o.startRow,i=o.endRow;s===e.length-1&&(t={rowPinned:r.rowPinned,rowIndex:r.rowIndex,columnId:o.startColumn.getColId()},this.setLastFocusedCell(t));const a={rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,rowEndIndex:i.rowIndex,rowEndPinned:i.rowPinned,columnStart:o.startColumn,columns:o.columns};n.addCellRange(a)})}processCell(e){const t=e[0],{rowIndex:n,rowPinned:o}=t,s={rowIndex:n,rowPinned:o},r=Ca(this.beans,s),i={rowPinned:t.rowPinned,rowIndex:r.rowIndex,columnId:t.columnId};this.setLastFocusedCell(i)}setLastFocusedCell(e){const{rowIndex:t,columnId:n,rowPinned:o}=e,{colModel:s,focusSvc:r,rangeSvc:i}=this.beans,a=s.getCol(n);if(!a)return;const{scrollFeature:l}=this.gridBodyCtrl;l.ensureIndexVisible(t),l.ensureColumnVisible(a);const c={rowIndex:t,column:a,rowPinned:o};r.setFocusedCell({...c,forceBrowserFocus:!0}),i==null||i.setRangeToCell(c)}addListeners(){this.addManagedEventListeners({rowEditingStarted:e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}},rowEditingStopped:()=>{const e=new Hd(this.cellValueChanges);this.pushActionsToUndoStack(e),this.activeRowEdit=null},cellEditingStarted:e=>{this.activeCellEdit={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned}},cellEditingStopped:e=>{if(this.activeCellEdit=null,e.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const n=new Hd(this.cellValueChanges);this.pushActionsToUndoStack(n)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new Hd(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new J_(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1},keyShortcutChangedCellStart:()=>{this.isRangeInAction=!0},keyShortcutChangedCellEnd:()=>{let e;const{rangeSvc:t,gos:n}=this.beans;t&&ha(n)?e=new J_(this.cellValueChanges,void 0,void 0,[...t.getCellRanges()]):e=new Hd(this.cellValueChanges),this.pushActionsToUndoStack(e),this.isRangeInAction=!1},batchEditingStarted:()=>this.startBigChange("batchEditing"),batchEditingStopped:({changes:e})=>this.stopBigChange("batchEditing",e),bulkEditingStarted:()=>this.startBigChange("bulkEditing"),bulkEditingStopped:({changes:e})=>this.stopBigChange("bulkEditing",e)})}startBigChange(e){this.updateBigChange(e,!0)}updateBigChange(e,t){e==="bulkEditing"?this.bulkEditing=t:this.batchEditing=t}stopBigChange(e,t){if(e==="bulkEditing"&&!this.bulkEditing||e==="batchEditing"&&!this.batchEditing||(this.updateBigChange(e,!1),(t==null?void 0:t.length)===0))return;const n=new Hd(t??[]);this.pushActionsToUndoStack(n),this.cellValueChanges=[]}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}},hwe=".ag-cell-inline-editing{border:var(--ag-cell-editing-border)!important;border-radius:var(--ag-border-radius);box-shadow:var(--ag-cell-editing-shadow);padding:0;z-index:1;.ag-cell-edit-wrapper,.ag-cell-editor,.ag-cell-wrapper,:where(.ag-cell-editor) .ag-input-field-input,:where(.ag-cell-editor) .ag-wrapper{height:100%;line-height:normal;min-height:100%;width:100%}&.ag-cell-editing-error{border-color:var(--ag-invalid-color)!important}}:where(.ag-popup-editor) .ag-large-text{background-color:var(--ag-background-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);padding:0}.ag-large-text-input{display:block;height:auto;padding:var(--ag-cell-horizontal-padding)}:where(.ag-rtl .ag-large-text-input) textarea{resize:none}:where(.ag-ltr) .ag-checkbox-edit{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-checkbox-edit{padding-right:var(--ag-cell-horizontal-padding)}:where(.ag-row.ag-row-editing-invalid .ag-cell-inline-editing){opacity:.8}.ag-popup-editor{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}",fwe={tag:"div",cls:"ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit",children:[{tag:"ag-checkbox",ref:"eEditor",role:"presentation"}]},pwe=class extends ky{constructor(){super(fwe,[L0]),this.eEditor=ht}initialiseEditor(e){const t=e.value??void 0,n=this.eEditor;n.setValue(t),n.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(t),this.addManagedListeners(n,{fieldValueChanged:s=>this.setAriaLabel(s.selected)})}getValue(){return this.eEditor.getValue()}focusIn(){this.eEditor.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.getLocaleTextFunc(),n=jv(t,e),o=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eEditor.setInputAriaLabel(`${o} (${n})`)}getValidationElement(e){return e?this.params.eGridCell:this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{getValidationErrors:t}=e,n=this.getValue();return t?t({value:n,internalErrors:null,cellEditorParams:e}):null}},jy=class extends ky{constructor(e){super(),this.cellEditorInput=e,this.eEditor=ht}initialiseEditor(e){const{cellEditorInput:t}=this;this.setTemplate({tag:"div",cls:"ag-cell-edit-wrapper",children:[t.getTemplate()]},t.getAgComponents());const{eEditor:n}=this,{cellStartedEdit:o,eventKey:s,suppressPreventDefault:r}=e;n.getInputElement().setAttribute("title",""),t.init(n,e);let i,a=!0;o?(this.focusAfterAttached=!0,s===Oe.BACKSPACE||s===Oe.DELETE?i="":s&&s.length===1?r?a=!1:i=s:(i=t.getStartValue(),s!==Oe.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,i=t.getStartValue()),a&&i!=null&&n.setStartValue(i),this.addGuiEventListener("keydown",l=>{const{key:c}=l;(c===Oe.PAGE_UP||c===Oe.PAGE_DOWN)&&l.preventDefault()})}afterGuiAttached(){var o,s;const e=this.getLocaleTextFunc(),t=this.eEditor;if(t.setInputAriaLabel(e("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;hl()||t.getFocusableElement().focus();const n=t.getInputElement();this.highlightAllOnFocus?n.select():(s=(o=this.cellEditorInput).setCaret)==null||s.call(o)}focusIn(){const{eEditor:e}=this,t=e.getFocusableElement(),n=e.getInputElement();t.focus(),n.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){return this.cellEditorInput.getValidationErrors()}},gwe={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},mwe=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return gwe}getAgComponents(){return[N2]}init(e,t){var i,a;this.eEditor=e,this.params=t;const{min:n,max:o,step:s,colDef:r}=t;n!=null&&e.setMin(n),o!=null&&e.setMax(o),s!=null&&e.setStep(s),this.includeTime=t.includeTime??((a=(i=this.getDataTypeService())==null?void 0:i.getDateIncludesTimeFlag)==null?void 0:a.call(i,r.cellDataType)),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const t=this.eEditor.getInputElement().valueAsDate,{params:n}=this,{min:o,max:s,getValidationErrors:r}=n;let i=[];const a=this.getLocaleTextFunc();if(t instanceof Date&&!isNaN(t.getTime())){if(o){const l=o instanceof Date?o:new Date(o);if(t<l){const c=l.toLocaleDateString();i.push(a("minDateValidation",`Date must be after ${c}`,[c]))}}if(s){const l=s instanceof Date?s:new Date(s);if(t>l){const c=l.toLocaleDateString();i.push(a("maxDateValidation",`Date must be before ${c}`,[c]))}}}return i.length||(i=null),r?r({value:t,cellEditorParams:n,internalErrors:i}):i}getValue(){const{eEditor:e,params:t}=this,n=e.getDate();return!ft(n)&&!ft(t.value)?t.value:n??null}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return Gs(e,this.includeTime??!1)}},vwe=class extends jy{constructor(){super(new mwe(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},ywe={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},wwe=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return ywe}getAgComponents(){return[N2]}init(e,t){var i,a;this.eEditor=e,this.params=t;const{min:n,max:o,step:s,colDef:r}=t;n!=null&&e.setMin(n),o!=null&&e.setMax(o),s!=null&&e.setStep(s),this.includeTime=t.includeTime??((a=(i=this.getDataTypeService())==null?void 0:i.getDateIncludesTimeFlag)==null?void 0:a.call(i,r.cellDataType)),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const{eEditor:e,params:t}=this,n=e.getInputElement().value,o=this.formatDate(this.parseDate(n??void 0)),{min:s,max:r,getValidationErrors:i}=t;let a=[];if(o){const l=new Date(o),c=this.getLocaleTextFunc();if(s){const u=new Date(s);if(l<u){const d=u.toLocaleDateString();a.push(c("minDateValidation",`Date must be after ${d}`,[d]))}}if(r){const u=new Date(r);if(l>u){const d=u.toLocaleDateString();a.push(c("maxDateValidation",`Date must be before ${d}`,[d]))}}}return a.length||(a=null),i?i({value:this.getValue(),cellEditorParams:t,internalErrors:a}):a}getValue(){const{params:e,eEditor:t}=this,n=this.formatDate(t.getDate());return!ft(n)&&!ft(e.value)?e.value:e.parseValue(n??"")}getStartValue(){return Gs(this.parseDate(this.params.value??void 0)??null,this.includeTime??!1)}parseDate(e){const t=this.getDataTypeService();return t?t.getDateParserFunction(this.params.column)(e):Cs(e)??void 0}formatDate(e){const t=this.getDataTypeService();return t?t.getDateFormatterFunction(this.params.column)(e):Gs(e??null,this.includeTime??!1)??void 0}},Cwe=class extends jy{constructor(){super(new wwe(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},bwe={tag:"div",cls:"ag-large-text",children:[{tag:"ag-input-text-area",ref:"eEditor",cls:"ag-large-text-input"}]},Swe=class extends ky{constructor(){super(bwe,[Ule]),this.eEditor=ht}initialiseEditor(e){const{eEditor:t}=this,{cellStartedEdit:n,eventKey:o,maxLength:s,cols:r,rows:i}=e;this.focusAfterAttached=n,t.getInputElement().setAttribute("title",""),t.setMaxLength(s||200).setCols(r||60).setRows(i||10);let a;n?(this.focusAfterAttached=!0,o===Oe.BACKSPACE||o===Oe.DELETE?a="":o&&o.length===1?a=o:(a=this.getStartValue(e),o!==Oe.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,a=this.getStartValue(e)),a!=null&&t.setValue(a,!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.activateTabIndex()}getStartValue(e){const{value:t}=e;return(t==null?void 0:t.toString())??t}onKeyDown(e){const t=e.key;(t===Oe.LEFT||t===Oe.UP||t===Oe.RIGHT||t===Oe.DOWN||e.shiftKey&&t===Oe.ENTER)&&e.stopPropagation()}afterGuiAttached(){const{eEditor:e,focusAfterAttached:t,highlightAllOnFocus:n}=this,o=this.getLocaleTextFunc();e.setInputAriaLabel(o("ariaInputEditor","Input Editor")),t&&(e.getFocusableElement().focus(),n&&e.getInputElement().select())}getValue(){const{eEditor:e,params:t}=this,{value:n}=t,o=e.getValue();return!ft(o)&&!ft(n)?n:t.parseValue(o)}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:n}=e,o=this.getLocaleTextFunc(),s=this.getValue();let r=[];return typeof s=="string"&&t!=null&&s.length>t&&r.push(o("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),r.length||(r=null),n?n({value:s,internalErrors:r,cellEditorParams:e}):r}},Ewe={tag:"ag-input-number-field",ref:"eEditor",cls:"ag-cell-editor"},_we=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return Ewe}getAgComponents(){return[Wle]}init(e,t){this.eEditor=e,this.params=t;const{max:n,min:o,precision:s,step:r}=t;n!=null&&e.setMax(n),o!=null&&e.setMin(o),s!=null&&e.setPrecision(s),r!=null&&e.setStep(r);const i=e.getInputElement();t.preventStepping?e.addManagedElementListeners(i,{keydown:this.preventStepping}):t.showStepperButtons&&i.classList.add("ag-number-field-input-stepper")}getValidationErrors(){const{params:e}=this,{min:t,max:n,getValidationErrors:o}=e,r=this.eEditor.getInputElement().valueAsNumber,i=this.getLocaleTextFunc();let a=[];return typeof r=="number"&&(t!=null&&r<t&&a.push(i("minValueValidation",`Must be greater than or equal to ${t}.`,[String(t)])),n!=null&&r>n&&a.push(i("maxValueValidation",`Must be less than or equal to ${n}.`,[String(n)]))),a.length||(a=null),o?o({value:r,cellEditorParams:e,internalErrors:a}):a}preventStepping(e){(e.key===Oe.UP||e.key===Oe.DOWN)&&e.preventDefault()}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();if(!ft(n)&&!ft(t.value))return t.value;let o=t.parseValue(n);if(o==null)return o;if(typeof o=="string"){if(o==="")return null;o=Number(o)}return isNaN(o)?null:o}getStartValue(){return this.params.value}setCaret(){hl()&&this.eEditor.getInputElement().focus({preventScroll:!0})}},Rwe=class extends jy{constructor(){super(new _we(()=>this.getLocaleTextFunc()))}},Dwe={tag:"div",cls:"ag-cell-edit-wrapper",children:[{tag:"ag-select",ref:"eEditor",cls:"ag-cell-editor"}]},Twe=class extends ky{constructor(){super(Dwe,[tce]),this.eEditor=ht,this.startedByEnter=!1}wireBeans(e){this.valueSvc=e.valueSvc}initialiseEditor(e){this.focusAfterAttached=e.cellStartedEdit;const{eEditor:t,valueSvc:n,gos:o}=this,{values:s,value:r,eventKey:i}=e;if(Bn(s)){Je(58);return}this.startedByEnter=i!=null?i===Oe.ENTER:!1;let a=!1;s.forEach(d=>{const h={value:d},f=n.formatValue(e.column,null,d),p=f!=null;h.text=p?f:d,t.addOption(h),a=a||r===d}),a?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:l,valueListMaxWidth:c,valueListMaxHeight:u}=e;l!=null&&t.setPickerGap(l),u!=null&&t.setPickerMaxHeight(u),c!=null&&t.setPickerMaxWidth(c),o.get("editType")!=="fullRow"&&this.addManagedListeners(this.eEditor,{selectedItem:()=>e.stopEditing()})}afterGuiAttached(){this.focusAfterAttached&&this.eEditor.getFocusableElement().focus(),this.startedByEnter&&setTimeout(()=>{this.isAlive()&&this.eEditor.showPicker()})}focusIn(){this.eEditor.getFocusableElement().focus()}getValue(){return this.eEditor.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getAriaElement()}getValidationErrors(){const{params:e}=this,{values:t,getValidationErrors:n}=e,o=this.getValue();let s=[];if(t&&!t.includes(o)){const r=this.getLocaleTextFunc();s.push(r("invalidSelectionValidation","Invalid selection."))}else s=null;return n?n({value:o,internalErrors:s,cellEditorParams:e}):s}},Iwe={tag:"ag-input-text-field",ref:"eEditor",cls:"ag-cell-editor"},xwe=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return Iwe}getAgComponents(){return[my]}init(e,t){this.eEditor=e,this.params=t;const n=t.maxLength;n!=null&&e.setMaxLength(n)}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:n}=e,o=this.getValue(),s=this.getLocaleTextFunc();let r=[];return t!=null&&typeof o=="string"&&o.length>t&&r.push(s("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),r.length||(r=null),n?n({value:o,cellEditorParams:e,internalErrors:r}):r}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();return!ft(n)&&!ft(t.value)?t.value:t.parseValue(n)}getStartValue(){const e=this.params;return e.useFormatter||e.column.getColDef().refData?e.formatValue(e.value):e.value}setCaret(){hl()&&this.eEditor.getInputElement().focus({preventScroll:!0});const e=this.eEditor,t=e.getValue(),n=ft(t)&&t.length||0;n&&e.getInputElement().setSelectionRange(n,n)}},u$=class extends jy{constructor(){super(new xwe(()=>this.getLocaleTextFunc()))}};function Fwe(e){return e.ctrlsSvc.getScrollFeature().getVScrollPosition()}function Pwe(e){return e.ctrlsSvc.getScrollFeature().getHScrollPosition()}function d$(e,t,n="auto"){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureColumnVisible(t,n),"ensureVisible")}function h$(e,t,n){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureIndexVisible(t,n),"ensureVisible")}function kwe(e,t,n=null){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureNodeVisible(t,n),"ensureVisible")}function Awe(e){var t;(t=e.undoRedo)==null||t.undo("api")}function Owe(e){var t;(t=e.undoRedo)==null||t.redo("api")}function Mwe(e,t){var n;return(n=e.editModelSvc)==null?void 0:n.getEditRowDataValue(t,{checkSiblings:!0})}function Nwe(e){var o;const t=(o=e.editModelSvc)==null?void 0:o.getEditMap(),n=[];return t==null||t.forEach((s,r)=>{const{rowIndex:i,rowPinned:a}=r;s.forEach((l,c)=>{const{editorValue:u,pendingValue:d,sourceValue:h,state:f}=l,p=ba(l);let g=u??d;g===pr&&(g=void 0);const v={newValue:g,oldValue:h,state:f,column:c,colId:c.getColId(),colKey:c.getColId(),rowIndex:i,rowPinned:a};(f==="editing"||f==="changed"&&p)&&n.push(v)})}),n}function Lwe(e,t=!1){var o;const{editSvc:n}=e;if(n!=null&&n.isBatchEditing()){if(t)for(const s of((o=e.editModelSvc)==null?void 0:o.getEditPositions())??[])s.state==="editing"&&n.revertSingleCellEdit(s);else Lc(e,{persist:!0});Vd(e,void 0,{cancel:t})}else n==null||n.stopEditing(void 0,{cancel:t,source:"edit",forceStop:!t,forceCancel:t})}function Vwe(e,t){var o;const n=zn(e,t);return((o=e.editSvc)==null?void 0:o.isEditing(n))??!1}function Bwe(e,t){const{key:n,colKey:o,rowIndex:s,rowPinned:r}=t,{editSvc:i,colModel:a}=e,l=a.getCol(o);if(!l){Je(12,{colKey:o});return}const u=Ca(e,{rowIndex:s,rowPinned:r||null});if(!u){Je(290,{rowIndex:s,rowPinned:r});return}if(!l.isCellEditable(u))return;r==null&&h$(e,s),d$(e,o),i==null||i.startEditing({rowNode:u,column:l},{event:n?new KeyboardEvent("keydown",{key:n}):void 0,source:"api"})}function $we(e){var t;return((t=e.editSvc)==null?void 0:t.validateEdit())||null}function Hwe(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentUndoStackSize())??0}function Gwe(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentRedoStackSize())??0}var Uwe={tag:"div",cls:"ag-popup-editor",attrs:{tabindex:"-1"}},Wwe=class extends b0{constructor(e){super(Uwe),this.params=e}postConstruct(){Dc(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params,n=o=>{n_(this.gos,o,t.node,t.column,!0)||t.onKeyDown(o)};this.addManagedElementListeners(e,{keydown:n})}};function zwe(e,{column:t},n,o,s="ui"){var c;if(n instanceof KeyboardEvent&&(n.key===Oe.TAB||n.key===Oe.ENTER||n.key===Oe.F2||n.key===Oe.BACKSPACE&&o))return!0;if((n==null?void 0:n.shiftKey)&&((c=e.rangeSvc)==null?void 0:c.getCellRanges().length)!=0)return!1;const i=t==null?void 0:t.getColDef(),a=jwe(e.gos,i),l=n==null?void 0:n.type;return l==="click"&&(n==null?void 0:n.detail)===1&&a===1||l==="dblclick"&&(n==null?void 0:n.detail)===2&&a===2?!0:s==="api"?o??!1:!1}function jwe(e,t){return e.get("suppressClickEdit")===!0?0:e.get("singleClickEdit")===!0||t!=null&&t.singleClickEdit?1:2}function Q_(e,{rowNode:t,column:n},o="ui"){const s=n.getColDef().editable,r=e.editModelSvc;return n.isColumnFunc(t,s)||!!r&&r.hasEdits({rowNode:t,column:n},{withOpenEditor:!0})}function Kwe(e,t,n="ui"){const o=Q_(e,t,n);return o===!0||n==="ui"?o:e.colModel.getCols().some(r=>Q_(e,{rowNode:t.rowNode,column:r},n))}var Ky=(e,t=!1)=>{if(e!==void 0)return ba(e)||t&&e.state==="editing"};function f$(e,t,n=!1){var o;return Ky((o=e.editModelSvc)==null?void 0:o.getEdit(t),n)}var p$=(e,t,n)=>{if(e)for(let o=0,s=e.length;o<s;++o){const r=e[o];if(r.data&&(Ky(t==null?void 0:t.getEdit({rowNode:r,column:n}))||Ky(t==null?void 0:t.getEdit({rowNode:r.pinnedSibling,column:n})))||p$(r.childrenAfterGroup,t,n))return!0}};function g$(e,t){const{column:n,rowNode:o}=t;return e.gos.get("groupTotalRow")&&!(o!=null&&o.footer)?!1:p$(o==null?void 0:o.childrenAfterGroup,e.editModelSvc,n)}function m$(e,{rowNode:t,column:n}){var o;if(t=t.pinnedSibling,!!t)return Ky((o=e.editModelSvc)==null?void 0:o.getEdit({rowNode:t,column:n}))}var qwe=class extends We{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}setComp(e){this.cellComp=e,this.applyCellStyles()}applyCellStyles(){var s;const{cellCtrl:e,editSvc:t,beans:n}=this;if(t!=null&&t.isBatchEditing()&&t.isEditing()){const r=f$(n,e)||g$(n,e)||m$(n,e);this.applyBatchingStyle(r)}else this.applyBatchingStyle(!1);const o=!!((s=this.editModelSvc)!=null&&s.getCellValidationModel().hasCellValidation(this.cellCtrl));this.cellComp.toggleCss("ag-cell-editing-error",o)}applyBatchingStyle(e){var t;this.cellComp.toggleCss("ag-cell-editing",e??!1),this.cellComp.toggleCss("ag-cell-batch-edit",(e&&((t=this.editSvc)==null?void 0:t.isBatchEditing()))??!1)}},Ywe=class extends We{constructor(e,t){super(),this.rowCtrl=e,this.beans=t,this.gos=t.gos,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}applyRowStyles(){var i;const{rowCtrl:e,editModelSvc:t,beans:n}=this;let o=e.rowNode,s=t==null?void 0:t.getEditRow(o);const r=(i=this.editModelSvc)==null?void 0:i.getRowValidationModel().hasRowValidation({rowNode:o});if(!s&&o.pinnedSibling&&(o=o.pinnedSibling,s=t==null?void 0:t.getEditRow(o)),s){const a=Array.from(s.keys()).some(l=>{const c={rowNode:o,column:l};return f$(n,c,!0)||g$(n,c)||m$(n,c)});this.applyStyle(r,a);return}this.applyStyle(r)}applyStyle(e=!1,t=!1){var s,r;const n=((s=this.editSvc)==null?void 0:s.isBatchEditing())??!1,o=this.gos.get("editType")==="fullRow";(r=this.rowCtrl)==null||r.forEachGui(void 0,({rowComp:i})=>{i.toggleCss("ag-row-editing",o&&t),i.toggleCss("ag-row-batch-edit",o&&t&&n),i.toggleCss("ag-row-inline-editing",t),i.toggleCss("ag-row-not-inline-editing",!t),i.toggleCss("ag-row-editing-invalid",o&&t&&e)})}},Zwe=({rowModel:e,pinnedRowModel:t,editModelSvc:n},o)=>{const s=new Set;e.forEachNode(r=>o.has(r)&&s.add(r)),t==null||t.forEachPinnedRow("top",r=>o.has(r)&&s.add(r)),t==null||t.forEachPinnedRow("bottom",r=>o.has(r)&&s.add(r));for(const r of o)s.has(r)||n.removeEdits({rowNode:r});return s},Xwe=({editModelSvc:e},t,n)=>{var o;for(const s of t)(o=e==null?void 0:e.getEditRow(s))==null||o.forEach((r,i)=>!n.has(i)&&e.removeEdits({rowNode:s,column:i}))},Jwe=e=>()=>{const t=new Set(e.colModel.getCols()),n=e.editModelSvc.getEditMap(!0),o=new Set(n.keys());Xwe(e,Zwe(e,o),t)},Qwe=new Set(["undo","redo","paste","bulk","rangeSvc"]),eCe=new Set(["ui","api"]),v$={paste:"api",rangeSvc:"api",fillHandle:"api",cellClear:"api",bulk:"api"},tCe=new Set(Object.keys(v$)),nCe=new Set(["paste","rangeSvc","renderer","cellClear","redo","undo"]),qy={cancel:!0,source:"api"},oCe={cancel:!1,source:"api"},Gd={checkSiblings:!0},Fp={force:!0,suppressFlash:!0},sCe=class extends We{constructor(){super(...arguments),this.beanName="editSvc",this.batch=!1,this.stopping=!1,this.committing=!1}postConstruct(){const{beans:e}=this;this.model=e.editModelSvc,this.valueSvc=e.valueSvc,this.rangeSvc=e.rangeSvc,this.addManagedPropertyListener("editType",({currentValue:o})=>{this.stopEditing(void 0,qy),this.createStrategy(o)});const t=Jwe(e),n=()=>{const o=this.model.getCellValidationModel().getCellValidationMap().size>0,s=this.model.getRowValidationModel().getRowValidationMap().size>0;return o||s?this.stopEditing(void 0,qy):this.isEditing()&&(this.isBatchEditing()?Vd(e,this.model.getEditPositions()):this.stopEditing(void 0,oCe)),!1};this.addManagedEventListeners({columnPinned:t,columnVisible:t,columnRowGroupChanged:t,rowExpansionStateChanged:t,pinnedRowsChanged:t,displayedRowsChanged:t,sortChanged:n,filterChanged:n,cellFocused:this.onCellFocused.bind(this)})}isBatchEditing(){return this.batch}setBatchEditing(e){e?(this.batch=!0,this.stopEditing(void 0,qy)):(this.stopEditing(void 0,qy),this.batch=!1)}createStrategy(e){const{beans:t,gos:n,strategy:o}=this,s=y$(n,e);if(o){if(o.beanName===s)return o;this.destroyStrategy()}return this.strategy=this.createOptionalManagedBean(t.registry.createDynamicBean(s,!0))}destroyStrategy(){this.strategy&&(this.strategy.destroy(),this.strategy=this.destroyBean(this.strategy))}shouldStartEditing(e,t,n,o="ui"){const s=zwe(this.beans,e,t,n,o);return s&&(this.strategy??(this.strategy=this.createStrategy())),s}shouldStopEditing(e,t,n="ui"){var o;return((o=this.strategy)==null?void 0:o.shouldStop(e,t,n))??null}shouldCancelEditing(e,t,n="ui"){var o;return((o=this.strategy)==null?void 0:o.shouldCancel(e,t,n))??null}validateEdit(){return wme(this.beans)}isEditing(e,t){return this.model.hasEdits(e,t??Gd)}isRowEditing(e,t){return(e&&this.model.hasRowEdits(e,t))??!1}startEditing(e,t){const{startedEdit:n=!0,event:o=null,source:s="ui",ignoreEventKey:r=!1,silent:i}=t;if(this.strategy??(this.strategy=this.createStrategy()),!this.isCellEditable(e,"api"))return;const a=zn(this.beans,e);if(a&&!a.comp){a.onCompAttachedFuncs.push(()=>this.startEditing(e,t));return}const l=this.shouldStartEditing(e,o,n,s);if(l===!1&&s!=="api"){this.isEditing(e)&&this.stopEditing();return}!this.batch&&this.shouldStopEditing(e,void 0,s)&&!t.continueEditing&&this.stopEditing(void 0,{source:s}),l&&this.isBatchEditing()&&this.dispatchBatchEvent("batchEditingStarted",new Map),this.strategy.start({position:e,event:o,source:s,ignoreEventKey:r,startedEdit:n,silent:i})}stopEditing(e,t){var v,w,S;const{event:n,cancel:o,source:s="ui",forceCancel:r,forceStop:i}=t||{},{beans:a,model:l}=this;if(tCe.has(s)&&this.isBatchEditing())return this.bulkRefresh(e),!1;const c=this.committing?v$[s]:s;if(!(this.committing||this.isEditing(e)||this.isBatchEditing()&&l.hasEdits(e,Gd))||!this.strategy||this.stopping)return!1;this.stopping=!0;const d=zn(a,e);d&&(d.onEditorAttachedFuncs=[]);let h=l.getEditMap(!0),f=!1;const p=!o&&(!!this.shouldStopEditing(e,n,c)||this.committing&&!this.batch)||(i??!1),g=o&&!!this.shouldCancelEditing(e,n,c)||(r??!1);if(p||g){Lc(a,{persist:!0,isCancelling:g||o,isStopping:p});const b=l.getEditMap(),C=this.processEdits(b,o,s);(v=this.strategy)==null||v.stop(o,n);for(const _ of C)l.clearEditValue(_);this.bulkRefresh(void 0,h);for(const _ of l.getEditPositions(b)){const E=zn(a,_),x=ba(_);E==null||E.refreshCell({force:!0,suppressFlash:!x})}h=b,f||(f=p)}else if(n instanceof KeyboardEvent&&this.batch&&((w=this.strategy)!=null&&w.midBatchInputsAllowed(e))&&this.isEditing(e,{withOpenEditor:!0})){const{key:b}=n,C=b===Oe.ENTER,_=b===Oe.ESCAPE,E=b===Oe.TAB;(C||E||_)&&(C||E?Lc(a,{persist:!0}):_&&this.revertSingleCellEdit(d),this.isBatchEditing()?(S=this.strategy)==null||S.cleanupEditors():Vd(a,l.getEditPositions(),{event:n,cancel:_}),n.preventDefault(),this.bulkRefresh(e,h,{suppressFlash:!0}),h=l.getEditMap())}else Lc(a,{persist:!0}),h=l.getEditMap();return f&&e&&this.model.removeEdits(e),this.navigateAfterEdit(t,d==null?void 0:d.cellPosition),k_(a),this.model.hasEdits()||(this.model.getCellValidationModel().clearCellValidationMap(),this.model.getRowValidationModel().clearRowValidationMap()),this.bulkRefresh(),g&&this.beans.rowRenderer.refreshRows({rowNodes:Array.from(h.keys())}),this.isBatchEditing()&&(this.beans.rowRenderer.refreshRows({suppressFlash:!0,force:!0}),f&&p&&this.dispatchBatchEvent("batchEditingStopped",h)),this.stopping=!1,f}navigateAfterEdit(e,t){var c;if(!e||!t)return;const{event:n,suppressNavigateAfterEdit:o}=e;if(!(n instanceof KeyboardEvent)||o)return;const{key:r,shiftKey:i}=n,a=this.gos.get("enterNavigatesVerticallyAfterEdit");if(r!==Oe.ENTER||!a)return;const l=i?Oe.UP:Oe.DOWN;(c=this.beans.navigation)==null||c.navigateToNextCell(null,l,t,!1)}processEdits(e,t=!1,n){const o=Array.from(e.keys()),s=this.model.getCellValidationModel().getCellValidationMap().size>0||this.model.getRowValidationModel().getRowValidationMap().size>0,r=[];for(const i of o){const a=e.get(i);for(const l of a.keys()){const c=a.get(l),u={rowNode:i,column:l},d=ba(c);!t&&d&&!s&&(this.setNodeDataValue(i,l,c.pendingValue,void 0,n)||r.push(u))}}return r}setNodeDataValue(e,t,n,o,s="edit"){const{beans:r}=this,i=zn(r,{rowNode:e,column:t}),a=eCe.has(s)?"edit":s;i&&(i.suppressRefreshCell=!0),this.commitNextEdit();const l=e.setDataValue(t,n,a);return i&&(i.suppressRefreshCell=!1),o&&(i==null||i.refreshCell(Fp)),l}setEditMap(e,t){var o;this.strategy??(this.strategy=this.createStrategy()),(o=this.strategy)==null||o.setEditMap(e,t),this.bulkRefresh();let n=Fp;t!=null&&t.forceRefreshOfEditCellsOnly&&(n={...rCe(e),...Fp}),this.beans.rowRenderer.refreshCells(n)}dispatchEditValuesChanged({rowNode:e,column:t},n={}){if(!e||!t||!n)return;const{pendingValue:o,sourceValue:s}=n,{rowIndex:r,rowPinned:i,data:a}=e;this.beans.eventSvc.dispatchEvent({type:"cellEditValuesChanged",node:e,rowIndex:r,rowPinned:i,column:t,source:"api",data:a,newValue:o,oldValue:s,value:o,colDef:t.getColDef()})}bulkRefresh(e={},t,n={}){var a;const{beans:o,gos:s}=this,{editModelSvc:r,rowModel:i}=o;ro(s)&&(e.rowNode&&e.column?this.refCell(e,this.model.getEdit(e),n):t&&((a=r==null?void 0:r.getEditMap(!1))==null||a.forEach((l,c)=>{for(const u of l.keys())this.refCell({rowNode:c,column:u},l.get(u),n)})))}refCell({rowNode:e,column:t},n,o={}){var d,h,f;const{beans:s,gos:r}=this,i=new Set([e]),a=new Set,l=e.pinnedSibling;l&&i.add(l);const c=e.sibling;c&&a.add(c);let u=e.parent;for(;u;)(d=u.sibling)!=null&&d.footer&&r.get("groupTotalRow")||!u.parent&&u.sibling&&r.get("grandTotalRow")?a.add(u.sibling):a.add(u),u=u.parent;for(const p of i)this.dispatchEditValuesChanged({rowNode:p,column:t},n);for(const p of i)(h=zn(s,{rowNode:p,column:t}))==null||h.refreshCell(o);for(const p of a)(f=zn(s,{rowNode:p,column:t}))==null||f.refreshCell(o)}stopAllEditing(e=!1,t="ui"){this.isEditing()&&this.stopEditing(void 0,{cancel:e,source:t})}isCellEditable(e,t="ui"){const{rowNode:n}=e,{gos:o,beans:s}=this;if(n.group){if(o.get("treeData")){if(!n.data&&!o.get("enableGroupEdit"))return!1}else if(!o.get("enableGroupEdit"))return!1}const r=y$(o)==="fullRow"?Kwe(s,e,t):Q_(s,e,t);return r&&(this.strategy??(this.strategy=this.createStrategy())),r}cellEditingInvalidCommitBlocks(){return this.gos.get("invalidEditValueMode")==="block"}checkNavWithValidation(e,t,n=!0){var o,s,r,i;if(this.hasValidationErrors(e)){const a=zn(this.beans,e);return this.cellEditingInvalidCommitBlocks()?((o=t==null?void 0:t.preventDefault)==null||o.call(t),n&&(!(a!=null&&a.hasBrowserFocus())&&(a==null||a.focusCell()),(i=(r=(s=a==null?void 0:a.comp)==null?void 0:s.getCellEditor())==null?void 0:r.focusIn)==null||i.call(r)),"block-stop"):(a&&this.revertSingleCellEdit(a),"revert-continue")}return"continue"}revertSingleCellEdit(e,t=!1){var o,s,r,i;const n=zn(this.beans,e);(o=n==null?void 0:n.comp)!=null&&o.getCellEditor()&&(Vd(this.beans,[e],{silent:!0}),this.model.clearEditValue(e),Ld(this.beans,e,{silent:!0}),Vc(this.beans),n==null||n.refreshCell(Fp),t&&(n==null||n.focusCell(),(i=(r=(s=n==null?void 0:n.comp)==null?void 0:s.getCellEditor())==null?void 0:r.focusIn)==null||i.call(r)))}hasValidationErrors(e){var o;Vc(this.beans);const t=zn(this.beans,e);t&&(t.refreshCell(Fp),(o=t.rowCtrl.rowEditStyleFeature)==null||o.applyRowStyles());let n=!1;return e!=null&&e.rowNode?(n||(n=this.model.getRowValidationModel().hasRowValidation({rowNode:e.rowNode})),e.column&&(n||(n=this.model.getCellValidationModel().hasCellValidation({rowNode:e.rowNode,column:e.column})))):(n||(n=this.model.getCellValidationModel().getCellValidationMap().size>0),n||(n=this.model.getRowValidationModel().getRowValidationMap().size>0)),n}moveToNextCell(e,t,n,o="ui"){var a;let s;const r=this.isEditing(),i=r&&this.checkNavWithValidation(void 0,n)==="block-stop";return e instanceof Bd&&r&&(s=(a=this.strategy)==null?void 0:a.moveToNextEditingCell(e,t,n,o,i)),s===null||(s=s||!!this.beans.focusSvc.focusedHeader,s===!1&&!i&&this.stopEditing()),s}getCellDataValue({rowNode:e,column:t},n=!0){if(!e||!t)return;let o=this.model.getEdit({rowNode:e,column:t});const s=e.pinnedSibling;if(s){const i=this.model.getEdit({rowNode:s,column:t});i&&(o=i)}const r=n?(o==null?void 0:o.editorValue)??(o==null?void 0:o.pendingValue):o==null?void 0:o.pendingValue;return r===pr||!o?(o==null?void 0:o.sourceValue)??this.valueSvc.getValue(t,e,!1,"api"):r}addStopEditingWhenGridLosesFocus(e){fme(this,this.beans,e)}createPopupEditorWrapper(e){return new Wwe(e)}commitNextEdit(){this.committing=!0}setDataValue(e,t,n){var o;try{if((!this.isEditing()||this.committing)&&!nCe.has(n))return;const{beans:s}=this;this.strategy??(this.strategy=this.createStrategy());const r=this.isBatchEditing()?"ui":this.committing?n??"api":"api";if(!n||Qwe.has(n))return By(s,e,t,n,void 0,{persist:!0}),this.setNodeDataValue(e.rowNode,e.column,t,!0,n);const i=this.model.getEdit(e);if(i){if(i.pendingValue===t)return!1;if(i.sourceValue!==t)return By(s,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:r,suppressNavigateAfterEdit:!0}),!0;if(i.sourceValue===t)return(o=s.editModelSvc)==null||o.removeEdits(e),this.dispatchEditValuesChanged(e,{...i,pendingValue:t}),!0}return By(s,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:r,suppressNavigateAfterEdit:!0}),!0}finally{this.committing=!1}}handleColDefChanged(e){mme(this.beans,e)}destroy(){this.model.clear(),this.destroyStrategy(),super.destroy()}prepDetailsDuringBatch(e,t){if(!this.batch||!this.model.hasRowEdits(e.rowNode,Gd))return;const{rowNode:o,column:s}=e,{compDetails:r,valueToDisplay:i}=t;if(r){const{params:l}=r;return l.data=this.model.getEditRowDataValue(o,Gd),{compDetails:r}}const a=this.model.getEditRow(e.rowNode,Gd);if(i!==void 0&&(a!=null&&a.has(s)))return{valueToDisplay:this.valueSvc.getValue(s,o)}}cleanupEditors(){var e;(e=this.strategy)==null||e.cleanupEditors()}dispatchCellEvent(e,t,n,o){var s;(s=this.strategy)==null||s.dispatchCellEvent(e,t,n,o)}dispatchBatchEvent(e,t){this.eventSvc.dispatchEvent(this.createBatchEditEvent(e,t))}createBatchEditEvent(e,t){return Pt(this.gos,{type:e,...e==="batchEditingStopped"?{changes:this.toEventChangeList(t)}:{}})}toEventChangeList(e){return this.model.getEditPositions(e).map(t=>({rowIndex:t.rowNode.rowIndex,rowPinned:t.rowNode.rowPinned,columnId:t.column.getColId(),newValue:t.pendingValue,oldValue:t.sourceValue}))}applyBulkEdit({rowNode:e,column:t},n){var c,u;if(!n||n.length===0)return;const{beans:o,rangeSvc:s,valueSvc:r}=this;Lc(o,{persist:!0});const i=this.model.getEditMap(!0),a=(u=(c=i.get(e))==null?void 0:c.get(t))==null?void 0:u.pendingValue;this.batch||this.eventSvc.dispatchEvent({type:"bulkEditingStarted"}),n.forEach(d=>{if(s==null||s.forEachRowInRange(d,h=>{const f=Ca(o,h);if(f===void 0)return;const p=i.get(f)??new Map;for(const g of d.columns)if(g&&this.isCellEditable({rowNode:f,column:g},"api")){const v=r.getValue(g,f,!0,"api");let w=r.parseValue(g,f??null,a,v);Number.isNaN(w)&&(w=null),p.set(g,{editorValue:void 0,pendingValue:w,sourceValue:v,state:"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}p.size>0&&i.set(f,p)}),this.setEditMap(i),this.batch){this.cleanupEditors(),k_(o),this.bulkRefresh();return}this.commitNextEdit(),this.stopEditing(void 0,{source:"bulk"}),this.eventSvc.dispatchEvent({type:"bulkEditingStopped",changes:this.toEventChangeList(i)})}),this.bulkRefresh();const l=zn(o,{rowNode:e,column:t});l&&l.focusCell(!0)}createCellStyleFeature(e,t){return new qwe(e,t)}createRowStyleFeature(e,t){return new Ywe(e,t)}setEditingCells(e,t){const{beans:n}=this,{colModel:o,valueSvc:s}=n,r=new Map;for(let{colId:i,column:a,colKey:l,rowIndex:c,rowPinned:u,newValue:d,state:h}of e){const f=i?o.getCol(i):l?o.getCol(l):a;if(!f)continue;const p=Ca(n,{rowIndex:c,rowPinned:u});if(!p)continue;const g=s.getValue(f,p,!0,"api");if(!(t!=null&&t.forceRefreshOfEditCellsOnly)&&!ba({pendingValue:d,sourceValue:g})&&h!=="editing")continue;let v=r.get(p);v||(v=new Map,r.set(p,v)),d===void 0&&(d=pr),v.set(f,{editorValue:void 0,pendingValue:d,sourceValue:g,state:h??"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}this.setEditMap(r,t)}onCellFocused(e){var r;const t=zn(this.beans,e);if(!t||!this.isEditing(t,Gd))return;const n=this.model.getEdit(t);if(!n||!ba(n))return;const s=this.getLocaleTextFunc()("ariaPendingChange","Pending Change");(r=this.beans.ariaAnnounce)==null||r.announceValue(s,"pendingChange")}allowedFocusTargetOnValidation(e){return zn(this.beans,e)}};function rCe(e){return{rowNodes:e?Array.from(e.keys()):void 0,columns:e?[...new Set(Array.from(e.values()).flatMap(t=>Array.from(t.keys())))]:void 0}}function y$(e,t){return t??e.get("editType")??"singleCell"}var w$=class extends We{postConstruct(){var e,t;this.model=this.beans.editModelSvc,this.editSvc=this.beans.editSvc,this.addManagedEventListeners({cellFocused:(e=this.onCellFocusChanged)==null?void 0:e.bind(this),cellFocusCleared:(t=this.onCellFocusChanged)==null?void 0:t.bind(this)})}clearEdits(e){this.model.clearEditValue(e)}onCellFocusChanged(e){let t;const n=e.previousParams,{editSvc:o,beans:s}=this,r=e.type==="cellFocused"?e.sourceEvent:null;n&&(t=zn(s,n));const{gos:i,editModelSvc:a}=s,l=e.type==="cellFocusCleared";if(o.isEditing(void 0,{withOpenEditor:!0})){const{column:c,rowIndex:u,rowPinned:d}=e,h={column:c,rowNode:Ca(s,{rowIndex:u,rowPinned:d})},f=i.get("invalidEditValueMode")==="block";if(f)return;const p=!f,g=!!(a!=null&&a.getCellValidationModel().hasCellValidation(h)),v=p&&g;(n||l?o.stopEditing(void 0,{cancel:v,source:l&&p?"api":void 0,event:r}):!0)||(o.isBatchEditing()?o.cleanupEditors():o.stopEditing(void 0,{source:"api"}))}t==null||t.refreshCell({suppressFlash:!0,force:!0})}stop(e,t){var s,r;const n=this.model.getEditPositions(),o={all:[],pass:[],fail:[]};for(const i of n){o.all.push(i);const a=this.model.getCellValidationModel().getCellValidation(i);if((((s=a==null?void 0:a.errorMessages)==null?void 0:s.length)??0)>0){o.fail.push(i);continue}o.pass.push(i)}if(e)for(const i of n)$y(this.beans,i,{cancel:e}),this.model.stop(i);else{const i=this.processValidationResults(o);if(i.destroy.length>0)for(const a of i.destroy)$y(this.beans,a,{event:t,cancel:e}),this.model.stop(a);if(i.keep.length>0)for(const a of i.keep){const l=zn(this.beans,a);(r=this.editSvc)!=null&&r.cellEditingInvalidCommitBlocks()||l&&this.editSvc.revertSingleCellEdit(l)}}return!0}cleanupEditors({rowNode:e}={},t){Lc(this.beans,{persist:!1});const n=this.model.getEditPositions(),o=[];if(e)for(const s of n)s.rowNode!==e&&o.push(s);else for(const s of n)o.push(s);Vd(this.beans,o),k_(this.beans,t)}setFocusOutOnEditor(e){var t,n,o;(o=(n=(t=e.comp)==null?void 0:t.getCellEditor())==null?void 0:n.focusOut)==null||o.call(n)}setFocusInOnEditor(e){const t=e.comp,n=t==null?void 0:t.getCellEditor();if(n!=null&&n.focusIn)n.focusIn();else{const o=this.beans.gos.get("editType")==="fullRow";e.focusCell(o),e.onEditorAttachedFuncs.push(()=>{var s,r;return(r=(s=t==null?void 0:t.getCellEditor())==null?void 0:s.focusIn)==null?void 0:r.call(s)})}}setupEditors(e){const{event:t,ignoreEventKey:n=!1,startedEdit:o,position:s,cells:r=this.model.getEditPositions()}=e,i=t instanceof KeyboardEvent&&!n&&t.key||void 0;gme(this.beans,r,s,i,t,o)}dispatchCellEvent(e,t,n,o){const s=zn(this.beans,e);s&&this.eventSvc.dispatchEvent({...s.createEvent(t??null,n),...o})}dispatchRowEvent(e,t,n){if(n)return;const o=F_(this.beans,e);o&&this.eventSvc.dispatchEvent(o.createRowEvent(t))}shouldStop(e,t,n="ui"){const o=this.editSvc.isBatchEditing();return o&&n==="api"?!0:o&&(n==="ui"||n==="edit")?!1:n==="api"?!0:t instanceof KeyboardEvent&&!o?t.key===Oe.ENTER:null}shouldCancel(e,t,n="ui"){const o=this.editSvc.isBatchEditing();return!!(t instanceof KeyboardEvent&&!o&&t.key===Oe.ESCAPE||o&&n==="api"||n==="api")}setEditMap(e,t){var o;t!=null&&t.update||this.editSvc.stopEditing(void 0,{cancel:!0,source:"api"});const n=[];if(e.forEach((s,r)=>{s.forEach((i,a)=>{i.state==="editing"&&n.push({...i,rowNode:r,column:a})})}),t!=null&&t.update&&(e=new Map([...this.model.getEditMap(),...e])),(o=this.model)==null||o.setEditMap(e),n.length>0){const s=n.at(-1),r=s.pendingValue===pr?void 0:s.pendingValue;this.start({position:s,event:new KeyboardEvent("keydown",{key:r}),source:"api"});const i=zn(this.beans,s);i&&this.setFocusInOnEditor(i)}}destroy(){this.cleanupEditors(),super.destroy()}},iCe=class extends w${constructor(){super(...arguments),this.beanName="fullRow",this.startedRows=[]}shouldStop(e,t,n="ui"){const{rowNode:o}=e||{};if(!F_(this.beans,{rowNode:this.rowNode}))return!0;const r=super.shouldStop({rowNode:this.rowNode},t,n);return r!==null?r:this.rowNode?o!==this.rowNode:!1}midBatchInputsAllowed({rowNode:e}){return e?this.model.hasEdits({rowNode:e}):!1}clearEdits(e){this.model.clearEditValue(e)}start(e){const{position:t,silent:n,startedEdit:o,event:s,ignoreEventKey:r}=e,{rowNode:i}=t;this.rowNode!==i&&super.cleanupEditors(t);const a=this.beans.visibleCols.allCols,l=[],c=[];for(const u of a)u.isCellEditable(i)&&c.push(u);if(c.length!=0){this.dispatchRowEvent({rowNode:i},"rowEditingStarted",n),this.startedRows.push(i);for(const u of c){const d={rowNode:i,column:u};l.push(d),this.model.hasEdits(d)||this.model.start(d)}this.rowNode=i,this.setupEditors({cells:l,position:t,startedEdit:o,event:s,ignoreEventKey:r})}}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){var s;const{rowNode:n}=this;if(n&&!this.model.hasRowEdits(n))return!1;const o=[];if(e||this.model.getEditMap().forEach((r,i)=>{if(!(!r||r.size===0)){for(const a of r.values())if(ba(a)){o.push(i);break}}}),Vc(this.beans),!e&&((s=this.editSvc)==null?void 0:s.checkNavWithValidation({rowNode:n}))==="block-stop")return!1;super.stop(e,t);for(const r of o)this.dispatchRowEvent({rowNode:r},"rowValueChanged");return this.cleanupEditors({rowNode:n},!0),this.rowNode=void 0,!0}onCellFocusChanged(e){const{rowIndex:t}=e,n=e.previousParams;if((n==null?void 0:n.rowIndex)===t||e.sourceEvent instanceof KeyboardEvent)return;const o=zn(this.beans,n);this.gos.get("invalidEditValueMode")==="block"&&o&&(this.model.getCellValidationModel().getCellValidation(o)||this.model.getRowValidationModel().getRowValidation(o))||super.onCellFocusChanged(e)}cleanupEditors(e={},t){super.cleanupEditors(e,t);for(const n of this.startedRows)this.dispatchRowEvent({rowNode:n},"rowEditingStopped");this.startedRows.length=0}moveToNextEditingCell(e,t,n,o="ui",s=!1){var h,f,p,g;const r=e.cellPosition;let i;this.model.suspend(!0);try{i=(h=this.beans.navigation)==null?void 0:h.findNextCellToFocusOn(r,{backwards:t,startEditing:!0,skipToNextEditableCell:!1})}finally{this.model.suspend(!1)}if(i===!1)return null;if(i==null)return!1;const a=i.cellPosition,l=e.isCellEditable(),c=i.isCellEditable(),u=a&&r.rowIndex===a.rowIndex&&r.rowPinned===a.rowPinned;l&&this.setFocusOutOnEditor(e),this.restoreEditors();const d=this.gos.get("suppressStartEditOnTab");return c&&!s?d?i.focusCell(!0,n):((f=i.comp)!=null&&f.getCellEditor()||Ld(this.beans,i,{event:n,cellStartedEdit:!0}),this.setFocusInOnEditor(i),i.focusCell(!1,n)):(c&&s&&this.setFocusInOnEditor(i),i.focusCell(!0,n)),!u&&!s&&((p=this.editSvc)==null||p.stopEditing({rowNode:e.rowNode},{event:n}),this.cleanupEditors(i,!0),d?i.focusCell(!0,n):this.editSvc.startEditing(i,{startedEdit:!0,event:n,source:o,ignoreEventKey:!0})),(g=e.rowCtrl)==null||g.refreshRow({suppressFlash:!0,force:!0}),!0}restoreEditors(){this.model.getEditMap().forEach((e,t)=>e.forEach(({state:n},o)=>{var r;if(n!=="editing")return;const s=zn(this.beans,{rowNode:t,column:o});s&&!((r=s.comp)!=null&&r.getCellEditor())&&Ld(this.beans,s,{silent:!0})}))}destroy(){super.destroy(),this.rowNode=void 0,this.startedRows.length=0}},aCe=class extends w${constructor(){super(...arguments),this.beanName="singleCell"}shouldStop(e,t,n="ui"){const o=super.shouldStop(e,t,n);if(o!==null)return o;const{rowNode:s,column:r}=e||{};return(!this.rowNode||!this.column)&&s&&r?null:this.rowNode!==s||this.column!==r}midBatchInputsAllowed(e){return this.model.hasEdits(e)}start(e){const{position:t,startedEdit:n,event:o,ignoreEventKey:s}=e;(this.rowNode!==t.rowNode||this.column!==t.column)&&super.cleanupEditors(),this.rowNode=t.rowNode,this.column=t.column,this.model.start(t),this.setupEditors({cells:[t],position:t,startedEdit:n,event:o,ignoreEventKey:s})}dispatchRowEvent(e,t,n){}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){return super.stop(e,t),this.rowNode=void 0,this.column=void 0,!0}onCellFocusChanged(e){const{colModel:t,editSvc:n}=this.beans,{rowIndex:o,column:s,rowPinned:r}=e,i=Ca(this.beans,{rowIndex:o,rowPinned:r}),a=P_(s),l=t.getCol(a),c=e.previousParams;if(c){const u=P_(c.column);if((c==null?void 0:c.rowIndex)===o&&u===a&&(c==null?void 0:c.rowPinned)===r)return}n!=null&&n.isEditing({rowNode:i,column:l},{withOpenEditor:!0})&&e.type==="cellFocused"||super.onCellFocusChanged(e)}moveToNextEditingCell(e,t,n,o="ui",s=!1){var p,g,v,w,S,b;const r=this.beans.focusSvc.getFocusedCell();r&&(e=Md(this.beans,r)??e);const i=e.cellPosition;let a;const l=this.beans.gos.get("editType")==="fullRow";l&&this.model.suspend(!0),s||(e.eGui.focus(),(g=this.editSvc)==null||g.stopEditing(e,{source:(p=this.editSvc)!=null&&p.isBatchEditing()?"ui":"api",event:n}));try{a=(v=this.beans.navigation)==null?void 0:v.findNextCellToFocusOn(i,{backwards:t,startEditing:!0})}finally{l&&this.model.suspend(!1)}if(a===!1)return null;if(a==null)return!1;const c=a.cellPosition,u=e.isCellEditable(),d=a.isCellEditable(),h=c&&i.rowIndex===c.rowIndex&&i.rowPinned===c.rowPinned;u&&!s&&this.setFocusOutOnEditor(e);const f=this.gos.get("suppressStartEditOnTab");if(!h&&!s&&(super.cleanupEditors(a,!0),f?a.focusCell(!0,n):this.editSvc.startEditing(a,{startedEdit:!0,event:n,source:o,ignoreEventKey:!0})),d&&!s){if(a.focusCell(!1,n),f)a.focusCell(!0,n);else if(!((w=a.comp)!=null&&w.getCellEditor())){const C=(S=this.editSvc)==null?void 0:S.isEditing(a,{withOpenEditor:!0});Ld(this.beans,a,{event:n,cellStartedEdit:!0,silent:C}),this.setFocusInOnEditor(a),this.cleanupEditors(a)}}else d&&s&&this.setFocusInOnEditor(a),a.focusCell(!0,n);return(b=e.rowCtrl)==null||b.refreshRow({suppressFlash:!0,force:!0}),!0}destroy(){super.destroy(),this.rowNode=void 0,this.column=void 0}},Cl={moduleName:"EditCore",version:dt,beans:[hme,sCe],apiFunctions:{getEditingCells:Nwe,getEditRowValues:Mwe,getCellEditorInstances:pme,startEditingCell:Bwe,stopEditing:Lwe,isEditing:Vwe,validateEdit:$we},dynamicBeans:{singleCell:aCe,fullRow:iCe},dependsOn:[Uy,l$],css:[hwe]},lCe={moduleName:"UndoRedoEdit",version:dt,beans:[dwe],apiFunctions:{undoCellEditing:Awe,redoCellEditing:Owe,getCurrentUndoSize:Hwe,getCurrentRedoSize:Gwe},dependsOn:[Cl]},cCe={moduleName:"TextEditor",version:dt,userComponents:{agCellEditor:u$,agTextCellEditor:u$},dependsOn:[Cl]},uCe={moduleName:"NumberEditor",version:dt,userComponents:{agNumberCellEditor:{classImp:Rwe}},dependsOn:[Cl]},dCe={moduleName:"DateEditor",version:dt,userComponents:{agDateCellEditor:vwe,agDateStringCellEditor:Cwe},dependsOn:[Cl]},hCe={moduleName:"CheckboxEditor",version:dt,userComponents:{agCheckboxCellEditor:pwe},dependsOn:[Cl]},fCe={moduleName:"SelectEditor",version:dt,userComponents:{agSelectCellEditor:Twe},dependsOn:[Cl]},pCe={moduleName:"LargeTextEditor",version:dt,userComponents:{agLargeTextCellEditor:Swe},dependsOn:[Cl]},gCe={moduleName:"CustomEditor",version:dt,dependsOn:[Cl]},mCe=class extends We{constructor(){super(...arguments),this.beanName="selectionColSvc"}postConstruct(){this.addManagedPropertyListener("rowSelection",e=>{this.onSelectionOptionsChanged(e.currentValue,e.previousValue,Dd(e.source))}),this.addManagedPropertyListener("selectionColumnDef",this.updateColumns.bind(this))}addColumns(e){const t=this.columns;t!=null&&(e.list=t.list.concat(e.list),e.tree=t.tree.concat(e.tree),Tae(e))}createColumns(e,t){var h,f;const n=()=>{var p;cy(this.beans,(p=this.columns)==null?void 0:p.tree),this.columns=null},o=e.treeDepth,r=(((h=this.columns)==null?void 0:h.treeDepth)??-1)==o,i=this.generateSelectionCols();if(Dae(i,((f=this.columns)==null?void 0:f.list)??[])&&r)return;n();const{colGroupSvc:l}=this.beans,c=(l==null?void 0:l.findDepth(e.tree))??0,u=(l==null?void 0:l.balanceTreeForAutoCols(i,c))??[];this.columns={list:i,tree:u,treeDepth:c,map:{}},t(p=>{if(!p)return null;const g=p.filter(v=>!pa(v));return[...i,...g]})}updateColumns(e){var n;const t=Dd(e.source);for(const o of((n=this.columns)==null?void 0:n.list)??[]){const s=this.createSelectionColDef(e.currentValue);o.setColDef(s,null,t),Ur(this.beans,{state:[{...s,colId:o.getColId()}]},t)}}getColumn(e){var t;return((t=this.columns)==null?void 0:t.list.find(n=>hp(n,e)))??null}getColumns(){var e;return((e=this.columns)==null?void 0:e.list)??null}isSelectionColumnEnabled(){var i,a;const{gos:e,beans:t}=this,n=e.get("rowSelection");if(typeof n!="object"||!_c(e))return!1;const o=(((a=(i=t.autoColSvc)==null?void 0:i.getColumns())==null?void 0:a.length)??0)>0;if(n.checkboxLocation==="autoGroupColumn"&&o)return!1;const s=!!Rd(n),r=oy(n);return s||r}createSelectionColDef(e){const{gos:t}=this,n=e??t.get("selectionColumnDef"),o=t.get("enableRtl"),{rowSpan:s,spanRows:r,...i}=n??{};return{width:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:o?"right":"left",comparator(a,l,c,u){const d=c.isSelected(),h=u.isSelected();return d===h?0:d?1:-1},editable:!1,suppressFillHandle:!0,pinned:null,...i,colId:a2,chartDataType:"excluded"}}generateSelectionCols(){if(!this.isSelectionColumnEnabled())return[];const e=this.createSelectionColDef(),t=e.colId;this.gos.validateColDef(e,t,!0);const n=new Tc(e,null,t,!1);return this.createBean(n),[n]}onSelectionOptionsChanged(e,t,n){const o=t&&typeof t!="string"?Rd(t):void 0,s=e&&typeof e!="string"?Rd(e):void 0,r=o!==s,i=t&&typeof t!="string"?oy(t):void 0,a=e&&typeof e!="string"?oy(e):void 0,l=i!==a,c=sy(e),u=sy(t);(r||l||c!==u)&&this.beans.colModel.refreshAll(n)}destroy(){var e;cy(this.beans,(e=this.columns)==null?void 0:e.tree),super.destroy()}refreshVisibility(e,t,n){var l,c;if(!((l=this.columns)!=null&&l.list.length))return;const o=e.length+t.length+n.length;if(o===0)return;const s=this.columns.list[0];if(!s.isVisible())return;const r=()=>{let u;switch(s.pinned){case"left":case!0:u=e;break;case"right":u=n;break;default:u=t}u&&Gr(u,s)};(((c=this.beans.rowNumbersSvc)==null?void 0:c.getColumn(l2))?2:1)===o&&r()}};function vCe(e,t){var i;if(!t.nodes.every(a=>a.rowPinned&&!bp(a)?(Je(59),!1):a.id===void 0?(Je(60),!1):!0))return;const{nodes:o,source:s,newValue:r}=t;(i=e.selectionSvc)==null||i.setNodesSelected({nodes:o,source:s??"api",newValue:r})}function yCe(e,t,n="apiSelectAll"){var o;(o=e.selectionSvc)==null||o.selectAllRowNodes({source:n,selectAll:t})}function wCe(e,t,n="apiSelectAll"){var o;(o=e.selectionSvc)==null||o.deselectAllRowNodes({source:n,selectAll:t})}function CCe(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"filtered"})}function bCe(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"filtered"})}function SCe(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"currentPage"})}function ECe(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"currentPage"})}function _Ce(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedNodes())??[]}function RCe(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedRows())??[]}var DCe=class extends Bde{constructor(){super(...arguments),this.beanName="selectionSvc",this.selectedNodes=new Map,this.detailSelection=new Map,this.masterSelectsDetail=!1}postConstruct(){super.postConstruct();const{gos:e}=this;this.mode=ry(e),this.groupSelectsDescendants=up(e),this.groupSelectsFiltered=iy(e)==="filteredDescendants",this.masterSelectsDetail=n2(e)==="detail",this.addManagedPropertyListeners(["groupSelectsChildren","groupSelectsFiltered","rowSelection"],()=>{const t=up(e),n=ry(e),o=iy(e)==="filteredDescendants";this.masterSelectsDetail=n2(e)==="detail",(t!==this.groupSelectsDescendants||o!==this.groupSelectsFiltered||n!==this.mode)&&(this.deselectAllRowNodes({source:"api"}),this.groupSelectsDescendants=t,this.groupSelectsFiltered=o,this.mode=n)}),this.addManagedEventListeners({rowSelected:this.onRowSelected.bind(this)})}destroy(){super.destroy(),this.resetNodes()}handleSelectionEvent(e,t,n){if(this.isRowSelectionBlocked(t))return 0;const o=this.inferNodeSelections(t,e.shiftKey,e.metaKey||e.ctrlKey,n);if(o==null)return 0;if(this.selectionCtx.selectAll=!1,"select"in o)return o.reset?this.resetNodes():this.selectRange(o.deselect,!1,n),this.selectRange(o.select,!0,n);{const s=o.checkFilteredNodes?b$(o.node):o.newValue;return this.setNodesSelected({nodes:[o.node],newValue:s,clearSelection:o.clearSelection,keepDescendants:o.keepDescendants,event:e,source:n})}}setNodesSelected({newValue:e,clearSelection:t,suppressFinishActions:n,nodes:o,event:s,source:r,keepDescendants:i=!1}){var c;if(o.length===0)return 0;const{gos:a}=this;if(!_c(a)&&e)return Je(132),0;if(o.length>1&&!this.isMultiSelect())return Je(130),0;let l=0;for(let u=0;u<o.length;u++){const d=o[u],h=Ud(d);if(h.rowPinned&&!bp(h)){Je(59);continue}if(h.id===void 0){Je(60);continue}this.groupSelectsFiltered&&h.group&&!a.get("treeData")||this.selectRowNode(h,e,s,r)&&(this.detailSelection.delete(h.id),l++),this.groupSelectsDescendants&&((c=h.childrenAfterGroup)!=null&&c.length)&&(l+=this.selectChildren(h,e,r))}return n||(o.length===1&&r==="api"&&this.selectionCtx.setRoot(Ud(o[0])),e&&(t||!this.isMultiSelect())&&(l+=this.clearOtherNodes(Ud(o[0]),i,r)),l>0&&(this.updateGroupsFromChildrenSelections(r),this.dispatchSelectionChanged(r))),l}selectRange(e,t,n){let o=0;return e.forEach(s=>{const r=Ud(s);if(r.group&&this.groupSelectsDescendants)return;this.selectRowNode(r,t,void 0,n)&&o++}),o>0&&(this.updateGroupsFromChildrenSelections(n),this.dispatchSelectionChanged(n)),o}selectChildren(e,t,n){const o=this.groupSelectsFiltered?e.childrenAfterAggFilter:e.childrenAfterGroup;return o?this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,source:n,nodes:o}):0}getSelectedNodes(){return Array.from(this.selectedNodes.values())}getSelectedRows(){const e=[];return this.selectedNodes.forEach(t=>t.data&&e.push(t.data)),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach((n,o)=>{e(n)&&t.set(o,n)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsDescendants)return!1;const{gos:n,rowModel:o}=this.beans;if(!ro(n))return!1;const s=o.rootNode;if(!s)return!1;t||(t=new Ep(!0,s),t.active=!1);let r=!1;return t.forEachChangedNodeDepthFirst(i=>{if(i!==s){const a=this.calculateSelectedFromChildren(i);r=this.selectRowNode(i,a===null?!1:a,void 0,e)||r}}),r}clearOtherNodes(e,t,n){const o=new Map;let s=0;return this.selectedNodes.forEach(r=>{const i=r.id==e.id;if((t?!ICe(e,r):!0)&&!i){const l=this.selectedNodes.get(r.id);s+=this.setNodesSelected({nodes:[l],newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:n}),this.groupSelectsDescendants&&r.parent&&o.set(r.parent.id,r.parent)}}),o.forEach(r=>{const i=this.calculateSelectedFromChildren(r);this.selectRowNode(r,i===null?!1:i,void 0,n)}),s}onRowSelected(e){const t=e.node;this.groupSelectsDescendants&&t.group||(t.isSelected()?this.selectedNodes.set(t.id,t):this.selectedNodes.delete(t.id))}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}createDaemonNode(e){if(!e.id)return;const t=new pl(this.beans);return t.id=e.id,t.data=e.data,t.__selected=e.__selected,t.level=e.level,t}syncInOldRowNode(e,t){t&&e.id!==t.id&&this.selectedNodes.get(t.id)==e&&this.selectedNodes.set(t.id,t)}syncInNewRowNode(e){this.selectedNodes.has(e.id)?(e.__selected=!0,this.selectedNodes.set(e.id,e)):e.__selected=!1}reset(e){const t=this.getSelectionCount();this.resetNodes(),t&&this.dispatchSelectionChanged(e)}resetNodes(){this.selectedNodes.forEach(e=>{this.selectRowNode(e,!1)}),this.selectedNodes.clear()}getBestCostNodeSelection(){const{gos:e,rowModel:t}=this.beans;if(!ro(e))return;const n=t.getTopLevelNodes();if(n===null)return;const o=[];function s(r){for(let i=0,a=r.length;i<a;i++){const l=r[i];l.isSelected()?o.push(l):l.group&&l.childrenAfterGroup&&s(l.childrenAfterGroup)}}return s(n),o}isEmpty(){return this.getSelectionCount()===0}deselectAllRowNodes({source:e,selectAll:t}){const n=ro(this.gos);let o=!1;const s=r=>{const i=this.selectRowNode(Ud(r),!1,void 0,e);o||(o=i)};if(t==="currentPage"||t==="filtered"){if(!n){_n(102);return}this.getNodesToSelect(t).forEach(s)}else this.selectedNodes.forEach(s),this.reset(e);if(this.selectionCtx.selectAll=!1,n&&this.groupSelectsDescendants){const r=this.updateGroupsFromChildrenSelections(e);o||(o=r)}o&&this.dispatchSelectionChanged(e)}getSelectedCounts(e){let t=0,n=0;return this.getNodesToSelect(e).forEach(o=>{this.groupSelectsDescendants&&o.group||(o.isSelected()?t++:o.selectable&&n++)}),{selectedCount:t,notSelectedCount:n}}getSelectAllState(e){const{selectedCount:t,notSelectedCount:n}=this.getSelectedCounts(e);return C$(t,n)??null}hasNodesToSelect(e){return this.getNodesToSelect(e).filter(t=>t.selectable).length>0}getNodesToSelect(e){if(!this.canSelectAll())return[];const t=[],n=s=>t.push(s);if(e==="currentPage")return this.forEachNodeOnPage(s=>{if(!s.group){n(s);return}if(!s.expanded&&!s.footer){const r=i=>{var a;n(i),(a=i.childrenAfterFilter)==null||a.forEach(r)};r(s);return}this.groupSelectsDescendants||n(s)}),t;const o=this.beans.rowModel;return e==="filtered"?(o.forEachNodeAfterFilter(n),t):(o.forEachNode(n),t)}forEachNodeOnPage(e){const{pageBounds:t,rowModel:n}=this.beans,o=t.getFirstRow(),s=t.getLastRow();for(let r=o;r<=s;r++){const i=n.getRow(r);i&&e(i)}}selectAllRowNodes(e){const{gos:t,selectionCtx:n}=this;if(!_c(t)){Je(132);return}if(fae(t)&&!cp(t)){Je(130);return}if(!this.canSelectAll())return;const{source:o,selectAll:s}=e;let r=!1;if(this.getNodesToSelect(s).forEach(i=>{const a=this.selectRowNode(Ud(i),!0,void 0,o);r||(r=a)}),n.selectAll=!0,ro(t)&&this.groupSelectsDescendants){const i=this.updateGroupsFromChildrenSelections(o);r||(r=i)}r&&this.dispatchSelectionChanged(o)}getSelectionState(){return this.isEmpty()?null:Array.from(this.selectedNodes.keys())}setSelectionState(e,t,n){if(e||(e=[]),!Array.isArray(e)){_n(103);return}const o=new Set(e),s=[];this.beans.rowModel.forEachNode(r=>{o.has(r.id)&&s.push(r)}),n&&this.resetNodes(),this.setNodesSelected({newValue:!0,nodes:s,source:t})}canSelectAll(){return ro(this.beans.gos)}updateSelectable(e){var l;const{gos:t,rowModel:n}=this.beans;if(!_c(t))return;const o="selectableChanged",s=e!==void 0,r=ro(t)&&this.groupSelectsDescendants,i=[],a=c=>{var d;if(s&&!c.group)return;if(r&&c.group){const h=((d=c.childrenAfterGroup)==null?void 0:d.some(f=>f.selectable))??!1;this.setRowSelectable(c,h,!0);return}!this.updateRowSelectable(c,!0)&&c.isSelected()&&i.push(c)};if(r){if(e===void 0){const c=n.rootNode;e=c?new Ep(!1,c):void 0}e==null||e.forEachChangedNodeDepthFirst(a,!s,!s)}else n.forEachNode(a);i.length&&this.setNodesSelected({nodes:i,newValue:!1,source:o}),!s&&r&&((l=this.updateGroupsFromChildrenSelections)==null||l.call(this,o))}updateSelectableAfterGrouping(e){var t;this.updateSelectable(e),this.groupSelectsDescendants&&((t=this.updateGroupsFromChildrenSelections)!=null&&t.call(this,"rowGroupChanged",e))&&this.dispatchSelectionChanged("rowGroupChanged")}refreshMasterNodeState(e,t){var r,i;if(!this.masterSelectsDetail)return;const n=(i=(r=e.detailNode)==null?void 0:r.detailGridInfo)==null?void 0:i.api;if(!n)return;const o=TCe(n);if(e.isSelected()!==o&&this.selectRowNode(e,o,t,"masterDetail")&&this.dispatchSelectionChanged("masterDetail"),!o){const a=this.detailSelection.get(e.id)??new Set;for(const l of n.getSelectedNodes())a.add(l.id);this.detailSelection.set(e.id,a)}}setDetailSelectionState(e,t,n){if(this.masterSelectsDetail){if(!cp(t)){Je(269);return}switch(e.isSelected()){case!0:{n.selectAll();break}case!1:{n.deselectAll();break}case void 0:{const o=this.detailSelection.get(e.id);if(o){const s=[];for(const r of o){const i=n.getRowNode(r);i&&s.push(i)}n.setNodesSelected({nodes:s,newValue:!0,source:"masterDetail"})}break}}}}dispatchSelectionChanged(e){this.eventSvc.dispatchEvent({type:"selectionChanged",source:e,selectedNodes:this.getSelectedNodes(),serverSideState:null})}};function Ud(e){return bp(e)?e.pinnedSibling:e.footer?e.sibling:e}function TCe(e){let t=0,n=0;return e.forEachNode(o=>{o.isSelected()?t++:o.selectable&&n++}),C$(t,n)}function C$(e,t){if(e===0&&t===0)return!1;if(!(e>0&&t>0))return e>0}function ICe(e,t){let n=t.parent;for(;n;){if(n===e)return!0;n=n.parent}return!1}function b$(e){var o;const t=e.isSelected()===!1,n=((o=e.childrenAfterFilter)==null?void 0:o.some(b$))??!1;return t||n}var xCe={moduleName:"SharedRowSelection",version:dt,beans:[mCe],apiFunctions:{setNodesSelected:vCe,selectAll:yCe,deselectAll:wCe,selectAllFiltered:CCe,deselectAllFiltered:bCe,selectAllOnCurrentPage:SCe,deselectAllOnCurrentPage:ECe,getSelectedNodes:_Ce,getSelectedRows:RCe}},FCe={moduleName:"RowSelection",version:dt,rowModels:["clientSide","infinite","viewport"],beans:[DCe],dependsOn:[xCe]};function PCe(e){var t;(t=e.expansionSvc)==null||t.expandAll(!0)}function kCe(e){var t;(t=e.expansionSvc)==null||t.expandAll(!1)}function S$(e){var t;(t=e.rowModel)==null||t.onRowHeightChanged()}function E$(e){var t,n;if((t=e.rowAutoHeight)!=null&&t.active){Je(3);return}(n=e.rowModel)==null||n.resetRowHeights()}function ACe(e,t,n){var s,r;const o=Ove(e);if(o){if(((s=e.rowGroupColsSvc)==null?void 0:s.columns.length)===0){if(t<0){_n(238);return}o.setRowCount(t,n);return}_n(28);return}(r=Gy(e))==null||r.setRowCount(t,n)}function OCe(e){var t;return Sd(e.gos)?e.rowModel.getBlockStates():((t=e.rowNodeBlockLoader)==null?void 0:t.getBlockState())??{}}function MCe(e){return e.rowModel.isLastRowIndexKnown()}var NCe={moduleName:"CsrmSsrmSharedApi",version:dt,apiFunctions:{expandAll:PCe,collapseAll:kCe}},LCe={moduleName:"RowModelSharedApi",version:dt,apiFunctions:{onRowHeightChanged:S$,resetRowHeights:E$}},VCe={moduleName:"SsrmInfiniteSharedApi",version:dt,apiFunctions:{setRowCount:ACe,getCacheBlockState:OCe,isLastRowIndexKnown:MCe}},BCe=class extends We{constructor(){super(...arguments),this.beanName="alignedGridsSvc",this.consuming=!1}getAlignedGridApis(){let e=this.gos.get("alignedGrids")??[];const t=typeof e=="function";return typeof e=="function"&&(e=e()),e.map(o=>{var r;if(!o){_n(18),t||_n(20);return}if(this.isGridApi(o))return o;const s=o;return"current"in s?(r=s.current)==null?void 0:r.api:(s.api||_n(19),s.api)}).filter(o=>!!o&&!o.isDestroyed())}isGridApi(e){return!!e&&!!e.dispatchEvent}postConstruct(){const e=this.fireColumnEvent.bind(this);this.addManagedEventListeners({columnMoved:e,columnVisible:e,columnPinned:e,columnGroupOpened:e,columnResized:e,bodyScroll:this.fireScrollEvent.bind(this),alignedGridColumn:({event:t})=>this.onColumnEvent(t),alignedGridScroll:({event:t})=>this.onScrollEvent(t)})}fireEvent(e){if(!this.consuming)for(const t of this.getAlignedGridApis())t.isDestroyed()||t.dispatchEvent(e)}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){this.fireEvent({type:"alignedGridColumn",event:e})}fireScrollEvent(e){e.direction==="horizontal"&&this.fireEvent({type:"alignedGridScroll",event:e})}onScrollEvent(e){this.onEvent(()=>{this.beans.ctrlsSvc.getScrollFeature().setHorizontalScrollPosition(e.left,!0)})}extractDataFromEvent(e,t){const n=[];return e.columns?e.columns.forEach(o=>{n.push(t(o))}):e.column&&n.push(t(e.column)),n}getMasterColumns(e){return this.extractDataFromEvent(e,t=>t)}getColumnIds(e){return this.extractDataFromEvent(e,t=>t.getColId())}onColumnEvent(e){this.onEvent(()=>{switch(e.type){case"columnMoved":case"columnVisible":case"columnPinned":case"columnResized":{this.processColumnEvent(e);break}case"columnGroupOpened":{this.processGroupOpenedEvent(e);break}case"columnPivotChanged":Je(21);break}})}processGroupOpenedEvent(e){const{colGroupSvc:t}=this.beans;if(t)for(const n of e.columnGroups){let o=null;n&&(o=t.getProvidedColGroup(n.getGroupId())),!(n&&!o)&&t.setColumnGroupOpened(o,n.isExpanded(),"alignedGridChanged")}}processColumnEvent(e){const t=e.column;let n=null;const o=this.beans,{colResize:s,ctrlsSvc:r,colModel:i}=o;if(t&&(n=i.getColDefCol(t.getColId())),t&&!n)return;const a=this.getMasterColumns(e);switch(e.type){case"columnMoved":{const d=e.api.getColumnState().map(h=>({colId:h.colId}));Ur(o,{state:d,applyOrder:!0},"alignedGridChanged")}break;case"columnVisible":{const d=e.api.getColumnState().map(h=>({colId:h.colId,hide:h.hide}));Ur(o,{state:d},"alignedGridChanged")}break;case"columnPinned":{const d=e.api.getColumnState().map(h=>({colId:h.colId,pinned:h.pinned}));Ur(o,{state:d},"alignedGridChanged")}break;case"columnResized":{const u=e,d={};for(const h of a)d[h.getId()]={key:h.getColId(),newWidth:h.getActualWidth()};for(const h of u.flexColumns??[])d[h.getId()]&&delete d[h.getId()];s==null||s.setColumnWidths(Object.values(d),!1,u.finished,"alignedGridChanged");break}}const c=r.getGridBodyCtrl().isVerticalScrollShowing();for(const u of this.getAlignedGridApis())u.setGridOption("alwaysShowVerticalScroll",c)}},$Ce={moduleName:"AlignedGrids",version:dt,beans:[BCe],dependsOn:[aB]},HCe=class extends We{constructor(e){super(),this.rootNode=e,this.nextId=0,this.allNodesMap={},_$(e)}getRowNode(e){return this.allNodesMap[e]}setNewRowData(e){const{selectionSvc:t,pinnedRowModel:n,groupStage:o}=this.beans;t==null||t.reset("rowDataChanged"),n!=null&&n.isManual()&&n.reset(),this.dispatchRowDataUpdateStarted(e),this.allNodesMap=Object.create(null),this.nextId=0;const s=_$(this.rootNode),r=new Array(e.length);s._leafs=r;let i=0;const a=o==null?void 0:o.getNestedDataGetter(),l=a?new Set:null,c=(u,d)=>{const h=u.level+1;for(let f=0,p=d.length;f<p;++f){const g=d[f];if(!g)continue;const v=this.createRowNode(g,h);if(v.sourceRowIndex=i,r[i++]=v,l&&!l.has(g)){l.add(g),v.treeParent=u;const w=a(g);w&&c(v,w)}}};c(s,e),r.length=i}setImmutableRowData(e,t){var w;const{rootNode:n,gos:o}=this;this.dispatchRowDataUpdateStarted(t);const s=_d(o),r=e.changedRowNodes,{adds:i,updates:a}=r,l=new Set,c=[],u=(w=this.beans.groupStage)==null?void 0:w.getNestedDataGetter();let d=o.get("suppressMaintainUnsortedOrder")?void 0:!1,h=-1,f=!1;const p=(S,b)=>{if(!d&&d!==void 0){const C=S.sourceRowIndex;d=C<=h,h=C}S.data!==b&&(S.updateData(b),i.has(S)||a.add(S),!S.selectable&&S.isSelected()&&c.push(S))},g=(S,b,C)=>{for(let _=0,E=b.length;_<E;++_){const x=b[_];if(!x)continue;let I=this.getRowNode(s({data:x,level:C}));if(I?(p(I,x),f||(f=!!u&&I.treeParent!==S)):(I=this.createRowNode(x,C),i.add(I)),!u||l.has(I)){l.add(I);continue}l.add(I),I.treeParent=S;const F=u(x);F&&g(I,F,C+1)}};g(n,t,0);const v=this.deleteUnusedNodes(l,r,c)||d||i.size>0;if(v){const S=n._leafs??(n._leafs=[]);d===void 0?jCe(S,l,r):zCe(S,l)&&(r.reordered=!0)}(v||f||a.size)&&(e.rowDataUpdated=!0,this.deselect(c))}deleteUnusedNodes(e,{removals:t},n){const o=this.rootNode._leafs;for(let s=0,r=o.length;s<r;s++){const i=o[s];e.has(i)||(t.add(i),i.isSelected()&&n.push(i),this.deleteNode(i))}return t.size>0}updateRowData(e,t){var a;if(this.dispatchRowDataUpdateStarted(e.add),(a=this.beans.groupStage)!=null&&a.getNestedDataGetter())return Je(268),{remove:[],update:[],add:[]};const n=[],o=_d(this.gos),s=this.executeRemove(o,e,t,n),r=this.executeUpdate(o,e,t,n),i=this.executeAdd(e,t);return this.deselect(n),{remove:s,update:r,add:i}}executeRemove(e,{remove:t},{adds:n,updates:o,removals:s},r){const i=this.rootNode._leafs,a=i==null?void 0:i.length,l=t==null?void 0:t.length;if(!l||!a)return[];let c=0,u=a,d=0,h;const f=new Array(l);for(let p=0;p<l;++p){const g=this.lookupNode(e,t[p]);if(!g)continue;const v=g.sourceRowIndex;v<u&&(u=v),v>d&&(d=v),g.isSelected()&&r.push(g),this.deleteNode(g),n.delete(g)?(h??(h=new Set),h.add(g)):(o.delete(g),s.add(g)),f[c++]=g}return f.length=c,c&&WCe(i,u,d,s,h),f}executeUpdate(e,{update:t},{adds:n,updates:o},s){const r=t==null?void 0:t.length;if(!r)return[];const i=new Array(r);let a=0;for(let l=0;l<r;l++){const c=t[l],u=this.lookupNode(e,c);u&&(u.updateData(c),!u.selectable&&u.isSelected()&&s.push(u),i[a++]=u,n.has(u)||o.add(u))}return i.length=a,i}executeAdd(e,t){var n;const o=(n=this.rootNode)._leafs??(n._leafs=[]),s=o.length,r=e.add,i=r==null?void 0:r.length;if(!i)return[];const a=s+i;let l=this.sanitizeAddIndex(o,e.addIndex);if(l<s){for(let d=s-1,h=a-1;d>=l;--d){const f=o[d];f.sourceRowIndex=h,o[h--]=f}t.reordered=!0}o.length=a;const c=new Array(i),u=t.adds;for(let d=0;d<i;d++){const h=this.createRowNode(r[d],0);u.add(h),h.sourceRowIndex=l,o[l]=h,c[d]=h,l++}return c}dispatchRowDataUpdateStarted(e){this.eventSvc.dispatchEvent({type:"rowDataUpdateStarted",firstRowData:e!=null&&e.length?e[0]:null})}deselect(e){var o;const t="rowDataChanged",n=this.beans.selectionSvc;e.length&&(n==null||n.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t})),(o=n==null?void 0:n.updateGroupsFromChildrenSelections)==null||o.call(n,t),e.length&&this.eventSvc.dispatchEvent({type:"selectionChanged",source:t,selectedNodes:(n==null?void 0:n.getSelectedNodes())??null,serverSideState:null})}createRowNode(e,t){const n=new pl(this.beans);n.parent=this.rootNode,n.level=t,n.group=!1,n.expanded=!1,n.setDataAndId(e,String(this.nextId++));const o=n.id,s=this.allNodesMap;return s[o]&&Je(2,{nodeId:o}),s[o]=n,n}deleteNode(e){var s;e.clearRowTopAndRowIndex();const t=e.id,n=this.allNodesMap;n[t]===e&&delete n[t];const o=e.pinnedSibling;o&&((s=this.beans.pinnedRowModel)==null||s.pinRow(o,null))}lookupNode(e,t){if(!e)return UCe(this.rootNode._leafs,t);const n=e({data:t,level:0}),o=this.allNodesMap[n];return o||(_n(4,{id:n}),null)}sanitizeAddIndex(e,t){const n=e.length;if(typeof t!="number"||t<0||t>=n||Number.isNaN(t))return n;t=Math.ceil(t);const o=this.gos;return t>0&&o.get("treeData")&&o.get("getDataPath")&&(t=GCe(e,t)),t}},GCe=(e,t)=>{for(let n=0,o=e.length;n<o;n++){const s=e[n];if((s==null?void 0:s.rowIndex)==t-1)return n+1}return t},_$=e=>{var i;e.group=!0,e.level=-1,e.id="ROOT_NODE_ID",((i=e._leafs)==null?void 0:i.length)!==0&&(e._leafs=[]);const t=[],n=[],o=[],s=[];e.childrenAfterGroup=t,e.childrenAfterSort=n,e.childrenAfterAggFilter=o,e.childrenAfterFilter=s;const r=e.sibling;return r&&(r.childrenAfterGroup=t,r.childrenAfterSort=n,r.childrenAfterAggFilter=o,r.childrenAfterFilter=s,r.childrenMapped=e.childrenMapped),e.updateHasChildren(),e},UCe=(e,t)=>{if(e)for(let n=0,o=e.length;n<o;n++){const s=e[n];if(s.data===t)return s}return _n(5,{data:t}),null},WCe=(e,t,n,o,s)=>{t=Math.max(0,t);for(let r=t,i=e.length;r<i;++r){const a=e[r];r<=n&&(o.has(a)||s!=null&&s.has(a))||(a.sourceRowIndex=t,e[t++]=a)}e.length=t},zCe=(e,t)=>{const n=t.size;e.length=n;let o=0,s=!1,r=!1;for(const i of t){const a=i.sourceRowIndex;a===o?r||(r=s):(a>=0?r=!0:s=!0,i.sourceRowIndex=o,e[o]=i),++o}return r},jCe=(e,t,{removals:n,adds:o})=>{const s=e.length;e.length=t.size;let r=0;for(let i=0;i<s;++i){const a=e[i];n.has(a)||(r!==i&&(a.sourceRowIndex=r,e[r]=a),++r)}for(const i of o)i.sourceRowIndex<0&&(i.sourceRowIndex=r,e[r++]=i);e.length=r},R$=e=>{const t=e.childrenAfterSort,n=e.sibling;if(n&&(n.childrenAfterSort=t),!!t)for(let o=0,s=t.length-1;o<=s;o++){const r=t[o],i=o===0,a=o===s;r.firstChild!==i&&(r.firstChild=i,r.dispatchRowEvent("firstChildChanged")),r.lastChild!==a&&(r.lastChild=a,r.dispatchRowEvent("lastChildChanged")),r.childIndex!==o&&(r.childIndex=o,r.dispatchRowEvent("childIndexChanged"))}},KCe=class extends We{constructor(){super(...arguments),this.beanName="sortStage",this.step="sort",this.refreshProps=["postSortRows","groupDisplayType","accentedSort"]}execute(e){const t=this.beans.sortSvc.getSortOptions(),n=t.length>0&&!!e.changedRowNodes&&this.gos.get("deltaSort");this.sort(t,n,e.changedRowNodes,e.changedPath)}sort(e,t,n,o){const{gos:s,colModel:r,rowGroupColsSvc:i,rowNodeSorter:a,rowRenderer:l,showRowGroupCols:c}=this.beans,u=s.get("groupMaintainOrder"),d=r.getCols().some(S=>S.isRowGroupActive()),h=i==null?void 0:i.columns,f=r.isPivotMode(),p=s.getCallback("postSortRows");let g=!1,v;const w=S=>{var E,x;const b=f&&S.leafGroup;let C=u&&d&&!S.leafGroup;C&&(v??(v=this.shouldSortContainsGroupCols(e)),C&&(C=!v));let _=null;if(C){let I=!1;if(h){const F=S.level+1;F<h.length&&(I=h[F].getSort()===null)}I||(_=ZCe(S))}else!e.length||b||(t&&n?_=qCe(a,S,n,o,e):_=a.doFullSort(S.childrenAfterAggFilter,e));if(_||(_=((E=S.childrenAfterAggFilter)==null?void 0:E.slice(0))??[]),g||(g=((x=S.childrenAfterSort)==null?void 0:x[0])!==_[0]),S.childrenAfterSort=_,R$(S),p){const I={nodes:S.childrenAfterSort};p(I)}};if(o==null||o.forEachChangedNodeDepthFirst(w),g&&s.get("groupHideOpenParents")){const S=c==null?void 0:c.getShowRowGroupCols();S!=null&&S.length&&l.refreshCells({columns:S,force:!0})}}shouldSortContainsGroupCols(e){const t=e.length;if(!t)return!1;if(Si(this.gos)){for(let n=0;n<t;++n){const o=e[n].column;if(o.isPrimary()&&o.isRowGroupActive())return!0}return!1}for(let n=0;n<t;++n)if(e[n].column.getColDef().showRowGroup)return!0;return!1}},qCe=(e,t,n,o,s)=>{const r=t.childrenAfterAggFilter,i=t.childrenAfterSort;if(!i)return e.doFullSort(r,s);const a=new Set,l=[],{updates:c,adds:u}=n;for(let h=0,f=r.length;h<f;++h){const p=r[h];c.has(p)||u.has(p)||o&&!o.canSkip(p)?l.push({currentPos:l.length,rowNode:p}):a.add(p)}const d=i.filter(h=>a.has(h)).map((h,f)=>({currentPos:f,rowNode:h}));return l.sort((h,f)=>e.compareRowNodes(s,h,f)),YCe(e,s,l,d)},YCe=(e,t,n,o)=>{let s=0,r=0;const i=n.length,a=o.length,l=new Array(i+a);let c=0;for(;s<i&&r<a;){const u=n[s],d=o[r];e.compareRowNodes(t,u,d)<0?(l[c++]=u.rowNode,++s):(l[c++]=d.rowNode,++r)}for(;s<i;)l[c++]=n[s++].rowNode;for(;r<a;)l[c++]=o[r++].rowNode;return l},ZCe=e=>{const t=e.childrenAfterSort,n=e.childrenAfterAggFilter,o=t==null?void 0:t.length,s=n==null?void 0:n.length;if(!o||!s)return null;const r=new Array(s),i=new Set;for(let l=0;l<s;++l)i.add(n[l]);let a=0;for(let l=0;l<o;++l){const c=t[l];i.delete(c)&&(r[a++]=c)}if(i.size===0&&a===o)return t;for(const l of i)r[a++]=l;return r.length=a,r},XCe=class extends We{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null,this.rowCountReady=!1,this.nodeManager=void 0,this.rowsToDisplay=[],this.rowDataUpdatedPending=!1,this.asyncTransactions=null,this.asyncTransactionsTimer=0,this.started=!1,this.refreshingModel=!1,this.rowNodesCountReady=!1,this.stages=[],this.stagesRefreshProps=new Map,this.onRowHeightChanged_debounced=Lo(this,this.onRowHeightChanged.bind(this),100)}postConstruct(){const e=this.beans,t=new pl(e);this.rootNode=t,this.nodeManager=this.createBean(new HCe(t));const n=this.refreshModel.bind(this,{step:"group"}),o=this.refreshModel.bind(this,{step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame")});this.addManagedEventListeners({newColumnsLoaded:o,columnRowGroupChanged:n,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:this.refreshModel.bind(this,{step:"pivot"}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),columnPivotModeChanged:n,gridStylesChanged:this.onGridStylesChanges.bind(this),gridReady:this.onGridReady.bind(this),rowExpansionStateChanged:this.onRowGroupOpened.bind(this)}),this.addPropertyListeners()}addPropertyListeners(){const{beans:e,stagesRefreshProps:t}=this,n=[e.groupStage,e.filterStage,e.pivotStage,e.aggStage,e.sortStage,e.filterAggStage,e.flattenStage].filter(o=>!!o);this.stages=n;for(let o=n.length-1;o>=0;--o)for(const s of n[o].refreshProps)t.set(s,o);this.addManagedPropertyListeners([...t.keys()],o=>{var r;const s=(r=o.changeSet)==null?void 0:r.properties;s&&this.onPropChange(s)}),this.addManagedPropertyListener("rowData",()=>this.onPropChange(["rowData"])),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){this.started=!0,this.rowNodesCountReady?this.refreshModel({step:"group",rowDataUpdated:!0,newData:!0}):this.setInitialData()}setInitialData(){this.gos.get("rowData")&&this.onPropChange(["rowData"])}ensureRowHeightsValid(e,t,n,o){let s,r=!1;do{s=!1;const i=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),l=Math.max(i,n),c=Math.min(a,o);for(let u=l;u<=c;u++){const d=this.getRow(u);if(d.rowHeightEstimated){const h=cl(this.beans,d);d.setRowHeight(h.height),s=!0,r=!0}}s&&this.setRowTopAndRowIndex()}while(s);return r}onPropChange(e){const{nodeManager:t,gos:n,beans:o}=this,s=o.groupStage;if(!t)return;const r=new Set(e),i=s==null?void 0:s.onPropChange(r);let a;r.has("rowData")?a=n.get("rowData"):i&&(a=s==null?void 0:s.extractData()),a&&!Array.isArray(a)&&(a=null,Je(1));const l={step:"nothing",changedProps:r};a&&(!i&&!this.isEmpty()&&a.length>0&&n.exists("getRowId")&&!n.get("resetRowDataOnUpdate")?(l.keepRenderedRows=!0,l.animate=!n.get("suppressAnimationFrame"),l.changedRowNodes=new Oy,t.setImmutableRowData(l,a)):(l.rowDataUpdated=!0,l.newData=!0,t.setNewRowData(a),this.rowNodesCountReady=!0));const c=l.rowDataUpdated?"group":this.getRefreshedStage(e);c&&(l.step=c,this.refreshModel(l))}getRefreshedStage(e){const{stages:t,stagesRefreshProps:n}=this,o=t.length;let s=o;for(let r=0,i=e.length;r<i&&s;++r)s=Math.min(s,n.get(e[r])??s);return s<o?t[s].step:null}setRowTopAndRowIndex(e){const{beans:t,rowsToDisplay:n}=this,o=t.environment.getDefaultRowHeight();let s=0;const r=Vo(this.gos,"normal");for(let i=0,a=n.length;i<a;++i){const l=n[i],c=l.id;if(c!=null&&(e==null||e.add(c)),l.rowHeight==null){const u=cl(t,l,r,o);l.setRowHeight(u.height,u.estimated)}l.setRowTop(s),l.setRowIndex(i),s+=l.rowHeight}}clearRowTopAndRowIndex(e,t){const n=e.active,o=i=>{(i==null?void 0:i.id)!=null&&!t.has(i.id)&&i.clearRowTopAndRowIndex()},s=i=>{o(i),o(i.detailNode),o(i.sibling);const a=i.childrenAfterGroup;if(!i.hasChildren()||!a)return;const l=i.level==-1;if(!(n&&!l&&!i.expanded))for(let u=0,d=a.length;u<d;++u)s(a[u])},r=this.rootNode;r&&s(r)}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay.length}getTopLevelRowCount(){var s,r;const{rootNode:e,rowsToDisplay:t}=this;if(!e||!t.length)return 0;if(t[0]===e)return 1;const o=(s=e.sibling)!=null&&s.displayed?1:0;return(((r=e.childrenAfterSort)==null?void 0:r.length)??0)+o}getTopLevelRowDisplayedIndex(e){const{beans:t,rootNode:n,rowsToDisplay:o}=this;if(!n||!o.length||o[0]===n)return e;const r=n.childrenAfterSort,i=l=>{let c=r[l];if(this.gos.get("groupHideOpenParents"))for(;c.expanded&&c.childrenAfterSort&&c.childrenAfterSort.length>0;)c=c.childrenAfterSort[0];return c.rowIndex},a=t.footerSvc;return a?a==null?void 0:a.getTopDisplayIndex(o,e,r,i):i(e)}getTopLevelIndexFromDisplayedIndex(e){var a;const{rootNode:t,rowsToDisplay:n}=this;if(!t||!n.length||n[0]===t)return e;let s=this.getRow(e);s.footer&&(s=s.sibling);let r=s.parent;for(;r&&r!==t;)s=r,r=s.parent;const i=((a=t.childrenAfterSort)==null?void 0:a.indexOf(s))??-1;return i>=0?i:e}getRowBounds(e){const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){this.refreshModel({step:"map",keepRenderedRows:!0,animate:Ed(this.gos)})}onFilterChanged({afterDataChange:e,columns:t}){if(!e){const o=t.length===0||t.some(s=>s.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:o,keepRenderedRows:!0,animate:Ed(this.gos)})}}onSortChanged(){this.refreshModel({step:"sort",keepRenderedRows:!0,animate:Ed(this.gos)})}getType(){return"clientSide"}onValueChanged(){this.refreshModel({step:this.beans.colModel.isPivotActive()?"pivot":"aggregate"})}createChangePath(e){const t=new Ep(!1,this.rootNode);return t.active=e,t}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;const{changedRowNodes:t,newData:n,rowDataUpdated:o}=e;return!(!t||n||!o||t.removals.size||t.adds.size)}refreshModel(e){var c,u;const{nodeManager:t,beans:n,eventSvc:o,started:s,refreshingModel:r}=this;if(!t)return;const i=!!e.rowDataUpdated,a=e.changedPath??(e.changedPath=this.createChangePath(!e.newData&&i));if(s&&i&&o.dispatchEvent({type:"rowDataUpdated"}),!s||r||n.colModel.changeEventsDispatching||this.isSuppressModelUpdateAfterUpdateTransaction(e)){this.rowDataUpdatedPending||(this.rowDataUpdatedPending=i);return}switch(this.rowDataUpdatedPending&&(this.rowDataUpdatedPending=!1,e.step="group"),this.refreshingModel=!0,(c=n.masterDetailSvc)==null||c.refreshModel(e),i&&e.step!=="group"&&((u=n.colFilter)==null||u.refreshModel()),e.step){case"group":this.doGrouping(e);case"filter":this.doFilter(a);case"pivot":this.doPivot(a);case"aggregate":this.doAggregate(a);case"filter_aggregates":this.doFilterAggregates(a);case"sort":this.doSort(e.changedRowNodes,a);case"map":this.doRowsToDisplay()}const l=new Set;this.setRowTopAndRowIndex(l),this.clearRowTopAndRowIndex(a,l),this.refreshingModel=!1,o.dispatchEvent({type:"modelUpdated",animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:!1,keepUndoRedoStack:e.keepUndoRedoStack})}isEmpty(){var e,t,n;return!((t=(e=this.rootNode)==null?void 0:e._leafs)!=null&&t.length)||!((n=this.beans.colModel)!=null&&n.ready)}isRowsToRender(){return this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let n=!1,o=!1;const s=[],r=up(this.gos);return this.forEachNodeAfterFilterAndSort(i=>{if(o)return;if(n&&(i===t||i===e)&&(o=!0,r&&i.group)){D$(s,i);return}if(!n){if(i!==t&&i!==e)return;n=!0,t===e&&(o=!0)}(!i.group||!r)&&s.push(i)}),s}getTopLevelNodes(){var e;return((e=this.rootNode)==null?void 0:e.childrenAfterGroup)??null}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){const t=this.rowsToDisplay,n=t.length;if(this.isEmpty()||n===0)return-1;let o=0,s=n-1;if(e<=0)return 0;if(t[s].rowTop<=e)return s;let i=-1,a=-1;for(;;){const l=Math.floor((o+s)/2),c=t[l];if(this.isRowInPixel(c,e)||(c.rowTop<e?o=l+1:c.rowTop>e&&(s=l-1),i===o&&a===s))return l;i=o,a=s}}isRowInPixel(e,t){const n=e.rowTop,o=n+e.rowHeight;return n<=t&&o>t}forEachLeafNode(e){var n;const t=(n=this.rootNode)==null?void 0:n._leafs;if(t)for(let o=0,s=t.length;o<s;++o)e(t[o],o)}forEachNode(e,t=!1){this.depthFirstSearchRowNodes(e,t)}forEachDisplayedNode(e){const t=this.rowsToDisplay;for(let n=0,o=t.length;n<o;++n)e(t[n],n)}forEachNodeAfterFilter(e,t=!1){this.depthFirstSearchRowNodes(e,t,n=>n.childrenAfterAggFilter)}forEachNodeAfterFilterAndSort(e,t=!1){this.depthFirstSearchRowNodes(e,t,n=>n.childrenAfterSort)}forEachPivotNode(e,t,n){const{colModel:o,rowGroupColsSvc:s}=this.beans;if(!o.isPivotMode())return;if(!(s!=null&&s.columns.length)){e(this.rootNode,0);return}const r=n?"childrenAfterSort":"childrenAfterGroup";this.depthFirstSearchRowNodes(e,t,i=>i.leafGroup?null:i[r])}depthFirstSearchRowNodes(e,t=!1,n=r=>r.childrenAfterGroup,o=this.rootNode,s=0){let r=s;if(!o)return r;const i=o===this.rootNode;if(i||e(o,r++),o.hasChildren()&&!o.footer){const a=n(o);if(a){const l=this.beans.footerSvc;r=(l==null?void 0:l.addTotalRows(r,o,e,t,i,"top"))??r;for(const c of a)r=this.depthFirstSearchRowNodes(e,t,n,c,r);return(l==null?void 0:l.addTotalRows(r,o,e,t,i,"bottom"))??r}}return r}doAggregate(e){var n;const t=this.rootNode;t&&((n=this.beans.aggStage)==null||n.execute({rowNode:t,changedPath:e}))}doFilterAggregates(e){const t=this.rootNode,n=this.beans.filterAggStage;if(n){n.execute({rowNode:t,changedPath:e});return}t.childrenAfterAggFilter=t.childrenAfterFilter}doSort(e,t){const n=this.beans.sortStage;if(n){n.execute({rowNode:this.rootNode,changedRowNodes:e,changedPath:t});return}t.forEachChangedNodeDepthFirst(o=>{o.childrenAfterSort=o.childrenAfterAggFilter.slice(0),R$(o)})}doGrouping(e){var s;const t=this.rootNode,n=this.beans.groupStage,o=n==null?void 0:n.execute({rowNode:t,changedRowNodes:e.changedRowNodes,changedPath:e.changedPath,afterColumnsChanged:!!e.afterColumnsChanged});if(o===void 0){const r=t._leafs;t.childrenAfterGroup=r,t.updateHasChildren();const i=t.sibling;i&&(i.childrenAfterGroup=r)}(o||e.rowDataUpdated)&&((s=this.beans.colFilter)==null||s.refreshModel()),!this.rowCountReady&&this.rowNodesCountReady&&(this.rowCountReady=!0,this.eventSvc.dispatchEventOnce({type:"rowCountReady"}))}doFilter(e){const t=this.beans.filterStage;if(t){t.execute({rowNode:this.rootNode,changedPath:e});return}e.forEachChangedNodeDepthFirst(n=>{n.childrenAfterFilter=n.childrenAfterGroup,zB(n)},!0)}doPivot(e){var t;(t=this.beans.pivotStage)==null||t.execute({rowNode:this.rootNode,changedPath:e})}getRowNode(e){var o,s;const t=(o=this.nodeManager)==null?void 0:o.getRowNode(e);return typeof t=="object"?t:typeof e=="string"&&e.indexOf(z0)===0?(s=this.beans.groupStage)==null?void 0:s.getNode(e):void 0}batchUpdateRowData(e,t){if(!this.asyncTransactionsTimer){this.asyncTransactions=[];const n=this.gos.get("asyncTransactionWaitMillis");this.asyncTransactionsTimer=setTimeout(()=>this.executeBatchUpdateRowData(),n)}this.asyncTransactions.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){const e=this.asyncTransactionsTimer;e&&(clearTimeout(e),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){var a;const{nodeManager:e,beans:t,eventSvc:n,asyncTransactions:o}=this;if(!e)return;(a=t.valueCache)==null||a.onDataChanged();const s=[],r=[],i=new Oy;for(const{rowDataTransaction:l,callback:c}of o??[]){this.rowNodesCountReady=!0;const u=e.updateRowData(l,i);s.push(u),c&&r.push(c.bind(null,u))}this.commitTransactions(i),r.length>0&&setTimeout(()=>{for(let l=0,c=r.length;l<c;l++)r[l]()},0),s.length>0&&n.dispatchEvent({type:"asyncTransactionsFlushed",results:s}),this.asyncTransactionsTimer=0,this.asyncTransactions=null}updateRowData(e){var s;const t=this.nodeManager;if(!t)return null;(s=this.beans.valueCache)==null||s.onDataChanged(),this.rowNodesCountReady=!0;const n=new Oy,o=t.updateRowData(e,n);return this.commitTransactions(n),o}commitTransactions(e){this.refreshModel({step:"group",rowDataUpdated:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame"),changedRowNodes:e,changedPath:this.createChangePath(!0)})}doRowsToDisplay(){const{beans:e,rootNode:t}=this,n=e.flattenStage;if(n){this.rowsToDisplay=n.execute({rowNode:t});return}const o=this.rootNode.childrenAfterSort??[];for(const s of o)s.setUiLevel(0);this.rowsToDisplay=o}onRowHeightChanged(){this.refreshModel({step:"map",keepRenderedRows:!0,keepUndoRedoStack:!0})}resetRowHeights(){const e=this.rootNode;if(!e)return;const t=this.resetRowHeightsForAllRowNodes();e.setRowHeight(e.rowHeight,!0);const n=e.sibling;n==null||n.setRowHeight(n.rowHeight,!0),t&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{t.setRowHeight(t.rowHeight,!0);const n=t.detailNode;n==null||n.setRowHeight(n.rowHeight,!0);const o=t.sibling;o==null||o.setRowHeight(o.rowHeight,!0),e=!0}),e}onGridStylesChanges(e){var t;e.rowHeightChanged&&!((t=this.beans.rowAutoHeight)!=null&&t.active)&&this.resetRowHeights()}onGridReady(){this.started||this.setInitialData()}destroy(){super.destroy(),this.nodeManager=this.destroyBean(this.nodeManager),this.started=!1,this.rootNode=null,this.rowsToDisplay=[],this.asyncTransactions=null,clearTimeout(this.asyncTransactionsTimer)}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}},D$=(e,t)=>{const n=t.childrenAfterGroup;if(n)for(let o=0,s=n.length;o<s;++o){const r=n[o];r.data&&e.push(r),r.group&&D$(e,r)}};function JCe(e){var t;(t=e.expansionSvc)==null||t.onGroupExpandedOrCollapsed()}function QCe(e,t){const n=wl(e);n&&((!t||t==="everything")&&(t="group"),n.refreshModel({step:t,keepRenderedRows:!0,animate:!e.gos.get("suppressAnimationFrame")}))}function ebe(e){var t;return((t=wl(e))==null?void 0:t.isEmpty())??!0}function tbe(e,t){var n;(n=wl(e))==null||n.forEachLeafNode(t)}function nbe(e,t){var n;(n=wl(e))==null||n.forEachNodeAfterFilter(t)}function obe(e,t){var n;(n=wl(e))==null||n.forEachNodeAfterFilterAndSort(t)}function sbe(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=wl(e))==null?void 0:n.updateRowData(t)})}function rbe(e,t,n){e.frameworkOverrides.wrapIncoming(()=>{var o;return(o=wl(e))==null?void 0:o.batchUpdateRowData(t,n)})}function ibe(e){e.frameworkOverrides.wrapIncoming(()=>{var t;return(t=wl(e))==null?void 0:t.flushAsyncTransactions()})}function abe(e){var t;return(t=e.selectionSvc)==null?void 0:t.getBestCostNodeSelection()}var T$={moduleName:"ClientSideRowModel",version:dt,rowModels:["clientSide"],beans:[XCe,KCe],dependsOn:[NB]},lbe={moduleName:"ClientSideRowModelApi",version:dt,apiFunctions:{onGroupExpandedOrCollapsed:JCe,refreshClientSideRowModel:QCe,isRowDataEmpty:ebe,forEachLeafNode:tbe,forEachNodeAfterFilter:nbe,forEachNodeAfterFilterAndSort:obe,applyTransaction:sbe,applyTransactionAsync:rbe,flushAsyncTransactions:ibe,getBestCostNodeSelection:abe,resetRowHeights:E$,onRowHeightChanged:S$},dependsOn:[NCe,LCe]},cbe=class extends We{constructor(){super(...arguments),this.beanName="gridSerializer"}wireBeans(e){this.visibleCols=e.visibleCols,this.colModel=e.colModel,this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel}serialize(e,t={}){const{allColumns:n,columnKeys:o,skipRowGroups:s,exportRowNumbers:r}=t,i=this.getColumnsToExport({allColumns:n,skipRowGroups:s,columnKeys:o,exportRowNumbers:r});return[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)].reduce((a,l)=>l(a),e).parse()}processRow(e,t,n,o){var p;const s=t.shouldRowBeSkipped||(()=>!1),i=t.rowPositions!=null||!!t.onlySelected,a=this.gos.get("groupHideOpenParents")&&!i,l=this.colModel.isPivotMode()?o.leafGroup:!o.group,c=!!o.footer,u=o.allChildrenCount===1&&((p=o.childrenAfterGroup)==null?void 0:p.length)===1&&dae(this.gos,o);if(!l&&!c&&(t.skipRowGroups||u||a)||t.onlySelected&&!o.isSelected()||t.skipPinnedTop&&o.rowPinned==="top"||t.skipPinnedBottom&&o.rowPinned==="bottom"||o.stub||o.level===-1&&!l&&!c||s(Pt(this.gos,{node:o})))return;const f=e.onNewBodyRow(o);if(n.forEach((g,v)=>{f.onColumn(g,v,o)}),t.getCustomContentBelowRow){const g=t.getCustomContentBelowRow(Pt(this.gos,{node:o}));g&&e.addCustomContent(g)}}appendContent(e){return t=>{const n=e.appendContent;return n&&t.addCustomContent(n),t}}prependContent(e){return t=>{const n=e.prependContent;return n&&t.addCustomContent(n),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return n=>{if(!e.skipColumnGroupHeaders){const o=new w2,{colGroupSvc:s}=this.beans,r=s?s.createColumnGroups({columns:t,idCreator:o,pinned:null,isStandaloneStructure:!0}):t;this.recursivelyAddHeaderGroups(r,n,e.processGroupHeaderCallback)}return n}}exportHeaders(e,t){return n=>{if(!e.skipColumnHeaders){const o=n.onNewHeaderRow();t.forEach((s,r)=>{o.onColumn(s,r,void 0)})}return n}}processPinnedTopRows(e,t){return n=>{var s,r;const o=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(i=>i.rowPinned==="top").sort((i,a)=>i.rowIndex-a.rowIndex).map(i=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedTopRow(i.rowIndex)}).forEach(o):(s=this.pinnedRowModel)!=null&&s.isManual()||(r=this.pinnedRowModel)==null||r.forEachPinnedRow("top",o),n}}processRows(e,t){return n=>{var c;const o=this.rowModel,s=ro(this.gos),r=Sd(this.gos),i=!s&&e.onlySelected,a=this.processRow.bind(this,n,e,t),{exportedRows:l="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(u=>u.rowPinned==null).sort((u,d)=>u.rowIndex-d.rowIndex).map(u=>o.getRow(u.rowIndex)).forEach(a);else if(this.colModel.isPivotMode())s?o.forEachPivotNode(a,!0,l==="filteredAndSorted"):r?o.forEachNodeAfterFilterAndSort(a,!0):o.forEachNode(a);else if(e.onlySelectedAllPages||i){const u=((c=this.beans.selectionSvc)==null?void 0:c.getSelectedNodes())??[];this.replicateSortedOrder(u),u.forEach(a)}else l==="all"?o.forEachNode(a):s||r?o.forEachNodeAfterFilterAndSort(a,!0):o.forEachNode(a);return n}}replicateSortedOrder(e){const{sortSvc:t,rowNodeSorter:n}=this.beans;if(!t||!n)return;const o=t.getSortOptions(),s=(r,i)=>{var a,l;return r.rowIndex!=null&&i.rowIndex!=null?r.rowIndex-i.rowIndex:r.level===i.level?((a=r.parent)==null?void 0:a.id)===((l=i.parent)==null?void 0:l.id)?n.compareRowNodes(o,{rowNode:r,currentPos:r.rowIndex??-1},{rowNode:i,currentPos:i.rowIndex??-1}):s(r.parent,i.parent):r.level>i.level?s(r.parent,i):s(r,i.parent)};e.sort(s)}processPinnedBottomRows(e,t){return n=>{var s,r;const o=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(i=>i.rowPinned==="bottom").sort((i,a)=>i.rowIndex-a.rowIndex).map(i=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedBottomRow(i.rowIndex)}).forEach(o):(s=this.pinnedRowModel)!=null&&s.isManual()||(r=this.pinnedRowModel)==null||r.forEachPinnedRow("bottom",o),n}}getColumnsToExport(e){const{allColumns:t=!1,skipRowGroups:n=!1,exportRowNumbers:o=!1,columnKeys:s}=e,{colModel:r,gos:i,visibleCols:a}=this,l=r.isPivotMode(),c=h=>pa(h)?!1:!ga(h)||o;if(s!=null&&s.length)return r.getColsForKeys(s).filter(c);const u=i.get("treeData");let d=[];return t&&!l?d=r.getCols():d=a.allCols,d=d.filter(h=>c(h)&&(n&&!u?!v0(h):!0)),d}recursivelyAddHeaderGroups(e,t,n){const o=[];for(const s of e){const r=s;if(r.getChildren)for(const i of r.getChildren()??[])o.push(i)}e.length>0&&io(e[0])&&this.doAddHeaderHeader(t,e,n),o&&o.length>0&&this.recursivelyAddHeaderGroups(o,t,n)}doAddHeaderHeader(e,t,n){const o=e.onNewHeaderGroupingRow();let s=0;for(const r of t){const i=r;let a;n?a=n(Pt(this.gos,{columnGroup:i})):a=this.beans.colNames.getDisplayNameForColumnGroup(i,"header");const c=(i.isExpandable()?i.getLeafColumns():[]).reduce((u,d,h,f)=>{let p=Tn(u);return d.getColumnGroupShow()==="open"?(!p||p[1]!=null)&&(p=[h],u.push(p)):p&&p[1]==null&&(p[1]=h-1),h===f.length-1&&p&&p[1]==null&&(p[1]=h),u},[]);o.onColumn(i,a||"",s++,i.getLeafColumns().length-1,c)}}},ube={moduleName:"SharedExport",version:dt,beans:[cbe]},I$=`\r
|
|
260
|
-
`,dbe=class extends $ve{constructor(e){super(e),this.config=e,this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:n}=e;this.suppressQuotes=t,this.columnSeparator=n}addCustomContent(e){e&&(typeof e=="string"?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,I$),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((n,o)=>{o!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(n.data.value||""),n.mergeAcross&&this.appendEmptyCells(n.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,n,o){n!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(o)}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,n){t!=0&&(this.result+=this.columnSeparator);const o=this.extractRowCellValue(e,t,t,"csv",n);this.result+=this.putInQuotes(o.valueFormatted??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():(Je(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=I$),this.isFirstLine=!1}},hbe=class extends Bve{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.rowGroupColsSvc=e.rowGroupColsSvc,this.valueSvc=e.valueSvc}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){Je(51);return}const t=this.getMergedParams(e),n=this.getData(t),o=new Blob(["\uFEFF",n],{type:"text/plain"}),s=typeof t.fileName=="function"?t.fileName(Pt(this.gos,{})):t.fileName;Hve(this.getFileName(s),o)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const n=t?Object.assign({},e):this.getMergedParams(e);return this.getData(n)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{colModel:t,colNames:n,rowGroupColsSvc:o,valueSvc:s,gos:r}=this,{processCellCallback:i,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:u,columnSeparator:d}=e;return new dbe({colModel:t,colNames:n,valueSvc:s,gos:r,processCellCallback:i||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:u||!1,columnSeparator:d||",",rowGroupColsSvc:o})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function fbe(e,t){var n;return(n=e.csvCreator)==null?void 0:n.getDataAsCsv(t)}function pbe(e,t){var n;(n=e.csvCreator)==null||n.exportDataAsCsv(t)}var gbe={moduleName:"CsvExport",version:dt,beans:[hbe],apiFunctions:{getDataAsCsv:fbe,exportDataAsCsv:pbe},dependsOn:[ube]},mbe=class extends We{constructor(e,t,n){super(),this.id=e,this.parentCache=t,this.params=n,this.state="needsLoading",this.version=0,this.startRow=e*n.blockSize,this.endRow=this.startRow+n.blockSize}load(){this.state="loading",this.loadFromDatasource()}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed"),this.dispatchLocalEvent({type:"loadComplete"})}pageLoaded(e,t,n){this.successCommon(e,{rowData:t,rowCount:n})}isRequestMostRecentAndLive(e){const t=e===this.version,n=this.isAlive();return t&&n}successCommon(e,t){this.dispatchLocalEvent({type:"loadComplete"}),this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}postConstruct(){this.rowNodes=[];const{params:{blockSize:e,rowHeight:t},startRow:n,beans:o,rowNodes:s}=this;for(let r=0;r<e;r++){const i=n+r,a=new pl(o);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(i),a.setRowTop(t*i),s.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:n,state:o}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:n,pageStatus:o}}}setDataAndId(e,t,n){ft(t)?e.setDataAndId(t,n.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Bn(this.params.datasource.getRows)){Je(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:n,params:{sortModel:o,filterModel:s},gos:r}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,n),failCallback:this.pageLoadFailed.bind(this,n),sortModel:o,filterModel:s,context:Pt(r,{}).context}}forEachNode(e,t,n){this.rowNodes.forEach((o,s)=>{this.startRow+s<n&&e(o,t.value++)})}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.value++);const n=e-this.startRow;return this.rowNodes[n]}processServerResult(e){const{rowNodes:t,beans:n}=this;t.forEach((s,r)=>{const i=e.rowData?e.rowData[r]:void 0;!s.id&&s.alreadyRendered&&i&&(t[r]=new pl(n),t[r].setRowIndex(s.rowIndex),t[r].setRowTop(s.rowTop),t[r].setRowHeight(s.rowHeight),s.clearRowTopAndRowIndex()),this.setDataAndId(t[r],i,this.startRow+r)});const o=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,o)}destroy(){for(const e of this.rowNodes)e.clearRowTopAndRowIndex();super.destroy()}},vbe=2,ybe=class extends We{constructor(e){super(),this.params=e,this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount}getRow(e,t=!1){const n=Math.floor(e/this.params.blockSize);let o=this.blocks[n];if(!o){if(t)return;o=this.createBlock(n)}return o.getRow(e)}createBlock(e){const t=this.params,n=this.createBean(new mbe(e,this,t));return this.blocks[n.id]=n,this.blockCount++,this.purgeBlocksIfNeeded(n),t.rowNodeBlockLoader.addBlock(n),n}refreshCache(){if(this.blockCount==0){this.purgeCache();return}for(const t of this.getBlocksInOrder())t.setStateWaitingToLoad();this.params.rowNodeBlockLoader.checkBlockToLoad()}destroy(){for(const e of this.getBlocksInOrder())this.destroyBlock(e);super.destroy()}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(ll(this.gos,`InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(i=>i!=e),n=(i,a)=>a.lastAccessed-i.lastAccessed;t.sort(n);const o=this.params.maxBlocksInCache>0,s=o?this.params.maxBlocksInCache-1:null,r=vbe-1;t.forEach((i,a)=>{const l=i.state==="needsLoading"&&a>=r,c=o?a>=s:!1;if(l||c){if(this.isBlockCurrentlyDisplayed(i)||this.isBlockFocused(i))return;this.removeBlockFromCache(i)}})}isBlockFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const{startRow:n,endRow:o}=e;return t.rowIndex>=n&&t.rowIndex<o}isBlockCurrentlyDisplayed(e){const{startRow:t,endRow:n}=e;return this.beans.rowRenderer.isRangeInRenderedViewport(t,n-1)}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{blockSize:n,overflowSize:o}=this.params,r=(e.id+1)*n+o;this.rowCount<r&&(this.rowCount=r)}}setRowCount(e,t){this.rowCount=e,ft(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t={value:0};for(const n of this.getBlocksInOrder())n.forEachNode(e,t,this.rowCount)}getBlocksInOrder(){const e=(n,o)=>n.id-o.id;return Object.values(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.id],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){this.isAlive()&&(this.destroyAllBlocksPastVirtualRowCount(),this.eventSvc.dispatchEvent({type:"storeUpdated"}))}destroyAllBlocksPastVirtualRowCount(){const e=[];for(const t of this.getBlocksInOrder())t.id*this.params.blockSize>=this.rowCount&&e.push(t);if(e.length>0)for(const t of e)this.destroyBlock(t)}purgeCache(){for(const e of this.getBlocksInOrder())this.removeBlockFromCache(e);this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const n=[];let o=-1,s=!1;const r={value:0};let i=!1;for(const l of this.getBlocksInOrder())if(!i){if(s&&o+1!==l.id){i=!0;continue}o=l.id,l.forEachNode(c=>{const u=c===e||c===t;(s||u)&&n.push(c),u&&(s=!s)},r,this.rowCount)}return i||s?[]:n}},wbe=class extends We{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(){return!1}postConstruct(){if(this.gos.get("rowModelType")!=="infinite")return;const e=this.beans,t=new pl(e);this.rootNode=t,t.level=-1,this.rowHeight=Rc(e),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache())}start(){this.setDatasource(this.gos.get("datasource"))}destroy(){this.destroyDatasource(),super.destroy(),this.rootNode=null}destroyDatasource(){this.datasource&&(this.destroyBean(this.datasource),this.beans.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedEventListeners({filterChanged:this.reset.bind(this),sortChanged:this.reset.bind(this),newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.dispatchModelUpdatedEvent.bind(this)}),this.addManagedPropertyListener("datasource",()=>this.setDatasource(this.gos.get("datasource"))),this.addManagedPropertyListener("cacheBlockSize",()=>this.resetCache()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=Rc(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){var t;let e;this.cacheParams?e=!Yf(this.cacheParams.sortModel,((t=this.beans.sortSvc)==null?void 0:t.getSortModel())??[]):e=!0,e&&this.reset()}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){var n;return((n=this.infiniteCache)==null?void 0:n.getRowNodesInRange(e,t))??[]}reset(){var n;if(!this.datasource)return;_d(this.gos)!=null||(n=this.beans.selectionSvc)==null||n.reset("rowDataChanged"),this.resetCache()}dispatchModelUpdatedEvent(){this.eventSvc.dispatchEvent({type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1})}resetCache(){this.destroyCache();const e=this.beans,{filterManager:t,sortSvc:n,rowNodeBlockLoader:o,eventSvc:s,gos:r}=e;this.cacheParams={datasource:this.datasource,filterModel:(t==null?void 0:t.getFilterModel())??{},sortModel:(n==null?void 0:n.getSortModel())??[],rowNodeBlockLoader:o,initialRowCount:r.get("infiniteInitialRowCount"),maxBlocksInCache:r.get("maxBlocksInCache"),rowHeight:Rc(e),overflowSize:r.get("cacheOverflowSize"),blockSize:r.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new ybe(this.cacheParams)),s.dispatchEventOnce({type:"rowCountReady"}),this.dispatchModelUpdatedEvent()}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)}),this.dispatchModelUpdatedEvent()}destroyCache(){this.infiniteCache=this.destroyBean(this.infiniteCache)}getRow(e){const t=this.infiniteCache;if(t&&!(e>=t.getRowCount()))return t.getRow(e)}getRowNode(e){let t;return this.forEachNode(n=>{n.id===e&&(t=n)}),t}forEachNode(e){var t;(t=this.infiniteCache)==null||t.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),n=this.getRowCount()-1;return t>n?n:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){var e;(e=this.infiniteCache)==null||e.refreshCache()}purgeCache(){var e;(e=this.infiniteCache)==null||e.purgeCache()}isLastRowIndexKnown(){var e;return((e=this.infiniteCache)==null?void 0:e.isLastRowIndexKnown())??!1}setRowCount(e,t){var n;(n=this.infiniteCache)==null||n.setRowCount(e,t)}resetRowHeights(){}onRowHeightChanged(){}};function Cbe(e){var t;(t=Gy(e))==null||t.refreshCache()}function bbe(e){var t;(t=Gy(e))==null||t.purgeCache()}function Sbe(e){var t;return(t=Gy(e))==null?void 0:t.getRowCount()}var Ebe=class extends We{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=hae(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=Lo(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){Gr(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad()}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),this.maxConcurrentRequests!=null&&this.activeBlockLoadsCount>=this.maxConcurrentRequests){ll(this.gos,"RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.maxConcurrentRequests!=null?this.maxConcurrentRequests-this.activeBlockLoadsCount:1,t=this.blocks.filter(n=>n.state==="needsLoading").slice(0,e);this.activeBlockLoadsCount+=t.length;for(const n of t)n.load();this.printCacheStatus()}getBlockState(){const e={};return this.blocks.forEach(t=>{const{id:n,state:o}=t.getBlockStateJson();e[n]=o}),e}printCacheStatus(){ll(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},_be={moduleName:"InfiniteRowModelCore",version:dt,rowModels:["infinite"],beans:[wbe,Ebe]},Rbe={moduleName:"InfiniteRowModel",version:dt,apiFunctions:{refreshInfiniteCache:Cbe,purgeInfiniteCache:bbe,getInfiniteRowCount:Sbe},dependsOn:[_be,VCe]},Dbe="↑",Tbe="↓",Ibe={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},xbe=class extends bn{constructor(){super(Ibe),this.eValue=ht,this.eDelta=ht,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const n=Math.abs(t),o=e.formatValue(n),s=ft(o)?o:n,r=t>=0,i=this.eDelta;r?i.textContent=Dbe+s:i.textContent=Tbe+s,i.classList.toggle("ag-value-change-delta-up",r),i.classList.toggle("ag-value-change-delta-down",!r)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),No(this.eDelta)}refresh(e,t=!1){var c;const{value:n,valueFormatted:o}=e,{eValue:s,lastValue:r,beans:i}=this;if(n===r||(ft(o)?s.textContent=o:ft(n)?s.textContent=n:No(s),(c=i.filterManager)!=null&&c.isSuppressFlashingCellsBecauseFiltering()))return!1;const a=n&&typeof n=="object"&&"toNumber"in n?n.toNumber():n,l=r&&typeof r=="object"&&"toNumber"in r?r.toNumber():r;if(a===l)return!1;if(typeof a=="number"&&typeof l=="number"){const u=a-l;this.showDelta(e,u)}return r&&s.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=n,!0}},Fbe=".ag-value-slide-out{opacity:1}:where(.ag-ltr) .ag-value-slide-out{margin-right:5px;transition:opacity 3s,margin-right 3s}:where(.ag-rtl) .ag-value-slide-out{margin-left:5px;transition:opacity 3s,margin-left 3s}:where(.ag-ltr,.ag-rtl) .ag-value-slide-out{transition-timing-function:linear}.ag-value-slide-out-end{opacity:0}:where(.ag-ltr) .ag-value-slide-out-end{margin-right:10px}:where(.ag-rtl) .ag-value-slide-out-end{margin-left:10px}",Pbe={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},kbe=class extends bn{constructor(){super(Pbe),this.eCurrent=ht,this.refreshCount=0,this.registerCSS(Fbe)}init(e){this.refresh(e,!0)}addSlideAnimation(){var s;this.refreshCount++;const e=this.refreshCount;(s=this.ePrevious)==null||s.remove();const{beans:t,eCurrent:n}=this,o=ao({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=o,o.textContent=n.textContent,this.getGui().insertBefore(o,n),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{var r;e===this.refreshCount&&((r=this.ePrevious)==null||r.remove(),this.ePrevious=null)},3e3)})}refresh(e,t=!1){var s;let n=e.value;if(Bn(n)&&(n=""),n===this.lastValue||(s=this.beans.filterManager)!=null&&s.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=n;const o=this.eCurrent;return ft(e.valueFormatted)?o.textContent=e.valueFormatted:ft(e.value)?o.textContent=n:No(o),!0}},Abe=class extends We{constructor(){super(...arguments),this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(e,t,n=this.beans.gos.get("cellFlashDuration"),o=this.beans.gos.get("cellFadeDuration")){const s=this.animations[t];s.delete(e);const r=Date.now(),i=r+n,a=r+n+o,l={phase:"flash",flashEndTime:i,fadeEndTime:a};s.set(e,l);const c=`ag-cell-${t}`,u=`${c}-animation`,{comp:d,eGui:{style:h}}=e;d.toggleCss(c,!0),d.toggleCss(u,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&i+15<this.nextAnimationTime&&(clearTimeout(this.nextAnimationCycle),this.nextAnimationCycle=null,this.nextAnimationTime=null),this.nextAnimationCycle||(this.beans.frameworkOverrides.wrapIncoming(()=>{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),n)}),this.nextAnimationTime=i)}advanceAnimations(){const e=Date.now();let t=null;for(const n of Object.keys(this.animations)){const o=this.animations[n],s=`ag-cell-${n}`,r=`${s}-animation`;for(const[i,a]of o){if(!i.isAlive()||!i.comp){o.delete(i);continue}const{phase:l,flashEndTime:c,fadeEndTime:u}=a,d=l==="flash"?c:u;if(!(e+15>=d)){t=Math.min(d,t??1/0);continue}const{comp:f,eGui:{style:p}}=i;switch(l){case"flash":f.toggleCss(s,!1),f.toggleCss(r,!0),p.transition=`background-color ${u-c}ms`,p.transitionDelay=`${c-e}ms`,t=Math.min(u,t??1/0),a.phase="fade";break;case"fade":f.toggleCss(s,!1),f.toggleCss(r,!1),p.removeProperty("transition"),p.removeProperty("transition-delay"),o.delete(i);break}}}t==null?(this.nextAnimationTime=null,this.nextAnimationCycle=null):t&&(this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),t-e),this.nextAnimationTime=t)}onFlashCells(e,t){if(!e.comp)return;const n=khe(e.cellPosition);t.cells[n]&&this.animateCell(e,"highlight")}flashCell(e,t){this.animateCell(e,"data-changed",t==null?void 0:t.flashDuration,t==null?void 0:t.fadeDuration)}destroy(){for(const e of Object.keys(this.animations))this.animations[e].clear()}};function Obe(e,t={}){const{cellFlashSvc:n}=e;n&&e.frameworkOverrides.wrapIncoming(()=>{for(const o of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))n.flashCell(o,t)})}var Mbe={moduleName:"HighlightChanges",version:dt,beans:[Abe],userComponents:{agAnimateShowChangeCellRenderer:xbe,agAnimateSlideCellRenderer:kbe},apiFunctions:{flashCells:Obe}};function Nbe(e){var t;return((t=e.stateSvc)==null?void 0:t.getState())??{}}function Lbe(e,t,n){var o;return(o=e.stateSvc)==null?void 0:o.setState(t,n)}function x$(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=Vbe(e)),e.version=dt,e}function Vbe(e){return e.cellSelection=Bbe(e,"rangeSelection"),e}function Bbe(e,t){if(e&&typeof e=="object")return e[t]}var $be=class extends We{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Lo(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=Lo(this,()=>{this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(this.updateCachedState("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowGroupExpansion",void 0)):(this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("ssrmRowGroupExpansion",void 0))},0),this.onRowSelectedDebounced=Lo(this,()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}postConstruct(){const{gos:e,ctrlsSvc:t,colDelayRenderSvc:n}=this.beans;this.isClientSideRowModel=ro(e);const o=x$(e.get("initialState")??{}),s=o.partialColumnState;delete o.partialColumnState,this.cachedState=o;const r=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>r(()=>this.setupStateOnGridReady(o))),(o.columnOrder||o.columnVisibility||o.columnSizing||o.columnPinning||o.columnGroup)&&(n==null||n.hideColumns("columnState"));const[i,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:c})=>{c==="gridInitializing"&&(i(),r(()=>{this.setupStateOnColumnsInitialised(o,!!s),n==null||n.revealColumns("columnState")}))},rowCountReady:()=>{a==null||a(),r(()=>this.setupStateOnRowCountReady(o))},firstDataRendered:()=>{l==null||l(),r(()=>this.setupStateOnFirstDataRendered(o))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const n=x$(e);delete n.partialColumnState,this.cachedState=n,this.startSuppressEvents();const o="api",s=t?new Set(t):void 0;this.setGridReadyState(n,o,s),this.setColumnsInitialisedState(n,o,!!s,s),this.setRowCountState(n,o,s),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(n,o,s),this.stopSuppressEvents(o)})}setGridReadyState(e,t,n){var o,s;t==="api"&&!(n!=null&&n.has("sideBar"))&&((s=(o=this.beans.sideBar)==null?void 0:o.comp)==null||s.setState(e.sideBar)),this.updateCachedState("sideBar",this.getSideBarState())}setupStateOnGridReady(e){this.setGridReadyState(e,"gridInitializing");const t=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:t,sideBarUpdated:t})}updateColumnAndGroupState(){this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState())}setColumnsInitialisedState(e,t,n,o){this.setColumnState(e,t,n,o),this.setColumnGroupState(e,t,o),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const n=o=>()=>this.updateColumnState([o]);this.addManagedEventListeners({columnValueChanged:n("aggregation"),columnMoved:n("columnOrder"),columnPinned:n("columnPinning"),columnResized:n("columnSizing"),columnVisible:n("columnVisibility"),columnPivotChanged:n("pivot"),columnPivotModeChanged:n("pivot"),columnRowGroupChanged:n("rowGroup"),sortChanged:n("sort"),newColumnsLoaded:this.updateColumnAndGroupState.bind(this),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setRowCountState(e,t,n){const{filter:o,rowGroupExpansion:s,ssrmRowGroupExpansion:r,rowSelection:i,pagination:a}=e,l=(u,d)=>!(n!=null&&n.has(u))&&(d||t==="api");l("filter",o)&&this.setFilterState(o),l("rowGroupExpansion",s)&&this.setRowGroupExpansionState(r,s,t),l("rowSelection",i)&&this.setRowSelectionState(i,t),l("pagination",a)&&this.setPaginationState(a,t);const c=this.updateCachedState.bind(this);c("filter",this.getFilterState()),this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(c("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),c("rowGroupExpansion",void 0)):(c("rowGroupExpansion",this.getRowGroupExpansionState()),c("ssrmRowGroupExpansion",void 0)),c("rowSelection",this.getRowSelectionState()),c("pagination",this.getPaginationState())}setupStateOnRowCountReady(e){this.setRowCountState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>{this.updateRowGroupExpansionStateTimer=0,this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(t("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),t("rowGroupExpansion",void 0)):(t("rowGroupExpansion",this.getRowGroupExpansionState()),t("ssrmRowGroupExpansion",void 0))},o=()=>t("filter",this.getFilterState()),{gos:s,colFilter:r}=this.beans;this.addManagedEventListeners({filterChanged:o,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:n,columnRowGroupChanged:n,rowDataUpdated:()=>{(s.get("groupDefaultExpanded")!==0||s.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(n)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:i=>{(i.newPage||i.newPageSize)&&t("pagination",this.getPaginationState())}}),r&&this.addManagedListeners(r,{filterStateChanged:o})}setFirstDataRenderedState(e,t,n){const{scroll:o,cellSelection:s,focusedCell:r,columnOrder:i,rowPinning:a}=e,l=(d,h)=>!(n!=null&&n.has(d))&&(h||t==="api");l("focusedCell",r)&&this.setFocusedCellState(r),l("cellSelection",s)&&this.setCellSelectionState(s),l("scroll",o)&&this.setScrollState(o),l("rowPinning",a)&&this.setRowPinningState(a),this.setColumnPivotState(!!(i!=null&&i.orderedColIds),t);const c=this.updateCachedState.bind(this);c("sideBar",this.getSideBarState()),c("focusedCell",this.getFocusedCellState());const u=this.getRangeSelectionState();c("rangeSelection",u),c("cellSelection",u),c("scroll",this.getScrollState())}setupStateOnFirstDataRendered(e){this.setFirstDataRenderedState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>t("focusedCell",this.getFocusedCellState());this.addManagedEventListeners({cellFocused:n,cellFocusCleared:n,cellSelectionChanged:o=>{if(o.finished){const s=this.getRangeSelectionState();t("rangeSelection",s),t("cellSelection",s)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return Nve(dy(e),e.colModel.isPivotMode())}setColumnState(e,t,n,o){const{sort:s,rowGroup:r,aggregation:i,pivot:a,columnPinning:l,columnVisibility:c,columnSizing:u,columnOrder:d}=e;let h=!1;const f=(T,A)=>{const k=!(o!=null&&o.has(T))&&!!(A||t==="api");return h||(h=k),k},p={},g=T=>{let A=p[T];return A||(A={colId:T},p[T]=A,A)},v={},w=f("sort",s);w&&(s==null||s.sortModel.forEach(({colId:T,sort:A},k)=>{const P=g(T);P.sort=A,P.sortIndex=k})),(w||!n)&&(v.sort=null,v.sortIndex=null);const S=f("rowGroup",r);S&&(r==null||r.groupColIds.forEach((T,A)=>{const k=g(T);k.rowGroup=!0,k.rowGroupIndex=A})),(S||!n)&&(v.rowGroup=null,v.rowGroupIndex=null);const b=f("aggregation",i);b&&(i==null||i.aggregationModel.forEach(({colId:T,aggFunc:A})=>{g(T).aggFunc=A})),(b||!n)&&(v.aggFunc=null);const C=f("pivot",a);C&&(a==null||a.pivotColIds.forEach((T,A)=>{const k=g(T);k.pivot=!0,k.pivotIndex=A}),this.gos.updateGridOptions({options:{pivotMode:!!(a!=null&&a.pivotMode)},source:t})),(C||!n)&&(v.pivot=null,v.pivotIndex=null);const _=f("columnPinning",l);if(_){for(const T of(l==null?void 0:l.leftColIds)??[])g(T).pinned="left";for(const T of(l==null?void 0:l.rightColIds)??[])g(T).pinned="right"}(_||!n)&&(v.pinned=null);const E=f("columnVisibility",c);if(E)for(const T of(c==null?void 0:c.hiddenColIds)??[])g(T).hide=!0;(E||!n)&&(v.hide=null);const x=f("columnSizing",u);if(x)for(const{colId:T,flex:A,width:k}of(u==null?void 0:u.columnSizingModel)??[]){const P=g(T);P.flex=A??null,P.width=k}(x||!n)&&(v.flex=null);const I=d==null?void 0:d.orderedColIds,F=!!(I!=null&&I.length)&&!(o!=null&&o.has("columnOrder")),M=F?I.map(T=>g(T)):Object.values(p);(M.length||h)&&(this.columnStates=M,Ur(this.beans,{state:M,applyOrder:F,defaultState:v},t))}setColumnPivotState(e,t){const n=this.columnStates;this.columnStates=void 0;const o=this.columnGroupStates;this.columnGroupStates=void 0;const s=this.beans,{pivotResultCols:r,colGroupSvc:i}=s;if(r!=null&&r.isPivotResultColsPresent()){if(n){const a=[];for(const l of n)r.getPivotResultCol(l.colId)&&a.push(l);Ur(s,{state:a,applyOrder:e},t)}o&&(i==null||i.setColumnGroupState(o,t))}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return Lve(t)}setColumnGroupState(e,t,n){var a;const o=this.beans.colGroupSvc;if(!o||n!=null&&n.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const s=new Set((a=e.columnGroup)==null?void 0:a.openColumnGroupIds),i=o.getColumnGroupState().map(({groupId:l})=>{const c=s.has(l);return c&&s.delete(l),{groupId:l,open:c}});for(const l of s)i.push({groupId:l,open:!0});i.length&&(this.columnGroupStates=i),o.setColumnGroupState(i,t)}getFilterState(){const e=this.beans.filterManager;let t=e==null?void 0:e.getFilterModel();t&&Object.keys(t).length===0&&(t=void 0);const n=e==null?void 0:e.getFilterState(),o=(e==null?void 0:e.getAdvFilterModel())??void 0;return t||o||n?{filterModel:t,columnFilterState:n,advancedFilterModel:o}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:n,columnFilterState:o,advancedFilterModel:s}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(n!==void 0||o!==void 0)&&(t==null||t.setFilterState(n??null,o??null,"columnFilter")),s!==void 0&&(t==null||t.setAdvFilterModel(s??null,"advancedFilter"))}getRangeSelectionState(){var t;const e=(t=this.beans.rangeSvc)==null?void 0:t.getCellRanges().map(n=>{const{id:o,type:s,startRow:r,endRow:i,columns:a,startColumn:l}=n;return{id:o,type:s,startRow:r,endRow:i,colIds:a.map(c=>c.getColId()),startColId:l.getColId()}});return e!=null&&e.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeSvc:n,colModel:o,visibleCols:s}=this.beans;if(!ha(t)||!n)return;const r=[];for(const i of(e==null?void 0:e.cellRanges)??[]){const a=[];for(const c of i.colIds){const u=o.getCol(c);u&&a.push(u)}if(!a.length)continue;let l=o.getCol(i.startColId);if(!l){const c=s.allCols,u=new Set(a);l=c.find(d=>u.has(d))}r.push({...i,columns:a,startColumn:l})}n.setCellRanges(r)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.beans.ctrlsSvc.getScrollFeature(),{left:t}=(e==null?void 0:e.getHScrollPosition())??{left:0},{top:n}=(e==null?void 0:e.getVScrollPosition())??{top:0};return n||t?{top:n,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:n}=e??{top:0,left:0},{frameworkOverrides:o,rowRenderer:s,animationFrameSvc:r,ctrlsSvc:i}=this.beans;o.wrapIncoming(()=>{var a;i.get("center").setCenterViewportScrollLeft(n),(a=i.getScrollFeature())==null||a.setVerticalScrollPosition(t),s.redraw({afterScroll:!0}),r==null||r.flushAllFrames()})}getSideBarState(){var e,t;return(t=(e=this.beans.sideBar)==null?void 0:e.comp)==null?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.beans.focusSvc.getFocusedCell();if(e){const{column:t,rowIndex:n,rowPinned:o}=e;return{colId:t.getColId(),rowIndex:n,rowPinned:o}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:n}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:o,rowIndex:s,rowPinned:r}=e;t.setFocusedCell({column:n.getCol(o),rowIndex:s,rowPinned:r,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const n=e.getCurrentPage(),o=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!n&&!o))return{page:n,pageSize:o}}setPaginationState(e,t){const{pagination:n,gos:o}=this.beans;if(!n)return;const{pageSize:s,page:r}=e??{page:0,pageSize:o.get("paginationPageSize")},i=t==="gridInitializing";s&&!o.get("paginationAutoPageSize")&&n.setPageSize(s,i?"initialState":"pageSizeSelector"),typeof r=="number"&&(i?n.setPage(r):n.goToPage(r))}getRowSelectionState(){var o;const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!((o=t==null?void 0:t.toggledNodes)!=null&&o.length)?void 0:t}setRowSelectionState(e,t){var n;(n=this.beans.selectionSvc)==null||n.setSelectionState(e,t,t==="api")}getRowGroupExpansionState(){const{expansionSvc:e}=this.beans;if(e)return e.getExpansionState()}getRowPinningState(){var e;return(e=this.beans.pinnedRowModel)==null?void 0:e.getPinnedState()}setRowPinningState(e){const t=this.beans.pinnedRowModel;e?t==null||t.setPinnedState(e):t==null||t.reset()}setRowGroupExpansionState(e,t,n){const o=this.beans.expansionSvc;if(!o)return;const s=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};o.setExpansionState(s,n)}updateColumnState(e){const t=this.getColumnState();let n=!1;const o=this.cachedState;for(const s of Object.keys(t)){const r=t[s];Yf(r,o[s])||(n=!0)}this.cachedState={...o,...t},n&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const n=this.cachedState[e];this.setCachedStateValue(e,t),Yf(t,n)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState={...this.cachedState,[e]:t}}refreshStaleState(){const e=this.staleStateKeys;for(const t of e)t==="rowSelection"&&this.setCachedStateValue(t,this.getRowSelectionState());e.clear()}dispatchStateUpdateEvent(e){if(!this.suppressEvents){for(const t of e)this.queuedUpdateSources.add(t);this.dispatchStateUpdateEventDebounced()}}dispatchQueuedStateUpdateEvents(){const e=this.queuedUpdateSources,t=Array.from(e);e.clear(),this.eventSvc.dispatchEvent({type:"stateUpdated",sources:t,state:this.cachedState})}startSuppressEvents(){var e;this.suppressEvents=!0,(e=this.beans.colAnimation)==null||e.setSuppressAnimation(!0)}stopSuppressEvents(e){setTimeout(()=>{var t;this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&((t=this.beans.colAnimation)==null||t.setSuppressAnimation(!1),this.dispatchStateUpdateEvent([e]))})}suppressEventsAndDispatchInitEvent(e){this.startSuppressEvents(),e(),this.stopSuppressEvents("gridInitializing")}},Hbe={moduleName:"GridState",version:dt,beans:[$be],apiFunctions:{getState:Nbe,setState:Lbe}};function Gbe(e){return e.rowModel.isLastRowIndexKnown()}function Ube(e){var t;return((t=e.pagination)==null?void 0:t.getPageSize())??100}function Wbe(e){var t;return((t=e.pagination)==null?void 0:t.getCurrentPage())??0}function zbe(e){var t;return((t=e.pagination)==null?void 0:t.getTotalPages())??1}function jbe(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function Kbe(e){var t;(t=e.pagination)==null||t.goToNextPage()}function qbe(e){var t;(t=e.pagination)==null||t.goToPreviousPage()}function Ybe(e){var t;(t=e.pagination)==null||t.goToFirstPage()}function Zbe(e){var t;(t=e.pagination)==null||t.goToLastPage()}function Xbe(e,t){var n;(n=e.pagination)==null||n.goToPage(t)}var Jbe=class extends We{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeSvc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.centerRowsCtrl=e.center;const t=this.checkPageSize.bind(this);this.addManagedEventListeners({bodyHeightChanged:t,scrollVisibilityChanged:t}),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||this.centerRowsCtrl==null}onPaginationAutoSizeChanged(){this.notActive()?this.beans.pagination.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.viewportSizeFeature.getBodyHeight();if(e>0){const t=this.beans,n=()=>{const o=Math.max(Rc(t),1),s=Math.floor(e/o);t.pagination.setPageSize(s,"autoCalculated")};this.isBodyRendered?Lo(this,n,50)():(n(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},Pp="paginationPageSizeSelector",Qbe={tag:"span",cls:"ag-paging-page-size"},eSe=class extends bn{constructor(){super(Qbe),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.pagination.getPageSize()||(this.pagination.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}wireBeans(e){this.pagination=e.pagination}postConstruct(){this.addManagedPropertyListener(Pp,()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedEventListeners({paginationChanged:e=>this.handlePaginationChanged(e)})}handlePaginationChanged(e){if(!this.selectPageSizeComp||!(e!=null&&e.newPageSize))return;const t=this.pagination.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&!e&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp)}reset(){No(this.getGui()),this.selectPageSizeComp&&(this.selectPageSizeComp=this.destroyBean(this.selectPageSizeComp))}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel")&&!this.gos.get("paginationAutoPageSize")&&this.gos.get(Pp)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),n=!t||!e.includes(t);if(n){const s=this.gos.exists("paginationPageSize"),r=this.gos.get(Pp)!==!0;Je(94,{pageSizeSet:s,pageSizesSet:r,pageSizeOptions:e,paginationPageSizeOption:t}),r||Je(95,{paginationPageSizeOption:t,paginationPageSizeSelector:Pp}),e.unshift("")}const o=String(n?"":t);this.selectPageSizeComp?(dl(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(o,!0)):this.createPageSizeSelectorComp(e,o),this.hasEmptyOption=n}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const n=this.getLocaleTextFunc(),o=n("pageSizeSelectorLabel","Page Size:"),s=n("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new B0).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(s).setLabel(o).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(Pp);return!Array.isArray(t)||!(t!=null&&t.length)?e:[...t].sort((n,o)=>n-o)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},tSe={selector:"AG-PAGE-SIZE-SELECTOR",component:eSe},nSe=".ag-paging-panel{align-items:center;border-top:var(--ag-footer-row-border);display:flex;gap:calc(var(--ag-spacing)*4);height:var(--ag-pagination-panel-height);justify-content:flex-end;padding:0 var(--ag-cell-horizontal-padding)}:where(.ag-paging-page-size) .ag-wrapper{min-width:50px}.ag-paging-page-summary-panel{align-items:center;display:flex;gap:var(--ag-cell-widget-spacing);.ag-disabled &{pointer-events:none}}.ag-paging-button{cursor:pointer;position:relative;&.ag-disabled{cursor:default;opacity:.5}}.ag-paging-number,.ag-paging-row-summary-panel-number{font-weight:500}",oSe=class extends $V{constructor(){super(),this.btFirst=ht,this.btPrevious=ht,this.btNext=ht,this.btLast=ht,this.lbRecordCount=ht,this.lbFirstRowOnPage=ht,this.lbLastRowOnPage=ht,this.lbCurrent=ht,this.lbTotal=ht,this.pageSizeComp=ht,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(nSe)}wireBeans(e){this.rowModel=e.rowModel,this.pagination=e.pagination,this.ariaAnnounce=e.ariaAnnounce}postConstruct(){const e=this.gos.get("enableRtl");this.setTemplate(this.getTemplate(),[tSe]);const{btFirst:t,btPrevious:n,btNext:o,btLast:s}=this;this.activateTabIndex([t,n,o,s]),t.insertAdjacentElement("afterbegin",hr(e?"last":"first",this.beans)),n.insertAdjacentElement("afterbegin",hr(e?"next":"previous",this.beans)),o.insertAdjacentElement("afterbegin",hr(e?"previous":"next",this.beans)),s.insertAdjacentElement("afterbegin",hr(e?"first":"last",this.beans)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],()=>this.onPageSizeRelatedOptionsChange()),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:r=>this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(r):Jue(this.beans,r),forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}onPaginationChanged(){const t=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(t),t&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){if(!this.areListenersSetup){this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)});for(const e of[{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)}]){const{el:t,fn:n}=e;this.addManagedListeners(t,{click:n,keydown:o=>{(o.key===Oe.ENTER||o.key===Oe.SPACE)&&(o.preventDefault(),n())}})}Xue(this.beans,this,this.getGui()),this.areListenersSetup=!0}}onBtFirst(){this.previousAndFirstButtonsDisabled||this.pagination.goToFirstPage()}formatNumber(e){const t=this.gos.getCallback("paginationNumberFormatter");return t?t({value:e}):Vve(e,this.getLocaleTextFunc.bind(this))}getTemplate(){const e=this.getLocaleTextFunc(),t=`ag-${this.getCompId()}`;return{tag:"div",cls:"ag-paging-panel ag-unselectable",attrs:{id:`${t}`},children:[{tag:"ag-page-size-selector",ref:"pageSizeComp"},{tag:"span",cls:"ag-paging-row-summary-panel",children:[{tag:"span",ref:"lbFirstRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-first-row`}},{tag:"span",attrs:{id:`${t}-to`},children:e("to","to")},{tag:"span",ref:"lbLastRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-last-row`}},{tag:"span",attrs:{id:`${t}-of`},children:e("of","of")},{tag:"span",ref:"lbRecordCount",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-row-count`}}]},{tag:"span",cls:"ag-paging-page-summary-panel",role:"presentation",children:[{tag:"div",ref:"btFirst",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("firstPage","First Page")}},{tag:"div",ref:"btPrevious",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("previousPage","Previous Page")}},{tag:"span",cls:"ag-paging-description",children:[{tag:"span",attrs:{id:`${t}-start-page`},children:e("page","Page")},{tag:"span",ref:"lbCurrent",cls:"ag-paging-number",attrs:{id:`${t}-start-page-number`}},{tag:"span",attrs:{id:`${t}-of-page`},children:e("of","of")},{tag:"span",ref:"lbTotal",cls:"ag-paging-number",attrs:{id:`${t}-of-page-number`}}]},{tag:"div",ref:"btNext",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("nextPage","Next Page")}},{tag:"div",ref:"btLast",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("lastPage","Last Page")}}]}]}}onBtNext(){this.nextButtonDisabled||this.pagination.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.pagination.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.pagination.goToLastPage()}enableOrDisableButtons(){const e=this.pagination.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),n=this.pagination.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const o=this.isZeroPagesToDisplay(),s=e===n-1;this.nextButtonDisabled=s||o,this.lastButtonDisabled=!t||o||e===n-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){hie(e,t),e.classList.toggle("ag-disabled",t)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages();return e&&t===0}updateLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages(),n=this.pagination.getMasterRowCount(),o=e?n:null,s=this.pagination.getCurrentPage(),r=this.pagination.getPageSize();let i,a;this.isZeroPagesToDisplay()?i=a=0:(i=r*s+1,a=i+r-1,e&&a>o&&(a=o));const l=i+r-1,c=!e&&n<l,u=this.formatNumber(i);this.lbFirstRowOnPage.textContent=u;let d;const h=this.getLocaleTextFunc();c?d=h("pageLastRowUnknown","?"):d=this.formatNumber(a),this.lbLastRowOnPage.textContent=d;const p=t>0?s+1:0,g=this.formatNumber(p);this.lbCurrent.textContent=g;let v,w;if(e)v=this.formatNumber(t),w=this.formatNumber(o);else{const S=h("more","more");v=S,w=S}this.lbTotal.textContent=v,this.lbRecordCount.textContent=w,this.announceAriaStatus(u,d,w,g,v)}announceAriaStatus(e,t,n,o,s){var d,h;const r=this.getLocaleTextFunc(),i=r("page","Page"),a=r("to","to"),l=r("of","of"),c=`${e} ${a} ${t} ${l} ${n}`,u=`${i} ${o} ${l} ${s}`;c!==this.ariaRowStatus&&(this.ariaRowStatus=c,(d=this.ariaAnnounce)==null||d.announceValue(c,"paginationRow")),u!==this.ariaPageStatus&&(this.ariaPageStatus=u,(h=this.ariaAnnounce)==null||h.announceValue(u,"paginationPage"))}},sSe={selector:"AG-PAGINATION",component:oSe},rSe=class extends We{constructor(){super(...arguments),this.beanName="pagination",this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.masterRowCount=0}postConstruct(){const e=this.gos;this.active=e.get("pagination"),this.pageSizeFromGridOptions=e.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this))}getPaginationSelector(){return sSe}isPaginateChildRows(){const e=this.gos;return e.get("groupHideParentOfSingleChild")||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")?!0:e.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){const t=this.currentPage;if(!this.active||t===e||typeof t!="number")return;const{editSvc:n}=this.beans;n!=null&&n.isEditing()&&(n.isBatchEditing()?n.cleanupEditors():n.stopEditing(void 0,{source:"api"})),this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0})}goToPageWithIndex(e){var n,o;if(!this.active)return;let t=e;this.paginateChildRows||(t=((o=(n=this.beans.rowModel).getTopLevelIndexFromDisplayedIndex)==null?void 0:o.call(n,e))??e),this.goToPage(Math.floor(t/this.pageSize))}isRowInPage(e){return this.active?e>=this.topDisplayedRowIndex&&e<=this.bottomDisplayedRowIndex:!0}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.beans.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return ft(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:ft(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:ft(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:ft(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.beans.pageBounds.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(this.pageSizeAutoCalculated===void 0)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const n=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,this.currentPage!==0&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,this.currentPage!==0&&this.goToFirstPage();break}n!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){const e=this.totalPages;this.currentPage>=e&&(this.currentPage=e-1);const t=this.currentPage;(!isFinite(t)||isNaN(t)||t<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){const e=this.beans.rowModel,t=e.getTopLevelRowCount();if(this.masterRowCount=t,t<=0){this.setZeroRows();return}const n=this.pageSize,o=t-1;this.totalPages=Math.floor(o/n)+1,this.adjustCurrentPageIfInvalid();const s=this.currentPage,r=n*s;let i=n*(s+1)-1;if(i>o&&(i=o),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(r),i===o)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=a-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){const e=this.beans.rowModel.getRowCount();if(this.masterRowCount=e,e===0){this.setZeroRows();return}const{pageSize:t,currentPage:n}=this,o=e-1;this.totalPages=Math.floor(o/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*n,this.bottomDisplayedRowIndex=t*(n+1)-1,this.bottomDisplayedRowIndex>o&&(this.bottomDisplayedRowIndex=o)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.beans.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:n=!1,newPageSize:o=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:n,newPageSize:o,keepRenderedRows:t})}},iSe={moduleName:"Pagination",version:dt,beans:[rSe,Jbe],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:Gbe,paginationGetPageSize:Ube,paginationGetCurrentPage:Wbe,paginationGetTotalPages:zbe,paginationGetRowCount:jbe,paginationGoToNextPage:Kbe,paginationGoToPreviousPage:qbe,paginationGoToFirstPage:Ybe,paginationGoToLastPage:Zbe,paginationGoToPage:Xbe},dependsOn:[Uy]};function aSe(e,t={}){const n=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(n))}function F$(e,t,n,o,s){t&&(o&&t.parent&&t.parent.level!==-1&&F$(e,t.parent,n,o,s),t.setExpanded(n,void 0,s))}function lSe(e,t){return e.rowModel.getRowNode(t)}function cSe(e,t,n,o){e.rowRenderer.addRenderedRowListener(t,n,o)}function uSe(e){return e.rowRenderer.getRenderedNodes()}function dSe(e,t,n){e.rowModel.forEachNode(t,n)}function hSe(e){return e.rowRenderer.firstRenderedRow}function fSe(e){return e.rowRenderer.lastRenderedRow}function pSe(e,t){return e.rowModel.getRow(t)}function gSe(e){return e.rowModel.getRowCount()}var mSe={moduleName:"RowApi",version:dt,apiFunctions:{redrawRows:aSe,setRowNodeExpanded:F$,getRowNode:lSe,addRenderedRowListener:cSe,getRenderedNodes:uSe,forEachNode:dSe,getFirstDisplayedRowIndex:hSe,getLastDisplayedRowIndex:fSe,getDisplayedRowAtIndex:pSe,getDisplayedRowCount:gSe}},vSe={moduleName:"ScrollApi",version:dt,apiFunctions:{getVerticalPixelRange:Fwe,getHorizontalPixelRange:Pwe,ensureColumnVisible:d$,ensureIndexVisible:h$,ensureNodeVisible:kwe}};function ySe(e,t,n){if(!t)return;const o=e.ctrlsSvc.getGridBodyCtrl().eGridBody,s=`aria-${t}`;n===null?o.removeAttribute(s):o.setAttribute(s,n)}function wSe(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function CSe(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function bSe(e){var t;return((t=e.animationFrameSvc)==null?void 0:t.isQueueEmpty())??!0}function SSe(e){var t;(t=e.animationFrameSvc)==null||t.flushAllFrames()}function ESe(e){return{rowHeight:Rc(e),headerHeight:yp(e)}}function _Se(e,t={}){var r;const n=[];for(const i of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const a=i.getCellRenderer();a!=null&&n.push(gp(a))}if((r=t.columns)!=null&&r.length)return n;const o=[],s=N_(t.rowNodes);for(const i of e.rowRenderer.getAllRowCtrls()){if(s&&!L_(i.rowNode,s)||!i.isFullWidth())continue;const a=i.getFullWidthCellRenderers();for(let l=0;l<a.length;l++){const c=a[l];c!=null&&o.push(gp(c))}}return[...o,...n]}var RSe={moduleName:"RenderApi",version:dt,apiFunctions:{setGridAriaProperty:ySe,refreshCells:wSe,refreshHeader:CSe,isAnimationFrameQueueEmpty:bSe,flushAllAnimationFrames:SSe,getSizesForCurrentTheme:ESe,getCellRendererInstances:_Se}};function DSe(e,t){var n,o;typeof t=="number"?(n=e.colAutosize)==null||n.sizeColumnsToFit(t,"api"):(o=e.colAutosize)==null||o.sizeColumnsToFitGridBody(t)}function P$({colAutosize:e,visibleCols:t},n,o){Array.isArray(n)?e==null||e.autoSizeCols({colKeys:n,skipHeader:o,source:"api"}):e==null||e.autoSizeCols({...n,colKeys:n.colIds??t.allCols,source:"api"})}function TSe(e,t){var n;t&&typeof t=="object"?P$(e,t):(n=e.colAutosize)==null||n.autoSizeAllColumns({source:"api",skipHeader:t})}var ISe=class extends We{constructor(){super(...arguments),this.beanName="colAutosize",this.timesDelayed=0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}postConstruct(){var n;const{gos:e}=this,t=e.get("autoSizeStrategy");if(t){let o=!1;const s=t.type;if(s==="fitGridWidth"||s==="fitProvidedWidth")o=!0;else if(s==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const r=e.get("rowData");o=r!=null&&r.length>0&&ro(e)}o&&((n=this.beans.colDelayRenderSvc)==null||n.hideColumns(s))}}autoSizeCols(e){const{eventSvc:t,visibleCols:n}=this.beans;this.innerAutoSizeCols(e).then(o=>{var c;const s=u=>Td(t,Array.from(u),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return s(o);const r=k$(this.beans),i=u=>n.leftCols.some(d=>hp(d,u)),a=u=>n.rightCols.some(d=>hp(d,u)),l=e.colKeys.filter(u=>!pa(u)&&!ga(u)&&!i(u)&&!a(u));this.sizeColumnsToFit(r,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:(c=e.columnLimits)==null?void 0:c.map(u=>({...u,key:u.colId})),colKeys:l,onlyScaleUp:!0}),s(o)})}innerAutoSizeCols(e){return new Promise((t,n)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,n));const{colKeys:o,skipHeader:s,skipHeaderGroups:r,stopAtGroup:i,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:c=[],source:u="api"}=e,{animationFrameSvc:d,renderStatus:h,colModel:f,autoWidthCalc:p,visibleCols:g}=this.beans;if(d==null||d.flushAllFrames(),this.timesDelayed<5&&h&&(!h.areHeaderCellsRendered()||!h.areCellsRendered())){this.timesDelayed++,setTimeout(()=>{this.isAlive()&&this.innerAutoSizeCols(e).then(t,n)});return}this.timesDelayed=0;const v=new Set;let w=-1;const S=Object.fromEntries(c.map(({colId:_,...E})=>[_,E])),b=s??this.gos.get("skipHeaderOnAutoSize"),C=r??b;for(;w!==0;){w=0;const _=[];for(const E of o){if(!E||Rae(E))continue;const x=f.getCol(E);if(!x||v.has(x))continue;const I=p.getPreferredWidthForColumn(x,b);if(I>0){const F=S[x.colId]??{};F.minWidth??(F.minWidth=l),F.maxWidth??(F.maxWidth=a);const M=xSe(x,I,F);x.setActualWidth(M,u),v.add(x),w++}_.push(x)}_.length&&g.refresh(u)}C||this.autoSizeColumnGroupsByColumns(o,u,i),t(v)})}autoSizeColumn(e,t,n){this.autoSizeCols({colKeys:[e],skipHeader:n,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,n){const{colModel:o,ctrlsSvc:s}=this.beans,r=new Set,i=o.getColsForKeys(e);for(const l of i){let c=l.getParent();for(;c&&c!=n;)c.isPadding()||r.add(c),c=c.getParent()}let a;for(const l of r){for(const c of s.getHeaderRowContainerCtrls())if(a=c.getHeaderCtrlForColumn(l),a)break;a==null||a.resizeLeafColumnsToFit(t)}}autoSizeAllColumns(e){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.autoSizeAllColumns(e));return}this.autoSizeCols({colKeys:this.beans.visibleCols.allCols,...e})}addColumnAutosizeListeners(e,t){const n=this.gos.get("skipHeaderOnAutoSize"),o=()=>{this.autoSizeColumn(t,"uiColumnResized",n)};e.addEventListener("dblclick",o);const s=new Mc(e);return s.addEventListener("doubleTap",o),()=>{e.removeEventListener("dblclick",o),s.destroy()}}addColumnGroupResize(e,t,n){const o=this.gos.get("skipHeaderOnAutoSize"),s=()=>{const r=[],i=t.getDisplayedLeafColumns();for(const a of i)a.getColDef().suppressAutoSize||r.push(a.getColId());r.length>0&&this.autoSizeCols({colKeys:r,skipHeader:o,stopAtGroup:t,source:"uiColumnResized"}),n()};return e.addEventListener("dblclick",s),()=>e.removeEventListener("dblclick",s)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const n=k$(this.beans);if(n>0){this.sizeColumnsToFit(n,"sizeColumnsToFit",!1,e);return}t===void 0?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,100)},0):t===100?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,500)},100):t===500?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,-1)},500):Je(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",n,o){var p,g;if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,n,o));return}const s={};for(const{key:v,...w}of(o==null?void 0:o.columnLimits)??[])s[typeof v=="string"?v:v.getColId()]=w;const r=this.beans.visibleCols.allCols;if(e<=0||!r.length)return;const i=fa(r);if(o!=null&&o.onlyScaleUp&&i>e||e===i&&r.every(w=>{if(w.colDef.suppressSizeToFit)return!0;const S=s==null?void 0:s[w.getId()],b=(S==null?void 0:S.minWidth)??(o==null?void 0:o.defaultMinWidth),C=(S==null?void 0:S.maxWidth)??(o==null?void 0:o.defaultMaxWidth),_=w.getActualWidth();return(b==null||_>=b)&&(C==null||_<=C)}))return;const l=[],c=[];for(const v of r){const w=((p=o==null?void 0:o.colKeys)==null?void 0:p.some(S=>hp(v,S)))??!0;v.getColDef().suppressSizeToFit||!w?c.push(v):l.push(v)}const u=l.slice(0);let d=!1;const h=v=>{Gr(l,v),c.push(v)};for(const v of l){v.resetActualWidth(t);const w=s==null?void 0:s[v.getId()],S=(w==null?void 0:w.minWidth)??(o==null?void 0:o.defaultMinWidth),b=(w==null?void 0:w.maxWidth)??(o==null?void 0:o.defaultMaxWidth),C=v.getActualWidth();typeof S=="number"&&C<S?v.setActualWidth(S,t,!0):typeof b=="number"&&C>b&&v.setActualWidth(b,t,!0)}for(;!d;){d=!0;const v=e-fa(c);if(v<=0)for(const w of l){const S=((g=s==null?void 0:s[w.getId()])==null?void 0:g.minWidth)??(o==null?void 0:o.defaultMinWidth)??w.minWidth;w.setActualWidth(S,t,!0)}else{const w=v/fa(l);let S=v;for(let b=l.length-1;b>=0;b--){const C=l[b],_=s==null?void 0:s[C.getId()],E=(_==null?void 0:_.minWidth)??(o==null?void 0:o.defaultMinWidth),x=(_==null?void 0:_.maxWidth)??(o==null?void 0:o.defaultMaxWidth),I=C.getMinWidth(),F=C.getMaxWidth(),M=typeof E=="number"&&E>I?E:I,T=typeof x=="number"&&x<F?x:F;let A=Math.round(C.getActualWidth()*w);A<M?(A=M,h(C),d=!1):A>T?(A=T,h(C),d=!1):b===0&&(A=S),C.setActualWidth(A,t,!0),S-=A}}}for(const v of u)v.fireColumnWidthChangedEvent(t);const f=this.beans.visibleCols;f.setLeftValues(t),f.updateBodyWidths(),!n&&Td(this.eventSvc,u,!0,t)}applyAutosizeStrategy(){const{gos:e,colDelayRenderSvc:t}=this.beans,n=e.get("autoSizeStrategy");(n==null?void 0:n.type)!=="fitGridWidth"&&(n==null?void 0:n.type)!=="fitProvidedWidth"||setTimeout(()=>{if(!this.isAlive())return;const o=n.type;if(o==="fitGridWidth"){const{columnLimits:s,defaultMinWidth:r,defaultMaxWidth:i}=n,a=s==null?void 0:s.map(({colId:l,minWidth:c,maxWidth:u})=>({key:l,minWidth:c,maxWidth:u}));this.sizeColumnsToFitGridBody({defaultMinWidth:r,defaultMaxWidth:i,columnLimits:a})}else o==="fitProvidedWidth"&&this.sizeColumnsToFit(n.width,"sizeColumnsToFit");t==null||t.revealColumns(o)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{var o;if(!this.isAlive())return;const n="autosizeColumns";e?this.autoSizeCols({...t,source:n,colKeys:e}):this.autoSizeAllColumns({...t,source:n}),(o=this.beans.colDelayRenderSvc)==null||o.revealColumns(t.type)})}processResizeOperations(){this.shouldQueueResizeOperations=!1;for(const e of this.resizeOperationQueue)e();this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}destroy(){this.resizeOperationQueue.length=0,super.destroy()}};function xSe(e,t,n={}){const o=n.minWidth??e.getMinWidth();t<o&&(t=o);const s=n.maxWidth??e.getMaxWidth();return t>s&&(t=s),t}function k$({ctrlsSvc:e,scrollVisibleSvc:t}){const n=e.getGridBodyCtrl(),s=n.isVerticalScrollShowing()?t.getScrollbarWidth():0;return ep(n.eGridBody)-s}var FSe={moduleName:"ColumnAutoSize",version:dt,beans:[ISe],apiFunctions:{sizeColumnsToFit:DSe,autoSizeColumns:P$,autoSizeAllColumns:TSe},dependsOn:[oB]},PSe=".ag-row-pinned-source{background-color:var(--ag-pinned-source-row-background-color);color:var(--ag-pinned-source-row-text-color);font-weight:var(--ag-pinned-source-row-font-weight)}.ag-row-pinned-manual{background-color:var(--ag-pinned-row-background-color);color:var(--ag-pinned-row-text-color);font-weight:var(--ag-pinned-row-font-weight)}";function kSe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedTopRowCount())??0}function ASe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedBottomRowCount())??0}function OSe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedTopRow(t)}function MSe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedBottomRow(t)}function NSe(e,t,n){var o;return(o=e.pinnedRowModel)==null?void 0:o.forEachPinnedRow(t,n)}var LSe={moduleName:"PinnedRow",version:dt,beans:[Ode],css:[PSe],apiFunctions:{getPinnedTopRowCount:kSe,getPinnedBottomRowCount:ASe,getPinnedTopRow:OSe,getPinnedBottomRow:MSe,forEachPinnedRow:NSe},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},VSe=class{constructor(e,t){this.col=e,this.firstNode=t,this.cellSpan=!0,this.spannedNodes=new Set,this.addSpannedNode(t)}reset(){this.spannedNodes.clear(),this.addSpannedNode(this.firstNode)}addSpannedNode(e){this.spannedNodes.add(e),this.lastNode=e}getLastNode(){return this.lastNode}getCellHeight(){return this.lastNode.rowTop+this.lastNode.rowHeight-this.firstNode.rowTop-1}doesSpanContain(e){return e.column!==this.col||e.rowPinned!=this.firstNode.rowPinned?!1:this.firstNode.rowIndex<=e.rowIndex&&e.rowIndex<=this.lastNode.rowIndex}getLastNodeAutoHeight(){var n;const e=(n=this.firstNode.__autoHeights)==null?void 0:n[this.col.getColId()];if(e==null)return;let t=0;for(const o of this.spannedNodes)o!==this.lastNode&&(t+=o.rowHeight);return e-t}},BSe=class extends We{constructor(e){super(),this.column=e}buildCache(e){var b;const{column:t,beans:{gos:n,pinnedRowModel:o,rowModel:s,valueSvc:r,pagination:i}}=this,{colDef:a}=t,l=this.getNodeMap(e),c=new Map,u=n.getCallback("isFullWidthRow"),d=a.equals,h=a.spanRows,f=typeof h=="function";let p=null,g=null,v;const w=(C,_)=>{p=C,g=null,v=_},S=C=>{const _=!C.isExpandable()&&!C.group&&!C.detail&&(u?!u({rowNode:C}):!0);if(C.rowIndex==null||!_){w(null,null);return}if(p==null||C.level!==p.level||C.footer||g&&C.rowIndex-1!==(g==null?void 0:g.getLastNode().rowIndex)){w(C,r.getValue(t,C));return}const E=r.getValue(t,C);if(f){const x=Pt(n,{valueA:v,nodeA:p,valueB:E,nodeB:C,column:t,colDef:a});if(!h(x)){w(C,E);return}}else if(d?!d(v,E):v!==E){w(C,E);return}if(!g){const x=l==null?void 0:l.get(p);(x==null?void 0:x.firstNode)===p?(x.reset(),g=x):g=new VSe(t,p),c.set(p,g)}g.addSpannedNode(C),c.set(C,g)};switch(e){case"center":(b=s.forEachDisplayedNode)==null||b.call(s,C=>{(!i||i.isRowInPage(C.rowIndex))&&S(C)}),this.centerValueNodeMap=c;break;case"top":o==null||o.forEachPinnedRow("top",S),this.topValueNodeMap=c;break;case"bottom":o==null||o.forEachPinnedRow("bottom",S),this.bottomValueNodeMap=c;break}}isCellSpanning(e){return!!this.getCellSpan(e)}getCellSpan(e){return this.getNodeMap(e.rowPinned).get(e)}getNodeMap(e){switch(e){case"top":return this.topValueNodeMap;case"bottom":return this.bottomValueNodeMap;default:return this.centerValueNodeMap}}},$Se=class extends We{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=Lo(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=Lo(this,this.dispatchCellsUpdatedEvent.bind(this,!1),0),this.pinnedTimeout=null,this.modelTimeout=null}postConstruct(){const e=this.onRowDataUpdated.bind(this),t=this.buildPinnedCaches.bind(this);this.addManagedEventListeners({paginationChanged:this.buildModelCaches.bind(this),pinnedRowDataChanged:t,pinnedRowsChanged:t,rowNodeDataChanged:e,cellValueChanged:e})}register(e){const{gos:t}=this.beans;if(!t.get("enableCellSpan")||this.spanningColumns.has(e))return;const n=this.createManagedBean(new BSe(e));this.spanningColumns.set(e,n),n.buildCache("top"),n.buildCache("bottom"),n.buildCache("center"),this.debouncePinnedEvent(),this.debounceModelEvent()}dispatchCellsUpdatedEvent(e){this.dispatchLocalEvent({type:"spannedCellsUpdated",pinned:e})}deregister(e){this.spanningColumns.delete(e)}onRowDataUpdated({node:e}){const{spannedRowRenderer:t}=this.beans;if(e.rowPinned){if(this.pinnedTimeout!=null)return;this.pinnedTimeout=window.setTimeout(()=>{this.pinnedTimeout=null,this.buildPinnedCaches(),t==null||t.createCtrls("top"),t==null||t.createCtrls("bottom")},0);return}this.modelTimeout==null&&(this.modelTimeout=window.setTimeout(()=>{this.modelTimeout=null,this.buildModelCaches(),t==null||t.createCtrls("center")},0))}buildModelCaches(){this.modelTimeout!=null&&clearTimeout(this.modelTimeout),this.spanningColumns.forEach(e=>e.buildCache("center")),this.debounceModelEvent()}buildPinnedCaches(){this.pinnedTimeout!=null&&clearTimeout(this.pinnedTimeout),this.spanningColumns.forEach(e=>{e.buildCache("top"),e.buildCache("bottom")}),this.debouncePinnedEvent()}isCellSpanning(e,t){const n=this.spanningColumns.get(e);return n?n.isCellSpanning(t):!1}getCellSpanByPosition(e){const{pinnedRowModel:t,rowModel:n}=this.beans,o=e.column,s=e.rowIndex,r=this.spanningColumns.get(o);if(!r)return;let i;switch(e.rowPinned){case"top":i=t==null?void 0:t.getPinnedTopRow(s);break;case"bottom":i=t==null?void 0:t.getPinnedBottomRow(s);break;default:i=n.getRow(s)}if(i)return r.getCellSpan(i)}getCellStart(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.firstNode.rowIndex}:e}getCellEnd(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.getLastNode().rowIndex}:e}getCellSpan(e,t){const n=this.spanningColumns.get(e);if(n)return n.getCellSpan(t)}forEachSpannedColumn(e,t){for(const[n,o]of this.spanningColumns)if(o.isCellSpanning(e)){const s=o.getCellSpan(e);t(n,s)}}destroy(){super.destroy(),this.spanningColumns.clear()}},HSe=class extends Bd{constructor(e,t,n){super(e.col,e.firstNode,n,t),this.cellSpan=e,this.SPANNED_CELL_CSS_CLASS="ag-spanned-cell"}setComp(e,t,n,o,s,r,i){this.eWrapper=n,super.setComp(e,t,n,o,s,r,i),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||zv(e,t.rowIndex)}setAriaRowSpan(){vie(this.eGui,this.cellSpan.spannedNodes.size)}setFocusedCellPosition(e){this.focusedCellPosition=e}getFocusedCellPosition(){return this.focusedCellPosition??this.cellPosition}checkCellFocused(){const e=this.beans.focusSvc.getFocusedCell();return!!e&&this.cellSpan.doesSpanContain(e)}applyStaticCssClasses(){super.applyStaticCssClasses(),this.comp.toggleCss(this.SPANNED_CELL_CSS_CLASS,!0)}onCellFocused(e){const{beans:t}=this;if(Py(t)){this.focusedCellPosition=void 0;return}const n=this.isCellFocused();n||(this.focusedCellPosition=void 0),e&&n&&(this.focusedCellPosition={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column}),super.onCellFocused(e)}getRootElement(){return this.eWrapper}},GSe=class extends Hy{onRowIndexChanged(){super.onRowIndexChanged();for(const e of this.getAllCellCtrls())e.refreshAriaRowIndex()}getInitialRowClasses(e){return["ag-spanned-row"]}getNewCellCtrl(e){var o;const t=(o=this.beans.rowSpanSvc)==null?void 0:o.getCellSpan(e,this.rowNode);if(!(!t||t.firstNode!==this.rowNode))return new HSe(t,this,this.beans)}isCorrectCtrlForSpan(e){var o;const t=(o=this.beans.rowSpanSvc)==null?void 0:o.getCellSpan(e.column,this.rowNode);return!t||t.firstNode!==this.rowNode?!1:e.getCellSpan()===t}onRowHeightChanged(){}refreshFirstAndLastRowStyles(){}addHoverFunctionality(){}resetHoveredStatus(){}},USe=class extends We{constructor(){super(...arguments),this.beanName="spannedRowRenderer",this.topCtrls=new Map,this.bottomCtrls=new Map,this.centerCtrls=new Map}postConstruct(){this.addManagedEventListeners({displayedRowsChanged:this.createAllCtrls.bind(this)})}createAllCtrls(){this.createCtrls("top"),this.createCtrls("bottom"),this.createCtrls("center")}createCtrls(e){const{rowSpanSvc:t}=this.beans,n=this.getCtrlsMap(e),o=n.size,s=this.getAllRelevantRowControls(e),r=new Map;let i=!1;for(const l of s)l.isAlive()&&(t==null||t.forEachSpannedColumn(l.rowNode,(c,u)=>{if(r.has(u.firstNode))return;const d=n.get(u.firstNode);if(d){r.set(u.firstNode,d),n.delete(u.firstNode);return}i=!0;const h=new GSe(u.firstNode,this.beans,!1,!1,!1);r.set(u.firstNode,h)}));this.setCtrlsMap(e,r);const a=r.size===o;if(!(!i&&a)){for(const l of n.values())l.destroyFirstPass(!0),l.destroySecondPass();this.dispatchLocalEvent({type:"spannedRowsUpdated",ctrlsKey:e})}}getAllRelevantRowControls(e){const{rowRenderer:t}=this.beans;switch(e){case"top":return t.topRowCtrls;case"bottom":return t.bottomRowCtrls;case"center":return t.allRowCtrls}}getCellByPosition(e){const{rowSpanSvc:t}=this.beans,n=t==null?void 0:t.getCellSpanByPosition(e);if(!n)return;const o=this.getCtrlsMap(e.rowPinned).get(n.firstNode);if(o)return o.getAllCellCtrls().find(s=>s.column===e.column)}getCtrls(e){return[...this.getCtrlsMap(e).values()]}destroyRowCtrls(e){for(const t of this.getCtrlsMap(e).values())t.destroyFirstPass(!0),t.destroySecondPass();this.setCtrlsMap(e,new Map)}getCtrlsMap(e){switch(e){case"top":return this.topCtrls;case"bottom":return this.bottomCtrls;default:return this.centerCtrls}}setCtrlsMap(e,t){switch(e){case"top":this.topCtrls=t;break;case"bottom":this.bottomCtrls=t;break;default:this.centerCtrls=t;break}}destroy(){super.destroy(),this.destroyRowCtrls("top"),this.destroyRowCtrls("bottom"),this.destroyRowCtrls("center")}},WSe={moduleName:"CellSpan",version:dt,beans:[$Se,USe]},zSe=class extends We{constructor(e,t){super(),this.cellCtrl=e,this.staticClasses=[],this.beans=t,this.column=e.column}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const{column:e,cellComp:t}=this,n=e.colDef,o=n.cellClassRules,s=this.getCellClassParams(e,n);O_(this.beans.expressionSvc,o===this.cellClassRules?void 0:this.cellClassRules,o,s,r=>t.toggleCss(r,!0),r=>t.toggleCss(r,!1)),this.cellClassRules=o}applyUserStyles(){const e=this.column,t=e.colDef,n=t.cellStyle;if(!n)return;let o;if(typeof n=="function"){const s=this.getCellClassParams(e,t);o=n(s)}else o=n;o&&this.cellComp.setUserStyles(o)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,n=e.colDef,o=this.getCellClassParams(e,n);for(const r of this.staticClasses)t.toggleCss(r,!1);const s=this.beans.cellStyles.getStaticCellClasses(n,o);this.staticClasses=s;for(const r of s)t.toggleCss(r,!0)}getCellClassParams(e,t){const{value:n,rowNode:o}=this.cellCtrl;return Pt(this.beans.gos,{value:n,data:o.data,node:o,colDef:t,column:e,rowIndex:o.rowIndex})}},jSe=class extends We{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,n,o){O_(this.beans.expressionSvc,void 0,e.cellClassRules,t,n,o),this.processStaticCellClasses(e,t,n)}getStaticCellClasses(e,t){const{cellClass:n}=e;if(!n)return[];let o;return typeof n=="function"?o=n(t):o=n,typeof o=="string"&&(o=[o]),o||[]}createCellCustomStyleFeature(e,t){return new zSe(e,t)}processStaticCellClasses(e,t,n){this.getStaticCellClasses(e,t).forEach(s=>{n(s)})}},KSe={moduleName:"CellStyle",version:dt,beans:[jSe]},qSe={moduleName:"RowStyle",version:dt,beans:[Ome]};function YSe(e,t){var n;return!!((n=e.colHover)!=null&&n.isHovered(t))}var ZSe=class extends We{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=n=>{const{beans:o,gos:s,element:r,columns:i}=this,a=o.colHover;if(n??!!s.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(r,{mouseover:a.setMouseOver.bind(a,i),mouseout:a.clearMouseOver.bind(a)});else{for(const c of this.destroyManagedListeners)c();this.destroyManagedListeners=[]}}}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{this.enableFeature(e)}),this.enableFeature()}destroy(){super.destroy(),this.destroyManagedListeners=null}},XSe="ag-column-hover",JSe=class extends We{constructor(){super(...arguments),this.beanName="colHover"}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{e||this.clearMouseOver()})}setMouseOver(e){this.updateState(e)}clearMouseOver(){this.updateState(null)}isHovered(e){if(!this.gos.get("columnHoverHighlight"))return!1;const t=this.selectedColumns;return!!t&&t.indexOf(e)>=0}addHeaderColumnHoverListener(e,t,n){const o=()=>{const s=this.isHovered(n);t.toggleCss("ag-column-hover",s)};e.addManagedEventListeners({columnHoverChanged:o}),o()}onCellColumnHover(e,t){if(!t)return;const n=this.isHovered(e);t.toggleCss(XSe,n)}addHeaderFilterColumnHoverListener(e,t,n,o){this.createHoverFeature(e,[n],o);const s=()=>{const r=this.isHovered(n);t.toggleCss("ag-column-hover",r)};e.addManagedEventListeners({columnHoverChanged:s}),s()}createHoverFeature(e,t,n){e.createManagedBean(new ZSe(t,n))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},QSe={moduleName:"ColumnHover",version:dt,beans:[JSe],apiFunctions:{isColumnHovered:YSe}},eEe=class extends We{constructor(){super(...arguments),this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){var e,t;this.wrapSvc=(t=(e=this.beans.frameworkOverrides).createGlobalEventListenerWrapper)==null?void 0:t.call(e)}addListener(e,t){var r;const n=((r=this.wrapSvc)==null?void 0:r.wrap(e,t))??t,o=!Vy.has(e),s=o?this.asyncListeners:this.syncListeners;s.has(e)||s.set(e,new Set),s.get(e).add(n),this.eventSvc.addListener(e,n,o)}removeListener(e,t){var r,i;const n=((r=this.wrapSvc)==null?void 0:r.unwrap(e,t))??t,o=this.asyncListeners.get(e),s=!!(o!=null&&o.delete(n));s||(i=this.syncListeners.get(e))==null||i.delete(n),this.eventSvc.removeListener(e,n,s)}addGlobalListener(e){var r;const t=((r=this.wrapSvc)==null?void 0:r.wrapGlobal(e))??e,n=(i,a)=>{Vy.has(i)&&t(i,a)},o=(i,a)=>{Vy.has(i)||t(i,a)};this.globalListenerPairs.set(e,{syncListener:n,asyncListener:o});const s=this.eventSvc;s.addGlobalListener(n,!1),s.addGlobalListener(o,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:n,globalListenerPairs:o}=this,s=(n==null?void 0:n.unwrapGlobal(e))??e;if(o.has(s)){const{syncListener:i,asyncListener:a}=o.get(s);t.removeGlobalListener(i,!1),t.removeGlobalListener(a,!0),o.delete(e)}else this.syncGlobalListeners.delete(s),t.removeGlobalListener(s,!1)}destroyEventListeners(e,t){e.forEach((n,o)=>{n.forEach(s=>this.eventSvc.removeListener(o,s,t)),n.clear()}),e.clear()}destroyGlobalListeners(e,t){for(const n of e)this.eventSvc.removeGlobalListener(n,t);e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncListeners,!1),this.destroyEventListeners(this.asyncListeners,!0),this.destroyGlobalListeners(this.syncGlobalListeners,!1);const{globalListenerPairs:e,eventSvc:t}=this;e.forEach(({syncListener:n,asyncListener:o})=>{t.removeGlobalListener(n,!1),t.removeGlobalListener(o,!0)}),e.clear()}};function tEe(e,t,n){var o;(o=e.apiEventSvc)==null||o.addListener(t,n)}function nEe(e,t,n){var o;(o=e.apiEventSvc)==null||o.removeListener(t,n)}function oEe(e,t){var n;(n=e.apiEventSvc)==null||n.addGlobalListener(t)}function sEe(e,t){var n;(n=e.apiEventSvc)==null||n.removeGlobalListener(t)}var rEe={moduleName:"EventApi",version:dt,apiFunctions:{addEventListener:tEe,addGlobalListener:oEe,removeEventListener:nEe,removeGlobalListener:sEe},beans:[eEe]},iEe={moduleName:"Locale",version:dt,beans:[Mve]},aEe=class extends We{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=Lo(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){var a,l,c,u;const{visibleCols:e,rowModel:t,rowSpanSvc:n,pinnedRowModel:o}=this.beans,s=e.autoHeightCols;let r=!1;const i=d=>{var p;const h=d.__autoHeights;let f=cl(this.beans,d).height;for(const g of s){let v=h==null?void 0:h[g.getColId()];const w=n==null?void 0:n.getCellSpan(g,d);if(w){if(w.getLastNode()!==d)continue;if(v=(p=n==null?void 0:n.getCellSpan(g,d))==null?void 0:p.getLastNodeAutoHeight(),!v)return}if(v==null){if(this.colSpanSkipCell(g,d))continue;return}f=Math.max(v,f)}f!==d.rowHeight&&(d.setRowHeight(f),r=!0)};(a=o==null?void 0:o.forEachPinnedRow)==null||a.call(o,"top",i),(l=o==null?void 0:o.forEachPinnedRow)==null||l.call(o,"bottom",i),(c=t.forEachDisplayedNode)==null||c.call(t,i),r&&((u=t.onRowHeightChanged)==null||u.call(t))}setRowAutoHeight(e,t,n){if(e.__autoHeights??(e.__autoHeights={}),t==null){delete e.__autoHeights[n.getId()];return}const o=e.__autoHeights[n.getId()];e.__autoHeights[n.getId()]=t,o!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:n,colViewport:o,visibleCols:s}=this.beans;if(!n.colSpanActive)return!1;let r=[];switch(e.getPinned()){case"left":r=s.getLeftColsForRow(t);break;case"right":r=s.getRightColsForRow(t);break;case null:r=o.getColsWithinViewport(t);break}return!r.includes(e)}setupCellAutoHeight(e,t,n){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const o=t.parentElement,{rowNode:s,column:r}=e,i=this.beans,a=u=>{var S;if((S=this.beans.editSvc)!=null&&S.isEditing(e)||!e.isAlive()||!n.isAlive())return;const{paddingTop:d,paddingBottom:h,borderBottomWidth:f,borderTopWidth:p}=Ec(o),g=d+h+f+p,w=t.offsetHeight+g;if(u<5){const b=Io(i),C=!(b!=null&&b.contains(t)),_=w==0;if(C||_){window.setTimeout(()=>a(u+1),0);return}}this.setRowAutoHeight(s,w,r)},l=()=>a(0);l();const c=il(i,t,l);return n.addDestroyFunc(()=>{c(),this.setRowAutoHeight(s,void 0,r)}),!0}setAutoHeightActive(e){this.active=e.list.some(t=>t.isVisible()&&t.isAutoHeight())}areRowsMeasured(){if(!this.active)return!0;const e=this.beans.rowRenderer.getAllRowCtrls();let t=null;for(const{rowNode:n}of e)if((!t||this.beans.colModel.colSpanActive)&&(t=this.beans.colViewport.getColsWithinViewport(n).filter(s=>s.isAutoHeight())),t.length!==0){if(!n.__autoHeights)return!1;for(const o of t){const s=n.__autoHeights[o.getColId()];if(!s||n.rowHeight<s)return!1}}return!0}},lEe={moduleName:"RowAutoHeight",version:dt,beans:[aEe]},cEe={moduleName:"AllCommunity",version:dt,dependsOn:[T$,gbe,Rbe,Qve,cCe,uCe,dCe,hCe,fCe,pCe,gCe,lCe,twe,nwe,owe,ewe,rwe,iwe,Hbe,$Ce,iSe,aB,mSe,vSe,RSe,FSe,qhe,LSe,FCe,mve,KSe,QSe,qSe,rEe,wve,Mbe,l$,iEe,lEe,Khe,lbe,WSe]};let A$=!1;A$||(tae.registerModules([cEe,T$]),A$=!0);class uEe{constructor(t,n){no(this,"gridApi",null);no(this,"container");no(this,"config");no(this,"eventListeners",new Map);this.container=t,this.config=n}init(){if(this.gridApi)throw new Error("Grid already initialized");const{onGridReady:t,onCellClicked:n,onCellFocused:o,onRowSelected:s,...r}=this.config,i={...r,onGridReady:a=>{this.gridApi=a.api,t&&t(a)},onCellClicked:a=>{n&&n(a)},onCellFocused:a=>{o&&o(a)},onRowSelected:a=>{s&&s(a)}};return this.gridApi=Pve(this.container,i),this.gridApi}updateRowData(t){this.gridApi&&this.gridApi.setGridOption("rowData",t)}updateColumnDefs(t){this.gridApi&&this.gridApi.setGridOption("columnDefs",t)}setColumnWidth(t){var n;this.gridApi&&((n=this.gridApi)==null||n.applyColumnState({state:t,applyOrder:!1}))}updateDatasource(t){this.gridApi&&this.gridApi.setGridOption("datasource",t)}refreshInfiniteCache(){this.gridApi&&this.gridApi.refreshInfiniteCache()}sizeColumnsToFit(){this.gridApi}deselectAll(){this.gridApi&&this.gridApi.deselectAll()}getSelectedRows(){var t;return((t=this.gridApi)==null?void 0:t.getSelectedRows())||[]}setQuickFilterText(t){this.gridApi&&this.gridApi.setGridOption("quickFilterText",t)}getColumnState(){var t;return(t=this.gridApi)==null?void 0:t.getColumnState()}addEventListener(t,n){if(!this.gridApi)throw new Error("Grid not initialized");this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t).add(n),this.gridApi.addEventListener(t,n)}addRow(t,n="bottom"){if(this.gridApi){const o={add:[t],addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(o),n==="bottom"){const s=this.gridApi.getDisplayedRowCount();s>0&&this.gridApi.ensureIndexVisible(s-1,"bottom")}}}addRows(t,n="bottom"){if(this.gridApi&&t.length>0){const o={add:t,addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(o),n==="bottom"){const s=this.gridApi.getDisplayedRowCount();s>0&&this.gridApi.ensureIndexVisible(s-1,"bottom")}}}destroy(){this.gridApi&&(this.eventListeners.forEach((t,n)=>{t.forEach(o=>{var s;(s=this.gridApi)==null||s.removeEventListener(n,o)})}),this.eventListeners.clear(),this.gridApi.destroy(),this.gridApi=null)}getApi(){return this.gridApi}switchTheme(t){document.body.dataset.agThemeMode=t==="dark"?"dark":"light"}}const dEe=fB.withParams({accentColor:"var(--primary-color)",backgroundColor:"#ffffff",borderColor:"#e5e7eb",borderRadius:4,browserColorScheme:"light",chromeBackgroundColor:"#f9fafb",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#111827",headerBackgroundColor:"#fff",headerFontSize:14,headerFontWeight:600,headerTextColor:"#374151",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"light").withParams({accentColor:"var(--primary-color)",backgroundColor:"#1f2937",borderColor:"#374151",borderRadius:4,browserColorScheme:"dark",chromeBackgroundColor:"#111827",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#f9fafb",headerBackgroundColor:"#374151",headerFontSize:14,headerFontWeight:600,headerTextColor:"#f9fafb",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"dark"),hEe=st({__name:"AgTable",props:{statusBar:{},sideBar:{type:[Object,String,Array,Boolean,null]},suppressContextMenu:{type:Boolean},preventDefaultOnContextMenu:{type:Boolean},allowContextMenuWithControlKey:{type:Boolean},columnMenu:{},suppressMenuHide:{type:Boolean},enableBrowserTooltips:{type:Boolean},tooltipTrigger:{},tooltipShowDelay:{},tooltipHideDelay:{},tooltipMouseTrack:{type:Boolean},tooltipShowMode:{},tooltipInteraction:{type:Boolean},popupParent:{},copyHeadersToClipboard:{type:Boolean},copyGroupHeadersToClipboard:{type:Boolean},clipboardDelimiter:{},suppressCopyRowsToClipboard:{type:Boolean},suppressCopySingleCellRanges:{type:Boolean},suppressLastEmptyLineOnPaste:{type:Boolean},suppressClipboardPaste:{type:Boolean},suppressClipboardApi:{type:Boolean},suppressCutToClipboard:{type:Boolean},columnDefs:{},defaultColDef:{},defaultColGroupDef:{},columnTypes:{},dataTypeDefinitions:{},maintainColumnOrder:{type:Boolean},enableStrictPivotColumnOrder:{type:Boolean},suppressFieldDotNotation:{type:Boolean},headerHeight:{},groupHeaderHeight:{},floatingFiltersHeight:{},pivotHeaderHeight:{},pivotGroupHeaderHeight:{},hidePaddedHeaderRows:{type:Boolean},allowDragFromColumnsToolPanel:{type:Boolean},suppressMovableColumns:{type:Boolean},suppressColumnMoveAnimation:{type:Boolean},suppressMoveWhenColumnDragging:{type:Boolean},suppressDragLeaveHidesColumns:{type:Boolean},suppressGroupChangesColumnVisibility:{type:[Boolean,String]},suppressMakeColumnVisibleAfterUnGroup:{type:Boolean},suppressRowGroupHidesColumns:{type:Boolean},colResizeDefault:{},suppressAutoSize:{type:Boolean},autoSizePadding:{},skipHeaderOnAutoSize:{type:Boolean},autoSizeStrategy:{},components:{},editType:{},suppressStartEditOnTab:{type:Boolean},getFullRowEditValidationErrors:{type:Function},invalidEditValueMode:{},singleClickEdit:{type:Boolean},suppressClickEdit:{type:Boolean},readOnlyEdit:{type:Boolean},stopEditingWhenCellsLoseFocus:{type:Boolean},enterNavigatesVertically:{type:Boolean},enterNavigatesVerticallyAfterEdit:{type:Boolean},enableCellEditingOnBackspace:{type:Boolean},undoRedoCellEditing:{type:Boolean},undoRedoCellEditingLimit:{},defaultCsvExportParams:{},suppressCsvExport:{type:Boolean},defaultExcelExportParams:{},suppressExcelExport:{type:Boolean},excelStyles:{},findSearchValue:{},findOptions:{},quickFilterText:{},cacheQuickFilter:{type:Boolean},includeHiddenColumnsInQuickFilter:{type:Boolean},quickFilterParser:{type:Function},quickFilterMatcher:{type:Function},applyQuickFilterBeforePivotOrAgg:{type:Boolean},excludeChildrenWhenTreeDataFiltering:{type:Boolean},enableAdvancedFilter:{type:Boolean},alwaysPassFilter:{type:Function},includeHiddenColumnsInAdvancedFilter:{type:Boolean},advancedFilterParent:{},advancedFilterBuilderParams:{},advancedFilterParams:{},suppressAdvancedFilterEval:{type:Boolean},suppressSetFilterByDefault:{type:Boolean},enableFilterHandlers:{type:Boolean},filterHandlers:{},enableCharts:{type:Boolean},chartThemes:{},customChartThemes:{},chartThemeOverrides:{},chartToolPanelsDef:{},chartMenuItems:{type:[Array,Function]},loadingCellRenderer:{},loadingCellRendererParams:{},loadingCellRendererSelector:{type:Function},localeText:{},masterDetail:{type:Boolean},keepDetailRows:{type:Boolean},keepDetailRowsCount:{},detailCellRenderer:{},detailCellRendererParams:{},detailRowHeight:{},detailRowAutoHeight:{type:Boolean},context:{},alignedGrids:{type:[Array,Function]},tabIndex:{},rowBuffer:{},valueCache:{type:Boolean},valueCacheNeverExpires:{type:Boolean},enableCellExpressions:{type:Boolean},suppressTouch:{type:Boolean},suppressFocusAfterRefresh:{type:Boolean},suppressBrowserResizeObserver:{type:Boolean},suppressPropertyNamesCheck:{type:Boolean},suppressChangeDetection:{type:Boolean},debug:{type:Boolean},loading:{type:Boolean},overlayLoadingTemplate:{},loadingOverlayComponent:{},loadingOverlayComponentParams:{},suppressLoadingOverlay:{type:Boolean},overlayNoRowsTemplate:{},noRowsOverlayComponent:{},noRowsOverlayComponentParams:{},suppressNoRowsOverlay:{type:Boolean},pagination:{type:Boolean},paginationPageSize:{},paginationPageSizeSelector:{type:[Array,Boolean]},paginationAutoPageSize:{type:Boolean},paginateChildRows:{type:Boolean},suppressPaginationPanel:{type:Boolean},pivotMode:{type:Boolean},pivotPanelShow:{},pivotMaxGeneratedColumns:{},pivotDefaultExpanded:{},pivotColumnGroupTotals:{},pivotRowTotals:{},pivotSuppressAutoColumn:{type:Boolean},suppressExpandablePivotGroups:{type:Boolean},functionsReadOnly:{type:Boolean},aggFuncs:{},suppressAggFuncInHeader:{type:Boolean},alwaysAggregateAtRootLevel:{type:Boolean},aggregateOnlyChangedColumns:{type:Boolean},suppressAggFilteredOnly:{type:Boolean},removePivotHeaderRowWhenSingleValueColumn:{type:Boolean},animateRows:{type:Boolean},cellFlashDuration:{},cellFadeDuration:{},allowShowChangeAfterFilter:{type:Boolean},domLayout:{},ensureDomOrder:{type:Boolean},enableCellSpan:{type:Boolean},enableRtl:{type:Boolean},suppressColumnVirtualisation:{type:Boolean},suppressMaxRenderedRowRestriction:{type:Boolean},suppressRowVirtualisation:{type:Boolean},rowDragManaged:{type:Boolean},rowDragInsertDelay:{},suppressRowDrag:{type:Boolean},suppressMoveWhenRowDragging:{type:Boolean},rowDragEntireRow:{type:Boolean},rowDragMultiRow:{type:Boolean},rowDragText:{type:Function},dragAndDropImageComponent:{},dragAndDropImageComponentParams:{},fullWidthCellRenderer:{},fullWidthCellRendererParams:{},embedFullWidthRows:{type:Boolean},groupDisplayType:{},groupDefaultExpanded:{},autoGroupColumnDef:{},groupMaintainOrder:{type:Boolean},groupSelectsChildren:{type:Boolean},groupLockGroupColumns:{},groupAggFiltering:{type:[Boolean,Function]},groupTotalRow:{type:[String,Function]},grandTotalRow:{},suppressStickyTotalRow:{type:[Boolean,String]},groupSuppressBlankHeader:{type:Boolean},groupSelectsFiltered:{type:Boolean},showOpenedGroup:{type:Boolean},groupHideParentOfSingleChild:{type:[Boolean,String]},groupRemoveSingleChildren:{type:Boolean},groupRemoveLowestSingleChildren:{type:Boolean},groupHideOpenParents:{type:Boolean},groupAllowUnbalanced:{type:Boolean},rowGroupPanelShow:{},groupRowRenderer:{},groupRowRendererParams:{},treeData:{type:Boolean},treeDataChildrenField:{},treeDataParentIdField:{},rowGroupPanelSuppressSort:{type:Boolean},suppressGroupRowsSticky:{type:Boolean},groupHierarchyConfig:{},pinnedTopRowData:{},pinnedBottomRowData:{},enableRowPinning:{type:[Boolean,String]},isRowPinnable:{type:Function},isRowPinned:{type:Function},rowModelType:{},rowData:{},asyncTransactionWaitMillis:{},suppressModelUpdateAfterUpdateTransaction:{type:Boolean},datasource:{},cacheOverflowSize:{},infiniteInitialRowCount:{},serverSideInitialRowCount:{},suppressServerSideFullWidthLoadingRow:{type:Boolean},cacheBlockSize:{},maxBlocksInCache:{},maxConcurrentDatasourceRequests:{},blockLoadDebounceMillis:{},purgeClosedRowNodes:{type:Boolean},serverSideDatasource:{},serverSideSortAllLevels:{type:Boolean},serverSideEnableClientSideSort:{type:Boolean},serverSideOnlyRefreshFilteredGroups:{type:Boolean},serverSidePivotResultFieldSeparator:{},viewportDatasource:{},viewportRowModelPageSize:{},viewportRowModelBufferSize:{},alwaysShowHorizontalScroll:{type:Boolean},alwaysShowVerticalScroll:{type:Boolean},debounceVerticalScrollbar:{type:Boolean},suppressHorizontalScroll:{type:Boolean},suppressScrollOnNewData:{type:Boolean},suppressScrollWhenPopupsAreOpen:{type:Boolean},suppressAnimationFrame:{type:Boolean},suppressMiddleClickScrolls:{type:Boolean},suppressPreventDefaultOnMouseWheel:{type:Boolean},scrollbarWidth:{},rowSelection:{},cellSelection:{type:[Boolean,Object]},rowMultiSelectWithClick:{type:Boolean},suppressRowDeselection:{type:Boolean},suppressRowClickSelection:{type:Boolean},suppressCellFocus:{type:Boolean},suppressHeaderFocus:{type:Boolean},selectionColumnDef:{},rowNumbers:{type:[Boolean,Object]},suppressMultiRangeSelection:{type:Boolean},enableCellTextSelection:{type:Boolean},enableRangeSelection:{type:Boolean},enableRangeHandle:{type:Boolean},enableFillHandle:{type:Boolean},fillHandleDirection:{},suppressClearOnFillReduction:{type:Boolean},sortingOrder:{},accentedSort:{type:Boolean},unSortIcon:{type:Boolean},suppressMultiSort:{type:Boolean},alwaysMultiSort:{type:Boolean},multiSortKey:{},suppressMaintainUnsortedOrder:{type:Boolean},icons:{},rowHeight:{},rowStyle:{},rowClass:{},rowClassRules:{},suppressRowHoverHighlight:{type:Boolean},suppressRowTransform:{type:Boolean},columnHoverHighlight:{type:Boolean},gridId:{},deltaSort:{type:Boolean},treeDataDisplayType:{},enableGroupEdit:{type:Boolean},initialState:{},reactiveCustomComponents:{type:Boolean},renderingMode:{},theme:{},loadThemeGoogleFonts:{type:Boolean},themeCssLayer:{},styleNonce:{},themeStyleContainer:{},getContextMenuItems:{type:Function},getMainMenuItems:{type:Function},postProcessPopup:{type:Function},processUnpinnedColumns:{type:Function},processCellForClipboard:{type:Function},processHeaderForClipboard:{type:Function},processGroupHeaderForClipboard:{type:Function},processCellFromClipboard:{type:Function},sendToClipboard:{type:Function},processDataFromClipboard:{type:Function},isExternalFilterPresent:{type:Function},doesExternalFilterPass:{type:Function},getChartToolbarItems:{type:Function},createChartContainer:{type:Function},focusGridInnerElement:{type:Function},navigateToNextHeader:{type:Function},tabToNextHeader:{type:Function},navigateToNextCell:{type:Function},tabToNextCell:{type:Function},getLocaleText:{type:Function},getDocument:{type:Function},paginationNumberFormatter:{type:Function},getGroupRowAgg:{type:Function},isGroupOpenByDefault:{type:Function},ssrmExpandAllAffectsAllRows:{type:Boolean},initialGroupOrderComparator:{type:Function},processPivotResultColDef:{type:Function},processPivotResultColGroupDef:{type:Function},getDataPath:{type:Function},getChildCount:{type:Function},getServerSideGroupLevelParams:{type:Function},isServerSideGroupOpenByDefault:{type:Function},isApplyServerSideTransaction:{type:Function},isServerSideGroup:{type:Function},getServerSideGroupKey:{type:Function},getBusinessKeyForNode:{type:Function},getRowId:{type:Function},resetRowDataOnUpdate:{type:Boolean},processRowPostCreate:{type:Function},isRowSelectable:{type:Function},isRowMaster:{type:Function},fillOperation:{type:Function},postSortRows:{type:Function},getRowStyle:{type:Function},getRowClass:{type:Function},getRowHeight:{type:Function},isFullWidthRow:{type:Function},onToolPanelVisibleChanged:{type:Function},onToolPanelSizeChanged:{type:Function},onColumnMenuVisibleChanged:{type:Function},onContextMenuVisibleChanged:{type:Function},onCutStart:{type:Function},onCutEnd:{type:Function},onPasteStart:{type:Function},onPasteEnd:{type:Function},onColumnVisible:{type:Function},onColumnPinned:{type:Function},onColumnResized:{type:Function},onColumnMoved:{type:Function},onColumnValueChanged:{type:Function},onColumnPivotModeChanged:{type:Function},onColumnPivotChanged:{type:Function},onColumnGroupOpened:{type:Function},onNewColumnsLoaded:{type:Function},onGridColumnsChanged:{type:Function},onDisplayedColumnsChanged:{type:Function},onVirtualColumnsChanged:{type:Function},onColumnEverythingChanged:{type:Function},onColumnsReset:{type:Function},onColumnHeaderMouseOver:{type:Function},onColumnHeaderMouseLeave:{type:Function},onColumnHeaderClicked:{type:Function},onColumnHeaderContextMenu:{type:Function},onComponentStateChanged:{type:Function},onCellValueChanged:{type:Function},onCellEditRequest:{type:Function},onRowValueChanged:{type:Function},onCellEditingStarted:{type:Function},onCellEditingStopped:{type:Function},onRowEditingStarted:{type:Function},onRowEditingStopped:{type:Function},onBulkEditingStarted:{type:Function},onBulkEditingStopped:{type:Function},onBatchEditingStarted:{type:Function},onBatchEditingStopped:{type:Function},onUndoStarted:{type:Function},onUndoEnded:{type:Function},onRedoStarted:{type:Function},onRedoEnded:{type:Function},onCellSelectionDeleteStart:{type:Function},onCellSelectionDeleteEnd:{type:Function},onRangeDeleteStart:{type:Function},onRangeDeleteEnd:{type:Function},onFillStart:{type:Function},onFillEnd:{type:Function},onFilterOpened:{type:Function},onFilterChanged:{type:Function},onFilterModified:{type:Function},onFilterUiChanged:{type:Function},onFloatingFilterUiChanged:{type:Function},onAdvancedFilterBuilderVisibleChanged:{type:Function},onFindChanged:{type:Function},onChartCreated:{type:Function},onChartRangeSelectionChanged:{type:Function},onChartOptionsChanged:{type:Function},onChartDestroyed:{type:Function},onCellKeyDown:{type:Function},onGridReady:{type:Function},onGridPreDestroyed:{type:Function},onFirstDataRendered:{type:Function},onGridSizeChanged:{type:Function},onModelUpdated:{type:Function},onVirtualRowRemoved:{type:Function},onViewportChanged:{type:Function},onBodyScroll:{type:Function},onBodyScrollEnd:{type:Function},onDragStarted:{type:Function},onDragStopped:{type:Function},onDragCancelled:{type:Function},onStateUpdated:{type:Function},onPaginationChanged:{type:Function},onRowDragEnter:{type:Function},onRowDragMove:{type:Function},onRowDragLeave:{type:Function},onRowDragEnd:{type:Function},onRowDragCancel:{type:Function},isRowValidDropPosition:{type:Function},onRowResizeStarted:{type:Function},onRowResizeEnded:{type:Function},onColumnRowGroupChanged:{type:Function},onRowGroupOpened:{type:Function},onExpandOrCollapseAll:{type:Function},onPivotMaxColumnsExceeded:{type:Function},onPinnedRowDataChanged:{type:Function},onPinnedRowsChanged:{type:Function},onRowDataUpdated:{type:Function},onAsyncTransactionsFlushed:{type:Function},onStoreRefreshed:{type:Function},onHeaderFocused:{type:Function},onCellClicked:{type:Function},onCellDoubleClicked:{type:Function},onCellFocused:{type:Function},onCellMouseOver:{type:Function},onCellMouseOut:{type:Function},onCellMouseDown:{type:Function},onRowClicked:{type:Function},onRowDoubleClicked:{type:Function},onRowSelected:{type:Function},onSelectionChanged:{type:Function},onCellContextMenu:{type:Function},onRangeSelectionChanged:{type:Function},onCellSelectionChanged:{type:Function},onTooltipShow:{type:Function},onTooltipHide:{type:Function},onSortChanged:{type:Function},height:{},isSorting:{type:Boolean}},emits:["onGridReady","row-clicked","cell-clicked","cell-focused","row-selected"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=B(null);wS(r,()=>{var v;const g=(v=i.value)==null?void 0:v.getApi();g==null||g.clearFocusedCell()});const i=B(null),a=q(()=>({width:"100%",height:o.height||"500px"})),l=q(()=>({...o,theme:dEe}));function c(){if(!r.value){console.warn("Grid container element not found");return}const g={...l.value,height:o.height};i.value=new uEe(r.value,g),i.value.init(),u()}function u(){var v;const g=((v=i.value)==null?void 0:v.getApi())??null;s("onGridReady",g)}function d(g){var w,S;if(!g)return;(w=i.value)==null||w.updateColumnDefs(g);const v=g.map(b=>b.field&&b.width&&!b.hide?{colId:b.field,width:b.width,flex:null}:null).filter(b=>b!==null);(S=i.value)==null||S.setColumnWidth(v)}function h(){var g;(g=i.value)==null||g.destroy(),i.value=null}function f(){var g;return((g=i.value)==null?void 0:g.getApi())||void 0}function p(){return i.value||null}return tt(()=>o.columnDefs,(g,v)=>{const w=g==null?void 0:g.filter(b=>!b.hide).map(b=>b.field).join(","),S=v==null?void 0:v.filter(b=>!b.hide).map(b=>b.field).join(",");w!==S&&d(g)},{deep:!0}),qn(()=>{h()}),t({gridApi:f,gridManager:p,syncColumnDefs:d}),Qt(()=>{c()}),qn(()=>{h()}),(g,v)=>(K(),ie("div",{ref_key:"gridContainerRef",ref:r,style:rn(a.value),class:Q(["ag-theme-quartz",["ag-table-container",o.isSorting?"is-sorting":""]])},null,6))}});function Wd(e){return hL(e)}const fEe=()=>[...[{headerName:"Name",field:"name",sortable:!1,filter:!1,pinned:"left",headerComponent:Wd(gc),suppressMovable:!0},{headerName:"Notes",field:"description",sortable:!1,filter:!1,suppressMovable:!1},{headerName:"Assignee",field:"assignees",sortable:!1,filter:!1,headerComponent:Wd(gc)},{headerName:"Status",field:"status",sortable:!1,filter:!1,headerComponent:Wd(gc)},{headerName:"Date Range",field:"dateRange",sortable:!1,filter:!1,headerComponent:Wd(gc)},{headerName:"Last Updated",field:"lastUpdated",sortable:!1,filter:!1,headerComponent:Wd(gc),cellRendererParams:n=>{var o,s,r;return{...n,value:(o=n==null?void 0:n.data)==null?void 0:o.lastUpdated.value,tooltip:((r=(s=n==null?void 0:n.data)==null?void 0:s.lastUpdated)==null?void 0:r.tooltip)||void 0,readOnly:!0}}},{headerName:"Completed On",field:"completedOn",sortable:!1,filter:!1,headerComponent:Wd(gc),cellRendererParams:n=>{var o,s,r;return{...n,value:(o=n==null?void 0:n.data)==null?void 0:o.completedOn.value,tooltip:((r=(s=n==null?void 0:n.data)==null?void 0:s.completedOn)==null?void 0:r.tooltip)||void 0,readOnly:!0}}}].map(n=>qf.fromType(n))],Yy={WIDTH:60,HEADER_CLASS:"ag-checkbox-header"},pEe=()=>({field:"__checkboxSelection",checkboxSelection:!0,headerCheckboxSelection:!0,pinned:"left",width:Yy.WIDTH,minWidth:Yy.WIDTH,maxWidth:Yy.WIDTH,cellClass:"ag-checkbox-cell",headerClass:Yy.HEADER_CLASS,headerComponent:Wv(vee),suppressMovable:!0}),O$="blank",gEe=[O$,"__checkboxSelection","options"],mEe=["uiColumnResized","uiColumnMoved","api"],vEe={headerName:"",field:"options",sortable:!1,filter:!1,editable:!0,pinned:"right",lockPosition:!0,suppressMovable:!0,resizable:!1},M$=(e,t)=>t!=null&&t.width?{...e,width:t.width,flex:void 0}:e,yEe=(e,t,n)=>{const{getCachedValue:o,setCachedValue:s}=$h({dbName:"item_table_column_configs",storeName:"column_configs"}),r=async()=>{const d=await o(t);if(!d||typeof d!="string")return null;try{const h=JSON.parse(d);return Array.isArray(h)?h:null}catch(h){return console.error("Failed to parse cached column config:",h),null}},i=B([]),a=pEe();let l=0;const c=async d=>{const h=++l,f=await r();if(h!==l)return;const p=[];f==null||f.forEach(D=>{const{field:N,hide:G,width:J,pinned:ae}=D;p.push([N,G])});const g=new Map(p),v=fEe(),w=qf.fromType(vEe),S=!!f,C=((d==null?void 0:d.map(D=>{var N;return{headerName:D.name,field:`metric_${D.id}`,editable:((N=D==null?void 0:D.auth_permission)==null?void 0:N.permission)==2,sortable:!0,filter:!1,flex:1,context:{...D},hide:S?!g.get(`metric_${D.id}`):!(D.is_primary||D.is_point_metric),cellClass:"ag-cell-optimized",headerComponent:Wv(gc),headerComponentParams:()=>({headerType:D.metric_type.code=="number"||D.metric_type.code=="formula"?"number":"default"})}}))||[]).map(D=>qf.fromType(D)),_=[a,...v,...C,w],E=[],x=[],I=[];for(const D of _)D.pinned==="left"?E.push(D):D.pinned==="right"||D.field===O$?x.push(D):I.push(D);if(!f||f.length===0){i.value=_;return}const F=new Map(f.map(D=>[D.field,D])),M=new Map(I.map(D=>[D.field,D])),T=[];for(const D of f)if(D.field&&M.has(D.field)){const N=M.get(D.field);T.push({...M$(N,D),hide:D.hide}),M.delete(D.field)}const A=Array.from(M.values()),k=[...T,...A].map(D=>({...D,lockPinned:!0})),P=D=>M$(D,F.get(D.field));i.value=[...E.map(P),...k,...x.map(P)]};tt(e,d=>c(d),{immediate:!0});const u=xr((d,h)=>{if((d==null?void 0:d.source)!==void 0&&!mEe.includes(d.source))return;const f=n.value,p=f==null?void 0:f.getColumnDefs(),g=new Map;if(f==null||f.getColumnState().forEach(w=>{w.width&&g.set(w.colId,Number(w.width))}),i.value=p||i.value,!h)return;const v=(p??[]).filter(w=>w.field&&!gEe.includes(w.field)).map(w=>({field:w.field,hide:w.hide,width:g.get(w.field)||w.width,pinned:w.pinned}));s(t,JSON.stringify(v))},li);return HR(()=>u.cancel()),{columnDefs:i,checkboxColumn:a,saveColumnConfig:u}},wEe=()=>{const e=un.getInstance().getItem("API_BASE_URL");return e!=null&&e.includes("v1")?e.slice(0,e.lastIndexOf("/v1")):String(e)},CEe=e=>{var A,k,P;const{showMessage:t,showErrorNetMessage:n}=oa(),o=oo(),s={domainApi:wEe(),wsCode:un.getInstance().getItem("ws.code"),entityId:e.value.entityId},r=(P=(k=(A=o==null?void 0:o.appContext)==null?void 0:A.config)==null?void 0:k.globalProperties)==null?void 0:P.apiConfig;if(!r||s.domainApi===""||s.wsCode==="")throw new Error("API configuration is missing in useItems");const i=new FO(r,s);i.on("call-api",D=>{D.success?t(D.apiCode,"success"):n(D)});const a=hs({}),l=B([]),c=B(!1),u=B(null),d=B(null),h=B(1),f=B(20);let p=Promise.resolve();const{setCachedUsers:g}=$7(),v=D=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",include_permission:"{include_permission}",include_permission_names:!0,q:D}),w=50,S=async(D,N,G)=>{if(!D.length)return[];const J=e8(D,N);return(await Promise.all(J.map(G))).flat()},b=async D=>{try{return(await i.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:D})).data.map(G=>[G==null?void 0:G.id,G.permission])}catch(N){return console.error("Failed to fetch item permissions chunk:",N),[]}},C=async(D,N)=>{try{const G=await i.getMetricValues({workspaceId:e.value.workspaceId,item_ids:D,per_page:D.length*N.length,metric_ids:N}),J=G.data.map(ne=>{const ee=new Map(ne.item_metrics.map(j=>[j.metric_id,{value:j.value,auth_permission:j==null?void 0:j.auth_permission}])),$=Object.fromEntries(N.map(j=>[j,ee.get(j)??null]));return[ne==null?void 0:ne.id,$]}),ae=new Set(G.data.map(ne=>ne==null?void 0:ne.id));for(const ne of D)if(!ae.has(ne)){const ee=Object.fromEntries(N.map($=>[$,{value:null,auth_permission:void 0}]));J.push([ne,ee])}return J}catch(G){return console.error("Failed to fetch a chunk of metric values:",G),D.map(ae=>[ae,Object.fromEntries(N.map(ne=>[ne,void 0]))])}},_=async D=>{try{const N=await i.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:D,per_page:D.length}),G=N.data.flatMap(J=>J.assignees);return g(G),N.data.map(J=>[J==null?void 0:J.id,J==null?void 0:J.assignees])}catch(N){return console.error("Failed to fetch a chunk of assigned users:",N),[]}},E=async D=>{if(!D.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const N=await S(D,w,b);return Object.fromEntries(N)}catch(N){return console.error("Failed to fetch item permissions:",N),{}}},x=async(D,N)=>!D.length||!N.length?{}:(p=p.then(async()=>{try{const ae=[];let ne=0;for(let $=0;$<N.length;$+=5){ne++;const j=N.slice($,$+5),te=[];for(let ve=0;ve<j.length;ve++){const we=j[ve],re=await S(D,w,W=>C(W,[we]));te.push(re),await new Promise(W=>setTimeout(W,500))}ae.push(...te);const pe=$+5>=N.length}const ee={};for(const $ of ae.flat()){const[j,te]=$;ee[j]||(ee[j]={}),Object.assign(ee[j],te)}return ee}catch(G){return console.error("Failed to fetch metric values:",G),{}}}),p),I=async D=>{if(!D.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const N=await S(D,w,_);return Object.fromEntries(N)}catch(N){return console.error("Failed to fetch assigned users:",N),{}}};return{items:l,loading:c,error:u,pagination:d,currentPage:h,pageSize:f,cusorMap:a,fetchItems:async D=>{const{cursor:N,offset:G,size:J,searchQuery:ae}=D;let ne=[];c.value=!0,u.value=null;try{const ee=await i.getAllItem_cursor({...D,cursor:N||void 0,offset:G||void 0,pageSize:J||f.value,...v(ae),sortBy:D.sort_by});return l.value=ee.data,d.value=ee.meta,h.value=ee.meta.current_page||0,ne=ee.data.map($=>$==null?void 0:$.id),ee}catch(ee){throw u.value=ee,console.error("Failed to fetch items (cursor):",ee),ee}finally{const ee=async()=>{try{const[$,j]=await Promise.all([I(ne),E(ne)]);e.value.updateItemData({assignees:$,permission:j},ne);const te=await x(ne,e.value.metricIds);e.value.setMetricValues(te,new Set(ne),e.value.metricIds)}catch($){console.error("Post-fetch processing failed:",$)}};c.value=!1,setTimeout(ee)}},getAssignableStatus:async D=>{try{return await i.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:D})}catch(N){throw console.error("Failed to fetch assignable status:",N),N}},getMetricList:async D=>{try{return await i.getMetricList({workspaceId:e.value.workspaceId,entityId:D})}catch(N){throw console.error("Failed to fetch metric list:",N),N}},getMetricValues:x,getAssignedUsers:I}};function bEe(e){return{updateRowData:(o,s)=>{if(!e.value)return;const r=[],i=new Set,a=e.value.getColumnDefs();if(!a)return;const l=a.map(c=>{if(c.field&&c.field.startsWith("metric_")&&(c.hide===!1||c.hide===void 0))return c.field}).filter(Boolean);s.forEach(c=>{var d;const u=(d=e.value)==null?void 0:d.getRowNode(c);if(u){if(r.push(u),o.assignees){const h=T7((o.assignees[c]||[]).map(rP));u.data.assignees=h,i.add("assignees")}o.permission&&(u.data.permissions=o.permission[c]),l.forEach(h=>{u.data[h]=u.data[h]??null})}}),i.add("assignees"),i.add("status"),i.add("dateRange"),i.add("moreActions"),i.add("name"),i.add("description"),e.value.refreshCells({rowNodes:r,columns:Array.from(i),force:!0})},setMetricValues:(o,s,r)=>{const i=e.value;if(!i)return;const a=new Map(Array.from(s).map(c=>[c,new Map(r.map(u=>[u,{value:null,auth_permission:void 0}]))]));Object.entries(o).forEach(([c,u])=>{Object.entries(u).forEach(([d,h])=>{var f;(f=a.get(c))==null||f.set(d,{value:h==null?void 0:h.value,auth_permission:h==null?void 0:h.auth_permission})})});const l=Array.from(a.entries()).map(([c,u])=>{const d=i.getRowNode(c);return d!=null&&d.data?(u.forEach((h,f)=>{const p=`metric_${f}`;d.data[p]=(h==null?void 0:h.value)||null;const g=`metric_permission_${f}`;d.data[p]=(h==null?void 0:h.value)||null,d.data[g]=(h==null?void 0:h.auth_permission)||null}),d):null});l.length>0&&i.refreshCells({rowNodes:l,columns:Array.from(r).map(c=>`metric_${c}`),force:!0})}}}function SEe(e,t,n,o,s){let r=!0;return{async getRows(i){try{o(!0),r&&(s(!0),r=!1);const a=Math.floor(i.startRow/t)+1,{rows:l,total:c}=await e({page:a,pageSize:t,filterText:n(),sort_by:i.sortModel});let u=-1;Number.isFinite(c)?u=c:l.length<t&&(u=i.startRow+l.length),i.context={pageSize:t,text:n()},i.successCallback(l,u),o(!1),s(!1)}catch(a){console.error("Datasource fetch error:",a),i.failCallback(),o(!1),s(!1)}}}}function EEe(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:o,gridApi:s,fetcher:r}=e,i=B(!0),a=B(!0),l=B(!1),c=()=>{n.value=!n.value},u=v=>{if(i.value=!1,s.value=v,!v)return null;const{addEventListener:w,setGridOption:S}=v;if(!r)return console.error("Fetcher function is undefined"),null;const b=SEe(r,e.perPage,()=>o.value,C=>{i.value=C},C=>{a.value=C});return S==null||S("datasource",b),w==null||w("selectionChanged",()=>{t.value=v.getSelectedRows()}),v||null},d=v=>{var w,S;if((w=s.value)==null||w.hideOverlay(),v!==void 0&&(o.value=v),(S=s.value)==null||S.deselectAll(),t.value=[],i.value=!0,!s.value||!r){console.error("Grid API or fetcher is not available"),i.value=!1;return}l.value=!0,a.value=!0,s.value.purgeInfiniteCache(),s.value.ensureIndexVisible(0,"top"),setTimeout(()=>{i.value=!1,setTimeout(()=>{l.value=!1},100)},300)},h=()=>{var v;(v=s.value)==null||v.deselectAll(),t.value=[]},f=xr(v=>{d(v)},li),p=()=>{s.value},g=B(!1);return{isLoading:i,toggleSidebar:c,onGridReady:u,onSearch:f,handleUnSelect:h,firstLoad:a,cacheCleared:l,handleSelectAll:p,isSelectAll:g}}const _Ee={changelog:{"1.0.1":{date:"2024-06-20",changes:["Fixed styling issues for archived and deleted rows."]},"1.0.0":{date:"2024-06-15",changes:["Initial release of the Item Table package."]},"0.0.1-alpha.8":{date:"2024-06-10",changes:["Improved performance of row updates.","Added support for custom cell renderers.","Add row hover effect for better UX.","Add loading skeleton for filter","Beta release with core functionalities implemented."]},"0.0.1-alpha.9":{date:"2024-06-05",changes:["Add row selection feature.","Fix bug with column resizing.","Optimize rendering for large datasets.","Implement getLog function to retrieve changelog entries based on version.","Display app version and changelog in the Item Table component tooltip.","Clean up unused autocomplete and memoized config composables.","Update styles for better consistency and readability."]},"0.0.1-alpha.11":{date:"2024-06-18",changes:["Add bulk process status display: items now show an hourglass icon and tooltip when being processed.","Update data model: added isProcessing and bulk_process properties to track item status.","Improve row focus: focused rows now flash for better visibility.","Set 'Last Updated' and 'Completed On' columns as read-only.","Fix: resolve visual fetching issue in useRemoteFiles composable.","Fix: use correct upload icon in PopupCreateScenes component.","Enhance data conversion to include processing status in item rows."]},"0.0.1-alpha.12":{date:"2024-06-12",changes:["feat: enhance Snackbar component and notification handling","Refactor Snackbar.vue for improved readability and styling, including color adjustments for icons and text.","Add showMessage function in notifications store to display messages based on API keys, improving notification management.","Introduce notificationMessage constant to centralize notification messages for various API actions, enhancing maintainability.","Remove unnecessary console logs from useRemoteFiles and improve logging in notification store for better debugging."]},"0.0.1-alpha.16":{date:"2024-06-20",changes:["Add onboarding tour feature and enhance UI components with new dependencies","Refactor UI components for improved styling and functionality","Updated RatingComponent.vue to streamline class bindings and improve accessibility attributes.","Enhanced SearchBox.vue by adding a clear event handler and simplifying icon rendering.","Modified AssigneeGroupEditor.vue and AssigneeGroupRenderer.vue to remove unnecessary size attributes from icons.","Adjusted DateRangeRenderer.vue to remove size attributes from icons for consistency.","Updated HeaderCheckbox.vue to set dropdown placement to 'bottom-start'.","Refined HeaderSorting.vue to simplify sort option labels and improve sorting logic.","Enhanced HeaderWrapper.vue to utilize reactive properties for sorting state.","Improved HyperLinkEditor.vue and HyperLinkInlineEditor.vue by removing size attributes from icons.","Updated PopupLayout.vue to use a CSS variable for box-shadow styling.","Refined Snackbar.vue to standardize icon colors and improve styling consistency.","Adjusted useTippy.ts to set default placement and arrow visibility for tooltips.","Modified notificationMessage.ts to remove error messages for list fetching.","Cleaned up notifications.ts by removing console logs for a cleaner codebase.","Updated sortStore.ts to comment out unnecessary console logs for better performance.","Enhanced styles.scss by defining new icon size variables and standardizing box-shadow styles."]},"0.0.99":{date:"2024-06-24",changes:["Fix: resolve issue with incorrect version display in Item Table component.","Update changelog retrieval logic to ensure accurate version matching.","Enhance tooltip display for app version and changelog in Item Table component."]}}},REe=e=>{var t;return(t=Object.entries(_Ee.changelog).find(([n,o])=>n===e))==null?void 0:t[1].changes},DEe={key:1},TEe=Ct(st({__name:"PopupOverwriteScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const o=B(null),s=e,r=()=>{o.value&&o.value.show()},i=B(""),a=B("idle"),l=B({file:null,format:null}),{apiServices:c}=Zn(!1,{}),u=B(!1),d=async()=>{u.value=!0;const T=s.workspaceId,A=s.entityId;if(!T||!A||!c.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await c.value.downloadExportedItemsFile(T,A))throw new Error("No response from downloadTemplate API")}catch(k){console.error("Error downloading template:",k)}u.value=!1},h=n,f=()=>{h("import-success"),S()},p=async T=>{var P,D,N;const A=new FormData,k=((P=T.name.split(".").pop())==null?void 0:P.toString())||"";if(A.append("file",T),A.append("format",k),A.append("entity_id",s.entityId||""),!c.value){console.error("API services not available");return}try{await c.value.overwriteScenesViaImportFile(s.workspaceId,s.entityId,A),g()}catch(G){throw console.error("Error uploading file:",G),v(((N=(D=G.response)==null?void 0:D.data)==null?void 0:N.message)||"An unknown error occurred during file upload."),G}},g=()=>{a.value="success"},v=T=>{i.value=T,a.value="error"},w=async()=>{!l.value||!l.value.file||await p(l.value.file)},S=()=>{var T;E(),(T=o.value)==null||T.hide()};t({close:S,open:r});const b=q(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Update existing work"})[a.value]),C=q(()=>l.value.file?!1:(console.error("No file selected"),!0)),_=B(null),E=()=>{var T;(T=_.value)==null||T.clear(),i.value="",l.value={file:null,format:null},a.value="idle"},x=yn("switchInstance"),I=()=>{x?x("xlsx_toolbox","",{showLoad:!1}):window.appManager.switchInstance("xlsx_toolbox","",{showLoad:!1}),console.log("Toolbox opened")},F=(T,A)=>new File([T],A,{type:T.type});let M;return Qt(()=>{const T=sessionStorage.getItem("BASE_URL");M=jE({target:window,allowedOrigins:[T||"https://app.arbocollab.com"],onMessage:(A,k)=>{var D;if(console.log("PopupCreateScenes: Received message:",A),A.type!=="TOOLBOX_EXPORT_DATA")return;console.log("Received from:",k.origin),console.log("File name:",A.payload.fileName);const P=F(A.payload.file,A.payload.fileName);(D=_.value)==null||D.setFile(P)},onInvalidMessage:(A,k,P)=>{console.warn("Rejected postMessage:",k,P.origin)}})}),qn(()=>{M==null||M()}),(T,A)=>(K(),Ue(H(zS),{"popup-name":b.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:o,onHidden:E},tu({default:he(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(K(),Ue(oL,{key:0,state:a.value,"error-message":i.value,overwrite:!0},null,8,["state","error-message"])):(K(),ie("div",DEe,[me("div",{class:Q(T.$style["step-section"])},[me("span",{class:Q(T.$style["step-title"])},"Step 1: Download current data",2),me("span",{class:Q(T.$style["step-description"])},[...A[1]||(A[1]=[Qe(" Download a file with all existing work and details. Edit it, then upload in Step 2. ",-1),me("br",null,null,-1),me("i",null,"Note: Empty cells and unchanged values will be skipped.",-1)])],2),me("div",{class:Q(T.$style["actions-section"])},[ue(H(at),{class:Q(T.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:u.value,onHandleClick:d},{prefix:he(()=>[ue(H(lt),{src:"Download"})]),default:he(()=>[A[2]||(A[2]=Qe(" Download file ",-1))]),_:1},8,["class","disabled"]),ue(H(at),{class:Q(T.$style["download-sample-btn"]),size:12,variant:"secondary",onHandleClick:I},{default:he(()=>[...A[3]||(A[3]=[Qe(" Toolbox ",-1)])]),_:1},8,["class"])],2)],2),me("div",{class:Q(T.$style["step-section"])},[me("span",{class:Q(T.$style["step-title"])},"Step 2: Upload updated file (.xlsx, .xls, .csv)",2),ue(H(EM),{modelValue:l.value,"onUpdate:modelValue":A[0]||(A[0]=k=>l.value=k),ref_key:"filUploaderRef",ref:_},null,8,["modelValue"])],2),me("div",{class:Q(T.$style["step-section"]),style:{"padding-top":"0","padding-bottom":"0"}},[ue(sL)],2)]))]),_:2},[a.value==="idle"?{name:"footer",fn:he(()=>[ue(H(at),{style:{flex:"1"},variant:"secondary",onClick:S},{default:he(()=>[...A[4]||(A[4]=[Qe(" Cancel ",-1)])]),_:1}),ue(H(at),{disabled:C.value,style:{flex:"1"},variant:"primary",onClick:w},{default:he(()=>[...A[5]||(A[5]=[Qe(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:he(()=>[ue(H(at),{style:{flex:"1"},variant:"primary",onClick:f},{default:he(()=>[...A[6]||(A[6]=[Qe(" Close ",-1)])]),_:1})]),key:"1"}:{name:"footer",fn:he(()=>[ue(H(at),{style:{flex:"1"},variant:"primary",onClick:E},{default:he(()=>[...A[7]||(A[7]=[Qe(" Try Again ",-1)])]),_:1})]),key:"2"}]),1032,["popup-name"]))}}),[["__cssModules",{$style:{"step-section":"_step-section_1ji92_1","step-title":"_step-title_1ji92_12","step-title-2":"_step-title-2_1ji92_18","step-description":"_step-description_1ji92_24","date-format-guide":"_date-format-guide_1ji92_29","import-error":"_import-error_1ji92_40","drop-area":"_drop-area_1ji92_50","is-dragging":"_is-dragging_1ji92_50","drop-area-content":"_drop-area-content_1ji92_53",browse:"_browse_1ji92_62","download-sample-btn":"_download-sample-btn_1ji92_66","actions-section":"_actions-section_1ji92_70"}}]]),IEe={class:"visual-btn-visual"},xEe={class:"visual-btn--label"},FEe={key:0,class:"visual-btn--description"},PEe={key:1,class:"visual-btn--description"},N$=Ct(st({__name:"VisualButton",props:{label:{},description:{},disabled:{type:Boolean}},emits:["onClick"],setup(e,{emit:t}){const n=e,o=()=>{n.disabled||s("onClick")},s=t;return(r,i)=>(K(),ie("div",{class:Q(["visual-btn",{"visual-btn--disabled":e.disabled}]),onClick:o},[me("div",IEe,[Tt(r.$slots,"visual",{},()=>[i[0]||(i[0]=kU('<svg width="42" height="36" viewBox="0 0 42 36" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-db9bdf1b><g clip-path="url(#clip0_4824_13082)" data-v-db9bdf1b><path d="M5.14286 18V10.2857H18V18H5.14286ZM5.14286 23.1 429H18V30.8571H5.14286V23.1429ZM23.1429 30.8571V23.1429H36V30.8571H23.1429ZM36 18H23.1429V10.2857H36V18ZM5.14286 0C2.30625 0 0 2.30625 0 5.14286V30.8571C0 33.6937 2.30625 36 5.14286 36H36C38.8366 36 41.1429 33.6937 41.1429 30.8571V5.14286C41.1429 2.30625 38.8366 0 36 0H5.14286Z" fill="#D7D7D7" data-v-db9bdf1b></path><path d="M0 5.14286C0 2.30625 2.30625 0 5.14286 0H36C38.8366 0 41.1429 2.30625 41.1429 5.14286V10.318H0V5.14286Z" fill="#A6A6A6" data-v-db9bdf1b></path></g><defs data-v-db9bdf1b><clipPath id="clip0_4824_13082" data-v-db9bdf1b><rect width="41.1429" height="36" fill="white" data-v-db9bdf1b></rect></clipPath></defs></svg>',1))],!0)]),me("div",xEe,ut(n.label),1),n.disabled?(K(),ie("div",FEe," Coming soon ")):(K(),ie("div",PEe,ut(n.description),1))],2))}}),[["__scopeId","data-v-db9bdf1b"]]),eR="xlsx_toolbox",kEe="TOOLBOX_EXPORT_DATA",AEe="https://app.arbocollab.com",OEe=e=>{const t=yn("switchInstance",void 0),n=r=>{const{source:i,template:a}=r??{};console.log("Opening toolbox with payload:",r);const l={showLoad:!1};if(t?t(eR,"",l):window.appManager.switchInstance(eR,"",l),!i||!a)throw new Error("Source or template file is missing");setTimeout(()=>{const c=`${sessionStorage.getItem("BASE_URL")}`;window.postMessage({type:"xlsx-mapping:load",payload:{source:i,template:a}},c)},1e3)};let o;const s=r=>{var i;if(console.log("Received postMessage event:",r),((i=r.data)==null?void 0:i.type)===kEe){const{file:a,fileName:l}=r.data.payload;e(new File([a],l,{type:a.type}),l),window.appManager.hide(eR)}};return Qt(()=>{o=jE({target:window,allowedOrigins:[sessionStorage.getItem("BASE_URL")||AEe],onMessage:r=>{s({data:r})},onInvalidMessage:(r,i,a)=>{console.warn("Rejected postMessage:",i,a.origin)}}),window.addEventListener("message",s)}),qn(()=>o==null?void 0:o()),{openToolbox:n}},MEe={class:"header-name"},NEe={class:"modal-body"},LEe={class:"description"},VEe={key:0,class:"error-message"},BEe={class:"dynamic"},$Ee={key:1,class:"choose-method-container"},HEe={key:2,class:"select-status-container"},GEe={key:3,class:"result-container"},UEe={key:4,class:"result-container"},L$="text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",WEe=20,zEe=Ct(st({__name:"PopupToolboxUploader",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const o=q(()=>dP()),s=q(()=>({1:{title:`Create ${o.value} in bulk`,description:""},2:{title:"Select status",description:"Choose a status for the new work "},3:{title:"Import successful",description:"Work will be created in background. Refresh to see updates."},4:{title:"Import failed",description:"File doesn’t meet requirements. Check file and try again."},5:{title:"Waiting for Toolbox",description:"Waiting for Toolbox"}})),r={"--popup-pt":"20px","--popup-pb":"20px","--popup-pl":"24px","--popup-pr":"24px"},i=e,a=n,{apiServices:l}=Zn(!1,i),c=B(),u=B(2),d=B(null),h=B(null),f=B(null),p=B(void 0),g=B(null),v=q(()=>s.value[u.value]),w=()=>{d.value=null,u.value=1,h.value=null,f.value=null,S.value=null,g.value=null,p.value=void 0};tt([h,f],([P,D])=>{u.value===1&&P&&D&&(u.value=2)});const S=B(null),b=P=>{console.error(P),S.value=P},C=async(P,D)=>{var G,J,ae;if(A.value=!0,console.log("Uploading file:",P),!l.value||!i.workspaceId||!i.entityId){console.error("API services not available");return}const N=new FormData;N.append("file",P),N.append("format",((G=D??P.name)==null?void 0:G.split(".").pop())??P.name.split(".").pop()??""),N.append("entity_id",i.entityId),N.append("template_flow_status_id",d.value??"");try{await l.value.addNewSceneViaImportFile(i.workspaceId,i.entityId,N),u.value=3,a("import-success")}catch(ne){console.error("Error uploading file:",ne),b(((ae=(J=ne.response)==null?void 0:J.data)==null?void 0:ae.message)||"An unknown error occurred during file upload."),u.value=4}finally{A.value=!1}},{openToolbox:_}=OEe((P,D)=>{console.log("File received from toolbox:",P),f.value=P,p.value=D??P.name,u.value=2}),E=async()=>{const P=await I();try{_({source:void 0,template:P})}catch(D){console.error("Error opening toolbox:",D),oa().showErrorNetMessage("Failed to open toolbox.")}},x=B(!1),I=async()=>{x.value=!0;const P=i.workspaceId,D=i.entityId;if(!P||!D||!l.value)return console.error("Workspace ID or Entity ID is missing"),Promise.reject(new Error("Workspace ID or Entity ID is missing"));try{const N=await l.value.downloadTemplate(P,D,!1);if(console.log("Downloaded template response:",N),!N)throw new Error("No response from downloadTemplate API");return N}catch(N){return console.error("Error downloading template:",N),Promise.reject(N)}finally{x.value=!1}},F=P=>{console.log("Validating file:",P.type);const D=L$.includes(P.type);return D||(console.error("Invalid file type:",P.type),oa().addNotification({id:"invalid-file-type",message:"Invalid file type. Please upload a xlsx, xls, csv file.",type:"error"})),D},M=async()=>{const P=document.createElement("input");P.type="file",P.accept=L$,P.onchange=async()=>{var N;const D=(N=P.files)==null?void 0:N[0];if(D){if(!F(D)){w();return}h.value=ob(D);try{const G=await I();if(console.log("Template file downloaded:",G),!G){oa().addNotification({id:"failed-download-template",message:"Failed to download template file.",type:"error"});return}_({source:D,template:G})}catch(G){console.error("Error opening toolbox:",G),oa().addNotification({id:"failed-open-toolbox",message:"Failed to open toolbox.",type:"error"})}}},P.click()},T=async P=>{var D;if(!((D=l.value)!=null&&D.getAssignableStatuses)){console.error("API services not available");return}return l.value.getAssignableStatuses(i.workspaceId,{entity_id:i.entityId,name_like:P.name_like,page:P.page,per_page:WEe})},A=B(!1),k=()=>{d.value&&f.value&&(A.value=!0,C(f.value,p.value).finally(()=>{A.value=!1}))};return t({open:()=>{var P;return(P=c.value)==null?void 0:P.show()},close:()=>{var P;return(P=c.value)==null?void 0:P.hide()}}),(P,D)=>(K(),Ue(H(zS),Wt({ref_key:"popupRef",ref:c,style:r,onHidden:w},{popupIndex:10,popupName:v.value.title,minWidth:"420px",showOverlay:!0,overlayOpacity:.5,closeOnOverlayClick:!1,closeOnEscape:!0}),tu({header:he(()=>[me("span",MEe,ut(v.value.title),1)]),default:he(()=>[me("div",NEe,[me("div",LEe,ut(v.value.description),1),S.value?(K(),ie("div",VEe,[D[1]||(D[1]=Qe(" Error code ",-1)),me("span",BEe,ut(S.value),1)])):Xe("",!0),u.value===1?(K(),ie("div",$Ee,[ue(N$,{disabled:!0,label:"Start with a blank sheet",description:`Type or paste ${o.value} details
|
|
260
|
+
`,dbe=class extends $ve{constructor(e){super(e),this.config=e,this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:n}=e;this.suppressQuotes=t,this.columnSeparator=n}addCustomContent(e){e&&(typeof e=="string"?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,I$),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((n,o)=>{o!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(n.data.value||""),n.mergeAcross&&this.appendEmptyCells(n.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,n,o){n!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(o)}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,n){t!=0&&(this.result+=this.columnSeparator);const o=this.extractRowCellValue(e,t,t,"csv",n);this.result+=this.putInQuotes(o.valueFormatted??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():(Je(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=I$),this.isFirstLine=!1}},hbe=class extends Bve{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.rowGroupColsSvc=e.rowGroupColsSvc,this.valueSvc=e.valueSvc}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){Je(51);return}const t=this.getMergedParams(e),n=this.getData(t),o=new Blob(["\uFEFF",n],{type:"text/plain"}),s=typeof t.fileName=="function"?t.fileName(Pt(this.gos,{})):t.fileName;Hve(this.getFileName(s),o)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const n=t?Object.assign({},e):this.getMergedParams(e);return this.getData(n)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{colModel:t,colNames:n,rowGroupColsSvc:o,valueSvc:s,gos:r}=this,{processCellCallback:i,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:u,columnSeparator:d}=e;return new dbe({colModel:t,colNames:n,valueSvc:s,gos:r,processCellCallback:i||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:u||!1,columnSeparator:d||",",rowGroupColsSvc:o})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function fbe(e,t){var n;return(n=e.csvCreator)==null?void 0:n.getDataAsCsv(t)}function pbe(e,t){var n;(n=e.csvCreator)==null||n.exportDataAsCsv(t)}var gbe={moduleName:"CsvExport",version:dt,beans:[hbe],apiFunctions:{getDataAsCsv:fbe,exportDataAsCsv:pbe},dependsOn:[ube]},mbe=class extends We{constructor(e,t,n){super(),this.id=e,this.parentCache=t,this.params=n,this.state="needsLoading",this.version=0,this.startRow=e*n.blockSize,this.endRow=this.startRow+n.blockSize}load(){this.state="loading",this.loadFromDatasource()}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed"),this.dispatchLocalEvent({type:"loadComplete"})}pageLoaded(e,t,n){this.successCommon(e,{rowData:t,rowCount:n})}isRequestMostRecentAndLive(e){const t=e===this.version,n=this.isAlive();return t&&n}successCommon(e,t){this.dispatchLocalEvent({type:"loadComplete"}),this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}postConstruct(){this.rowNodes=[];const{params:{blockSize:e,rowHeight:t},startRow:n,beans:o,rowNodes:s}=this;for(let r=0;r<e;r++){const i=n+r,a=new pl(o);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(i),a.setRowTop(t*i),s.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:n,state:o}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:n,pageStatus:o}}}setDataAndId(e,t,n){ft(t)?e.setDataAndId(t,n.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Bn(this.params.datasource.getRows)){Je(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:n,params:{sortModel:o,filterModel:s},gos:r}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,n),failCallback:this.pageLoadFailed.bind(this,n),sortModel:o,filterModel:s,context:Pt(r,{}).context}}forEachNode(e,t,n){this.rowNodes.forEach((o,s)=>{this.startRow+s<n&&e(o,t.value++)})}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.value++);const n=e-this.startRow;return this.rowNodes[n]}processServerResult(e){const{rowNodes:t,beans:n}=this;t.forEach((s,r)=>{const i=e.rowData?e.rowData[r]:void 0;!s.id&&s.alreadyRendered&&i&&(t[r]=new pl(n),t[r].setRowIndex(s.rowIndex),t[r].setRowTop(s.rowTop),t[r].setRowHeight(s.rowHeight),s.clearRowTopAndRowIndex()),this.setDataAndId(t[r],i,this.startRow+r)});const o=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,o)}destroy(){for(const e of this.rowNodes)e.clearRowTopAndRowIndex();super.destroy()}},vbe=2,ybe=class extends We{constructor(e){super(),this.params=e,this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount}getRow(e,t=!1){const n=Math.floor(e/this.params.blockSize);let o=this.blocks[n];if(!o){if(t)return;o=this.createBlock(n)}return o.getRow(e)}createBlock(e){const t=this.params,n=this.createBean(new mbe(e,this,t));return this.blocks[n.id]=n,this.blockCount++,this.purgeBlocksIfNeeded(n),t.rowNodeBlockLoader.addBlock(n),n}refreshCache(){if(this.blockCount==0){this.purgeCache();return}for(const t of this.getBlocksInOrder())t.setStateWaitingToLoad();this.params.rowNodeBlockLoader.checkBlockToLoad()}destroy(){for(const e of this.getBlocksInOrder())this.destroyBlock(e);super.destroy()}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(ll(this.gos,`InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(i=>i!=e),n=(i,a)=>a.lastAccessed-i.lastAccessed;t.sort(n);const o=this.params.maxBlocksInCache>0,s=o?this.params.maxBlocksInCache-1:null,r=vbe-1;t.forEach((i,a)=>{const l=i.state==="needsLoading"&&a>=r,c=o?a>=s:!1;if(l||c){if(this.isBlockCurrentlyDisplayed(i)||this.isBlockFocused(i))return;this.removeBlockFromCache(i)}})}isBlockFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const{startRow:n,endRow:o}=e;return t.rowIndex>=n&&t.rowIndex<o}isBlockCurrentlyDisplayed(e){const{startRow:t,endRow:n}=e;return this.beans.rowRenderer.isRangeInRenderedViewport(t,n-1)}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{blockSize:n,overflowSize:o}=this.params,r=(e.id+1)*n+o;this.rowCount<r&&(this.rowCount=r)}}setRowCount(e,t){this.rowCount=e,ft(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t={value:0};for(const n of this.getBlocksInOrder())n.forEachNode(e,t,this.rowCount)}getBlocksInOrder(){const e=(n,o)=>n.id-o.id;return Object.values(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.id],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){this.isAlive()&&(this.destroyAllBlocksPastVirtualRowCount(),this.eventSvc.dispatchEvent({type:"storeUpdated"}))}destroyAllBlocksPastVirtualRowCount(){const e=[];for(const t of this.getBlocksInOrder())t.id*this.params.blockSize>=this.rowCount&&e.push(t);if(e.length>0)for(const t of e)this.destroyBlock(t)}purgeCache(){for(const e of this.getBlocksInOrder())this.removeBlockFromCache(e);this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const n=[];let o=-1,s=!1;const r={value:0};let i=!1;for(const l of this.getBlocksInOrder())if(!i){if(s&&o+1!==l.id){i=!0;continue}o=l.id,l.forEachNode(c=>{const u=c===e||c===t;(s||u)&&n.push(c),u&&(s=!s)},r,this.rowCount)}return i||s?[]:n}},wbe=class extends We{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(){return!1}postConstruct(){if(this.gos.get("rowModelType")!=="infinite")return;const e=this.beans,t=new pl(e);this.rootNode=t,t.level=-1,this.rowHeight=Rc(e),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache())}start(){this.setDatasource(this.gos.get("datasource"))}destroy(){this.destroyDatasource(),super.destroy(),this.rootNode=null}destroyDatasource(){this.datasource&&(this.destroyBean(this.datasource),this.beans.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedEventListeners({filterChanged:this.reset.bind(this),sortChanged:this.reset.bind(this),newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.dispatchModelUpdatedEvent.bind(this)}),this.addManagedPropertyListener("datasource",()=>this.setDatasource(this.gos.get("datasource"))),this.addManagedPropertyListener("cacheBlockSize",()=>this.resetCache()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=Rc(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){var t;let e;this.cacheParams?e=!Yf(this.cacheParams.sortModel,((t=this.beans.sortSvc)==null?void 0:t.getSortModel())??[]):e=!0,e&&this.reset()}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){var n;return((n=this.infiniteCache)==null?void 0:n.getRowNodesInRange(e,t))??[]}reset(){var n;if(!this.datasource)return;_d(this.gos)!=null||(n=this.beans.selectionSvc)==null||n.reset("rowDataChanged"),this.resetCache()}dispatchModelUpdatedEvent(){this.eventSvc.dispatchEvent({type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1})}resetCache(){this.destroyCache();const e=this.beans,{filterManager:t,sortSvc:n,rowNodeBlockLoader:o,eventSvc:s,gos:r}=e;this.cacheParams={datasource:this.datasource,filterModel:(t==null?void 0:t.getFilterModel())??{},sortModel:(n==null?void 0:n.getSortModel())??[],rowNodeBlockLoader:o,initialRowCount:r.get("infiniteInitialRowCount"),maxBlocksInCache:r.get("maxBlocksInCache"),rowHeight:Rc(e),overflowSize:r.get("cacheOverflowSize"),blockSize:r.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new ybe(this.cacheParams)),s.dispatchEventOnce({type:"rowCountReady"}),this.dispatchModelUpdatedEvent()}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)}),this.dispatchModelUpdatedEvent()}destroyCache(){this.infiniteCache=this.destroyBean(this.infiniteCache)}getRow(e){const t=this.infiniteCache;if(t&&!(e>=t.getRowCount()))return t.getRow(e)}getRowNode(e){let t;return this.forEachNode(n=>{n.id===e&&(t=n)}),t}forEachNode(e){var t;(t=this.infiniteCache)==null||t.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),n=this.getRowCount()-1;return t>n?n:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){var e;(e=this.infiniteCache)==null||e.refreshCache()}purgeCache(){var e;(e=this.infiniteCache)==null||e.purgeCache()}isLastRowIndexKnown(){var e;return((e=this.infiniteCache)==null?void 0:e.isLastRowIndexKnown())??!1}setRowCount(e,t){var n;(n=this.infiniteCache)==null||n.setRowCount(e,t)}resetRowHeights(){}onRowHeightChanged(){}};function Cbe(e){var t;(t=Gy(e))==null||t.refreshCache()}function bbe(e){var t;(t=Gy(e))==null||t.purgeCache()}function Sbe(e){var t;return(t=Gy(e))==null?void 0:t.getRowCount()}var Ebe=class extends We{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=hae(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=Lo(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){Gr(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad()}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),this.maxConcurrentRequests!=null&&this.activeBlockLoadsCount>=this.maxConcurrentRequests){ll(this.gos,"RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.maxConcurrentRequests!=null?this.maxConcurrentRequests-this.activeBlockLoadsCount:1,t=this.blocks.filter(n=>n.state==="needsLoading").slice(0,e);this.activeBlockLoadsCount+=t.length;for(const n of t)n.load();this.printCacheStatus()}getBlockState(){const e={};return this.blocks.forEach(t=>{const{id:n,state:o}=t.getBlockStateJson();e[n]=o}),e}printCacheStatus(){ll(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},_be={moduleName:"InfiniteRowModelCore",version:dt,rowModels:["infinite"],beans:[wbe,Ebe]},Rbe={moduleName:"InfiniteRowModel",version:dt,apiFunctions:{refreshInfiniteCache:Cbe,purgeInfiniteCache:bbe,getInfiniteRowCount:Sbe},dependsOn:[_be,VCe]},Dbe="↑",Tbe="↓",Ibe={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},xbe=class extends bn{constructor(){super(Ibe),this.eValue=ht,this.eDelta=ht,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const n=Math.abs(t),o=e.formatValue(n),s=ft(o)?o:n,r=t>=0,i=this.eDelta;r?i.textContent=Dbe+s:i.textContent=Tbe+s,i.classList.toggle("ag-value-change-delta-up",r),i.classList.toggle("ag-value-change-delta-down",!r)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),No(this.eDelta)}refresh(e,t=!1){var c;const{value:n,valueFormatted:o}=e,{eValue:s,lastValue:r,beans:i}=this;if(n===r||(ft(o)?s.textContent=o:ft(n)?s.textContent=n:No(s),(c=i.filterManager)!=null&&c.isSuppressFlashingCellsBecauseFiltering()))return!1;const a=n&&typeof n=="object"&&"toNumber"in n?n.toNumber():n,l=r&&typeof r=="object"&&"toNumber"in r?r.toNumber():r;if(a===l)return!1;if(typeof a=="number"&&typeof l=="number"){const u=a-l;this.showDelta(e,u)}return r&&s.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=n,!0}},Fbe=".ag-value-slide-out{opacity:1}:where(.ag-ltr) .ag-value-slide-out{margin-right:5px;transition:opacity 3s,margin-right 3s}:where(.ag-rtl) .ag-value-slide-out{margin-left:5px;transition:opacity 3s,margin-left 3s}:where(.ag-ltr,.ag-rtl) .ag-value-slide-out{transition-timing-function:linear}.ag-value-slide-out-end{opacity:0}:where(.ag-ltr) .ag-value-slide-out-end{margin-right:10px}:where(.ag-rtl) .ag-value-slide-out-end{margin-left:10px}",Pbe={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},kbe=class extends bn{constructor(){super(Pbe),this.eCurrent=ht,this.refreshCount=0,this.registerCSS(Fbe)}init(e){this.refresh(e,!0)}addSlideAnimation(){var s;this.refreshCount++;const e=this.refreshCount;(s=this.ePrevious)==null||s.remove();const{beans:t,eCurrent:n}=this,o=ao({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=o,o.textContent=n.textContent,this.getGui().insertBefore(o,n),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{var r;e===this.refreshCount&&((r=this.ePrevious)==null||r.remove(),this.ePrevious=null)},3e3)})}refresh(e,t=!1){var s;let n=e.value;if(Bn(n)&&(n=""),n===this.lastValue||(s=this.beans.filterManager)!=null&&s.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=n;const o=this.eCurrent;return ft(e.valueFormatted)?o.textContent=e.valueFormatted:ft(e.value)?o.textContent=n:No(o),!0}},Abe=class extends We{constructor(){super(...arguments),this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(e,t,n=this.beans.gos.get("cellFlashDuration"),o=this.beans.gos.get("cellFadeDuration")){const s=this.animations[t];s.delete(e);const r=Date.now(),i=r+n,a=r+n+o,l={phase:"flash",flashEndTime:i,fadeEndTime:a};s.set(e,l);const c=`ag-cell-${t}`,u=`${c}-animation`,{comp:d,eGui:{style:h}}=e;d.toggleCss(c,!0),d.toggleCss(u,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&i+15<this.nextAnimationTime&&(clearTimeout(this.nextAnimationCycle),this.nextAnimationCycle=null,this.nextAnimationTime=null),this.nextAnimationCycle||(this.beans.frameworkOverrides.wrapIncoming(()=>{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),n)}),this.nextAnimationTime=i)}advanceAnimations(){const e=Date.now();let t=null;for(const n of Object.keys(this.animations)){const o=this.animations[n],s=`ag-cell-${n}`,r=`${s}-animation`;for(const[i,a]of o){if(!i.isAlive()||!i.comp){o.delete(i);continue}const{phase:l,flashEndTime:c,fadeEndTime:u}=a,d=l==="flash"?c:u;if(!(e+15>=d)){t=Math.min(d,t??1/0);continue}const{comp:f,eGui:{style:p}}=i;switch(l){case"flash":f.toggleCss(s,!1),f.toggleCss(r,!0),p.transition=`background-color ${u-c}ms`,p.transitionDelay=`${c-e}ms`,t=Math.min(u,t??1/0),a.phase="fade";break;case"fade":f.toggleCss(s,!1),f.toggleCss(r,!1),p.removeProperty("transition"),p.removeProperty("transition-delay"),o.delete(i);break}}}t==null?(this.nextAnimationTime=null,this.nextAnimationCycle=null):t&&(this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),t-e),this.nextAnimationTime=t)}onFlashCells(e,t){if(!e.comp)return;const n=khe(e.cellPosition);t.cells[n]&&this.animateCell(e,"highlight")}flashCell(e,t){this.animateCell(e,"data-changed",t==null?void 0:t.flashDuration,t==null?void 0:t.fadeDuration)}destroy(){for(const e of Object.keys(this.animations))this.animations[e].clear()}};function Obe(e,t={}){const{cellFlashSvc:n}=e;n&&e.frameworkOverrides.wrapIncoming(()=>{for(const o of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))n.flashCell(o,t)})}var Mbe={moduleName:"HighlightChanges",version:dt,beans:[Abe],userComponents:{agAnimateShowChangeCellRenderer:xbe,agAnimateSlideCellRenderer:kbe},apiFunctions:{flashCells:Obe}};function Nbe(e){var t;return((t=e.stateSvc)==null?void 0:t.getState())??{}}function Lbe(e,t,n){var o;return(o=e.stateSvc)==null?void 0:o.setState(t,n)}function x$(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=Vbe(e)),e.version=dt,e}function Vbe(e){return e.cellSelection=Bbe(e,"rangeSelection"),e}function Bbe(e,t){if(e&&typeof e=="object")return e[t]}var $be=class extends We{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Lo(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=Lo(this,()=>{this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(this.updateCachedState("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowGroupExpansion",void 0)):(this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("ssrmRowGroupExpansion",void 0))},0),this.onRowSelectedDebounced=Lo(this,()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}postConstruct(){const{gos:e,ctrlsSvc:t,colDelayRenderSvc:n}=this.beans;this.isClientSideRowModel=ro(e);const o=x$(e.get("initialState")??{}),s=o.partialColumnState;delete o.partialColumnState,this.cachedState=o;const r=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>r(()=>this.setupStateOnGridReady(o))),(o.columnOrder||o.columnVisibility||o.columnSizing||o.columnPinning||o.columnGroup)&&(n==null||n.hideColumns("columnState"));const[i,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:c})=>{c==="gridInitializing"&&(i(),r(()=>{this.setupStateOnColumnsInitialised(o,!!s),n==null||n.revealColumns("columnState")}))},rowCountReady:()=>{a==null||a(),r(()=>this.setupStateOnRowCountReady(o))},firstDataRendered:()=>{l==null||l(),r(()=>this.setupStateOnFirstDataRendered(o))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const n=x$(e);delete n.partialColumnState,this.cachedState=n,this.startSuppressEvents();const o="api",s=t?new Set(t):void 0;this.setGridReadyState(n,o,s),this.setColumnsInitialisedState(n,o,!!s,s),this.setRowCountState(n,o,s),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(n,o,s),this.stopSuppressEvents(o)})}setGridReadyState(e,t,n){var o,s;t==="api"&&!(n!=null&&n.has("sideBar"))&&((s=(o=this.beans.sideBar)==null?void 0:o.comp)==null||s.setState(e.sideBar)),this.updateCachedState("sideBar",this.getSideBarState())}setupStateOnGridReady(e){this.setGridReadyState(e,"gridInitializing");const t=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:t,sideBarUpdated:t})}updateColumnAndGroupState(){this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState())}setColumnsInitialisedState(e,t,n,o){this.setColumnState(e,t,n,o),this.setColumnGroupState(e,t,o),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const n=o=>()=>this.updateColumnState([o]);this.addManagedEventListeners({columnValueChanged:n("aggregation"),columnMoved:n("columnOrder"),columnPinned:n("columnPinning"),columnResized:n("columnSizing"),columnVisible:n("columnVisibility"),columnPivotChanged:n("pivot"),columnPivotModeChanged:n("pivot"),columnRowGroupChanged:n("rowGroup"),sortChanged:n("sort"),newColumnsLoaded:this.updateColumnAndGroupState.bind(this),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setRowCountState(e,t,n){const{filter:o,rowGroupExpansion:s,ssrmRowGroupExpansion:r,rowSelection:i,pagination:a}=e,l=(u,d)=>!(n!=null&&n.has(u))&&(d||t==="api");l("filter",o)&&this.setFilterState(o),l("rowGroupExpansion",s)&&this.setRowGroupExpansionState(r,s,t),l("rowSelection",i)&&this.setRowSelectionState(i,t),l("pagination",a)&&this.setPaginationState(a,t);const c=this.updateCachedState.bind(this);c("filter",this.getFilterState()),this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(c("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),c("rowGroupExpansion",void 0)):(c("rowGroupExpansion",this.getRowGroupExpansionState()),c("ssrmRowGroupExpansion",void 0)),c("rowSelection",this.getRowSelectionState()),c("pagination",this.getPaginationState())}setupStateOnRowCountReady(e){this.setRowCountState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>{this.updateRowGroupExpansionStateTimer=0,this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(t("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),t("rowGroupExpansion",void 0)):(t("rowGroupExpansion",this.getRowGroupExpansionState()),t("ssrmRowGroupExpansion",void 0))},o=()=>t("filter",this.getFilterState()),{gos:s,colFilter:r}=this.beans;this.addManagedEventListeners({filterChanged:o,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:n,columnRowGroupChanged:n,rowDataUpdated:()=>{(s.get("groupDefaultExpanded")!==0||s.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(n)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:i=>{(i.newPage||i.newPageSize)&&t("pagination",this.getPaginationState())}}),r&&this.addManagedListeners(r,{filterStateChanged:o})}setFirstDataRenderedState(e,t,n){const{scroll:o,cellSelection:s,focusedCell:r,columnOrder:i,rowPinning:a}=e,l=(d,h)=>!(n!=null&&n.has(d))&&(h||t==="api");l("focusedCell",r)&&this.setFocusedCellState(r),l("cellSelection",s)&&this.setCellSelectionState(s),l("scroll",o)&&this.setScrollState(o),l("rowPinning",a)&&this.setRowPinningState(a),this.setColumnPivotState(!!(i!=null&&i.orderedColIds),t);const c=this.updateCachedState.bind(this);c("sideBar",this.getSideBarState()),c("focusedCell",this.getFocusedCellState());const u=this.getRangeSelectionState();c("rangeSelection",u),c("cellSelection",u),c("scroll",this.getScrollState())}setupStateOnFirstDataRendered(e){this.setFirstDataRenderedState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>t("focusedCell",this.getFocusedCellState());this.addManagedEventListeners({cellFocused:n,cellFocusCleared:n,cellSelectionChanged:o=>{if(o.finished){const s=this.getRangeSelectionState();t("rangeSelection",s),t("cellSelection",s)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return Nve(dy(e),e.colModel.isPivotMode())}setColumnState(e,t,n,o){const{sort:s,rowGroup:r,aggregation:i,pivot:a,columnPinning:l,columnVisibility:c,columnSizing:u,columnOrder:d}=e;let h=!1;const f=(T,A)=>{const k=!(o!=null&&o.has(T))&&!!(A||t==="api");return h||(h=k),k},p={},g=T=>{let A=p[T];return A||(A={colId:T},p[T]=A,A)},v={},w=f("sort",s);w&&(s==null||s.sortModel.forEach(({colId:T,sort:A},k)=>{const P=g(T);P.sort=A,P.sortIndex=k})),(w||!n)&&(v.sort=null,v.sortIndex=null);const S=f("rowGroup",r);S&&(r==null||r.groupColIds.forEach((T,A)=>{const k=g(T);k.rowGroup=!0,k.rowGroupIndex=A})),(S||!n)&&(v.rowGroup=null,v.rowGroupIndex=null);const b=f("aggregation",i);b&&(i==null||i.aggregationModel.forEach(({colId:T,aggFunc:A})=>{g(T).aggFunc=A})),(b||!n)&&(v.aggFunc=null);const C=f("pivot",a);C&&(a==null||a.pivotColIds.forEach((T,A)=>{const k=g(T);k.pivot=!0,k.pivotIndex=A}),this.gos.updateGridOptions({options:{pivotMode:!!(a!=null&&a.pivotMode)},source:t})),(C||!n)&&(v.pivot=null,v.pivotIndex=null);const _=f("columnPinning",l);if(_){for(const T of(l==null?void 0:l.leftColIds)??[])g(T).pinned="left";for(const T of(l==null?void 0:l.rightColIds)??[])g(T).pinned="right"}(_||!n)&&(v.pinned=null);const E=f("columnVisibility",c);if(E)for(const T of(c==null?void 0:c.hiddenColIds)??[])g(T).hide=!0;(E||!n)&&(v.hide=null);const x=f("columnSizing",u);if(x)for(const{colId:T,flex:A,width:k}of(u==null?void 0:u.columnSizingModel)??[]){const P=g(T);P.flex=A??null,P.width=k}(x||!n)&&(v.flex=null);const I=d==null?void 0:d.orderedColIds,F=!!(I!=null&&I.length)&&!(o!=null&&o.has("columnOrder")),M=F?I.map(T=>g(T)):Object.values(p);(M.length||h)&&(this.columnStates=M,Ur(this.beans,{state:M,applyOrder:F,defaultState:v},t))}setColumnPivotState(e,t){const n=this.columnStates;this.columnStates=void 0;const o=this.columnGroupStates;this.columnGroupStates=void 0;const s=this.beans,{pivotResultCols:r,colGroupSvc:i}=s;if(r!=null&&r.isPivotResultColsPresent()){if(n){const a=[];for(const l of n)r.getPivotResultCol(l.colId)&&a.push(l);Ur(s,{state:a,applyOrder:e},t)}o&&(i==null||i.setColumnGroupState(o,t))}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return Lve(t)}setColumnGroupState(e,t,n){var a;const o=this.beans.colGroupSvc;if(!o||n!=null&&n.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const s=new Set((a=e.columnGroup)==null?void 0:a.openColumnGroupIds),i=o.getColumnGroupState().map(({groupId:l})=>{const c=s.has(l);return c&&s.delete(l),{groupId:l,open:c}});for(const l of s)i.push({groupId:l,open:!0});i.length&&(this.columnGroupStates=i),o.setColumnGroupState(i,t)}getFilterState(){const e=this.beans.filterManager;let t=e==null?void 0:e.getFilterModel();t&&Object.keys(t).length===0&&(t=void 0);const n=e==null?void 0:e.getFilterState(),o=(e==null?void 0:e.getAdvFilterModel())??void 0;return t||o||n?{filterModel:t,columnFilterState:n,advancedFilterModel:o}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:n,columnFilterState:o,advancedFilterModel:s}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(n!==void 0||o!==void 0)&&(t==null||t.setFilterState(n??null,o??null,"columnFilter")),s!==void 0&&(t==null||t.setAdvFilterModel(s??null,"advancedFilter"))}getRangeSelectionState(){var t;const e=(t=this.beans.rangeSvc)==null?void 0:t.getCellRanges().map(n=>{const{id:o,type:s,startRow:r,endRow:i,columns:a,startColumn:l}=n;return{id:o,type:s,startRow:r,endRow:i,colIds:a.map(c=>c.getColId()),startColId:l.getColId()}});return e!=null&&e.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeSvc:n,colModel:o,visibleCols:s}=this.beans;if(!ha(t)||!n)return;const r=[];for(const i of(e==null?void 0:e.cellRanges)??[]){const a=[];for(const c of i.colIds){const u=o.getCol(c);u&&a.push(u)}if(!a.length)continue;let l=o.getCol(i.startColId);if(!l){const c=s.allCols,u=new Set(a);l=c.find(d=>u.has(d))}r.push({...i,columns:a,startColumn:l})}n.setCellRanges(r)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.beans.ctrlsSvc.getScrollFeature(),{left:t}=(e==null?void 0:e.getHScrollPosition())??{left:0},{top:n}=(e==null?void 0:e.getVScrollPosition())??{top:0};return n||t?{top:n,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:n}=e??{top:0,left:0},{frameworkOverrides:o,rowRenderer:s,animationFrameSvc:r,ctrlsSvc:i}=this.beans;o.wrapIncoming(()=>{var a;i.get("center").setCenterViewportScrollLeft(n),(a=i.getScrollFeature())==null||a.setVerticalScrollPosition(t),s.redraw({afterScroll:!0}),r==null||r.flushAllFrames()})}getSideBarState(){var e,t;return(t=(e=this.beans.sideBar)==null?void 0:e.comp)==null?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.beans.focusSvc.getFocusedCell();if(e){const{column:t,rowIndex:n,rowPinned:o}=e;return{colId:t.getColId(),rowIndex:n,rowPinned:o}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:n}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:o,rowIndex:s,rowPinned:r}=e;t.setFocusedCell({column:n.getCol(o),rowIndex:s,rowPinned:r,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const n=e.getCurrentPage(),o=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!n&&!o))return{page:n,pageSize:o}}setPaginationState(e,t){const{pagination:n,gos:o}=this.beans;if(!n)return;const{pageSize:s,page:r}=e??{page:0,pageSize:o.get("paginationPageSize")},i=t==="gridInitializing";s&&!o.get("paginationAutoPageSize")&&n.setPageSize(s,i?"initialState":"pageSizeSelector"),typeof r=="number"&&(i?n.setPage(r):n.goToPage(r))}getRowSelectionState(){var o;const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!((o=t==null?void 0:t.toggledNodes)!=null&&o.length)?void 0:t}setRowSelectionState(e,t){var n;(n=this.beans.selectionSvc)==null||n.setSelectionState(e,t,t==="api")}getRowGroupExpansionState(){const{expansionSvc:e}=this.beans;if(e)return e.getExpansionState()}getRowPinningState(){var e;return(e=this.beans.pinnedRowModel)==null?void 0:e.getPinnedState()}setRowPinningState(e){const t=this.beans.pinnedRowModel;e?t==null||t.setPinnedState(e):t==null||t.reset()}setRowGroupExpansionState(e,t,n){const o=this.beans.expansionSvc;if(!o)return;const s=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};o.setExpansionState(s,n)}updateColumnState(e){const t=this.getColumnState();let n=!1;const o=this.cachedState;for(const s of Object.keys(t)){const r=t[s];Yf(r,o[s])||(n=!0)}this.cachedState={...o,...t},n&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const n=this.cachedState[e];this.setCachedStateValue(e,t),Yf(t,n)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState={...this.cachedState,[e]:t}}refreshStaleState(){const e=this.staleStateKeys;for(const t of e)t==="rowSelection"&&this.setCachedStateValue(t,this.getRowSelectionState());e.clear()}dispatchStateUpdateEvent(e){if(!this.suppressEvents){for(const t of e)this.queuedUpdateSources.add(t);this.dispatchStateUpdateEventDebounced()}}dispatchQueuedStateUpdateEvents(){const e=this.queuedUpdateSources,t=Array.from(e);e.clear(),this.eventSvc.dispatchEvent({type:"stateUpdated",sources:t,state:this.cachedState})}startSuppressEvents(){var e;this.suppressEvents=!0,(e=this.beans.colAnimation)==null||e.setSuppressAnimation(!0)}stopSuppressEvents(e){setTimeout(()=>{var t;this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&((t=this.beans.colAnimation)==null||t.setSuppressAnimation(!1),this.dispatchStateUpdateEvent([e]))})}suppressEventsAndDispatchInitEvent(e){this.startSuppressEvents(),e(),this.stopSuppressEvents("gridInitializing")}},Hbe={moduleName:"GridState",version:dt,beans:[$be],apiFunctions:{getState:Nbe,setState:Lbe}};function Gbe(e){return e.rowModel.isLastRowIndexKnown()}function Ube(e){var t;return((t=e.pagination)==null?void 0:t.getPageSize())??100}function Wbe(e){var t;return((t=e.pagination)==null?void 0:t.getCurrentPage())??0}function zbe(e){var t;return((t=e.pagination)==null?void 0:t.getTotalPages())??1}function jbe(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function Kbe(e){var t;(t=e.pagination)==null||t.goToNextPage()}function qbe(e){var t;(t=e.pagination)==null||t.goToPreviousPage()}function Ybe(e){var t;(t=e.pagination)==null||t.goToFirstPage()}function Zbe(e){var t;(t=e.pagination)==null||t.goToLastPage()}function Xbe(e,t){var n;(n=e.pagination)==null||n.goToPage(t)}var Jbe=class extends We{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeSvc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.centerRowsCtrl=e.center;const t=this.checkPageSize.bind(this);this.addManagedEventListeners({bodyHeightChanged:t,scrollVisibilityChanged:t}),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||this.centerRowsCtrl==null}onPaginationAutoSizeChanged(){this.notActive()?this.beans.pagination.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.viewportSizeFeature.getBodyHeight();if(e>0){const t=this.beans,n=()=>{const o=Math.max(Rc(t),1),s=Math.floor(e/o);t.pagination.setPageSize(s,"autoCalculated")};this.isBodyRendered?Lo(this,n,50)():(n(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},Pp="paginationPageSizeSelector",Qbe={tag:"span",cls:"ag-paging-page-size"},eSe=class extends bn{constructor(){super(Qbe),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.pagination.getPageSize()||(this.pagination.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}wireBeans(e){this.pagination=e.pagination}postConstruct(){this.addManagedPropertyListener(Pp,()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedEventListeners({paginationChanged:e=>this.handlePaginationChanged(e)})}handlePaginationChanged(e){if(!this.selectPageSizeComp||!(e!=null&&e.newPageSize))return;const t=this.pagination.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&!e&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp)}reset(){No(this.getGui()),this.selectPageSizeComp&&(this.selectPageSizeComp=this.destroyBean(this.selectPageSizeComp))}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel")&&!this.gos.get("paginationAutoPageSize")&&this.gos.get(Pp)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),n=!t||!e.includes(t);if(n){const s=this.gos.exists("paginationPageSize"),r=this.gos.get(Pp)!==!0;Je(94,{pageSizeSet:s,pageSizesSet:r,pageSizeOptions:e,paginationPageSizeOption:t}),r||Je(95,{paginationPageSizeOption:t,paginationPageSizeSelector:Pp}),e.unshift("")}const o=String(n?"":t);this.selectPageSizeComp?(dl(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(o,!0)):this.createPageSizeSelectorComp(e,o),this.hasEmptyOption=n}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const n=this.getLocaleTextFunc(),o=n("pageSizeSelectorLabel","Page Size:"),s=n("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new B0).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(s).setLabel(o).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(Pp);return!Array.isArray(t)||!(t!=null&&t.length)?e:[...t].sort((n,o)=>n-o)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},tSe={selector:"AG-PAGE-SIZE-SELECTOR",component:eSe},nSe=".ag-paging-panel{align-items:center;border-top:var(--ag-footer-row-border);display:flex;gap:calc(var(--ag-spacing)*4);height:var(--ag-pagination-panel-height);justify-content:flex-end;padding:0 var(--ag-cell-horizontal-padding)}:where(.ag-paging-page-size) .ag-wrapper{min-width:50px}.ag-paging-page-summary-panel{align-items:center;display:flex;gap:var(--ag-cell-widget-spacing);.ag-disabled &{pointer-events:none}}.ag-paging-button{cursor:pointer;position:relative;&.ag-disabled{cursor:default;opacity:.5}}.ag-paging-number,.ag-paging-row-summary-panel-number{font-weight:500}",oSe=class extends $V{constructor(){super(),this.btFirst=ht,this.btPrevious=ht,this.btNext=ht,this.btLast=ht,this.lbRecordCount=ht,this.lbFirstRowOnPage=ht,this.lbLastRowOnPage=ht,this.lbCurrent=ht,this.lbTotal=ht,this.pageSizeComp=ht,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(nSe)}wireBeans(e){this.rowModel=e.rowModel,this.pagination=e.pagination,this.ariaAnnounce=e.ariaAnnounce}postConstruct(){const e=this.gos.get("enableRtl");this.setTemplate(this.getTemplate(),[tSe]);const{btFirst:t,btPrevious:n,btNext:o,btLast:s}=this;this.activateTabIndex([t,n,o,s]),t.insertAdjacentElement("afterbegin",hr(e?"last":"first",this.beans)),n.insertAdjacentElement("afterbegin",hr(e?"next":"previous",this.beans)),o.insertAdjacentElement("afterbegin",hr(e?"previous":"next",this.beans)),s.insertAdjacentElement("afterbegin",hr(e?"first":"last",this.beans)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],()=>this.onPageSizeRelatedOptionsChange()),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:r=>this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(r):Jue(this.beans,r),forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}onPaginationChanged(){const t=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(t),t&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){if(!this.areListenersSetup){this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)});for(const e of[{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)}]){const{el:t,fn:n}=e;this.addManagedListeners(t,{click:n,keydown:o=>{(o.key===Oe.ENTER||o.key===Oe.SPACE)&&(o.preventDefault(),n())}})}Xue(this.beans,this,this.getGui()),this.areListenersSetup=!0}}onBtFirst(){this.previousAndFirstButtonsDisabled||this.pagination.goToFirstPage()}formatNumber(e){const t=this.gos.getCallback("paginationNumberFormatter");return t?t({value:e}):Vve(e,this.getLocaleTextFunc.bind(this))}getTemplate(){const e=this.getLocaleTextFunc(),t=`ag-${this.getCompId()}`;return{tag:"div",cls:"ag-paging-panel ag-unselectable",attrs:{id:`${t}`},children:[{tag:"ag-page-size-selector",ref:"pageSizeComp"},{tag:"span",cls:"ag-paging-row-summary-panel",children:[{tag:"span",ref:"lbFirstRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-first-row`}},{tag:"span",attrs:{id:`${t}-to`},children:e("to","to")},{tag:"span",ref:"lbLastRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-last-row`}},{tag:"span",attrs:{id:`${t}-of`},children:e("of","of")},{tag:"span",ref:"lbRecordCount",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-row-count`}}]},{tag:"span",cls:"ag-paging-page-summary-panel",role:"presentation",children:[{tag:"div",ref:"btFirst",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("firstPage","First Page")}},{tag:"div",ref:"btPrevious",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("previousPage","Previous Page")}},{tag:"span",cls:"ag-paging-description",children:[{tag:"span",attrs:{id:`${t}-start-page`},children:e("page","Page")},{tag:"span",ref:"lbCurrent",cls:"ag-paging-number",attrs:{id:`${t}-start-page-number`}},{tag:"span",attrs:{id:`${t}-of-page`},children:e("of","of")},{tag:"span",ref:"lbTotal",cls:"ag-paging-number",attrs:{id:`${t}-of-page-number`}}]},{tag:"div",ref:"btNext",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("nextPage","Next Page")}},{tag:"div",ref:"btLast",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("lastPage","Last Page")}}]}]}}onBtNext(){this.nextButtonDisabled||this.pagination.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.pagination.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.pagination.goToLastPage()}enableOrDisableButtons(){const e=this.pagination.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),n=this.pagination.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const o=this.isZeroPagesToDisplay(),s=e===n-1;this.nextButtonDisabled=s||o,this.lastButtonDisabled=!t||o||e===n-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){hie(e,t),e.classList.toggle("ag-disabled",t)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages();return e&&t===0}updateLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages(),n=this.pagination.getMasterRowCount(),o=e?n:null,s=this.pagination.getCurrentPage(),r=this.pagination.getPageSize();let i,a;this.isZeroPagesToDisplay()?i=a=0:(i=r*s+1,a=i+r-1,e&&a>o&&(a=o));const l=i+r-1,c=!e&&n<l,u=this.formatNumber(i);this.lbFirstRowOnPage.textContent=u;let d;const h=this.getLocaleTextFunc();c?d=h("pageLastRowUnknown","?"):d=this.formatNumber(a),this.lbLastRowOnPage.textContent=d;const p=t>0?s+1:0,g=this.formatNumber(p);this.lbCurrent.textContent=g;let v,w;if(e)v=this.formatNumber(t),w=this.formatNumber(o);else{const S=h("more","more");v=S,w=S}this.lbTotal.textContent=v,this.lbRecordCount.textContent=w,this.announceAriaStatus(u,d,w,g,v)}announceAriaStatus(e,t,n,o,s){var d,h;const r=this.getLocaleTextFunc(),i=r("page","Page"),a=r("to","to"),l=r("of","of"),c=`${e} ${a} ${t} ${l} ${n}`,u=`${i} ${o} ${l} ${s}`;c!==this.ariaRowStatus&&(this.ariaRowStatus=c,(d=this.ariaAnnounce)==null||d.announceValue(c,"paginationRow")),u!==this.ariaPageStatus&&(this.ariaPageStatus=u,(h=this.ariaAnnounce)==null||h.announceValue(u,"paginationPage"))}},sSe={selector:"AG-PAGINATION",component:oSe},rSe=class extends We{constructor(){super(...arguments),this.beanName="pagination",this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.masterRowCount=0}postConstruct(){const e=this.gos;this.active=e.get("pagination"),this.pageSizeFromGridOptions=e.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this))}getPaginationSelector(){return sSe}isPaginateChildRows(){const e=this.gos;return e.get("groupHideParentOfSingleChild")||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")?!0:e.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){const t=this.currentPage;if(!this.active||t===e||typeof t!="number")return;const{editSvc:n}=this.beans;n!=null&&n.isEditing()&&(n.isBatchEditing()?n.cleanupEditors():n.stopEditing(void 0,{source:"api"})),this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0})}goToPageWithIndex(e){var n,o;if(!this.active)return;let t=e;this.paginateChildRows||(t=((o=(n=this.beans.rowModel).getTopLevelIndexFromDisplayedIndex)==null?void 0:o.call(n,e))??e),this.goToPage(Math.floor(t/this.pageSize))}isRowInPage(e){return this.active?e>=this.topDisplayedRowIndex&&e<=this.bottomDisplayedRowIndex:!0}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.beans.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return ft(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:ft(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:ft(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:ft(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.beans.pageBounds.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(this.pageSizeAutoCalculated===void 0)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const n=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,this.currentPage!==0&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,this.currentPage!==0&&this.goToFirstPage();break}n!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){const e=this.totalPages;this.currentPage>=e&&(this.currentPage=e-1);const t=this.currentPage;(!isFinite(t)||isNaN(t)||t<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){const e=this.beans.rowModel,t=e.getTopLevelRowCount();if(this.masterRowCount=t,t<=0){this.setZeroRows();return}const n=this.pageSize,o=t-1;this.totalPages=Math.floor(o/n)+1,this.adjustCurrentPageIfInvalid();const s=this.currentPage,r=n*s;let i=n*(s+1)-1;if(i>o&&(i=o),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(r),i===o)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=a-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){const e=this.beans.rowModel.getRowCount();if(this.masterRowCount=e,e===0){this.setZeroRows();return}const{pageSize:t,currentPage:n}=this,o=e-1;this.totalPages=Math.floor(o/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*n,this.bottomDisplayedRowIndex=t*(n+1)-1,this.bottomDisplayedRowIndex>o&&(this.bottomDisplayedRowIndex=o)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.beans.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:n=!1,newPageSize:o=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:n,newPageSize:o,keepRenderedRows:t})}},iSe={moduleName:"Pagination",version:dt,beans:[rSe,Jbe],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:Gbe,paginationGetPageSize:Ube,paginationGetCurrentPage:Wbe,paginationGetTotalPages:zbe,paginationGetRowCount:jbe,paginationGoToNextPage:Kbe,paginationGoToPreviousPage:qbe,paginationGoToFirstPage:Ybe,paginationGoToLastPage:Zbe,paginationGoToPage:Xbe},dependsOn:[Uy]};function aSe(e,t={}){const n=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(n))}function F$(e,t,n,o,s){t&&(o&&t.parent&&t.parent.level!==-1&&F$(e,t.parent,n,o,s),t.setExpanded(n,void 0,s))}function lSe(e,t){return e.rowModel.getRowNode(t)}function cSe(e,t,n,o){e.rowRenderer.addRenderedRowListener(t,n,o)}function uSe(e){return e.rowRenderer.getRenderedNodes()}function dSe(e,t,n){e.rowModel.forEachNode(t,n)}function hSe(e){return e.rowRenderer.firstRenderedRow}function fSe(e){return e.rowRenderer.lastRenderedRow}function pSe(e,t){return e.rowModel.getRow(t)}function gSe(e){return e.rowModel.getRowCount()}var mSe={moduleName:"RowApi",version:dt,apiFunctions:{redrawRows:aSe,setRowNodeExpanded:F$,getRowNode:lSe,addRenderedRowListener:cSe,getRenderedNodes:uSe,forEachNode:dSe,getFirstDisplayedRowIndex:hSe,getLastDisplayedRowIndex:fSe,getDisplayedRowAtIndex:pSe,getDisplayedRowCount:gSe}},vSe={moduleName:"ScrollApi",version:dt,apiFunctions:{getVerticalPixelRange:Fwe,getHorizontalPixelRange:Pwe,ensureColumnVisible:d$,ensureIndexVisible:h$,ensureNodeVisible:kwe}};function ySe(e,t,n){if(!t)return;const o=e.ctrlsSvc.getGridBodyCtrl().eGridBody,s=`aria-${t}`;n===null?o.removeAttribute(s):o.setAttribute(s,n)}function wSe(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function CSe(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function bSe(e){var t;return((t=e.animationFrameSvc)==null?void 0:t.isQueueEmpty())??!0}function SSe(e){var t;(t=e.animationFrameSvc)==null||t.flushAllFrames()}function ESe(e){return{rowHeight:Rc(e),headerHeight:yp(e)}}function _Se(e,t={}){var r;const n=[];for(const i of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const a=i.getCellRenderer();a!=null&&n.push(gp(a))}if((r=t.columns)!=null&&r.length)return n;const o=[],s=N_(t.rowNodes);for(const i of e.rowRenderer.getAllRowCtrls()){if(s&&!L_(i.rowNode,s)||!i.isFullWidth())continue;const a=i.getFullWidthCellRenderers();for(let l=0;l<a.length;l++){const c=a[l];c!=null&&o.push(gp(c))}}return[...o,...n]}var RSe={moduleName:"RenderApi",version:dt,apiFunctions:{setGridAriaProperty:ySe,refreshCells:wSe,refreshHeader:CSe,isAnimationFrameQueueEmpty:bSe,flushAllAnimationFrames:SSe,getSizesForCurrentTheme:ESe,getCellRendererInstances:_Se}};function DSe(e,t){var n,o;typeof t=="number"?(n=e.colAutosize)==null||n.sizeColumnsToFit(t,"api"):(o=e.colAutosize)==null||o.sizeColumnsToFitGridBody(t)}function P$({colAutosize:e,visibleCols:t},n,o){Array.isArray(n)?e==null||e.autoSizeCols({colKeys:n,skipHeader:o,source:"api"}):e==null||e.autoSizeCols({...n,colKeys:n.colIds??t.allCols,source:"api"})}function TSe(e,t){var n;t&&typeof t=="object"?P$(e,t):(n=e.colAutosize)==null||n.autoSizeAllColumns({source:"api",skipHeader:t})}var ISe=class extends We{constructor(){super(...arguments),this.beanName="colAutosize",this.timesDelayed=0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}postConstruct(){var n;const{gos:e}=this,t=e.get("autoSizeStrategy");if(t){let o=!1;const s=t.type;if(s==="fitGridWidth"||s==="fitProvidedWidth")o=!0;else if(s==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const r=e.get("rowData");o=r!=null&&r.length>0&&ro(e)}o&&((n=this.beans.colDelayRenderSvc)==null||n.hideColumns(s))}}autoSizeCols(e){const{eventSvc:t,visibleCols:n}=this.beans;this.innerAutoSizeCols(e).then(o=>{var c;const s=u=>Td(t,Array.from(u),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return s(o);const r=k$(this.beans),i=u=>n.leftCols.some(d=>hp(d,u)),a=u=>n.rightCols.some(d=>hp(d,u)),l=e.colKeys.filter(u=>!pa(u)&&!ga(u)&&!i(u)&&!a(u));this.sizeColumnsToFit(r,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:(c=e.columnLimits)==null?void 0:c.map(u=>({...u,key:u.colId})),colKeys:l,onlyScaleUp:!0}),s(o)})}innerAutoSizeCols(e){return new Promise((t,n)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,n));const{colKeys:o,skipHeader:s,skipHeaderGroups:r,stopAtGroup:i,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:c=[],source:u="api"}=e,{animationFrameSvc:d,renderStatus:h,colModel:f,autoWidthCalc:p,visibleCols:g}=this.beans;if(d==null||d.flushAllFrames(),this.timesDelayed<5&&h&&(!h.areHeaderCellsRendered()||!h.areCellsRendered())){this.timesDelayed++,setTimeout(()=>{this.isAlive()&&this.innerAutoSizeCols(e).then(t,n)});return}this.timesDelayed=0;const v=new Set;let w=-1;const S=Object.fromEntries(c.map(({colId:_,...E})=>[_,E])),b=s??this.gos.get("skipHeaderOnAutoSize"),C=r??b;for(;w!==0;){w=0;const _=[];for(const E of o){if(!E||Rae(E))continue;const x=f.getCol(E);if(!x||v.has(x))continue;const I=p.getPreferredWidthForColumn(x,b);if(I>0){const F=S[x.colId]??{};F.minWidth??(F.minWidth=l),F.maxWidth??(F.maxWidth=a);const M=xSe(x,I,F);x.setActualWidth(M,u),v.add(x),w++}_.push(x)}_.length&&g.refresh(u)}C||this.autoSizeColumnGroupsByColumns(o,u,i),t(v)})}autoSizeColumn(e,t,n){this.autoSizeCols({colKeys:[e],skipHeader:n,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,n){const{colModel:o,ctrlsSvc:s}=this.beans,r=new Set,i=o.getColsForKeys(e);for(const l of i){let c=l.getParent();for(;c&&c!=n;)c.isPadding()||r.add(c),c=c.getParent()}let a;for(const l of r){for(const c of s.getHeaderRowContainerCtrls())if(a=c.getHeaderCtrlForColumn(l),a)break;a==null||a.resizeLeafColumnsToFit(t)}}autoSizeAllColumns(e){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.autoSizeAllColumns(e));return}this.autoSizeCols({colKeys:this.beans.visibleCols.allCols,...e})}addColumnAutosizeListeners(e,t){const n=this.gos.get("skipHeaderOnAutoSize"),o=()=>{this.autoSizeColumn(t,"uiColumnResized",n)};e.addEventListener("dblclick",o);const s=new Mc(e);return s.addEventListener("doubleTap",o),()=>{e.removeEventListener("dblclick",o),s.destroy()}}addColumnGroupResize(e,t,n){const o=this.gos.get("skipHeaderOnAutoSize"),s=()=>{const r=[],i=t.getDisplayedLeafColumns();for(const a of i)a.getColDef().suppressAutoSize||r.push(a.getColId());r.length>0&&this.autoSizeCols({colKeys:r,skipHeader:o,stopAtGroup:t,source:"uiColumnResized"}),n()};return e.addEventListener("dblclick",s),()=>e.removeEventListener("dblclick",s)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const n=k$(this.beans);if(n>0){this.sizeColumnsToFit(n,"sizeColumnsToFit",!1,e);return}t===void 0?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,100)},0):t===100?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,500)},100):t===500?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,-1)},500):Je(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",n,o){var p,g;if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,n,o));return}const s={};for(const{key:v,...w}of(o==null?void 0:o.columnLimits)??[])s[typeof v=="string"?v:v.getColId()]=w;const r=this.beans.visibleCols.allCols;if(e<=0||!r.length)return;const i=fa(r);if(o!=null&&o.onlyScaleUp&&i>e||e===i&&r.every(w=>{if(w.colDef.suppressSizeToFit)return!0;const S=s==null?void 0:s[w.getId()],b=(S==null?void 0:S.minWidth)??(o==null?void 0:o.defaultMinWidth),C=(S==null?void 0:S.maxWidth)??(o==null?void 0:o.defaultMaxWidth),_=w.getActualWidth();return(b==null||_>=b)&&(C==null||_<=C)}))return;const l=[],c=[];for(const v of r){const w=((p=o==null?void 0:o.colKeys)==null?void 0:p.some(S=>hp(v,S)))??!0;v.getColDef().suppressSizeToFit||!w?c.push(v):l.push(v)}const u=l.slice(0);let d=!1;const h=v=>{Gr(l,v),c.push(v)};for(const v of l){v.resetActualWidth(t);const w=s==null?void 0:s[v.getId()],S=(w==null?void 0:w.minWidth)??(o==null?void 0:o.defaultMinWidth),b=(w==null?void 0:w.maxWidth)??(o==null?void 0:o.defaultMaxWidth),C=v.getActualWidth();typeof S=="number"&&C<S?v.setActualWidth(S,t,!0):typeof b=="number"&&C>b&&v.setActualWidth(b,t,!0)}for(;!d;){d=!0;const v=e-fa(c);if(v<=0)for(const w of l){const S=((g=s==null?void 0:s[w.getId()])==null?void 0:g.minWidth)??(o==null?void 0:o.defaultMinWidth)??w.minWidth;w.setActualWidth(S,t,!0)}else{const w=v/fa(l);let S=v;for(let b=l.length-1;b>=0;b--){const C=l[b],_=s==null?void 0:s[C.getId()],E=(_==null?void 0:_.minWidth)??(o==null?void 0:o.defaultMinWidth),x=(_==null?void 0:_.maxWidth)??(o==null?void 0:o.defaultMaxWidth),I=C.getMinWidth(),F=C.getMaxWidth(),M=typeof E=="number"&&E>I?E:I,T=typeof x=="number"&&x<F?x:F;let A=Math.round(C.getActualWidth()*w);A<M?(A=M,h(C),d=!1):A>T?(A=T,h(C),d=!1):b===0&&(A=S),C.setActualWidth(A,t,!0),S-=A}}}for(const v of u)v.fireColumnWidthChangedEvent(t);const f=this.beans.visibleCols;f.setLeftValues(t),f.updateBodyWidths(),!n&&Td(this.eventSvc,u,!0,t)}applyAutosizeStrategy(){const{gos:e,colDelayRenderSvc:t}=this.beans,n=e.get("autoSizeStrategy");(n==null?void 0:n.type)!=="fitGridWidth"&&(n==null?void 0:n.type)!=="fitProvidedWidth"||setTimeout(()=>{if(!this.isAlive())return;const o=n.type;if(o==="fitGridWidth"){const{columnLimits:s,defaultMinWidth:r,defaultMaxWidth:i}=n,a=s==null?void 0:s.map(({colId:l,minWidth:c,maxWidth:u})=>({key:l,minWidth:c,maxWidth:u}));this.sizeColumnsToFitGridBody({defaultMinWidth:r,defaultMaxWidth:i,columnLimits:a})}else o==="fitProvidedWidth"&&this.sizeColumnsToFit(n.width,"sizeColumnsToFit");t==null||t.revealColumns(o)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{var o;if(!this.isAlive())return;const n="autosizeColumns";e?this.autoSizeCols({...t,source:n,colKeys:e}):this.autoSizeAllColumns({...t,source:n}),(o=this.beans.colDelayRenderSvc)==null||o.revealColumns(t.type)})}processResizeOperations(){this.shouldQueueResizeOperations=!1;for(const e of this.resizeOperationQueue)e();this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}destroy(){this.resizeOperationQueue.length=0,super.destroy()}};function xSe(e,t,n={}){const o=n.minWidth??e.getMinWidth();t<o&&(t=o);const s=n.maxWidth??e.getMaxWidth();return t>s&&(t=s),t}function k$({ctrlsSvc:e,scrollVisibleSvc:t}){const n=e.getGridBodyCtrl(),s=n.isVerticalScrollShowing()?t.getScrollbarWidth():0;return ep(n.eGridBody)-s}var FSe={moduleName:"ColumnAutoSize",version:dt,beans:[ISe],apiFunctions:{sizeColumnsToFit:DSe,autoSizeColumns:P$,autoSizeAllColumns:TSe},dependsOn:[oB]},PSe=".ag-row-pinned-source{background-color:var(--ag-pinned-source-row-background-color);color:var(--ag-pinned-source-row-text-color);font-weight:var(--ag-pinned-source-row-font-weight)}.ag-row-pinned-manual{background-color:var(--ag-pinned-row-background-color);color:var(--ag-pinned-row-text-color);font-weight:var(--ag-pinned-row-font-weight)}";function kSe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedTopRowCount())??0}function ASe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedBottomRowCount())??0}function OSe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedTopRow(t)}function MSe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedBottomRow(t)}function NSe(e,t,n){var o;return(o=e.pinnedRowModel)==null?void 0:o.forEachPinnedRow(t,n)}var LSe={moduleName:"PinnedRow",version:dt,beans:[Ode],css:[PSe],apiFunctions:{getPinnedTopRowCount:kSe,getPinnedBottomRowCount:ASe,getPinnedTopRow:OSe,getPinnedBottomRow:MSe,forEachPinnedRow:NSe},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},VSe=class{constructor(e,t){this.col=e,this.firstNode=t,this.cellSpan=!0,this.spannedNodes=new Set,this.addSpannedNode(t)}reset(){this.spannedNodes.clear(),this.addSpannedNode(this.firstNode)}addSpannedNode(e){this.spannedNodes.add(e),this.lastNode=e}getLastNode(){return this.lastNode}getCellHeight(){return this.lastNode.rowTop+this.lastNode.rowHeight-this.firstNode.rowTop-1}doesSpanContain(e){return e.column!==this.col||e.rowPinned!=this.firstNode.rowPinned?!1:this.firstNode.rowIndex<=e.rowIndex&&e.rowIndex<=this.lastNode.rowIndex}getLastNodeAutoHeight(){var n;const e=(n=this.firstNode.__autoHeights)==null?void 0:n[this.col.getColId()];if(e==null)return;let t=0;for(const o of this.spannedNodes)o!==this.lastNode&&(t+=o.rowHeight);return e-t}},BSe=class extends We{constructor(e){super(),this.column=e}buildCache(e){var b;const{column:t,beans:{gos:n,pinnedRowModel:o,rowModel:s,valueSvc:r,pagination:i}}=this,{colDef:a}=t,l=this.getNodeMap(e),c=new Map,u=n.getCallback("isFullWidthRow"),d=a.equals,h=a.spanRows,f=typeof h=="function";let p=null,g=null,v;const w=(C,_)=>{p=C,g=null,v=_},S=C=>{const _=!C.isExpandable()&&!C.group&&!C.detail&&(u?!u({rowNode:C}):!0);if(C.rowIndex==null||!_){w(null,null);return}if(p==null||C.level!==p.level||C.footer||g&&C.rowIndex-1!==(g==null?void 0:g.getLastNode().rowIndex)){w(C,r.getValue(t,C));return}const E=r.getValue(t,C);if(f){const x=Pt(n,{valueA:v,nodeA:p,valueB:E,nodeB:C,column:t,colDef:a});if(!h(x)){w(C,E);return}}else if(d?!d(v,E):v!==E){w(C,E);return}if(!g){const x=l==null?void 0:l.get(p);(x==null?void 0:x.firstNode)===p?(x.reset(),g=x):g=new VSe(t,p),c.set(p,g)}g.addSpannedNode(C),c.set(C,g)};switch(e){case"center":(b=s.forEachDisplayedNode)==null||b.call(s,C=>{(!i||i.isRowInPage(C.rowIndex))&&S(C)}),this.centerValueNodeMap=c;break;case"top":o==null||o.forEachPinnedRow("top",S),this.topValueNodeMap=c;break;case"bottom":o==null||o.forEachPinnedRow("bottom",S),this.bottomValueNodeMap=c;break}}isCellSpanning(e){return!!this.getCellSpan(e)}getCellSpan(e){return this.getNodeMap(e.rowPinned).get(e)}getNodeMap(e){switch(e){case"top":return this.topValueNodeMap;case"bottom":return this.bottomValueNodeMap;default:return this.centerValueNodeMap}}},$Se=class extends We{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=Lo(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=Lo(this,this.dispatchCellsUpdatedEvent.bind(this,!1),0),this.pinnedTimeout=null,this.modelTimeout=null}postConstruct(){const e=this.onRowDataUpdated.bind(this),t=this.buildPinnedCaches.bind(this);this.addManagedEventListeners({paginationChanged:this.buildModelCaches.bind(this),pinnedRowDataChanged:t,pinnedRowsChanged:t,rowNodeDataChanged:e,cellValueChanged:e})}register(e){const{gos:t}=this.beans;if(!t.get("enableCellSpan")||this.spanningColumns.has(e))return;const n=this.createManagedBean(new BSe(e));this.spanningColumns.set(e,n),n.buildCache("top"),n.buildCache("bottom"),n.buildCache("center"),this.debouncePinnedEvent(),this.debounceModelEvent()}dispatchCellsUpdatedEvent(e){this.dispatchLocalEvent({type:"spannedCellsUpdated",pinned:e})}deregister(e){this.spanningColumns.delete(e)}onRowDataUpdated({node:e}){const{spannedRowRenderer:t}=this.beans;if(e.rowPinned){if(this.pinnedTimeout!=null)return;this.pinnedTimeout=window.setTimeout(()=>{this.pinnedTimeout=null,this.buildPinnedCaches(),t==null||t.createCtrls("top"),t==null||t.createCtrls("bottom")},0);return}this.modelTimeout==null&&(this.modelTimeout=window.setTimeout(()=>{this.modelTimeout=null,this.buildModelCaches(),t==null||t.createCtrls("center")},0))}buildModelCaches(){this.modelTimeout!=null&&clearTimeout(this.modelTimeout),this.spanningColumns.forEach(e=>e.buildCache("center")),this.debounceModelEvent()}buildPinnedCaches(){this.pinnedTimeout!=null&&clearTimeout(this.pinnedTimeout),this.spanningColumns.forEach(e=>{e.buildCache("top"),e.buildCache("bottom")}),this.debouncePinnedEvent()}isCellSpanning(e,t){const n=this.spanningColumns.get(e);return n?n.isCellSpanning(t):!1}getCellSpanByPosition(e){const{pinnedRowModel:t,rowModel:n}=this.beans,o=e.column,s=e.rowIndex,r=this.spanningColumns.get(o);if(!r)return;let i;switch(e.rowPinned){case"top":i=t==null?void 0:t.getPinnedTopRow(s);break;case"bottom":i=t==null?void 0:t.getPinnedBottomRow(s);break;default:i=n.getRow(s)}if(i)return r.getCellSpan(i)}getCellStart(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.firstNode.rowIndex}:e}getCellEnd(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.getLastNode().rowIndex}:e}getCellSpan(e,t){const n=this.spanningColumns.get(e);if(n)return n.getCellSpan(t)}forEachSpannedColumn(e,t){for(const[n,o]of this.spanningColumns)if(o.isCellSpanning(e)){const s=o.getCellSpan(e);t(n,s)}}destroy(){super.destroy(),this.spanningColumns.clear()}},HSe=class extends Bd{constructor(e,t,n){super(e.col,e.firstNode,n,t),this.cellSpan=e,this.SPANNED_CELL_CSS_CLASS="ag-spanned-cell"}setComp(e,t,n,o,s,r,i){this.eWrapper=n,super.setComp(e,t,n,o,s,r,i),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||zv(e,t.rowIndex)}setAriaRowSpan(){vie(this.eGui,this.cellSpan.spannedNodes.size)}setFocusedCellPosition(e){this.focusedCellPosition=e}getFocusedCellPosition(){return this.focusedCellPosition??this.cellPosition}checkCellFocused(){const e=this.beans.focusSvc.getFocusedCell();return!!e&&this.cellSpan.doesSpanContain(e)}applyStaticCssClasses(){super.applyStaticCssClasses(),this.comp.toggleCss(this.SPANNED_CELL_CSS_CLASS,!0)}onCellFocused(e){const{beans:t}=this;if(Py(t)){this.focusedCellPosition=void 0;return}const n=this.isCellFocused();n||(this.focusedCellPosition=void 0),e&&n&&(this.focusedCellPosition={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column}),super.onCellFocused(e)}getRootElement(){return this.eWrapper}},GSe=class extends Hy{onRowIndexChanged(){super.onRowIndexChanged();for(const e of this.getAllCellCtrls())e.refreshAriaRowIndex()}getInitialRowClasses(e){return["ag-spanned-row"]}getNewCellCtrl(e){var o;const t=(o=this.beans.rowSpanSvc)==null?void 0:o.getCellSpan(e,this.rowNode);if(!(!t||t.firstNode!==this.rowNode))return new HSe(t,this,this.beans)}isCorrectCtrlForSpan(e){var o;const t=(o=this.beans.rowSpanSvc)==null?void 0:o.getCellSpan(e.column,this.rowNode);return!t||t.firstNode!==this.rowNode?!1:e.getCellSpan()===t}onRowHeightChanged(){}refreshFirstAndLastRowStyles(){}addHoverFunctionality(){}resetHoveredStatus(){}},USe=class extends We{constructor(){super(...arguments),this.beanName="spannedRowRenderer",this.topCtrls=new Map,this.bottomCtrls=new Map,this.centerCtrls=new Map}postConstruct(){this.addManagedEventListeners({displayedRowsChanged:this.createAllCtrls.bind(this)})}createAllCtrls(){this.createCtrls("top"),this.createCtrls("bottom"),this.createCtrls("center")}createCtrls(e){const{rowSpanSvc:t}=this.beans,n=this.getCtrlsMap(e),o=n.size,s=this.getAllRelevantRowControls(e),r=new Map;let i=!1;for(const l of s)l.isAlive()&&(t==null||t.forEachSpannedColumn(l.rowNode,(c,u)=>{if(r.has(u.firstNode))return;const d=n.get(u.firstNode);if(d){r.set(u.firstNode,d),n.delete(u.firstNode);return}i=!0;const h=new GSe(u.firstNode,this.beans,!1,!1,!1);r.set(u.firstNode,h)}));this.setCtrlsMap(e,r);const a=r.size===o;if(!(!i&&a)){for(const l of n.values())l.destroyFirstPass(!0),l.destroySecondPass();this.dispatchLocalEvent({type:"spannedRowsUpdated",ctrlsKey:e})}}getAllRelevantRowControls(e){const{rowRenderer:t}=this.beans;switch(e){case"top":return t.topRowCtrls;case"bottom":return t.bottomRowCtrls;case"center":return t.allRowCtrls}}getCellByPosition(e){const{rowSpanSvc:t}=this.beans,n=t==null?void 0:t.getCellSpanByPosition(e);if(!n)return;const o=this.getCtrlsMap(e.rowPinned).get(n.firstNode);if(o)return o.getAllCellCtrls().find(s=>s.column===e.column)}getCtrls(e){return[...this.getCtrlsMap(e).values()]}destroyRowCtrls(e){for(const t of this.getCtrlsMap(e).values())t.destroyFirstPass(!0),t.destroySecondPass();this.setCtrlsMap(e,new Map)}getCtrlsMap(e){switch(e){case"top":return this.topCtrls;case"bottom":return this.bottomCtrls;default:return this.centerCtrls}}setCtrlsMap(e,t){switch(e){case"top":this.topCtrls=t;break;case"bottom":this.bottomCtrls=t;break;default:this.centerCtrls=t;break}}destroy(){super.destroy(),this.destroyRowCtrls("top"),this.destroyRowCtrls("bottom"),this.destroyRowCtrls("center")}},WSe={moduleName:"CellSpan",version:dt,beans:[$Se,USe]},zSe=class extends We{constructor(e,t){super(),this.cellCtrl=e,this.staticClasses=[],this.beans=t,this.column=e.column}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const{column:e,cellComp:t}=this,n=e.colDef,o=n.cellClassRules,s=this.getCellClassParams(e,n);O_(this.beans.expressionSvc,o===this.cellClassRules?void 0:this.cellClassRules,o,s,r=>t.toggleCss(r,!0),r=>t.toggleCss(r,!1)),this.cellClassRules=o}applyUserStyles(){const e=this.column,t=e.colDef,n=t.cellStyle;if(!n)return;let o;if(typeof n=="function"){const s=this.getCellClassParams(e,t);o=n(s)}else o=n;o&&this.cellComp.setUserStyles(o)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,n=e.colDef,o=this.getCellClassParams(e,n);for(const r of this.staticClasses)t.toggleCss(r,!1);const s=this.beans.cellStyles.getStaticCellClasses(n,o);this.staticClasses=s;for(const r of s)t.toggleCss(r,!0)}getCellClassParams(e,t){const{value:n,rowNode:o}=this.cellCtrl;return Pt(this.beans.gos,{value:n,data:o.data,node:o,colDef:t,column:e,rowIndex:o.rowIndex})}},jSe=class extends We{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,n,o){O_(this.beans.expressionSvc,void 0,e.cellClassRules,t,n,o),this.processStaticCellClasses(e,t,n)}getStaticCellClasses(e,t){const{cellClass:n}=e;if(!n)return[];let o;return typeof n=="function"?o=n(t):o=n,typeof o=="string"&&(o=[o]),o||[]}createCellCustomStyleFeature(e,t){return new zSe(e,t)}processStaticCellClasses(e,t,n){this.getStaticCellClasses(e,t).forEach(s=>{n(s)})}},KSe={moduleName:"CellStyle",version:dt,beans:[jSe]},qSe={moduleName:"RowStyle",version:dt,beans:[Ome]};function YSe(e,t){var n;return!!((n=e.colHover)!=null&&n.isHovered(t))}var ZSe=class extends We{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=n=>{const{beans:o,gos:s,element:r,columns:i}=this,a=o.colHover;if(n??!!s.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(r,{mouseover:a.setMouseOver.bind(a,i),mouseout:a.clearMouseOver.bind(a)});else{for(const c of this.destroyManagedListeners)c();this.destroyManagedListeners=[]}}}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{this.enableFeature(e)}),this.enableFeature()}destroy(){super.destroy(),this.destroyManagedListeners=null}},XSe="ag-column-hover",JSe=class extends We{constructor(){super(...arguments),this.beanName="colHover"}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{e||this.clearMouseOver()})}setMouseOver(e){this.updateState(e)}clearMouseOver(){this.updateState(null)}isHovered(e){if(!this.gos.get("columnHoverHighlight"))return!1;const t=this.selectedColumns;return!!t&&t.indexOf(e)>=0}addHeaderColumnHoverListener(e,t,n){const o=()=>{const s=this.isHovered(n);t.toggleCss("ag-column-hover",s)};e.addManagedEventListeners({columnHoverChanged:o}),o()}onCellColumnHover(e,t){if(!t)return;const n=this.isHovered(e);t.toggleCss(XSe,n)}addHeaderFilterColumnHoverListener(e,t,n,o){this.createHoverFeature(e,[n],o);const s=()=>{const r=this.isHovered(n);t.toggleCss("ag-column-hover",r)};e.addManagedEventListeners({columnHoverChanged:s}),s()}createHoverFeature(e,t,n){e.createManagedBean(new ZSe(t,n))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},QSe={moduleName:"ColumnHover",version:dt,beans:[JSe],apiFunctions:{isColumnHovered:YSe}},eEe=class extends We{constructor(){super(...arguments),this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){var e,t;this.wrapSvc=(t=(e=this.beans.frameworkOverrides).createGlobalEventListenerWrapper)==null?void 0:t.call(e)}addListener(e,t){var r;const n=((r=this.wrapSvc)==null?void 0:r.wrap(e,t))??t,o=!Vy.has(e),s=o?this.asyncListeners:this.syncListeners;s.has(e)||s.set(e,new Set),s.get(e).add(n),this.eventSvc.addListener(e,n,o)}removeListener(e,t){var r,i;const n=((r=this.wrapSvc)==null?void 0:r.unwrap(e,t))??t,o=this.asyncListeners.get(e),s=!!(o!=null&&o.delete(n));s||(i=this.syncListeners.get(e))==null||i.delete(n),this.eventSvc.removeListener(e,n,s)}addGlobalListener(e){var r;const t=((r=this.wrapSvc)==null?void 0:r.wrapGlobal(e))??e,n=(i,a)=>{Vy.has(i)&&t(i,a)},o=(i,a)=>{Vy.has(i)||t(i,a)};this.globalListenerPairs.set(e,{syncListener:n,asyncListener:o});const s=this.eventSvc;s.addGlobalListener(n,!1),s.addGlobalListener(o,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:n,globalListenerPairs:o}=this,s=(n==null?void 0:n.unwrapGlobal(e))??e;if(o.has(s)){const{syncListener:i,asyncListener:a}=o.get(s);t.removeGlobalListener(i,!1),t.removeGlobalListener(a,!0),o.delete(e)}else this.syncGlobalListeners.delete(s),t.removeGlobalListener(s,!1)}destroyEventListeners(e,t){e.forEach((n,o)=>{n.forEach(s=>this.eventSvc.removeListener(o,s,t)),n.clear()}),e.clear()}destroyGlobalListeners(e,t){for(const n of e)this.eventSvc.removeGlobalListener(n,t);e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncListeners,!1),this.destroyEventListeners(this.asyncListeners,!0),this.destroyGlobalListeners(this.syncGlobalListeners,!1);const{globalListenerPairs:e,eventSvc:t}=this;e.forEach(({syncListener:n,asyncListener:o})=>{t.removeGlobalListener(n,!1),t.removeGlobalListener(o,!0)}),e.clear()}};function tEe(e,t,n){var o;(o=e.apiEventSvc)==null||o.addListener(t,n)}function nEe(e,t,n){var o;(o=e.apiEventSvc)==null||o.removeListener(t,n)}function oEe(e,t){var n;(n=e.apiEventSvc)==null||n.addGlobalListener(t)}function sEe(e,t){var n;(n=e.apiEventSvc)==null||n.removeGlobalListener(t)}var rEe={moduleName:"EventApi",version:dt,apiFunctions:{addEventListener:tEe,addGlobalListener:oEe,removeEventListener:nEe,removeGlobalListener:sEe},beans:[eEe]},iEe={moduleName:"Locale",version:dt,beans:[Mve]},aEe=class extends We{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=Lo(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){var a,l,c,u;const{visibleCols:e,rowModel:t,rowSpanSvc:n,pinnedRowModel:o}=this.beans,s=e.autoHeightCols;let r=!1;const i=d=>{var p;const h=d.__autoHeights;let f=cl(this.beans,d).height;for(const g of s){let v=h==null?void 0:h[g.getColId()];const w=n==null?void 0:n.getCellSpan(g,d);if(w){if(w.getLastNode()!==d)continue;if(v=(p=n==null?void 0:n.getCellSpan(g,d))==null?void 0:p.getLastNodeAutoHeight(),!v)return}if(v==null){if(this.colSpanSkipCell(g,d))continue;return}f=Math.max(v,f)}f!==d.rowHeight&&(d.setRowHeight(f),r=!0)};(a=o==null?void 0:o.forEachPinnedRow)==null||a.call(o,"top",i),(l=o==null?void 0:o.forEachPinnedRow)==null||l.call(o,"bottom",i),(c=t.forEachDisplayedNode)==null||c.call(t,i),r&&((u=t.onRowHeightChanged)==null||u.call(t))}setRowAutoHeight(e,t,n){if(e.__autoHeights??(e.__autoHeights={}),t==null){delete e.__autoHeights[n.getId()];return}const o=e.__autoHeights[n.getId()];e.__autoHeights[n.getId()]=t,o!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:n,colViewport:o,visibleCols:s}=this.beans;if(!n.colSpanActive)return!1;let r=[];switch(e.getPinned()){case"left":r=s.getLeftColsForRow(t);break;case"right":r=s.getRightColsForRow(t);break;case null:r=o.getColsWithinViewport(t);break}return!r.includes(e)}setupCellAutoHeight(e,t,n){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const o=t.parentElement,{rowNode:s,column:r}=e,i=this.beans,a=u=>{var S;if((S=this.beans.editSvc)!=null&&S.isEditing(e)||!e.isAlive()||!n.isAlive())return;const{paddingTop:d,paddingBottom:h,borderBottomWidth:f,borderTopWidth:p}=Ec(o),g=d+h+f+p,w=t.offsetHeight+g;if(u<5){const b=Io(i),C=!(b!=null&&b.contains(t)),_=w==0;if(C||_){window.setTimeout(()=>a(u+1),0);return}}this.setRowAutoHeight(s,w,r)},l=()=>a(0);l();const c=il(i,t,l);return n.addDestroyFunc(()=>{c(),this.setRowAutoHeight(s,void 0,r)}),!0}setAutoHeightActive(e){this.active=e.list.some(t=>t.isVisible()&&t.isAutoHeight())}areRowsMeasured(){if(!this.active)return!0;const e=this.beans.rowRenderer.getAllRowCtrls();let t=null;for(const{rowNode:n}of e)if((!t||this.beans.colModel.colSpanActive)&&(t=this.beans.colViewport.getColsWithinViewport(n).filter(s=>s.isAutoHeight())),t.length!==0){if(!n.__autoHeights)return!1;for(const o of t){const s=n.__autoHeights[o.getColId()];if(!s||n.rowHeight<s)return!1}}return!0}},lEe={moduleName:"RowAutoHeight",version:dt,beans:[aEe]},cEe={moduleName:"AllCommunity",version:dt,dependsOn:[T$,gbe,Rbe,Qve,cCe,uCe,dCe,hCe,fCe,pCe,gCe,lCe,twe,nwe,owe,ewe,rwe,iwe,Hbe,$Ce,iSe,aB,mSe,vSe,RSe,FSe,qhe,LSe,FCe,mve,KSe,QSe,qSe,rEe,wve,Mbe,l$,iEe,lEe,Khe,lbe,WSe]};let A$=!1;A$||(tae.registerModules([cEe,T$]),A$=!0);class uEe{constructor(t,n){no(this,"gridApi",null);no(this,"container");no(this,"config");no(this,"eventListeners",new Map);this.container=t,this.config=n}init(){if(this.gridApi)throw new Error("Grid already initialized");const{onGridReady:t,onCellClicked:n,onCellFocused:o,onRowSelected:s,...r}=this.config,i={...r,onGridReady:a=>{this.gridApi=a.api,t&&t(a)},onCellClicked:a=>{n&&n(a)},onCellFocused:a=>{o&&o(a)},onRowSelected:a=>{s&&s(a)}};return this.gridApi=Pve(this.container,i),this.gridApi}updateRowData(t){this.gridApi&&this.gridApi.setGridOption("rowData",t)}updateColumnDefs(t){this.gridApi&&this.gridApi.setGridOption("columnDefs",t)}setColumnWidth(t){var n;this.gridApi&&((n=this.gridApi)==null||n.applyColumnState({state:t,applyOrder:!1}))}updateDatasource(t){this.gridApi&&this.gridApi.setGridOption("datasource",t)}refreshInfiniteCache(){this.gridApi&&this.gridApi.refreshInfiniteCache()}sizeColumnsToFit(){this.gridApi}deselectAll(){this.gridApi&&this.gridApi.deselectAll()}getSelectedRows(){var t;return((t=this.gridApi)==null?void 0:t.getSelectedRows())||[]}setQuickFilterText(t){this.gridApi&&this.gridApi.setGridOption("quickFilterText",t)}getColumnState(){var t;return(t=this.gridApi)==null?void 0:t.getColumnState()}addEventListener(t,n){if(!this.gridApi)throw new Error("Grid not initialized");this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t).add(n),this.gridApi.addEventListener(t,n)}addRow(t,n="bottom"){if(this.gridApi){const o={add:[t],addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(o),n==="bottom"){const s=this.gridApi.getDisplayedRowCount();s>0&&this.gridApi.ensureIndexVisible(s-1,"bottom")}}}addRows(t,n="bottom"){if(this.gridApi&&t.length>0){const o={add:t,addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(o),n==="bottom"){const s=this.gridApi.getDisplayedRowCount();s>0&&this.gridApi.ensureIndexVisible(s-1,"bottom")}}}destroy(){this.gridApi&&(this.eventListeners.forEach((t,n)=>{t.forEach(o=>{var s;(s=this.gridApi)==null||s.removeEventListener(n,o)})}),this.eventListeners.clear(),this.gridApi.destroy(),this.gridApi=null)}getApi(){return this.gridApi}switchTheme(t){document.body.dataset.agThemeMode=t==="dark"?"dark":"light"}}const dEe=fB.withParams({accentColor:"var(--primary-color)",backgroundColor:"#ffffff",borderColor:"#e5e7eb",borderRadius:4,browserColorScheme:"light",chromeBackgroundColor:"#f9fafb",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#111827",headerBackgroundColor:"#fff",headerFontSize:14,headerFontWeight:600,headerTextColor:"#374151",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"light").withParams({accentColor:"var(--primary-color)",backgroundColor:"#1f2937",borderColor:"#374151",borderRadius:4,browserColorScheme:"dark",chromeBackgroundColor:"#111827",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#f9fafb",headerBackgroundColor:"#374151",headerFontSize:14,headerFontWeight:600,headerTextColor:"#f9fafb",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"dark"),hEe=st({__name:"AgTable",props:{statusBar:{},sideBar:{type:[Object,String,Array,Boolean,null]},suppressContextMenu:{type:Boolean},preventDefaultOnContextMenu:{type:Boolean},allowContextMenuWithControlKey:{type:Boolean},columnMenu:{},suppressMenuHide:{type:Boolean},enableBrowserTooltips:{type:Boolean},tooltipTrigger:{},tooltipShowDelay:{},tooltipHideDelay:{},tooltipMouseTrack:{type:Boolean},tooltipShowMode:{},tooltipInteraction:{type:Boolean},popupParent:{},copyHeadersToClipboard:{type:Boolean},copyGroupHeadersToClipboard:{type:Boolean},clipboardDelimiter:{},suppressCopyRowsToClipboard:{type:Boolean},suppressCopySingleCellRanges:{type:Boolean},suppressLastEmptyLineOnPaste:{type:Boolean},suppressClipboardPaste:{type:Boolean},suppressClipboardApi:{type:Boolean},suppressCutToClipboard:{type:Boolean},columnDefs:{},defaultColDef:{},defaultColGroupDef:{},columnTypes:{},dataTypeDefinitions:{},maintainColumnOrder:{type:Boolean},enableStrictPivotColumnOrder:{type:Boolean},suppressFieldDotNotation:{type:Boolean},headerHeight:{},groupHeaderHeight:{},floatingFiltersHeight:{},pivotHeaderHeight:{},pivotGroupHeaderHeight:{},hidePaddedHeaderRows:{type:Boolean},allowDragFromColumnsToolPanel:{type:Boolean},suppressMovableColumns:{type:Boolean},suppressColumnMoveAnimation:{type:Boolean},suppressMoveWhenColumnDragging:{type:Boolean},suppressDragLeaveHidesColumns:{type:Boolean},suppressGroupChangesColumnVisibility:{type:[Boolean,String]},suppressMakeColumnVisibleAfterUnGroup:{type:Boolean},suppressRowGroupHidesColumns:{type:Boolean},colResizeDefault:{},suppressAutoSize:{type:Boolean},autoSizePadding:{},skipHeaderOnAutoSize:{type:Boolean},autoSizeStrategy:{},components:{},editType:{},suppressStartEditOnTab:{type:Boolean},getFullRowEditValidationErrors:{type:Function},invalidEditValueMode:{},singleClickEdit:{type:Boolean},suppressClickEdit:{type:Boolean},readOnlyEdit:{type:Boolean},stopEditingWhenCellsLoseFocus:{type:Boolean},enterNavigatesVertically:{type:Boolean},enterNavigatesVerticallyAfterEdit:{type:Boolean},enableCellEditingOnBackspace:{type:Boolean},undoRedoCellEditing:{type:Boolean},undoRedoCellEditingLimit:{},defaultCsvExportParams:{},suppressCsvExport:{type:Boolean},defaultExcelExportParams:{},suppressExcelExport:{type:Boolean},excelStyles:{},findSearchValue:{},findOptions:{},quickFilterText:{},cacheQuickFilter:{type:Boolean},includeHiddenColumnsInQuickFilter:{type:Boolean},quickFilterParser:{type:Function},quickFilterMatcher:{type:Function},applyQuickFilterBeforePivotOrAgg:{type:Boolean},excludeChildrenWhenTreeDataFiltering:{type:Boolean},enableAdvancedFilter:{type:Boolean},alwaysPassFilter:{type:Function},includeHiddenColumnsInAdvancedFilter:{type:Boolean},advancedFilterParent:{},advancedFilterBuilderParams:{},advancedFilterParams:{},suppressAdvancedFilterEval:{type:Boolean},suppressSetFilterByDefault:{type:Boolean},enableFilterHandlers:{type:Boolean},filterHandlers:{},enableCharts:{type:Boolean},chartThemes:{},customChartThemes:{},chartThemeOverrides:{},chartToolPanelsDef:{},chartMenuItems:{type:[Array,Function]},loadingCellRenderer:{},loadingCellRendererParams:{},loadingCellRendererSelector:{type:Function},localeText:{},masterDetail:{type:Boolean},keepDetailRows:{type:Boolean},keepDetailRowsCount:{},detailCellRenderer:{},detailCellRendererParams:{},detailRowHeight:{},detailRowAutoHeight:{type:Boolean},context:{},alignedGrids:{type:[Array,Function]},tabIndex:{},rowBuffer:{},valueCache:{type:Boolean},valueCacheNeverExpires:{type:Boolean},enableCellExpressions:{type:Boolean},suppressTouch:{type:Boolean},suppressFocusAfterRefresh:{type:Boolean},suppressBrowserResizeObserver:{type:Boolean},suppressPropertyNamesCheck:{type:Boolean},suppressChangeDetection:{type:Boolean},debug:{type:Boolean},loading:{type:Boolean},overlayLoadingTemplate:{},loadingOverlayComponent:{},loadingOverlayComponentParams:{},suppressLoadingOverlay:{type:Boolean},overlayNoRowsTemplate:{},noRowsOverlayComponent:{},noRowsOverlayComponentParams:{},suppressNoRowsOverlay:{type:Boolean},pagination:{type:Boolean},paginationPageSize:{},paginationPageSizeSelector:{type:[Array,Boolean]},paginationAutoPageSize:{type:Boolean},paginateChildRows:{type:Boolean},suppressPaginationPanel:{type:Boolean},pivotMode:{type:Boolean},pivotPanelShow:{},pivotMaxGeneratedColumns:{},pivotDefaultExpanded:{},pivotColumnGroupTotals:{},pivotRowTotals:{},pivotSuppressAutoColumn:{type:Boolean},suppressExpandablePivotGroups:{type:Boolean},functionsReadOnly:{type:Boolean},aggFuncs:{},suppressAggFuncInHeader:{type:Boolean},alwaysAggregateAtRootLevel:{type:Boolean},aggregateOnlyChangedColumns:{type:Boolean},suppressAggFilteredOnly:{type:Boolean},removePivotHeaderRowWhenSingleValueColumn:{type:Boolean},animateRows:{type:Boolean},cellFlashDuration:{},cellFadeDuration:{},allowShowChangeAfterFilter:{type:Boolean},domLayout:{},ensureDomOrder:{type:Boolean},enableCellSpan:{type:Boolean},enableRtl:{type:Boolean},suppressColumnVirtualisation:{type:Boolean},suppressMaxRenderedRowRestriction:{type:Boolean},suppressRowVirtualisation:{type:Boolean},rowDragManaged:{type:Boolean},rowDragInsertDelay:{},suppressRowDrag:{type:Boolean},suppressMoveWhenRowDragging:{type:Boolean},rowDragEntireRow:{type:Boolean},rowDragMultiRow:{type:Boolean},rowDragText:{type:Function},dragAndDropImageComponent:{},dragAndDropImageComponentParams:{},fullWidthCellRenderer:{},fullWidthCellRendererParams:{},embedFullWidthRows:{type:Boolean},groupDisplayType:{},groupDefaultExpanded:{},autoGroupColumnDef:{},groupMaintainOrder:{type:Boolean},groupSelectsChildren:{type:Boolean},groupLockGroupColumns:{},groupAggFiltering:{type:[Boolean,Function]},groupTotalRow:{type:[String,Function]},grandTotalRow:{},suppressStickyTotalRow:{type:[Boolean,String]},groupSuppressBlankHeader:{type:Boolean},groupSelectsFiltered:{type:Boolean},showOpenedGroup:{type:Boolean},groupHideParentOfSingleChild:{type:[Boolean,String]},groupRemoveSingleChildren:{type:Boolean},groupRemoveLowestSingleChildren:{type:Boolean},groupHideOpenParents:{type:Boolean},groupAllowUnbalanced:{type:Boolean},rowGroupPanelShow:{},groupRowRenderer:{},groupRowRendererParams:{},treeData:{type:Boolean},treeDataChildrenField:{},treeDataParentIdField:{},rowGroupPanelSuppressSort:{type:Boolean},suppressGroupRowsSticky:{type:Boolean},groupHierarchyConfig:{},pinnedTopRowData:{},pinnedBottomRowData:{},enableRowPinning:{type:[Boolean,String]},isRowPinnable:{type:Function},isRowPinned:{type:Function},rowModelType:{},rowData:{},asyncTransactionWaitMillis:{},suppressModelUpdateAfterUpdateTransaction:{type:Boolean},datasource:{},cacheOverflowSize:{},infiniteInitialRowCount:{},serverSideInitialRowCount:{},suppressServerSideFullWidthLoadingRow:{type:Boolean},cacheBlockSize:{},maxBlocksInCache:{},maxConcurrentDatasourceRequests:{},blockLoadDebounceMillis:{},purgeClosedRowNodes:{type:Boolean},serverSideDatasource:{},serverSideSortAllLevels:{type:Boolean},serverSideEnableClientSideSort:{type:Boolean},serverSideOnlyRefreshFilteredGroups:{type:Boolean},serverSidePivotResultFieldSeparator:{},viewportDatasource:{},viewportRowModelPageSize:{},viewportRowModelBufferSize:{},alwaysShowHorizontalScroll:{type:Boolean},alwaysShowVerticalScroll:{type:Boolean},debounceVerticalScrollbar:{type:Boolean},suppressHorizontalScroll:{type:Boolean},suppressScrollOnNewData:{type:Boolean},suppressScrollWhenPopupsAreOpen:{type:Boolean},suppressAnimationFrame:{type:Boolean},suppressMiddleClickScrolls:{type:Boolean},suppressPreventDefaultOnMouseWheel:{type:Boolean},scrollbarWidth:{},rowSelection:{},cellSelection:{type:[Boolean,Object]},rowMultiSelectWithClick:{type:Boolean},suppressRowDeselection:{type:Boolean},suppressRowClickSelection:{type:Boolean},suppressCellFocus:{type:Boolean},suppressHeaderFocus:{type:Boolean},selectionColumnDef:{},rowNumbers:{type:[Boolean,Object]},suppressMultiRangeSelection:{type:Boolean},enableCellTextSelection:{type:Boolean},enableRangeSelection:{type:Boolean},enableRangeHandle:{type:Boolean},enableFillHandle:{type:Boolean},fillHandleDirection:{},suppressClearOnFillReduction:{type:Boolean},sortingOrder:{},accentedSort:{type:Boolean},unSortIcon:{type:Boolean},suppressMultiSort:{type:Boolean},alwaysMultiSort:{type:Boolean},multiSortKey:{},suppressMaintainUnsortedOrder:{type:Boolean},icons:{},rowHeight:{},rowStyle:{},rowClass:{},rowClassRules:{},suppressRowHoverHighlight:{type:Boolean},suppressRowTransform:{type:Boolean},columnHoverHighlight:{type:Boolean},gridId:{},deltaSort:{type:Boolean},treeDataDisplayType:{},enableGroupEdit:{type:Boolean},initialState:{},reactiveCustomComponents:{type:Boolean},renderingMode:{},theme:{},loadThemeGoogleFonts:{type:Boolean},themeCssLayer:{},styleNonce:{},themeStyleContainer:{},getContextMenuItems:{type:Function},getMainMenuItems:{type:Function},postProcessPopup:{type:Function},processUnpinnedColumns:{type:Function},processCellForClipboard:{type:Function},processHeaderForClipboard:{type:Function},processGroupHeaderForClipboard:{type:Function},processCellFromClipboard:{type:Function},sendToClipboard:{type:Function},processDataFromClipboard:{type:Function},isExternalFilterPresent:{type:Function},doesExternalFilterPass:{type:Function},getChartToolbarItems:{type:Function},createChartContainer:{type:Function},focusGridInnerElement:{type:Function},navigateToNextHeader:{type:Function},tabToNextHeader:{type:Function},navigateToNextCell:{type:Function},tabToNextCell:{type:Function},getLocaleText:{type:Function},getDocument:{type:Function},paginationNumberFormatter:{type:Function},getGroupRowAgg:{type:Function},isGroupOpenByDefault:{type:Function},ssrmExpandAllAffectsAllRows:{type:Boolean},initialGroupOrderComparator:{type:Function},processPivotResultColDef:{type:Function},processPivotResultColGroupDef:{type:Function},getDataPath:{type:Function},getChildCount:{type:Function},getServerSideGroupLevelParams:{type:Function},isServerSideGroupOpenByDefault:{type:Function},isApplyServerSideTransaction:{type:Function},isServerSideGroup:{type:Function},getServerSideGroupKey:{type:Function},getBusinessKeyForNode:{type:Function},getRowId:{type:Function},resetRowDataOnUpdate:{type:Boolean},processRowPostCreate:{type:Function},isRowSelectable:{type:Function},isRowMaster:{type:Function},fillOperation:{type:Function},postSortRows:{type:Function},getRowStyle:{type:Function},getRowClass:{type:Function},getRowHeight:{type:Function},isFullWidthRow:{type:Function},onToolPanelVisibleChanged:{type:Function},onToolPanelSizeChanged:{type:Function},onColumnMenuVisibleChanged:{type:Function},onContextMenuVisibleChanged:{type:Function},onCutStart:{type:Function},onCutEnd:{type:Function},onPasteStart:{type:Function},onPasteEnd:{type:Function},onColumnVisible:{type:Function},onColumnPinned:{type:Function},onColumnResized:{type:Function},onColumnMoved:{type:Function},onColumnValueChanged:{type:Function},onColumnPivotModeChanged:{type:Function},onColumnPivotChanged:{type:Function},onColumnGroupOpened:{type:Function},onNewColumnsLoaded:{type:Function},onGridColumnsChanged:{type:Function},onDisplayedColumnsChanged:{type:Function},onVirtualColumnsChanged:{type:Function},onColumnEverythingChanged:{type:Function},onColumnsReset:{type:Function},onColumnHeaderMouseOver:{type:Function},onColumnHeaderMouseLeave:{type:Function},onColumnHeaderClicked:{type:Function},onColumnHeaderContextMenu:{type:Function},onComponentStateChanged:{type:Function},onCellValueChanged:{type:Function},onCellEditRequest:{type:Function},onRowValueChanged:{type:Function},onCellEditingStarted:{type:Function},onCellEditingStopped:{type:Function},onRowEditingStarted:{type:Function},onRowEditingStopped:{type:Function},onBulkEditingStarted:{type:Function},onBulkEditingStopped:{type:Function},onBatchEditingStarted:{type:Function},onBatchEditingStopped:{type:Function},onUndoStarted:{type:Function},onUndoEnded:{type:Function},onRedoStarted:{type:Function},onRedoEnded:{type:Function},onCellSelectionDeleteStart:{type:Function},onCellSelectionDeleteEnd:{type:Function},onRangeDeleteStart:{type:Function},onRangeDeleteEnd:{type:Function},onFillStart:{type:Function},onFillEnd:{type:Function},onFilterOpened:{type:Function},onFilterChanged:{type:Function},onFilterModified:{type:Function},onFilterUiChanged:{type:Function},onFloatingFilterUiChanged:{type:Function},onAdvancedFilterBuilderVisibleChanged:{type:Function},onFindChanged:{type:Function},onChartCreated:{type:Function},onChartRangeSelectionChanged:{type:Function},onChartOptionsChanged:{type:Function},onChartDestroyed:{type:Function},onCellKeyDown:{type:Function},onGridReady:{type:Function},onGridPreDestroyed:{type:Function},onFirstDataRendered:{type:Function},onGridSizeChanged:{type:Function},onModelUpdated:{type:Function},onVirtualRowRemoved:{type:Function},onViewportChanged:{type:Function},onBodyScroll:{type:Function},onBodyScrollEnd:{type:Function},onDragStarted:{type:Function},onDragStopped:{type:Function},onDragCancelled:{type:Function},onStateUpdated:{type:Function},onPaginationChanged:{type:Function},onRowDragEnter:{type:Function},onRowDragMove:{type:Function},onRowDragLeave:{type:Function},onRowDragEnd:{type:Function},onRowDragCancel:{type:Function},isRowValidDropPosition:{type:Function},onRowResizeStarted:{type:Function},onRowResizeEnded:{type:Function},onColumnRowGroupChanged:{type:Function},onRowGroupOpened:{type:Function},onExpandOrCollapseAll:{type:Function},onPivotMaxColumnsExceeded:{type:Function},onPinnedRowDataChanged:{type:Function},onPinnedRowsChanged:{type:Function},onRowDataUpdated:{type:Function},onAsyncTransactionsFlushed:{type:Function},onStoreRefreshed:{type:Function},onHeaderFocused:{type:Function},onCellClicked:{type:Function},onCellDoubleClicked:{type:Function},onCellFocused:{type:Function},onCellMouseOver:{type:Function},onCellMouseOut:{type:Function},onCellMouseDown:{type:Function},onRowClicked:{type:Function},onRowDoubleClicked:{type:Function},onRowSelected:{type:Function},onSelectionChanged:{type:Function},onCellContextMenu:{type:Function},onRangeSelectionChanged:{type:Function},onCellSelectionChanged:{type:Function},onTooltipShow:{type:Function},onTooltipHide:{type:Function},onSortChanged:{type:Function},height:{},isSorting:{type:Boolean}},emits:["onGridReady","row-clicked","cell-clicked","cell-focused","row-selected"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=B(null);wS(r,()=>{var v;const g=(v=i.value)==null?void 0:v.getApi();g==null||g.clearFocusedCell()});const i=B(null),a=q(()=>({width:"100%",height:o.height||"500px"})),l=q(()=>({...o,theme:dEe}));function c(){if(!r.value){console.warn("Grid container element not found");return}const g={...l.value,height:o.height};i.value=new uEe(r.value,g),i.value.init(),u()}function u(){var v;const g=((v=i.value)==null?void 0:v.getApi())??null;s("onGridReady",g)}function d(g){var w,S;if(!g)return;(w=i.value)==null||w.updateColumnDefs(g);const v=g.map(b=>b.field&&b.width&&!b.hide?{colId:b.field,width:b.width,flex:null}:null).filter(b=>b!==null);(S=i.value)==null||S.setColumnWidth(v)}function h(){var g;(g=i.value)==null||g.destroy(),i.value=null}function f(){var g;return((g=i.value)==null?void 0:g.getApi())||void 0}function p(){return i.value||null}return tt(()=>o.columnDefs,(g,v)=>{const w=g==null?void 0:g.filter(b=>!b.hide).map(b=>b.field).join(","),S=v==null?void 0:v.filter(b=>!b.hide).map(b=>b.field).join(",");w!==S&&d(g)},{deep:!0}),qn(()=>{h()}),t({gridApi:f,gridManager:p,syncColumnDefs:d}),Qt(()=>{c()}),qn(()=>{h()}),(g,v)=>(K(),ie("div",{ref_key:"gridContainerRef",ref:r,style:rn(a.value),class:Q(["ag-theme-quartz",["ag-table-container",o.isSorting?"is-sorting":""]])},null,6))}});function Wd(e){return hL(e)}const fEe=()=>[...[{headerName:"Name",field:"name",sortable:!1,filter:!1,pinned:"left",headerComponent:Wd(gc),suppressMovable:!0},{headerName:"Notes",field:"description",sortable:!1,filter:!1,suppressMovable:!1},{headerName:"Assignee",field:"assignees",sortable:!1,filter:!1,headerComponent:Wd(gc)},{headerName:"Status",field:"status",sortable:!1,filter:!1,headerComponent:Wd(gc)},{headerName:"Date Range",field:"dateRange",sortable:!1,filter:!1,headerComponent:Wd(gc)},{headerName:"Last Updated",field:"lastUpdated",sortable:!1,filter:!1,headerComponent:Wd(gc),cellRendererParams:n=>{var o,s,r;return{...n,value:(o=n==null?void 0:n.data)==null?void 0:o.lastUpdated.value,tooltip:((r=(s=n==null?void 0:n.data)==null?void 0:s.lastUpdated)==null?void 0:r.tooltip)||void 0,readOnly:!0}}},{headerName:"Completed On",field:"completedOn",sortable:!1,filter:!1,headerComponent:Wd(gc),cellRendererParams:n=>{var o,s,r;return{...n,value:(o=n==null?void 0:n.data)==null?void 0:o.completedOn.value,tooltip:((r=(s=n==null?void 0:n.data)==null?void 0:s.completedOn)==null?void 0:r.tooltip)||void 0,readOnly:!0}}}].map(n=>qf.fromType(n))],Yy={WIDTH:60,HEADER_CLASS:"ag-checkbox-header"},pEe=()=>({field:"__checkboxSelection",checkboxSelection:!0,headerCheckboxSelection:!0,pinned:"left",width:Yy.WIDTH,minWidth:Yy.WIDTH,maxWidth:Yy.WIDTH,cellClass:"ag-checkbox-cell",headerClass:Yy.HEADER_CLASS,headerComponent:Wv(vee),suppressMovable:!0}),O$="blank",gEe=[O$,"__checkboxSelection","options"],mEe=["uiColumnResized","uiColumnMoved","api"],vEe={headerName:"",field:"options",sortable:!1,filter:!1,editable:!0,pinned:"right",lockPosition:!0,suppressMovable:!0,resizable:!1},M$=(e,t)=>t!=null&&t.width?{...e,width:t.width,flex:void 0}:e,yEe=(e,t,n)=>{const{getCachedValue:o,setCachedValue:s}=$h({dbName:"item_table_column_configs",storeName:"column_configs"}),r=async()=>{const d=await o(t);if(!d||typeof d!="string")return null;try{const h=JSON.parse(d);return Array.isArray(h)?h:null}catch(h){return console.error("Failed to parse cached column config:",h),null}},i=B([]),a=pEe();let l=0;const c=async d=>{const h=++l,f=await r();if(h!==l)return;const p=[];f==null||f.forEach(D=>{const{field:N,hide:G,width:J,pinned:ae}=D;p.push([N,G])});const g=new Map(p),v=fEe(),w=qf.fromType(vEe),S=!!f,C=((d==null?void 0:d.map(D=>{var N;return{headerName:D.name,field:`metric_${D.id}`,editable:((N=D==null?void 0:D.auth_permission)==null?void 0:N.permission)==2,sortable:!0,filter:!1,flex:1,context:{...D},hide:S?!g.get(`metric_${D.id}`):!(D.is_primary||D.is_point_metric),cellClass:"ag-cell-optimized",headerComponent:Wv(gc),headerComponentParams:()=>({headerType:D.metric_type.code=="number"||D.metric_type.code=="formula"?"number":"default"})}}))||[]).map(D=>qf.fromType(D)),_=[a,...v,...C,w],E=[],x=[],I=[];for(const D of _)D.pinned==="left"?E.push(D):D.pinned==="right"||D.field===O$?x.push(D):I.push(D);if(!f||f.length===0){i.value=_;return}const F=new Map(f.map(D=>[D.field,D])),M=new Map(I.map(D=>[D.field,D])),T=[];for(const D of f)if(D.field&&M.has(D.field)){const N=M.get(D.field);T.push({...M$(N,D),hide:D.hide}),M.delete(D.field)}const A=Array.from(M.values()),k=[...T,...A].map(D=>({...D,lockPinned:!0})),P=D=>M$(D,F.get(D.field));i.value=[...E.map(P),...k,...x.map(P)]};tt(e,d=>c(d),{immediate:!0});const u=xr((d,h)=>{if((d==null?void 0:d.source)!==void 0&&!mEe.includes(d.source))return;const f=n.value,p=f==null?void 0:f.getColumnDefs(),g=new Map;if(f==null||f.getColumnState().forEach(w=>{w.width&&g.set(w.colId,Number(w.width))}),i.value=p||i.value,!h)return;const v=(p??[]).filter(w=>w.field&&!gEe.includes(w.field)).map(w=>({field:w.field,hide:w.hide,width:g.get(w.field)||w.width,pinned:w.pinned}));s(t,JSON.stringify(v))},li);return HR(()=>u.cancel()),{columnDefs:i,checkboxColumn:a,saveColumnConfig:u}},wEe=()=>{const e=un.getInstance().getItem("API_BASE_URL");return e!=null&&e.includes("v1")?e.slice(0,e.lastIndexOf("/v1")):String(e)},CEe=e=>{var A,k,P;const{showMessage:t,showErrorNetMessage:n}=oa(),o=oo(),s={domainApi:wEe(),wsCode:un.getInstance().getItem("ws.code"),entityId:e.value.entityId},r=(P=(k=(A=o==null?void 0:o.appContext)==null?void 0:A.config)==null?void 0:k.globalProperties)==null?void 0:P.apiConfig;if(!r||s.domainApi===""||s.wsCode==="")throw new Error("API configuration is missing in useItems");const i=new FO(r,s);i.on("call-api",D=>{D.success?t(D.apiCode,"success"):n(D)});const a=hs({}),l=B([]),c=B(!1),u=B(null),d=B(null),h=B(1),f=B(20);let p=Promise.resolve();const{setCachedUsers:g}=$7(),v=D=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",include_permission:"{include_permission}",include_permission_names:!0,q:D}),w=50,S=async(D,N,G)=>{if(!D.length)return[];const J=e8(D,N);return(await Promise.all(J.map(G))).flat()},b=async D=>{try{return(await i.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:D})).data.map(G=>[G==null?void 0:G.id,G.permission])}catch(N){return console.error("Failed to fetch item permissions chunk:",N),[]}},C=async(D,N)=>{try{const G=await i.getMetricValues({workspaceId:e.value.workspaceId,item_ids:D,per_page:D.length*N.length,metric_ids:N}),J=G.data.map(ne=>{const ee=new Map(ne.item_metrics.map(j=>[j.metric_id,{value:j.value,auth_permission:j==null?void 0:j.auth_permission}])),$=Object.fromEntries(N.map(j=>[j,ee.get(j)??null]));return[ne==null?void 0:ne.id,$]}),ae=new Set(G.data.map(ne=>ne==null?void 0:ne.id));for(const ne of D)if(!ae.has(ne)){const ee=Object.fromEntries(N.map($=>[$,{value:null,auth_permission:void 0}]));J.push([ne,ee])}return J}catch(G){return console.error("Failed to fetch a chunk of metric values:",G),D.map(ae=>[ae,Object.fromEntries(N.map(ne=>[ne,void 0]))])}},_=async D=>{try{const N=await i.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:D,per_page:D.length}),G=N.data.flatMap(J=>J.assignees);return g(G),N.data.map(J=>[J==null?void 0:J.id,J==null?void 0:J.assignees])}catch(N){return console.error("Failed to fetch a chunk of assigned users:",N),[]}},E=async D=>{if(!D.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const N=await S(D,w,b);return Object.fromEntries(N)}catch(N){return console.error("Failed to fetch item permissions:",N),{}}},x=async(D,N)=>!D.length||!N.length?{}:(p=p.then(async()=>{try{const ae=[];let ne=0;for(let $=0;$<N.length;$+=5){ne++;const j=N.slice($,$+5),te=[];for(let ve=0;ve<j.length;ve++){const we=j[ve],re=await S(D,w,W=>C(W,[we]));te.push(re),await new Promise(W=>setTimeout(W,500))}ae.push(...te);const pe=$+5>=N.length}const ee={};for(const $ of ae.flat()){const[j,te]=$;ee[j]||(ee[j]={}),Object.assign(ee[j],te)}return ee}catch(G){return console.error("Failed to fetch metric values:",G),{}}}),p),I=async D=>{if(!D.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const N=await S(D,w,_);return Object.fromEntries(N)}catch(N){return console.error("Failed to fetch assigned users:",N),{}}};return{items:l,loading:c,error:u,pagination:d,currentPage:h,pageSize:f,cusorMap:a,fetchItems:async D=>{const{cursor:N,offset:G,size:J,searchQuery:ae}=D;let ne=[];c.value=!0,u.value=null;try{const ee=await i.getAllItem_cursor({...D,cursor:N||void 0,offset:G||void 0,pageSize:J||f.value,...v(ae),sortBy:D.sort_by});return l.value=ee.data,d.value=ee.meta,h.value=ee.meta.current_page||0,ne=ee.data.map($=>$==null?void 0:$.id),ee}catch(ee){throw u.value=ee,console.error("Failed to fetch items (cursor):",ee),ee}finally{const ee=async()=>{try{const[$,j]=await Promise.all([I(ne),E(ne)]);e.value.updateItemData({assignees:$,permission:j},ne);const te=await x(ne,e.value.metricIds);e.value.setMetricValues(te,new Set(ne),e.value.metricIds)}catch($){console.error("Post-fetch processing failed:",$)}};c.value=!1,setTimeout(ee)}},getAssignableStatus:async D=>{try{return await i.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:D})}catch(N){throw console.error("Failed to fetch assignable status:",N),N}},getMetricList:async D=>{try{return await i.getMetricList({workspaceId:e.value.workspaceId,entityId:D})}catch(N){throw console.error("Failed to fetch metric list:",N),N}},getMetricValues:x,getAssignedUsers:I}};function bEe(e){return{updateRowData:(o,s)=>{if(!e.value)return;const r=[],i=new Set,a=e.value.getColumnDefs();if(!a)return;const l=a.map(c=>{if(c.field&&c.field.startsWith("metric_")&&(c.hide===!1||c.hide===void 0))return c.field}).filter(Boolean);s.forEach(c=>{var d;const u=(d=e.value)==null?void 0:d.getRowNode(c);if(u){if(r.push(u),o.assignees){const h=T7((o.assignees[c]||[]).map(rP));u.data.assignees=h,i.add("assignees")}o.permission&&(u.data.permissions=o.permission[c]),l.forEach(h=>{u.data[h]=u.data[h]??null})}}),i.add("assignees"),i.add("status"),i.add("dateRange"),i.add("moreActions"),i.add("name"),i.add("description"),e.value.refreshCells({rowNodes:r,columns:Array.from(i),force:!0})},setMetricValues:(o,s,r)=>{const i=e.value;if(!i)return;const a=new Map(Array.from(s).map(c=>[c,new Map(r.map(u=>[u,{value:null,auth_permission:void 0}]))]));Object.entries(o).forEach(([c,u])=>{Object.entries(u).forEach(([d,h])=>{var f;(f=a.get(c))==null||f.set(d,{value:h==null?void 0:h.value,auth_permission:h==null?void 0:h.auth_permission})})});const l=Array.from(a.entries()).map(([c,u])=>{const d=i.getRowNode(c);return d!=null&&d.data?(u.forEach((h,f)=>{const p=`metric_${f}`;d.data[p]=(h==null?void 0:h.value)||null;const g=`metric_permission_${f}`;d.data[p]=(h==null?void 0:h.value)||null,d.data[g]=(h==null?void 0:h.auth_permission)||null}),d):null});l.length>0&&i.refreshCells({rowNodes:l,columns:Array.from(r).map(c=>`metric_${c}`),force:!0})}}}function SEe(e,t,n,o,s){let r=!0;return{async getRows(i){try{o(!0),r&&(s(!0),r=!1);const a=Math.floor(i.startRow/t)+1,{rows:l,total:c}=await e({page:a,pageSize:t,filterText:n(),sort_by:i.sortModel});let u=-1;Number.isFinite(c)?u=c:l.length<t&&(u=i.startRow+l.length),i.context={pageSize:t,text:n()},i.successCallback(l,u),o(!1),s(!1)}catch(a){console.error("Datasource fetch error:",a),i.failCallback(),o(!1),s(!1)}}}}function EEe(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:o,gridApi:s,fetcher:r}=e,i=B(!0),a=B(!0),l=B(!1),c=()=>{n.value=!n.value},u=v=>{if(i.value=!1,s.value=v,!v)return null;const{addEventListener:w,setGridOption:S}=v;if(!r)return console.error("Fetcher function is undefined"),null;const b=SEe(r,e.perPage,()=>o.value,C=>{i.value=C},C=>{a.value=C});return S==null||S("datasource",b),w==null||w("selectionChanged",()=>{t.value=v.getSelectedRows()}),v||null},d=v=>{var w,S;if((w=s.value)==null||w.hideOverlay(),v!==void 0&&(o.value=v),(S=s.value)==null||S.deselectAll(),t.value=[],i.value=!0,!s.value||!r){console.error("Grid API or fetcher is not available"),i.value=!1;return}l.value=!0,a.value=!0,s.value.purgeInfiniteCache(),s.value.ensureIndexVisible(0,"top"),setTimeout(()=>{i.value=!1,setTimeout(()=>{l.value=!1},100)},300)},h=()=>{var v;(v=s.value)==null||v.deselectAll(),t.value=[]},f=xr(v=>{d(v)},li),p=()=>{s.value},g=B(!1);return{isLoading:i,toggleSidebar:c,onGridReady:u,onSearch:f,handleUnSelect:h,firstLoad:a,cacheCleared:l,handleSelectAll:p,isSelectAll:g}}const _Ee={changelog:{"1.0.1":{date:"2024-06-20",changes:["Fixed styling issues for archived and deleted rows."]},"1.0.0":{date:"2024-06-15",changes:["Initial release of the Item Table package."]},"0.0.1-alpha.8":{date:"2024-06-10",changes:["Improved performance of row updates.","Added support for custom cell renderers.","Add row hover effect for better UX.","Add loading skeleton for filter","Beta release with core functionalities implemented."]},"0.0.1-alpha.9":{date:"2024-06-05",changes:["Add row selection feature.","Fix bug with column resizing.","Optimize rendering for large datasets.","Implement getLog function to retrieve changelog entries based on version.","Display app version and changelog in the Item Table component tooltip.","Clean up unused autocomplete and memoized config composables.","Update styles for better consistency and readability."]},"0.0.1-alpha.11":{date:"2024-06-18",changes:["Add bulk process status display: items now show an hourglass icon and tooltip when being processed.","Update data model: added isProcessing and bulk_process properties to track item status.","Improve row focus: focused rows now flash for better visibility.","Set 'Last Updated' and 'Completed On' columns as read-only.","Fix: resolve visual fetching issue in useRemoteFiles composable.","Fix: use correct upload icon in PopupCreateScenes component.","Enhance data conversion to include processing status in item rows."]},"0.0.1-alpha.12":{date:"2024-06-12",changes:["feat: enhance Snackbar component and notification handling","Refactor Snackbar.vue for improved readability and styling, including color adjustments for icons and text.","Add showMessage function in notifications store to display messages based on API keys, improving notification management.","Introduce notificationMessage constant to centralize notification messages for various API actions, enhancing maintainability.","Remove unnecessary console logs from useRemoteFiles and improve logging in notification store for better debugging."]},"0.0.1-alpha.16":{date:"2024-06-20",changes:["Add onboarding tour feature and enhance UI components with new dependencies","Refactor UI components for improved styling and functionality","Updated RatingComponent.vue to streamline class bindings and improve accessibility attributes.","Enhanced SearchBox.vue by adding a clear event handler and simplifying icon rendering.","Modified AssigneeGroupEditor.vue and AssigneeGroupRenderer.vue to remove unnecessary size attributes from icons.","Adjusted DateRangeRenderer.vue to remove size attributes from icons for consistency.","Updated HeaderCheckbox.vue to set dropdown placement to 'bottom-start'.","Refined HeaderSorting.vue to simplify sort option labels and improve sorting logic.","Enhanced HeaderWrapper.vue to utilize reactive properties for sorting state.","Improved HyperLinkEditor.vue and HyperLinkInlineEditor.vue by removing size attributes from icons.","Updated PopupLayout.vue to use a CSS variable for box-shadow styling.","Refined Snackbar.vue to standardize icon colors and improve styling consistency.","Adjusted useTippy.ts to set default placement and arrow visibility for tooltips.","Modified notificationMessage.ts to remove error messages for list fetching.","Cleaned up notifications.ts by removing console logs for a cleaner codebase.","Updated sortStore.ts to comment out unnecessary console logs for better performance.","Enhanced styles.scss by defining new icon size variables and standardizing box-shadow styles."]},"0.0.99":{date:"2024-06-24",changes:["Fix: resolve issue with incorrect version display in Item Table component.","Update changelog retrieval logic to ensure accurate version matching.","Enhance tooltip display for app version and changelog in Item Table component."]}}},REe=e=>{var t;return(t=Object.entries(_Ee.changelog).find(([n,o])=>n===e))==null?void 0:t[1].changes},DEe={key:1},TEe=Ct(st({__name:"PopupOverwriteScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const o=B(null),s=e,r=()=>{o.value&&o.value.show()},i=B(""),a=B("idle"),l=B({file:null,format:null}),{apiServices:c}=Zn(!1,{}),u=B(!1),d=async()=>{u.value=!0;const T=s.workspaceId,A=s.entityId;if(!T||!A||!c.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await c.value.downloadExportedItemsFile(T,A))throw new Error("No response from downloadTemplate API")}catch(k){console.error("Error downloading template:",k)}u.value=!1},h=n,f=()=>{h("import-success"),S()},p=async T=>{var P,D,N;const A=new FormData,k=((P=T.name.split(".").pop())==null?void 0:P.toString())||"";if(A.append("file",T),A.append("format",k),A.append("entity_id",s.entityId||""),!c.value){console.error("API services not available");return}try{await c.value.overwriteScenesViaImportFile(s.workspaceId,s.entityId,A),g()}catch(G){throw console.error("Error uploading file:",G),v(((N=(D=G.response)==null?void 0:D.data)==null?void 0:N.message)||"An unknown error occurred during file upload."),G}},g=()=>{a.value="success"},v=T=>{i.value=T,a.value="error"},w=async()=>{!l.value||!l.value.file||await p(l.value.file)},S=()=>{var T;E(),(T=o.value)==null||T.hide()};t({close:S,open:r});const b=q(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Update existing work"})[a.value]),C=q(()=>l.value.file?!1:(console.error("No file selected"),!0)),_=B(null),E=()=>{var T;(T=_.value)==null||T.clear(),i.value="",l.value={file:null,format:null},a.value="idle"},x=yn("switchInstance"),I=()=>{x?x("xlsx_toolbox","",{showLoad:!1}):window.appManager.switchInstance("xlsx_toolbox","",{showLoad:!1}),console.log("Toolbox opened")},F=(T,A)=>new File([T],A,{type:T.type});let M;return Qt(()=>{const T=sessionStorage.getItem("BASE_URL");M=jE({target:window,allowedOrigins:[T||"https://app.arbocollab.com"],onMessage:(A,k)=>{var D;if(console.log("PopupCreateScenes: Received message:",A),A.type!=="TOOLBOX_EXPORT_DATA")return;console.log("Received from:",k.origin),console.log("File name:",A.payload.fileName);const P=F(A.payload.file,A.payload.fileName);(D=_.value)==null||D.setFile(P)},onInvalidMessage:(A,k,P)=>{console.warn("Rejected postMessage:",k,P.origin)}})}),qn(()=>{M==null||M()}),(T,A)=>(K(),Ue(H(zS),{"popup-name":b.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:o,onHidden:E},tu({default:he(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(K(),Ue(oL,{key:0,state:a.value,"error-message":i.value,overwrite:!0},null,8,["state","error-message"])):(K(),ie("div",DEe,[me("div",{class:Q(T.$style["step-section"])},[me("span",{class:Q(T.$style["step-title"])},"Step 1: Download current data",2),me("span",{class:Q(T.$style["step-description"])},[...A[1]||(A[1]=[Qe(" Download a file with all existing work and details. Edit it, then upload in Step 2. ",-1),me("br",null,null,-1),me("i",null,"Note: Empty cells and unchanged values will be skipped.",-1)])],2),me("div",{class:Q(T.$style["actions-section"])},[ue(H(at),{class:Q(T.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:u.value,onHandleClick:d},{prefix:he(()=>[ue(H(lt),{src:"Download"})]),default:he(()=>[A[2]||(A[2]=Qe(" Download file ",-1))]),_:1},8,["class","disabled"]),ue(H(at),{class:Q(T.$style["download-sample-btn"]),size:12,variant:"secondary",onHandleClick:I},{default:he(()=>[...A[3]||(A[3]=[Qe(" Toolbox ",-1)])]),_:1},8,["class"])],2)],2),me("div",{class:Q(T.$style["step-section"])},[me("span",{class:Q(T.$style["step-title"])},"Step 2: Upload updated file (.xlsx, .xls, .csv)",2),ue(H(EM),{modelValue:l.value,"onUpdate:modelValue":A[0]||(A[0]=k=>l.value=k),ref_key:"filUploaderRef",ref:_},null,8,["modelValue"])],2),me("div",{class:Q(T.$style["step-section"]),style:{"padding-top":"0","padding-bottom":"0"}},[ue(sL)],2)]))]),_:2},[a.value==="idle"?{name:"footer",fn:he(()=>[ue(H(at),{style:{flex:"1"},variant:"secondary",onClick:S},{default:he(()=>[...A[4]||(A[4]=[Qe(" Cancel ",-1)])]),_:1}),ue(H(at),{disabled:C.value,style:{flex:"1"},variant:"primary",onClick:w},{default:he(()=>[...A[5]||(A[5]=[Qe(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:he(()=>[ue(H(at),{style:{flex:"1"},variant:"primary",onClick:f},{default:he(()=>[...A[6]||(A[6]=[Qe(" Close ",-1)])]),_:1})]),key:"1"}:{name:"footer",fn:he(()=>[ue(H(at),{style:{flex:"1"},variant:"primary",onClick:E},{default:he(()=>[...A[7]||(A[7]=[Qe(" Try Again ",-1)])]),_:1})]),key:"2"}]),1032,["popup-name"]))}}),[["__cssModules",{$style:{"step-section":"_step-section_1ji92_1","step-title":"_step-title_1ji92_12","step-title-2":"_step-title-2_1ji92_18","step-description":"_step-description_1ji92_24","date-format-guide":"_date-format-guide_1ji92_29","import-error":"_import-error_1ji92_40","drop-area":"_drop-area_1ji92_50","is-dragging":"_is-dragging_1ji92_50","drop-area-content":"_drop-area-content_1ji92_53",browse:"_browse_1ji92_62","download-sample-btn":"_download-sample-btn_1ji92_66","actions-section":"_actions-section_1ji92_70"}}]]),IEe={class:"visual-btn-visual"},xEe={class:"visual-btn--label"},FEe={key:0,class:"visual-btn--description"},PEe={key:1,class:"visual-btn--description"},N$=Ct(st({__name:"VisualButton",props:{label:{},description:{},disabled:{type:Boolean}},emits:["onClick"],setup(e,{emit:t}){const n=e,o=()=>{n.disabled||s("onClick")},s=t;return(r,i)=>(K(),ie("div",{class:Q(["visual-btn",{"visual-btn--disabled":e.disabled}]),onClick:o},[me("div",IEe,[Tt(r.$slots,"visual",{},()=>[i[0]||(i[0]=kU('<svg width="42" height="36" viewBox="0 0 42 36" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-db9bdf1b><g clip-path="url(#clip0_4824_13082)" data-v-db9bdf1b><path d="M5.14286 18V10.2857H18V18H5.14286ZM5.14286 23.1 429H18V30.8571H5.14286V23.1429ZM23.1429 30.8571V23.1429H36V30.8571H23.1429ZM36 18H23.1429V10.2857H36V18ZM5.14286 0C2.30625 0 0 2.30625 0 5.14286V30.8571C0 33.6937 2.30625 36 5.14286 36H36C38.8366 36 41.1429 33.6937 41.1429 30.8571V5.14286C41.1429 2.30625 38.8366 0 36 0H5.14286Z" fill="#D7D7D7" data-v-db9bdf1b></path><path d="M0 5.14286C0 2.30625 2.30625 0 5.14286 0H36C38.8366 0 41.1429 2.30625 41.1429 5.14286V10.318H0V5.14286Z" fill="#A6A6A6" data-v-db9bdf1b></path></g><defs data-v-db9bdf1b><clipPath id="clip0_4824_13082" data-v-db9bdf1b><rect width="41.1429" height="36" fill="white" data-v-db9bdf1b></rect></clipPath></defs></svg>',1))],!0)]),me("div",xEe,ut(n.label),1),n.disabled?(K(),ie("div",FEe," Coming soon ")):(K(),ie("div",PEe,ut(n.description),1))],2))}}),[["__scopeId","data-v-db9bdf1b"]]),eR="xlsx_toolbox",kEe="TOOLBOX_EXPORT_DATA",AEe="https://app.arbocollab.com",OEe=e=>{const t=yn("switchInstance",void 0),n=r=>{const{source:i,template:a}=r??{};console.log("Opening toolbox with payload:",r);const l={showLoad:!1};if(t?t(eR,"",l):window.appManager.switchInstance(eR,"",l),!i||!a)throw new Error("Source or template file is missing");setTimeout(()=>{const c=`${sessionStorage.getItem("BASE_URL")}`;window.postMessage({type:"xlsx-mapping:load",payload:{source:i,template:a}},c)},1e3)};let o;const s=r=>{var i;if(console.log("Received postMessage event:",r),((i=r.data)==null?void 0:i.type)===kEe){const{file:a,fileName:l}=r.data.payload;e(new File([a],l,{type:a.type}),l),window.appManager.hide(eR)}};return Qt(()=>{o=jE({target:window,allowedOrigins:[sessionStorage.getItem("BASE_URL")||AEe],onMessage:r=>{s({data:r})},onInvalidMessage:(r,i,a)=>{console.warn("Rejected postMessage:",i,a.origin)}}),window.addEventListener("message",s)}),qn(()=>o==null?void 0:o()),{openToolbox:n}},MEe={class:"header-name"},NEe={class:"modal-body"},LEe={class:"description"},VEe={key:0,class:"error-message"},BEe={class:"dynamic"},$Ee={key:1,class:"choose-method-container"},HEe={key:2,class:"select-status-container"},GEe={key:3,class:"result-container"},UEe={key:4,class:"result-container"},L$="text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",WEe=20,zEe=Ct(st({__name:"PopupToolboxUploader",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const o=q(()=>dP()),s=q(()=>({1:{title:`Create ${o.value} in bulk`,description:""},2:{title:"Select status",description:"Choose a status for the new work "},3:{title:"Import successful",description:"Work will be created in background. Refresh to see updates."},4:{title:"Import failed",description:"File doesn’t meet requirements. Check file and try again."},5:{title:"Waiting for Toolbox",description:"Waiting for Toolbox"}})),r={"--popup-pt":"20px","--popup-pb":"20px","--popup-pl":"24px","--popup-pr":"24px"},i=e,a=n,{apiServices:l}=Zn(!1,i),c=B(),u=B(1),d=B(null),h=B(null),f=B(null),p=B(void 0),g=B(null),v=q(()=>s.value[u.value]),w=()=>{d.value=null,u.value=1,h.value=null,f.value=null,S.value=null,g.value=null,p.value=void 0};tt([h,f],([P,D])=>{u.value===1&&P&&D&&(u.value=2)});const S=B(null),b=P=>{console.error(P),S.value=P},C=async(P,D)=>{var G,J,ae;if(A.value=!0,console.log("Uploading file:",P),!l.value||!i.workspaceId||!i.entityId){console.error("API services not available");return}const N=new FormData;N.append("file",P),N.append("format",((G=D??P.name)==null?void 0:G.split(".").pop())??P.name.split(".").pop()??""),N.append("entity_id",i.entityId),N.append("template_flow_status_id",d.value??"");try{await l.value.addNewSceneViaImportFile(i.workspaceId,i.entityId,N),u.value=3,a("import-success")}catch(ne){console.error("Error uploading file:",ne),b(((ae=(J=ne.response)==null?void 0:J.data)==null?void 0:ae.message)||"An unknown error occurred during file upload."),u.value=4}finally{A.value=!1}},{openToolbox:_}=OEe((P,D)=>{console.log("File received from toolbox:",P),f.value=P,p.value=D??P.name,u.value=2}),E=async()=>{const P=await I();try{_({source:void 0,template:P})}catch(D){console.error("Error opening toolbox:",D),oa().showErrorNetMessage("Failed to open toolbox.")}},x=B(!1),I=async()=>{x.value=!0;const P=i.workspaceId,D=i.entityId;if(!P||!D||!l.value)return console.error("Workspace ID or Entity ID is missing"),Promise.reject(new Error("Workspace ID or Entity ID is missing"));try{const N=await l.value.downloadTemplate(P,D,!1);if(console.log("Downloaded template response:",N),!N)throw new Error("No response from downloadTemplate API");return N}catch(N){return console.error("Error downloading template:",N),Promise.reject(N)}finally{x.value=!1}},F=P=>{console.log("Validating file:",P.type);const D=L$.includes(P.type);return D||(console.error("Invalid file type:",P.type),oa().addNotification({id:"invalid-file-type",message:"Invalid file type. Please upload a xlsx, xls, csv file.",type:"error"})),D},M=async()=>{const P=document.createElement("input");P.type="file",P.accept=L$,P.onchange=async()=>{var N;const D=(N=P.files)==null?void 0:N[0];if(D){if(!F(D)){w();return}h.value=ob(D);try{const G=await I();if(console.log("Template file downloaded:",G),!G){oa().addNotification({id:"failed-download-template",message:"Failed to download template file.",type:"error"});return}_({source:D,template:G})}catch(G){console.error("Error opening toolbox:",G),oa().addNotification({id:"failed-open-toolbox",message:"Failed to open toolbox.",type:"error"})}}},P.click()},T=async P=>{var D;if(!((D=l.value)!=null&&D.getAssignableStatuses)){console.error("API services not available");return}return l.value.getAssignableStatuses(i.workspaceId,{entity_id:i.entityId,name_like:P.name_like,page:P.page,per_page:WEe})},A=B(!1),k=()=>{d.value&&f.value&&(A.value=!0,C(f.value,p.value).finally(()=>{A.value=!1}))};return t({open:()=>{var P;return(P=c.value)==null?void 0:P.show()},close:()=>{var P;return(P=c.value)==null?void 0:P.hide()}}),(P,D)=>(K(),Ue(H(zS),Wt({ref_key:"popupRef",ref:c,style:r,onHidden:w},{popupIndex:10,popupName:v.value.title,minWidth:"420px",showOverlay:!0,overlayOpacity:.5,closeOnOverlayClick:!1,closeOnEscape:!0}),tu({header:he(()=>[me("span",MEe,ut(v.value.title),1)]),default:he(()=>[me("div",NEe,[me("div",LEe,ut(v.value.description),1),S.value?(K(),ie("div",VEe,[D[1]||(D[1]=Qe(" Error code ",-1)),me("span",BEe,ut(S.value),1)])):Xe("",!0),u.value===1?(K(),ie("div",$Ee,[ue(N$,{disabled:!0,label:"Start with a blank sheet",description:`Type or paste ${o.value} details
|
|
261
261
|
into a table.`,onOnClick:E},{visual:he(()=>[ue(H(Ka),{src:"BlankSheet",size:65})]),_:1},8,["description"]),ue(N$,{label:"Import from file",description:`Create ${o.value} from a CSV or
|
|
262
|
-
Excel file.`,onOnClick:M},{visual:he(()=>[ue(H(Ka),{src:"UploadFile",size:65,"max-width":"65"})]),_:1},8,["description"])])):u.value===2?(K(),ie("div",HEe,[ue(H(CM),{modelValue:d.value,"onUpdate:modelValue":D[0]||(D[0]=N=>d.value=N),"get-status-func":T,"workspace-id":i.workspaceId,id:i.entityId,style:{width:"100%"},"max-width":"372px"},null,8,["modelValue","workspace-id","id"])])):u.value===3?(K(),ie("div",GEe,[ue(H(Ka),{src:"Success",width:240,height:180,ratio:"unset"})])):u.value===4?(K(),ie("div",UEe,[ue(H(Ka),{src:"Failed",width:240,height:180,ratio:"unset"})])):Xe("",!0)])]),_:2},[u.value===2||u.value===4?{name:"footer",fn:he(()=>[u.value===2?(K(),Ue(H(at),{key:0,loading:A.value,disabled:A.value||!d.value,onClick:k},{default:he(()=>[...D[2]||(D[2]=[Qe(" Import ",-1)])]),_:1},8,["loading","disabled"])):(K(),Ue(H(at),{key:1,onClick:w},{default:he(()=>[...D[3]||(D[3]=[Qe(" Try Again ",-1)])]),_:1}))]),key:"0"}:void 0]),1040))}}),[["__scopeId","data-v-
|
|
263
|
-
`)});function Fi(Ae){var Ze;Ae==="new_scene"?(Ze=gr.value)==null||Ze.show():Ae==="import_scenes"?jt():Ae==="overwrite_scenes"&&Nt()}const mr=Ae=>{w.value=Ae.api.getSelectedRows().map(Ze=>Ze.id)},Sa=Ae=>{const Ze=be(Ae);return Ze&&(Ze.addEventListener("modelUpdated",zt),Ze.addEventListener("bodyScroll",()=>Ze.stopEditing()),Ze.addEventListener("selectionChanged",At),Ze.addEventListener("columnMoved",hn=>J(hn,!0)),Ze.addEventListener("columnResized",hn=>J(hn,!0)),Ze.addEventListener("firstDataRendered",()=>{Me.value=!1}),!document.querySelector(".ag-body-viewport"))||Ae==null||Ae.setColumnsVisible(["ag-Grid-SelectionColumn"],!1),Ze},Pi=()=>{var Ae;d.value=(((Ae=document.getElementById("item-table-layout-id"))==null?void 0:Ae.clientHeight)??0)-78+"px"};Qt(()=>{gt(()=>{Pi()}),window.addEventListener("resize",Pi);function Ae(){requestAnimationFrame(Ae)}Ae()}),qn(()=>{window.removeEventListener("resize",Pi)});const ki=async({code:Ae,name:Ze})=>{await Ee(Ae),setTimeout(()=>{var Kt;(Kt=E.value)==null||Kt.setValue(Ze)},300)},Ai=Ae=>{if(!v.value)return;const Ze=v.value.getRowNode(Ae);Ze?(v.value.ensureIndexVisible(Number(Ze.rowIndex),"middle"),v.value.flashCells({rowNodes:[Ze],flashDuration:3e3,fadeDuration:1e3})):v.value.ensureIndexVisible(b.value.total-1,"bottom")},vr=Ae=>Ae.metric_type.code==="number"?"number":"default",Oi=async()=>{if(f.entityId)try{const Ae=await ve(f.entityId);I.value=Ae.data.map(Ze=>({...Ze,sortType:vr(Ze)}))}catch(Ae){console.error("Failed to initialize metric list:",Ae),I.value=[]}},zd=async()=>{if(k.value)try{const Ae=await k.value.getUserPermission(f.workspaceId);s(Ae)}catch(Ae){console.error("Failed to fetch user permissions:",Ae)}},On=async()=>{if(k.value)try{const Ae=await k.value.getEntityDetail(f.workspaceId,f.entityId);r(Ae.permission),c.value=Ae}catch(Ae){console.error("Failed to fetch entity details:",Ae)}},lo=Pv(),{setUser:nR}=lo,jd=async()=>{if(k.value)try{const Ae=await k.value.getMe();return nR(Ae),Ae}catch(Ae){console.error("Failed to fetch user details:",Ae)}},Kd=async()=>{var Ae;if(k.value)try{const Ze=await k.value.getWorkspaces(f.workspaceId),Kt=(Ae=Ze.data[0])==null?void 0:Ae.ws_user_role_id;return Kt&&lo.setUserRoleId(Kt),Ze}catch(Ze){console.error("Failed to fetch workspace details:",Ze)}};tt(()=>[f.entityId,f.workspaceId],async([Ae,Ze])=>{!Ae||!Ze||(jd(),Kd(),Oi(),zd(),On())},{immediate:!0,deep:!0}),tt(j,(Ae,Ze)=>{const Kt=Ae.filter(hn=>!(Ze!=null&&Ze.includes(hn)));Kt.length>0&&re(Array.from(T.value),Kt).then(hn=>{ne(hn,T.value,Kt)})},{immediate:!0,deep:!0}),tt(F,(Ae,Ze)=>{M.value=!!(Ze&&Ae&&Ze!==Ae)}),t({refreshTable:nt});const qd=Ae=>{Ve.value=Ae,nt()},oR=Ae=>{L.value=Ae,nt()},Mi=Ae=>{P.value=Ae||[],J({},!0)},bl=q(()=>{var hn;const Ae=un.getInstance().getItem("ws.terminology"),Ze=Ae?JSON.parse(Ae):null;return`New ${((hn=Ze==null?void 0:Ze.find(Ni=>Ni.code==="scene"))==null?void 0:hn.name)||"Scene"}`});return(Ae,Ze)=>(K(),Ue(H(uee),{"is-sidebar-open":C.value,onCloseSidebar:H(Ge),onSidebarClear:H(Ge),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:H(Ge)},{"header-left":he(()=>{var Kt;return[((Kt=H(i))==null?void 0:Kt.has_create_item_permission)==1?(K(),Ue(H(WS),{key:0,variant:["primary"],options:h.value,onSelect:Fi,onHandleClick:Ze[1]||(Ze[1]=hn=>Fi("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:he(()=>[Ke(ue(H(at),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Ze[0]||(Ze[0]=hn=>Fi("new_scene")),label:bl.value},null,8,["label"]),[[H(l),1]])]),_:1},8,["options"])):Xe("",!0)]}),"header-actions":he(()=>[ue(H(Une),{"onUpdate:assignees":oR,onApplyFilter:qd,loading:H(Me),entityId:f.entityId},null,8,["loading","entityId"]),Ke(ue(H(bS),{focusIndex:"4",modelValue:_.value,"onUpdate:modelValue":Ze[2]||(Ze[2]=Kt=>_.value=Kt),onSearch:H(Ee),class:Q(Ae.$style.itemSearchBox),onClear:Ze[3]||(Ze[3]=Kt=>H(Ee)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:E},null,8,["modelValue","onSearch","class"]),[[H(n),{isLoading:H(Me),fullwidth:!0}]]),Ke((K(),Ue(H(vA),{status:H(le)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":M.value},{default:he(()=>[Ke((K(),Ue(H(at),{variant:["secondary","icon"],disabled:H(le),onClick:nt},{default:he(()=>[ue(H(lt),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[H(l),5],[H(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[H(n),{isLoading:H(Me),fullwidth:!0}]]),Ke(ue(H(Vte),{"model-value":H(P),onChange:Ze[4]||(Ze[4]=Kt=>Mi(Kt)),id:"table_customization",gridApi:v.value,ref_key:"tableCustomizationRef",ref:G,"checkbox-column":H(D),tableHeight:d.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[H(n),{isLoading:H(Me),fullwidth:!0}]])]),grid:he(({availableHeight:Kt})=>[ue(H(hEe),Wt({id:"item_table_main",ref_key:"agGrid",ref:de},tn.value,{height:Kt+"px",isSorting:H(xe),onOnGridReady:Sa,onSelectionChanged:mr}),null,16,["height","isSorting"])]),footer:he(()=>[me("div",{class:Q(Ae.$style.tableFooter),id:"table_footer"},[me("span",null,[Ze[5]||(Ze[5]=Qe(" Showing ",-1)),me("b",null,ut(H(b).loaded)+" of "+ut(H(b).total),1)])],2)]),"new-row":he(()=>[ue(H(wne),{ref_key:"createNewSceneRef",ref:gr,onSearchForCode:ki,onFocusOnId:Ai},null,512)]),"bulk-update-actions":he(()=>[!C.value&&w.value.length>0?Ke((K(),Ue(H(nee),{key:0,selectRowData:wt.value,"workspace-id":f.workspaceId,"entity-id":f.entityId,"grid-api":v.value,onUnselect:H(ze),onSelectAll:H(qe),"take-name":ge.value,"selected-all":W.value,"total-rows":H(b).total,"visible-rows":H(b).loaded,onUpdated:At,loading:H(le)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"])),[[Ks,!C.value&&w.value.length>0]]):Xe("",!0)]),snackbar:he(()=>[ue(H(Kee))]),popup:he(()=>[ue(zre,{ref_key:"popupCreateSceneRef",ref:Le,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:nt},null,8,["workspace-id","entity-id"]),ue(zEe,{ref_key:"popupToolboxUploaderRef",ref:je,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:nt},null,8,["workspace-id","entity-id"]),ue(TEe,{ref_key:"popupOverwriteScenesRef",ref:_t,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:nt},null,8,["workspace-id","entity-id"])]),_:1},8,["is-sidebar-open","onCloseSidebar","onSidebarClear","onSidebarApply"]))}}),[["__cssModules",{$style:{tableTitle:"_tableTitle_1sow5_1",tableFooter:"_tableFooter_1sow5_7",footerStart:"_footerStart_1sow5_17",newRow:"_newRow_1sow5_25","warning-text":"_warning-text_1sow5_43","has-error":"_has-error_1sow5_48",itemSearchBox:"_itemSearchBox_1sow5_52","beta-tag":"_beta-tag_1sow5_56"}}]]),V$="0.1.
|
|
262
|
+
Excel file.`,onOnClick:M},{visual:he(()=>[ue(H(Ka),{src:"UploadFile",size:65,"max-width":"65"})]),_:1},8,["description"])])):u.value===2?(K(),ie("div",HEe,[ue(H(CM),{modelValue:d.value,"onUpdate:modelValue":D[0]||(D[0]=N=>d.value=N),"get-status-func":T,"workspace-id":i.workspaceId,id:i.entityId,style:{width:"100%"},"max-width":"372px"},null,8,["modelValue","workspace-id","id"])])):u.value===3?(K(),ie("div",GEe,[ue(H(Ka),{src:"Success",width:240,height:180,ratio:"unset"})])):u.value===4?(K(),ie("div",UEe,[ue(H(Ka),{src:"Failed",width:240,height:180,ratio:"unset"})])):Xe("",!0)])]),_:2},[u.value===2||u.value===4?{name:"footer",fn:he(()=>[u.value===2?(K(),Ue(H(at),{key:0,loading:A.value,disabled:A.value||!d.value,onClick:k},{default:he(()=>[...D[2]||(D[2]=[Qe(" Import ",-1)])]),_:1},8,["loading","disabled"])):(K(),Ue(H(at),{key:1,onClick:w},{default:he(()=>[...D[3]||(D[3]=[Qe(" Try Again ",-1)])]),_:1}))]),key:"0"}:void 0]),1040))}}),[["__scopeId","data-v-6d122354"]]),jEe=Ct(st({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=Ts,o=gS(),{setUserPermissions:s,setEntityPermissions:r}=o,{entityPermissions:i}=ns(o),a=Yt,l=ko,c=B(null),u={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},d=B(""),h=q(()=>{var Ze;const Ae=((Ze=i.value)==null?void 0:Ze.has_create_item_permission)==1||!1;return[{label:"Create in bulk",value:"import_scenes",type:"text",id:"import_scenes_option",hide:!Ae},{label:"Update existing (CSV or Excel)",value:"overwrite_scenes",type:"text",hide:!Ae,id:"overwrite_scenes_option"}]}),f=e;qf.initialize({wrapVueCellRenderer:Wv,wrapVueCellEditor:hL});const p=mf(),{switchInstanceFunc:g}=ns(p);Qt(()=>{const Ae=oo();g.value=Ae==null?void 0:Ae.appContext.config.globalProperties.switchInstance;const Ze=new BroadcastChannel("focusable_channel");gt(()=>{setTimeout(()=>{Ze.postMessage("Focusable elements updated")},7e3)})});const v=B(null),w=B([]),S=cv(),{rowCount:b}=ns(S),C=B(!1),_=B(""),E=B(),x=EA(),{metricList:I}=ns(x),F=B(""),M=B(!1),T=B(new Set),A=B(new Map),{apiServices:k}=Zn(!1,f),{columnDefs:P,checkboxColumn:D,saveColumnConfig:N}=yEe(I,f.entityId,v),G=B();tt(()=>P,()=>{var Ae;(Ae=G.value)==null||Ae.updateColumnDefs(P.value)},{deep:!0});const J=(Ae,Ze)=>{N(Ae,Ze)},{updateRowData:ae,setMetricValues:ne}=bEe(v),ee=q(()=>({isSearching:_.value.length>0,isFiltering:!(Object.keys(Ve.value||{}).length==1&&Object.keys(Ve.value)[0]=="preflight_status")&&Object.keys(Ve.value||{}).length>0})),$=q(Dm),j=q(()=>P.value.filter(Ae=>{var Ze;return((Ze=Ae.field)==null?void 0:Ze.startsWith("metric_"))&&!Ae.hide}).map(Ae=>{var Ze;return((Ze=Ae.field)==null?void 0:Ze.replace("metric_",""))||""}));Jr("timezone",$);const te=q(()=>({autoFetch:!1,workspaceId:f.workspaceId,entityId:f.entityId,metricIds:j.value,updateItemData:ae,setMetricValues:ne})),{fetchItems:pe,getMetricList:ve,cusorMap:we,getMetricValues:re}=CEe(te),W=q(()=>{if(!v.value)return!1;const Ae=v.value.getSelectedRows().length;return Ae>0&&Ae>=b.value.total}),ge=q(()=>{var Ae;return((Ae=c.value)==null?void 0:Ae.name)||"Items"}),oe=Ae=>{setTimeout(()=>{gt(()=>{var Ze,Kt;v.value&&(Ae?(Ze=v.value)==null||Ze.showNoRowsOverlay():(Kt=v.value)==null||Kt.hideOverlay())})},500)},_e=(Ae,Ze)=>{var Kt;b.value.total=Ae.meta.total??0,(Kt=Ae.meta.next)!=null&&Kt.cursor&&(we[Ze+1]=Ae.meta.next.cursor),F.value=Ae.meta["X-Tsr-signature"]||"",Ae.meta.total===0?oe(!0):oe(!1)},U=SM(),{setDefaultSort:Y}=U,de=B(null),{sortingAPIConfiguration:ke,isSortingRunning:xe}=ns(U),Ve=B({preflight_status:"1"}),ye=q(()=>({...Ve.value,search:_.value}));Jr("filterParams",ye);const L=B([]),z=async({page:Ae,pageSize:Ze,filterText:Kt})=>{var $c,Ea,In;($c=v.value)==null||$c.hideOverlay();const hn=we[Ae],Ni=!hn&&Ae>1?(Ae-1)*Ze:void 0,as=ke.value;as.length>0&&(xe.value=!0);try{const zr={cursor:hn,size:Ze,searchQuery:Kt,offset:Ni,sort_by:as,...Ve.value},ls=await pe(zr);if(!ls)return{rows:[],total:0};const kp=(In=(Ea=ls.meta)==null?void 0:Ea.extra)==null?void 0:In.default_sort;kp&&Y(kp);const Sl=Ap=>{const Zd=Ap.data.map(yr=>aP(yr,$.value));return Zd.forEach(yr=>{T.value.add(String(yr.id)),A.value.set(String(yr.id),{})}),Zd};console.log(" processFetchedItems res:",ls);const Yd=Sl(ls);return _e(ls,Ae),{rows:Yd,total:b.value.total}}catch(zr){return console.error("Failed to fetch items:",zr),{rows:[],total:0}}finally{xe.value=!1}},{isLoading:le,toggleSidebar:Ge,onGridReady:be,handleUnSelect:ze,handleSelectAll:qe,onSearch:Ee,firstLoad:Me}=EEe({selectRowData:B([]),isSidebarOpen:C,quickFilterText:_,gridApi:v,perPage:u.ROWS_PER_PAGE,fetcher:z}),wt=B([]),At=()=>{var Ae;wt.value=((Ae=v.value)==null?void 0:Ae.getSelectedRows())||[]},Ut=hs({columnsDisplay:[],rowsDisplay:{fromIndex:0,toIndex:0}}),tn=q(()=>({blockLoadDebounceMillis:1e3,columnDefs:P.value,rowModelType:"infinite",cacheBlockSize:u.ROWS_PER_PAGE,infiniteInitialRowCount:20,popupParent:document.getElementById("item-table-layout-id")||void 0,rowSelection:{mode:"multiRow",checkboxes:!1,enableClickSelection:!1,enableSelectionWithoutKeys:!1},pagination:!1,rowHeight:u.ROW_HEIGHT,suppressHorizontalScroll:!1,suppressColumnVirtualisation:!1,debounceVerticalScrollbar:!1,animateRows:!1,suppressAnimationFrame:!1,suppressScrollOnNewData:!0,suppressScrollWhenPopupsAreOpen:!1,rowBuffer:20,enableCellTextSelection:!1,suppressDragLeaveHidesColumns:!0,suppressMaxRenderedRowRestriction:!1,height:u.GRID_HEIGHT,stopEditingWhenCellsLoseFocus:!0,onModelUpdated:zt,noRowsOverlayComponent:Wv(tne),noRowsOverlayComponentParams:()=>ee.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:Ae=>Ae.data.id,getRowClass:Ae=>{if(!Ae.data)return["row-empty"];const Ze=["row-highlight"];return Ae.data.id||Ze.push("row-inactive"),Ae.data.isDeleted&&Ze.push("row-deleted"),Ae.data.disabled&&Ze.push("row-deleted"),Ae.data.isArchived&&Ze.push("row-archived"),Ae.data.isLocked&&Ze.push("row-locked"),Ze},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:f.workspaceId,entityId:f.entityId,apiServices:k.value,sorting:xe.value},onCellKeyDown:Ae=>{var Ze,Kt,hn;if(Ae.data.isDeleted)return!1;if(((Ze=Ae==null?void 0:Ae.event)==null?void 0:Ze.key)==="Enter"){const{api:Ni,node:as,column:$c}=Ae,Ea=Ni.getCellRendererInstances({rowNodes:[as],columns:[$c]});if(Ea.length>0){const In=Ea[0];In&&typeof((Kt=In.componsenExposed)==null?void 0:Kt.focus)=="function"&&((hn=In.componsenExposed)==null||hn.focus())}}},isRowSelectable:Ae=>!Ae.group,suppressKeyboardEvent:Ae=>{var hn;if((hn=Ae.data)!=null&&hn.isDeleted)return!0;const Ze=Ae.event.key,Kt=Ae.editing;return Kt&&Ze==="Tab"?!0:Kt&&Ze==="Enter"?!1:Ze==="Enter"?(Ae.event.preventDefault(),Ae.event.stopPropagation(),!0):Ze==="ArrowUp"||Ze==="ArrowDown"||Ze==="ArrowLeft"||Ze==="ArrowRight"||Ze==="Tab"||Ze==="Enter"},navigateToNextCell:()=>null,onBodyScroll:Ae=>{const Ze=Ae.api.getFirstDisplayedRowIndex(),Kt=Ae.api.getLastDisplayedRowIndex();Ut.rowsDisplay.fromIndex=Ze,Ut.rowsDisplay.toIndex=Kt,Ut.columnsDisplay=Ae.api.getAllDisplayedVirtualColumns().map(hn=>hn.getColId())},onViewportChanged:Ae=>{Ut.columnsDisplay=Ae.api.getAllDisplayedVirtualColumns().map(Ze=>Ze.getColId())},suppressHeaderFocus:!0,onCellEditingStarted(Ae){if(Ae.data.isDeleted&&Ae.api.stopEditing(),Ae.colDef.field=="options"){const Ze=Ae.api.getCellRendererInstances({rowNodes:[Ae.node],columns:[Ae.column]});Ze.length>0&&Ze[0].focusUi()}},tabToNextCell:Ae=>{let Ze=Ae.nextCellPosition;if(Ze&&Ze.column.getColId()==="ag-Grid-SelectionColumn"){const Kt=Ae.api.getAllDisplayedColumns(),hn=Kt.indexOf(Ze.column),Ni=Ae.backwards?-1:1,as=Kt[hn+Ni];if(as)return{rowIndex:Ze.rowIndex,column:as,rowPinned:Ze.rowPinned}}return Ze}}));function zt(){if(!v.value)return;let Ae=0;v.value.forEachNode(Ze=>{Ze.data&&Ae++}),b.value.loaded=Math.min(Ae,b.value.total)}tt(()=>ke,()=>{v.value&&(F.value="",T.value.clear(),v.value.deselectAll(),Object.keys(we).forEach(Ae=>delete we[Number(Ae)]),v.value.purgeInfiniteCache(),v.value.ensureIndexVisible(0))},{deep:!0});const Le=B(),je=B(),_t=B(),Nt=()=>{var Ae;(Ae=_t.value)==null||Ae.open()},jt=()=>{var Ae;(Ae=je.value)==null||Ae.open()},nt=async()=>{Me.value=!0,v.value&&(F.value="",T.value.clear(),Object.keys(we).forEach(Ae=>delete we[Number(Ae)]),await v.value.deselectAll(),await v.value.ensureIndexVisible(0,"top"),await v.value.purgeInfiniteCache(),await v.value.refreshInfiniteCache())},Fo=q(()=>un.getInstance().getItem("ITEM_TABLE_APP_VERSION")||""),gr=B();q(()=>{var Ae;return(Ae=REe(Fo.value))==null?void 0:Ae.map(Ze=>`<div>• ${Ze}</div>`).join(`
|
|
263
|
+
`)});function Fi(Ae){var Ze;Ae==="new_scene"?(Ze=gr.value)==null||Ze.show():Ae==="import_scenes"?jt():Ae==="overwrite_scenes"&&Nt()}const mr=Ae=>{w.value=Ae.api.getSelectedRows().map(Ze=>Ze.id)},Sa=Ae=>{const Ze=be(Ae);return Ze&&(Ze.addEventListener("modelUpdated",zt),Ze.addEventListener("bodyScroll",()=>Ze.stopEditing()),Ze.addEventListener("selectionChanged",At),Ze.addEventListener("columnMoved",hn=>J(hn,!0)),Ze.addEventListener("columnResized",hn=>J(hn,!0)),Ze.addEventListener("firstDataRendered",()=>{Me.value=!1}),!document.querySelector(".ag-body-viewport"))||Ae==null||Ae.setColumnsVisible(["ag-Grid-SelectionColumn"],!1),Ze},Pi=()=>{var Ae;d.value=(((Ae=document.getElementById("item-table-layout-id"))==null?void 0:Ae.clientHeight)??0)-78+"px"};Qt(()=>{gt(()=>{Pi()}),window.addEventListener("resize",Pi);function Ae(){requestAnimationFrame(Ae)}Ae()}),qn(()=>{window.removeEventListener("resize",Pi)});const ki=async({code:Ae,name:Ze})=>{await Ee(Ae),setTimeout(()=>{var Kt;(Kt=E.value)==null||Kt.setValue(Ze)},300)},Ai=Ae=>{if(!v.value)return;const Ze=v.value.getRowNode(Ae);Ze?(v.value.ensureIndexVisible(Number(Ze.rowIndex),"middle"),v.value.flashCells({rowNodes:[Ze],flashDuration:3e3,fadeDuration:1e3})):v.value.ensureIndexVisible(b.value.total-1,"bottom")},vr=Ae=>Ae.metric_type.code==="number"?"number":"default",Oi=async()=>{if(f.entityId)try{const Ae=await ve(f.entityId);I.value=Ae.data.map(Ze=>({...Ze,sortType:vr(Ze)}))}catch(Ae){console.error("Failed to initialize metric list:",Ae),I.value=[]}},zd=async()=>{if(k.value)try{const Ae=await k.value.getUserPermission(f.workspaceId);s(Ae)}catch(Ae){console.error("Failed to fetch user permissions:",Ae)}},On=async()=>{if(k.value)try{const Ae=await k.value.getEntityDetail(f.workspaceId,f.entityId);r(Ae.permission),c.value=Ae}catch(Ae){console.error("Failed to fetch entity details:",Ae)}},lo=Pv(),{setUser:nR}=lo,jd=async()=>{if(k.value)try{const Ae=await k.value.getMe();return nR(Ae),Ae}catch(Ae){console.error("Failed to fetch user details:",Ae)}},Kd=async()=>{var Ae;if(k.value)try{const Ze=await k.value.getWorkspaces(f.workspaceId),Kt=(Ae=Ze.data[0])==null?void 0:Ae.ws_user_role_id;return Kt&&lo.setUserRoleId(Kt),Ze}catch(Ze){console.error("Failed to fetch workspace details:",Ze)}};tt(()=>[f.entityId,f.workspaceId],async([Ae,Ze])=>{!Ae||!Ze||(jd(),Kd(),Oi(),zd(),On())},{immediate:!0,deep:!0}),tt(j,(Ae,Ze)=>{const Kt=Ae.filter(hn=>!(Ze!=null&&Ze.includes(hn)));Kt.length>0&&re(Array.from(T.value),Kt).then(hn=>{ne(hn,T.value,Kt)})},{immediate:!0,deep:!0}),tt(F,(Ae,Ze)=>{M.value=!!(Ze&&Ae&&Ze!==Ae)}),t({refreshTable:nt});const qd=Ae=>{Ve.value=Ae,nt()},oR=Ae=>{L.value=Ae,nt()},Mi=Ae=>{P.value=Ae||[],J({},!0)},bl=q(()=>{var hn;const Ae=un.getInstance().getItem("ws.terminology"),Ze=Ae?JSON.parse(Ae):null;return`New ${((hn=Ze==null?void 0:Ze.find(Ni=>Ni.code==="scene"))==null?void 0:hn.name)||"Scene"}`});return(Ae,Ze)=>(K(),Ue(H(uee),{"is-sidebar-open":C.value,onCloseSidebar:H(Ge),onSidebarClear:H(Ge),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:H(Ge)},{"header-left":he(()=>{var Kt;return[((Kt=H(i))==null?void 0:Kt.has_create_item_permission)==1?(K(),Ue(H(WS),{key:0,variant:["primary"],options:h.value,onSelect:Fi,onHandleClick:Ze[1]||(Ze[1]=hn=>Fi("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:he(()=>[Ke(ue(H(at),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Ze[0]||(Ze[0]=hn=>Fi("new_scene")),label:bl.value},null,8,["label"]),[[H(l),1]])]),_:1},8,["options"])):Xe("",!0)]}),"header-actions":he(()=>[ue(H(Une),{"onUpdate:assignees":oR,onApplyFilter:qd,loading:H(Me),entityId:f.entityId},null,8,["loading","entityId"]),Ke(ue(H(bS),{focusIndex:"4",modelValue:_.value,"onUpdate:modelValue":Ze[2]||(Ze[2]=Kt=>_.value=Kt),onSearch:H(Ee),class:Q(Ae.$style.itemSearchBox),onClear:Ze[3]||(Ze[3]=Kt=>H(Ee)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:E},null,8,["modelValue","onSearch","class"]),[[H(n),{isLoading:H(Me),fullwidth:!0}]]),Ke((K(),Ue(H(vA),{status:H(le)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":M.value},{default:he(()=>[Ke((K(),Ue(H(at),{variant:["secondary","icon"],disabled:H(le),onClick:nt},{default:he(()=>[ue(H(lt),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[H(l),5],[H(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[H(n),{isLoading:H(Me),fullwidth:!0}]]),Ke(ue(H(Vte),{"model-value":H(P),onChange:Ze[4]||(Ze[4]=Kt=>Mi(Kt)),id:"table_customization",gridApi:v.value,ref_key:"tableCustomizationRef",ref:G,"checkbox-column":H(D),tableHeight:d.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[H(n),{isLoading:H(Me),fullwidth:!0}]])]),grid:he(({availableHeight:Kt})=>[ue(H(hEe),Wt({id:"item_table_main",ref_key:"agGrid",ref:de},tn.value,{height:Kt+"px",isSorting:H(xe),onOnGridReady:Sa,onSelectionChanged:mr}),null,16,["height","isSorting"])]),footer:he(()=>[me("div",{class:Q(Ae.$style.tableFooter),id:"table_footer"},[me("span",null,[Ze[5]||(Ze[5]=Qe(" Showing ",-1)),me("b",null,ut(H(b).loaded)+" of "+ut(H(b).total),1)])],2)]),"new-row":he(()=>[ue(H(wne),{ref_key:"createNewSceneRef",ref:gr,onSearchForCode:ki,onFocusOnId:Ai},null,512)]),"bulk-update-actions":he(()=>[!C.value&&w.value.length>0?Ke((K(),Ue(H(nee),{key:0,selectRowData:wt.value,"workspace-id":f.workspaceId,"entity-id":f.entityId,"grid-api":v.value,onUnselect:H(ze),onSelectAll:H(qe),"take-name":ge.value,"selected-all":W.value,"total-rows":H(b).total,"visible-rows":H(b).loaded,onUpdated:At,loading:H(le)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"])),[[Ks,!C.value&&w.value.length>0]]):Xe("",!0)]),snackbar:he(()=>[ue(H(Kee))]),popup:he(()=>[ue(zre,{ref_key:"popupCreateSceneRef",ref:Le,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:nt},null,8,["workspace-id","entity-id"]),ue(zEe,{ref_key:"popupToolboxUploaderRef",ref:je,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:nt},null,8,["workspace-id","entity-id"]),ue(TEe,{ref_key:"popupOverwriteScenesRef",ref:_t,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:nt},null,8,["workspace-id","entity-id"])]),_:1},8,["is-sidebar-open","onCloseSidebar","onSidebarClear","onSidebarApply"]))}}),[["__cssModules",{$style:{tableTitle:"_tableTitle_1sow5_1",tableFooter:"_tableFooter_1sow5_7",footerStart:"_footerStart_1sow5_17",newRow:"_newRow_1sow5_25","warning-text":"_warning-text_1sow5_43","has-error":"_has-error_1sow5_48",itemSearchBox:"_itemSearchBox_1sow5_52","beta-tag":"_beta-tag_1sow5_56"}}]]),V$="0.1.167",KEe={key:0},qEe=Ct(st({__name:"app",setup(e){const t=q(()=>n.id.length===0||n.workspaceId.length===0),n=hs({id:"",workspaceId:"",apiConfig:{}}),o=oa(),{showMessage:s,showErrorNetMessage:r}=o,i=["basicInfor","importItems"],a=h=>{h.success?s(h.apiCode,"success"):i.includes(h.apiCode)||r(h)},l=B(null),c=()=>{const h=un.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};gh(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",V$);try{if(l.value=oo(),!l.value)throw new Error("Current instance is null");n.id=((h=l.value)==null?void 0:h.appContext.config.globalProperties.id)||"",n.workspaceId=((f=l.value)==null?void 0:f.appContext.config.globalProperties.workspaceId)||un.getInstance().getItem("ws.code");const g={domainApi:c(),wsCode:un.getInstance().getItem("ws.code"),entityId:n.id};if(n.apiConfig=(p=l.value)==null?void 0:p.appContext.config.globalProperties.apiConfig,!g.entityId||!g.wsCode||!g.domainApi)throw new Error("API configuration is missing in dashboardConfig");const v=new FO(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),qn(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const u=q(()=>n.id),d=q(()=>n.workspaceId);return Jr("workspaceId",d),Jr("entityId",u),(h,f)=>(K(),ie("div",{class:Q(h.$style.dashboardPluginWrapper)},[t.value?(K(),ie("span",KEe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):u.value?(K(),Ue(H(jEe),{key:1,entityId:u.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Xe("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),tR=async(e={},t={})=>{const n=n1(qEe),o=dZ();n.use(o);const s=["apiConfig","workspaceId","id"],r={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,r[a]=l,s.includes(a)&&typeof l=="string"?sessionStorage.setItem(a,l):console.error(`[Config Error] Key "${a}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=r,Object.values(t).forEach(a=>{a&&typeof a.install=="function"&&n.use(a)}),n.config.errorHandler=(a,l,c)=>{console.error("[Vue Error]",a),c&&console.error("[Info]",c)},console.log(`%cArbo Dashboard Plugin v${V$}`,"color: #4CAF50; font-weight: bold;"),console.log(n.config.globalProperties),globalThis.window.$switchInstance=n.config.globalProperties.switchInstance,n.provide("switchInstance",n.config.globalProperties.switchInstance),n.directive("tooltip",Yt),n.directive("focusable",ko);const i=await Are();return n.use(i),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=tR),Mn.default=tR,Mn.initDashboard=tR,Object.defineProperties(Mn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|