UNPKG

ag-grid-community

Version:

Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue

1 lines 1.27 MB
import{LocalEventService as cv,_escapeString as uv}from"ag-stack";var id={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}};import{_doOnce as hv,_missing as od}from"ag-stack";import{_areEqual as gv}from"ag-stack";var Do=e=>e==="__proto__"||e==="constructor"||e==="prototype",xi=e=>{const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},Mo=e=>e!==null&&typeof e=="object"&&xi(e),sd=(e,t,i,o,s)=>{let r=e[t];if(r!==i){if(i===null||typeof i!="object"){(o||i!==void 0)&&(e[t]=i);return}s&&r==null&&xi(i)&&(r={},e[t]=r),r!==null&&typeof r=="object"&&!Array.isArray(r)?he(r,i,o,s):e[t]=i}},he=(e,t,i=!0,o=!1)=>{if(!(t==null||t==="")){if(Array.isArray(t)){for(let s=0,r=t.length;s<r;++s)sd(e,s,t[s],i,o);return}for(const s of Object.keys(t))Do(s)||sd(e,s,t[s],i,o)}},Ao=e=>{if(e===null||typeof e!="object")return e;if(Array.isArray(e)){const i=e.length,o=new Array(i);for(let s=0;s<i;++s)o[s]=Ao(e[s]);return o}if(!xi(e))return e;const t={};for(const i of Object.keys(e))Do(i)||(t[i]=Ao(e[i]));return t},ti=(e,t,i)=>{if(e===t)return!0;if(e===null||t===null||typeof e!="object"||typeof t!="object")return!1;const o=Array.isArray(e);if(o!==Array.isArray(t))return!1;if(o)return gv(e,t);if(!xi(e)||!xi(t))return!1;const s=Object.keys(e),r=Object.keys(t),n=s.length,a=r.length;if(i===void 0){if(n!==a)return!1;for(let c=0;c<n;++c){const u=s[c];if(!(u in t)||!ti(e[u],t[u]))return!1}return!0}let l=0;for(let c=0;c<n;++c){const u=s[c];if(l===0&&u===i){l=1;continue}if(!(u in t)||!ti(e[u],t[u]))return!1}const d=i in t?1:0;return n-l===a-d},dr=class at{static applyGlobalGridOptions(t){if(!at.gridOptions)return{...t};let i={};return he(i,at.gridOptions,!0,!0),at.mergeStrategy==="deep"?he(i,t,!0,!0):i={...i,...t},at.gridOptions.context&&(i.context=at.gridOptions.context),t.context&&(at.mergeStrategy==="deep"&&i.context&&he(t.context,i.context,!0,!0),i.context=t.context),i}static applyGlobalGridOption(t,i){if(at.mergeStrategy==="deep"){const o=cr(t);if(o&&typeof o=="object"&&typeof i=="object")return at.applyGlobalGridOptions({[t]:i})[t]}return i}};dr.gridOptions=void 0,dr.mergeStrategy="shallow";var Fi=dr;function pv(e,t="shallow"){Fi.gridOptions=e,Fi.mergeStrategy=t}function cr(e){return Fi.gridOptions?.[e]}var rd={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipSwitchShowDelay:200,tooltipHideDelay:1e4,noteTrigger:"hover",noteShowDelay:180,noteHideDelay:220,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:" ",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,enableStrictPivotColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressMoveWhenColumnDragging:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,includeHiddenColumnsInCharts:!0,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,cellFlashDuration:500,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,refreshAfterGroupEdit:!1,rowDragInsertDelay:500,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupHideColumnsUntilExpanded:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,pivotPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,suppressContentVisibilityAuto:!0,contentVisibilityAutoDelay:1e3,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1,columnMenu:"new",reactiveCustomComponents:!0,suppressSetFilterByDefault:!1,enableFilterHandlers:!1};function Io(e){return typeof e=="number"&&Number.isFinite(e)}function nd(e){const t=Number(e);return Number.isFinite(t)?t:null}function xt(e,t,i){return Math.max(t,Math.min(e,i))}function ad(e,t){if(typeof e!="number")return"";const i=t(),o=i("thousandSeparator",","),s=i("decimalSeparator",".");return e.toString().replace(".",s).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${o}`)}function ld(e,t){return e.get("rowModelType")===t}function de(e,t){return ld(e,"clientSide")}function ii(e,t){return ld(e,"serverSide")}function oe(e,t){return e.get("domLayout")===t}function Ke(e){return Ai(e)!==void 0}function ur(e){return typeof e.get("getRowHeight")=="function"}function fv(e,t){return t?!e.get("enableStrictPivotColumnOrder"):e.get("maintainColumnOrder")}function dd({gos:e,formula:t}){const i=e.get("rowNumbers");return i||!!t?.active&&i!==!1}function je(e,t,i=!1,o){const{gos:s,environment:r}=e;if(o==null&&(o=r.getDefaultRowHeight()),ur(s)){if(i)return{height:o,estimated:!0};const l={node:t,data:t.data},d=s.getCallback("getRowHeight")(l);if(Io(d))return d===0&&e.log.warn(23),{height:Math.max(1,d),estimated:!1}}if(t.detail&&s.get("masterDetail"))return mv(s);const n=s.get("rowHeight");return{height:n&&Io(n)?n:o,estimated:!1}}function mv(e){if(e.get("detailRowAutoHeight"))return{height:1,estimated:!1};const t=e.get("detailRowHeight");return Io(t)?{height:t,estimated:!1}:{height:300,estimated:!1}}function lt(e){const{environment:t,gos:i}=e,o=i.get("rowHeight");if(!o||od(o))return t.getDefaultRowHeight();const s=t.refreshRowHeightVariable();return s!==-1?s:(e.log.warn(24),t.getDefaultRowHeight())}function cd(e,t,i){const o=t[e.getDomDataKey()];return o?o[i]:void 0}function Ft(e,t,i,o){const s=e.getDomDataKey();let r=t[s];od(r)&&(r={},t[s]=r),r[i]=o}function Pt(e){return e.get("ensureDomOrder")?!1:e.get("animateRows")}function hr(e){return!(e.get("paginateChildRows")||e.get("groupHideOpenParents")||oe(e,"print"))}function Ze(e){return!e.get("autoGroupColumnDef")?.comparator&&!e.get("treeData")}function Pi(e){const t=e.get("groupAggFiltering");if(typeof t=="function")return e.getCallback("groupAggFiltering");if(t===!0)return()=>!0}function gr(e){return e.get("grandTotalRow")}function ud(e){switch(e){case"pinnedTop":return"top";case"pinnedBottom":return"bottom";default:return null}}function Cv(e){const t=e.get("groupTotalRow");return typeof t=="function"?e.getCallback("groupTotalRow"):()=>t??void 0}function hd(e){return e.get("groupHideOpenParents")?!0:e.get("groupDisplayType")==="multipleColumns"}function gd(e){return hd(e)&&e.get("groupHideColumnsUntilExpanded")&&de(e)}function pr(e,t){return t?!1:e.get("groupDisplayType")==="groupRows"}function fr(e,t,i){return!!t.group&&!t.footer&&pr(e,i)}function Dt(e){const t=e.gos.getCallback("getRowId");return t===void 0?t:i=>{let o=t(i);return typeof o!="string"&&(hv(()=>e.log.warn(25,{id:o}),`getRowIdString:${e.context.getId()}`),o=String(o)),o}}function pd(e,t){const i=e.get("groupHideParentOfSingleChild");return!!(i===!0||i==="leafGroupsOnly"&&t.leafGroup||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")&&t.leafGroup)}function fd(e){const t=e.get("maxConcurrentDatasourceRequests");return t>0?t:void 0}function vv(e,t){const i=e.get("suppressGroupChangesColumnVisibility");if(i===!0||t&&i==="suppressHideOnGroup"||!t&&i==="suppressShowOnUngroup")return!1;const o=e.get("suppressRowGroupHidesColumns");if(t&&o===!0)return!1;const s=e.get("suppressMakeColumnVisibleAfterUnGroup");return!(!t&&s===!0)}function Mt(e){return e?.checkboxes??!0}function Di(e){return e?.mode==="multiRow"&&(e.headerCheckbox??!0)}function Mi(e){if(typeof e=="object")return e.checkboxLocation??"selectionColumn"}function mr(e){return e?.hideDisabledCheckboxes??!1}function md(e){return typeof e.get("rowSelection")!="string"}function wv(e){return e.get("cellSelection")!==void 0}function bv(e){const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"?t?.suppressMultiRanges??!1:!1:e.get("suppressMultiRangeSelection")}function Ne(e){const t=e.get("cellSelection");return t!==void 0?!!t:e.get("enableRangeSelection")}function Sv(e){const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"&&t.handle?.mode==="fill"?t.handle:void 0:{mode:"fill",setFillValue:e.get("fillOperation"),direction:e.get("fillHandleDirection"),suppressClearOnFillReduction:e.get("suppressClearOnFillReduction")}}function dt(e){const t=e.get("cellSelection")??!1;return(typeof t=="object"&&t.enableColumnSelection)??!1}function Cd(e){const t=e.get("rowSelection")??"single";if(typeof t=="string"){const i=e.get("suppressRowClickSelection"),o=e.get("suppressRowDeselection");return i&&o?!1:i?"enableDeselection":o?"enableSelection":!0}return t.mode==="singleRow"||t.mode==="multiRow"?t.enableClickSelection??!1:!1}function yv(e){const t=Cd(e);return t===!0||t==="enableSelection"}function Rv(e){const t=Cd(e);return t===!0||t==="enableDeselection"}function To(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("isRowSelectable"):t?.isRowSelectable}function Ai(e){const t="beanName"in e&&e.beanName==="gos"?e.get("rowSelection"):e.rowSelection;if(typeof t=="string")switch(t){case"multiple":return"multiRow";case"single":return"singleRow";default:return}switch(t?.mode){case"multiRow":case"singleRow":return t.mode;default:return}}function oi(e){return Ai(e)==="multiRow"}function Ev(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("rowMultiSelectWithClick"):t?.enableSelectionWithoutKeys??!1}function Ii(e){const t=e.get("rowSelection");if(typeof t=="string"){const i=e.get("groupSelectsChildren"),o=e.get("groupSelectsFiltered");return i&&o?"filteredDescendants":i?"descendants":"self"}return t?.mode==="multiRow"?t.groupSelects:void 0}function vd(e,t=!0){const i=e.get("rowSelection");return typeof i!="object"?t?"all":void 0:i.mode==="multiRow"?i.selectAll:"all"}function xv(e){const t=e.get("rowSelection");return typeof t=="string"?!1:t?.mode==="multiRow"?t.ctrlASelectsRows??!1:!1}function si(e){const t=Ii(e);return t==="descendants"||t==="filteredDescendants"}function wd(e){const t=e.get("rowSelection");return typeof t=="object"&&t.masterSelects||"self"}function bd(e){return e.isModuleRegistered("SetFilter")&&!e.get("suppressSetFilterByDefault")}function ge(e){return e.get("columnMenu")==="legacy"}function Sd(e){return!ge(e)}function yd(e){return!e||e.length<2?e:"on"+e[0].toUpperCase()+e.substring(1)}function Fv(e,t,i){typeof e!="object"&&(e={});const o={...e};for(const s of i){const r=t[s];typeof r<"u"&&(o[s]=r)}return o}function Pv(e,t){if(!e)return;const i={};let o=!1;for(const n of Object.keys(e))i[n]=e[n],o=!0;if(!o)return;const s={type:"gridOptionsChanged",options:i};t.dispatchEvent(s);const r={type:"componentStateChanged",...i};t.dispatchEvent(r)}function O(e,t){return e.addCommon(t)}function Dv(e,t){return e[t]??e.gridOptions?.[t]??cr(t)??rd[t]}function Rd({gos:e},t){return t.button===2||t.ctrlKey&&e.get("allowContextMenuWithControlKey")}function Cr(e,t,i,o,s){const r=ko(e,t,i),n=new At(r,t,i,o,"user");return n.buildToken=s,e.context.createBean(n),n}function ko(e,t,i,o){const{gos:s,dataTypeSvc:r}=e,n={},a=s.get("defaultColDef");he(n,a,!1,!0);const l=r?.updateColDefAndGetColumnType(n,t,i),d=t.type??l??n.type;n.type=d,d&&Mv(e,Bo(d),n);const c=n.cellDataType;he(n,t,!1,!0),c!==void 0&&(n.cellDataType=c);const u=s.get("autoGroupColumnDef");return u&&t.rowGroup&&Ze(s)&&he(n,{sort:u.sort,initialSort:u.initialSort},!1,!0),r?.postProcess(n),r?.validateColDef(n,t,a,i),s.validateColDef(n,i,o),n}function Mv(e,t,i){const o=t.length;if(o===0)return;const s=e.gos.get("columnTypes");if(s==null){Ed(e,i,t,o,id);return}const r={...id},n=Object.keys(s);for(let a=0,l=n.length;a<l;++a){const d=n[a],c=s[d];d in r?e.log.warn(34,{key:d}):(c.type&&e.log.warn(35),r[d]=c)}Ed(e,i,t,o,r)}function Ed(e,t,i,o,s){for(let r=0;r<o;++r){const n=i[r].trim(),a=s[n];a?he(t,a,!1,!0):e.log.warn(36,{t:n})}}import{_areEqual as Av,_symmetricDiff as Iv}from"ag-stack";import{_indexMap as Tv}from"ag-stack";import{AgBeanStub as kv}from"ag-stack";var y=class extends kv{warn(...e){this.beans.log.warn(...e)}error(...e){this.beans.log.error(...e)}deprecated(...e){this.beans.log.deprecated(...e)}};function Ti(e){return e instanceof ki}var ki=class extends y{constructor(e,t,i,o){super(),this.colGroupDef=e,this.groupId=t,this.padding=i,this.level=o,this.isColumn=!1,this.expandable=!1,this.expanded=!1,this.buildToken=0,this.displayInstances=null,this.lastVisible=!1,this.instanceId=zd(),this.expanded=!!e?.openByDefault}getInstanceId(){return this.instanceId}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){const e=this.children;for(let t=0,i=e.length;t<i;++t)if(e[t].isVisible())return!0;return!1}isPadding(){return this.padding}setExpanded(e){return e=!!e,this.expanded===e?!1:(this.expanded=e,this.dispatchLocalEvent({type:"expandedChanged"}),!0)}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.groupId}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}addLeafColumns(e){const t=this.children;for(let i=0,o=t.length;i<o;++i){const s=t[i];s.isColumn?e.push(s):s.addLeafColumns(e)}}getColumnGroupShow(){return this.colGroupDef?.columnGroupShow}setExpandable(){if(this.padding)return!0;const e=Md(this.children,0),t=e===Dd;this.expandable!==t&&(this.expandable=t,this.dispatchLocalEvent({type:"expandableChanged"}));const i=e!==0;return this.lastVisible===i?!1:(this.lastVisible=i,!0)}},xd=1,Fd=2,Pd=4,Dd=7,Md=(e,t)=>{for(let i=0,o=e.length;i<o;++i){const s=e[i];if(Ti(s)&&s.padding)t=Md(s.children,t);else if(s.isVisible()){const r=s.getColumnGroupShow();r==="open"?t|=xd|Pd:r==="closed"?t|=Fd|Pd:t|=xd|Fd}if(t===Dd)return t}return t};function Ad(e,t){let i=0,o=0;const s=e.length;let r=s,n=-1,a=s,l=-1;for(let g=0;g<s;++g){const p=e[g].colDef.lockPosition;p==="right"?(++o,a===s&&(a=g),l=g):(p==="left"||p===!0)&&(++i,r===s&&(r=g),n=g)}if(i===0&&o===0)return e;let d,c,u;if(t.get("enableRtl")){if(l===o-1&&r===s-i)return e;u=0,c=o,d=s-i}else{if(n===i-1&&a===s-o)return e;d=0,c=i,u=s-o}const h=new Array(s);for(let g=0;g<s;++g){const p=e[g],f=p.colDef.lockPosition;let m;f==="right"?m=u++:f==="left"||f===!0?m=d++:m=c++,h[m]=p}return h}function Id(e,t){const i=Tv(e);let o=0,s=0,r=0;const n=l=>{for(let d=0,c=l.length;d<c;++d){const u=l[d];if(Ti(u)){n(u.children);continue}const h=i.get(u)??-1;r===0?(o=h,s=h):h<o?o=h:h>s&&(s=h),++r}},a=l=>{for(let d=0,c=l.length;d<c;++d){const u=l[d];if(Ti(u)&&(u.colGroupDef?.marryChildren&&(r=0,n(u.children),r>1&&s-o>r-1)||!a(u.children)))return!1}return!0};return a(t)}function Td(e,t){if(!e||e.length==0)return;const i=t(e[0]);for(let o=1;o<e.length;o++)if(i!==t(e[o]))return;return i}function kd(e,t,i){if(!t.length)return;const o=t.length===1?t[0]:null,s=Td(t,r=>r.getPinned());e.dispatchEvent({type:"columnPinned",pinned:s??null,columns:t,column:o,source:i})}function vr(e,t,i){if(!t.length)return;const o=t.length===1?t[0]:null,s=Td(t,r=>r.isVisible());e.dispatchEvent({type:"columnVisible",visible:s,columns:t,column:o,source:i})}function Lo(e,t,i,o){e.dispatchEvent({type:t,columns:i,column:i?.length==1?i[0]:null,source:o})}function ri(e,t,i,o,s=null){t?.length&&e.dispatchEvent({type:"columnResized",columns:t,column:t.length===1?t[0]:null,flexColumns:s,finished:i,source:o})}var Ld=(e,t,i,o,s,r,n,a)=>{const{sortSvc:l,pinnedCols:d,colFlex:c}=e;i!==void 0&&t.setVisible(!i,a),l&&(l.updateColSort(t,o,a),s!==void 0&&l.setColSortIndex(t,s)),r!==void 0&&d?.setColPinned(t,r),n!==void 0&&c?.setColFlex(t,n)};function Li(e,t,i=!1,o,s=!1){const r=e.colModel,n=i===!0;let a=null;for(let l=0,d=t.length;l<d;++l){const c=t[l],u=typeof c=="string"?r.getCol(c):c;u===void 0||s&&u.colDef.lockVisible||u.visible!==n&&(u.setVisible(n,o),a??(a=[]),a.push(u))}if(a){const{colAnimation:l,eventSvc:d}=e;l?.start();try{r.refreshColsDerivedState(),e.visibleCols.refresh(o,!1),d.dispatchEvent({type:"columnEverythingChanged",source:o}),vr(d,a,o)}finally{l?.finish()}}}function Qe(e,t,i){const{colModel:o,colAnimation:s,calculatedColsSvc:r}=e,n=t.state;if(n&&!Array.isArray(n))return e.log.warn(32),!1;n&&r?.restoreDynamicColumnDefs(n)&&r.refreshDynamicColumns(i);const a=o.colDefList,l=e.selectionColSvc?.column;if(!a.length&&!l)return!1;s?.start();try{const d=br(e);let c=wr(e,n??null,a,t,i,!0);if(c!==null||t.defaultState){const u=e.pivotResultCols?.pivotCols;c=wr(e,c,u,t,i,!1)}return Bd(e,t,i,d),c===null}finally{s?.finish()}}function wr(e,t,i,o,s,r){const n=e.colModel,a=o.defaultState;let l=null,d=null,c=null;const u=a?new Set:null;if(t)for(let h=0,g=t.length;h<g;++h){const p=t[h],f=p.colId;let m;if(f!=null){if(f.startsWith(kt)){l??(l=[]),l.push(p);continue}if(f.startsWith(Vo)){d??(d=[]),d.push(p);continue}if(r)m=n.getNonPivotColById(f);else{const C=n.getCol(f);m=C?.colDef.pivotKeys==null?null:C}}m?(Ho(e,m,p,a,s),u?.add(m)):(c??(c=[]),c.push(p))}if(u!==null&&i)for(let h=0,g=i.length;h<g;++h){const p=i[h];u.has(p)||Ho(e,p,null,a,s)}return r&&Lv(e,l,d,a,s),c}function Lv(e,t,i,o,s){const{autoColSvc:r,selectionColSvc:n,rowGroupColsSvc:a,pivotColsSvc:l,valueColsSvc:d}=e;a?.sortByPendingState(),l?.sortByPendingState(),d?.sortByPendingState(),e.colModel.refreshCols(!1,s);const c=n?.column;Hd(e,t,r?.columns??[],o,s),Hd(e,i,c?[c]:[],o,s)}function Hd(e,t,i,o,s){let r=null;if(t!==null){r=new Set;for(let n=0,a=t.length;n<a;++n){const l=t[n],d=l.colId;for(let c=0,u=i.length;c<u;++c){const h=i[c];if(h.colId===d){r.add(h),Ho(e,h,l,o,s);break}}}}if(o)for(let n=0,a=i.length;n<a;++n){const l=i[n];r?.has(l)||Ho(e,l,null,o,s)}}function Ho(e,t,i,o,s){const r=Ye(i?.flex,o?.flex),n=Ye(i?.sort,o?.sort),a=Ye(i?.sortType,o?.sortType),d=ut(n)||yr(a)?{type:_e(a),direction:Tt(n)}:void 0;Ld(e,t,Ye(i?.hide,o?.hide),d,Ye(i?.sortIndex,o?.sortIndex),Ye(i?.pinned,o?.pinned),r,s);const c=Ye(i?.headerName,o?.headerName);if(c!==void 0&&t.setHeaderNameOverride(c),r==null){const h=Ye(i?.width,o?.width);if(h!=null){const g=t.colDef.minWidth??e.environment.getDefaultColumnMinWidth();g!=null&&h>=g&&t.setActualWidth(h,s)}}if(t.colKind==="auto-group"||!t.primary)return;e.valueColsSvc?.syncColState(t,i,o,s),e.rowGroupColsSvc?.syncColState(t,i,o,s),e.pivotColsSvc?.syncColState(t,i,o,s),e.showValuesAsSvc?.syncColState(t,i,o,s);const u=Ye(i?.pivotSort,o?.pivotSort);u!==void 0&&(t.pivotSort=Tt(u))}function Vd(e,t){const{colModel:i,autoColSvc:o,selectionColSvc:s,eventSvc:r,gos:n,colAnimation:a,calculatedColsSvc:l}=e,d=e.userColumnSvc?.clear()??!1;if(l?(l.resetDynamicColumnDefs(!0)||d)&&l.refreshDynamicColumns(t):d&&i.rebuildCols(t),!i.colDefList.length)return;const c=s?.column??null,u=o?.columns,h=u?.length??0,g=new Array(h+(c?1:0)+i.colDefList.length);let p=0,f=-1,m=-1;const C=v=>{const b=_d(e,v),{rowGroupIndex:w,pivotIndex:S}=b;w!=null&&w>f&&(f=w),S!=null&&S>m&&(m=S),g[p++]=b};if(u)for(let v=0;v<h;++v)C(u[v]);c&&C(c),Sr(i.colDefTree,C);for(let v=0,b=g.length;v<b;++v){const w=g[v];w.rowGroup&&w.rowGroupIndex==null&&(w.rowGroupIndex=++f),w.pivot&&w.pivotIndex==null&&(w.pivotIndex=++m)}a?.start();try{const v=br(e);wr(e,g,i.colDefList,{},t,!0);const b=i.colDefList;for(let A=0,N=b.length;A<N;++A){const W=b[A];W.pivotSort=Rr(W.colDef)}const w=o?.columns,S=w?.length??0,R=new Array((c?1:0)+S+i.colDefList.length);let x=0;c&&(R[x++]={colId:c.colId});for(let A=0;A<S;++A)R[x++]={colId:w[A].colId};Sr(i.colDefTree,A=>{R[x++]={colId:A.colId}});const M=i.groupHeaderNameOverrides;M.size&&(M.clear(),r.dispatchEvent({type:"columnHeaderNameChanged",column:null,columns:null,columnGroup:null,source:t})),Bd(e,{state:R,applyOrder:!0},t,v)}finally{a?.finish()}r.dispatchEvent(O(n,{type:"columnsReset",source:t}))}function Bd(e,t,i,o){Hv(e,t),e.visibleCols.refresh(i,!1),e.eventSvc.dispatchEvent({type:"columnEverythingChanged",source:i}),Od(e,i,o)}function Hv(e,t){const i=e.colModel,o=t.state;if(!t.applyOrder||!o||!i.ready)return;const s=i.colsById,r=i.colsList,n=new Set,a=[];for(let c=0,u=o.length;c<u;++c){const h=o[c].colId;if(h==null)continue;const g=s[h];g!=null&&g.inColsList&&!n.has(g)&&(a.push(g),n.add(g))}let l=null;for(let c=0,u=r.length;c<u;++c){const h=r[c];n.has(h)||(h.colKind==="auto-group"?(l??(l=[]),l.push(h)):a.push(h))}l!==null&&Vv(a,l);const d=Ad(a,e.gos);if(!Av(d,r)){if(i.hasMarryChildren&&!Id(d,i.colsTree)){e.log.warn(39);return}i.colsList=d,i.markColsListIndexDirty()}}function Vv(e,t){let i=0;for(let s=0,r=e.length;s<r;++s)e[s].colKind==="auto-group"&&(i=s+1);const o=t.length;for(let s=e.length-1;s>=i;--s)e[s+o]=e[s];for(let s=0;s<o;++s)e[i+s]=t[s]}function br(e){const{rowGroupColsSvc:t,pivotColsSvc:i,colModel:o}=e,s=t?.columns,r=i?.columns,n=o.getColsInStateOrder(),a=new Map;for(let l=0,d=n.length;l<d;++l){const c=n[l],u=c.sortDef,h=u.direction;a.set(c.colId,{width:c.actualWidth,hide:!c.visible,pinned:c.pinned,sort:h,sortType:h?u.type:void 0,sortIndex:c.sortIndex??null,aggFunc:c.aggregationActive?c.aggFunc:null,pivotSort:c.pivotSort})}return{rowGroupColumns:s?.length?s.slice():void 0,pivotColumns:r?.length?r.slice():void 0,before:a,colsList:o.colsList}}function Od(e,t,i){const o=e.rowGroupColsSvc?.columns,s=e.pivotColsSvc?.columns;Gd(e,t,"columnRowGroupChanged",i.rowGroupColumns,o),Gd(e,t,"columnPivotChanged",i.pivotColumns,s),Bv(e,t,i.before),Ov(e,t,i)}function Gd(e,t,i,o,s){_v(o,s)||Lo(e.eventSvc,i,Iv(o,s),t)}function Bv(e,t,i){const{eventSvc:o,sortSvc:s}=e,r=e.colModel.getAllCols();let n=null,a=null,l=null,d=null,c=null,u=null;for(let h=0,g=r.length;h<g;++h){const p=r[h],f=i.get(p.colId);f&&(f.width!=p.actualWidth&&(a??(a=[]),a.push(p)),f.pinned!=p.pinned&&(l??(l=[]),l.push(p)),f.hide==p.visible&&(d??(d=[]),d.push(p)),Gv(p,f)&&(n??(n=[]),n.push(p)),s&&Nv(p,f)&&(c??(c=[]),c.push(p)),f.pivotSort!==p.pivotSort&&(u??(u=[]),u.push(p)))}n&&Lo(o,"columnValueChanged",n,t),a&&ri(o,a,!0,t),l&&kd(o,l,t),d&&vr(o,d,t),c&&s?.dispatchSortChangedEvents(t,c),u&&Lo(o,"columnPivotChanged",u,t)}function Ov(e,t,i){const o=e.colModel,s=o.colsList;if(s===i.colsList)return;const r=i.before,n=o.colsById;let a;for(const u of r.keys()){const h=n[u];h?.inColsList&&(a??(a=[]),a.push(h))}if(!a)return;let l=0,d;const c=a.length;for(let u=0,h=s.length;u<h&&l<c;++u){const g=s[u];if(r.has(g.colId)){const p=a[l++];p!==g&&(d??(d=[]),d.push(p))}}d&&e.eventSvc.dispatchEvent({type:"columnMoved",columns:d,column:d.length===1?d[0]:null,finished:!0,source:t})}var Nd=e=>{const t=e.colModel;if(!t.isAlive())return[];const i=t.getColsInStateOrder(),o=Er(e),s=new Array(i.length);for(let r=0,n=i.length;r<n;++r){const a=i[r],l=a.rowGroupActive,d=a.pivotActive,c=a.sortDef,u=c.direction;s[r]={colId:a.colId,width:a.actualWidth,hide:!a.visible,pinned:a.pinned,sort:u,sortType:u?c.type??null:null,sortIndex:a.sortIndex??null,aggFunc:a.aggregationActive?a.aggFunc:null,valueIndex:a.aggregationActive?a.aggregationActiveIndex:null,rowGroup:l,rowGroupIndex:l?a.rowGroupActiveIndex:null,pivot:d,pivotIndex:d?a.pivotActiveIndex:null,pivotSort:a.pivotSort===void 0?o:a.pivotSort,flex:a.flex??null,showValuesAs:e.showValuesAsSvc?.toColState(a)??null,headerName:a.headerNameOverride}}return s};function _d(e,t){const i=t.colDef,o=Ce(i.sort??i.initialSort??null),s=i.rowGroupIndex??i.initialRowGroupIndex??null;let r=i.rowGroup??i.initialRowGroup??null;s==null&&r===!1&&(r=null);const n=i.pivotIndex??i.initialPivotIndex??null;let a=i.pivot??i.initialPivot??null;return n==null&&a===!1&&(a=null),{colId:t.colId,sort:o.direction,sortType:o.type,sortIndex:i.sortIndex??i.initialSortIndex??null,hide:i.hide??i.initialHide??null,pinned:i.pinned??i.initialPinned??null,width:i.width??i.initialWidth??null,flex:i.flex??i.initialFlex??null,rowGroup:r,rowGroupIndex:s,pivot:a,pivotIndex:n,pivotSort:Rr(i),aggFunc:i.aggFunc??i.initialAggFunc??null,showValuesAs:e.showValuesAsSvc?.colDefSelection(i)??null,headerName:null}}var Ye=(e,t)=>e!==void 0?e:t,Sr=(e,t)=>{for(let i=0,o=e.length;i<o;++i){const s=e[i],r=s.children;r?Sr(r,t):t(s)}},Gv=(e,t)=>{const i=t.aggFunc,o=i!=null;return o!==e.aggregationActive||o&&i!=e.aggFunc},Nv=(e,t)=>{if(t.sortIndex!=e.sortIndex)return!0;const i=e.getSortDef(),o=t.sortType??"default";return i?i.direction!==t.sort||i.type!==o:t.sort!==null},_v=(e,t)=>{if(e===t)return!0;const i=e?.length??0;if(i!==(t?.length??0))return!1;for(let o=0;o<i;++o){const s=e[o],r=t[o];if(s!==r&&s.colId!==r.colId)return!1}return!0},zv=0;function zd(){return zv++}var Wv=e=>e instanceof At,ct=(e,t)=>{if(!t.group&&!t.rowPinned){const i=e.pivotValueColumn;if(i)return i}return e},Uv=["asc","desc",null],qv=[{type:"absolute",direction:"asc"},{type:"absolute",direction:"desc"},null],At=class extends y{constructor(e,t,i,o,s){super(),this.colDef=e,this.userProvidedColDef=t,this.colId=i,this.primary=o,this.colKind=s,this.isColumn=!0,this.instanceId=zd(),this.aggFunc=void 0,this.isCalculatedCol=!1,this.field=void 0,this.fieldPath=null,this.valueGetter=void 0,this.allowFormula=!1,this.showRowGroup=void 0,this.pivotValueColumn=void 0,this.valueFormatter=void 0,this.refData=void 0,this.enableCellChangeFlash=void 0,this.colSpan=void 0,this.rowSpan=void 0,this.calculatedExpression=void 0,this.actualWidth=0,this.minWidth=0,this.maxWidth=0,this.flex=null,this.pinned=null,this.left=null,this.oldLeft=null,this.visible=!1,this.displayed=!1,this.filterActive=!1,this.sortDef=Ce(),this.sortIndex=void 0,this.pivotSort=void 0,this.autoHeaderHeight=null,this.tooltipEnabled=!1,this.tooltipFieldContainsDots=!1,this.frameworkEventListenerService=void 0,this.colEventSvc=null,this.buildToken=0,this.allColsIndex=-1,this.inColsList=!1,this.ariaColIndex=0,this.colsListIndex=-1,this.moving=!1,this.resizing=!1,this.menuVisible=!1,this.highlighted=null,this.formulaRef=null,this.showValuesAsDef=void 0,this.showValuesAs=null,this.anchoredToColId=void 0,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.rowGroupActive=!1,this.rowGroupActiveIndex=-1,this.pivotActive=!1,this.pivotActiveIndex=-1,this.aggregationActive=!1,this.aggregationActiveIndex=-1,this.showRowGroupCol=null,this.parent=null,this.originalParent=null,this.cachedSortTypes=null,this.headerNameOverride=null,this.colIdSanitised=uv(i)}destroy(){super.destroy(),this.allColsIndex=-1,this.displayed=!1,this.colsListIndex=-1,this.inColsList=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.beans.rowSpanSvc?.deregister(this)}getInstanceId(){return this.instanceId}initState(){const{beans:e,colDef:t}=this,{sortSvc:i,pinnedCols:o,colFlex:s}=e;i?.initCol(this);const r=t.hide;this.visible=r!==void 0?!r:!t.initialHide,this.pivotSort=Rr(t),o?.initCol(this),s?.initCol(this)}setColDef(e,t,i){const o=this.colDef;return this.userProvidedColDef=t,this.colDef=e,ti(e,o)?(this.initCalculatedColumnState(e),!1):(++this.beans.colModel.colDefsVersion,this.cachedSortTypes=null,this.initColDefHotFields(),this.beans.showValuesAsSvc?.resolveColumn(this,!1),this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),e.spanRows!==o.spanRows&&this.beans.rowSpanSvc?.columnRowSpanChanged(this),this.dispatchColEvent("colDefChanged",i),this.beans.pivotResultCols?.recreateColDefsForSource(this,i),!0)}reapplyColDef(e,t,i){const o=ko(this.beans,e,this.colId);if(this.setColDef(o,e,t),i){Ld(this.beans,this,o.hide,o.sort,o.sortIndex,o.pinned,o.flex,t);const s=o.pivotSort;s!==void 0&&(this.pivotSort=Tt(s));const r=this.flex;(r==null||r<=0)&&this.setActualWidth(o.width??this.actualWidth,t)}}getUserProvidedColDef(){return this.userProvidedColDef}getParent(){return this.parent}getOriginalParent(){return this.originalParent}postConstruct(){this.initColDefHotFields(),this.beans.showValuesAsSvc?.resolveColumn(this,!0),this.initState(),this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip()}initDotNotation(){const{field:e,tooltipField:t}=this.colDef;this.field=e,this.gos.get("suppressFieldDotNotation")?(this.fieldPath=null,this.tooltipFieldContainsDots=!1):(this.fieldPath=typeof e=="string"&&e.includes(".")?e.split("."):null,this.tooltipFieldContainsDots=typeof t=="string"&&t.includes("."))}initMinAndMaxWidths(){const e=this.colDef;this.minWidth=e.minWidth??this.beans.environment.getDefaultColumnMinWidth(),this.maxWidth=e.maxWidth??Number.MAX_SAFE_INTEGER}initTooltip(){this.beans.tooltipSvc?.initCol(this)}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){const t=e.width??e.initialWidth??200;return xt(t,this.minWidth,this.maxWidth)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){return this.beans.showRowGroupCols?.isRowGroupDisplayed(this,e)??!1}isPrimary(){return this.primary}isFilterAllowed(){return!!this.colDef.filter}isFieldContainsDots(){return this.fieldPath!==null}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}getHighlighted(){return this.highlighted}getColEventSvc(){let e=this.colEventSvc;return e||(e=new cv,this.colEventSvc=e),e}__addEventListener(e,t){this.getColEventSvc().addEventListener(e,t)}__removeEventListener(e,t){this.colEventSvc?.removeEventListener(e,t)}addEventListener(e,t){const i=this.getColEventSvc();this.frameworkEventListenerService=this.beans.frameworkOverrides.createLocalEventListenerWrapper?.(this.frameworkEventListenerService,i);const o=this.frameworkEventListenerService?.wrap(e,t)??t;i.addEventListener(e,o)}removeEventListener(e,t){const i=this.frameworkEventListenerService?.unwrap(e,t)??t;this.colEventSvc?.removeEventListener(e,i)}createColumnFunctionCallbackParams(e){return O(this.gos,{node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){return this.beans.cellNavigation?.isSuppressNavigable(this,e)??!1}isCellEditable(e){return this.beans.editSvc?.isCellEditable({rowNode:e,column:this})??!1}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(e){return this.isColumnFunc(e,this.colDef.rowDrag)}isDndSource(e){return this.isColumnFunc(e,this.colDef.dndSource)}isCellCheckboxSelection(e){return this.beans.selectionSvc?.isCellCheckboxSelection(this,e)??!1}isSuppressPaste(e){return this.isCalculatedCol||this.isColumnFunc(e,this.colDef.suppressPaste??null)}initColDefHotFields(){const e=this.colDef;this.valueGetter=e.valueGetter,this.allowFormula=e.allowFormula===!0,this.showRowGroup=e.showRowGroup,this.pivotValueColumn=e.pivotValueColumn,this.valueFormatter=e.valueFormatter,this.refData=e.refData,this.enableCellChangeFlash=e.enableCellChangeFlash,this.colSpan=e.colSpan,this.rowSpan=e.rowSpan,this.initCalculatedColumnState(e)}initCalculatedColumnState(e){this.calculatedExpression=e.calculatedExpression,this.isCalculatedCol=this.calculatedExpression!==void 0&&this.beans.calculatedColsSvc?.isEnabled()===!0}isResizable(){return this.colDef.resizable??!0}isColumnFunc(e,t){return typeof t=="boolean"?t:typeof t=="function"&&t(this.createColumnFunctionCallbackParams(e))}isMoving(){return this.moving}getSort(){return this.sortDef.direction}getSortDef(){const e=this.sortDef;return e.direction?e:null}setSortDef(e){this.sortDef=e}isSortable(){return this.colDef.sortable??!0}isSortAscending(){return this.getSort()==="asc"}isSortDescending(){return this.getSort()==="desc"}isSortNone(){return!this.getSort()}isSorting(){return this.getSort()!=null}getSortIndex(){return this.sortIndex}isMenuVisible(){return this.menuVisible}getAggFunc(){return this.aggFunc}getShowValuesAs(){return this.showValuesAs}getShowValuesAsDef(){return this.showValuesAsDef??null}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(e,t){const i=this.left;this.oldLeft=i,i!==e&&(this.left=e,this.dispatchColEvent("leftChanged",t))}isFilterActive(){return this.filterActive}isHovered(){return this.warn(261),!!this.beans.colHover?.isHovered(this)}setFirstRightPinned(e,t){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.dispatchColEvent("firstRightPinnedChanged",t))}setLastLeftPinned(e,t){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.dispatchColEvent("lastLeftPinnedChanged",t))}isFirstRightPinned(){return this.firstRightPinned}isLastLeftPinned(){return this.lastLeftPinned}isPinned(){return this.pinned==="left"||this.pinned==="right"}isPinnedLeft(){return this.pinned==="left"}isPinnedRight(){return this.pinned==="right"}getPinned(){return this.pinned}setVisible(e,t){const i=e===!0;if(this.visible!==i){this.visible=i;let o=this.originalParent;for(;o&&o.setExpandable();)o=o.originalParent;this.dispatchColEvent("visibleChanged",t)}this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){return!this.colDef.suppressSpanHeaderHeight}getFirstRealParent(){let e=this.originalParent;for(;e?.padding;)e=e.originalParent;return e}getColumnGroupPaddingInfo(){let e=this.parent;if(!e?.providedColumnGroup.padding)return{numberOfParents:0,isSpanningTotal:!1};const t=e.getPaddingLevel()+1;let i=!0;for(;e;){if(!e.providedColumnGroup.padding){i=!1;break}e=e.parent}return{numberOfParents:t,isSpanningTotal:i}}getColDef(){return this.colDef}getDefinition(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getDisplayName(e="columnDrop"){return this.beans.colNames.getDisplayNameForColumn(this,e)||this.colDef.headerName||this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){return this.autoHeaderHeight!==e?(this.autoHeaderHeight=e,!0):!1}getColSpan(e){const t=this.colSpan;if(t==null)return 1;const i=this.createColumnFunctionCallbackParams(e),o=t(i);return o<1?1:o}getRowSpan(e){const t=this.rowSpan;if(t==null)return 1;const i=this.createColumnFunctionCallbackParams(e),o=t(i);return o<1?1:o}setActualWidth(e,t,i=!1){e=Math.max(e,this.minWidth),e=Math.min(e,this.maxWidth),this.actualWidth!==e&&(this.actualWidth=e,this.flex!=null&&t!=="flex"&&t!=="gridInitializing"&&(this.flex=null),i||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.dispatchColEvent("widthChanged",e)}isGreaterThanMax(e){return e>this.maxWidth}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex}isRowGroupActive(){return this.rowGroupActive}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.pivotActive||this.rowGroupActive||this.aggregationActive}isAnyFunctionAllowed(){const e=this.colDef;return e.enablePivot===!0||e.enableRowGroup===!0||e.enableValue===!0}isValueActive(){return this.aggregationActive}isAllowPivot(){return this.colDef.enablePivot===!0}isAllowValue(){return this.colDef.enableValue===!0}isAllowRowGroup(){return this.colDef.enableRowGroup===!0}isAllowFormula(){return this.allowFormula}setHeaderNameOverride(e,t="api"){this.headerNameOverride!==e&&(this.headerNameOverride=e,this.dispatchColEvent("headerNameChanged",t),this.beans.eventSvc.dispatchEvent({type:"columnHeaderNameChanged",column:this,columns:null,columnGroup:null,source:t}))}dispatchColEvent(e,t,i){this.colEventSvc?.dispatchEvent(O(this.gos,{type:e,column:this,columns:[this],source:t,...i}))}dispatchStateUpdatedEvent(e){this.colEventSvc?.dispatchEvent({type:"columnStateUpdated",key:e})}},Ce=e=>It(e)?{direction:e.direction,type:e.type}:{direction:Tt(e),type:_e(e)},Wd=e=>{const t=[],{sort:i,initialSort:o}=e.colDef;return i!==null&&t.push(_e(i?.type)),o!==null&&t.push(_e(o?.type)),t},Ud=(e,t,i)=>t.colDef.sortingOrder??e.get("sortingOrder")??(i.includes("absolute")?qv:Uv),$v=(e,t)=>{const i=Ud(e,t,Wd(t)),o=new Array(i.length);for(let s=0,r=i.length;s<r;++s)o[s]=Ce(i[s]);return o},Kv=(e,t)=>{const i=e.get("sortingOrder")==null,o=t.cachedSortTypes;if(i&&o)return o;const s=Wd(t),r=new Set(s),n=Ud(e,t,s);for(let a=0,l=n.length;a<l;++a){const d=n[a];if(!It(d)){Tt(d)&&r.add(_e(d));continue}d.direction&&r.add(d.type)}return i&&(t.cachedSortTypes=r),r},ut=e=>e==="asc"||e==="desc"||e===null,yr=e=>e==="default"||e==="absolute",It=e=>{if(!e||typeof e!="object")return!1;const t=e;return yr(t.type)&&ut(t.direction)},Rr=e=>{const t=e.pivotSort!==void 0?e.pivotSort:e.initialPivotSort;return t===void 0?void 0:Tt(t)},Er=e=>e.pivotResultCols?.suppliedColDefs!=null?null:"asc",jv=(e,t)=>t===void 0?Er(e):t,Tt=e=>ut(e)?e:null,_e=e=>yr(e)?e:"default",qd=(e,t,i)=>{const o=i?.(),s=o!==void 0?o:t.sortSvc?.getDisplaySort(e),r=_e(s?.type),n=Tt(s?.direction);return{isAbsoluteSort:r==="absolute",isDefaultSort:r==="default",isAscending:n==="asc",isDescending:n==="desc",direction:n}},kt="ag-Grid-AutoColumn",Vo="ag-Grid-SelectionColumn",$d="ag-Grid-RowNumbersColumn",Zv="ag-Grid-HierarchyColumn";function ht(e){let t=0;for(let i=0,o=e.length;i<o;++i)t+=e[i].actualWidth;return t}function xr(e){return e.colKind==="auto-group"}function Hi(e){return e.colKind==="selection"}function ye(e){return e.colKind==="row-number"}function Kd(e){const t=e.colKind;return t==="selection"||t==="row-number"}function Bo(e){return Array.isArray(e)?e:typeof e=="string"?e.split(","):[]}function Lt(e){return e==="optionsUpdated"?"gridOptionsChanged":e}function jd(e,t,i){const o=Zd(t),s=e.showValuesAsSvc?.colDefSelection(t)??void 0;return o?{...t,colId:i,sort:o.direction,sortType:o.type,showValuesAs:s}:{...t,colId:i,sort:void 0,showValuesAs:s}}function Zd(e){const{sort:t,initialSort:i}=e,o=It(t)||ut(t),s=It(i)||ut(i);return o?Ce(t):s?Ce(i):null}var Qd=(e,t)=>{if(e)for(let i=0,o=e.length;i<o;++i){const s=e[i];s.isAlive()&&s.destroy()}if(t)for(let i=0,o=t.length;i<o;++i){const s=t[i];s.isAlive()&&s.destroy()}},Yd=(e,t,i)=>{for(let o=0,s=e.length;o<s;++o){const r=e[o];r.buildToken!==i&&r.isAlive()&&r.destroy()}for(let o=0,s=t.length;o<s;++o){const r=t[o];r.buildToken!==i&&r.isAlive()&&r.destroy()}};function Fr(e,t){for(let i=0,o=e.length;i<o;++i){const s=e[i];"children"in s?Fr(s.children,t):t(s)}}import{_escapeString as Qv}from"ag-stack";var Re=e=>e instanceof ni,ni=class extends y{constructor(e,t,i,o){super(),this.providedColumnGroup=e,this.groupId=t,this.partId=i,this.pinned=o,this.isColumn=!1,this.children=null,this.displayedChildren=[],this.autoHeaderHeight=null,this.left=null,this.oldLeft=null,this.parent=null,this.buildToken=0,this.uniqueId=`${t}_${i}`,this.colIdSanitised=Qv(this.uniqueId)}getParent(){return this.parent}getUniqueId(){return this.uniqueId}isEmptyGroup(){return!this.displayedChildren?.length}isMoving(){return Jd(this.providedColumnGroup)===!0}checkLeft(){const e=this.displayedChildren;let t=null;if(e)for(let i=0,o=e.length;i<o;++i){const s=e[i];Re(s)&&s.checkLeft();const r=s.left;r!=null&&(t==null||r<t)&&(t=r)}this.setLeft(t)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(e){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.dispatchLocalEvent({type:"leftChanged"}))}getPinned(){return this.pinned}getGroupId(){return this.groupId}getDisplayName(e="columnDrop"){return this.beans.colNames.getDisplayNameForColumnGroup(this,e)||this.getColGroupDef()?.headerName||this.getGroupId()}getPartId(){return this.partId}getActualWidth(){let e=0;const t=this.displayedChildren;if(t)for(let i=0,o=t.length;i<o;++i)e+=t[i].getActualWidth();return e}isResizable(){const e=this.displayedChildren;if(e){for(let t=0,i=e.length;t<i;++t)if(e[t].isResizable())return!0}return!1}getMinWidth(){const e=this.displayedChildren;if(!e)return 0;let t=0;for(let i=0,o=e.length;i<o;++i){const s=e[i];t+=s.getMinWidth()}return t}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}getDisplayedLeafColumns(){const e=[];return this.addDisplayedLeafColumns(e),e}get ariaColIndex(){return Ht(this,!1,!1)?.ariaColIndex??0}getDefinition(){return this.providedColumnGroup.colGroupDef}getColGroupDef(){return this.providedColumnGroup.colGroupDef}isPadding(){return this.providedColumnGroup.padding}isExpandable(){return this.providedColumnGroup.expandable}isExpanded(){return!!this.providedColumnGroup.expanded}isAutoHeaderHeight(){return!!this.providedColumnGroup.colGroupDef?.autoHeaderHeight}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){return e===this.autoHeaderHeight?!1:(this.autoHeaderHeight=e,!0)}addDisplayedLeafColumns(e){const t=this.displayedChildren;if(t)for(let i=0,o=t.length;i<o;++i){const s=t[i];s.isColumn?e.push(s):Re(s)&&s.addDisplayedLeafColumns(e)}}addLeafColumns(e){const t=this.children;if(t)for(let i=0,o=t.length;i<o;++i){const s=t[i];s.isColumn?e.push(s):Re(s)&&s.addLeafColumns(e)}}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){let e=0,t=this;for(;t?.providedColumnGroup.padding&&t.parent?.providedColumnGroup.padding;)++e,t=t.parent;return e}},Ht=(e,t,i)=>{const o=t?e.displayedChildren:e.children;if(o)for(let s=0,r=o.length;s<r;++s){const n=o[i?r-1-s:s];if(n.isColumn)return n;const a=Ht(n,t,i);if(a)return a}return null},Jd=e=>{let t=!1;const i=e.children;for(let o=0,s=i.length;o<s;++o){const r=i[o];if(r.isColumn){if(t=!0,!r.moving)return!1;continue}const n=Jd(r);if(n===!1)return!1;n===!0&&(t=!0)}return t||null},Xd=(e,t)=>{let i=e.parent;if(i){let o=i.getPaddingLevel();for(;i&&i.providedColumnGroup.level+o>t;)i=i.parent,o=o>0?o-1:0}return i},Oo="ROOT_NODE_ID",Go="rowGroupFooter_",Pr="detail_",ec=Go+Oo;import{AgPromise as Yv,KeyCode as Jv}from"ag-stack";import{BaseDragAndDropService as Xv}from"ag-stack";function tc(e){return typeof e=="object"&&!!e.component}import{AgPromise as ew}from"ag-stack";function tw(e){return e?e.prototype&&"getGui"in e.prototype:!1}function ic(e,t,i,o){const{name:s}=i;let r,n,a,l,d,c;if(t){const u=t,h=u[s+"Selector"],g=h?h(o):null,p=f=>{typeof f=="string"?r=f:f!=null&&f!==!0&&(e.isFrameworkComponent(f)?a=f:n=f)};g?(p(g.component),l=g.params,d=g.popup,c=g.popupPosition):p(u[s])}return{compName:r,jsComp:n,fwComp:a,paramsFromSelector:l,popupFromSelector:d,popupPositionFromSelector:c}}var iw=class extends y{constructor(){super(...arguments),this.beanName="userCompFactory"}wireBeans(e){this.agCompUtils=e.agCompUtils,this.registry=e.registry,this.frameworkCompWrapper=e.frameworkCompWrapper,this.frameworkCompWrapper?.setGridId?.(e.context.getId()),this.gridOptions=e.gridOptions}getCompDetailsFromGridOptions(e,t,i,o=!1){return this.getCompDetails(this.gridOptions,e,t,i,o)}getCompDetails(e,t,i,o,s=!1){const{name:r,cellRenderer:n}=t;let{compName:a,jsComp:l,fwComp:d,paramsFromSelector:c,popupFromSelector:u,popupPositionFromSelector:h}=ic(this.beans.frameworkOverrides,e,t,o),g,p;const f=b=>{const w=this.registry.getUserComponent(r,b);w&&(l=w.componentFromFramework?void 0:w.component,d=w.componentFromFramework?w.component:void 0,g=w.params,p=w.processParams)};if(a!=null&&f(a),l==null&&d==null&&i!=null&&f(i),l&&n&&!tw(l)&&(l=this.agCompUtils?.adaptFunction(t,l)),!l&&!d){const{validation:b}=this.beans;s&&(a!==i||!i)?a?b?.isProvidedUserComp(a)||this.error(50,{compName:a}):i?b||this.error(260,{...this.gos.getModuleErrorParams(),propName:r,compName:i}):this.error(216,{name:r}):i&&!b&&this.error(146,{comp:i});return}const m=this.mergeParams(e,t,o,c,g,p),C=l==null,v=l??d;return{componentFromFramework:C,componentClass:v,params:m,type:t,popupFromSelector:u,popupPositionFromSelector:h,newAgStackInstance:()=>this.newAgStackInstance(v,C,m,t)}}newAgStackInstance(e,t,i,o){const s=!t;let r;s?r=new e:r=this.frameworkCompWrapper.wrap(e,o.mandatoryMethods,o.optionalMethods,o),this.createBean(r);const n=r.init?.(i);return n==null?ew.resolve(r):n.then(()=>r)}mergeParams(e,t,i,o=null,s,r){const n={...i,...s},l=e?.[t.name+"Params"];if(typeof l=="function"){const d=l(i);he(n,d)}else typeof l=="object"&&he(n,l);return he(n,o),r?r(n,this.beans):n}},ow={name:"dateComponent",mandatoryMethods:["getDate","setDate"],optionalMethods:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","refresh"]},sw={name:"dragAndDropImageComponent",mandatoryMethods:["setIcon","setLabel"],requiresBlockWrapper:!0},rw={name:"headerComponent",optionalMethods:["refresh"]},nw={name:"innerHeaderComponent"},aw={name:"innerHeaderGroupComponent"},lw={name:"headerGroupComponent"},dw={name:"innerRenderer",cellRenderer:!0,optionalMethods:["afterGuiAttached"]},cw={name:"cellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},uw={name:"cellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},hw={name:"loadingCellRenderer",cellRenderer:!0},gw={name:"cellEditor",mandatoryMethods:["getValue"],optionalMethods:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},pw={name:"tooltipComponent",requiresBlockWrapper:!0},Dr={name:"filter",mandatoryMethods:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethods:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},fw={name:"floatingFilterComponent",mandatoryMethods:["onParentModelChanged"],optionalMethods:["afterGuiAttached","refresh"]},mw={name:"fullWidthCellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},Cw={name:"loadingCellRenderer",cellRenderer:!0},vw={name:"groupRowRenderer",optionalMethods:["afterGuiAttached"],cellRenderer:!0},ww={name:"detailCellRenderer",optionalMethods:["refresh"],cellRenderer:!0};function bw(e,t){return e.getCompDetailsFromGridOptions(sw,"agDragAndDropImage",t,!0)}function Sw(e,t,i){return e.getCompDetails(t,dw,void 0,i)}function yw(e,t,i){return e.getCompDetails(t,rw,"agColumnHeader",i)}function Rw(e,t,i){return e.getCompDetails(t,nw,void 0,i)}function Ew(e,t){const i=t.columnGroup.getColGroupDef();return e.getCompDetails(i,lw,"agColumnGroupHeader",t)}function xw(e,t,i){return e.getCompDetails(t,aw,void 0,i)}function Fw(e,t){return e.getCompDetailsFromGridOptions(mw,void 0,t,!0)}function Pw(e,t){return e.getCompDetailsFromGridOptions(Cw,"agLoadingCellRenderer",t,!0)}function Dw(e,t){return e.getCompDetailsFromGridOptions(vw,"agGroupRowRenderer",t,!0)}function Mw(e,t){return e.getCompDetailsFromGridOptions(ww,"agDetailCellRenderer",t,!0)}function Mr(e,t,i){return e.getCompDetails(t,cw,void 0,i)}function Aw(e,t,i){return e.getCompDetails(t,uw,void 0,i)}function oc(e,t,i){return e.getCompDetails(t,hw,"agSkeletonCellRenderer",i,!0)}function sc(e,t,i){return e.getCompDetails(t,gw,"agCellEditor",i,!0)}function rc(e,t,i,o){const s=t.filter;return tc(s)&&(t={filter:s.component,filterParams:t.filterParams}),e.getCompDetails(t,Dr,o,i,!0)}function Iw(e,t,i){return e.getCompDetails(t,ow,"agDateInput",i,!0)}function Tw(e,t){return e.getCompDetails(t.colDef,pw,"agTooltipComponent",t,!0)}function nc(e,t,i,o){return e.getCompDetails(t,fw,o,i)}function ac(e,t){return ic(e,t,Dr)}function Ar(e,t,i){return e.mergeParams(t,Dr,i)}var lc=(e=>(e[e.