ag-grid-community
Version:
Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue
7 lines • 994 kB
JavaScript
var _e=class{constructor(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,i){const s=t?this.allAsyncListeners:this.allSyncListeners;let o=s.get(e);return!o&&i&&(o=new Set,s.set(e,o)),o}noRegisteredListenersExist(){return this.allSyncListeners.size===0&&this.allAsyncListeners.size===0&&this.globalSyncListeners.size===0&&this.globalAsyncListeners.size===0}addEventListener(e,t,i=!1){this.getListeners(e,i,!0).add(t)}removeEventListener(e,t,i=!1){const s=this.getListeners(e,i,!1);s&&(s.delete(t),s.size===0&&(i?this.allAsyncListeners:this.allSyncListeners).delete(e))}addGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).add(e)}removeGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).delete(e)}dispatchEvent(e){const t=e;this.dispatchToListeners(t,!0),this.dispatchToListeners(t,!1),this.firedEvents[t.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){const i=e.type;if(t&&"event"in e){const a=e.event;a instanceof Event&&(e.eventPath=a.composedPath())}const s=(a,l)=>a.forEach(d=>{if(!l.has(d))return;const c=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>d(e)):()=>d(e);t?this.dispatchAsync(c):c()}),o=this.getListeners(i,t,!1)??new Set,n=new Set(o);n.size>0&&s(n,o),new Set(t?this.globalAsyncListeners:this.globalSyncListeners).forEach(a=>{const l=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>a(i,e)):()=>a(i,e);t?this.dispatchAsync(l):l()})}dispatchAsync(e){if(this.asyncFunctionsQueue.push(e),!this.scheduled){const t=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)};this.frameworkOverrides?this.frameworkOverrides.wrapIncoming(t):t(),this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[],e.forEach(t=>t())}};function Eu(e,t){return t}function _s(e){return e?.getLocaleTextFunc()??Eu}function ce(e,t,i){i==null||typeof i=="string"&&i==""?Us(e,t):ue(e,t,i)}function ue(e,t,i){e.setAttribute(qn(t),i.toString())}function Us(e,t){e.removeAttribute(qn(t))}function qn(e){return`aria-${e}`}function Ee(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function Du(e){let t;return e==="asc"?t="ascending":e==="desc"?t="descending":e==="mixed"?t="other":t="none",t}function Pu(e){return parseInt(e.getAttribute("aria-posinset"),10)}function Mu(e){return e.getAttribute("aria-label")}function $t(e,t){ce(e,"label",t)}function Hi(e,t){ce(e,"labelledby",t)}function Au(e,t){ce(e,"describedby",t)}function Yn(e,t){ce(e,"live",t)}function Tu(e,t){ce(e,"atomic",t)}function ku(e,t){ce(e,"relevant",t)}function Iu(e,t){ce(e,"level",t)}function Qn(e,t){ce(e,"disabled",t)}function $s(e,t){ce(e,"hidden",t)}function Lu(e,t){ce(e,"activedescendant",t)}function Bi(e,t){ue(e,"expanded",t)}function Ou(e){Us(e,"expanded")}function Zn(e,t){ue(e,"setsize",t)}function Xn(e,t){ue(e,"posinset",t)}function Gu(e,t){ue(e,"multiselectable",t)}function Jn(e,t){ue(e,"rowcount",t)}function Vi(e,t){ue(e,"rowindex",t)}function Hu(e,t){ue(e,"rowspan",t)}function er(e,t){ue(e,"colcount",t)}function Ks(e,t){ue(e,"colindex",t)}function tr(e,t){ue(e,"colspan",t)}function ir(e,t){ue(e,"sort",t)}function sr(e){Us(e,"sort")}function Ni(e,t){ce(e,"selected",t)}function Bu(e,t){ue(e,"checked",t===void 0?"mixed":t)}function or(e,t){ce(e,"controls",t.id),Hi(t,e.id)}function Vu(e,t){ce(e,"haspopup",t===!1?null:t)}function js(e,t){return t===void 0?e("ariaIndeterminate","indeterminate"):t===!0?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}var qs,Ys,Qs,Zs,Xs,Js,eo,to;function Ge(){return qs===void 0&&(qs=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),qs}function nr(){if(Ys===void 0){const e=window;Ys=!!e.chrome&&(!!e.chrome.webstore||!!e.chrome.runtime)||/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}return Ys}function io(){return Qs===void 0&&(Qs=/(firefox)/i.test(navigator.userAgent)),Qs}function rr(){return Zs===void 0&&(Zs=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),Zs}function Ue(){return Xs===void 0&&(Xs=/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1),Xs}function so(e){if(!e)return null;const t=e.tabIndex,i=e.getAttribute("tabIndex");return t===-1&&(i===null||i===""&&!io())?null:t.toString()}function Nu(){if(to!==void 0)return to;if(!document.body)return-1;let e=1e6;const t=io()?6e6:1e9,i=document.createElement("div");for(document.body.appendChild(i);;){const s=e*2;if(i.style.height=s+"px",s>t||i.clientHeight!==s)break;e=s}return document.body.removeChild(i),to=e,e}function zu(){return eo==null&&ar(),eo}function ar(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let i=t.offsetWidth-t.clientWidth;i===0&&t.clientWidth===0&&(i=null),t.parentNode&&t.parentNode.removeChild(t),i!=null&&(eo=i,Js=i===0)}function lr(){return Js==null&&ar(),Js}var zi;function Wu(e,t,i){const s=e.parentElement;let o=s&&s.firstChild;for(;o;)t&&o.classList.toggle(t,o===e),i&&o.classList.toggle(i,o!==e),o=o.nextSibling}var _u="[tabindex], input, select, button, textarea, [href]",dr="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function oo(e){const t=Element.prototype.matches||Element.prototype.msMatchesSelector,s=t.call(e,"input, select, button, textarea"),o=t.call(e,dr),n=ve(e);return s&&!o&&n}function N(e,t,i={}){const{skipAriaHidden:s}=i;e.classList.toggle("ag-hidden",!t),s||$s(e,!t)}function cr(e,t,i={}){const{skipAriaHidden:s}=i;e.classList.toggle("ag-invisible",!t),s||$s(e,!t)}function Mt(e,t){const i="disabled",s=t?n=>n.setAttribute(i,""):n=>n.removeAttribute(i);s(e);const o=e.querySelectorAll("input")??[];for(const n of o)s(n)}function it(e,t,i){let s=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,typeof i=="number"){if(++s>i)break}else if(e===i)break}return!1}function st(e){const{height:t,width:i,borderTopWidth:s,borderRightWidth:o,borderBottomWidth:n,borderLeftWidth:r,paddingTop:a,paddingRight:l,paddingBottom:d,paddingLeft:c,marginTop:u,marginRight:h,marginBottom:g,marginLeft:p,boxSizing:f}=window.getComputedStyle(e);return{height:parseFloat(t||"0"),width:parseFloat(i||"0"),borderTopWidth:parseFloat(s||"0"),borderRightWidth:parseFloat(o||"0"),borderBottomWidth:parseFloat(n||"0"),borderLeftWidth:parseFloat(r||"0"),paddingTop:parseFloat(a||"0"),paddingRight:parseFloat(l||"0"),paddingBottom:parseFloat(d||"0"),paddingLeft:parseFloat(c||"0"),marginTop:parseFloat(u||"0"),marginRight:parseFloat(h||"0"),marginBottom:parseFloat(g||"0"),marginLeft:parseFloat(p||"0"),boxSizing:f}}function Wi(e){const t=st(e);return t.boxSizing==="border-box"?t.height-t.paddingTop-t.paddingBottom:t.height}function At(e){const t=st(e);return t.boxSizing==="border-box"?t.width-t.paddingLeft-t.paddingRight:t.width}function no(e){const{height:t,marginBottom:i,marginTop:s}=st(e);return Math.floor(t+i+s)}function Kt(e){const{width:t,marginLeft:i,marginRight:s}=st(e);return Math.floor(t+i+s)}function ur(e){const t=e.getBoundingClientRect(),{borderTopWidth:i,borderLeftWidth:s,borderRightWidth:o,borderBottomWidth:n}=st(e);return{top:t.top+(i||0),left:t.left+(s||0),right:t.right+(o||0),bottom:t.bottom+(n||0)}}function _i(){if(typeof zi=="boolean")return zi;const e=document.createElement("div");return e.style.direction="rtl",e.style.width="1px",e.style.height="1px",e.style.position="fixed",e.style.top="0px",e.style.overflow="hidden",e.dir="rtl",e.innerHTML=`<div style="width: 2px">
<span style="display: inline-block; width: 1px"></span>
<span style="display: inline-block; width: 1px"></span>
</div>`,document.body.appendChild(e),e.scrollLeft=1,zi=Math.floor(e.scrollLeft)===0,document.body.removeChild(e),zi}function Ui(e,t){let i=e.scrollLeft;return t&&(i=Math.abs(i),nr()&&!_i()&&(i=e.scrollWidth-e.getBoundingClientRect().width-i)),i}function $i(e,t,i){i&&(_i()?t*=-1:(Ge()||nr())&&(t=e.scrollWidth-e.getBoundingClientRect().width-t)),e.scrollLeft=t}function X(e){for(;e&&e.firstChild;)e.removeChild(e.firstChild)}function he(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function hr(e){return!!e.offsetParent}function ve(e){const t=e;return t.checkVisibility?t.checkVisibility({checkVisibilityCSS:!0}):!(!hr(e)||window.getComputedStyle(e).visibility!=="visible")}function jt(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function gr(e,t,i){i&&i.nextSibling===t||(e.firstChild?i?i.nextSibling?e.insertBefore(t,i.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.insertAdjacentElement("afterbegin",t):e.appendChild(t))}function pr(e,t){for(let i=0;i<t.length;i++){const s=t[i],o=e.children[i];o!==s&&e.insertBefore(s,o)}}function Uu(e){return e.replace(/[A-Z]/g,t=>`-${t.toLocaleLowerCase()}`)}function qt(e,t){if(t)for(const i of Object.keys(t)){const s=t[i];if(!i||!i.length||s==null)continue;const o=Uu(i),n=s.toString(),r=n.replace(/\s*!important/g,""),a=r.length!=n.length?"important":void 0;e.style.setProperty(o,r,a)}}function $u(e){return e.clientWidth<e.scrollWidth}function Ku(e){return e.clientHeight<e.scrollHeight}function Ki(e,t){t==="flex"?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):Se(e,t)}function Se(e,t){t=ro(t),e.style.width=t,e.style.maxWidth=t,e.style.minWidth=t}function Yt(e,t){t=ro(t),e.style.height=t,e.style.maxHeight=t,e.style.minHeight=t}function ro(e){return typeof e=="number"?`${e}px`:e}function ji(e){return e instanceof Node||e instanceof HTMLElement}function we(e,t,i){i==null||i===""?e.removeAttribute(t):e.setAttribute(t,i.toString())}function He(e,t,i){const o=Tr(e).ResizeObserver,n=o?new o(i):null;return n?.observe(t),()=>n?.disconnect()}function ju(e){const t=dt(e),i="getSelection"in t?t.getSelection():null,s=[];for(let o=0;o<(i?.rangeCount??0);o++){const n=i?.getRangeAt(o);n&&s.push(n)}return{selection:i,ranges:s}}function qu(e,t){if(!e.gos.get("enableCellTextSelection")||!io()&&!Ge())return t();const{selection:s,ranges:o}=ju(e);t(),s?.removeAllRanges();for(const n of o)s?.addRange(n)}function De(e,t){const i=Tr(e);i.requestAnimationFrame?i.requestAnimationFrame(t):i.webkitRequestAnimationFrame?i.webkitRequestAnimationFrame(t):i.setTimeout(t,0)}var fr="data-ref",ao;function mr(){return ao??(ao=document.createTextNode(" ")),ao.cloneNode()}function _(e){const{attrs:t,children:i,cls:s,ref:o,role:n,tag:r}=e,a=document.createElement(r);if(s&&(a.className=s),o&&a.setAttribute(fr,o),n&&a.setAttribute("role",n),t)for(const l of Object.keys(t))a.setAttribute(l,t[l]);if(i)if(typeof i=="string")a.textContent=i;else{let l=!0;for(const d of i)d&&(typeof d=="string"?(a.appendChild(document.createTextNode(d)),l=!1):(l&&(a.appendChild(mr()),l=!1),a.append(_(d)),a.appendChild(mr())))}return a}function Pe(e){return e==null||e===""?null:e}function x(e){return e!=null&&e!==""}function B(e){return!x(e)}function qi(e){return e!=null&&typeof e.toString=="function"?e.toString():null}function Tt(e,t){const i=e?JSON.stringify(e):null,s=t?JSON.stringify(t):null;return i===s}function Cr(e,t,i=!1){const s=e==null,o=t==null;if(e&&e.toNumber&&(e=e.toNumber()),t&&t.toNumber&&(t=t.toNumber()),s&&o)return 0;if(s)return-1;if(o)return 1;function n(r,a){return r>a?1:r<a?-1:0}if(typeof e!="string"||!i)return n(e,t);try{return e.localeCompare(t)}catch{return n(e,t)}}var vr="https://www.ag-grid.com",wr={};function lo(e,t){wr[t]||(e(),wr[t]=!0)}function $e(e,t,...i){e.get("debug")&&console.log("AG Grid: "+t,...i)}function ot(e,...t){lo(()=>console.warn("AG Grid: "+e,...t),e+t?.join(""))}function kt(e,...t){lo(()=>console.error("AG Grid: "+e,...t),e+t?.join(""))}var Yu={pending:!1,funcs:[]},Qu={pending:!1,funcs:[]};function Yi(e,t="setTimeout",i){const s=t==="raf"?Qu:Yu;if(s.funcs.push(e),s.pending)return;s.pending=!0;const o=()=>{const n=s.funcs.slice();s.funcs.length=0,s.pending=!1,n.forEach(r=>r())};t==="raf"?De(i,o):window.setTimeout(o,0)}function Q(e,t,i){let s;return function(...o){const n=this;window.clearTimeout(s),s=window.setTimeout(function(){e.isAlive()&&t.apply(n,o)},i)}}function br(e,t){let i=0;return function(...s){const o=this,n=Date.now();n-i<t||(i=n,e.apply(o,s))}}function Sr(e,t,i=100,s){const o=Date.now();let n=null,r=!1;const a=()=>{const l=Date.now()-o>i;(e()||l)&&(t(),r=!0,n!=null&&(window.clearInterval(n),n=null),l&&s&&ot(s))};a(),r||(n=window.setInterval(a,10))}var D="33.2.1",yr=2e3,Rr=100,xr="_version_",Fr=null,Zu=!1,nt=`${vr}/javascript-data-grid`;function Xu(e){Fr=e}function Ju(e){nt=e}function Er(e,t,i){return Fr?.getConsoleMessage(e,t)??[sh(e,t,i)]}function co(e,t,i,s){Zu||e(`error #${t}`,...Er(t,i,s))}function eh(e){if(!e)return String(e);const t={};for(const i of Object.keys(e))typeof e[i]!="object"&&typeof e[i]!="function"&&(t[i]=e[i]);return JSON.stringify(t)}function th(e){let t=e;return e instanceof Error?t=e.toString():typeof e=="object"&&(t=eh(e)),t}function Qi(e){return e===void 0?"undefined":e===null?"null":e}function uo(e,t){return`${e}?${t.toString()}`}function ih(e,t,i){const s=Array.from(t.entries()).sort((n,r)=>r[1].length-n[1].length);let o=uo(e,t);for(const[n,r]of s){if(n===xr)continue;const a=o.length-i;if(a<=0)break;const l="...",d=a+l.length,c=r.length-d>Rr?r.slice(0,r.length-d)+l:r.slice(0,Rr)+l;t.set(n,c),o=uo(e,t)}return o}function Dr(e,t){const i=new URLSearchParams;if(i.append(xr,D),t)for(const n of Object.keys(t))i.append(n,th(t[n]));const s=`${nt}/errors/${e}`,o=uo(s,i);return o.length<=yr?o:ih(s,i,yr)}var sh=(e,t,i)=>{const s=Dr(e,t);return`${i?i+`
`:""}Visit ${s}${i?"":`
Alternatively register the ValidationModule to see the full message in the console.`}`};function R(...e){co(ot,e[0],e[1])}function O(...e){co(kt,e[0],e[1])}function ho(e,t,i){co(kt,e,t,i)}function Pr(e,t){const i=t[0];return`error #${i} `+Er(i,t[1],e).join(" ")}function Be(...e){return Pr(void 0,e)}function oh(...e){return Pr(`
`,e)}function Mr(e,t){return e.get("rowModelType")===t}function J(e,t){return Mr(e,"clientSide")}function rt(e,t){return Mr(e,"serverSide")}function Z(e,t){return e.get("domLayout")===t}function Ke(e){return Xt(e)!==void 0}function go(e){return typeof e.get("getRowHeight")=="function"}function nh(e,t){return t?!e.get("enableStrictPivotColumnOrder"):e.get("maintainColumnOrder")}function at(e,t,i=!1,s){const{gos:o,environment:n}=e;if(s==null&&(s=n.getDefaultRowHeight()),go(o)){if(i)return{height:s,estimated:!0};const l={node:t,data:t.data},d=o.getCallback("getRowHeight")(l);if(po(d))return d===0&&R(23),{height:Math.max(1,d),estimated:!1}}if(t.detail&&o.get("masterDetail"))return rh(o);const r=o.get("rowHeight");return{height:r&&po(r)?r:s,estimated:!1}}function rh(e){if(e.get("detailRowAutoHeight"))return{height:1,estimated:!1};const t=e.get("detailRowHeight");return po(t)?{height:t,estimated:!1}:{height:300,estimated:!1}}function je(e){const{environment:t,gos:i}=e,s=i.get("rowHeight");if(!s||B(s))return t.getDefaultRowHeight();const o=t.refreshRowHeightVariable();return o!==-1?o:(R(24),t.getDefaultRowHeight())}function po(e){return!isNaN(e)&&typeof e=="number"&&isFinite(e)}function Ar(e,t,i){const s=t[e.getDomDataKey()];return s?s[i]:void 0}function lt(e,t,i,s){const o=e.getDomDataKey();let n=t[o];B(n)&&(n={},t[o]=n),n[i]=s}function $(e){const{gos:t,eGridDiv:i}=e;let s=null;const o=t.get("getDocument");return o&&x(o)?s=o():i&&(s=i.ownerDocument),s&&x(s)?s:document}function Tr(e){return $(e).defaultView||window}function dt(e){return e.eGridDiv.getRootNode()}function z(e){return dt(e).activeElement}function Zi(e){let t=null,i=null;try{t=$(e).fullscreenElement}catch{}finally{t||(t=dt(e));const s=t.querySelector("body");s?i=s:t instanceof ShadowRoot?i=t:t instanceof Document?i=t?.documentElement:i=t}return i}function ah(e){return Zi(e)?.clientWidth??(window.innerHeight||-1)}function lh(e){return Zi(e)?.clientHeight??(window.innerHeight||-1)}function kr(e,t,i){const o=e.getBoundingClientRect().height,n=ah(i)-2,r=lh(i)-2;if(!e.offsetParent)return;const l=ur(e.offsetParent),{clientY:d,clientX:c}=t;let u=d-l.top-o/2,h=c-l.left-10;const g=$(i),p=g.defaultView||window,f=p.pageYOffset||g.documentElement.scrollTop,m=p.pageXOffset||g.documentElement.scrollLeft;n>0&&h+e.clientWidth>n+m&&(h=n+m-e.clientWidth),h<0&&(h=0),r>0&&u+e.clientHeight>r+f&&(u=r+f-e.clientHeight),u<0&&(u=0),e.style.left=`${h}px`,e.style.top=`${u}px`}function fo(e){const t=$(e),i=z(e);return i===null||i===t.body}function ct(e){return e.get("ensureDomOrder")?!1:e.get("animateRows")}function mo(e){return!(e.get("paginateChildRows")||e.get("groupHideOpenParents")||Z(e,"print"))}function ye(e){return!e.get("autoGroupColumnDef")?.comparator&&!e.get("treeData")}function Xi(e){const t=e.get("groupAggFiltering");if(typeof t=="function")return e.getCallback("groupAggFiltering");if(t===!0)return()=>!0}function dh(e){return e.get("grandTotalRow")}function ch(e){const t=e.get("groupTotalRow");return typeof t=="function"?e.getCallback("groupTotalRow"):()=>t??void 0}function Ir(e){return e.get("groupHideOpenParents")?!0:e.get("groupDisplayType")==="multipleColumns"}function Ji(e,t){return t?!1:e.get("groupDisplayType")==="groupRows"}function ut(e){const t=e.getCallback("getRowId");return t===void 0?t:i=>{let s=t(i);return typeof s!="string"&&(R(25,{id:s}),s=String(s)),s}}function Lr(e,t){const i=e.get("groupHideParentOfSingleChild");return!!(i===!0||i==="leafGroupsOnly"&&t.leafGroup||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")&&t.leafGroup)}function Or(e){const t=e.get("maxConcurrentDatasourceRequests");return t>0?t:void 0}function uh(e,t){const i=e.get("suppressGroupChangesColumnVisibility");if(i===!0||t&&i==="suppressHideOnGroup"||!t&&i==="suppressShowOnUngroup")return!1;const s=e.get("suppressRowGroupHidesColumns");if(t&&s===!0)return!1;const o=e.get("suppressMakeColumnVisibleAfterUnGroup");return!(!t&&o===!0)}function ht(e){return e?.checkboxes??!0}function Qt(e){return e?.mode==="multiRow"&&(e.headerCheckbox??!0)}function Zt(e){if(typeof e=="object")return e.checkboxLocation??"selectionColumn"}function Co(e){return e?.hideDisabledCheckboxes??!1}function Gr(e){return typeof e.get("rowSelection")!="string"}function hh(e){return e.get("cellSelection")!==void 0}function gh(e){const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"?t?.suppressMultiRanges??!1:!1:e.get("suppressMultiRangeSelection")}function Me(e){const t=e.get("cellSelection");return t!==void 0?!!t:e.get("enableRangeSelection")}function ph(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 Hr(e){const t=e.get("rowSelection")??"single";if(typeof t=="string"){const i=e.get("suppressRowClickSelection"),s=e.get("suppressRowDeselection");return i&&s?!1:i?"enableDeselection":s?"enableSelection":!0}return t.mode==="singleRow"||t.mode==="multiRow"?t.enableClickSelection??!1:!1}function fh(e){const t=Hr(e);return t===!0||t==="enableSelection"}function mh(e){const t=Hr(e);return t===!0||t==="enableDeselection"}function es(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("isRowSelectable"):t?.isRowSelectable}function Xt(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 It(e){return Xt(e)==="multiRow"}function Ch(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("rowMultiSelectWithClick"):t?.enableSelectionWithoutKeys??!1}function Jt(e){const t=e.get("rowSelection");if(typeof t=="string"){const i=e.get("groupSelectsChildren"),s=e.get("groupSelectsFiltered");return i&&s?"filteredDescendants":i?"descendants":"self"}return t?.mode==="multiRow"?t.groupSelects:void 0}function Br(e,t=!0){const i=e.get("rowSelection");return typeof i!="object"?t?"all":void 0:i.mode==="multiRow"?i.selectAll:"all"}function Lt(e){const t=Jt(e);return t==="descendants"||t==="filteredDescendants"}function Vr(e){const t=e.get("rowSelection");return typeof t=="object"&&t.masterSelects||"self"}function vo(e){return e.isModuleRegistered("SetFilter")&&!e.get("suppressSetFilterByDefault")}function ae(e){return e.get("columnMenu")==="legacy"}function Nr(e){return!ae(e)}function wo(e){return!e||e.length<2?e:"on"+e[0].toUpperCase()+e.substring(1)}function vh(e,t,i){typeof e!="object"&&(e={});const s={...e};return i.forEach(o=>{const n=t[o];typeof n<"u"&&(s[o]=n)}),s}function wh(e,t){if(!e)return;const i={};let s=!1;if(Object.keys(e).forEach(r=>{i[r]=e[r],s=!0}),!s)return;const o={type:"gridOptionsChanged",options:i};t.dispatchEvent(o);const n={type:"componentStateChanged",...i};t.dispatchEvent(n)}function T(e,t){return e.addGridCommonParams(t)}function zr(e){return e.get("treeData")?e.get("treeDataParentIdField")?"treeSelfRef":e.get("treeDataChildrenField")?"treeNested":"treePath":"group"}var Wr="__ag_Grid_Stop_Propagation",bh=["touchstart","touchend","touchmove","touchcancel","scroll"],Sh=["wheel"],bo={};function gt(e){e[Wr]=!0}function Ae(e){return e[Wr]===!0}var _r=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return i=>{if(typeof bo[i]=="boolean")return bo[i];const s=document.createElement(e[i]||"div");return i="on"+i,bo[i]=i in s}})();function Ur(e,t,i){let s=t;for(;s;){const o=Ar(e,s,i);if(o)return o;s=s.parentElement}return null}function $r(e,t){return!t||!e?!1:Rh(t).indexOf(e)>=0}function yh(e){const t=[];let i=e.target;for(;i;)t.push(i),i=i.parentElement;return t}function Rh(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():yh(t)}function xh(e,t,i,s){const o=Kr(i);let n;o!=null&&(n={passive:o}),e&&e.addEventListener&&e.addEventListener(t,i,s,n)}var Kr=e=>{const t=bh.includes(e),i=Sh.includes(e);if(t)return!0;if(i)return!1},S=class{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.propertyListenerId=0,this.lastChangeSetIdLookup={},this.isAlive=()=>!this.destroyed}preWireBeans(e){this.beans=e,this.stubContext=e.context,this.eventSvc=e.eventSvc,this.gos=e.gos}destroy(){const{destroyFunctions:e}=this;for(let t=0;t<e.length;t++)e[t]();e.length=0,this.destroyed=!0,this.dispatchLocalEvent({type:"destroyed"})}addEventListener(e,t,i){this.localEventService||(this.localEventService=new _e),this.localEventService.addEventListener(e,t,i)}removeEventListener(e,t,i){this.localEventService?.removeEventListener(e,t,i)}dispatchLocalEvent(e){this.localEventService?.dispatchEvent(e)}addManagedElementListeners(e,t){return this._setupListeners(e,t)}addManagedEventListeners(e){return this._setupListeners(this.eventSvc,e)}addManagedListeners(e,t){return this._setupListeners(e,t)}_setupListeners(e,t){const i=[];for(const s of Object.keys(t)){const o=t[s];o&&i.push(this._setupListener(e,s,o))}return i}_setupListener(e,t,i){if(this.destroyed)return()=>null;let s;return Fh(e)?(e.__addEventListener(t,i),s=()=>(e.__removeEventListener(t,i),null)):(e instanceof HTMLElement?xh(this.beans.frameworkOverrides,e,t,i):e.addEventListener(t,i),s=()=>(e.removeEventListener(t,i),null)),this.destroyFunctions.push(s),()=>(s(),this.destroyFunctions=this.destroyFunctions.filter(o=>o!==s),null)}setupGridOptionListener(e,t){const{gos:i}=this;i.addPropertyEventListener(e,t);const s=()=>(i.removePropertyEventListener(e,t),null);return this.destroyFunctions.push(s),()=>(s(),this.destroyFunctions=this.destroyFunctions.filter(o=>o!==s),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupGridOptionListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const i=e.join("-")+this.propertyListenerId++,s=o=>{if(o.changeSet){if(o.changeSet&&o.changeSet.id===this.lastChangeSetIdLookup[i])return;this.lastChangeSetIdLookup[i]=o.changeSet.id}const n={type:"gridPropertyChanged",changeSet:o.changeSet,source:o.source};t(n)};e.forEach(o=>this.setupGridOptionListener(o,s))}getLocaleTextFunc(){return _s(this.beans.localeSvc)}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createOptionalManagedBean(e,t){return e?this.createManagedBean(e,t):void 0}createManagedBean(e,t){const i=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),i}createBean(e,t,i){return(t||this.stubContext).createBean(e,i)}destroyBean(e,t){return(t||this.stubContext).destroyBean(e)}destroyBeans(e,t){return(t||this.stubContext).destroyBeans(e)}};function Fh(e){return e.__addEventListener!==void 0}var jr=new Set(["__proto__","constructor","prototype"]);function Eh(e,t){if(e!=null){if(Array.isArray(e)){for(let i=0;i<e.length;i++)t(i.toString(),e[i]);return}for(const i of Object.keys(e))t(i,e[i])}}function ee(e,t,i=!0,s=!1){x(t)&&Eh(t,(o,n)=>{if(jr.has(o))return;let r=e[o];r!==n&&(s&&r==null&&n!=null&&typeof n=="object"&&n.constructor===Object&&(r={},e[o]=r),qr(n)&&qr(r)&&!Array.isArray(r)?ee(r,n,i,s):(i||n!==void 0)&&(e[o]=n))})}function ei(e,t,i){if(!t||!e)return;if(!i)return e[t];const s=t.split(".");let o=e;for(let n=0;n<s.length;n++){if(o==null)return;o=o[s[n]]}return o}function qr(e){return typeof e=="object"&&e!==null}var Dh=/[&<>"']/g,Ph={"&":"&","<":"<",">":">",'"':""","'":"'"};function Te(e,t){if(e==null)return null;const i=e.toString().toString();return t?i:i.replace(Dh,s=>Ph[s])}var Mh={resizable:!0,sortable:!0},Ah=0;function Yr(){return Ah++}function Ve(e){return e instanceof ts}var ts=class extends S{constructor(e,t,i,s){super(),this.colDef=e,this.userProvidedColDef=t,this.colId=i,this.primary=s,this.isColumn=!0,this.instanceId=Yr(),this.autoHeaderHeight=null,this.moving=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.colEventSvc=new _e,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.flex=null,this.colIdSanitised=Te(i)}destroy(){super.destroy(),this.beans.rowSpanSvc?.deregister(this)}getInstanceId(){return this.instanceId}setState(){const{colDef:e,beans:{sortSvc:t,pinnedCols:i,colFlex:s}}=this;t?.initCol(this);const o=e.hide;o!==void 0?this.visible=!o:this.visible=!e.initialHide,i?.initCol(this),s?.initCol(this)}setColDef(e,t,i){const s=e.spanRows!==this.colDef.spanRows;this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),s&&(this.beans.rowSpanSvc?.deregister(this),this.initRowSpan()),this.dispatchColEvent("colDefChanged",i)}getUserProvidedColDef(){return this.userProvidedColDef}getParent(){return this.parent}getOriginalParent(){return this.originalParent}postConstruct(){this.setState(),this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip(),this.initRowSpan()}initDotNotation(){const{gos:e,colDef:{field:t,tooltipField:i}}=this,s=e.get("suppressFieldDotNotation");this.fieldContainsDots=x(t)&&t.indexOf(".")>=0&&!s,this.tooltipFieldContainsDots=x(i)&&i.indexOf(".")>=0&&!s}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)}initRowSpan(){this.colDef.spanRows&&this.beans.rowSpanSvc?.register(this)}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){let t;const i=e.width,s=e.initialWidth;return i!=null?t=i:s!=null?t=s:t=200,Math.max(Math.min(t,this.maxWidth),this.minWidth)}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.fieldContainsDots}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}getHighlighted(){return this.highlighted}__addEventListener(e,t){this.colEventSvc.addEventListener(e,t)}__removeEventListener(e,t){this.colEventSvc.removeEventListener(e,t)}addEventListener(e,t){this.frameworkEventListenerService=this.beans.frameworkOverrides.createLocalEventListenerWrapper?.(this.frameworkEventListenerService,this.colEventSvc);const i=this.frameworkEventListenerService?.wrap(t)??t;this.colEventSvc.addEventListener(e,i)}removeEventListener(e,t){const i=this.frameworkEventListenerService?.unwrap(t)??t;this.colEventSvc.removeEventListener(e,i)}createColumnFunctionCallbackParams(e){return T(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(this,e)??!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.isColumnFunc(e,this.colDef?.suppressPaste??null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(e){return this.colDef[e]??Mh[e]}isColumnFunc(e,t){if(typeof t=="boolean")return t;if(typeof t=="function"){const i=this.createColumnFunctionCallbackParams(e);return t(i)}return!1}createColumnEvent(e,t){return T(this.gos,{type:e,column:this,columns:[this],source:t})}isMoving(){return this.moving}getSort(){return this.sort}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return this.sort==="asc"}isSortDescending(){return this.sort==="desc"}isSortNone(){return B(this.sort)}isSorting(){return x(this.sort)}getSortIndex(){return this.sortIndex}isMenuVisible(){return this.menuVisible}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(e,t){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.dispatchColEvent("leftChanged",t))}isFilterActive(){return this.filterActive}isHovered(){return R(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;this.visible!==i&&(this.visible=i,this.dispatchColEvent("visibleChanged",t)),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){return!this.getColDef().suppressSpanHeaderHeight}getColumnGroupPaddingInfo(){let e=this.getParent();if(!e||!e.isPadding())return{numberOfParents:0,isSpanningTotal:!1};const t=e.getPaddingLevel()+1;let i=!0;for(;e;){if(!e.isPadding()){i=!1;break}e=e.getParent()}return{numberOfParents:t,isSpanningTotal:i}}getColDef(){return this.colDef}getDefinition(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}createBaseColDefParams(e){return T(this.gos,{node:e,data:e.data,colDef:this.colDef,column:this})}getColSpan(e){if(B(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.colSpan(t);return Math.max(i,1)}getRowSpan(e){if(B(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.rowSpan(t);return Math.max(i,1)}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.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}isValueActive(){return this.aggregationActive}isAllowPivot(){return this.colDef.enablePivot===!0}isAllowValue(){return this.colDef.enableValue===!0}isAllowRowGroup(){return this.colDef.enableRowGroup===!0}dispatchColEvent(e,t,i){const s=this.createColumnEvent(e,t);i&&ee(s,i),this.colEventSvc.dispatchEvent(s)}dispatchStateUpdatedEvent(e){this.colEventSvc.dispatchEvent({type:"columnStateUpdated",key:e})}};function te(e){return e instanceof ti}var ti=class extends S{constructor(e,t,i,s){super(),this.colGroupDef=e,this.groupId=t,this.padding=i,this.level=s,this.isColumn=!1,this.expandable=!1,this.instanceId=Yr(),this.expandableListenerRemoveCallback=null,this.expanded=!!e?.openByDefault}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0),super.destroy()}reset(e,t){this.colGroupDef=e,this.level=t,this.originalParent=null,this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback(),this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){return this.children?this.children.some(e=>e.isVisible()):!1}isPadding(){return this.padding}setExpanded(e){this.expanded=e===void 0?!1:e,this.dispatchLocalEvent({type:"expandedChanged"})}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(e){this.children=e}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}addLeafColumns(e){this.children&&this.children.forEach(t=>{Ve(t)?e.push(t):te(t)&&t.addLeafColumns(e)})}getColumnGroupShow(){const e=this.colGroupDef;if(e)return e.columnGroupShow}setupExpandable(){this.setExpandable(),this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback();const e=this.onColumnVisibilityChanged.bind(this);this.getLeafColumns().forEach(t=>t.__addEventListener("visibleChanged",e)),this.expandableListenerRemoveCallback=()=>{this.getLeafColumns().forEach(t=>t.__removeEventListener("visibleChanged",e)),this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let e=!1,t=!1,i=!1;const s=this.findChildrenRemovingPadding();for(let n=0,r=s.length;n<r;n++){const a=s[n];if(!a.isVisible())continue;const l=a.getColumnGroupShow();l==="open"?(e=!0,i=!0):l==="closed"?(t=!0,i=!0):(e=!0,t=!0)}const o=e&&t&&i;this.expandable!==o&&(this.expandable=o,this.dispatchLocalEvent({type:"expandableChanged"}))}findChildrenRemovingPadding(){const e=[],t=i=>{i.forEach(s=>{te(s)&&s.isPadding()?t(s.children):e.push(s)})};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}},Th={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}},Qr=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=qi(e);let i=0;for(;;){let s=e??t;if(s?i!==0&&(s+="_"+i):s=i,!this.existingKeys[s])return this.existingKeys[s]=!0,String(s);i++}}},So=Object.freeze([]);function G(e){if(e?.length)return e[e.length-1]}function qe(e,t,i){return e==null&&t==null?!0:e!=null&&t!=null&&e.length===t.length&&e.every((s,o)=>i?i(s,t[o]):t[o]===s)}function is(e,t){if(e)for(const i of e)t(i)}function ge(e,t){const i=e.indexOf(t);i>=0&&e.splice(i,1)}function Zr(e,t,i){for(let s=0;s<t.length;s++)ge(e,t[s]);for(let s=t.length-1;s>=0;s--)e.splice(i,0,t[s])}function kh(e){return[].concat.apply([],e)}var ii="ag-Grid-AutoColumn",yo="ag-Grid-SelectionColumn",Xr="ag-Grid-RowNumbersColumn";function Ro(e){const t=[],i=s=>{for(let o=0;o<s.length;o++){const n=s[o];Ve(n)?t.push(n):te(n)&&i(n.getChildren())}};return i(e),t}function Ne(e){return e.reduce((t,i)=>t+i.getActualWidth(),0)}function si(e,t,i){const s={};if(!t)return;ze(null,t,n=>{s[n.getInstanceId()]=n}),i&&ze(null,i,n=>{s[n.getInstanceId()]=null});const o=Object.values(s).filter(n=>n!=null);e.context.destroyBeans(o)}function ss(e){return e.getId().startsWith(ii)}function ke(e){return(typeof e=="string"?e:"getColId"in e?e.getColId():e.colId)?.startsWith(yo)??!1}function pt(e){return(typeof e=="string"?e:"getColId"in e?e.getColId():e.colId)?.startsWith(Xr)??!1}function os(e){let t=[];return e instanceof Array?t=e:typeof e=="string"&&(t=e.split(",")),t}function Jr(e,t){return qe(e,t,(i,s)=>i.getColId()===s.getColId())}function ea(e){e.map={},e.list.forEach(t=>e.map[t.getId()]=t)}function ft(e){return e==="gridOptionsUpdated"?"gridOptionsChanged":e}function xo(e,t){const i=e===t,s=e.getColDef()===t,o=e.getColId()==t;return i||s||o}var Ih=(e,t)=>(i,s)=>{const o={value1:void 0,value2:void 0};let n=!1;return e&&(e[i]!==void 0&&(o.value1=e[i],n=!0),x(s)&&e[s]!==void 0&&(o.value2=e[s],n=!0)),!n&&t&&(t[i]!==void 0&&(o.value1=t[i]),x(s)&&t[s]!==void 0&&(o.value2=t[s])),o};function ta(e,t=null,i,s,o){const n=new Qr,{existingCols:r,existingGroups:a,existingColKeys:l}=Lh(s);n.addExistingKeys(l);const d=ia(e,t,0,i,r,n,a,o),{colGroupSvc:c}=e,u=c?.findMaxDepth(d,0)??0,h=c?c.balanceColumnTree(d,0,u,n):d;return ze(null,h,(p,f)=>{te(p)&&p.setupExpandable(),p.originalParent=f}),{columnTree:h,treeDept:u}}function Lh(e){const t=[],i=[],s=[];return e&&ze(null,e,o=>{if(te(o)){const n=o;i.push(n)}else{const n=o;s.push(n.getId()),t.push(n)}}),{existingCols:t,existingGroups:i,existingColKeys:s}}function ia(e,t,i,s,o,n,r,a){if(!t)return[];const{colGroupSvc:l}=e,d=new Array(t.length);for(let c=0;c<d.length;c++){const u=t[c];l&&Vh(u)?d[c]=l.createProvidedColumnGroup(s,u,i,o,n,r,a):d[c]=Oh(e,s,u,o,n,a)}return d}function Oh(e,t,i,s,o,n){const r=Gh(i,s);r&&s?.splice(r.idx,1);let a=r?.column;if(a){const l=ns(e,i,a.getColId());a.setColDef(l,i,n),oa(e,a,l,n)}else{const l=o.getUniqueKey(i.colId,i.field),d=ns(e,i,l);a=new ts(d,i,l,t),e.context.createBean(a)}return e.dataTypeSvc?.addColumnListeners(a),a}function sa(e,t,i,s,o,n,r,a){const{sortSvc:l,pinnedCols:d,colFlex:c}=e;i!==void 0&&t.setVisible(!i,a),l&&(l.updateColSort(t,s,a),o!==void 0&&l.setColSortIndex(t,o)),n!==void 0&&d?.setColPinned(t,n),r!==void 0&&c?.setColFlex(t,r)}function oa(e,t,i,s){sa(e,t,i.hide,i.sort,i.sortIndex,i.pinned,i.flex,s);const o=t.getFlex();if(!(o!=null&&o>0))if(i.width!=null)t.setActualWidth(i.width,s);else{const n=t.getActualWidth();t.setActualWidth(n,s)}}function Gh(e,t){if(t)for(let i=0;i<t.length;i++){const s=t[i].getUserProvidedColDef();if(!s)continue;if(e.colId!=null){if(t[i].getId()===e.colId)return{idx:i,column:t[i]};continue}if(e.field!=null){if(s.field===e.field)return{idx:i,column:t[i]};continue}if(s===e)return{idx:i,column:t[i]}}}function ns(e,t,i,s){const{gos:o,dataTypeSvc:n,validation:r}=e,a={},l=o.get("defaultColDef");ee(a,l,!1,!0);const d=Hh(e,a,t,i);d&&Bh(e,d,a),ee(a,t,!1,!0);const c=o.get("autoGroupColumnDef"),u=ye(o);return t.rowGroup&&c&&u&&ee(a,{sort:c.sort,initialSort:c.initialSort},!1,!0),n?.validateColDef(a),r?.validateColDef(a,i,s),a}function Hh(e,t,i,s){const o=e.dataTypeSvc?.updateColDefAndGetColumnType(t,i,s),n=i.type??o??t.type;return t.type=n,n?os(n):void 0}function Bh(e,t,i){if(!t.length)return;const s=Object.assign({},Th),o=e.gos.get("columnTypes")||{};for(const n of Object.keys(o)){const r=o[n];n in s?R(34,{key:n}):(r.type&&R(35),s[n]=r)}t.forEach(n=>{const r=s[n.trim()];r?ee(i,r,!1,!0):R(36,{t:n})})}function Vh(e){return e.children!==void 0}function ze(e,t,i){if(t)for(let s=0;s<t.length;s++){const o=t[s];te(o)&&ze(o,o.getChildren(),i),i(o,e)}}function na(e,t){const i=[],s=[],o=[];return e.forEach(r=>{const a=r.getColDef().lockPosition;a==="right"?o.push(r):a==="left"||a===!0?i.push(r):s.push(r)}),t.get("enableRtl")?[...o,...s,...i]:[...i,...s,...o]}function ra(e,t){let i=!0;return ze(null,t,s=>{if(!te(s))return;const o=s,n=o.getColGroupDef();if(!(n&&n.marryChildren))return;const a=[];o.getLeafColumns().forEach(h=>{const g=e.indexOf(h);a.push(g)});const l=Math.max.apply(Math,a),d=Math.min.apply(Math,a),c=l-d,u=o.getLeafColumns().length-1;c>u&&(i=!1)}),i}function aa(e,t){if(!e||e.length==0)return;const i=t(e[0]);for(let s=1;s<e.length;s++)if(i!==t(e[s]))return;return i}function la(e,t,i){if(!t.length)return;const s=t.length===1?t[0]:null,o=aa(t,n=>n.getPinned());e.dispatchEvent({type:"columnPinned",pinned:o??null,columns:t,column:s,source:i})}function Nh(e,t,i){if(!t.length)return;const s=t.length===1?t[0]:null,o=aa(t,n=>n.isVisible());e.dispatchEvent({type:"columnVisible",visible:o,columns:t,column:s,source:i})}function da(e,t,i,s){e.dispatchEvent({type:t,columns:i,column:i&&i.length==1?i[0]:null,source:s})}function Ot(e,t,i,s,o=null){t?.length&&e.dispatchEvent({type:"columnResized",columns:t,column:t.length===1?t[0]:null,flexColumns:o,finished:i,source:s})}function le(e,t,i){const{colModel:s,rowGroupColsSvc:o,pivotColsSvc:n,autoColSvc:r,selectionColSvc:a,colAnimation:l,visibleCols:d,pivotResultCols:c,environment:u,valueColsSvc:h,eventSvc:g,gos:p}=e,f=s.getColDefCols()||[];if(!f?.length)return!1;if(t?.state&&!t.state.forEach)return R(32),!1;const m=(y,P,E,A,I)=>{if(!y)return;const M=Ih(P,t.defaultState),V=M("flex").value1;if(sa(e,y,M("hide").value1,M("sort").value1,M("sortIndex").value1,M("pinned").value1,V,i),V==null){const j=M("width").value1;if(j!=null){const Ce=y.getColDef().minWidth??u.getDefaultColumnMinWidth();Ce!=null&&j>=Ce&&y.setActualWidth(j,i)}}I||!y.isPrimary()||(h?.syncColumnWithState(y,i,M),o?.syncColumnWithState(y,i,M,E),n?.syncColumnWithState(y,i,M,A))},C=(y,P,E)=>{const A=ua(e,i),I=P.slice(),M={},V={},j=[],Ce=[],Fe=[];let re=0;const Gi=o?.columns.slice()??[],Fu=n?.columns.slice()??[];y.forEach(se=>{const Ut=se.colId;if(Ut.startsWith(ii)){j.push(se),Fe.push(se);return}if(ke(Ut)){Ce.push(se),Fe.push(se);return}const Pt=E(Ut);Pt?(m(Pt,se,M,V,!1),ge(I,Pt)):(Fe.push(se),re+=1)});const $n=se=>m(se,null,M,V,!1);I.forEach($n),o?.sortColumns(ga.bind(o,M,Gi)),n?.sortColumns(ga.bind(n,V,Fu)),s.refreshCols(!1);const Kn=(se,Ut,Ws=[])=>{Ut.forEach(Pt=>{const jn=se(Pt.colId);ge(Ws,jn),m(jn,Pt,null,null,!0)}),Ws.forEach($n)};return Kn(se=>r?.getColumn(se)??null,j,r?.getColumns()?.slice()),Kn(se=>a?.getColumn(se)??null,Ce,a?.getColumns()?.slice()),zh(t,s,p),d.refresh(i),g.dispatchEvent({type:"columnEverythingChanged",source:i}),A(),{unmatchedAndAutoStates:Fe,unmatchedCount:re}};l?.start();let{unmatchedAndAutoStates:w,unmatchedCount:v}=C(t.state||[],f,y=>s.getColDefCol(y));if(w.length>0||x(t.defaultState)){const y=c?.getPivotResultCols()?.list??[];v=C(w,y,P=>c?.getPivotResultCol(P)??null).unmatchedCount}return l?.finish(),v===0}function ca(e,t){const{colModel:i,autoColSvc:s,selectionColSvc:o}=e,n=i.getColDefCols();if(!n?.length)return;const r=i.getColDefColTree(),a=Ro(r),l=[];let d=1e3,c=1e3;const u=m=>{const C=ha(m);B(C.rowGroupIndex)&&C.rowGroup&&(C.rowGroupIndex=d++),B(C.pivotIndex)&&C.pivot&&(C.pivotIndex=c++),l.push(C)};s?.getColumns()?.forEach(u),o?.getColumns()?.forEach(u),a?.forEach(u),le(e,{state:l},t);const h=s?.getColumns()??[],f=[...o?.getColumns()??[],...h,...n].map(m=>({colId:m.colId}));le(e,{state:f,applyOrder:!0},t)}function ua(e,t){const{rowGroupColsSvc:i,pivotColsSvc:s,valueColsSvc:o,colModel:n,sortSvc:r,eventSvc:a}=e,l={rowGroupColumns:i?.columns.slice()??[],pivotColumns:s?.columns.slice()??[],valueColumns:o?.columns.slice()??[]},d=Gt(e),c={};return d.forEach(u=>{c[u.colId]=u}),()=>{const u=(E,A,I,M)=>{const V=A.map(M),j=I.map(M);if(qe(V,j))return;const Fe=new Set(A);I.forEach(Gi=>{Fe.delete(Gi)||Fe.add(Gi)});const re=[...Fe];a.dispatchEvent({type:E,columns:re,column:re.length===1?re[0]:null,source:t})},h=E=>{const A=[];return n.forAllCols(I=>{const M=c[I.getColId()];M&&E(M,I)&&A.push(I)}),A},g=E=>E.getColId();u("columnRowGroupChanged",l.rowGroupColumns,i?.columns??[],g),u("columnPivotChanged",l.pivotColumns,s?.columns??[],g);const f=h((E,A)=>{const I=E.aggFunc!=null,M=I!=A.isValueActive(),V=I&&E.aggFunc!=A.getAggFunc();return M||V});f.length>0&&da(a,"columnValueChanged",f,t),Ot(a,h((E,A)=>E.width!=A.getActualWidth()),!0,t),la(a,h((E,A)=>E.pinned!=A.getPinned()),t),Nh(a,h((E,A)=>E.hide==A.isVisible()),t);const y=h((E,A)=>E.sort!=A.getSort()||E.sortIndex!=A.getSortIndex());y.length>0&&r?.dispatchSortChangedEvents(t,y);const P=Gt(e);_h(d,P,t,n,a)}}function Gt(e){const{colModel:t,rowGroupColsSvc:i,pivotColsSvc:s}=e,o=t.getColDefCols();if(B(o)||!t.isAlive())return[];const n=i?.columns,r=s?.columns,a=[],l=c=>{const u=c.isRowGroupActive()&&n?n.indexOf(c):null,h=c.isPivotActive()&&r?r.indexOf(c):null,g=c.isValueActive()?c.getAggFunc():null,p=c.getSort()!=null?c.getSort():null,f=c.getSortIndex()!=null?c.getSortIndex():null;a.push({colId:c.getColId(),width:c.getActualWidth(),hide:!c.isVisible(),pinned:c.getPinned(),sort:p,sortIndex:f,aggFunc:g,rowGroup:c.isRowGroupActive(),rowGroupIndex:u,pivot:c.isPivotActive(),pivotIndex:h,flex:c.getFlex()??null})};t.forAllCols(c=>l(c));const d=new Map(t.getCols().map((c,u)=>[c.getColId(),u]));return a.sort((c,u)=>{const h=d.has(c.colId)?d.get(c.colId):-1,g=d.has(u.colId)?d.get(u.colId):-1;return h-g}),a}function ha(e){const t=(p,f)=>p??f??null,i=e.getColDef(),s=t(i.sort,i.initialSort),o=t(i.sortIndex,i.initialSortIndex),n=t(i.hide,i.initialHide),r=t(i.pinned,i.initialPinned),a=t(i.width,i.initialWidth),l=t(i.flex,i.initialFlex);let d=t(i.rowGroupIndex,i.initialRowGroupIndex),c=t(i.rowGroup,i.initialRowGroup);d==null&&(c==null||c==!1)&&(d=null,c=null);let u=t(i.pivotIndex,i.initialPivotIndex),h=t(i.pivot,i.initialPivot);u==null&&(h==null||h==!1)&&(u=null,h=null);const g=t(i.aggFunc,i.initialAggFunc);return{colId:e.getColId(),sort:s,sortIndex:o,hide:n,pinned:r,width:a,flex:l,rowGroup:c,rowGroupIndex:d,pivot:h,pivotIndex:u,aggFunc:g}}function zh(e,t,i){if(!e.applyOrder||!e.state)return;const s=[];e.state.forEach(o=>{o.colId!=null&&s.push(o.colId)}),Wh(t.cols,s,t,i)}function Wh(e,t,i,s){if(e==null)return;let o=[];const n={};t.forEach(a=>{if(n[a])return;const l=e.map[a];l&&(o.push(l),n[a]=!0)});let r=0;if(e.list.forEach(a=>{const l=a.getColId();if(n[l]!=null)return;l.startsWith(ii)?o.splice(r++,0,a):o.push(a)}),o=na(o,s),!ra(o,i.getColTree())){R(39);return}e.list=o}function _h(e,t,i,s,o){const n={};t.forEach(c=>n[c.colId]=c);const r={};e.forEach(c=>{n[c.colId]&&(r[c.colId]=!0)});const a=e.filter(c=>r[c.colId]),l=t.filter(c=>r[c.colId]),d=[];l.forEach((c,u)=>{const h=a&&a[u];if(h&&h.colId!==c.colId){const g=s.getCol(h.colId);g&&d.push(g)}}),d.length&&o.dispatchEvent({type:"columnMoved",columns:d,column:d.length===1?d[0]:null,finished:!0,source:i})}var ga=(e,t,i,s)=>{const o=e[i.getId()],n=e[s.getId()],r=o!=null,a=n!=null;if(r&&a)return o-n;if(r)return-1;if(a)return 1;const l=t.indexOf(i),d=t.indexOf(s),c=l>=0,u=d>=0;return c&&u?l-d:c?-1:1},Uh=class extends S{constructor(){super(...arguments),this.beanName="colModel",this.pivotMode=!1,this.ready=!1,this.changeEventsDispatching=!1}postConstruct(){this.pivotMode=this.gos.get("pivotMode"),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents"],e=>this.refreshAll(ft(e.source))),this.addManagedPropertyListeners(["defaultColDef","defaultColGroupDef","columnTypes","suppressFieldDotNotation"],this.recreateColumnDefs.bind(this)),this.addManagedPropertyListener("pivotMode",e=>this.setPivotMode(this.gos.get("pivotMode"),ft(e.source)))}createColsFromColDefs(e){const{beans:t}=this,{valueCache:i,colAutosize:s,rowGroupColsSvc:o,pivotColsSvc:n,valueColsSvc:r,visibleCols:a,colViewport:l,eventSvc:d}=t,c=this.colDefs?ua(t,e):void 0;i?.expire();const u=this.colDefCols?.list,h=this.colDefCols?.tree,g=ta(t,this.colDefs,!0,h,e);si(t,this.colDefCols?.tree,g.columnTree);const p=g.columnTree,f=g.treeDept,m=Ro(p),C={};m.forEach(w=>C[w.getId()]=w),this.colDefCols={tree:p,treeDepth:f,list:m,map:C},o?.extractCols(e,u),n?.extractCols(e,u),r?.extractCols(e,u),this.ready=!0,this.refreshCols(!0),a.refresh(e),l.checkViewportColumns(),d.dispatchEvent({type:"columnEverythingChanged",source:e}),c&&(this.changeEventsDispatching=!0,c(),this.changeEventsDispatching=!1),d.dispatchEvent({type:"newColumnsLoaded",source:e}),e==="gridInitializing"&&s?.applyAutosizeStrategy()}refreshCols(e){if(!this.colDefCols)return;const t=this.cols?.tree;this.saveColOrder();const{autoColSvc:i,selectionColSvc:s,rowNumbersSvc:o,quickFilter:n,pivotResultCols:r,showRowGroupCols:a,rowAutoHeight:l,visibleCols:d,colViewport:c,eventSvc:u}=this.beans,h=this.selectCols(r,this.colDefCols);this.createColumnsForService([i,s,o],h);const g=nh(this.gos,this.showingPivotResult);(!e||g)&&this.restoreColOrder(h),this.positionLockedCols(h),a?.refresh(),n?.refreshCols(),this.setColSpanActive(),l?.setAutoHeightActive(