@epam/ai-dial-ui-kit 0.6.0-rc.6 → 0.6.0-rc.7
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/dist/dial-ui-kit.cjs.js
CHANGED
|
@@ -58,5 +58,5 @@ See ${xp(e,t)}`;return Array.isArray(o)?o.concat(n):[o,n]}var TP={1:"Charting Ag
|
|
|
58
58
|
`)}checkProperties(e,t,s,o,i){const n=["__ob__","__v_skip","__metadata__"],r=XP(Object.getOwnPropertyNames(e),[...n,...t,...s],s),a=Object.keys(r);for(const l of a){const c=r[l];let d=`invalid ${o} property '${l}' did you mean any of these: ${c.slice(0,8).join(", ")}.`;s.includes("context")&&(d+=`
|
|
59
59
|
If you are trying to annotate ${o} with application data, use the '${o}.context' property instead.`),Zi(d)}if(a.length>0&&i){const l=this.beans.frameworkOverrides.getDocLink(i);Zi(`to see all the valid ${o} properties please check: ${l}`)}}};function XP(e,t,s){const o={},i=e.filter(n=>!t.some(r=>r===n));if(i.length>0)for(const n of i)o[n]=Dc({inputValue:n,allSuggestions:s}).values;return o}var QP=new Set(["firstChildChanged","lastChildChanged","childIndexChanged"]),JP={moduleName:"Validation",version:K,beans:[ZP]};function Rm(e){const t=e.sibling;t&&(t.childrenAfterFilter=e.childrenAfterFilter)}var e5=class extends A{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){const t=!!this.filterManager?.isChildFilterPresent();this.filterNodes(t,e)}filterNodes(e,t){const s=(o,i)=>{o.hasChildren()&&e&&!i?o.childrenAfterFilter=o.childrenAfterGroup.filter(n=>{const r=n.childrenAfterFilter&&n.childrenAfterFilter.length>0,a=n.data&&this.filterManager.doesRowPassFilter({rowNode:n});return r||a}):o.childrenAfterFilter=o.childrenAfterGroup,Rm(o)};if(this.doingTreeDataFiltering()){const o=(n,r)=>{if(n.childrenAfterGroup)for(let a=0;a<n.childrenAfterGroup.length;a++){const l=n.childrenAfterGroup[a],c=r||this.filterManager.doesRowPassFilter({rowNode:l});l.childrenAfterGroup?o(n.childrenAfterGroup[a],c):s(l,c)}s(n,r)},i=n=>o(n,!1);t.executeFromRootNode(i)}else{const o=i=>s(i,!1);t.forEachChangedNodeDepthFirst(o,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}},t5=class extends Hd{constructor(){super(...arguments),this.iconCreated=!1}wireComp(e,t,s,o,i){this.comp=e;const n=Rn(this,this.beans.context,i);this.eButtonShowMainFilter=s,this.eFloatingFilterBody=o,this.setGui(t,n),this.setupActive(),this.refreshHeaderStyles(),this.setupWidth(n),this.setupLeft(n),this.setupHover(n),this.setupFocus(n),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(n),this.setupUi(),n.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(n);const r=()=>this.onColDefChanged(n);n.addManagedListeners(this.column,{colDefChanged:r}),n.addManagedEventListeners({filterSwitched:({column:a})=>{a===this.column&&r()}}),n.addDestroyFunc(()=>{this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.clearComponent()})}resizeHeader(){}moveHeader(){}getHeaderClassParams(){const{column:e,beans:t}=this,s=e.colDef;return he(t.gos,{colDef:s,column:e,floatingFilter:!0})}setupActive(){const e=this.column.getColDef(),t=!!e.filter,s=!!e.floatingFilter;this.active=t&&s}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=Ht("filter",this.beans,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(e){e.createManagedBean(new pi(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();si(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){const{beans:t}=this;if(ze(t)===this.eGui)return;const i=xo(t,this.eGui,null,e.shiftKey);if(i){t.headerNavigation?.scrollToColumn(this.column),e.preventDefault(),i.focus();return}const n=this.findNextColumnWithFloatingFilter(e.shiftKey);n&&t.focusSvc.focusHeaderPosition({headerPosition:{headerRowIndex:this.rowCtrl.rowIndex,column:n},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.visibleCols;let s=this.column;do if(s=e?t.getColBefore(s):t.getColAfter(s),!s)break;while(!s.getColDef().filter||!s.getColDef().floatingFilter);return s}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case T.UP:case T.DOWN:case T.LEFT:case T.RIGHT:if(t)return;fo(e);case T.ENTER:t&&po(this.eGui)&&e.preventDefault();break;case T.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const s=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),o=!!e.relatedTarget&&eo(e.relatedTarget,"ag-floating-filter");if(s&&o&&e.target===this.eGui){const i=this.lastFocusEvent,n=!!(i&&i.key===T.TAB);if(i&&n){const r=i.shiftKey;po(this.eGui,r)}}this.focusThis()}setupHover(e){this.beans.colHover?.addHeaderFilterColumnHoverListener(e,this.comp,this.column,this.eGui)}setupLeft(e){const t=new Nd(this.column,this.eGui,this.beans);e.createManagedBean(t)}setupFilterButton(){this.suppressFilterButton=!this.beans.menuSvc?.isFloatingFilterButtonEnabled(this.column),this.highlightFilterButtonWhenActive=!Et(this.gos)}setupUserComp(){if(!this.active)return;const e=this.beans.colFilter?.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;this.beans.menuSvc?.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(e){if(!this.active)return;const{beans:{colFilter:t},column:s,gos:o}=this,i=n=>{if(n?.source==="filterDestroyed"&&(!this.isAlive()||!t?.isAlive()))return;const r=this.comp.getFloatingFilterComp();r&&r.then(a=>{if(a){if(o.get("enableFilterHandlers")){const d=n;let u="filter";d?.afterFloatingFilter?u="ui":d?.afterDataChange?u="dataChanged":n?.source==="api"&&(u="api"),this.updateFloatingFilterParams(this.userCompDetails,u);return}const l=t?.getCurrentFloatingFilterParentModel(s),c=n?{...n,columns:n.columns??[],source:n.source==="api"?"api":"columnFilter"}:null;a.onParentModelChanged(l,c)}})};[this.destroySyncListener]=e.addManagedListeners(s,{filterChanged:i}),t?.isFilterActive(s)&&i(null)}setupWidth(e){const t=()=>{const s=`${this.column.getActualWidth()}px`;this.comp.setWidth(s)};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(){if(!this.suppressFilterButton&&this.comp){const e=!!this.beans.filterManager?.isFilterAllowed(this.column);this.comp.setButtonWrapperDisplayed(e),this.highlightFilterButtonWhenActive&&e&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(e){const t=this.active;this.setupActive();const s=!t&&this.active;t&&!this.active&&(this.destroySyncListener(),this.destroyFilterChangedListener());const o=this.beans.colFilter,i=this.active?o?.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,n=this.comp.getFloatingFilterComp();!n||!i?this.updateCompDetails(e,i,s):n.then(r=>{!r||o?.areFilterCompsDifferent(this.userCompDetails??null,i)?this.updateCompDetails(e,i,s):this.updateFloatingFilterParams(i,"colDef")})}updateCompDetails(e,t,s){this.isAlive()&&(this.setCompDetails(t),this.setupFilterButton(),this.setupUi(),s&&(this.setupSyncWithFilter(e),this.setupFilterChangedListener(e)))}updateFloatingFilterParams(e,t){if(!e)return;let s=e.params;this.comp.getFloatingFilterComp()?.then(o=>{typeof o?.refresh=="function"&&(this.gos.get("enableFilterHandlers")&&(s={...s,model:Qe(this.beans.colFilter?.model??{},this.column.getColId()),source:t}),o.refresh(s))})}addResizeAndMoveKeyboardListeners(){}destroy(){super.destroy(),this.destroySyncListener=null,this.destroyFilterChangedListener=null}};function s5(e,t){const s=e.colModel.getCol(t);if(!s){Te(12,{colKey:t});return}e.menuSvc?.showColumnMenu({column:s,positionBy:"auto"})}function o5(e){e.menuSvc?.hidePopupMenu()}var i5={moduleName:"SharedMenu",version:K,beans:[RR],apiFunctions:{showColumnMenu:s5,hidePopupMenu:o5}},n5=class extends Jy{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:s,event:o}=e,i=t.getBoundingClientRect(),n=this.getParentRect();this.setAlignedTo(t,s);let r=!1;const a=()=>{const l=this.keepXYWithinBounds(s,i.top-n.top,0),c=s.clientWidth>0?s.clientWidth:200;r||(s.style.minWidth=`${c}px`,r=!0);const u=n.right-n.left-c;let h;return this.gos.get("enableRtl")?(h=f(),h<0&&(h=p(),this.setAlignedStyles(s,"left")),h>u&&(h=0,this.setAlignedStyles(s,"right"))):(h=p(),h>u&&(h=f(),this.setAlignedStyles(s,"right")),h<0&&(h=0,this.setAlignedStyles(s,"left"))),{x:h,y:l};function p(){return i.right-n.left-2}function f(){return i.left-n.left-c}};this.positionPopup({ePopup:s,keepWithinBounds:!0,updatePosition:a,postProcessCallback:()=>this.callPostProcessPopup(e,"subMenu",s,t,o instanceof MouseEvent?o:void 0)})}callPostProcessPopup(e,t,s,o,i){const n=this.gos.getCallback("postProcessPopup");if(n){const{column:r,rowNode:a}=e;n({column:r,rowNode:a,ePopup:s,type:t,eventSource:o,mouseEvent:i})}}getActivePopups(){return this.popupList.map(e=>e.element)}handleThemeChange(e){if(e.themeChanged){const t=this.beans.environment;for(const s of this.popupList)t.applyThemeClasses(s.wrapper)}}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isStopPropagation(e){return ms(e)}},Ma={moduleName:"Popup",version:K,beans:[n5]},r5=".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 a5(e){const t=e.filterManager;return!!t?.isColumnFilterPresent()||!!t?.isAggregateFilterPresent()}function l5(e,t){return e.filterManager?.getColumnFilterInstance(t)??Promise.resolve(void 0)}function c5(e,t){const s=e.colModel.getColDefCol(t);if(s)return e.colFilter?.destroyFilter(s,"api")}function d5(e,t){e.frameworkOverrides.wrapIncoming(()=>e.filterManager?.setFilterModel(t))}function u5(e){return e.filterManager?.getFilterModel()??{}}function h5(e,t,s){const{gos:o,colModel:i,colFilter:n}=e;s&&!o.get("enableFilterHandlers")&&(G(288),s=!1);const r=i.getColDefCol(t);return r?n?.getModelForColumn(r,s)??null:null}function g5(e,t,s){return e.filterManager?.setColumnFilterModel(t,s)??Promise.resolve()}function p5(e,t){const s=e.colModel.getCol(t);if(!s){Te(12,{colKey:t});return}e.menuSvc?.showFilterMenu({column:s,containerType:"columnFilter",positionBy:"auto"})}function f5(e){e.menuSvc?.hideFilterMenu()}function m5(e,t){const s=e.colModel.getCol(t);if(!s){Te(12,{colKey:t});return}return e.colFilter?.getHandler(s,!0)}function C5(e,t){const{colModel:s,colFilter:o,gos:i}=e;if(!i.get("enableFilterHandlers")){G(287);return}const{colId:n,action:r}=t;if(n){const a=s.getColById(n);a&&o?.updateModel(a,r)}else o?.updateAllModels(r)}var v5={filterHandler:()=>({doesFilterPass:()=>!0})},w5=class extends A{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={...vf},this.isGlobalButtons=!1,this.activeFilterComps=new Set}postConstruct(){this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)});const e=this.gos,t={...e.get("initialState")?.filter?.filterModel??{}};this.initialModel=t,this.model={...t},e.get("enableFilterHandlers")||delete this.handlerMap.agMultiColumnFilter}refreshModel(){this.onNewRowsLoaded("rowDataUpdated")}setModel(e,t="api",s){const{colModel:o,dataTypeSvc:i,filterManager:n}=this.beans;if(i?.isPendingInference){this.modelUpdates.push({model:e,source:t});return}const r=[],a=this.getModel(!0);if(e){const l=new Set(Object.keys(e));this.allColumnFilters.forEach((c,d)=>{const u=e[d];r.push(this.setModelOnFilterWrapper(c,u)),l.delete(d)}),l.forEach(c=>{const d=o.getColDefCol(c)||o.getCol(c);if(!d){G(62,{colId:c});return}if(!d.isFilterAllowed()){G(63,{colId:c});return}const u=this.getOrCreateFilterWrapper(d,!0);if(!u){G(64,{colId:c});return}r.push(this.setModelOnFilterWrapper(u,e[c],!0))})}else this.model={},this.allColumnFilters.forEach(l=>{r.push(this.setModelOnFilterWrapper(l,null))});Ee.all(r).then(()=>{const l=this.getModel(!0),c=[];this.allColumnFilters.forEach((d,u)=>{const h=a?a[u]:null,p=l?l[u]:null;an(h,p)||c.push(d.column)}),c.length>0?n?.onFilterChanged({columns:c,source:t}):s&&this.updateActive("filterChanged")})}getModel(e){const t={},{allColumnFilters:s,initialModel:o,beans:{colModel:i}}=this;if(s.forEach((n,r)=>{const a=this.getModelFromFilterWrapper(n);Y(a)&&(t[r]=a)}),!e)for(const n of Object.keys(o)){const r=o[n];Y(r)&&!s.has(n)&&i.getCol(n)?.isFilterAllowed()&&(t[n]=r)}return t}setState(e,t,s="api"){if(this.state.clear(),t)for(const o of Object.keys(t)){const i=t[o];this.state.set(o,{model:Qe(this.model,o),state:i})}this.setModel(e,s,!0)}getState(){const e=this.state;if(!e.size)return;const t={};let s=!1;return e.forEach((o,i)=>{const n=o.state;n!=null&&(s=!0,t[i]=n)}),s?t:void 0}getModelFromFilterWrapper(e){const s=e.column.getColId();if(e.isHandler)return Qe(this.model,s);const o=e.filter;return o?typeof o.getModel!="function"?(G(66),null):o.getModel():Qe(this.initialModel,s)}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():(G(67),!1):!1,{colModel:t,gos:s}=this.beans,o=!!bc(s),i=c=>{if(!c.isPrimary())return!0;const u=!t.isPivotActive();return!c.isValueActive()||!u?!1:t.isPivotMode()?!0:o},n=[],r=[],a=(c,d,u)=>{d&&(i(c)?n.push(u):r.push(u))},l=[];return this.allColumnFilters.forEach(c=>{const d=c.column,u=d.getColId();if(c.isHandler)l.push(Ee.resolve().then(()=>{a(d,this.isHandlerActive(d),{colId:u,isHandler:!0,handler:c.handler,handlerParams:c.handlerParams})}));else{const h=Ds(c);h&&l.push(h.then(p=>{a(d,e(p),{colId:u,isHandler:!1,comp:p})}))}}),Ee.all(l).then(()=>{this.activeAggregateFilters=n,this.activeColumnFilters=r})}updateFilterFlagInColumns(e,t){const s=[];return this.allColumnFilters.forEach(o=>{const i=o.column;if(o.isHandler)s.push(Ee.resolve().then(()=>{this.setColFilterActive(i,this.isHandlerActive(i),e,t)}));else{const n=Ds(o);n&&s.push(n.then(r=>{this.setColFilterActive(i,r.isFilterActive(),e,t)}))}}),this.beans.groupFilter?.updateFilterFlags(e,t),Ee.all(s)}doFiltersPass(e,t,s){const{data:o,aggData:i}=e,n=s?this.activeAggregateFilters:this.activeColumnFilters,r=s?i:o,a=this.model;for(let l=0;l<n.length;l++){const c=n[l],{colId:d,isHandler:u}=c;if(d!==t)if(u){const{handler:h,handlerParams:p}=c;if(!h.doesFilterPass({node:e,data:r,model:Qe(a,d),handlerParams:p}))return!1}else{const h=c.comp;if(typeof h.doesFilterPass!="function"){Te(91);continue}if(!h.doesFilterPass({node:e,data:r}))return!1}}return!0}getHandlerParams(e){const t=this.allColumnFilters.get(e.getColId());return t?.isHandler?t.handlerParams:void 0}callOnFilterChangedOutsideRenderCycle(e){const{rowRenderer:t,filterManager:s}=this.beans,o=()=>{this.isAlive()&&s?.onFilterChanged(e)};t.isRefreshInProgress()?setTimeout(o,0):o()}updateBeforeFilterChanged(e={}){const{column:t,additionalEventAttributes:s}=e,o=t?.getColId();return this.updateActiveFilters().then(()=>this.updateFilterFlagInColumns("filterChanged",s).then(()=>{this.allColumnFilters.forEach(i=>{const{column:n,isHandler:r}=i;o!==n.getColId()&&(r&&i.handler.onAnyFilterChanged?.(),Ds(i,r)?.then(a=>{typeof a?.onAnyFilterChanged=="function"&&a.onAnyFilterChanged()}))}),this.processingFilterChange=!0}))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!(this.gos.get("allowShowChangeAfterFilter")??!1)&&this.processingFilterChange}onNewRowsLoaded(e){const t=[];this.allColumnFilters.forEach(s=>{const o=s.isHandler;o&&s.handler.onNewRowsLoaded?.();const i=Ds(s,o);i&&t.push(i.then(n=>{n.onNewRowsLoaded?.()}))}),Ee.all(t).then(()=>this.updateActive(e,{afterDataChange:!0}))}updateActive(e,t){this.updateFilterFlagInColumns(e,t).then(()=>this.updateActiveFilters())}createGetValue(e,t){const{filterValueSvc:s,colModel:o}=this.beans;return(i,n)=>{const r=n?o.getCol(n):e;return r?s.getValue(r,i,t):void 0}}isFilterActive(e){const t=this.cachedFilter(e);if(t?.isHandler)return this.isHandlerActive(e);const s=t?.filter;return s?s.isFilterActive():Qe(this.initialModel,e.getColId())!=null}isHandlerActive(e){const t=Y(Qe(this.model,e.getColId()));if(t)return t;const s=this.beans.groupFilter;return s?.isGroupFilter(e)?s.isFilterActive(e):!1}getOrCreateFilterUi(e){const t=this.getOrCreateFilterWrapper(e,!0);return t?Ds(t):null}getFilterUiForDisplay(e){const t=this.getOrCreateFilterWrapper(e,!0);if(!t)return null;const s=Ds(t);return s?s.then(o=>({comp:o,params:t.filterUi.filterParams,isHandler:t.isHandler})):null}getHandler(e,t){const s=this.getOrCreateFilterWrapper(e,t);return s?.isHandler?s.handler:void 0}getOrCreateFilterWrapper(e,t){if(!e.isFilterAllowed())return;let s=this.cachedFilter(e);return!s&&t&&(s=this.createFilterWrapper(e),this.setColumnFilterWrapper(e,s)),s}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e,t=!1){return this.getDefaultFilterFromDataType(()=>this.beans.dataTypeSvc?.getBaseDataType(e),t)}getDefaultFilterFromDataType(e,t=!1){return A0(this.gos)?t?"agSetColumnFloatingFilter":"agSetColumnFilter":xx(e(),t)}getDefaultFloatingFilter(e){return this.getDefaultFilter(e,!0)}createFilterComp(e,t,s,o,i,n){const r=()=>{const c=this.createFilterCompParams(e,i,n),d=o(c,i);return GS(this.beans.userCompFactory,t,d,s)},a=r();return a?{compDetails:a,createFilterUi:c=>(c?r():a).newAgStackInstance()}:null}createFilterInstance(e,t,s,o){const i=this.beans.selectableFilter;i?.isSelectable(t)&&(t=i.getFilterDef(e,t));const{handler:n,handlerParams:r,handlerGenerator:a}=this.createHandler(e,t,s)??{},l=this.createFilterComp(e,t,s,o,!!n,"init");if(!l)return{compDetails:null,createFilterUi:null,handler:n,handlerGenerator:a,handlerParams:r};const{compDetails:c,createFilterUi:d}=l;return this.isGlobalButtons&&(c.params?.buttons?.length||G(281,{colId:e.getColId()})),{compDetails:c,handler:n,handlerGenerator:a,handlerParams:r,createFilterUi:d}}createBaseFilterParams(e,t){const{filterManager:s,rowModel:o}=this.beans;return he(this.gos,{column:e,colDef:e.getColDef(),getValue:this.createGetValue(e),doesRowPassOtherFilter:t?()=>!0:i=>s?.doesRowPassOtherFilters(e.getColId(),i)??!0,rowModel:o})}createFilterCompParams(e,t,s,o){const i=this.filterChangedCallbackFactory(e),n=this.createBaseFilterParams(e,o);if(n.filterChangedCallback=i,n.filterModifiedCallback=o?()=>{}:r=>this.filterModified(e,r),t){const r=n,a=e.getColId(),l=Qe(this.model,a);r.model=l,r.state=this.state.get(a)??{model:l},r.onModelChange=(c,d)=>{this.updateStoredModel(a,c),this.refreshHandlerAndUi(e,c,"ui",!1,d).then(()=>{i({...d,source:"columnFilter"})})},r.onStateChange=c=>{this.updateState(e,c),this.updateOrRefreshFilterUi(e)},r.onAction=(c,d,u)=>{this.updateModel(e,c,d),this.dispatchLocalEvent({type:"filterAction",column:e,action:c,event:u})},r.getHandler=()=>this.getHandler(e,!0),r.onUiChange=c=>this.filterUiChanged(e,c),r.source=s}return n}createFilterUiForHandler(e,t){return t?{created:!1,create:t,filterParams:e.params,compDetails:e}:null}createFilterUiLegacy(e,t,s){const o=t(),i={created:!0,create:t,filterParams:e.params,compDetails:e,promise:o};return o.then(s),i}createFilterWrapper(e){const{compDetails:t,handler:s,handlerGenerator:o,handlerParams:i,createFilterUi:n}=this.createFilterInstance(e,e.getColDef(),this.getDefaultFilter(e),a=>a),r=e.getColId();if(s)return delete this.initialModel[r],s.init?.({...i,source:"init",model:Qe(this.model,r)}),{column:e,isHandler:!0,handler:s,handlerGenerator:o,handlerParams:i,filterUi:this.createFilterUiForHandler(t,n)};if(n){const a={column:e,filterUi:null,isHandler:!1};return a.filterUi=this.createFilterUiLegacy(t,n,l=>{a.filter=l??void 0}),a}return{column:e,filterUi:null,isHandler:!1}}createHandlerFunc(e,t,s){const{gos:o,frameworkOverrides:i,registry:n}=this.beans;let r;const a=p=>{const f=p.filter;if($p(f)){const C=f.handler;return C||(r=f.doesFilterPass,r?()=>({doesFilterPass:r}):void 0)}return typeof f=="string"?f:void 0},l=o.get("enableFilterHandlers"),c=l?a(t):void 0,d=p=>()=>this.createBean(n.createDynamicBean(p,!0));let u,h;if(typeof c=="string"){const p=o.get("filterHandlers")?.[c];p!=null?u=p:ux.has(c)&&(u=d(c),h=c)}else u=c;if(!u){let p;const{compName:f,jsComp:C,fwComp:v}=Yp(i,t);f?p=f:C==null&&v==null&&t.filter===!0&&(p=s),h=this.handlerMap[p],h&&(u=d(h))}return u?{filterHandler:u,handlerNameOrCallback:r??h}:l?(_e(o)&&G(277,{colId:e.getColId()}),v5):void 0}createHandler(e,t,s){const o=this.createHandlerFunc(e,t,s);if(!o)return;const i=yl(this.beans.userCompFactory,t,this.createFilterCompParams(e,!0,"init")),{handlerNameOrCallback:n,filterHandler:r}=o,{handler:a,handlerParams:l}=this.createHandlerFromFunc(e,r,i);return{handler:a,handlerParams:l,handlerGenerator:n??r}}createHandlerFromFunc(e,t,s){const o=e.getColDef(),i=t(he(this.gos,{column:e,colDef:o})),n=this.createHandlerParams(e,s);return{handler:i,handlerParams:n}}createHandlerParams(e,t){const s=e.getColDef(),o=e.getColId(),i=this.filterChangedCallbackFactory(e);return he(this.gos,{colDef:s,column:e,getValue:this.createGetValue(e),doesRowPassOtherFilter:n=>this.beans.filterManager?.doesRowPassOtherFilters(o,n)??!0,onModelChange:(n,r)=>{this.updateStoredModel(o,n),this.refreshHandlerAndUi(e,n,"handler",!1,r).then(()=>{i({...r,source:"columnFilter"})})},filterParams:t})}onColumnsChanged(){const e=[],{colModel:t,filterManager:s,groupFilter:o}=this.beans;this.allColumnFilters.forEach((n,r)=>{let a;n.column.isPrimary()?a=t.getColDefCol(r):a=t.getCol(r),!(a&&a===n.column)&&(e.push(n.column),this.disposeFilterWrapper(n,"columnChanged"),this.disposeColumnListener(r))});const i=o&&e.every(n=>o.isGroupFilter(n));e.length>0&&!i&&s?.onFilterChanged({columns:e,source:"api"})}isFilterAllowed(e){if(!e.isFilterAllowed())return!1;const s=this.beans.groupFilter;return s?.isGroupFilter(e)?s.isFilterAllowed(e):!0}getFloatingFilterCompDetails(e,t){const{userCompFactory:s,frameworkOverrides:o,selectableFilter:i}=this.beans,n=h=>{const p=this.getOrCreateFilterUi(e);p?.then(f=>{h(pn(f))})},r=e.getColDef(),a=i?.isSelectable(r)?i.getFilterDef(e,r):r,l=Px(o,a,()=>this.getDefaultFloatingFilter(e))??"agReadOnlyFloatingFilter",c=this.gos.get("enableFilterHandlers"),d=yl(s,a,this.createFilterCompParams(e,c,"init",!0)),u=he(this.gos,{column:e,filterParams:d,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:n,showParentFilter:t});if(c){const h=u,p=e.getColId(),f=this.filterChangedCallbackFactory(e);h.onUiChange=C=>this.floatingFilterUiChanged(e,C),h.model=Qe(this.model,p),h.onModelChange=(C,v)=>{this.updateStoredModel(p,C),this.refreshHandlerAndUi(e,C,"floating",!0,v).then(()=>{f({...v,source:"columnFilter"})})},h.getHandler=()=>this.getHandler(e,!0),h.source="init"}return _S(s,r,u,l)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilterUi(e,t,s,o){const i="paramsUpdated";if(e.isHandler){const n=t.getColId();delete this.initialModel[n],this.state.delete(n);const r=e.filterUi,a=this.createFilterUiForHandler(s,o);e.filterUi=a;const l=this.eventSvc;r?.created?r.promise.then(c=>{this.destroyBean(c),l.dispatchEvent({type:"filterDestroyed",source:i,column:t})}):l.dispatchEvent({type:"filterHandlerDestroyed",source:i,column:t})}else this.destroyFilter(t,i)}destroyFilter(e,t="api"){const s=e.getColId(),o=this.allColumnFilters.get(s);this.disposeColumnListener(s),delete this.initialModel[s],o&&this.disposeFilterWrapper(o,t).then(i=>{i&&this.isAlive()&&this.beans.filterManager?.onFilterChanged({columns:[e],source:"api"})})}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){let s=!1;const{column:o,isHandler:i,filterUi:n}=e,r=o.getColId();i&&(s=this.isHandlerActive(o),this.destroyBean(e.handler),delete this.model[r],this.state.delete(r));const a=()=>{this.setColFilterActive(o,!1,"filterDestroyed"),this.allColumnFilters.delete(r),this.eventSvc.dispatchEvent({type:"filterDestroyed",source:t,column:o})};if(n){if(n.created)return n.promise.then(l=>(s=i?s:!!l?.isFilterActive(),this.destroyBean(l),a(),s));a()}return Ee.resolve(s)}filterChangedCallbackFactory(e){return t=>{this.callOnFilterChangedOutsideRenderCycle({additionalEventAttributes:t,columns:[e],column:e,source:t?.source??"columnFilter"})}}filterParamsChanged(e,t="api"){const s=this.allColumnFilters.get(e);if(!s)return;const o=this.beans,i=s.column,n=i.getColDef(),r=i.isFilterAllowed(),a=this.getDefaultFilter(i),l=o.selectableFilter,c=l?.isSelectable(n)?l.getFilterDef(i,n):n,d=r?this.createHandlerFunc(i,c,this.getDefaultFilter(i)):void 0,u=!!d,h=s.isHandler;if(h!=u){this.destroyFilter(i,"paramsUpdated");return}const{compDetails:p,createFilterUi:f}=(r?this.createFilterComp(i,c,a,v=>v,u,"colDef"):null)??{compDetails:null,createFilterUi:null},C=p?.params??yl(o.userCompFactory,c,this.createFilterCompParams(i,u,"colDef"));if(h){const v=d?.handlerNameOrCallback??d?.filterHandler,w=Qe(this.model,e);if(s.handlerGenerator!=v){const b=s.handler,{handler:S,handlerParams:y}=this.createHandlerFromFunc(i,d.filterHandler,C);s.handler=S,s.handlerParams=y,s.handlerGenerator=v,delete this.model[e],S.init?.({...y,source:"init",model:null}),this.destroyBean(b),w!=null&&this.beans.filterManager?.onFilterChanged({columns:[i],source:t})}else{const b=this.createHandlerParams(i,p?.params);s.handlerParams=b,s.handler.refresh?.({...b,source:"colDef",model:w})}}if(this.areFilterCompsDifferent(s.filterUi?.compDetails??null,p)||!s.filterUi||!p){this.destroyFilterUi(s,i,p,f);return}s.filterUi.filterParams=C,Ds(s,h)?.then(v=>{(v?.refresh?v.refresh(C):!0)===!1?this.destroyFilterUi(s,i,p,f):this.dispatchLocalEvent({type:"filterParamsChanged",column:i,params:C})})}refreshHandlerAndUi(e,t,s,o,i){const n=this.cachedFilter(e);if(!n)return o&&this.getOrCreateFilterWrapper(e,!0),Ee.resolve();if(!n.isHandler)return Ee.resolve();const{filterUi:r,handler:a,handlerParams:l}=n;return hx(()=>{if(r){const{created:c,filterParams:d}=r;if(c)return r.promise.then(u=>u?{filter:u,filterParams:d}:void 0);r.refreshed=!0}return Ee.resolve(void 0)},a,l,t,this.state.get(e.getColId())??{model:t},s,i)}setColumnFilterWrapper(e,t){const s=e.getColId();this.allColumnFilters.set(s,t),this.allColumnListeners.set(s,this.addManagedListeners(e,{colDefChanged:()=>this.filterParamsChanged(s)})[0])}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:s}=e,{componentClass:o}=t;return!(s===o||s?.render&&o?.render&&s.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 s=this.getOrCreateFilterUi(t);return s?new Promise(o=>{s.then(i=>{o(pn(i))})}):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:s})=>{this.setModelForColumn(e,t).then(()=>s())}),this.columnModelUpdates=[]}getModelForColumn(e,t){if(t){const{state:o,model:i}=this,n=e.getColId(),r=o.get(n);return r?r.model??null:Qe(i,n)}const s=this.cachedFilter(e);return s?this.getModelFromFilterWrapper(s):null}setModelForColumn(e,t){if(this.beans.dataTypeSvc?.isPendingInference){let s=()=>{};const o=new Promise(i=>{s=i});return this.columnModelUpdates.push({key:e,model:t,resolve:s}),o}return new Promise(s=>{this.setModelForColumnLegacy(e,t).then(o=>s(o))})}getStateForColumn(e){return this.state.get(e)??{model:Qe(this.model,e)}}setModelForColumnLegacy(e,t){const s=this.beans.colModel.getColDefCol(e),o=s?this.getOrCreateFilterWrapper(s,!0):null;return o?this.setModelOnFilterWrapper(o,t):Ee.resolve()}setColDefPropsForDataType(e,t,s){const o=e.filter,i=o===!0?this.getDefaultFilterFromDataType(()=>t.baseDataType):o;if(typeof i!="string")return;let n,r;const a=this.beans,{filterParams:l,filterValueGetter:c}=e;i==="agMultiColumnFilter"?{filterParams:n,filterValueGetter:r}=a.multiFilter?.getParamsForDataType(l,c,t,s)??{}:{filterParams:n,filterValueGetter:r}=bx(i,l,c,t,s,a,this.getLocaleTextFunc()),e.filterParams=n,r&&(e.filterValueGetter=r)}setColFilterActive(e,t,s,o){e.filterActive!==t&&(e.filterActive=t,e.dispatchColEvent("filterActiveChanged",s)),e.dispatchColEvent("filterChanged",s,o)}setModelOnFilterWrapper(e,t,s){return new Ee(o=>{if(e.isHandler){const n=e.column,r=n.getColId(),a=this.model[r];if(this.updateStoredModel(r,t),s&&t===a){o();return}this.refreshHandlerAndUi(n,t,"api").then(()=>o());return}const i=Ds(e);if(i){i.then(n=>{if(typeof n?.setModel!="function"){G(65),o();return}(n.setModel(t)||Ee.resolve()).then(()=>o())});return}o()})}updateStoredModel(e,t){Y(t)?this.model[e]=t:delete this.model[e];const s=this.state.get(e),o={model:t,state:s?.state};this.state.set(e,o)}filterModified(e,t){this.getOrCreateFilterUi(e)?.then(s=>{this.eventSvc.dispatchEvent({type:"filterModified",column:e,filterInstance:s,...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,s){const o=e.getColId(),i=this.cachedFilter(e),n=()=>i?.filterUi;Qu(t,n,()=>Qe(this.model,o),()=>this.state.get(o),r=>this.updateState(e,r),r=>n()?.filterParams?.onModelChange(r,s),i?.isHandler?i.handler.processModelToApply?.bind(i.handler):void 0)}updateAllModels(e,t){const s=[];this.allColumnFilters.forEach((o,i)=>{const n=this.beans.colModel.getColDefCol(i);n&&Qu(e,()=>o.filterUi,()=>Qe(this.model,i),()=>this.state.get(i),r=>this.updateState(n,r),r=>{this.updateStoredModel(i,r),this.dispatchLocalEvent({type:"filterAction",column:n,action:e}),s.push(this.refreshHandlerAndUi(n,r,"ui"))},o?.isHandler?o.handler.processModelToApply?.bind(o.handler):void 0)}),s.length&&Ee.all(s).then(()=>{this.callOnFilterChangedOutsideRenderCycle({source:"columnFilter",additionalEventAttributes:t,columns:[]})})}updateOrRefreshFilterUi(e){const t=e.getColId();bf(()=>this.cachedFilter(e)?.filterUi,()=>Qe(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:s}=this;for(const i of s)if(i.source==="COLUMN_MENU")return!1;let o=!1;for(const i of e.keys()){const n=e.get(i);if(n.valid===!1)return!1;(n.model??null)!==Qe(t,i)&&(o=!0)}return o}hasUnappliedModel(e){const{model:t,state:s}=this;return(s.get(e)?.model??null)!==Qe(t,e)}setGlobalButtons(e){this.isGlobalButtons=e,this.dispatchLocalEvent({type:"filterGlobalButtons",isGlobal:e})}shouldKeepStateOnDetach(e,t){if(t==="newFiltersToolPanel")return!0;const s=this.beans.filterPanelSvc;return s?.isActive?!!s.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 b5(e){return!!e.filterManager?.isAnyFilterPresent()}function S5(e,t="api"){e.filterManager?.onFilterChanged({source:t})}var y5=class extends A{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:s}=this;this.alwaysPassFilter=s.get("alwaysPassFilter"),this.addManagedPropertyListener("alwaysPassFilter",()=>{this.alwaysPassFilter=s.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,s="api"){this.isAdvFilterEnabled()||this.colFilter?.setState(e,t,s)}setFilterModel(e,t="api",s){if(this.isAdvFilterEnabled()){s||this.warnAdvFilters();return}this.colFilter?.setModel(e,t)}getFilterModel(){return this.colFilter?.getModel()??{}}getFilterState(){return this.colFilter?.getState()}isColumnFilterPresent(){return!!this.colFilter?.isFilterPresent()}isAggregateFilterPresent(){return!!this.colFilter?.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){e?this.colFilter?.disableFilters()&&this.onFilterChanged({source:"advancedFilter"}):this.advancedFilter?.isFilterPresent()&&(this.advancedFilter.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvFilterEnabled(){return!!this.advancedFilter?.isEnabled()}isAdvFilterHeaderActive(){return this.isAdvFilterEnabled()&&this.advancedFilter.isHeaderActive()}refreshFiltersForAggregations(){bc(this.gos)&&this.isAnyFilterPresent()&&this.onFilterChanged()}onFilterChanged(e={}){const{source:t,additionalEventAttributes:s,columns:o=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.colFilter?this.colFilter.updateBeforeFilterChanged(e):Ee.resolve()).then(()=>{const i={source:t,type:"filterChanged",columns:o};s&>(i,s),this.eventSvc.dispatchEvent(i),this.colFilter?.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){return!!this.colFilter?.isSuppressFlashingCellsBecauseFiltering()}isQuickFilterPresent(){return!!this.quickFilter?.isFilterPresent()}updateAggFiltering(){this.aggFiltering=!!bc(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){const{rowNode:t}=e;return this.alwaysPassFilter?.(t)?!0:!(this.isAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.isAggregateFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip,!0))}doesRowPassFilter(e){const{rowNode:t}=e;return this.alwaysPassFilter?.(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){return this.isAdvFilterEnabled()?!1:!!this.colFilter?.isFilterAllowed(e)}getAdvFilterModel(){return this.isAdvFilterEnabled()?this.advancedFilter.getModel():null}setAdvFilterModel(e,t="api"){if(this.isAdvFilterEnabled()){if(this.beans.dataTypeSvc?.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(){return this.isAdvFilterEnabled()?!1:!!this.colFilter?.hasFloatingFilters()}getColumnFilterInstance(e){return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve(void 0)):this.colFilter?.getFilterInstance(e)??Promise.resolve(void 0)}warnAdvFilters(){G(68)}setupAdvFilterHeaderComp(e){this.advancedFilter?.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){return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve()):this.colFilter?.setModelForColumn(e,t)??Promise.resolve()}},x5=class extends A{constructor(){super(...arguments),this.beanName="filterMenuFactory"}wireBeans(e){this.popupSvc=e.popupSvc}hideActiveMenu(){this.hidePopup?.()}showMenuAfterMouseEvent(e,t,s,o){e&&!e.isColumn||this.showPopup(e,i=>{this.popupSvc?.positionPopupUnderMouseEvent({column:e,type:s,mouseEvent:t,ePopup:i})},s,t.target,Et(this.gos),o)}showMenuAfterButtonClick(e,t,s,o){if(e&&!e.isColumn)return;let i=-1,n="left";const r=Et(this.gos);!r&&this.gos.get("enableRtl")&&(i=1,n="right");const a=r?void 0:4*i,l=r?void 0:4;this.showPopup(e,c=>{this.popupSvc?.positionPopupByComponent({type:s,eventSource:t,ePopup:c,nudgeX:a,nudgeY:l,alignSide:n,keepWithinBounds:!0,position:"under",column:e})},s,t,r,o)}showPopup(e,t,s,o,i,n){const r=e?this.createBean(new vx(e,"COLUMN_MENU")):void 0;if(this.activeMenu=r,!r?.hasFilter()||!e){Te(57);return}const a=ft({tag:"div",cls:`ag-menu${i?"":" ag-filter-menu"}`,role:"presentation"});[this.tabListener]=this.addManagedElementListeners(a,{keydown:C=>this.trapFocusWithin(C,a)}),a.appendChild(r?.getGui());let l;const c=()=>r?.afterGuiDetached(),d=L0(this.gos)?o??this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody:void 0,u=C=>{rh(e,!1,"contextMenu");const v=C instanceof KeyboardEvent;this.tabListener&&(this.tabListener=this.tabListener()),v&&o&&ws(o)&&tf(o)?.focus({preventScroll:!0}),c(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,s,e),n?.()},h=this.getLocaleTextFunc(),p=i&&s!=="columnFilter"?h("ariaLabelColumnMenu","Column Menu"):h("ariaLabelColumnFilter","Column Filter"),f=this.popupSvc?.addPopup({modal:!0,eChild:a,closeOnEsc:!0,closedCallback:u,positionCallback:()=>t(a),anchorToElement:d,ariaLabel:p});f&&(this.hidePopup=l=f.hideFunc),r.afterInit().then(()=>{t(a),r.afterGuiAttached({container:s,hidePopup:l})}),rh(e,!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,s,e)}trapFocusWithin(e,t){e.key!==T.TAB||e.defaultPrevented||xo(this.beans,t,!1,e.shiftKey)||(e.preventDefault(),po(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,s){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:t,column:s??null,columnGroup:null})}isMenuEnabled(e){return e.isFilterAllowed()&&(e.getColDef().menuTabs??["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}},R5=class extends A{constructor(){super(...arguments),this.beanName="filterValueSvc"}getValue(e,t,s){if(!t)return;const o=e.getColDef(),{selectableFilter:i,valueSvc:n}=this.beans,r=s??i?.getFilterValueGetter(e.getColId())??o.filterValueGetter;return r?this.executeFilterValueGetter(r,t.data,e,t,o):n.getValue(e,t)}executeFilterValueGetter(e,t,s,o,i){const{expressionSvc:n,valueSvc:r}=this.beans,a=he(this.gos,{data:t,node:o,column:s,colDef:i,getValue:r.getValueCallback.bind(r,o)});return typeof e=="function"?e(a):n?.evaluate(e,a)}},F5={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eFloatingFilterText"}]},E5=class extends We{constructor(){super(F5,[xa]),this.eFloatingFilterText=ne}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 s=e,o=s.getHandler();if(o.getModelAsString){const i=o.getModelAsString(s.model);this.eFloatingFilterText.setValue(i)}}}onParentModelChanged(e){if(e==null){this.eFloatingFilterText.setValue("");return}this.params.parentFilterInstance(t=>{if(t.getModelAsString){const s=t.getModelAsString(e);this.eFloatingFilterText.setValue(s)}})}refresh(e){this.init(e)}},jd=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions??t,this.mapCustomOptions(),this.defaultOption=this.getDefaultItem(e.defaultOption)}refresh(e,t){const s=e.filterOptions??t;this.filterOptions!==s&&(this.filterOptions=s,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 s=[["displayKey"],["displayName"],["predicate","test"]],o=i=>i.some(n=>t[n]!=null)?!0:(G(72,{keys:i}),!1);if(!s.every(o)){this.filterOptions=e.filter(i=>i===t)||[];continue}this.customFilterOptions[t.displayKey]=t}}getDefaultItem(e){const{filterOptions:t}=this;if(e)return e;if(t.length>=1){const s=t[0];if(typeof s=="string")return s;if(s.displayKey)return s.displayKey;G(73)}else G(74)}getCustomOption(e){return this.customFilterOptions[e]}};function tn(e,t,s){return s==null?e.splice(t):e.splice(t,s)}function ea(e){return e==null||typeof e=="string"&&e.trim().length===0}function D5(e){return e==="AND"||e==="OR"?e:"AND"}function P5(e,t,s){if(e==null)return;const{predicate:o}=e;if(o!=null&&!t.some(i=>i==null))return o(t,s)}function M5(e,t){let s=e.length;return s>t&&(e.splice(t),G(78),s=t),s}function vn(e,t){const s=t.getCustomOption(e);if(s){const{numberOfInputs:i}=s;return i??1}return e&&["empty","notBlank","blank"].indexOf(e)>=0?0:e==="inRange"?2:1}var Ud=class extends Dx{constructor(e,t,s){super(e,"simple-filter"),this.mapValuesFromModel=t,this.defaultOptions=s,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 jd;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=D5(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,s)=>{const o=s===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 s=!e.operator,o=!t.operator;if(!s&&o||s&&!o)return!1;let n;if(s){const r=e,a=t;n=this.areSimpleModelsEqual(r,a)}else{const r=e,a=t;n=r.operator===a.operator&&Vs(r.conditions,a.conditions,(l,c)=>this.areSimpleModelsEqual(l,c))}return n}setModelIntoUi(e,t){if(e==null)return this.resetUiToDefaults(t),Ee.resolve();if(e.operator){const o=e;let i=o.conditions;i==null&&(i=[],G(77));const n=M5(i,this.maxNumConditions),r=this.getNumConditions();if(n<r)this.removeConditionsAndOperators(n);else if(n>r)for(let l=r;l<n;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)),i.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()),Ee.resolve()}setNumConditions(e){let t=e.maxNumConditions??2;t<1&&(G(79),t=1),this.maxNumConditions=t;let s=e.numAlwaysVisibleConditions??1;s<1&&(G(80),s=1),s>t&&(G(81),s=t),this.numAlwaysVisibleConditions=s}createOption(){const e=this.getGui(),t=this.createManagedBean(new Fd);this.eTypes.push(t),t.addCss("ag-filter-select"),e.appendChild(t.getGui());const s=this.createEValue();this.eConditionBodies.push(s),e.appendChild(s),this.putOptionsIntoDropdown(t),this.resetType(t);const o=this.getNumConditions()-1;this.forEachPositionInput(o,i=>this.resetInput(i)),this.addChangedListeners(t,o)}createJoinOperatorPanel(){const e=ft({tag:"div",cls:"ag-filter-condition"});this.eJoinPanels.push(e);const t=this.createJoinOperator(this.eJoinAnds,e,"and"),s=this.createJoinOperator(this.eJoinOrs,e,"or");this.getGui().appendChild(e);const o=this.eJoinPanels.length-1,i=this.joinOperatorId++;this.resetJoinOperatorAnd(t,o,i),this.resetJoinOperatorOr(s,o,i),this.isReadOnly()||(t.onValueChange(this.listener),s.onValueChange(this.listener))}createJoinOperator(e,t,s){const o=this.createManagedBean(new iy);e.push(o);const i="ag-filter-condition-operator";return o.addCss(i),o.addCss(`${i}-${s}`),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 s of t)e.addOption(s);e.setDisabled(t.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,s=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:s?this.getLocaleTextFunc()(s.displayKey,s.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 s=0;s<this.getNumConditions();s++)this.isConditionUiComplete(s)?e=s:t=!1;if(this.shouldAddNewConditionAtEnd(t))this.createJoinOperatorPanel(),this.createOption();else{const s=this.lastUiCompletePosition??this.getNumConditions()-2;if(e<s){this.removeConditionsAndOperators(s+1);const o=e+1,i=s-o;i>0&&this.removeConditionsAndOperators(o,i),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=e}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((o,i)=>{const n=this.isConditionDisabled(i,e);o.setDisabled(n||this.filterListOptions.length<=1),i===1&&(cn(this.eJoinPanels[0],n),this.eJoinAnds[0].setDisabled(n),this.eJoinOrs[0].setDisabled(n))}),this.eConditionBodies.forEach((o,i)=>{Ve(o,this.isConditionBodyVisible(i))});const s=(t??this.getJoinOperator())==="OR";for(const o of this.eJoinAnds)o.setValue(!s,!0);for(const o of this.eJoinOrs)o.setValue(s,!0);this.forEachInput((o,i,n,r)=>{this.setElementDisplayed(o,i<r),this.setElementDisabled(o,this.isConditionDisabled(n,e))}),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;const{eTypes:s,eConditionBodies:o,eJoinPanels:i,eJoinAnds:n,eJoinOrs:r}=this;this.removeComponents(s,e,t),this.removeElements(o,e,t),this.removeEValues(e,t);const a=Math.max(e-1,0);this.removeElements(i,a,t),this.removeComponents(n,a,t),this.removeComponents(r,a,t)}removeElements(e,t,s){const o=tn(e,t,s);for(const i of o)Os(i)}removeComponents(e,t,s){const o=tn(e,t,s);for(const i of o)Os(i.getGui()),this.destroyBean(i)}afterGuiAttached(e){if(super.afterGuiAttached(e),this.resetPlaceholder(),!e?.suppressFocus){let t;if(!this.isReadOnly()){const s=this.getInputs(0)[0];s instanceof Zs&&this.isConditionBodyVisible(0)?t=s.getInputElement():t=this.eTypes[0]?.getFocusableElement()}(t??this.getGui()).focus({preventScroll:!0})}}afterGuiDetached(){super.afterGuiDetached();const e=this.params;if(this.beans.colFilter?.shouldKeepStateOnDetach(e.column))return;e.onStateChange({model:e.model});let t=-1,s=-1,o=!1;const i=this.getJoinOperator();for(let r=this.getNumConditions()-1;r>=0;r--)if(this.isConditionUiComplete(r))t===-1&&(t=r,s=r);else{const a=r>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(r-1),l=r<t;(a||l)&&(this.removeConditionsAndOperators(r,1),o=!0,l&&s--)}let n=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),n=!0),this.shouldAddNewConditionAtEnd(s===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),n=!0),n&&this.updateConditionStatusesAndValues(s,i),o&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=s}getModelAsString(e){return this.params.getHandler()?.getModelAsString?.(e)??""}getPlaceholderText(e,t){let s=this.translate(e);if(typeof this.filterPlaceholder=="function"){const o=this.eTypes[t].getValue(),i=this.translate(o);s=this.filterPlaceholder({filterOptionKey:o,filterOption:i,placeholder:s})}else typeof this.filterPlaceholder=="string"&&(s=this.filterPlaceholder);return s}resetPlaceholder(){const e=this.getLocaleTextFunc();this.forEachInput((t,s,o,i)=>{if(!(t instanceof Zs))return;const n=s===0&&i>1?"inRangeStart":s===0?"filterOoo":"inRangeEnd",r=s===0&&i>1?e("ariaFilterFromValue","Filter from value"):s===0?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(n,o)),t.setInputAriaLabel(r)})}setElementValue(e,t,s){e instanceof Zs&&e.setValue(t!=null?String(t):null,!0)}setElementDisplayed(e,t){zu(e)&&Ve(e.getGui(),t)}setElementDisabled(e,t){zu(e)&&cn(e.getGui(),t)}attachElementOnChange(e,t){e instanceof Zs&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach((t,s)=>{this.forEachPositionTypeInput(s,t,e)})}forEachPositionInput(e,t){const s=this.getConditionType(e);this.forEachPositionTypeInput(e,s,t)}forEachPositionTypeInput(e,t,s){const o=vn(t,this.optionsFactory),i=this.getInputs(e);for(let n=0;n<i.length;n++){const r=i[n];r!=null&&s(r,n,e,o)}}isConditionDisabled(e,t){return this.isReadOnly()?!0:e===0?!1:e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return vn(t,this.optionsFactory)>0}isConditionUiComplete(e){return!(e>=this.getNumConditions()||this.getConditionType(e)==="empty"||this.getValues(e).some(s=>s==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,s)=>this.resetJoinOperatorAnd(t,s,this.joinOperatorId+s)),this.eJoinOrs.forEach((t,s)=>this.resetJoinOperatorOr(t,s,this.joinOperatorId+s)),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 s=this.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.defaultOption,!0).setAriaLabel(s).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,s){this.resetJoinOperator(e,t,this.defaultJoinOperator==="AND",this.translate("andCondition"),s)}resetJoinOperatorOr(e,t,s){this.resetJoinOperator(e,t,this.defaultJoinOperator==="OR",this.translate("orCondition"),s)}resetJoinOperator(e,t,s,o,i){this.updateJoinOperatorDisabled(e.setValue(s,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${i}`).setLabel(o),t)}updateJoinOperatorsDisabled(){const e=(t,s)=>this.updateJoinOperatorDisabled(t,s);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 s=this.mapValuesFromModel(e,this.optionsFactory);this.forEachInput((o,i,n)=>{n===t&&this.setElementValue(o,s[i]!=null?s[i]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,s,o)=>{this.setElementValue(t,s===0&&o===0?e:null,!0)})}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,s=>{this.attachElementOnChange(s,this.listener)}))}hasInvalidInputs(){return!1}isReadOnly(){return!!this.params.readOnly}},Fm=class{constructor(e,t,s,o,i,n){this.alive=!0,this.context=e,this.eParent=i;const r=BS(t,s,o);r&&r.newAgStackInstance().then(a=>{if(!this.alive){e.destroyBean(a);return}if(this.dateComp=a,!a)return;i.appendChild(a.getGui()),a?.afterGuiAttached?.();const{tempValue:l,disabled:c}=this;l&&a.setDate(l),c!=null&&a.setDisabled?.(c),n?.(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){const t=this.dateComp;t?t.setDisabled?.(e):this.disabled=e}setDisplayed(e){Ve(this.eParent,e)}setInputPlaceholder(e){this.dateComp?.setInputPlaceholder?.(e)}setInputAriaLabel(e){this.dateComp?.setInputAriaLabel?.(e)}afterGuiAttached(e){this.dateComp?.afterGuiAttached?.(e)}updateParams(e){this.dateComp?.refresh?.(e)}},$d=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"];function Em(e,t){const{dateFrom:s,dateTo:o,type:i}=e||{};return[s&&wt(s,void 0,!0)||null,o&&wt(o,void 0,!0)||null].slice(0,vn(i,t))}var zh=1e3,Wh=1/0,T5=class extends Ud{constructor(){super("dateFilter",Em,$d),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=zh,this.maxValidYear=Wh,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 d=e[l];if(d!=null)if(isNaN(d))G(82,{param:l});else return d==null?c:Number(d);return c},s=t("minValidYear",zh),o=t("maxValidYear",Wh);this.minValidYear=s,this.maxValidYear=o,s>o&&G(83);const{minValidDate:i,maxValidDate:n}=e,r=i instanceof Date?i:wt(i);this.minValidDate=r;const a=n instanceof Date?n:wt(n);this.maxValidDate=a,r&&a&&r>a&&G(84)}createDateCompWrapper(e){const{beans:{userCompFactory:t,context:s,gos:o},params:i}=this,n=new Fm(s,t,i.colDef,he(o,{onDateChanged:()=>this.onUiChanged(),filterParams:i,location:"filter"}),e);return this.addDestroyFunc(()=>n.destroy()),n}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}createEValue(){const e=ft({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,s,o){const i=ft({tag:"div",cls:`ag-filter-${o} ag-filter-date-${o}`});t.push(i),e.appendChild(i),s.push(this.createDateCompWrapper(i))}removeEValues(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),tn(this.eConditionPanelsFrom,e,t),tn(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,s){const o=tn(e,t,s);for(const i of o)i.destroy()}isValidDateValue(e){if(e===null)return!1;const{minValidDate:t,maxValidDate:s,minValidYear:o,maxValidYear:i}=this;if(t){if(e<t)return!1}else if(e.getUTCFullYear()<o)return!1;if(s){if(e>s)return!1}else if(e.getUTCFullYear()>i)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput((s,o,i,n)=>{i!==e||!t||o>=n||(t=t&&this.isValidDateValue(s.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),s={},o=this.getValues(e),i=this.params.useIsoSeparator?"T":" ";return o.length>0&&(s.dateFrom=Dt(o[0],!0,i)),o.length>1&&(s.dateTo=Dt(o[1],!0,i)),{dateFrom:null,dateTo:null,filterType:this.filterType,type:t,...s}}resetPlaceholder(){const e=this.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),s=e("ariaFilterValue","Filter Value");this.forEachInput(o=>{o.setInputPlaceholder(t),o.setInputAriaLabel(s)})}getInputs(e){const{dateConditionFromComps:t,dateConditionToComps:s}=this;return e>=t.length?[null,null]:[t[e],s[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(s,o,i,n)=>{o<n&&t.push(s.getDate())}),t}translate(e){return e==="lessThan"?super.translate("before"):e==="greaterThan"?super.translate("after"):super.translate(e)}},Dm=class extends A{constructor(e,t){super(),this.mapValuesFromModel=e,this.defaultOptions=t}init(e){const t=e.filterParams,s=new jd;this.optionsFactory=s,s.init(t,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(s,t)),this.updateParams(e),this.validateModel(e)}refresh(e){if(e.source==="colDef"){const t=e.filterParams,s=this.optionsFactory;s.refresh(t,this.defaultOptions),this.filterModelFormatter.updateParams({optionsFactory:s,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:s}=t,o=[];if(s){const r=t;o.push(...r.conditions??[])}else o.push(t);const i=s&&s==="OR"?"some":"every",n=this.params.getValue(e.node);return o[i](r=>this.individualConditionPasses(e,r,n))}getModelAsString(e,t){return this.filterModelFormatter.getModelAsString(e,t)??""}validateModel(e){const{model:t,filterParams:{filterOptions:s,maxNumConditions:o}}=e;if(t==null)return;let n=xf(t)?t.conditions:[t];const r=s?.map(d=>typeof d=="string"?d:d.displayKey)??this.defaultOptions;if(!(!n||n.every(d=>r.find(u=>u===d.type)!==void 0))){this.params={...e,model:null},e.onModelChange(null);return}let l=!1;const c=this.filterType;if((n&&!n.every(d=>d.filterType===c)||t.filterType!==c)&&(n=n.map(d=>({...d,filterType:c})),l=!0),typeof o=="number"&&n&&n.length>o&&(n=n.slice(0,o),l=!0),l){const d=n.length>1?{...t,filterType:c,conditions:n}:{...n[0],filterType:c};this.params={...e,model:d},e.onModelChange(d)}}individualConditionPasses(e,t,s){const o=this.optionsFactory,i=this.mapValuesFromModel(t,o),n=o.getCustomOption(t.type),r=P5(n,i,s);return r??(s==null?this.evaluateNullValue(t.type):this.evaluateNonNullValue(i,s,t,e))}},Pm=class extends Dm{evaluateNullValue(e){const{includeBlanksInEquals:t,includeBlanksInNotEqual:s,includeBlanksInGreaterThan:o,includeBlanksInLessThan:i,includeBlanksInRange:n}=this.params.filterParams;switch(e){case"equals":if(t)return!0;break;case"notEqual":if(s)return!0;break;case"greaterThan":case"greaterThanOrEqual":if(o)return!0;break;case"lessThan":case"lessThanOrEqual":if(i)return!0;break;case"inRange":if(n)return!0;break;case"blank":return!0;case"notBlank":return!1}return!1}evaluateNonNullValue(e,t,s){const o=s.type;if(!this.isValid(t))return o==="notEqual"||o==="notBlank";const i=this.comparator(),n=e[0]!=null?i(e[0],t):0;switch(o){case"equals":return n===0;case"notEqual":return n!==0;case"greaterThan":return n>0;case"greaterThanOrEqual":return n>=0;case"lessThan":return n<0;case"lessThanOrEqual":return n<=0;case"inRange":{const r=i(e[1],t);return this.params.filterParams.inRangeInclusive?n>=0&&r<=0:n>0&&r<0}case"blank":return ea(t);case"notBlank":return!ea(t);default:return G(76,{filterModelType:o}),!0}}},Mm={equals:"Equals",notEqual:"NotEqual",greaterThan:"GreaterThan",greaterThanOrEqual:"GreaterThanOrEqual",lessThan:"LessThan",lessThanOrEqual:"LessThanOrEqual",inRange:"InRange"},I5={contains:"Contains",notContains:"NotContains",equals:"TextEquals",notEqual:"TextNotEqual",startsWith:"StartsWith",endsWith:"EndsWith",inRange:"InRange"},Kd=class extends A{constructor(e,t,s){super(),this.optionsFactory=e,this.filterParams=t,this.valueFormatter=s}getModelAsString(e,t){const s=this.getLocaleTextFunc(),o=t==="filterToolPanel";if(!e)return o?ks(this,"filterSummaryInactive"):null;if(e.operator!=null){const n=e,a=(n.conditions??[]).map(c=>this.getModelAsString(c,t)),l=n.operator==="AND"?"andCondition":"orCondition";return a.join(` ${ks(this,l)} `)}else{if(e.type==="blank"||e.type==="notBlank")return o?ks(this,e.type==="blank"?"filterSummaryBlank":"filterSummaryNotBlank"):s(e.type,e.type);{const n=e,r=this.optionsFactory.getCustomOption(n.type),{displayKey:a,displayName:l,numberOfInputs:c}=r||{};return a&&l&&c===0?s(a,l):this.conditionToString(n,o,n.type==="inRange"||c===2,a,l)}}}updateParams(e){const{optionsFactory:t,filterParams:s}=e;this.optionsFactory=t,this.filterParams=s}conditionForToolPanel(e,t,s,o,i,n){let r;const a=this.getTypeKey(e);return a&&(r=ks(this,a)),i&&n&&(r=this.getLocaleTextFunc()(i,n)),r!=null?t?`${r} ${ks(this,"filterSummaryInRangeValues",[s(),o()])}`:`${r} ${s()}`: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)}},Tm=class extends Kd{constructor(e,t){super(e,t,s=>{const{dataTypeSvc:o,valueSvc:i}=this.beans,n=t.column,r=o?.getDateFormatterFunction(n),a=r?r(s??void 0):s;return i.formatValue(n,null,a)}),this.filterTypeKeys=Mm}conditionToString(e,t,s,o,i){const{type:n}=e,r=wt(e.dateFrom),a=wt(e.dateTo),l=this.filterParams.inRangeFloatingFilterDateFormat,c=t?this.formatValue.bind(this):h=>Ec(h,l),d=()=>r!==null?c(r):"null",u=()=>a!==null?c(a):"null";if(t){const h=this.conditionForToolPanel(n,s,d,u,o,i);if(h!=null)return h}return s?`${d()}-${u()}`:r!=null?c(r):`${n}`}};function k5(e,t){const s=t;return s<e?-1:s>e?1:0}var A5=class extends Pm{constructor(){super(Em,$d),this.filterType="date",this.FilterModelFormatterClass=Tm}comparator(){return this.params.filterParams.comparator??k5}isValid(e){const t=this.params.filterParams.isValidDate;return!t||t(e)}},Im=class extends We{constructor(){super(...arguments),this.defaultDebounceMs=0}setLastTypeFromModel(e){if(!e){this.lastType=this.optionsFactory.defaultOption;return}const t=e.operator;let s;t?s=e.conditions[0]:s=e,this.lastType=s.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const s=e;return this.isTypeEditable(s.type)}init(e){this.params=e;const t=this.gos.get("enableFilterHandlers");if(this.reactive=t,this.setParams(e),t){const s=e;this.onModelUpdated(s.model)}}setParams(e){const t=new jd;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 s=this.optionsFactory.defaultOption;t||(this.lastType=s),this.readOnly=!!e.filterParams.readOnly;const o=this.isTypeEditable(s);this.setEditable(o)}refresh(e){this.params=e;const t=e,s=this.reactive;if((!s||t.source==="colDef")&&this.updateParams(e),s){const{source:o,model:i}=t;if(o==="dataChanged"||o==="ui")return;this.onModelUpdated(i)}}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?.afterFloatingFilter||t?.afterDataChange||this.onModelUpdated(e)}hasSingleInput(e){const t=this.optionsFactory.getCustomOption(e)?.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")}`}},L5={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"}]},O5=class extends Im{constructor(){super(L5,[xa]),this.eReadOnlyText=ne,this.eDateWrapper=ne,this.FilterModelFormatterClass=Tm,this.filterType="date",this.defaultOptions=$d}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 s=e?wt(e.dateFrom):null;this.dateComp.setDate(s),this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){Ve(this.eDateWrapper,e),Ve(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 s=t.model,o=Dt(e),i=o==null?null:{...s??{filterType:this.filterType,type:this.lastType??this.optionsFactory.defaultOption},dateFrom:o};t.onModelChange(i,{afterFloatingFilter:!0})}else this.params.parentFilterInstance(t=>{t?.onFloatingFilterChanged(this.lastType||null,e)})}getDateComponentParams(){const{filterParams:e}=this.params,t=Td(e,this.defaultDebounceMs);return he(this.gos,{onDateChanged:ot(this,this.onDateChanged.bind(this),t),filterParams:e,location:"floatingFilter"})}createDateComponent(){const{beans:{context:e,userCompFactory:t},eDateWrapper:s,params:o}=this;this.dateComp=new Fm(e,t,o.column.getColDef(),this.getDateComponentParams(),s,i=>{i.setInputAriaLabel(this.getAriaLabel(o))}),this.addDestroyFunc(()=>this.dateComp.destroy())}},N5={tag:"div",cls:"ag-filter-filter",children:[{tag:"ag-input-text-field",ref:"eDateInput",cls:"ag-date-filter"}]},H5=class extends We{constructor(){super(N5,[xa]),this.eDateInput=ne,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){const t=this.eDateInput.getInputElement(),s=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=s&&zs();const{minValidYear:o,maxValidYear:i,minValidDate:n,maxValidDate:r,buttons:a,includeTime:l,colDef:c}=e.filterParams||{},d=this.beans.dataTypeSvc,u=l??d?.getDateIncludesTimeFlag?.(c.cellDataType)??!1;if(s?u?(t.type="datetime-local",t.step="1"):t.type="date":t.type="text",n&&o&&G(85),r&&i&&G(86),n&&r){const[h,p]=[n,r].map(f=>f instanceof Date?f:wt(f));h&&p&&h.getTime()>p.getTime()&&G(87)}n?n instanceof Date?t.min=Ec(n):t.min=n:o&&(t.min=`${o}-01-01`),r?r instanceof Date?t.max=Ec(r):t.max=r:i&&(t.max=`${i}-12-31`),this.isApply=e.location==="floatingFilter"&&!!a?.includes("apply")}refresh(e){this.params=e,this.setParams(e)}getDate(){return wt(this.eDateInput.getValue())}setDate(e){const t=this.params.filterParams.colDef.cellDataType,s=this.beans.dataTypeSvc?.getDateIncludesTimeFlag(t)??!1;this.eDateInput.setValue(Dt(e,s))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setInputAriaLabel(e){this.eDateInput.setAriaLabel(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){e?.suppressFocus||this.eDateInput.getInputElement().focus({preventScroll:!0})}shouldUseBrowserDatePicker(e){return e?.filterParams?.browserDatePicker??!0}},qd=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"];function jc(e){const{allowedCharPattern:t}=e??{};return t??null}function Uc(e){return e==null||isNaN(e)?null:e}function km(e,t){const{filter:s,filterTo:o,type:i}=e||{};return[Uc(s),Uc(o)].slice(0,vn(i,t))}var G5=class extends Ud{constructor(){super("numberFilter",km,qd),this.eValuesFrom=[],this.eValuesTo=[],this.filterType="number",this.defaultDebounceMs=500}setElementValue(e,t,s){const{numberFormatter:o}=this.params,i=!s&&o?o(t??null):t;super.setElementValue(e,i)}createEValue(){const e=jc(this.params),t=ft({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,s,o){const i=this.createManagedBean(o?new Ro({allowedCharPattern:o}):new Rd);i.addCss(`ag-filter-${s}`),i.addCss("ag-filter-filter"),t.push(i),e.appendChild(i.getGui())}removeEValues(e,t){const s=o=>this.removeComponents(o,e,t);s(this.eValuesFrom),s(this.eValuesTo)}getValues(e){const t=[];return this.forEachPositionInput(e,(s,o,i,n)=>{o<n&&t.push(Uc(this.stringToFloat(s.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=gs(e);t!=null&&t.trim()===""&&(t=null);const s=this.params.numberParser;return s?s(t):t==null||t.trim()==="-"?null:Number.parseFloat(t)}createCondition(e){const t=this.getConditionType(e),s={filterType:this.filterType,type:t},o=this.getValues(e);return o.length>0&&(s.filter=o[0]),o.length>1&&(s.filterTo=o[1]),s}getInputs(e){const{eValuesFrom:t,eValuesTo:s}=this;return e>=t.length?[null,null]:[t[e],s[e]]}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>{t.getInputElement().validity.valid||(e=!0)}),e}},Am=class extends Kd{constructor(e,t){super(e,t,t.numberFormatter),this.filterTypeKeys=Mm}conditionToString(e,t,s,o,i){const{filter:n,filterTo:r,type:a}=e,l=this.formatValue.bind(this);if(t){const c=this.conditionForToolPanel(a,s,()=>l(n),()=>l(r),o,i);if(c!=null)return c}return s?`${l(n)}-${l(r)}`:n!=null?l(n):`${a}`}},B5=class extends Pm{constructor(){super(km,qd),this.filterType="number",this.FilterModelFormatterClass=Am}comparator(){return(e,t)=>e===t?0:e<t?1:-1}isValid(e){return!isNaN(e)}},Lm=class extends A{constructor(e){super(),this.params=e,this.eInput=ne,this.onValueChanged=()=>{}}setupGui(e){this.eInput=this.createManagedBean(new Ro(this.params?.config));const t=this.eInput.getGui();e.appendChild(t);const s=o=>this.onValueChanged(o);this.addManagedListeners(t,{input:s,keydown:s})}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:s}=this;s.setInputAriaLabel(e),t!==void 0&&s.setAutoComplete(t)}};function $c(e){const t=e?.trim();return t===""?e:t}function Om(e,t){const{filter:s,filterTo:o,type:i}=e||{};return[s||null,o||null].slice(0,vn(i,t))}var V5={tag:"div",ref:"eFloatingFilterInputContainer",cls:"ag-floating-filter-input",role:"presentation"},Nm=class extends Im{constructor(){super(...arguments),this.eFloatingFilterInputContainer=ne,this.defaultDebounceMs=500}postConstruct(){this.setTemplate(V5)}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:s,defaultDebounceMs:o,readOnly:i}=this;if(s.setParams({ariaLabel:this.getAriaLabel(e),autoComplete:t}),this.applyActive=Fa(e.filterParams),!i){const n=Td(e.filterParams,o),r=ot(this,this.syncUpWithParentFilter.bind(this),n);s.setValueChangedListener(r)}}updateParams(e){super.updateParams(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const{inputSvc:t}=this,s=t.getValue();vt(this.eFloatingFilterInputContainer),this.destroyBean(t),this.setupFloatingFilterInputService(e),t.setValue(s,!0)}syncUpWithParentFilter(e){const t=e.key===T.ENTER,s=this.reactive;if(s&&this.params.onUiChange(),this.applyActive&&!t)return;const{inputSvc:o,params:i,lastType:n}=this;let r=o.getValue();if(i.filterParams.trimInput&&(r=$c(r),o.setValue(r,!0)),s){const a=i,l=a.model,c=this.convertValue(r),d=c==null?null:{...l??{filterType:this.filterType,type:n??this.optionsFactory.defaultOption},filter:c};a.onModelChange(d,{afterFloatingFilter:!0})}else i.parentFilterInstance(a=>{a?.onFloatingFilterChanged(n||null,r||null)})}convertValue(e){return e||null}setEditable(e){this.inputSvc.setEditable(e)}},z5=class extends A{constructor(){super(...arguments),this.onValueChanged=()=>{},this.numberInputActive=!0}setupGui(e){this.eNumberInput=this.createManagedBean(new Rd),this.eTextInput=this.createManagedBean(new Ro),this.eTextInput.setDisabled(!0);const t=this.eNumberInput.getGui(),s=this.eTextInput.getGui();e.appendChild(t),e.appendChild(s),this.setupListeners(t,o=>this.onValueChanged(o)),this.setupListeners(s,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)}},W5=class extends Nm{constructor(){super(...arguments),this.FilterModelFormatterClass=Am,this.filterType="number",this.defaultOptions=qd}updateParams(e){jc(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.updateParams(e)}createFloatingFilterInputService(e){return this.allowedCharPattern=jc(e.filterParams),this.allowedCharPattern?this.createManagedBean(new Lm({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new z5)}convertValue(e){return e?Number(e):null}},Yd=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],_5=class extends Ud{constructor(){super("textFilter",Om,Yd),this.filterType="text",this.eValuesFrom=[],this.eValuesTo=[],this.defaultDebounceMs=500}createCondition(e){const t=this.getConditionType(e),s={filterType:this.filterType,type:t},o=this.getValues(e);return o.length>0&&(s.filter=o[0]),o.length>1&&(s.filterTo=o[1]),s}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){const{eValuesFrom:t,eValuesTo:s}=this;return e>=t.length?[null,null]:[t[e],s[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(s,o,i,n)=>{o<n&&t.push(gs(s.getValue()))}),t}createEValue(){const e=ft({tag:"div",cls:"ag-filter-body",role:"presentation"}),{eValuesFrom:t,eValuesTo:s}=this;return this.createFromToElement(e,t,"from"),this.createFromToElement(e,s,"to"),e}createFromToElement(e,t,s){const o=this.createManagedBean(new Ro);o.addCss(`ag-filter-${s}`),o.addCss("ag-filter-filter"),t.push(o),e.appendChild(o.getGui())}removeEValues(e,t){const s=n=>this.removeComponents(n,e,t),{eValuesFrom:o,eValuesTo:i}=this;s(o),s(i)}},Hm=class extends Kd{constructor(){super(...arguments),this.filterTypeKeys=I5}conditionToString(e,t,s,o,i){const{filter:n,filterTo:r,type:a}=e;if(t){const l=d=>()=>ks(this,"filterSummaryTextQuote",[d]),c=this.conditionForToolPanel(a,s,l(n),l(r),o,i);if(c!=null)return c}return s?`${n}-${r}`:n!=null?`${n}`:`${a}`}},j5=({filterOption:e,value:t,filterText:s})=>{if(s==null)return!1;switch(e){case"contains":return t.includes(s);case"notContains":return!t.includes(s);case"equals":return t===s;case"notEqual":return t!=s;case"startsWith":return t.indexOf(s)===0;case"endsWith":{const o=t.lastIndexOf(s);return o>=0&&o===t.length-s.length}default:return!1}},U5=e=>e,$5=e=>e==null?null:e.toString().toLowerCase(),K5=class extends Dm{constructor(){super(Om,Yd),this.filterType="text",this.FilterModelFormatterClass=Hm}updateParams(e){super.updateParams(e);const t=e.filterParams;this.matcher=t.textMatcher??j5,this.formatter=t.textFormatter??(t.caseSensitive?U5:$5)}evaluateNullValue(e){return e?["notEqual","notContains","blank"].indexOf(e)>=0:!1}evaluateNonNullValue(e,t,s,o){const i=e.map(h=>this.formatter(h))||[],n=this.formatter(t),{api:r,colDef:a,column:l,context:c,filterParams:{textFormatter:d}}=this.params;if(s.type==="blank")return ea(t);if(s.type==="notBlank")return!ea(t);const u={api:r,colDef:a,column:l,context:c,node:o.node,data:o.data,filterOption:s.type,value:n,textFormatter:d};return i.some(h=>this.matcher({...u,filterText:h}))}processModelToApply(e){if(e&&this.params.filterParams.trimInput){const t=s=>{const o={...s},{filter:i,filterTo:n}=s;return i&&(o.filter=$c(i)??null),n&&(o.filterTo=$c(n)??null),o};return xf(e)?{...e,conditions:e.conditions.map(t)}:t(e)}return e}},q5=class extends Nm{constructor(){super(...arguments),this.FilterModelFormatterClass=Hm,this.filterType="text",this.defaultOptions=Yd}createFloatingFilterInputService(){return this.createManagedBean(new Lm)}};function Y5(e){return!!e.quickFilter?.isFilterPresent()}function Z5(e){return e.quickFilter?.getText()}function X5(e){e.quickFilter?.resetCache()}var Q5=class extends A{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",s=>this.setFilter(s.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(){const{autoColSvc:e,colModel:t,gos:s,pivotResultCols:o}=this.beans,i=t.isPivotMode(),n=e?.getColumns(),r=t.getColDefCols();let a=(i&&!s.get("applyQuickFilterBeforePivotOrAgg")?o?.getPivotResultCols()?.list:r)??[];n&&(a=a.concat(n)),this.colsToUse=s.get("includeHiddenColumnsInQuickFilter")?a:a.filter(l=>l.isVisible()||l.isRowGroupActive())}isFilterPresent(){return this.quickFilter!==null}doesRowPass(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassMatcher(t,e):this.quickFilterParts.every(s=>t?this.doesRowPassCache(e,s):this.doesRowPassNoCache(e,s))}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 Y(e)?e.toUpperCase():null}setFilter(e){if(e!=null&&typeof e!="string"){G(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"),s=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,s&&(this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}onColumnConfigChanged(){this.refreshCols(),this.resetCache(),this.isFilterPresent()&&this.dispatchLocalEvent({type:"quickFilterChanged"})}doesRowPassNoCache(e,t){return this.colsToUse.some(s=>{const o=this.getTextForColumn(s,e);return Y(o)&&o.includes(t)})}doesRowPassCache(e,t){return this.checkGenerateAggText(e),e.quickFilterAggregateText.includes(t)}doesRowPassMatcher(e,t){let s;e?(this.checkGenerateAggText(t),s=t.quickFilterAggregateText):s=this.getAggText(t);const{quickFilterParts:o,matcher:i}=this;return i(o,s)}checkGenerateAggText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getAggText(e))}getTextForColumn(e,t){let s=this.beans.filterValueSvc.getValue(e,t);const o=e.getColDef();if(o.getQuickFilterText){const i=he(this.gos,{value:s,node:t,data:t.data,column:e,colDef:o});s=o.getQuickFilterText(i)}return Y(s)?s.toString().toUpperCase():null}getAggText(e){const t=[];for(const s of this.colsToUse){const o=this.getTextForColumn(s,e);Y(o)&&t.push(o)}return t.join(`
|
|
60
60
|
`)}},J5={moduleName:"ClientSideRowModelFilter",version:K,rowModels:["clientSide"],beans:[e5]},Zd={moduleName:"FilterCore",version:K,beans:[y5],apiFunctions:{isAnyFilterPresent:b5,onFilterChanged:S5},css:[r5],dependsOn:[J5]},Gm={moduleName:"FilterValue",version:K,beans:[R5]},Ta={moduleName:"ColumnFilter",version:K,beans:[w5,x5],dynamicBeans:{headerFilterCellCtrl:t5},icons:{filter:"filter",filterActive:"filter"},apiFunctions:{isColumnFilterPresent:a5,getColumnFilterInstance:l5,destroyFilter:c5,setFilterModel:d5,getFilterModel:u5,getColumnFilterModel:h5,setColumnFilterModel:g5,showColumnFilter:p5,hideColumnFilter:f5,getColumnFilterHandler:m5,doFilterAction:C5},dependsOn:[Zd,Ma,Gm,i5]},e4={moduleName:"CustomFilter",version:K,userComponents:{agReadOnlyFloatingFilter:E5},dependsOn:[Ta]},t4={moduleName:"TextFilter",version:K,dependsOn:[Ta],userComponents:{agTextColumnFilter:{classImp:_5,params:{useForm:!0}},agTextColumnFloatingFilter:q5},dynamicBeans:{agTextColumnFilterHandler:K5}},s4={moduleName:"NumberFilter",version:K,dependsOn:[Ta],userComponents:{agNumberColumnFilter:{classImp:G5,params:{useForm:!0}},agNumberColumnFloatingFilter:W5},dynamicBeans:{agNumberColumnFilterHandler:B5}},o4={moduleName:"DateFilter",version:K,dependsOn:[Ta],userComponents:{agDateColumnFilter:{classImp:T5,params:{useForm:!0}},agDateInput:H5,agDateColumnFloatingFilter:O5},dynamicBeans:{agDateColumnFilterHandler:A5}},i4={moduleName:"QuickFilterCore",version:K,rowModels:["clientSide"],beans:[Q5],dependsOn:[Zd,Gm]},n4={moduleName:"QuickFilter",version:K,apiFunctions:{isQuickFilterPresent:Y5,getQuickFilter:Z5,resetQuickFilter:X5},dependsOn:[i4]},r4={moduleName:"ExternalFilter",version:K,dependsOn:[Zd]},a4=".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}}",Zl=(e,t,s)=>{const{editModelSvc:o}=e,i=o?.getCellValidationModel()?.getCellValidation(t)?.errorMessages,n=o?.getRowValidationModel().getRowValidation(t)?.errorMessages,r=i||n;return r?.length?r.join(s("tooltipValidationErrorSeparator",". ")):void 0},l4=class extends A{constructor(){super(...arguments),this.beanName="tooltipSvc"}setupHeaderTooltip(e,t,s,o){e&&t.destroyBean(e);const i=this.gos,n=Yl(i),{column:r,eGui:a}=t,l=r.getColDef();!o&&n&&!l.headerComponent&&(o=fr(()=>a.querySelector(".ag-header-cell-text")));const c="header",u=this.beans.colNames.getDisplayNameForColumn(r,"header",!0),h=s??u,p={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>s??l?.headerTooltipValueGetter?.(he(i,{location:c,colDef:l,column:r,value:h,valueFormatted:u}))??l?.headerTooltip,shouldDisplayTooltip:o,getAdditionalParams:()=>({column:r,colDef:r.getColDef()})};let f=this.createTooltipFeature(p);return f&&(f=t.createBean(f),t.setRefreshFunction("tooltip",()=>f.refreshTooltip())),f}setupHeaderGroupTooltip(e,t,s,o){e&&t.destroyBean(e);const i=this.gos,n=Yl(i),{column:r,eGui:a}=t,l=r.getColGroupDef();!o&&n&&!l?.headerGroupComponent&&(o=fr(()=>a.querySelector(".ag-header-group-text")));const c="headerGroup",u=this.beans.colNames.getDisplayNameForColumnGroup(r,"header"),h=s??u,p={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>s??l?.headerTooltipValueGetter?.(he(i,{location:c,colDef:l,column:r,value:h,valueFormatted:u}))??l?.headerTooltip,shouldDisplayTooltip:o,getAdditionalParams:()=>{const C={column:r};return l&&(C.colDef=l),C}},f=this.createTooltipFeature(p);return f&&t.createBean(f)}enableCellTooltipFeature(e,t,s){const{beans:o}=this,{gos:i,editSvc:n}=o,{column:r,rowNode:a}=e;let l="cell";const c=()=>{const p=!!!n?.isEditing(e)&&Zl(o,e,this.getLocaleTextFunc());if(p)return l="cellEditor",p;l="cell";const f=r.getColDef(),C=a.data;if(f.tooltipField&&Y(C))return Ji(C,f.tooltipField,r.isTooltipFieldContainsDots());const v=f.tooltipValueGetter;return v?v(he(i,{location:"cell",colDef:r.getColDef(),column:r,rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,value:e.value,valueFormatted:e.valueFormatted})):null},d=Yl(i);s||(d&&!e.isCellRenderer()?s=()=>{const h=!!n?.isEditing(e);if(!h&&Zl(o,e,this.getLocaleTextFunc()))return!0;if(!r.isTooltipEnabled())return!1;const C=fr(()=>{const v=e.eGui;return v.children.length===0?v:v.querySelector(".ag-cell-value")});return!h&&C()}:s=()=>!n?.isEditing(e));const u={getGui:()=>e.eGui,getLocation:()=>l,getTooltipValue:t!=null?()=>t:c,shouldDisplayTooltip:s,getAdditionalParams:()=>({column:r,colDef:r.getColDef(),rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,valueFormatted:e.valueFormatted})};return this.createTooltipFeature(u,o)}setupFullWidthRowTooltip(e,t,s,o){const i={getGui:()=>t.getFullWidthElement(),getTooltipValue:()=>s,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:o},n=this.beans,r=n.context;e&&t.destroyBean(e,r);const a=this.createTooltipFeature(i,n);if(a)return t.createBean(a,r)}setupCellEditorTooltip(e,t){const{beans:s}=this,{context:o}=s,i=t.getValidationElement?.(!0)||!t.isPopup?.()&&e.eGui;if(!i)return;const n={getGui:()=>i,getTooltipValue:()=>Zl(s,e,this.getLocaleTextFunc()),getLocation:()=>"cellEditor",shouldDisplayTooltip:()=>{const{editModelSvc:a}=s,l=a?.getRowValidationModel()?.getRowValidationMap(),c=a?.getCellValidationModel()?.getCellValidationMap(),d=!!l&&l.size>0,u=!!c&&c.size>0;return d||u}},r=this.createTooltipFeature(n,s);if(r)return e.createBean(r,o)}initCol(e){const{colDef:t}=e;e.tooltipEnabled=Y(t.tooltipField)||Y(t.tooltipValueGetter)||Y(t.tooltipComponent)}createTooltipFeature(e,t){return this.beans.registry.createDynamicBean("tooltipFeature",!1,e,t)}},c4=class extends Zy{createTooltipComp(e,t){WS(this.beans.userCompFactory,e)?.newAgStackInstance().then(t)}setEventHandlers(e){[this.onColumnMovedEventCallback]=this.addManagedEventListeners({columnMoved:e})}clearEventHandlers(){this.onColumnMovedEventCallback?.(),this.onColumnMovedEventCallback=void 0}},Bm={moduleName:"Tooltip",version:K,beans:[l4],dynamicBeans:{tooltipFeature:gf,highlightTooltipFeature:Xy,tooltipStateManager:c4},userComponents:{agTooltipComponent:ex},dependsOn:[Ma],css:[a4]},Bo=class{constructor(e){this.cellValueChanges=e}},Xl=class extends Bo{constructor(e,t,s,o){super(e),this.initialRange=t,this.finalRange=s,this.ranges=o}},d4=10,_h=class{constructor(e){this.actionStack=[],this.maxStackSize=e||d4,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}},u4=class extends A{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},s=this.activeCellEdit!==null&&_f(this.activeCellEdit,t),o=this.activeRowEdit!==null&&D2(this.activeRowEdit,t);if(!(s||o||this.isPasting||this.isRangeInAction))return;const{rowPinned:n,rowIndex:r,column:a,oldValue:l,value:c}=e,d={rowPinned:n,rowIndex:r,columnId:a.getColId(),newValue:c,oldValue:l};this.cellValueChanges.push(d)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}postConstruct(){const{gos:e,ctrlsSvc:t}=this.beans;if(!e.get("undoRedoCellEditing"))return;const s=e.get("undoRedoCellEditingLimit");if(s<=0)return;this.undoStack=new _h(s),this.redoStack=new _h(s),this.addListeners();const o=this.clearStacks.bind(this);this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this),modelUpdated:i=>{i.keepUndoRedoStack||this.clearStacks()},columnPivotModeChanged:o,newColumnsLoaded:o,columnGroupOpened:o,columnRowGroupChanged:o,columnMoved:o,columnPinned:o,columnVisible:o,rowDragEnd:o}),t.whenReady(this,i=>{this.gridBodyCtrl=i.gridBodyCtrl})}getCurrentUndoStackSize(){return this.undoStack?.getCurrentStackSize()??0}getCurrentRedoStackSize(){return this.redoStack?.getCurrentStackSize()??0}undo(e){const{eventSvc:t,undoStack:s,redoStack:o}=this;t.dispatchEvent({type:"undoStarted",source:e});const i=this.undoRedo(s,o,"initialRange","oldValue","undo");t.dispatchEvent({type:"undoEnded",source:e,operationPerformed:i})}redo(e){const{eventSvc:t,undoStack:s,redoStack:o}=this;t.dispatchEvent({type:"redoStarted",source:e});const i=this.undoRedo(o,s,"finalRange","newValue","redo");t.dispatchEvent({type:"redoEnded",source:e,operationPerformed:i})}undoRedo(e,t,s,o,i){if(!e)return!1;const n=e.pop();return n?.cellValueChanges?(this.processAction(n,r=>r[o],i),n instanceof Xl?this.processRange(n.ranges||[n[s]]):this.processCell(n.cellValueChanges),t.push(n),!0):!1}processAction(e,t,s){for(const o of e.cellValueChanges){const{rowIndex:i,rowPinned:n,columnId:r}=o,a={rowIndex:i,rowPinned:n},l=Cs(this.beans,a);l.displayed&&l.setDataValue(r,t(o),s)}}processRange(e){let t;const s=this.beans.rangeSvc;s.removeAllCellRanges(!0),e.forEach((o,i)=>{if(!o)return;const n=o.startRow,r=o.endRow;i===e.length-1&&(t={rowPinned:n.rowPinned,rowIndex:n.rowIndex,columnId:o.startColumn.getColId()},this.setLastFocusedCell(t));const a={rowStartIndex:n.rowIndex,rowStartPinned:n.rowPinned,rowEndIndex:r.rowIndex,rowEndPinned:r.rowPinned,columnStart:o.startColumn,columns:o.columns};s.addCellRange(a)})}processCell(e){const t=e[0],{rowIndex:s,rowPinned:o}=t,i={rowIndex:s,rowPinned:o},n=Cs(this.beans,i),r={rowPinned:t.rowPinned,rowIndex:n.rowIndex,columnId:t.columnId};this.setLastFocusedCell(r)}setLastFocusedCell(e){const{rowIndex:t,columnId:s,rowPinned:o}=e,{colModel:i,focusSvc:n,rangeSvc:r}=this.beans,a=i.getCol(s);if(!a)return;const{scrollFeature:l}=this.gridBodyCtrl;l.ensureIndexVisible(t),l.ensureColumnVisible(a);const c={rowIndex:t,column:a,rowPinned:o};n.setFocusedCell({...c,forceBrowserFocus:!0}),r?.setRangeToCell(c)}addListeners(){this.addManagedEventListeners({rowEditingStarted:e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}},rowEditingStopped:()=>{const e=new Bo(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 s=new Bo(this.cellValueChanges);this.pushActionsToUndoStack(s)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new Bo(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new Xl(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1},keyShortcutChangedCellStart:()=>{this.isRangeInAction=!0},keyShortcutChangedCellEnd:()=>{let e;const{rangeSvc:t,gos:s}=this.beans;t&&Hs(s)?e=new Xl(this.cellValueChanges,void 0,void 0,[...t.getCellRanges()]):e=new Bo(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?.length===0))return;const s=new Bo(t??[]);this.pushActionsToUndoStack(s),this.cellValueChanges=[]}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}},h4=".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}",g4={tag:"div",cls:"ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit",children:[{tag:"ag-checkbox",ref:"eEditor",role:"presentation"}]},p4=class extends Da{constructor(){super(g4,[xd]),this.eEditor=ne}initialiseEditor(e){const t=e.value??void 0,s=this.eEditor;s.setValue(t),s.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(t),this.addManagedListeners(s,{fieldValueChanged:i=>this.setAriaLabel(i.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(),s=Sa(t,e),o=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eEditor.setInputAriaLabel(`${o} (${s})`)}getValidationElement(e){return e?this.params.eGridCell:this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{getValidationErrors:t}=e,s=this.getValue();return t?t({value:s,internalErrors:null,cellEditorParams:e}):null}},Ia=class extends Da{constructor(e){super(),this.cellEditorInput=e,this.eEditor=ne}initialiseEditor(e){const{cellEditorInput:t}=this;this.setTemplate({tag:"div",cls:"ag-cell-edit-wrapper",children:[t.getTemplate()]},t.getAgComponents());const{eEditor:s}=this,{cellStartedEdit:o,eventKey:i,suppressPreventDefault:n}=e;s.getInputElement().setAttribute("title",""),t.init(s,e);let r,a=!0;o?(this.focusAfterAttached=!0,i===T.BACKSPACE||i===T.DELETE?r="":i&&i.length===1?n?a=!1:r=i:(r=t.getStartValue(),i!==T.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,r=t.getStartValue()),a&&r!=null&&s.setStartValue(r),this.addGuiEventListener("keydown",l=>{const{key:c}=l;(c===T.PAGE_UP||c===T.PAGE_DOWN)&&l.preventDefault()})}afterGuiAttached(){const e=this.getLocaleTextFunc(),t=this.eEditor;if(t.setInputAriaLabel(e("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;zs()||t.getFocusableElement().focus();const s=t.getInputElement();this.highlightAllOnFocus?s.select():this.cellEditorInput.setCaret?.()}focusIn(){const{eEditor:e}=this,t=e.getFocusableElement(),s=e.getInputElement();t.focus(),s.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){return this.cellEditorInput.getValidationErrors()}},f4={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},m4=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return f4}getAgComponents(){return[of]}init(e,t){this.eEditor=e,this.params=t;const{min:s,max:o,step:i,colDef:n}=t;s!=null&&e.setMin(s),o!=null&&e.setMax(o),i!=null&&e.setStep(i),this.includeTime=t.includeTime??this.getDataTypeService()?.getDateIncludesTimeFlag?.(n.cellDataType),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const t=this.eEditor.getInputElement().valueAsDate,{params:s}=this,{min:o,max:i,getValidationErrors:n}=s;let r=[];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();r.push(a("minDateValidation",`Date must be after ${c}`,[c]))}}if(i){const l=i instanceof Date?i:new Date(i);if(t>l){const c=l.toLocaleDateString();r.push(a("maxDateValidation",`Date must be before ${c}`,[c]))}}}return r.length||(r=null),n?n({value:t,cellEditorParams:s,internalErrors:r}):r}getValue(){const{eEditor:e,params:t}=this,s=e.getDate();return!Y(s)&&!Y(t.value)?t.value:s??null}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return Dt(e,this.includeTime??!1)}},C4=class extends Ia{constructor(){super(new m4(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},v4={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},w4=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return v4}getAgComponents(){return[of]}init(e,t){this.eEditor=e,this.params=t;const{min:s,max:o,step:i,colDef:n}=t;s!=null&&e.setMin(s),o!=null&&e.setMax(o),i!=null&&e.setStep(i),this.includeTime=t.includeTime??this.getDataTypeService()?.getDateIncludesTimeFlag?.(n.cellDataType),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const{eEditor:e,params:t}=this,s=e.getInputElement().value,o=this.formatDate(this.parseDate(s??void 0)),{min:i,max:n,getValidationErrors:r}=t;let a=[];if(o){const l=new Date(o),c=this.getLocaleTextFunc();if(i){const d=new Date(i);if(l<d){const u=d.toLocaleDateString();a.push(c("minDateValidation",`Date must be after ${u}`,[u]))}}if(n){const d=new Date(n);if(l>d){const u=d.toLocaleDateString();a.push(c("maxDateValidation",`Date must be before ${u}`,[u]))}}}return a.length||(a=null),r?r({value:this.getValue(),cellEditorParams:t,internalErrors:a}):a}getValue(){const{params:e,eEditor:t}=this,s=this.formatDate(t.getDate());return!Y(s)&&!Y(e.value)?e.value:e.parseValue(s??"")}getStartValue(){return Dt(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):wt(e)??void 0}formatDate(e){const t=this.getDataTypeService();return t?t.getDateFormatterFunction(this.params.column)(e):Dt(e??null,this.includeTime??!1)??void 0}},b4=class extends Ia{constructor(){super(new w4(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},S4={tag:"div",cls:"ag-large-text",children:[{tag:"ag-input-text-area",ref:"eEditor",cls:"ag-large-text-input"}]},y4=class extends Da{constructor(){super(S4,[ry]),this.eEditor=ne}initialiseEditor(e){const{eEditor:t}=this,{cellStartedEdit:s,eventKey:o,maxLength:i,cols:n,rows:r}=e;this.focusAfterAttached=s,t.getInputElement().setAttribute("title",""),t.setMaxLength(i||200).setCols(n||60).setRows(r||10);let a;s?(this.focusAfterAttached=!0,o===T.BACKSPACE||o===T.DELETE?a="":o&&o.length===1?a=o:(a=this.getStartValue(e),o!==T.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?.toString()??t}onKeyDown(e){const t=e.key;(t===T.LEFT||t===T.UP||t===T.RIGHT||t===T.DOWN||e.shiftKey&&t===T.ENTER)&&e.stopPropagation()}afterGuiAttached(){const{eEditor:e,focusAfterAttached:t,highlightAllOnFocus:s}=this,o=this.getLocaleTextFunc();e.setInputAriaLabel(o("ariaInputEditor","Input Editor")),t&&(e.getFocusableElement().focus(),s&&e.getInputElement().select())}getValue(){const{eEditor:e,params:t}=this,{value:s}=t,o=e.getValue();return!Y(o)&&!Y(s)?s:t.parseValue(o)}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:s}=e,o=this.getLocaleTextFunc(),i=this.getValue();let n=[];return typeof i=="string"&&t!=null&&i.length>t&&n.push(o("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),n.length||(n=null),s?s({value:i,internalErrors:n,cellEditorParams:e}):n}},x4={tag:"ag-input-number-field",ref:"eEditor",cls:"ag-cell-editor"},R4=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return x4}getAgComponents(){return[ay]}init(e,t){this.eEditor=e,this.params=t;const{max:s,min:o,precision:i,step:n}=t;s!=null&&e.setMax(s),o!=null&&e.setMin(o),i!=null&&e.setPrecision(i),n!=null&&e.setStep(n);const r=e.getInputElement();t.preventStepping?e.addManagedElementListeners(r,{keydown:this.preventStepping}):t.showStepperButtons&&r.classList.add("ag-number-field-input-stepper")}getValidationErrors(){const{params:e}=this,{min:t,max:s,getValidationErrors:o}=e,n=this.eEditor.getInputElement().valueAsNumber,r=this.getLocaleTextFunc();let a=[];return typeof n=="number"&&(t!=null&&n<t&&a.push(r("minValueValidation",`Must be greater than or equal to ${t}.`,[String(t)])),s!=null&&n>s&&a.push(r("maxValueValidation",`Must be less than or equal to ${s}.`,[String(s)]))),a.length||(a=null),o?o({value:n,cellEditorParams:e,internalErrors:a}):a}preventStepping(e){(e.key===T.UP||e.key===T.DOWN)&&e.preventDefault()}getValue(){const{eEditor:e,params:t}=this,s=e.getValue();if(!Y(s)&&!Y(t.value))return t.value;let o=t.parseValue(s);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(){zs()&&this.eEditor.getInputElement().focus({preventScroll:!0})}},F4=class extends Ia{constructor(){super(new R4(()=>this.getLocaleTextFunc()))}},E4={tag:"div",cls:"ag-cell-edit-wrapper",children:[{tag:"ag-select",ref:"eEditor",cls:"ag-cell-editor"}]},D4=class extends Da{constructor(){super(E4,[vy]),this.eEditor=ne,this.startedByEnter=!1}wireBeans(e){this.valueSvc=e.valueSvc}initialiseEditor(e){this.focusAfterAttached=e.cellStartedEdit;const{eEditor:t,valueSvc:s,gos:o}=this,{values:i,value:n,eventKey:r}=e;if(Ge(i)){G(58);return}this.startedByEnter=r!=null?r===T.ENTER:!1;let a=!1;i.forEach(u=>{const h={value:u},p=s.formatValue(e.column,null,u),f=p!=null;h.text=f?p:u,t.addOption(h),a=a||n===u}),a?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:l,valueListMaxWidth:c,valueListMaxHeight:d}=e;l!=null&&t.setPickerGap(l),d!=null&&t.setPickerMaxHeight(d),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:s}=e,o=this.getValue();let i=[];if(t&&!t.includes(o)){const n=this.getLocaleTextFunc();i.push(n("invalidSelectionValidation","Invalid selection."))}else i=null;return s?s({value:o,internalErrors:i,cellEditorParams:e}):i}},P4={tag:"ag-input-text-field",ref:"eEditor",cls:"ag-cell-editor"},M4=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return P4}getAgComponents(){return[xa]}init(e,t){this.eEditor=e,this.params=t;const s=t.maxLength;s!=null&&e.setMaxLength(s)}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:s}=e,o=this.getValue(),i=this.getLocaleTextFunc();let n=[];return t!=null&&typeof o=="string"&&o.length>t&&n.push(i("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),n.length||(n=null),s?s({value:o,cellEditorParams:e,internalErrors:n}):n}getValue(){const{eEditor:e,params:t}=this,s=e.getValue();return!Y(s)&&!Y(t.value)?t.value:t.parseValue(s)}getStartValue(){const e=this.params;return e.useFormatter||e.column.getColDef().refData?e.formatValue(e.value):e.value}setCaret(){zs()&&this.eEditor.getInputElement().focus({preventScroll:!0});const e=this.eEditor,t=e.getValue(),s=Y(t)&&t.length||0;s&&e.getInputElement().setSelectionRange(s,s)}},jh=class extends Ia{constructor(){super(new M4(()=>this.getLocaleTextFunc()))}};function T4(e){return e.ctrlsSvc.getScrollFeature().getVScrollPosition()}function I4(e){return e.ctrlsSvc.getScrollFeature().getHScrollPosition()}function Vm(e,t,s="auto"){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureColumnVisible(t,s),"ensureVisible")}function zm(e,t,s){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureIndexVisible(t,s),"ensureVisible")}function k4(e,t,s=null){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureNodeVisible(t,s),"ensureVisible")}function A4(e){e.undoRedo?.undo("api")}function L4(e){e.undoRedo?.redo("api")}function O4(e,t){return e.editModelSvc?.getEditRowDataValue(t,{checkSiblings:!0})}function N4(e){const t=e.editModelSvc?.getEditMap(),s=[];return t?.forEach((o,i)=>{const{rowIndex:n,rowPinned:r}=i;o.forEach((a,l)=>{const{editorValue:c,pendingValue:d,sourceValue:u,state:h}=a,p=hs(a);let f=c??d;f===zt&&(f=void 0);const C={newValue:f,oldValue:u,state:h,column:l,colId:l.getColId(),colKey:l.getColId(),rowIndex:n,rowPinned:r};(h==="editing"||h==="changed"&&p)&&s.push(C)})}),s}function H4(e,t=!1){const{editSvc:s}=e;if(s?.isBatchEditing()){if(t)for(const o of e.editModelSvc?.getEditPositions()??[])o.state==="editing"&&s.revertSingleCellEdit(o);else Xs(e,{persist:!0});Qo(e,void 0,{cancel:t})}else s?.stopEditing(void 0,{cancel:t,source:"edit",forceStop:!t,forceCancel:t})}function G4(e,t){const s=He(e,t);return e.editSvc?.isEditing(s)??!1}function B4(e,t){const{key:s,colKey:o,rowIndex:i,rowPinned:n}=t,{editSvc:r,colModel:a}=e,l=a.getCol(o);if(!l){G(12,{colKey:o});return}const d=Cs(e,{rowIndex:i,rowPinned:n||null});if(!d){G(290,{rowIndex:i,rowPinned:n});return}if(!l.isCellEditable(d))return;n==null&&zm(e,i),Vm(e,o),r?.startEditing({rowNode:d,column:l},{event:s?new KeyboardEvent("keydown",{key:s}):void 0,source:"api"})}function V4(e){return e.editSvc?.validateEdit()||null}function z4(e){return e.undoRedo?.getCurrentUndoStackSize()??0}function W4(e){return e.undoRedo?.getCurrentRedoStackSize()??0}var _4={tag:"div",cls:"ag-popup-editor",attrs:{tabindex:"-1"}},j4=class extends bd{constructor(e){super(_4),this.params=e}postConstruct(){go(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params,s=o=>{Ac(this.gos,o,t.node,t.column,!0)||t.onKeyDown(o)};this.addManagedElementListeners(e,{keydown:s})}};function U4(e,{column:t},s,o,i="ui"){if(s instanceof KeyboardEvent&&(s.key===T.TAB||s.key===T.ENTER||s.key===T.F2||s.key===T.BACKSPACE&&o))return!0;if(s?.shiftKey&&e.rangeSvc?.getCellRanges().length!=0)return!1;const r=t?.getColDef(),a=$4(e.gos,r),l=s?.type;return l==="click"&&s?.detail===1&&a===1||l==="dblclick"&&s?.detail===2&&a===2?!0:i==="api"?o??!1:!1}function $4(e,t){return e.get("suppressClickEdit")===!0?0:e.get("singleClickEdit")===!0||t?.singleClickEdit?1:2}function Kc(e,{rowNode:t,column:s},o="ui"){const i=s.getColDef().editable,n=e.editModelSvc;return s.isColumnFunc(t,i)||!!n&&n.hasEdits({rowNode:t,column:s},{withOpenEditor:!0})}function K4(e,t,s="ui"){const o=Kc(e,t,s);return o===!0||s==="ui"?o:e.colModel.getCols().some(n=>Kc(e,{rowNode:t.rowNode,column:n},s))}var ta=(e,t=!1)=>{if(e!==void 0)return hs(e)||t&&e.state==="editing"};function Wm(e,t,s=!1){return ta(e.editModelSvc?.getEdit(t),s)}var _m=(e,t,s)=>{if(e)for(let o=0,i=e.length;o<i;++o){const n=e[o];if(n.data&&(ta(t?.getEdit({rowNode:n,column:s}))||ta(t?.getEdit({rowNode:n.pinnedSibling,column:s})))||_m(n.childrenAfterGroup,t,s))return!0}};function jm(e,t){const{column:s,rowNode:o}=t;return e.gos.get("groupTotalRow")&&!o?.footer?!1:_m(o?.childrenAfterGroup,e.editModelSvc,s)}function Um(e,{rowNode:t,column:s}){if(t=t.pinnedSibling,!!t)return ta(e.editModelSvc?.getEdit({rowNode:t,column:s}))}var q4=class extends A{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(){const{cellCtrl:e,editSvc:t,beans:s}=this;if(t?.isBatchEditing()&&t.isEditing()){const i=Wm(s,e)||jm(s,e)||Um(s,e);this.applyBatchingStyle(i)}else this.applyBatchingStyle(!1);const o=!!this.editModelSvc?.getCellValidationModel().hasCellValidation(this.cellCtrl);this.cellComp.toggleCss("ag-cell-editing-error",o)}applyBatchingStyle(e){this.cellComp.toggleCss("ag-cell-editing",e??!1),this.cellComp.toggleCss("ag-cell-batch-edit",(e&&this.editSvc?.isBatchEditing())??!1)}},Y4=class extends A{constructor(e,t){super(),this.rowCtrl=e,this.beans=t,this.gos=t.gos,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}applyRowStyles(){const{rowCtrl:e,editModelSvc:t,beans:s}=this;let o=e.rowNode,i=t?.getEditRow(o);const n=this.editModelSvc?.getRowValidationModel().hasRowValidation({rowNode:o});if(!i&&o.pinnedSibling&&(o=o.pinnedSibling,i=t?.getEditRow(o)),i){const r=Array.from(i.keys()).some(a=>{const l={rowNode:o,column:a};return Wm(s,l,!0)||jm(s,l)||Um(s,l)});this.applyStyle(n,r);return}this.applyStyle(n)}applyStyle(e=!1,t=!1){const s=this.editSvc?.isBatchEditing()??!1,o=this.gos.get("editType")==="fullRow";this.rowCtrl?.forEachGui(void 0,({rowComp:i})=>{i.toggleCss("ag-row-editing",o&&t),i.toggleCss("ag-row-batch-edit",o&&t&&s),i.toggleCss("ag-row-inline-editing",t),i.toggleCss("ag-row-not-inline-editing",!t),i.toggleCss("ag-row-editing-invalid",o&&t&&e)})}},Z4=({rowModel:e,pinnedRowModel:t,editModelSvc:s},o)=>{const i=new Set;e.forEachNode(n=>o.has(n)&&i.add(n)),t?.forEachPinnedRow("top",n=>o.has(n)&&i.add(n)),t?.forEachPinnedRow("bottom",n=>o.has(n)&&i.add(n));for(const n of o)i.has(n)||s.removeEdits({rowNode:n});return i},X4=({editModelSvc:e},t,s)=>{for(const o of t)e?.getEditRow(o)?.forEach((i,n)=>!s.has(n)&&e.removeEdits({rowNode:o,column:n}))},Q4=e=>()=>{const t=new Set(e.colModel.getCols()),s=e.editModelSvc.getEditMap(!0),o=new Set(s.keys());X4(e,Z4(e,o),t)},J4=new Set(["undo","redo","paste","bulk","rangeSvc"]),eM=new Set(["ui","api"]),$m={paste:"api",rangeSvc:"api",fillHandle:"api",cellClear:"api",bulk:"api"},tM=new Set(Object.keys($m)),sM=new Set(["paste","rangeSvc","renderer","cellClear","redo","undo"]),dr={cancel:!0,source:"api"},oM={cancel:!1,source:"api"},No={checkSiblings:!0},Ni={force:!0,suppressFlash:!0},iM=class extends A{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,dr),this.createStrategy(o)});const t=Q4(e),s=()=>{const o=this.model.getCellValidationModel().getCellValidationMap().size>0,i=this.model.getRowValidationModel().getRowValidationMap().size>0;return o||i?this.stopEditing(void 0,dr):this.isEditing()&&(this.isBatchEditing()?Qo(e,this.model.getEditPositions()):this.stopEditing(void 0,oM)),!1};this.addManagedEventListeners({columnPinned:t,columnVisible:t,columnRowGroupChanged:t,rowExpansionStateChanged:t,pinnedRowsChanged:t,displayedRowsChanged:t,sortChanged:s,filterChanged:s,cellFocused:this.onCellFocused.bind(this)})}isBatchEditing(){return this.batch}setBatchEditing(e){e?(this.batch=!0,this.stopEditing(void 0,dr)):(this.stopEditing(void 0,dr),this.batch=!1)}createStrategy(e){const{beans:t,gos:s,strategy:o}=this,i=Uh(s,e);if(o){if(o.beanName===i)return o;this.destroyStrategy()}return this.strategy=this.createOptionalManagedBean(t.registry.createDynamicBean(i,!0))}destroyStrategy(){this.strategy&&(this.strategy.destroy(),this.strategy=this.destroyBean(this.strategy))}shouldStartEditing(e,t,s,o="ui"){const i=U4(this.beans,e,t,s,o);return i&&(this.strategy??(this.strategy=this.createStrategy())),i}shouldStopEditing(e,t,s="ui"){return this.strategy?.shouldStop(e,t,s)??null}shouldCancelEditing(e,t,s="ui"){return this.strategy?.shouldCancel(e,t,s)??null}validateEdit(){return w3(this.beans)}isEditing(e,t){return this.model.hasEdits(e,t??No)}isRowEditing(e,t){return(e&&this.model.hasRowEdits(e,t))??!1}startEditing(e,t){const{startedEdit:s=!0,event:o=null,source:i="ui",ignoreEventKey:n=!1,silent:r}=t;if(this.strategy??(this.strategy=this.createStrategy()),!this.isCellEditable(e,"api"))return;const a=He(this.beans,e);if(a&&!a.comp){a.onCompAttachedFuncs.push(()=>this.startEditing(e,t));return}const l=this.shouldStartEditing(e,o,s,i);if(l===!1&&i!=="api"){this.isEditing(e)&&this.stopEditing();return}!this.batch&&this.shouldStopEditing(e,void 0,i)&&!t.continueEditing&&this.stopEditing(void 0,{source:i}),l&&this.isBatchEditing()&&this.dispatchBatchEvent("batchEditingStarted",new Map),this.strategy.start({position:e,event:o,source:i,ignoreEventKey:n,startedEdit:s,silent:r})}stopEditing(e,t){const{event:s,cancel:o,source:i="ui",forceCancel:n,forceStop:r}=t||{},{beans:a,model:l}=this;if(tM.has(i)&&this.isBatchEditing())return this.bulkRefresh(e),!1;const c=this.committing?$m[i]:i;if(!(this.committing||this.isEditing(e)||this.isBatchEditing()&&l.hasEdits(e,No))||!this.strategy||this.stopping)return!1;this.stopping=!0;const u=He(a,e);u&&(u.onEditorAttachedFuncs=[]);let h=l.getEditMap(!0),p=!1;const f=!o&&(!!this.shouldStopEditing(e,s,c)||this.committing&&!this.batch)||(r??!1),C=o&&!!this.shouldCancelEditing(e,s,c)||(n??!1);if(f||C){Xs(a,{persist:!0,isCancelling:C||o,isStopping:f});const v=l.getEditMap(),w=this.processEdits(v,o,i);this.strategy?.stop(o,s);for(const b of w)l.clearEditValue(b);this.bulkRefresh(void 0,h);for(const b of l.getEditPositions(v)){const S=He(a,b),y=hs(b);S?.refreshCell({force:!0,suppressFlash:!y})}h=v,p||(p=f)}else if(s instanceof KeyboardEvent&&this.batch&&this.strategy?.midBatchInputsAllowed(e)&&this.isEditing(e,{withOpenEditor:!0})){const{key:v}=s,w=v===T.ENTER,b=v===T.ESCAPE,S=v===T.TAB;(w||S||b)&&(w||S?Xs(a,{persist:!0}):b&&this.revertSingleCellEdit(u),this.isBatchEditing()?this.strategy?.cleanupEditors():Qo(a,l.getEditPositions(),{event:s,cancel:b}),s.preventDefault(),this.bulkRefresh(e,h,{suppressFlash:!0}),h=l.getEditMap())}else Xs(a,{persist:!0}),h=l.getEditMap();return p&&e&&this.model.removeEdits(e),this.navigateAfterEdit(t,u?.cellPosition),zc(a),this.model.hasEdits()||(this.model.getCellValidationModel().clearCellValidationMap(),this.model.getRowValidationModel().clearRowValidationMap()),this.bulkRefresh(),C&&this.beans.rowRenderer.refreshRows({rowNodes:Array.from(h.keys())}),this.isBatchEditing()&&(this.beans.rowRenderer.refreshRows({suppressFlash:!0,force:!0}),p&&f&&this.dispatchBatchEvent("batchEditingStopped",h)),this.stopping=!1,p}navigateAfterEdit(e,t){if(!e||!t)return;const{event:s,suppressNavigateAfterEdit:o}=e;if(!(s instanceof KeyboardEvent)||o)return;const{key:n,shiftKey:r}=s,a=this.gos.get("enterNavigatesVerticallyAfterEdit");if(n!==T.ENTER||!a)return;const l=r?T.UP:T.DOWN;this.beans.navigation?.navigateToNextCell(null,l,t,!1)}processEdits(e,t=!1,s){const o=Array.from(e.keys()),i=this.model.getCellValidationModel().getCellValidationMap().size>0||this.model.getRowValidationModel().getRowValidationMap().size>0,n=[];for(const r of o){const a=e.get(r);for(const l of a.keys()){const c=a.get(l),d={rowNode:r,column:l},u=hs(c);!t&&u&&!i&&(this.setNodeDataValue(r,l,c.pendingValue,void 0,s)||n.push(d))}}return n}setNodeDataValue(e,t,s,o,i="edit"){const{beans:n}=this,r=He(n,{rowNode:e,column:t}),a=eM.has(i)?"edit":i;r&&(r.suppressRefreshCell=!0),this.commitNextEdit();const l=e.setDataValue(t,s,a);return r&&(r.suppressRefreshCell=!1),o&&r?.refreshCell(Ni),l}setEditMap(e,t){this.strategy??(this.strategy=this.createStrategy()),this.strategy?.setEditMap(e,t),this.bulkRefresh();let s=Ni;t?.forceRefreshOfEditCellsOnly&&(s={...nM(e),...Ni}),this.beans.rowRenderer.refreshCells(s)}dispatchEditValuesChanged({rowNode:e,column:t},s={}){if(!e||!t||!s)return;const{pendingValue:o,sourceValue:i}=s,{rowIndex:n,rowPinned:r,data:a}=e;this.beans.eventSvc.dispatchEvent({type:"cellEditValuesChanged",node:e,rowIndex:n,rowPinned:r,column:t,source:"api",data:a,newValue:o,oldValue:i,value:o,colDef:t.getColDef()})}bulkRefresh(e={},t,s={}){const{beans:o,gos:i}=this,{editModelSvc:n,rowModel:r}=o;_e(i)&&(e.rowNode&&e.column?this.refCell(e,this.model.getEdit(e),s):t&&n?.getEditMap(!1)?.forEach((a,l)=>{for(const c of a.keys())this.refCell({rowNode:l,column:c},a.get(c),s)}))}refCell({rowNode:e,column:t},s,o={}){const{beans:i,gos:n}=this,r=new Set([e]),a=new Set,l=e.pinnedSibling;l&&r.add(l);const c=e.sibling;c&&a.add(c);let d=e.parent;for(;d;)d.sibling?.footer&&n.get("groupTotalRow")||!d.parent&&d.sibling&&n.get("grandTotalRow")?a.add(d.sibling):a.add(d),d=d.parent;for(const u of r)this.dispatchEditValuesChanged({rowNode:u,column:t},s);for(const u of r)He(i,{rowNode:u,column:t})?.refreshCell(o);for(const u of a)He(i,{rowNode:u,column:t})?.refreshCell(o)}stopAllEditing(e=!1,t="ui"){this.isEditing()&&this.stopEditing(void 0,{cancel:e,source:t})}isCellEditable(e,t="ui"){const{rowNode:s}=e,{gos:o,beans:i}=this;if(s.group){if(o.get("treeData")){if(!s.data&&!o.get("enableGroupEdit"))return!1}else if(!o.get("enableGroupEdit"))return!1}const n=Uh(o)==="fullRow"?K4(i,e,t):Kc(i,e,t);return n&&(this.strategy??(this.strategy=this.createStrategy())),n}cellEditingInvalidCommitBlocks(){return this.gos.get("invalidEditValueMode")==="block"}checkNavWithValidation(e,t,s=!0){if(this.hasValidationErrors(e)){const o=He(this.beans,e);return this.cellEditingInvalidCommitBlocks()?(t?.preventDefault?.(),s&&(!o?.hasBrowserFocus()&&o?.focusCell(),o?.comp?.getCellEditor()?.focusIn?.()),"block-stop"):(o&&this.revertSingleCellEdit(o),"revert-continue")}return"continue"}revertSingleCellEdit(e,t=!1){const s=He(this.beans,e);s?.comp?.getCellEditor()&&(Qo(this.beans,[e],{silent:!0}),this.model.clearEditValue(e),ai(this.beans,e,{silent:!0}),mo(this.beans),s?.refreshCell(Ni),t&&(s?.focusCell(),s?.comp?.getCellEditor()?.focusIn?.()))}hasValidationErrors(e){mo(this.beans);const t=He(this.beans,e);t&&(t.refreshCell(Ni),t.rowCtrl.rowEditStyleFeature?.applyRowStyles());let s=!1;return e?.rowNode?(s||(s=this.model.getRowValidationModel().hasRowValidation({rowNode:e.rowNode})),e.column&&(s||(s=this.model.getCellValidationModel().hasCellValidation({rowNode:e.rowNode,column:e.column})))):(s||(s=this.model.getCellValidationModel().getCellValidationMap().size>0),s||(s=this.model.getRowValidationModel().getRowValidationMap().size>0)),s}moveToNextCell(e,t,s,o="ui"){let i;const n=this.isEditing(),r=n&&this.checkNavWithValidation(void 0,s)==="block-stop";return e instanceof Jo&&n&&(i=this.strategy?.moveToNextEditingCell(e,t,s,o,r)),i===null||(i=i||!!this.beans.focusSvc.focusedHeader,i===!1&&!r&&this.stopEditing()),i}getCellDataValue({rowNode:e,column:t},s=!0){if(!e||!t)return;let o=this.model.getEdit({rowNode:e,column:t});const i=e.pinnedSibling;if(i){const r=this.model.getEdit({rowNode:i,column:t});r&&(o=r)}const n=s?o?.editorValue??o?.pendingValue:o?.pendingValue;return n===zt||!o?o?.sourceValue??this.valueSvc.getValue(t,e,!1,"api"):n}addStopEditingWhenGridLosesFocus(e){g3(this,this.beans,e)}createPopupEditorWrapper(e){return new j4(e)}commitNextEdit(){this.committing=!0}setDataValue(e,t,s){try{if((!this.isEditing()||this.committing)&&!sM.has(s))return;const{beans:o}=this;this.strategy??(this.strategy=this.createStrategy());const i=this.isBatchEditing()?"ui":this.committing?s??"api":"api";if(!s||J4.has(s))return Pr(o,e,t,s,void 0,{persist:!0}),this.setNodeDataValue(e.rowNode,e.column,t,!0,s);const n=this.model.getEdit(e);if(n){if(n.pendingValue===t)return!1;if(n.sourceValue!==t)return Pr(o,e,t,s,void 0,{persist:!0}),this.stopEditing(e,{source:i,suppressNavigateAfterEdit:!0}),!0;if(n.sourceValue===t)return o.editModelSvc?.removeEdits(e),this.dispatchEditValuesChanged(e,{...n,pendingValue:t}),!0}return Pr(o,e,t,s,void 0,{persist:!0}),this.stopEditing(e,{source:i,suppressNavigateAfterEdit:!0}),!0}finally{this.committing=!1}}handleColDefChanged(e){m3(this.beans,e)}destroy(){this.model.clear(),this.destroyStrategy(),super.destroy()}prepDetailsDuringBatch(e,t){if(!this.batch||!this.model.hasRowEdits(e.rowNode,No))return;const{rowNode:o,column:i}=e,{compDetails:n,valueToDisplay:r}=t;if(n){const{params:l}=n;return l.data=this.model.getEditRowDataValue(o,No),{compDetails:n}}const a=this.model.getEditRow(e.rowNode,No);if(r!==void 0&&a?.has(i))return{valueToDisplay:this.valueSvc.getValue(i,o)}}cleanupEditors(){this.strategy?.cleanupEditors()}dispatchCellEvent(e,t,s,o){this.strategy?.dispatchCellEvent(e,t,s,o)}dispatchBatchEvent(e,t){this.eventSvc.dispatchEvent(this.createBatchEditEvent(e,t))}createBatchEditEvent(e,t){return he(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},s){if(!s||s.length===0)return;const{beans:o,rangeSvc:i,valueSvc:n}=this;Xs(o,{persist:!0});const r=this.model.getEditMap(!0),a=r.get(e)?.get(t)?.pendingValue;this.batch||this.eventSvc.dispatchEvent({type:"bulkEditingStarted"}),s.forEach(c=>{if(i?.forEachRowInRange(c,d=>{const u=Cs(o,d);if(u===void 0)return;const h=r.get(u)??new Map;for(const p of c.columns)if(p&&this.isCellEditable({rowNode:u,column:p},"api")){const f=n.getValue(p,u,!0,"api");let C=n.parseValue(p,u??null,a,f);Number.isNaN(C)&&(C=null),h.set(p,{editorValue:void 0,pendingValue:C,sourceValue:f,state:"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}h.size>0&&r.set(u,h)}),this.setEditMap(r),this.batch){this.cleanupEditors(),zc(o),this.bulkRefresh();return}this.commitNextEdit(),this.stopEditing(void 0,{source:"bulk"}),this.eventSvc.dispatchEvent({type:"bulkEditingStopped",changes:this.toEventChangeList(r)})}),this.bulkRefresh();const l=He(o,{rowNode:e,column:t});l&&l.focusCell(!0)}createCellStyleFeature(e,t){return new q4(e,t)}createRowStyleFeature(e,t){return new Y4(e,t)}setEditingCells(e,t){const{beans:s}=this,{colModel:o,valueSvc:i}=s,n=new Map;for(let{colId:r,column:a,colKey:l,rowIndex:c,rowPinned:d,newValue:u,state:h}of e){const p=r?o.getCol(r):l?o.getCol(l):a;if(!p)continue;const f=Cs(s,{rowIndex:c,rowPinned:d});if(!f)continue;const C=i.getValue(p,f,!0,"api");if(!t?.forceRefreshOfEditCellsOnly&&!hs({pendingValue:u,sourceValue:C})&&h!=="editing")continue;let v=n.get(f);v||(v=new Map,n.set(f,v)),u===void 0&&(u=zt),v.set(p,{editorValue:void 0,pendingValue:u,sourceValue:C,state:h??"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}this.setEditMap(n,t)}onCellFocused(e){const t=He(this.beans,e);if(!t||!this.isEditing(t,No))return;const s=this.model.getEdit(t);if(!s||!hs(s))return;const i=this.getLocaleTextFunc()("ariaPendingChange","Pending Change");this.beans.ariaAnnounce?.announceValue(i,"pendingChange")}allowedFocusTargetOnValidation(e){return He(this.beans,e)}};function nM(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 Uh(e,t){return t??e.get("editType")??"singleCell"}var Km=class extends A{postConstruct(){this.model=this.beans.editModelSvc,this.editSvc=this.beans.editSvc,this.addManagedEventListeners({cellFocused:this.onCellFocusChanged?.bind(this),cellFocusCleared:this.onCellFocusChanged?.bind(this)})}clearEdits(e){this.model.clearEditValue(e)}onCellFocusChanged(e){let t;const s=e.previousParams,{editSvc:o,beans:i}=this,n=e.type==="cellFocused"?e.sourceEvent:null;s&&(t=He(i,s));const{gos:r,editModelSvc:a}=i,l=e.type==="cellFocusCleared";if(o.isEditing(void 0,{withOpenEditor:!0})){const{column:c,rowIndex:d,rowPinned:u}=e,h={column:c,rowNode:Cs(i,{rowIndex:d,rowPinned:u})},p=r.get("invalidEditValueMode")==="block";if(p)return;const f=!p,C=!!a?.getCellValidationModel().hasCellValidation(h),v=f&&C;(s||l?o.stopEditing(void 0,{cancel:v,source:l&&f?"api":void 0,event:n}):!0)||(o.isBatchEditing()?o.cleanupEditors():o.stopEditing(void 0,{source:"api"}))}t?.refreshCell({suppressFlash:!0,force:!0})}stop(e,t){const s=this.model.getEditPositions(),o={all:[],pass:[],fail:[]};for(const i of s){if(o.all.push(i),(this.model.getCellValidationModel().getCellValidation(i)?.errorMessages?.length??0)>0){o.fail.push(i);continue}o.pass.push(i)}if(e)for(const i of s)Qr(this.beans,i,{cancel:e}),this.model.stop(i);else{const i=this.processValidationResults(o);if(i.destroy.length>0)for(const n of i.destroy)Qr(this.beans,n,{event:t,cancel:e}),this.model.stop(n);if(i.keep.length>0)for(const n of i.keep){const r=He(this.beans,n);this.editSvc?.cellEditingInvalidCommitBlocks()||r&&this.editSvc.revertSingleCellEdit(r)}}return!0}cleanupEditors({rowNode:e}={},t){Xs(this.beans,{persist:!1});const s=this.model.getEditPositions(),o=[];if(e)for(const i of s)i.rowNode!==e&&o.push(i);else for(const i of s)o.push(i);Qo(this.beans,o),zc(this.beans,t)}setFocusOutOnEditor(e){e.comp?.getCellEditor()?.focusOut?.()}setFocusInOnEditor(e){const t=e.comp,s=t?.getCellEditor();if(s?.focusIn)s.focusIn();else{const o=this.beans.gos.get("editType")==="fullRow";e.focusCell(o),e.onEditorAttachedFuncs.push(()=>t?.getCellEditor()?.focusIn?.())}}setupEditors(e){const{event:t,ignoreEventKey:s=!1,startedEdit:o,position:i,cells:n=this.model.getEditPositions()}=e,r=t instanceof KeyboardEvent&&!s&&t.key||void 0;f3(this.beans,n,i,r,t,o)}dispatchCellEvent(e,t,s,o){const i=He(this.beans,e);i&&this.eventSvc.dispatchEvent({...i.createEvent(t??null,s),...o})}dispatchRowEvent(e,t,s){if(s)return;const o=zd(this.beans,e);o&&this.eventSvc.dispatchEvent(o.createRowEvent(t))}shouldStop(e,t,s="ui"){const o=this.editSvc.isBatchEditing();return o&&s==="api"?!0:o&&(s==="ui"||s==="edit")?!1:s==="api"?!0:t instanceof KeyboardEvent&&!o?t.key===T.ENTER:null}shouldCancel(e,t,s="ui"){const o=this.editSvc.isBatchEditing();return!!(t instanceof KeyboardEvent&&!o&&t.key===T.ESCAPE||o&&s==="api"||s==="api")}setEditMap(e,t){t?.update||this.editSvc.stopEditing(void 0,{cancel:!0,source:"api"});const s=[];if(e.forEach((o,i)=>{o.forEach((n,r)=>{n.state==="editing"&&s.push({...n,rowNode:i,column:r})})}),t?.update&&(e=new Map([...this.model.getEditMap(),...e])),this.model?.setEditMap(e),s.length>0){const o=s.at(-1),i=o.pendingValue===zt?void 0:o.pendingValue;this.start({position:o,event:new KeyboardEvent("keydown",{key:i}),source:"api"});const n=He(this.beans,o);n&&this.setFocusInOnEditor(n)}}destroy(){this.cleanupEditors(),super.destroy()}},rM=class extends Km{constructor(){super(...arguments),this.beanName="fullRow",this.startedRows=[]}shouldStop(e,t,s="ui"){const{rowNode:o}=e||{};if(!zd(this.beans,{rowNode:this.rowNode}))return!0;const n=super.shouldStop({rowNode:this.rowNode},t,s);return n!==null?n: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:s,startedEdit:o,event:i,ignoreEventKey:n}=e,{rowNode:r}=t;this.rowNode!==r&&super.cleanupEditors(t),this.dispatchRowEvent({rowNode:r},"rowEditingStarted",s),this.startedRows.push(r);const a=this.beans.visibleCols.allCols,l=[];for(const c of a){if(!c.isCellEditable(r))continue;const d={rowNode:r,column:c};l.push(d),this.model.hasEdits(d)||this.model.start(d)}this.rowNode=r,this.setupEditors({cells:l,position:t,startedEdit:o,event:i,ignoreEventKey:n})}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){const{rowNode:s}=this;if(s&&!this.model.hasRowEdits(s))return!1;const o=[];if(e||this.model.getEditMap().forEach((i,n)=>{if(!(!i||i.size===0)){for(const r of i.values())if(hs(r)){o.push(n);break}}}),mo(this.beans),!e&&this.editSvc?.checkNavWithValidation({rowNode:s})==="block-stop")return!1;super.stop(e,t);for(const i of o)this.dispatchRowEvent({rowNode:i},"rowValueChanged");return this.cleanupEditors({rowNode:s},!0),this.rowNode=void 0,!0}onCellFocusChanged(e){const{rowIndex:t}=e,s=e.previousParams;if(s?.rowIndex===t||e.sourceEvent instanceof KeyboardEvent)return;const o=He(this.beans,s);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 s of this.startedRows)this.dispatchRowEvent({rowNode:s},"rowEditingStopped");this.startedRows.length=0}moveToNextEditingCell(e,t,s,o="ui",i=!1){const n=e.cellPosition;let r;this.model.suspend(!0);try{r=this.beans.navigation?.findNextCellToFocusOn(n,{backwards:t,startEditing:!0,skipToNextEditableCell:!1})}finally{this.model.suspend(!1)}if(r===!1)return null;if(r==null)return!1;const a=r.cellPosition,l=e.isCellEditable(),c=r.isCellEditable(),d=a&&n.rowIndex===a.rowIndex&&n.rowPinned===a.rowPinned;l&&this.setFocusOutOnEditor(e),this.restoreEditors();const u=this.gos.get("suppressStartEditOnTab");return c&&!i?u?r.focusCell(!0,s):(r.comp?.getCellEditor()||ai(this.beans,r,{event:s,cellStartedEdit:!0}),this.setFocusInOnEditor(r),r.focusCell(!1,s)):(c&&i&&this.setFocusInOnEditor(r),r.focusCell(!0,s)),!d&&!i&&(this.editSvc?.stopEditing({rowNode:e.rowNode},{event:s}),this.cleanupEditors(r,!0),u?r.focusCell(!0,s):this.editSvc.startEditing(r,{startedEdit:!0,event:s,source:o,ignoreEventKey:!0})),e.rowCtrl?.refreshRow({suppressFlash:!0,force:!0}),!0}restoreEditors(){this.model.getEditMap().forEach((e,t)=>e.forEach(({state:s},o)=>{if(s!=="editing")return;const i=He(this.beans,{rowNode:t,column:o});i&&!i.comp?.getCellEditor()&&ai(this.beans,i,{silent:!0})}))}destroy(){super.destroy(),this.rowNode=void 0,this.startedRows.length=0}},aM=class extends Km{constructor(){super(...arguments),this.beanName="singleCell"}shouldStop(e,t,s="ui"){const o=super.shouldStop(e,t,s);if(o!==null)return o;const{rowNode:i,column:n}=e||{};return(!this.rowNode||!this.column)&&i&&n?null:this.rowNode!==i||this.column!==n}midBatchInputsAllowed(e){return this.model.hasEdits(e)}start(e){const{position:t,startedEdit:s,event:o,ignoreEventKey:i}=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:s,event:o,ignoreEventKey:i})}dispatchRowEvent(e,t,s){}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:s}=this.beans,{rowIndex:o,column:i,rowPinned:n}=e,r=Cs(this.beans,{rowIndex:o,rowPinned:n}),a=Vc(i),l=t.getCol(a),c=e.previousParams;if(c){const d=Vc(c.column);if(c?.rowIndex===o&&d===a&&c?.rowPinned===n)return}s?.isEditing({rowNode:r,column:l},{withOpenEditor:!0})&&e.type==="cellFocused"||super.onCellFocusChanged(e)}moveToNextEditingCell(e,t,s,o="ui",i=!1){const n=this.beans.focusSvc.getFocusedCell();n&&(e=Wo(this.beans,n)??e);const r=e.cellPosition;let a;const l=this.beans.gos.get("editType")==="fullRow";l&&this.model.suspend(!0),i||(e.eGui.focus(),this.editSvc?.stopEditing(e,{source:this.editSvc?.isBatchEditing()?"ui":"api",event:s}));try{a=this.beans.navigation?.findNextCellToFocusOn(r,{backwards:t,startEditing:!0})}finally{l&&this.model.suspend(!1)}if(a===!1)return null;if(a==null)return!1;const c=a.cellPosition,d=e.isCellEditable(),u=a.isCellEditable(),h=c&&r.rowIndex===c.rowIndex&&r.rowPinned===c.rowPinned;d&&!i&&this.setFocusOutOnEditor(e);const p=this.gos.get("suppressStartEditOnTab");if(!h&&!i&&(super.cleanupEditors(a,!0),p?a.focusCell(!0,s):this.editSvc.startEditing(a,{startedEdit:!0,event:s,source:o,ignoreEventKey:!0})),u&&!i){if(a.focusCell(!1,s),p)a.focusCell(!0,s);else if(!a.comp?.getCellEditor()){const f=this.editSvc?.isEditing(a,{withOpenEditor:!0});ai(this.beans,a,{event:s,cellStartedEdit:!0,silent:f}),this.setFocusInOnEditor(a),this.cleanupEditors(a)}}else u&&i&&this.setFocusInOnEditor(a),a.focusCell(!0,s);return e.rowCtrl?.refreshRow({suppressFlash:!0,force:!0}),!0}destroy(){super.destroy(),this.rowNode=void 0,this.column=void 0}},_s={moduleName:"EditCore",version:K,beans:[h3,iM],apiFunctions:{getEditingCells:N4,getEditRowValues:O4,getCellEditorInstances:p3,startEditingCell:B4,stopEditing:H4,isEditing:G4,validateEdit:V4},dynamicBeans:{singleCell:aM,fullRow:rM},dependsOn:[Ma,Bm],css:[h4]},lM={moduleName:"UndoRedoEdit",version:K,beans:[u4],apiFunctions:{undoCellEditing:A4,redoCellEditing:L4,getCurrentUndoSize:z4,getCurrentRedoSize:W4},dependsOn:[_s]},cM={moduleName:"TextEditor",version:K,userComponents:{agCellEditor:jh,agTextCellEditor:jh},dependsOn:[_s]},dM={moduleName:"NumberEditor",version:K,userComponents:{agNumberCellEditor:{classImp:F4}},dependsOn:[_s]},uM={moduleName:"DateEditor",version:K,userComponents:{agDateCellEditor:C4,agDateStringCellEditor:b4},dependsOn:[_s]},hM={moduleName:"CheckboxEditor",version:K,userComponents:{agCheckboxCellEditor:p4},dependsOn:[_s]},gM={moduleName:"SelectEditor",version:K,userComponents:{agSelectCellEditor:D4},dependsOn:[_s]},pM={moduleName:"LargeTextEditor",version:K,userComponents:{agLargeTextCellEditor:y4},dependsOn:[_s]},fM={moduleName:"CustomEditor",version:K,dependsOn:[_s]},mM=class extends A{constructor(){super(...arguments),this.beanName="selectionColSvc"}postConstruct(){this.addManagedPropertyListener("rowSelection",e=>{this.onSelectionOptionsChanged(e.currentValue,e.previousValue,Ko(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),j0(e))}createColumns(e,t){const s=()=>{_r(this.beans,this.columns?.tree),this.columns=null},o=e.treeDepth,n=(this.columns?.treeDepth??-1)==o,r=this.generateSelectionCols();if(_0(r,this.columns?.list??[])&&n)return;s();const{colGroupSvc:l}=this.beans,c=l?.findDepth(e.tree)??0,d=l?.balanceTreeForAutoCols(r,c)??[];this.columns={list:r,tree:d,treeDepth:c,map:{}},t(h=>{if(!h)return null;const p=h.filter(f=>!ys(f));return[...r,...p]})}updateColumns(e){const t=Ko(e.source);for(const s of this.columns?.list??[]){const o=this.createSelectionColDef(e.currentValue);s.setColDef(o,null,t),_t(this.beans,{state:[{...o,colId:s.getColId()}]},t)}}getColumn(e){return this.columns?.list.find(t=>Xi(t,e))??null}getColumns(){return this.columns?.list??null}isSelectionColumnEnabled(){const{gos:e,beans:t}=this,s=e.get("rowSelection");if(typeof s!="object"||!so(e))return!1;const o=(t.autoColSvc?.getColumns()?.length??0)>0;if(s.checkboxLocation==="autoGroupColumn"&&o)return!1;const i=!!$o(s),n=vr(s);return i||n}createSelectionColDef(e){const{gos:t}=this,s=e??t.get("selectionColumnDef"),o=t.get("enableRtl"),{rowSpan:i,spanRows:n,...r}=s??{};return{width:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:o?"right":"left",comparator(a,l,c,d){const u=c.isSelected(),h=d.isSelected();return u===h?0:u?1:-1},editable:!1,suppressFillHandle:!0,pinned:null,...r,colId:Lp,chartDataType:"excluded"}}generateSelectionCols(){if(!this.isSelectionColumnEnabled())return[];const e=this.createSelectionColDef(),t=e.colId;this.gos.validateColDef(e,t,!0);const s=new yo(e,null,t,!1);return this.createBean(s),[s]}onSelectionOptionsChanged(e,t,s){const o=t&&typeof t!="string"?$o(t):void 0,i=e&&typeof e!="string"?$o(e):void 0,n=o!==i,r=t&&typeof t!="string"?vr(t):void 0,a=e&&typeof e!="string"?vr(e):void 0,l=r!==a,c=Br(e),d=Br(t);(n||l||c!==d)&&this.beans.colModel.refreshAll(s)}destroy(){_r(this.beans,this.columns?.tree),super.destroy()}refreshVisibility(e,t,s){if(!this.columns?.list.length)return;const o=e.length+t.length+s.length;if(o===0)return;const i=this.columns.list[0];if(!i.isVisible())return;const n=()=>{let l;switch(i.pinned){case"left":case!0:l=e;break;case"right":l=s;break;default:l=t}l&&jt(l,i)};(this.beans.rowNumbersSvc?.getColumn(Op)?2:1)===o&&n()}};function CM(e,t){if(!t.nodes.every(r=>r.rowPinned&&!Mn(r)?(G(59),!1):r.id===void 0?(G(60),!1):!0))return;const{nodes:o,source:i,newValue:n}=t;e.selectionSvc?.setNodesSelected({nodes:o,source:i??"api",newValue:n})}function vM(e,t,s="apiSelectAll"){e.selectionSvc?.selectAllRowNodes({source:s,selectAll:t})}function wM(e,t,s="apiSelectAll"){e.selectionSvc?.deselectAllRowNodes({source:s,selectAll:t})}function bM(e,t="apiSelectAllFiltered"){e.selectionSvc?.selectAllRowNodes({source:t,selectAll:"filtered"})}function SM(e,t="apiSelectAllFiltered"){e.selectionSvc?.deselectAllRowNodes({source:t,selectAll:"filtered"})}function yM(e,t="apiSelectAllCurrentPage"){e.selectionSvc?.selectAllRowNodes({source:t,selectAll:"currentPage"})}function xM(e,t="apiSelectAllCurrentPage"){e.selectionSvc?.deselectAllRowNodes({source:t,selectAll:"currentPage"})}function RM(e){return e.selectionSvc?.getSelectedNodes()??[]}function FM(e){return e.selectionSvc?.getSelectedRows()??[]}var EM=class extends qR{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=Vr(e),this.groupSelectsDescendants=gn(e),this.groupSelectsFiltered=Wr(e)==="filteredDescendants",this.masterSelectsDetail=Nu(e)==="detail",this.addManagedPropertyListeners(["groupSelectsChildren","groupSelectsFiltered","rowSelection"],()=>{const t=gn(e),s=Vr(e),o=Wr(e)==="filteredDescendants";this.masterSelectsDetail=Nu(e)==="detail",(t!==this.groupSelectsDescendants||o!==this.groupSelectsFiltered||s!==this.mode)&&(this.deselectAllRowNodes({source:"api"}),this.groupSelectsDescendants=t,this.groupSelectsFiltered=o,this.mode=s)}),this.addManagedEventListeners({rowSelected:this.onRowSelected.bind(this)})}destroy(){super.destroy(),this.resetNodes()}handleSelectionEvent(e,t,s){if(this.isRowSelectionBlocked(t))return 0;const o=this.inferNodeSelections(t,e.shiftKey,e.metaKey||e.ctrlKey,s);if(o==null)return 0;if(this.selectionCtx.selectAll=!1,"select"in o)return o.reset?this.resetNodes():this.selectRange(o.deselect,!1,s),this.selectRange(o.select,!0,s);{const i=o.checkFilteredNodes?Ym(o.node):o.newValue;return this.setNodesSelected({nodes:[o.node],newValue:i,clearSelection:o.clearSelection,keepDescendants:o.keepDescendants,event:e,source:s})}}setNodesSelected({newValue:e,clearSelection:t,suppressFinishActions:s,nodes:o,event:i,source:n,keepDescendants:r=!1}){if(o.length===0)return 0;const{gos:a}=this;if(!so(a)&&e)return G(132),0;if(o.length>1&&!this.isMultiSelect())return G(130),0;let l=0;for(let c=0;c<o.length;c++){const d=o[c],u=Ho(d);if(u.rowPinned&&!Mn(u)){G(59);continue}if(u.id===void 0){G(60);continue}this.groupSelectsFiltered&&u.group&&!a.get("treeData")||this.selectRowNode(u,e,i,n)&&(this.detailSelection.delete(u.id),l++),this.groupSelectsDescendants&&u.childrenAfterGroup?.length&&(l+=this.selectChildren(u,e,n))}return s||(o.length===1&&n==="api"&&this.selectionCtx.setRoot(Ho(o[0])),e&&(t||!this.isMultiSelect())&&(l+=this.clearOtherNodes(Ho(o[0]),r,n)),l>0&&(this.updateGroupsFromChildrenSelections(n),this.dispatchSelectionChanged(n))),l}selectRange(e,t,s){let o=0;return e.forEach(i=>{const n=Ho(i);if(n.group&&this.groupSelectsDescendants)return;this.selectRowNode(n,t,void 0,s)&&o++}),o>0&&(this.updateGroupsFromChildrenSelections(s),this.dispatchSelectionChanged(s)),o}selectChildren(e,t,s){const o=this.groupSelectsFiltered?e.childrenAfterAggFilter:e.childrenAfterGroup;return o?this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,source:s,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((s,o)=>{e(s)&&t.set(o,s)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsDescendants)return!1;const{gos:s,rowModel:o}=this.beans;if(!_e(s))return!1;const i=o.rootNode;if(!i)return!1;t||(t=new mn(!0,i),t.active=!1);let n=!1;return t.forEachChangedNodeDepthFirst(r=>{if(r!==i){const a=this.calculateSelectedFromChildren(r);n=this.selectRowNode(r,a===null?!1:a,void 0,e)||n}}),n}clearOtherNodes(e,t,s){const o=new Map;let i=0;return this.selectedNodes.forEach(n=>{const r=n.id==e.id;if((t?!PM(e,n):!0)&&!r){const l=this.selectedNodes.get(n.id);i+=this.setNodesSelected({nodes:[l],newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:s}),this.groupSelectsDescendants&&n.parent&&o.set(n.parent.id,n.parent)}}),o.forEach(n=>{const r=this.calculateSelectedFromChildren(n);this.selectRowNode(n,r===null?!1:r,void 0,s)}),i}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 Bs(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(!_e(e))return;const s=t.getTopLevelNodes();if(s===null)return;const o=[];function i(n){for(let r=0,a=n.length;r<a;r++){const l=n[r];l.isSelected()?o.push(l):l.group&&l.childrenAfterGroup&&i(l.childrenAfterGroup)}}return i(s),o}isEmpty(){return this.getSelectionCount()===0}deselectAllRowNodes({source:e,selectAll:t}){const s=_e(this.gos);let o=!1;const i=n=>{const r=this.selectRowNode(Ho(n),!1,void 0,e);o||(o=r)};if(t==="currentPage"||t==="filtered"){if(!s){Te(102);return}this.getNodesToSelect(t).forEach(i)}else this.selectedNodes.forEach(i),this.reset(e);if(this.selectionCtx.selectAll=!1,s&&this.groupSelectsDescendants){const n=this.updateGroupsFromChildrenSelections(e);o||(o=n)}o&&this.dispatchSelectionChanged(e)}getSelectedCounts(e){let t=0,s=0;return this.getNodesToSelect(e).forEach(o=>{this.groupSelectsDescendants&&o.group||(o.isSelected()?t++:o.selectable&&s++)}),{selectedCount:t,notSelectedCount:s}}getSelectAllState(e){const{selectedCount:t,notSelectedCount:s}=this.getSelectedCounts(e);return qm(t,s)??null}hasNodesToSelect(e){return this.getNodesToSelect(e).filter(t=>t.selectable).length>0}getNodesToSelect(e){if(!this.canSelectAll())return[];const t=[],s=i=>t.push(i);if(e==="currentPage")return this.forEachNodeOnPage(i=>{if(!i.group){s(i);return}if(!i.expanded&&!i.footer){const n=r=>{s(r),r.childrenAfterFilter?.forEach(n)};n(i);return}this.groupSelectsDescendants||s(i)}),t;const o=this.beans.rowModel;return e==="filtered"?(o.forEachNodeAfterFilter(s),t):(o.forEachNode(s),t)}forEachNodeOnPage(e){const{pageBounds:t,rowModel:s}=this.beans,o=t.getFirstRow(),i=t.getLastRow();for(let n=o;n<=i;n++){const r=s.getRow(n);r&&e(r)}}selectAllRowNodes(e){const{gos:t,selectionCtx:s}=this;if(!so(t)){G(132);return}if(P0(t)&&!zr(t)){G(130);return}if(!this.canSelectAll())return;const{source:o,selectAll:i}=e;let n=!1;if(this.getNodesToSelect(i).forEach(r=>{const a=this.selectRowNode(Ho(r),!0,void 0,o);n||(n=a)}),s.selectAll=!0,_e(t)&&this.groupSelectsDescendants){const r=this.updateGroupsFromChildrenSelections(o);n||(n=r)}n&&this.dispatchSelectionChanged(o)}getSelectionState(){return this.isEmpty()?null:Array.from(this.selectedNodes.keys())}setSelectionState(e,t,s){if(e||(e=[]),!Array.isArray(e)){Te(103);return}const o=new Set(e),i=[];this.beans.rowModel.forEachNode(n=>{o.has(n.id)&&i.push(n)}),s&&this.resetNodes(),this.setNodesSelected({newValue:!0,nodes:i,source:t})}canSelectAll(){return _e(this.beans.gos)}updateSelectable(e){const{gos:t,rowModel:s}=this.beans;if(!so(t))return;const o="selectableChanged",i=e!==void 0,n=_e(t)&&this.groupSelectsDescendants,r=[],a=l=>{if(i&&!l.group)return;if(n&&l.group){const d=l.childrenAfterGroup?.some(u=>u.selectable)??!1;this.setRowSelectable(l,d,!0);return}!this.updateRowSelectable(l,!0)&&l.isSelected()&&r.push(l)};if(n){if(e===void 0){const l=s.rootNode;e=l?new mn(!1,l):void 0}e?.forEachChangedNodeDepthFirst(a,!i,!i)}else s.forEachNode(a);r.length&&this.setNodesSelected({nodes:r,newValue:!1,source:o}),!i&&n&&this.updateGroupsFromChildrenSelections?.(o)}updateSelectableAfterGrouping(e){this.updateSelectable(e),this.groupSelectsDescendants&&this.updateGroupsFromChildrenSelections?.("rowGroupChanged",e)&&this.dispatchSelectionChanged("rowGroupChanged")}refreshMasterNodeState(e,t){if(!this.masterSelectsDetail)return;const s=e.detailNode?.detailGridInfo?.api;if(!s)return;const o=DM(s);if(e.isSelected()!==o&&this.selectRowNode(e,o,t,"masterDetail")&&this.dispatchSelectionChanged("masterDetail"),!o){const n=this.detailSelection.get(e.id)??new Set;for(const r of s.getSelectedNodes())n.add(r.id);this.detailSelection.set(e.id,n)}}setDetailSelectionState(e,t,s){if(this.masterSelectsDetail){if(!zr(t)){G(269);return}switch(e.isSelected()){case!0:{s.selectAll();break}case!1:{s.deselectAll();break}case void 0:{const o=this.detailSelection.get(e.id);if(o){const i=[];for(const n of o){const r=s.getRowNode(n);r&&i.push(r)}s.setNodesSelected({nodes:i,newValue:!0,source:"masterDetail"})}break}}}}dispatchSelectionChanged(e){this.eventSvc.dispatchEvent({type:"selectionChanged",source:e,selectedNodes:this.getSelectedNodes(),serverSideState:null})}};function Ho(e){return Mn(e)?e.pinnedSibling:e.footer?e.sibling:e}function DM(e){let t=0,s=0;return e.forEachNode(o=>{o.isSelected()?t++:o.selectable&&s++}),qm(t,s)}function qm(e,t){if(e===0&&t===0)return!1;if(!(e>0&&t>0))return e>0}function PM(e,t){let s=t.parent;for(;s;){if(s===e)return!0;s=s.parent}return!1}function Ym(e){const t=e.isSelected()===!1,s=e.childrenAfterFilter?.some(Ym)??!1;return t||s}var MM={moduleName:"SharedRowSelection",version:K,beans:[mM],apiFunctions:{setNodesSelected:CM,selectAll:vM,deselectAll:wM,selectAllFiltered:bM,deselectAllFiltered:SM,selectAllOnCurrentPage:yM,deselectAllOnCurrentPage:xM,getSelectedNodes:RM,getSelectedRows:FM}},TM={moduleName:"RowSelection",version:K,rowModels:["clientSide","infinite","viewport"],beans:[EM],dependsOn:[MM]};function IM(e){e.expansionSvc?.expandAll(!0)}function kM(e){e.expansionSvc?.expandAll(!1)}function Zm(e){e.rowModel?.onRowHeightChanged()}function Xm(e){if(e.rowAutoHeight?.active){G(3);return}e.rowModel?.resetRowHeights()}function AM(e,t,s){const o=AP(e);if(o){if(e.rowGroupColsSvc?.columns.length===0){if(t<0){Te(238);return}o.setRowCount(t,s);return}Te(28);return}Pa(e)?.setRowCount(t,s)}function LM(e){return So(e.gos)?e.rowModel.getBlockStates():e.rowNodeBlockLoader?.getBlockState()??{}}function OM(e){return e.rowModel.isLastRowIndexKnown()}var NM={moduleName:"CsrmSsrmSharedApi",version:K,apiFunctions:{expandAll:IM,collapseAll:kM}},HM={moduleName:"RowModelSharedApi",version:K,apiFunctions:{onRowHeightChanged:Zm,resetRowHeights:Xm}},GM={moduleName:"SsrmInfiniteSharedApi",version:K,apiFunctions:{setRowCount:AM,getCacheBlockState:LM,isLastRowIndexKnown:OM}},BM=class extends A{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=>{if(!o){Te(18),t||Te(20);return}if(this.isGridApi(o))return o;const i=o;return"current"in i?i.current?.api:(i.api||Te(19),i.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 s=[];return e.columns?e.columns.forEach(o=>{s.push(t(o))}):e.column&&s.push(t(e.column)),s}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":G(21);break}})}processGroupOpenedEvent(e){const{colGroupSvc:t}=this.beans;if(t)for(const s of e.columnGroups){let o=null;s&&(o=t.getProvidedColGroup(s.getGroupId())),!(s&&!o)&&t.setColumnGroupOpened(o,s.isExpanded(),"alignedGridChanged")}}processColumnEvent(e){const t=e.column;let s=null;const o=this.beans,{colResize:i,ctrlsSvc:n,colModel:r}=o;if(t&&(s=r.getColDefCol(t.getColId())),t&&!s)return;const a=this.getMasterColumns(e);switch(e.type){case"columnMoved":{const u=e.api.getColumnState().map(h=>({colId:h.colId}));_t(o,{state:u,applyOrder:!0},"alignedGridChanged")}break;case"columnVisible":{const u=e.api.getColumnState().map(h=>({colId:h.colId,hide:h.hide}));_t(o,{state:u},"alignedGridChanged")}break;case"columnPinned":{const u=e.api.getColumnState().map(h=>({colId:h.colId,pinned:h.pinned}));_t(o,{state:u},"alignedGridChanged")}break;case"columnResized":{const d=e,u={};for(const h of a)u[h.getId()]={key:h.getColId(),newWidth:h.getActualWidth()};for(const h of d.flexColumns??[])u[h.getId()]&&delete u[h.getId()];i?.setColumnWidths(Object.values(u),!1,d.finished,"alignedGridChanged");break}}const c=n.getGridBodyCtrl().isVerticalScrollShowing();for(const d of this.getAlignedGridApis())d.setGridOption("alwaysShowVerticalScroll",c)}},VM={moduleName:"AlignedGrids",version:K,beans:[BM],dependsOn:[Zf]},zM=class extends A{constructor(e){super(),this.rootNode=e,this.nextId=0,this.allNodesMap={},$h(e)}getRowNode(e){return this.allNodesMap[e]}setNewRowData(e){const{selectionSvc:t,pinnedRowModel:s,groupStage:o}=this.beans;t?.reset("rowDataChanged"),s?.isManual()&&s.reset(),this.dispatchRowDataUpdateStarted(e),this.allNodesMap=Object.create(null),this.nextId=0;const i=$h(this.rootNode),n=new Array(e.length);i._leafs=n;let r=0;const a=o?.getNestedDataGetter(),l=a?new Set:null,c=(d,u)=>{const h=d.level+1;for(let p=0,f=u.length;p<f;++p){const C=u[p];if(!C)continue;const v=this.createRowNode(C,h);if(v.sourceRowIndex=r,n[r++]=v,l&&!l.has(C)){l.add(C),v.treeParent=d;const w=a(C);w&&c(v,w)}}};c(i,e),n.length=r}setImmutableRowData(e,t){const{rootNode:s,gos:o}=this;this.dispatchRowDataUpdateStarted(t);const i=oi(o),n=e.changedRowNodes,{adds:r,updates:a}=n,l=new Set,c=[],d=this.beans.groupStage?.getNestedDataGetter();let u=o.get("suppressMaintainUnsortedOrder")?void 0:!1,h=-1,p=!1;const f=(w,b)=>{if(!u&&u!==void 0){const S=w.sourceRowIndex;u=S<=h,h=S}w.data!==b&&(w.updateData(b),r.has(w)||a.add(w),!w.selectable&&w.isSelected()&&c.push(w))},C=(w,b,S)=>{for(let y=0,x=b.length;y<x;++y){const R=b[y];if(!R)continue;let F=this.getRowNode(i({data:R,level:S}));if(F?(f(F,R),p||(p=!!d&&F.treeParent!==w)):(F=this.createRowNode(R,S),r.add(F)),!d||l.has(F)){l.add(F);continue}l.add(F),F.treeParent=w;const D=d(R);D&&C(F,D,S+1)}};C(s,t,0);const v=this.deleteUnusedNodes(l,n,c)||u||r.size>0;if(v){const w=s._leafs??(s._leafs=[]);u===void 0?$M(w,l,n):UM(w,l)&&(n.reordered=!0)}(v||p||a.size)&&(e.rowDataUpdated=!0,this.deselect(c))}deleteUnusedNodes(e,{removals:t},s){const o=this.rootNode._leafs;for(let i=0,n=o.length;i<n;i++){const r=o[i];e.has(r)||(t.add(r),r.isSelected()&&s.push(r),this.deleteNode(r))}return t.size>0}updateRowData(e,t){if(this.dispatchRowDataUpdateStarted(e.add),this.beans.groupStage?.getNestedDataGetter())return G(268),{remove:[],update:[],add:[]};const s=[],o=oi(this.gos),i=this.executeRemove(o,e,t,s),n=this.executeUpdate(o,e,t,s),r=this.executeAdd(e,t);return this.deselect(s),{remove:i,update:n,add:r}}executeRemove(e,{remove:t},{adds:s,updates:o,removals:i},n){const r=this.rootNode._leafs,a=r?.length,l=t?.length;if(!l||!a)return[];let c=0,d=a,u=0,h;const p=new Array(l);for(let f=0;f<l;++f){const C=this.lookupNode(e,t[f]);if(!C)continue;const v=C.sourceRowIndex;v<d&&(d=v),v>u&&(u=v),C.isSelected()&&n.push(C),this.deleteNode(C),s.delete(C)?(h??(h=new Set),h.add(C)):(o.delete(C),i.add(C)),p[c++]=C}return p.length=c,c&&jM(r,d,u,i,h),p}executeUpdate(e,{update:t},{adds:s,updates:o},i){const n=t?.length;if(!n)return[];const r=new Array(n);let a=0;for(let l=0;l<n;l++){const c=t[l],d=this.lookupNode(e,c);d&&(d.updateData(c),!d.selectable&&d.isSelected()&&i.push(d),r[a++]=d,s.has(d)||o.add(d))}return r.length=a,r}executeAdd(e,t){var s;const o=(s=this.rootNode)._leafs??(s._leafs=[]),i=o.length,n=e.add,r=n?.length;if(!r)return[];const a=i+r;let l=this.sanitizeAddIndex(o,e.addIndex);if(l<i){for(let u=i-1,h=a-1;u>=l;--u){const p=o[u];p.sourceRowIndex=h,o[h--]=p}t.reordered=!0}o.length=a;const c=new Array(r),d=t.adds;for(let u=0;u<r;u++){const h=this.createRowNode(n[u],0);d.add(h),h.sourceRowIndex=l,o[l]=h,c[u]=h,l++}return c}dispatchRowDataUpdateStarted(e){this.eventSvc.dispatchEvent({type:"rowDataUpdateStarted",firstRowData:e?.length?e[0]:null})}deselect(e){const t="rowDataChanged",s=this.beans.selectionSvc;e.length&&s?.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t}),s?.updateGroupsFromChildrenSelections?.(t),e.length&&this.eventSvc.dispatchEvent({type:"selectionChanged",source:t,selectedNodes:s?.getSelectedNodes()??null,serverSideState:null})}createRowNode(e,t){const s=new Bs(this.beans);s.parent=this.rootNode,s.level=t,s.group=!1,s.expanded=!1,s.setDataAndId(e,String(this.nextId++));const o=s.id,i=this.allNodesMap;return i[o]&&G(2,{nodeId:o}),i[o]=s,s}deleteNode(e){e.clearRowTopAndRowIndex();const t=e.id,s=this.allNodesMap;s[t]===e&&delete s[t];const o=e.pinnedSibling;o&&this.beans.pinnedRowModel?.pinRow(o,null)}lookupNode(e,t){if(!e)return _M(this.rootNode._leafs,t);const s=e({data:t,level:0}),o=this.allNodesMap[s];return o||(Te(4,{id:s}),null)}sanitizeAddIndex(e,t){const s=e.length;if(typeof t!="number"||t<0||t>=s||Number.isNaN(t))return s;t=Math.ceil(t);const o=this.gos;return t>0&&o.get("treeData")&&o.get("getDataPath")&&(t=WM(e,t)),t}},WM=(e,t)=>{for(let s=0,o=e.length;s<o;s++)if(e[s]?.rowIndex==t-1)return s+1;return t},$h=e=>{e.group=!0,e.level=-1,e.id="ROOT_NODE_ID",e._leafs?.length!==0&&(e._leafs=[]);const t=[],s=[],o=[],i=[];e.childrenAfterGroup=t,e.childrenAfterSort=s,e.childrenAfterAggFilter=o,e.childrenAfterFilter=i;const n=e.sibling;return n&&(n.childrenAfterGroup=t,n.childrenAfterSort=s,n.childrenAfterAggFilter=o,n.childrenAfterFilter=i,n.childrenMapped=e.childrenMapped),e.updateHasChildren(),e},_M=(e,t)=>{if(e)for(let s=0,o=e.length;s<o;s++){const i=e[s];if(i.data===t)return i}return Te(5,{data:t}),null},jM=(e,t,s,o,i)=>{t=Math.max(0,t);for(let n=t,r=e.length;n<r;++n){const a=e[n];n<=s&&(o.has(a)||i?.has(a))||(a.sourceRowIndex=t,e[t++]=a)}e.length=t},UM=(e,t)=>{const s=t.size;e.length=s;let o=0,i=!1,n=!1;for(const r of t){const a=r.sourceRowIndex;a===o?n||(n=i):(a>=0?n=!0:i=!0,r.sourceRowIndex=o,e[o]=r),++o}return n},$M=(e,t,{removals:s,adds:o})=>{const i=e.length;e.length=t.size;let n=0;for(let r=0;r<i;++r){const a=e[r];s.has(a)||(n!==r&&(a.sourceRowIndex=n,e[n]=a),++n)}for(const r of o)r.sourceRowIndex<0&&(r.sourceRowIndex=n,e[n++]=r);e.length=n},Qm=e=>{const t=e.childrenAfterSort,s=e.sibling;if(s&&(s.childrenAfterSort=t),!!t)for(let o=0,i=t.length-1;o<=i;o++){const n=t[o],r=o===0,a=o===i;n.firstChild!==r&&(n.firstChild=r,n.dispatchRowEvent("firstChildChanged")),n.lastChild!==a&&(n.lastChild=a,n.dispatchRowEvent("lastChildChanged")),n.childIndex!==o&&(n.childIndex=o,n.dispatchRowEvent("childIndexChanged"))}},KM=class extends A{constructor(){super(...arguments),this.beanName="sortStage",this.step="sort",this.refreshProps=["postSortRows","groupDisplayType","accentedSort"]}execute(e){const t=this.beans.sortSvc.getSortOptions(),s=t.length>0&&!!e.changedRowNodes&&this.gos.get("deltaSort");this.sort(t,s,e.changedRowNodes,e.changedPath)}sort(e,t,s,o){const{gos:i,colModel:n,rowGroupColsSvc:r,rowNodeSorter:a,rowRenderer:l,showRowGroupCols:c}=this.beans,d=i.get("groupMaintainOrder"),u=n.getCols().some(b=>b.isRowGroupActive()),h=r?.columns,p=n.isPivotMode(),f=i.getCallback("postSortRows");let C=!1,v;const w=b=>{const S=p&&b.leafGroup;let y=d&&u&&!b.leafGroup;y&&(v??(v=this.shouldSortContainsGroupCols(e)),y&&(y=!v));let x=null;if(y){let R=!1;if(h){const F=b.level+1;F<h.length&&(R=h[F].getSort()===null)}R||(x=ZM(b))}else!e.length||S||(t&&s?x=qM(a,b,s,o,e):x=a.doFullSort(b.childrenAfterAggFilter,e));if(x||(x=b.childrenAfterAggFilter?.slice(0)??[]),C||(C=b.childrenAfterSort?.[0]!==x[0]),b.childrenAfterSort=x,Qm(b),f){const R={nodes:b.childrenAfterSort};f(R)}};if(o?.forEachChangedNodeDepthFirst(w),C&&i.get("groupHideOpenParents")){const b=c?.getShowRowGroupCols();b?.length&&l.refreshCells({columns:b,force:!0})}}shouldSortContainsGroupCols(e){const t=e.length;if(!t)return!1;if(Jt(this.gos)){for(let s=0;s<t;++s){const o=e[s].column;if(o.isPrimary()&&o.isRowGroupActive())return!0}return!1}for(let s=0;s<t;++s)if(e[s].column.getColDef().showRowGroup)return!0;return!1}},qM=(e,t,s,o,i)=>{const n=t.childrenAfterAggFilter,r=t.childrenAfterSort;if(!r)return e.doFullSort(n,i);const a=new Set,l=[],{updates:c,adds:d}=s;for(let h=0,p=n.length;h<p;++h){const f=n[h];c.has(f)||d.has(f)||o&&!o.canSkip(f)?l.push({currentPos:l.length,rowNode:f}):a.add(f)}const u=r.filter(h=>a.has(h)).map((h,p)=>({currentPos:p,rowNode:h}));return l.sort((h,p)=>e.compareRowNodes(i,h,p)),YM(e,i,l,u)},YM=(e,t,s,o)=>{let i=0,n=0;const r=s.length,a=o.length,l=new Array(r+a);let c=0;for(;i<r&&n<a;){const d=s[i],u=o[n];e.compareRowNodes(t,d,u)<0?(l[c++]=d.rowNode,++i):(l[c++]=u.rowNode,++n)}for(;i<r;)l[c++]=s[i++].rowNode;for(;n<a;)l[c++]=o[n++].rowNode;return l},ZM=e=>{const t=e.childrenAfterSort,s=e.childrenAfterAggFilter,o=t?.length,i=s?.length;if(!o||!i)return null;const n=new Array(i),r=new Set;for(let l=0;l<i;++l)r.add(s[l]);let a=0;for(let l=0;l<o;++l){const c=t[l];r.delete(c)&&(n[a++]=c)}if(r.size===0&&a===o)return t;for(const l of r)n[a++]=l;return n.length=a,n},XM=class extends A{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=ot(this,this.onRowHeightChanged.bind(this),100)}postConstruct(){const e=this.beans,t=new Bs(e);this.rootNode=t,this.nodeManager=this.createBean(new zM(t));const s=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:s,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:this.refreshModel.bind(this,{step:"pivot"}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),columnPivotModeChanged:s,gridStylesChanged:this.onGridStylesChanges.bind(this),gridReady:this.onGridReady.bind(this),rowExpansionStateChanged:this.onRowGroupOpened.bind(this)}),this.addPropertyListeners()}addPropertyListeners(){const{beans:e,stagesRefreshProps:t}=this,s=[e.groupStage,e.filterStage,e.pivotStage,e.aggStage,e.sortStage,e.filterAggStage,e.flattenStage].filter(o=>!!o);this.stages=s;for(let o=s.length-1;o>=0;--o)for(const i of s[o].refreshProps)t.set(i,o);this.addManagedPropertyListeners([...t.keys()],o=>{const i=o.changeSet?.properties;i&&this.onPropChange(i)}),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,s,o){let i,n=!1;do{i=!1;const r=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),l=Math.max(r,s),c=Math.min(a,o);for(let d=l;d<=c;d++){const u=this.getRow(d);if(u.rowHeightEstimated){const h=Ns(this.beans,u);u.setRowHeight(h.height),i=!0,n=!0}}i&&this.setRowTopAndRowIndex()}while(i);return n}onPropChange(e){const{nodeManager:t,gos:s,beans:o}=this,i=o.groupStage;if(!t)return;const n=new Set(e),r=i?.onPropChange(n);let a;n.has("rowData")?a=s.get("rowData"):r&&(a=i?.extractData()),a&&!Array.isArray(a)&&(a=null,G(1));const l={step:"nothing",changedProps:n};a&&(!r&&!this.isEmpty()&&a.length>0&&s.exists("getRowId")&&!s.get("resetRowDataOnUpdate")?(l.keepRenderedRows=!0,l.animate=!s.get("suppressAnimationFrame"),l.changedRowNodes=new Fr,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:s}=this,o=t.length;let i=o;for(let n=0,r=e.length;n<r&&i;++n)i=Math.min(i,s.get(e[n])??i);return i<o?t[i].step:null}setRowTopAndRowIndex(e){const{beans:t,rowsToDisplay:s}=this,o=t.environment.getDefaultRowHeight();let i=0;const n=it(this.gos,"normal");for(let r=0,a=s.length;r<a;++r){const l=s[r],c=l.id;if(c!=null&&e?.add(c),l.rowHeight==null){const d=Ns(t,l,n,o);l.setRowHeight(d.height,d.estimated)}l.setRowTop(i),l.setRowIndex(r),i+=l.rowHeight}}clearRowTopAndRowIndex(e,t){const s=e.active,o=r=>{r?.id!=null&&!t.has(r.id)&&r.clearRowTopAndRowIndex()},i=r=>{o(r),o(r.detailNode),o(r.sibling);const a=r.childrenAfterGroup;if(!r.hasChildren()||!a)return;const l=r.level==-1;if(!(s&&!l&&!r.expanded))for(let d=0,u=a.length;d<u;++d)i(a[d])},n=this.rootNode;n&&i(n)}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay.length}getTopLevelRowCount(){const{rootNode:e,rowsToDisplay:t}=this;if(!e||!t.length)return 0;if(t[0]===e)return 1;const o=e.sibling?.displayed?1:0;return(e.childrenAfterSort?.length??0)+o}getTopLevelRowDisplayedIndex(e){const{beans:t,rootNode:s,rowsToDisplay:o}=this;if(!s||!o.length||o[0]===s)return e;const n=s.childrenAfterSort,r=l=>{let c=n[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?.getTopDisplayIndex(o,e,n,r):r(e)}getTopLevelIndexFromDisplayedIndex(e){const{rootNode:t,rowsToDisplay:s}=this;if(!t||!s.length||s[0]===t)return e;let i=this.getRow(e);i.footer&&(i=i.sibling);let n=i.parent;for(;n&&n!==t;)i=n,n=i.parent;const r=t.childrenAfterSort?.indexOf(i)??-1;return r>=0?r: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:Uo(this.gos)})}onFilterChanged({afterDataChange:e,columns:t}){if(!e){const o=t.length===0||t.some(i=>i.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:o,keepRenderedRows:!0,animate:Uo(this.gos)})}}onSortChanged(){this.refreshModel({step:"sort",keepRenderedRows:!0,animate:Uo(this.gos)})}getType(){return"clientSide"}onValueChanged(){this.refreshModel({step:this.beans.colModel.isPivotActive()?"pivot":"aggregate"})}createChangePath(e){const t=new mn(!1,this.rootNode);return t.active=e,t}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;const{changedRowNodes:t,newData:s,rowDataUpdated:o}=e;return!(!t||s||!o||t.removals.size||t.adds.size)}refreshModel(e){const{nodeManager:t,beans:s,eventSvc:o,started:i,refreshingModel:n}=this;if(!t)return;const r=!!e.rowDataUpdated,a=e.changedPath??(e.changedPath=this.createChangePath(!e.newData&&r));if(i&&r&&o.dispatchEvent({type:"rowDataUpdated"}),!i||n||s.colModel.changeEventsDispatching||this.isSuppressModelUpdateAfterUpdateTransaction(e)){this.rowDataUpdatedPending||(this.rowDataUpdatedPending=r);return}switch(this.rowDataUpdatedPending&&(this.rowDataUpdatedPending=!1,e.step="group"),this.refreshingModel=!0,s.masterDetailSvc?.refreshModel(e),r&&e.step!=="group"&&s.colFilter?.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(){return!this.rootNode?._leafs?.length||!this.beans.colModel?.ready}isRowsToRender(){return this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let s=!1,o=!1;const i=[],n=gn(this.gos);return this.forEachNodeAfterFilterAndSort(r=>{if(o)return;if(s&&(r===t||r===e)&&(o=!0,n&&r.group)){Jm(i,r);return}if(!s){if(r!==t&&r!==e)return;s=!0,t===e&&(o=!0)}(!r.group||!n)&&i.push(r)}),i}getTopLevelNodes(){return this.rootNode?.childrenAfterGroup??null}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){const t=this.rowsToDisplay,s=t.length;if(this.isEmpty()||s===0)return-1;let o=0,i=s-1;if(e<=0)return 0;if(t[i].rowTop<=e)return i;let r=-1,a=-1;for(;;){const l=Math.floor((o+i)/2),c=t[l];if(this.isRowInPixel(c,e)||(c.rowTop<e?o=l+1:c.rowTop>e&&(i=l-1),r===o&&a===i))return l;r=o,a=i}}isRowInPixel(e,t){const s=e.rowTop,o=s+e.rowHeight;return s<=t&&o>t}forEachLeafNode(e){const t=this.rootNode?._leafs;if(t)for(let s=0,o=t.length;s<o;++s)e(t[s],s)}forEachNode(e,t=!1){this.depthFirstSearchRowNodes(e,t)}forEachDisplayedNode(e){const t=this.rowsToDisplay;for(let s=0,o=t.length;s<o;++s)e(t[s],s)}forEachNodeAfterFilter(e,t=!1){this.depthFirstSearchRowNodes(e,t,s=>s.childrenAfterAggFilter)}forEachNodeAfterFilterAndSort(e,t=!1){this.depthFirstSearchRowNodes(e,t,s=>s.childrenAfterSort)}forEachPivotNode(e,t,s){const{colModel:o,rowGroupColsSvc:i}=this.beans;if(!o.isPivotMode())return;if(!i?.columns.length){e(this.rootNode,0);return}const n=s?"childrenAfterSort":"childrenAfterGroup";this.depthFirstSearchRowNodes(e,t,r=>r.leafGroup?null:r[n])}depthFirstSearchRowNodes(e,t=!1,s=n=>n.childrenAfterGroup,o=this.rootNode,i=0){let n=i;if(!o)return n;const r=o===this.rootNode;if(r||e(o,n++),o.hasChildren()&&!o.footer){const a=s(o);if(a){const l=this.beans.footerSvc;n=l?.addTotalRows(n,o,e,t,r,"top")??n;for(const c of a)n=this.depthFirstSearchRowNodes(e,t,s,c,n);return l?.addTotalRows(n,o,e,t,r,"bottom")??n}}return n}doAggregate(e){const t=this.rootNode;t&&this.beans.aggStage?.execute({rowNode:t,changedPath:e})}doFilterAggregates(e){const t=this.rootNode,s=this.beans.filterAggStage;if(s){s.execute({rowNode:t,changedPath:e});return}t.childrenAfterAggFilter=t.childrenAfterFilter}doSort(e,t){const s=this.beans.sortStage;if(s){s.execute({rowNode:this.rootNode,changedRowNodes:e,changedPath:t});return}t.forEachChangedNodeDepthFirst(o=>{o.childrenAfterSort=o.childrenAfterAggFilter.slice(0),Qm(o)})}doGrouping(e){const t=this.rootNode,o=this.beans.groupStage?.execute({rowNode:t,changedRowNodes:e.changedRowNodes,changedPath:e.changedPath,afterColumnsChanged:!!e.afterColumnsChanged});if(o===void 0){const i=t._leafs;t.childrenAfterGroup=i,t.updateHasChildren();const n=t.sibling;n&&(n.childrenAfterGroup=i)}(o||e.rowDataUpdated)&&this.beans.colFilter?.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(s=>{s.childrenAfterFilter=s.childrenAfterGroup,Rm(s)},!0)}doPivot(e){this.beans.pivotStage?.execute({rowNode:this.rootNode,changedPath:e})}getRowNode(e){const t=this.nodeManager?.getRowNode(e);return typeof t=="object"?t:typeof e=="string"&&e.indexOf(Tc)===0?this.beans.groupStage?.getNode(e):void 0}batchUpdateRowData(e,t){if(!this.asyncTransactionsTimer){this.asyncTransactions=[];const s=this.gos.get("asyncTransactionWaitMillis");this.asyncTransactionsTimer=setTimeout(()=>this.executeBatchUpdateRowData(),s)}this.asyncTransactions.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){const e=this.asyncTransactionsTimer;e&&(clearTimeout(e),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){const{nodeManager:e,beans:t,eventSvc:s,asyncTransactions:o}=this;if(!e)return;t.valueCache?.onDataChanged();const i=[],n=[],r=new Fr;for(const{rowDataTransaction:a,callback:l}of o??[]){this.rowNodesCountReady=!0;const c=e.updateRowData(a,r);i.push(c),l&&n.push(l.bind(null,c))}this.commitTransactions(r),n.length>0&&setTimeout(()=>{for(let a=0,l=n.length;a<l;a++)n[a]()},0),i.length>0&&s.dispatchEvent({type:"asyncTransactionsFlushed",results:i}),this.asyncTransactionsTimer=0,this.asyncTransactions=null}updateRowData(e){const t=this.nodeManager;if(!t)return null;this.beans.valueCache?.onDataChanged(),this.rowNodesCountReady=!0;const s=new Fr,o=t.updateRowData(e,s);return this.commitTransactions(s),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,s=e.flattenStage;if(s){this.rowsToDisplay=s.execute({rowNode:t});return}const o=this.rootNode.childrenAfterSort??[];for(const i of o)i.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 s=e.sibling;s?.setRowHeight(s.rowHeight,!0),t&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{t.setRowHeight(t.rowHeight,!0);const s=t.detailNode;s?.setRowHeight(s.rowHeight,!0);const o=t.sibling;o?.setRowHeight(o.rowHeight,!0),e=!0}),e}onGridStylesChanges(e){e.rowHeightChanged&&!this.beans.rowAutoHeight?.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()}},Jm=(e,t)=>{const s=t.childrenAfterGroup;if(s)for(let o=0,i=s.length;o<i;++o){const n=s[o];n.data&&e.push(n),n.group&&Jm(e,n)}};function QM(e){e.expansionSvc?.onGroupExpandedOrCollapsed()}function JM(e,t){const s=Ws(e);s&&((!t||t==="everything")&&(t="group"),s.refreshModel({step:t,keepRenderedRows:!0,animate:!e.gos.get("suppressAnimationFrame")}))}function eT(e){return Ws(e)?.isEmpty()??!0}function tT(e,t){Ws(e)?.forEachLeafNode(t)}function sT(e,t){Ws(e)?.forEachNodeAfterFilter(t)}function oT(e,t){Ws(e)?.forEachNodeAfterFilterAndSort(t)}function iT(e,t){return e.frameworkOverrides.wrapIncoming(()=>Ws(e)?.updateRowData(t))}function nT(e,t,s){e.frameworkOverrides.wrapIncoming(()=>Ws(e)?.batchUpdateRowData(t,s))}function rT(e){e.frameworkOverrides.wrapIncoming(()=>Ws(e)?.flushAsyncTransactions())}function aT(e){return e.selectionSvc?.getBestCostNodeSelection()}var lT={moduleName:"ClientSideRowModel",version:K,rowModels:["clientSide"],beans:[XM,KM],dependsOn:[bm]},cT={moduleName:"ClientSideRowModelApi",version:K,apiFunctions:{onGroupExpandedOrCollapsed:QM,refreshClientSideRowModel:JM,isRowDataEmpty:eT,forEachLeafNode:tT,forEachNodeAfterFilter:sT,forEachNodeAfterFilterAndSort:oT,applyTransaction:iT,applyTransactionAsync:nT,flushAsyncTransactions:rT,getBestCostNodeSelection:aT,resetRowHeights:Xm,onRowHeightChanged:Zm},dependsOn:[NM,HM]},dT=class extends A{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:s,columnKeys:o,skipRowGroups:i,exportRowNumbers:n}=t,r=this.getColumnsToExport({allColumns:s,skipRowGroups:i,columnKeys:o,exportRowNumbers:n});return[this.prepareSession(r),this.prependContent(t),this.exportColumnGroups(t,r),this.exportHeaders(t,r),this.processPinnedTopRows(t,r),this.processRows(t,r),this.processPinnedBottomRows(t,r),this.appendContent(t)].reduce((a,l)=>l(a),e).parse()}processRow(e,t,s,o){const i=t.shouldRowBeSkipped||(()=>!1),r=t.rowPositions!=null||!!t.onlySelected,a=this.gos.get("groupHideOpenParents")&&!r,l=this.colModel.isPivotMode()?o.leafGroup:!o.group,c=!!o.footer,d=o.allChildrenCount===1&&o.childrenAfterGroup?.length===1&&E0(this.gos,o);if(!l&&!c&&(t.skipRowGroups||d||a)||t.onlySelected&&!o.isSelected()||t.skipPinnedTop&&o.rowPinned==="top"||t.skipPinnedBottom&&o.rowPinned==="bottom"||o.stub||o.level===-1&&!l&&!c||i(he(this.gos,{node:o})))return;const p=e.onNewBodyRow(o);if(s.forEach((f,C)=>{p.onColumn(f,C,o)}),t.getCustomContentBelowRow){const f=t.getCustomContentBelowRow(he(this.gos,{node:o}));f&&e.addCustomContent(f)}}appendContent(e){return t=>{const s=e.appendContent;return s&&t.addCustomContent(s),t}}prependContent(e){return t=>{const s=e.prependContent;return s&&t.addCustomContent(s),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return s=>{if(!e.skipColumnGroupHeaders){const o=new Up,{colGroupSvc:i}=this.beans,n=i?i.createColumnGroups({columns:t,idCreator:o,pinned:null,isStandaloneStructure:!0}):t;this.recursivelyAddHeaderGroups(n,s,e.processGroupHeaderCallback)}return s}}exportHeaders(e,t){return s=>{if(!e.skipColumnHeaders){const o=s.onNewHeaderRow();t.forEach((i,n)=>{o.onColumn(i,n,void 0)})}return s}}processPinnedTopRows(e,t){return s=>{const o=this.processRow.bind(this,s,e,t);return e.rowPositions?e.rowPositions.filter(i=>i.rowPinned==="top").sort((i,n)=>i.rowIndex-n.rowIndex).map(i=>this.pinnedRowModel?.getPinnedTopRow(i.rowIndex)).forEach(o):this.pinnedRowModel?.isManual()||this.pinnedRowModel?.forEachPinnedRow("top",o),s}}processRows(e,t){return s=>{const o=this.rowModel,i=_e(this.gos),n=So(this.gos),r=!i&&e.onlySelected,a=this.processRow.bind(this,s,e,t),{exportedRows:l="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(c=>c.rowPinned==null).sort((c,d)=>c.rowIndex-d.rowIndex).map(c=>o.getRow(c.rowIndex)).forEach(a);else if(this.colModel.isPivotMode())i?o.forEachPivotNode(a,!0,l==="filteredAndSorted"):n?o.forEachNodeAfterFilterAndSort(a,!0):o.forEachNode(a);else if(e.onlySelectedAllPages||r){const c=this.beans.selectionSvc?.getSelectedNodes()??[];this.replicateSortedOrder(c),c.forEach(a)}else l==="all"?o.forEachNode(a):i||n?o.forEachNodeAfterFilterAndSort(a,!0):o.forEachNode(a);return s}}replicateSortedOrder(e){const{sortSvc:t,rowNodeSorter:s}=this.beans;if(!t||!s)return;const o=t.getSortOptions(),i=(n,r)=>n.rowIndex!=null&&r.rowIndex!=null?n.rowIndex-r.rowIndex:n.level===r.level?n.parent?.id===r.parent?.id?s.compareRowNodes(o,{rowNode:n,currentPos:n.rowIndex??-1},{rowNode:r,currentPos:r.rowIndex??-1}):i(n.parent,r.parent):n.level>r.level?i(n.parent,r):i(n,r.parent);e.sort(i)}processPinnedBottomRows(e,t){return s=>{const o=this.processRow.bind(this,s,e,t);return e.rowPositions?e.rowPositions.filter(i=>i.rowPinned==="bottom").sort((i,n)=>i.rowIndex-n.rowIndex).map(i=>this.pinnedRowModel?.getPinnedBottomRow(i.rowIndex)).forEach(o):this.pinnedRowModel?.isManual()||this.pinnedRowModel?.forEachPinnedRow("bottom",o),s}}getColumnsToExport(e){const{allColumns:t=!1,skipRowGroups:s=!1,exportRowNumbers:o=!1,columnKeys:i}=e,{colModel:n,gos:r,visibleCols:a}=this,l=n.isPivotMode(),c=h=>ys(h)?!1:!ps(h)||o;if(i?.length)return n.getColsForKeys(i).filter(c);const d=r.get("treeData");let u=[];return t&&!l?u=n.getCols():u=a.allCols,u=u.filter(h=>c(h)&&(s&&!d?!vd(h):!0)),u}recursivelyAddHeaderGroups(e,t,s){const o=[];for(const i of e){const n=i;if(n.getChildren)for(const r of n.getChildren()??[])o.push(r)}e.length>0&&Ue(e[0])&&this.doAddHeaderHeader(t,e,s),o&&o.length>0&&this.recursivelyAddHeaderGroups(o,t,s)}doAddHeaderHeader(e,t,s){const o=e.onNewHeaderGroupingRow();let i=0;for(const n of t){const r=n;let a;s?a=s(he(this.gos,{columnGroup:r})):a=this.beans.colNames.getDisplayNameForColumnGroup(r,"header");const c=(r.isExpandable()?r.getLeafColumns():[]).reduce((d,u,h,p)=>{let f=Ie(d);return u.getColumnGroupShow()==="open"?(!f||f[1]!=null)&&(f=[h],d.push(f)):f&&f[1]==null&&(f[1]=h-1),h===p.length-1&&f&&f[1]==null&&(f[1]=h),d},[]);o.onColumn(r,a||"",i++,r.getLeafColumns().length-1,c)}}},uT={moduleName:"SharedExport",version:K,beans:[dT]},Kh=`\r
|
|
61
|
-
`,hT=class extends VP{constructor(e){super(e),this.config=e,this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:s}=e;this.suppressQuotes=t,this.columnSeparator=s}addCustomContent(e){e&&(typeof e=="string"?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,Kh),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((s,o)=>{o!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(s.data.value||""),s.mergeAcross&&this.appendEmptyCells(s.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,s,o){s!=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,s){t!=0&&(this.result+=this.columnSeparator);const o=this.extractRowCellValue(e,t,t,"csv",s);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():(G(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=Kh),this.isFirstLine=!1}},gT=class extends BP{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()){G(51);return}const t=this.getMergedParams(e),s=this.getData(t),o=new Blob(["\uFEFF",s],{type:"text/plain"}),i=typeof t.fileName=="function"?t.fileName(he(this.gos,{})):t.fileName;zP(this.getFileName(i),o)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const s=t?Object.assign({},e):this.getMergedParams(e);return this.getData(s)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{colModel:t,colNames:s,rowGroupColsSvc:o,valueSvc:i,gos:n}=this,{processCellCallback:r,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:d,columnSeparator:u}=e;return new hT({colModel:t,colNames:s,valueSvc:i,gos:n,processCellCallback:r||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:d||!1,columnSeparator:u||",",rowGroupColsSvc:o})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function pT(e,t){return e.csvCreator?.getDataAsCsv(t)}function fT(e,t){e.csvCreator?.exportDataAsCsv(t)}var mT={moduleName:"CsvExport",version:K,beans:[gT],apiFunctions:{getDataAsCsv:pT,exportDataAsCsv:fT},dependsOn:[uT]},CT=class extends A{constructor(e,t,s){super(),this.id=e,this.parentCache=t,this.params=s,this.state="needsLoading",this.version=0,this.startRow=e*s.blockSize,this.endRow=this.startRow+s.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,s){this.successCommon(e,{rowData:t,rowCount:s})}isRequestMostRecentAndLive(e){const t=e===this.version,s=this.isAlive();return t&&s}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:s,beans:o,rowNodes:i}=this;for(let n=0;n<e;n++){const r=s+n,a=new Bs(o);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(r),a.setRowTop(t*r),i.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:s,state:o}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:s,pageStatus:o}}}setDataAndId(e,t,s){Y(t)?e.setDataAndId(t,s.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Ge(this.params.datasource.getRows)){G(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:s,params:{sortModel:o,filterModel:i},gos:n}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,s),failCallback:this.pageLoadFailed.bind(this,s),sortModel:o,filterModel:i,context:he(n,{}).context}}forEachNode(e,t,s){this.rowNodes.forEach((o,i)=>{this.startRow+i<s&&e(o,t.value++)})}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.value++);const s=e-this.startRow;return this.rowNodes[s]}processServerResult(e){const{rowNodes:t,beans:s}=this;t.forEach((i,n)=>{const r=e.rowData?e.rowData[n]:void 0;!i.id&&i.alreadyRendered&&r&&(t[n]=new Bs(s),t[n].setRowIndex(i.rowIndex),t[n].setRowTop(i.rowTop),t[n].setRowHeight(i.rowHeight),i.clearRowTopAndRowIndex()),this.setDataAndId(t[n],r,this.startRow+n)});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()}},vT=2,wT=class extends A{constructor(e){super(),this.params=e,this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount}getRow(e,t=!1){const s=Math.floor(e/this.params.blockSize);let o=this.blocks[s];if(!o){if(t)return;o=this.createBlock(s)}return o.getRow(e)}createBlock(e){const t=this.params,s=this.createBean(new CT(e,this,t));return this.blocks[s.id]=s,this.blockCount++,this.purgeBlocksIfNeeded(s),t.rowNodeBlockLoader.addBlock(s),s}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()&&(ho(this.gos,`InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(r=>r!=e),s=(r,a)=>a.lastAccessed-r.lastAccessed;t.sort(s);const o=this.params.maxBlocksInCache>0,i=o?this.params.maxBlocksInCache-1:null,n=vT-1;t.forEach((r,a)=>{const l=r.state==="needsLoading"&&a>=n,c=o?a>=i:!1;if(l||c){if(this.isBlockCurrentlyDisplayed(r)||this.isBlockFocused(r))return;this.removeBlockFromCache(r)}})}isBlockFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const{startRow:s,endRow:o}=e;return t.rowIndex>=s&&t.rowIndex<o}isBlockCurrentlyDisplayed(e){const{startRow:t,endRow:s}=e;return this.beans.rowRenderer.isRangeInRenderedViewport(t,s-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:s,overflowSize:o}=this.params,n=(e.id+1)*s+o;this.rowCount<n&&(this.rowCount=n)}}setRowCount(e,t){this.rowCount=e,Y(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t={value:0};for(const s of this.getBlocksInOrder())s.forEachNode(e,t,this.rowCount)}getBlocksInOrder(){const e=(s,o)=>s.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 s=[];let o=-1,i=!1;const n={value:0};let r=!1;for(const l of this.getBlocksInOrder())if(!r){if(i&&o+1!==l.id){r=!0;continue}o=l.id,l.forEachNode(c=>{const d=c===e||c===t;(i||d)&&s.push(c),d&&(i=!i)},n,this.rowCount)}return r||i?[]:s}},bT=class extends A{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 Bs(e);this.rootNode=t,t.level=-1,this.rowHeight=oo(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=oo(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){let e;this.cacheParams?e=!an(this.cacheParams.sortModel,this.beans.sortSvc?.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){return this.infiniteCache?.getRowNodesInRange(e,t)??[]}reset(){if(!this.datasource)return;oi(this.gos)!=null||this.beans.selectionSvc?.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:s,rowNodeBlockLoader:o,eventSvc:i,gos:n}=e;this.cacheParams={datasource:this.datasource,filterModel:t?.getFilterModel()??{},sortModel:s?.getSortModel()??[],rowNodeBlockLoader:o,initialRowCount:n.get("infiniteInitialRowCount"),maxBlocksInCache:n.get("maxBlocksInCache"),rowHeight:oo(e),overflowSize:n.get("cacheOverflowSize"),blockSize:n.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new wT(this.cacheParams)),i.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(s=>{s.id===e&&(t=s)}),t}forEachNode(e){this.infiniteCache?.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),s=this.getRowCount()-1;return t>s?s:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){this.infiniteCache?.refreshCache()}purgeCache(){this.infiniteCache?.purgeCache()}isLastRowIndexKnown(){return this.infiniteCache?.isLastRowIndexKnown()??!1}setRowCount(e,t){this.infiniteCache?.setRowCount(e,t)}resetRowHeights(){}onRowHeightChanged(){}};function ST(e){Pa(e)?.refreshCache()}function yT(e){Pa(e)?.purgeCache()}function xT(e){return Pa(e)?.getRowCount()}var RT=class extends A{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=D0(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=ot(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){jt(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){ho(this.gos,"RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.maxConcurrentRequests!=null?this.maxConcurrentRequests-this.activeBlockLoadsCount:1,t=this.blocks.filter(s=>s.state==="needsLoading").slice(0,e);this.activeBlockLoadsCount+=t.length;for(const s of t)s.load();this.printCacheStatus()}getBlockState(){const e={};return this.blocks.forEach(t=>{const{id:s,state:o}=t.getBlockStateJson();e[s]=o}),e}printCacheStatus(){ho(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},FT={moduleName:"InfiniteRowModelCore",version:K,rowModels:["infinite"],beans:[bT,RT]},ET={moduleName:"InfiniteRowModel",version:K,apiFunctions:{refreshInfiniteCache:ST,purgeInfiniteCache:yT,getInfiniteRowCount:xT},dependsOn:[FT,GM]},DT="↑",PT="↓",MT={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},TT=class extends We{constructor(){super(MT),this.eValue=ne,this.eDelta=ne,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const s=Math.abs(t),o=e.formatValue(s),i=Y(o)?o:s,n=t>=0,r=this.eDelta;n?r.textContent=DT+i:r.textContent=PT+i,r.classList.toggle("ag-value-change-delta-up",n),r.classList.toggle("ag-value-change-delta-down",!n)}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"),vt(this.eDelta)}refresh(e,t=!1){const{value:s,valueFormatted:o}=e,{eValue:i,lastValue:n,beans:r}=this;if(s===n||(Y(o)?i.textContent=o:Y(s)?i.textContent=s:vt(i),r.filterManager?.isSuppressFlashingCellsBecauseFiltering()))return!1;const a=s&&typeof s=="object"&&"toNumber"in s?s.toNumber():s,l=n&&typeof n=="object"&&"toNumber"in n?n.toNumber():n;if(a===l)return!1;if(typeof a=="number"&&typeof l=="number"){const c=a-l;this.showDelta(e,c)}return n&&i.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=s,!0}},IT=".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}",kT={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},AT=class extends We{constructor(){super(kT),this.eCurrent=ne,this.refreshCount=0,this.registerCSS(IT)}init(e){this.refresh(e,!0)}addSlideAnimation(){this.refreshCount++;const e=this.refreshCount;this.ePrevious?.remove();const{beans:t,eCurrent:s}=this,o=ft({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=o,o.textContent=s.textContent,this.getGui().insertBefore(o,s),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{e===this.refreshCount&&(this.ePrevious?.remove(),this.ePrevious=null)},3e3)})}refresh(e,t=!1){let s=e.value;if(Ge(s)&&(s=""),s===this.lastValue||this.beans.filterManager?.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=s;const o=this.eCurrent;return Y(e.valueFormatted)?o.textContent=e.valueFormatted:Y(e.value)?o.textContent=s:vt(o),!0}},LT=class extends A{constructor(){super(...arguments),this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(e,t,s=this.beans.gos.get("cellFlashDuration"),o=this.beans.gos.get("cellFadeDuration")){const i=this.animations[t];i.delete(e);const n=Date.now(),r=n+s,a=n+s+o,l={phase:"flash",flashEndTime:r,fadeEndTime:a};i.set(e,l);const c=`ag-cell-${t}`,d=`${c}-animation`,{comp:u,eGui:{style:h}}=e;u.toggleCss(c,!0),u.toggleCss(d,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&r+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),s)}),this.nextAnimationTime=r)}advanceAnimations(){const e=Date.now();let t=null;for(const s of Object.keys(this.animations)){const o=this.animations[s],i=`ag-cell-${s}`,n=`${i}-animation`;for(const[r,a]of o){if(!r.isAlive()||!r.comp){o.delete(r);continue}const{phase:l,flashEndTime:c,fadeEndTime:d}=a,u=l==="flash"?c:d;if(!(e+15>=u)){t=Math.min(u,t??1/0);continue}const{comp:p,eGui:{style:f}}=r;switch(l){case"flash":p.toggleCss(i,!1),p.toggleCss(n,!0),f.transition=`background-color ${d-c}ms`,f.transitionDelay=`${c-e}ms`,t=Math.min(d,t??1/0),a.phase="fade";break;case"fade":p.toggleCss(i,!1),p.toggleCss(n,!1),f.removeProperty("transition"),f.removeProperty("transition-delay"),o.delete(r);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 s=F2(e.cellPosition);t.cells[s]&&this.animateCell(e,"highlight")}flashCell(e,t){this.animateCell(e,"data-changed",t?.flashDuration,t?.fadeDuration)}destroy(){for(const e of Object.keys(this.animations))this.animations[e].clear()}};function OT(e,t={}){const{cellFlashSvc:s}=e;s&&e.frameworkOverrides.wrapIncoming(()=>{for(const o of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))s.flashCell(o,t)})}var NT={moduleName:"HighlightChanges",version:K,beans:[LT],userComponents:{agAnimateShowChangeCellRenderer:TT,agAnimateSlideCellRenderer:AT},apiFunctions:{flashCells:OT}};function HT(e){return e.stateSvc?.getState()??{}}function GT(e,t,s){return e.stateSvc?.setState(t,s)}function qh(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=BT(e)),e.version=K,e}function BT(e){return e.cellSelection=VT(e,"rangeSelection"),e}function VT(e,t){if(e&&typeof e=="object")return e[t]}var zT=class extends A{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=ot(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=ot(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=ot(this,()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}postConstruct(){const{gos:e,ctrlsSvc:t,colDelayRenderSvc:s}=this.beans;this.isClientSideRowModel=_e(e);const o=qh(e.get("initialState")??{}),i=o.partialColumnState;delete o.partialColumnState,this.cachedState=o;const n=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>n(()=>this.setupStateOnGridReady(o))),(o.columnOrder||o.columnVisibility||o.columnSizing||o.columnPinning||o.columnGroup)&&s?.hideColumns("columnState");const[r,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:c})=>{c==="gridInitializing"&&(r(),n(()=>{this.setupStateOnColumnsInitialised(o,!!i),s?.revealColumns("columnState")}))},rowCountReady:()=>{a?.(),n(()=>this.setupStateOnRowCountReady(o))},firstDataRendered:()=>{l?.(),n(()=>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 s=qh(e);delete s.partialColumnState,this.cachedState=s,this.startSuppressEvents();const o="api",i=t?new Set(t):void 0;this.setGridReadyState(s,o,i),this.setColumnsInitialisedState(s,o,!!i,i),this.setRowCountState(s,o,i),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(s,o,i),this.stopSuppressEvents(o)})}setGridReadyState(e,t,s){t==="api"&&!s?.has("sideBar")&&this.beans.sideBar?.comp?.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,s,o){this.setColumnState(e,t,s,o),this.setColumnGroupState(e,t,o),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const s=o=>()=>this.updateColumnState([o]);this.addManagedEventListeners({columnValueChanged:s("aggregation"),columnMoved:s("columnOrder"),columnPinned:s("columnPinning"),columnResized:s("columnSizing"),columnVisible:s("columnVisibility"),columnPivotChanged:s("pivot"),columnPivotModeChanged:s("pivot"),columnRowGroupChanged:s("rowGroup"),sortChanged:s("sort"),newColumnsLoaded:this.updateColumnAndGroupState.bind(this),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setRowCountState(e,t,s){const{filter:o,rowGroupExpansion:i,ssrmRowGroupExpansion:n,rowSelection:r,pagination:a}=e,l=(d,u)=>!s?.has(d)&&(u||t==="api");l("filter",o)&&this.setFilterState(o),l("rowGroupExpansion",i)&&this.setRowGroupExpansionState(n,i,t),l("rowSelection",r)&&this.setRowSelectionState(r,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),s=()=>{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:i,colFilter:n}=this.beans;this.addManagedEventListeners({filterChanged:o,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:s,columnRowGroupChanged:s,rowDataUpdated:()=>{(i.get("groupDefaultExpanded")!==0||i.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(s)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:r=>{(r.newPage||r.newPageSize)&&t("pagination",this.getPaginationState())}}),n&&this.addManagedListeners(n,{filterStateChanged:o})}setFirstDataRenderedState(e,t,s){const{scroll:o,cellSelection:i,focusedCell:n,columnOrder:r,rowPinning:a}=e,l=(u,h)=>!s?.has(u)&&(h||t==="api");l("focusedCell",n)&&this.setFocusedCellState(n),l("cellSelection",i)&&this.setCellSelectionState(i),l("scroll",o)&&this.setScrollState(o),l("rowPinning",a)&&this.setRowPinningState(a),this.setColumnPivotState(!!r?.orderedColIds,t);const c=this.updateCachedState.bind(this);c("sideBar",this.getSideBarState()),c("focusedCell",this.getFocusedCellState());const d=this.getRangeSelectionState();c("rangeSelection",d),c("cellSelection",d),c("scroll",this.getScrollState())}setupStateOnFirstDataRendered(e){this.setFirstDataRenderedState(e,"gridInitializing");const t=this.updateCachedState.bind(this),s=()=>t("focusedCell",this.getFocusedCellState());this.addManagedEventListeners({cellFocused:s,cellFocusCleared:s,cellSelectionChanged:o=>{if(o.finished){const i=this.getRangeSelectionState();t("rangeSelection",i),t("cellSelection",i)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return OP(Ur(e),e.colModel.isPivotMode())}setColumnState(e,t,s,o){const{sort:i,rowGroup:n,aggregation:r,pivot:a,columnPinning:l,columnVisibility:c,columnSizing:d,columnOrder:u}=e;let h=!1;const p=(E,P)=>{const N=!o?.has(E)&&!!(P||t==="api");return h||(h=N),N},f={},C=E=>{let P=f[E];return P||(P={colId:E},f[E]=P,P)},v={},w=p("sort",i);w&&i?.sortModel.forEach(({colId:E,sort:P},N)=>{const B=C(E);B.sort=P,B.sortIndex=N}),(w||!s)&&(v.sort=null,v.sortIndex=null);const b=p("rowGroup",n);b&&n?.groupColIds.forEach((E,P)=>{const N=C(E);N.rowGroup=!0,N.rowGroupIndex=P}),(b||!s)&&(v.rowGroup=null,v.rowGroupIndex=null);const S=p("aggregation",r);S&&r?.aggregationModel.forEach(({colId:E,aggFunc:P})=>{C(E).aggFunc=P}),(S||!s)&&(v.aggFunc=null);const y=p("pivot",a);y&&(a?.pivotColIds.forEach((E,P)=>{const N=C(E);N.pivot=!0,N.pivotIndex=P}),this.gos.updateGridOptions({options:{pivotMode:!!a?.pivotMode},source:t})),(y||!s)&&(v.pivot=null,v.pivotIndex=null);const x=p("columnPinning",l);if(x){for(const E of l?.leftColIds??[])C(E).pinned="left";for(const E of l?.rightColIds??[])C(E).pinned="right"}(x||!s)&&(v.pinned=null);const R=p("columnVisibility",c);if(R)for(const E of c?.hiddenColIds??[])C(E).hide=!0;(R||!s)&&(v.hide=null);const F=p("columnSizing",d);if(F)for(const{colId:E,flex:P,width:N}of d?.columnSizingModel??[]){const B=C(E);B.flex=P??null,B.width=N}(F||!s)&&(v.flex=null);const D=u?.orderedColIds,M=!!D?.length&&!o?.has("columnOrder"),k=M?D.map(E=>C(E)):Object.values(f);(k.length||h)&&(this.columnStates=k,_t(this.beans,{state:k,applyOrder:M,defaultState:v},t))}setColumnPivotState(e,t){const s=this.columnStates;this.columnStates=void 0;const o=this.columnGroupStates;this.columnGroupStates=void 0;const i=this.beans,{pivotResultCols:n,colGroupSvc:r}=i;if(n?.isPivotResultColsPresent()){if(s){const a=[];for(const l of s)n.getPivotResultCol(l.colId)&&a.push(l);_t(i,{state:a,applyOrder:e},t)}o&&r?.setColumnGroupState(o,t)}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return NP(t)}setColumnGroupState(e,t,s){const o=this.beans.colGroupSvc;if(!o||s?.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const i=new Set(e.columnGroup?.openColumnGroupIds),r=o.getColumnGroupState().map(({groupId:a})=>{const l=i.has(a);return l&&i.delete(a),{groupId:a,open:l}});for(const a of i)r.push({groupId:a,open:!0});r.length&&(this.columnGroupStates=r),o.setColumnGroupState(r,t)}getFilterState(){const e=this.beans.filterManager;let t=e?.getFilterModel();t&&Object.keys(t).length===0&&(t=void 0);const s=e?.getFilterState(),o=e?.getAdvFilterModel()??void 0;return t||o||s?{filterModel:t,columnFilterState:s,advancedFilterModel:o}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:s,columnFilterState:o,advancedFilterModel:i}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(s!==void 0||o!==void 0)&&t?.setFilterState(s??null,o??null,"columnFilter"),i!==void 0&&t?.setAdvFilterModel(i??null,"advancedFilter")}getRangeSelectionState(){const e=this.beans.rangeSvc?.getCellRanges().map(t=>{const{id:s,type:o,startRow:i,endRow:n,columns:r,startColumn:a}=t;return{id:s,type:o,startRow:i,endRow:n,colIds:r.map(l=>l.getColId()),startColId:a.getColId()}});return e?.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeSvc:s,colModel:o,visibleCols:i}=this.beans;if(!Hs(t)||!s)return;const n=[];for(const r of e?.cellRanges??[]){const a=[];for(const c of r.colIds){const d=o.getCol(c);d&&a.push(d)}if(!a.length)continue;let l=o.getCol(r.startColId);if(!l){const c=i.allCols,d=new Set(a);l=c.find(u=>d.has(u))}n.push({...r,columns:a,startColumn:l})}s.setCellRanges(n)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.beans.ctrlsSvc.getScrollFeature(),{left:t}=e?.getHScrollPosition()??{left:0},{top:s}=e?.getVScrollPosition()??{top:0};return s||t?{top:s,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:s}=e??{top:0,left:0},{frameworkOverrides:o,rowRenderer:i,animationFrameSvc:n,ctrlsSvc:r}=this.beans;o.wrapIncoming(()=>{r.get("center").setCenterViewportScrollLeft(s),r.getScrollFeature()?.setVerticalScrollPosition(t),i.redraw({afterScroll:!0}),n?.flushAllFrames()})}getSideBarState(){return this.beans.sideBar?.comp?.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.beans.focusSvc.getFocusedCell();if(e){const{column:t,rowIndex:s,rowPinned:o}=e;return{colId:t.getColId(),rowIndex:s,rowPinned:o}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:s}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:o,rowIndex:i,rowPinned:n}=e;t.setFocusedCell({column:s.getCol(o),rowIndex:i,rowPinned:n,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const s=e.getCurrentPage(),o=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!s&&!o))return{page:s,pageSize:o}}setPaginationState(e,t){const{pagination:s,gos:o}=this.beans;if(!s)return;const{pageSize:i,page:n}=e??{page:0,pageSize:o.get("paginationPageSize")},r=t==="gridInitializing";i&&!o.get("paginationAutoPageSize")&&s.setPageSize(i,r?"initialState":"pageSizeSelector"),typeof n=="number"&&(r?s.setPage(n):s.goToPage(n))}getRowSelectionState(){const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!t?.toggledNodes?.length?void 0:t}setRowSelectionState(e,t){this.beans.selectionSvc?.setSelectionState(e,t,t==="api")}getRowGroupExpansionState(){const{expansionSvc:e}=this.beans;if(e)return e.getExpansionState()}getRowPinningState(){return this.beans.pinnedRowModel?.getPinnedState()}setRowPinningState(e){const t=this.beans.pinnedRowModel;e?t?.setPinnedState(e):t?.reset()}setRowGroupExpansionState(e,t,s){const o=this.beans.expansionSvc;if(!o)return;const i=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};o.setExpansionState(i,s)}updateColumnState(e){const t=this.getColumnState();let s=!1;const o=this.cachedState;for(const i of Object.keys(t)){const n=t[i];an(n,o[i])||(s=!0)}this.cachedState={...o,...t},s&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const s=this.cachedState[e];this.setCachedStateValue(e,t),an(t,s)||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(){this.suppressEvents=!0,this.beans.colAnimation?.setSuppressAnimation(!0)}stopSuppressEvents(e){setTimeout(()=>{this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&(this.beans.colAnimation?.setSuppressAnimation(!1),this.dispatchStateUpdateEvent([e]))})}suppressEventsAndDispatchInitEvent(e){this.startSuppressEvents(),e(),this.stopSuppressEvents("gridInitializing")}},WT={moduleName:"GridState",version:K,beans:[zT],apiFunctions:{getState:HT,setState:GT}};function _T(e){return e.rowModel.isLastRowIndexKnown()}function jT(e){return e.pagination?.getPageSize()??100}function UT(e){return e.pagination?.getCurrentPage()??0}function $T(e){return e.pagination?.getTotalPages()??1}function KT(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function qT(e){e.pagination?.goToNextPage()}function YT(e){e.pagination?.goToPreviousPage()}function ZT(e){e.pagination?.goToFirstPage()}function XT(e){e.pagination?.goToLastPage()}function QT(e,t){e.pagination?.goToPage(t)}var JT=class extends A{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,s=()=>{const o=Math.max(oo(t),1),i=Math.floor(e/o);t.pagination.setPageSize(i,"autoCalculated")};this.isBodyRendered?ot(this,s,50)():(s(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},Hi="paginationPageSizeSelector",e6={tag:"span",cls:"ag-paging-page-size"},t6=class extends We{constructor(){super(e6),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(Hi,()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedEventListeners({paginationChanged:e=>this.handlePaginationChanged(e)})}handlePaginationChanged(e){if(!this.selectPageSizeComp||!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(){vt(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(Hi)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),s=!t||!e.includes(t);if(s){const i=this.gos.exists("paginationPageSize"),n=this.gos.get(Hi)!==!0;G(94,{pageSizeSet:i,pageSizesSet:n,pageSizeOptions:e,paginationPageSizeOption:t}),n||G(95,{paginationPageSizeOption:t,paginationPageSizeSelector:Hi}),e.unshift("")}const o=String(s?"":t);this.selectPageSizeComp?(Vs(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(o,!0)):this.createPageSizeSelectorComp(e,o),this.hasEmptyOption=s}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const s=this.getLocaleTextFunc(),o=s("pageSizeSelectorLabel","Page Size:"),i=s("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new Fd).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(i).setLabel(o).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(Hi);return!Array.isArray(t)||!t?.length?e:[...t].sort((s,o)=>s-o)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},s6={selector:"AG-PAGE-SIZE-SELECTOR",component:t6},o6=".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}",i6=class extends ZR{constructor(){super(),this.btFirst=ne,this.btPrevious=ne,this.btNext=ne,this.btLast=ne,this.lbRecordCount=ne,this.lbFirstRowOnPage=ne,this.lbLastRowOnPage=ne,this.lbCurrent=ne,this.lbTotal=ne,this.pageSizeComp=ne,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(o6)}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(),[s6]);const{btFirst:t,btPrevious:s,btNext:o,btLast:i}=this;this.activateTabIndex([t,s,o,i]),t.insertAdjacentElement("afterbegin",Ht(e?"last":"first",this.beans)),s.insertAdjacentElement("afterbegin",Ht(e?"next":"previous",this.beans)),o.insertAdjacentElement("afterbegin",Ht(e?"previous":"next",this.beans)),i.insertAdjacentElement("afterbegin",Ht(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:n=>this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(n):pR(this.beans,n),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:s}=e;this.addManagedListeners(t,{click:s,keydown:o=>{(o.key===T.ENTER||o.key===T.SPACE)&&(o.preventDefault(),s())}})}gR(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}):GP(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(),s=this.pagination.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const o=this.isZeroPagesToDisplay(),i=e===s-1;this.nextButtonDisabled=i||o,this.lastButtonDisabled=!t||o||e===s-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){Tb(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(),s=this.pagination.getMasterRowCount(),o=e?s:null,i=this.pagination.getCurrentPage(),n=this.pagination.getPageSize();let r,a;this.isZeroPagesToDisplay()?r=a=0:(r=n*i+1,a=r+n-1,e&&a>o&&(a=o));const l=r+n-1,c=!e&&s<l,d=this.formatNumber(r);this.lbFirstRowOnPage.textContent=d;let u;const h=this.getLocaleTextFunc();c?u=h("pageLastRowUnknown","?"):u=this.formatNumber(a),this.lbLastRowOnPage.textContent=u;const f=t>0?i+1:0,C=this.formatNumber(f);this.lbCurrent.textContent=C;let v,w;if(e)v=this.formatNumber(t),w=this.formatNumber(o);else{const b=h("more","more");v=b,w=b}this.lbTotal.textContent=v,this.lbRecordCount.textContent=w,this.announceAriaStatus(d,u,w,C,v)}announceAriaStatus(e,t,s,o,i){const n=this.getLocaleTextFunc(),r=n("page","Page"),a=n("to","to"),l=n("of","of"),c=`${e} ${a} ${t} ${l} ${s}`,d=`${r} ${o} ${l} ${i}`;c!==this.ariaRowStatus&&(this.ariaRowStatus=c,this.ariaAnnounce?.announceValue(c,"paginationRow")),d!==this.ariaPageStatus&&(this.ariaPageStatus=d,this.ariaAnnounce?.announceValue(d,"paginationPage"))}},n6={selector:"AG-PAGINATION",component:i6},r6=class extends A{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 n6}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:s}=this.beans;s?.isEditing()&&(s.isBatchEditing()?s.cleanupEditors():s.stopEditing(void 0,{source:"api"})),this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0})}goToPageWithIndex(e){if(!this.active)return;let t=e;this.paginateChildRows||(t=this.beans.rowModel.getTopLevelIndexFromDisplayedIndex?.(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 Y(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:Y(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:Y(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:Y(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 s=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}s!==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 s=this.pageSize,o=t-1;this.totalPages=Math.floor(o/s)+1,this.adjustCurrentPageIfInvalid();const i=this.currentPage,n=s*i;let r=s*(i+1)-1;if(r>o&&(r=o),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(n),r===o)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(r+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:s}=this,o=e-1;this.totalPages=Math.floor(o/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*s,this.bottomDisplayedRowIndex=t*(s+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:s=!1,newPageSize:o=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:s,newPageSize:o,keepRenderedRows:t})}},a6={moduleName:"Pagination",version:K,beans:[r6,JT],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:_T,paginationGetPageSize:jT,paginationGetCurrentPage:UT,paginationGetTotalPages:$T,paginationGetRowCount:KT,paginationGoToNextPage:qT,paginationGoToPreviousPage:YT,paginationGoToFirstPage:ZT,paginationGoToLastPage:XT,paginationGoToPage:QT},dependsOn:[Ma]};function l6(e,t={}){const s=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(s))}function eC(e,t,s,o,i){t&&(o&&t.parent&&t.parent.level!==-1&&eC(e,t.parent,s,o,i),t.setExpanded(s,void 0,i))}function c6(e,t){return e.rowModel.getRowNode(t)}function d6(e,t,s,o){e.rowRenderer.addRenderedRowListener(t,s,o)}function u6(e){return e.rowRenderer.getRenderedNodes()}function h6(e,t,s){e.rowModel.forEachNode(t,s)}function g6(e){return e.rowRenderer.firstRenderedRow}function p6(e){return e.rowRenderer.lastRenderedRow}function f6(e,t){return e.rowModel.getRow(t)}function m6(e){return e.rowModel.getRowCount()}var C6={moduleName:"RowApi",version:K,apiFunctions:{redrawRows:l6,setRowNodeExpanded:eC,getRowNode:c6,addRenderedRowListener:d6,getRenderedNodes:u6,forEachNode:h6,getFirstDisplayedRowIndex:g6,getLastDisplayedRowIndex:p6,getDisplayedRowAtIndex:f6,getDisplayedRowCount:m6}},v6={moduleName:"ScrollApi",version:K,apiFunctions:{getVerticalPixelRange:T4,getHorizontalPixelRange:I4,ensureColumnVisible:Vm,ensureIndexVisible:zm,ensureNodeVisible:k4}};function w6(e,t,s){if(!t)return;const o=e.ctrlsSvc.getGridBodyCtrl().eGridBody,i=`aria-${t}`;s===null?o.removeAttribute(i):o.setAttribute(i,s)}function b6(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function S6(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function y6(e){return e.animationFrameSvc?.isQueueEmpty()??!0}function x6(e){e.animationFrameSvc?.flushAllFrames()}function R6(e){return{rowHeight:oo(e),headerHeight:Pn(e)}}function F6(e,t={}){const s=[];for(const n of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const r=n.getCellRenderer();r!=null&&s.push(pn(r))}if(t.columns?.length)return s;const o=[],i=Wc(t.rowNodes);for(const n of e.rowRenderer.getAllRowCtrls()){if(i&&!_c(n.rowNode,i)||!n.isFullWidth())continue;const r=n.getFullWidthCellRenderers();for(let a=0;a<r.length;a++){const l=r[a];l!=null&&o.push(pn(l))}}return[...o,...s]}var E6={moduleName:"RenderApi",version:K,apiFunctions:{setGridAriaProperty:w6,refreshCells:b6,refreshHeader:S6,isAnimationFrameQueueEmpty:y6,flushAllAnimationFrames:x6,getSizesForCurrentTheme:R6,getCellRendererInstances:F6}};function D6(e,t){typeof t=="number"?e.colAutosize?.sizeColumnsToFit(t,"api"):e.colAutosize?.sizeColumnsToFitGridBody(t)}function tC({colAutosize:e,visibleCols:t},s,o){Array.isArray(s)?e?.autoSizeCols({colKeys:s,skipHeader:o,source:"api"}):e?.autoSizeCols({...s,colKeys:s.colIds??t.allCols,source:"api"})}function P6(e,t){t&&typeof t=="object"?tC(e,t):e.colAutosize?.autoSizeAllColumns({source:"api",skipHeader:t})}var M6=class extends A{constructor(){super(...arguments),this.beanName="colAutosize",this.timesDelayed=0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}postConstruct(){const{gos:e}=this,t=e.get("autoSizeStrategy");if(t){let s=!1;const o=t.type;if(o==="fitGridWidth"||o==="fitProvidedWidth")s=!0;else if(o==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const i=e.get("rowData");s=i!=null&&i.length>0&&_e(e)}s&&this.beans.colDelayRenderSvc?.hideColumns(o)}}autoSizeCols(e){const{eventSvc:t,visibleCols:s}=this.beans;this.innerAutoSizeCols(e).then(o=>{const i=c=>ii(t,Array.from(c),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return i(o);const n=Yh(this.beans),r=c=>s.leftCols.some(d=>Xi(d,c)),a=c=>s.rightCols.some(d=>Xi(d,c)),l=e.colKeys.filter(c=>!ys(c)&&!ps(c)&&!r(c)&&!a(c));this.sizeColumnsToFit(n,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:e.columnLimits?.map(c=>({...c,key:c.colId})),colKeys:l,onlyScaleUp:!0}),i(o)})}innerAutoSizeCols(e){return new Promise((t,s)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,s));const{colKeys:o,skipHeader:i,skipHeaderGroups:n,stopAtGroup:r,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:c=[],source:d="api"}=e,{animationFrameSvc:u,renderStatus:h,colModel:p,autoWidthCalc:f,visibleCols:C}=this.beans;if(u?.flushAllFrames(),this.timesDelayed<5&&h&&(!h.areHeaderCellsRendered()||!h.areCellsRendered())){this.timesDelayed++,setTimeout(()=>{this.isAlive()&&this.innerAutoSizeCols(e).then(t,s)});return}this.timesDelayed=0;const v=new Set;let w=-1;const b=Object.fromEntries(c.map(({colId:x,...R})=>[x,R])),S=i??this.gos.get("skipHeaderOnAutoSize"),y=n??S;for(;w!==0;){w=0;const x=[];for(const R of o){if(!R||W0(R))continue;const F=p.getCol(R);if(!F||v.has(F))continue;const D=f.getPreferredWidthForColumn(F,S);if(D>0){const M=b[F.colId]??{};M.minWidth??(M.minWidth=l),M.maxWidth??(M.maxWidth=a);const k=T6(F,D,M);F.setActualWidth(k,d),v.add(F),w++}x.push(F)}x.length&&C.refresh(d)}y||this.autoSizeColumnGroupsByColumns(o,d,r),t(v)})}autoSizeColumn(e,t,s){this.autoSizeCols({colKeys:[e],skipHeader:s,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,s){const{colModel:o,ctrlsSvc:i}=this.beans,n=new Set,r=o.getColsForKeys(e);for(const l of r){let c=l.getParent();for(;c&&c!=s;)c.isPadding()||n.add(c),c=c.getParent()}let a;for(const l of n){for(const c of i.getHeaderRowContainerCtrls())if(a=c.getHeaderCtrlForColumn(l),a)break;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 s=this.gos.get("skipHeaderOnAutoSize"),o=()=>{this.autoSizeColumn(t,"uiColumnResized",s)};e.addEventListener("dblclick",o);const i=new Ks(e);return i.addEventListener("doubleTap",o),()=>{e.removeEventListener("dblclick",o),i.destroy()}}addColumnGroupResize(e,t,s){const o=this.gos.get("skipHeaderOnAutoSize"),i=()=>{const n=[],r=t.getDisplayedLeafColumns();for(const a of r)a.getColDef().suppressAutoSize||n.push(a.getColId());n.length>0&&this.autoSizeCols({colKeys:n,skipHeader:o,stopAtGroup:t,source:"uiColumnResized"}),s()};return e.addEventListener("dblclick",i),()=>e.removeEventListener("dblclick",i)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const s=Yh(this.beans);if(s>0){this.sizeColumnsToFit(s,"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):G(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",s,o){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,s,o));return}const i={};for(const{key:f,...C}of o?.columnLimits??[])i[typeof f=="string"?f:f.getColId()]=C;const n=this.beans.visibleCols.allCols;if(e<=0||!n.length)return;const r=cs(n);if(o?.onlyScaleUp&&r>e||e===r&&n.every(C=>{if(C.colDef.suppressSizeToFit)return!0;const v=i?.[C.getId()],w=v?.minWidth??o?.defaultMinWidth,b=v?.maxWidth??o?.defaultMaxWidth,S=C.getActualWidth();return(w==null||S>=w)&&(b==null||S<=b)}))return;const l=[],c=[];for(const f of n){const C=o?.colKeys?.some(v=>Xi(f,v))??!0;f.getColDef().suppressSizeToFit||!C?c.push(f):l.push(f)}const d=l.slice(0);let u=!1;const h=f=>{jt(l,f),c.push(f)};for(const f of l){f.resetActualWidth(t);const C=i?.[f.getId()],v=C?.minWidth??o?.defaultMinWidth,w=C?.maxWidth??o?.defaultMaxWidth,b=f.getActualWidth();typeof v=="number"&&b<v?f.setActualWidth(v,t,!0):typeof w=="number"&&b>w&&f.setActualWidth(w,t,!0)}for(;!u;){u=!0;const f=e-cs(c);if(f<=0)for(const C of l){const v=i?.[C.getId()]?.minWidth??o?.defaultMinWidth??C.minWidth;C.setActualWidth(v,t,!0)}else{const C=f/cs(l);let v=f;for(let w=l.length-1;w>=0;w--){const b=l[w],S=i?.[b.getId()],y=S?.minWidth??o?.defaultMinWidth,x=S?.maxWidth??o?.defaultMaxWidth,R=b.getMinWidth(),F=b.getMaxWidth(),D=typeof y=="number"&&y>R?y:R,M=typeof x=="number"&&x<F?x:F;let k=Math.round(b.getActualWidth()*C);k<D?(k=D,h(b),u=!1):k>M?(k=M,h(b),u=!1):w===0&&(k=v),b.setActualWidth(k,t,!0),v-=k}}}for(const f of d)f.fireColumnWidthChangedEvent(t);const p=this.beans.visibleCols;p.setLeftValues(t),p.updateBodyWidths(),!s&&ii(this.eventSvc,d,!0,t)}applyAutosizeStrategy(){const{gos:e,colDelayRenderSvc:t}=this.beans,s=e.get("autoSizeStrategy");s?.type!=="fitGridWidth"&&s?.type!=="fitProvidedWidth"||setTimeout(()=>{if(!this.isAlive())return;const o=s.type;if(o==="fitGridWidth"){const{columnLimits:i,defaultMinWidth:n,defaultMaxWidth:r}=s,a=i?.map(({colId:l,minWidth:c,maxWidth:d})=>({key:l,minWidth:c,maxWidth:d}));this.sizeColumnsToFitGridBody({defaultMinWidth:n,defaultMaxWidth:r,columnLimits:a})}else o==="fitProvidedWidth"&&this.sizeColumnsToFit(s.width,"sizeColumnsToFit");t?.revealColumns(o)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{if(!this.isAlive())return;const s="autosizeColumns";e?this.autoSizeCols({...t,source:s,colKeys:e}):this.autoSizeAllColumns({...t,source:s}),this.beans.colDelayRenderSvc?.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 T6(e,t,s={}){const o=s.minWidth??e.getMinWidth();t<o&&(t=o);const i=s.maxWidth??e.getMaxWidth();return t>i&&(t=i),t}function Yh({ctrlsSvc:e,scrollVisibleSvc:t}){const s=e.getGridBodyCtrl(),i=s.isVerticalScrollShowing()?t.getScrollbarWidth():0;return dn(s.eGridBody)-i}var I6={moduleName:"ColumnAutoSize",version:K,beans:[M6],apiFunctions:{sizeColumnsToFit:D6,autoSizeColumns:tC,autoSizeAllColumns:P6},dependsOn:[Yf]},k6=".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 A6(e){return e.pinnedRowModel?.getPinnedTopRowCount()??0}function L6(e){return e.pinnedRowModel?.getPinnedBottomRowCount()??0}function O6(e,t){return e.pinnedRowModel?.getPinnedTopRow(t)}function N6(e,t){return e.pinnedRowModel?.getPinnedBottomRow(t)}function H6(e,t,s){return e.pinnedRowModel?.forEachPinnedRow(t,s)}var G6={moduleName:"PinnedRow",version:K,beans:[_R],css:[k6],apiFunctions:{getPinnedTopRowCount:A6,getPinnedBottomRowCount:L6,getPinnedTopRow:O6,getPinnedBottomRow:N6,forEachPinnedRow:H6},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},B6=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(){const e=this.firstNode.__autoHeights?.[this.col.getColId()];if(e==null)return;let t=0;for(const s of this.spannedNodes)s!==this.lastNode&&(t+=s.rowHeight);return e-t}},V6=class extends A{constructor(e){super(),this.column=e}buildCache(e){const{column:t,beans:{gos:s,pinnedRowModel:o,rowModel:i,valueSvc:n,pagination:r}}=this,{colDef:a}=t,l=this.getNodeMap(e),c=new Map,d=s.getCallback("isFullWidthRow"),u=a.equals,h=a.spanRows,p=typeof h=="function";let f=null,C=null,v;const w=(S,y)=>{f=S,C=null,v=y},b=S=>{const y=!S.isExpandable()&&!S.group&&!S.detail&&(d?!d({rowNode:S}):!0);if(S.rowIndex==null||!y){w(null,null);return}if(f==null||S.level!==f.level||S.footer||C&&S.rowIndex-1!==C?.getLastNode().rowIndex){w(S,n.getValue(t,S));return}const x=n.getValue(t,S);if(p){const R=he(s,{valueA:v,nodeA:f,valueB:x,nodeB:S,column:t,colDef:a});if(!h(R)){w(S,x);return}}else if(u?!u(v,x):v!==x){w(S,x);return}if(!C){const R=l?.get(f);R?.firstNode===f?(R.reset(),C=R):C=new B6(t,f),c.set(f,C)}C.addSpannedNode(S),c.set(S,C)};switch(e){case"center":i.forEachDisplayedNode?.(S=>{(!r||r.isRowInPage(S.rowIndex))&&b(S)}),this.centerValueNodeMap=c;break;case"top":o?.forEachPinnedRow("top",b),this.topValueNodeMap=c;break;case"bottom":o?.forEachPinnedRow("bottom",b),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}}},z6=class extends A{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=ot(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=ot(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 s=this.createManagedBean(new V6(e));this.spanningColumns.set(e,s),s.buildCache("top"),s.buildCache("bottom"),s.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?.createCtrls("top"),t?.createCtrls("bottom")},0);return}this.modelTimeout==null&&(this.modelTimeout=window.setTimeout(()=>{this.modelTimeout=null,this.buildModelCaches(),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 s=this.spanningColumns.get(e);return s?s.isCellSpanning(t):!1}getCellSpanByPosition(e){const{pinnedRowModel:t,rowModel:s}=this.beans,o=e.column,i=e.rowIndex,n=this.spanningColumns.get(o);if(!n)return;let r;switch(e.rowPinned){case"top":r=t?.getPinnedTopRow(i);break;case"bottom":r=t?.getPinnedBottomRow(i);break;default:r=s.getRow(i)}if(r)return n.getCellSpan(r)}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 s=this.spanningColumns.get(e);if(s)return s.getCellSpan(t)}forEachSpannedColumn(e,t){for(const[s,o]of this.spanningColumns)if(o.isCellSpanning(e)){const i=o.getCellSpan(e);t(s,i)}}destroy(){super.destroy(),this.spanningColumns.clear()}},W6=class extends Jo{constructor(e,t,s){super(e.col,e.firstNode,s,t),this.cellSpan=e,this.SPANNED_CELL_CSS_CLASS="ag-spanned-cell"}setComp(e,t,s,o,i,n,r){this.eWrapper=s,super.setComp(e,t,s,o,i,n,r),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||tp(e,t.rowIndex)}setAriaRowSpan(){Lb(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(Ea(t)){this.focusedCellPosition=void 0;return}const s=this.isCellFocused();s||(this.focusedCellPosition=void 0),e&&s&&(this.focusedCellPosition={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column}),super.onCellFocused(e)}getRootElement(){return this.eWrapper}},_6=class extends Jr{onRowIndexChanged(){super.onRowIndexChanged();for(const e of this.getAllCellCtrls())e.refreshAriaRowIndex()}getInitialRowClasses(e){return["ag-spanned-row"]}getNewCellCtrl(e){const t=this.beans.rowSpanSvc?.getCellSpan(e,this.rowNode);if(!(!t||t.firstNode!==this.rowNode))return new W6(t,this,this.beans)}isCorrectCtrlForSpan(e){const t=this.beans.rowSpanSvc?.getCellSpan(e.column,this.rowNode);return!t||t.firstNode!==this.rowNode?!1:e.getCellSpan()===t}onRowHeightChanged(){}refreshFirstAndLastRowStyles(){}addHoverFunctionality(){}resetHoveredStatus(){}},j6=class extends A{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,s=this.getCtrlsMap(e),o=s.size,i=this.getAllRelevantRowControls(e),n=new Map;let r=!1;for(const l of i)l.isAlive()&&t?.forEachSpannedColumn(l.rowNode,(c,d)=>{if(n.has(d.firstNode))return;const u=s.get(d.firstNode);if(u){n.set(d.firstNode,u),s.delete(d.firstNode);return}r=!0;const h=new _6(d.firstNode,this.beans,!1,!1,!1);n.set(d.firstNode,h)});this.setCtrlsMap(e,n);const a=n.size===o;if(!(!r&&a)){for(const l of s.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,s=t?.getCellSpanByPosition(e);if(!s)return;const o=this.getCtrlsMap(e.rowPinned).get(s.firstNode);if(o)return o.getAllCellCtrls().find(i=>i.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")}},U6={moduleName:"CellSpan",version:K,beans:[z6,j6]},$6=class extends A{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,s=e.colDef,o=s.cellClassRules,i=this.getCellClassParams(e,s);_d(this.beans.expressionSvc,o===this.cellClassRules?void 0:this.cellClassRules,o,i,n=>t.toggleCss(n,!0),n=>t.toggleCss(n,!1)),this.cellClassRules=o}applyUserStyles(){const e=this.column,t=e.colDef,s=t.cellStyle;if(!s)return;let o;if(typeof s=="function"){const i=this.getCellClassParams(e,t);o=s(i)}else o=s;o&&this.cellComp.setUserStyles(o)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,s=e.colDef,o=this.getCellClassParams(e,s);for(const n of this.staticClasses)t.toggleCss(n,!1);const i=this.beans.cellStyles.getStaticCellClasses(s,o);this.staticClasses=i;for(const n of i)t.toggleCss(n,!0)}getCellClassParams(e,t){const{value:s,rowNode:o}=this.cellCtrl;return he(this.beans.gos,{value:s,data:o.data,node:o,colDef:t,column:e,rowIndex:o.rowIndex})}},K6=class extends A{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,s,o){_d(this.beans.expressionSvc,void 0,e.cellClassRules,t,s,o),this.processStaticCellClasses(e,t,s)}getStaticCellClasses(e,t){const{cellClass:s}=e;if(!s)return[];let o;return typeof s=="function"?o=s(t):o=s,typeof o=="string"&&(o=[o]),o||[]}createCellCustomStyleFeature(e,t){return new $6(e,t)}processStaticCellClasses(e,t,s){this.getStaticCellClasses(e,t).forEach(i=>{s(i)})}},q6={moduleName:"CellStyle",version:K,beans:[K6]},Y6={moduleName:"RowStyle",version:K,beans:[L3]};function Z6(e,t){return!!e.colHover?.isHovered(t)}var X6=class extends A{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=s=>{const{beans:o,gos:i,element:n,columns:r}=this,a=o.colHover;if(s??!!i.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(n,{mouseover:a.setMouseOver.bind(a,r),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}},Q6="ag-column-hover",J6=class extends A{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,s){const o=()=>{const i=this.isHovered(s);t.toggleCss("ag-column-hover",i)};e.addManagedEventListeners({columnHoverChanged:o}),o()}onCellColumnHover(e,t){if(!t)return;const s=this.isHovered(e);t.toggleCss(Q6,s)}addHeaderFilterColumnHoverListener(e,t,s,o){this.createHoverFeature(e,[s],o);const i=()=>{const n=this.isHovered(s);t.toggleCss("ag-column-hover",n)};e.addManagedEventListeners({columnHoverChanged:i}),i()}createHoverFeature(e,t,s){e.createManagedBean(new X6(t,s))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},eI={moduleName:"ColumnHover",version:K,beans:[J6],apiFunctions:{isColumnHovered:Z6}},tI=class extends A{constructor(){super(...arguments),this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){this.wrapSvc=this.beans.frameworkOverrides.createGlobalEventListenerWrapper?.()}addListener(e,t){const s=this.wrapSvc?.wrap(e,t)??t,o=!Dr.has(e),i=o?this.asyncListeners:this.syncListeners;i.has(e)||i.set(e,new Set),i.get(e).add(s),this.eventSvc.addListener(e,s,o)}removeListener(e,t){const s=this.wrapSvc?.unwrap(e,t)??t,i=!!this.asyncListeners.get(e)?.delete(s);i||this.syncListeners.get(e)?.delete(s),this.eventSvc.removeListener(e,s,i)}addGlobalListener(e){const t=this.wrapSvc?.wrapGlobal(e)??e,s=(n,r)=>{Dr.has(n)&&t(n,r)},o=(n,r)=>{Dr.has(n)||t(n,r)};this.globalListenerPairs.set(e,{syncListener:s,asyncListener:o});const i=this.eventSvc;i.addGlobalListener(s,!1),i.addGlobalListener(o,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:s,globalListenerPairs:o}=this,i=s?.unwrapGlobal(e)??e;if(o.has(i)){const{syncListener:r,asyncListener:a}=o.get(i);t.removeGlobalListener(r,!1),t.removeGlobalListener(a,!0),o.delete(e)}else this.syncGlobalListeners.delete(i),t.removeGlobalListener(i,!1)}destroyEventListeners(e,t){e.forEach((s,o)=>{s.forEach(i=>this.eventSvc.removeListener(o,i,t)),s.clear()}),e.clear()}destroyGlobalListeners(e,t){for(const s of e)this.eventSvc.removeGlobalListener(s,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:s,asyncListener:o})=>{t.removeGlobalListener(s,!1),t.removeGlobalListener(o,!0)}),e.clear()}};function sI(e,t,s){e.apiEventSvc?.addListener(t,s)}function oI(e,t,s){e.apiEventSvc?.removeListener(t,s)}function iI(e,t){e.apiEventSvc?.addGlobalListener(t)}function nI(e,t){e.apiEventSvc?.removeGlobalListener(t)}var rI={moduleName:"EventApi",version:K,apiFunctions:{addEventListener:sI,addGlobalListener:iI,removeEventListener:oI,removeGlobalListener:nI},beans:[tI]},aI={moduleName:"Locale",version:K,beans:[LP]},lI=class extends A{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=ot(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){const{visibleCols:e,rowModel:t,rowSpanSvc:s,pinnedRowModel:o}=this.beans,i=e.autoHeightCols;let n=!1;const r=a=>{const l=a.__autoHeights;let c=Ns(this.beans,a).height;for(const d of i){let u=l?.[d.getColId()];const h=s?.getCellSpan(d,a);if(h){if(h.getLastNode()!==a)continue;if(u=s?.getCellSpan(d,a)?.getLastNodeAutoHeight(),!u)return}if(u==null){if(this.colSpanSkipCell(d,a))continue;return}c=Math.max(u,c)}c!==a.rowHeight&&(a.setRowHeight(c),n=!0)};o?.forEachPinnedRow?.("top",r),o?.forEachPinnedRow?.("bottom",r),t.forEachDisplayedNode?.(r),n&&t.onRowHeightChanged?.()}setRowAutoHeight(e,t,s){if(e.__autoHeights??(e.__autoHeights={}),t==null){delete e.__autoHeights[s.getId()];return}const o=e.__autoHeights[s.getId()];e.__autoHeights[s.getId()]=t,o!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:s,colViewport:o,visibleCols:i}=this.beans;if(!s.colSpanActive)return!1;let n=[];switch(e.getPinned()){case"left":n=i.getLeftColsForRow(t);break;case"right":n=i.getRightColsForRow(t);break;case null:n=o.getColsWithinViewport(t);break}return!n.includes(e)}setupCellAutoHeight(e,t,s){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const o=t.parentElement,{rowNode:i,column:n}=e,r=this.beans,a=d=>{if(this.beans.editSvc?.isEditing(e)||!e.isAlive()||!s.isAlive())return;const{paddingTop:u,paddingBottom:h,borderBottomWidth:p,borderTopWidth:f}=bo(o),C=u+h+p+f,w=t.offsetHeight+C;if(d<5){const S=!Je(r)?.contains(t),y=w==0;if(S||y){window.setTimeout(()=>a(d+1),0);return}}this.setRowAutoHeight(i,w,n)},l=()=>a(0);l();const c=bs(r,t,l);return s.addDestroyFunc(()=>{c(),this.setRowAutoHeight(i,void 0,n)}),!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:s}of e)if((!t||this.beans.colModel.colSpanActive)&&(t=this.beans.colViewport.getColsWithinViewport(s).filter(i=>i.isAutoHeight())),t.length!==0){if(!s.__autoHeights)return!1;for(const o of t){const i=s.__autoHeights[o.getColId()];if(!i||s.rowHeight<i)return!1}}return!0}},cI={moduleName:"RowAutoHeight",version:K,beans:[lI]},dI={moduleName:"AllCommunity",version:K,dependsOn:[lT,mT,ET,JP,cM,dM,uM,hM,gM,pM,fM,lM,t4,s4,o4,e4,n4,r4,WT,VM,a6,Zf,C6,v6,E6,I6,z2,G6,TM,mP,q6,eI,Y6,rI,wP,NT,Bm,aI,cI,V2,cT,U6]},dt=g.createContext({}),sC=g.createContext("default"),Tn=(e,t,s,o)=>{if(!e||e.componentFromFramework||t.isDestroyed())return;const n=e.newAgStackInstance();let r,a,l=!1;return n.then(c=>{if(l){t.destroyBean(c);return}r=c,a=r.getGui(),s.appendChild(a),Zh(o,r)}),()=>{l=!0,r&&(a?.remove(),t.destroyBean(r),o&&Zh(o,void 0))}},Zh=(e,t)=>{if(e)if(e instanceof Function)e(t);else{const s=e;s.current=t}},At=(...e)=>e.filter(s=>s!=null&&s!=="").join(" "),Gt=class oC{constructor(...t){this.classesMap={};for(const s of t)this.classesMap[s]=!0}setClass(t,s){if(!!this.classesMap[t]==s)return this;const i=new oC;return i.classesMap={...this.classesMap},i.classesMap[t]=s,i}toString(){return Object.keys(this.classesMap).filter(s=>this.classesMap[s]).join(" ")}},fi=e=>{const t=()=>typeof Symbol=="function"&&Symbol.for,s=()=>t()?Symbol.for("react.memo"):60115;return typeof e=="function"&&!(e.prototype&&e.prototype.isReactComponent)||typeof e=="object"&&e.$$typeof===s()},qc=g.version?.split(".")[0],iC=qc==="16"||qc==="17";function uI(){return qc==="19"}var Mr=!1;function hI(e){return Mr||setTimeout(()=>Mr=!1,0),Mr=!0,e()}var wn=(e,t)=>{!iC&&e&&!Mr?Sn.flushSync(t):t()},gI=e=>{iC?e():g.startTransition(e)};function pI(e,t,s){return g.useSyncExternalStore?g.useSyncExternalStore(e,t):s}function sa(e,t,s){if(t==null||e==null)return t;if(e===t||t.length===0&&e.length===0)return e;if(s||e.length===0&&t.length>0||e.length>0&&t.length===0)return t;const o=[],i=[],n=new Map,r=new Map;for(let a=0;a<t.length;a++){const l=t[a];r.set(l.instanceId,l)}for(let a=0;a<e.length;a++){const l=e[a];n.set(l.instanceId,l),r.has(l.instanceId)&&o.push(l)}for(let a=0;a<t.length;a++){const l=t[a],c=l.instanceId;n.has(c)||i.push(l)}return o.length===e.length&&i.length===0?e:o.length===0&&i.length===t.length?t:o.length===0?i:i.length===0?o:[...o,...i]}var nC=g.forwardRef((e,t)=>{const{registry:s,context:o}=g.useContext(dt),i=g.useRef(null),n=g.useRef(null),r=g.useRef(null),a=g.useRef(null),l=g.useRef(null),c=g.useRef(),[d,u]=g.useState(),[h,p]=g.useState(),[f,C]=g.useState(),[v,w]=g.useState(()=>new Gt),[b,S]=g.useState(()=>new Gt("ag-hidden")),[y,x]=g.useState(()=>new Gt("ag-hidden")),[R,F]=g.useState(()=>new Gt("ag-invisible"));g.useImperativeHandle(t,()=>({refresh(){return!1}})),g.useLayoutEffect(()=>Tn(d,o,n.current),[d]);const D=g.useCallback(te=>{if(i.current=te,!te||o.isDestroyed()){c.current=o.destroyBean(c.current);return}const L={setInnerRenderer:(V,Q)=>{u(V),C(Q)},setChildCount:V=>p(V),toggleCss:(V,Q)=>w(X=>X.setClass(V,Q)),setContractedDisplayed:V=>x(Q=>Q.setClass("ag-hidden",!V)),setExpandedDisplayed:V=>S(Q=>Q.setClass("ag-hidden",!V)),setCheckboxVisible:V=>F(Q=>Q.setClass("ag-invisible",!V)),setCheckboxSpacing:V=>F(Q=>Q.setClass("ag-group-checkbox-spacing",V))},le=s.createDynamicBean("groupCellRendererCtrl",!0);le&&(c.current=o.createBean(le),c.current.init(L,te,r.current,a.current,l.current,nC,e))},[]),M=g.useMemo(()=>`ag-cell-wrapper ${v.toString()}`,[v]),k=g.useMemo(()=>`ag-group-expanded ${b.toString()}`,[b]),E=g.useMemo(()=>`ag-group-contracted ${y.toString()}`,[y]),P=g.useMemo(()=>`ag-group-checkbox ${R.toString()}`,[R]),N=d?.componentFromFramework,B=N?d.componentClass:void 0,O=d==null&&f!=null,J=hi(f);return g.createElement("span",{className:M,ref:D,...e.colDef?{}:{role:c.current?.getCellAriaRole()}},g.createElement("span",{className:k,ref:a}),g.createElement("span",{className:E,ref:l}),g.createElement("span",{className:P,ref:r}),g.createElement("span",{className:"ag-group-value",ref:n},O?J:N?g.createElement(B,{...d.params}):null),g.createElement("span",{className:"ag-group-child-count"},h))}),Xh=nC,Xd=g.createContext({setMethods:()=>{}}),fI=e=>{const{initialProps:t,addUpdateCallback:s,CustomComponentClass:o,setMethods:i}=e,[{key:n,...r},a]=g.useState(t);return g.useEffect(()=>{s(l=>a(l))},[]),g.createElement(Xd.Provider,{value:{setMethods:i}},g.createElement(o,{key:n,...r}))},mI=g.memo(fI),CI=0;function Qh(){return`agPortalKey_${++CI}`}var rC=class{constructor(e,t,s,o){this.portal=null,this.oldPortal=null,this.reactComponent=e,this.portalManager=t,this.componentType=s,this.suppressFallbackMethods=!!o,this.statelessComponent=this.isStateless(this.reactComponent),this.key=Qh(),this.portalKey=Qh(),this.instanceCreated=this.isStatelessComponent()?Ee.resolve(!1):new Ee(i=>{this.resolveInstanceCreated=i})}getGui(){return this.eParentElement}getRootElement(){return this.eParentElement.firstChild}destroy(){this.componentInstance&&typeof this.componentInstance.destroy=="function"&&this.componentInstance.destroy();const e=this.portal;e&&this.portalManager.destroyPortal(e)}createParentElement(e){const t=this.portalManager.getComponentWrappingElement(),s=document.createElement(t||"div");return s.classList.add("ag-react-container"),e.reactContainer=s,s}statelessComponentRendered(){return this.eParentElement.childElementCount>0||this.eParentElement.childNodes.length>0}getFrameworkComponentInstance(){return this.componentInstance}isStatelessComponent(){return this.statelessComponent}getReactComponentName(){return this.reactComponent.name}getMemoType(){return this.hasSymbol()?Symbol.for("react.memo"):60115}hasSymbol(){return typeof Symbol=="function"&&Symbol.for}isStateless(e){return typeof e=="function"&&!(e.prototype&&e.prototype.isReactComponent)||typeof e=="object"&&e.$$typeof===this.getMemoType()}hasMethod(e){const t=this.getFrameworkComponentInstance();return!!t&&t[e]!=null||this.fallbackMethodAvailable(e)}callMethod(e,t){const s=this.getFrameworkComponentInstance();if(this.isStatelessComponent())return this.fallbackMethod(e,t&&t[0]?t[0]:{});if(!s){setTimeout(()=>this.callMethod(e,t));return}const o=s[e];if(o)return o.apply(s,t);if(this.fallbackMethodAvailable(e))return this.fallbackMethod(e,t&&t[0]?t[0]:{})}addMethod(e,t){this[e]=t}init(e){return this.eParentElement=this.createParentElement(e),this.createOrUpdatePortal(e),new Ee(t=>this.createReactComponent(t))}createOrUpdatePortal(e){this.isStatelessComponent()||(this.ref=t=>{this.componentInstance=t,this.resolveInstanceCreated?.(!0),this.resolveInstanceCreated=void 0},e.ref=this.ref),this.reactElement=this.createElement(this.reactComponent,{...e,key:this.key}),this.portal=Sn.createPortal(this.reactElement,this.eParentElement,this.portalKey)}createElement(e,t){return g.createElement(e,t)}createReactComponent(e){this.portalManager.mountReactPortal(this.portal,this,e)}rendered(){return this.isStatelessComponent()&&this.statelessComponentRendered()||!!(!this.isStatelessComponent()&&this.getFrameworkComponentInstance())}refreshComponent(e){this.oldPortal=this.portal,this.createOrUpdatePortal(e),this.portalManager.updateReactPortal(this.oldPortal,this.portal)}fallbackMethod(e,t){const s=this[`${e}Component`];if(!this.suppressFallbackMethods&&s)return s.bind(this)(t)}fallbackMethodAvailable(e){return this.suppressFallbackMethods?!1:!!this[`${e}Component`]}};function ka(e,t,s){for(const o of e){const i=t[o];i&&(s[o]=i)}}var Pt=class extends rC{constructor(){super(...arguments),this.awaitUpdateCallback=new Ee(e=>{this.resolveUpdateCallback=e}),this.wrapperComponent=mI}init(e){return this.sourceParams=e,super.init(this.getProps())}addMethod(){}getInstance(){return this.instanceCreated.then(()=>this.componentInstance)}getFrameworkComponentInstance(){return this}createElement(e,t){return super.createElement(this.wrapperComponent,{initialProps:t,CustomComponentClass:e,setMethods:s=>this.setMethods(s),addUpdateCallback:s=>{this.updateCallback=()=>(s(this.getProps()),new Ee(o=>{setTimeout(()=>{o()})})),this.resolveUpdateCallback()}})}setMethods(e){this.providedMethods=e,ka(this.getOptionalMethods(),this.providedMethods,this)}getOptionalMethods(){return[]}getProps(){return{...this.sourceParams,key:this.key,ref:this.ref}}refreshProps(){return this.updateCallback?this.updateCallback():new Ee(e=>this.awaitUpdateCallback.then(()=>{this.updateCallback().then(()=>e())}))}},vI=class extends Pt{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},wI=class extends Pt{constructor(){super(...arguments),this.date=null,this.onDateChange=e=>this.updateDate(e)}getDate(){return this.date}setDate(e){this.date=e,this.refreshProps()}refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled"]}updateDate(e){this.setDate(e),this.sourceParams.onDateChanged()}getProps(){const e=super.getProps();return e.date=this.date,e.onDateChange=this.onDateChange,delete e.onDateChanged,e}},bI=class extends Pt{constructor(){super(...arguments),this.label="",this.icon=null,this.shake=!1}setIcon(e,t){this.icon=e,this.shake=t,this.refreshProps()}setLabel(e){this.label=e,this.refreshProps()}getProps(){const e=super.getProps(),{label:t,icon:s,shake:o}=this;return e.label=t,e.icon=s,e.shake=o,e}},SI=class extends Pt{constructor(){super(...arguments),this.model=null,this.onModelChange=e=>this.updateModel(e),this.onUiChange=()=>this.sourceParams.filterModifiedCallback(),this.expectingNewMethods=!0,this.hasBeenActive=!1,this.awaitSetMethodsCallback=new Ee(e=>{this.resolveSetMethodsCallback=e})}isFilterActive(){return this.model!=null}doesFilterPass(e){return this.providedMethods.doesFilterPass(e)}getModel(){return this.model}setModel(e){return this.expectingNewMethods=!0,this.model=e,this.hasBeenActive||(this.hasBeenActive=this.isFilterActive()),this.refreshProps()}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}afterGuiAttached(e){const t=this.providedMethods;t?t.afterGuiAttached?.(e):this.awaitSetMethodsCallback.then(()=>this.providedMethods?.afterGuiAttached?.(e))}getOptionalMethods(){return["afterGuiDetached","onNewRowsLoaded","getModelAsString","onAnyFilterChanged"]}setMethods(e){this.expectingNewMethods===!1&&this.hasBeenActive&&this.providedMethods?.doesFilterPass!==e?.doesFilterPass&&setTimeout(()=>{this.sourceParams.filterChangedCallback()}),this.expectingNewMethods=!1,super.setMethods(e),this.resolveSetMethodsCallback(),this.resolveFilterPassCallback?.(),this.resolveFilterPassCallback=void 0}updateModel(e){this.resolveFilterPassCallback?.();const t=new Ee(s=>{this.resolveFilterPassCallback=s});this.setModel(e).then(()=>{t.then(()=>{this.sourceParams.filterChangedCallback()})})}getProps(){const e=super.getProps();return e.model=this.model,e.onModelChange=this.onModelChange,e.onUiChange=this.onUiChange,delete e.filterChangedCallback,e}},yI=class extends Pt{constructor(){super(...arguments),this.awaitSetMethodsCallback=new Ee(e=>{this.resolveSetMethodsCallback=e})}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}afterGuiAttached(e){const t=this.providedMethods;t?t.afterGuiAttached?.(e):this.awaitSetMethodsCallback.then(()=>this.providedMethods?.afterGuiAttached?.(e))}getOptionalMethods(){return["afterGuiDetached","onNewRowsLoaded","onAnyFilterChanged"]}setMethods(e){super.setMethods(e),this.resolveSetMethodsCallback()}};function aC(e,t){e.parentFilterInstance(s=>{(s.setModel(t)||Ee.resolve()).then(()=>{e.filterParams.filterChangedCallback()})})}var xI=class{constructor(e,t){this.floatingFilterParams=e,this.refreshProps=t,this.model=null,this.onModelChange=s=>this.updateModel(s)}getProps(){return{...this.floatingFilterParams,model:this.model,onModelChange:this.onModelChange}}onParentModelChanged(e){this.model=e,this.refreshProps()}refresh(e){this.floatingFilterParams=e,this.refreshProps()}setMethods(e){ka(this.getOptionalMethods(),e,this)}getOptionalMethods(){return["afterGuiAttached"]}updateModel(e){this.model=e,this.refreshProps(),aC(this.floatingFilterParams,e)}},RI=class extends Pt{constructor(){super(...arguments),this.model=null,this.onModelChange=e=>this.updateModel(e)}onParentModelChanged(e){this.model=e,this.refreshProps()}refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached"]}updateModel(e){this.model=e,this.refreshProps(),aC(this.sourceParams,e)}getProps(){const e=super.getProps();return e.model=this.model,e.onModelChange=this.onModelChange,e}},FI=class extends Pt{refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached"]}},EI=class extends Pt{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},DI=class extends Pt{refresh(e){this.sourceParams=e,this.refreshProps()}},PI=class extends Pt{constructor(){super(...arguments),this.active=!1,this.expanded=!1,this.onActiveChange=e=>this.updateActive(e)}setActive(e){this.awaitSetActive(e)}setExpanded(e){this.expanded=e,this.refreshProps()}getOptionalMethods(){return["select","configureDefaults"]}awaitSetActive(e){return this.active=e,this.refreshProps()}updateActive(e){const t=this.awaitSetActive(e);e&&t.then(()=>this.sourceParams.onItemActivated())}getProps(){const e=super.getProps();return e.active=this.active,e.expanded=this.expanded,e.onActiveChange=this.onActiveChange,delete e.onItemActivated,e}},MI=class extends Pt{refresh(e){this.sourceParams=e,this.refreshProps()}},TI=class extends Pt{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},II=class extends Pt{constructor(){super(...arguments),this.onStateChange=e=>this.updateState(e)}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}getState(){return this.state}updateState(e){this.state=e,this.refreshProps(),this.sourceParams.onStateUpdated()}getProps(){const e=super.getProps();return e.state=this.state,e.onStateChange=this.onStateChange,e}};function Qd(){G(231)}var kI=1e3,AI=class{constructor(e,t,s){this.destroyed=!1,this.portals=[],this.hasPendingPortalUpdate=!1,this.wrappingElement=t||"div",this.refresher=e,this.maxComponentCreationTimeMs=s||kI}getPortals(){return this.portals}destroy(){this.destroyed=!0}destroyPortal(e){this.portals=this.portals.filter(t=>t!==e),this.batchUpdate()}getComponentWrappingElement(){return this.wrappingElement}mountReactPortal(e,t,s){this.portals=[...this.portals,e],this.waitForInstance(t,s),this.batchUpdate()}updateReactPortal(e,t){this.portals[this.portals.indexOf(e)]=t,this.batchUpdate()}batchUpdate(){this.hasPendingPortalUpdate||(setTimeout(()=>{this.destroyed||(this.refresher(),this.hasPendingPortalUpdate=!1)}),this.hasPendingPortalUpdate=!0)}waitForInstance(e,t,s=Date.now()){if(this.destroyed){t(null);return}if(e.rendered())t(e);else{if(Date.now()-s>=this.maxComponentCreationTimeMs&&!this.hasPendingPortalUpdate){wn(!0,()=>this.refresher()),e.rendered()&&t(e);return}window.setTimeout(()=>{this.waitForInstance(e,t,s)})}}},LI=({ctrl:e})=>{const t=e.isAlive(),{context:s}=g.useContext(dt),[o,i]=g.useState(),[n,r]=g.useState(),a=g.useRef(),l=g.useRef(null),c=g.useRef(null),d=g.useRef(null),u=g.useRef(),h=g.useRef();t&&!h.current&&(h.current=new Fn(()=>l.current));const p=g.useCallback(w=>{if(l.current=w,!w||!e.isAlive()||s.isDestroyed()){a.current=s.destroyBean(a.current);return}a.current=s.createBean(new gi);const b=()=>{const y=e.getSelectAllGui();y&&(c.current?.insertAdjacentElement("afterend",y),a.current.addDestroyFunc(()=>y.remove()))},S={setWidth:y=>{l.current&&(l.current.style.width=y)},toggleCss:(y,x)=>h.current.toggleCss(y,x),setUserStyles:y=>r(y),setAriaSort:y=>{l.current&&(y?Hb(l.current,y):Gb(l.current))},setUserCompDetails:y=>i(y),getUserCompInstance:()=>u.current||void 0,refreshSelectAllGui:b,removeSelectAllGui:()=>e.getSelectAllGui()?.remove()};e.setComp(S,w,c.current,d.current,a.current),b()},[]);g.useLayoutEffect(()=>Tn(o,s,d.current,u),[o]),g.useEffect(()=>{e.setDragSource(l.current)},[o]);const f=g.useMemo(()=>!!(o?.componentFromFramework&&fi(o.componentClass)),[o]),C=o?.componentFromFramework,v=o?.componentClass;return g.createElement("div",{ref:p,style:n,className:"ag-header-cell",role:"columnheader"},g.createElement("div",{ref:c,className:"ag-header-cell-resize",role:"presentation"}),g.createElement("div",{ref:d,className:"ag-header-cell-comp-wrapper",role:"presentation"},C?f?g.createElement(v,{...o.params}):g.createElement(v,{...o.params,ref:u}):null))},OI=g.memo(LI),NI=class{constructor(e,t){this.floatingFilterParams=e,this.refreshProps=t}getProps(){return this.floatingFilterParams}refresh(e){this.floatingFilterParams=e,this.refreshProps()}setMethods(e){ka(this.getOptionalMethods(),e,this)}getOptionalMethods(){return["afterGuiAttached"]}},HI=({ctrl:e})=>{const{context:t,gos:s}=g.useContext(dt),[o,i]=g.useState(),[n,r]=g.useState(()=>new Gt("ag-header-cell","ag-floating-filter")),[a,l]=g.useState(()=>new Gt),[c,d]=g.useState(()=>new Gt("ag-floating-filter-button","ag-hidden")),[u,h]=g.useState("false"),[p,f]=g.useState(),[,C]=g.useState(1),v=g.useRef(),w=g.useRef(null),b=g.useRef(null),S=g.useRef(null),y=g.useRef(null),x=g.useRef(),R=g.useRef(),F=V=>{V!=null&&x.current&&x.current(V)},D=g.useCallback(V=>{if(w.current=V,!V||!e.isAlive()||t.isDestroyed()){v.current=t.destroyBean(v.current);return}v.current=t.createBean(new gi),R.current=new Ee(X=>{x.current=X});const Q={toggleCss:(X,$)=>r(q=>q.setClass(X,$)),setUserStyles:X=>i(X),addOrRemoveBodyCssClass:(X,$)=>l(q=>q.setClass(X,$)),setButtonWrapperDisplayed:X=>{d($=>$.setClass("ag-hidden",!X)),h(X?"false":"true")},setWidth:X=>{w.current&&(w.current.style.width=X)},setCompDetails:X=>f(X),getFloatingFilterComp:()=>R.current?R.current:null,setMenuIcon:X=>y.current?.appendChild(X)};e.setComp(Q,V,y.current,b.current,v.current)},[]);g.useLayoutEffect(()=>Tn(p,t,b.current,F),[p]);const M=g.useMemo(()=>n.toString(),[n]),k=g.useMemo(()=>a.toString(),[a]),E=g.useMemo(()=>c.toString(),[c]),P=g.useMemo(()=>!!(p&&p.componentFromFramework&&fi(p.componentClass)),[p]),N=g.useMemo(()=>s.get("reactiveCustomComponents"),[]),B=g.useMemo(()=>s.get("enableFilterHandlers"),[]),[O,J]=g.useState();g.useEffect(()=>{if(p?.componentFromFramework)if(N){const V=B?NI:xI,Q=new V(p.params,()=>C(X=>X+1));F(Q),J(Q)}else Qd()},[p]);const te=O?.getProps(),L=p?.componentFromFramework,le=p?.componentClass;return g.createElement("div",{ref:D,style:o,className:M,role:"gridcell"},g.createElement("div",{ref:b,className:k,role:"presentation"},L?N?te&&g.createElement(Xd.Provider,{value:{setMethods:V=>O.setMethods(V)}},g.createElement(le,{...te})):g.createElement(le,{...p.params,ref:P?()=>{}:F}):null),g.createElement("div",{ref:S,"aria-hidden":u,className:E,role:"presentation"},g.createElement("button",{ref:y,type:"button",className:"ag-button ag-floating-filter-button-button",tabIndex:-1})))},GI=g.memo(HI),BI=({ctrl:e})=>{const{context:t}=g.useContext(dt),[s,o]=g.useState(),[i,n]=g.useState(()=>new Gt),[r,a]=g.useState(()=>new Gt),[l,c]=g.useState("false"),[d,u]=g.useState(),[h,p]=g.useState(),f=g.useRef(),C=g.useRef(null),v=g.useRef(null),w=g.useRef(null),b=g.useRef(),S=g.useCallback(M=>{if(C.current=M,!M||!e.isAlive()||t.isDestroyed()){f.current=t.destroyBean(f.current);return}f.current=t.createBean(new gi);const k={setWidth:E=>{C.current&&(C.current.style.width=E)},toggleCss:(E,P)=>n(N=>N.setClass(E,P)),setUserStyles:E=>o(E),setHeaderWrapperHidden:E=>{const P=w.current;P&&(E?P.style.setProperty("display","none"):P.style.removeProperty("display"))},setHeaderWrapperMaxHeight:E=>{const P=w.current;P&&(E!=null?P.style.setProperty("max-height",`${E}px`):P.style.removeProperty("max-height"),P.classList.toggle("ag-header-cell-comp-wrapper-limited-height",E!=null))},setUserCompDetails:E=>p(E),setResizableDisplayed:E=>{a(P=>P.setClass("ag-hidden",!E)),c(E?"false":"true")},setAriaExpanded:E=>u(E),getUserCompInstance:()=>b.current||void 0};e.setComp(k,M,v.current,w.current,f.current)},[]);g.useLayoutEffect(()=>Tn(h,t,w.current),[h]),g.useEffect(()=>{C.current&&e.setDragSource(C.current)},[h]);const y=g.useMemo(()=>!!(h?.componentFromFramework&&fi(h.componentClass)),[h]),x=g.useMemo(()=>"ag-header-group-cell "+i.toString(),[i]),R=g.useMemo(()=>"ag-header-cell-resize "+r.toString(),[r]),F=h?.componentFromFramework,D=h?.componentClass;return g.createElement("div",{ref:S,style:s,className:x,role:"columnheader","aria-expanded":d},g.createElement("div",{ref:w,className:"ag-header-cell-comp-wrapper",role:"presentation"},F?y?g.createElement(D,{...h.params}):g.createElement(D,{...h.params,ref:b}):null),g.createElement("div",{ref:v,"aria-hidden":l,className:R}))},VI=g.memo(BI),zI=({ctrl:e})=>{const{gos:t,context:s}=g.useContext(dt),{topOffset:o,rowHeight:i}=g.useMemo(()=>e.getTopAndHeight(),[]),n=g.useMemo(()=>t.get("tabIndex"),[]),[r,a]=g.useState(()=>e.getAriaRowIndex()),l=e.headerRowClass,[c,d]=g.useState(()=>i+"px"),[u,h]=g.useState(()=>o+"px"),p=g.useRef(null),[f,C]=g.useState(()=>e.getUpdatedHeaderCtrls()),v=g.useRef(),w=g.useRef(null),b=g.useCallback(x=>{if(w.current=x,!x||!e.isAlive()||s.isDestroyed()){v.current=s.destroyBean(v.current);return}v.current=s.createBean(new gi);const R={setHeight:F=>d(F),setTop:F=>h(F),setHeaderCtrls:(F,D,M)=>{const k=p.current,E=sa(k,F,D);E!==k&&(p.current=E,wn(M,()=>C(E)))},setWidth:F=>{w.current&&(w.current.style.width=F)},setRowIndex:F=>{a(F)}};e.setComp(R,v.current,!1)},[]),S=g.useMemo(()=>({height:c,top:u}),[c,u]),y=g.useCallback(x=>{switch(e.type){case"group":return g.createElement(VI,{ctrl:x,key:x.instanceId});case"filter":return g.createElement(GI,{ctrl:x,key:x.instanceId});default:return g.createElement(OI,{ctrl:x,key:x.instanceId})}},[]);return g.createElement("div",{ref:b,className:l,role:"row",style:S,tabIndex:n,"aria-rowindex":r},f.map(y))},WI=g.memo(zI),_I=({pinned:e})=>{const[t,s]=g.useState(!0),[o,i]=g.useState([]),{context:n}=g.useContext(dt),r=g.useRef(null),a=g.useRef(null),l=g.useRef(),c=e==="left",d=e==="right",u=!c&&!d,h=g.useCallback(C=>{if(r.current=C,!C||n.isDestroyed()){l.current=n.destroyBean(l.current);return}l.current=n.createBean(new xR(e));const v={setDisplayed:s,setCtrls:w=>i(w),setCenterWidth:w=>{a.current&&(a.current.style.width=w)},setViewportScrollLeft:w=>{r.current&&(r.current.scrollLeft=w)},setPinnedContainerWidth:w=>{r.current&&(r.current.style.width=w,r.current.style.minWidth=w,r.current.style.maxWidth=w)}};l.current.setComp(v,r.current)},[]),p=t?"":"ag-hidden",f=()=>o.map(C=>g.createElement(WI,{ctrl:C,key:C.instanceId}));return c?g.createElement("div",{ref:h,className:"ag-pinned-left-header "+p,"aria-hidden":!t,role:"rowgroup"},f()):d?g.createElement("div",{ref:h,className:"ag-pinned-right-header "+p,"aria-hidden":!t,role:"rowgroup"},f()):u?g.createElement("div",{ref:h,className:"ag-header-viewport "+p,role:"rowgroup",tabIndex:-1},g.createElement("div",{ref:a,className:"ag-header-container",role:"presentation"},f())):null},Ql=g.memo(_I),jI=()=>{const[e,t]=g.useState(()=>new Gt),[s,o]=g.useState(),{context:i}=g.useContext(dt),n=g.useRef(null),r=g.useRef(),a=g.useCallback(d=>{if(n.current=d,!d||i.isDestroyed()){r.current=i.destroyBean(r.current);return}r.current=i.createBean(new wR);const u={toggleCss:(h,p)=>t(f=>f.setClass(h,p)),setHeightAndMinHeight:h=>o(h)};r.current.setComp(u,d,d)},[]),l=g.useMemo(()=>"ag-header "+e.toString(),[e]),c=g.useMemo(()=>({height:s,minHeight:s}),[s]);return g.createElement("div",{ref:a,className:l,style:c,role:"presentation"},g.createElement(Ql,{pinned:"left"}),g.createElement(Ql,{pinned:null}),g.createElement(Ql,{pinned:"right"}))},UI=g.memo(jI),$I=(e,t)=>{g.useEffect(()=>{const s=t.current;if(s){const o=s.parentElement;if(o){const i=document.createComment(e);return o.insertBefore(i,s),()=>{i.remove()}}}},[e])},qs=$I,KI=class{constructor(e,t){this.cellEditorParams=e,this.refreshProps=t,this.instanceCreated=new Ee(s=>{this.resolveInstanceCreated=s}),this.onValueChange=s=>this.updateValue(s),this.value=e.value}getProps(){return{...this.cellEditorParams,initialValue:this.cellEditorParams.value,value:this.value,onValueChange:this.onValueChange}}getValue(){return this.value}refresh(e){this.cellEditorParams=e,this.refreshProps()}setMethods(e){ka(this.getOptionalMethods(),e,this)}getInstance(){return this.instanceCreated.then(()=>this.componentInstance)}setRef(e){this.componentInstance=e,this.resolveInstanceCreated?.(),this.resolveInstanceCreated=void 0}getOptionalMethods(){return["isCancelBeforeStart","isCancelAfterEnd","focusIn","focusOut","afterGuiAttached","getValidationErrors","getValidationElement"]}updateValue(e){this.value=e,this.refreshProps()}},qI=e=>{const t=g.useRef(e),s=g.useRef(),o=g.useRef(!1),i=g.useRef(!1),[,n]=g.useState(0);o.current&&(i.current=!0),g.useEffect(()=>(o.current||(s.current=t.current(),o.current=!0),n(r=>r+1),()=>{i.current&&s.current?.()}),[])},YI=e=>{const[t,s]=g.useState(),o=g.useContext(dt),{context:i,popupSvc:n,gos:r,editSvc:a}=o,{editDetails:l,cellCtrl:c,eParentCell:d}=e;return qI(()=>{const{compDetails:u}=l,h=r.get("stopEditingWhenCellsLoseFocus");let p,f;if(!i.isDestroyed()){f=i.createBean(a.createPopupEditorWrapper(u.params));const C=f.getGui();if(e.jsChildComp){const x=e.jsChildComp.getGui();x&&C.appendChild(x)}const{column:v,rowNode:w}=c,b={column:v,rowNode:w,type:"popupCellEditor",eventSource:d,ePopup:C,position:l.popupPosition,keepWithinBounds:!0},S=n?.positionPopupByComponent.bind(n,b),y=n?.addPopup({modal:h,eChild:C,closeOnEsc:!0,closedCallback:()=>{c.onPopupEditorClosed()},anchorToElement:d,positionCallback:S,ariaOwns:d});p=y?y.hideFunc:void 0,s(f),e.jsChildComp?.afterGuiAttached?.()}return()=>{p?.(),i.destroyBean(f)}}),g.useLayoutEffect(()=>()=>{c.isCellFocused()&&t?.getGui().contains(ze(o))&&d.focus({preventScroll:!0})},[t]),t&&e.wrappedContent?Sn.createPortal(e.wrappedContent,t.getGui()):null},Jh=g.memo(YI),ZI=(e,t,s)=>{const{compProxy:o}=e;s(o);const i=o.getProps(),n=fi(t);return g.createElement(Xd.Provider,{value:{setMethods:r=>o.setMethods(r)}},n?g.createElement(t,{...i}):g.createElement(t,{...i,ref:r=>o.setRef(r)}))},eg=(e,t,s)=>e.compProxy?ZI(e,t,s):g.createElement(t,{...e.compDetails.params,ref:s}),XI=(e,t,s,o,i)=>{const n=e.compDetails,r=n.componentClass,a=n.componentFromFramework&&!e.popup,l=n.componentFromFramework&&e.popup,c=!n.componentFromFramework&&e.popup;return a?eg(e,r,t):l?g.createElement(Jh,{editDetails:e,cellCtrl:o,eParentCell:s,wrappedContent:eg(e,r,t)}):c&&i?g.createElement(Jh,{editDetails:e,cellCtrl:o,eParentCell:s,jsChildComp:i}):null},QI=(e,t,s,o,i,n)=>{const{context:r}=g.useContext(dt),a=g.useCallback(()=>{const l=i.current;if(!l)return;const c=l.getGui();c&&c.parentElement&&c.remove(),r.destroyBean(l),i.current=void 0},[]);g.useEffect(()=>{const l=e!=null,c=e?.compDetails&&!e.compDetails.componentFromFramework,d=t&&s==null;if(!(l&&c&&!d)){a();return}const h=e.compDetails;if(i.current){const f=i.current,v=f.refresh!=null&&e.force==!1?f.refresh(h.params):!1;if(v===!0||v===void 0)return;a()}h.newAgStackInstance().then(f=>{if(!f)return;const C=f.getGui();if(!C)return;(t?s:n.current).appendChild(C),i.current=f})},[e,t,o]),g.useEffect(()=>a,[])},lC=QI,JI=({cellCtrl:e,parent:t})=>{const s=g.useRef(),o=g.useMemo(()=>{const{loadingComp:i}=e.getDeferLoadingCellRenderer();return i?{value:void 0,compDetails:i,force:!1}:void 0},[e]);if(lC(o,!1,void 0,1,s,t),o?.compDetails?.componentFromFramework){const i=o.compDetails.componentClass;return g.createElement(i,{...o.compDetails.params})}return g.createElement(g.Fragment,null)},ek=({cellCtrl:e,printLayout:t,editingCell:s})=>{const o=g.useContext(dt),{context:i}=o,{column:{colIdSanitised:n},instanceId:r}=e,a=g.useRef(),[l,c]=g.useState(()=>e.isCellRenderer()?void 0:{compDetails:void 0,value:e.getValueToDisplay(),force:!1}),[d,u]=g.useState(),[h,p]=g.useState(1),[f,C]=g.useState(),[v,w]=g.useState(!1),[b,S]=g.useState(!1),[y,x]=g.useState(!1),[R,F]=g.useState(),D=g.useMemo(()=>e.isForceWrapper(),[e]),M=g.useMemo(()=>e.getCellAriaRole(),[e]),k=g.useRef(null),E=g.useRef(null),P=g.useRef(null),N=g.useRef(),B=g.useRef(),O=g.useRef(),J=g.useRef([]),te=g.useRef(),L=g.useRef(),[le,V]=g.useState(0),Q=g.useCallback(de=>{L.current=de,V(ye=>ye+1)},[]),X=l!=null&&(v||y||b)&&(d==null||!!d.popup),$=D||X,q=g.useMemo(()=>e.getCellValueClass(),[e]),ee=g.useCallback(de=>{if(B.current=de,de){const ye=de.isCancelBeforeStart&&de.isCancelBeforeStart();setTimeout(()=>{ye?(e.stopEditing(!0),e.focusCell(!0)):(e.cellEditorAttached(),e.enableEditorTooltipFeature(de))})}},[e]),ge=g.useRef();ge.current||(ge.current=new Fn(()=>k.current)),lC(l,$,L.current,le,N,k);const H=g.useRef();g.useLayoutEffect(()=>{const de=H.current,ye=l;if(H.current=l,de==null||de.compDetails==null||ye==null||ye.compDetails==null)return;te.current?.refreshVisibility();const _=de.compDetails,we=ye.compDetails;if(_.componentClass!=we.componentClass||P.current?.refresh==null)return;P.current.refresh(we.params)!=!0&&p(xe=>xe+1)},[l]),g.useLayoutEffect(()=>{if(!(d&&!d.compDetails.componentFromFramework)||i.isDestroyed())return;const ye=d.compDetails,_=d.popup===!0,we=ye.newAgStackInstance();return we.then(pe=>{if(!pe)return;const xe=pe.getGui();ee(pe),_||((D?O:k).current?.appendChild(xe),pe.afterGuiAttached?.()),F(pe)}),()=>{we.then(pe=>{const xe=pe.getGui();e.disableEditorTooltipFeature(),i.destroyBean(pe),ee(void 0),F(void 0),xe?.remove()})}},[d]);const I=g.useCallback(de=>{if(O.current=de,!de||i.isDestroyed()||!e.isAlive()){const we=J.current;J.current=[];for(const pe of we)pe();return}let ye;const _=we=>{we&&(de.insertAdjacentElement("afterbegin",we.getGui()),J.current.push(()=>{Os(we.getGui()),i.destroyBean(we),te.current===ye&&(te.current=void 0)}))};v&&_(e.createSelectionCheckbox()),y&&_(e.createDndSource()),b&&(ye=e.createRowDragComp(),te.current=ye,ye&&(_(ye),ye.refreshVisibility()))},[e,i,y,b,v]),U=g.useCallback(()=>{const de=!e.isCellSpanning()||E.current,ye=k.current;if(!ye||!de||!e||!e.isAlive()||i.isDestroyed()){a.current=i.destroyBean(a.current);return}a.current=i.createBean(new gi);const _={toggleCss:(pe,xe)=>ge.current.toggleCss(pe,xe),setUserStyles:pe=>C(pe),getFocusableElement:()=>k.current,setIncludeSelection:pe=>w(pe),setIncludeRowDrag:pe=>S(pe),setIncludeDndSource:pe=>x(pe),getCellEditor:()=>B.current??null,getCellRenderer:()=>P.current??N.current,getParentOfValue:()=>L.current??O.current??k.current,setRenderDetails:(pe,xe,qe)=>{const Mt=()=>{c(je=>je?.compDetails!==pe||je?.value!==xe||je?.force!==qe?{value:xe,compDetails:pe,force:qe}:je)};if(pe?.params?.deferRender&&!e.rowNode.group){const{loadingComp:je,onReady:Wt}=e.getDeferLoadingCellRenderer();if(je){c({value:void 0,compDetails:je,force:!1}),Wt.then(()=>gI(Mt));return}}Mt()},setEditDetails:(pe,xe,qe,Mt)=>{if(pe){let je;pe.componentFromFramework&&(Mt?je=new KI(pe.params,()=>p(Wt=>Wt+1)):Qd()),u({compDetails:pe,popup:xe,popupPosition:qe,compProxy:je}),xe||c(void 0)}else e.hasBrowserFocus()&&_.getFocusableElement().focus({preventScroll:!0}),B.current=void 0,u(void 0)},refreshEditStyles:(pe,xe)=>{if(!k.current)return;const{current:qe}=ge;qe.toggleCss("ag-cell-value",!$),qe.toggleCss("ag-cell-inline-editing",!!pe&&!xe),qe.toggleCss("ag-cell-popup-editing",!!pe&&!!xe),qe.toggleCss("ag-cell-not-inline-editing",!pe||!!xe)}},we=O.current||void 0;e.setComp(_,ye,E.current??void 0,we,t,s,a.current)},[]),W=g.useCallback(de=>{k.current=de,U()},[]),ue=g.useCallback(de=>{E.current=de,U()},[]),ie=g.useMemo(()=>!!(l?.compDetails?.componentFromFramework&&fi(l.compDetails.componentClass)),[l]);g.useLayoutEffect(()=>{if(!k.current)return;const{current:de}=ge;de.toggleCss("ag-cell-value",!$),de.toggleCss("ag-cell-inline-editing",!!d&&!d.popup),de.toggleCss("ag-cell-popup-editing",!!d&&!!d.popup),de.toggleCss("ag-cell-not-inline-editing",!d||!!d.popup)});const Ce=()=>{const{compDetails:de,value:ye}=l;if(!de)return ye?.toString?.()??ye;if(de.componentFromFramework){const _=de.componentClass;return g.createElement(g.Suspense,{fallback:g.createElement(JI,{cellCtrl:e,parent:k})},ie?g.createElement(_,{...de.params,key:h}):g.createElement(_,{...de.params,key:h,ref:P}))}},ve=()=>{const de=()=>l==null?null:$?g.createElement("span",{role:"presentation",id:`cell-${r}`,className:q,ref:Q},Ce()):Ce(),ye=_=>XI(_,ee,k.current,e,R);return d!=null?d.popup?g.createElement(g.Fragment,null,de(),ye(d)):ye(d):de()},Pe=()=>g.createElement("div",{ref:W,style:f,role:M,"col-id":n},$?g.createElement("div",{className:"ag-cell-wrapper",role:"presentation",ref:I},ve()):ve());return e.isCellSpanning()?g.createElement("div",{ref:ue,className:"ag-spanned-cell-wrapper",role:"presentation"},Pe()):Pe()},tk=g.memo(ek),sk=({rowCtrl:e,containerType:t})=>{const{context:s,gos:o,editSvc:i}=g.useContext(dt),n=g.useContext(sC)==="default",r=g.useRef(),a=g.useRef(e.getDomOrder()),l=e.isFullWidth(),c=e.rowNode.displayed,[d,u]=g.useState(()=>c?e.rowNode.getRowIndexString():null),[h,p]=g.useState(()=>e.rowId),[f,C]=g.useState(()=>e.businessKey),[v,w]=g.useState(()=>e.rowStyles),b=g.useRef(null),[S,y]=g.useState(()=>null),[x,R]=g.useState(),[F,D]=g.useState(()=>c?e.getInitialRowTop(t):void 0),[M,k]=g.useState(()=>c?e.getInitialTransform(t):void 0),E=g.useRef(null),P=g.useRef(),N=g.useRef(),B=g.useRef(!1),[O,J]=g.useState(0);g.useEffect(()=>{if(B.current||!x||O>10)return;const W=E.current?.firstChild;W?(e.setupDetailRowAutoHeight(W),B.current=!0):J(ue=>ue+1)},[x,O]);const te=g.useRef();te.current||(te.current=new Fn(()=>E.current));const L=g.useRef(()=>{}),le=g.useCallback(W=>(L.current=W,()=>{L.current=()=>{}}),[]),V=pI(le,()=>b.current,[]),Q=n?V:S,X=g.useCallback(W=>{if(E.current=W,r.current=W?s.createBean(new gi):s.destroyBean(r.current),!W){e.unsetComp(t);return}if(!e.isAlive()||s.isDestroyed())return;const ue={setTop:D,setTransform:k,toggleCss:(ie,Ce)=>te.current.toggleCss(ie,Ce),setDomOrder:ie=>a.current=ie,setRowIndex:u,setRowId:p,setRowBusinessKey:C,setUserStyles:w,setCellCtrls:(ie,Ce)=>{const ve=b.current,Pe=sa(ve,ie,a.current);Pe!==ve&&(b.current=Pe,n?L.current():wn(Ce,()=>y(Pe)))},showFullWidth:ie=>{N.current=ie.params,R(ie)},getFullWidthCellRenderer:()=>P.current,getFullWidthCellRendererParams:()=>N.current,refreshFullWidth:ie=>{const Ce=ie();return N.current=Ce,H.current?(R(ve=>({...ve,params:Ce})),!0):!P.current||!P.current.refresh?!1:P.current.refresh(Ce)}};e.setComp(ue,W,t,r.current)},[]);g.useLayoutEffect(()=>Tn(x,s,E.current,P),[x]);const $=g.useMemo(()=>{const W={top:F,transform:M};return Object.assign(W,v),W},[F,M,v]),q=l&&x?.componentFromFramework,ee=!l&&Q!=null,ge=g.useMemo(()=>!!(x?.componentFromFramework&&fi(x.componentClass)),[x]),H=g.useRef(!1);g.useEffect(()=>{H.current=ge&&!!x&&!!o.get("reactiveCustomComponents")},[ge,x]);const I=()=>Q?.map(W=>g.createElement(tk,{cellCtrl:W,editingCell:i?.isEditing(W,{withOpenEditor:!0})??!1,printLayout:e.printLayout,key:W.instanceId})),U=()=>{const W=x.componentClass;return ge?g.createElement(W,{...x.params}):g.createElement(W,{...x.params,ref:P})};return g.createElement("div",{ref:X,role:"row",style:$,"row-index":d,"row-id":h,"row-business-key":f},ee?I():q?U():null)},tg=g.memo(sk),ok=({name:e})=>{const{context:t,gos:s}=g.useContext(dt),o=g.useMemo(()=>Dn(e),[e]),i=g.useRef(null),n=g.useRef(null),r=g.useRef(null),a=g.useRef([]),l=g.useRef([]),[c,d]=g.useState(()=>[]),u=!!s.get("enableCellSpan")&&!!o.getSpannedRowCtrls,h=g.useRef([]),p=g.useRef([]),[f,C]=g.useState(()=>[]),v=g.useRef(!1),w=g.useRef(),b=g.useMemo(()=>At("ag-viewport",Df(e)),[e]),S=g.useMemo(()=>At(Rr(e)),[e]),y=g.useMemo(()=>At("ag-spanning-container",_x(e)),[e]),x=o.type==="center"||u,R=x?i:n;qs(" AG Row Container "+e+" ",R);const F=g.useCallback(()=>{const O=!x||i.current!=null,J=n.current!=null,te=!u||r.current!=null;return O&&J&&te},[]),D=g.useCallback(()=>i.current==null&&n.current==null&&r.current==null,[]),M=g.useCallback(()=>{if(D()&&(w.current=t.destroyBean(w.current)),!t.isDestroyed()&&F()){const O=L=>{const le=sa(l.current,a.current,v.current);le!==l.current&&(l.current=le,wn(L,()=>d(le)))},J=L=>{const le=sa(p.current,h.current,v.current);le!==p.current&&(p.current=le,wn(L,()=>C(le)))},te={setHorizontalScroll:L=>{i.current&&(i.current.scrollLeft=L)},setViewportHeight:L=>{i.current&&(i.current.style.height=L)},setRowCtrls:({rowCtrls:L,useFlushSync:le})=>{const V=!!le&&a.current.length>0&&L.length>0;a.current=L,O(V)},setSpannedRowCtrls:(L,le)=>{const V=!!le&&h.current.length>0&&L.length>0;h.current=L,J(V)},setDomOrder:L=>{v.current!=L&&(v.current=L,O(!1))},setContainerWidth:L=>{n.current&&(n.current.style.width=L)},setOffsetTop:L=>{n.current&&(n.current.style.transform=`translateY(${L})`)}};w.current=t.createBean(new Jx(e)),w.current.setComp(te,n.current,r.current??void 0,i.current)}},[F,D]),k=g.useCallback(O=>{n.current=O,M()},[M]),E=g.useCallback(O=>{r.current=O,M()},[M]),P=g.useCallback(O=>{i.current=O,M()},[M]),N=()=>g.createElement("div",{className:S,ref:k,role:x?"presentation":"rowgroup"},c.map(O=>g.createElement(tg,{rowCtrl:O,containerType:o.type,key:O.instanceId})));if(!x)return N();const B=()=>g.createElement("div",{className:y,ref:E,role:"presentation"},f.map(O=>g.createElement(tg,{rowCtrl:O,containerType:o.type,key:O.instanceId})));return g.createElement("div",{className:b,ref:P,role:"rowgroup"},N(),u?B():null)},ik=g.memo(ok),nk=()=>{const e=g.useContext(dt),{context:t,overlays:s}=e,[o,i]=g.useState(""),[n,r]=g.useState(0),[a,l]=g.useState(0),[c,d]=g.useState("0px"),[u,h]=g.useState("0px"),[p,f]=g.useState("100%"),[C,v]=g.useState("0px"),[w,b]=g.useState("0px"),[S,y]=g.useState("100%"),[x,R]=g.useState(!0),[F,D]=g.useState(!0),[M,k]=g.useState(null),[E,P]=g.useState(""),[N,B]=g.useState(null),[O,J]=g.useState("ag-layout-normal"),te=g.useRef();te.current||(te.current=new Fn(()=>L.current));const L=g.useRef(null),le=g.useRef(null),V=g.useRef(null),Q=g.useRef(null),X=g.useRef(null),$=g.useRef(null),q=g.useRef(null),ee=g.useRef([]),ge=g.useRef([]);qs(" AG Grid Body ",L),qs(" AG Pinned Top ",le),qs(" AG Sticky Top ",V),qs(" AG Middle ",$),qs(" AG Pinned Bottom ",q);const H=g.useCallback(xe=>{if(L.current=xe,!xe||t.isDestroyed()){ee.current=t.destroyBeans(ee.current);for(const Le of ge.current)Le();ge.current=[];return}const qe=(Le,et)=>{Le.appendChild(et),ge.current.push(()=>et.remove())},Mt=Le=>{const et=t.createBean(new Le);return ee.current.push(et),et},je=(Le,et,mi)=>{qe(Le,document.createComment(mi)),qe(Le,Mt(et).getGui())};je(xe,rR," AG Fake Horizontal Scroll ");const Wt=s?.getOverlayWrapperCompClass();Wt&&je(xe,Wt," AG Overlay Wrapper "),X.current&&je(X.current,lR," AG Fake Vertical Scroll ");const Eo={setRowAnimationCssOnBodyViewport:i,setColumnCount:Le=>{L.current&&Ob(L.current,Le)},setRowCount:Le=>{L.current&&Ab(L.current,Le)},setTopHeight:r,setBottomHeight:l,setStickyTopHeight:d,setStickyTopTop:h,setStickyTopWidth:f,setTopInvisible:R,setBottomInvisible:D,setColumnMovingCss:(Le,et)=>te.current.toggleCss(Le,et),updateLayoutClasses:J,setAlwaysVerticalScrollClass:k,setPinnedTopBottomOverflowY:P,setCellSelectableCss:(Le,et)=>B(et?Le:null),setBodyViewportWidth:Le=>{$.current&&($.current.style.width=Le)},registerBodyViewportResizeListener:Le=>{if($.current){const et=bs(e,$.current,Le);ge.current.push(()=>et())}},setStickyBottomHeight:v,setStickyBottomBottom:b,setStickyBottomWidth:y,setGridRootRole:Le=>xe.setAttribute("role",Le)},Do=t.createBean(new oR);ee.current.push(Do),Do.setComp(Eo,xe,$.current,le.current,q.current,V.current,Q.current)},[]),I=g.useMemo(()=>At("ag-root","ag-unselectable",O),[O]),U=g.useMemo(()=>At("ag-body-viewport",o,O,M,N),[o,O,M,N]),W=g.useMemo(()=>At("ag-body",O),[O]),ue=g.useMemo(()=>At("ag-floating-top",x?"ag-invisible":null,N),[N,x]),ie=g.useMemo(()=>At("ag-sticky-top",N),[N]),Ce=g.useMemo(()=>At("ag-sticky-bottom",C==="0px"?"ag-invisible":null,N),[N,C]),ve=g.useMemo(()=>At("ag-floating-bottom",F?"ag-invisible":null,N),[N,F]),Pe=g.useMemo(()=>({height:n,minHeight:n,overflowY:E}),[n,E]),de=g.useMemo(()=>({height:c,top:u,width:p}),[c,u,p]),ye=g.useMemo(()=>({height:C,bottom:w,width:S}),[C,w,S]),_=g.useMemo(()=>({height:a,minHeight:a,overflowY:E}),[a,E]),we=xe=>g.createElement(ik,{name:xe,key:`${xe}-container`}),pe=({section:xe,children:qe,className:Mt,style:je})=>g.createElement("div",{ref:xe,className:Mt,role:"presentation",style:je},qe.map(we));return g.createElement("div",{ref:H,className:I},g.createElement(UI,null),pe({section:le,className:ue,style:Pe,children:["topLeft","topCenter","topRight","topFullWidth"]}),g.createElement("div",{className:W,ref:X,role:"presentation"},pe({section:$,className:U,children:["left","center","right","fullWidth"]})),pe({section:V,className:ie,style:de,children:["stickyTopLeft","stickyTopCenter","stickyTopRight","stickyTopFullWidth"]}),pe({section:Q,className:Ce,style:ye,children:["stickyBottomLeft","stickyBottomCenter","stickyBottomRight","stickyBottomFullWidth"]}),pe({section:q,className:ve,style:_,children:["bottomLeft","bottomCenter","bottomRight","bottomFullWidth"]}))},rk=g.memo(nk),ak=(e,t)=>{const{children:s,eFocusableElement:o,onTabKeyDown:i,gridCtrl:n,forceFocusOutWhenTabGuardsAreEmpty:r,isEmpty:a}=e,{context:l}=g.useContext(dt),c=g.useRef(null),d=g.useRef(null),u=g.useRef(),h=w=>{const b=w==null?void 0:parseInt(w,10).toString();for(const S of[c,d])b===void 0?S.current?.removeAttribute("tabindex"):S.current?.setAttribute("tabindex",b)};g.useImperativeHandle(t,()=>({forceFocusOutOfContainer(w){u.current?.forceFocusOutOfContainer(w)}}));const p=g.useCallback(()=>{const w=c.current,b=d.current;if(!w&&!b||l.isDestroyed()){u.current=l.destroyBean(u.current);return}if(w&&b){const S={setTabIndex:h};u.current=l.createBean(new Bf({comp:S,eTopGuard:w,eBottomGuard:b,eFocusableElement:o,onTabKeyDown:i,forceFocusOutWhenTabGuardsAreEmpty:r,focusInnerElement:y=>n.focusInnerElement(y),isEmpty:a}))}},[]),f=g.useCallback(w=>{c.current=w,p()},[p]),C=g.useCallback(w=>{d.current=w,p()},[p]),v=w=>{const b=w==="top"?Zo.TAB_GUARD_TOP:Zo.TAB_GUARD_BOTTOM;return g.createElement("div",{className:`${Zo.TAB_GUARD} ${b}`,role:"presentation",ref:w==="top"?f:C})};return g.createElement(g.Fragment,null,v("top"),s,v("bottom"))},lk=g.forwardRef(ak),ck=g.memo(lk),dk=({context:e})=>{const[t,s]=g.useState(""),[o,i]=g.useState(""),[n,r]=g.useState(null),[a,l]=g.useState(null),[c,d]=g.useState(!1),[u,h]=g.useState(),p=g.useRef(),f=g.useRef(null),C=g.useRef(),[v,w]=g.useState(null),b=g.useRef(()=>{}),S=g.useRef(),y=g.useRef([]),x=g.useCallback(()=>{},[]);qs(" AG Grid ",f);const R=g.useCallback(P=>{if(f.current=P,p.current=P?e.createBean(new n2):e.destroyBean(p.current),!P||e.isDestroyed())return;const N=p.current;b.current=N.focusInnerElement.bind(N);const B={destroyGridUi:()=>{},setRtlClass:s,forceFocusOutOfContainer:O=>{if(!O&&S.current?.isDisplayed()){S.current.forceFocusOutOfContainer(O);return}C.current?.forceFocusOutOfContainer(O)},updateLayoutClasses:i,getFocusableContainers:()=>{const O=[],J=f.current?.querySelector(".ag-root");J&&O.push({getGui:()=>J});for(const te of y.current)te.isDisplayed()&&O.push(te);return O},setCursor:r,setUserSelect:l};N.setComp(B,P,P),d(!0)},[]);g.useEffect(()=>{const P=p.current,N=f.current;if(!u||!P||!v||!N||e.isDestroyed())return;const B=[],{watermarkSelector:O,paginationSelector:J,sideBarSelector:te,statusBarSelector:L,gridHeaderDropZonesSelector:le}=P.getOptionalSelectors(),V=[];if(le){const X=e.createBean(new le.component),$=X.getGui();N.insertAdjacentElement("afterbegin",$),V.push($),B.push(X)}if(te){const X=e.createBean(new te.component),$=X.getGui(),q=v.querySelector(".ag-tab-guard-bottom");q&&(q.insertAdjacentElement("beforebegin",$),V.push($)),B.push(X),y.current.push(X)}const Q=X=>{const $=e.createBean(new X),q=$.getGui();return N.insertAdjacentElement("beforeend",q),V.push(q),B.push($),$};if(L&&Q(L.component),J){const X=Q(J.component);S.current=X,y.current.push(X)}return O&&Q(O.component),()=>{e.destroyBeans(B);for(const X of V)X.remove()}},[u,v,e]);const F=g.useMemo(()=>At("ag-root-wrapper",t,o),[t,o]),D=g.useMemo(()=>At("ag-root-wrapper-body","ag-focus-managed",o),[o]),M=g.useMemo(()=>({userSelect:a??"",WebkitUserSelect:a??"",cursor:n??""}),[a,n]),k=g.useCallback(P=>{C.current=P,h(P!==null)},[]),E=g.useCallback(()=>!p.current?.isFocusable(),[]);return g.createElement("div",{ref:R,className:F,style:M,role:"presentation"},g.createElement("div",{className:D,ref:w,role:"presentation"},c&&v&&!e.isDestroyed()&&g.createElement(dt.Provider,{value:e.getBeans()},g.createElement(ck,{ref:k,eFocusableElement:v,onTabKeyDown:x,gridCtrl:p.current,forceFocusOutWhenTabGuardsAreEmpty:!0,isEmpty:E},g.createElement(rk,null)))))},uk=g.memo(dk),hk=class extends A{postConstruct(){if(this.beans.colAutosize){const e=this.queueResizeOperationsForTick.bind(this);this.addManagedEventListeners({rowExpansionStateChanged:e,expandOrCollapseAll:e,cellValueChanged:e,rowNodeDataChanged:e,rowDataUpdated:e})}}queueResizeOperationsForTick(){const e=this.beans.colAutosize;e.shouldQueueResizeOperations=!0,setTimeout(()=>{e.processResizeOperations()},0)}areHeaderCellsRendered(){return this.beans.ctrlsSvc.getHeaderRowContainerCtrls().every(e=>e.getAllCtrls().every(t=>t.areCellsRendered()))}areCellsRendered(){return this.beans.rowRenderer.getAllRowCtrls().every(e=>e.isRowRendered()&&e.getAllCellCtrls().every(t=>!!t.eGui))}},cC={setGridApi:void 0,maxComponentCreationTimeMs:void 0,children:void 0},gk={gridOptions:void 0,modules:void 0,containerStyle:void 0,className:void 0,passGridApi:void 0,componentWrappingElement:void 0,...cC},dC=new Set(Object.keys(gk)),pk=new Set(Object.keys(cC)),uC=e=>{const t=g.useRef(),s=g.useRef(null),o=g.useRef(null),i=g.useRef([]),n=g.useRef([]),r=g.useRef(e),a=g.useRef(),l=g.useRef(),c=g.useRef(!1),[d,u]=g.useState(void 0),[,h]=g.useState(0),p=g.useCallback(w=>{if(s.current=w,!w){for(const E of i.current)E();i.current.length=0;return}const b=e.modules||[];o.current||(o.current=new AI(()=>h(E=>E+1),e.componentWrappingElement,e.maxComponentCreationTimeMs),i.current.push(()=>{o.current?.destroy(),o.current=null}));const S=N0(e.gridOptions,e,Object.keys(e).filter(E=>!dC.has(E))),y=()=>{if(c.current){const E=()=>a.current?.shouldQueueUpdates()?void 0:n.current.shift();let P=E();for(;P;)P(),P=E()}},x=new vk(y);a.current=x;const R=new hk,F={providedBeanInstances:{frameworkCompWrapper:new mk(o.current,S),renderStatus:R},modules:b,frameworkOverrides:x,setThemeOnGridDiv:!0},D=E=>{u(E),E.createBean(R),i.current.push(()=>{E.destroy()}),E.getBean("ctrlsSvc").whenReady({addDestroyFunc:P=>{i.current.push(P)}},()=>{if(E.isDestroyed())return;const P=t.current;P&&e.passGridApi?.(P)})},M=E=>{E.getBean("ctrlsSvc").whenReady({addDestroyFunc:P=>{i.current.push(P)}},()=>{for(const P of n.current)P();n.current.length=0,c.current=!0})},k=new kP;S.gridId??(S.gridId=l.current),t.current=k.create(w,S,D,M,F),i.current.push(()=>{t.current=void 0}),t.current&&(l.current=t.current.getGridId())},[]),f=g.useMemo(()=>({height:"100%",...e.containerStyle||{}}),[e.containerStyle]),C=g.useCallback(w=>{c.current&&!a.current?.shouldQueueUpdates()?w():n.current.push(w)},[]);g.useEffect(()=>{const w=fk(r.current,e);r.current=e,C(()=>{t.current&&H0(w,t.current)})},[e]);const v=!g.useSyncExternalStore||wr(e,"renderingMode")==="legacy"?"legacy":"default";return g.createElement("div",{style:f,className:e.className,ref:p},g.createElement(sC.Provider,{value:v},d&&!d.isDestroyed()?g.createElement(uk,{key:d.instanceId,context:d}):null,o.current?.getPortals()??null))};function fk(e,t){const s={};for(const o of Object.keys(t)){if(dC.has(o)){pk.has(o)&&G(274,{prop:o});continue}const i=t[o];e[o]!==i&&(s[o]=i)}return s}var mk=class extends HP{constructor(e,t){super(),this.parent=e,this.gridOptions=t}createWrapper(e,t){const s=this.gridOptions;if(wr(s,"reactiveCustomComponents")){const r=(a=>{switch(a){case"filter":return wr(s,"enableFilterHandlers")?yI:SI;case"floatingFilterComponent":return wr(s,"enableFilterHandlers")?FI:RI;case"dateComponent":return wI;case"dragAndDropImageComponent":return bI;case"loadingOverlayComponent":return DI;case"noRowsOverlayComponent":return MI;case"statusPanel":return TI;case"toolPanel":return II;case"menuItem":return PI;case"cellRenderer":return vI;case"innerHeaderComponent":return EI}})(t.name);if(r)return new r(e,this.parent,t)}else switch(t.name){case"filter":case"floatingFilterComponent":case"dateComponent":case"dragAndDropImageComponent":case"loadingOverlayComponent":case"noRowsOverlayComponent":case"statusPanel":case"toolPanel":case"menuItem":case"cellRenderer":Qd();break}const i=!t.cellRenderer&&t.name!=="toolPanel";return new rC(e,this.parent,t,i)}},Ck=g.forwardRef((e,t)=>{const s=g.useContext(dt),{registry:o,context:i,gos:n,rowModel:r}=s,[a,l]=g.useState(()=>new Gt),[c,d]=g.useState(()=>new Gt),[u,h]=g.useState(),[p,f]=g.useState(),C=g.useRef(),v=g.useRef(null),w=g.useRef(),b=g.useMemo(()=>g0(e.api.getGridId(),u?.rowModelType??"clientSide"),[e]),S=g.useMemo(()=>a.toString()+" ag-details-row",[a]),y=g.useMemo(()=>c.toString()+" ag-details-grid",[c]);t&&g.useImperativeHandle(t,()=>({refresh(){return C.current?.refresh()??!1}})),e.template&&G(230);const x=g.useCallback(F=>{if(v.current=F,!F||i.isDestroyed()){C.current=i.destroyBean(C.current),w.current?.();return}const D={toggleCss:(k,E)=>l(P=>P.setClass(k,E)),toggleDetailGridCss:(k,E)=>d(P=>P.setClass(k,E)),setDetailGrid:k=>h(k),setRowData:k=>f(k),getGui:()=>v.current},M=o.createDynamicBean("detailCellRendererCtrl",!0);if(M&&(i.createBean(M),M.init(D,e),C.current=M,n.get("detailRowAutoHeight"))){const k=()=>{if(v.current==null)return;const E=v.current.clientHeight;E!=null&&E>0&&setTimeout(()=>{e.node.setRowHeight(E),(_e(n)||So(n))&&r.onRowHeightChanged()},0)};w.current=bs(s,F,k),k()}},[]),R=g.useCallback(F=>{C.current?.registerDetailWithMaster(F)},[]);return g.createElement("div",{className:S,ref:x},u&&g.createElement(uC,{className:y,...u,modules:b,rowData:p,passGridApi:R}))}),vk=class extends Vf{constructor(e){super("react"),this.processQueuedUpdates=e,this.queueUpdates=!1,this.renderingEngine="react",this.frameworkComponents={agGroupCellRenderer:Xh,agGroupRowRenderer:Xh,agDetailCellRenderer:Ck},this.wrapIncoming=(t,s)=>s==="ensureVisible"?hI(t):t()}frameworkComponent(e){return this.frameworkComponents[e]}isFrameworkComponent(e){if(!e)return!1;const t=e.prototype;return!(t&&"getGui"in t)}getLockOnRefresh(){this.queueUpdates=!0}releaseLockOnRefresh(){this.queueUpdates=!1,this.processQueuedUpdates()}shouldQueueUpdates(){return this.queueUpdates}runWhenReadyAsync(){return uI()}},wk=class extends g.Component{constructor(){super(...arguments),this.apiListeners=[],this.setGridApi=e=>{this.api=e;for(const t of this.apiListeners)t(e)}}registerApiListener(e){this.apiListeners.push(e)}componentWillUnmount(){this.apiListeners.length=0}render(){return g.createElement(uC,{...this.props,passGridApi:this.setGridApi})}},hC=(e=>(e.Dropdown="dropdown",e.Menu="menu",e))(hC||{}),xt=(e=>(e.Click="click",e.Hover="hover",e.ContextMenu="contextMenu",e))(xt||{}),oa=(e=>(e.Item="item",e.Divider="divider",e.PlainText="plainText",e))(oa||{});const bk=Z("flex items-center gap-2 align-middle","h-auto px-0 bg-transparent border-0"),Sk=Z("z-[53] overflow-auto rounded bg-layer-0 text-primary shadow focus-visible:outline-none","w-max"),yk=Z("flex w-full cursor-pointer items-center gap-3","focus-visible:border-none focus-visible:outline-none","hover:bg-accent-primary-alpha px-3","dial-small h-[34px] rounded text-primary"),xk="opacity-75 !cursor-not-allowed",Rk="text-error",Fk="my-1 border-t border-hover border-secondary",Gi=4,Jd=({ariaLabel:e,className:t,size:s=24,onClose:o,...i})=>m.jsx(De,{"aria-label":e,className:ce("text-secondary hover:enabled:text-accent-primary",t),onClick:o,iconBefore:m.jsx(z.IconX,{size:s}),...i}),bt=({children:e,menu:t,renderOverlay:s,trigger:o=[xt.Click],placement:i,disabled:n=!1,open:r,defaultOpen:a=!1,onOpenChange:l,closable:c=!1,onClose:d,className:u,listClassName:h,outsidePressIgnoreRef:p,outsideClosable:f=!0,allowedPlacements:C,anchorToMouse:v=!1,matchReferenceWidth:w=!0,maxDropdownHeight:b})=>{const[S,y]=g.useState(a),x=r!==void 0,R=x?!!r:S,F=g.useRef(null),D=g.useCallback(H=>{x||y(H),l?.(H)},[x,l]),M=g.useId(),k=i===void 0,E=H=>"clientWidth"in H?H.clientWidth:H.getBoundingClientRect?.()?.width??0,{refs:P,floatingStyles:N,context:B}=Re.useFloating({placement:i,open:R,onOpenChange:D,whileElementsMounted:Re.autoUpdate,middleware:[Re.offset({mainAxis:Gi,crossAxis:0}),k?Re.autoPlacement({alignment:"start",crossAxis:!0,padding:Gi,allowedPlacements:C}):Re.flip({padding:Gi}),Re.shift({padding:Gi}),Re.size({padding:Gi,apply({availableWidth:H,availableHeight:I,elements:U}){const W=U.floating,ue=E(U.reference);W.style.setProperty("--fui-available-height",`${Math.floor(I)}px`),W.style.setProperty("--reference-width",w?`${Math.round(ue)}px`:"0px"),w?W.style.minWidth=`${Math.round(ue)}px`:W.style.removeProperty("min-width"),W.style.maxWidth=`${Math.floor(H)}px`;const ie=Math.floor(I);W.style.maxHeight=`${b?Math.min(ie,b):ie}px`}})]}),O=Re.useClick(B,{enabled:o.includes(xt.Click)&&!n}),J=Re.useHover(B,{enabled:o.includes(xt.Hover)&&!n,move:!1,restMs:40,delay:{open:80,close:80}}),te=Re.useDismiss(B,{bubbles:!0,referencePress:!1,outsidePress:H=>{if(!f)return!1;const I=H.target;return!(p?.current&&I instanceof Node&&p.current.contains(I))}}),L=Re.useRole(B,{role:"menu"}),{getReferenceProps:le,getFloatingProps:V}=Re.useInteractions([O,J,te,L]),Q=g.useCallback((H,I)=>{P.setPositionReference({getBoundingClientRect:()=>({width:0,height:0,x:H,y:I,top:I,left:H,right:H,bottom:I})})},[P]),X=g.useCallback(H=>{!o.includes(xt.ContextMenu)||n||(H.preventDefault(),v&&(Q(H.clientX,H.clientY),F.current=document.elementFromPoint(H.clientX,H.clientY)),D(!0))},[v,n,D,Q,o]),$=g.useCallback(H=>{!v||n||(o.includes(xt.ContextMenu)&&R&&D(!1),Q(H.clientX,H.clientY),F.current=document.elementFromPoint(H.clientX,H.clientY))},[v,n,Q,R,o,D]);g.useEffect(()=>{n&&R&&D(!1)},[n,R,D]);const q=g.useCallback(H=>I=>{H.disabled||(H.onClick?.({key:H.key,domEvent:I}),t?.onClick?.({key:H.key,domEvent:I}),D(!1))},[t,D]),ee=g.useMemo(()=>s?s():t?m.jsxs(m.Fragment,{children:[t.header&&m.jsx(m.Fragment,{children:typeof t.header=="function"?t.header():t.header}),m.jsx("div",{role:"none",className:"py-1","aria-label":"dropdown",children:t.items.map(H=>H.type===oa.Divider?m.jsx("div",{role:"separator",className:Fk},H.key):H.type===oa.PlainText?m.jsx("div",{className:ce("px-3 py-2 text-secondary dial-caption",H.className),children:H.label},H.key):m.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!H.disabled,className:Z(yk,H.disabled&&xk,H.danger&&Rk,H.className),disabled:H.disabled,onClick:q(H),children:[H.icon&&m.jsx("span",{className:Z(H.danger&&"text-error",H.disabled&&"text-secondary"),children:m.jsx(Oe,{icon:H.icon})}),m.jsx("span",{className:Z("flex-1 truncate text-left",H.danger&&"text-error",H.disabled&&"text-secondary"),"aria-labelledby":"item-text",children:H.label})]},H.key))}),t.footer&&m.jsx(m.Fragment,{children:typeof t.footer=="function"?t.footer():t.footer})]}):null,[q,t,s]),ge=le({onContextMenu:X,onMouseDown:$});return g.useEffect(()=>{if(!R)return;const H=P.reference.current;let I=null;if(H instanceof Element?I=H:F.current instanceof Element&&(I=F.current),!I)return;const U=new IntersectionObserver(([W])=>{W.isIntersecting||D(!1)},{root:null,threshold:0});return U.observe(I),()=>U.disconnect()},[R,P.reference,D]),m.jsxs(m.Fragment,{children:[m.jsx("span",{ref:P.setReference,className:Z(bk,n&&"!cursor-not-allowed opacity-75",u),"aria-haspopup":"menu","aria-expanded":R,"aria-controls":M,...ge,children:e}),R&&m.jsx(Re.FloatingPortal,{children:m.jsx(Re.FloatingFocusManager,{context:B,modal:!1,initialFocus:-1,returnFocus:!0,children:m.jsxs("div",{id:M,ref:P.setFloating,style:N,className:Z(Sk,!w&&"w-max",h),...V(),children:[c&&m.jsx("div",{className:"flex items-center justify-between px-2 pt-2",children:m.jsx(Jd,{ariaLabel:"Close dropdown",onClose:H=>{d?.(H),D(!1)}})}),ee]})})})]})},Ek="h-full",Jl={accentColor:"var(--controls-bg-accent, #5C8DEA)",backgroundColor:"var(--bg-layer-2, #141A23)",oddRowBackgroundColor:"var(--bg-layer-3, #222932)",borderColor:"var(--bg-layer-4, #333942)",rowBorder:"1px solid var(--stroke-tertiary, #090D13)",borderRadius:3,browserColorScheme:"dark",chromeBackgroundColor:"var(--bg-layer-1, #090D13)",foregroundColor:"var(--text-primary, #F3F4F6)",headerFontSize:14,headerFontWeight:600,headerTextColor:"var(--text-secondary, #7F8792)",spacing:4,wrapperBorderRadius:3,fontSize:14,fontFamily:{googleFont:"var(--theme-font, var(--font-inter))"}},ec=40,Dk=(e,t,s,o,i)=>{const n=typeof e=="string"?e.toLowerCase():e,r=typeof t=="string"?t.toLowerCase():t;return n===r?0:n?r?n>r?1:-1:i?1:-1:i?-1:1},Pk=({selectedRowIds:e,selectedRows:t,onSelectionChange:s,onSelectionChangeWithMap:o,rowData:i=[],getRowId:n,disabledRowIds:r})=>{const[a,l]=g.useState(new Map),c=t??a,d=g.useMemo(()=>new Set(c.keys()),[c]),u=g.useCallback(w=>r?.has(n(w))??!1,[r,n]),h=g.useMemo(()=>i.filter(w=>!u(w)),[i,u]),p=e!==void 0||t!==void 0;g.useEffect(()=>{if(e!==void 0&&!t){const w=new Map;i.forEach(S=>{const y=n(S);e.has(y)&&!r?.has(y)&&w.set(y,S)}),(w.size!==a.size||Array.from(w.keys()).some(S=>!a.has(S)))&&l(w)}},[e,t,i,n,r,a]);const f=g.useCallback((w,b)=>{const S=n(w);if(r?.has(S))return;const y=new Map(c);b?y.set(S,w):y.delete(S),p||l(y),o?.(y),s&&s(new Set(y.keys()),Array.from(y.values()))},[c,n,r,p,s,o]),C=g.useMemo(()=>{if(!h.length)return"unchecked";const w=h.map(n),b=w.filter(S=>d.has(S)).length;return b===0?"unchecked":b===w.length?"checked":"indeterminate"},[h,d,n]),v=g.useCallback(w=>{const b=new Map;if(w&&h.forEach(S=>{const y=n(S);b.set(y,S)}),p||l(b),o&&o(b),s){const S=new Set(b.keys()),y=Array.from(b.values());s(S,y)}},[h,n,p,s,o]);return{currentSelectedIds:d,currentSelectedRows:c,handleSelectionToggle:f,headerCheckboxState:C,handleHeaderCheckboxChange:v}};m0.registerModules([dI]);const eu=({columnDefs:e,rowData:t,additionalGridOptions:s,getContextMenuItems:o,className:i,ariaLabel:n="Data grid",withSelectionColumn:r=!0,wrapCustomCellRenderers:a=!0,disabledRowIds:l,selectedRowIds:c,selectedRows:d,selectionOnHover:u=!0,onSelectionChange:h,onSelectionChangeWithMap:p,getRowId:f=F=>String(F.id||JSON.stringify(F)),alternateOddRowColors:C=!1,filterPlaceholder:v="Enter value",emptyStateIcon:w,emptyStateTitle:b="No results found",emptyStateDescription:S="Sorry, we couldn't find any results for your search.",loading:y=!1,wrapperBorder:x=!0,withoutHeaderBorders:R=!1})=>{const[F,D]=g.useState(ec),[M,k]=g.useState(),E=g.useId(),{currentSelectedIds:P,handleSelectionToggle:N,headerCheckboxState:B,handleHeaderCheckboxChange:O}=Pk({selectedRowIds:c,selectedRows:d,onSelectionChange:h,onSelectionChangeWithMap:p,rowData:t,getRowId:f,disabledRowIds:l}),J=g.useMemo(()=>({...Jl,oddRowBackgroundColor:C?Jl.oddRowBackgroundColor:Jl.backgroundColor,wrapperBorder:x}),[C,x]),te=g.useCallback(I=>{I.api.sizeColumnsToFit(),D(ec)},[]),L=g.useCallback(I=>{if(!I.data)return"";const U=f(I.data);return Z({"ag-row-selected":P.has(U),"opacity-50":l?.has(U)})},[P,l,f]),le=g.useCallback(()=>{const I=B==="checked",U=B==="indeterminate",W="header-select-all",ue=t?.some(ie=>!l?.has(f(ie)))??!1;return m.jsx("div",{className:"flex items-center justify-center h-full header-checkbox-container",children:m.jsx(sn,{id:W,ariaLabel:"Select all rows",checked:I,disabled:!ue,"aria-disabled":!ue,indeterminate:U,className:Z(`dial-header-select ${B}`,!u&&"dial-header-select-visible"),onChange:O})})},[B,t,u,O,l,f]),V=g.useCallback(I=>{if(I.data){const U=f(I.data),W=l?.has(U),ue=I.value==null?"":String(I.value),ie=o?.(I.data)??[];return m.jsx(bt,{trigger:[xt.ContextMenu],menu:{items:ie},anchorToMouse:!0,matchReferenceWidth:!0,className:"w-full",disabled:W,children:m.jsx("span",{className:"block min-w-0 h-full max-w-full",children:m.jsx(ct,{text:ue,className:"max-w-full h-full"})})})}},[o,l,f]),Q=g.useCallback(I=>{if(!I.data)return null;const U=f(I.data),W=P.has(U),ue=l?.has(U),ie=`row-select-${U}`;return m.jsx("div",{className:"flex items-center justify-center size-full",children:m.jsx(sn,{id:ie,ariaLabel:"Select row",checked:W,disabled:ue,"aria-disabled":ue,className:Z("dial-row-select",!u&&"dial-row-select-visible",ue&&"opacity-50 cursor-not-allowed"),onChange:Ce=>{ue||!I.data||N(I.data,!!Ce)}},`${U}-${W}`)})},[P,l,f,N,u]),X=g.useCallback(I=>{const U=typeof a=="function"?a(I):!!a;if(!I.cellRenderer)return{...I,cellRenderer:V};if(!U)return I;const W=I.cellRenderer;return{...I,cellRenderer:ie=>{const Ce=ie.data?o?.(ie.data)??[]:[];let ve=null;if(typeof W=="function"){const ye=W;ve=m.jsx(ye,{...ie})}else ve=V(ie);const Pe=ie.data?f(ie.data):null,de=Pe?l?.has(Pe):!1;return m.jsx(bt,{trigger:[xt.ContextMenu],menu:{items:Ce},anchorToMouse:!0,matchReferenceWidth:!0,className:"w-full h-full",disabled:de,children:m.jsx("span",{className:"block min-w-0 max-w-full flex-1",children:ve})})}}},[l,o,f,V,a]),$=g.useMemo(()=>({colId:"__select",headerName:"",width:44,minWidth:44,suppressSizeToFit:!0,lockPosition:!0,sortable:!1,resizable:!1,filter:!1,floatingFilter:!1,cellRenderer:Q,headerComponent:le}),[Q,le]),q=g.useMemo(()=>{const I=(e??[]).map(X);return r?[$,...I]:I},[e,$,r,X]),ee=g.useMemo(()=>({minWidth:150,resizable:!0,sortable:!0,floatingFilter:!0,filter:"agTextColumnFilter",filterParams:{filterPlaceholder:v,buttons:["reset"]},comparator:Dk.bind(void 0)}),[v]),ge=I=>{const U=q.map(W=>({...W,sort:void 0}));I.api.updateGridOptions({columnDefs:U,rowData:t}),I.api.sizeColumnsToFit(),k(I.api),s?.onGridReady?.(I)};g.useEffect(()=>{M&&M.redrawRows()},[M,P]);const H=g.useCallback(()=>m.jsx(ua,{title:b,description:S,containerClassName:"gap-3",titleClassName:"mt-2 !text-lg",icon:w||m.jsx(z.IconZoomCancel,{size:100,stroke:.5,className:"text-secondary"})}),[b,S,w]);return m.jsx("div",{className:Z(Ek,i,r&&"with-selection-column",R&&"dial-without-header-borders"),"aria-label":n,role:"region","aria-busy":y,children:m.jsx("div",{className:"ag-theme-balham-dark h-full overflow-x-auto",role:"table","aria-describedby":E,children:m.jsx(wk,{rowModelType:"clientSide",headerHeight:ec,rowHeight:F,cellSelection:!1,getRowClass:L,theme:cD.withPart(WE).withParams({...J}),autoSizeStrategy:{type:"fitGridWidth"},columnDefs:q,defaultColDef:ee,onGridSizeChanged:te,onGridReady:ge,loading:y,suppressCellFocus:!0,suppressDragLeaveHidesColumns:!0,noRowsOverlayComponent:H,rowData:t,...s})})})};var ia=(e=>(e.Horizontal="horizontal",e.Vertical="vertical",e))(ia||{}),na=(e=>(e.Mobile="mobile",e.Tablet="tablet",e))(na||{});const ur=({tab:e,active:t,invalid:s,className:o,horizontal:i,onClick:n})=>{const r=ce("rounded h-[38px] items-center flex flex-row border-transparent cursor-pointer dial-small leading-4 hover:text-accent-primary",{"border-b-2 px-4":i,"border-l-2 px-3":!i}),a=ce(r,{"bg-layer-4":i,"bg-layer-1 text-secondary pointer-events-none":e.disabled,"bg-accent-primary-alpha text-primary":t&&!e.disabled,"text-primary":!t&&!e.disabled,"border-b-accent-primary":t&&i&&!e.disabled,"border-l-accent-primary":t&&!i&&!e.disabled},o);return m.jsxs("button",{role:"tab",className:a,onClick:()=>n(e.id),disabled:e.disabled,children:[m.jsx(ct,{text:e.label,contentClassName:"max-w-[200px]",className:"max-w-[200px]"}),(s||e.invalid)&&m.jsx("div",{className:"text-error pl-1",children:m.jsx(z.IconExclamationCircle,{...ae})})]})},sg=12;var Qs=(e=>(e.Undefined="undefined",e.Mobile="mobile",e.Tablet="tablet",e.Desktop="desktop",e))(Qs||{});const og=()=>typeof window<"u"&&window.innerWidth<640,ig=()=>{if(typeof window>"u")return Qs.Undefined;const e=window.innerWidth;return e>=1024?Qs.Desktop:e<640?Qs.Mobile:Qs.Tablet},Mk=()=>{const[e,t]=g.useState(ig());return g.useEffect(()=>{const s=()=>t(ig());return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),e},gC=({tabs:e,activeTab:t,onClick:s,orientation:o=ia.Horizontal,screenThreshold:i=na.Tablet,smallScreenContainerClassName:n,smallScreenDropdownItemClassName:r})=>{const[a,l]=g.useState(!1),[c,d]=g.useState(!1),[u,h]=g.useState(!1),p=Mk(),f=p===Qs.Mobile||i===na.Tablet&&p===Qs.Tablet,C=o===ia.Horizontal,v=g.useRef(null),w=g.useRef(null),b=g.useRef(null),S=e.find(R=>R.id===t),y=g.useMemo(()=>Z("flex gap-2",C?"flex-row flex-nowrap overflow-x-auto":"flex-col flex-wrap w-full"),[C]),x=g.useCallback(()=>{const R=w.current;R&&h(R.scrollWidth>R.clientWidth)},[]);return g.useEffect(()=>{x();const R=new ResizeObserver(()=>x()),F=w.current;return F&&R.observe(F),()=>R.disconnect()},[e,x]),g.useEffect(()=>{const R=b.current,F=w.current;if(!R||!F)return;const D=R.offsetLeft,M=D+R.offsetWidth,k=F.scrollLeft,E=k+F.clientWidth;D<k?F.scrollTo({left:D-sg,behavior:"smooth"}):M>E&&F.scrollTo({left:M-F.clientWidth+sg,behavior:"smooth"})},[t]),f?m.jsx("div",{role:"tablist",className:ce("h-11 flex items-center bg-layer-3 px-4",n),children:m.jsx(bt,{trigger:[xt.Click],open:a,onOpenChange:l,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],renderOverlay:()=>e.map(R=>m.jsx(ur,{tab:R,active:R.id===t,onClick:F=>{s(F),l(!1)},className:ce("w-full rounded-none h-11 items-center px-6",r)},R.id)),children:m.jsxs("div",{className:"flex gap-2 items-center h-11 cursor-pointer",children:[m.jsx(ur,{tab:S,active:!0,onClick:s,className:"rounded-none bg-transparent border-l-0 border-b-0 h-full items-center px-0"},t),m.jsx(Oe,{icon:m.jsx(z.IconChevronDown,{size:16}),className:Z("text-primary transition-transform",a&&"rotate-180")})]})})}):m.jsxs("div",{ref:v,className:"flex w-full items-start",children:[m.jsx("div",{ref:w,role:"tablist",className:y,children:e.map(R=>m.jsx("div",{ref:t===R.id?b:void 0,className:"w-full",children:m.jsx(ur,{tab:R,active:t===R.id,onClick:s,horizontal:C,className:"w-full"})},R.id))}),u&&m.jsx("div",{className:"flex items-center ml-2",children:m.jsx(bt,{trigger:[xt.Click],open:c,onOpenChange:d,placement:"bottom-end",renderOverlay:()=>e.map(R=>m.jsx(ur,{tab:R,active:R.id===t,onClick:F=>{s(F),d(!1)},className:"w-full rounded-none h-[32px] items-center px-3 py-2"},R.id)),children:m.jsx(De,{iconBefore:m.jsx(z.IconDotsVertical,{size:18}),className:Z("w-8 h-8 flex items-center justify-center rounded border",c?"bg-layer-4 border-transparent":"border-primary")})})})]})},Tk="w-full overflow-hidden",Ik="flex flex-nowrap items-center gap-2 min-w-0 px-0 py-0 whitespace-nowrap",pC="flex items-center gap-2 min-w-0 shrink-0 dial-small",kk="max-w-[20%] basis-[20%] flex-none",Ak="flex-1 min-w-0",ng="inline-flex items-center gap-1 min-w-0 transition-colors",Lk="text-secondary hover:text-accent-primary",Ok="text-primary cursor-default",fC="flex-none inline-flex items-center leading-none text-secondary",Nk="items-center gap-1 min-w-0 transition-colors text-secondary hover:text-accent-primary",mC=m.jsx(z.IconChevronRight,{size:16,"aria-hidden":"true"}),_i=({label:e,href:t,onClick:s,disabled:o,isLast:i,separator:n=mC,className:r,iconBefore:a,labelClassName:l})=>{const c=ce(pC,i?Ak:kk,r),d=(!!t||!!s)&&!i&&!o,u=d?ce(ng,Lk):ce(ng,Ok,o?"pointer-events-none opacity-75":""),h=typeof e=="string"?m.jsx(ct,{className:l,text:e,id:"breadcrumb-item-content"}):m.jsx("span",{className:ce("flex-1 min-w-0 max-w-full truncate",l),"aria-label":"breadcrumb-item-content",children:e});return m.jsxs("li",{className:c,"aria-label":"breadcrumb-item",children:[d?m.jsxs("a",{href:t,onClick:s,className:u,children:[a,h]}):m.jsxs("span",{className:u,"aria-current":i?"page":void 0,"aria-disabled":o?"true":void 0,children:[a,h]}),!i&&m.jsx("span",{className:fC,"aria-label":"separator",children:n})]})},CC=({pathItems:e,separator:t=mC,ariaLabel:s="Breadcrumb",className:o,children:i,labelClassName:n})=>{const r=g.useMemo(()=>e?.length?e:g.Children.toArray(i).filter(g.isValidElement).map(c=>{const d=c.props,{labelClassName:u,isLast:h,separator:p,...f}=d;return f}),[e,i]),a=g.useCallback(c=>{const d=parseInt(c.key,10),u=r[d];u.onClick?u.onClick(c.domEvent):u.href&&(window.location.href=u.href)},[r]),l=g.useMemo(()=>{if(r.length===0)return null;if(r.length<=3)return r.map((f,C)=>g.createElement(_i,{...f,key:`item-${C}`,isLast:C===r.length-1,separator:t,labelClassName:n}));const c=r.at(0),d=r.slice(1,-2),u=r.at(-2),h=r.at(-1);if(!c||!u||!h)return null;const p=d.map((f,C)=>({key:String(C+1),label:typeof f.label=="string"?f.label:`Item ${C+1}`,disabled:f.disabled}));return m.jsxs(m.Fragment,{children:[g.createElement(_i,{...c,key:"item-0",separator:t,labelClassName:n}),m.jsxs("li",{className:ce(pC),children:[m.jsx(bt,{menu:{items:p,onClick:a},placement:"bottom-start",matchReferenceWidth:!1,children:m.jsx("button",{type:"button","aria-label":"More breadcrumbs",className:Nk,children:m.jsx(z.IconDots,{size:16})})}),m.jsx("span",{className:fC,children:t})]}),g.createElement(_i,{...u,key:`item-${r.length-2}`,separator:t,labelClassName:n}),g.createElement(_i,{...h,key:`item-${r.length-1}`,isLast:!0,separator:t,labelClassName:n})]})},[r,t,n,a]);return m.jsx("nav",{"aria-label":s,className:ce(Tk,o),children:m.jsx("ol",{className:Ik,children:l})})},vC=({iconClassName:e,...t})=>m.jsx(De,{...t,iconBefore:m.jsx(z.IconTrashX,{...ae,className:e||""})}),wC=({value:e,textareaId:t,placeholder:s,className:o="",containerClassName:i="",disabled:n,invalid:r,readonly:a,disableTooltip:l,onChange:c})=>m.jsx(vs,{tooltip:l?null:e,triggerClassName:ce("flex",i),children:m.jsx("textarea",{id:t,placeholder:s,value:e||"",disabled:n,className:Z("dial-textarea dial-input px-3 py-2",r?"dial-input-error":"",n&&"dial-input-disable",a&&"dial-input-readonly",o),onChange:d=>!a&&c?.(d.currentTarget.value)})}),Hk=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],Gk=(e,t,s,o)=>{if((t==="number"||s!==void 0||o!==void 0)&&!Hk.includes(e.key)&&!(e.ctrlKey||e.metaKey)&&!(e.key==="-"&&(e.currentTarget.selectionStart??0)===0&&!e.currentTarget.value.includes("-"))&&!(e.key==="."&&t==="number"&&!e.currentTarget.value.includes("."))){if(!/^[0-9]$/.test(e.key)){e.preventDefault();return}if(s!==void 0||o!==void 0){const n=e.currentTarget.value,r=e.currentTarget.selectionStart||0,a=n.slice(0,r)+e.key+n.slice(r),l=parseFloat(a);if(!isNaN(l)){if(s!==void 0&&l<s){e.preventDefault();return}if(o!==void 0&&l>o){e.preventDefault();return}}}}},Co=({iconBefore:e,iconAfter:t,hideBorder:s,value:o,elementId:i,placeholder:n="",className:r="",containerClassName:a,tooltipTriggerClassName:l,type:c="text",disabled:d,readonly:u,invalid:h,onChange:p,min:f,max:C,prefix:v,suffix:w,textBeforeInput:b,textAfterInput:S,onBlur:y,defaultValue:x,tooltipText:R,hideTooltip:F=!1,inputRef:D})=>{const M=g.useRef(null),k=Re.useMergeRefs([D,M]);g.useEffect(()=>{const B=M.current;if(!B)return;const O=J=>{J.preventDefault()};return B.addEventListener("wheel",O,{passive:!1}),()=>{B.removeEventListener("wheel",O)}},[]);const E=c==="number"||f!==void 0||C!==void 0,P=B=>{Gk(B,c,f,C)},N=B=>{const O=B.currentTarget.value;if(E&&O!==""){const J=parseFloat(O);if(isNaN(J)&&O!=="-"&&O!=="."||!isNaN(J)&&(f!==void 0&&J<f||C!==void 0&&J>C))return}p?.(O||void 0)};return m.jsxs("div",{className:Z("dial-input-field flex flex-row items-center justify-between py-2",s?"dial-input-no-border":"dial-input",h&&"dial-input-error",d&&"dial-input-disable",u&&"dial-input-readonly",!b&&"pl-3",!S&&"pr-3",a),"aria-label":"input-container",children:[b&&m.jsx("div",{className:"mr-2",children:m.jsx(Co,{hideBorder:!0,containerClassName:"rounded-r-none border-r-0",className:"overflow-hidden overflow-ellipsis dial-small",value:b,disabled:!0,elementId:b+"textBefore"})}),v&&m.jsxs("p",{className:"text-secondary dial-small mr-2",children:[" ",v]}),m.jsx(Oe,{icon:e,className:Z(!!e&&"mr-2")}),m.jsx(vs,{tooltip:F?void 0:R||o,triggerClassName:Z(l,"flex-1"),children:m.jsx("input",{ref:k,type:c,autoComplete:"off",id:i,placeholder:n,value:x?void 0:o??"",disabled:d,className:Z("border-0 bg-transparent w-full truncate",r),onChange:B=>!u&&N?.(B),onKeyDown:P,onBlur:y,min:f,max:C,defaultValue:x})}),m.jsx(Oe,{icon:t,className:Z(!!t&&"ml-2")}),w&&m.jsxs("p",{className:"text-secondary dial-small ml-2",children:[" ",w]}),S&&m.jsx("div",{className:"ml-2",children:m.jsx(Co,{hideBorder:!0,containerClassName:"rounded-l-none border-l-0",value:S,disabled:!0,elementId:S+"textAfter"})})]})},Bk=/^0+\.(\d+)?$/,Vk=/^0+/,bC=({label:e,optional:t,optionalText:s,description:o,error:i,captionDescription:n,readonly:r,orientation:a,elementId:l,fieldTitle:c,errorText:d,elementClassName:u,elementContainerClassName:h,containerClassName:p,defaultEmptyText:f,...C})=>m.jsx(da,{label:e??c,error:i??d,optionalText:s,optional:t,description:o,captionDescription:n,readonly:r,orientation:a,elementId:l,className:p,defaultEmptyText:f,value:C.value,children:m.jsx(Co,{elementId:l,className:u,containerClassName:h,invalid:d!=null,...C})}),zk=({onChange:e,...t})=>{const s=o=>!o||o==="-"?o:String(o)?.match(Bk)?String(o)?.replace(Vk,"0"):Number(o);return m.jsx(bC,{type:"number",onChange:o=>e?.(s(o)),...t})},Wk=({onChange:e,...t})=>m.jsx(bC,{type:"text",onChange:s=>e?.(s),...t}),_k=({fieldTitle:e,optional:t,elementId:s,elementClassName:o,containerClassName:i,elementContainerClassName:n,errorText:r,...a})=>m.jsxs("div",{className:ce("flex flex-col",i),children:[m.jsx(wo,{fieldTitle:e,optional:t,htmlFor:s}),m.jsx(wC,{textareaId:s,className:o,containerClassName:n,...a}),m.jsx(Ls,{errorText:r})]}),tu=({label:e,switchId:t,isOn:s=!1,disabled:o,onChange:i})=>{const n=Z("flex w-[36px] h-[18px] cursor-pointer items-center gap-1 rounded-full p-0.5 transition-all duration-200",s?"flex-row-reverse":"flex-row",o?"pointer-events-none":"",o?s?"bg-controls-disable":"bg-layer-4":s?"bg-accent-primary":"bg-layer-4"),r=g.useCallback(a=>{a.stopPropagation(),i?.(!s)},[i,s]);return m.jsxs("div",{className:"flex flex-row items-center",role:"switch",children:[m.jsx("input",{type:"checkbox",onChange:r,id:t,disabled:o,className:"invisible w-0 h-0",checked:s}),m.jsx("label",{htmlFor:t,className:n,children:m.jsx("span",{className:Z("size-3 rounded-full",o?s?"bg-layer-4":"bg-controls-disable":"bg-controls-enable-primary")})}),e&&m.jsx("span",{className:Z("pl-2 dial-small",o?"text-secondary":"text-primary"),"aria-label":"switch-title",children:e})]})};var Bt=(e=>(e.Sm="sm",e.Md="md",e.Lg="lg",e))(Bt||{});const jk="z-[52] flex items-center justify-center bg-blackout md:p-4",Uk="divide-tertiary divide-y",$k="flex flex-row justify-between py-4 px-6 items-center",Kk={[Bt.Sm]:"dial-sm-popup",[Bt.Md]:"dial-md-popup",[Bt.Lg]:"dial-lg-popup"},Fo=({open:e=!1,header:t,portalId:s,className:o,overlayClassName:i,titleClassName:n,headerClassName:r,dividers:a=!0,children:l,footer:c,onClose:d,size:u=Bt.Md,closeOnOutsideClick:h=!0})=>{const{refs:p,context:f}=Re.useFloating({open:e,onOpenChange:y=>{y||d?.(null)}}),C=Re.useRole(f,{role:"dialog"}),v=Re.useDismiss(f,{outsidePress:h}),{getFloatingProps:w}=Re.useInteractions([C,v]);if(!e)return null;const b=typeof t=="string"?"dial-popup-heading":void 0,S=y=>y?typeof y=="string"?m.jsx("h3",{id:b,className:Z("flex-1 min-w-0 mr-3 truncate dial-h3 text-primary",n),children:m.jsx(vs,{tooltip:y,children:y})}):y:m.jsx("span",{});return m.jsx(Re.FloatingPortal,{id:s,children:m.jsx(Re.FloatingOverlay,{className:Z(jk,i),children:m.jsx(Re.FloatingFocusManager,{context:f,children:m.jsxs("div",{ref:p.setFloating,...w(),role:"dialog","aria-modal":"true","aria-labelledby":b,className:Z("dial-popup",Kk[u],a&&Uk,o),children:[m.jsxs("div",{className:ce($k,r),children:[S(t),m.jsx(Jd,{ariaLabel:"Close dialog",onClose:y=>d?.(y)})]}),m.jsx("div",{className:"flex-grow overflow-auto","aria-label":"popup-description",children:l}),c]})})})})};var li=(e=>(e.Info="info",e.Danger="danger",e))(li||{});const qk="flex justify-end gap-2 px-6 py-4",Yk="text-secondary dial-small-150 px-6 py-4",Zk="Cancel",Xk="Ok",rg={[li.Info]:{confirmVariant:ke.Primary,cancelVariant:ke.Secondary},[li.Danger]:{container:"dial-danger-popup",confirmVariant:ke.Danger,cancelVariant:ke.Secondary}},SC=({header:e,description:t,descriptionClassName:s,open:o=!1,confirmLabel:i=Xk,cancelLabel:n=Zk,isLoading:r=!1,disableConfirmButton:a=!1,className:l,confirmClassName:c,onClose:d,onConfirm:u,onCancel:h,children:p,dividers:f=!1,variant:C=li.Info,size:v=Bt.Sm,footer:w})=>{const b=r?null:m.jsxs("div",{className:qk,children:[m.jsx(De,{variant:ke.Secondary,label:n,onClick:()=>h?h():d?.()}),m.jsx(De,{variant:rg[C].confirmVariant,className:c,label:i,disabled:a,onClick:()=>u()})]}),S=g.useCallback(()=>r?m.jsx("div",{className:"px-6 py-4 h-[120px]",children:m.jsx(yn,{size:50})}):p??(t?m.jsx("div",{className:Z(Yk,s),children:t}):null),[p,t,r,s]);return m.jsx(Fo,{open:o,header:e,className:Z(rg[C].container,l),dividers:f,onClose:()=>d?.(),footer:w??b,size:v,children:S()})},su=({selectedItems:e,listClassName:t,listElementClassName:s,placeholder:o})=>e?.length?m.jsx("ul",{className:Z("flex-row items-center truncate flex-wrap","flex gap-x-2 gap-y-1",t),children:e?.map(i=>m.jsx("li",{children:m.jsx(vs,{tooltip:i,children:m.jsx(ga,{tag:i,className:Z([s])})})},i))}):o?m.jsx("span",{className:"text-secondary",children:o}):null,ag=e=>me.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},me.createElement("path",{d:"M2.25 13.5V12C2.25 11.5858 2.58579 11.25 3 11.25C3.41421 11.25 3.75 11.5858 3.75 12V13.5C3.75 13.6989 3.82907 13.8896 3.96973 14.0303C4.11038 14.1709 4.30109 14.25 4.5 14.25H6C6.41421 14.25 6.75 14.5858 6.75 15C6.75 15.4142 6.41421 15.75 6 15.75H4.5C3.90326 15.75 3.33114 15.5128 2.90918 15.0908C2.48722 14.6689 2.25 14.0967 2.25 13.5ZM14.25 6V4.5C14.25 4.30109 14.1709 4.11038 14.0303 3.96973C13.8896 3.82907 13.6989 3.75 13.5 3.75H12C11.5858 3.75 11.25 3.41421 11.25 3C11.25 2.58579 11.5858 2.25 12 2.25H13.5C14.0967 2.25 14.6689 2.48722 15.0908 2.90918C15.5128 3.33114 15.75 3.90326 15.75 4.5V6C15.75 6.41421 15.4142 6.75 15 6.75C14.5858 6.75 14.25 6.41421 14.25 6Z",fill:"currentColor"})),yC=({children:e,open:t,disabled:s=!1,selectedValue:o,valueClassName:i,inputClassName:n,onOpen:r,elementId:a,errorText:l,invalid:c,emptyValueText:d,placeholder:u})=>{const h=Array.isArray(o)&&o.length>0,p=typeof o=="string"&&!!o.trim(),f=h||p?o:u?void 0:d,C=s?void 0:r,v=()=>m.jsxs(m.Fragment,{children:[m.jsx("button",{type:"button",className:"w-full",onClick:C,"aria-label":"open-popup",id:a,children:m.jsxs("div",{className:Z("dial-input px-3 py-2 dial-input-field flex flex-row items-center w-full justify-between",n,s&&"dial-input-disable",(l||c)&&"dial-input-error"),children:[m.jsx(vs,{tooltip:f==null?void 0:String(f),children:f||!u?m.jsx("span",{className:i,children:f}):m.jsx("span",{className:"text-secondary",children:u})}),!s&&m.jsx("div",{className:"flex-shrink-0",children:m.jsx(Oe,{icon:m.jsx(ag,{role:"img",width:ds,height:ds})})})]})}),l&&m.jsx(Ls,{errorText:l})]}),w=()=>m.jsx("div",{className:"w-full",onClick:C,children:m.jsxs("div",{className:Z("dial-input px-3 py-2 flex flex-row items-center w-full justify-between",s&&"dial-input-disable"),children:[m.jsx(su,{placeholder:u,selectedItems:f}),!s&&m.jsx("div",{className:"ml-1",children:m.jsx(Oe,{icon:m.jsx(ag,{role:"img",width:ds,height:ds})})})]})});return m.jsxs(m.Fragment,{children:[h?w():v(),t&&Sn.createPortal(e,document.body)]})},Qk=({fieldTitle:e,htmlFor:t,disabled:s,selectedValue:o,radioButtons:i,customInputValue:n,valueClassName:r,inputClassName:a,emptyValueText:l,onClose:c,header:d,portalId:u,onApply:h,cancelButtonTitle:p="Cancel",applyButtonTitle:f="Apply",isValid:C,selectedRadioValue:v,onChangeRadioField:w,id:b,size:S=Bt.Md})=>{const[y,x]=g.useState(!1),R=g.useCallback(()=>{s||x(!0)},[s]),F=g.useCallback(()=>{x(!1),c?.()},[c]),D=g.useCallback(()=>{h(),F()},[h,F]);return m.jsxs("div",{className:"flex flex-col",children:[m.jsx(wo,{fieldTitle:e,htmlFor:t}),m.jsx(yC,{disabled:s,open:y,selectedValue:n??i.find(M=>M.id===o)?.name,valueClassName:r,inputClassName:Z(a,"py-2","px-3"),emptyValueText:l,onOpen:R,children:m.jsx(Fo,{open:y,onClose:F,header:d,portalId:u,size:S,footer:m.jsxs("div",{className:"flex flex-row items-center justify-end gap-2 px-6 py-4",children:[m.jsx(De,{variant:ke.Secondary,label:p,onClick:F}),m.jsx(De,{variant:ke.Primary,label:f,onClick:D,disabled:!C})]}),children:m.jsx("div",{className:"px-6 py-4",children:m.jsx(Ir,{radioButtons:i,labelClassName:"dial-small",activeRadioButton:v,onChange:w,elementId:b,orientation:ao.Column})})})})]})},Jk="Create",eA="Cancel",tA="flex items-center justify-end gap-2 px-6 py-3",sA=({header:e,open:t=!1,submitLabel:s=Jk,cancelLabel:o=eA,isLoading:i=!1,disableSubmitButton:n=!1,className:r,submitClassName:a,onClose:l,onSubmit:c,onCancel:d,children:u,dividers:h=!0,size:p=Bt.Md,footer:f})=>{const C=i?null:m.jsxs("div",{className:tA,children:[m.jsx(De,{variant:ke.Secondary,label:o,onClick:()=>d?d():l?.()}),m.jsx(De,{variant:ke.Primary,className:a,label:s,disabled:n,onClick:()=>c()})]}),v=g.useCallback(()=>i?m.jsx("div",{className:"px-6 py-4 h-[120px]",children:m.jsx(yn,{size:50})}):u??null,[u,i]);return m.jsx(Fo,{open:t,header:e,className:r,dividers:h,onClose:()=>l?.(),footer:f??C,size:p,children:v()})},oA=({onClick:e})=>m.jsx(z.IconEyeOff,{...ae,className:"text-primary",onClick:e,role:"button","aria-label":"hide"}),iA=({onClick:e})=>m.jsx(z.IconEye,{...ae,className:"text-primary",onClick:e,role:"button","aria-label":"show"}),xC=({...e})=>{const[t,s]=g.useState(!1),o=g.useCallback(i=>{s(i)},[]);return m.jsx(Co,{type:t?"text":"password",...e,hideTooltip:!t,iconAfter:t?m.jsx(oA,{onClick:()=>o(!1)}):m.jsx(iA,{onClick:()=>o(!0)})})},nA=({fieldTitle:e,optional:t,elementClassName:s,elementId:o,errorText:i,...n})=>m.jsxs("div",{className:"flex flex-col",children:[m.jsx(wo,{fieldTitle:e,optional:t,htmlFor:o}),m.jsx(xC,{className:s,elementId:o,invalid:!!i,...n}),m.jsx(Ls,{errorText:i})]});var bn=(e=>(e.Small="small",e.Base="base",e))(bn||{});const rA={[bn.Small]:{textClassName:"text-xs px-1",containerClassName:"px-[6px] py-1 h-[22px]",iconSize:10,iconStroke:1},[bn.Base]:{textClassName:"text-sm px-2",containerClassName:"px-3 py-2 h-[38px]",iconSize:18,iconStroke:1.5}},ou=({elementId:e,value:t,placeholder:s="Search...",disabled:o,readonly:i,invalid:n,className:r,containerClassName:a,onChange:l,onBlur:c,size:d=bn.Base,allowClear:u=!0})=>{const[h,p]=g.useState(t||"");g.useEffect(()=>{p(t||"")},[t]);const f=g.useCallback(w=>{p(w),l?.(w)},[l]),C=rA[d],v=g.useCallback(()=>{f("")},[f]);return m.jsxs("div",{className:ce("dial-input flex flex-row items-center justify-between",n&&"dial-input-error",o&&"dial-input-disable",i&&"dial-input-readonly",C.containerClassName,a),children:[m.jsx(Oe,{className:Z(o?"text-secondary":"text-primary"),icon:m.jsx(z.IconSearch,{size:C.iconSize,stroke:C.iconStroke})}),m.jsx("input",{id:e,type:"text",autoComplete:"off",placeholder:s,value:h??"",disabled:o,readOnly:i,className:Z("border-0 bg-transparent w-full",r,C.textClassName),onChange:w=>!i&&f(w.currentTarget.value),onBlur:c}),h&&!i&&!o&&u&&m.jsx(Oe,{className:"text-primary cursor-pointer",icon:m.jsx(z.IconX,{size:C.iconSize,stroke:C.iconStroke,onClick:v,"aria-label":"Clear search",role:"button"})})]})},aA=({placeholder:e="",selectedItems:t=[],updateSelected:s,listClassName:o,listElementClassName:i,containerClassName:n,inputClassName:r})=>{const[a,l]=g.useState(""),c=g.useCallback(u=>{u.key==="Enter"&&(s([...t,u.currentTarget.value]),l("")),(u.key==="Backspace"||u.key==="Delete")&&t.length&&!a&&s(t.slice(0,-1))},[t,s,a]),d=g.useCallback(u=>{l(u.target.value)},[l]);return m.jsxs("div",{className:Z(["dial-input px-3 py-2 flex flex-row items-center flex-wrap w-fit gap-2",n]),children:[m.jsx(su,{selectedItems:t,listClassName:o,listElementClassName:i}),m.jsx("input",{type:"text",value:a,className:Z(["border-0 bg-transparent p-0",r]),placeholder:t?.length?"":e,onKeyDown:c,onChange:d})]})},lA=({initialTags:e=[],fieldTitle:t,optional:s,elementId:o,placeholder:i,errorText:n,invalid:r,disabled:a,onChange:l})=>{const c=g.useRef(null),[d,u]=g.useState(e),[h,p]=g.useState(""),[f,C]=g.useState(!1),v=S=>{const y=S.trim().replace(/,$/,"");if(y&&!d.includes(y)){const x=[y,...d];u(x),l?.(x)}},w=S=>{(S.key===","||S.key==="Enter")&&(S.preventDefault(),v(h),p(""))},b=S=>{const y=d.filter((x,R)=>R!==S);u(y),l?.(y)};return g.useEffect(()=>{const S=new ResizeObserver(()=>{if(c.current){const y=c.current.scrollHeight>c.current.clientHeight+10;C(y)}});return c.current&&S.observe(c.current),()=>S.disconnect()},[d]),m.jsxs("div",{className:Z("flex flex-col w-full"),children:[m.jsx(wo,{fieldTitle:t,optional:s,htmlFor:o}),m.jsx("div",{className:Z("dial-input min-h-[38px] p-[6px]",r&&"dial-input-error",a&&"dial-input-disable"),children:m.jsxs("div",{ref:c,className:Z("flex flex-wrap gap-2 items-center",f?"flex-col-reverse":"flex-row"),children:[d.map((S,y)=>m.jsx(ga,{tag:S,remove:a?void 0:()=>b(y)},S+y)),m.jsx("input",{type:"text",value:h,onChange:S=>p(S.target.value),onKeyDown:w,className:Z("dial-input-no-border outline-none border-none w-full min-w-[100px] flex-1 p-1"),placeholder:i,disabled:a})]})}),m.jsx(Ls,{errorText:n})]})},cA="dial-input flex w-full items-center justify-between gap-2 dial-small",dA="w-full rounded flex flex-col",tc="flex w-full items-center justify-between gap-2 px-3 h-[34px] dial-small text-primary truncate hover:bg-accent-primary-alpha focus:bg-accent-primary-alpha focus:outline-none",uA="bg-accent-primary-alpha",hA="bg-accent-primary-alpha border-l border-accent-primary border-1",lg="opacity-75",gA=352,pA=m.jsx(z.IconChevronDown,{size:16}),RC=({options:e,selectedValues:t,handleRemoveTag:s})=>m.jsx("div",{className:"flex flex-wrap w-full items-center gap-1",children:t.map(o=>{const i=e.find(r=>r.value===o)?.label??o,n=e.find(r=>r.value===o)?.icon;return m.jsx(ga,{tag:i,remove:r=>s?.(r,o),iconBefore:n?m.jsx(Oe,{icon:n}):null,className:"max-w-full"},o)})});var ra=(e=>(e.Sm="sm",e.Md="md",e))(ra||{}),aa=(e=>(e.Primary="Primary",e.Secondary="Secondary",e))(aa||{});const FC=({options:e,multiple:t=!1,elementId:s,value:o,defaultValue:i,variant:n=aa.Primary,size:r=ra.Md,prefix:a,customSelectedValue:l,placeholder:c="Select...",searchable:d=!1,searchPlaceholder:u,selectAll:h=!1,selectAllLabel:p="Select all",emptyStateTitle:f="No options available",emptyStateDescription:C,emptyStateIcon:v,disabled:w=!1,className:b,closable:S=!1,header:y,footer:x,onClose:R,onChange:F,inlineSearch:D=!1,dismissRef:M,onFooterClick:k})=>{const E=g.useId(),[P,N]=g.useState(!1),[B,O]=g.useState(D&&l||""),J=g.useRef(null),te=o!==void 0,[L,le]=g.useState(i),V=te?o:L,Q=g.useMemo(()=>t?Array.isArray(V)?V:[]:typeof V=="string"?[V]:[],[V,t]),X=g.useMemo(()=>{const _=B.trim().toLowerCase();return _?e.filter(we=>we.label.toLowerCase().includes(_)):e},[e,B]);g.useEffect(()=>{!P&&!D&&O("")},[D,P]),g.useEffect(()=>{D&&O(l||"")},[l,D]);const $=g.useCallback(_=>{te||le(_),F?.(_)},[te,F]),q=_=>{if(t){const we=new Set(Q);we.has(_)?we.delete(_):we.add(_),$(Array.from(we))}else $(_),N(!1)},ee=g.useCallback((_,we)=>{if(_.stopPropagation(),!t){$("");return}const pe=Q.filter(xe=>xe!==we);$(pe)},[t,Q,$]),ge=g.useMemo(()=>X.filter(_=>!_.disabled),[X]),H=g.useMemo(()=>ge.filter(_=>Q.includes(_.value)).length,[ge,Q]),I=_=>{D&&!t&&!_&&q(B),N(_)},U=ge.length>0&&H===ge.length,W=H>0&&!U,ue=()=>{if(!(!t||ge.length===0))if(U){const _=new Set(ge.map(pe=>pe.value)),we=Q.filter(pe=>!_.has(pe));$(we)}else{const _=new Set(Q);ge.forEach(we=>_.add(we.value)),$(Array.from(_))}},ie=Q.length>0;g.useEffect(()=>{P&&D&&!t&&!w&&requestAnimationFrame(()=>{const _=J.current;if(!_)return;_.focus();const we=_.value?.length??0;_.setSelectionRange?.(we,we)})},[P,D,t,w]);const Ce=!t&&ie?Q[0]:void 0,ve=g.useMemo(()=>Ce?e.find(_=>_.value===Ce):void 0,[e,Ce]),Pe=g.useCallback(()=>!t||Q.length===0?null:m.jsx(RC,{options:e,selectedValues:Q,handleRemoveTag:ee}),[t,e,Q,ee]),de=g.useCallback(()=>t?ie?Pe():m.jsx("span",{className:"text-secondary truncate",children:c}):ve?m.jsxs(m.Fragment,{children:[ve.icon&&m.jsx(Oe,{icon:ve.icon}),m.jsx(ct,{text:a?`${a} ${ve.label}`:ve.label}),ve?.description&&m.jsx("div",{className:"text-secondary dial-small",children:ve.description})]}):l&&o?l:m.jsx("span",{className:"text-secondary truncate",children:c}),[ie,t,l,a,o,c,Pe,ve]);g.useImperativeHandle(M,()=>({dismiss:()=>{N(!1)}}));const ye=()=>{O(Q.length===1?ve?.label??B:"")};return m.jsx(bt,{open:P,onOpenChange:I,disabled:w,closable:S,onClose:R,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],maxDropdownHeight:d?null:gA,renderOverlay:()=>m.jsxs("div",{id:`list-${s||E}`,role:"listbox","aria-multiselectable":t||void 0,className:dA,children:[y&&m.jsx(m.Fragment,{children:typeof y=="function"?y():y}),(d||S)&&e.length>8&&m.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[d&&m.jsx(ou,{placeholder:u,onChange:O,value:B,elementId:`search-${s||E}`}),S&&m.jsx(De,{"aria-label":"Close select",className:"shrink-0",iconBefore:m.jsx(z.IconX,{size:16}),onClick:_=>{R?.(_),N(!1)}})]}),t&&h&&ge.length>0&&m.jsx("div",{className:Z(tc,"mt-2"),children:m.jsx(sn,{id:`${s||E}-selectAll`,label:p,checked:U,indeterminate:W,onChange:ue,ariaLabel:p})}),m.jsx("div",{className:Z("overflow-y-auto max-h-[352px]",D&&X.length===0?"":"py-1"),children:X.length===0?!D&&m.jsx("div",{className:"px-2 py-3",children:m.jsx(ua,{icon:v??m.jsx(z.IconClipboardX,{size:24}),title:f,description:C})}):X.map(_=>{const we=Q.includes(_.value);return t?m.jsxs("div",{role:"option","aria-selected":we,"aria-disabled":!!_.disabled,className:Z(tc,we&&uA,_.disabled&&lg,"w-full"),children:[m.jsx(sn,{id:`${s||E}-${_.value}`,label:m.jsxs("span",{className:"flex w-full flex-1 min-w-0 items-center gap-2 text-primary",children:[_.icon&&m.jsx(Oe,{icon:_.icon}),m.jsx("span",{className:"truncate",children:_.label})]}),checked:we,disabled:_.disabled,onChange:()=>!_.disabled&&q(_.value),ariaLabel:_.label}),_.description&&m.jsx("div",{className:"text-secondary dial-small",children:_.description})]},_.value):m.jsx("button",{role:"option",type:"button","aria-selected":we,"aria-disabled":!!_.disabled,disabled:_.disabled,className:Z(tc,we&&hA,_.disabled&&lg),onClick:()=>!_.disabled&&q(_.value),children:m.jsxs("div",{className:"flex items-center gap-2 w-full",children:[_.icon&&m.jsx(Oe,{icon:_.icon}),m.jsx(ct,{text:_.label}),_.description&&m.jsx("div",{className:"text-secondary dial-small",children:_.description})]})},_.value)})}),x&&m.jsx("div",{onClick:_=>{k?.(_),k&&N(!1)},children:typeof x=="function"?x():x})]}),children:m.jsxs("button",{type:"button","aria-haspopup":"listbox","aria-expanded":P,"aria-controls":`list-${s||E}`,className:ce(cA,w&&"opacity-75 !cursor-not-allowed",r===ra.Sm?"min-h-[25px] px-1.5 py-1":"min-h-[38px] px-3 py-2",n===aa.Secondary?"!bg-layer-4":"",b),onMouseDown:_=>{w||D&&!t&&(ye(),_.preventDefault())},onClick:()=>{w||(N(_=>!_),D&&!t&&(ye(),J.current?.focus()))},children:[D&&!t?m.jsx("div",{className:"flex min-w-0 items-center gap-2 text-primary flex-1",children:m.jsx("input",{id:`inline-${s||E}`,type:"text",placeholder:u??c,value:B||"",onChange:_=>O(_.currentTarget.value.trimStart()),onFocus:()=>!w&&N(!0),onMouseDown:_=>{ye(),_.stopPropagation()},onClick:_=>{_.stopPropagation()},onKeyDown:_=>{_.stopPropagation()},className:"bg-transparent outline-none w-full dial-small",ref:J,disabled:w,"aria-disabled":w,autoComplete:"off"})}):m.jsx("div",{className:"flex min-w-0 items-center gap-2 text-primary",children:de()}),!D&&m.jsx(Oe,{icon:pA,className:Z("text-primary",P&&"rotate-180")})]})})},fA=({fieldTitle:e,optional:t,captionDescription:s,containerClassName:o,selectClassName:i,error:n,elementId:r,description:a,readonly:l,value:c,defaultEmptyText:d,...u})=>{const h=g.useCallback(()=>{if(!c||Array.isArray(c)&&c.length===0)return d??"None";if(Array.isArray(c))return m.jsx(RC,{options:u.options,selectedValues:c});{const p=u.options?.find(f=>f.value===c);return m.jsx("span",{"aria-readonly":!0,className:"text-primary",children:p?.label||c})}},[c,u.options,d]);return m.jsx(da,{elementId:r,label:e,optional:t,description:a,error:n,captionDescription:s,className:o,readonly:l,value:h(),defaultEmptyText:d,children:m.jsx(FC,{className:i,value:c,elementId:r,...u})})};function EC(e){let t=null;return()=>(t==null&&(t=e()),t)}function mA(e,t){return e.filter(s=>s!==t)}function CA(e,t){const s=new Set,o=n=>s.add(n);e.forEach(o),t.forEach(o);const i=[];return s.forEach(n=>i.push(n)),i}class vA{enter(t){const s=this.entered.length,o=i=>this.isNodeInDocument(i)&&(!i.contains||i.contains(t));return this.entered=CA(this.entered.filter(o),[t]),s===0&&this.entered.length>0}leave(t){const s=this.entered.length;return this.entered=mA(this.entered.filter(this.isNodeInDocument),t),s>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class wA{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(t=>{Object.defineProperty(this.item,t,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${t}" until the drop event.`),null}})})}loadDataTransfer(t){if(t){const s={};Object.keys(this.config.exposeProperties).forEach(o=>{const i=this.config.exposeProperties[o];i!=null&&(s[o]={value:i(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,s)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,s){return s===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const iu="__NATIVE_FILE__",DC="__NATIVE_URL__",PC="__NATIVE_TEXT__",MC="__NATIVE_HTML__",cg=Object.freeze(Object.defineProperty({__proto__:null,FILE:iu,HTML:MC,TEXT:PC,URL:DC},Symbol.toStringTag,{value:"Module"}));function sc(e,t,s){const o=t.reduce((i,n)=>i||e.getData(n),"");return o??s}const Yc={[iu]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[MC]:{exposeProperties:{html:(e,t)=>sc(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[DC]:{exposeProperties:{urls:(e,t)=>sc(e,t,"").split(`
|
|
61
|
+
`,hT=class extends VP{constructor(e){super(e),this.config=e,this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:s}=e;this.suppressQuotes=t,this.columnSeparator=s}addCustomContent(e){e&&(typeof e=="string"?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,Kh),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((s,o)=>{o!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(s.data.value||""),s.mergeAcross&&this.appendEmptyCells(s.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,s,o){s!=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,s){t!=0&&(this.result+=this.columnSeparator);const o=this.extractRowCellValue(e,t,t,"csv",s);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():(G(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=Kh),this.isFirstLine=!1}},gT=class extends BP{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()){G(51);return}const t=this.getMergedParams(e),s=this.getData(t),o=new Blob(["\uFEFF",s],{type:"text/plain"}),i=typeof t.fileName=="function"?t.fileName(he(this.gos,{})):t.fileName;zP(this.getFileName(i),o)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const s=t?Object.assign({},e):this.getMergedParams(e);return this.getData(s)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{colModel:t,colNames:s,rowGroupColsSvc:o,valueSvc:i,gos:n}=this,{processCellCallback:r,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:d,columnSeparator:u}=e;return new hT({colModel:t,colNames:s,valueSvc:i,gos:n,processCellCallback:r||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:d||!1,columnSeparator:u||",",rowGroupColsSvc:o})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function pT(e,t){return e.csvCreator?.getDataAsCsv(t)}function fT(e,t){e.csvCreator?.exportDataAsCsv(t)}var mT={moduleName:"CsvExport",version:K,beans:[gT],apiFunctions:{getDataAsCsv:pT,exportDataAsCsv:fT},dependsOn:[uT]},CT=class extends A{constructor(e,t,s){super(),this.id=e,this.parentCache=t,this.params=s,this.state="needsLoading",this.version=0,this.startRow=e*s.blockSize,this.endRow=this.startRow+s.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,s){this.successCommon(e,{rowData:t,rowCount:s})}isRequestMostRecentAndLive(e){const t=e===this.version,s=this.isAlive();return t&&s}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:s,beans:o,rowNodes:i}=this;for(let n=0;n<e;n++){const r=s+n,a=new Bs(o);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(r),a.setRowTop(t*r),i.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:s,state:o}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:s,pageStatus:o}}}setDataAndId(e,t,s){Y(t)?e.setDataAndId(t,s.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Ge(this.params.datasource.getRows)){G(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:s,params:{sortModel:o,filterModel:i},gos:n}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,s),failCallback:this.pageLoadFailed.bind(this,s),sortModel:o,filterModel:i,context:he(n,{}).context}}forEachNode(e,t,s){this.rowNodes.forEach((o,i)=>{this.startRow+i<s&&e(o,t.value++)})}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.value++);const s=e-this.startRow;return this.rowNodes[s]}processServerResult(e){const{rowNodes:t,beans:s}=this;t.forEach((i,n)=>{const r=e.rowData?e.rowData[n]:void 0;!i.id&&i.alreadyRendered&&r&&(t[n]=new Bs(s),t[n].setRowIndex(i.rowIndex),t[n].setRowTop(i.rowTop),t[n].setRowHeight(i.rowHeight),i.clearRowTopAndRowIndex()),this.setDataAndId(t[n],r,this.startRow+n)});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()}},vT=2,wT=class extends A{constructor(e){super(),this.params=e,this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount}getRow(e,t=!1){const s=Math.floor(e/this.params.blockSize);let o=this.blocks[s];if(!o){if(t)return;o=this.createBlock(s)}return o.getRow(e)}createBlock(e){const t=this.params,s=this.createBean(new CT(e,this,t));return this.blocks[s.id]=s,this.blockCount++,this.purgeBlocksIfNeeded(s),t.rowNodeBlockLoader.addBlock(s),s}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()&&(ho(this.gos,`InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(r=>r!=e),s=(r,a)=>a.lastAccessed-r.lastAccessed;t.sort(s);const o=this.params.maxBlocksInCache>0,i=o?this.params.maxBlocksInCache-1:null,n=vT-1;t.forEach((r,a)=>{const l=r.state==="needsLoading"&&a>=n,c=o?a>=i:!1;if(l||c){if(this.isBlockCurrentlyDisplayed(r)||this.isBlockFocused(r))return;this.removeBlockFromCache(r)}})}isBlockFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const{startRow:s,endRow:o}=e;return t.rowIndex>=s&&t.rowIndex<o}isBlockCurrentlyDisplayed(e){const{startRow:t,endRow:s}=e;return this.beans.rowRenderer.isRangeInRenderedViewport(t,s-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:s,overflowSize:o}=this.params,n=(e.id+1)*s+o;this.rowCount<n&&(this.rowCount=n)}}setRowCount(e,t){this.rowCount=e,Y(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t={value:0};for(const s of this.getBlocksInOrder())s.forEachNode(e,t,this.rowCount)}getBlocksInOrder(){const e=(s,o)=>s.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 s=[];let o=-1,i=!1;const n={value:0};let r=!1;for(const l of this.getBlocksInOrder())if(!r){if(i&&o+1!==l.id){r=!0;continue}o=l.id,l.forEachNode(c=>{const d=c===e||c===t;(i||d)&&s.push(c),d&&(i=!i)},n,this.rowCount)}return r||i?[]:s}},bT=class extends A{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 Bs(e);this.rootNode=t,t.level=-1,this.rowHeight=oo(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=oo(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){let e;this.cacheParams?e=!an(this.cacheParams.sortModel,this.beans.sortSvc?.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){return this.infiniteCache?.getRowNodesInRange(e,t)??[]}reset(){if(!this.datasource)return;oi(this.gos)!=null||this.beans.selectionSvc?.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:s,rowNodeBlockLoader:o,eventSvc:i,gos:n}=e;this.cacheParams={datasource:this.datasource,filterModel:t?.getFilterModel()??{},sortModel:s?.getSortModel()??[],rowNodeBlockLoader:o,initialRowCount:n.get("infiniteInitialRowCount"),maxBlocksInCache:n.get("maxBlocksInCache"),rowHeight:oo(e),overflowSize:n.get("cacheOverflowSize"),blockSize:n.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new wT(this.cacheParams)),i.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(s=>{s.id===e&&(t=s)}),t}forEachNode(e){this.infiniteCache?.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),s=this.getRowCount()-1;return t>s?s:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){this.infiniteCache?.refreshCache()}purgeCache(){this.infiniteCache?.purgeCache()}isLastRowIndexKnown(){return this.infiniteCache?.isLastRowIndexKnown()??!1}setRowCount(e,t){this.infiniteCache?.setRowCount(e,t)}resetRowHeights(){}onRowHeightChanged(){}};function ST(e){Pa(e)?.refreshCache()}function yT(e){Pa(e)?.purgeCache()}function xT(e){return Pa(e)?.getRowCount()}var RT=class extends A{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=D0(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=ot(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){jt(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){ho(this.gos,"RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.maxConcurrentRequests!=null?this.maxConcurrentRequests-this.activeBlockLoadsCount:1,t=this.blocks.filter(s=>s.state==="needsLoading").slice(0,e);this.activeBlockLoadsCount+=t.length;for(const s of t)s.load();this.printCacheStatus()}getBlockState(){const e={};return this.blocks.forEach(t=>{const{id:s,state:o}=t.getBlockStateJson();e[s]=o}),e}printCacheStatus(){ho(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},FT={moduleName:"InfiniteRowModelCore",version:K,rowModels:["infinite"],beans:[bT,RT]},ET={moduleName:"InfiniteRowModel",version:K,apiFunctions:{refreshInfiniteCache:ST,purgeInfiniteCache:yT,getInfiniteRowCount:xT},dependsOn:[FT,GM]},DT="↑",PT="↓",MT={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},TT=class extends We{constructor(){super(MT),this.eValue=ne,this.eDelta=ne,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const s=Math.abs(t),o=e.formatValue(s),i=Y(o)?o:s,n=t>=0,r=this.eDelta;n?r.textContent=DT+i:r.textContent=PT+i,r.classList.toggle("ag-value-change-delta-up",n),r.classList.toggle("ag-value-change-delta-down",!n)}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"),vt(this.eDelta)}refresh(e,t=!1){const{value:s,valueFormatted:o}=e,{eValue:i,lastValue:n,beans:r}=this;if(s===n||(Y(o)?i.textContent=o:Y(s)?i.textContent=s:vt(i),r.filterManager?.isSuppressFlashingCellsBecauseFiltering()))return!1;const a=s&&typeof s=="object"&&"toNumber"in s?s.toNumber():s,l=n&&typeof n=="object"&&"toNumber"in n?n.toNumber():n;if(a===l)return!1;if(typeof a=="number"&&typeof l=="number"){const c=a-l;this.showDelta(e,c)}return n&&i.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=s,!0}},IT=".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}",kT={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},AT=class extends We{constructor(){super(kT),this.eCurrent=ne,this.refreshCount=0,this.registerCSS(IT)}init(e){this.refresh(e,!0)}addSlideAnimation(){this.refreshCount++;const e=this.refreshCount;this.ePrevious?.remove();const{beans:t,eCurrent:s}=this,o=ft({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=o,o.textContent=s.textContent,this.getGui().insertBefore(o,s),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{e===this.refreshCount&&(this.ePrevious?.remove(),this.ePrevious=null)},3e3)})}refresh(e,t=!1){let s=e.value;if(Ge(s)&&(s=""),s===this.lastValue||this.beans.filterManager?.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=s;const o=this.eCurrent;return Y(e.valueFormatted)?o.textContent=e.valueFormatted:Y(e.value)?o.textContent=s:vt(o),!0}},LT=class extends A{constructor(){super(...arguments),this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(e,t,s=this.beans.gos.get("cellFlashDuration"),o=this.beans.gos.get("cellFadeDuration")){const i=this.animations[t];i.delete(e);const n=Date.now(),r=n+s,a=n+s+o,l={phase:"flash",flashEndTime:r,fadeEndTime:a};i.set(e,l);const c=`ag-cell-${t}`,d=`${c}-animation`,{comp:u,eGui:{style:h}}=e;u.toggleCss(c,!0),u.toggleCss(d,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&r+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),s)}),this.nextAnimationTime=r)}advanceAnimations(){const e=Date.now();let t=null;for(const s of Object.keys(this.animations)){const o=this.animations[s],i=`ag-cell-${s}`,n=`${i}-animation`;for(const[r,a]of o){if(!r.isAlive()||!r.comp){o.delete(r);continue}const{phase:l,flashEndTime:c,fadeEndTime:d}=a,u=l==="flash"?c:d;if(!(e+15>=u)){t=Math.min(u,t??1/0);continue}const{comp:p,eGui:{style:f}}=r;switch(l){case"flash":p.toggleCss(i,!1),p.toggleCss(n,!0),f.transition=`background-color ${d-c}ms`,f.transitionDelay=`${c-e}ms`,t=Math.min(d,t??1/0),a.phase="fade";break;case"fade":p.toggleCss(i,!1),p.toggleCss(n,!1),f.removeProperty("transition"),f.removeProperty("transition-delay"),o.delete(r);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 s=F2(e.cellPosition);t.cells[s]&&this.animateCell(e,"highlight")}flashCell(e,t){this.animateCell(e,"data-changed",t?.flashDuration,t?.fadeDuration)}destroy(){for(const e of Object.keys(this.animations))this.animations[e].clear()}};function OT(e,t={}){const{cellFlashSvc:s}=e;s&&e.frameworkOverrides.wrapIncoming(()=>{for(const o of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))s.flashCell(o,t)})}var NT={moduleName:"HighlightChanges",version:K,beans:[LT],userComponents:{agAnimateShowChangeCellRenderer:TT,agAnimateSlideCellRenderer:AT},apiFunctions:{flashCells:OT}};function HT(e){return e.stateSvc?.getState()??{}}function GT(e,t,s){return e.stateSvc?.setState(t,s)}function qh(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=BT(e)),e.version=K,e}function BT(e){return e.cellSelection=VT(e,"rangeSelection"),e}function VT(e,t){if(e&&typeof e=="object")return e[t]}var zT=class extends A{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=ot(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=ot(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=ot(this,()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}postConstruct(){const{gos:e,ctrlsSvc:t,colDelayRenderSvc:s}=this.beans;this.isClientSideRowModel=_e(e);const o=qh(e.get("initialState")??{}),i=o.partialColumnState;delete o.partialColumnState,this.cachedState=o;const n=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>n(()=>this.setupStateOnGridReady(o))),(o.columnOrder||o.columnVisibility||o.columnSizing||o.columnPinning||o.columnGroup)&&s?.hideColumns("columnState");const[r,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:c})=>{c==="gridInitializing"&&(r(),n(()=>{this.setupStateOnColumnsInitialised(o,!!i),s?.revealColumns("columnState")}))},rowCountReady:()=>{a?.(),n(()=>this.setupStateOnRowCountReady(o))},firstDataRendered:()=>{l?.(),n(()=>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 s=qh(e);delete s.partialColumnState,this.cachedState=s,this.startSuppressEvents();const o="api",i=t?new Set(t):void 0;this.setGridReadyState(s,o,i),this.setColumnsInitialisedState(s,o,!!i,i),this.setRowCountState(s,o,i),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(s,o,i),this.stopSuppressEvents(o)})}setGridReadyState(e,t,s){t==="api"&&!s?.has("sideBar")&&this.beans.sideBar?.comp?.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,s,o){this.setColumnState(e,t,s,o),this.setColumnGroupState(e,t,o),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const s=o=>()=>this.updateColumnState([o]);this.addManagedEventListeners({columnValueChanged:s("aggregation"),columnMoved:s("columnOrder"),columnPinned:s("columnPinning"),columnResized:s("columnSizing"),columnVisible:s("columnVisibility"),columnPivotChanged:s("pivot"),columnPivotModeChanged:s("pivot"),columnRowGroupChanged:s("rowGroup"),sortChanged:s("sort"),newColumnsLoaded:this.updateColumnAndGroupState.bind(this),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setRowCountState(e,t,s){const{filter:o,rowGroupExpansion:i,ssrmRowGroupExpansion:n,rowSelection:r,pagination:a}=e,l=(d,u)=>!s?.has(d)&&(u||t==="api");l("filter",o)&&this.setFilterState(o),l("rowGroupExpansion",i)&&this.setRowGroupExpansionState(n,i,t),l("rowSelection",r)&&this.setRowSelectionState(r,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),s=()=>{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:i,colFilter:n}=this.beans;this.addManagedEventListeners({filterChanged:o,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:s,columnRowGroupChanged:s,rowDataUpdated:()=>{(i.get("groupDefaultExpanded")!==0||i.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(s)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:r=>{(r.newPage||r.newPageSize)&&t("pagination",this.getPaginationState())}}),n&&this.addManagedListeners(n,{filterStateChanged:o})}setFirstDataRenderedState(e,t,s){const{scroll:o,cellSelection:i,focusedCell:n,columnOrder:r,rowPinning:a}=e,l=(u,h)=>!s?.has(u)&&(h||t==="api");l("focusedCell",n)&&this.setFocusedCellState(n),l("cellSelection",i)&&this.setCellSelectionState(i),l("scroll",o)&&this.setScrollState(o),l("rowPinning",a)&&this.setRowPinningState(a),this.setColumnPivotState(!!r?.orderedColIds,t);const c=this.updateCachedState.bind(this);c("sideBar",this.getSideBarState()),c("focusedCell",this.getFocusedCellState());const d=this.getRangeSelectionState();c("rangeSelection",d),c("cellSelection",d),c("scroll",this.getScrollState())}setupStateOnFirstDataRendered(e){this.setFirstDataRenderedState(e,"gridInitializing");const t=this.updateCachedState.bind(this),s=()=>t("focusedCell",this.getFocusedCellState());this.addManagedEventListeners({cellFocused:s,cellFocusCleared:s,cellSelectionChanged:o=>{if(o.finished){const i=this.getRangeSelectionState();t("rangeSelection",i),t("cellSelection",i)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return OP(Ur(e),e.colModel.isPivotMode())}setColumnState(e,t,s,o){const{sort:i,rowGroup:n,aggregation:r,pivot:a,columnPinning:l,columnVisibility:c,columnSizing:d,columnOrder:u}=e;let h=!1;const p=(E,P)=>{const N=!o?.has(E)&&!!(P||t==="api");return h||(h=N),N},f={},C=E=>{let P=f[E];return P||(P={colId:E},f[E]=P,P)},v={},w=p("sort",i);w&&i?.sortModel.forEach(({colId:E,sort:P},N)=>{const B=C(E);B.sort=P,B.sortIndex=N}),(w||!s)&&(v.sort=null,v.sortIndex=null);const b=p("rowGroup",n);b&&n?.groupColIds.forEach((E,P)=>{const N=C(E);N.rowGroup=!0,N.rowGroupIndex=P}),(b||!s)&&(v.rowGroup=null,v.rowGroupIndex=null);const S=p("aggregation",r);S&&r?.aggregationModel.forEach(({colId:E,aggFunc:P})=>{C(E).aggFunc=P}),(S||!s)&&(v.aggFunc=null);const y=p("pivot",a);y&&(a?.pivotColIds.forEach((E,P)=>{const N=C(E);N.pivot=!0,N.pivotIndex=P}),this.gos.updateGridOptions({options:{pivotMode:!!a?.pivotMode},source:t})),(y||!s)&&(v.pivot=null,v.pivotIndex=null);const x=p("columnPinning",l);if(x){for(const E of l?.leftColIds??[])C(E).pinned="left";for(const E of l?.rightColIds??[])C(E).pinned="right"}(x||!s)&&(v.pinned=null);const R=p("columnVisibility",c);if(R)for(const E of c?.hiddenColIds??[])C(E).hide=!0;(R||!s)&&(v.hide=null);const F=p("columnSizing",d);if(F)for(const{colId:E,flex:P,width:N}of d?.columnSizingModel??[]){const B=C(E);B.flex=P??null,B.width=N}(F||!s)&&(v.flex=null);const D=u?.orderedColIds,M=!!D?.length&&!o?.has("columnOrder"),k=M?D.map(E=>C(E)):Object.values(f);(k.length||h)&&(this.columnStates=k,_t(this.beans,{state:k,applyOrder:M,defaultState:v},t))}setColumnPivotState(e,t){const s=this.columnStates;this.columnStates=void 0;const o=this.columnGroupStates;this.columnGroupStates=void 0;const i=this.beans,{pivotResultCols:n,colGroupSvc:r}=i;if(n?.isPivotResultColsPresent()){if(s){const a=[];for(const l of s)n.getPivotResultCol(l.colId)&&a.push(l);_t(i,{state:a,applyOrder:e},t)}o&&r?.setColumnGroupState(o,t)}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return NP(t)}setColumnGroupState(e,t,s){const o=this.beans.colGroupSvc;if(!o||s?.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const i=new Set(e.columnGroup?.openColumnGroupIds),r=o.getColumnGroupState().map(({groupId:a})=>{const l=i.has(a);return l&&i.delete(a),{groupId:a,open:l}});for(const a of i)r.push({groupId:a,open:!0});r.length&&(this.columnGroupStates=r),o.setColumnGroupState(r,t)}getFilterState(){const e=this.beans.filterManager;let t=e?.getFilterModel();t&&Object.keys(t).length===0&&(t=void 0);const s=e?.getFilterState(),o=e?.getAdvFilterModel()??void 0;return t||o||s?{filterModel:t,columnFilterState:s,advancedFilterModel:o}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:s,columnFilterState:o,advancedFilterModel:i}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(s!==void 0||o!==void 0)&&t?.setFilterState(s??null,o??null,"columnFilter"),i!==void 0&&t?.setAdvFilterModel(i??null,"advancedFilter")}getRangeSelectionState(){const e=this.beans.rangeSvc?.getCellRanges().map(t=>{const{id:s,type:o,startRow:i,endRow:n,columns:r,startColumn:a}=t;return{id:s,type:o,startRow:i,endRow:n,colIds:r.map(l=>l.getColId()),startColId:a.getColId()}});return e?.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeSvc:s,colModel:o,visibleCols:i}=this.beans;if(!Hs(t)||!s)return;const n=[];for(const r of e?.cellRanges??[]){const a=[];for(const c of r.colIds){const d=o.getCol(c);d&&a.push(d)}if(!a.length)continue;let l=o.getCol(r.startColId);if(!l){const c=i.allCols,d=new Set(a);l=c.find(u=>d.has(u))}n.push({...r,columns:a,startColumn:l})}s.setCellRanges(n)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.beans.ctrlsSvc.getScrollFeature(),{left:t}=e?.getHScrollPosition()??{left:0},{top:s}=e?.getVScrollPosition()??{top:0};return s||t?{top:s,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:s}=e??{top:0,left:0},{frameworkOverrides:o,rowRenderer:i,animationFrameSvc:n,ctrlsSvc:r}=this.beans;o.wrapIncoming(()=>{r.get("center").setCenterViewportScrollLeft(s),r.getScrollFeature()?.setVerticalScrollPosition(t),i.redraw({afterScroll:!0}),n?.flushAllFrames()})}getSideBarState(){return this.beans.sideBar?.comp?.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.beans.focusSvc.getFocusedCell();if(e){const{column:t,rowIndex:s,rowPinned:o}=e;return{colId:t.getColId(),rowIndex:s,rowPinned:o}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:s}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:o,rowIndex:i,rowPinned:n}=e;t.setFocusedCell({column:s.getCol(o),rowIndex:i,rowPinned:n,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const s=e.getCurrentPage(),o=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!s&&!o))return{page:s,pageSize:o}}setPaginationState(e,t){const{pagination:s,gos:o}=this.beans;if(!s)return;const{pageSize:i,page:n}=e??{page:0,pageSize:o.get("paginationPageSize")},r=t==="gridInitializing";i&&!o.get("paginationAutoPageSize")&&s.setPageSize(i,r?"initialState":"pageSizeSelector"),typeof n=="number"&&(r?s.setPage(n):s.goToPage(n))}getRowSelectionState(){const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!t?.toggledNodes?.length?void 0:t}setRowSelectionState(e,t){this.beans.selectionSvc?.setSelectionState(e,t,t==="api")}getRowGroupExpansionState(){const{expansionSvc:e}=this.beans;if(e)return e.getExpansionState()}getRowPinningState(){return this.beans.pinnedRowModel?.getPinnedState()}setRowPinningState(e){const t=this.beans.pinnedRowModel;e?t?.setPinnedState(e):t?.reset()}setRowGroupExpansionState(e,t,s){const o=this.beans.expansionSvc;if(!o)return;const i=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};o.setExpansionState(i,s)}updateColumnState(e){const t=this.getColumnState();let s=!1;const o=this.cachedState;for(const i of Object.keys(t)){const n=t[i];an(n,o[i])||(s=!0)}this.cachedState={...o,...t},s&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const s=this.cachedState[e];this.setCachedStateValue(e,t),an(t,s)||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(){this.suppressEvents=!0,this.beans.colAnimation?.setSuppressAnimation(!0)}stopSuppressEvents(e){setTimeout(()=>{this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&(this.beans.colAnimation?.setSuppressAnimation(!1),this.dispatchStateUpdateEvent([e]))})}suppressEventsAndDispatchInitEvent(e){this.startSuppressEvents(),e(),this.stopSuppressEvents("gridInitializing")}},WT={moduleName:"GridState",version:K,beans:[zT],apiFunctions:{getState:HT,setState:GT}};function _T(e){return e.rowModel.isLastRowIndexKnown()}function jT(e){return e.pagination?.getPageSize()??100}function UT(e){return e.pagination?.getCurrentPage()??0}function $T(e){return e.pagination?.getTotalPages()??1}function KT(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function qT(e){e.pagination?.goToNextPage()}function YT(e){e.pagination?.goToPreviousPage()}function ZT(e){e.pagination?.goToFirstPage()}function XT(e){e.pagination?.goToLastPage()}function QT(e,t){e.pagination?.goToPage(t)}var JT=class extends A{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,s=()=>{const o=Math.max(oo(t),1),i=Math.floor(e/o);t.pagination.setPageSize(i,"autoCalculated")};this.isBodyRendered?ot(this,s,50)():(s(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},Hi="paginationPageSizeSelector",e6={tag:"span",cls:"ag-paging-page-size"},t6=class extends We{constructor(){super(e6),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(Hi,()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedEventListeners({paginationChanged:e=>this.handlePaginationChanged(e)})}handlePaginationChanged(e){if(!this.selectPageSizeComp||!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(){vt(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(Hi)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),s=!t||!e.includes(t);if(s){const i=this.gos.exists("paginationPageSize"),n=this.gos.get(Hi)!==!0;G(94,{pageSizeSet:i,pageSizesSet:n,pageSizeOptions:e,paginationPageSizeOption:t}),n||G(95,{paginationPageSizeOption:t,paginationPageSizeSelector:Hi}),e.unshift("")}const o=String(s?"":t);this.selectPageSizeComp?(Vs(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(o,!0)):this.createPageSizeSelectorComp(e,o),this.hasEmptyOption=s}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const s=this.getLocaleTextFunc(),o=s("pageSizeSelectorLabel","Page Size:"),i=s("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new Fd).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(i).setLabel(o).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(Hi);return!Array.isArray(t)||!t?.length?e:[...t].sort((s,o)=>s-o)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},s6={selector:"AG-PAGE-SIZE-SELECTOR",component:t6},o6=".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}",i6=class extends ZR{constructor(){super(),this.btFirst=ne,this.btPrevious=ne,this.btNext=ne,this.btLast=ne,this.lbRecordCount=ne,this.lbFirstRowOnPage=ne,this.lbLastRowOnPage=ne,this.lbCurrent=ne,this.lbTotal=ne,this.pageSizeComp=ne,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(o6)}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(),[s6]);const{btFirst:t,btPrevious:s,btNext:o,btLast:i}=this;this.activateTabIndex([t,s,o,i]),t.insertAdjacentElement("afterbegin",Ht(e?"last":"first",this.beans)),s.insertAdjacentElement("afterbegin",Ht(e?"next":"previous",this.beans)),o.insertAdjacentElement("afterbegin",Ht(e?"previous":"next",this.beans)),i.insertAdjacentElement("afterbegin",Ht(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:n=>this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(n):pR(this.beans,n),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:s}=e;this.addManagedListeners(t,{click:s,keydown:o=>{(o.key===T.ENTER||o.key===T.SPACE)&&(o.preventDefault(),s())}})}gR(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}):GP(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(),s=this.pagination.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const o=this.isZeroPagesToDisplay(),i=e===s-1;this.nextButtonDisabled=i||o,this.lastButtonDisabled=!t||o||e===s-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){Tb(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(),s=this.pagination.getMasterRowCount(),o=e?s:null,i=this.pagination.getCurrentPage(),n=this.pagination.getPageSize();let r,a;this.isZeroPagesToDisplay()?r=a=0:(r=n*i+1,a=r+n-1,e&&a>o&&(a=o));const l=r+n-1,c=!e&&s<l,d=this.formatNumber(r);this.lbFirstRowOnPage.textContent=d;let u;const h=this.getLocaleTextFunc();c?u=h("pageLastRowUnknown","?"):u=this.formatNumber(a),this.lbLastRowOnPage.textContent=u;const f=t>0?i+1:0,C=this.formatNumber(f);this.lbCurrent.textContent=C;let v,w;if(e)v=this.formatNumber(t),w=this.formatNumber(o);else{const b=h("more","more");v=b,w=b}this.lbTotal.textContent=v,this.lbRecordCount.textContent=w,this.announceAriaStatus(d,u,w,C,v)}announceAriaStatus(e,t,s,o,i){const n=this.getLocaleTextFunc(),r=n("page","Page"),a=n("to","to"),l=n("of","of"),c=`${e} ${a} ${t} ${l} ${s}`,d=`${r} ${o} ${l} ${i}`;c!==this.ariaRowStatus&&(this.ariaRowStatus=c,this.ariaAnnounce?.announceValue(c,"paginationRow")),d!==this.ariaPageStatus&&(this.ariaPageStatus=d,this.ariaAnnounce?.announceValue(d,"paginationPage"))}},n6={selector:"AG-PAGINATION",component:i6},r6=class extends A{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 n6}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:s}=this.beans;s?.isEditing()&&(s.isBatchEditing()?s.cleanupEditors():s.stopEditing(void 0,{source:"api"})),this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0})}goToPageWithIndex(e){if(!this.active)return;let t=e;this.paginateChildRows||(t=this.beans.rowModel.getTopLevelIndexFromDisplayedIndex?.(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 Y(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:Y(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:Y(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:Y(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 s=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}s!==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 s=this.pageSize,o=t-1;this.totalPages=Math.floor(o/s)+1,this.adjustCurrentPageIfInvalid();const i=this.currentPage,n=s*i;let r=s*(i+1)-1;if(r>o&&(r=o),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(n),r===o)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(r+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:s}=this,o=e-1;this.totalPages=Math.floor(o/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*s,this.bottomDisplayedRowIndex=t*(s+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:s=!1,newPageSize:o=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:s,newPageSize:o,keepRenderedRows:t})}},a6={moduleName:"Pagination",version:K,beans:[r6,JT],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:_T,paginationGetPageSize:jT,paginationGetCurrentPage:UT,paginationGetTotalPages:$T,paginationGetRowCount:KT,paginationGoToNextPage:qT,paginationGoToPreviousPage:YT,paginationGoToFirstPage:ZT,paginationGoToLastPage:XT,paginationGoToPage:QT},dependsOn:[Ma]};function l6(e,t={}){const s=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(s))}function eC(e,t,s,o,i){t&&(o&&t.parent&&t.parent.level!==-1&&eC(e,t.parent,s,o,i),t.setExpanded(s,void 0,i))}function c6(e,t){return e.rowModel.getRowNode(t)}function d6(e,t,s,o){e.rowRenderer.addRenderedRowListener(t,s,o)}function u6(e){return e.rowRenderer.getRenderedNodes()}function h6(e,t,s){e.rowModel.forEachNode(t,s)}function g6(e){return e.rowRenderer.firstRenderedRow}function p6(e){return e.rowRenderer.lastRenderedRow}function f6(e,t){return e.rowModel.getRow(t)}function m6(e){return e.rowModel.getRowCount()}var C6={moduleName:"RowApi",version:K,apiFunctions:{redrawRows:l6,setRowNodeExpanded:eC,getRowNode:c6,addRenderedRowListener:d6,getRenderedNodes:u6,forEachNode:h6,getFirstDisplayedRowIndex:g6,getLastDisplayedRowIndex:p6,getDisplayedRowAtIndex:f6,getDisplayedRowCount:m6}},v6={moduleName:"ScrollApi",version:K,apiFunctions:{getVerticalPixelRange:T4,getHorizontalPixelRange:I4,ensureColumnVisible:Vm,ensureIndexVisible:zm,ensureNodeVisible:k4}};function w6(e,t,s){if(!t)return;const o=e.ctrlsSvc.getGridBodyCtrl().eGridBody,i=`aria-${t}`;s===null?o.removeAttribute(i):o.setAttribute(i,s)}function b6(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function S6(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function y6(e){return e.animationFrameSvc?.isQueueEmpty()??!0}function x6(e){e.animationFrameSvc?.flushAllFrames()}function R6(e){return{rowHeight:oo(e),headerHeight:Pn(e)}}function F6(e,t={}){const s=[];for(const n of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const r=n.getCellRenderer();r!=null&&s.push(pn(r))}if(t.columns?.length)return s;const o=[],i=Wc(t.rowNodes);for(const n of e.rowRenderer.getAllRowCtrls()){if(i&&!_c(n.rowNode,i)||!n.isFullWidth())continue;const r=n.getFullWidthCellRenderers();for(let a=0;a<r.length;a++){const l=r[a];l!=null&&o.push(pn(l))}}return[...o,...s]}var E6={moduleName:"RenderApi",version:K,apiFunctions:{setGridAriaProperty:w6,refreshCells:b6,refreshHeader:S6,isAnimationFrameQueueEmpty:y6,flushAllAnimationFrames:x6,getSizesForCurrentTheme:R6,getCellRendererInstances:F6}};function D6(e,t){typeof t=="number"?e.colAutosize?.sizeColumnsToFit(t,"api"):e.colAutosize?.sizeColumnsToFitGridBody(t)}function tC({colAutosize:e,visibleCols:t},s,o){Array.isArray(s)?e?.autoSizeCols({colKeys:s,skipHeader:o,source:"api"}):e?.autoSizeCols({...s,colKeys:s.colIds??t.allCols,source:"api"})}function P6(e,t){t&&typeof t=="object"?tC(e,t):e.colAutosize?.autoSizeAllColumns({source:"api",skipHeader:t})}var M6=class extends A{constructor(){super(...arguments),this.beanName="colAutosize",this.timesDelayed=0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}postConstruct(){const{gos:e}=this,t=e.get("autoSizeStrategy");if(t){let s=!1;const o=t.type;if(o==="fitGridWidth"||o==="fitProvidedWidth")s=!0;else if(o==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const i=e.get("rowData");s=i!=null&&i.length>0&&_e(e)}s&&this.beans.colDelayRenderSvc?.hideColumns(o)}}autoSizeCols(e){const{eventSvc:t,visibleCols:s}=this.beans;this.innerAutoSizeCols(e).then(o=>{const i=c=>ii(t,Array.from(c),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return i(o);const n=Yh(this.beans),r=c=>s.leftCols.some(d=>Xi(d,c)),a=c=>s.rightCols.some(d=>Xi(d,c)),l=e.colKeys.filter(c=>!ys(c)&&!ps(c)&&!r(c)&&!a(c));this.sizeColumnsToFit(n,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:e.columnLimits?.map(c=>({...c,key:c.colId})),colKeys:l,onlyScaleUp:!0}),i(o)})}innerAutoSizeCols(e){return new Promise((t,s)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,s));const{colKeys:o,skipHeader:i,skipHeaderGroups:n,stopAtGroup:r,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:c=[],source:d="api"}=e,{animationFrameSvc:u,renderStatus:h,colModel:p,autoWidthCalc:f,visibleCols:C}=this.beans;if(u?.flushAllFrames(),this.timesDelayed<5&&h&&(!h.areHeaderCellsRendered()||!h.areCellsRendered())){this.timesDelayed++,setTimeout(()=>{this.isAlive()&&this.innerAutoSizeCols(e).then(t,s)});return}this.timesDelayed=0;const v=new Set;let w=-1;const b=Object.fromEntries(c.map(({colId:x,...R})=>[x,R])),S=i??this.gos.get("skipHeaderOnAutoSize"),y=n??S;for(;w!==0;){w=0;const x=[];for(const R of o){if(!R||W0(R))continue;const F=p.getCol(R);if(!F||v.has(F))continue;const D=f.getPreferredWidthForColumn(F,S);if(D>0){const M=b[F.colId]??{};M.minWidth??(M.minWidth=l),M.maxWidth??(M.maxWidth=a);const k=T6(F,D,M);F.setActualWidth(k,d),v.add(F),w++}x.push(F)}x.length&&C.refresh(d)}y||this.autoSizeColumnGroupsByColumns(o,d,r),t(v)})}autoSizeColumn(e,t,s){this.autoSizeCols({colKeys:[e],skipHeader:s,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,s){const{colModel:o,ctrlsSvc:i}=this.beans,n=new Set,r=o.getColsForKeys(e);for(const l of r){let c=l.getParent();for(;c&&c!=s;)c.isPadding()||n.add(c),c=c.getParent()}let a;for(const l of n){for(const c of i.getHeaderRowContainerCtrls())if(a=c.getHeaderCtrlForColumn(l),a)break;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 s=this.gos.get("skipHeaderOnAutoSize"),o=()=>{this.autoSizeColumn(t,"uiColumnResized",s)};e.addEventListener("dblclick",o);const i=new Ks(e);return i.addEventListener("doubleTap",o),()=>{e.removeEventListener("dblclick",o),i.destroy()}}addColumnGroupResize(e,t,s){const o=this.gos.get("skipHeaderOnAutoSize"),i=()=>{const n=[],r=t.getDisplayedLeafColumns();for(const a of r)a.getColDef().suppressAutoSize||n.push(a.getColId());n.length>0&&this.autoSizeCols({colKeys:n,skipHeader:o,stopAtGroup:t,source:"uiColumnResized"}),s()};return e.addEventListener("dblclick",i),()=>e.removeEventListener("dblclick",i)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const s=Yh(this.beans);if(s>0){this.sizeColumnsToFit(s,"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):G(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",s,o){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,s,o));return}const i={};for(const{key:f,...C}of o?.columnLimits??[])i[typeof f=="string"?f:f.getColId()]=C;const n=this.beans.visibleCols.allCols;if(e<=0||!n.length)return;const r=cs(n);if(o?.onlyScaleUp&&r>e||e===r&&n.every(C=>{if(C.colDef.suppressSizeToFit)return!0;const v=i?.[C.getId()],w=v?.minWidth??o?.defaultMinWidth,b=v?.maxWidth??o?.defaultMaxWidth,S=C.getActualWidth();return(w==null||S>=w)&&(b==null||S<=b)}))return;const l=[],c=[];for(const f of n){const C=o?.colKeys?.some(v=>Xi(f,v))??!0;f.getColDef().suppressSizeToFit||!C?c.push(f):l.push(f)}const d=l.slice(0);let u=!1;const h=f=>{jt(l,f),c.push(f)};for(const f of l){f.resetActualWidth(t);const C=i?.[f.getId()],v=C?.minWidth??o?.defaultMinWidth,w=C?.maxWidth??o?.defaultMaxWidth,b=f.getActualWidth();typeof v=="number"&&b<v?f.setActualWidth(v,t,!0):typeof w=="number"&&b>w&&f.setActualWidth(w,t,!0)}for(;!u;){u=!0;const f=e-cs(c);if(f<=0)for(const C of l){const v=i?.[C.getId()]?.minWidth??o?.defaultMinWidth??C.minWidth;C.setActualWidth(v,t,!0)}else{const C=f/cs(l);let v=f;for(let w=l.length-1;w>=0;w--){const b=l[w],S=i?.[b.getId()],y=S?.minWidth??o?.defaultMinWidth,x=S?.maxWidth??o?.defaultMaxWidth,R=b.getMinWidth(),F=b.getMaxWidth(),D=typeof y=="number"&&y>R?y:R,M=typeof x=="number"&&x<F?x:F;let k=Math.round(b.getActualWidth()*C);k<D?(k=D,h(b),u=!1):k>M?(k=M,h(b),u=!1):w===0&&(k=v),b.setActualWidth(k,t,!0),v-=k}}}for(const f of d)f.fireColumnWidthChangedEvent(t);const p=this.beans.visibleCols;p.setLeftValues(t),p.updateBodyWidths(),!s&&ii(this.eventSvc,d,!0,t)}applyAutosizeStrategy(){const{gos:e,colDelayRenderSvc:t}=this.beans,s=e.get("autoSizeStrategy");s?.type!=="fitGridWidth"&&s?.type!=="fitProvidedWidth"||setTimeout(()=>{if(!this.isAlive())return;const o=s.type;if(o==="fitGridWidth"){const{columnLimits:i,defaultMinWidth:n,defaultMaxWidth:r}=s,a=i?.map(({colId:l,minWidth:c,maxWidth:d})=>({key:l,minWidth:c,maxWidth:d}));this.sizeColumnsToFitGridBody({defaultMinWidth:n,defaultMaxWidth:r,columnLimits:a})}else o==="fitProvidedWidth"&&this.sizeColumnsToFit(s.width,"sizeColumnsToFit");t?.revealColumns(o)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{if(!this.isAlive())return;const s="autosizeColumns";e?this.autoSizeCols({...t,source:s,colKeys:e}):this.autoSizeAllColumns({...t,source:s}),this.beans.colDelayRenderSvc?.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 T6(e,t,s={}){const o=s.minWidth??e.getMinWidth();t<o&&(t=o);const i=s.maxWidth??e.getMaxWidth();return t>i&&(t=i),t}function Yh({ctrlsSvc:e,scrollVisibleSvc:t}){const s=e.getGridBodyCtrl(),i=s.isVerticalScrollShowing()?t.getScrollbarWidth():0;return dn(s.eGridBody)-i}var I6={moduleName:"ColumnAutoSize",version:K,beans:[M6],apiFunctions:{sizeColumnsToFit:D6,autoSizeColumns:tC,autoSizeAllColumns:P6},dependsOn:[Yf]},k6=".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 A6(e){return e.pinnedRowModel?.getPinnedTopRowCount()??0}function L6(e){return e.pinnedRowModel?.getPinnedBottomRowCount()??0}function O6(e,t){return e.pinnedRowModel?.getPinnedTopRow(t)}function N6(e,t){return e.pinnedRowModel?.getPinnedBottomRow(t)}function H6(e,t,s){return e.pinnedRowModel?.forEachPinnedRow(t,s)}var G6={moduleName:"PinnedRow",version:K,beans:[_R],css:[k6],apiFunctions:{getPinnedTopRowCount:A6,getPinnedBottomRowCount:L6,getPinnedTopRow:O6,getPinnedBottomRow:N6,forEachPinnedRow:H6},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},B6=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(){const e=this.firstNode.__autoHeights?.[this.col.getColId()];if(e==null)return;let t=0;for(const s of this.spannedNodes)s!==this.lastNode&&(t+=s.rowHeight);return e-t}},V6=class extends A{constructor(e){super(),this.column=e}buildCache(e){const{column:t,beans:{gos:s,pinnedRowModel:o,rowModel:i,valueSvc:n,pagination:r}}=this,{colDef:a}=t,l=this.getNodeMap(e),c=new Map,d=s.getCallback("isFullWidthRow"),u=a.equals,h=a.spanRows,p=typeof h=="function";let f=null,C=null,v;const w=(S,y)=>{f=S,C=null,v=y},b=S=>{const y=!S.isExpandable()&&!S.group&&!S.detail&&(d?!d({rowNode:S}):!0);if(S.rowIndex==null||!y){w(null,null);return}if(f==null||S.level!==f.level||S.footer||C&&S.rowIndex-1!==C?.getLastNode().rowIndex){w(S,n.getValue(t,S));return}const x=n.getValue(t,S);if(p){const R=he(s,{valueA:v,nodeA:f,valueB:x,nodeB:S,column:t,colDef:a});if(!h(R)){w(S,x);return}}else if(u?!u(v,x):v!==x){w(S,x);return}if(!C){const R=l?.get(f);R?.firstNode===f?(R.reset(),C=R):C=new B6(t,f),c.set(f,C)}C.addSpannedNode(S),c.set(S,C)};switch(e){case"center":i.forEachDisplayedNode?.(S=>{(!r||r.isRowInPage(S.rowIndex))&&b(S)}),this.centerValueNodeMap=c;break;case"top":o?.forEachPinnedRow("top",b),this.topValueNodeMap=c;break;case"bottom":o?.forEachPinnedRow("bottom",b),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}}},z6=class extends A{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=ot(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=ot(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 s=this.createManagedBean(new V6(e));this.spanningColumns.set(e,s),s.buildCache("top"),s.buildCache("bottom"),s.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?.createCtrls("top"),t?.createCtrls("bottom")},0);return}this.modelTimeout==null&&(this.modelTimeout=window.setTimeout(()=>{this.modelTimeout=null,this.buildModelCaches(),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 s=this.spanningColumns.get(e);return s?s.isCellSpanning(t):!1}getCellSpanByPosition(e){const{pinnedRowModel:t,rowModel:s}=this.beans,o=e.column,i=e.rowIndex,n=this.spanningColumns.get(o);if(!n)return;let r;switch(e.rowPinned){case"top":r=t?.getPinnedTopRow(i);break;case"bottom":r=t?.getPinnedBottomRow(i);break;default:r=s.getRow(i)}if(r)return n.getCellSpan(r)}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 s=this.spanningColumns.get(e);if(s)return s.getCellSpan(t)}forEachSpannedColumn(e,t){for(const[s,o]of this.spanningColumns)if(o.isCellSpanning(e)){const i=o.getCellSpan(e);t(s,i)}}destroy(){super.destroy(),this.spanningColumns.clear()}},W6=class extends Jo{constructor(e,t,s){super(e.col,e.firstNode,s,t),this.cellSpan=e,this.SPANNED_CELL_CSS_CLASS="ag-spanned-cell"}setComp(e,t,s,o,i,n,r){this.eWrapper=s,super.setComp(e,t,s,o,i,n,r),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||tp(e,t.rowIndex)}setAriaRowSpan(){Lb(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(Ea(t)){this.focusedCellPosition=void 0;return}const s=this.isCellFocused();s||(this.focusedCellPosition=void 0),e&&s&&(this.focusedCellPosition={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column}),super.onCellFocused(e)}getRootElement(){return this.eWrapper}},_6=class extends Jr{onRowIndexChanged(){super.onRowIndexChanged();for(const e of this.getAllCellCtrls())e.refreshAriaRowIndex()}getInitialRowClasses(e){return["ag-spanned-row"]}getNewCellCtrl(e){const t=this.beans.rowSpanSvc?.getCellSpan(e,this.rowNode);if(!(!t||t.firstNode!==this.rowNode))return new W6(t,this,this.beans)}isCorrectCtrlForSpan(e){const t=this.beans.rowSpanSvc?.getCellSpan(e.column,this.rowNode);return!t||t.firstNode!==this.rowNode?!1:e.getCellSpan()===t}onRowHeightChanged(){}refreshFirstAndLastRowStyles(){}addHoverFunctionality(){}resetHoveredStatus(){}},j6=class extends A{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,s=this.getCtrlsMap(e),o=s.size,i=this.getAllRelevantRowControls(e),n=new Map;let r=!1;for(const l of i)l.isAlive()&&t?.forEachSpannedColumn(l.rowNode,(c,d)=>{if(n.has(d.firstNode))return;const u=s.get(d.firstNode);if(u){n.set(d.firstNode,u),s.delete(d.firstNode);return}r=!0;const h=new _6(d.firstNode,this.beans,!1,!1,!1);n.set(d.firstNode,h)});this.setCtrlsMap(e,n);const a=n.size===o;if(!(!r&&a)){for(const l of s.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,s=t?.getCellSpanByPosition(e);if(!s)return;const o=this.getCtrlsMap(e.rowPinned).get(s.firstNode);if(o)return o.getAllCellCtrls().find(i=>i.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")}},U6={moduleName:"CellSpan",version:K,beans:[z6,j6]},$6=class extends A{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,s=e.colDef,o=s.cellClassRules,i=this.getCellClassParams(e,s);_d(this.beans.expressionSvc,o===this.cellClassRules?void 0:this.cellClassRules,o,i,n=>t.toggleCss(n,!0),n=>t.toggleCss(n,!1)),this.cellClassRules=o}applyUserStyles(){const e=this.column,t=e.colDef,s=t.cellStyle;if(!s)return;let o;if(typeof s=="function"){const i=this.getCellClassParams(e,t);o=s(i)}else o=s;o&&this.cellComp.setUserStyles(o)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,s=e.colDef,o=this.getCellClassParams(e,s);for(const n of this.staticClasses)t.toggleCss(n,!1);const i=this.beans.cellStyles.getStaticCellClasses(s,o);this.staticClasses=i;for(const n of i)t.toggleCss(n,!0)}getCellClassParams(e,t){const{value:s,rowNode:o}=this.cellCtrl;return he(this.beans.gos,{value:s,data:o.data,node:o,colDef:t,column:e,rowIndex:o.rowIndex})}},K6=class extends A{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,s,o){_d(this.beans.expressionSvc,void 0,e.cellClassRules,t,s,o),this.processStaticCellClasses(e,t,s)}getStaticCellClasses(e,t){const{cellClass:s}=e;if(!s)return[];let o;return typeof s=="function"?o=s(t):o=s,typeof o=="string"&&(o=[o]),o||[]}createCellCustomStyleFeature(e,t){return new $6(e,t)}processStaticCellClasses(e,t,s){this.getStaticCellClasses(e,t).forEach(i=>{s(i)})}},q6={moduleName:"CellStyle",version:K,beans:[K6]},Y6={moduleName:"RowStyle",version:K,beans:[L3]};function Z6(e,t){return!!e.colHover?.isHovered(t)}var X6=class extends A{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=s=>{const{beans:o,gos:i,element:n,columns:r}=this,a=o.colHover;if(s??!!i.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(n,{mouseover:a.setMouseOver.bind(a,r),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}},Q6="ag-column-hover",J6=class extends A{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,s){const o=()=>{const i=this.isHovered(s);t.toggleCss("ag-column-hover",i)};e.addManagedEventListeners({columnHoverChanged:o}),o()}onCellColumnHover(e,t){if(!t)return;const s=this.isHovered(e);t.toggleCss(Q6,s)}addHeaderFilterColumnHoverListener(e,t,s,o){this.createHoverFeature(e,[s],o);const i=()=>{const n=this.isHovered(s);t.toggleCss("ag-column-hover",n)};e.addManagedEventListeners({columnHoverChanged:i}),i()}createHoverFeature(e,t,s){e.createManagedBean(new X6(t,s))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},eI={moduleName:"ColumnHover",version:K,beans:[J6],apiFunctions:{isColumnHovered:Z6}},tI=class extends A{constructor(){super(...arguments),this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){this.wrapSvc=this.beans.frameworkOverrides.createGlobalEventListenerWrapper?.()}addListener(e,t){const s=this.wrapSvc?.wrap(e,t)??t,o=!Dr.has(e),i=o?this.asyncListeners:this.syncListeners;i.has(e)||i.set(e,new Set),i.get(e).add(s),this.eventSvc.addListener(e,s,o)}removeListener(e,t){const s=this.wrapSvc?.unwrap(e,t)??t,i=!!this.asyncListeners.get(e)?.delete(s);i||this.syncListeners.get(e)?.delete(s),this.eventSvc.removeListener(e,s,i)}addGlobalListener(e){const t=this.wrapSvc?.wrapGlobal(e)??e,s=(n,r)=>{Dr.has(n)&&t(n,r)},o=(n,r)=>{Dr.has(n)||t(n,r)};this.globalListenerPairs.set(e,{syncListener:s,asyncListener:o});const i=this.eventSvc;i.addGlobalListener(s,!1),i.addGlobalListener(o,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:s,globalListenerPairs:o}=this,i=s?.unwrapGlobal(e)??e;if(o.has(i)){const{syncListener:r,asyncListener:a}=o.get(i);t.removeGlobalListener(r,!1),t.removeGlobalListener(a,!0),o.delete(e)}else this.syncGlobalListeners.delete(i),t.removeGlobalListener(i,!1)}destroyEventListeners(e,t){e.forEach((s,o)=>{s.forEach(i=>this.eventSvc.removeListener(o,i,t)),s.clear()}),e.clear()}destroyGlobalListeners(e,t){for(const s of e)this.eventSvc.removeGlobalListener(s,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:s,asyncListener:o})=>{t.removeGlobalListener(s,!1),t.removeGlobalListener(o,!0)}),e.clear()}};function sI(e,t,s){e.apiEventSvc?.addListener(t,s)}function oI(e,t,s){e.apiEventSvc?.removeListener(t,s)}function iI(e,t){e.apiEventSvc?.addGlobalListener(t)}function nI(e,t){e.apiEventSvc?.removeGlobalListener(t)}var rI={moduleName:"EventApi",version:K,apiFunctions:{addEventListener:sI,addGlobalListener:iI,removeEventListener:oI,removeGlobalListener:nI},beans:[tI]},aI={moduleName:"Locale",version:K,beans:[LP]},lI=class extends A{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=ot(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){const{visibleCols:e,rowModel:t,rowSpanSvc:s,pinnedRowModel:o}=this.beans,i=e.autoHeightCols;let n=!1;const r=a=>{const l=a.__autoHeights;let c=Ns(this.beans,a).height;for(const d of i){let u=l?.[d.getColId()];const h=s?.getCellSpan(d,a);if(h){if(h.getLastNode()!==a)continue;if(u=s?.getCellSpan(d,a)?.getLastNodeAutoHeight(),!u)return}if(u==null){if(this.colSpanSkipCell(d,a))continue;return}c=Math.max(u,c)}c!==a.rowHeight&&(a.setRowHeight(c),n=!0)};o?.forEachPinnedRow?.("top",r),o?.forEachPinnedRow?.("bottom",r),t.forEachDisplayedNode?.(r),n&&t.onRowHeightChanged?.()}setRowAutoHeight(e,t,s){if(e.__autoHeights??(e.__autoHeights={}),t==null){delete e.__autoHeights[s.getId()];return}const o=e.__autoHeights[s.getId()];e.__autoHeights[s.getId()]=t,o!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:s,colViewport:o,visibleCols:i}=this.beans;if(!s.colSpanActive)return!1;let n=[];switch(e.getPinned()){case"left":n=i.getLeftColsForRow(t);break;case"right":n=i.getRightColsForRow(t);break;case null:n=o.getColsWithinViewport(t);break}return!n.includes(e)}setupCellAutoHeight(e,t,s){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const o=t.parentElement,{rowNode:i,column:n}=e,r=this.beans,a=d=>{if(this.beans.editSvc?.isEditing(e)||!e.isAlive()||!s.isAlive())return;const{paddingTop:u,paddingBottom:h,borderBottomWidth:p,borderTopWidth:f}=bo(o),C=u+h+p+f,w=t.offsetHeight+C;if(d<5){const S=!Je(r)?.contains(t),y=w==0;if(S||y){window.setTimeout(()=>a(d+1),0);return}}this.setRowAutoHeight(i,w,n)},l=()=>a(0);l();const c=bs(r,t,l);return s.addDestroyFunc(()=>{c(),this.setRowAutoHeight(i,void 0,n)}),!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:s}of e)if((!t||this.beans.colModel.colSpanActive)&&(t=this.beans.colViewport.getColsWithinViewport(s).filter(i=>i.isAutoHeight())),t.length!==0){if(!s.__autoHeights)return!1;for(const o of t){const i=s.__autoHeights[o.getColId()];if(!i||s.rowHeight<i)return!1}}return!0}},cI={moduleName:"RowAutoHeight",version:K,beans:[lI]},dI={moduleName:"AllCommunity",version:K,dependsOn:[lT,mT,ET,JP,cM,dM,uM,hM,gM,pM,fM,lM,t4,s4,o4,e4,n4,r4,WT,VM,a6,Zf,C6,v6,E6,I6,z2,G6,TM,mP,q6,eI,Y6,rI,wP,NT,Bm,aI,cI,V2,cT,U6]},dt=g.createContext({}),sC=g.createContext("default"),Tn=(e,t,s,o)=>{if(!e||e.componentFromFramework||t.isDestroyed())return;const n=e.newAgStackInstance();let r,a,l=!1;return n.then(c=>{if(l){t.destroyBean(c);return}r=c,a=r.getGui(),s.appendChild(a),Zh(o,r)}),()=>{l=!0,r&&(a?.remove(),t.destroyBean(r),o&&Zh(o,void 0))}},Zh=(e,t)=>{if(e)if(e instanceof Function)e(t);else{const s=e;s.current=t}},At=(...e)=>e.filter(s=>s!=null&&s!=="").join(" "),Gt=class oC{constructor(...t){this.classesMap={};for(const s of t)this.classesMap[s]=!0}setClass(t,s){if(!!this.classesMap[t]==s)return this;const i=new oC;return i.classesMap={...this.classesMap},i.classesMap[t]=s,i}toString(){return Object.keys(this.classesMap).filter(s=>this.classesMap[s]).join(" ")}},fi=e=>{const t=()=>typeof Symbol=="function"&&Symbol.for,s=()=>t()?Symbol.for("react.memo"):60115;return typeof e=="function"&&!(e.prototype&&e.prototype.isReactComponent)||typeof e=="object"&&e.$$typeof===s()},qc=g.version?.split(".")[0],iC=qc==="16"||qc==="17";function uI(){return qc==="19"}var Mr=!1;function hI(e){return Mr||setTimeout(()=>Mr=!1,0),Mr=!0,e()}var wn=(e,t)=>{!iC&&e&&!Mr?Sn.flushSync(t):t()},gI=e=>{iC?e():g.startTransition(e)};function pI(e,t,s){return g.useSyncExternalStore?g.useSyncExternalStore(e,t):s}function sa(e,t,s){if(t==null||e==null)return t;if(e===t||t.length===0&&e.length===0)return e;if(s||e.length===0&&t.length>0||e.length>0&&t.length===0)return t;const o=[],i=[],n=new Map,r=new Map;for(let a=0;a<t.length;a++){const l=t[a];r.set(l.instanceId,l)}for(let a=0;a<e.length;a++){const l=e[a];n.set(l.instanceId,l),r.has(l.instanceId)&&o.push(l)}for(let a=0;a<t.length;a++){const l=t[a],c=l.instanceId;n.has(c)||i.push(l)}return o.length===e.length&&i.length===0?e:o.length===0&&i.length===t.length?t:o.length===0?i:i.length===0?o:[...o,...i]}var nC=g.forwardRef((e,t)=>{const{registry:s,context:o}=g.useContext(dt),i=g.useRef(null),n=g.useRef(null),r=g.useRef(null),a=g.useRef(null),l=g.useRef(null),c=g.useRef(),[d,u]=g.useState(),[h,p]=g.useState(),[f,C]=g.useState(),[v,w]=g.useState(()=>new Gt),[b,S]=g.useState(()=>new Gt("ag-hidden")),[y,x]=g.useState(()=>new Gt("ag-hidden")),[R,F]=g.useState(()=>new Gt("ag-invisible"));g.useImperativeHandle(t,()=>({refresh(){return!1}})),g.useLayoutEffect(()=>Tn(d,o,n.current),[d]);const D=g.useCallback(te=>{if(i.current=te,!te||o.isDestroyed()){c.current=o.destroyBean(c.current);return}const L={setInnerRenderer:(V,Q)=>{u(V),C(Q)},setChildCount:V=>p(V),toggleCss:(V,Q)=>w(X=>X.setClass(V,Q)),setContractedDisplayed:V=>x(Q=>Q.setClass("ag-hidden",!V)),setExpandedDisplayed:V=>S(Q=>Q.setClass("ag-hidden",!V)),setCheckboxVisible:V=>F(Q=>Q.setClass("ag-invisible",!V)),setCheckboxSpacing:V=>F(Q=>Q.setClass("ag-group-checkbox-spacing",V))},le=s.createDynamicBean("groupCellRendererCtrl",!0);le&&(c.current=o.createBean(le),c.current.init(L,te,r.current,a.current,l.current,nC,e))},[]),M=g.useMemo(()=>`ag-cell-wrapper ${v.toString()}`,[v]),k=g.useMemo(()=>`ag-group-expanded ${b.toString()}`,[b]),E=g.useMemo(()=>`ag-group-contracted ${y.toString()}`,[y]),P=g.useMemo(()=>`ag-group-checkbox ${R.toString()}`,[R]),N=d?.componentFromFramework,B=N?d.componentClass:void 0,O=d==null&&f!=null,J=hi(f);return g.createElement("span",{className:M,ref:D,...e.colDef?{}:{role:c.current?.getCellAriaRole()}},g.createElement("span",{className:k,ref:a}),g.createElement("span",{className:E,ref:l}),g.createElement("span",{className:P,ref:r}),g.createElement("span",{className:"ag-group-value",ref:n},O?J:N?g.createElement(B,{...d.params}):null),g.createElement("span",{className:"ag-group-child-count"},h))}),Xh=nC,Xd=g.createContext({setMethods:()=>{}}),fI=e=>{const{initialProps:t,addUpdateCallback:s,CustomComponentClass:o,setMethods:i}=e,[{key:n,...r},a]=g.useState(t);return g.useEffect(()=>{s(l=>a(l))},[]),g.createElement(Xd.Provider,{value:{setMethods:i}},g.createElement(o,{key:n,...r}))},mI=g.memo(fI),CI=0;function Qh(){return`agPortalKey_${++CI}`}var rC=class{constructor(e,t,s,o){this.portal=null,this.oldPortal=null,this.reactComponent=e,this.portalManager=t,this.componentType=s,this.suppressFallbackMethods=!!o,this.statelessComponent=this.isStateless(this.reactComponent),this.key=Qh(),this.portalKey=Qh(),this.instanceCreated=this.isStatelessComponent()?Ee.resolve(!1):new Ee(i=>{this.resolveInstanceCreated=i})}getGui(){return this.eParentElement}getRootElement(){return this.eParentElement.firstChild}destroy(){this.componentInstance&&typeof this.componentInstance.destroy=="function"&&this.componentInstance.destroy();const e=this.portal;e&&this.portalManager.destroyPortal(e)}createParentElement(e){const t=this.portalManager.getComponentWrappingElement(),s=document.createElement(t||"div");return s.classList.add("ag-react-container"),e.reactContainer=s,s}statelessComponentRendered(){return this.eParentElement.childElementCount>0||this.eParentElement.childNodes.length>0}getFrameworkComponentInstance(){return this.componentInstance}isStatelessComponent(){return this.statelessComponent}getReactComponentName(){return this.reactComponent.name}getMemoType(){return this.hasSymbol()?Symbol.for("react.memo"):60115}hasSymbol(){return typeof Symbol=="function"&&Symbol.for}isStateless(e){return typeof e=="function"&&!(e.prototype&&e.prototype.isReactComponent)||typeof e=="object"&&e.$$typeof===this.getMemoType()}hasMethod(e){const t=this.getFrameworkComponentInstance();return!!t&&t[e]!=null||this.fallbackMethodAvailable(e)}callMethod(e,t){const s=this.getFrameworkComponentInstance();if(this.isStatelessComponent())return this.fallbackMethod(e,t&&t[0]?t[0]:{});if(!s){setTimeout(()=>this.callMethod(e,t));return}const o=s[e];if(o)return o.apply(s,t);if(this.fallbackMethodAvailable(e))return this.fallbackMethod(e,t&&t[0]?t[0]:{})}addMethod(e,t){this[e]=t}init(e){return this.eParentElement=this.createParentElement(e),this.createOrUpdatePortal(e),new Ee(t=>this.createReactComponent(t))}createOrUpdatePortal(e){this.isStatelessComponent()||(this.ref=t=>{this.componentInstance=t,this.resolveInstanceCreated?.(!0),this.resolveInstanceCreated=void 0},e.ref=this.ref),this.reactElement=this.createElement(this.reactComponent,{...e,key:this.key}),this.portal=Sn.createPortal(this.reactElement,this.eParentElement,this.portalKey)}createElement(e,t){return g.createElement(e,t)}createReactComponent(e){this.portalManager.mountReactPortal(this.portal,this,e)}rendered(){return this.isStatelessComponent()&&this.statelessComponentRendered()||!!(!this.isStatelessComponent()&&this.getFrameworkComponentInstance())}refreshComponent(e){this.oldPortal=this.portal,this.createOrUpdatePortal(e),this.portalManager.updateReactPortal(this.oldPortal,this.portal)}fallbackMethod(e,t){const s=this[`${e}Component`];if(!this.suppressFallbackMethods&&s)return s.bind(this)(t)}fallbackMethodAvailable(e){return this.suppressFallbackMethods?!1:!!this[`${e}Component`]}};function ka(e,t,s){for(const o of e){const i=t[o];i&&(s[o]=i)}}var Pt=class extends rC{constructor(){super(...arguments),this.awaitUpdateCallback=new Ee(e=>{this.resolveUpdateCallback=e}),this.wrapperComponent=mI}init(e){return this.sourceParams=e,super.init(this.getProps())}addMethod(){}getInstance(){return this.instanceCreated.then(()=>this.componentInstance)}getFrameworkComponentInstance(){return this}createElement(e,t){return super.createElement(this.wrapperComponent,{initialProps:t,CustomComponentClass:e,setMethods:s=>this.setMethods(s),addUpdateCallback:s=>{this.updateCallback=()=>(s(this.getProps()),new Ee(o=>{setTimeout(()=>{o()})})),this.resolveUpdateCallback()}})}setMethods(e){this.providedMethods=e,ka(this.getOptionalMethods(),this.providedMethods,this)}getOptionalMethods(){return[]}getProps(){return{...this.sourceParams,key:this.key,ref:this.ref}}refreshProps(){return this.updateCallback?this.updateCallback():new Ee(e=>this.awaitUpdateCallback.then(()=>{this.updateCallback().then(()=>e())}))}},vI=class extends Pt{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},wI=class extends Pt{constructor(){super(...arguments),this.date=null,this.onDateChange=e=>this.updateDate(e)}getDate(){return this.date}setDate(e){this.date=e,this.refreshProps()}refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled"]}updateDate(e){this.setDate(e),this.sourceParams.onDateChanged()}getProps(){const e=super.getProps();return e.date=this.date,e.onDateChange=this.onDateChange,delete e.onDateChanged,e}},bI=class extends Pt{constructor(){super(...arguments),this.label="",this.icon=null,this.shake=!1}setIcon(e,t){this.icon=e,this.shake=t,this.refreshProps()}setLabel(e){this.label=e,this.refreshProps()}getProps(){const e=super.getProps(),{label:t,icon:s,shake:o}=this;return e.label=t,e.icon=s,e.shake=o,e}},SI=class extends Pt{constructor(){super(...arguments),this.model=null,this.onModelChange=e=>this.updateModel(e),this.onUiChange=()=>this.sourceParams.filterModifiedCallback(),this.expectingNewMethods=!0,this.hasBeenActive=!1,this.awaitSetMethodsCallback=new Ee(e=>{this.resolveSetMethodsCallback=e})}isFilterActive(){return this.model!=null}doesFilterPass(e){return this.providedMethods.doesFilterPass(e)}getModel(){return this.model}setModel(e){return this.expectingNewMethods=!0,this.model=e,this.hasBeenActive||(this.hasBeenActive=this.isFilterActive()),this.refreshProps()}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}afterGuiAttached(e){const t=this.providedMethods;t?t.afterGuiAttached?.(e):this.awaitSetMethodsCallback.then(()=>this.providedMethods?.afterGuiAttached?.(e))}getOptionalMethods(){return["afterGuiDetached","onNewRowsLoaded","getModelAsString","onAnyFilterChanged"]}setMethods(e){this.expectingNewMethods===!1&&this.hasBeenActive&&this.providedMethods?.doesFilterPass!==e?.doesFilterPass&&setTimeout(()=>{this.sourceParams.filterChangedCallback()}),this.expectingNewMethods=!1,super.setMethods(e),this.resolveSetMethodsCallback(),this.resolveFilterPassCallback?.(),this.resolveFilterPassCallback=void 0}updateModel(e){this.resolveFilterPassCallback?.();const t=new Ee(s=>{this.resolveFilterPassCallback=s});this.setModel(e).then(()=>{t.then(()=>{this.sourceParams.filterChangedCallback()})})}getProps(){const e=super.getProps();return e.model=this.model,e.onModelChange=this.onModelChange,e.onUiChange=this.onUiChange,delete e.filterChangedCallback,e}},yI=class extends Pt{constructor(){super(...arguments),this.awaitSetMethodsCallback=new Ee(e=>{this.resolveSetMethodsCallback=e})}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}afterGuiAttached(e){const t=this.providedMethods;t?t.afterGuiAttached?.(e):this.awaitSetMethodsCallback.then(()=>this.providedMethods?.afterGuiAttached?.(e))}getOptionalMethods(){return["afterGuiDetached","onNewRowsLoaded","onAnyFilterChanged"]}setMethods(e){super.setMethods(e),this.resolveSetMethodsCallback()}};function aC(e,t){e.parentFilterInstance(s=>{(s.setModel(t)||Ee.resolve()).then(()=>{e.filterParams.filterChangedCallback()})})}var xI=class{constructor(e,t){this.floatingFilterParams=e,this.refreshProps=t,this.model=null,this.onModelChange=s=>this.updateModel(s)}getProps(){return{...this.floatingFilterParams,model:this.model,onModelChange:this.onModelChange}}onParentModelChanged(e){this.model=e,this.refreshProps()}refresh(e){this.floatingFilterParams=e,this.refreshProps()}setMethods(e){ka(this.getOptionalMethods(),e,this)}getOptionalMethods(){return["afterGuiAttached"]}updateModel(e){this.model=e,this.refreshProps(),aC(this.floatingFilterParams,e)}},RI=class extends Pt{constructor(){super(...arguments),this.model=null,this.onModelChange=e=>this.updateModel(e)}onParentModelChanged(e){this.model=e,this.refreshProps()}refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached"]}updateModel(e){this.model=e,this.refreshProps(),aC(this.sourceParams,e)}getProps(){const e=super.getProps();return e.model=this.model,e.onModelChange=this.onModelChange,e}},FI=class extends Pt{refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached"]}},EI=class extends Pt{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},DI=class extends Pt{refresh(e){this.sourceParams=e,this.refreshProps()}},PI=class extends Pt{constructor(){super(...arguments),this.active=!1,this.expanded=!1,this.onActiveChange=e=>this.updateActive(e)}setActive(e){this.awaitSetActive(e)}setExpanded(e){this.expanded=e,this.refreshProps()}getOptionalMethods(){return["select","configureDefaults"]}awaitSetActive(e){return this.active=e,this.refreshProps()}updateActive(e){const t=this.awaitSetActive(e);e&&t.then(()=>this.sourceParams.onItemActivated())}getProps(){const e=super.getProps();return e.active=this.active,e.expanded=this.expanded,e.onActiveChange=this.onActiveChange,delete e.onItemActivated,e}},MI=class extends Pt{refresh(e){this.sourceParams=e,this.refreshProps()}},TI=class extends Pt{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},II=class extends Pt{constructor(){super(...arguments),this.onStateChange=e=>this.updateState(e)}refresh(e){return this.sourceParams=e,this.refreshProps(),!0}getState(){return this.state}updateState(e){this.state=e,this.refreshProps(),this.sourceParams.onStateUpdated()}getProps(){const e=super.getProps();return e.state=this.state,e.onStateChange=this.onStateChange,e}};function Qd(){G(231)}var kI=1e3,AI=class{constructor(e,t,s){this.destroyed=!1,this.portals=[],this.hasPendingPortalUpdate=!1,this.wrappingElement=t||"div",this.refresher=e,this.maxComponentCreationTimeMs=s||kI}getPortals(){return this.portals}destroy(){this.destroyed=!0}destroyPortal(e){this.portals=this.portals.filter(t=>t!==e),this.batchUpdate()}getComponentWrappingElement(){return this.wrappingElement}mountReactPortal(e,t,s){this.portals=[...this.portals,e],this.waitForInstance(t,s),this.batchUpdate()}updateReactPortal(e,t){this.portals[this.portals.indexOf(e)]=t,this.batchUpdate()}batchUpdate(){this.hasPendingPortalUpdate||(setTimeout(()=>{this.destroyed||(this.refresher(),this.hasPendingPortalUpdate=!1)}),this.hasPendingPortalUpdate=!0)}waitForInstance(e,t,s=Date.now()){if(this.destroyed){t(null);return}if(e.rendered())t(e);else{if(Date.now()-s>=this.maxComponentCreationTimeMs&&!this.hasPendingPortalUpdate){wn(!0,()=>this.refresher()),e.rendered()&&t(e);return}window.setTimeout(()=>{this.waitForInstance(e,t,s)})}}},LI=({ctrl:e})=>{const t=e.isAlive(),{context:s}=g.useContext(dt),[o,i]=g.useState(),[n,r]=g.useState(),a=g.useRef(),l=g.useRef(null),c=g.useRef(null),d=g.useRef(null),u=g.useRef(),h=g.useRef();t&&!h.current&&(h.current=new Fn(()=>l.current));const p=g.useCallback(w=>{if(l.current=w,!w||!e.isAlive()||s.isDestroyed()){a.current=s.destroyBean(a.current);return}a.current=s.createBean(new gi);const b=()=>{const y=e.getSelectAllGui();y&&(c.current?.insertAdjacentElement("afterend",y),a.current.addDestroyFunc(()=>y.remove()))},S={setWidth:y=>{l.current&&(l.current.style.width=y)},toggleCss:(y,x)=>h.current.toggleCss(y,x),setUserStyles:y=>r(y),setAriaSort:y=>{l.current&&(y?Hb(l.current,y):Gb(l.current))},setUserCompDetails:y=>i(y),getUserCompInstance:()=>u.current||void 0,refreshSelectAllGui:b,removeSelectAllGui:()=>e.getSelectAllGui()?.remove()};e.setComp(S,w,c.current,d.current,a.current),b()},[]);g.useLayoutEffect(()=>Tn(o,s,d.current,u),[o]),g.useEffect(()=>{e.setDragSource(l.current)},[o]);const f=g.useMemo(()=>!!(o?.componentFromFramework&&fi(o.componentClass)),[o]),C=o?.componentFromFramework,v=o?.componentClass;return g.createElement("div",{ref:p,style:n,className:"ag-header-cell",role:"columnheader"},g.createElement("div",{ref:c,className:"ag-header-cell-resize",role:"presentation"}),g.createElement("div",{ref:d,className:"ag-header-cell-comp-wrapper",role:"presentation"},C?f?g.createElement(v,{...o.params}):g.createElement(v,{...o.params,ref:u}):null))},OI=g.memo(LI),NI=class{constructor(e,t){this.floatingFilterParams=e,this.refreshProps=t}getProps(){return this.floatingFilterParams}refresh(e){this.floatingFilterParams=e,this.refreshProps()}setMethods(e){ka(this.getOptionalMethods(),e,this)}getOptionalMethods(){return["afterGuiAttached"]}},HI=({ctrl:e})=>{const{context:t,gos:s}=g.useContext(dt),[o,i]=g.useState(),[n,r]=g.useState(()=>new Gt("ag-header-cell","ag-floating-filter")),[a,l]=g.useState(()=>new Gt),[c,d]=g.useState(()=>new Gt("ag-floating-filter-button","ag-hidden")),[u,h]=g.useState("false"),[p,f]=g.useState(),[,C]=g.useState(1),v=g.useRef(),w=g.useRef(null),b=g.useRef(null),S=g.useRef(null),y=g.useRef(null),x=g.useRef(),R=g.useRef(),F=V=>{V!=null&&x.current&&x.current(V)},D=g.useCallback(V=>{if(w.current=V,!V||!e.isAlive()||t.isDestroyed()){v.current=t.destroyBean(v.current);return}v.current=t.createBean(new gi),R.current=new Ee(X=>{x.current=X});const Q={toggleCss:(X,$)=>r(q=>q.setClass(X,$)),setUserStyles:X=>i(X),addOrRemoveBodyCssClass:(X,$)=>l(q=>q.setClass(X,$)),setButtonWrapperDisplayed:X=>{d($=>$.setClass("ag-hidden",!X)),h(X?"false":"true")},setWidth:X=>{w.current&&(w.current.style.width=X)},setCompDetails:X=>f(X),getFloatingFilterComp:()=>R.current?R.current:null,setMenuIcon:X=>y.current?.appendChild(X)};e.setComp(Q,V,y.current,b.current,v.current)},[]);g.useLayoutEffect(()=>Tn(p,t,b.current,F),[p]);const M=g.useMemo(()=>n.toString(),[n]),k=g.useMemo(()=>a.toString(),[a]),E=g.useMemo(()=>c.toString(),[c]),P=g.useMemo(()=>!!(p&&p.componentFromFramework&&fi(p.componentClass)),[p]),N=g.useMemo(()=>s.get("reactiveCustomComponents"),[]),B=g.useMemo(()=>s.get("enableFilterHandlers"),[]),[O,J]=g.useState();g.useEffect(()=>{if(p?.componentFromFramework)if(N){const V=B?NI:xI,Q=new V(p.params,()=>C(X=>X+1));F(Q),J(Q)}else Qd()},[p]);const te=O?.getProps(),L=p?.componentFromFramework,le=p?.componentClass;return g.createElement("div",{ref:D,style:o,className:M,role:"gridcell"},g.createElement("div",{ref:b,className:k,role:"presentation"},L?N?te&&g.createElement(Xd.Provider,{value:{setMethods:V=>O.setMethods(V)}},g.createElement(le,{...te})):g.createElement(le,{...p.params,ref:P?()=>{}:F}):null),g.createElement("div",{ref:S,"aria-hidden":u,className:E,role:"presentation"},g.createElement("button",{ref:y,type:"button",className:"ag-button ag-floating-filter-button-button",tabIndex:-1})))},GI=g.memo(HI),BI=({ctrl:e})=>{const{context:t}=g.useContext(dt),[s,o]=g.useState(),[i,n]=g.useState(()=>new Gt),[r,a]=g.useState(()=>new Gt),[l,c]=g.useState("false"),[d,u]=g.useState(),[h,p]=g.useState(),f=g.useRef(),C=g.useRef(null),v=g.useRef(null),w=g.useRef(null),b=g.useRef(),S=g.useCallback(M=>{if(C.current=M,!M||!e.isAlive()||t.isDestroyed()){f.current=t.destroyBean(f.current);return}f.current=t.createBean(new gi);const k={setWidth:E=>{C.current&&(C.current.style.width=E)},toggleCss:(E,P)=>n(N=>N.setClass(E,P)),setUserStyles:E=>o(E),setHeaderWrapperHidden:E=>{const P=w.current;P&&(E?P.style.setProperty("display","none"):P.style.removeProperty("display"))},setHeaderWrapperMaxHeight:E=>{const P=w.current;P&&(E!=null?P.style.setProperty("max-height",`${E}px`):P.style.removeProperty("max-height"),P.classList.toggle("ag-header-cell-comp-wrapper-limited-height",E!=null))},setUserCompDetails:E=>p(E),setResizableDisplayed:E=>{a(P=>P.setClass("ag-hidden",!E)),c(E?"false":"true")},setAriaExpanded:E=>u(E),getUserCompInstance:()=>b.current||void 0};e.setComp(k,M,v.current,w.current,f.current)},[]);g.useLayoutEffect(()=>Tn(h,t,w.current),[h]),g.useEffect(()=>{C.current&&e.setDragSource(C.current)},[h]);const y=g.useMemo(()=>!!(h?.componentFromFramework&&fi(h.componentClass)),[h]),x=g.useMemo(()=>"ag-header-group-cell "+i.toString(),[i]),R=g.useMemo(()=>"ag-header-cell-resize "+r.toString(),[r]),F=h?.componentFromFramework,D=h?.componentClass;return g.createElement("div",{ref:S,style:s,className:x,role:"columnheader","aria-expanded":d},g.createElement("div",{ref:w,className:"ag-header-cell-comp-wrapper",role:"presentation"},F?y?g.createElement(D,{...h.params}):g.createElement(D,{...h.params,ref:b}):null),g.createElement("div",{ref:v,"aria-hidden":l,className:R}))},VI=g.memo(BI),zI=({ctrl:e})=>{const{gos:t,context:s}=g.useContext(dt),{topOffset:o,rowHeight:i}=g.useMemo(()=>e.getTopAndHeight(),[]),n=g.useMemo(()=>t.get("tabIndex"),[]),[r,a]=g.useState(()=>e.getAriaRowIndex()),l=e.headerRowClass,[c,d]=g.useState(()=>i+"px"),[u,h]=g.useState(()=>o+"px"),p=g.useRef(null),[f,C]=g.useState(()=>e.getUpdatedHeaderCtrls()),v=g.useRef(),w=g.useRef(null),b=g.useCallback(x=>{if(w.current=x,!x||!e.isAlive()||s.isDestroyed()){v.current=s.destroyBean(v.current);return}v.current=s.createBean(new gi);const R={setHeight:F=>d(F),setTop:F=>h(F),setHeaderCtrls:(F,D,M)=>{const k=p.current,E=sa(k,F,D);E!==k&&(p.current=E,wn(M,()=>C(E)))},setWidth:F=>{w.current&&(w.current.style.width=F)},setRowIndex:F=>{a(F)}};e.setComp(R,v.current,!1)},[]),S=g.useMemo(()=>({height:c,top:u}),[c,u]),y=g.useCallback(x=>{switch(e.type){case"group":return g.createElement(VI,{ctrl:x,key:x.instanceId});case"filter":return g.createElement(GI,{ctrl:x,key:x.instanceId});default:return g.createElement(OI,{ctrl:x,key:x.instanceId})}},[]);return g.createElement("div",{ref:b,className:l,role:"row",style:S,tabIndex:n,"aria-rowindex":r},f.map(y))},WI=g.memo(zI),_I=({pinned:e})=>{const[t,s]=g.useState(!0),[o,i]=g.useState([]),{context:n}=g.useContext(dt),r=g.useRef(null),a=g.useRef(null),l=g.useRef(),c=e==="left",d=e==="right",u=!c&&!d,h=g.useCallback(C=>{if(r.current=C,!C||n.isDestroyed()){l.current=n.destroyBean(l.current);return}l.current=n.createBean(new xR(e));const v={setDisplayed:s,setCtrls:w=>i(w),setCenterWidth:w=>{a.current&&(a.current.style.width=w)},setViewportScrollLeft:w=>{r.current&&(r.current.scrollLeft=w)},setPinnedContainerWidth:w=>{r.current&&(r.current.style.width=w,r.current.style.minWidth=w,r.current.style.maxWidth=w)}};l.current.setComp(v,r.current)},[]),p=t?"":"ag-hidden",f=()=>o.map(C=>g.createElement(WI,{ctrl:C,key:C.instanceId}));return c?g.createElement("div",{ref:h,className:"ag-pinned-left-header "+p,"aria-hidden":!t,role:"rowgroup"},f()):d?g.createElement("div",{ref:h,className:"ag-pinned-right-header "+p,"aria-hidden":!t,role:"rowgroup"},f()):u?g.createElement("div",{ref:h,className:"ag-header-viewport "+p,role:"rowgroup",tabIndex:-1},g.createElement("div",{ref:a,className:"ag-header-container",role:"presentation"},f())):null},Ql=g.memo(_I),jI=()=>{const[e,t]=g.useState(()=>new Gt),[s,o]=g.useState(),{context:i}=g.useContext(dt),n=g.useRef(null),r=g.useRef(),a=g.useCallback(d=>{if(n.current=d,!d||i.isDestroyed()){r.current=i.destroyBean(r.current);return}r.current=i.createBean(new wR);const u={toggleCss:(h,p)=>t(f=>f.setClass(h,p)),setHeightAndMinHeight:h=>o(h)};r.current.setComp(u,d,d)},[]),l=g.useMemo(()=>"ag-header "+e.toString(),[e]),c=g.useMemo(()=>({height:s,minHeight:s}),[s]);return g.createElement("div",{ref:a,className:l,style:c,role:"presentation"},g.createElement(Ql,{pinned:"left"}),g.createElement(Ql,{pinned:null}),g.createElement(Ql,{pinned:"right"}))},UI=g.memo(jI),$I=(e,t)=>{g.useEffect(()=>{const s=t.current;if(s){const o=s.parentElement;if(o){const i=document.createComment(e);return o.insertBefore(i,s),()=>{i.remove()}}}},[e])},qs=$I,KI=class{constructor(e,t){this.cellEditorParams=e,this.refreshProps=t,this.instanceCreated=new Ee(s=>{this.resolveInstanceCreated=s}),this.onValueChange=s=>this.updateValue(s),this.value=e.value}getProps(){return{...this.cellEditorParams,initialValue:this.cellEditorParams.value,value:this.value,onValueChange:this.onValueChange}}getValue(){return this.value}refresh(e){this.cellEditorParams=e,this.refreshProps()}setMethods(e){ka(this.getOptionalMethods(),e,this)}getInstance(){return this.instanceCreated.then(()=>this.componentInstance)}setRef(e){this.componentInstance=e,this.resolveInstanceCreated?.(),this.resolveInstanceCreated=void 0}getOptionalMethods(){return["isCancelBeforeStart","isCancelAfterEnd","focusIn","focusOut","afterGuiAttached","getValidationErrors","getValidationElement"]}updateValue(e){this.value=e,this.refreshProps()}},qI=e=>{const t=g.useRef(e),s=g.useRef(),o=g.useRef(!1),i=g.useRef(!1),[,n]=g.useState(0);o.current&&(i.current=!0),g.useEffect(()=>(o.current||(s.current=t.current(),o.current=!0),n(r=>r+1),()=>{i.current&&s.current?.()}),[])},YI=e=>{const[t,s]=g.useState(),o=g.useContext(dt),{context:i,popupSvc:n,gos:r,editSvc:a}=o,{editDetails:l,cellCtrl:c,eParentCell:d}=e;return qI(()=>{const{compDetails:u}=l,h=r.get("stopEditingWhenCellsLoseFocus");let p,f;if(!i.isDestroyed()){f=i.createBean(a.createPopupEditorWrapper(u.params));const C=f.getGui();if(e.jsChildComp){const x=e.jsChildComp.getGui();x&&C.appendChild(x)}const{column:v,rowNode:w}=c,b={column:v,rowNode:w,type:"popupCellEditor",eventSource:d,ePopup:C,position:l.popupPosition,keepWithinBounds:!0},S=n?.positionPopupByComponent.bind(n,b),y=n?.addPopup({modal:h,eChild:C,closeOnEsc:!0,closedCallback:()=>{c.onPopupEditorClosed()},anchorToElement:d,positionCallback:S,ariaOwns:d});p=y?y.hideFunc:void 0,s(f),e.jsChildComp?.afterGuiAttached?.()}return()=>{p?.(),i.destroyBean(f)}}),g.useLayoutEffect(()=>()=>{c.isCellFocused()&&t?.getGui().contains(ze(o))&&d.focus({preventScroll:!0})},[t]),t&&e.wrappedContent?Sn.createPortal(e.wrappedContent,t.getGui()):null},Jh=g.memo(YI),ZI=(e,t,s)=>{const{compProxy:o}=e;s(o);const i=o.getProps(),n=fi(t);return g.createElement(Xd.Provider,{value:{setMethods:r=>o.setMethods(r)}},n?g.createElement(t,{...i}):g.createElement(t,{...i,ref:r=>o.setRef(r)}))},eg=(e,t,s)=>e.compProxy?ZI(e,t,s):g.createElement(t,{...e.compDetails.params,ref:s}),XI=(e,t,s,o,i)=>{const n=e.compDetails,r=n.componentClass,a=n.componentFromFramework&&!e.popup,l=n.componentFromFramework&&e.popup,c=!n.componentFromFramework&&e.popup;return a?eg(e,r,t):l?g.createElement(Jh,{editDetails:e,cellCtrl:o,eParentCell:s,wrappedContent:eg(e,r,t)}):c&&i?g.createElement(Jh,{editDetails:e,cellCtrl:o,eParentCell:s,jsChildComp:i}):null},QI=(e,t,s,o,i,n)=>{const{context:r}=g.useContext(dt),a=g.useCallback(()=>{const l=i.current;if(!l)return;const c=l.getGui();c&&c.parentElement&&c.remove(),r.destroyBean(l),i.current=void 0},[]);g.useEffect(()=>{const l=e!=null,c=e?.compDetails&&!e.compDetails.componentFromFramework,d=t&&s==null;if(!(l&&c&&!d)){a();return}const h=e.compDetails;if(i.current){const f=i.current,v=f.refresh!=null&&e.force==!1?f.refresh(h.params):!1;if(v===!0||v===void 0)return;a()}h.newAgStackInstance().then(f=>{if(!f)return;const C=f.getGui();if(!C)return;(t?s:n.current).appendChild(C),i.current=f})},[e,t,o]),g.useEffect(()=>a,[])},lC=QI,JI=({cellCtrl:e,parent:t})=>{const s=g.useRef(),o=g.useMemo(()=>{const{loadingComp:i}=e.getDeferLoadingCellRenderer();return i?{value:void 0,compDetails:i,force:!1}:void 0},[e]);if(lC(o,!1,void 0,1,s,t),o?.compDetails?.componentFromFramework){const i=o.compDetails.componentClass;return g.createElement(i,{...o.compDetails.params})}return g.createElement(g.Fragment,null)},ek=({cellCtrl:e,printLayout:t,editingCell:s})=>{const o=g.useContext(dt),{context:i}=o,{column:{colIdSanitised:n},instanceId:r}=e,a=g.useRef(),[l,c]=g.useState(()=>e.isCellRenderer()?void 0:{compDetails:void 0,value:e.getValueToDisplay(),force:!1}),[d,u]=g.useState(),[h,p]=g.useState(1),[f,C]=g.useState(),[v,w]=g.useState(!1),[b,S]=g.useState(!1),[y,x]=g.useState(!1),[R,F]=g.useState(),D=g.useMemo(()=>e.isForceWrapper(),[e]),M=g.useMemo(()=>e.getCellAriaRole(),[e]),k=g.useRef(null),E=g.useRef(null),P=g.useRef(null),N=g.useRef(),B=g.useRef(),O=g.useRef(),J=g.useRef([]),te=g.useRef(),L=g.useRef(),[le,V]=g.useState(0),Q=g.useCallback(de=>{L.current=de,V(ye=>ye+1)},[]),X=l!=null&&(v||y||b)&&(d==null||!!d.popup),$=D||X,q=g.useMemo(()=>e.getCellValueClass(),[e]),ee=g.useCallback(de=>{if(B.current=de,de){const ye=de.isCancelBeforeStart&&de.isCancelBeforeStart();setTimeout(()=>{ye?(e.stopEditing(!0),e.focusCell(!0)):(e.cellEditorAttached(),e.enableEditorTooltipFeature(de))})}},[e]),ge=g.useRef();ge.current||(ge.current=new Fn(()=>k.current)),lC(l,$,L.current,le,N,k);const H=g.useRef();g.useLayoutEffect(()=>{const de=H.current,ye=l;if(H.current=l,de==null||de.compDetails==null||ye==null||ye.compDetails==null)return;te.current?.refreshVisibility();const _=de.compDetails,we=ye.compDetails;if(_.componentClass!=we.componentClass||P.current?.refresh==null)return;P.current.refresh(we.params)!=!0&&p(xe=>xe+1)},[l]),g.useLayoutEffect(()=>{if(!(d&&!d.compDetails.componentFromFramework)||i.isDestroyed())return;const ye=d.compDetails,_=d.popup===!0,we=ye.newAgStackInstance();return we.then(pe=>{if(!pe)return;const xe=pe.getGui();ee(pe),_||((D?O:k).current?.appendChild(xe),pe.afterGuiAttached?.()),F(pe)}),()=>{we.then(pe=>{const xe=pe.getGui();e.disableEditorTooltipFeature(),i.destroyBean(pe),ee(void 0),F(void 0),xe?.remove()})}},[d]);const I=g.useCallback(de=>{if(O.current=de,!de||i.isDestroyed()||!e.isAlive()){const we=J.current;J.current=[];for(const pe of we)pe();return}let ye;const _=we=>{we&&(de.insertAdjacentElement("afterbegin",we.getGui()),J.current.push(()=>{Os(we.getGui()),i.destroyBean(we),te.current===ye&&(te.current=void 0)}))};v&&_(e.createSelectionCheckbox()),y&&_(e.createDndSource()),b&&(ye=e.createRowDragComp(),te.current=ye,ye&&(_(ye),ye.refreshVisibility()))},[e,i,y,b,v]),U=g.useCallback(()=>{const de=!e.isCellSpanning()||E.current,ye=k.current;if(!ye||!de||!e||!e.isAlive()||i.isDestroyed()){a.current=i.destroyBean(a.current);return}a.current=i.createBean(new gi);const _={toggleCss:(pe,xe)=>ge.current.toggleCss(pe,xe),setUserStyles:pe=>C(pe),getFocusableElement:()=>k.current,setIncludeSelection:pe=>w(pe),setIncludeRowDrag:pe=>S(pe),setIncludeDndSource:pe=>x(pe),getCellEditor:()=>B.current??null,getCellRenderer:()=>P.current??N.current,getParentOfValue:()=>L.current??O.current??k.current,setRenderDetails:(pe,xe,qe)=>{const Mt=()=>{c(je=>je?.compDetails!==pe||je?.value!==xe||je?.force!==qe?{value:xe,compDetails:pe,force:qe}:je)};if(pe?.params?.deferRender&&!e.rowNode.group){const{loadingComp:je,onReady:Wt}=e.getDeferLoadingCellRenderer();if(je){c({value:void 0,compDetails:je,force:!1}),Wt.then(()=>gI(Mt));return}}Mt()},setEditDetails:(pe,xe,qe,Mt)=>{if(pe){let je;pe.componentFromFramework&&(Mt?je=new KI(pe.params,()=>p(Wt=>Wt+1)):Qd()),u({compDetails:pe,popup:xe,popupPosition:qe,compProxy:je}),xe||c(void 0)}else e.hasBrowserFocus()&&_.getFocusableElement().focus({preventScroll:!0}),B.current=void 0,u(void 0)},refreshEditStyles:(pe,xe)=>{if(!k.current)return;const{current:qe}=ge;qe.toggleCss("ag-cell-value",!$),qe.toggleCss("ag-cell-inline-editing",!!pe&&!xe),qe.toggleCss("ag-cell-popup-editing",!!pe&&!!xe),qe.toggleCss("ag-cell-not-inline-editing",!pe||!!xe)}},we=O.current||void 0;e.setComp(_,ye,E.current??void 0,we,t,s,a.current)},[]),W=g.useCallback(de=>{k.current=de,U()},[]),ue=g.useCallback(de=>{E.current=de,U()},[]),ie=g.useMemo(()=>!!(l?.compDetails?.componentFromFramework&&fi(l.compDetails.componentClass)),[l]);g.useLayoutEffect(()=>{if(!k.current)return;const{current:de}=ge;de.toggleCss("ag-cell-value",!$),de.toggleCss("ag-cell-inline-editing",!!d&&!d.popup),de.toggleCss("ag-cell-popup-editing",!!d&&!!d.popup),de.toggleCss("ag-cell-not-inline-editing",!d||!!d.popup)});const Ce=()=>{const{compDetails:de,value:ye}=l;if(!de)return ye?.toString?.()??ye;if(de.componentFromFramework){const _=de.componentClass;return g.createElement(g.Suspense,{fallback:g.createElement(JI,{cellCtrl:e,parent:k})},ie?g.createElement(_,{...de.params,key:h}):g.createElement(_,{...de.params,key:h,ref:P}))}},ve=()=>{const de=()=>l==null?null:$?g.createElement("span",{role:"presentation",id:`cell-${r}`,className:q,ref:Q},Ce()):Ce(),ye=_=>XI(_,ee,k.current,e,R);return d!=null?d.popup?g.createElement(g.Fragment,null,de(),ye(d)):ye(d):de()},Pe=()=>g.createElement("div",{ref:W,style:f,role:M,"col-id":n},$?g.createElement("div",{className:"ag-cell-wrapper",role:"presentation",ref:I},ve()):ve());return e.isCellSpanning()?g.createElement("div",{ref:ue,className:"ag-spanned-cell-wrapper",role:"presentation"},Pe()):Pe()},tk=g.memo(ek),sk=({rowCtrl:e,containerType:t})=>{const{context:s,gos:o,editSvc:i}=g.useContext(dt),n=g.useContext(sC)==="default",r=g.useRef(),a=g.useRef(e.getDomOrder()),l=e.isFullWidth(),c=e.rowNode.displayed,[d,u]=g.useState(()=>c?e.rowNode.getRowIndexString():null),[h,p]=g.useState(()=>e.rowId),[f,C]=g.useState(()=>e.businessKey),[v,w]=g.useState(()=>e.rowStyles),b=g.useRef(null),[S,y]=g.useState(()=>null),[x,R]=g.useState(),[F,D]=g.useState(()=>c?e.getInitialRowTop(t):void 0),[M,k]=g.useState(()=>c?e.getInitialTransform(t):void 0),E=g.useRef(null),P=g.useRef(),N=g.useRef(),B=g.useRef(!1),[O,J]=g.useState(0);g.useEffect(()=>{if(B.current||!x||O>10)return;const W=E.current?.firstChild;W?(e.setupDetailRowAutoHeight(W),B.current=!0):J(ue=>ue+1)},[x,O]);const te=g.useRef();te.current||(te.current=new Fn(()=>E.current));const L=g.useRef(()=>{}),le=g.useCallback(W=>(L.current=W,()=>{L.current=()=>{}}),[]),V=pI(le,()=>b.current,[]),Q=n?V:S,X=g.useCallback(W=>{if(E.current=W,r.current=W?s.createBean(new gi):s.destroyBean(r.current),!W){e.unsetComp(t);return}if(!e.isAlive()||s.isDestroyed())return;const ue={setTop:D,setTransform:k,toggleCss:(ie,Ce)=>te.current.toggleCss(ie,Ce),setDomOrder:ie=>a.current=ie,setRowIndex:u,setRowId:p,setRowBusinessKey:C,setUserStyles:w,setCellCtrls:(ie,Ce)=>{const ve=b.current,Pe=sa(ve,ie,a.current);Pe!==ve&&(b.current=Pe,n?L.current():wn(Ce,()=>y(Pe)))},showFullWidth:ie=>{N.current=ie.params,R(ie)},getFullWidthCellRenderer:()=>P.current,getFullWidthCellRendererParams:()=>N.current,refreshFullWidth:ie=>{const Ce=ie();return N.current=Ce,H.current?(R(ve=>({...ve,params:Ce})),!0):!P.current||!P.current.refresh?!1:P.current.refresh(Ce)}};e.setComp(ue,W,t,r.current)},[]);g.useLayoutEffect(()=>Tn(x,s,E.current,P),[x]);const $=g.useMemo(()=>{const W={top:F,transform:M};return Object.assign(W,v),W},[F,M,v]),q=l&&x?.componentFromFramework,ee=!l&&Q!=null,ge=g.useMemo(()=>!!(x?.componentFromFramework&&fi(x.componentClass)),[x]),H=g.useRef(!1);g.useEffect(()=>{H.current=ge&&!!x&&!!o.get("reactiveCustomComponents")},[ge,x]);const I=()=>Q?.map(W=>g.createElement(tk,{cellCtrl:W,editingCell:i?.isEditing(W,{withOpenEditor:!0})??!1,printLayout:e.printLayout,key:W.instanceId})),U=()=>{const W=x.componentClass;return ge?g.createElement(W,{...x.params}):g.createElement(W,{...x.params,ref:P})};return g.createElement("div",{ref:X,role:"row",style:$,"row-index":d,"row-id":h,"row-business-key":f},ee?I():q?U():null)},tg=g.memo(sk),ok=({name:e})=>{const{context:t,gos:s}=g.useContext(dt),o=g.useMemo(()=>Dn(e),[e]),i=g.useRef(null),n=g.useRef(null),r=g.useRef(null),a=g.useRef([]),l=g.useRef([]),[c,d]=g.useState(()=>[]),u=!!s.get("enableCellSpan")&&!!o.getSpannedRowCtrls,h=g.useRef([]),p=g.useRef([]),[f,C]=g.useState(()=>[]),v=g.useRef(!1),w=g.useRef(),b=g.useMemo(()=>At("ag-viewport",Df(e)),[e]),S=g.useMemo(()=>At(Rr(e)),[e]),y=g.useMemo(()=>At("ag-spanning-container",_x(e)),[e]),x=o.type==="center"||u,R=x?i:n;qs(" AG Row Container "+e+" ",R);const F=g.useCallback(()=>{const O=!x||i.current!=null,J=n.current!=null,te=!u||r.current!=null;return O&&J&&te},[]),D=g.useCallback(()=>i.current==null&&n.current==null&&r.current==null,[]),M=g.useCallback(()=>{if(D()&&(w.current=t.destroyBean(w.current)),!t.isDestroyed()&&F()){const O=L=>{const le=sa(l.current,a.current,v.current);le!==l.current&&(l.current=le,wn(L,()=>d(le)))},J=L=>{const le=sa(p.current,h.current,v.current);le!==p.current&&(p.current=le,wn(L,()=>C(le)))},te={setHorizontalScroll:L=>{i.current&&(i.current.scrollLeft=L)},setViewportHeight:L=>{i.current&&(i.current.style.height=L)},setRowCtrls:({rowCtrls:L,useFlushSync:le})=>{const V=!!le&&a.current.length>0&&L.length>0;a.current=L,O(V)},setSpannedRowCtrls:(L,le)=>{const V=!!le&&h.current.length>0&&L.length>0;h.current=L,J(V)},setDomOrder:L=>{v.current!=L&&(v.current=L,O(!1))},setContainerWidth:L=>{n.current&&(n.current.style.width=L)},setOffsetTop:L=>{n.current&&(n.current.style.transform=`translateY(${L})`)}};w.current=t.createBean(new Jx(e)),w.current.setComp(te,n.current,r.current??void 0,i.current)}},[F,D]),k=g.useCallback(O=>{n.current=O,M()},[M]),E=g.useCallback(O=>{r.current=O,M()},[M]),P=g.useCallback(O=>{i.current=O,M()},[M]),N=()=>g.createElement("div",{className:S,ref:k,role:x?"presentation":"rowgroup"},c.map(O=>g.createElement(tg,{rowCtrl:O,containerType:o.type,key:O.instanceId})));if(!x)return N();const B=()=>g.createElement("div",{className:y,ref:E,role:"presentation"},f.map(O=>g.createElement(tg,{rowCtrl:O,containerType:o.type,key:O.instanceId})));return g.createElement("div",{className:b,ref:P,role:"rowgroup"},N(),u?B():null)},ik=g.memo(ok),nk=()=>{const e=g.useContext(dt),{context:t,overlays:s}=e,[o,i]=g.useState(""),[n,r]=g.useState(0),[a,l]=g.useState(0),[c,d]=g.useState("0px"),[u,h]=g.useState("0px"),[p,f]=g.useState("100%"),[C,v]=g.useState("0px"),[w,b]=g.useState("0px"),[S,y]=g.useState("100%"),[x,R]=g.useState(!0),[F,D]=g.useState(!0),[M,k]=g.useState(null),[E,P]=g.useState(""),[N,B]=g.useState(null),[O,J]=g.useState("ag-layout-normal"),te=g.useRef();te.current||(te.current=new Fn(()=>L.current));const L=g.useRef(null),le=g.useRef(null),V=g.useRef(null),Q=g.useRef(null),X=g.useRef(null),$=g.useRef(null),q=g.useRef(null),ee=g.useRef([]),ge=g.useRef([]);qs(" AG Grid Body ",L),qs(" AG Pinned Top ",le),qs(" AG Sticky Top ",V),qs(" AG Middle ",$),qs(" AG Pinned Bottom ",q);const H=g.useCallback(xe=>{if(L.current=xe,!xe||t.isDestroyed()){ee.current=t.destroyBeans(ee.current);for(const Le of ge.current)Le();ge.current=[];return}const qe=(Le,et)=>{Le.appendChild(et),ge.current.push(()=>et.remove())},Mt=Le=>{const et=t.createBean(new Le);return ee.current.push(et),et},je=(Le,et,mi)=>{qe(Le,document.createComment(mi)),qe(Le,Mt(et).getGui())};je(xe,rR," AG Fake Horizontal Scroll ");const Wt=s?.getOverlayWrapperCompClass();Wt&&je(xe,Wt," AG Overlay Wrapper "),X.current&&je(X.current,lR," AG Fake Vertical Scroll ");const Eo={setRowAnimationCssOnBodyViewport:i,setColumnCount:Le=>{L.current&&Ob(L.current,Le)},setRowCount:Le=>{L.current&&Ab(L.current,Le)},setTopHeight:r,setBottomHeight:l,setStickyTopHeight:d,setStickyTopTop:h,setStickyTopWidth:f,setTopInvisible:R,setBottomInvisible:D,setColumnMovingCss:(Le,et)=>te.current.toggleCss(Le,et),updateLayoutClasses:J,setAlwaysVerticalScrollClass:k,setPinnedTopBottomOverflowY:P,setCellSelectableCss:(Le,et)=>B(et?Le:null),setBodyViewportWidth:Le=>{$.current&&($.current.style.width=Le)},registerBodyViewportResizeListener:Le=>{if($.current){const et=bs(e,$.current,Le);ge.current.push(()=>et())}},setStickyBottomHeight:v,setStickyBottomBottom:b,setStickyBottomWidth:y,setGridRootRole:Le=>xe.setAttribute("role",Le)},Do=t.createBean(new oR);ee.current.push(Do),Do.setComp(Eo,xe,$.current,le.current,q.current,V.current,Q.current)},[]),I=g.useMemo(()=>At("ag-root","ag-unselectable",O),[O]),U=g.useMemo(()=>At("ag-body-viewport",o,O,M,N),[o,O,M,N]),W=g.useMemo(()=>At("ag-body",O),[O]),ue=g.useMemo(()=>At("ag-floating-top",x?"ag-invisible":null,N),[N,x]),ie=g.useMemo(()=>At("ag-sticky-top",N),[N]),Ce=g.useMemo(()=>At("ag-sticky-bottom",C==="0px"?"ag-invisible":null,N),[N,C]),ve=g.useMemo(()=>At("ag-floating-bottom",F?"ag-invisible":null,N),[N,F]),Pe=g.useMemo(()=>({height:n,minHeight:n,overflowY:E}),[n,E]),de=g.useMemo(()=>({height:c,top:u,width:p}),[c,u,p]),ye=g.useMemo(()=>({height:C,bottom:w,width:S}),[C,w,S]),_=g.useMemo(()=>({height:a,minHeight:a,overflowY:E}),[a,E]),we=xe=>g.createElement(ik,{name:xe,key:`${xe}-container`}),pe=({section:xe,children:qe,className:Mt,style:je})=>g.createElement("div",{ref:xe,className:Mt,role:"presentation",style:je},qe.map(we));return g.createElement("div",{ref:H,className:I},g.createElement(UI,null),pe({section:le,className:ue,style:Pe,children:["topLeft","topCenter","topRight","topFullWidth"]}),g.createElement("div",{className:W,ref:X,role:"presentation"},pe({section:$,className:U,children:["left","center","right","fullWidth"]})),pe({section:V,className:ie,style:de,children:["stickyTopLeft","stickyTopCenter","stickyTopRight","stickyTopFullWidth"]}),pe({section:Q,className:Ce,style:ye,children:["stickyBottomLeft","stickyBottomCenter","stickyBottomRight","stickyBottomFullWidth"]}),pe({section:q,className:ve,style:_,children:["bottomLeft","bottomCenter","bottomRight","bottomFullWidth"]}))},rk=g.memo(nk),ak=(e,t)=>{const{children:s,eFocusableElement:o,onTabKeyDown:i,gridCtrl:n,forceFocusOutWhenTabGuardsAreEmpty:r,isEmpty:a}=e,{context:l}=g.useContext(dt),c=g.useRef(null),d=g.useRef(null),u=g.useRef(),h=w=>{const b=w==null?void 0:parseInt(w,10).toString();for(const S of[c,d])b===void 0?S.current?.removeAttribute("tabindex"):S.current?.setAttribute("tabindex",b)};g.useImperativeHandle(t,()=>({forceFocusOutOfContainer(w){u.current?.forceFocusOutOfContainer(w)}}));const p=g.useCallback(()=>{const w=c.current,b=d.current;if(!w&&!b||l.isDestroyed()){u.current=l.destroyBean(u.current);return}if(w&&b){const S={setTabIndex:h};u.current=l.createBean(new Bf({comp:S,eTopGuard:w,eBottomGuard:b,eFocusableElement:o,onTabKeyDown:i,forceFocusOutWhenTabGuardsAreEmpty:r,focusInnerElement:y=>n.focusInnerElement(y),isEmpty:a}))}},[]),f=g.useCallback(w=>{c.current=w,p()},[p]),C=g.useCallback(w=>{d.current=w,p()},[p]),v=w=>{const b=w==="top"?Zo.TAB_GUARD_TOP:Zo.TAB_GUARD_BOTTOM;return g.createElement("div",{className:`${Zo.TAB_GUARD} ${b}`,role:"presentation",ref:w==="top"?f:C})};return g.createElement(g.Fragment,null,v("top"),s,v("bottom"))},lk=g.forwardRef(ak),ck=g.memo(lk),dk=({context:e})=>{const[t,s]=g.useState(""),[o,i]=g.useState(""),[n,r]=g.useState(null),[a,l]=g.useState(null),[c,d]=g.useState(!1),[u,h]=g.useState(),p=g.useRef(),f=g.useRef(null),C=g.useRef(),[v,w]=g.useState(null),b=g.useRef(()=>{}),S=g.useRef(),y=g.useRef([]),x=g.useCallback(()=>{},[]);qs(" AG Grid ",f);const R=g.useCallback(P=>{if(f.current=P,p.current=P?e.createBean(new n2):e.destroyBean(p.current),!P||e.isDestroyed())return;const N=p.current;b.current=N.focusInnerElement.bind(N);const B={destroyGridUi:()=>{},setRtlClass:s,forceFocusOutOfContainer:O=>{if(!O&&S.current?.isDisplayed()){S.current.forceFocusOutOfContainer(O);return}C.current?.forceFocusOutOfContainer(O)},updateLayoutClasses:i,getFocusableContainers:()=>{const O=[],J=f.current?.querySelector(".ag-root");J&&O.push({getGui:()=>J});for(const te of y.current)te.isDisplayed()&&O.push(te);return O},setCursor:r,setUserSelect:l};N.setComp(B,P,P),d(!0)},[]);g.useEffect(()=>{const P=p.current,N=f.current;if(!u||!P||!v||!N||e.isDestroyed())return;const B=[],{watermarkSelector:O,paginationSelector:J,sideBarSelector:te,statusBarSelector:L,gridHeaderDropZonesSelector:le}=P.getOptionalSelectors(),V=[];if(le){const X=e.createBean(new le.component),$=X.getGui();N.insertAdjacentElement("afterbegin",$),V.push($),B.push(X)}if(te){const X=e.createBean(new te.component),$=X.getGui(),q=v.querySelector(".ag-tab-guard-bottom");q&&(q.insertAdjacentElement("beforebegin",$),V.push($)),B.push(X),y.current.push(X)}const Q=X=>{const $=e.createBean(new X),q=$.getGui();return N.insertAdjacentElement("beforeend",q),V.push(q),B.push($),$};if(L&&Q(L.component),J){const X=Q(J.component);S.current=X,y.current.push(X)}return O&&Q(O.component),()=>{e.destroyBeans(B);for(const X of V)X.remove()}},[u,v,e]);const F=g.useMemo(()=>At("ag-root-wrapper",t,o),[t,o]),D=g.useMemo(()=>At("ag-root-wrapper-body","ag-focus-managed",o),[o]),M=g.useMemo(()=>({userSelect:a??"",WebkitUserSelect:a??"",cursor:n??""}),[a,n]),k=g.useCallback(P=>{C.current=P,h(P!==null)},[]),E=g.useCallback(()=>!p.current?.isFocusable(),[]);return g.createElement("div",{ref:R,className:F,style:M,role:"presentation"},g.createElement("div",{className:D,ref:w,role:"presentation"},c&&v&&!e.isDestroyed()&&g.createElement(dt.Provider,{value:e.getBeans()},g.createElement(ck,{ref:k,eFocusableElement:v,onTabKeyDown:x,gridCtrl:p.current,forceFocusOutWhenTabGuardsAreEmpty:!0,isEmpty:E},g.createElement(rk,null)))))},uk=g.memo(dk),hk=class extends A{postConstruct(){if(this.beans.colAutosize){const e=this.queueResizeOperationsForTick.bind(this);this.addManagedEventListeners({rowExpansionStateChanged:e,expandOrCollapseAll:e,cellValueChanged:e,rowNodeDataChanged:e,rowDataUpdated:e})}}queueResizeOperationsForTick(){const e=this.beans.colAutosize;e.shouldQueueResizeOperations=!0,setTimeout(()=>{e.processResizeOperations()},0)}areHeaderCellsRendered(){return this.beans.ctrlsSvc.getHeaderRowContainerCtrls().every(e=>e.getAllCtrls().every(t=>t.areCellsRendered()))}areCellsRendered(){return this.beans.rowRenderer.getAllRowCtrls().every(e=>e.isRowRendered()&&e.getAllCellCtrls().every(t=>!!t.eGui))}},cC={setGridApi:void 0,maxComponentCreationTimeMs:void 0,children:void 0},gk={gridOptions:void 0,modules:void 0,containerStyle:void 0,className:void 0,passGridApi:void 0,componentWrappingElement:void 0,...cC},dC=new Set(Object.keys(gk)),pk=new Set(Object.keys(cC)),uC=e=>{const t=g.useRef(),s=g.useRef(null),o=g.useRef(null),i=g.useRef([]),n=g.useRef([]),r=g.useRef(e),a=g.useRef(),l=g.useRef(),c=g.useRef(!1),[d,u]=g.useState(void 0),[,h]=g.useState(0),p=g.useCallback(w=>{if(s.current=w,!w){for(const E of i.current)E();i.current.length=0;return}const b=e.modules||[];o.current||(o.current=new AI(()=>h(E=>E+1),e.componentWrappingElement,e.maxComponentCreationTimeMs),i.current.push(()=>{o.current?.destroy(),o.current=null}));const S=N0(e.gridOptions,e,Object.keys(e).filter(E=>!dC.has(E))),y=()=>{if(c.current){const E=()=>a.current?.shouldQueueUpdates()?void 0:n.current.shift();let P=E();for(;P;)P(),P=E()}},x=new vk(y);a.current=x;const R=new hk,F={providedBeanInstances:{frameworkCompWrapper:new mk(o.current,S),renderStatus:R},modules:b,frameworkOverrides:x,setThemeOnGridDiv:!0},D=E=>{u(E),E.createBean(R),i.current.push(()=>{E.destroy()}),E.getBean("ctrlsSvc").whenReady({addDestroyFunc:P=>{i.current.push(P)}},()=>{if(E.isDestroyed())return;const P=t.current;P&&e.passGridApi?.(P)})},M=E=>{E.getBean("ctrlsSvc").whenReady({addDestroyFunc:P=>{i.current.push(P)}},()=>{for(const P of n.current)P();n.current.length=0,c.current=!0})},k=new kP;S.gridId??(S.gridId=l.current),t.current=k.create(w,S,D,M,F),i.current.push(()=>{t.current=void 0}),t.current&&(l.current=t.current.getGridId())},[]),f=g.useMemo(()=>({height:"100%",...e.containerStyle||{}}),[e.containerStyle]),C=g.useCallback(w=>{c.current&&!a.current?.shouldQueueUpdates()?w():n.current.push(w)},[]);g.useEffect(()=>{const w=fk(r.current,e);r.current=e,C(()=>{t.current&&H0(w,t.current)})},[e]);const v=!g.useSyncExternalStore||wr(e,"renderingMode")==="legacy"?"legacy":"default";return g.createElement("div",{style:f,className:e.className,ref:p},g.createElement(sC.Provider,{value:v},d&&!d.isDestroyed()?g.createElement(uk,{key:d.instanceId,context:d}):null,o.current?.getPortals()??null))};function fk(e,t){const s={};for(const o of Object.keys(t)){if(dC.has(o)){pk.has(o)&&G(274,{prop:o});continue}const i=t[o];e[o]!==i&&(s[o]=i)}return s}var mk=class extends HP{constructor(e,t){super(),this.parent=e,this.gridOptions=t}createWrapper(e,t){const s=this.gridOptions;if(wr(s,"reactiveCustomComponents")){const r=(a=>{switch(a){case"filter":return wr(s,"enableFilterHandlers")?yI:SI;case"floatingFilterComponent":return wr(s,"enableFilterHandlers")?FI:RI;case"dateComponent":return wI;case"dragAndDropImageComponent":return bI;case"loadingOverlayComponent":return DI;case"noRowsOverlayComponent":return MI;case"statusPanel":return TI;case"toolPanel":return II;case"menuItem":return PI;case"cellRenderer":return vI;case"innerHeaderComponent":return EI}})(t.name);if(r)return new r(e,this.parent,t)}else switch(t.name){case"filter":case"floatingFilterComponent":case"dateComponent":case"dragAndDropImageComponent":case"loadingOverlayComponent":case"noRowsOverlayComponent":case"statusPanel":case"toolPanel":case"menuItem":case"cellRenderer":Qd();break}const i=!t.cellRenderer&&t.name!=="toolPanel";return new rC(e,this.parent,t,i)}},Ck=g.forwardRef((e,t)=>{const s=g.useContext(dt),{registry:o,context:i,gos:n,rowModel:r}=s,[a,l]=g.useState(()=>new Gt),[c,d]=g.useState(()=>new Gt),[u,h]=g.useState(),[p,f]=g.useState(),C=g.useRef(),v=g.useRef(null),w=g.useRef(),b=g.useMemo(()=>g0(e.api.getGridId(),u?.rowModelType??"clientSide"),[e]),S=g.useMemo(()=>a.toString()+" ag-details-row",[a]),y=g.useMemo(()=>c.toString()+" ag-details-grid",[c]);t&&g.useImperativeHandle(t,()=>({refresh(){return C.current?.refresh()??!1}})),e.template&&G(230);const x=g.useCallback(F=>{if(v.current=F,!F||i.isDestroyed()){C.current=i.destroyBean(C.current),w.current?.();return}const D={toggleCss:(k,E)=>l(P=>P.setClass(k,E)),toggleDetailGridCss:(k,E)=>d(P=>P.setClass(k,E)),setDetailGrid:k=>h(k),setRowData:k=>f(k),getGui:()=>v.current},M=o.createDynamicBean("detailCellRendererCtrl",!0);if(M&&(i.createBean(M),M.init(D,e),C.current=M,n.get("detailRowAutoHeight"))){const k=()=>{if(v.current==null)return;const E=v.current.clientHeight;E!=null&&E>0&&setTimeout(()=>{e.node.setRowHeight(E),(_e(n)||So(n))&&r.onRowHeightChanged()},0)};w.current=bs(s,F,k),k()}},[]),R=g.useCallback(F=>{C.current?.registerDetailWithMaster(F)},[]);return g.createElement("div",{className:S,ref:x},u&&g.createElement(uC,{className:y,...u,modules:b,rowData:p,passGridApi:R}))}),vk=class extends Vf{constructor(e){super("react"),this.processQueuedUpdates=e,this.queueUpdates=!1,this.renderingEngine="react",this.frameworkComponents={agGroupCellRenderer:Xh,agGroupRowRenderer:Xh,agDetailCellRenderer:Ck},this.wrapIncoming=(t,s)=>s==="ensureVisible"?hI(t):t()}frameworkComponent(e){return this.frameworkComponents[e]}isFrameworkComponent(e){if(!e)return!1;const t=e.prototype;return!(t&&"getGui"in t)}getLockOnRefresh(){this.queueUpdates=!0}releaseLockOnRefresh(){this.queueUpdates=!1,this.processQueuedUpdates()}shouldQueueUpdates(){return this.queueUpdates}runWhenReadyAsync(){return uI()}},wk=class extends g.Component{constructor(){super(...arguments),this.apiListeners=[],this.setGridApi=e=>{this.api=e;for(const t of this.apiListeners)t(e)}}registerApiListener(e){this.apiListeners.push(e)}componentWillUnmount(){this.apiListeners.length=0}render(){return g.createElement(uC,{...this.props,passGridApi:this.setGridApi})}},hC=(e=>(e.Dropdown="dropdown",e.Menu="menu",e))(hC||{}),xt=(e=>(e.Click="click",e.Hover="hover",e.ContextMenu="contextMenu",e))(xt||{}),oa=(e=>(e.Item="item",e.Divider="divider",e.PlainText="plainText",e))(oa||{});const bk=Z("flex items-center gap-2 align-middle","h-auto px-0 bg-transparent border-0"),Sk=Z("z-[53] overflow-auto rounded bg-layer-0 text-primary shadow focus-visible:outline-none","w-max"),yk=Z("flex w-full cursor-pointer items-center gap-3","focus-visible:border-none focus-visible:outline-none","hover:bg-accent-primary-alpha px-3","dial-small h-[34px] rounded text-primary"),xk="opacity-75 !cursor-not-allowed",Rk="text-error",Fk="my-1 border-t border-hover border-secondary",Gi=4,Jd=({ariaLabel:e,className:t,size:s=24,onClose:o,...i})=>m.jsx(De,{"aria-label":e,className:ce("text-secondary hover:enabled:text-accent-primary",t),onClick:o,iconBefore:m.jsx(z.IconX,{size:s}),...i}),bt=({children:e,menu:t,renderOverlay:s,trigger:o=[xt.Click],placement:i,disabled:n=!1,open:r,defaultOpen:a=!1,onOpenChange:l,closable:c=!1,onClose:d,className:u,listClassName:h,outsidePressIgnoreRef:p,outsideClosable:f=!0,allowedPlacements:C,anchorToMouse:v=!1,matchReferenceWidth:w=!0,maxDropdownHeight:b})=>{const[S,y]=g.useState(a),x=r!==void 0,R=x?!!r:S,F=g.useRef(null),D=g.useCallback(H=>{x||y(H),l?.(H)},[x,l]),M=g.useId(),k=i===void 0,E=H=>"clientWidth"in H?H.clientWidth:H.getBoundingClientRect?.()?.width??0,{refs:P,floatingStyles:N,context:B}=Re.useFloating({placement:i,open:R,onOpenChange:D,whileElementsMounted:Re.autoUpdate,middleware:[Re.offset({mainAxis:Gi,crossAxis:0}),k?Re.autoPlacement({alignment:"start",crossAxis:!0,padding:Gi,allowedPlacements:C}):Re.flip({padding:Gi}),Re.shift({padding:Gi}),Re.size({padding:Gi,apply({availableWidth:H,availableHeight:I,elements:U}){const W=U.floating,ue=E(U.reference);W.style.setProperty("--fui-available-height",`${Math.floor(I)}px`),W.style.setProperty("--reference-width",w?`${Math.round(ue)}px`:"0px"),w?W.style.minWidth=`${Math.round(ue)}px`:W.style.removeProperty("min-width"),W.style.maxWidth=`${Math.floor(H)}px`;const ie=Math.floor(I);W.style.maxHeight=`${b?Math.min(ie,b):ie}px`}})]}),O=Re.useClick(B,{enabled:o.includes(xt.Click)&&!n}),J=Re.useHover(B,{enabled:o.includes(xt.Hover)&&!n,move:!1,restMs:40,delay:{open:80,close:80}}),te=Re.useDismiss(B,{bubbles:!0,referencePress:!1,outsidePress:H=>{if(!f)return!1;const I=H.target;return!(p?.current&&I instanceof Node&&p.current.contains(I))}}),L=Re.useRole(B,{role:"menu"}),{getReferenceProps:le,getFloatingProps:V}=Re.useInteractions([O,J,te,L]),Q=g.useCallback((H,I)=>{P.setPositionReference({getBoundingClientRect:()=>({width:0,height:0,x:H,y:I,top:I,left:H,right:H,bottom:I})})},[P]),X=g.useCallback(H=>{!o.includes(xt.ContextMenu)||n||(H.preventDefault(),v&&(Q(H.clientX,H.clientY),F.current=document.elementFromPoint(H.clientX,H.clientY)),D(!0))},[v,n,D,Q,o]),$=g.useCallback(H=>{!v||n||(o.includes(xt.ContextMenu)&&R&&D(!1),Q(H.clientX,H.clientY),F.current=document.elementFromPoint(H.clientX,H.clientY))},[v,n,Q,R,o,D]);g.useEffect(()=>{n&&R&&D(!1)},[n,R,D]);const q=g.useCallback(H=>I=>{H.disabled||(H.onClick?.({key:H.key,domEvent:I}),t?.onClick?.({key:H.key,domEvent:I}),D(!1))},[t,D]),ee=g.useMemo(()=>s?s():t?m.jsxs(m.Fragment,{children:[t.header&&m.jsx(m.Fragment,{children:typeof t.header=="function"?t.header():t.header}),m.jsx("div",{role:"none",className:"py-1","aria-label":"dropdown",children:t.items.map(H=>H.type===oa.Divider?m.jsx("div",{role:"separator",className:Fk},H.key):H.type===oa.PlainText?m.jsx("div",{className:ce("px-3 py-2 text-secondary dial-caption",H.className),children:H.label},H.key):m.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!H.disabled,className:Z(yk,H.disabled&&xk,H.danger&&Rk,H.className),disabled:H.disabled,onClick:q(H),children:[H.icon&&m.jsx("span",{className:Z(H.danger&&"text-error",H.disabled&&"text-secondary"),children:m.jsx(Oe,{icon:H.icon})}),m.jsx("span",{className:Z("flex-1 truncate text-left",H.danger&&"text-error",H.disabled&&"text-secondary"),"aria-labelledby":"item-text",children:H.label})]},H.key))}),t.footer&&m.jsx(m.Fragment,{children:typeof t.footer=="function"?t.footer():t.footer})]}):null,[q,t,s]),ge=le({onContextMenu:X,onMouseDown:$});return g.useEffect(()=>{if(!R)return;const H=P.reference.current;let I=null;if(H instanceof Element?I=H:F.current instanceof Element&&(I=F.current),!I)return;const U=new IntersectionObserver(([W])=>{W.isIntersecting||D(!1)},{root:null,threshold:0});return U.observe(I),()=>U.disconnect()},[R,P.reference,D]),m.jsxs(m.Fragment,{children:[m.jsx("span",{ref:P.setReference,className:Z(bk,n&&"!cursor-not-allowed opacity-75",u),"aria-haspopup":"menu","aria-expanded":R,"aria-controls":M,...ge,children:e}),R&&m.jsx(Re.FloatingPortal,{children:m.jsx(Re.FloatingFocusManager,{context:B,modal:!1,initialFocus:-1,returnFocus:!0,children:m.jsxs("div",{id:M,ref:P.setFloating,style:N,className:Z(Sk,!w&&"w-max",h),...V(),children:[c&&m.jsx("div",{className:"flex items-center justify-between px-2 pt-2",children:m.jsx(Jd,{ariaLabel:"Close dropdown",onClose:H=>{d?.(H),D(!1)}})}),ee]})})})]})},Ek="h-full",Jl={accentColor:"var(--controls-bg-accent, #5C8DEA)",backgroundColor:"var(--bg-layer-2, #141A23)",oddRowBackgroundColor:"var(--bg-layer-3, #222932)",borderColor:"var(--bg-layer-4, #333942)",rowBorder:"1px solid var(--stroke-tertiary, #090D13)",borderRadius:3,browserColorScheme:"dark",chromeBackgroundColor:"var(--bg-layer-1, #090D13)",foregroundColor:"var(--text-primary, #F3F4F6)",headerFontSize:14,headerFontWeight:600,headerTextColor:"var(--text-secondary, #7F8792)",spacing:4,wrapperBorderRadius:3,fontSize:14,fontFamily:{googleFont:"var(--theme-font, var(--font-inter))"}},ec=40,Dk=(e,t,s,o,i)=>{const n=typeof e=="string"?e.toLowerCase():e,r=typeof t=="string"?t.toLowerCase():t;return n===r?0:n?r?n>r?1:-1:i?1:-1:i?-1:1},Pk=({selectedRowIds:e,selectedRows:t,onSelectionChange:s,onSelectionChangeWithMap:o,rowData:i=[],getRowId:n,disabledRowIds:r})=>{const[a,l]=g.useState(new Map),c=t??a,d=g.useMemo(()=>new Set(c.keys()),[c]),u=g.useCallback(w=>r?.has(n(w))??!1,[r,n]),h=g.useMemo(()=>i.filter(w=>!u(w)),[i,u]),p=e!==void 0||t!==void 0;g.useEffect(()=>{if(e!==void 0&&!t){const w=new Map;i.forEach(S=>{const y=n(S);e.has(y)&&!r?.has(y)&&w.set(y,S)}),(w.size!==a.size||Array.from(w.keys()).some(S=>!a.has(S)))&&l(w)}},[e,t,i,n,r,a]);const f=g.useCallback((w,b)=>{const S=n(w);if(r?.has(S))return;const y=new Map(c);b?y.set(S,w):y.delete(S),p||l(y),o?.(y),s&&s(new Set(y.keys()),Array.from(y.values()))},[c,n,r,p,s,o]),C=g.useMemo(()=>{if(!h.length)return"unchecked";const w=h.map(n),b=w.filter(S=>d.has(S)).length;return b===0?"unchecked":b===w.length?"checked":"indeterminate"},[h,d,n]),v=g.useCallback(w=>{const b=new Map;if(w&&h.forEach(S=>{const y=n(S);b.set(y,S)}),p||l(b),o&&o(b),s){const S=new Set(b.keys()),y=Array.from(b.values());s(S,y)}},[h,n,p,s,o]);return{currentSelectedIds:d,currentSelectedRows:c,handleSelectionToggle:f,headerCheckboxState:C,handleHeaderCheckboxChange:v}};m0.registerModules([dI]);const eu=({columnDefs:e,rowData:t,additionalGridOptions:s,getContextMenuItems:o,className:i,ariaLabel:n="Data grid",withSelectionColumn:r=!0,wrapCustomCellRenderers:a=!0,disabledRowIds:l,selectedRowIds:c,selectedRows:d,selectionOnHover:u=!0,onSelectionChange:h,onSelectionChangeWithMap:p,getRowId:f=F=>String(F.id||JSON.stringify(F)),alternateOddRowColors:C=!1,filterPlaceholder:v="Enter value",emptyStateIcon:w,emptyStateTitle:b="No results found",emptyStateDescription:S="Sorry, we couldn't find any results for your search.",loading:y=!1,wrapperBorder:x=!0,withoutHeaderBorders:R=!1})=>{const[F,D]=g.useState(ec),[M,k]=g.useState(),E=g.useId(),{currentSelectedIds:P,handleSelectionToggle:N,headerCheckboxState:B,handleHeaderCheckboxChange:O}=Pk({selectedRowIds:c,selectedRows:d,onSelectionChange:h,onSelectionChangeWithMap:p,rowData:t,getRowId:f,disabledRowIds:l}),J=g.useMemo(()=>({...Jl,oddRowBackgroundColor:C?Jl.oddRowBackgroundColor:Jl.backgroundColor,wrapperBorder:x}),[C,x]),te=g.useCallback(I=>{I.api.sizeColumnsToFit(),D(ec)},[]),L=g.useCallback(I=>{if(!I.data)return"";const U=f(I.data);return Z({"ag-row-selected":P.has(U),"opacity-50":l?.has(U)})},[P,l,f]),le=g.useCallback(()=>{const I=B==="checked",U=B==="indeterminate",W="header-select-all",ue=t?.some(ie=>!l?.has(f(ie)))??!1;return m.jsx("div",{className:"flex items-center justify-center h-full header-checkbox-container",children:m.jsx(sn,{id:W,ariaLabel:"Select all rows",checked:I,disabled:!ue,"aria-disabled":!ue,indeterminate:U,className:Z(`dial-header-select ${B}`,!u&&"dial-header-select-visible"),onChange:O})})},[B,t,u,O,l,f]),V=g.useCallback(I=>{if(I.data){const U=f(I.data),W=l?.has(U),ue=I.value==null?"":String(I.value),ie=o?.(I.data)??[];return m.jsx(bt,{trigger:[xt.ContextMenu],menu:{items:ie},anchorToMouse:!0,matchReferenceWidth:!0,className:"w-full",disabled:W,children:m.jsx("span",{className:"block min-w-0 h-full max-w-full",children:m.jsx(ct,{text:ue,className:"max-w-full h-full"})})})}},[o,l,f]),Q=g.useCallback(I=>{if(!I.data)return null;const U=f(I.data),W=P.has(U),ue=l?.has(U),ie=`row-select-${U}`;return m.jsx("div",{className:"flex items-center justify-center size-full",children:m.jsx(sn,{id:ie,ariaLabel:"Select row",checked:W,disabled:ue,"aria-disabled":ue,className:Z("dial-row-select",!u&&"dial-row-select-visible",ue&&"opacity-50 cursor-not-allowed"),onChange:Ce=>{ue||!I.data||N(I.data,!!Ce)}},`${U}-${W}`)})},[P,l,f,N,u]),X=g.useCallback(I=>{const U=typeof a=="function"?a(I):!!a;if(!I.cellRenderer)return{...I,cellRenderer:V};if(!U)return I;const W=I.cellRenderer;return{...I,cellRenderer:ie=>{const Ce=ie.data?o?.(ie.data)??[]:[];let ve=null;if(typeof W=="function"){const ye=W;ve=m.jsx(ye,{...ie})}else ve=V(ie);const Pe=ie.data?f(ie.data):null,de=Pe?l?.has(Pe):!1;return m.jsx(bt,{trigger:[xt.ContextMenu],menu:{items:Ce},anchorToMouse:!0,matchReferenceWidth:!0,className:"w-full h-full",disabled:de,children:m.jsx("span",{className:"block min-w-0 max-w-full flex-1",children:ve})})}}},[l,o,f,V,a]),$=g.useMemo(()=>({colId:"__select",headerName:"",width:44,minWidth:44,suppressSizeToFit:!0,lockPosition:!0,sortable:!1,resizable:!1,filter:!1,floatingFilter:!1,cellRenderer:Q,headerComponent:le}),[Q,le]),q=g.useMemo(()=>{const I=(e??[]).map(X);return r?[$,...I]:I},[e,$,r,X]),ee=g.useMemo(()=>({minWidth:150,resizable:!0,sortable:!0,floatingFilter:!0,filter:"agTextColumnFilter",filterParams:{filterPlaceholder:v,buttons:["reset"]},comparator:Dk.bind(void 0)}),[v]),ge=I=>{const U=q.map(W=>({...W,sort:void 0}));I.api.updateGridOptions({columnDefs:U,rowData:t}),I.api.sizeColumnsToFit(),k(I.api),s?.onGridReady?.(I)};g.useEffect(()=>{M&&M.redrawRows()},[M,P]);const H=g.useCallback(()=>m.jsx(ua,{title:b,description:S,containerClassName:"gap-3",titleClassName:"mt-2 !text-lg",icon:w||m.jsx(z.IconZoomCancel,{size:100,stroke:.5,className:"text-secondary"})}),[b,S,w]);return m.jsx("div",{className:Z(Ek,i,r&&"with-selection-column",R&&"dial-without-header-borders"),"aria-label":n,role:"region","aria-busy":y,children:m.jsx("div",{className:"ag-theme-balham-dark h-full overflow-x-auto",role:"table","aria-describedby":E,children:m.jsx(wk,{rowModelType:"clientSide",headerHeight:ec,rowHeight:F,cellSelection:!1,getRowClass:L,theme:cD.withPart(WE).withParams({...J}),autoSizeStrategy:{type:"fitGridWidth"},columnDefs:q,defaultColDef:ee,onGridSizeChanged:te,onGridReady:ge,loading:y,suppressCellFocus:!0,suppressDragLeaveHidesColumns:!0,noRowsOverlayComponent:H,rowData:t,...s})})})};var ia=(e=>(e.Horizontal="horizontal",e.Vertical="vertical",e))(ia||{}),na=(e=>(e.Mobile="mobile",e.Tablet="tablet",e))(na||{});const ur=({tab:e,active:t,invalid:s,className:o,horizontal:i,onClick:n})=>{const r=ce("rounded h-[38px] items-center flex flex-row border-transparent cursor-pointer dial-small leading-4 hover:text-accent-primary",{"border-b-2 px-4":i,"border-l-2 px-3":!i}),a=ce(r,{"bg-layer-4":i,"bg-layer-1 text-secondary pointer-events-none":e.disabled,"bg-accent-primary-alpha text-primary":t&&!e.disabled,"text-primary":!t&&!e.disabled,"border-b-accent-primary":t&&i&&!e.disabled,"border-l-accent-primary":t&&!i&&!e.disabled},o);return m.jsxs("button",{role:"tab",className:a,onClick:()=>n(e.id),disabled:e.disabled,children:[m.jsx(ct,{text:e.label,contentClassName:"max-w-[200px]",className:"max-w-[200px]"}),(s||e.invalid)&&m.jsx("div",{className:"text-error pl-1",children:m.jsx(z.IconExclamationCircle,{...ae})})]})},sg=12;var Qs=(e=>(e.Undefined="undefined",e.Mobile="mobile",e.Tablet="tablet",e.Desktop="desktop",e))(Qs||{});const og=()=>typeof window<"u"&&window.innerWidth<640,ig=()=>{if(typeof window>"u")return Qs.Undefined;const e=window.innerWidth;return e>=1024?Qs.Desktop:e<640?Qs.Mobile:Qs.Tablet},Mk=()=>{const[e,t]=g.useState(ig());return g.useEffect(()=>{const s=()=>t(ig());return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),e},gC=({tabs:e,activeTab:t,onClick:s,orientation:o=ia.Horizontal,screenThreshold:i=na.Tablet,smallScreenContainerClassName:n,smallScreenDropdownItemClassName:r})=>{const[a,l]=g.useState(!1),[c,d]=g.useState(!1),[u,h]=g.useState(!1),p=Mk(),f=p===Qs.Mobile||i===na.Tablet&&p===Qs.Tablet,C=o===ia.Horizontal,v=g.useRef(null),w=g.useRef(null),b=g.useRef(null),S=e.find(R=>R.id===t),y=g.useMemo(()=>Z("flex gap-2",C?"flex-row flex-nowrap overflow-x-auto":"flex-col flex-wrap w-full"),[C]),x=g.useCallback(()=>{const R=w.current;R&&h(R.scrollWidth>R.clientWidth)},[]);return g.useEffect(()=>{x();const R=new ResizeObserver(()=>x()),F=w.current;return F&&R.observe(F),()=>R.disconnect()},[e,x]),g.useEffect(()=>{const R=b.current,F=w.current;if(!R||!F)return;const D=R.offsetLeft,M=D+R.offsetWidth,k=F.scrollLeft,E=k+F.clientWidth;D<k?F.scrollTo({left:D-sg,behavior:"smooth"}):M>E&&F.scrollTo({left:M-F.clientWidth+sg,behavior:"smooth"})},[t]),f?m.jsx("div",{role:"tablist",className:ce("h-11 flex items-center bg-layer-3 px-4",n),children:m.jsx(bt,{trigger:[xt.Click],open:a,onOpenChange:l,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],renderOverlay:()=>e.map(R=>m.jsx(ur,{tab:R,active:R.id===t,onClick:F=>{s(F),l(!1)},className:ce("w-full rounded-none h-11 items-center px-6",r)},R.id)),children:m.jsxs("div",{className:"flex gap-2 items-center h-11 cursor-pointer",children:[m.jsx(ur,{tab:S,active:!0,onClick:s,className:"rounded-none bg-transparent border-l-0 border-b-0 h-full items-center px-0"},t),m.jsx(Oe,{icon:m.jsx(z.IconChevronDown,{size:16}),className:Z("text-primary transition-transform",a&&"rotate-180")})]})})}):m.jsxs("div",{ref:v,className:"flex w-full items-start",children:[m.jsx("div",{ref:w,role:"tablist",className:y,children:e.map(R=>m.jsx("div",{ref:t===R.id?b:void 0,className:"w-full",children:m.jsx(ur,{tab:R,active:t===R.id,onClick:s,horizontal:C,className:"w-full"})},R.id))}),u&&m.jsx("div",{className:"flex items-center ml-2",children:m.jsx(bt,{trigger:[xt.Click],open:c,onOpenChange:d,placement:"bottom-end",renderOverlay:()=>e.map(R=>m.jsx(ur,{tab:R,active:R.id===t,onClick:F=>{s(F),d(!1)},className:"w-full rounded-none h-[32px] items-center px-3 py-2"},R.id)),children:m.jsx(De,{iconBefore:m.jsx(z.IconDotsVertical,{size:18}),className:Z("w-8 h-8 flex items-center justify-center rounded border",c?"bg-layer-4 border-transparent":"border-primary")})})})]})},Tk="w-full overflow-hidden",Ik="flex flex-nowrap items-center gap-2 min-w-0 px-0 py-0 whitespace-nowrap",pC="flex items-center gap-2 min-w-0 shrink-0 dial-small",kk="max-w-[20%] basis-[20%] flex-none",Ak="flex-1 min-w-0",ng="inline-flex items-center gap-1 min-w-0 transition-colors",Lk="text-secondary hover:text-accent-primary",Ok="text-primary cursor-default",fC="flex-none inline-flex items-center leading-none text-secondary",Nk="items-center gap-1 min-w-0 transition-colors text-secondary hover:text-accent-primary",mC=m.jsx(z.IconChevronRight,{size:16,"aria-hidden":"true"}),_i=({label:e,href:t,onClick:s,disabled:o,isLast:i,separator:n=mC,className:r,iconBefore:a,labelClassName:l,...c})=>{const d=ce(pC,i?Ak:kk,r),u=(!!t||!!s)&&!i&&!o,h=u?ce(ng,Lk):ce(ng,Ok,o?"pointer-events-none opacity-75":""),p=typeof e=="string"?m.jsx(ct,{className:l,text:e,id:"breadcrumb-item-content"}):m.jsx("span",{className:ce("flex-1 min-w-0 max-w-full truncate",l),"aria-label":"breadcrumb-item-content",children:e});return m.jsxs("li",{...c,className:d,"aria-label":c["aria-label"]||"breadcrumb-item",children:[u?m.jsxs("a",{href:t,onClick:s,className:h,children:[a,p]}):m.jsxs("span",{className:h,"aria-current":i?"page":void 0,"aria-disabled":o?"true":void 0,children:[a,p]}),!i&&m.jsx("span",{className:fC,"aria-label":"separator",children:n})]})},CC=({pathItems:e,separator:t=mC,ariaLabel:s="Breadcrumb",className:o,children:i,labelClassName:n})=>{const r=g.useMemo(()=>e?.length?e:g.Children.toArray(i).filter(g.isValidElement).map(c=>{const d=c.props,{labelClassName:u,isLast:h,separator:p,...f}=d;return f}),[e,i]),a=g.useCallback(c=>{const d=parseInt(c.key,10),u=r[d];u.onClick?u.onClick(c.domEvent):u.href&&(window.location.href=u.href)},[r]),l=g.useMemo(()=>{if(r.length===0)return null;if(r.length<=3)return r.map((f,C)=>g.createElement(_i,{...f,key:`item-${C}`,isLast:C===r.length-1,separator:t,labelClassName:n}));const c=r.at(0),d=r.slice(1,-2),u=r.at(-2),h=r.at(-1);if(!c||!u||!h)return null;const p=d.map((f,C)=>({key:String(C+1),label:typeof f.label=="string"?f.label:`Item ${C+1}`,disabled:f.disabled}));return m.jsxs(m.Fragment,{children:[g.createElement(_i,{...c,key:"item-0",separator:t,labelClassName:n}),m.jsxs("li",{className:ce(pC),children:[m.jsx(bt,{menu:{items:p,onClick:a},placement:"bottom-start",matchReferenceWidth:!1,children:m.jsx("button",{type:"button","aria-label":"More breadcrumbs",className:Nk,children:m.jsx(z.IconDots,{size:16})})}),m.jsx("span",{className:fC,children:t})]}),g.createElement(_i,{...u,key:`item-${r.length-2}`,separator:t,labelClassName:n}),g.createElement(_i,{...h,key:`item-${r.length-1}`,isLast:!0,separator:t,labelClassName:n})]})},[r,t,n,a]);return m.jsx("nav",{"aria-label":s,className:ce(Tk,o),children:m.jsx("ol",{className:Ik,children:l})})},vC=({iconClassName:e,...t})=>m.jsx(De,{...t,iconBefore:m.jsx(z.IconTrashX,{...ae,className:e||""})}),wC=({value:e,textareaId:t,placeholder:s,className:o="",containerClassName:i="",disabled:n,invalid:r,readonly:a,disableTooltip:l,onChange:c})=>m.jsx(vs,{tooltip:l?null:e,triggerClassName:ce("flex",i),children:m.jsx("textarea",{id:t,placeholder:s,value:e||"",disabled:n,className:Z("dial-textarea dial-input px-3 py-2",r?"dial-input-error":"",n&&"dial-input-disable",a&&"dial-input-readonly",o),onChange:d=>!a&&c?.(d.currentTarget.value)})}),Hk=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],Gk=(e,t,s,o)=>{if((t==="number"||s!==void 0||o!==void 0)&&!Hk.includes(e.key)&&!(e.ctrlKey||e.metaKey)&&!(e.key==="-"&&(e.currentTarget.selectionStart??0)===0&&!e.currentTarget.value.includes("-"))&&!(e.key==="."&&t==="number"&&!e.currentTarget.value.includes("."))){if(!/^[0-9]$/.test(e.key)){e.preventDefault();return}if(s!==void 0||o!==void 0){const n=e.currentTarget.value,r=e.currentTarget.selectionStart||0,a=n.slice(0,r)+e.key+n.slice(r),l=parseFloat(a);if(!isNaN(l)){if(s!==void 0&&l<s){e.preventDefault();return}if(o!==void 0&&l>o){e.preventDefault();return}}}}},Co=({iconBefore:e,iconAfter:t,hideBorder:s,value:o,elementId:i,placeholder:n="",className:r="",containerClassName:a,tooltipTriggerClassName:l,type:c="text",disabled:d,readonly:u,invalid:h,onChange:p,min:f,max:C,prefix:v,suffix:w,textBeforeInput:b,textAfterInput:S,onBlur:y,defaultValue:x,tooltipText:R,hideTooltip:F=!1,inputRef:D})=>{const M=g.useRef(null),k=Re.useMergeRefs([D,M]);g.useEffect(()=>{const B=M.current;if(!B)return;const O=J=>{J.preventDefault()};return B.addEventListener("wheel",O,{passive:!1}),()=>{B.removeEventListener("wheel",O)}},[]);const E=c==="number"||f!==void 0||C!==void 0,P=B=>{Gk(B,c,f,C)},N=B=>{const O=B.currentTarget.value;if(E&&O!==""){const J=parseFloat(O);if(isNaN(J)&&O!=="-"&&O!=="."||!isNaN(J)&&(f!==void 0&&J<f||C!==void 0&&J>C))return}p?.(O||void 0)};return m.jsxs("div",{className:Z("dial-input-field flex flex-row items-center justify-between py-2",s?"dial-input-no-border":"dial-input",h&&"dial-input-error",d&&"dial-input-disable",u&&"dial-input-readonly",!b&&"pl-3",!S&&"pr-3",a),"aria-label":"input-container",children:[b&&m.jsx("div",{className:"mr-2",children:m.jsx(Co,{hideBorder:!0,containerClassName:"rounded-r-none border-r-0",className:"overflow-hidden overflow-ellipsis dial-small",value:b,disabled:!0,elementId:b+"textBefore"})}),v&&m.jsxs("p",{className:"text-secondary dial-small mr-2",children:[" ",v]}),m.jsx(Oe,{icon:e,className:Z(!!e&&"mr-2")}),m.jsx(vs,{tooltip:F?void 0:R||o,triggerClassName:Z(l,"flex-1"),children:m.jsx("input",{ref:k,type:c,autoComplete:"off",id:i,placeholder:n,value:x?void 0:o??"",disabled:d,className:Z("border-0 bg-transparent w-full truncate",r),onChange:B=>!u&&N?.(B),onKeyDown:P,onBlur:y,min:f,max:C,defaultValue:x})}),m.jsx(Oe,{icon:t,className:Z(!!t&&"ml-2")}),w&&m.jsxs("p",{className:"text-secondary dial-small ml-2",children:[" ",w]}),S&&m.jsx("div",{className:"ml-2",children:m.jsx(Co,{hideBorder:!0,containerClassName:"rounded-l-none border-l-0",value:S,disabled:!0,elementId:S+"textAfter"})})]})},Bk=/^0+\.(\d+)?$/,Vk=/^0+/,bC=({label:e,optional:t,optionalText:s,description:o,error:i,captionDescription:n,readonly:r,orientation:a,elementId:l,fieldTitle:c,errorText:d,elementClassName:u,elementContainerClassName:h,containerClassName:p,defaultEmptyText:f,...C})=>m.jsx(da,{label:e??c,error:i??d,optionalText:s,optional:t,description:o,captionDescription:n,readonly:r,orientation:a,elementId:l,className:p,defaultEmptyText:f,value:C.value,children:m.jsx(Co,{elementId:l,className:u,containerClassName:h,invalid:d!=null,...C})}),zk=({onChange:e,...t})=>{const s=o=>!o||o==="-"?o:String(o)?.match(Bk)?String(o)?.replace(Vk,"0"):Number(o);return m.jsx(bC,{type:"number",onChange:o=>e?.(s(o)),...t})},Wk=({onChange:e,...t})=>m.jsx(bC,{type:"text",onChange:s=>e?.(s),...t}),_k=({fieldTitle:e,optional:t,elementId:s,elementClassName:o,containerClassName:i,elementContainerClassName:n,errorText:r,...a})=>m.jsxs("div",{className:ce("flex flex-col",i),children:[m.jsx(wo,{fieldTitle:e,optional:t,htmlFor:s}),m.jsx(wC,{textareaId:s,className:o,containerClassName:n,...a}),m.jsx(Ls,{errorText:r})]}),tu=({label:e,switchId:t,isOn:s=!1,disabled:o,onChange:i})=>{const n=Z("flex w-[36px] h-[18px] cursor-pointer items-center gap-1 rounded-full p-0.5 transition-all duration-200",s?"flex-row-reverse":"flex-row",o?"pointer-events-none":"",o?s?"bg-controls-disable":"bg-layer-4":s?"bg-accent-primary":"bg-layer-4"),r=g.useCallback(a=>{a.stopPropagation(),i?.(!s)},[i,s]);return m.jsxs("div",{className:"flex flex-row items-center",role:"switch",children:[m.jsx("input",{type:"checkbox",onChange:r,id:t,disabled:o,className:"invisible w-0 h-0",checked:s}),m.jsx("label",{htmlFor:t,className:n,children:m.jsx("span",{className:Z("size-3 rounded-full",o?s?"bg-layer-4":"bg-controls-disable":"bg-controls-enable-primary")})}),e&&m.jsx("span",{className:Z("pl-2 dial-small",o?"text-secondary":"text-primary"),"aria-label":"switch-title",children:e})]})};var Bt=(e=>(e.Sm="sm",e.Md="md",e.Lg="lg",e))(Bt||{});const jk="z-[52] flex items-center justify-center bg-blackout md:p-4",Uk="divide-tertiary divide-y",$k="flex flex-row justify-between py-4 px-6 items-center",Kk={[Bt.Sm]:"dial-sm-popup",[Bt.Md]:"dial-md-popup",[Bt.Lg]:"dial-lg-popup"},Fo=({open:e=!1,header:t,portalId:s,className:o,overlayClassName:i,titleClassName:n,headerClassName:r,dividers:a=!0,children:l,footer:c,onClose:d,size:u=Bt.Md,closeOnOutsideClick:h=!0})=>{const{refs:p,context:f}=Re.useFloating({open:e,onOpenChange:y=>{y||d?.(null)}}),C=Re.useRole(f,{role:"dialog"}),v=Re.useDismiss(f,{outsidePress:h}),{getFloatingProps:w}=Re.useInteractions([C,v]);if(!e)return null;const b=typeof t=="string"?"dial-popup-heading":void 0,S=y=>y?typeof y=="string"?m.jsx("h3",{id:b,className:Z("flex-1 min-w-0 mr-3 truncate dial-h3 text-primary",n),children:m.jsx(vs,{tooltip:y,children:y})}):y:m.jsx("span",{});return m.jsx(Re.FloatingPortal,{id:s,children:m.jsx(Re.FloatingOverlay,{className:Z(jk,i),children:m.jsx(Re.FloatingFocusManager,{context:f,children:m.jsxs("div",{ref:p.setFloating,...w(),role:"dialog","aria-modal":"true","aria-labelledby":b,className:Z("dial-popup",Kk[u],a&&Uk,o),children:[m.jsxs("div",{className:ce($k,r),children:[S(t),m.jsx(Jd,{ariaLabel:"Close dialog",onClose:y=>d?.(y)})]}),m.jsx("div",{className:"flex-grow overflow-auto","aria-label":"popup-description",children:l}),c]})})})})};var li=(e=>(e.Info="info",e.Danger="danger",e))(li||{});const qk="flex justify-end gap-2 px-6 py-4",Yk="text-secondary dial-small-150 px-6 py-4",Zk="Cancel",Xk="Ok",rg={[li.Info]:{confirmVariant:ke.Primary,cancelVariant:ke.Secondary},[li.Danger]:{container:"dial-danger-popup",confirmVariant:ke.Danger,cancelVariant:ke.Secondary}},SC=({header:e,description:t,descriptionClassName:s,open:o=!1,confirmLabel:i=Xk,cancelLabel:n=Zk,isLoading:r=!1,disableConfirmButton:a=!1,className:l,confirmClassName:c,onClose:d,onConfirm:u,onCancel:h,children:p,dividers:f=!1,variant:C=li.Info,size:v=Bt.Sm,footer:w})=>{const b=r?null:m.jsxs("div",{className:qk,children:[m.jsx(De,{variant:ke.Secondary,label:n,onClick:()=>h?h():d?.()}),m.jsx(De,{variant:rg[C].confirmVariant,className:c,label:i,disabled:a,onClick:()=>u()})]}),S=g.useCallback(()=>r?m.jsx("div",{className:"px-6 py-4 h-[120px]",children:m.jsx(yn,{size:50})}):p??(t?m.jsx("div",{className:Z(Yk,s),children:t}):null),[p,t,r,s]);return m.jsx(Fo,{open:o,header:e,className:Z(rg[C].container,l),dividers:f,onClose:()=>d?.(),footer:w??b,size:v,children:S()})},su=({selectedItems:e,listClassName:t,listElementClassName:s,placeholder:o})=>e?.length?m.jsx("ul",{className:Z("flex-row items-center truncate flex-wrap","flex gap-x-2 gap-y-1",t),children:e?.map(i=>m.jsx("li",{children:m.jsx(vs,{tooltip:i,children:m.jsx(ga,{tag:i,className:Z([s])})})},i))}):o?m.jsx("span",{className:"text-secondary",children:o}):null,ag=e=>me.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},me.createElement("path",{d:"M2.25 13.5V12C2.25 11.5858 2.58579 11.25 3 11.25C3.41421 11.25 3.75 11.5858 3.75 12V13.5C3.75 13.6989 3.82907 13.8896 3.96973 14.0303C4.11038 14.1709 4.30109 14.25 4.5 14.25H6C6.41421 14.25 6.75 14.5858 6.75 15C6.75 15.4142 6.41421 15.75 6 15.75H4.5C3.90326 15.75 3.33114 15.5128 2.90918 15.0908C2.48722 14.6689 2.25 14.0967 2.25 13.5ZM14.25 6V4.5C14.25 4.30109 14.1709 4.11038 14.0303 3.96973C13.8896 3.82907 13.6989 3.75 13.5 3.75H12C11.5858 3.75 11.25 3.41421 11.25 3C11.25 2.58579 11.5858 2.25 12 2.25H13.5C14.0967 2.25 14.6689 2.48722 15.0908 2.90918C15.5128 3.33114 15.75 3.90326 15.75 4.5V6C15.75 6.41421 15.4142 6.75 15 6.75C14.5858 6.75 14.25 6.41421 14.25 6Z",fill:"currentColor"})),yC=({children:e,open:t,disabled:s=!1,selectedValue:o,valueClassName:i,inputClassName:n,onOpen:r,elementId:a,errorText:l,invalid:c,emptyValueText:d,placeholder:u})=>{const h=Array.isArray(o)&&o.length>0,p=typeof o=="string"&&!!o.trim(),f=h||p?o:u?void 0:d,C=s?void 0:r,v=()=>m.jsxs(m.Fragment,{children:[m.jsx("button",{type:"button",className:"w-full",onClick:C,"aria-label":"open-popup",id:a,children:m.jsxs("div",{className:Z("dial-input px-3 py-2 dial-input-field flex flex-row items-center w-full justify-between",n,s&&"dial-input-disable",(l||c)&&"dial-input-error"),children:[m.jsx(vs,{tooltip:f==null?void 0:String(f),children:f||!u?m.jsx("span",{className:i,children:f}):m.jsx("span",{className:"text-secondary",children:u})}),!s&&m.jsx("div",{className:"flex-shrink-0",children:m.jsx(Oe,{icon:m.jsx(ag,{role:"img",width:ds,height:ds})})})]})}),l&&m.jsx(Ls,{errorText:l})]}),w=()=>m.jsx("div",{className:"w-full",onClick:C,children:m.jsxs("div",{className:Z("dial-input px-3 py-2 flex flex-row items-center w-full justify-between",s&&"dial-input-disable"),children:[m.jsx(su,{placeholder:u,selectedItems:f}),!s&&m.jsx("div",{className:"ml-1",children:m.jsx(Oe,{icon:m.jsx(ag,{role:"img",width:ds,height:ds})})})]})});return m.jsxs(m.Fragment,{children:[h?w():v(),t&&Sn.createPortal(e,document.body)]})},Qk=({fieldTitle:e,htmlFor:t,disabled:s,selectedValue:o,radioButtons:i,customInputValue:n,valueClassName:r,inputClassName:a,emptyValueText:l,onClose:c,header:d,portalId:u,onApply:h,cancelButtonTitle:p="Cancel",applyButtonTitle:f="Apply",isValid:C,selectedRadioValue:v,onChangeRadioField:w,id:b,size:S=Bt.Md})=>{const[y,x]=g.useState(!1),R=g.useCallback(()=>{s||x(!0)},[s]),F=g.useCallback(()=>{x(!1),c?.()},[c]),D=g.useCallback(()=>{h(),F()},[h,F]);return m.jsxs("div",{className:"flex flex-col",children:[m.jsx(wo,{fieldTitle:e,htmlFor:t}),m.jsx(yC,{disabled:s,open:y,selectedValue:n??i.find(M=>M.id===o)?.name,valueClassName:r,inputClassName:Z(a,"py-2","px-3"),emptyValueText:l,onOpen:R,children:m.jsx(Fo,{open:y,onClose:F,header:d,portalId:u,size:S,footer:m.jsxs("div",{className:"flex flex-row items-center justify-end gap-2 px-6 py-4",children:[m.jsx(De,{variant:ke.Secondary,label:p,onClick:F}),m.jsx(De,{variant:ke.Primary,label:f,onClick:D,disabled:!C})]}),children:m.jsx("div",{className:"px-6 py-4",children:m.jsx(Ir,{radioButtons:i,labelClassName:"dial-small",activeRadioButton:v,onChange:w,elementId:b,orientation:ao.Column})})})})]})},Jk="Create",eA="Cancel",tA="flex items-center justify-end gap-2 px-6 py-3",sA=({header:e,open:t=!1,submitLabel:s=Jk,cancelLabel:o=eA,isLoading:i=!1,disableSubmitButton:n=!1,className:r,submitClassName:a,onClose:l,onSubmit:c,onCancel:d,children:u,dividers:h=!0,size:p=Bt.Md,footer:f})=>{const C=i?null:m.jsxs("div",{className:tA,children:[m.jsx(De,{variant:ke.Secondary,label:o,onClick:()=>d?d():l?.()}),m.jsx(De,{variant:ke.Primary,className:a,label:s,disabled:n,onClick:()=>c()})]}),v=g.useCallback(()=>i?m.jsx("div",{className:"px-6 py-4 h-[120px]",children:m.jsx(yn,{size:50})}):u??null,[u,i]);return m.jsx(Fo,{open:t,header:e,className:r,dividers:h,onClose:()=>l?.(),footer:f??C,size:p,children:v()})},oA=({onClick:e})=>m.jsx(z.IconEyeOff,{...ae,className:"text-primary",onClick:e,role:"button","aria-label":"hide"}),iA=({onClick:e})=>m.jsx(z.IconEye,{...ae,className:"text-primary",onClick:e,role:"button","aria-label":"show"}),xC=({...e})=>{const[t,s]=g.useState(!1),o=g.useCallback(i=>{s(i)},[]);return m.jsx(Co,{type:t?"text":"password",...e,hideTooltip:!t,iconAfter:t?m.jsx(oA,{onClick:()=>o(!1)}):m.jsx(iA,{onClick:()=>o(!0)})})},nA=({fieldTitle:e,optional:t,elementClassName:s,elementId:o,errorText:i,...n})=>m.jsxs("div",{className:"flex flex-col",children:[m.jsx(wo,{fieldTitle:e,optional:t,htmlFor:o}),m.jsx(xC,{className:s,elementId:o,invalid:!!i,...n}),m.jsx(Ls,{errorText:i})]});var bn=(e=>(e.Small="small",e.Base="base",e))(bn||{});const rA={[bn.Small]:{textClassName:"text-xs px-1",containerClassName:"px-[6px] py-1 h-[22px]",iconSize:10,iconStroke:1},[bn.Base]:{textClassName:"text-sm px-2",containerClassName:"px-3 py-2 h-[38px]",iconSize:18,iconStroke:1.5}},ou=({elementId:e,value:t,placeholder:s="Search...",disabled:o,readonly:i,invalid:n,className:r,containerClassName:a,onChange:l,onBlur:c,size:d=bn.Base,allowClear:u=!0})=>{const[h,p]=g.useState(t||"");g.useEffect(()=>{p(t||"")},[t]);const f=g.useCallback(w=>{p(w),l?.(w)},[l]),C=rA[d],v=g.useCallback(()=>{f("")},[f]);return m.jsxs("div",{className:ce("dial-input flex flex-row items-center justify-between",n&&"dial-input-error",o&&"dial-input-disable",i&&"dial-input-readonly",C.containerClassName,a),children:[m.jsx(Oe,{className:Z(o?"text-secondary":"text-primary"),icon:m.jsx(z.IconSearch,{size:C.iconSize,stroke:C.iconStroke})}),m.jsx("input",{id:e,type:"text",autoComplete:"off",placeholder:s,value:h??"",disabled:o,readOnly:i,className:Z("border-0 bg-transparent w-full",r,C.textClassName),onChange:w=>!i&&f(w.currentTarget.value),onBlur:c}),h&&!i&&!o&&u&&m.jsx(Oe,{className:"text-primary cursor-pointer",icon:m.jsx(z.IconX,{size:C.iconSize,stroke:C.iconStroke,onClick:v,"aria-label":"Clear search",role:"button"})})]})},aA=({placeholder:e="",selectedItems:t=[],updateSelected:s,listClassName:o,listElementClassName:i,containerClassName:n,inputClassName:r})=>{const[a,l]=g.useState(""),c=g.useCallback(u=>{u.key==="Enter"&&(s([...t,u.currentTarget.value]),l("")),(u.key==="Backspace"||u.key==="Delete")&&t.length&&!a&&s(t.slice(0,-1))},[t,s,a]),d=g.useCallback(u=>{l(u.target.value)},[l]);return m.jsxs("div",{className:Z(["dial-input px-3 py-2 flex flex-row items-center flex-wrap w-fit gap-2",n]),children:[m.jsx(su,{selectedItems:t,listClassName:o,listElementClassName:i}),m.jsx("input",{type:"text",value:a,className:Z(["border-0 bg-transparent p-0",r]),placeholder:t?.length?"":e,onKeyDown:c,onChange:d})]})},lA=({initialTags:e=[],fieldTitle:t,optional:s,elementId:o,placeholder:i,errorText:n,invalid:r,disabled:a,onChange:l})=>{const c=g.useRef(null),[d,u]=g.useState(e),[h,p]=g.useState(""),[f,C]=g.useState(!1),v=S=>{const y=S.trim().replace(/,$/,"");if(y&&!d.includes(y)){const x=[y,...d];u(x),l?.(x)}},w=S=>{(S.key===","||S.key==="Enter")&&(S.preventDefault(),v(h),p(""))},b=S=>{const y=d.filter((x,R)=>R!==S);u(y),l?.(y)};return g.useEffect(()=>{const S=new ResizeObserver(()=>{if(c.current){const y=c.current.scrollHeight>c.current.clientHeight+10;C(y)}});return c.current&&S.observe(c.current),()=>S.disconnect()},[d]),m.jsxs("div",{className:Z("flex flex-col w-full"),children:[m.jsx(wo,{fieldTitle:t,optional:s,htmlFor:o}),m.jsx("div",{className:Z("dial-input min-h-[38px] p-[6px]",r&&"dial-input-error",a&&"dial-input-disable"),children:m.jsxs("div",{ref:c,className:Z("flex flex-wrap gap-2 items-center",f?"flex-col-reverse":"flex-row"),children:[d.map((S,y)=>m.jsx(ga,{tag:S,remove:a?void 0:()=>b(y)},S+y)),m.jsx("input",{type:"text",value:h,onChange:S=>p(S.target.value),onKeyDown:w,className:Z("dial-input-no-border outline-none border-none w-full min-w-[100px] flex-1 p-1"),placeholder:i,disabled:a})]})}),m.jsx(Ls,{errorText:n})]})},cA="dial-input flex w-full items-center justify-between gap-2 dial-small",dA="w-full rounded flex flex-col",tc="flex w-full items-center justify-between gap-2 px-3 h-[34px] dial-small text-primary truncate hover:bg-accent-primary-alpha focus:bg-accent-primary-alpha focus:outline-none",uA="bg-accent-primary-alpha",hA="bg-accent-primary-alpha border-l border-accent-primary border-1",lg="opacity-75",gA=352,pA=m.jsx(z.IconChevronDown,{size:16}),RC=({options:e,selectedValues:t,handleRemoveTag:s})=>m.jsx("div",{className:"flex flex-wrap w-full items-center gap-1",children:t.map(o=>{const i=e.find(r=>r.value===o)?.label??o,n=e.find(r=>r.value===o)?.icon;return m.jsx(ga,{tag:i,remove:r=>s?.(r,o),iconBefore:n?m.jsx(Oe,{icon:n}):null,className:"max-w-full"},o)})});var ra=(e=>(e.Sm="sm",e.Md="md",e))(ra||{}),aa=(e=>(e.Primary="Primary",e.Secondary="Secondary",e))(aa||{});const FC=({options:e,multiple:t=!1,elementId:s,value:o,defaultValue:i,variant:n=aa.Primary,size:r=ra.Md,prefix:a,customSelectedValue:l,placeholder:c="Select...",searchable:d=!1,searchPlaceholder:u,selectAll:h=!1,selectAllLabel:p="Select all",emptyStateTitle:f="No options available",emptyStateDescription:C,emptyStateIcon:v,disabled:w=!1,className:b,closable:S=!1,header:y,footer:x,onClose:R,onChange:F,inlineSearch:D=!1,dismissRef:M,onFooterClick:k})=>{const E=g.useId(),[P,N]=g.useState(!1),[B,O]=g.useState(D&&l||""),J=g.useRef(null),te=o!==void 0,[L,le]=g.useState(i),V=te?o:L,Q=g.useMemo(()=>t?Array.isArray(V)?V:[]:typeof V=="string"?[V]:[],[V,t]),X=g.useMemo(()=>{const _=B.trim().toLowerCase();return _?e.filter(we=>we.label.toLowerCase().includes(_)):e},[e,B]);g.useEffect(()=>{!P&&!D&&O("")},[D,P]),g.useEffect(()=>{D&&O(l||"")},[l,D]);const $=g.useCallback(_=>{te||le(_),F?.(_)},[te,F]),q=_=>{if(t){const we=new Set(Q);we.has(_)?we.delete(_):we.add(_),$(Array.from(we))}else $(_),N(!1)},ee=g.useCallback((_,we)=>{if(_.stopPropagation(),!t){$("");return}const pe=Q.filter(xe=>xe!==we);$(pe)},[t,Q,$]),ge=g.useMemo(()=>X.filter(_=>!_.disabled),[X]),H=g.useMemo(()=>ge.filter(_=>Q.includes(_.value)).length,[ge,Q]),I=_=>{D&&!t&&!_&&q(B),N(_)},U=ge.length>0&&H===ge.length,W=H>0&&!U,ue=()=>{if(!(!t||ge.length===0))if(U){const _=new Set(ge.map(pe=>pe.value)),we=Q.filter(pe=>!_.has(pe));$(we)}else{const _=new Set(Q);ge.forEach(we=>_.add(we.value)),$(Array.from(_))}},ie=Q.length>0;g.useEffect(()=>{P&&D&&!t&&!w&&requestAnimationFrame(()=>{const _=J.current;if(!_)return;_.focus();const we=_.value?.length??0;_.setSelectionRange?.(we,we)})},[P,D,t,w]);const Ce=!t&&ie?Q[0]:void 0,ve=g.useMemo(()=>Ce?e.find(_=>_.value===Ce):void 0,[e,Ce]),Pe=g.useCallback(()=>!t||Q.length===0?null:m.jsx(RC,{options:e,selectedValues:Q,handleRemoveTag:ee}),[t,e,Q,ee]),de=g.useCallback(()=>t?ie?Pe():m.jsx("span",{className:"text-secondary truncate",children:c}):ve?m.jsxs(m.Fragment,{children:[ve.icon&&m.jsx(Oe,{icon:ve.icon}),m.jsx(ct,{text:a?`${a} ${ve.label}`:ve.label}),ve?.description&&m.jsx("div",{className:"text-secondary dial-small",children:ve.description})]}):l&&o?l:m.jsx("span",{className:"text-secondary truncate",children:c}),[ie,t,l,a,o,c,Pe,ve]);g.useImperativeHandle(M,()=>({dismiss:()=>{N(!1)}}));const ye=()=>{O(Q.length===1?ve?.label??B:"")};return m.jsx(bt,{open:P,onOpenChange:I,disabled:w,closable:S,onClose:R,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],maxDropdownHeight:d?null:gA,renderOverlay:()=>m.jsxs("div",{id:`list-${s||E}`,role:"listbox","aria-multiselectable":t||void 0,className:dA,children:[y&&m.jsx(m.Fragment,{children:typeof y=="function"?y():y}),(d||S)&&e.length>8&&m.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[d&&m.jsx(ou,{placeholder:u,onChange:O,value:B,elementId:`search-${s||E}`}),S&&m.jsx(De,{"aria-label":"Close select",className:"shrink-0",iconBefore:m.jsx(z.IconX,{size:16}),onClick:_=>{R?.(_),N(!1)}})]}),t&&h&&ge.length>0&&m.jsx("div",{className:Z(tc,"mt-2"),children:m.jsx(sn,{id:`${s||E}-selectAll`,label:p,checked:U,indeterminate:W,onChange:ue,ariaLabel:p})}),m.jsx("div",{className:Z("overflow-y-auto max-h-[352px]",D&&X.length===0?"":"py-1"),children:X.length===0?!D&&m.jsx("div",{className:"px-2 py-3",children:m.jsx(ua,{icon:v??m.jsx(z.IconClipboardX,{size:24}),title:f,description:C})}):X.map(_=>{const we=Q.includes(_.value);return t?m.jsxs("div",{role:"option","aria-selected":we,"aria-disabled":!!_.disabled,className:Z(tc,we&&uA,_.disabled&&lg,"w-full"),children:[m.jsx(sn,{id:`${s||E}-${_.value}`,label:m.jsxs("span",{className:"flex w-full flex-1 min-w-0 items-center gap-2 text-primary",children:[_.icon&&m.jsx(Oe,{icon:_.icon}),m.jsx("span",{className:"truncate",children:_.label})]}),checked:we,disabled:_.disabled,onChange:()=>!_.disabled&&q(_.value),ariaLabel:_.label}),_.description&&m.jsx("div",{className:"text-secondary dial-small",children:_.description})]},_.value):m.jsx("button",{role:"option",type:"button","aria-selected":we,"aria-disabled":!!_.disabled,disabled:_.disabled,className:Z(tc,we&&hA,_.disabled&&lg),onClick:()=>!_.disabled&&q(_.value),children:m.jsxs("div",{className:"flex items-center gap-2 w-full",children:[_.icon&&m.jsx(Oe,{icon:_.icon}),m.jsx(ct,{text:_.label}),_.description&&m.jsx("div",{className:"text-secondary dial-small",children:_.description})]})},_.value)})}),x&&m.jsx("div",{onClick:_=>{k?.(_),k&&N(!1)},children:typeof x=="function"?x():x})]}),children:m.jsxs("button",{type:"button","aria-haspopup":"listbox","aria-expanded":P,"aria-controls":`list-${s||E}`,className:ce(cA,w&&"opacity-75 !cursor-not-allowed",r===ra.Sm?"min-h-[25px] px-1.5 py-1":"min-h-[38px] px-3 py-2",n===aa.Secondary?"!bg-layer-4":"",b),onMouseDown:_=>{w||D&&!t&&(ye(),_.preventDefault())},onClick:()=>{w||(N(_=>!_),D&&!t&&(ye(),J.current?.focus()))},children:[D&&!t?m.jsx("div",{className:"flex min-w-0 items-center gap-2 text-primary flex-1",children:m.jsx("input",{id:`inline-${s||E}`,type:"text",placeholder:u??c,value:B||"",onChange:_=>O(_.currentTarget.value.trimStart()),onFocus:()=>!w&&N(!0),onMouseDown:_=>{ye(),_.stopPropagation()},onClick:_=>{_.stopPropagation()},onKeyDown:_=>{_.stopPropagation()},className:"bg-transparent outline-none w-full dial-small",ref:J,disabled:w,"aria-disabled":w,autoComplete:"off"})}):m.jsx("div",{className:"flex min-w-0 items-center gap-2 text-primary",children:de()}),!D&&m.jsx(Oe,{icon:pA,className:Z("text-primary",P&&"rotate-180")})]})})},fA=({fieldTitle:e,optional:t,captionDescription:s,containerClassName:o,selectClassName:i,error:n,elementId:r,description:a,readonly:l,value:c,defaultEmptyText:d,...u})=>{const h=g.useCallback(()=>{if(!c||Array.isArray(c)&&c.length===0)return d??"None";if(Array.isArray(c))return m.jsx(RC,{options:u.options,selectedValues:c});{const p=u.options?.find(f=>f.value===c);return m.jsx("span",{"aria-readonly":!0,className:"text-primary",children:p?.label||c})}},[c,u.options,d]);return m.jsx(da,{elementId:r,label:e,optional:t,description:a,error:n,captionDescription:s,className:o,readonly:l,value:h(),defaultEmptyText:d,children:m.jsx(FC,{className:i,value:c,elementId:r,...u})})};function EC(e){let t=null;return()=>(t==null&&(t=e()),t)}function mA(e,t){return e.filter(s=>s!==t)}function CA(e,t){const s=new Set,o=n=>s.add(n);e.forEach(o),t.forEach(o);const i=[];return s.forEach(n=>i.push(n)),i}class vA{enter(t){const s=this.entered.length,o=i=>this.isNodeInDocument(i)&&(!i.contains||i.contains(t));return this.entered=CA(this.entered.filter(o),[t]),s===0&&this.entered.length>0}leave(t){const s=this.entered.length;return this.entered=mA(this.entered.filter(this.isNodeInDocument),t),s>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class wA{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(t=>{Object.defineProperty(this.item,t,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${t}" until the drop event.`),null}})})}loadDataTransfer(t){if(t){const s={};Object.keys(this.config.exposeProperties).forEach(o=>{const i=this.config.exposeProperties[o];i!=null&&(s[o]={value:i(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,s)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,s){return s===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const iu="__NATIVE_FILE__",DC="__NATIVE_URL__",PC="__NATIVE_TEXT__",MC="__NATIVE_HTML__",cg=Object.freeze(Object.defineProperty({__proto__:null,FILE:iu,HTML:MC,TEXT:PC,URL:DC},Symbol.toStringTag,{value:"Module"}));function sc(e,t,s){const o=t.reduce((i,n)=>i||e.getData(n),"");return o??s}const Yc={[iu]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[MC]:{exposeProperties:{html:(e,t)=>sc(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[DC]:{exposeProperties:{urls:(e,t)=>sc(e,t,"").split(`
|
|
62
62
|
`),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[PC]:{exposeProperties:{text:(e,t)=>sc(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function bA(e,t){const s=Yc[e];if(!s)throw new Error(`native type ${e} has no configuration`);const o=new wA(s);return o.loadDataTransfer(t),o}function oc(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(Yc).filter(s=>{const o=Yc[s];return o?.matchesTypes?o.matchesTypes.some(i=>t.indexOf(i)>-1):!1})[0]||null}const SA=EC(()=>/firefox/i.test(navigator.userAgent)),TC=EC(()=>!!window.safari);class dg{interpolate(t){const{xs:s,ys:o,c1s:i,c2s:n,c3s:r}=this;let a=s.length-1;if(t===s[a])return o[a];let l=0,c=r.length-1,d;for(;l<=c;){d=Math.floor(.5*(l+c));const p=s[d];if(p<t)l=d+1;else if(p>t)c=d-1;else return o[d]}a=Math.max(0,c);const u=t-s[a],h=u*u;return o[a]+i[a]*u+n[a]*h+r[a]*u*h}constructor(t,s){const{length:o}=t,i=[];for(let p=0;p<o;p++)i.push(p);i.sort((p,f)=>t[p]<t[f]?-1:1);const n=[],r=[];let a,l;for(let p=0;p<o-1;p++)a=t[p+1]-t[p],l=s[p+1]-s[p],n.push(a),r.push(l/a);const c=[r[0]];for(let p=0;p<n.length-1;p++){const f=r[p],C=r[p+1];if(f*C<=0)c.push(0);else{a=n[p];const v=n[p+1],w=a+v;c.push(3*w/((w+v)/f+(w+a)/C))}}c.push(r[r.length-1]);const d=[],u=[];let h;for(let p=0;p<c.length-1;p++){h=r[p];const f=c[p],C=1/n[p],v=f+c[p+1]-h-h;d.push((h-f-v)*C),u.push(v*C*C)}this.xs=t,this.ys=s,this.c1s=c,this.c2s=d,this.c3s=u}}const yA=1;function IC(e){const t=e.nodeType===yA?e:e.parentElement;if(!t)return null;const{top:s,left:o}=t.getBoundingClientRect();return{x:o,y:s}}function hr(e){return{x:e.clientX,y:e.clientY}}function xA(e){var t;return e.nodeName==="IMG"&&(SA()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function RA(e,t,s,o){let i=e?t.width:s,n=e?t.height:o;return TC()&&e&&(n/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:n}}function FA(e,t,s,o,i){const n=xA(t),a=IC(n?e:t),l={x:s.x-a.x,y:s.y-a.y},{offsetWidth:c,offsetHeight:d}=e,{anchorX:u,anchorY:h}=o,{dragPreviewWidth:p,dragPreviewHeight:f}=RA(n,t,c,d),C=()=>{let R=new dg([0,.5,1],[l.y,l.y/d*f,l.y+f-d]).interpolate(h);return TC()&&n&&(R+=(window.devicePixelRatio-1)*f),R},v=()=>new dg([0,.5,1],[l.x,l.x/c*p,l.x+p-c]).interpolate(u),{offsetX:w,offsetY:b}=i,S=w===0||w,y=b===0||b;return{x:S?w:v(),y:y?b:C()}}class EA{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var t;return!((t=this.globalContext)===null||t===void 0)&&t.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var t;return((t=this.optionsArgs)===null||t===void 0?void 0:t.rootElement)||this.window}constructor(t,s){this.ownerDocument=null,this.globalContext=t,this.optionsArgs=s}}function DA(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function ug(e){for(var t=1;t<arguments.length;t++){var s=arguments[t]!=null?arguments[t]:{},o=Object.keys(s);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(s).filter(function(i){return Object.getOwnPropertyDescriptor(s,i).enumerable}))),o.forEach(function(i){DA(e,i,s[i])})}return e}class PA{profile(){var t,s;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((t=this.dragStartSourceIds)===null||t===void 0?void 0:t.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((s=this.dragOverTargetIds)===null||s===void 0?void 0:s.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const t=this.rootElement;if(t!==void 0){if(t.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");t.__isReactDndBackendSetUp=!0,this.addEventListeners(t)}}teardown(){const t=this.rootElement;if(t!==void 0&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var s;(s=this.window)===null||s===void 0||s.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(t,s,o){return this.sourcePreviewNodeOptions.set(t,o),this.sourcePreviewNodes.set(t,s),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,s,o){this.sourceNodes.set(t,s),this.sourceNodeOptions.set(t,o);const i=r=>this.handleDragStart(r,t),n=r=>this.handleSelectStart(r);return s.setAttribute("draggable","true"),s.addEventListener("dragstart",i),s.addEventListener("selectstart",n),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),s.removeEventListener("dragstart",i),s.removeEventListener("selectstart",n),s.setAttribute("draggable","false")}}connectDropTarget(t,s){const o=r=>this.handleDragEnter(r,t),i=r=>this.handleDragOver(r,t),n=r=>this.handleDrop(r,t);return s.addEventListener("dragenter",o),s.addEventListener("dragover",i),s.addEventListener("drop",n),()=>{s.removeEventListener("dragenter",o),s.removeEventListener("dragover",i),s.removeEventListener("drop",n)}}addEventListeners(t){t.addEventListener&&(t.addEventListener("dragstart",this.handleTopDragStart),t.addEventListener("dragstart",this.handleTopDragStartCapture,!0),t.addEventListener("dragend",this.handleTopDragEndCapture,!0),t.addEventListener("dragenter",this.handleTopDragEnter),t.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.addEventListener("dragover",this.handleTopDragOver),t.addEventListener("dragover",this.handleTopDragOverCapture,!0),t.addEventListener("drop",this.handleTopDrop),t.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(t){t.removeEventListener&&(t.removeEventListener("dragstart",this.handleTopDragStart),t.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),t.removeEventListener("dragend",this.handleTopDragEndCapture,!0),t.removeEventListener("dragenter",this.handleTopDragEnter),t.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.removeEventListener("dragover",this.handleTopDragOver),t.removeEventListener("dragover",this.handleTopDragOverCapture,!0),t.removeEventListener("drop",this.handleTopDrop),t.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const t=this.monitor.getSourceId(),s=this.sourceNodeOptions.get(t);return ug({dropEffect:this.altKeyPressed?"copy":"move"},s||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const t=this.monitor.getSourceId(),s=this.sourcePreviewNodeOptions.get(t);return ug({anchorX:.5,anchorY:.5,captureDraggingState:!1},s||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(cg).some(s=>cg[s]===t)}beginDragNativeItem(t,s){this.clearCurrentDragSourceNode(),this.currentNativeSource=bA(t,s),this.currentNativeHandle=this.registry.addSource(t,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(t){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=t;const s=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var o;return(o=this.rootElement)===null||o===void 0?void 0:o.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},s)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var t;(t=this.window)===null||t===void 0||t.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(t,s){t.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(s))}handleDragEnter(t,s){this.dragEnterTargetIds.unshift(s)}handleDragOver(t,s){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(s)}handleDrop(t,s){this.dropTargetIds.unshift(s)}constructor(t,s,o){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=i=>{const n=this.sourceNodes.get(i);return n&&IC(n)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=i=>!!(i&&this.document&&this.document.body&&this.document.body.contains(i)),this.endDragIfSourceWasRemovedFromDOM=()=>{const i=this.currentDragSourceNode;i==null||this.isNodeInDocument(i)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=i=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(i||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=i=>{if(i.defaultPrevented)return;const{dragStartSourceIds:n}=this;this.dragStartSourceIds=null;const r=hr(i);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(n||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:r});const{dataTransfer:a}=i,l=oc(a);if(this.monitor.isDragging()){if(a&&typeof a.setDragImage=="function"){const d=this.monitor.getSourceId(),u=this.sourceNodes.get(d),h=this.sourcePreviewNodes.get(d)||u;if(h){const{anchorX:p,anchorY:f,offsetX:C,offsetY:v}=this.getCurrentSourcePreviewNodeOptions(),S=FA(u,h,r,{anchorX:p,anchorY:f},{offsetX:C,offsetY:v});a.setDragImage(h,S.x,S.y)}}try{a?.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(i.target);const{captureDraggingState:c}=this.getCurrentSourcePreviewNodeOptions();c?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(l)this.beginDragNativeItem(l);else{if(a&&!a.types&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=i=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var n;(n=this.currentNativeSource)===null||n===void 0||n.loadDataTransfer(i.dataTransfer)}if(!this.enterLeaveCounter.enter(i.target)||this.monitor.isDragging())return;const{dataTransfer:a}=i,l=oc(a);l&&this.beginDragNativeItem(l,a)},this.handleTopDragEnter=i=>{const{dragEnterTargetIds:n}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=i.altKey,n.length>0&&this.actions.hover(n,{clientOffset:hr(i)}),n.some(a=>this.monitor.canDropOnTarget(a))&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=i=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var n;(n=this.currentNativeSource)===null||n===void 0||n.loadDataTransfer(i.dataTransfer)}},this.handleTopDragOver=i=>{const{dragOverTargetIds:n}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}this.altKeyPressed=i.altKey,this.lastClientOffset=hr(i),this.scheduleHover(n),(n||[]).some(a=>this.monitor.canDropOnTarget(a))?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=i=>{this.isDraggingNativeItem()&&i.preventDefault(),this.enterLeaveCounter.leave(i.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=i=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var n;i.preventDefault(),(n=this.currentNativeSource)===null||n===void 0||n.loadDataTransfer(i.dataTransfer)}else oc(i.dataTransfer)&&i.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=i=>{const{dropTargetIds:n}=this;this.dropTargetIds=[],this.actions.hover(n,{clientOffset:hr(i)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=i=>{const n=i.target;typeof n.dragDrop=="function"&&(n.tagName==="INPUT"||n.tagName==="SELECT"||n.tagName==="TEXTAREA"||n.isContentEditable||(i.preventDefault(),n.dragDrop()))},this.options=new EA(s,o),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new vA(this.isNodeInDocument)}}const MA=function(t,s,o){return new PA(t,s,o)},TA=({onChange:e,emptyTextFirstLine:t,emptyTextSecondLine:s,emptyButtonLabel:o,acceptTypes:i,maxFilesCount:n,multiple:r,fileFormatError:a,fileCountError:l,getIsFileFormatError:c})=>{const d=g.useRef(null),u=g.useRef(null),[h,p]=g.useState([]),[f,C]=g.useState(!1),v=g.useCallback(E=>{const P=E.target.files;if(P&&P.length>0){const N=Array.from(P);c?.(N)?C(!0):e(N)}},[c,e]),w=g.useCallback(E=>n&&E?.length>n,[n]),b=g.useMemo(()=>f||w(h),[f,h,w]),S=()=>{p([]),C(!1)};g.useEffect(()=>{S()},[i]);const[{isOver:y,canDrop:x},R]=$g(()=>({accept:[iu],drop(E){const P=E.files;!c?.(P)&&!w(P)&&e(P),S()},collect:E=>({isOver:E.isOver(),canDrop:E.canDrop()})}),[v]),F=E=>{(E.key==="Enter"||E.key==="Space")&&(E.preventDefault(),u.current?.click())},D=E=>{E?.preventDefault();const P=Array.from(E.dataTransfer?.items??[]);C(!!c?.(P)),p(P)},M=E=>{E.target===E.currentTarget&&S()},k=Z("border border-dashed rounded w-full cursor-pointer relative h-full hover:border-hover",!x&&!b&&"border-primary",x&&(y?"border-accent-primary":"border-hover"),b&&"border-error");return R(d),m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:k,ref:d,onDragOver:D,onDragLeave:M,children:[m.jsxs("label",{htmlFor:"file",tabIndex:0,onKeyDown:F,className:"flex flex-col items-center cursor-pointer h-full w-full text-secondary dial-tiny justify-center",children:[t&&m.jsx("p",{className:"mb-1",children:t}),s&&m.jsx("p",{className:"mb-0.5",children:s}),o&&m.jsx(De,{variant:ke.Tertiary,label:o,onClick:()=>u.current?.click()})]}),m.jsx("input",{multiple:r,id:"file",type:"file",ref:u,hidden:!0,accept:i,onChange:v})]}),m.jsx(m.Fragment,{children:f?m.jsx(Ls,{errorText:a}):w(h)&&m.jsx(Ls,{errorText:l})})]})},IA=({iconBefore:e,className:t,errorText:s,...o})=>{const i=o.invalid,n=()=>m.jsx("div",{className:"mr-2",children:i?m.jsx(z.IconExclamationCircle,{...ae,className:"text-error"}):e});return m.jsx(Co,{...o,iconBefore:n(),tooltipTriggerClassName:"flex-1 min-w-0",className:Z(i?"text-error":"",t),tooltipText:i&&s?s:void 0,hideBorder:!0})},kA=e=>{const{files:t,iconBeforeInput:s,dynamicIcon:o,onChange:i,isInvalid:n,errorText:r,removeButtonAriaLabel:a}=e,l=(u,h)=>{u.stopPropagation(),i(t?.filter(p=>p.name!==h)||[])},c=u=>m.jsx(vC,{"aria-label":a,onClick:h=>l(h,u)}),d=u=>{i(u)};return!t||t.length===0?m.jsx(v1,{backend:MA,children:m.jsx(TA,{...e,onChange:d})}):m.jsx("div",{className:"flex-1 min-h-0 border border-solid border-primary rounded",children:t&&t.length>0&&m.jsx("div",{className:"max-h-full overflow-y-auto",children:t.map((u,h)=>m.jsx(IA,{elementId:u.name,value:u.name,iconAfter:c(u.name),iconBefore:s||o?.(u.name),invalid:n?.(u),errorText:r},u.name+h))})})},AA=({onChange:e,fieldTitle:t,elementId:s,files:o,maxFilesCount:i,fileFormatError:n,fileCountError:r,multiple:a=!0,acceptTypes:l,deleteAllButtonLabel:c,addButtonLabel:d,...u})=>{const h=g.useRef(null),p=()=>h.current?.click(),f=()=>{e([])},C=g.useCallback(w=>w?.some(b=>b.type===""||!(l==="/"||l?.toLowerCase()?.includes(b?.type?.toLowerCase()))),[l]),v=g.useCallback(w=>{const b=w.target.files;if(b&&b.length>0){const S=Array.from(b);C(S)||e([...o||[],...S])}},[e,o,C]);return m.jsxs("div",{className:"h-full flex flex-col",children:[m.jsxs("div",{className:"flex justify-between items-center pb-1 min-h-[42px]",children:[m.jsx(wo,{fieldTitle:`${t}: ${a?o?.length||0:""}`,htmlFor:s}),a&&!!o?.length&&m.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[m.jsx(De,{variant:ke.Tertiary,className:"!text-error",iconBefore:m.jsx(z.IconTrashX,{...ae}),label:c,onClick:f}),(i?i>o?.length:!0)&&m.jsx(De,{variant:ke.Tertiary,iconBefore:m.jsx(z.IconPlus,{...ae}),label:d,onClick:p})]})]}),o&&o.length>0&&m.jsx("input",{id:"file",type:"file",multiple:a,ref:h,hidden:!0,accept:l,onChange:v}),m.jsx(kA,{files:o,onChange:e,acceptTypes:l,maxFilesCount:i,multiple:a,fileFormatError:n,fileCountError:r,getIsFileFormatError:C,...u})]})},LA=m.jsx(z.IconChevronDown,{size:16}),OA=m.jsx(z.IconChevronUp,{size:16}),Zc=e=>{const[t,s]=g.useState(!1),o=g.useMemo(()=>t?OA:LA,[t]);return m.jsx("div",{children:m.jsx(bt,{menu:{items:e.items},onOpenChange:i=>s(i),children:m.jsx(De,{...e,iconAfter:o})})})},NA="w-full h-full grid grid-rows-[auto_1fr] gap-5 p-6 overflow-hidden min-w-0 bg-layer-2",hg="w-full text-secondary flex items-center gap-2",HA="flex min-h-0 min-w-0 h-full gap-4 overflow-hidden",GA="flex flex-col flex-1 min-h-0 min-w-0 h-full gap-4",BA="w-full h-full rounded bg-layer-3 text-secondary overflow-auto min-w-0",VA="flex-1 w-full rounded text-secondary overflow-auto min-h-0 min-w-0",zA=280,WA="Files",As=20,_A="Files",ic=".dial_folder",jA=280,UA=460,nc=44,$A=56,KA=800;var Me=(e=>(e.ITEM="item",e.FOLDER="folder",e))(Me||{}),kC=(e=>(e.FILE="FILE",e.PROMPT="PROMPT",e.CONVERSATION="CONVERSATION",e.APPLICATION="APPLICATION",e.TOOLSET="TOOL_SET",e))(kC||{}),AC=(e=>(e.READ="READ",e.WRITE="WRITE",e.SHARE="SHARE",e))(AC||{});const vo=(e,t)=>{if(!(!e||!e.length||!t))for(const s of e){if(s.path===t)return s;const o=vo(s.items,t);if(o)return o}},gg=(e,t)=>{if(!e?.length)return;if(!t)return e[0];const s=vo(e,t);if(s&&s.nodeType===Me.FOLDER)return s;const o=t.split("/").filter(Boolean);if(o.length<=1)return e[0];const i="/"+o.slice(0,o.length-1).join("/");return vo(e,i)??e[0]},ei=e=>(e??"").toLowerCase(),qA=e=>ei(e).replace(/^\./,""),YA=e=>{if(!e)return[];const t=[],s=o=>{const i=o.items??[];for(const n of i)t.push(n),n.nodeType===Me.FOLDER&&s(n)};return s(e),t},Xc=e=>(e.name??e.path.split("/").pop()??"").startsWith("."),Tr=e=>{if(!e||e<=0)return"";const t=1024,s=t*1024;return e>=s?`${(e/s).toFixed(1)} MB`:e>=t?`${(e/t).toFixed(0)} KB`:`${e} bytes`},ZA=(e,t="en-US",s={year:"numeric",month:"short",day:"2-digit"})=>{if(!e)return"";try{return new Intl.DateTimeFormat(t,s).format(new Date(e))}catch{return e}};function LC(e,t,s){if(!e||e.length===0||e.includes("*/*"))return!0;const o=t.toLowerCase(),i=s&&s.includes(".")?`.${s.split(".").at(-1).toLowerCase()}`:void 0;return e.some(n=>{const r=n.toLowerCase();if(r.startsWith("."))return i===r;if(r.endsWith("/*")){const a=r.slice(0,-1);return o.startsWith(a)}return o===r})}const XA={size:10,stroke:2},QA=26;var Vt=(e=>(e.File="file",e.Folder="folder",e))(Vt||{});const JA=({name:e,type:t,shared:s=!1,loading:o=!1,...i})=>{const n=r=>m.jsxs("span",{className:"inline-flex relative text-secondary",role:"img",children:[r,s&&m.jsx("span",{className:"absolute -bottom-0.5 -left-0.5",children:m.jsx(nn,{})})]});if(o)return n(m.jsx(yn,{}));if(t===Vt.File){const r=e.includes(".")?e.split(".").pop():null;return m.jsx(nd,{...i,extension:r??"",className:"text-secondary",indicator:s?m.jsx(nn,{}):null,label:"File type icon"})}return t===Vt.Folder?n(m.jsx(Oe,{icon:m.jsx(z.IconFolder,{className:i.className,size:i.size??ae.size,stroke:i.stroke??ae.stroke}),className:"inline-block align-middle"})):null},e8=({name:e,type:t,elementId:s,loading:o=!1,shared:i=!1,iconClassName:n,iconIndicator:r,iconLabel:a,iconSize:l,iconStroke:c,inputInvalid:d,inputInvalidMessage:u,inputContainerClassName:h,inputIconAfter:p,inputRef:f,onChange:C})=>{const v=()=>d?m.jsx(vs,{tooltip:u,children:p||m.jsx(z.IconAlertCircleFilled,{...ae,className:"text-error","aria-label":"alert"})}):null;return m.jsxs("div",{className:"flex gap-2 items-center",children:[m.jsx(JA,{name:e,type:t,label:a,className:n,indicator:r,size:l,stroke:c,loading:o,shared:i}),m.jsx(Co,{containerClassName:ce("!h-6 py-[1px] pl-[7px] pr-[7px]",h),elementId:s,value:e,onChange:C,invalid:d,iconAfter:v(),inputRef:f})]})};function OC({value:e,isEditing:t,restoreOnCancel:s=!0,onValidate:o,onSave:i,onCancel:n}){const[r,a]=g.useState(e),[l,c]=g.useState(!1),[d,u]=g.useState(""),h=g.useRef(null),p=g.useCallback((b=!1,S="")=>{c(b),u(S)},[]),f=g.useCallback(b=>{if(!o)return p(),!0;const S=o(b);return S?(p(!0,S),!1):(p(),!0)},[o,p]),C=g.useCallback(b=>{const S=b??"";a(S),f(S)},[f]),v=g.useCallback(()=>{f(r)?i?.(r):h.current?.focus()},[f,i,r]),w=g.useCallback(()=>{s&&a(e),p(),n?.()},[e,n,s,p]);return g.useEffect(()=>{t&&(a(e),p(),requestAnimationFrame(()=>{h.current?.focus(),h.current?.select()}))},[t,e,p]),g.useEffect(()=>{const b=h.current;if(!t||!b)return;const S=y=>{y.key==="Enter"?(y.preventDefault(),h.current?.blur()):y.key==="Escape"&&(y.preventDefault(),w())};return b.addEventListener("keydown",S),()=>b.removeEventListener("keydown",S)},[t,v,w]),g.useEffect(()=>{if(!t)return;const b=h.current;if(!b)return;const S=y=>{const x=y.relatedTarget;x&&b.contains(x)||(f(r)?v():b.focus())};return b.addEventListener("blur",S),()=>{b.removeEventListener("blur",S)}},[t,r,f,v]),{inputRef:h,value:r,onChange:C,invalid:l,invalidMessage:d}}const la=({name:e,type:t,elementId:s,editing:o=!1,loading:i=!1,shared:n=!1,iconSize:r=ds,validate:a,onSave:l,onCancel:c,inputContainerClassName:d,...u})=>{const{value:h,invalid:p,invalidMessage:f,onChange:C,inputRef:v}=OC({value:e,isEditing:o,onValidate:a,onCancel:c,onSave:l});return o?m.jsx(e8,{type:t,name:h,elementId:s,inputInvalid:p,inputInvalidMessage:f,inputRef:v,onChange:C,iconSize:r,inputContainerClassName:d}):t===Vt.Folder?m.jsx(ba,{name:e,loading:i,shared:n,iconSize:r,className:"max-w-[428px] truncate"}):m.jsx(wa,{className:"max-w-[428px]",...u,name:e,shared:n,iconSize:r})},NC=e=>{const[t,s]=g.useState(e?.expandedPaths??new Set),o=g.useMemo(()=>!!e?.onExpandedPathsChange,[e?.onExpandedPathsChange]),i=g.useMemo(()=>o?e?.expandedPaths??new Set:t,[o,e?.expandedPaths,t]),n=g.useCallback(d=>{o?e?.onExpandedPathsChange?.(d):s(d)},[o,e]),r=g.useCallback(d=>{const u=new Set(i);u.has(d)?u.delete(d):u.add(d),n(u)},[i,n]),a=g.useCallback(()=>{n(new Set)},[n]),l=g.useCallback(d=>{const u=new Set(i);u.add(d),n(u)},[i,n]),c=g.useCallback(d=>{const u=new Set(i);u.delete(d),n(u)},[i,n]);return{expandedPaths:i,setExpandedPaths:n,togglePath:r,collapseAll:a,expandPath:l,collapsePath:c,isControlled:o}},t8=({items:e,showFiles:t=!1,expandedPaths:s,loadingPaths:o=new Set,loadedPaths:i=new Set,sharedByMePaths:n=new Set,selectedPath:r,emptyStateTitle:a="No Folders",emptyStateDescription:l,emptyStateIcon:c,areHiddenFilesVisible:d=!1,renamedPath:u,rootItemLabel:h,rootItemPath:p,onItemClick:f,getContextMenuItems:C,onRenameSave:v,onRenameCancel:w,onRenameValidate:b,onExpandedPathsChange:S})=>{const{expandedPaths:y,togglePath:x}=NC({expandedPaths:s??new Set,onExpandedPathsChange:S}),R=D=>{f?.(D),x(D.path)},F=(D,M)=>D.map(k=>{const{path:E,nodeType:P,name:N,items:B}=k,O=P===Me.FOLDER;if(!d&&Xc(k))return null;if(!O&&!t)return;const J=Array.isArray(B)&&B.length>0&&B.some(H=>H.nodeType===Me.FOLDER||t),te=y.has(E),L=r===E,le=o.has(E),V=u===E,Q=i.has(E),X=n.has(E),$=p&&h&&E===p&&O,q=b&&(H=>b(H,k)),ee=L?"bg-accent-primary-alpha border-l-2 border-l-accent-primary rounded":"border-l-2 border-l-transparent",ge=$?[]:C?.(k)??[];return m.jsx("div",{className:"cursor-pointer text-secondary",children:m.jsxs("div",{className:"flex flex-col w-full","aria-label":"folder",children:[m.jsx(bt,{trigger:[xt.ContextMenu],className:"w-full",anchorToMouse:!0,menu:{items:ge},children:m.jsxs("div",{style:{paddingLeft:`${M*QA}px`},className:ce("py-1 gap-[2px] dial-small flex justify-between hover:bg-accent-primary-alpha rounded group/item w-full mb-[2px] relative",ee),"aria-selected":L,children:[!V&&m.jsx("div",{className:"absolute size-full left-0 top-0 z-0",onClick:()=>R(k)}),m.jsx("div",{className:"relative flex flex-row truncate items-center w-fit h-6",onClick:()=>!V&&R(k),children:m.jsxs(m.Fragment,{children:[O&&m.jsx(z.IconCaretRightFilled,{...XA,className:Z("flex-shrink-0",te&&"rotate-90 transition-all",Q&&!J&&"text-transparent")}),m.jsx(la,{elementId:`${E}-tree-item`,name:$?h:N,type:O?Vt.Folder:Vt.File,loading:le,shared:X,iconSize:As,...!$&&{editing:V,onSave:v,onCancel:w,validate:q}})]})}),ge.length>0&&!V&&!$&&m.jsx("div",{className:"flex-1 flex justify-end",children:m.jsx(bt,{placement:"bottom-start",allowedPlacements:["top-start","top-end"],menu:{items:ge},className:"sticky right-0",children:m.jsx(Oe,{className:"invisible group-hover/item:visible text-secondary mx-2 flex flex-row gap-2 hover:text-accent-primary",icon:m.jsx(z.IconDotsVertical,{...ae})})})})]})}),te&&B&&F(B,M+1)]})},`${E}-children`)});return m.jsx("div",{className:"flex-1 w-full h-full overflow-y-auto","aria-label":"folders-tree",children:e.length>0?F(e,0):m.jsx(ua,{title:a,description:l,icon:c})})},s8="w-full flex items-center justify-between gap-4",o8="min-w-0 h-[38px] flex-1 overflow-hidden bg-layer-3 px-3 flex items-center rounded",i8="w-[260px]",n8=({ariaLabel:e="Breadcrumb",labelClassName:t,onItemClick:s,path:o,makeHref:i,rootItemPath:n,rootItemLabel:r,className:a,breadcrumbClassName:l,searchable:c=!0,value:d,elementId:u="fm-search",disabled:h,readonly:p,invalid:f,onSearchChange:C,searchClassName:v,searchContainerClassName:w,isCompactView:b=!1})=>{const S=g.useMemo(()=>{if(!o)return;const M=o.split("/").map(E=>E.trim()).filter(Boolean);if(!M.length)return[{label:"/"}];const k=M.map((E,P)=>{const N=M.slice(0,P+1),B=typeof i=="function"?i(N,P):void 0;return{label:E,href:B,onClick:s?O=>{O.preventDefault(),s(B)}:void 0}});if(n&&r){const E=n.split("/").filter(Boolean),P=o.split("/").filter(Boolean);if(E.every((B,O)=>P[O]===B)&&k.length>0){const B=k.slice(E.length);return[{label:r,href:n,onClick:s?O=>{O.preventDefault(),s(n)}:void 0},...B]}}return k},[o,i,s,n,r]),[y,x]=g.useState(!1),R=g.useCallback(()=>{if(!y){x(!0);const M=document.getElementById(u);M&&M.focus()}},[u,y]),F=g.useCallback(()=>{(!d||String(d).trim()==="")&&C?.("")},[d,C]),D=g.useCallback(()=>b&&y?m.jsx(De,{className:"!p-[9px]",variant:ke.Secondary,iconBefore:m.jsx(z.IconArrowLeft,{...ae}),onClick:()=>{x(!1),C?.("")}}):m.jsx("div",{className:o8,children:m.jsx(CC,{pathItems:S,ariaLabel:e,labelClassName:t,className:l})}),[e,l,S,y,b,t,C]);return m.jsxs("div",{className:ce(s8,{"gap-3":b},a),"aria-label":"navigation-panel",children:[D(),c&&m.jsx("div",{className:ce(i8,{"w-[38px]":b&&!y,"w-full":b&&y}),role:"search","aria-label":"Search",onClick:R,children:m.jsx(ou,{elementId:u,value:d??"",onChange:C,disabled:h,readonly:p,onBlur:F,invalid:f,className:v,containerClassName:ce(w,{"p-[10px]":b})})})]})};var ca=(e=>(e.MyFiles="my_files",e.Shared="shared",e.Organization="organization",e))(ca||{}),re=(e=>(e.Duplicate="duplicate",e.Copy="copy",e.Move="move",e.Download="download",e.Delete="delete",e.Rename="rename",e.Info="info",e.Unshare="unshare",e))(re||{}),at=(e=>(e.Replace="replace",e.Duplicate="duplicate",e.Cancel="cancel",e))(at||{}),It=(e=>(e.ReplaceAll="replaceAll",e.DuplicateAll="duplicateAll",e.DecideForEach="decideForEach",e))(It||{}),Ze=(e=>(e.Copy="copy",e.Move="move",e))(Ze||{}),ti=(e=>(e.Tree="tree",e.Grid="grid",e))(ti||{}),tt=(e=>(e.Name="name",e.UpdatedAt="updatedAt",e.Size="size",e.Author="author",e.Owner="owner",e.Path="path",e.Actions="__actions",e))(tt||{});const HC=()=>{const[e,t]=g.useState(og());return g.useEffect(()=>{const s=()=>t(og());return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),e},r8=({tabs:e,activeTab:t,onTabChange:s,areHiddenFilesVisible:o,onToggleHiddenFiles:i,isNewButtonVisible:n,newButtonVariant:r=ke.Secondary,newButtonDropdownItems:a=[],newButtonLabel:l="New",hiddenFilesSwitcherLabel:c="Hidden files",showHiddenFilesLabel:d="Show hidden files",hideHiddenFilesLabel:u="Hide hidden files"})=>{const h=HC(),p=g.useMemo(()=>[{key:"hidden-files-switch",label:o?u:d,icon:o?m.jsx(z.IconEyeOff,{...ae,className:"text-secondary"}):m.jsx(z.IconEye,{...ae,className:"text-secondary"}),onClick:()=>i?.(!o)}],[o,u,d,i]),f=()=>e&&t&&s?m.jsx(gC,{tabs:e,activeTab:t,onClick:w=>s(w),screenThreshold:na.Tablet,smallScreenContainerClassName:"w-fit bg-transparent h-[38px] overflow-hidden",smallScreenDropdownItemClassName:"px-3 h-[38px]"}):null,C=()=>m.jsxs(m.Fragment,{children:[m.jsx(tu,{switchId:"hidden-files-switch",label:c,isOn:o,onChange:i}),n&&m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"h-6 border-l border-primary"}),m.jsx(Zc,{label:l,variant:r,items:a})]})]}),v=()=>m.jsxs(m.Fragment,{children:[m.jsx(bt,{menu:{items:p},allowedPlacements:["bottom","bottom-start"],children:m.jsx(De,{className:"h-[38px]",iconBefore:m.jsx(z.IconDotsVertical,{...ae,className:"text-secondary hover:text-accent-primary"})})}),n?m.jsx(Zc,{label:l,variant:r,items:a}):null]});return m.jsxs("div",{className:"flex w-full justify-between gap-4 items-center overflow-x-auto",children:[m.jsx("div",{className:"flex-1 min-w-0",children:f()}),m.jsx("div",{className:"flex gap-4 flex-shrink-0 items-center",children:h?v():C()})]})},a8=12,l8=8;var Js=(e=>(e.Normal="normal",e.Reverse="reverse",e))(Js||{});function c8({actions:e,direction:t=Js.Normal,moreButtonWidth:s=ds,actionsGap:o=8,containerPadding:i=8,dependencies:n=[]}){const r=g.useRef(null),a=g.useRef(null),l=g.useRef(null),c=g.useRef(null),d=g.useRef([]),[u,h]=g.useState(e.length);g.useLayoutEffect(()=>{if(!a.current)return;const C=Array.from(a.current.children);d.current=C.map(v=>Math.ceil(v.getBoundingClientRect().width))},[e,...n]),g.useEffect(()=>{if(!r.current)return;let C=null;const v=()=>{C&&cancelAnimationFrame(C),C=requestAnimationFrame(()=>{const b=r.current,S=l.current?.offsetWidth??0,y=c.current?.offsetWidth??0,x=S+y,F=b.getBoundingClientRect().width-x-s-o*2-i*2,D=d.current;let M=0,k=0;if(t===Js.Reverse)for(let E=D.length-1;E>=0&&(M+=D[E]+o,!(M>F));E--)k++;else for(const E of D){if(M+=E+o,M>F)break;k++}h(k)})},w=new ResizeObserver(v);return w.observe(r.current),v(),()=>{C&&cancelAnimationFrame(C),w.disconnect()}},[e.length,t,...n]);const p=t===Js.Reverse?e.slice(0,e.length-u):e.slice(u);return{visibleActions:t===Js.Reverse?e.slice(e.length-u):e.slice(0,u),hiddenActions:p,refs:{containerRef:r,measureRef:a,leftSectionRef:l,rightSectionRef:c}}}const d8=({getSelectionLabel:e,onClearSelection:t,actions:s,selectedCount:o})=>{const i=HC(),{refs:{containerRef:n,leftSectionRef:r,measureRef:a},visibleActions:l,hiddenActions:c}=c8({actions:s,direction:Js.Reverse,dependencies:[i],actionsGap:a8,containerPadding:l8}),d=e(o);return m.jsxs(m.Fragment,{children:[m.jsx("div",{ref:a,className:"absolute top-0 left-0 invisible pointer-events-none overflow-hidden whitespace-nowrap flex gap-3",children:s.map(({key:u,icon:h,title:p})=>m.jsx(De,{iconBefore:h,label:p,variant:ke.Secondary,hideTitleOnMobile:!0},u))}),m.jsxs("div",{ref:n,className:"rounded bg-layer-0 p-2 flex justify-between items-center w-full",role:"toolbar","aria-label":"File bulk actions",children:[m.jsx("div",{ref:r,children:m.jsx(De,{label:d,onClick:t,textClassName:"text-accent-primary whitespace-nowrap",variant:ke.Tertiary,iconBefore:m.jsx(z.IconX,{...ae,className:"text-accent-primary"})})}),m.jsxs("div",{className:"flex flex-1 w-full gap-3 items-center justify-end",children:[c.length>0&&m.jsx(bt,{menu:{items:c},allowedPlacements:["bottom","bottom-start"],children:m.jsx(De,{className:"h-[38px]",iconBefore:m.jsx(z.IconDotsVertical,{...ae,className:"text-secondary hover:text-accent-primary"})})}),l.map(({key:u,icon:h,title:p,onClick:f,disabled:C})=>m.jsx(De,{className:"!p-[9px]",iconBefore:h,label:p,variant:ke.Secondary,hideTitleOnMobile:!0,disabled:C,onClick:v=>f?.({key:u,domEvent:v})},u))]})]})]})},nu=e=>me.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},me.createElement("path",{d:"M3.009 12.5527C2.77901 12.4216 2.5877 12.2321 2.45443 12.0034C2.32116 11.7746 2.25064 11.5147 2.25 11.25V3.75C2.25 2.925 2.925 2.25 3.75 2.25H11.25C11.8125 2.25 12.1185 2.53875 12.375 3M10.5 15.75H7.25025C6.98757 15.75 6.72747 15.6983 6.48479 15.5977C6.24211 15.4972 6.0216 15.3499 5.83586 15.1641C5.65012 14.9784 5.50278 14.7579 5.40226 14.5152C5.30174 14.2725 5.25 14.0124 5.25 13.7498V7.25025C5.25 6.71975 5.46074 6.21098 5.83586 5.83586C6.21098 5.46074 6.71975 5.25 7.25025 5.25H13.7498C14.0124 5.25 14.2725 5.30174 14.5152 5.40226C14.7579 5.50278 14.9784 5.65012 15.1641 5.83586C15.3499 6.0216 15.4972 6.24211 15.5977 6.48479C15.6983 6.72747 15.75 6.98757 15.75 7.25025V10.5M12.75 16.5L16.5 12.75M16.5 12.75V16.125M16.5 12.75H13.125",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),ru=e=>me.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},me.createElement("path",{d:"M9.75 14.25H3.75C3.35218 14.25 2.97064 14.092 2.68934 13.8107C2.40804 13.5294 2.25 13.1478 2.25 12.75V4.5C2.25 4.10218 2.40804 3.72064 2.68934 3.43934C2.97064 3.15804 3.35218 3 3.75 3H6.75L9 5.25H14.25C14.6478 5.25 15.0294 5.40804 15.3107 5.68934C15.592 5.97064 15.75 6.35218 15.75 6.75V9.75M12 16.5L15.75 12.75M15.75 12.75V16.125M15.75 12.75H12.375",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),u8=e=>{const[t,s]=g.useState(e?.showHiddenFiles??!1),o=!!e?.onShowHiddenFilesChange,i=o?e.showHiddenFiles??!1:t,n=g.useCallback(a=>{o?e?.onShowHiddenFilesChange?.(a):s(a)},[o,e]),r=g.useCallback(()=>{const a=!i;o?e?.onShowHiddenFilesChange?.(a):s(a)},[i,o,e]);return{areHiddenFilesVisible:i,toggleHiddenFilesVisibility:r,setAreHiddenFilesVisible:n}},h8=e=>{const[t,s]=g.useState(e?.collapsed??!1),o=!!e?.onCollapseChange,i=o?e.collapsed??!1:t,n=g.useCallback(a=>{o?e?.onCollapseChange?.(a):s(a)},[o,e]),r=g.useCallback(()=>{const a=!i;o?e?.onCollapseChange?.(a):s(a)},[i,o,e]);return{isTreeCollapsed:i,toggleTreeCollapse:r,setIsTreeCollapsed:n}},pg=(e,t)=>{if(!t.has(e))return e;const s=e.lastIndexOf("."),o=s>0,i=o?e.substring(0,s):e,n=o?e.substring(s):"";let r=1,a;do a=`${i} (${r})${n}`,r++;while(t.has(a));return a},rc=e=>e.name,GC=({getDestinationFiles:e,onResolve:t})=>{const[s,o]=g.useState([]),[i,n]=g.useState(!1),[r,a]=g.useState(null),l=g.useRef(!1),c=g.useCallback(b=>{l.current=!0,o(b),n(!0)},[]),d=g.useCallback(()=>{l.current=!1,n(!1),o([]),a(null)},[]),u=g.useCallback((b,S)=>{const y=e(b),x=new Set(y.map(rc)),R=S.filter(F=>x.has(F.name));return{hasConflicts:R.length>0,conflicts:R}},[e]),h=g.useCallback((b,S,y,x)=>{const R=e(b),F=new Set(R.map(rc));return S.map(D=>{const M=D.name,k=F.has(M),E=y&&k?M:pg(M,F);return(!y||!k)&&F.add(E),{sourceUrl:D.path,destinationUrl:`${b}/${E}`,overwrite:y&&k,nodeType:D.nodeType??Me.ITEM,...x??{}}})},[e]),p=g.useCallback((b,S,y,x)=>{const R=e(b),F=new Set(R.map(rc));return S.filter(M=>y.get(M.path)!==at.Cancel).map(M=>{const k=y.get(M.path),E=F.has(M.name),P=k===at.Replace&&E,N=P?M.name:pg(M.name,F);return P||F.add(N),{sourceUrl:M.path,destinationUrl:`${b}/${N}`,overwrite:P,nodeType:M.nodeType??Me.ITEM,...x??{}}})},[e]),f=g.useCallback((b,S,y)=>{const x=u(b,S);return x.hasConflicts&&(a({files:S,destinationFolder:b,metadata:y}),c(x.conflicts)),x},[u,c]),C=g.useCallback(()=>{if(!r)return;const{files:b,destinationFolder:S,metadata:y}=r,x=h(S,b,!0,y);t?.(x,S),d()},[r,h,t,d]),v=g.useCallback(()=>{if(!r)return;const{files:b,destinationFolder:S,metadata:y}=r,x=h(S,b,!1,y);t?.(x,S),d()},[r,h,t,d]),w=g.useCallback(b=>{if(!r)return;const{files:S,destinationFolder:y,metadata:x}=r,R=new Map(b.map(D=>[D.file.path,D.action])),F=p(y,S,R,x);t?.(F,y),d()},[r,p,t,d]);return{conflictingFiles:s,conflictResolutionOpen:i,hasActiveConflictRef:l,checkForConflicts:u,startConflictResolution:f,resolveConflictsWithStrategy:h,resolveConflictsWithDecisions:p,openConflictResolution:c,closeConflictResolution:d,handleReplaceAll:C,handleDuplicateAll:v,handleDecideForEach:w}},g8=({getDestinationFiles:e,onCopyFiles:t,onMoveToFiles:s,onCopySuccess:o,onMoveSuccess:i,onDuplicateSuccess:n,getCopyHeader:r,getMoveHeader:a})=>{const[l,c]=g.useState(!1),[d,u]=g.useState([]),[h,p]=g.useState([]),[f,C]=g.useState(Ze.Copy),[v,w]=g.useState(null),{conflictingFiles:b,conflictResolutionOpen:S,hasActiveConflictRef:y,startConflictResolution:x,resolveConflictsWithStrategy:R,closeConflictResolution:F,openConflictResolution:D,handleReplaceAll:M,handleDuplicateAll:k,handleDecideForEach:E}=GC({getDestinationFiles:e,onResolve:(ee,ge)=>{v?.type===Ze.Copy?(t?.(ee,ge),o?.()):v?.type===Ze.Move&&v.sourceFolder&&(s?.(ee,v.sourceFolder,ge),i?.())}}),P=g.useCallback(()=>{u([]),p([]),w(null)},[]),N=g.useCallback(ee=>{const ge=x(ee,d,{type:Ze.Copy});if(w({type:Ze.Copy}),!ge.hasConflicts){const H=R(ee,d,!1);t?.(H,ee),o?.(),P()}},[d,x,R,t,o,P]),B=g.useCallback((ee,ge)=>{const H=ge||(v?.sourceFolder??"/");if(!x(ee,h,{type:Ze.Move,sourceFolderPath:H}).hasConflicts){const U=R(ee,h,!0);s?.(U,H,ee),i?.(),P()}},[h,x,R,s,i,P,v]),O=g.useCallback(()=>{M(),P()},[M,P]),J=g.useCallback(()=>{k(),P()},[k,P]),te=g.useCallback(ee=>{E(ee),P()},[E,P]),L=g.useCallback(ee=>{const ge=ee.at(0)?.parentPath??"/",H=R(ge,ee,!1);t?.(H,ge),n?.()},[t,n,R]),le=g.useCallback(ee=>{C(ee),c(!0)},[]),V=g.useCallback(()=>{c(!1),y.current||P()},[P,y]),[Q,X]=g.useState(),$=g.useCallback(ee=>{u(ee),r&&ee.length>0?X(r(ee.length,ee[0]?.name)):X(void 0)},[r]),q=g.useCallback(ee=>{p(ee),w({type:Ze.Move,sourceFolder:ee[0]?.folderId}),a&&ee.length>0?X(a(ee.length,ee[0]?.name)):X(void 0)},[a,w]);return{handleDuplicate:L,handleCloseDestinationFolderPopup:V,handleOpenDestinationFolderPopup:le,handleCopyTo:N,handleMoveTo:B,openDestinationFolderPopup:l,destinationFolderMode:f,destinationFolderTitle:Q,handleSetCopiedFiles:$,handleSetMovedFiles:q,clearState:P,conflictingFiles:b,conflictResolutionOpen:S,openConflictResolution:D,closeConflictResolution:F,handleConflictReplace:O,handleConflictDuplicate:J,handleConflictDecideForEach:te}},p8=({path:e,defaultPath:t,onPathChange:s,onSelectionClear:o})=>{const i=e!==void 0,[n,r]=g.useState(t),a=i?e:n,l=g.useCallback(d=>{i||r(d),s?.(d)},[i,s]),c=g.useCallback(d=>{l(d),o?.()},[l,o]);return{currentPath:a,setCurrentPath:l,handlePathChange:c}},f8=({onDeleteFiles:e,onDeleteSuccess:t})=>{const[s,o]=g.useState(!1),[i,n]=g.useState([]),[r,a]=g.useState(""),l=g.useCallback((u,h)=>{n(u),a(h),o(!0)},[]),c=g.useCallback(()=>{o(!1),n([])},[]),d=g.useCallback(()=>{if(e&&i.length>0){const u=i.map(h=>({sourceUrl:h.path,nodeType:h.nodeType}));e(u,r),t?.()}c()},[i,e,t,c,r]);return{deleteConfirmationOpen:s,itemsToDelete:i,openDeleteConfirmation:l,closeDeleteConfirmation:c,confirmDelete:d}},m8=({onDownloadFiles:e,onDownloadSuccess:t})=>({handleDownloadFiles:g.useCallback(o=>{e&&o.length>0&&(e(o),t?.())},[e,t])}),C8=e=>"dataTransfer"in e&&e.dataTransfer!==null,v8=({onUploadFiles:e,onValidateUpload:t,maxFileSize:s,allowedFileTypes:o,validationMessages:i={},onUploadArchive:n}={})=>{const[r,a]=g.useState(!1),[l,c]=g.useState(!1),[d,u]=g.useState(),h=g.useRef(null),p=g.useRef(""),f=g.useRef([]),[C,v]=g.useState(new Map),[w,b]=g.useState(null),S=g.useCallback(I=>!o||o.includes("*/*")?I:I.filter(({fileContent:U,name:W})=>LC(o,U.type,W)),[o]),{conflictingFiles:y,conflictResolutionOpen:x,hasActiveConflictRef:R,startConflictResolution:F,closeConflictResolution:D,openConflictResolution:M,handleReplaceAll:k,handleDuplicateAll:E,handleDecideForEach:P}=GC({getDestinationFiles:()=>f.current,onResolve:(I,U)=>{if(!w)return;const W=I.map(ue=>{const ie=C.get(ue.sourceUrl);if(!ie)return;const Ce=ue.destinationUrl.split("/").pop();return{fileContent:ie.fileContent,name:Ce}}).filter(Boolean);W.length>0&&e?.(W,U),N()}}),N=g.useCallback(()=>{v(new Map),b(null)},[]);g.useEffect(()=>{let I=0;const U=Ce=>{C8(Ce)&&Ce.dataTransfer.types.includes(_A)&&(I++,c(!0))},W=()=>{I--,I===0&&c(!1)},ue=()=>{I=0,c(!1)},ie=Ce=>{Ce.preventDefault()};return window.addEventListener("dragenter",U),window.addEventListener("dragleave",W),window.addEventListener("drop",ue),window.addEventListener("dragover",ie),()=>{window.removeEventListener("dragenter",U),window.removeEventListener("dragleave",W),window.removeEventListener("drop",ue),window.removeEventListener("dragover",ie)}},[]);const B=g.useCallback(I=>s?I.filter(U=>U.fileContent.size>s).map(U=>U.name):[],[s]),O=g.useCallback((I,U)=>I.map(W=>({id:W.name,name:W.name,folderId:U,path:W.name,nodeType:Me.ITEM,parentPath:U,contentLength:W.fileContent.size})),[]),J=g.useCallback(async(I,U,W)=>{u(void 0),f.current=W;const ue=B(I);if(ue.length>0){const Pe=s?(s/1048576).toFixed(2):0,de=i.oversizedFiles||`Files exceed maximum size (${Pe}MB): ${ue.join(", ")}`;return u(de),!1}if(t)try{const Pe=await t(I,W,U);if(!Pe.valid)return u(Pe.message||i.validationFailed||"Validation failed"),!1}catch{return u(i.validationError||"Validation error occurred"),!1}const ie=new Map(I.map(Pe=>[Pe.name,Pe]));v(ie);const Ce=O(I,U);return b({destinationFolder:U}),F(U,Ce,{destinationFolder:U}).hasConflicts?!1:(e?.(I,U),N(),!0)},[e,t,B,s,i,O,F,N]),te=g.useCallback(()=>{k(),N()},[k,N]),L=g.useCallback(()=>{E(),N()},[E,N]),le=g.useCallback(I=>{P(I),N()},[P,N]),V=g.useCallback(()=>{D(),R.current||N()},[D,R,N]),Q=g.useCallback(I=>{I.preventDefault(),I.stopPropagation(),I.dataTransfer.types.includes("Files")&&a(!0)},[]),X=g.useCallback(I=>{I.preventDefault(),I.stopPropagation();const U=I.currentTarget.getBoundingClientRect(),W=I.clientX,ue=I.clientY;(W<=U.left||W>=U.right||ue<=U.top||ue>=U.bottom)&&a(!1)},[]),$=g.useCallback(I=>{I.preventDefault(),I.stopPropagation(),I.dataTransfer.types.includes("Files")&&(I.dataTransfer.dropEffect="copy")},[]),q=g.useCallback(async(I,U,W)=>{if(I.preventDefault(),I.stopPropagation(),a(!1),!I.dataTransfer.types.includes("Files"))return;const ue=Array.from(I.dataTransfer.files);if(ue.length===0)return;const ie=ue.map(ve=>({fileContent:ve,name:ve.name})),Ce=S(ie);if(Ce.length===0){u(i.unsupportedFiles||"Selected files are not supported");return}await J(Ce,U,W)},[J,S,i]);g.useEffect(()=>{let I=h.current;I||(I=document.createElement("input"),I.type="file",I.multiple=!0,I.style.display="none",document.body.appendChild(I),h.current=I),o&&o.length>0?I.accept=o.join(","):I.removeAttribute("accept");const U=async()=>{if(!I?.files?.length)return;const ue=Array.from(I.files).map(Ce=>({fileContent:Ce,name:Ce.name})),ie=S(ue);if(ie.length===0){u(i.unsupportedFiles||"Selected files are not supported"),I.value="";return}await J(ie,p.current,f.current),I.value=""};return I.addEventListener("change",U),()=>{I&&(I.removeEventListener("change",U),h.current===I&&(document.body.removeChild(I),h.current=null))}},[o,S,J,i]);const ee=g.useCallback((I,U)=>{p.current=I,f.current=U,h.current&&h.current.click()},[]),ge=g.useCallback((I,U)=>{if(!n)return;const W=document.createElement("input");W.type="file",W.accept=".zip,application/zip",W.multiple=!1,W.style.display="none";const ue=()=>{const ie=W.files?.[0];if(!ie){document.body.removeChild(W);return}const Ce=ie.name.replace(/\.zip$/i,"");if(U.some(Pe=>Pe.nodeType===Me.FOLDER&&Pe.name.toLowerCase()===Ce.toLowerCase())){u(i.validationFailed||`Folder with name "${Ce}" already exists`),document.body.removeChild(W);return}try{n(ie,Ce,I)}finally{document.body.removeChild(W)}};W.addEventListener("change",ue),document.body.appendChild(W),W.click()},[n,i]),H=g.useCallback(()=>{u(void 0)},[]);return{isDragging:r,isDraggingOverWindow:l,uploadError:d,handleDragEnter:Q,handleDragLeave:X,handleDragOver:$,handleDrop:q,clearError:H,handleUpload:J,openFileDialog:ee,openArchiveDialog:ge,fileInputRef:h,uploadConflictingFiles:y,uploadConflictResolutionOpen:x,hasActiveUploadConflictRef:R,openUploadConflictResolution:M,closeUploadConflictResolution:V,handleUploadConflictReplace:te,handleUploadConflictDuplicate:L,handleUploadConflictDecideForEach:le}},BC=g.createContext(void 0),w8={emptyName:"Name cannot be empty",duplicateName:"An item with this name already exists"};function b8(e){let t=e.length;for(;t>0&&e[t-1]==="/";)t--;return e.slice(0,t)}function S8(e,t){const s=b8(e),o=s.lastIndexOf("/");return o===-1?t:s.slice(0,o+1)+t}function y8(e){const t=e.lastIndexOf(".");return t===-1||t===0?e:e.substring(0,t)}function fg(e){const t=e.lastIndexOf(".");return t===-1||t===0?"":e.substring(t)}const x8=({items:e,onRenameValidate:t,validationMessages:s,onMoveToFiles:o})=>{const[i,n]=g.useState(),r=g.useMemo(()=>({...w8,...s}),[s]),a=g.useMemo(()=>i?.path,[i]),l=g.useCallback(p=>{const f=vo(e,p);f&&n(f)},[e]),c=g.useCallback(()=>{n(void 0)},[]),d=g.useCallback(p=>{if(!i||!o){n(void 0);return}const f=i.nodeType===Me.ITEM;let C=p.trim();if(f){const S=fg(i.name);S&&!C.endsWith(S)&&(C=C+S)}if(C===i.name){n(void 0);return}const v=S8(i.path,C),w=i.parentPath;if(!w){n(void 0);return}const b={sourceUrl:i.path,destinationUrl:v,nodeType:i.nodeType};o([b],w,w),n(void 0)},[i,o]),u=g.useCallback((p,f)=>{const C=p.trim();if(!C)return r.emptyName;const v=f.nodeType===Me.ITEM;let w=C;if(v){const S=fg(f.name);S&&!w.endsWith(S)&&(w=w+S)}const b=f.parentPath;if(b){const S=vo(e,b);if(S&&new Set((S.items??[]).filter(x=>x.path!==f.path).map(x=>x.name.toLowerCase())).has(w.toLowerCase()))return r.duplicateName}if(t){const S=t(w,f);if(S)return S}return null},[t,r,e]),h=g.useCallback(p=>p.nodeType===Me.ITEM?y8(p.name):p.name,[]);return{renamedPath:a,renamedItem:i,renameHandler:l,renameSaveHandler:d,renameCancelHandler:c,renameValidateHandler:u,getDisplayName:h}},R8=({newActionLabels:e,onUploadFiles:t,onCreateFolder:s,onUploadArchive:o})=>{const i=g.useMemo(()=>{const r=[];return e&&(e.newFolder&&r.push({key:"new-folder",label:e.newFolder,icon:m.jsx(z.IconFolder,{...ae,className:"text-secondary"}),onClick:()=>{s&&s()}}),e.uploadFiles&&r.push({key:"upload-file",label:e.uploadFiles,icon:m.jsx(z.IconFile,{...ae,className:"text-secondary"}),onClick:()=>{t&&t()}}),e.uploadArchive&&r.push({key:"upload-archive",label:e.uploadArchive,icon:m.jsx(z.IconFileZip,{...ae,className:"text-secondary"}),onClick:()=>{o&&o()}})),r},[e,t,s,o]),n=g.useMemo(()=>i.length>0,[i]);return{newActions:i,isNewButtonVisible:n}},F8={emptyName:"Folder name cannot be empty",duplicateName:"A folder with this name already exists"},E8=({currentFolder:e,onCreateFolder:t,onValidateFolderName:s,validationMessages:o})=>{const[i,n]=g.useState(!1),[r,a]=g.useState(null),l=g.useRef(e?.path),c=g.useMemo(()=>({...F8,...o}),[o]);g.useEffect(()=>{const f=e?.path;l.current!==f&&i&&(n(!1),a(null)),l.current=f},[e?.path,i]);const d=g.useCallback(()=>{const f=`__new_folder_${Date.now()}`;a(f),n(!0)},[]),u=g.useCallback(()=>{n(!1),a(null)},[]),h=g.useCallback(f=>{const C=f.trim();if(!C)return c.emptyName;if(e&&new Set((e.items??[]).filter(w=>w.nodeType===Me.FOLDER).map(w=>w.name.toLowerCase())).has(C.toLowerCase()))return c.duplicateName;if(s&&e){const v=s(C,e);if(v)return v}return null},[e,s,c]),p=g.useCallback(async f=>{const C=f.trim();if(!C)return;const w=`${e?.path??"/"}/${C}`,b=`${w}/${ic}`,y={fileContent:new File([],ic,{type:"text/plain"}),name:ic};t&&await t(y,w,b),u()},[e,t,u]);return{isCreatingFolder:i,newFolderTempId:r,startFolderCreation:d,cancelFolderCreation:u,saveFolderCreation:p,validateFolderName:h}},D8=({additionalButtons:e,expandedPathsLength:t,collapseAll:s})=>{const o=t===0;return{additionalButtons:g.useMemo(()=>{const n=ce(["hover:text-accent-primary p-1",o&&"text-controls-disable hover:text-controls-disable disabled:hover:cursor-default"]);return m.jsxs(m.Fragment,{children:[e,m.jsx(De,{disabled:o,className:n,onClick:s,iconBefore:m.jsx(z.IconCopyMinus,{size:24,stroke:1.5}),"aria-label":"collapse-all"})]})},[e,o,s])}},P8=({onGetInfo:e})=>{const[t,s]=g.useState(!1),[o,i]=g.useState(void 0),n=g.useCallback(async a=>{i(a),s(!0),e&&await e(a)},[e]),r=g.useCallback(()=>{s(!1),i(void 0)},[]);return{isMetadataPopupOpen:t,selectedFileForMetadata:o,openMetadataPopup:n,closeMetadataPopup:r}};function M8(e){const t=[];function s(o){for(const i of o)t.push(i),i.items&&s(i.items)}return s(e),t}function mg(e,t){const s=ei(t);return e.filter(o=>ei(o.name).includes(s))}function T8({onSearchFiles:e,clearSearchResults:t,currentPath:s,searchResults:o=[],searchInProgress:i=!1,navigationPanelValue:n,onNavigationPanelSearchChange:r,allItems:a=[]}){const[l,c]=g.useState(""),d=g.useRef(!1),u=g.useRef(!1),h=g.useRef([]),p=g.useRef(s);g.useEffect(()=>{n!=null&&c(String(n))},[n]);const f=String(n??l??"").trim(),C=u.current&&(i||o.length>0||f!==""),v=g.useCallback(y=>{const x=y.trim();if(!x){u.current=!1,d.current=!1;return}u.current=!0,e&&s&&!d.current&&(d.current=!0,e(s,x))},[e,s]),w=g.useCallback(()=>{d.current=!1,u.current=!1,h.current=[],c(""),r?.(""),t?.()},[t,r]),b=g.useCallback(y=>{const x=String(y??"");c(x),r?.(x),x.trim()?v(x):w()},[r,v,w]);g.useEffect(()=>{p.current!==s&&(p.current=s,(u.current||f)&&w())},[s,w,f]),g.useEffect(()=>{o.length>0&&h.current.length===0&&(h.current=o)},[o]);const S=g.useMemo(()=>{if(e){const x=h.current.length>0?h.current:o;return!f||x.length===0?x:mg(x,f)}if(!f||!a.length)return[];const y=M8(a);return mg(y,f)},[e,o,f,a]);return{isSearchMode:C,searchValue:l,effectiveSearchValue:f,setSearchValue:c,handleSearchChange:b,handleSearchActivate:v,handleSearchClear:w,searchResultsRows:S}}function I8({selectedPaths:e,defaultSelectedPaths:t,onSelectedPathsChange:s}){const o=e!==void 0,[i,n]=g.useState(()=>t??new Set),r=g.useMemo(()=>o?e:i,[o,e,i]),a=g.useCallback(c=>{const d=new Set(c);s?.(d),o||n(d)},[o,s]),l=g.useCallback(()=>{a(new Set)},[a]);return{selectedPaths:r,setSelectedPaths:a,clearSelection:l,isControlled:o}}const VC=({children:e,className:t,items:s=[],rootItem:o,path:i,defaultPath:n,filesLoading:r,selectedPaths:a,defaultSelectedPaths:l,onSelectedPathsChange:c,showHiddenFiles:d,onShowHiddenFilesChange:u,treeOptions:h,navigationPanelOptions:p,deleteConfirmationOptions:f,gridOptions:C,toolbarOptions:v,bulkActionsToolbarOptions:w,destinationFolderPopupOptions:b,conflictResolutionPopupOptions:S,onPathChange:y,onTableFileClick:x,onCopyFiles:R,onMoveToFiles:F,onDeleteFiles:D,onDownloadFiles:M,onRenameValidate:k,renameValidationMessages:E,onUploadFiles:P,onValidateUpload:N,uploadValidationMessages:B,maxFileSize:O,onUploadArchive:J,onCreateFolder:te,onCreateFolderValidate:L,folderCreationValidationMessages:le,fileMetadataPopupOptions:V,onGetInfo:Q,onUnshareFile:X,actionsRef:$,sharedByMePaths:q,onSearchFiles:ee,searchResults:ge,searchInProgress:H,clearSearchResults:I,allowedFileTypes:U})=>{const{selectedPaths:W,clearSelection:ue,setSelectedPaths:ie}=I8({selectedPaths:a,defaultSelectedPaths:l,onSelectedPathsChange:c}),Ce=g.useMemo(()=>{const Ae=new Map;return W.forEach(yt=>{const Kt=vo(s,yt);Kt&&Ae.set(yt,Kt)}),Ae},[W,s]),{currentPath:ve,setCurrentPath:Pe,handlePathChange:de}=p8({path:i,defaultPath:n,onPathChange:y,onSelectionClear:ue}),[ye,_]=g.useState(),we=b?.destinationFolderPath??ye,pe=g.useCallback(Ae=>{b?.setDestinationFolderPath?b.setDestinationFolderPath(Ae):_(Ae)},[b]),{areHiddenFilesVisible:xe,toggleHiddenFilesVisibility:qe}=u8({showHiddenFiles:d,onShowHiddenFilesChange:u}),{isTreeCollapsed:Mt,toggleTreeCollapse:je,setIsTreeCollapsed:Wt}=h8({collapsed:h?.collapsed,onCollapseChange:h?.onCollapseChange}),{renamedPath:Eo,renamedItem:Do,renameHandler:Le,renameSaveHandler:et,renameCancelHandler:mi,renameValidateHandler:In,getDisplayName:Aa}=x8({items:s,onRenameValidate:k,validationMessages:E,onMoveToFiles:F}),{isSearchMode:Ci,searchValue:La,effectiveSearchValue:vi,setSearchValue:Oa,handleSearchChange:Na,searchResultsRows:kn}=T8({onSearchFiles:ee,clearSearchResults:I,currentPath:ve,searchResults:ge,searchInProgress:H,navigationPanelValue:p?.value,onNavigationPanelSearchChange:p?.onSearchChange,allItems:s}),St=g.useMemo(()=>gg(s,ve)??s[0],[s,ve]),{handleCopyTo:Ha,handleMoveTo:Ga,handleDuplicate:Ba,handleOpenDestinationFolderPopup:Va,handleCloseDestinationFolderPopup:za,openDestinationFolderPopup:mt,handleSetCopiedFiles:Wa,handleSetMovedFiles:_a,destinationFolderMode:ja,destinationFolderTitle:wi,conflictingFiles:Ua,conflictResolutionOpen:$a,closeConflictResolution:An,handleConflictReplace:Ka,handleConflictDuplicate:Ln,handleConflictDecideForEach:On}=g8({getDestinationFiles:Ae=>gg(s,Ae)?.items??[],onCopyFiles:R,onMoveToFiles:F,onCopySuccess:ue,onMoveSuccess:ue,onDuplicateSuccess:ue,getCopyHeader:b?.getCopyHeader,getMoveHeader:b?.getMoveHeader});g.useEffect(()=>{mt&&!we&&pe(ve??o?.path??"/")},[mt,we,ve,o?.path,pe]),g.useEffect(()=>{mt||pe(void 0)},[mt,pe]);const{deleteConfirmationOpen:Nn,itemsToDelete:Hn,openDeleteConfirmation:Po,closeDeleteConfirmation:Gn,confirmDelete:bi}=f8({onDeleteFiles:D,onDeleteSuccess:ue}),{handleDownloadFiles:qa}=m8({onDownloadFiles:M,onDownloadSuccess:ue}),{isDragging:Bn,isDraggingOverWindow:Si,uploadError:Ya,handleDragEnter:yi,handleDragLeave:Vn,handleDragOver:xi,handleDrop:Mo,clearError:zn,openFileDialog:Ri,fileInputRef:Za,openArchiveDialog:Xe,uploadConflictingFiles:Wn,uploadConflictResolutionOpen:Fi,closeUploadConflictResolution:Xa,handleUploadConflictReplace:_n,handleUploadConflictDuplicate:Qa,handleUploadConflictDecideForEach:Ja}=v8({onUploadFiles:P,onValidateUpload:N,maxFileSize:O,onUploadArchive:J,allowedFileTypes:U,validationMessages:B}),el=g.useCallback(Ae=>{const yt=ve??"",Kt=St?.items??[];Mo(Ae,yt,Kt)},[ve,St,Mo]),Ei=g.useCallback(()=>{const Ae=ve??"",yt=St?.items??[];Ri(Ae,yt)},[ve,St,Ri]),tl=g.useCallback(()=>{const Ae=ve??"",yt=St?.items??[];Xe(Ae,yt)},[ve,St,Xe]),{isCreatingFolder:Di,newFolderTempId:xs,startFolderCreation:Pi,cancelFolderCreation:Mi,saveFolderCreation:jn,validateFolderName:Un}=E8({currentFolder:St,onCreateFolder:te,onValidateFolderName:L,validationMessages:le}),{newActions:sl,isNewButtonVisible:j}=R8({newActionLabels:v?.newActionLabels,onUploadFiles:Ei,onUploadArchive:tl,onCreateFolder:Pi}),Fe=g.useMemo(()=>{if(Ci){const Be=kn;return xe?Be.map(ut=>({id:ut.id??ut.path,name:ut.name??ut.path.split("/").pop()??"",updatedAt:ut.updatedAt,size:ut.nodeType===Me.ITEM?Tr(ut.contentLength):"",author:ut.author,path:ut.path,nodeType:ut.nodeType,extension:ut.extension,isTemporary:!1,owner:ut.owner})):Be.filter(nt=>!Xc(nt)).map(nt=>({id:nt.id??nt.path,name:nt.name??nt.path.split("/").pop()??"",updatedAt:nt.updatedAt,size:nt.nodeType===Me.ITEM?Tr(nt.contentLength):"",author:nt.author,path:nt.path,nodeType:nt.nodeType,extension:nt.extension,isTemporary:!1,owner:nt.owner}))}const Ae=ei(vi).trim(),yt=St?.items??[];let Kt=Ae?YA(St):yt;xe||(Kt=Kt.filter(Be=>!Xc(Be)));const cl=Kt.map(Be=>({id:Be.id??Be.path,name:Be.name??Be.path.split("/").pop()??"",updatedAt:Be.updatedAt,size:Be.nodeType===Me.ITEM?Tr(Be.contentLength):"",author:Be.author,path:Be.path,nodeType:Be.nodeType,extension:Be.extension,isTemporary:!1,owner:Be.owner,contentType:Be.contentType}));if(Di&&xs&&!Ae&&cl.unshift({id:xs,name:"",updatedAt:void 0,size:"",author:void 0,path:xs,nodeType:Me.FOLDER,extension:void 0,isTemporary:!0,owner:void 0}),!Ae)return cl;const $C=Ae.split(/\s+/).filter(Boolean);return cl.filter(Be=>{if(Be.isTemporary)return!0;const ut=ei(Be.name),nt=ei(Be.author),KC=qA(Be.extension);return $C.every(dl=>ut.includes(dl)||nt.includes(dl)||KC.includes(dl))})},[Ci,kn,St,vi,xe,Di,xs]),Rs=g.useCallback(Ae=>{de(Ae.path)},[de]),Fs=g.useCallback(Ae=>{de(Ae)},[de]),Ti=g.useCallback(Ae=>{Ae.nodeType===Me.FOLDER?de(Ae.path):x?.(Ae)},[de,x]),{expandedPaths:$n,setExpandedPaths:ol,collapseAll:js}=NC({expandedPaths:h?.expandedPaths,onExpandedPathsChange:h?.onExpandedPathsChange}),{additionalButtons:il}=D8({collapseAll:js,expandedPathsLength:$n.size,additionalButtons:h?.additionalButtons}),{isMetadataPopupOpen:nl,selectedFileForMetadata:Ii,openMetadataPopup:rl,closeMetadataPopup:Kn}=P8({onGetInfo:Q}),al=g.useCallback(()=>{Kn(),V?.clearMetadata?.()},[Kn,V]),ll={className:t,items:s,allowedFileTypes:U,rootItem:o,filesLoading:r,treeOptions:{...h,expandedPaths:$n,onExpandedPathsChange:ol,additionalButtons:il},navigationPanelOptions:p,gridOptions:C,toolbarOptions:v,bulkActionsToolbarOptions:w,deleteConfirmationOptions:f,destinationFolderPopupOptions:{...b,destinationFolderPath:we,setDestinationFolderPath:pe,header:wi,onCreateFolder:te,onCreateFolderValidate:L,folderCreationValidationMessages:le},currentPath:ve,setCurrentPath:Pe,searchValue:La,effectiveSearchValue:vi,setSearchValue:Oa,areHiddenFilesVisible:xe,toggleHiddenFilesVisibility:qe,isTreeCollapsed:Mt,toggleTreeCollapse:je,setIsTreeCollapsed:Wt,selectedPaths:W,selectedFiles:Ce,setSelectedPaths:ie,clearSelection:ue,currentFolder:St,gridRows:Fe,handleCopyTo:Ha,handleMoveTo:Ga,handleDuplicate:Ba,handleSetCopiedFiles:Wa,handleSetMovedFiles:_a,openDestinationFolderPopup:mt,handleCloseDestinationFolderPopup:za,handleOpenDestinationFolderPopup:Va,destinationFolderMode:ja,handleDownloadFiles:qa,renamedPath:Eo,renamedItem:Do,onRename:Le,onRenameSave:et,onRenameCancel:mi,onRenameValidate:In,getDisplayName:Aa,openDeleteConfirmation:Po,closeDeleteConfirmation:Gn,confirmDelete:bi,deleteConfirmationOpen:Nn,itemsToDelete:Hn,handlePathChange:de,handleTreeItemClick:Rs,handleBreadcrumbItemClick:Fs,handleSearchChange:Na,handleTableRowClick:Ti,onTableFileClick:x,isDragging:Bn,uploadError:Ya,handleDragEnter:yi,handleDragLeave:Vn,handleDragOver:xi,handleDrop:el,clearUploadError:zn,onUploadFiles:P,onValidateUpload:N,maxFileSize:O,isDraggingOverWindow:Si,openFileDialog:Ei,fileInputRef:Za,newActions:sl,isNewButtonVisible:j,isCreatingFolder:Di,newFolderTempId:xs,startFolderCreation:Pi,cancelFolderCreation:Mi,saveFolderCreation:jn,validateFolderName:Un,conflictResolutionPopupOptions:S,conflictingFiles:Ua,conflictResolutionOpen:$a,closeConflictResolution:An,handleConflictReplace:Ka,handleConflictDuplicate:Ln,handleConflictDecideForEach:On,uploadConflictingFiles:Wn,uploadConflictResolutionOpen:Fi,closeUploadConflictResolution:Xa,handleUploadConflictReplace:_n,handleUploadConflictDuplicate:Qa,handleUploadConflictDecideForEach:Ja,fileMetadataPopupOptions:V,isMetadataPopupOpen:nl,selectedFileForMetadata:Ii,openMetadataPopup:rl,closeMetadataPopup:al,onGetInfo:Q,onUnshareFile:X,actionsRef:$,sharedByMePaths:q,onSearchFiles:ee,searchInProgress:H,searchResults:ge,clearSearchResults:I,isSearchMode:Ci};return m.jsx(BC.Provider,{value:ll,children:e})},zC=()=>{const e=g.useContext(BC);if(!e)throw new Error("useFileManagerContext must be used within <FileManagerProvider>");return e},k8="en-US",A8={year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"},L8="text-primary";function WC(e){if(!e)return null;if(e instanceof Date)return isFinite(e.getTime())?e:null;if(typeof e=="number"){const t=new Date(e);return isFinite(t.getTime())?t:null}if(typeof e=="string"){const t=e.trim();if(/^-?\d+$/.test(t)){const o=Number(t);return WC(o)}const s=new Date(t);return isFinite(s.getTime())?s:null}return null}const _C=({value:e,locale:t=k8,options:s=A8,emptyPlaceholder:o,className:i})=>{const n=WC(e),r=g.useMemo(()=>n?new Intl.DateTimeFormat(t,s).format(n):o,[n,o,t,s]),a=n?n.toISOString():void 0;return m.jsx(ct,{text:a?m.jsx("time",{dateTime:a,children:r}):m.jsx("span",{children:r}),className:Z(L8,i),hideTooltip:!1})},O8=({open:e,itemsToDelete:t,onClose:s,onConfirm:o,cancelLabel:i="Cancel",confirmLabel:n="Delete",titleRenderer:r,contentRenderer:a})=>{const l=t.map(p=>p.name),d=r?.(l)||"Confirm Deleting Items",u=m.jsxs("div",{className:"px-6 py-3 dial-small",children:[m.jsx("p",{className:"text-secondary mb-3",children:t.length===1?m.jsxs(m.Fragment,{children:["Do you want to delete file or folder"," ",m.jsxs("span",{className:"text-primary break-all",children:['"',t[0].name,'"']}),"?"]}):m.jsxs(m.Fragment,{children:["Do you want to delete the following"," ",m.jsx("span",{className:"text-primary",children:t.length})," items?"]})}),t.length>1&&m.jsx(m.Fragment,{children:t.length<=10?m.jsx("ul",{className:"space-y-1 text-primary list-none",children:t.map(p=>m.jsx("li",{className:"truncate",children:p.name},p.path))}):m.jsxs(m.Fragment,{children:[m.jsx("ul",{className:"space-y-1 text-primary list-none mb-2",children:t.slice(0,10).map(p=>m.jsx("li",{className:"truncate",children:p.name},p.path))}),m.jsxs("p",{className:"text-secondary italic",children:["... and ",t.length-10," more"]})]})})]}),h=a?.(l)||u;return m.jsx(SC,{open:e,header:d,confirmLabel:n,cancelLabel:i,variant:li.Danger,onClose:s,onConfirm:o,children:h})},N8=({onClose:e,onConfirm:t,open:s,copyLabel:o="Copy",moveLabel:i="Move",addFolderLabel:n="Add folder",mode:r=Ze.Copy,hiddenFilesSwitcherLabel:a="Show hidden files",onUploadFiles:l,onValidateUpload:c,maxFileSize:d,header:u,...h})=>{const[p,f]=g.useState(!1),C=g.useRef(null),v=g.useCallback(b=>{f(b)},[]),w=r===Ze.Copy?"Copy to":"Move to";return m.jsx(Fo,{open:s,onClose:()=>{e()},size:Bt.Lg,className:"md:!h-[800px]",footer:m.jsxs("div",{className:"flex justify-between space-x-2 py-4 px-6",children:[m.jsxs("div",{className:"flex space-x-4",children:[m.jsx(De,{label:n,variant:ke.Tertiary,iconBefore:m.jsx(z.IconFolderPlus,{...ae}),onClick:()=>{C.current?.createFolder()}}),m.jsx("div",{className:"border border-l border-primary my-2"}),m.jsx("div",{className:"inline-flex items-center cursor-pointer",onClick:b=>{b.stopPropagation(),v(!p)},children:m.jsx(tu,{label:a,isOn:p,onChange:v,switchId:"hidden-files-switch"})})]}),m.jsxs("div",{className:"flex space-x-4",children:[m.jsx(De,{onClick:e,label:"Cancel",variant:ke.Secondary}),m.jsx(De,{onClick:t,label:r==="copy"?o:i,variant:ke.Primary})]})]}),header:u??w,children:m.jsx(UC,{...h,actionsRef:C,showHiddenFiles:p,onShowHiddenFilesChange:v,treeOptions:{...h.treeOptions,collapsed:!0,expandedPaths:new Set([h.rootItem?.path||"/"])},gridOptions:{withSelectionColumn:!1,...h.gridOptions},onUploadFiles:l,onValidateUpload:c,maxFileSize:d})})},H8=({selectedFiles:e,actionLabels:t,onDuplicate:s,onCopy:o,onMove:i,onDownload:n,onDelete:r,getCurrentFolderPath:a})=>g.useMemo(()=>{const l=[],c=Array.from(e.values());return!c.length||!t||(t[re.Move]&&l.push({key:re.Move,label:t[re.Move],title:t[re.Move],icon:m.jsx(ru,{width:ae.size,height:ae.size,className:"text-secondary"}),onClick:()=>i(c)}),t[re.Copy]&&l.push({key:re.Copy,label:t[re.Copy],title:t[re.Copy],icon:m.jsx(nu,{width:ae.size,height:ae.size,className:"text-secondary"}),onClick:()=>o(c)}),t[re.Duplicate]&&l.push({key:re.Duplicate,label:t[re.Duplicate],title:t[re.Duplicate],icon:m.jsx(z.IconCopy,{...ae,className:"text-secondary"}),onClick:()=>s(c)}),t[re.Delete]&&l.push({key:re.Delete,label:t[re.Delete],title:t[re.Delete],icon:m.jsx(z.IconTrashX,{...ae,className:"text-secondary"}),onClick:()=>{const d=a();r(c,d)}}),t[re.Download]&&l.push({key:re.Download,label:t[re.Download],title:t[re.Download],icon:m.jsx(z.IconDownload,{...ae,className:"text-secondary"}),onClick:()=>n(c)})),l},[e,t,s,o,i,n,r,a]),jC=e=>me.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},me.createElement("path",{d:"M4.5 15.75V14.25C4.5 13.4544 4.81607 12.6913 5.37868 12.1287C5.94129 11.5661 6.70435 11.25 7.5 11.25H9.75M15.75 12.75L12 16.5M12 16.5V13.125M12 16.5H15.375M6 5.25C6 6.04565 6.31607 6.80871 6.87868 7.37132C7.44129 7.93393 8.20435 8.25 9 8.25C9.79565 8.25 10.5587 7.93393 11.1213 7.37132C11.6839 6.80871 12 6.04565 12 5.25C12 4.45435 11.6839 3.69129 11.1213 3.12868C10.5587 2.56607 9.79565 2.25 9 2.25C8.20435 2.25 7.44129 2.56607 6.87868 3.12868C6.31607 3.69129 6 4.45435 6 5.25Z",stroke:"#7F8792",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),G8=({actionLabels:e,onDuplicate:t,onCopy:s,onMove:o,onDownload:i,onRename:n,onDelete:r,onInfo:a,onUnshare:l})=>g.useMemo(()=>c=>{const d=[];return e&&(e[re.Duplicate]&&d.push({key:re.Duplicate,label:e[re.Duplicate],icon:m.jsx(z.IconCopy,{...ae,className:"text-secondary"}),onClick:()=>t(c)}),e[re.Copy]&&d.push({key:re.Copy,label:e[re.Copy],icon:m.jsx(nu,{width:ae.size,height:ae.size,className:"text-secondary"}),onClick:()=>s(c)}),e[re.Move]&&d.push({key:re.Move,label:e[re.Move],icon:m.jsx(ru,{width:ae.size,height:ae.size,className:"text-secondary"}),onClick:()=>o(c)}),e[re.Download]&&d.push({key:re.Download,label:e[re.Download],icon:m.jsx(z.IconDownload,{...ae,className:"text-secondary"}),onClick:()=>i(c)}),e[re.Delete]&&d.push({key:re.Delete,label:e[re.Delete],icon:m.jsx(z.IconTrashX,{...ae,className:"text-secondary"}),onClick:()=>r(c,c.parentPath??"")}),e[re.Rename]&&d.push({key:re.Rename,label:e[re.Rename],icon:m.jsx(z.IconPencilMinus,{...ae,className:"text-secondary"}),onClick:()=>n(c.path)}),e[re.Info]&&c.nodeType===Me.ITEM&&d.push({key:re.Info,label:e[re.Info],icon:m.jsx(z.IconInfoCircle,{...ae,className:"text-secondary"}),onClick:()=>a(c)}),e[re.Unshare]&&d.push({key:re.Unshare,label:e[re.Unshare],icon:m.jsx(jC,{width:ae.size,height:ae.size,className:"text-secondary"}),onClick:()=>l(c)})),d},[e,t,s,o,i,n,r,a,l]),Cg=({open:e,onClose:t,onReplace:s,onDuplicate:o,onDecideForEach:i,conflictingFiles:n,singleFileTitle:r="Replace Or Duplicate Item",multipleFilesTitle:a="Replace Or Duplicate Items",message:l,actionLabels:c,strategyLabels:d,confirmLabel:u="Confirm",cancelLabel:h="Cancel",nameColumnLabel:p="Name",actionColumnLabel:f="Action"})=>{const C=n.length===1,v=C?n[0]?.name:"",w=c?.[at.Replace]??"Replace",b=c?.[at.Duplicate]??"Duplicate",S=c?.[at.Cancel]??"Cancel",y=d?.[It.ReplaceAll]??"Replace all",x=d?.[It.DuplicateAll]??"Duplicate all",R=d?.[It.DecideForEach]??"Decide for each",[F,D]=g.useState(at.Replace),[M,k]=g.useState(It.ReplaceAll),[E,P]=g.useState(new Map(n.map(q=>[q.path,at.Replace]))),[N,B]=g.useState(void 0),O=C?r:a,J=m.jsxs(m.Fragment,{children:["Item with the name ",m.jsxs("span",{className:"text-primary",children:['"',v,'"']})," ","already exists in this destination."]}),te=`${n.length} items with the same names already exist in this destination.`,L=l??(C?J:te),le=g.useMemo(()=>[{id:at.Replace,name:w},{id:at.Duplicate,name:b}],[w,b]),V=g.useMemo(()=>n.map(q=>({id:q.path,name:q.name,path:q.path,nodeType:q.nodeType??Me.ITEM,action:E.get(q.path)||at.Replace})),[n,E]),Q=g.useMemo(()=>[{field:"name",headerName:p,flex:1,minWidth:200,floatingFilter:!1,filter:!1,resizable:!1,cellRenderer:q=>q.data?.nodeType===Me.FOLDER?m.jsx(ba,{name:q.data.name,iconSize:As}):m.jsx(wa,{name:q.data.name,iconSize:As})},{field:"action",headerName:f,width:140,suppressSizeToFit:!0,sortable:!1,filter:!1,floatingFilter:!1,resizable:!1,cellRenderer:q=>{if(!q.data)return null;const ee=[{key:at.Replace,label:w,icon:m.jsx(z.IconCircleFilled,{size:10,className:"text-accent-tertiary"})},{key:at.Duplicate,label:b,icon:m.jsx(z.IconCircleFilled,{size:10,className:"text-accent-secondary"})},{key:at.Cancel,label:S,icon:m.jsx(z.IconCircleFilled,{size:10,className:"text-error"})}],ge=ee.find(I=>I.key===q.data.action),H=N===q.data.path;return m.jsx("div",{className:"flex items-center h-full",children:m.jsx(bt,{trigger:[xt.Click],open:H,menu:{items:ee,onClick:({key:I})=>{P(U=>{const W=new Map(U);return W.set(q.data.path,I),W}),B(void 0)}},placement:"bottom-start",matchReferenceWidth:!1,allowedPlacements:["bottom-start","top-start"],onOpenChange:I=>{B(I?q.data.path:void 0)},children:m.jsxs("button",{type:"button",className:"flex items-center gap-2",children:[m.jsxs("span",{className:"flex items-center gap-2",children:[ge?.icon,ge?.label??w]}),m.jsx(z.IconChevronDown,{size:16,className:Z("text-secondary transition-transform",H&&"rotate-180")})]})})})}}],[p,f,w,b,S,N]),X=g.useMemo(()=>[{id:It.ReplaceAll,name:y},{id:It.DuplicateAll,name:x},{id:It.DecideForEach,name:R,content:M===It.DecideForEach?m.jsx("div",{className:"mt-4",children:m.jsx(eu,{columnDefs:Q,rowData:V,getRowId:q=>q.id,withSelectionColumn:!1,wrapCustomCellRenderers:!1,alternateOddRowColors:!1,additionalGridOptions:{domLayout:"autoHeight"}})}):void 0}],[y,x,R,M,Q,V]),$=g.useCallback(()=>{if(C)F===at.Replace?s():o();else if(M===It.ReplaceAll)s();else if(M===It.DuplicateAll)o();else if(M===It.DecideForEach&&i){const q=n.map(ee=>({file:ee,action:E.get(ee.path)||at.Replace}));i(q)}},[C,F,M,E,n,s,o,i]);return m.jsx(Fo,{open:e,onClose:t,size:Bt.Md,header:O,dividers:!1,footer:m.jsxs("div",{className:"flex justify-end gap-3 py-4 px-6",children:[m.jsx(De,{onClick:t,label:h,variant:ke.Secondary}),m.jsx(De,{onClick:$,label:u,variant:ke.Primary})]}),children:m.jsxs("div",{className:"px-6 py-4",children:[m.jsx("p",{className:"text-secondary mb-4",children:L}),C?m.jsx(Ir,{elementId:"single-file-conflict",radioButtons:le,activeRadioButton:F,orientation:ao.Column,onChange:q=>D(q)}):m.jsx(Ir,{elementId:"multiple-files-conflict",radioButtons:X,activeRadioButton:M,orientation:ao.Column,onChange:q=>k(q),formItemChildrenClassName:"gap-3"})]})})},B8=({id:e,name:t,nodeType:s,size:o,updatedAt:i,dateLocale:n,dateOptions:r,shared:a})=>m.jsx("div",{className:"flex",children:m.jsx("div",{className:"flex flex-1 min-w-0",children:m.jsx(la,{type:s===Me.FOLDER?Vt.Folder:Vt.File,name:t,elementId:e,shared:a,iconSize:As,details:m.jsxs("div",{className:"flex items-center gap-1 dial-tiny text-secondary",children:[m.jsx("span",{children:o}),i&&o&&m.jsx(z.IconCircleFilled,{size:2,className:"text-secondary"}),i?m.jsx("span",{children:m.jsx(_C,{value:i,locale:n?.toString(),options:r,className:"dial-tiny text-secondary"})}):null]})})})});function V8(e){const t=g.useRef(null),[s,o]=g.useState(!1);return g.useEffect(()=>{if(!t.current)return;const i=new ResizeObserver(([n])=>{const r=n.contentRect.width;o(r<e)});return i.observe(t.current),()=>i.disconnect()},[e]),{containerRef:t,isBelowBreakpoint:s}}const z8=({getContextMenuItems:e,isRowDisabled:t,allowedFileTypes:s})=>{const o=g.useCallback(n=>{if(!n.data||t(n.data,s))return null;const a=n.data?e?.(n.data)??[]:[];return a.length?m.jsx(bt,{placement:"bottom-start",allowedPlacements:["top-start","top-end","bottom-start"],menu:{items:a},className:"sticky right-0",children:m.jsx(Oe,{className:"text-secondary mx-2 flex flex-row gap-2 hover:text-accent-primary",icon:m.jsx(z.IconDotsVertical,{...ae})})}):null},[s,e,t]);return{actionsColumnDef:g.useMemo(()=>({colId:"__actions",headerName:"",width:44,minWidth:44,suppressSizeToFit:!0,sortable:!1,resizable:!1,filter:!1,floatingFilter:!1,cellRenderer:o}),[o])}},W8=({onRename:e})=>{const[t,s]=g.useState(ti.Grid),o=g.useCallback(n=>{e(n),s(ti.Grid)},[e]),i=g.useCallback(n=>{e(n),s(ti.Tree)},[e]);return{renameTriggerView:t,onGridRename:o,onTreeRename:i}},_8=100,Bi=16,Yt="text-secondary",gr="text-primary min-w-0",j8="text-primary break-words min-w-0",Vi="bg-layer-2",U8=({open:e,onClose:t,fileMetadata:s,loading:o=!1,header:i="Information",nameLabel:n="Name:",pathLabel:r="Path:",modifiedDateLabel:a="Modified Date:",sizeLabel:l="Size:",authorLabel:c="Author:",dateLocale:d="en-US",dateOptions:u})=>m.jsx(Fo,{open:e,onClose:t,size:Bt.Sm,header:i,dividers:!1,children:m.jsx("div",{className:"px-6 py-4",children:m.jsx("div",{className:"grid gap-x-4 gap-y-4 items-center dial-small",style:{gridTemplateColumns:`${_8}px 1fr`},children:o?m.jsxs(m.Fragment,{children:[m.jsx("div",{className:Yt,children:n}),m.jsx(Go,{variant:Ot.Text,width:"100%",height:Bi,className:Vi}),m.jsx("div",{className:Yt,children:a}),m.jsx(Go,{variant:Ot.Text,width:"90%",height:Bi,className:Vi}),m.jsx("div",{className:Yt,children:l}),m.jsx(Go,{variant:Ot.Text,width:"60%",height:Bi,className:Vi}),m.jsx("div",{className:Yt,children:c}),m.jsx(Go,{variant:Ot.Text,width:"80%",height:Bi,className:Vi}),m.jsx("div",{className:Yt,children:r}),m.jsx(Go,{variant:Ot.Text,width:"70%",height:Bi,className:Vi})]}):s?m.jsxs(m.Fragment,{children:[m.jsx("div",{className:Yt,children:n}),m.jsx("div",{className:gr,children:m.jsx(ct,{text:s.name})}),m.jsx("div",{className:Yt,children:a}),m.jsx("div",{className:gr,children:m.jsx(ct,{text:ZA(s.updatedAt,d,u)})}),m.jsx("div",{className:Yt,children:l}),m.jsx("div",{className:gr,children:m.jsx(ct,{text:Tr(s.contentLength)})}),m.jsx("div",{className:Yt,children:c}),m.jsx("div",{className:gr,children:m.jsx(ct,{text:s.author||"—"})}),m.jsx("div",{className:Yt,children:r}),m.jsx("div",{className:j8,children:decodeURIComponent(s.path)})]}):null})})}),UC=e=>m.jsx(VC,{...e,children:m.jsx($8,{})}),$8=()=>{const{className:e,items:t,rootItem:s,filesLoading:o,treeOptions:i,navigationPanelOptions:n,gridOptions:r,toolbarOptions:a,bulkActionsToolbarOptions:l,deleteConfirmationOptions:c,destinationFolderPopupOptions:d,conflictResolutionPopupOptions:u,compactViewWidthBreakpoint:h=KA,sharedByMePaths:p,allowedFileTypes:f,areHiddenFilesVisible:C,toggleHiddenFilesVisibility:v,isTreeCollapsed:w,toggleTreeCollapse:b,currentPath:S,gridRows:y,selectedPaths:x,selectedFiles:R,clearSelection:F,setSelectedPaths:D,effectiveSearchValue:M,handleBreadcrumbItemClick:k,handleSearchChange:E,handleTreeItemClick:P,handleTableRowClick:N,handleOpenDestinationFolderPopup:B,handleCloseDestinationFolderPopup:O,openDestinationFolderPopup:J,destinationFolderMode:te,handleSetCopiedFiles:L,handleSetMovedFiles:le,handleDuplicate:V,handleCopyTo:Q,handleMoveTo:X,handleDownloadFiles:$,openDeleteConfirmation:q,closeDeleteConfirmation:ee,confirmDelete:ge,deleteConfirmationOpen:H,itemsToDelete:I,renamedPath:U,renamedItem:W,onRename:ue,onRenameSave:ie,onRenameCancel:Ce,onRenameValidate:ve,getDisplayName:Pe,isDragging:de,isDraggingOverWindow:ye,handleDragEnter:_,handleDragLeave:we,handleDragOver:pe,handleDrop:xe,onUploadFiles:qe,onValidateUpload:Mt,maxFileSize:je,newActions:Wt,isNewButtonVisible:Eo,newFolderTempId:Do,cancelFolderCreation:Le,saveFolderCreation:et,validateFolderName:mi,startFolderCreation:In,conflictingFiles:Aa,conflictResolutionOpen:Ci,closeConflictResolution:La,handleConflictReplace:vi,handleConflictDuplicate:Oa,handleConflictDecideForEach:Na,uploadConflictingFiles:kn,uploadConflictResolutionOpen:St,closeUploadConflictResolution:Ha,handleUploadConflictReplace:Ga,handleUploadConflictDuplicate:Ba,handleUploadConflictDecideForEach:Va,openMetadataPopup:za,fileMetadataPopupOptions:mt,isMetadataPopupOpen:Wa,selectedFileForMetadata:_a,closeMetadataPopup:ja,onUnshareFile:wi,actionsRef:Ua,searchInProgress:$a,isSearchMode:An}=zC(),{width:Ka=zA,header:Ln=WA,containerClassName:On=BA,additionalButtons:Nn,...Hn}=i??{},[Po,Gn]=g.useState(Ka),{renameTriggerView:bi,onGridRename:qa,onTreeRename:Bn}=W8({onRename:ue}),Si=g.useRef(null),Ya=j=>{Si.current===null&&(Si.current=requestAnimationFrame(()=>{Gn(j),Si.current=null}))},{columnDefs:yi,filterable:Vn=!0,dateLocale:xi,dateOptions:Mo,visibleColumns:zn=[tt.Name,tt.UpdatedAt,tt.Size,tt.Author,tt.Actions],...Ri}=r??{},{containerRef:Za,isBelowBreakpoint:Xe}=V8(h),Wn=g.useMemo(()=>An?[tt.Name,tt.Path,tt.Actions]:zn,[An,zn]),Fi=g.useCallback((j,Fe)=>!(j.nodeType===Me.FOLDER||!j.contentType||LC(Fe,j.contentType,j.name)),[]),Xa=g.useMemo(()=>[{colId:tt.Name,field:"name",headerName:"Name",flex:1,minWidth:200,cellRenderer:j=>{const Fe=j.data.nodeType,{saveFolderCreation:Rs,validateFolderName:Fs,cancelFolderCreation:Ti,newFolderTempId:$n,sharedByMePaths:ol}=j.context,js=ol?.has(j.data.path);if(j.data?.isTemporary&&j.data.id===$n)return m.jsx(la,{name:"",type:Vt.Folder,elementId:`new-folder-${j.data.id}`,editing:!0,shared:js,iconSize:As,validate:Fs,onSave:Rs,onCancel:Ti,inputContainerClassName:ce(["!h-9",Xe&&Fe===Me.ITEM&&"!h-10"])});const{renameTriggerView:il,renamedPath:nl,renamedItem:Ii,getDisplayName:rl,onRenameValidate:Kn,onRenameSave:al,onRenameCancel:ll}=j.context;if(il===ti.Grid&&nl===j.data?.path&&Ii&&j.data){const yt=rl(Ii);return m.jsx(la,{name:yt,type:Fe===Me.FOLDER?Vt.Folder:Vt.File,elementId:`rename-${j.data.id}`,editing:!0,shared:js,iconSize:As,validate:Kt=>Kn(Kt,Ii),onSave:al,onCancel:ll,inputContainerClassName:ce(["!h-9",Xe&&Fe===Me.ITEM&&"!h-10"])})}return Xe?m.jsx(B8,{id:j.data.id,name:j.data.name,nodeType:Fe,size:j.data.size,shared:js,updatedAt:j.data.updatedAt,dateLocale:xi,dateOptions:Mo}):Fe===Me.FOLDER?m.jsx(ba,{name:j.data.name,shared:js,iconSize:As}):m.jsx(wa,{name:j.data.name,shared:js,iconSize:As})}},{colId:tt.Path,field:"path",headerName:"Path",flex:1,minWidth:200,cellRenderer:j=>m.jsx(ct,{text:j.data.path})},{colId:tt.UpdatedAt,field:"updatedAt",headerName:"Modified Date",width:168,suppressSizeToFit:!0,cellRenderer:_C,cellRendererParams:{locale:xi,options:Mo}},{colId:tt.Size,field:"size",headerName:"Size",width:120,suppressSizeToFit:!0},{colId:tt.Author,field:"author",headerName:"Author",width:200,suppressSizeToFit:!0,cellRenderer:j=>j.data.author},{colId:tt.Owner,field:"owner",headerName:"Owner",width:200,suppressSizeToFit:!0,cellRenderer:j=>j.data.owner}],[xi,Mo,Xe]),_n=g.useCallback(j=>{const Fe=[];return i?.actionLabels&&(i.actionLabels[re.Duplicate]&&Fe.push({key:"duplicate",label:i.actionLabels[re.Duplicate],icon:m.jsx(z.IconCopy,{...ae,className:"text-secondary"}),onClick:()=>V([j])}),i.actionLabels[re.Copy]&&Fe.push({key:Ze.Copy,label:i.actionLabels[re.Copy],icon:m.jsx(nu,{width:ae.size,height:ae.size,className:"text-secondary"}),onClick:()=>{L([j]),B(Ze.Copy)}}),i.actionLabels[re.Move]&&Fe.push({key:Ze.Move,label:i.actionLabels[re.Move],icon:m.jsx(ru,{width:ae.size,height:ae.size,className:"text-secondary"}),onClick:()=>{le([j]),B(Ze.Move)}}),i.actionLabels[re.Download]&&Fe.push({key:"download",label:i.actionLabels[re.Download],icon:m.jsx(z.IconDownload,{...ae,className:"text-secondary"}),onClick:()=>$([j])}),i.actionLabels[re.Rename]&&Fe.push({key:"rename",label:i.actionLabels[re.Rename],icon:m.jsx(z.IconPencilMinus,{...ae,className:"text-secondary"}),onClick:()=>Bn(j.path)}),i.actionLabels[re.Unshare]&&Fe.push({key:"unshare",label:i.actionLabels[re.Unshare],icon:m.jsx(jC,{width:ae.size,height:ae.size,className:"text-secondary"}),onClick:()=>wi?.(j)}),i.actionLabels[re.Delete]&&Fe.push({key:"delete",label:i.actionLabels[re.Delete],icon:m.jsx(z.IconTrashX,{...ae,className:"text-secondary"}),onClick:()=>q([j],j.parentPath??"")})),Fe},[$,V,B,L,le,Bn,q,i,wi]),Qa=g.useMemo(()=>{const j=new Map;return R.forEach((Fe,Rs)=>{const Fs=y.find(Ti=>Ti.path===Rs);Fs&&j.set(Rs,Fs)}),j},[R,y]),Ja=g.useMemo(()=>{const j=new Set;return y.filter(Fe=>Fi(Fe,f)).forEach(Fe=>j.add(Fe.path)),j},[f,y,Fi]),el=g.useCallback(j=>{const Fe=new Set;j.forEach((Rs,Fs)=>Fe.add(Fs)),D(Fe)},[D]),Ei=H8({selectedFiles:R,actionLabels:l?.actionLabels,onDuplicate:V,onCopy:j=>{L(j),B(Ze.Copy)},onMove:j=>{le(j),B(Ze.Move)},onDownload:$,onDelete:q,getCurrentFolderPath:()=>S??"/"}),tl=g.useCallback(()=>a&&x.size===0?m.jsx("div",{className:hg,role:"toolbar","aria-label":"File Manager Toolbar",children:m.jsx(r8,{...a,areHiddenFilesVisible:C,onToggleHiddenFiles:v,isNewButtonVisible:Eo,newButtonDropdownItems:Wt})}):x.size>0&&l?m.jsx("div",{className:hg,role:"toolbar","aria-label":"File Manager Toolbar",children:m.jsx(d8,{...l,selectedCount:x.size,onClearSelection:F,actions:Ei})}):m.jsx("div",{}),[l,x,F,Ei,C,v,a,Eo,Wt]);g.useImperativeHandle(Ua,()=>({createFolder:In}),[In]);const Di=g.useCallback(()=>Xe?null:m.jsx("aside",{role:"region","aria-label":"File Manager Tree Navigation",className:"min-h-0 min-w-0 h-full flex-none",children:m.jsx(qg,{defaultWidth:Po,width:Po,onResizeStop:Gn,onResize:Ya,minWidth:jA,maxWidth:UA,enabled:w,children:m.jsx(Lg,{width:Po,title:Ln,containerClassName:On,additionalButtons:Nn,isOpened:w,onToggle:b,children:m.jsx(t8,{...Hn,items:t,rootItemPath:s?.path,rootItemLabel:s?.label,selectedPath:S,sharedByMePaths:p,onItemClick:P,areHiddenFilesVisible:C,getContextMenuItems:_n,renamedPath:bi===ti.Tree?U:void 0,onRenameSave:ie,onRenameCancel:Ce,onRenameValidate:ve})})})}),[Nn,C,On,S,Hn,_n,P,Xe,w,t,s,Ce,ie,ve,bi,U,Po,Ln,p,b]),xs=G8({actionLabels:r?.actionLabels,onDuplicate:j=>V([j]),onCopy:j=>{L([j]),B(Ze.Copy)},onMove:j=>{le([j]),B(Ze.Move)},onDownload:j=>$([j]),onRename:qa,onDelete:(j,Fe)=>q([j],Fe),onInfo:j=>za(j),onUnshare:j=>wi?.(j)}),Pi=g.useCallback(j=>{const Fe=vo(t,j.path);return Fe?xs(Fe):[]},[t,xs]),{actionsColumnDef:Mi}=z8({getContextMenuItems:Pi,isRowDisabled:Fi,allowedFileTypes:f}),jn=yi??Xa,Un=g.useMemo(()=>{let j=jn;return yi||(j=j.filter(Fe=>Fe.colId&&Wn.includes(Fe.colId))),Xe&&(j=j.slice(0,1)),j.push(Mi),Vn?j:j.map(Fe=>({...Fe,filter:!1,floatingFilter:!1}))},[jn,Vn,Xe,Mi,yi,Wn]),sl=g.useCallback(j=>{j.colDef.colId==="__select"||j.colDef.colId===tt.Actions||U&&j.data?.path===U||j.data?.isTemporary||j.data&&N(j.data)},[U,N]);return m.jsxs("section",{ref:Za,className:ce(NA,{"gap-3 pt-4":l&&x.size>0,"gap-4 p-3 pt-4":Xe,"gap-2 pt-2":Xe&&l&&x.size>0},e),children:[tl(),m.jsxs("div",{className:HA,children:[Di(),m.jsxs("div",{className:ce(GA,{"gap-3":Xe}),children:[m.jsx(n8,{...n??{},makeHref:j=>j.join("/"),path:S,onItemClick:k,rootItemPath:s?.path,rootItemLabel:s?.label,value:M,onSearchChange:E,isCompactView:Xe}),m.jsx("section",{role:"region","aria-label":"File Manager Grid View",className:ce(VA),onDragEnter:_,onDragLeave:we,onDragOver:pe,onDrop:xe,children:m.jsx(eu,{columnDefs:Un,rowData:y,getRowId:j=>j.path,loading:o||$a,getContextMenuItems:Pi,withoutHeaderBorders:Xe,selectionOnHover:!Xe,className:Z(de?"border border-dashed border-accent-primary":"",ye&&!de?"border border-dashed border-primary":""),...Ri,additionalGridOptions:{...Ri.additionalGridOptions,onCellClicked:sl,headerHeight:nc,rowHeight:nc,...Xe?{getRowHeight:j=>j.data?.nodeType===Me.FOLDER?nc:$A}:{},context:{cancelFolderCreation:Le,saveFolderCreation:et,getDisplayName:Pe,onRenameCancel:Ce,onRenameSave:ie,onRenameValidate:ve,renameTriggerView:bi,validateFolderName:mi,renamedItem:W,renamedPath:U,newFolderTempId:Do,sharedByMePaths:p}},selectedRows:Qa,onSelectionChangeWithMap:el,wrapperBorder:!de&&!ye,disabledRowIds:Ja})})]})]}),m.jsx(O8,{...c,open:H,itemsToDelete:I,onClose:ee,onConfirm:ge}),m.jsx(N8,{...d,open:J,onClose:O,onConfirm:()=>{const j=d?.destinationFolderPath??"/";te===Ze.Copy?Q(j):X(j),O()},mode:te,items:t,rootItem:s,gridOptions:{columnDefs:Un,loading:o},onUploadFiles:qe,onValidateUpload:Mt,maxFileSize:je,path:d?.destinationFolderPath||S,onPathChange:j=>{d?.setDestinationFolderPath?.(j)}}),m.jsx(Cg,{...u,open:Ci,onClose:La,onReplace:vi,onDuplicate:Oa,onDecideForEach:Na,conflictingFiles:Aa}),m.jsx(Cg,{...u,open:St,onClose:Ha,onReplace:Ga,onDuplicate:Ba,onDecideForEach:Va,conflictingFiles:kn}),m.jsx(U8,{open:Wa,onClose:ja,fileMetadata:mt?.fileMetadata??_a,loading:mt?.loading,header:mt?.header,nameLabel:mt?.nameLabel,pathLabel:mt?.pathLabel,modifiedDateLabel:mt?.modifiedDateLabel,sizeLabel:mt?.sizeLabel,authorLabel:mt?.authorLabel,dateLocale:r?.dateLocale,dateOptions:r?.dateOptions})]})},K8=e=>{const[t,s]=g.useState(ca.MyFiles),o=n=>{s(n)},i=g.useMemo(()=>{if(e)return Object.values(ca).map(n=>({id:n,label:e?.[n]||n.replace("_"," ")}))},[e]);return{activeTab:t,handleTabChange:o,tabs:i}};exports.AlertVariant=Ys;exports.ButtonVariant=ke;exports.ConfirmationPopupVariant=li;exports.DialAlert=Nv;exports.DialAutocompleteInput=aA;exports.DialAutocompleteInputValue=su;exports.DialBreadcrumb=CC;exports.DialBreadcrumbItem=_i;exports.DialButton=De;exports.DialButtonDropdown=Zc;exports.DialCheckbox=sn;exports.DialCloseButton=Jd;exports.DialCollapsibleSidebar=Lg;exports.DialConditionalResizableContainer=qg;exports.DialConfirmationPopup=SC;exports.DialDraggableItem=eb;exports.DialDropdown=bt;exports.DialEllipsisTooltip=ct;exports.DialErrorText=Ls;exports.DialFieldLabel=wo;exports.DialFileIcon=nd;exports.DialFileManager=UC;exports.DialFileManagerActions=re;exports.DialFileManagerTabs=ca;exports.DialFileName=wa;exports.DialFileNodeType=Me;exports.DialFilePermission=AC;exports.DialFileResourceType=kC;exports.DialFolderName=ba;exports.DialFormItem=da;exports.DialFormPopup=sA;exports.DialGrid=eu;exports.DialIcon=Oe;exports.DialInput=Co;exports.DialInputPopup=yC;exports.DialItemType=Vt;exports.DialLabelledText=Zv;exports.DialLoadFileAreaField=AA;exports.DialLoader=yn;exports.DialNoDataContent=ua;exports.DialNumberInputField=zk;exports.DialPasswordInput=xC;exports.DialPasswordInputField=nA;exports.DialPopup=Fo;exports.DialRadioButton=Ag;exports.DialRadioGroup=Ir;exports.DialRadioGroupPopupField=Qk;exports.DialRemoveButton=vC;exports.DialResizableContainer=Kg;exports.DialSearch=ou;exports.DialSelect=FC;exports.DialSelectField=fA;exports.DialSharedEntityIndicator=nn;exports.DialSkeleton=Go;exports.DialSkeletonAvatarShape=kr;exports.DialSkeletonAvatarSize=Ui;exports.DialSkeletonVariant=Ot;exports.DialSteps=jv;exports.DialSwitch=tu;exports.DialTabs=gC;exports.DialTag=ga;exports.DialTagInput=lA;exports.DialTextAreaField=_k;exports.DialTextInputField=Wk;exports.DialTextarea=wC;exports.DialTooltip=vs;exports.DropdownItemType=oa;exports.DropdownTrigger=xt;exports.DropdownType=hC;exports.FileManagerColumnKey=tt;exports.FileManagerProvider=VC;exports.FlexibleActionsDirection=Js;exports.FormItemOrientation=on;exports.PopupSize=Bt;exports.RadioGroupOrientation=ao;exports.ResizableContainerSide=rn;exports.SearchSize=bn;exports.SelectSize=ra;exports.SelectVariant=aa;exports.StepStatus=Rt;exports.TabOrientation=ia;exports.TagVariant=ha;exports.mergeClasses=ce;exports.useDialFileManagerTabs=K8;exports.useEditableItem=OC;exports.useFileManagerContext=zC;
|