@epam/ai-dial-ui-kit 0.6.1 → 0.6.2
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 ${Op(e,t)}`;return Array.isArray(i)?i.concat(n):[i,n]}var o5={1:"Charting Ag
|
|
|
58
58
|
`)}checkProperties(e,t,s,i,o){const n=["__ob__","__v_skip","__metadata__"],r=F5(Object.getOwnPropertyNames(e),[...n,...t,...s],s),a=Object.keys(r);for(const l of a){const c=r[l];let d=`invalid ${i} 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 ${i} with application data, use the '${i}.context' property instead.`),Jo(d)}if(a.length>0&&o){const l=this.beans.frameworkOverrides.getDocLink(o);Jo(`to see all the valid ${i} properties please check: ${l}`)}}};function F5(e,t,s){const i={},o=e.filter(n=>!t.some(r=>r===n));if(o.length>0)for(const n of o)i[n]=Ac({inputValue:n,allSuggestions:s}).values;return i}var E5=new Set(["firstChildChanged","lastChildChanged","childIndexChanged"]),D5={moduleName:"Validation",version:$,beans:[R5]};function Nm(e){const t=e.sibling;t&&(t.childrenAfterFilter=e.childrenAfterFilter)}var P5=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=(i,o)=>{i.hasChildren()&&e&&!o?i.childrenAfterFilter=i.childrenAfterGroup.filter(n=>{const r=n.childrenAfterFilter&&n.childrenAfterFilter.length>0,a=n.data&&this.filterManager.doesRowPassFilter({rowNode:n});return r||a}):i.childrenAfterFilter=i.childrenAfterGroup,Nm(i)};if(this.doingTreeDataFiltering()){const i=(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?i(n.childrenAfterGroup[a],c):s(l,c)}s(n,r)},o=n=>i(n,!1);t.executeFromRootNode(o)}else{const i=o=>s(o,!1);t.forEachChangedNodeDepthFirst(i,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}},M5=class extends jd{constructor(){super(...arguments),this.iconCreated=!1}wireComp(e,t,s,i,o){this.comp=e;const n=Pn(this,this.beans.context,o);this.eButtonShowMainFilter=s,this.eFloatingFilterBody=i,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 ue(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=Vt("filter",this.beans,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(e){e.createManagedBean(new Ro(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();uo(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){const{beans:t}=this;if(je(t)===this.eGui)return;const o=Mi(t,this.eGui,null,e.shiftKey);if(o){t.headerNavigation?.scrollToColumn(this.column),e.preventDefault(),o.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;Si(e);case T.ENTER:t&&bi(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"),i=!!e.relatedTarget&&ai(e.relatedTarget,"ag-floating-filter");if(s&&i&&e.target===this.eGui){const o=this.lastFocusEvent,n=!!(o&&o.key===T.TAB);if(o&&n){const r=o.shiftKey;bi(this.eGui,r)}}this.focusThis()}setupHover(e){this.beans.colHover?.addHeaderFilterColumnHoverListener(e,this.comp,this.column,this.eGui)}setupLeft(e){const t=new _d(this.column,this.eGui,this.beans);e.createManagedBean(t)}setupFilterButton(){this.suppressFilterButton=!this.beans.menuSvc?.isFloatingFilterButtonEnabled(this.column),this.highlightFilterButtonWhenActive=!Pt(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:i}=this,o=n=>{if(n?.source==="filterDestroyed"&&(!this.isAlive()||!t?.isAlive()))return;const r=this.comp.getFloatingFilterComp();r&&r.then(a=>{if(a){if(i.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:o}),t?.isFilterActive(s)&&o(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 i=this.beans.colFilter,o=this.active?i?.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,n=this.comp.getFloatingFilterComp();!n||!o?this.updateCompDetails(e,o,s):n.then(r=>{!r||i?.areFilterCompsDifferent(this.userCompDetails??null,o)?this.updateCompDetails(e,o,s):this.updateFloatingFilterParams(o,"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(i=>{typeof i?.refresh=="function"&&(this.gos.get("enableFilterHandlers")&&(s={...s,model:et(this.beans.colFilter?.model??{},this.column.getColId()),source:t}),i.refresh(s))})}addResizeAndMoveKeyboardListeners(){}destroy(){super.destroy(),this.destroySyncListener=null,this.destroyFilterChangedListener=null}};function T5(e,t){const s=e.colModel.getCol(t);if(!s){Ie(12,{colKey:t});return}e.menuSvc?.showColumnMenu({column:s,positionBy:"auto"})}function I5(e){e.menuSvc?.hidePopupMenu()}var k5={moduleName:"SharedMenu",version:$,beans:[QR],apiFunctions:{showColumnMenu:T5,hidePopupMenu:I5}},A5=class extends Dx{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:i}=e,o=t.getBoundingClientRect(),n=this.getParentRect();this.setAlignedTo(t,s);let r=!1;const a=()=>{const l=this.keepXYWithinBounds(s,o.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 o.right-n.left-2}function f(){return o.left-n.left-c}};this.positionPopup({ePopup:s,keepWithinBounds:!0,updatePosition:a,postProcessCallback:()=>this.callPostProcessPopup(e,"subMenu",s,t,i instanceof MouseEvent?i:void 0)})}callPostProcessPopup(e,t,s,i,o){const n=this.gos.getCallback("postProcessPopup");if(n){const{column:r,rowNode:a}=e;n({column:r,rowNode:a,ePopup:s,type:t,eventSource:i,mouseEvent:o})}}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 ys(e)}},ka={moduleName:"Popup",version:$,beans:[A5]},L5=".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 O5(e){const t=e.filterManager;return!!t?.isColumnFilterPresent()||!!t?.isAggregateFilterPresent()}function N5(e,t){return e.filterManager?.getColumnFilterInstance(t)??Promise.resolve(void 0)}function H5(e,t){const s=e.colModel.getColDefCol(t);if(s)return e.colFilter?.destroyFilter(s,"api")}function G5(e,t){e.frameworkOverrides.wrapIncoming(()=>e.filterManager?.setFilterModel(t))}function B5(e){return e.filterManager?.getFilterModel()??{}}function V5(e,t,s){const{gos:i,colModel:o,colFilter:n}=e;s&&!i.get("enableFilterHandlers")&&(B(288),s=!1);const r=o.getColDefCol(t);return r?n?.getModelForColumn(r,s)??null:null}function z5(e,t,s){return e.filterManager?.setColumnFilterModel(t,s)??Promise.resolve()}function W5(e,t){const s=e.colModel.getCol(t);if(!s){Ie(12,{colKey:t});return}e.menuSvc?.showFilterMenu({column:s,containerType:"columnFilter",positionBy:"auto"})}function _5(e){e.menuSvc?.hideFilterMenu()}function j5(e,t){const s=e.colModel.getCol(t);if(!s){Ie(12,{colKey:t});return}return e.colFilter?.getHandler(s,!0)}function U5(e,t){const{colModel:s,colFilter:i,gos:o}=e;if(!o.get("enableFilterHandlers")){B(287);return}const{colId:n,action:r}=t;if(n){const a=s.getColById(n);a&&i?.updateModel(a,r)}else i?.updateAllModels(r)}var $5={filterHandler:()=>({doesFilterPass:()=>!0})},K5=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={...Tf},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:i,dataTypeSvc:o,filterManager:n}=this.beans;if(o?.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=i.getColDefCol(c)||i.getCol(c);if(!d){B(62,{colId:c});return}if(!d.isFilterAllowed()){B(63,{colId:c});return}const u=this.getOrCreateFilterWrapper(d,!0);if(!u){B(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))});De.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;dn(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:i,beans:{colModel:o}}=this;if(s.forEach((n,r)=>{const a=this.getModelFromFilterWrapper(n);K(a)&&(t[r]=a)}),!e)for(const n of Object.keys(i)){const r=i[n];K(r)&&!s.has(n)&&o.getCol(n)?.isFilterAllowed()&&(t[n]=r)}return t}setState(e,t,s="api"){if(this.state.clear(),t)for(const i of Object.keys(t)){const o=t[i];this.state.set(i,{model:et(this.model,i),state:o})}this.setModel(e,s,!0)}getState(){const e=this.state;if(!e.size)return;const t={};let s=!1;return e.forEach((i,o)=>{const n=i.state;n!=null&&(s=!0,t[o]=n)}),s?t:void 0}getModelFromFilterWrapper(e){const s=e.column.getColId();if(e.isHandler)return et(this.model,s);const i=e.filter;return i?typeof i.getModel!="function"?(B(66),null):i.getModel():et(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():(B(67),!1):!1,{colModel:t,gos:s}=this.beans,i=!!Ec(s),o=c=>{if(!c.isPrimary())return!0;const u=!t.isPivotActive();return!c.isValueActive()||!u?!1:t.isPivotMode()?!0:i},n=[],r=[],a=(c,d,u)=>{d&&(o(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(De.resolve().then(()=>{a(d,this.isHandlerActive(d),{colId:u,isHandler:!0,handler:c.handler,handlerParams:c.handlerParams})}));else{const h=Ls(c);h&&l.push(h.then(p=>{a(d,e(p),{colId:u,isHandler:!1,comp:p})}))}}),De.all(l).then(()=>{this.activeAggregateFilters=n,this.activeColumnFilters=r})}updateFilterFlagInColumns(e,t){const s=[];return this.allColumnFilters.forEach(i=>{const o=i.column;if(i.isHandler)s.push(De.resolve().then(()=>{this.setColFilterActive(o,this.isHandlerActive(o),e,t)}));else{const n=Ls(i);n&&s.push(n.then(r=>{this.setColFilterActive(o,r.isFilterActive(),e,t)}))}}),this.beans.groupFilter?.updateFilterFlags(e,t),De.all(s)}doFiltersPass(e,t,s){const{data:i,aggData:o}=e,n=s?this.activeAggregateFilters:this.activeColumnFilters,r=s?o:i,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:et(a,d),handlerParams:p}))return!1}else{const h=c.comp;if(typeof h.doesFilterPass!="function"){Ie(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,i=()=>{this.isAlive()&&s?.onFilterChanged(e)};t.isRefreshInProgress()?setTimeout(i,0):i()}updateBeforeFilterChanged(e={}){const{column:t,additionalEventAttributes:s}=e,i=t?.getColId();return this.updateActiveFilters().then(()=>this.updateFilterFlagInColumns("filterChanged",s).then(()=>{this.allColumnFilters.forEach(o=>{const{column:n,isHandler:r}=o;i!==n.getColId()&&(r&&o.handler.onAnyFilterChanged?.(),Ls(o,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 i=s.isHandler;i&&s.handler.onNewRowsLoaded?.();const o=Ls(s,i);o&&t.push(o.then(n=>{n.onNewRowsLoaded?.()}))}),De.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:i}=this.beans;return(o,n)=>{const r=n?i.getCol(n):e;return r?s.getValue(r,o,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():et(this.initialModel,e.getColId())!=null}isHandlerActive(e){const t=K(et(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?Ls(t):null}getFilterUiForDisplay(e){const t=this.getOrCreateFilterWrapper(e,!0);if(!t)return null;const s=Ls(t);return s?s.then(i=>({comp:i,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 aS(this.gos)?t?"agSetColumnFloatingFilter":"agSetColumnFilter":Xx(e(),t)}getDefaultFloatingFilter(e){return this.getDefaultFilter(e,!0)}createFilterComp(e,t,s,i,o,n){const r=()=>{const c=this.createFilterCompParams(e,o,n),d=i(c,o);return hy(this.beans.userCompFactory,t,d,s)},a=r();return a?{compDetails:a,createFilterUi:c=>(c?r():a).newAgStackInstance()}:null}createFilterInstance(e,t,s,i){const o=this.beans.selectableFilter;o?.isSelectable(t)&&(t=o.getFilterDef(e,t));const{handler:n,handlerParams:r,handlerGenerator:a}=this.createHandler(e,t,s)??{},l=this.createFilterComp(e,t,s,i,!!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||B(281,{colId:e.getColId()})),{compDetails:c,handler:n,handlerGenerator:a,handlerParams:r,createFilterUi:d}}createBaseFilterParams(e,t){const{filterManager:s,rowModel:i}=this.beans;return ue(this.gos,{column:e,colDef:e.getColDef(),getValue:this.createGetValue(e),doesRowPassOtherFilter:t?()=>!0:o=>s?.doesRowPassOtherFilters(e.getColId(),o)??!0,rowModel:i})}createFilterCompParams(e,t,s,i){const o=this.filterChangedCallbackFactory(e),n=this.createBaseFilterParams(e,i);if(n.filterChangedCallback=o,n.filterModifiedCallback=i?()=>{}:r=>this.filterModified(e,r),t){const r=n,a=e.getColId(),l=et(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(()=>{o({...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 i=t(),o={created:!0,create:t,filterParams:e.params,compDetails:e,promise:i};return i.then(s),o}createFilterWrapper(e){const{compDetails:t,handler:s,handlerGenerator:i,handlerParams:o,createFilterUi:n}=this.createFilterInstance(e,e.getColDef(),this.getDefaultFilter(e),a=>a),r=e.getColId();if(s)return delete this.initialModel[r],s.init?.({...o,source:"init",model:et(this.model,r)}),{column:e,isHandler:!0,handler:s,handlerGenerator:i,handlerParams:o,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:i,frameworkOverrides:o,registry:n}=this.beans;let r;const a=p=>{const f=p.filter;if(nf(f)){const C=f.handler;return C||(r=f.doesFilterPass,r?()=>({doesFilterPass:r}):void 0)}return typeof f=="string"?f:void 0},l=i.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=i.get("filterHandlers")?.[c];p!=null?u=p:Bx.has(c)&&(u=d(c),h=c)}else u=c;if(!u){let p;const{compName:f,jsComp:C,fwComp:w}=lf(o,t);f?p=f:C==null&&w==null&&t.filter===!0&&(p=s),h=this.handlerMap[p],h&&(u=d(h))}return u?{filterHandler:u,handlerNameOrCallback:r??h}:l?($e(i)&&B(277,{colId:e.getColId()}),$5):void 0}createHandler(e,t,s){const i=this.createHandlerFunc(e,t,s);if(!i)return;const o=El(this.beans.userCompFactory,t,this.createFilterCompParams(e,!0,"init")),{handlerNameOrCallback:n,filterHandler:r}=i,{handler:a,handlerParams:l}=this.createHandlerFromFunc(e,r,o);return{handler:a,handlerParams:l,handlerGenerator:n??r}}createHandlerFromFunc(e,t,s){const i=e.getColDef(),o=t(ue(this.gos,{column:e,colDef:i})),n=this.createHandlerParams(e,s);return{handler:o,handlerParams:n}}createHandlerParams(e,t){const s=e.getColDef(),i=e.getColId(),o=this.filterChangedCallbackFactory(e);return ue(this.gos,{colDef:s,column:e,getValue:this.createGetValue(e),doesRowPassOtherFilter:n=>this.beans.filterManager?.doesRowPassOtherFilters(i,n)??!0,onModelChange:(n,r)=>{this.updateStoredModel(i,n),this.refreshHandlerAndUi(e,n,"handler",!1,r).then(()=>{o({...r,source:"columnFilter"})})},filterParams:t})}onColumnsChanged(){const e=[],{colModel:t,filterManager:s,groupFilter:i}=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 o=i&&e.every(n=>i.isGroupFilter(n));e.length>0&&!o&&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:i,selectableFilter:o}=this.beans,n=h=>{const p=this.getOrCreateFilterUi(e);p?.then(f=>{h(Cn(f))})},r=e.getColDef(),a=o?.isSelectable(r)?o.getFilterDef(e,r):r,l=sR(i,a,()=>this.getDefaultFloatingFilter(e))??"agReadOnlyFloatingFilter",c=this.gos.get("enableFilterHandlers"),d=El(s,a,this.createFilterCompParams(e,c,"init",!0)),u=ue(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=et(this.model,p),h.onModelChange=(C,w)=>{this.updateStoredModel(p,C),this.refreshHandlerAndUi(e,C,"floating",!0,w).then(()=>{f({...w,source:"columnFilter"})})},h.getHandler=()=>this.getHandler(e,!0),h.source="init"}return Cy(s,r,u,l)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilterUi(e,t,s,i){const o="paramsUpdated";if(e.isHandler){const n=t.getColId();delete this.initialModel[n],this.state.delete(n);const r=e.filterUi,a=this.createFilterUiForHandler(s,i);e.filterUi=a;const l=this.eventSvc;r?.created?r.promise.then(c=>{this.destroyBean(c),l.dispatchEvent({type:"filterDestroyed",source:o,column:t})}):l.dispatchEvent({type:"filterHandlerDestroyed",source:o,column:t})}else this.destroyFilter(t,o)}destroyFilter(e,t="api"){const s=e.getColId(),i=this.allColumnFilters.get(s);this.disposeColumnListener(s),delete this.initialModel[s],i&&this.disposeFilterWrapper(i,t).then(o=>{o&&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:i,isHandler:o,filterUi:n}=e,r=i.getColId();o&&(s=this.isHandlerActive(i),this.destroyBean(e.handler),delete this.model[r],this.state.delete(r));const a=()=>{this.setColFilterActive(i,!1,"filterDestroyed"),this.allColumnFilters.delete(r),this.eventSvc.dispatchEvent({type:"filterDestroyed",source:t,column:i})};if(n){if(n.created)return n.promise.then(l=>(s=o?s:!!l?.isFilterActive(),this.destroyBean(l),a(),s));a()}return De.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 i=this.beans,o=s.column,n=o.getColDef(),r=o.isFilterAllowed(),a=this.getDefaultFilter(o),l=i.selectableFilter,c=l?.isSelectable(n)?l.getFilterDef(o,n):n,d=r?this.createHandlerFunc(o,c,this.getDefaultFilter(o)):void 0,u=!!d,h=s.isHandler;if(h!=u){this.destroyFilter(o,"paramsUpdated");return}const{compDetails:p,createFilterUi:f}=(r?this.createFilterComp(o,c,a,w=>w,u,"colDef"):null)??{compDetails:null,createFilterUi:null},C=p?.params??El(i.userCompFactory,c,this.createFilterCompParams(o,u,"colDef"));if(h){const w=d?.handlerNameOrCallback??d?.filterHandler,v=et(this.model,e);if(s.handlerGenerator!=w){const b=s.handler,{handler:S,handlerParams:y}=this.createHandlerFromFunc(o,d.filterHandler,C);s.handler=S,s.handlerParams=y,s.handlerGenerator=w,delete this.model[e],S.init?.({...y,source:"init",model:null}),this.destroyBean(b),v!=null&&this.beans.filterManager?.onFilterChanged({columns:[o],source:t})}else{const b=this.createHandlerParams(o,p?.params);s.handlerParams=b,s.handler.refresh?.({...b,source:"colDef",model:v})}}if(this.areFilterCompsDifferent(s.filterUi?.compDetails??null,p)||!s.filterUi||!p){this.destroyFilterUi(s,o,p,f);return}s.filterUi.filterParams=C,Ls(s,h)?.then(w=>{(w?.refresh?w.refresh(C):!0)===!1?this.destroyFilterUi(s,o,p,f):this.dispatchLocalEvent({type:"filterParamsChanged",column:o,params:C})})}refreshHandlerAndUi(e,t,s,i,o){const n=this.cachedFilter(e);if(!n)return i&&this.getOrCreateFilterWrapper(e,!0),De.resolve();if(!n.isHandler)return De.resolve();const{filterUi:r,handler:a,handlerParams:l}=n;return Vx(()=>{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 De.resolve(void 0)},a,l,t,this.state.get(e.getColId())??{model:t},s,o)}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:i}=t;return!(s===i||s?.render&&i?.render&&s.render===i.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(i=>{s.then(o=>{i(Cn(o))})}):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:i,model:o}=this,n=e.getColId(),r=i.get(n);return r?r.model??null:et(o,n)}const s=this.cachedFilter(e);return s?this.getModelFromFilterWrapper(s):null}setModelForColumn(e,t){if(this.beans.dataTypeSvc?.isPendingInference){let s=()=>{};const i=new Promise(o=>{s=o});return this.columnModelUpdates.push({key:e,model:t,resolve:s}),i}return new Promise(s=>{this.setModelForColumnLegacy(e,t).then(i=>s(i))})}getStateForColumn(e){return this.state.get(e)??{model:et(this.model,e)}}setModelForColumnLegacy(e,t){const s=this.beans.colModel.getColDefCol(e),i=s?this.getOrCreateFilterWrapper(s,!0):null;return i?this.setModelOnFilterWrapper(i,t):De.resolve()}setColDefPropsForDataType(e,t,s){const i=e.filter,o=i===!0?this.getDefaultFilterFromDataType(()=>t.baseDataType):i;if(typeof o!="string")return;let n,r;const a=this.beans,{filterParams:l,filterValueGetter:c}=e;o==="agMultiColumnFilter"?{filterParams:n,filterValueGetter:r}=a.multiFilter?.getParamsForDataType(l,c,t,s)??{}:{filterParams:n,filterValueGetter:r}=qx(o,l,c,t,s,a,this.getLocaleTextFunc()),e.filterParams=n,r&&(e.filterValueGetter=r)}setColFilterActive(e,t,s,i){e.filterActive!==t&&(e.filterActive=t,e.dispatchColEvent("filterActiveChanged",s)),e.dispatchColEvent("filterChanged",s,i)}setModelOnFilterWrapper(e,t,s){return new De(i=>{if(e.isHandler){const n=e.column,r=n.getColId(),a=this.model[r];if(this.updateStoredModel(r,t),s&&t===a){i();return}this.refreshHandlerAndUi(n,t,"api").then(()=>i());return}const o=Ls(e);if(o){o.then(n=>{if(typeof n?.setModel!="function"){B(65),i();return}(n.setModel(t)||De.resolve()).then(()=>i())});return}i()})}updateStoredModel(e,t){K(t)?this.model[e]=t:delete this.model[e];const s=this.state.get(e),i={model:t,state:s?.state};this.state.set(e,i)}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 i=e.getColId(),o=this.cachedFilter(e),n=()=>o?.filterUi;uh(t,n,()=>et(this.model,i),()=>this.state.get(i),r=>this.updateState(e,r),r=>n()?.filterParams?.onModelChange(r,s),o?.isHandler?o.handler.processModelToApply?.bind(o.handler):void 0)}updateAllModels(e,t){const s=[];this.allColumnFilters.forEach((i,o)=>{const n=this.beans.colModel.getColDefCol(o);n&&uh(e,()=>i.filterUi,()=>et(this.model,o),()=>this.state.get(o),r=>this.updateState(n,r),r=>{this.updateStoredModel(o,r),this.dispatchLocalEvent({type:"filterAction",column:n,action:e}),s.push(this.refreshHandlerAndUi(n,r,"ui"))},i?.isHandler?i.handler.processModelToApply?.bind(i.handler):void 0)}),s.length&&De.all(s).then(()=>{this.callOnFilterChangedOutsideRenderCycle({source:"columnFilter",additionalEventAttributes:t,columns:[]})})}updateOrRefreshFilterUi(e){const t=e.getColId();kf(()=>this.cachedFilter(e)?.filterUi,()=>et(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 o of s)if(o.source==="COLUMN_MENU")return!1;let i=!1;for(const o of e.keys()){const n=e.get(o);if(n.valid===!1)return!1;(n.model??null)!==et(t,o)&&(i=!0)}return i}hasUnappliedModel(e){const{model:t,state:s}=this;return(s.get(e)?.model??null)!==et(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 q5(e){return!!e.filterManager?.isAnyFilterPresent()}function Y5(e,t="api"){e.filterManager?.onFilterChanged({source:t})}var Z5=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:i})=>this.onAdvFilterEnabledChanged(i),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],()=>{this.onFilterChanged({source:"api"})}),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",()=>{this.updateAggFiltering(),this.onFilterChanged()}),this.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(){Ec(this.gos)&&this.isAnyFilterPresent()&&this.onFilterChanged()}onFilterChanged(e={}){const{source:t,additionalEventAttributes:s,columns:i=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.colFilter?this.colFilter.updateBeforeFilterChanged(e):De.resolve()).then(()=>{const o={source:t,type:"filterChanged",columns:i};s&&mt(o,s),this.eventSvc.dispatchEvent(o),this.colFilter?.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){return!!this.colFilter?.isSuppressFlashingCellsBecauseFiltering()}isQuickFilterPresent(){return!!this.quickFilter?.isFilterPresent()}updateAggFiltering(){this.aggFiltering=!!Ec(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(){B(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,i){e&&!e.isColumn||this.showPopup(e,o=>{this.popupSvc?.positionPopupUnderMouseEvent({column:e,type:s,mouseEvent:t,ePopup:o})},s,t.target,Pt(this.gos),i)}showMenuAfterButtonClick(e,t,s,i){if(e&&!e.isColumn)return;let o=-1,n="left";const r=Pt(this.gos);!r&&this.gos.get("enableRtl")&&(o=1,n="right");const a=r?void 0:4*o,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,i)}showPopup(e,t,s,i,o,n){const r=e?this.createBean(new $x(e,"COLUMN_MENU")):void 0;if(this.activeMenu=r,!r?.hasFilter()||!e){Ie(57);return}const a=vt({tag:"div",cls:`ag-menu${o?"":" 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=lS(this.gos)?i??this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody:void 0,u=C=>{wh(e,!1,"contextMenu");const w=C instanceof KeyboardEvent;this.tabListener&&(this.tabListener=this.tabListener()),w&&i&&Fs(i)&&pf(i)?.focus({preventScroll:!0}),c(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,s,e),n?.()},h=this.getLocaleTextFunc(),p=o&&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})}),wh(e,!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,s,e)}trapFocusWithin(e,t){e.key!==T.TAB||e.defaultPrevented||Mi(this.beans,t,!1,e.shiftKey)||(e.preventDefault(),bi(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()}},Q5=class extends A{constructor(){super(...arguments),this.beanName="filterValueSvc"}getValue(e,t,s){if(!t)return;const i=e.getColDef(),{selectableFilter:o,valueSvc:n}=this.beans,r=s??o?.getFilterValueGetter(e.getColId())??i.filterValueGetter;return r?this.executeFilterValueGetter(r,t.data,e,t,i):n.getValue(e,t)}executeFilterValueGetter(e,t,s,i,o){const{expressionSvc:n,valueSvc:r}=this.beans,a=ue(this.gos,{data:t,node:i,column:s,colDef:o,getValue:r.getValueCallback.bind(r,i)});return typeof e=="function"?e(a):n?.evaluate(e,a)}},J5={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eFloatingFilterText"}]},e4=class extends Ue{constructor(){super(J5,[Ea]),this.eFloatingFilterText=de}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,i=s.getHandler();if(i.getModelAsString){const o=i.getModelAsString(s.model);this.eFloatingFilterText.setValue(o)}}}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)}},Xd=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"]],i=o=>o.some(n=>t[n]!=null)?!0:(B(72,{keys:o}),!1);if(!s.every(i)){this.filterOptions=e.filter(o=>o===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;B(73)}else B(74)}getCustomOption(e){return this.customFilterOptions[e]}};function nn(e,t,s){return s==null?e.splice(t):e.splice(t,s)}function ra(e){return e==null||typeof e=="string"&&e.trim().length===0}function t4(e){return e==="AND"||e==="OR"?e:"AND"}function s4(e,t,s){if(e==null)return;const{predicate:i}=e;if(i!=null&&!t.some(o=>o==null))return i(t,s)}function i4(e,t){let s=e.length;return s>t&&(e.splice(t),B(78),s=t),s}function Sn(e,t){const s=t.getCustomOption(e);if(s){const{numberOfInputs:o}=s;return o??1}return e&&["empty","notBlank","blank"].indexOf(e)>=0?0:e==="inRange"?2:1}var Qd=class extends tR{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 Xd;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=t4(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 i=s===0?e:this.optionsFactory.defaultOption;t.setValue(i,!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,i=!t.operator;if(!s&&i||s&&!i)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&&qs(r.conditions,a.conditions,(l,c)=>this.areSimpleModelsEqual(l,c))}return n}setModelIntoUi(e,t){if(e==null)return this.resetUiToDefaults(t),De.resolve();if(e.operator){const i=e;let o=i.conditions;o==null&&(o=[],B(77));const n=i4(o,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=i.operator==="OR";this.eJoinAnds.forEach(l=>l.setValue(!a,!0)),this.eJoinOrs.forEach(l=>l.setValue(a,!0)),o.forEach((l,c)=>{this.eTypes[c].setValue(l.type,!0),this.setConditionIntoUi(l,c)})}else{const i=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(i.type,!0),this.setConditionIntoUi(i,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.updateUiVisibility(),t||this.params.onUiChange(this.getUiChangeEventParams()),De.resolve()}setNumConditions(e){let t=e.maxNumConditions??2;t<1&&(B(79),t=1),this.maxNumConditions=t;let s=e.numAlwaysVisibleConditions??1;s<1&&(B(80),s=1),s>t&&(B(81),s=t),this.numAlwaysVisibleConditions=s}createOption(){const e=this.getGui(),t=this.createManagedBean(new kd);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 i=this.getNumConditions()-1;this.forEachPositionInput(i,o=>this.resetInput(o)),this.addChangedListeners(t,i)}createJoinOperatorPanel(){const e=vt({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 i=this.eJoinPanels.length-1,o=this.joinOperatorId++;this.resetJoinOperatorAnd(t,i,o),this.resetJoinOperatorOr(s,i,o),this.isReadOnly()||(t.onValueChange(this.listener),s.onValueChange(this.listener))}createJoinOperator(e,t,s){const i=this.createManagedBean(new ky);e.push(i);const o="ag-filter-condition-operator";return i.addCss(o),i.addCss(`${o}-${s}`),t.appendChild(i.getGui()),i}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 i=e+1,o=s-i;o>0&&this.removeConditionsAndOperators(i,o),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=e}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((i,o)=>{const n=this.isConditionDisabled(o,e);i.setDisabled(n||this.filterListOptions.length<=1),o===1&&(hn(this.eJoinPanels[0],n),this.eJoinAnds[0].setDisabled(n),this.eJoinOrs[0].setDisabled(n))}),this.eConditionBodies.forEach((i,o)=>{_e(i,this.isConditionBodyVisible(o))});const s=(t??this.getJoinOperator())==="OR";for(const i of this.eJoinAnds)i.setValue(!s,!0);for(const i of this.eJoinOrs)i.setValue(s,!0);this.forEachInput((i,o,n,r)=>{this.setElementDisplayed(i,o<r),this.setElementDisabled(i,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:i,eJoinPanels:o,eJoinAnds:n,eJoinOrs:r}=this;this.removeComponents(s,e,t),this.removeElements(i,e,t),this.removeEValues(e,t);const a=Math.max(e-1,0);this.removeElements(o,a,t),this.removeComponents(n,a,t),this.removeComponents(r,a,t)}removeElements(e,t,s){const i=nn(e,t,s);for(const o of i)_s(o)}removeComponents(e,t,s){const i=nn(e,t,s);for(const o of i)_s(o.getGui()),this.destroyBean(o)}afterGuiAttached(e){if(super.afterGuiAttached(e),this.resetPlaceholder(),!e?.suppressFocus){let t;if(!this.isReadOnly()){const s=this.getInputs(0)[0];s instanceof oi&&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,i=!1;const o=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),i=!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,o),i&&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 i=this.eTypes[t].getValue(),o=this.translate(i);s=this.filterPlaceholder({filterOptionKey:i,filterOption:o,placeholder:s})}else typeof this.filterPlaceholder=="string"&&(s=this.filterPlaceholder);return s}resetPlaceholder(){const e=this.getLocaleTextFunc();this.forEachInput((t,s,i,o)=>{if(!(t instanceof oi))return;const n=s===0&&o>1?"inRangeStart":s===0?"filterOoo":"inRangeEnd",r=s===0&&o>1?e("ariaFilterFromValue","Filter from value"):s===0?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(n,i)),t.setInputAriaLabel(r)})}setElementValue(e,t,s){e instanceof oi&&e.setValue(t!=null?String(t):null,!0)}setElementDisplayed(e,t){eh(e)&&_e(e.getGui(),t)}setElementDisabled(e,t){eh(e)&&hn(e.getGui(),t)}attachElementOnChange(e,t){e instanceof oi&&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 i=Sn(t,this.optionsFactory),o=this.getInputs(e);for(let n=0;n<o.length;n++){const r=o[n];r!=null&&s(r,n,e,i)}}isConditionDisabled(e,t){return this.isReadOnly()?!0:e===0?!1:e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return Sn(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,i,o){this.updateJoinOperatorDisabled(e.setValue(s,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${o}`).setLabel(i),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((i,o,n)=>{n===t&&this.setElementValue(i,s[o]!=null?s[o]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,s,i)=>{this.setElementValue(t,s===0&&i===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}},Hm=class{constructor(e,t,s,i,o,n){this.alive=!0,this.context=e,this.eParent=o;const r=gy(t,s,i);r&&r.newAgStackInstance().then(a=>{if(!this.alive){e.destroyBean(a);return}if(this.dateComp=a,!a)return;o.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){_e(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)}},Jd=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"];function Gm(e,t){const{dateFrom:s,dateTo:i,type:o}=e||{};return[s&&St(s,void 0,!0)||null,i&&St(i,void 0,!0)||null].slice(0,Sn(o,t))}var eg=1e3,tg=1/0,o4=class extends Qd{constructor(){super("dateFilter",Gm,Jd),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=eg,this.maxValidYear=tg,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))B(82,{param:l});else return d==null?c:Number(d);return c},s=t("minValidYear",eg),i=t("maxValidYear",tg);this.minValidYear=s,this.maxValidYear=i,s>i&&B(83);const{minValidDate:o,maxValidDate:n}=e,r=o instanceof Date?o:St(o);this.minValidDate=r;const a=n instanceof Date?n:St(n);this.maxValidDate=a,r&&a&&r>a&&B(84)}createDateCompWrapper(e){const{beans:{userCompFactory:t,context:s,gos:i},params:o}=this,n=new Hm(s,t,o.colDef,ue(i,{onDateChanged:()=>this.onUiChanged(),filterParams:o,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=vt({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,i){const o=vt({tag:"div",cls:`ag-filter-${i} ag-filter-date-${i}`});t.push(o),e.appendChild(o),s.push(this.createDateCompWrapper(o))}removeEValues(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),nn(this.eConditionPanelsFrom,e,t),nn(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,s){const i=nn(e,t,s);for(const o of i)o.destroy()}isValidDateValue(e){if(e===null)return!1;const{minValidDate:t,maxValidDate:s,minValidYear:i,maxValidYear:o}=this;if(t){if(e<t)return!1}else if(e.getUTCFullYear()<i)return!1;if(s){if(e>s)return!1}else if(e.getUTCFullYear()>o)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput((s,i,o,n)=>{o!==e||!t||i>=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={},i=this.getValues(e),o=this.params.useIsoSeparator?"T":" ";return i.length>0&&(s.dateFrom=Mt(i[0],!0,o)),i.length>1&&(s.dateTo=Mt(i[1],!0,o)),{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(i=>{i.setInputPlaceholder(t),i.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,i,o,n)=>{i<n&&t.push(s.getDate())}),t}translate(e){return e==="lessThan"?super.translate("before"):e==="greaterThan"?super.translate("after"):super.translate(e)}},Bm=class extends A{constructor(e,t){super(),this.mapValuesFromModel=e,this.defaultOptions=t}init(e){const t=e.filterParams,s=new Xd;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,i=[];if(s){const r=t;i.push(...r.conditions??[])}else i.push(t);const o=s&&s==="OR"?"some":"every",n=this.params.getValue(e.node);return i[o](r=>this.individualConditionPasses(e,r,n))}getModelAsString(e,t){return this.filterModelFormatter.getModelAsString(e,t)??""}validateModel(e){const{model:t,filterParams:{filterOptions:s,maxNumConditions:i}}=e;if(t==null)return;let n=Of(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 i=="number"&&n&&n.length>i&&(n=n.slice(0,i),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 i=this.optionsFactory,o=this.mapValuesFromModel(t,i),n=i.getCustomOption(t.type),r=s4(n,o,s);return r??(s==null?this.evaluateNullValue(t.type):this.evaluateNonNullValue(o,s,t,e))}},Vm=class extends Bm{evaluateNullValue(e){const{includeBlanksInEquals:t,includeBlanksInNotEqual:s,includeBlanksInGreaterThan:i,includeBlanksInLessThan:o,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(i)return!0;break;case"lessThan":case"lessThanOrEqual":if(o)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 i=s.type;if(!this.isValid(t))return i==="notEqual"||i==="notBlank";const o=this.comparator(),n=e[0]!=null?o(e[0],t):0;switch(i){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=o(e[1],t);return this.params.filterParams.inRangeInclusive?n>=0&&r<=0:n>0&&r<0}case"blank":return ra(t);case"notBlank":return!ra(t);default:return B(76,{filterModelType:i}),!0}}},zm={equals:"Equals",notEqual:"NotEqual",greaterThan:"GreaterThan",greaterThanOrEqual:"GreaterThanOrEqual",lessThan:"LessThan",lessThanOrEqual:"LessThanOrEqual",inRange:"InRange"},n4={contains:"Contains",notContains:"NotContains",equals:"TextEquals",notEqual:"TextNotEqual",startsWith:"StartsWith",endsWith:"EndsWith",inRange:"InRange"},eu=class extends A{constructor(e,t,s){super(),this.optionsFactory=e,this.filterParams=t,this.valueFormatter=s}getModelAsString(e,t){const s=this.getLocaleTextFunc(),i=t==="filterToolPanel";if(!e)return i?Bs(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(` ${Bs(this,l)} `)}else{if(e.type==="blank"||e.type==="notBlank")return i?Bs(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,i,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,i,o,n){let r;const a=this.getTypeKey(e);return a&&(r=Bs(this,a)),o&&n&&(r=this.getLocaleTextFunc()(o,n)),r!=null?t?`${r} ${Bs(this,"filterSummaryInRangeValues",[s(),i()])}`:`${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)}},Wm=class extends eu{constructor(e,t){super(e,t,s=>{const{dataTypeSvc:i,valueSvc:o}=this.beans,n=t.column,r=i?.getDateFormatterFunction(n),a=r?r(s??void 0):s;return o.formatValue(n,null,a)}),this.filterTypeKeys=zm}conditionToString(e,t,s,i,o){const{type:n}=e,r=St(e.dateFrom),a=St(e.dateTo),l=this.filterParams.inRangeFloatingFilterDateFormat,c=t?this.formatValue.bind(this):h=>kc(h,l),d=()=>r!==null?c(r):"null",u=()=>a!==null?c(a):"null";if(t){const h=this.conditionForToolPanel(n,s,d,u,i,o);if(h!=null)return h}return s?`${d()}-${u()}`:r!=null?c(r):`${n}`}};function r4(e,t){const s=t;return s<e?-1:s>e?1:0}var a4=class extends Vm{constructor(){super(Gm,Jd),this.filterType="date",this.FilterModelFormatterClass=Wm}comparator(){return this.params.filterParams.comparator??r4}isValid(e){const t=this.params.filterParams.isValidDate;return!t||t(e)}},_m=class extends Ue{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 Xd;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 i=this.isTypeEditable(s);this.setEditable(i)}refresh(e){this.params=e;const t=e,s=this.reactive;if((!s||t.source==="colDef")&&this.updateParams(e),s){const{source:i,model:o}=t;if(i==="dataChanged"||i==="ui")return;this.onModelUpdated(o)}}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")}`}},l4={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"}]},c4=class extends _m{constructor(){super(l4,[Ea]),this.eReadOnlyText=de,this.eDateWrapper=de,this.FilterModelFormatterClass=Wm,this.filterType="date",this.defaultOptions=Jd}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?St(e.dateFrom):null;this.dateComp.setDate(s),this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){_e(this.eDateWrapper,e),_e(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,i=Mt(e),o=i==null?null:{...s??{filterType:this.filterType,type:this.lastType??this.optionsFactory.defaultOption},dateFrom:i};t.onModelChange(o,{afterFloatingFilter:!0})}else this.params.parentFilterInstance(t=>{t?.onFloatingFilterChanged(this.lastType||null,e)})}getDateComponentParams(){const{filterParams:e}=this.params,t=Hd(e,this.defaultDebounceMs);return ue(this.gos,{onDateChanged:nt(this,this.onDateChanged.bind(this),t),filterParams:e,location:"floatingFilter"})}createDateComponent(){const{beans:{context:e,userCompFactory:t},eDateWrapper:s,params:i}=this;this.dateComp=new Hm(e,t,i.column.getColDef(),this.getDateComponentParams(),s,o=>{o.setInputAriaLabel(this.getAriaLabel(i))}),this.addDestroyFunc(()=>this.dateComp.destroy())}},d4={tag:"div",cls:"ag-filter-filter",children:[{tag:"ag-input-text-field",ref:"eDateInput",cls:"ag-date-filter"}]},u4=class extends Ue{constructor(){super(d4,[Ea]),this.eDateInput=de,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&&Ys();const{minValidYear:i,maxValidYear:o,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&&i&&B(85),r&&o&&B(86),n&&r){const[h,p]=[n,r].map(f=>f instanceof Date?f:St(f));h&&p&&h.getTime()>p.getTime()&&B(87)}n?n instanceof Date?t.min=kc(n):t.min=n:i&&(t.min=`${i}-01-01`),r?r instanceof Date?t.max=kc(r):t.max=r:o&&(t.max=`${o}-12-31`),this.isApply=e.location==="floatingFilter"&&!!a?.includes("apply")}refresh(e){this.params=e,this.setParams(e)}getDate(){return St(this.eDateInput.getValue())}setDate(e){const t=this.params.filterParams.colDef.cellDataType,s=this.beans.dataTypeSvc?.getDateIncludesTimeFlag(t)??!1;this.eDateInput.setValue(Mt(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}},tu=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"];function Zc(e){const{allowedCharPattern:t}=e??{};return t??null}function Xc(e){return e==null||isNaN(e)?null:e}function jm(e,t){const{filter:s,filterTo:i,type:o}=e||{};return[Xc(s),Xc(i)].slice(0,Sn(o,t))}var h4=class extends Qd{constructor(){super("numberFilter",jm,tu),this.eValuesFrom=[],this.eValuesTo=[],this.filterType="number",this.defaultDebounceMs=500}setElementValue(e,t,s){const{numberFormatter:i}=this.params,o=!s&&i?i(t??null):t;super.setElementValue(e,o)}createEValue(){const e=Zc(this.params),t=vt({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,i){const o=this.createManagedBean(i?new Ti({allowedCharPattern:i}):new Id);o.addCss(`ag-filter-${s}`),o.addCss("ag-filter-filter"),t.push(o),e.appendChild(o.getGui())}removeEValues(e,t){const s=i=>this.removeComponents(i,e,t);s(this.eValuesFrom),s(this.eValuesTo)}getValues(e){const t=[];return this.forEachPositionInput(e,(s,i,o,n)=>{i<n&&t.push(Xc(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=ws(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},i=this.getValues(e);return i.length>0&&(s.filter=i[0]),i.length>1&&(s.filterTo=i[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}},Um=class extends eu{constructor(e,t){super(e,t,t.numberFormatter),this.filterTypeKeys=zm}conditionToString(e,t,s,i,o){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),i,o);if(c!=null)return c}return s?`${l(n)}-${l(r)}`:n!=null?l(n):`${a}`}},g4=class extends Vm{constructor(){super(jm,tu),this.filterType="number",this.FilterModelFormatterClass=Um}comparator(){return(e,t)=>e===t?0:e<t?1:-1}isValid(e){return!isNaN(e)}},$m=class extends A{constructor(e){super(),this.params=e,this.eInput=de,this.onValueChanged=()=>{}}setupGui(e){this.eInput=this.createManagedBean(new Ti(this.params?.config));const t=this.eInput.getGui();e.appendChild(t);const s=i=>this.onValueChanged(i);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 Qc(e){const t=e?.trim();return t===""?e:t}function Km(e,t){const{filter:s,filterTo:i,type:o}=e||{};return[s||null,i||null].slice(0,Sn(o,t))}var p4={tag:"div",ref:"eFloatingFilterInputContainer",cls:"ag-floating-filter-input",role:"presentation"},qm=class extends _m{constructor(){super(...arguments),this.eFloatingFilterInputContainer=de,this.defaultDebounceMs=500}postConstruct(){this.setTemplate(p4)}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:i,readOnly:o}=this;if(s.setParams({ariaLabel:this.getAriaLabel(e),autoComplete:t}),this.applyActive=Pa(e.filterParams),!o){const n=Hd(e.filterParams,i),r=nt(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();bt(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:i,params:o,lastType:n}=this;let r=i.getValue();if(o.filterParams.trimInput&&(r=Qc(r),i.setValue(r,!0)),s){const a=o,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 o.parentFilterInstance(a=>{a?.onFloatingFilterChanged(n||null,r||null)})}convertValue(e){return e||null}setEditable(e){this.inputSvc.setEditable(e)}},f4=class extends A{constructor(){super(...arguments),this.onValueChanged=()=>{},this.numberInputActive=!0}setupGui(e){this.eNumberInput=this.createManagedBean(new Id),this.eTextInput=this.createManagedBean(new Ti),this.eTextInput.setDisabled(!0);const t=this.eNumberInput.getGui(),s=this.eTextInput.getGui();e.appendChild(t),e.appendChild(s),this.setupListeners(t,i=>this.onValueChanged(i)),this.setupListeners(s,i=>this.onValueChanged(i))}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)}},m4=class extends qm{constructor(){super(...arguments),this.FilterModelFormatterClass=Um,this.filterType="number",this.defaultOptions=tu}updateParams(e){Zc(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.updateParams(e)}createFloatingFilterInputService(e){return this.allowedCharPattern=Zc(e.filterParams),this.allowedCharPattern?this.createManagedBean(new $m({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new f4)}convertValue(e){return e?Number(e):null}},su=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],C4=class extends Qd{constructor(){super("textFilter",Km,su),this.filterType="text",this.eValuesFrom=[],this.eValuesTo=[],this.defaultDebounceMs=500}createCondition(e){const t=this.getConditionType(e),s={filterType:this.filterType,type:t},i=this.getValues(e);return i.length>0&&(s.filter=i[0]),i.length>1&&(s.filterTo=i[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,i,o,n)=>{i<n&&t.push(ws(s.getValue()))}),t}createEValue(){const e=vt({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 i=this.createManagedBean(new Ti);i.addCss(`ag-filter-${s}`),i.addCss("ag-filter-filter"),t.push(i),e.appendChild(i.getGui())}removeEValues(e,t){const s=n=>this.removeComponents(n,e,t),{eValuesFrom:i,eValuesTo:o}=this;s(i),s(o)}},Ym=class extends eu{constructor(){super(...arguments),this.filterTypeKeys=n4}conditionToString(e,t,s,i,o){const{filter:n,filterTo:r,type:a}=e;if(t){const l=d=>()=>Bs(this,"filterSummaryTextQuote",[d]),c=this.conditionForToolPanel(a,s,l(n),l(r),i,o);if(c!=null)return c}return s?`${n}-${r}`:n!=null?`${n}`:`${a}`}},v4=({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 i=t.lastIndexOf(s);return i>=0&&i===t.length-s.length}default:return!1}},w4=e=>e,b4=e=>e==null?null:e.toString().toLowerCase(),S4=class extends Bm{constructor(){super(Km,su),this.filterType="text",this.FilterModelFormatterClass=Ym}updateParams(e){super.updateParams(e);const t=e.filterParams;this.matcher=t.textMatcher??v4,this.formatter=t.textFormatter??(t.caseSensitive?w4:b4)}evaluateNullValue(e){return e?["notEqual","notContains","blank"].indexOf(e)>=0:!1}evaluateNonNullValue(e,t,s,i){const o=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 ra(t);if(s.type==="notBlank")return!ra(t);const u={api:r,colDef:a,column:l,context:c,node:i.node,data:i.data,filterOption:s.type,value:n,textFormatter:d};return o.some(h=>this.matcher({...u,filterText:h}))}processModelToApply(e){if(e&&this.params.filterParams.trimInput){const t=s=>{const i={...s},{filter:o,filterTo:n}=s;return o&&(i.filter=Qc(o)??null),n&&(i.filterTo=Qc(n)??null),i};return Of(e)?{...e,conditions:e.conditions.map(t)}:t(e)}return e}},y4=class extends qm{constructor(){super(...arguments),this.FilterModelFormatterClass=Ym,this.filterType="text",this.defaultOptions=su}createFloatingFilterInputService(){return this.createManagedBean(new $m)}};function x4(e){return!!e.quickFilter?.isFilterPresent()}function R4(e){return e.quickFilter?.getText()}function F4(e){e.quickFilter?.resetCache()}var E4=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:i}=this.beans,o=t.isPivotMode(),n=e?.getColumns(),r=t.getColDefCols();let a=(o&&!s.get("applyQuickFilterBeforePivotOrAgg")?i?.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 K(e)?e.toUpperCase():null}setFilter(e){if(e!=null&&typeof e!="string"){B(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 i=this.getTextForColumn(s,e);return K(i)&&i.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:i,matcher:o}=this;return o(i,s)}checkGenerateAggText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getAggText(e))}getTextForColumn(e,t){let s=this.beans.filterValueSvc.getValue(e,t);const i=e.getColDef();if(i.getQuickFilterText){const o=ue(this.gos,{value:s,node:t,data:t.data,column:e,colDef:i});s=i.getQuickFilterText(o)}return K(s)?s.toString().toUpperCase():null}getAggText(e){const t=[];for(const s of this.colsToUse){const i=this.getTextForColumn(s,e);K(i)&&t.push(i)}return t.join(`
|
|
60
60
|
`)}},D4={moduleName:"ClientSideRowModelFilter",version:$,rowModels:["clientSide"],beans:[P5]},iu={moduleName:"FilterCore",version:$,beans:[Z5],apiFunctions:{isAnyFilterPresent:q5,onFilterChanged:Y5},css:[L5],dependsOn:[D4]},Zm={moduleName:"FilterValue",version:$,beans:[Q5]},Aa={moduleName:"ColumnFilter",version:$,beans:[K5,X5],dynamicBeans:{headerFilterCellCtrl:M5},icons:{filter:"filter",filterActive:"filter"},apiFunctions:{isColumnFilterPresent:O5,getColumnFilterInstance:N5,destroyFilter:H5,setFilterModel:G5,getFilterModel:B5,getColumnFilterModel:V5,setColumnFilterModel:z5,showColumnFilter:W5,hideColumnFilter:_5,getColumnFilterHandler:j5,doFilterAction:U5},dependsOn:[iu,ka,Zm,k5]},P4={moduleName:"CustomFilter",version:$,userComponents:{agReadOnlyFloatingFilter:e4},dependsOn:[Aa]},M4={moduleName:"TextFilter",version:$,dependsOn:[Aa],userComponents:{agTextColumnFilter:{classImp:C4,params:{useForm:!0}},agTextColumnFloatingFilter:y4},dynamicBeans:{agTextColumnFilterHandler:S4}},T4={moduleName:"NumberFilter",version:$,dependsOn:[Aa],userComponents:{agNumberColumnFilter:{classImp:h4,params:{useForm:!0}},agNumberColumnFloatingFilter:m4},dynamicBeans:{agNumberColumnFilterHandler:g4}},I4={moduleName:"DateFilter",version:$,dependsOn:[Aa],userComponents:{agDateColumnFilter:{classImp:o4,params:{useForm:!0}},agDateInput:u4,agDateColumnFloatingFilter:c4},dynamicBeans:{agDateColumnFilterHandler:a4}},k4={moduleName:"QuickFilterCore",version:$,rowModels:["clientSide"],beans:[E4],dependsOn:[iu,Zm]},A4={moduleName:"QuickFilter",version:$,apiFunctions:{isQuickFilterPresent:x4,getQuickFilter:R4,resetQuickFilter:F4},dependsOn:[k4]},L4={moduleName:"ExternalFilter",version:$,dependsOn:[iu]},O4=".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}}",ec=(e,t,s)=>{const{editModelSvc:i}=e,o=i?.getCellValidationModel()?.getCellValidation(t)?.errorMessages,n=i?.getRowValidationModel().getRowValidation(t)?.errorMessages,r=o||n;return r?.length?r.join(s("tooltipValidationErrorSeparator",". ")):void 0},N4=class extends A{constructor(){super(...arguments),this.beanName="tooltipSvc"}setupHeaderTooltip(e,t,s,i){e&&t.destroyBean(e);const o=this.gos,n=Jl(o),{column:r,eGui:a}=t,l=r.getColDef();!i&&n&&!l.headerComponent&&(i=yr(()=>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?.(ue(o,{location:c,colDef:l,column:r,value:h,valueFormatted:u}))??l?.headerTooltip,shouldDisplayTooltip:i,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,i){e&&t.destroyBean(e);const o=this.gos,n=Jl(o),{column:r,eGui:a}=t,l=r.getColGroupDef();!i&&n&&!l?.headerGroupComponent&&(i=yr(()=>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?.(ue(o,{location:c,colDef:l,column:r,value:h,valueFormatted:u}))??l?.headerTooltip,shouldDisplayTooltip:i,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:i}=this,{gos:o,editSvc:n}=i,{column:r,rowNode:a}=e;let l="cell";const c=()=>{const p=!!!n?.isEditing(e)&&ec(i,e,this.getLocaleTextFunc());if(p)return l="cellEditor",p;l="cell";const f=r.getColDef(),C=a.data;if(f.tooltipField&&K(C))return sn(C,f.tooltipField,r.isTooltipFieldContainsDots());const w=f.tooltipValueGetter;return w?w(ue(o,{location:"cell",colDef:r.getColDef(),column:r,rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,value:e.value,valueFormatted:e.valueFormatted})):null},d=Jl(o);s||(d&&!e.isCellRenderer()?s=()=>{const h=!!n?.isEditing(e);if(!h&&ec(i,e,this.getLocaleTextFunc()))return!0;if(!r.isTooltipEnabled())return!1;const C=yr(()=>{const w=e.eGui;return w.children.length===0?w:w.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,i)}setupFullWidthRowTooltip(e,t,s,i){const o={getGui:()=>t.getFullWidthElement(),getTooltipValue:()=>s,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:i},n=this.beans,r=n.context;e&&t.destroyBean(e,r);const a=this.createTooltipFeature(o,n);if(a)return t.createBean(a,r)}setupCellEditorTooltip(e,t){const{beans:s}=this,{context:i}=s,o=t.getValidationElement?.(!0)||!t.isPopup?.()&&e.eGui;if(!o)return;const n={getGui:()=>o,getTooltipValue:()=>ec(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,i)}initCol(e){const{colDef:t}=e;e.tooltipEnabled=K(t.tooltipField)||K(t.tooltipValueGetter)||K(t.tooltipComponent)}createTooltipFeature(e,t){return this.beans.registry.createDynamicBean("tooltipFeature",!1,e,t)}},H4=class extends Rx{createTooltipComp(e,t){my(this.beans.userCompFactory,e)?.newAgStackInstance().then(t)}setEventHandlers(e){[this.onColumnMovedEventCallback]=this.addManagedEventListeners({columnMoved:e})}clearEventHandlers(){this.onColumnMovedEventCallback?.(),this.onColumnMovedEventCallback=void 0}},Xm={moduleName:"Tooltip",version:$,beans:[N4],dynamicBeans:{tooltipFeature:Ff,highlightTooltipFeature:Fx,tooltipStateManager:H4},userComponents:{agTooltipComponent:Px},dependsOn:[ka],css:[O4]},Ui=class{constructor(e){this.cellValueChanges=e}},tc=class extends Ui{constructor(e,t,s,i){super(e),this.initialRange=t,this.finalRange=s,this.ranges=i}},G4=10,sg=class{constructor(e){this.actionStack=[],this.maxStackSize=e||G4,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}},B4=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&&tm(this.activeCellEdit,t),i=this.activeRowEdit!==null&&tF(this.activeRowEdit,t);if(!(s||i||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 sg(s),this.redoStack=new sg(s),this.addListeners();const i=this.clearStacks.bind(this);this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this),modelUpdated:o=>{o.keepUndoRedoStack||this.clearStacks()},columnPivotModeChanged:i,newColumnsLoaded:i,columnGroupOpened:i,columnRowGroupChanged:i,columnMoved:i,columnPinned:i,columnVisible:i,rowDragEnd:i}),t.whenReady(this,o=>{this.gridBodyCtrl=o.gridBodyCtrl})}getCurrentUndoStackSize(){return this.undoStack?.getCurrentStackSize()??0}getCurrentRedoStackSize(){return this.redoStack?.getCurrentStackSize()??0}undo(e){const{eventSvc:t,undoStack:s,redoStack:i}=this;t.dispatchEvent({type:"undoStarted",source:e});const o=this.undoRedo(s,i,"initialRange","oldValue","undo");t.dispatchEvent({type:"undoEnded",source:e,operationPerformed:o})}redo(e){const{eventSvc:t,undoStack:s,redoStack:i}=this;t.dispatchEvent({type:"redoStarted",source:e});const o=this.undoRedo(i,s,"finalRange","newValue","redo");t.dispatchEvent({type:"redoEnded",source:e,operationPerformed:o})}undoRedo(e,t,s,i,o){if(!e)return!1;const n=e.pop();return n?.cellValueChanges?(this.processAction(n,r=>r[i],o),n instanceof tc?this.processRange(n.ranges||[n[s]]):this.processCell(n.cellValueChanges),t.push(n),!0):!1}processAction(e,t,s){for(const i of e.cellValueChanges){const{rowIndex:o,rowPinned:n,columnId:r}=i,a={rowIndex:o,rowPinned:n},l=xs(this.beans,a);l.displayed&&l.setDataValue(r,t(i),s)}}processRange(e){let t;const s=this.beans.rangeSvc;s.removeAllCellRanges(!0),e.forEach((i,o)=>{if(!i)return;const n=i.startRow,r=i.endRow;o===e.length-1&&(t={rowPinned:n.rowPinned,rowIndex:n.rowIndex,columnId:i.startColumn.getColId()},this.setLastFocusedCell(t));const a={rowStartIndex:n.rowIndex,rowStartPinned:n.rowPinned,rowEndIndex:r.rowIndex,rowEndPinned:r.rowPinned,columnStart:i.startColumn,columns:i.columns};s.addCellRange(a)})}processCell(e){const t=e[0],{rowIndex:s,rowPinned:i}=t,o={rowIndex:s,rowPinned:i},n=xs(this.beans,o),r={rowPinned:t.rowPinned,rowIndex:n.rowIndex,columnId:t.columnId};this.setLastFocusedCell(r)}setLastFocusedCell(e){const{rowIndex:t,columnId:s,rowPinned:i}=e,{colModel:o,focusSvc:n,rangeSvc:r}=this.beans,a=o.getCol(s);if(!a)return;const{scrollFeature:l}=this.gridBodyCtrl;l.ensureIndexVisible(t),l.ensureColumnVisible(a);const c={rowIndex:t,column:a,rowPinned:i};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 Ui(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 Ui(this.cellValueChanges);this.pushActionsToUndoStack(s)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new Ui(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new tc(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&&Us(s)?e=new tc(this.cellValueChanges,void 0,void 0,[...t.getCellRanges()]):e=new Ui(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 Ui(t??[]);this.pushActionsToUndoStack(s),this.cellValueChanges=[]}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}},V4=".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}",z4={tag:"div",cls:"ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit",children:[{tag:"ag-checkbox",ref:"eEditor",role:"presentation"}]},W4=class extends Ta{constructor(){super(z4,[Td]),this.eEditor=de}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:o=>this.setAriaLabel(o.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=Ra(t,e),i=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eEditor.setInputAriaLabel(`${i} (${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}},La=class extends Ta{constructor(e){super(),this.cellEditorInput=e,this.eEditor=de}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:i,eventKey:o,suppressPreventDefault:n}=e;s.getInputElement().setAttribute("title",""),t.init(s,e);let r,a=!0;i?(this.focusAfterAttached=!0,o===T.BACKSPACE||o===T.DELETE?r="":o&&o.length===1?n?a=!1:r=o:(r=t.getStartValue(),o!==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;Ys()||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()}},_4={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},j4=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return _4}getAgComponents(){return[mf]}init(e,t){this.eEditor=e,this.params=t;const{min:s,max:i,step:o,colDef:n}=t;s!=null&&e.setMin(s),i!=null&&e.setMax(i),o!=null&&e.setStep(o),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:i,max:o,getValidationErrors:n}=s;let r=[];const a=this.getLocaleTextFunc();if(t instanceof Date&&!isNaN(t.getTime())){if(i){const l=i instanceof Date?i:new Date(i);if(t<l){const c=l.toLocaleDateString();r.push(a("minDateValidation",`Date must be after ${c}`,[c]))}}if(o){const l=o instanceof Date?o:new Date(o);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!K(s)&&!K(t.value)?t.value:s??null}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return Mt(e,this.includeTime??!1)}},U4=class extends La{constructor(){super(new j4(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},$4={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},K4=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return $4}getAgComponents(){return[mf]}init(e,t){this.eEditor=e,this.params=t;const{min:s,max:i,step:o,colDef:n}=t;s!=null&&e.setMin(s),i!=null&&e.setMax(i),o!=null&&e.setStep(o),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,i=this.formatDate(this.parseDate(s??void 0)),{min:o,max:n,getValidationErrors:r}=t;let a=[];if(i){const l=new Date(i),c=this.getLocaleTextFunc();if(o){const d=new Date(o);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!K(s)&&!K(e.value)?e.value:e.parseValue(s??"")}getStartValue(){return Mt(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):St(e)??void 0}formatDate(e){const t=this.getDataTypeService();return t?t.getDateFormatterFunction(this.params.column)(e):Mt(e??null,this.includeTime??!1)??void 0}},q4=class extends La{constructor(){super(new K4(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},Y4={tag:"div",cls:"ag-large-text",children:[{tag:"ag-input-text-area",ref:"eEditor",cls:"ag-large-text-input"}]},Z4=class extends Ta{constructor(){super(Y4,[Ly]),this.eEditor=de}initialiseEditor(e){const{eEditor:t}=this,{cellStartedEdit:s,eventKey:i,maxLength:o,cols:n,rows:r}=e;this.focusAfterAttached=s,t.getInputElement().setAttribute("title",""),t.setMaxLength(o||200).setCols(n||60).setRows(r||10);let a;s?(this.focusAfterAttached=!0,i===T.BACKSPACE||i===T.DELETE?a="":i&&i.length===1?a=i:(a=this.getStartValue(e),i!==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,i=this.getLocaleTextFunc();e.setInputAriaLabel(i("ariaInputEditor","Input Editor")),t&&(e.getFocusableElement().focus(),s&&e.getInputElement().select())}getValue(){const{eEditor:e,params:t}=this,{value:s}=t,i=e.getValue();return!K(i)&&!K(s)?s:t.parseValue(i)}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:s}=e,i=this.getLocaleTextFunc(),o=this.getValue();let n=[];return typeof o=="string"&&t!=null&&o.length>t&&n.push(i("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),n.length||(n=null),s?s({value:o,internalErrors:n,cellEditorParams:e}):n}},X4={tag:"ag-input-number-field",ref:"eEditor",cls:"ag-cell-editor"},Q4=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return X4}getAgComponents(){return[Oy]}init(e,t){this.eEditor=e,this.params=t;const{max:s,min:i,precision:o,step:n}=t;s!=null&&e.setMax(s),i!=null&&e.setMin(i),o!=null&&e.setPrecision(o),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:i}=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),i?i({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(!K(s)&&!K(t.value))return t.value;let i=t.parseValue(s);if(i==null)return i;if(typeof i=="string"){if(i==="")return null;i=Number(i)}return isNaN(i)?null:i}getStartValue(){return this.params.value}setCaret(){Ys()&&this.eEditor.getInputElement().focus({preventScroll:!0})}},J4=class extends La{constructor(){super(new Q4(()=>this.getLocaleTextFunc()))}},eM={tag:"div",cls:"ag-cell-edit-wrapper",children:[{tag:"ag-select",ref:"eEditor",cls:"ag-cell-editor"}]},tM=class extends Ta{constructor(){super(eM,[$y]),this.eEditor=de,this.startedByEnter=!1}wireBeans(e){this.valueSvc=e.valueSvc}initialiseEditor(e){this.focusAfterAttached=e.cellStartedEdit;const{eEditor:t,valueSvc:s,gos:i}=this,{values:o,value:n,eventKey:r}=e;if(ze(o)){B(58);return}this.startedByEnter=r!=null?r===T.ENTER:!1;let a=!1;o.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),i.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,i=this.getValue();let o=[];if(t&&!t.includes(i)){const n=this.getLocaleTextFunc();o.push(n("invalidSelectionValidation","Invalid selection."))}else o=null;return s?s({value:i,internalErrors:o,cellEditorParams:e}):o}},sM={tag:"ag-input-text-field",ref:"eEditor",cls:"ag-cell-editor"},iM=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return sM}getAgComponents(){return[Ea]}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,i=this.getValue(),o=this.getLocaleTextFunc();let n=[];return t!=null&&typeof i=="string"&&i.length>t&&n.push(o("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),n.length||(n=null),s?s({value:i,cellEditorParams:e,internalErrors:n}):n}getValue(){const{eEditor:e,params:t}=this,s=e.getValue();return!K(s)&&!K(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(){Ys()&&this.eEditor.getInputElement().focus({preventScroll:!0});const e=this.eEditor,t=e.getValue(),s=K(t)&&t.length||0;s&&e.getInputElement().setSelectionRange(s,s)}},ig=class extends La{constructor(){super(new iM(()=>this.getLocaleTextFunc()))}};function oM(e){return e.ctrlsSvc.getScrollFeature().getVScrollPosition()}function nM(e){return e.ctrlsSvc.getScrollFeature().getHScrollPosition()}function Qm(e,t,s="auto"){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureColumnVisible(t,s),"ensureVisible")}function Jm(e,t,s){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureIndexVisible(t,s),"ensureVisible")}function rM(e,t,s=null){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureNodeVisible(t,s),"ensureVisible")}function aM(e){e.undoRedo?.undo("api")}function lM(e){e.undoRedo?.redo("api")}function cM(e,t){return e.editModelSvc?.getEditRowDataValue(t,{checkSiblings:!0})}function dM(e){const t=e.editModelSvc?.getEditMap(),s=[];return t?.forEach((i,o)=>{const{rowIndex:n,rowPinned:r}=o;i.forEach((a,l)=>{const{editorValue:c,pendingValue:d,sourceValue:u,state:h}=a,p=vs(a);let f=c??d;f===jt&&(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 uM(e,t=!1){const{editSvc:s}=e;if(s?.isBatchEditing()){if(t)for(const i of e.editModelSvc?.getEditPositions()??[])i.state==="editing"&&s.revertSingleCellEdit(i);else ni(e,{persist:!0});ro(e,void 0,{cancel:t})}else s?.stopEditing(void 0,{cancel:t,source:"edit",forceStop:!t,forceCancel:t})}function hM(e,t){const s=Ve(e,t);return e.editSvc?.isEditing(s)??!1}function gM(e,t){const{key:s,colKey:i,rowIndex:o,rowPinned:n}=t,{editSvc:r,colModel:a}=e,l=a.getCol(i);if(!l){B(12,{colKey:i});return}const d=xs(e,{rowIndex:o,rowPinned:n||null});if(!d){B(290,{rowIndex:o,rowPinned:n});return}if(!l.isCellEditable(d))return;n==null&&Jm(e,o),Qm(e,i),r?.startEditing({rowNode:d,column:l},{event:s?new KeyboardEvent("keydown",{key:s}):void 0,source:"api"})}function pM(e){return e.editSvc?.validateEdit()||null}function fM(e){return e.undoRedo?.getCurrentUndoStackSize()??0}function mM(e){return e.undoRedo?.getCurrentRedoStackSize()??0}var CM={tag:"div",cls:"ag-popup-editor",attrs:{tabindex:"-1"}},vM=class extends Dd{constructor(e){super(CM),this.params=e}postConstruct(){wi(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params,s=i=>{Bc(this.gos,i,t.node,t.column,!0)||t.onKeyDown(i)};this.addManagedElementListeners(e,{keydown:s})}};function wM(e,{column:t},s,i,o="ui"){if(s instanceof KeyboardEvent&&(s.key===T.TAB||s.key===T.ENTER||s.key===T.F2||s.key===T.BACKSPACE&&i))return!0;if(s?.shiftKey&&e.rangeSvc?.getCellRanges().length!=0)return!1;const r=t?.getColDef(),a=bM(e.gos,r),l=s?.type;return l==="click"&&s?.detail===1&&a===1||l==="dblclick"&&s?.detail===2&&a===2?!0:o==="api"?i??!1:!1}function bM(e,t){return e.get("suppressClickEdit")===!0?0:e.get("singleClickEdit")===!0||t?.singleClickEdit?1:2}function Jc(e,{rowNode:t,column:s},i="ui"){const o=s.getColDef().editable,n=e.editModelSvc;return s.isColumnFunc(t,o)||!!n&&n.hasEdits({rowNode:t,column:s},{withOpenEditor:!0})}function SM(e,t,s="ui"){const i=Jc(e,t,s);return i===!0||s==="ui"?i:e.colModel.getCols().some(n=>Jc(e,{rowNode:t.rowNode,column:n},s))}var aa=(e,t=!1)=>{if(e!==void 0)return vs(e)||t&&e.state==="editing"};function eC(e,t,s=!1){return aa(e.editModelSvc?.getEdit(t),s)}var tC=(e,t,s)=>{if(e)for(let i=0,o=e.length;i<o;++i){const n=e[i];if(n.data&&(aa(t?.getEdit({rowNode:n,column:s}))||aa(t?.getEdit({rowNode:n.pinnedSibling,column:s})))||tC(n.childrenAfterGroup,t,s))return!0}};function sC(e,t){const{column:s,rowNode:i}=t;return e.gos.get("groupTotalRow")&&!i?.footer?!1:tC(i?.childrenAfterGroup,e.editModelSvc,s)}function iC(e,{rowNode:t,column:s}){if(t=t.pinnedSibling,!!t)return aa(e.editModelSvc?.getEdit({rowNode:t,column:s}))}var yM=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 o=eC(s,e)||sC(s,e)||iC(s,e);this.applyBatchingStyle(o)}else this.applyBatchingStyle(!1);const i=!!this.editModelSvc?.getCellValidationModel().hasCellValidation(this.cellCtrl);this.cellComp.toggleCss("ag-cell-editing-error",i)}applyBatchingStyle(e){this.cellComp.toggleCss("ag-cell-editing",e??!1),this.cellComp.toggleCss("ag-cell-batch-edit",(e&&this.editSvc?.isBatchEditing())??!1)}},xM=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 i=e.rowNode,o=t?.getEditRow(i);const n=this.editModelSvc?.getRowValidationModel().hasRowValidation({rowNode:i});if(!o&&i.pinnedSibling&&(i=i.pinnedSibling,o=t?.getEditRow(i)),o){const r=Array.from(o.keys()).some(a=>{const l={rowNode:i,column:a};return eC(s,l,!0)||sC(s,l)||iC(s,l)});this.applyStyle(n,r);return}this.applyStyle(n)}applyStyle(e=!1,t=!1){const s=this.editSvc?.isBatchEditing()??!1,i=this.gos.get("editType")==="fullRow";this.rowCtrl?.forEachGui(void 0,({rowComp:o})=>{o.toggleCss("ag-row-editing",i&&t),o.toggleCss("ag-row-batch-edit",i&&t&&s),o.toggleCss("ag-row-inline-editing",t),o.toggleCss("ag-row-not-inline-editing",!t),o.toggleCss("ag-row-editing-invalid",i&&t&&e)})}},RM=({rowModel:e,pinnedRowModel:t,editModelSvc:s},i)=>{const o=new Set;e.forEachNode(n=>i.has(n)&&o.add(n)),t?.forEachPinnedRow("top",n=>i.has(n)&&o.add(n)),t?.forEachPinnedRow("bottom",n=>i.has(n)&&o.add(n));for(const n of i)o.has(n)||s.removeEdits({rowNode:n});return o},FM=({editModelSvc:e},t,s)=>{for(const i of t)e?.getEditRow(i)?.forEach((o,n)=>!s.has(n)&&e.removeEdits({rowNode:i,column:n}))},EM=e=>()=>{const t=new Set(e.colModel.getCols()),s=e.editModelSvc.getEditMap(!0),i=new Set(s.keys());FM(e,RM(e,i),t)},DM=new Set(["undo","redo","paste","bulk","rangeSvc"]),PM=new Set(["ui","api"]),oC={paste:"api",rangeSvc:"api",fillHandle:"api",cellClear:"api",bulk:"api"},MM=new Set(Object.keys(oC)),TM=new Set(["paste","rangeSvc","renderer","cellClear","redo","undo"]),Cr={cancel:!0,source:"api"},IM={cancel:!1,source:"api"},Wi={checkSiblings:!0},Go={force:!0,suppressFlash:!0},kM=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:i})=>{this.stopEditing(void 0,Cr),this.createStrategy(i)});const t=EM(e),s=()=>{const i=this.model.getCellValidationModel().getCellValidationMap().size>0,o=this.model.getRowValidationModel().getRowValidationMap().size>0;return i||o?this.stopEditing(void 0,Cr):this.isEditing()&&(this.isBatchEditing()?ro(e,this.model.getEditPositions()):this.stopEditing(void 0,IM)),!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,Cr)):(this.stopEditing(void 0,Cr),this.batch=!1)}createStrategy(e){const{beans:t,gos:s,strategy:i}=this,o=og(s,e);if(i){if(i.beanName===o)return i;this.destroyStrategy()}return this.strategy=this.createOptionalManagedBean(t.registry.createDynamicBean(o,!0))}destroyStrategy(){this.strategy&&(this.strategy.destroy(),this.strategy=this.destroyBean(this.strategy))}shouldStartEditing(e,t,s,i="ui"){const o=wM(this.beans,e,t,s,i);return o&&(this.strategy??(this.strategy=this.createStrategy())),o}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 KD(this.beans)}isEditing(e,t){return this.model.hasEdits(e,t??Wi)}isRowEditing(e,t){return(e&&this.model.hasRowEdits(e,t))??!1}startEditing(e,t){const{startedEdit:s=!0,event:i=null,source:o="ui",ignoreEventKey:n=!1,silent:r}=t;if(this.strategy??(this.strategy=this.createStrategy()),!this.isCellEditable(e,"api"))return;const a=Ve(this.beans,e);if(a&&!a.comp){a.onCompAttachedFuncs.push(()=>this.startEditing(e,t));return}const l=this.shouldStartEditing(e,i,s,o);if(l===!1&&o!=="api"){this.isEditing(e)&&this.stopEditing();return}!this.batch&&this.shouldStopEditing(e,void 0,o)&&!t.continueEditing&&this.stopEditing(void 0,{source:o}),l&&this.isBatchEditing()&&this.dispatchBatchEvent("batchEditingStarted",new Map),this.strategy.start({position:e,event:i,source:o,ignoreEventKey:n,startedEdit:s,silent:r})}stopEditing(e,t){const{event:s,cancel:i,source:o="ui",forceCancel:n,forceStop:r}=t||{},{beans:a,model:l}=this;if(MM.has(o)&&this.isBatchEditing())return this.bulkRefresh(e),!1;const c=this.committing?oC[o]:o;if(!(this.committing||this.isEditing(e)||this.isBatchEditing()&&l.hasEdits(e,Wi))||!this.strategy||this.stopping)return!1;this.stopping=!0;const u=Ve(a,e);u&&(u.onEditorAttachedFuncs=[]);let h=l.getEditMap(!0),p=!1;const f=!i&&(!!this.shouldStopEditing(e,s,c)||this.committing&&!this.batch)||(r??!1),C=i&&!!this.shouldCancelEditing(e,s,c)||(n??!1);if(f||C){ni(a,{persist:!0,isCancelling:C||i,isStopping:f});const w=l.getEditMap(),v=this.processEdits(w,i,o);this.strategy?.stop(i,s);for(const b of v)l.clearEditValue(b);this.bulkRefresh(void 0,h);for(const b of l.getEditPositions(w)){const S=Ve(a,b),y=vs(b);S?.refreshCell({force:!0,suppressFlash:!y})}h=w,p||(p=f)}else if(s instanceof KeyboardEvent&&this.batch&&this.strategy?.midBatchInputsAllowed(e)&&this.isEditing(e,{withOpenEditor:!0})){const{key:w}=s,v=w===T.ENTER,b=w===T.ESCAPE,S=w===T.TAB;(v||S||b)&&(v||S?ni(a,{persist:!0}):b&&this.revertSingleCellEdit(u),this.isBatchEditing()?this.strategy?.cleanupEditors():ro(a,l.getEditPositions(),{event:s,cancel:b}),s.preventDefault(),this.bulkRefresh(e,h,{suppressFlash:!0}),h=l.getEditMap())}else ni(a,{persist:!0}),h=l.getEditMap();return p&&e&&this.model.removeEdits(e),this.navigateAfterEdit(t,u?.cellPosition),Kc(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:i}=e;if(!(s instanceof KeyboardEvent)||i)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 i=Array.from(e.keys()),o=this.model.getCellValidationModel().getCellValidationMap().size>0||this.model.getRowValidationModel().getRowValidationMap().size>0,n=[];for(const r of i){const a=e.get(r);for(const l of a.keys()){const c=a.get(l),d={rowNode:r,column:l},u=vs(c);!t&&u&&!o&&(this.setNodeDataValue(r,l,c.pendingValue,void 0,s)||n.push(d))}}return n}setNodeDataValue(e,t,s,i,o="edit"){const{beans:n}=this,r=Ve(n,{rowNode:e,column:t}),a=PM.has(o)?"edit":o;r&&(r.suppressRefreshCell=!0),this.commitNextEdit();const l=e.setDataValue(t,s,a);return r&&(r.suppressRefreshCell=!1),i&&r?.refreshCell(Go),l}setEditMap(e,t){this.strategy??(this.strategy=this.createStrategy()),this.strategy?.setEditMap(e,t),this.bulkRefresh();let s=Go;t?.forceRefreshOfEditCellsOnly&&(s={...AM(e),...Go}),this.beans.rowRenderer.refreshCells(s)}dispatchEditValuesChanged({rowNode:e,column:t},s={}){if(!e||!t||!s)return;const{pendingValue:i,sourceValue:o}=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:i,oldValue:o,value:i,colDef:t.getColDef()})}bulkRefresh(e={},t,s={}){const{beans:i,gos:o}=this,{editModelSvc:n,rowModel:r}=i;$e(o)&&(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,i={}){const{beans:o,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)Ve(o,{rowNode:u,column:t})?.refreshCell(i);for(const u of a)Ve(o,{rowNode:u,column:t})?.refreshCell(i)}stopAllEditing(e=!1,t="ui"){this.isEditing()&&this.stopEditing(void 0,{cancel:e,source:t})}isCellEditable(e,t="ui"){const{rowNode:s}=e,{gos:i,beans:o}=this;if(s.group){if(i.get("treeData")){if(!s.data&&!i.get("enableGroupEdit"))return!1}else if(!i.get("enableGroupEdit"))return!1}const n=og(i)==="fullRow"?SM(o,e,t):Jc(o,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 i=Ve(this.beans,e);return this.cellEditingInvalidCommitBlocks()?(t?.preventDefault?.(),s&&(!i?.hasBrowserFocus()&&i?.focusCell(),i?.comp?.getCellEditor()?.focusIn?.()),"block-stop"):(i&&this.revertSingleCellEdit(i),"revert-continue")}return"continue"}revertSingleCellEdit(e,t=!1){const s=Ve(this.beans,e);s?.comp?.getCellEditor()&&(ro(this.beans,[e],{silent:!0}),this.model.clearEditValue(e),mo(this.beans,e,{silent:!0}),yi(this.beans),s?.refreshCell(Go),t&&(s?.focusCell(),s?.comp?.getCellEditor()?.focusIn?.()))}hasValidationErrors(e){yi(this.beans);const t=Ve(this.beans,e);t&&(t.refreshCell(Go),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,i="ui"){let o;const n=this.isEditing(),r=n&&this.checkNavWithValidation(void 0,s)==="block-stop";return e instanceof ao&&n&&(o=this.strategy?.moveToNextEditingCell(e,t,s,i,r)),o===null||(o=o||!!this.beans.focusSvc.focusedHeader,o===!1&&!r&&this.stopEditing()),o}getCellDataValue({rowNode:e,column:t},s=!0){if(!e||!t)return;let i=this.model.getEdit({rowNode:e,column:t});const o=e.pinnedSibling;if(o){const r=this.model.getEdit({rowNode:o,column:t});r&&(i=r)}const n=s?i?.editorValue??i?.pendingValue:i?.pendingValue;return n===jt||!i?i?.sourceValue??this.valueSvc.getValue(t,e,!1,"api"):n}addStopEditingWhenGridLosesFocus(e){zD(this,this.beans,e)}createPopupEditorWrapper(e){return new vM(e)}commitNextEdit(){this.committing=!0}setDataValue(e,t,s){try{if((!this.isEditing()||this.committing)&&!TM.has(s))return;const{beans:i}=this;this.strategy??(this.strategy=this.createStrategy());const o=this.isBatchEditing()?"ui":this.committing?s??"api":"api";if(!s||DM.has(s))return Or(i,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 Or(i,e,t,s,void 0,{persist:!0}),this.stopEditing(e,{source:o,suppressNavigateAfterEdit:!0}),!0;if(n.sourceValue===t)return i.editModelSvc?.removeEdits(e),this.dispatchEditValuesChanged(e,{...n,pendingValue:t}),!0}return Or(i,e,t,s,void 0,{persist:!0}),this.stopEditing(e,{source:o,suppressNavigateAfterEdit:!0}),!0}finally{this.committing=!1}}handleColDefChanged(e){jD(this.beans,e)}destroy(){this.model.clear(),this.destroyStrategy(),super.destroy()}prepDetailsDuringBatch(e,t){if(!this.batch||!this.model.hasRowEdits(e.rowNode,Wi))return;const{rowNode:i,column:o}=e,{compDetails:n,valueToDisplay:r}=t;if(n){const{params:l}=n;return l.data=this.model.getEditRowDataValue(i,Wi),{compDetails:n}}const a=this.model.getEditRow(e.rowNode,Wi);if(r!==void 0&&a?.has(o))return{valueToDisplay:this.valueSvc.getValue(o,i)}}cleanupEditors(){this.strategy?.cleanupEditors()}dispatchCellEvent(e,t,s,i){this.strategy?.dispatchCellEvent(e,t,s,i)}dispatchBatchEvent(e,t){this.eventSvc.dispatchEvent(this.createBatchEditEvent(e,t))}createBatchEditEvent(e,t){return ue(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:i,rangeSvc:o,valueSvc:n}=this;ni(i,{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(o?.forEachRowInRange(c,d=>{const u=xs(i,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(),Kc(i),this.bulkRefresh();return}this.commitNextEdit(),this.stopEditing(void 0,{source:"bulk"}),this.eventSvc.dispatchEvent({type:"bulkEditingStopped",changes:this.toEventChangeList(r)})}),this.bulkRefresh();const l=Ve(i,{rowNode:e,column:t});l&&l.focusCell(!0)}createCellStyleFeature(e,t){return new yM(e,t)}createRowStyleFeature(e,t){return new xM(e,t)}setEditingCells(e,t){const{beans:s}=this,{colModel:i,valueSvc:o}=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?i.getCol(r):l?i.getCol(l):a;if(!p)continue;const f=xs(s,{rowIndex:c,rowPinned:d});if(!f)continue;const C=o.getValue(p,f,!0,"api");if(!t?.forceRefreshOfEditCellsOnly&&!vs({pendingValue:u,sourceValue:C})&&h!=="editing")continue;let w=n.get(f);w||(w=new Map,n.set(f,w)),u===void 0&&(u=jt),w.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=Ve(this.beans,e);if(!t||!this.isEditing(t,Wi))return;const s=this.model.getEdit(t);if(!s||!vs(s))return;const o=this.getLocaleTextFunc()("ariaPendingChange","Pending Change");this.beans.ariaAnnounce?.announceValue(o,"pendingChange")}allowedFocusTargetOnValidation(e){return Ve(this.beans,e)}};function AM(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 og(e,t){return t??e.get("editType")??"singleCell"}var nC=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:i,beans:o}=this,n=e.type==="cellFocused"?e.sourceEvent:null;s&&(t=Ve(o,s));const{gos:r,editModelSvc:a}=o,l=e.type==="cellFocusCleared";if(i.isEditing(void 0,{withOpenEditor:!0})){const{column:c,rowIndex:d,rowPinned:u}=e,h={column:c,rowNode:xs(o,{rowIndex:d,rowPinned:u})},p=r.get("invalidEditValueMode")==="block";if(p)return;const f=!p,C=!!a?.getCellValidationModel().hasCellValidation(h),w=f&&C;(s||l?i.stopEditing(void 0,{cancel:w,source:l&&f?"api":void 0,event:n}):!0)||(i.isBatchEditing()?i.cleanupEditors():i.stopEditing(void 0,{source:"api"}))}t?.refreshCell({suppressFlash:!0,force:!0})}stop(e,t){const s=this.model.getEditPositions(),i={all:[],pass:[],fail:[]};for(const o of s){if(i.all.push(o),(this.model.getCellValidationModel().getCellValidation(o)?.errorMessages?.length??0)>0){i.fail.push(o);continue}i.pass.push(o)}if(e)for(const o of s)oa(this.beans,o,{cancel:e}),this.model.stop(o);else{const o=this.processValidationResults(i);if(o.destroy.length>0)for(const n of o.destroy)oa(this.beans,n,{event:t,cancel:e}),this.model.stop(n);if(o.keep.length>0)for(const n of o.keep){const r=Ve(this.beans,n);this.editSvc?.cellEditingInvalidCommitBlocks()||r&&this.editSvc.revertSingleCellEdit(r)}}return!0}cleanupEditors({rowNode:e}={},t){ni(this.beans,{persist:!1});const s=this.model.getEditPositions(),i=[];if(e)for(const o of s)o.rowNode!==e&&i.push(o);else for(const o of s)i.push(o);ro(this.beans,i),Kc(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 i=this.beans.gos.get("editType")==="fullRow";e.focusCell(i),e.onEditorAttachedFuncs.push(()=>t?.getCellEditor()?.focusIn?.())}}setupEditors(e){const{event:t,ignoreEventKey:s=!1,startedEdit:i,position:o,cells:n=this.model.getEditPositions()}=e,r=t instanceof KeyboardEvent&&!s&&t.key||void 0;_D(this.beans,n,o,r,t,i)}dispatchCellEvent(e,t,s,i){const o=Ve(this.beans,e);o&&this.eventSvc.dispatchEvent({...o.createEvent(t??null,s),...i})}dispatchRowEvent(e,t,s){if(s)return;const i=qd(this.beans,e);i&&this.eventSvc.dispatchEvent(i.createRowEvent(t))}shouldStop(e,t,s="ui"){const i=this.editSvc.isBatchEditing();return i&&s==="api"?!0:i&&(s==="ui"||s==="edit")?!1:s==="api"?!0:t instanceof KeyboardEvent&&!i?t.key===T.ENTER:null}shouldCancel(e,t,s="ui"){const i=this.editSvc.isBatchEditing();return!!(t instanceof KeyboardEvent&&!i&&t.key===T.ESCAPE||i&&s==="api"||s==="api")}setEditMap(e,t){t?.update||this.editSvc.stopEditing(void 0,{cancel:!0,source:"api"});const s=[];if(e.forEach((i,o)=>{i.forEach((n,r)=>{n.state==="editing"&&s.push({...n,rowNode:o,column:r})})}),t?.update&&(e=new Map([...this.model.getEditMap(),...e])),this.model?.setEditMap(e),s.length>0){const i=s.at(-1),o=i.pendingValue===jt?void 0:i.pendingValue;this.start({position:i,event:new KeyboardEvent("keydown",{key:o}),source:"api"});const n=Ve(this.beans,i);n&&this.setFocusInOnEditor(n)}}destroy(){this.cleanupEditors(),super.destroy()}},LM=class extends nC{constructor(){super(...arguments),this.beanName="fullRow",this.startedRows=[]}shouldStop(e,t,s="ui"){const{rowNode:i}=e||{};if(!qd(this.beans,{rowNode:this.rowNode}))return!0;const n=super.shouldStop({rowNode:this.rowNode},t,s);return n!==null?n:this.rowNode?i!==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:i,event:o,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:i,event:o,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 i=[];if(e||this.model.getEditMap().forEach((o,n)=>{if(!(!o||o.size===0)){for(const r of o.values())if(vs(r)){i.push(n);break}}}),yi(this.beans),!e&&this.editSvc?.checkNavWithValidation({rowNode:s})==="block-stop")return!1;super.stop(e,t);for(const o of i)this.dispatchRowEvent({rowNode:o},"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 i=Ve(this.beans,s);this.gos.get("invalidEditValueMode")==="block"&&i&&(this.model.getCellValidationModel().getCellValidation(i)||this.model.getRowValidationModel().getRowValidation(i))||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,i="ui",o=!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&&!o?u?r.focusCell(!0,s):(r.comp?.getCellEditor()||mo(this.beans,r,{event:s,cellStartedEdit:!0}),this.setFocusInOnEditor(r),r.focusCell(!1,s)):(c&&o&&this.setFocusInOnEditor(r),r.focusCell(!0,s)),!d&&!o&&(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:i,ignoreEventKey:!0})),e.rowCtrl?.refreshRow({suppressFlash:!0,force:!0}),!0}restoreEditors(){this.model.getEditMap().forEach((e,t)=>e.forEach(({state:s},i)=>{if(s!=="editing")return;const o=Ve(this.beans,{rowNode:t,column:i});o&&!o.comp?.getCellEditor()&&mo(this.beans,o,{silent:!0})}))}destroy(){super.destroy(),this.rowNode=void 0,this.startedRows.length=0}},OM=class extends nC{constructor(){super(...arguments),this.beanName="singleCell"}shouldStop(e,t,s="ui"){const i=super.shouldStop(e,t,s);if(i!==null)return i;const{rowNode:o,column:n}=e||{};return(!this.rowNode||!this.column)&&o&&n?null:this.rowNode!==o||this.column!==n}midBatchInputsAllowed(e){return this.model.hasEdits(e)}start(e){const{position:t,startedEdit:s,event:i,ignoreEventKey:o}=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:i,ignoreEventKey:o})}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:i,column:o,rowPinned:n}=e,r=xs(this.beans,{rowIndex:i,rowPinned:n}),a=$c(o),l=t.getCol(a),c=e.previousParams;if(c){const d=$c(c.column);if(c?.rowIndex===i&&d===a&&c?.rowPinned===n)return}s?.isEditing({rowNode:r,column:l},{withOpenEditor:!0})&&e.type==="cellFocused"||super.onCellFocusChanged(e)}moveToNextEditingCell(e,t,s,i="ui",o=!1){const n=this.beans.focusSvc.getFocusedCell();n&&(e=qi(this.beans,n)??e);const r=e.cellPosition;let a;const l=this.beans.gos.get("editType")==="fullRow";l&&this.model.suspend(!0),o||(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&&!o&&this.setFocusOutOnEditor(e);const p=this.gos.get("suppressStartEditOnTab");if(!h&&!o&&(super.cleanupEditors(a,!0),p?a.focusCell(!0,s):this.editSvc.startEditing(a,{startedEdit:!0,event:s,source:i,ignoreEventKey:!0})),u&&!o){if(a.focusCell(!1,s),p)a.focusCell(!0,s);else if(!a.comp?.getCellEditor()){const f=this.editSvc?.isEditing(a,{withOpenEditor:!0});mo(this.beans,a,{event:s,cellStartedEdit:!0,silent:f}),this.setFocusInOnEditor(a),this.cleanupEditors(a)}}else u&&o&&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}},Xs={moduleName:"EditCore",version:$,beans:[VD,kM],apiFunctions:{getEditingCells:dM,getEditRowValues:cM,getCellEditorInstances:WD,startEditingCell:gM,stopEditing:uM,isEditing:hM,validateEdit:pM},dynamicBeans:{singleCell:OM,fullRow:LM},dependsOn:[ka,Xm],css:[V4]},NM={moduleName:"UndoRedoEdit",version:$,beans:[B4],apiFunctions:{undoCellEditing:aM,redoCellEditing:lM,getCurrentUndoSize:fM,getCurrentRedoSize:mM},dependsOn:[Xs]},HM={moduleName:"TextEditor",version:$,userComponents:{agCellEditor:ig,agTextCellEditor:ig},dependsOn:[Xs]},GM={moduleName:"NumberEditor",version:$,userComponents:{agNumberCellEditor:{classImp:J4}},dependsOn:[Xs]},BM={moduleName:"DateEditor",version:$,userComponents:{agDateCellEditor:U4,agDateStringCellEditor:q4},dependsOn:[Xs]},VM={moduleName:"CheckboxEditor",version:$,userComponents:{agCheckboxCellEditor:W4},dependsOn:[Xs]},zM={moduleName:"SelectEditor",version:$,userComponents:{agSelectCellEditor:tM},dependsOn:[Xs]},WM={moduleName:"LargeTextEditor",version:$,userComponents:{agLargeTextCellEditor:Z4},dependsOn:[Xs]},_M={moduleName:"CustomEditor",version:$,dependsOn:[Xs]},jM=class extends A{constructor(){super(...arguments),this.beanName="selectionColSvc"}postConstruct(){this.addManagedPropertyListener("rowSelection",e=>{this.onSelectionOptionsChanged(e.currentValue,e.previousValue,to(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),vS(e))}createColumns(e,t){const s=()=>{Yr(this.beans,this.columns?.tree),this.columns=null},i=e.treeDepth,n=(this.columns?.treeDepth??-1)==i,r=this.generateSelectionCols();if(CS(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=>!Ps(f));return[...r,...p]})}updateColumns(e){const t=to(e.source);for(const s of this.columns?.list??[]){const i=this.createSelectionColDef(e.currentValue);s.setColDef(i,null,t),$t(this.beans,{state:[{...i,colId:s.getColId()}]},t)}}getColumn(e){return this.columns?.list.find(t=>en(t,e))??null}getColumns(){return this.columns?.list??null}isSelectionColumnEnabled(){const{gos:e,beans:t}=this,s=e.get("rowSelection");if(typeof s!="object"||!ci(e))return!1;const i=(t.autoColSvc?.getColumns()?.length??0)>0;if(s.checkboxLocation==="autoGroupColumn"&&i)return!1;const o=!!eo(s),n=Fr(s);return o||n}createSelectionColDef(e){const{gos:t}=this,s=e??t.get("selectionColumnDef"),i=t.get("enableRtl"),{rowSpan:o,spanRows:n,...r}=s??{};return{width:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:i?"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:$p,chartDataType:"excluded"}}generateSelectionCols(){if(!this.isSelectionColumnEnabled())return[];const e=this.createSelectionColDef(),t=e.colId;this.gos.validateColDef(e,t,!0);const s=new Pi(e,null,t,!1);return this.createBean(s),[s]}onSelectionOptionsChanged(e,t,s){const i=t&&typeof t!="string"?eo(t):void 0,o=e&&typeof e!="string"?eo(e):void 0,n=i!==o,r=t&&typeof t!="string"?Fr(t):void 0,a=e&&typeof e!="string"?Fr(e):void 0,l=r!==a,c=Ur(e),d=Ur(t);(n||l||c!==d)&&this.beans.colModel.refreshAll(s)}destroy(){Yr(this.beans,this.columns?.tree),super.destroy()}refreshVisibility(e,t,s){if(!this.columns?.list.length)return;const i=e.length+t.length+s.length;if(i===0)return;const o=this.columns.list[0];if(!o.isVisible())return;const n=()=>{let l;switch(o.pinned){case"left":case!0:l=e;break;case"right":l=s;break;default:l=t}l&&qt(l,o)};(this.beans.rowNumbersSvc?.getColumn(Kp)?2:1)===i&&n()}};function UM(e,t){if(!t.nodes.every(r=>r.rowPinned&&!An(r)?(B(59),!1):r.id===void 0?(B(60),!1):!0))return;const{nodes:i,source:o,newValue:n}=t;e.selectionSvc?.setNodesSelected({nodes:i,source:o??"api",newValue:n})}function $M(e,t,s="apiSelectAll"){e.selectionSvc?.selectAllRowNodes({source:s,selectAll:t})}function KM(e,t,s="apiSelectAll"){e.selectionSvc?.deselectAllRowNodes({source:s,selectAll:t})}function qM(e,t="apiSelectAllFiltered"){e.selectionSvc?.selectAllRowNodes({source:t,selectAll:"filtered"})}function YM(e,t="apiSelectAllFiltered"){e.selectionSvc?.deselectAllRowNodes({source:t,selectAll:"filtered"})}function ZM(e,t="apiSelectAllCurrentPage"){e.selectionSvc?.selectAllRowNodes({source:t,selectAll:"currentPage"})}function XM(e,t="apiSelectAllCurrentPage"){e.selectionSvc?.deselectAllRowNodes({source:t,selectAll:"currentPage"})}function QM(e){return e.selectionSvc?.getSelectedNodes()??[]}function JM(e){return e.selectionSvc?.getSelectedRows()??[]}var eT=class extends y2{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=$r(e),this.groupSelectsDescendants=mn(e),this.groupSelectsFiltered=qr(e)==="filteredDescendants",this.masterSelectsDetail=Yu(e)==="detail",this.addManagedPropertyListeners(["groupSelectsChildren","groupSelectsFiltered","rowSelection"],()=>{const t=mn(e),s=$r(e),i=qr(e)==="filteredDescendants";this.masterSelectsDetail=Yu(e)==="detail",(t!==this.groupSelectsDescendants||i!==this.groupSelectsFiltered||s!==this.mode)&&(this.deselectAllRowNodes({source:"api"}),this.groupSelectsDescendants=t,this.groupSelectsFiltered=i,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 i=this.inferNodeSelections(t,e.shiftKey,e.metaKey||e.ctrlKey,s);if(i==null)return 0;if(this.selectionCtx.selectAll=!1,"select"in i)return i.reset?this.resetNodes():this.selectRange(i.deselect,!1,s),this.selectRange(i.select,!0,s);{const o=i.checkFilteredNodes?aC(i.node):i.newValue;return this.setNodesSelected({nodes:[i.node],newValue:o,clearSelection:i.clearSelection,keepDescendants:i.keepDescendants,event:e,source:s})}}setNodesSelected({newValue:e,clearSelection:t,suppressFinishActions:s,nodes:i,event:o,source:n,keepDescendants:r=!1}){if(i.length===0)return 0;const{gos:a}=this;if(!ci(a)&&e)return B(132),0;if(i.length>1&&!this.isMultiSelect())return B(130),0;let l=0;for(let c=0;c<i.length;c++){const d=i[c],u=_i(d);if(u.rowPinned&&!An(u)){B(59);continue}if(u.id===void 0){B(60);continue}this.groupSelectsFiltered&&u.group&&!a.get("treeData")||this.selectRowNode(u,e,o,n)&&(this.detailSelection.delete(u.id),l++),this.groupSelectsDescendants&&u.childrenAfterGroup?.length&&(l+=this.selectChildren(u,e,n))}return s||(i.length===1&&n==="api"&&this.selectionCtx.setRoot(_i(i[0])),e&&(t||!this.isMultiSelect())&&(l+=this.clearOtherNodes(_i(i[0]),r,n)),l>0&&(this.updateGroupsFromChildrenSelections(n),this.dispatchSelectionChanged(n))),l}selectRange(e,t,s){let i=0;return e.forEach(o=>{const n=_i(o);if(n.group&&this.groupSelectsDescendants)return;this.selectRowNode(n,t,void 0,s)&&i++}),i>0&&(this.updateGroupsFromChildrenSelections(s),this.dispatchSelectionChanged(s)),i}selectChildren(e,t,s){const i=this.groupSelectsFiltered?e.childrenAfterAggFilter:e.childrenAfterGroup;return i?this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,source:s,nodes:i}):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,i)=>{e(s)&&t.set(i,s)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsDescendants)return!1;const{gos:s,rowModel:i}=this.beans;if(!$e(s))return!1;const o=i.rootNode;if(!o)return!1;t||(t=new wn(!0,o),t.active=!1);let n=!1;return t.forEachChangedNodeDepthFirst(r=>{if(r!==o){const a=this.calculateSelectedFromChildren(r);n=this.selectRowNode(r,a===null?!1:a,void 0,e)||n}}),n}clearOtherNodes(e,t,s){const i=new Map;let o=0;return this.selectedNodes.forEach(n=>{const r=n.id==e.id;if((t?!sT(e,n):!0)&&!r){const l=this.selectedNodes.get(n.id);o+=this.setNodesSelected({nodes:[l],newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:s}),this.groupSelectsDescendants&&n.parent&&i.set(n.parent.id,n.parent)}}),i.forEach(n=>{const r=this.calculateSelectedFromChildren(n);this.selectRowNode(n,r===null?!1:r,void 0,s)}),o}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 Ks(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 i=[];function o(n){for(let r=0,a=n.length;r<a;r++){const l=n[r];l.isSelected()?i.push(l):l.group&&l.childrenAfterGroup&&o(l.childrenAfterGroup)}}return o(s),i}isEmpty(){return this.getSelectionCount()===0}deselectAllRowNodes({source:e,selectAll:t}){const s=$e(this.gos);let i=!1;const o=n=>{const r=this.selectRowNode(_i(n),!1,void 0,e);i||(i=r)};if(t==="currentPage"||t==="filtered"){if(!s){Ie(102);return}this.getNodesToSelect(t).forEach(o)}else this.selectedNodes.forEach(o),this.reset(e);if(this.selectionCtx.selectAll=!1,s&&this.groupSelectsDescendants){const n=this.updateGroupsFromChildrenSelections(e);i||(i=n)}i&&this.dispatchSelectionChanged(e)}getSelectedCounts(e){let t=0,s=0;return this.getNodesToSelect(e).forEach(i=>{this.groupSelectsDescendants&&i.group||(i.isSelected()?t++:i.selectable&&s++)}),{selectedCount:t,notSelectedCount:s}}getSelectAllState(e){const{selectedCount:t,notSelectedCount:s}=this.getSelectedCounts(e);return rC(t,s)??null}hasNodesToSelect(e){return this.getNodesToSelect(e).filter(t=>t.selectable).length>0}getNodesToSelect(e){if(!this.canSelectAll())return[];const t=[],s=o=>t.push(o);if(e==="currentPage")return this.forEachNodeOnPage(o=>{if(!o.group){s(o);return}if(!o.expanded&&!o.footer){const n=r=>{s(r),r.childrenAfterFilter?.forEach(n)};n(o);return}this.groupSelectsDescendants||s(o)}),t;const i=this.beans.rowModel;return e==="filtered"?(i.forEachNodeAfterFilter(s),t):(i.forEachNode(s),t)}forEachNodeOnPage(e){const{pageBounds:t,rowModel:s}=this.beans,i=t.getFirstRow(),o=t.getLastRow();for(let n=i;n<=o;n++){const r=s.getRow(n);r&&e(r)}}selectAllRowNodes(e){const{gos:t,selectionCtx:s}=this;if(!ci(t)){B(132);return}if(sS(t)&&!Kr(t)){B(130);return}if(!this.canSelectAll())return;const{source:i,selectAll:o}=e;let n=!1;if(this.getNodesToSelect(o).forEach(r=>{const a=this.selectRowNode(_i(r),!0,void 0,i);n||(n=a)}),s.selectAll=!0,$e(t)&&this.groupSelectsDescendants){const r=this.updateGroupsFromChildrenSelections(i);n||(n=r)}n&&this.dispatchSelectionChanged(i)}getSelectionState(){return this.isEmpty()?null:Array.from(this.selectedNodes.keys())}setSelectionState(e,t,s){if(e||(e=[]),!Array.isArray(e)){Ie(103);return}const i=new Set(e),o=[];this.beans.rowModel.forEachNode(n=>{i.has(n.id)&&o.push(n)}),s&&this.resetNodes(),this.setNodesSelected({newValue:!0,nodes:o,source:t})}canSelectAll(){return $e(this.beans.gos)}updateSelectable(e){const{gos:t,rowModel:s}=this.beans;if(!ci(t))return;const i="selectableChanged",o=e!==void 0,n=$e(t)&&this.groupSelectsDescendants,r=[],a=l=>{if(o&&!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 wn(!1,l):void 0}e?.forEachChangedNodeDepthFirst(a,!o,!o)}else s.forEachNode(a);r.length&&this.setNodesSelected({nodes:r,newValue:!1,source:i}),!o&&n&&this.updateGroupsFromChildrenSelections?.(i)}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 i=tT(s);if(e.isSelected()!==i&&this.selectRowNode(e,i,t,"masterDetail")&&this.dispatchSelectionChanged("masterDetail"),!i){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(!Kr(t)){B(269);return}switch(e.isSelected()){case!0:{s.selectAll();break}case!1:{s.deselectAll();break}case void 0:{const i=this.detailSelection.get(e.id);if(i){const o=[];for(const n of i){const r=s.getRowNode(n);r&&o.push(r)}s.setNodesSelected({nodes:o,newValue:!0,source:"masterDetail"})}break}}}}dispatchSelectionChanged(e){this.eventSvc.dispatchEvent({type:"selectionChanged",source:e,selectedNodes:this.getSelectedNodes(),serverSideState:null})}};function _i(e){return An(e)?e.pinnedSibling:e.footer?e.sibling:e}function tT(e){let t=0,s=0;return e.forEachNode(i=>{i.isSelected()?t++:i.selectable&&s++}),rC(t,s)}function rC(e,t){if(e===0&&t===0)return!1;if(!(e>0&&t>0))return e>0}function sT(e,t){let s=t.parent;for(;s;){if(s===e)return!0;s=s.parent}return!1}function aC(e){const t=e.isSelected()===!1,s=e.childrenAfterFilter?.some(aC)??!1;return t||s}var iT={moduleName:"SharedRowSelection",version:$,beans:[jM],apiFunctions:{setNodesSelected:UM,selectAll:$M,deselectAll:KM,selectAllFiltered:qM,deselectAllFiltered:YM,selectAllOnCurrentPage:ZM,deselectAllOnCurrentPage:XM,getSelectedNodes:QM,getSelectedRows:JM}},oT={moduleName:"RowSelection",version:$,rowModels:["clientSide","infinite","viewport"],beans:[eT],dependsOn:[iT]};function nT(e){e.expansionSvc?.expandAll(!0)}function rT(e){e.expansionSvc?.expandAll(!1)}function lC(e){e.rowModel?.onRowHeightChanged()}function cC(e){if(e.rowAutoHeight?.active){B(3);return}e.rowModel?.resetRowHeights()}function aT(e,t,s){const i=a5(e);if(i){if(e.rowGroupColsSvc?.columns.length===0){if(t<0){Ie(238);return}i.setRowCount(t,s);return}Ie(28);return}Ia(e)?.setRowCount(t,s)}function lT(e){return Di(e.gos)?e.rowModel.getBlockStates():e.rowNodeBlockLoader?.getBlockState()??{}}function cT(e){return e.rowModel.isLastRowIndexKnown()}var dT={moduleName:"CsrmSsrmSharedApi",version:$,apiFunctions:{expandAll:nT,collapseAll:rT}},uT={moduleName:"RowModelSharedApi",version:$,apiFunctions:{onRowHeightChanged:lC,resetRowHeights:cC}},hT={moduleName:"SsrmInfiniteSharedApi",version:$,apiFunctions:{setRowCount:aT,getCacheBlockState:lT,isLastRowIndexKnown:cT}},gT=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(i=>{if(!i){Ie(18),t||Ie(20);return}if(this.isGridApi(i))return i;const o=i;return"current"in o?o.current?.api:(o.api||Ie(19),o.api)}).filter(i=>!!i&&!i.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(i=>{s.push(t(i))}):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":B(21);break}})}processGroupOpenedEvent(e){const{colGroupSvc:t}=this.beans;if(t)for(const s of e.columnGroups){let i=null;s&&(i=t.getProvidedColGroup(s.getGroupId())),!(s&&!i)&&t.setColumnGroupOpened(i,s.isExpanded(),"alignedGridChanged")}}processColumnEvent(e){const t=e.column;let s=null;const i=this.beans,{colResize:o,ctrlsSvc:n,colModel:r}=i;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(i,{state:u,applyOrder:!0},"alignedGridChanged")}break;case"columnVisible":{const u=e.api.getColumnState().map(h=>({colId:h.colId,hide:h.hide}));$t(i,{state:u},"alignedGridChanged")}break;case"columnPinned":{const u=e.api.getColumnState().map(h=>({colId:h.colId,pinned:h.pinned}));$t(i,{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()];o?.setColumnWidths(Object.values(u),!1,d.finished,"alignedGridChanged");break}}const c=n.getGridBodyCtrl().isVerticalScrollShowing();for(const d of this.getAlignedGridApis())d.setGridOption("alwaysShowVerticalScroll",c)}},pT={moduleName:"AlignedGrids",version:$,beans:[gT],dependsOn:[lm]},fT=class extends A{constructor(e){super(),this.rootNode=e,this.nextId=0,this.allNodesMap={},ng(e)}getRowNode(e){return this.allNodesMap[e]}setNewRowData(e){const{selectionSvc:t,pinnedRowModel:s,groupStage:i}=this.beans;t?.reset("rowDataChanged"),s?.isManual()&&s.reset(),this.dispatchRowDataUpdateStarted(e),this.allNodesMap=Object.create(null),this.nextId=0;const o=ng(this.rootNode),n=new Array(e.length);o._leafs=n;let r=0;const a=i?.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 w=this.createRowNode(C,h);if(w.sourceRowIndex=r,n[r++]=w,l&&!l.has(C)){l.add(C),w.treeParent=d;const v=a(C);v&&c(w,v)}}};c(o,e),n.length=r}setImmutableRowData(e,t){const{rootNode:s,gos:i}=this;this.dispatchRowDataUpdateStarted(t);const o=ho(i),n=e.changedRowNodes,{adds:r,updates:a}=n,l=new Set,c=[],d=this.beans.groupStage?.getNestedDataGetter();let u=i.get("suppressMaintainUnsortedOrder")?void 0:!1,h=-1,p=!1;const f=(v,b)=>{if(!u&&u!==void 0){const S=v.sourceRowIndex;u=S<=h,h=S}v.data!==b&&(v.updateData(b),r.has(v)||a.add(v),!v.selectable&&v.isSelected()&&c.push(v))},C=(v,b,S)=>{for(let y=0,x=b.length;y<x;++y){const F=b[y];if(!F)continue;let R=this.getRowNode(o({data:F,level:S}));if(R?(f(R,F),p||(p=!!d&&R.treeParent!==v)):(R=this.createRowNode(F,S),r.add(R)),!d||l.has(R)){l.add(R);continue}l.add(R),R.treeParent=v;const E=d(F);E&&C(R,E,S+1)}};C(s,t,0);const w=this.deleteUnusedNodes(l,n,c)||u||r.size>0;if(w){const v=s._leafs??(s._leafs=[]);u===void 0?bT(v,l,n):wT(v,l)&&(n.reordered=!0)}(w||p||a.size)&&(e.rowDataUpdated=!0,this.deselect(c))}deleteUnusedNodes(e,{removals:t},s){const i=this.rootNode._leafs;for(let o=0,n=i.length;o<n;o++){const r=i[o];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 B(268),{remove:[],update:[],add:[]};const s=[],i=ho(this.gos),o=this.executeRemove(i,e,t,s),n=this.executeUpdate(i,e,t,s),r=this.executeAdd(e,t);return this.deselect(s),{remove:o,update:n,add:r}}executeRemove(e,{remove:t},{adds:s,updates:i,removals:o},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 w=C.sourceRowIndex;w<d&&(d=w),w>u&&(u=w),C.isSelected()&&n.push(C),this.deleteNode(C),s.delete(C)?(h??(h=new Set),h.add(C)):(i.delete(C),o.add(C)),p[c++]=C}return p.length=c,c&&vT(r,d,u,o,h),p}executeUpdate(e,{update:t},{adds:s,updates:i},o){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()&&o.push(d),r[a++]=d,s.has(d)||i.add(d))}return r.length=a,r}executeAdd(e,t){var s;const i=(s=this.rootNode)._leafs??(s._leafs=[]),o=i.length,n=e.add,r=n?.length;if(!r)return[];const a=o+r;let l=this.sanitizeAddIndex(i,e.addIndex);if(l<o){for(let u=o-1,h=a-1;u>=l;--u){const p=i[u];p.sourceRowIndex=h,i[h--]=p}t.reordered=!0}i.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,i[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 Ks(this.beans);s.parent=this.rootNode,s.level=t,s.group=!1,s.expanded=!1,s.setDataAndId(e,String(this.nextId++));const i=s.id,o=this.allNodesMap;return o[i]&&B(2,{nodeId:i}),o[i]=s,s}deleteNode(e){e.clearRowTopAndRowIndex();const t=e.id,s=this.allNodesMap;s[t]===e&&delete s[t];const i=e.pinnedSibling;i&&this.beans.pinnedRowModel?.pinRow(i,null)}lookupNode(e,t){if(!e)return CT(this.rootNode._leafs,t);const s=e({data:t,level:0}),i=this.allNodesMap[s];return i||(Ie(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 i=this.gos;return t>0&&i.get("treeData")&&i.get("getDataPath")&&(t=mT(e,t)),t}},mT=(e,t)=>{for(let s=0,i=e.length;s<i;s++)if(e[s]?.rowIndex==t-1)return s+1;return t},ng=e=>{e.group=!0,e.level=-1,e.id="ROOT_NODE_ID",e._leafs?.length!==0&&(e._leafs=[]);const t=[],s=[],i=[],o=[];e.childrenAfterGroup=t,e.childrenAfterSort=s,e.childrenAfterAggFilter=i,e.childrenAfterFilter=o;const n=e.sibling;return n&&(n.childrenAfterGroup=t,n.childrenAfterSort=s,n.childrenAfterAggFilter=i,n.childrenAfterFilter=o,n.childrenMapped=e.childrenMapped),e.updateHasChildren(),e},CT=(e,t)=>{if(e)for(let s=0,i=e.length;s<i;s++){const o=e[s];if(o.data===t)return o}return Ie(5,{data:t}),null},vT=(e,t,s,i,o)=>{t=Math.max(0,t);for(let n=t,r=e.length;n<r;++n){const a=e[n];n<=s&&(i.has(a)||o?.has(a))||(a.sourceRowIndex=t,e[t++]=a)}e.length=t},wT=(e,t)=>{const s=t.size;e.length=s;let i=0,o=!1,n=!1;for(const r of t){const a=r.sourceRowIndex;a===i?n||(n=o):(a>=0?n=!0:o=!0,r.sourceRowIndex=i,e[i]=r),++i}return n},bT=(e,t,{removals:s,adds:i})=>{const o=e.length;e.length=t.size;let n=0;for(let r=0;r<o;++r){const a=e[r];s.has(a)||(n!==r&&(a.sourceRowIndex=n,e[n]=a),++n)}for(const r of i)r.sourceRowIndex<0&&(r.sourceRowIndex=n,e[n++]=r);e.length=n},dC=e=>{const t=e.childrenAfterSort,s=e.sibling;if(s&&(s.childrenAfterSort=t),!!t)for(let i=0,o=t.length-1;i<=o;i++){const n=t[i],r=i===0,a=i===o;n.firstChild!==r&&(n.firstChild=r,n.dispatchRowEvent("firstChildChanged")),n.lastChild!==a&&(n.lastChild=a,n.dispatchRowEvent("lastChildChanged")),n.childIndex!==i&&(n.childIndex=i,n.dispatchRowEvent("childIndexChanged"))}},ST=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,i){const{gos:o,colModel:n,rowGroupColsSvc:r,rowNodeSorter:a,rowRenderer:l,showRowGroupCols:c}=this.beans,d=o.get("groupMaintainOrder"),u=n.getCols().some(b=>b.isRowGroupActive()),h=r?.columns,p=n.isPivotMode(),f=o.getCallback("postSortRows");let C=!1,w;const v=b=>{const S=p&&b.leafGroup;let y=d&&u&&!b.leafGroup;y&&(w??(w=this.shouldSortContainsGroupCols(e)),y&&(y=!w));let x=null;if(y){let F=!1;if(h){const R=b.level+1;R<h.length&&(F=h[R].getSort()===null)}F||(x=RT(b))}else!e.length||S||(t&&s?x=yT(a,b,s,i,e):x=a.doFullSort(b.childrenAfterAggFilter,e));if(x||(x=b.childrenAfterAggFilter?.slice(0)??[]),C||(C=b.childrenAfterSort?.[0]!==x[0]),b.childrenAfterSort=x,dC(b),f){const F={nodes:b.childrenAfterSort};f(F)}};if(i?.forEachChangedNodeDepthFirst(v),C&&o.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(is(this.gos)){for(let s=0;s<t;++s){const i=e[s].column;if(i.isPrimary()&&i.isRowGroupActive())return!0}return!1}for(let s=0;s<t;++s)if(e[s].column.getColDef().showRowGroup)return!0;return!1}},yT=(e,t,s,i,o)=>{const n=t.childrenAfterAggFilter,r=t.childrenAfterSort;if(!r)return e.doFullSort(n,o);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)||i&&!i.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(o,h,p)),xT(e,o,l,u)},xT=(e,t,s,i)=>{let o=0,n=0;const r=s.length,a=i.length,l=new Array(r+a);let c=0;for(;o<r&&n<a;){const d=s[o],u=i[n];e.compareRowNodes(t,d,u)<0?(l[c++]=d.rowNode,++o):(l[c++]=u.rowNode,++n)}for(;o<r;)l[c++]=s[o++].rowNode;for(;n<a;)l[c++]=i[n++].rowNode;return l},RT=e=>{const t=e.childrenAfterSort,s=e.childrenAfterAggFilter,i=t?.length,o=s?.length;if(!i||!o)return null;const n=new Array(o),r=new Set;for(let l=0;l<o;++l)r.add(s[l]);let a=0;for(let l=0;l<i;++l){const c=t[l];r.delete(c)&&(n[a++]=c)}if(r.size===0&&a===i)return t;for(const l of r)n[a++]=l;return n.length=a,n},FT=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=nt(this,this.onRowHeightChanged.bind(this),100)}postConstruct(){const e=this.beans,t=new Ks(e);this.rootNode=t,this.nodeManager=this.createBean(new fT(t));const s=this.refreshModel.bind(this,{step:"group"}),i=this.refreshModel.bind(this,{step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame")});this.addManagedEventListeners({newColumnsLoaded:i,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(i=>!!i);this.stages=s;for(let i=s.length-1;i>=0;--i)for(const o of s[i].refreshProps)t.set(o,i);this.addManagedPropertyListeners([...t.keys()],i=>{const o=i.changeSet?.properties;o&&this.onPropChange(o)}),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,i){let o,n=!1;do{o=!1;const r=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),l=Math.max(r,s),c=Math.min(a,i);for(let d=l;d<=c;d++){const u=this.getRow(d);if(u.rowHeightEstimated){const h=js(this.beans,u);u.setRowHeight(h.height),o=!0,n=!0}}o&&this.setRowTopAndRowIndex()}while(o);return n}onPropChange(e){const{nodeManager:t,gos:s,beans:i}=this,o=i.groupStage;if(!t)return;const n=new Set(e),r=o?.onPropChange(n);let a;n.has("rowData")?a=s.get("rowData"):r&&(a=o?.extractData()),a&&!Array.isArray(a)&&(a=null,B(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 kr,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,i=t.length;let o=i;for(let n=0,r=e.length;n<r&&o;++n)o=Math.min(o,s.get(e[n])??o);return o<i?t[o].step:null}setRowTopAndRowIndex(e){const{beans:t,rowsToDisplay:s}=this,i=t.environment.getDefaultRowHeight();let o=0;const n=rt(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=js(t,l,n,i);l.setRowHeight(d.height,d.estimated)}l.setRowTop(o),l.setRowIndex(r),o+=l.rowHeight}}clearRowTopAndRowIndex(e,t){const s=e.active,i=r=>{r?.id!=null&&!t.has(r.id)&&r.clearRowTopAndRowIndex()},o=r=>{i(r),i(r.detailNode),i(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)o(a[d])},n=this.rootNode;n&&o(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 i=e.sibling?.displayed?1:0;return(e.childrenAfterSort?.length??0)+i}getTopLevelRowDisplayedIndex(e){const{beans:t,rootNode:s,rowsToDisplay:i}=this;if(!s||!i.length||i[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(i,e,n,r):r(e)}getTopLevelIndexFromDisplayedIndex(e){const{rootNode:t,rowsToDisplay:s}=this;if(!t||!s.length||s[0]===t)return e;let o=this.getRow(e);o.footer&&(o=o.sibling);let n=o.parent;for(;n&&n!==t;)o=n,n=o.parent;const r=t.childrenAfterSort?.indexOf(o)??-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:Ji(this.gos)})}onFilterChanged({afterDataChange:e,columns:t}){if(!e){const i=t.length===0||t.some(o=>o.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:i,keepRenderedRows:!0,animate:Ji(this.gos)})}}onSortChanged(){this.refreshModel({step:"sort",keepRenderedRows:!0,animate:Ji(this.gos)})}getType(){return"clientSide"}onValueChanged(){this.refreshModel({step:this.beans.colModel.isPivotActive()?"pivot":"aggregate"})}createChangePath(e){const t=new wn(!1,this.rootNode);return t.active=e,t}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;const{changedRowNodes:t,newData:s,rowDataUpdated:i}=e;return!(!t||s||!i||t.removals.size||t.adds.size)}refreshModel(e){const{nodeManager:t,beans:s,eventSvc:i,started:o,refreshingModel:n}=this;if(!t)return;const r=!!e.rowDataUpdated,a=e.changedPath??(e.changedPath=this.createChangePath(!e.newData&&r));if(o&&r&&i.dispatchEvent({type:"rowDataUpdated"}),!o||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,i.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,i=!1;const o=[],n=mn(this.gos);return this.forEachNodeAfterFilterAndSort(r=>{if(i)return;if(s&&(r===t||r===e)&&(i=!0,n&&r.group)){uC(o,r);return}if(!s){if(r!==t&&r!==e)return;s=!0,t===e&&(i=!0)}(!r.group||!n)&&o.push(r)}),o}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 i=0,o=s-1;if(e<=0)return 0;if(t[o].rowTop<=e)return o;let r=-1,a=-1;for(;;){const l=Math.floor((i+o)/2),c=t[l];if(this.isRowInPixel(c,e)||(c.rowTop<e?i=l+1:c.rowTop>e&&(o=l-1),r===i&&a===o))return l;r=i,a=o}}isRowInPixel(e,t){const s=e.rowTop,i=s+e.rowHeight;return s<=t&&i>t}forEachLeafNode(e){const t=this.rootNode?._leafs;if(t)for(let s=0,i=t.length;s<i;++s)e(t[s],s)}forEachNode(e,t=!1){this.depthFirstSearchRowNodes(e,t)}forEachDisplayedNode(e){const t=this.rowsToDisplay;for(let s=0,i=t.length;s<i;++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:i,rowGroupColsSvc:o}=this.beans;if(!i.isPivotMode())return;if(!o?.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,i=this.rootNode,o=0){let n=o;if(!i)return n;const r=i===this.rootNode;if(r||e(i,n++),i.hasChildren()&&!i.footer){const a=s(i);if(a){const l=this.beans.footerSvc;n=l?.addTotalRows(n,i,e,t,r,"top")??n;for(const c of a)n=this.depthFirstSearchRowNodes(e,t,s,c,n);return l?.addTotalRows(n,i,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(i=>{i.childrenAfterSort=i.childrenAfterAggFilter.slice(0),dC(i)})}doGrouping(e){const t=this.rootNode,i=this.beans.groupStage?.execute({rowNode:t,changedRowNodes:e.changedRowNodes,changedPath:e.changedPath,afterColumnsChanged:!!e.afterColumnsChanged});if(i===void 0){const o=t._leafs;t.childrenAfterGroup=o,t.updateHasChildren();const n=t.sibling;n&&(n.childrenAfterGroup=o)}(i||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,Nm(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(Nc)===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:i}=this;if(!e)return;t.valueCache?.onDataChanged();const o=[],n=[],r=new kr;for(const{rowDataTransaction:a,callback:l}of i??[]){this.rowNodesCountReady=!0;const c=e.updateRowData(a,r);o.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),o.length>0&&s.dispatchEvent({type:"asyncTransactionsFlushed",results:o}),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 kr,i=t.updateRowData(e,s);return this.commitTransactions(s),i}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 i=this.rootNode.childrenAfterSort??[];for(const o of i)o.setUiLevel(0);this.rowsToDisplay=i}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 i=t.sibling;i?.setRowHeight(i.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()}},uC=(e,t)=>{const s=t.childrenAfterGroup;if(s)for(let i=0,o=s.length;i<o;++i){const n=s[i];n.data&&e.push(n),n.group&&uC(e,n)}};function ET(e){e.expansionSvc?.onGroupExpandedOrCollapsed()}function DT(e,t){const s=Zs(e);s&&((!t||t==="everything")&&(t="group"),s.refreshModel({step:t,keepRenderedRows:!0,animate:!e.gos.get("suppressAnimationFrame")}))}function PT(e){return Zs(e)?.isEmpty()??!0}function MT(e,t){Zs(e)?.forEachLeafNode(t)}function TT(e,t){Zs(e)?.forEachNodeAfterFilter(t)}function IT(e,t){Zs(e)?.forEachNodeAfterFilterAndSort(t)}function kT(e,t){return e.frameworkOverrides.wrapIncoming(()=>Zs(e)?.updateRowData(t))}function AT(e,t,s){e.frameworkOverrides.wrapIncoming(()=>Zs(e)?.batchUpdateRowData(t,s))}function LT(e){e.frameworkOverrides.wrapIncoming(()=>Zs(e)?.flushAsyncTransactions())}function OT(e){return e.selectionSvc?.getBestCostNodeSelection()}var NT={moduleName:"ClientSideRowModel",version:$,rowModels:["clientSide"],beans:[FT,ST],dependsOn:[km]},HT={moduleName:"ClientSideRowModelApi",version:$,apiFunctions:{onGroupExpandedOrCollapsed:ET,refreshClientSideRowModel:DT,isRowDataEmpty:PT,forEachLeafNode:MT,forEachNodeAfterFilter:TT,forEachNodeAfterFilterAndSort:IT,applyTransaction:kT,applyTransactionAsync:AT,flushAsyncTransactions:LT,getBestCostNodeSelection:OT,resetRowHeights:cC,onRowHeightChanged:lC},dependsOn:[dT,uT]},GT=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:i,skipRowGroups:o,exportRowNumbers:n}=t,r=this.getColumnsToExport({allColumns:s,skipRowGroups:o,columnKeys:i,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,i){const o=t.shouldRowBeSkipped||(()=>!1),r=t.rowPositions!=null||!!t.onlySelected,a=this.gos.get("groupHideOpenParents")&&!r,l=this.colModel.isPivotMode()?i.leafGroup:!i.group,c=!!i.footer,d=i.allChildrenCount===1&&i.childrenAfterGroup?.length===1&&eS(this.gos,i);if(!l&&!c&&(t.skipRowGroups||d||a)||t.onlySelected&&!i.isSelected()||t.skipPinnedTop&&i.rowPinned==="top"||t.skipPinnedBottom&&i.rowPinned==="bottom"||i.stub||i.level===-1&&!l&&!c||o(ue(this.gos,{node:i})))return;const p=e.onNewBodyRow(i);if(s.forEach((f,C)=>{p.onColumn(f,C,i)}),t.getCustomContentBelowRow){const f=t.getCustomContentBelowRow(ue(this.gos,{node:i}));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 i=new of,{colGroupSvc:o}=this.beans,n=o?o.createColumnGroups({columns:t,idCreator:i,pinned:null,isStandaloneStructure:!0}):t;this.recursivelyAddHeaderGroups(n,s,e.processGroupHeaderCallback)}return s}}exportHeaders(e,t){return s=>{if(!e.skipColumnHeaders){const i=s.onNewHeaderRow();t.forEach((o,n)=>{i.onColumn(o,n,void 0)})}return s}}processPinnedTopRows(e,t){return s=>{const i=this.processRow.bind(this,s,e,t);return e.rowPositions?e.rowPositions.filter(o=>o.rowPinned==="top").sort((o,n)=>o.rowIndex-n.rowIndex).map(o=>this.pinnedRowModel?.getPinnedTopRow(o.rowIndex)).forEach(i):this.pinnedRowModel?.isManual()||this.pinnedRowModel?.forEachPinnedRow("top",i),s}}processRows(e,t){return s=>{const i=this.rowModel,o=$e(this.gos),n=Di(this.gos),r=!o&&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=>i.getRow(c.rowIndex)).forEach(a);else if(this.colModel.isPivotMode())o?i.forEachPivotNode(a,!0,l==="filteredAndSorted"):n?i.forEachNodeAfterFilterAndSort(a,!0):i.forEachNode(a);else if(e.onlySelectedAllPages||r){const c=this.beans.selectionSvc?.getSelectedNodes()??[];this.replicateSortedOrder(c),c.forEach(a)}else l==="all"?i.forEachNode(a):o||n?i.forEachNodeAfterFilterAndSort(a,!0):i.forEachNode(a);return s}}replicateSortedOrder(e){const{sortSvc:t,rowNodeSorter:s}=this.beans;if(!t||!s)return;const i=t.getSortOptions(),o=(n,r)=>n.rowIndex!=null&&r.rowIndex!=null?n.rowIndex-r.rowIndex:n.level===r.level?n.parent?.id===r.parent?.id?s.compareRowNodes(i,{rowNode:n,currentPos:n.rowIndex??-1},{rowNode:r,currentPos:r.rowIndex??-1}):o(n.parent,r.parent):n.level>r.level?o(n.parent,r):o(n,r.parent);e.sort(o)}processPinnedBottomRows(e,t){return s=>{const i=this.processRow.bind(this,s,e,t);return e.rowPositions?e.rowPositions.filter(o=>o.rowPinned==="bottom").sort((o,n)=>o.rowIndex-n.rowIndex).map(o=>this.pinnedRowModel?.getPinnedBottomRow(o.rowIndex)).forEach(i):this.pinnedRowModel?.isManual()||this.pinnedRowModel?.forEachPinnedRow("bottom",i),s}}getColumnsToExport(e){const{allColumns:t=!1,skipRowGroups:s=!1,exportRowNumbers:i=!1,columnKeys:o}=e,{colModel:n,gos:r,visibleCols:a}=this,l=n.isPivotMode(),c=h=>Ps(h)?!1:!bs(h)||i;if(o?.length)return n.getColsForKeys(o).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?!Fd(h):!0)),u}recursivelyAddHeaderGroups(e,t,s){const i=[];for(const o of e){const n=o;if(n.getChildren)for(const r of n.getChildren()??[])i.push(r)}e.length>0&&Ke(e[0])&&this.doAddHeaderHeader(t,e,s),i&&i.length>0&&this.recursivelyAddHeaderGroups(i,t,s)}doAddHeaderHeader(e,t,s){const i=e.onNewHeaderGroupingRow();let o=0;for(const n of t){const r=n;let a;s?a=s(ue(this.gos,{columnGroup:r})):a=this.beans.colNames.getDisplayNameForColumnGroup(r,"header");const c=(r.isExpandable()?r.getLeafColumns():[]).reduce((d,u,h,p)=>{let f=Ae(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},[]);i.onColumn(r,a||"",o++,r.getLeafColumns().length-1,c)}}},BT={moduleName:"SharedExport",version:$,beans:[GT]},rg=`\r
|
|
61
|
-
`,VT=class extends p5{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,rg),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((s,i)=>{i!==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,i){s!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(i)}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 i=this.extractRowCellValue(e,t,t,"csv",s);this.result+=this.putInQuotes(i.valueFormatted??i.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():(B(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=rg),this.isFirstLine=!1}},zT=class extends g5{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()){B(51);return}const t=this.getMergedParams(e),s=this.getData(t),i=new Blob(["\uFEFF",s],{type:"text/plain"}),o=typeof t.fileName=="function"?t.fileName(ue(this.gos,{})):t.fileName;f5(this.getFileName(o),i)}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:i,valueSvc:o,gos:n}=this,{processCellCallback:r,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:d,columnSeparator:u}=e;return new VT({colModel:t,colNames:s,valueSvc:o,gos:n,processCellCallback:r||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:d||!1,columnSeparator:u||",",rowGroupColsSvc:i})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function WT(e,t){return e.csvCreator?.getDataAsCsv(t)}function _T(e,t){e.csvCreator?.exportDataAsCsv(t)}var jT={moduleName:"CsvExport",version:$,beans:[zT],apiFunctions:{getDataAsCsv:WT,exportDataAsCsv:_T},dependsOn:[BT]},UT=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:i,rowNodes:o}=this;for(let n=0;n<e;n++){const r=s+n,a=new Ks(i);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(r),a.setRowTop(t*r),o.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:s,state:i}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:s,pageStatus:i}}}setDataAndId(e,t,s){K(t)?e.setDataAndId(t,s.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(ze(this.params.datasource.getRows)){B(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:s,params:{sortModel:i,filterModel:o},gos:n}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,s),failCallback:this.pageLoadFailed.bind(this,s),sortModel:i,filterModel:o,context:ue(n,{}).context}}forEachNode(e,t,s){this.rowNodes.forEach((i,o)=>{this.startRow+o<s&&e(i,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((o,n)=>{const r=e.rowData?e.rowData[n]:void 0;!o.id&&o.alreadyRendered&&r&&(t[n]=new Ks(s),t[n].setRowIndex(o.rowIndex),t[n].setRowTop(o.rowTop),t[n].setRowHeight(o.rowHeight),o.clearRowTopAndRowIndex()),this.setDataAndId(t[n],r,this.startRow+n)});const i=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,i)}destroy(){for(const e of this.rowNodes)e.clearRowTopAndRowIndex();super.destroy()}},$T=2,KT=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 i=this.blocks[s];if(!i){if(t)return;i=this.createBlock(s)}return i.getRow(e)}createBlock(e){const t=this.params,s=this.createBean(new UT(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()&&(vi(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 i=this.params.maxBlocksInCache>0,o=i?this.params.maxBlocksInCache-1:null,n=$T-1;t.forEach((r,a)=>{const l=r.state==="needsLoading"&&a>=n,c=i?a>=o:!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:i}=e;return t.rowIndex>=s&&t.rowIndex<i}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:i}=this.params,n=(e.id+1)*s+i;this.rowCount<n&&(this.rowCount=n)}}setRowCount(e,t){this.rowCount=e,K(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,i)=>s.id-i.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 i=-1,o=!1;const n={value:0};let r=!1;for(const l of this.getBlocksInOrder())if(!r){if(o&&i+1!==l.id){r=!0;continue}i=l.id,l.forEachNode(c=>{const d=c===e||c===t;(o||d)&&s.push(c),d&&(o=!o)},n,this.rowCount)}return r||o?[]:s}},qT=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 Ks(e);this.rootNode=t,t.level=-1,this.rowHeight=di(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=di(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){let e;this.cacheParams?e=!dn(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;ho(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:i,eventSvc:o,gos:n}=e;this.cacheParams={datasource:this.datasource,filterModel:t?.getFilterModel()??{},sortModel:s?.getSortModel()??[],rowNodeBlockLoader:i,initialRowCount:n.get("infiniteInitialRowCount"),maxBlocksInCache:n.get("maxBlocksInCache"),rowHeight:di(e),overflowSize:n.get("cacheOverflowSize"),blockSize:n.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new KT(this.cacheParams)),o.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 YT(e){Ia(e)?.refreshCache()}function ZT(e){Ia(e)?.purgeCache()}function XT(e){return Ia(e)?.getRowCount()}var QT=class extends A{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=tS(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=nt(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){qt(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){vi(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:i}=t.getBlockStateJson();e[s]=i}),e}printCacheStatus(){vi(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},JT={moduleName:"InfiniteRowModelCore",version:$,rowModels:["infinite"],beans:[qT,QT]},e6={moduleName:"InfiniteRowModel",version:$,apiFunctions:{refreshInfiniteCache:YT,purgeInfiniteCache:ZT,getInfiniteRowCount:XT},dependsOn:[JT,hT]},t6="↑",s6="↓",i6={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},o6=class extends Ue{constructor(){super(i6),this.eValue=de,this.eDelta=de,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const s=Math.abs(t),i=e.formatValue(s),o=K(i)?i:s,n=t>=0,r=this.eDelta;n?r.textContent=t6+o:r.textContent=s6+o,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"),bt(this.eDelta)}refresh(e,t=!1){const{value:s,valueFormatted:i}=e,{eValue:o,lastValue:n,beans:r}=this;if(s===n||(K(i)?o.textContent=i:K(s)?o.textContent=s:bt(o),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&&o.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=s,!0}},n6=".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}",r6={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},a6=class extends Ue{constructor(){super(r6),this.eCurrent=de,this.refreshCount=0,this.registerCSS(n6)}init(e){this.refresh(e,!0)}addSlideAnimation(){this.refreshCount++;const e=this.refreshCount;this.ePrevious?.remove();const{beans:t,eCurrent:s}=this,i=vt({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=i,i.textContent=s.textContent,this.getGui().insertBefore(i,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(ze(s)&&(s=""),s===this.lastValue||this.beans.filterManager?.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=s;const i=this.eCurrent;return K(e.valueFormatted)?i.textContent=e.valueFormatted:K(e.value)?i.textContent=s:bt(i),!0}},l6=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"),i=this.beans.gos.get("cellFadeDuration")){const o=this.animations[t];o.delete(e);const n=Date.now(),r=n+s,a=n+s+i,l={phase:"flash",flashEndTime:r,fadeEndTime:a};o.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 i=this.animations[s],o=`ag-cell-${s}`,n=`${o}-animation`;for(const[r,a]of i){if(!r.isAlive()||!r.comp){i.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(o,!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(o,!1),p.toggleCss(n,!1),f.removeProperty("transition"),f.removeProperty("transition-delay"),i.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=J2(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 c6(e,t={}){const{cellFlashSvc:s}=e;s&&e.frameworkOverrides.wrapIncoming(()=>{for(const i of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))s.flashCell(i,t)})}var d6={moduleName:"HighlightChanges",version:$,beans:[l6],userComponents:{agAnimateShowChangeCellRenderer:o6,agAnimateSlideCellRenderer:a6},apiFunctions:{flashCells:c6}};function u6(e){return e.stateSvc?.getState()??{}}function h6(e,t,s){return e.stateSvc?.setState(t,s)}function ag(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=g6(e)),e.version=$,e}function g6(e){return e.cellSelection=p6(e,"rangeSelection"),e}function p6(e,t){if(e&&typeof e=="object")return e[t]}var f6=class extends A{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=nt(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=nt(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=nt(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 i=ag(e.get("initialState")??{}),o=i.partialColumnState;delete i.partialColumnState,this.cachedState=i;const n=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>n(()=>this.setupStateOnGridReady(i))),(i.columnOrder||i.columnVisibility||i.columnSizing||i.columnPinning||i.columnGroup)&&s?.hideColumns("columnState");const[r,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:c})=>{c==="gridInitializing"&&(r(),n(()=>{this.setupStateOnColumnsInitialised(i,!!o),s?.revealColumns("columnState")}))},rowCountReady:()=>{a?.(),n(()=>this.setupStateOnRowCountReady(i))},firstDataRendered:()=>{l?.(),n(()=>this.setupStateOnFirstDataRendered(i))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const s=ag(e);delete s.partialColumnState,this.cachedState=s,this.startSuppressEvents();const i="api",o=t?new Set(t):void 0;this.setGridReadyState(s,i,o),this.setColumnsInitialisedState(s,i,!!o,o),this.setRowCountState(s,i,o),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(s,i,o),this.stopSuppressEvents(i)})}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,i){this.setColumnState(e,t,s,i),this.setColumnGroupState(e,t,i),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const s=i=>()=>this.updateColumnState([i]);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:i,rowGroupExpansion:o,ssrmRowGroupExpansion:n,rowSelection:r,pagination:a}=e,l=(d,u)=>!s?.has(d)&&(u||t==="api");l("filter",i)&&this.setFilterState(i),l("rowGroupExpansion",o)&&this.setRowGroupExpansionState(n,o,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))},i=()=>t("filter",this.getFilterState()),{gos:o,colFilter:n}=this.beans;this.addManagedEventListeners({filterChanged:i,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:s,columnRowGroupChanged:s,rowDataUpdated:()=>{(o.get("groupDefaultExpanded")!==0||o.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:i})}setFirstDataRenderedState(e,t,s){const{scroll:i,cellSelection:o,focusedCell:n,columnOrder:r,rowPinning:a}=e,l=(u,h)=>!s?.has(u)&&(h||t==="api");l("focusedCell",n)&&this.setFocusedCellState(n),l("cellSelection",o)&&this.setCellSelectionState(o),l("scroll",i)&&this.setScrollState(i),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:i=>{if(i.finished){const o=this.getRangeSelectionState();t("rangeSelection",o),t("cellSelection",o)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return c5(Xr(e),e.colModel.isPivotMode())}setColumnState(e,t,s,i){const{sort:o,rowGroup:n,aggregation:r,pivot:a,columnPinning:l,columnVisibility:c,columnSizing:d,columnOrder:u}=e;let h=!1;const p=(D,I)=>{const V=!i?.has(D)&&!!(I||t==="api");return h||(h=V),V},f={},C=D=>{let I=f[D];return I||(I={colId:D},f[D]=I,I)},w={},v=p("sort",o);v&&o?.sortModel.forEach(({colId:D,sort:I},V)=>{const N=C(D);N.sort=I,N.sortIndex=V}),(v||!s)&&(w.sort=null,w.sortIndex=null);const b=p("rowGroup",n);b&&n?.groupColIds.forEach((D,I)=>{const V=C(D);V.rowGroup=!0,V.rowGroupIndex=I}),(b||!s)&&(w.rowGroup=null,w.rowGroupIndex=null);const S=p("aggregation",r);S&&r?.aggregationModel.forEach(({colId:D,aggFunc:I})=>{C(D).aggFunc=I}),(S||!s)&&(w.aggFunc=null);const y=p("pivot",a);y&&(a?.pivotColIds.forEach((D,I)=>{const V=C(D);V.pivot=!0,V.pivotIndex=I}),this.gos.updateGridOptions({options:{pivotMode:!!a?.pivotMode},source:t})),(y||!s)&&(w.pivot=null,w.pivotIndex=null);const x=p("columnPinning",l);if(x){for(const D of l?.leftColIds??[])C(D).pinned="left";for(const D of l?.rightColIds??[])C(D).pinned="right"}(x||!s)&&(w.pinned=null);const F=p("columnVisibility",c);if(F)for(const D of c?.hiddenColIds??[])C(D).hide=!0;(F||!s)&&(w.hide=null);const R=p("columnSizing",d);if(R)for(const{colId:D,flex:I,width:V}of d?.columnSizingModel??[]){const N=C(D);N.flex=I??null,N.width=V}(R||!s)&&(w.flex=null);const E=u?.orderedColIds,P=!!E?.length&&!i?.has("columnOrder"),M=P?E.map(D=>C(D)):Object.values(f);(M.length||h)&&(this.columnStates=M,$t(this.beans,{state:M,applyOrder:P,defaultState:w},t))}setColumnPivotState(e,t){const s=this.columnStates;this.columnStates=void 0;const i=this.columnGroupStates;this.columnGroupStates=void 0;const o=this.beans,{pivotResultCols:n,colGroupSvc:r}=o;if(n?.isPivotResultColsPresent()){if(s){const a=[];for(const l of s)n.getPivotResultCol(l.colId)&&a.push(l);$t(o,{state:a,applyOrder:e},t)}i&&r?.setColumnGroupState(i,t)}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return d5(t)}setColumnGroupState(e,t,s){const i=this.beans.colGroupSvc;if(!i||s?.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const o=new Set(e.columnGroup?.openColumnGroupIds),r=i.getColumnGroupState().map(({groupId:a})=>{const l=o.has(a);return l&&o.delete(a),{groupId:a,open:l}});for(const a of o)r.push({groupId:a,open:!0});r.length&&(this.columnGroupStates=r),i.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(),i=e?.getAdvFilterModel()??void 0;return t||i||s?{filterModel:t,columnFilterState:s,advancedFilterModel:i}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:s,columnFilterState:i,advancedFilterModel:o}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(s!==void 0||i!==void 0)&&t?.setFilterState(s??null,i??null,"columnFilter"),o!==void 0&&t?.setAdvFilterModel(o??null,"advancedFilter")}getRangeSelectionState(){const e=this.beans.rangeSvc?.getCellRanges().map(t=>{const{id:s,type:i,startRow:o,endRow:n,columns:r,startColumn:a}=t;return{id:s,type:i,startRow:o,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:i,visibleCols:o}=this.beans;if(!Us(t)||!s)return;const n=[];for(const r of e?.cellRanges??[]){const a=[];for(const c of r.colIds){const d=i.getCol(c);d&&a.push(d)}if(!a.length)continue;let l=i.getCol(r.startColId);if(!l){const c=o.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:i,rowRenderer:o,animationFrameSvc:n,ctrlsSvc:r}=this.beans;i.wrapIncoming(()=>{r.get("center").setCenterViewportScrollLeft(s),r.getScrollFeature()?.setVerticalScrollPosition(t),o.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:i}=e;return{colId:t.getColId(),rowIndex:s,rowPinned:i}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:s}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:i,rowIndex:o,rowPinned:n}=e;t.setFocusedCell({column:s.getCol(i),rowIndex:o,rowPinned:n,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const s=e.getCurrentPage(),i=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!s&&!i))return{page:s,pageSize:i}}setPaginationState(e,t){const{pagination:s,gos:i}=this.beans;if(!s)return;const{pageSize:o,page:n}=e??{page:0,pageSize:i.get("paginationPageSize")},r=t==="gridInitializing";o&&!i.get("paginationAutoPageSize")&&s.setPageSize(o,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 i=this.beans.expansionSvc;if(!i)return;const o=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};i.setExpansionState(o,s)}updateColumnState(e){const t=this.getColumnState();let s=!1;const i=this.cachedState;for(const o of Object.keys(t)){const n=t[o];dn(n,i[o])||(s=!0)}this.cachedState={...i,...t},s&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const s=this.cachedState[e];this.setCachedStateValue(e,t),dn(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")}},m6={moduleName:"GridState",version:$,beans:[f6],apiFunctions:{getState:u6,setState:h6}};function C6(e){return e.rowModel.isLastRowIndexKnown()}function v6(e){return e.pagination?.getPageSize()??100}function w6(e){return e.pagination?.getCurrentPage()??0}function b6(e){return e.pagination?.getTotalPages()??1}function S6(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function y6(e){e.pagination?.goToNextPage()}function x6(e){e.pagination?.goToPreviousPage()}function R6(e){e.pagination?.goToFirstPage()}function F6(e){e.pagination?.goToLastPage()}function E6(e,t){e.pagination?.goToPage(t)}var D6=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 i=Math.max(di(t),1),o=Math.floor(e/i);t.pagination.setPageSize(o,"autoCalculated")};this.isBodyRendered?nt(this,s,50)():(s(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},Bo="paginationPageSizeSelector",P6={tag:"span",cls:"ag-paging-page-size"},M6=class extends Ue{constructor(){super(P6),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(Bo,()=>{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(){bt(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(Bo)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),s=!t||!e.includes(t);if(s){const o=this.gos.exists("paginationPageSize"),n=this.gos.get(Bo)!==!0;B(94,{pageSizeSet:o,pageSizesSet:n,pageSizeOptions:e,paginationPageSizeOption:t}),n||B(95,{paginationPageSizeOption:t,paginationPageSizeSelector:Bo}),e.unshift("")}const i=String(s?"":t);this.selectPageSizeComp?(qs(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(i,!0)):this.createPageSizeSelectorComp(e,i),this.hasEmptyOption=s}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const s=this.getLocaleTextFunc(),i=s("pageSizeSelectorLabel","Page Size:"),o=s("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new kd).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(o).setLabel(i).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(Bo);return!Array.isArray(t)||!t?.length?e:[...t].sort((s,i)=>s-i)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},T6={selector:"AG-PAGE-SIZE-SELECTOR",component:M6},I6=".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}",k6=class extends R2{constructor(){super(),this.btFirst=de,this.btPrevious=de,this.btNext=de,this.btLast=de,this.lbRecordCount=de,this.lbFirstRowOnPage=de,this.lbLastRowOnPage=de,this.lbCurrent=de,this.lbTotal=de,this.pageSizeComp=de,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(I6)}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(),[T6]);const{btFirst:t,btPrevious:s,btNext:i,btLast:o}=this;this.activateTabIndex([t,s,i,o]),t.insertAdjacentElement("afterbegin",Vt(e?"last":"first",this.beans)),s.insertAdjacentElement("afterbegin",Vt(e?"next":"previous",this.beans)),i.insertAdjacentElement("afterbegin",Vt(e?"previous":"next",this.beans)),o.insertAdjacentElement("afterbegin",Vt(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):WR(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:i=>{(i.key===T.ENTER||i.key===T.SPACE)&&(i.preventDefault(),s())}})}zR(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}):h5(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 i=this.isZeroPagesToDisplay(),o=e===s-1;this.nextButtonDisabled=o||i,this.lastButtonDisabled=!t||i||e===s-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){o0(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(),i=e?s:null,o=this.pagination.getCurrentPage(),n=this.pagination.getPageSize();let r,a;this.isZeroPagesToDisplay()?r=a=0:(r=n*o+1,a=r+n-1,e&&a>i&&(a=i));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?o+1:0,C=this.formatNumber(f);this.lbCurrent.textContent=C;let w,v;if(e)w=this.formatNumber(t),v=this.formatNumber(i);else{const b=h("more","more");w=b,v=b}this.lbTotal.textContent=w,this.lbRecordCount.textContent=v,this.announceAriaStatus(d,u,v,C,w)}announceAriaStatus(e,t,s,i,o){const n=this.getLocaleTextFunc(),r=n("page","Page"),a=n("to","to"),l=n("of","of"),c=`${e} ${a} ${t} ${l} ${s}`,d=`${r} ${i} ${l} ${o}`;c!==this.ariaRowStatus&&(this.ariaRowStatus=c,this.ariaAnnounce?.announceValue(c,"paginationRow")),d!==this.ariaPageStatus&&(this.ariaPageStatus=d,this.ariaAnnounce?.announceValue(d,"paginationPage"))}},A6={selector:"AG-PAGINATION",component:k6},L6=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 A6}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 K(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:K(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:K(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:K(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,i=t-1;this.totalPages=Math.floor(i/s)+1,this.adjustCurrentPageIfInvalid();const o=this.currentPage,n=s*o;let r=s*(o+1)-1;if(r>i&&(r=i),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(n),r===i)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,i=e-1;this.totalPages=Math.floor(i/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*s,this.bottomDisplayedRowIndex=t*(s+1)-1,this.bottomDisplayedRowIndex>i&&(this.bottomDisplayedRowIndex=i)}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:i=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:s,newPageSize:i,keepRenderedRows:t})}},O6={moduleName:"Pagination",version:$,beans:[L6,D6],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:C6,paginationGetPageSize:v6,paginationGetCurrentPage:w6,paginationGetTotalPages:b6,paginationGetRowCount:S6,paginationGoToNextPage:y6,paginationGoToPreviousPage:x6,paginationGoToFirstPage:R6,paginationGoToLastPage:F6,paginationGoToPage:E6},dependsOn:[ka]};function N6(e,t={}){const s=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(s))}function hC(e,t,s,i,o){t&&(i&&t.parent&&t.parent.level!==-1&&hC(e,t.parent,s,i,o),t.setExpanded(s,void 0,o))}function H6(e,t){return e.rowModel.getRowNode(t)}function G6(e,t,s,i){e.rowRenderer.addRenderedRowListener(t,s,i)}function B6(e){return e.rowRenderer.getRenderedNodes()}function V6(e,t,s){e.rowModel.forEachNode(t,s)}function z6(e){return e.rowRenderer.firstRenderedRow}function W6(e){return e.rowRenderer.lastRenderedRow}function _6(e,t){return e.rowModel.getRow(t)}function j6(e){return e.rowModel.getRowCount()}var U6={moduleName:"RowApi",version:$,apiFunctions:{redrawRows:N6,setRowNodeExpanded:hC,getRowNode:H6,addRenderedRowListener:G6,getRenderedNodes:B6,forEachNode:V6,getFirstDisplayedRowIndex:z6,getLastDisplayedRowIndex:W6,getDisplayedRowAtIndex:_6,getDisplayedRowCount:j6}},$6={moduleName:"ScrollApi",version:$,apiFunctions:{getVerticalPixelRange:oM,getHorizontalPixelRange:nM,ensureColumnVisible:Qm,ensureIndexVisible:Jm,ensureNodeVisible:rM}};function K6(e,t,s){if(!t)return;const i=e.ctrlsSvc.getGridBodyCtrl().eGridBody,o=`aria-${t}`;s===null?i.removeAttribute(o):i.setAttribute(o,s)}function q6(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function Y6(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function Z6(e){return e.animationFrameSvc?.isQueueEmpty()??!0}function X6(e){e.animationFrameSvc?.flushAllFrames()}function Q6(e){return{rowHeight:di(e),headerHeight:kn(e)}}function J6(e,t={}){const s=[];for(const n of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const r=n.getCellRenderer();r!=null&&s.push(Cn(r))}if(t.columns?.length)return s;const i=[],o=qc(t.rowNodes);for(const n of e.rowRenderer.getAllRowCtrls()){if(o&&!Yc(n.rowNode,o)||!n.isFullWidth())continue;const r=n.getFullWidthCellRenderers();for(let a=0;a<r.length;a++){const l=r[a];l!=null&&i.push(Cn(l))}}return[...i,...s]}var eI={moduleName:"RenderApi",version:$,apiFunctions:{setGridAriaProperty:K6,refreshCells:q6,refreshHeader:Y6,isAnimationFrameQueueEmpty:Z6,flushAllAnimationFrames:X6,getSizesForCurrentTheme:Q6,getCellRendererInstances:J6}};function tI(e,t){typeof t=="number"?e.colAutosize?.sizeColumnsToFit(t,"api"):e.colAutosize?.sizeColumnsToFitGridBody(t)}function gC({colAutosize:e,visibleCols:t},s,i){Array.isArray(s)?e?.autoSizeCols({colKeys:s,skipHeader:i,source:"api"}):e?.autoSizeCols({...s,colKeys:s.colIds??t.allCols,source:"api"})}function sI(e,t){t&&typeof t=="object"?gC(e,t):e.colAutosize?.autoSizeAllColumns({source:"api",skipHeader:t})}var iI=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 i=t.type;if(i==="fitGridWidth"||i==="fitProvidedWidth")s=!0;else if(i==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const o=e.get("rowData");s=o!=null&&o.length>0&&$e(e)}s&&this.beans.colDelayRenderSvc?.hideColumns(i)}}autoSizeCols(e){const{eventSvc:t,visibleCols:s}=this.beans;this.innerAutoSizeCols(e).then(i=>{const o=c=>go(t,Array.from(c),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return o(i);const n=lg(this.beans),r=c=>s.leftCols.some(d=>en(d,c)),a=c=>s.rightCols.some(d=>en(d,c)),l=e.colKeys.filter(c=>!Ps(c)&&!bs(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}),o(i)})}innerAutoSizeCols(e){return new Promise((t,s)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,s));const{colKeys:i,skipHeader:o,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 w=new Set;let v=-1;const b=Object.fromEntries(c.map(({colId:x,...F})=>[x,F])),S=o??this.gos.get("skipHeaderOnAutoSize"),y=n??S;for(;v!==0;){v=0;const x=[];for(const F of i){if(!F||mS(F))continue;const R=p.getCol(F);if(!R||w.has(R))continue;const E=f.getPreferredWidthForColumn(R,S);if(E>0){const P=b[R.colId]??{};P.minWidth??(P.minWidth=l),P.maxWidth??(P.maxWidth=a);const M=oI(R,E,P);R.setActualWidth(M,d),w.add(R),v++}x.push(R)}x.length&&C.refresh(d)}y||this.autoSizeColumnGroupsByColumns(i,d,r),t(w)})}autoSizeColumn(e,t,s){this.autoSizeCols({colKeys:[e],skipHeader:s,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,s){const{colModel:i,ctrlsSvc:o}=this.beans,n=new Set,r=i.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 o.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"),i=()=>{this.autoSizeColumn(t,"uiColumnResized",s)};e.addEventListener("dblclick",i);const o=new ti(e);return o.addEventListener("doubleTap",i),()=>{e.removeEventListener("dblclick",i),o.destroy()}}addColumnGroupResize(e,t,s){const i=this.gos.get("skipHeaderOnAutoSize"),o=()=>{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:i,stopAtGroup:t,source:"uiColumnResized"}),s()};return e.addEventListener("dblclick",o),()=>e.removeEventListener("dblclick",o)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const s=lg(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):B(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",s,i){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,s,i));return}const o={};for(const{key:f,...C}of i?.columnLimits??[])o[typeof f=="string"?f:f.getColId()]=C;const n=this.beans.visibleCols.allCols;if(e<=0||!n.length)return;const r=fs(n);if(i?.onlyScaleUp&&r>e||e===r&&n.every(C=>{if(C.colDef.suppressSizeToFit)return!0;const w=o?.[C.getId()],v=w?.minWidth??i?.defaultMinWidth,b=w?.maxWidth??i?.defaultMaxWidth,S=C.getActualWidth();return(v==null||S>=v)&&(b==null||S<=b)}))return;const l=[],c=[];for(const f of n){const C=i?.colKeys?.some(w=>en(f,w))??!0;f.getColDef().suppressSizeToFit||!C?c.push(f):l.push(f)}const d=l.slice(0);let u=!1;const h=f=>{qt(l,f),c.push(f)};for(const f of l){f.resetActualWidth(t);const C=o?.[f.getId()],w=C?.minWidth??i?.defaultMinWidth,v=C?.maxWidth??i?.defaultMaxWidth,b=f.getActualWidth();typeof w=="number"&&b<w?f.setActualWidth(w,t,!0):typeof v=="number"&&b>v&&f.setActualWidth(v,t,!0)}for(;!u;){u=!0;const f=e-fs(c);if(f<=0)for(const C of l){const w=o?.[C.getId()]?.minWidth??i?.defaultMinWidth??C.minWidth;C.setActualWidth(w,t,!0)}else{const C=f/fs(l);let w=f;for(let v=l.length-1;v>=0;v--){const b=l[v],S=o?.[b.getId()],y=S?.minWidth??i?.defaultMinWidth,x=S?.maxWidth??i?.defaultMaxWidth,F=b.getMinWidth(),R=b.getMaxWidth(),E=typeof y=="number"&&y>F?y:F,P=typeof x=="number"&&x<R?x:R;let M=Math.round(b.getActualWidth()*C);M<E?(M=E,h(b),u=!1):M>P?(M=P,h(b),u=!1):v===0&&(M=w),b.setActualWidth(M,t,!0),w-=M}}}for(const f of d)f.fireColumnWidthChangedEvent(t);const p=this.beans.visibleCols;p.setLeftValues(t),p.updateBodyWidths(),!s&&go(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 i=s.type;if(i==="fitGridWidth"){const{columnLimits:o,defaultMinWidth:n,defaultMaxWidth:r}=s,a=o?.map(({colId:l,minWidth:c,maxWidth:d})=>({key:l,minWidth:c,maxWidth:d}));this.sizeColumnsToFitGridBody({defaultMinWidth:n,defaultMaxWidth:r,columnLimits:a})}else i==="fitProvidedWidth"&&this.sizeColumnsToFit(s.width,"sizeColumnsToFit");t?.revealColumns(i)})}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 oI(e,t,s={}){const i=s.minWidth??e.getMinWidth();t<i&&(t=i);const o=s.maxWidth??e.getMaxWidth();return t>o&&(t=o),t}function lg({ctrlsSvc:e,scrollVisibleSvc:t}){const s=e.getGridBodyCtrl(),o=s.isVerticalScrollShowing()?t.getScrollbarWidth():0;return gn(s.eGridBody)-o}var nI={moduleName:"ColumnAutoSize",version:$,beans:[iI],apiFunctions:{sizeColumnsToFit:tI,autoSizeColumns:gC,autoSizeAllColumns:sI},dependsOn:[am]},rI=".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 aI(e){return e.pinnedRowModel?.getPinnedTopRowCount()??0}function lI(e){return e.pinnedRowModel?.getPinnedBottomRowCount()??0}function cI(e,t){return e.pinnedRowModel?.getPinnedTopRow(t)}function dI(e,t){return e.pinnedRowModel?.getPinnedBottomRow(t)}function uI(e,t,s){return e.pinnedRowModel?.forEachPinnedRow(t,s)}var hI={moduleName:"PinnedRow",version:$,beans:[C2],css:[rI],apiFunctions:{getPinnedTopRowCount:aI,getPinnedBottomRowCount:lI,getPinnedTopRow:cI,getPinnedBottomRow:dI,forEachPinnedRow:uI},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},gI=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}},pI=class extends A{constructor(e){super(),this.column=e}buildCache(e){const{column:t,beans:{gos:s,pinnedRowModel:i,rowModel:o,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,w;const v=(S,y)=>{f=S,C=null,w=y},b=S=>{const y=!S.isExpandable()&&!S.group&&!S.detail&&(d?!d({rowNode:S}):!0);if(S.rowIndex==null||!y){v(null,null);return}if(f==null||S.level!==f.level||S.footer||C&&S.rowIndex-1!==C?.getLastNode().rowIndex){v(S,n.getValue(t,S));return}const x=n.getValue(t,S);if(p){const F=ue(s,{valueA:w,nodeA:f,valueB:x,nodeB:S,column:t,colDef:a});if(!h(F)){v(S,x);return}}else if(u?!u(w,x):w!==x){v(S,x);return}if(!C){const F=l?.get(f);F?.firstNode===f?(F.reset(),C=F):C=new gI(t,f),c.set(f,C)}C.addSpannedNode(S),c.set(S,C)};switch(e){case"center":o.forEachDisplayedNode?.(S=>{(!r||r.isRowInPage(S.rowIndex))&&b(S)}),this.centerValueNodeMap=c;break;case"top":i?.forEachPinnedRow("top",b),this.topValueNodeMap=c;break;case"bottom":i?.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}}},fI=class extends A{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=nt(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=nt(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 pI(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,i=e.column,o=e.rowIndex,n=this.spanningColumns.get(i);if(!n)return;let r;switch(e.rowPinned){case"top":r=t?.getPinnedTopRow(o);break;case"bottom":r=t?.getPinnedBottomRow(o);break;default:r=s.getRow(o)}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,i]of this.spanningColumns)if(i.isCellSpanning(e)){const o=i.getCellSpan(e);t(s,o)}}destroy(){super.destroy(),this.spanningColumns.clear()}},mI=class extends ao{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,i,o,n,r){this.eWrapper=s,super.setComp(e,t,s,i,o,n,r),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||gp(e,t.rowIndex)}setAriaRowSpan(){l0(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(Ma(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}},CI=class extends na{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 mI(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(){}},vI=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),i=s.size,o=this.getAllRelevantRowControls(e),n=new Map;let r=!1;for(const l of o)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 CI(d.firstNode,this.beans,!1,!1,!1);n.set(d.firstNode,h)});this.setCtrlsMap(e,n);const a=n.size===i;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 i=this.getCtrlsMap(e.rowPinned).get(s.firstNode);if(i)return i.getAllCellCtrls().find(o=>o.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")}},wI={moduleName:"CellSpan",version:$,beans:[fI,vI]},bI=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,i=s.cellClassRules,o=this.getCellClassParams(e,s);Zd(this.beans.expressionSvc,i===this.cellClassRules?void 0:this.cellClassRules,i,o,n=>t.toggleCss(n,!0),n=>t.toggleCss(n,!1)),this.cellClassRules=i}applyUserStyles(){const e=this.column,t=e.colDef,s=t.cellStyle;if(!s)return;let i;if(typeof s=="function"){const o=this.getCellClassParams(e,t);i=s(o)}else i=s;i&&this.cellComp.setUserStyles(i)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,s=e.colDef,i=this.getCellClassParams(e,s);for(const n of this.staticClasses)t.toggleCss(n,!1);const o=this.beans.cellStyles.getStaticCellClasses(s,i);this.staticClasses=o;for(const n of o)t.toggleCss(n,!0)}getCellClassParams(e,t){const{value:s,rowNode:i}=this.cellCtrl;return ue(this.beans.gos,{value:s,data:i.data,node:i,colDef:t,column:e,rowIndex:i.rowIndex})}},SI=class extends A{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,s,i){Zd(this.beans.expressionSvc,void 0,e.cellClassRules,t,s,i),this.processStaticCellClasses(e,t,s)}getStaticCellClasses(e,t){const{cellClass:s}=e;if(!s)return[];let i;return typeof s=="function"?i=s(t):i=s,typeof i=="string"&&(i=[i]),i||[]}createCellCustomStyleFeature(e,t){return new bI(e,t)}processStaticCellClasses(e,t,s){this.getStaticCellClasses(e,t).forEach(o=>{s(o)})}},yI={moduleName:"CellStyle",version:$,beans:[SI]},xI={moduleName:"RowStyle",version:$,beans:[lP]};function RI(e,t){return!!e.colHover?.isHovered(t)}var FI=class extends A{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=s=>{const{beans:i,gos:o,element:n,columns:r}=this,a=i.colHover;if(s??!!o.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}},EI="ag-column-hover",DI=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 i=()=>{const o=this.isHovered(s);t.toggleCss("ag-column-hover",o)};e.addManagedEventListeners({columnHoverChanged:i}),i()}onCellColumnHover(e,t){if(!t)return;const s=this.isHovered(e);t.toggleCss(EI,s)}addHeaderFilterColumnHoverListener(e,t,s,i){this.createHoverFeature(e,[s],i);const o=()=>{const n=this.isHovered(s);t.toggleCss("ag-column-hover",n)};e.addManagedEventListeners({columnHoverChanged:o}),o()}createHoverFeature(e,t,s){e.createManagedBean(new FI(t,s))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},PI={moduleName:"ColumnHover",version:$,beans:[DI],apiFunctions:{isColumnHovered:RI}},MI=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,i=!Lr.has(e),o=i?this.asyncListeners:this.syncListeners;o.has(e)||o.set(e,new Set),o.get(e).add(s),this.eventSvc.addListener(e,s,i)}removeListener(e,t){const s=this.wrapSvc?.unwrap(e,t)??t,o=!!this.asyncListeners.get(e)?.delete(s);o||this.syncListeners.get(e)?.delete(s),this.eventSvc.removeListener(e,s,o)}addGlobalListener(e){const t=this.wrapSvc?.wrapGlobal(e)??e,s=(n,r)=>{Lr.has(n)&&t(n,r)},i=(n,r)=>{Lr.has(n)||t(n,r)};this.globalListenerPairs.set(e,{syncListener:s,asyncListener:i});const o=this.eventSvc;o.addGlobalListener(s,!1),o.addGlobalListener(i,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:s,globalListenerPairs:i}=this,o=s?.unwrapGlobal(e)??e;if(i.has(o)){const{syncListener:r,asyncListener:a}=i.get(o);t.removeGlobalListener(r,!1),t.removeGlobalListener(a,!0),i.delete(e)}else this.syncGlobalListeners.delete(o),t.removeGlobalListener(o,!1)}destroyEventListeners(e,t){e.forEach((s,i)=>{s.forEach(o=>this.eventSvc.removeListener(i,o,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:i})=>{t.removeGlobalListener(s,!1),t.removeGlobalListener(i,!0)}),e.clear()}};function TI(e,t,s){e.apiEventSvc?.addListener(t,s)}function II(e,t,s){e.apiEventSvc?.removeListener(t,s)}function kI(e,t){e.apiEventSvc?.addGlobalListener(t)}function AI(e,t){e.apiEventSvc?.removeGlobalListener(t)}var LI={moduleName:"EventApi",version:$,apiFunctions:{addEventListener:TI,addGlobalListener:kI,removeEventListener:II,removeGlobalListener:AI},beans:[MI]},OI={moduleName:"Locale",version:$,beans:[l5]},NI=class extends A{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=nt(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){const{visibleCols:e,rowModel:t,rowSpanSvc:s,pinnedRowModel:i}=this.beans,o=e.autoHeightCols;let n=!1;const r=a=>{const l=a.__autoHeights;let c=js(this.beans,a).height;for(const d of o){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)};i?.forEachPinnedRow?.("top",r),i?.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 i=e.__autoHeights[s.getId()];e.__autoHeights[s.getId()]=t,i!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:s,colViewport:i,visibleCols:o}=this.beans;if(!s.colSpanActive)return!1;let n=[];switch(e.getPinned()){case"left":n=o.getLeftColsForRow(t);break;case"right":n=o.getRightColsForRow(t);break;case null:n=i.getColsWithinViewport(t);break}return!n.includes(e)}setupCellAutoHeight(e,t,s){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const i=t.parentElement,{rowNode:o,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}=Ei(i),C=u+h+p+f,v=t.offsetHeight+C;if(d<5){const S=!tt(r)?.contains(t),y=v==0;if(S||y){window.setTimeout(()=>a(d+1),0);return}}this.setRowAutoHeight(o,v,n)},l=()=>a(0);l();const c=Es(r,t,l);return s.addDestroyFunc(()=>{c(),this.setRowAutoHeight(o,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(o=>o.isAutoHeight())),t.length!==0){if(!s.__autoHeights)return!1;for(const i of t){const o=s.__autoHeights[i.getColId()];if(!o||s.rowHeight<o)return!1}}return!0}},HI={moduleName:"RowAutoHeight",version:$,beans:[NI]},GI={moduleName:"AllCommunity",version:$,dependsOn:[NT,jT,e6,D5,HM,GM,BM,VM,zM,WM,_M,NM,M4,T4,I4,P4,A4,L4,m6,pT,O6,lm,U6,$6,eI,nI,fF,hI,oT,jP,yI,PI,xI,LI,KP,d6,Xm,OI,HI,pF,HT,wI]},ht=g.createContext({}),pC=g.createContext("default"),Ln=(e,t,s,i)=>{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),cg(i,r)}),()=>{l=!0,r&&(a?.remove(),t.destroyBean(r),i&&cg(i,void 0))}},cg=(e,t)=>{if(e)if(e instanceof Function)e(t);else{const s=e;s.current=t}},Nt=(...e)=>e.filter(s=>s!=null&&s!=="").join(" "),zt=class fC{constructor(...t){this.classesMap={};for(const s of t)this.classesMap[s]=!0}setClass(t,s){if(!!this.classesMap[t]==s)return this;const o=new fC;return o.classesMap={...this.classesMap},o.classesMap[t]=s,o}toString(){return Object.keys(this.classesMap).filter(s=>this.classesMap[s]).join(" ")}},Fo=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()},ed=g.version?.split(".")[0],mC=ed==="16"||ed==="17";function BI(){return ed==="19"}var Nr=!1;function VI(e){return Nr||setTimeout(()=>Nr=!1,0),Nr=!0,e()}var yn=(e,t)=>{!mC&&e&&!Nr?Rn.flushSync(t):t()},zI=e=>{mC?e():g.startTransition(e)};function WI(e,t,s){return g.useSyncExternalStore?g.useSyncExternalStore(e,t):s}function la(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 i=[],o=[],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)&&i.push(l)}for(let a=0;a<t.length;a++){const l=t[a],c=l.instanceId;n.has(c)||o.push(l)}return i.length===e.length&&o.length===0?e:i.length===0&&o.length===t.length?t:i.length===0?o:o.length===0?i:[...i,...o]}var CC=g.forwardRef((e,t)=>{const{registry:s,context:i}=g.useContext(ht),o=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(),[w,v]=g.useState(()=>new zt),[b,S]=g.useState(()=>new zt("ag-hidden")),[y,x]=g.useState(()=>new zt("ag-hidden")),[F,R]=g.useState(()=>new zt("ag-invisible"));g.useImperativeHandle(t,()=>({refresh(){return!1}})),g.useLayoutEffect(()=>Ln(d,i,n.current),[d]);const E=g.useCallback(Q=>{if(o.current=Q,!Q||i.isDestroyed()){c.current=i.destroyBean(c.current);return}const L={setInnerRenderer:(W,ee)=>{u(W),C(ee)},setChildCount:W=>p(W),toggleCss:(W,ee)=>v(Y=>Y.setClass(W,ee)),setContractedDisplayed:W=>x(ee=>ee.setClass("ag-hidden",!W)),setExpandedDisplayed:W=>S(ee=>ee.setClass("ag-hidden",!W)),setCheckboxVisible:W=>R(ee=>ee.setClass("ag-invisible",!W)),setCheckboxSpacing:W=>R(ee=>ee.setClass("ag-group-checkbox-spacing",W))},re=s.createDynamicBean("groupCellRendererCtrl",!0);re&&(c.current=i.createBean(re),c.current.init(L,Q,r.current,a.current,l.current,CC,e))},[]),P=g.useMemo(()=>`ag-cell-wrapper ${w.toString()}`,[w]),M=g.useMemo(()=>`ag-group-expanded ${b.toString()}`,[b]),D=g.useMemo(()=>`ag-group-contracted ${y.toString()}`,[y]),I=g.useMemo(()=>`ag-group-checkbox ${F.toString()}`,[F]),V=d?.componentFromFramework,N=V?d.componentClass:void 0,O=d==null&&f!=null,q=yo(f);return g.createElement("span",{className:P,ref:E,...e.colDef?{}:{role:c.current?.getCellAriaRole()}},g.createElement("span",{className:M,ref:a}),g.createElement("span",{className:D,ref:l}),g.createElement("span",{className:I,ref:r}),g.createElement("span",{className:"ag-group-value",ref:n},O?q:V?g.createElement(N,{...d.params}):null),g.createElement("span",{className:"ag-group-child-count"},h))}),dg=CC,ou=g.createContext({setMethods:()=>{}}),_I=e=>{const{initialProps:t,addUpdateCallback:s,CustomComponentClass:i,setMethods:o}=e,[{key:n,...r},a]=g.useState(t);return g.useEffect(()=>{s(l=>a(l))},[]),g.createElement(ou.Provider,{value:{setMethods:o}},g.createElement(i,{key:n,...r}))},jI=g.memo(_I),UI=0;function ug(){return`agPortalKey_${++UI}`}var vC=class{constructor(e,t,s,i){this.portal=null,this.oldPortal=null,this.reactComponent=e,this.portalManager=t,this.componentType=s,this.suppressFallbackMethods=!!i,this.statelessComponent=this.isStateless(this.reactComponent),this.key=ug(),this.portalKey=ug(),this.instanceCreated=this.isStatelessComponent()?De.resolve(!1):new De(o=>{this.resolveInstanceCreated=o})}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 i=s[e];if(i)return i.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 De(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=Rn.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 Oa(e,t,s){for(const i of e){const o=t[i];o&&(s[i]=o)}}var It=class extends vC{constructor(){super(...arguments),this.awaitUpdateCallback=new De(e=>{this.resolveUpdateCallback=e}),this.wrapperComponent=jI}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 De(i=>{setTimeout(()=>{i()})})),this.resolveUpdateCallback()}})}setMethods(e){this.providedMethods=e,Oa(this.getOptionalMethods(),this.providedMethods,this)}getOptionalMethods(){return[]}getProps(){return{...this.sourceParams,key:this.key,ref:this.ref}}refreshProps(){return this.updateCallback?this.updateCallback():new De(e=>this.awaitUpdateCallback.then(()=>{this.updateCallback().then(()=>e())}))}},$I=class extends It{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},KI=class extends It{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}},qI=class extends It{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:i}=this;return e.label=t,e.icon=s,e.shake=i,e}},YI=class extends It{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 De(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 De(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}},ZI=class extends It{constructor(){super(...arguments),this.awaitSetMethodsCallback=new De(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 wC(e,t){e.parentFilterInstance(s=>{(s.setModel(t)||De.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){Oa(this.getOptionalMethods(),e,this)}getOptionalMethods(){return["afterGuiAttached"]}updateModel(e){this.model=e,this.refreshProps(),wC(this.floatingFilterParams,e)}},QI=class extends It{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(),wC(this.sourceParams,e)}getProps(){const e=super.getProps();return e.model=this.model,e.onModelChange=this.onModelChange,e}},JI=class extends It{refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached"]}},ek=class extends It{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},tk=class extends It{refresh(e){this.sourceParams=e,this.refreshProps()}},sk=class extends It{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}},ik=class extends It{refresh(e){this.sourceParams=e,this.refreshProps()}},ok=class extends It{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},nk=class extends It{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 nu(){B(231)}var rk=1e3,ak=class{constructor(e,t,s){this.destroyed=!1,this.portals=[],this.hasPendingPortalUpdate=!1,this.wrappingElement=t||"div",this.refresher=e,this.maxComponentCreationTimeMs=s||rk}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){yn(!0,()=>this.refresher()),e.rendered()&&t(e);return}window.setTimeout(()=>{this.waitForInstance(e,t,s)})}}},lk=({ctrl:e})=>{const t=e.isAlive(),{context:s}=g.useContext(ht),[i,o]=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 Mn(()=>l.current));const p=g.useCallback(v=>{if(l.current=v,!v||!e.isAlive()||s.isDestroyed()){a.current=s.destroyBean(a.current);return}a.current=s.createBean(new xo);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?u0(l.current,y):h0(l.current))},setUserCompDetails:y=>o(y),getUserCompInstance:()=>u.current||void 0,refreshSelectAllGui:b,removeSelectAllGui:()=>e.getSelectAllGui()?.remove()};e.setComp(S,v,c.current,d.current,a.current),b()},[]);g.useLayoutEffect(()=>Ln(i,s,d.current,u),[i]),g.useEffect(()=>{e.setDragSource(l.current)},[i]);const f=g.useMemo(()=>!!(i?.componentFromFramework&&Fo(i.componentClass)),[i]),C=i?.componentFromFramework,w=i?.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(w,{...i.params}):g.createElement(w,{...i.params,ref:u}):null))},ck=g.memo(lk),dk=class{constructor(e,t){this.floatingFilterParams=e,this.refreshProps=t}getProps(){return this.floatingFilterParams}refresh(e){this.floatingFilterParams=e,this.refreshProps()}setMethods(e){Oa(this.getOptionalMethods(),e,this)}getOptionalMethods(){return["afterGuiAttached"]}},uk=({ctrl:e})=>{const{context:t,gos:s}=g.useContext(ht),[i,o]=g.useState(),[n,r]=g.useState(()=>new zt("ag-header-cell","ag-floating-filter")),[a,l]=g.useState(()=>new zt),[c,d]=g.useState(()=>new zt("ag-floating-filter-button","ag-hidden")),[u,h]=g.useState("false"),[p,f]=g.useState(),[,C]=g.useState(1),w=g.useRef(),v=g.useRef(null),b=g.useRef(null),S=g.useRef(null),y=g.useRef(null),x=g.useRef(),F=g.useRef(),R=W=>{W!=null&&x.current&&x.current(W)},E=g.useCallback(W=>{if(v.current=W,!W||!e.isAlive()||t.isDestroyed()){w.current=t.destroyBean(w.current);return}w.current=t.createBean(new xo),F.current=new De(Y=>{x.current=Y});const ee={toggleCss:(Y,Z)=>r(j=>j.setClass(Y,Z)),setUserStyles:Y=>o(Y),addOrRemoveBodyCssClass:(Y,Z)=>l(j=>j.setClass(Y,Z)),setButtonWrapperDisplayed:Y=>{d(Z=>Z.setClass("ag-hidden",!Y)),h(Y?"false":"true")},setWidth:Y=>{v.current&&(v.current.style.width=Y)},setCompDetails:Y=>f(Y),getFloatingFilterComp:()=>F.current?F.current:null,setMenuIcon:Y=>y.current?.appendChild(Y)};e.setComp(ee,W,y.current,b.current,w.current)},[]);g.useLayoutEffect(()=>Ln(p,t,b.current,R),[p]);const P=g.useMemo(()=>n.toString(),[n]),M=g.useMemo(()=>a.toString(),[a]),D=g.useMemo(()=>c.toString(),[c]),I=g.useMemo(()=>!!(p&&p.componentFromFramework&&Fo(p.componentClass)),[p]),V=g.useMemo(()=>s.get("reactiveCustomComponents"),[]),N=g.useMemo(()=>s.get("enableFilterHandlers"),[]),[O,q]=g.useState();g.useEffect(()=>{if(p?.componentFromFramework)if(V){const W=N?dk:XI,ee=new W(p.params,()=>C(Y=>Y+1));R(ee),q(ee)}else nu()},[p]);const Q=O?.getProps(),L=p?.componentFromFramework,re=p?.componentClass;return g.createElement("div",{ref:E,style:i,className:P,role:"gridcell"},g.createElement("div",{ref:b,className:M,role:"presentation"},L?V?Q&&g.createElement(ou.Provider,{value:{setMethods:W=>O.setMethods(W)}},g.createElement(re,{...Q})):g.createElement(re,{...p.params,ref:I?()=>{}:R}):null),g.createElement("div",{ref:S,"aria-hidden":u,className:D,role:"presentation"},g.createElement("button",{ref:y,type:"button",className:"ag-button ag-floating-filter-button-button",tabIndex:-1})))},hk=g.memo(uk),gk=({ctrl:e})=>{const{context:t}=g.useContext(ht),[s,i]=g.useState(),[o,n]=g.useState(()=>new zt),[r,a]=g.useState(()=>new zt),[l,c]=g.useState("false"),[d,u]=g.useState(),[h,p]=g.useState(),f=g.useRef(),C=g.useRef(null),w=g.useRef(null),v=g.useRef(null),b=g.useRef(),S=g.useCallback(P=>{if(C.current=P,!P||!e.isAlive()||t.isDestroyed()){f.current=t.destroyBean(f.current);return}f.current=t.createBean(new xo);const M={setWidth:D=>{C.current&&(C.current.style.width=D)},toggleCss:(D,I)=>n(V=>V.setClass(D,I)),setUserStyles:D=>i(D),setHeaderWrapperHidden:D=>{const I=v.current;I&&(D?I.style.setProperty("display","none"):I.style.removeProperty("display"))},setHeaderWrapperMaxHeight:D=>{const I=v.current;I&&(D!=null?I.style.setProperty("max-height",`${D}px`):I.style.removeProperty("max-height"),I.classList.toggle("ag-header-cell-comp-wrapper-limited-height",D!=null))},setUserCompDetails:D=>p(D),setResizableDisplayed:D=>{a(I=>I.setClass("ag-hidden",!D)),c(D?"false":"true")},setAriaExpanded:D=>u(D),getUserCompInstance:()=>b.current||void 0};e.setComp(M,P,w.current,v.current,f.current)},[]);g.useLayoutEffect(()=>Ln(h,t,v.current),[h]),g.useEffect(()=>{C.current&&e.setDragSource(C.current)},[h]);const y=g.useMemo(()=>!!(h?.componentFromFramework&&Fo(h.componentClass)),[h]),x=g.useMemo(()=>"ag-header-group-cell "+o.toString(),[o]),F=g.useMemo(()=>"ag-header-cell-resize "+r.toString(),[r]),R=h?.componentFromFramework,E=h?.componentClass;return g.createElement("div",{ref:S,style:s,className:x,role:"columnheader","aria-expanded":d},g.createElement("div",{ref:v,className:"ag-header-cell-comp-wrapper",role:"presentation"},R?y?g.createElement(E,{...h.params}):g.createElement(E,{...h.params,ref:b}):null),g.createElement("div",{ref:w,"aria-hidden":l,className:F}))},pk=g.memo(gk),fk=({ctrl:e})=>{const{gos:t,context:s}=g.useContext(ht),{topOffset:i,rowHeight:o}=g.useMemo(()=>e.getTopAndHeight(),[]),n=g.useMemo(()=>t.get("tabIndex"),[]),[r,a]=g.useState(()=>e.getAriaRowIndex()),l=e.headerRowClass,[c,d]=g.useState(()=>o+"px"),[u,h]=g.useState(()=>i+"px"),p=g.useRef(null),[f,C]=g.useState(()=>e.getUpdatedHeaderCtrls()),w=g.useRef(),v=g.useRef(null),b=g.useCallback(x=>{if(v.current=x,!x||!e.isAlive()||s.isDestroyed()){w.current=s.destroyBean(w.current);return}w.current=s.createBean(new xo);const F={setHeight:R=>d(R),setTop:R=>h(R),setHeaderCtrls:(R,E,P)=>{const M=p.current,D=la(M,R,E);D!==M&&(p.current=D,yn(P,()=>C(D)))},setWidth:R=>{v.current&&(v.current.style.width=R)},setRowIndex:R=>{a(R)}};e.setComp(F,w.current,!1)},[]),S=g.useMemo(()=>({height:c,top:u}),[c,u]),y=g.useCallback(x=>{switch(e.type){case"group":return g.createElement(pk,{ctrl:x,key:x.instanceId});case"filter":return g.createElement(hk,{ctrl:x,key:x.instanceId});default:return g.createElement(ck,{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))},mk=g.memo(fk),Ck=({pinned:e})=>{const[t,s]=g.useState(!0),[i,o]=g.useState([]),{context:n}=g.useContext(ht),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 w={setDisplayed:s,setCtrls:v=>o(v),setCenterWidth:v=>{a.current&&(a.current.style.width=v)},setViewportScrollLeft:v=>{r.current&&(r.current.scrollLeft=v)},setPinnedContainerWidth:v=>{r.current&&(r.current.style.width=v,r.current.style.minWidth=v,r.current.style.maxWidth=v)}};l.current.setComp(w,r.current)},[]),p=t?"":"ag-hidden",f=()=>i.map(C=>g.createElement(mk,{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},sc=g.memo(Ck),vk=()=>{const[e,t]=g.useState(()=>new zt),[s,i]=g.useState(),{context:o}=g.useContext(ht),n=g.useRef(null),r=g.useRef(),a=g.useCallback(d=>{if(n.current=d,!d||o.isDestroyed()){r.current=o.destroyBean(r.current);return}r.current=o.createBean(new KR);const u={toggleCss:(h,p)=>t(f=>f.setClass(h,p)),setHeightAndMinHeight:h=>i(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(sc,{pinned:"left"}),g.createElement(sc,{pinned:null}),g.createElement(sc,{pinned:"right"}))},wk=g.memo(vk),bk=(e,t)=>{g.useEffect(()=>{const s=t.current;if(s){const i=s.parentElement;if(i){const o=document.createComment(e);return i.insertBefore(o,s),()=>{o.remove()}}}},[e])},si=bk,Sk=class{constructor(e,t){this.cellEditorParams=e,this.refreshProps=t,this.instanceCreated=new De(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){Oa(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()}},yk=e=>{const t=g.useRef(e),s=g.useRef(),i=g.useRef(!1),o=g.useRef(!1),[,n]=g.useState(0);i.current&&(o.current=!0),g.useEffect(()=>(i.current||(s.current=t.current(),i.current=!0),n(r=>r+1),()=>{o.current&&s.current?.()}),[])},xk=e=>{const[t,s]=g.useState(),i=g.useContext(ht),{context:o,popupSvc:n,gos:r,editSvc:a}=i,{editDetails:l,cellCtrl:c,eParentCell:d}=e;return yk(()=>{const{compDetails:u}=l,h=r.get("stopEditingWhenCellsLoseFocus");let p,f;if(!o.isDestroyed()){f=o.createBean(a.createPopupEditorWrapper(u.params));const C=f.getGui();if(e.jsChildComp){const x=e.jsChildComp.getGui();x&&C.appendChild(x)}const{column:w,rowNode:v}=c,b={column:w,rowNode:v,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?.(),o.destroyBean(f)}}),g.useLayoutEffect(()=>()=>{c.isCellFocused()&&t?.getGui().contains(je(i))&&d.focus({preventScroll:!0})},[t]),t&&e.wrappedContent?Rn.createPortal(e.wrappedContent,t.getGui()):null},hg=g.memo(xk),Rk=(e,t,s)=>{const{compProxy:i}=e;s(i);const o=i.getProps(),n=Fo(t);return g.createElement(ou.Provider,{value:{setMethods:r=>i.setMethods(r)}},n?g.createElement(t,{...o}):g.createElement(t,{...o,ref:r=>i.setRef(r)}))},gg=(e,t,s)=>e.compProxy?Rk(e,t,s):g.createElement(t,{...e.compDetails.params,ref:s}),Fk=(e,t,s,i,o)=>{const n=e.compDetails,r=n.componentClass,a=n.componentFromFramework&&!e.popup,l=n.componentFromFramework&&e.popup,c=!n.componentFromFramework&&e.popup;return a?gg(e,r,t):l?g.createElement(hg,{editDetails:e,cellCtrl:i,eParentCell:s,wrappedContent:gg(e,r,t)}):c&&o?g.createElement(hg,{editDetails:e,cellCtrl:i,eParentCell:s,jsChildComp:o}):null},Ek=(e,t,s,i,o,n)=>{const{context:r}=g.useContext(ht),a=g.useCallback(()=>{const l=o.current;if(!l)return;const c=l.getGui();c&&c.parentElement&&c.remove(),r.destroyBean(l),o.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(o.current){const f=o.current,w=f.refresh!=null&&e.force==!1?f.refresh(h.params):!1;if(w===!0||w===void 0)return;a()}h.newAgStackInstance().then(f=>{if(!f)return;const C=f.getGui();if(!C)return;(t?s:n.current).appendChild(C),o.current=f})},[e,t,i]),g.useEffect(()=>a,[])},bC=Ek,Dk=({cellCtrl:e,parent:t})=>{const s=g.useRef(),i=g.useMemo(()=>{const{loadingComp:o}=e.getDeferLoadingCellRenderer();return o?{value:void 0,compDetails:o,force:!1}:void 0},[e]);if(bC(i,!1,void 0,1,s,t),i?.compDetails?.componentFromFramework){const o=i.compDetails.componentClass;return g.createElement(o,{...i.compDetails.params})}return g.createElement(g.Fragment,null)},Pk=({cellCtrl:e,printLayout:t,editingCell:s})=>{const i=g.useContext(ht),{context:o}=i,{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(),[w,v]=g.useState(!1),[b,S]=g.useState(!1),[y,x]=g.useState(!1),[F,R]=g.useState(),E=g.useMemo(()=>e.isForceWrapper(),[e]),P=g.useMemo(()=>e.getCellAriaRole(),[e]),M=g.useRef(null),D=g.useRef(null),I=g.useRef(null),V=g.useRef(),N=g.useRef(),O=g.useRef(),q=g.useRef([]),Q=g.useRef(),L=g.useRef(),[re,W]=g.useState(0),ee=g.useCallback(ie=>{L.current=ie,W(be=>be+1)},[]),Y=l!=null&&(w||y||b)&&(d==null||!!d.popup),Z=E||Y,j=g.useMemo(()=>e.getCellValueClass(),[e]),fe=g.useCallback(ie=>{if(N.current=ie,ie){const be=ie.isCancelBeforeStart&&ie.isCancelBeforeStart();setTimeout(()=>{be?(e.stopEditing(!0),e.focusCell(!0)):(e.cellEditorAttached(),e.enableEditorTooltipFeature(ie))})}},[e]),Ce=g.useRef();Ce.current||(Ce.current=new Mn(()=>M.current)),bC(l,Z,L.current,re,V,M);const k=g.useRef();g.useLayoutEffect(()=>{const ie=k.current,be=l;if(k.current=l,ie==null||ie.compDetails==null||be==null||be.compDetails==null)return;Q.current?.refreshVisibility();const Re=ie.compDetails,ke=be.compDetails;if(Re.componentClass!=ke.componentClass||I.current?.refresh==null)return;I.current.refresh(ke.params)!=!0&&p(ve=>ve+1)},[l]),g.useLayoutEffect(()=>{if(!(d&&!d.compDetails.componentFromFramework)||o.isDestroyed())return;const be=d.compDetails,Re=d.popup===!0,ke=be.newAgStackInstance();return ke.then(me=>{if(!me)return;const ve=me.getGui();fe(me),Re||((E?O:M).current?.appendChild(ve),me.afterGuiAttached?.()),R(me)}),()=>{ke.then(me=>{const ve=me.getGui();e.disableEditorTooltipFeature(),o.destroyBean(me),fe(void 0),R(void 0),ve?.remove()})}},[d]);const ce=g.useCallback(ie=>{if(O.current=ie,!ie||o.isDestroyed()||!e.isAlive()){const ke=q.current;q.current=[];for(const me of ke)me();return}let be;const Re=ke=>{ke&&(ie.insertAdjacentElement("afterbegin",ke.getGui()),q.current.push(()=>{_s(ke.getGui()),o.destroyBean(ke),Q.current===be&&(Q.current=void 0)}))};w&&Re(e.createSelectionCheckbox()),y&&Re(e.createDndSource()),b&&(be=e.createRowDragComp(),Q.current=be,be&&(Re(be),be.refreshVisibility()))},[e,o,y,b,w]),we=g.useCallback(()=>{const ie=!e.isCellSpanning()||D.current,be=M.current;if(!be||!ie||!e||!e.isAlive()||o.isDestroyed()){a.current=o.destroyBean(a.current);return}a.current=o.createBean(new xo);const Re={toggleCss:(me,ve)=>Ce.current.toggleCss(me,ve),setUserStyles:me=>C(me),getFocusableElement:()=>M.current,setIncludeSelection:me=>v(me),setIncludeRowDrag:me=>S(me),setIncludeDndSource:me=>x(me),getCellEditor:()=>N.current??null,getCellRenderer:()=>I.current??V.current,getParentOfValue:()=>L.current??O.current??M.current,setRenderDetails:(me,ve,He)=>{const We=()=>{c(Pe=>Pe?.compDetails!==me||Pe?.value!==ve||Pe?.force!==He?{value:ve,compDetails:me,force:He}:Pe)};if(me?.params?.deferRender&&!e.rowNode.group){const{loadingComp:Pe,onReady:kt}=e.getDeferLoadingCellRenderer();if(Pe){c({value:void 0,compDetails:Pe,force:!1}),kt.then(()=>zI(We));return}}We()},setEditDetails:(me,ve,He,We)=>{if(me){let Pe;me.componentFromFramework&&(We?Pe=new Sk(me.params,()=>p(kt=>kt+1)):nu()),u({compDetails:me,popup:ve,popupPosition:He,compProxy:Pe}),ve||c(void 0)}else e.hasBrowserFocus()&&Re.getFocusableElement().focus({preventScroll:!0}),N.current=void 0,u(void 0)},refreshEditStyles:(me,ve)=>{if(!M.current)return;const{current:He}=Ce;He.toggleCss("ag-cell-value",!Z),He.toggleCss("ag-cell-inline-editing",!!me&&!ve),He.toggleCss("ag-cell-popup-editing",!!me&&!!ve),He.toggleCss("ag-cell-not-inline-editing",!me||!!ve)}},ke=O.current||void 0;e.setComp(Re,be,D.current??void 0,ke,t,s,a.current)},[]),z=g.useCallback(ie=>{M.current=ie,we()},[]),H=g.useCallback(ie=>{D.current=ie,we()},[]),U=g.useMemo(()=>!!(l?.compDetails?.componentFromFramework&&Fo(l.compDetails.componentClass)),[l]);g.useLayoutEffect(()=>{if(!M.current)return;const{current:ie}=Ce;ie.toggleCss("ag-cell-value",!Z),ie.toggleCss("ag-cell-inline-editing",!!d&&!d.popup),ie.toggleCss("ag-cell-popup-editing",!!d&&!!d.popup),ie.toggleCss("ag-cell-not-inline-editing",!d||!!d.popup)});const oe=()=>{const{compDetails:ie,value:be}=l;if(!ie)return be?.toString?.()??be;if(ie.componentFromFramework){const Re=ie.componentClass;return g.createElement(g.Suspense,{fallback:g.createElement(Dk,{cellCtrl:e,parent:M})},U?g.createElement(Re,{...ie.params,key:h}):g.createElement(Re,{...ie.params,key:h,ref:I}))}},he=()=>{const ie=()=>l==null?null:Z?g.createElement("span",{role:"presentation",id:`cell-${r}`,className:j,ref:ee},oe()):oe(),be=Re=>Fk(Re,fe,M.current,e,F);return d!=null?d.popup?g.createElement(g.Fragment,null,ie(),be(d)):be(d):ie()},ye=()=>g.createElement("div",{ref:z,style:f,role:P,"col-id":n},Z?g.createElement("div",{className:"ag-cell-wrapper",role:"presentation",ref:ce},he()):he());return e.isCellSpanning()?g.createElement("div",{ref:H,className:"ag-spanned-cell-wrapper",role:"presentation"},ye()):ye()},Mk=g.memo(Pk),Tk=({rowCtrl:e,containerType:t})=>{const{context:s,gos:i,editSvc:o}=g.useContext(ht),n=g.useContext(pC)==="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),[w,v]=g.useState(()=>e.rowStyles),b=g.useRef(null),[S,y]=g.useState(()=>null),[x,F]=g.useState(),[R,E]=g.useState(()=>c?e.getInitialRowTop(t):void 0),[P,M]=g.useState(()=>c?e.getInitialTransform(t):void 0),D=g.useRef(null),I=g.useRef(),V=g.useRef(),N=g.useRef(!1),[O,q]=g.useState(0);g.useEffect(()=>{if(N.current||!x||O>10)return;const z=D.current?.firstChild;z?(e.setupDetailRowAutoHeight(z),N.current=!0):q(H=>H+1)},[x,O]);const Q=g.useRef();Q.current||(Q.current=new Mn(()=>D.current));const L=g.useRef(()=>{}),re=g.useCallback(z=>(L.current=z,()=>{L.current=()=>{}}),[]),W=WI(re,()=>b.current,[]),ee=n?W:S,Y=g.useCallback(z=>{if(D.current=z,r.current=z?s.createBean(new xo):s.destroyBean(r.current),!z){e.unsetComp(t);return}if(!e.isAlive()||s.isDestroyed())return;const H={setTop:E,setTransform:M,toggleCss:(U,oe)=>Q.current.toggleCss(U,oe),setDomOrder:U=>a.current=U,setRowIndex:u,setRowId:p,setRowBusinessKey:C,setUserStyles:v,setCellCtrls:(U,oe)=>{const he=b.current,ye=la(he,U,a.current);ye!==he&&(b.current=ye,n?L.current():yn(oe,()=>y(ye)))},showFullWidth:U=>{V.current=U.params,F(U)},getFullWidthCellRenderer:()=>I.current,getFullWidthCellRendererParams:()=>V.current,refreshFullWidth:U=>{const oe=U();return V.current=oe,k.current?(F(he=>({...he,params:oe})),!0):!I.current||!I.current.refresh?!1:I.current.refresh(oe)}};e.setComp(H,z,t,r.current)},[]);g.useLayoutEffect(()=>Ln(x,s,D.current,I),[x]);const Z=g.useMemo(()=>{const z={top:R,transform:P};return Object.assign(z,w),z},[R,P,w]),j=l&&x?.componentFromFramework,fe=!l&&ee!=null,Ce=g.useMemo(()=>!!(x?.componentFromFramework&&Fo(x.componentClass)),[x]),k=g.useRef(!1);g.useEffect(()=>{k.current=Ce&&!!x&&!!i.get("reactiveCustomComponents")},[Ce,x]);const ce=()=>ee?.map(z=>g.createElement(Mk,{cellCtrl:z,editingCell:o?.isEditing(z,{withOpenEditor:!0})??!1,printLayout:e.printLayout,key:z.instanceId})),we=()=>{const z=x.componentClass;return Ce?g.createElement(z,{...x.params}):g.createElement(z,{...x.params,ref:I})};return g.createElement("div",{ref:Y,role:"row",style:Z,"row-index":d,"row-id":h,"row-business-key":f},fe?ce():j?we():null)},pg=g.memo(Tk),Ik=({name:e})=>{const{context:t,gos:s}=g.useContext(ht),i=g.useMemo(()=>In(e),[e]),o=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")&&!!i.getSpannedRowCtrls,h=g.useRef([]),p=g.useRef([]),[f,C]=g.useState(()=>[]),w=g.useRef(!1),v=g.useRef(),b=g.useMemo(()=>Nt("ag-viewport",Bf(e)),[e]),S=g.useMemo(()=>Nt(Ir(e)),[e]),y=g.useMemo(()=>Nt("ag-spanning-container",CR(e)),[e]),x=i.type==="center"||u,F=x?o:n;si(" AG Row Container "+e+" ",F);const R=g.useCallback(()=>{const O=!x||o.current!=null,q=n.current!=null,Q=!u||r.current!=null;return O&&q&&Q},[]),E=g.useCallback(()=>o.current==null&&n.current==null&&r.current==null,[]),P=g.useCallback(()=>{if(E()&&(v.current=t.destroyBean(v.current)),!t.isDestroyed()&&R()){const O=L=>{const re=la(l.current,a.current,w.current);re!==l.current&&(l.current=re,yn(L,()=>d(re)))},q=L=>{const re=la(p.current,h.current,w.current);re!==p.current&&(p.current=re,yn(L,()=>C(re)))},Q={setHorizontalScroll:L=>{o.current&&(o.current.scrollLeft=L)},setViewportHeight:L=>{o.current&&(o.current.style.height=L)},setRowCtrls:({rowCtrls:L,useFlushSync:re})=>{const W=!!re&&a.current.length>0&&L.length>0;a.current=L,O(W)},setSpannedRowCtrls:(L,re)=>{const W=!!re&&h.current.length>0&&L.length>0;h.current=L,q(W)},setDomOrder:L=>{w.current!=L&&(w.current=L,O(!1))},setContainerWidth:L=>{n.current&&(n.current.style.width=L)},setOffsetTop:L=>{n.current&&(n.current.style.transform=`translateY(${L})`)}};v.current=t.createBean(new DR(e)),v.current.setComp(Q,n.current,r.current??void 0,o.current)}},[R,E]),M=g.useCallback(O=>{n.current=O,P()},[P]),D=g.useCallback(O=>{r.current=O,P()},[P]),I=g.useCallback(O=>{o.current=O,P()},[P]),V=()=>g.createElement("div",{className:S,ref:M,role:x?"presentation":"rowgroup"},c.map(O=>g.createElement(pg,{rowCtrl:O,containerType:i.type,key:O.instanceId})));if(!x)return V();const N=()=>g.createElement("div",{className:y,ref:D,role:"presentation"},f.map(O=>g.createElement(pg,{rowCtrl:O,containerType:i.type,key:O.instanceId})));return g.createElement("div",{className:b,ref:I,role:"rowgroup"},V(),u?N():null)},kk=g.memo(Ik),Ak=()=>{const e=g.useContext(ht),{context:t,overlays:s}=e,[i,o]=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,w]=g.useState("0px"),[v,b]=g.useState("0px"),[S,y]=g.useState("100%"),[x,F]=g.useState(!0),[R,E]=g.useState(!0),[P,M]=g.useState(null),[D,I]=g.useState(""),[V,N]=g.useState(null),[O,q]=g.useState("ag-layout-normal"),Q=g.useRef();Q.current||(Q.current=new Mn(()=>L.current));const L=g.useRef(null),re=g.useRef(null),W=g.useRef(null),ee=g.useRef(null),Y=g.useRef(null),Z=g.useRef(null),j=g.useRef(null),fe=g.useRef([]),Ce=g.useRef([]);si(" AG Grid Body ",L),si(" AG Pinned Top ",re),si(" AG Sticky Top ",W),si(" AG Middle ",Z),si(" AG Pinned Bottom ",j);const k=g.useCallback(ve=>{if(L.current=ve,!ve||t.isDestroyed()){fe.current=t.destroyBeans(fe.current);for(const G of Ce.current)G();Ce.current=[];return}const He=(G,Se)=>{G.appendChild(Se),Ce.current.push(()=>Se.remove())},We=G=>{const Se=t.createBean(new G);return fe.current.push(Se),Se},Pe=(G,Se,lt)=>{He(G,document.createComment(lt)),He(G,We(Se).getGui())};Pe(ve,LR," AG Fake Horizontal Scroll ");const kt=s?.getOverlayWrapperCompClass();kt&&Pe(ve,kt," AG Overlay Wrapper "),Y.current&&Pe(Y.current,NR," AG Fake Vertical Scroll ");const at={setRowAnimationCssOnBodyViewport:o,setColumnCount:G=>{L.current&&c0(L.current,G)},setRowCount:G=>{L.current&&a0(L.current,G)},setTopHeight:r,setBottomHeight:l,setStickyTopHeight:d,setStickyTopTop:h,setStickyTopWidth:f,setTopInvisible:F,setBottomInvisible:E,setColumnMovingCss:(G,Se)=>Q.current.toggleCss(G,Se),updateLayoutClasses:q,setAlwaysVerticalScrollClass:M,setPinnedTopBottomOverflowY:I,setCellSelectableCss:(G,Se)=>N(Se?G:null),setBodyViewportWidth:G=>{Z.current&&(Z.current.style.width=G)},registerBodyViewportResizeListener:G=>{if(Z.current){const Se=Es(e,Z.current,G);Ce.current.push(()=>Se())}},setStickyBottomHeight:w,setStickyBottomBottom:b,setStickyBottomWidth:y,setGridRootRole:G=>ve.setAttribute("role",G)},ds=t.createBean(new IR);fe.current.push(ds),ds.setComp(at,ve,Z.current,re.current,j.current,W.current,ee.current)},[]),ce=g.useMemo(()=>Nt("ag-root","ag-unselectable",O),[O]),we=g.useMemo(()=>Nt("ag-body-viewport",i,O,P,V),[i,O,P,V]),z=g.useMemo(()=>Nt("ag-body",O),[O]),H=g.useMemo(()=>Nt("ag-floating-top",x?"ag-invisible":null,V),[V,x]),U=g.useMemo(()=>Nt("ag-sticky-top",V),[V]),oe=g.useMemo(()=>Nt("ag-sticky-bottom",C==="0px"?"ag-invisible":null,V),[V,C]),he=g.useMemo(()=>Nt("ag-floating-bottom",R?"ag-invisible":null,V),[V,R]),ye=g.useMemo(()=>({height:n,minHeight:n,overflowY:D}),[n,D]),ie=g.useMemo(()=>({height:c,top:u,width:p}),[c,u,p]),be=g.useMemo(()=>({height:C,bottom:v,width:S}),[C,v,S]),Re=g.useMemo(()=>({height:a,minHeight:a,overflowY:D}),[a,D]),ke=ve=>g.createElement(kk,{name:ve,key:`${ve}-container`}),me=({section:ve,children:He,className:We,style:Pe})=>g.createElement("div",{ref:ve,className:We,role:"presentation",style:Pe},He.map(ke));return g.createElement("div",{ref:k,className:ce},g.createElement(wk,null),me({section:re,className:H,style:ye,children:["topLeft","topCenter","topRight","topFullWidth"]}),g.createElement("div",{className:z,ref:Y,role:"presentation"},me({section:Z,className:we,children:["left","center","right","fullWidth"]})),me({section:W,className:U,style:ie,children:["stickyTopLeft","stickyTopCenter","stickyTopRight","stickyTopFullWidth"]}),me({section:ee,className:oe,style:be,children:["stickyBottomLeft","stickyBottomCenter","stickyBottomRight","stickyBottomFullWidth"]}),me({section:j,className:he,style:Re,children:["bottomLeft","bottomCenter","bottomRight","bottomFullWidth"]}))},Lk=g.memo(Ak),Ok=(e,t)=>{const{children:s,eFocusableElement:i,onTabKeyDown:o,gridCtrl:n,forceFocusOutWhenTabGuardsAreEmpty:r,isEmpty:a}=e,{context:l}=g.useContext(ht),c=g.useRef(null),d=g.useRef(null),u=g.useRef(),h=v=>{const b=v==null?void 0:parseInt(v,10).toString();for(const S of[c,d])b===void 0?S.current?.removeAttribute("tabindex"):S.current?.setAttribute("tabindex",b)};g.useImperativeHandle(t,()=>({forceFocusOutOfContainer(v){u.current?.forceFocusOutOfContainer(v)}}));const p=g.useCallback(()=>{const v=c.current,b=d.current;if(!v&&!b||l.isDestroyed()){u.current=l.destroyBean(u.current);return}if(v&&b){const S={setTabIndex:h};u.current=l.createBean(new Xf({comp:S,eTopGuard:v,eBottomGuard:b,eFocusableElement:i,onTabKeyDown:o,forceFocusOutWhenTabGuardsAreEmpty:r,focusInnerElement:y=>n.focusInnerElement(y),isEmpty:a}))}},[]),f=g.useCallback(v=>{c.current=v,p()},[p]),C=g.useCallback(v=>{d.current=v,p()},[p]),w=v=>{const b=v==="top"?oo.TAB_GUARD_TOP:oo.TAB_GUARD_BOTTOM;return g.createElement("div",{className:`${oo.TAB_GUARD} ${b}`,role:"presentation",ref:v==="top"?f:C})};return g.createElement(g.Fragment,null,w("top"),s,w("bottom"))},Nk=g.forwardRef(Ok),Hk=g.memo(Nk),Gk=({context:e})=>{const[t,s]=g.useState(""),[i,o]=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(),[w,v]=g.useState(null),b=g.useRef(()=>{}),S=g.useRef(),y=g.useRef([]),x=g.useCallback(()=>{},[]);si(" AG Grid ",f);const F=g.useCallback(I=>{if(f.current=I,p.current=I?e.createBean(new A2):e.destroyBean(p.current),!I||e.isDestroyed())return;const V=p.current;b.current=V.focusInnerElement.bind(V);const N={destroyGridUi:()=>{},setRtlClass:s,forceFocusOutOfContainer:O=>{if(!O&&S.current?.isDisplayed()){S.current.forceFocusOutOfContainer(O);return}C.current?.forceFocusOutOfContainer(O)},updateLayoutClasses:o,getFocusableContainers:()=>{const O=[],q=f.current?.querySelector(".ag-root");q&&O.push({getGui:()=>q});for(const Q of y.current)Q.isDisplayed()&&O.push(Q);return O},setCursor:r,setUserSelect:l};V.setComp(N,I,I),d(!0)},[]);g.useEffect(()=>{const I=p.current,V=f.current;if(!u||!I||!w||!V||e.isDestroyed())return;const N=[],{watermarkSelector:O,paginationSelector:q,sideBarSelector:Q,statusBarSelector:L,gridHeaderDropZonesSelector:re}=I.getOptionalSelectors(),W=[];if(re){const Y=e.createBean(new re.component),Z=Y.getGui();V.insertAdjacentElement("afterbegin",Z),W.push(Z),N.push(Y)}if(Q){const Y=e.createBean(new Q.component),Z=Y.getGui(),j=w.querySelector(".ag-tab-guard-bottom");j&&(j.insertAdjacentElement("beforebegin",Z),W.push(Z)),N.push(Y),y.current.push(Y)}const ee=Y=>{const Z=e.createBean(new Y),j=Z.getGui();return V.insertAdjacentElement("beforeend",j),W.push(j),N.push(Z),Z};if(L&&ee(L.component),q){const Y=ee(q.component);S.current=Y,y.current.push(Y)}return O&&ee(O.component),()=>{e.destroyBeans(N);for(const Y of W)Y.remove()}},[u,w,e]);const R=g.useMemo(()=>Nt("ag-root-wrapper",t,i),[t,i]),E=g.useMemo(()=>Nt("ag-root-wrapper-body","ag-focus-managed",i),[i]),P=g.useMemo(()=>({userSelect:a??"",WebkitUserSelect:a??"",cursor:n??""}),[a,n]),M=g.useCallback(I=>{C.current=I,h(I!==null)},[]),D=g.useCallback(()=>!p.current?.isFocusable(),[]);return g.createElement("div",{ref:F,className:R,style:P,role:"presentation"},g.createElement("div",{className:E,ref:v,role:"presentation"},c&&w&&!e.isDestroyed()&&g.createElement(ht.Provider,{value:e.getBeans()},g.createElement(Hk,{ref:M,eFocusableElement:w,onTabKeyDown:x,gridCtrl:p.current,forceFocusOutWhenTabGuardsAreEmpty:!0,isEmpty:D},g.createElement(Lk,null)))))},Bk=g.memo(Gk),Vk=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))}},SC={setGridApi:void 0,maxComponentCreationTimeMs:void 0,children:void 0},zk={gridOptions:void 0,modules:void 0,containerStyle:void 0,className:void 0,passGridApi:void 0,componentWrappingElement:void 0,...SC},yC=new Set(Object.keys(zk)),Wk=new Set(Object.keys(SC)),xC=e=>{const t=g.useRef(),s=g.useRef(null),i=g.useRef(null),o=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(v=>{if(s.current=v,!v){for(const D of o.current)D();o.current.length=0;return}const b=e.modules||[];i.current||(i.current=new ak(()=>h(D=>D+1),e.componentWrappingElement,e.maxComponentCreationTimeMs),o.current.push(()=>{i.current?.destroy(),i.current=null}));const S=dS(e.gridOptions,e,Object.keys(e).filter(D=>!yC.has(D))),y=()=>{if(c.current){const D=()=>a.current?.shouldQueueUpdates()?void 0:n.current.shift();let I=D();for(;I;)I(),I=D()}},x=new $k(y);a.current=x;const F=new Vk,R={providedBeanInstances:{frameworkCompWrapper:new jk(i.current,S),renderStatus:F},modules:b,frameworkOverrides:x,setThemeOnGridDiv:!0},E=D=>{u(D),D.createBean(F),o.current.push(()=>{D.destroy()}),D.getBean("ctrlsSvc").whenReady({addDestroyFunc:I=>{o.current.push(I)}},()=>{if(D.isDestroyed())return;const I=t.current;I&&e.passGridApi?.(I)})},P=D=>{D.getBean("ctrlsSvc").whenReady({addDestroyFunc:I=>{o.current.push(I)}},()=>{for(const I of n.current)I();n.current.length=0,c.current=!0})},M=new r5;S.gridId??(S.gridId=l.current),t.current=M.create(v,S,E,P,R),o.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(v=>{c.current&&!a.current?.shouldQueueUpdates()?v():n.current.push(v)},[]);g.useEffect(()=>{const v=_k(r.current,e);r.current=e,C(()=>{t.current&&uS(v,t.current)})},[e]);const w=!g.useSyncExternalStore||Er(e,"renderingMode")==="legacy"?"legacy":"default";return g.createElement("div",{style:f,className:e.className,ref:p},g.createElement(pC.Provider,{value:w},d&&!d.isDestroyed()?g.createElement(Bk,{key:d.instanceId,context:d}):null,i.current?.getPortals()??null))};function _k(e,t){const s={};for(const i of Object.keys(t)){if(yC.has(i)){Wk.has(i)&&B(274,{prop:i});continue}const o=t[i];e[i]!==o&&(s[i]=o)}return s}var jk=class extends u5{constructor(e,t){super(),this.parent=e,this.gridOptions=t}createWrapper(e,t){const s=this.gridOptions;if(Er(s,"reactiveCustomComponents")){const r=(a=>{switch(a){case"filter":return Er(s,"enableFilterHandlers")?ZI:YI;case"floatingFilterComponent":return Er(s,"enableFilterHandlers")?JI:QI;case"dateComponent":return KI;case"dragAndDropImageComponent":return qI;case"loadingOverlayComponent":return tk;case"noRowsOverlayComponent":return ik;case"statusPanel":return ok;case"toolPanel":return nk;case"menuItem":return sk;case"cellRenderer":return $I;case"innerHeaderComponent":return ek}})(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":nu();break}const o=!t.cellRenderer&&t.name!=="toolPanel";return new vC(e,this.parent,t,o)}},Uk=g.forwardRef((e,t)=>{const s=g.useContext(ht),{registry:i,context:o,gos:n,rowModel:r}=s,[a,l]=g.useState(()=>new zt),[c,d]=g.useState(()=>new zt),[u,h]=g.useState(),[p,f]=g.useState(),C=g.useRef(),w=g.useRef(null),v=g.useRef(),b=g.useMemo(()=>z0(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&&B(230);const x=g.useCallback(R=>{if(w.current=R,!R||o.isDestroyed()){C.current=o.destroyBean(C.current),v.current?.();return}const E={toggleCss:(M,D)=>l(I=>I.setClass(M,D)),toggleDetailGridCss:(M,D)=>d(I=>I.setClass(M,D)),setDetailGrid:M=>h(M),setRowData:M=>f(M),getGui:()=>w.current},P=i.createDynamicBean("detailCellRendererCtrl",!0);if(P&&(o.createBean(P),P.init(E,e),C.current=P,n.get("detailRowAutoHeight"))){const M=()=>{if(w.current==null)return;const D=w.current.clientHeight;D!=null&&D>0&&setTimeout(()=>{e.node.setRowHeight(D),($e(n)||Di(n))&&r.onRowHeightChanged()},0)};v.current=Es(s,R,M),M()}},[]),F=g.useCallback(R=>{C.current?.registerDetailWithMaster(R)},[]);return g.createElement("div",{className:S,ref:x},u&&g.createElement(xC,{className:y,...u,modules:b,rowData:p,passGridApi:F}))}),$k=class extends Qf{constructor(e){super("react"),this.processQueuedUpdates=e,this.queueUpdates=!1,this.renderingEngine="react",this.frameworkComponents={agGroupCellRenderer:dg,agGroupRowRenderer:dg,agDetailCellRenderer:Uk},this.wrapIncoming=(t,s)=>s==="ensureVisible"?VI(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 BI()}},Kk=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(xC,{...this.props,passGridApi:this.setGridApi})}},RC=(e=>(e.Dropdown="dropdown",e.Menu="menu",e))(RC||{}),Ft=(e=>(e.Click="click",e.Hover="hover",e.ContextMenu="contextMenu",e))(Ft||{}),Co=(e=>(e.Item="item",e.Divider="divider",e.PlainText="plainText",e))(Co||{});const qk=X("flex items-center gap-2 align-middle","h-auto px-0 bg-transparent border-0"),Yk=X("z-[53] overflow-auto rounded bg-layer-0 text-primary shadow focus-visible:outline-none"),Zk=X("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",Qk="text-error",Jk="my-1 border-t border-hover border-secondary",Vo=4,ru=({ariaLabel:e,className:t,size:s=24,onClose:i,...o})=>m.jsx(xt,{"aria-label":e,className:ne("text-secondary hover:enabled:text-accent-primary",t),onClick:i,iconBefore:m.jsx(_.IconX,{size:s}),...o}),yt=({children:e,menu:t,renderOverlay:s,trigger:i=[Ft.Click],placement:o,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:w=!1,matchReferenceWidth:v=!0,maxDropdownHeight:b})=>{const[S,y]=g.useState(a),x=r!==void 0,F=x?!!r:S,R=g.useRef(null),E=g.useCallback(k=>{x||y(k),l?.(k)},[x,l]),P=g.useId(),M=o===void 0,D=k=>"clientWidth"in k?k.clientWidth:k.getBoundingClientRect?.()?.width??0,{refs:I,floatingStyles:V,context:N}=Ee.useFloating({placement:o,open:F,onOpenChange:E,whileElementsMounted:Ee.autoUpdate,middleware:[Ee.offset({mainAxis:Vo,crossAxis:0}),M?Ee.autoPlacement({alignment:"start",crossAxis:!0,padding:Vo,allowedPlacements:C}):Ee.flip({padding:Vo}),Ee.shift({padding:Vo}),Ee.size({padding:Vo,apply({availableWidth:k,availableHeight:ce,elements:we}){const z=we.floating,H=D(we.reference);z.style.setProperty("--fui-available-height",`${Math.floor(ce)}px`),z.style.setProperty("--reference-width",v?`${Math.round(H)}px`:"0px"),v?z.style.minWidth=`${Math.round(H)}px`:z.style.removeProperty("min-width"),z.style.maxWidth=`${Math.floor(k)}px`;const U=Math.floor(ce);z.style.maxHeight=`${b?Math.min(U,b):U}px`}})]}),O=Ee.useClick(N,{enabled:i.includes(Ft.Click)&&!n}),q=Ee.useHover(N,{enabled:i.includes(Ft.Hover)&&!n,move:!1,restMs:40,delay:{open:80,close:80}}),Q=Ee.useDismiss(N,{bubbles:!0,referencePress:!1,outsidePress:k=>{if(!f)return!1;const ce=k.target;return!(p?.current&&ce instanceof Node&&p.current.contains(ce))}}),L=Ee.useRole(N,{role:"menu"}),{getReferenceProps:re,getFloatingProps:W}=Ee.useInteractions([O,q,Q,L]),ee=g.useCallback((k,ce)=>{I.setPositionReference({getBoundingClientRect:()=>({width:0,height:0,x:k,y:ce,top:ce,left:k,right:k,bottom:ce})})},[I]),Y=g.useCallback(k=>{!i.includes(Ft.ContextMenu)||n||(k.preventDefault(),w&&(ee(k.clientX,k.clientY),R.current=document.elementFromPoint(k.clientX,k.clientY)),E(!0))},[w,n,E,ee,i]),Z=g.useCallback(k=>{!w||n||(i.includes(Ft.ContextMenu)&&F&&E(!1),ee(k.clientX,k.clientY),R.current=document.elementFromPoint(k.clientX,k.clientY))},[w,n,ee,F,i,E]);g.useEffect(()=>{n&&F&&E(!1)},[n,F,E]);const j=g.useCallback(k=>ce=>{k.disabled||(k.onClick?.({key:k.key,domEvent:ce}),t?.onClick?.({key:k.key,domEvent:ce}),E(!1))},[t,E]),fe=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(k=>k.type===Co.Divider?m.jsx("div",{role:"separator",className:Jk},k.key):k.type===Co.PlainText?m.jsx("div",{className:ne("px-3 py-2 text-secondary dial-caption",k.className),children:k.label},k.key):m.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!k.disabled,className:X(Zk,k.disabled&&Xk,k.danger&&Qk,k.className),disabled:k.disabled,onClick:j(k),children:[k.icon&&m.jsx("span",{className:X(k.danger&&"text-error",k.disabled&&"text-secondary"),children:m.jsx(Ne,{icon:k.icon})}),m.jsx("span",{className:X("flex-1 truncate text-left",k.danger&&"text-error",k.disabled&&"text-secondary"),"aria-labelledby":"item-text",children:k.label})]},k.key))}),t.footer&&m.jsx(m.Fragment,{children:typeof t.footer=="function"?t.footer():t.footer})]}):null,[j,t,s]),Ce=re({onContextMenu:Y,onMouseDown:Z});return g.useEffect(()=>{if(!F)return;const k=I.reference.current;let ce=null;if(k instanceof Element?ce=k:R.current instanceof Element&&(ce=R.current),!ce)return;const we=new IntersectionObserver(([z])=>{z.isIntersecting||E(!1)},{root:null,threshold:0});return we.observe(ce),()=>we.disconnect()},[F,I.reference,E]),m.jsxs(m.Fragment,{children:[m.jsx("span",{ref:I.setReference,className:X(qk,n&&"!cursor-not-allowed opacity-75",u),"aria-haspopup":"menu","aria-expanded":F,"aria-controls":P,...Ce,children:e}),F&&m.jsx(Ee.FloatingPortal,{children:m.jsx(Ee.FloatingFocusManager,{context:N,modal:!1,initialFocus:-1,returnFocus:!0,children:m.jsxs("div",{id:P,ref:I.setFloating,style:V,className:X(Yk,!v&&"w-max",h),...W(),children:[c&&m.jsx("div",{className:"flex items-center justify-between px-2 pt-2",children:m.jsx(ru,{ariaLabel:"Close dropdown",onClose:k=>{d?.(k),E(!1)}})}),fe]})})})]})},e8="h-full",ic={accentColor:"var(--controls-bg-accent, #5C8DEA)",backgroundColor:"var(--bg-layer-3, #222932)",oddRowBackgroundColor:"var(--bg-layer-4, #333942)",selectedRowBackgroundColor:"var(--bg-accent-primary-alpha, #74A4FF26)",borderColor:"var(--bg-layer-4, #333942)",rowBorder:"1px solid var(--stroke-tertiary, #090D13)",rowHoverColor:"var(--bg-accent-primary-alpha, #74A4FF26)",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))"}},oc=40,t8=(e,t,s,i,o)=>{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:o?1:-1:o?-1:1},s8=({selectedRowIds:e,selectedRows:t,onSelectionChange:s,onSelectionChangeWithMap:i,rowData:o=[],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(v=>r?.has(n(v))??!1,[r,n]),h=g.useMemo(()=>o.filter(v=>!u(v)),[o,u]),p=e!==void 0||t!==void 0;g.useEffect(()=>{if(e!==void 0&&!t){const v=new Map;o.forEach(S=>{const y=n(S);e.has(y)&&!r?.has(y)&&v.set(y,S)}),(v.size!==a.size||Array.from(v.keys()).some(S=>!a.has(S)))&&l(v)}},[e,t,o,n,r,a]);const f=g.useCallback((v,b,S)=>{const y=n(v);if(r?.has(y))return;const x=S?new Map:new Map(c);b?x.set(y,v):x.delete(y),p||l(x),i?.(x),s&&s(new Set(x.keys()),Array.from(x.values()))},[c,n,r,p,s,i]),C=g.useMemo(()=>{if(!h.length)return"unchecked";const v=h.map(n),b=v.filter(S=>d.has(S)).length;return b===0?"unchecked":b===v.length?"checked":"indeterminate"},[h,d,n]),w=g.useCallback(v=>{const b=new Map;if(v&&h.forEach(S=>{const y=n(S);b.set(y,S)}),p||l(b),i&&i(b),s){const S=new Set(b.keys()),y=Array.from(b.values());s(S,y)}},[h,n,p,s,i]);return{currentSelectedIds:d,currentSelectedRows:c,handleSelectionToggle:f,headerCheckboxState:C,handleHeaderCheckboxChange:w}};var Yi=(e=>(e.CHECKBOX="CHECKBOX",e.RADIO_BUTTON="RADIO_BUTTON",e))(Yi||{});j0.registerModules([GI]);const au=({columnDefs:e,rowData:t,additionalGridOptions:s,getContextMenuItems:i,className:o,ariaLabel:n="Data grid",withSelectionColumn:r=!0,wrapCustomCellRenderers:a=!0,disabledRowIds:l,selectedRowIds:c,selectedRows:d,selectionOnHover:u=!0,onSelectionChange:h,onSelectionChangeWithMap:p,onGridApiChange:f,getRowId:C=P=>String(P.id||JSON.stringify(P)),alternateOddRowColors:w=!1,filterPlaceholder:v="Enter value",emptyStateIcon:b,emptyStateTitle:S="No results found",emptyStateDescription:y="Sorry, we couldn't find any results for your search.",loading:x=!1,wrapperBorder:F=!0,withoutHeaderBorders:R=!1,selectionMode:E=Yi.CHECKBOX})=>{const[P,M]=g.useState(oc),[D,I]=g.useState(),V=g.useId(),{currentSelectedIds:N,handleSelectionToggle:O,headerCheckboxState:q,handleHeaderCheckboxChange:Q}=s8({selectedRowIds:c,selectedRows:d,onSelectionChange:h,onSelectionChangeWithMap:p,rowData:t,getRowId:C,disabledRowIds:l}),L=g.useMemo(()=>({...ic,oddRowBackgroundColor:w?ic.oddRowBackgroundColor:ic.backgroundColor,wrapperBorder:F}),[w,F]),re=g.useCallback(z=>{z.api.sizeColumnsToFit(),M(oc)},[]),W=g.useCallback(z=>{if(!z.data)return"";const H=C(z.data);return X({"ag-row-selected":N.has(H),"opacity-50":l?.has(H)})},[N,l,C]),ee=g.useCallback(()=>{if(E!==Yi.CHECKBOX)return null;const z=q==="checked",H=q==="indeterminate",U="header-select-all",oe=t?.some(he=>!l?.has(C(he)))??!1;return m.jsx("div",{className:"flex items-center justify-center h-full header-checkbox-container",children:m.jsx(rn,{id:U,ariaLabel:"Select all rows",checked:z,disabled:!oe,"aria-disabled":!oe,indeterminate:H,className:X(`dial-header-select ${q}`,!u&&"dial-header-select-visible"),onChange:Q})})},[q,t,u,Q,l,C,E]),Y=g.useCallback(z=>{if(z.data){const H=C(z.data),U=l?.has(H),oe=z.value==null?"":String(z.value),he=i?.(z.data)??[];return m.jsx(yt,{trigger:[Ft.ContextMenu],menu:{items:he},anchorToMouse:!0,matchReferenceWidth:!0,className:"w-full",disabled:U,children:m.jsx("span",{className:"block min-w-0 h-full max-w-full",children:m.jsx(ot,{text:oe,className:"max-w-full h-full"})})})}},[i,l,C]),Z=g.useCallback(z=>{if(!z.data)return null;const H=C(z.data),U=N.has(H),oe=l?.has(H),he=`row-select-${H}`;return E===Yi.RADIO_BUTTON?m.jsx("div",{className:"h-6 w-6 flex items-center justify-center",children:m.jsx(nd,{className:"w-[18px] h-[18px]",inputId:he,checked:U,disabled:oe,name:"gridradiobutton",value:"selected",onChange:()=>{oe||!z.data||O(z.data,!0,!0)}})}):m.jsx("div",{className:"flex items-center justify-center size-full",children:m.jsx(rn,{id:he,ariaLabel:"Select row",checked:U,disabled:oe,"aria-disabled":oe,className:X("dial-row-select",!u&&"dial-row-select-visible",oe&&"opacity-50 cursor-not-allowed"),onChange:ye=>{oe||!z.data||O(z.data,!!ye)}},`${H}-${U}`)})},[N,l,C,O,u,E]),j=g.useCallback(z=>{const H=typeof a=="function"?a(z):!!a;if(!z.cellRenderer)return{...z,cellRenderer:Y};if(!H)return z;const U=z.cellRenderer;return{...z,cellRenderer:he=>{const ye=he.data?i?.(he.data)??[]:[];let ie=null;if(typeof U=="function"){const ke=U;ie=m.jsx(ke,{...he})}else ie=Y(he);const be=he.data?C(he.data):null,Re=be?l?.has(be):!1;return m.jsx(yt,{trigger:[Ft.ContextMenu],menu:{items:ye},anchorToMouse:!0,matchReferenceWidth:!0,className:"w-full h-full",disabled:Re,children:m.jsx("span",{className:"block min-w-0 max-w-full flex-1",children:ie})})}}},[l,i,C,Y,a]),fe=g.useMemo(()=>({colId:"__select",headerName:"",width:44,minWidth:44,suppressSizeToFit:!0,lockPosition:!0,sortable:!1,resizable:!1,filter:!1,floatingFilter:!1,cellRenderer:Z,headerComponent:E===Yi.CHECKBOX?ee:void 0}),[Z,ee,E]),Ce=g.useMemo(()=>{const z=(e??[]).map(j);return r?[fe,...z]:z},[e,fe,r,j]),k=g.useMemo(()=>({minWidth:150,resizable:!0,sortable:!0,floatingFilter:!0,filter:"agTextColumnFilter",filterParams:{filterPlaceholder:v,buttons:["reset"]},comparator:t8.bind(void 0)}),[v]),ce=z=>{const H=Ce.map(U=>({...U,sort:void 0}));z.api.updateGridOptions({columnDefs:H,rowData:t}),z.api.sizeColumnsToFit(),I(z.api),s?.onGridReady?.(z),f?.(z.api)};g.useEffect(()=>{D&&D.redrawRows()},[D,N]);const we=g.useCallback(()=>m.jsx(En,{title:S,description:y,containerClassName:"gap-3",titleClassName:"mt-2 !text-lg",icon:b||m.jsx(_.IconZoomCancel,{size:100,stroke:.5,className:"text-secondary"})}),[S,y,b]);return m.jsx("div",{className:X(e8,o,r&&"with-selection-column",R&&"dial-without-header-borders"),"aria-label":n,role:"region","aria-busy":x,children:m.jsx("div",{className:"ag-theme-balham-dark h-full overflow-x-auto",role:"table","aria-describedby":V,children:m.jsx(Kk,{rowModelType:"clientSide",headerHeight:oc,rowHeight:P,cellSelection:!1,getRowClass:W,theme:H3.withPart(m3).withParams({...L}),autoSizeStrategy:{type:"fitGridWidth"},columnDefs:Ce,defaultColDef:k,onGridSizeChanged:re,onGridReady:ce,loading:x,suppressCellFocus:!0,suppressDragLeaveHidesColumns:!0,noRowsOverlayComponent:we,rowData:t,...s})})})};var ca=(e=>(e.Horizontal="horizontal",e.Vertical="vertical",e))(ca||{}),da=(e=>(e.Mobile="mobile",e.Tablet="tablet",e))(da||{});const vr=({tab:e,active:t,invalid:s,className:i,horizontal:o,onClick:n})=>{const r=ne("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":o,"border-l-2 px-3":!o}),a=ne(r,{"bg-layer-4":o,"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&&o&&!e.disabled,"border-l-accent-primary":t&&!o&&!e.disabled},i);return m.jsxs("button",{role:"tab",className:a,onClick:()=>n(e.id),disabled:e.disabled,children:[m.jsx(ot,{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(_.IconExclamationCircle,{...se})})]})},fg=12;var Vs=(e=>(e.Undefined="undefined",e.Mobile="mobile",e.Tablet="tablet",e.Desktop="desktop",e))(Vs||{});const mg=()=>typeof window<"u"&&window.innerWidth<640,nc=()=>{if(typeof window>"u")return Vs.Undefined;const e=window.innerWidth;return e>=1024?Vs.Desktop:e<640?Vs.Mobile:Vs.Tablet},i8=()=>{const[e,t]=g.useState(()=>typeof window>"u"?Vs.Desktop:nc());return g.useEffect(()=>{t(nc());const s=()=>t(nc());return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),e},FC=({tabs:e,activeTab:t,onClick:s,orientation:i=ca.Horizontal,screenThreshold:o=da.Tablet,smallScreenContainerClassName:n,smallScreenDropdownItemClassName:r,desktopDropdownClassName:a,desktopTabClassName:l})=>{const[c,d]=g.useState(!1),[u,h]=g.useState(!1),[p,f]=g.useState(!1),C=i8(),w=C===Vs.Mobile||o===da.Tablet&&C===Vs.Tablet,v=i===ca.Horizontal,b=g.useRef(null),S=g.useRef(null),y=g.useRef(null),x=e.find(E=>E.id===t),F=g.useMemo(()=>X("flex gap-2",v?"flex-row flex-nowrap overflow-x-auto":"flex-col flex-wrap w-full"),[v]),R=g.useCallback(()=>{const E=S.current;E&&f(E.scrollWidth>E.clientWidth)},[]);return g.useEffect(()=>{R();const E=new ResizeObserver(()=>R()),P=S.current;return P&&E.observe(P),()=>E.disconnect()},[e,R]),g.useEffect(()=>{const E=y.current,P=S.current;if(!E||!P)return;const M=E.offsetLeft,D=M+E.offsetWidth,I=P.scrollLeft,V=I+P.clientWidth;M<I?P.scrollTo({left:M-fg,behavior:"smooth"}):D>V&&P.scrollTo({left:D-P.clientWidth+fg,behavior:"smooth"})},[t]),w?m.jsx("div",{role:"tablist",className:ne("h-11 flex items-center bg-layer-3 px-4",n),children:m.jsx(yt,{trigger:[Ft.Click],open:c,onOpenChange:d,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],renderOverlay:()=>e.map(E=>m.jsx(vr,{tab:E,active:E.id===t,onClick:P=>{s(P),d(!1)},className:ne("w-full rounded-none h-11 items-center px-6",r)},E.id)),children:m.jsxs("div",{className:"flex gap-2 items-center h-11 cursor-pointer",children:[m.jsx(vr,{tab:x,active:!0,onClick:s,className:"rounded-none bg-transparent border-l-0 border-b-0 h-full items-center px-0"},t),m.jsx(Ne,{icon:m.jsx(_.IconChevronDown,{size:16}),className:X("text-primary transition-transform",c&&"rotate-180")})]})})}):m.jsxs("div",{ref:b,className:"flex w-full items-start",children:[m.jsx("div",{ref:S,role:"tablist",className:F,children:e.map(E=>m.jsx("div",{ref:t===E.id?y:void 0,className:"w-full",children:m.jsx(vr,{tab:E,active:t===E.id,onClick:s,horizontal:v,className:ne("w-full",l)})},E.id))}),p&&m.jsx("div",{className:"flex items-center ml-2",children:m.jsx(yt,{trigger:[Ft.Click],open:u,onOpenChange:h,placement:"bottom-end",renderOverlay:()=>e.map(E=>m.jsx(vr,{tab:E,active:E.id===t,onClick:P=>{s(P),h(!1)},className:"w-full rounded-none h-8 items-center px-3 py-2"},E.id)),children:m.jsx(xt,{iconBefore:m.jsx(_.IconDotsVertical,{size:18}),className:ne("w-8 h-8 flex items-center justify-center rounded border",u?"bg-layer-4 border-transparent":"border-primary",a)})})})]})},o8="w-full overflow-hidden",n8="flex flex-nowrap items-center gap-2 min-w-0 px-0 py-0 whitespace-nowrap",EC="flex items-center gap-2 min-w-0 shrink-0 dial-small",r8="max-w-[20%] basis-[20%] flex-none",a8="flex-1 min-w-0",Cg="inline-flex items-center gap-1 min-w-0 transition-colors",l8="text-secondary hover:text-accent-primary",c8="text-primary cursor-default",DC="flex-none inline-flex items-center leading-none text-secondary",d8="items-center gap-1 min-w-0 transition-colors text-secondary hover:text-accent-primary",PC=m.jsx(_.IconChevronRight,{size:16,"aria-hidden":"true"}),Uo=({label:e,href:t,onClick:s,disabled:i,isLast:o,separator:n=PC,className:r,iconBefore:a,labelClassName:l,onBeforeNavigate:c,...d})=>{const u=async w=>{if(c&&!o&&!await c()){w.preventDefault();return}s&&s(w)},h=ne(EC,o?a8:r8,r),p=(!!t||!!s)&&!o&&!i,f=p?ne(Cg,l8):ne(Cg,c8,i?"pointer-events-none opacity-75":""),C=typeof e=="string"?m.jsx(ot,{className:ne("cursor-pointer",l),text:e,id:"breadcrumb-item-content"}):m.jsx("span",{className:ne("flex-1 min-w-0 max-w-full truncate cursor-pointer",l),"aria-label":"breadcrumb-item-content",children:e});return m.jsxs("li",{...d,className:h,"aria-label":d["aria-label"]||"breadcrumb-item",children:[p?m.jsxs("a",{href:t,onClick:u,className:f,children:[a,C]}):m.jsxs("span",{className:f,"aria-current":o?"page":void 0,"aria-disabled":i?"true":void 0,children:[a,C]}),!o&&m.jsx("span",{className:DC,"aria-label":"separator",children:n})]})},MC=({pathItems:e,separator:t=PC,ariaLabel:s="Breadcrumb",className:i,children:o,labelClassName:n,onBeforeNavigate:r})=>{const a=g.useMemo(()=>e?.length?e:g.Children.toArray(o).filter(g.isValidElement).map(d=>{const u=d.props,{labelClassName:h,isLast:p,separator:f,...C}=u;return C}),[e,o]),l=g.useCallback(async d=>{const u=parseInt(d.key,10),h=a[u];if(r&&!await r()){d.domEvent.preventDefault();return}h.onClick?h.onClick(d.domEvent):h.href&&(window.location.href=h.href)},[a,r]),c=g.useMemo(()=>{if(a.length===0)return null;if(a.length<=3)return a.map((C,w)=>g.createElement(Uo,{...C,key:`item-${w}`,isLast:w===a.length-1,separator:t,labelClassName:n,onBeforeNavigate:r}));const d=a.at(0),u=a.slice(1,-2),h=a.at(-2),p=a.at(-1);if(!d||!h||!p)return null;const f=u.map((C,w)=>({key:String(w+1),label:typeof C.label=="string"?C.label:`Item ${w+1}`,disabled:C.disabled}));return m.jsxs(m.Fragment,{children:[g.createElement(Uo,{...d,key:"item-0",separator:t,labelClassName:n,onBeforeNavigate:r}),m.jsxs("li",{className:ne(EC),children:[m.jsx(yt,{menu:{items:f,onClick:l},placement:"bottom-start",matchReferenceWidth:!1,children:m.jsx("button",{type:"button","aria-label":"More breadcrumbs",className:d8,children:m.jsx(_.IconDots,{size:16})})}),m.jsx("span",{className:DC,children:t})]}),g.createElement(Uo,{...h,key:`item-${a.length-2}`,separator:t,labelClassName:n,onBeforeNavigate:r}),g.createElement(Uo,{...p,key:`item-${a.length-1}`,isLast:!0,separator:t,labelClassName:n,onBeforeNavigate:r})]})},[a,t,n,l,r]);return m.jsx("nav",{"aria-label":s,className:ne(o8,i),children:m.jsx("ol",{className:n8,children:c})})},lu=(e,t)=>({appearance:i,...o})=>m.jsx(xt,{...o,variant:e,appearance:i||t}),TC=(e,t)=>({variant:i,...o})=>m.jsx(xt,{...o,variant:i||t,appearance:e}),Kt=lu(qe.Primary,Me.Solid),Rs=lu(qe.Neutral,Me.Outlined),IC=lu(qe.Error,Me.Outlined),u8=TC(Me.Link,qe.Primary),h8=TC(Me.Ghost,qe.Primary),kC=({iconClassName:e,...t})=>m.jsx(IC,{...t,appearance:Me.Ghost,iconBefore:m.jsx(_.IconTrashX,{...se,className:e||""})}),AC=({value:e,textareaId:t,placeholder:s,className:i="",containerClassName:o="",disabled:n,invalid:r,readonly:a,disableTooltip:l,onChange:c})=>m.jsx(_t,{tooltip:l?null:e,triggerClassName:ne("flex",o),children:m.jsx("textarea",{id:t,placeholder:s,value:e||"",disabled:n,className:X("dial-textarea dial-input px-3 py-2",r&&"dial-input-error",n&&"dial-input-disable",a&&"dial-input-readonly",i),onChange:d=>!a&&c?.(d.currentTarget.value)})}),g8=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],p8=(e,t,s,i)=>{if((t==="number"||s!==void 0||i!==void 0)&&!g8.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||i!==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(i!==void 0&&l>i){e.preventDefault();return}}}}},xi=({iconBefore:e,iconAfter:t,hideBorder:s,value:i,elementId:o,placeholder:n="",className:r="",containerClassName:a,tooltipTriggerClassName:l,type:c="text",disabled:d,readonly:u,invalid:h,onChange:p,min:f,max:C,prefix:w,suffix:v,textBeforeInput:b,textAfterInput:S,onBlur:y,defaultValue:x,tooltipText:F,hideTooltip:R=!1,inputRef:E})=>{const P=g.useRef(null),M=Ee.useMergeRefs([E,P]);g.useEffect(()=>{const N=P.current;if(!N)return;const O=q=>{q.preventDefault()};return N.addEventListener("wheel",O,{passive:!1}),()=>{N.removeEventListener("wheel",O)}},[]);const D=c==="number"||f!==void 0||C!==void 0,I=N=>{p8(N,c,f,C)},V=N=>{const O=N.currentTarget.value;if(D&&O!==""){const q=parseFloat(O);if(isNaN(q)&&O!=="-"&&O!=="."||!isNaN(q)&&(f!==void 0&&q<f||C!==void 0&&q>C))return}p?.(O||void 0)};return m.jsxs("div",{className:X("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(xi,{hideBorder:!0,containerClassName:"rounded-r-none border-r-0",className:"overflow-hidden overflow-ellipsis dial-small",value:b,disabled:!0,elementId:b+"textBefore"})}),w&&m.jsxs("p",{className:"text-secondary dial-small mr-2",children:[" ",w]}),m.jsx(Ne,{icon:e,className:X(!!e&&"mr-2")}),m.jsx(_t,{tooltip:R?void 0:F||i,triggerClassName:X(l,"flex-1"),children:m.jsx("input",{ref:M,type:c,autoComplete:"off",id:o,placeholder:n,value:x?void 0:i??"",disabled:d,className:X("border-0 bg-transparent w-full truncate",r),onChange:N=>!u&&V?.(N),onKeyDown:I,onBlur:y,min:f,max:C,defaultValue:x})}),m.jsx(Ne,{icon:t,className:X(!!t&&"ml-2")}),v&&m.jsxs("p",{className:"text-secondary dial-small ml-2",children:[" ",v]}),S&&m.jsx("div",{className:"ml-2",children:m.jsx(xi,{hideBorder:!0,containerClassName:"rounded-l-none border-l-0",value:S,disabled:!0,elementId:S+"textAfter"})})]})},f8=/^0+\.(\d+)?$/,m8=/^0+/,LC=({label:e,optional:t,optionalText:s,description:i,error:o,captionDescription:n,readonly:r,orientation:a,elementId:l,fieldTitle:c,errorText:d,elementClassName:u,elementContainerClassName:h,containerClassName:p,defaultEmptyText:f,...C})=>m.jsx(pa,{label:e??c,error:o??d,optionalText:s,optional:t,description:i,captionDescription:n,readonly:r,orientation:a,elementId:l,className:p,defaultEmptyText:f,value:C.value,children:m.jsx(xi,{elementId:l,className:u,containerClassName:h,invalid:d!=null,...C})}),C8=({onChange:e,...t})=>{const s=i=>!i||i==="-"?i:String(i)?.match(f8)?String(i)?.replace(m8,"0"):Number(i);return m.jsx(LC,{type:"number",onChange:i=>e?.(s(i)),...t})},v8=({onChange:e,...t})=>m.jsx(LC,{type:"text",onChange:s=>e?.(s),...t}),w8=({fieldTitle:e,optional:t,elementId:s,elementClassName:i,containerClassName:o,elementContainerClassName:n,errorText:r,...a})=>m.jsxs("div",{className:ne("flex flex-col",o),children:[m.jsx(Fi,{fieldTitle:e,optional:t,htmlFor:s}),m.jsx(AC,{textareaId:s,className:i,containerClassName:n,...a}),m.jsx(Ws,{errorText:r})]}),cu=({label:e,switchId:t,isOn:s=!1,disabled:i,onChange:o})=>{const n=X("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",i?"pointer-events-none":"",i?s?"bg-controls-disable":"bg-layer-4":s?"bg-accent-primary":"bg-layer-4"),r=g.useCallback(a=>{a.stopPropagation(),o?.(!s)},[o,s]);return m.jsxs("div",{className:"flex flex-row items-center",role:"switch",children:[m.jsx("input",{type:"checkbox",onChange:r,id:t,disabled:i,className:"invisible w-0 h-0",checked:s}),m.jsx("label",{htmlFor:t,className:n,children:m.jsx("span",{className:X("size-3 rounded-full",i?s?"bg-layer-4":"bg-controls-disable":"bg-controls-enable-primary")})}),e&&m.jsx("span",{className:X("pl-2 dial-small",i?"text-secondary":"text-primary"),"aria-label":"switch-title",children:e})]})};var Tt=(e=>(e.Sm="sm",e.Md="md",e.Lg="lg",e))(Tt||{});const b8="z-[52] flex items-center justify-center bg-blackout md:p-4",S8="divide-tertiary divide-y",y8="flex flex-row justify-between py-4 px-6 items-center",x8={[Tt.Sm]:"dial-sm-popup",[Tt.Md]:"dial-md-popup",[Tt.Lg]:"dial-lg-popup"},Ii=({open:e=!1,header:t,portalId:s,className:i,overlayClassName:o,titleClassName:n,headerClassName:r,dividers:a=!0,children:l,footer:c,onClose:d,size:u=Tt.Md,hideClose:h=!1,closeOnOutsideClick:p=!0})=>{const{refs:f,context:C}=Ee.useFloating({open:e,onOpenChange:x=>{x||d?.(null)}}),w=Ee.useRole(C,{role:"dialog"}),v=Ee.useDismiss(C,{outsidePress:p}),{getFloatingProps:b}=Ee.useInteractions([w,v]);if(!e)return null;const S=typeof t=="string"?"dial-popup-heading":void 0,y=x=>x?typeof x=="string"?m.jsx("h3",{id:S,className:X("flex-1 min-w-0 mr-3 truncate dial-h3 text-primary",n),children:m.jsx(_t,{tooltip:x,children:x})}):x:m.jsx("span",{});return m.jsx(Ee.FloatingPortal,{id:s,children:m.jsx(Ee.FloatingOverlay,{className:X(b8,o),children:m.jsx(Ee.FloatingFocusManager,{context:C,children:m.jsxs("div",{ref:f.setFloating,...b(),role:"dialog","aria-modal":"true","aria-labelledby":S,className:X("dial-popup",x8[u],a&&S8,i),children:[m.jsxs("div",{className:ne(y8,r),children:[y(t),!h&&m.jsx(ru,{ariaLabel:"Close dialog",onClose:x=>d?.(x)})]}),m.jsx("div",{className:"flex-grow overflow-auto","aria-label":"popup-description",children:l}),c]})})})})};var vo=(e=>(e.Info="info",e.Danger="danger",e))(vo||{});const R8="flex justify-end gap-2 px-6 py-4",F8="text-secondary dial-small-150 px-6 py-4",E8="Cancel",D8="Ok",rc={[vo.Info]:{confirm:{variant:qe.Primary,appearance:Me.Solid},cancel:{variant:qe.Neutral,appearance:Me.Outlined}},[vo.Danger]:{container:"dial-danger-popup",confirm:{variant:qe.Error,appearance:Me.Solid},cancel:{variant:qe.Neutral,appearance:Me.Outlined}}},OC=({header:e,description:t,descriptionClassName:s,open:i=!1,confirmLabel:o=D8,cancelLabel:n=E8,isLoading:r=!1,disableConfirmButton:a=!1,className:l,confirmClassName:c,onClose:d,onConfirm:u,onCancel:h,children:p,dividers:f=!1,variant:C=vo.Info,size:w=Tt.Sm,footer:v})=>{const b=r?null:m.jsxs("div",{className:R8,children:[m.jsx(Rs,{label:n,onClick:()=>h?h():d?.()}),m.jsx(xt,{variant:rc[C].confirm?.variant,appearance:rc[C].confirm?.appearance,className:c,label:o,disabled:a,onClick:()=>u()})]}),S=g.useCallback(()=>r?m.jsx("div",{className:"px-6 py-4 h-[120px]",children:m.jsx(Fn,{size:50})}):p??(t?m.jsx("div",{className:X(F8,s),children:t}):null),[p,t,r,s]);return m.jsx(Ii,{open:i,header:e,className:X(rc[C].container,l),dividers:f,onClose:()=>d?.(),footer:v??b,size:w,children:S()})},du=({selectedItems:e,listClassName:t,listElementClassName:s,placeholder:i})=>e?.length?m.jsx("ul",{className:X("flex-row items-center truncate flex-wrap","flex gap-x-2 gap-y-1",t),children:e?.map(o=>m.jsx("li",{children:m.jsx(_t,{tooltip:o,children:m.jsx(ma,{tag:o,className:X([s])})})},o))}):i?m.jsx("span",{className:"text-secondary",children:i}):null,vg=e=>ge.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},ge.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"})),NC=({children:e,open:t,disabled:s=!1,selectedValue:i,valueClassName:o,inputClassName:n,onOpen:r,elementId:a,errorText:l,invalid:c,emptyValueText:d,placeholder:u})=>{const h=Array.isArray(i)&&i.length>0,p=typeof i=="string"&&!!i.trim(),f=h||p?i:u?void 0:d,C=s?void 0:r,w=()=>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:X("dial-input px-3 py-2 dial-input-field flex flex-row items-center w-full justify-between cursor-pointer",n,s&&"dial-input-disable",(l||c)&&"dial-input-error"),children:[m.jsx(_t,{tooltip:f==null?void 0:String(f),children:f||!u?m.jsx("span",{className:o,children:f}):m.jsx("span",{className:"text-secondary",children:u})}),!s&&m.jsx("div",{className:"flex-shrink-0",children:m.jsx(Ne,{icon:m.jsx(vg,{role:"img",width:ms,height:ms})})})]})}),l&&m.jsx(Ws,{errorText:l})]}),v=()=>m.jsx("div",{className:"w-full",onClick:C,children:m.jsxs("div",{className:X("dial-input px-3 py-2 flex flex-row items-center w-full justify-between cursor-pointer",s&&"dial-input-disable"),children:[m.jsx(du,{placeholder:u,selectedItems:f}),!s&&m.jsx("div",{className:"ml-1",children:m.jsx(Ne,{icon:m.jsx(vg,{role:"img",width:ms,height:ms})})})]})});return m.jsxs(m.Fragment,{children:[h?v():w(),t&&Rn.createPortal(e,document.body)]})},P8=({fieldTitle:e,htmlFor:t,disabled:s,selectedValue:i,radioButtons:o,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:w,onChangeRadioField:v,id:b,size:S=Tt.Md})=>{const[y,x]=g.useState(!1),F=g.useCallback(()=>{s||x(!0)},[s]),R=g.useCallback(()=>{x(!1),c?.()},[c]),E=g.useCallback(()=>{h(),R()},[h,R]);return m.jsxs("div",{className:"flex flex-col",children:[m.jsx(Fi,{fieldTitle:e,htmlFor:t}),m.jsx(NC,{disabled:s,open:y,selectedValue:n??o.find(P=>P.id===i)?.name,valueClassName:r,inputClassName:X(a,"py-2","px-3"),emptyValueText:l,onOpen:F,children:m.jsx(Ii,{open:y,onClose:R,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(Rs,{label:p,onClick:R}),m.jsx(Kt,{label:f,onClick:E,disabled:!C})]}),children:m.jsx("div",{className:"px-6 py-4",children:m.jsx(Hr,{radioButtons:o,labelClassName:"dial-small",activeRadioButton:w,onChange:v,elementId:b,orientation:pi.Column})})})})]})},M8="Create",T8="Cancel",I8="flex items-center justify-end gap-2 px-6 py-3",k8=({header:e,open:t=!1,submitLabel:s=M8,cancelLabel:i=T8,isLoading:o=!1,disableSubmitButton:n=!1,className:r,submitClassName:a,onClose:l,onSubmit:c,onCancel:d,children:u,dividers:h=!0,size:p=Tt.Md,footer:f})=>{const C=o?null:m.jsxs("div",{className:I8,children:[m.jsx(Rs,{label:i,onClick:()=>d?d():l?.()}),m.jsx(Kt,{className:a,label:s,disabled:n,onClick:()=>c()})]}),w=g.useCallback(()=>o?m.jsx("div",{className:"px-6 py-4 h-[120px]",children:m.jsx(Fn,{size:50})}):u??null,[u,o]);return m.jsx(Ii,{open:t,header:e,className:r,dividers:h,onClose:()=>l?.(),footer:f??C,size:p,children:w()})},A8=({onClick:e})=>m.jsx(_.IconEyeOff,{...se,className:"text-primary",onClick:e,role:"button","aria-label":"hide"}),L8=({onClick:e})=>m.jsx(_.IconEye,{...se,className:"text-primary",onClick:e,role:"button","aria-label":"show"}),HC=({...e})=>{const[t,s]=g.useState(!1),i=g.useCallback(o=>{s(o)},[]);return m.jsx(xi,{type:t?"text":"password",...e,hideTooltip:!t,iconAfter:t?m.jsx(A8,{onClick:()=>i(!1)}):m.jsx(L8,{onClick:()=>i(!0)})})},O8=({fieldTitle:e,optional:t,elementClassName:s,elementId:i,errorText:o,...n})=>m.jsxs("div",{className:"flex flex-col",children:[m.jsx(Fi,{fieldTitle:e,optional:t,htmlFor:i}),m.jsx(HC,{className:s,elementId:i,invalid:!!o,...n}),m.jsx(Ws,{errorText:o})]});var xn=(e=>(e.Small="small",e.Base="base",e))(xn||{});const N8={[xn.Small]:{textClassName:"text-xs px-1",containerClassName:"px-[6px] py-1 h-[22px]",iconSize:10,iconStroke:1},[xn.Base]:{textClassName:"text-sm px-2",containerClassName:"px-3 py-2 h-[38px]",iconSize:18,iconStroke:1.5}},uu=({elementId:e,value:t,placeholder:s="Search...",disabled:i,readonly:o,invalid:n,className:r,containerClassName:a,onChange:l,onBlur:c,size:d=xn.Base,allowClear:u=!0})=>{const[h,p]=g.useState(t||"");g.useEffect(()=>{p(t||"")},[t]);const f=g.useCallback(v=>{p(v),l?.(v)},[l]),C=N8[d],w=g.useCallback(()=>{f("")},[f]);return m.jsxs("div",{className:ne("dial-input flex flex-row items-center justify-between",n&&"dial-input-error",i&&"dial-input-disable",o&&"dial-input-readonly",C.containerClassName,a),children:[m.jsx(Ne,{className:X(i?"text-secondary":"text-primary"),icon:m.jsx(_.IconSearch,{size:C.iconSize,stroke:C.iconStroke})}),m.jsx("input",{id:e,type:"text",autoComplete:"off",placeholder:s,value:h??"",disabled:i,readOnly:o,className:X("border-0 bg-transparent w-full",r,C.textClassName),onChange:v=>!o&&f(v.currentTarget.value),onBlur:c}),h&&!o&&!i&&u&&m.jsx(Ne,{className:"text-primary cursor-pointer",icon:m.jsx(_.IconX,{size:C.iconSize,stroke:C.iconStroke,onClick:w,"aria-label":"Clear search",role:"button"})})]})},H8=({placeholder:e="",selectedItems:t=[],listClassName:s,listElementClassName:i,containerClassName:o,inputClassName:n,onChange:r})=>{const[a,l]=g.useState(""),c=g.useCallback(u=>{u.key==="Enter"&&(r([...t,u.currentTarget.value]),l("")),(u.key==="Backspace"||u.key==="Delete")&&t.length&&!a&&r(t.slice(0,-1))},[t,r,a]),d=g.useCallback(u=>{l(u.target.value)},[l]);return m.jsxs("div",{className:X(["dial-input px-3 py-2 flex flex-row items-center flex-wrap w-fit gap-2",o]),children:[m.jsx(du,{selectedItems:t,listClassName:s,listElementClassName:i}),m.jsx("input",{type:"text",value:a,className:X(["border-0 bg-transparent p-0",n]),placeholder:t?.length?"":e,onKeyDown:c,onChange:d})]})},G8=({initialTags:e=[],fieldTitle:t,optional:s,elementId:i,placeholder:o,captionDescription:n,errorText:r,invalid:a,disabled:l,onChange:c})=>{const d=g.useRef(null),[u,h]=g.useState(e),[p,f]=g.useState(""),[C,w]=g.useState(!1),v=F=>{const R=F.trim().replace(/,$/,"");if(R&&!u.includes(R)){const E=[R,...u];h(E),c?.(E)}},b=F=>{(F.key===","||F.key==="Enter")&&(F.preventDefault(),v(p),f(""))},S=()=>{p.trim()&&(v(p),f(""))},y=F=>{const R=u.filter((E,P)=>P!==F);h(R),c?.(R)},x=()=>r?m.jsx(Ws,{errorText:r}):n?m.jsx("div",{className:"dial-tiny text-secondary mt-1",children:n}):null;return g.useEffect(()=>{const F=new ResizeObserver(()=>{if(d.current){const R=d.current.scrollHeight>d.current.clientHeight+10;w(R)}});return d.current&&F.observe(d.current),()=>F.disconnect()},[u]),m.jsxs("div",{className:X("flex flex-col w-full"),children:[m.jsx(Fi,{fieldTitle:t,optional:s,htmlFor:i}),m.jsx("div",{className:X("dial-input min-h-[38px] p-[6px]",a&&"dial-input-error",l&&"dial-input-disable"),children:m.jsxs("div",{ref:d,className:X("flex flex-wrap gap-2 items-center",C?"flex-col-reverse":"flex-row"),children:[u.map((F,R)=>m.jsx(ma,{tag:F,remove:l?void 0:()=>y(R)},F+R)),m.jsx("input",{type:"text",value:p,onChange:F=>f(F.target.value),onKeyDown:b,onBlur:S,className:X("dial-input-no-border outline-none border-none w-full min-w-[100px] flex-1 p-1"),placeholder:o,disabled:l})]})}),x()]})},B8="dial-input flex w-full items-center justify-between gap-2 dial-small cursor-pointer",V8="w-full rounded flex flex-col",ac="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",z8="bg-accent-primary-alpha",W8="bg-accent-primary-alpha border-l border-accent-primary border-1",wg="opacity-75",_8=352,j8=m.jsx(_.IconChevronDown,{size:16}),GC=({options:e,selectedValues:t,handleRemoveTag:s})=>m.jsx("div",{className:"flex flex-wrap w-full items-center gap-1",children:t.map(i=>{const o=e.find(r=>r.value===i)?.label??i,n=e.find(r=>r.value===i)?.icon;return m.jsx(ma,{tag:o,remove:r=>s?.(r,i),iconBefore:n?m.jsx(Ne,{icon:n}):null,className:"max-w-full"},i)})});var ua=(e=>(e.Sm="sm",e.Md="md",e))(ua||{}),ha=(e=>(e.Primary="Primary",e.Secondary="Secondary",e))(ha||{});const BC=({options:e,multiple:t=!1,elementId:s,value:i,defaultValue:o,variant:n=ha.Primary,size:r=ua.Md,prefix:a,customSelectedValue:l,placeholder:c="Select...",searchable:d=!1,searchPlaceholder:u,selectAll:h=!1,invalid:p,selectAllLabel:f="Select all",emptyStateTitle:C="No options available",emptyStateDescription:w,emptyStateIcon:v,disabled:b=!1,className:S,listClassName:y,closable:x=!1,header:F,footer:R,onClose:E,onChange:P,inlineSearch:M=!1,dismissRef:D,onFooterClick:I,open:V,onOpenChange:N,onInlineQueryChange:O})=>{const q=g.useId(),[Q,L]=g.useState(!1),re=V!==void 0,W=re?!!V:Q,ee=g.useCallback(G=>{re||L(G),N?.(G)},[re,N]),[Y,Z]=g.useState(M&&l||""),j=g.useRef(null),fe=g.useCallback(G=>{G!==Y&&(Z(G),O?.(G))},[O,Y]),Ce=i!==void 0,[k,ce]=g.useState(o),we=Ce?i:k,z=g.useMemo(()=>t?Array.isArray(we)?we:[]:typeof we=="string"?[we]:[],[we,t]),H=g.useMemo(()=>{const G=Y.trim().toLowerCase();return G?e.filter(Se=>Se.label.toLowerCase().includes(G)):e},[e,Y]);g.useEffect(()=>{!W&&!M&&fe("")},[M,W,fe]),g.useEffect(()=>{M&&!W&&l&&fe(l||"")},[l,M,W,fe]);const U=g.useCallback(G=>{Ce||ce(G),P?.(G)},[Ce,P]),oe=g.useCallback(G=>{if(t){const Se=new Set(z);Se.has(G)?Se.delete(G):Se.add(G),U(Array.from(Se));return}if(U(G),M){const Se=e.find(lt=>lt.value===G);Se&&(fe(Se.label),O?.(Se.label))}ee(!1)},[t,U,M,ee,z,e,fe,O]),he=g.useCallback((G,Se)=>{if(G.stopPropagation(),!t){U("");return}const lt=z.filter(us=>us!==Se);U(lt)},[t,z,U]),ye=g.useMemo(()=>H.filter(G=>!G.disabled),[H]),ie=g.useMemo(()=>ye.filter(G=>z.includes(G.value)).length,[ye,z]),be=G=>{M&&!t&&!G&&oe(Y),ee(G)},Re=ye.length>0&&ie===ye.length,ke=ie>0&&!Re,me=()=>{if(!(!t||ye.length===0))if(Re){const G=new Set(ye.map(lt=>lt.value)),Se=z.filter(lt=>!G.has(lt));U(Se)}else{const G=new Set(z);ye.forEach(Se=>G.add(Se.value)),U(Array.from(G))}},ve=z.length>0;g.useEffect(()=>{W&&M&&!t&&!b&&requestAnimationFrame(()=>{const G=j.current;if(!G)return;G.focus();const Se=G.value?.length??0;G.setSelectionRange?.(Se,Se)})},[W,M,t,b]);const He=!t&&ve?z[0]:void 0,We=g.useMemo(()=>He?e.find(G=>G.value===He):void 0,[e,He]),Pe=g.useCallback(()=>!t||z.length===0?null:m.jsx(GC,{options:e,selectedValues:z,handleRemoveTag:he}),[t,e,z,he]),kt=g.useCallback(()=>t?ve?Pe():m.jsx("span",{className:"text-secondary truncate",children:c}):We?m.jsxs(m.Fragment,{children:[We.icon&&m.jsx(Ne,{icon:We.icon}),m.jsx(ot,{text:a?`${a} ${We.label}`:We.label}),We?.description&&m.jsx("div",{className:"text-secondary dial-small",children:We.description})]}):l&&i?l:m.jsx("span",{className:"text-secondary truncate",children:c}),[ve,t,l,a,i,c,Pe,We]);g.useImperativeHandle(D,()=>({dismiss:()=>{ee(!1)}}));const at=g.useCallback(()=>{fe(z.length===1?We?.label??Y:"")},[Y,z.length,fe,We?.label]),ds=g.useCallback(()=>{b||(ee(!W),M&&!t&&(at(),j.current?.focus()))},[b,M,W,t,at,ee]);return m.jsx(yt,{open:W,onOpenChange:be,disabled:b,closable:x,onClose:E,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],maxDropdownHeight:d?null:_8,listClassName:y,renderOverlay:()=>m.jsxs("div",{id:`list-${s||q}`,role:"listbox","aria-multiselectable":t||void 0,className:V8,children:[F&&m.jsx(m.Fragment,{children:typeof F=="function"?F():F}),(d||x)&&e.length>8&&m.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[d&&m.jsx(uu,{placeholder:u,onChange:fe,value:Y,elementId:`search-${s||q}`}),x&&m.jsx(xt,{"aria-label":"Close select",className:"shrink-0",iconBefore:m.jsx(_.IconX,{size:16}),onClick:G=>{E?.(G),ee(!1)}})]}),t&&h&&ye.length>0&&m.jsx("div",{className:X(ac,"mt-2"),children:m.jsx(rn,{id:`${s||q}-selectAll`,label:f,checked:Re,indeterminate:ke,onChange:me,ariaLabel:f})}),m.jsx("div",{className:X("overflow-y-auto max-h-[352px]",M&&H.length===0?"":"py-1"),children:H.length===0?!M&&m.jsx("div",{className:"px-2 py-3",children:m.jsx(En,{icon:v??m.jsx(_.IconClipboardX,{size:24,stroke:.5}),title:C,description:w})}):H.map(G=>{const Se=z.includes(G.value);return t?m.jsxs("div",{role:"option","aria-selected":Se,"aria-disabled":!!G.disabled,className:X(ac,Se&&z8,G.disabled&&wg,"w-full"),children:[m.jsx(rn,{id:`${s||q}-${G.value}`,label:m.jsxs("span",{className:"flex w-full flex-1 pl-2 min-w-0 items-center gap-2 text-primary",children:[G.icon&&m.jsx(Ne,{icon:G.icon}),m.jsx("span",{className:"truncate",children:G.label})]}),checked:Se,disabled:G.disabled,onChange:()=>!G.disabled&&oe(G.value),ariaLabel:G.label}),G.description&&m.jsx("div",{className:"text-secondary dial-small",children:G.description})]},G.value):m.jsx("button",{role:"option",type:"button","aria-selected":Se,"aria-disabled":!!G.disabled,disabled:G.disabled,className:X(ac,Se&&W8,G.disabled&&wg),onClick:()=>!G.disabled&&oe(G.value),children:m.jsxs("div",{className:"flex items-center gap-2 w-full",children:[G.icon&&m.jsx(Ne,{icon:G.icon}),m.jsx(ot,{text:G.label}),G.description&&m.jsx("div",{className:"text-secondary dial-small",children:G.description})]})},G.value)})}),R&&m.jsx("div",{onClick:G=>{I?.(G),I&&ee(!1)},children:typeof R=="function"?R():R})]}),children:m.jsxs("div",{role:"button",tabIndex:0,"aria-roledescription":"button to open select list","aria-haspopup":"listbox","aria-expanded":W,"aria-controls":`list-${s||q}`,className:ne(B8,b&&"opacity-75 !cursor-not-allowed",r===ua.Sm?"min-h-[25px] px-1.5 py-1":"min-h-[38px] px-3 py-2",p&&"dial-input-error",n===ha.Secondary?"!bg-layer-4":"",S),onMouseDown:G=>{b||M&&!t&&(at(),G.preventDefault())},onClick:()=>{ds()},onKeyDown:G=>{(G.key===" "||G.code==="Space")&&(G.preventDefault(),ds())},children:[M&&!t?m.jsx("div",{className:"flex min-w-0 items-center gap-2 text-primary flex-1",children:m.jsx("input",{id:`inline-${s||q}`,type:"text",placeholder:u??c,value:Y||"",onChange:G=>fe(G.currentTarget.value.trimStart()),onFocus:()=>!b&&ee(!0),onMouseDown:G=>{at(),G.stopPropagation()},onClick:G=>{G.stopPropagation()},onKeyDown:G=>{G.stopPropagation()},className:"bg-transparent outline-none w-full dial-small",ref:j,disabled:b,"aria-disabled":b,autoComplete:"off"})}):m.jsx("div",{className:"flex w-full min-w-0 items-center gap-2 text-primary",children:kt()}),!M&&m.jsx(Ne,{icon:j8,className:X("text-primary",W&&"rotate-180")})]})})},U8=({fieldTitle:e,optional:t,captionDescription:s,containerClassName:i,selectClassName:o,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(GC,{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(pa,{elementId:r,label:e,optional:t,description:a,error:n,captionDescription:s,className:i,readonly:l,value:h(),defaultEmptyText:d,children:m.jsx(BC,{className:o,value:c,elementId:r,invalid:!!n,...u})})};function VC(e){let t=null;return()=>(t==null&&(t=e()),t)}function $8(e,t){return e.filter(s=>s!==t)}function K8(e,t){const s=new Set,i=n=>s.add(n);e.forEach(i),t.forEach(i);const o=[];return s.forEach(n=>o.push(n)),o}class q8{enter(t){const s=this.entered.length,i=o=>this.isNodeInDocument(o)&&(!o.contains||o.contains(t));return this.entered=K8(this.entered.filter(i),[t]),s===0&&this.entered.length>0}leave(t){const s=this.entered.length;return this.entered=$8(this.entered.filter(this.isNodeInDocument),t),s>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class Y8{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(i=>{const o=this.config.exposeProperties[i];o!=null&&(s[i]={value:o(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 hu="__NATIVE_FILE__",zC="__NATIVE_URL__",WC="__NATIVE_TEXT__",_C="__NATIVE_HTML__",bg=Object.freeze(Object.defineProperty({__proto__:null,FILE:hu,HTML:_C,TEXT:WC,URL:zC},Symbol.toStringTag,{value:"Module"}));function lc(e,t,s){const i=t.reduce((o,n)=>o||e.getData(n),"");return i??s}const td={[hu]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[_C]:{exposeProperties:{html:(e,t)=>lc(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[zC]:{exposeProperties:{urls:(e,t)=>lc(e,t,"").split(`
|
|
61
|
+
`,VT=class extends p5{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,rg),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((s,i)=>{i!==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,i){s!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(i)}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 i=this.extractRowCellValue(e,t,t,"csv",s);this.result+=this.putInQuotes(i.valueFormatted??i.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():(B(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=rg),this.isFirstLine=!1}},zT=class extends g5{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()){B(51);return}const t=this.getMergedParams(e),s=this.getData(t),i=new Blob(["\uFEFF",s],{type:"text/plain"}),o=typeof t.fileName=="function"?t.fileName(ue(this.gos,{})):t.fileName;f5(this.getFileName(o),i)}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:i,valueSvc:o,gos:n}=this,{processCellCallback:r,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:d,columnSeparator:u}=e;return new VT({colModel:t,colNames:s,valueSvc:o,gos:n,processCellCallback:r||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:d||!1,columnSeparator:u||",",rowGroupColsSvc:i})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function WT(e,t){return e.csvCreator?.getDataAsCsv(t)}function _T(e,t){e.csvCreator?.exportDataAsCsv(t)}var jT={moduleName:"CsvExport",version:$,beans:[zT],apiFunctions:{getDataAsCsv:WT,exportDataAsCsv:_T},dependsOn:[BT]},UT=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:i,rowNodes:o}=this;for(let n=0;n<e;n++){const r=s+n,a=new Ks(i);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(r),a.setRowTop(t*r),o.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:s,state:i}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:s,pageStatus:i}}}setDataAndId(e,t,s){K(t)?e.setDataAndId(t,s.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(ze(this.params.datasource.getRows)){B(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:s,params:{sortModel:i,filterModel:o},gos:n}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,s),failCallback:this.pageLoadFailed.bind(this,s),sortModel:i,filterModel:o,context:ue(n,{}).context}}forEachNode(e,t,s){this.rowNodes.forEach((i,o)=>{this.startRow+o<s&&e(i,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((o,n)=>{const r=e.rowData?e.rowData[n]:void 0;!o.id&&o.alreadyRendered&&r&&(t[n]=new Ks(s),t[n].setRowIndex(o.rowIndex),t[n].setRowTop(o.rowTop),t[n].setRowHeight(o.rowHeight),o.clearRowTopAndRowIndex()),this.setDataAndId(t[n],r,this.startRow+n)});const i=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,i)}destroy(){for(const e of this.rowNodes)e.clearRowTopAndRowIndex();super.destroy()}},$T=2,KT=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 i=this.blocks[s];if(!i){if(t)return;i=this.createBlock(s)}return i.getRow(e)}createBlock(e){const t=this.params,s=this.createBean(new UT(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()&&(vi(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 i=this.params.maxBlocksInCache>0,o=i?this.params.maxBlocksInCache-1:null,n=$T-1;t.forEach((r,a)=>{const l=r.state==="needsLoading"&&a>=n,c=i?a>=o:!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:i}=e;return t.rowIndex>=s&&t.rowIndex<i}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:i}=this.params,n=(e.id+1)*s+i;this.rowCount<n&&(this.rowCount=n)}}setRowCount(e,t){this.rowCount=e,K(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,i)=>s.id-i.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 i=-1,o=!1;const n={value:0};let r=!1;for(const l of this.getBlocksInOrder())if(!r){if(o&&i+1!==l.id){r=!0;continue}i=l.id,l.forEachNode(c=>{const d=c===e||c===t;(o||d)&&s.push(c),d&&(o=!o)},n,this.rowCount)}return r||o?[]:s}},qT=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 Ks(e);this.rootNode=t,t.level=-1,this.rowHeight=di(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=di(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){let e;this.cacheParams?e=!dn(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;ho(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:i,eventSvc:o,gos:n}=e;this.cacheParams={datasource:this.datasource,filterModel:t?.getFilterModel()??{},sortModel:s?.getSortModel()??[],rowNodeBlockLoader:i,initialRowCount:n.get("infiniteInitialRowCount"),maxBlocksInCache:n.get("maxBlocksInCache"),rowHeight:di(e),overflowSize:n.get("cacheOverflowSize"),blockSize:n.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new KT(this.cacheParams)),o.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 YT(e){Ia(e)?.refreshCache()}function ZT(e){Ia(e)?.purgeCache()}function XT(e){return Ia(e)?.getRowCount()}var QT=class extends A{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=tS(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=nt(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){qt(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){vi(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:i}=t.getBlockStateJson();e[s]=i}),e}printCacheStatus(){vi(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},JT={moduleName:"InfiniteRowModelCore",version:$,rowModels:["infinite"],beans:[qT,QT]},e6={moduleName:"InfiniteRowModel",version:$,apiFunctions:{refreshInfiniteCache:YT,purgeInfiniteCache:ZT,getInfiniteRowCount:XT},dependsOn:[JT,hT]},t6="↑",s6="↓",i6={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},o6=class extends Ue{constructor(){super(i6),this.eValue=de,this.eDelta=de,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const s=Math.abs(t),i=e.formatValue(s),o=K(i)?i:s,n=t>=0,r=this.eDelta;n?r.textContent=t6+o:r.textContent=s6+o,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"),bt(this.eDelta)}refresh(e,t=!1){const{value:s,valueFormatted:i}=e,{eValue:o,lastValue:n,beans:r}=this;if(s===n||(K(i)?o.textContent=i:K(s)?o.textContent=s:bt(o),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&&o.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=s,!0}},n6=".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}",r6={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},a6=class extends Ue{constructor(){super(r6),this.eCurrent=de,this.refreshCount=0,this.registerCSS(n6)}init(e){this.refresh(e,!0)}addSlideAnimation(){this.refreshCount++;const e=this.refreshCount;this.ePrevious?.remove();const{beans:t,eCurrent:s}=this,i=vt({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=i,i.textContent=s.textContent,this.getGui().insertBefore(i,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(ze(s)&&(s=""),s===this.lastValue||this.beans.filterManager?.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=s;const i=this.eCurrent;return K(e.valueFormatted)?i.textContent=e.valueFormatted:K(e.value)?i.textContent=s:bt(i),!0}},l6=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"),i=this.beans.gos.get("cellFadeDuration")){const o=this.animations[t];o.delete(e);const n=Date.now(),r=n+s,a=n+s+i,l={phase:"flash",flashEndTime:r,fadeEndTime:a};o.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 i=this.animations[s],o=`ag-cell-${s}`,n=`${o}-animation`;for(const[r,a]of i){if(!r.isAlive()||!r.comp){i.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(o,!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(o,!1),p.toggleCss(n,!1),f.removeProperty("transition"),f.removeProperty("transition-delay"),i.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=J2(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 c6(e,t={}){const{cellFlashSvc:s}=e;s&&e.frameworkOverrides.wrapIncoming(()=>{for(const i of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))s.flashCell(i,t)})}var d6={moduleName:"HighlightChanges",version:$,beans:[l6],userComponents:{agAnimateShowChangeCellRenderer:o6,agAnimateSlideCellRenderer:a6},apiFunctions:{flashCells:c6}};function u6(e){return e.stateSvc?.getState()??{}}function h6(e,t,s){return e.stateSvc?.setState(t,s)}function ag(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=g6(e)),e.version=$,e}function g6(e){return e.cellSelection=p6(e,"rangeSelection"),e}function p6(e,t){if(e&&typeof e=="object")return e[t]}var f6=class extends A{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=nt(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=nt(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=nt(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 i=ag(e.get("initialState")??{}),o=i.partialColumnState;delete i.partialColumnState,this.cachedState=i;const n=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>n(()=>this.setupStateOnGridReady(i))),(i.columnOrder||i.columnVisibility||i.columnSizing||i.columnPinning||i.columnGroup)&&s?.hideColumns("columnState");const[r,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:c})=>{c==="gridInitializing"&&(r(),n(()=>{this.setupStateOnColumnsInitialised(i,!!o),s?.revealColumns("columnState")}))},rowCountReady:()=>{a?.(),n(()=>this.setupStateOnRowCountReady(i))},firstDataRendered:()=>{l?.(),n(()=>this.setupStateOnFirstDataRendered(i))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const s=ag(e);delete s.partialColumnState,this.cachedState=s,this.startSuppressEvents();const i="api",o=t?new Set(t):void 0;this.setGridReadyState(s,i,o),this.setColumnsInitialisedState(s,i,!!o,o),this.setRowCountState(s,i,o),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(s,i,o),this.stopSuppressEvents(i)})}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,i){this.setColumnState(e,t,s,i),this.setColumnGroupState(e,t,i),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const s=i=>()=>this.updateColumnState([i]);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:i,rowGroupExpansion:o,ssrmRowGroupExpansion:n,rowSelection:r,pagination:a}=e,l=(d,u)=>!s?.has(d)&&(u||t==="api");l("filter",i)&&this.setFilterState(i),l("rowGroupExpansion",o)&&this.setRowGroupExpansionState(n,o,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))},i=()=>t("filter",this.getFilterState()),{gos:o,colFilter:n}=this.beans;this.addManagedEventListeners({filterChanged:i,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:s,columnRowGroupChanged:s,rowDataUpdated:()=>{(o.get("groupDefaultExpanded")!==0||o.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:i})}setFirstDataRenderedState(e,t,s){const{scroll:i,cellSelection:o,focusedCell:n,columnOrder:r,rowPinning:a}=e,l=(u,h)=>!s?.has(u)&&(h||t==="api");l("focusedCell",n)&&this.setFocusedCellState(n),l("cellSelection",o)&&this.setCellSelectionState(o),l("scroll",i)&&this.setScrollState(i),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:i=>{if(i.finished){const o=this.getRangeSelectionState();t("rangeSelection",o),t("cellSelection",o)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return c5(Xr(e),e.colModel.isPivotMode())}setColumnState(e,t,s,i){const{sort:o,rowGroup:n,aggregation:r,pivot:a,columnPinning:l,columnVisibility:c,columnSizing:d,columnOrder:u}=e;let h=!1;const p=(D,I)=>{const V=!i?.has(D)&&!!(I||t==="api");return h||(h=V),V},f={},C=D=>{let I=f[D];return I||(I={colId:D},f[D]=I,I)},w={},v=p("sort",o);v&&o?.sortModel.forEach(({colId:D,sort:I},V)=>{const N=C(D);N.sort=I,N.sortIndex=V}),(v||!s)&&(w.sort=null,w.sortIndex=null);const b=p("rowGroup",n);b&&n?.groupColIds.forEach((D,I)=>{const V=C(D);V.rowGroup=!0,V.rowGroupIndex=I}),(b||!s)&&(w.rowGroup=null,w.rowGroupIndex=null);const S=p("aggregation",r);S&&r?.aggregationModel.forEach(({colId:D,aggFunc:I})=>{C(D).aggFunc=I}),(S||!s)&&(w.aggFunc=null);const y=p("pivot",a);y&&(a?.pivotColIds.forEach((D,I)=>{const V=C(D);V.pivot=!0,V.pivotIndex=I}),this.gos.updateGridOptions({options:{pivotMode:!!a?.pivotMode},source:t})),(y||!s)&&(w.pivot=null,w.pivotIndex=null);const x=p("columnPinning",l);if(x){for(const D of l?.leftColIds??[])C(D).pinned="left";for(const D of l?.rightColIds??[])C(D).pinned="right"}(x||!s)&&(w.pinned=null);const F=p("columnVisibility",c);if(F)for(const D of c?.hiddenColIds??[])C(D).hide=!0;(F||!s)&&(w.hide=null);const R=p("columnSizing",d);if(R)for(const{colId:D,flex:I,width:V}of d?.columnSizingModel??[]){const N=C(D);N.flex=I??null,N.width=V}(R||!s)&&(w.flex=null);const E=u?.orderedColIds,P=!!E?.length&&!i?.has("columnOrder"),M=P?E.map(D=>C(D)):Object.values(f);(M.length||h)&&(this.columnStates=M,$t(this.beans,{state:M,applyOrder:P,defaultState:w},t))}setColumnPivotState(e,t){const s=this.columnStates;this.columnStates=void 0;const i=this.columnGroupStates;this.columnGroupStates=void 0;const o=this.beans,{pivotResultCols:n,colGroupSvc:r}=o;if(n?.isPivotResultColsPresent()){if(s){const a=[];for(const l of s)n.getPivotResultCol(l.colId)&&a.push(l);$t(o,{state:a,applyOrder:e},t)}i&&r?.setColumnGroupState(i,t)}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return d5(t)}setColumnGroupState(e,t,s){const i=this.beans.colGroupSvc;if(!i||s?.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const o=new Set(e.columnGroup?.openColumnGroupIds),r=i.getColumnGroupState().map(({groupId:a})=>{const l=o.has(a);return l&&o.delete(a),{groupId:a,open:l}});for(const a of o)r.push({groupId:a,open:!0});r.length&&(this.columnGroupStates=r),i.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(),i=e?.getAdvFilterModel()??void 0;return t||i||s?{filterModel:t,columnFilterState:s,advancedFilterModel:i}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:s,columnFilterState:i,advancedFilterModel:o}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(s!==void 0||i!==void 0)&&t?.setFilterState(s??null,i??null,"columnFilter"),o!==void 0&&t?.setAdvFilterModel(o??null,"advancedFilter")}getRangeSelectionState(){const e=this.beans.rangeSvc?.getCellRanges().map(t=>{const{id:s,type:i,startRow:o,endRow:n,columns:r,startColumn:a}=t;return{id:s,type:i,startRow:o,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:i,visibleCols:o}=this.beans;if(!Us(t)||!s)return;const n=[];for(const r of e?.cellRanges??[]){const a=[];for(const c of r.colIds){const d=i.getCol(c);d&&a.push(d)}if(!a.length)continue;let l=i.getCol(r.startColId);if(!l){const c=o.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:i,rowRenderer:o,animationFrameSvc:n,ctrlsSvc:r}=this.beans;i.wrapIncoming(()=>{r.get("center").setCenterViewportScrollLeft(s),r.getScrollFeature()?.setVerticalScrollPosition(t),o.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:i}=e;return{colId:t.getColId(),rowIndex:s,rowPinned:i}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:s}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:i,rowIndex:o,rowPinned:n}=e;t.setFocusedCell({column:s.getCol(i),rowIndex:o,rowPinned:n,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const s=e.getCurrentPage(),i=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!s&&!i))return{page:s,pageSize:i}}setPaginationState(e,t){const{pagination:s,gos:i}=this.beans;if(!s)return;const{pageSize:o,page:n}=e??{page:0,pageSize:i.get("paginationPageSize")},r=t==="gridInitializing";o&&!i.get("paginationAutoPageSize")&&s.setPageSize(o,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 i=this.beans.expansionSvc;if(!i)return;const o=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};i.setExpansionState(o,s)}updateColumnState(e){const t=this.getColumnState();let s=!1;const i=this.cachedState;for(const o of Object.keys(t)){const n=t[o];dn(n,i[o])||(s=!0)}this.cachedState={...i,...t},s&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const s=this.cachedState[e];this.setCachedStateValue(e,t),dn(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")}},m6={moduleName:"GridState",version:$,beans:[f6],apiFunctions:{getState:u6,setState:h6}};function C6(e){return e.rowModel.isLastRowIndexKnown()}function v6(e){return e.pagination?.getPageSize()??100}function w6(e){return e.pagination?.getCurrentPage()??0}function b6(e){return e.pagination?.getTotalPages()??1}function S6(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function y6(e){e.pagination?.goToNextPage()}function x6(e){e.pagination?.goToPreviousPage()}function R6(e){e.pagination?.goToFirstPage()}function F6(e){e.pagination?.goToLastPage()}function E6(e,t){e.pagination?.goToPage(t)}var D6=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 i=Math.max(di(t),1),o=Math.floor(e/i);t.pagination.setPageSize(o,"autoCalculated")};this.isBodyRendered?nt(this,s,50)():(s(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},Bo="paginationPageSizeSelector",P6={tag:"span",cls:"ag-paging-page-size"},M6=class extends Ue{constructor(){super(P6),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(Bo,()=>{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(){bt(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(Bo)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),s=!t||!e.includes(t);if(s){const o=this.gos.exists("paginationPageSize"),n=this.gos.get(Bo)!==!0;B(94,{pageSizeSet:o,pageSizesSet:n,pageSizeOptions:e,paginationPageSizeOption:t}),n||B(95,{paginationPageSizeOption:t,paginationPageSizeSelector:Bo}),e.unshift("")}const i=String(s?"":t);this.selectPageSizeComp?(qs(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(i,!0)):this.createPageSizeSelectorComp(e,i),this.hasEmptyOption=s}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const s=this.getLocaleTextFunc(),i=s("pageSizeSelectorLabel","Page Size:"),o=s("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new kd).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(o).setLabel(i).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(Bo);return!Array.isArray(t)||!t?.length?e:[...t].sort((s,i)=>s-i)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},T6={selector:"AG-PAGE-SIZE-SELECTOR",component:M6},I6=".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}",k6=class extends R2{constructor(){super(),this.btFirst=de,this.btPrevious=de,this.btNext=de,this.btLast=de,this.lbRecordCount=de,this.lbFirstRowOnPage=de,this.lbLastRowOnPage=de,this.lbCurrent=de,this.lbTotal=de,this.pageSizeComp=de,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(I6)}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(),[T6]);const{btFirst:t,btPrevious:s,btNext:i,btLast:o}=this;this.activateTabIndex([t,s,i,o]),t.insertAdjacentElement("afterbegin",Vt(e?"last":"first",this.beans)),s.insertAdjacentElement("afterbegin",Vt(e?"next":"previous",this.beans)),i.insertAdjacentElement("afterbegin",Vt(e?"previous":"next",this.beans)),o.insertAdjacentElement("afterbegin",Vt(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):WR(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:i=>{(i.key===T.ENTER||i.key===T.SPACE)&&(i.preventDefault(),s())}})}zR(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}):h5(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 i=this.isZeroPagesToDisplay(),o=e===s-1;this.nextButtonDisabled=o||i,this.lastButtonDisabled=!t||i||e===s-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){o0(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(),i=e?s:null,o=this.pagination.getCurrentPage(),n=this.pagination.getPageSize();let r,a;this.isZeroPagesToDisplay()?r=a=0:(r=n*o+1,a=r+n-1,e&&a>i&&(a=i));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?o+1:0,C=this.formatNumber(f);this.lbCurrent.textContent=C;let w,v;if(e)w=this.formatNumber(t),v=this.formatNumber(i);else{const b=h("more","more");w=b,v=b}this.lbTotal.textContent=w,this.lbRecordCount.textContent=v,this.announceAriaStatus(d,u,v,C,w)}announceAriaStatus(e,t,s,i,o){const n=this.getLocaleTextFunc(),r=n("page","Page"),a=n("to","to"),l=n("of","of"),c=`${e} ${a} ${t} ${l} ${s}`,d=`${r} ${i} ${l} ${o}`;c!==this.ariaRowStatus&&(this.ariaRowStatus=c,this.ariaAnnounce?.announceValue(c,"paginationRow")),d!==this.ariaPageStatus&&(this.ariaPageStatus=d,this.ariaAnnounce?.announceValue(d,"paginationPage"))}},A6={selector:"AG-PAGINATION",component:k6},L6=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 A6}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 K(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:K(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:K(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:K(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,i=t-1;this.totalPages=Math.floor(i/s)+1,this.adjustCurrentPageIfInvalid();const o=this.currentPage,n=s*o;let r=s*(o+1)-1;if(r>i&&(r=i),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(n),r===i)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,i=e-1;this.totalPages=Math.floor(i/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*s,this.bottomDisplayedRowIndex=t*(s+1)-1,this.bottomDisplayedRowIndex>i&&(this.bottomDisplayedRowIndex=i)}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:i=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:s,newPageSize:i,keepRenderedRows:t})}},O6={moduleName:"Pagination",version:$,beans:[L6,D6],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:C6,paginationGetPageSize:v6,paginationGetCurrentPage:w6,paginationGetTotalPages:b6,paginationGetRowCount:S6,paginationGoToNextPage:y6,paginationGoToPreviousPage:x6,paginationGoToFirstPage:R6,paginationGoToLastPage:F6,paginationGoToPage:E6},dependsOn:[ka]};function N6(e,t={}){const s=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(s))}function hC(e,t,s,i,o){t&&(i&&t.parent&&t.parent.level!==-1&&hC(e,t.parent,s,i,o),t.setExpanded(s,void 0,o))}function H6(e,t){return e.rowModel.getRowNode(t)}function G6(e,t,s,i){e.rowRenderer.addRenderedRowListener(t,s,i)}function B6(e){return e.rowRenderer.getRenderedNodes()}function V6(e,t,s){e.rowModel.forEachNode(t,s)}function z6(e){return e.rowRenderer.firstRenderedRow}function W6(e){return e.rowRenderer.lastRenderedRow}function _6(e,t){return e.rowModel.getRow(t)}function j6(e){return e.rowModel.getRowCount()}var U6={moduleName:"RowApi",version:$,apiFunctions:{redrawRows:N6,setRowNodeExpanded:hC,getRowNode:H6,addRenderedRowListener:G6,getRenderedNodes:B6,forEachNode:V6,getFirstDisplayedRowIndex:z6,getLastDisplayedRowIndex:W6,getDisplayedRowAtIndex:_6,getDisplayedRowCount:j6}},$6={moduleName:"ScrollApi",version:$,apiFunctions:{getVerticalPixelRange:oM,getHorizontalPixelRange:nM,ensureColumnVisible:Qm,ensureIndexVisible:Jm,ensureNodeVisible:rM}};function K6(e,t,s){if(!t)return;const i=e.ctrlsSvc.getGridBodyCtrl().eGridBody,o=`aria-${t}`;s===null?i.removeAttribute(o):i.setAttribute(o,s)}function q6(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function Y6(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function Z6(e){return e.animationFrameSvc?.isQueueEmpty()??!0}function X6(e){e.animationFrameSvc?.flushAllFrames()}function Q6(e){return{rowHeight:di(e),headerHeight:kn(e)}}function J6(e,t={}){const s=[];for(const n of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const r=n.getCellRenderer();r!=null&&s.push(Cn(r))}if(t.columns?.length)return s;const i=[],o=qc(t.rowNodes);for(const n of e.rowRenderer.getAllRowCtrls()){if(o&&!Yc(n.rowNode,o)||!n.isFullWidth())continue;const r=n.getFullWidthCellRenderers();for(let a=0;a<r.length;a++){const l=r[a];l!=null&&i.push(Cn(l))}}return[...i,...s]}var eI={moduleName:"RenderApi",version:$,apiFunctions:{setGridAriaProperty:K6,refreshCells:q6,refreshHeader:Y6,isAnimationFrameQueueEmpty:Z6,flushAllAnimationFrames:X6,getSizesForCurrentTheme:Q6,getCellRendererInstances:J6}};function tI(e,t){typeof t=="number"?e.colAutosize?.sizeColumnsToFit(t,"api"):e.colAutosize?.sizeColumnsToFitGridBody(t)}function gC({colAutosize:e,visibleCols:t},s,i){Array.isArray(s)?e?.autoSizeCols({colKeys:s,skipHeader:i,source:"api"}):e?.autoSizeCols({...s,colKeys:s.colIds??t.allCols,source:"api"})}function sI(e,t){t&&typeof t=="object"?gC(e,t):e.colAutosize?.autoSizeAllColumns({source:"api",skipHeader:t})}var iI=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 i=t.type;if(i==="fitGridWidth"||i==="fitProvidedWidth")s=!0;else if(i==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const o=e.get("rowData");s=o!=null&&o.length>0&&$e(e)}s&&this.beans.colDelayRenderSvc?.hideColumns(i)}}autoSizeCols(e){const{eventSvc:t,visibleCols:s}=this.beans;this.innerAutoSizeCols(e).then(i=>{const o=c=>go(t,Array.from(c),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return o(i);const n=lg(this.beans),r=c=>s.leftCols.some(d=>en(d,c)),a=c=>s.rightCols.some(d=>en(d,c)),l=e.colKeys.filter(c=>!Ps(c)&&!bs(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}),o(i)})}innerAutoSizeCols(e){return new Promise((t,s)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,s));const{colKeys:i,skipHeader:o,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 w=new Set;let v=-1;const b=Object.fromEntries(c.map(({colId:x,...F})=>[x,F])),S=o??this.gos.get("skipHeaderOnAutoSize"),y=n??S;for(;v!==0;){v=0;const x=[];for(const F of i){if(!F||mS(F))continue;const R=p.getCol(F);if(!R||w.has(R))continue;const E=f.getPreferredWidthForColumn(R,S);if(E>0){const P=b[R.colId]??{};P.minWidth??(P.minWidth=l),P.maxWidth??(P.maxWidth=a);const M=oI(R,E,P);R.setActualWidth(M,d),w.add(R),v++}x.push(R)}x.length&&C.refresh(d)}y||this.autoSizeColumnGroupsByColumns(i,d,r),t(w)})}autoSizeColumn(e,t,s){this.autoSizeCols({colKeys:[e],skipHeader:s,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,s){const{colModel:i,ctrlsSvc:o}=this.beans,n=new Set,r=i.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 o.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"),i=()=>{this.autoSizeColumn(t,"uiColumnResized",s)};e.addEventListener("dblclick",i);const o=new ti(e);return o.addEventListener("doubleTap",i),()=>{e.removeEventListener("dblclick",i),o.destroy()}}addColumnGroupResize(e,t,s){const i=this.gos.get("skipHeaderOnAutoSize"),o=()=>{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:i,stopAtGroup:t,source:"uiColumnResized"}),s()};return e.addEventListener("dblclick",o),()=>e.removeEventListener("dblclick",o)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const s=lg(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):B(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",s,i){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,s,i));return}const o={};for(const{key:f,...C}of i?.columnLimits??[])o[typeof f=="string"?f:f.getColId()]=C;const n=this.beans.visibleCols.allCols;if(e<=0||!n.length)return;const r=fs(n);if(i?.onlyScaleUp&&r>e||e===r&&n.every(C=>{if(C.colDef.suppressSizeToFit)return!0;const w=o?.[C.getId()],v=w?.minWidth??i?.defaultMinWidth,b=w?.maxWidth??i?.defaultMaxWidth,S=C.getActualWidth();return(v==null||S>=v)&&(b==null||S<=b)}))return;const l=[],c=[];for(const f of n){const C=i?.colKeys?.some(w=>en(f,w))??!0;f.getColDef().suppressSizeToFit||!C?c.push(f):l.push(f)}const d=l.slice(0);let u=!1;const h=f=>{qt(l,f),c.push(f)};for(const f of l){f.resetActualWidth(t);const C=o?.[f.getId()],w=C?.minWidth??i?.defaultMinWidth,v=C?.maxWidth??i?.defaultMaxWidth,b=f.getActualWidth();typeof w=="number"&&b<w?f.setActualWidth(w,t,!0):typeof v=="number"&&b>v&&f.setActualWidth(v,t,!0)}for(;!u;){u=!0;const f=e-fs(c);if(f<=0)for(const C of l){const w=o?.[C.getId()]?.minWidth??i?.defaultMinWidth??C.minWidth;C.setActualWidth(w,t,!0)}else{const C=f/fs(l);let w=f;for(let v=l.length-1;v>=0;v--){const b=l[v],S=o?.[b.getId()],y=S?.minWidth??i?.defaultMinWidth,x=S?.maxWidth??i?.defaultMaxWidth,F=b.getMinWidth(),R=b.getMaxWidth(),E=typeof y=="number"&&y>F?y:F,P=typeof x=="number"&&x<R?x:R;let M=Math.round(b.getActualWidth()*C);M<E?(M=E,h(b),u=!1):M>P?(M=P,h(b),u=!1):v===0&&(M=w),b.setActualWidth(M,t,!0),w-=M}}}for(const f of d)f.fireColumnWidthChangedEvent(t);const p=this.beans.visibleCols;p.setLeftValues(t),p.updateBodyWidths(),!s&&go(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 i=s.type;if(i==="fitGridWidth"){const{columnLimits:o,defaultMinWidth:n,defaultMaxWidth:r}=s,a=o?.map(({colId:l,minWidth:c,maxWidth:d})=>({key:l,minWidth:c,maxWidth:d}));this.sizeColumnsToFitGridBody({defaultMinWidth:n,defaultMaxWidth:r,columnLimits:a})}else i==="fitProvidedWidth"&&this.sizeColumnsToFit(s.width,"sizeColumnsToFit");t?.revealColumns(i)})}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 oI(e,t,s={}){const i=s.minWidth??e.getMinWidth();t<i&&(t=i);const o=s.maxWidth??e.getMaxWidth();return t>o&&(t=o),t}function lg({ctrlsSvc:e,scrollVisibleSvc:t}){const s=e.getGridBodyCtrl(),o=s.isVerticalScrollShowing()?t.getScrollbarWidth():0;return gn(s.eGridBody)-o}var nI={moduleName:"ColumnAutoSize",version:$,beans:[iI],apiFunctions:{sizeColumnsToFit:tI,autoSizeColumns:gC,autoSizeAllColumns:sI},dependsOn:[am]},rI=".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 aI(e){return e.pinnedRowModel?.getPinnedTopRowCount()??0}function lI(e){return e.pinnedRowModel?.getPinnedBottomRowCount()??0}function cI(e,t){return e.pinnedRowModel?.getPinnedTopRow(t)}function dI(e,t){return e.pinnedRowModel?.getPinnedBottomRow(t)}function uI(e,t,s){return e.pinnedRowModel?.forEachPinnedRow(t,s)}var hI={moduleName:"PinnedRow",version:$,beans:[C2],css:[rI],apiFunctions:{getPinnedTopRowCount:aI,getPinnedBottomRowCount:lI,getPinnedTopRow:cI,getPinnedBottomRow:dI,forEachPinnedRow:uI},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},gI=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}},pI=class extends A{constructor(e){super(),this.column=e}buildCache(e){const{column:t,beans:{gos:s,pinnedRowModel:i,rowModel:o,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,w;const v=(S,y)=>{f=S,C=null,w=y},b=S=>{const y=!S.isExpandable()&&!S.group&&!S.detail&&(d?!d({rowNode:S}):!0);if(S.rowIndex==null||!y){v(null,null);return}if(f==null||S.level!==f.level||S.footer||C&&S.rowIndex-1!==C?.getLastNode().rowIndex){v(S,n.getValue(t,S));return}const x=n.getValue(t,S);if(p){const F=ue(s,{valueA:w,nodeA:f,valueB:x,nodeB:S,column:t,colDef:a});if(!h(F)){v(S,x);return}}else if(u?!u(w,x):w!==x){v(S,x);return}if(!C){const F=l?.get(f);F?.firstNode===f?(F.reset(),C=F):C=new gI(t,f),c.set(f,C)}C.addSpannedNode(S),c.set(S,C)};switch(e){case"center":o.forEachDisplayedNode?.(S=>{(!r||r.isRowInPage(S.rowIndex))&&b(S)}),this.centerValueNodeMap=c;break;case"top":i?.forEachPinnedRow("top",b),this.topValueNodeMap=c;break;case"bottom":i?.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}}},fI=class extends A{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=nt(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=nt(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 pI(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,i=e.column,o=e.rowIndex,n=this.spanningColumns.get(i);if(!n)return;let r;switch(e.rowPinned){case"top":r=t?.getPinnedTopRow(o);break;case"bottom":r=t?.getPinnedBottomRow(o);break;default:r=s.getRow(o)}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,i]of this.spanningColumns)if(i.isCellSpanning(e)){const o=i.getCellSpan(e);t(s,o)}}destroy(){super.destroy(),this.spanningColumns.clear()}},mI=class extends ao{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,i,o,n,r){this.eWrapper=s,super.setComp(e,t,s,i,o,n,r),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||gp(e,t.rowIndex)}setAriaRowSpan(){l0(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(Ma(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}},CI=class extends na{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 mI(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(){}},vI=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),i=s.size,o=this.getAllRelevantRowControls(e),n=new Map;let r=!1;for(const l of o)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 CI(d.firstNode,this.beans,!1,!1,!1);n.set(d.firstNode,h)});this.setCtrlsMap(e,n);const a=n.size===i;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 i=this.getCtrlsMap(e.rowPinned).get(s.firstNode);if(i)return i.getAllCellCtrls().find(o=>o.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")}},wI={moduleName:"CellSpan",version:$,beans:[fI,vI]},bI=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,i=s.cellClassRules,o=this.getCellClassParams(e,s);Zd(this.beans.expressionSvc,i===this.cellClassRules?void 0:this.cellClassRules,i,o,n=>t.toggleCss(n,!0),n=>t.toggleCss(n,!1)),this.cellClassRules=i}applyUserStyles(){const e=this.column,t=e.colDef,s=t.cellStyle;if(!s)return;let i;if(typeof s=="function"){const o=this.getCellClassParams(e,t);i=s(o)}else i=s;i&&this.cellComp.setUserStyles(i)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,s=e.colDef,i=this.getCellClassParams(e,s);for(const n of this.staticClasses)t.toggleCss(n,!1);const o=this.beans.cellStyles.getStaticCellClasses(s,i);this.staticClasses=o;for(const n of o)t.toggleCss(n,!0)}getCellClassParams(e,t){const{value:s,rowNode:i}=this.cellCtrl;return ue(this.beans.gos,{value:s,data:i.data,node:i,colDef:t,column:e,rowIndex:i.rowIndex})}},SI=class extends A{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,s,i){Zd(this.beans.expressionSvc,void 0,e.cellClassRules,t,s,i),this.processStaticCellClasses(e,t,s)}getStaticCellClasses(e,t){const{cellClass:s}=e;if(!s)return[];let i;return typeof s=="function"?i=s(t):i=s,typeof i=="string"&&(i=[i]),i||[]}createCellCustomStyleFeature(e,t){return new bI(e,t)}processStaticCellClasses(e,t,s){this.getStaticCellClasses(e,t).forEach(o=>{s(o)})}},yI={moduleName:"CellStyle",version:$,beans:[SI]},xI={moduleName:"RowStyle",version:$,beans:[lP]};function RI(e,t){return!!e.colHover?.isHovered(t)}var FI=class extends A{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=s=>{const{beans:i,gos:o,element:n,columns:r}=this,a=i.colHover;if(s??!!o.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}},EI="ag-column-hover",DI=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 i=()=>{const o=this.isHovered(s);t.toggleCss("ag-column-hover",o)};e.addManagedEventListeners({columnHoverChanged:i}),i()}onCellColumnHover(e,t){if(!t)return;const s=this.isHovered(e);t.toggleCss(EI,s)}addHeaderFilterColumnHoverListener(e,t,s,i){this.createHoverFeature(e,[s],i);const o=()=>{const n=this.isHovered(s);t.toggleCss("ag-column-hover",n)};e.addManagedEventListeners({columnHoverChanged:o}),o()}createHoverFeature(e,t,s){e.createManagedBean(new FI(t,s))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},PI={moduleName:"ColumnHover",version:$,beans:[DI],apiFunctions:{isColumnHovered:RI}},MI=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,i=!Lr.has(e),o=i?this.asyncListeners:this.syncListeners;o.has(e)||o.set(e,new Set),o.get(e).add(s),this.eventSvc.addListener(e,s,i)}removeListener(e,t){const s=this.wrapSvc?.unwrap(e,t)??t,o=!!this.asyncListeners.get(e)?.delete(s);o||this.syncListeners.get(e)?.delete(s),this.eventSvc.removeListener(e,s,o)}addGlobalListener(e){const t=this.wrapSvc?.wrapGlobal(e)??e,s=(n,r)=>{Lr.has(n)&&t(n,r)},i=(n,r)=>{Lr.has(n)||t(n,r)};this.globalListenerPairs.set(e,{syncListener:s,asyncListener:i});const o=this.eventSvc;o.addGlobalListener(s,!1),o.addGlobalListener(i,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:s,globalListenerPairs:i}=this,o=s?.unwrapGlobal(e)??e;if(i.has(o)){const{syncListener:r,asyncListener:a}=i.get(o);t.removeGlobalListener(r,!1),t.removeGlobalListener(a,!0),i.delete(e)}else this.syncGlobalListeners.delete(o),t.removeGlobalListener(o,!1)}destroyEventListeners(e,t){e.forEach((s,i)=>{s.forEach(o=>this.eventSvc.removeListener(i,o,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:i})=>{t.removeGlobalListener(s,!1),t.removeGlobalListener(i,!0)}),e.clear()}};function TI(e,t,s){e.apiEventSvc?.addListener(t,s)}function II(e,t,s){e.apiEventSvc?.removeListener(t,s)}function kI(e,t){e.apiEventSvc?.addGlobalListener(t)}function AI(e,t){e.apiEventSvc?.removeGlobalListener(t)}var LI={moduleName:"EventApi",version:$,apiFunctions:{addEventListener:TI,addGlobalListener:kI,removeEventListener:II,removeGlobalListener:AI},beans:[MI]},OI={moduleName:"Locale",version:$,beans:[l5]},NI=class extends A{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=nt(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){const{visibleCols:e,rowModel:t,rowSpanSvc:s,pinnedRowModel:i}=this.beans,o=e.autoHeightCols;let n=!1;const r=a=>{const l=a.__autoHeights;let c=js(this.beans,a).height;for(const d of o){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)};i?.forEachPinnedRow?.("top",r),i?.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 i=e.__autoHeights[s.getId()];e.__autoHeights[s.getId()]=t,i!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:s,colViewport:i,visibleCols:o}=this.beans;if(!s.colSpanActive)return!1;let n=[];switch(e.getPinned()){case"left":n=o.getLeftColsForRow(t);break;case"right":n=o.getRightColsForRow(t);break;case null:n=i.getColsWithinViewport(t);break}return!n.includes(e)}setupCellAutoHeight(e,t,s){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const i=t.parentElement,{rowNode:o,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}=Ei(i),C=u+h+p+f,v=t.offsetHeight+C;if(d<5){const S=!tt(r)?.contains(t),y=v==0;if(S||y){window.setTimeout(()=>a(d+1),0);return}}this.setRowAutoHeight(o,v,n)},l=()=>a(0);l();const c=Es(r,t,l);return s.addDestroyFunc(()=>{c(),this.setRowAutoHeight(o,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(o=>o.isAutoHeight())),t.length!==0){if(!s.__autoHeights)return!1;for(const i of t){const o=s.__autoHeights[i.getColId()];if(!o||s.rowHeight<o)return!1}}return!0}},HI={moduleName:"RowAutoHeight",version:$,beans:[NI]},GI={moduleName:"AllCommunity",version:$,dependsOn:[NT,jT,e6,D5,HM,GM,BM,VM,zM,WM,_M,NM,M4,T4,I4,P4,A4,L4,m6,pT,O6,lm,U6,$6,eI,nI,fF,hI,oT,jP,yI,PI,xI,LI,KP,d6,Xm,OI,HI,pF,HT,wI]},ht=g.createContext({}),pC=g.createContext("default"),Ln=(e,t,s,i)=>{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),cg(i,r)}),()=>{l=!0,r&&(a?.remove(),t.destroyBean(r),i&&cg(i,void 0))}},cg=(e,t)=>{if(e)if(e instanceof Function)e(t);else{const s=e;s.current=t}},Nt=(...e)=>e.filter(s=>s!=null&&s!=="").join(" "),zt=class fC{constructor(...t){this.classesMap={};for(const s of t)this.classesMap[s]=!0}setClass(t,s){if(!!this.classesMap[t]==s)return this;const o=new fC;return o.classesMap={...this.classesMap},o.classesMap[t]=s,o}toString(){return Object.keys(this.classesMap).filter(s=>this.classesMap[s]).join(" ")}},Fo=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()},ed=g.version?.split(".")[0],mC=ed==="16"||ed==="17";function BI(){return ed==="19"}var Nr=!1;function VI(e){return Nr||setTimeout(()=>Nr=!1,0),Nr=!0,e()}var yn=(e,t)=>{!mC&&e&&!Nr?Rn.flushSync(t):t()},zI=e=>{mC?e():g.startTransition(e)};function WI(e,t,s){return g.useSyncExternalStore?g.useSyncExternalStore(e,t):s}function la(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 i=[],o=[],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)&&i.push(l)}for(let a=0;a<t.length;a++){const l=t[a],c=l.instanceId;n.has(c)||o.push(l)}return i.length===e.length&&o.length===0?e:i.length===0&&o.length===t.length?t:i.length===0?o:o.length===0?i:[...i,...o]}var CC=g.forwardRef((e,t)=>{const{registry:s,context:i}=g.useContext(ht),o=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(),[w,v]=g.useState(()=>new zt),[b,S]=g.useState(()=>new zt("ag-hidden")),[y,x]=g.useState(()=>new zt("ag-hidden")),[F,R]=g.useState(()=>new zt("ag-invisible"));g.useImperativeHandle(t,()=>({refresh(){return!1}})),g.useLayoutEffect(()=>Ln(d,i,n.current),[d]);const E=g.useCallback(Q=>{if(o.current=Q,!Q||i.isDestroyed()){c.current=i.destroyBean(c.current);return}const L={setInnerRenderer:(W,ee)=>{u(W),C(ee)},setChildCount:W=>p(W),toggleCss:(W,ee)=>v(Y=>Y.setClass(W,ee)),setContractedDisplayed:W=>x(ee=>ee.setClass("ag-hidden",!W)),setExpandedDisplayed:W=>S(ee=>ee.setClass("ag-hidden",!W)),setCheckboxVisible:W=>R(ee=>ee.setClass("ag-invisible",!W)),setCheckboxSpacing:W=>R(ee=>ee.setClass("ag-group-checkbox-spacing",W))},re=s.createDynamicBean("groupCellRendererCtrl",!0);re&&(c.current=i.createBean(re),c.current.init(L,Q,r.current,a.current,l.current,CC,e))},[]),P=g.useMemo(()=>`ag-cell-wrapper ${w.toString()}`,[w]),M=g.useMemo(()=>`ag-group-expanded ${b.toString()}`,[b]),D=g.useMemo(()=>`ag-group-contracted ${y.toString()}`,[y]),I=g.useMemo(()=>`ag-group-checkbox ${F.toString()}`,[F]),V=d?.componentFromFramework,N=V?d.componentClass:void 0,O=d==null&&f!=null,q=yo(f);return g.createElement("span",{className:P,ref:E,...e.colDef?{}:{role:c.current?.getCellAriaRole()}},g.createElement("span",{className:M,ref:a}),g.createElement("span",{className:D,ref:l}),g.createElement("span",{className:I,ref:r}),g.createElement("span",{className:"ag-group-value",ref:n},O?q:V?g.createElement(N,{...d.params}):null),g.createElement("span",{className:"ag-group-child-count"},h))}),dg=CC,ou=g.createContext({setMethods:()=>{}}),_I=e=>{const{initialProps:t,addUpdateCallback:s,CustomComponentClass:i,setMethods:o}=e,[{key:n,...r},a]=g.useState(t);return g.useEffect(()=>{s(l=>a(l))},[]),g.createElement(ou.Provider,{value:{setMethods:o}},g.createElement(i,{key:n,...r}))},jI=g.memo(_I),UI=0;function ug(){return`agPortalKey_${++UI}`}var vC=class{constructor(e,t,s,i){this.portal=null,this.oldPortal=null,this.reactComponent=e,this.portalManager=t,this.componentType=s,this.suppressFallbackMethods=!!i,this.statelessComponent=this.isStateless(this.reactComponent),this.key=ug(),this.portalKey=ug(),this.instanceCreated=this.isStatelessComponent()?De.resolve(!1):new De(o=>{this.resolveInstanceCreated=o})}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 i=s[e];if(i)return i.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 De(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=Rn.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 Oa(e,t,s){for(const i of e){const o=t[i];o&&(s[i]=o)}}var It=class extends vC{constructor(){super(...arguments),this.awaitUpdateCallback=new De(e=>{this.resolveUpdateCallback=e}),this.wrapperComponent=jI}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 De(i=>{setTimeout(()=>{i()})})),this.resolveUpdateCallback()}})}setMethods(e){this.providedMethods=e,Oa(this.getOptionalMethods(),this.providedMethods,this)}getOptionalMethods(){return[]}getProps(){return{...this.sourceParams,key:this.key,ref:this.ref}}refreshProps(){return this.updateCallback?this.updateCallback():new De(e=>this.awaitUpdateCallback.then(()=>{this.updateCallback().then(()=>e())}))}},$I=class extends It{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},KI=class extends It{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}},qI=class extends It{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:i}=this;return e.label=t,e.icon=s,e.shake=i,e}},YI=class extends It{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 De(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 De(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}},ZI=class extends It{constructor(){super(...arguments),this.awaitSetMethodsCallback=new De(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 wC(e,t){e.parentFilterInstance(s=>{(s.setModel(t)||De.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){Oa(this.getOptionalMethods(),e,this)}getOptionalMethods(){return["afterGuiAttached"]}updateModel(e){this.model=e,this.refreshProps(),wC(this.floatingFilterParams,e)}},QI=class extends It{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(),wC(this.sourceParams,e)}getProps(){const e=super.getProps();return e.model=this.model,e.onModelChange=this.onModelChange,e}},JI=class extends It{refresh(e){this.sourceParams=e,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached"]}},ek=class extends It{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},tk=class extends It{refresh(e){this.sourceParams=e,this.refreshProps()}},sk=class extends It{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}},ik=class extends It{refresh(e){this.sourceParams=e,this.refreshProps()}},ok=class extends It{refresh(e){return this.sourceParams=e,this.refreshProps(),!0}},nk=class extends It{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 nu(){B(231)}var rk=1e3,ak=class{constructor(e,t,s){this.destroyed=!1,this.portals=[],this.hasPendingPortalUpdate=!1,this.wrappingElement=t||"div",this.refresher=e,this.maxComponentCreationTimeMs=s||rk}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){yn(!0,()=>this.refresher()),e.rendered()&&t(e);return}window.setTimeout(()=>{this.waitForInstance(e,t,s)})}}},lk=({ctrl:e})=>{const t=e.isAlive(),{context:s}=g.useContext(ht),[i,o]=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 Mn(()=>l.current));const p=g.useCallback(v=>{if(l.current=v,!v||!e.isAlive()||s.isDestroyed()){a.current=s.destroyBean(a.current);return}a.current=s.createBean(new xo);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?u0(l.current,y):h0(l.current))},setUserCompDetails:y=>o(y),getUserCompInstance:()=>u.current||void 0,refreshSelectAllGui:b,removeSelectAllGui:()=>e.getSelectAllGui()?.remove()};e.setComp(S,v,c.current,d.current,a.current),b()},[]);g.useLayoutEffect(()=>Ln(i,s,d.current,u),[i]),g.useEffect(()=>{e.setDragSource(l.current)},[i]);const f=g.useMemo(()=>!!(i?.componentFromFramework&&Fo(i.componentClass)),[i]),C=i?.componentFromFramework,w=i?.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(w,{...i.params}):g.createElement(w,{...i.params,ref:u}):null))},ck=g.memo(lk),dk=class{constructor(e,t){this.floatingFilterParams=e,this.refreshProps=t}getProps(){return this.floatingFilterParams}refresh(e){this.floatingFilterParams=e,this.refreshProps()}setMethods(e){Oa(this.getOptionalMethods(),e,this)}getOptionalMethods(){return["afterGuiAttached"]}},uk=({ctrl:e})=>{const{context:t,gos:s}=g.useContext(ht),[i,o]=g.useState(),[n,r]=g.useState(()=>new zt("ag-header-cell","ag-floating-filter")),[a,l]=g.useState(()=>new zt),[c,d]=g.useState(()=>new zt("ag-floating-filter-button","ag-hidden")),[u,h]=g.useState("false"),[p,f]=g.useState(),[,C]=g.useState(1),w=g.useRef(),v=g.useRef(null),b=g.useRef(null),S=g.useRef(null),y=g.useRef(null),x=g.useRef(),F=g.useRef(),R=W=>{W!=null&&x.current&&x.current(W)},E=g.useCallback(W=>{if(v.current=W,!W||!e.isAlive()||t.isDestroyed()){w.current=t.destroyBean(w.current);return}w.current=t.createBean(new xo),F.current=new De(Y=>{x.current=Y});const ee={toggleCss:(Y,Z)=>r(j=>j.setClass(Y,Z)),setUserStyles:Y=>o(Y),addOrRemoveBodyCssClass:(Y,Z)=>l(j=>j.setClass(Y,Z)),setButtonWrapperDisplayed:Y=>{d(Z=>Z.setClass("ag-hidden",!Y)),h(Y?"false":"true")},setWidth:Y=>{v.current&&(v.current.style.width=Y)},setCompDetails:Y=>f(Y),getFloatingFilterComp:()=>F.current?F.current:null,setMenuIcon:Y=>y.current?.appendChild(Y)};e.setComp(ee,W,y.current,b.current,w.current)},[]);g.useLayoutEffect(()=>Ln(p,t,b.current,R),[p]);const P=g.useMemo(()=>n.toString(),[n]),M=g.useMemo(()=>a.toString(),[a]),D=g.useMemo(()=>c.toString(),[c]),I=g.useMemo(()=>!!(p&&p.componentFromFramework&&Fo(p.componentClass)),[p]),V=g.useMemo(()=>s.get("reactiveCustomComponents"),[]),N=g.useMemo(()=>s.get("enableFilterHandlers"),[]),[O,q]=g.useState();g.useEffect(()=>{if(p?.componentFromFramework)if(V){const W=N?dk:XI,ee=new W(p.params,()=>C(Y=>Y+1));R(ee),q(ee)}else nu()},[p]);const Q=O?.getProps(),L=p?.componentFromFramework,re=p?.componentClass;return g.createElement("div",{ref:E,style:i,className:P,role:"gridcell"},g.createElement("div",{ref:b,className:M,role:"presentation"},L?V?Q&&g.createElement(ou.Provider,{value:{setMethods:W=>O.setMethods(W)}},g.createElement(re,{...Q})):g.createElement(re,{...p.params,ref:I?()=>{}:R}):null),g.createElement("div",{ref:S,"aria-hidden":u,className:D,role:"presentation"},g.createElement("button",{ref:y,type:"button",className:"ag-button ag-floating-filter-button-button",tabIndex:-1})))},hk=g.memo(uk),gk=({ctrl:e})=>{const{context:t}=g.useContext(ht),[s,i]=g.useState(),[o,n]=g.useState(()=>new zt),[r,a]=g.useState(()=>new zt),[l,c]=g.useState("false"),[d,u]=g.useState(),[h,p]=g.useState(),f=g.useRef(),C=g.useRef(null),w=g.useRef(null),v=g.useRef(null),b=g.useRef(),S=g.useCallback(P=>{if(C.current=P,!P||!e.isAlive()||t.isDestroyed()){f.current=t.destroyBean(f.current);return}f.current=t.createBean(new xo);const M={setWidth:D=>{C.current&&(C.current.style.width=D)},toggleCss:(D,I)=>n(V=>V.setClass(D,I)),setUserStyles:D=>i(D),setHeaderWrapperHidden:D=>{const I=v.current;I&&(D?I.style.setProperty("display","none"):I.style.removeProperty("display"))},setHeaderWrapperMaxHeight:D=>{const I=v.current;I&&(D!=null?I.style.setProperty("max-height",`${D}px`):I.style.removeProperty("max-height"),I.classList.toggle("ag-header-cell-comp-wrapper-limited-height",D!=null))},setUserCompDetails:D=>p(D),setResizableDisplayed:D=>{a(I=>I.setClass("ag-hidden",!D)),c(D?"false":"true")},setAriaExpanded:D=>u(D),getUserCompInstance:()=>b.current||void 0};e.setComp(M,P,w.current,v.current,f.current)},[]);g.useLayoutEffect(()=>Ln(h,t,v.current),[h]),g.useEffect(()=>{C.current&&e.setDragSource(C.current)},[h]);const y=g.useMemo(()=>!!(h?.componentFromFramework&&Fo(h.componentClass)),[h]),x=g.useMemo(()=>"ag-header-group-cell "+o.toString(),[o]),F=g.useMemo(()=>"ag-header-cell-resize "+r.toString(),[r]),R=h?.componentFromFramework,E=h?.componentClass;return g.createElement("div",{ref:S,style:s,className:x,role:"columnheader","aria-expanded":d},g.createElement("div",{ref:v,className:"ag-header-cell-comp-wrapper",role:"presentation"},R?y?g.createElement(E,{...h.params}):g.createElement(E,{...h.params,ref:b}):null),g.createElement("div",{ref:w,"aria-hidden":l,className:F}))},pk=g.memo(gk),fk=({ctrl:e})=>{const{gos:t,context:s}=g.useContext(ht),{topOffset:i,rowHeight:o}=g.useMemo(()=>e.getTopAndHeight(),[]),n=g.useMemo(()=>t.get("tabIndex"),[]),[r,a]=g.useState(()=>e.getAriaRowIndex()),l=e.headerRowClass,[c,d]=g.useState(()=>o+"px"),[u,h]=g.useState(()=>i+"px"),p=g.useRef(null),[f,C]=g.useState(()=>e.getUpdatedHeaderCtrls()),w=g.useRef(),v=g.useRef(null),b=g.useCallback(x=>{if(v.current=x,!x||!e.isAlive()||s.isDestroyed()){w.current=s.destroyBean(w.current);return}w.current=s.createBean(new xo);const F={setHeight:R=>d(R),setTop:R=>h(R),setHeaderCtrls:(R,E,P)=>{const M=p.current,D=la(M,R,E);D!==M&&(p.current=D,yn(P,()=>C(D)))},setWidth:R=>{v.current&&(v.current.style.width=R)},setRowIndex:R=>{a(R)}};e.setComp(F,w.current,!1)},[]),S=g.useMemo(()=>({height:c,top:u}),[c,u]),y=g.useCallback(x=>{switch(e.type){case"group":return g.createElement(pk,{ctrl:x,key:x.instanceId});case"filter":return g.createElement(hk,{ctrl:x,key:x.instanceId});default:return g.createElement(ck,{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))},mk=g.memo(fk),Ck=({pinned:e})=>{const[t,s]=g.useState(!0),[i,o]=g.useState([]),{context:n}=g.useContext(ht),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 w={setDisplayed:s,setCtrls:v=>o(v),setCenterWidth:v=>{a.current&&(a.current.style.width=v)},setViewportScrollLeft:v=>{r.current&&(r.current.scrollLeft=v)},setPinnedContainerWidth:v=>{r.current&&(r.current.style.width=v,r.current.style.minWidth=v,r.current.style.maxWidth=v)}};l.current.setComp(w,r.current)},[]),p=t?"":"ag-hidden",f=()=>i.map(C=>g.createElement(mk,{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},sc=g.memo(Ck),vk=()=>{const[e,t]=g.useState(()=>new zt),[s,i]=g.useState(),{context:o}=g.useContext(ht),n=g.useRef(null),r=g.useRef(),a=g.useCallback(d=>{if(n.current=d,!d||o.isDestroyed()){r.current=o.destroyBean(r.current);return}r.current=o.createBean(new KR);const u={toggleCss:(h,p)=>t(f=>f.setClass(h,p)),setHeightAndMinHeight:h=>i(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(sc,{pinned:"left"}),g.createElement(sc,{pinned:null}),g.createElement(sc,{pinned:"right"}))},wk=g.memo(vk),bk=(e,t)=>{g.useEffect(()=>{const s=t.current;if(s){const i=s.parentElement;if(i){const o=document.createComment(e);return i.insertBefore(o,s),()=>{o.remove()}}}},[e])},si=bk,Sk=class{constructor(e,t){this.cellEditorParams=e,this.refreshProps=t,this.instanceCreated=new De(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){Oa(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()}},yk=e=>{const t=g.useRef(e),s=g.useRef(),i=g.useRef(!1),o=g.useRef(!1),[,n]=g.useState(0);i.current&&(o.current=!0),g.useEffect(()=>(i.current||(s.current=t.current(),i.current=!0),n(r=>r+1),()=>{o.current&&s.current?.()}),[])},xk=e=>{const[t,s]=g.useState(),i=g.useContext(ht),{context:o,popupSvc:n,gos:r,editSvc:a}=i,{editDetails:l,cellCtrl:c,eParentCell:d}=e;return yk(()=>{const{compDetails:u}=l,h=r.get("stopEditingWhenCellsLoseFocus");let p,f;if(!o.isDestroyed()){f=o.createBean(a.createPopupEditorWrapper(u.params));const C=f.getGui();if(e.jsChildComp){const x=e.jsChildComp.getGui();x&&C.appendChild(x)}const{column:w,rowNode:v}=c,b={column:w,rowNode:v,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?.(),o.destroyBean(f)}}),g.useLayoutEffect(()=>()=>{c.isCellFocused()&&t?.getGui().contains(je(i))&&d.focus({preventScroll:!0})},[t]),t&&e.wrappedContent?Rn.createPortal(e.wrappedContent,t.getGui()):null},hg=g.memo(xk),Rk=(e,t,s)=>{const{compProxy:i}=e;s(i);const o=i.getProps(),n=Fo(t);return g.createElement(ou.Provider,{value:{setMethods:r=>i.setMethods(r)}},n?g.createElement(t,{...o}):g.createElement(t,{...o,ref:r=>i.setRef(r)}))},gg=(e,t,s)=>e.compProxy?Rk(e,t,s):g.createElement(t,{...e.compDetails.params,ref:s}),Fk=(e,t,s,i,o)=>{const n=e.compDetails,r=n.componentClass,a=n.componentFromFramework&&!e.popup,l=n.componentFromFramework&&e.popup,c=!n.componentFromFramework&&e.popup;return a?gg(e,r,t):l?g.createElement(hg,{editDetails:e,cellCtrl:i,eParentCell:s,wrappedContent:gg(e,r,t)}):c&&o?g.createElement(hg,{editDetails:e,cellCtrl:i,eParentCell:s,jsChildComp:o}):null},Ek=(e,t,s,i,o,n)=>{const{context:r}=g.useContext(ht),a=g.useCallback(()=>{const l=o.current;if(!l)return;const c=l.getGui();c&&c.parentElement&&c.remove(),r.destroyBean(l),o.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(o.current){const f=o.current,w=f.refresh!=null&&e.force==!1?f.refresh(h.params):!1;if(w===!0||w===void 0)return;a()}h.newAgStackInstance().then(f=>{if(!f)return;const C=f.getGui();if(!C)return;(t?s:n.current).appendChild(C),o.current=f})},[e,t,i]),g.useEffect(()=>a,[])},bC=Ek,Dk=({cellCtrl:e,parent:t})=>{const s=g.useRef(),i=g.useMemo(()=>{const{loadingComp:o}=e.getDeferLoadingCellRenderer();return o?{value:void 0,compDetails:o,force:!1}:void 0},[e]);if(bC(i,!1,void 0,1,s,t),i?.compDetails?.componentFromFramework){const o=i.compDetails.componentClass;return g.createElement(o,{...i.compDetails.params})}return g.createElement(g.Fragment,null)},Pk=({cellCtrl:e,printLayout:t,editingCell:s})=>{const i=g.useContext(ht),{context:o}=i,{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(),[w,v]=g.useState(!1),[b,S]=g.useState(!1),[y,x]=g.useState(!1),[F,R]=g.useState(),E=g.useMemo(()=>e.isForceWrapper(),[e]),P=g.useMemo(()=>e.getCellAriaRole(),[e]),M=g.useRef(null),D=g.useRef(null),I=g.useRef(null),V=g.useRef(),N=g.useRef(),O=g.useRef(),q=g.useRef([]),Q=g.useRef(),L=g.useRef(),[re,W]=g.useState(0),ee=g.useCallback(ie=>{L.current=ie,W(be=>be+1)},[]),Y=l!=null&&(w||y||b)&&(d==null||!!d.popup),Z=E||Y,j=g.useMemo(()=>e.getCellValueClass(),[e]),fe=g.useCallback(ie=>{if(N.current=ie,ie){const be=ie.isCancelBeforeStart&&ie.isCancelBeforeStart();setTimeout(()=>{be?(e.stopEditing(!0),e.focusCell(!0)):(e.cellEditorAttached(),e.enableEditorTooltipFeature(ie))})}},[e]),Ce=g.useRef();Ce.current||(Ce.current=new Mn(()=>M.current)),bC(l,Z,L.current,re,V,M);const k=g.useRef();g.useLayoutEffect(()=>{const ie=k.current,be=l;if(k.current=l,ie==null||ie.compDetails==null||be==null||be.compDetails==null)return;Q.current?.refreshVisibility();const Re=ie.compDetails,ke=be.compDetails;if(Re.componentClass!=ke.componentClass||I.current?.refresh==null)return;I.current.refresh(ke.params)!=!0&&p(ve=>ve+1)},[l]),g.useLayoutEffect(()=>{if(!(d&&!d.compDetails.componentFromFramework)||o.isDestroyed())return;const be=d.compDetails,Re=d.popup===!0,ke=be.newAgStackInstance();return ke.then(me=>{if(!me)return;const ve=me.getGui();fe(me),Re||((E?O:M).current?.appendChild(ve),me.afterGuiAttached?.()),R(me)}),()=>{ke.then(me=>{const ve=me.getGui();e.disableEditorTooltipFeature(),o.destroyBean(me),fe(void 0),R(void 0),ve?.remove()})}},[d]);const ce=g.useCallback(ie=>{if(O.current=ie,!ie||o.isDestroyed()||!e.isAlive()){const ke=q.current;q.current=[];for(const me of ke)me();return}let be;const Re=ke=>{ke&&(ie.insertAdjacentElement("afterbegin",ke.getGui()),q.current.push(()=>{_s(ke.getGui()),o.destroyBean(ke),Q.current===be&&(Q.current=void 0)}))};w&&Re(e.createSelectionCheckbox()),y&&Re(e.createDndSource()),b&&(be=e.createRowDragComp(),Q.current=be,be&&(Re(be),be.refreshVisibility()))},[e,o,y,b,w]),we=g.useCallback(()=>{const ie=!e.isCellSpanning()||D.current,be=M.current;if(!be||!ie||!e||!e.isAlive()||o.isDestroyed()){a.current=o.destroyBean(a.current);return}a.current=o.createBean(new xo);const Re={toggleCss:(me,ve)=>Ce.current.toggleCss(me,ve),setUserStyles:me=>C(me),getFocusableElement:()=>M.current,setIncludeSelection:me=>v(me),setIncludeRowDrag:me=>S(me),setIncludeDndSource:me=>x(me),getCellEditor:()=>N.current??null,getCellRenderer:()=>I.current??V.current,getParentOfValue:()=>L.current??O.current??M.current,setRenderDetails:(me,ve,He)=>{const We=()=>{c(Pe=>Pe?.compDetails!==me||Pe?.value!==ve||Pe?.force!==He?{value:ve,compDetails:me,force:He}:Pe)};if(me?.params?.deferRender&&!e.rowNode.group){const{loadingComp:Pe,onReady:kt}=e.getDeferLoadingCellRenderer();if(Pe){c({value:void 0,compDetails:Pe,force:!1}),kt.then(()=>zI(We));return}}We()},setEditDetails:(me,ve,He,We)=>{if(me){let Pe;me.componentFromFramework&&(We?Pe=new Sk(me.params,()=>p(kt=>kt+1)):nu()),u({compDetails:me,popup:ve,popupPosition:He,compProxy:Pe}),ve||c(void 0)}else e.hasBrowserFocus()&&Re.getFocusableElement().focus({preventScroll:!0}),N.current=void 0,u(void 0)},refreshEditStyles:(me,ve)=>{if(!M.current)return;const{current:He}=Ce;He.toggleCss("ag-cell-value",!Z),He.toggleCss("ag-cell-inline-editing",!!me&&!ve),He.toggleCss("ag-cell-popup-editing",!!me&&!!ve),He.toggleCss("ag-cell-not-inline-editing",!me||!!ve)}},ke=O.current||void 0;e.setComp(Re,be,D.current??void 0,ke,t,s,a.current)},[]),z=g.useCallback(ie=>{M.current=ie,we()},[]),H=g.useCallback(ie=>{D.current=ie,we()},[]),U=g.useMemo(()=>!!(l?.compDetails?.componentFromFramework&&Fo(l.compDetails.componentClass)),[l]);g.useLayoutEffect(()=>{if(!M.current)return;const{current:ie}=Ce;ie.toggleCss("ag-cell-value",!Z),ie.toggleCss("ag-cell-inline-editing",!!d&&!d.popup),ie.toggleCss("ag-cell-popup-editing",!!d&&!!d.popup),ie.toggleCss("ag-cell-not-inline-editing",!d||!!d.popup)});const oe=()=>{const{compDetails:ie,value:be}=l;if(!ie)return be?.toString?.()??be;if(ie.componentFromFramework){const Re=ie.componentClass;return g.createElement(g.Suspense,{fallback:g.createElement(Dk,{cellCtrl:e,parent:M})},U?g.createElement(Re,{...ie.params,key:h}):g.createElement(Re,{...ie.params,key:h,ref:I}))}},he=()=>{const ie=()=>l==null?null:Z?g.createElement("span",{role:"presentation",id:`cell-${r}`,className:j,ref:ee},oe()):oe(),be=Re=>Fk(Re,fe,M.current,e,F);return d!=null?d.popup?g.createElement(g.Fragment,null,ie(),be(d)):be(d):ie()},ye=()=>g.createElement("div",{ref:z,style:f,role:P,"col-id":n},Z?g.createElement("div",{className:"ag-cell-wrapper",role:"presentation",ref:ce},he()):he());return e.isCellSpanning()?g.createElement("div",{ref:H,className:"ag-spanned-cell-wrapper",role:"presentation"},ye()):ye()},Mk=g.memo(Pk),Tk=({rowCtrl:e,containerType:t})=>{const{context:s,gos:i,editSvc:o}=g.useContext(ht),n=g.useContext(pC)==="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),[w,v]=g.useState(()=>e.rowStyles),b=g.useRef(null),[S,y]=g.useState(()=>null),[x,F]=g.useState(),[R,E]=g.useState(()=>c?e.getInitialRowTop(t):void 0),[P,M]=g.useState(()=>c?e.getInitialTransform(t):void 0),D=g.useRef(null),I=g.useRef(),V=g.useRef(),N=g.useRef(!1),[O,q]=g.useState(0);g.useEffect(()=>{if(N.current||!x||O>10)return;const z=D.current?.firstChild;z?(e.setupDetailRowAutoHeight(z),N.current=!0):q(H=>H+1)},[x,O]);const Q=g.useRef();Q.current||(Q.current=new Mn(()=>D.current));const L=g.useRef(()=>{}),re=g.useCallback(z=>(L.current=z,()=>{L.current=()=>{}}),[]),W=WI(re,()=>b.current,[]),ee=n?W:S,Y=g.useCallback(z=>{if(D.current=z,r.current=z?s.createBean(new xo):s.destroyBean(r.current),!z){e.unsetComp(t);return}if(!e.isAlive()||s.isDestroyed())return;const H={setTop:E,setTransform:M,toggleCss:(U,oe)=>Q.current.toggleCss(U,oe),setDomOrder:U=>a.current=U,setRowIndex:u,setRowId:p,setRowBusinessKey:C,setUserStyles:v,setCellCtrls:(U,oe)=>{const he=b.current,ye=la(he,U,a.current);ye!==he&&(b.current=ye,n?L.current():yn(oe,()=>y(ye)))},showFullWidth:U=>{V.current=U.params,F(U)},getFullWidthCellRenderer:()=>I.current,getFullWidthCellRendererParams:()=>V.current,refreshFullWidth:U=>{const oe=U();return V.current=oe,k.current?(F(he=>({...he,params:oe})),!0):!I.current||!I.current.refresh?!1:I.current.refresh(oe)}};e.setComp(H,z,t,r.current)},[]);g.useLayoutEffect(()=>Ln(x,s,D.current,I),[x]);const Z=g.useMemo(()=>{const z={top:R,transform:P};return Object.assign(z,w),z},[R,P,w]),j=l&&x?.componentFromFramework,fe=!l&&ee!=null,Ce=g.useMemo(()=>!!(x?.componentFromFramework&&Fo(x.componentClass)),[x]),k=g.useRef(!1);g.useEffect(()=>{k.current=Ce&&!!x&&!!i.get("reactiveCustomComponents")},[Ce,x]);const ce=()=>ee?.map(z=>g.createElement(Mk,{cellCtrl:z,editingCell:o?.isEditing(z,{withOpenEditor:!0})??!1,printLayout:e.printLayout,key:z.instanceId})),we=()=>{const z=x.componentClass;return Ce?g.createElement(z,{...x.params}):g.createElement(z,{...x.params,ref:I})};return g.createElement("div",{ref:Y,role:"row",style:Z,"row-index":d,"row-id":h,"row-business-key":f},fe?ce():j?we():null)},pg=g.memo(Tk),Ik=({name:e})=>{const{context:t,gos:s}=g.useContext(ht),i=g.useMemo(()=>In(e),[e]),o=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")&&!!i.getSpannedRowCtrls,h=g.useRef([]),p=g.useRef([]),[f,C]=g.useState(()=>[]),w=g.useRef(!1),v=g.useRef(),b=g.useMemo(()=>Nt("ag-viewport",Bf(e)),[e]),S=g.useMemo(()=>Nt(Ir(e)),[e]),y=g.useMemo(()=>Nt("ag-spanning-container",CR(e)),[e]),x=i.type==="center"||u,F=x?o:n;si(" AG Row Container "+e+" ",F);const R=g.useCallback(()=>{const O=!x||o.current!=null,q=n.current!=null,Q=!u||r.current!=null;return O&&q&&Q},[]),E=g.useCallback(()=>o.current==null&&n.current==null&&r.current==null,[]),P=g.useCallback(()=>{if(E()&&(v.current=t.destroyBean(v.current)),!t.isDestroyed()&&R()){const O=L=>{const re=la(l.current,a.current,w.current);re!==l.current&&(l.current=re,yn(L,()=>d(re)))},q=L=>{const re=la(p.current,h.current,w.current);re!==p.current&&(p.current=re,yn(L,()=>C(re)))},Q={setHorizontalScroll:L=>{o.current&&(o.current.scrollLeft=L)},setViewportHeight:L=>{o.current&&(o.current.style.height=L)},setRowCtrls:({rowCtrls:L,useFlushSync:re})=>{const W=!!re&&a.current.length>0&&L.length>0;a.current=L,O(W)},setSpannedRowCtrls:(L,re)=>{const W=!!re&&h.current.length>0&&L.length>0;h.current=L,q(W)},setDomOrder:L=>{w.current!=L&&(w.current=L,O(!1))},setContainerWidth:L=>{n.current&&(n.current.style.width=L)},setOffsetTop:L=>{n.current&&(n.current.style.transform=`translateY(${L})`)}};v.current=t.createBean(new DR(e)),v.current.setComp(Q,n.current,r.current??void 0,o.current)}},[R,E]),M=g.useCallback(O=>{n.current=O,P()},[P]),D=g.useCallback(O=>{r.current=O,P()},[P]),I=g.useCallback(O=>{o.current=O,P()},[P]),V=()=>g.createElement("div",{className:S,ref:M,role:x?"presentation":"rowgroup"},c.map(O=>g.createElement(pg,{rowCtrl:O,containerType:i.type,key:O.instanceId})));if(!x)return V();const N=()=>g.createElement("div",{className:y,ref:D,role:"presentation"},f.map(O=>g.createElement(pg,{rowCtrl:O,containerType:i.type,key:O.instanceId})));return g.createElement("div",{className:b,ref:I,role:"rowgroup"},V(),u?N():null)},kk=g.memo(Ik),Ak=()=>{const e=g.useContext(ht),{context:t,overlays:s}=e,[i,o]=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,w]=g.useState("0px"),[v,b]=g.useState("0px"),[S,y]=g.useState("100%"),[x,F]=g.useState(!0),[R,E]=g.useState(!0),[P,M]=g.useState(null),[D,I]=g.useState(""),[V,N]=g.useState(null),[O,q]=g.useState("ag-layout-normal"),Q=g.useRef();Q.current||(Q.current=new Mn(()=>L.current));const L=g.useRef(null),re=g.useRef(null),W=g.useRef(null),ee=g.useRef(null),Y=g.useRef(null),Z=g.useRef(null),j=g.useRef(null),fe=g.useRef([]),Ce=g.useRef([]);si(" AG Grid Body ",L),si(" AG Pinned Top ",re),si(" AG Sticky Top ",W),si(" AG Middle ",Z),si(" AG Pinned Bottom ",j);const k=g.useCallback(ve=>{if(L.current=ve,!ve||t.isDestroyed()){fe.current=t.destroyBeans(fe.current);for(const G of Ce.current)G();Ce.current=[];return}const He=(G,Se)=>{G.appendChild(Se),Ce.current.push(()=>Se.remove())},We=G=>{const Se=t.createBean(new G);return fe.current.push(Se),Se},Pe=(G,Se,lt)=>{He(G,document.createComment(lt)),He(G,We(Se).getGui())};Pe(ve,LR," AG Fake Horizontal Scroll ");const kt=s?.getOverlayWrapperCompClass();kt&&Pe(ve,kt," AG Overlay Wrapper "),Y.current&&Pe(Y.current,NR," AG Fake Vertical Scroll ");const at={setRowAnimationCssOnBodyViewport:o,setColumnCount:G=>{L.current&&c0(L.current,G)},setRowCount:G=>{L.current&&a0(L.current,G)},setTopHeight:r,setBottomHeight:l,setStickyTopHeight:d,setStickyTopTop:h,setStickyTopWidth:f,setTopInvisible:F,setBottomInvisible:E,setColumnMovingCss:(G,Se)=>Q.current.toggleCss(G,Se),updateLayoutClasses:q,setAlwaysVerticalScrollClass:M,setPinnedTopBottomOverflowY:I,setCellSelectableCss:(G,Se)=>N(Se?G:null),setBodyViewportWidth:G=>{Z.current&&(Z.current.style.width=G)},registerBodyViewportResizeListener:G=>{if(Z.current){const Se=Es(e,Z.current,G);Ce.current.push(()=>Se())}},setStickyBottomHeight:w,setStickyBottomBottom:b,setStickyBottomWidth:y,setGridRootRole:G=>ve.setAttribute("role",G)},ds=t.createBean(new IR);fe.current.push(ds),ds.setComp(at,ve,Z.current,re.current,j.current,W.current,ee.current)},[]),ce=g.useMemo(()=>Nt("ag-root","ag-unselectable",O),[O]),we=g.useMemo(()=>Nt("ag-body-viewport",i,O,P,V),[i,O,P,V]),z=g.useMemo(()=>Nt("ag-body",O),[O]),H=g.useMemo(()=>Nt("ag-floating-top",x?"ag-invisible":null,V),[V,x]),U=g.useMemo(()=>Nt("ag-sticky-top",V),[V]),oe=g.useMemo(()=>Nt("ag-sticky-bottom",C==="0px"?"ag-invisible":null,V),[V,C]),he=g.useMemo(()=>Nt("ag-floating-bottom",R?"ag-invisible":null,V),[V,R]),ye=g.useMemo(()=>({height:n,minHeight:n,overflowY:D}),[n,D]),ie=g.useMemo(()=>({height:c,top:u,width:p}),[c,u,p]),be=g.useMemo(()=>({height:C,bottom:v,width:S}),[C,v,S]),Re=g.useMemo(()=>({height:a,minHeight:a,overflowY:D}),[a,D]),ke=ve=>g.createElement(kk,{name:ve,key:`${ve}-container`}),me=({section:ve,children:He,className:We,style:Pe})=>g.createElement("div",{ref:ve,className:We,role:"presentation",style:Pe},He.map(ke));return g.createElement("div",{ref:k,className:ce},g.createElement(wk,null),me({section:re,className:H,style:ye,children:["topLeft","topCenter","topRight","topFullWidth"]}),g.createElement("div",{className:z,ref:Y,role:"presentation"},me({section:Z,className:we,children:["left","center","right","fullWidth"]})),me({section:W,className:U,style:ie,children:["stickyTopLeft","stickyTopCenter","stickyTopRight","stickyTopFullWidth"]}),me({section:ee,className:oe,style:be,children:["stickyBottomLeft","stickyBottomCenter","stickyBottomRight","stickyBottomFullWidth"]}),me({section:j,className:he,style:Re,children:["bottomLeft","bottomCenter","bottomRight","bottomFullWidth"]}))},Lk=g.memo(Ak),Ok=(e,t)=>{const{children:s,eFocusableElement:i,onTabKeyDown:o,gridCtrl:n,forceFocusOutWhenTabGuardsAreEmpty:r,isEmpty:a}=e,{context:l}=g.useContext(ht),c=g.useRef(null),d=g.useRef(null),u=g.useRef(),h=v=>{const b=v==null?void 0:parseInt(v,10).toString();for(const S of[c,d])b===void 0?S.current?.removeAttribute("tabindex"):S.current?.setAttribute("tabindex",b)};g.useImperativeHandle(t,()=>({forceFocusOutOfContainer(v){u.current?.forceFocusOutOfContainer(v)}}));const p=g.useCallback(()=>{const v=c.current,b=d.current;if(!v&&!b||l.isDestroyed()){u.current=l.destroyBean(u.current);return}if(v&&b){const S={setTabIndex:h};u.current=l.createBean(new Xf({comp:S,eTopGuard:v,eBottomGuard:b,eFocusableElement:i,onTabKeyDown:o,forceFocusOutWhenTabGuardsAreEmpty:r,focusInnerElement:y=>n.focusInnerElement(y),isEmpty:a}))}},[]),f=g.useCallback(v=>{c.current=v,p()},[p]),C=g.useCallback(v=>{d.current=v,p()},[p]),w=v=>{const b=v==="top"?oo.TAB_GUARD_TOP:oo.TAB_GUARD_BOTTOM;return g.createElement("div",{className:`${oo.TAB_GUARD} ${b}`,role:"presentation",ref:v==="top"?f:C})};return g.createElement(g.Fragment,null,w("top"),s,w("bottom"))},Nk=g.forwardRef(Ok),Hk=g.memo(Nk),Gk=({context:e})=>{const[t,s]=g.useState(""),[i,o]=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(),[w,v]=g.useState(null),b=g.useRef(()=>{}),S=g.useRef(),y=g.useRef([]),x=g.useCallback(()=>{},[]);si(" AG Grid ",f);const F=g.useCallback(I=>{if(f.current=I,p.current=I?e.createBean(new A2):e.destroyBean(p.current),!I||e.isDestroyed())return;const V=p.current;b.current=V.focusInnerElement.bind(V);const N={destroyGridUi:()=>{},setRtlClass:s,forceFocusOutOfContainer:O=>{if(!O&&S.current?.isDisplayed()){S.current.forceFocusOutOfContainer(O);return}C.current?.forceFocusOutOfContainer(O)},updateLayoutClasses:o,getFocusableContainers:()=>{const O=[],q=f.current?.querySelector(".ag-root");q&&O.push({getGui:()=>q});for(const Q of y.current)Q.isDisplayed()&&O.push(Q);return O},setCursor:r,setUserSelect:l};V.setComp(N,I,I),d(!0)},[]);g.useEffect(()=>{const I=p.current,V=f.current;if(!u||!I||!w||!V||e.isDestroyed())return;const N=[],{watermarkSelector:O,paginationSelector:q,sideBarSelector:Q,statusBarSelector:L,gridHeaderDropZonesSelector:re}=I.getOptionalSelectors(),W=[];if(re){const Y=e.createBean(new re.component),Z=Y.getGui();V.insertAdjacentElement("afterbegin",Z),W.push(Z),N.push(Y)}if(Q){const Y=e.createBean(new Q.component),Z=Y.getGui(),j=w.querySelector(".ag-tab-guard-bottom");j&&(j.insertAdjacentElement("beforebegin",Z),W.push(Z)),N.push(Y),y.current.push(Y)}const ee=Y=>{const Z=e.createBean(new Y),j=Z.getGui();return V.insertAdjacentElement("beforeend",j),W.push(j),N.push(Z),Z};if(L&&ee(L.component),q){const Y=ee(q.component);S.current=Y,y.current.push(Y)}return O&&ee(O.component),()=>{e.destroyBeans(N);for(const Y of W)Y.remove()}},[u,w,e]);const R=g.useMemo(()=>Nt("ag-root-wrapper",t,i),[t,i]),E=g.useMemo(()=>Nt("ag-root-wrapper-body","ag-focus-managed",i),[i]),P=g.useMemo(()=>({userSelect:a??"",WebkitUserSelect:a??"",cursor:n??""}),[a,n]),M=g.useCallback(I=>{C.current=I,h(I!==null)},[]),D=g.useCallback(()=>!p.current?.isFocusable(),[]);return g.createElement("div",{ref:F,className:R,style:P,role:"presentation"},g.createElement("div",{className:E,ref:v,role:"presentation"},c&&w&&!e.isDestroyed()&&g.createElement(ht.Provider,{value:e.getBeans()},g.createElement(Hk,{ref:M,eFocusableElement:w,onTabKeyDown:x,gridCtrl:p.current,forceFocusOutWhenTabGuardsAreEmpty:!0,isEmpty:D},g.createElement(Lk,null)))))},Bk=g.memo(Gk),Vk=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))}},SC={setGridApi:void 0,maxComponentCreationTimeMs:void 0,children:void 0},zk={gridOptions:void 0,modules:void 0,containerStyle:void 0,className:void 0,passGridApi:void 0,componentWrappingElement:void 0,...SC},yC=new Set(Object.keys(zk)),Wk=new Set(Object.keys(SC)),xC=e=>{const t=g.useRef(),s=g.useRef(null),i=g.useRef(null),o=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(v=>{if(s.current=v,!v){for(const D of o.current)D();o.current.length=0;return}const b=e.modules||[];i.current||(i.current=new ak(()=>h(D=>D+1),e.componentWrappingElement,e.maxComponentCreationTimeMs),o.current.push(()=>{i.current?.destroy(),i.current=null}));const S=dS(e.gridOptions,e,Object.keys(e).filter(D=>!yC.has(D))),y=()=>{if(c.current){const D=()=>a.current?.shouldQueueUpdates()?void 0:n.current.shift();let I=D();for(;I;)I(),I=D()}},x=new $k(y);a.current=x;const F=new Vk,R={providedBeanInstances:{frameworkCompWrapper:new jk(i.current,S),renderStatus:F},modules:b,frameworkOverrides:x,setThemeOnGridDiv:!0},E=D=>{u(D),D.createBean(F),o.current.push(()=>{D.destroy()}),D.getBean("ctrlsSvc").whenReady({addDestroyFunc:I=>{o.current.push(I)}},()=>{if(D.isDestroyed())return;const I=t.current;I&&e.passGridApi?.(I)})},P=D=>{D.getBean("ctrlsSvc").whenReady({addDestroyFunc:I=>{o.current.push(I)}},()=>{for(const I of n.current)I();n.current.length=0,c.current=!0})},M=new r5;S.gridId??(S.gridId=l.current),t.current=M.create(v,S,E,P,R),o.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(v=>{c.current&&!a.current?.shouldQueueUpdates()?v():n.current.push(v)},[]);g.useEffect(()=>{const v=_k(r.current,e);r.current=e,C(()=>{t.current&&uS(v,t.current)})},[e]);const w=!g.useSyncExternalStore||Er(e,"renderingMode")==="legacy"?"legacy":"default";return g.createElement("div",{style:f,className:e.className,ref:p},g.createElement(pC.Provider,{value:w},d&&!d.isDestroyed()?g.createElement(Bk,{key:d.instanceId,context:d}):null,i.current?.getPortals()??null))};function _k(e,t){const s={};for(const i of Object.keys(t)){if(yC.has(i)){Wk.has(i)&&B(274,{prop:i});continue}const o=t[i];e[i]!==o&&(s[i]=o)}return s}var jk=class extends u5{constructor(e,t){super(),this.parent=e,this.gridOptions=t}createWrapper(e,t){const s=this.gridOptions;if(Er(s,"reactiveCustomComponents")){const r=(a=>{switch(a){case"filter":return Er(s,"enableFilterHandlers")?ZI:YI;case"floatingFilterComponent":return Er(s,"enableFilterHandlers")?JI:QI;case"dateComponent":return KI;case"dragAndDropImageComponent":return qI;case"loadingOverlayComponent":return tk;case"noRowsOverlayComponent":return ik;case"statusPanel":return ok;case"toolPanel":return nk;case"menuItem":return sk;case"cellRenderer":return $I;case"innerHeaderComponent":return ek}})(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":nu();break}const o=!t.cellRenderer&&t.name!=="toolPanel";return new vC(e,this.parent,t,o)}},Uk=g.forwardRef((e,t)=>{const s=g.useContext(ht),{registry:i,context:o,gos:n,rowModel:r}=s,[a,l]=g.useState(()=>new zt),[c,d]=g.useState(()=>new zt),[u,h]=g.useState(),[p,f]=g.useState(),C=g.useRef(),w=g.useRef(null),v=g.useRef(),b=g.useMemo(()=>z0(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&&B(230);const x=g.useCallback(R=>{if(w.current=R,!R||o.isDestroyed()){C.current=o.destroyBean(C.current),v.current?.();return}const E={toggleCss:(M,D)=>l(I=>I.setClass(M,D)),toggleDetailGridCss:(M,D)=>d(I=>I.setClass(M,D)),setDetailGrid:M=>h(M),setRowData:M=>f(M),getGui:()=>w.current},P=i.createDynamicBean("detailCellRendererCtrl",!0);if(P&&(o.createBean(P),P.init(E,e),C.current=P,n.get("detailRowAutoHeight"))){const M=()=>{if(w.current==null)return;const D=w.current.clientHeight;D!=null&&D>0&&setTimeout(()=>{e.node.setRowHeight(D),($e(n)||Di(n))&&r.onRowHeightChanged()},0)};v.current=Es(s,R,M),M()}},[]),F=g.useCallback(R=>{C.current?.registerDetailWithMaster(R)},[]);return g.createElement("div",{className:S,ref:x},u&&g.createElement(xC,{className:y,...u,modules:b,rowData:p,passGridApi:F}))}),$k=class extends Qf{constructor(e){super("react"),this.processQueuedUpdates=e,this.queueUpdates=!1,this.renderingEngine="react",this.frameworkComponents={agGroupCellRenderer:dg,agGroupRowRenderer:dg,agDetailCellRenderer:Uk},this.wrapIncoming=(t,s)=>s==="ensureVisible"?VI(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 BI()}},Kk=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(xC,{...this.props,passGridApi:this.setGridApi})}},RC=(e=>(e.Dropdown="dropdown",e.Menu="menu",e))(RC||{}),Ft=(e=>(e.Click="click",e.Hover="hover",e.ContextMenu="contextMenu",e))(Ft||{}),Co=(e=>(e.Item="item",e.Divider="divider",e.PlainText="plainText",e))(Co||{});const qk=X("flex items-center gap-2 align-middle","h-auto px-0 bg-transparent border-0"),Yk=X("z-[53] overflow-auto rounded bg-layer-0 text-primary shadow focus-visible:outline-none"),Zk=X("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",Qk="text-error",Jk="my-1 border-t border-hover border-secondary",Vo=4,ru=({ariaLabel:e,className:t,size:s=24,onClose:i,...o})=>m.jsx(xt,{"aria-label":e,className:ne("text-secondary hover:enabled:text-accent-primary",t),onClick:i,iconBefore:m.jsx(_.IconX,{size:s}),...o}),yt=({children:e,menu:t,renderOverlay:s,trigger:i=[Ft.Click],placement:o,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:w=!1,matchReferenceWidth:v=!0,maxDropdownHeight:b})=>{const[S,y]=g.useState(a),x=r!==void 0,F=x?!!r:S,R=g.useRef(null),E=g.useCallback(k=>{x||y(k),l?.(k)},[x,l]),P=g.useId(),M=o===void 0,D=k=>"clientWidth"in k?k.clientWidth:k.getBoundingClientRect?.()?.width??0,{refs:I,floatingStyles:V,context:N}=Ee.useFloating({placement:o,open:F,onOpenChange:E,whileElementsMounted:Ee.autoUpdate,middleware:[Ee.offset({mainAxis:Vo,crossAxis:0}),M?Ee.autoPlacement({alignment:"start",crossAxis:!0,padding:Vo,allowedPlacements:C}):Ee.flip({padding:Vo}),Ee.shift({padding:Vo}),Ee.size({padding:Vo,apply({availableWidth:k,availableHeight:ce,elements:we}){const z=we.floating,H=D(we.reference);z.style.setProperty("--fui-available-height",`${Math.floor(ce)}px`),z.style.setProperty("--reference-width",v?`${Math.round(H)}px`:"0px"),v?z.style.minWidth=`${Math.round(H)}px`:z.style.removeProperty("min-width"),z.style.maxWidth=`${Math.floor(k)}px`;const U=Math.floor(ce);z.style.maxHeight=`${b?Math.min(U,b):U}px`}})]}),O=Ee.useClick(N,{enabled:i.includes(Ft.Click)&&!n}),q=Ee.useHover(N,{enabled:i.includes(Ft.Hover)&&!n,move:!1,restMs:40,delay:{open:80,close:80}}),Q=Ee.useDismiss(N,{bubbles:!0,referencePress:!1,outsidePress:k=>{if(!f)return!1;const ce=k.target;return!(p?.current&&ce instanceof Node&&p.current.contains(ce))}}),L=Ee.useRole(N,{role:"menu"}),{getReferenceProps:re,getFloatingProps:W}=Ee.useInteractions([O,q,Q,L]),ee=g.useCallback((k,ce)=>{I.setPositionReference({getBoundingClientRect:()=>({width:0,height:0,x:k,y:ce,top:ce,left:k,right:k,bottom:ce})})},[I]),Y=g.useCallback(k=>{!i.includes(Ft.ContextMenu)||n||(k.preventDefault(),w&&(ee(k.clientX,k.clientY),R.current=document.elementFromPoint(k.clientX,k.clientY)),E(!0))},[w,n,E,ee,i]),Z=g.useCallback(k=>{!w||n||(i.includes(Ft.ContextMenu)&&F&&E(!1),ee(k.clientX,k.clientY),R.current=document.elementFromPoint(k.clientX,k.clientY))},[w,n,ee,F,i,E]);g.useEffect(()=>{n&&F&&E(!1)},[n,F,E]);const j=g.useCallback(k=>ce=>{k.disabled||(k.onClick?.({key:k.key,domEvent:ce}),t?.onClick?.({key:k.key,domEvent:ce}),E(!1))},[t,E]),fe=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(k=>k.type===Co.Divider?m.jsx("div",{role:"separator",className:Jk},k.key):k.type===Co.PlainText?m.jsx("div",{className:ne("px-3 py-2 text-secondary dial-caption",k.className),children:k.label},k.key):m.jsxs("button",{role:"menuitem",type:"button","aria-disabled":!!k.disabled,className:X(Zk,k.disabled&&Xk,k.danger&&Qk,k.className),disabled:k.disabled,onClick:j(k),children:[k.icon&&m.jsx("span",{className:X(k.danger&&"text-error",k.disabled&&"text-secondary"),children:m.jsx(Ne,{icon:k.icon})}),m.jsx("span",{className:X("flex-1 truncate text-left",k.danger&&"text-error",k.disabled&&"text-secondary"),"aria-labelledby":"item-text",children:k.label})]},k.key))}),t.footer&&m.jsx(m.Fragment,{children:typeof t.footer=="function"?t.footer():t.footer})]}):null,[j,t,s]),Ce=re({onContextMenu:Y,onMouseDown:Z});return g.useEffect(()=>{if(!F)return;const k=I.reference.current;let ce=null;if(k instanceof Element?ce=k:R.current instanceof Element&&(ce=R.current),!ce)return;const we=new IntersectionObserver(([z])=>{z.isIntersecting||E(!1)},{root:null,threshold:0});return we.observe(ce),()=>we.disconnect()},[F,I.reference,E]),m.jsxs(m.Fragment,{children:[m.jsx("span",{ref:I.setReference,className:X(qk,n&&"!cursor-not-allowed opacity-75",u),"aria-haspopup":"menu","aria-expanded":F,"aria-controls":P,...Ce,children:e}),F&&m.jsx(Ee.FloatingPortal,{children:m.jsx(Ee.FloatingFocusManager,{context:N,modal:!1,initialFocus:-1,returnFocus:!0,children:m.jsxs("div",{id:P,ref:I.setFloating,style:V,className:X(Yk,!v&&"w-max",h),...W(),children:[c&&m.jsx("div",{className:"flex items-center justify-between px-2 pt-2",children:m.jsx(ru,{ariaLabel:"Close dropdown",onClose:k=>{d?.(k),E(!1)}})}),fe]})})})]})},e8="h-full",ic={accentColor:"var(--controls-bg-accent, #5C8DEA)",backgroundColor:"var(--bg-layer-3, #222932)",oddRowBackgroundColor:"var(--bg-layer-4, #333942)",selectedRowBackgroundColor:"var(--bg-accent-primary-alpha, #74A4FF26)",borderColor:"var(--bg-layer-4, #333942)",rowBorder:"1px solid var(--stroke-tertiary, #090D13)",rowHoverColor:"var(--bg-accent-primary-alpha, #74A4FF26)",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))"}},oc=40,t8=(e,t,s,i,o)=>{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:o?1:-1:o?-1:1},s8=({selectedRowIds:e,selectedRows:t,onSelectionChange:s,onSelectionChangeWithMap:i,rowData:o=[],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(v=>r?.has(n(v))??!1,[r,n]),h=g.useMemo(()=>o.filter(v=>!u(v)),[o,u]),p=e!==void 0||t!==void 0;g.useEffect(()=>{if(e!==void 0&&!t){const v=new Map;o.forEach(S=>{const y=n(S);e.has(y)&&!r?.has(y)&&v.set(y,S)}),(v.size!==a.size||Array.from(v.keys()).some(S=>!a.has(S)))&&l(v)}},[e,t,o,n,r,a]);const f=g.useCallback((v,b,S)=>{const y=n(v);if(r?.has(y))return;const x=S?new Map:new Map(c);b?x.set(y,v):x.delete(y),p||l(x),i?.(x),s&&s(new Set(x.keys()),Array.from(x.values()))},[c,n,r,p,s,i]),C=g.useMemo(()=>{if(!h.length)return"unchecked";const v=h.map(n),b=v.filter(S=>d.has(S)).length;return b===0?"unchecked":b===v.length?"checked":"indeterminate"},[h,d,n]),w=g.useCallback(v=>{const b=new Map;if(v&&h.forEach(S=>{const y=n(S);b.set(y,S)}),p||l(b),i&&i(b),s){const S=new Set(b.keys()),y=Array.from(b.values());s(S,y)}},[h,n,p,s,i]);return{currentSelectedIds:d,currentSelectedRows:c,handleSelectionToggle:f,headerCheckboxState:C,handleHeaderCheckboxChange:w}};var Yi=(e=>(e.CHECKBOX="CHECKBOX",e.RADIO_BUTTON="RADIO_BUTTON",e))(Yi||{});j0.registerModules([GI]);const au=({columnDefs:e,rowData:t,additionalGridOptions:s,getContextMenuItems:i,className:o,ariaLabel:n="Data grid",withSelectionColumn:r=!0,wrapCustomCellRenderers:a=!0,disabledRowIds:l,selectedRowIds:c,selectedRows:d,selectionOnHover:u=!0,onSelectionChange:h,onSelectionChangeWithMap:p,onGridApiChange:f,getRowId:C=P=>String(P.id||JSON.stringify(P)),alternateOddRowColors:w=!1,filterPlaceholder:v="Enter value",emptyStateIcon:b,emptyStateTitle:S="No results found",emptyStateDescription:y="Sorry, we couldn't find any results for your search.",loading:x=!1,wrapperBorder:F=!0,withoutHeaderBorders:R=!1,selectionMode:E=Yi.CHECKBOX})=>{const[P,M]=g.useState(oc),[D,I]=g.useState(),V=g.useId(),{currentSelectedIds:N,handleSelectionToggle:O,headerCheckboxState:q,handleHeaderCheckboxChange:Q}=s8({selectedRowIds:c,selectedRows:d,onSelectionChange:h,onSelectionChangeWithMap:p,rowData:t,getRowId:C,disabledRowIds:l}),L=g.useMemo(()=>({...ic,oddRowBackgroundColor:w?ic.oddRowBackgroundColor:ic.backgroundColor,wrapperBorder:F}),[w,F]),re=g.useCallback(z=>{z.api.sizeColumnsToFit(),M(oc)},[]),W=g.useCallback(z=>{if(!z.data)return"";const H=C(z.data);return X({"ag-row-selected":N.has(H),"opacity-50":l?.has(H)})},[N,l,C]),ee=g.useCallback(()=>{if(E!==Yi.CHECKBOX)return null;const z=q==="checked",H=q==="indeterminate",U="header-select-all",oe=t?.some(he=>!l?.has(C(he)))??!1;return m.jsx("div",{className:"flex items-center justify-center h-full header-checkbox-container",children:m.jsx(rn,{id:U,ariaLabel:"Select all rows",checked:z,disabled:!oe,"aria-disabled":!oe,indeterminate:H,className:X(`dial-header-select ${q}`,!u&&"dial-header-select-visible"),onChange:Q})})},[q,t,u,Q,l,C,E]),Y=g.useCallback(z=>{if(z.data){const H=C(z.data),U=l?.has(H),oe=z.value==null?"":String(z.value),he=i?.(z.data)??[];return m.jsx(yt,{trigger:[Ft.ContextMenu],menu:{items:he},anchorToMouse:!0,matchReferenceWidth:!0,className:"w-full",disabled:U,children:m.jsx("span",{className:"block min-w-0 h-full max-w-full",children:m.jsx(ot,{text:oe,className:"max-w-full h-full"})})})}},[i,l,C]),Z=g.useCallback(z=>{if(!z.data)return null;const H=C(z.data),U=N.has(H),oe=l?.has(H),he=`row-select-${H}`;return E===Yi.RADIO_BUTTON?m.jsx("div",{className:"h-6 w-6 flex items-center justify-center",children:m.jsx(nd,{className:"w-[18px] h-[18px]",inputId:he,checked:U,disabled:oe,name:"gridradiobutton",value:"selected",onChange:()=>{oe||!z.data||O(z.data,!0,!0)}})}):m.jsx("div",{className:"flex items-center justify-center size-full",children:m.jsx(rn,{id:he,ariaLabel:"Select row",checked:U,disabled:oe,"aria-disabled":oe,className:X("dial-row-select",!u&&"dial-row-select-visible",oe&&"opacity-50 cursor-not-allowed"),onChange:ye=>{oe||!z.data||O(z.data,!!ye)}},`${H}-${U}`)})},[N,l,C,O,u,E]),j=g.useCallback(z=>{const H=typeof a=="function"?a(z):!!a;if(!z.cellRenderer)return{...z,cellRenderer:Y};if(!H)return z;const U=z.cellRenderer;return{...z,cellRenderer:he=>{const ye=he.data?i?.(he.data)??[]:[];let ie=null;if(typeof U=="function"){const ke=U;ie=m.jsx(ke,{...he})}else ie=Y(he);const be=he.data?C(he.data):null,Re=be?l?.has(be):!1;return m.jsx(yt,{trigger:[Ft.ContextMenu],menu:{items:ye},anchorToMouse:!0,matchReferenceWidth:!0,className:"w-full h-full",disabled:Re,children:m.jsx("span",{className:"block min-w-0 max-w-full flex-1",children:ie})})}}},[l,i,C,Y,a]),fe=g.useMemo(()=>({colId:"__select",headerName:"",width:44,minWidth:44,suppressSizeToFit:!0,lockPosition:!0,sortable:!1,resizable:!1,filter:!1,floatingFilter:!1,cellRenderer:Z,headerComponent:E===Yi.CHECKBOX?ee:void 0}),[Z,ee,E]),Ce=g.useMemo(()=>{const z=(e??[]).map(j);return r?[fe,...z]:z},[e,fe,r,j]),k=g.useMemo(()=>({minWidth:150,resizable:!0,sortable:!0,floatingFilter:!0,filter:"agTextColumnFilter",filterParams:{filterPlaceholder:v,buttons:["reset"]},comparator:t8.bind(void 0)}),[v]),ce=z=>{const H=Ce.map(U=>({...U,sort:void 0}));z.api.updateGridOptions({columnDefs:H,rowData:t}),z.api.sizeColumnsToFit(),I(z.api),s?.onGridReady?.(z),f?.(z.api)};g.useEffect(()=>{D&&D.redrawRows()},[D,N]);const we=g.useCallback(()=>m.jsx(En,{title:S,description:y,containerClassName:"gap-3",titleClassName:"mt-2 !text-lg",icon:b||m.jsx(_.IconZoomCancel,{size:100,stroke:.5,className:"text-secondary"})}),[S,y,b]);return m.jsx("div",{className:X(e8,o,r&&"with-selection-column",R&&"dial-without-header-borders"),"aria-label":n,role:"region","aria-busy":x,children:m.jsx("div",{className:"ag-theme-balham-dark h-full overflow-x-auto",role:"table","aria-describedby":V,children:m.jsx(Kk,{rowModelType:"clientSide",headerHeight:oc,rowHeight:P,cellSelection:!1,getRowClass:W,theme:H3.withPart(m3).withParams({...L}),autoSizeStrategy:{type:"fitGridWidth"},columnDefs:Ce,defaultColDef:k,onGridSizeChanged:re,onGridReady:ce,loading:x,suppressCellFocus:!0,suppressDragLeaveHidesColumns:!0,noRowsOverlayComponent:we,rowData:t,...s})})})};var ca=(e=>(e.Horizontal="horizontal",e.Vertical="vertical",e))(ca||{}),da=(e=>(e.Mobile="mobile",e.Tablet="tablet",e))(da||{});const vr=({tab:e,active:t,invalid:s,className:i,horizontal:o,onClick:n})=>{const r=ne("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":o,"border-l-2 px-3":!o}),a=ne(r,{"bg-layer-4":o,"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&&o&&!e.disabled,"border-l-accent-primary":t&&!o&&!e.disabled},i);return m.jsxs("button",{role:"tab",className:a,onClick:()=>n(e.id),disabled:e.disabled,children:[m.jsx(ot,{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(_.IconExclamationCircle,{...se})})]})},fg=12;var Vs=(e=>(e.Undefined="undefined",e.Mobile="mobile",e.Tablet="tablet",e.Desktop="desktop",e))(Vs||{});const mg=()=>typeof window<"u"&&window.innerWidth<640,nc=()=>{if(typeof window>"u")return Vs.Undefined;const e=window.innerWidth;return e>=1024?Vs.Desktop:e<640?Vs.Mobile:Vs.Tablet},i8=()=>{const[e,t]=g.useState(()=>typeof window>"u"?Vs.Desktop:nc());return g.useEffect(()=>{t(nc());const s=()=>t(nc());return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),e},FC=({tabs:e,activeTab:t,onClick:s,orientation:i=ca.Horizontal,screenThreshold:o=da.Tablet,smallScreenContainerClassName:n,smallScreenDropdownItemClassName:r,desktopDropdownClassName:a,desktopTabClassName:l})=>{const[c,d]=g.useState(!1),[u,h]=g.useState(!1),[p,f]=g.useState(!1),C=i8(),w=C===Vs.Mobile||o===da.Tablet&&C===Vs.Tablet,v=i===ca.Horizontal,b=g.useRef(null),S=g.useRef(null),y=g.useRef(null),x=e.find(E=>E.id===t),F=g.useMemo(()=>X("flex gap-2",v?"flex-row flex-nowrap overflow-x-auto":"flex-col flex-wrap w-full"),[v]),R=g.useCallback(()=>{const E=S.current;E&&f(E.scrollWidth>E.clientWidth)},[]);return g.useEffect(()=>{R();const E=new ResizeObserver(()=>R()),P=S.current;return P&&E.observe(P),()=>E.disconnect()},[e,R]),g.useEffect(()=>{const E=y.current,P=S.current;if(!E||!P)return;const M=E.offsetLeft,D=M+E.offsetWidth,I=P.scrollLeft,V=I+P.clientWidth;M<I?P.scrollTo({left:M-fg,behavior:"smooth"}):D>V&&P.scrollTo({left:D-P.clientWidth+fg,behavior:"smooth"})},[t]),w?m.jsx("div",{role:"tablist",className:ne("h-11 flex items-center bg-layer-3 px-4",n),children:m.jsx(yt,{trigger:[Ft.Click],open:c,onOpenChange:d,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],renderOverlay:()=>e.map(E=>m.jsx(vr,{tab:E,active:E.id===t,onClick:P=>{s(P),d(!1)},className:ne("w-full rounded-none h-11 items-center px-6",r)},E.id)),children:m.jsxs("div",{className:"flex gap-2 items-center h-11 cursor-pointer",children:[m.jsx(vr,{tab:x,active:!0,onClick:s,className:"rounded-none bg-transparent border-l-0 border-b-0 h-full items-center px-0"},t),m.jsx(Ne,{icon:m.jsx(_.IconChevronDown,{size:16}),className:X("text-primary transition-transform",c&&"rotate-180")})]})})}):m.jsxs("div",{ref:b,className:"flex w-full items-start",children:[m.jsx("div",{ref:S,role:"tablist",className:F,children:e.map(E=>m.jsx("div",{ref:t===E.id?y:void 0,className:"w-full",children:m.jsx(vr,{tab:E,active:t===E.id,onClick:s,horizontal:v,className:ne("w-full",l)})},E.id))}),p&&m.jsx("div",{className:"flex items-center ml-2",children:m.jsx(yt,{trigger:[Ft.Click],open:u,onOpenChange:h,placement:"bottom-end",renderOverlay:()=>e.map(E=>m.jsx(vr,{tab:E,active:E.id===t,onClick:P=>{s(P),h(!1)},className:"w-full rounded-none h-8 items-center px-3 py-2"},E.id)),children:m.jsx(xt,{iconBefore:m.jsx(_.IconDotsVertical,{size:18}),className:ne("w-8 h-8 flex items-center justify-center rounded border",u?"bg-layer-4 border-transparent":"border-primary",a)})})})]})},o8="w-full overflow-hidden",n8="flex flex-nowrap items-center gap-2 min-w-0 px-0 py-0 whitespace-nowrap",EC="flex items-center gap-2 min-w-0 shrink-0 dial-small",r8="max-w-[20%] basis-[20%] flex-none",a8="flex-1 min-w-0",Cg="inline-flex items-center gap-1 min-w-0 transition-colors",l8="text-secondary hover:text-accent-primary",c8="text-primary cursor-default",DC="flex-none inline-flex items-center leading-none text-secondary",d8="items-center gap-1 min-w-0 transition-colors text-secondary hover:text-accent-primary",PC=m.jsx(_.IconChevronRight,{size:16,"aria-hidden":"true"}),Uo=({label:e,href:t,onClick:s,disabled:i,isLast:o,separator:n=PC,className:r,iconBefore:a,labelClassName:l,onBeforeNavigate:c,...d})=>{const u=async w=>{if(c&&!o&&!await c()){w.preventDefault();return}s&&s(w)},h=ne(EC,o?a8:r8,r),p=(!!t||!!s)&&!o&&!i,f=p?ne(Cg,l8):ne(Cg,c8,i?"pointer-events-none opacity-75":""),C=typeof e=="string"?m.jsx(ot,{className:ne("cursor-pointer",l),text:e,id:"breadcrumb-item-content"}):m.jsx("span",{className:ne("flex-1 min-w-0 max-w-full truncate cursor-pointer",l),"aria-label":"breadcrumb-item-content",children:e});return m.jsxs("li",{...d,className:h,"aria-label":d["aria-label"]||"breadcrumb-item",children:[p?m.jsxs("a",{href:t,onClick:u,className:f,children:[a,C]}):m.jsxs("span",{className:f,"aria-current":o?"page":void 0,"aria-disabled":i?"true":void 0,children:[a,C]}),!o&&m.jsx("span",{className:DC,"aria-label":"separator",children:n})]})},MC=({pathItems:e,separator:t=PC,ariaLabel:s="Breadcrumb",className:i,children:o,labelClassName:n,onBeforeNavigate:r})=>{const a=g.useMemo(()=>e?.length?e:g.Children.toArray(o).filter(g.isValidElement).map(d=>{const u=d.props,{labelClassName:h,isLast:p,separator:f,...C}=u;return C}),[e,o]),l=g.useCallback(async d=>{const u=parseInt(d.key,10),h=a[u];if(r&&!await r()){d.domEvent.preventDefault();return}h.onClick?h.onClick(d.domEvent):h.href&&(window.location.href=h.href)},[a,r]),c=g.useMemo(()=>{if(a.length===0)return null;if(a.length<=3)return a.map((C,w)=>g.createElement(Uo,{...C,key:`item-${w}`,isLast:w===a.length-1,separator:t,labelClassName:n,onBeforeNavigate:r}));const d=a.at(0),u=a.slice(1,-2),h=a.at(-2),p=a.at(-1);if(!d||!h||!p)return null;const f=u.map((C,w)=>({key:String(w+1),label:typeof C.label=="string"?C.label:`Item ${w+1}`,disabled:C.disabled}));return m.jsxs(m.Fragment,{children:[g.createElement(Uo,{...d,key:"item-0",separator:t,labelClassName:n,onBeforeNavigate:r}),m.jsxs("li",{className:ne(EC),children:[m.jsx(yt,{menu:{items:f,onClick:l},placement:"bottom-start",matchReferenceWidth:!1,children:m.jsx("button",{type:"button","aria-label":"More breadcrumbs",className:d8,children:m.jsx(_.IconDots,{size:16})})}),m.jsx("span",{className:DC,children:t})]}),g.createElement(Uo,{...h,key:`item-${a.length-2}`,separator:t,labelClassName:n,onBeforeNavigate:r}),g.createElement(Uo,{...p,key:`item-${a.length-1}`,isLast:!0,separator:t,labelClassName:n,onBeforeNavigate:r})]})},[a,t,n,l,r]);return m.jsx("nav",{"aria-label":s,className:ne(o8,i),children:m.jsx("ol",{className:n8,children:c})})},lu=(e,t)=>({appearance:i,...o})=>m.jsx(xt,{...o,variant:e,appearance:i||t}),TC=(e,t)=>({variant:i,...o})=>m.jsx(xt,{...o,variant:i||t,appearance:e}),Kt=lu(qe.Primary,Me.Solid),Rs=lu(qe.Neutral,Me.Outlined),IC=lu(qe.Error,Me.Outlined),u8=TC(Me.Link,qe.Primary),h8=TC(Me.Ghost,qe.Primary),kC=({iconClassName:e,...t})=>m.jsx(IC,{...t,appearance:Me.Ghost,iconBefore:m.jsx(_.IconTrashX,{...se,className:e||""})}),AC=({value:e,textareaId:t,placeholder:s,className:i="",containerClassName:o="",disabled:n,invalid:r,readonly:a,disableTooltip:l,onChange:c})=>m.jsx(_t,{tooltip:l?null:e,triggerClassName:ne("flex",o),children:m.jsx("textarea",{id:t,placeholder:s,value:e||"",disabled:n,className:X("dial-textarea dial-input px-3 py-2",r&&"dial-input-error",n&&"dial-input-disable",a&&"dial-input-readonly",i),onChange:d=>!a&&c?.(d.currentTarget.value)})}),g8=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Tab","Enter","Escape","Home","End","Insert"],p8=(e,t,s,i)=>{if((t==="number"||s!==void 0||i!==void 0)&&!g8.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||i!==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(i!==void 0&&l>i){e.preventDefault();return}}}}},xi=({iconBefore:e,iconAfter:t,hideBorder:s,value:i,elementId:o,placeholder:n="",className:r="",containerClassName:a,tooltipTriggerClassName:l,type:c="text",disabled:d,readonly:u,invalid:h,onChange:p,min:f,max:C,prefix:w,suffix:v,textBeforeInput:b,textAfterInput:S,onBlur:y,defaultValue:x,tooltipText:F,hideTooltip:R=!1,inputRef:E})=>{const P=g.useRef(null),M=Ee.useMergeRefs([E,P]);g.useEffect(()=>{const N=P.current;if(!N)return;const O=q=>{q.preventDefault()};return N.addEventListener("wheel",O,{passive:!1}),()=>{N.removeEventListener("wheel",O)}},[]);const D=c==="number"||f!==void 0||C!==void 0,I=N=>{p8(N,c,f,C)},V=N=>{const O=N.currentTarget.value;if(D&&O!==""){const q=parseFloat(O);if(isNaN(q)&&O!=="-"&&O!=="."||!isNaN(q)&&(f!==void 0&&q<f||C!==void 0&&q>C))return}p?.(O||void 0)};return m.jsxs("div",{className:X("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(xi,{hideBorder:!0,containerClassName:"rounded-r-none border-r-0",className:"overflow-hidden overflow-ellipsis dial-small",value:b,disabled:!0,elementId:b+"textBefore"})}),w&&m.jsxs("p",{className:"text-secondary dial-small mr-2",children:[" ",w]}),m.jsx(Ne,{icon:e,className:X(!!e&&"mr-2")}),m.jsx(_t,{tooltip:R?void 0:F||i,triggerClassName:X(l,"flex-1"),children:m.jsx("input",{ref:M,type:c,autoComplete:c==="password"?"new-password":"off",id:o,placeholder:n,value:x?void 0:i??"",disabled:d,className:X("border-0 bg-transparent w-full truncate",r),onChange:N=>!u&&V?.(N),onKeyDown:I,onBlur:y,min:f,max:C,defaultValue:x})}),m.jsx(Ne,{icon:t,className:X(!!t&&"ml-2")}),v&&m.jsxs("p",{className:"text-secondary dial-small ml-2",children:[" ",v]}),S&&m.jsx("div",{className:"ml-2",children:m.jsx(xi,{hideBorder:!0,containerClassName:"rounded-l-none border-l-0",value:S,disabled:!0,elementId:S+"textAfter"})})]})},f8=/^0+\.(\d+)?$/,m8=/^0+/,LC=({label:e,optional:t,optionalText:s,description:i,error:o,captionDescription:n,readonly:r,orientation:a,elementId:l,fieldTitle:c,errorText:d,elementClassName:u,elementContainerClassName:h,containerClassName:p,defaultEmptyText:f,...C})=>m.jsx(pa,{label:e??c,error:o??d,optionalText:s,optional:t,description:i,captionDescription:n,readonly:r,orientation:a,elementId:l,className:p,defaultEmptyText:f,value:C.value,children:m.jsx(xi,{elementId:l,className:u,containerClassName:h,invalid:d!=null,...C})}),C8=({onChange:e,...t})=>{const s=i=>!i||i==="-"?i:String(i)?.match(f8)?String(i)?.replace(m8,"0"):Number(i);return m.jsx(LC,{type:"number",onChange:i=>e?.(s(i)),...t})},v8=({onChange:e,...t})=>m.jsx(LC,{type:"text",onChange:s=>e?.(s),...t}),w8=({fieldTitle:e,optional:t,elementId:s,elementClassName:i,containerClassName:o,elementContainerClassName:n,errorText:r,...a})=>m.jsxs("div",{className:ne("flex flex-col",o),children:[m.jsx(Fi,{fieldTitle:e,optional:t,htmlFor:s}),m.jsx(AC,{textareaId:s,className:i,containerClassName:n,...a}),m.jsx(Ws,{errorText:r})]}),cu=({label:e,switchId:t,isOn:s=!1,disabled:i,onChange:o})=>{const n=X("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",i?"pointer-events-none":"",i?s?"bg-controls-disable":"bg-layer-4":s?"bg-accent-primary":"bg-layer-4"),r=g.useCallback(a=>{a.stopPropagation(),o?.(!s)},[o,s]);return m.jsxs("div",{className:"flex flex-row items-center",role:"switch",children:[m.jsx("input",{type:"checkbox",onChange:r,id:t,disabled:i,className:"invisible w-0 h-0",checked:s}),m.jsx("label",{htmlFor:t,className:n,children:m.jsx("span",{className:X("size-3 rounded-full",i?s?"bg-layer-4":"bg-controls-disable":"bg-controls-enable-primary")})}),e&&m.jsx("span",{className:X("pl-2 dial-small",i?"text-secondary":"text-primary"),"aria-label":"switch-title",children:e})]})};var Tt=(e=>(e.Sm="sm",e.Md="md",e.Lg="lg",e))(Tt||{});const b8="z-[52] flex items-center justify-center bg-blackout md:p-4",S8="divide-tertiary divide-y",y8="flex flex-row justify-between py-4 px-6 items-center",x8={[Tt.Sm]:"dial-sm-popup",[Tt.Md]:"dial-md-popup",[Tt.Lg]:"dial-lg-popup"},Ii=({open:e=!1,header:t,portalId:s,className:i,overlayClassName:o,titleClassName:n,headerClassName:r,dividers:a=!0,children:l,footer:c,onClose:d,size:u=Tt.Md,hideClose:h=!1,closeOnOutsideClick:p=!0})=>{const{refs:f,context:C}=Ee.useFloating({open:e,onOpenChange:x=>{x||d?.(null)}}),w=Ee.useRole(C,{role:"dialog"}),v=Ee.useDismiss(C,{outsidePress:p}),{getFloatingProps:b}=Ee.useInteractions([w,v]);if(!e)return null;const S=typeof t=="string"?"dial-popup-heading":void 0,y=x=>x?typeof x=="string"?m.jsx("h3",{id:S,className:X("flex-1 min-w-0 mr-3 truncate dial-h3 text-primary",n),children:m.jsx(_t,{tooltip:x,children:x})}):x:m.jsx("span",{});return m.jsx(Ee.FloatingPortal,{id:s,children:m.jsx(Ee.FloatingOverlay,{className:X(b8,o),children:m.jsx(Ee.FloatingFocusManager,{context:C,children:m.jsxs("div",{ref:f.setFloating,...b(),role:"dialog","aria-modal":"true","aria-labelledby":S,className:X("dial-popup",x8[u],a&&S8,i),children:[m.jsxs("div",{className:ne(y8,r),children:[y(t),!h&&m.jsx(ru,{ariaLabel:"Close dialog",onClose:x=>d?.(x)})]}),m.jsx("div",{className:"flex-grow overflow-auto","aria-label":"popup-description",children:l}),c]})})})})};var vo=(e=>(e.Info="info",e.Danger="danger",e))(vo||{});const R8="flex justify-end gap-2 px-6 py-4",F8="text-secondary dial-small-150 px-6 py-4",E8="Cancel",D8="Ok",rc={[vo.Info]:{confirm:{variant:qe.Primary,appearance:Me.Solid},cancel:{variant:qe.Neutral,appearance:Me.Outlined}},[vo.Danger]:{container:"dial-danger-popup",confirm:{variant:qe.Error,appearance:Me.Solid},cancel:{variant:qe.Neutral,appearance:Me.Outlined}}},OC=({header:e,description:t,descriptionClassName:s,open:i=!1,confirmLabel:o=D8,cancelLabel:n=E8,isLoading:r=!1,disableConfirmButton:a=!1,className:l,confirmClassName:c,onClose:d,onConfirm:u,onCancel:h,children:p,dividers:f=!1,variant:C=vo.Info,size:w=Tt.Sm,footer:v})=>{const b=r?null:m.jsxs("div",{className:R8,children:[m.jsx(Rs,{label:n,onClick:()=>h?h():d?.()}),m.jsx(xt,{variant:rc[C].confirm?.variant,appearance:rc[C].confirm?.appearance,className:c,label:o,disabled:a,onClick:()=>u()})]}),S=g.useCallback(()=>r?m.jsx("div",{className:"px-6 py-4 h-[120px]",children:m.jsx(Fn,{size:50})}):p??(t?m.jsx("div",{className:X(F8,s),children:t}):null),[p,t,r,s]);return m.jsx(Ii,{open:i,header:e,className:X(rc[C].container,l),dividers:f,onClose:()=>d?.(),footer:v??b,size:w,children:S()})},du=({selectedItems:e,listClassName:t,listElementClassName:s,placeholder:i})=>e?.length?m.jsx("ul",{className:X("flex-row items-center truncate flex-wrap","flex gap-x-2 gap-y-1",t),children:e?.map(o=>m.jsx("li",{children:m.jsx(_t,{tooltip:o,children:m.jsx(ma,{tag:o,className:X([s])})})},o))}):i?m.jsx("span",{className:"text-secondary",children:i}):null,vg=e=>ge.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},ge.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"})),NC=({children:e,open:t,disabled:s=!1,selectedValue:i,valueClassName:o,inputClassName:n,onOpen:r,elementId:a,errorText:l,invalid:c,emptyValueText:d,placeholder:u})=>{const h=Array.isArray(i)&&i.length>0,p=typeof i=="string"&&!!i.trim(),f=h||p?i:u?void 0:d,C=s?void 0:r,w=()=>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:X("dial-input px-3 py-2 dial-input-field flex flex-row items-center w-full justify-between cursor-pointer",n,s&&"dial-input-disable",(l||c)&&"dial-input-error"),children:[m.jsx(_t,{tooltip:f==null?void 0:String(f),children:f||!u?m.jsx("span",{className:o,children:f}):m.jsx("span",{className:"text-secondary",children:u})}),!s&&m.jsx("div",{className:"flex-shrink-0",children:m.jsx(Ne,{icon:m.jsx(vg,{role:"img",width:ms,height:ms})})})]})}),l&&m.jsx(Ws,{errorText:l})]}),v=()=>m.jsx("div",{className:"w-full",onClick:C,children:m.jsxs("div",{className:X("dial-input px-3 py-2 flex flex-row items-center w-full justify-between cursor-pointer",s&&"dial-input-disable"),children:[m.jsx(du,{placeholder:u,selectedItems:f}),!s&&m.jsx("div",{className:"ml-1",children:m.jsx(Ne,{icon:m.jsx(vg,{role:"img",width:ms,height:ms})})})]})});return m.jsxs(m.Fragment,{children:[h?v():w(),t&&Rn.createPortal(e,document.body)]})},P8=({fieldTitle:e,htmlFor:t,disabled:s,selectedValue:i,radioButtons:o,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:w,onChangeRadioField:v,id:b,size:S=Tt.Md})=>{const[y,x]=g.useState(!1),F=g.useCallback(()=>{s||x(!0)},[s]),R=g.useCallback(()=>{x(!1),c?.()},[c]),E=g.useCallback(()=>{h(),R()},[h,R]);return m.jsxs("div",{className:"flex flex-col",children:[m.jsx(Fi,{fieldTitle:e,htmlFor:t}),m.jsx(NC,{disabled:s,open:y,selectedValue:n??o.find(P=>P.id===i)?.name,valueClassName:r,inputClassName:X(a,"py-2","px-3"),emptyValueText:l,onOpen:F,children:m.jsx(Ii,{open:y,onClose:R,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(Rs,{label:p,onClick:R}),m.jsx(Kt,{label:f,onClick:E,disabled:!C})]}),children:m.jsx("div",{className:"px-6 py-4",children:m.jsx(Hr,{radioButtons:o,labelClassName:"dial-small",activeRadioButton:w,onChange:v,elementId:b,orientation:pi.Column})})})})]})},M8="Create",T8="Cancel",I8="flex items-center justify-end gap-2 px-6 py-3",k8=({header:e,open:t=!1,submitLabel:s=M8,cancelLabel:i=T8,isLoading:o=!1,disableSubmitButton:n=!1,className:r,submitClassName:a,onClose:l,onSubmit:c,onCancel:d,children:u,dividers:h=!0,size:p=Tt.Md,footer:f})=>{const C=o?null:m.jsxs("div",{className:I8,children:[m.jsx(Rs,{label:i,onClick:()=>d?d():l?.()}),m.jsx(Kt,{className:a,label:s,disabled:n,onClick:()=>c()})]}),w=g.useCallback(()=>o?m.jsx("div",{className:"px-6 py-4 h-[120px]",children:m.jsx(Fn,{size:50})}):u??null,[u,o]);return m.jsx(Ii,{open:t,header:e,className:r,dividers:h,onClose:()=>l?.(),footer:f??C,size:p,children:w()})},A8=({onClick:e})=>m.jsx(_.IconEyeOff,{...se,className:"text-primary",onClick:e,role:"button","aria-label":"hide"}),L8=({onClick:e})=>m.jsx(_.IconEye,{...se,className:"text-primary",onClick:e,role:"button","aria-label":"show"}),HC=({...e})=>{const[t,s]=g.useState(!1),i=g.useCallback(o=>{s(o)},[]);return m.jsx(xi,{type:t?"text":"password",...e,hideTooltip:!t,iconAfter:t?m.jsx(A8,{onClick:()=>i(!1)}):m.jsx(L8,{onClick:()=>i(!0)})})},O8=({fieldTitle:e,optional:t,elementClassName:s,elementId:i,errorText:o,...n})=>m.jsxs("div",{className:"flex flex-col",children:[m.jsx(Fi,{fieldTitle:e,optional:t,htmlFor:i}),m.jsx(HC,{className:s,elementId:i,invalid:!!o,...n}),m.jsx(Ws,{errorText:o})]});var xn=(e=>(e.Small="small",e.Base="base",e))(xn||{});const N8={[xn.Small]:{textClassName:"text-xs px-1",containerClassName:"px-[6px] py-1 h-[22px]",iconSize:10,iconStroke:1},[xn.Base]:{textClassName:"text-sm px-2",containerClassName:"px-3 py-2 h-[38px]",iconSize:18,iconStroke:1.5}},uu=({elementId:e,value:t,placeholder:s="Search...",disabled:i,readonly:o,invalid:n,className:r,containerClassName:a,onChange:l,onBlur:c,size:d=xn.Base,allowClear:u=!0})=>{const[h,p]=g.useState(t||"");g.useEffect(()=>{p(t||"")},[t]);const f=g.useCallback(v=>{p(v),l?.(v)},[l]),C=N8[d],w=g.useCallback(()=>{f("")},[f]);return m.jsxs("div",{className:ne("dial-input flex flex-row items-center justify-between",n&&"dial-input-error",i&&"dial-input-disable",o&&"dial-input-readonly",C.containerClassName,a),children:[m.jsx(Ne,{className:X(i?"text-secondary":"text-primary"),icon:m.jsx(_.IconSearch,{size:C.iconSize,stroke:C.iconStroke})}),m.jsx("input",{id:e,type:"text",autoComplete:"off",placeholder:s,value:h??"",disabled:i,readOnly:o,className:X("border-0 bg-transparent w-full",r,C.textClassName),onChange:v=>!o&&f(v.currentTarget.value),onBlur:c}),h&&!o&&!i&&u&&m.jsx(Ne,{className:"text-primary cursor-pointer",icon:m.jsx(_.IconX,{size:C.iconSize,stroke:C.iconStroke,onClick:w,"aria-label":"Clear search",role:"button"})})]})},H8=({placeholder:e="",selectedItems:t=[],listClassName:s,listElementClassName:i,containerClassName:o,inputClassName:n,onChange:r})=>{const[a,l]=g.useState(""),c=g.useCallback(u=>{u.key==="Enter"&&(r([...t,u.currentTarget.value]),l("")),(u.key==="Backspace"||u.key==="Delete")&&t.length&&!a&&r(t.slice(0,-1))},[t,r,a]),d=g.useCallback(u=>{l(u.target.value)},[l]);return m.jsxs("div",{className:X(["dial-input px-3 py-2 flex flex-row items-center flex-wrap w-fit gap-2",o]),children:[m.jsx(du,{selectedItems:t,listClassName:s,listElementClassName:i}),m.jsx("input",{type:"text",value:a,className:X(["border-0 bg-transparent p-0",n]),placeholder:t?.length?"":e,onKeyDown:c,onChange:d})]})},G8=({initialTags:e=[],fieldTitle:t,optional:s,elementId:i,placeholder:o,captionDescription:n,errorText:r,invalid:a,disabled:l,onChange:c})=>{const d=g.useRef(null),[u,h]=g.useState(e),[p,f]=g.useState(""),[C,w]=g.useState(!1),v=F=>{const R=F.trim().replace(/,$/,"");if(R&&!u.includes(R)){const E=[R,...u];h(E),c?.(E)}},b=F=>{(F.key===","||F.key==="Enter")&&(F.preventDefault(),v(p),f(""))},S=()=>{p.trim()&&(v(p),f(""))},y=F=>{const R=u.filter((E,P)=>P!==F);h(R),c?.(R)},x=()=>r?m.jsx(Ws,{errorText:r}):n?m.jsx("div",{className:"dial-tiny text-secondary mt-1",children:n}):null;return g.useEffect(()=>{const F=new ResizeObserver(()=>{if(d.current){const R=d.current.scrollHeight>d.current.clientHeight+10;w(R)}});return d.current&&F.observe(d.current),()=>F.disconnect()},[u]),m.jsxs("div",{className:X("flex flex-col w-full"),children:[m.jsx(Fi,{fieldTitle:t,optional:s,htmlFor:i}),m.jsx("div",{className:X("dial-input min-h-[38px] p-[6px]",a&&"dial-input-error",l&&"dial-input-disable"),children:m.jsxs("div",{ref:d,className:X("flex flex-wrap gap-2 items-center",C?"flex-col-reverse":"flex-row"),children:[u.map((F,R)=>m.jsx(ma,{tag:F,remove:l?void 0:()=>y(R)},F+R)),m.jsx("input",{type:"text",value:p,onChange:F=>f(F.target.value),onKeyDown:b,onBlur:S,className:X("dial-input-no-border outline-none border-none w-full min-w-[100px] flex-1 p-1"),placeholder:o,disabled:l})]})}),x()]})},B8="dial-input flex w-full items-center justify-between gap-2 dial-small cursor-pointer",V8="w-full rounded flex flex-col",ac="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",z8="bg-accent-primary-alpha",W8="bg-accent-primary-alpha border-l border-accent-primary border-1",wg="opacity-75",_8=352,j8=m.jsx(_.IconChevronDown,{size:16}),GC=({options:e,selectedValues:t,handleRemoveTag:s})=>m.jsx("div",{className:"flex flex-wrap w-full items-center gap-1",children:t.map(i=>{const o=e.find(r=>r.value===i)?.label??i,n=e.find(r=>r.value===i)?.icon;return m.jsx(ma,{tag:o,remove:r=>s?.(r,i),iconBefore:n?m.jsx(Ne,{icon:n}):null,className:"max-w-full"},i)})});var ua=(e=>(e.Sm="sm",e.Md="md",e))(ua||{}),ha=(e=>(e.Primary="Primary",e.Secondary="Secondary",e))(ha||{});const BC=({options:e,multiple:t=!1,elementId:s,value:i,defaultValue:o,variant:n=ha.Primary,size:r=ua.Md,prefix:a,customSelectedValue:l,placeholder:c="Select...",searchable:d=!1,searchPlaceholder:u,selectAll:h=!1,invalid:p,selectAllLabel:f="Select all",emptyStateTitle:C="No options available",emptyStateDescription:w,emptyStateIcon:v,disabled:b=!1,className:S,listClassName:y,closable:x=!1,header:F,footer:R,onClose:E,onChange:P,inlineSearch:M=!1,dismissRef:D,onFooterClick:I,open:V,onOpenChange:N,onInlineQueryChange:O})=>{const q=g.useId(),[Q,L]=g.useState(!1),re=V!==void 0,W=re?!!V:Q,ee=g.useCallback(G=>{re||L(G),N?.(G)},[re,N]),[Y,Z]=g.useState(M&&l||""),j=g.useRef(null),fe=g.useCallback(G=>{G!==Y&&(Z(G),O?.(G))},[O,Y]),Ce=i!==void 0,[k,ce]=g.useState(o),we=Ce?i:k,z=g.useMemo(()=>t?Array.isArray(we)?we:[]:typeof we=="string"?[we]:[],[we,t]),H=g.useMemo(()=>{const G=Y.trim().toLowerCase();return G?e.filter(Se=>Se.label.toLowerCase().includes(G)):e},[e,Y]);g.useEffect(()=>{!W&&!M&&fe("")},[M,W,fe]),g.useEffect(()=>{M&&!W&&l&&fe(l||"")},[l,M,W,fe]);const U=g.useCallback(G=>{Ce||ce(G),P?.(G)},[Ce,P]),oe=g.useCallback(G=>{if(t){const Se=new Set(z);Se.has(G)?Se.delete(G):Se.add(G),U(Array.from(Se));return}if(U(G),M){const Se=e.find(lt=>lt.value===G);Se&&(fe(Se.label),O?.(Se.label))}ee(!1)},[t,U,M,ee,z,e,fe,O]),he=g.useCallback((G,Se)=>{if(G.stopPropagation(),!t){U("");return}const lt=z.filter(us=>us!==Se);U(lt)},[t,z,U]),ye=g.useMemo(()=>H.filter(G=>!G.disabled),[H]),ie=g.useMemo(()=>ye.filter(G=>z.includes(G.value)).length,[ye,z]),be=G=>{M&&!t&&!G&&oe(Y),ee(G)},Re=ye.length>0&&ie===ye.length,ke=ie>0&&!Re,me=()=>{if(!(!t||ye.length===0))if(Re){const G=new Set(ye.map(lt=>lt.value)),Se=z.filter(lt=>!G.has(lt));U(Se)}else{const G=new Set(z);ye.forEach(Se=>G.add(Se.value)),U(Array.from(G))}},ve=z.length>0;g.useEffect(()=>{W&&M&&!t&&!b&&requestAnimationFrame(()=>{const G=j.current;if(!G)return;G.focus();const Se=G.value?.length??0;G.setSelectionRange?.(Se,Se)})},[W,M,t,b]);const He=!t&&ve?z[0]:void 0,We=g.useMemo(()=>He?e.find(G=>G.value===He):void 0,[e,He]),Pe=g.useCallback(()=>!t||z.length===0?null:m.jsx(GC,{options:e,selectedValues:z,handleRemoveTag:he}),[t,e,z,he]),kt=g.useCallback(()=>t?ve?Pe():m.jsx("span",{className:"text-secondary truncate",children:c}):We?m.jsxs(m.Fragment,{children:[We.icon&&m.jsx(Ne,{icon:We.icon}),m.jsx(ot,{text:a?`${a} ${We.label}`:We.label}),We?.description&&m.jsx("div",{className:"text-secondary dial-small",children:We.description})]}):l&&i?l:m.jsx("span",{className:"text-secondary truncate",children:c}),[ve,t,l,a,i,c,Pe,We]);g.useImperativeHandle(D,()=>({dismiss:()=>{ee(!1)}}));const at=g.useCallback(()=>{fe(z.length===1?We?.label??Y:"")},[Y,z.length,fe,We?.label]),ds=g.useCallback(()=>{b||(ee(!W),M&&!t&&(at(),j.current?.focus()))},[b,M,W,t,at,ee]);return m.jsx(yt,{open:W,onOpenChange:be,disabled:b,closable:x,onClose:E,placement:"bottom-start",allowedPlacements:["bottom-start","top-start"],maxDropdownHeight:d?null:_8,listClassName:y,renderOverlay:()=>m.jsxs("div",{id:`list-${s||q}`,role:"listbox","aria-multiselectable":t||void 0,className:V8,children:[F&&m.jsx(m.Fragment,{children:typeof F=="function"?F():F}),(d||x)&&e.length>8&&m.jsxs("div",{className:"flex items-center gap-2 px-2 pt-2",children:[d&&m.jsx(uu,{placeholder:u,onChange:fe,value:Y,elementId:`search-${s||q}`}),x&&m.jsx(xt,{"aria-label":"Close select",className:"shrink-0",iconBefore:m.jsx(_.IconX,{size:16}),onClick:G=>{E?.(G),ee(!1)}})]}),t&&h&&ye.length>0&&m.jsx("div",{className:X(ac,"mt-2"),children:m.jsx(rn,{id:`${s||q}-selectAll`,label:f,checked:Re,indeterminate:ke,onChange:me,ariaLabel:f})}),m.jsx("div",{className:X("overflow-y-auto max-h-[352px]",M&&H.length===0?"":"py-1"),children:H.length===0?!M&&m.jsx("div",{className:"px-2 py-3",children:m.jsx(En,{icon:v??m.jsx(_.IconClipboardX,{size:24,stroke:.5}),title:C,description:w})}):H.map(G=>{const Se=z.includes(G.value);return t?m.jsxs("div",{role:"option","aria-selected":Se,"aria-disabled":!!G.disabled,className:X(ac,Se&&z8,G.disabled&&wg,"w-full"),children:[m.jsx(rn,{id:`${s||q}-${G.value}`,label:m.jsxs("span",{className:"flex w-full flex-1 pl-2 min-w-0 items-center gap-2 text-primary",children:[G.icon&&m.jsx(Ne,{icon:G.icon}),m.jsx("span",{className:"truncate",children:G.label})]}),checked:Se,disabled:G.disabled,onChange:()=>!G.disabled&&oe(G.value),ariaLabel:G.label}),G.description&&m.jsx("div",{className:"text-secondary dial-small",children:G.description})]},G.value):m.jsx("button",{role:"option",type:"button","aria-selected":Se,"aria-disabled":!!G.disabled,disabled:G.disabled,className:X(ac,Se&&W8,G.disabled&&wg),onClick:()=>!G.disabled&&oe(G.value),children:m.jsxs("div",{className:"flex items-center gap-2 w-full",children:[G.icon&&m.jsx(Ne,{icon:G.icon}),m.jsx(ot,{text:G.label}),G.description&&m.jsx("div",{className:"text-secondary dial-small",children:G.description})]})},G.value)})}),R&&m.jsx("div",{onClick:G=>{I?.(G),I&&ee(!1)},children:typeof R=="function"?R():R})]}),children:m.jsxs("div",{role:"button",tabIndex:0,"aria-roledescription":"button to open select list","aria-haspopup":"listbox","aria-expanded":W,"aria-controls":`list-${s||q}`,className:ne(B8,b&&"opacity-75 !cursor-not-allowed",r===ua.Sm?"min-h-[25px] px-1.5 py-1":"min-h-[38px] px-3 py-2",p&&"dial-input-error",n===ha.Secondary?"!bg-layer-4":"",S),onMouseDown:G=>{b||M&&!t&&(at(),G.preventDefault())},onClick:()=>{ds()},onKeyDown:G=>{(G.key===" "||G.code==="Space")&&(G.preventDefault(),ds())},children:[M&&!t?m.jsx("div",{className:"flex min-w-0 items-center gap-2 text-primary flex-1",children:m.jsx("input",{id:`inline-${s||q}`,type:"text",placeholder:u??c,value:Y||"",onChange:G=>fe(G.currentTarget.value.trimStart()),onFocus:()=>!b&&ee(!0),onMouseDown:G=>{at(),G.stopPropagation()},onClick:G=>{G.stopPropagation()},onKeyDown:G=>{G.stopPropagation()},className:"bg-transparent outline-none w-full dial-small",ref:j,disabled:b,"aria-disabled":b,autoComplete:"off"})}):m.jsx("div",{className:"flex w-full min-w-0 items-center gap-2 text-primary",children:kt()}),!M&&m.jsx(Ne,{icon:j8,className:X("text-primary",W&&"rotate-180")})]})})},U8=({fieldTitle:e,optional:t,captionDescription:s,containerClassName:i,selectClassName:o,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(GC,{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(pa,{elementId:r,label:e,optional:t,description:a,error:n,captionDescription:s,className:i,readonly:l,value:h(),defaultEmptyText:d,children:m.jsx(BC,{className:o,value:c,elementId:r,invalid:!!n,...u})})};function VC(e){let t=null;return()=>(t==null&&(t=e()),t)}function $8(e,t){return e.filter(s=>s!==t)}function K8(e,t){const s=new Set,i=n=>s.add(n);e.forEach(i),t.forEach(i);const o=[];return s.forEach(n=>o.push(n)),o}class q8{enter(t){const s=this.entered.length,i=o=>this.isNodeInDocument(o)&&(!o.contains||o.contains(t));return this.entered=K8(this.entered.filter(i),[t]),s===0&&this.entered.length>0}leave(t){const s=this.entered.length;return this.entered=$8(this.entered.filter(this.isNodeInDocument),t),s>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class Y8{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(i=>{const o=this.config.exposeProperties[i];o!=null&&(s[i]={value:o(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 hu="__NATIVE_FILE__",zC="__NATIVE_URL__",WC="__NATIVE_TEXT__",_C="__NATIVE_HTML__",bg=Object.freeze(Object.defineProperty({__proto__:null,FILE:hu,HTML:_C,TEXT:WC,URL:zC},Symbol.toStringTag,{value:"Module"}));function lc(e,t,s){const i=t.reduce((o,n)=>o||e.getData(n),"");return i??s}const td={[hu]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[_C]:{exposeProperties:{html:(e,t)=>lc(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[zC]:{exposeProperties:{urls:(e,t)=>lc(e,t,"").split(`
|
|
62
62
|
`),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[WC]:{exposeProperties:{text:(e,t)=>lc(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function Z8(e,t){const s=td[e];if(!s)throw new Error(`native type ${e} has no configuration`);const i=new Y8(s);return i.loadDataTransfer(t),i}function cc(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(td).filter(s=>{const i=td[s];return i?.matchesTypes?i.matchesTypes.some(o=>t.indexOf(o)>-1):!1})[0]||null}const X8=VC(()=>/firefox/i.test(navigator.userAgent)),jC=VC(()=>!!window.safari);class Sg{interpolate(t){const{xs:s,ys:i,c1s:o,c2s:n,c3s:r}=this;let a=s.length-1;if(t===s[a])return i[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 i[d]}a=Math.max(0,c);const u=t-s[a],h=u*u;return i[a]+o[a]*u+n[a]*h+r[a]*u*h}constructor(t,s){const{length:i}=t,o=[];for(let p=0;p<i;p++)o.push(p);o.sort((p,f)=>t[p]<t[f]?-1:1);const n=[],r=[];let a,l;for(let p=0;p<i-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 w=n[p+1],v=a+w;c.push(3*v/((v+w)/f+(v+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],w=f+c[p+1]-h-h;d.push((h-f-w)*C),u.push(w*C*C)}this.xs=t,this.ys=s,this.c1s=c,this.c2s=d,this.c3s=u}}const Q8=1;function UC(e){const t=e.nodeType===Q8?e:e.parentElement;if(!t)return null;const{top:s,left:i}=t.getBoundingClientRect();return{x:i,y:s}}function wr(e){return{x:e.clientX,y:e.clientY}}function J8(e){var t;return e.nodeName==="IMG"&&(X8()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function eA(e,t,s,i){let o=e?t.width:s,n=e?t.height:i;return jC()&&e&&(n/=window.devicePixelRatio,o/=window.devicePixelRatio),{dragPreviewWidth:o,dragPreviewHeight:n}}function tA(e,t,s,i,o){const n=J8(t),a=UC(n?e:t),l={x:s.x-a.x,y:s.y-a.y},{offsetWidth:c,offsetHeight:d}=e,{anchorX:u,anchorY:h}=i,{dragPreviewWidth:p,dragPreviewHeight:f}=eA(n,t,c,d),C=()=>{let F=new Sg([0,.5,1],[l.y,l.y/d*f,l.y+f-d]).interpolate(h);return jC()&&n&&(F+=(window.devicePixelRatio-1)*f),F},w=()=>new Sg([0,.5,1],[l.x,l.x/c*p,l.x+p-c]).interpolate(u),{offsetX:v,offsetY:b}=o,S=v===0||v,y=b===0||b;return{x:S?v:w(),y:y?b:C()}}class sA{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 iA(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}function yg(e){for(var t=1;t<arguments.length;t++){var s=arguments[t]!=null?arguments[t]:{},i=Object.keys(s);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(s).filter(function(o){return Object.getOwnPropertyDescriptor(s,o).enumerable}))),i.forEach(function(o){iA(e,o,s[o])})}return e}class oA{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,i){return this.sourcePreviewNodeOptions.set(t,i),this.sourcePreviewNodes.set(t,s),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,s,i){this.sourceNodes.set(t,s),this.sourceNodeOptions.set(t,i);const o=r=>this.handleDragStart(r,t),n=r=>this.handleSelectStart(r);return s.setAttribute("draggable","true"),s.addEventListener("dragstart",o),s.addEventListener("selectstart",n),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),s.removeEventListener("dragstart",o),s.removeEventListener("selectstart",n),s.setAttribute("draggable","false")}}connectDropTarget(t,s){const i=r=>this.handleDragEnter(r,t),o=r=>this.handleDragOver(r,t),n=r=>this.handleDrop(r,t);return s.addEventListener("dragenter",i),s.addEventListener("dragover",o),s.addEventListener("drop",n),()=>{s.removeEventListener("dragenter",i),s.removeEventListener("dragover",o),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 yg({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 yg({anchorX:.5,anchorY:.5,captureDraggingState:!1},s||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(bg).some(s=>bg[s]===t)}beginDragNativeItem(t,s){this.clearCurrentDragSourceNode(),this.currentNativeSource=Z8(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 i;return(i=this.rootElement)===null||i===void 0?void 0:i.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,i){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=o=>{const n=this.sourceNodes.get(o);return n&&UC(n)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=o=>!!(o&&this.document&&this.document.body&&this.document.body.contains(o)),this.endDragIfSourceWasRemovedFromDOM=()=>{const o=this.currentDragSourceNode;o==null||this.isNodeInDocument(o)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=o=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(o||[],{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=o=>{if(o.defaultPrevented)return;const{dragStartSourceIds:n}=this;this.dragStartSourceIds=null;const r=wr(o);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(n||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:r});const{dataTransfer:a}=o,l=cc(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:w}=this.getCurrentSourcePreviewNodeOptions(),S=tA(u,h,r,{anchorX:p,anchorY:f},{offsetX:C,offsetY:w});a.setDragImage(h,S.x,S.y)}}try{a?.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(o.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&&(o.target&&!o.target.hasAttribute||!o.target.hasAttribute("draggable")))return;o.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=o=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var n;(n=this.currentNativeSource)===null||n===void 0||n.loadDataTransfer(o.dataTransfer)}if(!this.enterLeaveCounter.enter(o.target)||this.monitor.isDragging())return;const{dataTransfer:a}=o,l=cc(a);l&&this.beginDragNativeItem(l,a)},this.handleTopDragEnter=o=>{const{dragEnterTargetIds:n}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=o.altKey,n.length>0&&this.actions.hover(n,{clientOffset:wr(o)}),n.some(a=>this.monitor.canDropOnTarget(a))&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=o=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var n;(n=this.currentNativeSource)===null||n===void 0||n.loadDataTransfer(o.dataTransfer)}},this.handleTopDragOver=o=>{const{dragOverTargetIds:n}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none");return}this.altKeyPressed=o.altKey,this.lastClientOffset=wr(o),this.scheduleHover(n),(n||[]).some(a=>this.monitor.canDropOnTarget(a))?(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?o.preventDefault():(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=o=>{this.isDraggingNativeItem()&&o.preventDefault(),this.enterLeaveCounter.leave(o.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=o=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var n;o.preventDefault(),(n=this.currentNativeSource)===null||n===void 0||n.loadDataTransfer(o.dataTransfer)}else cc(o.dataTransfer)&&o.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=o=>{const{dropTargetIds:n}=this;this.dropTargetIds=[],this.actions.hover(n,{clientOffset:wr(o)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=o=>{const n=o.target;typeof n.dragDrop=="function"&&(n.tagName==="INPUT"||n.tagName==="SELECT"||n.tagName==="TEXTAREA"||n.isContentEditable||(o.preventDefault(),n.dragDrop()))},this.options=new sA(s,i),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new q8(this.isNodeInDocument)}}const nA=function(t,s,i){return new oA(t,s,i)},rA=({onChange:e,emptyTextFirstLine:t,emptyTextSecondLine:s,emptyButtonLabel:i,acceptTypes:o,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),w=g.useCallback(D=>{const I=D.target.files;if(I&&I.length>0){const V=Array.from(I);c?.(V)?C(!0):e(V)}},[c,e]),v=g.useCallback(D=>n&&D?.length>n,[n]),b=g.useMemo(()=>f||v(h),[f,h,v]),S=()=>{p([]),C(!1)};g.useEffect(()=>{S()},[o]);const[{isOver:y,canDrop:x},F]=op(()=>({accept:[hu],drop(D){const I=D.files;!c?.(I)&&!v(I)&&e(I),S()},collect:D=>({isOver:D.isOver(),canDrop:D.canDrop()})}),[w]),R=D=>{(D.key==="Enter"||D.key==="Space")&&(D.preventDefault(),u.current?.click())},E=D=>{D?.preventDefault();const I=Array.from(D.dataTransfer?.items??[]);C(!!c?.(I)),p(I)},P=D=>{D.target===D.currentTarget&&S()},M=X("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 F(d),m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:M,ref:d,onDragOver:E,onDragLeave:P,children:[m.jsxs("label",{htmlFor:"file",tabIndex:0,onKeyDown:R,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}),i&&m.jsx(Kt,{appearance:Me.Ghost,label:i,onClick:()=>u.current?.click()})]}),m.jsx("input",{multiple:r,id:"file",type:"file",ref:u,hidden:!0,accept:o,onChange:w})]}),m.jsx(m.Fragment,{children:f?m.jsx(Ws,{errorText:a}):v(h)&&m.jsx(Ws,{errorText:l})})]})},aA=({iconBefore:e,className:t,errorText:s,...i})=>{const o=i.invalid,n=()=>m.jsx("div",{className:"mr-2",children:o?m.jsx(_.IconExclamationCircle,{...se,className:"text-error"}):e});return m.jsx(xi,{...i,iconBefore:n(),tooltipTriggerClassName:"flex-1 min-w-0",className:X(o?"text-error":"",t),tooltipText:o&&s?s:void 0,hideBorder:!0})},lA=e=>{const{files:t,iconBeforeInput:s,dynamicIcon:i,onChange:o,isInvalid:n,errorText:r,removeButtonAriaLabel:a}=e,l=(u,h)=>{u.stopPropagation(),o(t?.filter(p=>p.name!==h)||[])},c=u=>m.jsx(kC,{"aria-label":a,onClick:h=>l(h,u)}),d=u=>{o(u)};return!t||t.length===0?m.jsx($1,{backend:nA,children:m.jsx(rA,{...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(aA,{elementId:u.name,value:u.name,iconAfter:c(u.name),iconBefore:s||i?.(u.name),invalid:n?.(u),errorText:r},u.name+h))})})},cA=({onChange:e,fieldTitle:t,elementId:s,files:i,maxFilesCount:o,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(v=>v?.some(b=>b.type===""||!(l==="/"||l?.toLowerCase()?.includes(b?.type?.toLowerCase()))),[l]),w=g.useCallback(v=>{const b=v.target.files;if(b&&b.length>0){const S=Array.from(b);C(S)||e([...i||[],...S])}},[e,i,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(Fi,{fieldTitle:`${t}: ${a?i?.length||0:""}`,htmlFor:s}),a&&!!i?.length&&m.jsxs("div",{className:"flex flex-row items-center gap-x-2",children:[m.jsx(Kt,{appearance:Me.Ghost,className:"!text-error",iconBefore:m.jsx(_.IconTrashX,{...se}),label:c,onClick:f}),(o?o>i?.length:!0)&&m.jsx(Kt,{appearance:Me.Ghost,iconBefore:m.jsx(_.IconPlus,{...se}),label:d,onClick:p})]})]}),i&&i.length>0&&m.jsx("input",{id:"file",type:"file",multiple:a,ref:h,hidden:!0,accept:l,onChange:w}),m.jsx(lA,{files:i,onChange:e,acceptTypes:l,maxFilesCount:o,multiple:a,fileFormatError:n,fileCountError:r,getIsFileFormatError:C,...u})]})},dA=m.jsx(_.IconChevronDown,{size:16}),uA=m.jsx(_.IconChevronUp,{size:16}),sd=({variant:e,appearance:t,items:s,...i})=>{const[o,n]=g.useState(!1),r=g.useMemo(()=>o?uA:dA,[o]);return m.jsx("div",{children:m.jsx(yt,{menu:{items:s},onOpenChange:a=>n(a),children:m.jsx(xt,{...i,iconAfter:r,variant:e||qe.Primary,appearance:t||Me.Solid})})})},hA="w-full h-full grid grid-rows-[auto_1fr] gap-5 p-6 overflow-hidden min-w-0 bg-layer-1",xg="w-full text-secondary flex items-center gap-2",gA="flex min-h-0 min-w-0 h-full gap-4 overflow-hidden",pA="flex flex-col flex-1 min-h-0 min-w-0 h-full gap-4",fA="w-full h-full rounded bg-layer-3 text-secondary overflow-auto min-w-0",mA="flex-1 w-full rounded text-secondary overflow-auto min-h-0 min-w-0",CA="opacity-0 pointer-events-none group-hover/grid-row:opacity-100 group-hover/grid-row:pointer-events-auto",vA=280,wA="Files",zs=20,bA="Files",dc=".dial_folder",SA=280,yA=460,uc=44,xA=56,RA=800;var Te=(e=>(e.ITEM="item",e.FOLDER="folder",e))(Te||{}),$C=(e=>(e.FILE="FILE",e.PROMPT="PROMPT",e.CONVERSATION="CONVERSATION",e.APPLICATION="APPLICATION",e.TOOLSET="TOOL_SET",e))($C||{}),ki=(e=>(e.READ="READ",e.WRITE="WRITE",e.SHARE="SHARE",e))(ki||{});const Ri=(e,t)=>{if(!(!e||!e.length||!t))for(const s of e){if(s.path===t)return s;const i=Ri(s.items,t);if(i)return i}},Rg=(e,t)=>{if(!e?.length)return;if(!t)return e[0];const s=Ri(e,t);if(s&&s.nodeType===Te.FOLDER)return s;const i=t.split("/").filter(Boolean);if(i.length<=1)return e[0];const o="/"+i.slice(0,i.length-1).join("/");return Ri(e,o)??e[0]},lo=e=>(e??"").toLowerCase(),FA=e=>lo(e).replace(/^\./,""),EA=e=>{if(!e)return[];const t=[],s=i=>{const o=i.items??[];for(const n of o)t.push(n),n.nodeType===Te.FOLDER&&s(n)};return s(e),t},id=e=>(e.name??e.path.split("/").pop()??"").startsWith("."),gu=e=>{if(!e)return"0 bytes";const t=1024,s=t*1024;return e>=s?`${(e/s).toFixed(1)} MB`:e>=t?`${(e/t).toFixed(0)} KB`:`${e} bytes`},DA=(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 KC(e,t,s){if(!e||e.includes("*/*"))return!0;const i=t.toLowerCase(),o=s&&s.includes(".")?`.${s.split(".").at(-1).toLowerCase()}`:void 0;return e.some(n=>{const r=n.toLowerCase();if(r.startsWith("."))return o===r;if(r.endsWith("/*")){const a=r.slice(0,-1);return i.startsWith(a)}return i===r})}const PA={size:10,stroke:2},MA=26;var Wt=(e=>(e.File="file",e.Folder="folder",e))(Wt||{});const TA=({name:e,type:t,shared:s=!1,loading:i=!1,sharedIndicatorClassName:o,...n})=>{const r=a=>m.jsxs("span",{className:"inline-flex relative text-secondary",role:"img",children:[a,s&&m.jsx("span",{className:"absolute -bottom-0.5 -left-0.5",children:m.jsx(ln,{className:o})})]});if(i)return r(m.jsx(Fn,{}));if(t===Wt.File){const a=e.includes(".")?e.split(".").pop():null;return m.jsx(hd,{...n,extension:a??"",className:"text-secondary",indicator:s?m.jsx(ln,{className:o}):null,label:"File type icon"})}return t===Wt.Folder?r(m.jsx(Ne,{icon:m.jsx(_.IconFolder,{className:n.className,size:n.size??se.size,stroke:n.stroke??se.stroke}),className:"inline-block align-middle"})):null},IA=({name:e,type:t,elementId:s,loading:i=!1,shared:o=!1,iconClassName:n,iconIndicator:r,iconLabel:a,iconSize:l,iconStroke:c,inputInvalid:d,inputInvalidMessage:u,inputContainerClassName:h,inputIconAfter:p,inputRef:f,onChange:C,sharedIndicatorClassName:w})=>{const v=()=>d?m.jsx(_t,{tooltip:u,children:p||m.jsx(_.IconAlertCircleFilled,{...se,className:"text-error","aria-label":"alert"})}):null;return m.jsxs("div",{className:"flex gap-2 items-center",children:[m.jsx(TA,{name:e,type:t,label:a,className:n,indicator:r,size:l,stroke:c,loading:i,shared:o,sharedIndicatorClassName:w}),m.jsx(xi,{containerClassName:ne("!h-6 py-[1px] pl-[7px] pr-[7px]",h),elementId:s,value:e,onChange:C,invalid:d,hideTooltip:!0,iconAfter:v(),inputRef:f})]})};function qC({value:e,isEditing:t,restoreOnCancel:s=!0,onValidate:i,onSave:o,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(!i)return p(),!0;const S=i(b);return S?(p(!0,S),!1):(p(),!0)},[i,p]),C=g.useCallback(b=>{const S=b??"";a(S),f(S)},[f]),w=g.useCallback(()=>{f(r)?o?.(r):h.current?.focus()},[f,o,r]),v=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(),v())};return b.addEventListener("keydown",S),()=>b.removeEventListener("keydown",S)},[t,w,v]),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)?w():b.focus())};return b.addEventListener("blur",S),()=>{b.removeEventListener("blur",S)}},[t,r,f,w]),{inputRef:h,value:r,onChange:C,invalid:l,invalidMessage:d}}const ga=({name:e,type:t,elementId:s,editing:i=!1,loading:o=!1,shared:n=!1,iconSize:r=ms,validate:a,onSave:l,onCancel:c,inputContainerClassName:d,sharedIndicatorClassName:u,...h})=>{const{value:p,invalid:f,invalidMessage:C,onChange:w,inputRef:v}=qC({value:e,isEditing:i,onValidate:a,onCancel:c,onSave:l});return i?m.jsx(IA,{type:t,name:p,elementId:s,inputInvalid:f,inputInvalidMessage:C,inputRef:v,onChange:w,iconSize:r,inputContainerClassName:d,sharedIndicatorClassName:u}):t===Wt.Folder?m.jsx(xa,{name:e,loading:o,shared:n,iconSize:r,className:"max-w-[428px] truncate",sharedIndicatorClassName:u}):m.jsx(ya,{className:"max-w-[428px]",...h,name:e,shared:n,iconSize:r,sharedIndicatorClassName:u})},YC=e=>{const[t,s]=g.useState(e?.expandedPaths??new Set),i=g.useMemo(()=>!!e?.onExpandedPathsChange,[e?.onExpandedPathsChange]),o=g.useMemo(()=>i?e?.expandedPaths??new Set:t,[i,e?.expandedPaths,t]);g.useEffect(()=>{i&&e?.expandedPaths&&s(new Set(e.expandedPaths))},[i,e?.expandedPaths]);const n=g.useCallback(d=>{i?e?.onExpandedPathsChange?.(d):s(d)},[i,e]),r=g.useCallback(d=>{const u=new Set(o);u.has(d)?u.delete(d):u.add(d),n(u)},[o,n]),a=g.useCallback(()=>{n(new Set)},[n]),l=g.useCallback(d=>{const u=new Set(o);u.add(d),n(u)},[o,n]),c=g.useCallback(d=>{const u=new Set(o);u.delete(d),n(u)},[o,n]);return{expandedPaths:o,setExpandedPaths:n,togglePath:r,collapseAll:a,expandPath:l,collapsePath:c,isControlled:i}},kA=({items:e,showFiles:t=!1,expandedPaths:s,loadingPaths:i=new Set,loadedPaths:o=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:w,onRenameCancel:v,onRenameValidate:b,onExpandedPathsChange:S})=>{const{expandedPaths:y,togglePath:x}=YC({expandedPaths:s??new Set,onExpandedPathsChange:S}),F=E=>{f?.(E),x(E.path)},R=(E,P)=>E.map(M=>{const{path:D,nodeType:I,name:V,items:N}=M,O=I===Te.FOLDER;if(!d&&id(M))return null;if(!O&&!t)return;const q=Array.isArray(N)&&N.length>0&&N.some(k=>k.nodeType===Te.FOLDER||t),Q=y.has(D),L=r===D,re=i.has(D),W=u===D,ee=o.has(D),Y=n.has(D),Z=p&&h&&D===p&&O,j=b&&(k=>b(k,M)),fe=L?"bg-accent-primary-alpha border-l-2 border-l-accent-primary rounded":"border-l-2 border-l-transparent",Ce=Z?[]:C?.(M)??[];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(yt,{trigger:[Ft.ContextMenu],className:"w-full",anchorToMouse:!0,menu:{items:Ce},children:m.jsxs("div",{style:{paddingLeft:`${P*MA}px`},className:ne("py-1 gap-[2px] dial-small flex justify-between hover:bg-accent-primary-alpha rounded group/item w-full mb-[2px] relative",fe),"aria-selected":L,children:[!W&&m.jsx("div",{className:"absolute size-full left-0 top-0 z-0",onClick:()=>F(M)}),m.jsx("div",{className:"relative flex flex-row truncate items-center w-fit h-6",onClick:()=>!W&&F(M),children:m.jsxs(m.Fragment,{children:[O&&m.jsx(_.IconCaretRightFilled,{...PA,className:X("flex-shrink-0",Q&&"rotate-90 transition-all",ee&&!q&&"text-transparent")}),m.jsx(ga,{elementId:`${D}-tree-item`,name:Z?h:V,type:O?Wt.Folder:Wt.File,loading:re,shared:Y,sharedIndicatorClassName:ne("group-hover/item:bg-accent-primary-alpha",L&&"bg-accent-primary-alpha"),iconSize:zs,...!Z&&{editing:W,onSave:w,onCancel:v,validate:j}})]})}),Ce.length>0&&!W&&!Z&&m.jsx("div",{className:"flex-1 flex justify-end",children:m.jsx(yt,{placement:"bottom-start",allowedPlacements:["top-start","top-end"],menu:{items:Ce},className:"sticky right-0",children:m.jsx(Ne,{className:"invisible group-hover/item:visible text-secondary mx-2 flex flex-row gap-2 hover:text-accent-primary",icon:m.jsx(_.IconDotsVertical,{...se})})})})]})}),Q&&N&&R(N,P+1)]})},`${D}-children`)});return m.jsx("div",{className:"flex-1 w-full h-full overflow-y-auto","aria-label":"folders-tree",children:e.length>0?R(e,0):m.jsx(En,{title:a,description:l,icon:c})})},Fg=e=>e.split("/").map(t=>t.trim()).filter(Boolean),AA="w-full flex items-center justify-between gap-4",LA="min-w-0 h-[38px] flex-1 overflow-hidden bg-layer-3 px-3 flex items-center rounded",OA="w-[260px]",NA=({ariaLabel:e="Breadcrumb",labelClassName:t,onItemClick:s,path:i,makeHref:o,rootItemPath:n,rootItemLabel:r,breadcrumbsHiddenPathPart:a,className:l,breadcrumbClassName:c,searchable:d=!0,value:u,elementId:h="file-manager-search",disabled:p,readonly:f,invalid:C,onSearchChange:w,searchClassName:v,searchContainerClassName:b,isCompactView:S=!1})=>{const y=g.useMemo(()=>{if(!i)return;let M=Fg(i);const D=[...M];let I=0;if(a){const N=Fg(a);if(N.length){const O=M.findIndex((q,Q)=>N.every((L,re)=>M[Q+re]===L));O!==-1&&(I=N.length,M=[...M.slice(0,O),...M.slice(O+N.length)])}}if(!M.length)return[{label:"/"}];const V=M.map((N,O)=>{const q=O<M.length-I?O:O+I,Q=D.slice(0,q+1),L=typeof o=="function"?o(Q,q):void 0;return{label:N,href:L,onClick:s?re=>{re.preventDefault(),s(L)}:void 0}});if(n&&r){const N=n.split("/").filter(Boolean),O=i.split("/").filter(Boolean);if(N.every((Q,L)=>O[L]===Q)&&V.length>0){const Q=V.slice(N.length);return[{label:r,href:n,onClick:s?L=>{L.preventDefault(),s(n)}:void 0},...Q]}}return V},[i,a,n,r,o,s]),[x,F]=g.useState(!1),R=g.useCallback(()=>{if(S&&!x){F(!0);const M=document.getElementById(h);M&&M.focus()}},[h,x,S]),E=g.useCallback(()=>{(!u||String(u).trim()==="")&&w?.("")},[u,w]),P=g.useCallback(()=>S&&x?m.jsx(Rs,{className:"!p-[9px]",iconBefore:m.jsx(_.IconArrowLeft,{...se}),onClick:()=>{F(!1),w?.("")}}):m.jsx("div",{className:LA,children:m.jsx(MC,{pathItems:y,ariaLabel:e,labelClassName:t,className:c})}),[e,c,y,x,S,t,w]);return m.jsxs("div",{className:ne(AA,{"gap-3":S},l),"aria-label":"navigation-panel",children:[P(),d&&m.jsx("div",{className:ne(OA,{"w-[38px]":S&&!x,"w-full":S&&x}),role:"search","aria-label":"Search",onClick:R,children:m.jsx(uu,{elementId:h,value:u??"",onChange:w,disabled:p,readonly:f,onBlur:E,invalid:C,className:v,containerClassName:ne(b,{"p-[10px]":S})})})]})};var Zi=(e=>(e.MyFiles="my_files",e.Shared="shared",e.Organization="organization",e))(Zi||{}),te=(e=>(e.AddSibling="addSibling",e.AddChild="addChild",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))(te||{}),dt=(e=>(e.Replace="replace",e.Duplicate="duplicate",e.Cancel="cancel",e))(dt||{}),Lt=(e=>(e.ReplaceAll="replaceAll",e.DuplicateAll="duplicateAll",e.DecideForEach="decideForEach",e))(Lt||{}),Je=(e=>(e.Copy="copy",e.Move="move",e))(Je||{}),co=(e=>(e.Tree="tree",e.Grid="grid",e))(co||{}),Qe=(e=>(e.Name="name",e.UpdatedAt="updatedAt",e.Size="size",e.Author="author",e.Owner="owner",e.Path="path",e.Actions="__actions",e))(Qe||{});const ZC=()=>{const[e,t]=g.useState(mg());return g.useEffect(()=>{const s=()=>t(mg());return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),e},HA=({tabs:e,activeTab:t,onTabChange:s,areHiddenFilesVisible:i,onToggleHiddenFiles:o,isNewButtonVisible:n,isNewButtonDisabled:r,newButtonVariant:a=qe.Secondary,newButtonDropdownItems:l=[],newButtonLabel:c="New",hiddenFilesSwitcherLabel:d="Hidden files",showHiddenFilesLabel:u="Show hidden files",hideHiddenFilesLabel:h="Hide hidden files",showHiddenFilesToggle:p=!0,disabledNewButtonTooltip:f})=>{const C=ZC(),w=g.useMemo(()=>[{key:"hidden-files-switch",label:i?h:u,icon:i?m.jsx(_.IconEyeOff,{...se,className:"text-secondary"}):m.jsx(_.IconEye,{...se,className:"text-secondary"}),onClick:()=>o?.(!i)}],[i,h,u,o]),v=()=>e&&t&&s?m.jsx(FC,{tabs:e,activeTab:t,onClick:y=>s(y),screenThreshold:da.Tablet,smallScreenContainerClassName:"w-fit bg-transparent h-[38px] overflow-hidden",smallScreenDropdownItemClassName:"px-3 h-[38px]"}):null,b=()=>m.jsxs(m.Fragment,{children:[p&&m.jsxs(m.Fragment,{children:[m.jsx(cu,{switchId:"hidden-files-switch",label:d,isOn:i,onChange:o}),m.jsx("div",{className:"h-6 border-l border-primary"})]}),n&&m.jsx(_t,{tooltip:r&&f?f:void 0,children:m.jsx(sd,{label:c,variant:a,items:l,disabled:r})})]}),S=()=>m.jsxs(m.Fragment,{children:[m.jsx(yt,{menu:{items:w},allowedPlacements:["bottom","bottom-start"],children:m.jsx(xt,{className:"h-[38px]",iconBefore:m.jsx(_.IconDotsVertical,{...se,className:"text-secondary hover:text-accent-primary"})})}),n?m.jsx(_t,{tooltip:r&&f?f:void 0,children:m.jsx(sd,{label:c,variant:a,items:l,disabled:r})}):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:v()}),m.jsx("div",{className:"flex gap-4 flex-shrink-0 items-center",children:C?S():b()})]})},GA=12,BA=8;var ri=(e=>(e.Normal="normal",e.Reverse="reverse",e))(ri||{});function VA({actions:e,direction:t=ri.Normal,moreButtonWidth:s=ms,actionsGap:i=8,containerPadding:o=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(w=>Math.ceil(w.getBoundingClientRect().width))},[e,...n]),g.useEffect(()=>{if(!r.current)return;let C=null;const w=()=>{C&&cancelAnimationFrame(C),C=requestAnimationFrame(()=>{const b=r.current,S=l.current?.offsetWidth??0,y=c.current?.offsetWidth??0,x=S+y,R=b.getBoundingClientRect().width-x-s-i*2-o*2,E=d.current;let P=0,M=0;if(t===ri.Reverse)for(let D=E.length-1;D>=0&&(P+=E[D]+i,!(P>R));D--)M++;else for(const D of E){if(P+=D+i,P>R)break;M++}h(M)})},v=new ResizeObserver(w);return v.observe(r.current),w(),()=>{C&&cancelAnimationFrame(C),v.disconnect()}},[e.length,t,...n]);const p=t===ri.Reverse?e.slice(0,e.length-u):e.slice(u);return{visibleActions:t===ri.Reverse?e.slice(e.length-u):e.slice(0,u),hiddenActions:p,refs:{containerRef:r,measureRef:a,leftSectionRef:l,rightSectionRef:c}}}const zA=({getSelectionLabel:e,onClearSelection:t,actions:s,selectedCount:i})=>{const o=ZC(),{refs:{containerRef:n,leftSectionRef:r,measureRef:a},visibleActions:l,hiddenActions:c}=VA({actions:s,direction:ri.Reverse,dependencies:[o],actionsGap:GA,containerPadding:BA}),d=e(i);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(Rs,{iconBefore:h,label:p,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(Kt,{label:d,onClick:t,textClassName:"text-accent-primary whitespace-nowrap",appearance:Me.Ghost,iconBefore:m.jsx(_.IconX,{...se,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(yt,{menu:{items:c},allowedPlacements:["bottom","bottom-start"],children:m.jsx(xt,{className:"h-[38px]",iconBefore:m.jsx(_.IconDotsVertical,{...se,className:"text-secondary hover:text-accent-primary"})})}),l.map(({key:u,icon:h,title:p,onClick:f,disabled:C})=>m.jsx(Rs,{className:"!p-[9px]",iconBefore:h,label:p,hideTitleOnMobile:!0,disabled:C,onClick:w=>f?.({key:u,domEvent:w})},u))]})]})]})},pu=e=>ge.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},ge.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"})),fu=e=>ge.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},ge.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"})),XC=e=>ge.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},ge.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.1812 1.2002H2.80615C2.43319 1.2002 2.07551 1.34835 1.81178 1.61208C1.54806 1.8758 1.3999 2.23348 1.3999 2.60645V5.48145C1.3999 5.85441 1.54806 6.21209 1.81178 6.47581C2.07551 6.73954 2.43319 6.8877 2.80615 6.8877H15.1812C15.5541 6.8877 15.9118 6.73954 16.1755 6.47581C16.4392 6.21209 16.5874 5.85441 16.5874 5.48145V2.60645C16.5874 2.23348 16.4392 1.8758 16.1755 1.61208C15.9118 1.34835 15.5541 1.2002 15.1812 1.2002ZM14.8999 5.2002H3.0874V2.8877H14.8999V5.2002ZM12 7.80017C12.3107 7.80017 12.5625 8.05201 12.5625 8.36267V11.7377H15.9375C16.2482 11.7377 16.5 11.9895 16.5 12.3002C16.5 12.6108 16.2482 12.8627 15.9375 12.8627H12.5625V16.2377C12.5625 16.5483 12.3107 16.8002 12 16.8002C11.6893 16.8002 11.4375 16.5483 11.4375 16.2377V12.8627H8.0625C7.75184 12.8627 7.5 12.6108 7.5 12.3002C7.5 11.9895 7.75184 11.7377 8.0625 11.7377H11.4375V8.36267C11.4375 8.05201 11.6893 7.80017 12 7.80017ZM2.41188 12.5883C2.14816 12.3246 2 11.9669 2 11.5939V9.00018H3.6875V11.3127H6.1001V13.0002H3.40625C3.03329 13.0002 2.6756 12.852 2.41188 12.5883Z",fill:"currentColor"})),QC=e=>ge.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},ge.createElement("path",{d:"M9.00049 7.7998C9.3108 7.80007 9.56279 8.05198 9.56299 8.3623V11.7373H12.938C13.2483 11.7376 13.5003 11.9895 13.5005 12.2998C13.5005 12.6103 13.2484 12.862 12.938 12.8623H9.56299V16.2373C9.56299 16.5478 9.31092 16.7995 9.00049 16.7998C8.68983 16.7998 8.43799 16.548 8.43799 16.2373V12.8623H5.06299C4.75233 12.8623 4.50049 12.6105 4.50049 12.2998C4.50069 11.9893 4.75245 11.7373 5.06299 11.7373H8.43799V8.3623C8.43819 8.05181 8.68995 7.7998 9.00049 7.7998ZM15.1812 1.2002C15.5541 1.2002 15.9116 1.34858 16.1753 1.6123C16.439 1.87603 16.5874 2.23348 16.5874 2.60645V5.48145C16.5874 5.85441 16.439 6.21186 16.1753 6.47559C15.9116 6.73931 15.5541 6.8877 15.1812 6.8877H2.80615C2.43319 6.8877 2.07573 6.73931 1.81201 6.47559C1.54829 6.21186 1.3999 5.85441 1.3999 5.48145V2.60645C1.3999 2.23348 1.54829 1.87603 1.81201 1.6123C2.07573 1.34858 2.43319 1.2002 2.80615 1.2002H15.1812ZM3.0874 2.8877V5.2002H14.8999V2.8877H3.0874Z",fill:"currentColor"})),WA=e=>{const[t,s]=g.useState(e?.showHiddenFiles??!1),i=!!e?.onShowHiddenFilesChange,o=i?e.showHiddenFiles??!1:t,n=g.useCallback(a=>{i?e?.onShowHiddenFilesChange?.(a):s(a)},[i,e]),r=g.useCallback(()=>{const a=!o;i?e?.onShowHiddenFilesChange?.(a):s(a)},[o,i,e]);return{areHiddenFilesVisible:o,toggleHiddenFilesVisibility:r,setAreHiddenFilesVisible:n}},_A=e=>{const[t,s]=g.useState(e?.collapsed??!1),i=!!e?.onCollapseChange,o=i?e.collapsed??!1:t,n=g.useCallback(a=>{i?e?.onCollapseChange?.(a):s(a)},[i,e]),r=g.useCallback(()=>{const a=!o;i?e?.onCollapseChange?.(a):s(a)},[o,i,e]);return{isTreeCollapsed:o,toggleTreeCollapse:r,setIsTreeCollapsed:n}},Eg=(e,t,s)=>{if(!t.has(e))return e;const i=s===Te.FOLDER?(o,n)=>`${o} (${n})`:(o,n)=>{const r=o.lastIndexOf("."),a=r>0,l=a?o.slice(0,r):o,c=a?o.slice(r):"";return`${l} (${n})${c}`};for(let o=1;;o++){const n=i(e,o);if(!t.has(n))return n}},hc=e=>e.name,JC=({getDestinationFiles:e,onResolve:t})=>{const[s,i]=g.useState([]),[o,n]=g.useState(!1),[r,a]=g.useState(null),l=g.useRef(!1),c=g.useCallback(b=>{l.current=!0,i(b),n(!0)},[]),d=g.useCallback(()=>{l.current=!1,n(!1),i([]),a(null)},[]),u=g.useCallback((b,S)=>{const y=e(b),x=new Set(y.map(hc)),F=S.filter(R=>x.has(R.name));return{hasConflicts:F.length>0,conflicts:F}},[e]),h=g.useCallback((b,S,y,x)=>{const F=e(b),R=new Set(F.map(hc));return S.map(E=>{const P=E.name,M=R.has(P),D=y&&M?P:Eg(P,R,E.nodeType);return(!y||!M)&&R.add(D),{sourceUrl:E.path,destinationUrl:`${b}/${D}`,overwrite:y&&M,nodeType:E.nodeType??Te.ITEM,...x??{}}})},[e]),p=g.useCallback((b,S,y,x)=>{const F=e(b),R=new Set(F.map(hc));return S.filter(P=>y.get(P.path)!==dt.Cancel).map(P=>{const M=y.get(P.path),D=R.has(P.name),I=M===dt.Replace&&D,V=I?P.name:Eg(P.name,R,P.nodeType);return I||R.add(V),{sourceUrl:P.path,destinationUrl:`${b}/${V}`,overwrite:I,nodeType:P.nodeType??Te.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]),w=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]),v=g.useCallback(b=>{if(!r)return;const{files:S,destinationFolder:y,metadata:x}=r,F=new Map(b.map(E=>[E.file.path,E.action])),R=p(y,S,F,x);t?.(R,y),d()},[r,p,t,d]);return{conflictingFiles:s,conflictResolutionOpen:o,hasActiveConflictRef:l,checkForConflicts:u,startConflictResolution:f,resolveConflictsWithStrategy:h,resolveConflictsWithDecisions:p,openConflictResolution:c,closeConflictResolution:d,handleReplaceAll:C,handleDuplicateAll:w,handleDecideForEach:v}},jA=({getDestinationFiles:e,onCopyFiles:t,onMoveToFiles:s,onCopySuccess:i,onMoveSuccess:o,onDuplicateSuccess:n,getCopyHeader:r,getMoveHeader:a})=>{const[l,c]=g.useState(!1),[d,u]=g.useState([]),[h,p]=g.useState([]),[f,C]=g.useState(Je.Copy),[w,v]=g.useState(),[b,S]=g.useState(null),{conflictingFiles:y,conflictResolutionOpen:x,hasActiveConflictRef:F,startConflictResolution:R,resolveConflictsWithStrategy:E,closeConflictResolution:P,openConflictResolution:M,handleReplaceAll:D,handleDuplicateAll:I,handleDecideForEach:V}=JC({getDestinationFiles:e,onResolve:(k,ce)=>{b?.type===Je.Copy?(t?.(k,ce),i?.()):b?.type===Je.Move&&b.sourceFolder&&(s?.(k,b.sourceFolder,ce),o?.())}}),N=g.useCallback(()=>{u([]),p([]),S(null),v(void 0)},[]),O=g.useCallback(k=>{const ce=R(k,d,{type:Je.Copy});if(S({type:Je.Copy}),!ce.hasConflicts){const we=E(k,d,!1);t?.(we,k),i?.(),N()}},[d,R,E,t,i,N]),q=g.useCallback((k,ce)=>{const we=ce||(b?.sourceFolder??"/");if(!R(k,h,{type:Je.Move,sourceFolderPath:we}).hasConflicts){const H=E(k,h,!0);s?.(H,we,k),o?.(),N()}},[h,R,E,s,o,N,b]),Q=g.useCallback(()=>{D(),N()},[D,N]),L=g.useCallback(()=>{I(),N()},[I,N]),re=g.useCallback(k=>{V(k),N()},[V,N]),W=g.useCallback(k=>{const ce=k.at(0)?.parentPath??"/",we=E(ce,k,!1);t?.(we,ce),n?.()},[t,n,E]),ee=g.useCallback(k=>{C(k),c(!0)},[]),Y=g.useCallback(()=>{c(!1),F.current||N()},[N,F]),[Z,j]=g.useState(),fe=g.useCallback(k=>{u(k);const ce=k[0]?.parentPath??k[0]?.folderId;v(ce),r&&k.length>0?j(r(k.length,k[0]?.name)):j(void 0)},[r]),Ce=g.useCallback(k=>{p(k);const ce=k[0]?.parentPath??k[0]?.folderId;v(ce),S({type:Je.Move,sourceFolder:ce}),a&&k.length>0?j(a(k.length,k[0]?.name)):j(void 0)},[a]);return{handleDuplicate:W,handleCloseDestinationFolderPopup:Y,handleOpenDestinationFolderPopup:ee,handleCopyTo:O,handleMoveTo:q,openDestinationFolderPopup:l,destinationFolderMode:f,destinationFolderTitle:Z,handleSetCopiedFiles:fe,handleSetMovedFiles:Ce,clearState:N,conflictingFiles:y,conflictResolutionOpen:x,openConflictResolution:M,closeConflictResolution:P,handleConflictReplace:Q,handleConflictDuplicate:L,handleConflictDecideForEach:re,sourceFolder:w}},UA=({path:e,defaultPath:t,onPathChange:s,onSelectionClear:i})=>{const o=e!==void 0,[n,r]=g.useState(t),a=o?e:n,l=g.useCallback(d=>{o||r(d),s?.(d)},[o,s]),c=g.useCallback(d=>{l(d),i?.()},[l,i]);return{currentPath:a,setCurrentPath:l,handlePathChange:c}},$A=({onDeleteFiles:e,onDeleteSuccess:t})=>{const[s,i]=g.useState(!1),[o,n]=g.useState([]),[r,a]=g.useState(""),l=g.useCallback((u,h)=>{n(u),a(h),i(!0)},[]),c=g.useCallback(()=>{i(!1),n([])},[]),d=g.useCallback(()=>{if(e&&o.length>0){const u=o.map(h=>({sourceUrl:h.path,nodeType:h.nodeType}));e(u,r),t?.()}c()},[o,e,t,c,r]);return{deleteConfirmationOpen:s,itemsToDelete:o,openDeleteConfirmation:l,closeDeleteConfirmation:c,confirmDelete:d}},KA=({onDownloadFiles:e,onDownloadSuccess:t})=>({handleDownloadFiles:g.useCallback(i=>{e&&i.length>0&&(e(i),t?.())},[e,t])}),qA=e=>"dataTransfer"in e&&e.dataTransfer!==null,YA=({onUploadFiles:e,onValidateUpload:t,maxFileSize:s,allowedFileTypes:i,validationMessages:o={},onUploadArchive:n,uploadEnabled:r=!0,currentFolder:a}={})=>{const[l,c]=g.useState(!1),[d,u]=g.useState(!1),[h,p]=g.useState(),f=g.useRef(null),C=g.useRef(""),w=g.useRef([]),v=g.useMemo(()=>!!a?.permissions?.includes(ki.WRITE),[a]),[b,S]=g.useState(new Map),[y,x]=g.useState(null),F=g.useCallback(H=>!i||i.includes("*/*")?H:H.filter(({fileContent:U,name:oe})=>KC(i,U.type,oe)),[i]),R=g.useCallback(()=>{S(new Map),x(null)},[]),{conflictingFiles:E,conflictResolutionOpen:P,hasActiveConflictRef:M,startConflictResolution:D,closeConflictResolution:I,openConflictResolution:V,handleReplaceAll:N,handleDuplicateAll:O,handleDecideForEach:q}=JC({getDestinationFiles:()=>w.current,onResolve:(H,U)=>{if(!r||!v){R();return}if(!y)return;const oe=H.map(he=>{const ye=b.get(he.sourceUrl);if(!ye)return;const ie=he.destinationUrl.split("/").pop();return{fileContent:ye.fileContent,name:ie}}).filter(Boolean);oe.length>0&&e?.(oe,U),R()}});g.useEffect(()=>{r&&v||(c(!1),u(!1),p(void 0),I(),R())},[r,I,R,v]),g.useEffect(()=>{if(!r||!v)return;let H=0;const U=ie=>{qA(ie)&&ie.dataTransfer.types.includes(bA)&&(H++,u(!0))},oe=()=>{H--,H===0&&u(!1)},he=()=>{H=0,u(!1)},ye=ie=>{ie.preventDefault()};return window.addEventListener("dragenter",U),window.addEventListener("dragleave",oe),window.addEventListener("drop",he),window.addEventListener("dragover",ye),()=>{window.removeEventListener("dragenter",U),window.removeEventListener("dragleave",oe),window.removeEventListener("drop",he),window.removeEventListener("dragover",ye)}},[r,v]);const Q=g.useCallback(H=>s?H.filter(U=>U.fileContent.size>s).map(U=>U.name):[],[s]),L=g.useCallback((H,U)=>H.map(oe=>({id:oe.name,name:oe.name,folderId:U,path:oe.name,nodeType:Te.ITEM,parentPath:U,contentLength:oe.fileContent.size})),[]),re=g.useCallback(async(H,U,oe)=>{if(!r||!v)return!1;p(void 0),w.current=oe;const he=Q(H);if(he.length>0){const Re=s?(s/1048576).toFixed(2):0,ke=o.oversizedFiles||`Files exceed maximum size (${Re}MB): ${he.join(", ")}`;return p(ke),!1}if(t)try{const Re=await t(H,oe,U);if(!Re.valid)return p(Re.message||o.validationFailed||"Validation failed"),!1}catch{return p(o.validationError||"Validation error occurred"),!1}const ye=new Map(H.map(Re=>[Re.name,Re]));S(ye);const ie=L(H,U);return x({destinationFolder:U}),D(U,ie,{destinationFolder:U}).hasConflicts?!1:(e?.(H,U),R(),!0)},[r,e,t,Q,s,o,L,D,R,v]),W=g.useCallback(()=>{N(),R()},[N,R]),ee=g.useCallback(()=>{O(),R()},[O,R]),Y=g.useCallback(H=>{q(H),R()},[q,R]),Z=g.useCallback(()=>{I(),M.current||R()},[I,M,R]),j=g.useCallback(H=>{!r||!v||(H.preventDefault(),H.stopPropagation(),H.dataTransfer.types.includes("Files")&&c(!0))},[r,v]),fe=g.useCallback(H=>{if(!r||!v)return;H.preventDefault(),H.stopPropagation();const U=H.currentTarget.getBoundingClientRect(),oe=H.clientX,he=H.clientY;(oe<=U.left||oe>=U.right||he<=U.top||he>=U.bottom)&&c(!1)},[r,v]),Ce=g.useCallback(H=>{!r||!v||(H.preventDefault(),H.stopPropagation(),H.dataTransfer.types.includes("Files")&&(H.dataTransfer.dropEffect="copy"))},[r,v]),k=g.useCallback(async(H,U,oe)=>{if(!r||!v||(H.preventDefault(),H.stopPropagation(),c(!1),!H.dataTransfer.types.includes("Files")))return;const he=Array.from(H.dataTransfer.files);if(he.length===0)return;const ye=he.map(be=>({fileContent:be,name:be.name})),ie=F(ye);if(ie.length===0){p(o.unsupportedFiles||"Selected files are not supported");return}await re(ie,U,oe)},[r,F,re,o,v]);g.useEffect(()=>{let H=f.current;H||(H=document.createElement("input"),H.type="file",H.multiple=!0,H.style.display="none",document.body.appendChild(H),f.current=H),i&&i.length>0?H.accept=i.join(","):H.removeAttribute("accept");const U=async()=>{if(!r||!v){H&&(H.value="");return}if(!H?.files?.length)return;const he=Array.from(H.files).map(ie=>({fileContent:ie,name:ie.name})),ye=F(he);if(ye.length===0){p(o.unsupportedFiles||"Selected files are not supported"),H.value="";return}await re(ye,C.current,w.current),H.value=""};return H.addEventListener("change",U),()=>{H&&(H.removeEventListener("change",U),f.current===H&&(document.body.removeChild(H),f.current=null))}},[r,i,F,re,o,v]);const ce=g.useCallback((H,U)=>{!r||!v||(C.current=H,w.current=U,f.current&&f.current.click())},[r,v]),we=g.useCallback((H,U)=>{if(!n||!r||!v)return;const oe=document.createElement("input");oe.type="file",oe.accept=".zip,application/zip",oe.multiple=!1,oe.style.display="none";const he=()=>{const ye=oe.files?.[0];if(!ye){document.body.removeChild(oe);return}const ie=ye.name.replace(/\.zip$/i,"");if(U.some(Re=>Re.nodeType===Te.FOLDER&&Re.name.toLowerCase()===ie.toLowerCase())){p(o.validationFailed||`Folder with name "${ie}" already exists`),document.body.removeChild(oe);return}try{n(ye,ie,H)}finally{document.body.removeChild(oe)}};oe.addEventListener("change",he),document.body.appendChild(oe),oe.click()},[r,n,o,v]),z=g.useCallback(()=>{p(void 0)},[]);return{isDragging:l,isDraggingOverWindow:d,uploadError:h,handleDragEnter:j,handleDragLeave:fe,handleDragOver:Ce,handleDrop:k,clearError:z,handleUpload:re,openFileDialog:ce,openArchiveDialog:we,fileInputRef:f,uploadConflictingFiles:E,uploadConflictResolutionOpen:P,hasActiveUploadConflictRef:M,openUploadConflictResolution:V,closeUploadConflictResolution:Z,handleUploadConflictReplace:W,handleUploadConflictDuplicate:ee,handleUploadConflictDecideForEach:Y}},ev=g.createContext(void 0),ZA={emptyName:"Name cannot be empty",duplicateName:"An item with this name already exists"};function XA(e){let t=e.length;for(;t>0&&e[t-1]==="/";)t--;return e.slice(0,t)}function QA(e,t){const s=XA(e),i=s.lastIndexOf("/");return i===-1?t:s.slice(0,i+1)+t}function JA(e){const t=e.lastIndexOf(".");return t===-1||t===0?e:e.substring(0,t)}function Dg(e){const t=e.lastIndexOf(".");return t===-1||t===0?"":e.substring(t)}const eL=({items:e,onRenameValidate:t,validationMessages:s,onMoveToFiles:i})=>{const[o,n]=g.useState(),r=g.useMemo(()=>({...ZA,...s}),[s]),a=g.useMemo(()=>o?.path,[o]),l=g.useCallback(p=>{const f=Ri(e,p);f&&n(f)},[e]),c=g.useCallback(()=>{n(void 0)},[]),d=g.useCallback(p=>{if(!o||!i){n(void 0);return}const f=o.nodeType===Te.ITEM;let C=p.trim();if(f){const S=Dg(o.name);S&&!C.endsWith(S)&&(C=C+S)}if(C===o.name){n(void 0);return}const w=QA(o.path,C),v=o.parentPath;if(!v){n(void 0);return}const b={sourceUrl:o.path,destinationUrl:w,nodeType:o.nodeType};i([b],v,v),n(void 0)},[o,i]),u=g.useCallback((p,f)=>{const C=p.trim();if(!C)return r.emptyName;const w=f.nodeType===Te.ITEM;let v=C;if(w){const S=Dg(f.name);S&&!v.endsWith(S)&&(v=v+S)}const b=f.parentPath;if(b){const S=Ri(e,b);if(S&&new Set((S.items??[]).filter(x=>x.path!==f.path).map(x=>x.name.toLowerCase())).has(v.toLowerCase()))return r.duplicateName}if(t){const S=t(v,f);if(S)return S}return null},[t,r,e]),h=g.useCallback(p=>p.nodeType===Te.ITEM?JA(p.name):p.name,[]);return{renamedPath:a,renamedItem:o,renameHandler:l,renameSaveHandler:d,renameCancelHandler:c,renameValidateHandler:u,getDisplayName:h}},tL=({newActions:e,currentFolder:t,onUploadFiles:s,onCreateFolder:i,onUploadArchive:o,isNewButtonDisabled:n})=>{const r=g.useMemo(()=>{const c=[];return e&&(e.newFolder&&c.push({key:"new-folder",label:e.newFolder.label,icon:e?.newFolder?.icon!==void 0?e?.newFolder?.icon:m.jsx(_.IconFolder,{...se,className:"text-secondary"}),onClick:()=>{i&&i()}}),e.uploadFiles&&c.push({key:"upload-file",label:e.uploadFiles.label,icon:e?.uploadFiles?.icon!==void 0?e?.uploadFiles?.icon:m.jsx(_.IconFile,{...se,className:"text-secondary"}),onClick:()=>{s&&s()}}),e.uploadArchive&&c.push({key:"upload-archive",label:e.uploadArchive.label,icon:e?.uploadArchive?.icon!==void 0?e?.uploadArchive?.icon:m.jsx(_.IconFileZip,{...se,className:"text-secondary"}),onClick:()=>{o&&o()}})),c},[e,i,s,o]),a=g.useMemo(()=>r?.length>0,[r]),l=g.useMemo(()=>!t?.permissions?.includes(ki.WRITE)||!!n,[t,n]);return{newActions:r,isNewButtonVisible:a,isNewButtonDisabled:l}},sL={emptyName:"Folder name cannot be empty",duplicateName:"A folder with this name already exists"},iL=({currentFolder:e,onCreateFolder:t,onValidateFolderName:s,validationMessages:i})=>{const[o,n]=g.useState(!1),[r,a]=g.useState(null),l=g.useRef(e?.path),c=g.useMemo(()=>({...sL,...i}),[i]);g.useEffect(()=>{const f=e?.path;l.current!==f&&o&&(n(!1),a(null)),l.current=f},[e?.path,o]);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(v=>v.nodeType===Te.FOLDER).map(v=>v.name.toLowerCase())).has(C.toLowerCase()))return c.duplicateName;if(s&&e){const w=s(C,e);if(w)return w}return null},[e,s,c]),p=g.useCallback(async f=>{const C=f.trim();if(!C)return;const v=`${e?.path??"/"}/${C}`,b=`${v}/${dc}`,y={fileContent:new File([],dc,{type:"text/plain"}),name:dc};t&&await t(y,v,b),u()},[e,t,u]);return{isCreatingFolder:o,newFolderTempId:r,startFolderCreation:d,cancelFolderCreation:u,saveFolderCreation:p,validateFolderName:h}},oL=({additionalButtons:e,expandedPathsLength:t,collapseAll:s})=>{const i=t===0;return{additionalButtons:g.useMemo(()=>{const n=ne(["hover:text-accent-primary p-1",i&&"text-controls-disable hover:text-controls-disable disabled:hover:cursor-default"]);return m.jsxs(m.Fragment,{children:[e,m.jsx(xt,{disabled:i,className:n,onClick:s,iconBefore:m.jsx(_.IconCopyMinus,{size:24,stroke:1.5}),"aria-label":"collapse-all"})]})},[e,i,s])}},nL=({onGetInfo:e})=>{const[t,s]=g.useState(!1),[i,o]=g.useState(void 0),n=g.useCallback(async a=>{o(a),s(!0),e&&await e(a)},[e]),r=g.useCallback(()=>{s(!1),o(void 0)},[]);return{isMetadataPopupOpen:t,selectedFileForMetadata:i,openMetadataPopup:n,closeMetadataPopup:r}};function rL(e){const t=[];function s(i){for(const o of i)t.push(o),o.items&&s(o.items)}return s(e),t}function Pg(e,t){const s=lo(t);return e.filter(i=>lo(i.name).includes(s))}function aL({onSearchFiles:e,clearSearchResults:t,currentPath:s,searchResults:i=[],searchInProgress:o=!1,navigationPanelValue:n,onNavigationPanelSearchChange:r,allItems:a=[],activeTab:l}){const[c,d]=g.useState(""),u=g.useRef(!1),h=g.useRef(!1),p=g.useRef([]),f=g.useRef(s),C=g.useRef(l);g.useEffect(()=>{n!=null&&d(String(n))},[n]);const w=String(n??c??"").trim(),v=h.current&&(o||i.length>0||w!==""),b=g.useCallback(F=>{const R=F.trim();if(!R){h.current=!1,u.current=!1;return}h.current=!0,e&&s&&!u.current&&(u.current=!0,e(s,R))},[e,s]),S=g.useCallback(()=>{u.current=!1,h.current=!1,p.current=[],d(""),r?.(""),t?.()},[t,r]),y=g.useCallback(F=>{const R=String(F??"");d(R),r?.(R),R.trim()?b(R):S()},[r,b,S]);g.useEffect(()=>{(f.current!==s||C.current!==l)&&(f.current=s,C.current=l,u.current=!1,h.current=!1,p.current=[],d(""),r?.(""),t?.())},[s,l,r,t]),g.useEffect(()=>{i.length>0&&p.current.length===0&&(p.current=i)},[i]);const x=g.useMemo(()=>{if(e){const R=p.current.length>0?p.current:i;return!w||R.length===0?R:Pg(R,w)}if(!w||!a.length)return[];const F=rL(a);return Pg(F,w)},[e,i,w,a]);return{isSearchMode:v,searchValue:c,effectiveSearchValue:w,setSearchValue:d,handleSearchChange:y,handleSearchActivate:b,handleSearchClear:S,searchResultsRows:x}}function lL({selectedPaths:e,defaultSelectedPaths:t,onSelectedPathsChange:s}){const i=e!==void 0,[o,n]=g.useState(()=>t??new Set),r=g.useMemo(()=>i?e:o,[i,e,o]),a=g.useCallback(c=>{const d=new Set(c);s?.(d),i||n(d)},[i,s]),l=g.useCallback(()=>{a(new Set)},[a]);return{selectedPaths:r,setSelectedPaths:a,clearSelection:l,isControlled:i}}const tv=({children:e,className:t,items:s=[],rootItem:i,path:o,defaultPath:n,filesLoading:r,selectedPaths:a,defaultSelectedPaths:l,onSelectedPathsChange:c,showHiddenFiles:d,onShowHiddenFilesChange:u,treeOptions:h,showNavigationPanel:p=!0,navigationPanelOptions:f,deleteConfirmationOptions:C,gridOptions:w,toolbarOptions:v,bulkActionsToolbarOptions:b,destinationFolderPopupOptions:S,conflictResolutionPopupOptions:y,onPathChange:x,onTableFileClick:F,onGridApiChange:R,onCopyFiles:E,onMoveToFiles:P,onDeleteFiles:M,onDownloadFiles:D,onRenameValidate:I,onAddSibling:V,onAddChild:N,renameValidationMessages:O,onUploadFiles:q,onValidateUpload:Q,uploadEnabled:L,uploadValidationMessages:re,maxFileSize:W,onUploadArchive:ee,onCreateFolder:Y,onCreateFolderValidate:Z,folderCreationValidationMessages:j,fileMetadataPopupOptions:fe,onGetInfo:Ce,onUnshareFiles:k,actionsRef:ce,sharedByMePaths:we,onSearchFiles:z,searchResults:H,searchInProgress:U,clearSearchResults:oe,allowedFileTypes:he,maxSelectableFileSize:ye,emptyStateIcon:ie,emptyStateTitle:be,emptyStateDescription:Re,sharedWithMeIds:ke})=>{const{selectedPaths:me,clearSelection:ve,setSelectedPaths:He}=lL({selectedPaths:a,defaultSelectedPaths:l,onSelectedPathsChange:c}),We=g.useMemo(()=>{const Oe=new Map;return me.forEach(Ut=>{const ks=Ri(s,Ut);ks&&Oe.set(Ut,ks)}),Oe},[me,s]),{currentPath:Pe,setCurrentPath:kt,handlePathChange:at}=UA({path:o,defaultPath:n,onPathChange:x,onSelectionClear:ve}),[ds,G]=g.useState(),Se=S?.destinationFolderPath??ds,lt=g.useCallback(Oe=>{S?.setDestinationFolderPath?S.setDestinationFolderPath(Oe):G(Oe)},[S]),{areHiddenFilesVisible:us,toggleHiddenFilesVisibility:On}=WA({showHiddenFiles:d,onShowHiddenFilesChange:u}),{isTreeCollapsed:Na,toggleTreeCollapse:Ha,setIsTreeCollapsed:Ga}=_A({collapsed:h?.collapsed,onCollapseChange:h?.onCollapseChange}),{renamedPath:Ba,renamedItem:Nn,renameHandler:Va,renameSaveHandler:za,renameCancelHandler:Wa,renameValidateHandler:_a,getDisplayName:ja}=eL({items:s,onRenameValidate:I,validationMessages:O,onMoveToFiles:P}),{isSearchMode:Eo,searchValue:Ua,effectiveSearchValue:Do,setSearchValue:$a,handleSearchChange:Ka,searchResultsRows:Hn}=aL({onSearchFiles:z,clearSearchResults:oe,currentPath:Pe,searchResults:H,searchInProgress:U,navigationPanelValue:f?.value,onNavigationPanelSearchChange:f?.onSearchChange,allItems:s,activeTab:v?.activeTab}),gt=g.useMemo(()=>Rg(s,Pe)??s[0],[s,Pe]),{handleCopyTo:qa,handleMoveTo:Xt,handleDuplicate:Ya,handleOpenDestinationFolderPopup:Za,handleCloseDestinationFolderPopup:Xa,openDestinationFolderPopup:Ms,handleSetCopiedFiles:Qa,handleSetMovedFiles:Ja,destinationFolderMode:Po,destinationFolderTitle:Gn,conflictingFiles:Bn,conflictResolutionOpen:Vn,closeConflictResolution:Ai,handleConflictReplace:el,handleConflictDuplicate:zn,handleConflictDecideForEach:Wn,sourceFolder:_n}=jA({getDestinationFiles:Oe=>Rg(s,Oe)?.items??[],onCopyFiles:E,onMoveToFiles:P,onCopySuccess:ve,onMoveSuccess:ve,onDuplicateSuccess:ve,getCopyHeader:S?.getCopyHeader,getMoveHeader:S?.getMoveHeader});g.useEffect(()=>{Ms||lt(void 0)},[Ms,lt]);const{deleteConfirmationOpen:jn,itemsToDelete:Li,openDeleteConfirmation:Un,closeDeleteConfirmation:Mo,confirmDelete:tl}=$A({onDeleteFiles:M,onDeleteSuccess:ve}),{handleDownloadFiles:$n}=KA({onDownloadFiles:D,onDownloadSuccess:ve}),{isDragging:To,isDraggingOverWindow:sl,uploadError:il,handleDragEnter:ol,handleDragLeave:nl,handleDragOver:rl,handleDrop:Io,clearError:Kn,openFileDialog:qn,fileInputRef:Rt,openArchiveDialog:Yn,uploadConflictingFiles:ko,uploadConflictResolutionOpen:Zn,closeUploadConflictResolution:al,handleUploadConflictReplace:ll,handleUploadConflictDuplicate:cl,handleUploadConflictDecideForEach:Xn}=YA({onUploadFiles:q,onValidateUpload:Q,maxFileSize:W,onUploadArchive:ee,allowedFileTypes:he,validationMessages:re,uploadEnabled:L,currentFolder:gt}),dl=g.useCallback(Oe=>{const Ut=Pe??"",ks=gt?.items??[];Io(Oe,Ut,ks)},[Pe,gt,Io]),Qn=g.useCallback(()=>{const Oe=Pe??"",Ut=gt?.items??[];qn(Oe,Ut)},[Pe,gt,qn]),Jn=g.useCallback(()=>{const Oe=Pe??"",Ut=gt?.items??[];Yn(Oe,Ut)},[Pe,gt,Yn]),{isCreatingFolder:Oi,newFolderTempId:Qs,startFolderCreation:Ao,cancelFolderCreation:ul,saveFolderCreation:hl,validateFolderName:J}=iL({currentFolder:gt,onCreateFolder:Y,onValidateFolderName:Z,validationMessages:j}),{newActions:Le,isNewButtonVisible:Ts,isNewButtonDisabled:Is}=tL({newActions:v?.newActions,currentFolder:gt,onUploadFiles:Qn,onUploadArchive:Jn,onCreateFolder:Ao,isNewButtonDisabled:v?.isNewButtonDisabled}),er=g.useMemo(()=>{if(Eo){const Ge=Hn;return us?Ge.map(pt=>({...pt,id:pt.id??pt.path,name:pt.name??pt.path.split("/").pop()??"",updatedAt:pt.updatedAt,size:pt.contentLength,author:pt.author,path:pt.path,nodeType:pt.nodeType,extension:pt.extension,isTemporary:!1,owner:pt.owner})):Ge.filter(st=>!id(st)).map(st=>({...st,id:st.id??st.path,name:st.name??st.path.split("/").pop()??"",updatedAt:st.updatedAt,size:st.contentLength,contentLength:st.contentLength,author:st.author,path:st.path,nodeType:st.nodeType,extension:st.extension,isTemporary:!1,owner:st.owner}))}const Oe=lo(Do).trim(),Ut=gt?.items??[];let ks=Oe?EA(gt):Ut;us||(ks=ks.filter(Ge=>!id(Ge)));const gl=ks.map(Ge=>({...Ge,id:Ge.id??Ge.path,name:Ge.name??Ge.path.split("/").pop()??"",updatedAt:Ge.updatedAt,size:Ge.contentLength,author:Ge.author,path:Ge.path,nodeType:Ge.nodeType,extension:Ge.extension,isTemporary:!1,owner:Ge.owner,contentType:Ge.contentType,contentLength:Ge.contentLength}));if(Oi&&Qs&&!Oe&&gl.unshift({id:Qs,name:"",updatedAt:void 0,author:void 0,path:Qs,nodeType:Te.FOLDER,extension:void 0,isTemporary:!0,owner:void 0}),!Oe)return gl;const Sv=Oe.split(/\s+/).filter(Boolean);return gl.filter(Ge=>{if(Ge.isTemporary)return!0;const pt=lo(Ge.name),st=lo(Ge.author),yv=FA(Ge.extension);return Sv.every(pl=>pt.includes(pl)||st.includes(pl)||yv.includes(pl))})},[Eo,Hn,gt,Do,us,Oi,Qs]),dv=g.useCallback(Oe=>{at(Oe.path)},[at]),uv=g.useCallback(Oe=>{at(Oe)},[at]),hv=g.useCallback(Oe=>{Oe.nodeType===Te.FOLDER?at(Oe.path):F?.(Oe)},[at,F]),{expandedPaths:Cu,setExpandedPaths:gv,collapseAll:pv}=YC({expandedPaths:h?.expandedPaths,onExpandedPathsChange:h?.onExpandedPathsChange}),{additionalButtons:fv}=oL({collapseAll:pv,expandedPathsLength:Cu.size,additionalButtons:h?.additionalButtons}),{isMetadataPopupOpen:mv,selectedFileForMetadata:Cv,openMetadataPopup:vv,closeMetadataPopup:vu}=nL({onGetInfo:Ce}),wv=g.useCallback(()=>{vu(),fe?.clearMetadata?.()},[vu,fe]),bv={className:t,items:s,allowedFileTypes:he,maxSelectableFileSize:ye,rootItem:i,filesLoading:r,treeOptions:{...h,expandedPaths:Cu,onExpandedPathsChange:gv,additionalButtons:fv},showNavigationPanel:p,navigationPanelOptions:f,gridOptions:w,toolbarOptions:v,bulkActionsToolbarOptions:b,deleteConfirmationOptions:C,destinationFolderPopupOptions:{...S,destinationFolderPath:Se,setDestinationFolderPath:lt,header:Gn,onCreateFolder:Y,onCreateFolderValidate:Z,folderCreationValidationMessages:j,sourceFolder:_n},currentPath:Pe,setCurrentPath:kt,searchValue:Ua,effectiveSearchValue:Do,setSearchValue:$a,areHiddenFilesVisible:us,toggleHiddenFilesVisibility:On,isTreeCollapsed:Na,toggleTreeCollapse:Ha,setIsTreeCollapsed:Ga,selectedPaths:me,selectedFiles:We,setSelectedPaths:He,clearSelection:ve,currentFolder:gt,gridRows:er,handleCopyTo:qa,handleMoveTo:Xt,handleDuplicate:Ya,handleSetCopiedFiles:Qa,handleSetMovedFiles:Ja,openDestinationFolderPopup:Ms,handleCloseDestinationFolderPopup:Xa,handleOpenDestinationFolderPopup:Za,destinationFolderMode:Po,handleAddSibling:V,handleAddChild:N,handleDownloadFiles:$n,renamedPath:Ba,renamedItem:Nn,onRename:Va,onRenameSave:za,onRenameCancel:Wa,onRenameValidate:_a,getDisplayName:ja,openDeleteConfirmation:Un,closeDeleteConfirmation:Mo,confirmDelete:tl,deleteConfirmationOpen:jn,itemsToDelete:Li,handlePathChange:at,handleTreeItemClick:dv,handleBreadcrumbItemClick:uv,handleSearchChange:Ka,handleTableRowClick:hv,onTableFileClick:F,onGridApiChange:R,isDragging:To,uploadError:il,handleDragEnter:ol,handleDragLeave:nl,handleDragOver:rl,handleDrop:dl,clearUploadError:Kn,onUploadFiles:q,onValidateUpload:Q,maxFileSize:W,isDraggingOverWindow:sl,openFileDialog:Qn,fileInputRef:Rt,newActions:Le,isNewButtonVisible:Ts,isNewButtonDisabled:Is,isCreatingFolder:Oi,newFolderTempId:Qs,startFolderCreation:Ao,cancelFolderCreation:ul,saveFolderCreation:hl,validateFolderName:J,conflictResolutionPopupOptions:y,conflictingFiles:Bn,conflictResolutionOpen:Vn,closeConflictResolution:Ai,handleConflictReplace:el,handleConflictDuplicate:zn,handleConflictDecideForEach:Wn,uploadConflictingFiles:ko,uploadConflictResolutionOpen:Zn,closeUploadConflictResolution:al,handleUploadConflictReplace:ll,handleUploadConflictDuplicate:cl,handleUploadConflictDecideForEach:Xn,fileMetadataPopupOptions:fe,isMetadataPopupOpen:mv,selectedFileForMetadata:Cv,openMetadataPopup:vv,closeMetadataPopup:wv,onGetInfo:Ce,onUnshareFiles:k,actionsRef:ce,sharedByMePaths:we,onSearchFiles:z,searchInProgress:U,searchResults:H,clearSearchResults:oe,isSearchMode:Eo,emptyStateIcon:ie,emptyStateTitle:be,emptyStateDescription:Re,sharedWithMeIds:ke};return m.jsx(ev.Provider,{value:bv,children:e})},sv=()=>{const e=g.useContext(ev);if(!e)throw new Error("useFileManagerContext must be used within <FileManagerProvider>");return e},cL=({open:e,itemsToDelete:t,onClose:s,onConfirm:i,cancelLabel:o="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(OC,{open:e,header:d,confirmLabel:n,cancelLabel:o,variant:vo.Danger,onClose:s,onConfirm:i,children:h})},iv=({onClose:e,onConfirm:t,open:s,copyLabel:i="Copy",moveLabel:o="Move",addFolderLabel:n="Add folder",mode:r=Je.Copy,hiddenFilesSwitcherLabel:a="Show hidden files",onUploadFiles:l,onValidateUpload:c,maxFileSize:d,header:u,sourceFolder:h,disabledPathTooltip:p="Unavailable for the original path. Please select another folder",path:f,collapsedFileTree:C=!1,alertProps:w,...v})=>{const[b,S]=g.useState(!1),y=g.useRef(null),x=g.useCallback(E=>{S(E)},[]),F=r===Je.Copy?"Copy to":"Move to",R=g.useMemo(()=>!f||!h?!1:h===f,[f,h]);return m.jsx(Ii,{open:s,onClose:()=>{e()},size:Tt.Lg,className:"md:!h-[800px] !bg-layer-2",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(Kt,{label:n,appearance:Me.Ghost,iconBefore:m.jsx(_.IconFolderPlus,{...se}),onClick:()=>{y.current?.createFolder()}}),m.jsx("div",{className:"border border-l border-primary my-2"}),m.jsx("div",{className:"inline-flex items-center cursor-pointer",children:m.jsx(cu,{label:a,isOn:b,onChange:x,switchId:"hidden-files-switch"})})]}),m.jsxs("div",{className:"flex space-x-4",children:[m.jsx(Rs,{onClick:e,label:"Cancel"}),R?m.jsx(_t,{tooltip:p,children:m.jsx(Kt,{onClick:t,label:r==="copy"?i:o,disabled:R,"aria-disabled":R})}):m.jsx(Kt,{onClick:t,label:r==="copy"?i:o})]})]}),header:u??F,children:m.jsxs("div",{className:"bg-layer-2 h-full flex flex-col",children:[w&&m.jsx("div",{className:"px-4 pt-4",children:m.jsx(Ug,{...w})}),m.jsx("div",{className:"flex-1 min-h-0",children:m.jsx(cv,{...v,className:ne(v.className,"bg-layer-2 h-full"),actionsRef:y,path:f,showHiddenFiles:b,onShowHiddenFilesChange:x,treeOptions:{...v.treeOptions,collapsed:C,expandedPaths:new Set([v.rootItem?.path||"/"]),header:v.treeOptions?.header},gridOptions:{withSelectionColumn:!1,...v.gridOptions},navigationPanelOptions:{elementId:"file-manager-destination-search",...v.navigationPanelOptions},onUploadFiles:l,onValidateUpload:c,maxFileSize:d})})]})})},mu=e=>ge.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},ge.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"})),dL=({selectedFiles:e,actionLabels:t,onDuplicate:s,onCopy:i,onMove:o,onDownload:n,onUnshare:r,onDelete:a,getCurrentFolderPath:l,sharedWithMeIds:c,onClearSelection:d})=>g.useMemo(()=>{const u=[],h=Array.from(e.values());if(!h.length||!t)return u;if(t[te.Move]&&u.push({key:te.Move,label:t[te.Move],title:t[te.Move],icon:m.jsx(fu,{width:se.size,height:se.size,className:"text-secondary"}),onClick:()=>o(h)}),t[te.Copy]&&u.push({key:te.Copy,label:t[te.Copy],title:t[te.Copy],icon:m.jsx(pu,{width:se.size,height:se.size,className:"text-secondary"}),onClick:()=>i(h)}),t[te.Duplicate]&&u.push({key:te.Duplicate,label:t[te.Duplicate],title:t[te.Duplicate],icon:m.jsx(_.IconCopy,{...se,className:"text-secondary"}),onClick:()=>s(h)}),t[te.Delete]){const p=h.some(f=>f.permissions&&!f.permissions.includes(ki.WRITE));u.push({key:te.Delete,label:t[te.Delete],title:t[te.Delete],icon:m.jsx(_.IconTrashX,{...se,className:"text-secondary"}),disabled:p,onClick:()=>{const f=l();a(h,f)}})}if(t[te.Download]&&u.push({key:te.Download,label:t[te.Download],title:t[te.Download],icon:m.jsx(_.IconDownload,{...se,className:"text-secondary"}),onClick:()=>n(h)}),t[te.Unshare]&&r){const p=h.some(f=>!c?.includes(f.path));u.push({key:te.Unshare,label:t[te.Unshare],title:t[te.Unshare],disabled:p,icon:m.jsx(mu,{width:se.size,height:se.size,className:"text-secondary"}),onClick:()=>{r(h),d()}})}return u},[e,t,o,i,s,l,a,n,r,c,d]),uL=({actionLabels:e,onDuplicate:t,onCopy:s,onMove:i,onDownload:o,onRename:n,onDelete:r,onInfo:a,onUnshare:l,sharedWithMeIds:c,onAddSibling:d,onAddChild:u})=>g.useMemo(()=>h=>{const p=[];if(!e)return p;e[te.AddSibling]&&typeof d=="function"&&p.push({key:"addSibling",label:e[te.AddSibling],icon:m.jsx(QC,{width:se.size,height:se.size,className:"text-secondary"}),onClick:()=>d(h)}),e[te.AddChild]&&typeof u=="function"&&p.push({key:"addChild",label:e[te.AddChild],icon:m.jsx(XC,{width:se.size,height:se.size,className:"text-secondary"}),onClick:()=>u(h)},{key:"divider",type:Co.Divider}),e[te.Duplicate]&&p.push({key:te.Duplicate,label:e[te.Duplicate],icon:m.jsx(_.IconCopy,{...se,className:"text-secondary"}),onClick:()=>t(h)}),e[te.Copy]&&p.push({key:te.Copy,label:e[te.Copy],icon:m.jsx(pu,{width:se.size,height:se.size,className:"text-secondary"}),onClick:()=>s(h)}),e[te.Move]&&p.push({key:te.Move,label:e[te.Move],icon:m.jsx(fu,{width:se.size,height:se.size,className:"text-secondary"}),onClick:()=>i(h)}),e[te.Download]&&p.push({key:te.Download,label:e[te.Download],icon:m.jsx(_.IconDownload,{...se,className:"text-secondary"}),onClick:()=>o(h)});const f=!h.permissions||h.permissions.includes(ki.WRITE);return e[te.Delete]&&f&&p.push({key:te.Delete,label:e[te.Delete],icon:m.jsx(_.IconTrashX,{...se,className:"text-secondary"}),onClick:()=>r(h,h.parentPath??"")}),e[te.Rename]&&p.push({key:te.Rename,label:e[te.Rename],icon:m.jsx(_.IconPencilMinus,{...se,className:"text-secondary"}),onClick:()=>n(h.path)}),e[te.Info]&&h.nodeType===Te.ITEM&&p.push({key:te.Info,label:e[te.Info],icon:m.jsx(_.IconInfoCircle,{...se,className:"text-secondary"}),onClick:()=>a(h)}),e[te.Unshare]&&c?.includes(h.path)&&p.push({key:te.Unshare,label:e[te.Unshare],icon:m.jsx(mu,{width:se.size,height:se.size,className:"text-secondary"}),onClick:()=>l(h)}),p},[e,d,u,t,s,i,o,r,n,a,l,c]),Mg=({open:e,onClose:t,onReplace:s,onDuplicate:i,onDecideForEach:o,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,w=C?n[0]?.name:"",v=c?.[dt.Replace]??"Replace",b=c?.[dt.Duplicate]??"Duplicate",S=c?.[dt.Cancel]??"Cancel",y=d?.[Lt.ReplaceAll]??"Replace all",x=d?.[Lt.DuplicateAll]??"Duplicate all",F=d?.[Lt.DecideForEach]??"Decide for each",[R,E]=g.useState(dt.Replace),[P,M]=g.useState(Lt.ReplaceAll),[D,I]=g.useState(new Map(n.map(j=>[j.path,dt.Replace]))),[V,N]=g.useState(void 0),O=C?r:a,q=m.jsxs(m.Fragment,{children:["Item with the name ",m.jsxs("span",{className:"text-primary",children:['"',w,'"']})," ","already exists in this destination."]}),Q=`${n.length} items with the same names already exist in this destination.`,L=l??(C?q:Q),re=g.useMemo(()=>[{id:dt.Replace,name:v},{id:dt.Duplicate,name:b}],[v,b]),W=g.useMemo(()=>n.map(j=>({id:j.path,name:j.name,path:j.path,nodeType:j.nodeType??Te.ITEM,action:D.get(j.path)||dt.Replace})),[n,D]),ee=g.useMemo(()=>[{field:"name",headerName:p,flex:1,minWidth:200,floatingFilter:!1,filter:!1,resizable:!1,cellRenderer:j=>j.data?.nodeType===Te.FOLDER?m.jsx(xa,{name:j.data.name,iconSize:zs}):m.jsx(ya,{name:j.data.name,iconSize:zs})},{field:"action",headerName:f,width:140,suppressSizeToFit:!0,sortable:!1,filter:!1,floatingFilter:!1,resizable:!1,cellRenderer:j=>{if(!j.data)return null;const fe=[{key:dt.Replace,label:v,icon:m.jsx(_.IconCircleFilled,{size:10,className:"text-accent-tertiary"})},{key:dt.Duplicate,label:b,icon:m.jsx(_.IconCircleFilled,{size:10,className:"text-accent-secondary"})},{key:dt.Cancel,label:S,icon:m.jsx(_.IconCircleFilled,{size:10,className:"text-error"})}],Ce=fe.find(ce=>ce.key===j.data.action),k=V===j.data.path;return m.jsx("div",{className:"flex items-center h-full",children:m.jsx(yt,{trigger:[Ft.Click],open:k,menu:{items:fe,onClick:({key:ce})=>{I(we=>{const z=new Map(we);return z.set(j.data.path,ce),z}),N(void 0)}},placement:"bottom-start",matchReferenceWidth:!1,allowedPlacements:["bottom-start","top-start"],onOpenChange:ce=>{N(ce?j.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:[Ce?.icon,Ce?.label??v]}),m.jsx(_.IconChevronDown,{size:16,className:X("text-secondary transition-transform",k&&"rotate-180")})]})})})}}],[p,f,v,b,S,V]),Y=g.useMemo(()=>[{id:Lt.ReplaceAll,name:y},{id:Lt.DuplicateAll,name:x},{id:Lt.DecideForEach,name:F,content:P===Lt.DecideForEach?m.jsx("div",{className:"mt-4",children:m.jsx(au,{columnDefs:ee,rowData:W,getRowId:j=>j.id,withSelectionColumn:!1,wrapCustomCellRenderers:!1,alternateOddRowColors:!1,additionalGridOptions:{domLayout:"autoHeight"}})}):void 0}],[y,x,F,P,ee,W]),Z=g.useCallback(()=>{if(C)R===dt.Replace?s():i();else if(P===Lt.ReplaceAll)s();else if(P===Lt.DuplicateAll)i();else if(P===Lt.DecideForEach&&o){const j=n.map(fe=>({file:fe,action:D.get(fe.path)||dt.Replace}));o(j)}},[C,R,P,D,n,s,i,o]);return m.jsx(Ii,{open:e,onClose:t,size:C?Tt.Sm:Tt.Md,className:X([!C&&"w-[600px]"]),header:O,dividers:!1,footer:m.jsxs("div",{className:"flex justify-end gap-3 py-4 px-6 border-t border-tertiary",children:[m.jsx(Rs,{onClick:t,label:h}),m.jsx(Kt,{onClick:Z,label:u})]}),children:m.jsxs("div",{className:"px-6 py-4",children:[m.jsx("p",{className:"text-secondary mb-4 break-words",children:L}),C?m.jsx(Hr,{elementId:"single-file-conflict",radioButtons:re,activeRadioButton:R,orientation:pi.Column,onChange:j=>E(j)}):m.jsx(Hr,{elementId:"multiple-files-conflict",radioButtons:Y,activeRadioButton:P,orientation:pi.Column,onChange:j=>M(j),formItemChildrenClassName:"gap-3"})]})})};function hL(e){const t=g.useRef(null),[s,i]=g.useState(!1);return g.useEffect(()=>{if(!t.current)return;const o=new ResizeObserver(([n])=>{const r=n.contentRect.width;i(r<e)});return o.observe(t.current),()=>o.disconnect()},[e]),{containerRef:t,isBelowBreakpoint:s}}const gL=({getContextMenuItems:e,isRowDisabled:t,allowedFileTypes:s,maxSelectableFileSize:i,buttonClassName:o})=>{const n=g.useCallback(a=>{if(!a.data||t(a.data,s,i))return null;const c=a.data?e?.(a.data)??[]:[];return c.length?m.jsx(yt,{placement:"bottom-start",allowedPlacements:["top-start","top-end","bottom-start"],menu:{items:c},className:ne("sticky right-0",o),children:m.jsx(Ne,{className:"text-secondary mx-2 flex flex-row gap-2 hover:text-accent-primary",icon:m.jsx(_.IconDotsVertical,{...se})})}):null},[s,i,o,e,t]);return{actionsColumnDef:g.useMemo(()=>({colId:"__actions",headerName:"",width:44,minWidth:44,suppressSizeToFit:!0,sortable:!1,resizable:!1,filter:!1,floatingFilter:!1,cellRenderer:n}),[n])}},pL=({onRename:e})=>{const[t,s]=g.useState(co.Grid),i=g.useCallback(n=>{e(n),s(co.Grid)},[e]),o=g.useCallback(n=>{e(n),s(co.Tree)},[e]);return{renameTriggerView:t,onGridRename:i,onTreeRename:o}},fL=100,zo=16,Jt="text-secondary",br="text-primary min-w-0",mL="text-primary break-words min-w-0",Wo="bg-layer-2",CL=({open:e,onClose:t,fileMetadata:s,loading:i=!1,header:o="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(Ii,{open:e,onClose:t,size:Tt.Sm,header:o,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:`${fL}px 1fr`},children:i?m.jsxs(m.Fragment,{children:[m.jsx("div",{className:Jt,children:n}),m.jsx(ji,{variant:Gt.Text,width:"100%",height:zo,className:Wo}),m.jsx("div",{className:Jt,children:a}),m.jsx(ji,{variant:Gt.Text,width:"90%",height:zo,className:Wo}),m.jsx("div",{className:Jt,children:l}),m.jsx(ji,{variant:Gt.Text,width:"60%",height:zo,className:Wo}),m.jsx("div",{className:Jt,children:c}),m.jsx(ji,{variant:Gt.Text,width:"80%",height:zo,className:Wo}),m.jsx("div",{className:Jt,children:r}),m.jsx(ji,{variant:Gt.Text,width:"70%",height:zo,className:Wo})]}):s?m.jsxs(m.Fragment,{children:[m.jsx("div",{className:Jt,children:n}),m.jsx("div",{className:br,children:m.jsx(ot,{text:s.name})}),m.jsx("div",{className:Jt,children:a}),m.jsx("div",{className:br,children:m.jsx(ot,{text:DA(s.updatedAt,d,u)})}),m.jsx("div",{className:Jt,children:l}),m.jsx("div",{className:br,children:m.jsx(ot,{text:gu(s.contentLength)})}),m.jsx("div",{className:Jt,children:c}),m.jsx("div",{className:br,children:m.jsx(ot,{text:s.author||"—"})}),m.jsx("div",{className:Jt,children:r}),m.jsx("div",{className:mL,children:decodeURIComponent(s.path)})]}):null})})}),vL="en-US",wL={year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"},bL="text-primary";function ov(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 i=Number(t);return ov(i)}const s=new Date(t);return isFinite(s.getTime())?s:null}return null}const nv=({value:e,locale:t=vL,options:s=wL,emptyPlaceholder:i,className:o})=>{const n=ov(e),r=g.useMemo(()=>n?new Intl.DateTimeFormat(t,s).format(n):i,[n,i,t,s]),a=n?n.toISOString():void 0;return m.jsx(ot,{text:a?m.jsx("time",{dateTime:a,children:r}):m.jsx("span",{children:r}),className:X(bL,o),hideTooltip:!1})},SL=({id:e,name:t,nodeType:s,size:i,updatedAt:o,dateLocale:n,dateOptions:r,shared:a,sharedIndicatorClassName:l})=>m.jsx("div",{className:"flex",children:m.jsx("div",{className:"flex flex-1 min-w-0",children:m.jsx(ga,{type:s===Te.FOLDER?Wt.Folder:Wt.File,name:t,elementId:e,shared:a,iconSize:zs,sharedIndicatorClassName:l,details:m.jsxs("div",{className:"flex items-center gap-1 dial-tiny text-secondary",children:[m.jsx("span",{children:s===Te.ITEM?gu(i):""}),o&&i&&m.jsx(_.IconCircleFilled,{size:2,className:"text-secondary"}),o?m.jsx("span",{children:m.jsx(nv,{value:o,locale:n?.toString(),options:r,className:"dial-tiny text-secondary"})}):null]})})})}),rv=e=>(t,s,i)=>({colId:Qe.Name,field:"name",headerName:e,flex:1,minWidth:200,cellRenderer:o=>{const n=o.data.nodeType,{saveFolderCreation:r,validateFolderName:a,cancelFolderCreation:l,newFolderTempId:c,sharedByMePaths:d,selectedPaths:u}=o.context,h=d?.has(o.data.path),p=u?.has(o.data.path),f=ne(["group-hover/grid-row:bg-accent-primary-alpha",p&&"bg-accent-primary-alpha"]);if(o.data?.isTemporary&&o.data.id===c)return m.jsx(ga,{name:"",type:Wt.Folder,elementId:`new-folder-${o.data.id}`,editing:!0,shared:h,sharedIndicatorClassName:f,iconSize:zs,validate:a,onSave:r,onCancel:l,inputContainerClassName:ne(["!h-9",i&&n===Te.ITEM&&"!h-10"])});const{renameTriggerView:C,renamedPath:w,renamedItem:v,getDisplayName:b,onRenameValidate:S,onRenameSave:y,onRenameCancel:x}=o.context;if(C===co.Grid&&w===o.data?.path&&v&&o.data){const R=b(v);return m.jsx(ga,{name:R,type:n===Te.FOLDER?Wt.Folder:Wt.File,elementId:`rename-${o.data.id}`,editing:!0,shared:h,sharedIndicatorClassName:f,iconSize:zs,validate:E=>S(E,v),onSave:y,onCancel:x,inputContainerClassName:ne(["!h-9",i&&n===Te.ITEM&&"!h-10"])})}return i?m.jsx(SL,{id:o.data.id,name:o.data.name,nodeType:n,size:o.data.size,shared:h,sharedIndicatorClassName:f,updatedAt:o.data.updatedAt,dateLocale:t,dateOptions:s}):n===Te.FOLDER?m.jsx(xa,{name:o.data.name,shared:h,sharedIndicatorClassName:f,iconSize:zs}):m.jsx(ya,{name:o.data.name,shared:h,sharedIndicatorClassName:f,iconSize:zs})}}),av=e=>(t,s)=>({colId:Qe.UpdatedAt,field:"updatedAt",headerName:e,width:168,suppressSizeToFit:!0,cellRenderer:nv,cellRendererParams:{locale:t,options:s}}),lv=e=>({colId:Qe.Size,field:"size",headerName:e,width:120,suppressSizeToFit:!0,cellRenderer:t=>t.data.nodeType===Te.ITEM?gu(t.data.contentLength):""}),yL=e=>{const t=e.event;if(!(t?.target??null)?.closest("input")||!t)return!1;switch(t.key){case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"ArrowDown":case"Home":case"End":return!0;default:return!1}};function xL({userColumnDefs:e,filterable:t,dateLocale:s,dateOptions:i,effectiveVisibleColumns:o,isCompactView:n,hasActions:r,actionsColumnDef:a,rootItemLabel:l,rootItemPath:c}){const d=g.useMemo(()=>[rv("Name")(s,i,n),{colId:Qe.Path,field:"path",headerName:"Path",flex:1,minWidth:200,cellRenderer:h=>{if(!c||!l)return m.jsx(ot,{text:h.data.path});const p=h.data.path.replace(c,l);return m.jsx(ot,{text:p})}},av("Modified Date")(s,i),lv("Size"),{colId:Qe.Author,field:"author",headerName:"Author",width:200,suppressSizeToFit:!0,cellRenderer:h=>h.data.author},{colId:Qe.Owner,field:"owner",headerName:"Owner",width:200,suppressSizeToFit:!0,cellRenderer:h=>h.data.owner}],[s,i,n,l,c]);return{columnDefs:g.useMemo(()=>{const h=e?.map(C=>typeof C=="function"?C(s,i,n):C);let p=h??d;h||(p=p.filter(C=>C.colId&&o.includes(C.colId))),r&&(n&&(p=p.slice(0,1)),p.push(a));const f=C=>C.colId===Qe.Name;return p.map(C=>{const w={...C,filter:t?C.filter:!1,floatingFilter:t?C.floatingFilter:!1};return f(C)&&!C.suppressKeyboardEvent&&(w.suppressKeyboardEvent=yL),w})},[a,s,i,d,o,t,r,n,e])}}const cv=e=>m.jsx(tv,{...e,children:m.jsx(RL,{})}),RL=()=>{const{className:e,items:t,rootItem:s,filesLoading:i,treeOptions:o,showNavigationPanel:n,navigationPanelOptions:r,gridOptions:a,toolbarOptions:l,bulkActionsToolbarOptions:c,deleteConfirmationOptions:d,destinationFolderPopupOptions:u,conflictResolutionPopupOptions:h,compactViewWidthBreakpoint:p=RA,sharedByMePaths:f,allowedFileTypes:C,maxSelectableFileSize:w,areHiddenFilesVisible:v,toggleHiddenFilesVisibility:b,isTreeCollapsed:S,toggleTreeCollapse:y,currentPath:x,gridRows:F,selectedPaths:R,selectedFiles:E,clearSelection:P,setSelectedPaths:M,effectiveSearchValue:D,handleBreadcrumbItemClick:I,handleSearchChange:V,handleTreeItemClick:N,handleTableRowClick:O,onGridApiChange:q,handleOpenDestinationFolderPopup:Q,handleCloseDestinationFolderPopup:L,openDestinationFolderPopup:re,destinationFolderMode:W,handleSetCopiedFiles:ee,handleSetMovedFiles:Y,handleDuplicate:Z,handleCopyTo:j,handleMoveTo:fe,handleAddSibling:Ce,handleAddChild:k,handleDownloadFiles:ce,openDeleteConfirmation:we,closeDeleteConfirmation:z,confirmDelete:H,deleteConfirmationOpen:U,itemsToDelete:oe,renamedPath:he,renamedItem:ye,onRename:ie,onRenameSave:be,onRenameCancel:Re,onRenameValidate:ke,getDisplayName:me,isDragging:ve,isDraggingOverWindow:He,handleDragEnter:We,handleDragLeave:Pe,handleDragOver:kt,handleDrop:at,onUploadFiles:ds,onValidateUpload:G,maxFileSize:Se,newActions:lt,isNewButtonVisible:us,isNewButtonDisabled:On,newFolderTempId:Na,cancelFolderCreation:Ha,saveFolderCreation:Ga,validateFolderName:Ba,startFolderCreation:Nn,conflictingFiles:Va,conflictResolutionOpen:za,closeConflictResolution:Wa,handleConflictReplace:_a,handleConflictDuplicate:ja,handleConflictDecideForEach:Eo,uploadConflictingFiles:Ua,uploadConflictResolutionOpen:Do,closeUploadConflictResolution:$a,handleUploadConflictReplace:Ka,handleUploadConflictDuplicate:Hn,handleUploadConflictDecideForEach:gt,openMetadataPopup:qa,fileMetadataPopupOptions:Xt,isMetadataPopupOpen:Ya,selectedFileForMetadata:Za,closeMetadataPopup:Xa,onUnshareFiles:Ms,actionsRef:Qa,searchInProgress:Ja,isSearchMode:Po,emptyStateIcon:Gn,emptyStateTitle:Bn="You don't have any files",emptyStateDescription:Vn="Upload or drag and drop files",sharedWithMeIds:Ai}=sv(),{width:el=vA,header:zn=wA,containerClassName:Wn=fA,additionalButtons:_n,...jn}=o??{},[Li,Un]=g.useState(el),{renameTriggerView:Mo,onGridRename:tl,onTreeRename:$n}=pL({onRename:ie}),To=g.useRef(null),sl=J=>{To.current===null&&(To.current=requestAnimationFrame(()=>{Un(J),To.current=null}))},{columnDefs:il,filterable:ol=!0,dateLocale:nl,dateOptions:rl,visibleColumns:Io=[Qe.Name,Qe.UpdatedAt,Qe.Size,Qe.Author,Qe.Actions],...Kn}=a??{},{containerRef:qn,isBelowBreakpoint:Rt}=hL(p),Yn=g.useMemo(()=>Po?[Qe.Name,Qe.Path,Qe.Actions]:Io,[Po,Io]),ko=g.useCallback((J,Le,Ts)=>{const Is=J.nodeType===Te.FOLDER||!J.contentLength||typeof Ts!="number"||J.contentLength<=Ts;return!(J.nodeType===Te.FOLDER||!J.contentType||KC(Le,J.contentType,J.name))||!Is},[]),Zn=g.useCallback(J=>{const Le=[];return o?.actionLabels&&(o.actionLabels[te.AddSibling]&&typeof Ce=="function"&&Le.push({key:"addSibling",label:o.actionLabels[te.AddSibling],icon:m.jsx(QC,{width:se.size,height:se.size,className:"text-secondary"}),onClick:()=>Ce([J])}),o.actionLabels[te.AddChild]&&typeof k=="function"&&Le.push({key:"addChild",label:o.actionLabels[te.AddChild],icon:m.jsx(XC,{width:se.size,height:se.size,className:"text-secondary"}),onClick:()=>k([J])},{key:"divider",type:Co.Divider}),o.actionLabels[te.Duplicate]&&Le.push({key:"duplicate",label:o.actionLabels[te.Duplicate],icon:m.jsx(_.IconCopy,{...se,className:"text-secondary"}),onClick:()=>Z([J])}),o.actionLabels[te.Copy]&&Le.push({key:Je.Copy,label:o.actionLabels[te.Copy],icon:m.jsx(pu,{width:se.size,height:se.size,className:"text-secondary"}),onClick:()=>{ee([J]),Q(Je.Copy)}}),o.actionLabels[te.Move]&&Le.push({key:Je.Move,label:o.actionLabels[te.Move],icon:m.jsx(fu,{width:se.size,height:se.size,className:"text-secondary"}),onClick:()=>{Y([J]),Q(Je.Move)}}),o.actionLabels[te.Download]&&Le.push({key:"download",label:o.actionLabels[te.Download],icon:m.jsx(_.IconDownload,{...se,className:"text-secondary"}),onClick:()=>ce([J])}),o.actionLabels[te.Rename]&&Le.push({key:"rename",label:o.actionLabels[te.Rename],icon:m.jsx(_.IconPencilMinus,{...se,className:"text-secondary"}),onClick:()=>$n(J.path)}),o.actionLabels[te.Unshare]&&Ai?.includes(J.path)&&Le.push({key:"unshare",label:o.actionLabels[te.Unshare],icon:m.jsx(mu,{width:se.size,height:se.size,className:"text-secondary"}),onClick:()=>Ms?.([J])}),o.actionLabels[te.Delete]&&J.permissions?.includes(ki.WRITE)&&Le.push({key:"delete",label:o.actionLabels[te.Delete],icon:m.jsx(_.IconTrashX,{...se,className:"text-secondary"}),onClick:()=>we([J],J.parentPath??"")})),Le},[o?.actionLabels,Ce,k,Z,ee,Q,Y,ce,$n,Ms,Ai,we]),al=g.useMemo(()=>{const J=new Map;return E.forEach((Le,Ts)=>{const Is=F.find(er=>er.path===Ts);Is&&J.set(Ts,Is)}),J},[E,F]),ll=g.useMemo(()=>{const J=new Set;return F.filter(Le=>ko(Le,C,w)).forEach(Le=>J.add(Le.path)),J},[C,w,F,ko]),cl=g.useCallback(J=>{const Le=new Set;J.forEach((Ts,Is)=>Le.add(Is)),M(Le)},[M]),Xn=dL({selectedFiles:E,actionLabels:c?.actionLabels,onDuplicate:Z,onCopy:J=>{ee(J),Q(Je.Copy)},onMove:J=>{Y(J),Q(Je.Move)},onDownload:ce,onDelete:we,onUnshare:Ms,getCurrentFolderPath:()=>x??"/",sharedWithMeIds:Ai,onClearSelection:P}),dl=g.useCallback(()=>l&&R.size===0?m.jsx("div",{className:xg,role:"toolbar","aria-label":"File Manager Toolbar",children:m.jsx(HA,{...l,areHiddenFilesVisible:v,onToggleHiddenFiles:b,isNewButtonVisible:us,isNewButtonDisabled:On,newButtonDropdownItems:lt})}):R.size>0&&c?m.jsx("div",{className:xg,role:"toolbar","aria-label":"File Manager Toolbar",children:m.jsx(zA,{...c,selectedCount:R.size,onClearSelection:P,actions:Xn})}):m.jsx("div",{}),[c,R,P,Xn,v,b,l,us,On,lt]);g.useImperativeHandle(Qa,()=>({createFolder:Nn}),[Nn]);const Qn=g.useCallback(()=>Rt?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(rp,{defaultWidth:Li,width:Li,onResizeStop:Un,onResize:sl,minWidth:SA,maxWidth:yA,enabled:!S,children:m.jsx($g,{width:Li,title:zn,containerClassName:Wn,titleClassName:"dial-body-text text-primary",additionalButtons:_n,isOpened:!S,onToggle:y,children:m.jsx(kA,{...jn,items:t,rootItemPath:s?.path,rootItemLabel:s?.label,selectedPath:x,sharedByMePaths:f,onItemClick:N,areHiddenFilesVisible:v,getContextMenuItems:Zn,renamedPath:Mo===co.Tree?he:void 0,onRenameSave:be,onRenameCancel:Re,onRenameValidate:ke})})})}),[_n,v,Wn,x,jn,Zn,N,Rt,S,t,s,Re,be,ke,Mo,he,Li,zn,f,y]),Jn=uL({actionLabels:a?.actionLabels,onDuplicate:J=>Z([J]),onCopy:J=>{ee([J]),Q(Je.Copy)},onMove:J=>{Y([J]),Q(Je.Move)},onDownload:J=>ce([J]),onRename:tl,onDelete:(J,Le)=>we([J],Le),onInfo:J=>qa(J),onUnshare:J=>Ms?.([J]),sharedWithMeIds:Ai,onAddChild:J=>k?.([J]),onAddSibling:J=>Ce?.([J])}),Oi=g.useCallback(J=>{const Le=Ri(t,J.path);return Le?Jn(Le):[]},[t,Jn]),{actionsColumnDef:Qs}=gL({getContextMenuItems:Oi,isRowDisabled:ko,allowedFileTypes:C,buttonClassName:Rt?"":CA}),{columnDefs:Ao}=xL({userColumnDefs:il,filterable:ol,dateLocale:nl,dateOptions:rl,effectiveVisibleColumns:Yn,isCompactView:Rt,hasActions:!!a?.actionLabels,actionsColumnDef:Qs,rootItemLabel:s?.label,rootItemPath:s?.path}),ul=g.useCallback(J=>{J.colDef.colId==="__select"||J.colDef.colId===Qe.Actions||he&&J.data?.path===he||J.data?.isTemporary||J.data&&O(J.data)},[he,O]),hl=g.useCallback(()=>m.jsx(En,{title:Bn,description:Vn,descriptionClassName:"text-sm",containerClassName:"gap-3 size-full bg-layer-2 border rounded-[4px] border-primary",titleClassName:"mt-2 !text-lg",icon:Gn||m.jsx(_.IconFileDescription,{size:100,stroke:.5,className:"text-secondary"})}),[Vn,Gn,Bn]);return m.jsxs("section",{ref:qn,className:ne(hA,{"gap-3 pt-4":c&&R.size>0,"gap-4 p-3 pt-4":Rt,"gap-2 pt-2":Rt&&c&&R.size>0},e),children:[dl(),m.jsxs("div",{className:gA,children:[Qn(),m.jsxs("div",{className:ne(pA,{"gap-3":Rt}),children:[n&&m.jsx(NA,{...r??{},makeHref:J=>J.join("/"),path:x,onItemClick:I,rootItemPath:s?.path,rootItemLabel:s?.label,value:D,onSearchChange:V,isCompactView:Rt,labelClassName:"dial-tiny"}),m.jsx("section",{role:"region","aria-label":"File Manager Grid View",className:ne(mA),onDragEnter:We,onDragLeave:Pe,onDragOver:kt,onDrop:at,children:F.length===0&&!Po&&!i?hl():m.jsx(au,{columnDefs:Ao,rowData:F,getRowId:J=>J.path,loading:i||Ja,getContextMenuItems:Oi,withoutHeaderBorders:Rt,selectionOnHover:!Rt,onGridApiChange:q,className:X(ve?"border border-dashed border-accent-primary":"",He&&!ve?"border border-dashed border-primary":""),...Kn,additionalGridOptions:{...Kn.additionalGridOptions,onCellClicked:ul,headerHeight:uc,rowHeight:uc,rowClass:"group/grid-row",...Rt?{getRowHeight:J=>J.data?.nodeType===Te.FOLDER?uc:xA}:{},context:{cancelFolderCreation:Ha,saveFolderCreation:Ga,getDisplayName:me,onRenameCancel:Re,onRenameSave:be,onRenameValidate:ke,renameTriggerView:Mo,validateFolderName:Ba,renamedItem:ye,renamedPath:he,newFolderTempId:Na,sharedByMePaths:f,selectedPaths:R}},selectedRows:al,onSelectionChangeWithMap:cl,wrapperBorder:!ve&&!He,disabledRowIds:ll})})]})]}),m.jsx(cL,{...d,open:U,itemsToDelete:oe,onClose:z,onConfirm:H}),m.jsx(iv,{...u,open:re,onClose:L,onConfirm:()=>{const J=u?.destinationFolderPath??"/";W===Je.Copy?j(J):fe(J),L()},mode:W,items:t,rootItem:s,gridOptions:{columnDefs:Ao.filter(J=>J.colId!==Qe.Actions),loading:i},onUploadFiles:ds,onValidateUpload:G,maxFileSize:Se,path:u?.destinationFolderPath??u?.sourceFolder??x,onPathChange:J=>{u?.setDestinationFolderPath?.(J)},sourceFolder:u?.sourceFolder??x,treeOptions:{header:o?.header}}),m.jsx(Mg,{...h,open:za,onClose:Wa,onReplace:_a,onDuplicate:ja,onDecideForEach:Eo,conflictingFiles:Va}),m.jsx(Mg,{...h,open:Do,onClose:$a,onReplace:Ka,onDuplicate:Hn,onDecideForEach:gt,conflictingFiles:Ua}),m.jsx(CL,{open:Ya,onClose:Xa,fileMetadata:Xt?.fileMetadata??Za,loading:Xt?.loading,header:Xt?.header,nameLabel:Xt?.nameLabel,pathLabel:Xt?.pathLabel,modifiedDateLabel:Xt?.modifiedDateLabel,sizeLabel:Xt?.sizeLabel,authorLabel:Xt?.authorLabel,dateLocale:a?.dateLocale,dateOptions:a?.dateOptions})]})},FL=(e,t=Zi.MyFiles)=>{const s=Object.values(Zi).includes(t)?t:Zi.MyFiles,[i,o]=g.useState(s),n=a=>{o(a)},r=g.useMemo(()=>{if(e)return Object.values(Zi).map(a=>({id:a,label:e?.[a]||a.replace("_"," ")}))},[e]);return{activeTab:i,handleTabChange:n,tabs:r}};exports.AlertVariant=ii;exports.ButtonAppearance=Me;exports.ButtonSize=$o;exports.ButtonVariant=qe;exports.ConfirmationPopupVariant=vo;exports.DialAlert=Ug;exports.DialAutocompleteInput=H8;exports.DialAutocompleteInputValue=du;exports.DialBreadcrumb=MC;exports.DialBreadcrumbItem=Uo;exports.DialButton=xt;exports.DialButtonDropdown=sd;exports.DialCheckbox=rn;exports.DialCloseButton=ru;exports.DialCollapsibleSidebar=$g;exports.DialConditionalResizableContainer=rp;exports.DialConfirmationPopup=OC;exports.DialDestinationFolderPopup=iv;exports.DialDraggableItem=Pb;exports.DialDropdown=yt;exports.DialEllipsisTooltip=ot;exports.DialErrorButton=IC;exports.DialErrorText=Ws;exports.DialFieldLabel=Fi;exports.DialFileIcon=hd;exports.DialFileManager=cv;exports.DialFileManagerActions=te;exports.DialFileManagerTabs=Zi;exports.DialFileName=ya;exports.DialFileNodeType=Te;exports.DialFilePermission=ki;exports.DialFileResourceType=$C;exports.DialFolderName=xa;exports.DialFormItem=pa;exports.DialFormPopup=k8;exports.DialGhostButton=h8;exports.DialGrid=au;exports.DialIcon=Ne;exports.DialInput=xi;exports.DialInputPopup=NC;exports.DialItemType=Wt;exports.DialLabelledText=Rw;exports.DialLinkButton=u8;exports.DialLoadFileAreaField=cA;exports.DialLoader=Fn;exports.DialNeutralButton=Rs;exports.DialNoDataContent=En;exports.DialNumberInputField=C8;exports.DialPasswordInput=HC;exports.DialPasswordInputField=O8;exports.DialPopup=Ii;exports.DialPrimaryButton=Kt;exports.DialRadioButton=nd;exports.DialRadioGroup=Hr;exports.DialRadioGroupPopupField=P8;exports.DialRemoveButton=kC;exports.DialResizableContainer=np;exports.DialSearch=uu;exports.DialSelect=BC;exports.DialSelectField=U8;exports.DialSharedEntityIndicator=ln;exports.DialSkeleton=ji;exports.DialSkeletonAvatarShape=Gr;exports.DialSkeletonAvatarSize=qo;exports.DialSkeletonVariant=Gt;exports.DialSteps=vw;exports.DialSwitch=cu;exports.DialTabs=FC;exports.DialTag=ma;exports.DialTagInput=G8;exports.DialTextAreaField=w8;exports.DialTextInputField=v8;exports.DialTextarea=AC;exports.DialTooltip=_t;exports.DropdownItemType=Co;exports.DropdownTrigger=Ft;exports.DropdownType=RC;exports.FileManagerColumnKey=Qe;exports.FileManagerProvider=tv;exports.FlexibleActionsDirection=ri;exports.FormItemOrientation=an;exports.GridSelectionMode=Yi;exports.NAME_COLUMN=rv;exports.PopupSize=Tt;exports.RadioGroupOrientation=pi;exports.ResizableContainerSide=cn;exports.SIZE_COLUMN=lv;exports.SearchSize=xn;exports.SelectSize=ua;exports.SelectVariant=ha;exports.StepStatus=Et;exports.TabOrientation=ca;exports.TagVariant=fa;exports.UPDATED_AT_COLUMN=av;exports.mergeClasses=ne;exports.useDialFileManagerTabs=FL;exports.useEditableItem=qC;exports.useFileManagerContext=sv;
|