@wangcheng051/plugin-kit 0.1.1 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,338 @@
1
- (function(l,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("react"),require("antd"),require("@ant-design/icons"),require("react-redux"),require("ag-grid-react")):typeof define=="function"&&define.amd?define(["exports","react","antd","@ant-design/icons","react-redux","ag-grid-react"],t):(l=typeof globalThis<"u"?globalThis:l||self,t(l.CrmPluginKit={},l.React,l.antd,l.antdIcons,l.ReactRedux,l.agGridReact))})(this,function(l,t,S,be,re,Ee){"use strict";function ve(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const W=ve(be);function j(e){return e==null||e===""||typeof e=="number"&&Number.isNaN(e)?!0:Array.isArray(e)?e.length===0:!1}function oe(e,r,n){if(!e||!r)return n;const o=String(r).split(".");let a=e;for(let i=0;i<o.length;i+=1){if(a==null)return n;a=a[o[i]]}return a===void 0?n:a}function Y(e,r=0){if(j(e))return"-";const n=Number(e);return Number.isNaN(n)?"-":n.toLocaleString("zh-CN",{minimumFractionDigits:r,maximumFractionDigits:r})}function se(e,r={}){const{digits:n=2,symbol:o="¥",showSymbol:a=!0,showZeroZero:i=!1}=r;if(j(e))return"-";const g=Number(e);if(Number.isNaN(g))return"-";const _=Y(Math.abs(g),n),k=a?o:"";return g<0?`-${k}${_}`:`${k}${_}`}function le(e,r=2){if(j(e))return"-";const n=Number(e);return Number.isNaN(n)?"-":`${Y(n*100,r)}%`}function Te(e,r){const n={};return(e||[]).forEach(o=>{const a=typeof r=="function"?r(o):oe(o,r);n[a]||(n[a]=[]),n[a].push(o)}),n}function _e(e){const r={};return Object.keys(e||{}).forEach(n=>{j(e[n])||(r[n]=e[n])}),r}function we(e,r=300){let n=null;return function(...a){n&&clearTimeout(n),n=setTimeout(()=>{n=null,e.apply(this,a)},r)}}function Ne(...e){return e.filter(Boolean).join(" ")}function ie(e=[],r="value"){return new Map((e||[]).map(n=>[(n==null?void 0:n[r])??(n==null?void 0:n.id),n]))}function H(e,r=new WeakMap){if(e===null||typeof e!="object")return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){const o=[];return r.set(e,o),e.forEach((a,i)=>{o[i]=H(a,r)}),o}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);const n={};return r.set(e,n),Object.keys(e).forEach(o=>{n[o]=H(e[o],r)}),n}const{Text:I}=S.Typography;function Me({value:e}){return e==null||e===""?t.createElement(I,{type:"secondary"},"-"):t.createElement("span",null,String(e))}function ke({value:e,digits:r=2,showSymbol:n=!0}){if(e==null||e==="")return t.createElement(I,{type:"secondary"},"-");const o=Number(e);return Number.isNaN(o)?t.createElement(I,{type:"secondary"},"-"):t.createElement("span",{style:{color:o<0?"#ff4d4f":void 0}},se(o,{digits:r,showSymbol:n}))}function Ae({value:e,digits:r=0,percent:n=!1}){if(e==null||e==="")return t.createElement(I,{type:"secondary"},"-");const o=Number(e);return Number.isNaN(o)?t.createElement(I,{type:"secondary"},"-"):t.createElement("span",null,n?le(o,r):Y(o,r))}function De({value:e,color:r,options:n}){if(e==null||e==="")return t.createElement(I,{type:"secondary"},"-");let o=r,a=e;if(n&&n.length){const i=n.find(g=>String(g.value)===String(e));i&&(a=i.label,o=o??i.color)}return t.createElement(S.Tag,{color:o||"default"},a)}function Be({value:e,length:r=30}){if(e==null||e==="")return t.createElement(I,{type:"secondary"},"-");const n=String(e);return n.length<=r?t.createElement("span",null,n):t.createElement(S.Tooltip,{title:n},t.createElement(I,{ellipsis:!0,style:{maxWidth:240}},n))}function xe({value:e,onClick:r}){return e==null||e===""?t.createElement(I,{type:"secondary"},"-"):t.createElement("a",{onClick:()=>r&&r(e)},String(e))}function He({value:e,actions:r=[]}){return t.createElement("span",null,r.map(n=>t.createElement("a",{key:n.key,style:{marginRight:8},onClick:()=>n.onClick&&n.onClick(n)},n.text)))}const Le={token:{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",borderRadius:6,fontSize:14,controlHeight:32,wireframe:!1},components:{Table:{headerBg:"#fafafa",headerColor:"#262626",rowHoverBg:"#f5f5f5",borderColor:"#f0f0f0"},Layout:{headerBg:"#ffffff",headerHeight:56,bodyBg:"#f0f2f5"},Card:{headerBg:"transparent"},Menu:{itemBorderRadius:6}}},Ie={success:{color:"success",text:"成功"},warning:{color:"warning",text:"警告"},error:{color:"error",text:"异常"},processing:{color:"processing",text:"处理中"},info:{color:"processing",text:"进行中"},default:{color:"default",text:"未知"}},Oe={1:"success",0:"default",true:"success",false:"default"},ce=["alpine","balham","material","quartz","classic"],$="alpine";function Pe(e=$,r){return[`ag-theme-${ce.includes(e)?e:$}`,r].filter(Boolean).join(" ")}const qe={compact:28,normal:36,relaxed:48},ae=W.default&&typeof W.default=="object"?W.default:W,ze=W.SearchOutlined||ae.SearchOutlined,Ge=W.SettingOutlined||ae.SettingOutlined,T={poper:"_poper_cidv4_2",antTable:"_antTable_cidv4_6",detailTable:"_detailTable_cidv4_10",opts:"_opts_cidv4_10",commonDetail:"_commonDetail_cidv4_18",title:"_title_cidv4_18",searchAndAdd:"_searchAndAdd_cidv4_25",addIcons:"_addIcons_cidv4_25",noteTitle:"_noteTitle_cidv4_31",customHead:"_customHead_cidv4_40",sortNames:"_sortNames_cidv4_43",customSort:"_customSort_cidv4_48",customUnSort:"_customUnSort_cidv4_53",active:"_active_cidv4_56",inactive:"_inactive_cidv4_59",popoverContext:"_popoverContext_cidv4_63",contextRender:"_contextRender_cidv4_68",contextRenderFooter:"_contextRenderFooter_cidv4_71"},ue=({onChange:e=()=>{},columRef:r})=>{const{language:n}=re.useSelector(u=>u.controller),[o,a]=t.useState(!1),[i,g]=t.useState(H(r.current));t.useEffect(()=>{const u=r==null?void 0:r.current;!u||!u.length||o||g(H(u))},[r==null?void 0:r.current,o]);const _=()=>{e({column:i,optType:"mergeColum"}),a(!1)},k=u=>{i[u].visible=!i[u].visible,g([...i])},A=()=>{g(H(r.current))};return React.createElement("div",null,React.createElement(S.Popover,{placement:"bottomLeft",trigger:"click",className:T.poper,open:!!o,onOpenChange:u=>{a(u)},content:React.createElement(React.Fragment,null,React.createElement("div",{style:{padding:"10px 10px",maxHeight:"300px",overflowY:"auto",position:"relative",minWidth:178}},React.createElement("div",{style:{borderBottom:"1px solid rgba(0, 0, 0, 0.06)",paddingBottom:"10px"}},n?"Custom List":"自定义列表"),i.map((u,w)=>React.createElement("div",{style:{height:"32px",display:"flex",alignItems:"center"},key:u+w},React.createElement(S.Checkbox,{color:"primary",checked:u.visible,disabled:u.disabled,onChange:O=>k(w)}),React.createElement("span",{style:{position:"relative",top:"2px",marginLeft:"8px"}},(n?u.enDisplay:u.cnDisplay)||u.field)))),React.createElement("div",{style:{minWidth:120,display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:5,paddingBottom:5,boxShadow:" 0 -1px 2px 0 rgba(0, 0, 0, 0.05)"}},React.createElement(S.Button,{onClick:_,type:"primary"},n?"Save":"保存"),React.createElement(S.Button,{onClick:()=>a(!1)},n?"Cancel":"取消")))},React.createElement(Ge,{onClick:()=>A()})))},ee={fill:"currentColor",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16"},de=e=>t.createElement("svg",{...ee,...e,t:"1688438905306","p-id":"2388"},t.createElement("path",{d:"M804.571 621.714a36.206 36.206 0 0 1-10.861 25.71l-256 256c-6.84 6.839-16.019 10.862-25.71 10.862s-18.87-3.987-25.71-10.862l-256-256a36.425 36.425 0 0 1-10.861-25.71c0-20.004 16.566-36.571 36.571-36.571h512c20.005 0 36.571 16.567 36.571 36.571z","p-id":"2389"})),fe=e=>t.createElement("svg",{...ee,...e,t:"1688438923470","p-id":"2523"},t.createElement("path",{d:"M804.571 402.286c0 20.004-16.566 36.571-36.571 36.571H256c-20.005 0-36.571-16.567-36.571-36.571a36.206 36.206 0 0 1 10.861-25.71l256-256c6.84-6.839 16.019-10.862 25.71-10.862s18.87 3.987 25.71 10.862l256 256a36.425 36.425 0 0 1 10.861 25.71z","p-id":"2524"})),me=e=>t.createElement("svg",{...ee,...e,t:"1688438886160","p-id":"2253"},t.createElement("path",{d:"M804.571 621.714a36.206 36.206 0 0 1-10.861 25.71l-256 256c-6.84 6.839-16.019 10.862-25.71 10.862s-18.87-3.987-25.71-10.862l-256-256a36.425 36.425 0 0 1-10.861-25.71c0-20.004 16.566-36.571 36.571-36.571h512c20.005 0 36.571 16.567 36.571 36.571z m0-219.428c0 20.004-16.566 36.571-36.571 36.571H256c-20.005 0-36.571-16.567-36.571-36.571a36.206 36.206 0 0 1 10.861-25.71l256-256c6.84-6.839 16.019-10.862 25.71-10.862s18.87 3.987 25.71 10.862l256 256a36.425 36.425 0 0 1 10.861 25.71z","p-id":"2254"})),ge=e=>{const[r,n]=t.useState("inactive"),[o,a]=t.useState("inactive"),[i,g]=t.useState("inactive"),_=t.useRef(null),[k,A]=t.useState(!1),[u,w]=t.useState(null),O=()=>{e.showColumnMenu(_.current)};t.useEffect(()=>{var h;const s=Array.isArray(e.filterKey)?e.filterKey:[];w(((h=ie(s,"field").get(e.field))==null?void 0:h.value)??null)},[e.filterKey,e.field]);const v=()=>{const s=e.column.getSort();console.log(s,"sort"),n(s==="asc"?"active":"inactive"),a(s==="desc"?"active":"inactive"),g(s?"inactive":"active")},N=(s,h)=>{e.setSort(s,h.shiftKey)};t.useEffect(()=>{const s=e.column;if(!(!s||typeof s.addEventListener!="function"))return s.addEventListener("sortChanged",v),v(),()=>{s.removeEventListener("sortChanged",v)}},[e.column]),e.enableFilterButton&&`${e.menuIcon}`;let G=null;e.enableSorting&&(G=t.createElement("div",{className:T.sortNames},t.createElement("div",{onClick:s=>N("",s),onTouchEnd:s=>N("",s),className:`${T.customSort} ${T[r]}`},t.createElement(fe,null)),t.createElement("div",{onClick:s=>N("asc",s),onTouchEnd:s=>N("desc",s),className:`${T.customSort} ${T[o]}`},t.createElement(de,null)),t.createElement("div",{onClick:s=>N("desc",s),onTouchEnd:s=>N("",s),className:`${T.customSort} ${T.customUnSort} ${T[i]}`},t.createElement(me,null))));const U={width:"100%"},J=t.useMemo(()=>{var h,C;let s=((h=e.filterSearchRender[e.field])==null?void 0:h.render)||S.Input;return t.createElement(s,{...((C=e.filterSearchRender[e.field])==null?void 0:C.tPropty)||{},value:u,onChange:f=>{w(f.target?f.target.value:f)},style:U})},[e.field,u]);let K=null;return e.search&&(K=t.createElement("div",null,t.createElement(S.Popover,{arrow:!1,open:k,trigger:"click",overlayClassName:T.popoverContext,onOpenChange:s=>A(s),placement:"bottom",content:t.createElement("div",{className:T.contextRender},J,t.createElement("div",{className:T.contextRenderFooter},t.createElement(S.Button,{type:"primary",onClick:()=>{const s=e.filterKey.filter(C=>C.field!=e.field);u!=null&&u.length&&s.push({field:e.field,value:u});const h=s!=null&&s.length?s:[];e.onSearch(h),e.setfilterKey(h),A(!1)}},e.language?"Search":"搜索"),t.createElement(S.Button,{style:{marginLeft:10},onClick:()=>{const s=e.filterKey.filter(C=>C.field!=e.field),h=s!=null&&s.length?s:[];A(!1),e.setfilterKey(h),w(null),e.onSearch(h)}},e.language?"Reset":"重置")))},t.createElement(ze,{style:{color:u?"#1890ff":"rgba(0, 0, 0, 0.25)",marginLeft:10,cursor:"pointer"}})))),t.createElement("div",{className:T.customHead},t.createElement("div",{className:"customHeaderLabel"},e.displayName),G,K)},he=({columnDefs:e=[],loading:r,customBottomTotal:n=!1,onChange:o=()=>{},tableRef:a,tableData:i,pagination:g=!1,reset:_={},customColumn:k=[],filterSearchRender:A={},setfilterKey:u,filterKey:w})=>{const O=t.useMemo(()=>({width:"100%",height:"100%",position:"relative"}),[]),v=t.useMemo(()=>({height:"100%",width:"100%"}),[]),N=re.useSelector(c=>c.controller.language),G=t.useMemo(()=>{const c=g&&typeof g=="object"?g.total:void 0;return typeof c=="number"&&!Number.isNaN(c)?c:Array.isArray(i)?i.length:0},[g,i]),U=t.useMemo(()=>{let c={};return e.map((d,D)=>{if(D==0)c[d.field]="Total",c.fromData="total";else{let L=d.lockPosition?"":0;i.map(P=>{let Q=d.field!=d.key&&d.key?d.key:d.field,X=["jobCurrency","industries","jobSalaryRange"];!isNaN(Number(P[Q]))&&!X.includes(d.field)&&(L+=Number(P[Q]))}),c[d.field]=typeof L=="number"&&L>0?L:"--"}}),[c]},[i,e]),J={visible:!0,sortable:!0,active:!1,unSortIcon:!0,minWidth:200,comparator:(c,d,D,L,P)=>0,headerComponent:ge},K=t.useMemo(()=>({width:170,lockPinned:!0}),[]),s=t.useCallback(c=>{a&&(a.current=c)},[]),h=c=>{var P;const{isNotTip:d,render:D}=c.colDef||{},L=((P=c.data)==null?void 0:P.fromData)==="total";return D&&!L?D(c):t.createElement(S.Tooltip,{title:d?"":c.value||"",arrow:!0,placement:"top"},typeof c.value=="number"||c.value?c.value:"--")},C=t.useCallback(c=>{var D;const d=((D=c.api.getState().sort)==null?void 0:D.sortModel)??[];o({sort:d[0]??null,optType:"sort"})},[o]),f=c=>{o({column:c.api.getColumnDefs().filter(d=>d.field).map(d=>({...d,pinned:void 0,field:d.field,hide:d.hide,visible:d.visible}))})},Z=(c,d)=>{o({optType:"mergeColum",pagination:{page:c,size:d}})};return t.createElement("div",{style:O},r?t.createElement("div",{className:"loadingContent"},t.createElement(S.Spin,null)):null,t.createElement("div",{style:v,className:"ag-theme-alpine AgGridReact"},t.createElement(Ee.AgGridReact,{rowData:i,pinnedBottomRowData:n?U:[],defaultColDef:K,suppressRowTransform:!0,onSortChanged:C,onDragStopped:f,suppressDragLeaveHidesColumns:!0,suppressMovableColumns:!1,..._,columnDefs:[...e.map(c=>({...J,...c,headerName:N?c.enDisplay:c.cnDisplay,cellRenderer:h,headerComponentParams:{onSearch:d=>{console.log(d,"搜索"),o({filter:d||{}})},setfilterKey:u,filterKey:w,language:N,filterSearchRender:A,...c}})),...k],icons:{sortAscending:`<span style="font-size: inherit;color: rgb(24, 144, 255);vertical-align:-webkit-baseline-middle">
1
+ (function(X,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("react"),require("antd"),require("react-redux"),require("react-dom"),require("react-dom/server")):typeof define=="function"&&define.amd?define(["exports","react","antd","react-redux","react-dom","react-dom/server"],g):(X=typeof globalThis<"u"?globalThis:X||self,g(X.CrmPluginKit={},X.React,X.antd,X.ReactRedux,X.ReactDOM,X.ReactDOM))})(this,function(X,g,Ze,Ba,lo,Bc){"use strict";function Wc(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const i=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>t[s]})}}return e.default=t,Object.freeze(e)}const is=Wc(g);function ao(t){return t==null||t===""||typeof t=="number"&&Number.isNaN(t)?!0:Array.isArray(t)?t.length===0:!1}function Wa(t,e,s){if(!t||!e)return s;const i=String(e).split(".");let o=t;for(let r=0;r<i.length;r+=1){if(o==null)return s;o=o[i[r]]}return o===void 0?s:o}function fr(t,e=0){if(ao(t))return"-";const s=Number(t);return Number.isNaN(s)?"-":s.toLocaleString("zh-CN",{minimumFractionDigits:e,maximumFractionDigits:e})}function Ua(t,e={}){const{digits:s=2,symbol:i="¥",showSymbol:o=!0,showZeroZero:r=!1}=e;if(ao(t))return"-";const n=Number(t);if(Number.isNaN(n))return"-";const l=fr(Math.abs(n),s),a=o?i:"";return n<0?`-${a}${l}`:`${a}${l}`}function za(t,e=2){if(ao(t))return"-";const s=Number(t);return Number.isNaN(s)?"-":`${fr(s*100,e)}%`}function Uc(t,e){const s={};return(t||[]).forEach(i=>{const o=typeof e=="function"?e(i):Wa(i,e);s[o]||(s[o]=[]),s[o].push(i)}),s}function zc(t){const e={};return Object.keys(t||{}).forEach(s=>{ao(t[s])||(e[s]=t[s])}),e}function Kc(t,e=300){let s=null;return function(...o){s&&clearTimeout(s),s=setTimeout(()=>{s=null,t.apply(this,o)},e)}}function Yc(...t){return t.filter(Boolean).join(" ")}function Ka(t=[],e="value"){return new Map((t||[]).map(s=>[(s==null?void 0:s[e])??(s==null?void 0:s.id),s]))}function zt(t,e=new WeakMap){if(t===null||typeof t!="object")return t;if(e.has(t))return e.get(t);if(Array.isArray(t)){const i=[];return e.set(t,i),t.forEach((o,r)=>{i[r]=zt(o,e)}),i}if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t.source,t.flags);const s={};return e.set(t,s),Object.keys(t).forEach(i=>{s[i]=zt(t[i],e)}),s}const{Text:os}=Ze.Typography;function jc({value:t}){return t==null||t===""?g.createElement(os,{type:"secondary"},"-"):g.createElement("span",null,String(t))}function qc({value:t,digits:e=2,showSymbol:s=!0}){if(t==null||t==="")return g.createElement(os,{type:"secondary"},"-");const i=Number(t);return Number.isNaN(i)?g.createElement(os,{type:"secondary"},"-"):g.createElement("span",{style:{color:i<0?"#ff4d4f":void 0}},Ua(i,{digits:e,showSymbol:s}))}function Qc({value:t,digits:e=0,percent:s=!1}){if(t==null||t==="")return g.createElement(os,{type:"secondary"},"-");const i=Number(t);return Number.isNaN(i)?g.createElement(os,{type:"secondary"},"-"):g.createElement("span",null,s?za(i,e):fr(i,e))}function Xc({value:t,color:e,options:s}){if(t==null||t==="")return g.createElement(os,{type:"secondary"},"-");let i=e,o=t;if(s&&s.length){const r=s.find(n=>String(n.value)===String(t));r&&(o=r.label,i=i??r.color)}return g.createElement(Ze.Tag,{color:i||"default"},o)}function Jc({value:t,length:e=30}){if(t==null||t==="")return g.createElement(os,{type:"secondary"},"-");const s=String(t);return s.length<=e?g.createElement("span",null,s):g.createElement(Ze.Tooltip,{title:s},g.createElement(os,{ellipsis:!0,style:{maxWidth:240}},s))}function Zc({value:t,onClick:e}){return t==null||t===""?g.createElement(os,{type:"secondary"},"-"):g.createElement("a",{onClick:()=>e&&e(t)},String(t))}function $c({value:t,actions:e=[]}){return g.createElement("span",null,e.map(s=>g.createElement("a",{key:s.key,style:{marginRight:8},onClick:()=>s.onClick&&s.onClick(s)},s.text)))}const ep={token:{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",borderRadius:6,fontSize:14,controlHeight:32,wireframe:!1},components:{Table:{headerBg:"#fafafa",headerColor:"#262626",rowHoverBg:"#f5f5f5",borderColor:"#f0f0f0"},Layout:{headerBg:"#ffffff",headerHeight:56,bodyBg:"#f0f2f5"},Card:{headerBg:"transparent"},Menu:{itemBorderRadius:6}}},tp={success:{color:"success",text:"成功"},warning:{color:"warning",text:"警告"},error:{color:"error",text:"异常"},processing:{color:"processing",text:"处理中"},info:{color:"processing",text:"进行中"},default:{color:"default",text:"未知"}},sp={1:"success",0:"default",true:"success",false:"default"},Ya="pk-ag-grid",ip=["alpine","balham","material","quartz","classic"],ja="alpine";function op(t=ja,e){return[Ya,e].filter(Boolean).join(" ")}const rp={compact:28,normal:36,relaxed:48};var qa=g.createContext({});function uo(){return uo=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var s=arguments[e];for(var i in s)({}).hasOwnProperty.call(s,i)&&(t[i]=s[i])}return t},uo.apply(null,arguments)}function np(t){if(Array.isArray(t))return t}function lp(t,e){var s=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(s!=null){var i,o,r,n,l=[],a=!0,d=!1;try{if(r=(s=s.call(t)).next,e!==0)for(;!(a=(i=r.call(s)).done)&&(l.push(i.value),l.length!==e);a=!0);}catch(h){d=!0,o=h}finally{try{if(!a&&s.return!=null&&(n=s.return(),Object(n)!==n))return}finally{if(d)throw o}}return l}}function Qa(t,e){(e==null||e>t.length)&&(e=t.length);for(var s=0,i=Array(e);s<e;s++)i[s]=t[s];return i}function ap(t,e){if(t){if(typeof t=="string")return Qa(t,e);var s={}.toString.call(t).slice(8,-1);return s==="Object"&&t.constructor&&(s=t.constructor.name),s==="Map"||s==="Set"?Array.from(t):s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?Qa(t,e):void 0}}function dp(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xa(t,e){return np(t)||lp(t,e)||ap(t,e)||dp()}function xs(t){"@babel/helpers - typeof";return xs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xs(t)}function up(t,e){if(xs(t)!="object"||!t)return t;var s;if(typeof Symbol<"u"&&(s=t[Symbol.toPrimitive])!==void 0){var i=s.call(t,e);if(xs(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function hp(t){var e=up(t,"string");return xs(e)=="symbol"?e:e+""}function $e(t,e,s){return(e=hp(e))in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function cp(t,e){if(t==null)return{};var s={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.indexOf(i)!==-1)continue;s[i]=t[i]}return s}function Ja(t,e){if(t==null)return{};var s,i,o=cp(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(i=0;i<r.length;i++)s=r[i],e.indexOf(s)===-1&&{}.propertyIsEnumerable.call(t,s)&&(o[s]=t[s])}return o}function pp(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Za={exports:{}};/*!
3
+ Copyright (c) 2018 Jed Watson.
4
+ Licensed under the MIT License (MIT), see
5
+ http://jedwatson.github.io/classnames
6
+ */(function(t){(function(){var e={}.hasOwnProperty;function s(){for(var r="",n=0;n<arguments.length;n++){var l=arguments[n];l&&(r=o(r,i(l)))}return r}function i(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return s.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var n="";for(var l in r)e.call(r,l)&&r[l]&&(n=o(n,l));return n}function o(r,n){return n?r?r+" "+n:r+n:r}t.exports?(s.default=s,t.exports=s):window.classNames=s})()})(Za);var gp=Za.exports;const fp=pp(gp),Be=Math.round;function Mn(t,e){const s=t.replace(/^[^(]*\((.*)/,"$1").replace(/\).*/,"").match(/\d*\.?\d+%?/g)||[],i=s.map(o=>parseFloat(o));for(let o=0;o<3;o+=1)i[o]=e(i[o]||0,s[o]||"",o);return s[3]?i[3]=s[3].includes("%")?i[3]/100:i[3]:i[3]=1,i}const $a=(t,e,s)=>s===0?t:t/100;function ho(t,e){const s=e||255;return t>s?s:t<0?0:t}class vi{constructor(e){$e(this,"isValid",!0),$e(this,"r",0),$e(this,"g",0),$e(this,"b",0),$e(this,"a",1),$e(this,"_h",void 0),$e(this,"_s",void 0),$e(this,"_l",void 0),$e(this,"_v",void 0),$e(this,"_max",void 0),$e(this,"_min",void 0),$e(this,"_brightness",void 0);function s(i){return i[0]in e&&i[1]in e&&i[2]in e}if(e)if(typeof e=="string"){let o=function(r){return i.startsWith(r)};const i=e.trim();/^#?[A-F\d]{3,8}$/i.test(i)?this.fromHexString(i):o("rgb")?this.fromRgbString(i):o("hsl")?this.fromHslString(i):(o("hsv")||o("hsb"))&&this.fromHsvString(i)}else if(e instanceof vi)this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this._h=e._h,this._s=e._s,this._l=e._l,this._v=e._v;else if(s("rgb"))this.r=ho(e.r),this.g=ho(e.g),this.b=ho(e.b),this.a=typeof e.a=="number"?ho(e.a,1):1;else if(s("hsl"))this.fromHsl(e);else if(s("hsv"))this.fromHsv(e);else throw new Error("@ant-design/fast-color: unsupported input "+JSON.stringify(e))}setR(e){return this._sc("r",e)}setG(e){return this._sc("g",e)}setB(e){return this._sc("b",e)}setA(e){return this._sc("a",e,1)}setHue(e){const s=this.toHsv();return s.h=e,this._c(s)}getLuminance(){function e(r){const n=r/255;return n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}const s=e(this.r),i=e(this.g),o=e(this.b);return .2126*s+.7152*i+.0722*o}getHue(){if(typeof this._h>"u"){const e=this.getMax()-this.getMin();e===0?this._h=0:this._h=Be(60*(this.r===this.getMax()?(this.g-this.b)/e+(this.g<this.b?6:0):this.g===this.getMax()?(this.b-this.r)/e+2:(this.r-this.g)/e+4))}return this._h}getSaturation(){if(typeof this._s>"u"){const e=this.getMax()-this.getMin();e===0?this._s=0:this._s=e/this.getMax()}return this._s}getLightness(){return typeof this._l>"u"&&(this._l=(this.getMax()+this.getMin())/510),this._l}getValue(){return typeof this._v>"u"&&(this._v=this.getMax()/255),this._v}getBrightness(){return typeof this._brightness>"u"&&(this._brightness=(this.r*299+this.g*587+this.b*114)/1e3),this._brightness}darken(e=10){const s=this.getHue(),i=this.getSaturation();let o=this.getLightness()-e/100;return o<0&&(o=0),this._c({h:s,s:i,l:o,a:this.a})}lighten(e=10){const s=this.getHue(),i=this.getSaturation();let o=this.getLightness()+e/100;return o>1&&(o=1),this._c({h:s,s:i,l:o,a:this.a})}mix(e,s=50){const i=this._c(e),o=s/100,r=l=>(i[l]-this[l])*o+this[l],n={r:Be(r("r")),g:Be(r("g")),b:Be(r("b")),a:Be(r("a")*100)/100};return this._c(n)}tint(e=10){return this.mix({r:255,g:255,b:255,a:1},e)}shade(e=10){return this.mix({r:0,g:0,b:0,a:1},e)}onBackground(e){const s=this._c(e),i=this.a+s.a*(1-this.a),o=r=>Be((this[r]*this.a+s[r]*s.a*(1-this.a))/i);return this._c({r:o("r"),g:o("g"),b:o("b"),a:i})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}clone(){return this._c(this)}toHexString(){let e="#";const s=(this.r||0).toString(16);e+=s.length===2?s:"0"+s;const i=(this.g||0).toString(16);e+=i.length===2?i:"0"+i;const o=(this.b||0).toString(16);if(e+=o.length===2?o:"0"+o,typeof this.a=="number"&&this.a>=0&&this.a<1){const r=Be(this.a*255).toString(16);e+=r.length===2?r:"0"+r}return e}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){const e=this.getHue(),s=Be(this.getSaturation()*100),i=Be(this.getLightness()*100);return this.a!==1?`hsla(${e},${s}%,${i}%,${this.a})`:`hsl(${e},${s}%,${i}%)`}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return this.a!==1?`rgba(${this.r},${this.g},${this.b},${this.a})`:`rgb(${this.r},${this.g},${this.b})`}toString(){return this.toRgbString()}_sc(e,s,i){const o=this.clone();return o[e]=ho(s,i),o}_c(e){return new this.constructor(e)}getMax(){return typeof this._max>"u"&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return typeof this._min>"u"&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(e){const s=e.replace("#","");function i(o,r){return parseInt(s[o]+s[r||o],16)}s.length<6?(this.r=i(0),this.g=i(1),this.b=i(2),this.a=s[3]?i(3)/255:1):(this.r=i(0,1),this.g=i(2,3),this.b=i(4,5),this.a=s[6]?i(6,7)/255:1)}fromHsl({h:e,s,l:i,a:o}){if(this._h=e%360,this._s=s,this._l=i,this.a=typeof o=="number"?o:1,s<=0){const m=Be(i*255);this.r=m,this.g=m,this.b=m}let r=0,n=0,l=0;const a=e/60,d=(1-Math.abs(2*i-1))*s,h=d*(1-Math.abs(a%2-1));a>=0&&a<1?(r=d,n=h):a>=1&&a<2?(r=h,n=d):a>=2&&a<3?(n=d,l=h):a>=3&&a<4?(n=h,l=d):a>=4&&a<5?(r=h,l=d):a>=5&&a<6&&(r=d,l=h);const c=i-d/2;this.r=Be((r+c)*255),this.g=Be((n+c)*255),this.b=Be((l+c)*255)}fromHsv({h:e,s,v:i,a:o}){this._h=e%360,this._s=s,this._v=i,this.a=typeof o=="number"?o:1;const r=Be(i*255);if(this.r=r,this.g=r,this.b=r,s<=0)return;const n=e/60,l=Math.floor(n),a=n-l,d=Be(i*(1-s)*255),h=Be(i*(1-s*a)*255),c=Be(i*(1-s*(1-a))*255);switch(l){case 0:this.g=c,this.b=d;break;case 1:this.r=h,this.b=d;break;case 2:this.r=d,this.b=c;break;case 3:this.r=d,this.g=h;break;case 4:this.r=c,this.g=d;break;case 5:default:this.g=d,this.b=h;break}}fromHsvString(e){const s=Mn(e,$a);this.fromHsv({h:s[0],s:s[1],v:s[2],a:s[3]})}fromHslString(e){const s=Mn(e,$a);this.fromHsl({h:s[0],s:s[1],l:s[2],a:s[3]})}fromRgbString(e){const s=Mn(e,(i,o)=>o.includes("%")?Be(i/100*255):i);this.r=s[0],this.g=s[1],this.b=s[2],this.a=s[3]}}var mr=2,ed=.16,mp=.05,Cp=.05,vp=.15,td=5,sd=4,wp=[{index:7,amount:15},{index:6,amount:25},{index:5,amount:30},{index:5,amount:45},{index:5,amount:65},{index:5,amount:85},{index:4,amount:90},{index:3,amount:95},{index:2,amount:97},{index:1,amount:98}];function id(t,e,s){var i;return Math.round(t.h)>=60&&Math.round(t.h)<=240?i=s?Math.round(t.h)-mr*e:Math.round(t.h)+mr*e:i=s?Math.round(t.h)+mr*e:Math.round(t.h)-mr*e,i<0?i+=360:i>=360&&(i-=360),i}function od(t,e,s){if(t.h===0&&t.s===0)return t.s;var i;return s?i=t.s-ed*e:e===sd?i=t.s+ed:i=t.s+mp*e,i>1&&(i=1),s&&e===td&&i>.1&&(i=.1),i<.06&&(i=.06),Math.round(i*100)/100}function rd(t,e,s){var i;return s?i=t.v+Cp*e:i=t.v-vp*e,i=Math.max(0,Math.min(1,i)),Math.round(i*100)/100}function Sp(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=[],i=new vi(t),o=i.toHsv(),r=td;r>0;r-=1){var n=new vi({h:id(o,r,!0),s:od(o,r,!0),v:rd(o,r,!0)});s.push(n)}s.push(i);for(var l=1;l<=sd;l+=1){var a=new vi({h:id(o,l),s:od(o,l),v:rd(o,l)});s.push(a)}return e.theme==="dark"?wp.map(function(d){var h=d.index,c=d.amount;return new vi(e.backgroundColor||"#141414").mix(s[h],c).toHexString()}):s.map(function(d){return d.toHexString()})}var In=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];In.primary=In[5];function nd(t,e){var s=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),s.push.apply(s,i)}return s}function Kt(t){for(var e=1;e<arguments.length;e++){var s=arguments[e]!=null?arguments[e]:{};e%2?nd(Object(s),!0).forEach(function(i){$e(t,i,s[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):nd(Object(s)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(s,i))})}return t}function Ep(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function yp(t,e){if(!t)return!1;if(t.contains)return t.contains(e);for(var s=e;s;){if(s===t)return!0;s=s.parentNode}return!1}var ld="data-rc-order",ad="data-rc-priority",Rp="rc-util-key",Nn=new Map;function dd(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.mark;return e?e.startsWith("data-")?e:"data-".concat(e):Rp}function xn(t){if(t.attachTo)return t.attachTo;var e=document.querySelector("head");return e||document.body}function bp(t){return t==="queue"?"prependQueue":t?"prepend":"append"}function Gn(t){return Array.from((Nn.get(t)||t).children).filter(function(e){return e.tagName==="STYLE"})}function ud(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Ep())return null;var s=e.csp,i=e.prepend,o=e.priority,r=o===void 0?0:o,n=bp(i),l=n==="prependQueue",a=document.createElement("style");a.setAttribute(ld,n),l&&r&&a.setAttribute(ad,"".concat(r)),s!=null&&s.nonce&&(a.nonce=s==null?void 0:s.nonce),a.innerHTML=t;var d=xn(e),h=d.firstChild;if(i){if(l){var c=(e.styles||Gn(d)).filter(function(m){if(!["prepend","prependQueue"].includes(m.getAttribute(ld)))return!1;var C=Number(m.getAttribute(ad)||0);return r>=C});if(c.length)return d.insertBefore(a,c[c.length-1].nextSibling),a}d.insertBefore(a,h)}else d.appendChild(a);return a}function Tp(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=xn(e);return(e.styles||Gn(s)).find(function(i){return i.getAttribute(dd(e))===t})}function Dp(t,e){var s=Nn.get(t);if(!s||!yp(document,s)){var i=ud("",e),o=i.parentNode;Nn.set(t,o),t.removeChild(i)}}function Ap(t,e){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=xn(s),o=Gn(i),r=Kt(Kt({},s),{},{styles:o});Dp(i,r);var n=Tp(e,r);if(n){var l,a;if((l=r.csp)!==null&&l!==void 0&&l.nonce&&n.nonce!==((a=r.csp)===null||a===void 0?void 0:a.nonce)){var d;n.nonce=(d=r.csp)===null||d===void 0?void 0:d.nonce}return n.innerHTML!==t&&(n.innerHTML=t),n}var h=ud(t,r);return h.setAttribute(dd(r),e),h}function hd(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}function Pp(t){return hd(t)instanceof ShadowRoot}function Fp(t){return Pp(t)?hd(t):null}var On={},_n=[],Lp=function(e){_n.push(e)};function Mp(t,e){if(process.env.NODE_ENV!=="production"&&!t&&console!==void 0){var s=_n.reduce(function(i,o){return o(i??"","warning")},e);s&&console.error("Warning: ".concat(s))}}function Ip(t,e){if(process.env.NODE_ENV!=="production"&&!t&&console!==void 0){var s=_n.reduce(function(i,o){return o(i??"","note")},e);s&&console.warn("Note: ".concat(s))}}function Np(){On={}}function cd(t,e,s){!e&&!On[s]&&(t(!1,s),On[s]=!0)}function Cr(t,e){cd(Mp,t,e)}function xp(t,e){cd(Ip,t,e)}Cr.preMessage=Lp,Cr.resetWarned=Np,Cr.noteOnce=xp;function Gp(t){return t.replace(/-(.)/g,function(e,s){return s.toUpperCase()})}function Op(t,e){Cr(t,"[@ant-design/icons] ".concat(e))}function pd(t){return xs(t)==="object"&&typeof t.name=="string"&&typeof t.theme=="string"&&(xs(t.icon)==="object"||typeof t.icon=="function")}function gd(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(t).reduce(function(e,s){var i=t[s];switch(s){case"class":e.className=i,delete e.class;break;default:delete e[s],e[Gp(s)]=i}return e},{})}function Vn(t,e,s){return s?g.createElement(t.tag,Kt(Kt({key:e},gd(t.attrs)),s),(t.children||[]).map(function(i,o){return Vn(i,"".concat(e,"-").concat(t.tag,"-").concat(o))})):g.createElement(t.tag,Kt({key:e},gd(t.attrs)),(t.children||[]).map(function(i,o){return Vn(i,"".concat(e,"-").concat(t.tag,"-").concat(o))}))}function fd(t){return Sp(t)[0]}function md(t){return t?Array.isArray(t)?t:[t]:[]}var _p=`
7
+ .anticon {
8
+ display: inline-flex;
9
+ align-items: center;
10
+ color: inherit;
11
+ font-style: normal;
12
+ line-height: 0;
13
+ text-align: center;
14
+ text-transform: none;
15
+ vertical-align: -0.125em;
16
+ text-rendering: optimizeLegibility;
17
+ -webkit-font-smoothing: antialiased;
18
+ -moz-osx-font-smoothing: grayscale;
19
+ }
20
+
21
+ .anticon > * {
22
+ line-height: 1;
23
+ }
24
+
25
+ .anticon svg {
26
+ display: inline-block;
27
+ }
28
+
29
+ .anticon::before {
30
+ display: none;
31
+ }
32
+
33
+ .anticon .anticon-icon {
34
+ display: block;
35
+ }
36
+
37
+ .anticon[tabindex] {
38
+ cursor: pointer;
39
+ }
40
+
41
+ .anticon-spin::before,
42
+ .anticon-spin {
43
+ display: inline-block;
44
+ -webkit-animation: loadingCircle 1s infinite linear;
45
+ animation: loadingCircle 1s infinite linear;
46
+ }
47
+
48
+ @-webkit-keyframes loadingCircle {
49
+ 100% {
50
+ -webkit-transform: rotate(360deg);
51
+ transform: rotate(360deg);
52
+ }
53
+ }
54
+
55
+ @keyframes loadingCircle {
56
+ 100% {
57
+ -webkit-transform: rotate(360deg);
58
+ transform: rotate(360deg);
59
+ }
60
+ }
61
+ `,Vp=function(e){var s=g.useContext(qa),i=s.csp,o=s.prefixCls,r=s.layer,n=_p;o&&(n=n.replace(/anticon/g,o)),r&&(n="@layer ".concat(r,` {
62
+ `).concat(n,`
63
+ }`)),g.useEffect(function(){var l=e.current,a=Fp(l);Ap(n,"@ant-design-icons",{prepend:!r,csp:i,attachTo:a})},[])},Hp=["icon","className","onClick","style","primaryColor","secondaryColor"],co={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function kp(t){var e=t.primaryColor,s=t.secondaryColor;co.primaryColor=e,co.secondaryColor=s||fd(e),co.calculated=!!s}function Bp(){return Kt({},co)}var wi=function(e){var s=e.icon,i=e.className,o=e.onClick,r=e.style,n=e.primaryColor,l=e.secondaryColor,a=Ja(e,Hp),d=is.useRef(),h=co;if(n&&(h={primaryColor:n,secondaryColor:l||fd(n)}),Vp(d),Op(pd(s),"icon should be icon definiton, but got ".concat(s)),!pd(s))return null;var c=s;return c&&typeof c.icon=="function"&&(c=Kt(Kt({},c),{},{icon:c.icon(h.primaryColor,h.secondaryColor)})),Vn(c.icon,"svg-".concat(c.name),Kt(Kt({className:i,onClick:o,style:r,"data-icon":c.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},a),{},{ref:d}))};wi.displayName="IconReact",wi.getTwoToneColors=Bp,wi.setTwoToneColors=kp;function Cd(t){var e=md(t),s=Xa(e,2),i=s[0],o=s[1];return wi.setTwoToneColors({primaryColor:i,secondaryColor:o})}function Wp(){var t=wi.getTwoToneColors();return t.calculated?[t.primaryColor,t.secondaryColor]:t.primaryColor}var Up=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];Cd(In.primary);var po=is.forwardRef(function(t,e){var s=t.className,i=t.icon,o=t.spin,r=t.rotate,n=t.tabIndex,l=t.onClick,a=t.twoToneColor,d=Ja(t,Up),h=is.useContext(qa),c=h.prefixCls,m=c===void 0?"anticon":c,C=h.rootClassName,v=fp(C,m,$e($e({},"".concat(m,"-").concat(i.name),!!i.name),"".concat(m,"-spin"),!!o||i.name==="loading"),s),S=n;S===void 0&&l&&(S=-1);var w=r?{msTransform:"rotate(".concat(r,"deg)"),transform:"rotate(".concat(r,"deg)")}:void 0,R=md(a),y=Xa(R,2),b=y[0],T=y[1];return is.createElement("span",uo({role:"img","aria-label":i.name},d,{ref:e,tabIndex:S,onClick:l,className:v}),is.createElement(wi,{icon:i,primaryColor:b,secondaryColor:T,style:w}))});po.displayName="AntdIcon",po.getTwoToneColor=Wp,po.setTwoToneColor=Cd;var zp={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},Kp=function(e,s){return is.createElement(po,uo({},e,{ref:s,icon:zp}))},vd=is.forwardRef(Kp);process.env.NODE_ENV!=="production"&&(vd.displayName="SearchOutlined");var Yp={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"},jp=function(e,s){return is.createElement(po,uo({},e,{ref:s,icon:Yp}))},wd=is.forwardRef(jp);process.env.NODE_ENV!=="production"&&(wd.displayName="SettingOutlined");const vt={poper:"_poper_cidv4_2",antTable:"_antTable_cidv4_6",detailTable:"_detailTable_cidv4_10",opts:"_opts_cidv4_10",commonDetail:"_commonDetail_cidv4_18",title:"_title_cidv4_18",searchAndAdd:"_searchAndAdd_cidv4_25",addIcons:"_addIcons_cidv4_25",noteTitle:"_noteTitle_cidv4_31",customHead:"_customHead_cidv4_40",sortNames:"_sortNames_cidv4_43",customSort:"_customSort_cidv4_48",customUnSort:"_customUnSort_cidv4_53",active:"_active_cidv4_56",inactive:"_inactive_cidv4_59",popoverContext:"_popoverContext_cidv4_63",contextRender:"_contextRender_cidv4_68",contextRenderFooter:"_contextRenderFooter_cidv4_71"},Sd=({onChange:t=()=>{},columRef:e})=>{const{language:s}=Ba.useSelector(h=>h.controller),[i,o]=g.useState(!1),[r,n]=g.useState(zt(e.current));g.useEffect(()=>{const h=e==null?void 0:e.current;!h||!h.length||i||n(zt(h))},[e==null?void 0:e.current,i]);const l=()=>{t({column:r,optType:"mergeColum"}),o(!1)},a=h=>{r[h].visible=!r[h].visible,n([...r])},d=()=>{n(zt(e.current))};return React.createElement("div",null,React.createElement(Ze.Popover,{placement:"bottomLeft",trigger:"click",className:vt.poper,open:!!i,onOpenChange:h=>{o(h)},content:React.createElement(React.Fragment,null,React.createElement("div",{style:{padding:"10px 10px",maxHeight:"300px",overflowY:"auto",position:"relative",minWidth:178}},React.createElement("div",{style:{borderBottom:"1px solid rgba(0, 0, 0, 0.06)",paddingBottom:"10px"}},s?"Custom List":"自定义列表"),r.map((h,c)=>React.createElement("div",{style:{height:"32px",display:"flex",alignItems:"center"},key:h+c},React.createElement(Ze.Checkbox,{color:"primary",checked:h.visible,disabled:h.disabled,onChange:m=>a(c)}),React.createElement("span",{style:{position:"relative",top:"2px",marginLeft:"8px"}},(s?h.enDisplay:h.cnDisplay)||h.field)))),React.createElement("div",{style:{minWidth:120,display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:5,paddingBottom:5,boxShadow:" 0 -1px 2px 0 rgba(0, 0, 0, 0.05)"}},React.createElement(Ze.Button,{onClick:l,type:"primary"},s?"Save":"保存"),React.createElement(Ze.Button,{onClick:()=>o(!1)},s?"Cancel":"取消")))},React.createElement(wd,{onClick:()=>d()})))};var Hn=Object.defineProperty,qp=Object.defineProperties,Qp=Object.getOwnPropertyDescriptor,Xp=Object.getOwnPropertyDescriptors,vr=Object.getOwnPropertySymbols,Ed=Object.prototype.hasOwnProperty,yd=Object.prototype.propertyIsEnumerable,Rd=(t,e,s)=>e in t?Hn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,_=(t,e)=>{for(var s in e||(e={}))Ed.call(e,s)&&Rd(t,s,e[s]);if(vr)for(var s of vr(e))yd.call(e,s)&&Rd(t,s,e[s]);return t},Ee=(t,e)=>qp(t,Xp(e)),Jp=(t,e)=>{var s={};for(var i in t)Ed.call(t,i)&&e.indexOf(i)<0&&(s[i]=t[i]);if(t!=null&&vr)for(var i of vr(t))e.indexOf(i)<0&&yd.call(t,i)&&(s[i]=t[i]);return s},We=(t,e)=>{for(var s in e)Hn(t,s,{get:e[s],enumerable:!0})},u=(t,e,s,i)=>{for(var o=i>1?void 0:i?Qp(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(o=(i?n(e,s,o):n(o))||o);return i&&o&&Hn(e,s,o),o},xt=(t,e)=>(s,i)=>e(s,i,t),bd={};We(bd,{attrToBoolean:()=>wr,attrToNumber:()=>fs,attrToString:()=>Zp,defaultComparator:()=>$p,exists:()=>P,jsonEquals:()=>kn,makeNull:()=>Yt,missing:()=>z,missingOrEmpty:()=>bt,toStringOrNull:()=>go,values:()=>Gs});function Yt(t){return t==null||t===""?null:t}function P(t,e=!1){return t!=null&&(t!==""||e)}function z(t){return!P(t)}function bt(t){return t==null||t.length===0}function go(t){return t!=null&&typeof t.toString=="function"?t.toString():null}function fs(t){if(t===void 0)return;if(t===null||t==="")return null;if(typeof t=="number")return isNaN(t)?void 0:t;const e=parseInt(t,10);return isNaN(e)?void 0:e}function wr(t){if(t!==void 0)return t===null||t===""?!1:typeof t=="boolean"?t:/true/i.test(t)}function Zp(t){if(!(t==null||t===""))return t}function kn(t,e){const s=t?JSON.stringify(t):null,i=e?JSON.stringify(e):null;return s===i}function $p(t,e,s=!1){const i=t==null,o=e==null;if(t&&t.toNumber&&(t=t.toNumber()),e&&e.toNumber&&(e=e.toNumber()),i&&o)return 0;if(i)return-1;if(o)return 1;function r(n,l){return n>l?1:n<l?-1:0}if(typeof t!="string"||!s)return r(t,e);try{return t.localeCompare(e)}catch{return r(t,e)}}function Gs(t){if(t instanceof Set||t instanceof Map){const e=[];return t.forEach(s=>e.push(s)),e}return Object.values(t)}var eg=class{constructor(){this.existingKeys={}}addExistingKeys(t){for(let e=0;e<t.length;e++)this.existingKeys[t[e]]=!0}getUniqueKey(t,e){t=go(t);let s=0;for(;;){let i;if(t?(i=t,s!==0&&(i+="_"+s)):e?(i=e,s!==0&&(i+="_"+s)):i=s,!this.existingKeys[i])return this.existingKeys[i]=!0,String(i);s++}}},Td={};We(Td,{SKIP_JS_BUILTINS:()=>Sr,cloneObject:()=>Bn,deepCloneDefinition:()=>Er,getAllValuesInObject:()=>ms,getValueUsingField:()=>Si,isNonNullObject:()=>yr,iterateObject:()=>je,mergeDeep:()=>at,removeAllReferences:()=>Dd});var Sr=new Set(["__proto__","constructor","prototype"]);function je(t,e){if(t!=null){if(Array.isArray(t)){for(let s=0;s<t.length;s++)e(s.toString(),t[s]);return}for(const[s,i]of Object.entries(t))e(s,i)}}function Bn(t){const e={},s=Object.keys(t);for(let i=0;i<s.length;i++){if(Sr.has(s[i]))continue;const o=s[i],r=t[o];e[o]=r}return e}function Er(t,e){if(!t)return;const s=t,i={};return Object.keys(s).forEach(o=>{if(e&&e.indexOf(o)>=0||Sr.has(o))return;const r=s[o];yr(r)&&r.constructor===Object?i[o]=Er(r):i[o]=r}),i}function ms(t){if(!t)return[];const e=Object;if(typeof e.values=="function")return e.values(t);const s=[];for(const i in t)t.hasOwnProperty(i)&&t.propertyIsEnumerable(i)&&s.push(t[i]);return s}function at(t,e,s=!0,i=!1){P(e)&&je(e,(o,r)=>{if(Sr.has(o))return;let n=t[o];n!==r&&(i&&n==null&&r!=null&&typeof r=="object"&&r.constructor===Object&&(n={},t[o]=n),yr(r)&&yr(n)&&!Array.isArray(n)?at(n,r,s,i):(s||r!==void 0)&&(t[o]=r))})}function Si(t,e,s){if(!e||!t)return;if(!s)return t[e];const i=e.split(".");let o=t;for(let r=0;r<i.length;r++){if(o==null)return;o=o[i[r]]}return o}function Dd(t,e=[],s){Object.keys(t).forEach(n=>{typeof t[n]=="object"&&!e.includes(n)&&(t[n]=void 0)});const i=Object.getPrototypeOf(t),o={},r=n=>`AG Grid: Grid API function ${n}() cannot be called as the grid has been destroyed.
64
+ It is recommended to remove local references to the grid api. Alternatively, check gridApi.isDestroyed() to avoid calling methods against a destroyed grid.
65
+ To run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${s}`;Object.getOwnPropertyNames(i).forEach(n=>{if(typeof i[n]=="function"&&!e.includes(n)){const a=()=>{console.warn(r(n))};o[n]={value:a,writable:!0}}}),Object.defineProperties(t,o)}function yr(t){return typeof t=="object"&&t!==null}var Ad={};We(Ad,{compose:()=>tg,debounce:()=>et,doOnce:()=>Ei,errorOnce:()=>Os,executeAfter:()=>Ld,executeInAWhile:()=>Fd,executeNextVMTurn:()=>zn,getFunctionName:()=>Rr,isFunction:()=>br,noop:()=>sg,throttle:()=>Kn,waitUntil:()=>Yn,warnOnce:()=>H});var Pd={};function Ei(t,e){Pd[e]||(t(),Pd[e]=!0)}function H(t){Ei(()=>console.warn("AG Grid: "+t),t)}function Os(t){Ei(()=>console.error("AG Grid: "+t),t)}function Rr(t){if(t.name)return t.name;const e=/function\s+([^\(]+)/.exec(t.toString());return e&&e.length===2?e[1].trim():null}function br(t){return!!(t&&t.constructor&&t.call&&t.apply)}function Fd(t){Ld(t,400)}var Wn=[],Un=!1;function zn(t){Wn.push(t),!Un&&(Un=!0,window.setTimeout(()=>{const e=Wn.slice();Wn.length=0,Un=!1,e.forEach(s=>s())},0))}function Ld(t,e=0){t.length>0&&window.setTimeout(()=>t.forEach(s=>s()),e)}function et(t,e){let s;return function(...i){const o=this;window.clearTimeout(s),s=window.setTimeout(function(){t.apply(o,i)},e)}}function Kn(t,e){let s=0;return function(...i){const o=this,r=new Date().getTime();r-s<e||(s=r,t.apply(o,i))}}function Yn(t,e,s=100,i){const o=new Date().getTime();let r=null,n=!1;const l=()=>{const a=new Date().getTime()-o>s;(t()||a)&&(e(),n=!0,r!=null&&(window.clearInterval(r),r=null),a&&i&&console.warn(i))};l(),n||(r=window.setInterval(l,10))}function tg(...t){return e=>t.reduce((s,i)=>i(s),e)}var sg=()=>{},Md=(t=>(t.CommunityCoreModule="@ag-grid-community/core",t.InfiniteRowModelModule="@ag-grid-community/infinite-row-model",t.ClientSideRowModelModule="@ag-grid-community/client-side-row-model",t.CsvExportModule="@ag-grid-community/csv-export",t.EnterpriseCoreModule="@ag-grid-enterprise/core",t.RowGroupingModule="@ag-grid-enterprise/row-grouping",t.ColumnsToolPanelModule="@ag-grid-enterprise/column-tool-panel",t.FiltersToolPanelModule="@ag-grid-enterprise/filter-tool-panel",t.MenuModule="@ag-grid-enterprise/menu",t.SetFilterModule="@ag-grid-enterprise/set-filter",t.MultiFilterModule="@ag-grid-enterprise/multi-filter",t.StatusBarModule="@ag-grid-enterprise/status-bar",t.SideBarModule="@ag-grid-enterprise/side-bar",t.RangeSelectionModule="@ag-grid-enterprise/range-selection",t.MasterDetailModule="@ag-grid-enterprise/master-detail",t.RichSelectModule="@ag-grid-enterprise/rich-select",t.GridChartsModule="@ag-grid-enterprise/charts",t.ViewportRowModelModule="@ag-grid-enterprise/viewport-row-model",t.ServerSideRowModelModule="@ag-grid-enterprise/server-side-row-model",t.ExcelExportModule="@ag-grid-enterprise/excel-export",t.ClipboardModule="@ag-grid-enterprise/clipboard",t.SparklinesModule="@ag-grid-enterprise/sparklines",t.AdvancedFilterModule="@ag-grid-enterprise/advanced-filter",t.AngularModule="@ag-grid-community/angular",t.ReactModule="@ag-grid-community/react",t.VueModule="@ag-grid-community/vue",t))(Md||{}),Tr=class ge{static register(e){ge.__register(e,!0,void 0)}static registerModules(e){ge.__registerModules(e,!0,void 0)}static __register(e,s,i){ge.runVersionChecks(e),i!==void 0?(ge.areGridScopedModules=!0,ge.gridModulesMap[i]===void 0&&(ge.gridModulesMap[i]={}),ge.gridModulesMap[i][e.moduleName]=e):ge.globalModulesMap[e.moduleName]=e,ge.setModuleBased(s)}static __unRegisterGridModules(e){delete ge.gridModulesMap[e]}static __registerModules(e,s,i){ge.setModuleBased(s),e&&e.forEach(o=>ge.__register(o,s,i))}static isValidModuleVersion(e){const[s,i]=e.version.split(".")||[],[o,r]=ge.currentModuleVersion.split(".")||[];return s===o&&i===r}static runVersionChecks(e){if(ge.currentModuleVersion||(ge.currentModuleVersion=e.version),e.version?ge.isValidModuleVersion(e)||console.error(`AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '${e.moduleName}' is version ${e.version} but the other modules are version ${this.currentModuleVersion}. Please update all modules to the same version.`):console.error(`AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '${e.moduleName}' is incompatible. Please update all modules to the same version.`),e.validate){const s=e.validate();s.isValid||console.error(`AG Grid: ${s.message}`)}}static setModuleBased(e){ge.moduleBased===void 0?ge.moduleBased=e:ge.moduleBased!==e&&Ei(()=>{console.warn("AG Grid: You are mixing modules (i.e. @ag-grid-community/core) and packages (ag-grid-community) - you can only use one or the other of these mechanisms."),console.warn("Please see https://www.ag-grid.com/javascript-grid/modules/ for more information.")},"ModulePackageCheck")}static __setIsBundled(){ge.isBundled=!0}static __assertRegistered(e,s,i){var o;if(this.__isRegistered(e,i))return!0;const r=s+e;let n;if(ge.isBundled)n=`AG Grid: unable to use ${s} as 'ag-grid-enterprise' has not been loaded. Check you are using the Enterprise bundle:
66
+
67
+ <script src="https://cdn.jsdelivr.net/npm/ag-grid-enterprise@AG_GRID_VERSION/dist/ag-grid-enterprise.min.js"><\/script>
68
+
69
+ For more info see: https://ag-grid.com/javascript-data-grid/getting-started/#getting-started-with-ag-grid-enterprise`;else if(ge.moduleBased||ge.moduleBased===void 0){let l=(o=Object.entries(Md).find(([a,d])=>d===e))==null?void 0:o[0];n=`AG Grid: unable to use ${s} as the ${l} is not registered${ge.areGridScopedModules?` for gridId: ${i}`:""}. Check if you have registered the module:
70
+
71
+ import { ModuleRegistry } from '@ag-grid-community/core';
72
+ import { ${l} } from '${e}';
73
+
74
+ ModuleRegistry.registerModules([ ${l} ]);
75
+
76
+ For more info see: https://www.ag-grid.com/javascript-grid/modules/`}else n=`AG Grid: unable to use ${s} as package 'ag-grid-enterprise' has not been imported. Check that you have imported the package:
77
+
78
+ import 'ag-grid-enterprise';`;return Ei(()=>{console.warn(n)},r),!1}static __isRegistered(e,s){var i;return!!ge.globalModulesMap[e]||!!((i=ge.gridModulesMap[s])!=null&&i[e])}static __getRegisteredModules(e){return[...Gs(ge.globalModulesMap),...Gs(ge.gridModulesMap[e]||{})]}static __getGridRegisteredModules(e){var s;return Gs((s=ge.gridModulesMap[e])!=null?s:{})||[]}static __isPackageBased(){return!ge.moduleBased}};Tr.globalModulesMap={},Tr.gridModulesMap={},Tr.areGridScopedModules=!1;var ne=Tr,ig=class{constructor(t,e){if(this.beanWrappers={},this.destroyed=!1,!t||!t.beanClasses)return;this.contextParams=t,this.logger=e,this.logger.log(">> creating ag-Application Context"),this.createBeans();const s=this.getBeanInstances();this.wireBeans(s),this.logger.log(">> ag-Application Context ready - component is alive")}getBeanInstances(){return Gs(this.beanWrappers).map(t=>t.beanInstance)}createBean(t,e){if(!t)throw Error("Can't wire to bean since it is null");return this.wireBeans([t],e),t}wireBeans(t,e){this.autoWireBeans(t),this.methodWireBeans(t),this.callLifeCycleMethods(t,"preConstructMethods"),P(e)&&t.forEach(e),this.callLifeCycleMethods(t,"postConstructMethods")}createBeans(){this.contextParams.beanClasses.forEach(this.createBeanWrapper.bind(this)),je(this.beanWrappers,(e,s)=>{let i;s.bean.__agBeanMetaData&&s.bean.__agBeanMetaData.autowireMethods&&s.bean.__agBeanMetaData.autowireMethods.agConstructor&&(i=s.bean.__agBeanMetaData.autowireMethods.agConstructor);const o=this.getBeansForParameters(i,s.bean.name),r=new(s.bean.bind.apply(s.bean,[null,...o]));s.beanInstance=r});const t=Object.keys(this.beanWrappers).join(", ");this.logger.log(`created beans: ${t}`)}createBeanWrapper(t){const e=t.__agBeanMetaData;if(!e){let i;t.prototype.constructor?i=Rr(t.prototype.constructor):i=""+t,console.error(`Context item ${i} is not a bean`);return}const s={bean:t,beanInstance:null,beanName:e.beanName};this.beanWrappers[e.beanName]=s}autoWireBeans(t){t.forEach(e=>{this.forEachMetaDataInHierarchy(e,(s,i)=>{const o=s.agClassAttributes;o&&o.forEach(r=>{const n=this.lookupBeanInstance(i,r.beanName,r.optional);e[r.attributeName]=n})})})}methodWireBeans(t){t.forEach(e=>{this.forEachMetaDataInHierarchy(e,(s,i)=>{je(s.autowireMethods,(o,r)=>{if(o==="agConstructor")return;const n=this.getBeansForParameters(r,i);e[o].apply(e,n)})})})}forEachMetaDataInHierarchy(t,e){let s=Object.getPrototypeOf(t);for(;s!=null;){const i=s.constructor;if(i.hasOwnProperty("__agBeanMetaData")){const o=i.__agBeanMetaData,r=this.getBeanName(i);e(o,r)}s=Object.getPrototypeOf(s)}}getBeanName(t){if(t.__agBeanMetaData&&t.__agBeanMetaData.beanName)return t.__agBeanMetaData.beanName;const e=t.toString();return e.substring(9,e.indexOf("("))}getBeansForParameters(t,e){const s=[];return t&&je(t,(i,o)=>{const r=this.lookupBeanInstance(e,o);s[Number(i)]=r}),s}lookupBeanInstance(t,e,s=!1){if(this.destroyed)return this.logger.log(`AG Grid: bean reference ${e} is used after the grid is destroyed!`),null;if(e==="context")return this;if(this.contextParams.providedBeanInstances&&this.contextParams.providedBeanInstances.hasOwnProperty(e))return this.contextParams.providedBeanInstances[e];const i=this.beanWrappers[e];return i?i.beanInstance:(s||console.error(`AG Grid: unable to find bean reference ${e} while initialising ${t}`),null)}callLifeCycleMethods(t,e){t.forEach(s=>this.callLifeCycleMethodsOnBean(s,e))}callLifeCycleMethodsOnBean(t,e,s){const i={};this.forEachMetaDataInHierarchy(t,r=>{const n=r[e];n&&n.forEach(l=>{l!=s&&(i[l]=!0)})}),Object.keys(i).forEach(r=>t[r]())}getBean(t){return this.lookupBeanInstance("getBean",t,!0)}destroy(){if(this.destroyed)return;this.destroyed=!0,this.logger.log(">> Shutting down ag-Application Context");const t=this.getBeanInstances();this.destroyBeans(t),this.contextParams.providedBeanInstances=null,ne.__unRegisterGridModules(this.contextParams.gridId),this.logger.log(">> ag-Application Context shut down - component is dead")}destroyBean(t){t&&this.destroyBeans([t])}destroyBeans(t){return t?(t.forEach(e=>{this.callLifeCycleMethodsOnBean(e,"preDestroyMethods","destroy");const s=e;typeof s.destroy=="function"&&s.destroy()}),[]):[]}isDestroyed(){return this.destroyed}getGridId(){return this.contextParams.gridId}};function Id(t,e,s){const i=_s(t.constructor);i.preConstructMethods||(i.preConstructMethods=[]),i.preConstructMethods.push(e)}function M(t,e,s){const i=_s(t.constructor);i.postConstructMethods||(i.postConstructMethods=[]),i.postConstructMethods.push(e)}function tt(t,e,s){const i=_s(t.constructor);i.preDestroyMethods||(i.preDestroyMethods=[]),i.preDestroyMethods.push(e)}function O(t){return e=>{const s=_s(e);s.beanName=t}}function f(t){return(e,s,i)=>{Nd(e,t,!1,e,s)}}function he(t){return(e,s,i)=>{Nd(e,t,!0,e,s)}}function Nd(t,e,s,i,o,r){if(e===null){console.error("AG Grid: Autowired name should not be null");return}const n=_s(t.constructor);n.agClassAttributes||(n.agClassAttributes=[]),n.agClassAttributes.push({attributeName:o,beanName:e,optional:s})}function Tt(t){return(e,s,i)=>{const o=typeof e=="function"?e:e.constructor;let r;if(typeof i=="number"){let n;s?(r=_s(o),n=s):(r=_s(o),n="agConstructor"),r.autowireMethods||(r.autowireMethods={}),r.autowireMethods[n]||(r.autowireMethods[n]={}),r.autowireMethods[n][i]=t}}}function _s(t){return t.hasOwnProperty("__agBeanMetaData")||(t.__agBeanMetaData={}),t.__agBeanMetaData}var Gt=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={}}setBeans(t,e,s=null,i=null){if(this.frameworkOverrides=e,this.gos=t,s){const o=t.useAsyncEvents();this.addGlobalListener(s,o)}i&&this.addGlobalListener(i,!1)}setFrameworkOverrides(t){this.frameworkOverrides=t}getListeners(t,e,s){const i=e?this.allAsyncListeners:this.allSyncListeners;let o=i.get(t);return!o&&s&&(o=new Set,i.set(t,o)),o}noRegisteredListenersExist(){return this.allSyncListeners.size===0&&this.allAsyncListeners.size===0&&this.globalSyncListeners.size===0&&this.globalAsyncListeners.size===0}addEventListener(t,e,s=!1){this.getListeners(t,s,!0).add(e)}removeEventListener(t,e,s=!1){const i=this.getListeners(t,s,!1);i&&(i.delete(e),i.size===0&&(s?this.allAsyncListeners:this.allSyncListeners).delete(t))}addGlobalListener(t,e=!1){(e?this.globalAsyncListeners:this.globalSyncListeners).add(t)}removeGlobalListener(t,e=!1){(e?this.globalAsyncListeners:this.globalSyncListeners).delete(t)}dispatchEvent(t){let e=t;this.gos&&this.gos.addGridCommonParams(e),this.dispatchToListeners(e,!0),this.dispatchToListeners(e,!1),this.firedEvents[e.type]=!0}dispatchEventOnce(t){this.firedEvents[t.type]||this.dispatchEvent(t)}dispatchToListeners(t,e){var s;const i=t.type;if(e&&"event"in t){const a=t.event;a instanceof Event&&(t.eventPath=a.composedPath())}const o=(a,d)=>a.forEach(h=>{if(!d.has(h))return;const c=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>h(t)):()=>h(t);e?this.dispatchAsync(c):c()}),r=(s=this.getListeners(i,e,!1))!=null?s:new Set,n=new Set(r);n.size>0&&o(n,r),new Set(e?this.globalAsyncListeners:this.globalSyncListeners).forEach(a=>{const d=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>a(i,t)):()=>a(i,t);e?this.dispatchAsync(d):d()})}dispatchAsync(t){this.asyncFunctionsQueue.push(t),this.scheduled||(this.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)}),this.scheduled=!0)}flushAsyncQueue(){this.scheduled=!1;const t=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[],t.forEach(e=>e())}};u([xt(0,Tt("gridOptionsService")),xt(1,Tt("frameworkOverrides")),xt(2,Tt("globalEventListener")),xt(3,Tt("globalSyncEventListener"))],Gt.prototype,"setBeans",1),Gt=u([O("eventService")],Gt);var jn=class{constructor(t){this.frameworkOverrides=t,this.wrappedListeners=new Map,this.wrappedGlobalListeners=new Map}wrap(t){let e=t;return this.frameworkOverrides.shouldWrapOutgoing&&(e=s=>{this.frameworkOverrides.wrapOutgoing(()=>t(s))},this.wrappedListeners.set(t,e)),e}wrapGlobal(t){let e=t;return this.frameworkOverrides.shouldWrapOutgoing&&(e=(s,i)=>{this.frameworkOverrides.wrapOutgoing(()=>t(s,i))},this.wrappedGlobalListeners.set(t,e)),e}unwrap(t){var e;return(e=this.wrappedListeners.get(t))!=null?e:t}unwrapGlobal(t){var e;return(e=this.wrappedGlobalListeners.get(t))!=null?e:t}},og={resizable:!0,sortable:!0},rg=0;function xd(){return rg++}var Me=class lc{constructor(e,s,i,o){this.instanceId=xd(),this.autoHeaderHeight=null,this.moving=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.eventService=new Gt,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.colDef=e,this.userProvidedColDef=s,this.colId=i,this.primary=o,this.setState(e)}getInstanceId(){return this.instanceId}setState(e){e.sort!==void 0?(e.sort==="asc"||e.sort==="desc")&&(this.sort=e.sort):(e.initialSort==="asc"||e.initialSort==="desc")&&(this.sort=e.initialSort);const s=e.sortIndex,i=e.initialSortIndex;s!==void 0?s!==null&&(this.sortIndex=s):i!==null&&(this.sortIndex=i);const o=e.hide,r=e.initialHide;o!==void 0?this.visible=!o:this.visible=!r,e.pinned!==void 0?this.setPinned(e.pinned):this.setPinned(e.initialPinned);const n=e.flex,l=e.initialFlex;n!==void 0?this.flex=n:l!==void 0&&(this.flex=l)}setColDef(e,s,i){this.colDef=e,this.userProvidedColDef=s,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),this.eventService.dispatchEvent(this.createColumnEvent("colDefChanged",i))}getUserProvidedColDef(){return this.userProvidedColDef}setParent(e){this.parent=e}getParent(){return this.parent}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}initialise(){this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip()}initDotNotation(){const e=this.gos.get("suppressFieldDotNotation");this.fieldContainsDots=P(this.colDef.field)&&this.colDef.field.indexOf(".")>=0&&!e,this.tooltipFieldContainsDots=P(this.colDef.tooltipField)&&this.colDef.tooltipField.indexOf(".")>=0&&!e}initMinAndMaxWidths(){var e,s;const i=this.colDef;this.minWidth=(e=i.minWidth)!=null?e:this.environment.getMinColWidth(),this.maxWidth=(s=i.maxWidth)!=null?s:Number.MAX_SAFE_INTEGER}initTooltip(){this.tooltipEnabled=P(this.colDef.tooltipField)||P(this.colDef.tooltipValueGetter)||P(this.colDef.tooltipComponent)}resetActualWidth(e){const s=this.calculateColInitialWidth(this.colDef);this.setActualWidth(s,e,!0)}calculateColInitialWidth(e){var s,i;const o=(s=e.minWidth)!=null?s:this.environment.getMinColWidth(),r=(i=e.maxWidth)!=null?i:Number.MAX_SAFE_INTEGER;let n;const l=fs(e.width),a=fs(e.initialWidth);return l!=null?n=l:a!=null?n=a:n=200,Math.max(Math.min(n,r),o)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){if(z(this.colDef)||z(this.colDef.showRowGroup))return!1;const s=this.colDef.showRowGroup===!0,i=this.colDef.showRowGroup===e;return s||i}isPrimary(){return this.primary}isFilterAllowed(){return!!this.colDef.filter}isFieldContainsDots(){return this.fieldContainsDots}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}addEventListener(e,s){var i,o;this.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.eventService.setFrameworkOverrides(this.frameworkOverrides),this.frameworkEventListenerService=new jn(this.frameworkOverrides));const r=(o=(i=this.frameworkEventListenerService)==null?void 0:i.wrap(s))!=null?o:s;this.eventService.addEventListener(e,r)}removeEventListener(e,s){var i,o;const r=(o=(i=this.frameworkEventListenerService)==null?void 0:i.unwrap(s))!=null?o:s;this.eventService.removeEventListener(e,r)}createColumnFunctionCallbackParams(e){return this.gos.addGridCommonParams({node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){if(typeof this.colDef.suppressNavigable=="boolean")return this.colDef.suppressNavigable;if(typeof this.colDef.suppressNavigable=="function"){const s=this.createColumnFunctionCallbackParams(e),i=this.colDef.suppressNavigable;return i(s)}return!1}isCellEditable(e){return e.group&&!this.gos.get("enableGroupEdit")?!1:this.isColumnFunc(e,this.colDef.editable)}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.isColumnFunc(e,this.colDef.checkboxSelection)}isSuppressPaste(e){return this.isColumnFunc(e,this.colDef?this.colDef.suppressPaste:null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(e){var s;return(s=this.colDef[e])!=null?s:og[e]}isColumnFunc(e,s){if(typeof s=="boolean")return s;if(typeof s=="function"){const i=this.createColumnFunctionCallbackParams(e);return s(i)}return!1}setMoving(e,s){this.moving=e,this.eventService.dispatchEvent(this.createColumnEvent("movingChanged",s))}createColumnEvent(e,s){return this.gos.addGridCommonParams({type:e,column:this,columns:[this],source:s})}isMoving(){return this.moving}getSort(){return this.sort}setSort(e,s){this.sort!==e&&(this.sort=e,this.eventService.dispatchEvent(this.createColumnEvent("sortChanged",s))),this.dispatchStateUpdatedEvent("sort")}setMenuVisible(e,s){this.menuVisible!==e&&(this.menuVisible=e,this.eventService.dispatchEvent(this.createColumnEvent("menuVisibleChanged",s)))}isMenuVisible(){return this.menuVisible}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return this.sort==="asc"}isSortDescending(){return this.sort==="desc"}isSortNone(){return z(this.sort)}isSorting(){return P(this.sort)}getSortIndex(){return this.sortIndex}setSortIndex(e){this.sortIndex=e,this.dispatchStateUpdatedEvent("sortIndex")}setAggFunc(e){this.aggFunc=e,this.dispatchStateUpdatedEvent("aggFunc")}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(e,s){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.eventService.dispatchEvent(this.createColumnEvent("leftChanged",s)))}isFilterActive(){return this.filterActive}setFilterActive(e,s,i){this.filterActive!==e&&(this.filterActive=e,this.eventService.dispatchEvent(this.createColumnEvent("filterActiveChanged",s)));const o=this.createColumnEvent("filterChanged",s);i&&at(o,i),this.eventService.dispatchEvent(o)}isHovered(){return this.columnHoverService.isHovered(this)}setPinned(e){e===!0||e==="left"?this.pinned="left":e==="right"?this.pinned="right":this.pinned=null,this.dispatchStateUpdatedEvent("pinned")}setFirstRightPinned(e,s){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.eventService.dispatchEvent(this.createColumnEvent("firstRightPinnedChanged",s)))}setLastLeftPinned(e,s){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.eventService.dispatchEvent(this.createColumnEvent("lastLeftPinnedChanged",s)))}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,s){const i=e===!0;this.visible!==i&&(this.visible=i,this.eventService.dispatchEvent(this.createColumnEvent("visibleChanged",s))),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){const e=this.getColDef();return!e.suppressSpanHeaderHeight&&!e.autoHeaderHeight}getColumnGroupPaddingInfo(){let e=this.getParent();if(!e||!e.isPadding())return{numberOfParents:0,isSpanningTotal:!1};const s=e.getPaddingLevel()+1;let i=!0;for(;e;){if(!e.isPadding()){i=!1;break}e=e.getParent()}return{numberOfParents:s,isSpanningTotal:i}}getColDef(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getDefinition(){return this.colDef}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const s=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,s}createBaseColDefParams(e){return this.gos.addGridCommonParams({node:e,data:e.data,colDef:this.colDef,column:this})}getColSpan(e){if(z(this.colDef.colSpan))return 1;const s=this.createBaseColDefParams(e),i=this.colDef.colSpan(s);return Math.max(i,1)}getRowSpan(e){if(z(this.colDef.rowSpan))return 1;const s=this.createBaseColDefParams(e),i=this.colDef.rowSpan(s);return Math.max(i,1)}setActualWidth(e,s,i=!1){this.minWidth!=null&&(e=Math.max(e,this.minWidth)),this.maxWidth!=null&&(e=Math.min(e,this.maxWidth)),this.actualWidth!==e&&(this.actualWidth=e,this.flex&&s!=="flex"&&s!=="gridInitializing"&&(this.flex=null),i||this.fireColumnWidthChangedEvent(s)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.eventService.dispatchEvent(this.createColumnEvent("widthChanged",e))}isGreaterThanMax(e){return this.maxWidth!=null?e>this.maxWidth:!1}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex||0}setFlex(e){this.flex!==e&&(this.flex=e),this.dispatchStateUpdatedEvent("flex")}setMinimum(e){P(this.minWidth)&&this.setActualWidth(this.minWidth,e)}setRowGroupActive(e,s){this.rowGroupActive!==e&&(this.rowGroupActive=e,this.eventService.dispatchEvent(this.createColumnEvent("columnRowGroupChanged",s))),this.dispatchStateUpdatedEvent("rowGroup")}isRowGroupActive(){return this.rowGroupActive}setPivotActive(e,s){this.pivotActive!==e&&(this.pivotActive=e,this.eventService.dispatchEvent(this.createColumnEvent("columnPivotChanged",s))),this.dispatchStateUpdatedEvent("pivot")}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}setValueActive(e,s){this.aggregationActive!==e&&(this.aggregationActive=e,this.eventService.dispatchEvent(this.createColumnEvent("columnValueChanged",s)))}isValueActive(){return this.aggregationActive}isAllowPivot(){return this.colDef.enablePivot===!0}isAllowValue(){return this.colDef.enableValue===!0}isAllowRowGroup(){return this.colDef.enableRowGroup===!0}getMenuTabs(e){H("As of v31.1, 'getMenuTabs' is deprecated. Use 'getColDef().menuTabs ?? defaultValues' instead.");let s=this.getColDef().menuTabs;return s==null&&(s=e),s}dispatchStateUpdatedEvent(e){this.eventService.dispatchEvent({type:lc.EVENT_STATE_UPDATED,key:e})}};Me.EVENT_MOVING_CHANGED="movingChanged",Me.EVENT_LEFT_CHANGED="leftChanged",Me.EVENT_WIDTH_CHANGED="widthChanged",Me.EVENT_LAST_LEFT_PINNED_CHANGED="lastLeftPinnedChanged",Me.EVENT_FIRST_RIGHT_PINNED_CHANGED="firstRightPinnedChanged",Me.EVENT_VISIBLE_CHANGED="visibleChanged",Me.EVENT_FILTER_CHANGED="filterChanged",Me.EVENT_FILTER_ACTIVE_CHANGED="filterActiveChanged",Me.EVENT_SORT_CHANGED="sortChanged",Me.EVENT_COL_DEF_CHANGED="colDefChanged",Me.EVENT_MENU_VISIBLE_CHANGED="menuVisibleChanged",Me.EVENT_ROW_GROUP_CHANGED="columnRowGroupChanged",Me.EVENT_PIVOT_CHANGED="columnPivotChanged",Me.EVENT_VALUE_CHANGED="columnValueChanged",Me.EVENT_STATE_UPDATED="columnStateUpdated",u([f("gridOptionsService")],Me.prototype,"gos",2),u([f("environment")],Me.prototype,"environment",2),u([f("columnHoverService")],Me.prototype,"columnHoverService",2),u([f("frameworkOverrides")],Me.prototype,"frameworkOverrides",2),u([M],Me.prototype,"initialise",1);var fe=Me,Dr=class ur{constructor(e,s,i,o){this.localEventService=new Gt,this.expandable=!1,this.instanceId=xd(),this.expandableListenerRemoveCallback=null,this.colGroupDef=e,this.groupId=s,this.expanded=!!e&&!!e.openByDefault,this.padding=i,this.level=o}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0)}reset(e,s){this.colGroupDef=e,this.level=s,this.originalParent=null,this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback(),this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}setOriginalParent(e){this.originalParent=e}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;const s={type:ur.EVENT_EXPANDED_CHANGED};this.localEventService.dispatchEvent(s)}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(s=>{s instanceof fe?e.push(s):s instanceof ur&&s.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(s=>s.addEventListener("visibleChanged",e)),this.expandableListenerRemoveCallback=()=>{this.getLeafColumns().forEach(s=>s.removeEventListener("visibleChanged",e)),this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let e=!1,s=!1,i=!1;const o=this.findChildrenRemovingPadding();for(let n=0,l=o.length;n<l;n++){const a=o[n];if(!a.isVisible())continue;const d=a.getColumnGroupShow();d==="open"?(e=!0,i=!0):d==="closed"?(s=!0,i=!0):(e=!0,s=!0)}const r=e&&s&&i;if(this.expandable!==r){this.expandable=r;const n={type:ur.EVENT_EXPANDABLE_CHANGED};this.localEventService.dispatchEvent(n)}}findChildrenRemovingPadding(){const e=[],s=i=>{i.forEach(o=>{o instanceof ur&&o.isPadding()?s(o.children):e.push(o)})};return s(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}addEventListener(e,s){this.localEventService.addEventListener(e,s)}removeEventListener(e,s){this.localEventService.removeEventListener(e,s)}};Dr.EVENT_EXPANDED_CHANGED="expandedChanged",Dr.EVENT_EXPANDABLE_CHANGED="expandableChanged",u([tt],Dr.prototype,"destroy",1);var Ie=Dr,ng={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}},Gd={};We(Gd,{addSafePassiveEventListener:()=>Kd,createEventPath:()=>Ud,getCtrlForEventTarget:()=>Ar,getEventPath:()=>zd,isElementInEventPath:()=>Pr,isEventSupported:()=>$n,isStopPropagationForAgGrid:()=>_t,stopPropagationForAgGrid:()=>Ot});var Od={};We(Od,{areEqual:()=>jt,existsAndNotEmpty:()=>_d,flatten:()=>Bd,forEachReverse:()=>ug,includes:()=>wt,insertArrayIntoArray:()=>Qn,insertIntoArray:()=>fo,last:()=>ie,moveInArray:()=>Xn,pushAll:()=>Jn,removeAllFromArray:()=>kd,removeAllFromUnorderedArray:()=>Hd,removeFromArray:()=>dt,removeFromUnorderedArray:()=>qn,removeRepeatsFromArray:()=>ag,shallowCompare:()=>lg,sortNumerically:()=>Vd,toStrings:()=>dg});function _d(t){return t!=null&&t.length>0}function ie(t){if(!(!t||!t.length))return t[t.length-1]}function jt(t,e,s){return t==null&&e==null?!0:t!=null&&e!=null&&t.length===e.length&&t.every((i,o)=>s?s(i,e[o]):e[o]===i)}function lg(t,e){return jt(t,e)}function Vd(t){return t.sort((e,s)=>e-s)}function ag(t,e){if(t)for(let s=t.length-2;s>=0;s--){const i=t[s]===e,o=t[s+1]===e;i&&o&&t.splice(s+1,1)}}function qn(t,e){const s=t.indexOf(e);s>=0&&(t[s]=t[t.length-1],t.pop())}function dt(t,e){const s=t.indexOf(e);s>=0&&t.splice(s,1)}function Hd(t,e){for(let s=0;s<e.length;s++)qn(t,e[s])}function kd(t,e){for(let s=0;s<e.length;s++)dt(t,e[s])}function fo(t,e,s){t.splice(s,0,e)}function Qn(t,e,s){if(!(t==null||e==null))for(let i=e.length-1;i>=0;i--){const o=e[i];fo(t,o,s)}}function Xn(t,e,s){kd(t,e),e.slice().reverse().forEach(i=>fo(t,i,s))}function wt(t,e){return t.indexOf(e)>-1}function Bd(t){return[].concat.apply([],t)}function Jn(t,e){e==null||t==null||e.forEach(s=>t.push(s))}function dg(t){return t.map(go)}function ug(t,e){if(t!=null)for(let s=t.length-1;s>=0;s--)e(t[s],s)}var Wd="__ag_Grid_Stop_Propagation",hg=["touchstart","touchend","touchmove","touchcancel","scroll"],Zn={};function Ot(t){t[Wd]=!0}function _t(t){return t[Wd]===!0}var $n=(()=>{const t={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return s=>{if(typeof Zn[s]=="boolean")return Zn[s];const i=document.createElement(t[s]||"div");return s="on"+s,Zn[s]=s in i}})();function Ar(t,e,s){let i=e;for(;i;){const o=t.getDomData(i,s);if(o)return o;i=i.parentElement}return null}function Pr(t,e){return!e||!t?!1:zd(e).indexOf(t)>=0}function Ud(t){const e=[];let s=t.target;for(;s;)e.push(s),s=s.parentElement;return e}function zd(t){const e=t;return e.path?e.path:e.composedPath?e.composedPath():Ud(e)}function Kd(t,e,s,i){const r=wt(hg,s)?{passive:!0}:void 0;t&&t.addEventListener&&t.addEventListener(e,s,i,r)}var rs=class ac{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.lastChangeSetIdLookup={},this.propertyListenerId=0,this.isAlive=()=>!this.destroyed}getFrameworkOverrides(){return this.frameworkOverrides}getContext(){return this.context}destroy(){for(let e=0;e<this.destroyFunctions.length;e++)this.destroyFunctions[e]();this.destroyFunctions.length=0,this.destroyed=!0,this.dispatchEvent({type:ac.EVENT_DESTROYED})}addEventListener(e,s){this.localEventService||(this.localEventService=new Gt),this.localEventService.addEventListener(e,s)}removeEventListener(e,s){this.localEventService&&this.localEventService.removeEventListener(e,s)}dispatchEvent(e){this.localEventService&&this.localEventService.dispatchEvent(e)}addManagedListener(e,s,i){if(this.destroyed)return;e instanceof HTMLElement?Kd(this.getFrameworkOverrides(),e,s,i):e.addEventListener(s,i);const o=()=>(e.removeEventListener(s,i),null);return this.destroyFunctions.push(o),()=>(o(),this.destroyFunctions=this.destroyFunctions.filter(r=>r!==o),null)}setupGridOptionListener(e,s){this.gos.addEventListener(e,s);const i=()=>(this.gos.removeEventListener(e,s),null);return this.destroyFunctions.push(i),()=>(i(),this.destroyFunctions=this.destroyFunctions.filter(o=>o!==i),null)}addManagedPropertyListener(e,s){return this.destroyed?()=>null:this.setupGridOptionListener(e,s)}addManagedPropertyListeners(e,s){if(this.destroyed)return;const i=e.join("-")+this.propertyListenerId++,o=r=>{if(r.changeSet){if(r.changeSet&&r.changeSet.id===this.lastChangeSetIdLookup[i])return;this.lastChangeSetIdLookup[i]=r.changeSet.id}const n={type:"gridPropertyChanged",changeSet:r.changeSet,source:r.source};s(n)};e.forEach(r=>this.setupGridOptionListener(r,o))}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createManagedBean(e,s){const i=this.createBean(e,s);return this.addDestroyFunc(this.destroyBean.bind(this,e,s)),i}createBean(e,s,i){return(s||this.getContext()).createBean(e,i)}destroyBean(e,s){return(s||this.getContext()).destroyBean(e)}destroyBeans(e,s){if(e)for(let i=0;i<e.length;i++)this.destroyBean(e[i],s);return[]}};rs.EVENT_DESTROYED="destroyed",u([f("frameworkOverrides")],rs.prototype,"frameworkOverrides",2),u([f("context")],rs.prototype,"context",2),u([f("eventService")],rs.prototype,"eventService",2),u([f("gridOptionsService")],rs.prototype,"gos",2),u([f("localeService")],rs.prototype,"localeService",2),u([f("environment")],rs.prototype,"environment",2),u([tt],rs.prototype,"destroy",1);var L=rs,mo=class extends L{setBeans(t){this.logger=t.create("ColumnFactory")}createColumnTree(t,e,s,i){const o=new eg,{existingCols:r,existingGroups:n,existingColKeys:l}=this.extractExistingTreeData(s);o.addExistingKeys(l);const a=this.recursivelyCreateColumns(t,0,e,r,o,n,i),d=this.findMaxDept(a,0);this.logger.log("Number of levels for grouped columns is "+d);const h=this.balanceColumnTree(a,0,d,o);return ns(null,h,(m,C)=>{m instanceof Ie&&m.setupExpandable(),m.setOriginalParent(C)}),{columnTree:h,treeDept:d}}extractExistingTreeData(t){const e=[],s=[],i=[];return t&&ns(null,t,o=>{if(o instanceof Ie){const r=o;s.push(r)}else{const r=o;i.push(r.getId()),e.push(r)}}),{existingCols:e,existingGroups:s,existingColKeys:i}}createForAutoGroups(t,e){return t.map(s=>this.createAutoGroupTreeItem(e,s))}createAutoGroupTreeItem(t,e){const s=this.findDepth(t);let i=e;for(let o=s-1;o>=0;o--){const r=new Ie(null,`FAKE_PATH_${e.getId()}}_${o}`,!0,o);this.createBean(r),r.setChildren([i]),i.setOriginalParent(r),i=r}return s===0&&e.setOriginalParent(null),i}findDepth(t){let e=0,s=t;for(;s&&s[0]&&s[0]instanceof Ie;)e++,s=s[0].getChildren();return e}balanceColumnTree(t,e,s,i){const o=[];for(let r=0;r<t.length;r++){const n=t[r];if(n instanceof Ie){const l=n,a=this.balanceColumnTree(l.getChildren(),e+1,s,i);l.setChildren(a),o.push(l)}else{let l,a;for(let d=s-1;d>=e;d--){const h=i.getUniqueKey(null,null),c=this.createMergedColGroupDef(null),m=new Ie(c,h,!0,e);this.createBean(m),a&&a.setChildren([m]),a=m,l||(l=a)}if(l&&a)if(o.push(l),t.some(h=>h instanceof Ie)){a.setChildren([n]);continue}else{a.setChildren(t);break}o.push(n)}}return o}findMaxDept(t,e){let s=e;for(let i=0;i<t.length;i++){const o=t[i];if(o instanceof Ie){const r=o,n=this.findMaxDept(r.getChildren(),e+1);s<n&&(s=n)}}return s}recursivelyCreateColumns(t,e,s,i,o,r,n){if(!t)return[];const l=new Array(t.length);for(let a=0;a<l.length;a++){const d=t[a];this.isColumnGroup(d)?l[a]=this.createColumnGroup(s,d,e,i,o,r,n):l[a]=this.createColumn(s,d,i,o,n)}return l}createColumnGroup(t,e,s,i,o,r,n){const l=this.createMergedColGroupDef(e),a=o.getUniqueKey(l.groupId||null,null),d=new Ie(l,a,!1,s);this.createBean(d);const h=this.findExistingGroup(e,r);h&&r.splice(h.idx,1);let c=h==null?void 0:h.group;c&&d.setExpanded(c.isExpanded());const m=this.recursivelyCreateColumns(l.children,s+1,t,i,o,r,n);return d.setChildren(m),d}createMergedColGroupDef(t){const e={};return Object.assign(e,this.gos.get("defaultColGroupDef")),Object.assign(e,t),e}createColumn(t,e,s,i,o){const r=this.findExistingColumn(e,s);r&&(s==null||s.splice(r.idx,1));let n=r==null?void 0:r.column;if(n){const l=this.addColumnDefaultAndTypes(e,n.getColId());n.setColDef(l,e,o),this.applyColumnState(n,l,o)}else{const l=i.getUniqueKey(e.colId,e.field),a=this.addColumnDefaultAndTypes(e,l);n=new fe(a,e,l,t),this.context.createBean(n)}return this.dataTypeService.addColumnListeners(n),n}applyColumnState(t,e,s){const i=fs(e.flex);if(i!==void 0&&t.setFlex(i),t.getFlex()<=0){const l=fs(e.width);if(l!=null)t.setActualWidth(l,s);else{const a=t.getActualWidth();t.setActualWidth(a,s)}}e.sort!==void 0&&(e.sort=="asc"||e.sort=="desc"?t.setSort(e.sort,s):t.setSort(void 0,s));const r=fs(e.sortIndex);r!==void 0&&t.setSortIndex(r);const n=wr(e.hide);n!==void 0&&t.setVisible(!n,s),e.pinned!==void 0&&t.setPinned(e.pinned)}findExistingColumn(t,e){if(e)for(let s=0;s<e.length;s++){const i=e[s].getUserProvidedColDef();if(!i)continue;if(t.colId!=null){if(e[s].getId()===t.colId)return{idx:s,column:e[s]};continue}if(t.field!=null){if(i.field===t.field)return{idx:s,column:e[s]};continue}if(i===t)return{idx:s,column:e[s]}}}findExistingGroup(t,e){if(t.groupId!=null)for(let i=0;i<e.length;i++){const o=e[i];if(o.getColGroupDef()&&o.getId()===t.groupId)return{idx:i,group:o}}}addColumnDefaultAndTypes(t,e){const s={},i=this.gos.get("defaultColDef");at(s,i,!1,!0);const o=this.dataTypeService.updateColDefAndGetColumnType(s,t,e);o&&this.assignColumnTypes(o,s),at(s,t,!1,!0);const r=this.gos.get("autoGroupColumnDef"),n=this.gos.isColumnsSortingCoupledToGroup();return t.rowGroup&&r&&n&&at(s,{sort:r.sort,initialSort:r.initialSort},!1,!0),this.dataTypeService.validateColDef(s),s}assignColumnTypes(t,e){if(!t.length)return;const s=Object.assign({},ng),i=this.gos.get("columnTypes")||{};je(i,(o,r)=>{o in s?console.warn(`AG Grid: the column type '${o}' is a default column type and cannot be overridden.`):(r.type&&H("Column type definitions 'columnTypes' with a 'type' attribute are not supported because a column type cannot refer to another column type. Only column definitions 'columnDefs' can use the 'type' attribute to refer to a column type."),s[o]=r)}),t.forEach(o=>{const r=s[o.trim()];r?at(e,r,!1,!0):console.warn("AG Grid: colDef.type '"+o+"' does not correspond to defined gridOptions.columnTypes")})}isColumnGroup(t){return t.children!==void 0}};u([f("dataTypeService")],mo.prototype,"dataTypeService",2),u([xt(0,Tt("loggerFactory"))],mo.prototype,"setBeans",1),mo=u([O("columnFactory")],mo);function ns(t,e,s){if(e)for(let i=0;i<e.length;i++){const o=e[i];o instanceof Ie&&ns(o,o.getChildren(),s),s(o,t)}}var Fr=class ts{constructor(e,s,i,o){this.displayedChildren=[],this.localEventService=new Gt,this.groupId=s,this.partId=i,this.providedColumnGroup=e,this.pinned=o}static createUniqueId(e,s){return e+"_"+s}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}setParent(e){this.parent=e}getUniqueId(){return ts.createUniqueId(this.groupId,this.partId)}isEmptyGroup(){return this.displayedChildren.length===0}isMoving(){const e=this.getProvidedColumnGroup().getLeafColumns();return!e||e.length===0?!1:e.every(s=>s.isMoving())}checkLeft(){if(this.displayedChildren.forEach(e=>{e instanceof ts&&e.checkLeft()}),this.displayedChildren.length>0)if(this.gos.get("enableRtl")){const s=ie(this.displayedChildren).getLeft();this.setLeft(s)}else{const e=this.displayedChildren[0].getLeft();this.setLeft(e)}else this.setLeft(null)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(e){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.localEventService.dispatchEvent(this.createAgEvent(ts.EVENT_LEFT_CHANGED)))}getPinned(){return this.pinned}createAgEvent(e){return{type:e}}addEventListener(e,s){this.localEventService.addEventListener(e,s)}removeEventListener(e,s){this.localEventService.removeEventListener(e,s)}getGroupId(){return this.groupId}getPartId(){return this.partId}isChildInThisGroupDeepSearch(e){let s=!1;return this.children.forEach(i=>{e===i&&(s=!0),i instanceof ts&&i.isChildInThisGroupDeepSearch(e)&&(s=!0)}),s}getActualWidth(){let e=0;return this.displayedChildren&&this.displayedChildren.forEach(s=>{e+=s.getActualWidth()}),e}isResizable(){if(!this.displayedChildren)return!1;let e=!1;return this.displayedChildren.forEach(s=>{s.isResizable()&&(e=!0)}),e}getMinWidth(){let e=0;return this.displayedChildren.forEach(s=>{e+=s.getMinWidth()||0}),e}addChild(e){this.children||(this.children=[]),this.children.push(e)}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}getDisplayedLeafColumns(){const e=[];return this.addDisplayedLeafColumns(e),e}getDefinition(){return this.providedColumnGroup.getColGroupDef()}getColGroupDef(){return this.providedColumnGroup.getColGroupDef()}isPadding(){return this.providedColumnGroup.isPadding()}isExpandable(){return this.providedColumnGroup.isExpandable()}isExpanded(){return this.providedColumnGroup.isExpanded()}setExpanded(e){this.providedColumnGroup.setExpanded(e)}addDisplayedLeafColumns(e){this.displayedChildren.forEach(s=>{s instanceof fe?e.push(s):s instanceof ts&&s.addDisplayedLeafColumns(e)})}addLeafColumns(e){this.children.forEach(s=>{s instanceof fe?e.push(s):s instanceof ts&&s.addLeafColumns(e)})}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){const e=this.getParent();return!this.isPadding()||!e||!e.isPadding()?0:1+e.getPaddingLevel()}calculateDisplayedColumns(){this.displayedChildren=[];let e=this;for(;e!=null&&e.isPadding();)e=e.getParent();if(!(e?e.providedColumnGroup.isExpandable():!1)){this.displayedChildren=this.children,this.localEventService.dispatchEvent(this.createAgEvent(ts.EVENT_DISPLAYED_CHILDREN_CHANGED));return}this.children.forEach(i=>{if(i instanceof ts&&(!i.displayedChildren||!i.displayedChildren.length))return;switch(i.getColumnGroupShow()){case"open":e.providedColumnGroup.isExpanded()&&this.displayedChildren.push(i);break;case"closed":e.providedColumnGroup.isExpanded()||this.displayedChildren.push(i);break;default:this.displayedChildren.push(i);break}}),this.localEventService.dispatchEvent(this.createAgEvent(ts.EVENT_DISPLAYED_CHILDREN_CHANGED))}};Fr.EVENT_LEFT_CHANGED="leftChanged",Fr.EVENT_DISPLAYED_CHILDREN_CHANGED="displayedChildrenChanged",u([f("gridOptionsService")],Fr.prototype,"gos",2);var He=Fr,p=class{};p.EVENT_COLUMN_EVERYTHING_CHANGED="columnEverythingChanged",p.EVENT_NEW_COLUMNS_LOADED="newColumnsLoaded",p.EVENT_COLUMN_PIVOT_MODE_CHANGED="columnPivotModeChanged",p.EVENT_PIVOT_MAX_COLUMNS_EXCEEDED="pivotMaxColumnsExceeded",p.EVENT_COLUMN_ROW_GROUP_CHANGED="columnRowGroupChanged",p.EVENT_EXPAND_COLLAPSE_ALL="expandOrCollapseAll",p.EVENT_COLUMN_PIVOT_CHANGED="columnPivotChanged",p.EVENT_GRID_COLUMNS_CHANGED="gridColumnsChanged",p.EVENT_COLUMN_VALUE_CHANGED="columnValueChanged",p.EVENT_COLUMN_MOVED="columnMoved",p.EVENT_COLUMN_VISIBLE="columnVisible",p.EVENT_COLUMN_PINNED="columnPinned",p.EVENT_COLUMN_GROUP_OPENED="columnGroupOpened",p.EVENT_COLUMN_RESIZED="columnResized",p.EVENT_DISPLAYED_COLUMNS_CHANGED="displayedColumnsChanged",p.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED="suppressMovableColumns",p.EVENT_SUPPRESS_MENU_HIDE_CHANGED="suppressMenuHide",p.EVENT_SUPPRESS_FIELD_DOT_NOTATION="suppressFieldDotNotation",p.EVENT_VIRTUAL_COLUMNS_CHANGED="virtualColumnsChanged",p.EVENT_COLUMN_HEADER_MOUSE_OVER="columnHeaderMouseOver",p.EVENT_COLUMN_HEADER_MOUSE_LEAVE="columnHeaderMouseLeave",p.EVENT_COLUMN_HEADER_CLICKED="columnHeaderClicked",p.EVENT_COLUMN_HEADER_CONTEXT_MENU="columnHeaderContextMenu",p.EVENT_ASYNC_TRANSACTIONS_FLUSHED="asyncTransactionsFlushed",p.EVENT_ROW_GROUP_OPENED="rowGroupOpened",p.EVENT_ROW_DATA_UPDATED="rowDataUpdated",p.EVENT_PINNED_ROW_DATA_CHANGED="pinnedRowDataChanged",p.EVENT_RANGE_SELECTION_CHANGED="rangeSelectionChanged",p.EVENT_CHART_CREATED="chartCreated",p.EVENT_CHART_RANGE_SELECTION_CHANGED="chartRangeSelectionChanged",p.EVENT_CHART_OPTIONS_CHANGED="chartOptionsChanged",p.EVENT_CHART_DESTROYED="chartDestroyed",p.EVENT_TOOL_PANEL_VISIBLE_CHANGED="toolPanelVisibleChanged",p.EVENT_TOOL_PANEL_SIZE_CHANGED="toolPanelSizeChanged",p.EVENT_COLUMN_PANEL_ITEM_DRAG_START="columnPanelItemDragStart",p.EVENT_COLUMN_PANEL_ITEM_DRAG_END="columnPanelItemDragEnd",p.EVENT_MODEL_UPDATED="modelUpdated",p.EVENT_CUT_START="cutStart",p.EVENT_CUT_END="cutEnd",p.EVENT_PASTE_START="pasteStart",p.EVENT_PASTE_END="pasteEnd",p.EVENT_FILL_START="fillStart",p.EVENT_FILL_END="fillEnd",p.EVENT_RANGE_DELETE_START="rangeDeleteStart",p.EVENT_RANGE_DELETE_END="rangeDeleteEnd",p.EVENT_UNDO_STARTED="undoStarted",p.EVENT_UNDO_ENDED="undoEnded",p.EVENT_REDO_STARTED="redoStarted",p.EVENT_REDO_ENDED="redoEnded",p.EVENT_KEY_SHORTCUT_CHANGED_CELL_START="keyShortcutChangedCellStart",p.EVENT_KEY_SHORTCUT_CHANGED_CELL_END="keyShortcutChangedCellEnd",p.EVENT_CELL_CLICKED="cellClicked",p.EVENT_CELL_DOUBLE_CLICKED="cellDoubleClicked",p.EVENT_CELL_MOUSE_DOWN="cellMouseDown",p.EVENT_CELL_CONTEXT_MENU="cellContextMenu",p.EVENT_CELL_VALUE_CHANGED="cellValueChanged",p.EVENT_CELL_EDIT_REQUEST="cellEditRequest",p.EVENT_ROW_VALUE_CHANGED="rowValueChanged",p.EVENT_CELL_FOCUSED="cellFocused",p.EVENT_CELL_FOCUS_CLEARED="cellFocusCleared",p.EVENT_FULL_WIDTH_ROW_FOCUSED="fullWidthRowFocused",p.EVENT_ROW_SELECTED="rowSelected",p.EVENT_SELECTION_CHANGED="selectionChanged",p.EVENT_TOOLTIP_SHOW="tooltipShow",p.EVENT_TOOLTIP_HIDE="tooltipHide",p.EVENT_CELL_KEY_DOWN="cellKeyDown",p.EVENT_CELL_MOUSE_OVER="cellMouseOver",p.EVENT_CELL_MOUSE_OUT="cellMouseOut",p.EVENT_FILTER_CHANGED="filterChanged",p.EVENT_FILTER_MODIFIED="filterModified",p.EVENT_FILTER_OPENED="filterOpened",p.EVENT_ADVANCED_FILTER_BUILDER_VISIBLE_CHANGED="advancedFilterBuilderVisibleChanged",p.EVENT_SORT_CHANGED="sortChanged",p.EVENT_VIRTUAL_ROW_REMOVED="virtualRowRemoved",p.EVENT_ROW_CLICKED="rowClicked",p.EVENT_ROW_DOUBLE_CLICKED="rowDoubleClicked",p.EVENT_GRID_READY="gridReady",p.EVENT_GRID_PRE_DESTROYED="gridPreDestroyed",p.EVENT_GRID_SIZE_CHANGED="gridSizeChanged",p.EVENT_VIEWPORT_CHANGED="viewportChanged",p.EVENT_SCROLLBAR_WIDTH_CHANGED="scrollbarWidthChanged",p.EVENT_FIRST_DATA_RENDERED="firstDataRendered",p.EVENT_DRAG_STARTED="dragStarted",p.EVENT_DRAG_STOPPED="dragStopped",p.EVENT_CHECKBOX_CHANGED="checkboxChanged",p.EVENT_ROW_EDITING_STARTED="rowEditingStarted",p.EVENT_ROW_EDITING_STOPPED="rowEditingStopped",p.EVENT_CELL_EDITING_STARTED="cellEditingStarted",p.EVENT_CELL_EDITING_STOPPED="cellEditingStopped",p.EVENT_BODY_SCROLL="bodyScroll",p.EVENT_BODY_SCROLL_END="bodyScrollEnd",p.EVENT_HEIGHT_SCALE_CHANGED="heightScaleChanged",p.EVENT_PAGINATION_CHANGED="paginationChanged",p.EVENT_COMPONENT_STATE_CHANGED="componentStateChanged",p.EVENT_STORE_REFRESHED="storeRefreshed",p.EVENT_STATE_UPDATED="stateUpdated",p.EVENT_COLUMN_MENU_VISIBLE_CHANGED="columnMenuVisibleChanged",p.EVENT_CONTEXT_MENU_VISIBLE_CHANGED="contextMenuVisibleChanged",p.EVENT_BODY_HEIGHT_CHANGED="bodyHeightChanged",p.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED="columnContainerWidthChanged",p.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED="displayedColumnsWidthChanged",p.EVENT_SCROLL_VISIBILITY_CHANGED="scrollVisibilityChanged",p.EVENT_COLUMN_HOVER_CHANGED="columnHoverChanged",p.EVENT_FLASH_CELLS="flashCells",p.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED="paginationPixelOffsetChanged",p.EVENT_DISPLAYED_ROWS_CHANGED="displayedRowsChanged",p.EVENT_LEFT_PINNED_WIDTH_CHANGED="leftPinnedWidthChanged",p.EVENT_RIGHT_PINNED_WIDTH_CHANGED="rightPinnedWidthChanged",p.EVENT_ROW_CONTAINER_HEIGHT_CHANGED="rowContainerHeightChanged",p.EVENT_HEADER_HEIGHT_CHANGED="headerHeightChanged",p.EVENT_COLUMN_HEADER_HEIGHT_CHANGED="columnHeaderHeightChanged",p.EVENT_ROW_DRAG_ENTER="rowDragEnter",p.EVENT_ROW_DRAG_MOVE="rowDragMove",p.EVENT_ROW_DRAG_LEAVE="rowDragLeave",p.EVENT_ROW_DRAG_END="rowDragEnd",p.EVENT_GRID_STYLES_CHANGED="gridStylesChanged",p.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST="columnRowGroupChangeRequest",p.EVENT_COLUMN_PIVOT_CHANGE_REQUEST="columnPivotChangeRequest",p.EVENT_COLUMN_VALUE_CHANGE_REQUEST="columnValueChangeRequest",p.EVENT_COLUMN_AGG_FUNC_CHANGE_REQUEST="columnAggFuncChangeRequest",p.EVENT_STORE_UPDATED="storeUpdated",p.EVENT_FILTER_DESTROYED="filterDestroyed",p.EVENT_ROW_DATA_UPDATE_STARTED="rowDataUpdateStarted",p.EVENT_ROW_COUNT_READY="rowCountReady",p.EVENT_ADVANCED_FILTER_ENABLED_CHANGED="advancedFilterEnabledChanged",p.EVENT_DATA_TYPES_INFERRED="dataTypesInferred",p.EVENT_FIELD_VALUE_CHANGED="fieldValueChanged",p.EVENT_FIELD_PICKER_VALUE_SELECTED="fieldPickerValueSelected",p.EVENT_SIDE_BAR_UPDATED="sideBarUpdated";var Lr=new Set([p.EVENT_GRID_PRE_DESTROYED,p.EVENT_FILL_START]),Yd=class{constructor(){this.existingIds={}}getInstanceIdForKey(t){const e=this.existingIds[t];let s;return typeof e!="number"?s=0:s=e+1,this.existingIds[t]=s,s}},yi="ag-Grid-AutoColumn",Co=class extends L{createAutoGroupColumns(t){const e=[],s=this.gos.get("treeData");let i=this.gos.isGroupMultiAutoColumn();return s&&i&&(console.warn('AG Grid: you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data'),i=!1),i?t.forEach((o,r)=>{e.push(this.createOneAutoGroupColumn(o,r))}):e.push(this.createOneAutoGroupColumn()),e}updateAutoGroupColumns(t,e){t.forEach((s,i)=>this.updateOneAutoGroupColumn(s,i,e))}createOneAutoGroupColumn(t,e){let s;t?s=`${yi}-${t.getId()}`:s=yi;const i=this.createAutoGroupColDef(s,t,e);i.colId=s;const o=new fe(i,null,s,!0);return this.context.createBean(o),o}updateOneAutoGroupColumn(t,e,s){const i=t.getColDef(),o=typeof i.showRowGroup=="string"?i.showRowGroup:void 0,r=o!=null?this.columnModel.getPrimaryColumn(o):void 0,n=this.createAutoGroupColDef(t.getId(),r??void 0,e);t.setColDef(n,null,s),this.columnFactory.applyColumnState(t,n,s)}createAutoGroupColDef(t,e,s){let i=this.createBaseColDef(e);const o=this.gos.get("autoGroupColumnDef");at(i,o),i=this.columnFactory.addColumnDefaultAndTypes(i,t),this.gos.get("treeData")||z(i.field)&&z(i.valueGetter)&&z(i.filterValueGetter)&&i.filter!=="agGroupColumnFilter"&&(i.filter=!1),s&&s>0&&(i.headerCheckboxSelection=!1);const r=this.gos.isColumnsSortingCoupledToGroup(),n=i.valueGetter||i.field!=null;return r&&!n&&(i.sortIndex=void 0,i.initialSort=void 0),i}createBaseColDef(t){const e=this.gos.get("autoGroupColumnDef"),i={headerName:this.localeService.getLocaleTextFunc()("group","Group")};if(e&&(e.cellRenderer||e.cellRendererSelector)||(i.cellRenderer="agGroupCellRenderer"),t){const r=t.getColDef();Object.assign(i,{headerName:this.columnModel.getDisplayNameForColumn(t,"header"),headerValueGetter:r.headerValueGetter}),r.cellRenderer&&Object.assign(i,{cellRendererParams:{innerRenderer:r.cellRenderer,innerRendererParams:r.cellRendererParams}}),i.showRowGroup=t.getColId()}else i.showRowGroup=!0;return i}};u([f("columnModel")],Co.prototype,"columnModel",2),u([f("columnFactory")],Co.prototype,"columnFactory",2),Co=u([O("autoGroupColService")],Co);var jd={};We(jd,{camelCaseToHumanText:()=>qd,camelCaseToHyphenated:()=>Qd,capitalise:()=>fg,escapeString:()=>Ne,utf8_encode:()=>gg});var cg=/[&<>"']/g,pg={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function gg(t){const e=String.fromCharCode;function s(c){const m=[];if(!c)return[];const C=c.length;let v=0,S,w;for(;v<C;)S=c.charCodeAt(v++),S>=55296&&S<=56319&&v<C?(w=c.charCodeAt(v++),(w&64512)==56320?m.push(((S&1023)<<10)+(w&1023)+65536):(m.push(S),v--)):m.push(S);return m}function i(c){if(c>=55296&&c<=57343)throw Error("Lone surrogate U+"+c.toString(16).toUpperCase()+" is not a scalar value")}function o(c,m){return e(c>>m&63|128)}function r(c){if(c>=0&&c<=31&&c!==10)return`_x${c.toString(16).toUpperCase().padStart(4,"0")}_`;if(!(c&4294967168))return e(c);let m="";return c&4294965248?c&4294901760?c&4292870144||(m=e(c>>18&7|240),m+=o(c,12),m+=o(c,6)):(i(c),m=e(c>>12&15|224),m+=o(c,6)):m=e(c>>6&31|192),m+=e(c&63|128),m}const n=s(t),l=n.length;let a=-1,d,h="";for(;++a<l;)d=n[a],h+=r(d);return h}function fg(t){return t[0].toUpperCase()+t.substring(1).toLowerCase()}function Ne(t,e){if(t==null)return null;const s=t.toString().toString();return e?s:s.replace(cg,i=>pg[i])}function qd(t){if(!t||t==null)return null;const e=/([a-z])([A-Z])/g,s=/([A-Z]+)([A-Z])([a-z])/g;return t.replace(e,"$1 $2").replace(s,"$1 $2$3").replace(/\./g," ").split(" ").map(o=>o.substring(0,1).toUpperCase()+(o.length>1?o.substring(1,o.length):"")).join(" ")}function Qd(t){return t.replace(/[A-Z]/g,e=>`-${e.toLocaleLowerCase()}`)}var Xd={};We(Xd,{convertToMap:()=>Cs,keys:()=>Cg,mapById:()=>mg});function Cs(t){const e=new Map;return t.forEach(s=>e.set(s[0],s[1])),e}function mg(t,e){const s=new Map;return t.forEach(i=>s.set(e(i),i)),s}function Cg(t){const e=[];return t.forEach((s,i)=>e.push(i)),e}var Ue=class extends L{constructor(){super(...arguments),this.primaryHeaderRowCount=0,this.secondaryHeaderRowCount=0,this.gridHeaderRowCount=0,this.displayedColumnsLeft=[],this.displayedColumnsRight=[],this.displayedColumnsCenter=[],this.displayedColumns=[],this.displayedColumnsAndGroupsMap={},this.viewportColumns=[],this.viewportColumnsHash="",this.headerViewportColumns=[],this.viewportColumnsCenter=[],this.headerViewportColumnsCenter=[],this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={},this.autoHeightActiveAtLeastOnce=!1,this.rowGroupColumns=[],this.valueColumns=[],this.pivotColumns=[],this.ready=!1,this.changeEventsDispatching=!1,this.autoGroupsNeedBuilding=!1,this.forceRecreateAutoGroups=!1,this.pivotMode=!1,this.bodyWidth=0,this.leftWidth=0,this.rightWidth=0,this.bodyWidthDirty=!0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}init(){this.suppressColumnVirtualisation=this.gos.get("suppressColumnVirtualisation");const t=this.gos.get("pivotMode");this.isPivotSettingAllowed(t)&&(this.pivotMode=t),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents"],e=>this.buildAutoGroupColumns(Ri(e.source))),this.addManagedPropertyListener("autoGroupColumnDef",e=>this.onAutoGroupColumnDefChanged(Ri(e.source))),this.addManagedPropertyListeners(["defaultColDef","columnTypes","suppressFieldDotNotation"],e=>this.onSharedColDefChanged(Ri(e.source))),this.addManagedPropertyListener("pivotMode",e=>this.setPivotMode(this.gos.get("pivotMode"),Ri(e.source))),this.addManagedListener(this.eventService,p.EVENT_FIRST_DATA_RENDERED,()=>this.onFirstDataRendered())}buildAutoGroupColumns(t){this.columnDefs&&(this.autoGroupsNeedBuilding=!0,this.forceRecreateAutoGroups=!0,this.updateGridColumns(),this.updateDisplayedColumns(t))}onAutoGroupColumnDefChanged(t){this.groupAutoColumns&&this.autoGroupColService.updateAutoGroupColumns(this.groupAutoColumns,t)}onSharedColDefChanged(t){this.gridColumns&&(this.groupAutoColumns&&this.autoGroupColService.updateAutoGroupColumns(this.groupAutoColumns,t),this.createColumnsFromColumnDefs(!0,t))}setColumnDefs(t,e){const s=!!this.columnDefs;this.columnDefs=t,this.createColumnsFromColumnDefs(s,e)}recreateColumnDefs(t){this.onSharedColDefChanged(t)}destroyOldColumns(t,e){const s={};if(!t)return;ns(null,t,o=>{s[o.getInstanceId()]=o}),e&&ns(null,e,o=>{s[o.getInstanceId()]=null});const i=Object.values(s).filter(o=>o!=null);this.destroyBeans(i)}destroyColumns(){this.destroyOldColumns(this.primaryColumnTree),this.destroyOldColumns(this.secondaryBalancedTree),this.destroyOldColumns(this.groupAutoColsBalancedTree)}createColumnsFromColumnDefs(t,e){const s=t?this.compareColumnStatesAndDispatchEvents(e):void 0;this.valueCache.expire(),this.autoGroupsNeedBuilding=!0;const i=this.primaryColumns,o=this.primaryColumnTree,r=this.columnFactory.createColumnTree(this.columnDefs,!0,o,e);this.destroyOldColumns(this.primaryColumnTree,r.columnTree),this.primaryColumnTree=r.columnTree,this.primaryHeaderRowCount=r.treeDept+1,this.primaryColumns=this.getColumnsFromTree(this.primaryColumnTree),this.primaryColumnsMap={},this.primaryColumns.forEach(a=>this.primaryColumnsMap[a.getId()]=a),this.extractRowGroupColumns(e,i),this.extractPivotColumns(e,i),this.extractValueColumns(e,i),this.ready=!0;const n=this.gridColsArePrimary===void 0;(this.gridColsArePrimary||n||this.autoGroupsNeedBuilding)&&(this.updateGridColumns(),t&&this.gridColsArePrimary&&!this.gos.get("maintainColumnOrder")&&this.orderGridColumnsLikePrimary(),this.updateDisplayedColumns(e),this.checkViewportColumns()),this.dispatchEverythingChanged(e),this.changeEventsDispatching=!0,s&&s(),this.changeEventsDispatching=!1,this.dispatchNewColumnsLoaded(e)}shouldRowModelIgnoreRefresh(){return this.changeEventsDispatching}dispatchNewColumnsLoaded(t){const e={type:p.EVENT_NEW_COLUMNS_LOADED,source:t};this.eventService.dispatchEvent(e),t==="gridInitializing"&&this.onColumnsReady()}dispatchEverythingChanged(t){const e={type:p.EVENT_COLUMN_EVERYTHING_CHANGED,source:t};this.eventService.dispatchEvent(e)}orderGridColumnsLikePrimary(){const t=this.primaryColumns;if(!t)return;const e=t.filter(i=>this.gridColumns.indexOf(i)>=0),s=this.gridColumns.filter(i=>e.indexOf(i)<0);this.gridColumns=[...s,...e],this.gridColumns=this.placeLockedColumns(this.gridColumns)}getAllDisplayedAutoHeightCols(){return this.displayedAutoHeightCols}setViewport(){this.gos.get("enableRtl")?(this.viewportLeft=this.bodyWidth-this.scrollPosition-this.scrollWidth,this.viewportRight=this.bodyWidth-this.scrollPosition):(this.viewportLeft=this.scrollPosition,this.viewportRight=this.scrollWidth+this.scrollPosition)}checkViewportColumns(t=!1){if(this.displayedColumnsCenter==null||!this.extractViewport())return;const s={type:p.EVENT_VIRTUAL_COLUMNS_CHANGED,afterScroll:t};this.eventService.dispatchEvent(s)}setViewportPosition(t,e,s=!1){(t!==this.scrollWidth||e!==this.scrollPosition||this.bodyWidthDirty)&&(this.scrollWidth=t,this.scrollPosition=e,this.bodyWidthDirty=!0,this.setViewport(),this.ready&&this.checkViewportColumns(s))}isPivotMode(){return this.pivotMode}isPivotSettingAllowed(t){return t&&this.gos.get("treeData")?(H("Pivot mode not available with treeData."),!1):!0}setPivotMode(t,e){if(t===this.pivotMode||!this.isPivotSettingAllowed(this.pivotMode)||(this.pivotMode=t,!this.gridColumns))return;this.autoGroupsNeedBuilding=!0,this.updateGridColumns(),this.updateDisplayedColumns(e);const s={type:p.EVENT_COLUMN_PIVOT_MODE_CHANGED};this.eventService.dispatchEvent(s)}getSecondaryPivotColumn(t,e){if(z(this.secondaryColumns))return null;const s=this.getPrimaryColumn(e);let i=null;return this.secondaryColumns.forEach(o=>{const r=o.getColDef().pivotKeys,n=o.getColDef().pivotValueColumn;jt(r,t)&&n===s&&(i=o)}),i}setBeans(t){this.logger=t.create("columnModel")}setFirstRightAndLastLeftPinned(t){let e,s;this.gos.get("enableRtl")?(e=this.displayedColumnsLeft?this.displayedColumnsLeft[0]:null,s=this.displayedColumnsRight?ie(this.displayedColumnsRight):null):(e=this.displayedColumnsLeft?ie(this.displayedColumnsLeft):null,s=this.displayedColumnsRight?this.displayedColumnsRight[0]:null),this.gridColumns.forEach(i=>{i.setLastLeftPinned(i===e,t),i.setFirstRightPinned(i===s,t)})}autoSizeColumns(t){if(this.shouldQueueResizeOperations){this.resizeOperationQueue.push(()=>this.autoSizeColumns(t));return}const{columns:e,skipHeader:s,skipHeaderGroups:i,stopAtGroup:o,source:r="api"}=t;this.animationFrameService.flushAllFrames();const n=[];let l=-1;const a=s??this.gos.get("skipHeaderOnAutoSize"),d=i??a;for(;l!==0;)l=0,this.actionOnGridColumns(e,h=>{if(n.indexOf(h)>=0)return!1;const c=this.autoWidthCalculator.getPreferredWidthForColumn(h,a);if(c>0){const m=this.normaliseColumnWidth(h,c);h.setActualWidth(m,r),n.push(h),l++}return!0},r);d||this.autoSizeColumnGroupsByColumns(e,r,o),this.dispatchColumnResizedEvent(n,!0,"autosizeColumns")}dispatchColumnResizedEvent(t,e,s,i=null){if(t&&t.length){const o={type:p.EVENT_COLUMN_RESIZED,columns:t,column:t.length===1?t[0]:null,flexColumns:i,finished:e,source:s};this.eventService.dispatchEvent(o)}}dispatchColumnChangedEvent(t,e,s){const i={type:t,columns:e,column:e&&e.length==1?e[0]:null,source:s};this.eventService.dispatchEvent(i)}dispatchColumnMovedEvent(t){const{movedColumns:e,source:s,toIndex:i,finished:o}=t,r={type:p.EVENT_COLUMN_MOVED,columns:e,column:e&&e.length===1?e[0]:null,toIndex:i,finished:o,source:s};this.eventService.dispatchEvent(r)}dispatchColumnPinnedEvent(t,e){if(!t.length)return;const s=t.length===1?t[0]:null,i=this.getCommonValue(t,r=>r.getPinned()),o={type:p.EVENT_COLUMN_PINNED,pinned:i??null,columns:t,column:s,source:e};this.eventService.dispatchEvent(o)}dispatchColumnVisibleEvent(t,e){if(!t.length)return;const s=t.length===1?t[0]:null,i=this.getCommonValue(t,r=>r.isVisible()),o={type:p.EVENT_COLUMN_VISIBLE,visible:i,columns:t,column:s,source:e};this.eventService.dispatchEvent(o)}autoSizeColumn(t,e,s){t&&this.autoSizeColumns({columns:[t],skipHeader:s,skipHeaderGroups:!0,source:e})}autoSizeColumnGroupsByColumns(t,e,s){const i=new Set;this.getGridColumns(t).forEach(l=>{let a=l.getParent();for(;a&&a!=s;)a.isPadding()||i.add(a),a=a.getParent()});let r;const n=[];for(const l of i){for(const a of this.ctrlsService.getHeaderRowContainerCtrls())if(r=a.getHeaderCtrlForColumn(l),r)break;r&&r.resizeLeafColumnsToFit(e)}return n}autoSizeAllColumns(t,e){if(this.shouldQueueResizeOperations){this.resizeOperationQueue.push(()=>this.autoSizeAllColumns(t,e));return}const s=this.getAllDisplayedColumns();this.autoSizeColumns({columns:s,skipHeader:e,source:t})}getColumnsFromTree(t){const e=[],s=i=>{for(let o=0;o<i.length;o++){const r=i[o];r instanceof fe?e.push(r):r instanceof Ie&&s(r.getChildren())}};return s(t),e}getAllDisplayedTrees(){return this.displayedTreeLeft&&this.displayedTreeRight&&this.displayedTreeCentre?this.displayedTreeLeft.concat(this.displayedTreeCentre).concat(this.displayedTreeRight):null}getPrimaryColumnTree(){return this.primaryColumnTree}getHeaderRowCount(){return this.gridHeaderRowCount}getDisplayedTreeLeft(){return this.displayedTreeLeft}getDisplayedTreeRight(){return this.displayedTreeRight}getDisplayedTreeCentre(){return this.displayedTreeCentre}isColumnDisplayed(t){return this.getAllDisplayedColumns().indexOf(t)>=0}getAllDisplayedColumns(){return this.displayedColumns}getViewportColumns(){return this.viewportColumns}getDisplayedLeftColumnsForRow(t){return this.colSpanActive?this.getDisplayedColumnsForRow(t,this.displayedColumnsLeft):this.displayedColumnsLeft}getDisplayedRightColumnsForRow(t){return this.colSpanActive?this.getDisplayedColumnsForRow(t,this.displayedColumnsRight):this.displayedColumnsRight}isColSpanActive(){return this.colSpanActive}getDisplayedColumnsForRow(t,e,s,i){const o=[];let r=null;for(let n=0;n<e.length;n++){const l=e[n],a=e.length-n,d=Math.min(l.getColSpan(t),a),h=[l];if(d>1){const m=d-1;for(let C=1;C<=m;C++)h.push(e[n+C]);n+=m}let c;s?(c=!1,h.forEach(m=>{s(m)&&(c=!0)})):c=!0,c&&(o.length===0&&r&&(i&&i(l))&&o.push(r),o.push(l)),r=l}return o}getViewportCenterColumnsForRow(t){if(!this.colSpanActive)return this.viewportColumnsCenter;const e=i=>{const o=i.getLeft();return P(o)&&o>this.viewportLeft},s=this.isColumnVirtualisationSuppressed()?null:this.isColumnInRowViewport.bind(this);return this.getDisplayedColumnsForRow(t,this.displayedColumnsCenter,s,e)}isColumnAtEdge(t,e){const s=this.getAllDisplayedColumns();if(!s.length)return!1;const i=e==="first";let o;if(t instanceof He){const r=t.getDisplayedLeafColumns();if(!r.length)return!1;o=i?r[0]:ie(r)}else o=t;return(i?s[0]:ie(s))===o}getAriaColumnIndex(t){let e;return t instanceof He?e=t.getLeafColumns()[0]:e=t,this.ariaOrderColumns.indexOf(e)+1}isColumnInHeaderViewport(t){return t.isAutoHeaderHeight()?!0:this.isColumnInRowViewport(t)}isColumnInRowViewport(t){if(t.isAutoHeight())return!0;const e=t.getLeft()||0,s=e+t.getActualWidth(),i=this.viewportLeft-200,o=this.viewportRight+200,r=e<i&&s<i,n=e>o&&s>o;return!r&&!n}getDisplayedColumnsLeftWidth(){return this.getWidthOfColsInList(this.displayedColumnsLeft)}getDisplayedColumnsRightWidth(){return this.getWidthOfColsInList(this.displayedColumnsRight)}updatePrimaryColumnList(t,e,s,i,o,r){if(!t||bt(t))return;let n=!1;if(t.forEach(a=>{if(!a)return;const d=this.getPrimaryColumn(a);if(d){if(s){if(e.indexOf(d)>=0)return;e.push(d)}else{if(e.indexOf(d)<0)return;dt(e,d)}i(d),n=!0}}),!n)return;this.autoGroupsNeedBuilding&&this.updateGridColumns(),this.updateDisplayedColumns(r);const l={type:o,columns:e,column:e.length===1?e[0]:null,source:r};this.eventService.dispatchEvent(l)}setRowGroupColumns(t,e){this.autoGroupsNeedBuilding=!0,this.setPrimaryColumnList(t,this.rowGroupColumns,p.EVENT_COLUMN_ROW_GROUP_CHANGED,!0,this.setRowGroupActive.bind(this),e)}setRowGroupActive(t,e,s){t!==e.isRowGroupActive()&&(e.setRowGroupActive(t,s),t&&!this.gos.get("suppressRowGroupHidesColumns")&&this.setColumnsVisible([e],!1,s),!t&&!this.gos.get("suppressMakeColumnVisibleAfterUnGroup")&&this.setColumnsVisible([e],!0,s))}addRowGroupColumns(t,e){this.autoGroupsNeedBuilding=!0,this.updatePrimaryColumnList(t,this.rowGroupColumns,!0,this.setRowGroupActive.bind(this,!0),p.EVENT_COLUMN_ROW_GROUP_CHANGED,e)}removeRowGroupColumns(t,e){this.autoGroupsNeedBuilding=!0,this.updatePrimaryColumnList(t,this.rowGroupColumns,!1,this.setRowGroupActive.bind(this,!1),p.EVENT_COLUMN_ROW_GROUP_CHANGED,e)}addPivotColumns(t,e){this.updatePrimaryColumnList(t,this.pivotColumns,!0,s=>s.setPivotActive(!0,e),p.EVENT_COLUMN_PIVOT_CHANGED,e)}setPivotColumns(t,e){this.setPrimaryColumnList(t,this.pivotColumns,p.EVENT_COLUMN_PIVOT_CHANGED,!0,(s,i)=>{i.setPivotActive(s,e)},e)}removePivotColumns(t,e){this.updatePrimaryColumnList(t,this.pivotColumns,!1,s=>s.setPivotActive(!1,e),p.EVENT_COLUMN_PIVOT_CHANGED,e)}setPrimaryColumnList(t,e,s,i,o,r){if(!this.gridColumns)return;const n=new Map;e.forEach((l,a)=>n.set(l,a)),e.length=0,P(t)&&t.forEach(l=>{const a=this.getPrimaryColumn(l);a&&e.push(a)}),e.forEach((l,a)=>{const d=n.get(l);if(d===void 0){n.set(l,0);return}i&&d!==a||n.delete(l)}),(this.primaryColumns||[]).forEach(l=>{const a=e.indexOf(l)>=0;o(a,l)}),this.autoGroupsNeedBuilding&&this.updateGridColumns(),this.updateDisplayedColumns(r),this.dispatchColumnChangedEvent(s,[...n.keys()],r)}setValueColumns(t,e){this.setPrimaryColumnList(t,this.valueColumns,p.EVENT_COLUMN_VALUE_CHANGED,!1,this.setValueActive.bind(this),e)}setValueActive(t,e,s){if(t!==e.isValueActive()&&(e.setValueActive(t,s),t&&!e.getAggFunc()&&this.aggFuncService)){const i=this.aggFuncService.getDefaultAggFunc(e);e.setAggFunc(i)}}addValueColumns(t,e){this.updatePrimaryColumnList(t,this.valueColumns,!0,this.setValueActive.bind(this,!0),p.EVENT_COLUMN_VALUE_CHANGED,e)}removeValueColumns(t,e){this.updatePrimaryColumnList(t,this.valueColumns,!1,this.setValueActive.bind(this,!1),p.EVENT_COLUMN_VALUE_CHANGED,e)}normaliseColumnWidth(t,e){const s=t.getMinWidth();P(s)&&e<s&&(e=s);const i=t.getMaxWidth();return P(i)&&t.isGreaterThanMax(e)&&(e=i),e}getPrimaryOrGridColumn(t){return this.getPrimaryColumn(t)||this.getGridColumn(t)}setColumnWidths(t,e,s,i){const o=[];t.forEach(r=>{const n=this.getPrimaryOrGridColumn(r.key);if(!n)return;if(o.push({width:r.newWidth,ratios:[1],columns:[n]}),this.gos.get("colResizeDefault")==="shift"&&(e=!e),e){const a=this.getDisplayedColAfter(n);if(!a)return;const d=n.getActualWidth()-r.newWidth,h=a.getActualWidth()+d;o.push({width:h,ratios:[1],columns:[a]})}}),o.length!==0&&this.resizeColumnSets({resizeSets:o,finished:s,source:i})}checkMinAndMaxWidthsForSet(t){const{columns:e,width:s}=t;let i=0,o=0,r=!0;e.forEach(a=>{const d=a.getMinWidth();i+=d||0;const h=a.getMaxWidth();P(h)&&h>0?o+=h:r=!1});const n=s>=i,l=!r||s<=o;return n&&l}resizeColumnSets(t){const{resizeSets:e,finished:s,source:i}=t;if(!(!e||e.every(h=>this.checkMinAndMaxWidthsForSet(h)))){if(s){const h=e&&e.length>0?e[0].columns:null;this.dispatchColumnResizedEvent(h,s,i)}return}const r=[],n=[];e.forEach(h=>{const{width:c,columns:m,ratios:C}=h,v={},S={};m.forEach(y=>n.push(y));let w=!0,R=0;for(;w;){if(R++,R>1e3){console.error("AG Grid: infinite loop in resizeColumnSets");break}w=!1;const y=[];let b=0,T=c;m.forEach((A,F)=>{if(S[A.getId()])T-=v[A.getId()];else{y.push(A);const x=C[F];b+=x}});const D=1/b;y.forEach((A,F)=>{const k=F===y.length-1;let x;k?x=T:(x=Math.round(C[F]*c*D),T-=x);const N=A.getMinWidth(),G=A.getMaxWidth();P(N)&&x<N?(x=N,S[A.getId()]=!0,w=!0):P(G)&&G>0&&x>G&&(x=G,S[A.getId()]=!0,w=!0),v[A.getId()]=x})}m.forEach(y=>{const b=v[y.getId()];y.getActualWidth()!==b&&(y.setActualWidth(b,i),r.push(y))})});const l=r.length>0;let a=[];l&&(a=this.refreshFlexedColumns({resizingCols:n,skipSetLeft:!0}),this.setLeftValues(i),this.updateBodyWidths(),this.checkViewportColumns());const d=n.concat(a);(l||s)&&this.dispatchColumnResizedEvent(d,s,i,a)}setColumnAggFunc(t,e,s){if(!t)return;const i=this.getPrimaryColumn(t);i&&(i.setAggFunc(e),this.dispatchColumnChangedEvent(p.EVENT_COLUMN_VALUE_CHANGED,[i],s))}moveRowGroupColumn(t,e,s){if(this.isRowGroupEmpty())return;const i=this.rowGroupColumns[t],o=this.rowGroupColumns.slice(t,e);this.rowGroupColumns.splice(t,1),this.rowGroupColumns.splice(e,0,i);const r={type:p.EVENT_COLUMN_ROW_GROUP_CHANGED,columns:o,column:o.length===1?o[0]:null,source:s};this.eventService.dispatchEvent(r)}moveColumns(t,e,s,i=!0){if(!this.gridColumns)return;if(this.columnAnimationService.start(),e>this.gridColumns.length-t.length){console.warn("AG Grid: tried to insert columns in invalid location, toIndex = "+e),console.warn("AG Grid: remember that you should not count the moving columns when calculating the new index");return}const o=this.getGridColumns(t);this.doesMovePassRules(o,e)&&(Xn(this.gridColumns,o,e),this.updateDisplayedColumns(s),this.dispatchColumnMovedEvent({movedColumns:o,source:s,toIndex:e,finished:i}),this.columnAnimationService.finish())}doesMovePassRules(t,e){const s=this.getProposedColumnOrder(t,e);return this.doesOrderPassRules(s)}doesOrderPassRules(t){return!(!this.doesMovePassMarryChildren(t)||!this.doesMovePassLockedPositions(t))}getProposedColumnOrder(t,e){const s=this.gridColumns.slice();return Xn(s,t,e),s}sortColumnsLikeGridColumns(t){!t||t.length<=1||t.filter(s=>this.gridColumns.indexOf(s)<0).length>0||t.sort((s,i)=>{const o=this.gridColumns.indexOf(s),r=this.gridColumns.indexOf(i);return o-r})}doesMovePassLockedPositions(t){let e=0,s=!0;const i=o=>o?o===!0||o==="left"?0:2:1;return t.forEach(o=>{const r=i(o.getColDef().lockPosition);r<e&&(s=!1),e=r}),s}doesMovePassMarryChildren(t){let e=!0;return ns(null,this.gridBalancedTree,s=>{if(!(s instanceof Ie))return;const i=s,o=i.getColGroupDef();if(!(o&&o.marryChildren))return;const n=[];i.getLeafColumns().forEach(c=>{const m=t.indexOf(c);n.push(m)});const l=Math.max.apply(Math,n),a=Math.min.apply(Math,n),d=l-a,h=i.getLeafColumns().length-1;d>h&&(e=!1)}),e}moveColumnByIndex(t,e,s){if(!this.gridColumns)return;const i=this.gridColumns[t];this.moveColumns([i],e,s)}getColumnDefs(){if(!this.primaryColumns)return;const t=this.primaryColumns.slice();return this.gridColsArePrimary?t.sort((e,s)=>this.gridColumns.indexOf(e)-this.gridColumns.indexOf(s)):this.lastPrimaryOrder&&t.sort((e,s)=>this.lastPrimaryOrder.indexOf(e)-this.lastPrimaryOrder.indexOf(s)),this.columnDefFactory.buildColumnDefs(t,this.rowGroupColumns,this.pivotColumns)}getBodyContainerWidth(){return this.bodyWidth}getContainerWidth(t){switch(t){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}updateBodyWidths(){const t=this.getWidthOfColsInList(this.displayedColumnsCenter),e=this.getWidthOfColsInList(this.displayedColumnsLeft),s=this.getWidthOfColsInList(this.displayedColumnsRight);if(this.bodyWidthDirty=this.bodyWidth!==t,this.bodyWidth!==t||this.leftWidth!==e||this.rightWidth!==s){this.bodyWidth=t,this.leftWidth=e,this.rightWidth=s;const o={type:p.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED};this.eventService.dispatchEvent(o);const r={type:p.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED};this.eventService.dispatchEvent(r)}}getValueColumns(){return this.valueColumns?this.valueColumns:[]}getPivotColumns(){return this.pivotColumns?this.pivotColumns:[]}isPivotActive(){return this.pivotColumns&&this.pivotColumns.length>0&&this.pivotMode}getRowGroupColumns(){return this.rowGroupColumns?this.rowGroupColumns:[]}getDisplayedCenterColumns(){return this.displayedColumnsCenter}getDisplayedLeftColumns(){return this.displayedColumnsLeft}getDisplayedRightColumns(){return this.displayedColumnsRight}getAllPrimaryColumns(){return this.primaryColumns?this.primaryColumns:null}getSecondaryColumns(){return this.secondaryColumns?this.secondaryColumns:null}getAllColumnsForQuickFilter(){return this.columnsForQuickFilter}getAllGridColumns(){var t;return(t=this.gridColumns)!=null?t:[]}isRowGroupEmpty(){return bt(this.rowGroupColumns)}setColumnsVisible(t,e=!1,s){this.applyColumnState({state:t.map(i=>({colId:typeof i=="string"?i:i.getColId(),hide:!e}))},s)}setColumnsPinned(t,e,s){if(!this.gridColumns)return;if(this.gos.isDomLayout("print")){console.warn("AG Grid: Changing the column pinning status is not allowed with domLayout='print'");return}this.columnAnimationService.start();let i;e===!0||e==="left"?i="left":e==="right"?i="right":i=null,this.actionOnGridColumns(t,o=>o.getPinned()!==i?(o.setPinned(i),!0):!1,s,()=>({type:p.EVENT_COLUMN_PINNED,pinned:i,column:null,columns:null,source:s})),this.columnAnimationService.finish()}actionOnGridColumns(t,e,s,i){if(bt(t))return;const o=[];if(t.forEach(r=>{if(!r)return;const n=this.getGridColumn(r);if(!n)return;e(n)!==!1&&o.push(n)}),!!o.length&&(this.updateDisplayedColumns(s),P(i)&&i)){const r=i();r.columns=o,r.column=o.length===1?o[0]:null,this.eventService.dispatchEvent(r)}}getDisplayedColBefore(t){const e=this.getAllDisplayedColumns(),s=e.indexOf(t);return s>0?e[s-1]:null}getDisplayedColAfter(t){const e=this.getAllDisplayedColumns(),s=e.indexOf(t);return s<e.length-1?e[s+1]:null}getDisplayedGroupAtDirection(t,e){const s=t.getProvidedColumnGroup().getLevel()+t.getPaddingLevel(),i=t.getDisplayedLeafColumns(),o=e==="After"?ie(i):i[0],r=`getDisplayedCol${e}`;for(;;){const n=this[r](o);if(!n)return null;const l=this.getColumnGroupAtLevel(n,s);if(l!==t)return l}}getColumnGroupAtLevel(t,e){let s=t.getParent(),i,o;for(;i=s.getProvidedColumnGroup().getLevel(),o=s.getPaddingLevel(),!(i+o<=e);)s=s.getParent();return s}isPinningLeft(){return this.displayedColumnsLeft.length>0}isPinningRight(){return this.displayedColumnsRight.length>0}getPrimaryAndSecondaryAndAutoColumns(){return[].concat(this.primaryColumns||[],this.groupAutoColumns||[],this.secondaryColumns||[])}createStateItemFromColumn(t){const e=t.isRowGroupActive()?this.rowGroupColumns.indexOf(t):null,s=t.isPivotActive()?this.pivotColumns.indexOf(t):null,i=t.isValueActive()?t.getAggFunc():null,o=t.getSort()!=null?t.getSort():null,r=t.getSortIndex()!=null?t.getSortIndex():null,n=t.getFlex()!=null&&t.getFlex()>0?t.getFlex():null;return{colId:t.getColId(),width:t.getActualWidth(),hide:!t.isVisible(),pinned:t.getPinned(),sort:o,sortIndex:r,aggFunc:i,rowGroup:t.isRowGroupActive(),rowGroupIndex:e,pivot:t.isPivotActive(),pivotIndex:s,flex:n}}getColumnState(){if(z(this.primaryColumns)||!this.isAlive())return[];const e=this.getPrimaryAndSecondaryAndAutoColumns().map(this.createStateItemFromColumn.bind(this));return this.orderColumnStateList(e),e}orderColumnStateList(t){const e=Cs(this.gridColumns.map((s,i)=>[s.getColId(),i]));t.sort((s,i)=>{const o=e.has(s.colId)?e.get(s.colId):-1,r=e.has(i.colId)?e.get(i.colId):-1;return o-r})}resetColumnState(t){if(bt(this.primaryColumns))return;const e=this.getColumnsFromTree(this.primaryColumnTree),s=[];let i=1e3,o=1e3,r=[];this.groupAutoColumns&&(r=r.concat(this.groupAutoColumns)),e&&(r=r.concat(e)),r.forEach(n=>{const l=this.getColumnStateFromColDef(n);z(l.rowGroupIndex)&&l.rowGroup&&(l.rowGroupIndex=i++),z(l.pivotIndex)&&l.pivot&&(l.pivotIndex=o++),s.push(l)}),this.applyColumnState({state:s,applyOrder:!0},t)}getColumnStateFromColDef(t){const e=(v,S)=>v??S??null,s=t.getColDef(),i=e(s.sort,s.initialSort),o=e(s.sortIndex,s.initialSortIndex),r=e(s.hide,s.initialHide),n=e(s.pinned,s.initialPinned),l=e(s.width,s.initialWidth),a=e(s.flex,s.initialFlex);let d=e(s.rowGroupIndex,s.initialRowGroupIndex),h=e(s.rowGroup,s.initialRowGroup);d==null&&(h==null||h==!1)&&(d=null,h=null);let c=e(s.pivotIndex,s.initialPivotIndex),m=e(s.pivot,s.initialPivot);c==null&&(m==null||m==!1)&&(c=null,m=null);const C=e(s.aggFunc,s.initialAggFunc);return{colId:t.getColId(),sort:i,sortIndex:o,hide:r,pinned:n,width:l,flex:a,rowGroup:h,rowGroupIndex:d,pivot:m,pivotIndex:c,aggFunc:C}}applyColumnState(t,e){if(bt(this.primaryColumns))return!1;if(t&&t.state&&!t.state.forEach)return console.warn("AG Grid: applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state."),!1;const s=(r,n,l)=>{const a=this.compareColumnStatesAndDispatchEvents(e);this.autoGroupsNeedBuilding=!0;const d=n.slice(),h={},c={},m=[],C=[];let v=0;const S=this.rowGroupColumns.slice(),w=this.pivotColumns.slice();r.forEach(T=>{const D=T.colId||"";if(D.startsWith(yi)){m.push(T),C.push(T);return}const F=l(D);F?(this.syncColumnWithStateItem(F,T,t.defaultState,h,c,!1,e),dt(d,F)):(C.push(T),v+=1)});const R=T=>this.syncColumnWithStateItem(T,null,t.defaultState,h,c,!1,e);d.forEach(R);const y=(T,D,A,F)=>{const k=T[A.getId()],x=T[F.getId()],N=k!=null,G=x!=null;if(N&&G)return k-x;if(N)return-1;if(G)return 1;const U=D.indexOf(A),V=D.indexOf(F),te=U>=0,ae=V>=0;return te&&ae?U-V:te?-1:1};this.rowGroupColumns.sort(y.bind(this,h,S)),this.pivotColumns.sort(y.bind(this,c,w)),this.updateGridColumns();const b=this.groupAutoColumns?this.groupAutoColumns.slice():[];return m.forEach(T=>{const D=this.getAutoColumn(T.colId);dt(b,D),this.syncColumnWithStateItem(D,T,t.defaultState,null,null,!0,e)}),b.forEach(R),this.applyOrderAfterApplyState(t),this.updateDisplayedColumns(e),this.dispatchEverythingChanged(e),a(),{unmatchedAndAutoStates:C,unmatchedCount:v}};this.columnAnimationService.start();let{unmatchedAndAutoStates:i,unmatchedCount:o}=s(t.state||[],this.primaryColumns||[],r=>this.getPrimaryColumn(r));return(i.length>0||P(t.defaultState))&&(o=s(i,this.secondaryColumns||[],r=>this.getSecondaryColumn(r)).unmatchedCount),this.columnAnimationService.finish(),o===0}applyOrderAfterApplyState(t){if(!t.applyOrder||!t.state)return;let e=[];const s={};t.state.forEach(o=>{if(!o.colId||s[o.colId])return;const r=this.gridColumnsMap[o.colId];r&&(e.push(r),s[o.colId]=!0)});let i=0;if(this.gridColumns.forEach(o=>{const r=o.getColId();if(s[r]!=null)return;r.startsWith(yi)?fo(e,o,i++):e.push(o)}),e=this.placeLockedColumns(e),!this.doesMovePassMarryChildren(e)){console.warn("AG Grid: Applying column order broke a group where columns should be married together. Applying new order has been discarded.");return}this.gridColumns=e}compareColumnStatesAndDispatchEvents(t){const e={rowGroupColumns:this.rowGroupColumns.slice(),pivotColumns:this.pivotColumns.slice(),valueColumns:this.valueColumns.slice()},s=this.getColumnState(),i={};return s.forEach(o=>{i[o.colId]=o}),()=>{const o=this.getPrimaryAndSecondaryAndAutoColumns(),r=(S,w,R,y)=>{const b=w.map(y),T=R.map(y);if(jt(b,T))return;const A=new Set(w);R.forEach(x=>{A.delete(x)||A.add(x)});const F=[...A],k={type:S,columns:F,column:F.length===1?F[0]:null,source:t};this.eventService.dispatchEvent(k)},n=S=>{const w=[];return o.forEach(R=>{const y=i[R.getColId()];y&&S(y,R)&&w.push(R)}),w},l=S=>S.getColId();r(p.EVENT_COLUMN_ROW_GROUP_CHANGED,e.rowGroupColumns,this.rowGroupColumns,l),r(p.EVENT_COLUMN_PIVOT_CHANGED,e.pivotColumns,this.pivotColumns,l);const d=n((S,w)=>{const R=S.aggFunc!=null,y=R!=w.isValueActive(),b=R&&S.aggFunc!=w.getAggFunc();return y||b});d.length>0&&this.dispatchColumnChangedEvent(p.EVENT_COLUMN_VALUE_CHANGED,d,t);const h=(S,w)=>S.width!=w.getActualWidth();this.dispatchColumnResizedEvent(n(h),!0,t);const c=(S,w)=>S.pinned!=w.getPinned();this.dispatchColumnPinnedEvent(n(c),t);const m=(S,w)=>S.hide==w.isVisible();this.dispatchColumnVisibleEvent(n(m),t);const v=n((S,w)=>S.sort!=w.getSort()||S.sortIndex!=w.getSortIndex());v.length>0&&this.sortController.dispatchSortChangedEvents(t,v),this.normaliseColumnMovedEventForColumnState(s,t)}}getCommonValue(t,e){if(!t||t.length==0)return;const s=e(t[0]);for(let i=1;i<t.length;i++)if(s!==e(t[i]))return;return s}normaliseColumnMovedEventForColumnState(t,e){const s=this.getColumnState(),i={};s.forEach(a=>i[a.colId]=a);const o={};t.forEach(a=>{i[a.colId]&&(o[a.colId]=!0)});const r=t.filter(a=>o[a.colId]),n=s.filter(a=>o[a.colId]),l=[];n.forEach((a,d)=>{const h=r&&r[d];if(h&&h.colId!==a.colId){const c=this.getGridColumn(h.colId);c&&l.push(c)}}),l.length&&this.dispatchColumnMovedEvent({movedColumns:l,source:e,finished:!0})}syncColumnWithStateItem(t,e,s,i,o,r,n){var l;if(!t)return;const a=(T,D)=>{const A={value1:void 0,value2:void 0};let F=!1;return e&&(e[T]!==void 0&&(A.value1=e[T],F=!0),P(D)&&e[D]!==void 0&&(A.value2=e[D],F=!0)),!F&&s&&(s[T]!==void 0&&(A.value1=s[T]),P(D)&&s[D]!==void 0&&(A.value2=s[D])),A},d=a("hide").value1;d!==void 0&&t.setVisible(!d,n);const h=a("pinned").value1;h!==void 0&&t.setPinned(h);const c=(l=t.getColDef().minWidth)!=null?l:this.environment.getMinColWidth(),m=a("flex").value1;if(m!==void 0&&t.setFlex(m),m==null){const T=a("width").value1;T!=null&&c!=null&&T>=c&&t.setActualWidth(T,n)}const C=a("sort").value1;C!==void 0&&(C==="desc"||C==="asc"?t.setSort(C,n):t.setSort(void 0,n));const v=a("sortIndex").value1;if(v!==void 0&&t.setSortIndex(v),r||!t.isPrimary())return;const S=a("aggFunc").value1;S!==void 0&&(typeof S=="string"?(t.setAggFunc(S),t.isValueActive()||(t.setValueActive(!0,n),this.valueColumns.push(t))):(P(S)&&console.warn("AG Grid: stateItem.aggFunc must be a string. if using your own aggregation functions, register the functions first before using them in get/set state. This is because it is intended for the column state to be stored and retrieved as simple JSON."),t.isValueActive()&&(t.setValueActive(!1,n),dt(this.valueColumns,t))));const{value1:w,value2:R}=a("rowGroup","rowGroupIndex");(w!==void 0||R!==void 0)&&(typeof R=="number"||w?(t.isRowGroupActive()||(t.setRowGroupActive(!0,n),this.rowGroupColumns.push(t)),i&&typeof R=="number"&&(i[t.getId()]=R)):t.isRowGroupActive()&&(t.setRowGroupActive(!1,n),dt(this.rowGroupColumns,t)));const{value1:y,value2:b}=a("pivot","pivotIndex");(y!==void 0||b!==void 0)&&(typeof b=="number"||y?(t.isPivotActive()||(t.setPivotActive(!0,n),this.pivotColumns.push(t)),o&&typeof b=="number"&&(o[t.getId()]=b)):t.isPivotActive()&&(t.setPivotActive(!1,n),dt(this.pivotColumns,t)))}getGridColumns(t){return this.getColumns(t,this.getGridColumn.bind(this))}getColumns(t,e){const s=[];return t&&t.forEach(i=>{const o=e(i);o&&s.push(o)}),s}getColumnWithValidation(t){if(t==null)return null;const e=this.getGridColumn(t);return e||console.warn("AG Grid: could not find column "+t),e}getPrimaryColumn(t){return this.primaryColumns?this.getColumn(t,this.primaryColumns,this.primaryColumnsMap):null}getGridColumn(t){return this.getColumn(t,this.gridColumns,this.gridColumnsMap)}lookupGridColumn(t){return this.gridColumnsMap[t]}getSecondaryColumn(t){return this.secondaryColumns?this.getColumn(t,this.secondaryColumns,this.secondaryColumnsMap):null}getColumn(t,e,s){if(!t||!s)return null;if(typeof t=="string"&&s[t])return s[t];for(let i=0;i<e.length;i++)if(this.columnsMatch(e[i],t))return e[i];return this.getAutoColumn(t)}getSourceColumnsForGroupColumn(t){const e=t.getColDef().showRowGroup;if(!e)return null;if(e===!0)return this.rowGroupColumns.slice(0);const s=this.getPrimaryColumn(e);return s?[s]:null}getAutoColumn(t){return!this.groupAutoColumns||!P(this.groupAutoColumns)||z(this.groupAutoColumns)?null:this.groupAutoColumns.find(e=>this.columnsMatch(e,t))||null}columnsMatch(t,e){const s=t===e,i=t.getColDef()===e,o=t.getColId()==e;return s||i||o}getDisplayNameForColumn(t,e,s=!1){if(!t)return null;const i=this.getHeaderName(t.getColDef(),t,null,null,e);return s?this.wrapHeaderNameWithAggFunc(t,i):i}getDisplayNameForProvidedColumnGroup(t,e,s){const i=e?e.getColGroupDef():null;return i?this.getHeaderName(i,null,t,e,s):null}getDisplayNameForColumnGroup(t,e){return this.getDisplayNameForProvidedColumnGroup(t,t.getProvidedColumnGroup(),e)}getHeaderName(t,e,s,i,o){const r=t.headerValueGetter;if(r){const n=this.gos.addGridCommonParams({colDef:t,column:e,columnGroup:s,providedColumnGroup:i,location:o});return typeof r=="function"?r(n):typeof r=="string"?this.expressionService.evaluate(r,n):(console.warn("AG Grid: headerValueGetter must be a function or a string"),"")}else{if(t.headerName!=null)return t.headerName;if(t.field)return qd(t.field)}return""}wrapHeaderNameWithAggFunc(t,e){if(this.gos.get("suppressAggFuncInHeader"))return e;const s=t.getColDef().pivotValueColumn,i=P(s);let o=null,r;if(i){const n=this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&this.valueColumns.length===1,l=t.getColDef().pivotTotalColumnIds!==void 0;if(n&&!l)return e;o=s?s.getAggFunc():null,r=!0}else{const n=t.isValueActive(),l=this.pivotMode||!this.isRowGroupEmpty();n&&l?(o=t.getAggFunc(),r=!0):r=!1}if(r){const n=typeof o=="string"?o:"func";return`${this.localeService.getLocaleTextFunc()(n,n)}(${e})`}return e}getColumnGroup(t,e){if(!t)return null;if(t instanceof He)return t;const s=this.getAllDisplayedTrees(),i=typeof e=="number";let o=null;return Vs(s,!1,r=>{if(r instanceof He){const n=r;let l;i?l=t===n.getGroupId()&&e===n.getPartId():l=t===n.getGroupId(),l&&(o=n)}}),o}isReady(){return this.ready}extractValueColumns(t,e){this.valueColumns=this.extractColumns(e,this.valueColumns,(s,i)=>s.setValueActive(i,t),()=>{},()=>{},s=>{const i=s.aggFunc;if(i===null||i==="")return null;if(i!==void 0)return!!i},s=>s.initialAggFunc!=null&&s.initialAggFunc!=""),this.valueColumns.forEach(s=>{const i=s.getColDef();i.aggFunc!=null&&i.aggFunc!=""?s.setAggFunc(i.aggFunc):s.getAggFunc()||s.setAggFunc(i.initialAggFunc)})}extractRowGroupColumns(t,e){this.rowGroupColumns=this.extractColumns(e,this.rowGroupColumns,(s,i)=>s.setRowGroupActive(i,t),s=>s.rowGroupIndex,s=>s.initialRowGroupIndex,s=>s.rowGroup,s=>s.initialRowGroup)}extractColumns(t=[],e=[],s,i,o,r,n){const l=[],a=[];(this.primaryColumns||[]).forEach(c=>{const m=t.indexOf(c)<0,C=c.getColDef(),v=wr(r(C)),S=wr(n(C)),w=fs(i(C)),R=fs(o(C));let y;v!==void 0?y=v:w!==void 0?w===null?y=!1:y=w>=0:m?S!==void 0?y=S:R!==void 0?y=R!=null&&R>=0:y=!1:y=e.indexOf(c)>=0,y&&((m?w!=null||R!=null:w!=null)?l.push(c):a.push(c))});const d=c=>{const m=i(c.getColDef()),C=o(c.getColDef());return m??C};l.sort((c,m)=>{const C=d(c),v=d(m);return C===v?0:C<v?-1:1});const h=[].concat(l);return e.forEach(c=>{a.indexOf(c)>=0&&h.push(c)}),a.forEach(c=>{h.indexOf(c)<0&&h.push(c)}),e.forEach(c=>{h.indexOf(c)<0&&s(c,!1)}),h.forEach(c=>{e.indexOf(c)<0&&s(c,!0)}),h}extractPivotColumns(t,e){this.pivotColumns=this.extractColumns(e,this.pivotColumns,(s,i)=>s.setPivotActive(i,t),s=>s.pivotIndex,s=>s.initialPivotIndex,s=>s.pivot,s=>s.initialPivot)}resetColumnGroupState(t){if(!this.primaryColumnTree)return;const e=[];ns(null,this.primaryColumnTree,s=>{if(s instanceof Ie){const i=s.getColGroupDef(),o={groupId:s.getGroupId(),open:i?i.openByDefault:void 0};e.push(o)}}),this.setColumnGroupState(e,t)}getColumnGroupState(){const t=[];return ns(null,this.gridBalancedTree,e=>{e instanceof Ie&&t.push({groupId:e.getGroupId(),open:e.isExpanded()})}),t}setColumnGroupState(t,e){if(!this.gridBalancedTree)return;this.columnAnimationService.start();const s=[];if(t.forEach(i=>{const o=i.groupId,r=i.open,n=this.getProvidedColumnGroup(o);n&&n.isExpanded()!==r&&(this.logger.log("columnGroupOpened("+n.getGroupId()+","+r+")"),n.setExpanded(r),s.push(n))}),this.updateGroupsAndDisplayedColumns(e),this.setFirstRightAndLastLeftPinned(e),s.length){const i={type:p.EVENT_COLUMN_GROUP_OPENED,columnGroup:Ie.length===1?s[0]:void 0,columnGroups:s};this.eventService.dispatchEvent(i)}this.columnAnimationService.finish()}setColumnGroupOpened(t,e,s){let i;t instanceof Ie?i=t.getId():i=t||"",this.setColumnGroupState([{groupId:i,open:e}],s)}getProvidedColumnGroup(t){typeof t!="string"&&console.error("AG Grid: group key must be a string");let e=null;return ns(null,this.gridBalancedTree,s=>{s instanceof Ie&&s.getId()===t&&(e=s)}),e}calculateColumnsForDisplay(){let t;return this.pivotMode&&z(this.secondaryColumns)?t=this.gridColumns.filter(e=>{const s=this.groupAutoColumns&&wt(this.groupAutoColumns,e),i=this.valueColumns&&wt(this.valueColumns,e);return s||i}):t=this.gridColumns.filter(e=>this.groupAutoColumns&&wt(this.groupAutoColumns,e)||e.isVisible()),t}checkColSpanActiveInCols(t){let e=!1;return t.forEach(s=>{P(s.getColDef().colSpan)&&(e=!0)}),e}calculateColumnsForGroupDisplay(){this.groupDisplayColumns=[],this.groupDisplayColumnsMap={};const t=e=>{const s=e.getColDef(),i=s.showRowGroup;s&&P(i)&&(this.groupDisplayColumns.push(e),typeof i=="string"?this.groupDisplayColumnsMap[i]=e:i===!0&&this.getRowGroupColumns().forEach(o=>{this.groupDisplayColumnsMap[o.getId()]=e}))};this.gridColumns.forEach(t)}getGroupDisplayColumns(){return this.groupDisplayColumns}getGroupDisplayColumnForGroup(t){return this.groupDisplayColumnsMap[t]}updateDisplayedColumns(t){const e=this.calculateColumnsForDisplay();this.buildDisplayedTrees(e),this.updateGroupsAndDisplayedColumns(t),this.setFirstRightAndLastLeftPinned(t)}isSecondaryColumnsPresent(){return P(this.secondaryColumns)}setSecondaryColumns(t,e){if(!this.gridColumns)return;const s=t;if(!(!s&&z(this.secondaryColumns))){if(s){this.processSecondaryColumnDefinitions(t);const i=this.columnFactory.createColumnTree(t,!1,this.secondaryBalancedTree||this.previousSecondaryColumns||void 0,e);this.destroyOldColumns(this.secondaryBalancedTree,i.columnTree),this.secondaryBalancedTree=i.columnTree,this.secondaryHeaderRowCount=i.treeDept+1,this.secondaryColumns=this.getColumnsFromTree(this.secondaryBalancedTree),this.secondaryColumnsMap={},this.secondaryColumns.forEach(o=>this.secondaryColumnsMap[o.getId()]=o),this.previousSecondaryColumns=null}else this.previousSecondaryColumns=this.secondaryBalancedTree,this.secondaryBalancedTree=null,this.secondaryHeaderRowCount=-1,this.secondaryColumns=null,this.secondaryColumnsMap={};this.updateGridColumns(),this.updateDisplayedColumns(e)}}processSecondaryColumnDefinitions(t){const e=this.gos.get("processPivotResultColDef"),s=this.gos.get("processPivotResultColGroupDef");if(!e&&!s)return;const i=o=>{o.forEach(r=>{if(P(r.children)){const l=r;s&&s(l),i(l.children)}else e&&e(r)})};t&&i(t)}updateGridColumns(){const t=this.gridBalancedTree;if(this.gridColsArePrimary?this.lastPrimaryOrder=this.gridColumns:this.lastSecondaryOrder=this.gridColumns,this.createGroupAutoColumnsIfNeeded()){const i=Cs(this.groupAutoColumns.map(o=>[o,!0]));this.lastPrimaryOrder&&(this.lastPrimaryOrder=this.lastPrimaryOrder.filter(o=>!i.has(o)),this.lastPrimaryOrder=[...this.groupAutoColumns,...this.lastPrimaryOrder]),this.lastSecondaryOrder&&(this.lastSecondaryOrder=this.lastSecondaryOrder.filter(o=>!i.has(o)),this.lastSecondaryOrder=[...this.groupAutoColumns,...this.lastSecondaryOrder])}let s;if(this.secondaryColumns&&this.secondaryBalancedTree){const i=this.secondaryColumns.some(o=>this.gridColumnsMap[o.getColId()]!==void 0);this.gridBalancedTree=this.secondaryBalancedTree.slice(),this.gridHeaderRowCount=this.secondaryHeaderRowCount,this.gridColumns=this.secondaryColumns.slice(),this.gridColsArePrimary=!1,i&&(s=this.lastSecondaryOrder)}else this.primaryColumns&&(this.gridBalancedTree=this.primaryColumnTree.slice(),this.gridHeaderRowCount=this.primaryHeaderRowCount,this.gridColumns=this.primaryColumns.slice(),this.gridColsArePrimary=!0,s=this.lastPrimaryOrder);if(this.addAutoGroupToGridColumns(),this.orderGridColsLike(s),this.gridColumns=this.placeLockedColumns(this.gridColumns),this.calculateColumnsForGroupDisplay(),this.refreshQuickFilterColumns(),this.clearDisplayedAndViewportColumns(),this.colSpanActive=this.checkColSpanActiveInCols(this.gridColumns),this.gridColumnsMap={},this.gridColumns.forEach(i=>this.gridColumnsMap[i.getId()]=i),this.setAutoHeightActive(),!jt(t,this.gridBalancedTree)){const i={type:p.EVENT_GRID_COLUMNS_CHANGED};this.eventService.dispatchEvent(i)}}setAutoHeightActive(){this.autoHeightActive=this.gridColumns.filter(t=>t.isAutoHeight()).length>0,this.autoHeightActive&&(this.autoHeightActiveAtLeastOnce=!0,this.gos.isRowModelType("clientSide")||this.gos.isRowModelType("serverSide")||H("autoHeight columns only work with Client Side Row Model and Server Side Row Model."))}orderGridColsLike(t){if(z(t))return;const e=Cs(t.map((a,d)=>[a,d]));let s=!0;if(this.gridColumns.forEach(a=>{e.has(a)&&(s=!1)}),s)return;const i=Cs(this.gridColumns.map(a=>[a,!0])),o=t.filter(a=>i.has(a)),r=Cs(o.map(a=>[a,!0])),n=this.gridColumns.filter(a=>!r.has(a)),l=o.slice();n.forEach(a=>{let d=a.getOriginalParent();if(!d){l.push(a);return}const h=[];for(;!h.length&&d;)d.getLeafColumns().forEach(v=>{const S=l.indexOf(v)>=0,w=h.indexOf(v)<0;S&&w&&h.push(v)}),d=d.getOriginalParent();if(!h.length){l.push(a);return}const c=h.map(C=>l.indexOf(C)),m=Math.max(...c);fo(l,a,m+1)}),this.gridColumns=l}isPrimaryColumnGroupsPresent(){return this.primaryHeaderRowCount>1}refreshQuickFilterColumns(){var t;let e=(t=this.isPivotMode()&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")?this.secondaryColumns:this.primaryColumns)!=null?t:[];this.groupAutoColumns&&(e=e.concat(this.groupAutoColumns)),this.columnsForQuickFilter=this.gos.get("includeHiddenColumnsInQuickFilter")?e:e.filter(s=>s.isVisible()||s.isRowGroupActive())}placeLockedColumns(t){const e=[],s=[],i=[];return t.forEach(o=>{const r=o.getColDef().lockPosition;r==="right"?i.push(o):r==="left"||r===!0?e.push(o):s.push(o)}),[...e,...s,...i]}addAutoGroupToGridColumns(){if(z(this.groupAutoColumns)){this.destroyOldColumns(this.groupAutoColsBalancedTree),this.groupAutoColsBalancedTree=null;return}this.gridColumns=this.groupAutoColumns?this.groupAutoColumns.concat(this.gridColumns):this.gridColumns;const t=this.columnFactory.createForAutoGroups(this.groupAutoColumns,this.gridBalancedTree);this.destroyOldColumns(this.groupAutoColsBalancedTree,t),this.groupAutoColsBalancedTree=t,this.gridBalancedTree=t.concat(this.gridBalancedTree)}clearDisplayedAndViewportColumns(){this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={},this.displayedColumnsLeft=[],this.displayedColumnsRight=[],this.displayedColumnsCenter=[],this.displayedColumns=[],this.ariaOrderColumns=[],this.viewportColumns=[],this.headerViewportColumns=[],this.viewportColumnsHash=""}updateGroupsAndDisplayedColumns(t){this.updateOpenClosedVisibilityInColumnGroups(),this.deriveDisplayedColumns(t),this.refreshFlexedColumns(),this.extractViewport(),this.updateBodyWidths();const e={type:p.EVENT_DISPLAYED_COLUMNS_CHANGED};this.eventService.dispatchEvent(e)}deriveDisplayedColumns(t){this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeLeft,this.displayedColumnsLeft),this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeCentre,this.displayedColumnsCenter),this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeRight,this.displayedColumnsRight),this.joinColumnsAriaOrder(),this.joinDisplayedColumns(),this.setLeftValues(t),this.displayedAutoHeightCols=this.displayedColumns.filter(e=>e.isAutoHeight())}isAutoRowHeightActive(){return this.autoHeightActive}wasAutoRowHeightEverActive(){return this.autoHeightActiveAtLeastOnce}joinColumnsAriaOrder(){const t=this.getAllGridColumns(),e=[],s=[],i=[];for(const o of t){const r=o.getPinned();r?r===!0||r==="left"?e.push(o):i.push(o):s.push(o)}this.ariaOrderColumns=e.concat(s).concat(i)}joinDisplayedColumns(){this.gos.get("enableRtl")?this.displayedColumns=this.displayedColumnsRight.concat(this.displayedColumnsCenter).concat(this.displayedColumnsLeft):this.displayedColumns=this.displayedColumnsLeft.concat(this.displayedColumnsCenter).concat(this.displayedColumnsRight)}setLeftValues(t){this.setLeftValuesOfColumns(t),this.setLeftValuesOfGroups()}setLeftValuesOfColumns(t){if(!this.primaryColumns)return;const e=this.getPrimaryAndSecondaryAndAutoColumns().slice(0),s=this.gos.get("enableRtl");[this.displayedColumnsLeft,this.displayedColumnsRight,this.displayedColumnsCenter].forEach(i=>{if(s){let o=this.getWidthOfColsInList(i);i.forEach(r=>{o-=r.getActualWidth(),r.setLeft(o,t)})}else{let o=0;i.forEach(r=>{r.setLeft(o,t),o+=r.getActualWidth()})}Hd(e,i)}),e.forEach(i=>{i.setLeft(null,t)})}setLeftValuesOfGroups(){[this.displayedTreeLeft,this.displayedTreeRight,this.displayedTreeCentre].forEach(t=>{t.forEach(e=>{e instanceof He&&e.checkLeft()})})}derivedDisplayedColumnsFromDisplayedTree(t,e){e.length=0,Vs(t,!0,s=>{s instanceof fe&&e.push(s)})}isColumnVirtualisationSuppressed(){return this.suppressColumnVirtualisation||this.viewportRight===0}extractViewportColumns(){this.isColumnVirtualisationSuppressed()?(this.viewportColumnsCenter=this.displayedColumnsCenter,this.headerViewportColumnsCenter=this.displayedColumnsCenter):(this.viewportColumnsCenter=this.displayedColumnsCenter.filter(this.isColumnInRowViewport.bind(this)),this.headerViewportColumnsCenter=this.displayedColumnsCenter.filter(this.isColumnInHeaderViewport.bind(this))),this.viewportColumns=this.viewportColumnsCenter.concat(this.displayedColumnsLeft).concat(this.displayedColumnsRight),this.headerViewportColumns=this.headerViewportColumnsCenter.concat(this.displayedColumnsLeft).concat(this.displayedColumnsRight)}getVirtualHeaderGroupRow(t,e){let s;switch(t){case"left":s=this.viewportRowLeft[e];break;case"right":s=this.viewportRowRight[e];break;default:s=this.viewportRowCenter[e];break}return z(s)&&(s=[]),s}calculateHeaderRows(){this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={};const t={};this.headerViewportColumns.forEach(s=>t[s.getId()]=!0);const e=(s,i,o)=>{let r=!1;for(let n=0;n<s.length;n++){const l=s[n];let a=!1;if(l instanceof fe)a=t[l.getId()]===!0;else{const h=l.getDisplayedChildren();h&&(a=e(h,i,o+1))}a&&(r=!0,i[o]||(i[o]=[]),i[o].push(l))}return r};e(this.displayedTreeLeft,this.viewportRowLeft,0),e(this.displayedTreeRight,this.viewportRowRight,0),e(this.displayedTreeCentre,this.viewportRowCenter,0)}extractViewport(){const t=i=>`${i.getId()}-${i.getPinned()||"normal"}`;this.extractViewportColumns();const e=this.viewportColumns.map(t).join("#"),s=this.viewportColumnsHash!==e;return s&&(this.viewportColumnsHash=e,this.calculateHeaderRows()),s}refreshFlexedColumns(t={}){var e;const s=t.source?t.source:"flex";if(t.viewportWidth!=null&&(this.flexViewportWidth=t.viewportWidth),!this.flexViewportWidth)return[];let i=-1;if(t.resizingCols){const m=new Set(t.resizingCols);let C=this.displayedColumnsCenter;for(let v=C.length-1;v>=0;v--)if(m.has(C[v])){i=v;break}}let o=0,r=[],n=0,l=0;for(let m=0;m<this.displayedColumnsCenter.length;m++)this.displayedColumnsCenter[m].getFlex()&&m>i?(r.push(this.displayedColumnsCenter[m]),l+=this.displayedColumnsCenter[m].getFlex(),n+=(e=this.displayedColumnsCenter[m].getMinWidth())!=null?e:0):o+=this.displayedColumnsCenter[m].getActualWidth();if(!r.length)return[];let a=[];o+n>this.flexViewportWidth&&(r.forEach(m=>{var C;return m.setActualWidth((C=m.getMinWidth())!=null?C:0,s)}),a=r,r=[]);const d=[];let h;e:for(;;){h=this.flexViewportWidth-o;const m=h/l;for(let C=0;C<r.length;C++){const v=r[C],S=m*v.getFlex();let w=0;const R=v.getMinWidth(),y=v.getMaxWidth();if(P(R)&&S<R?w=R:P(y)&&S>y&&(w=y),w){v.setActualWidth(w,s),qn(r,v),l-=v.getFlex(),a.push(v),o+=v.getActualWidth();continue e}d[C]=Math.round(S)}break}let c=h;return r.forEach((m,C)=>{m.setActualWidth(Math.min(d[C],c),s),a.push(m),c-=d[C]}),t.skipSetLeft||this.setLeftValues(s),t.updateBodyWidths&&this.updateBodyWidths(),t.fireResizedEvent&&this.dispatchColumnResizedEvent(a,!0,s,r),r}sizeColumnsToFit(t,e="sizeColumnsToFit",s,i){var o,r,n,l,a;if(this.shouldQueueResizeOperations){this.resizeOperationQueue.push(()=>this.sizeColumnsToFit(t,e,s,i));return}const d={};i&&((o=i==null?void 0:i.columnLimits)==null||o.forEach(R=>{var y=R,{key:b}=y,T=Jp(y,["key"]);d[typeof b=="string"?b:b.getColId()]=T}));const h=this.getAllDisplayedColumns(),c=t===this.getWidthOfColsInList(h);if(t<=0||!h.length||c)return;const m=[],C=[];h.forEach(R=>{R.getColDef().suppressSizeToFit===!0?C.push(R):m.push(R)});const v=m.slice(0);let S=!1;const w=R=>{dt(m,R),C.push(R)};for(m.forEach(R=>{var y,b;R.resetActualWidth(e);const T=d==null?void 0:d[R.getId()],D=(y=T==null?void 0:T.minWidth)!=null?y:i==null?void 0:i.defaultMinWidth,A=(b=T==null?void 0:T.maxWidth)!=null?b:i==null?void 0:i.defaultMaxWidth,F=R.getActualWidth();typeof D=="number"&&F<D?R.setActualWidth(D,e,!0):typeof A=="number"&&F>A&&R.setActualWidth(A,e,!0)});!S;){S=!0;const R=t-this.getWidthOfColsInList(C);if(R<=0)m.forEach(y=>{var b,T;const D=(T=(b=d==null?void 0:d[y.getId()])==null?void 0:b.minWidth)!=null?T:i==null?void 0:i.defaultMinWidth;if(typeof D=="number"){y.setActualWidth(D,e,!0);return}y.setMinimum(e)});else{const y=R/this.getWidthOfColsInList(m);let b=R;for(let T=m.length-1;T>=0;T--){const D=m[T],A=d==null?void 0:d[D.getId()],F=(r=A==null?void 0:A.minWidth)!=null?r:i==null?void 0:i.defaultMinWidth,k=(n=A==null?void 0:A.maxWidth)!=null?n:i==null?void 0:i.defaultMaxWidth,x=(l=D.getMinWidth())!=null?l:0,N=(a=D.getMaxWidth())!=null?a:Number.MAX_VALUE,G=typeof F=="number"&&F>x?F:D.getMinWidth(),U=typeof k=="number"&&k<N?k:D.getMaxWidth();let V=Math.round(D.getActualWidth()*y);P(G)&&V<G?(V=G,w(D),S=!1):P(U)&&V>U?(V=U,w(D),S=!1):T===0&&(V=b),D.setActualWidth(V,e,!0),b-=V}}}v.forEach(R=>{R.fireColumnWidthChangedEvent(e)}),this.setLeftValues(e),this.updateBodyWidths(),!s&&this.dispatchColumnResizedEvent(v,!0,e)}buildDisplayedTrees(t){const e=[],s=[],i=[];t.forEach(r=>{switch(r.getPinned()){case"left":e.push(r);break;case"right":s.push(r);break;default:i.push(r);break}});const o=new Yd;this.displayedTreeLeft=this.displayedGroupCreator.createDisplayedGroups(e,o,"left",this.displayedTreeLeft),this.displayedTreeRight=this.displayedGroupCreator.createDisplayedGroups(s,o,"right",this.displayedTreeRight),this.displayedTreeCentre=this.displayedGroupCreator.createDisplayedGroups(i,o,null,this.displayedTreeCentre),this.updateDisplayedMap()}updateDisplayedMap(){this.displayedColumnsAndGroupsMap={};const t=e=>{this.displayedColumnsAndGroupsMap[e.getUniqueId()]=e};Vs(this.displayedTreeCentre,!1,t),Vs(this.displayedTreeLeft,!1,t),Vs(this.displayedTreeRight,!1,t)}isDisplayed(t){return this.displayedColumnsAndGroupsMap[t.getUniqueId()]===t}updateOpenClosedVisibilityInColumnGroups(){const t=this.getAllDisplayedTrees();Vs(t,!1,e=>{e instanceof He&&e.calculateDisplayedColumns()})}getGroupAutoColumns(){return this.groupAutoColumns}createGroupAutoColumnsIfNeeded(){const t=this.forceRecreateAutoGroups;if(this.forceRecreateAutoGroups=!1,!this.autoGroupsNeedBuilding)return!1;this.autoGroupsNeedBuilding=!1;const e=this.gos.isGroupUseEntireRow(this.pivotMode),s=this.pivotMode?this.gos.get("pivotSuppressAutoColumn"):this.isGroupSuppressAutoColumn();if((this.rowGroupColumns.length>0||this.gos.get("treeData"))&&!s&&!e){const r=this.autoGroupColService.createAutoGroupColumns(this.rowGroupColumns);if(!this.autoColsEqual(r,this.groupAutoColumns)||t)return this.groupAutoColumns=r,!0}else this.groupAutoColumns=null;return!1}isGroupSuppressAutoColumn(){return this.gos.get("groupDisplayType")==="custom"?!0:this.gos.get("treeDataDisplayType")==="custom"}autoColsEqual(t,e){return jt(t,e,(s,i)=>s.getColId()===i.getColId())}getWidthOfColsInList(t){return t.reduce((e,s)=>e+s.getActualWidth(),0)}getFirstDisplayedColumn(){const t=this.gos.get("enableRtl"),e=["getDisplayedLeftColumns","getDisplayedCenterColumns","getDisplayedRightColumns"];t&&e.reverse();for(let s=0;s<e.length;s++){const i=this[e[s]]();if(i.length)return t?ie(i):i[0]}return null}setColumnHeaderHeight(t,e){if(t.setAutoHeaderHeight(e)){const i={type:p.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,column:t,columns:[t],source:"autosizeColumnHeaderHeight"};this.eventService.dispatchEvent(i)}}getColumnGroupHeaderRowHeight(){return this.isPivotMode()?this.getPivotGroupHeaderHeight():this.getGroupHeaderHeight()}getColumnHeaderRowHeight(){const t=this.isPivotMode()?this.getPivotHeaderHeight():this.getHeaderHeight(),e=this.getAllDisplayedColumns().filter(s=>s.isAutoHeaderHeight()).map(s=>s.getAutoHeaderHeight()||0);return Math.max(t,...e)}getHeaderHeight(){var t;return(t=this.gos.get("headerHeight"))!=null?t:this.environment.getFromTheme(25,"headerHeight")}getFloatingFiltersHeight(){var t;return(t=this.gos.get("floatingFiltersHeight"))!=null?t:this.getHeaderHeight()}getGroupHeaderHeight(){var t;return(t=this.gos.get("groupHeaderHeight"))!=null?t:this.getHeaderHeight()}getPivotHeaderHeight(){var t;return(t=this.gos.get("pivotHeaderHeight"))!=null?t:this.getHeaderHeight()}getPivotGroupHeaderHeight(){var t;return(t=this.gos.get("pivotGroupHeaderHeight"))!=null?t:this.getGroupHeaderHeight()}queueResizeOperations(){this.shouldQueueResizeOperations=!0}processResizeOperations(){this.shouldQueueResizeOperations=!1,this.resizeOperationQueue.forEach(t=>t()),this.resizeOperationQueue=[]}resetColumnDefIntoColumn(t,e){const s=t.getUserProvidedColDef();if(!s)return!1;const i=this.columnFactory.addColumnDefaultAndTypes(s,t.getColId());return t.setColDef(i,s,e),!0}isColumnGroupingLocked(t){const e=this.gos.get("groupLockGroupColumns");if(!t.isRowGroupActive()||e===0)return!1;if(e===-1)return!0;const s=this.rowGroupColumns.findIndex(i=>i.getColId()===t.getColId());return e>s}generateColumnStateForRowGroupAndPivotIndexes(t,e){let s={};const i=(o,r,n,l,a,d)=>{if(!r.length||!this.primaryColumns)return[];const h=Object.keys(o),c=new Set(h),m=new Set(h),C=new Set(r.map(D=>{const A=D.getColId();return m.delete(A),A}).concat(h)),v=[],S={};let w=0;for(let D=0;D<this.primaryColumns.length;D++){const A=this.primaryColumns[D].getColId();C.has(A)&&(v.push(A),S[A]=w++)}let R=1e3,y=!1,b=0;const T=D=>{const A=S[D];for(let F=b;F<A;F++){const k=v[F];m.has(k)&&(o[k][a]=R++,m.delete(k))}b=A};r.forEach(D=>{const A=D.getColId();if(c.has(A))T(A),o[A][a]=R++;else{const F=D.getColDef();(F[a]===null||F[a]===void 0&&F[d]==null)&&(y||(F[n]||F[n]===void 0&&F[l]?T(A):(m.forEach(N=>{o[N][a]=R+S[N]}),R+=v.length,y=!0)),s[A]||(s[A]={colId:A}),s[A][a]=R++)}})};return i(t,this.rowGroupColumns,"rowGroup","initialRowGroup","rowGroupIndex","initialRowGroupIndex"),i(e,this.pivotColumns,"pivot","initialPivot","pivotIndex","initialPivotIndex"),Object.values(s)}onColumnsReady(){const t=this.gos.get("autoSizeStrategy");if(!t)return;const{type:e}=t;setTimeout(()=>{if(e==="fitGridWidth"){const{columnLimits:s,defaultMinWidth:i,defaultMaxWidth:o}=t,r=s==null?void 0:s.map(({colId:n,minWidth:l,maxWidth:a})=>({key:n,minWidth:l,maxWidth:a}));this.ctrlsService.getGridBodyCtrl().sizeColumnsToFit({defaultMinWidth:i,defaultMaxWidth:o,columnLimits:r})}else e==="fitProvidedWidth"&&this.sizeColumnsToFit(t.width,"sizeColumnsToFit")})}onFirstDataRendered(){const t=this.gos.get("autoSizeStrategy");if((t==null?void 0:t.type)!=="fitCellContents")return;const{colIds:e,skipHeader:s}=t;setTimeout(()=>{e?this.autoSizeColumns({columns:e,skipHeader:s,source:"autosizeColumns"}):this.autoSizeAllColumns("autosizeColumns",s)})}};u([f("expressionService")],Ue.prototype,"expressionService",2),u([f("columnFactory")],Ue.prototype,"columnFactory",2),u([f("displayedGroupCreator")],Ue.prototype,"displayedGroupCreator",2),u([f("ctrlsService")],Ue.prototype,"ctrlsService",2),u([f("autoWidthCalculator")],Ue.prototype,"autoWidthCalculator",2),u([f("columnAnimationService")],Ue.prototype,"columnAnimationService",2),u([f("autoGroupColService")],Ue.prototype,"autoGroupColService",2),u([f("valueCache")],Ue.prototype,"valueCache",2),u([f("animationFrameService")],Ue.prototype,"animationFrameService",2),u([f("sortController")],Ue.prototype,"sortController",2),u([f("columnDefFactory")],Ue.prototype,"columnDefFactory",2),u([he("aggFuncService")],Ue.prototype,"aggFuncService",2),u([M],Ue.prototype,"init",1),u([tt],Ue.prototype,"destroyColumns",1),u([xt(0,Tt("loggerFactory"))],Ue.prototype,"setBeans",1),Ue=u([O("columnModel")],Ue);function Ri(t){return t==="gridOptionsUpdated"?"gridOptionsChanged":t}function Vs(t,e,s){if(t)for(let i=0;i<t.length;i++){const o=t[i];if(o instanceof He){const r=e?o.getDisplayedChildren():o.getChildren();Vs(r,e,s)}s(o)}}var el=class extends L{createDisplayedGroups(t,e,s,i){const o=this.mapOldGroupsById(i),r=[];let n=t;for(;n.length;){const l=n;n=[];let a=0;const d=h=>{const c=a;a=h;const m=l[c],v=(m instanceof He?m.getProvidedColumnGroup():m).getOriginalParent();if(v==null){for(let w=c;w<h;w++)r.push(l[w]);return}const S=this.createColumnGroup(v,e,o,s);for(let w=c;w<h;w++)S.addChild(l[w]);n.push(S)};for(let h=1;h<l.length;h++){const c=l[h],C=(c instanceof He?c.getProvidedColumnGroup():c).getOriginalParent(),v=l[a],w=(v instanceof He?v.getProvidedColumnGroup():v).getOriginalParent();C!==w&&d(h)}a<l.length&&d(l.length)}return this.setupParentsIntoColumns(r,null),r}createColumnGroup(t,e,s,i){const o=t.getGroupId(),r=e.getInstanceIdForKey(o),n=He.createUniqueId(o,r);let l=s[n];return l&&l.getProvidedColumnGroup()!==t&&(l=null),P(l)?l.reset():(l=new He(t,o,r,i),this.context.createBean(l)),l}mapOldGroupsById(t){const e={},s=i=>{i.forEach(o=>{if(o instanceof He){const r=o;e[o.getUniqueId()]=r,s(r.getChildren())}})};return t&&s(t),e}setupParentsIntoColumns(t,e){t.forEach(s=>{if(s.setParent(e),s instanceof He){const i=s;this.setupParentsIntoColumns(i.getChildren(),i)}})}};el=u([O("displayedGroupCreator")],el);var vg={enableBrowserTooltips:!0,tooltipTrigger:!0,tooltipMouseTrack:!0,tooltipShowMode:!0,tooltipInteraction:!0,defaultColGroupDef:!0,suppressAutoSize:!0,skipHeaderOnAutoSize:!0,autoSizeStrategy:!0,components:!0,stopEditingWhenCellsLoseFocus:!0,undoRedoCellEditing:!0,undoRedoCellEditingLimit:!0,excelStyles:!0,cacheQuickFilter:!0,excludeHiddenColumnsFromQuickFilter:!0,advancedFilterModel:!0,customChartThemes:!0,chartThemeOverrides:!0,enableChartToolPanelsButton:!0,suppressChartToolPanelsButton:!0,chartToolPanelsDef:!0,loadingCellRendererSelector:!0,localeText:!0,keepDetailRows:!0,keepDetailRowsCount:!0,detailRowHeight:!0,detailRowAutoHeight:!0,tabIndex:!0,valueCache:!0,valueCacheNeverExpires:!0,enableCellExpressions:!0,suppressParentsInRowNodes:!0,suppressTouch:!0,suppressAsyncEvents:!0,suppressBrowserResizeObserver:!0,suppressPropertyNamesCheck:!0,debug:!0,loadingOverlayComponent:!0,suppressLoadingOverlay:!0,noRowsOverlayComponent:!0,paginationPageSizeSelector:!0,paginateChildRows:!0,pivotPanelShow:!0,pivotSuppressAutoColumn:!0,suppressExpandablePivotGroups:!0,aggFuncs:!0,suppressAggFuncInHeader:!0,suppressAggAtRootLevel:!0,removePivotHeaderRowWhenSingleValueColumn:!0,allowShowChangeAfterFilter:!0,ensureDomOrder:!0,enableRtl:!0,suppressColumnVirtualisation:!0,suppressMaxRenderedRowRestriction:!0,suppressRowVirtualisation:!0,rowDragText:!0,suppressGroupMaintainValueType:!0,groupLockGroupColumns:!0,rowGroupPanelSuppressSort:!0,suppressGroupRowsSticky:!0,rowModelType:!0,cacheOverflowSize:!0,infiniteInitialRowCount:!0,serverSideInitialRowCount:!0,suppressServerSideInfiniteScroll:!0,maxBlocksInCache:!0,maxConcurrentDatasourceRequests:!0,blockLoadDebounceMillis:!0,serverSideOnlyRefreshFilteredGroups:!0,serverSidePivotResultFieldSeparator:!0,viewportRowModelPageSize:!0,viewportRowModelBufferSize:!0,debounceVerticalScrollbar:!0,suppressAnimationFrame:!0,suppressPreventDefaultOnMouseWheel:!0,scrollbarWidth:!0,icons:!0,suppressRowTransform:!0,gridId:!0,functionsPassive:!0,enableGroupEdit:!0,initialState:!0,processUnpinnedColumns:!0,createChartContainer:!0,getLocaleText:!0,getRowId:!0,reactiveCustomComponents:!0,columnMenu:!0},Oe=class{};Oe.STRING_PROPERTIES=["rowSelection","overlayLoadingTemplate","overlayNoRowsTemplate","gridId","quickFilterText","rowModelType","editType","domLayout","clipboardDelimiter","rowGroupPanelShow","multiSortKey","pivotColumnGroupTotals","pivotRowTotals","pivotPanelShow","fillHandleDirection","groupDisplayType","treeDataDisplayType","colResizeDefault","tooltipTrigger","serverSidePivotResultFieldSeparator","columnMenu","tooltipShowMode","grandTotalRow"],Oe.OBJECT_PROPERTIES=["components","rowStyle","context","autoGroupColumnDef","localeText","icons","datasource","serverSideDatasource","viewportDatasource","groupRowRendererParams","aggFuncs","fullWidthCellRendererParams","defaultColGroupDef","defaultColDef","defaultCsvExportParams","defaultExcelExportParams","columnTypes","rowClassRules","detailCellRendererParams","loadingCellRendererParams","loadingOverlayComponentParams","noRowsOverlayComponentParams","popupParent","statusBar","sideBar","chartThemeOverrides","customChartThemes","chartToolPanelsDef","dataTypeDefinitions","advancedFilterModel","advancedFilterParent","advancedFilterBuilderParams","initialState","autoSizeStrategy"],Oe.ARRAY_PROPERTIES=["sortingOrder","alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData","chartThemes","rowClass","paginationPageSizeSelector"],Oe.NUMBER_PROPERTIES=["rowHeight","detailRowHeight","rowBuffer","headerHeight","groupHeaderHeight","groupLockGroupColumns","floatingFiltersHeight","pivotHeaderHeight","pivotGroupHeaderHeight","groupDefaultExpanded","pivotDefaultExpanded","viewportRowModelPageSize","viewportRowModelBufferSize","autoSizePadding","maxBlocksInCache","maxConcurrentDatasourceRequests","tooltipShowDelay","tooltipHideDelay","cacheOverflowSize","paginationPageSize","cacheBlockSize","infiniteInitialRowCount","serverSideInitialRowCount","scrollbarWidth","asyncTransactionWaitMillis","blockLoadDebounceMillis","keepDetailRowsCount","undoRedoCellEditingLimit","cellFlashDelay","cellFadeDelay","cellFlashDuration","cellFadeDuration","tabIndex","pivotMaxGeneratedColumns"],Oe.BOOLEAN_PROPERTIES=["suppressMakeColumnVisibleAfterUnGroup","suppressRowClickSelection","suppressCellFocus","suppressHeaderFocus","suppressHorizontalScroll","groupSelectsChildren","alwaysShowHorizontalScroll","alwaysShowVerticalScroll","debug","enableBrowserTooltips","enableCellExpressions","groupIncludeTotalFooter","groupSuppressBlankHeader","suppressMenuHide","suppressRowDeselection","unSortIcon","suppressMultiSort","alwaysMultiSort","singleClickEdit","suppressLoadingOverlay","suppressNoRowsOverlay","suppressAutoSize","skipHeaderOnAutoSize","suppressParentsInRowNodes","suppressColumnMoveAnimation","suppressMovableColumns","suppressFieldDotNotation","enableRangeSelection","enableRangeHandle","enableFillHandle","suppressClearOnFillReduction","deltaSort","suppressTouch","suppressAsyncEvents","allowContextMenuWithControlKey","suppressContextMenu","enableCellChangeFlash","suppressDragLeaveHidesColumns","suppressRowGroupHidesColumns","suppressMiddleClickScrolls","suppressPreventDefaultOnMouseWheel","suppressCopyRowsToClipboard","copyHeadersToClipboard","copyGroupHeadersToClipboard","pivotMode","suppressAggFuncInHeader","suppressColumnVirtualisation","alwaysAggregateAtRootLevel","suppressAggAtRootLevel","suppressFocusAfterRefresh","functionsPassive","functionsReadOnly","animateRows","groupSelectsFiltered","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","enableRtl","suppressClickEdit","rowDragEntireRow","rowDragManaged","suppressRowDrag","suppressMoveWhenRowDragging","rowDragMultiRow","enableGroupEdit","embedFullWidthRows","suppressPaginationPanel","groupHideOpenParents","groupAllowUnbalanced","pagination","paginationAutoPageSize","suppressScrollOnNewData","suppressScrollWhenPopupsAreOpen","purgeClosedRowNodes","cacheQuickFilter","includeHiddenColumnsInQuickFilter","excludeHiddenColumnsFromQuickFilter","ensureDomOrder","accentedSort","suppressChangeDetection","valueCache","valueCacheNeverExpires","aggregateOnlyChangedColumns","suppressAnimationFrame","suppressExcelExport","suppressCsvExport","includeHiddenColumnsInAdvancedFilter","suppressMultiRangeSelection","enterMovesDown","enterMovesDownAfterEdit","enterNavigatesVerticallyAfterEdit","enterNavigatesVertically","suppressPropertyNamesCheck","rowMultiSelectWithClick","suppressRowHoverHighlight","suppressRowTransform","suppressClipboardPaste","suppressLastEmptyLineOnPaste","enableCharts","enableChartToolPanelsButton","suppressChartToolPanelsButton","suppressMaintainUnsortedOrder","enableCellTextSelection","suppressBrowserResizeObserver","suppressMaxRenderedRowRestriction","excludeChildrenWhenTreeDataFiltering","tooltipMouseTrack","tooltipInteraction","keepDetailRows","paginateChildRows","preventDefaultOnContextMenu","undoRedoCellEditing","allowDragFromColumnsToolPanel","pivotSuppressAutoColumn","suppressExpandablePivotGroups","debounceVerticalScrollbar","detailRowAutoHeight","serverSideFilterAllLevels","serverSideSortAllLevels","serverSideEnableClientSideSort","serverSideOnlyRefreshFilteredGroups","serverSideSortOnServer","serverSideFilterOnServer","suppressAggFilteredOnly","showOpenedGroup","suppressClipboardApi","suppressModelUpdateAfterUpdateTransaction","stopEditingWhenCellsLoseFocus","maintainColumnOrder","groupMaintainOrder","columnHoverHighlight","readOnlyEdit","suppressRowVirtualisation","enableCellEditingOnBackspace","resetRowDataOnUpdate","removePivotHeaderRowWhenSingleValueColumn","suppressCopySingleCellRanges","suppressGroupRowsSticky","suppressCutToClipboard","suppressServerSideInfiniteScroll","rowGroupPanelSuppressSort","allowShowChangeAfterFilter","enableAdvancedFilter","masterDetail","treeData","suppressGroupMaintainValueType","reactiveCustomComponents","applyQuickFilterBeforePivotOrAgg","suppressServerSideFullWidthLoadingRow","suppressAdvancedFilterEval"],Oe.OTHER_PROPERTIES=["suppressStickyTotalRow"],Oe.FUNCTIONAL_PROPERTIES=["doesExternalFilterPass","processPivotResultColDef","processPivotResultColGroupDef","getBusinessKeyForNode","isRowSelectable","rowDragText","groupRowRenderer","fullWidthCellRenderer","loadingCellRenderer","loadingOverlayComponent","noRowsOverlayComponent","detailCellRenderer","quickFilterParser","quickFilterMatcher"],Oe.CALLBACK_PROPERTIES=["getLocaleText","isExternalFilterPresent","getRowHeight","getRowClass","getRowStyle","getContextMenuItems","getMainMenuItems","processRowPostCreate","processCellForClipboard","getGroupRowAgg","isFullWidthRow","sendToClipboard","navigateToNextHeader","tabToNextHeader","navigateToNextCell","tabToNextCell","processCellFromClipboard","getDocument","postProcessPopup","getChildCount","getDataPath","isRowMaster","postSortRows","processHeaderForClipboard","processUnpinnedColumns","processGroupHeaderForClipboard","paginationNumberFormatter","processDataFromClipboard","getServerSideGroupKey","isServerSideGroup","createChartContainer","getChartToolbarItems","fillOperation","isApplyServerSideTransaction","getServerSideGroupLevelParams","isServerSideGroupOpenByDefault","isGroupOpenByDefault","initialGroupOrderComparator","groupIncludeFooter","loadingCellRendererSelector","getRowId","groupAggFiltering","chartMenuItems","groupTotalRow"],Oe.FUNCTION_PROPERTIES=[...Oe.FUNCTIONAL_PROPERTIES,...Oe.CALLBACK_PROPERTIES],Oe.ALL_PROPERTIES=[...Oe.ARRAY_PROPERTIES,...Oe.OBJECT_PROPERTIES,...Oe.STRING_PROPERTIES,...Oe.NUMBER_PROPERTIES,...Oe.FUNCTION_PROPERTIES,...Oe.BOOLEAN_PROPERTIES,...Oe.OTHER_PROPERTIES];var vo=Oe,Ye=class Dn{static getCallbackForEvent(e){return!e||e.length<2?e:"on"+e[0].toUpperCase()+e.substring(1)}static getGridOptionKeys(){return this.ALL_PROPERTIES_AND_CALLBACKS}static combineAttributesAndGridOptions(e,s){typeof e!="object"&&(e={});const i=_({},e);return Dn.getGridOptionKeys().forEach(r=>{const n=s[r];typeof n<"u"&&n!==Dn.VUE_OMITTED_PROPERTY&&(i[r]=n)}),i}static processOnChange(e,s,i){if(!e)return;const o={};let r=!1;if(Object.keys(e).filter(l=>Dn.ALL_PROPERTIES_AND_CALLBACKS_SET.has(l)).forEach(l=>{o[l]=e[l],r=!0}),!r)return;s.__internalUpdateGridOptions(o,!0);const n={type:p.EVENT_COMPONENT_STATE_CHANGED};je(o,(l,a)=>{n[l]=a}),s.dispatchEvent(n)}};Ye.EVENTS=Gs(p),Ye.VUE_OMITTED_PROPERTY="AG-VUE-OMITTED-PROPERTY",Ye.EXCLUDED_INTERNAL_EVENTS=[p.EVENT_SCROLLBAR_WIDTH_CHANGED,p.EVENT_CHECKBOX_CHANGED,p.EVENT_HEIGHT_SCALE_CHANGED,p.EVENT_BODY_HEIGHT_CHANGED,p.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED,p.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,p.EVENT_SCROLL_VISIBILITY_CHANGED,p.EVENT_COLUMN_HOVER_CHANGED,p.EVENT_FLASH_CELLS,p.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED,p.EVENT_DISPLAYED_ROWS_CHANGED,p.EVENT_LEFT_PINNED_WIDTH_CHANGED,p.EVENT_RIGHT_PINNED_WIDTH_CHANGED,p.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,p.EVENT_STORE_UPDATED,p.EVENT_COLUMN_PANEL_ITEM_DRAG_START,p.EVENT_COLUMN_PANEL_ITEM_DRAG_END,p.EVENT_KEY_SHORTCUT_CHANGED_CELL_START,p.EVENT_KEY_SHORTCUT_CHANGED_CELL_END,p.EVENT_FULL_WIDTH_ROW_FOCUSED,p.EVENT_HEADER_HEIGHT_CHANGED,p.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,p.EVENT_CELL_FOCUS_CLEARED,p.EVENT_GRID_STYLES_CHANGED,p.EVENT_FILTER_DESTROYED,p.EVENT_ROW_DATA_UPDATE_STARTED,p.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,p.EVENT_DATA_TYPES_INFERRED,p.EVENT_FIELD_VALUE_CHANGED,p.EVENT_FIELD_PICKER_VALUE_SELECTED,p.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED,p.EVENT_SUPPRESS_MENU_HIDE_CHANGED,p.EVENT_SUPPRESS_FIELD_DOT_NOTATION,p.EVENT_ROW_COUNT_READY,p.EVENT_SIDE_BAR_UPDATED],Ye.PUBLIC_EVENTS=Ye.EVENTS.filter(t=>!wt(Ye.EXCLUDED_INTERNAL_EVENTS,t)),Ye.EVENT_CALLBACKS=Ye.EVENTS.map(t=>Ye.getCallbackForEvent(t)),Ye.BOOLEAN_PROPERTIES=vo.BOOLEAN_PROPERTIES,Ye.ALL_PROPERTIES=vo.ALL_PROPERTIES,Ye.ALL_PROPERTIES_AND_CALLBACKS=[...Ye.ALL_PROPERTIES,...Ye.EVENT_CALLBACKS],Ye.ALL_PROPERTIES_AND_CALLBACKS_SET=new Set(Ye.ALL_PROPERTIES_AND_CALLBACKS);var Mr=Ye,tl=class extends L{constructor(){super(...arguments),this.componentsMappedByName={}}setupComponents(t){t&&t.forEach(e=>this.addComponent(e))}addComponent(t){const s=t.componentName.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase().toUpperCase();this.componentsMappedByName[s]=t.componentClass}getComponentClass(t){return this.componentsMappedByName[t]}};tl=u([O("agStackComponentsRegistry")],tl);var Jd={};We(Jd,{getAriaCheckboxStateName:()=>xr,getAriaLabel:()=>tu,getAriaLevel:()=>wg,getAriaPosInSet:()=>eu,getAriaSortState:()=>$d,removeAriaExpanded:()=>ru,removeAriaSort:()=>hu,setAriaActiveDescendant:()=>rl,setAriaAtomic:()=>su,setAriaChecked:()=>Eg,setAriaColCount:()=>au,setAriaColIndex:()=>ll,setAriaColSpan:()=>du,setAriaControls:()=>al,setAriaDescribedBy:()=>Sg,setAriaDisabled:()=>ol,setAriaExpanded:()=>ls,setAriaHidden:()=>wo,setAriaLabel:()=>St,setAriaLabelledBy:()=>bi,setAriaLevel:()=>ou,setAriaLive:()=>il,setAriaMultiSelectable:()=>nu,setAriaPosInSet:()=>Nr,setAriaRelevant:()=>iu,setAriaRole:()=>Ae,setAriaRowCount:()=>lu,setAriaRowIndex:()=>nl,setAriaSelected:()=>Ti,setAriaSetSize:()=>Ir,setAriaSort:()=>uu});function Dt(t,e,s){s==null||typeof s=="string"&&s==""?sl(t,e):At(t,e,s)}function At(t,e,s){t.setAttribute(Zd(e),s.toString())}function sl(t,e){t.removeAttribute(Zd(e))}function Zd(t){return`aria-${t}`}function Ae(t,e){e?t.setAttribute("role",e):t.removeAttribute("role")}function $d(t){let e;return t==="asc"?e="ascending":t==="desc"?e="descending":t==="mixed"?e="other":e="none",e}function wg(t){return parseInt(t.getAttribute("aria-level"),10)}function eu(t){return parseInt(t.getAttribute("aria-posinset"),10)}function tu(t){return t.getAttribute("aria-label")}function St(t,e){Dt(t,"label",e)}function bi(t,e){Dt(t,"labelledby",e)}function Sg(t,e){Dt(t,"describedby",e)}function il(t,e){Dt(t,"live",e)}function su(t,e){Dt(t,"atomic",e)}function iu(t,e){Dt(t,"relevant",e)}function ou(t,e){Dt(t,"level",e)}function ol(t,e){Dt(t,"disabled",e)}function wo(t,e){Dt(t,"hidden",e)}function rl(t,e){Dt(t,"activedescendant",e)}function ls(t,e){At(t,"expanded",e)}function ru(t){sl(t,"expanded")}function Ir(t,e){At(t,"setsize",e)}function Nr(t,e){At(t,"posinset",e)}function nu(t,e){At(t,"multiselectable",e)}function lu(t,e){At(t,"rowcount",e)}function nl(t,e){At(t,"rowindex",e)}function au(t,e){At(t,"colcount",e)}function ll(t,e){At(t,"colindex",e)}function du(t,e){At(t,"colspan",e)}function uu(t,e){At(t,"sort",e)}function hu(t){sl(t,"sort")}function Ti(t,e){Dt(t,"selected",e)}function Eg(t,e){At(t,"checked",e===void 0?"mixed":e)}function al(t,e){Dt(t,"controls",e.id),bi(e,t.id)}function xr(t,e){return e===void 0?t("ariaIndeterminate","indeterminate"):e===!0?t("ariaChecked","checked"):t("ariaUnchecked","unchecked")}var cu={};We(cu,{browserSupportsPreventScroll:()=>wl,getBodyHeight:()=>fu,getBodyWidth:()=>gu,getMaxDivHeight:()=>pu,getSafariVersion:()=>ml,getScrollbarWidth:()=>mu,getTabIndex:()=>_r,isBrowserChrome:()=>Or,isBrowserFirefox:()=>Cl,isBrowserSafari:()=>qt,isIOSUserAgent:()=>as,isInvisibleScrollbar:()=>Sl,isMacOsUserAgent:()=>vl});var dl,Gr,ul,hl,cl,pl,gl,fl;function qt(){return dl===void 0&&(dl=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),dl}function ml(){if(Gr===void 0)if(qt()){const t=navigator.userAgent.match(/version\/(\d+)/i);t&&(Gr=t[1]!=null?parseFloat(t[1]):0)}else Gr=0;return Gr}function Or(){if(ul===void 0){const t=window;ul=!!t.chrome&&(!!t.chrome.webstore||!!t.chrome.runtime)||/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}return ul}function Cl(){return hl===void 0&&(hl=/(firefox)/i.test(navigator.userAgent)),hl}function vl(){return cl===void 0&&(cl=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),cl}function as(){return pl===void 0&&(pl=/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1),pl}function wl(){return!qt()||ml()>=15}function _r(t){if(!t)return null;const e=t.tabIndex,s=t.getAttribute("tabIndex");return e===-1&&(s===null||s===""&&!Cl())?null:e.toString()}function pu(){if(!document.body)return-1;let t=1e6;const e=navigator.userAgent.toLowerCase().match(/firefox/)?6e6:1e9,s=document.createElement("div");for(document.body.appendChild(s);;){const i=t*2;if(s.style.height=i+"px",i>e||s.clientHeight!==i)break;t=i}return document.body.removeChild(s),t}function gu(){var t,e,s;return(s=(t=document.body)==null?void 0:t.clientWidth)!=null?s:window.innerHeight||((e=document.documentElement)==null?void 0:e.clientWidth)||-1}function fu(){var t,e,s;return(s=(t=document.body)==null?void 0:t.clientHeight)!=null?s:window.innerHeight||((e=document.documentElement)==null?void 0:e.clientHeight)||-1}function mu(){return fl==null&&Cu(),fl}function Cu(){const t=document.body,e=document.createElement("div");e.style.width=e.style.height="100px",e.style.opacity="0",e.style.overflow="scroll",e.style.msOverflowStyle="scrollbar",e.style.position="absolute",t.appendChild(e);let s=e.offsetWidth-e.clientWidth;s===0&&e.clientWidth===0&&(s=null),e.parentNode&&e.parentNode.removeChild(e),s!=null&&(fl=s,gl=s===0)}function Sl(){return gl==null&&Cu(),gl}var vu={};We(vu,{dateToFormattedString:()=>Ai,parseDateTimeFromString:()=>ut,serialiseDate:()=>Pt});var wu={};We(wu,{cleanNumber:()=>yg,createArrayOfNumbers:()=>Su,decToHex:()=>Rg,formatNumberCommas:()=>El,formatNumberTwoDecimalPlacesAndCommas:()=>bg,padStartWidthZeros:()=>Di,sum:()=>Tg});function Di(t,e){return t.toString().padStart(e,"0")}function Su(t,e){const s=[];for(let i=t;i<=e;i++)s.push(i);return s}function yg(t){return typeof t=="string"&&(t=parseInt(t,10)),typeof t=="number"?Math.floor(t):null}function Rg(t,e){let s="";for(let i=0;i<e;i++)s+=String.fromCharCode(t&255),t>>>=8;return s}function bg(t,e,s){return typeof t!="number"?"":El(Math.round(t*100)/100,e,s)}function El(t,e,s){return typeof t!="number"?"":t.toString().replace(".",s).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${e}`)}function Tg(t){return t==null?null:t.reduce((e,s)=>e+s,0)}function Pt(t,e=!0,s="-"){if(!t)return null;let i=[t.getFullYear(),t.getMonth()+1,t.getDate()].map(o=>Di(o,2)).join(s);return e&&(i+=" "+[t.getHours(),t.getMinutes(),t.getSeconds()].map(o=>Di(o,2)).join(":")),i}var yl=t=>{if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"};function Ai(t,e="YYYY-MM-DD"){const s=Di(t.getFullYear(),4),i=["January","February","March","April","May","June","July","August","September","October","November","December"],o=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],r={YYYY:()=>s.slice(s.length-4,s.length),YY:()=>s.slice(s.length-2,s.length),Y:()=>`${t.getFullYear()}`,MMMM:()=>i[t.getMonth()],MMM:()=>i[t.getMonth()].slice(0,3),MM:()=>Di(t.getMonth()+1,2),Mo:()=>`${t.getMonth()+1}${yl(t.getMonth()+1)}`,M:()=>`${t.getMonth()+1}`,Do:()=>`${t.getDate()}${yl(t.getDate())}`,DD:()=>Di(t.getDate(),2),D:()=>`${t.getDate()}`,dddd:()=>o[t.getDay()],ddd:()=>o[t.getDay()].slice(0,3),dd:()=>o[t.getDay()].slice(0,2),do:()=>`${t.getDay()}${yl(t.getDay())}`,d:()=>`${t.getDay()}`},n=new RegExp(Object.keys(r).join("|"),"g");return e.replace(n,l=>l in r?r[l]():l)}function ut(t){if(!t)return null;const[e,s]=t.split(" ");if(!e)return null;const i=e.split("-").map(c=>parseInt(c,10));if(i.filter(c=>!isNaN(c)).length!==3)return null;const[o,r,n]=i,l=new Date(o,r-1,n);if(l.getFullYear()!==o||l.getMonth()!==r-1||l.getDate()!==n)return null;if(!s||s==="00:00:00")return l;const[a,d,h]=s.split(":").map(c=>parseInt(c,10));return a>=0&&a<24&&l.setHours(a),d>=0&&d<60&&l.setMinutes(d),h>=0&&h<60&&l.setSeconds(h),l}var Eu={};We(Eu,{FOCUSABLE_EXCLUDE:()=>bl,FOCUSABLE_SELECTOR:()=>yu,addOrRemoveAttribute:()=>Qt,addStylesToElement:()=>Ml,bindCellRendererToHtmlElement:()=>Nl,clearElement:()=>Le,copyNodeList:()=>Au,ensureDomOrder:()=>Fl,formatSize:()=>Hr,getAbsoluteHeight:()=>Dl,getAbsoluteWidth:()=>Eo,getElementRectWithOffset:()=>Al,getElementSize:()=>vs,getInnerHeight:()=>So,getInnerWidth:()=>ks,getScrollLeft:()=>Ro,insertWithDomOrder:()=>bu,isElementChildOfClass:()=>Hs,isFocusableFormField:()=>Tl,isHorizontalScrollShowing:()=>Tu,isInDOM:()=>Pl,isNodeOrElement:()=>Do,isRtlNegativeScroll:()=>yo,isVerticalScrollShowing:()=>Du,isVisible:()=>ht,iterateNamedNodeMap:()=>Pu,loadTemplate:()=>ct,nodeListForEach:()=>Il,radioCssClass:()=>Rl,removeFromParent:()=>Vt,setDisabled:()=>Pi,setDisplayed:()=>$,setDomChildOrder:()=>Ll,setElementHeight:()=>Dg,setElementWidth:()=>To,setFixedHeight:()=>Bs,setFixedWidth:()=>Ft,setScrollLeft:()=>bo,setVisible:()=>Ru});var Vr;function Rl(t,e,s){const i=t.parentElement;let o=i&&i.firstChild;for(;o;)e&&o.classList.toggle(e,o===t),s&&o.classList.toggle(s,o!==t),o=o.nextSibling}var yu="[tabindex], input, select, button, textarea, [href]",bl="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function Tl(t){const e=Element.prototype.matches||Element.prototype.msMatchesSelector,i=e.call(t,"input, select, button, textarea"),o=e.call(t,bl),r=ht(t);return i&&!o&&r}function $(t,e,s={}){const{skipAriaHidden:i}=s;t.classList.toggle("ag-hidden",!e),i||wo(t,!e)}function Ru(t,e,s={}){const{skipAriaHidden:i}=s;t.classList.toggle("ag-invisible",!e),i||wo(t,!e)}function Pi(t,e){const s="disabled",i=e?o=>o.setAttribute(s,""):o=>o.removeAttribute(s);i(t),Il(t.querySelectorAll("input"),o=>i(o))}function Hs(t,e,s){let i=0;for(;t;){if(t.classList.contains(e))return!0;if(t=t.parentElement,typeof s=="number"){if(++i>s)break}else if(t===s)break}return!1}function vs(t){const{height:e,width:s,borderTopWidth:i,borderRightWidth:o,borderBottomWidth:r,borderLeftWidth:n,paddingTop:l,paddingRight:a,paddingBottom:d,paddingLeft:h,marginTop:c,marginRight:m,marginBottom:C,marginLeft:v,boxSizing:S}=window.getComputedStyle(t);return{height:parseFloat(e||"0"),width:parseFloat(s||"0"),borderTopWidth:parseFloat(i||"0"),borderRightWidth:parseFloat(o||"0"),borderBottomWidth:parseFloat(r||"0"),borderLeftWidth:parseFloat(n||"0"),paddingTop:parseFloat(l||"0"),paddingRight:parseFloat(a||"0"),paddingBottom:parseFloat(d||"0"),paddingLeft:parseFloat(h||"0"),marginTop:parseFloat(c||"0"),marginRight:parseFloat(m||"0"),marginBottom:parseFloat(C||"0"),marginLeft:parseFloat(v||"0"),boxSizing:S}}function So(t){const e=vs(t);return e.boxSizing==="border-box"?e.height-e.paddingTop-e.paddingBottom:e.height}function ks(t){const e=vs(t);return e.boxSizing==="border-box"?e.width-e.paddingLeft-e.paddingRight:e.width}function Dl(t){const e=vs(t),s=e.marginBottom+e.marginTop;return Math.ceil(t.offsetHeight+s)}function Eo(t){const e=vs(t),s=e.marginLeft+e.marginRight;return Math.ceil(t.offsetWidth+s)}function Al(t){const e=t.getBoundingClientRect(),{borderTopWidth:s,borderLeftWidth:i,borderRightWidth:o,borderBottomWidth:r}=vs(t);return{top:e.top+(s||0),left:e.left+(i||0),right:e.right+(o||0),bottom:e.bottom+(r||0)}}function yo(){if(typeof Vr=="boolean")return Vr;const t=document.createElement("div");return t.style.direction="rtl",t.style.width="1px",t.style.height="1px",t.style.position="fixed",t.style.top="0px",t.style.overflow="hidden",t.dir="rtl",t.innerHTML=`<div style="width: 2px">
79
+ <span style="display: inline-block; width: 1px"></span>
80
+ <span style="display: inline-block; width: 1px"></span>
81
+ </div>`,document.body.appendChild(t),t.scrollLeft=1,Vr=Math.floor(t.scrollLeft)===0,document.body.removeChild(t),Vr}function Ro(t,e){let s=t.scrollLeft;return e&&(s=Math.abs(s),Or()&&!yo()&&(s=t.scrollWidth-t.clientWidth-s)),s}function bo(t,e,s){s&&(yo()?e*=-1:(qt()||Or())&&(e=t.scrollWidth-t.clientWidth-e)),t.scrollLeft=e}function Le(t){for(;t&&t.firstChild;)t.removeChild(t.firstChild)}function Vt(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Pl(t){return!!t.offsetParent}function ht(t){const e=t;return e.checkVisibility?e.checkVisibility({checkVisibilityCSS:!0}):!(!Pl(t)||window.getComputedStyle(t).visibility!=="visible")}function ct(t){const e=document.createElement("div");return e.innerHTML=(t||"").trim(),e.firstChild}function Fl(t,e,s){s&&s.nextSibling===e||(s?s.nextSibling?t.insertBefore(e,s.nextSibling):t.appendChild(e):t.firstChild&&t.firstChild!==e&&t.insertAdjacentElement("afterbegin",e))}function Ll(t,e){for(let s=0;s<e.length;s++){const i=e[s],o=t.children[s];o!==i&&t.insertBefore(i,o)}}function bu(t,e,s){s?s.insertAdjacentElement("afterend",e):t.firstChild?t.insertAdjacentElement("afterbegin",e):t.appendChild(e)}function Ml(t,e){if(e)for(const[s,i]of Object.entries(e)){if(!s||!s.length||i==null)continue;const o=Qd(s),r=i.toString(),n=r.replace(/\s*!important/g,""),l=n.length!=r.length?"important":void 0;t.style.setProperty(o,n,l)}}function Tu(t){return t.clientWidth<t.scrollWidth}function Du(t){return t.clientHeight<t.scrollHeight}function To(t,e){e==="flex"?(t.style.removeProperty("width"),t.style.removeProperty("minWidth"),t.style.removeProperty("maxWidth"),t.style.flex="1 1 auto"):Ft(t,e)}function Ft(t,e){e=Hr(e),t.style.width=e.toString(),t.style.maxWidth=e.toString(),t.style.minWidth=e.toString()}function Dg(t,e){e==="flex"?(t.style.removeProperty("height"),t.style.removeProperty("minHeight"),t.style.removeProperty("maxHeight"),t.style.flex="1 1 auto"):Bs(t,e)}function Bs(t,e){e=Hr(e),t.style.height=e.toString(),t.style.maxHeight=e.toString(),t.style.minHeight=e.toString()}function Hr(t){return typeof t=="number"?`${t}px`:t}function Do(t){return t instanceof Node||t instanceof HTMLElement}function Au(t){if(t==null)return[];const e=[];return Il(t,s=>e.push(s)),e}function Pu(t,e){if(t)for(let s=0;s<t.length;s++){const i=t[s];e(i.name,i.value)}}function Qt(t,e,s){s==null?t.removeAttribute(e):t.setAttribute(e,s.toString())}function Il(t,e){if(t!=null)for(let s=0;s<t.length;s++)e(t[s])}function Nl(t,e){t.then(s=>{const i=s.getGui();i!=null&&(typeof i=="object"?e.appendChild(i):e.innerHTML=i)})}var Fu={};We(Fu,{fuzzyCheckStrings:()=>Lu,fuzzySuggestions:()=>Ao});function Lu(t,e,s){const i={},o=t.filter(r=>!e.some(n=>n===r));return o.length>0&&o.forEach(r=>i[r]=Ao(r,s).values),i}function Ao(t,e,s,i){let o=e.map((l,a)=>({value:l,relevance:Ag(t.toLowerCase(),l.toLocaleLowerCase()),idx:a}));if(o.sort((l,a)=>a.relevance-l.relevance),s&&(o=o.filter(l=>l.relevance!==0)),o.length>0&&i&&i>0){const a=o[0].relevance*i;o=o.filter(d=>a-d.relevance<0)}const r=[],n=[];for(const l of o)r.push(l.value),n.push(l.idx);return{values:r,indices:n}}function Ag(t,e){const s=t.replace(/\s/g,""),i=e.replace(/\s/g,"");let o=0,r=-1;for(let n=0;n<s.length;n++){const l=i.indexOf(s[n],r+1);l!==-1&&(r=l,o+=100-r*100/1e4*100)}return o}var Mu={};We(Mu,{createIcon:()=>Lt,createIconNoSpan:()=>be,iconNameClassMap:()=>Iu});var Iu={columnGroupOpened:"expanded",columnGroupClosed:"contracted",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate",columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",groupContracted:"tree-closed",groupExpanded:"tree-open",setFilterGroupClosed:"tree-closed",setFilterGroupOpen:"tree-open",setFilterGroupIndeterminate:"tree-indeterminate",chart:"chart",close:"cross",cancel:"cancel",check:"tick",first:"first",previous:"previous",next:"next",last:"last",linked:"linked",unlinked:"unlinked",colorPicker:"color-picker",groupLoading:"loading",menu:"menu",menuAlt:"menu-alt",filter:"filter",columns:"columns",maximize:"maximize",minimize:"minimize",menuPin:"pin",menuValue:"aggregation",menuAddRowGroup:"group",menuRemoveRowGroup:"group",clipboardCopy:"copy",clipboardCut:"cut",clipboardPaste:"paste",pivotPanel:"pivot",rowGroupPanel:"group",valuePanel:"aggregation",columnDrag:"grip",rowDrag:"grip",save:"save",csvExport:"csv",excelExport:"excel",smallDown:"small-down",smallLeft:"small-left",smallRight:"small-right",smallUp:"small-up",sortAscending:"asc",sortDescending:"desc",sortUnSort:"none",advancedFilterBuilder:"group",advancedFilterBuilderDrag:"grip",advancedFilterBuilderInvalid:"not-allowed",advancedFilterBuilderMoveUp:"up",advancedFilterBuilderMoveDown:"down",advancedFilterBuilderAdd:"plus",advancedFilterBuilderRemove:"minus",chartsMenuEdit:"chart",chartsMenuAdvancedSettings:"settings",chartsMenuAdd:"plus"};function Lt(t,e,s){const i=be(t,e,s);if(i){const{className:r}=i;if(typeof r=="string"&&r.indexOf("ag-icon")>-1||typeof r=="object"&&r["ag-icon"])return i}const o=document.createElement("span");return o.appendChild(i),o}function be(t,e,s,i){let o=null;const r=s&&s.getColDef().icons;if(r&&(o=r[t]),e&&!o){const n=e.get("icons");n&&(o=n[t])}if(o){let n;if(typeof o=="function")n=o();else if(typeof o=="string")n=o;else throw new Error("icon from grid options needs to be a string or a function");if(typeof n=="string")return ct(n);if(Do(n))return n;console.warn("AG Grid: iconRenderer should return back a string or a dom object")}else{const n=document.createElement("span");let l=Iu[t];return l||(i?l=t:(console.warn(`AG Grid: Did not find icon ${t}`),l="")),n.setAttribute("class",`ag-icon ag-icon-${l}`),n.setAttribute("unselectable","on"),Ae(n,"presentation"),n}}var Nu={};We(Nu,{isDeleteKey:()=>Ou,isEventFromPrintableCharacter:()=>kr,isUserSuppressingHeaderKeyboardEvent:()=>xu,isUserSuppressingKeyboardEvent:()=>Br,normaliseQwertyAzerty:()=>Gu});var E=class{};E.BACKSPACE="Backspace",E.TAB="Tab",E.ENTER="Enter",E.ESCAPE="Escape",E.SPACE=" ",E.LEFT="ArrowLeft",E.UP="ArrowUp",E.RIGHT="ArrowRight",E.DOWN="ArrowDown",E.DELETE="Delete",E.F2="F2",E.PAGE_UP="PageUp",E.PAGE_DOWN="PageDown",E.PAGE_HOME="Home",E.PAGE_END="End",E.A="KeyA",E.C="KeyC",E.D="KeyD",E.V="KeyV",E.X="KeyX",E.Y="KeyY",E.Z="KeyZ";var Pg=65,Fg=67,Lg=86,Mg=68,Ig=90,Ng=89;function kr(t){return t.altKey||t.ctrlKey||t.metaKey?!1:t.key.length===1}function Br(t,e,s,i,o){const r=i?i.getColDef().suppressKeyboardEvent:void 0;if(!r)return!1;const n=t.addGridCommonParams({event:e,editing:o,column:i,node:s,data:s.data,colDef:i.getColDef()});return!!(r&&r(n))}function xu(t,e,s,i){const o=i.getDefinition(),r=o&&o.suppressHeaderKeyboardEvent;if(!P(r))return!1;const n=t.addGridCommonParams({colDef:o,column:i,headerRowIndex:s,event:e});return!!r(n)}function Gu(t){const{keyCode:e}=t;let s;switch(e){case Pg:s=E.A;break;case Fg:s=E.C;break;case Lg:s=E.V;break;case Mg:s=E.D;break;case Ig:s=E.Z;break;case Ng:s=E.Y;break;default:s=t.code}return s}function Ou(t,e=!1){return t===E.DELETE?!0:!e&&t===E.BACKSPACE?vl():!1}var _u={};We(_u,{areEventsNear:()=>xl});function xl(t,e,s){if(s===0)return!1;const i=Math.abs(t.clientX-e.clientX),o=Math.abs(t.clientY-e.clientY);return Math.max(i,o)<=s}var Vu={};We(Vu,{sortRowNodesByOrder:()=>xg});function xg(t,e){if(!t)return!1;const s=(n,l)=>{const a=e[n.id],d=e[l.id],h=a!==void 0,c=d!==void 0,m=h&&c,C=!h&&!c;return m?a-d:C?n.__objectId-l.__objectId:h?1:-1};let i,o,r=!1;for(let n=0;n<t.length-1;n++)if(i=t[n],o=t[n+1],s(i,o)>0){r=!0;break}return r?(t.sort(s),!0):!1}var Hu={};We(Hu,{convertToSet:()=>Gl});function Gl(t){const e=new Set;return t.forEach(s=>e.add(s)),e}var Gg=_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_(_({},Jd),Od),cu),vu),Eu),Gd),Ad),Fu),bd),Mu),Nu),Xd),_u),wu),Td),Vu),Hu),jd),W=Gg,Fi=class{constructor(t=0,e=1){this.nextValue=t,this.step=e}next(){const t=this.nextValue;return this.nextValue+=this.step,t}peek(){return this.nextValue}skip(t){this.nextValue+=t}},xe=class An{constructor(e){this.status=0,this.resolution=null,this.waiters=[],e(s=>this.onDone(s),s=>this.onReject(s))}static all(e){return new An(s=>{let i=e.length;const o=new Array(i);e.forEach((r,n)=>{r.then(l=>{o[n]=l,i--,i===0&&s(o)})})})}static resolve(e=null){return new An(s=>s(e))}then(e){return new An(s=>{this.status===1?s(e(this.resolution)):this.waiters.push(i=>s(e(i)))})}resolveNow(e,s){return this.status===1?s(this.resolution):e}onDone(e){this.status=1,this.resolution=e,this.waiters.forEach(s=>s(e))}onReject(e){console.warn("TBI")}},Po=class{constructor(t){this.cssClassStates={},this.getGui=t}addCssClass(t){const e=(t||"").split(" ");if(e.length>1){e.forEach(i=>this.addCssClass(i));return}if(this.cssClassStates[t]!==!0&&t.length){const i=this.getGui();i&&i.classList.add(t),this.cssClassStates[t]=!0}}removeCssClass(t){const e=(t||"").split(" ");if(e.length>1){e.forEach(i=>this.removeCssClass(i));return}if(this.cssClassStates[t]!==!1&&t.length){const i=this.getGui();i&&i.classList.remove(t),this.cssClassStates[t]=!1}}containsCssClass(t){const e=this.getGui();return e?e.classList.contains(t):!1}addOrRemoveCssClass(t,e){if(!t)return;if(t.indexOf(" ")>=0){const i=(t||"").split(" ");if(i.length>1){i.forEach(o=>this.addOrRemoveCssClass(o,e));return}}if(this.cssClassStates[t]!==e&&t.length){const i=this.getGui();i&&i.classList.toggle(t,e),this.cssClassStates[t]=e}}},Fo=class mi extends L{constructor(e,s,i,o){super(),this.parentComp=e,this.tooltipShowDelayOverride=s,this.tooltipHideDelayOverride=i,this.shouldDisplayTooltip=o,this.SHOW_QUICK_TOOLTIP_DIFF=1e3,this.FADE_OUT_TOOLTIP_TIMEOUT=1e3,this.INTERACTIVE_HIDE_DELAY=100,this.interactionEnabled=!1,this.isInteractingWithTooltip=!1,this.state=0,this.tooltipInstanceCount=0,this.tooltipMouseTrack=!1}postConstruct(){this.gos.get("tooltipInteraction")&&(this.interactionEnabled=!0),this.tooltipTrigger=this.getTooltipTrigger(),this.tooltipMouseTrack=this.gos.get("tooltipMouseTrack");const e=this.parentComp.getGui();this.tooltipTrigger===0&&(this.addManagedListener(e,"mouseenter",this.onMouseEnter.bind(this)),this.addManagedListener(e,"mouseleave",this.onMouseLeave.bind(this))),this.tooltipTrigger===1&&(this.addManagedListener(e,"focusin",this.onFocusIn.bind(this)),this.addManagedListener(e,"focusout",this.onFocusOut.bind(this))),this.addManagedListener(e,"mousemove",this.onMouseMove.bind(this)),this.interactionEnabled||(this.addManagedListener(e,"mousedown",this.onMouseDown.bind(this)),this.addManagedListener(e,"keydown",this.onKeyDown.bind(this)))}getGridOptionsTooltipDelay(e){const s=this.gos.get(e);return s<0&&H(`${e} should not be lower than 0`),Math.max(200,s)}getTooltipDelay(e){var s,i;return e==="show"?(s=this.tooltipShowDelayOverride)!=null?s:this.getGridOptionsTooltipDelay("tooltipShowDelay"):(i=this.tooltipHideDelayOverride)!=null?i:this.getGridOptionsTooltipDelay("tooltipHideDelay")}destroy(){this.setToDoNothing(),super.destroy()}getTooltipTrigger(){const e=this.gos.get("tooltipTrigger");return!e||e==="hover"?0:1}onMouseEnter(e){this.interactionEnabled&&this.interactiveTooltipTimeoutId&&(this.unlockService(),this.startHideTimeout()),!as()&&(mi.isLocked?this.showTooltipTimeoutId=window.setTimeout(()=>{this.prepareToShowTooltip(e)},this.INTERACTIVE_HIDE_DELAY):this.prepareToShowTooltip(e))}onMouseMove(e){this.lastMouseEvent&&(this.lastMouseEvent=e),this.tooltipMouseTrack&&this.state===2&&this.tooltipComp&&this.positionTooltip()}onMouseDown(){this.setToDoNothing()}onMouseLeave(){this.interactionEnabled?this.lockService():this.setToDoNothing()}onFocusIn(){this.prepareToShowTooltip()}onFocusOut(e){var s;const i=e.relatedTarget,o=this.parentComp.getGui(),r=(s=this.tooltipComp)==null?void 0:s.getGui();this.isInteractingWithTooltip||o.contains(i)||this.interactionEnabled&&(r!=null&&r.contains(i))||this.setToDoNothing()}onKeyDown(){this.setToDoNothing()}prepareToShowTooltip(e){if(this.state!=0||mi.isLocked)return;let s=0;e&&(s=this.isLastTooltipHiddenRecently()?200:this.getTooltipDelay("show")),this.lastMouseEvent=e||null,this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),s),this.state=1}isLastTooltipHiddenRecently(){const e=new Date().getTime(),s=mi.lastTooltipHideTime;return e-s<this.SHOW_QUICK_TOOLTIP_DIFF}setToDoNothing(){this.state===2&&this.hideTooltip(),this.onBodyScrollEventCallback&&(this.onBodyScrollEventCallback(),this.onBodyScrollEventCallback=void 0),this.onColumnMovedEventCallback&&(this.onColumnMovedEventCallback(),this.onColumnMovedEventCallback=void 0),this.clearTimeouts(),this.state=0,this.lastMouseEvent=null}showTooltip(){const e=_({},this.parentComp.getTooltipParams());if(!P(e.value)||this.shouldDisplayTooltip&&!this.shouldDisplayTooltip()){this.setToDoNothing();return}this.state=2,this.tooltipInstanceCount++;const s=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);this.userComponentFactory.getTooltipCompDetails(e).newAgStackInstance().then(s)}hideTooltip(e){if(!e&&this.isInteractingWithTooltip)return;this.tooltipComp&&(this.destroyTooltipComp(),mi.lastTooltipHideTime=new Date().getTime());const s={type:p.EVENT_TOOLTIP_HIDE,parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(s),this.state=0}newTooltipComponentCallback(e,s){if(this.state!==2||this.tooltipInstanceCount!==e){this.getContext().destroyBean(s);return}const o=s.getGui();this.tooltipComp=s,o.classList.contains("ag-tooltip")||o.classList.add("ag-tooltip-custom"),this.tooltipTrigger===0&&o.classList.add("ag-tooltip-animate"),this.interactionEnabled&&o.classList.add("ag-tooltip-interactive");const r=this.localeService.getLocaleTextFunc(),n=this.popupService.addPopup({eChild:o,ariaLabel:r("ariaLabelTooltip","Tooltip")});n&&(this.tooltipPopupDestroyFunc=n.hideFunc),this.positionTooltip(),this.tooltipTrigger===1&&(this.onBodyScrollEventCallback=this.addManagedListener(this.eventService,p.EVENT_BODY_SCROLL,this.setToDoNothing.bind(this)),this.onColumnMovedEventCallback=this.addManagedListener(this.eventService,p.EVENT_COLUMN_MOVED,this.setToDoNothing.bind(this))),this.interactionEnabled&&(this.tooltipTrigger===0?(this.tooltipMouseEnterListener=this.addManagedListener(o,"mouseenter",this.onTooltipMouseEnter.bind(this))||null,this.tooltipMouseLeaveListener=this.addManagedListener(o,"mouseleave",this.onTooltipMouseLeave.bind(this))||null):(this.tooltipFocusInListener=this.addManagedListener(o,"focusin",this.onTooltipFocusIn.bind(this))||null,this.tooltipFocusOutListener=this.addManagedListener(o,"focusout",this.onTooltipFocusOut.bind(this))||null));const l={type:p.EVENT_TOOLTIP_SHOW,tooltipGui:o,parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(l),this.startHideTimeout()}onTooltipMouseEnter(){this.isInteractingWithTooltip=!0,this.unlockService()}onTooltipMouseLeave(){this.isInteractingWithTooltip=!1,this.lockService()}onTooltipFocusIn(){this.isInteractingWithTooltip=!0}onTooltipFocusOut(e){var s;const i=this.parentComp.getGui(),o=(s=this.tooltipComp)==null?void 0:s.getGui(),r=e.relatedTarget;o!=null&&o.contains(r)||(this.isInteractingWithTooltip=!1,i.contains(r)?this.startHideTimeout():this.hideTooltip())}positionTooltip(){const e={type:"tooltip",ePopup:this.tooltipComp.getGui(),nudgeY:18,skipObserver:this.tooltipMouseTrack};this.lastMouseEvent?this.popupService.positionPopupUnderMouseEvent(Ee(_({},e),{mouseEvent:this.lastMouseEvent})):this.popupService.positionPopupByComponent(Ee(_({},e),{eventSource:this.parentComp.getGui(),position:"under",keepWithinBounds:!0,nudgeY:5}))}destroyTooltipComp(){this.tooltipComp.getGui().classList.add("ag-tooltip-hiding");const e=this.tooltipPopupDestroyFunc,s=this.tooltipComp,i=this.tooltipTrigger===0?this.FADE_OUT_TOOLTIP_TIMEOUT:0;window.setTimeout(()=>{e(),this.getContext().destroyBean(s)},i),this.clearTooltipListeners(),this.tooltipPopupDestroyFunc=void 0,this.tooltipComp=void 0}clearTooltipListeners(){[this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener,this.tooltipFocusInListener,this.tooltipFocusOutListener].forEach(e=>{e&&e()}),this.tooltipMouseEnterListener=this.tooltipMouseLeaveListener=this.tooltipFocusInListener=this.tooltipFocusOutListener=null}lockService(){mi.isLocked=!0,this.interactiveTooltipTimeoutId=window.setTimeout(()=>{this.unlockService(),this.setToDoNothing()},this.INTERACTIVE_HIDE_DELAY)}unlockService(){mi.isLocked=!1,this.clearInteractiveTimeout()}startHideTimeout(){this.clearHideTimeout(),this.hideTooltipTimeoutId=window.setTimeout(this.hideTooltip.bind(this),this.getTooltipDelay("hide"))}clearShowTimeout(){this.showTooltipTimeoutId&&(window.clearTimeout(this.showTooltipTimeoutId),this.showTooltipTimeoutId=void 0)}clearHideTimeout(){this.hideTooltipTimeoutId&&(window.clearTimeout(this.hideTooltipTimeoutId),this.hideTooltipTimeoutId=void 0)}clearInteractiveTimeout(){this.interactiveTooltipTimeoutId&&(window.clearTimeout(this.interactiveTooltipTimeoutId),this.interactiveTooltipTimeoutId=void 0)}clearTimeouts(){this.clearShowTimeout(),this.clearHideTimeout(),this.clearInteractiveTimeout()}};Fo.isLocked=!1,u([f("popupService")],Fo.prototype,"popupService",2),u([f("userComponentFactory")],Fo.prototype,"userComponentFactory",2),u([M],Fo.prototype,"postConstruct",1);var Og=Fo,ds=class extends L{constructor(t,e){super(),this.ctrl=t,e&&(this.beans=e)}postConstruct(){this.refreshToolTip()}setBrowserTooltip(t){const e="title",s=this.ctrl.getGui();s&&(t!=null&&t!=""?s.setAttribute(e,t):s.removeAttribute(e))}updateTooltipText(){this.tooltip=this.ctrl.getTooltipValue()}createTooltipFeatureIfNeeded(){var t,e,s,i;if(this.tooltipManager!=null)return;const o={getTooltipParams:()=>this.getTooltipParams(),getGui:()=>this.ctrl.getGui()};this.tooltipManager=this.createBean(new Og(o,(e=(t=this.ctrl).getTooltipShowDelayOverride)==null?void 0:e.call(t),(i=(s=this.ctrl).getTooltipHideDelayOverride)==null?void 0:i.call(s),this.ctrl.shouldDisplayTooltip),this.beans.context)}refreshToolTip(){this.browserTooltips=this.beans.gos.get("enableBrowserTooltips"),this.updateTooltipText(),this.browserTooltips?(this.setBrowserTooltip(this.tooltip),this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context))):(this.setBrowserTooltip(null),this.createTooltipFeatureIfNeeded())}getTooltipParams(){const t=this.ctrl,e=t.getColumn?t.getColumn():void 0,s=t.getColDef?t.getColDef():void 0,i=t.getRowNode?t.getRowNode():void 0;return{location:t.getLocation(),colDef:s,column:e,rowIndex:t.getRowIndex?t.getRowIndex():void 0,node:i,data:i?i.data:void 0,value:this.getTooltipText(),valueFormatted:t.getValueFormatted?t.getValueFormatted():void 0,hideTooltipCallback:()=>{var o;return(o=this.tooltipManager)==null?void 0:o.hideTooltip(!0)}}}getTooltipText(){return this.tooltip}destroy(){this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context)),super.destroy()}};u([f("beans")],ds.prototype,"beans",2),u([M],ds.prototype,"postConstruct",1);var _g=new Fi,Lo=class Oa extends L{constructor(e){super(),this.displayed=!0,this.visible=!0,this.compId=_g.next(),this.cssClassManager=new Po(()=>this.eGui),e&&this.setTemplate(e)}preConstructOnComponent(){this.usingBrowserTooltips=this.gos.get("enableBrowserTooltips")}getCompId(){return this.compId}getTooltipParams(){return{value:this.tooltipText,location:"UNKNOWN"}}setTooltip(e){const{newTooltipText:s,showDelayOverride:i,hideDelayOverride:o,location:r,shouldDisplayTooltip:n}=e||{};this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),this.tooltipText!==s&&(this.tooltipText=s);const l=()=>this.tooltipText;s!=null&&(this.tooltipFeature=this.createBean(new ds({getTooltipValue:l,getGui:()=>this.getGui(),getLocation:()=>r??"UNKNOWN",getColDef:e==null?void 0:e.getColDef,getColumn:e==null?void 0:e.getColumn,getTooltipShowDelayOverride:i!=null?()=>i:void 0,getTooltipHideDelayOverride:o!=null?()=>o:void 0,shouldDisplayTooltip:n})))}createChildComponentsFromTags(e,s){Au(e.childNodes).forEach(o=>{if(!(o instanceof HTMLElement))return;const r=this.createComponentFromElement(o,n=>{n.getGui()&&this.copyAttributesFromNode(o,n.getGui())},s);if(r){if(r.addItems&&o.children.length){this.createChildComponentsFromTags(o,s);const n=Array.prototype.slice.call(o.children);r.addItems(n)}this.swapComponentForNode(r,e,o)}else o.childNodes&&this.createChildComponentsFromTags(o,s)})}createComponentFromElement(e,s,i){const o=e.nodeName,r=i?i[e.getAttribute("ref")]:void 0,n=this.agStackComponentsRegistry.getComponentClass(o);if(n){Oa.elementGettingCreated=e;const l=new n(r);return l.setParentComponent(this),this.createBean(l,null,s),l}return null}copyAttributesFromNode(e,s){Pu(e.attributes,(i,o)=>s.setAttribute(i,o))}swapComponentForNode(e,s,i){const o=e.getGui();s.replaceChild(o,i),s.insertBefore(document.createComment(i.nodeName),o),this.addDestroyFunc(this.destroyBean.bind(this,e)),this.swapInComponentForQuerySelectors(e,i)}swapInComponentForQuerySelectors(e,s){const i=this;this.iterateOverQuerySelectors(o=>{i[o.attributeName]===s&&(i[o.attributeName]=e)})}iterateOverQuerySelectors(e){let s=Object.getPrototypeOf(this);for(;s!=null;){const i=s.__agComponentMetaData,o=Rr(s.constructor);i&&i[o]&&i[o].querySelectors&&i[o].querySelectors.forEach(r=>e(r)),s=Object.getPrototypeOf(s)}}activateTabIndex(e){const s=this.gos.get("tabIndex");e||(e=[]),e.length||e.push(this.getGui()),e.forEach(i=>i.setAttribute("tabindex",s.toString()))}setTemplate(e,s){const i=ct(e);this.setTemplateFromElement(i,s)}setTemplateFromElement(e,s){this.eGui=e,this.eGui.__agComponent=this,this.wireQuerySelectors(),this.getContext()&&this.createChildComponentsFromTags(this.getGui(),s)}createChildComponentsPreConstruct(){this.getGui()&&this.createChildComponentsFromTags(this.getGui())}wireQuerySelectors(){if(!this.eGui)return;const e=this;this.iterateOverQuerySelectors(s=>{const i=r=>e[s.attributeName]=r;if(s.refSelector&&this.getAttribute("ref")===s.refSelector)i(this.eGui);else{const r=this.eGui.querySelector(s.querySelector);r&&i(r.__agComponent||r)}})}getGui(){return this.eGui}getFocusableElement(){return this.eGui}getAriaElement(){return this.getFocusableElement()}setParentComponent(e){this.parentComponent=e}getParentComponent(){return this.parentComponent}setGui(e){this.eGui=e}queryForHtmlElement(e){return this.eGui.querySelector(e)}queryForHtmlInputElement(e){return this.eGui.querySelector(e)}appendChild(e,s){if(e!=null)if(s||(s=this.eGui),Do(e))s.appendChild(e);else{const i=e;s.appendChild(i.getGui())}}isDisplayed(){return this.displayed}setVisible(e,s={}){if(e!==this.visible){this.visible=e;const{skipAriaHidden:i}=s;Ru(this.eGui,e,{skipAriaHidden:i})}}setDisplayed(e,s={}){if(e!==this.displayed){this.displayed=e;const{skipAriaHidden:i}=s;$(this.eGui,e,{skipAriaHidden:i});const o={type:Oa.EVENT_DISPLAYED_CHANGED,visible:this.displayed};this.dispatchEvent(o)}}destroy(){this.parentComponent&&(this.parentComponent=void 0),this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const e=this.eGui;e&&e.__agComponent&&(e.__agComponent=void 0),super.destroy()}addGuiEventListener(e,s,i){this.eGui.addEventListener(e,s,i),this.addDestroyFunc(()=>this.eGui.removeEventListener(e,s))}addCssClass(e){this.cssClassManager.addCssClass(e)}removeCssClass(e){this.cssClassManager.removeCssClass(e)}containsCssClass(e){return this.cssClassManager.containsCssClass(e)}addOrRemoveCssClass(e,s){this.cssClassManager.addOrRemoveCssClass(e,s)}getAttribute(e){const{eGui:s}=this;return s?s.getAttribute(e):null}getRefElement(e){return this.queryForHtmlElement(`[ref="${e}"]`)}};Lo.EVENT_DISPLAYED_CHANGED="displayedChanged",u([f("agStackComponentsRegistry")],Lo.prototype,"agStackComponentsRegistry",2),u([Id],Lo.prototype,"preConstructOnComponent",1),u([Id],Lo.prototype,"createChildComponentsPreConstruct",1);var K=Lo;function I(t){return Vg.bind(this,`[ref=${t}]`,t)}function Vg(t,e,s,i,o){if(t===null){console.error("AG Grid: QuerySelector selector should not be null");return}if(typeof o=="number"){console.error("AG Grid: QuerySelector should be on an attribute");return}Hg(s,"querySelectors",{attributeName:i,querySelector:t,refSelector:e})}function Hg(t,e,s){const i=kg(t,Rr(t.constructor));i[e]||(i[e]=[]),i[e].push(s)}function kg(t,e){return t.__agComponentMetaData||(t.__agComponentMetaData={}),t.__agComponentMetaData[e]||(t.__agComponentMetaData[e]={}),t.__agComponentMetaData[e]}var Ol=class extends K{constructor(){super(`
82
+ <div class="ag-floating-filter-input" role="presentation">
83
+ <ag-input-text-field ref="eFloatingFilterText"></ag-input-text-field>
84
+ </div>`)}destroy(){super.destroy()}init(t){this.params=t;const e=this.columnModel.getDisplayNameForColumn(t.column,"header",!0),s=this.localeService.getLocaleTextFunc();this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${e} ${s("ariaFilterInput","Filter Input")}`)}onParentModelChanged(t){if(t==null){this.eFloatingFilterText.setValue("");return}this.params.parentFilterInstance(e=>{if(e.getModelAsString){const s=e.getModelAsString(t);this.eFloatingFilterText.setValue(s)}})}onParamsUpdated(t){this.refresh(t)}refresh(t){this.init(t)}};u([I("eFloatingFilterText")],Ol.prototype,"eFloatingFilterText",2),u([f("columnModel")],Ol.prototype,"columnModel",2);var ku=class{constructor(t,e,s,i,o){this.alive=!0,this.context=t,this.eParent=i,e.getDateCompDetails(s).newAgStackInstance().then(l=>{if(!this.alive){t.destroyBean(l);return}this.dateComp=l,l&&(i.appendChild(l.getGui()),l.afterGuiAttached&&l.afterGuiAttached(),this.tempValue&&l.setDate(this.tempValue),this.disabled!=null&&this.setDateCompDisabled(this.disabled),o==null||o(this))})}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(t){this.dateComp?this.dateComp.setDate(t):this.tempValue=t}setDisabled(t){this.dateComp?this.setDateCompDisabled(t):this.disabled=t}setDisplayed(t){$(this.eParent,t)}setInputPlaceholder(t){this.dateComp&&this.dateComp.setInputPlaceholder&&this.dateComp.setInputPlaceholder(t)}setInputAriaLabel(t){this.dateComp&&this.dateComp.setInputAriaLabel&&this.dateComp.setInputAriaLabel(t)}afterGuiAttached(t){this.dateComp&&typeof this.dateComp.afterGuiAttached=="function"&&this.dateComp.afterGuiAttached(t)}updateParams(t){var e,s;let i=!1;(e=this.dateComp)!=null&&e.refresh&&typeof this.dateComp.refresh=="function"&&this.dateComp.refresh(t)!==null&&(i=!0),!i&&((s=this.dateComp)!=null&&s.onParamsUpdated)&&typeof this.dateComp.onParamsUpdated=="function"&&this.dateComp.onParamsUpdated(t)!==null&&H("Custom date component method 'onParamsUpdated' is deprecated. Use 'refresh' instead.")}setDateCompDisabled(t){this.dateComp!=null&&this.dateComp.setDisabled!=null&&this.dateComp.setDisabled(t)}},Bu=class{constructor(){this.customFilterOptions={}}init(t,e){this.filterOptions=t.filterOptions||e,this.mapCustomOptions(),this.selectDefaultItem(t)}getFilterOptions(){return this.filterOptions}mapCustomOptions(){this.filterOptions&&this.filterOptions.forEach(t=>{if(typeof t=="string")return;const e=[["displayKey"],["displayName"],["predicate","test"]],s=i=>i.some(o=>t[o]!=null)?!0:(console.warn(`AG Grid: ignoring FilterOptionDef as it doesn't contain one of '${i}'`),!1);if(!e.every(s)){this.filterOptions=this.filterOptions.filter(i=>i===t)||[];return}this.customFilterOptions[t.displayKey]=t})}selectDefaultItem(t){if(t.defaultOption)this.defaultOption=t.defaultOption;else if(this.filterOptions.length>=1){const e=this.filterOptions[0];typeof e=="string"?this.defaultOption=e:e.displayKey?this.defaultOption=e.displayKey:console.warn("AG Grid: invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'")}else console.warn("AG Grid: no filter options for filter")}getDefaultOption(){return this.defaultOption}getCustomOption(t){return this.customFilterOptions[t]}},Wu={applyFilter:"Apply",clearFilter:"Clear",resetFilter:"Reset",cancelFilter:"Cancel",textFilter:"Text Filter",numberFilter:"Number Filter",dateFilter:"Date Filter",setFilter:"Set Filter",filterOoo:"Filter...",empty:"Choose one",equals:"Equals",notEqual:"Does not equal",lessThan:"Less than",greaterThan:"Greater than",inRange:"Between",inRangeStart:"From",inRangeEnd:"To",lessThanOrEqual:"Less than or equal to",greaterThanOrEqual:"Greater than or equal to",contains:"Contains",notContains:"Does not contain",startsWith:"Begins with",endsWith:"Ends with",blank:"Blank",notBlank:"Not blank",before:"Before",after:"After",andCondition:"AND",orCondition:"OR",dateFormatOoo:"yyyy-mm-dd"},Wr=class dc extends L{constructor(e,s={}){super(),this.eFocusableElement=e,this.callbacks=s,this.callbacks=_({shouldStopEventPropagation:()=>!1,onTabKeyDown:i=>{if(i.defaultPrevented)return;const o=this.focusService.findNextFocusableElement(this.eFocusableElement,!1,i.shiftKey);o&&(o.focus(),i.preventDefault())}},s)}postConstruct(){this.eFocusableElement.classList.add(dc.FOCUS_MANAGED_CLASS),this.addKeyDownListeners(this.eFocusableElement),this.callbacks.onFocusIn&&this.addManagedListener(this.eFocusableElement,"focusin",this.callbacks.onFocusIn),this.callbacks.onFocusOut&&this.addManagedListener(this.eFocusableElement,"focusout",this.callbacks.onFocusOut)}addKeyDownListeners(e){this.addManagedListener(e,"keydown",s=>{if(!(s.defaultPrevented||_t(s))){if(this.callbacks.shouldStopEventPropagation(s)){Ot(s);return}s.key===E.TAB?this.callbacks.onTabKeyDown(s):this.callbacks.handleKeyDown&&this.callbacks.handleKeyDown(s)}})}};Wr.FOCUS_MANAGED_CLASS="ag-focus-managed",u([f("focusService")],Wr.prototype,"focusService",2),u([M],Wr.prototype,"postConstruct",1);var ws=Wr,Uu="ag-resizer-wrapper",Bg=`<div class="${Uu}">
85
+ <div ref="eTopLeftResizer" class="ag-resizer ag-resizer-topLeft"></div>
86
+ <div ref="eTopResizer" class="ag-resizer ag-resizer-top"></div>
87
+ <div ref="eTopRightResizer" class="ag-resizer ag-resizer-topRight"></div>
88
+ <div ref="eRightResizer" class="ag-resizer ag-resizer-right"></div>
89
+ <div ref="eBottomRightResizer" class="ag-resizer ag-resizer-bottomRight"></div>
90
+ <div ref="eBottomResizer" class="ag-resizer ag-resizer-bottom"></div>
91
+ <div ref="eBottomLeftResizer" class="ag-resizer ag-resizer-bottomLeft"></div>
92
+ <div ref="eLeftResizer" class="ag-resizer ag-resizer-left"></div>
93
+ </div>`,Li=class extends L{constructor(t,e){super(),this.element=t,this.dragStartPosition={x:0,y:0},this.position={x:0,y:0},this.lastSize={width:-1,height:-1},this.positioned=!1,this.resizersAdded=!1,this.resizeListeners=[],this.boundaryEl=null,this.isResizing=!1,this.isMoving=!1,this.resizable={},this.movable=!1,this.currentResizer=null,this.config=Object.assign({},{popup:!1},e)}center(){const{clientHeight:t,clientWidth:e}=this.offsetParent,s=e/2-this.getWidth()/2,i=t/2-this.getHeight()/2;this.offsetElement(s,i)}initialisePosition(){if(this.positioned)return;const{centered:t,forcePopupParentAsOffsetParent:e,minWidth:s,width:i,minHeight:o,height:r,x:n,y:l}=this.config;this.offsetParent||this.setOffsetParent();let a=0,d=0;const h=ht(this.element);if(h){const c=this.findBoundaryElement(),m=window.getComputedStyle(c);if(m.minWidth!=null){const C=c.offsetWidth-this.element.offsetWidth;d=parseInt(m.minWidth,10)-C}if(m.minHeight!=null){const C=c.offsetHeight-this.element.offsetHeight;a=parseInt(m.minHeight,10)-C}}if(this.minHeight=o||a,this.minWidth=s||d,i&&this.setWidth(i),r&&this.setHeight(r),(!i||!r)&&this.refreshSize(),t)this.center();else if(n||l)this.offsetElement(n,l);else if(h&&e){let c=this.boundaryEl,m=!0;if(c||(c=this.findBoundaryElement(),m=!1),c){const C=parseFloat(c.style.top),v=parseFloat(c.style.left);m?this.offsetElement(isNaN(v)?0:v,isNaN(C)?0:C):this.setPosition(v,C)}}this.positioned=!!this.offsetParent}isPositioned(){return this.positioned}getPosition(){return this.position}setMovable(t,e){if(!this.config.popup||t===this.movable)return;this.movable=t;const s=this.moveElementDragListener||{eElement:e,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};t?(this.dragService.addDragSource(s),this.moveElementDragListener=s):(this.dragService.removeDragSource(s),this.moveElementDragListener=void 0)}setResizable(t){if(this.clearResizeListeners(),t?this.addResizers():this.removeResizers(),typeof t=="boolean"){if(t===!1)return;t={topLeft:t,top:t,topRight:t,right:t,bottomRight:t,bottom:t,bottomLeft:t,left:t}}Object.keys(t).forEach(e=>{const i=!!t[e],o=this.getResizerElement(e),r={dragStartPixels:0,eElement:o,onDragStart:n=>this.onResizeStart(n,e),onDragging:this.onResize.bind(this),onDragStop:n=>this.onResizeEnd(n,e)};(i||!this.isAlive()&&!i)&&(i?(this.dragService.addDragSource(r),this.resizeListeners.push(r),o.style.pointerEvents="all"):o.style.pointerEvents="none",this.resizable[e]=i)})}removeSizeFromEl(){this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("flex")}restoreLastSize(){this.element.style.flex="0 0 auto";const{height:t,width:e}=this.lastSize;e!==-1&&(this.element.style.width=`${e}px`),t!==-1&&(this.element.style.height=`${t}px`)}getHeight(){return this.element.offsetHeight}setHeight(t){const{popup:e}=this.config,s=this.element;let i=!1;if(typeof t=="string"&&t.indexOf("%")!==-1)Bs(s,t),t=Dl(s),i=!0;else if(t=Math.max(this.minHeight,t),this.positioned){const o=this.getAvailableHeight();o&&t>o&&(t=o)}this.getHeight()!==t&&(i?(s.style.maxHeight="unset",s.style.minHeight="unset"):e?Bs(s,t):(s.style.height=`${t}px`,s.style.flex="0 0 auto",this.lastSize.height=typeof t=="number"?t:parseFloat(t)))}getAvailableHeight(){const{popup:t,forcePopupParentAsOffsetParent:e}=this.config;this.positioned||this.initialisePosition();const{clientHeight:s}=this.offsetParent;if(!s)return null;const i=this.element.getBoundingClientRect(),o=this.offsetParent.getBoundingClientRect(),r=t?this.position.y:i.top,n=t?0:o.top;let l=0;if(e){const d=this.element.parentElement;if(d){const{bottom:h}=d.getBoundingClientRect();l=h-i.bottom}}return s+n-r-l}getWidth(){return this.element.offsetWidth}setWidth(t){const e=this.element,{popup:s}=this.config;let i=!1;if(typeof t=="string"&&t.indexOf("%")!==-1)Ft(e,t),t=Eo(e),i=!0;else if(this.positioned){t=Math.max(this.minWidth,t);const{clientWidth:o}=this.offsetParent,r=s?this.position.x:this.element.getBoundingClientRect().left;o&&t+r>o&&(t=o-r)}this.getWidth()!==t&&(i?(e.style.maxWidth="unset",e.style.minWidth="unset"):this.config.popup?Ft(e,t):(e.style.width=`${t}px`,e.style.flex=" unset",this.lastSize.width=typeof t=="number"?t:parseFloat(t)))}offsetElement(t=0,e=0){const{forcePopupParentAsOffsetParent:s}=this.config,i=s?this.boundaryEl:this.element;i&&(this.popupService.positionPopup({ePopup:i,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:t,y:e})}),this.setPosition(parseFloat(i.style.left),parseFloat(i.style.top)))}constrainSizeToAvailableHeight(t){if(!this.config.forcePopupParentAsOffsetParent)return;const e=()=>{const s=this.getAvailableHeight();this.element.style.setProperty("max-height",`${s}px`)};t?this.resizeObserverSubscriber=this.resizeObserverService.observeResize(this.popupService.getPopupParent(),e):(this.element.style.removeProperty("max-height"),this.resizeObserverSubscriber&&(this.resizeObserverSubscriber(),this.resizeObserverSubscriber=void 0))}setPosition(t,e){this.position.x=t,this.position.y=e}updateDragStartPosition(t,e){this.dragStartPosition={x:t,y:e}}calculateMouseMovement(t){const{e,isLeft:s,isTop:i,anywhereWithin:o,topBuffer:r}=t,n=e.clientX-this.dragStartPosition.x,l=e.clientY-this.dragStartPosition.y,a=this.shouldSkipX(e,!!s,!!o,n)?0:n,d=this.shouldSkipY(e,!!i,r,l)?0:l;return{movementX:a,movementY:d}}shouldSkipX(t,e,s,i){const o=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),n=this.boundaryEl.getBoundingClientRect(),l=this.config.popup?this.position.x:o.left;let a=l<=0&&r.left>=t.clientX||r.right<=t.clientX&&r.right<=n.right;return a?!0:(e?a=i<0&&t.clientX>l+r.left||i>0&&t.clientX<l+r.left:s?a=i<0&&t.clientX>n.right||i>0&&t.clientX<l+r.left:a=i<0&&t.clientX>n.right||i>0&&t.clientX<n.right,a)}shouldSkipY(t,e,s=0,i){const o=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),n=this.boundaryEl.getBoundingClientRect(),l=this.config.popup?this.position.y:o.top;let a=l<=0&&r.top>=t.clientY||r.bottom<=t.clientY&&r.bottom<=n.bottom;return a?!0:(e?a=i<0&&t.clientY>l+r.top+s||i>0&&t.clientY<l+r.top:a=i<0&&t.clientY>n.bottom||i>0&&t.clientY<n.bottom,a)}createResizeMap(){const t=this.element;this.resizerMap={topLeft:{element:t.querySelector("[ref=eTopLeftResizer]")},top:{element:t.querySelector("[ref=eTopResizer]")},topRight:{element:t.querySelector("[ref=eTopRightResizer]")},right:{element:t.querySelector("[ref=eRightResizer]")},bottomRight:{element:t.querySelector("[ref=eBottomRightResizer]")},bottom:{element:t.querySelector("[ref=eBottomResizer]")},bottomLeft:{element:t.querySelector("[ref=eBottomLeftResizer]")},left:{element:t.querySelector("[ref=eLeftResizer]")}}}addResizers(){if(this.resizersAdded)return;const t=this.element;if(!t)return;const s=new DOMParser().parseFromString(Bg,"text/html").body;t.appendChild(s.firstChild),this.createResizeMap(),this.resizersAdded=!0}removeResizers(){this.resizerMap=void 0;const t=this.element.querySelector(`.${Uu}`);t&&this.element.removeChild(t),this.resizersAdded=!1}getResizerElement(t){return this.resizerMap[t].element}onResizeStart(t,e){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.currentResizer={isTop:!!e.match(/top/i),isRight:!!e.match(/right/i),isBottom:!!e.match(/bottom/i),isLeft:!!e.match(/left/i)},this.element.classList.add("ag-resizing"),this.resizerMap[e].element.classList.add("ag-active");const{popup:s,forcePopupParentAsOffsetParent:i}=this.config;!s&&!i&&this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop),this.isResizing=!0,this.updateDragStartPosition(t.clientX,t.clientY)}getSiblings(){const e=this.element.parentElement;return e?Array.prototype.slice.call(e.children).filter(s=>!s.classList.contains("ag-hidden")):null}getMinSizeOfSiblings(){const t=this.getSiblings()||[];let e=0,s=0;for(let i=0;i<t.length;i++){const o=t[i],r=!!o.style.flex&&o.style.flex!=="0 0 auto";if(o===this.element)continue;let n=this.minHeight||0,l=this.minWidth||0;if(r){const a=window.getComputedStyle(o);a.minHeight&&(n=parseInt(a.minHeight,10)),a.minWidth&&(l=parseInt(a.minWidth,10))}else n=o.offsetHeight,l=o.offsetWidth;e+=n,s+=l}return{height:e,width:s}}applySizeToSiblings(t){let e=null;const s=this.getSiblings();if(s){for(let i=0;i<s.length;i++){const o=s[i];o!==e&&(t?o.style.height=`${o.offsetHeight}px`:o.style.width=`${o.offsetWidth}px`,o.style.flex="0 0 auto",o===this.element&&(e=s[i+1]))}e&&(e.style.removeProperty("height"),e.style.removeProperty("min-height"),e.style.removeProperty("max-height"),e.style.flex="1 1 auto")}}isResizable(){return Object.values(this.resizable).some(t=>t)}onResize(t){if(!this.isResizing||!this.currentResizer)return;const{popup:e,forcePopupParentAsOffsetParent:s}=this.config,{isTop:i,isRight:o,isBottom:r,isLeft:n}=this.currentResizer,l=o||n,a=r||i,{movementX:d,movementY:h}=this.calculateMouseMovement({e:t,isLeft:n,isTop:i}),c=this.position.x,m=this.position.y;let C=0,v=0;if(l&&d){const S=n?-1:1,w=this.getWidth(),R=w+d*S;let y=!1;n&&(C=w-R,(c+C<=0||R<=this.minWidth)&&(y=!0,C=0)),y||this.setWidth(R)}if(a&&h){const S=i?-1:1,w=this.getHeight(),R=w+h*S;let y=!1;i?(v=w-R,(m+v<=0||R<=this.minHeight)&&(y=!0,v=0)):!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&w<R&&this.getMinSizeOfSiblings().height+R>this.element.parentElement.offsetHeight&&(y=!0),y||this.setHeight(R)}this.updateDragStartPosition(t.clientX,t.clientY),((e||s)&&C||v)&&this.offsetElement(c+C,m+v)}onResizeEnd(t,e){this.isResizing=!1,this.currentResizer=null,this.boundaryEl=null;const s={type:"resize"};this.element.classList.remove("ag-resizing"),this.resizerMap[e].element.classList.remove("ag-active"),this.dispatchEvent(s)}refreshSize(){const t=this.element;this.config.popup&&(this.config.width||this.setWidth(t.offsetWidth),this.config.height||this.setHeight(t.offsetHeight))}onMoveStart(t){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.isMoving=!0,this.element.classList.add("ag-moving"),this.updateDragStartPosition(t.clientX,t.clientY)}onMove(t){if(!this.isMoving)return;const{x:e,y:s}=this.position;let i;this.config.calculateTopBuffer&&(i=this.config.calculateTopBuffer());const{movementX:o,movementY:r}=this.calculateMouseMovement({e:t,isTop:!0,anywhereWithin:!0,topBuffer:i});this.offsetElement(e+o,s+r),this.updateDragStartPosition(t.clientX,t.clientY)}onMoveEnd(){this.isMoving=!1,this.boundaryEl=null,this.element.classList.remove("ag-moving")}setOffsetParent(){this.config.forcePopupParentAsOffsetParent?this.offsetParent=this.popupService.getPopupParent():this.offsetParent=this.element.offsetParent}findBoundaryElement(){let t=this.element;for(;t;){if(window.getComputedStyle(t).position!=="static")return t;t=t.parentElement}return this.element}clearResizeListeners(){for(;this.resizeListeners.length;){const t=this.resizeListeners.pop();this.dragService.removeDragSource(t)}}destroy(){super.destroy(),this.moveElementDragListener&&this.dragService.removeDragSource(this.moveElementDragListener),this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}};u([f("popupService")],Li.prototype,"popupService",2),u([f("resizeObserverService")],Li.prototype,"resizeObserverService",2),u([f("dragService")],Li.prototype,"dragService",2);var Ur=class hr extends K{constructor(e){super(),this.filterNameKey=e,this.applyActive=!1,this.hidePopup=null,this.debouncePending=!1,this.appliedModel=null,this.buttonListeners=[]}postConstruct(){this.resetTemplate(),this.createManagedBean(new ws(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=new Li(this.getPositionableElement(),{forcePopupParentAsOffsetParent:!0}),this.createBean(this.positionableFeature)}handleKeyDown(e){}getFilterTitle(){return this.translate(this.filterNameKey)}isFilterActive(){return!!this.appliedModel}resetTemplate(e){let s=this.getGui();s&&s.removeEventListener("submit",this.onFormSubmit);const i=`
94
+ <form class="ag-filter-wrapper">
95
+ <div class="ag-filter-body-wrapper ag-${this.getCssIdentifier()}-body-wrapper" ref="eFilterBody">
96
+ ${this.createBodyTemplate()}
97
+ </div>
98
+ </form>`;this.setTemplate(i,e),s=this.getGui(),s&&s.addEventListener("submit",this.onFormSubmit)}isReadOnly(){return!!this.providedFilterParams.readOnly}init(e){this.setParams(e),this.resetUiToDefaults(!0).then(()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()})}setParams(e){this.providedFilterParams=e,this.applyActive=hr.isUseApplyButton(e),this.resetButtonsPanel()}updateParams(e){this.providedFilterParams=e,this.applyActive=hr.isUseApplyButton(e),this.resetUiToActiveModel(this.getModel(),()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()})}resetButtonsPanel(){const{buttons:e}=this.providedFilterParams,s=e&&e.length>0&&!this.isReadOnly();if(this.eButtonsPanel?(Le(this.eButtonsPanel),this.buttonListeners.forEach(r=>r==null?void 0:r()),this.buttonListeners=[]):s&&(this.eButtonsPanel=document.createElement("div"),this.eButtonsPanel.classList.add("ag-filter-apply-panel")),!s){this.eButtonsPanel&&Vt(this.eButtonsPanel);return}const i=document.createDocumentFragment(),o=r=>{let n,l;switch(r){case"apply":n=this.translate("applyFilter"),l=h=>this.onBtApply(!1,!1,h);break;case"clear":n=this.translate("clearFilter"),l=()=>this.onBtClear();break;case"reset":n=this.translate("resetFilter"),l=()=>this.onBtReset();break;case"cancel":n=this.translate("cancelFilter"),l=h=>{this.onBtCancel(h)};break;default:console.warn("AG Grid: Unknown button type specified");return}const d=ct(`<button
99
+ type="${r==="apply"?"submit":"button"}"
100
+ ref="${r}FilterButton"
101
+ class="ag-button ag-standard-button ag-filter-apply-panel-button"
102
+ >${n}
103
+ </button>`);this.buttonListeners.push(this.addManagedListener(d,"click",l)),i.append(d)};Gl(e).forEach(r=>o(r)),this.eButtonsPanel.append(i),this.getGui().appendChild(this.eButtonsPanel)}getDefaultDebounceMs(){return 0}setupOnBtApplyDebounce(){const e=hr.getDebounceMs(this.providedFilterParams,this.getDefaultDebounceMs()),s=et(this.checkApplyDebounce.bind(this),e);this.onBtApplyDebounce=()=>{this.debouncePending=!0,s()}}checkApplyDebounce(){this.debouncePending&&(this.debouncePending=!1,this.onBtApply())}getModel(){return this.appliedModel?this.appliedModel:null}setModel(e){return(e!=null?this.setModelIntoUi(e):this.resetUiToDefaults()).then(()=>{this.updateUiVisibility(),this.applyModel("api")})}onBtCancel(e){this.resetUiToActiveModel(this.getModel(),()=>{this.handleCancelEnd(e)})}handleCancelEnd(e){this.providedFilterParams.closeOnApply&&this.close(e)}resetUiToActiveModel(e,s){const i=()=>{this.onUiChanged(!1,"prevent"),s==null||s()};e!=null?this.setModelIntoUi(e).then(i):this.resetUiToDefaults().then(i)}onBtClear(){this.resetUiToDefaults().then(()=>this.onUiChanged())}onBtReset(){this.onBtClear(),this.onBtApply()}applyModel(e="api"){const s=this.getModelFromUi();if(!this.isModelValid(s))return!1;const i=this.appliedModel;return this.appliedModel=s,!this.areModelsEqual(i,s)}isModelValid(e){return!0}onFormSubmit(e){e.preventDefault()}onBtApply(e=!1,s=!1,i){i&&i.preventDefault(),this.applyModel(s?"rowDataUpdated":"ui")&&this.providedFilterParams.filterChangedCallback({afterFloatingFilter:e,afterDataChange:s,source:"columnFilter"});const{closeOnApply:o}=this.providedFilterParams;o&&this.applyActive&&!e&&!s&&this.close(i)}onNewRowsLoaded(){}close(e){if(!this.hidePopup)return;const s=e,i=s&&s.key;let o;(i==="Enter"||i==="Space")&&(o={keyboardEvent:s}),this.hidePopup(o),this.hidePopup=null}onUiChanged(e=!1,s){if(this.updateUiVisibility(),this.providedFilterParams.filterModifiedCallback(),this.applyActive&&!this.isReadOnly()){const i=this.isModelValid(this.getModelFromUi()),o=this.getRefElement("applyFilterButton");o&&Pi(o,!i)}e&&!s||s==="immediately"?this.onBtApply(e):(!this.applyActive&&!s||s==="debounce")&&this.onBtApplyDebounce()}afterGuiAttached(e){e&&(this.hidePopup=e.hidePopup),this.refreshFilterResizer(e==null?void 0:e.container)}refreshFilterResizer(e){if(!this.positionableFeature||e==="toolPanel")return;const s=e==="floatingFilter"||e==="columnFilter",{positionableFeature:i,gos:o}=this;s?(i.restoreLastSize(),i.setResizable(o.get("enableRtl")?{bottom:!0,bottomLeft:!0,left:!0}:{bottom:!0,bottomRight:!0,right:!0})):(this.positionableFeature.removeSizeFromEl(),this.positionableFeature.setResizable(!1)),this.positionableFeature.constrainSizeToAvailableHeight(!0)}afterGuiDetached(){this.checkApplyDebounce(),this.positionableFeature&&this.positionableFeature.constrainSizeToAvailableHeight(!1)}static getDebounceMs(e,s){return hr.isUseApplyButton(e)?(e.debounceMs!=null&&console.warn("AG Grid: debounceMs is ignored when apply button is present"),0):e.debounceMs!=null?e.debounceMs:s}static isUseApplyButton(e){return!!e.buttons&&e.buttons.indexOf("apply")>=0}refresh(e){return this.providedFilterParams=e,!0}destroy(){const e=this.getGui();e&&e.removeEventListener("submit",this.onFormSubmit),this.hidePopup=null,this.positionableFeature&&(this.positionableFeature=this.destroyBean(this.positionableFeature)),this.appliedModel=null,super.destroy()}translate(e){return this.localeService.getLocaleTextFunc()(e,Wu[e])}getCellValue(e){return this.providedFilterParams.getValue(e)}getPositionableElement(){return this.eFilterBody}};u([f("rowModel")],Ur.prototype,"rowModel",2),u([I("eFilterBody")],Ur.prototype,"eFilterBody",2),u([M],Ur.prototype,"postConstruct",1);var zr=Ur,_l=class extends K{constructor(t,e){super(e),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=t||{}}postConstruct(){this.addCssClass("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:t,label:e,labelWidth:s,labelAlignment:i,disabled:o}=this.config;o!=null&&this.setDisabled(o),t!=null&&this.setLabelSeparator(t),e!=null&&this.setLabel(e),s!=null&&this.setLabelWidth(s),this.setLabelAlignment(i||this.labelAlignment),this.refreshLabel()}refreshLabel(){Le(this.eLabel),typeof this.label=="string"?this.eLabel.innerText=this.label+this.labelSeparator:this.label&&this.eLabel.appendChild(this.label),this.label===""?($(this.eLabel,!1),Ae(this.eLabel,"presentation")):($(this.eLabel,!0),Ae(this.eLabel,null))}setLabelSeparator(t){return this.labelSeparator===t?this:(this.labelSeparator=t,this.label!=null&&this.refreshLabel(),this)}getLabelId(){return this.eLabel.id=this.eLabel.id||`ag-${this.getCompId()}-label`,this.eLabel.id}getLabel(){return this.label}setLabel(t){return this.label===t?this:(this.label=t,this.refreshLabel(),this)}setLabelAlignment(t){const s=this.getGui().classList;return s.toggle("ag-label-align-left",t==="left"),s.toggle("ag-label-align-right",t==="right"),s.toggle("ag-label-align-top",t==="top"),this}setLabelEllipsis(t){return this.eLabel.classList.toggle("ag-label-ellipsis",t),this}setLabelWidth(t){return this.label==null?this:(To(this.eLabel,t),this)}setDisabled(t){t=!!t;const e=this.getGui();return Pi(e,t),e.classList.toggle("ag-disabled",t),this.disabled=t,this}isDisabled(){return!!this.disabled}};u([M],_l.prototype,"postConstruct",1);var zu=class extends _l{constructor(t,e,s){super(t,e),this.className=s}postConstruct(){super.postConstruct();const{width:t,value:e,onValueChange:s}=this.config;t!=null&&this.setWidth(t),e!=null&&this.setValue(e),s!=null&&this.onValueChange(s),this.className&&this.addCssClass(this.className),this.refreshAriaLabelledBy()}refreshAriaLabelledBy(){const t=this.getAriaElement(),e=this.getLabelId();tu(t)!==null?bi(t,""):bi(t,e??"")}setAriaLabel(t){return St(this.getAriaElement(),t),this.refreshAriaLabelledBy(),this}onValueChange(t){return this.addManagedListener(this,p.EVENT_FIELD_VALUE_CHANGED,()=>t(this.getValue())),this}getWidth(){return this.getGui().clientWidth}setWidth(t){return Ft(this.getGui(),t),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(t,e){return this.value===t?this:(this.previousValue=this.value,this.value=t,e||this.dispatchEvent({type:p.EVENT_FIELD_VALUE_CHANGED}),this)}},Wg=`
104
+ <div class="ag-picker-field" role="presentation">
105
+ <div ref="eLabel"></div>
106
+ <div ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-picker-collapsed">
107
+ <div ref="eDisplayField" class="ag-picker-field-display"></div>
108
+ <div ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>
109
+ </div>
110
+ </div>`,Ws=class extends zu{constructor(t){if(super(t,(t==null?void 0:t.template)||Wg,t==null?void 0:t.className),this.isPickerDisplayed=!1,this.skipClick=!1,this.pickerGap=4,this.hideCurrentPicker=null,this.ariaRole=t==null?void 0:t.ariaRole,this.onPickerFocusIn=this.onPickerFocusIn.bind(this),this.onPickerFocusOut=this.onPickerFocusOut.bind(this),!t)return;const{pickerGap:e,maxPickerHeight:s,variableWidth:i,minPickerWidth:o,maxPickerWidth:r}=t;e!=null&&(this.pickerGap=e),this.variableWidth=!!i,s!=null&&this.setPickerMaxHeight(s),o!=null&&this.setPickerMinWidth(o),r!=null&&this.setPickerMaxWidth(r)}postConstruct(){super.postConstruct(),this.setupAria();const t=`ag-${this.getCompId()}-display`;this.eDisplayField.setAttribute("id",t);const e=this.getAriaElement();this.addManagedListener(e,"keydown",this.onKeyDown.bind(this)),this.addManagedListener(this.eLabel,"mousedown",this.onLabelOrWrapperMouseDown.bind(this)),this.addManagedListener(this.eWrapper,"mousedown",this.onLabelOrWrapperMouseDown.bind(this));const{pickerIcon:s,inputWidth:i}=this.config;if(s){const o=be(s,this.gos);o&&this.eIcon.appendChild(o)}i!=null&&this.setInputWidth(i)}setupAria(){const t=this.getAriaElement();t.setAttribute("tabindex",this.gos.get("tabIndex").toString()),ls(t,!1),this.ariaRole&&Ae(t,this.ariaRole)}onLabelOrWrapperMouseDown(t){if(t){const e=this.getFocusableElement();if(e!==this.eWrapper&&(t==null?void 0:t.target)===e)return;t.preventDefault(),this.getFocusableElement().focus()}if(this.skipClick){this.skipClick=!1;return}this.isDisabled()||(this.isPickerDisplayed?this.hidePicker():this.showPicker())}onKeyDown(t){switch(t.key){case E.UP:case E.DOWN:case E.ENTER:case E.SPACE:t.preventDefault(),this.onLabelOrWrapperMouseDown();break;case E.ESCAPE:this.isPickerDisplayed&&(t.preventDefault(),t.stopPropagation(),this.hideCurrentPicker&&this.hideCurrentPicker());break}}showPicker(){this.isPickerDisplayed=!0,this.pickerComponent||(this.pickerComponent=this.createPickerComponent());const t=this.pickerComponent.getGui();t.addEventListener("focusin",this.onPickerFocusIn),t.addEventListener("focusout",this.onPickerFocusOut),this.hideCurrentPicker=this.renderAndPositionPicker(),this.toggleExpandedStyles(!0)}renderAndPositionPicker(){const t=this.gos.getDocument(),e=this.pickerComponent.getGui();this.gos.get("suppressScrollWhenPopupsAreOpen")||(this.destroyMouseWheelFunc=this.addManagedListener(this.eventService,p.EVENT_BODY_SCROLL,()=>{this.hidePicker()}));const s=this.localeService.getLocaleTextFunc(),{pickerAriaLabelKey:i,pickerAriaLabelValue:o,modalPicker:r=!0}=this.config,n={modal:r,eChild:e,closeOnEsc:!0,closedCallback:()=>{const C=this.gos.getActiveDomElement(),v=!C||C===t.body;this.beforeHidePicker(),v&&this.isAlive()&&this.getFocusableElement().focus()},ariaLabel:s(i,o)},l=this.popupService.addPopup(n),{maxPickerHeight:a,minPickerWidth:d,maxPickerWidth:h,variableWidth:c}=this;c?(d&&(e.style.minWidth=d),e.style.width=Hr(Eo(this.eWrapper)),h&&(e.style.maxWidth=h)):To(e,h??Eo(this.eWrapper));const m=a??`${So(this.popupService.getPopupParent())}px`;return e.style.setProperty("max-height",m),e.style.position="absolute",this.alignPickerToComponent(),l.hideFunc}alignPickerToComponent(){if(!this.pickerComponent)return;const{pickerType:t}=this.config,{pickerGap:e}=this,s=this.gos.get("enableRtl")?"right":"left";this.popupService.positionPopupByComponent({type:t,eventSource:this.eWrapper,ePopup:this.pickerComponent.getGui(),position:"under",alignSide:s,keepWithinBounds:!0,nudgeY:e})}beforeHidePicker(){this.destroyMouseWheelFunc&&(this.destroyMouseWheelFunc(),this.destroyMouseWheelFunc=void 0),this.toggleExpandedStyles(!1);const t=this.pickerComponent.getGui();t.removeEventListener("focusin",this.onPickerFocusIn),t.removeEventListener("focusout",this.onPickerFocusOut),this.isPickerDisplayed=!1,this.pickerComponent=void 0,this.hideCurrentPicker=null}toggleExpandedStyles(t){if(!this.isAlive())return;const e=this.getAriaElement();ls(e,t),this.eWrapper.classList.toggle("ag-picker-expanded",t),this.eWrapper.classList.toggle("ag-picker-collapsed",!t)}onPickerFocusIn(){this.togglePickerHasFocus(!0)}onPickerFocusOut(t){var e;(e=this.pickerComponent)!=null&&e.getGui().contains(t.relatedTarget)||this.togglePickerHasFocus(!1)}togglePickerHasFocus(t){this.pickerComponent&&this.eWrapper.classList.toggle("ag-picker-has-focus",t)}hidePicker(){this.hideCurrentPicker&&this.hideCurrentPicker()}setInputWidth(t){return To(this.eWrapper,t),this}getFocusableElement(){return this.eWrapper}setPickerGap(t){return this.pickerGap=t,this}setPickerMinWidth(t){return typeof t=="number"&&(t=`${t}px`),this.minPickerWidth=t??void 0,this}setPickerMaxWidth(t){return typeof t=="number"&&(t=`${t}px`),this.maxPickerWidth=t??void 0,this}setPickerMaxHeight(t){return typeof t=="number"&&(t=`${t}px`),this.maxPickerHeight=t??void 0,this}destroy(){this.hidePicker(),super.destroy()}};u([f("popupService")],Ws.prototype,"popupService",2),u([I("eLabel")],Ws.prototype,"eLabel",2),u([I("eWrapper")],Ws.prototype,"eWrapper",2),u([I("eDisplayField")],Ws.prototype,"eDisplayField",2),u([I("eIcon")],Ws.prototype,"eIcon",2);var Kr=class Pn extends K{constructor(e="default",s=!1){super(`<div class="ag-list ag-${e}-list" role="listbox"></div>`),this.cssIdentifier=e,this.unFocusable=s,this.options=[],this.itemEls=[]}init(){const e=this.getGui();this.addManagedListener(e,"mouseleave",()=>this.clearHighlighted()),!this.unFocusable&&this.addManagedListener(e,"keydown",this.handleKeyDown.bind(this))}handleKeyDown(e){const s=e.key;switch(s){case E.ENTER:if(!this.highlightedEl)this.setValue(this.getValue());else{const i=this.itemEls.indexOf(this.highlightedEl);this.setValueByIndex(i)}break;case E.DOWN:case E.UP:e.preventDefault(),this.navigate(s);break;case E.PAGE_DOWN:case E.PAGE_UP:case E.PAGE_HOME:case E.PAGE_END:e.preventDefault(),this.navigateToPage(s);break}}navigate(e){const s=e===E.DOWN;let i;if(!this.highlightedEl)i=this.itemEls[s?0:this.itemEls.length-1];else{let r=this.itemEls.indexOf(this.highlightedEl)+(s?1:-1);r=Math.min(Math.max(r,0),this.itemEls.length-1),i=this.itemEls[r]}this.highlightItem(i)}navigateToPage(e){if(!this.highlightedEl||this.itemEls.length===0)return;const s=this.itemEls.indexOf(this.highlightedEl),i=this.options.length-1,o=this.itemEls[0].clientHeight,r=Math.floor(this.getGui().clientHeight/o);let n=-1;e===E.PAGE_HOME?n=0:e===E.PAGE_END?n=i:e===E.PAGE_DOWN?n=Math.min(s+r,i):e===E.PAGE_UP&&(n=Math.max(s-r,0)),n!==-1&&this.highlightItem(this.itemEls[n])}addOptions(e){return e.forEach(s=>this.addOption(s)),this}addOption(e){const{value:s,text:i}=e,o=i||s;return this.options.push({value:s,text:o}),this.renderOption(s,o),this.updateIndices(),this}clearOptions(){this.options=[],this.reset(!0),this.itemEls.forEach(e=>{Vt(e)}),this.itemEls=[]}updateIndices(){const e=this.getGui().querySelectorAll(".ag-list-item");e.forEach((s,i)=>{Nr(s,i+1),Ir(s,e.length)})}renderOption(e,s){const i=this.gos.getDocument(),o=i.createElement("div");Ae(o,"option"),o.classList.add("ag-list-item",`ag-${this.cssIdentifier}-list-item`);const r=i.createElement("span");o.appendChild(r),r.textContent=s,this.unFocusable||(o.tabIndex=-1),this.itemEls.push(o),this.addManagedListener(o,"mousemove",()=>this.highlightItem(o)),this.addManagedListener(o,"mousedown",n=>{n.preventDefault(),this.setValue(e)}),this.createManagedBean(new ds({getTooltipValue:()=>s,getGui:()=>o,getLocation:()=>"UNKNOWN",shouldDisplayTooltip:()=>r.scrollWidth>r.clientWidth})),this.getGui().appendChild(o)}setValue(e,s){if(this.value===e)return this.fireItemSelected(),this;if(e==null)return this.reset(s),this;const i=this.options.findIndex(o=>o.value===e);if(i!==-1){const o=this.options[i];this.value=o.value,this.displayValue=o.text,this.highlightItem(this.itemEls[i]),s||this.fireChangeEvent()}return this}setValueByIndex(e){return this.setValue(this.options[e].value)}getValue(){return this.value}getDisplayValue(){return this.displayValue}refreshHighlighted(){this.clearHighlighted();const e=this.options.findIndex(s=>s.value===this.value);e!==-1&&this.highlightItem(this.itemEls[e])}reset(e){this.value=null,this.displayValue=null,this.clearHighlighted(),e||this.fireChangeEvent()}highlightItem(e){if(!ht(e))return;this.clearHighlighted(),this.highlightedEl=e,this.highlightedEl.classList.add(Pn.ACTIVE_CLASS),Ti(this.highlightedEl,!0);const s=this.getGui(),{scrollTop:i,clientHeight:o}=s,{offsetTop:r,offsetHeight:n}=e;(r+n>i+o||r<i)&&this.highlightedEl.scrollIntoView({block:"nearest"}),this.unFocusable||this.highlightedEl.focus()}clearHighlighted(){!this.highlightedEl||!ht(this.highlightedEl)||(this.highlightedEl.classList.remove(Pn.ACTIVE_CLASS),Ti(this.highlightedEl,!1),this.highlightedEl=null)}fireChangeEvent(){this.dispatchEvent({type:p.EVENT_FIELD_VALUE_CHANGED}),this.fireItemSelected()}fireItemSelected(){this.dispatchEvent({type:Pn.EVENT_ITEM_SELECTED})}};Kr.EVENT_ITEM_SELECTED="selectedItem",Kr.ACTIVE_CLASS="ag-active-item",u([M],Kr.prototype,"init",1);var Ku=Kr,Yu=class uc extends Ws{constructor(e){super(_({pickerAriaLabelKey:"ariaLabelSelectField",pickerAriaLabelValue:"Select Field",pickerType:"ag-list",className:"ag-select",pickerIcon:"smallDown",ariaRole:"combobox"},e))}postConstruct(){super.postConstruct(),this.createListComponent(),this.eWrapper.tabIndex=this.gos.get("tabIndex");const{options:e,value:s,placeholder:i}=this.config;e!=null&&this.addOptions(e),s!=null&&this.setValue(s,!0),i&&s==null&&(this.eDisplayField.textContent=i),this.addManagedListener(this.eWrapper,"focusout",this.onWrapperFocusOut.bind(this))}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}createListComponent(){this.listComponent=this.createBean(new Ku("select",!0)),this.listComponent.setParentComponent(this);const e=this.listComponent.getAriaElement(),s=`ag-select-list-${this.listComponent.getCompId()}`;e.setAttribute("id",s),al(this.getAriaElement(),e),this.listComponent.addManagedListener(this.listComponent,Ku.EVENT_ITEM_SELECTED,()=>{this.hidePicker(),this.dispatchEvent({type:uc.EVENT_ITEM_SELECTED})}),this.listComponent.addManagedListener(this.listComponent,p.EVENT_FIELD_VALUE_CHANGED,()=>{this.listComponent&&(this.setValue(this.listComponent.getValue(),!1,!0),this.hidePicker())})}createPickerComponent(){return this.listComponent}onKeyDown(e){var s;const{key:i}=e;switch(i===E.TAB&&this.hidePicker(),i){case E.ENTER:case E.UP:case E.DOWN:case E.PAGE_UP:case E.PAGE_DOWN:case E.PAGE_HOME:case E.PAGE_END:e.preventDefault(),this.isPickerDisplayed?(s=this.listComponent)==null||s.handleKeyDown(e):super.onKeyDown(e);break;case E.ESCAPE:super.onKeyDown(e);break}}showPicker(){this.listComponent&&(super.showPicker(),this.listComponent.refreshHighlighted())}addOptions(e){return e.forEach(s=>this.addOption(s)),this}addOption(e){return this.listComponent.addOption(e),this}clearOptions(){var e;return(e=this.listComponent)==null||e.clearOptions(),this}setValue(e,s,i){if(this.value===e||!this.listComponent)return this;if(i||this.listComponent.setValue(e,!0),this.listComponent.getValue()===this.getValue())return this;let r=this.listComponent.getDisplayValue();return r==null&&this.config.placeholder&&(r=this.config.placeholder),this.eDisplayField.textContent=r,this.setTooltip({newTooltipText:r??null,shouldDisplayTooltip:()=>this.eDisplayField.scrollWidth>this.eDisplayField.clientWidth}),super.setValue(e,s)}destroy(){this.listComponent&&(this.destroyBean(this.listComponent),this.listComponent=void 0),super.destroy()}};Yu.EVENT_ITEM_SELECTED="selectedItem";var Yr=Yu,Ht=class extends zu{constructor(t,e,s="text",i="input"){super(t,`
111
+ <div role="presentation">
112
+ <div ref="eLabel" class="ag-input-field-label"></div>
113
+ <div ref="eWrapper" class="ag-wrapper ag-input-wrapper" role="presentation">
114
+ <${i} ref="eInput" class="ag-input-field-input"></${i}>
115
+ </div>
116
+ </div>`,e),this.inputType=s,this.displayFieldTag=i}postConstruct(){super.postConstruct(),this.setInputType(),this.eLabel.classList.add(`${this.className}-label`),this.eWrapper.classList.add(`${this.className}-input-wrapper`),this.eInput.classList.add(`${this.className}-input`),this.addCssClass("ag-input-field"),this.eInput.id=this.eInput.id||`ag-${this.getCompId()}-input`;const{inputName:t,inputWidth:e}=this.config;t!=null&&this.setInputName(t),e!=null&&this.setInputWidth(e),this.addInputListeners(),this.activateTabIndex([this.eInput])}addInputListeners(){this.addManagedListener(this.eInput,"input",t=>this.setValue(t.target.value))}setInputType(){this.displayFieldTag==="input"&&this.eInput.setAttribute("type",this.inputType)}getInputElement(){return this.eInput}setInputWidth(t){return To(this.eWrapper,t),this}setInputName(t){return this.getInputElement().setAttribute("name",t),this}getFocusableElement(){return this.eInput}setMaxLength(t){const e=this.eInput;return e.maxLength=t,this}setInputPlaceholder(t){return Qt(this.eInput,"placeholder",t),this}setInputAriaLabel(t){return St(this.eInput,t),this.refreshAriaLabelledBy(),this}setDisabled(t){return Pi(this.eInput,t),super.setDisabled(t)}setAutoComplete(t){if(t===!0)Qt(this.eInput,"autocomplete",null);else{const e=typeof t=="string"?t:"off";Qt(this.eInput,"autocomplete",e)}return this}};u([I("eLabel")],Ht.prototype,"eLabel",2),u([I("eWrapper")],Ht.prototype,"eWrapper",2),u([I("eInput")],Ht.prototype,"eInput",2);var jr=class extends Ht{constructor(t,e="ag-checkbox",s="checkbox"){super(t,e,s),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();const{readOnly:t,passive:e}=this.config;typeof t=="boolean"&&this.setReadOnly(t),typeof e=="boolean"&&this.setPassive(e)}addInputListeners(){this.addManagedListener(this.eInput,"click",this.onCheckboxClick.bind(this)),this.addManagedListener(this.eLabel,"click",this.toggle.bind(this))}getNextValue(){return this.selected===void 0?!0:!this.selected}setPassive(t){this.passive=t}isReadOnly(){return this.readOnly}setReadOnly(t){this.eWrapper.classList.toggle("ag-disabled",t),this.eInput.disabled=t,this.readOnly=t}setDisabled(t){return this.eWrapper.classList.toggle("ag-disabled",t),super.setDisabled(t)}toggle(){if(this.eInput.disabled)return;const t=this.isSelected(),e=this.getNextValue();this.passive?this.dispatchChange(e,t):this.setValue(e)}getValue(){return this.isSelected()}setValue(t,e){return this.refreshSelectedClass(t),this.setSelected(t,e),this}setName(t){const e=this.getInputElement();return e.name=t,this}isSelected(){return this.selected}setSelected(t,e){this.isSelected()!==t&&(this.previousValue=this.isSelected(),t=this.selected=typeof t=="boolean"?t:void 0,this.eInput.checked=t,this.eInput.indeterminate=t===void 0,e||this.dispatchChange(this.selected,this.previousValue))}dispatchChange(t,e,s){this.dispatchEvent({type:p.EVENT_FIELD_VALUE_CHANGED,selected:t,previousValue:e,event:s});const i=this.getInputElement(),o={type:p.EVENT_CHECKBOX_CHANGED,id:i.id,name:i.name,selected:t,previousValue:e};this.eventService.dispatchEvent(o)}onCheckboxClick(t){if(this.passive||this.eInput.disabled)return;const e=this.isSelected(),s=this.selected=t.target.checked;this.refreshSelectedClass(s),this.dispatchChange(s,e,t)}refreshSelectedClass(t){this.eWrapper.classList.toggle("ag-checked",t===!0),this.eWrapper.classList.toggle("ag-indeterminate",t==null)}},ju=class extends jr{constructor(t){super(t,"ag-radio-button","radio")}isSelected(){return this.eInput.checked}toggle(){this.eInput.disabled||this.isSelected()||this.setValue(!0)}addInputListeners(){super.addInputListeners(),this.addManagedListener(this.eventService,p.EVENT_CHECKBOX_CHANGED,this.onChange.bind(this))}onChange(t){t.selected&&t.name&&this.eInput.name&&this.eInput.name===t.name&&t.id&&this.eInput.id!==t.id&&this.setValue(!1,!0)}},Vl=class{constructor(t,e,s){this.localeService=t,this.optionsFactory=e,this.valueFormatter=s}getModelAsString(t){if(!t)return null;const e=t.operator!=null,s=this.localeService.getLocaleTextFunc();if(e){const i=t;let{conditions:o}=i;if(!o){const{condition1:l,condition2:a}=i;o=[l,a]}const r=o.map(l=>this.getModelAsString(l)),n=i.operator==="AND"?"andCondition":"orCondition";return r.join(` ${s(n,Wu[n])} `)}else{if(t.type===Pe.BLANK||t.type===Pe.NOT_BLANK)return s(t.type,t.type);{const i=t,o=this.optionsFactory.getCustomOption(i.type),{displayKey:r,displayName:n,numberOfInputs:l}=o||{};return r&&n&&l===0?(s(r,n),n):this.conditionToString(i,o)}}}updateParams(t){this.optionsFactory=t.optionsFactory}formatValue(t){var e;return this.valueFormatter?(e=this.valueFormatter(t??null))!=null?e:"":String(t)}},st=class io extends zr{constructor(){super(...arguments),this.eTypes=[],this.eJoinOperatorPanels=[],this.eJoinOperatorsAnd=[],this.eJoinOperatorsOr=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}getNumberOfInputs(e){const s=this.optionsFactory.getCustomOption(e);if(s){const{numberOfInputs:o}=s;return o??1}const i=[io.EMPTY,io.NOT_BLANK,io.BLANK];return e&&i.indexOf(e)>=0?0:e===io.IN_RANGE?2:1}onFloatingFilterChanged(e,s){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(s),this.onUiChanged(!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((s,i)=>{i===0?s.setValue(e,!0):s.setValue(this.optionsFactory.getDefaultOption(),!0)})}getModelFromUi(){const e=this.getUiCompleteConditions();return e.length===0?null:this.maxNumConditions>1&&e.length>1?{filterType:this.getFilterType(),operator:this.getJoinOperator(),condition1:e[0],condition2:e[1],conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map(e=>e.getValue())}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){return this.eJoinOperatorsOr.length===0?this.defaultJoinOperator:this.eJoinOperatorsOr[0].getValue()===!0?"OR":"AND"}areModelsEqual(e,s){if(!e&&!s)return!0;if(!e&&s||e&&!s)return!1;const i=!e.operator,o=!s.operator;if(!i&&o||i&&!o)return!1;let n;if(i){const l=e,a=s;n=this.areSimpleModelsEqual(l,a)}else{const l=e,a=s;n=l.operator===a.operator&&jt(l.conditions,a.conditions,(d,h)=>this.areSimpleModelsEqual(d,h))}return n}shouldRefresh(e){var s,i,o;const r=this.getModel(),n=r?(s=r.conditions)!=null?s:[r]:null,l=(o=(i=e.filterOptions)==null?void 0:i.map(d=>typeof d=="string"?d:d.displayKey))!=null?o:this.getDefaultFilterOptions();return!(!(!n||n.every(d=>l.find(h=>h===d.type)!==void 0))||typeof e.maxNumConditions=="number"&&n&&n.length>e.maxNumConditions)}refresh(e){return!this.shouldRefresh(e)||!super.refresh(e)?!1:(this.setParams(e),this.removeConditionsAndOperators(0),this.createOption(),this.setModel(this.getModel()),!0)}setModelIntoUi(e){if(e.operator){let i=e;i.conditions||(i.conditions=[i.condition1,i.condition2]);const o=this.validateAndUpdateConditions(i.conditions),r=this.getNumConditions();if(o<r)this.removeConditionsAndOperators(o);else if(o>r)for(let l=r;l<o;l++)this.createJoinOperatorPanel(),this.createOption();const n=i.operator==="OR";this.eJoinOperatorsAnd.forEach(l=>l.setValue(!n,!0)),this.eJoinOperatorsOr.forEach(l=>l.setValue(n,!0)),i.conditions.forEach((l,a)=>{this.eTypes[a].setValue(l.type,!0),this.setConditionIntoUi(l,a)})}else{const i=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(i.type,!0),this.setConditionIntoUi(i,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.onUiChanged(),xe.resolve()}validateAndUpdateConditions(e){let s=e.length;return s>this.maxNumConditions&&(e.splice(this.maxNumConditions),H('Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.'),s=this.maxNumConditions),s}doesFilterPass(e){var s;const i=this.getModel();if(i==null)return!0;const{operator:o}=i,r=[];if(o){const l=i;r.push(...(s=l.conditions)!=null?s:[])}else r.push(i);return r[o&&o==="OR"?"some":"every"](l=>this.individualConditionPasses(e,l))}setParams(e){super.setParams(e),this.setNumConditions(e),this.defaultJoinOperator=this.getDefaultJoinOperator(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.optionsFactory=new Bu,this.optionsFactory.init(e,this.getDefaultFilterOptions()),this.createFilterListOptions(),this.createOption(),this.createMissingConditionsAndOperators(),this.isReadOnly()&&this.eFilterBody.setAttribute("tabindex","-1")}setNumConditions(e){var s,i;e.suppressAndOrCondition!=null&&H('Since v29.2 "filterParams.suppressAndOrCondition" is deprecated. Use "filterParams.maxNumConditions = 1" instead.'),e.alwaysShowBothConditions!=null&&H('Since v29.2 "filterParams.alwaysShowBothConditions" is deprecated. Use "filterParams.numAlwaysVisibleConditions = 2" instead.'),this.maxNumConditions=(s=e.maxNumConditions)!=null?s:e.suppressAndOrCondition?1:2,this.maxNumConditions<1&&(H('"filterParams.maxNumConditions" must be greater than or equal to zero.'),this.maxNumConditions=1),this.numAlwaysVisibleConditions=(i=e.numAlwaysVisibleConditions)!=null?i:e.alwaysShowBothConditions?2:1,this.numAlwaysVisibleConditions<1&&(H('"filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.'),this.numAlwaysVisibleConditions=1),this.numAlwaysVisibleConditions>this.maxNumConditions&&(H('"filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".'),this.numAlwaysVisibleConditions=this.maxNumConditions)}createOption(){const e=this.createManagedBean(new Yr);this.eTypes.push(e),e.addCssClass("ag-filter-select"),this.eFilterBody.appendChild(e.getGui());const s=this.createValueElement();this.eConditionBodies.push(s),this.eFilterBody.appendChild(s),this.putOptionsIntoDropdown(e),this.resetType(e);const i=this.getNumConditions()-1;this.forEachPositionInput(i,o=>this.resetInput(o)),this.addChangedListeners(e,i)}createJoinOperatorPanel(){const e=document.createElement("div");this.eJoinOperatorPanels.push(e),e.classList.add("ag-filter-condition");const s=this.createJoinOperator(this.eJoinOperatorsAnd,e,"and"),i=this.createJoinOperator(this.eJoinOperatorsOr,e,"or");this.eFilterBody.appendChild(e);const o=this.eJoinOperatorPanels.length-1,r=this.joinOperatorId++;this.resetJoinOperatorAnd(s,o,r),this.resetJoinOperatorOr(i,o,r),this.isReadOnly()||(s.onValueChange(this.listener),i.onValueChange(this.listener))}createJoinOperator(e,s,i){const o=this.createManagedBean(new ju);return e.push(o),o.addCssClass("ag-filter-condition-operator"),o.addCssClass(`ag-filter-condition-operator-${i}`),s.appendChild(o.getGui()),o}getDefaultJoinOperator(e){return e==="AND"||e==="OR"?e:"AND"}createFilterListOptions(){const e=this.optionsFactory.getFilterOptions();this.filterListOptions=e.map(s=>typeof s=="string"?this.createBoilerplateListOption(s):this.createCustomListOption(s))}putOptionsIntoDropdown(e){this.filterListOptions.forEach(s=>{e.addOption(s)}),e.setDisabled(this.filterListOptions.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:s}=e,i=this.optionsFactory.getCustomOption(e.displayKey);return{value:s,text:i?this.localeService.getLocaleTextFunc()(i.displayKey,i.displayName):this.translate(s)}}isAllowTwoConditions(){return this.maxNumConditions>=2}createBodyTemplate(){return""}getCssIdentifier(){return"simple-filter"}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){var e;let s=-1,i=!0;for(let o=0;o<this.getNumConditions();o++)this.isConditionUiComplete(o)?s=o:i=!1;if(this.shouldAddNewConditionAtEnd(i))this.createJoinOperatorPanel(),this.createOption();else{const o=(e=this.lastUiCompletePosition)!=null?e:this.getNumConditions()-2;if(s<o){this.removeConditionsAndOperators(o+1);const r=s+1,n=o-r;n>0&&this.removeConditionsAndOperators(r,n),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=s}updateConditionStatusesAndValues(e,s){this.eTypes.forEach((o,r)=>{const n=this.isConditionDisabled(r,e);o.setDisabled(n||this.filterListOptions.length<=1),r===1&&(Pi(this.eJoinOperatorPanels[0],n),this.eJoinOperatorsAnd[0].setDisabled(n),this.eJoinOperatorsOr[0].setDisabled(n))}),this.eConditionBodies.forEach((o,r)=>{$(o,this.isConditionBodyVisible(r))});const i=(s??this.getJoinOperator())==="OR";this.eJoinOperatorsAnd.forEach((o,r)=>{o.setValue(!i,!0)}),this.eJoinOperatorsOr.forEach((o,r)=>{o.setValue(i,!0)}),this.forEachInput((o,r,n,l)=>{this.setElementDisplayed(o,r<l),this.setElementDisabled(o,this.isConditionDisabled(n,e))}),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,s){if(e>=this.getNumConditions())return;this.removeComponents(this.eTypes,e,s),this.removeElements(this.eConditionBodies,e,s),this.removeValueElements(e,s);const i=Math.max(e-1,0);this.removeElements(this.eJoinOperatorPanels,i,s),this.removeComponents(this.eJoinOperatorsAnd,i,s),this.removeComponents(this.eJoinOperatorsOr,i,s)}removeElements(e,s,i){this.removeItems(e,s,i).forEach(r=>Vt(r))}removeComponents(e,s,i){this.removeItems(e,s,i).forEach(r=>{Vt(r.getGui()),this.destroyBean(r)})}removeItems(e,s,i){return i==null?e.splice(s):e.splice(s,i)}afterGuiAttached(e){if(super.afterGuiAttached(e),this.resetPlaceholder(),!(e!=null&&e.suppressFocus))if(this.isReadOnly())this.eFilterBody.focus();else{const s=this.getInputs(0)[0];if(!s)return;s instanceof Ht&&s.getInputElement().focus()}}afterGuiDetached(){super.afterGuiDetached();const e=this.getModel();this.resetUiToActiveModel(e);let s=-1,i=-1,o=!1;const r=this.getJoinOperator();for(let l=this.getNumConditions()-1;l>=0;l--)if(this.isConditionUiComplete(l))s===-1&&(s=l,i=l);else{const a=l>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(l-1),d=l<s;(a||d)&&(this.removeConditionsAndOperators(l,1),o=!0,d&&i--)}let n=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),n=!0),this.shouldAddNewConditionAtEnd(i===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),n=!0),n&&this.updateConditionStatusesAndValues(i,r),o&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=i}getPlaceholderText(e,s){let i=this.translate(e);if(br(this.filterPlaceholder)){const o=this.filterPlaceholder,r=this.eTypes[s].getValue(),n=this.translate(r);i=o({filterOptionKey:r,filterOption:n,placeholder:i})}else typeof this.filterPlaceholder=="string"&&(i=this.filterPlaceholder);return i}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc();this.forEachInput((s,i,o,r)=>{if(!(s instanceof Ht))return;const n=i===0&&r>1?"inRangeStart":i===0?"filterOoo":"inRangeEnd",l=i===0&&r>1?e("ariaFilterFromValue","Filter from value"):i===0?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");s.setInputPlaceholder(this.getPlaceholderText(n,o)),s.setInputAriaLabel(l)})}setElementValue(e,s,i){e instanceof Ht&&e.setValue(s!=null?String(s):null,!0)}setElementDisplayed(e,s){e instanceof K&&$(e.getGui(),s)}setElementDisabled(e,s){e instanceof K&&Pi(e.getGui(),s)}attachElementOnChange(e,s){e instanceof Ht&&e.onValueChange(s)}forEachInput(e){this.getConditionTypes().forEach((s,i)=>{this.forEachPositionTypeInput(i,s,e)})}forEachPositionInput(e,s){const i=this.getConditionType(e);this.forEachPositionTypeInput(e,i,s)}forEachPositionTypeInput(e,s,i){const o=this.getNumberOfInputs(s),r=this.getInputs(e);for(let n=0;n<r.length;n++){const l=r[n];l!=null&&i(l,n,e,o)}}isConditionDisabled(e,s){return this.isReadOnly()?!0:e===0?!1:e>s+1}isConditionBodyVisible(e){const s=this.getConditionType(e);return this.getNumberOfInputs(s)>0}isConditionUiComplete(e){return!(e>=this.getNumConditions()||this.getConditionType(e)===io.EMPTY||this.getValues(e).some(i=>i==null))}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const e=[];for(let s=0;s<this.getNumConditions();s++)this.isConditionUiComplete(s)&&e.push(this.createCondition(s));return e}createMissingConditionsAndOperators(){if(!this.isReadOnly())for(let e=this.getNumConditions();e<this.numAlwaysVisibleConditions;e++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){return this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach(s=>this.resetType(s)),this.eJoinOperatorsAnd.forEach((s,i)=>this.resetJoinOperatorAnd(s,i,this.joinOperatorId+i)),this.eJoinOperatorsOr.forEach((s,i)=>this.resetJoinOperatorOr(s,i,this.joinOperatorId+i)),this.joinOperatorId++,this.forEachInput(s=>this.resetInput(s)),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,e||this.onUiChanged(),xe.resolve()}resetType(e){const i=this.localeService.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.getDefaultOption(),!0).setAriaLabel(i).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,s,i){this.resetJoinOperator(e,s,this.isDefaultOperator("AND"),this.translate("andCondition"),i)}resetJoinOperatorOr(e,s,i){this.resetJoinOperator(e,s,this.isDefaultOperator("OR"),this.translate("orCondition"),i)}resetJoinOperator(e,s,i,o,r){this.updateJoinOperatorDisabled(e.setValue(i,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${r}`).setLabel(o),s)}updateJoinOperatorsDisabled(){this.eJoinOperatorsAnd.forEach((e,s)=>this.updateJoinOperatorDisabled(e,s)),this.eJoinOperatorsOr.forEach((e,s)=>this.updateJoinOperatorDisabled(e,s))}updateJoinOperatorDisabled(e,s){e.setDisabled(this.isReadOnly()||s>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,s){const i=this.mapValuesFromModel(e);this.forEachInput((o,r,n,l)=>{n===s&&this.setElementValue(o,i[r]!=null?i[r]:null)})}setValueFromFloatingFilter(e){this.forEachInput((s,i,o,r)=>{this.setElementValue(s,i===0&&o===0?e:null,!0)})}isDefaultOperator(e){return e===this.defaultJoinOperator}addChangedListeners(e,s){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(s,i=>{this.attachElementOnChange(i,this.listener)}))}individualConditionPasses(e,s){const i=this.getCellValue(e.node),o=this.mapValuesFromModel(s),r=this.optionsFactory.getCustomOption(s.type),n=this.evaluateCustomFilter(r,o,i);return n??(i==null?this.evaluateNullValue(s.type):this.evaluateNonNullValue(o,i,s,e))}evaluateCustomFilter(e,s,i){if(e==null)return;const{predicate:o}=e;if(o!=null&&!s.some(r=>r==null))return o(s,i)}isBlank(e){return e==null||typeof e=="string"&&e.trim().length===0}hasInvalidInputs(){return!1}};st.EMPTY="empty",st.BLANK="blank",st.NOT_BLANK="notBlank",st.EQUALS="equals",st.NOT_EQUAL="notEqual",st.LESS_THAN="lessThan",st.LESS_THAN_OR_EQUAL="lessThanOrEqual",st.GREATER_THAN="greaterThan",st.GREATER_THAN_OR_EQUAL="greaterThanOrEqual",st.IN_RANGE="inRange",st.CONTAINS="contains",st.NOT_CONTAINS="notContains",st.STARTS_WITH="startsWith",st.ENDS_WITH="endsWith";var Pe=st,_e=class ke extends Pe{setParams(e){super.setParams(e),this.scalarFilterParams=e}evaluateNullValue(e){switch(e){case ke.EQUALS:case ke.NOT_EQUAL:if(this.scalarFilterParams.includeBlanksInEquals)return!0;break;case ke.GREATER_THAN:case ke.GREATER_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInGreaterThan)return!0;break;case ke.LESS_THAN:case ke.LESS_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInLessThan)return!0;break;case ke.IN_RANGE:if(this.scalarFilterParams.includeBlanksInRange)return!0;break;case ke.BLANK:return!0;case ke.NOT_BLANK:return!1}return!1}evaluateNonNullValue(e,s,i){const o=this.comparator(),r=e[0]!=null?o(e[0],s):0;switch(i.type){case ke.EQUALS:return r===0;case ke.NOT_EQUAL:return r!==0;case ke.GREATER_THAN:return r>0;case ke.GREATER_THAN_OR_EQUAL:return r>=0;case ke.LESS_THAN:return r<0;case ke.LESS_THAN_OR_EQUAL:return r<=0;case ke.IN_RANGE:{const n=o(e[1],s);return this.scalarFilterParams.inRangeInclusive?r>=0&&n<=0:r>0&&n<0}case ke.BLANK:return this.isBlank(s);case ke.NOT_BLANK:return!this.isBlank(s);default:return console.warn('AG Grid: Unexpected type of filter "'+i.type+'", it looks like the filter was configured with incorrect Filter Options'),!0}}},qu=1e3,Qu=1/0,Xu=class extends Vl{constructor(t,e,s){super(e,s),this.dateFilterParams=t}conditionToString(t,e){const{type:s}=t,{numberOfInputs:i}=e||{},o=s==Pe.IN_RANGE||i===2,r=ut(t.dateFrom),n=ut(t.dateTo),l=this.dateFilterParams.inRangeFloatingFilterDateFormat;if(o){const a=r!==null?Ai(r,l):"null",d=n!==null?Ai(n,l):"null";return`${a}-${d}`}return r!=null?Ai(r,l):`${s}`}updateParams(t){super.updateParams(t),this.dateFilterParams=t.dateFilterParams}},Hl=class hc extends _e{constructor(){super("dateFilter"),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=qu,this.maxValidYear=Qu,this.minValidDate=null,this.maxValidDate=null}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}mapValuesFromModel(e){const{dateFrom:s,dateTo:i,type:o}=e||{};return[s&&ut(s)||null,i&&ut(i)||null].slice(0,this.getNumberOfInputs(o))}comparator(){return this.dateFilterParams.comparator?this.dateFilterParams.comparator:this.defaultComparator.bind(this)}defaultComparator(e,s){const i=s;return s==null||i<e?-1:i>e?1:0}setParams(e){this.dateFilterParams=e,super.setParams(e);const s=(i,o)=>{if(e[i]!=null)if(isNaN(e[i]))console.warn(`AG Grid: DateFilter ${i} is not a number`);else return e[i]==null?o:Number(e[i]);return o};this.minValidYear=s("minValidYear",qu),this.maxValidYear=s("maxValidYear",Qu),this.minValidYear>this.maxValidYear&&console.warn("AG Grid: DateFilter minValidYear should be <= maxValidYear"),e.minValidDate?this.minValidDate=e.minValidDate instanceof Date?e.minValidDate:ut(e.minValidDate):this.minValidDate=null,e.maxValidDate?this.maxValidDate=e.maxValidDate instanceof Date?e.maxValidDate:ut(e.maxValidDate):this.maxValidDate=null,this.minValidDate&&this.maxValidDate&&this.minValidDate>this.maxValidDate&&console.warn("AG Grid: DateFilter minValidDate should be <= maxValidDate"),this.filterModelFormatter=new Xu(this.dateFilterParams,this.localeService,this.optionsFactory)}createDateCompWrapper(e){const s=new ku(this.getContext(),this.userComponentFactory,{onDateChanged:()=>this.onUiChanged(),filterParams:this.dateFilterParams},e);return this.addDestroyFunc(()=>s.destroy()),s}setElementValue(e,s){e.setDate(s)}setElementDisplayed(e,s){e.setDisplayed(s)}setElementDisabled(e,s){e.setDisabled(s)}getDefaultFilterOptions(){return hc.DEFAULT_FILTER_OPTIONS}createValueElement(){const s=this.gos.getDocument().createElement("div");return s.classList.add("ag-filter-body"),this.createFromToElement(s,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(s,this.eConditionPanelsTo,this.dateConditionToComps,"to"),s}createFromToElement(e,s,i,o){const n=this.gos.getDocument().createElement("div");n.classList.add(`ag-filter-${o}`),n.classList.add(`ag-filter-date-${o}`),s.push(n),e.appendChild(n),i.push(this.createDateCompWrapper(n))}removeValueElements(e,s){this.removeDateComps(this.dateConditionFromComps,e,s),this.removeDateComps(this.dateConditionToComps,e,s),this.removeItems(this.eConditionPanelsFrom,e,s),this.removeItems(this.eConditionPanelsTo,e,s)}removeDateComps(e,s,i){this.removeItems(e,s,i).forEach(r=>r.destroy())}isValidDateValue(e){if(e===null)return!1;if(this.minValidDate){if(e<this.minValidDate)return!1}else if(e.getUTCFullYear()<this.minValidYear)return!1;if(this.maxValidDate){if(e>this.maxValidDate)return!1}else if(e.getUTCFullYear()>this.maxValidYear)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let s=!0;return this.forEachInput((i,o,r,n)=>{r!==e||!s||o>=n||(s=s&&this.isValidDateValue(i.getDate()))}),s}areSimpleModelsEqual(e,s){return e.dateFrom===s.dateFrom&&e.dateTo===s.dateTo&&e.type===s.type}getFilterType(){return"date"}createCondition(e){const s=this.getConditionType(e),i={},o=this.getValues(e);return o.length>0&&(i.dateFrom=Pt(o[0])),o.length>1&&(i.dateTo=Pt(o[1])),_({dateFrom:null,dateTo:null,filterType:this.getFilterType(),type:s},i)}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc(),s=this.translate("dateFormatOoo"),i=e("ariaFilterValue","Filter Value");this.forEachInput(o=>{o.setInputPlaceholder(s),o.setInputAriaLabel(i)})}getInputs(e){return e>=this.dateConditionFromComps.length?[null,null]:[this.dateConditionFromComps[e],this.dateConditionToComps[e]]}getValues(e){const s=[];return this.forEachPositionInput(e,(i,o,r,n)=>{o<n&&s.push(i.getDate())}),s}translate(e){return e===_e.LESS_THAN?super.translate("before"):e===_e.GREATER_THAN?super.translate("after"):super.translate(e)}getModelAsString(e){var s;return(s=this.filterModelFormatter.getModelAsString(e))!=null?s:""}};Hl.DEFAULT_FILTER_OPTIONS=[_e.EQUALS,_e.NOT_EQUAL,_e.LESS_THAN,_e.GREATER_THAN,_e.IN_RANGE,_e.BLANK,_e.NOT_BLANK],u([f("userComponentFactory")],Hl.prototype,"userComponentFactory",2);var Ju=Hl,kl=class extends K{getDefaultDebounceMs(){return 0}destroy(){super.destroy()}isEventFromFloatingFilter(t){return t&&t.afterFloatingFilter}isEventFromDataChange(t){return t==null?void 0:t.afterDataChange}getLastType(){return this.lastType}isReadOnly(){return this.readOnly}setLastTypeFromModel(t){if(!t){this.lastType=this.optionsFactory.getDefaultOption();return}const e=t.operator;let s;e?s=t.conditions[0]:s=t,this.lastType=s.type}canWeEditAfterModelFromParentFilter(t){if(!t)return this.isTypeEditable(this.lastType);if(t.operator)return!1;const s=t;return this.isTypeEditable(s.type)}init(t){this.setSimpleParams(t,!1)}setSimpleParams(t,e=!0){this.optionsFactory=new Bu,this.optionsFactory.init(t.filterParams,this.getDefaultFilterOptions()),e||(this.lastType=this.optionsFactory.getDefaultOption()),this.readOnly=!!t.filterParams.readOnly;const s=this.isTypeEditable(this.optionsFactory.getDefaultOption());this.setEditable(s)}onParamsUpdated(t){this.refresh(t)}refresh(t){this.setSimpleParams(t)}doesFilterHaveSingleInput(t){const e=this.optionsFactory.getCustomOption(t),{numberOfInputs:s}=e||{};return s==null||s==1}isTypeEditable(t){const e=[Pe.IN_RANGE,Pe.EMPTY,Pe.BLANK,Pe.NOT_BLANK];return!!t&&!this.isReadOnly()&&this.doesFilterHaveSingleInput(t)&&e.indexOf(t)<0}getAriaLabel(t){const e=this.columnModel.getDisplayNameForColumn(t.column,"header",!0),s=this.localeService.getLocaleTextFunc();return`${e} ${s("ariaFilterInput","Filter Input")}`}};u([f("columnModel")],kl.prototype,"columnModel",2);var qr=class extends kl{constructor(){super(`
117
+ <div class="ag-floating-filter-input" role="presentation">
118
+ <ag-input-text-field ref="eReadOnlyText"></ag-input-text-field>
119
+ <div ref="eDateWrapper" style="display: flex;"></div>
120
+ </div>`)}getDefaultFilterOptions(){return Ju.DEFAULT_FILTER_OPTIONS}init(t){super.init(t),this.params=t,this.filterParams=t.filterParams,this.createDateComponent(),this.filterModelFormatter=new Xu(this.filterParams,this.localeService,this.optionsFactory);const e=this.localeService.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(e("ariaDateFilterInput","Date Filter Input"))}onParamsUpdated(t){this.refresh(t)}refresh(t){super.refresh(t),this.params=t,this.filterParams=t.filterParams,this.updateDateComponent(),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory,dateFilterParams:this.filterParams}),this.updateCompOnModelChange(t.currentParentModel())}updateCompOnModelChange(t){const e=!this.isReadOnly()&&this.canWeEditAfterModelFromParentFilter(t);if(this.setEditable(e),e){if(t){const s=t;this.dateComp.setDate(ut(s.dateFrom))}else this.dateComp.setDate(null);this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(t)),this.dateComp.setDate(null)}setEditable(t){$(this.eDateWrapper,t),$(this.eReadOnlyText.getGui(),!t)}onParentModelChanged(t,e){this.isEventFromFloatingFilter(e)||this.isEventFromDataChange(e)||(super.setLastTypeFromModel(t),this.updateCompOnModelChange(t))}onDateChanged(){const t=this.dateComp.getDate(),e=Pt(t);this.params.parentFilterInstance(s=>{if(s){const i=ut(e);s.onFloatingFilterChanged(this.getLastType()||null,i)}})}getDateComponentParams(){const t=zr.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs());return{onDateChanged:et(this.onDateChanged.bind(this),t),filterParams:this.params.column.getColDef().filterParams}}createDateComponent(){this.dateComp=new ku(this.getContext(),this.userComponentFactory,this.getDateComponentParams(),this.eDateWrapper,t=>{t.setInputAriaLabel(this.getAriaLabel(this.params))}),this.addDestroyFunc(()=>this.dateComp.destroy())}updateDateComponent(){const t=this.gos.addGridCommonParams(this.getDateComponentParams());this.dateComp.updateParams(t)}getFilterModelFormatter(){return this.filterModelFormatter}};u([f("userComponentFactory")],qr.prototype,"userComponentFactory",2),u([I("eReadOnlyText")],qr.prototype,"eReadOnlyText",2),u([I("eDateWrapper")],qr.prototype,"eDateWrapper",2);var Zu=class extends K{constructor(){super(`
121
+ <div class="ag-filter-filter">
122
+ <ag-input-text-field class="ag-date-filter" ref="eDateInput"></ag-input-text-field>
123
+ </div>`)}destroy(){super.destroy()}init(t){this.params=t,this.setParams(t);const e=this.eDateInput.getInputElement();this.addManagedListener(e,"mousedown",()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||e.focus()}),this.addManagedListener(e,"input",s=>{s.target===this.gos.getActiveDomElement()&&(this.eDateInput.isDisabled()||this.params.onDateChanged())})}setParams(t){const e=this.eDateInput.getInputElement(),s=this.shouldUseBrowserDatePicker(t);this.usingSafariDatePicker=s&&qt(),e.type=s?"date":"text";const{minValidYear:i,maxValidYear:o,minValidDate:r,maxValidDate:n}=t.filterParams||{};if(r&&i&&H("DateFilter should not have both minValidDate and minValidYear parameters set at the same time! minValidYear will be ignored."),n&&o&&H("DateFilter should not have both maxValidDate and maxValidYear parameters set at the same time! maxValidYear will be ignored."),r&&n){const[l,a]=[r,n].map(d=>d instanceof Date?d:ut(d));l&&a&&l.getTime()>a.getTime()&&H("DateFilter parameter minValidDate should always be lower than or equal to parameter maxValidDate.")}r?r instanceof Date?e.min=Ai(r):e.min=r:i&&(e.min=`${i}-01-01`),n?n instanceof Date?e.max=Ai(n):e.max=n:o&&(e.max=`${o}-12-31`)}onParamsUpdated(t){this.refresh(t)}refresh(t){this.params=t,this.setParams(t)}getDate(){return ut(this.eDateInput.getValue())}setDate(t){this.eDateInput.setValue(Pt(t,!1))}setInputPlaceholder(t){this.eDateInput.setInputPlaceholder(t)}setInputAriaLabel(t){this.eDateInput.setAriaLabel(t)}setDisabled(t){this.eDateInput.setDisabled(t)}afterGuiAttached(t){(!t||!t.suppressFocus)&&this.eDateInput.getInputElement().focus()}shouldUseBrowserDatePicker(t){return t.filterParams&&t.filterParams.browserDatePicker!=null?t.filterParams.browserDatePicker:Or()||Cl()||qt()&&ml()>=14.1}};u([I("eDateInput")],Zu.prototype,"eDateInput",2);var Us=class extends Ht{constructor(t,e="ag-text-field",s="text"){super(t,e,s)}postConstruct(){super.postConstruct(),this.config.allowedCharPattern&&this.preventDisallowedCharacters()}setValue(t,e){return this.eInput.value!==t&&(this.eInput.value=P(t)?t:""),super.setValue(t,e)}setStartValue(t){this.setValue(t,!0)}preventDisallowedCharacters(){const t=new RegExp(`[${this.config.allowedCharPattern}]`),e=s=>{kr(s)&&s.key&&!t.test(s.key)&&s.preventDefault()};this.addManagedListener(this.eInput,"keydown",e),this.addManagedListener(this.eInput,"paste",s=>{var i;const o=(i=s.clipboardData)==null?void 0:i.getData("text");o&&o.split("").some(r=>!t.test(r))&&s.preventDefault()})}},Bl=class extends Us{constructor(t){super(t,"ag-number-field","number")}postConstruct(){super.postConstruct(),this.addManagedListener(this.eInput,"blur",()=>{const o=parseFloat(this.eInput.value),r=isNaN(o)?"":this.normalizeValue(o.toString());this.value!==r&&this.setValue(r)}),this.addManagedListener(this.eInput,"wheel",this.onWheel.bind(this)),this.eInput.step="any";const{precision:t,min:e,max:s,step:i}=this.config;typeof t=="number"&&this.setPrecision(t),typeof e=="number"&&this.setMin(e),typeof s=="number"&&this.setMax(s),typeof i=="number"&&this.setStep(i)}onWheel(t){this.gos.getActiveDomElement()===this.eInput&&t.preventDefault()}normalizeValue(t){if(t==="")return"";this.precision!=null&&(t=this.adjustPrecision(t));const e=parseFloat(t);return this.min!=null&&e<this.min?t=this.min.toString():this.max!=null&&e>this.max&&(t=this.max.toString()),t}adjustPrecision(t,e){if(this.precision==null)return t;if(e){const i=parseFloat(t).toFixed(this.precision);return parseFloat(i).toString()}const s=String(t).split(".");if(s.length>1){if(s[1].length<=this.precision)return t;if(this.precision>0)return`${s[0]}.${s[1].slice(0,this.precision)}`}return s[0]}setMin(t){return this.min===t?this:(this.min=t,Qt(this.eInput,"min",t),this)}setMax(t){return this.max===t?this:(this.max=t,Qt(this.eInput,"max",t),this)}setPrecision(t){return this.precision=t,this}setStep(t){return this.step===t?this:(this.step=t,Qt(this.eInput,"step",t),this)}setValue(t,e){return this.setValueOrInputValue(s=>super.setValue(s,e),()=>this,t)}setStartValue(t){return this.setValueOrInputValue(e=>super.setValue(e,!0),e=>{this.eInput.value=e},t)}setValueOrInputValue(t,e,s){if(P(s)){let i=this.isScientificNotation(s);if(i&&this.eInput.validity.valid)return t(s);if(!i){s=this.adjustPrecision(s);const o=this.normalizeValue(s);i=s!=o}if(i)return e(s)}return t(s)}getValue(){if(!this.eInput.validity.valid)return;const t=this.eInput.value;return this.isScientificNotation(t)?this.adjustPrecision(t,!0):super.getValue()}isScientificNotation(t){return typeof t=="string"&&t.includes("e")}},$u=class extends Vl{conditionToString(t,e){const{numberOfInputs:s}=e||{};return t.type==Pe.IN_RANGE||s===2?`${this.formatValue(t.filter)}-${this.formatValue(t.filterTo)}`:t.filter!=null?this.formatValue(t.filter):`${t.type}`}};function Wl(t){const{allowedCharPattern:e}=t??{};return e??null}var eh=class cc extends _e{constructor(){super("numberFilter"),this.eValuesFrom=[],this.eValuesTo=[]}refresh(e){return this.numberFilterParams.allowedCharPattern!==e.allowedCharPattern?!1:super.refresh(e)}mapValuesFromModel(e){const{filter:s,filterTo:i,type:o}=e||{};return[this.processValue(s),this.processValue(i)].slice(0,this.getNumberOfInputs(o))}getDefaultDebounceMs(){return 500}comparator(){return(e,s)=>e===s?0:e<s?1:-1}setParams(e){this.numberFilterParams=e,super.setParams(e),this.filterModelFormatter=new $u(this.localeService,this.optionsFactory,this.numberFilterParams.numberFormatter)}getDefaultFilterOptions(){return cc.DEFAULT_FILTER_OPTIONS}setElementValue(e,s,i){const o=!i&&this.numberFilterParams.numberFormatter?this.numberFilterParams.numberFormatter(s??null):s;super.setElementValue(e,o)}createValueElement(){const e=Wl(this.numberFilterParams),s=document.createElement("div");return s.classList.add("ag-filter-body"),Ae(s,"presentation"),this.createFromToElement(s,this.eValuesFrom,"from",e),this.createFromToElement(s,this.eValuesTo,"to",e),s}createFromToElement(e,s,i,o){const r=this.createManagedBean(o?new Us({allowedCharPattern:o}):new Bl);r.addCssClass(`ag-filter-${i}`),r.addCssClass("ag-filter-filter"),s.push(r),e.appendChild(r.getGui())}removeValueElements(e,s){this.removeComponents(this.eValuesFrom,e,s),this.removeComponents(this.eValuesTo,e,s)}getValues(e){const s=[];return this.forEachPositionInput(e,(i,o,r,n)=>{o<n&&s.push(this.processValue(this.stringToFloat(i.getValue())))}),s}areSimpleModelsEqual(e,s){return e.filter===s.filter&&e.filterTo===s.filterTo&&e.type===s.type}getFilterType(){return"number"}processValue(e){return e==null||isNaN(e)?null:e}stringToFloat(e){if(typeof e=="number")return e;let s=Yt(e);return s!=null&&s.trim()===""&&(s=null),this.numberFilterParams.numberParser?this.numberFilterParams.numberParser(s):s==null||s.trim()==="-"?null:parseFloat(s)}createCondition(e){const s=this.getConditionType(e),i={filterType:this.getFilterType(),type:s},o=this.getValues(e);return o.length>0&&(i.filter=o[0]),o.length>1&&(i.filterTo=o[1]),i}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getModelAsString(e){var s;return(s=this.filterModelFormatter.getModelAsString(e))!=null?s:""}hasInvalidInputs(){let e=!1;return this.forEachInput(s=>{if(!s.getInputElement().validity.valid){e=!0;return}}),e}};eh.DEFAULT_FILTER_OPTIONS=[_e.EQUALS,_e.NOT_EQUAL,_e.GREATER_THAN,_e.GREATER_THAN_OR_EQUAL,_e.LESS_THAN,_e.LESS_THAN_OR_EQUAL,_e.IN_RANGE,_e.BLANK,_e.NOT_BLANK];var th=eh,sh=class extends Vl{conditionToString(t,e){const{numberOfInputs:s}=e||{};return t.type==Pe.IN_RANGE||s===2?`${t.filter}-${t.filterTo}`:t.filter!=null?`${t.filter}`:`${t.type}`}},kt=class oo extends Pe{constructor(){super("textFilter"),this.eValuesFrom=[],this.eValuesTo=[]}static trimInput(e){const s=e&&e.trim();return s===""?e:s}getDefaultDebounceMs(){return 500}setParams(e){this.textFilterParams=e,super.setParams(e),this.matcher=this.getTextMatcher(),this.formatter=this.textFilterParams.textFormatter||(this.textFilterParams.caseSensitive?oo.DEFAULT_FORMATTER:oo.DEFAULT_LOWERCASE_FORMATTER),this.filterModelFormatter=new sh(this.localeService,this.optionsFactory)}getTextMatcher(){const e=this.textFilterParams.textCustomComparator;return e?(W.warnOnce("textCustomComparator is deprecated, use textMatcher instead."),({filterOption:s,value:i,filterText:o})=>e(s,i,o)):this.textFilterParams.textMatcher||oo.DEFAULT_MATCHER}createCondition(e){const s=this.getConditionType(e),i={filterType:this.getFilterType(),type:s},o=this.getValuesWithSideEffects(e,!0);return o.length>0&&(i.filter=o[0]),o.length>1&&(i.filterTo=o[1]),i}getFilterType(){return"text"}areSimpleModelsEqual(e,s){return e.filter===s.filter&&e.filterTo===s.filterTo&&e.type===s.type}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getValues(e){return this.getValuesWithSideEffects(e,!1)}getValuesWithSideEffects(e,s){const i=[];return this.forEachPositionInput(e,(o,r,n,l)=>{var a;if(r<l){let d=Yt(o.getValue());s&&this.textFilterParams.trimInput&&(d=(a=oo.trimInput(d))!=null?a:null,o.setValue(d,!0)),i.push(d)}}),i}getDefaultFilterOptions(){return oo.DEFAULT_FILTER_OPTIONS}createValueElement(){const e=document.createElement("div");return e.classList.add("ag-filter-body"),Ae(e,"presentation"),this.createFromToElement(e,this.eValuesFrom,"from"),this.createFromToElement(e,this.eValuesTo,"to"),e}createFromToElement(e,s,i){const o=this.createManagedBean(new Us);o.addCssClass(`ag-filter-${i}`),o.addCssClass("ag-filter-filter"),s.push(o),e.appendChild(o.getGui())}removeValueElements(e,s){this.removeComponents(this.eValuesFrom,e,s),this.removeComponents(this.eValuesTo,e,s)}mapValuesFromModel(e){const{filter:s,filterTo:i,type:o}=e||{};return[s||null,i||null].slice(0,this.getNumberOfInputs(o))}evaluateNullValue(e){const s=[Pe.NOT_EQUAL,Pe.NOT_CONTAINS,Pe.BLANK];return e?s.indexOf(e)>=0:!1}evaluateNonNullValue(e,s,i,o){const r=e.map(v=>this.formatter(v))||[],n=this.formatter(s),{api:l,colDef:a,column:d,columnApi:h,context:c,textFormatter:m}=this.textFilterParams;if(i.type===Pe.BLANK)return this.isBlank(s);if(i.type===Pe.NOT_BLANK)return!this.isBlank(s);const C={api:l,colDef:a,column:d,columnApi:h,context:c,node:o.node,data:o.data,filterOption:i.type,value:n,textFormatter:m};return r.some(v=>this.matcher(Ee(_({},C),{filterText:v})))}getModelAsString(e){var s;return(s=this.filterModelFormatter.getModelAsString(e))!=null?s:""}};kt.DEFAULT_FILTER_OPTIONS=[Pe.CONTAINS,Pe.NOT_CONTAINS,Pe.EQUALS,Pe.NOT_EQUAL,Pe.STARTS_WITH,Pe.ENDS_WITH,Pe.BLANK,Pe.NOT_BLANK],kt.DEFAULT_FORMATTER=t=>t,kt.DEFAULT_LOWERCASE_FORMATTER=t=>t==null?null:t.toString().toLowerCase(),kt.DEFAULT_MATCHER=({filterOption:t,value:e,filterText:s})=>{if(s==null)return!1;switch(t){case kt.CONTAINS:return e.indexOf(s)>=0;case kt.NOT_CONTAINS:return e.indexOf(s)<0;case kt.EQUALS:return e===s;case kt.NOT_EQUAL:return e!=s;case kt.STARTS_WITH:return e.indexOf(s)===0;case kt.ENDS_WITH:const i=e.lastIndexOf(s);return i>=0&&i===e.length-s.length;default:return!1}};var Ul=kt,ih=class extends L{constructor(t){super(),this.params=t,this.valueChangedListener=()=>{}}setupGui(t){var e;this.eFloatingFilterTextInput=this.createManagedBean(new Us((e=this.params)==null?void 0:e.config));const s=this.eFloatingFilterTextInput.getGui();t.appendChild(s),this.addManagedListener(s,"input",i=>this.valueChangedListener(i)),this.addManagedListener(s,"keydown",i=>this.valueChangedListener(i))}setEditable(t){this.eFloatingFilterTextInput.setDisabled(!t)}setAutoComplete(t){this.eFloatingFilterTextInput.setAutoComplete(t)}getValue(){return this.eFloatingFilterTextInput.getValue()}setValue(t,e){this.eFloatingFilterTextInput.setValue(t,e)}setValueChangedListener(t){this.valueChangedListener=t}setParams(t){this.setAriaLabel(t.ariaLabel),t.autoComplete!==void 0&&this.setAutoComplete(t.autoComplete)}setAriaLabel(t){this.eFloatingFilterTextInput.setInputAriaLabel(t)}},Qr=class extends kl{postConstruct(){this.setTemplate(`
124
+ <div class="ag-floating-filter-input" role="presentation" ref="eFloatingFilterInputContainer"></div>
125
+ `)}getDefaultDebounceMs(){return 500}onParentModelChanged(t,e){this.isEventFromFloatingFilter(e)||this.isEventFromDataChange(e)||(this.setLastTypeFromModel(t),this.setEditable(this.canWeEditAfterModelFromParentFilter(t)),this.floatingFilterInputService.setValue(this.getFilterModelFormatter().getModelAsString(t)))}init(t){this.setupFloatingFilterInputService(t),super.init(t),this.setTextInputParams(t)}setupFloatingFilterInputService(t){this.floatingFilterInputService=this.createFloatingFilterInputService(t),this.floatingFilterInputService.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(t){var e;this.params=t;const s=(e=t.browserAutoComplete)!=null?e:!1;if(this.floatingFilterInputService.setParams({ariaLabel:this.getAriaLabel(t),autoComplete:s}),this.applyActive=zr.isUseApplyButton(this.params.filterParams),!this.isReadOnly()){const i=zr.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs()),o=et(this.syncUpWithParentFilter.bind(this),i);this.floatingFilterInputService.setValueChangedListener(o)}}onParamsUpdated(t){this.refresh(t)}refresh(t){super.refresh(t),this.setTextInputParams(t)}recreateFloatingFilterInputService(t){const e=this.floatingFilterInputService.getValue();Le(this.eFloatingFilterInputContainer),this.destroyBean(this.floatingFilterInputService),this.setupFloatingFilterInputService(t),this.floatingFilterInputService.setValue(e,!0)}syncUpWithParentFilter(t){const e=t.key===E.ENTER;if(this.applyActive&&!e)return;let s=this.floatingFilterInputService.getValue();this.params.filterParams.trimInput&&(s=Ul.trimInput(s),this.floatingFilterInputService.setValue(s,!0)),this.params.parentFilterInstance(i=>{i&&i.onFloatingFilterChanged(this.getLastType()||null,s||null)})}setEditable(t){this.floatingFilterInputService.setEditable(t)}};u([I("eFloatingFilterInputContainer")],Qr.prototype,"eFloatingFilterInputContainer",2),u([M],Qr.prototype,"postConstruct",1);var Ug=class extends L{constructor(){super(...arguments),this.valueChangedListener=()=>{},this.numberInputActive=!0}setupGui(t){this.eFloatingFilterNumberInput=this.createManagedBean(new Bl),this.eFloatingFilterTextInput=this.createManagedBean(new Us),this.eFloatingFilterTextInput.setDisabled(!0);const e=this.eFloatingFilterNumberInput.getGui(),s=this.eFloatingFilterTextInput.getGui();t.appendChild(e),t.appendChild(s),this.setupListeners(e,i=>this.valueChangedListener(i)),this.setupListeners(s,i=>this.valueChangedListener(i))}setEditable(t){this.numberInputActive=t,this.eFloatingFilterNumberInput.setDisplayed(this.numberInputActive),this.eFloatingFilterTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(t){this.eFloatingFilterNumberInput.setAutoComplete(t),this.eFloatingFilterTextInput.setAutoComplete(t)}getValue(){return this.getActiveInputElement().getValue()}setValue(t,e){this.getActiveInputElement().setValue(t,e)}getActiveInputElement(){return this.numberInputActive?this.eFloatingFilterNumberInput:this.eFloatingFilterTextInput}setValueChangedListener(t){this.valueChangedListener=t}setupListeners(t,e){this.addManagedListener(t,"input",e),this.addManagedListener(t,"keydown",e)}setParams(t){this.setAriaLabel(t.ariaLabel),t.autoComplete!==void 0&&this.setAutoComplete(t.autoComplete)}setAriaLabel(t){this.eFloatingFilterNumberInput.setInputAriaLabel(t),this.eFloatingFilterTextInput.setInputAriaLabel(t)}},zg=class extends Qr{init(t){var e;super.init(t),this.filterModelFormatter=new $u(this.localeService,this.optionsFactory,(e=t.filterParams)==null?void 0:e.numberFormatter)}onParamsUpdated(t){this.refresh(t)}refresh(t){Wl(t.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(t),super.refresh(t),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return th.DEFAULT_FILTER_OPTIONS}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(t){return this.allowedCharPattern=Wl(t.filterParams),this.allowedCharPattern?this.createManagedBean(new ih({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new Ug)}},Kg=class extends Qr{init(t){super.init(t),this.filterModelFormatter=new sh(this.localeService,this.optionsFactory)}onParamsUpdated(t){this.refresh(t)}refresh(t){super.refresh(t),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return Ul.DEFAULT_FILTER_OPTIONS}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(){return this.createManagedBean(new ih)}},Mo=class cr{constructor(e,s=!1){this.destroyFuncs=[],this.touching=!1,this.eventService=new Gt,this.eElement=e,this.preventMouseClick=s;const i=this.onTouchStart.bind(this),o=this.onTouchMove.bind(this),r=this.onTouchEnd.bind(this);this.eElement.addEventListener("touchstart",i,{passive:!0}),this.eElement.addEventListener("touchmove",o,{passive:!0}),this.eElement.addEventListener("touchend",r,{passive:!1}),this.destroyFuncs.push(()=>{this.eElement.removeEventListener("touchstart",i,{passive:!0}),this.eElement.removeEventListener("touchmove",o,{passive:!0}),this.eElement.removeEventListener("touchend",r,{passive:!1})})}getActiveTouch(e){for(let s=0;s<e.length;s++)if(e[s].identifier===this.touchStart.identifier)return e[s];return null}addEventListener(e,s){this.eventService.addEventListener(e,s)}removeEventListener(e,s){this.eventService.removeEventListener(e,s)}onTouchStart(e){if(this.touching)return;this.touchStart=e.touches[0],this.touching=!0,this.moved=!1;const s=this.touchStart;window.setTimeout(()=>{const i=this.touchStart===s;if(this.touching&&i&&!this.moved){this.moved=!0;const o={type:cr.EVENT_LONG_TAP,touchStart:this.touchStart,touchEvent:e};this.eventService.dispatchEvent(o)}},500)}onTouchMove(e){if(!this.touching)return;const s=this.getActiveTouch(e.touches);if(!s)return;!xl(s,this.touchStart,4)&&(this.moved=!0)}onTouchEnd(e){if(this.touching){if(!this.moved){const s={type:cr.EVENT_TAP,touchStart:this.touchStart};this.eventService.dispatchEvent(s),this.checkForDoubleTap()}this.preventMouseClick&&e.cancelable&&e.preventDefault(),this.touching=!1}}checkForDoubleTap(){const e=new Date().getTime();if(this.lastTapTime&&this.lastTapTime>0)if(e-this.lastTapTime>cr.DOUBLE_TAP_MILLIS){const i={type:cr.EVENT_DOUBLE_TAP,touchStart:this.touchStart};this.eventService.dispatchEvent(i),this.lastTapTime=null}else this.lastTapTime=e;else this.lastTapTime=e}destroy(){this.destroyFuncs.forEach(e=>e())}};Mo.EVENT_TAP="tap",Mo.EVENT_DOUBLE_TAP="doubleTap",Mo.EVENT_LONG_TAP="longTap",Mo.DOUBLE_TAP_MILLIS=500;var ze=Mo,us=class pc extends K{constructor(e){super(),e||this.setTemplate(pc.TEMPLATE)}attachCustomElements(e,s,i,o,r){this.eSortOrder=e,this.eSortAsc=s,this.eSortDesc=i,this.eSortMixed=o,this.eSortNone=r}setupSort(e,s=!1){this.column=e,this.suppressOrder=s,this.setupMultiSortIndicator(),!(!this.column.isSortable()&&!this.column.getColDef().showRowGroup)&&(this.addInIcon("sortAscending",this.eSortAsc,e),this.addInIcon("sortDescending",this.eSortDesc,e),this.addInIcon("sortUnSort",this.eSortNone,e),this.addManagedPropertyListener("unSortIcon",()=>this.updateIcons()),this.addManagedListener(this.eventService,p.EVENT_NEW_COLUMNS_LOADED,()=>this.updateIcons()),this.addManagedListener(this.eventService,p.EVENT_SORT_CHANGED,()=>this.onSortChanged()),this.addManagedListener(this.eventService,p.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.onSortChanged()),this.onSortChanged())}addInIcon(e,s,i){if(s==null)return;const o=be(e,this.gos,i);o&&s.appendChild(o)}onSortChanged(){this.updateIcons(),this.suppressOrder||this.updateSortOrder()}updateIcons(){const e=this.sortController.getDisplaySortForColumn(this.column);if(this.eSortAsc){const s=e==="asc";$(this.eSortAsc,s,{skipAriaHidden:!0})}if(this.eSortDesc){const s=e==="desc";$(this.eSortDesc,s,{skipAriaHidden:!0})}if(this.eSortNone){const s=!this.column.getColDef().unSortIcon&&!this.gos.get("unSortIcon"),i=e==null;$(this.eSortNone,!s&&i,{skipAriaHidden:!0})}}setupMultiSortIndicator(){this.addInIcon("sortUnSort",this.eSortMixed,this.column);const e=this.column.getColDef().showRowGroup;this.gos.isColumnsSortingCoupledToGroup()&&e&&(this.addManagedListener(this.eventService,p.EVENT_SORT_CHANGED,()=>this.updateMultiSortIndicator()),this.addManagedListener(this.eventService,p.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.updateMultiSortIndicator()),this.updateMultiSortIndicator())}updateMultiSortIndicator(){if(this.eSortMixed){const e=this.sortController.getDisplaySortForColumn(this.column)==="mixed";$(this.eSortMixed,e,{skipAriaHidden:!0})}}updateSortOrder(){var e;if(!this.eSortOrder)return;const s=this.sortController.getColumnsWithSortingOrdered(),i=(e=this.sortController.getDisplaySortIndexForColumn(this.column))!=null?e:-1,o=s.some(n=>{var l;return(l=this.sortController.getDisplaySortIndexForColumn(n))!=null?l:!1}),r=i>=0&&o;$(this.eSortOrder,r,{skipAriaHidden:!0}),i>=0?this.eSortOrder.textContent=(i+1).toString():Le(this.eSortOrder)}};us.TEMPLATE=`<span class="ag-sort-indicator-container">
126
+ <span ref="eSortOrder" class="ag-sort-indicator-icon ag-sort-order ag-hidden" aria-hidden="true"></span>
127
+ <span ref="eSortAsc" class="ag-sort-indicator-icon ag-sort-ascending-icon ag-hidden" aria-hidden="true"></span>
128
+ <span ref="eSortDesc" class="ag-sort-indicator-icon ag-sort-descending-icon ag-hidden" aria-hidden="true"></span>
129
+ <span ref="eSortMixed" class="ag-sort-indicator-icon ag-sort-mixed-icon ag-hidden" aria-hidden="true"></span>
130
+ <span ref="eSortNone" class="ag-sort-indicator-icon ag-sort-none-icon ag-hidden" aria-hidden="true"></span>
131
+ </span>`,u([I("eSortOrder")],us.prototype,"eSortOrder",2),u([I("eSortAsc")],us.prototype,"eSortAsc",2),u([I("eSortDesc")],us.prototype,"eSortDesc",2),u([I("eSortMixed")],us.prototype,"eSortMixed",2),u([I("eSortNone")],us.prototype,"eSortNone",2),u([f("columnModel")],us.prototype,"columnModel",2),u([f("sortController")],us.prototype,"sortController",2);var zl=us,qe=class gc extends K{constructor(){super(...arguments),this.lastMovingChanged=0}destroy(){super.destroy()}refresh(e){const s=this.params;return this.params=e,this.workOutTemplate()!=this.currentTemplate||this.workOutShowMenu()!=this.currentShowMenu||this.workOutSort()!=this.currentSort||this.shouldSuppressMenuHide()!=this.currentSuppressMenuHide||s.enableFilterButton!=e.enableFilterButton||s.enableFilterIcon!=e.enableFilterIcon?!1:(this.setDisplayName(e),!0)}workOutTemplate(){var e;let s=(e=this.params.template)!=null?e:gc.TEMPLATE;return s=s&&s.trim?s.trim():s,s}init(e){this.params=e,this.currentTemplate=this.workOutTemplate(),this.setTemplate(this.currentTemplate),this.setupTap(),this.setMenu(),this.setupSort(),this.setupFilterIcon(),this.setupFilterButton(),this.setDisplayName(e)}setDisplayName(e){if(this.currentDisplayName!=e.displayName){this.currentDisplayName=e.displayName;const s=Ne(this.currentDisplayName,!0);this.eText&&(this.eText.textContent=s)}}addInIcon(e,s,i){if(s==null)return;const o=be(e,this.gos,i);o&&s.appendChild(o)}setupTap(){const{gos:e}=this;if(e.get("suppressTouch"))return;const s=new ze(this.getGui(),!0),i=this.shouldSuppressMenuHide(),o=i&&P(this.eMenu),r=o?new ze(this.eMenu,!0):s;if(this.params.enableMenu){const n=o?"EVENT_TAP":"EVENT_LONG_TAP",l=a=>this.params.showColumnMenuAfterMouseClick(a.touchStart);this.addManagedListener(r,ze[n],l)}if(this.params.enableSorting){const n=l=>{var a,d;const h=l.touchStart.target;i&&((a=this.eMenu)!=null&&a.contains(h)||(d=this.eFilterButton)!=null&&d.contains(h))||this.sortController.progressSort(this.params.column,!1,"uiColumnSorted")};this.addManagedListener(s,ze.EVENT_TAP,n)}if(this.params.enableFilterButton){const n=new ze(this.eFilterButton,!0);this.addManagedListener(n,"tap",()=>this.params.showFilter(this.eFilterButton)),this.addDestroyFunc(()=>n.destroy())}this.addDestroyFunc(()=>s.destroy()),o&&this.addDestroyFunc(()=>r.destroy())}workOutShowMenu(){return this.params.enableMenu&&this.menuService.isHeaderMenuButtonEnabled()}shouldSuppressMenuHide(){return this.menuService.isHeaderMenuButtonAlwaysShowEnabled()}setMenu(){if(!this.eMenu)return;if(this.currentShowMenu=this.workOutShowMenu(),!this.currentShowMenu){Vt(this.eMenu),this.eMenu=void 0;return}const e=this.menuService.isLegacyMenuEnabled();this.addInIcon(e?"menu":"menuAlt",this.eMenu,this.params.column),this.eMenu.classList.toggle("ag-header-menu-icon",!e),this.currentSuppressMenuHide=this.shouldSuppressMenuHide(),this.addManagedListener(this.eMenu,"click",()=>this.params.showColumnMenu(this.eMenu)),this.eMenu.classList.toggle("ag-header-menu-always-show",this.currentSuppressMenuHide)}onMenuKeyboardShortcut(e){var s,i,o,r;const{column:n}=this.params,l=this.menuService.isLegacyMenuEnabled();if(e&&!l){if(this.menuService.isFilterMenuInHeaderEnabled(n))return this.params.showFilter((i=(s=this.eFilterButton)!=null?s:this.eMenu)!=null?i:this.getGui()),!0}else if(this.params.enableMenu)return this.params.showColumnMenu((r=(o=this.eMenu)!=null?o:this.eFilterButton)!=null?r:this.getGui()),!0;return!1}workOutSort(){return this.params.enableSorting}setupSort(){if(this.currentSort=this.params.enableSorting,this.eSortIndicator||(this.eSortIndicator=this.context.createBean(new zl(!0)),this.eSortIndicator.attachCustomElements(this.eSortOrder,this.eSortAsc,this.eSortDesc,this.eSortMixed,this.eSortNone)),this.eSortIndicator.setupSort(this.params.column),!this.currentSort)return;this.addManagedListener(this.params.column,fe.EVENT_MOVING_CHANGED,()=>{this.lastMovingChanged=new Date().getTime()}),this.eLabel&&this.addManagedListener(this.eLabel,"click",s=>{const i=this.params.column.isMoving(),r=new Date().getTime()-this.lastMovingChanged<50;if(!(i||r)){const a=this.gos.get("multiSortKey")==="ctrl"?s.ctrlKey||s.metaKey:s.shiftKey;this.params.progressSort(a)}});const e=()=>{if(this.addOrRemoveCssClass("ag-header-cell-sorted-asc",this.params.column.isSortAscending()),this.addOrRemoveCssClass("ag-header-cell-sorted-desc",this.params.column.isSortDescending()),this.addOrRemoveCssClass("ag-header-cell-sorted-none",this.params.column.isSortNone()),this.params.column.getColDef().showRowGroup){const s=this.columnModel.getSourceColumnsForGroupColumn(this.params.column),o=!(s==null?void 0:s.every(r=>this.params.column.getSort()==r.getSort()));this.addOrRemoveCssClass("ag-header-cell-sorted-mixed",o)}};this.addManagedListener(this.eventService,p.EVENT_SORT_CHANGED,e),this.addManagedListener(this.eventService,p.EVENT_COLUMN_ROW_GROUP_CHANGED,e)}setupFilterIcon(){this.eFilter&&this.configureFilter(this.params.enableFilterIcon,this.eFilter,this.onFilterChangedIcon.bind(this))}setupFilterButton(){if(!this.eFilterButton)return;this.configureFilter(this.params.enableFilterButton,this.eFilterButton,this.onFilterChangedButton.bind(this))?this.addManagedListener(this.eFilterButton,"click",()=>this.params.showFilter(this.eFilterButton)):this.eFilterButton=void 0}configureFilter(e,s,i){if(!e)return Vt(s),!1;const{column:o}=this.params;return this.addInIcon("filter",s,o),this.addManagedListener(o,fe.EVENT_FILTER_CHANGED,i),i(),!0}onFilterChangedIcon(){const e=this.params.column.isFilterActive();$(this.eFilter,e,{skipAriaHidden:!0})}onFilterChangedButton(){const e=this.params.column.isFilterActive();this.eFilterButton.classList.toggle("ag-filter-active",e)}getAnchorElementForMenu(e){var s,i,o,r;return e?(i=(s=this.eFilterButton)!=null?s:this.eMenu)!=null?i:this.getGui():(r=(o=this.eMenu)!=null?o:this.eFilterButton)!=null?r:this.getGui()}};qe.TEMPLATE=`<div class="ag-cell-label-container" role="presentation">
132
+ <span ref="eMenu" class="ag-header-icon ag-header-cell-menu-button" aria-hidden="true"></span>
133
+ <span ref="eFilterButton" class="ag-header-icon ag-header-cell-filter-button" aria-hidden="true"></span>
134
+ <div ref="eLabel" class="ag-header-cell-label" role="presentation">
135
+ <span ref="eText" class="ag-header-cell-text"></span>
136
+ <span ref="eFilter" class="ag-header-icon ag-header-label-icon ag-filter-icon" aria-hidden="true"></span>
137
+ <ag-sort-indicator ref="eSortIndicator"></ag-sort-indicator>
138
+ </div>
139
+ </div>`,u([f("sortController")],qe.prototype,"sortController",2),u([f("menuService")],qe.prototype,"menuService",2),u([f("columnModel")],qe.prototype,"columnModel",2),u([I("eFilter")],qe.prototype,"eFilter",2),u([I("eFilterButton")],qe.prototype,"eFilterButton",2),u([I("eSortIndicator")],qe.prototype,"eSortIndicator",2),u([I("eMenu")],qe.prototype,"eMenu",2),u([I("eLabel")],qe.prototype,"eLabel",2),u([I("eText")],qe.prototype,"eText",2),u([I("eSortOrder")],qe.prototype,"eSortOrder",2),u([I("eSortAsc")],qe.prototype,"eSortAsc",2),u([I("eSortDesc")],qe.prototype,"eSortDesc",2),u([I("eSortMixed")],qe.prototype,"eSortMixed",2),u([I("eSortNone")],qe.prototype,"eSortNone",2);var Kl=qe,Io=class fc extends K{constructor(){super(fc.TEMPLATE)}destroy(){super.destroy()}init(e){this.params=e,this.checkWarnings(),this.setupLabel(),this.addGroupExpandIcon(),this.setupExpandIcons()}checkWarnings(){this.params.template&&H("A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)")}setupExpandIcons(){this.addInIcon("columnGroupOpened","agOpened"),this.addInIcon("columnGroupClosed","agClosed");const e=o=>{if(_t(o))return;const r=!this.params.columnGroup.isExpanded();this.columnModel.setColumnGroupOpened(this.params.columnGroup.getProvidedColumnGroup(),r,"uiColumnExpanded")};this.addTouchAndClickListeners(this.eCloseIcon,e),this.addTouchAndClickListeners(this.eOpenIcon,e);const s=o=>{Ot(o)};this.addManagedListener(this.eCloseIcon,"dblclick",s),this.addManagedListener(this.eOpenIcon,"dblclick",s),this.addManagedListener(this.getGui(),"dblclick",e),this.updateIconVisibility();const i=this.params.columnGroup.getProvidedColumnGroup();this.addManagedListener(i,Ie.EVENT_EXPANDED_CHANGED,this.updateIconVisibility.bind(this)),this.addManagedListener(i,Ie.EVENT_EXPANDABLE_CHANGED,this.updateIconVisibility.bind(this))}addTouchAndClickListeners(e,s){const i=new ze(e,!0);this.addManagedListener(i,ze.EVENT_TAP,s),this.addDestroyFunc(()=>i.destroy()),this.addManagedListener(e,"click",s)}updateIconVisibility(){if(this.params.columnGroup.isExpandable()){const s=this.params.columnGroup.isExpanded();$(this.eOpenIcon,s),$(this.eCloseIcon,!s)}else $(this.eOpenIcon,!1),$(this.eCloseIcon,!1)}addInIcon(e,s){const i=be(e,this.gos,null);i&&this.getRefElement(s).appendChild(i)}addGroupExpandIcon(){if(!this.params.columnGroup.isExpandable()){$(this.eOpenIcon,!1),$(this.eCloseIcon,!1);return}}setupLabel(){var e;const{displayName:s,columnGroup:i}=this.params;if(P(s)){const o=Ne(s,!0);this.getRefElement("agLabel").textContent=o}this.addOrRemoveCssClass("ag-sticky-label",!((e=i.getColGroupDef())!=null&&e.suppressStickyLabel))}};Io.TEMPLATE=`<div class="ag-header-group-cell-label" ref="agContainer" role="presentation">
140
+ <span ref="agLabel" class="ag-header-group-text" role="presentation"></span>
141
+ <span ref="agOpened" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded"></span>
142
+ <span ref="agClosed" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed"></span>
143
+ </div>`,u([f("columnModel")],Io.prototype,"columnModel",2),u([I("agOpened")],Io.prototype,"eOpenIcon",2),u([I("agClosed")],Io.prototype,"eCloseIcon",2);var Yg=Io,zs=class extends K{isPopup(){return!0}setParentComponent(t){t.addCssClass("ag-has-popup"),super.setParentComponent(t)}destroy(){const t=this.parentComponent;t&&t.isAlive()&&t.getGui().classList.remove("ag-has-popup"),super.destroy()}},Yl=class mc extends zs{constructor(){super(mc.TEMPLATE)}init(e){this.params=e,this.focusAfterAttached=e.cellStartedEdit,this.eTextArea.setMaxLength(e.maxLength||200).setCols(e.cols||60).setRows(e.rows||10),P(e.value,!0)&&this.eTextArea.setValue(e.value.toString(),!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.activateTabIndex()}onKeyDown(e){const s=e.key;(s===E.LEFT||s===E.UP||s===E.RIGHT||s===E.DOWN||e.shiftKey&&s===E.ENTER)&&e.stopPropagation()}afterGuiAttached(){const e=this.localeService.getLocaleTextFunc();this.eTextArea.setInputAriaLabel(e("ariaInputEditor","Input Editor")),this.focusAfterAttached&&this.eTextArea.getFocusableElement().focus()}getValue(){const e=this.eTextArea.getValue();return!P(e)&&!P(this.params.value)?this.params.value:this.params.parseValue(e)}};Yl.TEMPLATE=`<div class="ag-large-text">
144
+ <ag-input-text-area ref="eTextArea" class="ag-large-text-input"></ag-input-text-area>
145
+ </div>`,u([I("eTextArea")],Yl.prototype,"eTextArea",2);var jg=Yl,jl=class extends zs{constructor(){super(`<div class="ag-cell-edit-wrapper">
146
+ <ag-select class="ag-cell-editor" ref="eSelect"></ag-select>
147
+ </div>`),this.startedByEnter=!1}init(t){this.focusAfterAttached=t.cellStartedEdit;const{eSelect:e,valueService:s,gos:i}=this,{values:o,value:r,eventKey:n}=t;if(z(o)){console.warn("AG Grid: no values found for select cellEditor");return}this.startedByEnter=n!=null?n===E.ENTER:!1;let l=!1;o.forEach(c=>{const m={value:c},C=s.formatValue(t.column,null,c),v=C!=null;m.text=v?C:c,e.addOption(m),l=l||r===c}),l?e.setValue(t.value,!0):t.values.length&&e.setValue(t.values[0],!0);const{valueListGap:a,valueListMaxWidth:d,valueListMaxHeight:h}=t;a!=null&&e.setPickerGap(a),h!=null&&e.setPickerMaxHeight(h),d!=null&&e.setPickerMaxWidth(d),i.get("editType")!=="fullRow"&&this.addManagedListener(this.eSelect,Yr.EVENT_ITEM_SELECTED,()=>t.stopEditing())}afterGuiAttached(){this.focusAfterAttached&&this.eSelect.getFocusableElement().focus(),this.startedByEnter&&setTimeout(()=>{this.isAlive()&&this.eSelect.showPicker()})}focusIn(){this.eSelect.getFocusableElement().focus()}getValue(){return this.eSelect.getValue()}isPopup(){return!1}};u([f("valueService")],jl.prototype,"valueService",2),u([I("eSelect")],jl.prototype,"eSelect",2);var No=class extends zs{constructor(t){super(`
148
+ <div class="ag-cell-edit-wrapper">
149
+ ${t.getTemplate()}
150
+ </div>`),this.cellEditorInput=t}init(t){this.params=t;const e=this.eInput;this.cellEditorInput.init(e,t);let s;if(t.cellStartedEdit){this.focusAfterAttached=!0;const i=t.eventKey;i===E.BACKSPACE||t.eventKey===E.DELETE?s="":i&&i.length===1?s=i:(s=this.cellEditorInput.getStartValue(),i!==E.F2&&(this.highlightAllOnFocus=!0))}else this.focusAfterAttached=!1,s=this.cellEditorInput.getStartValue();s!=null&&e.setStartValue(s),this.addManagedListener(e.getGui(),"keydown",i=>{const{key:o}=i;(o===E.PAGE_UP||o===E.PAGE_DOWN)&&i.preventDefault()})}afterGuiAttached(){var t,e;const s=this.localeService.getLocaleTextFunc(),i=this.eInput;if(i.setInputAriaLabel(s("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;qt()||i.getFocusableElement().focus();const o=i.getInputElement();this.highlightAllOnFocus?o.select():(e=(t=this.cellEditorInput).setCaret)==null||e.call(t)}focusIn(){const t=this.eInput,e=t.getFocusableElement(),s=t.getInputElement();e.focus(),s.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}};u([I("eInput")],No.prototype,"eInput",2);var qg=class{getTemplate(){return'<ag-input-text-field class="ag-cell-editor" ref="eInput"></ag-input-text-field>'}init(t,e){this.eInput=t,this.params=e,e.maxLength!=null&&t.setMaxLength(e.maxLength)}getValue(){const t=this.eInput.getValue();return!P(t)&&!P(this.params.value)?this.params.value:this.params.parseValue(t)}getStartValue(){return this.params.useFormatter||this.params.column.getColDef().refData?this.params.formatValue(this.params.value):this.params.value}setCaret(){const t=this.eInput.getValue(),e=P(t)&&t.length||0;e&&this.eInput.getInputElement().setSelectionRange(e,e)}},oh=class extends No{constructor(){super(new qg)}},Qg="↑",Xg="↓",rh=class extends K{constructor(){super(),this.refreshCount=0;const t=document.createElement("span"),e=document.createElement("span");e.setAttribute("class","ag-value-change-delta");const s=document.createElement("span");s.setAttribute("class","ag-value-change-value"),t.appendChild(e),t.appendChild(s),this.setTemplateFromElement(t)}init(t){this.eValue=this.queryForHtmlElement(".ag-value-change-value"),this.eDelta=this.queryForHtmlElement(".ag-value-change-delta"),this.refresh(t,!0)}showDelta(t,e){const s=Math.abs(e),i=t.formatValue(s),o=P(i)?i:s,r=e>=0;r?this.eDelta.textContent=Qg+o:this.eDelta.textContent=Xg+o,this.eDelta.classList.toggle("ag-value-change-delta-up",r),this.eDelta.classList.toggle("ag-value-change-delta-down",!r)}setTimerToRemoveDelta(){this.refreshCount++;const t=this.refreshCount;this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>{t===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),Le(this.eDelta)}refresh(t,e=!1){const s=t.value;if(s===this.lastValue||(P(t.valueFormatted)?this.eValue.textContent=t.valueFormatted:P(t.value)?this.eValue.textContent=s:Le(this.eValue),this.filterManager.isSuppressFlashingCellsBecauseFiltering()))return!1;if(typeof s=="number"&&typeof this.lastValue=="number"){const i=s-this.lastValue;this.showDelta(t,i)}return this.lastValue&&this.eValue.classList.add("ag-value-change-value-highlight"),e||this.setTimerToRemoveDelta(),this.lastValue=s,!0}};u([f("filterManager")],rh.prototype,"filterManager",2);var nh=class extends K{constructor(){super(),this.refreshCount=0;const t=document.createElement("span"),e=document.createElement("span");e.setAttribute("class","ag-value-slide-current"),t.appendChild(e),this.setTemplateFromElement(t),this.eCurrent=this.queryForHtmlElement(".ag-value-slide-current")}init(t){this.refresh(t,!0)}addSlideAnimation(){this.refreshCount++;const t=this.refreshCount;this.ePrevious&&this.getGui().removeChild(this.ePrevious);const e=document.createElement("span");e.setAttribute("class","ag-value-slide-previous ag-value-slide-out"),this.ePrevious=e,this.ePrevious.textContent=this.eCurrent.textContent,this.getGui().insertBefore(this.ePrevious,this.eCurrent),this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>{t===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{t===this.refreshCount&&(this.getGui().removeChild(this.ePrevious),this.ePrevious=null)},3e3)})}refresh(t,e=!1){let s=t.value;return z(s)&&(s=""),s===this.lastValue||this.filterManager.isSuppressFlashingCellsBecauseFiltering()?!1:(e||this.addSlideAnimation(),this.lastValue=s,P(t.valueFormatted)?this.eCurrent.textContent=t.valueFormatted:P(t.value)?this.eCurrent.textContent=s:Le(this.eCurrent),!0)}};u([f("filterManager")],nh.prototype,"filterManager",2);var ye=class we{constructor(e){this.rowIndex=null,this.key=null,this.childrenMapped={},this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=we.OBJECT_ID_SEQUENCE++,this.__autoHeights={},this.alreadyRendered=!1,this.highlighted=null,this.hovered=!1,this.selected=!1,this.beans=e}setData(e){this.setDataCommon(e,!1)}updateData(e){this.setDataCommon(e,!0)}setDataCommon(e,s){const i=this.data;this.data=e,this.beans.valueCache.onDataChanged(),this.updateDataOnDetailNode(),this.checkRowSelectable(),this.resetQuickFilterAggregateText();const o=this.createDataChangedEvent(e,i,s);this.dispatchLocalEvent(o)}updateDataOnDetailNode(){this.detailNode&&(this.detailNode.data=this.data)}createDataChangedEvent(e,s,i){return{type:we.EVENT_DATA_CHANGED,node:this,oldData:s,newData:e,update:i}}createLocalRowEvent(e){return{type:e,node:this}}getRowIndexString(){return this.rowPinned==="top"?"t-"+this.rowIndex:this.rowPinned==="bottom"?"b-"+this.rowIndex:this.rowIndex.toString()}createDaemonNode(){const e=new we(this.beans);return e.id=this.id,e.data=this.data,e.__daemon=!0,e.selected=this.selected,e.level=this.level,e}setDataAndId(e,s){const i=P(this.id)?this.createDaemonNode():null,o=this.data;this.data=e,this.updateDataOnDetailNode(),this.setId(s),this.checkRowSelectable(),this.beans.selectionService.syncInRowNode(this,i);const r=this.createDataChangedEvent(e,o,!1);this.dispatchLocalEvent(r)}checkRowSelectable(){const e=this.beans.gos.get("isRowSelectable");this.setRowSelectable(e?e(this):!0)}setRowSelectable(e,s){if(this.selectable!==e){if(this.selectable=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(we.EVENT_SELECTABLE_CHANGED)),s)return;if(this.beans.gos.get("groupSelectsChildren")){const o=this.calculateSelectedFromChildren();this.setSelectedParams({newValue:o??!1,source:"selectableChanged"});return}this.isSelected()&&!this.selectable&&this.setSelectedParams({newValue:!1,source:"selectableChanged"})}}setId(e){const s=this.beans.gos.getCallback("getRowId");if(s)if(this.data){const i=this.getGroupKeys(!0);this.id=s({data:this.data,parentKeys:i.length>0?i:void 0,level:this.level}),this.id!==null&&typeof this.id=="string"&&this.id.startsWith(we.ID_PREFIX_ROW_GROUP)&&console.error(`AG Grid: Row IDs cannot start with ${we.ID_PREFIX_ROW_GROUP}, this is a reserved prefix for AG Grid's row grouping feature.`),this.id!==null&&typeof this.id!="string"&&(this.id=""+this.id)}else this.id=void 0;else this.id=e}getGroupKeys(e=!1){const s=[];let i=this;for(e&&(i=i.parent);i&&i.level>=0;)s.push(i.key),i=i.parent;return s.reverse(),s}isPixelInRange(e){return!P(this.rowTop)||!P(this.rowHeight)?!1:e>=this.rowTop&&e<this.rowTop+this.rowHeight}setFirstChild(e){this.firstChild!==e&&(this.firstChild=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(we.EVENT_FIRST_CHILD_CHANGED)))}setLastChild(e){this.lastChild!==e&&(this.lastChild=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(we.EVENT_LAST_CHILD_CHANGED)))}setChildIndex(e){this.childIndex!==e&&(this.childIndex=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(we.EVENT_CHILD_INDEX_CHANGED)))}setRowTop(e){this.oldRowTop=this.rowTop,this.rowTop!==e&&(this.rowTop=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(we.EVENT_TOP_CHANGED)),this.setDisplayed(e!==null))}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setDisplayed(e){this.displayed!==e&&(this.displayed=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(we.EVENT_DISPLAYED_CHANGED)))}setDragging(e){this.dragging!==e&&(this.dragging=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(we.EVENT_DRAGGING_CHANGED)))}setHighlighted(e){e!==this.highlighted&&(this.highlighted=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(we.EVENT_HIGHLIGHT_CHANGED)))}setHovered(e){this.hovered!==e&&(this.hovered=e)}isHovered(){return this.hovered}setAllChildrenCount(e){this.allChildrenCount!==e&&(this.allChildrenCount=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(we.EVENT_ALL_CHILDREN_COUNT_CHANGED)))}setMaster(e){this.master!==e&&(this.master&&!e&&(this.expanded=!1),this.master=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(we.EVENT_MASTER_CHANGED)))}setGroup(e){this.group!==e&&(this.group&&!e&&(this.expanded=!1),this.group=e,this.updateHasChildren(),this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(we.EVENT_GROUP_CHANGED)))}setRowHeight(e,s=!1){this.rowHeight=e,this.rowHeightEstimated=s,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(we.EVENT_HEIGHT_CHANGED))}setRowAutoHeight(e,s){this.__autoHeights||(this.__autoHeights={}),this.__autoHeights[s.getId()]=e,e!=null&&(this.checkAutoHeightsDebounced==null&&(this.checkAutoHeightsDebounced=et(this.checkAutoHeights.bind(this),1)),this.checkAutoHeightsDebounced())}checkAutoHeights(){let e=!1,s=!0,i=0;const o=this.__autoHeights;if(o==null||(this.beans.columnModel.getAllDisplayedAutoHeightCols().forEach(l=>{let a=o[l.getId()];if(a==null)if(this.beans.columnModel.isColSpanActive()){let d=[];switch(l.getPinned()){case"left":d=this.beans.columnModel.getDisplayedLeftColumnsForRow(this);break;case"right":d=this.beans.columnModel.getDisplayedRightColumnsForRow(this);break;case null:d=this.beans.columnModel.getViewportCenterColumnsForRow(this);break}if(d.includes(l)){e=!0;return}a=-1}else{e=!0;return}else s=!1;a>i&&(i=a)}),e)||((s||i<10)&&(i=this.beans.gos.getRowHeightForNode(this).height),i==this.rowHeight))return;this.setRowHeight(i);const n=this.beans.rowModel;n.onRowHeightChangedDebounced&&n.onRowHeightChangedDebounced()}setRowIndex(e){this.rowIndex!==e&&(this.rowIndex=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(we.EVENT_ROW_INDEX_CHANGED)))}setUiLevel(e){this.uiLevel!==e&&(this.uiLevel=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(we.EVENT_UI_LEVEL_CHANGED)))}setExpanded(e,s,i){if(this.expanded===e)return;this.expanded=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(we.EVENT_EXPANDED_CHANGED));const o=Object.assign({},this.createGlobalRowEvent(p.EVENT_ROW_GROUP_OPENED),{expanded:e,event:s||null});this.beans.rowNodeEventThrottle.dispatchExpanded(o,i),this.beans.rowRenderer.refreshCells({rowNodes:[this]})}createGlobalRowEvent(e){return this.beans.gos.addGridCommonParams({type:e,node:this,data:this.data,rowIndex:this.rowIndex,rowPinned:this.rowPinned})}dispatchLocalEvent(e){this.eventService&&this.eventService.dispatchEvent(e)}setDataValue(e,s,i){const r=(()=>{var a;return typeof e!="string"?e:(a=this.beans.columnModel.getGridColumn(e))!=null?a:this.beans.columnModel.getPrimaryColumn(e)})(),n=this.getValueFromValueService(r);if(this.beans.gos.get("readOnlyEdit"))return this.dispatchEventForSaveValueReadOnly(r,n,s,i),!1;const l=this.beans.valueService.setValue(this,r,s,i);return this.dispatchCellChangedEvent(r,s,n),this.checkRowSelectable(),l}getValueFromValueService(e){var s,i;const o=this.leafGroup&&this.beans.columnModel.isPivotMode(),r=this.group&&this.expanded&&!this.footer&&!o;let n=!1;const l=(s=this.beans.gos.get("groupTotalRow"))!=null?s:this.beans.gos.get("groupIncludeFooter");typeof l!="function"?n=!!l:n=!!((i=this.beans.gos.getCallback("groupTotalRow"))!=null?i:this.beans.gos.getCallback("groupIncludeFooter"))({node:this});const a=this.beans.gos.get("groupSuppressBlankHeader"),d=r&&n&&!a;return this.beans.valueService.getValue(e,this,!1,d)}dispatchEventForSaveValueReadOnly(e,s,i,o){const r=this.beans.gos.addGridCommonParams({type:p.EVENT_CELL_EDIT_REQUEST,event:null,rowIndex:this.rowIndex,rowPinned:this.rowPinned,column:e,colDef:e.getColDef(),data:this.data,node:this,oldValue:s,newValue:i,value:i,source:o});this.beans.eventService.dispatchEvent(r)}setGroupValue(e,s){const i=this.beans.columnModel.getGridColumn(e);z(this.groupData)&&(this.groupData={});const o=i.getColId(),r=this.groupData[o];r!==s&&(this.groupData[o]=s,this.dispatchCellChangedEvent(i,s,r))}setAggData(e){const s=this.aggData;if(this.aggData=e,this.eventService){const i=o=>{const r=this.aggData?this.aggData[o]:void 0,n=s?s[o]:void 0;if(r===n)return;const l=this.beans.columnModel.lookupGridColumn(o);l&&this.dispatchCellChangedEvent(l,r,n)};for(const o in this.aggData)i(o);for(const o in e)o in this.aggData||i(o)}}updateHasChildren(){let e=this.group&&!this.footer||this.childrenAfterGroup&&this.childrenAfterGroup.length>0;if(this.beans.gos.isRowModelType("serverSide")){const i=this.beans.gos.get("treeData"),o=this.beans.gos.get("isServerSideGroup");e=!this.stub&&!this.footer&&(i?!!o&&o(this.data):!!this.group)}e!==this.__hasChildren&&(this.__hasChildren=!!e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(we.EVENT_HAS_CHILDREN_CHANGED)))}hasChildren(){return this.__hasChildren==null&&this.updateHasChildren(),this.__hasChildren}isEmptyRowGroupNode(){return this.group&&bt(this.childrenAfterGroup)}dispatchCellChangedEvent(e,s,i){const o={type:we.EVENT_CELL_CHANGED,node:this,column:e,newValue:s,oldValue:i};this.dispatchLocalEvent(o)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return this.footer?!1:this.beans.columnModel.isPivotMode()?this.hasChildren()&&!this.leafGroup:this.hasChildren()||!!this.master}isSelected(){return this.footer?this.sibling.isSelected():this.selected}depthFirstSearch(e){this.childrenAfterGroup&&this.childrenAfterGroup.forEach(s=>s.depthFirstSearch(e)),e(this)}calculateSelectedFromChildren(){var e;let s=!1,i=!1,o=!1;if(!((e=this.childrenAfterGroup)!=null&&e.length))return this.selectable?this.selected:null;for(let r=0;r<this.childrenAfterGroup.length;r++){const n=this.childrenAfterGroup[r];let l=n.isSelected();if(!n.selectable){const a=n.calculateSelectedFromChildren();if(a===null)continue;l=a}switch(l){case!0:s=!0;break;case!1:i=!0;break;default:o=!0;break}}if(!(o||s&&i))return s?!0:i?!1:this.selectable?this.selected:null}setSelectedInitialValue(e){this.selected=e}selectThisNode(e,s,i="api"){const o=!this.selectable&&e,r=this.selected===e;if(o||r)return!1;this.selected=e,this.eventService&&this.dispatchLocalEvent(this.createLocalRowEvent(we.EVENT_ROW_SELECTED));const n=this.sibling;n&&n.footer&&n.eventService&&n.dispatchLocalEvent(n.createLocalRowEvent(we.EVENT_ROW_SELECTED));const l=Ee(_({},this.createGlobalRowEvent(p.EVENT_ROW_SELECTED)),{event:s||null,source:i});return this.beans.eventService.dispatchEvent(l),!0}setSelected(e,s=!1,i="api"){if(typeof i=="boolean"){console.warn("AG Grid: since version v30, rowNode.setSelected() property `suppressFinishActions` has been removed, please use `gridApi.setNodesSelected()` for bulk actions, and the event `source` property for ignoring events instead.");return}this.setSelectedParams({newValue:e,clearSelection:s,rangeSelect:!1,source:i})}setSelectedParams(e){return this.rowPinned?(console.warn("AG Grid: cannot select pinned rows"),0):this.id===void 0?(console.warn("AG Grid: cannot select node until id for node is known"),0):this.beans.selectionService.setNodesSelected(Ee(_({},e),{nodes:[this.footer?this.sibling:this]}))}isRowPinned(){return this.rowPinned==="top"||this.rowPinned==="bottom"}isParentOfNode(e){let s=this.parent;for(;s;){if(s===e)return!0;s=s.parent}return!1}addEventListener(e,s){var i,o;this.eventService||(this.eventService=new Gt),this.beans.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.eventService.setFrameworkOverrides(this.beans.frameworkOverrides),this.frameworkEventListenerService=new jn(this.beans.frameworkOverrides));const r=(o=(i=this.frameworkEventListenerService)==null?void 0:i.wrap(s))!=null?o:s;this.eventService.addEventListener(e,r)}removeEventListener(e,s){var i,o;if(!this.eventService)return;const r=(o=(i=this.frameworkEventListenerService)==null?void 0:i.unwrap(s))!=null?o:s;this.eventService.removeEventListener(e,r),this.eventService.noRegisteredListenersExist()&&(this.eventService=null)}onMouseEnter(){this.dispatchLocalEvent(this.createLocalRowEvent(we.EVENT_MOUSE_ENTER))}onMouseLeave(){this.dispatchLocalEvent(this.createLocalRowEvent(we.EVENT_MOUSE_LEAVE))}getFirstChildOfFirstChild(e){let s=this,i=!0,o=!1,r=null;for(;i&&!o;){const n=s.parent;P(n)&&s.firstChild?n.rowGroupColumn===e&&(o=!0,r=n):i=!1,s=n}return o?r:null}isFullWidthCell(){if(this.detail)return!0;const e=this.beans.gos.getCallback("isFullWidthRow");return e?e({rowNode:this}):!1}getRoute(){if(this.key==null)return;const e=[];let s=this;for(;s.key!=null;)e.push(s.key),s=s.parent;return e.reverse()}createFooter(){if(this.sibling)return;const e=new Set(["eventService","__objectId","sticky"]),s=new we(this.beans);Object.keys(this).forEach(i=>{e.has(i)||(s[i]=this[i])}),s.footer=!0,s.setRowTop(null),s.setRowIndex(null),s.oldRowTop=null,s.id="rowGroupFooter_"+this.id,s.sibling=this,this.sibling=s}destroyFooter(){this.sibling&&(this.sibling.setRowTop(null),this.sibling.setRowIndex(null),this.sibling=void 0)}};ye.ID_PREFIX_ROW_GROUP="row-group-",ye.ID_PREFIX_TOP_PINNED="t-",ye.ID_PREFIX_BOTTOM_PINNED="b-",ye.OBJECT_ID_SEQUENCE=0,ye.EVENT_ROW_SELECTED="rowSelected",ye.EVENT_DATA_CHANGED="dataChanged",ye.EVENT_CELL_CHANGED="cellChanged",ye.EVENT_ALL_CHILDREN_COUNT_CHANGED="allChildrenCountChanged",ye.EVENT_MASTER_CHANGED="masterChanged",ye.EVENT_GROUP_CHANGED="groupChanged",ye.EVENT_MOUSE_ENTER="mouseEnter",ye.EVENT_MOUSE_LEAVE="mouseLeave",ye.EVENT_HEIGHT_CHANGED="heightChanged",ye.EVENT_TOP_CHANGED="topChanged",ye.EVENT_DISPLAYED_CHANGED="displayedChanged",ye.EVENT_FIRST_CHILD_CHANGED="firstChildChanged",ye.EVENT_LAST_CHILD_CHANGED="lastChildChanged",ye.EVENT_CHILD_INDEX_CHANGED="childIndexChanged",ye.EVENT_ROW_INDEX_CHANGED="rowIndexChanged",ye.EVENT_EXPANDED_CHANGED="expandedChanged",ye.EVENT_HAS_CHILDREN_CHANGED="hasChildrenChanged",ye.EVENT_SELECTABLE_CHANGED="selectableChanged",ye.EVENT_UI_LEVEL_CHANGED="uiLevelChanged",ye.EVENT_HIGHLIGHT_CHANGED="rowHighlightChanged",ye.EVENT_DRAGGING_CHANGED="draggingChanged";var J=ye,Xr=class extends K{constructor(){super(`
151
+ <div class="ag-selection-checkbox" role="presentation">
152
+ <ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>
153
+ </div>`)}postConstruct(){this.eCheckbox.setPassive(!0)}getCheckboxId(){return this.eCheckbox.getInputElement().id}onDataChanged(){this.onSelectionChanged()}onSelectableChanged(){this.showOrHideSelect()}onSelectionChanged(){const t=this.localeService.getLocaleTextFunc(),e=this.rowNode.isSelected(),s=xr(t,e),[i,o]=this.rowNode.selectable?["ariaRowToggleSelection","Press Space to toggle row selection"]:["ariaRowSelectionDisabled","Row Selection is disabled for this row"],r=t(i,o);this.eCheckbox.setValue(e,!0),this.eCheckbox.setInputAriaLabel(`${r} (${s})`)}onClicked(t,e,s){return this.rowNode.setSelectedParams({newValue:t,rangeSelect:s.shiftKey,groupSelectsFiltered:e,event:s,source:"checkboxSelected"})}init(t){if(this.rowNode=t.rowNode,this.column=t.column,this.overrides=t.overrides,this.onSelectionChanged(),this.addManagedListener(this.eCheckbox.getInputElement(),"dblclick",i=>{Ot(i)}),this.addManagedListener(this.eCheckbox.getInputElement(),"click",i=>{Ot(i);const o=this.gos.get("groupSelectsFiltered"),r=this.eCheckbox.getValue();this.shouldHandleIndeterminateState(r,o)?this.onClicked(!0,o,i||{})===0&&this.onClicked(!1,o,i):r?this.onClicked(!1,o,i):this.onClicked(!0,o,i||{})}),this.addManagedListener(this.rowNode,J.EVENT_ROW_SELECTED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.rowNode,J.EVENT_DATA_CHANGED,this.onDataChanged.bind(this)),this.addManagedListener(this.rowNode,J.EVENT_SELECTABLE_CHANGED,this.onSelectableChanged.bind(this)),this.gos.get("isRowSelectable")||typeof this.getIsVisible()=="function"){const i=this.showOrHideSelect.bind(this);this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,i),this.addManagedListener(this.rowNode,J.EVENT_DATA_CHANGED,i),this.addManagedListener(this.rowNode,J.EVENT_CELL_CHANGED,i),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")}shouldHandleIndeterminateState(t,e){return e&&(this.eCheckbox.getPreviousValue()===void 0||t===void 0)&&this.gos.isRowModelType("clientSide")}showOrHideSelect(){var t,e,s;let i=this.rowNode.selectable;const o=this.getIsVisible();if(i)if(typeof o=="function"){const n=(t=this.overrides)==null?void 0:t.callbackParams;if(!this.column)i=o(Ee(_({},n),{node:this.rowNode,data:this.rowNode.data}));else{const l=this.column.createColumnFunctionCallbackParams(this.rowNode);i=o(_(_({},n),l))}}else i=o??!1;if((e=this.column)==null?void 0:e.getColDef().showDisabledCheckboxes){this.eCheckbox.setDisabled(!i),this.setVisible(!0),this.setDisplayed(!0);return}if((s=this.overrides)!=null&&s.removeHidden){this.setDisplayed(i);return}this.setVisible(i)}getIsVisible(){var t,e;return this.overrides?this.overrides.isVisible:(e=(t=this.column)==null?void 0:t.getColDef())==null?void 0:e.checkboxSelection}};u([I("eCheckbox")],Xr.prototype,"eCheckbox",2),u([M],Xr.prototype,"postConstruct",1);var lh=(t=>(t[t.Left=0]="Left",t[t.Right=1]="Right",t))(lh||{}),j=class extends L{constructor(){super(...arguments),this.dragSourceAndParamsList=[],this.dropTargets=[]}init(){this.ePinnedIcon=Lt("columnMovePin",this.gos,null),this.eHideIcon=Lt("columnMoveHide",this.gos,null),this.eMoveIcon=Lt("columnMoveMove",this.gos,null),this.eLeftIcon=Lt("columnMoveLeft",this.gos,null),this.eRightIcon=Lt("columnMoveRight",this.gos,null),this.eGroupIcon=Lt("columnMoveGroup",this.gos,null),this.eAggregateIcon=Lt("columnMoveValue",this.gos,null),this.ePivotIcon=Lt("columnMovePivot",this.gos,null),this.eDropNotAllowedIcon=Lt("dropNotAllowed",this.gos,null)}addDragSource(t,e=!1){const s={eElement:t.eElement,dragStartPixels:t.dragStartPixels,onDragStart:this.onDragStart.bind(this,t),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),includeTouch:e};this.dragSourceAndParamsList.push({params:s,dragSource:t}),this.dragService.addDragSource(s)}removeDragSource(t){const e=this.dragSourceAndParamsList.find(s=>s.dragSource===t);e&&(this.dragService.removeDragSource(e.params),dt(this.dragSourceAndParamsList,e))}clearDragSourceParamsList(){this.dragSourceAndParamsList.forEach(t=>this.dragService.removeDragSource(t.params)),this.dragSourceAndParamsList.length=0,this.dropTargets.length=0}nudge(){this.dragging&&this.onDragging(this.eventLastTime,!0)}onDragStart(t,e){this.dragging=!0,this.dragSource=t,this.eventLastTime=e,this.dragItem=this.dragSource.getDragItem(),this.lastDropTarget=void 0,this.dragSource.onDragStarted&&this.dragSource.onDragStarted(),this.createGhost()}onDragStop(t){if(this.eventLastTime=null,this.dragging=!1,this.dragSource.onDragStopped&&this.dragSource.onDragStopped(),this.lastDropTarget&&this.lastDropTarget.onDragStop){const e=this.createDropTargetEvent(this.lastDropTarget,t,null,null,!1);this.lastDropTarget.onDragStop(e)}this.lastDropTarget=null,this.dragItem=null,this.removeGhost()}onDragging(t,e){var s,i,o,r;const n=this.getHorizontalDirection(t),l=this.getVerticalDirection(t);this.eventLastTime=t,this.positionGhost(t);const a=this.dropTargets.filter(h=>this.isMouseOnDropTarget(t,h)),d=this.findCurrentDropTarget(t,a);if(d!==this.lastDropTarget)this.leaveLastTargetIfExists(t,n,l,e),this.lastDropTarget!==null&&d===null&&((i=(s=this.dragSource).onGridExit)==null||i.call(s,this.dragItem)),this.lastDropTarget===null&&d!==null&&((r=(o=this.dragSource).onGridEnter)==null||r.call(o,this.dragItem)),this.enterDragTargetIfExists(d,t,n,l,e),this.lastDropTarget=d;else if(d&&d.onDragging){const h=this.createDropTargetEvent(d,t,n,l,e);d.onDragging(h)}}getAllContainersFromDropTarget(t){const e=t.getSecondaryContainers?t.getSecondaryContainers():null,s=[[t.getContainer()]];return e?s.concat(e):s}allContainersIntersect(t,e){for(const s of e){const i=s.getBoundingClientRect();if(i.width===0||i.height===0)return!1;const o=t.clientX>=i.left&&t.clientX<i.right,r=t.clientY>=i.top&&t.clientY<i.bottom;if(!o||!r)return!1}return!0}isMouseOnDropTarget(t,e){const s=this.getAllContainersFromDropTarget(e);let i=!1;for(const o of s)if(this.allContainersIntersect(t,o)){i=!0;break}return e.targetContainsSource&&!e.getContainer().contains(this.dragSource.eElement)?!1:i&&e.isInterestedIn(this.dragSource.type,this.dragSource.eElement)}findCurrentDropTarget(t,e){const s=e.length;if(s===0)return null;if(s===1)return e[0];const o=this.gos.getRootNode().elementsFromPoint(t.clientX,t.clientY);for(const r of o)for(const n of e)if(Bd(this.getAllContainersFromDropTarget(n)).indexOf(r)!==-1)return n;return null}enterDragTargetIfExists(t,e,s,i,o){if(t){if(t.onDragEnter){const r=this.createDropTargetEvent(t,e,s,i,o);t.onDragEnter(r)}this.setGhostIcon(t.getIconName?t.getIconName():null)}}leaveLastTargetIfExists(t,e,s,i){if(this.lastDropTarget){if(this.lastDropTarget.onDragLeave){const o=this.createDropTargetEvent(this.lastDropTarget,t,e,s,i);this.lastDropTarget.onDragLeave(o)}this.setGhostIcon(null)}}addDropTarget(t){this.dropTargets.push(t)}removeDropTarget(t){this.dropTargets=this.dropTargets.filter(e=>e.getContainer()!==t.getContainer())}hasExternalDropZones(){return this.dropTargets.some(t=>t.external)}findExternalZone(t){return this.dropTargets.filter(s=>s.external).find(s=>s.getContainer()===t.getContainer())||null}getHorizontalDirection(t){const e=this.eventLastTime&&this.eventLastTime.clientX,s=t.clientX;return e===s?null:e>s?0:1}getVerticalDirection(t){const e=this.eventLastTime&&this.eventLastTime.clientY,s=t.clientY;return e===s?null:e>s?0:1}createDropTargetEvent(t,e,s,i,o){const r=t.getContainer(),n=r.getBoundingClientRect(),{gridApi:l,columnApi:a,dragItem:d,dragSource:h}=this,c=e.clientX-n.left,m=e.clientY-n.top;return{event:e,x:c,y:m,vDirection:i,hDirection:s,dragSource:h,fromNudge:o,dragItem:d,api:l,columnApi:a,dropZoneTarget:r}}positionGhost(t){const e=this.eGhost;if(!e)return;const i=e.getBoundingClientRect().height,o=gu()-2,r=fu()-2,n=Al(e.offsetParent),{clientY:l,clientX:a}=t;let d=l-n.top-i/2,h=a-n.left-10;const c=this.gos.getDocument(),m=c.defaultView||window,C=m.pageYOffset||c.documentElement.scrollTop,v=m.pageXOffset||c.documentElement.scrollLeft;o>0&&h+e.clientWidth>o+v&&(h=o+v-e.clientWidth),h<0&&(h=0),r>0&&d+e.clientHeight>r+C&&(d=r+C-e.clientHeight),d<0&&(d=0),e.style.left=`${h}px`,e.style.top=`${d}px`}removeGhost(){this.eGhost&&this.eGhostParent&&this.eGhostParent.removeChild(this.eGhost),this.eGhost=null}createGhost(){this.eGhost=ct(j.GHOST_TEMPLATE),this.mouseEventService.stampTopLevelGridCompWithGridInstance(this.eGhost);const{theme:t}=this.environment.getTheme();t&&this.eGhost.classList.add(t),this.eGhostIcon=this.eGhost.querySelector(".ag-dnd-ghost-icon"),this.setGhostIcon(null);const e=this.eGhost.querySelector(".ag-dnd-ghost-label");let s=this.dragSource.dragItemName;br(s)&&(s=s()),e.innerHTML=Ne(s)||"",this.eGhost.style.height="25px",this.eGhost.style.top="20px",this.eGhost.style.left="20px";const i=this.gos.getDocument();let o=null,r=null;try{o=i.fullscreenElement}catch{}finally{o||(o=this.gos.getRootNode());const n=o.querySelector("body");n?r=n:o instanceof ShadowRoot?r=o:o instanceof Document?r=o==null?void 0:o.documentElement:r=o}this.eGhostParent=r,this.eGhostParent?this.eGhostParent.appendChild(this.eGhost):console.warn("AG Grid: could not find document body, it is needed for dragging columns")}setGhostIcon(t,e=!1){Le(this.eGhostIcon);let s=null;switch(t||(t=this.dragSource.getDefaultIconName?this.dragSource.getDefaultIconName():j.ICON_NOT_ALLOWED),t){case j.ICON_PINNED:s=this.ePinnedIcon;break;case j.ICON_MOVE:s=this.eMoveIcon;break;case j.ICON_LEFT:s=this.eLeftIcon;break;case j.ICON_RIGHT:s=this.eRightIcon;break;case j.ICON_GROUP:s=this.eGroupIcon;break;case j.ICON_AGGREGATE:s=this.eAggregateIcon;break;case j.ICON_PIVOT:s=this.ePivotIcon;break;case j.ICON_NOT_ALLOWED:s=this.eDropNotAllowedIcon;break;case j.ICON_HIDE:s=this.eHideIcon;break}this.eGhostIcon.classList.toggle("ag-shake-left-to-right",e),!(s===this.eHideIcon&&this.gos.get("suppressDragLeaveHidesColumns"))&&s&&this.eGhostIcon.appendChild(s)}};j.ICON_PINNED="pinned",j.ICON_MOVE="move",j.ICON_LEFT="left",j.ICON_RIGHT="right",j.ICON_GROUP="group",j.ICON_AGGREGATE="aggregate",j.ICON_PIVOT="pivot",j.ICON_NOT_ALLOWED="notAllowed",j.ICON_HIDE="hide",j.GHOST_TEMPLATE=`<div class="ag-dnd-ghost ag-unselectable">
154
+ <span class="ag-dnd-ghost-icon ag-shake-left-to-right"></span>
155
+ <div class="ag-dnd-ghost-label"></div>
156
+ </div>`,u([f("dragService")],j.prototype,"dragService",2),u([f("mouseEventService")],j.prototype,"mouseEventService",2),u([f("columnApi")],j.prototype,"columnApi",2),u([f("gridApi")],j.prototype,"gridApi",2),u([M],j.prototype,"init",1),u([tt],j.prototype,"clearDragSourceParamsList",1),j=u([O("dragAndDropService")],j);var Ks=class extends K{constructor(t,e,s,i,o,r){super(),this.cellValueFn=t,this.rowNode=e,this.column=s,this.customGui=i,this.dragStartPixels=o,this.suppressVisibilityChange=r,this.dragSource=null}isCustomGui(){return this.customGui!=null}postConstruct(){if(this.customGui?this.setDragElement(this.customGui,this.dragStartPixels):(this.setTemplate('<div class="ag-drag-handle ag-row-drag" aria-hidden="true"></div>'),this.getGui().appendChild(be("rowDrag",this.gos,null)),this.addDragSource()),this.checkCompatibility(),!this.suppressVisibilityChange){const t=this.gos.get("rowDragManaged")?new uh(this,this.beans,this.rowNode,this.column):new dh(this,this.beans,this.rowNode,this.column);this.createManagedBean(t,this.beans.context)}}setDragElement(t,e){this.setTemplateFromElement(t),this.addDragSource(e)}getSelectedNodes(){if(!this.gos.get("rowDragMultiRow"))return[this.rowNode];const e=this.beans.selectionService.getSelectedNodes();return e.indexOf(this.rowNode)!==-1?e:[this.rowNode]}checkCompatibility(){const t=this.gos.get("rowDragManaged");this.gos.get("treeData")&&t&&H("If using row drag with tree data, you cannot have rowDragManaged=true")}getDragItem(){return{rowNode:this.rowNode,rowNodes:this.getSelectedNodes(),columns:this.column?[this.column]:void 0,defaultTextValue:this.cellValueFn()}}getRowDragText(t){if(t){const e=t.getColDef();if(e.rowDragText)return e.rowDragText}return this.gos.get("rowDragText")}addDragSource(t=4){this.dragSource&&this.removeDragSource();const e=this.localeService.getLocaleTextFunc();this.dragSource={type:2,eElement:this.getGui(),dragItemName:()=>{var s;const i=this.getDragItem(),o=((s=i.rowNodes)==null?void 0:s.length)||1,r=this.getRowDragText(this.column);return r?r(i,o):o===1?this.cellValueFn():`${o} ${e("rowDragRows","rows")}`},getDragItem:()=>this.getDragItem(),dragStartPixels:t,dragSourceDomDataKey:this.gos.getDomDataKey()},this.beans.dragAndDropService.addDragSource(this.dragSource,!0)}removeDragSource(){this.dragSource&&this.beans.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null}};u([f("beans")],Ks.prototype,"beans",2),u([M],Ks.prototype,"postConstruct",1),u([tt],Ks.prototype,"removeDragSource",1);var ah=class extends L{constructor(t,e,s){super(),this.parent=t,this.rowNode=e,this.column=s}setDisplayedOrVisible(t){const e={skipAriaHidden:!0};if(t)this.parent.setDisplayed(!1,e);else{let s=!0,i=!1;this.column&&(s=this.column.isRowDrag(this.rowNode)||this.parent.isCustomGui(),i=br(this.column.getColDef().rowDrag)),i?(this.parent.setDisplayed(!0,e),this.parent.setVisible(s,e)):(this.parent.setDisplayed(s,e),this.parent.setVisible(!0,e))}}},dh=class extends ah{constructor(t,e,s,i){super(t,s,i),this.beans=e}postConstruct(){this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.addManagedListener(this.rowNode,J.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,J.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,J.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,p.EVENT_NEW_COLUMNS_LOADED,this.workOutVisibility.bind(this)),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const t=this.gos.get("suppressRowDrag");this.setDisplayedOrVisible(t)}};u([M],dh.prototype,"postConstruct",1);var uh=class extends ah{constructor(t,e,s,i){super(t,s,i),this.beans=e}postConstruct(){this.addManagedListener(this.beans.eventService,p.EVENT_SORT_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,p.EVENT_FILTER_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,p.EVENT_COLUMN_ROW_GROUP_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,p.EVENT_NEW_COLUMNS_LOADED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,J.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,J.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const e=this.beans.ctrlsService.getGridBodyCtrl().getRowDragFeature(),s=e&&e.shouldPreventRowMove(),i=this.gos.get("suppressRowDrag"),o=this.beans.dragAndDropService.hasExternalDropZones(),r=s&&!o||i;this.setDisplayedOrVisible(r)}};u([M],uh.prototype,"postConstruct",1);var Ys=class extends L{init(t,e,s,i,o,r,n){var l,a,d,h;this.params=n,this.eGui=e,this.eCheckbox=s,this.eExpanded=i,this.eContracted=o,this.comp=t,this.compClass=r;const{node:c,value:m,colDef:C}=n,v=this.isTopLevelFooter();if(!v){if(this.isEmbeddedRowMismatch())return;if(c.footer&&this.gos.get("groupHideOpenParents")){const w=C&&C.showRowGroup,R=c.rowGroupColumn&&c.rowGroupColumn.getColId();if(w!==R)return}}if(this.setupShowingValueForOpenedParent(),this.findDisplayedGroupNode(),!v){const S=n.node.footer&&n.node.rowGroupIndex===this.columnModel.getRowGroupColumns().findIndex(A=>{var F;return A.getColId()===((F=n.colDef)==null?void 0:F.showRowGroup)}),R=this.gos.get("groupDisplayType")!="multipleColumns"||this.gos.get("treeData")||this.gos.get("showOpenedGroup")&&!n.node.footer&&(!n.node.group||n.node.rowGroupIndex!=null&&n.node.rowGroupIndex>this.columnModel.getRowGroupColumns().findIndex(A=>{var F;return A.getColId()===((F=n.colDef)==null?void 0:F.showRowGroup)})),y=!c.group&&(((l=this.params.colDef)==null?void 0:l.field)||((a=this.params.colDef)==null?void 0:a.valueGetter)),b=this.isExpandable(),T=this.columnModel.isPivotMode()&&c.leafGroup&&((d=c.rowGroupColumn)==null?void 0:d.getColId())===((h=n.column)==null?void 0:h.getColDef().showRowGroup);if(!this.showingValueForOpenedParent&&!b&&!y&&!R&&!S&&!T)return}this.addExpandAndContract(),this.addFullWidthRowDraggerIfNeeded(),this.addCheckboxIfNeeded(),this.addValueElement(),this.setupIndent(),this.refreshAriaExpanded()}getCellAriaRole(){var t,e;const s=(t=this.params.colDef)==null?void 0:t.cellAriaRole,i=(e=this.params.column)==null?void 0:e.getColDef().cellAriaRole;return s||i||"gridcell"}destroy(){super.destroy(),this.expandListener=null}refreshAriaExpanded(){const{node:t,eGridCell:e}=this.params;if(this.expandListener&&(this.expandListener=this.expandListener()),!this.isExpandable()){ru(e);return}const s=()=>{ls(e,!!t.expanded)};this.expandListener=this.addManagedListener(t,J.EVENT_EXPANDED_CHANGED,s)||null,s()}isTopLevelFooter(){if(!this.gos.getGrandTotalRow()||this.params.value!=null||this.params.node.level!=-1)return!1;const e=this.params.colDef;if(e==null||e.showRowGroup===!0)return!0;const i=this.columnModel.getRowGroupColumns();return!i||i.length===0?!0:i[0].getId()===e.showRowGroup}isEmbeddedRowMismatch(){if(!this.params.fullWidth||!this.gos.get("embedFullWidthRows"))return!1;const t=this.params.pinned==="left",e=this.params.pinned==="right",s=!t&&!e;return this.gos.get("enableRtl")?this.columnModel.isPinningLeft()?!e:!s:this.columnModel.isPinningLeft()?!t:!s}findDisplayedGroupNode(){const t=this.params.column,e=this.params.node;if(this.showingValueForOpenedParent){let s=e.parent;for(;s!=null;){if(s.rowGroupColumn&&t.isRowGroupDisplayed(s.rowGroupColumn.getId())){this.displayedGroupNode=s;break}s=s.parent}}z(this.displayedGroupNode)&&(this.displayedGroupNode=e)}setupShowingValueForOpenedParent(){const t=this.params.node,e=this.params.column;if(!this.gos.get("groupHideOpenParents")){this.showingValueForOpenedParent=!1;return}if(!t.groupData){this.showingValueForOpenedParent=!1;return}if(t.rowGroupColumn!=null){const o=t.rowGroupColumn.getId();if(e.isRowGroupDisplayed(o)){this.showingValueForOpenedParent=!1;return}}const i=t.groupData[e.getId()]!=null;this.showingValueForOpenedParent=i}addValueElement(){this.displayedGroupNode.footer?this.addFooterValue():(this.addGroupValue(),this.addChildCount())}addGroupValue(){var t;const e=this.adjustParamsWithDetailsFromRelatedColumn(),s=this.getInnerCompDetails(e),{valueFormatted:i,value:o}=e;let r=i;if(r==null){const n=this.displayedGroupNode.rowGroupColumn&&((t=this.params.column)==null?void 0:t.isRowGroupDisplayed(this.displayedGroupNode.rowGroupColumn.getId()));this.displayedGroupNode.key===""&&this.displayedGroupNode.group&&n?r=this.localeService.getLocaleTextFunc()("blanks","(Blanks)"):r=o??null}this.comp.setInnerRenderer(s,r)}adjustParamsWithDetailsFromRelatedColumn(){const t=this.displayedGroupNode.rowGroupColumn,e=this.params.column;if(!t)return this.params;if(e!=null&&!e.isRowGroupDisplayed(t.getId()))return this.params;const i=this.params,{value:o,node:r}=this.params,n=this.valueService.formatValue(t,r,o);return Ee(_({},i),{valueFormatted:n})}addFooterValue(){let t=this.params.totalValueGetter;if(!t){const i=this.params.footerValueGetter;i&&(t=i,H("As of v31.3, footerValueGetter is deprecated. Use `totalValueGetter` instead."))}let e="";if(t){const i=Bn(this.params);i.value=this.params.value,typeof t=="function"?e=t(i):typeof t=="string"?e=this.expressionService.evaluate(t,i):console.warn("AG Grid: footerValueGetter should be either a function or a string (expression)")}else e=this.localeService.getLocaleTextFunc()("footerTotal","Total")+" "+(this.params.value!=null?this.params.value:"");const s=this.getInnerCompDetails(this.params);this.comp.setInnerRenderer(s,e)}getInnerCompDetails(t){if(t.fullWidth)return this.userComponentFactory.getFullWidthGroupRowInnerCellRenderer(this.gos.get("groupRowRendererParams"),t);const e=this.userComponentFactory.getInnerRendererDetails(t,t),s=n=>n&&n.componentClass==this.compClass;if(e&&!s(e))return e;const i=this.displayedGroupNode.rowGroupColumn,o=i?i.getColDef():void 0;if(!o)return;const r=this.userComponentFactory.getCellRendererDetails(o,t);if(r&&!s(r))return r;if(s(r)&&o.cellRendererParams&&o.cellRendererParams.innerRenderer)return this.userComponentFactory.getInnerRendererDetails(o.cellRendererParams,t)}addChildCount(){this.params.suppressCount||(this.addManagedListener(this.displayedGroupNode,J.EVENT_ALL_CHILDREN_COUNT_CHANGED,this.updateChildCount.bind(this)),this.updateChildCount())}updateChildCount(){const t=this.displayedGroupNode.allChildrenCount,i=this.isShowRowGroupForThisRow()&&t!=null&&t>=0?`(${t})`:"";this.comp.setChildCount(i)}isShowRowGroupForThisRow(){if(this.gos.get("treeData"))return!0;const t=this.displayedGroupNode.rowGroupColumn;if(!t)return!1;const e=this.params.column;return e==null||e.isRowGroupDisplayed(t.getId())}addExpandAndContract(){var t;const e=this.params,s=be("groupExpanded",this.gos,null),i=be("groupContracted",this.gos,null);s&&this.eExpanded.appendChild(s),i&&this.eContracted.appendChild(i);const o=e.eGridCell;!(((t=this.params.column)==null?void 0:t.isCellEditable(e.node))&&this.gos.get("enableGroupEdit"))&&this.isExpandable()&&!e.suppressDoubleClickExpand&&this.addManagedListener(o,"dblclick",this.onCellDblClicked.bind(this)),this.addManagedListener(this.eExpanded,"click",this.onExpandClicked.bind(this)),this.addManagedListener(this.eContracted,"click",this.onExpandClicked.bind(this)),this.addManagedListener(o,"keydown",this.onKeyDown.bind(this)),this.addManagedListener(e.node,J.EVENT_EXPANDED_CHANGED,this.showExpandAndContractIcons.bind(this)),this.showExpandAndContractIcons();const n=this.onRowNodeIsExpandableChanged.bind(this);this.addManagedListener(this.displayedGroupNode,J.EVENT_ALL_CHILDREN_COUNT_CHANGED,n),this.addManagedListener(this.displayedGroupNode,J.EVENT_MASTER_CHANGED,n),this.addManagedListener(this.displayedGroupNode,J.EVENT_GROUP_CHANGED,n),this.addManagedListener(this.displayedGroupNode,J.EVENT_HAS_CHILDREN_CHANGED,n)}onExpandClicked(t){_t(t)||(Ot(t),this.onExpandOrContract(t))}onExpandOrContract(t){const e=this.displayedGroupNode,s=!e.expanded;!s&&e.sticky&&this.scrollToStickyNode(e),e.setExpanded(s,t)}scrollToStickyNode(t){this.ctrlsService.getGridBodyCtrl().getScrollFeature().setVerticalScrollPosition(t.rowTop-t.stickyRowTop)}isExpandable(){if(this.showingValueForOpenedParent)return!0;const t=this.displayedGroupNode,e=this.columnModel.isPivotMode()&&t.leafGroup;if(!(t.isExpandable()&&!t.footer&&!e))return!1;const i=this.params.column;return i!=null&&typeof i.getColDef().showRowGroup=="string"?this.isShowRowGroupForThisRow():!0}showExpandAndContractIcons(){const{params:t,displayedGroupNode:e,columnModel:s}=this,{node:i}=t,o=this.isExpandable();if(o){const d=this.showingValueForOpenedParent?!0:i.expanded;this.comp.setExpandedDisplayed(d),this.comp.setContractedDisplayed(!d)}else this.comp.setExpandedDisplayed(!1),this.comp.setContractedDisplayed(!1);const r=s.isPivotMode(),n=r&&e.leafGroup,l=o&&!n,a=i.footer&&i.level===-1;this.comp.addOrRemoveCssClass("ag-cell-expandable",l),this.comp.addOrRemoveCssClass("ag-row-group",l),r?this.comp.addOrRemoveCssClass("ag-pivot-leaf-group",n):a||this.comp.addOrRemoveCssClass("ag-row-group-leaf-indent",!l)}onRowNodeIsExpandableChanged(){this.showExpandAndContractIcons(),this.setIndent(),this.refreshAriaExpanded()}setupIndent(){const t=this.params.node;this.params.suppressPadding||(this.addManagedListener(t,J.EVENT_UI_LEVEL_CHANGED,this.setIndent.bind(this)),this.setIndent())}setIndent(){if(this.gos.get("groupHideOpenParents"))return;const t=this.params,e=t.node,s=!!t.colDef,i=this.gos.get("treeData"),r=!s||i||t.colDef.showRowGroup===!0?e.uiLevel:0;this.indentClass&&this.comp.addOrRemoveCssClass(this.indentClass,!1),this.indentClass="ag-row-group-indent-"+r,this.comp.addOrRemoveCssClass(this.indentClass,!0)}addFullWidthRowDraggerIfNeeded(){if(!this.params.fullWidth||!this.params.rowDrag)return;const t=new Ks(()=>this.params.value,this.params.node);this.createManagedBean(t,this.context),this.eGui.insertAdjacentElement("afterbegin",t.getGui())}isUserWantsSelected(){const t=this.params.checkbox;return typeof t=="function"||t===!0}addCheckboxIfNeeded(){const t=this.displayedGroupNode,e=this.isUserWantsSelected()&&!t.footer&&!t.rowPinned&&!t.detail;if(e){const s=new Xr;this.getContext().createBean(s),s.init({rowNode:this.params.node,column:this.params.column,overrides:{isVisible:this.params.checkbox,callbackParams:this.params,removeHidden:!0}}),this.eCheckbox.appendChild(s.getGui()),this.addDestroyFunc(()=>this.getContext().destroyBean(s))}this.comp.setCheckboxVisible(e)}onKeyDown(t){!(t.key===E.ENTER)||this.params.suppressEnterExpand||this.params.column&&this.params.column.isCellEditable(this.params.node)||this.onExpandOrContract(t)}onCellDblClicked(t){if(_t(t))return;Pr(this.eExpanded,t)||Pr(this.eContracted,t)||this.onExpandOrContract(t)}};u([f("expressionService")],Ys.prototype,"expressionService",2),u([f("valueService")],Ys.prototype,"valueService",2),u([f("columnModel")],Ys.prototype,"columnModel",2),u([f("userComponentFactory")],Ys.prototype,"userComponentFactory",2),u([f("ctrlsService")],Ys.prototype,"ctrlsService",2);var js=class Cc extends K{constructor(){super(Cc.TEMPLATE)}init(e){const s={setInnerRenderer:(n,l)=>this.setRenderDetails(n,l),setChildCount:n=>this.eChildCount.textContent=n,addOrRemoveCssClass:(n,l)=>this.addOrRemoveCssClass(n,l),setContractedDisplayed:n=>$(this.eContracted,n),setExpandedDisplayed:n=>$(this.eExpanded,n),setCheckboxVisible:n=>this.eCheckbox.classList.toggle("ag-invisible",!n)},i=this.createManagedBean(new Ys),o=!e.colDef,r=this.getGui();i.init(s,r,this.eCheckbox,this.eExpanded,this.eContracted,this.constructor,e),o&&Ae(r,i.getCellAriaRole())}setRenderDetails(e,s){if(e){const i=e.newAgStackInstance();if(!i)return;i.then(o=>{if(!o)return;const r=()=>this.context.destroyBean(o);this.isAlive()?(this.eValue.appendChild(o.getGui()),this.addDestroyFunc(r)):r()})}else this.eValue.innerText=s}destroy(){this.getContext().destroyBean(this.innerCellRenderer),super.destroy()}refresh(){return!1}};js.TEMPLATE=`<span class="ag-cell-wrapper">
157
+ <span class="ag-group-expanded" ref="eExpanded"></span>
158
+ <span class="ag-group-contracted" ref="eContracted"></span>
159
+ <span class="ag-group-checkbox ag-invisible" ref="eCheckbox"></span>
160
+ <span class="ag-group-value" ref="eValue"></span>
161
+ <span class="ag-group-child-count" ref="eChildCount"></span>
162
+ </span>`,u([I("eExpanded")],js.prototype,"eExpanded",2),u([I("eContracted")],js.prototype,"eContracted",2),u([I("eCheckbox")],js.prototype,"eCheckbox",2),u([I("eValue")],js.prototype,"eValue",2),u([I("eChildCount")],js.prototype,"eChildCount",2);var hh=js,Jr=class vc extends K{constructor(){super(vc.TEMPLATE)}init(e){e.node.failedLoad?this.setupFailed():this.setupLoading()}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=e("loadingError","ERR")}setupLoading(){const e=be("groupLoading",this.gos,null);e&&this.eLoadingIcon.appendChild(e);const s=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=s("loadingOoo","Loading")}refresh(e){return!1}destroy(){super.destroy()}};Jr.TEMPLATE=`<div class="ag-loading">
163
+ <span class="ag-loading-icon" ref="eLoadingIcon"></span>
164
+ <span class="ag-loading-text" ref="eLoadingText"></span>
165
+ </div>`,u([I("eLoadingIcon")],Jr.prototype,"eLoadingIcon",2),u([I("eLoadingText")],Jr.prototype,"eLoadingText",2);var Jg=Jr,ch=class wc extends K{constructor(){super(wc.TEMPLATE)}init(e){const s=`ag-cell-skeleton-renderer-${this.getCompId()}`;this.getGui().setAttribute("id",s),this.addDestroyFunc(()=>bi(e.eParentOfValue)),bi(e.eParentOfValue,s),e.node.failedLoad?this.setupFailed():this.setupLoading()}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.getGui().innerText=e("loadingError","ERR");const s=e("ariaSkeletonCellLoadingFailed","Row failed to load");St(this.getGui(),s)}setupLoading(){const s=this.gos.getDocument().createElement("div");s.classList.add("ag-skeleton-effect"),this.getGui().appendChild(s);const o=this.localeService.getLocaleTextFunc()("ariaSkeletonCellLoading","Row data is loading");St(this.getGui(),o)}refresh(e){return!1}destroy(){super.destroy()}};ch.TEMPLATE='<div class="ag-skeleton-container"></div>';var Zg=ch,ph=class Sc extends K{constructor(){super()}destroy(){super.destroy()}init(e){const s=this.gos.get("overlayLoadingTemplate");if(this.setTemplate(s??Sc.DEFAULT_LOADING_OVERLAY_TEMPLATE),!s){const i=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=i("loadingOoo","Loading...")})}}};ph.DEFAULT_LOADING_OVERLAY_TEMPLATE='<span aria-live="polite" aria-atomic="true" class="ag-overlay-loading-center"></span>';var $g=ph,gh=class Ec extends K{constructor(){super()}destroy(){super.destroy()}init(e){const s=this.gos.get("overlayNoRowsTemplate");if(this.setTemplate(s??Ec.DEFAULT_NO_ROWS_TEMPLATE),!s){const i=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=i("noRowsToShow","No Rows To Show")})}}};gh.DEFAULT_NO_ROWS_TEMPLATE='<span class="ag-overlay-no-rows-center"></span>';var ef=gh,tf=class extends zs{constructor(){super('<div class="ag-tooltip"></div>')}init(t){const{value:e}=t;this.getGui().textContent=Ne(e,!0)}},sf=class{getTemplate(){return'<ag-input-number-field class="ag-cell-editor" ref="eInput"></ag-input-number-field>'}init(t,e){this.eInput=t,this.params=e,e.max!=null&&t.setMax(e.max),e.min!=null&&t.setMin(e.min),e.precision!=null&&t.setPrecision(e.precision),e.step!=null&&t.setStep(e.step);const s=t.getInputElement();e.preventStepping?t.addManagedListener(s,"keydown",this.preventStepping):e.showStepperButtons&&s.classList.add("ag-number-field-input-stepper")}preventStepping(t){(t.key===E.UP||t.key===E.DOWN)&&t.preventDefault()}getValue(){const t=this.eInput.getValue();if(!P(t)&&!P(this.params.value))return this.params.value;let e=this.params.parseValue(t);if(e==null)return e;if(typeof e=="string"){if(e==="")return null;e=Number(e)}return isNaN(e)?null:e}getStartValue(){return this.params.value}},of=class extends No{constructor(){super(new sf)}},rf=class{getTemplate(){return'<ag-input-date-field class="ag-cell-editor" ref="eInput"></ag-input-date-field>'}init(t,e){this.eInput=t,this.params=e,e.min!=null&&t.setMin(e.min),e.max!=null&&t.setMax(e.max),e.step!=null&&t.setStep(e.step)}getValue(){const t=this.eInput.getDate();return!P(t)&&!P(this.params.value)?this.params.value:t??null}getStartValue(){const{value:t}=this.params;if(t instanceof Date)return Pt(t,!1)}},nf=class extends No{constructor(){super(new rf)}},lf=class{constructor(t){this.getDataTypeService=t}getTemplate(){return'<ag-input-date-field class="ag-cell-editor" ref="eInput"></ag-input-date-field>'}init(t,e){this.eInput=t,this.params=e,e.min!=null&&t.setMin(e.min),e.max!=null&&t.setMax(e.max),e.step!=null&&t.setStep(e.step)}getValue(){const t=this.formatDate(this.eInput.getDate());return!P(t)&&!P(this.params.value)?this.params.value:this.params.parseValue(t??"")}getStartValue(){var t,e;return Pt((e=this.parseDate((t=this.params.value)!=null?t:void 0))!=null?e:null,!1)}parseDate(t){return this.getDataTypeService().getDateParserFunction(this.params.column)(t)}formatDate(t){return this.getDataTypeService().getDateFormatterFunction(this.params.column)(t)}},fh=class extends No{constructor(){super(new lf(()=>this.dataTypeService))}};u([f("dataTypeService")],fh.prototype,"dataTypeService",2);var ql=class yc extends K{constructor(){super(yc.TEMPLATE)}init(e){this.params=e,this.updateCheckbox(e);const s=this.eCheckbox.getInputElement();s.setAttribute("tabindex","-1"),il(s,"polite"),this.addManagedListener(s,"click",i=>{if(Ot(i),this.eCheckbox.isDisabled())return;const o=this.eCheckbox.getValue();this.onCheckboxChanged(o)}),this.addManagedListener(s,"dblclick",i=>{Ot(i)}),this.addManagedListener(this.params.eGridCell,"keydown",i=>{if(i.key===E.SPACE&&!this.eCheckbox.isDisabled()){this.params.eGridCell===this.gos.getActiveDomElement()&&this.eCheckbox.toggle();const o=this.eCheckbox.getValue();this.onCheckboxChanged(o),i.preventDefault()}})}refresh(e){return this.params=e,this.updateCheckbox(e),!0}updateCheckbox(e){var s,i,o;let r,n=!0;if(e.node.group&&e.column){const c=e.column.getColId();c.startsWith(yi)?r=e.value==null||e.value===""?void 0:e.value==="true":e.node.aggData&&e.node.aggData[c]!==void 0?r=(s=e.value)!=null?s:void 0:n=!1}else r=(i=e.value)!=null?i:void 0;if(!n){this.eCheckbox.setDisplayed(!1);return}this.eCheckbox.setValue(r);const l=e.disabled!=null?e.disabled:!((o=e.column)!=null&&o.isCellEditable(e.node));this.eCheckbox.setDisabled(l);const a=this.localeService.getLocaleTextFunc(),d=xr(a,r),h=l?d:`${a("ariaToggleCellValue","Press SPACE to toggle cell value")} (${d})`;this.eCheckbox.setInputAriaLabel(h)}onCheckboxChanged(e){const{column:s,node:i,rowIndex:o,value:r}=this.params,n={type:p.EVENT_CELL_EDITING_STARTED,column:s,colDef:s==null?void 0:s.getColDef(),data:i.data,node:i,rowIndex:o,rowPinned:i.rowPinned,value:r};this.eventService.dispatchEvent(n);const l=this.params.node.setDataValue(this.params.column,e,"edit"),a={type:p.EVENT_CELL_EDITING_STOPPED,column:s,colDef:s==null?void 0:s.getColDef(),data:i.data,node:i,rowIndex:o,rowPinned:i.rowPinned,value:r,oldValue:r,newValue:e,valueChanged:l};this.eventService.dispatchEvent(a)}};ql.TEMPLATE=`
166
+ <div class="ag-cell-wrapper ag-checkbox-cell" role="presentation">
167
+ <ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>
168
+ </div>`,u([I("eCheckbox")],ql.prototype,"eCheckbox",2);var af=ql,mh=class extends zs{constructor(){super(`
169
+ <div class="ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit">
170
+ <ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>
171
+ </div>`)}init(t){var e;this.params=t;const s=(e=t.value)!=null?e:void 0;this.eCheckbox.setValue(s),this.eCheckbox.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(s),this.addManagedListener(this.eCheckbox,p.EVENT_FIELD_VALUE_CHANGED,o=>this.setAriaLabel(o.selected))}getValue(){return this.eCheckbox.getValue()}focusIn(){this.eCheckbox.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(t){const e=this.localeService.getLocaleTextFunc(),s=xr(e,t),i=e("ariaToggleCellValue","Press SPACE to toggle cell value");this.eCheckbox.setInputAriaLabel(`${i} (${s})`)}};u([I("eCheckbox")],mh.prototype,"eCheckbox",2);var df=class extends K{constructor(){super(),this.setTemplate("<div></div>")}init(t){var e;this.params=t,this.cssClassPrefix=(e=this.params.cssClassPrefix)!=null?e:"ag-menu-option",this.addIcon(),this.addName(),this.addShortcut(),this.addSubMenu()}configureDefaults(){return!0}addIcon(){if(this.params.isCompact)return;const t=ct(`<span ref="eIcon" class="${this.getClassName("part")} ${this.getClassName("icon")}" role="presentation"></span>`);this.params.checked?t.appendChild(be("check",this.gos)):this.params.icon&&(Do(this.params.icon)?t.appendChild(this.params.icon):typeof this.params.icon=="string"?t.innerHTML=this.params.icon:console.warn("AG Grid: menu item icon must be DOM node or string")),this.getGui().appendChild(t)}addName(){const t=ct(`<span ref="eName" class="${this.getClassName("part")} ${this.getClassName("text")}">${this.params.name||""}</span>`);this.getGui().appendChild(t)}addShortcut(){if(this.params.isCompact)return;const t=ct(`<span ref="eShortcut" class="${this.getClassName("part")} ${this.getClassName("shortcut")}">${this.params.shortcut||""}</span>`);this.getGui().appendChild(t)}addSubMenu(){const t=ct(`<span ref="ePopupPointer" class="${this.getClassName("part")} ${this.getClassName("popup-pointer")}"></span>`),e=this.getGui();if(this.params.subMenu){const s=this.gos.get("enableRtl")?"smallLeft":"smallRight";ls(e,!1),t.appendChild(be(s,this.gos))}e.appendChild(t)}getClassName(t){return`${this.cssClassPrefix}-${t}`}destroy(){super.destroy()}},Zr=class extends L{constructor(){super(...arguments),this.agGridDefaults={agDateInput:Zu,agColumnHeader:Kl,agColumnGroupHeader:Yg,agSortIndicator:zl,agTextColumnFloatingFilter:Kg,agNumberColumnFloatingFilter:zg,agDateColumnFloatingFilter:qr,agReadOnlyFloatingFilter:Ol,agAnimateShowChangeCellRenderer:rh,agAnimateSlideCellRenderer:nh,agGroupCellRenderer:hh,agGroupRowRenderer:hh,agLoadingCellRenderer:Jg,agSkeletonCellRenderer:Zg,agCheckboxCellRenderer:af,agCellEditor:oh,agTextCellEditor:oh,agNumberCellEditor:of,agDateCellEditor:nf,agDateStringCellEditor:fh,agSelectCellEditor:jl,agLargeTextCellEditor:jg,agCheckboxCellEditor:mh,agTextColumnFilter:Ul,agNumberColumnFilter:th,agDateColumnFilter:Ju,agLoadingOverlay:$g,agNoRowsOverlay:ef,agTooltipComponent:tf,agMenuItem:df},this.enterpriseAgDefaultCompsModule={agSetColumnFilter:"@ag-grid-enterprise/set-filter",agSetColumnFloatingFilter:"@ag-grid-enterprise/set-filter",agMultiColumnFilter:"@ag-grid-enterprise/multi-filter",agMultiColumnFloatingFilter:"@ag-grid-enterprise/multi-filter",agGroupColumnFilter:"@ag-grid-enterprise/row-grouping",agGroupColumnFloatingFilter:"@ag-grid-enterprise/row-grouping",agRichSelect:"@ag-grid-enterprise/rich-select",agRichSelectCellEditor:"@ag-grid-enterprise/rich-select",agDetailCellRenderer:"@ag-grid-enterprise/master-detail",agSparklineCellRenderer:"@ag-grid-enterprise/sparklines"},this.jsComps={}}init(){const t=this.gos.get("components");t!=null&&je(t,(e,s)=>this.registerJsComponent(e,s))}registerDefaultComponent(t,e){if(this.agGridDefaults[t]){console.error("Trying to overwrite a default component. You should call registerComponent");return}this.agGridDefaults[t]=e}registerJsComponent(t,e){this.jsComps[t]=e}retrieve(t,e){const s=(l,a)=>({componentFromFramework:a,component:l}),i=this.getFrameworkOverrides().frameworkComponent(e,this.gos.get("components"));if(i!=null)return s(i,!0);const o=this.jsComps[e];if(o){const l=this.getFrameworkOverrides().isFrameworkComponent(o);return s(o,l)}const r=this.agGridDefaults[e];if(r)return s(r,!1);const n=this.enterpriseAgDefaultCompsModule[e];return n?ne.__assertRegistered(n,`AG Grid '${t}' component: ${e}`,this.context.getGridId()):Ei(()=>{this.warnAboutMissingComponent(t,e)},"MissingComp"+e),null}warnAboutMissingComponent(t,e){const s=[...Object.keys(this.agGridDefaults).filter(o=>!["agCellEditor","agGroupRowRenderer","agSortIndicator"].includes(o)),...Object.keys(this.jsComps)],i=Ao(e,s,!0,.8).values;console.warn(`AG Grid: Could not find '${e}' component. It was configured as "${t}: '${e}'" but it wasn't found in the list of registered components.`),i.length>0&&console.warn(` Did you mean: [${i.slice(0,3)}]?`),console.warn(`If using a custom component check it has been registered as described in: ${this.getFrameworkOverrides().getDocLink("components/")}`)}};u([M],Zr.prototype,"init",1),Zr=u([O("userComponentRegistry")],Zr);var uf={propertyName:"dateComponent",cellRenderer:!1},hf={propertyName:"headerComponent",cellRenderer:!1},cf={propertyName:"headerGroupComponent",cellRenderer:!1},Ch={propertyName:"cellRenderer",cellRenderer:!0},pf={propertyName:"loadingCellRenderer",cellRenderer:!0},gf={propertyName:"cellEditor",cellRenderer:!1},vh={propertyName:"innerRenderer",cellRenderer:!0},ff={propertyName:"loadingOverlayComponent",cellRenderer:!1},mf={propertyName:"noRowsOverlayComponent",cellRenderer:!1},Cf={propertyName:"tooltipComponent",cellRenderer:!1},Ql={propertyName:"filter",cellRenderer:!1},vf={propertyName:"floatingFilterComponent",cellRenderer:!1},wf={propertyName:"toolPanel",cellRenderer:!1},Sf={propertyName:"statusPanel",cellRenderer:!1},Ef={propertyName:"fullWidthCellRenderer",cellRenderer:!0},yf={propertyName:"loadingCellRenderer",cellRenderer:!0},Rf={propertyName:"groupRowRenderer",cellRenderer:!0},bf={propertyName:"detailCellRenderer",cellRenderer:!0},Tf={propertyName:"menuItem",cellRenderer:!1},wh=class{static getFloatingFilterType(t){return this.filterToFloatingFilterMapping[t]}};wh.filterToFloatingFilterMapping={set:"agSetColumnFloatingFilter",agSetColumnFilter:"agSetColumnFloatingFilter",multi:"agMultiColumnFloatingFilter",agMultiColumnFilter:"agMultiColumnFloatingFilter",group:"agGroupColumnFloatingFilter",agGroupColumnFilter:"agGroupColumnFloatingFilter",number:"agNumberColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",date:"agDateColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",text:"agTextColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"};var Ss=class extends L{getHeaderCompDetails(t,e){return this.getCompDetails(t,hf,"agColumnHeader",e)}getHeaderGroupCompDetails(t){const e=t.columnGroup.getColGroupDef();return this.getCompDetails(e,cf,"agColumnGroupHeader",t)}getFullWidthCellRendererDetails(t){return this.getCompDetails(this.gridOptions,Ef,null,t,!0)}getFullWidthLoadingCellRendererDetails(t){return this.getCompDetails(this.gridOptions,yf,"agLoadingCellRenderer",t,!0)}getFullWidthGroupCellRendererDetails(t){return this.getCompDetails(this.gridOptions,Rf,"agGroupRowRenderer",t,!0)}getFullWidthDetailCellRendererDetails(t){return this.getCompDetails(this.gridOptions,bf,"agDetailCellRenderer",t,!0)}getInnerRendererDetails(t,e){return this.getCompDetails(t,vh,null,e)}getFullWidthGroupRowInnerCellRenderer(t,e){return this.getCompDetails(t,vh,null,e)}getCellRendererDetails(t,e){return this.getCompDetails(t,Ch,null,e)}getLoadingCellRendererDetails(t,e){return this.getCompDetails(t,pf,"agSkeletonCellRenderer",e,!0)}getCellEditorDetails(t,e){return this.getCompDetails(t,gf,"agCellEditor",e,!0)}getFilterDetails(t,e,s){return this.getCompDetails(t,Ql,s,e,!0)}getDateCompDetails(t){return this.getCompDetails(this.gridOptions,uf,"agDateInput",t,!0)}getLoadingOverlayCompDetails(t){return this.getCompDetails(this.gridOptions,ff,"agLoadingOverlay",t,!0)}getNoRowsOverlayCompDetails(t){return this.getCompDetails(this.gridOptions,mf,"agNoRowsOverlay",t,!0)}getTooltipCompDetails(t){return this.getCompDetails(t.colDef,Cf,"agTooltipComponent",t,!0)}getSetFilterCellRendererDetails(t,e){return this.getCompDetails(t,Ch,null,e)}getFloatingFilterCompDetails(t,e,s){return this.getCompDetails(t,vf,s,e)}getToolPanelCompDetails(t,e){return this.getCompDetails(t,wf,null,e,!0)}getStatusPanelCompDetails(t,e){return this.getCompDetails(t,Sf,null,e,!0)}getMenuItemCompDetails(t,e){return this.getCompDetails(t,Tf,"agMenuItem",e,!0)}getCompDetails(t,e,s,i,o=!1){const{propertyName:r,cellRenderer:n}=e;let{compName:l,jsComp:a,fwComp:d,paramsFromSelector:h,popupFromSelector:c,popupPositionFromSelector:m}=this.getCompKeys(t,e,i);const C=R=>{const y=this.userComponentRegistry.retrieve(r,R);y&&(a=y.componentFromFramework?void 0:y.component,d=y.componentFromFramework?y.component:void 0)};if(l!=null&&C(l),a==null&&d==null&&s!=null&&C(s),a&&n&&!this.agComponentUtils.doesImplementIComponent(a)&&(a=this.agComponentUtils.adaptFunction(r,a)),!a&&!d){o&&console.error(`AG Grid: Could not find component ${l}, did you forget to configure this component?`);return}const v=this.mergeParamsWithApplicationProvidedParams(t,e,i,h),S=a==null,w=a||d;return{componentFromFramework:S,componentClass:w,params:v,type:e,popupFromSelector:c,popupPositionFromSelector:m,newAgStackInstance:()=>this.newAgStackInstance(w,S,v,e)}}getCompKeys(t,e,s){const{propertyName:i}=e;let o,r,n,l,a,d;if(t){const h=t,c=h[i+"Selector"],m=c?c(s):null,C=v=>{typeof v=="string"?o=v:v!=null&&v!==!0&&(this.getFrameworkOverrides().isFrameworkComponent(v)?n=v:r=v)};m?(C(m.component),l=m.params,a=m.popup,d=m.popupPosition):C(h[i])}return{compName:o,jsComp:r,fwComp:n,paramsFromSelector:l,popupFromSelector:a,popupPositionFromSelector:d}}newAgStackInstance(t,e,s,i){const o=i.propertyName,r=!e;let n;if(r)n=new t;else{const a=this.componentMetadataProvider.retrieve(o);n=this.frameworkComponentWrapper.wrap(t,a.mandatoryMethodList,a.optionalMethodList,i)}const l=this.initComponent(n,s);return l==null?xe.resolve(n):l.then(()=>n)}mergeParamsWithApplicationProvidedParams(t,e,s,i=null){const o=this.gos.getGridCommonParams();at(o,s);const r=t,n=r&&r[e.propertyName+"Params"];if(typeof n=="function"){const l=n(s);at(o,l)}else typeof n=="object"&&at(o,n);return at(o,i),o}initComponent(t,e){if(this.context.createBean(t),t.init!=null)return t.init(e)}getDefaultFloatingFilterType(t,e){if(t==null)return null;let s=null,{compName:i,jsComp:o,fwComp:r}=this.getCompKeys(t,Ql);return i?s=wh.getFloatingFilterType(i):o==null&&r==null&&t.filter===!0&&(s=e()),s}};u([f("gridOptions")],Ss.prototype,"gridOptions",2),u([f("agComponentUtils")],Ss.prototype,"agComponentUtils",2),u([f("componentMetadataProvider")],Ss.prototype,"componentMetadataProvider",2),u([f("userComponentRegistry")],Ss.prototype,"userComponentRegistry",2),u([he("frameworkComponentWrapper")],Ss.prototype,"frameworkComponentWrapper",2),Ss=u([O("userComponentFactory")],Ss);var Sh=class{constructor(t){this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=t.scrollContainer,this.scrollHorizontally=t.scrollAxis.indexOf("x")!==-1,this.scrollVertically=t.scrollAxis.indexOf("y")!==-1,this.scrollByTick=t.scrollByTick!=null?t.scrollByTick:20,t.onScrollCallback&&(this.onScrollCallback=t.onScrollCallback),this.scrollVertically&&(this.getVerticalPosition=t.getVerticalPosition,this.setVerticalPosition=t.setVerticalPosition),this.scrollHorizontally&&(this.getHorizontalPosition=t.getHorizontalPosition,this.setHorizontalPosition=t.setHorizontalPosition),this.shouldSkipVerticalScroll=t.shouldSkipVerticalScroll||(()=>!1),this.shouldSkipHorizontalScroll=t.shouldSkipHorizontalScroll||(()=>!1)}check(t,e=!1){const s=e||this.shouldSkipVerticalScroll();if(s&&this.shouldSkipHorizontalScroll())return;const i=this.scrollContainer.getBoundingClientRect(),o=this.scrollByTick;this.tickLeft=t.clientX<i.left+o,this.tickRight=t.clientX>i.right-o,this.tickUp=t.clientY<i.top+o&&!s,this.tickDown=t.clientY>i.bottom-o&&!s,this.tickLeft||this.tickRight||this.tickUp||this.tickDown?this.ensureTickingStarted():this.ensureCleared()}ensureTickingStarted(){this.tickingInterval===null&&(this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0)}doTick(){this.tickCount++;let t;if(t=this.tickCount>20?200:this.tickCount>10?80:40,this.scrollVertically){const e=this.getVerticalPosition();this.tickUp&&this.setVerticalPosition(e-t),this.tickDown&&this.setVerticalPosition(e+t)}if(this.scrollHorizontally){const e=this.getHorizontalPosition();this.tickLeft&&this.setHorizontalPosition(e-t),this.tickRight&&this.setHorizontalPosition(e+t)}this.onScrollCallback&&this.onScrollCallback()}ensureCleared(){this.tickingInterval&&(window.clearInterval(this.tickingInterval),this.tickingInterval=null)}},Et=class extends L{constructor(t){super(),this.eContainer=t}postConstruct(){this.gos.isRowModelType("clientSide")&&(this.clientSideRowModel=this.rowModel),this.ctrlsService.whenReady(t=>{const e=t.gridBodyCtrl;this.autoScrollService=new Sh({scrollContainer:e.getBodyViewportElement(),scrollAxis:"y",getVerticalPosition:()=>e.getScrollFeature().getVScrollPosition().top,setVerticalPosition:s=>e.getScrollFeature().setVerticalScrollPosition(s),onScrollCallback:()=>{this.onDragging(this.lastDraggingEvent)}})})}getContainer(){return this.eContainer}isInterestedIn(t){return t===2}getIconName(){return this.gos.get("rowDragManaged")&&this.shouldPreventRowMove()?j.ICON_NOT_ALLOWED:j.ICON_MOVE}shouldPreventRowMove(){return!!(this.columnModel.getRowGroupColumns().length||this.filterManager.isAnyFilterPresent()||this.sortController.isSortActive())}getRowNodes(t){if(!this.isFromThisGrid(t))return t.dragItem.rowNodes||[];const e=t.dragItem.rowNode;if(this.gos.get("rowDragMultiRow")){const i=[...this.selectionService.getSelectedNodes()].sort((o,r)=>o.rowIndex==null||r.rowIndex==null?0:this.getRowIndexNumber(o)-this.getRowIndexNumber(r));if(i.indexOf(e)!==-1)return i}return[e]}onDragEnter(t){t.dragItem.rowNodes=this.getRowNodes(t),this.dispatchGridEvent(p.EVENT_ROW_DRAG_ENTER,t),this.getRowNodes(t).forEach(e=>{e.setDragging(!0)}),this.onEnterOrDragging(t)}onDragging(t){this.onEnterOrDragging(t)}isFromThisGrid(t){const{dragSourceDomDataKey:e}=t.dragSource;return e===this.gos.getDomDataKey()}isDropZoneWithinThisGrid(t){const s=this.ctrlsService.getGridBodyCtrl().getGui(),{dropZoneTarget:i}=t;return!s.contains(i)}onEnterOrDragging(t){this.dispatchGridEvent(p.EVENT_ROW_DRAG_MOVE,t),this.lastDraggingEvent=t;const e=this.mouseEventService.getNormalisedPosition(t).y;this.gos.get("rowDragManaged")&&this.doManagedDrag(t,e),this.autoScrollService.check(t.event)}doManagedDrag(t,e){const s=this.isFromThisGrid(t),i=this.gos.get("rowDragManaged"),o=t.dragItem.rowNodes;i&&this.shouldPreventRowMove()||(this.gos.get("suppressMoveWhenRowDragging")||!s?this.isDropZoneWithinThisGrid(t)||this.clientSideRowModel.highlightRowAtPixel(o[0],e):this.moveRows(o,e))}getRowIndexNumber(t){return parseInt(ie(t.getRowIndexString().split("-")),10)}moveRowAndClearHighlight(t){const e=this.clientSideRowModel.getLastHighlightedRowNode(),s=e&&e.highlighted===1,i=this.mouseEventService.getNormalisedPosition(t).y,o=t.dragItem.rowNodes;let r=s?1:0;if(this.isFromThisGrid(t))o.forEach(n=>{n.rowTop<i&&(r-=1)}),this.moveRows(o,i,r);else{const n=this.gos.getCallback("getRowId");let l=this.clientSideRowModel.getRowIndexAtPixel(i)+1;this.clientSideRowModel.getHighlightPosition(i)===0&&l--,this.clientSideRowModel.updateRowData({add:o.map(a=>a.data).filter(a=>!this.clientSideRowModel.getRowNode(n?n({data:a,level:0}):a.id)),addIndex:l})}this.clearRowHighlight()}clearRowHighlight(){this.clientSideRowModel.highlightRowAtPixel(null)}moveRows(t,e,s=0){var i;this.clientSideRowModel.ensureRowsAtPixel(t,e,s)&&(this.focusService.clearFocusedCell(),(i=this.rangeService)==null||i.removeAllCellRanges())}addRowDropZone(t){if(!t.getContainer()){H("addRowDropZone - A container target needs to be provided");return}if(this.dragAndDropService.findExternalZone(t)){console.warn("AG Grid: addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.");return}let e={getContainer:t.getContainer};t.fromGrid?e=t:(t.onDragEnter&&(e.onDragEnter=s=>{t.onDragEnter(this.draggingToRowDragEvent(p.EVENT_ROW_DRAG_ENTER,s))}),t.onDragLeave&&(e.onDragLeave=s=>{t.onDragLeave(this.draggingToRowDragEvent(p.EVENT_ROW_DRAG_LEAVE,s))}),t.onDragging&&(e.onDragging=s=>{t.onDragging(this.draggingToRowDragEvent(p.EVENT_ROW_DRAG_MOVE,s))}),t.onDragStop&&(e.onDragStop=s=>{t.onDragStop(this.draggingToRowDragEvent(p.EVENT_ROW_DRAG_END,s))})),this.dragAndDropService.addDropTarget(_({isInterestedIn:s=>s===2,getIconName:()=>j.ICON_MOVE,external:!0},e))}getRowDropZone(t){const e=this.getContainer.bind(this),s=this.onDragEnter.bind(this),i=this.onDragLeave.bind(this),o=this.onDragging.bind(this),r=this.onDragStop.bind(this);return t?{getContainer:e,onDragEnter:t.onDragEnter?n=>{s(n),t.onDragEnter(this.draggingToRowDragEvent(p.EVENT_ROW_DRAG_ENTER,n))}:s,onDragLeave:t.onDragLeave?n=>{i(n),t.onDragLeave(this.draggingToRowDragEvent(p.EVENT_ROW_DRAG_LEAVE,n))}:i,onDragging:t.onDragging?n=>{o(n),t.onDragging(this.draggingToRowDragEvent(p.EVENT_ROW_DRAG_MOVE,n))}:o,onDragStop:t.onDragStop?n=>{r(n),t.onDragStop(this.draggingToRowDragEvent(p.EVENT_ROW_DRAG_END,n))}:r,fromGrid:!0}:{getContainer:e,onDragEnter:s,onDragLeave:i,onDragging:o,onDragStop:r,fromGrid:!0}}draggingToRowDragEvent(t,e){const s=this.mouseEventService.getNormalisedPosition(e).y,i=s>this.paginationProxy.getCurrentPageHeight();let o=-1,r;i||(o=this.rowModel.getRowIndexAtPixel(s),r=this.rowModel.getRow(o));let n;switch(e.vDirection){case 1:n="down";break;case 0:n="up";break;default:n=null;break}return this.gos.addGridCommonParams({type:t,event:e.event,node:e.dragItem.rowNode,nodes:e.dragItem.rowNodes,overIndex:o,overNode:r,y:s,vDirection:n})}dispatchGridEvent(t,e){const s=this.draggingToRowDragEvent(t,e);this.eventService.dispatchEvent(s)}onDragLeave(t){this.dispatchGridEvent(p.EVENT_ROW_DRAG_LEAVE,t),this.stopDragging(t),this.gos.get("rowDragManaged")&&this.clearRowHighlight()}onDragStop(t){this.dispatchGridEvent(p.EVENT_ROW_DRAG_END,t),this.stopDragging(t),this.gos.get("rowDragManaged")&&(this.gos.get("suppressMoveWhenRowDragging")||!this.isFromThisGrid(t))&&!this.isDropZoneWithinThisGrid(t)&&this.moveRowAndClearHighlight(t)}stopDragging(t){this.autoScrollService.ensureCleared(),this.getRowNodes(t).forEach(e=>{e.setDragging(!1)})}};u([f("dragAndDropService")],Et.prototype,"dragAndDropService",2),u([f("rowModel")],Et.prototype,"rowModel",2),u([f("paginationProxy")],Et.prototype,"paginationProxy",2),u([f("columnModel")],Et.prototype,"columnModel",2),u([f("focusService")],Et.prototype,"focusService",2),u([f("sortController")],Et.prototype,"sortController",2),u([f("filterManager")],Et.prototype,"filterManager",2),u([f("selectionService")],Et.prototype,"selectionService",2),u([f("mouseEventService")],Et.prototype,"mouseEventService",2),u([f("ctrlsService")],Et.prototype,"ctrlsService",2),u([he("rangeService")],Et.prototype,"rangeService",2),u([M],Et.prototype,"postConstruct",1);var xo=class extends L{constructor(){super(...arguments),this.dragEndFunctions=[],this.dragSources=[]}removeAllListeners(){this.dragSources.forEach(this.removeListener.bind(this)),this.dragSources.length=0}removeListener(t){const e=t.dragSource.eElement,s=t.mouseDownListener;if(e.removeEventListener("mousedown",s),t.touchEnabled){const i=t.touchStartListener;e.removeEventListener("touchstart",i,{passive:!0})}}removeDragSource(t){const e=this.dragSources.find(s=>s.dragSource===t);e&&(this.removeListener(e),dt(this.dragSources,e))}isDragging(){return this.dragging}addDragSource(t){const e=this.onMouseDown.bind(this,t),{eElement:s,includeTouch:i,stopPropagationForTouch:o}=t;s.addEventListener("mousedown",e);let r=null;const n=this.gos.get("suppressTouch");i&&!n&&(r=l=>{Tl(l.target)||(l.cancelable&&(l.preventDefault(),o&&l.stopPropagation()),this.onTouchStart(t,l))},s.addEventListener("touchstart",r,{passive:!1})),this.dragSources.push({dragSource:t,mouseDownListener:e,touchStartListener:r,touchEnabled:!!i})}getStartTarget(){return this.startTarget}onTouchStart(t,e){this.currentDragParams=t,this.dragging=!1;const s=e.touches[0];this.touchLastTime=s,this.touchStart=s;const i=a=>this.onTouchMove(a,t.eElement),o=a=>this.onTouchUp(a,t.eElement),r=a=>{a.cancelable&&a.preventDefault()},n=e.target,l=[{target:this.gos.getRootNode(),type:"touchmove",listener:r,options:{passive:!1}},{target:n,type:"touchmove",listener:i,options:{passive:!0}},{target:n,type:"touchend",listener:o,options:{passive:!0}},{target:n,type:"touchcancel",listener:o,options:{passive:!0}}];this.addTemporaryEvents(l),t.dragStartPixels===0&&this.onCommonMove(s,this.touchStart,t.eElement)}onMouseDown(t,e){const s=e;if(t.skipMouseEvent&&t.skipMouseEvent(e)||s._alreadyProcessedByDragService||(s._alreadyProcessedByDragService=!0,e.button!==0))return;this.shouldPreventMouseEvent(e)&&e.preventDefault(),this.currentDragParams=t,this.dragging=!1,this.mouseStartEvent=e,this.startTarget=e.target;const i=a=>this.onMouseMove(a,t.eElement),o=a=>this.onMouseUp(a,t.eElement),r=a=>a.preventDefault(),n=this.gos.getRootNode(),l=[{target:n,type:"mousemove",listener:i},{target:n,type:"mouseup",listener:o},{target:n,type:"contextmenu",listener:r}];this.addTemporaryEvents(l),t.dragStartPixels===0&&this.onMouseMove(e,t.eElement)}addTemporaryEvents(t){t.forEach(e=>{const{target:s,type:i,listener:o,options:r}=e;s.addEventListener(i,o,r)}),this.dragEndFunctions.push(()=>{t.forEach(e=>{const{target:s,type:i,listener:o,options:r}=e;s.removeEventListener(i,o,r)})})}isEventNearStartEvent(t,e){const{dragStartPixels:s}=this.currentDragParams,i=P(s)?s:4;return xl(t,e,i)}getFirstActiveTouch(t){for(let e=0;e<t.length;e++)if(t[e].identifier===this.touchStart.identifier)return t[e];return null}onCommonMove(t,e,s){if(!this.dragging){if(!this.dragging&&this.isEventNearStartEvent(t,e))return;this.dragging=!0;const i={type:p.EVENT_DRAG_STARTED,target:s};this.eventService.dispatchEvent(i),this.currentDragParams.onDragStart(e),this.currentDragParams.onDragging(e)}this.currentDragParams.onDragging(t)}onTouchMove(t,e){const s=this.getFirstActiveTouch(t.touches);s&&this.onCommonMove(s,this.touchStart,e)}onMouseMove(t,e){var s;qt()&&((s=this.gos.getDocument().getSelection())==null||s.removeAllRanges()),this.shouldPreventMouseEvent(t)&&t.preventDefault(),this.onCommonMove(t,this.mouseStartEvent,e)}shouldPreventMouseEvent(t){const e=this.gos.get("enableCellTextSelection"),s=t.type==="mousemove";return e&&s&&t.cancelable&&this.mouseEventService.isEventFromThisGrid(t)&&!this.isOverFormFieldElement(t)}isOverFormFieldElement(t){const e=t.target,s=e==null?void 0:e.tagName.toLocaleLowerCase();return!!(s!=null&&s.match("^a$|textarea|input|select|button"))}onTouchUp(t,e){let s=this.getFirstActiveTouch(t.changedTouches);s||(s=this.touchLastTime),this.onUpCommon(s,e)}onMouseUp(t,e){this.onUpCommon(t,e)}onUpCommon(t,e){if(this.dragging){this.dragging=!1,this.currentDragParams.onDragStop(t);const s={type:p.EVENT_DRAG_STOPPED,target:e};this.eventService.dispatchEvent(s)}this.mouseStartEvent=null,this.startTarget=null,this.touchStart=null,this.touchLastTime=null,this.currentDragParams=null,this.dragEndFunctions.forEach(s=>s()),this.dragEndFunctions.length=0}};u([f("mouseEventService")],xo.prototype,"mouseEventService",2),u([tt],xo.prototype,"removeAllListeners",1),xo=u([O("dragService")],xo);var Xl="ag-list-item-hovered",Eh=class extends L{constructor(t,e,s){super(),this.comp=t,this.virtualList=e,this.params=s,this.currentDragValue=null,this.lastHoveredListItem=null}postConstruct(){this.addManagedListener(this.params.eventSource,this.params.listItemDragStartEvent,this.listItemDragStart.bind(this)),this.addManagedListener(this.params.eventSource,this.params.listItemDragEndEvent,this.listItemDragEnd.bind(this)),this.createDropTarget(),this.createAutoScrollService()}listItemDragStart(t){this.currentDragValue=this.params.getCurrentDragValue(t),this.moveBlocked=this.params.isMoveBlocked(this.currentDragValue)}listItemDragEnd(){window.setTimeout(()=>{this.currentDragValue=null,this.moveBlocked=!1},10)}createDropTarget(){const t={isInterestedIn:e=>e===this.params.dragSourceType,getIconName:()=>this.moveBlocked?j.ICON_PINNED:j.ICON_MOVE,getContainer:()=>this.comp.getGui(),onDragging:e=>this.onDragging(e),onDragStop:()=>this.onDragStop(),onDragLeave:()=>this.onDragLeave()};this.dragAndDropService.addDropTarget(t)}createAutoScrollService(){const t=this.virtualList.getGui();this.autoScrollService=new Sh({scrollContainer:t,scrollAxis:"y",getVerticalPosition:()=>t.scrollTop,setVerticalPosition:e=>t.scrollTop=e})}onDragging(t){if(!this.currentDragValue||this.moveBlocked)return;const e=this.getListDragItem(t),s=this.virtualList.getComponentAt(e.rowIndex);if(!s)return;const i=s.getGui().parentElement;this.lastHoveredListItem&&this.lastHoveredListItem.rowIndex===e.rowIndex&&this.lastHoveredListItem.position===e.position||(this.autoScrollService.check(t.event),this.clearHoveredItems(),this.lastHoveredListItem=e,Rl(i,Xl),Rl(i,`ag-item-highlight-${e.position}`))}getListDragItem(t){const e=this.virtualList.getGui(),s=parseFloat(window.getComputedStyle(e).paddingTop),i=this.virtualList.getRowHeight(),o=this.virtualList.getScrollTop(),r=Math.max(0,(t.y-s+o)/i),n=this.params.getNumRows(this.comp)-1,l=Math.min(n,r)|0;return{rowIndex:l,position:Math.round(r)>r||r>n?"bottom":"top",component:this.virtualList.getComponentAt(l)}}onDragStop(){this.moveBlocked||(this.params.moveItem(this.currentDragValue,this.lastHoveredListItem),this.clearHoveredItems(),this.autoScrollService.ensureCleared())}onDragLeave(){this.clearHoveredItems(),this.autoScrollService.ensureCleared()}clearHoveredItems(){this.virtualList.getGui().querySelectorAll(`.${Xl}`).forEach(e=>{[Xl,"ag-item-highlight-top","ag-item-highlight-bottom"].forEach(s=>{e.classList.remove(s)})}),this.lastHoveredListItem=null}};u([f("dragAndDropService")],Eh.prototype,"dragAndDropService",2),u([M],Eh.prototype,"postConstruct",1);function qs(t){const e=t;return e!=null&&e.getFrameworkComponentInstance!=null?e.getFrameworkComponentInstance():t}var Z=class{constructor(){this.detailGridInfoMap={},this.destroyCalled=!1}init(){switch(this.rowModel.getType()){case"clientSide":this.clientSideRowModel=this.rowModel;break;case"infinite":this.infiniteRowModel=this.rowModel;break;case"serverSide":this.serverSideRowModel=this.rowModel;break}this.ctrlsService.whenReady(t=>{this.gridBodyCtrl=t.gridBodyCtrl})}__getAlignedGridService(){return this.alignedGridsService}getGridId(){return this.context.getGridId()}addDetailGridInfo(t,e){this.detailGridInfoMap[t]=e}removeDetailGridInfo(t){delete this.detailGridInfoMap[t]}getDetailGridInfo(t){return this.detailGridInfoMap[t]}forEachDetailGridInfo(t){let e=0;je(this.detailGridInfoMap,(s,i)=>{P(i)&&(t(i,e),e++)})}getDataAsCsv(t){if(ne.__assertRegistered("@ag-grid-community/csv-export","api.getDataAsCsv",this.context.getGridId()))return this.csvCreator.getDataAsCsv(t)}exportDataAsCsv(t){ne.__assertRegistered("@ag-grid-community/csv-export","api.exportDataAsCsv",this.context.getGridId())&&this.csvCreator.exportDataAsCsv(t)}assertNotExcelMultiSheet(t,e){return ne.__assertRegistered("@ag-grid-enterprise/excel-export","api."+t,this.context.getGridId())?this.excelCreator.getFactoryMode()===1?(console.warn("AG Grid: The Excel Exporter is currently on Multi Sheet mode. End that operation by calling 'api.getMultipleSheetAsExcel()' or 'api.exportMultipleSheetsAsExcel()'"),!1):!0:!1}getDataAsExcel(t){if(this.assertNotExcelMultiSheet("getDataAsExcel",t))return this.excelCreator.getDataAsExcel(t)}exportDataAsExcel(t){this.assertNotExcelMultiSheet("exportDataAsExcel",t)&&this.excelCreator.exportDataAsExcel(t)}getSheetDataForExcel(t){if(ne.__assertRegistered("@ag-grid-enterprise/excel-export","api.getSheetDataForExcel",this.context.getGridId()))return this.excelCreator.setFactoryMode(1),this.excelCreator.getSheetDataForExcel(t)}getMultipleSheetsAsExcel(t){if(ne.__assertRegistered("@ag-grid-enterprise/excel-export","api.getMultipleSheetsAsExcel",this.context.getGridId()))return this.excelCreator.getMultipleSheetsAsExcel(t)}exportMultipleSheetsAsExcel(t){ne.__assertRegistered("@ag-grid-enterprise/excel-export","api.exportMultipleSheetsAsExcel",this.context.getGridId())&&this.excelCreator.exportMultipleSheetsAsExcel(t)}setGridAriaProperty(t,e){if(!t)return;const s=this.ctrlsService.getGridBodyCtrl().getGui(),i=`aria-${t}`;e===null?s.removeAttribute(i):s.setAttribute(i,e)}logMissingRowModel(t,...e){console.error(`AG Grid: api.${t} can only be called when gridOptions.rowModelType is ${e.join(" or ")}`)}logDeprecation(t,e,s,i){H(`Since ${t} api.${e} is deprecated. Please use ${s} instead. ${i??""}`)}getPinnedTopRowCount(){return this.pinnedRowModel.getPinnedTopRowCount()}getPinnedBottomRowCount(){return this.pinnedRowModel.getPinnedBottomRowCount()}getPinnedTopRow(t){return this.pinnedRowModel.getPinnedTopRow(t)}getPinnedBottomRow(t){return this.pinnedRowModel.getPinnedBottomRow(t)}expireValueCache(){this.valueCache.expire()}getVerticalPixelRange(){return this.gridBodyCtrl.getScrollFeature().getVScrollPosition()}getHorizontalPixelRange(){return this.gridBodyCtrl.getScrollFeature().getHScrollPosition()}refreshCells(t={}){this.frameworkOverrides.wrapIncoming(()=>this.rowRenderer.refreshCells(t))}flashCells(t={}){const e=s=>H(`Since v31.1 api.flashCells parameter '${s}Delay' is deprecated. Please use '${s}Duration' instead.`);P(t.fadeDelay)&&e("fade"),P(t.flashDelay)&&e("flash"),this.frameworkOverrides.wrapIncoming(()=>this.rowRenderer.flashCells(t))}redrawRows(t={}){const e=t?t.rowNodes:void 0;this.frameworkOverrides.wrapIncoming(()=>this.rowRenderer.redrawRows(e))}refreshHeader(){this.frameworkOverrides.wrapIncoming(()=>this.ctrlsService.getHeaderRowContainerCtrls().forEach(t=>t.refresh()))}isAnyFilterPresent(){return this.filterManager.isAnyFilterPresent()}isColumnFilterPresent(){return this.filterManager.isColumnFilterPresent()||this.filterManager.isAggregateFilterPresent()}isQuickFilterPresent(){return this.filterManager.isQuickFilterPresent()}getModel(){return H("Since v31.1 getModel() is deprecated. Please use the appropriate grid API methods instead."),this.rowModel}setRowNodeExpanded(t,e,s,i){this.expansionService.setRowNodeExpanded(t,e,s,i)}onGroupExpandedOrCollapsed(){if(z(this.clientSideRowModel)){this.logMissingRowModel("onGroupExpandedOrCollapsed","clientSide");return}this.expansionService.onGroupExpandedOrCollapsed()}refreshClientSideRowModel(t){if(z(this.clientSideRowModel)){this.logMissingRowModel("refreshClientSideRowModel","clientSide");return}this.clientSideRowModel.refreshModel(t)}isAnimationFrameQueueEmpty(){return this.animationFrameService.isQueueEmpty()}flushAllAnimationFrames(){this.animationFrameService.flushAllFrames()}getRowNode(t){return this.rowModel.getRowNode(t)}getSizesForCurrentTheme(){return{rowHeight:this.gos.getRowHeightAsNumber(),headerHeight:this.columnModel.getHeaderHeight()}}expandAll(){this.clientSideRowModel||this.serverSideRowModel?this.expansionService.expandAll(!0):this.logMissingRowModel("expandAll","clientSide","serverSide")}collapseAll(){this.clientSideRowModel||this.serverSideRowModel?this.expansionService.expandAll(!1):this.logMissingRowModel("collapseAll","clientSide","serverSide")}addRenderedRowListener(t,e,s){this.rowRenderer.addRenderedRowListener(t,e,s)}getQuickFilter(){return this.gos.get("quickFilterText")}getAdvancedFilterModel(){return ne.__assertRegistered("@ag-grid-enterprise/advanced-filter","api.getAdvancedFilterModel",this.context.getGridId())?this.filterManager.getAdvancedFilterModel():null}setAdvancedFilterModel(t){this.filterManager.setAdvancedFilterModel(t)}showAdvancedFilterBuilder(){ne.__assertRegistered("@ag-grid-enterprise/advanced-filter","api.setAdvancedFilterModel",this.context.getGridId())&&this.filterManager.showAdvancedFilterBuilder("api")}setNodesSelected(t){if(!t.nodes.every(n=>n.rowPinned?(console.warn("AG Grid: cannot select pinned rows"),!1):n.id===void 0?(console.warn("AG Grid: cannot select node until id for node is known"),!1):!0))return;const{nodes:s,source:i,newValue:o}=t,r=s;this.selectionService.setNodesSelected({nodes:r,source:i??"api",newValue:o})}selectAll(t="apiSelectAll"){this.selectionService.selectAllRowNodes({source:t})}deselectAll(t="apiSelectAll"){this.selectionService.deselectAllRowNodes({source:t})}selectAllFiltered(t="apiSelectAllFiltered"){this.selectionService.selectAllRowNodes({source:t,justFiltered:!0})}deselectAllFiltered(t="apiSelectAllFiltered"){this.selectionService.deselectAllRowNodes({source:t,justFiltered:!0})}getServerSideSelectionState(){return z(this.serverSideRowModel)?(this.logMissingRowModel("getServerSideSelectionState","serverSide"),null):this.selectionService.getSelectionState()}setServerSideSelectionState(t){if(z(this.serverSideRowModel)){this.logMissingRowModel("setServerSideSelectionState","serverSide");return}this.selectionService.setSelectionState(t,"api")}selectAllOnCurrentPage(t="apiSelectAllCurrentPage"){this.selectionService.selectAllRowNodes({source:t,justCurrentPage:!0})}deselectAllOnCurrentPage(t="apiSelectAllCurrentPage"){this.selectionService.deselectAllRowNodes({source:t,justCurrentPage:!0})}showLoadingOverlay(){this.overlayService.showLoadingOverlay()}showNoRowsOverlay(){this.overlayService.showNoRowsOverlay()}hideOverlay(){this.overlayService.hideOverlay()}getSelectedNodes(){return this.selectionService.getSelectedNodes()}getSelectedRows(){return this.selectionService.getSelectedRows()}getBestCostNodeSelection(){if(z(this.clientSideRowModel)){this.logMissingRowModel("getBestCostNodeSelection","clientSide");return}return this.selectionService.getBestCostNodeSelection()}getRenderedNodes(){return this.rowRenderer.getRenderedNodes()}ensureColumnVisible(t,e="auto"){this.frameworkOverrides.wrapIncoming(()=>this.gridBodyCtrl.getScrollFeature().ensureColumnVisible(t,e),"ensureVisible")}ensureIndexVisible(t,e){this.frameworkOverrides.wrapIncoming(()=>this.gridBodyCtrl.getScrollFeature().ensureIndexVisible(t,e),"ensureVisible")}ensureNodeVisible(t,e=null){this.frameworkOverrides.wrapIncoming(()=>this.gridBodyCtrl.getScrollFeature().ensureNodeVisible(t,e),"ensureVisible")}forEachLeafNode(t){if(z(this.clientSideRowModel)){this.logMissingRowModel("forEachLeafNode","clientSide");return}this.clientSideRowModel.forEachLeafNode(t)}forEachNode(t,e){this.rowModel.forEachNode(t,e)}forEachNodeAfterFilter(t){if(z(this.clientSideRowModel)){this.logMissingRowModel("forEachNodeAfterFilter","clientSide");return}this.clientSideRowModel.forEachNodeAfterFilter(t)}forEachNodeAfterFilterAndSort(t){if(z(this.clientSideRowModel)){this.logMissingRowModel("forEachNodeAfterFilterAndSort","clientSide");return}this.clientSideRowModel.forEachNodeAfterFilterAndSort(t)}getFilterInstance(t,e){return H("'getFilterInstance' is deprecated. To get/set individual filter models, use 'getColumnFilterModel' or 'setColumnFilterModel' instead. To get hold of the filter instance, use 'getColumnFilterInstance' which returns the instance asynchronously."),this.filterManager.getFilterInstance(t,e)}getColumnFilterInstance(t){return this.filterManager.getColumnFilterInstance(t)}destroyFilter(t){const e=this.columnModel.getPrimaryColumn(t);if(e)return this.filterManager.destroyFilter(e,"api")}getStatusPanel(t){if(!ne.__assertRegistered("@ag-grid-enterprise/status-bar","api.getStatusPanel",this.context.getGridId()))return;const e=this.statusBarService.getStatusPanel(t);return qs(e)}getColumnDef(t){const e=this.columnModel.getPrimaryColumn(t);return e?e.getColDef():null}getColumnDefs(){return this.columnModel.getColumnDefs()}onFilterChanged(t="api"){this.filterManager.onFilterChanged({source:t})}onSortChanged(){this.sortController.onSortChanged("api")}setFilterModel(t){this.frameworkOverrides.wrapIncoming(()=>this.filterManager.setFilterModel(t))}getFilterModel(){return this.filterManager.getFilterModel()}getColumnFilterModel(t){return this.filterManager.getColumnFilterModel(t)}setColumnFilterModel(t,e){return this.filterManager.setColumnFilterModel(t,e)}getFocusedCell(){return this.focusService.getFocusedCell()}clearFocusedCell(){return this.focusService.clearFocusedCell()}setFocusedCell(t,e,s){this.focusService.setFocusedCell({rowIndex:t,column:e,rowPinned:s,forceBrowserFocus:!0})}addRowDropZone(t){this.gridBodyCtrl.getRowDragFeature().addRowDropZone(t)}removeRowDropZone(t){const e=this.dragAndDropService.findExternalZone(t);e&&this.dragAndDropService.removeDropTarget(e)}getRowDropZoneParams(t){return this.gridBodyCtrl.getRowDragFeature().getRowDropZone(t)}assertSideBarLoaded(t){return ne.__assertRegistered("@ag-grid-enterprise/side-bar","api."+t,this.context.getGridId())}isSideBarVisible(){return this.assertSideBarLoaded("isSideBarVisible")&&this.sideBarService.getSideBarComp().isDisplayed()}setSideBarVisible(t){this.assertSideBarLoaded("setSideBarVisible")&&this.sideBarService.getSideBarComp().setDisplayed(t)}setSideBarPosition(t){this.assertSideBarLoaded("setSideBarPosition")&&this.sideBarService.getSideBarComp().setSideBarPosition(t)}openToolPanel(t){this.assertSideBarLoaded("openToolPanel")&&this.sideBarService.getSideBarComp().openToolPanel(t,"api")}closeToolPanel(){this.assertSideBarLoaded("closeToolPanel")&&this.sideBarService.getSideBarComp().close("api")}getOpenedToolPanel(){return this.assertSideBarLoaded("getOpenedToolPanel")?this.sideBarService.getSideBarComp().openedItem():null}refreshToolPanel(){this.assertSideBarLoaded("refreshToolPanel")&&this.sideBarService.getSideBarComp().refresh()}isToolPanelShowing(){return this.assertSideBarLoaded("isToolPanelShowing")&&this.sideBarService.getSideBarComp().isToolPanelShowing()}getToolPanelInstance(t){if(this.assertSideBarLoaded("getToolPanelInstance")){const e=this.sideBarService.getSideBarComp().getToolPanelInstance(t);return qs(e)}}getSideBar(){if(this.assertSideBarLoaded("getSideBar"))return this.sideBarService.getSideBarComp().getDef()}resetRowHeights(){if(P(this.clientSideRowModel)){if(this.columnModel.isAutoRowHeightActive()){console.warn("AG Grid: calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.");return}this.clientSideRowModel.resetRowHeights()}}setRowCount(t,e){if(this.serverSideRowModel){if(this.columnModel.isRowGroupEmpty()){this.serverSideRowModel.setRowCount(t,e);return}console.error("AG Grid: setRowCount cannot be used while using row grouping.");return}if(this.infiniteRowModel){this.infiniteRowModel.setRowCount(t,e);return}this.logMissingRowModel("setRowCount","infinite","serverSide")}onRowHeightChanged(){this.clientSideRowModel?this.clientSideRowModel.onRowHeightChanged():this.serverSideRowModel&&this.serverSideRowModel.onRowHeightChanged()}getValue(t,e){return this.logDeprecation("31.3","getValue","getCellValue"),this.getCellValue({colKey:t,rowNode:e})}getCellValue(t){var e;const{colKey:s,rowNode:i,useFormatter:o}=t;let r=(e=this.columnModel.getPrimaryColumn(s))!=null?e:this.columnModel.getGridColumn(s);if(z(r))return null;const n=this.valueService.getValue(r,i);if(o){const l=this.valueService.formatValue(r,i,n);return l??Ne(n,!0)}return n}addEventListener(t,e){this.apiEventService.addEventListener(t,e)}addGlobalListener(t){this.apiEventService.addGlobalListener(t)}removeEventListener(t,e){this.apiEventService.removeEventListener(t,e)}removeGlobalListener(t){this.apiEventService.removeGlobalListener(t)}dispatchEvent(t){this.eventService.dispatchEvent(t)}destroy(){var t;const e=`See ${this.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed")}`;if(this.destroyCalled)return;const s={type:p.EVENT_GRID_PRE_DESTROYED,state:this.getState()};this.dispatchEvent(s),this.destroyCalled=!0,(t=this.ctrlsService.get("gridCtrl"))==null||t.destroyGridUi(),this.context.destroy(),this.detailGridInfoMap={},Dd(this,["isDestroyed"],e)}isDestroyed(){return this.destroyCalled}resetQuickFilter(){this.filterManager.resetQuickFilterCache()}getCellRanges(){return this.rangeService?this.rangeService.getCellRanges():(ne.__assertRegistered("@ag-grid-enterprise/range-selection","api.getCellRanges",this.context.getGridId()),null)}addCellRange(t){if(this.rangeService){this.rangeService.addCellRange(t);return}ne.__assertRegistered("@ag-grid-enterprise/range-selection","api.addCellRange",this.context.getGridId())}clearRangeSelection(){this.rangeService&&this.rangeService.removeAllCellRanges(),ne.__assertRegistered("@ag-grid-enterprise/range-selection","gridApi.clearRangeSelection",this.context.getGridId())}undoCellEditing(){this.undoRedoService.undo("api")}redoCellEditing(){this.undoRedoService.redo("api")}getCurrentUndoSize(){return this.undoRedoService.getCurrentUndoStackSize()}getCurrentRedoSize(){return this.undoRedoService.getCurrentRedoStackSize()}assertChart(t,e){if(ne.__assertRegistered("@ag-grid-enterprise/charts","api."+t,this.context.getGridId()))return this.frameworkOverrides.wrapIncoming(()=>e())}getChartModels(){return this.assertChart("getChartModels",()=>this.chartService.getChartModels())}getChartRef(t){return this.assertChart("getChartRef",()=>this.chartService.getChartRef(t))}getChartImageDataURL(t){return this.assertChart("getChartImageDataURL",()=>this.chartService.getChartImageDataURL(t))}downloadChart(t){return this.assertChart("downloadChart",()=>this.chartService.downloadChart(t))}openChartToolPanel(t){return this.assertChart("openChartToolPanel",()=>this.chartService.openChartToolPanel(t))}closeChartToolPanel(t){return this.assertChart("closeChartToolPanel",()=>this.chartService.closeChartToolPanel(t.chartId))}createRangeChart(t){return this.assertChart("createRangeChart",()=>this.chartService.createRangeChart(t))}createPivotChart(t){return this.assertChart("createPivotChart",()=>this.chartService.createPivotChart(t))}createCrossFilterChart(t){return this.assertChart("createCrossFilterChart",()=>this.chartService.createCrossFilterChart(t))}updateChart(t){return this.assertChart("updateChart",()=>this.chartService.updateChart(t))}restoreChart(t,e){return this.assertChart("restoreChart",()=>this.chartService.restoreChart(t,e))}assertClipboard(t,e){ne.__assertRegistered("@ag-grid-enterprise/clipboard","api"+t,this.context.getGridId())&&e()}copyToClipboard(t){this.assertClipboard("copyToClipboard",()=>this.clipboardService.copyToClipboard(t))}cutToClipboard(t){this.assertClipboard("cutToClipboard",()=>this.clipboardService.cutToClipboard(t))}copySelectedRowsToClipboard(t){this.assertClipboard("copySelectedRowsToClipboard",()=>this.clipboardService.copySelectedRowsToClipboard(t))}copySelectedRangeToClipboard(t){this.assertClipboard("copySelectedRangeToClipboard",()=>this.clipboardService.copySelectedRangeToClipboard(t))}copySelectedRangeDown(){this.assertClipboard("copySelectedRangeDown",()=>this.clipboardService.copyRangeDown())}pasteFromClipboard(){this.assertClipboard("pasteFromClipboard",()=>this.clipboardService.pasteFromClipboard())}showColumnMenuAfterButtonClick(t,e){H("'showColumnMenuAfterButtonClick' is deprecated. Use 'IHeaderParams.showColumnMenu' within a header component, or 'api.showColumnMenu' elsewhere.");const s=this.columnModel.getGridColumn(t);this.menuService.showColumnMenu({column:s,buttonElement:e,positionBy:"button"})}showColumnMenuAfterMouseClick(t,e){H("'showColumnMenuAfterMouseClick' is deprecated. Use 'IHeaderParams.showColumnMenuAfterMouseClick' within a header component, or 'api.showColumnMenu' elsewhere.");let s=this.columnModel.getGridColumn(t);if(s||(s=this.columnModel.getPrimaryColumn(t)),!s){console.error(`AG Grid: column '${t}' not found`);return}this.menuService.showColumnMenu({column:s,mouseEvent:e,positionBy:"mouse"})}showContextMenu(t){const{rowNode:e,column:s,value:i,x:o,y:r}=t||{};let{x:n,y:l}=this.menuService.getContextMenuPosition(e,s);o!=null&&(n=o),r!=null&&(l=r),this.menuService.showContextMenu({mouseEvent:new MouseEvent("mousedown",{clientX:n,clientY:l}),rowNode:e,column:s,value:i})}showColumnChooser(t){this.menuService.showColumnChooser({chooserParams:t})}showColumnFilter(t){const e=this.columnModel.getGridColumn(t);if(!e){console.error(`AG Grid: column '${t}' not found`);return}this.menuService.showFilterMenu({column:e,containerType:"columnFilter",positionBy:"auto"})}showColumnMenu(t){const e=this.columnModel.getGridColumn(t);if(!e){console.error(`AG Grid: column '${t}' not found`);return}this.menuService.showColumnMenu({column:e,positionBy:"auto"})}hidePopupMenu(){this.menuService.hidePopupMenu()}hideColumnChooser(){this.menuService.hideColumnChooser()}tabToNextCell(t){return this.navigationService.tabToNextCell(!1,t)}tabToPreviousCell(t){return this.navigationService.tabToNextCell(!0,t)}getCellRendererInstances(t={}){return this.rowRenderer.getCellRendererInstances(t).map(qs)}getCellEditorInstances(t={}){return this.rowRenderer.getCellEditorInstances(t).map(qs)}getEditingCells(){return this.rowRenderer.getEditingCells()}stopEditing(t=!1){this.rowRenderer.stopEditing(t)}startEditingCell(t){const e=this.columnModel.getGridColumn(t.colKey);if(!e){console.warn(`AG Grid: no column found for ${t.colKey}`);return}const s={rowIndex:t.rowIndex,rowPinned:t.rowPinned||null,column:e};t.rowPinned==null&&this.ensureIndexVisible(t.rowIndex),this.ensureColumnVisible(t.colKey);const o=this.navigationService.getCellByPosition(s);o&&(this.focusService.isCellFocused(s)||this.focusService.setFocusedCell(s),o.startRowOrCellEdit(t.key))}addAggFunc(t,e){this.logDeprecation("v31.1","addAggFunc(key, func)","addAggFuncs({ key: func })"),this.aggFuncService&&this.aggFuncService.addAggFuncs({key:e})}addAggFuncs(t){this.aggFuncService&&this.aggFuncService.addAggFuncs(t)}clearAggFuncs(){this.aggFuncService&&this.aggFuncService.clear()}applyServerSideTransaction(t){if(!this.serverSideTransactionManager){this.logMissingRowModel("applyServerSideTransaction","serverSide");return}return this.serverSideTransactionManager.applyTransaction(t)}applyServerSideTransactionAsync(t,e){if(!this.serverSideTransactionManager){this.logMissingRowModel("applyServerSideTransactionAsync","serverSide");return}return this.serverSideTransactionManager.applyTransactionAsync(t,e)}applyServerSideRowData(t){var e,s;const i=(e=t.startRow)!=null?e:0,o=(s=t.route)!=null?s:[];if(i<0){console.warn(`AG Grid: invalid value ${t.startRow} for startRow, the value should be >= 0`);return}this.serverSideRowModel?this.serverSideRowModel.applyRowData(t.successParams,i,o):this.logMissingRowModel("setServerSideDatasource","serverSide")}retryServerSideLoads(){if(!this.serverSideRowModel){this.logMissingRowModel("retryServerSideLoads","serverSide");return}this.serverSideRowModel.retryLoads()}flushServerSideAsyncTransactions(){if(!this.serverSideTransactionManager){this.logMissingRowModel("flushServerSideAsyncTransactions","serverSide");return}return this.serverSideTransactionManager.flushAsyncTransactions()}applyTransaction(t){if(!this.clientSideRowModel){this.logMissingRowModel("applyTransaction","clientSide");return}return this.frameworkOverrides.wrapIncoming(()=>this.clientSideRowModel.updateRowData(t))}applyTransactionAsync(t,e){if(!this.clientSideRowModel){this.logMissingRowModel("applyTransactionAsync","clientSide");return}this.frameworkOverrides.wrapIncoming(()=>this.clientSideRowModel.batchUpdateRowData(t,e))}flushAsyncTransactions(){if(!this.clientSideRowModel){this.logMissingRowModel("flushAsyncTransactions","clientSide");return}this.frameworkOverrides.wrapIncoming(()=>this.clientSideRowModel.flushAsyncTransactions())}refreshInfiniteCache(){this.infiniteRowModel?this.infiniteRowModel.refreshCache():this.logMissingRowModel("refreshInfiniteCache","infinite")}purgeInfiniteCache(){this.infiniteRowModel?this.infiniteRowModel.purgeCache():this.logMissingRowModel("purgeInfiniteCache","infinite")}refreshServerSide(t){if(!this.serverSideRowModel){this.logMissingRowModel("refreshServerSide","serverSide");return}this.serverSideRowModel.refreshStore(t)}getServerSideGroupLevelState(){return this.serverSideRowModel?this.serverSideRowModel.getStoreState():(this.logMissingRowModel("getServerSideGroupLevelState","serverSide"),[])}getInfiniteRowCount(){if(this.infiniteRowModel)return this.infiniteRowModel.getRowCount();this.logMissingRowModel("getInfiniteRowCount","infinite")}isLastRowIndexKnown(){if(this.infiniteRowModel)return this.infiniteRowModel.isLastRowIndexKnown();this.logMissingRowModel("isLastRowIndexKnown","infinite")}getCacheBlockState(){return this.rowNodeBlockLoader.getBlockState()}getFirstDisplayedRow(){return this.logDeprecation("v31.1","getFirstDisplayedRow","getFirstDisplayedRowIndex"),this.getFirstDisplayedRowIndex()}getFirstDisplayedRowIndex(){return this.rowRenderer.getFirstVirtualRenderedRow()}getLastDisplayedRow(){return this.logDeprecation("v31.1","getLastDisplayedRow","getLastDisplayedRowIndex"),this.getLastDisplayedRowIndex()}getLastDisplayedRowIndex(){return this.rowRenderer.getLastVirtualRenderedRow()}getDisplayedRowAtIndex(t){return this.rowModel.getRow(t)}getDisplayedRowCount(){return this.rowModel.getRowCount()}paginationIsLastPageFound(){return this.paginationProxy.isLastPageFound()}paginationGetPageSize(){return this.paginationProxy.getPageSize()}paginationGetCurrentPage(){return this.paginationProxy.getCurrentPage()}paginationGetTotalPages(){return this.paginationProxy.getTotalPages()}paginationGetRowCount(){return this.paginationProxy.getMasterRowCount()}paginationGoToNextPage(){this.paginationProxy.goToNextPage()}paginationGoToPreviousPage(){this.paginationProxy.goToPreviousPage()}paginationGoToFirstPage(){this.paginationProxy.goToFirstPage()}paginationGoToLastPage(){this.paginationProxy.goToLastPage()}paginationGoToPage(t){this.paginationProxy.goToPage(t)}sizeColumnsToFit(t){typeof t=="number"?this.columnModel.sizeColumnsToFit(t,"api"):this.gridBodyCtrl.sizeColumnsToFit(t)}setColumnGroupOpened(t,e){this.columnModel.setColumnGroupOpened(t,e,"api")}getColumnGroup(t,e){return this.columnModel.getColumnGroup(t,e)}getProvidedColumnGroup(t){return this.columnModel.getProvidedColumnGroup(t)}getDisplayNameForColumn(t,e){return this.columnModel.getDisplayNameForColumn(t,e)||""}getDisplayNameForColumnGroup(t,e){return this.columnModel.getDisplayNameForColumnGroup(t,e)||""}getColumn(t){return this.columnModel.getPrimaryColumn(t)}getColumns(){return this.columnModel.getAllPrimaryColumns()}applyColumnState(t){return this.columnModel.applyColumnState(t,"api")}getColumnState(){return this.columnModel.getColumnState()}resetColumnState(){this.columnModel.resetColumnState("api")}getColumnGroupState(){return this.columnModel.getColumnGroupState()}setColumnGroupState(t){this.columnModel.setColumnGroupState(t,"api")}resetColumnGroupState(){this.columnModel.resetColumnGroupState("api")}isPinning(){return this.columnModel.isPinningLeft()||this.columnModel.isPinningRight()}isPinningLeft(){return this.columnModel.isPinningLeft()}isPinningRight(){return this.columnModel.isPinningRight()}getDisplayedColAfter(t){return this.columnModel.getDisplayedColAfter(t)}getDisplayedColBefore(t){return this.columnModel.getDisplayedColBefore(t)}setColumnVisible(t,e){this.logDeprecation("v31.1","setColumnVisible(key,visible)","setColumnsVisible([key],visible)"),this.columnModel.setColumnsVisible([t],e,"api")}setColumnsVisible(t,e){this.columnModel.setColumnsVisible(t,e,"api")}setColumnPinned(t,e){this.logDeprecation("v31.1","setColumnPinned(key,pinned)","setColumnsPinned([key],pinned)"),this.columnModel.setColumnsPinned([t],e,"api")}setColumnsPinned(t,e){this.columnModel.setColumnsPinned(t,e,"api")}getAllGridColumns(){return this.columnModel.getAllGridColumns()}getDisplayedLeftColumns(){return this.columnModel.getDisplayedLeftColumns()}getDisplayedCenterColumns(){return this.columnModel.getDisplayedCenterColumns()}getDisplayedRightColumns(){return this.columnModel.getDisplayedRightColumns()}getAllDisplayedColumns(){return this.columnModel.getAllDisplayedColumns()}getAllDisplayedVirtualColumns(){return this.columnModel.getViewportColumns()}moveColumn(t,e){this.logDeprecation("v31.1","moveColumn(key, toIndex)","moveColumns([key], toIndex)"),this.columnModel.moveColumns([t],e,"api")}moveColumnByIndex(t,e){this.columnModel.moveColumnByIndex(t,e,"api")}moveColumns(t,e){this.columnModel.moveColumns(t,e,"api")}moveRowGroupColumn(t,e){this.columnModel.moveRowGroupColumn(t,e,"api")}setColumnAggFunc(t,e){this.columnModel.setColumnAggFunc(t,e,"api")}setColumnWidth(t,e,s=!0,i="api"){this.logDeprecation("v31.1","setColumnWidth(col, width)","setColumnWidths([{key: col, newWidth: width}])"),this.columnModel.setColumnWidths([{key:t,newWidth:e}],!1,s,i)}setColumnWidths(t,e=!0,s="api"){this.columnModel.setColumnWidths(t,!1,e,s)}isPivotMode(){return this.columnModel.isPivotMode()}getPivotResultColumn(t,e){return this.columnModel.getSecondaryPivotColumn(t,e)}setValueColumns(t){this.columnModel.setValueColumns(t,"api")}getValueColumns(){return this.columnModel.getValueColumns()}removeValueColumn(t){this.logDeprecation("v31.1","removeValueColumn(colKey)","removeValueColumns([colKey])"),this.columnModel.removeValueColumns([t],"api")}removeValueColumns(t){this.columnModel.removeValueColumns(t,"api")}addValueColumn(t){this.logDeprecation("v31.1","addValueColumn(colKey)","addValueColumns([colKey])"),this.columnModel.addValueColumns([t],"api")}addValueColumns(t){this.columnModel.addValueColumns(t,"api")}setRowGroupColumns(t){this.columnModel.setRowGroupColumns(t,"api")}removeRowGroupColumn(t){this.logDeprecation("v31.1","removeRowGroupColumn(colKey)","removeRowGroupColumns([colKey])"),this.columnModel.removeRowGroupColumns([t],"api")}removeRowGroupColumns(t){this.columnModel.removeRowGroupColumns(t,"api")}addRowGroupColumn(t){this.logDeprecation("v31.1","addRowGroupColumn(colKey)","addRowGroupColumns([colKey])"),this.columnModel.addRowGroupColumns([t],"api")}addRowGroupColumns(t){this.columnModel.addRowGroupColumns(t,"api")}getRowGroupColumns(){return this.columnModel.getRowGroupColumns()}setPivotColumns(t){this.columnModel.setPivotColumns(t,"api")}removePivotColumn(t){this.logDeprecation("v31.1","removePivotColumn(colKey)","removePivotColumns([colKey])"),this.columnModel.removePivotColumns([t],"api")}removePivotColumns(t){this.columnModel.removePivotColumns(t,"api")}addPivotColumn(t){this.logDeprecation("v31.1","addPivotColumn(colKey)","addPivotColumns([colKey])"),this.columnModel.addPivotColumns([t],"api")}addPivotColumns(t){this.columnModel.addPivotColumns(t,"api")}getPivotColumns(){return this.columnModel.getPivotColumns()}getLeftDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeLeft()}getCenterDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeCentre()}getRightDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeRight()}getAllDisplayedColumnGroups(){return this.columnModel.getAllDisplayedTrees()}autoSizeColumn(t,e){return this.logDeprecation("v31.1","autoSizeColumn(key, skipHeader)","autoSizeColumns([key], skipHeader)"),this.columnModel.autoSizeColumns({columns:[t],skipHeader:e,source:"api"})}autoSizeColumns(t,e){this.columnModel.autoSizeColumns({columns:t,skipHeader:e,source:"api"})}autoSizeAllColumns(t){this.columnModel.autoSizeAllColumns("api",t)}setPivotResultColumns(t){this.columnModel.setSecondaryColumns(t,"api")}getPivotResultColumns(){return this.columnModel.getSecondaryColumns()}getState(){return this.stateService.getState()}getGridOption(t){return this.gos.get(t)}setGridOption(t,e){this.updateGridOptions({[t]:e})}updateGridOptions(t){this.gos.updateGridOptions({options:t})}__internalUpdateGridOptions(t,e){this.gos.updateGridOptions({options:t,force:e,source:"gridOptionsUpdated"})}deprecatedUpdateGridOption(t,e){H(`set${t.charAt(0).toUpperCase()}${t.slice(1,t.length)} is deprecated. Please use 'api.setGridOption('${t}', newValue)' or 'api.updateGridOptions({ ${t}: newValue })' instead.`),this.setGridOption(t,e)}setPivotMode(t){this.deprecatedUpdateGridOption("pivotMode",t)}setPinnedTopRowData(t){this.deprecatedUpdateGridOption("pinnedTopRowData",t)}setPinnedBottomRowData(t){this.deprecatedUpdateGridOption("pinnedBottomRowData",t)}setPopupParent(t){this.deprecatedUpdateGridOption("popupParent",t)}setSuppressModelUpdateAfterUpdateTransaction(t){this.deprecatedUpdateGridOption("suppressModelUpdateAfterUpdateTransaction",t)}setDataTypeDefinitions(t){this.deprecatedUpdateGridOption("dataTypeDefinitions",t)}setPagination(t){this.deprecatedUpdateGridOption("pagination",t)}paginationSetPageSize(t){this.deprecatedUpdateGridOption("paginationPageSize",t)}setSideBar(t){this.deprecatedUpdateGridOption("sideBar",t)}setSuppressClipboardPaste(t){this.deprecatedUpdateGridOption("suppressClipboardPaste",t)}setGroupRemoveSingleChildren(t){this.deprecatedUpdateGridOption("groupRemoveSingleChildren",t)}setGroupRemoveLowestSingleChildren(t){this.deprecatedUpdateGridOption("groupRemoveLowestSingleChildren",t)}setGroupDisplayType(t){this.deprecatedUpdateGridOption("groupDisplayType",t)}setGroupIncludeFooter(t){this.deprecatedUpdateGridOption("groupIncludeFooter",t)}setGroupIncludeTotalFooter(t){this.deprecatedUpdateGridOption("groupIncludeTotalFooter",t)}setRowClass(t){this.deprecatedUpdateGridOption("rowClass",t)}setDeltaSort(t){this.deprecatedUpdateGridOption("deltaSort",t)}setSuppressRowDrag(t){this.deprecatedUpdateGridOption("suppressRowDrag",t)}setSuppressMoveWhenRowDragging(t){this.deprecatedUpdateGridOption("suppressMoveWhenRowDragging",t)}setSuppressRowClickSelection(t){this.deprecatedUpdateGridOption("suppressRowClickSelection",t)}setEnableAdvancedFilter(t){this.deprecatedUpdateGridOption("enableAdvancedFilter",t)}setIncludeHiddenColumnsInAdvancedFilter(t){this.deprecatedUpdateGridOption("includeHiddenColumnsInAdvancedFilter",t)}setAdvancedFilterParent(t){this.deprecatedUpdateGridOption("advancedFilterParent",t)}setAdvancedFilterBuilderParams(t){this.deprecatedUpdateGridOption("advancedFilterBuilderParams",t)}setQuickFilter(t){H("setQuickFilter is deprecated. Please use 'api.setGridOption('quickFilterText', newValue)' or 'api.updateGridOptions({ quickFilterText: newValue })' instead."),this.gos.updateGridOptions({options:{quickFilterText:t}})}setExcludeHiddenColumnsFromQuickFilter(t){this.deprecatedUpdateGridOption("includeHiddenColumnsInQuickFilter",!t)}setIncludeHiddenColumnsInQuickFilter(t){this.deprecatedUpdateGridOption("includeHiddenColumnsInQuickFilter",t)}setQuickFilterParser(t){this.deprecatedUpdateGridOption("quickFilterParser",t)}setQuickFilterMatcher(t){this.deprecatedUpdateGridOption("quickFilterMatcher",t)}setAlwaysShowHorizontalScroll(t){this.deprecatedUpdateGridOption("alwaysShowHorizontalScroll",t)}setAlwaysShowVerticalScroll(t){this.deprecatedUpdateGridOption("alwaysShowVerticalScroll",t)}setFunctionsReadOnly(t){this.deprecatedUpdateGridOption("functionsReadOnly",t)}setColumnDefs(t,e="api"){H("setColumnDefs is deprecated. Please use 'api.setGridOption('columnDefs', newValue)' or 'api.updateGridOptions({ columnDefs: newValue })' instead."),this.gos.updateGridOptions({options:{columnDefs:t},source:e})}setAutoGroupColumnDef(t,e="api"){H("setAutoGroupColumnDef is deprecated. Please use 'api.setGridOption('autoGroupColumnDef', newValue)' or 'api.updateGridOptions({ autoGroupColumnDef: newValue })' instead."),this.gos.updateGridOptions({options:{autoGroupColumnDef:t},source:e})}setDefaultColDef(t,e="api"){H("setDefaultColDef is deprecated. Please use 'api.setGridOption('defaultColDef', newValue)' or 'api.updateGridOptions({ defaultColDef: newValue })' instead."),this.gos.updateGridOptions({options:{defaultColDef:t},source:e})}setColumnTypes(t,e="api"){H("setColumnTypes is deprecated. Please use 'api.setGridOption('columnTypes', newValue)' or 'api.updateGridOptions({ columnTypes: newValue })' instead."),this.gos.updateGridOptions({options:{columnTypes:t},source:e})}setTreeData(t){this.deprecatedUpdateGridOption("treeData",t)}setServerSideDatasource(t){this.deprecatedUpdateGridOption("serverSideDatasource",t)}setCacheBlockSize(t){this.deprecatedUpdateGridOption("cacheBlockSize",t)}setDatasource(t){this.deprecatedUpdateGridOption("datasource",t)}setViewportDatasource(t){this.deprecatedUpdateGridOption("viewportDatasource",t)}setRowData(t){this.deprecatedUpdateGridOption("rowData",t)}setEnableCellTextSelection(t){this.deprecatedUpdateGridOption("enableCellTextSelection",t)}setHeaderHeight(t){this.deprecatedUpdateGridOption("headerHeight",t)}setDomLayout(t){this.deprecatedUpdateGridOption("domLayout",t)}setFillHandleDirection(t){this.deprecatedUpdateGridOption("fillHandleDirection",t)}setGroupHeaderHeight(t){this.deprecatedUpdateGridOption("groupHeaderHeight",t)}setFloatingFiltersHeight(t){this.deprecatedUpdateGridOption("floatingFiltersHeight",t)}setPivotHeaderHeight(t){this.deprecatedUpdateGridOption("pivotHeaderHeight",t)}setPivotGroupHeaderHeight(t){this.deprecatedUpdateGridOption("pivotGroupHeaderHeight",t)}setAnimateRows(t){this.deprecatedUpdateGridOption("animateRows",t)}setIsExternalFilterPresent(t){this.deprecatedUpdateGridOption("isExternalFilterPresent",t)}setDoesExternalFilterPass(t){this.deprecatedUpdateGridOption("doesExternalFilterPass",t)}setNavigateToNextCell(t){this.deprecatedUpdateGridOption("navigateToNextCell",t)}setTabToNextCell(t){this.deprecatedUpdateGridOption("tabToNextCell",t)}setTabToNextHeader(t){this.deprecatedUpdateGridOption("tabToNextHeader",t)}setNavigateToNextHeader(t){this.deprecatedUpdateGridOption("navigateToNextHeader",t)}setRowGroupPanelShow(t){this.deprecatedUpdateGridOption("rowGroupPanelShow",t)}setGetGroupRowAgg(t){this.deprecatedUpdateGridOption("getGroupRowAgg",t)}setGetBusinessKeyForNode(t){this.deprecatedUpdateGridOption("getBusinessKeyForNode",t)}setGetChildCount(t){this.deprecatedUpdateGridOption("getChildCount",t)}setProcessRowPostCreate(t){this.deprecatedUpdateGridOption("processRowPostCreate",t)}setGetRowId(t){H("getRowId is a static property and can no longer be updated.")}setGetRowClass(t){this.deprecatedUpdateGridOption("getRowClass",t)}setIsFullWidthRow(t){this.deprecatedUpdateGridOption("isFullWidthRow",t)}setIsRowSelectable(t){this.deprecatedUpdateGridOption("isRowSelectable",t)}setIsRowMaster(t){this.deprecatedUpdateGridOption("isRowMaster",t)}setPostSortRows(t){this.deprecatedUpdateGridOption("postSortRows",t)}setGetDocument(t){this.deprecatedUpdateGridOption("getDocument",t)}setGetContextMenuItems(t){this.deprecatedUpdateGridOption("getContextMenuItems",t)}setGetMainMenuItems(t){this.deprecatedUpdateGridOption("getMainMenuItems",t)}setProcessCellForClipboard(t){this.deprecatedUpdateGridOption("processCellForClipboard",t)}setSendToClipboard(t){this.deprecatedUpdateGridOption("sendToClipboard",t)}setProcessCellFromClipboard(t){this.deprecatedUpdateGridOption("processCellFromClipboard",t)}setProcessPivotResultColDef(t){this.deprecatedUpdateGridOption("processPivotResultColDef",t)}setProcessPivotResultColGroupDef(t){this.deprecatedUpdateGridOption("processPivotResultColGroupDef",t)}setPostProcessPopup(t){this.deprecatedUpdateGridOption("postProcessPopup",t)}setInitialGroupOrderComparator(t){this.deprecatedUpdateGridOption("initialGroupOrderComparator",t)}setGetChartToolbarItems(t){this.deprecatedUpdateGridOption("getChartToolbarItems",t)}setPaginationNumberFormatter(t){this.deprecatedUpdateGridOption("paginationNumberFormatter",t)}setGetServerSideGroupLevelParams(t){this.deprecatedUpdateGridOption("getServerSideGroupLevelParams",t)}setIsServerSideGroupOpenByDefault(t){this.deprecatedUpdateGridOption("isServerSideGroupOpenByDefault",t)}setIsApplyServerSideTransaction(t){this.deprecatedUpdateGridOption("isApplyServerSideTransaction",t)}setIsServerSideGroup(t){this.deprecatedUpdateGridOption("isServerSideGroup",t)}setGetServerSideGroupKey(t){this.deprecatedUpdateGridOption("getServerSideGroupKey",t)}setGetRowStyle(t){this.deprecatedUpdateGridOption("getRowStyle",t)}setGetRowHeight(t){this.deprecatedUpdateGridOption("getRowHeight",t)}};u([f("rowRenderer")],Z.prototype,"rowRenderer",2),u([f("navigationService")],Z.prototype,"navigationService",2),u([f("filterManager")],Z.prototype,"filterManager",2),u([f("columnModel")],Z.prototype,"columnModel",2),u([f("selectionService")],Z.prototype,"selectionService",2),u([f("gridOptionsService")],Z.prototype,"gos",2),u([f("valueService")],Z.prototype,"valueService",2),u([f("alignedGridsService")],Z.prototype,"alignedGridsService",2),u([f("eventService")],Z.prototype,"eventService",2),u([f("pinnedRowModel")],Z.prototype,"pinnedRowModel",2),u([f("context")],Z.prototype,"context",2),u([f("rowModel")],Z.prototype,"rowModel",2),u([f("sortController")],Z.prototype,"sortController",2),u([f("paginationProxy")],Z.prototype,"paginationProxy",2),u([f("focusService")],Z.prototype,"focusService",2),u([f("dragAndDropService")],Z.prototype,"dragAndDropService",2),u([f("menuService")],Z.prototype,"menuService",2),u([f("valueCache")],Z.prototype,"valueCache",2),u([f("animationFrameService")],Z.prototype,"animationFrameService",2),u([f("ctrlsService")],Z.prototype,"ctrlsService",2),u([f("overlayService")],Z.prototype,"overlayService",2),u([f("stateService")],Z.prototype,"stateService",2),u([f("expansionService")],Z.prototype,"expansionService",2),u([f("apiEventService")],Z.prototype,"apiEventService",2),u([f("frameworkOverrides")],Z.prototype,"frameworkOverrides",2),u([f("undoRedoService")],Z.prototype,"undoRedoService",2),u([f("rowNodeBlockLoader")],Z.prototype,"rowNodeBlockLoader",2),u([he("csvCreator")],Z.prototype,"csvCreator",2),u([he("excelCreator")],Z.prototype,"excelCreator",2),u([he("rangeService")],Z.prototype,"rangeService",2),u([he("clipboardService")],Z.prototype,"clipboardService",2),u([he("aggFuncService")],Z.prototype,"aggFuncService",2),u([he("statusBarService")],Z.prototype,"statusBarService",2),u([he("chartService")],Z.prototype,"chartService",2),u([he("ssrmTransactionManager")],Z.prototype,"serverSideTransactionManager",2),u([he("sideBarService")],Z.prototype,"sideBarService",2),u([M],Z.prototype,"init",1),Z=u([O("gridApi")],Z);var pt=class extends L{constructor(){super(...arguments),this.quickFilter=null,this.quickFilterParts=null}postConstruct(){this.addManagedListener(this.eventService,p.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.resetQuickFilterCache()),this.addManagedListener(this.eventService,p.EVENT_NEW_COLUMNS_LOADED,()=>this.resetQuickFilterCache()),this.addManagedListener(this.eventService,p.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.resetQuickFilterCache()),this.addManagedListener(this.eventService,p.EVENT_COLUMN_VISIBLE,()=>{this.gos.get("includeHiddenColumnsInQuickFilter")||this.resetQuickFilterCache()}),this.addManagedPropertyListener("quickFilterText",t=>this.setQuickFilter(t.currentValue)),this.addManagedPropertyListeners(["includeHiddenColumnsInQuickFilter","applyQuickFilterBeforePivotOrAgg"],()=>this.onQuickFilterColumnConfigChanged()),this.quickFilter=this.parseQuickFilter(this.gos.get("quickFilterText")),this.parser=this.gos.get("quickFilterParser"),this.matcher=this.gos.get("quickFilterMatcher"),this.setQuickFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],()=>this.setQuickFilterParserAndMatcher())}isQuickFilterPresent(){return this.quickFilter!==null}doesRowPassQuickFilter(t){const e=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassQuickFilterMatcher(e,t):this.quickFilterParts.every(s=>e?this.doesRowPassQuickFilterCache(t,s):this.doesRowPassQuickFilterNoCache(t,s))}resetQuickFilterCache(){this.rowModel.forEachNode(t=>t.quickFilterAggregateText=null)}setQuickFilterParts(){const{quickFilter:t,parser:e}=this;t?this.quickFilterParts=e?e(t):t.split(" "):this.quickFilterParts=null}parseQuickFilter(t){return P(t)?this.gos.isRowModelType("clientSide")?t.toUpperCase():(console.warn("AG Grid - Quick filtering only works with the Client-Side Row Model"),null):null}setQuickFilter(t){if(t!=null&&typeof t!="string"){console.warn(`AG Grid - Grid option quickFilterText only supports string inputs, received: ${typeof t}`);return}const e=this.parseQuickFilter(t);this.quickFilter!==e&&(this.quickFilter=e,this.setQuickFilterParts(),this.dispatchEvent({type:pt.EVENT_QUICK_FILTER_CHANGED}))}setQuickFilterParserAndMatcher(){const t=this.gos.get("quickFilterParser"),e=this.gos.get("quickFilterMatcher"),s=t!==this.parser||e!==this.matcher;this.parser=t,this.matcher=e,s&&(this.setQuickFilterParts(),this.dispatchEvent({type:pt.EVENT_QUICK_FILTER_CHANGED}))}onQuickFilterColumnConfigChanged(){this.columnModel.refreshQuickFilterColumns(),this.resetQuickFilterCache(),this.isQuickFilterPresent()&&this.dispatchEvent({type:pt.EVENT_QUICK_FILTER_CHANGED})}doesRowPassQuickFilterNoCache(t,e){return this.columnModel.getAllColumnsForQuickFilter().some(i=>{const o=this.getQuickFilterTextForColumn(i,t);return P(o)&&o.indexOf(e)>=0})}doesRowPassQuickFilterCache(t,e){return this.checkGenerateQuickFilterAggregateText(t),t.quickFilterAggregateText.indexOf(e)>=0}doesRowPassQuickFilterMatcher(t,e){let s;t?(this.checkGenerateQuickFilterAggregateText(e),s=e.quickFilterAggregateText):s=this.getQuickFilterAggregateText(e);const{quickFilterParts:i,matcher:o}=this;return o(i,s)}checkGenerateQuickFilterAggregateText(t){t.quickFilterAggregateText||(t.quickFilterAggregateText=this.getQuickFilterAggregateText(t))}getQuickFilterTextForColumn(t,e){let s=this.valueService.getValue(t,e,!0);const i=t.getColDef();if(i.getQuickFilterText){const o=this.gos.addGridCommonParams({value:s,node:e,data:e.data,column:t,colDef:i});s=i.getQuickFilterText(o)}return P(s)?s.toString().toUpperCase():null}getQuickFilterAggregateText(t){const e=[];return this.columnModel.getAllColumnsForQuickFilter().forEach(i=>{const o=this.getQuickFilterTextForColumn(i,t);P(o)&&e.push(o)}),e.join(pt.QUICK_FILTER_SEPARATOR)}};pt.EVENT_QUICK_FILTER_CHANGED="quickFilterChanged",pt.QUICK_FILTER_SEPARATOR=`
172
+ `,u([f("valueService")],pt.prototype,"valueService",2),u([f("columnModel")],pt.prototype,"columnModel",2),u([f("rowModel")],pt.prototype,"rowModel",2),u([M],pt.prototype,"postConstruct",1),pt=u([O("quickFilterService")],pt);var Mt=class extends L{constructor(){super(...arguments),this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue=[],this.advancedFilterModelUpdateQueue=[]}init(){var t,e,s;this.addManagedListener(this.eventService,p.EVENT_GRID_COLUMNS_CHANGED,()=>this.onColumnsChanged()),this.addManagedListener(this.eventService,p.EVENT_COLUMN_VALUE_CHANGED,()=>this.refreshFiltersForAggregations()),this.addManagedListener(this.eventService,p.EVENT_COLUMN_PIVOT_CHANGED,()=>this.refreshFiltersForAggregations()),this.addManagedListener(this.eventService,p.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.refreshFiltersForAggregations()),this.addManagedListener(this.eventService,p.EVENT_NEW_COLUMNS_LOADED,()=>this.updateAdvancedFilterColumns()),this.addManagedListener(this.eventService,p.EVENT_COLUMN_VISIBLE,()=>this.updateAdvancedFilterColumns()),this.addManagedListener(this.eventService,p.EVENT_ROW_DATA_UPDATED,()=>this.onNewRowsLoaded("rowDataUpdated")),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],()=>{this.onFilterChanged({source:"api"})}),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",()=>{this.updateAggFiltering(),this.onFilterChanged()}),this.addManagedPropertyListener("advancedFilterModel",i=>this.setAdvancedFilterModel(i.currentValue)),this.addManagedListener(this.eventService,p.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,({enabled:i})=>this.onAdvancedFilterEnabledChanged(i)),this.addManagedListener(this.eventService,p.EVENT_DATA_TYPES_INFERRED,()=>this.processFilterModelUpdateQueue()),this.addManagedListener(this.quickFilterService,pt.EVENT_QUICK_FILTER_CHANGED,()=>this.onFilterChanged({source:"quickFilter"})),this.initialFilterModel=_({},(s=(e=(t=this.gos.get("initialState"))==null?void 0:t.filter)==null?void 0:e.filterModel)!=null?s:{})}isExternalFilterPresentCallback(){const t=this.gos.getCallback("isExternalFilterPresent");return typeof t=="function"?t({}):!1}doesExternalFilterPass(t){const e=this.gos.get("doesExternalFilterPass");return typeof e=="function"?e(t):!1}setFilterModel(t,e="api"){if(this.isAdvancedFilterEnabled()){this.warnAdvancedFilters();return}if(this.dataTypeService.isPendingInference()){this.filterModelUpdateQueue.push({model:t,source:e});return}const s=[],i=this.getFilterModel();if(t){const o=Gl(Object.keys(t));this.allColumnFilters.forEach((r,n)=>{const l=t[n];s.push(this.setModelOnFilterWrapper(r.filterPromise,l)),o.delete(n)}),o.forEach(r=>{const n=this.columnModel.getPrimaryColumn(r)||this.columnModel.getGridColumn(r);if(!n){console.warn("AG Grid: setFilterModel() - no column found for colId: "+r);return}if(!n.isFilterAllowed()){console.warn("AG Grid: setFilterModel() - unable to fully apply model, filtering disabled for colId: "+r);return}const l=this.getOrCreateFilterWrapper(n,"NO_UI");if(!l){console.warn("AG-Grid: setFilterModel() - unable to fully apply model, unable to create filter for colId: "+r);return}s.push(this.setModelOnFilterWrapper(l.filterPromise,t[r]))})}else this.allColumnFilters.forEach(o=>{s.push(this.setModelOnFilterWrapper(o.filterPromise,null))});xe.all(s).then(()=>{const o=this.getFilterModel(),r=[];this.allColumnFilters.forEach((n,l)=>{const a=i?i[l]:null,d=o?o[l]:null;W.jsonEquals(a,d)||r.push(n.column)}),r.length>0&&this.onFilterChanged({columns:r,source:e})})}setModelOnFilterWrapper(t,e){return new xe(s=>{t.then(i=>{typeof i.setModel!="function"&&(console.warn("AG Grid: filter missing setModel method, which is needed for setFilterModel"),s()),(i.setModel(e)||xe.resolve()).then(()=>s())})})}getFilterModel(){const t={};return this.allColumnFilters.forEach((e,s)=>{const i=this.getModelFromFilterWrapper(e);P(i)&&(t[s]=i)}),t}getModelFromFilterWrapper(t){var e;const i=t.filterPromise.resolveNow(null,o=>o);return i==null?(e=this.initialFilterModel[t.column.getColId()])!=null?e:null:typeof i.getModel!="function"?(console.warn("AG Grid: filter API missing getModel method, which is needed for getFilterModel"),null):i.getModel()}isColumnFilterPresent(){return this.activeColumnFilters.length>0}isAggregateFilterPresent(){return!!this.activeAggregateFilters.length}isExternalFilterPresent(){return this.externalFilterPresent}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}isAdvancedFilterPresent(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isFilterPresent()}onAdvancedFilterEnabledChanged(t){var e;t?this.allColumnFilters.size&&(this.allColumnFilters.forEach(s=>this.disposeFilterWrapper(s,"advancedFilterEnabled")),this.onFilterChanged({source:"advancedFilter"})):(e=this.advancedFilterService)!=null&&e.isFilterPresent()&&(this.advancedFilterService.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvancedFilterEnabled(){var t;return!!((t=this.advancedFilterService)!=null&&t.isEnabled())}isAdvancedFilterHeaderActive(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isHeaderActive()}doAggregateFiltersPass(t,e){return this.doColumnFiltersPass(t,e,!0)}updateActiveFilters(){this.activeColumnFilters.length=0,this.activeAggregateFilters.length=0;const t=i=>i?i.isFilterActive?i.isFilterActive():(console.warn("AG Grid: Filter is missing isFilterActive() method"),!1):!1,e=!!this.gos.getGroupAggFiltering(),s=i=>{if(!i.isPrimary())return!0;const r=!this.columnModel.isPivotActive();return!i.isValueActive()||!r?!1:this.columnModel.isPivotMode()?!0:e};this.allColumnFilters.forEach(i=>{if(i.filterPromise.resolveNow(!1,t)){const o=i.filterPromise.resolveNow(null,r=>r);s(i.column)?this.activeAggregateFilters.push(o):this.activeColumnFilters.push(o)}})}updateFilterFlagInColumns(t,e){this.allColumnFilters.forEach(s=>{const i=s.filterPromise.resolveNow(!1,o=>o.isFilterActive());s.column.setFilterActive(i,t,e)})}isAnyFilterPresent(){return this.isQuickFilterPresent()||this.isColumnFilterPresent()||this.isAggregateFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}doColumnFiltersPass(t,e,s){const{data:i,aggData:o}=t,r=s?this.activeAggregateFilters:this.activeColumnFilters,n=s?o:i;for(let l=0;l<r.length;l++){const a=r[l];if(!(a==null||a===e)){if(typeof a.doesFilterPass!="function")throw new Error("Filter is missing method doesFilterPass");if(!a.doesFilterPass({node:t,data:n}))return!1}}return!0}resetQuickFilterCache(){this.quickFilterService.resetQuickFilterCache()}refreshFiltersForAggregations(){this.gos.getGroupAggFiltering()&&this.onFilterChanged()}callOnFilterChangedOutsideRenderCycle(t){const e=()=>this.onFilterChanged(t);this.rowRenderer.isRefreshInProgress()?setTimeout(e,0):e()}onFilterChanged(t={}){const{source:e,filterInstance:s,additionalEventAttributes:i,columns:o}=t;this.updateDependantFilters(),this.updateActiveFilters(),this.updateFilterFlagInColumns("filterChanged",i),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.allColumnFilters.forEach(n=>{n.filterPromise&&n.filterPromise.then(l=>{l&&l!==s&&l.onAnyFilterChanged&&l.onAnyFilterChanged()})});const r={source:e,type:p.EVENT_FILTER_CHANGED,columns:o||[]};i&&at(r,i),this.processingFilterChange=!0,this.eventService.dispatchEvent(r),this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){var t;return!((t=this.gos.get("allowShowChangeAfterFilter"))!=null?t:!1)&&this.processingFilterChange}isQuickFilterPresent(){return this.quickFilterService.isQuickFilterPresent()}updateAggFiltering(){this.aggFiltering=!!this.gos.getGroupAggFiltering()}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.columnModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(t,e){return this.doesRowPassFilter({rowNode:e,filterInstanceToSkip:t})}doesRowPassAggregateFilters(t){return!(this.isAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(t.rowNode)||this.isAggregateFilterPresent()&&!this.doAggregateFiltersPass(t.rowNode,t.filterInstanceToSkip))}doesRowPassFilter(t){return!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(t.rowNode)||this.isExternalFilterPresent()&&!this.doesExternalFilterPass(t.rowNode)||this.isColumnFilterPresent()&&!this.doColumnFiltersPass(t.rowNode,t.filterInstanceToSkip)||this.isAdvancedFilterPresent()&&!this.advancedFilterService.doesFilterPass(t.rowNode))}onNewRowsLoaded(t){this.allColumnFilters.forEach(e=>{e.filterPromise.then(s=>{s.onNewRowsLoaded&&s.onNewRowsLoaded()})}),this.updateFilterFlagInColumns(t,{afterDataChange:!0}),this.updateActiveFilters()}createValueGetter(t){return({node:e})=>this.valueService.getValue(t,e,!0)}createGetValue(t){return(e,s)=>{const i=s?this.columnModel.getGridColumn(s):t;return i?this.valueService.getValue(i,e,!0):void 0}}getFilterComponent(t,e,s=!0){var i;if(s)return((i=this.getOrCreateFilterWrapper(t,e))==null?void 0:i.filterPromise)||null;const o=this.cachedFilter(t);return o?o.filterPromise:null}isFilterActive(t){const e=this.cachedFilter(t);return!!e&&e.filterPromise.resolveNow(!1,s=>s.isFilterActive())}getOrCreateFilterWrapper(t,e){if(!t.isFilterAllowed())return null;let s=this.cachedFilter(t);return s||(s=this.createFilterWrapper(t,e),this.setColumnFilterWrapper(t,s)),s}cachedFilter(t){return this.allColumnFilters.get(t.getColId())}getDefaultFilter(t){let e;if(ne.__isRegistered("@ag-grid-enterprise/set-filter",this.context.getGridId()))e="agSetColumnFilter";else{const s=this.dataTypeService.getBaseDataType(t);s==="number"?e="agNumberColumnFilter":s==="date"||s==="dateString"?e="agDateColumnFilter":e="agTextColumnFilter"}return e}getDefaultFloatingFilter(t){let e;if(ne.__isRegistered("@ag-grid-enterprise/set-filter",this.context.getGridId()))e="agSetColumnFloatingFilter";else{const s=this.dataTypeService.getBaseDataType(t);s==="number"?e="agNumberColumnFloatingFilter":s==="date"||s==="dateString"?e="agDateColumnFloatingFilter":e="agTextColumnFloatingFilter"}return e}createFilterInstance(t){const e=this.getDefaultFilter(t),s=t.getColDef();let i;const o=Ee(_({},this.createFilterParams(t,s)),{filterModifiedCallback:()=>this.filterModifiedCallbackFactory(i,t)(),filterChangedCallback:n=>this.filterChangedCallbackFactory(i,t)(n),doesRowPassOtherFilter:n=>this.doesRowPassOtherFilters(i,n)}),r=this.userComponentFactory.getFilterDetails(s,o,e);return r?{filterPromise:()=>{const n=r.newAgStackInstance();return n&&n.then(l=>i=l),n},compDetails:r}:{filterPromise:null,compDetails:null}}createFilterParams(t,e){return this.gos.addGridCommonParams({column:t,colDef:Bn(e),rowModel:this.rowModel,filterChangedCallback:()=>{},filterModifiedCallback:()=>{},valueGetter:this.createValueGetter(t),getValue:this.createGetValue(t),doesRowPassOtherFilter:()=>!0})}createFilterWrapper(t,e){var s;const i={column:t,filterPromise:null,compiledElement:null,compDetails:null},{filterPromise:o,compDetails:r}=this.createFilterInstance(t);return i.filterPromise=(s=o==null?void 0:o())!=null?s:null,i.compDetails=r,i}onColumnsChanged(){const t=[];this.allColumnFilters.forEach((e,s)=>{let i;e.column.isPrimary()?i=this.columnModel.getPrimaryColumn(s):i=this.columnModel.getGridColumn(s),!(i&&i===e.column)&&(t.push(e.column),this.disposeFilterWrapper(e,"columnChanged"),this.disposeColumnListener(s))}),t.length>0?this.onFilterChanged({columns:t,source:"api"}):this.updateDependantFilters()}updateDependantFilters(){const t=this.columnModel.getGroupAutoColumns();t==null||t.forEach(e=>{e.getColDef().filter==="agGroupColumnFilter"&&this.getOrCreateFilterWrapper(e,"NO_UI")})}isFilterAllowed(t){var e,s;if(this.isAdvancedFilterEnabled()||!t.isFilterAllowed())return!1;const o=this.allColumnFilters.get(t.getColId());return(s=(e=o==null?void 0:o.filterPromise)==null?void 0:e.resolveNow(!0,r=>typeof(r==null?void 0:r.isFilterAllowed)=="function"?r==null?void 0:r.isFilterAllowed():!0))!=null?s:!0}getFloatingFilterCompDetails(t,e){const s=a=>{const d=this.getFilterComponent(t,"NO_UI");d!=null&&d.then(h=>{a(qs(h))})},i=t.getColDef(),o=Ee(_({},this.createFilterParams(t,i)),{filterChangedCallback:()=>s(a=>this.filterChangedCallbackFactory(a,t)())}),r=this.userComponentFactory.mergeParamsWithApplicationProvidedParams(i,Ql,o);let n=this.userComponentFactory.getDefaultFloatingFilterType(i,()=>this.getDefaultFloatingFilter(t));n==null&&(n="agReadOnlyFloatingFilter");const l={column:t,filterParams:r,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(t),parentFilterInstance:s,showParentFilter:e,suppressFilterButton:!1};return this.userComponentFactory.getFloatingFilterCompDetails(i,l,n)}getCurrentFloatingFilterParentModel(t){const e=this.getFilterComponent(t,"NO_UI",!1);return e?e.resolveNow(null,s=>s&&s.getModel()):null}destroyFilter(t,e="api"){const s=t.getColId(),i=this.allColumnFilters.get(s);this.disposeColumnListener(s),delete this.initialFilterModel[s],i&&(this.disposeFilterWrapper(i,e),this.onFilterChanged({columns:[t],source:"api"}))}disposeColumnListener(t){const e=this.allColumnListeners.get(t);e&&(this.allColumnListeners.delete(t),e())}disposeFilterWrapper(t,e){t.filterPromise.then(s=>{this.getContext().destroyBean(s),t.column.setFilterActive(!1,"filterDestroyed"),this.allColumnFilters.delete(t.column.getColId());const i={type:p.EVENT_FILTER_DESTROYED,source:e,column:t.column};this.eventService.dispatchEvent(i)})}filterModifiedCallbackFactory(t,e){return()=>{const s={type:p.EVENT_FILTER_MODIFIED,column:e,filterInstance:t};this.eventService.dispatchEvent(s)}}filterChangedCallbackFactory(t,e){return s=>{var i;const o=(i=s==null?void 0:s.source)!=null?i:"api",r={filter:t,additionalEventAttributes:s,columns:[e],source:o};this.callOnFilterChangedOutsideRenderCycle(r)}}checkDestroyFilter(t){const e=this.allColumnFilters.get(t);if(!e)return;const s=e.column,{compDetails:i}=s.isFilterAllowed()?this.createFilterInstance(s):{compDetails:null};if(this.areFilterCompsDifferent(e.compDetails,i)){this.destroyFilter(s,"paramsUpdated");return}const o=s.getColDef().filterParams;if(!e.filterPromise){this.destroyFilter(s,"paramsUpdated");return}e.filterPromise.then(r=>{(r!=null&&r.refresh?r.refresh(_(Ee(_({},this.createFilterParams(s,s.getColDef())),{filterModifiedCallback:this.filterModifiedCallbackFactory(r,s),filterChangedCallback:this.filterChangedCallbackFactory(r,s),doesRowPassOtherFilter:l=>this.doesRowPassOtherFilters(r,l)}),o)):!0)===!1&&this.destroyFilter(s,"paramsUpdated")})}setColumnFilterWrapper(t,e){const s=t.getColId();this.allColumnFilters.set(s,e),this.allColumnListeners.set(s,this.addManagedListener(t,fe.EVENT_COL_DEF_CHANGED,()=>this.checkDestroyFilter(s)))}areFilterCompsDifferent(t,e){if(!e||!t)return!0;const{componentClass:s}=t,{componentClass:i}=e;return!(s===i||(s==null?void 0:s.render)&&(i==null?void 0:i.render)&&s.render===i.render)}getAdvancedFilterModel(){return this.isAdvancedFilterEnabled()?this.advancedFilterService.getModel():null}setAdvancedFilterModel(t){if(this.isAdvancedFilterEnabled()){if(this.dataTypeService.isPendingInference()){this.advancedFilterModelUpdateQueue.push(t);return}this.advancedFilterService.setModel(t??null),this.onFilterChanged({source:"advancedFilter"})}}showAdvancedFilterBuilder(t){this.isAdvancedFilterEnabled()&&this.advancedFilterService.getCtrl().toggleFilterBuilder(t,!0)}updateAdvancedFilterColumns(){this.isAdvancedFilterEnabled()&&this.advancedFilterService.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){return this.isAdvancedFilterEnabled()?!1:this.columnModel.getAllGridColumns().some(e=>e.getColDef().floatingFilter)}getFilterInstance(t,e){if(this.isAdvancedFilterEnabled()){this.warnAdvancedFilters();return}const s=this.getFilterInstanceImpl(t,o=>{if(!e)return;const r=qs(o);e(r)});return qs(s)}getColumnFilterInstance(t){return new Promise(e=>{this.getFilterInstance(t,s=>{e(s)})})}getFilterInstanceImpl(t,e){const s=this.columnModel.getPrimaryColumn(t);if(!s)return;const i=this.getFilterComponent(s,"NO_UI"),o=i&&i.resolveNow(null,r=>r);return o?setTimeout(e,0,o):i&&i.then(r=>{e(r)}),o}warnAdvancedFilters(){H("Column Filter API methods have been disabled as Advanced Filters are enabled.")}setupAdvancedFilterHeaderComp(t){var e;(e=this.advancedFilterService)==null||e.getCtrl().setupHeaderComp(t)}getHeaderRowCount(){return this.isAdvancedFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvancedFilterHeaderActive()?this.advancedFilterService.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){this.filterModelUpdateQueue.forEach(({model:t,source:e})=>this.setFilterModel(t,e)),this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue.forEach(({key:t,model:e,resolve:s})=>{this.setColumnFilterModel(t,e).then(()=>s())}),this.columnFilterModelUpdateQueue=[],this.advancedFilterModelUpdateQueue.forEach(t=>this.setAdvancedFilterModel(t)),this.advancedFilterModelUpdateQueue=[]}getColumnFilterModel(t){const e=this.getFilterWrapper(t);return e?this.getModelFromFilterWrapper(e):null}setColumnFilterModel(t,e){if(this.isAdvancedFilterEnabled())return this.warnAdvancedFilters(),Promise.resolve();if(this.dataTypeService.isPendingInference()){let r=()=>{};const n=new Promise(l=>{r=l});return this.columnFilterModelUpdateQueue.push({key:t,model:e,resolve:r}),n}const s=this.columnModel.getPrimaryColumn(t),i=s?this.getOrCreateFilterWrapper(s,"NO_UI"):null;return i?(r=>new Promise(n=>{r.then(l=>n(l))}))(this.setModelOnFilterWrapper(i.filterPromise,e)):Promise.resolve()}getFilterWrapper(t){var e;const s=this.columnModel.getPrimaryColumn(t);return s&&(e=this.cachedFilter(s))!=null?e:null}destroy(){super.destroy(),this.allColumnFilters.forEach(t=>this.disposeFilterWrapper(t,"gridDestroyed")),this.allColumnListeners.clear()}};u([f("valueService")],Mt.prototype,"valueService",2),u([f("columnModel")],Mt.prototype,"columnModel",2),u([f("rowModel")],Mt.prototype,"rowModel",2),u([f("userComponentFactory")],Mt.prototype,"userComponentFactory",2),u([f("rowRenderer")],Mt.prototype,"rowRenderer",2),u([f("dataTypeService")],Mt.prototype,"dataTypeService",2),u([f("quickFilterService")],Mt.prototype,"quickFilterService",2),u([he("advancedFilterService")],Mt.prototype,"advancedFilterService",2),u([M],Mt.prototype,"init",1),Mt=u([O("filterManager")],Mt);var $r=class extends K{constructor(t,e){super('<div class="ag-filter"></div>'),this.column=t,this.source=e,this.filterWrapper=null}postConstruct(){this.createFilter(!0),this.addManagedListener(this.eventService,p.EVENT_FILTER_DESTROYED,this.onFilterDestroyed.bind(this))}hasFilter(){return!!this.filterWrapper}getFilter(){var t,e;return(e=(t=this.filterWrapper)==null?void 0:t.filterPromise)!=null?e:null}afterInit(){var t,e,s;return(s=(e=(t=this.filterWrapper)==null?void 0:t.filterPromise)==null?void 0:e.then(()=>{}))!=null?s:xe.resolve()}afterGuiAttached(t){var e,s;(s=(e=this.filterWrapper)==null?void 0:e.filterPromise)==null||s.then(i=>{var o;(o=i==null?void 0:i.afterGuiAttached)==null||o.call(i,t)})}afterGuiDetached(){var t,e;(e=(t=this.filterWrapper)==null?void 0:t.filterPromise)==null||e.then(s=>{var i;(i=s==null?void 0:s.afterGuiDetached)==null||i.call(s)})}createFilter(t){var e;const{column:s,source:i}=this;this.filterWrapper=this.filterManager.getOrCreateFilterWrapper(s,i),(e=this.filterWrapper)!=null&&e.filterPromise&&this.filterWrapper.filterPromise.then(o=>{let r=o.getGui();if(P(r)||console.warn(`AG Grid: getGui method from filter returned ${r}, it should be a DOM element or an HTML template string.`),typeof r=="string"&&(r=ct(r)),this.appendChild(r),t){const n={type:p.EVENT_FILTER_OPENED,column:s,source:i,eGui:this.getGui()};this.eventService.dispatchEvent(n)}})}onFilterDestroyed(t){(t.source==="api"||t.source==="paramsUpdated")&&t.column.getId()===this.column.getId()&&this.columnModel.getPrimaryColumn(this.column)&&(Le(this.getGui()),this.createFilter())}destroy(){this.filterWrapper=null,super.destroy()}};u([f("filterManager")],$r.prototype,"filterManager",2),u([f("columnModel")],$r.prototype,"columnModel",2),u([M],$r.prototype,"postConstruct",1);var Jl=class extends K{constructor(t,e){super(t),this.ctrl=e}getCtrl(){return this.ctrl}},Qs=class Rc extends Jl{constructor(e){super(Rc.TEMPLATE,e)}postConstruct(){const e=this.getGui(),s={addOrRemoveCssClass:(i,o)=>this.addOrRemoveCssClass(i,o),addOrRemoveBodyCssClass:(i,o)=>this.eFloatingFilterBody.classList.toggle(i,o),setButtonWrapperDisplayed:i=>$(this.eButtonWrapper,i),setCompDetails:i=>this.setCompDetails(i),getFloatingFilterComp:()=>this.compPromise,setWidth:i=>e.style.width=i,setMenuIcon:i=>this.eButtonShowMainFilter.appendChild(i)};this.ctrl.setComp(s,e,this.eButtonShowMainFilter,this.eFloatingFilterBody)}setCompDetails(e){if(!e){this.destroyFloatingFilterComp(),this.compPromise=null;return}this.compPromise=e.newAgStackInstance(),this.compPromise.then(s=>this.afterCompCreated(s))}destroyFloatingFilterComp(){this.floatingFilterComp&&(this.eFloatingFilterBody.removeChild(this.floatingFilterComp.getGui()),this.floatingFilterComp=this.destroyBean(this.floatingFilterComp))}afterCompCreated(e){if(e){if(!this.isAlive()){this.destroyBean(e);return}this.destroyFloatingFilterComp(),this.floatingFilterComp=e,this.eFloatingFilterBody.appendChild(e.getGui()),e.afterGuiAttached&&e.afterGuiAttached()}}};Qs.TEMPLATE=`<div class="ag-header-cell ag-floating-filter" role="gridcell">
173
+ <div ref="eFloatingFilterBody" role="presentation"></div>
174
+ <div class="ag-floating-filter-button ag-hidden" ref="eButtonWrapper" role="presentation">
175
+ <button type="button" class="ag-button ag-floating-filter-button-button" ref="eButtonShowMainFilter" tabindex="-1"></button>
176
+ </div>
177
+ </div>`,u([I("eFloatingFilterBody")],Qs.prototype,"eFloatingFilterBody",2),u([I("eButtonWrapper")],Qs.prototype,"eButtonWrapper",2),u([I("eButtonShowMainFilter")],Qs.prototype,"eButtonShowMainFilter",2),u([M],Qs.prototype,"postConstruct",1),u([tt],Qs.prototype,"destroyFloatingFilterComp",1);var Df=Qs,en=class extends L{constructor(t){super(),this.view=t}postConstruct(){this.addManagedPropertyListener("domLayout",this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()}updateLayoutClasses(){const t=this.getDomLayout(),e={autoHeight:t==="autoHeight",normal:t==="normal",print:t==="print"},s=e.autoHeight?"ag-layout-auto-height":e.print?"ag-layout-print":"ag-layout-normal";this.view.updateLayoutClasses(s,e)}getDomLayout(){var t;const e=(t=this.gos.get("domLayout"))!=null?t:"normal";return["normal","print","autoHeight"].indexOf(e)===-1?(H(`${e} is not valid for DOM Layout, valid values are 'normal', 'autoHeight', 'print'.`),"normal"):e}};u([M],en.prototype,"postConstruct",1);var hs=class extends L{constructor(t){super(),this.lastScrollSource=[null,null],this.scrollLeft=-1,this.nextScrollTop=-1,this.scrollTop=-1,this.lastOffsetHeight=-1,this.lastScrollTop=-1,this.eBodyViewport=t,this.resetLastHScrollDebounced=et(()=>this.lastScrollSource[1]=null,500),this.resetLastVScrollDebounced=et(()=>this.lastScrollSource[0]=null,500)}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onDisplayedColumnsWidthChanged.bind(this)),this.ctrlsService.whenReady(t=>{this.centerRowsCtrl=t.center,this.onDisplayedColumnsWidthChanged(),this.addScrollListener()})}addScrollListener(){const{fakeHScrollComp:t,fakeVScrollComp:e}=this.ctrlsService.getParams();this.addManagedListener(this.centerRowsCtrl.getViewportElement(),"scroll",this.onHScroll.bind(this)),t.onScrollCallback(this.onFakeHScroll.bind(this));const s=this.gos.get("debounceVerticalScrollbar"),i=s?et(this.onVScroll.bind(this),100):this.onVScroll.bind(this),o=s?et(this.onFakeVScroll.bind(this),100):this.onFakeVScroll.bind(this);this.addManagedListener(this.eBodyViewport,"scroll",i),e.onScrollCallback(o)}onDisplayedColumnsWidthChanged(){this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(t){if(this.centerRowsCtrl==null)return;t===void 0&&(t=this.centerRowsCtrl.getCenterViewportScrollLeft());const s=this.enableRtl?t:-t,{topCenter:i,stickyTopCenter:o,stickyBottomCenter:r,centerHeader:n,bottomCenter:l,fakeHScrollComp:a}=this.ctrlsService.getParams();n.setHorizontalScroll(-s),l.setContainerTranslateX(s),i.setContainerTranslateX(s),o.setContainerTranslateX(s),r.setContainerTranslateX(s);const d=this.centerRowsCtrl.getViewportElement(),h=this.lastScrollSource[1]===0;t=Math.abs(t),h?a.setScrollPosition(t):bo(d,t,this.enableRtl)}isControllingScroll(t,e){return this.lastScrollSource[e]==null?(this.lastScrollSource[e]=t,!0):this.lastScrollSource[e]===t}onFakeHScroll(){this.isControllingScroll(1,1)&&this.onHScrollCommon(1)}onHScroll(){this.isControllingScroll(0,1)&&this.onHScrollCommon(0)}onHScrollCommon(t){const e=this.centerRowsCtrl.getViewportElement(),{scrollLeft:s}=e;if(this.shouldBlockScrollUpdate(1,s,!0))return;let i;t===0?i=Ro(e,this.enableRtl):i=this.ctrlsService.get("fakeHScrollComp").getScrollPosition(),this.doHorizontalScroll(Math.round(i)),this.resetLastHScrollDebounced()}onFakeVScroll(){this.isControllingScroll(1,0)&&this.onVScrollCommon(1)}onVScroll(){this.isControllingScroll(0,0)&&this.onVScrollCommon(0)}onVScrollCommon(t){let e;t===0?e=this.eBodyViewport.scrollTop:e=this.ctrlsService.get("fakeVScrollComp").getScrollPosition(),!this.shouldBlockScrollUpdate(0,e,!0)&&(this.animationFrameService.setScrollTop(e),this.nextScrollTop=e,t===0?this.ctrlsService.get("fakeVScrollComp").setScrollPosition(e):this.eBodyViewport.scrollTop=e,this.gos.get("suppressAnimationFrame")?this.scrollGridIfNeeded():this.animationFrameService.schedule(),this.resetLastVScrollDebounced())}doHorizontalScroll(t){const e=this.ctrlsService.get("fakeHScrollComp").getScrollPosition();this.scrollLeft===t&&t===e||(this.scrollLeft=t,this.fireScrollEvent(1),this.horizontallyScrollHeaderCenterAndFloatingCenter(t),this.centerRowsCtrl.onHorizontalViewportChanged(!0))}fireScrollEvent(t){const e={type:p.EVENT_BODY_SCROLL,direction:t===1?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.eventService.dispatchEvent(e),window.clearTimeout(this.scrollTimer),this.scrollTimer=void 0,this.scrollTimer=window.setTimeout(()=>{const s=Ee(_({},e),{type:p.EVENT_BODY_SCROLL_END});this.eventService.dispatchEvent(s)},100)}shouldBlockScrollUpdate(t,e,s=!1){return s&&!as()?!1:t===0?this.shouldBlockVerticalScroll(e):this.shouldBlockHorizontalScroll(e)}shouldBlockVerticalScroll(t){const e=So(this.eBodyViewport),{scrollHeight:s}=this.eBodyViewport;return t<0||t+e>s}shouldBlockHorizontalScroll(t){const e=this.centerRowsCtrl.getCenterWidth(),{scrollWidth:s}=this.centerRowsCtrl.getViewportElement();if(this.enableRtl&&yo()){if(t>0)return!0}else if(t<0)return!0;return Math.abs(t)+e>s}redrawRowsAfterScroll(){this.fireScrollEvent(0)}checkScrollLeft(){this.scrollLeft!==this.centerRowsCtrl.getCenterViewportScrollLeft()&&this.onHScrollCommon(0)}scrollGridIfNeeded(){const t=this.scrollTop!=this.nextScrollTop;return t&&(this.scrollTop=this.nextScrollTop,this.redrawRowsAfterScroll()),t}setHorizontalScrollPosition(t,e=!1){const i=this.centerRowsCtrl.getViewportElement().scrollWidth-this.centerRowsCtrl.getCenterWidth();!e&&this.shouldBlockScrollUpdate(1,t)&&(this.enableRtl&&yo()?t=t>0?0:i:t=Math.min(Math.max(t,0),i)),bo(this.centerRowsCtrl.getViewportElement(),Math.abs(t),this.enableRtl),this.doHorizontalScroll(t)}setVerticalScrollPosition(t){this.eBodyViewport.scrollTop=t}getVScrollPosition(){return this.lastScrollTop=this.eBodyViewport.scrollTop,this.lastOffsetHeight=this.eBodyViewport.offsetHeight,{top:this.lastScrollTop,bottom:this.lastScrollTop+this.lastOffsetHeight}}getApproximateVScollPosition(){return this.lastScrollTop>=0&&this.lastOffsetHeight>=0?{top:this.scrollTop,bottom:this.scrollTop+this.lastOffsetHeight}:this.getVScrollPosition()}getHScrollPosition(){return this.centerRowsCtrl.getHScrollPosition()}isHorizontalScrollShowing(){return this.centerRowsCtrl.isHorizontalScrollShowing()}scrollHorizontally(t){const e=this.centerRowsCtrl.getViewportElement().scrollLeft;return this.setHorizontalScrollPosition(e+t),this.centerRowsCtrl.getViewportElement().scrollLeft-e}scrollToTop(){this.eBodyViewport.scrollTop=0}ensureNodeVisible(t,e=null){const s=this.rowModel.getRowCount();let i=-1;for(let o=0;o<s;o++){const r=this.rowModel.getRow(o);if(typeof t=="function"){if(r&&t(r)){i=o;break}}else if(t===r||t===r.data){i=o;break}}i>=0&&this.ensureIndexVisible(i,e)}ensureIndexVisible(t,e){if(this.gos.isDomLayout("print"))return;const s=this.paginationProxy.getRowCount();if(typeof t!="number"||t<0||t>=s){console.warn("AG Grid: Invalid row index for ensureIndexVisible: "+t);return}const o=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.getFrameworkOverrides().wrapIncoming(()=>{o||this.paginationProxy.goToPageWithIndex(t);const r=this.ctrlsService.getGridBodyCtrl(),n=r.getStickyTopHeight(),l=r.getStickyBottomHeight(),a=this.paginationProxy.getRow(t);let d;do{const h=a.rowTop,c=a.rowHeight,m=this.paginationProxy.getPixelOffset(),C=a.rowTop-m,v=C+a.rowHeight,S=this.getVScrollPosition(),w=this.heightScaler.getDivStretchOffset(),R=S.top+w,y=S.bottom+w,b=y-R,T=this.heightScaler.getScrollPositionForPixel(C),D=this.heightScaler.getScrollPositionForPixel(v-b),A=Math.min((T+D)/2,C),F=R+n>C,k=y-l<v;let x=null;e==="top"?x=T:e==="bottom"?x=D:e==="middle"?x=A:F?x=T-n:k&&(x=D+l),x!==null&&(this.setVerticalScrollPosition(x),this.rowRenderer.redraw({afterScroll:!0})),d=h!==a.rowTop||c!==a.rowHeight}while(d);this.animationFrameService.flushAllFrames()})}ensureColumnVisible(t,e="auto"){const s=this.columnModel.getGridColumn(t);if(!s||s.isPinned()||!this.columnModel.isColumnDisplayed(s))return;const i=this.getPositionedHorizontalScroll(s,e);this.getFrameworkOverrides().wrapIncoming(()=>{i!==null&&this.centerRowsCtrl.setCenterViewportScrollLeft(i),this.centerRowsCtrl.onHorizontalViewportChanged(),this.animationFrameService.flushAllFrames()})}setScrollPosition(t,e){this.getFrameworkOverrides().wrapIncoming(()=>{this.centerRowsCtrl.setCenterViewportScrollLeft(e),this.setVerticalScrollPosition(t),this.rowRenderer.redraw({afterScroll:!0}),this.animationFrameService.flushAllFrames()})}getPositionedHorizontalScroll(t,e){const{columnBeforeStart:s,columnAfterEnd:i}=this.isColumnOutsideViewport(t),o=this.centerRowsCtrl.getCenterWidth()<t.getActualWidth(),r=this.centerRowsCtrl.getCenterWidth(),n=this.enableRtl;let l=(n?s:i)||o,a=n?i:s;e!=="auto"&&(l=e==="start",a=e==="end");const d=e==="middle";if(l||a||d){const{colLeft:h,colMiddle:c,colRight:m}=this.getColumnBounds(t);return d?c-r/2:l?n?m:h:n?h-r:m-r}return null}isColumnOutsideViewport(t){const{start:e,end:s}=this.getViewportBounds(),{colLeft:i,colRight:o}=this.getColumnBounds(t),r=this.enableRtl,n=r?e>o:s<o,l=r?s<i:e>i;return{columnBeforeStart:n,columnAfterEnd:l}}getColumnBounds(t){const e=this.enableRtl,s=this.columnModel.getBodyContainerWidth(),i=t.getActualWidth(),o=t.getLeft(),r=e?-1:1,n=e?s-o:o,l=n+i*r,a=n+i/2*r;return{colLeft:n,colMiddle:a,colRight:l}}getViewportBounds(){const t=this.centerRowsCtrl.getCenterWidth(),e=this.centerRowsCtrl.getCenterViewportScrollLeft(),s=e,i=t+e;return{start:s,end:i,width:t}}};u([f("ctrlsService")],hs.prototype,"ctrlsService",2),u([f("animationFrameService")],hs.prototype,"animationFrameService",2),u([f("paginationProxy")],hs.prototype,"paginationProxy",2),u([f("rowModel")],hs.prototype,"rowModel",2),u([f("rowContainerHeightService")],hs.prototype,"heightScaler",2),u([f("rowRenderer")],hs.prototype,"rowRenderer",2),u([f("columnModel")],hs.prototype,"columnModel",2),u([M],hs.prototype,"postConstruct",1);var yh="ag-force-vertical-scroll",Af="ag-selectable",Pf="ag-column-moving",Qe=class extends L{constructor(){super(...arguments),this.stickyTopHeight=0,this.stickyBottomHeight=0}getScrollFeature(){return this.bodyScrollFeature}getBodyViewportElement(){return this.eBodyViewport}setComp(t,e,s,i,o,r,n){this.comp=t,this.eGridBody=e,this.eBodyViewport=s,this.eTop=i,this.eBottom=o,this.eStickyTop=r,this.eStickyBottom=n,this.setCellTextSelection(this.gos.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",l=>this.setCellTextSelection(l.currentValue)),this.createManagedBean(new en(this.comp)),this.bodyScrollFeature=this.createManagedBean(new hs(this.eBodyViewport)),this.addRowDragListener(),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([i,s,o,r,n]),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.filterManager.setupAdvancedFilterHeaderComp(i),this.ctrlsService.register("gridBodyCtrl",this)}getComp(){return this.comp}addEventListeners(){this.addManagedListener(this.eventService,p.EVENT_GRID_COLUMNS_CHANGED,this.onGridColumnsChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_SCROLL_VISIBILITY_CHANGED,this.onScrollVisibilityChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_HEADER_HEIGHT_CHANGED,this.onHeaderHeightChanged.bind(this))}addFocusListeners(t){t.forEach(e=>{this.addManagedListener(e,"focusin",s=>{const{target:i}=s,o=Hs(i,"ag-root",e);e.classList.toggle("ag-has-focus",!o)}),this.addManagedListener(e,"focusout",s=>{const{target:i,relatedTarget:o}=s,r=e.contains(o),n=Hs(o,"ag-root",e);Hs(i,"ag-root",e)||(!r||n)&&e.classList.remove("ag-has-focus")})})}setColumnMovingCss(t){this.comp.setColumnMovingCss(Pf,t)}setCellTextSelection(t=!1){this.comp.setCellSelectableCss(Af,t)}onScrollVisibilityChanged(){const t=this.scrollVisibleService.isVerticalScrollShowing();this.setVerticalScrollPaddingVisible(t),this.setStickyWidth(t),this.setStickyBottomOffsetBottom();const e=t&&this.gos.getScrollbarWidth()||0,s=Sl()?16:0,i=`calc(100% + ${e+s}px)`;this.animationFrameService.requestAnimationFrame(()=>this.comp.setBodyViewportWidth(i))}onGridColumnsChanged(){const t=this.columnModel.getAllGridColumns();this.comp.setColumnCount(t.length)}disableBrowserDragging(){this.addManagedListener(this.eGridBody,"dragstart",t=>{if(t.target instanceof HTMLImageElement)return t.preventDefault(),!1})}addStopEditingWhenGridLosesFocus(){if(!this.gos.get("stopEditingWhenCellsLoseFocus"))return;const t=s=>{const i=s.relatedTarget;if(_r(i)===null){this.rowRenderer.stopEditing();return}let o=e.some(r=>r.contains(i))&&this.mouseEventService.isElementInThisGrid(i);if(!o){const r=this.popupService;o=r.getActivePopups().some(n=>n.contains(i))||r.isElementWithinCustomPopup(i)}o||this.rowRenderer.stopEditing()},e=[this.eBodyViewport,this.eBottom,this.eTop,this.eStickyTop,this.eStickyBottom];e.forEach(s=>this.addManagedListener(s,"focusout",t))}updateRowCount(){const t=this.headerNavigationService.getHeaderRowCount()+this.filterManager.getHeaderRowCount(),e=this.rowModel.isLastRowIndexKnown()?this.rowModel.getRowCount():-1,s=e===-1?-1:t+e;this.comp.setRowCount(s)}registerBodyViewportResizeListener(t){this.comp.registerBodyViewportResizeListener(t)}setVerticalScrollPaddingVisible(t){const e=t?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(e)}isVerticalScrollShowing(){const t=this.gos.get("alwaysShowVerticalScroll"),e=t?yh:null,s=this.gos.isDomLayout("normal");return this.comp.setAlwaysVerticalScrollClass(e,t),t||s&&Du(this.eBodyViewport)}setupRowAnimationCssClass(){const t=()=>{const e=this.gos.isAnimateRows()&&!this.rowContainerHeightService.isStretching(),s=e?"ag-row-animation":"ag-row-no-animation";this.comp.setRowAnimationCssOnBodyViewport(s,e)};t(),this.addManagedListener(this.eventService,p.EVENT_HEIGHT_SCALE_CHANGED,t),this.addManagedPropertyListener("animateRows",t)}getGridBodyElement(){return this.eGridBody}addBodyViewportListener(){const t=this.onBodyViewportContextMenu.bind(this);this.addManagedListener(this.eBodyViewport,"contextmenu",t),this.mockContextMenuForIPad(t),this.addManagedListener(this.eBodyViewport,"wheel",this.onBodyViewportWheel.bind(this)),this.addManagedListener(this.eStickyTop,"wheel",this.onStickyWheel.bind(this)),this.addManagedListener(this.eStickyBottom,"wheel",this.onStickyWheel.bind(this)),this.addFullWidthContainerWheelListener()}addFullWidthContainerWheelListener(){const t=this.eBodyViewport.querySelector(".ag-full-width-container"),e=this.eBodyViewport.querySelector(".ag-center-cols-viewport");t&&e&&this.addManagedListener(t,"wheel",s=>this.onFullWidthContainerWheel(s,e))}onFullWidthContainerWheel(t,e){!t.deltaX||Math.abs(t.deltaY)>Math.abs(t.deltaX)||!this.mouseEventService.isEventFromThisGrid(t)||(t.preventDefault(),e.scrollBy({left:t.deltaX}))}onBodyViewportContextMenu(t,e,s){if(!t&&!s)return;this.gos.get("preventDefaultOnContextMenu")&&(t||s).preventDefault();const{target:i}=t||e;(i===this.eBodyViewport||i===this.ctrlsService.get("center").getViewportElement())&&this.menuService.showContextMenu({mouseEvent:t,touchEvent:s,value:null,anchorToElement:this.eGridBody})}mockContextMenuForIPad(t){if(!as())return;const e=new ze(this.eBodyViewport),s=i=>{t(void 0,i.touchStart,i.touchEvent)};this.addManagedListener(e,ze.EVENT_LONG_TAP,s),this.addDestroyFunc(()=>e.destroy())}onBodyViewportWheel(t){this.gos.get("suppressScrollWhenPopupsAreOpen")&&this.popupService.hasAnchoredPopup()&&t.preventDefault()}onStickyWheel(t){t.preventDefault(),t.offsetY&&this.scrollVertically(t.deltaY)}getGui(){return this.eGridBody}scrollVertically(t){const e=this.eBodyViewport.scrollTop;return this.bodyScrollFeature.setVerticalScrollPosition(e+t),this.eBodyViewport.scrollTop-e}addRowDragListener(){this.rowDragFeature=this.createManagedBean(new Et(this.eBodyViewport)),this.dragAndDropService.addDropTarget(this.rowDragFeature)}getRowDragFeature(){return this.rowDragFeature}onPinnedRowDataChanged(){this.setFloatingHeights()}setFloatingHeights(){const{pinnedRowModel:t}=this;let e=t.getPinnedTopTotalHeight(),s=t.getPinnedBottomTotalHeight();this.comp.setTopHeight(e),this.comp.setBottomHeight(s),this.comp.setTopDisplay(e?"inherit":"none"),this.comp.setBottomDisplay(s?"inherit":"none"),this.setStickyTopOffsetTop(),this.setStickyBottomOffsetBottom()}setStickyTopHeight(t=0){this.comp.setStickyTopHeight(`${t}px`),this.stickyTopHeight=t}getStickyTopHeight(){return this.stickyTopHeight}setStickyBottomHeight(t=0){this.comp.setStickyBottomHeight(`${t}px`),this.stickyBottomHeight=t}getStickyBottomHeight(){return this.stickyBottomHeight}setStickyWidth(t){if(!t)this.comp.setStickyTopWidth("100%"),this.comp.setStickyBottomWidth("100%");else{const e=this.gos.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${e}px)`),this.comp.setStickyBottomWidth(`calc(100% - ${e}px)`)}}onHeaderHeightChanged(){this.setStickyTopOffsetTop()}setStickyTopOffsetTop(){const e=this.ctrlsService.get("gridHeaderCtrl").getHeaderHeight()+this.filterManager.getHeaderHeight(),s=this.pinnedRowModel.getPinnedTopTotalHeight();let i=0;e>0&&(i+=e),s>0&&(i+=s),i>0&&(i+=1),this.comp.setStickyTopTop(`${i}px`)}setStickyBottomOffsetBottom(){const t=this.pinnedRowModel.getPinnedBottomTotalHeight(),s=this.scrollVisibleService.isHorizontalScrollShowing()&&this.gos.getScrollbarWidth()||0,i=t+s;this.comp.setStickyBottomBottom(`${i}px`)}sizeColumnsToFit(t,e){const i=this.isVerticalScrollShowing()?this.gos.getScrollbarWidth():0,r=ks(this.eGridBody)-i;if(r>0){this.columnModel.sizeColumnsToFit(r,"sizeColumnsToFit",!1,t);return}e===void 0?window.setTimeout(()=>{this.sizeColumnsToFit(t,100)},0):e===100?window.setTimeout(()=>{this.sizeColumnsToFit(t,500)},100):e===500?window.setTimeout(()=>{this.sizeColumnsToFit(t,-1)},500):console.warn("AG Grid: tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?")}addScrollEventListener(t){this.eBodyViewport.addEventListener("scroll",t,{passive:!0})}removeScrollEventListener(t){this.eBodyViewport.removeEventListener("scroll",t)}};u([f("animationFrameService")],Qe.prototype,"animationFrameService",2),u([f("rowContainerHeightService")],Qe.prototype,"rowContainerHeightService",2),u([f("ctrlsService")],Qe.prototype,"ctrlsService",2),u([f("columnModel")],Qe.prototype,"columnModel",2),u([f("scrollVisibleService")],Qe.prototype,"scrollVisibleService",2),u([f("menuService")],Qe.prototype,"menuService",2),u([f("headerNavigationService")],Qe.prototype,"headerNavigationService",2),u([f("dragAndDropService")],Qe.prototype,"dragAndDropService",2),u([f("pinnedRowModel")],Qe.prototype,"pinnedRowModel",2),u([f("rowRenderer")],Qe.prototype,"rowRenderer",2),u([f("popupService")],Qe.prototype,"popupService",2),u([f("mouseEventService")],Qe.prototype,"mouseEventService",2),u([f("rowModel")],Qe.prototype,"rowModel",2),u([f("filterManager")],Qe.prototype,"filterManager",2);var Go="ag-cell-range-selected",Ff="ag-cell-range-chart",Lf="ag-cell-range-single-cell",Mf="ag-cell-range-chart-category",If="ag-cell-range-handle",Nf="ag-cell-range-top",xf="ag-cell-range-right",Gf="ag-cell-range-bottom",Of="ag-cell-range-left",_f=class{constructor(t,e){this.beans=t,this.rangeService=t.rangeService,this.selectionHandleFactory=t.selectionHandleFactory,this.cellCtrl=e}setComp(t,e){this.cellComp=t,this.eGui=e,this.onRangeSelectionChanged()}onRangeSelectionChanged(){this.cellComp&&(this.rangeCount=this.rangeService.getCellRangeCount(this.cellCtrl.getCellPosition()),this.hasChartRange=this.getHasChartRange(),this.cellComp.addOrRemoveCssClass(Go,this.rangeCount!==0),this.cellComp.addOrRemoveCssClass(`${Go}-1`,this.rangeCount===1),this.cellComp.addOrRemoveCssClass(`${Go}-2`,this.rangeCount===2),this.cellComp.addOrRemoveCssClass(`${Go}-3`,this.rangeCount===3),this.cellComp.addOrRemoveCssClass(`${Go}-4`,this.rangeCount>=4),this.cellComp.addOrRemoveCssClass(Ff,this.hasChartRange),Ti(this.eGui,this.rangeCount>0?!0:void 0),this.cellComp.addOrRemoveCssClass(Lf,this.isSingleCell()),this.updateRangeBorders(),this.refreshHandle())}updateRangeBorders(){const t=this.getRangeBorders(),e=this.isSingleCell(),s=!e&&t.top,i=!e&&t.right,o=!e&&t.bottom,r=!e&&t.left;this.cellComp.addOrRemoveCssClass(Nf,s),this.cellComp.addOrRemoveCssClass(xf,i),this.cellComp.addOrRemoveCssClass(Gf,o),this.cellComp.addOrRemoveCssClass(Of,r)}isSingleCell(){const{rangeService:t}=this.beans;return this.rangeCount===1&&!!t&&!t.isMoreThanOneCell()}getHasChartRange(){const{rangeService:t}=this.beans;if(!this.rangeCount||!t)return!1;const e=t.getCellRanges();return e.length>0&&e.every(s=>wt([1,0],s.type))}updateRangeBordersIfRangeCount(){this.rangeCount>0&&(this.updateRangeBorders(),this.refreshHandle())}getRangeBorders(){const t=this.beans.gos.get("enableRtl");let e=!1,s=!1,i=!1,o=!1;const r=this.cellCtrl.getCellPosition().column,n=this.beans.columnModel;let l,a;t?(l=n.getDisplayedColAfter(r),a=n.getDisplayedColBefore(r)):(l=n.getDisplayedColBefore(r),a=n.getDisplayedColAfter(r));const d=this.rangeService.getCellRanges().filter(h=>this.rangeService.isCellInSpecificRange(this.cellCtrl.getCellPosition(),h));l||(o=!0),a||(s=!0);for(let h=0;h<d.length&&!(e&&s&&i&&o);h++){const c=d[h],m=this.rangeService.getRangeStartRow(c),C=this.rangeService.getRangeEndRow(c);!e&&this.beans.rowPositionUtils.sameRow(m,this.cellCtrl.getCellPosition())&&(e=!0),!i&&this.beans.rowPositionUtils.sameRow(C,this.cellCtrl.getCellPosition())&&(i=!0),!o&&l&&c.columns.indexOf(l)<0&&(o=!0),!s&&a&&c.columns.indexOf(a)<0&&(s=!0)}return{top:e,right:s,bottom:i,left:o}}refreshHandle(){if(this.beans.context.isDestroyed())return;const t=this.shouldHaveSelectionHandle();this.selectionHandle&&!t&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),t&&this.addSelectionHandle(),this.cellComp.addOrRemoveCssClass(If,!!this.selectionHandle)}shouldHaveSelectionHandle(){const t=this.beans.gos,e=this.rangeService.getCellRanges(),s=e.length;if(this.rangeCount<1||s<1)return!1;const i=ie(e),o=this.cellCtrl.getCellPosition(),r=t.get("enableFillHandle")&&!this.cellCtrl.isSuppressFillHandle(),n=t.get("enableRangeHandle");let l=s===1&&!this.cellCtrl.isEditing()&&(r||n);if(this.hasChartRange){const d=e[0].type===1&&this.rangeService.isCellInSpecificRange(o,e[0]);this.cellComp.addOrRemoveCssClass(Mf,d),l=i.type===0}return l&&i.endRow!=null&&this.rangeService.isContiguousRange(i)&&this.rangeService.isBottomRightCell(i,o)}addSelectionHandle(){const t=this.beans.gos,e=ie(this.rangeService.getCellRanges()).type,i=t.get("enableFillHandle")&&z(e)?0:1;this.selectionHandle&&this.selectionHandle.getType()!==i&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),this.selectionHandle||(this.selectionHandle=this.selectionHandleFactory.createSelectionHandle(i)),this.selectionHandle.refresh(this.cellCtrl)}destroy(){this.beans.context.destroyBean(this.selectionHandle)}},Vf=class extends L{constructor(t,e){super(),this.cellCtrl=t,this.beans=e,this.column=t.getColumn(),this.rowNode=t.getRowNode()}setupRowSpan(){this.rowSpan=this.column.getRowSpan(this.rowNode),this.addManagedListener(this.beans.eventService,p.EVENT_NEW_COLUMNS_LOADED,()=>this.onNewColumnsLoaded())}setComp(t){this.eGui=t,this.setupColSpan(),this.setupRowSpan(),this.onLeftChanged(),this.onWidthChanged(),this.applyRowSpan()}onNewColumnsLoaded(){const t=this.column.getRowSpan(this.rowNode);this.rowSpan!==t&&(this.rowSpan=t,this.applyRowSpan(!0))}onDisplayColumnsChanged(){const t=this.getColSpanningList();jt(this.colsSpanning,t)||(this.colsSpanning=t,this.onWidthChanged(),this.onLeftChanged())}setupColSpan(){this.column.getColDef().colSpan!=null&&(this.colsSpanning=this.getColSpanningList(),this.addManagedListener(this.beans.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayColumnsChanged.bind(this)),this.addManagedListener(this.beans.eventService,p.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onWidthChanged.bind(this)))}onWidthChanged(){if(!this.eGui)return;const t=this.getCellWidth();this.eGui.style.width=`${t}px`}getCellWidth(){return this.colsSpanning?this.colsSpanning.reduce((t,e)=>t+e.getActualWidth(),0):this.column.getActualWidth()}getColSpanningList(){const t=this.column.getColSpan(this.rowNode),e=[];if(t===1)e.push(this.column);else{let s=this.column;const i=this.column.getPinned();for(let o=0;s&&o<t&&(e.push(s),s=this.beans.columnModel.getDisplayedColAfter(s),!(!s||z(s)||i!==s.getPinned()));o++);}return e}onLeftChanged(){if(!this.eGui)return;const t=this.modifyLeftForPrintLayout(this.getCellLeft());this.eGui.style.left=t+"px"}getCellLeft(){let t;return this.beans.gos.get("enableRtl")&&this.colsSpanning?t=ie(this.colsSpanning):t=this.column,t.getLeft()}modifyLeftForPrintLayout(t){if(!this.cellCtrl.isPrintLayout()||this.column.getPinned()==="left")return t;const e=this.beans.columnModel.getDisplayedColumnsLeftWidth();if(this.column.getPinned()==="right"){const s=this.beans.columnModel.getBodyContainerWidth();return e+s+(t||0)}return e+(t||0)}applyRowSpan(t){if(this.rowSpan===1&&!t)return;const s=this.beans.gos.getRowHeightAsNumber()*this.rowSpan;this.eGui.style.height=`${s}px`,this.eGui.style.zIndex="1"}destroy(){super.destroy()}},Hf=class extends L{constructor(t,e){super(),this.staticClasses=[],this.cellCtrl=t,this.beans=e,this.column=t.getColumn(),this.rowNode=t.getRowNode()}setComp(t){this.cellComp=t,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const t=this.column.getColDef(),{cellClassRules:e}=t,s=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,colDef:t,column:this.column,rowIndex:this.rowNode.rowIndex});this.beans.stylingService.processClassRules(e===this.cellClassRules?void 0:this.cellClassRules,e,s,i=>this.cellComp.addOrRemoveCssClass(i,!0),i=>this.cellComp.addOrRemoveCssClass(i,!1)),this.cellClassRules=e}applyUserStyles(){const t=this.column.getColDef();if(!t.cellStyle)return;let e;if(typeof t.cellStyle=="function"){const s=this.beans.gos.addGridCommonParams({column:this.column,value:this.cellCtrl.getValue(),colDef:t,data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex}),i=t.cellStyle;e=i(s)}else e=t.cellStyle;e&&this.cellComp.setUserStyles(e)}applyClassesFromColDef(){const t=this.column.getColDef(),e=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,column:this.column,colDef:t,rowIndex:this.rowNode.rowIndex});this.staticClasses.length&&this.staticClasses.forEach(s=>this.cellComp.addOrRemoveCssClass(s,!1)),this.staticClasses=this.beans.stylingService.getStaticCellClasses(t,e),this.staticClasses.length&&this.staticClasses.forEach(s=>this.cellComp.addOrRemoveCssClass(s,!0))}destroy(){super.destroy()}},q=class{postConstruct(){this.gos.isRowModelType("clientSide")&&(this.clientSideRowModel=this.rowModel),this.gos.isRowModelType("serverSide")&&(this.serverSideRowModel=this.rowModel)}};u([f("resizeObserverService")],q.prototype,"resizeObserverService",2),u([f("paginationProxy")],q.prototype,"paginationProxy",2),u([f("context")],q.prototype,"context",2),u([f("gridOptionsService")],q.prototype,"gos",2),u([f("environment")],q.prototype,"environment",2),u([f("rowRenderer")],q.prototype,"rowRenderer",2),u([f("valueService")],q.prototype,"valueService",2),u([f("eventService")],q.prototype,"eventService",2),u([f("columnModel")],q.prototype,"columnModel",2),u([f("headerNavigationService")],q.prototype,"headerNavigationService",2),u([f("navigationService")],q.prototype,"navigationService",2),u([f("columnAnimationService")],q.prototype,"columnAnimationService",2),u([f("focusService")],q.prototype,"focusService",2),u([f("popupService")],q.prototype,"popupService",2),u([f("stylingService")],q.prototype,"stylingService",2),u([f("columnHoverService")],q.prototype,"columnHoverService",2),u([f("userComponentFactory")],q.prototype,"userComponentFactory",2),u([f("userComponentRegistry")],q.prototype,"userComponentRegistry",2),u([f("animationFrameService")],q.prototype,"animationFrameService",2),u([f("dragService")],q.prototype,"dragService",2),u([f("dragAndDropService")],q.prototype,"dragAndDropService",2),u([f("sortController")],q.prototype,"sortController",2),u([f("filterManager")],q.prototype,"filterManager",2),u([f("rowContainerHeightService")],q.prototype,"rowContainerHeightService",2),u([f("frameworkOverrides")],q.prototype,"frameworkOverrides",2),u([f("cellPositionUtils")],q.prototype,"cellPositionUtils",2),u([f("rowPositionUtils")],q.prototype,"rowPositionUtils",2),u([f("selectionService")],q.prototype,"selectionService",2),u([f("rowCssClassCalculator")],q.prototype,"rowCssClassCalculator",2),u([f("rowModel")],q.prototype,"rowModel",2),u([f("ctrlsService")],q.prototype,"ctrlsService",2),u([f("ctrlsFactory")],q.prototype,"ctrlsFactory",2),u([f("agStackComponentsRegistry")],q.prototype,"agStackComponentsRegistry",2),u([f("valueCache")],q.prototype,"valueCache",2),u([f("rowNodeEventThrottle")],q.prototype,"rowNodeEventThrottle",2),u([f("localeService")],q.prototype,"localeService",2),u([f("syncService")],q.prototype,"syncService",2),u([f("ariaAnnouncementService")],q.prototype,"ariaAnnouncementService",2),u([he("rangeService")],q.prototype,"rangeService",2),u([he("selectionHandleFactory")],q.prototype,"selectionHandleFactory",2),u([M],q.prototype,"postConstruct",1),q=u([O("beans")],q);var kf=class extends q{constructor(t,e,s){super(),this.cellCtrl=t,this.beans=e,this.column=s}onMouseEvent(t,e){if(!_t(e))switch(t){case"click":this.onCellClicked(e);break;case"mousedown":case"touchstart":this.onMouseDown(e);break;case"dblclick":this.onCellDoubleClicked(e);break;case"mouseout":this.onMouseOut(e);break;case"mouseover":this.onMouseOver(e);break}}onCellClicked(t){if(this.isDoubleClickOnIPad()){this.onCellDoubleClicked(t),t.preventDefault();return}const{eventService:e,rangeService:s,gos:i}=this.beans,o=t.ctrlKey||t.metaKey;s&&o&&s.getCellRangeCount(this.cellCtrl.getCellPosition())>1&&s.intersectLastRange(!0);const r=this.cellCtrl.createEvent(t,p.EVENT_CELL_CLICKED);e.dispatchEvent(r);const n=this.column.getColDef();n.onCellClicked&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{n.onCellClicked(r)})},0),(i.get("singleClickEdit")||n.singleClickEdit)&&!i.get("suppressClickEdit")&&!(t.shiftKey&&(s==null?void 0:s.getCellRanges().length)!=0)&&this.cellCtrl.startRowOrCellEdit()}isDoubleClickOnIPad(){if(!as()||$n("dblclick"))return!1;const t=new Date().getTime(),e=t-this.lastIPadMouseClickEvent<200;return this.lastIPadMouseClickEvent=t,e}onCellDoubleClicked(t){const e=this.column.getColDef(),s=this.cellCtrl.createEvent(t,p.EVENT_CELL_DOUBLE_CLICKED);this.beans.eventService.dispatchEvent(s),typeof e.onCellDoubleClicked=="function"&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{e.onCellDoubleClicked(s)})},0),!this.beans.gos.get("singleClickEdit")&&!this.beans.gos.get("suppressClickEdit")&&this.cellCtrl.startRowOrCellEdit(null,t)}onMouseDown(t){const{ctrlKey:e,metaKey:s,shiftKey:i}=t,o=t.target,{cellCtrl:r,beans:n}=this,{eventService:l,rangeService:a,focusService:d}=n;if(this.isRightClickInExistingRange(t))return;const h=a&&a.getCellRanges().length!=0;if(!i||!h){const c=qt()&&!r.isEditing()&&!Tl(o);r.focusCell(c)}if(i&&h&&!d.isCellFocused(r.getCellPosition())){t.preventDefault();const c=d.getFocusedCell();if(c){const{column:m,rowIndex:C,rowPinned:v}=c,S=n.rowRenderer.getRowByPosition({rowIndex:C,rowPinned:v}),w=S==null?void 0:S.getCellCtrl(m);w!=null&&w.isEditing()&&w.stopEditing(),d.setFocusedCell({column:m,rowIndex:C,rowPinned:v,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}}if(!this.containsWidget(o)){if(a){const c=this.cellCtrl.getCellPosition();if(i)a.extendLatestRangeToCell(c);else{const m=e||s;a.setRangeToCell(c,m)}}l.dispatchEvent(this.cellCtrl.createEvent(t,p.EVENT_CELL_MOUSE_DOWN))}}isRightClickInExistingRange(t){const{rangeService:e}=this.beans;if(e){const s=e.isCellInAnyRange(this.cellCtrl.getCellPosition()),i=t.button===2||t.ctrlKey&&this.beans.gos.get("allowContextMenuWithControlKey");if(s&&i)return!0}return!1}containsWidget(t){return Hs(t,"ag-selection-checkbox",3)}onMouseOut(t){if(this.mouseStayingInsideCell(t))return;const e=this.cellCtrl.createEvent(t,p.EVENT_CELL_MOUSE_OUT);this.beans.eventService.dispatchEvent(e),this.beans.columnHoverService.clearMouseOver()}onMouseOver(t){if(this.mouseStayingInsideCell(t))return;const e=this.cellCtrl.createEvent(t,p.EVENT_CELL_MOUSE_OVER);this.beans.eventService.dispatchEvent(e),this.beans.columnHoverService.setMouseOver([this.column])}mouseStayingInsideCell(t){if(!t.target||!t.relatedTarget)return!1;const e=this.cellCtrl.getGui(),s=e.contains(t.target),i=e.contains(t.relatedTarget);return s&&i}destroy(){}},Bf=class extends L{constructor(t,e,s,i,o){super(),this.cellCtrl=t,this.beans=e,this.rowNode=i,this.rowCtrl=o}setComp(t){this.eGui=t}onKeyDown(t){const e=t.key;switch(e){case E.ENTER:this.onEnterKeyDown(t);break;case E.F2:this.onF2KeyDown(t);break;case E.ESCAPE:this.onEscapeKeyDown(t);break;case E.TAB:this.onTabKeyDown(t);break;case E.BACKSPACE:case E.DELETE:this.onBackspaceOrDeleteKeyDown(e,t);break;case E.DOWN:case E.UP:case E.RIGHT:case E.LEFT:this.onNavigationKeyDown(t,e);break}}onNavigationKeyDown(t,e){this.cellCtrl.isEditing()||(t.shiftKey&&this.cellCtrl.isRangeSelectionEnabled()?this.onShiftRangeSelect(t):this.beans.navigationService.navigateToNextCell(t,e,this.cellCtrl.getCellPosition(),!0),t.preventDefault())}onShiftRangeSelect(t){if(!this.beans.rangeService)return;const e=this.beans.rangeService.extendLatestRangeInDirection(t);e&&this.beans.navigationService.ensureCellVisible(e)}onTabKeyDown(t){this.beans.navigationService.onTabKeyDown(this.cellCtrl,t)}onBackspaceOrDeleteKeyDown(t,e){var s;const{cellCtrl:i,beans:o,rowNode:r}=this,{gos:n,rangeService:l,eventService:a}=o;if(!i.isEditing()){if(a.dispatchEvent({type:p.EVENT_KEY_SHORTCUT_CHANGED_CELL_START}),Ou(t,n.get("enableCellEditingOnBackspace"))){if(l&&n.get("enableRangeSelection"))l.clearCellRangeCellValues({dispatchWrapperEvents:!0,wrapperEventSource:"deleteKey"});else if(i.isCellEditable()){const d=i.getColumn(),h=(s=this.beans.valueService.parseValue(d,r,"",r.getValueFromValueService(d)))!=null?s:null;r.setDataValue(d,h,"cellClear")}}else i.startRowOrCellEdit(t,e);a.dispatchEvent({type:p.EVENT_KEY_SHORTCUT_CHANGED_CELL_END})}}onEnterKeyDown(t){if(this.cellCtrl.isEditing()||this.rowCtrl.isEditing())this.cellCtrl.stopEditingAndFocus(!1,t.shiftKey);else if(this.beans.gos.get("enterNavigatesVertically")){const e=t.shiftKey?E.UP:E.DOWN;this.beans.navigationService.navigateToNextCell(null,e,this.cellCtrl.getCellPosition(),!1)}else this.cellCtrl.startRowOrCellEdit(E.ENTER,t),this.cellCtrl.isEditing()&&t.preventDefault()}onF2KeyDown(t){this.cellCtrl.isEditing()||this.cellCtrl.startRowOrCellEdit(E.F2,t)}onEscapeKeyDown(t){this.cellCtrl.isEditing()&&(this.cellCtrl.stopRowOrCellEdit(!0),this.cellCtrl.focusCell(!0))}processCharacter(t){if(t.target!==this.eGui||this.cellCtrl.isEditing())return;const i=t.key;i===" "?this.onSpaceKeyDown(t):(this.cellCtrl.startRowOrCellEdit(i,t),t.preventDefault())}onSpaceKeyDown(t){const{gos:e}=this.beans;if(!this.cellCtrl.isEditing()&&e.isRowSelection()){const s=this.rowNode.isSelected(),i=!s;if(i||!e.get("suppressRowDeselection")){const o=this.beans.gos.get("groupSelectsFiltered"),r=this.rowNode.setSelectedParams({newValue:i,rangeSelect:t.shiftKey,groupSelectsFiltered:o,event:t,source:"spaceKey"});s===void 0&&r===0&&this.rowNode.setSelectedParams({newValue:!1,rangeSelect:t.shiftKey,groupSelectsFiltered:o,event:t,source:"spaceKey"})}}t.preventDefault()}destroy(){super.destroy()}},Rh=class extends K{constructor(t,e,s){super('<div class="ag-drag-handle ag-row-drag" draggable="true"></div>'),this.rowNode=t,this.column=e,this.eCell=s}postConstruct(){this.getGui().appendChild(be("rowDrag",this.gos,null)),this.addGuiEventListener("mousedown",e=>{e.stopPropagation()}),this.addDragSource(),this.checkVisibility()}addDragSource(){this.addGuiEventListener("dragstart",this.onDragStart.bind(this))}onDragStart(t){const e=this.column.getColDef().dndSourceOnRowDrag;t.dataTransfer.setDragImage(this.eCell,0,0);const s=()=>{try{const i=JSON.stringify(this.rowNode.data);t.dataTransfer.setData("application/json",i),t.dataTransfer.setData("text/plain",i)}catch{}};if(e){const i=this.gos.addGridCommonParams({rowNode:this.rowNode,dragEvent:t});e(i)}else s()}checkVisibility(){const t=this.column.isDndSource(this.rowNode);this.setDisplayed(t)}};u([M],Rh.prototype,"postConstruct",1);var Wf="ag-column-first",Uf="ag-column-last",tn=class{static getHeaderClassesFromColDef(t,e,s,i){return z(t)?[]:this.getColumnClassesFromCollDef(t.headerClass,t,e,s,i)}static getToolPanelClassesFromColDef(t,e,s,i){return z(t)?[]:this.getColumnClassesFromCollDef(t.toolPanelClass,t,e,s,i)}static refreshFirstAndLastStyles(t,e,s){t.addOrRemoveCssClass(Wf,s.isColumnAtEdge(e,"first")),t.addOrRemoveCssClass(Uf,s.isColumnAtEdge(e,"last"))}static getClassParams(t,e,s,i){return e.addGridCommonParams({colDef:t,column:s,columnGroup:i})}static getColumnClassesFromCollDef(t,e,s,i,o){if(z(t))return[];let r;if(typeof t=="function"){const n=this.getClassParams(e,s,i,o);r=t(n)}else r=t;return typeof r=="string"?[r]:Array.isArray(r)?[...r]:[]}},zf="ag-cell",Kf="ag-cell-auto-height",Yf="ag-cell-normal-height",jf="ag-cell-focus",qf="ag-cell-first-right-pinned",Qf="ag-cell-last-left-pinned",Xf="ag-cell-not-inline-editing",Jf="ag-column-hover",Zf="ag-cell-wrap-text",$f=0,bh=class _a extends L{constructor(e,s,i,o){super(),this.cellRangeFeature=null,this.cellPositionFeature=null,this.cellCustomStyleFeature=null,this.tooltipFeature=null,this.cellMouseListenerFeature=null,this.cellKeyboardListenerFeature=null,this.suppressRefreshCell=!1,this.onCellCompAttachedFuncs=[],this.column=e,this.rowNode=s,this.beans=i,this.rowCtrl=o,this.instanceId=e.getId()+"-"+$f++,this.colIdSanitised=Ne(this.column.getId()),i.gos.get("suppressCellFocus")||(this.tabIndex=-1),this.createCellPosition(),this.addFeatures(),this.updateAndFormatValue(!1)}shouldRestoreFocus(){return this.beans.focusService.shouldRestoreFocus(this.cellPosition)}addFeatures(){this.cellPositionFeature=new Vf(this,this.beans),this.addDestroyFunc(()=>{var s;(s=this.cellPositionFeature)==null||s.destroy(),this.cellPositionFeature=null}),this.cellCustomStyleFeature=new Hf(this,this.beans),this.addDestroyFunc(()=>{var s;(s=this.cellCustomStyleFeature)==null||s.destroy(),this.cellCustomStyleFeature=null}),this.cellMouseListenerFeature=new kf(this,this.beans,this.column),this.addDestroyFunc(()=>{var s;(s=this.cellMouseListenerFeature)==null||s.destroy(),this.cellMouseListenerFeature=null}),this.cellKeyboardListenerFeature=new Bf(this,this.beans,this.column,this.rowNode,this.rowCtrl),this.addDestroyFunc(()=>{var s;(s=this.cellKeyboardListenerFeature)==null||s.destroy(),this.cellKeyboardListenerFeature=null}),this.column.isTooltipEnabled()&&(this.enableTooltipFeature(),this.addDestroyFunc(()=>{this.disableTooltipFeature()})),this.beans.rangeService&&this.beans.gos.get("enableRangeSelection")&&(this.cellRangeFeature=new _f(this.beans,this),this.addDestroyFunc(()=>{var s;(s=this.cellRangeFeature)==null||s.destroy(),this.cellRangeFeature=null}))}enableTooltipFeature(e,s){const i=()=>{const n=this.column.getColDef(),l=this.rowNode.data;if(n.tooltipField&&P(l))return Si(l,n.tooltipField,this.column.isTooltipFieldContainsDots());const a=n.tooltipValueGetter;return a?a(this.beans.gos.addGridCommonParams({location:"cell",colDef:this.column.getColDef(),column:this.column,rowIndex:this.cellPosition.rowIndex,node:this.rowNode,data:this.rowNode.data,value:this.value,valueFormatted:this.valueFormatted})):null},o=this.beans.gos.get("tooltipShowMode")==="whenTruncated";!s&&o&&!this.isCellRenderer()&&(s=()=>{const n=this.getGui(),l=n.children.length===0?n:n.querySelector(".ag-cell-value");return l?l.scrollWidth>l.clientWidth:!0});const r={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getRowIndex:()=>this.cellPosition.rowIndex,getRowNode:()=>this.rowNode,getGui:()=>this.getGui(),getLocation:()=>"cell",getTooltipValue:e!=null?()=>e:i,getValueFormatted:()=>this.valueFormatted,shouldDisplayTooltip:s};this.tooltipFeature=new ds(r,this.beans)}disableTooltipFeature(){this.tooltipFeature&&(this.tooltipFeature.destroy(),this.tooltipFeature=null)}setComp(e,s,i,o,r){var n,l,a,d;this.cellComp=e,this.eGui=s,this.printLayout=o,this.addDomData(),this.onCellFocused(this.focusEventToRestore),this.applyStaticCssClasses(),this.setWrapText(),this.onFirstRightPinnedChanged(),this.onLastLeftPinnedChanged(),this.onColumnHover(),this.setupControlComps(),this.setupAutoHeight(i),this.refreshFirstAndLastStyles(),this.refreshAriaColIndex(),(n=this.cellPositionFeature)==null||n.setComp(s),(l=this.cellCustomStyleFeature)==null||l.setComp(e),(a=this.tooltipFeature)==null||a.refreshToolTip(),(d=this.cellKeyboardListenerFeature)==null||d.setComp(this.eGui),this.cellRangeFeature&&this.cellRangeFeature.setComp(e,s),r&&this.isCellEditable()?this.startEditing():this.showValue(),this.onCellCompAttachedFuncs.length&&(this.onCellCompAttachedFuncs.forEach(h=>h()),this.onCellCompAttachedFuncs=[])}setupAutoHeight(e){if(this.isAutoHeight=this.column.isAutoHeight(),!this.isAutoHeight||!e)return;const s=e.parentElement,i=this.beans.gos.getRowHeightForNode(this.rowNode).height,o=l=>{if(this.editing||!this.isAlive())return;const{paddingTop:a,paddingBottom:d,borderBottomWidth:h,borderTopWidth:c}=vs(s),m=a+d+h+c,v=e.offsetHeight+m;if(l<5){const w=this.beans.gos.getDocument(),R=!w||!w.contains(e),y=v==0;if(R||y){window.setTimeout(()=>o(l+1),0);return}}const S=Math.max(v,i);this.rowNode.setRowAutoHeight(S,this.column)},r=()=>o(0);r();const n=this.beans.resizeObserverService.observeResize(e,r);this.addDestroyFunc(()=>{n(),this.rowNode.setRowAutoHeight(void 0,this.column)})}getCellAriaRole(){var e;return(e=this.column.getColDef().cellAriaRole)!=null?e:"gridcell"}getInstanceId(){return this.instanceId}getColumnIdSanitised(){return this.colIdSanitised}getTabIndex(){return this.tabIndex}isCellRenderer(){const e=this.column.getColDef();return e.cellRenderer!=null||e.cellRendererSelector!=null}getValueToDisplay(){var e;return(e=this.valueFormatted)!=null?e:this.value}showValue(e=!1){var s;const i=this.getValueToDisplay();let o;if(this.rowNode.stub){const r=this.createCellRendererParams();o=this.beans.userComponentFactory.getLoadingCellRendererDetails(this.column.getColDef(),r)}else if(this.isCellRenderer()){const r=this.createCellRendererParams();o=this.beans.userComponentFactory.getCellRendererDetails(this.column.getColDef(),r)}this.cellComp.setRenderDetails(o,i,e),(s=this.cellRangeFeature)==null||s.refreshHandle()}setupControlComps(){const e=this.column.getColDef();this.includeSelection=this.isIncludeControl(e.checkboxSelection),this.includeRowDrag=this.isIncludeControl(e.rowDrag),this.includeDndSource=this.isIncludeControl(e.dndSource),this.cellComp.setIncludeSelection(this.includeSelection),this.cellComp.setIncludeDndSource(this.includeDndSource),this.cellComp.setIncludeRowDrag(this.includeRowDrag)}isForceWrapper(){return this.beans.gos.get("enableCellTextSelection")||this.column.isAutoHeight()}isIncludeControl(e){return this.rowNode.rowPinned!=null?!1:typeof e=="function"||e===!0}refreshShouldDestroy(){const e=this.column.getColDef(),s=this.includeSelection!=this.isIncludeControl(e.checkboxSelection),i=this.includeRowDrag!=this.isIncludeControl(e.rowDrag),o=this.includeDndSource!=this.isIncludeControl(e.dndSource),r=this.isAutoHeight!=this.column.isAutoHeight();return s||i||o||r}startEditing(e=null,s=!1,i=null){if(!this.isCellEditable()||this.editing)return;if(!this.cellComp){this.onCellCompAttachedFuncs.push(()=>{this.startEditing(e,s,i)});return}const o=this.createCellEditorParams(e,s),r=this.column.getColDef(),n=this.beans.userComponentFactory.getCellEditorDetails(r,o);this.editCompDetails=n;const l=(n==null?void 0:n.popupFromSelector)!=null?n.popupFromSelector:!!r.cellEditorPopup,a=(n==null?void 0:n.popupPositionFromSelector)!=null?n.popupPositionFromSelector:r.cellEditorPopupPosition;this.setEditing(!0),this.cellComp.setEditDetails(n,l,a,this.beans.gos.get("reactiveCustomComponents"));const d=this.createEvent(i,p.EVENT_CELL_EDITING_STARTED);this.beans.eventService.dispatchEvent(d)}setEditing(e){var s;this.editing!==e&&(this.editing=e,(s=this.cellRangeFeature)==null||s.refreshHandle())}stopRowOrCellEdit(e=!1){this.beans.gos.get("editType")==="fullRow"?this.rowCtrl.stopEditing(e):this.stopEditing(e)}onPopupEditorClosed(){this.isEditing()&&this.stopEditingAndFocus()}takeValueFromCellEditor(e){const s={newValueExists:!1};if(e)return s;const i=this.cellComp.getCellEditor();return!i||i.isCancelAfterEnd&&i.isCancelAfterEnd()?s:{newValue:i.getValue(),newValueExists:!0}}saveNewValue(e,s){if(s===e)return!1;this.suppressRefreshCell=!0;const i=this.rowNode.setDataValue(this.column,s,"edit");return this.suppressRefreshCell=!1,i}stopEditing(e=!1){if(!this.editing)return!1;const{newValue:s,newValueExists:i}=this.takeValueFromCellEditor(e),o=this.rowNode.getValueFromValueService(this.column);let r=!1;return i&&(r=this.saveNewValue(o,s)),this.setEditing(!1),this.cellComp.setEditDetails(),this.editCompDetails=void 0,this.updateAndFormatValue(!1),this.refreshCell({forceRefresh:!0,suppressFlash:!0}),this.dispatchEditingStoppedEvent(o,s,!e&&!!r),r}dispatchEditingStoppedEvent(e,s,i){const o=Ee(_({},this.createEvent(null,p.EVENT_CELL_EDITING_STOPPED)),{oldValue:e,newValue:s,valueChanged:i});this.beans.eventService.dispatchEvent(o)}createCellEditorParams(e,s){return this.beans.gos.addGridCommonParams({value:this.rowNode.getValueFromValueService(this.column),eventKey:e,column:this.column,colDef:this.column.getColDef(),rowIndex:this.getCellPosition().rowIndex,node:this.rowNode,data:this.rowNode.data,cellStartedEdit:s,onKeyDown:this.onKeyDown.bind(this),stopEditing:this.stopEditingAndFocus.bind(this),eGridCell:this.getGui(),parseValue:this.parseValue.bind(this),formatValue:this.formatValue.bind(this)})}createCellRendererParams(){return this.beans.gos.addGridCommonParams({value:this.value,valueFormatted:this.valueFormatted,getValue:()=>this.rowNode.getValueFromValueService(this.column),setValue:s=>this.beans.valueService.setValue(this.rowNode,this.column,s),formatValue:this.formatValue.bind(this),data:this.rowNode.data,node:this.rowNode,pinned:this.column.getPinned(),colDef:this.column.getColDef(),column:this.column,rowIndex:this.getCellPosition().rowIndex,refreshCell:this.refreshCell.bind(this),eGridCell:this.getGui(),eParentOfValue:this.cellComp.getParentOfValue(),registerRowDragger:(s,i,o,r)=>this.registerRowDragger(s,i,r),setTooltip:(s,i)=>{var o;this.tooltipFeature&&this.disableTooltipFeature(),this.enableTooltipFeature(s,i),(o=this.tooltipFeature)==null||o.refreshToolTip()}})}parseValue(e){return this.beans.valueService.parseValue(this.column,this.rowNode,e,this.getValue())}setFocusOutOnEditor(){if(!this.editing)return;const e=this.cellComp.getCellEditor();e&&e.focusOut&&e.focusOut()}setFocusInOnEditor(){if(!this.editing)return;const e=this.cellComp.getCellEditor();e&&e.focusIn?e.focusIn():this.focusCell(!0)}onCellChanged(e){e.column===this.column&&this.refreshCell({})}refreshOrDestroyCell(e){var s;this.refreshShouldDestroy()?(s=this.rowCtrl)==null||s.recreateCell(this):this.refreshCell(e)}refreshCell(e){var s,i,o,r;if(this.suppressRefreshCell||this.editing)return;const n=this.column.getColDef(),l=e!=null&&!!e.newData,a=e!=null&&!!e.suppressFlash||!!n.suppressCellFlash,d=n.field==null&&n.valueGetter==null&&n.showRowGroup==null,h=e&&e.forceRefresh||d||l,c=!!this.cellComp,m=this.updateAndFormatValue(c),C=h||m;if(c){if(C){this.showValue(l);const v=this.beans.filterManager.isSuppressFlashingCellsBecauseFiltering();!a&&!v&&(this.beans.gos.get("enableCellChangeFlash")||n.enableCellChangeFlash)&&this.flashCell(),(s=this.cellCustomStyleFeature)==null||s.applyUserStyles(),(i=this.cellCustomStyleFeature)==null||i.applyClassesFromColDef()}(o=this.tooltipFeature)==null||o.refreshToolTip(),(r=this.cellCustomStyleFeature)==null||r.applyCellClassRules()}}stopEditingAndFocus(e=!1,s=!1){this.stopRowOrCellEdit(),this.focusCell(!0),e||this.navigateAfterEdit(s)}navigateAfterEdit(e){if(this.beans.gos.get("enterNavigatesVerticallyAfterEdit")){const i=e?E.UP:E.DOWN;this.beans.navigationService.navigateToNextCell(null,i,this.getCellPosition(),!1)}}flashCell(e){var s,i;const o=(s=e==null?void 0:e.flashDuration)!=null?s:e==null?void 0:e.flashDelay,r=(i=e==null?void 0:e.fadeDuration)!=null?i:e==null?void 0:e.fadeDelay;this.animateCell("data-changed",o,r)}animateCell(e,s,i){if(!this.cellComp)return;const o=`ag-cell-${e}`,r=`ag-cell-${e}-animation`,{gos:n}=this.beans;s||(s=n.get("cellFlashDuration")),P(i)||(i=n.get("cellFadeDuration")),this.cellComp.addOrRemoveCssClass(o,!0),this.cellComp.addOrRemoveCssClass(r,!1),this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(o,!1),this.cellComp.addOrRemoveCssClass(r,!0),this.eGui.style.transition=`background-color ${i}ms`,window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(r,!1),this.eGui.style.transition="")},i))},s)})}onFlashCells(e){if(!this.cellComp)return;const s=this.beans.cellPositionUtils.createId(this.getCellPosition());e.cells[s]&&this.animateCell("highlight")}isCellEditable(){return this.column.isCellEditable(this.rowNode)}isSuppressFillHandle(){return this.column.isSuppressFillHandle()}formatValue(e){var s;return(s=this.callValueFormatter(e))!=null?s:e}callValueFormatter(e){return this.beans.valueService.formatValue(this.column,this.rowNode,e)}updateAndFormatValue(e){const s=this.value,i=this.valueFormatted;return this.value=this.rowNode.getValueFromValueService(this.column),this.valueFormatted=this.callValueFormatter(this.value),e?!this.valuesAreEqual(s,this.value)||this.valueFormatted!=i:!0}valuesAreEqual(e,s){const i=this.column.getColDef();return i.equals?i.equals(e,s):e===s}getComp(){return this.cellComp}getValue(){return this.value}addDomData(){const e=this.getGui();this.beans.gos.setDomData(e,_a.DOM_DATA_KEY_CELL_CTRL,this),this.addDestroyFunc(()=>this.beans.gos.setDomData(e,_a.DOM_DATA_KEY_CELL_CTRL,null))}createEvent(e,s){return this.beans.gos.addGridCommonParams({type:s,node:this.rowNode,data:this.rowNode.data,value:this.value,column:this.column,colDef:this.column.getColDef(),rowPinned:this.rowNode.rowPinned,event:e,rowIndex:this.rowNode.rowIndex})}processCharacter(e){var s;(s=this.cellKeyboardListenerFeature)==null||s.processCharacter(e)}onKeyDown(e){var s;(s=this.cellKeyboardListenerFeature)==null||s.onKeyDown(e)}onMouseEvent(e,s){var i;(i=this.cellMouseListenerFeature)==null||i.onMouseEvent(e,s)}getGui(){return this.eGui}getColSpanningList(){return this.cellPositionFeature.getColSpanningList()}onLeftChanged(){var e;this.cellComp&&((e=this.cellPositionFeature)==null||e.onLeftChanged())}onDisplayedColumnsChanged(){this.eGui&&(this.refreshAriaColIndex(),this.refreshFirstAndLastStyles())}refreshFirstAndLastStyles(){const{cellComp:e,column:s,beans:i}=this;tn.refreshFirstAndLastStyles(e,s,i.columnModel)}refreshAriaColIndex(){const e=this.beans.columnModel.getAriaColumnIndex(this.column);ll(this.getGui(),e)}isSuppressNavigable(){return this.column.isSuppressNavigable(this.rowNode)}onWidthChanged(){var e;return(e=this.cellPositionFeature)==null?void 0:e.onWidthChanged()}getColumn(){return this.column}getRowNode(){return this.rowNode}isPrintLayout(){return this.printLayout}getCellPosition(){return this.cellPosition}isEditing(){return this.editing}startRowOrCellEdit(e,s=null){if(!this.cellComp){this.onCellCompAttachedFuncs.push(()=>{this.startRowOrCellEdit(e,s)});return}this.beans.gos.get("editType")==="fullRow"?this.rowCtrl.startRowEditing(e,this):this.startEditing(e,!0,s)}getRowCtrl(){return this.rowCtrl}getRowPosition(){return{rowIndex:this.cellPosition.rowIndex,rowPinned:this.cellPosition.rowPinned}}updateRangeBordersIfRangeCount(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.updateRangeBordersIfRangeCount()}onRangeSelectionChanged(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.onRangeSelectionChanged()}isRangeSelectionEnabled(){return this.cellRangeFeature!=null}focusCell(e=!1){this.beans.focusService.setFocusedCell({rowIndex:this.getCellPosition().rowIndex,column:this.column,rowPinned:this.rowNode.rowPinned,forceBrowserFocus:e})}onRowIndexChanged(){this.createCellPosition(),this.onCellFocused(),this.cellRangeFeature&&this.cellRangeFeature.onRangeSelectionChanged()}onFirstRightPinnedChanged(){if(!this.cellComp)return;const e=this.column.isFirstRightPinned();this.cellComp.addOrRemoveCssClass(qf,e)}onLastLeftPinnedChanged(){if(!this.cellComp)return;const e=this.column.isLastLeftPinned();this.cellComp.addOrRemoveCssClass(Qf,e)}onCellFocused(e){if(this.beans.gos.get("suppressCellFocus"))return;const s=this.beans.focusService.isCellFocused(this.cellPosition);if(!this.cellComp){s&&(e!=null&&e.forceBrowserFocus)&&(this.focusEventToRestore=e);return}this.focusEventToRestore=void 0,this.cellComp.addOrRemoveCssClass(jf,s),s&&e&&e.forceBrowserFocus&&this.cellComp.getFocusableElement().focus({preventScroll:!!e.preventScrollOnBrowserFocus});const i=this.beans.gos.get("editType")==="fullRow";!s&&!i&&this.editing&&this.stopRowOrCellEdit(),s&&this.rowCtrl.announceDescription()}createCellPosition(){this.cellPosition={rowIndex:this.rowNode.rowIndex,rowPinned:Yt(this.rowNode.rowPinned),column:this.column}}applyStaticCssClasses(){this.cellComp.addOrRemoveCssClass(zf,!0),this.cellComp.addOrRemoveCssClass(Xf,!0);const e=this.column.isAutoHeight()==!0;this.cellComp.addOrRemoveCssClass(Kf,e),this.cellComp.addOrRemoveCssClass(Yf,!e)}onColumnHover(){if(!this.cellComp||!this.beans.gos.get("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.cellComp.addOrRemoveCssClass(Jf,e)}onColDefChanged(){if(!this.cellComp)return;if(this.column.isTooltipEnabled()?(this.disableTooltipFeature(),this.enableTooltipFeature()):this.disableTooltipFeature(),this.setWrapText(),!this.editing)this.refreshOrDestroyCell({forceRefresh:!0,suppressFlash:!0});else{const s=this.getCellEditor();if(s!=null&&s.refresh){const{eventKey:i,cellStartedEdit:o}=this.editCompDetails.params,r=this.createCellEditorParams(i,o),n=this.column.getColDef(),l=this.beans.userComponentFactory.getCellEditorDetails(n,r);s.refresh(l.params)}}}setWrapText(){const e=this.column.getColDef().wrapText==!0;this.cellComp.addOrRemoveCssClass(Zf,e)}dispatchCellContextMenuEvent(e){const s=this.column.getColDef(),i=this.createEvent(e,p.EVENT_CELL_CONTEXT_MENU);this.beans.eventService.dispatchEvent(i),s.onCellContextMenu&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{s.onCellContextMenu(i)})},0)}getCellRenderer(){return this.cellComp?this.cellComp.getCellRenderer():null}getCellEditor(){return this.cellComp?this.cellComp.getCellEditor():null}destroy(){this.onCellCompAttachedFuncs=[],super.destroy()}createSelectionCheckbox(){const e=new Xr;return this.beans.context.createBean(e),e.init({rowNode:this.rowNode,column:this.column}),e}createDndSource(){const e=new Rh(this.rowNode,this.column,this.eGui);return this.beans.context.createBean(e),e}registerRowDragger(e,s,i){if(this.customRowDragComp){this.customRowDragComp.setDragElement(e,s);return}const o=this.createRowDragComp(e,s,i);o&&(this.customRowDragComp=o,this.addDestroyFunc(()=>{this.beans.context.destroyBean(o),this.customRowDragComp=null}))}createRowDragComp(e,s,i){const o=this.beans.gos.get("pagination"),r=this.beans.gos.get("rowDragManaged"),n=this.beans.gos.isRowModelType("clientSide");if(r){if(!n){H("managed row dragging is only allowed in the Client Side Row Model");return}if(o){H("managed row dragging is not possible when doing pagination");return}}const l=new Ks(()=>this.value,this.rowNode,this.column,e,s,i);return this.beans.context.createBean(l),l}};bh.DOM_DATA_KEY_CELL_CTRL="cellCtrl";var Xs=bh,em=0,Th=class Va extends L{constructor(e,s,i,o,r){super(),this.allRowGuis=[],this.active=!0,this.centerCellCtrls={list:[],map:{}},this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}},this.slideInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.fadeInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.rowDragComps=[],this.lastMouseDownOnDragger=!1,this.emptyStyle={},this.updateColumnListsPending=!1,this.rowId=null,this.businessKeySanitised=null,this.beans=s,this.gos=s.gos,this.rowNode=e,this.paginationPage=s.paginationProxy.getCurrentPage(),this.useAnimationFrameForCreate=o,this.printLayout=r,this.suppressRowTransform=this.gos.get("suppressRowTransform"),this.instanceId=e.id+"-"+em++,this.rowId=Ne(e.id),this.initRowBusinessKey(),this.rowFocused=s.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned),this.rowLevel=s.rowCssClassCalculator.calculateRowLevel(this.rowNode),this.setRowType(),this.setAnimateFlags(i),this.rowStyles=this.processStylesFromGridOptions(),this.isFullWidth()&&!this.gos.get("suppressCellFocus")&&(this.tabIndex=-1),this.addListeners()}initRowBusinessKey(){this.businessKeyForNodeFunc=this.gos.get("getBusinessKeyForNode"),this.updateRowBusinessKey()}updateRowBusinessKey(){if(typeof this.businessKeyForNodeFunc!="function")return;const e=this.businessKeyForNodeFunc(this.rowNode);this.businessKeySanitised=Ne(e)}getRowId(){return this.rowId}getRowStyles(){return this.rowStyles}getTabIndex(){return this.tabIndex}isSticky(){return this.rowNode.sticky}getInstanceId(){return this.instanceId}setComp(e,s,i){const o={rowComp:e,element:s,containerType:i};this.allRowGuis.push(o),i==="left"?this.leftGui=o:i==="right"?this.rightGui=o:i==="fullWidth"?this.fullWidthGui=o:this.centerGui=o,this.initialiseRowComp(o),this.rowType!=="FullWidthLoading"&&!this.rowNode.rowPinned&&this.beans.rowRenderer.dispatchFirstDataRenderedEvent()}unsetComp(e){switch(this.allRowGuis=this.allRowGuis.filter(s=>s.containerType!==e),e){case"left":this.leftGui=void 0;break;case"right":this.rightGui=void 0;break;case"fullWidth":this.fullWidthGui=void 0;break;case"center":this.centerGui=void 0;break}}isCacheable(){return this.rowType==="FullWidthDetail"&&this.gos.get("keepDetailRows")}setCached(e){const s=e?"none":"";this.allRowGuis.forEach(i=>i.element.style.display=s)}initialiseRowComp(e){const s=this.gos;this.listenOnDomOrder(e),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights(),this.onRowHeightChanged(e),this.updateRowIndexes(e),this.setFocusedClasses(e),this.setStylesFromGridOptions(!1,e),s.isRowSelection()&&this.rowNode.selectable&&this.onRowSelected(e),this.updateColumnLists(!this.useAnimationFrameForCreate);const i=e.rowComp;this.getInitialRowClasses(e.containerType).forEach(r=>i.addOrRemoveCssClass(r,!0)),this.executeSlideAndFadeAnimations(e),this.rowNode.group&&ls(e.element,this.rowNode.expanded==!0),this.setRowCompRowId(i),this.setRowCompRowBusinessKey(i),s.setDomData(e.element,Va.DOM_DATA_KEY_ROW_CTRL,this),this.addDestroyFunc(()=>s.setDomData(e.element,Va.DOM_DATA_KEY_ROW_CTRL,null)),this.useAnimationFrameForCreate?this.beans.animationFrameService.createTask(this.addHoverFunctionality.bind(this,e.element),this.rowNode.rowIndex,"createTasksP2"):this.addHoverFunctionality(e.element),this.isFullWidth()&&this.setupFullWidth(e),s.get("rowDragEntireRow")&&this.addRowDraggerToRow(e),this.useAnimationFrameForCreate&&this.beans.animationFrameService.addDestroyTask(()=>{this.isAlive()&&e.rowComp.addOrRemoveCssClass("ag-after-created",!0)}),this.executeProcessRowPostCreateFunc()}setRowCompRowBusinessKey(e){this.businessKeySanitised!=null&&e.setRowBusinessKey(this.businessKeySanitised)}getBusinessKey(){return this.businessKeySanitised}setRowCompRowId(e){this.rowId=Ne(this.rowNode.id),this.rowId!=null&&e.setRowId(this.rowId)}executeSlideAndFadeAnimations(e){const{containerType:s}=e;this.slideInAnimation[s]&&(zn(()=>{this.onTopChanged()}),this.slideInAnimation[s]=!1),this.fadeInAnimation[s]&&(zn(()=>{e.rowComp.addOrRemoveCssClass("ag-opacity-zero",!1)}),this.fadeInAnimation[s]=!1)}addRowDraggerToRow(e){if(this.gos.get("enableRangeSelection")){H("Setting `rowDragEntireRow: true` in the gridOptions doesn't work with `enableRangeSelection: true`");return}const s=this.beans.localeService.getLocaleTextFunc(),i=new Ks(()=>`1 ${s("rowDragRow","row")}`,this.rowNode,void 0,e.element,void 0,!0),o=this.createBean(i,this.beans.context);this.rowDragComps.push(o)}setupFullWidth(e){const s=this.getPinnedForContainer(e.containerType);if(this.rowType=="FullWidthDetail"&&!ne.__assertRegistered("@ag-grid-enterprise/master-detail","cell renderer 'agDetailCellRenderer' (for master detail)",this.beans.context.getGridId()))return;const i=this.createFullWidthCompDetails(e.element,s);e.rowComp.showFullWidth(i)}isPrintLayout(){return this.printLayout}getFullWidthCellRenderers(){var e,s;return this.gos.get("embedFullWidthRows")?this.allRowGuis.map(i=>{var o;return(o=i==null?void 0:i.rowComp)==null?void 0:o.getFullWidthCellRenderer()}):[(s=(e=this.fullWidthGui)==null?void 0:e.rowComp)==null?void 0:s.getFullWidthCellRenderer()]}getCellElement(e){const s=this.getCellCtrl(e);return s?s.getGui():null}executeProcessRowPostCreateFunc(){const e=this.gos.getCallback("processRowPostCreate");if(!e||!this.areAllContainersReady())return;const s={eRow:this.centerGui.element,ePinnedLeftRow:this.leftGui?this.leftGui.element:void 0,ePinnedRightRow:this.rightGui?this.rightGui.element:void 0,node:this.rowNode,rowIndex:this.rowNode.rowIndex,addRenderedRowListener:this.addEventListener.bind(this)};e(s)}areAllContainersReady(){const e=!!this.leftGui||!this.beans.columnModel.isPinningLeft(),s=!!this.centerGui,i=!!this.rightGui||!this.beans.columnModel.isPinningRight();return e&&s&&i}setRowType(){const e=this.rowNode.stub&&!this.gos.get("suppressServerSideFullWidthLoadingRow"),s=this.rowNode.isFullWidthCell(),i=this.gos.get("masterDetail")&&this.rowNode.detail,o=this.beans.columnModel.isPivotMode(),n=!!this.rowNode.group&&!this.rowNode.footer&&this.gos.isGroupUseEntireRow(o);e?this.rowType="FullWidthLoading":i?this.rowType="FullWidthDetail":s?this.rowType="FullWidth":n?this.rowType="FullWidthGroup":this.rowType="Normal"}updateColumnLists(e=!1,s=!1){if(this.isFullWidth())return;if(e||this.gos.get("suppressAnimationFrame")||this.printLayout){this.updateColumnListsImpl(s);return}this.updateColumnListsPending||(this.beans.animationFrameService.createTask(()=>{this.active&&this.updateColumnListsImpl(!0)},this.rowNode.rowIndex,"createTasksP1"),this.updateColumnListsPending=!0)}createCellCtrls(e,s,i=null){const o={list:[],map:{}},r=(n,l)=>{o.list.push(l),o.map[n]=l};return s.forEach(n=>{const l=n.getInstanceId();let a=e.map[l];a||(a=new Xs(n,this.rowNode,this.beans,this)),r(l,a)}),e.list.forEach(n=>{if(o.map[n.getColumn().getInstanceId()]!=null)return;if(!this.isCellEligibleToBeRemoved(n,i)){r(n.getColumn().getInstanceId(),n);return}n.destroy()}),o}updateColumnListsImpl(e){this.updateColumnListsPending=!1,this.createAllCellCtrls(),this.setCellCtrls(e)}setCellCtrls(e){this.allRowGuis.forEach(s=>{const i=this.getCellCtrlsForContainer(s.containerType);s.rowComp.setCellCtrls(i,e)})}getCellCtrlsForContainer(e){switch(e){case"left":return this.leftCellCtrls.list;case"right":return this.rightCellCtrls.list;case"fullWidth":return[];case"center":return this.centerCellCtrls.list;default:const s=e;throw new Error(`Unhandled case: ${s}`)}}createAllCellCtrls(){const e=this.beans.columnModel;if(this.printLayout)this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,e.getAllDisplayedColumns()),this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}};else{const s=e.getViewportCenterColumnsForRow(this.rowNode);this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,s);const i=e.getDisplayedLeftColumnsForRow(this.rowNode);this.leftCellCtrls=this.createCellCtrls(this.leftCellCtrls,i,"left");const o=e.getDisplayedRightColumnsForRow(this.rowNode);this.rightCellCtrls=this.createCellCtrls(this.rightCellCtrls,o,"right")}}isCellEligibleToBeRemoved(e,s){if(e.getColumn().getPinned()!=s)return!0;const n=e.isEditing(),l=this.beans.focusService.isCellFocused(e.getCellPosition());if(n||l){const d=e.getColumn();return!(this.beans.columnModel.getAllDisplayedColumns().indexOf(d)>=0)}return!0}getDomOrder(){return this.gos.get("ensureDomOrder")||this.gos.isDomLayout("print")}listenOnDomOrder(e){const s=()=>{e.rowComp.setDomOrder(this.getDomOrder())};this.addManagedPropertyListener("domLayout",s),this.addManagedPropertyListener("ensureDomOrder",s)}setAnimateFlags(e){if(this.isSticky()||!e)return;const s=P(this.rowNode.oldRowTop),i=this.beans.columnModel.isPinningLeft(),o=this.beans.columnModel.isPinningRight();if(s){if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows")){this.slideInAnimation.fullWidth=!0;return}this.slideInAnimation.center=!0,this.slideInAnimation.left=i,this.slideInAnimation.right=o}else{if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows")){this.fadeInAnimation.fullWidth=!0;return}this.fadeInAnimation.center=!0,this.fadeInAnimation.left=i,this.fadeInAnimation.right=o}}isEditing(){return this.editingRow}isFullWidth(){return this.rowType!=="Normal"}refreshFullWidth(){const e=(l,a)=>l?l.rowComp.refreshFullWidth(()=>this.createFullWidthCompDetails(l.element,a).params):!0,s=e(this.fullWidthGui,null),i=e(this.centerGui,null),o=e(this.leftGui,"left"),r=e(this.rightGui,"right");return s&&i&&o&&r}addListeners(){this.addManagedListener(this.rowNode,J.EVENT_HEIGHT_CHANGED,()=>this.onRowHeightChanged()),this.addManagedListener(this.rowNode,J.EVENT_ROW_SELECTED,()=>this.onRowSelected()),this.addManagedListener(this.rowNode,J.EVENT_ROW_INDEX_CHANGED,this.onRowIndexChanged.bind(this)),this.addManagedListener(this.rowNode,J.EVENT_TOP_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(this.rowNode,J.EVENT_EXPANDED_CHANGED,this.updateExpandedCss.bind(this)),this.addManagedListener(this.rowNode,J.EVENT_HAS_CHILDREN_CHANGED,this.updateExpandedCss.bind(this)),this.rowNode.detail&&this.addManagedListener(this.rowNode.parent,J.EVENT_DATA_CHANGED,this.onRowNodeDataChanged.bind(this)),this.addManagedListener(this.rowNode,J.EVENT_DATA_CHANGED,this.onRowNodeDataChanged.bind(this)),this.addManagedListener(this.rowNode,J.EVENT_CELL_CHANGED,this.postProcessCss.bind(this)),this.addManagedListener(this.rowNode,J.EVENT_HIGHLIGHT_CHANGED,this.onRowNodeHighlightChanged.bind(this)),this.addManagedListener(this.rowNode,J.EVENT_DRAGGING_CHANGED,this.postProcessRowDragging.bind(this)),this.addManagedListener(this.rowNode,J.EVENT_UI_LEVEL_CHANGED,this.onUiLevelChanged.bind(this));const e=this.beans.eventService;this.addManagedListener(e,p.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED,this.onPaginationPixelOffsetChanged.bind(this)),this.addManagedListener(e,p.EVENT_HEIGHT_SCALE_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(e,p.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(e,p.EVENT_VIRTUAL_COLUMNS_CHANGED,this.onVirtualColumnsChanged.bind(this)),this.addManagedListener(e,p.EVENT_CELL_FOCUSED,this.onCellFocusChanged.bind(this)),this.addManagedListener(e,p.EVENT_CELL_FOCUS_CLEARED,this.onCellFocusChanged.bind(this)),this.addManagedListener(e,p.EVENT_PAGINATION_CHANGED,this.onPaginationChanged.bind(this)),this.addManagedListener(e,p.EVENT_MODEL_UPDATED,this.refreshFirstAndLastRowStyles.bind(this)),this.addManagedListener(e,p.EVENT_COLUMN_MOVED,this.updateColumnLists.bind(this)),this.addDestroyFunc(()=>{this.destroyBeans(this.rowDragComps,this.beans.context),this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature,this.beans.context))}),this.addManagedPropertyListeners(["rowDragEntireRow"],()=>{if(this.gos.get("rowDragEntireRow")){this.allRowGuis.forEach(i=>{this.addRowDraggerToRow(i)});return}this.destroyBeans(this.rowDragComps,this.beans.context),this.rowDragComps=[]}),this.addListenersForCellComps()}addListenersForCellComps(){this.addManagedListener(this.rowNode,J.EVENT_ROW_INDEX_CHANGED,()=>{this.getAllCellCtrls().forEach(e=>e.onRowIndexChanged())}),this.addManagedListener(this.rowNode,J.EVENT_CELL_CHANGED,e=>{this.getAllCellCtrls().forEach(s=>s.onCellChanged(e))})}onRowNodeDataChanged(e){if(this.isFullWidth()!==!!this.rowNode.isFullWidthCell()){this.beans.rowRenderer.redrawRow(this.rowNode);return}if(this.isFullWidth()){this.refreshFullWidth()||this.beans.rowRenderer.redrawRow(this.rowNode);return}this.getAllCellCtrls().forEach(i=>i.refreshCell({suppressFlash:!e.update,newData:!e.update})),this.allRowGuis.forEach(i=>{this.setRowCompRowId(i.rowComp),this.updateRowBusinessKey(),this.setRowCompRowBusinessKey(i.rowComp)}),this.onRowSelected(),this.postProcessCss()}postProcessCss(){this.setStylesFromGridOptions(!0),this.postProcessClassesFromGridOptions(),this.postProcessRowClassRules(),this.postProcessRowDragging()}onRowNodeHighlightChanged(){const e=this.rowNode.highlighted;this.allRowGuis.forEach(s=>{const i=e===0,o=e===1;s.rowComp.addOrRemoveCssClass("ag-row-highlight-above",i),s.rowComp.addOrRemoveCssClass("ag-row-highlight-below",o)})}postProcessRowDragging(){const e=this.rowNode.dragging;this.allRowGuis.forEach(s=>s.rowComp.addOrRemoveCssClass("ag-row-dragging",e))}updateExpandedCss(){const e=this.rowNode.isExpandable(),s=this.rowNode.expanded==!0;this.allRowGuis.forEach(i=>{i.rowComp.addOrRemoveCssClass("ag-row-group",e),i.rowComp.addOrRemoveCssClass("ag-row-group-expanded",e&&s),i.rowComp.addOrRemoveCssClass("ag-row-group-contracted",e&&!s),ls(i.element,e&&s)})}onDisplayedColumnsChanged(){this.updateColumnLists(!0),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights()}onVirtualColumnsChanged(){this.updateColumnLists(!1,!0)}getRowPosition(){return{rowPinned:Yt(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}}onKeyboardNavigate(e){const s=this.allRowGuis.find(a=>a.element.contains(e.target));if(!((s?s.element:null)===e.target))return;const r=this.rowNode,n=this.beans.focusService.getFocusedCell(),l={rowIndex:r.rowIndex,rowPinned:r.rowPinned,column:n&&n.column};this.beans.navigationService.navigateToNextCell(e,e.key,l,!0),e.preventDefault()}onTabKeyDown(e){if(e.defaultPrevented||_t(e))return;const s=this.allRowGuis.find(n=>n.element.contains(e.target)),i=s?s.element:null,o=i===e.target;let r=null;o||(r=this.beans.focusService.findNextFocusableElement(i,!1,e.shiftKey)),(this.isFullWidth()&&o||!r)&&this.beans.navigationService.onTabKeyDown(this,e)}getFullWidthElement(){return this.fullWidthGui?this.fullWidthGui.element:null}getRowYPosition(){var e;const s=(e=this.allRowGuis.find(i=>ht(i.element)))==null?void 0:e.element;return s?s.getBoundingClientRect().top:0}onFullWidthRowFocused(e){var s;const i=this.rowNode,o=e?this.isFullWidth()&&e.rowIndex===i.rowIndex&&e.rowPinned==i.rowPinned:!1,r=this.fullWidthGui?this.fullWidthGui.element:(s=this.centerGui)==null?void 0:s.element;r&&(r.classList.toggle("ag-full-width-focus",o),o&&r.focus({preventScroll:!0}))}recreateCell(e){this.centerCellCtrls=this.removeCellCtrl(this.centerCellCtrls,e),this.leftCellCtrls=this.removeCellCtrl(this.leftCellCtrls,e),this.rightCellCtrls=this.removeCellCtrl(this.rightCellCtrls,e),e.destroy(),this.updateColumnLists()}removeCellCtrl(e,s){const i={list:[],map:{}};return e.list.forEach(o=>{o!==s&&(i.list.push(o),i.map[o.getColumn().getInstanceId()]=o)}),i}onMouseEvent(e,s){switch(e){case"dblclick":this.onRowDblClick(s);break;case"click":this.onRowClick(s);break;case"touchstart":case"mousedown":this.onRowMouseDown(s);break}}createRowEvent(e,s){return this.gos.addGridCommonParams({type:e,node:this.rowNode,data:this.rowNode.data,rowIndex:this.rowNode.rowIndex,rowPinned:this.rowNode.rowPinned,event:s})}createRowEventWithSource(e,s){const i=this.createRowEvent(e,s);return i.source=this,i}onRowDblClick(e){if(_t(e))return;const s=this.createRowEventWithSource(p.EVENT_ROW_DOUBLE_CLICKED,e);this.beans.eventService.dispatchEvent(s)}onRowMouseDown(e){if(this.lastMouseDownOnDragger=Hs(e.target,"ag-row-drag",3),!this.isFullWidth())return;const s=this.rowNode,i=this.beans.columnModel;this.beans.rangeService&&this.beans.rangeService.removeAllCellRanges(),this.beans.focusService.setFocusedCell({rowIndex:s.rowIndex,column:i.getAllDisplayedColumns()[0],rowPinned:s.rowPinned,forceBrowserFocus:!0})}onRowClick(e){if(_t(e)||this.lastMouseDownOnDragger)return;const i=this.createRowEventWithSource(p.EVENT_ROW_CLICKED,e);this.beans.eventService.dispatchEvent(i);const o=e.ctrlKey||e.metaKey,r=e.shiftKey;if(this.gos.get("groupSelectsChildren")&&this.rowNode.group||this.isRowSelectionBlocked()||this.gos.get("suppressRowClickSelection"))return;const l=this.gos.get("rowMultiSelectWithClick"),a=!this.gos.get("suppressRowDeselection"),d="rowClicked";if(this.rowNode.isSelected())l?this.rowNode.setSelectedParams({newValue:!1,event:e,source:d}):o?a&&this.rowNode.setSelectedParams({newValue:!1,event:e,source:d}):this.rowNode.setSelectedParams({newValue:!0,clearSelection:!r,rangeSelect:r,event:e,source:d});else{const h=l?!1:!o;this.rowNode.setSelectedParams({newValue:!0,clearSelection:h,rangeSelect:r,event:e,source:d})}}isRowSelectionBlocked(){return!this.rowNode.selectable||!!this.rowNode.rowPinned||!this.gos.isRowSelection()}setupDetailRowAutoHeight(e){if(this.rowType!=="FullWidthDetail"||!this.gos.get("detailRowAutoHeight"))return;const s=()=>{const o=e.clientHeight;if(o!=null&&o>0){const r=()=>{this.rowNode.setRowHeight(o),this.beans.clientSideRowModel?this.beans.clientSideRowModel.onRowHeightChanged():this.beans.serverSideRowModel&&this.beans.serverSideRowModel.onRowHeightChanged()};window.setTimeout(r,0)}},i=this.beans.resizeObserverService.observeResize(e,s);this.addDestroyFunc(i),s()}createFullWidthCompDetails(e,s){const i=this.gos.addGridCommonParams({fullWidth:!0,data:this.rowNode.data,node:this.rowNode,value:this.rowNode.key,valueFormatted:this.rowNode.key,rowIndex:this.rowNode.rowIndex,eGridCell:e,eParentOfValue:e,pinned:s,addRenderedRowListener:this.addEventListener.bind(this),registerRowDragger:(o,r,n,l)=>this.addFullWidthRowDragging(o,r,n,l),setTooltip:(o,r)=>this.refreshRowTooltip(o,r)});switch(this.rowType){case"FullWidthDetail":return this.beans.userComponentFactory.getFullWidthDetailCellRendererDetails(i);case"FullWidthGroup":return this.beans.userComponentFactory.getFullWidthGroupCellRendererDetails(i);case"FullWidthLoading":return this.beans.userComponentFactory.getFullWidthLoadingCellRendererDetails(i);default:return this.beans.userComponentFactory.getFullWidthCellRendererDetails(i)}}refreshRowTooltip(e,s){if(!this.fullWidthGui)return;const i={getGui:()=>this.fullWidthGui.element,getTooltipValue:()=>e,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:s};this.tooltipFeature&&this.destroyBean(this.tooltipFeature,this.beans.context),this.tooltipFeature=this.createBean(new ds(i,this.beans))}addFullWidthRowDragging(e,s,i="",o){if(!this.isFullWidth())return;const r=new Ks(()=>i,this.rowNode,void 0,e,s,o);this.createBean(r,this.beans.context),this.addDestroyFunc(()=>{this.destroyBean(r,this.beans.context)})}onUiLevelChanged(){const e=this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode);if(this.rowLevel!=e){const s="ag-row-level-"+e,i="ag-row-level-"+this.rowLevel;this.allRowGuis.forEach(o=>{o.rowComp.addOrRemoveCssClass(s,!0),o.rowComp.addOrRemoveCssClass(i,!1)})}this.rowLevel=e}isFirstRowOnPage(){return this.rowNode.rowIndex===this.beans.paginationProxy.getPageFirstRow()}isLastRowOnPage(){return this.rowNode.rowIndex===this.beans.paginationProxy.getPageLastRow()}refreshFirstAndLastRowStyles(){const e=this.isFirstRowOnPage(),s=this.isLastRowOnPage();this.firstRowOnPage!==e&&(this.firstRowOnPage=e,this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass("ag-row-first",e))),this.lastRowOnPage!==s&&(this.lastRowOnPage=s,this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass("ag-row-last",s)))}stopEditing(e=!1){if(this.stoppingRowEdit)return;const s=this.getAllCellCtrls(),i=this.editingRow;this.stoppingRowEdit=!0;let o=!1;for(const r of s){const n=r.stopEditing(e);i&&!e&&!o&&n&&(o=!0)}if(o){const r=this.createRowEvent(p.EVENT_ROW_VALUE_CHANGED);this.beans.eventService.dispatchEvent(r)}i&&this.setEditingRow(!1),this.stoppingRowEdit=!1}setInlineEditingCss(e){this.allRowGuis.forEach(s=>{s.rowComp.addOrRemoveCssClass("ag-row-inline-editing",e),s.rowComp.addOrRemoveCssClass("ag-row-not-inline-editing",!e)})}setEditingRow(e){this.editingRow=e,this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass("ag-row-editing",e));const s=e?this.createRowEvent(p.EVENT_ROW_EDITING_STARTED):this.createRowEvent(p.EVENT_ROW_EDITING_STOPPED);this.beans.eventService.dispatchEvent(s)}startRowEditing(e=null,s=null,i=null){if(this.editingRow)return;this.getAllCellCtrls().reduce((r,n)=>{const l=n===s;return l?n.startEditing(e,l,i):n.startEditing(null,l,i),r?!0:n.isEditing()},!1)&&this.setEditingRow(!0)}getAllCellCtrls(){return this.leftCellCtrls.list.length===0&&this.rightCellCtrls.list.length===0?this.centerCellCtrls.list:[...this.centerCellCtrls.list,...this.leftCellCtrls.list,...this.rightCellCtrls.list]}postProcessClassesFromGridOptions(){const e=this.beans.rowCssClassCalculator.processClassesFromGridOptions(this.rowNode);!e||!e.length||e.forEach(s=>{this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass(s,!0))})}postProcessRowClassRules(){this.beans.rowCssClassCalculator.processRowClassRules(this.rowNode,e=>{this.allRowGuis.forEach(s=>s.rowComp.addOrRemoveCssClass(e,!0))},e=>{this.allRowGuis.forEach(s=>s.rowComp.addOrRemoveCssClass(e,!1))})}setStylesFromGridOptions(e,s){e&&(this.rowStyles=this.processStylesFromGridOptions()),this.forEachGui(s,i=>i.rowComp.setUserStyles(this.rowStyles))}getPinnedForContainer(e){return e==="left"?"left":e==="right"?"right":null}getInitialRowClasses(e){const s=this.getPinnedForContainer(e),i={rowNode:this.rowNode,rowFocused:this.rowFocused,fadeRowIn:this.fadeInAnimation[e],rowIsEven:this.rowNode.rowIndex%2===0,rowLevel:this.rowLevel,fullWidthRow:this.isFullWidth(),firstRowOnPage:this.isFirstRowOnPage(),lastRowOnPage:this.isLastRowOnPage(),printLayout:this.printLayout,expandable:this.rowNode.isExpandable(),pinned:s};return this.beans.rowCssClassCalculator.getInitialRowClasses(i)}processStylesFromGridOptions(){const e=this.gos.get("rowStyle");if(e&&typeof e=="function"){console.warn("AG Grid: rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead");return}const s=this.gos.getCallback("getRowStyle");let i;if(s){const o={data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex};i=s(o)}return i||e?Object.assign({},e,i):this.emptyStyle}onRowSelected(e){const s=!!this.rowNode.isSelected();this.forEachGui(e,i=>{i.rowComp.addOrRemoveCssClass("ag-row-selected",s),Ti(i.element,s),i.element.contains(this.beans.gos.getActiveDomElement())&&(i===this.centerGui||i===this.fullWidthGui)&&this.announceDescription()})}announceDescription(){if(this.isRowSelectionBlocked())return;const e=this.rowNode.isSelected();if(e&&this.beans.gos.get("suppressRowDeselection"))return;const i=this.beans.localeService.getLocaleTextFunc()(e?"ariaRowDeselect":"ariaRowSelect",`Press SPACE to ${e?"deselect":"select"} this row.`);this.beans.ariaAnnouncementService.announceValue(i)}addHoverFunctionality(e){this.active&&(this.addManagedListener(e,"mouseenter",()=>this.rowNode.onMouseEnter()),this.addManagedListener(e,"mouseleave",()=>this.rowNode.onMouseLeave()),this.addManagedListener(this.rowNode,J.EVENT_MOUSE_ENTER,()=>{!this.beans.dragService.isDragging()&&!this.gos.get("suppressRowHoverHighlight")&&(e.classList.add("ag-row-hover"),this.rowNode.setHovered(!0))}),this.addManagedListener(this.rowNode,J.EVENT_MOUSE_LEAVE,()=>{e.classList.remove("ag-row-hover"),this.rowNode.setHovered(!1)}))}roundRowTopToBounds(e){const s=this.beans.ctrlsService.getGridBodyCtrl().getScrollFeature().getApproximateVScollPosition(),i=this.applyPaginationOffset(s.top,!0)-100,o=this.applyPaginationOffset(s.bottom,!0)+100;return Math.min(Math.max(i,e),o)}getFrameworkOverrides(){return this.beans.frameworkOverrides}forEachGui(e,s){e?s(e):this.allRowGuis.forEach(s)}onRowHeightChanged(e){if(this.rowNode.rowHeight==null)return;const s=this.rowNode.rowHeight,i=this.beans.environment.getDefaultRowHeight(),r=this.gos.isGetRowHeightFunction()?this.gos.getRowHeightForNode(this.rowNode).height:void 0,n=r?`${Math.min(i,r)-2}px`:void 0;this.forEachGui(e,l=>{l.element.style.height=`${s}px`,n&&l.element.style.setProperty("--ag-line-height",n)})}addEventListener(e,s){super.addEventListener(e,s)}removeEventListener(e,s){super.removeEventListener(e,s)}destroyFirstPass(e=!1){if(this.active=!1,!e&&this.gos.isAnimateRows()&&!this.isSticky())if(this.rowNode.rowTop!=null){const o=this.roundRowTopToBounds(this.rowNode.rowTop);this.setRowTop(o)}else this.allRowGuis.forEach(o=>o.rowComp.addOrRemoveCssClass("ag-opacity-zero",!0));this.rowNode.setHovered(!1);const s=this.createRowEvent(p.EVENT_VIRTUAL_ROW_REMOVED);this.dispatchEvent(s),this.beans.eventService.dispatchEvent(s),super.destroy()}destroySecondPass(){this.allRowGuis.length=0,this.stopEditing();const e=s=>(s.list.forEach(i=>i.destroy()),{list:[],map:{}});this.centerCellCtrls=e(this.centerCellCtrls),this.leftCellCtrls=e(this.leftCellCtrls),this.rightCellCtrls=e(this.rightCellCtrls)}setFocusedClasses(e){this.forEachGui(e,s=>{s.rowComp.addOrRemoveCssClass("ag-row-focus",this.rowFocused),s.rowComp.addOrRemoveCssClass("ag-row-no-focus",!this.rowFocused)})}onCellFocusChanged(){const e=this.beans.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);e!==this.rowFocused&&(this.rowFocused=e,this.setFocusedClasses()),!e&&this.editingRow&&this.stopEditing(!1)}onPaginationChanged(){const e=this.beans.paginationProxy.getCurrentPage();this.paginationPage!==e&&(this.paginationPage=e,this.onTopChanged()),this.refreshFirstAndLastRowStyles()}onTopChanged(){this.setRowTop(this.rowNode.rowTop)}onPaginationPixelOffsetChanged(){this.onTopChanged()}applyPaginationOffset(e,s=!1){if(this.rowNode.isRowPinned()||this.rowNode.sticky)return e;const i=this.beans.paginationProxy.getPixelOffset();return e+i*(s?1:-1)}setRowTop(e){if(!this.printLayout&&P(e)){const s=this.applyPaginationOffset(e),r=`${this.rowNode.isRowPinned()||this.rowNode.sticky?s:this.beans.rowContainerHeightService.getRealPixelPosition(s)}px`;this.setRowTopStyle(r)}}getInitialRowTop(e){return this.suppressRowTransform?this.getInitialRowTopShared(e):void 0}getInitialTransform(e){return this.suppressRowTransform?void 0:`translateY(${this.getInitialRowTopShared(e)})`}getInitialRowTopShared(e){if(this.printLayout)return"";let s;if(this.isSticky())s=this.rowNode.stickyRowTop;else{const i=this.slideInAnimation[e]?this.roundRowTopToBounds(this.rowNode.oldRowTop):this.rowNode.rowTop,o=this.applyPaginationOffset(i);s=this.rowNode.isRowPinned()?o:this.beans.rowContainerHeightService.getRealPixelPosition(o)}return s+"px"}setRowTopStyle(e){this.allRowGuis.forEach(s=>this.suppressRowTransform?s.rowComp.setTop(e):s.rowComp.setTransform(`translateY(${e})`))}getRowNode(){return this.rowNode}getCellCtrl(e){let s=null;return this.getAllCellCtrls().forEach(i=>{i.getColumn()==e&&(s=i)}),s!=null||this.getAllCellCtrls().forEach(i=>{i.getColSpanningList().indexOf(e)>=0&&(s=i)}),s}onRowIndexChanged(){this.rowNode.rowIndex!=null&&(this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss())}getRowIndex(){return this.rowNode.getRowIndexString()}updateRowIndexes(e){const s=this.rowNode.getRowIndexString(),i=this.beans.headerNavigationService.getHeaderRowCount()+this.beans.filterManager.getHeaderRowCount(),o=this.rowNode.rowIndex%2===0,r=i+this.rowNode.rowIndex+1;this.forEachGui(e,n=>{n.rowComp.setRowIndex(s),n.rowComp.addOrRemoveCssClass("ag-row-even",o),n.rowComp.addOrRemoveCssClass("ag-row-odd",!o),nl(n.element,r)})}};Th.DOM_DATA_KEY_ROW_CTRL="renderedRow";var Js=Th,gt=class extends L{constructor(t){super(),this.element=t}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.mockContextMenuForIPad()}addKeyboardListeners(){const t="keydown",e=this.processKeyboardEvent.bind(this,t);this.addManagedListener(this.element,t,e)}addMouseListeners(){["dblclick","contextmenu","mouseover","mouseout","click",$n("touchstart")?"touchstart":"mousedown"].forEach(s=>{const i=this.processMouseEvent.bind(this,s);this.addManagedListener(this.element,s,i)})}processMouseEvent(t,e){if(!this.mouseEventService.isEventFromThisGrid(e)||_t(e))return;const s=this.getRowForEvent(e),i=this.mouseEventService.getRenderedCellForEvent(e);t==="contextmenu"?this.handleContextMenuMouseEvent(e,void 0,s,i):(i&&i.onMouseEvent(t,e),s&&s.onMouseEvent(t,e))}mockContextMenuForIPad(){if(!as())return;const t=new ze(this.element),e=s=>{const i=this.getRowForEvent(s.touchEvent),o=this.mouseEventService.getRenderedCellForEvent(s.touchEvent);this.handleContextMenuMouseEvent(void 0,s.touchEvent,i,o)};this.addManagedListener(t,ze.EVENT_LONG_TAP,e),this.addDestroyFunc(()=>t.destroy())}getRowForEvent(t){let e=t.target;for(;e;){const s=this.gos.getDomData(e,Js.DOM_DATA_KEY_ROW_CTRL);if(s)return s;e=e.parentElement}return null}handleContextMenuMouseEvent(t,e,s,i){const o=s?s.getRowNode():null,r=i?i.getColumn():null;let n=null;if(r){const d=t||e;i.dispatchCellContextMenuEvent(d??null),n=this.valueService.getValue(r,o)}const l=this.ctrlsService.getGridBodyCtrl(),a=i?i.getGui():l.getGridBodyElement();this.menuService.showContextMenu({mouseEvent:t,touchEvent:e,rowNode:o,column:r,value:n,anchorToElement:a})}getControlsForEventTarget(t){return{cellCtrl:Ar(this.gos,t,Xs.DOM_DATA_KEY_CELL_CTRL),rowCtrl:Ar(this.gos,t,Js.DOM_DATA_KEY_ROW_CTRL)}}processKeyboardEvent(t,e){const{cellCtrl:s,rowCtrl:i}=this.getControlsForEventTarget(e.target);e.defaultPrevented||(s?this.processCellKeyboardEvent(s,t,e):i&&i.isFullWidth()&&this.processFullWidthRowKeyboardEvent(i,t,e))}processCellKeyboardEvent(t,e,s){const i=t.getRowNode(),o=t.getColumn(),r=t.isEditing();if(!Br(this.gos,s,i,o,r)&&e==="keydown"&&(!r&&this.navigationService.handlePageScrollingKey(s)||t.onKeyDown(s),this.doGridOperations(s,t.isEditing()),kr(s)&&t.processCharacter(s)),e==="keydown"){const l=t.createEvent(s,p.EVENT_CELL_KEY_DOWN);this.eventService.dispatchEvent(l)}}processFullWidthRowKeyboardEvent(t,e,s){const i=t.getRowNode(),o=this.focusService.getFocusedCell(),r=o&&o.column;if(!Br(this.gos,s,i,r,!1)){const l=s.key;if(e==="keydown")switch(l){case E.PAGE_HOME:case E.PAGE_END:case E.PAGE_UP:case E.PAGE_DOWN:this.navigationService.handlePageScrollingKey(s,!0);break;case E.UP:case E.DOWN:t.onKeyboardNavigate(s);break;case E.TAB:t.onTabKeyDown(s);break}}if(e==="keydown"){const l=t.createRowEvent(p.EVENT_CELL_KEY_DOWN,s);this.eventService.dispatchEvent(l)}}doGridOperations(t,e){if(!t.ctrlKey&&!t.metaKey||e||!this.mouseEventService.isEventFromThisGrid(t))return;const s=Gu(t);if(s===E.A)return this.onCtrlAndA(t);if(s===E.C)return this.onCtrlAndC(t);if(s===E.D)return this.onCtrlAndD(t);if(s===E.V)return this.onCtrlAndV(t);if(s===E.X)return this.onCtrlAndX(t);if(s===E.Y)return this.onCtrlAndY();if(s===E.Z)return this.onCtrlAndZ(t)}onCtrlAndA(t){const{pinnedRowModel:e,paginationProxy:s,rangeService:i}=this;if(i&&s.isRowsToRender()){const[o,r]=[e.isEmpty("top"),e.isEmpty("bottom")],n=o?null:"top";let l,a;r?(l=null,a=this.paginationProxy.getRowCount()-1):(l="bottom",a=e.getPinnedBottomRowData().length-1);const d=this.columnModel.getAllDisplayedColumns();if(bt(d))return;i.setCellRange({rowStartIndex:0,rowStartPinned:n,rowEndIndex:a,rowEndPinned:l,columnStart:d[0],columnEnd:ie(d)})}t.preventDefault()}onCtrlAndC(t){if(!this.clipboardService||this.gos.get("enableCellTextSelection"))return;const{cellCtrl:e,rowCtrl:s}=this.getControlsForEventTarget(t.target);e!=null&&e.isEditing()||s!=null&&s.isEditing()||(t.preventDefault(),this.clipboardService.copyToClipboard())}onCtrlAndX(t){if(!this.clipboardService||this.gos.get("enableCellTextSelection")||this.gos.get("suppressCutToClipboard"))return;const{cellCtrl:e,rowCtrl:s}=this.getControlsForEventTarget(t.target);e!=null&&e.isEditing()||s!=null&&s.isEditing()||(t.preventDefault(),this.clipboardService.cutToClipboard(void 0,"ui"))}onCtrlAndV(t){const{cellCtrl:e,rowCtrl:s}=this.getControlsForEventTarget(t.target);e!=null&&e.isEditing()||s!=null&&s.isEditing()||this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.pasteFromClipboard()}onCtrlAndD(t){this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.copyRangeDown(),t.preventDefault()}onCtrlAndZ(t){this.gos.get("undoRedoCellEditing")&&(t.preventDefault(),t.shiftKey?this.undoRedoService.redo("ui"):this.undoRedoService.undo("ui"))}onCtrlAndY(){this.undoRedoService.redo("ui")}};u([f("mouseEventService")],gt.prototype,"mouseEventService",2),u([f("valueService")],gt.prototype,"valueService",2),u([f("menuService")],gt.prototype,"menuService",2),u([f("ctrlsService")],gt.prototype,"ctrlsService",2),u([f("navigationService")],gt.prototype,"navigationService",2),u([f("focusService")],gt.prototype,"focusService",2),u([f("undoRedoService")],gt.prototype,"undoRedoService",2),u([f("columnModel")],gt.prototype,"columnModel",2),u([f("paginationProxy")],gt.prototype,"paginationProxy",2),u([f("pinnedRowModel")],gt.prototype,"pinnedRowModel",2),u([he("rangeService")],gt.prototype,"rangeService",2),u([he("clipboardService")],gt.prototype,"clipboardService",2),u([M],gt.prototype,"postConstruct",1);var Mi=class extends L{constructor(t){super(),this.centerContainerCtrl=t}postConstruct(){this.ctrlsService.whenReady(t=>{this.gridBodyCtrl=t.gridBodyCtrl,this.listenForResize()}),this.addManagedListener(this.eventService,p.EVENT_SCROLLBAR_WIDTH_CHANGED,this.onScrollbarWidthChanged.bind(this)),this.addManagedPropertyListeners(["alwaysShowHorizontalScroll","alwaysShowVerticalScroll"],()=>{this.checkViewportAndScrolls()})}listenForResize(){const t=()=>this.onCenterViewportResized();this.centerContainerCtrl.registerViewportResizeListener(t),this.gridBodyCtrl.registerBodyViewportResizeListener(t)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.centerContainerCtrl.isViewportInTheDOMTree()){this.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();const t=this.centerContainerCtrl.getCenterWidth();t!==this.centerWidth&&(this.centerWidth=t,this.columnModel.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0}))}else this.bodyHeight=0}keepPinnedColumnsNarrowerThanViewport(){const t=this.gridBodyCtrl.getBodyViewportElement(),e=ks(t);if(e<=50)return;let s=this.getPinnedColumnsOverflowingViewport(e-50);const i=this.gos.getCallback("processUnpinnedColumns");s.length&&(i&&(s=i({columns:s,viewportWidth:e})),this.columnModel.setColumnsPinned(s,null,"viewportSizeFeature"))}getPinnedColumnsOverflowingViewport(t){const e=this.pinnedWidthService.getPinnedRightWidth(),s=this.pinnedWidthService.getPinnedLeftWidth(),i=e+s;if(i<t)return[];const o=[...this.columnModel.getDisplayedLeftColumns()],r=[...this.columnModel.getDisplayedRightColumns()];let n=0,l=0,a=0;const d=[];let h=i-a-t;for(;(l<o.length||n<r.length)&&h>0;){if(n<r.length){const c=r[n++];h-=c.getActualWidth(),d.push(c)}if(l<o.length&&h>0){const c=o[l++];h-=c.getActualWidth(),d.push(c)}}return d}checkViewportAndScrolls(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.getScrollFeature().checkScrollLeft()}getBodyHeight(){return this.bodyHeight}checkBodyHeight(){const t=this.gridBodyCtrl.getBodyViewportElement(),e=So(t);if(this.bodyHeight!==e){this.bodyHeight=e;const s={type:p.EVENT_BODY_HEIGHT_CHANGED};this.eventService.dispatchEvent(s)}}updateScrollVisibleService(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)}updateScrollVisibleServiceImpl(){const t={horizontalScrollShowing:this.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleService.setScrollsVisible(t)}isHorizontalScrollShowing(){return this.centerContainerCtrl.isHorizontalScrollShowing()}onHorizontalViewportChanged(){const t=this.centerContainerCtrl.getCenterWidth(),e=this.centerContainerCtrl.getViewportScrollLeft();this.columnModel.setViewportPosition(t,e)}};u([f("ctrlsService")],Mi.prototype,"ctrlsService",2),u([f("pinnedWidthService")],Mi.prototype,"pinnedWidthService",2),u([f("columnModel")],Mi.prototype,"columnModel",2),u([f("scrollVisibleService")],Mi.prototype,"scrollVisibleService",2),u([M],Mi.prototype,"postConstruct",1);var Zl=class extends L{constructor(t){super(),this.element=t}postConstruct(){this.addManagedListener(this.eventService,p.EVENT_LEFT_PINNED_WIDTH_CHANGED,this.onPinnedLeftWidthChanged.bind(this))}onPinnedLeftWidthChanged(){const t=this.pinnedWidthService.getPinnedLeftWidth(),e=t>0;$(this.element,e),Ft(this.element,t)}getWidth(){return this.pinnedWidthService.getPinnedLeftWidth()}};u([f("pinnedWidthService")],Zl.prototype,"pinnedWidthService",2),u([M],Zl.prototype,"postConstruct",1);var $l=class extends L{constructor(t){super(),this.element=t}postConstruct(){this.addManagedListener(this.eventService,p.EVENT_RIGHT_PINNED_WIDTH_CHANGED,this.onPinnedRightWidthChanged.bind(this))}onPinnedRightWidthChanged(){const t=this.pinnedWidthService.getPinnedRightWidth(),e=t>0;$(this.element,e),Ft(this.element,t)}getWidth(){return this.pinnedWidthService.getPinnedRightWidth()}};u([f("pinnedWidthService")],$l.prototype,"pinnedWidthService",2),u([M],$l.prototype,"postConstruct",1);var sn=class extends L{constructor(t,e){super(),this.eContainer=t,this.eViewport=e}postConstruct(){this.addManagedListener(this.eventService,p.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,this.onHeightChanged.bind(this))}onHeightChanged(){const t=this.maxDivHeightScaler.getUiContainerHeight(),e=t!=null?`${t}px`:"";this.eContainer.style.height=e,this.eViewport&&(this.eViewport.style.height=e)}};u([f("rowContainerHeightService")],sn.prototype,"maxDivHeightScaler",2),u([M],sn.prototype,"postConstruct",1);var on=class extends L{constructor(t){super(),this.eContainer=t}postConstruct(){if(!this.rangeService)return;this.params={eElement:this.eContainer,onDragStart:this.rangeService.onDragStart.bind(this.rangeService),onDragStop:this.rangeService.onDragStop.bind(this.rangeService),onDragging:this.rangeService.onDragging.bind(this.rangeService)},this.addManagedPropertyListener("enableRangeSelection",e=>{if(e.currentValue){this.enableFeature();return}this.disableFeature()}),this.addDestroyFunc(()=>this.disableFeature()),this.gos.get("enableRangeSelection")&&this.enableFeature()}enableFeature(){this.dragService.addDragSource(this.params)}disableFeature(){this.dragService.removeDragSource(this.params)}};u([f("dragService")],on.prototype,"dragService",2),u([he("rangeService")],on.prototype,"rangeService",2),u([M],on.prototype,"postConstruct",1);var Ii=class extends L{constructor(t,e=!1){super(),this.callback=t,this.addSpacer=e}postConstruct(){const t=this.setWidth.bind(this);this.addManagedPropertyListener("domLayout",t),this.addManagedListener(this.eventService,p.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED,t),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,t),this.addManagedListener(this.eventService,p.EVENT_LEFT_PINNED_WIDTH_CHANGED,t),this.addSpacer&&(this.addManagedListener(this.eventService,p.EVENT_RIGHT_PINNED_WIDTH_CHANGED,t),this.addManagedListener(this.eventService,p.EVENT_SCROLL_VISIBILITY_CHANGED,t),this.addManagedListener(this.eventService,p.EVENT_SCROLLBAR_WIDTH_CHANGED,t)),this.setWidth()}setWidth(){const{columnModel:t}=this,e=this.gos.isDomLayout("print"),s=t.getBodyContainerWidth(),i=t.getDisplayedColumnsLeftWidth(),o=t.getDisplayedColumnsRightWidth();let r;e?r=s+i+o:(r=s,this.addSpacer&&(this.gos.get("enableRtl")?i:o)===0&&this.scrollVisibleService.isVerticalScrollShowing()&&(r+=this.gos.getScrollbarWidth())),this.callback(r)}};u([f("columnModel")],Ii.prototype,"columnModel",2),u([f("scrollVisibleService")],Ii.prototype,"scrollVisibleService",2),u([M],Ii.prototype,"postConstruct",1);var Re=(t=>(t.LEFT="left",t.RIGHT="right",t.CENTER="center",t.FULL_WIDTH="fullWidth",t.TOP_LEFT="topLeft",t.TOP_RIGHT="topRight",t.TOP_CENTER="topCenter",t.TOP_FULL_WIDTH="topFullWidth",t.STICKY_TOP_LEFT="stickyTopLeft",t.STICKY_TOP_RIGHT="stickyTopRight",t.STICKY_TOP_CENTER="stickyTopCenter",t.STICKY_TOP_FULL_WIDTH="stickyTopFullWidth",t.STICKY_BOTTOM_LEFT="stickyBottomLeft",t.STICKY_BOTTOM_RIGHT="stickyBottomRight",t.STICKY_BOTTOM_CENTER="stickyBottomCenter",t.STICKY_BOTTOM_FULL_WIDTH="stickyBottomFullWidth",t.BOTTOM_LEFT="bottomLeft",t.BOTTOM_RIGHT="bottomRight",t.BOTTOM_CENTER="bottomCenter",t.BOTTOM_FULL_WIDTH="bottomFullWidth",t))(Re||{});function Dh(t){switch(t){case"center":case"topCenter":case"stickyTopCenter":case"bottomCenter":case"stickyBottomCenter":return"center";case"left":case"topLeft":case"stickyTopLeft":case"bottomLeft":case"stickyBottomLeft":return"left";case"right":case"topRight":case"stickyTopRight":case"bottomRight":case"stickyBottomRight":return"right";case"fullWidth":case"topFullWidth":case"stickyTopFullWidth":case"bottomFullWidth":case"stickyBottomFullWidth":return"fullWidth";default:throw Error("Invalid Row Container Type")}}var tm=Cs([["center","ag-center-cols-container"],["left","ag-pinned-left-cols-container"],["right","ag-pinned-right-cols-container"],["fullWidth","ag-full-width-container"],["topCenter","ag-floating-top-container"],["topLeft","ag-pinned-left-floating-top"],["topRight","ag-pinned-right-floating-top"],["topFullWidth","ag-floating-top-full-width-container"],["stickyTopCenter","ag-sticky-top-container"],["stickyTopLeft","ag-pinned-left-sticky-top"],["stickyTopRight","ag-pinned-right-sticky-top"],["stickyTopFullWidth","ag-sticky-top-full-width-container"],["stickyBottomCenter","ag-sticky-bottom-container"],["stickyBottomLeft","ag-pinned-left-sticky-bottom"],["stickyBottomRight","ag-pinned-right-sticky-bottom"],["stickyBottomFullWidth","ag-sticky-bottom-full-width-container"],["bottomCenter","ag-floating-bottom-container"],["bottomLeft","ag-pinned-left-floating-bottom"],["bottomRight","ag-pinned-right-floating-bottom"],["bottomFullWidth","ag-floating-bottom-full-width-container"]]),sm=Cs([["center","ag-center-cols-viewport"],["topCenter","ag-floating-top-viewport"],["stickyTopCenter","ag-sticky-top-viewport"],["bottomCenter","ag-floating-bottom-viewport"],["stickyBottomCenter","ag-sticky-bottom-viewport"]]),Zs=class bc extends L{constructor(e){super(),this.visible=!0,this.EMPTY_CTRLS=[],this.name=e,this.isFullWithContainer=this.name==="topFullWidth"||this.name==="stickyTopFullWidth"||this.name==="stickyBottomFullWidth"||this.name==="bottomFullWidth"||this.name==="fullWidth"}static getRowContainerCssClasses(e){const s=tm.get(e),i=sm.get(e);return{container:s,viewport:i}}static getPinned(e){switch(e){case"bottomLeft":case"topLeft":case"stickyTopLeft":case"stickyBottomLeft":case"left":return"left";case"bottomRight":case"topRight":case"stickyTopRight":case"stickyBottomRight":case"right":return"right";default:return null}}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.forContainers(["center"],()=>this.viewportSizeFeature=this.createManagedBean(new Mi(this)))}registerWithCtrlsService(){switch(this.name){case"fullWidth":case"topFullWidth":case"stickyTopFullWidth":case"bottomFullWidth":case"stickyBottomFullWidth":return;default:this.ctrlsService.register(this.name,this)}}forContainers(e,s){e.indexOf(this.name)>=0&&s()}getContainerElement(){return this.eContainer}getViewportSizeFeature(){return this.viewportSizeFeature}setComp(e,s,i){this.comp=e,this.eContainer=s,this.eViewport=i,this.createManagedBean(new gt(this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder(),this.stopHScrollOnPinnedRows();const o=["topCenter","topLeft","topRight"],r=["stickyTopCenter","stickyTopLeft","stickyTopRight"],n=["stickyBottomCenter","stickyBottomLeft","stickyBottomRight"],l=["bottomCenter","bottomLeft","bottomRight"],a=["center","left","right"],d=[...o,...l,...a,...r,...n],h=["center","left","right","fullWidth"],c=["center","topCenter","stickyTopCenter","bottomCenter","stickyBottomCenter"],m=["left","bottomLeft","topLeft","stickyTopLeft","stickyBottomLeft"],C=["right","bottomRight","topRight","stickyTopRight","stickyBottomRight"];this.forContainers(m,()=>{this.pinnedWidthFeature=this.createManagedBean(new Zl(this.eContainer)),this.addManagedListener(this.eventService,p.EVENT_LEFT_PINNED_WIDTH_CHANGED,()=>this.onPinnedWidthChanged())}),this.forContainers(C,()=>{this.pinnedWidthFeature=this.createManagedBean(new $l(this.eContainer)),this.addManagedListener(this.eventService,p.EVENT_RIGHT_PINNED_WIDTH_CHANGED,()=>this.onPinnedWidthChanged())}),this.forContainers(h,()=>this.createManagedBean(new sn(this.eContainer,this.name==="center"?i:void 0))),this.forContainers(d,()=>this.createManagedBean(new on(this.eContainer))),this.forContainers(c,()=>this.createManagedBean(new Ii(v=>this.comp.setContainerWidth(`${v}px`)))),this.addListeners(),this.registerWithCtrlsService()}addListeners(){this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,()=>this.onDisplayedColumnsChanged()),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,()=>this.onDisplayedColumnsWidthChanged()),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_ROWS_CHANGED,e=>this.onDisplayedRowsChanged(e.afterScroll)),this.onDisplayedColumnsChanged(),this.onDisplayedColumnsWidthChanged(),this.onDisplayedRowsChanged()}listenOnDomOrder(){if(["stickyTopCenter","stickyTopLeft","stickyTopRight","stickyTopFullWidth","stickyBottomCenter","stickyBottomLeft","stickyBottomRight","stickyBottomFullWidth"].indexOf(this.name)>=0){this.comp.setDomOrder(!0);return}const i=()=>{const o=this.gos.get("ensureDomOrder"),r=this.gos.isDomLayout("print");this.comp.setDomOrder(o||r)};this.addManagedPropertyListener("domLayout",i),i()}stopHScrollOnPinnedRows(){this.forContainers(["topCenter","stickyTopCenter","bottomCenter","stickyBottomCenter"],()=>{const e=()=>this.eViewport.scrollLeft=0;this.addManagedListener(this.eViewport,"scroll",e)})}onDisplayedColumnsChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}onDisplayedColumnsWidthChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}addPreventScrollWhileDragging(){const e=s=>{this.dragService.isDragging()&&s.cancelable&&s.preventDefault()};this.eContainer.addEventListener("touchmove",e,{passive:!1}),this.addDestroyFunc(()=>this.eContainer.removeEventListener("touchmove",e))}onHorizontalViewportChanged(e=!1){const s=this.getCenterWidth(),i=this.getCenterViewportScrollLeft();this.columnModel.setViewportPosition(s,i,e)}getCenterWidth(){return ks(this.eViewport)}getCenterViewportScrollLeft(){return Ro(this.eViewport,this.enableRtl)}registerViewportResizeListener(e){const s=this.resizeObserverService.observeResize(this.eViewport,e);this.addDestroyFunc(()=>s())}isViewportInTheDOMTree(){return Pl(this.eViewport)}getViewportScrollLeft(){return Ro(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){return this.gos.get("alwaysShowHorizontalScroll")||Tu(this.eViewport)}getViewportElement(){return this.eViewport}setContainerTranslateX(e){this.eContainer.style.transform=`translateX(${e}px)`}getHScrollPosition(){return{left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth}}setCenterViewportScrollLeft(e){bo(this.eViewport,e,this.enableRtl)}isContainerVisible(){return!bc.getPinned(this.name)||!!this.pinnedWidthFeature&&this.pinnedWidthFeature.getWidth()>0}onPinnedWidthChanged(){const e=this.isContainerVisible();this.visible!=e&&(this.visible=e,this.onDisplayedRowsChanged())}onDisplayedRowsChanged(e=!1){const s=this.getRowCtrls();if(!this.visible||s.length===0){this.comp.setRowCtrls({rowCtrls:this.EMPTY_CTRLS});return}const i=this.gos.isDomLayout("print"),r=this.gos.get("embedFullWidthRows")||i,n=s.filter(l=>{const a=l.isFullWidth();return this.isFullWithContainer?!r&&a:r||!a});this.comp.setRowCtrls({rowCtrls:n,useFlushSync:e})}getRowCtrls(){switch(this.name){case"topCenter":case"topLeft":case"topRight":case"topFullWidth":return this.rowRenderer.getTopRowCtrls();case"stickyTopCenter":case"stickyTopLeft":case"stickyTopRight":case"stickyTopFullWidth":return this.rowRenderer.getStickyTopRowCtrls();case"stickyBottomCenter":case"stickyBottomLeft":case"stickyBottomRight":case"stickyBottomFullWidth":return this.rowRenderer.getStickyBottomRowCtrls();case"bottomCenter":case"bottomLeft":case"bottomRight":case"bottomFullWidth":return this.rowRenderer.getBottomRowCtrls();default:return this.rowRenderer.getCentreRowCtrls()}}};u([f("dragService")],Zs.prototype,"dragService",2),u([f("ctrlsService")],Zs.prototype,"ctrlsService",2),u([f("columnModel")],Zs.prototype,"columnModel",2),u([f("resizeObserverService")],Zs.prototype,"resizeObserverService",2),u([f("rowRenderer")],Zs.prototype,"rowRenderer",2),u([M],Zs.prototype,"postConstruct",1);var rn=Zs,im=`<div class="ag-root ag-unselectable" role="treegrid">
178
+ <ag-header-root ref="gridHeader"></ag-header-root>
179
+ <div class="ag-floating-top" ref="eTop" role="presentation">
180
+ <ag-row-container ref="topLeftContainer" name="topLeft"></ag-row-container>
181
+ <ag-row-container ref="topCenterContainer" name="topCenter"></ag-row-container>
182
+ <ag-row-container ref="topRightContainer" name="topRight"></ag-row-container>
183
+ <ag-row-container ref="topFullWidthContainer" name="topFullWidth"></ag-row-container>
184
+ </div>
185
+ <div class="ag-body" ref="eBody" role="presentation">
186
+ <div class="ag-body-viewport" ref="eBodyViewport" role="presentation">
187
+ <ag-row-container ref="leftContainer" name="left"></ag-row-container>
188
+ <ag-row-container ref="centerContainer" name="center"></ag-row-container>
189
+ <ag-row-container ref="rightContainer" name="right"></ag-row-container>
190
+ <ag-row-container ref="fullWidthContainer" name="fullWidth"></ag-row-container>
191
+ </div>
192
+ <ag-fake-vertical-scroll></ag-fake-vertical-scroll>
193
+ </div>
194
+ <div class="ag-sticky-top" ref="eStickyTop" role="presentation">
195
+ <ag-row-container ref="stickyTopLeftContainer" name="stickyTopLeft"></ag-row-container>
196
+ <ag-row-container ref="stickyTopCenterContainer" name="stickyTopCenter"></ag-row-container>
197
+ <ag-row-container ref="stickyTopRightContainer" name="stickyTopRight"></ag-row-container>
198
+ <ag-row-container ref="stickyTopFullWidthContainer" name="stickyTopFullWidth"></ag-row-container>
199
+ </div>
200
+ <div class="ag-sticky-bottom" ref="eStickyBottom" role="presentation">
201
+ <ag-row-container ref="stickyBottomLeftContainer" name="stickyBottomLeft"></ag-row-container>
202
+ <ag-row-container ref="stickyBottomCenterContainer" name="stickyBottomCenter"></ag-row-container>
203
+ <ag-row-container ref="stickyBottomRightContainer" name="stickyBottomRight"></ag-row-container>
204
+ <ag-row-container ref="stickyBottomFullWidthContainer" name="stickyBottomFullWidth"></ag-row-container>
205
+ </div>
206
+ <div class="ag-floating-bottom" ref="eBottom" role="presentation">
207
+ <ag-row-container ref="bottomLeftContainer" name="bottomLeft"></ag-row-container>
208
+ <ag-row-container ref="bottomCenterContainer" name="bottomCenter"></ag-row-container>
209
+ <ag-row-container ref="bottomRightContainer" name="bottomRight"></ag-row-container>
210
+ <ag-row-container ref="bottomFullWidthContainer" name="bottomFullWidth"></ag-row-container>
211
+ </div>
212
+ <ag-fake-horizontal-scroll></ag-fake-horizontal-scroll>
213
+ <ag-overlay-wrapper></ag-overlay-wrapper>
214
+ </div>`,Bt=class extends K{constructor(){super(im)}init(){const e=(i,o)=>{const r=`${i}px`;o.style.minHeight=r,o.style.height=r},s={setRowAnimationCssOnBodyViewport:(i,o)=>this.setRowAnimationCssOnBodyViewport(i,o),setColumnCount:i=>au(this.getGui(),i),setRowCount:i=>lu(this.getGui(),i),setTopHeight:i=>e(i,this.eTop),setBottomHeight:i=>e(i,this.eBottom),setTopDisplay:i=>this.eTop.style.display=i,setBottomDisplay:i=>this.eBottom.style.display=i,setStickyTopHeight:i=>this.eStickyTop.style.height=i,setStickyTopTop:i=>this.eStickyTop.style.top=i,setStickyTopWidth:i=>this.eStickyTop.style.width=i,setStickyBottomHeight:i=>this.eStickyBottom.style.height=i,setStickyBottomBottom:i=>this.eStickyBottom.style.bottom=i,setStickyBottomWidth:i=>this.eStickyBottom.style.width=i,setColumnMovingCss:(i,o)=>this.addOrRemoveCssClass(i,o),updateLayoutClasses:(i,o)=>{[this.eBodyViewport.classList,this.eBody.classList].forEach(n=>{n.toggle("ag-layout-auto-height",o.autoHeight),n.toggle("ag-layout-normal",o.normal),n.toggle("ag-layout-print",o.print)}),this.addOrRemoveCssClass("ag-layout-auto-height",o.autoHeight),this.addOrRemoveCssClass("ag-layout-normal",o.normal),this.addOrRemoveCssClass("ag-layout-print",o.print)},setAlwaysVerticalScrollClass:(i,o)=>this.eBodyViewport.classList.toggle(yh,o),registerBodyViewportResizeListener:i=>{const o=this.resizeObserverService.observeResize(this.eBodyViewport,i);this.addDestroyFunc(()=>o())},setPinnedTopBottomOverflowY:i=>this.eTop.style.overflowY=this.eBottom.style.overflowY=i,setCellSelectableCss:(i,o)=>{[this.eTop,this.eBodyViewport,this.eBottom].forEach(r=>r.classList.toggle(i,o))},setBodyViewportWidth:i=>this.eBodyViewport.style.width=i};this.ctrl=this.createManagedBean(new Qe),this.ctrl.setComp(s,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop,this.eStickyBottom),(this.rangeService&&this.gos.get("enableRangeSelection")||this.gos.get("rowSelection")==="multiple")&&nu(this.getGui(),!0)}setRowAnimationCssOnBodyViewport(e,s){const i=this.eBodyViewport.classList;i.toggle("ag-row-animation",s),i.toggle("ag-row-no-animation",!s)}getFloatingTopBottom(){return[this.eTop,this.eBottom]}};u([f("resizeObserverService")],Bt.prototype,"resizeObserverService",2),u([he("rangeService")],Bt.prototype,"rangeService",2),u([I("eBodyViewport")],Bt.prototype,"eBodyViewport",2),u([I("eStickyTop")],Bt.prototype,"eStickyTop",2),u([I("eStickyBottom")],Bt.prototype,"eStickyBottom",2),u([I("eTop")],Bt.prototype,"eTop",2),u([I("eBottom")],Bt.prototype,"eBottom",2),u([I("gridHeader")],Bt.prototype,"headerRootComp",2),u([I("eBody")],Bt.prototype,"eBody",2),u([M],Bt.prototype,"init",1);var Ni=class extends L{postConstruct(){this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onDisplayedColumnsWidthChanged.bind(this))}onDisplayedColumnsChanged(){this.update()}onDisplayedColumnsWidthChanged(){this.update()}update(){this.columnAnimationService.isActive()?this.columnAnimationService.executeLaterVMTurn(()=>{this.columnAnimationService.executeLaterVMTurn(()=>this.updateImpl())}):this.updateImpl()}updateImpl(){const t=this.ctrlsService.get("center");if(!t||this.columnAnimationService.isActive())return;const e={horizontalScrollShowing:t.isHorizontalScrollShowing(),verticalScrollShowing:this.isVerticalScrollShowing()};this.setScrollsVisible(e)}setScrollsVisible(t){if(this.horizontalScrollShowing!==t.horizontalScrollShowing||this.verticalScrollShowing!==t.verticalScrollShowing){this.horizontalScrollShowing=t.horizontalScrollShowing,this.verticalScrollShowing=t.verticalScrollShowing;const s={type:p.EVENT_SCROLL_VISIBILITY_CHANGED};this.eventService.dispatchEvent(s)}}isHorizontalScrollShowing(){return this.horizontalScrollShowing}isVerticalScrollShowing(){return this.verticalScrollShowing}};u([f("ctrlsService")],Ni.prototype,"ctrlsService",2),u([f("columnAnimationService")],Ni.prototype,"columnAnimationService",2),u([M],Ni.prototype,"postConstruct",1),Ni=u([O("scrollVisibleService")],Ni);var cs=class extends L{constructor(){super(...arguments),this.gridInstanceId=cs.gridInstanceSequence.next()}stampTopLevelGridCompWithGridInstance(t){t[cs.GRID_DOM_KEY]=this.gridInstanceId}getRenderedCellForEvent(t){return Ar(this.gos,t.target,Xs.DOM_DATA_KEY_CELL_CTRL)}isEventFromThisGrid(t){return this.isElementInThisGrid(t.target)}isElementInThisGrid(t){let e=t;for(;e;){const s=e[cs.GRID_DOM_KEY];if(P(s))return s===this.gridInstanceId;e=e.parentElement}return!1}getCellPositionForEvent(t){const e=this.getRenderedCellForEvent(t);return e?e.getCellPosition():null}getNormalisedPosition(t){const e=this.gos.isDomLayout("normal"),s=t;let i,o;if(s.clientX!=null||s.clientY!=null?(i=s.clientX,o=s.clientY):(i=s.x,o=s.y),e){const r=this.ctrlsService.getGridBodyCtrl(),n=r.getScrollFeature().getVScrollPosition(),l=r.getScrollFeature().getHScrollPosition();i+=l.left,o+=n.top}return{x:i,y:o}}};cs.gridInstanceSequence=new Fi,cs.GRID_DOM_KEY="__ag_grid_instance",u([f("ctrlsService")],cs.prototype,"ctrlsService",2),cs=u([O("mouseEventService")],cs);var Xe=class extends L{constructor(){super(),this.onPageDown=Kn(this.onPageDown,100),this.onPageUp=Kn(this.onPageUp,100)}postConstruct(){this.ctrlsService.whenReady(t=>{this.gridBodyCon=t.gridBodyCtrl})}handlePageScrollingKey(t,e=!1){const s=t.key,i=t.altKey,o=t.ctrlKey||t.metaKey,r=!!this.rangeService&&t.shiftKey,n=this.mouseEventService.getCellPositionForEvent(t);let l=!1;switch(s){case E.PAGE_HOME:case E.PAGE_END:!o&&!i&&(this.onHomeOrEndKey(s),l=!0);break;case E.LEFT:case E.RIGHT:case E.UP:case E.DOWN:if(!n)return!1;o&&!i&&!r&&(this.onCtrlUpDownLeftRight(s,n),l=!0);break;case E.PAGE_DOWN:case E.PAGE_UP:!o&&!i&&(l=this.handlePageUpDown(s,n,e));break}return l&&t.preventDefault(),l}handlePageUpDown(t,e,s){return s&&(e=this.focusService.getFocusedCell()),e?(t===E.PAGE_UP?this.onPageUp(e):this.onPageDown(e),!0):!1}navigateTo(t){var e;const{scrollIndex:s,scrollType:i,scrollColumn:o,focusIndex:r,focusColumn:n}=t;P(o)&&!o.isPinned()&&this.gridBodyCon.getScrollFeature().ensureColumnVisible(o),P(s)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(s,i),t.isAsync||this.gridBodyCon.getScrollFeature().ensureIndexVisible(r),this.focusService.setFocusedCell({rowIndex:r,column:n,rowPinned:null,forceBrowserFocus:!0}),(e=this.rangeService)==null||e.setRangeToCell({rowIndex:r,rowPinned:null,column:n})}onPageDown(t){const s=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),i=this.getViewportHeight(),o=this.paginationProxy.getPixelOffset(),r=s.top+i,n=this.paginationProxy.getRowIndexAtPixel(r+o);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(t,n):this.navigateToNextPage(t,n)}onPageUp(t){const s=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),i=this.paginationProxy.getPixelOffset(),o=s.top,r=this.paginationProxy.getRowIndexAtPixel(o+i);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(t,r,!0):this.navigateToNextPage(t,r,!0)}navigateToNextPage(t,e,s=!1){const i=this.getViewportHeight(),o=this.paginationProxy.getPageFirstRow(),r=this.paginationProxy.getPageLastRow(),n=this.paginationProxy.getPixelOffset(),l=this.paginationProxy.getRow(t.rowIndex),a=s?(l==null?void 0:l.rowHeight)-i-n:i-n,d=(l==null?void 0:l.rowTop)+a;let h=this.paginationProxy.getRowIndexAtPixel(d+n);if(h===t.rowIndex){const m=s?-1:1;e=h=t.rowIndex+m}let c;s?(c="bottom",h<o&&(h=o),e<o&&(e=o)):(c="top",h>r&&(h=r),e>r&&(e=r)),this.isRowTallerThanView(h)&&(e=h,c="top"),this.navigateTo({scrollIndex:e,scrollType:c,scrollColumn:null,focusIndex:h,focusColumn:t.column})}navigateToNextPageWithAutoHeight(t,e,s=!1){this.navigateTo({scrollIndex:e,scrollType:s?"bottom":"top",scrollColumn:null,focusIndex:e,focusColumn:t.column}),setTimeout(()=>{const i=this.getNextFocusIndexForAutoHeight(t,s);this.navigateTo({scrollIndex:e,scrollType:s?"bottom":"top",scrollColumn:null,focusIndex:i,focusColumn:t.column,isAsync:!0})},50)}getNextFocusIndexForAutoHeight(t,e=!1){var s;const i=e?-1:1,o=this.getViewportHeight(),r=this.paginationProxy.getPageLastRow();let n=0,l=t.rowIndex;for(;l>=0&&l<=r;){const a=this.paginationProxy.getRow(l);if(a){const d=(s=a.rowHeight)!=null?s:0;if(n+d>o)break;n+=d}l+=i}return Math.max(0,Math.min(l,r))}getViewportHeight(){const{gridBodyCtrl:t,center:e}=this.ctrlsService.getParams(),s=t.getScrollFeature().getVScrollPosition(),i=this.gos.getScrollbarWidth();let o=s.bottom-s.top;return e.isHorizontalScrollShowing()&&(o-=i),o}isRowTallerThanView(t){const e=this.paginationProxy.getRow(t);if(!e)return!1;const s=e.rowHeight;return typeof s!="number"?!1:s>this.getViewportHeight()}onCtrlUpDownLeftRight(t,e){const s=this.cellNavigationService.getNextCellToFocus(t,e,!0),{rowIndex:i,column:o}=s;this.navigateTo({scrollIndex:i,scrollType:null,scrollColumn:o,focusIndex:i,focusColumn:o})}onHomeOrEndKey(t){const e=t===E.PAGE_HOME,s=this.columnModel.getAllDisplayedColumns(),i=e?s[0]:ie(s),o=e?this.paginationProxy.getPageFirstRow():this.paginationProxy.getPageLastRow();this.navigateTo({scrollIndex:o,scrollType:null,scrollColumn:i,focusIndex:o,focusColumn:i})}onTabKeyDown(t,e){const s=e.shiftKey,i=this.tabToNextCellCommon(t,s,e);if(i!==!1){i&&e.preventDefault();return}if(s){const{rowIndex:o,rowPinned:r}=t.getRowPosition();(r?o===0:o===this.paginationProxy.getPageFirstRow())&&(this.gos.get("headerHeight")===0||this.gos.get("suppressHeaderFocus")?this.focusService.focusNextGridCoreContainer(!0,!0):(e.preventDefault(),this.focusService.focusPreviousFromFirstCell(e)))}else t instanceof Xs&&t.focusCell(!0),this.focusService.focusNextGridCoreContainer(s)&&e.preventDefault()}tabToNextCell(t,e){const s=this.focusService.getFocusedCell();if(!s)return!1;let i=this.getCellByPosition(s);return!i&&(i=this.rowRenderer.getRowByPosition(s),!i||!i.isFullWidth())?!1:!!this.tabToNextCellCommon(i,t,e)}tabToNextCellCommon(t,e,s){let i=t.isEditing();if(!i&&t instanceof Xs){const n=t.getRowCtrl();n&&(i=n.isEditing())}let o;return i?this.gos.get("editType")==="fullRow"?o=this.moveToNextEditingRow(t,e,s):o=this.moveToNextEditingCell(t,e,s):o=this.moveToNextCellNotEditing(t,e),o===null?o:o||!!this.focusService.getFocusedHeader()}moveToNextEditingCell(t,e,s=null){const i=t.getCellPosition();t.getGui().focus(),t.stopEditing();const o=this.findNextCellToFocusOn(i,e,!0);return o===!1?null:o==null?!1:(o.startEditing(null,!0,s),o.focusCell(!1),!0)}moveToNextEditingRow(t,e,s=null){const i=t.getCellPosition(),o=this.findNextCellToFocusOn(i,e,!0);if(o===!1)return null;if(o==null)return!1;const r=o.getCellPosition(),n=this.isCellEditable(i),l=this.isCellEditable(r),a=r&&i.rowIndex===r.rowIndex&&i.rowPinned===r.rowPinned;return n&&t.setFocusOutOnEditor(),a||(t.getRowCtrl().stopEditing(),o.getRowCtrl().startRowEditing(void 0,void 0,s)),l?(o.setFocusInOnEditor(),o.focusCell()):o.focusCell(!0),!0}moveToNextCellNotEditing(t,e){const s=this.columnModel.getAllDisplayedColumns();let i;t instanceof Js?i=Ee(_({},t.getRowPosition()),{column:e?s[0]:ie(s)}):i=t.getCellPosition();const o=this.findNextCellToFocusOn(i,e,!1);if(o===!1)return null;if(o instanceof Xs)o.focusCell(!0);else if(o)return this.tryToFocusFullWidthRow(o.getRowPosition(),e);return P(o)}findNextCellToFocusOn(t,e,s){var i;let o=t;for(;;){t!==o&&(t=o),e||(o=this.getLastCellOfColSpan(o)),o=this.cellNavigationService.getNextTabbedCell(o,e);const r=this.gos.getCallback("tabToNextCell");if(P(r)){const d=r({backwards:e,editing:s,previousCellPosition:t,nextCellPosition:o||null});if(d===!0||d===null)d===null&&H("Returning `null` from tabToNextCell is deprecated. Return `true` to stay on the current cell, or `false` to let the browser handle the tab behaviour."),o=t;else{if(d===!1)return!1;d.floating&&(H("tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?"),d.rowPinned=d.floating),o={rowIndex:d.rowIndex,column:d.column,rowPinned:d.rowPinned}}}if(!o)return null;if(o.rowIndex<0){const a=this.headerNavigationService.getHeaderRowCount();return this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:a+o.rowIndex,column:o.column},fromCell:!0}),null}const n=this.gos.get("editType")==="fullRow";if(s&&!n&&!this.isCellEditable(o))continue;this.ensureCellVisible(o);const l=this.getCellByPosition(o);if(!l){const a=this.rowRenderer.getRowByPosition(o);if(!a||!a.isFullWidth()||s)continue;return a}if(!l.isSuppressNavigable())return(i=this.rangeService)==null||i.setRangeToCell(o),l}}isCellEditable(t){const e=this.lookupRowNodeForCell(t);return e?t.column.isCellEditable(e):!1}getCellByPosition(t){const e=this.rowRenderer.getRowByPosition(t);return e?e.getCellCtrl(t.column):null}lookupRowNodeForCell(t){return t.rowPinned==="top"?this.pinnedRowModel.getPinnedTopRow(t.rowIndex):t.rowPinned==="bottom"?this.pinnedRowModel.getPinnedBottomRow(t.rowIndex):this.paginationProxy.getRow(t.rowIndex)}navigateToNextCell(t,e,s,i){let o=s,r=!1;for(;o&&(o===s||!this.isValidNavigateCell(o));)this.gos.get("enableRtl")?e===E.LEFT&&(o=this.getLastCellOfColSpan(o)):e===E.RIGHT&&(o=this.getLastCellOfColSpan(o)),o=this.cellNavigationService.getNextCellToFocus(e,o),r=z(o);if(r&&t&&t.key===E.UP&&(o={rowIndex:-1,rowPinned:null,column:s.column}),i){const l=this.gos.getCallback("navigateToNextCell");if(P(l)){const d=l({key:e,previousCellPosition:s,nextCellPosition:o||null,event:t});P(d)?(d.floating&&(H("tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?"),d.rowPinned=d.floating),o={rowPinned:d.rowPinned,rowIndex:d.rowIndex,column:d.column}):o=null}}if(!o)return;if(o.rowIndex<0){const l=this.headerNavigationService.getHeaderRowCount();this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:l+o.rowIndex,column:s.column},event:t||void 0,fromCell:!0});return}const n=this.getNormalisedPosition(o);n?this.focusPosition(n):this.tryToFocusFullWidthRow(o)}getNormalisedPosition(t){this.ensureCellVisible(t);const e=this.getCellByPosition(t);return e?(t=e.getCellPosition(),this.ensureCellVisible(t),t):null}tryToFocusFullWidthRow(t,e=!1){const s=this.columnModel.getAllDisplayedColumns(),i=this.rowRenderer.getRowByPosition(t);if(!i||!i.isFullWidth())return!1;const o=this.focusService.getFocusedCell(),r={rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:t.column||(e?ie(s):s[0])};this.focusPosition(r);const n=o!=null?this.rowPositionUtils.before(r,o):!1,l={type:p.EVENT_FULL_WIDTH_ROW_FOCUSED,rowIndex:r.rowIndex,rowPinned:r.rowPinned,column:r.column,isFullWidthCell:!0,floating:r.rowPinned,fromBelow:n};return this.eventService.dispatchEvent(l),!0}focusPosition(t){var e;this.focusService.setFocusedCell({rowIndex:t.rowIndex,column:t.column,rowPinned:t.rowPinned,forceBrowserFocus:!0}),(e=this.rangeService)==null||e.setRangeToCell(t)}isValidNavigateCell(t){return!!this.rowPositionUtils.getRowNode(t)}getLastCellOfColSpan(t){const e=this.getCellByPosition(t);if(!e)return t;const s=e.getColSpanningList();return s.length===1?t:{rowIndex:t.rowIndex,column:ie(s),rowPinned:t.rowPinned}}ensureCellVisible(t){const e=this.gos.isGroupRowsSticky(),s=this.rowModel.getRow(t.rowIndex);!(e&&(s==null?void 0:s.sticky))&&z(t.rowPinned)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(t.rowIndex),t.column.isPinned()||this.gridBodyCon.getScrollFeature().ensureColumnVisible(t.column)}};u([f("mouseEventService")],Xe.prototype,"mouseEventService",2),u([f("paginationProxy")],Xe.prototype,"paginationProxy",2),u([f("focusService")],Xe.prototype,"focusService",2),u([f("columnModel")],Xe.prototype,"columnModel",2),u([f("rowModel")],Xe.prototype,"rowModel",2),u([f("ctrlsService")],Xe.prototype,"ctrlsService",2),u([f("rowRenderer")],Xe.prototype,"rowRenderer",2),u([f("headerNavigationService")],Xe.prototype,"headerNavigationService",2),u([f("rowPositionUtils")],Xe.prototype,"rowPositionUtils",2),u([f("cellNavigationService")],Xe.prototype,"cellNavigationService",2),u([f("pinnedRowModel")],Xe.prototype,"pinnedRowModel",2),u([he("rangeService")],Xe.prototype,"rangeService",2),u([M],Xe.prototype,"postConstruct",1),Xe=u([O("navigationService")],Xe);var ea=class Tc extends zs{constructor(e){super('<div class="ag-popup-editor" tabindex="-1"/>'),this.params=e}postConstruct(){this.gos.setDomData(this.getGui(),Tc.DOM_KEY_POPUP_EDITOR_WRAPPER,!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),s=this.params,i=o=>{Br(this.gos,o,s.node,s.column,!0)||s.onKeyDown(o)};this.addManagedListener(e,"keydown",i)}};ea.DOM_KEY_POPUP_EDITOR_WRAPPER="popupEditorWrapper",u([M],ea.prototype,"postConstruct",1);var Ah=ea,om=class extends K{constructor(e,s,i,o,r){super(),this.rendererVersion=0,this.editorVersion=0,this.beans=e,this.column=s.getColumn(),this.rowNode=s.getRowNode(),this.rowCtrl=s.getRowCtrl(),this.eRow=o,this.cellCtrl=s;const n=document.createElement("div");n.setAttribute("comp-id",`${this.getCompId()}`),this.setTemplateFromElement(n);const l=this.getGui();this.forceWrapper=s.isForceWrapper(),this.refreshWrapper(!1);const a=(c,m)=>{m!=null&&m!=""?l.setAttribute(c,m):l.removeAttribute(c)};Ae(l,s.getCellAriaRole()),a("col-id",s.getColumnIdSanitised());const d=s.getTabIndex();d!==void 0&&a("tabindex",d.toString());const h={addOrRemoveCssClass:(c,m)=>this.addOrRemoveCssClass(c,m),setUserStyles:c=>Ml(l,c),getFocusableElement:()=>this.getFocusableElement(),setIncludeSelection:c=>this.includeSelection=c,setIncludeRowDrag:c=>this.includeRowDrag=c,setIncludeDndSource:c=>this.includeDndSource=c,setRenderDetails:(c,m,C)=>this.setRenderDetails(c,m,C),setEditDetails:(c,m,C)=>this.setEditDetails(c,m,C),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue()};s.setComp(h,this.getGui(),this.eCellWrapper,i,r)}getParentOfValue(){return this.eCellValue?this.eCellValue:this.eCellWrapper?this.eCellWrapper:this.getGui()}setRenderDetails(e,s,i){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=this.firstRender==null;const r=this.refreshWrapper(!1);this.refreshEditStyles(!1),e?!(i||r)&&this.refreshCellRenderer(e)||(this.destroyRenderer(),this.createCellRendererInstance(e)):(this.destroyRenderer(),this.insertValueWithoutCellRenderer(s))}setEditDetails(e,s,i){e?this.createCellEditorInstance(e,s,i):this.destroyEditor()}removeControls(){this.checkboxSelectionComp=this.beans.context.destroyBean(this.checkboxSelectionComp),this.dndSourceComp=this.beans.context.destroyBean(this.dndSourceComp),this.rowDraggingComp=this.beans.context.destroyBean(this.rowDraggingComp)}refreshWrapper(e){const s=this.includeRowDrag||this.includeDndSource||this.includeSelection,i=s||this.forceWrapper,o=i&&this.eCellWrapper==null;if(o){const h=document.createElement("div");h.setAttribute("role","presentation"),h.setAttribute("class","ag-cell-wrapper"),this.eCellWrapper=h,this.getGui().appendChild(this.eCellWrapper)}const r=!i&&this.eCellWrapper!=null;r&&(Vt(this.eCellWrapper),this.eCellWrapper=void 0),this.addOrRemoveCssClass("ag-cell-value",!i);const n=!e&&i,l=n&&this.eCellValue==null;if(l){const h=document.createElement("span");h.setAttribute("role","presentation"),h.setAttribute("class","ag-cell-value"),this.eCellValue=h,this.eCellWrapper.appendChild(this.eCellValue)}const a=!n&&this.eCellValue!=null;a&&(Vt(this.eCellValue),this.eCellValue=void 0);const d=o||r||l||a;return d&&this.removeControls(),e||s&&this.addControls(),d}addControls(){this.includeRowDrag&&this.rowDraggingComp==null&&(this.rowDraggingComp=this.cellCtrl.createRowDragComp(),this.rowDraggingComp&&this.eCellWrapper.insertBefore(this.rowDraggingComp.getGui(),this.eCellValue)),this.includeDndSource&&this.dndSourceComp==null&&(this.dndSourceComp=this.cellCtrl.createDndSource(),this.eCellWrapper.insertBefore(this.dndSourceComp.getGui(),this.eCellValue)),this.includeSelection&&this.checkboxSelectionComp==null&&(this.checkboxSelectionComp=this.cellCtrl.createSelectionCheckbox(),this.eCellWrapper.insertBefore(this.checkboxSelectionComp.getGui(),this.eCellValue))}createCellEditorInstance(e,s,i){const o=this.editorVersion,r=e.newAgStackInstance();if(!r)return;const{params:n}=e;r.then(a=>this.afterCellEditorCreated(o,a,n,s,i)),z(this.cellEditor)&&n.cellStartedEdit&&this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(e){const s=this.getParentOfValue();Le(s);const i=e!=null?Ne(e,!0):null;i!=null&&(s.textContent=i)}destroyEditorAndRenderer(){this.destroyRenderer(),this.destroyEditor()}destroyRenderer(){const{context:e}=this.beans;this.cellRenderer=e.destroyBean(this.cellRenderer),Vt(this.cellRendererGui),this.cellRendererGui=null,this.rendererVersion++}destroyEditor(){const{context:e}=this.beans;this.hideEditorPopup&&this.hideEditorPopup(),this.hideEditorPopup=void 0,this.cellEditor=e.destroyBean(this.cellEditor),this.cellEditorPopupWrapper=e.destroyBean(this.cellEditorPopupWrapper),Vt(this.cellEditorGui),this.cellEditorGui=null,this.editorVersion++}refreshCellRenderer(e){if(this.cellRenderer==null||this.cellRenderer.refresh==null||this.cellRendererClass!==e.componentClass)return!1;const s=this.cellRenderer.refresh(e.params);return s===!0||s===void 0}createCellRendererInstance(e){const i=!this.beans.gos.get("suppressAnimationFrame"),o=this.rendererVersion,{componentClass:r}=e,n=()=>{if(this.rendererVersion!==o||!this.isAlive())return;const a=e.newAgStackInstance(),d=this.afterCellRendererCreated.bind(this,o,r);a&&a.then(d)};i&&this.firstRender?this.beans.animationFrameService.createTask(n,this.rowNode.rowIndex,"createTasksP2"):n()}getCtrl(){return this.cellCtrl}getRowCtrl(){return this.rowCtrl}getCellRenderer(){return this.cellRenderer}getCellEditor(){return this.cellEditor}afterCellRendererCreated(e,s,i){if(!this.isAlive()||e!==this.rendererVersion){this.beans.context.destroyBean(i);return}if(this.cellRenderer=i,this.cellRendererClass=s,this.cellRendererGui=this.cellRenderer.getGui(),this.cellRendererGui!=null){const r=this.getParentOfValue();Le(r),r.appendChild(this.cellRendererGui)}}afterCellEditorCreated(e,s,i,o,r){if(e!==this.editorVersion){this.beans.context.destroyBean(s);return}if(s.isCancelBeforeStart&&s.isCancelBeforeStart()){this.beans.context.destroyBean(s),this.cellCtrl.stopEditing(!0);return}if(!s.getGui){console.warn(`AG Grid: cellEditor for column ${this.column.getId()} is missing getGui() method`),this.beans.context.destroyBean(s);return}this.cellEditor=s,this.cellEditorGui=s.getGui();const a=o||s.isPopup!==void 0&&s.isPopup();a?this.addPopupCellEditor(i,r):this.addInCellEditor(),this.refreshEditStyles(!0,a),s.afterGuiAttached&&s.afterGuiAttached()}refreshEditStyles(e,s){var i;this.addOrRemoveCssClass("ag-cell-inline-editing",e&&!s),this.addOrRemoveCssClass("ag-cell-popup-editing",e&&!!s),this.addOrRemoveCssClass("ag-cell-not-inline-editing",!e||!!s),(i=this.rowCtrl)==null||i.setInlineEditingCss(e)}addInCellEditor(){const e=this.getGui();e.contains(this.beans.gos.getActiveDomElement())&&e.focus(),this.destroyRenderer(),this.refreshWrapper(!0),this.clearParentOfValue(),this.cellEditorGui&&this.getParentOfValue().appendChild(this.cellEditorGui)}addPopupCellEditor(e,s){this.beans.gos.get("editType")==="fullRow"&&console.warn("AG Grid: popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.");const i=this.cellEditor;this.cellEditorPopupWrapper=this.beans.context.createBean(new Ah(e));const o=this.cellEditorPopupWrapper.getGui();this.cellEditorGui&&o.appendChild(this.cellEditorGui);const r=this.beans.popupService,n=this.beans.gos.get("stopEditingWhenCellsLoseFocus"),l=s??(i.getPopupPosition?i.getPopupPosition():"over"),a=this.beans.gos.get("enableRtl"),d={ePopup:o,column:this.column,rowNode:this.rowNode,type:"popupCellEditor",eventSource:this.getGui(),position:l,alignSide:a?"right":"left",keepWithinBounds:!0},h=r.positionPopupByComponent.bind(r,d),c=this.beans.localeService.getLocaleTextFunc(),m=r.addPopup({modal:n,eChild:o,closeOnEsc:!0,closedCallback:()=>{this.cellCtrl.onPopupEditorClosed()},anchorToElement:this.getGui(),positionCallback:h,ariaLabel:c("ariaLabelCellEditor","Cell Editor")});m&&(this.hideEditorPopup=m.hideFunc)}detach(){this.eRow.removeChild(this.getGui())}destroy(){this.cellCtrl.stopEditing(),this.destroyEditorAndRenderer(),this.removeControls(),super.destroy()}clearParentOfValue(){const e=this.getGui();e.contains(this.beans.gos.getActiveDomElement())&&wl()&&e.focus({preventScroll:!0}),Le(this.getParentOfValue())}},rm=class extends K{constructor(e,s,i){super(),this.cellComps={},this.beans=s,this.rowCtrl=e;const o=document.createElement("div");o.setAttribute("comp-id",`${this.getCompId()}`),o.setAttribute("style",this.getInitialStyle(i)),this.setTemplateFromElement(o);const r=this.getGui(),n=r.style;this.domOrder=this.rowCtrl.getDomOrder(),Ae(r,"row");const l=this.rowCtrl.getTabIndex();l!=null&&r.setAttribute("tabindex",l.toString());const a={setDomOrder:d=>this.domOrder=d,setCellCtrls:d=>this.setCellCtrls(d),showFullWidth:d=>this.showFullWidth(d),getFullWidthCellRenderer:()=>this.getFullWidthCellRenderer(),addOrRemoveCssClass:(d,h)=>this.addOrRemoveCssClass(d,h),setUserStyles:d=>Ml(r,d),setTop:d=>n.top=d,setTransform:d=>n.transform=d,setRowIndex:d=>r.setAttribute("row-index",d),setRowId:d=>r.setAttribute("row-id",d),setRowBusinessKey:d=>r.setAttribute("row-business-key",d),refreshFullWidth:d=>this.refreshFullWidth(d)};e.setComp(a,this.getGui(),i),this.addDestroyFunc(()=>{e.unsetComp(i)})}getInitialStyle(e){const s=this.rowCtrl.getInitialTransform(e);return s?`transform: ${s}`:`top: ${this.rowCtrl.getInitialRowTop(e)}`}showFullWidth(e){const s=o=>{if(this.isAlive()){const r=o.getGui();this.getGui().appendChild(r),this.rowCtrl.setupDetailRowAutoHeight(r),this.setFullWidthRowComp(o)}else this.beans.context.destroyBean(o)},i=e.newAgStackInstance();i&&i.then(s)}setCellCtrls(e){const s=Object.assign({},this.cellComps);e.forEach(o=>{const r=o.getInstanceId();this.cellComps[r]==null?this.newCellComp(o):s[r]=null});const i=ms(s).filter(o=>o!=null);this.destroyCells(i),this.ensureDomOrder(e)}ensureDomOrder(e){if(!this.domOrder)return;const s=[];e.forEach(i=>{const o=this.cellComps[i.getInstanceId()];o&&s.push(o.getGui())}),Ll(this.getGui(),s)}newCellComp(e){const s=new om(this.beans,e,this.rowCtrl.isPrintLayout(),this.getGui(),this.rowCtrl.isEditing());this.cellComps[e.getInstanceId()]=s,this.getGui().appendChild(s.getGui())}destroy(){super.destroy(),this.destroyAllCells()}destroyAllCells(){const e=ms(this.cellComps).filter(s=>s!=null);this.destroyCells(e)}setFullWidthRowComp(e){this.fullWidthCellRenderer&&console.error("AG Grid - should not be setting fullWidthRowComponent twice"),this.fullWidthCellRenderer=e,this.addDestroyFunc(()=>{this.fullWidthCellRenderer=this.beans.context.destroyBean(this.fullWidthCellRenderer)})}getFullWidthCellRenderer(){return this.fullWidthCellRenderer}destroyCells(e){e.forEach(s=>{if(!s)return;const i=s.getCtrl().getInstanceId();this.cellComps[i]===s&&(s.detach(),s.destroy(),this.cellComps[i]=null)})}refreshFullWidth(e){const{fullWidthCellRenderer:s}=this;if(!s||!s.refresh)return!1;const i=e();return s.refresh(i)}};function nm(){const t=K.elementGettingCreated.getAttribute("name"),e=rn.getRowContainerCssClasses(t);let s;return t==="center"||t==="topCenter"||t==="stickyTopCenter"||t==="bottomCenter"||t==="stickyBottomCenter"?s=`<div class="${e.viewport}" ref="eViewport" role="presentation">
215
+ <div class="${e.container}" ref="eContainer"></div>
216
+ </div>`:s=`<div class="${e.container}" ref="eContainer"></div>`,s}var xi=class extends K{constructor(){super(nm()),this.rowComps={},this.name=K.elementGettingCreated.getAttribute("name"),this.type=Dh(this.name)}postConstruct(){const e={setViewportHeight:i=>this.eViewport.style.height=i,setRowCtrls:({rowCtrls:i})=>this.setRowCtrls(i),setDomOrder:i=>{this.domOrder=i},setContainerWidth:i=>this.eContainer.style.width=i};this.createManagedBean(new rn(this.name)).setComp(e,this.eContainer,this.eViewport)}preDestroy(){this.setRowCtrls([])}setRowCtrls(e){const s=_({},this.rowComps);this.rowComps={},this.lastPlacedElement=null;const i=o=>{const r=o.getInstanceId(),n=s[r];if(n)this.rowComps[r]=n,delete s[r],this.ensureDomOrder(n.getGui());else{if(!o.getRowNode().displayed)return;const l=new rm(o,this.beans,this.type);this.rowComps[r]=l,this.appendRow(l.getGui())}};e.forEach(i),ms(s).forEach(o=>{this.eContainer.removeChild(o.getGui()),o.destroy()}),Ae(this.eContainer,"rowgroup")}appendRow(e){this.domOrder?bu(this.eContainer,e,this.lastPlacedElement):this.eContainer.appendChild(e),this.lastPlacedElement=e}ensureDomOrder(e){this.domOrder&&(Fl(this.eContainer,e,this.lastPlacedElement),this.lastPlacedElement=e)}};u([f("beans")],xi.prototype,"beans",2),u([I("eViewport")],xi.prototype,"eViewport",2),u([I("eContainer")],xi.prototype,"eContainer",2),u([M],xi.prototype,"postConstruct",1),u([tt],xi.prototype,"preDestroy",1);var ta=class{constructor(t){this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[],this.pinned=t}onDragEnter(t){if(this.clearColumnsList(),this.gos.get("functionsReadOnly"))return;const e=t.dragItem.columns;e&&e.forEach(s=>{s.isPrimary()&&(s.isAnyFunctionActive()||(s.isAllowValue()?this.columnsToAggregate.push(s):s.isAllowRowGroup()?this.columnsToGroup.push(s):s.isAllowPivot()&&this.columnsToPivot.push(s)))})}getIconName(){return this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length>0?this.pinned?j.ICON_PINNED:j.ICON_MOVE:null}onDragLeave(t){this.clearColumnsList()}clearColumnsList(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0}onDragging(t){}onDragStop(t){this.columnsToAggregate.length>0&&this.columnModel.addValueColumns(this.columnsToAggregate,"toolPanelDragAndDrop"),this.columnsToGroup.length>0&&this.columnModel.addRowGroupColumns(this.columnsToGroup,"toolPanelDragAndDrop"),this.columnsToPivot.length>0&&this.columnModel.addPivotColumns(this.columnsToPivot,"toolPanelDragAndDrop")}};u([f("columnModel")],ta.prototype,"columnModel",2),u([f("gridOptionsService")],ta.prototype,"gos",2);var $s=class{static attemptMoveColumns(t){const{isFromHeader:e,hDirection:s,xPosition:i,fromEnter:o,fakeEvent:r,pinned:n,gos:l,columnModel:a}=t,d=s===0,h=s===1;let{allMovingColumns:c}=t;if(e){let T=[];c.forEach(D=>{var A;let F=null,k=D.getParent();for(;k!=null&&k.getDisplayedLeafColumns().length===1;)F=k,k=k.getParent();F!=null?(!!((A=F.getColGroupDef())!=null&&A.marryChildren)?F.getProvidedColumnGroup().getLeafColumns():F.getLeafColumns()).forEach(G=>{T.includes(G)||T.push(G)}):T.includes(D)||T.push(D)}),c=T}const m=c.slice();a.sortColumnsLikeGridColumns(m);const C=this.calculateValidMoves({movingCols:m,draggingRight:h,xPosition:i,pinned:n,gos:l,columnModel:a}),v=this.calculateOldIndex(m,a);if(C.length===0)return;const S=C[0];let w=v!==null&&!o;if(e&&(w=v!==null),w&&!r&&(d&&S>=v||h&&S<=v))return;const R=a.getAllDisplayedColumns();let y=[],b=null;for(let T=0;T<C.length;T++){const D=C[T],A=a.getProposedColumnOrder(m,D);if(!a.doesOrderPassRules(A))continue;const F=A.filter(x=>R.includes(x));if(b===null)b=F;else if(!jt(F,b))break;const k=this.groupFragCount(A);y.push({move:D,fragCount:k})}if(y.length!==0)return y.sort((T,D)=>T.fragCount-D.fragCount),this.moveColumns(c,y[0].move,"uiColumnMoved",!1,a)}static moveColumns(t,e,s,i,o){return o.moveColumns(t,e,s,i),i?null:{columns:t,toIndex:e}}static calculateOldIndex(t,e){const s=e.getAllGridColumns(),i=Vd(t.map(a=>s.indexOf(a))),o=i[0];return ie(i)-o!==i.length-1?null:o}static groupFragCount(t){function e(i){let o=[],r=i.getOriginalParent();for(;r!=null;)o.push(r),r=r.getOriginalParent();return o}let s=0;for(let i=0;i<t.length-1;i++){let o=e(t[i]),r=e(t[i+1]);[o,r]=o.length>r.length?[o,r]:[r,o],o.forEach(n=>{r.indexOf(n)===-1&&s++})}return s}static getDisplayedColumns(t,e){switch(e){case"left":return t.getDisplayedLeftColumns();case"right":return t.getDisplayedRightColumns();default:return t.getDisplayedCenterColumns()}}static calculateValidMoves(t){const{movingCols:e,draggingRight:s,xPosition:i,pinned:o,gos:r,columnModel:n}=t;if(r.get("suppressMovableColumns")||e.some(y=>y.getColDef().suppressMovable))return[];const a=this.getDisplayedColumns(n,o),d=n.getAllGridColumns(),h=a.filter(y=>wt(e,y)),c=a.filter(y=>!wt(e,y)),m=d.filter(y=>!wt(e,y));let C=0,v=i;if(s){let y=0;h.forEach(b=>y+=b.getActualWidth()),v-=y}if(v>0){for(let y=0;y<c.length;y++){const b=c[y];if(v-=b.getActualWidth(),v<0)break;C++}s&&C++}let S;if(C>0){const y=c[C-1];S=m.indexOf(y)+1}else S=m.indexOf(c[0]),S===-1&&(S=0);const w=[S],R=(y,b)=>y-b;if(s){let y=S+1;const b=d.length-1;for(;y<=b;)w.push(y),y++;w.sort(R)}else{let y=S;const b=d.length-1;let T=d[y];for(;y<=b&&a.indexOf(T)<0;)y++,w.push(y),T=d[y];y=S-1;const D=0;for(;y>=D;)w.push(y),y--;w.sort(R).reverse()}return w}static normaliseX(t,e,s,i,o){const r=o.getHeaderRowContainerCtrl(e).getViewport();return s&&(t-=r.getBoundingClientRect().left),i.get("enableRtl")&&(t=r.clientWidth-t),e==null&&(t+=o.get("center").getCenterViewportScrollLeft()),t}},Gi=class{constructor(t){this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.pinned=t,this.isCenterContainer=!P(t)}init(){this.ctrlsService.whenReady(t=>{this.gridBodyCon=t.gridBodyCtrl})}getIconName(){return this.pinned?j.ICON_PINNED:j.ICON_MOVE}onDragEnter(t){const e=t.dragItem.columns;if(t.dragSource.type===0)this.setColumnsVisible(e,!0,"uiColumnDragged");else{const i=t.dragItem.visibleState,o=(e||[]).filter(r=>i[r.getId()]);this.setColumnsVisible(o,!0,"uiColumnDragged")}this.setColumnsPinned(e,this.pinned,"uiColumnDragged"),this.onDragging(t,!0,!0)}onDragLeave(){this.ensureIntervalCleared(),this.lastMovedInfo=null}setColumnsVisible(t,e,s){if(t){const i=t.filter(o=>!o.getColDef().lockVisible);this.columnModel.setColumnsVisible(i,e,s)}}setColumnsPinned(t,e,s){if(t){const i=t.filter(o=>!o.getColDef().lockPinned);this.columnModel.setColumnsPinned(i,e,s)}}onDragStop(){this.onDragging(this.lastDraggingEvent,!1,!0,!0),this.ensureIntervalCleared(),this.lastMovedInfo=null}checkCenterForScrolling(t){if(this.isCenterContainer){const e=this.ctrlsService.get("center"),s=e.getCenterViewportScrollLeft(),i=s+e.getCenterWidth();this.gos.get("enableRtl")?(this.needToMoveRight=t<s+50,this.needToMoveLeft=t>i-50):(this.needToMoveLeft=t<s+50,this.needToMoveRight=t>i-50),this.needToMoveLeft||this.needToMoveRight?this.ensureIntervalStarted():this.ensureIntervalCleared()}}onDragging(t=this.lastDraggingEvent,e=!1,s=!1,i=!1){var o;if(i){if(this.lastMovedInfo){const{columns:h,toIndex:c}=this.lastMovedInfo;$s.moveColumns(h,c,"uiColumnMoved",!0,this.columnModel)}return}if(this.lastDraggingEvent=t,z(t.hDirection))return;const r=$s.normaliseX(t.x,this.pinned,!1,this.gos,this.ctrlsService);e||this.checkCenterForScrolling(r);const n=this.normaliseDirection(t.hDirection),l=t.dragSource.type,a=((o=t.dragSource.getDragItem().columns)==null?void 0:o.filter(h=>h.getColDef().lockPinned?h.getPinned()==this.pinned:!0))||[],d=$s.attemptMoveColumns({allMovingColumns:a,isFromHeader:l===1,hDirection:n,xPosition:r,pinned:this.pinned,fromEnter:e,fakeEvent:s,gos:this.gos,columnModel:this.columnModel});d&&(this.lastMovedInfo=d)}normaliseDirection(t){if(this.gos.get("enableRtl"))switch(t){case 0:return 1;case 1:return 0;default:console.error(`AG Grid: Unknown direction ${t}`)}else return t}ensureIntervalStarted(){this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),100),this.needToMoveLeft?this.dragAndDropService.setGhostIcon(j.ICON_LEFT,!0):this.dragAndDropService.setGhostIcon(j.ICON_RIGHT,!0))}ensureIntervalCleared(){this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.dragAndDropService.setGhostIcon(j.ICON_MOVE))}moveInterval(){let t;this.intervalCount++,t=10+this.intervalCount*5,t>100&&(t=100);let e=null;const s=this.gridBodyCon.getScrollFeature();if(this.needToMoveLeft?e=s.scrollHorizontally(-t):this.needToMoveRight&&(e=s.scrollHorizontally(t)),e!==0)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;const o=this.lastDraggingEvent.dragItem.columns.filter(r=>!r.getColDef().lockPinned);if(o.length>0&&(this.dragAndDropService.setGhostIcon(j.ICON_PINNED),this.failedMoveAttempts>7)){const r=this.needToMoveLeft?"left":"right";this.setColumnsPinned(o,r,"uiColumnDragged"),this.dragAndDropService.nudge()}}}};u([f("columnModel")],Gi.prototype,"columnModel",2),u([f("dragAndDropService")],Gi.prototype,"dragAndDropService",2),u([f("gridOptionsService")],Gi.prototype,"gos",2),u([f("ctrlsService")],Gi.prototype,"ctrlsService",2),u([M],Gi.prototype,"init",1);var Oi=class extends L{constructor(t,e){super(),this.pinned=t,this.eContainer=e}postConstruct(){this.ctrlsService.whenReady(t=>{switch(this.pinned){case"left":this.eSecondaryContainers=[[t.gridBodyCtrl.getBodyViewportElement(),t.left.getContainerElement()],[t.bottomLeft.getContainerElement()],[t.topLeft.getContainerElement()]];break;case"right":this.eSecondaryContainers=[[t.gridBodyCtrl.getBodyViewportElement(),t.right.getContainerElement()],[t.bottomRight.getContainerElement()],[t.topRight.getContainerElement()]];break;default:this.eSecondaryContainers=[[t.gridBodyCtrl.getBodyViewportElement(),t.center.getViewportElement()],[t.bottomCenter.getViewportElement()],[t.topCenter.getViewportElement()]];break}})}isInterestedIn(t){return t===1||t===0&&this.gos.get("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}init(){this.moveColumnFeature=this.createManagedBean(new Gi(this.pinned)),this.bodyDropPivotTarget=this.createManagedBean(new ta(this.pinned)),this.dragAndDropService.addDropTarget(this)}getIconName(){return this.currentDropListener.getIconName()}isDropColumnInPivotMode(t){return this.columnModel.isPivotMode()&&t.dragSource.type===0}onDragEnter(t){this.currentDropListener=this.isDropColumnInPivotMode(t)?this.bodyDropPivotTarget:this.moveColumnFeature,this.currentDropListener.onDragEnter(t)}onDragLeave(t){this.currentDropListener.onDragLeave(t)}onDragging(t){this.currentDropListener.onDragging(t)}onDragStop(t){this.currentDropListener.onDragStop(t)}};u([f("dragAndDropService")],Oi.prototype,"dragAndDropService",2),u([f("columnModel")],Oi.prototype,"columnModel",2),u([f("ctrlsService")],Oi.prototype,"ctrlsService",2),u([M],Oi.prototype,"postConstruct",1),u([M],Oi.prototype,"init",1);var _i=class Dc extends Jl{constructor(e){super(Dc.TEMPLATE,e),this.headerCompVersion=0,this.column=e.getColumnGroupChild(),this.pinned=e.getPinned()}postConstruct(){const e=this.getGui();((r,n)=>{n!=null&&n!=""?e.setAttribute(r,n):e.removeAttribute(r)})("col-id",this.column.getColId());const i={setWidth:r=>e.style.width=r,addOrRemoveCssClass:(r,n)=>this.addOrRemoveCssClass(r,n),setAriaSort:r=>r?uu(e,r):hu(e),setUserCompDetails:r=>this.setUserCompDetails(r),getUserCompInstance:()=>this.headerComp};this.ctrl.setComp(i,this.getGui(),this.eResize,this.eHeaderCompWrapper);const o=this.ctrl.getSelectAllGui();this.eResize.insertAdjacentElement("afterend",o)}destroyHeaderComp(){this.headerComp&&(this.eHeaderCompWrapper.removeChild(this.headerCompGui),this.headerComp=this.destroyBean(this.headerComp),this.headerCompGui=void 0)}setUserCompDetails(e){this.headerCompVersion++;const s=this.headerCompVersion;e.newAgStackInstance().then(i=>this.afterCompCreated(s,i))}afterCompCreated(e,s){if(e!=this.headerCompVersion||!this.isAlive()){this.destroyBean(s);return}this.destroyHeaderComp(),this.headerComp=s,this.headerCompGui=s.getGui(),this.eHeaderCompWrapper.appendChild(this.headerCompGui),this.ctrl.setDragSource(this.getGui())}};_i.TEMPLATE=`<div class="ag-header-cell" role="columnheader">
217
+ <div ref="eResize" class="ag-header-cell-resize" role="presentation"></div>
218
+ <div ref="eHeaderCompWrapper" class="ag-header-cell-comp-wrapper" role="presentation"></div>
219
+ </div>`,u([I("eResize")],_i.prototype,"eResize",2),u([I("eHeaderCompWrapper")],_i.prototype,"eHeaderCompWrapper",2),u([M],_i.prototype,"postConstruct",1),u([tt],_i.prototype,"destroyHeaderComp",1);var lm=_i,nn=class Ac extends Jl{constructor(e){super(Ac.TEMPLATE,e)}postConstruct(){const e=this.getGui(),s=(o,r)=>r!=null?e.setAttribute(o,r):e.removeAttribute(o);e.setAttribute("col-id",this.ctrl.getColId());const i={addOrRemoveCssClass:(o,r)=>this.addOrRemoveCssClass(o,r),setResizableDisplayed:o=>$(this.eResize,o),setWidth:o=>e.style.width=o,setAriaExpanded:o=>s("aria-expanded",o),setUserCompDetails:o=>this.setUserCompDetails(o),getUserCompInstance:()=>this.headerGroupComp};this.ctrl.setComp(i,e,this.eResize)}setUserCompDetails(e){e.newAgStackInstance().then(s=>this.afterHeaderCompCreated(s))}afterHeaderCompCreated(e){const s=()=>this.destroyBean(e);if(!this.isAlive()){s();return}const i=this.getGui(),o=e.getGui();i.appendChild(o),this.addDestroyFunc(s),this.headerGroupComp=e,this.ctrl.setDragSource(i)}};nn.TEMPLATE=`<div class="ag-header-group-cell" role="columnheader">
220
+ <div ref="eResize" class="ag-header-cell-resize" role="presentation"></div>
221
+ </div>`,u([I("eResize")],nn.prototype,"eResize",2),u([M],nn.prototype,"postConstruct",1);var am=nn,sa=(t=>(t.COLUMN_GROUP="group",t.COLUMN="column",t.FLOATING_FILTER="filter",t))(sa||{}),ia=class extends K{constructor(e){super(),this.headerComps={},this.ctrl=e,this.setTemplate(`<div class="${this.ctrl.getHeaderRowClass()}" role="row"></div>`)}init(){nl(this.getGui(),this.ctrl.getAriaRowIndex());const e={setHeight:s=>this.getGui().style.height=s,setTop:s=>this.getGui().style.top=s,setHeaderCtrls:(s,i)=>this.setHeaderCtrls(s,i),setWidth:s=>this.getGui().style.width=s};this.ctrl.setComp(e)}destroyHeaderCtrls(){this.setHeaderCtrls([],!1)}setHeaderCtrls(e,s){if(!this.isAlive())return;const i=this.headerComps;if(this.headerComps={},e.forEach(o=>{const r=o.getInstanceId();let n=i[r];delete i[r],n==null&&(n=this.createHeaderComp(o),this.getGui().appendChild(n.getGui())),this.headerComps[r]=n}),je(i,(o,r)=>{this.getGui().removeChild(r.getGui()),this.destroyBean(r)}),s){const o=ms(this.headerComps);o.sort((n,l)=>{const a=n.getCtrl().getColumnGroupChild().getLeft(),d=l.getCtrl().getColumnGroupChild().getLeft();return a-d});const r=o.map(n=>n.getGui());Ll(this.getGui(),r)}}createHeaderComp(e){let s;switch(this.ctrl.getType()){case"group":s=new am(e);break;case"filter":s=new Df(e);break;default:s=new lm(e);break}return this.createBean(s),s.setParentComponent(this),s}};u([M],ia.prototype,"init",1),u([tt],ia.prototype,"destroyHeaderCtrls",1);var dm=0,ps=class Pc extends L{constructor(e,s,i){super(),this.resizeToggleTimeout=0,this.resizeMultiplier=1,this.resizeFeature=null,this.lastFocusEvent=null,this.dragSource=null,this.columnGroupChild=e,this.parentRowCtrl=i,this.beans=s,this.instanceId=e.getUniqueId()+"-"+dm++}postConstruct(){this.addManagedPropertyListeners(["suppressHeaderFocus"],()=>this.refreshTabIndex())}shouldStopEventPropagation(e){const{headerRowIndex:s,column:i}=this.focusService.getFocusedHeader();return xu(this.gos,e,s,i)}getWrapperHasFocus(){return this.gos.getActiveDomElement()===this.eGui}setGui(e){this.eGui=e,this.addDomData(),this.addManagedListener(this.beans.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.onDisplayedColumnsChanged(),this.refreshTabIndex()}onDisplayedColumnsChanged(){!this.comp||!this.column||(this.refreshFirstAndLastStyles(),this.refreshAriaColIndex())}refreshFirstAndLastStyles(){const{comp:e,column:s,beans:i}=this;tn.refreshFirstAndLastStyles(e,s,i.columnModel)}refreshAriaColIndex(){const{beans:e,column:s}=this,i=e.columnModel.getAriaColumnIndex(s);ll(this.eGui,i)}addResizeAndMoveKeyboardListeners(){this.resizeFeature&&(this.addManagedListener(this.eGui,"keydown",this.onGuiKeyDown.bind(this)),this.addManagedListener(this.eGui,"keyup",this.onGuiKeyUp.bind(this)))}refreshTabIndex(){this.gos.get("suppressHeaderFocus")?this.eGui.removeAttribute("tabindex"):this.eGui.setAttribute("tabindex","-1")}onGuiKeyDown(e){var s;const i=this.gos.getActiveDomElement(),o=e.key===E.LEFT||e.key===E.RIGHT;if(this.isResizing&&(e.preventDefault(),e.stopImmediatePropagation()),i!==this.eGui||!e.shiftKey&&!e.altKey||((this.isResizing||o)&&(e.preventDefault(),e.stopImmediatePropagation()),!o))return;const r=e.key===E.LEFT!==this.gos.get("enableRtl"),n=lh[r?"Left":"Right"];if(e.altKey){this.isResizing=!0,this.resizeMultiplier+=1;const l=this.getViewportAdjustedResizeDiff(e);this.resizeHeader(l,e.shiftKey),(s=this.resizeFeature)==null||s.toggleColumnResizing(!0)}else this.moveHeader(n)}getViewportAdjustedResizeDiff(e){let s=this.getResizeDiff(e);if(this.column.getPinned()){const o=this.pinnedWidthService.getPinnedLeftWidth(),r=this.pinnedWidthService.getPinnedRightWidth(),n=ks(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50;if(o+r+s>n)if(n>o+r)s=n-o-r;else return 0}return s}getResizeDiff(e){let s=e.key===E.LEFT!==this.gos.get("enableRtl");const i=this.column.getPinned(),o=this.gos.get("enableRtl");return i&&o!==(i==="right")&&(s=!s),(s?-1:1)*this.resizeMultiplier}onGuiKeyUp(){this.isResizing&&(this.resizeToggleTimeout&&(window.clearTimeout(this.resizeToggleTimeout),this.resizeToggleTimeout=0),this.isResizing=!1,this.resizeMultiplier=1,this.resizeToggleTimeout=setTimeout(()=>{var e;(e=this.resizeFeature)==null||e.toggleColumnResizing(!1)},150))}handleKeyDown(e){const s=this.getWrapperHasFocus();switch(e.key){case E.PAGE_DOWN:case E.PAGE_UP:case E.PAGE_HOME:case E.PAGE_END:s&&e.preventDefault()}}addDomData(){const e=Pc.DOM_DATA_KEY_HEADER_CTRL;this.gos.setDomData(this.eGui,e,this),this.addDestroyFunc(()=>this.gos.setDomData(this.eGui,e,null))}getGui(){return this.eGui}focus(e){return this.eGui?(this.lastFocusEvent=e||null,this.eGui.focus(),!0):!1}getRowIndex(){return this.parentRowCtrl.getRowIndex()}getParentRowCtrl(){return this.parentRowCtrl}getPinned(){return this.parentRowCtrl.getPinned()}getInstanceId(){return this.instanceId}getColumnGroupChild(){return this.columnGroupChild}removeDragSource(){this.dragSource&&(this.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null)}handleContextMenuMouseEvent(e,s,i){const o=e??s;this.gos.get("preventDefaultOnContextMenu")&&o.preventDefault();const r=i instanceof fe?i:void 0;this.menuService.isHeaderContextMenuEnabled(r)&&this.menuService.showHeaderContextMenu(r,e,s),this.dispatchColumnMouseEvent(p.EVENT_COLUMN_HEADER_CONTEXT_MENU,i)}dispatchColumnMouseEvent(e,s){const i={type:e,column:s};this.eventService.dispatchEvent(i)}destroy(){super.destroy(),this.removeDragSource(),this.comp=null,this.column=null,this.resizeFeature=null,this.lastFocusEvent=null,this.columnGroupChild=null,this.parentRowCtrl=null,this.eGui=null}};ps.DOM_DATA_KEY_HEADER_CTRL="headerCtrl",u([f("pinnedWidthService")],ps.prototype,"pinnedWidthService",2),u([f("focusService")],ps.prototype,"focusService",2),u([f("userComponentFactory")],ps.prototype,"userComponentFactory",2),u([f("ctrlsService")],ps.prototype,"ctrlsService",2),u([f("dragAndDropService")],ps.prototype,"dragAndDropService",2),u([f("menuService")],ps.prototype,"menuService",2),u([M],ps.prototype,"postConstruct",1);var ln=ps,an=class extends L{constructor(t,e,s,i){super(),this.columnOrGroup=t,this.eCell=e,this.ariaEl=this.eCell.querySelector("[role=columnheader]")||this.eCell,this.colsSpanning=i,this.beans=s}setColsSpanning(t){this.colsSpanning=t,this.onLeftChanged()}getColumnOrGroup(){return this.beans.gos.get("enableRtl")&&this.colsSpanning?ie(this.colsSpanning):this.columnOrGroup}postConstruct(){this.addManagedListener(this.columnOrGroup,fe.EVENT_LEFT_CHANGED,this.onLeftChanged.bind(this)),this.setLeftFirstTime(),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onLeftChanged.bind(this)),this.addManagedPropertyListener("domLayout",this.onLeftChanged.bind(this))}setLeftFirstTime(){const t=this.beans.gos.get("suppressColumnMoveAnimation"),e=P(this.columnOrGroup.getOldLeft());this.beans.columnAnimationService.isActive()&&e&&!t?this.animateInLeft():this.onLeftChanged()}animateInLeft(){const t=this.getColumnOrGroup(),e=t.getLeft(),s=t.getOldLeft(),i=this.modifyLeftForPrintLayout(t,s),o=this.modifyLeftForPrintLayout(t,e);this.setLeft(i),this.actualLeft=o,this.beans.columnAnimationService.executeNextVMTurn(()=>{this.actualLeft===o&&this.setLeft(o)})}onLeftChanged(){const t=this.getColumnOrGroup(),e=t.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(t,e),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(t,e){if(!this.beans.gos.isDomLayout("print")||t.getPinned()==="left")return e;const i=this.beans.columnModel.getDisplayedColumnsLeftWidth();if(t.getPinned()==="right"){const o=this.beans.columnModel.getBodyContainerWidth();return i+o+e}return i+e}setLeft(t){if(P(t)&&(this.eCell.style.left=`${t}px`),this.columnOrGroup instanceof fe)this.columnOrGroup;else{const s=this.columnOrGroup.getLeafColumns();if(!s.length)return;s.length>1&&du(this.ariaEl,s.length),s[0]}}};u([M],an.prototype,"postConstruct",1);var Oo=class extends L{constructor(t,e){super(),this.columns=t,this.element=e}postConstruct(){this.gos.get("columnHoverHighlight")&&this.addMouseHoverListeners()}addMouseHoverListeners(){this.addManagedListener(this.element,"mouseout",this.onMouseOut.bind(this)),this.addManagedListener(this.element,"mouseover",this.onMouseOver.bind(this))}onMouseOut(){this.columnHoverService.clearMouseOver()}onMouseOver(){this.columnHoverService.setMouseOver(this.columns)}};u([f("columnHoverService")],Oo.prototype,"columnHoverService",2),u([M],Oo.prototype,"postConstruct",1);var um=class extends ln{constructor(t,e,s){super(t,e,s),this.iconCreated=!1,this.column=t}setComp(t,e,s,i){this.comp=t,this.eButtonShowMainFilter=s,this.eFloatingFilterBody=i,this.setGui(e),this.setupActive(),this.setupWidth(),this.setupLeft(),this.setupHover(),this.setupFocus(),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(),this.setupUi(),this.addManagedListener(this.eButtonShowMainFilter,"click",this.showParentFilter.bind(this)),this.setupFilterChangedListener(),this.addManagedListener(this.column,fe.EVENT_COL_DEF_CHANGED,this.onColDefChanged.bind(this))}resizeHeader(){}moveHeader(){}setupActive(){const t=this.column.getColDef(),e=!!t.filter,s=!!t.floatingFilter;this.active=e&&s}setupUi(){if(this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton&&this.active),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body",this.suppressFilterButton),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body",!this.suppressFilterButton),!this.active||this.iconCreated)return;const t=be("filter",this.gos,this.column);t&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(t))}setupFocus(){this.createManagedBean(new ws(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){const t=this.localeService.getLocaleTextFunc();St(this.eButtonShowMainFilter,t("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(t){if(this.gos.getActiveDomElement()===this.eGui)return;const i=this.focusService.findNextFocusableElement(this.eGui,null,t.shiftKey);if(i){this.beans.headerNavigationService.scrollToColumn(this.column),t.preventDefault(),i.focus();return}const o=this.findNextColumnWithFloatingFilter(t.shiftKey);o&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:this.getParentRowCtrl().getRowIndex(),column:o},event:t})&&t.preventDefault()}findNextColumnWithFloatingFilter(t){const e=this.beans.columnModel;let s=this.column;do if(s=t?e.getDisplayedColBefore(s):e.getDisplayedColAfter(s),!s)break;while(!s.getColDef().filter||!s.getColDef().floatingFilter);return s}handleKeyDown(t){super.handleKeyDown(t);const e=this.getWrapperHasFocus();switch(t.key){case E.UP:case E.DOWN:e||t.preventDefault();case E.LEFT:case E.RIGHT:if(e)return;t.stopPropagation();case E.ENTER:e&&this.focusService.focusInto(this.eGui)&&t.preventDefault();break;case E.ESCAPE:e||this.eGui.focus()}}onFocusIn(t){if(this.eGui.contains(t.relatedTarget))return;const s=!!t.relatedTarget&&!t.relatedTarget.classList.contains("ag-floating-filter"),i=!!t.relatedTarget&&Hs(t.relatedTarget,"ag-floating-filter");if(s&&i&&t.target===this.eGui){const r=this.lastFocusEvent,n=!!(r&&r.key===E.TAB);if(r&&n){const l=r.shiftKey;this.focusService.focusInto(this.eGui,l)}}const o=this.getRowIndex();this.beans.focusService.setFocusedHeader(o,this.column)}setupHover(){this.createManagedBean(new Oo([this.column],this.eGui));const t=()=>{if(!this.gos.get("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",e)};this.addManagedListener(this.eventService,p.EVENT_COLUMN_HOVER_CHANGED,t),t()}setupLeft(){const t=new an(this.column,this.eGui,this.beans);this.createManagedBean(t)}setupFilterButton(){this.suppressFilterButton=!this.menuService.isFloatingFilterButtonEnabled(this.column),this.highlightFilterButtonWhenActive=!this.menuService.isLegacyMenuEnabled()}setupUserComp(){if(!this.active)return;const t=this.beans.filterManager.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());t&&this.setCompDetails(t)}setCompDetails(t){this.userCompDetails=t,this.comp.setCompDetails(t)}showParentFilter(){const t=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;this.menuService.showFilterMenu({column:this.column,buttonElement:t,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(){if(!this.active)return;const{filterManager:t}=this.beans,e=s=>{if((s==null?void 0:s.source)==="filterDestroyed"&&this.context.isDestroyed())return;const i=this.comp.getFloatingFilterComp();i&&i.then(o=>{var r;if(o){const n=t.getCurrentFloatingFilterParentModel(this.column);o.onParentModelChanged(n,s?this.gos.addGridCommonParams({columns:(r=s.columns)!=null?r:[],type:p.EVENT_FILTER_CHANGED,source:s.source==="api"?"api":"columnFilter"}):null)}})};this.destroySyncListener=this.addManagedListener(this.column,fe.EVENT_FILTER_CHANGED,e),t.isFilterActive(this.column)&&e(null)}setupWidth(){const t=()=>{const e=`${this.column.getActualWidth()}px`;this.comp.setWidth(e)};this.addManagedListener(this.column,fe.EVENT_WIDTH_CHANGED,t),t()}setupFilterChangedListener(){this.active&&(this.destroyFilterChangedListener=this.addManagedListener(this.column,fe.EVENT_FILTER_CHANGED,this.updateFilterButton.bind(this)),this.updateFilterButton())}updateFilterButton(){if(!this.suppressFilterButton&&this.comp){const t=this.beans.filterManager.isFilterAllowed(this.column);this.comp.setButtonWrapperDisplayed(t),this.highlightFilterButtonWhenActive&&t&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(){var t,e;const s=this.active;this.setupActive();const i=!s&&this.active;s&&!this.active&&((t=this.destroySyncListener)==null||t.call(this),(e=this.destroyFilterChangedListener)==null||e.call(this));const o=this.active?this.beans.filterManager.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,r=this.comp.getFloatingFilterComp();!r||!o?this.updateCompDetails(o,i):r.then(n=>{var l;!n||this.beans.filterManager.areFilterCompsDifferent((l=this.userCompDetails)!=null?l:null,o)?this.updateCompDetails(o,i):this.updateFloatingFilterParams(o)})}updateCompDetails(t,e){this.isAlive()&&(this.setCompDetails(t),this.setupFilterButton(),this.setupUi(),e&&(this.setupSyncWithFilter(),this.setupFilterChangedListener()))}updateFloatingFilterParams(t){var e;if(!t)return;const s=t.params;(e=this.comp.getFloatingFilterComp())==null||e.then(i=>{let o=!1;i!=null&&i.refresh&&typeof i.refresh=="function"&&i.refresh(s)!==null&&(o=!0),!o&&(i!=null&&i.onParamsUpdated)&&typeof i.onParamsUpdated=="function"&&i.onParamsUpdated(s)!==null&&H("Custom floating filter method 'onParamsUpdated' is deprecated. Use 'refresh' instead.")})}destroy(){super.destroy(),this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.destroySyncListener=null,this.destroyFilterChangedListener=null}},Vi=class extends L{constructor(t,e,s,i,o){super(),this.pinned=t,this.column=e,this.eResize=s,this.comp=i,this.ctrl=o}postConstruct(){const t=[];let e,s;const i=()=>{if($(this.eResize,e),!e)return;const n=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(t.push(n),s){const l=this.gos.get("skipHeaderOnAutoSize"),a=()=>{this.columnModel.autoSizeColumn(this.column,"uiColumnResized",l)};this.eResize.addEventListener("dblclick",a);const d=new ze(this.eResize);d.addEventListener(ze.EVENT_DOUBLE_TAP,a),t.push(()=>{this.eResize.removeEventListener("dblclick",a),d.removeEventListener(ze.EVENT_DOUBLE_TAP,a),d.destroy()})}},o=()=>{t.forEach(n=>n()),t.length=0},r=()=>{const n=this.column.isResizable(),l=!this.gos.get("suppressAutoSize")&&!this.column.getColDef().suppressAutoSize;(n!==e||l!==s)&&(e=n,s=l,o(),i())};r(),this.addDestroyFunc(o),this.ctrl.addRefreshFunction(r)}onResizing(t,e){const{column:s,lastResizeAmount:i,resizeStartWidth:o}=this,r=this.normaliseResizeAmount(e),n=o+r,l=[{key:s,newWidth:n}];if(this.column.getPinned()){const a=this.pinnedWidthService.getPinnedLeftWidth(),d=this.pinnedWidthService.getPinnedRightWidth(),h=ks(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50;if(a+d+(r-i)>h)return}this.lastResizeAmount=r,this.columnModel.setColumnWidths(l,this.resizeWithShiftKey,t,"uiColumnResized"),t&&this.toggleColumnResizing(!1)}onResizeStart(t){this.resizeStartWidth=this.column.getActualWidth(),this.lastResizeAmount=0,this.resizeWithShiftKey=t,this.toggleColumnResizing(!0)}toggleColumnResizing(t){this.comp.addOrRemoveCssClass("ag-column-resizing",t)}normaliseResizeAmount(t){let e=t;const s=this.pinned!=="left",i=this.pinned==="right";return this.gos.get("enableRtl")?s&&(e*=-1):i&&(e*=-1),e}};u([f("horizontalResizeService")],Vi.prototype,"horizontalResizeService",2),u([f("pinnedWidthService")],Vi.prototype,"pinnedWidthService",2),u([f("ctrlsService")],Vi.prototype,"ctrlsService",2),u([f("columnModel")],Vi.prototype,"columnModel",2),u([M],Vi.prototype,"postConstruct",1);var oa=class extends L{constructor(t){super(),this.cbSelectAllVisible=!1,this.processingEventFromCheckbox=!1,this.column=t}onSpaceKeyDown(t){const e=this.cbSelectAll;e.isDisplayed()&&!e.getGui().contains(this.gos.getActiveDomElement())&&(t.preventDefault(),e.setValue(!e.getValue()))}getCheckboxGui(){return this.cbSelectAll.getGui()}setComp(t){this.headerCellCtrl=t,this.cbSelectAll=this.createManagedBean(new jr),this.cbSelectAll.addCssClass("ag-header-select-all"),Ae(this.cbSelectAll.getGui(),"presentation"),this.showOrHideSelectAll(),this.addManagedListener(this.eventService,p.EVENT_NEW_COLUMNS_LOADED,this.onNewColumnsLoaded.bind(this)),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_SELECTION_CHANGED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_PAGINATION_CHANGED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_MODEL_UPDATED,this.onModelChanged.bind(this)),this.addManagedListener(this.cbSelectAll,p.EVENT_FIELD_VALUE_CHANGED,this.onCbSelectAll.bind(this)),wo(this.cbSelectAll.getGui(),!0),this.cbSelectAll.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()}onNewColumnsLoaded(){this.showOrHideSelectAll()}onDisplayedColumnsChanged(){this.isAlive()&&this.showOrHideSelectAll()}showOrHideSelectAll(){this.cbSelectAllVisible=this.isCheckboxSelection(),this.cbSelectAll.setDisplayed(this.cbSelectAllVisible,{skipAriaHidden:!0}),this.cbSelectAllVisible&&(this.checkRightRowModelType("selectAllCheckbox"),this.checkSelectionType("selectAllCheckbox"),this.updateStateOfCheckbox()),this.refreshSelectAllLabel()}onModelChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}onSelectionChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}updateStateOfCheckbox(){if(this.processingEventFromCheckbox)return;this.processingEventFromCheckbox=!0;const t=this.selectionService.getSelectAllState(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setValue(t);const e=this.selectionService.hasNodesToSelect(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setDisabled(!e),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}refreshSelectAllLabel(){const t=this.localeService.getLocaleTextFunc(),s=this.cbSelectAll.getValue()?t("ariaChecked","checked"):t("ariaUnchecked","unchecked"),i=t("ariaRowSelectAll","Press Space to toggle all rows selection");this.cbSelectAllVisible?this.headerCellCtrl.setAriaDescriptionProperty("selectAll",`${i} (${s})`):this.headerCellCtrl.setAriaDescriptionProperty("selectAll",null),this.cbSelectAll.setInputAriaLabel(`${i} (${s})`),this.headerCellCtrl.announceAriaDescription()}checkSelectionType(t){return this.gos.get("rowSelection")==="multiple"?!0:(console.warn(`AG Grid: ${t} is only available if using 'multiple' rowSelection.`),!1)}checkRightRowModelType(t){const e=this.rowModel.getType();return e==="clientSide"||e==="serverSide"?!0:(console.warn(`AG Grid: ${t} is only available if using 'clientSide' or 'serverSide' rowModelType, you are using ${e}.`),!1)}onCbSelectAll(){if(this.processingEventFromCheckbox||!this.cbSelectAllVisible)return;const t=this.cbSelectAll.getValue(),e=this.isFilteredOnly(),s=this.isCurrentPageOnly();let i="uiSelectAll";s?i="uiSelectAllCurrentPage":e&&(i="uiSelectAllFiltered");const o={source:i,justFiltered:e,justCurrentPage:s};t?this.selectionService.selectAllRowNodes(o):this.selectionService.deselectAllRowNodes(o)}isCheckboxSelection(){let t=this.column.getColDef().headerCheckboxSelection;if(typeof t=="function"){const e=t,s=this.gos.addGridCommonParams({column:this.column,colDef:this.column.getColDef()});t=e(s)}return t?this.checkRightRowModelType("headerCheckboxSelection")&&this.checkSelectionType("headerCheckboxSelection"):!1}isFilteredOnly(){return!!this.column.getColDef().headerCheckboxSelectionFilteredOnly}isCurrentPageOnly(){return!!this.column.getColDef().headerCheckboxSelectionCurrentPageOnly}};u([f("rowModel")],oa.prototype,"rowModel",2),u([f("selectionService")],oa.prototype,"selectionService",2);var hm=class extends ln{constructor(t,e,s){super(t,e,s),this.refreshFunctions=[],this.userHeaderClasses=new Set,this.ariaDescriptionProperties=new Map,this.column=t}setComp(t,e,s,i){this.comp=t,this.setGui(e),this.updateState(),this.setupWidth(),this.setupMovingCss(),this.setupMenuClass(),this.setupSortableClass(),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight(i),this.addColumnHoverListener(),this.setupFilterClass(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(),this.setupSelectAll(),this.setupUserComp(),this.refreshAria(),this.resizeFeature=this.createManagedBean(new Vi(this.getPinned(),this.column,s,t,this)),this.createManagedBean(new Oo([this.column],e)),this.createManagedBean(new an(this.column,e,this.beans)),this.createManagedBean(new ws(e,{shouldStopEventPropagation:o=>this.shouldStopEventPropagation(o),onTabKeyDown:()=>null,handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addResizeAndMoveKeyboardListeners(),this.addManagedPropertyListeners(["suppressMovableColumns","suppressMenuHide","suppressAggFuncInHeader"],this.refresh.bind(this)),this.addManagedListener(this.column,fe.EVENT_COL_DEF_CHANGED,this.refresh.bind(this)),this.addManagedListener(this.eventService,p.EVENT_COLUMN_VALUE_CHANGED,this.onColumnValueChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_COLUMN_ROW_GROUP_CHANGED,this.onColumnRowGroupChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_COLUMN_PIVOT_CHANGED,this.onColumnPivotChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_HEADER_HEIGHT_CHANGED,this.onHeaderHeightChanged.bind(this))}resizeHeader(t,e){var s,i;if(!this.column.isResizable())return;const o=this.column.getActualWidth(),r=(s=this.column.getMinWidth())!=null?s:0,n=(i=this.column.getMaxWidth())!=null?i:Number.MAX_SAFE_INTEGER,l=Math.min(Math.max(o+t,r),n);this.beans.columnModel.setColumnWidths([{key:this.column,newWidth:l}],e,!0,"uiColumnResized")}moveHeader(t){const{eGui:e,column:s,gos:i,ctrlsService:o}=this,r=this.getPinned(),n=e.getBoundingClientRect().left,l=s.getActualWidth(),a=i.get("enableRtl"),d=t===0!==a,h=$s.normaliseX(d?n-20:n+l+20,r,!0,i,o);$s.attemptMoveColumns({allMovingColumns:[s],isFromHeader:!0,hDirection:t,xPosition:h,pinned:r,fromEnter:!1,fakeEvent:!1,gos:i,columnModel:this.beans.columnModel}),o.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(s,"auto")}setupUserComp(){const t=this.lookupUserCompDetails();this.setCompDetails(t)}setCompDetails(t){this.userCompDetails=t,this.comp.setUserCompDetails(t)}lookupUserCompDetails(){const t=this.createParams(),e=this.column.getColDef();return this.userComponentFactory.getHeaderCompDetails(e,t)}createParams(){return this.gos.addGridCommonParams({column:this.column,displayName:this.displayName,enableSorting:this.column.isSortable(),enableMenu:this.menuEnabled,enableFilterButton:this.openFilterEnabled&&this.menuService.isHeaderFilterButtonEnabled(this.column),enableFilterIcon:!this.openFilterEnabled||this.menuService.isLegacyMenuEnabled(),showColumnMenu:e=>{this.menuService.showColumnMenu({column:this.column,buttonElement:e,positionBy:"button"})},showColumnMenuAfterMouseClick:e=>{this.menuService.showColumnMenu({column:this.column,mouseEvent:e,positionBy:"mouse"})},showFilter:e=>{this.menuService.showFilterMenu({column:this.column,buttonElement:e,containerType:"columnFilter",positionBy:"button"})},progressSort:e=>{this.beans.sortController.progressSort(this.column,!!e,"uiColumnSorted")},setSort:(e,s)=>{this.beans.sortController.setSortForColumn(this.column,e,!!s,"uiColumnSorted")},eGridHeader:this.getGui(),setTooltip:(e,s)=>{this.setupTooltip(e,s)}})}setupSelectAll(){this.selectAllFeature=this.createManagedBean(new oa(this.column)),this.selectAllFeature.setComp(this)}getSelectAllGui(){return this.selectAllFeature.getCheckboxGui()}handleKeyDown(t){super.handleKeyDown(t),t.key===E.SPACE&&this.selectAllFeature.onSpaceKeyDown(t),t.key===E.ENTER&&this.onEnterKeyDown(t),t.key===E.DOWN&&t.altKey&&this.showMenuOnKeyPress(t,!1)}onEnterKeyDown(t){if(t.ctrlKey||t.metaKey)this.showMenuOnKeyPress(t,!0);else if(this.sortable){const e=t.shiftKey;this.beans.sortController.progressSort(this.column,e,"uiColumnSorted")}}showMenuOnKeyPress(t,e){const s=this.comp.getUserCompInstance();!s||!(s instanceof Kl)||s.onMenuKeyboardShortcut(e)&&t.preventDefault()}onFocusIn(t){if(!this.getGui().contains(t.relatedTarget)){const e=this.getRowIndex();this.focusService.setFocusedHeader(e,this.column),this.announceAriaDescription()}this.focusService.isKeyboardMode()&&this.setActiveHeader(!0)}onFocusOut(t){this.getGui().contains(t.relatedTarget)||this.setActiveHeader(!1)}setupTooltip(t,e){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const s=this.gos.get("tooltipShowMode")==="whenTruncated",i=this.eGui,o=this.column.getColDef();!e&&s&&!o.headerComponent&&(e=()=>{const l=i.querySelector(".ag-header-cell-text");return l?l.scrollWidth>l.clientWidth:!0});const r={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getGui:()=>i,getLocation:()=>"header",getTooltipValue:()=>t??this.column.getColDef().headerTooltip,shouldDisplayTooltip:e},n=this.createManagedBean(new ds(r));this.refreshFunctions.push(()=>n.refreshToolTip())}setupClassesFromColDef(){const t=()=>{const e=this.column.getColDef(),s=tn.getHeaderClassesFromColDef(e,this.gos,this.column,null),i=this.userHeaderClasses;this.userHeaderClasses=new Set(s),s.forEach(o=>{i.has(o)?i.delete(o):this.comp.addOrRemoveCssClass(o,!0)}),i.forEach(o=>this.comp.addOrRemoveCssClass(o,!1))};this.refreshFunctions.push(t),t()}setDragSource(t){if(this.dragSourceElement=t,this.removeDragSource(),!t||!this.draggable)return;const{column:e,beans:s,displayName:i,dragAndDropService:o,gos:r}=this,{columnModel:n}=s;let l=!this.gos.get("suppressDragLeaveHidesColumns");const a=this.dragSource={type:1,eElement:t,getDefaultIconName:()=>l?j.ICON_HIDE:j.ICON_NOT_ALLOWED,getDragItem:()=>this.createDragItem(e),dragItemName:i,onDragStarted:()=>{l=!r.get("suppressDragLeaveHidesColumns"),e.setMoving(!0,"uiColumnMoved")},onDragStopped:()=>e.setMoving(!1,"uiColumnMoved"),onGridEnter:d=>{var h;if(l){const c=((h=d==null?void 0:d.columns)==null?void 0:h.filter(m=>!m.getColDef().lockVisible))||[];n.setColumnsVisible(c,!0,"uiColumnMoved")}},onGridExit:d=>{var h;if(l){const c=((h=d==null?void 0:d.columns)==null?void 0:h.filter(m=>!m.getColDef().lockVisible))||[];n.setColumnsVisible(c,!1,"uiColumnMoved")}}};o.addDragSource(a,!0)}createDragItem(t){const e={};return e[t.getId()]=t.isVisible(),{columns:[t],visibleState:e}}updateState(){this.menuEnabled=this.menuService.isColumnMenuInHeaderEnabled(this.column),this.openFilterEnabled=this.menuService.isFilterMenuInHeaderEnabled(this.column),this.sortable=this.column.isSortable(),this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()}addRefreshFunction(t){this.refreshFunctions.push(t)}refresh(){this.updateState(),this.refreshHeaderComp(),this.refreshAria(),this.refreshFunctions.forEach(t=>t())}refreshHeaderComp(){const t=this.lookupUserCompDetails();(this.comp.getUserCompInstance()!=null&&this.userCompDetails.componentClass==t.componentClass?this.attemptHeaderCompRefresh(t.params):!1)?this.setDragSource(this.dragSourceElement):this.setCompDetails(t)}attemptHeaderCompRefresh(t){const e=this.comp.getUserCompInstance();return!e||!e.refresh?!1:e.refresh(t)}calculateDisplayName(){return this.beans.columnModel.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(){this.displayName!==this.calculateDisplayName()&&this.refresh()}workOutDraggable(){const t=this.column.getColDef();return!!(!this.gos.get("suppressMovableColumns")&&!t.suppressMovable&&!t.lockPosition)||!!t.enableRowGroup||!!t.enablePivot}onColumnRowGroupChanged(){this.checkDisplayName()}onColumnPivotChanged(){this.checkDisplayName()}onColumnValueChanged(){this.checkDisplayName()}setupWidth(){const t=()=>{const e=this.column.getActualWidth();this.comp.setWidth(`${e}px`)};this.addManagedListener(this.column,fe.EVENT_WIDTH_CHANGED,t),t()}setupMovingCss(){const t=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving())};this.addManagedListener(this.column,fe.EVENT_MOVING_CHANGED,t),t()}setupMenuClass(){const t=()=>{this.comp.addOrRemoveCssClass("ag-column-menu-visible",this.column.isMenuVisible())};this.addManagedListener(this.column,fe.EVENT_MENU_VISIBLE_CHANGED,t),t()}setupSortableClass(){const t=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-sortable",!!this.sortable)};t(),this.addRefreshFunction(t),this.addManagedListener(this.eventService,fe.EVENT_SORT_CHANGED,this.refreshAriaSort.bind(this))}setupFilterClass(){const t=()=>{const e=this.column.isFilterActive();this.comp.addOrRemoveCssClass("ag-header-cell-filtered",e),this.refreshAria()};this.addManagedListener(this.column,fe.EVENT_FILTER_ACTIVE_CHANGED,t),t()}setupWrapTextClass(){const t=()=>{const e=!!this.column.getColDef().wrapHeaderText;this.comp.addOrRemoveCssClass("ag-header-cell-wrap-text",e)};t(),this.addRefreshFunction(t)}onDisplayedColumnsChanged(){super.onDisplayedColumnsChanged(),this.isAlive()&&this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){const{eGui:t,column:e,comp:s,beans:i}=this;if(!e.isSpanHeaderHeight()){t.style.removeProperty("top"),t.style.removeProperty("height"),s.addOrRemoveCssClass("ag-header-span-height",!1),s.addOrRemoveCssClass("ag-header-span-total",!1);return}const{numberOfParents:o,isSpanningTotal:r}=this.column.getColumnGroupPaddingInfo();s.addOrRemoveCssClass("ag-header-span-height",o>0);const{columnModel:n}=i,l=n.getColumnHeaderRowHeight();if(o===0){s.addOrRemoveCssClass("ag-header-span-total",!1),t.style.setProperty("top","0px"),t.style.setProperty("height",`${l}px`);return}s.addOrRemoveCssClass("ag-header-span-total",r);const d=n.isPivotMode()?n.getPivotGroupHeaderHeight():n.getGroupHeaderHeight(),h=o*d;t.style.setProperty("top",`${-h}px`),t.style.setProperty("height",`${l+h}px`)}setupAutoHeight(t){const{columnModel:e,resizeObserverService:s}=this.beans,i=d=>{if(!this.isAlive())return;const{paddingTop:h,paddingBottom:c,borderBottomWidth:m,borderTopWidth:C}=vs(this.getGui()),v=h+c+m+C,w=t.offsetHeight+v;if(d<5){const R=this.beans.gos.getDocument(),y=!R||!R.contains(t),b=w==0;if(y||b){window.setTimeout(()=>i(d+1),0);return}}e.setColumnHeaderHeight(this.column,w)};let o=!1,r;const n=()=>{const d=this.column.isAutoHeaderHeight();d&&!o&&l(),!d&&o&&a()},l=()=>{o=!0,i(0),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!0),r=s.observeResize(t,()=>i(0))},a=()=>{o=!1,r&&r(),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!1),r=void 0};n(),this.addDestroyFunc(()=>a()),this.addManagedListener(this.column,fe.EVENT_WIDTH_CHANGED,()=>o&&i(0)),this.addManagedListener(this.eventService,fe.EVENT_SORT_CHANGED,()=>{o&&window.setTimeout(()=>i(0))}),this.addRefreshFunction(n)}refreshAriaSort(){if(this.sortable){const t=this.localeService.getLocaleTextFunc(),e=this.beans.sortController.getDisplaySortForColumn(this.column)||null;this.comp.setAriaSort($d(e)),this.setAriaDescriptionProperty("sort",t("ariaSortableColumn","Press ENTER to sort"))}else this.comp.setAriaSort(),this.setAriaDescriptionProperty("sort",null)}refreshAriaMenu(){if(this.menuEnabled){const t=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("menu",t("ariaMenuColumn","Press ALT DOWN to open column menu"))}else this.setAriaDescriptionProperty("menu",null)}refreshAriaFilterButton(){if(this.openFilterEnabled&&!this.menuService.isLegacyMenuEnabled()){const t=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("filterButton",t("ariaFilterColumn","Press CTRL ENTER to open filter"))}else this.setAriaDescriptionProperty("filterButton",null)}refreshAriaFiltered(){const t=this.localeService.getLocaleTextFunc();this.column.isFilterActive()?this.setAriaDescriptionProperty("filter",t("ariaColumnFiltered","Column Filtered")):this.setAriaDescriptionProperty("filter",null)}setAriaDescriptionProperty(t,e){e!=null?this.ariaDescriptionProperties.set(t,e):this.ariaDescriptionProperties.delete(t)}announceAriaDescription(){if(!this.eGui.contains(this.beans.gos.getActiveDomElement()))return;const t=Array.from(this.ariaDescriptionProperties.keys()).sort((e,s)=>e==="filter"?-1:s.charCodeAt(0)-e.charCodeAt(0)).map(e=>this.ariaDescriptionProperties.get(e)).join(". ");this.beans.ariaAnnouncementService.announceValue(t)}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaFilterButton(),this.refreshAriaFiltered()}addColumnHoverListener(){const t=()=>{if(!this.gos.get("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",e)};this.addManagedListener(this.eventService,p.EVENT_COLUMN_HOVER_CHANGED,t),t()}getColId(){return this.column.getColId()}addActiveHeaderMouseListeners(){const t=i=>this.handleMouseOverChange(i.type==="mouseenter"),e=()=>this.dispatchColumnMouseEvent(p.EVENT_COLUMN_HEADER_CLICKED,this.column),s=i=>this.handleContextMenuMouseEvent(i,void 0,this.column);this.addManagedListener(this.getGui(),"mouseenter",t),this.addManagedListener(this.getGui(),"mouseleave",t),this.addManagedListener(this.getGui(),"click",e),this.addManagedListener(this.getGui(),"contextmenu",s)}handleMouseOverChange(t){this.setActiveHeader(t);const s={type:t?p.EVENT_COLUMN_HEADER_MOUSE_OVER:p.EVENT_COLUMN_HEADER_MOUSE_LEAVE,column:this.column};this.eventService.dispatchEvent(s)}setActiveHeader(t){this.comp.addOrRemoveCssClass("ag-header-active",t)}getAnchorElementForMenu(t){const e=this.comp.getUserCompInstance();return e instanceof Kl?e.getAnchorElementForMenu(t):this.getGui()}destroy(){super.destroy(),this.refreshFunctions=null,this.selectAllFeature=null,this.dragSourceElement=null,this.userCompDetails=null,this.userHeaderClasses=null,this.ariaDescriptionProperties=null}},_o=class extends L{constructor(t,e,s,i){super(),this.eResize=e,this.comp=t,this.pinned=s,this.columnGroup=i}postConstruct(){if(!this.columnGroup.isResizable()){this.comp.setResizableDisplayed(!1);return}const t=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(this.addDestroyFunc(t),!this.gos.get("suppressAutoSize")){const e=this.gos.get("skipHeaderOnAutoSize");this.eResize.addEventListener("dblclick",()=>{const s=[];this.columnGroup.getDisplayedLeafColumns().forEach(o=>{o.getColDef().suppressAutoSize||s.push(o.getColId())}),s.length>0&&this.columnModel.autoSizeColumns({columns:s,skipHeader:e,stopAtGroup:this.columnGroup,source:"uiColumnResized"}),this.resizeLeafColumnsToFit("uiColumnResized")})}}onResizeStart(t){const e=this.getInitialValues(t);this.storeLocalValues(e),this.toggleColumnResizing(!0)}onResizing(t,e,s="uiColumnResized"){const i=this.normaliseDragChange(e),o=this.resizeStartWidth+i;this.resizeColumnsFromLocalValues(o,s,t)}getInitialValues(t){const e=this.getColumnsToResize(),s=this.getInitialSizeOfColumns(e),i=this.getSizeRatiosOfColumns(e,s),o={columnsToResize:e,resizeStartWidth:s,resizeRatios:i};let r=null;if(t&&(r=this.columnModel.getDisplayedGroupAtDirection(this.columnGroup,"After")),r){const n=r.getDisplayedLeafColumns(),l=o.groupAfterColumns=n.filter(d=>d.isResizable()),a=o.groupAfterStartWidth=this.getInitialSizeOfColumns(l);o.groupAfterRatios=this.getSizeRatiosOfColumns(l,a)}else o.groupAfterColumns=void 0,o.groupAfterStartWidth=void 0,o.groupAfterRatios=void 0;return o}storeLocalValues(t){const{columnsToResize:e,resizeStartWidth:s,resizeRatios:i,groupAfterColumns:o,groupAfterStartWidth:r,groupAfterRatios:n}=t;this.resizeCols=e,this.resizeStartWidth=s,this.resizeRatios=i,this.resizeTakeFromCols=o,this.resizeTakeFromStartWidth=r,this.resizeTakeFromRatios=n}clearLocalValues(){this.resizeCols=void 0,this.resizeRatios=void 0,this.resizeTakeFromCols=void 0,this.resizeTakeFromRatios=void 0}resizeLeafColumnsToFit(t){const e=this.autoWidthCalculator.getPreferredWidthForColumnGroup(this.columnGroup),s=this.getInitialValues();e>s.resizeStartWidth&&this.resizeColumns(s,e,t,!0)}resizeColumnsFromLocalValues(t,e,s=!0){var i,o,r;if(!this.resizeCols||!this.resizeRatios)return;const n={columnsToResize:this.resizeCols,resizeStartWidth:this.resizeStartWidth,resizeRatios:this.resizeRatios,groupAfterColumns:(i=this.resizeTakeFromCols)!=null?i:void 0,groupAfterStartWidth:(o=this.resizeTakeFromStartWidth)!=null?o:void 0,groupAfterRatios:(r=this.resizeTakeFromRatios)!=null?r:void 0};this.resizeColumns(n,t,e,s)}resizeColumns(t,e,s,i=!0){const{columnsToResize:o,resizeStartWidth:r,resizeRatios:n,groupAfterColumns:l,groupAfterStartWidth:a,groupAfterRatios:d}=t,h=[];if(h.push({columns:o,ratios:n,width:e}),l){const c=e-r;h.push({columns:l,ratios:d,width:a-c})}this.columnModel.resizeColumnSets({resizeSets:h,finished:i,source:s}),i&&this.toggleColumnResizing(!1)}toggleColumnResizing(t){this.comp.addOrRemoveCssClass("ag-column-resizing",t)}getColumnsToResize(){return this.columnGroup.getDisplayedLeafColumns().filter(e=>e.isResizable())}getInitialSizeOfColumns(t){return t.reduce((e,s)=>e+s.getActualWidth(),0)}getSizeRatiosOfColumns(t,e){return t.map(s=>s.getActualWidth()/e)}normaliseDragChange(t){let e=t;return this.gos.get("enableRtl")?this.pinned!=="left"&&(e*=-1):this.pinned==="right"&&(e*=-1),e}destroy(){super.destroy(),this.clearLocalValues()}};u([f("horizontalResizeService")],_o.prototype,"horizontalResizeService",2),u([f("autoWidthCalculator")],_o.prototype,"autoWidthCalculator",2),u([f("columnModel")],_o.prototype,"columnModel",2),u([M],_o.prototype,"postConstruct",1);var Ph=class extends L{constructor(t,e){super(),this.removeChildListenersFuncs=[],this.columnGroup=e,this.comp=t}postConstruct(){this.addListenersToChildrenColumns(),this.addManagedListener(this.columnGroup,He.EVENT_DISPLAYED_CHILDREN_CHANGED,this.onDisplayedChildrenChanged.bind(this)),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))}addListenersToChildrenColumns(){this.removeListenersOnChildrenColumns();const t=this.onWidthChanged.bind(this);this.columnGroup.getLeafColumns().forEach(e=>{e.addEventListener("widthChanged",t),e.addEventListener("visibleChanged",t),this.removeChildListenersFuncs.push(()=>{e.removeEventListener("widthChanged",t),e.removeEventListener("visibleChanged",t)})})}removeListenersOnChildrenColumns(){this.removeChildListenersFuncs.forEach(t=>t()),this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){const t=this.columnGroup.getActualWidth();this.comp.setWidth(`${t}px`),this.comp.addOrRemoveCssClass("ag-hidden",t===0)}};u([M],Ph.prototype,"postConstruct",1);var cm=class extends ln{constructor(t,e,s){super(t,e,s),this.onSuppressColMoveChange=()=>{if(!this.isAlive()||this.isSuppressMoving())this.removeDragSource();else if(!this.dragSource){const i=this.getGui();this.setDragSource(i)}},this.column=t}setComp(t,e,s){this.comp=t,this.setGui(e),this.displayName=this.beans.columnModel.getDisplayNameForColumnGroup(this.column,"header"),this.addClasses(),this.setupMovingCss(),this.setupExpandable(),this.setupTooltip(),this.addDestroyFunc(()=>{this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature))}),this.setupUserComp(),this.addHeaderMouseListeners();const i=this.getParentRowCtrl().getPinned(),o=this.column.getProvidedColumnGroup().getLeafColumns();this.createManagedBean(new Oo(o,e)),this.createManagedBean(new an(this.column,e,this.beans)),this.createManagedBean(new Ph(t,this.column)),this.resizeFeature=this.createManagedBean(new _o(t,s,i,this.column)),this.createManagedBean(new ws(e,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)})),this.addManagedPropertyListener(p.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED,this.onSuppressColMoveChange),this.addResizeAndMoveKeyboardListeners()}resizeHeader(t,e){if(!this.resizeFeature)return;const s=this.resizeFeature.getInitialValues(e);this.resizeFeature.resizeColumns(s,s.resizeStartWidth+t,"uiColumnResized",!0)}moveHeader(t){const{beans:e,eGui:s,column:i,gos:o,ctrlsService:r}=this,n=o.get("enableRtl"),l=t===0,a=this.getPinned(),d=s.getBoundingClientRect(),h=d.left,c=d.width,m=$s.normaliseX(l!==n?h-20:h+c+20,a,!0,o,r),C=i.getGroupId(),v=this.focusService.getFocusedHeader();$s.attemptMoveColumns({allMovingColumns:this.column.getLeafColumns(),isFromHeader:!0,hDirection:t,xPosition:m,pinned:a,fromEnter:!1,fakeEvent:!1,gos:o,columnModel:e.columnModel});const S=i.getDisplayedLeafColumns(),w=l?S[0]:ie(S);this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(w,"auto"),!this.isAlive()&&v&&this.restoreFocus(C,i,v)}restoreFocus(t,e,s){const i=e.getLeafColumns();if(!i.length)return;const o=i[0].getParent();if(!o)return;const r=this.findGroupWidthId(o,t);r&&this.focusService.focusHeaderPosition({headerPosition:Ee(_({},s),{column:r})})}findGroupWidthId(t,e){for(;t;){if(t.getGroupId()===e)return t;t=t.getParent()}return null}resizeLeafColumnsToFit(t){this.resizeFeature&&this.resizeFeature.resizeLeafColumnsToFit(t)}setupUserComp(){const t=this.gos.addGridCommonParams({displayName:this.displayName,columnGroup:this.column,setExpanded:s=>{this.beans.columnModel.setColumnGroupOpened(this.column.getProvidedColumnGroup(),s,"gridInitializing")},setTooltip:(s,i)=>{this.setupTooltip(s,i)}}),e=this.userComponentFactory.getHeaderGroupCompDetails(t);this.comp.setUserCompDetails(e)}addHeaderMouseListeners(){const t=i=>this.handleMouseOverChange(i.type==="mouseenter"),e=()=>this.dispatchColumnMouseEvent(p.EVENT_COLUMN_HEADER_CLICKED,this.column.getProvidedColumnGroup()),s=i=>this.handleContextMenuMouseEvent(i,void 0,this.column.getProvidedColumnGroup());this.addManagedListener(this.getGui(),"mouseenter",t),this.addManagedListener(this.getGui(),"mouseleave",t),this.addManagedListener(this.getGui(),"click",e),this.addManagedListener(this.getGui(),"contextmenu",s)}handleMouseOverChange(t){const s={type:t?p.EVENT_COLUMN_HEADER_MOUSE_OVER:p.EVENT_COLUMN_HEADER_MOUSE_LEAVE,column:this.column.getProvidedColumnGroup()};this.eventService.dispatchEvent(s)}setupTooltip(t,e){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const s=this.column.getColGroupDef(),i=this.gos.get("tooltipShowMode")==="whenTruncated",o=this.eGui;!e&&i&&!(s!=null&&s.headerGroupComponent)&&(e=()=>{const n=o.querySelector(".ag-header-group-text");return n?n.scrollWidth>n.clientWidth:!0});const r={getColumn:()=>this.column,getGui:()=>o,getLocation:()=>"headerGroup",getTooltipValue:()=>t??(s&&s.headerTooltip),shouldDisplayTooltip:e};s&&(r.getColDef=()=>s),this.createBean(new ds(r))}setupExpandable(){const t=this.column.getProvidedColumnGroup();this.refreshExpanded(),this.addManagedListener(t,Ie.EVENT_EXPANDABLE_CHANGED,this.refreshExpanded.bind(this)),this.addManagedListener(t,Ie.EVENT_EXPANDED_CHANGED,this.refreshExpanded.bind(this))}refreshExpanded(){const t=this.column;this.expandable=t.isExpandable();const e=t.isExpanded();this.expandable?this.comp.setAriaExpanded(e?"true":"false"):this.comp.setAriaExpanded(void 0)}getColId(){return this.column.getUniqueId()}addClasses(){const t=this.column.getColGroupDef(),e=tn.getHeaderClassesFromColDef(t,this.gos,null,this.column);this.column.isPadding()?(e.push("ag-header-group-cell-no-group"),this.column.getLeafColumns().every(i=>i.isSpanHeaderHeight())&&e.push("ag-header-span-height")):e.push("ag-header-group-cell-with-group"),e.forEach(s=>this.comp.addOrRemoveCssClass(s,!0))}setupMovingCss(){const e=this.column.getProvidedColumnGroup().getLeafColumns(),s=()=>this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving());e.forEach(i=>{this.addManagedListener(i,fe.EVENT_MOVING_CHANGED,s)}),s()}onFocusIn(t){if(!this.eGui.contains(t.relatedTarget)){const e=this.getRowIndex();this.beans.focusService.setFocusedHeader(e,this.column)}}handleKeyDown(t){super.handleKeyDown(t);const e=this.getWrapperHasFocus();if(!(!this.expandable||!e)&&t.key===E.ENTER){const s=this.column,i=!s.isExpanded();this.beans.columnModel.setColumnGroupOpened(s.getProvidedColumnGroup(),i,"uiColumnExpanded")}}setDragSource(t){if(!this.isAlive()||this.isSuppressMoving()||(this.removeDragSource(),!t))return;const{beans:e,column:s,displayName:i,gos:o,dragAndDropService:r}=this,{columnModel:n}=e,l=s.getProvidedColumnGroup().getLeafColumns();let a=!o.get("suppressDragLeaveHidesColumns");const d=this.dragSource={type:1,eElement:t,getDefaultIconName:()=>a?j.ICON_HIDE:j.ICON_NOT_ALLOWED,dragItemName:i,getDragItem:()=>this.getDragItemForGroup(s),onDragStarted:()=>{a=!o.get("suppressDragLeaveHidesColumns"),l.forEach(h=>h.setMoving(!0,"uiColumnDragged"))},onDragStopped:()=>l.forEach(h=>h.setMoving(!1,"uiColumnDragged")),onGridEnter:h=>{var c;if(a){const m=((c=h==null?void 0:h.columns)==null?void 0:c.filter(C=>!C.getColDef().lockVisible))||[];n.setColumnsVisible(m,!0,"uiColumnMoved")}},onGridExit:h=>{var c;if(a){const m=((c=h==null?void 0:h.columns)==null?void 0:c.filter(C=>!C.getColDef().lockVisible))||[];n.setColumnsVisible(m,!1,"uiColumnMoved")}}};r.addDragSource(d,!0)}getDragItemForGroup(t){const e=t.getProvidedColumnGroup().getLeafColumns(),s={};e.forEach(o=>s[o.getId()]=o.isVisible());const i=[];return this.beans.columnModel.getAllDisplayedColumns().forEach(o=>{e.indexOf(o)>=0&&(i.push(o),dt(e,o))}),e.forEach(o=>i.push(o)),{columns:i,visibleState:s}}isSuppressMoving(){let t=!1;return this.column.getLeafColumns().forEach(s=>{(s.getColDef().suppressMovable||s.getColDef().lockPosition)&&(t=!0)}),t||this.gos.get("suppressMovableColumns")}},pm=0,Vo=class extends L{constructor(t,e,s){super(),this.instanceId=pm++,this.rowIndex=t,this.pinned=e,this.type=s;const i=s=="group"?"ag-header-row-column-group":s=="filter"?"ag-header-row-column-filter":"ag-header-row-column";this.headerRowClass=`ag-header-row ${i}`}postConstruct(){this.isPrintLayout=this.gos.isDomLayout("print"),this.isEnsureDomOrder=this.gos.get("ensureDomOrder")}getInstanceId(){return this.instanceId}setComp(t,e=!0){this.comp=t,e&&(this.onRowHeightChanged(),this.onVirtualColumnsChanged()),this.setWidth(),this.addEventListeners()}getHeaderRowClass(){return this.headerRowClass}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(){this.addManagedListener(this.eventService,p.EVENT_COLUMN_RESIZED,this.onColumnResized.bind(this)),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_VIRTUAL_COLUMNS_CHANGED,t=>this.onVirtualColumnsChanged(t.afterScroll)),this.addManagedListener(this.eventService,p.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_GRID_STYLES_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("domLayout",this.onDisplayedColumnsChanged.bind(this)),this.addManagedPropertyListener("ensureDomOrder",t=>this.isEnsureDomOrder=t.currentValue),this.addManagedPropertyListener("headerHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("pivotHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("groupHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("pivotGroupHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("floatingFiltersHeight",this.onRowHeightChanged.bind(this))}getHeaderCellCtrl(t){if(this.headerCellCtrls)return Gs(this.headerCellCtrls).find(e=>e.getColumnGroupChild()===t)}onDisplayedColumnsChanged(){this.isPrintLayout=this.gos.isDomLayout("print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}getType(){return this.type}onColumnResized(){this.setWidth()}setWidth(){const t=this.getWidthForRow();this.comp.setWidth(`${t}px`)}getWidthForRow(){const{columnModel:t}=this.beans;return this.isPrintLayout?this.pinned!=null?0:t.getContainerWidth("right")+t.getContainerWidth("left")+t.getContainerWidth(null):t.getContainerWidth(this.pinned)}onRowHeightChanged(){var{topOffset:t,rowHeight:e}=this.getTopAndHeight();this.comp.setTop(t+"px"),this.comp.setHeight(e+"px")}getTopAndHeight(){const{columnModel:t,filterManager:e}=this.beans;let s=t.getHeaderRowCount();const i=[];let o=0;e.hasFloatingFilters()&&(s++,o=1);const r=t.getColumnGroupHeaderRowHeight(),n=t.getColumnHeaderRowHeight(),l=1+o,a=s-l;for(let c=0;c<a;c++)i.push(r);i.push(n);for(let c=0;c<o;c++)i.push(t.getFloatingFiltersHeight());let d=0;for(let c=0;c<this.rowIndex;c++)d+=i[c];const h=i[this.rowIndex];return{topOffset:d,rowHeight:h}}getPinned(){return this.pinned}getRowIndex(){return this.rowIndex}onVirtualColumnsChanged(t=!1){const e=this.getHeaderCtrls(),s=this.isEnsureDomOrder||this.isPrintLayout;this.comp.setHeaderCtrls(e,s,t)}getHeaderCtrls(){const t=this.headerCellCtrls;this.headerCellCtrls=new Map;const e=this.getColumnsInViewport();for(const o of e)this.recycleAndCreateHeaderCtrls(o,t);const s=o=>{const{focusService:r,columnModel:n}=this.beans;return r.isHeaderWrapperFocused(o)?n.isDisplayed(o.getColumnGroupChild()):!1};if(t)for(const[o,r]of t)s(r)?this.headerCellCtrls.set(o,r):this.destroyBean(r);return Array.from(this.headerCellCtrls.values())}recycleAndCreateHeaderCtrls(t,e){if(!this.headerCellCtrls||t.isEmptyGroup())return;const s=t.getUniqueId();let i;if(e&&(i=e.get(s),e.delete(s)),i&&i.getColumnGroupChild()!=t&&(this.destroyBean(i),i=void 0),i==null)switch(this.type){case"filter":i=this.createBean(new um(t,this.beans,this));break;case"group":i=this.createBean(new cm(t,this.beans,this));break;default:i=this.createBean(new hm(t,this.beans,this));break}this.headerCellCtrls.set(s,i)}getColumnsInViewport(){return this.isPrintLayout?this.getColumnsInViewportPrintLayout():this.getColumnsInViewportNormalLayout()}getColumnsInViewportPrintLayout(){if(this.pinned!=null)return[];let t=[];const e=this.getActualDepth(),{columnModel:s}=this.beans;return["left",null,"right"].forEach(i=>{const o=s.getVirtualHeaderGroupRow(i,e);t=t.concat(o)}),t}getActualDepth(){return this.type=="filter"?this.rowIndex-1:this.rowIndex}getColumnsInViewportNormalLayout(){return this.beans.columnModel.getVirtualHeaderGroupRow(this.pinned,this.getActualDepth())}focusHeader(t,e){if(!this.headerCellCtrls)return!1;const i=Array.from(this.headerCellCtrls.values()).find(o=>o.getColumnGroupChild()==t);return i?i.focus(e):!1}destroy(){this.headerCellCtrls&&this.headerCellCtrls.forEach(t=>{this.destroyBean(t)}),this.headerCellCtrls=void 0,super.destroy()}};u([f("beans")],Vo.prototype,"beans",2),u([M],Vo.prototype,"postConstruct",1);var Es=class extends L{constructor(t){super(),this.hidden=!1,this.includeFloatingFilter=!1,this.groupsRowCtrls=[],this.pinned=t}setComp(t,e){this.comp=t,this.eViewport=e,this.setupCenterWidth(),this.setupPinnedWidth(),this.setupDragAndDrop(this.eViewport),this.addManagedListener(this.eventService,p.EVENT_GRID_COLUMNS_CHANGED,this.onGridColumnsChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.ctrlsService.registerHeaderContainer(this,this.pinned),this.columnModel.isReady()&&this.refresh()}setupDragAndDrop(t){const e=new Oi(this.pinned,t);this.createManagedBean(e)}refresh(t=!1){const e=new Fi,s=this.focusService.getFocusHeaderToUseAfterRefresh(),i=()=>{const l=this.columnModel.getHeaderRowCount()-1;this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls);for(let a=0;a<l;a++){const d=this.createBean(new Vo(e.next(),this.pinned,"group"));this.groupsRowCtrls.push(d)}},o=()=>{const l=e.next(),a=!this.hidden&&(this.columnsRowCtrl==null||!t||this.columnsRowCtrl.getRowIndex()!==l);(a||this.hidden)&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),a&&(this.columnsRowCtrl=this.createBean(new Vo(l,this.pinned,"column")))},r=()=>{this.includeFloatingFilter=this.filterManager.hasFloatingFilters()&&!this.hidden;const l=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter){l();return}const a=e.next();if(this.filtersRowCtrl){const d=this.filtersRowCtrl.getRowIndex()!==a;(!t||d)&&l()}this.filtersRowCtrl||(this.filtersRowCtrl=this.createBean(new Vo(a,this.pinned,"filter")))};i(),o(),r();const n=this.getAllCtrls();this.comp.setCtrls(n),this.restoreFocusOnHeader(s)}restoreFocusOnHeader(t){t==null||t.column.getPinned()!=this.pinned||this.focusService.focusHeaderPosition({headerPosition:t})}getAllCtrls(){const t=[...this.groupsRowCtrls];return this.columnsRowCtrl&&t.push(this.columnsRowCtrl),this.filtersRowCtrl&&t.push(this.filtersRowCtrl),t}onGridColumnsChanged(){this.refresh(!0)}onDisplayedColumnsChanged(){const t=this.filterManager.hasFloatingFilters()&&!this.hidden;this.includeFloatingFilter!==t&&this.refresh(!0)}setupCenterWidth(){this.pinned==null&&this.createManagedBean(new Ii(t=>this.comp.setCenterWidth(`${t}px`),!0))}setHorizontalScroll(t){this.comp.setViewportScrollLeft(t)}setupPinnedWidth(){if(this.pinned==null)return;const t=this.pinned==="left",e=this.pinned==="right";this.hidden=!0;const s=()=>{const i=t?this.pinnedWidthService.getPinnedLeftWidth():this.pinnedWidthService.getPinnedRightWidth();if(i==null)return;const o=i==0,r=this.hidden!==o,n=this.gos.get("enableRtl"),l=this.gos.getScrollbarWidth(),d=this.scrollVisibleService.isVerticalScrollShowing()&&(n&&t||!n&&e)?i+l:i;this.comp.setPinnedContainerWidth(`${d}px`),this.comp.setDisplayed(!o),r&&(this.hidden=o,this.refresh())};this.addManagedListener(this.eventService,p.EVENT_LEFT_PINNED_WIDTH_CHANGED,s),this.addManagedListener(this.eventService,p.EVENT_RIGHT_PINNED_WIDTH_CHANGED,s),this.addManagedListener(this.eventService,p.EVENT_SCROLL_VISIBILITY_CHANGED,s),this.addManagedListener(this.eventService,p.EVENT_SCROLLBAR_WIDTH_CHANGED,s)}getHeaderCtrlForColumn(t){if(t instanceof fe)return this.columnsRowCtrl?this.columnsRowCtrl.getHeaderCellCtrl(t):void 0;if(this.groupsRowCtrls.length!==0)for(let e=0;e<this.groupsRowCtrls.length;e++){const s=this.groupsRowCtrls[e].getHeaderCellCtrl(t);if(s)return s}}getHtmlElementForColumnHeader(t){const e=this.getHeaderCtrlForColumn(t);return e?e.getGui():null}getRowType(t){const s=this.getAllCtrls()[t];return s?s.getType():void 0}focusHeader(t,e,s){const o=this.getAllCtrls()[t];return o?o.focusHeader(e,s):!1}getViewport(){return this.eViewport}getRowCount(){return this.groupsRowCtrls.length+(this.columnsRowCtrl?1:0)+(this.filtersRowCtrl?1:0)}destroy(){this.filtersRowCtrl&&(this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)),this.columnsRowCtrl&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),this.groupsRowCtrls&&this.groupsRowCtrls.length&&(this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls)),super.destroy()}};u([f("ctrlsService")],Es.prototype,"ctrlsService",2),u([f("scrollVisibleService")],Es.prototype,"scrollVisibleService",2),u([f("pinnedWidthService")],Es.prototype,"pinnedWidthService",2),u([f("columnModel")],Es.prototype,"columnModel",2),u([f("focusService")],Es.prototype,"focusService",2),u([f("filterManager")],Es.prototype,"filterManager",2);var ei=class Fn extends K{constructor(e){super(),this.headerRowComps={},this.rowCompsList=[],this.pinned=e}init(){this.selectAndSetTemplate();const e={setDisplayed:i=>this.setDisplayed(i),setCtrls:i=>this.setCtrls(i),setCenterWidth:i=>this.eCenterContainer.style.width=i,setViewportScrollLeft:i=>this.getGui().scrollLeft=i,setPinnedContainerWidth:i=>{const o=this.getGui();o.style.width=i,o.style.maxWidth=i,o.style.minWidth=i}};this.createManagedBean(new Es(this.pinned)).setComp(e,this.getGui())}selectAndSetTemplate(){const e=this.pinned=="left",s=this.pinned=="right",i=e?Fn.PINNED_LEFT_TEMPLATE:s?Fn.PINNED_RIGHT_TEMPLATE:Fn.CENTER_TEMPLATE;this.setTemplate(i),this.eRowContainer=this.eCenterContainer?this.eCenterContainer:this.getGui()}destroyRowComps(){this.setCtrls([])}destroyRowComp(e){this.destroyBean(e),this.eRowContainer.removeChild(e.getGui())}setCtrls(e){const s=this.headerRowComps;this.headerRowComps={},this.rowCompsList=[];let i;const o=r=>{const n=r.getGui();n.parentElement!=this.eRowContainer&&this.eRowContainer.appendChild(n),i&&Fl(this.eRowContainer,n,i),i=n};e.forEach(r=>{const n=r.getInstanceId(),l=s[n];delete s[n];const a=l||this.createBean(new ia(r));this.headerRowComps[n]=a,this.rowCompsList.push(a),o(a)}),ms(s).forEach(r=>this.destroyRowComp(r))}};ei.PINNED_LEFT_TEMPLATE='<div class="ag-pinned-left-header" role="rowgroup"></div>',ei.PINNED_RIGHT_TEMPLATE='<div class="ag-pinned-right-header" role="rowgroup"></div>',ei.CENTER_TEMPLATE=`<div class="ag-header-viewport" role="presentation">
222
+ <div class="ag-header-container" ref="eCenterContainer" role="rowgroup"></div>
223
+ </div>`,u([I("eCenterContainer")],ei.prototype,"eCenterContainer",2),u([M],ei.prototype,"init",1),u([tt],ei.prototype,"destroyRowComps",1);var ra=ei,ti=class extends L{constructor(){super(...arguments),this.currentHeaderRowWithoutSpan=-1}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCon=e.gridBodyCtrl});const t=this.gos.getDocument();this.addManagedListener(t,"mousedown",()=>this.setCurrentHeaderRowWithoutSpan(-1))}getHeaderRowCount(){const t=this.ctrlsService.getHeaderRowContainerCtrl();return t?t.getRowCount():0}navigateVertically(t,e,s){if(e||(e=this.focusService.getFocusedHeader()),!e)return!1;const{headerRowIndex:i,column:o}=e,r=this.getHeaderRowCount(),n=t===0;let{headerRowIndex:l,column:a,headerRowIndexWithoutSpan:d}=n?this.headerPositionUtils.getColumnVisibleParent(o,i):this.headerPositionUtils.getColumnVisibleChild(o,i),h=!1;return l<0&&(l=0,a=o,h=!0),l>=r?(l=-1,this.setCurrentHeaderRowWithoutSpan(-1)):d!==void 0&&(this.currentHeaderRowWithoutSpan=d),!h&&!a?!1:this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:l,column:a},allowUserOverride:!0,event:s})}setCurrentHeaderRowWithoutSpan(t){this.currentHeaderRowWithoutSpan=t}navigateHorizontally(t,e=!1,s){const i=this.focusService.getFocusedHeader(),o=t===2,r=this.gos.get("enableRtl");let n,l;if(this.currentHeaderRowWithoutSpan!==-1?i.headerRowIndex=this.currentHeaderRowWithoutSpan:this.currentHeaderRowWithoutSpan=i.headerRowIndex,o!==r?(l="Before",n=this.headerPositionUtils.findHeader(i,l)):(l="After",n=this.headerPositionUtils.findHeader(i,l)),n||!e)return this.focusService.focusHeaderPosition({headerPosition:n,direction:l,fromTab:e,allowUserOverride:!0,event:s});if(e){const a=this.gos.getCallback("tabToNextHeader");if(a)return this.focusService.focusHeaderPositionFromUserFunc({userFunc:a,headerPosition:n,direction:l})}return this.focusNextHeaderRow(i,l,s)}focusNextHeaderRow(t,e,s){const i=t.headerRowIndex;let o=null,r;if(e==="Before"?i>0&&(r=i-1,this.currentHeaderRowWithoutSpan-=1,o=this.headerPositionUtils.findColAtEdgeForHeaderRow(r,"end")):(r=i+1,this.currentHeaderRowWithoutSpan<this.getHeaderRowCount()?this.currentHeaderRowWithoutSpan+=1:this.setCurrentHeaderRowWithoutSpan(-1),o=this.headerPositionUtils.findColAtEdgeForHeaderRow(r,"start")),!o)return!1;const{column:n,headerRowIndex:l}=this.headerPositionUtils.getHeaderIndexToFocus(o.column,o==null?void 0:o.headerRowIndex);return this.focusService.focusHeaderPosition({headerPosition:{column:n,headerRowIndex:l},direction:e,fromTab:!0,allowUserOverride:!0,event:s})}scrollToColumn(t,e="After"){if(t.getPinned())return;let s;if(t instanceof He){const i=t.getDisplayedLeafColumns();s=e==="Before"?ie(i):i[0]}else s=t;this.gridBodyCon.getScrollFeature().ensureColumnVisible(s)}};u([f("focusService")],ti.prototype,"focusService",2),u([f("headerPositionUtils")],ti.prototype,"headerPositionUtils",2),u([f("ctrlsService")],ti.prototype,"ctrlsService",2),u([M],ti.prototype,"postConstruct",1),ti=u([O("headerNavigationService")],ti);var ys=class extends L{setComp(t,e,s){this.comp=t,this.eGui=e,this.createManagedBean(new ws(s,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addManagedListener(this.eventService,p.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onPivotModeChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.onPivotModeChanged(),this.setupHeaderHeight();const i=this.onHeaderContextMenu.bind(this);this.addManagedListener(this.eGui,"contextmenu",i),this.mockContextMenuForIPad(i),this.ctrlsService.register("gridHeaderCtrl",this)}setupHeaderHeight(){const t=this.setHeaderHeight.bind(this);t(),this.addManagedPropertyListener("headerHeight",t),this.addManagedPropertyListener("pivotHeaderHeight",t),this.addManagedPropertyListener("groupHeaderHeight",t),this.addManagedPropertyListener("pivotGroupHeaderHeight",t),this.addManagedPropertyListener("floatingFiltersHeight",t),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,t),this.addManagedListener(this.eventService,p.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,t),this.addManagedListener(this.eventService,p.EVENT_GRID_STYLES_CHANGED,t),this.addManagedListener(this.eventService,p.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,t)}getHeaderHeight(){return this.headerHeight}setHeaderHeight(){const{columnModel:t}=this;let e=0,s=t.getHeaderRowCount(),i;this.filterManager.hasFloatingFilters()&&(s++,e=1);const r=this.columnModel.getColumnGroupHeaderRowHeight(),n=this.columnModel.getColumnHeaderRowHeight(),l=1+e,a=s-l;if(i=e*t.getFloatingFiltersHeight(),i+=a*r,i+=n,this.headerHeight===i)return;this.headerHeight=i;const d=`${i+1}px`;this.comp.setHeightAndMinHeight(d),this.eventService.dispatchEvent({type:p.EVENT_HEADER_HEIGHT_CHANGED})}onPivotModeChanged(){const t=this.columnModel.isPivotMode();this.comp.addOrRemoveCssClass("ag-pivot-on",t),this.comp.addOrRemoveCssClass("ag-pivot-off",!t)}onDisplayedColumnsChanged(){const e=this.columnModel.getAllDisplayedColumns().some(s=>s.isSpanHeaderHeight());this.comp.addOrRemoveCssClass("ag-header-allow-overflow",e)}onTabKeyDown(t){const e=this.gos.get("enableRtl"),s=t.shiftKey!==e?2:3;(this.headerNavigationService.navigateHorizontally(s,!0,t)||this.focusService.focusNextGridCoreContainer(t.shiftKey))&&t.preventDefault()}handleKeyDown(t){let e=null;switch(t.key){case E.LEFT:e=2;case E.RIGHT:P(e)||(e=3),this.headerNavigationService.navigateHorizontally(e,!1,t);break;case E.UP:e=0;case E.DOWN:P(e)||(e=1),this.headerNavigationService.navigateVertically(e,null,t)&&t.preventDefault();break;default:return}}onFocusOut(t){const{relatedTarget:e}=t;!e&&this.eGui.contains(this.gos.getActiveDomElement())||this.eGui.contains(e)||this.focusService.clearFocusedHeader()}onHeaderContextMenu(t,e,s){if(!t&&!s||!this.menuService.isHeaderContextMenuEnabled())return;const{target:i}=t??e;(i===this.eGui||i===this.ctrlsService.getHeaderRowContainerCtrl().getViewport())&&this.menuService.showHeaderContextMenu(void 0,t,s)}mockContextMenuForIPad(t){if(!as())return;const e=new ze(this.eGui),s=i=>{t(void 0,i.touchStart,i.touchEvent)};this.addManagedListener(e,ze.EVENT_LONG_TAP,s),this.addDestroyFunc(()=>e.destroy())}};u([f("headerNavigationService")],ys.prototype,"headerNavigationService",2),u([f("focusService")],ys.prototype,"focusService",2),u([f("columnModel")],ys.prototype,"columnModel",2),u([f("ctrlsService")],ys.prototype,"ctrlsService",2),u([f("filterManager")],ys.prototype,"filterManager",2),u([f("menuService")],ys.prototype,"menuService",2);var na=class Fc extends K{constructor(){super(Fc.TEMPLATE)}postConstruct(){const e={addOrRemoveCssClass:(o,r)=>this.addOrRemoveCssClass(o,r),setHeightAndMinHeight:o=>{this.getGui().style.height=o,this.getGui().style.minHeight=o}};this.createManagedBean(new ys).setComp(e,this.getGui(),this.getFocusableElement());const i=o=>{this.createManagedBean(o),this.appendChild(o)};i(new ra("left")),i(new ra(null)),i(new ra("right"))}};na.TEMPLATE='<div class="ag-header" role="presentation"/>',u([M],na.prototype,"postConstruct",1);var gm=na,Ho=class extends L{addResizeBar(t){const e={dragStartPixels:t.dragStartPixels||0,eElement:t.eResizeBar,onDragStart:this.onDragStart.bind(this,t),onDragStop:this.onDragStop.bind(this,t),onDragging:this.onDragging.bind(this,t),includeTouch:!0,stopPropagationForTouch:!0};return this.dragService.addDragSource(e),()=>this.dragService.removeDragSource(e)}onDragStart(t,e){this.dragStartX=e.clientX,this.setResizeIcons();const s=e instanceof MouseEvent&&e.shiftKey===!0;t.onResizeStart(s)}setResizeIcons(){const t=this.ctrlsService.get("gridCtrl");t.setResizeCursor(!0),t.disableUserSelect(!0)}onDragStop(t,e){t.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){const t=this.ctrlsService.get("gridCtrl");t.setResizeCursor(!1),t.disableUserSelect(!1)}onDragging(t,e){this.resizeAmount=e.clientX-this.dragStartX,t.onResizing(this.resizeAmount)}};u([f("dragService")],Ho.prototype,"dragService",2),u([f("ctrlsService")],Ho.prototype,"ctrlsService",2),Ho=u([O("horizontalResizeService")],Ho);var Rs=class extends L{hideActiveMenu(){this.hidePopup&&this.hidePopup()}showMenuAfterMouseEvent(t,e,s){this.showPopup(t,i=>{this.popupService.positionPopupUnderMouseEvent({column:t,type:s,mouseEvent:e,ePopup:i})},s,e.target,this.menuService.isLegacyMenuEnabled())}showMenuAfterButtonClick(t,e,s){let i=-1,o="left";const r=this.menuService.isLegacyMenuEnabled();!r&&this.gos.get("enableRtl")&&(i=1,o="right");let n=r?void 0:4*i,l=r?void 0:4;this.showPopup(t,a=>{this.popupService.positionPopupByComponent({type:s,eventSource:e,ePopup:a,nudgeX:n,nudgeY:l,alignSide:o,keepWithinBounds:!0,position:"under",column:t})},s,e,r)}showPopup(t,e,s,i,o){const r=t?this.createBean(new $r(t,"COLUMN_MENU")):void 0;if(this.activeMenu=r,!(r!=null&&r.hasFilter())||!t)throw new Error("AG Grid - unable to show popup filter, filter instantiation failed");const n=document.createElement("div");Ae(n,"presentation"),n.classList.add("ag-menu"),o||n.classList.add("ag-filter-menu"),this.tabListener=this.addManagedListener(n,"keydown",v=>this.trapFocusWithin(v,n)),n.appendChild(r==null?void 0:r.getGui());let l;const a=()=>r==null?void 0:r.afterGuiDetached(),d=this.menuService.isColumnMenuAnchoringEnabled()?i??this.ctrlsService.getGridBodyCtrl().getGui():void 0,h=v=>{t.setMenuVisible(!1,"contextMenu");const S=v instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),S&&i&&ht(i)){const w=this.focusService.findTabbableParent(i);w&&w.focus()}a(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,s,t)},c=this.localeService.getLocaleTextFunc(),m=o&&s!=="columnFilter"?c("ariaLabelColumnMenu","Column Menu"):c("ariaLabelColumnFilter","Column Filter"),C=this.popupService.addPopup({modal:!0,eChild:n,closeOnEsc:!0,closedCallback:h,positionCallback:()=>e(n),anchorToElement:d,ariaLabel:m});C&&(this.hidePopup=l=C.hideFunc),r.afterInit().then(()=>{e(n),r.afterGuiAttached({container:s,hidePopup:l})}),t.setMenuVisible(!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,s,t)}trapFocusWithin(t,e){t.key!==E.TAB||t.defaultPrevented||this.focusService.findNextFocusableElement(e,!1,t.shiftKey)||(t.preventDefault(),this.focusService.focusInto(e,t.shiftKey))}dispatchVisibleChangedEvent(t,e,s){const i={type:p.EVENT_COLUMN_MENU_VISIBLE_CHANGED,visible:t,switchingTab:!1,key:e,column:s??null};this.eventService.dispatchEvent(i)}isMenuEnabled(t){var e;return t.isFilterAllowed()&&((e=t.getColDef().menuTabs)!=null?e:["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}};u([f("filterManager")],Rs.prototype,"filterManager",2),u([f("popupService")],Rs.prototype,"popupService",2),u([f("focusService")],Rs.prototype,"focusService",2),u([f("ctrlsService")],Rs.prototype,"ctrlsService",2),u([f("menuService")],Rs.prototype,"menuService",2),Rs=u([O("filterMenuFactory")],Rs);var dn=(t=>(t.TAB_GUARD="ag-tab-guard",t.TAB_GUARD_TOP="ag-tab-guard-top",t.TAB_GUARD_BOTTOM="ag-tab-guard-bottom",t))(dn||{}),un=class extends L{constructor(t){super(),this.skipTabGuardFocus=!1,this.forcingFocusOut=!1;const{comp:e,eTopGuard:s,eBottomGuard:i,focusTrapActive:o,forceFocusOutWhenTabGuardsAreEmpty:r,focusInnerElement:n,onFocusIn:l,onFocusOut:a,shouldStopEventPropagation:d,onTabKeyDown:h,handleKeyDown:c,eFocusableElement:m}=t;this.comp=e,this.eTopGuard=s,this.eBottomGuard=i,this.providedFocusInnerElement=n,this.eFocusableElement=m,this.focusTrapActive=!!o,this.forceFocusOutWhenTabGuardsAreEmpty=!!r,this.providedFocusIn=l,this.providedFocusOut=a,this.providedShouldStopEventPropagation=d,this.providedOnTabKeyDown=h,this.providedHandleKeyDown=c}postConstruct(){this.createManagedBean(new ws(this.eFocusableElement,{shouldStopEventPropagation:()=>this.shouldStopEventPropagation(),onTabKeyDown:t=>this.onTabKeyDown(t),handleKeyDown:t=>this.handleKeyDown(t),onFocusIn:t=>this.onFocusIn(t),onFocusOut:t=>this.onFocusOut(t)})),this.activateTabGuards(),[this.eTopGuard,this.eBottomGuard].forEach(t=>this.addManagedListener(t,"focus",this.onFocus.bind(this)))}handleKeyDown(t){this.providedHandleKeyDown&&this.providedHandleKeyDown(t)}tabGuardsAreActive(){return!!this.eTopGuard&&this.eTopGuard.hasAttribute("tabIndex")}shouldStopEventPropagation(){return this.providedShouldStopEventPropagation?this.providedShouldStopEventPropagation():!1}activateTabGuards(){if(this.forcingFocusOut)return;const t=this.gos.get("tabIndex");this.comp.setTabIndex(t.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(t){if(this.skipTabGuardFocus){this.skipTabGuardFocus=!1;return}if(this.forceFocusOutWhenTabGuardsAreEmpty&&this.focusService.findFocusableElements(this.eFocusableElement,".ag-tab-guard").length===0){this.findNextElementOutsideAndFocus(t.target===this.eBottomGuard);return}const e=t.target===this.eBottomGuard;this.providedFocusInnerElement?this.providedFocusInnerElement(e):this.focusInnerElement(e)}findNextElementOutsideAndFocus(t){const e=this.gos.getDocument(),s=this.focusService.findFocusableElements(e.body,null,!0),i=s.indexOf(t?this.eTopGuard:this.eBottomGuard);if(i===-1)return;let o,r;t?(o=0,r=i):(o=i+1,r=s.length);const n=s.slice(o,r),l=this.gos.get("tabIndex");n.sort((a,d)=>{const h=parseInt(a.getAttribute("tabindex")||"0"),c=parseInt(d.getAttribute("tabindex")||"0");return c===l?1:h===l?-1:h===0?1:c===0?-1:h-c}),n[t?n.length-1:0].focus()}onFocusIn(t){this.focusTrapActive||(this.providedFocusIn&&this.providedFocusIn(t),this.deactivateTabGuards())}onFocusOut(t){this.focusTrapActive||(this.providedFocusOut&&this.providedFocusOut(t),this.eFocusableElement.contains(t.relatedTarget)||this.activateTabGuards())}onTabKeyDown(t){if(this.providedOnTabKeyDown){this.providedOnTabKeyDown(t);return}if(this.focusTrapActive||t.defaultPrevented)return;const e=this.tabGuardsAreActive();e&&this.deactivateTabGuards();const s=this.getNextFocusableElement(t.shiftKey);e&&setTimeout(()=>this.activateTabGuards(),0),s&&(s.focus(),t.preventDefault())}focusInnerElement(t=!1){const e=this.focusService.findFocusableElements(this.eFocusableElement);this.tabGuardsAreActive()&&(e.splice(0,1),e.splice(e.length-1,1)),e.length&&e[t?e.length-1:0].focus({preventScroll:!0})}getNextFocusableElement(t){return this.focusService.findNextFocusableElement(this.eFocusableElement,!1,t)}forceFocusOutOfContainer(t=!1){if(this.forcingFocusOut)return;const e=t?this.eTopGuard:this.eBottomGuard;this.activateTabGuards(),this.skipTabGuardFocus=!0,this.forcingFocusOut=!0,e.focus(),window.setTimeout(()=>{this.forcingFocusOut=!1,this.activateTabGuards()})}isTabGuard(t){return t===this.eTopGuard||t===this.eBottomGuard}};u([f("focusService")],un.prototype,"focusService",2),u([M],un.prototype,"postConstruct",1);var ko=class extends K{initialiseTabGuard(e){this.eTopGuard=this.createTabGuard("top"),this.eBottomGuard=this.createTabGuard("bottom"),this.eFocusableElement=this.getFocusableElement();const s=[this.eTopGuard,this.eBottomGuard],i={setTabIndex:o=>{s.forEach(r=>o!=null?r.setAttribute("tabindex",o):r.removeAttribute("tabindex"))}};this.addTabGuards(this.eTopGuard,this.eBottomGuard),this.tabGuardCtrl=this.createManagedBean(new un({comp:i,focusTrapActive:!!e.focusTrapActive,eTopGuard:this.eTopGuard,eBottomGuard:this.eBottomGuard,eFocusableElement:this.eFocusableElement,onFocusIn:e.onFocusIn,onFocusOut:e.onFocusOut,focusInnerElement:e.focusInnerElement,handleKeyDown:e.handleKeyDown,onTabKeyDown:e.onTabKeyDown,shouldStopEventPropagation:e.shouldStopEventPropagation,forceFocusOutWhenTabGuardsAreEmpty:e.forceFocusOutWhenTabGuardsAreEmpty}))}createTabGuard(e){const s=document.createElement("div"),i=e==="top"?"ag-tab-guard-top":"ag-tab-guard-bottom";return s.classList.add("ag-tab-guard",i),Ae(s,"presentation"),s}addTabGuards(e,s){this.eFocusableElement.insertAdjacentElement("afterbegin",e),this.eFocusableElement.insertAdjacentElement("beforeend",s)}removeAllChildrenExceptTabGuards(){const e=[this.eTopGuard,this.eBottomGuard];Le(this.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}appendChild(e,s){Do(e)||(e=e.getGui());const{eBottomGuard:i}=this;i?i.insertAdjacentElement("beforebegin",e):super.appendChild(e,s)}},hn=class Lc extends ko{constructor(e){super(Lc.getTemplate(e.cssClass)),this.items=[],this.tabbedItemScrollMap=new Map,this.params=e}postConstruct(){this.setupHeader(),this.params.items&&this.params.items.forEach(e=>this.addItem(e)),this.initialiseTabGuard({onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),focusInnerElement:this.focusInnerElement.bind(this),focusTrapActive:!0}),this.addDestroyFunc(()=>{var e,s,i;return(i=(s=(e=this.activeItem)==null?void 0:e.tabbedItem)==null?void 0:s.afterDetachedCallback)==null?void 0:i.call(s)})}static getTemplate(e){return`<div class="ag-tabs ${e}">
224
+ <div ref="eHeader"></div>
225
+ <div ref="eBody" role="presentation" class="ag-tabs-body ${e?`${e}-body`:""}"></div>
226
+ </div>`}setupHeader(){const{enableCloseButton:e,cssClass:s}=this.params,i=(o,r)=>{o.classList.add(`ag-tabs-${r}`),s&&o.classList.add(`${s}-${r}`)};e?(this.setupCloseButton(i),this.eTabHeader=this.gos.getDocument().createElement("div"),i(this.eHeader,"header-wrapper"),Ae(this.eHeader,"presentation"),this.eHeader.appendChild(this.eTabHeader)):this.eTabHeader=this.eHeader,Ae(this.eTabHeader,"tablist"),i(this.eTabHeader,"header")}setupCloseButton(e){const s=this.gos.getDocument(),i=s.createElement("button");e(i,"close-button");const o=be("close",this.gos,void 0,!0);St(i,this.params.closeButtonAriaLabel),i.appendChild(o),this.addManagedListener(i,"click",()=>{var n,l;return(l=(n=this.params).onCloseClicked)==null?void 0:l.call(n)});const r=s.createElement("div");e(r,"close-button-wrapper"),Ae(r,"presentation"),r.appendChild(i),this.eHeader.appendChild(r),this.eCloseButton=i}handleKeyDown(e){switch(e.key){case E.RIGHT:case E.LEFT:if(!this.eTabHeader.contains(this.gos.getActiveDomElement()))return;const s=e.key===E.RIGHT,i=this.gos.get("enableRtl"),o=this.items.indexOf(this.activeItem),r=s!==i?Math.min(o+1,this.items.length-1):Math.max(o-1,0);if(o===r)return;e.preventDefault();const n=this.items[r];this.showItemWrapper(n),n.eHeaderButton.focus();break;case E.UP:case E.DOWN:e.stopPropagation();break}}onTabKeyDown(e){var s,i,o,r;if(e.defaultPrevented)return;const{focusService:n,eHeader:l,eBody:a,activeItem:d,params:h}=this,{suppressTrapFocus:c,enableCloseButton:m}=h,C=this.gos.getActiveDomElement(),v=e.target,S=e.shiftKey;if(l.contains(C)){e.preventDefault(),m&&S&&!((s=this.eCloseButton)!=null&&s.contains(C))?(i=this.eCloseButton)==null||i.focus():c&&S?(o=this.focusService.findFocusableElementBeforeTabGuard(this.gos.getDocument().body,v))==null||o.focus():this.focusBody(e.shiftKey);return}let w=null;if(n.isTargetUnderManagedComponent(a,v)&&(S&&(w=this.focusService.findFocusableElementBeforeTabGuard(a,v)),!w&&!c&&(w=d.eHeaderButton)),!w&&a.contains(C)&&(w=n.findNextFocusableElement(a,!1,S),!w)){e.preventDefault(),c&&!S?this.forceFocusOutOfContainer(S):m&&!S?(r=this.eCloseButton)==null||r.focus():this.focusHeader();return}w&&(e.preventDefault(),w.focus())}focusInnerElement(e){e?this.focusHeader():this.focusBody(!0)}focusHeader(e){this.activeItem.eHeaderButton.focus({preventScroll:e})}focusBody(e){this.focusService.focusInto(this.eBody,e)}setAfterAttachedParams(e){this.afterAttachedParams=e}showFirstItem(){this.items.length>0&&this.showItemWrapper(this.items[0])}addItem(e){const s=document.createElement("span");Ae(s,"tab"),s.setAttribute("tabindex","-1"),s.appendChild(e.title),s.classList.add("ag-tab"),this.eTabHeader.appendChild(s),St(s,e.titleLabel);const i={tabbedItem:e,eHeaderButton:s};this.items.push(i),s.addEventListener("click",this.showItemWrapper.bind(this,i))}showItem(e){const s=this.items.find(i=>i.tabbedItem===e);s&&this.showItemWrapper(s)}showItemWrapper(e){var s,i,o,r,n,l;const{tabbedItem:a,eHeaderButton:d}=e;if((i=(s=this.params).onItemClicked)==null||i.call(s,{item:a}),this.activeItem===e){(r=(o=this.params).onActiveItemClicked)==null||r.call(o);return}this.lastScrollListener&&(this.lastScrollListener=this.lastScrollListener()),Le(this.eBody),a.bodyPromise.then(h=>{this.eBody.appendChild(h);const c=!this.focusService.isKeyboardMode();if(this.params.suppressFocusBodyOnOpen||this.focusService.focusInto(this.eBody,!1,c),a.afterAttachedCallback&&a.afterAttachedCallback(this.afterAttachedParams),this.params.keepScrollPosition){const m=a.getScrollableContainer&&a.getScrollableContainer()||h;this.lastScrollListener=this.addManagedListener(m,"scroll",()=>{this.tabbedItemScrollMap.set(a.name,m.scrollTop)});const C=this.tabbedItemScrollMap.get(a.name);C!==void 0&&setTimeout(()=>{m.scrollTop=C},0)}}),this.activeItem&&(this.activeItem.eHeaderButton.classList.remove("ag-tab-selected"),(l=(n=this.activeItem.tabbedItem).afterDetachedCallback)==null||l.call(n)),d.classList.add("ag-tab-selected"),this.activeItem=e}};u([f("focusService")],hn.prototype,"focusService",2),u([I("eHeader")],hn.prototype,"eHeader",2),u([I("eBody")],hn.prototype,"eBody",2),u([M],hn.prototype,"postConstruct",1);var fm=50,la=class extends L{constructor(){super(...arguments),this.polyfillFunctions=[]}observeResize(t,e){const s=this.gos.getWindow(),i=()=>{const l=new s.ResizeObserver(e);return l.observe(t),()=>l.disconnect()},o=()=>{var l,a;let d=(l=t==null?void 0:t.clientWidth)!=null?l:0,h=(a=t==null?void 0:t.clientHeight)!=null?a:0,c=!0;const m=()=>{var C,v;if(c){const S=(C=t==null?void 0:t.clientWidth)!=null?C:0,w=(v=t==null?void 0:t.clientHeight)!=null?v:0;(S!==d||w!==h)&&(d=S,h=w,e()),this.doNextPolyfillTurn(m)}};return m(),()=>c=!1},r=this.gos.get("suppressBrowserResizeObserver");return!!s.ResizeObserver&&!r?i():this.getFrameworkOverrides().wrapIncoming(()=>o(),"resize-observer")}doNextPolyfillTurn(t){this.polyfillFunctions.push(t),this.schedulePolyfill()}schedulePolyfill(){if(this.polyfillScheduled)return;const t=()=>{const e=this.polyfillFunctions;this.polyfillScheduled=!1,this.polyfillFunctions=[],e.forEach(s=>s())};this.polyfillScheduled=!0,window.setTimeout(t,fm)}};la=u([O("resizeObserverService")],la);var Hi=class extends L{constructor(){super(...arguments),this.createTasksP1={list:[],sorted:!1},this.createTasksP2={list:[],sorted:!1},this.destroyTasks=[],this.ticking=!1,this.scrollGoingDown=!0,this.lastPage=0,this.lastScrollTop=0,this.taskCount=0,this.cancelledTasks=new Set}setScrollTop(t){const e=this.gos.get("pagination");if(this.scrollGoingDown=t>=this.lastScrollTop,e&&t===0){const s=this.paginationProxy.getCurrentPage();s!==this.lastPage&&(this.lastPage=s,this.scrollGoingDown=!0)}this.lastScrollTop=t}init(){this.useAnimationFrame=!this.gos.get("suppressAnimationFrame")}isOn(){return this.useAnimationFrame}verifyAnimationFrameOn(t){this.useAnimationFrame===!1&&console.warn(`AG Grid: AnimationFrameService.${t} called but animation frames are off`)}createTask(t,e,s){this.verifyAnimationFrameOn(s);const i={task:t,index:e,createOrder:++this.taskCount};this.addTaskToList(this[s],i),this.schedule()}cancelTask(t){this.cancelledTasks.add(t)}addTaskToList(t,e){t.list.push(e),t.sorted=!1}sortTaskList(t){if(t.sorted)return;const e=this.scrollGoingDown?1:-1;t.list.sort((s,i)=>s.index!==i.index?e*(i.index-s.index):i.createOrder-s.createOrder),t.sorted=!0}addDestroyTask(t){this.verifyAnimationFrameOn("createTasksP3"),this.destroyTasks.push(t),this.schedule()}executeFrame(t){this.verifyAnimationFrameOn("executeFrame");const e=this.createTasksP1,s=e.list,i=this.createTasksP2,o=i.list,r=this.destroyTasks,n=new Date().getTime();let l=new Date().getTime()-n;const a=t<=0,d=this.ctrlsService.getGridBodyCtrl();for(;a||l<t;){if(!d.getScrollFeature().scrollGridIfNeeded()){let c;if(s.length)this.sortTaskList(e),c=s.pop().task;else if(o.length)this.sortTaskList(i),c=o.pop().task;else if(r.length)c=r.pop();else{this.cancelledTasks.clear();break}this.cancelledTasks.has(c)||c()}l=new Date().getTime()-n}s.length||o.length||r.length?this.requestFrame():this.stopTicking()}stopTicking(){this.ticking=!1}flushAllFrames(){this.useAnimationFrame&&this.executeFrame(-1)}schedule(){this.useAnimationFrame&&(this.ticking||(this.ticking=!0,this.requestFrame()))}requestFrame(){const t=this.executeFrame.bind(this,60);this.requestAnimationFrame(t)}requestAnimationFrame(t){const e=this.gos.getWindow();e.requestAnimationFrame?e.requestAnimationFrame(t):e.webkitRequestAnimationFrame?e.webkitRequestAnimationFrame(t):e.setTimeout(t,0)}isQueueEmpty(){return!this.ticking}debounce(t){let e=!1;return()=>{if(!this.isOn()){window.setTimeout(t,0);return}e||(e=!0,this.addDestroyTask(()=>{e=!1,t()}))}}};u([f("ctrlsService")],Hi.prototype,"ctrlsService",2),u([f("paginationProxy")],Hi.prototype,"paginationProxy",2),u([M],Hi.prototype,"init",1),Hi=u([O("animationFrameService")],Hi);var Bo=class extends L{postConstruct(){this.isClientSideRowModel=this.rowModel.getType()==="clientSide"}expandRows(t){if(!this.isClientSideRowModel)return;const e=new Set(t);this.rowModel.forEachNode(s=>{s.id&&e.has(s.id)&&(s.expanded=!0)}),this.onGroupExpandedOrCollapsed()}getExpandedRows(){const t=[];return this.rowModel.forEachNode(({expanded:e,id:s})=>{e&&s&&t.push(s)}),t}expandAll(t){this.isClientSideRowModel&&this.rowModel.expandOrCollapseAll(t)}setRowNodeExpanded(t,e,s,i){t&&(s&&t.parent&&t.parent.level!==-1&&this.setRowNodeExpanded(t.parent,e,s,i),t.setExpanded(e,void 0,i))}onGroupExpandedOrCollapsed(){this.isClientSideRowModel&&this.rowModel.refreshModel({step:"map"})}};u([f("rowModel")],Bo.prototype,"rowModel",2),u([M],Bo.prototype,"postConstruct",1),Bo=u([O("expansionService")],Bo);var It=class extends L{postConstruct(){var t;this.activeMenuFactory=(t=this.enterpriseMenuFactory)!=null?t:this.filterMenuFactory}showColumnMenu(t){this.showColumnMenuCommon(this.activeMenuFactory,t,"columnMenu")}showFilterMenu(t){const e=this.enterpriseMenuFactory&&this.isLegacyMenuEnabled()?this.enterpriseMenuFactory:this.filterMenuFactory;this.showColumnMenuCommon(e,t,t.containerType,!0)}showHeaderContextMenu(t,e,s){this.activeMenuFactory.showMenuAfterContextMenuEvent(t,e,s)}getContextMenuPosition(t,e){const s=this.getRowCtrl(t),i=this.getCellGui(s,e);if(!i)return s?{x:0,y:s.getRowYPosition()}:{x:0,y:0};const o=i.getBoundingClientRect();return{x:o.x+o.width/2,y:o.y+o.height/2}}showContextMenu(t){var e,s,i;const{column:o,rowNode:r}=t;let{anchorToElement:n,value:l}=t;r&&o&&l==null&&(l=r.getValueFromValueService(o)),n==null&&(n=this.getContextMenuAnchorElement(r,o)),(i=this.contextMenuFactory)==null||i.onContextMenu((e=t.mouseEvent)!=null?e:null,(s=t.touchEvent)!=null?s:null,r??null,o??null,l,n)}showColumnChooser(t){var e;(e=this.columnChooserFactory)==null||e.showColumnChooser(t)}hidePopupMenu(){var t;(t=this.contextMenuFactory)==null||t.hideActiveMenu(),this.activeMenuFactory.hideActiveMenu()}hideColumnChooser(){var t;(t=this.columnChooserFactory)==null||t.hideActiveColumnChooser()}isColumnMenuInHeaderEnabled(t){const{suppressMenu:e,suppressHeaderMenuButton:s}=t.getColDef();return!(s??e)&&this.activeMenuFactory.isMenuEnabled(t)&&(this.isLegacyMenuEnabled()||!!this.enterpriseMenuFactory)}isFilterMenuInHeaderEnabled(t){return!t.getColDef().suppressHeaderFilterButton&&this.filterManager.isFilterAllowed(t)}isHeaderContextMenuEnabled(t){return!(t!=null&&t.getColDef().suppressHeaderContextMenu)&&this.getColumnMenuType()==="new"}isHeaderMenuButtonAlwaysShowEnabled(){return this.isSuppressMenuHide()}isHeaderMenuButtonEnabled(){const t=!this.isSuppressMenuHide();return!(as()&&t)}isHeaderFilterButtonEnabled(t){return this.isFilterMenuInHeaderEnabled(t)&&!this.isLegacyMenuEnabled()&&!this.isFloatingFilterButtonDisplayed(t)}isFilterMenuItemEnabled(t){return this.filterManager.isFilterAllowed(t)&&!this.isLegacyMenuEnabled()&&!this.isFilterMenuInHeaderEnabled(t)&&!this.isFloatingFilterButtonDisplayed(t)}isColumnMenuAnchoringEnabled(){return!this.isLegacyMenuEnabled()}areAdditionalColumnMenuItemsEnabled(){return this.getColumnMenuType()==="new"}isLegacyMenuEnabled(){return this.getColumnMenuType()==="legacy"}isFloatingFilterButtonEnabled(t){var e;const s=t.getColDef(),i=(e=s.floatingFilterComponentParams)==null?void 0:e.suppressFilterButton;return i!=null&&H("As of v31.1, 'colDef.floatingFilterComponentParams.suppressFilterButton' is deprecated. Use 'colDef.suppressFloatingFilterButton' instead."),s.suppressFloatingFilterButton==null?!i:!s.suppressFloatingFilterButton}getColumnMenuType(){var t;return(t=this.gos.get("columnMenu"))!=null?t:"legacy"}isFloatingFilterButtonDisplayed(t){return!!t.getColDef().floatingFilter&&this.isFloatingFilterButtonEnabled(t)}isSuppressMenuHide(){const t=this.gos.get("suppressMenuHide");return this.isLegacyMenuEnabled()||this.gos.exists("suppressMenuHide")?t:!0}showColumnMenuCommon(t,e,s,i){const{column:o,positionBy:r}=e;if(r==="button"){const{buttonElement:n}=e;t.showMenuAfterButtonClick(o,n,s,i)}else if(r==="mouse"){const{mouseEvent:n}=e;t.showMenuAfterMouseEvent(o,n,s,i)}else o&&(this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(o,"auto"),this.animationFrameService.requestAnimationFrame(()=>{const n=this.ctrlsService.getHeaderRowContainerCtrl(o.getPinned()).getHeaderCtrlForColumn(o);t.showMenuAfterButtonClick(o,n.getAnchorElementForMenu(i),s,!0)}))}getRowCtrl(t){const{rowIndex:e,rowPinned:s}=t||{};if(e!=null)return this.rowRenderer.getRowByPosition({rowIndex:e,rowPinned:s})||void 0}getCellGui(t,e){if(!t||!e)return;const s=t.getCellCtrl(e);return(s==null?void 0:s.getGui())||void 0}getContextMenuAnchorElement(t,e){const s=this.ctrlsService.getGridBodyCtrl().getGridBodyElement(),i=this.getRowCtrl(t);if(!i)return s;const o=this.getCellGui(i,e);return o||(i.isFullWidth()?i.getFullWidthElement():s)}};u([f("filterMenuFactory")],It.prototype,"filterMenuFactory",2),u([f("ctrlsService")],It.prototype,"ctrlsService",2),u([f("animationFrameService")],It.prototype,"animationFrameService",2),u([f("filterManager")],It.prototype,"filterManager",2),u([f("rowRenderer")],It.prototype,"rowRenderer",2),u([he("columnChooserFactory")],It.prototype,"columnChooserFactory",2),u([he("contextMenuFactory")],It.prototype,"contextMenuFactory",2),u([he("enterpriseMenuFactory")],It.prototype,"enterpriseMenuFactory",2),u([M],It.prototype,"postConstruct",1),It=u([O("menuService")],It);var si=class extends L{postConstruct(){this.ctrlsService.whenReady(t=>{this.centerRowContainerCtrl=t.center})}getPreferredWidthForColumn(t,e){const s=this.getHeaderCellForColumn(t);if(!s)return-1;const i=this.rowRenderer.getAllCellsForColumn(t);return e||i.push(s),this.addElementsToContainerAndGetWidth(i)}getPreferredWidthForColumnGroup(t){const e=this.getHeaderCellForColumn(t);return e?this.addElementsToContainerAndGetWidth([e]):-1}addElementsToContainerAndGetWidth(t){const e=document.createElement("form");e.style.position="fixed";const s=this.centerRowContainerCtrl.getContainerElement();t.forEach(r=>this.cloneItemIntoDummy(r,e)),s.appendChild(e);const i=e.offsetWidth;s.removeChild(e);const o=this.getAutoSizePadding();return i+o}getAutoSizePadding(){return this.gos.get("autoSizePadding")}getHeaderCellForColumn(t){let e=null;return this.ctrlsService.getHeaderRowContainerCtrls().forEach(s=>{const i=s.getHtmlElementForColumnHeader(t);i!=null&&(e=i)}),e}cloneItemIntoDummy(t,e){const s=t.cloneNode(!0);s.style.width="",s.style.position="static",s.style.left="";const i=document.createElement("div"),o=i.classList;["ag-header-cell","ag-header-group-cell"].some(l=>s.classList.contains(l))?(o.add("ag-header","ag-header-row"),i.style.position="static"):o.add("ag-row");let n=t.parentElement;for(;n;){if(["ag-header-row","ag-row"].some(a=>n.classList.contains(a))){for(let a=0;a<n.classList.length;a++){const d=n.classList[a];d!="ag-row-position-absolute"&&o.add(d)}break}n=n.parentElement}i.appendChild(s),e.appendChild(i)}};u([f("rowRenderer")],si.prototype,"rowRenderer",2),u([f("ctrlsService")],si.prototype,"ctrlsService",2),u([f("rowCssClassCalculator")],si.prototype,"rowCssClassCalculator",2),u([M],si.prototype,"postConstruct",1),si=u([O("autoWidthCalculator")],si);var Wo=class extends L{constructor(t,e){super(),this.createRowCon=t,this.destroyRowCtrls=e,this.stickyTopRowCtrls=[],this.stickyBottomRowCtrls=[],this.topContainerHeight=0,this.bottomContainerHeight=0}postConstruct(){this.isClientSide=this.rowModel.getType()==="clientSide",this.ctrlsService.whenReady(t=>{this.gridBodyCtrl=t.gridBodyCtrl})}getStickyTopRowCtrls(){return this.stickyTopRowCtrls}getStickyBottomRowCtrls(){return this.stickyBottomRowCtrls}getLastPixelOfGroup(t){return this.isClientSide?this.getClientSideLastPixelOfGroup(t):this.getServerSideLastPixelOfGroup(t)}getFirstPixelOfGroup(t){return t.footer?t.sibling.rowTop+t.sibling.rowHeight-1:t.hasChildren()?t.rowTop-1:0}getServerSideLastPixelOfGroup(t){var e,s,i,o;if(this.isClientSide)throw new Error("This func should only be called in server side row model.");if(t.isExpandable()||t.footer){if(t.master)return t.detailNode.rowTop+t.detailNode.rowHeight;if(!t.sibling||Math.abs(t.sibling.rowIndex-t.rowIndex)===1){let n=(e=t.childStore)==null?void 0:e.getStoreBounds();return t.footer&&(n=(s=t.sibling.childStore)==null?void 0:s.getStoreBounds()),((i=n==null?void 0:n.heightPx)!=null?i:0)+((o=n==null?void 0:n.topPx)!=null?o:0)}return t.footer?t.rowTop+t.rowHeight:t.sibling.rowTop+t.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}getClientSideLastPixelOfGroup(t){if(!this.isClientSide)throw new Error("This func should only be called in client side row model.");if(t.isExpandable()||t.footer){const e=t.footer&&t.rowIndex===0,s=!t.sibling||Math.abs(t.sibling.rowIndex-t.rowIndex)===1;if(e||s){let i=t.footer?t.sibling:t;for(;i.isExpandable()&&i.expanded;)if(i.master)i=i.detailNode;else if(i.childrenAfterSort){if(i.childrenAfterSort.length===0)break;i=ie(i.childrenAfterSort)}return i.rowTop+i.rowHeight}return t.footer?t.rowTop+t.rowHeight:t.sibling.rowTop+t.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}updateStickyRows(t){const e=t==="top";let s=0;if(!this.canRowsBeSticky())return this.refreshNodesAndContainerHeight(t,new Set,s);const i=e?this.rowRenderer.getFirstVisibleVerticalPixel():this.rowRenderer.getLastVisibleVerticalPixel(),o=new Set,r=d=>{if(o.add(d),e){const h=this.getLastPixelOfGroup(d),c=i+s+d.rowHeight;h<c?d.stickyRowTop=s+(h-c):d.stickyRowTop=s}else{const h=this.getFirstPixelOfGroup(d),c=i-(s+d.rowHeight);h>c?d.stickyRowTop=s-(h-c):d.stickyRowTop=s}s=0,o.forEach(h=>{const c=h.stickyRowTop+h.rowHeight;s<c&&(s=c)})},n=this.areFooterRowsStickySuppressed(),l=this.gos.get("suppressGroupRowsSticky"),a=d=>d.displayed?d.footer?n===!0||n==="grand"&&d.level===-1||n==="group"&&d.level>-1?!1:!o.has(d):d.isExpandable()?l===!0?!1:!o.has(d)&&d.expanded:!1:!1;for(let d=0;d<100;d++){let h=i+s;e||(h=i-s);const c=this.rowModel.getRowIndexAtPixel(h),m=this.rowModel.getRow(c);if(m==null)break;const v=this.getStickyAncestors(m).find(w=>(e?w.rowIndex<c:w.rowIndex>c)&&a(w));if(v){r(v);continue}if((e?m.rowTop<h:m.rowTop+m.rowHeight>h)&&a(m)){r(m);continue}break}return e||o.forEach(d=>{d.stickyRowTop=s-(d.stickyRowTop+d.rowHeight)}),this.refreshNodesAndContainerHeight(t,o,s)}areFooterRowsStickySuppressed(){const t=this.gos.get("suppressStickyTotalRow");if(t===!0)return!0;const e=!!this.gos.get("groupIncludeFooter")||t==="group",s=!!this.gos.get("groupIncludeTotalFooter")||t==="grand";return e&&s?!0:s?"grand":e?"group":!1}canRowsBeSticky(){const t=this.gos.isGroupRowsSticky(),e=this.areFooterRowsStickySuppressed(),s=this.gos.get("suppressGroupRowsSticky");return t&&(!e||!s)}getStickyAncestors(t){const e=[];let s=t.footer?t.sibling:t.parent;for(;s;)s.sibling&&e.push(s.sibling),e.push(s),s=s.parent;return e.reverse()}checkStickyRows(){const t=this.updateStickyRows("top"),e=this.updateStickyRows("bottom");return t||e}destroyStickyCtrls(){this.refreshNodesAndContainerHeight("top",new Set,0),this.refreshNodesAndContainerHeight("bottom",new Set,0)}refreshStickyNode(t){const e=new Set;if(this.stickyTopRowCtrls.some(s=>s.getRowNode()===t)){for(let s=0;s<this.stickyTopRowCtrls.length;s++){const i=this.stickyTopRowCtrls[s].getRowNode();i!==t&&e.add(i)}this.refreshNodesAndContainerHeight("top",e,this.topContainerHeight)&&this.checkStickyRows();return}for(let s=0;s<this.stickyBottomRowCtrls.length;s++){const i=this.stickyBottomRowCtrls[s].getRowNode();i!==t&&e.add(i)}this.refreshNodesAndContainerHeight("bottom",e,this.bottomContainerHeight)&&this.checkStickyRows()}refreshNodesAndContainerHeight(t,e,s){const i=t==="top",o=i?this.stickyTopRowCtrls:this.stickyBottomRowCtrls,r={},n=[];for(let c=0;c<o.length;c++){const m=o[c].getRowNode();if(!e.has(m)){r[m.id]=o[c],m.sticky=!1;continue}n.push(o[c])}const l=new Set;for(let c=0;c<n.length;c++)l.add(n[c].getRowNode());const a=[];e.forEach(c=>{l.has(c)||(c.sticky=!0,a.push(this.createRowCon(c,!1,!1)))});let d=!!a.length||n.length!==o.length;i?this.topContainerHeight!==s&&(this.topContainerHeight=s,this.gridBodyCtrl.setStickyTopHeight(s),d=!0):this.bottomContainerHeight!==s&&(this.bottomContainerHeight=s,this.gridBodyCtrl.setStickyBottomHeight(s),d=!0),this.destroyRowCtrls(r,!1);const h=[...n,...a];return h.sort((c,m)=>m.getRowNode().rowIndex-c.getRowNode().rowIndex),i||h.reverse(),h.forEach(c=>c.setRowTop(c.getRowNode().stickyRowTop)),d?(i?this.stickyTopRowCtrls=h:this.stickyBottomRowCtrls=h,!0):!1}};u([f("rowModel")],Wo.prototype,"rowModel",2),u([f("rowRenderer")],Wo.prototype,"rowRenderer",2),u([f("ctrlsService")],Wo.prototype,"ctrlsService",2),u([M],Wo.prototype,"postConstruct",1);var yt=class extends L{constructor(){super(...arguments),this.destroyFuncsForColumnListeners=[],this.rowCtrlsByRowIndex={},this.zombieRowCtrls={},this.allRowCtrls=[],this.topRowCtrls=[],this.bottomRowCtrls=[],this.refreshInProgress=!1,this.dataFirstRenderedFired=!1,this.setupRangeSelectionListeners=()=>{const t=()=>{this.getAllCellCtrls().forEach(r=>r.onRangeSelectionChanged())},e=()=>{this.getAllCellCtrls().forEach(r=>r.updateRangeBordersIfRangeCount())},s=()=>{this.eventService.addEventListener(p.EVENT_RANGE_SELECTION_CHANGED,t),this.eventService.addEventListener(p.EVENT_COLUMN_MOVED,e),this.eventService.addEventListener(p.EVENT_COLUMN_PINNED,e),this.eventService.addEventListener(p.EVENT_COLUMN_VISIBLE,e)},i=()=>{this.eventService.removeEventListener(p.EVENT_RANGE_SELECTION_CHANGED,t),this.eventService.removeEventListener(p.EVENT_COLUMN_MOVED,e),this.eventService.removeEventListener(p.EVENT_COLUMN_PINNED,e),this.eventService.removeEventListener(p.EVENT_COLUMN_VISIBLE,e)};this.addDestroyFunc(()=>i()),this.addManagedPropertyListener("enableRangeSelection",r=>{r.currentValue?s():i()}),this.gos.get("enableRangeSelection")&&s()}}postConstruct(){this.ctrlsService.whenReady(t=>{this.gridBodyCtrl=t.gridBodyCtrl,this.initialise()})}initialise(){if(this.addManagedListener(this.eventService,p.EVENT_PAGINATION_CHANGED,this.onPageLoaded.bind(this)),this.addManagedListener(this.eventService,p.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_BODY_SCROLL,this.onBodyScroll.bind(this)),this.addManagedListener(this.eventService,p.EVENT_BODY_HEIGHT_CHANGED,this.redraw.bind(this)),this.addManagedPropertyListeners(["domLayout","embedFullWidthRows"],()=>this.onDomLayoutChanged()),this.addManagedPropertyListeners(["suppressMaxRenderedRowRestriction","rowBuffer"],()=>this.redraw()),this.addManagedPropertyListeners(["suppressCellFocus","getBusinessKeyForNode","fullWidthCellRenderer","fullWidthCellRendererParams","rowStyle","getRowStyle","rowClass","getRowClass","rowClassRules","suppressStickyTotalRow","groupRowRenderer","groupRowRendererParams","loadingCellRenderer","loadingCellRendererParams","detailCellRenderer","detailCellRendererParams","enableRangeSelection","enableCellTextSelection"],()=>this.redrawRows()),this.gos.isGroupRowsSticky()){const t=this.rowModel.getType();(t==="clientSide"||t==="serverSide")&&(this.stickyRowFeature=this.createManagedBean(new Wo(this.createRowCon.bind(this),this.destroyRowCtrls.bind(this))))}this.registerCellEventListeners(),this.initialiseCache(),this.printLayout=this.gos.isDomLayout("print"),this.embedFullWidthRows=this.printLayout||this.gos.get("embedFullWidthRows"),this.redrawAfterModelUpdate()}initialiseCache(){if(this.gos.get("keepDetailRows")){const t=this.getKeepDetailRowsCount(),e=t??3;this.cachedRowCtrls=new mm(e)}}getKeepDetailRowsCount(){return this.gos.get("keepDetailRowsCount")}getStickyTopRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyTopRowCtrls():[]}getStickyBottomRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyBottomRowCtrls():[]}updateAllRowCtrls(){const t=ms(this.rowCtrlsByRowIndex),e=ms(this.zombieRowCtrls),s=this.cachedRowCtrls?this.cachedRowCtrls.getEntries():[];e.length>0||s.length>0?this.allRowCtrls=[...t,...e,...s]:this.allRowCtrls=t}onCellFocusChanged(t){this.getAllCellCtrls().forEach(e=>e.onCellFocused(t)),this.getFullWidthRowCtrls().forEach(e=>e.onFullWidthRowFocused(t))}registerCellEventListeners(){this.addManagedListener(this.eventService,p.EVENT_CELL_FOCUSED,t=>{this.onCellFocusChanged(t)}),this.addManagedListener(this.eventService,p.EVENT_CELL_FOCUS_CLEARED,()=>{this.onCellFocusChanged()}),this.addManagedListener(this.eventService,p.EVENT_FLASH_CELLS,t=>{this.getAllCellCtrls().forEach(e=>e.onFlashCells(t))}),this.addManagedListener(this.eventService,p.EVENT_COLUMN_HOVER_CHANGED,()=>{this.getAllCellCtrls().forEach(t=>t.onColumnHover())}),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,()=>{this.getAllCellCtrls().forEach(t=>t.onDisplayedColumnsChanged())}),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,()=>{this.printLayout&&this.getAllCellCtrls().forEach(t=>t.onLeftChanged())}),this.setupRangeSelectionListeners(),this.refreshListenersToColumnsForCellComps(),this.addManagedListener(this.eventService,p.EVENT_GRID_COLUMNS_CHANGED,this.refreshListenersToColumnsForCellComps.bind(this)),this.addDestroyFunc(this.removeGridColumnListeners.bind(this))}removeGridColumnListeners(){this.destroyFuncsForColumnListeners.forEach(t=>t()),this.destroyFuncsForColumnListeners.length=0}refreshListenersToColumnsForCellComps(){this.removeGridColumnListeners(),this.columnModel.getAllGridColumns().forEach(e=>{const s=a=>{this.getAllCellCtrls().forEach(d=>{d.getColumn()===e&&a(d)})},i=()=>{s(a=>a.onLeftChanged())},o=()=>{s(a=>a.onWidthChanged())},r=()=>{s(a=>a.onFirstRightPinnedChanged())},n=()=>{s(a=>a.onLastLeftPinnedChanged())},l=()=>{s(a=>a.onColDefChanged())};e.addEventListener("leftChanged",i),e.addEventListener("widthChanged",o),e.addEventListener("firstRightPinnedChanged",r),e.addEventListener("lastLeftPinnedChanged",n),e.addEventListener("colDefChanged",l),this.destroyFuncsForColumnListeners.push(()=>{e.removeEventListener("leftChanged",i),e.removeEventListener("widthChanged",o),e.removeEventListener("firstRightPinnedChanged",r),e.removeEventListener("lastLeftPinnedChanged",n),e.removeEventListener("colDefChanged",l)})})}onDomLayoutChanged(){const t=this.gos.isDomLayout("print"),e=t||this.gos.get("embedFullWidthRows"),s=e!==this.embedFullWidthRows||this.printLayout!==t;this.printLayout=t,this.embedFullWidthRows=e,s&&this.redrawAfterModelUpdate({domLayoutChanged:!0})}datasourceChanged(){this.firstRenderedRow=0,this.lastRenderedRow=-1;const t=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(t)}onPageLoaded(t){const e={recycleRows:t.keepRenderedRows,animate:t.animate,newData:t.newData,newPage:t.newPage,onlyBody:!0};this.redrawAfterModelUpdate(e)}getAllCellsForColumn(t){const e=[];return this.getAllRowCtrls().forEach(s=>{const i=s.getCellElement(t);i&&e.push(i)}),e}refreshFloatingRowComps(){this.refreshFloatingRows(this.topRowCtrls,this.pinnedRowModel.getPinnedTopRowData()),this.refreshFloatingRows(this.bottomRowCtrls,this.pinnedRowModel.getPinnedBottomRowData())}getTopRowCtrls(){return this.topRowCtrls}getCentreRowCtrls(){return this.allRowCtrls}getBottomRowCtrls(){return this.bottomRowCtrls}refreshFloatingRows(t,e){t.forEach(s=>{s.destroyFirstPass(),s.destroySecondPass()}),t.length=0,e&&e.forEach(s=>{const i=new Js(s,this.beans,!1,!1,this.printLayout);t.push(i)})}onPinnedRowDataChanged(){const t={recycleRows:!0};this.redrawAfterModelUpdate(t)}redrawRow(t,e=!1){var s;if(t.sticky)this.stickyRowFeature.refreshStickyNode(t);else if((s=this.cachedRowCtrls)!=null&&s.has(t)){this.cachedRowCtrls.removeRow(t);return}else{const i=o=>{const r=o[t.rowIndex];r&&r.getRowNode()===t&&(r.destroyFirstPass(),r.destroySecondPass(),o[t.rowIndex]=this.createRowCon(t,!1,!1))};switch(t.rowPinned){case"top":i(this.topRowCtrls);break;case"bottom":i(this.bottomRowCtrls);break;default:i(this.rowCtrlsByRowIndex),this.updateAllRowCtrls()}}e||this.dispatchDisplayedRowsChanged(!1)}redrawRows(t){if(t!=null){t==null||t.forEach(s=>this.redrawRow(s,!0)),this.dispatchDisplayedRowsChanged(!1);return}this.redrawAfterModelUpdate()}getCellToRestoreFocusToAfterRefresh(t){const e=t!=null&&t.suppressKeepFocus?null:this.focusService.getFocusCellToUseAfterRefresh();if(e==null)return null;const s=this.gos.getActiveDomElement(),i=this.gos.getDomData(s,Xs.DOM_DATA_KEY_CELL_CTRL),o=this.gos.getDomData(s,Js.DOM_DATA_KEY_ROW_CTRL);return i||o?e:null}redrawAfterModelUpdate(t={}){this.getLockOnRefresh();const e=this.getCellToRestoreFocusToAfterRefresh(t);this.updateContainerHeights(),this.scrollToTopIfNewData(t);const s=!t.domLayoutChanged&&!!t.recycleRows,i=t.animate&&this.gos.isAnimateRows(),o=s?this.getRowsToRecycle():null;s||this.removeAllRowComps(),this.workOutFirstAndLastRowsToRender(),this.stickyRowFeature&&this.stickyRowFeature.checkStickyRows(),this.recycleRows(o,i),this.gridBodyCtrl.updateRowCount(),t.onlyBody||this.refreshFloatingRowComps(),this.dispatchDisplayedRowsChanged(),e!=null&&this.restoreFocusedCell(e),this.releaseLockOnRefresh()}scrollToTopIfNewData(t){const e=t.newData||t.newPage,s=this.gos.get("suppressScrollOnNewData");e&&!s&&this.gridBodyCtrl.getScrollFeature().scrollToTop()}updateContainerHeights(){if(this.printLayout){this.rowContainerHeightService.setModelHeight(null);return}let t=this.paginationProxy.getCurrentPageHeight();t===0&&(t=1),this.rowContainerHeightService.setModelHeight(t)}getLockOnRefresh(){if(this.refreshInProgress)throw new Error("AG Grid: cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, e.g. instead of api.redrawRows(), call setTimeout(function() { api.redrawRows(); }, 0). To see what part of your code that caused the refresh check this stacktrace.");this.refreshInProgress=!0}releaseLockOnRefresh(){this.refreshInProgress=!1}isRefreshInProgress(){return this.refreshInProgress}restoreFocusedCell(t){t&&(this.focusService.setRestoreFocusedCell(t),this.onCellFocusChanged(this.beans.gos.addGridCommonParams({rowIndex:t.rowIndex,column:t.column,rowPinned:t.rowPinned,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,type:"mock"})))}stopEditing(t=!1){this.getAllRowCtrls().forEach(e=>{e.stopEditing(t)})}getAllCellCtrls(){const t=[],e=this.getAllRowCtrls(),s=e.length;for(let i=0;i<s;i++){const o=e[i].getAllCellCtrls(),r=o.length;for(let n=0;n<r;n++)t.push(o[n])}return t}getAllRowCtrls(){const t=this.stickyRowFeature&&this.stickyRowFeature.getStickyTopRowCtrls()||[],e=this.stickyRowFeature&&this.stickyRowFeature.getStickyBottomRowCtrls()||[],s=[...this.topRowCtrls,...this.bottomRowCtrls,...t,...e];for(const i in this.rowCtrlsByRowIndex)s.push(this.rowCtrlsByRowIndex[i]);return s}addRenderedRowListener(t,e,s){const i=this.rowCtrlsByRowIndex[e];i&&i.addEventListener(t,s)}flashCells(t={}){this.getCellCtrls(t.rowNodes,t.columns).forEach(e=>e.flashCell(t))}refreshCells(t={}){const e={forceRefresh:t.force,newData:!1,suppressFlash:t.suppressFlash};this.getCellCtrls(t.rowNodes,t.columns).forEach(s=>s.refreshOrDestroyCell(e)),t.rowNodes&&(this.getRowCtrls(t.rowNodes).forEach(s=>{if(!s.isFullWidth())return;s.refreshFullWidth()||this.redrawRow(s.getRowNode(),!0)}),this.dispatchDisplayedRowsChanged(!1))}getCellRendererInstances(t){var e;const s=this.getCellCtrls(t.rowNodes,t.columns).map(r=>r.getCellRenderer()).filter(r=>r!=null);if((e=t.columns)!=null&&e.length)return s;const i=[],o=this.mapRowNodes(t.rowNodes);return this.getAllRowCtrls().forEach(r=>{if(o&&!this.isRowInMap(r.getRowNode(),o)||!r.isFullWidth())return;const n=r.getFullWidthCellRenderers();for(let l=0;l<n.length;l++){const a=n[l];a!=null&&i.push(a)}}),[...i,...s]}getCellEditorInstances(t){const e=[];return this.getCellCtrls(t.rowNodes,t.columns).forEach(s=>{const i=s.getCellEditor();i&&e.push(i)}),e}getEditingCells(){const t=[];return this.getAllCellCtrls().forEach(e=>{if(e.isEditing()){const s=e.getCellPosition();t.push(s)}}),t}mapRowNodes(t){if(!t)return;const e={top:{},bottom:{},normal:{}};return t.forEach(s=>{const i=s.id;switch(s.rowPinned){case"top":e.top[i]=s;break;case"bottom":e.bottom[i]=s;break;default:e.normal[i]=s;break}}),e}isRowInMap(t,e){const s=t.id;switch(t.rowPinned){case"top":return e.top[s]!=null;case"bottom":return e.bottom[s]!=null;default:return e.normal[s]!=null}}getRowCtrls(t){const e=this.mapRowNodes(t),s=this.getAllRowCtrls();return!t||!e?s:s.filter(i=>{const o=i.getRowNode();return this.isRowInMap(o,e)})}getCellCtrls(t,e){let s;P(e)&&(s={},e.forEach(o=>{const r=this.columnModel.getGridColumn(o);P(r)&&(s[r.getId()]=!0)}));const i=[];return this.getRowCtrls(t).forEach(o=>{o.getAllCellCtrls().forEach(r=>{const n=r.getColumn().getId();s&&!s[n]||i.push(r)})}),i}destroy(){this.removeAllRowComps(),super.destroy()}removeAllRowComps(){const t=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(t),this.stickyRowFeature&&this.stickyRowFeature.destroyStickyCtrls()}getRowsToRecycle(){const t=[];je(this.rowCtrlsByRowIndex,(s,i)=>{i.getRowNode().id==null&&t.push(s)}),this.removeRowCtrls(t);const e={};return je(this.rowCtrlsByRowIndex,(s,i)=>{const o=i.getRowNode();e[o.id]=i}),this.rowCtrlsByRowIndex={},e}removeRowCtrls(t,e=!1){t.forEach(s=>{const i=this.rowCtrlsByRowIndex[s];i&&(i.destroyFirstPass(e),i.destroySecondPass()),delete this.rowCtrlsByRowIndex[s]})}onBodyScroll(t){t.direction==="vertical"&&this.redraw({afterScroll:!0})}redraw(t={}){const{afterScroll:e}=t;let s;this.stickyRowFeature&&wl()&&(s=this.getCellToRestoreFocusToAfterRefresh()||void 0);const i=this.firstRenderedRow,o=this.lastRenderedRow;this.workOutFirstAndLastRowsToRender();let r=!1;this.stickyRowFeature&&(r=this.stickyRowFeature.checkStickyRows());const n=this.firstRenderedRow!==i||this.lastRenderedRow!==o;if(!(e&&!r&&!n)&&(this.getLockOnRefresh(),this.recycleRows(null,!1,e),this.releaseLockOnRefresh(),this.dispatchDisplayedRowsChanged(e&&!r),s!=null)){const l=this.getCellToRestoreFocusToAfterRefresh();s!=null&&l==null&&(this.animationFrameService.flushAllFrames(),this.restoreFocusedCell(s))}}removeRowCompsNotToDraw(t,e){const s={};t.forEach(r=>s[r]=!0);const o=Object.keys(this.rowCtrlsByRowIndex).filter(r=>!s[r]);this.removeRowCtrls(o,e)}calculateIndexesToDraw(t){let e=Su(this.firstRenderedRow,this.lastRenderedRow);const s=(o,r)=>{const n=r.getRowNode().rowIndex;n!=null&&(n<this.firstRenderedRow||n>this.lastRenderedRow)&&this.doNotUnVirtualiseRow(r)&&e.push(n)};je(this.rowCtrlsByRowIndex,s),je(t,s),e.sort((o,r)=>o-r);const i=[];for(let o=0;o<e.length;o++){const r=e[o],n=this.paginationProxy.getRow(r);n&&!n.sticky&&i.push(r)}return i}recycleRows(t,e=!1,s=!1){const i=this.calculateIndexesToDraw(t);(this.printLayout||s)&&(e=!1),this.removeRowCompsNotToDraw(i,!e),i.forEach(o=>{this.createOrUpdateRowCtrl(o,t,e,s)}),t&&(s&&!this.gos.get("suppressAnimationFrame")&&!this.printLayout?this.beans.animationFrameService.addDestroyTask(()=>{this.destroyRowCtrls(t,e),this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}):this.destroyRowCtrls(t,e)),this.updateAllRowCtrls()}dispatchDisplayedRowsChanged(t=!1){const e={type:p.EVENT_DISPLAYED_ROWS_CHANGED,afterScroll:t};this.eventService.dispatchEvent(e)}onDisplayedColumnsChanged(){const t=this.columnModel.isPinningLeft(),e=this.columnModel.isPinningRight();(this.pinningLeft!==t||e!==this.pinningRight)&&(this.pinningLeft=t,this.pinningRight=e,this.embedFullWidthRows&&this.redrawFullWidthEmbeddedRows())}redrawFullWidthEmbeddedRows(){const t=[];this.getFullWidthRowCtrls().forEach(e=>{const s=e.getRowNode().rowIndex;t.push(s.toString())}),this.refreshFloatingRowComps(),this.removeRowCtrls(t),this.redraw({afterScroll:!0})}getFullWidthRowCtrls(t){const e=this.mapRowNodes(t);return this.getAllRowCtrls().filter(s=>{if(!s.isFullWidth())return!1;const i=s.getRowNode();return!(e!=null&&!this.isRowInMap(i,e))})}createOrUpdateRowCtrl(t,e,s,i){let o,r=this.rowCtrlsByRowIndex[t];if(r||(o=this.paginationProxy.getRow(t),P(o)&&P(e)&&e[o.id]&&o.alreadyRendered&&(r=e[o.id],e[o.id]=null)),!r)if(o||(o=this.paginationProxy.getRow(t)),P(o))r=this.createRowCon(o,s,i);else return;return o&&(o.alreadyRendered=!0),this.rowCtrlsByRowIndex[t]=r,r}destroyRowCtrls(t,e){const s=[];je(t,(i,o)=>{if(o){if(this.cachedRowCtrls&&o.isCacheable()){this.cachedRowCtrls.addRow(o);return}o.destroyFirstPass(!e),e?(this.zombieRowCtrls[o.getInstanceId()]=o,s.push(()=>{o.destroySecondPass(),delete this.zombieRowCtrls[o.getInstanceId()]})):o.destroySecondPass()}}),e&&(s.push(()=>{this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}),Fd(s))}getRowBuffer(){return this.gos.get("rowBuffer")}getRowBufferInPixels(){const t=this.getRowBuffer(),e=this.gos.getRowHeightAsNumber();return t*e}workOutFirstAndLastRowsToRender(){this.rowContainerHeightService.updateOffset();let t,e;if(!this.paginationProxy.isRowsToRender())t=0,e=-1;else if(this.printLayout)this.environment.refreshRowHeightVariable(),t=this.paginationProxy.getPageFirstRow(),e=this.paginationProxy.getPageLastRow();else{const l=this.getRowBufferInPixels(),a=this.ctrlsService.getGridBodyCtrl(),d=this.gos.get("suppressRowVirtualisation");let h=!1,c,m;do{const R=this.paginationProxy.getPixelOffset(),{pageFirstPixel:y,pageLastPixel:b}=this.paginationProxy.getCurrentPagePixelRange(),T=this.rowContainerHeightService.getDivStretchOffset(),D=a.getScrollFeature().getVScrollPosition(),A=D.top,F=D.bottom;d?(c=y+T,m=b+T):(c=Math.max(A+R-l,y)+T,m=Math.min(F+R+l,b)+T),this.firstVisibleVPixel=Math.max(A+R,y)+T,this.lastVisibleVPixel=Math.min(F+R,b)+T,h=this.ensureAllRowsInRangeHaveHeightsCalculated(c,m)}while(h);let C=this.paginationProxy.getRowIndexAtPixel(c),v=this.paginationProxy.getRowIndexAtPixel(m);const S=this.paginationProxy.getPageFirstRow(),w=this.paginationProxy.getPageLastRow();C<S&&(C=S),v>w&&(v=w),t=C,e=v}const s=this.gos.isDomLayout("normal"),i=this.gos.get("suppressMaxRenderedRowRestriction"),o=Math.max(this.getRowBuffer(),500);s&&!i&&e-t>o&&(e=t+o);const r=t!==this.firstRenderedRow,n=e!==this.lastRenderedRow;if(r||n){this.firstRenderedRow=t,this.lastRenderedRow=e;const l={type:p.EVENT_VIEWPORT_CHANGED,firstRow:t,lastRow:e};this.eventService.dispatchEvent(l)}}dispatchFirstDataRenderedEvent(){if(this.dataFirstRenderedFired)return;this.dataFirstRenderedFired=!0;const t={type:p.EVENT_FIRST_DATA_RENDERED,firstRow:this.firstRenderedRow,lastRow:this.lastRenderedRow};window.requestAnimationFrame(()=>{this.beans.eventService.dispatchEvent(t)})}ensureAllRowsInRangeHaveHeightsCalculated(t,e){const s=this.paginationProxy.ensureRowHeightsValid(t,e,-1,-1);return s&&this.updateContainerHeights(),s}getFirstVisibleVerticalPixel(){return this.firstVisibleVPixel}getLastVisibleVerticalPixel(){return this.lastVisibleVPixel}getFirstVirtualRenderedRow(){return this.firstRenderedRow}getLastVirtualRenderedRow(){return this.lastRenderedRow}doNotUnVirtualiseRow(t){const i=t.getRowNode(),o=this.focusService.isRowNodeFocused(i),r=t.isEditing(),n=i.detail;return o||r||n?!!this.paginationProxy.isRowPresent(i):!1}createRowCon(t,e,s){const i=this.cachedRowCtrls?this.cachedRowCtrls.getRow(t):null;if(i)return i;const o=this.gos.get("suppressAnimationFrame"),r=s&&!o&&!this.printLayout;return new Js(t,this.beans,e,r,this.printLayout)}getRenderedNodes(){const t=this.rowCtrlsByRowIndex;return Object.values(t).map(e=>e.getRowNode())}getRowByPosition(t){let e;const{rowIndex:s}=t;switch(t.rowPinned){case"top":e=this.topRowCtrls[s];break;case"bottom":e=this.bottomRowCtrls[s];break;default:e=this.rowCtrlsByRowIndex[s],e||(e=this.getStickyTopRowCtrls().find(i=>i.getRowNode().rowIndex===s)||null,e||(e=this.getStickyBottomRowCtrls().find(i=>i.getRowNode().rowIndex===s)||null));break}return e}isRangeInRenderedViewport(t,e){if(t==null||e==null)return!1;const i=t>this.lastRenderedRow;return!(e<this.firstRenderedRow)&&!i}};u([f("animationFrameService")],yt.prototype,"animationFrameService",2),u([f("paginationProxy")],yt.prototype,"paginationProxy",2),u([f("columnModel")],yt.prototype,"columnModel",2),u([f("pinnedRowModel")],yt.prototype,"pinnedRowModel",2),u([f("rowModel")],yt.prototype,"rowModel",2),u([f("focusService")],yt.prototype,"focusService",2),u([f("beans")],yt.prototype,"beans",2),u([f("rowContainerHeightService")],yt.prototype,"rowContainerHeightService",2),u([f("ctrlsService")],yt.prototype,"ctrlsService",2),u([M],yt.prototype,"postConstruct",1),yt=u([O("rowRenderer")],yt);var mm=class{constructor(t){this.entriesMap={},this.entriesList=[],this.maxCount=t}addRow(t){if(this.entriesMap[t.getRowNode().id]=t,this.entriesList.push(t),t.setCached(!0),this.entriesList.length>this.maxCount){const e=this.entriesList[0];e.destroyFirstPass(),e.destroySecondPass(),this.removeFromCache(e)}}getRow(t){if(t==null||t.id==null)return null;const e=this.entriesMap[t.id];return e?(this.removeFromCache(e),e.setCached(!1),e.getRowNode()!=t?null:e):null}has(t){return this.entriesMap[t.id]!=null}removeRow(t){const e=t.id,s=this.entriesMap[e];delete this.entriesMap[e],dt(this.entriesList,s)}removeFromCache(t){const e=t.getRowNode().id;delete this.entriesMap[e],dt(this.entriesList,t)}getEntries(){return this.entriesList}},Uo=class extends L{init(){this.setPinnedTopRowData(),this.setPinnedBottomRowData(),this.addManagedPropertyListener("pinnedTopRowData",()=>this.setPinnedTopRowData()),this.addManagedPropertyListener("pinnedBottomRowData",()=>this.setPinnedBottomRowData())}isEmpty(t){const e=t==="top"?this.pinnedTopRows:this.pinnedBottomRows;return bt(e)}isRowsToRender(t){return!this.isEmpty(t)}getRowAtPixel(t,e){const s=e==="top"?this.pinnedTopRows:this.pinnedBottomRows;if(bt(s))return 0;for(let i=0;i<s.length;i++){const o=s[i];if(o.rowTop+o.rowHeight-1>=t)return i}return s.length-1}setPinnedTopRowData(){const t=this.gos.get("pinnedTopRowData");this.pinnedTopRows=this.createNodesFromData(t,!0);const e={type:p.EVENT_PINNED_ROW_DATA_CHANGED};this.eventService.dispatchEvent(e)}setPinnedBottomRowData(){const t=this.gos.get("pinnedBottomRowData");this.pinnedBottomRows=this.createNodesFromData(t,!1);const e={type:p.EVENT_PINNED_ROW_DATA_CHANGED};this.eventService.dispatchEvent(e)}createNodesFromData(t,e){const s=[];if(t){let i=0;t.forEach((o,r)=>{const n=new J(this.beans);n.data=o;const l=e?J.ID_PREFIX_TOP_PINNED:J.ID_PREFIX_BOTTOM_PINNED;n.id=l+r,n.rowPinned=e?"top":"bottom",n.setRowTop(i),n.setRowHeight(this.gos.getRowHeightForNode(n).height),n.setRowIndex(r),i+=n.rowHeight,s.push(n)})}return s}getPinnedTopRowData(){return this.pinnedTopRows}getPinnedBottomRowData(){return this.pinnedBottomRows}getPinnedTopTotalHeight(){return this.getTotalHeight(this.pinnedTopRows)}getPinnedTopRowCount(){return this.pinnedTopRows?this.pinnedTopRows.length:0}getPinnedBottomRowCount(){return this.pinnedBottomRows?this.pinnedBottomRows.length:0}getPinnedTopRow(t){return this.pinnedTopRows[t]}getPinnedBottomRow(t){return this.pinnedBottomRows[t]}forEachPinnedTopRow(t){bt(this.pinnedTopRows)||this.pinnedTopRows.forEach(t)}forEachPinnedBottomRow(t){bt(this.pinnedBottomRows)||this.pinnedBottomRows.forEach(t)}getPinnedBottomTotalHeight(){return this.getTotalHeight(this.pinnedBottomRows)}getTotalHeight(t){if(!t||t.length===0)return 0;const e=ie(t);return e.rowTop+e.rowHeight}};u([f("beans")],Uo.prototype,"beans",2),u([M],Uo.prototype,"init",1),Uo=u([O("pinnedRowModel")],Uo);var cn=class{constructor(t,e){this.active=!0,this.nodeIdsToColumns={},this.mapToItems={},this.keepingColumns=t,this.pathRoot={rowNode:e,children:null},this.mapToItems[e.id]=this.pathRoot}setInactive(){this.active=!1}isActive(){return this.active}depthFirstSearchChangedPath(t,e){if(t.children)for(let s=0;s<t.children.length;s++)this.depthFirstSearchChangedPath(t.children[s],e);e(t.rowNode)}depthFirstSearchEverything(t,e,s){if(t.childrenAfterGroup)for(let i=0;i<t.childrenAfterGroup.length;i++){const o=t.childrenAfterGroup[i];o.childrenAfterGroup?this.depthFirstSearchEverything(t.childrenAfterGroup[i],e,s):s&&e(o)}e(t)}forEachChangedNodeDepthFirst(t,e=!1,s=!1){this.active&&!s?this.depthFirstSearchChangedPath(this.pathRoot,t):this.depthFirstSearchEverything(this.pathRoot.rowNode,t,e)}executeFromRootNode(t){t(this.pathRoot.rowNode)}createPathItems(t){let e=t,s=0;for(;!this.mapToItems[e.id];){const i={rowNode:e,children:null};this.mapToItems[e.id]=i,s++,e=e.parent}return s}populateColumnsMap(t,e){if(!this.keepingColumns||!e)return;let s=t;for(;s;)this.nodeIdsToColumns[s.id]||(this.nodeIdsToColumns[s.id]={}),e.forEach(i=>this.nodeIdsToColumns[s.id][i.getId()]=!0),s=s.parent}linkPathItems(t,e){let s=t;for(let i=0;i<e;i++){const o=this.mapToItems[s.id],r=this.mapToItems[s.parent.id];r.children||(r.children=[]),r.children.push(o),s=s.parent}}addParentNode(t,e){if(!t||t.isRowPinned())return;const s=this.createPathItems(t);this.linkPathItems(t,s),this.populateColumnsMap(t,e)}canSkip(t){return this.active&&!this.mapToItems[t.id]}getValueColumnsForNode(t,e){if(!this.keepingColumns)return e;const s=this.nodeIdsToColumns[t.id];return e.filter(o=>s[o.getId()])}getNotValueColumnsForNode(t,e){if(!this.keepingColumns)return null;const s=this.nodeIdsToColumns[t.id];return e.filter(o=>!s[o.getId()])}},ki=class Ci extends L{constructor(e){super(),this.state=Ci.STATE_WAITING_TO_LOAD,this.version=0,this.id=e}getId(){return this.id}load(){this.state=Ci.STATE_LOADING,this.loadFromDatasource()}getVersion(){return this.version}setStateWaitingToLoad(){this.version++,this.state=Ci.STATE_WAITING_TO_LOAD}getState(){return this.state}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state=Ci.STATE_FAILED,this.processServerFail()),this.dispatchLoadCompleted(!1)}success(e,s){this.successCommon(e,s)}pageLoaded(e,s,i){this.successCommon(e,{rowData:s,rowCount:i})}isRequestMostRecentAndLive(e){const s=e===this.version,i=this.isAlive();return s&&i}successCommon(e,s){this.dispatchLoadCompleted(),this.isRequestMostRecentAndLive(e)&&(this.state=Ci.STATE_LOADED,this.processServerResult(s))}dispatchLoadCompleted(e=!0){const s={type:Ci.EVENT_LOAD_COMPLETE,success:e,block:this};this.dispatchEvent(s)}};ki.EVENT_LOAD_COMPLETE="loadComplete",ki.STATE_WAITING_TO_LOAD="needsLoading",ki.STATE_LOADING="loading",ki.STATE_LOADED="loaded",ki.STATE_FAILED="failed";var aa=ki,Xt=class extends L{constructor(){super(...arguments),this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=this.getMaxConcurrentDatasourceRequests();const t=this.gos.get("blockLoadDebounceMillis");t&&t>0&&(this.checkBlockToLoadDebounce=W.debounce(this.performCheckBlocksToLoad.bind(this),t))}setBeans(t){this.logger=t.create("RowNodeBlockLoader")}getMaxConcurrentDatasourceRequests(){const t=this.gos.get("maxConcurrentDatasourceRequests");if(t==null)return 2;if(!(t<=0))return t}addBlock(t){this.blocks.push(t),t.addEventListener(aa.EVENT_LOAD_COMPLETE,this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(t){W.removeFromArray(this.blocks,t)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad(),this.dispatchEvent({type:Xt.BLOCK_LOADED_EVENT}),this.activeBlockLoadsCount==0&&this.dispatchEvent({type:Xt.BLOCK_LOADER_FINISHED_EVENT})}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),this.maxConcurrentRequests!=null&&this.activeBlockLoadsCount>=this.maxConcurrentRequests){this.logger.log("checkBlockToLoad: max loads exceeded");return}const t=this.getAvailableLoadingCount(),e=this.blocks.filter(s=>s.getState()===aa.STATE_WAITING_TO_LOAD).slice(0,t);this.registerLoads(e.length),e.forEach(s=>s.load()),this.printCacheStatus()}getBlockState(){if(this.gos.isRowModelType("serverSide"))return this.rowModel.getBlockStates();const t={};return this.blocks.forEach(e=>{const{id:s,state:i}=e.getBlockStateJson();t[s]=i}),t}printCacheStatus(){this.logger.isLogging()&&this.logger.log(`printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}isLoading(){return this.activeBlockLoadsCount>0}registerLoads(t){this.activeBlockLoadsCount+=t}getAvailableLoadingCount(){return this.maxConcurrentRequests!==void 0?this.maxConcurrentRequests-this.activeBlockLoadsCount:void 0}};Xt.BLOCK_LOADED_EVENT="blockLoaded",Xt.BLOCK_LOADER_FINISHED_EVENT="blockLoaderFinished",u([f("rowModel")],Xt.prototype,"rowModel",2),u([M],Xt.prototype,"postConstruct",1),u([xt(0,Tt("loggerFactory"))],Xt.prototype,"setBeans",1),Xt=u([O("rowNodeBlockLoader")],Xt);var zo=class extends L{constructor(){super(...arguments),this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.pixelOffset=0,this.masterRowCount=0}postConstruct(){this.active=this.gos.get("pagination"),this.pageSizeFromGridOptions=this.gos.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedListener(this.eventService,p.EVENT_MODEL_UPDATED,this.onModelUpdated.bind(this)),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this)),this.onModelUpdated()}ensureRowHeightsValid(t,e,s,i){const o=this.rowModel.ensureRowHeightsValid(t,e,this.getPageFirstRow(),this.getPageLastRow());return o&&this.calculatePages(),o}isPaginateChildRows(){return this.gos.get("groupRemoveSingleChildren")||this.gos.get("groupRemoveLowestSingleChildren")?!0:this.gos.get("paginateChildRows")}onModelUpdated(t){this.calculatePages();const e={type:p.EVENT_PAGINATION_CHANGED,animate:t?t.animate:!1,newData:t?t.newData:!1,newPage:t?t.newPage:!1,newPageSize:t?t.newPageSize:!1,keepRenderedRows:t?t.keepRenderedRows:!1};this.eventService.dispatchEvent(e)}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages();const t={type:p.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!1,newPageSize:!1,keepRenderedRows:!0};this.eventService.dispatchEvent(t)}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(t){if(!this.active||this.currentPage===t||typeof this.currentPage!="number")return;this.currentPage=t,this.calculatePages();const e={type:p.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!0,newPageSize:!1,keepRenderedRows:!1};this.eventService.dispatchEvent(e)}getPixelOffset(){return this.pixelOffset}getRow(t){return this.rowModel.getRow(t)}getRowNode(t){return this.rowModel.getRowNode(t)}getRowIndexAtPixel(t){return this.rowModel.getRowIndexAtPixel(t)}getCurrentPageHeight(){return z(this.topRowBounds)||z(this.bottomRowBounds)?0:Math.max(this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight-this.topRowBounds.rowTop,0)}getCurrentPagePixelRange(){const t=this.topRowBounds?this.topRowBounds.rowTop:0,e=this.bottomRowBounds?this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight:0;return{pageFirstPixel:t,pageLastPixel:e}}isRowPresent(t){return this.rowModel.isRowPresent(t)?t.rowIndex>=this.topDisplayedRowIndex&&t.rowIndex<=this.bottomDisplayedRowIndex:!1}isEmpty(){return this.rowModel.isEmpty()}isRowsToRender(){return this.rowModel.isRowsToRender()}forEachNode(t){return this.rowModel.forEachNode(t)}forEachNodeOnPage(t){const e=this.getPageFirstRow(),s=this.getPageLastRow();for(let i=e;i<=s;i++){const o=this.getRow(i);o&&t(o)}}getType(){return this.rowModel.getType()}getRowBounds(t){const e=this.rowModel.getRowBounds(t);return e.rowIndex=t,e}getPageFirstRow(){return this.topRowBounds?this.topRowBounds.rowIndex:-1}getPageLastRow(){return this.bottomRowBounds?this.bottomRowBounds.rowIndex:-1}getRowCount(){return this.rowModel.getRowCount()}getPageForIndex(t){return Math.floor(t/this.pageSize)}goToPageWithIndex(t){if(!this.active)return;const e=this.getPageForIndex(t);this.goToPage(e)}isRowInPage(t){return this.active?this.getPageForIndex(t.rowIndex)===this.currentPage:!0}isLastPageFound(){return this.rowModel.isLastRowIndexKnown()}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const t=this.rowModel.getRowCount(),e=Math.floor(t/this.pageSize);this.goToPage(e)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(t){this.currentPage=t}get pageSize(){return P(this.pageSizeAutoCalculated)?this.pageSizeAutoCalculated:P(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:P(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:P(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}unsetAutoCalculatedPageSize(){if(this.pageSizeAutoCalculated===void 0)return;const t=this.pageSizeAutoCalculated;if(this.pageSizeAutoCalculated=void 0,this.pageSize===t)return;this.calculatePages();const e={type:p.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!1,newPageSize:!0,keepRenderedRows:!1};this.eventService.dispatchEvent(e)}setPageSize(t,e){const s=this.pageSize;switch(e){case"autoCalculated":this.pageSizeAutoCalculated=t;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=t,this.currentPage!==0&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=t;break;case"gridOptions":this.pageSizeFromGridOptions=t,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,this.currentPage!==0&&this.goToFirstPage();break}if(s!==this.pageSize){this.calculatePages();const i={type:p.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!1,newPageSize:!0,keepRenderedRows:!0};this.eventService.dispatchEvent(i)}}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.topRowBounds=this.rowModel.getRowBounds(this.topDisplayedRowIndex),this.topRowBounds&&(this.topRowBounds.rowIndex=this.topDisplayedRowIndex),this.bottomRowBounds=this.rowModel.getRowBounds(this.bottomDisplayedRowIndex),this.bottomRowBounds&&(this.bottomRowBounds.rowIndex=this.bottomDisplayedRowIndex),this.setPixelOffset(P(this.topRowBounds)?this.topRowBounds.rowTop:0)}setPixelOffset(t){this.pixelOffset!==t&&(this.pixelOffset=t,this.eventService.dispatchEvent({type:p.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){this.currentPage>=this.totalPages&&(this.currentPage=this.totalPages-1),(!isFinite(this.currentPage)||isNaN(this.currentPage)||this.currentPage<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){if(this.masterRowCount=this.rowModel.getTopLevelRowCount(),this.masterRowCount<=0){this.setZeroRows();return}const t=this.masterRowCount-1;this.totalPages=Math.floor(t/this.pageSize)+1,this.adjustCurrentPageIfInvalid();const e=this.pageSize*this.currentPage;let s=this.pageSize*(this.currentPage+1)-1;if(s>t&&(s=t),this.topDisplayedRowIndex=this.rowModel.getTopLevelRowDisplayedIndex(e),s===t)this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1;else{const i=this.rowModel.getTopLevelRowDisplayedIndex(s+1);this.bottomDisplayedRowIndex=i-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){if(this.masterRowCount=this.rowModel.getRowCount(),this.masterRowCount===0){this.setZeroRows();return}const t=this.masterRowCount-1;this.totalPages=Math.floor(t/this.pageSize)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=this.pageSize*this.currentPage,this.bottomDisplayedRowIndex=this.pageSize*(this.currentPage+1)-1,this.bottomDisplayedRowIndex>t&&(this.bottomDisplayedRowIndex=t)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1}};u([f("rowModel")],zo.prototype,"rowModel",2),u([M],zo.prototype,"postConstruct",1),zo=u([O("paginationProxy")],zo);var pn=class extends L{processAllCellClasses(t,e,s,i){this.processClassRules(void 0,t.cellClassRules,e,s,i),this.processStaticCellClasses(t,e,s)}processClassRules(t,e,s,i,o){if(e==null&&t==null)return;const r={},n={},l=(a,d)=>{a.split(" ").forEach(h=>{h.trim()!=""&&d(h)})};if(e){const a=Object.keys(e);for(let d=0;d<a.length;d++){const h=a[d],c=e[h];let m;typeof c=="string"?m=this.expressionService.evaluate(c,s):typeof c=="function"&&(m=c(s)),l(h,C=>{m?r[C]=!0:n[C]=!0})}}t&&o&&Object.keys(t).forEach(a=>l(a,d=>{r[d]||(n[d]=!0)})),o&&Object.keys(n).forEach(o),Object.keys(r).forEach(i)}getStaticCellClasses(t,e){const{cellClass:s}=t;if(!s)return[];let i;return typeof s=="function"?i=s(e):i=s,typeof i=="string"&&(i=[i]),i||[]}processStaticCellClasses(t,e,s){this.getStaticCellClasses(t,e).forEach(o=>{s(o)})}};u([f("expressionService")],pn.prototype,"expressionService",2),pn=u([O("stylingService")],pn);var Fh=class extends jr{constructor(t){super(t,"ag-toggle-button")}setValue(t,e){return super.setValue(t,e),this.addOrRemoveCssClass("ag-selected",this.getValue()),this}},Cm=class extends Ht{constructor(t){super(t,"ag-text-area",null,"textarea")}setValue(t,e){const s=super.setValue(t,e);return this.eInput.value=t,s}setCols(t){return this.eInput.cols=t,this}setRows(t){return this.eInput.rows=t,this}},vm=class extends Us{constructor(t){super(t,"ag-date-field","date")}postConstruct(){super.postConstruct(),this.addManagedListener(this.eInput,"wheel",this.onWheel.bind(this));const t=qt();this.addManagedListener(this.eInput,"mousedown",()=>{this.isDisabled()||t||this.eInput.focus()}),this.eInput.step="any"}onWheel(t){this.gos.getActiveDomElement()===this.eInput&&t.preventDefault()}setMin(t){var e;const s=t instanceof Date?(e=Pt(t??null,!1))!=null?e:void 0:t;return this.min===s?this:(this.min=s,Qt(this.eInput,"min",s),this)}setMax(t){var e;const s=t instanceof Date?(e=Pt(t??null,!1))!=null?e:void 0:t;return this.max===s?this:(this.max=s,Qt(this.eInput,"max",s),this)}setStep(t){return this.step===t?this:(this.step=t,Qt(this.eInput,"step",t),this)}getDate(){var t;if(this.eInput.validity.valid)return(t=ut(this.getValue()))!=null?t:void 0}setDate(t,e){this.setValue(Pt(t??null,!1),e)}},wm=class extends Ht{constructor(t){super(t,"ag-range-field","range")}postConstruct(){super.postConstruct();const{min:t,max:e,step:s}=this.config;t!=null&&this.setMinValue(t),e!=null&&this.setMaxValue(e),this.setStep(s||1)}addInputListeners(){this.addManagedListener(this.eInput,"input",t=>{const e=t.target.value;this.setValue(e)})}setMinValue(t){return this.min=t,this.eInput.setAttribute("min",t.toString()),this}setMaxValue(t){return this.max=t,this.eInput.setAttribute("max",t.toString()),this}setStep(t){return this.eInput.setAttribute("step",t.toString()),this}setValue(t,e){this.min!=null&&(t=Math.max(parseFloat(t),this.min).toString()),this.max!=null&&(t=Math.min(parseFloat(t),this.max).toString());const s=super.setValue(t,e);return this.eInput.value=t,s}},da=class extends K{constructor(t,e){super('<div class="ag-rich-select-row" role="presentation"></div>'),this.params=t,this.wrapperEl=e}postConstruct(){this.addManagedListener(this.getGui(),"click",this.onClick.bind(this))}setState(t){let e="";this.params.valueFormatter&&(e=this.params.valueFormatter(t)),this.populateWithRenderer(t,e)||this.populateWithoutRenderer(t,e),this.value=t}highlightString(t){const{parsedValue:e}=this;if(this.params.cellRenderer||!P(e))return;let s=P(t);if(s){const i=e==null?void 0:e.toLocaleLowerCase().indexOf(t.toLocaleLowerCase());if(i>=0){const o=i+t.length,r=Ne(e.slice(0,i),!0),n=Ne(e.slice(i,o),!0),l=Ne(e.slice(o));this.renderValueWithoutRenderer(`${r}<span class="ag-rich-select-row-text-highlight">${n}</span>${l}`)}else s=!1}s||this.renderValueWithoutRenderer(e)}updateHighlighted(t){var e;const s=this.getGui(),i=`ag-rich-select-row-${this.getCompId()}`;if((e=s.parentElement)==null||e.setAttribute("id",i),t){const o=this.getParentComponent().getAriaElement();rl(o,i),this.wrapperEl.setAttribute("data-active-option",i)}Ti(s.parentElement,t),this.addOrRemoveCssClass("ag-rich-select-row-selected",t)}populateWithoutRenderer(t,e){const s=this.gos.getDocument(),i=this.getGui(),o=s.createElement("span");o.style.overflow="hidden",o.style.textOverflow="ellipsis";const r=Ne(P(e)?e:t,!0);this.parsedValue=P(r)?r:null,i.appendChild(o),this.renderValueWithoutRenderer(r),this.setTooltip({newTooltipText:this.parsedValue,shouldDisplayTooltip:()=>o.scrollWidth>o.clientWidth})}renderValueWithoutRenderer(t){const e=this.getGui().querySelector("span");e&&(e.innerHTML=P(t)?t:"&nbsp;")}populateWithRenderer(t,e){let s,i;return this.params.cellRenderer&&(i=this.userComponentFactory.getCellRendererDetails(this.params,{value:t,valueFormatted:e,setTooltip:(o,r)=>{this.setTooltip({newTooltipText:o,shouldDisplayTooltip:r})}})),i&&(s=i.newAgStackInstance()),s&&Nl(s,this.getGui()),s?(s.then(o=>{this.addDestroyFunc(()=>{this.getContext().destroyBean(o)})}),!0):!1}onClick(){const t=this.getParentComponent(),e={type:p.EVENT_FIELD_PICKER_VALUE_SELECTED,fromEnterKey:!1,value:this.value};t==null||t.dispatchEvent(e)}};u([f("userComponentFactory")],da.prototype,"userComponentFactory",2),u([M],da.prototype,"postConstruct",1);var Ko=class Mc extends ko{constructor(e){super(Mc.getTemplate((e==null?void 0:e.cssIdentifier)||"default")),this.renderedRows=new Map,this.rowHeight=20,this.pageSize=-1,this.isScrolling=!1,this.isHeightFromTheme=!0;const{cssIdentifier:s="default",ariaRole:i="listbox",listName:o}=e||{};this.cssIdentifier=s,this.ariaRole=i,this.listName=o}postConstruct(){this.addScrollListener(),this.rowHeight=this.getItemHeight(),this.addResizeObserver(),this.initialiseTabGuard({onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e),focusInnerElement:e=>this.focusInnerElement(e),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)}),this.setAriaProperties(),this.addManagedListener(this.eventService,p.EVENT_GRID_STYLES_CHANGED,this.onGridStylesChanged.bind(this))}onGridStylesChanged(){this.rowHeight=this.getItemHeight(),this.refresh()}setAriaProperties(){const s=this.localeService.getLocaleTextFunc()("ariaDefaultListName",this.listName||"List"),i=this.eContainer;Ae(i,this.ariaRole),St(i,s)}addResizeObserver(){const e=()=>this.animationFrameService.requestAnimationFrame(()=>this.drawVirtualRows()),s=this.resizeObserverService.observeResize(this.getGui(),e);this.addDestroyFunc(s)}focusInnerElement(e){this.focusRow(e?this.model.getRowCount()-1:0)}onFocusIn(e){const s=e.target;s.classList.contains("ag-virtual-list-item")&&(this.lastFocusedRowIndex=eu(s)-1)}onFocusOut(e){this.getFocusableElement().contains(e.relatedTarget)||(this.lastFocusedRowIndex=null)}handleKeyDown(e){switch(e.key){case E.UP:case E.DOWN:this.navigate(e.key===E.UP)&&e.preventDefault();break;case E.PAGE_HOME:case E.PAGE_END:case E.PAGE_UP:case E.PAGE_DOWN:this.navigateToPage(e.key)!==null&&e.preventDefault();break}}onTabKeyDown(e){this.navigate(e.shiftKey)?e.preventDefault():(Ot(e),this.forceFocusOutOfContainer(e.shiftKey))}navigate(e){if(this.lastFocusedRowIndex==null)return!1;const s=this.lastFocusedRowIndex+(e?-1:1);return s<0||s>=this.model.getRowCount()?!1:(this.focusRow(s),!0)}navigateToPage(e,s="focused"){let i=!1;s==="focused"&&(s=this.getLastFocusedRow(),i=!0);const o=this.model.getRowCount()-1;let r=-1;return e===E.PAGE_HOME?r=0:e===E.PAGE_END?r=o:e===E.PAGE_DOWN?r=Math.min(s+this.pageSize,o):e===E.PAGE_UP&&(r=Math.max(s-this.pageSize,0)),r===-1?null:(i?this.focusRow(r):this.ensureIndexVisible(r),r)}getLastFocusedRow(){return this.lastFocusedRowIndex}focusRow(e){this.isScrolling||(this.isScrolling=!0,this.ensureIndexVisible(e),this.animationFrameService.requestAnimationFrame(()=>{if(this.isScrolling=!1,!this.isAlive())return;const s=this.renderedRows.get(e);s&&s.eDiv.focus()}))}getComponentAt(e){const s=this.renderedRows.get(e);return s&&s.rowComponent}forEachRenderedRow(e){this.renderedRows.forEach((s,i)=>e(s.rowComponent,i))}static getTemplate(e){return`<div class="ag-virtual-list-viewport ag-${e}-virtual-list-viewport" role="presentation">
227
+ <div class="ag-virtual-list-container ag-${e}-virtual-list-container" ref="eContainer"></div>
228
+ </div>`}getItemHeight(){return this.isHeightFromTheme?this.environment.getListItemHeight():this.rowHeight}ensureIndexVisible(e,s=!0){const i=this.model.getRowCount();if(typeof e!="number"||e<0||e>=i)return console.warn("AG Grid: invalid row index for ensureIndexVisible: "+e),!1;const o=e*this.rowHeight,r=o+this.rowHeight,n=this.getGui(),l=n.scrollTop,a=n.offsetHeight,d=l+a,h=s?0:this.rowHeight,c=l>o+h,m=d<r-h;if(c)return n.scrollTop=o,!0;if(m){const C=r-a;return n.scrollTop=C,!0}return!1}setComponentCreator(e){this.componentCreator=e}setComponentUpdater(e){this.componentUpdater=e}getRowHeight(){return this.rowHeight}getScrollTop(){return this.getGui().scrollTop}setRowHeight(e){this.isHeightFromTheme=!1,this.rowHeight=e,this.refresh()}refresh(e){if(this.model==null||!this.isAlive())return;const s=this.model.getRowCount();this.eContainer.style.height=`${s*this.rowHeight}px`,Yn(()=>this.eContainer.clientHeight>=s*this.rowHeight,()=>{this.isAlive()&&(this.canSoftRefresh(e)?this.drawVirtualRows(!0):(this.clearVirtualRows(),this.drawVirtualRows()))})}canSoftRefresh(e){return!!(e&&this.renderedRows.size&&typeof this.model.areRowsEqual=="function"&&this.componentUpdater)}clearVirtualRows(){this.renderedRows.forEach((e,s)=>this.removeRow(s))}drawVirtualRows(e){if(!this.isAlive()||!this.model)return;const s=this.getGui(),i=s.scrollTop,o=i+s.offsetHeight,r=Math.floor(i/this.rowHeight),n=Math.floor(o/this.rowHeight);this.pageSize=Math.floor((o-i)/this.rowHeight),this.ensureRowsRendered(r,n,e)}ensureRowsRendered(e,s,i){this.renderedRows.forEach((o,r)=>{(r<e||r>s)&&r!==this.lastFocusedRowIndex&&this.removeRow(r)}),i&&this.refreshRows();for(let o=e;o<=s;o++)this.renderedRows.has(o)||o<this.model.getRowCount()&&this.insertRow(o)}insertRow(e){const s=this.model.getRow(e),i=document.createElement("div");i.classList.add("ag-virtual-list-item",`ag-${this.cssIdentifier}-virtual-list-item`),Ae(i,this.ariaRole==="tree"?"treeitem":"option"),Ir(i,this.model.getRowCount()),Nr(i,e+1),i.setAttribute("tabindex","-1"),i.style.height=`${this.rowHeight}px`,i.style.top=`${this.rowHeight*e}px`;const o=this.componentCreator(s,i);o.addGuiEventListener("focusin",()=>this.lastFocusedRowIndex=e),i.appendChild(o.getGui()),this.renderedRows.has(e-1)?this.renderedRows.get(e-1).eDiv.insertAdjacentElement("afterend",i):this.renderedRows.has(e+1)?this.renderedRows.get(e+1).eDiv.insertAdjacentElement("beforebegin",i):this.eContainer.appendChild(i),this.renderedRows.set(e,{rowComponent:o,eDiv:i,value:s})}removeRow(e){const s=this.renderedRows.get(e);this.eContainer.removeChild(s.eDiv),this.destroyBean(s.rowComponent),this.renderedRows.delete(e)}refreshRows(){const e=this.model.getRowCount();this.renderedRows.forEach((s,i)=>{var o,r;if(i>=e)this.removeRow(i);else{const n=this.model.getRow(i);(r=(o=this.model).areRowsEqual)!=null&&r.call(o,s.value,n)?this.componentUpdater(n,s.rowComponent):this.removeRow(i)}})}addScrollListener(){this.addGuiEventListener("scroll",()=>this.drawVirtualRows(),{passive:!0})}setModel(e){this.model=e}getAriaElement(){return this.eContainer}destroy(){this.isAlive()&&(this.clearVirtualRows(),super.destroy())}};u([f("resizeObserverService")],Ko.prototype,"resizeObserverService",2),u([f("animationFrameService")],Ko.prototype,"animationFrameService",2),u([I("eContainer")],Ko.prototype,"eContainer",2),u([M],Ko.prototype,"postConstruct",1);var Lh=Ko,Sm=`
229
+ <div class="ag-picker-field" role="presentation">
230
+ <div ref="eLabel"></div>
231
+ <div ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-rich-select-value ag-picker-collapsed">
232
+ <div ref="eDisplayField" class="ag-picker-field-display"></div>
233
+ <ag-input-text-field ref="eInput" class="ag-rich-select-field-input"></ag-input-text-field>
234
+ <div ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>
235
+ </div>
236
+ </div>`,gn=class extends Ws{constructor(t){var e,s;super(Ee(_({pickerAriaLabelKey:"ariaLabelRichSelectField",pickerAriaLabelValue:"Rich Select Field",pickerType:"ag-list",className:"ag-rich-select",pickerIcon:"smallDown",ariaRole:"combobox",template:(e=t==null?void 0:t.template)!=null?e:Sm,modalPicker:!1},t),{maxPickerHeight:(s=t==null?void 0:t.maxPickerHeight)!=null?s:"calc(var(--ag-row-height) * 6.5)"})),this.searchString="",this.highlightedItem=-1,this.lastRowHovered=-1,this.searchStringCreator=null;const{cellRowHeight:i,value:o,valueList:r,searchStringCreator:n}=t||{};i!=null&&(this.cellRowHeight=i),o!==void 0&&(this.value=o),r!=null&&(this.values=r),n&&(this.searchStringCreator=n)}postConstruct(){super.postConstruct(),this.createLoadingElement(),this.createListComponent();const{allowTyping:t,placeholder:e}=this.config;t?(this.eInput.setAutoComplete(!1).setInputPlaceholder(e),this.eDisplayField.classList.add("ag-hidden")):this.eInput.setDisplayed(!1),this.eWrapper.tabIndex=this.gos.get("tabIndex");const{searchDebounceDelay:s=300}=this.config;this.clearSearchString=et(this.clearSearchString,s),this.renderSelectedValue(),t&&(this.eInput.onValueChange(i=>this.searchTextFromString(i)),this.addManagedListener(this.eWrapper,"focus",this.onWrapperFocus.bind(this))),this.addManagedListener(this.eWrapper,"focusout",this.onWrapperFocusOut.bind(this))}createLoadingElement(){const t=this.gos.getDocument(),e=this.localeService.getLocaleTextFunc(),s=t.createElement("div");s.classList.add("ag-loading-text"),s.innerText=e("loadingOoo","Loading..."),this.eLoading=s}createListComponent(){this.listComponent=this.createBean(new Lh({cssIdentifier:"rich-select"})),this.listComponent.setComponentCreator(this.createRowComponent.bind(this));const t=(l,a)=>{};this.listComponent.setComponentUpdater(t),this.listComponent.setParentComponent(this),this.addManagedListener(this.listComponent,p.EVENT_FIELD_PICKER_VALUE_SELECTED,l=>{this.onListValueSelected(l.value,l.fromEnterKey)});const{cellRowHeight:e}=this;e&&this.listComponent.setRowHeight(e);const s=this.listComponent.getGui(),i=this.listComponent.getAriaElement();this.addManagedListener(s,"mousemove",this.onPickerMouseMove.bind(this)),this.addManagedListener(s,"mousedown",l=>l.preventDefault()),s.classList.add("ag-rich-select-list");const o=`ag-rich-select-list-${this.listComponent.getCompId()}`;i.setAttribute("id",o);const n=this.localeService.getLocaleTextFunc()(this.config.pickerAriaLabelKey,this.config.pickerAriaLabelValue);St(i,n),al(this.eWrapper,i)}renderSelectedValue(){const{value:t,eDisplayField:e,config:s}=this,{allowTyping:i,initialInputValue:o}=this.config,r=this.config.valueFormatter?this.config.valueFormatter(t):t;if(i){this.eInput.setValue(o??r);return}let n;s.cellRenderer&&(n=this.userComponentFactory.getCellRendererDetails(this.config,{value:t,valueFormatted:r}));let l;if(n&&(l=n.newAgStackInstance()),l)Le(e),Nl(l,e),l.then(a=>{this.addDestroyFunc(()=>this.getContext().destroyBean(a))});else{if(P(this.value))e.innerText=r,e.classList.remove("ag-display-as-placeholder");else{const{placeholder:a}=s;P(a)?(e.innerHTML=`${Ne(a)}`,e.classList.add("ag-display-as-placeholder")):Le(e)}this.setTooltip({newTooltipText:r??null,shouldDisplayTooltip:()=>this.eDisplayField.scrollWidth>this.eDisplayField.clientWidth})}}getCurrentValueIndex(){const{currentList:t,value:e}=this;if(e==null||!t)return-1;for(let s=0;s<t.length;s++)if(t[s]===e)return s;return-1}highlightFilterMatch(){var t;(t=this.listComponent)==null||t.forEachRenderedRow((e,s)=>{e.highlightString(this.searchString)})}highlightSelectedValue(t){var e;t==null&&(t=this.getCurrentValueIndex()),this.highlightedItem=t,(e=this.listComponent)==null||e.forEachRenderedRow((s,i)=>{const o=t===-1?!1:this.highlightedItem===i;s.updateHighlighted(o)})}setRowHeight(t){t!==this.cellRowHeight&&(this.cellRowHeight=t),this.listComponent&&this.listComponent.setRowHeight(t)}createPickerComponent(){const{values:t}=this;return t&&this.setValueList({valueList:t}),this.listComponent}setSearchStringCreator(t){this.searchStringCreator=t}setValueList(t){const{valueList:e,refresh:s}=t;this.listComponent&&this.currentList!==e&&(this.currentList=e,this.listComponent.setModel({getRowCount:()=>e.length,getRow:i=>e[i],areRowsEqual:(i,o)=>i===o}),s&&(this.values?this.listComponent.refresh(!0):(this.values=e,this.isPickerDisplayed&&this.showCurrentValueInPicker())))}showPicker(){super.showPicker(),this.showCurrentValueInPicker(),this.displayOrHidePicker()}showCurrentValueInPicker(){var t,e;if(!this.listComponent)return;if(!this.currentList){this.isPickerDisplayed&&this.eLoading&&this.listComponent.appendChild(this.eLoading);return}(t=this.eLoading)!=null&&t.offsetParent&&((e=this.eLoading.parentElement)==null||e.removeChild(this.eLoading));const s=this.getCurrentValueIndex();s!==-1?(this.listComponent.refresh(),this.listComponent.ensureIndexVisible(s),this.listComponent.refresh(!0),this.highlightSelectedValue(s)):this.listComponent.refresh()}beforeHidePicker(){this.highlightedItem=-1,super.beforeHidePicker()}onWrapperFocus(){if(!this.eInput)return;const t=this.eInput.getFocusableElement();t.focus(),t.select()}onWrapperFocusOut(t){this.eWrapper.contains(t.relatedTarget)||this.hidePicker()}buildSearchStringFromKeyboardEvent(t){let{key:e}=t;if(e===E.BACKSPACE)this.searchString=this.searchString.slice(0,-1),e="";else if(!kr(t))return;t.preventDefault(),this.searchTextFromCharacter(e)}searchTextFromCharacter(t){this.searchString+=t,this.runSearch(),this.clearSearchString()}searchTextFromString(t){t==null&&(t=""),this.searchString=t,this.runSearch()}buildSearchStrings(t){const{valueFormatter:e=i=>i}=this.config;let s;return typeof t[0]=="number"||typeof t[0]=="string"?s=t.map(i=>e(i)):typeof t[0]=="object"&&this.searchStringCreator&&(s=this.searchStringCreator(t)),s}getSuggestionsAndFilteredValues(t,e){let s=[],i=[];if(!t.length)return{suggestions:s,filteredValues:i};const{searchType:o="fuzzy",filterList:r}=this.config;if(o==="fuzzy"){const n=Ao(this.searchString,e,!0);s=n.values;const l=n.indices;if(r&&l.length)for(let a=0;a<l.length;a++)i.push(this.values[l[a]])}else s=e.filter((n,l)=>{const a=n.toLocaleLowerCase(),d=this.searchString.toLocaleLowerCase(),h=o==="match"?a.startsWith(d):a.indexOf(d)!==-1;return r&&h&&i.push(this.values[l]),h});return{suggestions:s,filteredValues:i}}filterListModel(t){const{filterList:e}=this.config;e&&(this.setValueList({valueList:t,refresh:!0}),this.alignPickerToComponent())}runSearch(){var t,e;const{values:s}=this,i=this.buildSearchStrings(s);if(!i){this.highlightSelectedValue(-1);return}const{suggestions:o,filteredValues:r}=this.getSuggestionsAndFilteredValues(this.searchString,i),{filterList:n,highlightMatch:l,searchType:a="fuzzy"}=this.config,d=r.length,h=!!(n&&this.searchString!=="");if(this.filterListModel(h?r:s),o.length){const c=h?0:i.indexOf(o[0]);this.selectListItem(c)}else if(this.highlightSelectedValue(-1),!h||d)(t=this.listComponent)==null||t.ensureIndexVisible(0);else if(h){this.getAriaElement().removeAttribute("data-active-option");const c=(e=this.listComponent)==null?void 0:e.getAriaElement();c&&rl(c,null)}l&&a!=="fuzzy"&&this.highlightFilterMatch(),this.displayOrHidePicker()}displayOrHidePicker(){var t;const e=(t=this.listComponent)==null?void 0:t.getGui(),s=this.currentList?this.currentList.length===0:!1;e==null||e.classList.toggle("ag-hidden",s)}clearSearchString(){this.searchString=""}selectListItem(t,e){if(!this.isPickerDisplayed||!this.currentList||!this.listComponent||t<0||t>=this.currentList.length)return;this.listComponent.ensureIndexVisible(t,!e)&&!e&&this.listComponent.refresh(!0),this.highlightSelectedValue(t)}setValue(t,e,s){const i=this.currentList?this.currentList.indexOf(t):-1;return i===-1?this:(this.value=t,s||this.selectListItem(i),this.renderSelectedValue(),super.setValue(t,e))}createRowComponent(t){const e=new da(this.config,this.eWrapper);e.setParentComponent(this.listComponent),this.getContext().createBean(e),e.setState(t);const{highlightMatch:s,searchType:i="fuzzy"}=this.config;return s&&i!=="fuzzy"&&e.highlightString(this.searchString),e}getRowForMouseEvent(t){const{listComponent:e}=this;if(!e)return-1;const i=(e==null?void 0:e.getGui()).getBoundingClientRect(),o=e.getScrollTop(),r=t.clientY-i.top+o;return Math.floor(r/e.getRowHeight())}onPickerMouseMove(t){if(!this.listComponent)return;const e=this.getRowForMouseEvent(t);e!==-1&&e!=this.lastRowHovered&&(this.lastRowHovered=e,this.selectListItem(e,!0))}onNavigationKeyDown(t,e){t.preventDefault();const s=e===E.DOWN;if(!this.isPickerDisplayed&&s){this.showPicker();return}const i=this.highlightedItem,r=i===-1?0:i+(s?1:-1);this.selectListItem(r)}onPageNavigation(t){var e;if(!this.isPickerDisplayed)return;const s=(e=this.listComponent)==null?void 0:e.navigateToPage(t,this.highlightedItem);s!=null&&this.animationFrameService.requestAnimationFrame(()=>{if(!this.isAlive())return null;this.highlightSelectedValue(s)})}onEnterKeyDown(t){this.isPickerDisplayed&&(t.preventDefault(),this.currentList&&this.onListValueSelected(this.currentList[this.highlightedItem],!0))}onTabKeyDown(){!this.isPickerDisplayed||!this.currentList||this.setValue(this.currentList[this.highlightedItem],!1,!0)}onListValueSelected(t,e){this.setValue(t,!1,!0),this.dispatchPickerEvent(t,e),this.hidePicker()}dispatchPickerEvent(t,e){const s={type:p.EVENT_FIELD_PICKER_VALUE_SELECTED,fromEnterKey:e,value:t};this.dispatchEvent(s)}getFocusableElement(){const{allowTyping:t}=this.config;return t?this.eInput.getFocusableElement():super.getFocusableElement()}onKeyDown(t){const e=t.key,{allowTyping:s}=this.config;switch(e){case E.LEFT:case E.RIGHT:s||t.preventDefault();break;case E.PAGE_HOME:case E.PAGE_END:if(s){t.preventDefault();const i=this.eInput.getInputElement(),o=e===E.PAGE_HOME?0:i.value.length;i.setSelectionRange(o,o);break}case E.PAGE_UP:case E.PAGE_DOWN:t.preventDefault(),this.onPageNavigation(e);break;case E.DOWN:case E.UP:this.onNavigationKeyDown(t,e);break;case E.ESCAPE:this.isPickerDisplayed&&(ht(this.listComponent.getGui())&&(t.preventDefault(),Ot(t)),this.hidePicker());break;case E.ENTER:this.onEnterKeyDown(t);break;case E.TAB:this.onTabKeyDown();break;default:s||this.buildSearchStringFromKeyboardEvent(t)}}destroy(){this.listComponent&&(this.destroyBean(this.listComponent),this.listComponent=void 0),this.eLoading=void 0,super.destroy()}};u([f("userComponentFactory")],gn.prototype,"userComponentFactory",2),u([f("animationFrameService")],gn.prototype,"animationFrameService",2),u([I("eInput")],gn.prototype,"eInput",2);var Bi=class Ic extends _l{constructor(e){super(e,Ic.TEMPLATE),this.labelAlignment="top"}init(){this.eSlider.addCssClass("ag-slider-field");const{minValue:e,maxValue:s,textFieldWidth:i,step:o,value:r,onValueChange:n}=this.config;e!=null&&this.setMinValue(e),s!=null&&this.setMaxValue(s),i!=null&&this.setTextFieldWidth(i),o!=null&&this.setStep(o),r!=null&&this.setValue(r),n!=null&&this.onValueChange(n)}onValueChange(e){const s=p.EVENT_FIELD_VALUE_CHANGED;return this.addManagedListener(this.eText,s,()=>{const i=parseFloat(this.eText.getValue());this.eSlider.setValue(i.toString(),!0),e(i||0)}),this.addManagedListener(this.eSlider,s,()=>{const i=this.eSlider.getValue();this.eText.setValue(i,!0),e(parseFloat(i))}),this}setSliderWidth(e){return this.eSlider.setWidth(e),this}setTextFieldWidth(e){return this.eText.setWidth(e),this}setMinValue(e){return this.eSlider.setMinValue(e),this.eText.setMin(e),this}setMaxValue(e){return this.eSlider.setMaxValue(e),this.eText.setMax(e),this}getValue(){return this.eText.getValue()}setValue(e,s){return this.getValue()===e?this:(this.eText.setValue(e,!0),this.eSlider.setValue(e,!0),s||this.dispatchEvent({type:p.EVENT_FIELD_VALUE_CHANGED}),this)}setStep(e){return this.eSlider.setStep(e),this.eText.setStep(e),this}};Bi.TEMPLATE=`<div class="ag-slider">
237
+ <label ref="eLabel"></label>
238
+ <div class="ag-wrapper ag-slider-wrapper">
239
+ <ag-input-range ref="eSlider"></ag-input-range>
240
+ <ag-input-number-field ref="eText"></ag-input-number-field>
241
+ </div>
242
+ </div>`,u([I("eLabel")],Bi.prototype,"eLabel",2),u([I("eSlider")],Bi.prototype,"eSlider",2),u([I("eText")],Bi.prototype,"eText",2),u([M],Bi.prototype,"init",1);var Em=Bi,bs=class ro extends K{constructor(e={}){super(ro.getTemplate(e)),this.params=e,this.suppressEnabledCheckbox=!0,this.suppressToggleExpandOnEnableChange=!1;const{enabled:s,items:i,suppressEnabledCheckbox:o,expanded:r,suppressToggleExpandOnEnableChange:n,useToggle:l}=e;this.cssIdentifier=e.cssIdentifier||"default",this.enabled=s??!0,this.items=i||[],this.useToggle=l??!1,this.alignItems=e.alignItems||"center",this.expanded=r??!0,o!=null&&(this.suppressEnabledCheckbox=o),n!=null&&(this.suppressToggleExpandOnEnableChange=n)}static getTemplate(e){const s=e.cssIdentifier||"default",i=e.direction||"vertical";return`
243
+ <div class="ag-group ag-${s}-group" role="presentation">
244
+ <div ref="eToolbar" class="ag-group-toolbar ag-${s}-group-toolbar">
245
+ <ag-checkbox ref="cbGroupEnabled"></ag-checkbox>
246
+ </div>
247
+ <div ref="eContainer" class="ag-group-container ag-group-container-${i} ag-${s}-group-container"></div>
248
+ </div>
249
+ `}postConstruct(){if(this.setupTitleBar(),this.items.length){const o=this.items;this.items=[],this.addItems(o)}const e=this.localeService.getLocaleTextFunc();this.cbGroupEnabled.setLabel(e("enabled","Enabled")),this.enabled&&this.setEnabled(this.enabled,void 0,!0),this.setAlignItems(this.alignItems);const{onEnableChange:s,suppressOpenCloseIcons:i}=this.params;this.hideEnabledCheckbox(this.suppressEnabledCheckbox),this.hideOpenCloseIcons(i??!1),this.refreshChildDisplay(),$(this.eContainer,this.expanded),this.cbGroupEnabled.onValueChange(o=>{this.setEnabled(o,!0,this.suppressToggleExpandOnEnableChange),this.dispatchEnableChangeEvent(o)}),s!=null&&this.onEnableChange(s)}refreshChildDisplay(){var e;$(this.eToolbar,this.expanded&&!this.suppressEnabledCheckbox),(e=this.eTitleBar)==null||e.refreshOnExpand(this.expanded)}isExpanded(){return this.expanded}setAlignItems(e){this.alignItems!==e&&this.removeCssClass(`ag-group-item-alignment-${this.alignItems}`),this.alignItems=e;const s=`ag-group-item-alignment-${this.alignItems}`;return this.addCssClass(s),this}toggleGroupExpand(e){var s;let i=!1;if((s=this.eTitleBar)!=null&&s.isSuppressCollapse()&&!this.useToggle)e=!0,i=!0;else if(e=e??!this.expanded,this.expanded===e)return this;return this.expanded=e,this.refreshChildDisplay(),$(this.eContainer,e),i||this.dispatchEvent({type:e?ro.EVENT_EXPANDED:ro.EVENT_COLLAPSED}),this}addItems(e){e.forEach(s=>this.addItem(s))}prependItem(e){this.insertItem(e,!0)}addItem(e){this.insertItem(e,!1)}insertItem(e,s){const i=this.eContainer,o=e instanceof K?e.getGui():e;o.classList.add("ag-group-item",`ag-${this.cssIdentifier}-group-item`),s?(i.insertAdjacentElement("afterbegin",o),this.items.unshift(o)):(i.appendChild(o),this.items.push(o))}hideItem(e,s){const i=this.items[s];$(i,!e)}getItemIndex(e){const s=e instanceof K?e.getGui():e;return this.items.indexOf(s)}setTitle(e){var s;return(s=this.eTitleBar)==null||s.setTitle(e),this}addTitleBarWidget(e){var s;return(s=this.eTitleBar)==null||s.addWidget(e),this}addCssClassToTitleBar(e){var s;(s=this.eTitleBar)==null||s.addCssClass(e)}dispatchEnableChangeEvent(e){const s={type:ro.EVENT_ENABLE_CHANGE,enabled:e};this.dispatchEvent(s)}setEnabled(e,s,i){var o;return this.enabled=e,this.refreshDisabledStyles(),i||this.toggleGroupExpand(e),s||(this.cbGroupEnabled.setValue(e),(o=this.eToggle)==null||o.setValue(e)),this}isEnabled(){return this.enabled}onEnableChange(e){return this.addManagedListener(this,ro.EVENT_ENABLE_CHANGE,s=>e(s.enabled)),this}hideEnabledCheckbox(e){return this.suppressEnabledCheckbox=e,this.refreshChildDisplay(),this.refreshDisabledStyles(),this}hideOpenCloseIcons(e){var s;return(s=this.eTitleBar)==null||s.hideOpenCloseIcons(e),this}refreshDisabledStyles(){var e;const s=!this.enabled;this.eContainer.classList.toggle("ag-disabled",s),(e=this.eTitleBar)==null||e.refreshDisabledStyles(this.suppressEnabledCheckbox&&s),this.eContainer.classList.toggle("ag-disabled-group-container",s)}setupTitleBar(){const e=this.useToggle?this.createToggleTitleBar():this.createDefaultTitleBar();this.eToolbar.insertAdjacentElement("beforebegin",e.getGui())}createDefaultTitleBar(){const e=this.createManagedBean(new Mh(this.params));return this.eTitleBar=e,e.refreshOnExpand(this.expanded),this.addManagedListener(e,Mh.EVENT_EXPAND_CHANGED,s=>this.toggleGroupExpand(s.expanded)),e}createToggleTitleBar(){var e;const s=this.createManagedBean(new Fh({value:this.enabled,label:this.params.title,labelAlignment:"left",labelWidth:"flex",onValueChange:i=>{this.setEnabled(i,!0),this.dispatchEnableChangeEvent(i)}}));return s.addCssClass("ag-group-title-bar"),s.addCssClass(`ag-${(e=this.params.cssIdentifier)!=null?e:"default"}-group-title-bar ag-unselectable`),this.eToggle=s,this.toggleGroupExpand(this.enabled),s}};bs.EVENT_EXPANDED="expanded",bs.EVENT_COLLAPSED="collapsed",bs.EVENT_ENABLE_CHANGE="enableChange",u([I("eToolbar")],bs.prototype,"eToolbar",2),u([I("cbGroupEnabled")],bs.prototype,"cbGroupEnabled",2),u([I("eContainer")],bs.prototype,"eContainer",2),u([M],bs.prototype,"postConstruct",1);var ym=bs,ua="ag-disabled-group-title-bar",Wi=class Ha extends K{constructor(e={}){super(Ha.getTemplate(e)),this.suppressOpenCloseIcons=!1;const{title:s,suppressOpenCloseIcons:i}=e;s&&s.length>0&&(this.title=s),i!=null&&(this.suppressOpenCloseIcons=i)}static getTemplate(e){var s;const i=(s=e.cssIdentifier)!=null?s:"default";return`
250
+ <div class="ag-group-title-bar ag-${i}-group-title-bar ag-unselectable" role="button">
251
+ <span class="ag-group-title-bar-icon ag-${i}-group-title-bar-icon" ref="eGroupOpenedIcon" role="presentation"></span>
252
+ <span class="ag-group-title-bar-icon ag-${i}-group-title-bar-icon" ref="eGroupClosedIcon" role="presentation"></span>
253
+ <span ref="eTitle" class="ag-group-title ag-${i}-group-title"></span>
254
+ </div>
255
+ `}postConstruct(){this.setTitle(this.title),this.hideOpenCloseIcons(this.suppressOpenCloseIcons),this.setupExpandContract()}setupExpandContract(){this.eGroupClosedIcon.appendChild(Lt("columnSelectClosed",this.gos,null)),this.eGroupOpenedIcon.appendChild(Lt("columnSelectOpen",this.gos,null)),this.addManagedListener(this.getGui(),"click",()=>this.dispatchExpandChanged()),this.addManagedListener(this.getGui(),"keydown",e=>{switch(e.key){case E.ENTER:case E.SPACE:e.preventDefault(),this.dispatchExpandChanged();break;case E.RIGHT:case E.LEFT:e.preventDefault(),this.dispatchExpandChanged(e.key===E.RIGHT);break}})}refreshOnExpand(e){this.refreshAriaStatus(e),this.refreshOpenCloseIcons(e)}refreshAriaStatus(e){this.suppressOpenCloseIcons||ls(this.getGui(),e)}refreshOpenCloseIcons(e){const s=!this.suppressOpenCloseIcons;$(this.eGroupOpenedIcon,s&&e),$(this.eGroupClosedIcon,s&&!e)}isSuppressCollapse(){return this.suppressOpenCloseIcons}dispatchExpandChanged(e){const s={type:Ha.EVENT_EXPAND_CHANGED,expanded:e};this.dispatchEvent(s)}setTitle(e){const s=this.getGui(),i=!!e&&e.length>0;e=i?e:void 0,this.eTitle.textContent=e??"",$(s,i),e!==this.title&&(this.title=e);const o=s.classList.contains(ua);return this.refreshDisabledStyles(o),this}addWidget(e){return this.getGui().appendChild(e),this}hideOpenCloseIcons(e){return this.suppressOpenCloseIcons=e,e&&this.dispatchExpandChanged(!0),this}refreshDisabledStyles(e){const s=this.getGui();e?(s.classList.add(ua),s.removeAttribute("tabindex")):(s.classList.remove(ua),typeof this.title=="string"?s.setAttribute("tabindex","0"):s.removeAttribute("tabindex"))}};Wi.EVENT_EXPAND_CHANGED="expandedChanged",u([I("eGroupOpenedIcon")],Wi.prototype,"eGroupOpenedIcon",2),u([I("eGroupClosedIcon")],Wi.prototype,"eGroupClosedIcon",2),u([I("eTitle")],Wi.prototype,"eTitle",2),u([M],Wi.prototype,"postConstruct",1);var Mh=Wi,ha=class extends ko{constructor(t=0,e){super('<div class="ag-menu-list" role="tree"></div>'),this.level=t,this.menuItems=[],this.params=e??{column:null,node:null,value:null}}postConstruct(){this.initialiseTabGuard({onTabKeyDown:t=>this.onTabKeyDown(t),handleKeyDown:t=>this.handleKeyDown(t),onFocusIn:t=>this.handleFocusIn(t),onFocusOut:t=>this.handleFocusOut(t)})}onTabKeyDown(t){const e=this.getParentComponent(),s=e&&e.getGui();s&&s.classList.contains("ag-focus-managed")||t.preventDefault(),t.shiftKey&&this.closeIfIsChild(t)}handleKeyDown(t){switch(t.key){case E.UP:case E.RIGHT:case E.DOWN:case E.LEFT:t.preventDefault(),this.handleNavKey(t.key);break;case E.ESCAPE:this.closeIfIsChild()&&Ot(t);break}}handleFocusIn(t){var e,s;const i=t.relatedTarget;!this.tabGuardCtrl.isTabGuard(i)&&(this.getGui().contains(i)||(s=(e=this.activeMenuItem)==null?void 0:e.getSubMenuGui())!=null&&s.contains(i))||(this.activeMenuItem?this.activeMenuItem.activate():this.activateFirstItem())}handleFocusOut(t){var e;const s=t.relatedTarget;!this.activeMenuItem||this.getGui().contains(s)||(e=this.activeMenuItem.getSubMenuGui())!=null&&e.contains(s)||this.activeMenuItem.isSubMenuOpening()||this.activeMenuItem.deactivate()}clearActiveItem(){this.activeMenuItem&&(this.activeMenuItem.deactivate(),this.activeMenuItem=null)}addMenuItems(t){t!=null&&xe.all(t.map(e=>e==="separator"?xe.resolve({eGui:this.createSeparator()}):typeof e=="string"?(console.warn(`AG Grid: unrecognised menu item ${e}`),xe.resolve({eGui:null})):this.addItem(e))).then(e=>{e.forEach(s=>{s!=null&&s.eGui&&(this.appendChild(s.eGui),s.comp&&this.menuItems.push(s.comp))})})}addItem(t){const e=this.createManagedBean(new fn);return e.init({menuItemDef:t,isAnotherSubMenuOpen:()=>this.menuItems.some(s=>s.isSubMenuOpen()),level:this.level,contextParams:this.params}).then(()=>(e.setParentComponent(this),this.addManagedListener(e,fn.EVENT_CLOSE_MENU,s=>{this.dispatchEvent(s)}),this.addManagedListener(e,fn.EVENT_MENU_ITEM_ACTIVATED,s=>{this.activeMenuItem&&this.activeMenuItem!==s.menuItem&&this.activeMenuItem.deactivate(),this.activeMenuItem=s.menuItem}),{comp:e,eGui:e.getGui()}))}activateFirstItem(){const t=this.menuItems.filter(e=>!e.isDisabled())[0];t&&t.activate()}createSeparator(){return ct(`
256
+ <div class="ag-menu-separator" aria-hidden="true">
257
+ <div class="ag-menu-separator-part"></div>
258
+ <div class="ag-menu-separator-part"></div>
259
+ <div class="ag-menu-separator-part"></div>
260
+ <div class="ag-menu-separator-part"></div>
261
+ </div>`)}handleNavKey(t){switch(t){case E.UP:case E.DOWN:const s=this.findNextItem(t===E.UP);s&&s!==this.activeMenuItem&&s.activate();return}const e=this.gos.get("enableRtl")?E.RIGHT:E.LEFT;t===e?this.closeIfIsChild():this.openChild()}closeIfIsChild(t){const e=this.getParentComponent();return e&&e instanceof fn?(t&&t.preventDefault(),e.closeSubMenu(),e.getGui().focus(),!0):!1}openChild(){this.activeMenuItem&&this.activeMenuItem.openSubMenu(!0)}findNextItem(t){const e=this.menuItems.filter(o=>!o.isDisabled());if(!e.length)return;if(!this.activeMenuItem)return t?ie(e):e[0];t&&e.reverse();let s,i=!1;for(let o=0;o<e.length;o++){const r=e[o];if(!i){r===this.activeMenuItem&&(i=!0);continue}s=r;break}return i&&!s?e[0]:s||this.activeMenuItem}destroy(){this.clearActiveItem(),super.destroy()}};u([f("focusService")],ha.prototype,"focusService",2),u([M],ha.prototype,"postConstruct",1);var Ih=class extends ko{constructor(t){super(),this.wrappedComponent=t,this.setTemplateFromElement(t.getGui())}postConstruct(){this.initialiseTabGuard({onTabKeyDown:t=>this.onTabKeyDown(t),handleKeyDown:t=>this.handleKeyDown(t)})}handleKeyDown(t){t.key===E.ESCAPE&&this.closePanel()}onTabKeyDown(t){t.defaultPrevented||(this.closePanel(),t.preventDefault())}closePanel(){const t=this.parentComponent;t.closeSubMenu(),setTimeout(()=>t.getGui().focus(),0)}};u([M],Ih.prototype,"postConstruct",1);var Ui=class no extends L{constructor(){super(...arguments),this.isActive=!1,this.subMenuIsOpen=!1,this.subMenuIsOpening=!1,this.suppressRootStyles=!0,this.suppressAria=!0,this.suppressFocus=!0}init(e){var s,i;const{menuItemDef:o,isAnotherSubMenuOpen:r,level:n,childComponent:l,contextParams:a}=e;return this.params=e.menuItemDef,this.level=n,this.isAnotherSubMenuOpen=r,this.childComponent=l,this.contextParams=a,this.cssClassPrefix=(i=(s=this.params.menuItemParams)==null?void 0:s.cssClassPrefix)!=null?i:"ag-menu-option",this.userComponentFactory.getMenuItemCompDetails(this.params,Ee(_({},o),{level:n,isAnotherSubMenuOpen:r,openSubMenu:h=>this.openSubMenu(h),closeSubMenu:()=>this.closeSubMenu(),closeMenu:h=>this.closeMenu(h),updateTooltip:(h,c)=>this.refreshTooltip(h,c),onItemActivated:()=>this.onItemActivated()})).newAgStackInstance().then(h=>{var c;this.menuItemComp=h;const m=(c=h.configureDefaults)==null?void 0:c.call(h);m&&this.configureDefaults(m===!0?void 0:m)})}addListeners(e,s){s!=null&&s.suppressClick||this.addManagedListener(e,"click",i=>this.onItemSelected(i)),s!=null&&s.suppressKeyboardSelect||this.addManagedListener(e,"keydown",i=>{(i.key===E.ENTER||i.key===E.SPACE)&&(i.preventDefault(),this.onItemSelected(i))}),s!=null&&s.suppressMouseDown||this.addManagedListener(e,"mousedown",i=>{i.stopPropagation(),i.preventDefault()}),s!=null&&s.suppressMouseOver||(this.addManagedListener(e,"mouseenter",()=>this.onMouseEnter()),this.addManagedListener(e,"mouseleave",()=>this.onMouseLeave()))}isDisabled(){return!!this.params.disabled}openSubMenu(e=!1){var s,i;if(this.closeSubMenu(),!this.params.subMenu)return;this.subMenuIsOpening=!0;const o=ct('<div class="ag-menu" role="presentation"></div>');this.eSubMenuGui=o;let r,n=()=>{this.subMenuIsOpening=!1};if(this.childComponent){const h=this.createBean(new Ih(this.childComponent));h.setParentComponent(this);const c=h.getGui(),m="mouseenter",C=()=>this.cancelDeactivate();c.addEventListener(m,C),r=()=>c.removeEventListener(m,C),o.appendChild(c),this.childComponent.afterGuiAttached&&(n=()=>{this.childComponent.afterGuiAttached(),this.subMenuIsOpening=!1})}else if(this.params.subMenu){const h=this.createBean(new ha(this.level+1,this.contextParams));h.setParentComponent(this),h.addMenuItems(this.params.subMenu),o.appendChild(h.getGui()),this.addManagedListener(h,no.EVENT_CLOSE_MENU,c=>this.dispatchEvent(c)),h.addGuiEventListener("mouseenter",()=>this.cancelDeactivate()),r=()=>this.destroyBean(h),e&&(n=()=>{h.activateFirstItem(),this.subMenuIsOpening=!1})}const l=this.popupService.positionPopupForMenu.bind(this.popupService,{eventSource:this.eGui,ePopup:o}),a=this.localeService.getLocaleTextFunc(),d=this.popupService.addPopup({modal:!0,eChild:o,positionCallback:l,anchorToElement:this.eGui,ariaLabel:a("ariaLabelSubMenu","SubMenu"),afterGuiAttached:n});this.subMenuIsOpen=!0,this.setAriaExpanded(!0),this.hideSubMenu=()=>{var h,c;d&&d.hideFunc(),this.subMenuIsOpen=!1,this.setAriaExpanded(!1),r(),(c=(h=this.menuItemComp).setExpanded)==null||c.call(h,!1),this.eSubMenuGui=void 0},(i=(s=this.menuItemComp).setExpanded)==null||i.call(s,!0)}setAriaExpanded(e){this.suppressAria||ls(this.eGui,e)}closeSubMenu(){this.hideSubMenu&&(this.hideSubMenu(),this.hideSubMenu=null,this.setAriaExpanded(!1))}isSubMenuOpen(){return this.subMenuIsOpen}isSubMenuOpening(){return this.subMenuIsOpening}activate(e){var s,i;this.cancelActivate(),!this.params.disabled&&(this.isActive=!0,this.suppressRootStyles||this.eGui.classList.add(`${this.cssClassPrefix}-active`),(i=(s=this.menuItemComp).setActive)==null||i.call(s,!0),this.suppressFocus||this.eGui.focus({preventScroll:!0}),e&&this.params.subMenu&&window.setTimeout(()=>{this.isAlive()&&this.isActive&&this.openSubMenu()},300),this.onItemActivated())}deactivate(){var e,s;this.cancelDeactivate(),this.suppressRootStyles||this.eGui.classList.remove(`${this.cssClassPrefix}-active`),(s=(e=this.menuItemComp).setActive)==null||s.call(e,!1),this.isActive=!1,this.subMenuIsOpen&&this.hideSubMenu()}getGui(){return this.menuItemComp.getGui()}getParentComponent(){return this.parentComponent}setParentComponent(e){this.parentComponent=e}getSubMenuGui(){return this.eSubMenuGui}onItemSelected(e){var s,i;(i=(s=this.menuItemComp).select)==null||i.call(s),this.params.action?this.getFrameworkOverrides().wrapOutgoing(()=>this.params.action(this.gos.addGridCommonParams(_({},this.contextParams)))):this.openSubMenu(e&&e.type==="keydown"),!(this.params.subMenu&&!this.params.action||this.params.suppressCloseOnSelect)&&this.closeMenu(e)}closeMenu(e){const s={type:no.EVENT_CLOSE_MENU};e&&(e instanceof MouseEvent?s.mouseEvent=e:s.keyboardEvent=e),this.dispatchEvent(s)}onItemActivated(){const e={type:no.EVENT_MENU_ITEM_ACTIVATED,menuItem:this};this.dispatchEvent(e)}cancelActivate(){this.activateTimeoutId&&(window.clearTimeout(this.activateTimeoutId),this.activateTimeoutId=0)}cancelDeactivate(){this.deactivateTimeoutId&&(window.clearTimeout(this.deactivateTimeoutId),this.deactivateTimeoutId=0)}onMouseEnter(){this.cancelDeactivate(),this.isAnotherSubMenuOpen()?this.activateTimeoutId=window.setTimeout(()=>this.activate(!0),no.ACTIVATION_DELAY):this.activate(!0)}onMouseLeave(){this.cancelActivate(),this.isSubMenuOpen()?this.deactivateTimeoutId=window.setTimeout(()=>this.deactivate(),no.ACTIVATION_DELAY):this.deactivate()}configureDefaults(e){var s,i,o;if(!this.menuItemComp){setTimeout(()=>this.configureDefaults(e));return}let r=this.menuItemComp.getGui();const n=(i=(s=this.menuItemComp).getRootElement)==null?void 0:i.call(s);n&&(e!=null&&e.suppressRootStyles||r.classList.add("ag-menu-option-custom"),r=n),this.eGui=r,this.suppressRootStyles=!!(e!=null&&e.suppressRootStyles),this.suppressRootStyles||(r.classList.add(this.cssClassPrefix),(o=this.params.cssClasses)==null||o.forEach(l=>r.classList.add(l)),this.params.disabled&&r.classList.add(`${this.cssClassPrefix}-disabled`)),e!=null&&e.suppressTooltip||this.refreshTooltip(this.params.tooltip),this.suppressAria=!!(e!=null&&e.suppressAria),this.suppressAria||(Ae(r,"treeitem"),ou(r,this.level+1),this.params.disabled&&ol(r,!0)),e!=null&&e.suppressTabIndex||r.setAttribute("tabindex","-1"),this.params.disabled||this.addListeners(r,e),this.suppressFocus=!!(e!=null&&e.suppressFocus)}refreshTooltip(e,s){this.tooltip=e,this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),!(!e||!this.menuItemComp)&&(this.tooltipFeature=this.createBean(new ds({getGui:()=>this.getGui(),getTooltipValue:()=>this.tooltip,getLocation:()=>"menu",shouldDisplayTooltip:s})))}destroy(){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),super.destroy()}};Ui.EVENT_CLOSE_MENU="closeMenu",Ui.EVENT_MENU_ITEM_ACTIVATED="menuItemActivated",Ui.ACTIVATION_DELAY=80,u([f("popupService")],Ui.prototype,"popupService",2),u([f("userComponentFactory")],Ui.prototype,"userComponentFactory",2);var fn=Ui,ii=class ka extends K{constructor(e){super(ka.getTemplate(e)),this.config=e,this.closable=!0}static getTemplate(e){const s=e.cssIdentifier||"default";return`<div class="ag-panel ag-${s}-panel" tabindex="-1">
262
+ <div ref="eTitleBar" class="ag-panel-title-bar ag-${s}-panel-title-bar ag-unselectable">
263
+ <span ref="eTitle" class="ag-panel-title-bar-title ag-${s}-panel-title-bar-title"></span>
264
+ <div ref="eTitleBarButtons" class="ag-panel-title-bar-buttons ag-${s}-panel-title-bar-buttons"></div>
265
+ </div>
266
+ <div ref="eContentWrapper" class="ag-panel-content-wrapper ag-${s}-panel-content-wrapper"></div>
267
+ </div>`}postConstruct(){const{component:e,closable:s,hideTitleBar:i,title:o,minWidth:r=250,width:n,minHeight:l=250,height:a,centered:d,popup:h,x:c,y:m}=this.config;this.positionableFeature=new Li(this.getGui(),{minWidth:r,width:n,minHeight:l,height:a,centered:d,x:c,y:m,popup:h,calculateTopBuffer:()=>this.positionableFeature.getHeight()-this.getBodyHeight()}),this.createManagedBean(this.positionableFeature);const C=this.getGui();e&&this.setBodyComponent(e),i?$(this.eTitleBar,!1):(o&&this.setTitle(o),this.setClosable(s??this.closable)),this.addManagedListener(this.eTitleBar,"mousedown",v=>{if(C.contains(v.relatedTarget)||C.contains(this.gos.getActiveDomElement())||this.eTitleBarButtons.contains(v.target)){v.preventDefault();return}const S=this.eContentWrapper.querySelector("button, [href], input, select, textarea, [tabindex]");S&&S.focus()}),!(h&&this.positionableFeature.isPositioned())&&(this.renderComponent&&this.renderComponent(),this.positionableFeature.initialisePosition(),this.eContentWrapper.style.height="0")}renderComponent(){const e=this.getGui();e.focus(),this.close=()=>{e.parentElement.removeChild(e),this.destroy()}}getHeight(){return this.positionableFeature.getHeight()}setHeight(e){this.positionableFeature.setHeight(e)}getWidth(){return this.positionableFeature.getWidth()}setWidth(e){this.positionableFeature.setWidth(e)}setClosable(e){if(e!==this.closable&&(this.closable=e),e){const s=this.closeButtonComp=new K(ka.CLOSE_BTN_TEMPLATE);this.getContext().createBean(s);const i=s.getGui(),o=be("close",this.gos);o.classList.add("ag-panel-title-bar-button-icon"),i.appendChild(o),this.addTitleBarButton(s),s.addManagedListener(i,"click",this.onBtClose.bind(this))}else if(this.closeButtonComp){const s=this.closeButtonComp.getGui();s.parentElement.removeChild(s),this.closeButtonComp=this.destroyBean(this.closeButtonComp)}}setBodyComponent(e){e.setParentComponent(this),this.eContentWrapper.appendChild(e.getGui())}addTitleBarButton(e,s){const i=this.eTitleBarButtons,o=i.children,r=o.length;s==null&&(s=r),s=Math.max(0,Math.min(s,r)),e.addCssClass("ag-panel-title-bar-button");const n=e.getGui();s===0?i.insertAdjacentElement("afterbegin",n):s===r?i.insertAdjacentElement("beforeend",n):o[s-1].insertAdjacentElement("afterend",n),e.setParentComponent(this)}getBodyHeight(){return So(this.eContentWrapper)}getBodyWidth(){return ks(this.eContentWrapper)}setTitle(e){this.eTitle.innerText=e}onBtClose(){this.close()}destroy(){this.closeButtonComp&&(this.closeButtonComp=this.destroyBean(this.closeButtonComp));const e=this.getGui();e&&ht(e)&&this.close(),super.destroy()}};ii.CLOSE_BTN_TEMPLATE='<div class="ag-button"></div>',u([I("eContentWrapper")],ii.prototype,"eContentWrapper",2),u([I("eTitleBar")],ii.prototype,"eTitleBar",2),u([I("eTitleBarButtons")],ii.prototype,"eTitleBarButtons",2),u([I("eTitle")],ii.prototype,"eTitle",2),u([M],ii.prototype,"postConstruct",1);var Rm=ii,bm=class extends Rm{constructor(t){super(Ee(_({},t),{popup:!0})),this.isMaximizable=!1,this.isMaximized=!1,this.maximizeListeners=[],this.resizeListenerDestroy=null,this.lastPosition={x:0,y:0,width:0,height:0}}postConstruct(){const t=this.getGui(),{movable:e,resizable:s,maximizable:i}=this.config;this.addCssClass("ag-dialog"),super.postConstruct(),this.addManagedListener(t,"focusin",o=>{this.popupService.bringPopupToFront(t)}),e&&this.setMovable(e),i&&this.setMaximizable(i),s&&this.setResizable(s)}renderComponent(){const t=this.getGui(),{alwaysOnTop:e,modal:s,title:i,afterGuiAttached:o}=this.config,r=this.localeService.getLocaleTextFunc(),n=this.popupService.addPopup({modal:s,eChild:t,closeOnEsc:!0,closedCallback:this.onClosed.bind(this),alwaysOnTop:e,ariaLabel:i||r("ariaLabelDialog","Dialog"),afterGuiAttached:o});n&&(this.close=n.hideFunc)}onClosed(t){var e,s;this.destroy(),(s=(e=this.config).closedCallback)==null||s.call(e,t)}toggleMaximize(){const t=this.positionableFeature.getPosition();if(this.isMaximized){const{x:e,y:s,width:i,height:o}=this.lastPosition;this.setWidth(i),this.setHeight(o),this.positionableFeature.offsetElement(e,s)}else this.lastPosition.width=this.getWidth(),this.lastPosition.height=this.getHeight(),this.lastPosition.x=t.x,this.lastPosition.y=t.y,this.positionableFeature.offsetElement(0,0),this.setHeight("100%"),this.setWidth("100%");this.isMaximized=!this.isMaximized,this.refreshMaximizeIcon()}refreshMaximizeIcon(){$(this.maximizeIcon,!this.isMaximized),$(this.minimizeIcon,this.isMaximized)}clearMaximizebleListeners(){this.maximizeListeners.length&&(this.maximizeListeners.forEach(t=>t()),this.maximizeListeners.length=0),this.resizeListenerDestroy&&(this.resizeListenerDestroy(),this.resizeListenerDestroy=null)}destroy(){this.maximizeButtonComp=this.destroyBean(this.maximizeButtonComp),this.clearMaximizebleListeners(),super.destroy()}setResizable(t){this.positionableFeature.setResizable(t)}setMovable(t){this.positionableFeature.setMovable(t,this.eTitleBar)}setMaximizable(t){if(!t){this.clearMaximizebleListeners(),this.maximizeButtonComp&&(this.destroyBean(this.maximizeButtonComp),this.maximizeButtonComp=this.maximizeIcon=this.minimizeIcon=void 0);return}const e=this.eTitleBar;if(!e||t===this.isMaximizable)return;const s=this.buildMaximizeAndMinimizeElements();this.refreshMaximizeIcon(),s.addManagedListener(s.getGui(),"click",this.toggleMaximize.bind(this)),this.addTitleBarButton(s,0),this.maximizeListeners.push(this.addManagedListener(e,"dblclick",this.toggleMaximize.bind(this))),this.resizeListenerDestroy=this.addManagedListener(this,"resize",()=>{this.isMaximized=!1,this.refreshMaximizeIcon()})}buildMaximizeAndMinimizeElements(){const t=this.maximizeButtonComp=this.createBean(new K('<div class="ag-dialog-button"></span>')),e=t.getGui();return this.maximizeIcon=be("maximize",this.gos),e.appendChild(this.maximizeIcon),this.maximizeIcon.classList.add("ag-panel-title-bar-button-icon"),this.minimizeIcon=be("minimize",this.gos),e.appendChild(this.minimizeIcon),this.minimizeIcon.classList.add("ag-panel-title-bar-button-icon"),t}};u([f("popupService")],bm.prototype,"popupService",2);var Tm=0,gs=class extends L{constructor(){super(...arguments),this.popupList=[]}postConstruct(){this.ctrlsService.whenReady(t=>{this.gridCtrl=t.gridCtrl}),this.addManagedListener(this.eventService,p.EVENT_GRID_STYLES_CHANGED,this.handleThemeChange.bind(this))}getPopupParent(){const t=this.gos.get("popupParent");return t||this.gridCtrl.getGui()}positionPopupForMenu(t){const{eventSource:e,ePopup:s}=t,i=this.getPopupIndex(s);if(i!==-1){const C=this.popupList[i];C.alignedToElement=e}const o=e.getBoundingClientRect(),r=this.getParentRect(),n=this.keepXYWithinBounds(s,o.top-r.top,0),l=s.clientWidth>0?s.clientWidth:200;s.style.minWidth=`${l}px`;const d=r.right-r.left-l;let h;this.gos.get("enableRtl")?(h=m(),h<0&&(h=c(),this.setAlignedStyles(s,"left")),h>d&&(h=0,this.setAlignedStyles(s,"right"))):(h=c(),h>d&&(h=m(),this.setAlignedStyles(s,"right")),h<0&&(h=0,this.setAlignedStyles(s,"left"))),s.style.left=`${h}px`,s.style.top=`${n}px`;function c(){return o.right-r.left-2}function m(){return o.left-r.left-l}}positionPopupUnderMouseEvent(t){const{ePopup:e,nudgeX:s,nudgeY:i,skipObserver:o}=t;this.positionPopup({ePopup:e,nudgeX:s,nudgeY:i,keepWithinBounds:!0,skipObserver:o,updatePosition:()=>this.calculatePointerAlign(t.mouseEvent),postProcessCallback:()=>this.callPostProcessPopup(t.type,t.ePopup,null,t.mouseEvent,t.column,t.rowNode)})}calculatePointerAlign(t){const e=this.getParentRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}positionPopupByComponent(t){const{ePopup:e,nudgeX:s,nudgeY:i,keepWithinBounds:o,eventSource:r,alignSide:n="left",position:l="over",column:a,rowNode:d,type:h}=t,c=r.getBoundingClientRect(),m=this.getParentRect(),C=this.getPopupIndex(e);if(C!==-1){const S=this.popupList[C];S.alignedToElement=r}const v=()=>{let S=c.left-m.left;n==="right"&&(S-=e.offsetWidth-c.width);let w;return l==="over"?(w=c.top-m.top,this.setAlignedStyles(e,"over")):(this.setAlignedStyles(e,"under"),this.shouldRenderUnderOrAbove(e,c,m,t.nudgeY||0)==="under"?w=c.top-m.top+c.height:w=c.top-e.offsetHeight-(i||0)*2-m.top),{x:S,y:w}};this.positionPopup({ePopup:e,nudgeX:s,nudgeY:i,keepWithinBounds:o,updatePosition:v,postProcessCallback:()=>this.callPostProcessPopup(h,e,r,null,a,d)})}shouldRenderUnderOrAbove(t,e,s,i){const o=s.bottom-e.bottom,r=e.top-s.top,n=t.offsetHeight+i;return o>n?"under":r>n||r>o?"above":"under"}setAlignedStyles(t,e){const s=this.getPopupIndex(t);if(s===-1)return;const i=this.popupList[s],{alignedToElement:o}=i;!o||(["right","left","over","above","under"].forEach(n=>{o.classList.remove(`ag-has-popup-positioned-${n}`),t.classList.remove(`ag-popup-positioned-${n}`)}),!e)||(o.classList.add(`ag-has-popup-positioned-${e}`),t.classList.add(`ag-popup-positioned-${e}`))}callPostProcessPopup(t,e,s,i,o,r){const n=this.gos.getCallback("postProcessPopup");n&&n({column:o,rowNode:r,ePopup:e,type:t,eventSource:s,mouseEvent:i})}positionPopup(t){const{ePopup:e,keepWithinBounds:s,nudgeX:i,nudgeY:o,skipObserver:r,updatePosition:n}=t,l={width:0,height:0},a=(d=!1)=>{let{x:h,y:c}=n();d&&e.clientWidth===l.width&&e.clientHeight===l.height||(l.width=e.clientWidth,l.height=e.clientHeight,i&&(h+=i),o&&(c+=o),s&&(h=this.keepXYWithinBounds(e,h,1),c=this.keepXYWithinBounds(e,c,0)),e.style.left=`${h}px`,e.style.top=`${c}px`,t.postProcessCallback&&t.postProcessCallback())};if(a(),!r){const d=this.resizeObserverService.observeResize(e,()=>a(!0));setTimeout(()=>d(),gs.WAIT_FOR_POPUP_CONTENT_RESIZE)}}getActivePopups(){return this.popupList.map(t=>t.element)}getPopupList(){return this.popupList}getParentRect(){const t=this.gos.getDocument();let e=this.getPopupParent();return e===t.body?e=t.documentElement:getComputedStyle(e).position==="static"&&(e=e.offsetParent),Al(e)}keepXYWithinBounds(t,e,s){const i=s===0,o=i?"clientHeight":"clientWidth",r=i?"top":"left",n=i?"offsetHeight":"offsetWidth",l=i?"scrollTop":"scrollLeft",a=this.gos.getDocument(),d=a.documentElement,h=this.getPopupParent(),c=h.getBoundingClientRect(),m=a.documentElement.getBoundingClientRect(),C=h===a.body,v=t[n];let w=C?(i?Dl:Eo)(d)+d[l]:h[o];C&&(w-=Math.abs(m[r]-c[r]));const R=w-v;return Math.min(Math.max(e,0),Math.abs(R))}addPopup(t){const e=this.gos.getDocument(),{eChild:s,ariaLabel:i,alwaysOnTop:o,positionCallback:r,anchorToElement:n}=t;if(!e)return console.warn("AG Grid: could not find the document, document is empty"),{hideFunc:()=>{}};const l=this.getPopupIndex(s);if(l!==-1)return{hideFunc:this.popupList[l].hideFunc};this.initialisePopupPosition(s);const a=this.createPopupWrapper(s,i,!!o),d=this.addEventListenersToPopup(Ee(_({},t),{wrapperEl:a}));return r&&r(),this.addPopupToPopupList(s,a,d,n),{hideFunc:d}}initialisePopupPosition(t){const s=this.getPopupParent().getBoundingClientRect();P(t.style.top)||(t.style.top=`${s.top*-1}px`),P(t.style.left)||(t.style.left=`${s.left*-1}px`)}createPopupWrapper(t,e,s){const i=this.getPopupParent(),o=document.createElement("div"),{allThemes:r}=this.environment.getTheme();return r.length&&o.classList.add(...r),o.classList.add("ag-popup"),t.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr","ag-popup-child"),t.hasAttribute("role")||Ae(t,"dialog"),St(t,e),o.appendChild(t),i.appendChild(o),s?this.setAlwaysOnTop(t,!0):this.bringPopupToFront(t),o}handleThemeChange(){const{allThemes:t}=this.environment.getTheme();for(const e of this.popupList){for(const s of Array.from(e.wrapper.classList))s.startsWith("ag-theme-")&&e.wrapper.classList.remove(s);t.length&&e.wrapper.classList.add(...t)}}addEventListenersToPopup(t){const e=this.gos.getDocument(),s=this.getPopupParent(),{wrapperEl:i,eChild:o,closedCallback:r,afterGuiAttached:n,closeOnEsc:l,modal:a}=t;let d=!1;const h=v=>{if(!i.contains(this.gos.getActiveDomElement()))return;v.key===E.ESCAPE&&!_t(v)&&C({keyboardEvent:v})},c=v=>C({mouseEvent:v}),m=v=>C({touchEvent:v}),C=(v={})=>{const{mouseEvent:S,touchEvent:w,keyboardEvent:R,forceHide:y}=v;!y&&(this.isEventFromCurrentPopup({mouseEvent:S,touchEvent:w},o)||d)||(d=!0,s.removeChild(i),e.removeEventListener("keydown",h),e.removeEventListener("mousedown",c),e.removeEventListener("touchstart",m),e.removeEventListener("contextmenu",c),this.eventService.removeEventListener(p.EVENT_DRAG_STARTED,c),r&&r(S||w||R),this.removePopupFromPopupList(o))};return n&&n({hidePopup:C}),window.setTimeout(()=>{l&&e.addEventListener("keydown",h),a&&(e.addEventListener("mousedown",c),this.eventService.addEventListener(p.EVENT_DRAG_STARTED,c),e.addEventListener("touchstart",m),e.addEventListener("contextmenu",c))},0),C}addPopupToPopupList(t,e,s,i){this.popupList.push({element:t,wrapper:e,hideFunc:s,instanceId:Tm++,isAnchored:!!i}),i&&this.setPopupPositionRelatedToElement(t,i)}getPopupIndex(t){return this.popupList.findIndex(e=>e.element===t)}setPopupPositionRelatedToElement(t,e){const s=this.getPopupIndex(t);if(s===-1)return;const i=this.popupList[s];if(i.stopAnchoringPromise&&i.stopAnchoringPromise.then(r=>r&&r()),i.stopAnchoringPromise=void 0,i.isAnchored=!1,!e)return;const o=this.keepPopupPositionedRelativeTo({element:e,ePopup:t,hidePopup:i.hideFunc});return i.stopAnchoringPromise=o,i.isAnchored=!0,o}removePopupFromPopupList(t){this.setAlignedStyles(t,null),this.setPopupPositionRelatedToElement(t,null),this.popupList=this.popupList.filter(e=>e.element!==t)}keepPopupPositionedRelativeTo(t){const e=this.getPopupParent(),s=e.getBoundingClientRect(),{element:i,ePopup:o}=t,r=i.getBoundingClientRect(),n=s.top-r.top,l=s.left-r.left;let a=n,d=l;const h=o.style.top,c=parseInt(h.substring(0,h.length-1),10),m=o.style.left,C=parseInt(m.substring(0,m.length-1),10);return new xe(v=>{this.getFrameworkOverrides().setInterval(()=>{const S=e.getBoundingClientRect(),w=i.getBoundingClientRect();if(w.top==0&&w.left==0&&w.height==0&&w.width==0){t.hidePopup();return}const y=S.top-w.top;if(y!=a){const T=this.keepXYWithinBounds(o,c+n-y,0);o.style.top=`${T}px`}a=y;const b=S.left-w.left;if(b!=d){const T=this.keepXYWithinBounds(o,C+l-b,1);o.style.left=`${T}px`}d=b},200).then(S=>{v(()=>{S!=null&&window.clearInterval(S)})})})}hasAnchoredPopup(){return this.popupList.some(t=>t.isAnchored)}isEventFromCurrentPopup(t,e){const{mouseEvent:s,touchEvent:i}=t,o=s||i;if(!o)return!1;const r=this.getPopupIndex(e);if(r===-1)return!1;for(let n=r;n<this.popupList.length;n++){const l=this.popupList[n];if(Pr(l.element,o))return!0}return this.isElementWithinCustomPopup(o.target)}isElementWithinCustomPopup(t){const e=this.gos.getDocument();for(;t&&t!==e.body;){if(t.classList.contains("ag-custom-component-popup")||t.parentElement===null)return!0;t=t.parentElement}return!1}getWrapper(t){for(;!t.classList.contains("ag-popup")&&t.parentElement;)t=t.parentElement;return t.classList.contains("ag-popup")?t:null}setAlwaysOnTop(t,e){const s=this.getWrapper(t);s&&(s.classList.toggle("ag-always-on-top",!!e),e&&this.bringPopupToFront(s))}bringPopupToFront(t){const e=this.getPopupParent(),s=Array.prototype.slice.call(e.querySelectorAll(".ag-popup")),i=s.length,o=Array.prototype.slice.call(e.querySelectorAll(".ag-popup.ag-always-on-top")),r=o.length,n=this.getWrapper(t);if(!n||i<=1||!e.contains(t))return;const l=s.indexOf(n),a=n.querySelectorAll("div"),d=[];for(a.forEach(h=>{h.scrollTop!==0&&d.push([h,h.scrollTop])}),r?n.classList.contains("ag-always-on-top")?l!==i-1&&ie(o).insertAdjacentElement("afterend",n):l!==i-r-1&&o[0].insertAdjacentElement("beforebegin",n):l!==i-1&&ie(s).insertAdjacentElement("afterend",n);d.length;){const h=d.pop();h[0].scrollTop=h[1]}}};gs.WAIT_FOR_POPUP_CONTENT_RESIZE=200,u([f("focusService")],gs.prototype,"focusService",2),u([f("ctrlsService")],gs.prototype,"ctrlsService",2),u([f("resizeObserverService")],gs.prototype,"resizeObserverService",2),u([M],gs.prototype,"postConstruct",1),gs=u([O("popupService")],gs);var Dm=class extends K{constructor(){super(`
268
+ <div class="ag-autocomplete-row" role="presentation">
269
+ <div class="ag-autocomplete-row-label"></div>
270
+ </div>`),this.hasHighlighting=!1}setState(t,e){this.value=t,this.render(),this.updateSelected(e)}updateSelected(t){this.addOrRemoveCssClass("ag-autocomplete-row-selected",t)}setSearchString(t){var e;let s=!1;if(P(t)){const i=(e=this.value)==null?void 0:e.toLocaleLowerCase().indexOf(t.toLocaleLowerCase());if(i>=0){s=!0,this.hasHighlighting=!0;const o=i+t.length,r=Ne(this.value.slice(0,i)),n=Ne(this.value.slice(i,o)),l=Ne(this.value.slice(o));this.getGui().lastElementChild.innerHTML=`${r}<b>${n}</b>${l}`}}!s&&this.hasHighlighting&&(this.hasHighlighting=!1,this.render())}render(){var t;this.getGui().lastElementChild.innerHTML=(t=Ne(this.value))!=null?t:"&nbsp;"}},mn=class Nc extends zs{constructor(e){super(Nc.TEMPLATE),this.params=e,this.searchString=""}destroy(){super.destroy()}init(){this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList=this.createManagedBean(new Lh({cssIdentifier:"autocomplete"})),this.virtualList.setComponentCreator(this.createRowComponent.bind(this)),this.eList.appendChild(this.virtualList.getGui()),this.virtualList.setModel({getRowCount:()=>this.autocompleteEntries.length,getRow:s=>this.autocompleteEntries[s]});const e=this.virtualList.getGui();this.addManagedListener(e,"click",()=>this.params.onConfirmed()),this.addManagedListener(e,"mousemove",this.onMouseMove.bind(this)),this.addManagedListener(e,"mousedown",s=>s.preventDefault()),this.setSelectedValue(0)}onNavigationKeyDown(e,s){e.preventDefault();const i=this.autocompleteEntries.indexOf(this.selectedValue),o=s===E.UP?i-1:i+1;this.checkSetSelectedValue(o)}setSearch(e){this.searchString=e,P(e)?this.runSearch():(this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList.refresh(),this.checkSetSelectedValue(0)),this.updateSearchInList()}runContainsSearch(e,s){let i,o=!1;const r=e.toLocaleLowerCase(),n=s.filter(l=>{const d=l.toLocaleLowerCase().indexOf(r),h=d===0,c=d>=0;return c&&(!i||!o&&h||o===h&&l.length<i.length)&&(i=l,o=h),c});return!i&&n.length&&(i=n[0]),{topMatch:i,allMatches:n}}runSearch(){var e,s;const{autocompleteEntries:i}=this.params,o=i.map(d=>{var h;return(h=d.displayValue)!=null?h:d.key});let r,n;if(this.params.useFuzzySearch)r=Ao(this.searchString,o,!0).values,n=r.length?r[0]:void 0;else{const d=this.runContainsSearch(this.searchString,o);r=d.allMatches,n=d.topMatch}let l=i.filter(({key:d,displayValue:h})=>r.includes(h??d));if(!l.length&&this.selectedValue&&((s=(e=this.params)==null?void 0:e.forceLastSelection)!=null&&s.call(e,this.selectedValue,this.searchString))&&(l=[this.selectedValue]),this.autocompleteEntries=l,this.virtualList.refresh(),!n)return;const a=r.indexOf(n);this.checkSetSelectedValue(a)}updateSearchInList(){this.virtualList.forEachRenderedRow(e=>e.setSearchString(this.searchString))}checkSetSelectedValue(e){e>=0&&e<this.autocompleteEntries.length&&this.setSelectedValue(e)}setSelectedValue(e){const s=this.autocompleteEntries[e];this.selectedValue!==s&&(this.selectedValue=s,this.virtualList.ensureIndexVisible(e),this.virtualList.forEachRenderedRow((i,o)=>{i.updateSelected(e===o)}))}createRowComponent(e){var s;const i=new Dm;return this.getContext().createBean(i),i.setState((s=e.displayValue)!=null?s:e.key,e===this.selectedValue),i}onMouseMove(e){const s=this.virtualList.getGui().getBoundingClientRect(),i=this.virtualList.getScrollTop(),o=e.clientY-s.top+i,r=Math.floor(o/this.virtualList.getRowHeight());this.checkSetSelectedValue(r)}afterGuiAttached(){this.virtualList.refresh()}getSelectedValue(){var e;return this.autocompleteEntries.length&&(e=this.selectedValue)!=null?e:null}};mn.TEMPLATE=`<div class="ag-autocomplete-list-popup">
271
+ <div ref="eList" class="ag-autocomplete-list"></div>
272
+ <div>`,u([I("eList")],mn.prototype,"eList",2),u([M],mn.prototype,"init",1);var Am=mn,Ts=class pr extends K{constructor(){super(`
273
+ <div class="ag-autocomplete" role="presentation">
274
+ <ag-input-text-field ref="eAutocompleteInput"></ag-input-text-field>
275
+ </div>`),this.isListOpen=!1,this.lastPosition=0,this.valid=!0}postConstruct(){this.eAutocompleteInput.onValueChange(e=>this.onValueChanged(e)),this.eAutocompleteInput.getInputElement().setAttribute("autocomplete","off"),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.addGuiEventListener("click",this.updatePositionAndList.bind(this)),this.addDestroyFunc(()=>{this.destroyBean(this.autocompleteList)}),this.addGuiEventListener("focusout",()=>this.onFocusOut())}onValueChanged(e){const s=Yt(e);this.updateValue(s),this.updateAutocompleteList(s)}updateValue(e){this.updateLastPosition(),this.dispatchEvent({type:pr.EVENT_VALUE_CHANGED,value:e}),this.validate(e)}updateAutocompleteList(e){var s,i,o,r;const n=(i=(s=this.listGenerator)==null?void 0:s.call(this,e,this.lastPosition))!=null?i:{enabled:!1};if((!n.type||n.type!==((o=this.autocompleteListParams)==null?void 0:o.type))&&this.isListOpen&&this.closeList(),this.autocompleteListParams=n,(r=this.autocompleteListParams)!=null&&r.enabled){this.isListOpen||this.openList();const{searchString:l}=this.autocompleteListParams;this.autocompleteList.setSearch(l??"")}else this.isListOpen&&this.closeList()}onKeyDown(e){const s=e.key;switch(this.updateLastPosition(),s){case E.ENTER:this.onEnterKeyDown(e);break;case E.TAB:this.onTabKeyDown(e);break;case E.DOWN:case E.UP:this.onUpDownKeyDown(e,s);break;case E.LEFT:case E.RIGHT:case E.PAGE_HOME:case E.PAGE_END:setTimeout(()=>{this.updatePositionAndList()});break;case E.ESCAPE:this.onEscapeKeyDown(e);break;case E.SPACE:e.ctrlKey&&!this.isListOpen&&(e.preventDefault(),this.forceOpenList());break}}confirmSelection(){var e;const s=(e=this.autocompleteList)==null?void 0:e.getSelectedValue();s&&(this.closeList(),this.dispatchEvent({type:pr.EVENT_OPTION_SELECTED,value:this.getValue(),position:this.lastPosition,updateEntry:s,autocompleteType:this.autocompleteListParams.type}))}onTabKeyDown(e){this.isListOpen&&(e.preventDefault(),e.stopPropagation(),this.confirmSelection())}onEnterKeyDown(e){e.preventDefault(),this.isListOpen?this.confirmSelection():this.onCompleted()}onUpDownKeyDown(e,s){var i;e.preventDefault(),this.isListOpen?(i=this.autocompleteList)==null||i.onNavigationKeyDown(e,s):this.forceOpenList()}onEscapeKeyDown(e){this.isListOpen&&(e.preventDefault(),e.stopPropagation(),this.closeList(),this.setCaret(this.lastPosition,!0))}onFocusOut(){this.isListOpen&&this.closeList()}updatePositionAndList(){var e;this.updateLastPosition(),this.updateAutocompleteList((e=this.eAutocompleteInput.getValue())!=null?e:null)}setCaret(e,s){const i=this.gos.getDocument(),o=this.gos.getActiveDomElement();s&&(!o||o===i.body)&&this.eAutocompleteInput.getFocusableElement().focus();const r=this.eAutocompleteInput.getInputElement();r.setSelectionRange(e,e),e===r.value.length&&(r.scrollLeft=r.scrollWidth)}forceOpenList(){this.onValueChanged(this.eAutocompleteInput.getValue())}updateLastPosition(){var e;this.lastPosition=(e=this.eAutocompleteInput.getInputElement().selectionStart)!=null?e:0}validate(e){var s;this.validator&&(this.validationMessage=this.validator(e),this.eAutocompleteInput.getInputElement().setCustomValidity((s=this.validationMessage)!=null?s:""),this.valid=!this.validationMessage,this.dispatchEvent({type:pr.EVENT_VALID_CHANGED,isValid:this.valid,validationMessage:this.validationMessage}))}openList(){this.isListOpen=!0,this.autocompleteList=this.createBean(new Am({autocompleteEntries:this.autocompleteListParams.entries,onConfirmed:()=>this.confirmSelection(),forceLastSelection:this.forceLastSelection}));const e=this.autocompleteList.getGui(),s={ePopup:e,type:"autocomplete",eventSource:this.getGui(),position:"under",alignSide:this.gos.get("enableRtl")?"right":"left",keepWithinBounds:!0},i=this.popupService.addPopup({eChild:e,anchorToElement:this.getGui(),positionCallback:()=>this.popupService.positionPopupByComponent(s),ariaLabel:this.listAriaLabel});this.hidePopup=i.hideFunc,this.autocompleteList.afterGuiAttached()}closeList(){this.isListOpen=!1,this.hidePopup(),this.destroyBean(this.autocompleteList),this.autocompleteList=null}onCompleted(){this.isListOpen&&this.closeList(),this.dispatchEvent({type:pr.EVENT_VALUE_CONFIRMED,value:this.getValue(),isValid:this.isValid()})}getValue(){return Yt(this.eAutocompleteInput.getValue())}setInputPlaceholder(e){return this.eAutocompleteInput.setInputPlaceholder(e),this}setInputAriaLabel(e){return this.eAutocompleteInput.setInputAriaLabel(e),this}setListAriaLabel(e){return this.listAriaLabel=e,this}setListGenerator(e){return this.listGenerator=e,this}setValidator(e){return this.validator=e,this}isValid(){return this.valid}setValue(e){const{value:s,position:i,silent:o,updateListOnlyIfOpen:r,restoreFocus:n}=e;this.eAutocompleteInput.setValue(s,!0),this.setCaret(i??this.lastPosition,n),o||this.updateValue(s),(!r||this.isListOpen)&&this.updateAutocompleteList(s)}setForceLastSelection(e){return this.forceLastSelection=e,this}setInputDisabled(e){return this.eAutocompleteInput.setDisabled(e),this}};Ts.EVENT_VALUE_CHANGED="eventValueChanged",Ts.EVENT_VALUE_CONFIRMED="eventValueConfirmed",Ts.EVENT_OPTION_SELECTED="eventOptionSelected",Ts.EVENT_VALID_CHANGED="eventValidChanged",u([f("popupService")],Ts.prototype,"popupService",2),u([I("eAutocompleteInput")],Ts.prototype,"eAutocompleteInput",2),u([M],Ts.prototype,"postConstruct",1);var Pm=Ts,Ds=class Ln extends K{constructor(e,s,i,o){super(),this.dragSourceDropTarget=e,this.ghost=s,this.horizontal=i,this.template=o}init(){var e;this.setTemplate((e=this.template)!=null?e:Ln.TEMPLATE);const s=this.getGui();this.addElementClasses(s),this.addElementClasses(this.eDragHandle,"drag-handle"),this.addElementClasses(this.eText,"text"),this.addElementClasses(this.eButton,"button"),this.eDragHandle.appendChild(be("columnDrag",this.gos)),this.eButton.appendChild(be("cancel",this.gos)),this.setupComponents(),!this.ghost&&this.isDraggable()&&this.addDragSource(),this.setupAria(),this.setupTooltip(),this.activateTabIndex(),this.refreshDraggable()}isDraggable(){return!0}refreshDraggable(){this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!this.isDraggable())}setupAria(){const e=this.localeService.getLocaleTextFunc(),s=[this.getAriaDisplayName()];this.addAdditionalAriaInstructions(s,e),St(this.getGui(),s.join(". "))}addAdditionalAriaInstructions(e,s){if(this.isRemovable()){const i=s("ariaDropZoneColumnComponentDescription","Press DELETE to remove");e.push(i)}}setupTooltip(){const e=()=>{const s=this.getTooltip();this.setTooltip({newTooltipText:s})};e(),this.addManagedListener(this.eventService,p.EVENT_NEW_COLUMNS_LOADED,e)}getDragSourceId(){}getDefaultIconName(){return j.ICON_NOT_ALLOWED}addDragSource(){const{dragAndDropService:e,eDragHandle:s}=this,i=this.createGetDragItem(),o=this.getDefaultIconName(),r={type:this.getDragSourceType(),sourceId:this.getDragSourceId(),eElement:s,getDefaultIconName:()=>o,getDragItem:i,dragItemName:this.getDisplayName()};e.addDragSource(r,!0),this.addDestroyFunc(()=>e.removeDragSource(r))}setupComponents(){this.setTextValue(),this.setupRemove(),this.ghost&&this.addCssClass("ag-column-drop-cell-ghost")}isRemovable(){return!0}refreshRemove(){$(this.eButton,this.isRemovable())}setupRemove(){this.refreshRemove();const e={type:Ln.EVENT_COLUMN_REMOVE};this.addGuiEventListener("keydown",i=>this.onKeyDown(i)),this.addManagedListener(this.eButton,"click",i=>{this.dispatchEvent(e),i.stopPropagation()});const s=new ze(this.eButton);this.addManagedListener(s,ze.EVENT_TAP,()=>{this.dispatchEvent(e)}),this.addDestroyFunc(s.destroy.bind(s))}onKeyDown(e){e.key===E.DELETE&&this.isRemovable()&&(e.preventDefault(),this.dispatchEvent({type:Ln.EVENT_COLUMN_REMOVE}))}getDisplayValue(){return this.getDisplayName()}setTextValue(){const e=this.getDisplayValue(),s=Ne(e);this.eText.innerHTML=s}addElementClasses(e,s){s=s?`-${s}`:"";const i=this.horizontal?"horizontal":"vertical";e.classList.add(`ag-column-drop-cell${s}`,`ag-column-drop-${i}-cell${s}`)}destroy(){super.destroy(),this.dragSourceDropTarget=null}};Ds.EVENT_COLUMN_REMOVE="columnRemove",Ds.TEMPLATE=`<span role="option">
276
+ <span ref="eDragHandle" class="ag-drag-handle ag-column-drop-cell-drag-handle" role="presentation"></span>
277
+ <span ref="eText" class="ag-column-drop-cell-text" aria-hidden="true"></span>
278
+ <span ref="eButton" class="ag-column-drop-cell-button" role="presentation"></span>
279
+ </span>`,u([f("dragAndDropService")],Ds.prototype,"dragAndDropService",2),u([I("eText")],Ds.prototype,"eText",2),u([I("eDragHandle")],Ds.prototype,"eDragHandle",2),u([I("eButton")],Ds.prototype,"eButton",2),u([M],Ds.prototype,"init",1);var Fm=Ds,Yo=class ss extends K{constructor(e){super('<div class="ag-unselectable" role="presentation"></div>'),this.horizontal=e,this.state=ss.STATE_NOT_DRAGGING,this.guiDestroyFunctions=[],this.childPillComponents=[],this.resizeEnabled=!1,this.addElementClasses(this.getGui()),this.ePillDropList=document.createElement("div"),this.addElementClasses(this.ePillDropList,"list"),Ae(this.ePillDropList,"listbox")}isHorizontal(){return this.horizontal}toggleResizable(e){this.positionableFeature.setResizable(e?{bottom:!0}:!1),this.resizeEnabled=e}isSourceEventFromTarget(e){const{dropZoneTarget:s,dragSource:i}=e;return s.contains(i.eElement)}destroy(){this.destroyGui(),super.destroy()}destroyGui(){this.guiDestroyFunctions.forEach(e=>e()),this.guiDestroyFunctions.length=0,this.childPillComponents.length=0,Le(this.getGui()),Le(this.ePillDropList)}init(e){this.params=e??{},this.createManagedBean(new ws(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.setupDropTarget(),this.positionableFeature=new Li(this.getGui(),{minHeight:100}),this.createManagedBean(this.positionableFeature),this.refreshGui(),St(this.ePillDropList,this.getAriaLabel())}handleKeyDown(e){const s=!this.horizontal;let i=e.key===E.DOWN,o=e.key===E.UP;if(!s){const n=this.gos.get("enableRtl");i=!n&&e.key===E.RIGHT||n&&e.key===E.LEFT,o=!n&&e.key===E.LEFT||n&&e.key===E.RIGHT}if(!i&&!o)return;const r=this.focusService.findNextFocusableElement(this.getFocusableElement(),!1,o);r&&(e.preventDefault(),r.focus())}addElementClasses(e,s){s=s?`-${s}`:"";const i=this.horizontal?"horizontal":"vertical";e.classList.add(`ag-column-drop${s}`,`ag-column-drop-${i}${s}`)}setupDropTarget(){this.dropTarget={getContainer:this.getGui.bind(this),getIconName:this.getIconName.bind(this),onDragging:this.onDragging.bind(this),onDragEnter:this.onDragEnter.bind(this),onDragLeave:this.onDragLeave.bind(this),onDragStop:this.onDragStop.bind(this),isInterestedIn:this.isInterestedIn.bind(this)},this.dragAndDropService.addDropTarget(this.dropTarget)}minimumAllowedNewInsertIndex(){return 0}checkInsertIndex(e){const s=this.getNewInsertIndex(e);if(s<0)return!1;const i=this.minimumAllowedNewInsertIndex(),o=Math.max(i,s),r=o!==this.insertIndex;return r&&(this.insertIndex=o),r}getNewInsertIndex(e){const s=e.event,i=this.horizontal?s.clientX:s.clientY,o=this.childPillComponents.map(n=>n.getGui().getBoundingClientRect()),r=o.findIndex(n=>this.horizontal?n.right>i&&n.left<i:n.top<i&&n.bottom>i);if(r===-1){const n=this.gos.get("enableRtl");return o.every(d=>i>(this.horizontal?d.right:d.bottom))?n&&this.horizontal?0:this.childPillComponents.length:o.every(d=>i<(this.horizontal?d.left:d.top))?n&&this.horizontal?this.childPillComponents.length:0:this.insertIndex}return this.insertIndex<=r?r+1:r}checkDragStartedBySelf(e){this.state===ss.STATE_NOT_DRAGGING&&(this.state=ss.STATE_REARRANGE_ITEMS,this.potentialDndItems=this.getItems(e.dragSource.getDragItem()),this.refreshGui(),this.checkInsertIndex(e),this.refreshGui())}onDragging(e){this.checkDragStartedBySelf(e),this.checkInsertIndex(e)&&this.refreshGui()}handleDragEnterEnd(e){}onDragEnter(e){const s=this.getItems(e.dragSource.getDragItem());this.state=ss.STATE_NEW_ITEMS_IN;const i=s.filter(r=>this.isItemDroppable(r,e)),o=i.every(r=>this.childPillComponents.map(n=>n.getItem()).indexOf(r)!==-1);if(i.length!==0){if(this.potentialDndItems=i,o){this.state=ss.STATE_NOT_DRAGGING;return}this.handleDragEnterEnd(e),this.checkInsertIndex(e),this.refreshGui()}}isPotentialDndItems(){return _d(this.potentialDndItems)}handleDragLeaveEnd(e){}onDragLeave(e){if(this.state===ss.STATE_REARRANGE_ITEMS){const s=this.getItems(e.dragSource.getDragItem());this.removeItems(s)}this.isPotentialDndItems()&&(this.handleDragLeaveEnd(e),this.potentialDndItems=[],this.refreshGui()),this.state=ss.STATE_NOT_DRAGGING}refreshOnDragStop(){return!0}onDragStop(){if(this.isPotentialDndItems()){let e=!1;this.state===ss.STATE_NEW_ITEMS_IN?(this.addItems(this.potentialDndItems),e=!0):e=this.rearrangeItems(this.potentialDndItems),this.potentialDndItems=[],(this.refreshOnDragStop()||!e)&&this.refreshGui()}this.state=ss.STATE_NOT_DRAGGING}removeItems(e){const s=this.getExistingItems().filter(i=>!wt(e,i));this.updateItems(s)}addItems(e){if(!e)return;const s=this.getExistingItems().slice(),i=e.filter(o=>s.indexOf(o)<0);Qn(s,i,this.insertIndex),this.updateItems(s)}addItem(e){this.insertIndex=this.getExistingItems().length,this.addItems([e]),this.refreshGui()}rearrangeItems(e){const s=this.getNonGhostItems().slice();return Qn(s,e,this.insertIndex),jt(s,this.getExistingItems())?!1:(this.updateItems(s),!0)}refreshGui(){const e=this.ePillDropList.scrollTop,s=this.resizeEnabled,i=this.getFocusedItem();let o=this.focusService.findNextFocusableElement();o||(o=this.focusService.findNextFocusableElement(void 0,!1,!0)),this.toggleResizable(!1),this.destroyGui(),this.addIconAndTitleToGui(),this.addEmptyMessageToGui(),this.addItemsToGui(),this.isHorizontal()||(this.ePillDropList.scrollTop=e),s&&this.toggleResizable(s),this.focusService.isKeyboardMode()&&this.restoreFocus(i,o)}getFocusedItem(){const e=this.getGui(),s=this.gos.getActiveDomElement();return e.contains(s)?Array.from(e.querySelectorAll(".ag-column-drop-cell")).indexOf(s):-1}restoreFocus(e,s){const i=this.getGui(),o=Array.from(i.querySelectorAll(".ag-column-drop-cell"));if(e===-1)return;o.length===0&&s.focus();const r=Math.min(o.length-1,e),n=o[r];n&&n.focus()}focusList(e){const s=e?this.childPillComponents.length-1:0;this.restoreFocus(s,this.getFocusableElement())}getNonGhostItems(){const e=this.getExistingItems();return this.isPotentialDndItems()?e.filter(s=>!wt(this.potentialDndItems,s)):e}addItemsToGui(){const s=this.getNonGhostItems().map(i=>this.createItemComponent(i,!1));if(this.isPotentialDndItems()){const i=this.potentialDndItems.map(o=>this.createItemComponent(o,!0));this.insertIndex>=s.length?s.push(...i):s.splice(this.insertIndex,0,...i)}this.appendChild(this.ePillDropList),s.forEach((i,o)=>{o>0&&this.addArrow(this.ePillDropList),this.ePillDropList.appendChild(i.getGui())}),this.addAriaLabelsToComponents()}addAriaLabelsToComponents(){this.childPillComponents.forEach((e,s)=>{const i=e.getGui();Nr(i,s+1),Ir(i,this.childPillComponents.length)})}createItemComponent(e,s){const i=this.createPillComponent(e,this.dropTarget,s,this.horizontal);return i.addEventListener(Fm.EVENT_COLUMN_REMOVE,this.removeItems.bind(this,[e])),this.context.createBean(i),this.guiDestroyFunctions.push(()=>this.destroyBean(i)),s||this.childPillComponents.push(i),i}addIconAndTitleToGui(){const{title:e,icon:s}=this.params;if(!e||!s)return;const i=document.createElement("div");if(wo(i,!0),this.addElementClasses(i,"title-bar"),this.addElementClasses(s,"icon"),this.addOrRemoveCssClass("ag-column-drop-empty",this.isExistingItemsEmpty()),i.appendChild(s),!this.horizontal){const o=document.createElement("span");this.addElementClasses(o,"title"),o.innerHTML=e,i.appendChild(o)}this.appendChild(i)}isExistingItemsEmpty(){return this.getExistingItems().length===0}addEmptyMessageToGui(){const{emptyMessage:e}=this.params;if(!e||!this.isExistingItemsEmpty()||this.isPotentialDndItems())return;const s=document.createElement("span");s.innerHTML=e,this.addElementClasses(s,"empty-message"),this.ePillDropList.appendChild(s)}addArrow(e){if(this.horizontal){const s=this.gos.get("enableRtl"),i=be(s?"smallLeft":"smallRight",this.gos);this.addElementClasses(i,"cell-separator"),e.appendChild(i)}}};Yo.STATE_NOT_DRAGGING="notDragging",Yo.STATE_NEW_ITEMS_IN="newItemsIn",Yo.STATE_REARRANGE_ITEMS="rearrangeItems",u([f("focusService")],Yo.prototype,"focusService",2),u([f("dragAndDropService")],Yo.prototype,"dragAndDropService",2);var Lm=["touchstart","touchend","touchmove","touchcancel"],Nh=class{constructor(t="javascript"){this.frameworkName=t,this.renderingEngine="vanilla",this.wrapIncoming=e=>e(),this.wrapOutgoing=e=>e()}setInterval(t,e){return new xe(s=>{s(window.setInterval(t,e))})}addEventListener(t,e,s,i){const o=wt(Lm,e);t.addEventListener(e,s,{capture:!!i,passive:o})}get shouldWrapOutgoing(){return!1}frameworkComponent(t){return null}isFrameworkComponent(t){return!1}getDocLink(t){return`https://www.ag-grid.com/${this.frameworkName==="solid"?"react":this.frameworkName}-data-grid${t?`/${t}`:""}`}},As=class extends L{getNextCellToFocus(t,e,s=!1){return s?this.getNextCellToFocusWithCtrlPressed(t,e):this.getNextCellToFocusWithoutCtrlPressed(t,e)}getNextCellToFocusWithCtrlPressed(t,e){const s=t===E.UP,i=t===E.DOWN,o=t===E.LEFT;let r,n;if(s||i)n=s?this.paginationProxy.getPageFirstRow():this.paginationProxy.getPageLastRow(),r=e.column;else{const l=this.columnModel.getAllDisplayedColumns(),a=this.gos.get("enableRtl");n=e.rowIndex,r=o!==a?l[0]:ie(l)}return{rowIndex:n,rowPinned:null,column:r}}getNextCellToFocusWithoutCtrlPressed(t,e){let s=e,i=!1;for(;!i;){switch(t){case E.UP:s=this.getCellAbove(s);break;case E.DOWN:s=this.getCellBelow(s);break;case E.RIGHT:this.gos.get("enableRtl")?s=this.getCellToLeft(s):s=this.getCellToRight(s);break;case E.LEFT:this.gos.get("enableRtl")?s=this.getCellToRight(s):s=this.getCellToLeft(s);break;default:s=null,console.warn("AG Grid: unknown key for navigation "+t);break}s?i=this.isCellGoodToFocusOn(s):i=!0}return s}isCellGoodToFocusOn(t){const e=t.column;let s;switch(t.rowPinned){case"top":s=this.pinnedRowModel.getPinnedTopRow(t.rowIndex);break;case"bottom":s=this.pinnedRowModel.getPinnedBottomRow(t.rowIndex);break;default:s=this.rowModel.getRow(t.rowIndex);break}return s?!e.isSuppressNavigable(s):!1}getCellToLeft(t){if(!t)return null;const e=this.columnModel.getDisplayedColBefore(t.column);return e?{rowIndex:t.rowIndex,column:e,rowPinned:t.rowPinned}:null}getCellToRight(t){if(!t)return null;const e=this.columnModel.getDisplayedColAfter(t.column);return e?{rowIndex:t.rowIndex,column:e,rowPinned:t.rowPinned}:null}getRowBelow(t){const e=t.rowIndex,s=t.rowPinned;if(this.isLastRowInContainer(t))switch(s){case"bottom":return null;case"top":return this.rowModel.isRowsToRender()?{rowIndex:this.paginationProxy.getPageFirstRow(),rowPinned:null}:this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null;default:return this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null}const i=this.rowModel.getRow(t.rowIndex),o=this.getNextStickyPosition(i);return o||{rowIndex:e+1,rowPinned:s}}getNextStickyPosition(t,e){if(!this.gos.isGroupRowsSticky()||!t||!t.sticky)return;const s=this.rowRenderer.getStickyTopRowCtrls().some(l=>l.getRowNode().rowIndex===t.rowIndex);let i=[];s?i=[...this.rowRenderer.getStickyTopRowCtrls()].sort((l,a)=>l.getRowNode().rowIndex-a.getRowNode().rowIndex):i=[...this.rowRenderer.getStickyBottomRowCtrls()].sort((l,a)=>a.getRowNode().rowIndex-l.getRowNode().rowIndex);const o=e?-1:1,r=i.findIndex(l=>l.getRowNode().rowIndex===t.rowIndex),n=i[r+o];if(n)return{rowIndex:n.getRowNode().rowIndex,rowPinned:null}}getCellBelow(t){if(!t)return null;const e=this.getRowBelow(t);return e?{rowIndex:e.rowIndex,column:t.column,rowPinned:e.rowPinned}:null}isLastRowInContainer(t){const e=t.rowPinned,s=t.rowIndex;return e==="top"?this.pinnedRowModel.getPinnedTopRowData().length-1<=s:e==="bottom"?this.pinnedRowModel.getPinnedBottomRowData().length-1<=s:this.paginationProxy.getPageLastRow()<=s}getRowAbove(t){const e=t.rowIndex,s=t.rowPinned;if(s?e===0:e===this.paginationProxy.getPageFirstRow())return s==="top"?null:s?this.rowModel.isRowsToRender()?this.getLastBodyCell():this.pinnedRowModel.isRowsToRender("top")?this.getLastFloatingTopRow():null:this.pinnedRowModel.isRowsToRender("top")?this.getLastFloatingTopRow():null;const o=this.rowModel.getRow(t.rowIndex),r=this.getNextStickyPosition(o,!0);return r||{rowIndex:e-1,rowPinned:s}}getCellAbove(t){if(!t)return null;const e=this.getRowAbove({rowIndex:t.rowIndex,rowPinned:t.rowPinned});return e?{rowIndex:e.rowIndex,column:t.column,rowPinned:e.rowPinned}:null}getLastBodyCell(){return{rowIndex:this.paginationProxy.getPageLastRow(),rowPinned:null}}getLastFloatingTopRow(){return{rowIndex:this.pinnedRowModel.getPinnedTopRowData().length-1,rowPinned:"top"}}getNextTabbedCell(t,e){return e?this.getNextTabbedCellBackwards(t):this.getNextTabbedCellForwards(t)}getNextTabbedCellForwards(t){const e=this.columnModel.getAllDisplayedColumns();let s=t.rowIndex,i=t.rowPinned,o=this.columnModel.getDisplayedColAfter(t.column);if(!o){o=e[0];const r=this.getRowBelow(t);if(z(r)||!r.rowPinned&&!this.paginationProxy.isRowInPage(r))return null;s=r?r.rowIndex:null,i=r?r.rowPinned:null}return{rowIndex:s,column:o,rowPinned:i}}getNextTabbedCellBackwards(t){const e=this.columnModel.getAllDisplayedColumns();let s=t.rowIndex,i=t.rowPinned,o=this.columnModel.getDisplayedColBefore(t.column);if(!o){o=ie(e);const r=this.getRowAbove({rowIndex:t.rowIndex,rowPinned:t.rowPinned});if(z(r)||!r.rowPinned&&!this.paginationProxy.isRowInPage(r))return null;s=r?r.rowIndex:null,i=r?r.rowPinned:null}return{rowIndex:s,column:o,rowPinned:i}}};u([f("columnModel")],As.prototype,"columnModel",2),u([f("rowModel")],As.prototype,"rowModel",2),u([f("rowRenderer")],As.prototype,"rowRenderer",2),u([f("pinnedRowModel")],As.prototype,"pinnedRowModel",2),u([f("paginationProxy")],As.prototype,"paginationProxy",2),As=u([O("cellNavigationService")],As);var oi=class extends L{constructor(){super(...arguments),this.consuming=!1}setBeans(t){this.logger=t.create("AlignedGridsService")}getAlignedGridApis(){var t;let e=(t=this.gos.get("alignedGrids"))!=null?t:[];const s=typeof e=="function";typeof e=="function"&&(e=e());const i=()=>`See ${this.getFrameworkOverrides().getDocLink("aligned-grids")}`;return e.map(r=>{var n;if(!r){Os("alignedGrids contains an undefined option."),s||Os(`You may want to configure via a callback to avoid setup race conditions:
280
+ "alignedGrids: () => [linkedGrid]"`),Os(i());return}if(r instanceof Z)return r;const l=r;return"current"in l?(n=l.current)==null?void 0:n.api:(l.api||Os(`alignedGrids - No api found on the linked grid. If you are passing gridOptions to alignedGrids since v31 this is no longer valid. ${i()}`),l.api)}).filter(r=>!!r&&!r.isDestroyed())}init(){this.addManagedListener(this.eventService,p.EVENT_COLUMN_MOVED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,p.EVENT_COLUMN_VISIBLE,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,p.EVENT_COLUMN_PINNED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,p.EVENT_COLUMN_GROUP_OPENED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,p.EVENT_COLUMN_RESIZED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,p.EVENT_BODY_SCROLL,this.fireScrollEvent.bind(this))}fireEvent(t){this.consuming||this.getAlignedGridApis().forEach(e=>{if(e.isDestroyed())return;const s=e.__getAlignedGridService();t(s)})}onEvent(t){this.consuming=!0,t(),this.consuming=!1}fireColumnEvent(t){this.fireEvent(e=>{e.onColumnEvent(t)})}fireScrollEvent(t){t.direction==="horizontal"&&this.fireEvent(e=>{e.onScrollEvent(t)})}onScrollEvent(t){this.onEvent(()=>{this.ctrlsService.getGridBodyCtrl().getScrollFeature().setHorizontalScrollPosition(t.left,!0)})}getMasterColumns(t){const e=[];return t.columns?t.columns.forEach(s=>{e.push(s)}):t.column&&e.push(t.column),e}getColumnIds(t){const e=[];return t.columns?t.columns.forEach(s=>{e.push(s.getColId())}):t.column&&e.push(t.column.getColId()),e}onColumnEvent(t){this.onEvent(()=>{switch(t.type){case p.EVENT_COLUMN_MOVED:case p.EVENT_COLUMN_VISIBLE:case p.EVENT_COLUMN_PINNED:case p.EVENT_COLUMN_RESIZED:const e=t;this.processColumnEvent(e);break;case p.EVENT_COLUMN_GROUP_OPENED:const s=t;this.processGroupOpenedEvent(s);break;case p.EVENT_COLUMN_PIVOT_CHANGED:console.warn("AG Grid: pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid.");break}})}processGroupOpenedEvent(t){t.columnGroups.forEach(e=>{let s=null;if(e){const i=e.getGroupId();s=this.columnModel.getProvidedColumnGroup(i)}e&&!s||(this.logger.log("onColumnEvent-> processing "+t+" expanded = "+e.isExpanded()),this.columnModel.setColumnGroupOpened(s,e.isExpanded(),"alignedGridChanged"))})}processColumnEvent(t){var e;const s=t.column;let i=null;if(s&&(i=this.columnModel.getPrimaryColumn(s.getColId())),s&&!i)return;const o=this.getMasterColumns(t);switch(t.type){case p.EVENT_COLUMN_MOVED:{const d=t,c=t.api.getColumnState().map(m=>({colId:m.colId}));this.columnModel.applyColumnState({state:c,applyOrder:!0},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${t.type} toIndex = ${d.toIndex}`)}break;case p.EVENT_COLUMN_VISIBLE:{const d=t,c=t.api.getColumnState().map(m=>({colId:m.colId,hide:m.hide}));this.columnModel.applyColumnState({state:c},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${t.type} visible = ${d.visible}`)}break;case p.EVENT_COLUMN_PINNED:{const d=t,c=t.api.getColumnState().map(m=>({colId:m.colId,pinned:m.pinned}));this.columnModel.applyColumnState({state:c},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${t.type} pinned = ${d.pinned}`)}break;case p.EVENT_COLUMN_RESIZED:const l=t,a={};o.forEach(d=>{this.logger.log(`onColumnEvent-> processing ${t.type} actualWidth = ${d.getActualWidth()}`),a[d.getId()]={key:d.getColId(),newWidth:d.getActualWidth()}}),(e=l.flexColumns)==null||e.forEach(d=>{a[d.getId()]&&delete a[d.getId()]}),this.columnModel.setColumnWidths(Object.values(a),!1,l.finished,"alignedGridChanged");break}const n=this.ctrlsService.getGridBodyCtrl().isVerticalScrollShowing();this.getAlignedGridApis().forEach(l=>{l.setGridOption("alwaysShowVerticalScroll",n)})}};u([f("columnModel")],oi.prototype,"columnModel",2),u([f("ctrlsService")],oi.prototype,"ctrlsService",2),u([xt(0,Tt("loggerFactory"))],oi.prototype,"setBeans",1),u([M],oi.prototype,"init",1),oi=u([O("alignedGridsService")],oi);var ri=class extends L{constructor(){super(...arguments),this.selectedNodes=new Map,this.lastRowNode=null}init(){this.rowSelection=this.gos.get("rowSelection"),this.groupSelectsChildren=this.gos.get("groupSelectsChildren"),this.addManagedPropertyListeners(["groupSelectsChildren","rowSelection"],()=>{this.groupSelectsChildren=this.gos.get("groupSelectsChildren"),this.rowSelection=this.gos.get("rowSelection"),this.deselectAllRowNodes({source:"api"})}),this.addManagedListener(this.eventService,p.EVENT_ROW_SELECTED,this.onRowSelected.bind(this))}destroy(){super.destroy(),this.resetNodes(),this.lastRowNode=null}isMultiselect(){return this.rowSelection==="multiple"}setNodesSelected(t){var e;const{newValue:s,clearSelection:i,suppressFinishActions:o,rangeSelect:r,nodes:n,event:l,source:a="api"}=t;if(n.length===0)return 0;if(n.length>1&&!this.isMultiselect())return console.warn("AG Grid: cannot multi select while rowSelection='single'"),0;const d=this.groupSelectsChildren&&t.groupSelectsFiltered===!0,h=n.map(m=>m.footer?m.sibling:m);if(r){if(n.length>1)return console.warn("AG Grid: cannot range select while selecting multiple rows"),0;let m=null;if(a==="checkboxSelected"&&s===!1&&this.lastRowNode&&(this.lastRowNode.id?m=this.lastRowNode:this.lastRowNode=null),m==null&&(m=this.getLastSelectedNode()),m){const C=h[0];if(C!==m&&this.isMultiselect())return this.selectRange(C,m,s,a)}}this.lastRowNode=s?null:h[0];let c=0;for(let m=0;m<h.length;m++){const C=h[m];d&&C.group||C.selectThisNode(s,l,a)&&c++,this.groupSelectsChildren&&((e=C.childrenAfterGroup)!=null&&e.length)&&(c+=this.selectChildren(C,s,d,a))}if(!o&&(s&&(i||!this.isMultiselect())&&(c+=this.clearOtherNodes(h[0],a)),c>0)){this.updateGroupsFromChildrenSelections(a);const C={type:p.EVENT_SELECTION_CHANGED,source:a};this.eventService.dispatchEvent(C)}return c}selectRange(t,e,s=!0,i){const o=this.rowModel.getNodesInRangeForSelection(t,e);let r=0;o.forEach(l=>{if(l.group&&this.groupSelectsChildren)return;l.selectThisNode(s,void 0,i)&&r++}),this.updateGroupsFromChildrenSelections(i);const n={type:p.EVENT_SELECTION_CHANGED,source:i};return this.eventService.dispatchEvent(n),r}selectChildren(t,e,s,i){const o=s?t.childrenAfterAggFilter:t.childrenAfterGroup;return z(o)?0:this.setNodesSelected({newValue:e,clearSelection:!1,suppressFinishActions:!0,groupSelectsFiltered:s,source:i,nodes:o})}getLastSelectedNode(){const t=Array.from(this.selectedNodes.keys());if(t.length==0)return null;const e=this.selectedNodes.get(ie(t));return e||null}getSelectedNodes(){const t=[];return this.selectedNodes.forEach(e=>{e&&t.push(e)}),t}getSelectedRows(){const t=[];return this.selectedNodes.forEach(e=>{e&&e.data&&t.push(e.data)}),t}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(t){const e=new Map;this.selectedNodes.forEach((s,i)=>{s&&t(s)&&e.set(i,s)}),this.selectedNodes=e}updateGroupsFromChildrenSelections(t,e){if(!this.groupSelectsChildren||this.rowModel.getType()!=="clientSide")return!1;const i=this.rowModel.getRootNode();e||(e=new cn(!0,i),e.setInactive());let o=!1;return e.forEachChangedNodeDepthFirst(r=>{if(r!==i){const n=r.calculateSelectedFromChildren();o=r.selectThisNode(n===null?!1:n,void 0,t)||o}}),o}clearOtherNodes(t,e){const s=new Map;let i=0;return this.selectedNodes.forEach(o=>{if(o&&o.id!==t.id){const r=this.selectedNodes.get(o.id);i+=r.setSelectedParams({newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:e}),this.groupSelectsChildren&&o.parent&&s.set(o.parent.id,o.parent)}}),s.forEach(o=>{const r=o.calculateSelectedFromChildren();o.selectThisNode(r===null?!1:r,void 0,e)}),i}onRowSelected(t){const e=t.node;this.groupSelectsChildren&&e.group||(e.isSelected()?this.selectedNodes.set(e.id,e):this.selectedNodes.delete(e.id))}syncInRowNode(t,e){this.syncInOldRowNode(t,e),this.syncInNewRowNode(t)}syncInOldRowNode(t,e){if(P(e)&&t.id!==e.id&&e){const i=e.id;this.selectedNodes.get(i)==t&&this.selectedNodes.set(e.id,e)}}syncInNewRowNode(t){this.selectedNodes.has(t.id)?(t.setSelectedInitialValue(!0),this.selectedNodes.set(t.id,t)):t.setSelectedInitialValue(!1)}reset(t){const e=this.getSelectionCount();if(this.resetNodes(),e){const s={type:p.EVENT_SELECTION_CHANGED,source:t};this.eventService.dispatchEvent(s)}}resetNodes(){var t;(t=this.selectedNodes)==null||t.clear()}getBestCostNodeSelection(){if(this.rowModel.getType()!=="clientSide")return;const e=this.rowModel.getTopLevelNodes();if(e===null)return;const s=[];function i(o){for(let r=0,n=o.length;r<n;r++){const l=o[r];if(l.isSelected())s.push(l);else{const a=l;a.group&&a.children&&i(a.children)}}}return i(e),s}isEmpty(){let t=0;return this.selectedNodes.forEach(e=>{e&&t++}),t===0}deselectAllRowNodes(t){const e=l=>l.selectThisNode(!1,void 0,i),s=this.rowModel.getType()==="clientSide",{source:i,justFiltered:o,justCurrentPage:r}=t;if(r||o){if(!s){console.error("AG Grid: selecting just filtered only works when gridOptions.rowModelType='clientSide'");return}this.getNodesToSelect(o,r).forEach(e)}else this.selectedNodes.forEach(l=>{l&&e(l)}),this.reset(i);s&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(i);const n={type:p.EVENT_SELECTION_CHANGED,source:i};this.eventService.dispatchEvent(n)}getSelectedCounts(t,e){let s=0,i=0;const o=r=>{this.groupSelectsChildren&&r.group||(r.isSelected()?s++:r.selectable&&i++)};return this.getNodesToSelect(t,e).forEach(o),{selectedCount:s,notSelectedCount:i}}getSelectAllState(t,e){const{selectedCount:s,notSelectedCount:i}=this.getSelectedCounts(t,e);return s===0&&i===0?!1:s>0&&i>0?null:s>0}hasNodesToSelect(t=!1,e=!1){return this.getNodesToSelect(t,e).filter(s=>s.selectable).length>0}getNodesToSelect(t=!1,e=!1){if(this.rowModel.getType()!=="clientSide")throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`);const s=[];if(e)return this.paginationProxy.forEachNodeOnPage(o=>{if(!o.group){s.push(o);return}if(!o.expanded){const r=n=>{var l;s.push(n),(l=n.childrenAfterFilter)!=null&&l.length&&n.childrenAfterFilter.forEach(r)};r(o);return}this.groupSelectsChildren||s.push(o)}),s;const i=this.rowModel;return t?(i.forEachNodeAfterFilter(o=>{s.push(o)}),s):(i.forEachNode(o=>{s.push(o)}),s)}selectAllRowNodes(t){if(this.rowModel.getType()!=="clientSide")throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`);const{source:e,justFiltered:s,justCurrentPage:i}=t,o=n=>n.selectThisNode(!0,void 0,e);this.getNodesToSelect(s,i).forEach(o),this.rowModel.getType()==="clientSide"&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(e);const r={type:p.EVENT_SELECTION_CHANGED,source:e};this.eventService.dispatchEvent(r)}getSelectionState(){const t=[];return this.selectedNodes.forEach(e=>{e!=null&&e.id&&t.push(e.id)}),t.length?t:null}setSelectionState(t,e){if(!Array.isArray(t))return;const s=new Set(t),i=[];this.rowModel.forEachNode(o=>{s.has(o.id)&&i.push(o)}),this.setNodesSelected({newValue:!0,nodes:i,source:e})}};u([f("rowModel")],ri.prototype,"rowModel",2),u([f("paginationProxy")],ri.prototype,"paginationProxy",2),u([M],ri.prototype,"init",1),ri=u([O("selectionService")],ri);var zi=class{constructor(t){this.viaApi=(e,...s)=>(H(`Since v31, 'columnApi.${e}' is deprecated and moved to 'api.${e}'.`),this.api[e](...s)),this.api=t}sizeColumnsToFit(t){this.viaApi("sizeColumnsToFit",t)}setColumnGroupOpened(t,e){this.viaApi("setColumnGroupOpened",t,e)}getColumnGroup(t,e){return this.viaApi("getColumnGroup",t,e)}getProvidedColumnGroup(t){return this.viaApi("getProvidedColumnGroup",t)}getDisplayNameForColumn(t,e){return this.viaApi("getDisplayNameForColumn",t,e)}getDisplayNameForColumnGroup(t,e){return this.viaApi("getDisplayNameForColumnGroup",t,e)}getColumn(t){return this.viaApi("getColumn",t)}getColumns(){return this.viaApi("getColumns")}applyColumnState(t){return this.viaApi("applyColumnState",t)}getColumnState(){return this.viaApi("getColumnState")}resetColumnState(){this.viaApi("resetColumnState")}getColumnGroupState(){return this.viaApi("getColumnGroupState")}setColumnGroupState(t){this.viaApi("setColumnGroupState",t)}resetColumnGroupState(){this.viaApi("resetColumnGroupState")}isPinning(){return this.viaApi("isPinning")}isPinningLeft(){return this.viaApi("isPinningLeft")}isPinningRight(){return this.viaApi("isPinningRight")}getDisplayedColAfter(t){return this.viaApi("getDisplayedColAfter",t)}getDisplayedColBefore(t){return this.viaApi("getDisplayedColBefore",t)}setColumnVisible(t,e){this.viaApi("setColumnVisible",t,e)}setColumnsVisible(t,e){this.viaApi("setColumnsVisible",t,e)}setColumnPinned(t,e){this.viaApi("setColumnPinned",t,e)}setColumnsPinned(t,e){this.viaApi("setColumnsPinned",t,e)}getAllGridColumns(){return this.viaApi("getAllGridColumns")}getDisplayedLeftColumns(){return this.viaApi("getDisplayedLeftColumns")}getDisplayedCenterColumns(){return this.viaApi("getDisplayedCenterColumns")}getDisplayedRightColumns(){return this.viaApi("getDisplayedRightColumns")}getAllDisplayedColumns(){return this.viaApi("getAllDisplayedColumns")}getAllDisplayedVirtualColumns(){return this.viaApi("getAllDisplayedVirtualColumns")}moveColumn(t,e){this.viaApi("moveColumn",t,e)}moveColumnByIndex(t,e){this.viaApi("moveColumnByIndex",t,e)}moveColumns(t,e){this.viaApi("moveColumns",t,e)}moveRowGroupColumn(t,e){this.viaApi("moveRowGroupColumn",t,e)}setColumnAggFunc(t,e){this.viaApi("setColumnAggFunc",t,e)}setColumnWidth(t,e,s=!0,i){this.viaApi("setColumnWidth",t,e,s,i)}setColumnWidths(t,e=!0,s){this.viaApi("setColumnWidths",t,e,s)}setPivotMode(t){this.viaApi("setPivotMode",t)}isPivotMode(){return this.viaApi("isPivotMode")}getPivotResultColumn(t,e){return this.viaApi("getPivotResultColumn",t,e)}setValueColumns(t){this.viaApi("setValueColumns",t)}getValueColumns(){return this.viaApi("getValueColumns")}removeValueColumn(t){this.viaApi("removeValueColumn",t)}removeValueColumns(t){this.viaApi("removeValueColumns",t)}addValueColumn(t){this.viaApi("addValueColumn",t)}addValueColumns(t){this.viaApi("addValueColumns",t)}setRowGroupColumns(t){this.viaApi("setRowGroupColumns",t)}removeRowGroupColumn(t){this.viaApi("removeRowGroupColumn",t)}removeRowGroupColumns(t){this.viaApi("removeRowGroupColumns",t)}addRowGroupColumn(t){this.viaApi("addRowGroupColumn",t)}addRowGroupColumns(t){this.viaApi("addRowGroupColumns",t)}getRowGroupColumns(){return this.viaApi("getRowGroupColumns")}setPivotColumns(t){this.viaApi("setPivotColumns",t)}removePivotColumn(t){this.viaApi("removePivotColumn",t)}removePivotColumns(t){this.viaApi("removePivotColumns",t)}addPivotColumn(t){this.viaApi("addPivotColumn",t)}addPivotColumns(t){this.viaApi("addPivotColumns",t)}getPivotColumns(){return this.viaApi("getPivotColumns")}getLeftDisplayedColumnGroups(){return this.viaApi("getLeftDisplayedColumnGroups")}getCenterDisplayedColumnGroups(){return this.viaApi("getCenterDisplayedColumnGroups")}getRightDisplayedColumnGroups(){return this.viaApi("getRightDisplayedColumnGroups")}getAllDisplayedColumnGroups(){return this.viaApi("getAllDisplayedColumnGroups")}autoSizeColumn(t,e){return this.viaApi("autoSizeColumn",t,e)}autoSizeColumns(t,e){this.viaApi("autoSizeColumns",t,e)}autoSizeAllColumns(t){this.viaApi("autoSizeAllColumns",t)}setPivotResultColumns(t){this.viaApi("setPivotResultColumns",t)}getPivotResultColumns(){return this.viaApi("getPivotResultColumns")}};u([f("gridApi")],zi.prototype,"api",2),zi=u([O("columnApi")],zi);var Ps=class extends L{constructor(){super(...arguments),this.initialised=!1,this.isSsrm=!1}init(){this.isSsrm=this.gos.isRowModelType("serverSide"),this.cellExpressions=this.gos.get("enableCellExpressions"),this.isTreeData=this.gos.get("treeData"),this.initialised=!0;const t=s=>this.callColumnCellValueChangedHandler(s),e=this.gos.useAsyncEvents();this.eventService.addEventListener(p.EVENT_CELL_VALUE_CHANGED,t,e),this.addDestroyFunc(()=>this.eventService.removeEventListener(p.EVENT_CELL_VALUE_CHANGED,t,e)),this.addManagedPropertyListener("treeData",s=>this.isTreeData=s.currentValue)}getValue(t,e,s=!1,i=!1){if(this.initialised||this.init(),!e)return;const o=t.getColDef(),r=o.field,n=t.getColId(),l=e.data;let a;const d=e.groupData&&e.groupData[n]!==void 0,h=!i&&e.aggData&&e.aggData[n]!==void 0,c=this.isSsrm&&i&&!!t.getColDef().aggFunc,m=this.isSsrm&&e.footer&&e.field&&(t.getColDef().showRowGroup===!0||t.getColDef().showRowGroup===e.field);if(s&&o.filterValueGetter?a=this.executeFilterValueGetter(o.filterValueGetter,l,t,e):this.isTreeData&&h?a=e.aggData[n]:this.isTreeData&&o.valueGetter?a=this.executeValueGetter(o.valueGetter,l,t,e):this.isTreeData&&r&&l?a=Si(l,r,t.isFieldContainsDots()):d?a=e.groupData[n]:h?a=e.aggData[n]:o.valueGetter?a=this.executeValueGetter(o.valueGetter,l,t,e):m?a=Si(l,e.field,t.isFieldContainsDots()):r&&l&&!c&&(a=Si(l,r,t.isFieldContainsDots())),this.cellExpressions&&typeof a=="string"&&a.indexOf("=")===0){const C=a.substring(1);a=this.executeValueGetter(C,l,t,e)}if(a==null){const C=this.getOpenedGroup(e,t);if(C!=null)return C}return a}parseValue(t,e,s,i){const o=t.getColDef(),r=this.gos.addGridCommonParams({node:e,data:e==null?void 0:e.data,oldValue:i,newValue:s,colDef:o,column:t}),n=o.valueParser;return P(n)?typeof n=="function"?n(r):this.expressionService.evaluate(n,r):s}formatValue(t,e,s,i,o=!0){let r=null,n;const l=t.getColDef();if(i?n=i:o&&(n=l.valueFormatter),n){const a=this.gos.addGridCommonParams({value:s,node:e,data:e?e.data:null,colDef:l,column:t});typeof n=="function"?r=n(a):r=this.expressionService.evaluate(n,a)}else if(l.refData)return l.refData[s]||"";return r==null&&Array.isArray(s)&&(r=s.join(", ")),r}getOpenedGroup(t,e){if(!this.gos.get("showOpenedGroup")||!e.getColDef().showRowGroup)return;const i=e.getColDef().showRowGroup;let o=t.parent;for(;o!=null;){if(o.rowGroupColumn&&(i===!0||i===o.rowGroupColumn.getColId()))return o.key;o=o.parent}}setValue(t,e,s,i){const o=this.columnModel.getPrimaryColumn(e);if(!t||!o)return!1;z(t.data)&&(t.data={});const{field:r,valueSetter:n}=o.getColDef();if(z(r)&&z(n))return console.warn("AG Grid: you need either field or valueSetter set on colDef for editing to work"),!1;if(!this.dataTypeService.checkType(o,s))return console.warn("AG Grid: Data type of the new value does not match the cell data type of the column"),!1;const l=this.gos.addGridCommonParams({node:t,data:t.data,oldValue:this.getValue(o,t),newValue:s,colDef:o.getColDef(),column:o});l.newValue=s;let a;if(P(n)?typeof n=="function"?a=n(l):a=this.expressionService.evaluate(n,l):a=this.setValueUsingField(t.data,r,s,o.isFieldContainsDots()),a===void 0&&(a=!0),!a)return!1;t.resetQuickFilterAggregateText(),this.valueCache.onDataChanged(),l.newValue=this.getValue(o,t);const d={type:p.EVENT_CELL_VALUE_CHANGED,event:null,rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:l.column,api:l.api,columnApi:l.columnApi,colDef:l.colDef,context:l.context,data:t.data,node:t,oldValue:l.oldValue,newValue:l.newValue,value:l.newValue,source:i};return this.eventService.dispatchEvent(d),!0}callColumnCellValueChangedHandler(t){const e=t.colDef.onCellValueChanged;typeof e=="function"&&this.getFrameworkOverrides().wrapOutgoing(()=>{e({node:t.node,data:t.data,oldValue:t.oldValue,newValue:t.newValue,colDef:t.colDef,column:t.column,api:t.api,columnApi:t.columnApi,context:t.context})})}setValueUsingField(t,e,s,i){if(!e)return!1;let o=!1;if(!i)o=t[e]===s,o||(t[e]=s);else{const r=e.split(".");let n=t;for(;r.length>0&&n;){const l=r.shift();r.length===0?(o=n[l]===s,o||(n[l]=s)):n=n[l]}}return!o}executeFilterValueGetter(t,e,s,i){const o=this.gos.addGridCommonParams({data:e,node:i,column:s,colDef:s.getColDef(),getValue:this.getValueCallback.bind(this,i)});return typeof t=="function"?t(o):this.expressionService.evaluate(t,o)}executeValueGetter(t,e,s,i){const o=s.getColId(),r=this.valueCache.getValue(i,o);if(r!==void 0)return r;const n=this.gos.addGridCommonParams({data:e,node:i,column:s,colDef:s.getColDef(),getValue:this.getValueCallback.bind(this,i)});let l;return typeof t=="function"?l=t(n):l=this.expressionService.evaluate(t,n),this.valueCache.setValue(i,o,l),l}getValueCallback(t,e){const s=this.columnModel.getPrimaryColumn(e);return s?this.getValue(s,t):null}getKeyForNode(t,e){const s=this.getValue(t,e),i=t.getColDef().keyCreator;let o=s;if(i){const r=this.gos.addGridCommonParams({value:s,colDef:t.getColDef(),column:t,node:e,data:e.data});o=i(r)}return typeof o=="string"||o==null||(o=String(o),o==="[object Object]"&&H("a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (se AG Grid docs) or b) to toString() on the object to return a key")),o}};u([f("expressionService")],Ps.prototype,"expressionService",2),u([f("columnModel")],Ps.prototype,"columnModel",2),u([f("valueCache")],Ps.prototype,"valueCache",2),u([f("dataTypeService")],Ps.prototype,"dataTypeService",2),u([M],Ps.prototype,"init",1),Ps=u([O("valueService")],Ps);var Cn=class extends L{constructor(){super(...arguments),this.expressionToFunctionCache={}}setBeans(t){this.logger=t.create("ExpressionService")}evaluate(t,e){if(typeof t=="string")return this.evaluateExpression(t,e);console.error("AG Grid: value should be either a string or a function",t)}evaluateExpression(t,e){try{return this.createExpressionFunction(t)(e.value,e.context,e.oldValue,e.newValue,e.value,e.node,e.data,e.colDef,e.rowIndex,e.api,e.columnApi,e.getValue,e.column,e.columnGroup)}catch(s){return console.log("Processing of the expression failed"),console.log("Expression = "+t),console.log("Params =",e),console.log("Exception = "+s),null}}createExpressionFunction(t){if(this.expressionToFunctionCache[t])return this.expressionToFunctionCache[t];const e=this.createFunctionBody(t),s=new Function("x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, columnApi, getValue, column, columnGroup",e);return this.expressionToFunctionCache[t]=s,s}createFunctionBody(t){return t.indexOf("return")>=0?t:"return "+t+";"}};u([xt(0,Tt("loggerFactory"))],Cn.prototype,"setBeans",1),Cn=u([O("expressionService")],Cn);var vn=class extends L{setBeans(t){this.logging=t.get("debug")}create(t){return new ca(t,this.isLogging.bind(this))}isLogging(){return this.logging}};u([xt(0,Tt("gridOptionsService"))],vn.prototype,"setBeans",1),vn=u([O("loggerFactory")],vn);var ca=class{constructor(t,e){this.name=t,this.isLoggingFunc=e}isLogging(){return this.isLoggingFunc()}log(t){this.isLoggingFunc()&&console.log("AG Grid."+this.name+": "+t)}},Fs=class extends L{setComp(t,e,s){this.view=t,this.eGridHostDiv=e,this.eGui=s,this.eGui.setAttribute("grid-id",this.context.getGridId()),this.dragAndDropService.addDropTarget({getContainer:()=>this.eGui,isInterestedIn:o=>o===1||o===0,getIconName:()=>j.ICON_NOT_ALLOWED}),this.mouseEventService.stampTopLevelGridCompWithGridInstance(e),this.createManagedBean(new en(this.view)),this.addRtlSupport();const i=this.resizeObserverService.observeResize(this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc(()=>i()),this.ctrlsService.register("gridCtrl",this)}isDetailGrid(){var t;const e=this.focusService.findTabbableParent(this.getGui());return((t=e==null?void 0:e.getAttribute("row-id"))==null?void 0:t.startsWith("detail"))||!1}showDropZones(){return ne.__isRegistered("@ag-grid-enterprise/row-grouping",this.context.getGridId())}showSideBar(){return ne.__isRegistered("@ag-grid-enterprise/side-bar",this.context.getGridId())}showStatusBar(){return ne.__isRegistered("@ag-grid-enterprise/status-bar",this.context.getGridId())}showWatermark(){return ne.__isRegistered("@ag-grid-enterprise/core",this.context.getGridId())}onGridSizeChanged(){const t={type:p.EVENT_GRID_SIZE_CHANGED,clientWidth:this.eGridHostDiv.clientWidth,clientHeight:this.eGridHostDiv.clientHeight};this.eventService.dispatchEvent(t)}addRtlSupport(){const t=this.gos.get("enableRtl")?"ag-rtl":"ag-ltr";this.view.setRtlClass(t)}destroyGridUi(){this.view.destroyGridUi()}getGui(){return this.eGui}setResizeCursor(t){this.view.setCursor(t?"ew-resize":null)}disableUserSelect(t){this.view.setUserSelect(t?"none":null)}focusNextInnerContainer(t){const e=this.view.getFocusableContainers(),s=this.gos.getActiveDomElement(),o=e.findIndex(r=>r.contains(s))+(t?-1:1);return o<=0||o>=e.length?!1:this.focusService.focusInto(e[o])}focusInnerElement(t){const e=this.view.getFocusableContainers(),s=this.columnModel.getAllDisplayedColumns();if(t){if(e.length>1)return this.focusService.focusInto(ie(e),!0);const i=ie(s);if(this.focusService.focusGridView(i,!0))return!0}if(this.gos.get("headerHeight")===0||this.gos.get("suppressHeaderFocus")){if(this.focusService.focusGridView(s[0]))return!0;for(let i=1;i<e.length;i++)if(this.focusService.focusInto(e[i]))return!0;return!1}return this.focusService.focusFirstHeader()}forceFocusOutOfContainer(t=!1){this.view.forceFocusOutOfContainer(t)}};u([f("focusService")],Fs.prototype,"focusService",2),u([f("resizeObserverService")],Fs.prototype,"resizeObserverService",2),u([f("columnModel")],Fs.prototype,"columnModel",2),u([f("ctrlsService")],Fs.prototype,"ctrlsService",2),u([f("mouseEventService")],Fs.prototype,"mouseEventService",2),u([f("dragAndDropService")],Fs.prototype,"dragAndDropService",2);var jo=class extends ko{constructor(e){super(),this.eGridDiv=e}postConstruct(){this.logger=this.loggerFactory.create("GridComp");const e={destroyGridUi:()=>this.destroyBean(this),setRtlClass:i=>this.addCssClass(i),forceFocusOutOfContainer:this.forceFocusOutOfContainer.bind(this),updateLayoutClasses:this.updateLayoutClasses.bind(this),getFocusableContainers:this.getFocusableContainers.bind(this),setUserSelect:i=>{this.getGui().style.userSelect=i??"",this.getGui().style.webkitUserSelect=i??""},setCursor:i=>{this.getGui().style.cursor=i??""}};this.ctrl=this.createManagedBean(new Fs);const s=this.createTemplate();this.setTemplate(s),this.ctrl.setComp(e,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:i=>this.ctrl.focusInnerElement(i),forceFocusOutWhenTabGuardsAreEmpty:!0})}insertGridIntoDom(){const e=this.getGui();this.eGridDiv.appendChild(e),this.addDestroyFunc(()=>{this.eGridDiv.removeChild(e),this.logger.log("Grid removed from DOM")})}updateLayoutClasses(e,s){const i=this.eRootWrapperBody.classList;i.toggle("ag-layout-auto-height",s.autoHeight),i.toggle("ag-layout-normal",s.normal),i.toggle("ag-layout-print",s.print),this.addOrRemoveCssClass("ag-layout-auto-height",s.autoHeight),this.addOrRemoveCssClass("ag-layout-normal",s.normal),this.addOrRemoveCssClass("ag-layout-print",s.print)}createTemplate(){const e=this.ctrl.showDropZones()?"<ag-grid-header-drop-zones></ag-grid-header-drop-zones>":"",s=this.ctrl.showSideBar()?'<ag-side-bar ref="sideBar"></ag-side-bar>':"",i=this.ctrl.showStatusBar()?'<ag-status-bar ref="statusBar"></ag-status-bar>':"",o=this.ctrl.showWatermark()?"<ag-watermark></ag-watermark>":"";return`<div class="ag-root-wrapper" role="presentation">
281
+ ${e}
282
+ <div class="ag-root-wrapper-body" ref="rootWrapperBody" role="presentation">
283
+ <ag-grid-body ref="gridBody"></ag-grid-body>
284
+ ${s}
285
+ </div>
286
+ ${i}
287
+ <ag-pagination></ag-pagination>
288
+ ${o}
289
+ </div>`}getFocusableElement(){return this.eRootWrapperBody}getFocusableContainers(){const e=[this.gridBodyComp.getGui()];return this.sideBarComp&&e.push(this.sideBarComp.getGui()),e.filter(s=>ht(s))}};u([f("loggerFactory")],jo.prototype,"loggerFactory",2),u([I("gridBody")],jo.prototype,"gridBodyComp",2),u([I("sideBar")],jo.prototype,"sideBarComp",2),u([I("rootWrapperBody")],jo.prototype,"eRootWrapperBody",2),u([M],jo.prototype,"postConstruct",1);var ni=class extends L{progressSort(t,e,s){const i=this.getNextSortDirection(t);this.setSortForColumn(t,i,e,s)}setSortForColumn(t,e,s,i){e!=="asc"&&e!=="desc"&&(e=null);const o=this.gos.isColumnsSortingCoupledToGroup();let r=[t];if(o&&t.getColDef().showRowGroup){const a=this.columnModel.getSourceColumnsForGroupColumn(t),d=a==null?void 0:a.filter(h=>h.isSortable());d&&(r=[t,...d])}r.forEach(a=>a.setSort(e,i));const n=(s||this.gos.get("alwaysMultiSort"))&&!this.gos.get("suppressMultiSort"),l=[];if(!n){const a=this.clearSortBarTheseColumns(r,i);l.push(...a)}this.updateSortIndex(t),l.push(...r),this.dispatchSortChangedEvents(i,l)}updateSortIndex(t){const e=this.gos.isColumnsSortingCoupledToGroup(),s=this.columnModel.getGroupDisplayColumnForGroup(t.getId()),i=e&&s||t,o=this.getColumnsWithSortingOrdered();this.columnModel.getPrimaryAndSecondaryAndAutoColumns().forEach(l=>l.setSortIndex(null));const r=o.filter(l=>e&&l.getColDef().showRowGroup?!1:l!==i);(i.getSort()?[...r,i]:r).forEach((l,a)=>{l.setSortIndex(a)})}onSortChanged(t,e){this.dispatchSortChangedEvents(t,e)}isSortActive(){const e=this.columnModel.getPrimaryAndSecondaryAndAutoColumns().filter(s=>!!s.getSort());return e&&e.length>0}dispatchSortChangedEvents(t,e){const s={type:p.EVENT_SORT_CHANGED,source:t};e&&(s.columns=e),this.eventService.dispatchEvent(s)}clearSortBarTheseColumns(t,e){const s=[];return this.columnModel.getPrimaryAndSecondaryAndAutoColumns().forEach(i=>{t.includes(i)||(i.getSort()&&s.push(i),i.setSort(void 0,e))}),s}getNextSortDirection(t){let e;if(t.getColDef().sortingOrder?e=t.getColDef().sortingOrder:this.gos.get("sortingOrder")?e=this.gos.get("sortingOrder"):e=ni.DEFAULT_SORTING_ORDER,!Array.isArray(e)||e.length<=0)return console.warn(`AG Grid: sortingOrder must be an array with at least one element, currently it's ${e}`),null;const s=e.indexOf(t.getSort()),i=s<0,o=s==e.length-1;let r;return i||o?r=e[0]:r=e[s+1],ni.DEFAULT_SORTING_ORDER.indexOf(r)<0?(console.warn("AG Grid: invalid sort type "+r),null):r}getIndexedSortMap(){let t=this.columnModel.getPrimaryAndSecondaryAndAutoColumns().filter(r=>!!r.getSort());if(this.columnModel.isPivotMode()){const r=this.gos.isColumnsSortingCoupledToGroup();t=t.filter(n=>{const l=!!n.getAggFunc(),a=!n.isPrimary(),d=r?this.columnModel.getGroupDisplayColumnForGroup(n.getId()):n.getColDef().showRowGroup;return l||a||d})}const e=this.columnModel.getRowGroupColumns().filter(r=>!!r.getSort()),s={};t.forEach((r,n)=>s[r.getId()]=n),t.sort((r,n)=>{const l=r.getSortIndex(),a=n.getSortIndex();if(l!=null&&a!=null)return l-a;if(l==null&&a==null){const d=s[r.getId()],h=s[n.getId()];return d>h?1:-1}else return a==null?-1:1});const i=this.gos.isColumnsSortingCoupledToGroup()&&!!e.length;i&&(t=[...new Set(t.map(r=>{var n;return(n=this.columnModel.getGroupDisplayColumnForGroup(r.getId()))!=null?n:r}))]);const o=new Map;return t.forEach((r,n)=>o.set(r,n)),i&&e.forEach(r=>{const n=this.columnModel.getGroupDisplayColumnForGroup(r.getId());o.set(r,o.get(n))}),o}getColumnsWithSortingOrdered(){return[...this.getIndexedSortMap().entries()].sort(([t,e],[s,i])=>e-i).map(([t])=>t)}getSortModel(){return this.getColumnsWithSortingOrdered().filter(t=>t.getSort()).map(t=>({sort:t.getSort(),colId:t.getId()}))}getSortOptions(){return this.getColumnsWithSortingOrdered().filter(t=>t.getSort()).map(t=>({sort:t.getSort(),column:t}))}canColumnDisplayMixedSort(t){const e=this.gos.isColumnsSortingCoupledToGroup(),s=!!t.getColDef().showRowGroup;return e&&s}getDisplaySortForColumn(t){const e=this.columnModel.getSourceColumnsForGroupColumn(t);if(!this.canColumnDisplayMixedSort(t)||!(e!=null&&e.length))return t.getSort();const i=t.getColDef().field!=null||!!t.getColDef().valueGetter?[t,...e]:e,o=i[0].getSort();return i.every(n=>n.getSort()==o)?o:"mixed"}getDisplaySortIndexForColumn(t){return this.getIndexedSortMap().get(t)}};ni.DEFAULT_SORTING_ORDER=["asc","desc",null],u([f("columnModel")],ni.prototype,"columnModel",2),ni=u([O("sortController")],ni);var me=class extends L{static addKeyboardModeEvents(t){this.instanceCount>0||(t.addEventListener("keydown",me.toggleKeyboardMode),t.addEventListener("mousedown",me.toggleKeyboardMode))}static removeKeyboardModeEvents(t){this.instanceCount>0||(t.addEventListener("keydown",me.toggleKeyboardMode),t.addEventListener("mousedown",me.toggleKeyboardMode))}static toggleKeyboardMode(t){const e=me.keyboardModeActive,s=t.type==="keydown";s&&(t.ctrlKey||t.metaKey||t.altKey)||e!==s&&(me.keyboardModeActive=s)}static unregisterGridCompController(t){me.removeKeyboardModeEvents(t)}init(){const t=this.clearFocusedCell.bind(this);this.addManagedListener(this.eventService,p.EVENT_COLUMN_PIVOT_MODE_CHANGED,t),this.addManagedListener(this.eventService,p.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverythingChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_COLUMN_GROUP_OPENED,t),this.addManagedListener(this.eventService,p.EVENT_COLUMN_ROW_GROUP_CHANGED,t),this.registerKeyboardFocusEvents(),this.ctrlsService.whenReady(e=>{this.gridCtrl=e.gridCtrl})}registerKeyboardFocusEvents(){const t=this.gos.getDocument();me.addKeyboardModeEvents(t),me.instanceCount++,this.addDestroyFunc(()=>{me.instanceCount--,me.unregisterGridCompController(t)})}onColumnEverythingChanged(){if(!this.focusedCellPosition)return;const t=this.focusedCellPosition.column,e=this.columnModel.getGridColumn(t.getId());t!==e&&this.clearFocusedCell()}isKeyboardMode(){return me.keyboardModeActive}getFocusCellToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedCellPosition||this.isDomDataMissingInHierarchy(this.gos.getActiveDomElement(),Js.DOM_DATA_KEY_ROW_CTRL)?null:this.focusedCellPosition}getFocusHeaderToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedHeaderPosition||this.isDomDataMissingInHierarchy(this.gos.getActiveDomElement(),ln.DOM_DATA_KEY_HEADER_CTRL)?null:this.focusedHeaderPosition}isDomDataMissingInHierarchy(t,e){let s=t;for(;s;){if(this.gos.getDomData(s,e))return!1;s=s.parentNode}return!0}getFocusedCell(){return this.focusedCellPosition}shouldRestoreFocus(t){return this.isCellRestoreFocused(t)?(setTimeout(()=>{this.restoredFocusedCellPosition=null},0),!0):!1}isCellRestoreFocused(t){return this.restoredFocusedCellPosition==null?!1:this.cellPositionUtils.equals(t,this.restoredFocusedCellPosition)}setRestoreFocusedCell(t){this.getFrameworkOverrides().renderingEngine==="react"&&(this.restoredFocusedCellPosition=t)}getFocusEventParams(){const{rowIndex:t,rowPinned:e,column:s}=this.focusedCellPosition,i={rowIndex:t,rowPinned:e,column:s,isFullWidthCell:!1},o=this.rowRenderer.getRowByPosition({rowIndex:t,rowPinned:e});return o&&(i.isFullWidthCell=o.isFullWidth()),i}clearFocusedCell(){if(this.restoredFocusedCellPosition=null,this.focusedCellPosition==null)return;const t=_({type:p.EVENT_CELL_FOCUS_CLEARED},this.getFocusEventParams());this.focusedCellPosition=null,this.eventService.dispatchEvent(t)}setFocusedCell(t){const{column:e,rowIndex:s,rowPinned:i,forceBrowserFocus:o=!1,preventScrollOnBrowserFocus:r=!1}=t,n=this.columnModel.getGridColumn(e);if(!n){this.focusedCellPosition=null;return}this.focusedCellPosition=n?{rowIndex:s,rowPinned:Yt(i),column:n}:null;const l=Ee(_({type:p.EVENT_CELL_FOCUSED},this.getFocusEventParams()),{forceBrowserFocus:o,preventScrollOnBrowserFocus:r,floating:null});this.eventService.dispatchEvent(l)}isCellFocused(t){return this.focusedCellPosition==null?!1:this.cellPositionUtils.equals(t,this.focusedCellPosition)}isRowNodeFocused(t){return this.isRowFocused(t.rowIndex,t.rowPinned)}isHeaderWrapperFocused(t){if(this.focusedHeaderPosition==null)return!1;const e=t.getColumnGroupChild(),s=t.getRowIndex(),i=t.getPinned(),{column:o,headerRowIndex:r}=this.focusedHeaderPosition;return e===o&&s===r&&i==o.getPinned()}clearFocusedHeader(){this.focusedHeaderPosition=null}getFocusedHeader(){return this.focusedHeaderPosition}setFocusedHeader(t,e){this.focusedHeaderPosition={headerRowIndex:t,column:e}}focusHeaderPosition(t){if(this.gos.get("suppressHeaderFocus"))return!1;const{direction:e,fromTab:s,allowUserOverride:i,event:o,fromCell:r,rowWithoutSpanValue:n}=t;let{headerPosition:l}=t;if(r&&this.filterManager.isAdvancedFilterHeaderActive())return this.focusAdvancedFilter(l);if(i){const a=this.getFocusedHeader(),d=this.headerNavigationService.getHeaderRowCount();if(s){const h=this.gos.getCallback("tabToNextHeader");h&&(l=this.getHeaderPositionFromUserFunc({userFunc:h,direction:e,currentPosition:a,headerPosition:l,headerRowCount:d}))}else{const h=this.gos.getCallback("navigateToNextHeader");if(h&&o){const c={key:o.key,previousHeaderPosition:a,nextHeaderPosition:l,headerRowCount:d,event:o};l=h(c)}}}return l?this.focusProvidedHeaderPosition({headerPosition:l,direction:e,event:o,fromCell:r,rowWithoutSpanValue:n}):!1}focusHeaderPositionFromUserFunc(t){if(this.gos.get("suppressHeaderFocus"))return!1;const{userFunc:e,headerPosition:s,direction:i,event:o}=t,r=this.getFocusedHeader(),n=this.headerNavigationService.getHeaderRowCount(),l=this.getHeaderPositionFromUserFunc({userFunc:e,direction:i,currentPosition:r,headerPosition:s,headerRowCount:n});return!!l&&this.focusProvidedHeaderPosition({headerPosition:l,direction:i,event:o})}getHeaderPositionFromUserFunc(t){const{userFunc:e,direction:s,currentPosition:i,headerPosition:o,headerRowCount:r}=t,l=e({backwards:s==="Before",previousHeaderPosition:i,nextHeaderPosition:o,headerRowCount:r});return l===!0||l===null?(l===null&&H("Returning `null` from tabToNextHeader is deprecated. Return `true` to stay on the current header, or `false` to let the browser handle the tab behaviour."),i):l===!1?null:l}focusProvidedHeaderPosition(t){const{headerPosition:e,direction:s,fromCell:i,rowWithoutSpanValue:o,event:r}=t;if(e.headerRowIndex===-1)return this.filterManager.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(e):this.focusGridView(e.column);this.headerNavigationService.scrollToColumn(e.column,s);const l=this.ctrlsService.getHeaderRowContainerCtrl(e.column.getPinned()).focusHeader(e.headerRowIndex,e.column,r);return l&&(o!=null||i)&&this.headerNavigationService.setCurrentHeaderRowWithoutSpan(o??-1),l}focusFirstHeader(){let t=this.columnModel.getAllDisplayedColumns()[0];if(!t)return!1;t.getParent()&&(t=this.columnModel.getColumnGroupAtLevel(t,0));const e=this.headerPositionUtils.getHeaderIndexToFocus(t,0);return this.focusHeaderPosition({headerPosition:e,rowWithoutSpanValue:0})}focusLastHeader(t){const e=this.headerNavigationService.getHeaderRowCount()-1,s=ie(this.columnModel.getAllDisplayedColumns());return this.focusHeaderPosition({headerPosition:{headerRowIndex:e,column:s},rowWithoutSpanValue:-1,event:t})}focusPreviousFromFirstCell(t){return this.filterManager.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(null):this.focusLastHeader(t)}isAnyCellFocused(){return!!this.focusedCellPosition}isRowFocused(t,e){return this.focusedCellPosition==null?!1:this.focusedCellPosition.rowIndex===t&&this.focusedCellPosition.rowPinned===Yt(e)}findFocusableElements(t,e,s=!1){const i=yu;let o=bl;e&&(o+=", "+e),s&&(o+=', [tabindex="-1"]');const r=Array.prototype.slice.apply(t.querySelectorAll(i)).filter(a=>ht(a)),n=Array.prototype.slice.apply(t.querySelectorAll(o));return n.length?((a,d)=>a.filter(h=>d.indexOf(h)===-1))(r,n):r}focusInto(t,e=!1,s=!1){const i=this.findFocusableElements(t,null,s),o=e?ie(i):i[0];return o?(o.focus({preventScroll:!0}),!0):!1}findFocusableElementBeforeTabGuard(t,e){if(!e)return null;const s=this.findFocusableElements(t),i=s.indexOf(e);if(i===-1)return null;let o=-1;for(let r=i-1;r>=0;r--)if(s[r].classList.contains("ag-tab-guard-top")){o=r;break}return o<=0?null:s[o-1]}findNextFocusableElement(t=this.eGridDiv,e,s){const i=this.findFocusableElements(t,e?':not([tabindex="-1"])':null),o=this.gos.getActiveDomElement();let r;e?r=i.findIndex(l=>l.contains(o)):r=i.indexOf(o);const n=r+(s?-1:1);return n<0||n>=i.length?null:i[n]}isTargetUnderManagedComponent(t,e){if(!e)return!1;const s=t.querySelectorAll(`.${ws.FOCUS_MANAGED_CLASS}`);if(!s.length)return!1;for(let i=0;i<s.length;i++)if(s[i].contains(e))return!0;return!1}findTabbableParent(t,e=5){let s=0;for(;t&&_r(t)===null&&++s<=e;)t=t.parentElement;return _r(t)===null?null:t}focusGridView(t,e){var s;if(this.gos.get("suppressCellFocus"))return e?this.gos.get("suppressHeaderFocus")?this.focusNextGridCoreContainer(!0,!0):this.focusLastHeader():this.focusNextGridCoreContainer(!1);const i=e?this.rowPositionUtils.getLastRow():this.rowPositionUtils.getFirstRow();if(!i)return!1;const{rowIndex:o,rowPinned:r}=i,n=this.getFocusedHeader();return!t&&n&&(t=n.column),o==null||!t?!1:(this.navigationService.ensureCellVisible({rowIndex:o,column:t,rowPinned:r}),this.setFocusedCell({rowIndex:o,column:t,rowPinned:Yt(r),forceBrowserFocus:!0}),(s=this.rangeService)==null||s.setRangeToCell({rowIndex:o,rowPinned:r,column:t}),!0)}focusNextGridCoreContainer(t,e=!1){return!e&&this.gridCtrl.focusNextInnerContainer(t)?!0:((e||!t&&!this.gridCtrl.isDetailGrid())&&this.gridCtrl.forceFocusOutOfContainer(t),!1)}focusAdvancedFilter(t){var e,s;return this.advancedFilterFocusColumn=t==null?void 0:t.column,(s=(e=this.advancedFilterService)==null?void 0:e.getCtrl().focusHeaderComp())!=null?s:!1}focusNextFromAdvancedFilter(t,e){var s,i;const o=(i=e?void 0:this.advancedFilterFocusColumn)!=null?i:(s=this.columnModel.getAllDisplayedColumns())==null?void 0:s[0];return t?this.focusHeaderPosition({headerPosition:{column:o,headerRowIndex:this.headerNavigationService.getHeaderRowCount()-1}}):this.focusGridView(o)}clearAdvancedFilterColumn(){this.advancedFilterFocusColumn=void 0}};me.keyboardModeActive=!1,me.instanceCount=0,u([f("eGridDiv")],me.prototype,"eGridDiv",2),u([f("columnModel")],me.prototype,"columnModel",2),u([f("headerNavigationService")],me.prototype,"headerNavigationService",2),u([f("headerPositionUtils")],me.prototype,"headerPositionUtils",2),u([f("rowRenderer")],me.prototype,"rowRenderer",2),u([f("rowPositionUtils")],me.prototype,"rowPositionUtils",2),u([f("cellPositionUtils")],me.prototype,"cellPositionUtils",2),u([f("navigationService")],me.prototype,"navigationService",2),u([f("ctrlsService")],me.prototype,"ctrlsService",2),u([f("filterManager")],me.prototype,"filterManager",2),u([he("rangeService")],me.prototype,"rangeService",2),u([he("advancedFilterService")],me.prototype,"advancedFilterService",2),u([M],me.prototype,"init",1),me=u([O("focusService")],me);var pa=class extends L{setMouseOver(t){this.selectedColumns=t;const e={type:p.EVENT_COLUMN_HOVER_CHANGED};this.eventService.dispatchEvent(e)}clearMouseOver(){this.selectedColumns=null;const t={type:p.EVENT_COLUMN_HOVER_CHANGED};this.eventService.dispatchEvent(t)}isHovered(t){return!!this.selectedColumns&&this.selectedColumns.indexOf(t)>=0}};pa=u([O("columnHoverService")],pa);var qo=class extends L{constructor(){super(...arguments),this.executeNextFuncs=[],this.executeLaterFuncs=[],this.active=!1,this.suppressAnimation=!1,this.animationThreadCount=0}postConstruct(){this.ctrlsService.whenReady(t=>this.gridBodyCtrl=t.gridBodyCtrl)}isActive(){return this.active&&!this.suppressAnimation}setSuppressAnimation(t){this.suppressAnimation=t}start(){this.active||this.gos.get("suppressColumnMoveAnimation")||this.gos.get("enableRtl")||(this.ensureAnimationCssClassPresent(),this.active=!0)}finish(){this.active&&this.flush(()=>{this.active=!1})}executeNextVMTurn(t){this.active?this.executeNextFuncs.push(t):t()}executeLaterVMTurn(t){this.active?this.executeLaterFuncs.push(t):t()}ensureAnimationCssClassPresent(){this.animationThreadCount++;const t=this.animationThreadCount;this.gridBodyCtrl.setColumnMovingCss(!0),this.executeLaterFuncs.push(()=>{this.animationThreadCount===t&&this.gridBodyCtrl.setColumnMovingCss(!1)})}flush(t){if(this.executeNextFuncs.length===0&&this.executeLaterFuncs.length===0){t();return}const e=s=>{for(;s.length;){const i=s.pop();i&&i()}};this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>e(this.executeNextFuncs),0),window.setTimeout(()=>{t(),e(this.executeLaterFuncs)},200)})}};u([f("ctrlsService")],qo.prototype,"ctrlsService",2),u([M],qo.prototype,"postConstruct",1),qo=u([O("columnAnimationService")],qo);var Ki=class extends L{postConstruct(){this.ctrlsService.whenReady(t=>{this.centerRowsCtrl=t.center,this.addManagedListener(this.eventService,p.EVENT_BODY_HEIGHT_CHANGED,this.checkPageSize.bind(this)),this.addManagedListener(this.eventService,p.EVENT_SCROLL_VISIBILITY_CHANGED,this.checkPageSize.bind(this)),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||this.centerRowsCtrl==null}onPaginationAutoSizeChanged(){this.notActive()?this.paginationProxy.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const t=this.centerRowsCtrl.getViewportSizeFeature().getBodyHeight();if(t>0){const e=()=>{const s=this.gos.getRowHeightAsNumber(),i=Math.floor(t/s);this.paginationProxy.setPageSize(i,"autoCalculated")};this.isBodyRendered?et(()=>e(),50)():(e(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}};u([f("ctrlsService")],Ki.prototype,"ctrlsService",2),u([f("paginationProxy")],Ki.prototype,"paginationProxy",2),u([M],Ki.prototype,"postConstruct",1),Ki=u([O("paginationAutoPageSizeService")],Ki);var wn=class extends L{constructor(){super(...arguments),this.cacheVersion=0}init(){this.active=this.gos.get("valueCache"),this.neverExpires=this.gos.get("valueCacheNeverExpires")}onDataChanged(){this.neverExpires||this.expire()}expire(){this.cacheVersion++}setValue(t,e,s){this.active&&(t.__cacheVersion!==this.cacheVersion&&(t.__cacheVersion=this.cacheVersion,t.__cacheData={}),t.__cacheData[e]=s)}getValue(t,e){if(!(!this.active||t.__cacheVersion!==this.cacheVersion))return t.__cacheData[e]}};u([M],wn.prototype,"init",1),wn=u([O("valueCache")],wn);var Mm="paste",Yi=class extends L{init(){this.rowModel.getType()==="clientSide"&&(this.clientSideRowModel=this.rowModel),this.addManagedListener(this.eventService,p.EVENT_CELL_VALUE_CHANGED,this.onCellValueChanged.bind(this))}onCellValueChanged(t){t.source!==Mm&&this.doChangeDetection(t.node,t.column)}doChangeDetection(t,e){if(this.gos.get("suppressChangeDetection"))return;const s=[t];if(this.clientSideRowModel&&!t.isRowPinned()){const i=this.gos.get("aggregateOnlyChangedColumns"),o=new cn(i,this.clientSideRowModel.getRootNode());o.addParentNode(t.parent,[e]),this.clientSideRowModel.doAggregate(o),o.forEachChangedNodeDepthFirst(r=>{s.push(r)})}this.rowRenderer.refreshCells({rowNodes:s})}};u([f("rowModel")],Yi.prototype,"rowModel",2),u([f("rowRenderer")],Yi.prototype,"rowRenderer",2),u([M],Yi.prototype,"init",1),Yi=u([O("changeDetectionService")],Yi);var Sn=class extends L{adaptFunction(t,e){const s=this.componentMetadataProvider.retrieve(t);return s&&s.functionAdapter?s.functionAdapter(e):null}adaptCellRendererFunction(t){class e{refresh(i){return!1}getGui(){return this.eGui}init(i){const o=t(i),r=typeof o;if(r==="string"||r==="number"||r==="boolean"){this.eGui=ct("<span>"+o+"</span>");return}if(o==null){this.eGui=ct("<span></span>");return}this.eGui=o}}return e}doesImplementIComponent(t){return t?t.prototype&&"getGui"in t.prototype:!1}};u([f("componentMetadataProvider")],Sn.prototype,"componentMetadataProvider",2),Sn=u([O("agComponentUtils")],Sn);var Qo=class extends L{postConstruct(){this.componentMetaData={dateComponent:{mandatoryMethodList:["getDate","setDate"],optionalMethodList:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","onParamsUpdated","refresh"]},detailCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},headerComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},headerGroupComponent:{mandatoryMethodList:[],optionalMethodList:[]},loadingCellRenderer:{mandatoryMethodList:[],optionalMethodList:[],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},loadingOverlayComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},noRowsOverlayComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},floatingFilterComponent:{mandatoryMethodList:["onParentModelChanged"],optionalMethodList:["afterGuiAttached","onParamsUpdated","refresh"]},cellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},cellEditor:{mandatoryMethodList:["getValue"],optionalMethodList:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},innerRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},fullWidthCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},groupRowRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},filter:{mandatoryMethodList:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethodList:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},statusPanel:{mandatoryMethodList:[],optionalMethodList:["refresh"]},toolPanel:{mandatoryMethodList:[],optionalMethodList:["refresh","getState"]},tooltipComponent:{mandatoryMethodList:[],optionalMethodList:[]},menuItem:{mandatoryMethodList:[],optionalMethodList:["setActive","select","setExpanded","configureDefaults"]}}}retrieve(t){return this.componentMetaData[t]}};u([f("agComponentUtils")],Qo.prototype,"agComponentUtils",2),u([M],Qo.prototype,"postConstruct",1),Qo=u([O("componentMetadataProvider")],Qo);var Im=25,xh=10,ga=8,Nm=4,fa=4,ma=6,xm=16,Gh=14,Ca=8,Gm={"ag-theme-custom":{headerHeight:25,headerCellMinWidth:24,listItemHeight:Nm*5,rowHeight:25,chartMenuPanelWidth:220},"ag-theme-material":{headerHeight:ga*7,headerCellMinWidth:48,listItemHeight:ga*4,rowHeight:ga*6,chartMenuPanelWidth:240},"ag-theme-balham":{headerHeight:fa*8,headerCellMinWidth:24,listItemHeight:fa*6,rowHeight:fa*7,chartMenuPanelWidth:220},"ag-theme-alpine":{headerHeight:ma*8,headerCellMinWidth:36,listItemHeight:ma*4,rowHeight:ma*7,chartMenuPanelWidth:240},"ag-theme-quartz":{headerHeight:Gh+Ca*4.25,headerCellMinWidth:36,listItemHeight:xm+Ca,rowHeight:Gh+Ca*3.5,chartMenuPanelWidth:260}},Oh={headerHeight:["ag-header-row"],headerCellMinWidth:["ag-header-cell"],listItemHeight:["ag-virtual-list-item"],rowHeight:["ag-row"],chartMenuPanelWidth:["ag-chart-docked-container"]},Xo=class extends L{constructor(){super(...arguments),this.calculatedSizes={},this.calculatedTheme=null}postConstruct(){var t;const e=(t=this.getTheme().el)!=null?t:this.eGridDiv;this.addManagedPropertyListener("rowHeight",()=>this.refreshRowHeightVariable()),this.mutationObserver=new MutationObserver(()=>{this.calculatedSizes={},this.calculatedTheme=null,this.calculatedTheme=this.getTheme(),this.fireGridStylesChangedEvent()}),this.mutationObserver.observe(e||this.eGridDiv,{attributes:!0,attributeFilter:["class"]})}fireGridStylesChangedEvent(){const t={type:p.EVENT_GRID_STYLES_CHANGED};this.eventService.dispatchEvent(t)}getSassVariable(t){const{themeFamily:e,el:s}=this.getTheme();if(!e||e.indexOf("ag-theme")!==0)return;this.calculatedSizes||(this.calculatedSizes={}),this.calculatedSizes[e]||(this.calculatedSizes[e]={});const i=this.calculatedSizes[e][t];return i??(this.calculatedSizes[e][t]=this.calculateValueForSassProperty(t,e,s),this.calculatedSizes[e][t])}calculateValueForSassProperty(t,e,s){const i="ag-theme-"+(e.match("material")?"material":e.match("balham")?"balham":e.match("alpine")?"alpine":"custom"),o=Gm[i][t],r=this.gos.getDocument();if(s||(s=this.eGridDiv),!Oh[t])return o;const n=Oh[t],l=r.createElement("div"),a=Array.from(s.classList);l.classList.add(e,...a),l.style.position="absolute";const d=n.reduce((c,m)=>{const C=r.createElement("div");return C.style.position="static",C.classList.add(m),c.appendChild(C),C},l);let h=0;if(r.body){r.body.appendChild(l);const c=t.toLowerCase().indexOf("height")!==-1?"height":"width";h=parseInt(window.getComputedStyle(d)[c],10),r.body.removeChild(l)}return h||o}isThemeDark(){const{theme:t}=this.getTheme();return!!t&&t.indexOf("dark")>=0}chartMenuPanelWidth(){return this.getSassVariable("chartMenuPanelWidth")}getTheme(){if(this.calculatedTheme)return this.calculatedTheme;const t=/\bag-(material|(?:theme-([\w\-]*)))\b/g;let e=this.eGridDiv,s=null,i=[];for(;e;)if(s=t.exec(e.className),!s)e=e.parentElement||void 0;else{const r=e.className.match(t);r&&(i=r);break}if(!s)return{allThemes:i};const o=s[0];return this.calculatedTheme={theme:o,el:e,themeFamily:o.replace(/-dark$/,""),allThemes:i},this.calculatedTheme}getFromTheme(t,e){var s;return(s=this.getSassVariable(e))!=null?s:t}getDefaultRowHeight(){return this.getFromTheme(Im,"rowHeight")}getListItemHeight(){return this.getFromTheme(20,"listItemHeight")}refreshRowHeightVariable(){const t=this.eGridDiv.style.getPropertyValue("--ag-line-height").trim(),e=this.gos.get("rowHeight");if(e==null||isNaN(e)||!isFinite(e))return t!==null&&this.eGridDiv.style.setProperty("--ag-line-height",null),-1;const s=`${e}px`;return t!=s?(this.eGridDiv.style.setProperty("--ag-line-height",s),e):t!=""?parseFloat(t):-1}getMinColWidth(){const t=this.getFromTheme(null,"headerCellMinWidth");return P(t)?Math.max(t,xh):xh}destroy(){this.calculatedSizes=null,this.mutationObserver&&this.mutationObserver.disconnect(),super.destroy()}};u([f("eGridDiv")],Xo.prototype,"eGridDiv",2),u([M],Xo.prototype,"postConstruct",1),Xo=u([O("environment")],Xo);var ji=class extends L{constructor(){super(...arguments),this.scrollY=0,this.uiBodyHeight=0}agWire(t){this.logger=t.create("RowContainerHeightService")}postConstruct(){this.addManagedListener(this.eventService,p.EVENT_BODY_HEIGHT_CHANGED,this.updateOffset.bind(this)),this.maxDivHeight=pu(),this.logger.log("maxDivHeight = "+this.maxDivHeight)}isStretching(){return this.stretching}getDivStretchOffset(){return this.divStretchOffset}updateOffset(){if(!this.stretching)return;const e=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition().top,s=this.getUiBodyHeight();(e!==this.scrollY||s!==this.uiBodyHeight)&&(this.scrollY=e,this.uiBodyHeight=s,this.calculateOffset())}calculateOffset(){this.setUiContainerHeight(this.maxDivHeight),this.pixelsToShave=this.modelHeight-this.uiContainerHeight,this.maxScrollY=this.uiContainerHeight-this.uiBodyHeight;const t=this.scrollY/this.maxScrollY,e=t*this.pixelsToShave;this.logger.log(`Div Stretch Offset = ${e} (${this.pixelsToShave} * ${t})`),this.setDivStretchOffset(e)}setUiContainerHeight(t){t!==this.uiContainerHeight&&(this.uiContainerHeight=t,this.eventService.dispatchEvent({type:p.EVENT_ROW_CONTAINER_HEIGHT_CHANGED}))}clearOffset(){this.setUiContainerHeight(this.modelHeight),this.pixelsToShave=0,this.setDivStretchOffset(0)}setDivStretchOffset(t){const e=typeof t=="number"?Math.floor(t):null;this.divStretchOffset!==e&&(this.divStretchOffset=e,this.eventService.dispatchEvent({type:p.EVENT_HEIGHT_SCALE_CHANGED}))}setModelHeight(t){this.modelHeight=t,this.stretching=t!=null&&this.maxDivHeight>0&&t>this.maxDivHeight,this.stretching?this.calculateOffset():this.clearOffset()}getUiContainerHeight(){return this.uiContainerHeight}getRealPixelPosition(t){return t-this.divStretchOffset}getUiBodyHeight(){const e=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition();return e.bottom-e.top}getScrollPositionForPixel(t){if(this.pixelsToShave<=0)return t;const e=this.modelHeight-this.getUiBodyHeight(),s=t/e;return this.maxScrollY*s}};u([f("ctrlsService")],ji.prototype,"ctrlsService",2),u([xt(0,Tt("loggerFactory"))],ji.prototype,"agWire",1),u([M],ji.prototype,"postConstruct",1),ji=u([O("rowContainerHeightService")],ji);var qi=class extends L{init(){this.addManagedPropertyListener("isRowSelectable",()=>this.updateSelectable())}updateSelectableAfterGrouping(){this.updateSelectable(!0)}updateSelectable(t=!1){const e=!!this.gos.get("rowSelection"),s=this.gos.get("isRowSelectable");if(!e||!s)return;const i=this.gos.get("groupSelectsChildren"),o=this.rowModel.getType()==="clientSide"&&i,r=[],n=l=>{if(t&&!l.group)return;if(o&&l.group){const d=l.childrenAfterGroup.some(h=>h.selectable===!0);l.setRowSelectable(d,!0);return}const a=s?s(l):!0;l.setRowSelectable(a,!0),!a&&l.isSelected()&&r.push(l)};if(o){const l=this.rowModel;new cn(!1,l.getRootNode()).forEachChangedNodeDepthFirst(n,!0,!0)}else this.rowModel.forEachNode(n);r.length&&this.selectionService.setNodesSelected({nodes:r,newValue:!1,source:"selectableChanged"}),o&&this.selectionService instanceof ri&&this.selectionService.updateGroupsFromChildrenSelections("selectableChanged")}};u([f("rowModel")],qi.prototype,"rowModel",2),u([f("selectionService")],qi.prototype,"selectionService",2),u([M],qi.prototype,"init",1),qi=u([O("selectableService")],qi);var ft=class extends K{constructor(){super(),this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1}postConstruct(){const t=this.gos.get("enableRtl");this.setTemplate(this.getTemplate());const{btFirst:e,btPrevious:s,btNext:i,btLast:o,pageSizeComp:r}=this;this.activateTabIndex([e,s,i,o]),e.insertAdjacentElement("afterbegin",be(t?"last":"first",this.gos)),s.insertAdjacentElement("afterbegin",be(t?"next":"previous",this.gos)),i.insertAdjacentElement("afterbegin",be(t?"previous":"next",this.gos)),o.insertAdjacentElement("afterbegin",be(t?"first":"last",this.gos)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],()=>this.onPageSizeRelatedOptionsChange()),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.onPaginationChanged()}onPaginationChanged(){const e=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(e),e&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateRowLabels(),this.setCurrentPageLabel(),this.setTotalLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){this.areListenersSetup||(this.addManagedListener(this.eventService,p.EVENT_PAGINATION_CHANGED,this.onPaginationChanged.bind(this)),[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}].forEach(t=>{const{el:e,fn:s}=t;this.addManagedListener(e,"click",s),this.addManagedListener(e,"keydown",i=>{(i.key===E.ENTER||i.key===E.SPACE)&&(i.preventDefault(),s())})}),this.areListenersSetup=!0)}onBtFirst(){this.previousAndFirstButtonsDisabled||this.paginationProxy.goToFirstPage()}setCurrentPageLabel(){const t=this.paginationProxy.getTotalPages()>0,e=this.paginationProxy.getCurrentPage(),s=t?e+1:0;this.lbCurrent.textContent=this.formatNumber(s)}formatNumber(t){const e=this.gos.getCallback("paginationNumberFormatter");if(e)return e({value:t});const s=this.localeService.getLocaleTextFunc(),i=s("thousandSeparator",","),o=s("decimalSeparator",".");return El(t,i,o)}getTemplate(){const t=this.localeService.getLocaleTextFunc(),e=t("page","Page"),s=t("to","to"),i=t("of","of"),o=t("firstPage","First Page"),r=t("previousPage","Previous Page"),n=t("nextPage","Next Page"),l=t("lastPage","Last Page"),a=this.getCompId();return`<div class="ag-paging-panel ag-unselectable" id="ag-${a}">
290
+ <ag-page-size-selector ref="pageSizeComp"></ag-page-size-selector>
291
+ <span class="ag-paging-row-summary-panel" role="status">
292
+ <span id="ag-${a}-first-row" ref="lbFirstRowOnPage" class="ag-paging-row-summary-panel-number"></span>
293
+ <span id="ag-${a}-to">${s}</span>
294
+ <span id="ag-${a}-last-row" ref="lbLastRowOnPage" class="ag-paging-row-summary-panel-number"></span>
295
+ <span id="ag-${a}-of">${i}</span>
296
+ <span id="ag-${a}-row-count" ref="lbRecordCount" class="ag-paging-row-summary-panel-number"></span>
297
+ </span>
298
+ <span class="ag-paging-page-summary-panel" role="presentation">
299
+ <div ref="btFirst" class="ag-button ag-paging-button" role="button" aria-label="${o}"></div>
300
+ <div ref="btPrevious" class="ag-button ag-paging-button" role="button" aria-label="${r}"></div>
301
+ <span class="ag-paging-description" role="status">
302
+ <span id="ag-${a}-start-page">${e}</span>
303
+ <span id="ag-${a}-start-page-number" ref="lbCurrent" class="ag-paging-number"></span>
304
+ <span id="ag-${a}-of-page">${i}</span>
305
+ <span id="ag-${a}-of-page-number" ref="lbTotal" class="ag-paging-number"></span>
306
+ </span>
307
+ <div ref="btNext" class="ag-button ag-paging-button" role="button" aria-label="${n}"></div>
308
+ <div ref="btLast" class="ag-button ag-paging-button" role="button" aria-label="${l}"></div>
309
+ </span>
310
+ </div>`}onBtNext(){this.nextButtonDisabled||this.paginationProxy.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.paginationProxy.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.paginationProxy.goToLastPage()}enableOrDisableButtons(){const t=this.paginationProxy.getCurrentPage(),e=this.paginationProxy.isLastPageFound(),s=this.paginationProxy.getTotalPages();this.previousAndFirstButtonsDisabled=t===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const i=this.isZeroPagesToDisplay(),o=t===s-1;this.nextButtonDisabled=o||i,this.lastButtonDisabled=!e||i||t===s-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(t,e){ol(t,e),t.classList.toggle("ag-disabled",e)}updateRowLabels(){const t=this.paginationProxy.getCurrentPage(),e=this.paginationProxy.getPageSize(),s=this.paginationProxy.isLastPageFound(),i=this.paginationProxy.isLastPageFound()?this.paginationProxy.getMasterRowCount():null;let o,r;if(this.isZeroPagesToDisplay()?o=r=0:(o=e*t+1,r=o+e-1,s&&r>i&&(r=i)),this.lbFirstRowOnPage.textContent=this.formatNumber(o),this.rowNodeBlockLoader.isLoading()){const n=this.localeService.getLocaleTextFunc();this.lbLastRowOnPage.innerHTML=n("pageLastRowUnknown","?")}else this.lbLastRowOnPage.textContent=this.formatNumber(r)}isZeroPagesToDisplay(){const t=this.paginationProxy.isLastPageFound(),e=this.paginationProxy.getTotalPages();return t&&e===0}setTotalLabels(){const t=this.paginationProxy.isLastPageFound(),e=this.paginationProxy.getTotalPages(),s=t?this.paginationProxy.getMasterRowCount():null;if(s===1){const i=this.paginationProxy.getRow(0);if(i&&i.group&&!(i.groupData||i.aggData)){this.setTotalLabelsToZero();return}}if(t)this.lbTotal.textContent=this.formatNumber(e),this.lbRecordCount.textContent=this.formatNumber(s);else{const i=this.localeService.getLocaleTextFunc()("more","more");this.lbTotal.innerHTML=i,this.lbRecordCount.innerHTML=i}}setTotalLabelsToZero(){this.lbFirstRowOnPage.textContent=this.formatNumber(0),this.lbCurrent.textContent=this.formatNumber(0),this.lbLastRowOnPage.textContent=this.formatNumber(0),this.lbTotal.textContent=this.formatNumber(0),this.lbRecordCount.textContent=this.formatNumber(0)}};u([f("paginationProxy")],ft.prototype,"paginationProxy",2),u([f("rowNodeBlockLoader")],ft.prototype,"rowNodeBlockLoader",2),u([I("btFirst")],ft.prototype,"btFirst",2),u([I("btPrevious")],ft.prototype,"btPrevious",2),u([I("btNext")],ft.prototype,"btNext",2),u([I("btLast")],ft.prototype,"btLast",2),u([I("lbRecordCount")],ft.prototype,"lbRecordCount",2),u([I("lbFirstRowOnPage")],ft.prototype,"lbFirstRowOnPage",2),u([I("lbLastRowOnPage")],ft.prototype,"lbLastRowOnPage",2),u([I("lbCurrent")],ft.prototype,"lbCurrent",2),u([I("lbTotal")],ft.prototype,"lbTotal",2),u([I("pageSizeComp")],ft.prototype,"pageSizeComp",2),u([M],ft.prototype,"postConstruct",1);var Jo=class xc extends K{constructor(){super(xc.TEMPLATE),this.inProgress=!1,this.destroyRequested=!1}updateLayoutClasses(e,s){const i=this.eOverlayWrapper.classList;i.toggle("ag-layout-auto-height",s.autoHeight),i.toggle("ag-layout-normal",s.normal),i.toggle("ag-layout-print",s.print)}postConstruct(){this.createManagedBean(new en(this)),this.setDisplayed(!1,{skipAriaHidden:!0}),this.overlayService.registerOverlayWrapperComp(this)}setWrapperTypeClass(e){const s=this.eOverlayWrapper.classList;this.activeOverlayWrapperCssClass&&s.toggle(this.activeOverlayWrapperCssClass,!1),this.activeOverlayWrapperCssClass=e,s.toggle(e,!0)}showOverlay(e,s,i){this.inProgress||(this.setWrapperTypeClass(s),this.destroyActiveOverlay(),this.inProgress=!0,e&&e.then(o=>{this.inProgress=!1,this.eOverlayWrapper.appendChild(o.getGui()),this.activeOverlay=o,this.updateListenerDestroyFunc=i,this.destroyRequested&&(this.destroyRequested=!1,this.destroyActiveOverlay())}),this.setDisplayed(!0,{skipAriaHidden:!0}))}destroyActiveOverlay(){var e;if(this.inProgress){this.destroyRequested=!0;return}this.activeOverlay&&(this.activeOverlay=this.getContext().destroyBean(this.activeOverlay),(e=this.updateListenerDestroyFunc)==null||e.call(this),Le(this.eOverlayWrapper))}hideOverlay(){this.destroyActiveOverlay(),this.setDisplayed(!1,{skipAriaHidden:!0})}destroy(){this.destroyActiveOverlay(),super.destroy()}};Jo.TEMPLATE=`
311
+ <div class="ag-overlay" role="presentation">
312
+ <div class="ag-overlay-panel" role="presentation">
313
+ <div class="ag-overlay-wrapper" ref="eOverlayWrapper" role="presentation"></div>
314
+ </div>
315
+ </div>`,u([f("overlayService")],Jo.prototype,"overlayService",2),u([I("eOverlayWrapper")],Jo.prototype,"eOverlayWrapper",2),u([M],Jo.prototype,"postConstruct",1);var Om=Jo,Qi=class extends L{getFirstRow(){let t=0,e;return this.pinnedRowModel.getPinnedTopRowCount()?e="top":this.rowModel.getRowCount()?(e=null,t=this.paginationProxy.getPageFirstRow()):this.pinnedRowModel.getPinnedBottomRowCount()&&(e="bottom"),e===void 0?null:{rowIndex:t,rowPinned:e}}getLastRow(){let t,e=null;const s=this.pinnedRowModel.getPinnedBottomRowCount(),i=this.pinnedRowModel.getPinnedTopRowCount();return s?(e="bottom",t=s-1):this.rowModel.getRowCount()?(e=null,t=this.paginationProxy.getPageLastRow()):i&&(e="top",t=i-1),t===void 0?null:{rowIndex:t,rowPinned:e}}getRowNode(t){switch(t.rowPinned){case"top":return this.pinnedRowModel.getPinnedTopRowData()[t.rowIndex];case"bottom":return this.pinnedRowModel.getPinnedBottomRowData()[t.rowIndex];default:return this.rowModel.getRow(t.rowIndex)}}sameRow(t,e){return!t&&!e?!0:t&&!e||!t&&e?!1:t.rowIndex===e.rowIndex&&t.rowPinned==e.rowPinned}before(t,e){switch(t.rowPinned){case"top":if(e.rowPinned!=="top")return!0;break;case"bottom":if(e.rowPinned!=="bottom")return!1;break;default:if(P(e.rowPinned))return e.rowPinned!=="top";break}return t.rowIndex<e.rowIndex}};u([f("rowModel")],Qi.prototype,"rowModel",2),u([f("pinnedRowModel")],Qi.prototype,"pinnedRowModel",2),u([f("paginationProxy")],Qi.prototype,"paginationProxy",2),Qi=u([O("rowPositionUtils")],Qi);var va=class extends L{createId(t){const{rowIndex:e,rowPinned:s,column:i}=t;return this.createIdFromValues({rowIndex:e,column:i,rowPinned:s})}createIdFromValues(t){const{rowIndex:e,rowPinned:s,column:i}=t;return`${e}.${s??"null"}.${i.getId()}`}equals(t,e){const s=t.column===e.column,i=t.rowPinned===e.rowPinned,o=t.rowIndex===e.rowIndex;return s&&i&&o}};va=u([O("cellPositionUtils")],va);var Zo=class{constructor(t){this.cellValueChanges=t}},wa=class extends Zo{constructor(t,e,s,i){super(t),this.initialRange=e,this.finalRange=s,this.ranges=i}},_h=class Gc{constructor(e){this.actionStack=[],this.maxStackSize=e||Gc.DEFAULT_STACK_SIZE,this.actionStack=new Array(this.maxStackSize)}pop(){return this.actionStack.pop()}push(e){e.cellValueChanges&&e.cellValueChanges.length>0&&(this.actionStack.length===this.maxStackSize&&this.actionStack.shift(),this.actionStack.push(e))}clear(){this.actionStack=[]}getCurrentStackSize(){return this.actionStack.length}};_h.DEFAULT_STACK_SIZE=10;var Vh=_h,Jt=class extends L{constructor(){super(...arguments),this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.onCellValueChanged=t=>{const e={column:t.column,rowIndex:t.rowIndex,rowPinned:t.rowPinned},s=this.activeCellEdit!==null&&this.cellPositionUtils.equals(this.activeCellEdit,e),i=this.activeRowEdit!==null&&this.rowPositionUtils.sameRow(this.activeRowEdit,e);if(!(s||i||this.isPasting||this.isRangeInAction))return;const{rowPinned:r,rowIndex:n,column:l,oldValue:a,value:d}=t,h={rowPinned:r,rowIndex:n,columnId:l.getColId(),newValue:d,oldValue:a};this.cellValueChanges.push(h)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}init(){if(!this.gos.get("undoRedoCellEditing"))return;const t=this.gos.get("undoRedoCellEditingLimit");t<=0||(this.undoStack=new Vh(t),this.redoStack=new Vh(t),this.addRowEditingListeners(),this.addCellEditingListeners(),this.addPasteListeners(),this.addFillListeners(),this.addCellKeyListeners(),this.addManagedListener(this.eventService,p.EVENT_CELL_VALUE_CHANGED,this.onCellValueChanged),this.addManagedListener(this.eventService,p.EVENT_MODEL_UPDATED,e=>{e.keepUndoRedoStack||this.clearStacks()}),this.addManagedListener(this.eventService,p.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.clearStacks),this.addManagedListener(this.eventService,p.EVENT_NEW_COLUMNS_LOADED,this.clearStacks),this.addManagedListener(this.eventService,p.EVENT_COLUMN_GROUP_OPENED,this.clearStacks),this.addManagedListener(this.eventService,p.EVENT_COLUMN_ROW_GROUP_CHANGED,this.clearStacks),this.addManagedListener(this.eventService,p.EVENT_COLUMN_MOVED,this.clearStacks),this.addManagedListener(this.eventService,p.EVENT_COLUMN_PINNED,this.clearStacks),this.addManagedListener(this.eventService,p.EVENT_COLUMN_VISIBLE,this.clearStacks),this.addManagedListener(this.eventService,p.EVENT_ROW_DRAG_END,this.clearStacks),this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl}))}getCurrentUndoStackSize(){return this.undoStack?this.undoStack.getCurrentStackSize():0}getCurrentRedoStackSize(){return this.redoStack?this.redoStack.getCurrentStackSize():0}undo(t){const e={type:p.EVENT_UNDO_STARTED,source:t};this.eventService.dispatchEvent(e);const s=this.undoRedo(this.undoStack,this.redoStack,"initialRange","oldValue","undo"),i={type:p.EVENT_UNDO_ENDED,source:t,operationPerformed:s};this.eventService.dispatchEvent(i)}redo(t){const e={type:p.EVENT_REDO_STARTED,source:t};this.eventService.dispatchEvent(e);const s=this.undoRedo(this.redoStack,this.undoStack,"finalRange","newValue","redo"),i={type:p.EVENT_REDO_ENDED,source:t,operationPerformed:s};this.eventService.dispatchEvent(i)}undoRedo(t,e,s,i,o){if(!t)return!1;const r=t.pop();return!r||!r.cellValueChanges?!1:(this.processAction(r,n=>n[i],o),r instanceof wa?this.processRange(this.rangeService,r.ranges||[r[s]]):this.processCell(r.cellValueChanges),e.push(r),!0)}processAction(t,e,s){t.cellValueChanges.forEach(i=>{const{rowIndex:o,rowPinned:r,columnId:n}=i,l={rowIndex:o,rowPinned:r},a=this.rowPositionUtils.getRowNode(l);a.displayed&&a.setDataValue(n,e(i),s)})}processRange(t,e){let s;t.removeAllCellRanges(!0),e.forEach((i,o)=>{if(!i)return;const r=i.startRow,n=i.endRow;o===e.length-1&&(s={rowPinned:r.rowPinned,rowIndex:r.rowIndex,columnId:i.startColumn.getColId()},this.setLastFocusedCell(s));const l={rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,rowEndIndex:n.rowIndex,rowEndPinned:n.rowPinned,columnStart:i.startColumn,columns:i.columns};t.addCellRange(l)})}processCell(t){const e=t[0],{rowIndex:s,rowPinned:i}=e,o={rowIndex:s,rowPinned:i},r=this.rowPositionUtils.getRowNode(o),n={rowPinned:e.rowPinned,rowIndex:r.rowIndex,columnId:e.columnId};this.setLastFocusedCell(n,this.rangeService)}setLastFocusedCell(t,e){const{rowIndex:s,columnId:i,rowPinned:o}=t,r=this.gridBodyCtrl.getScrollFeature(),n=this.columnModel.getGridColumn(i);if(!n)return;r.ensureIndexVisible(s),r.ensureColumnVisible(n);const l={rowIndex:s,column:n,rowPinned:o};this.focusService.setFocusedCell(Ee(_({},l),{forceBrowserFocus:!0})),e==null||e.setRangeToCell(l)}addRowEditingListeners(){this.addManagedListener(this.eventService,p.EVENT_ROW_EDITING_STARTED,t=>{this.activeRowEdit={rowIndex:t.rowIndex,rowPinned:t.rowPinned}}),this.addManagedListener(this.eventService,p.EVENT_ROW_EDITING_STOPPED,()=>{const t=new Zo(this.cellValueChanges);this.pushActionsToUndoStack(t),this.activeRowEdit=null})}addCellEditingListeners(){this.addManagedListener(this.eventService,p.EVENT_CELL_EDITING_STARTED,t=>{this.activeCellEdit={column:t.column,rowIndex:t.rowIndex,rowPinned:t.rowPinned}}),this.addManagedListener(this.eventService,p.EVENT_CELL_EDITING_STOPPED,t=>{if(this.activeCellEdit=null,t.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const s=new Zo(this.cellValueChanges);this.pushActionsToUndoStack(s)}})}addPasteListeners(){this.addManagedListener(this.eventService,p.EVENT_PASTE_START,()=>{this.isPasting=!0}),this.addManagedListener(this.eventService,p.EVENT_PASTE_END,()=>{const t=new Zo(this.cellValueChanges);this.pushActionsToUndoStack(t),this.isPasting=!1})}addFillListeners(){this.addManagedListener(this.eventService,p.EVENT_FILL_START,()=>{this.isRangeInAction=!0}),this.addManagedListener(this.eventService,p.EVENT_FILL_END,t=>{const e=new wa(this.cellValueChanges,t.initialRange,t.finalRange);this.pushActionsToUndoStack(e),this.isRangeInAction=!1})}addCellKeyListeners(){this.addManagedListener(this.eventService,p.EVENT_KEY_SHORTCUT_CHANGED_CELL_START,()=>{this.isRangeInAction=!0}),this.addManagedListener(this.eventService,p.EVENT_KEY_SHORTCUT_CHANGED_CELL_END,()=>{let t;this.rangeService&&this.gos.get("enableRangeSelection")?t=new wa(this.cellValueChanges,void 0,void 0,[...this.rangeService.getCellRanges()]):t=new Zo(this.cellValueChanges),this.pushActionsToUndoStack(t),this.isRangeInAction=!1})}pushActionsToUndoStack(t){this.undoStack.push(t),this.cellValueChanges=[],this.redoStack.clear()}};u([f("focusService")],Jt.prototype,"focusService",2),u([f("ctrlsService")],Jt.prototype,"ctrlsService",2),u([f("cellPositionUtils")],Jt.prototype,"cellPositionUtils",2),u([f("rowPositionUtils")],Jt.prototype,"rowPositionUtils",2),u([f("columnModel")],Jt.prototype,"columnModel",2),u([he("rangeService")],Jt.prototype,"rangeService",2),u([M],Jt.prototype,"init",1),Jt=u([O("undoRedoService")],Jt);var $o=class extends L{findHeader(t,e){let s,i;if(t.column instanceof He?s=this.columnModel.getDisplayedGroupAtDirection(t.column,e):(i=`getDisplayedCol${e}`,s=this.columnModel[i](t.column)),!s)return;let{headerRowIndex:o}=t;if(this.getHeaderRowType(o)!=="filter"){const l=[s];for(;s.getParent();)s=s.getParent(),l.push(s);s=l[l.length-1-o]}const{column:r,headerRowIndex:n}=this.getHeaderIndexToFocus(s,o);return{column:r,headerRowIndex:n}}getHeaderIndexToFocus(t,e){let s;if(t instanceof He&&this.isAnyChildSpanningHeaderHeight(t)&&t.isPadding()){const i=t;s=i.getLeafColumns()[0];let o=s;for(;o!==i;)e++,o=o.getParent()}return{column:s||t,headerRowIndex:e}}isAnyChildSpanningHeaderHeight(t){return t?t.getLeafColumns().some(e=>e.isSpanHeaderHeight()):!1}getColumnVisibleParent(t,e){const s=this.getHeaderRowType(e),i=s==="filter",o=s==="column";let r=i?t:t.getParent(),n=e-1,l=n;if(o&&this.isAnyChildSpanningHeaderHeight(t.getParent())){for(;r&&r.isPadding();)r=r.getParent(),n--;l=n,n<0&&(r=t,n=e,l=void 0)}return{column:r,headerRowIndex:n,headerRowIndexWithoutSpan:l}}getColumnVisibleChild(t,e,s="After"){const i=this.getHeaderRowType(e);let o=t,r=e+1,n=r;if(i==="group"){const l=t.getDisplayedLeafColumns(),a=s==="After"?l[0]:ie(l),d=[];let h=a;for(;h.getParent()!==t;)h=h.getParent(),d.push(h);if(o=a,a.isSpanHeaderHeight())for(let c=d.length-1;c>=0;c--){const m=d[c];if(!m.isPadding()){o=m;break}r++}else o=ie(d),o||(o=a)}return{column:o,headerRowIndex:r,headerRowIndexWithoutSpan:n}}getHeaderRowType(t){const e=this.ctrlsService.getHeaderRowContainerCtrl();if(e)return e.getRowType(t)}findColAtEdgeForHeaderRow(t,e){const s=this.columnModel.getAllDisplayedColumns(),i=s[e==="start"?0:s.length-1];if(!i)return;const r=this.ctrlsService.getHeaderRowContainerCtrl(i.getPinned()).getRowType(t);if(r=="group"){const n=this.columnModel.getColumnGroupAtLevel(i,t);return{headerRowIndex:t,column:n}}return{headerRowIndex:r==null?-1:t,column:i}}};u([f("columnModel")],$o.prototype,"columnModel",2),u([f("ctrlsService")],$o.prototype,"ctrlsService",2),$o=u([O("headerPositionUtils")],$o);var Sa=class{buildColumnDefs(t,e,s){const i=[],o={};return t.forEach(r=>{const n=this.createDefFromColumn(r,e,s);let l=!0,a=n,d=r.getOriginalParent(),h=null;for(;d;){let c=null;if(d.isPadding()){d=d.getOriginalParent();continue}const m=o[d.getGroupId()];if(m){m.children.push(a),l=!1;break}if(c=this.createDefFromGroup(d),c&&(c.children=[a],o[c.groupId]=c,a=c,d=d.getOriginalParent()),d!=null&&h===d){l=!1;break}h=d}l&&i.push(a)}),i}createDefFromGroup(t){const e=Er(t.getColGroupDef(),["children"]);return e&&(e.groupId=t.getGroupId()),e}createDefFromColumn(t,e,s){const i=Er(t.getColDef());return i.colId=t.getColId(),i.width=t.getActualWidth(),i.rowGroup=t.isRowGroupActive(),i.rowGroupIndex=t.isRowGroupActive()?e.indexOf(t):null,i.pivot=t.isPivotActive(),i.pivotIndex=t.isPivotActive()?s.indexOf(t):null,i.aggFunc=t.isValueActive()?t.getAggFunc():null,i.hide=t.isVisible()?void 0:!0,i.pinned=t.isPinned()?t.getPinned():null,i.sort=t.getSort()?t.getSort():null,i.sortIndex=t.getSortIndex()!=null?t.getSortIndex():null,i}};Sa=u([O("columnDefFactory")],Sa);var er=class{getInitialRowClasses(t){const e=[];return P(t.extraCssClass)&&e.push(t.extraCssClass),e.push("ag-row"),e.push(t.rowFocused?"ag-row-focus":"ag-row-no-focus"),t.fadeRowIn&&e.push("ag-opacity-zero"),e.push(t.rowIsEven?"ag-row-even":"ag-row-odd"),t.rowNode.isRowPinned()&&e.push("ag-row-pinned"),t.rowNode.isSelected()&&e.push("ag-row-selected"),t.rowNode.footer&&e.push("ag-row-footer"),e.push("ag-row-level-"+t.rowLevel),t.rowNode.stub&&e.push("ag-row-loading"),t.fullWidthRow&&e.push("ag-full-width-row"),t.expandable&&(e.push("ag-row-group"),e.push(t.rowNode.expanded?"ag-row-group-expanded":"ag-row-group-contracted")),t.rowNode.dragging&&e.push("ag-row-dragging"),Jn(e,this.processClassesFromGridOptions(t.rowNode)),Jn(e,this.preProcessRowClassRules(t.rowNode)),e.push(t.printLayout?"ag-row-position-relative":"ag-row-position-absolute"),t.firstRowOnPage&&e.push("ag-row-first"),t.lastRowOnPage&&e.push("ag-row-last"),t.fullWidthRow&&(t.pinned==="left"&&e.push("ag-cell-last-left-pinned"),t.pinned==="right"&&e.push("ag-cell-first-right-pinned")),e}processClassesFromGridOptions(t){const e=[],s=r=>{typeof r=="string"?e.push(r):Array.isArray(r)&&r.forEach(n=>e.push(n))},i=this.gos.get("rowClass");if(i){if(typeof i=="function")return console.warn("AG Grid: rowClass should not be a function, please use getRowClass instead"),[];s(i)}const o=this.gos.getCallback("getRowClass");if(o){const r={data:t.data,node:t,rowIndex:t.rowIndex},n=o(r);s(n)}return e}preProcessRowClassRules(t){const e=[];return this.processRowClassRules(t,s=>{e.push(s)},s=>{}),e}processRowClassRules(t,e,s){const i=this.gos.addGridCommonParams({data:t.data,node:t,rowIndex:t.rowIndex});this.stylingService.processClassRules(void 0,this.gos.get("rowClassRules"),i,e,s)}calculateRowLevel(t){return t.group?t.level:t.parent?t.parent.level+1:0}};u([f("stylingService")],er.prototype,"stylingService",2),u([f("gridOptionsService")],er.prototype,"gos",2),er=u([O("rowCssClassCalculator")],er);var Xi=class extends L{init(){this.isAccentedSort=this.gos.get("accentedSort"),this.primaryColumnsSortGroups=this.gos.isColumnsSortingCoupledToGroup(),this.addManagedPropertyListener("accentedSort",t=>this.isAccentedSort=t.currentValue),this.addManagedPropertyListener("autoGroupColumnDef",()=>this.primaryColumnsSortGroups=this.gos.isColumnsSortingCoupledToGroup())}doFullSort(t,e){const s=(o,r)=>({currentPos:r,rowNode:o}),i=t.map(s);return i.sort(this.compareRowNodes.bind(this,e)),i.map(o=>o.rowNode)}compareRowNodes(t,e,s){const i=e.rowNode,o=s.rowNode;for(let r=0,n=t.length;r<n;r++){const l=t[r],a=l.sort==="desc",d=this.getValue(i,l.column),h=this.getValue(o,l.column);let c;const m=this.getComparator(l,i);if(m?c=m(d,h,i,o,a):c=W.defaultComparator(d,h,this.isAccentedSort),!isNaN(c)&&c!==0)return l.sort==="asc"?c:c*-1}return e.currentPos-s.currentPos}getComparator(t,e){const s=t.column,i=s.getColDef().comparator;if(i!=null)return i;if(!s.getColDef().showRowGroup)return;const o=!e.group&&s.getColDef().field;if(!o)return;const r=this.columnModel.getPrimaryColumn(o);if(r)return r.getColDef().comparator}getValue(t,e){var s,i;if(!this.primaryColumnsSortGroups)return this.valueService.getValue(e,t,!1,!1);if(t.rowGroupColumn===e){if(this.gos.isGroupUseEntireRow(this.columnModel.isPivotActive())){const l=(s=t.allLeafChildren)==null?void 0:s[0];return l?this.valueService.getValue(e,l,!1,!1):void 0}const n=this.columnModel.getGroupDisplayColumnForGroup(e.getId());return n?(i=t.groupData)==null?void 0:i[n.getId()]:void 0}if(!(t.group&&e.getColDef().showRowGroup))return this.valueService.getValue(e,t,!1,!1)}};u([f("valueService")],Xi.prototype,"valueService",2),u([f("columnModel")],Xi.prototype,"columnModel",2),u([M],Xi.prototype,"init",1),Xi=u([O("rowNodeSorter")],Xi);var li=class extends L{constructor(){super(...arguments),this.params={},this.ready=!1,this.readyCallbacks=[]}checkReady(){const t=this.params;this.ready=t.gridCtrl!=null&&t.gridBodyCtrl!=null&&t.center!=null&&t.left!=null&&t.right!=null&&t.bottomCenter!=null&&t.bottomLeft!=null&&t.bottomRight!=null&&t.topCenter!=null&&t.topLeft!=null&&t.topRight!=null&&t.stickyTopCenter!=null&&t.stickyTopLeft!=null&&t.stickyTopRight!=null&&t.stickyBottomCenter!=null&&t.stickyBottomLeft!=null&&t.stickyBottomRight!=null&&t.centerHeader!=null&&t.leftHeader!=null&&t.rightHeader!=null&&t.fakeHScrollComp!=null&&t.fakeVScrollComp!=null&&t.gridHeaderCtrl!=null,this.ready&&(this.readyCallbacks.forEach(e=>e(t)),this.readyCallbacks.length=0)}whenReady(t){this.ready?t(this.params):this.readyCallbacks.push(t)}register(t,e){this.params[t]=e,this.checkReady()}registerHeaderContainer(t,e){switch(e){case"left":this.params.leftHeader=t;break;case"right":this.params.rightHeader=t;break;default:this.params.centerHeader=t;break}this.checkReady()}get(t){return this.params[t]}getParams(){return this.params}getGridBodyCtrl(){return this.params.gridBodyCtrl}getHeaderRowContainerCtrls(){return[this.params.leftHeader,this.params.rightHeader,this.params.centerHeader]}getHeaderRowContainerCtrl(t){switch(t){case"left":return this.params.leftHeader;case"right":return this.params.rightHeader;default:return this.params.centerHeader}}};li.NAME="ctrlsService",li=u([O(li.NAME)],li);var Ea=class extends L{constructor(){super(...arguments),this.registry={}}register(t){this.registry[t.controllerName]=t.controllerClass}getInstance(t){const e=this.registry[t];if(e!=null)return new e}};Ea=u([O("ctrlsFactory")],Ea);var ai=class extends K{constructor(t,e){super(t),this.direction=e,this.hideTimeout=null}postConstruct(){this.addManagedListener(this.eventService,p.EVENT_SCROLL_VISIBILITY_CHANGED,this.onScrollVisibilityChanged.bind(this)),this.onScrollVisibilityChanged(),this.addOrRemoveCssClass("ag-apple-scrollbar",vl()||as())}initialiseInvisibleScrollbar(){this.invisibleScrollbar===void 0&&(this.invisibleScrollbar=Sl(),this.invisibleScrollbar&&(this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles()))}addActiveListenerToggles(){const t=["mouseenter","mousedown","touchstart"],e=["mouseleave","touchend"],s=this.getGui();t.forEach(i=>this.addManagedListener(s,i,()=>this.addOrRemoveCssClass("ag-scrollbar-active",!0))),e.forEach(i=>this.addManagedListener(s,i,()=>this.addOrRemoveCssClass("ag-scrollbar-active",!1)))}onScrollVisibilityChanged(){this.invisibleScrollbar===void 0&&this.initialiseInvisibleScrollbar(),this.animationFrameService.requestAnimationFrame(()=>this.setScrollVisible())}hideAndShowInvisibleScrollAsNeeded(){this.addManagedListener(this.eventService,p.EVENT_BODY_SCROLL,t=>{t.direction===this.direction&&(this.hideTimeout!==null&&(window.clearTimeout(this.hideTimeout),this.hideTimeout=null),this.addOrRemoveCssClass("ag-scrollbar-scrolling",!0))}),this.addManagedListener(this.eventService,p.EVENT_BODY_SCROLL_END,()=>{this.hideTimeout=window.setTimeout(()=>{this.addOrRemoveCssClass("ag-scrollbar-scrolling",!1),this.hideTimeout=null},400)})}attemptSettingScrollPosition(t){const e=this.getViewport();Yn(()=>ht(e),()=>this.setScrollPosition(t),100)}getViewport(){return this.eViewport}getContainer(){return this.eContainer}onScrollCallback(t){this.addManagedListener(this.getViewport(),"scroll",t)}};u([I("eViewport")],ai.prototype,"eViewport",2),u([I("eContainer")],ai.prototype,"eContainer",2),u([f("scrollVisibleService")],ai.prototype,"scrollVisibleService",2),u([f("ctrlsService")],ai.prototype,"ctrlsService",2),u([f("animationFrameService")],ai.prototype,"animationFrameService",2);var di=class Oc extends ai{constructor(){super(Oc.TEMPLATE,"horizontal")}postConstruct(){super.postConstruct();const e=this.setFakeHScrollSpacerWidths.bind(this);this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,e),this.addManagedListener(this.eventService,p.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedPropertyListener("domLayout",e),this.ctrlsService.register("fakeHScrollComp",this),this.createManagedBean(new Ii(s=>this.eContainer.style.width=`${s}px`)),this.addManagedPropertyListeners(["suppressHorizontalScroll"],this.onScrollVisibilityChanged.bind(this))}initialiseInvisibleScrollbar(){this.invisibleScrollbar===void 0&&(this.enableRtl=this.gos.get("enableRtl"),super.initialiseInvisibleScrollbar(),this.invisibleScrollbar&&this.refreshCompBottom())}onPinnedRowDataChanged(){this.refreshCompBottom()}refreshCompBottom(){if(!this.invisibleScrollbar)return;const e=this.pinnedRowModel.getPinnedBottomTotalHeight();this.getGui().style.bottom=`${e}px`}onScrollVisibilityChanged(){super.onScrollVisibilityChanged(),this.setFakeHScrollSpacerWidths()}setFakeHScrollSpacerWidths(){const e=this.scrollVisibleService.isVerticalScrollShowing();let s=this.columnModel.getDisplayedColumnsRightWidth();const i=!this.enableRtl&&e,o=this.gos.getScrollbarWidth();i&&(s+=o),Ft(this.eRightSpacer,s),this.eRightSpacer.classList.toggle("ag-scroller-corner",s<=o);let r=this.columnModel.getDisplayedColumnsLeftWidth();this.enableRtl&&e&&(r+=o),Ft(this.eLeftSpacer,r),this.eLeftSpacer.classList.toggle("ag-scroller-corner",r<=o)}setScrollVisible(){const e=this.scrollVisibleService.isHorizontalScrollShowing(),s=this.invisibleScrollbar,i=this.gos.get("suppressHorizontalScroll"),o=e&&this.gos.getScrollbarWidth()||0,n=i?0:o===0&&s?16:o;this.addOrRemoveCssClass("ag-scrollbar-invisible",s),Bs(this.getGui(),n),Bs(this.eViewport,n),Bs(this.eContainer,n),this.setDisplayed(e,{skipAriaHidden:!0})}getScrollPosition(){return Ro(this.getViewport(),this.enableRtl)}setScrollPosition(e){ht(this.getViewport())||this.attemptSettingScrollPosition(e),bo(this.getViewport(),e,this.enableRtl)}};di.TEMPLATE=`<div class="ag-body-horizontal-scroll" aria-hidden="true">
316
+ <div class="ag-horizontal-left-spacer" ref="eLeftSpacer"></div>
317
+ <div class="ag-body-horizontal-scroll-viewport" ref="eViewport">
318
+ <div class="ag-body-horizontal-scroll-container" ref="eContainer"></div>
319
+ </div>
320
+ <div class="ag-horizontal-right-spacer" ref="eRightSpacer"></div>
321
+ </div>`,u([I("eLeftSpacer")],di.prototype,"eLeftSpacer",2),u([I("eRightSpacer")],di.prototype,"eRightSpacer",2),u([f("columnModel")],di.prototype,"columnModel",2),u([f("pinnedRowModel")],di.prototype,"pinnedRowModel",2),u([M],di.prototype,"postConstruct",1);var _m=di,tr=class extends L{postConstruct(){const t=this.checkContainerWidths.bind(this);this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_CHANGED,t),this.addManagedListener(this.eventService,p.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,t),this.addManagedPropertyListener("domLayout",t)}checkContainerWidths(){const t=this.gos.isDomLayout("print"),e=t?0:this.columnModel.getDisplayedColumnsLeftWidth(),s=t?0:this.columnModel.getDisplayedColumnsRightWidth();e!=this.leftWidth&&(this.leftWidth=e,this.eventService.dispatchEvent({type:p.EVENT_LEFT_PINNED_WIDTH_CHANGED})),s!=this.rightWidth&&(this.rightWidth=s,this.eventService.dispatchEvent({type:p.EVENT_RIGHT_PINNED_WIDTH_CHANGED}))}getPinnedRightWidth(){return this.rightWidth}getPinnedLeftWidth(){return this.leftWidth}};u([f("columnModel")],tr.prototype,"columnModel",2),u([M],tr.prototype,"postConstruct",1),tr=u([O("pinnedWidthService")],tr);var Ji=class extends L{constructor(){super(...arguments),this.events=[]}postConstruct(){this.rowModel.getType()=="clientSide"&&(this.clientSideRowModel=this.rowModel)}dispatchExpanded(t,e){if(this.clientSideRowModel==null){this.eventService.dispatchEvent(t);return}this.events.push(t);const s=()=>{this.clientSideRowModel&&this.clientSideRowModel.onRowGroupOpened(),this.events.forEach(i=>this.eventService.dispatchEvent(i)),this.events=[]};e?s():(this.dispatchExpandedDebounced==null&&(this.dispatchExpandedDebounced=this.animationFrameService.debounce(s)),this.dispatchExpandedDebounced())}};u([f("animationFrameService")],Ji.prototype,"animationFrameService",2),u([f("rowModel")],Ji.prototype,"rowModel",2),u([M],Ji.prototype,"postConstruct",1),Ji=u([O("rowNodeEventThrottle")],Ji);var Vm={columnsMenuParams:{version:"31.1",message:"Use `columnChooserParams` instead."},suppressMenu:{version:"31.1",message:"Use `suppressHeaderMenuButton` instead."},suppressCellFlash:{version:"31.2",message:"Use `enableCellChangeFlash={false}` in the ColDef"},dndSource:{version:"31.2",message:"This feature has been replaced by `Row Dragging to an External DropZone`."},dndSourceOnRowDrag:{version:"31.2",message:"This feature has been replaced by `Row Dragging to an External DropZone`."}},Ls=(t,e)=>{var s;return((s=e.rowModelType)!=null?s:"clientSide")==="clientSide"?{module:"@ag-grid-enterprise/row-grouping"}:null},Hm={enableRowGroup:Ls,rowGroup:Ls,rowGroupIndex:Ls,enablePivot:Ls,enableValue:Ls,pivot:Ls,pivotIndex:Ls,aggFunc:Ls,cellEditor:t=>t.cellEditor==="agRichSelect"||t.cellEditor==="agRichSelectCellEditor"?{module:"@ag-grid-enterprise/rich-select"}:null,menuTabs:t=>{var e;const s=["columnsMenuTab","generalMenuTab"];return(e=t.menuTabs)!=null&&e.some(i=>s.includes(i))?{module:"@ag-grid-enterprise/menu"}:null},columnsMenuParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},columnChooserParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},headerCheckboxSelection:{supportedRowModels:["clientSide","serverSide"],dependencies:(t,{rowSelection:e})=>e==="multiple"?null:"headerCheckboxSelection is only supported with rowSelection=multiple"},headerCheckboxSelectionFilteredOnly:{supportedRowModels:["clientSide"],dependencies:(t,{rowSelection:e})=>e==="multiple"?null:"headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple"},headerCheckboxSelectionCurrentPageOnly:{supportedRowModels:["clientSide"],dependencies:(t,{rowSelection:e})=>e==="multiple"?null:"headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple"},children:()=>Zi},km={headerName:void 0,columnGroupShow:void 0,headerClass:void 0,toolPanelClass:void 0,headerValueGetter:void 0,pivotKeys:void 0,groupId:void 0,colId:void 0,sort:void 0,initialSort:void 0,field:void 0,type:void 0,cellDataType:void 0,tooltipComponent:void 0,tooltipField:void 0,headerTooltip:void 0,cellClass:void 0,showRowGroup:void 0,filter:void 0,initialAggFunc:void 0,defaultAggFunc:void 0,aggFunc:void 0,pinned:void 0,initialPinned:void 0,chartDataType:void 0,cellAriaRole:void 0,cellEditorPopupPosition:void 0,headerGroupComponent:void 0,headerGroupComponentParams:void 0,cellStyle:void 0,cellRenderer:void 0,cellRendererParams:void 0,cellEditor:void 0,cellEditorParams:void 0,filterParams:void 0,pivotValueColumn:void 0,headerComponent:void 0,headerComponentParams:void 0,floatingFilterComponent:void 0,floatingFilterComponentParams:void 0,tooltipComponentParams:void 0,refData:void 0,columnsMenuParams:void 0,columnChooserParams:void 0,children:void 0,sortingOrder:void 0,allowedAggFuncs:void 0,menuTabs:void 0,pivotTotalColumnIds:void 0,cellClassRules:void 0,icons:void 0,sortIndex:void 0,initialSortIndex:void 0,flex:void 0,initialFlex:void 0,width:void 0,initialWidth:void 0,minWidth:void 0,maxWidth:void 0,rowGroupIndex:void 0,initialRowGroupIndex:void 0,pivotIndex:void 0,initialPivotIndex:void 0,suppressCellFlash:void 0,suppressColumnsToolPanel:void 0,suppressFiltersToolPanel:void 0,openByDefault:void 0,marryChildren:void 0,suppressStickyLabel:void 0,hide:void 0,initialHide:void 0,rowGroup:void 0,initialRowGroup:void 0,pivot:void 0,initialPivot:void 0,checkboxSelection:void 0,showDisabledCheckboxes:void 0,headerCheckboxSelection:void 0,headerCheckboxSelectionFilteredOnly:void 0,headerCheckboxSelectionCurrentPageOnly:void 0,suppressMenu:void 0,suppressHeaderMenuButton:void 0,suppressMovable:void 0,lockPosition:void 0,lockVisible:void 0,lockPinned:void 0,unSortIcon:void 0,suppressSizeToFit:void 0,suppressAutoSize:void 0,enableRowGroup:void 0,enablePivot:void 0,enableValue:void 0,editable:void 0,suppressPaste:void 0,suppressNavigable:void 0,enableCellChangeFlash:void 0,rowDrag:void 0,dndSource:void 0,autoHeight:void 0,wrapText:void 0,sortable:void 0,resizable:void 0,singleClickEdit:void 0,floatingFilter:void 0,cellEditorPopup:void 0,suppressFillHandle:void 0,wrapHeaderText:void 0,autoHeaderHeight:void 0,dndSourceOnRowDrag:void 0,valueGetter:void 0,valueSetter:void 0,filterValueGetter:void 0,keyCreator:void 0,valueFormatter:void 0,valueParser:void 0,comparator:void 0,equals:void 0,pivotComparator:void 0,suppressKeyboardEvent:void 0,suppressHeaderKeyboardEvent:void 0,colSpan:void 0,rowSpan:void 0,getQuickFilterText:void 0,onCellValueChanged:void 0,onCellClicked:void 0,onCellDoubleClicked:void 0,onCellContextMenu:void 0,rowDragText:void 0,tooltipValueGetter:void 0,cellRendererSelector:void 0,cellEditorSelector:void 0,suppressSpanHeaderHeight:void 0,useValueFormatterForExport:void 0,useValueParserForImport:void 0,mainMenuItems:void 0,contextMenuItems:void 0,suppressFloatingFilterButton:void 0,suppressHeaderFilterButton:void 0,suppressHeaderContextMenu:void 0,loadingCellRenderer:void 0,loadingCellRendererParams:void 0,loadingCellRendererSelector:void 0},Bm=Object.keys(km),Zi={objectName:"colDef",allProperties:Bm,docsUrl:"column-properties/",deprecations:Vm,validations:Hm},Wm={enableChartToolPanelsButton:{version:"29"},functionsPassive:{version:"29.2"},onColumnRowGroupChangeRequest:{version:"29.2"},onColumnPivotChangeRequest:{version:"29.2"},onColumnValueChangeRequest:{version:"29.2"},onColumnAggFuncChangeRequest:{version:"29.2"},serverSideFilterAllLevels:{version:"30",message:"All server-side group levels are now filtered by default. This can be toggled using `serverSideOnlyRefreshFilteredGroups`."},suppressAggAtRootLevel:{version:"30",message:"The root level aggregation is now suppressed by default. This can be toggled using `alwaysAggregateAtRootLevel`."},excludeHiddenColumnsFromQuickFilter:{version:"30",message:"Hidden columns are now excluded from the Quick Filter by default. This can be toggled using `includeHiddenColumnsInQuickFilter`."},enterMovesDown:{version:"30",renamed:"enterNavigatesVertically"},enterMovesDownAfterEdit:{version:"30",renamed:"enterNavigatesVerticallyAfterEdit"},suppressParentsInRowNodes:{version:"30.2",message:"Using suppressParentsInRowNodes is no longer recommended. To serialize nodes it is now recommended to instead remove the parent node reference before serialization."},advancedFilterModel:{version:"31",message:"Use `initialState.filter.advancedFilterModel` instead."},suppressAsyncEvents:{version:"31",message:"Events should be handled asynchronously."},cellFadeDelay:{version:"31.1",renamed:"cellFadeDuration"},cellFlashDelay:{version:"31.1",renamed:"cellFlashDuration"},suppressServerSideInfiniteScroll:{version:"31.1"},serverSideSortOnServer:{version:"31.1"},serverSideFilterOnServer:{version:"31.1"},enableCellChangeFlash:{version:"31.2",message:"Use `enableCellChangeFlash` in the `ColDef` or `defaultColDef` for all columns."},groupIncludeFooter:{version:"31.3",message:"Use `groupTotalRow` instead."},groupIncludeTotalFooter:{version:"31.3",message:"Use `grandTotalRow` instead."}},Um={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!1,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipHideDelay:1e4,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,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!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,suppressChartToolPanelsButton:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressAsyncEvents:!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,enableCellChangeFlash:!1,cellFlashDelay:500,cellFlashDuration:500,cellFadeDelay:1e3,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupIncludeTotalFooter:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,suppressServerSideInfiniteScroll:!1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSideSortOnServer:!1,serverSideFilterOnServer:!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,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,suppressGroupMaintainValueType:!1,functionsPassive:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1},zm={sideBar:{module:"@ag-grid-enterprise/side-bar"},statusBar:{module:"@ag-grid-enterprise/status-bar"},enableCharts:{module:"@ag-grid-enterprise/charts"},getMainMenuItems:{module:"@ag-grid-enterprise/menu"},getContextMenuItems:{module:"@ag-grid-enterprise/menu"},allowContextMenuWithControlKey:{module:"@ag-grid-enterprise/menu"},enableAdvancedFilter:{module:"@ag-grid-enterprise/advanced-filter"},treeData:{supportedRowModels:["clientSide","serverSide"],module:"@ag-grid-enterprise/row-grouping",dependencies:t=>{var e;const s=(e=t.rowModelType)!=null?e:"clientSide";switch(s){case"clientSide":const i=`treeData requires 'getDataPath' in the ${s} row model.`;return t.getDataPath?null:i;case"serverSide":const o=`treeData requires 'isServerSideGroup' and 'getServerSideGroupKey' in the ${s} row model.`;return t.isServerSideGroup&&t.getServerSideGroupKey?null:o}return null}},masterDetail:{module:"@ag-grid-enterprise/master-detail"},enableRangeSelection:{module:"@ag-grid-enterprise/range-selection"},enableRangeHandle:{dependencies:{enableRangeSelection:[!0]}},enableFillHandle:{dependencies:{enableRangeSelection:[!0]}},groupDefaultExpanded:{supportedRowModels:["clientSide"]},groupIncludeFooter:{supportedRowModels:["clientSide","serverSide"],dependencies:t=>{var e;switch((e=t.rowModelType)!=null?e:"clientSide"){case"clientSide":return null;case"serverSide":return t.suppressServerSideInfiniteScroll?"groupIncludeFooter is not supported alongside suppressServerSideInfiniteScroll":null}return null}},groupIncludeTotalFooter:{supportedRowModels:["clientSide"]},groupRemoveSingleChildren:{dependencies:{groupHideOpenParents:[void 0,!1],groupRemoveLowestSingleChildren:[void 0,!1]}},groupRemoveLowestSingleChildren:{dependencies:{groupHideOpenParents:[void 0,!1],groupRemoveSingleChildren:[void 0,!1]}},groupSelectsChildren:{dependencies:{rowSelection:["multiple"]}},suppressParentsInRowNodes:{dependencies:{groupSelectsChildren:[void 0,!1]}},viewportDatasource:{supportedRowModels:["viewport"],module:"@ag-grid-enterprise/viewport-row-model"},serverSideDatasource:{supportedRowModels:["serverSide"],module:"@ag-grid-enterprise/server-side-row-model"},cacheBlockSize:{supportedRowModels:["serverSide","infinite"]},datasource:{supportedRowModels:["infinite"],module:"@ag-grid-community/infinite-row-model"},rowData:{supportedRowModels:["clientSide"],module:"@ag-grid-community/client-side-row-model"},columnDefs:()=>Zi,defaultColDef:()=>Zi,defaultColGroupDef:()=>Zi,autoGroupColumnDef:()=>Zi},Km={objectName:"gridOptions",allProperties:[...vo.ALL_PROPERTIES,...Mr.EVENT_CALLBACKS],propertyExceptions:["api","columnApi"],docsUrl:"grid-options/",deprecations:Wm,validations:zm},le=class{constructor(){this.destroyed=!1,this.domDataKey="__AG_"+Math.random().toString(),this.propertyEventService=new Gt,this.globalEventHandlerFactory=t=>(e,s)=>{if(this.destroyed)return;const i=Lr.has(e);if(i&&!t||!i&&t)return;const o=Mr.getCallbackForEvent(e),r=this.gridOptions[o];typeof r=="function"&&this.frameworkOverrides.wrapOutgoing(()=>{r(s)})}}get context(){return this.gridOptions.context}init(){this.columnApi=new zi(this.api);const t=!this.get("suppressAsyncEvents");this.eventService.addGlobalListener(this.globalEventHandlerFactory().bind(this),t),this.eventService.addGlobalListener(this.globalEventHandlerFactory(!0).bind(this),!1),this.propertyEventService.setFrameworkOverrides(this.frameworkOverrides),this.getScrollbarWidth()}destroy(){this.destroyed=!0,this.columnApi=void 0}get(t){var e;return(e=this.gridOptions[t])!=null?e:Um[t]}getCallback(t){return this.mergeGridCommonParams(this.gridOptions[t])}exists(t){return P(this.gridOptions[t])}mergeGridCommonParams(t){return t&&(s=>{const i=s;return i.api=this.api,i.columnApi=this.columnApi,i.context=this.context,t(i)})}static toBoolean(t){return typeof t=="boolean"?t:typeof t=="string"?t.toUpperCase()==="TRUE"||t=="":!1}static toNumber(t){if(typeof t=="number")return t;if(typeof t=="string"){const e=parseInt(t);return isNaN(e)?void 0:e}}static toConstrainedNum(t,e){return s=>{const i=le.toNumber(s);if(!(i==null||i<t||i>e))return i}}static getCoercedValue(t,e){const s=le.PROPERTY_COERCIONS.get(t);return s?s(e):e}static getCoercedGridOptions(t){const e={};return Object.entries(t).forEach(([s,i])=>{const o=le.getCoercedValue(s,i);e[s]=o}),e}updateGridOptions({options:t,force:e,source:s="api"}){const i={id:le.changeSetId++,properties:[]},o=[];Object.entries(t).forEach(([r,n])=>{s==="api"&&vg[r]&&H(`${r} is an initial property and cannot be updated.`);const l=le.getCoercedValue(r,n),a=e||typeof l=="object"&&s==="api",d=this.gridOptions[r];if(a||d!==l){this.gridOptions[r]=l;const h={type:r,currentValue:l,previousValue:d,changeSet:i,source:s};o.push(h)}}),this.validationService.processGridOptions(this.gridOptions),i.properties=o.map(r=>r.type),o.forEach(r=>{this.gridOptions.debug&&console.log(`AG Grid: Updated property ${r.type} from `,r.previousValue," to ",r.currentValue),this.propertyEventService.dispatchEvent(r)})}addEventListener(t,e){this.propertyEventService.addEventListener(t,e)}removeEventListener(t,e){this.propertyEventService.removeEventListener(t,e)}getScrollbarWidth(){if(this.scrollbarWidth==null){const e=typeof this.gridOptions.scrollbarWidth=="number"&&this.gridOptions.scrollbarWidth>=0?this.gridOptions.scrollbarWidth:mu();e!=null&&(this.scrollbarWidth=e,this.eventService.dispatchEvent({type:p.EVENT_SCROLLBAR_WIDTH_CHANGED}))}return this.scrollbarWidth}isRowModelType(t){return this.gridOptions.rowModelType===t||t==="clientSide"&&z(this.gridOptions.rowModelType)}isDomLayout(t){var e;return((e=this.gridOptions.domLayout)!=null?e:"normal")===t}isRowSelection(){return this.gridOptions.rowSelection==="single"||this.gridOptions.rowSelection==="multiple"}useAsyncEvents(){return!this.get("suppressAsyncEvents")}isGetRowHeightFunction(){return typeof this.gridOptions.getRowHeight=="function"}getRowHeightForNode(t,e=!1,s){if(s==null&&(s=this.environment.getDefaultRowHeight()),this.isGetRowHeightFunction()){if(e)return{height:s,estimated:!0};const o={node:t,data:t.data},r=this.getCallback("getRowHeight")(o);if(this.isNumeric(r))return r===0&&H("The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead."),{height:Math.max(1,r),estimated:!1}}return t.detail&&this.get("masterDetail")?this.getMasterDetailRowHeight():{height:this.gridOptions.rowHeight&&this.isNumeric(this.gridOptions.rowHeight)?this.gridOptions.rowHeight:s,estimated:!1}}getMasterDetailRowHeight(){return this.get("detailRowAutoHeight")?{height:1,estimated:!1}:this.isNumeric(this.gridOptions.detailRowHeight)?{height:this.gridOptions.detailRowHeight,estimated:!1}:{height:300,estimated:!1}}getRowHeightAsNumber(){if(!this.gridOptions.rowHeight||z(this.gridOptions.rowHeight))return this.environment.getDefaultRowHeight();const t=this.environment.refreshRowHeightVariable();return t!==-1?t:(console.warn("AG Grid row height must be a number if not using standard row model"),this.environment.getDefaultRowHeight())}isNumeric(t){return!isNaN(t)&&typeof t=="number"&&isFinite(t)}getDomDataKey(){return this.domDataKey}getDomData(t,e){const s=t[this.getDomDataKey()];return s?s[e]:void 0}setDomData(t,e,s){const i=this.getDomDataKey();let o=t[i];z(o)&&(o={},t[i]=o),o[e]=s}getDocument(){let t=null;return this.gridOptions.getDocument&&P(this.gridOptions.getDocument)?t=this.gridOptions.getDocument():this.eGridDiv&&(t=this.eGridDiv.ownerDocument),t&&P(t)?t:document}getWindow(){return this.getDocument().defaultView||window}getRootNode(){return this.eGridDiv.getRootNode()}getActiveDomElement(){return this.getRootNode().activeElement}getAsyncTransactionWaitMillis(){return P(this.gridOptions.asyncTransactionWaitMillis)?this.gridOptions.asyncTransactionWaitMillis:50}isAnimateRows(){return this.get("ensureDomOrder")?!1:this.get("animateRows")}isGroupRowsSticky(){return!(this.get("paginateChildRows")||this.get("groupHideOpenParents")||this.isDomLayout("print"))}isColumnsSortingCoupledToGroup(){const t=this.gridOptions.autoGroupColumnDef;return!(t!=null&&t.comparator)&&!this.get("treeData")}getGroupAggFiltering(){const t=this.gridOptions.groupAggFiltering;if(typeof t=="function")return this.getCallback("groupAggFiltering");if(t===!0)return()=>!0}getGrandTotalRow(){const t=this.gridOptions.grandTotalRow;if(t)return t;if(this.gridOptions.groupIncludeTotalFooter)return"bottom"}getGroupTotalRowCallback(){const t=this.get("groupTotalRow");if(typeof t=="function")return this.getCallback("groupTotalRow");if(t)return()=>t;const e=this.get("groupIncludeFooter");if(typeof e=="function"){const s=this.getCallback("groupIncludeFooter");return i=>s(i)?"bottom":void 0}return()=>e?"bottom":void 0}isGroupMultiAutoColumn(){return this.gridOptions.groupDisplayType?this.gridOptions.groupDisplayType==="multipleColumns":this.get("groupHideOpenParents")}isGroupUseEntireRow(t){return t?!1:this.gridOptions.groupDisplayType==="groupRows"}getGridCommonParams(){return{api:this.api,columnApi:this.columnApi,context:this.context}}addGridCommonParams(t){const e=t;return e.api=this.api,e.columnApi=this.columnApi,e.context=this.context,e}};le.PROPERTY_COERCIONS=new Map([...vo.BOOLEAN_PROPERTIES.map(t=>[t,le.toBoolean]),...vo.NUMBER_PROPERTIES.map(t=>[t,le.toNumber]),["groupAggFiltering",t=>typeof t=="function"?t:le.toBoolean(t)],["pageSize",le.toConstrainedNum(1,Number.MAX_VALUE)],["autoSizePadding",le.toConstrainedNum(0,Number.MAX_VALUE)],["keepDetailRowsCount",le.toConstrainedNum(1,Number.MAX_VALUE)],["rowBuffer",le.toConstrainedNum(0,Number.MAX_VALUE)],["infiniteInitialRowCount",le.toConstrainedNum(1,Number.MAX_VALUE)],["cacheOverflowSize",le.toConstrainedNum(1,Number.MAX_VALUE)],["cacheBlockSize",le.toConstrainedNum(1,Number.MAX_VALUE)],["serverSideInitialRowCount",le.toConstrainedNum(1,Number.MAX_VALUE)],["viewportRowModelPageSize",le.toConstrainedNum(1,Number.MAX_VALUE)],["viewportRowModelBufferSize",le.toConstrainedNum(0,Number.MAX_VALUE)]]),le.changeSetId=0,u([f("gridOptions")],le.prototype,"gridOptions",2),u([f("eventService")],le.prototype,"eventService",2),u([f("environment")],le.prototype,"environment",2),u([f("frameworkOverrides")],le.prototype,"frameworkOverrides",2),u([f("eGridDiv")],le.prototype,"eGridDiv",2),u([f("validationService")],le.prototype,"validationService",2),u([f("gridApi")],le.prototype,"api",2),u([M],le.prototype,"init",1),u([tt],le.prototype,"destroy",1),le=u([O("gridOptionsService")],le);var ya=class extends L{getLocaleTextFunc(){const t=this.gos.getCallback("getLocaleText");if(t)return(s,i,o)=>t({key:s,defaultValue:i,variableValues:o});const e=this.gos.get("localeText");return(s,i,o)=>{let r=e&&e[s];if(r&&o&&o.length){let n=0;for(;!(n>=o.length||r.indexOf("${variable}")===-1);)r=r.replace("${variable}",o[n++])}return r??i}}};ya=u([O("localeService")],ya);var Ra=class _c extends ai{constructor(){super(_c.TEMPLATE,"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new sn(this.eContainer)),this.ctrlsService.register("fakeVScrollComp",this),this.addManagedListener(this.eventService,p.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,this.onRowContainerHeightChanged.bind(this))}setScrollVisible(){const e=this.scrollVisibleService.isVerticalScrollShowing(),s=this.invisibleScrollbar,i=e&&this.gos.getScrollbarWidth()||0,o=i===0&&s?16:i;this.addOrRemoveCssClass("ag-scrollbar-invisible",s),Ft(this.getGui(),o),Ft(this.eViewport,o),Ft(this.eContainer,o),this.setDisplayed(e,{skipAriaHidden:!0})}onRowContainerHeightChanged(){const{ctrlsService:e}=this,i=e.getGridBodyCtrl().getBodyViewportElement(),o=this.getScrollPosition(),r=i.scrollTop;o!=r&&this.setScrollPosition(r,!0)}getScrollPosition(){return this.getViewport().scrollTop}setScrollPosition(e,s){!s&&!ht(this.getViewport())&&this.attemptSettingScrollPosition(e),this.getViewport().scrollTop=e}};Ra.TEMPLATE=`<div class="ag-body-vertical-scroll" aria-hidden="true">
322
+ <div class="ag-body-vertical-scroll-viewport" ref="eViewport">
323
+ <div class="ag-body-vertical-scroll-container" ref="eContainer"></div>
324
+ </div>
325
+ </div>`,u([M],Ra.prototype,"postConstruct",1);var Ym=Ra,Hh={january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},kh=["january","february","march","april","may","june","july","august","september","october","november","december"],ui=class extends L{constructor(){super(...arguments),this.dataTypeDefinitions={},this.isWaitingForRowData=!1,this.isColumnTypeOverrideInDataTypeDefinitions=!1,this.columnStateUpdatesPendingInference={},this.columnStateUpdateListenerDestroyFuncs=[]}init(){this.groupHideOpenParents=this.gos.get("groupHideOpenParents"),this.addManagedPropertyListener("groupHideOpenParents",()=>{this.groupHideOpenParents=this.gos.get("groupHideOpenParents")}),this.processDataTypeDefinitions(),this.addManagedPropertyListener("dataTypeDefinitions",t=>{this.processDataTypeDefinitions(),this.columnModel.recreateColumnDefs(Ri(t.source))})}processDataTypeDefinitions(){var t;const e=this.getDefaultDataTypes();this.dataTypeDefinitions={},Object.entries(e).forEach(([i,o])=>{this.dataTypeDefinitions[i]=Ee(_({},o),{groupSafeValueFormatter:this.createGroupSafeValueFormatter(o)})});const s=(t=this.gos.get("dataTypeDefinitions"))!=null?t:{};this.dataTypeMatchers={},Object.entries(s).forEach(([i,o])=>{const r=this.processDataTypeDefinition(o,s,[i],e);r&&(this.dataTypeDefinitions[i]=r,o.dataTypeMatcher&&(this.dataTypeMatchers[i]=o.dataTypeMatcher))}),this.checkObjectValueHandlers(e),["dateString","text","number","boolean","date"].forEach(i=>{const o=this.dataTypeMatchers[i];o&&delete this.dataTypeMatchers[i],this.dataTypeMatchers[i]=o??e[i].dataTypeMatcher})}mergeDataTypeDefinitions(t,e){const s=_(_({},t),e);return t.columnTypes&&e.columnTypes&&e.appendColumnTypes&&(s.columnTypes=[...this.convertColumnTypes(t.columnTypes),...this.convertColumnTypes(e.columnTypes)]),s}processDataTypeDefinition(t,e,s,i){let o;const r=t.extendsDataType;if(t.columnTypes&&(this.isColumnTypeOverrideInDataTypeDefinitions=!0),t.extendsDataType===t.baseDataType){let n=i[r];const l=e[r];if(n&&l&&(n=l),!this.validateDataTypeDefinition(t,n,r))return;o=this.mergeDataTypeDefinitions(n,t)}else{if(s.includes(r)){H('Data type definition hierarchies (via the "extendsDataType" property) cannot contain circular references.');return}const n=e[r];if(!this.validateDataTypeDefinition(t,n,r))return;const l=this.processDataTypeDefinition(n,e,[...s,r],i);if(!l)return;o=this.mergeDataTypeDefinitions(l,t)}return Ee(_({},o),{groupSafeValueFormatter:this.createGroupSafeValueFormatter(o)})}validateDataTypeDefinition(t,e,s){return e?e.baseDataType!==t.baseDataType?(H('The "baseDataType" property of a data type definition must match that of its parent.'),!1):!0:(H(`The data type definition ${s} does not exist.`),!1)}createGroupSafeValueFormatter(t){if(t.valueFormatter)return e=>{var s,i;if((s=e.node)!=null&&s.group){const o=e.column.getAggFunc();if(o){if(o==="first"||o==="last")return t.valueFormatter(e);if(t.baseDataType==="number"&&o!=="count"){if(typeof e.value=="number")return t.valueFormatter(e);if(typeof e.value=="object"){if(!e.value)return;if("toNumber"in e.value)return t.valueFormatter(Ee(_({},e),{value:e.value.toNumber()}));if("value"in e.value)return t.valueFormatter(Ee(_({},e),{value:e.value.value}))}}}if(!this.gos.get("suppressGroupMaintainValueType"))return}else if(this.groupHideOpenParents&&e.column.isRowGroupActive()){if(typeof e.value!="string"||(i=t.dataTypeMatcher)!=null&&i.call(t,e.value))return t.valueFormatter(e);if(!this.gos.get("suppressGroupMaintainValueType"))return}return t.valueFormatter(e)}}updateColDefAndGetDataTypeDefinitionColumnType(t,e,s){let{cellDataType:i}=e;const{field:o}=e;if(i===void 0&&(i=t.cellDataType),(i==null||i===!0)&&(i=this.canInferCellDataType(t,e)?this.inferCellDataType(o,s):!1),!i){t.cellDataType=!1;return}const r=this.dataTypeDefinitions[i];if(!r){H(`Missing data type definition - "${i}"`);return}return t.cellDataType=i,r.groupSafeValueFormatter&&(t.valueFormatter=r.groupSafeValueFormatter),r.valueParser&&(t.valueParser=r.valueParser),r.suppressDefaultProperties||this.setColDefPropertiesForBaseDataType(t,r,s),r.columnTypes}updateColDefAndGetColumnType(t,e,s){var i,o;const r=this.updateColDefAndGetDataTypeDefinitionColumnType(t,e,s),n=(o=(i=e.type)!=null?i:r)!=null?o:t.type;return t.type=n,n?this.convertColumnTypes(n):void 0}addColumnListeners(t){if(!this.isWaitingForRowData)return;const e=this.columnStateUpdatesPendingInference[t.getColId()];if(!e)return;const s=i=>{e.add(i.key)};t.addEventListener(fe.EVENT_STATE_UPDATED,s),this.columnStateUpdateListenerDestroyFuncs.push(()=>t.removeEventListener(fe.EVENT_STATE_UPDATED,s))}canInferCellDataType(t,e){var s;if(this.rowModel.getType()!=="clientSide")return!1;const i={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(this.doColDefPropsPreventInference(e,i))return!1;const o=e.type===null?t.type:e.type;if(o){const r=(s=this.gos.get("columnTypes"))!=null?s:{};if(this.convertColumnTypes(o).some(l=>{const a=r[l.trim()];return a&&this.doColDefPropsPreventInference(a,i)}))return!1}return!this.doColDefPropsPreventInference(t,i)}doColDefPropsPreventInference(t,e){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some(([s,i])=>this.doesColDefPropPreventInference(t,e,s,i))}doesColDefPropPreventInference(t,e,s,i){if(!e[s])return!1;const o=t[s];return o===null?(e[s]=!1,!1):i===void 0?!!o:o===i}inferCellDataType(t,e){var s;if(!t)return;let i;const o=this.getInitialData();if(o){const n=t.indexOf(".")>=0&&!this.gos.get("suppressFieldDotNotation");i=Si(o,t,n)}else this.initWaitForRowData(e);if(i==null)return;const[r]=(s=Object.entries(this.dataTypeMatchers).find(([n,l])=>l(i)))!=null?s:["object"];return r}getInitialData(){const t=this.gos.get("rowData");if(t!=null&&t.length)return t[0];if(this.initialData)return this.initialData;{const e=this.rowModel.getRootNode().allLeafChildren;if(e!=null&&e.length)return e[0].data}return null}initWaitForRowData(t){if(this.columnStateUpdatesPendingInference[t]=new Set,this.isWaitingForRowData)return;this.isWaitingForRowData=!0;const e=this.isColumnTypeOverrideInDataTypeDefinitions;e&&this.columnModel.queueResizeOperations();const s=this.addManagedListener(this.eventService,p.EVENT_ROW_DATA_UPDATE_STARTED,i=>{const{firstRowData:o}=i;if(!o)return;s==null||s(),this.isWaitingForRowData=!1,this.processColumnsPendingInference(o,e),this.columnStateUpdatesPendingInference={},e&&this.columnModel.processResizeOperations();const r={type:p.EVENT_DATA_TYPES_INFERRED};this.eventService.dispatchEvent(r)})}isPendingInference(){return this.isWaitingForRowData}processColumnsPendingInference(t,e){this.initialData=t;const s=[];this.columnStateUpdateListenerDestroyFuncs.forEach(r=>r()),this.columnStateUpdateListenerDestroyFuncs=[];const i={},o={};Object.entries(this.columnStateUpdatesPendingInference).forEach(([r,n])=>{const l=this.columnModel.getGridColumn(r);if(!l)return;const a=l.getColDef();if(!this.columnModel.resetColumnDefIntoColumn(l,"cellDataTypeInferred"))return;const d=l.getColDef();if(e&&d.type&&d.type!==a.type){const h=this.getUpdatedColumnState(l,n);h.rowGroup&&h.rowGroupIndex==null&&(i[r]=h),h.pivot&&h.pivotIndex==null&&(o[r]=h),s.push(h)}}),e&&s.push(...this.columnModel.generateColumnStateForRowGroupAndPivotIndexes(i,o)),s.length&&this.columnModel.applyColumnState({state:s},"cellDataTypeInferred"),this.initialData=null}getUpdatedColumnState(t,e){const s=this.columnModel.getColumnStateFromColDef(t);return e.forEach(i=>{delete s[i],i==="rowGroup"?delete s.rowGroupIndex:i==="pivot"&&delete s.pivotIndex}),s}checkObjectValueHandlers(t){const e=this.dataTypeDefinitions.object,s=t.object;this.hasObjectValueParser=e.valueParser!==s.valueParser,this.hasObjectValueFormatter=e.valueFormatter!==s.valueFormatter}convertColumnTypes(t){let e=[];return t instanceof Array?t.some(i=>typeof i!="string")?console.warn("if colDef.type is supplied an array it should be of type 'string[]'"):e=t:typeof t=="string"?e=t.split(","):console.warn("colDef.type should be of type 'string' | 'string[]'"),e}getDateStringTypeDefinition(t){var e;return t?(e=this.getDataTypeDefinition(t))!=null?e:this.dataTypeDefinitions.dateString:this.dataTypeDefinitions.dateString}getDateParserFunction(t){return this.getDateStringTypeDefinition(t).dateParser}getDateFormatterFunction(t){return this.getDateStringTypeDefinition(t).dateFormatter}getDataTypeDefinition(t){const e=t.getColDef();if(e.cellDataType)return this.dataTypeDefinitions[e.cellDataType]}getBaseDataType(t){var e;return(e=this.getDataTypeDefinition(t))==null?void 0:e.baseDataType}checkType(t,e){var s;if(e==null)return!0;const i=(s=this.getDataTypeDefinition(t))==null?void 0:s.dataTypeMatcher;return i?i(e):!0}validateColDef(t){t.cellDataType==="object"&&(t.valueFormatter===this.dataTypeDefinitions.object.groupSafeValueFormatter&&!this.hasObjectValueFormatter&&H('Cell data type is "object" but no value formatter has been provided. Please either provide an object data type definition with a value formatter, or set "colDef.valueFormatter"'),t.editable&&t.valueParser===this.dataTypeDefinitions.object.valueParser&&!this.hasObjectValueParser&&H('Cell data type is "object" but no value parser has been provided. Please either provide an object data type definition with a value parser, or set "colDef.valueParser"'))}setColDefPropertiesForBaseDataType(t,e,s){const i=(l,a,d)=>{let h=l.getColDef().valueFormatter;return h===e.groupSafeValueFormatter&&(h=e.valueFormatter),this.valueService.formatValue(l,a,d,h)},o=ne.__isRegistered("@ag-grid-enterprise/set-filter",this.context.getGridId()),r=this.localeService.getLocaleTextFunc(),n=l=>{const{filterParams:a}=t;t.filterParams=typeof a=="object"?_(_({},a),l):l};switch(e.baseDataType){case"number":{t.cellEditor="agNumberCellEditor",o&&n({comparator:(l,a)=>{const d=l==null?0:parseInt(l),h=a==null?0:parseInt(a);return d===h?0:d>h?1:-1}});break}case"boolean":{t.cellEditor="agCheckboxCellEditor",t.cellRenderer="agCheckboxCellRenderer",t.suppressKeyboardEvent=l=>!!l.colDef.editable&&l.event.key===E.SPACE,n(o?{valueFormatter:l=>P(l.value)?r(String(l.value),l.value?"True":"False"):r("blanks","(Blanks)")}:{maxNumConditions:1,debounceMs:0,filterOptions:["empty",{displayKey:"true",displayName:"True",predicate:(l,a)=>a,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(l,a)=>a===!1,numberOfInputs:0}]});break}case"date":{t.cellEditor="agDateCellEditor",t.keyCreator=l=>i(l.column,l.node,l.value),o&&n({valueFormatter:l=>{const a=i(l.column,l.node,l.value);return P(a)?a:r("blanks","(Blanks)")},treeList:!0,treeListFormatter:(l,a)=>{if(a===1&&l!=null){const d=kh[Number(l)-1];return r(d,Hh[d])}return l??r("blanks","(Blanks)")}});break}case"dateString":{t.cellEditor="agDateStringCellEditor",t.keyCreator=a=>i(a.column,a.node,a.value);const l=e.dateParser;n(o?{valueFormatter:a=>{const d=i(a.column,a.node,a.value);return P(d)?d:r("blanks","(Blanks)")},treeList:!0,treeListPathGetter:a=>{const d=l(a??void 0);return d?[String(d.getFullYear()),String(d.getMonth()+1),String(d.getDate())]:null},treeListFormatter:(a,d)=>{if(d===1&&a!=null){const h=kh[Number(a)-1];return r(h,Hh[h])}return a??r("blanks","(Blanks)")}}:{comparator:(a,d)=>{const h=l(d);return d==null||h<a?-1:h>a?1:0}});break}case"object":{t.cellEditorParams={useFormatter:!0},t.comparator=(l,a)=>{const d=this.columnModel.getPrimaryColumn(s),h=d==null?void 0:d.getColDef();if(!d||!h)return 0;const c=l==null?"":i(d,null,l),m=a==null?"":i(d,null,a);return c===m?0:c>m?1:-1},t.keyCreator=l=>i(l.column,l.node,l.value),o?n({valueFormatter:l=>{const a=i(l.column,l.node,l.value);return P(a)?a:r("blanks","(Blanks)")}}):t.filterValueGetter=l=>i(l.column,l.node,this.valueService.getValue(l.column,l.node));break}}}getDefaultDataTypes(){const t=s=>!!s.match("^\\d{4}-\\d{2}-\\d{2}$"),e=this.localeService.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:s=>{var i,o;return((o=(i=s.newValue)==null?void 0:i.trim)==null?void 0:o.call(i))===""?null:Number(s.newValue)},valueFormatter:s=>s.value==null?"":typeof s.value!="number"||isNaN(s.value)?e("invalidNumber","Invalid Number"):String(s.value),dataTypeMatcher:s=>typeof s=="number"},text:{baseDataType:"text",valueParser:s=>s.newValue===""?null:go(s.newValue),dataTypeMatcher:s=>typeof s=="string"},boolean:{baseDataType:"boolean",valueParser:s=>{var i,o;return s.newValue==null?s.newValue:((o=(i=s.newValue)==null?void 0:i.trim)==null?void 0:o.call(i))===""?null:String(s.newValue).toLowerCase()==="true"},valueFormatter:s=>s.value==null?"":String(s.value),dataTypeMatcher:s=>typeof s=="boolean"},date:{baseDataType:"date",valueParser:s=>ut(s.newValue==null?null:String(s.newValue)),valueFormatter:s=>{var i;return s.value==null?"":!(s.value instanceof Date)||isNaN(s.value.getTime())?e("invalidDate","Invalid Date"):(i=Pt(s.value,!1))!=null?i:""},dataTypeMatcher:s=>s instanceof Date},dateString:{baseDataType:"dateString",dateParser:s=>{var i;return(i=ut(s))!=null?i:void 0},dateFormatter:s=>{var i;return(i=Pt(s??null,!1))!=null?i:void 0},valueParser:s=>t(String(s.newValue))?s.newValue:null,valueFormatter:s=>t(String(s.value))?s.value:"",dataTypeMatcher:s=>typeof s=="string"&&t(s)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:s=>{var i;return(i=go(s.value))!=null?i:""}}}}};u([f("rowModel")],ui.prototype,"rowModel",2),u([f("columnModel")],ui.prototype,"columnModel",2),u([f("valueService")],ui.prototype,"valueService",2),u([M],ui.prototype,"init",1),ui=u([O("dataTypeService")],ui);var hi=class extends L{constructor(){super(...arguments),this.waitingForColumns=!1}postConstruct(){this.addManagedPropertyListener("columnDefs",t=>this.setColumnDefs(t))}start(){this.ctrlsService.whenReady(()=>{const t=this.gos.get("columnDefs");t?this.setColumnsAndData(t):this.waitingForColumns=!0,this.gridReady()})}setColumnsAndData(t){this.columnModel.setColumnDefs(t??[],"gridInitializing"),this.rowModel.start()}gridReady(){this.dispatchGridReadyEvent();const t=ne.__isRegistered("@ag-grid-enterprise/core",this.context.getGridId());new ca("AG Grid",()=>this.gos.get("debug")).log(`initialised successfully, enterprise = ${t}`)}dispatchGridReadyEvent(){const t={type:p.EVENT_GRID_READY};this.eventService.dispatchEvent(t)}setColumnDefs(t){const e=this.gos.get("columnDefs");if(e){if(this.waitingForColumns){this.waitingForColumns=!1,this.setColumnsAndData(e);return}this.columnModel.setColumnDefs(e,Ri(t.source))}}};u([f("ctrlsService")],hi.prototype,"ctrlsService",2),u([f("columnModel")],hi.prototype,"columnModel",2),u([f("rowModel")],hi.prototype,"rowModel",2),u([M],hi.prototype,"postConstruct",1),hi=u([O("syncService")],hi);var ci=class extends L{constructor(){super(...arguments),this.manuallyDisplayed=!1}postConstruct(){this.addManagedListener(this.eventService,p.EVENT_ROW_DATA_UPDATED,()=>this.onRowDataUpdated()),this.addManagedListener(this.eventService,p.EVENT_NEW_COLUMNS_LOADED,()=>this.onNewColumnsLoaded())}registerOverlayWrapperComp(t){this.overlayWrapperComp=t,(!this.gos.get("columnDefs")||this.gos.isRowModelType("clientSide")&&!this.gos.get("rowData"))&&this.showLoadingOverlay()}showLoadingOverlay(){if(this.gos.get("suppressLoadingOverlay"))return;const t={},e=this.userComponentFactory.getLoadingOverlayCompDetails(t);this.showOverlay(e,"ag-overlay-loading-wrapper","loadingOverlayComponentParams")}showNoRowsOverlay(){if(this.gos.get("suppressNoRowsOverlay"))return;const t={},e=this.userComponentFactory.getNoRowsOverlayCompDetails(t);this.showOverlay(e,"ag-overlay-no-rows-wrapper","noRowsOverlayComponentParams")}showOverlay(t,e,s){const i=t.newAgStackInstance(),o=this.addManagedPropertyListener(s,({currentValue:r})=>{i.then(n=>{n.refresh&&n.refresh(this.gos.addGridCommonParams(_({},r??{})))})});this.manuallyDisplayed=this.columnModel.isReady()&&!this.paginationProxy.isEmpty(),this.overlayWrapperComp.showOverlay(i,e,o)}hideOverlay(){this.manuallyDisplayed=!1,this.overlayWrapperComp.hideOverlay()}showOrHideOverlay(){const t=this.paginationProxy.isEmpty(),e=this.gos.get("suppressNoRowsOverlay");t&&!e?this.showNoRowsOverlay():this.hideOverlay()}onRowDataUpdated(){this.showOrHideOverlay()}onNewColumnsLoaded(){this.columnModel.isReady()&&!this.paginationProxy.isEmpty()&&!this.manuallyDisplayed&&this.hideOverlay()}};u([f("userComponentFactory")],ci.prototype,"userComponentFactory",2),u([f("paginationProxy")],ci.prototype,"paginationProxy",2),u([f("columnModel")],ci.prototype,"columnModel",2),u([M],ci.prototype,"postConstruct",1),ci=u([O("overlayService")],ci);var it=class extends L{constructor(){super(...arguments),this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=et(()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=et(()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),0),this.onRowSelectedDebounced=et(()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}postConstruct(){var t;this.isClientSideRowModel=this.rowModel.getType()==="clientSide",this.cachedState=(t=this.gos.get("initialState"))!=null?t:{},this.ctrlsService.whenReady(()=>this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnGridReady()));const e=this.addManagedListener(this.eventService,p.EVENT_NEW_COLUMNS_LOADED,({source:o})=>{o==="gridInitializing"&&(e==null||e(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnColumnsInitialised()))}),s=this.addManagedListener(this.eventService,p.EVENT_ROW_COUNT_READY,()=>{s==null||s(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnRowCountReady())}),i=this.addManagedListener(this.eventService,p.EVENT_FIRST_DATA_RENDERED,()=>{i==null||i(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnFirstDataRendered())})}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setupStateOnGridReady(){this.updateCachedState("sideBar",this.getSideBarState()),this.addManagedListener(this.eventService,p.EVENT_TOOL_PANEL_VISIBLE_CHANGED,()=>this.updateCachedState("sideBar",this.getSideBarState())),this.addManagedListener(this.eventService,p.EVENT_SIDE_BAR_UPDATED,()=>this.updateCachedState("sideBar",this.getSideBarState()))}setupStateOnColumnsInitialised(){var t;const e=(t=this.gos.get("initialState"))!=null?t:{};this.setColumnState(e),this.setColumnGroupState(e),this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState()),this.addManagedListener(this.eventService,p.EVENT_COLUMN_VALUE_CHANGED,()=>this.updateColumnState(["aggregation"])),this.addManagedListener(this.eventService,p.EVENT_COLUMN_MOVED,()=>this.updateColumnState(["columnOrder"])),this.addManagedListener(this.eventService,p.EVENT_COLUMN_PINNED,()=>this.updateColumnState(["columnPinning"])),this.addManagedListener(this.eventService,p.EVENT_COLUMN_RESIZED,()=>this.updateColumnState(["columnSizing"])),this.addManagedListener(this.eventService,p.EVENT_COLUMN_VISIBLE,()=>this.updateColumnState(["columnVisibility"])),this.addManagedListener(this.eventService,p.EVENT_COLUMN_PIVOT_CHANGED,()=>this.updateColumnState(["pivot"])),this.addManagedListener(this.eventService,p.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.updateColumnState(["pivot"])),this.addManagedListener(this.eventService,p.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.updateColumnState(["rowGroup"])),this.addManagedListener(this.eventService,p.EVENT_SORT_CHANGED,()=>this.updateColumnState(["sort"])),this.addManagedListener(this.eventService,p.EVENT_NEW_COLUMNS_LOADED,()=>this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","pivot","rowGroup","sort"])),this.addManagedListener(this.eventService,p.EVENT_COLUMN_GROUP_OPENED,()=>this.updateCachedState("columnGroup",this.getColumnGroupState()))}setupStateOnRowCountReady(){var t;const{filter:e,rowGroupExpansion:s,rowSelection:i,pagination:o}=(t=this.gos.get("initialState"))!=null?t:{},r=this.gos.get("advancedFilterModel");(e||r)&&this.setFilterState(e,r),s&&this.setRowGroupExpansionState(s),i&&this.setRowSelectionState(i),o&&this.setPaginationState(o),this.updateCachedState("filter",this.getFilterState()),this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowSelection",this.getRowSelectionState()),this.updateCachedState("pagination",this.getPaginationState()),this.addManagedListener(this.eventService,p.EVENT_FILTER_CHANGED,()=>this.updateCachedState("filter",this.getFilterState())),this.addManagedListener(this.eventService,p.EVENT_ROW_GROUP_OPENED,()=>this.onRowGroupOpenedDebounced()),this.addManagedListener(this.eventService,p.EVENT_EXPAND_COLLAPSE_ALL,()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState())),this.addManagedListener(this.eventService,p.EVENT_SELECTION_CHANGED,()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()}),this.addManagedListener(this.eventService,p.EVENT_PAGINATION_CHANGED,n=>{(n.newPage||n.newPageSize)&&this.updateCachedState("pagination",this.getPaginationState())})}setupStateOnFirstDataRendered(){var t;const{scroll:e,rangeSelection:s,focusedCell:i,columnOrder:o}=(t=this.gos.get("initialState"))!=null?t:{};i&&this.setFocusedCellState(i),s&&this.setRangeSelectionState(s),e&&this.setScrollState(e),this.setColumnPivotState(!!(o!=null&&o.orderedColIds)),this.updateCachedState("sideBar",this.getSideBarState()),this.updateCachedState("focusedCell",this.getFocusedCellState()),this.updateCachedState("rangeSelection",this.getRangeSelectionState()),this.updateCachedState("scroll",this.getScrollState()),this.addManagedListener(this.eventService,p.EVENT_CELL_FOCUSED,()=>this.updateCachedState("focusedCell",this.getFocusedCellState())),this.addManagedListener(this.eventService,p.EVENT_RANGE_SELECTION_CHANGED,r=>{r.finished&&this.updateCachedState("rangeSelection",this.getRangeSelectionState())}),this.addManagedListener(this.eventService,p.EVENT_BODY_SCROLL_END,()=>this.updateCachedState("scroll",this.getScrollState()))}getColumnState(){const t=this.columnModel.isPivotMode(),e=[],s=[],i=[],o=[],r=[],n=[],l=[],a=[],d=[],h=this.columnModel.getColumnState();for(let c=0;c<h.length;c++){const{colId:m,sort:C,sortIndex:v,rowGroup:S,rowGroupIndex:w,aggFunc:R,pivot:y,pivotIndex:b,pinned:T,hide:D,width:A,flex:F}=h[c];d.push(m),C&&(e[v??0]={colId:m,sort:C}),S&&(s[w??0]=m),typeof R=="string"&&i.push({colId:m,aggFunc:R}),y&&(o[b??0]=m),T&&(T==="right"?n:r).push(m),D&&l.push(m),(F||A)&&a.push({colId:m,flex:F??void 0,width:A})}return{sort:e.length?{sortModel:e}:void 0,rowGroup:s.length?{groupColIds:s}:void 0,aggregation:i.length?{aggregationModel:i}:void 0,pivot:o.length||t?{pivotMode:t,pivotColIds:o}:void 0,columnPinning:r.length||n.length?{leftColIds:r,rightColIds:n}:void 0,columnVisibility:l.length?{hiddenColIds:l}:void 0,columnSizing:a.length?{columnSizingModel:a}:void 0,columnOrder:d.length?{orderedColIds:d}:void 0}}setColumnState(t){const{sort:e,rowGroup:s,aggregation:i,pivot:o,columnPinning:r,columnVisibility:n,columnSizing:l,columnOrder:a}=t,d={},h=v=>{let S=d[v];return S||(S={colId:v},d[v]=S,S)};e&&e.sortModel.forEach(({colId:v,sort:S},w)=>{const R=h(v);R.sort=S,R.sortIndex=w}),s&&s.groupColIds.forEach((v,S)=>{const w=h(v);w.rowGroup=!0,w.rowGroupIndex=S}),i&&i.aggregationModel.forEach(({colId:v,aggFunc:S})=>{h(v).aggFunc=S}),o&&(o.pivotColIds.forEach((v,S)=>{const w=h(v);w.pivot=!0,w.pivotIndex=S}),this.gos.updateGridOptions({options:{pivotMode:o.pivotMode},source:"gridInitializing"})),r&&(r.leftColIds.forEach(v=>{h(v).pinned="left"}),r.rightColIds.forEach(v=>{h(v).pinned="right"})),n&&n.hiddenColIds.forEach(v=>{h(v).hide=!0}),l&&l.columnSizingModel.forEach(({colId:v,flex:S,width:w})=>{const R=h(v);R.flex=S??null,R.width=w});const c=a==null?void 0:a.orderedColIds,m=!!(c!=null&&c.length),C=m?c.map(v=>h(v)):Object.values(d);if(C.length){this.columnStates=C;const v={sort:null,sortIndex:null,rowGroup:null,rowGroupIndex:null,aggFunc:null,pivot:null,pivotIndex:null,pinned:null,hide:null,flex:null};this.columnModel.applyColumnState({state:C,applyOrder:m,defaultState:v},"gridInitializing")}}setColumnPivotState(t){const e=this.columnStates;this.columnStates=void 0;const s=this.columnGroupStates;if(this.columnGroupStates=void 0,!!this.columnModel.isSecondaryColumnsPresent()){if(e){let i=[];for(const o of e)this.columnModel.getSecondaryColumn(o.colId)&&i.push(o);this.columnModel.applyColumnState({state:i,applyOrder:t},"gridInitializing")}s&&this.columnModel.setColumnGroupState(s,"gridInitializing")}}getColumnGroupState(){const t=this.columnModel.getColumnGroupState(),e=[];return t.forEach(({groupId:s,open:i})=>{i&&e.push(s)}),e.length?{openColumnGroupIds:e}:void 0}setColumnGroupState(t){var e;if(!t.hasOwnProperty("columnGroup"))return;const s=new Set((e=t.columnGroup)==null?void 0:e.openColumnGroupIds),o=this.columnModel.getColumnGroupState().map(({groupId:r})=>{const n=s.has(r);return n&&s.delete(r),{groupId:r,open:n}});s.forEach(r=>{o.push({groupId:r,open:!0})}),o.length&&(this.columnGroupStates=o),this.columnModel.setColumnGroupState(o,"gridInitializing")}getFilterState(){var t;let e=this.filterManager.getFilterModel();e&&Object.keys(e).length===0&&(e=void 0);const s=(t=this.filterManager.getAdvancedFilterModel())!=null?t:void 0;return e||s?{filterModel:e,advancedFilterModel:s}:void 0}setFilterState(t,e){const{filterModel:s,advancedFilterModel:i}=t??{advancedFilterModel:e};s&&this.filterManager.setFilterModel(s,"columnFilter"),i&&this.filterManager.setAdvancedFilterModel(i)}getRangeSelectionState(){var t;const e=(t=this.rangeService)==null?void 0:t.getCellRanges().map(s=>{const{id:i,type:o,startRow:r,endRow:n,columns:l,startColumn:a}=s;return{id:i,type:o,startRow:r,endRow:n,colIds:l.map(d=>d.getColId()),startColId:a.getColId()}});return e!=null&&e.length?{cellRanges:e}:void 0}setRangeSelectionState(t){if(!this.gos.get("enableRangeSelection")||!this.rangeService)return;const e=[];t.cellRanges.forEach(s=>{const i=[];if(s.colIds.forEach(r=>{const n=this.columnModel.getGridColumn(r);n&&i.push(n)}),!i.length)return;let o=this.columnModel.getGridColumn(s.startColId);if(!o){const r=this.columnModel.getAllDisplayedColumns(),n=new Set(i);o=r.find(l=>n.has(l))}e.push(Ee(_({},s),{columns:i,startColumn:o}))}),this.rangeService.setCellRanges(e)}getScrollState(){var t,e,s;if(!this.isClientSideRowModel)return;const i=(t=this.ctrlsService.getGridBodyCtrl())==null?void 0:t.getScrollFeature(),{left:o}=(e=i==null?void 0:i.getHScrollPosition())!=null?e:{left:0},{top:r}=(s=i==null?void 0:i.getVScrollPosition())!=null?s:{top:0};return r||o?{top:r,left:o}:void 0}setScrollState(t){var e;if(!this.isClientSideRowModel)return;const{top:s,left:i}=t;(e=this.ctrlsService.getGridBodyCtrl())==null||e.getScrollFeature().setScrollPosition(s,i)}getSideBarState(){var t,e;return(e=(t=this.sideBarService)==null?void 0:t.getSideBarComp())==null?void 0:e.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const t=this.focusService.getFocusedCell();if(t){const{column:e,rowIndex:s,rowPinned:i}=t;return{colId:e.getColId(),rowIndex:s,rowPinned:i}}}setFocusedCellState(t){if(!this.isClientSideRowModel)return;const{colId:e,rowIndex:s,rowPinned:i}=t;this.focusService.setFocusedCell({column:this.columnModel.getGridColumn(e),rowIndex:s,rowPinned:i,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const t=this.paginationProxy.getCurrentPage(),e=this.gos.get("paginationAutoPageSize")?void 0:this.paginationProxy.getPageSize();if(!(!t&&!e))return{page:t,pageSize:e}}setPaginationState(t){t.pageSize&&!this.gos.get("paginationAutoPageSize")&&this.paginationProxy.setPageSize(t.pageSize,"initialState"),typeof t.page=="number"&&this.paginationProxy.setPage(t.page)}getRowSelectionState(){var t;const e=this.selectionService.getSelectionState();return!e||!Array.isArray(e)&&(e.selectAll===!1||e.selectAllChildren===!1)&&!((t=e==null?void 0:e.toggledNodes)!=null&&t.length)?void 0:e}setRowSelectionState(t){this.selectionService.setSelectionState(t,"gridInitializing")}getRowGroupExpansionState(){const t=this.expansionService.getExpandedRows();return t.length?{expandedRowGroupIds:t}:void 0}setRowGroupExpansionState(t){this.expansionService.expandRows(t.expandedRowGroupIds)}updateColumnState(t){const e=this.getColumnState();let s=!1;Object.entries(e).forEach(([i,o])=>{kn(o,this.cachedState[i])||(s=!0)}),this.cachedState=_(_({},this.cachedState),e),s&&this.dispatchStateUpdateEvent(t)}updateCachedState(t,e){const s=this.cachedState[t];this.setCachedStateValue(t,e),kn(e,s)||this.dispatchStateUpdateEvent([t])}setCachedStateValue(t,e){this.cachedState=Ee(_({},this.cachedState),{[t]:e})}refreshStaleState(){this.staleStateKeys.forEach(t=>{switch(t){case"rowSelection":this.setCachedStateValue(t,this.getRowSelectionState());break}}),this.staleStateKeys.clear()}dispatchStateUpdateEvent(t){this.suppressEvents||(t.forEach(e=>this.queuedUpdateSources.add(e)),this.dispatchStateUpdateEventDebounced())}dispatchQueuedStateUpdateEvents(){const t=Array.from(this.queuedUpdateSources);this.queuedUpdateSources.clear();const e={type:p.EVENT_STATE_UPDATED,sources:t,state:this.cachedState};this.eventService.dispatchEvent(e)}suppressEventsAndDispatchInitEvent(t){this.suppressEvents=!0,this.columnAnimationService.setSuppressAnimation(!0),t(),setTimeout(()=>{this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&(this.columnAnimationService.setSuppressAnimation(!1),this.dispatchStateUpdateEvent(["gridInitializing"]))})}};u([f("filterManager")],it.prototype,"filterManager",2),u([f("ctrlsService")],it.prototype,"ctrlsService",2),u([f("focusService")],it.prototype,"focusService",2),u([f("columnModel")],it.prototype,"columnModel",2),u([f("paginationProxy")],it.prototype,"paginationProxy",2),u([f("rowModel")],it.prototype,"rowModel",2),u([f("selectionService")],it.prototype,"selectionService",2),u([f("expansionService")],it.prototype,"expansionService",2),u([f("columnAnimationService")],it.prototype,"columnAnimationService",2),u([he("sideBarService")],it.prototype,"sideBarService",2),u([he("rangeService")],it.prototype,"rangeService",2),u([M],it.prototype,"postConstruct",1),it=u([O("stateService")],it);var sr=class extends L{init(){this.processGridOptions(this.gridOptions)}processGridOptions(t){this.processOptions(t,Km)}processColumnDefs(t){this.processOptions(t,Zi)}processOptions(t,e){const{validations:s,deprecations:i,allProperties:o,propertyExceptions:r,objectName:n,docsUrl:l}=e;o&&this.gridOptions.suppressPropertyNamesCheck!==!0&&this.checkProperties(t,[...r??[],...Object.keys(i)],o,n,l);const a=new Set;Object.keys(t).forEach(h=>{var c;const m=i[h];if(m)if("renamed"in m){const{renamed:b,version:T}=m;a.add(`As of v${T}, ${String(h)} is deprecated. Please use ${String(b)} instead.`),t[b]=t[h]}else{const{message:b,version:T}=m;a.add(`As of v${T}, ${String(h)} is deprecated. ${b??""}`)}const C=t[h];if(C==null||C===!1)return;const v=s[h];let S;if(v)if(typeof v=="function"){const b=v(t,this.gridOptions);if(!b)return;if("objectName"in b){const T=t[h];if(Array.isArray(T)){T.forEach(D=>{this.processOptions(D,b)});return}this.processOptions(t[h],b);return}S=b}else S=v;else return;const{module:w,dependencies:R,supportedRowModels:y}=S;if(y){const b=(c=this.gridOptions.rowModelType)!=null?c:"clientSide";if(!y.includes(b)){a.add(`${String(h)} is not supported with the '${b}' row model.`);return}}if(w){const b=Array.isArray(w)?w:[w];let T=!0;if(b.forEach(D=>{ne.__assertRegistered(D,String(h),this.context.getGridId())||(T=!1,a.add(`${String(h)} is only available when ${D} is loaded.`))}),!T)return}if(R){const b=this.checkForWarning(h,R,t);if(b){a.add(b);return}}}),a.size>0&&a.forEach(h=>{H(h)})}checkForWarning(t,e,s){if(typeof e=="function")return e(s,this.gridOptions);const o=Object.entries(e).find(([l,a])=>{const d=s[l];return!a.includes(d)});if(!o)return null;const[r,n]=o;return n.length>1?`'${String(t)}' requires '${r}' to be one of [${n.join(", ")}].`:`'${String(t)}' requires '${r}' to be ${n[0]}.`}checkProperties(t,e,s,i,o){const r=["__ob__","__v_skip","__metadata__"],n=Lu(Object.getOwnPropertyNames(t),[...r,...e,...s],s);if(je(n,(l,a)=>{H(`invalid ${i} property '${l}' did you mean any of these: ${a.slice(0,8).join(", ")}`)}),Object.keys(n).length>0&&o){const l=this.getFrameworkOverrides().getDocLink(o);H(`to see all the valid ${i} properties please check: ${l}`)}}};u([f("gridOptions")],sr.prototype,"gridOptions",2),u([M],sr.prototype,"init",1),sr=u([O("validationService")],sr);var En=class extends L{constructor(){super(...arguments),this.syncEventListeners=new Map,this.asyncEventListeners=new Map,this.syncGlobalEventListeners=new Set,this.globalEventListenerPairs=new Map}postConstruct(){this.frameworkEventWrappingService=new jn(this.getFrameworkOverrides())}addEventListener(t,e){const s=this.frameworkEventWrappingService.wrap(e),i=this.gos.useAsyncEvents()&&!Lr.has(t),o=i?this.asyncEventListeners:this.syncEventListeners;o.has(t)||o.set(t,new Set),o.get(t).add(s),this.eventService.addEventListener(t,s,i)}removeEventListener(t,e){var s;const i=this.frameworkEventWrappingService.unwrap(e),o=this.asyncEventListeners.get(t),r=!!(o!=null&&o.delete(i));r||(s=this.syncEventListeners.get(t))==null||s.delete(i),this.eventService.removeEventListener(t,i,r)}addGlobalListener(t){const e=this.frameworkEventWrappingService.wrapGlobal(t);if(this.gos.useAsyncEvents()){const i=(r,n)=>{Lr.has(r)&&e(r,n)},o=(r,n)=>{Lr.has(r)||e(r,n)};this.globalEventListenerPairs.set(t,{syncListener:i,asyncListener:o}),this.eventService.addGlobalListener(i,!1),this.eventService.addGlobalListener(o,!0)}else this.syncGlobalEventListeners.add(e),this.eventService.addGlobalListener(e,!1)}removeGlobalListener(t){const e=this.frameworkEventWrappingService.unwrapGlobal(t);if(this.globalEventListenerPairs.has(e)){const{syncListener:i,asyncListener:o}=this.globalEventListenerPairs.get(e);this.eventService.removeGlobalListener(i,!1),this.eventService.removeGlobalListener(o,!0),this.globalEventListenerPairs.delete(t)}else this.syncGlobalEventListeners.delete(e),this.eventService.removeGlobalListener(e,!1)}destroyEventListeners(t,e){t.forEach((s,i)=>{s.forEach(o=>this.eventService.removeEventListener(i,o,e)),s.clear()}),t.clear()}destroyGlobalListeners(t,e){t.forEach(s=>this.eventService.removeGlobalListener(s,e)),t.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncEventListeners,!1),this.destroyEventListeners(this.asyncEventListeners,!0),this.destroyGlobalListeners(this.syncGlobalEventListeners,!1),this.globalEventListenerPairs.forEach(({syncListener:t,asyncListener:e})=>{this.eventService.removeGlobalListener(t,!1),this.eventService.removeGlobalListener(e,!0)}),this.globalEventListenerPairs.clear()}};u([M],En.prototype,"postConstruct",1),En=u([O("apiEventService")],En);var ba=class extends K{constructor(){super('<span class="ag-paging-page-size"></span>'),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const t=this.selectPageSizeComp.getValue();if(!t)return;const e=Number(t);isNaN(e)||e<1||e===this.paginationProxy.getPageSize()||(this.paginationProxy.setPageSize(e,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}init(){this.addManagedPropertyListener("paginationPageSizeSelector",()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedListener(this.eventService,p.EVENT_PAGINATION_CHANGED,t=>this.handlePaginationChanged(t))}handlePaginationChanged(t){if(!this.selectPageSizeComp||!(t!=null&&t.newPageSize))return;const e=this.paginationProxy.getPageSize();this.getPageSizeSelectorValues().includes(e)?this.selectPageSizeComp.setValue(e.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(t){this.selectPageSizeComp&&this.reset(),t&&(this.reloadPageSizesSelector(),this.selectPageSizeComp&&this.appendChild(this.selectPageSizeComp))}reset(){Le(this.getGui()),this.selectPageSizeComp&&(this.destroyBean(this.selectPageSizeComp),this.selectPageSizeComp=void 0)}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel")&&!this.gos.get("paginationAutoPageSize")&&this.gos.get("paginationPageSizeSelector")!==!1}reloadPageSizesSelector(){const t=this.getPageSizeSelectorValues(),e=this.paginationProxy.getPageSize(),s=!e||!t.includes(e);s&&(t.unshift(""),H(`The paginationPageSize grid option is set to a value that is not in the list of page size options.
326
+ Please make sure that the paginationPageSize grid option is set to one of the values in the
327
+ paginationPageSizeSelector array, or set the paginationPageSizeSelector to false to hide the page size selector.`)),this.selectPageSizeComp&&(this.destroyBean(this.selectPageSizeComp),this.selectPageSizeComp=void 0);const i=this.localeService.getLocaleTextFunc(),o=i("pageSizeSelectorLabel","Page Size:"),r=t.map(l=>({value:String(l),text:String(l)})),n=i("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new Yr).addOptions(r).setValue(String(s?"":e)).setAriaLabel(n).setLabel(o).onValueChange(()=>this.handlePageSizeItemSelected()),this.hasEmptyOption=s}getPageSizeSelectorValues(){const t=[20,50,100],e=this.gos.get("paginationPageSizeSelector");return!Array.isArray(e)||!this.validateValues(e)?t:[...e].sort((s,i)=>s-i)}validateValues(t){if(!t.length)return H(`The paginationPageSizeSelector grid option is an empty array. This is most likely a mistake.
328
+ If you want to hide the page size selector, please set the paginationPageSizeSelector to false.`),!1;for(let e=0;e<t.length;e++){const s=t[e],i=typeof s=="number",o=s>0;if(!i)return H(`The paginationPageSizeSelector grid option contains a non-numeric value.
329
+ Please make sure that all values in the paginationPageSizeSelector array are numbers.`),!1;if(!o)return H(`The paginationPageSizeSelector grid option contains a negative number or zero.
330
+ Please make sure that all values in the paginationPageSizeSelector array are positive.`),!1}return!0}destroy(){this.toggleSelectDisplay(!1),super.destroy()}};u([f("paginationProxy")],ba.prototype,"paginationProxy",2),u([M],ba.prototype,"init",1);var ir=class extends L{constructor(){super(),this.descriptionContainer=null,this.announceValue=et(this.announceValue.bind(this),200)}postConstruct(){const t=this.gos.getDocument(),e=this.descriptionContainer=t.createElement("div");e.classList.add("ag-aria-description-container"),il(e,"polite"),iu(e,"additions text"),su(e,!0),this.eGridDiv.appendChild(e)}announceValue(t){this.descriptionContainer&&(this.descriptionContainer.textContent="",setTimeout(()=>{this.isAlive()&&this.descriptionContainer&&(this.descriptionContainer.textContent=t)},50))}destroy(){super.destroy();const{descriptionContainer:t}=this;t&&(Le(t),t.parentElement&&t.parentElement.removeChild(t)),this.descriptionContainer=null,this.eGridDiv=null}};u([f("eGridDiv")],ir.prototype,"eGridDiv",2),u([M],ir.prototype,"postConstruct",1),ir=u([O("ariaAnnouncementService")],ir);var Ta=class{};Ta.gridOptions=void 0;var jm=1,qm=class{create(t,e,s,i,o){var r;let n={};Ta.gridOptions?(at(n,Ta.gridOptions,!0,!0),n=_(_({},n),e)):n=e;const l=le.getCoercedGridOptions(n),a=!!l.debug,d=(r=l.gridId)!=null?r:String(jm++),h=this.getRegisteredModules(o,d),c=this.createBeansList(l.rowModelType,h,d),m=this.createProvidedBeans(t,l,o);if(!c){Os("Failed to create grid.");return}const C={providedBeanInstances:m,beanClasses:c,debug:a,gridId:d},v=new ca("Context",()=>C.debug),S=new ig(C,v),w=S.getBean("beans");return this.registerModuleUserComponents(w,h),this.registerStackComponents(w,h),this.registerControllers(w,h),s(S),w.syncService.start(),i&&i(S),S.getBean("gridApi")}registerControllers(t,e){e.forEach(s=>{s.controllers&&s.controllers.forEach(i=>t.ctrlsFactory.register(i))})}registerStackComponents(t,e){const s=this.createAgStackComponentsList(e);t.agStackComponentsRegistry.setupComponents(s)}getRegisteredModules(t,e){const s=t?t.modules:null,i=ne.__getRegisteredModules(e),o=[],r={},n=(l,a,d)=>{(c=>{r[c.moduleName]||(r[c.moduleName]=!0,o.push(c),ne.__register(c,l,d))})(a),a.dependantModules&&a.dependantModules.forEach(c=>n(l,c,d))};return s&&s.forEach(l=>n(!0,l,e)),i&&i.forEach(l=>n(!ne.__isPackageBased(),l,void 0)),o}registerModuleUserComponents(t,e){this.extractModuleEntity(e,i=>i.userComponents?i.userComponents:[]).forEach(i=>{t.userComponentRegistry.registerDefaultComponent(i.componentName,i.componentClass)})}createProvidedBeans(t,e,s){let i=s?s.frameworkOverrides:null;z(i)&&(i=new Nh);const o={gridOptions:e,eGridDiv:t,globalEventListener:s?s.globalEventListener:null,globalSyncEventListener:s?s.globalSyncEventListener:null,frameworkOverrides:i};return s&&s.providedBeanInstances&&Object.assign(o,s.providedBeanInstances),o}createAgStackComponentsList(t){let e=[{componentName:"AgCheckbox",componentClass:jr},{componentName:"AgRadioButton",componentClass:ju},{componentName:"AgToggleButton",componentClass:Fh},{componentName:"AgInputTextField",componentClass:Us},{componentName:"AgInputTextArea",componentClass:Cm},{componentName:"AgInputNumberField",componentClass:Bl},{componentName:"AgInputDateField",componentClass:vm},{componentName:"AgInputRange",componentClass:wm},{componentName:"AgRichSelect",componentClass:gn},{componentName:"AgSelect",componentClass:Yr},{componentName:"AgSlider",componentClass:Em},{componentName:"AgGridBody",componentClass:Bt},{componentName:"AgHeaderRoot",componentClass:gm},{componentName:"AgSortIndicator",componentClass:zl},{componentName:"AgPagination",componentClass:ft},{componentName:"AgPageSizeSelector",componentClass:ba},{componentName:"AgOverlayWrapper",componentClass:Om},{componentName:"AgGroupComponent",componentClass:ym},{componentName:"AgRowContainer",componentClass:xi},{componentName:"AgFakeHorizontalScroll",componentClass:_m},{componentName:"AgFakeVerticalScroll",componentClass:Ym},{componentName:"AgAutocomplete",componentClass:Pm}];const s=this.extractModuleEntity(t,i=>i.agStackComponents?i.agStackComponents:[]);return e=e.concat(s),e}createBeansList(t="clientSide",e,s){const i=e.filter(a=>!a.rowModel||a.rowModel===t),o={clientSide:"@ag-grid-community/client-side-row-model",infinite:"@ag-grid-community/infinite-row-model",serverSide:"@ag-grid-enterprise/server-side-row-model",viewport:"@ag-grid-enterprise/viewport-row-model"};if(!o[t]){Os("Could not find row model for rowModelType = "+t);return}if(!ne.__assertRegistered(o[t],`rowModelType = '${t}'`,s))return;const r=[q,Qi,va,$o,Ki,Z,Zr,Sn,Qo,la,Ss,ji,Ho,ya,sr,Uo,xo,el,Gt,le,gs,ri,Mt,Ue,ti,zo,yt,Cn,mo,oi,Xe,wn,Ps,vn,si,Rs,j,zi,me,cs,Xo,As,pn,Ni,ni,pa,qo,qi,Co,Yi,Hi,Jt,tl,Sa,er,Xt,Xi,li,tr,Ji,Ea,ui,pt,hi,ci,it,Bo,En,ir,It],n=this.extractModuleEntity(i,a=>a.beans?a.beans:[]);r.push(...n);const l=[];return r.forEach(a=>{l.indexOf(a)<0&&l.push(a)}),l}extractModuleEntity(t,e){return[].concat(...t.map(e))}},Qm=class{wrap(t,e,s=[],i){const o=this.createWrapper(t,i);return e.forEach(r=>{this.createMethod(o,r,!0)}),s.forEach(r=>{this.createMethod(o,r,!1)}),o}unwrap(t){return t}createMethod(t,e,s){t.addMethod(e,this.createMethodProxy(t,e,s))}createMethodProxy(t,e,s){return function(){return t.hasMethod(e)?t.callMethod(e,arguments):(s&&console.warn("AG Grid: Framework component is missing the method "+e+"()"),null)}}},$i=typeof global>"u"?{}:global;$i.HTMLElement=typeof HTMLElement>"u"?{}:HTMLElement,$i.HTMLButtonElement=typeof HTMLButtonElement>"u"?{}:HTMLButtonElement,$i.HTMLSelectElement=typeof HTMLSelectElement>"u"?{}:HTMLSelectElement,$i.HTMLInputElement=typeof HTMLInputElement>"u"?{}:HTMLInputElement,$i.Node=typeof Node>"u"?{}:Node,$i.MouseEvent=typeof MouseEvent>"u"?{}:MouseEvent;var Da=class gr{constructor(e,s,i,o,r,n){this.nextId=0,this.rowCountReady=!1,this.allNodesMap={},this.rootNode=e,this.gos=s,this.eventService=i,this.columnModel=o,this.beans=n,this.selectionService=r,this.rootNode.group=!0,this.rootNode.level=-1,this.rootNode.id=gr.ROOT_NODE_ID,this.rootNode.allLeafChildren=[],this.rootNode.childrenAfterGroup=[],this.rootNode.childrenAfterSort=[],this.rootNode.childrenAfterAggFilter=[],this.rootNode.childrenAfterFilter=[]}getCopyOfNodesMap(){return W.cloneObject(this.allNodesMap)}getRowNode(e){return this.allNodesMap[e]}setRowData(e){if(typeof e=="string"){console.warn("AG Grid: rowData must be an array.");return}this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(e);const s=this.rootNode,i=this.rootNode.sibling;s.childrenAfterFilter=null,s.childrenAfterGroup=null,s.childrenAfterAggFilter=null,s.childrenAfterSort=null,s.childrenMapped=null,s.updateHasChildren(),this.nextId=0,this.allNodesMap={},e?s.allLeafChildren=e.map(o=>this.createNode(o,this.rootNode,gr.TOP_LEVEL)):(s.allLeafChildren=[],s.childrenAfterGroup=[]),i&&(i.childrenAfterFilter=s.childrenAfterFilter,i.childrenAfterGroup=s.childrenAfterGroup,i.childrenAfterAggFilter=s.childrenAfterAggFilter,i.childrenAfterSort=s.childrenAfterSort,i.childrenMapped=s.childrenMapped,i.allLeafChildren=s.allLeafChildren)}updateRowData(e,s){this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(e.add);const i={remove:[],update:[],add:[]},o=[];return this.executeRemove(e,i,o),this.executeUpdate(e,i,o),this.executeAdd(e,i),this.updateSelection(o,"rowDataChanged"),s&&W.sortRowNodesByOrder(this.rootNode.allLeafChildren,s),i}isRowCountReady(){return this.rowCountReady}dispatchRowDataUpdateStartedEvent(e){const s={type:p.EVENT_ROW_DATA_UPDATE_STARTED,firstRowData:e!=null&&e.length?e[0]:null};this.eventService.dispatchEvent(s)}updateSelection(e,s){const i=e.length>0;if(i&&this.selectionService.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:s}),this.selectionService.updateGroupsFromChildrenSelections(s),i){const o={type:p.EVENT_SELECTION_CHANGED,source:s};this.eventService.dispatchEvent(o)}}executeAdd(e,s){var i;const{add:o,addIndex:r}=e;if(W.missingOrEmpty(o))return;const n=o.map(l=>this.createNode(l,this.rootNode,gr.TOP_LEVEL));if(typeof r=="number"&&r>=0){const{allLeafChildren:l}=this.rootNode,a=l.length;let d=r;if(this.gos.get("treeData")&&r>0&&a>0){for(let C=0;C<a;C++)if(((i=l[C])==null?void 0:i.rowIndex)==r-1){d=C+1;break}}const c=l.slice(0,d),m=l.slice(d,l.length);this.rootNode.allLeafChildren=[...c,...n,...m]}else this.rootNode.allLeafChildren=[...this.rootNode.allLeafChildren,...n];this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren),s.add=n}executeRemove(e,s,i){const{remove:o}=e;if(W.missingOrEmpty(o))return;const r={};o.forEach(n=>{const l=this.lookupRowNode(n);l&&(l.isSelected()&&i.push(l),l.clearRowTopAndRowIndex(),r[l.id]=!0,delete this.allNodesMap[l.id],s.remove.push(l))}),this.rootNode.allLeafChildren=this.rootNode.allLeafChildren.filter(n=>!r[n.id]),this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren)}executeUpdate(e,s,i){const{update:o}=e;W.missingOrEmpty(o)||o.forEach(r=>{const n=this.lookupRowNode(r);n&&(n.updateData(r),!n.selectable&&n.isSelected()&&i.push(n),this.setMasterForRow(n,r,gr.TOP_LEVEL,!1),s.update.push(n))})}lookupRowNode(e){const s=this.gos.getCallback("getRowId");let i;if(s){const o=s({data:e,level:0});if(i=this.allNodesMap[o],!i)return console.error(`AG Grid: could not find row id=${o}, data item was not found for this id`),null}else if(i=this.rootNode.allLeafChildren.find(o=>o.data===e),!i)return console.error("AG Grid: could not find data item as object was not found",e),console.error("Consider using getRowId to help the Grid find matching row data"),null;return i||null}createNode(e,s,i){const o=new J(this.beans);o.group=!1,this.setMasterForRow(o,e,i,!0);const r=this.gos.get("suppressParentsInRowNodes");return s&&!r&&(o.parent=s),o.level=i,o.setDataAndId(e,this.nextId.toString()),this.allNodesMap[o.id]&&console.warn(`AG Grid: duplicate node id '${o.id}' detected from getRowId callback, this could cause issues in your grid.`),this.allNodesMap[o.id]=o,this.nextId++,o}setMasterForRow(e,s,i,o){if(this.gos.get("treeData"))e.setMaster(!1),o&&(e.expanded=!1);else{if(this.gos.get("masterDetail")){const l=this.gos.get("isRowMaster");l?e.setMaster(l(s)):e.setMaster(!0)}else e.setMaster(!1);if(o){const l=this.columnModel.getRowGroupColumns(),a=l?l.length:0,d=i+a;e.expanded=e.master?this.isExpanded(d):!1}}}isExpanded(e){const s=this.gos.get("groupDefaultExpanded");return s===-1?!0:e<s}};Da.TOP_LEVEL=0,Da.ROOT_NODE_ID="ROOT_NODE_ID";var Xm=Da,ot=class extends L{constructor(){super(...arguments),this.onRowHeightChanged_debounced=W.debounce(this.onRowHeightChanged.bind(this),100),this.rowsToDisplay=[],this.hasStarted=!1,this.shouldSkipSettingDataOnStart=!1,this.isRefreshingModel=!1,this.rowCountReady=!1}init(){const t=this.refreshModel.bind(this,{step:"group"}),e=!this.gos.get("suppressAnimationFrame"),s=this.refreshModel.bind(this,{step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:e});this.addManagedListener(this.eventService,p.EVENT_NEW_COLUMNS_LOADED,s),this.addManagedListener(this.eventService,p.EVENT_COLUMN_ROW_GROUP_CHANGED,t),this.addManagedListener(this.eventService,p.EVENT_COLUMN_VALUE_CHANGED,this.onValueChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_COLUMN_PIVOT_CHANGED,this.refreshModel.bind(this,{step:"pivot"})),this.addManagedListener(this.eventService,p.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_COLUMN_PIVOT_MODE_CHANGED,t),this.addManagedListener(this.eventService,p.EVENT_GRID_STYLES_CHANGED,this.onGridStylesChanges.bind(this)),this.addManagedListener(this.eventService,p.EVENT_GRID_READY,()=>this.onGridReady()),this.addPropertyListeners(),this.rootNode=new J(this.beans),this.nodeManager=new Xm(this.rootNode,this.gos,this.eventService,this.columnModel,this.selectionService,this.beans)}addPropertyListeners(){const t=new Set(["treeData","masterDetail"]),e=new Set(["suppressParentsInRowNodes","groupDefaultExpanded","groupAllowUnbalanced","initialGroupOrderComparator","groupHideOpenParents","groupDisplayType"]),s=new Set(["excludeChildrenWhenTreeDataFiltering"]),i=new Set(["removePivotHeaderRowWhenSingleValueColumn","pivotRowTotals","pivotColumnGroupTotals","suppressExpandablePivotGroups"]),o=new Set(["getGroupRowAgg","alwaysAggregateAtRootLevel","groupIncludeTotalFooter","suppressAggFilteredOnly","grandTotalRow"]),r=new Set(["postSortRows","groupDisplayType","accentedSort"]),n=new Set([]),l=new Set(["groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupIncludeFooter","groupTotalRow"]),a=[...t,...e,...s,...i,...i,...o,...r,...n,...l];this.addManagedPropertyListeners(a,d=>{var h;const c=(h=d.changeSet)==null?void 0:h.properties;if(!c)return;const m=C=>c.some(v=>C.has(v));if(m(t)){this.setRowData(this.rootNode.allLeafChildren.map(C=>C.data));return}if(m(e)){this.refreshModel({step:"group"});return}if(m(s)){this.refreshModel({step:"filter"});return}if(m(i)){this.refreshModel({step:"pivot"});return}if(m(o)){this.refreshModel({step:"aggregate"});return}if(m(r)){this.refreshModel({step:"sort"});return}if(m(n)){this.refreshModel({step:"filter_aggregates"});return}m(l)&&this.refreshModel({step:"map"})}),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){this.hasStarted=!0,this.shouldSkipSettingDataOnStart?this.dispatchUpdateEventsAndRefresh():this.setInitialData()}setInitialData(){const t=this.gos.get("rowData");t&&(this.shouldSkipSettingDataOnStart=!0,this.setRowData(t))}ensureRowHeightsValid(t,e,s,i){let o,r=!1;do{o=!1;const n=this.getRowIndexAtPixel(t),l=this.getRowIndexAtPixel(e),a=Math.max(n,s),d=Math.min(l,i);for(let h=a;h<=d;h++){const c=this.getRow(h);if(c.rowHeightEstimated){const m=this.gos.getRowHeightForNode(c);c.setRowHeight(m.height),o=!0,r=!0}}o&&this.setRowTopAndRowIndex()}while(o);return r}setRowTopAndRowIndex(){const t=this.environment.getDefaultRowHeight();let e=0;const s=new Set,i=this.gos.isDomLayout("normal");for(let o=0;o<this.rowsToDisplay.length;o++){const r=this.rowsToDisplay[o];if(r.id!=null&&s.add(r.id),r.rowHeight==null){const n=this.gos.getRowHeightForNode(r,i,t);r.setRowHeight(n.height,n.estimated)}r.setRowTop(e),r.setRowIndex(o),e+=r.rowHeight}return s}clearRowTopAndRowIndex(t,e){const s=t.isActive(),i=r=>{r&&r.id!=null&&!e.has(r.id)&&r.clearRowTopAndRowIndex()},o=r=>{if(i(r),i(r.detailNode),i(r.sibling),r.hasChildren()&&r.childrenAfterGroup){const n=r.level==-1;s&&!n&&!r.expanded||r.childrenAfterGroup.forEach(o)}};o(this.rootNode)}ensureRowsAtPixel(t,e,s=0){const i=this.getRowIndexAtPixel(e),o=this.getRow(i),r=!this.gos.get("suppressAnimationFrame");return o===t[0]?!1:(t.forEach(n=>{W.removeFromArray(this.rootNode.allLeafChildren,n)}),t.forEach((n,l)=>{W.insertIntoArray(this.rootNode.allLeafChildren,n,Math.max(i+s,0)+l)}),this.refreshModel({step:"group",keepRenderedRows:!0,keepEditingRows:!0,animate:r}),!0)}highlightRowAtPixel(t,e){const s=e!=null?this.getRowIndexAtPixel(e):null,i=s!=null?this.getRow(s):null;if(!i||!t||i===t||e==null){this.lastHighlightedRow&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null);return}const o=this.getHighlightPosition(e,i);this.lastHighlightedRow&&this.lastHighlightedRow!==i&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null),i.setHighlighted(o),this.lastHighlightedRow=i}getHighlightPosition(t,e){if(!e){const o=this.getRowIndexAtPixel(t);if(e=this.getRow(o||0),!e)return 1}const{rowTop:s,rowHeight:i}=e;return t-s<i/2?0:1}getLastHighlightedRowNode(){return this.lastHighlightedRow}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay?this.rowsToDisplay.length:0}getTopLevelRowCount(){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return 1;const e=this.rootNode.childrenAfterAggFilter;return e?e.length:0}getTopLevelRowDisplayedIndex(t){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return t;let s=this.rootNode.childrenAfterSort[t];if(this.gos.get("groupHideOpenParents"))for(;s.expanded&&s.childrenAfterSort&&s.childrenAfterSort.length>0;)s=s.childrenAfterSort[0];return s.rowIndex}getRowBounds(t){if(W.missing(this.rowsToDisplay))return null;const e=this.rowsToDisplay[t];return e?{rowTop:e.rowTop,rowHeight:e.rowHeight}:null}onRowGroupOpened(){const t=this.gos.isAnimateRows();this.refreshModel({step:"map",keepRenderedRows:!0,animate:t})}onFilterChanged(t){if(t.afterDataChange)return;const e=this.gos.isAnimateRows(),i=t.columns.length===0||t.columns.some(o=>o.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:i,keepRenderedRows:!0,animate:e})}onSortChanged(){const t=this.gos.isAnimateRows();this.refreshModel({step:"sort",keepRenderedRows:!0,animate:t,keepEditingRows:!0})}getType(){return"clientSide"}onValueChanged(){this.columnModel.isPivotActive()?this.refreshModel({step:"pivot"}):this.refreshModel({step:"aggregate"})}createChangePath(t){const e=W.missingOrEmpty(t),s=new cn(!1,this.rootNode);return(e||this.gos.get("treeData"))&&s.setInactive(),s}isSuppressModelUpdateAfterUpdateTransaction(t){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction")||t.rowNodeTransactions==null)return!1;const e=t.rowNodeTransactions.filter(i=>i.add!=null&&i.add.length>0||i.remove!=null&&i.remove.length>0);return e==null||e.length==0}buildRefreshModelParams(t){let e="group";const s={everything:"group",group:"group",filter:"filter",map:"map",aggregate:"aggregate",sort:"sort",pivot:"pivot"};if(W.exists(t)&&(e=s[t]),W.missing(e)){console.error(`AG Grid: invalid step ${t}, available steps are ${Object.keys(s).join(", ")}`);return}const i=!this.gos.get("suppressAnimationFrame");return{step:e,keepRenderedRows:!0,keepEditingRows:!0,animate:i}}refreshModel(t){if(!this.hasStarted||this.isRefreshingModel||this.columnModel.shouldRowModelIgnoreRefresh())return;let e=typeof t=="object"&&"step"in t?t:this.buildRefreshModelParams(t);if(!e||this.isSuppressModelUpdateAfterUpdateTransaction(e))return;const s=this.createChangePath(e.rowNodeTransactions);switch(this.isRefreshingModel=!0,e.step){case"group":this.doRowGrouping(e.rowNodeTransactions,e.rowNodeOrder,s,!!e.afterColumnsChanged);case"filter":this.doFilter(s);case"pivot":this.doPivot(s);case"aggregate":this.doAggregate(s);case"filter_aggregates":this.doFilterAggregates(s);case"sort":this.doSort(e.rowNodeTransactions,s);case"map":this.doRowsToDisplay()}const i=this.setRowTopAndRowIndex();this.clearRowTopAndRowIndex(s,i),this.isRefreshingModel=!1;const o={type:p.EVENT_MODEL_UPDATED,animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:!1,keepUndoRedoStack:e.keepUndoRedoStack};this.eventService.dispatchEvent(o)}isEmpty(){const t=W.missing(this.rootNode.allLeafChildren)||this.rootNode.allLeafChildren.length===0;return W.missing(this.rootNode)||t||!this.columnModel.isReady()}isRowsToRender(){return W.exists(this.rowsToDisplay)&&this.rowsToDisplay.length>0}getNodesInRangeForSelection(t,e){let s=!e,i=!1;const o=[],r=this.gos.get("groupSelectsChildren");return this.forEachNodeAfterFilterAndSort(n=>{if(i)return;if(s&&(n===e||n===t)&&(i=!0,n.group&&r)){o.push(...n.allLeafChildren);return}if(!s){if(n!==e&&n!==t)return;s=!0}if(!n.group||!r){o.push(n);return}}),o}setDatasource(t){console.error("AG Grid: should never call setDatasource on clientSideRowController")}getTopLevelNodes(){return this.rootNode?this.rootNode.childrenAfterGroup:null}getRootNode(){return this.rootNode}getRow(t){return this.rowsToDisplay[t]}isRowPresent(t){return this.rowsToDisplay.indexOf(t)>=0}getRowIndexAtPixel(t){if(this.isEmpty()||this.rowsToDisplay.length===0)return-1;let e=0,s=this.rowsToDisplay.length-1;if(t<=0)return 0;if(W.last(this.rowsToDisplay).rowTop<=t)return this.rowsToDisplay.length-1;let o=-1,r=-1;for(;;){const n=Math.floor((e+s)/2),l=this.rowsToDisplay[n];if(this.isRowInPixel(l,t)||(l.rowTop<t?e=n+1:l.rowTop>t&&(s=n-1),o===e&&r===s))return n;o=e,r=s}}isRowInPixel(t,e){const s=t.rowTop,i=t.rowTop+t.rowHeight;return s<=e&&i>e}forEachLeafNode(t){this.rootNode.allLeafChildren&&this.rootNode.allLeafChildren.forEach((e,s)=>t(e,s))}forEachNode(t,e=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterGroup||[]],callback:t,recursionType:0,index:0,includeFooterNodes:e})}forEachNodeAfterFilter(t,e=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterAggFilter||[]],callback:t,recursionType:1,index:0,includeFooterNodes:e})}forEachNodeAfterFilterAndSort(t,e=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterSort||[]],callback:t,recursionType:2,index:0,includeFooterNodes:e})}forEachPivotNode(t,e=!1){this.recursivelyWalkNodesAndCallback({nodes:[this.rootNode],callback:t,recursionType:3,index:0,includeFooterNodes:e})}recursivelyWalkNodesAndCallback(t){const{nodes:e,callback:s,recursionType:i,includeFooterNodes:o}=t;let{index:r}=t;const n=l=>{var a;const d=(a=e[0])==null?void 0:a.parent;if(!d)return;const h=o&&this.gos.getGrandTotalRow(),c=this.gos.getGroupTotalRowCallback(),m=o&&c({node:d});if(d===this.rootNode){h===l&&(d.createFooter(),s(d.sibling,r++));return}m===l&&(d.createFooter(),s(d.sibling,r++))};n("top");for(let l=0;l<e.length;l++){const a=e[l];if(s(a,r++),a.hasChildren()&&!a.footer){let d=null;switch(i){case 0:d=a.childrenAfterGroup;break;case 1:d=a.childrenAfterAggFilter;break;case 2:d=a.childrenAfterSort;break;case 3:d=a.leafGroup?null:a.childrenAfterSort;break}d&&(r=this.recursivelyWalkNodesAndCallback({nodes:[...d],callback:s,recursionType:i,index:r,includeFooterNodes:o}))}}return n("bottom"),r}doAggregate(t){var e;(e=this.aggregationStage)==null||e.execute({rowNode:this.rootNode,changedPath:t})}doFilterAggregates(t){this.filterAggregatesStage?this.filterAggregatesStage.execute({rowNode:this.rootNode,changedPath:t}):this.rootNode.childrenAfterAggFilter=this.rootNode.childrenAfterFilter}expandOrCollapseAll(t){const e=this.gos.get("treeData"),s=this.columnModel.isPivotActive(),i=n=>{n&&n.forEach(l=>{const a=()=>{l.expanded=t,i(l.childrenAfterGroup)};if(e){W.exists(l.childrenAfterGroup)&&a();return}if(s){!l.leafGroup&&a();return}l.group&&a()})};this.rootNode&&i(this.rootNode.childrenAfterGroup),this.refreshModel({step:"map"});const o=t?"expandAll":"collapseAll",r={type:p.EVENT_EXPAND_COLLAPSE_ALL,source:o};this.eventService.dispatchEvent(r)}doSort(t,e){this.sortStage.execute({rowNode:this.rootNode,rowNodeTransactions:t,changedPath:e})}doRowGrouping(t,e,s,i){if(this.groupStage){if(t?this.groupStage.execute({rowNode:this.rootNode,rowNodeTransactions:t,rowNodeOrder:e,changedPath:s}):this.groupStage.execute({rowNode:this.rootNode,changedPath:s,afterColumnsChanged:i}),this.gos.get("groupSelectsChildren")&&this.selectionService.updateGroupsFromChildrenSelections("rowGroupChanged",s)){const r={type:p.EVENT_SELECTION_CHANGED,source:"rowGroupChanged"};this.eventService.dispatchEvent(r)}}else this.rootNode.childrenAfterGroup=this.rootNode.allLeafChildren,this.rootNode.sibling&&(this.rootNode.sibling.childrenAfterGroup=this.rootNode.childrenAfterGroup),this.rootNode.updateHasChildren();this.nodeManager.isRowCountReady()&&(this.rowCountReady=!0,this.eventService.dispatchEventOnce({type:p.EVENT_ROW_COUNT_READY}))}doFilter(t){this.filterStage.execute({rowNode:this.rootNode,changedPath:t})}doPivot(t){var e;(e=this.pivotStage)==null||e.execute({rowNode:this.rootNode,changedPath:t})}getCopyOfNodesMap(){return this.nodeManager.getCopyOfNodesMap()}getRowNode(t){if(typeof t=="string"&&t.indexOf(J.ID_PREFIX_ROW_GROUP)==0){let s;return this.forEachNode(i=>{i.id===t&&(s=i)}),s}return this.nodeManager.getRowNode(t)}setRowData(t){this.selectionService.reset("rowDataChanged"),this.nodeManager.setRowData(t),this.hasStarted&&this.dispatchUpdateEventsAndRefresh()}dispatchUpdateEventsAndRefresh(){const t={type:p.EVENT_ROW_DATA_UPDATED};this.eventService.dispatchEvent(t),this.refreshModel({step:"group",newData:!0})}batchUpdateRowData(t,e){if(this.applyAsyncTransactionsTimeout==null){this.rowDataTransactionBatch=[];const s=this.gos.getAsyncTransactionWaitMillis();this.applyAsyncTransactionsTimeout=window.setTimeout(()=>{this.executeBatchUpdateRowData()},s)}this.rowDataTransactionBatch.push({rowDataTransaction:t,callback:e})}flushAsyncTransactions(){this.applyAsyncTransactionsTimeout!=null&&(clearTimeout(this.applyAsyncTransactionsTimeout),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){this.valueCache.onDataChanged();const t=[],e=[];let s=!1;if(this.rowDataTransactionBatch&&this.rowDataTransactionBatch.forEach(i=>{const o=this.nodeManager.updateRowData(i.rowDataTransaction,void 0);e.push(o),i.callback&&t.push(i.callback.bind(null,o)),typeof i.rowDataTransaction.addIndex=="number"&&(s=!0)}),this.commonUpdateRowData(e,void 0,s),t.length>0&&window.setTimeout(()=>{t.forEach(i=>i())},0),e.length>0){const i={type:p.EVENT_ASYNC_TRANSACTIONS_FLUSHED,results:e};this.eventService.dispatchEvent(i)}this.rowDataTransactionBatch=null,this.applyAsyncTransactionsTimeout=void 0}updateRowData(t,e){this.valueCache.onDataChanged();const s=this.nodeManager.updateRowData(t,e),i=typeof t.addIndex=="number";return this.commonUpdateRowData([s],e,i),s}createRowNodeOrder(){if(this.gos.get("suppressMaintainUnsortedOrder"))return;const e={};if(this.rootNode&&this.rootNode.allLeafChildren)for(let s=0;s<this.rootNode.allLeafChildren.length;s++){const i=this.rootNode.allLeafChildren[s];e[i.id]=s}return e}commonUpdateRowData(t,e,s){if(!this.hasStarted)return;const i=!this.gos.get("suppressAnimationFrame");s&&(e=this.createRowNodeOrder());const o={type:p.EVENT_ROW_DATA_UPDATED};this.eventService.dispatchEvent(o),this.refreshModel({step:"group",rowNodeTransactions:t,rowNodeOrder:e,keepRenderedRows:!0,keepEditingRows:!0,animate:i})}doRowsToDisplay(){this.rowsToDisplay=this.flattenStage.execute({rowNode:this.rootNode})}onRowHeightChanged(){this.refreshModel({step:"map",keepRenderedRows:!0,keepEditingRows:!0,keepUndoRedoStack:!0})}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}resetRowHeights(){const t=this.resetRowHeightsForAllRowNodes();this.rootNode.setRowHeight(this.rootNode.rowHeight,!0),this.rootNode.sibling&&this.rootNode.sibling.setRowHeight(this.rootNode.sibling.rowHeight,!0),t&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let t=!1;return this.forEachNode(e=>{e.setRowHeight(e.rowHeight,!0);const s=e.detailNode;s&&s.setRowHeight(s.rowHeight,!0),e.sibling&&e.sibling.setRowHeight(e.sibling.rowHeight,!0),t=!0}),t}onGridStylesChanges(){this.columnModel.isAutoRowHeightActive()||this.resetRowHeights()}onGridReady(){this.hasStarted||this.setInitialData()}isRowDataLoaded(){return this.rowCountReady}};u([f("columnModel")],ot.prototype,"columnModel",2),u([f("selectionService")],ot.prototype,"selectionService",2),u([f("valueCache")],ot.prototype,"valueCache",2),u([f("beans")],ot.prototype,"beans",2),u([f("filterStage")],ot.prototype,"filterStage",2),u([f("sortStage")],ot.prototype,"sortStage",2),u([f("flattenStage")],ot.prototype,"flattenStage",2),u([he("groupStage")],ot.prototype,"groupStage",2),u([he("aggregationStage")],ot.prototype,"aggregationStage",2),u([he("pivotStage")],ot.prototype,"pivotStage",2),u([he("filterAggregatesStage")],ot.prototype,"filterAggregatesStage",2),u([M],ot.prototype,"init",1),ot=u([O("rowModel")],ot);var yn=class extends L{execute(t){const{changedPath:e}=t;this.filterService.filter(e)}};u([f("filterService")],yn.prototype,"filterService",2),yn=u([O("filterStage")],yn);var or=class extends L{execute(t){const e=this.sortController.getSortOptions(),s=W.exists(e)&&e.length>0,i=s&&W.exists(t.rowNodeTransactions)&&this.gos.get("deltaSort"),o=e.some(r=>this.gos.isColumnsSortingCoupledToGroup()?r.column.isPrimary()&&r.column.isRowGroupActive():!!r.column.getColDef().showRowGroup);this.sortService.sort(e,s,i,t.rowNodeTransactions,t.changedPath,o)}};u([f("sortService")],or.prototype,"sortService",2),u([f("sortController")],or.prototype,"sortController",2),or=u([O("sortStage")],or);var Rn=class extends L{execute(t){const e=t.rowNode,s=[],i=this.beans.columnModel.isPivotMode(),o=i&&e.leafGroup,r=o?[e]:e.childrenAfterSort,n=this.getFlattenDetails();this.recursivelyAddToRowsToDisplay(n,r,s,i,0);const l=s.length>0;if(!o&&l&&n.grandTotalRow){e.createFooter();const d=n.grandTotalRow==="top";this.addRowNodeToRowsToDisplay(n,e.sibling,s,0,d)}return s}getFlattenDetails(){const t=this.gos.get("groupRemoveSingleChildren");return{groupRemoveLowestSingleChildren:!t&&this.gos.get("groupRemoveLowestSingleChildren"),groupRemoveSingleChildren:t,isGroupMultiAutoColumn:this.gos.isGroupMultiAutoColumn(),hideOpenParents:this.gos.get("groupHideOpenParents"),grandTotalRow:this.gos.getGrandTotalRow(),groupTotalRow:this.gos.getGroupTotalRowCallback()}}recursivelyAddToRowsToDisplay(t,e,s,i,o){if(!W.missingOrEmpty(e))for(let r=0;r<e.length;r++){const n=e[r],l=n.hasChildren(),a=i&&!l,d=t.groupRemoveSingleChildren&&l&&n.childrenAfterGroup.length===1,h=t.groupRemoveLowestSingleChildren&&l&&n.leafGroup&&n.childrenAfterGroup.length===1,c=i&&n.leafGroup,m=t.hideOpenParents&&n.expanded&&!n.master&&!c;if(!a&&!m&&!d&&!h&&this.addRowNodeToRowsToDisplay(t,n,s,o),!(i&&n.leafGroup)){if(l){const v=d||h;if(n.expanded||v){const S=t.groupTotalRow({node:n});S||n.destroyFooter();const w=v?o:o+1;S==="top"&&(n.createFooter(),this.addRowNodeToRowsToDisplay(t,n.sibling,s,w)),this.recursivelyAddToRowsToDisplay(t,n.childrenAfterSort,s,i,w),S==="bottom"&&(n.createFooter(),this.addRowNodeToRowsToDisplay(t,n.sibling,s,w))}}else if(n.master&&n.expanded){const v=this.createDetailNode(n);this.addRowNodeToRowsToDisplay(t,v,s,o)}}}}addRowNodeToRowsToDisplay(t,e,s,i,o){o?s.unshift(e):s.push(e),e.setUiLevel(t.isGroupMultiAutoColumn?0:i)}createDetailNode(t){if(W.exists(t.detailNode))return t.detailNode;const e=new J(this.beans);return e.detail=!0,e.selectable=!1,e.parent=t,W.exists(t.id)&&(e.id="detail_"+t.id),e.data=t.data,e.level=t.level+1,t.detailNode=e,e}};u([f("beans")],Rn.prototype,"beans",2),Rn=u([O("flattenStage")],Rn);var rr=class extends L{sort(t,e,s,i,o,r){const n=this.gos.get("groupMaintainOrder"),l=this.columnModel.getAllGridColumns().some(m=>m.isRowGroupActive());let a={};s&&i&&(a=this.calculateDirtyNodes(i));const d=this.columnModel.isPivotMode(),h=this.gos.getCallback("postSortRows"),c=m=>{var C;this.pullDownGroupDataForHideOpenParents(m.childrenAfterAggFilter,!0);const v=d&&m.leafGroup;if(n&&l&&!m.leafGroup&&!r){const w=(C=this.columnModel.getRowGroupColumns())==null?void 0:C[m.level+1],R=(w==null?void 0:w.getSort())===null,y=m.childrenAfterAggFilter.slice(0);if(m.childrenAfterSort&&!R){const b={};m.childrenAfterSort.forEach((T,D)=>{b[T.id]=D}),y.sort((T,D)=>{var A,F;return((A=b[T.id])!=null?A:0)-((F=b[D.id])!=null?F:0)})}m.childrenAfterSort=y}else!e||v?m.childrenAfterSort=m.childrenAfterAggFilter.slice(0):s?m.childrenAfterSort=this.doDeltaSort(m,a,o,t):m.childrenAfterSort=this.rowNodeSorter.doFullSort(m.childrenAfterAggFilter,t);if(m.sibling&&(m.sibling.childrenAfterSort=m.childrenAfterSort),this.updateChildIndexes(m),h){const w={nodes:m.childrenAfterSort};h(w)}};o&&o.forEachChangedNodeDepthFirst(c),this.updateGroupDataForHideOpenParents(o)}calculateDirtyNodes(t){const e={},s=i=>{i&&i.forEach(o=>e[o.id]=!0)};return t&&t.forEach(i=>{s(i.add),s(i.update),s(i.remove)}),e}doDeltaSort(t,e,s,i){const o=t.childrenAfterAggFilter,r=t.childrenAfterSort;if(!r)return this.rowNodeSorter.doFullSort(o,i);const n={},l=[];o.forEach(c=>{e[c.id]||!s.canSkip(c)?l.push(c):n[c.id]=!0});const a=r.filter(c=>n[c.id]),d=(c,m)=>({currentPos:m,rowNode:c}),h=l.map(d).sort((c,m)=>this.rowNodeSorter.compareRowNodes(i,c,m));return this.mergeSortedArrays(i,h,a.map(d)).map(({rowNode:c})=>c)}mergeSortedArrays(t,e,s){const i=[];let o=0,r=0;for(;o<e.length&&r<s.length;)this.rowNodeSorter.compareRowNodes(t,e[o],s[r])<0?i.push(e[o++]):i.push(s[r++]);for(;o<e.length;)i.push(e[o++]);for(;r<s.length;)i.push(s[r++]);return i}updateChildIndexes(t){if(W.missing(t.childrenAfterSort))return;const e=t.childrenAfterSort;for(let s=0;s<e.length;s++){const i=e[s],o=s===0,r=s===t.childrenAfterSort.length-1;i.setFirstChild(o),i.setLastChild(r),i.setChildIndex(s)}}updateGroupDataForHideOpenParents(t){if(!this.gos.get("groupHideOpenParents"))return;if(this.gos.get("treeData"))return W.warnOnce("The property hideOpenParents dose not work with Tree Data. This is because Tree Data has values at the group level, it doesn't make sense to hide them."),!1;const e=s=>{this.pullDownGroupDataForHideOpenParents(s.childrenAfterSort,!1),s.childrenAfterSort.forEach(i=>{i.hasChildren()&&e(i)})};t&&t.executeFromRootNode(s=>e(s))}pullDownGroupDataForHideOpenParents(t,e){!this.gos.get("groupHideOpenParents")||W.missing(t)||t.forEach(s=>{this.columnModel.getGroupDisplayColumns().forEach(o=>{const r=o.getColDef().showRowGroup;if(typeof r!="string"){console.error("AG Grid: groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup");return}const n=r,l=this.columnModel.getPrimaryColumn(n);if(l!==s.rowGroupColumn)if(e)s.setGroupValue(o.getId(),void 0);else{const d=s.getFirstChildOfFirstChild(l);d&&s.setGroupValue(o.getId(),d.key)}})})}};u([f("columnModel")],rr.prototype,"columnModel",2),u([f("rowNodeSorter")],rr.prototype,"rowNodeSorter",2),rr=u([O("sortService")],rr);var bn=class extends L{filter(t){const e=this.filterManager.isChildFilterPresent();this.filterNodes(e,t)}filterNodes(t,e){const s=(i,o)=>{i.hasChildren()&&t&&!o?i.childrenAfterFilter=i.childrenAfterGroup.filter(r=>{const n=r.childrenAfterFilter&&r.childrenAfterFilter.length>0,l=r.data&&this.filterManager.doesRowPassFilter({rowNode:r});return n||l}):i.childrenAfterFilter=i.childrenAfterGroup,i.sibling&&(i.sibling.childrenAfterFilter=i.childrenAfterFilter)};if(this.doingTreeDataFiltering()){const i=(r,n)=>{if(r.childrenAfterGroup)for(let l=0;l<r.childrenAfterGroup.length;l++){const a=r.childrenAfterGroup[l],d=n||this.filterManager.doesRowPassFilter({rowNode:a});a.childrenAfterGroup?i(r.childrenAfterGroup[l],d):s(a,d)}s(r,n)},o=r=>i(r,!1);e.executeFromRootNode(o)}else{const i=o=>s(o,!1);e.forEachChangedNodeDepthFirst(i,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}};u([f("filterManager")],bn.prototype,"filterManager",2),bn=u([O("filterService")],bn);var pi=class extends L{postConstruct(){this.rowModel.getType()==="clientSide"&&(this.clientSideRowModel=this.rowModel,this.addManagedPropertyListener("rowData",()=>this.onRowDataUpdated()))}isActive(){const t=this.gos.exists("getRowId");return this.gos.get("resetRowDataOnUpdate")?!1:t}setRowData(t){const e=this.createTransactionForRowData(t);if(!e)return;const[s,i]=e;this.clientSideRowModel.updateRowData(s,i)}createTransactionForRowData(t){if(W.missing(this.clientSideRowModel)){console.error("AG Grid: ImmutableService only works with ClientSideRowModel");return}const e=this.gos.getCallback("getRowId");if(e==null){console.error("AG Grid: ImmutableService requires getRowId() callback to be implemented, your row data needs IDs!");return}const s={remove:[],update:[],add:[]},i=this.clientSideRowModel.getCopyOfNodesMap(),r=this.gos.get("suppressMaintainUnsortedOrder")?void 0:{};return W.exists(t)&&t.forEach((n,l)=>{const a=e({data:n,level:0}),d=i[a];r&&(r[a]=l),d?(d.data!==n&&s.update.push(n),i[a]=void 0):s.add.push(n)}),W.iterateObject(i,(n,l)=>{l&&s.remove.push(l.data)}),[s,r]}onRowDataUpdated(){const t=this.gos.get("rowData");t&&(this.isActive()?this.setRowData(t):(this.selectionService.reset("rowDataChanged"),this.clientSideRowModel.setRowData(t)))}};u([f("rowModel")],pi.prototype,"rowModel",2),u([f("rowRenderer")],pi.prototype,"rowRenderer",2),u([f("selectionService")],pi.prototype,"selectionService",2),u([M],pi.prototype,"postConstruct",1),pi=u([O("immutableService")],pi);var Jm="31.3.4",Zm={version:Jm,moduleName:"@ag-grid-community/client-side-row-model",rowModel:"clientSide",beans:[ot,yn,or,Rn,rr,bn,pi]},$m=Object.defineProperty,eC=Object.getOwnPropertyDescriptor,rt=(t,e,s,i)=>{for(var o=i>1?void 0:i?eC(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(o=(i?n(e,s,o):n(o))||o);return i&&o&&$m(e,s,o),o},tC=(t,e)=>(s,i)=>e(s,i,t),nr=class extends aa{constructor(t,e,s){super(t),this.parentCache=e,this.params=s,this.startRow=t*s.blockSize,this.endRow=this.startRow+s.blockSize}postConstruct(){this.createRowNodes()}getBlockStateJson(){return{id:""+this.getId(),state:{blockNumber:this.getId(),startRow:this.getStartRow(),endRow:this.getEndRow(),pageStatus:this.getState()}}}setDataAndId(t,e,s){W.exists(e)?t.setDataAndId(e,s.toString()):t.setDataAndId(void 0,void 0)}loadFromDatasource(){const t=this.createLoadParams();if(W.missing(this.params.datasource.getRows)){console.warn("AG Grid: datasource is missing getRows method");return}window.setTimeout(()=>{this.params.datasource.getRows(t)},0)}processServerFail(){}createLoadParams(){return{startRow:this.getStartRow(),endRow:this.getEndRow(),successCallback:this.pageLoaded.bind(this,this.getVersion()),failCallback:this.pageLoadFailed.bind(this,this.getVersion()),sortModel:this.params.sortModel,filterModel:this.params.filterModel,context:this.gos.getGridCommonParams().context}}forEachNode(t,e,s){this.rowNodes.forEach((i,o)=>{this.startRow+o<s&&t(i,e.next())})}getLastAccessed(){return this.lastAccessed}getRow(t,e=!1){e||(this.lastAccessed=this.params.lastAccessedSequence.next());const s=t-this.startRow;return this.rowNodes[s]}getStartRow(){return this.startRow}getEndRow(){return this.endRow}createRowNodes(){this.rowNodes=[];for(let t=0;t<this.params.blockSize;t++){const e=this.startRow+t,s=new J(this.beans);s.setRowHeight(this.params.rowHeight),s.uiLevel=0,s.setRowIndex(e),s.setRowTop(this.params.rowHeight*e),this.rowNodes.push(s)}}processServerResult(t){this.rowNodes.forEach((s,i)=>{const o=t.rowData?t.rowData[i]:void 0;!s.id&&s.alreadyRendered&&o&&(this.rowNodes[i]=new J(this.beans),this.rowNodes[i].setRowIndex(s.rowIndex),this.rowNodes[i].setRowTop(s.rowTop),this.rowNodes[i].setRowHeight(s.rowHeight),s.clearRowTopAndRowIndex()),this.setDataAndId(this.rowNodes[i],o,this.startRow+i)});const e=t.rowCount!=null&&t.rowCount>=0?t.rowCount:void 0;this.parentCache.pageLoaded(this,e)}destroyRowNodes(){this.rowNodes.forEach(t=>{t.clearRowTopAndRowIndex()})}};rt([f("beans")],nr.prototype,"beans",2),rt([M],nr.prototype,"postConstruct",1),rt([tt],nr.prototype,"destroyRowNodes",1);var eo=class Vc extends L{constructor(e){super(),this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount,this.params=e}setBeans(e){this.logger=e.create("InfiniteCache")}getRow(e,s=!1){const i=Math.floor(e/this.params.blockSize);let o=this.blocks[i];if(!o){if(s)return;o=this.createBlock(i)}return o.getRow(e)}createBlock(e){const s=this.createBean(new nr(e,this,this.params));return this.blocks[s.getId()]=s,this.blockCount++,this.purgeBlocksIfNeeded(s),this.params.rowNodeBlockLoader.addBlock(s),s}refreshCache(){if(this.blockCount==0){this.purgeCache();return}this.getBlocksInOrder().forEach(s=>s.setStateWaitingToLoad()),this.params.rowNodeBlockLoader.checkBlockToLoad()}destroyAllBlocks(){this.getBlocksInOrder().forEach(e=>this.destroyBlock(e))}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,s){this.isAlive()&&(this.logger.log(`onPageLoaded: page = ${e.getId()}, lastRow = ${s}`),this.checkRowCount(e,s),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const s=this.getBlocksInOrder().filter(l=>l!=e),i=(l,a)=>a.getLastAccessed()-l.getLastAccessed();s.sort(i);const o=this.params.maxBlocksInCache>0,r=o?this.params.maxBlocksInCache-1:null,n=Vc.MAX_EMPTY_BLOCKS_TO_KEEP-1;s.forEach((l,a)=>{const d=l.getState()===nr.STATE_WAITING_TO_LOAD&&a>=n,h=o?a>=r:!1;if(d||h){if(this.isBlockCurrentlyDisplayed(l)||this.isBlockFocused(l))return;this.removeBlockFromCache(l)}})}isBlockFocused(e){const s=this.focusService.getFocusCellToUseAfterRefresh();if(!s||s.rowPinned!=null)return!1;const i=e.getStartRow(),o=e.getEndRow();return s.rowIndex>=i&&s.rowIndex<o}isBlockCurrentlyDisplayed(e){const s=e.getStartRow(),i=e.getEndRow()-1;return this.rowRenderer.isRangeInRenderedViewport(s,i)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,s){if(typeof s=="number"&&s>=0)this.rowCount=s,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const o=(e.getId()+1)*this.params.blockSize+this.params.overflowSize;this.rowCount<o&&(this.rowCount=o)}}setRowCount(e,s){this.rowCount=e,W.exists(s)&&(this.lastRowIndexKnown=s),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const s=new Fi;this.getBlocksInOrder().forEach(i=>i.forEachNode(e,s,this.rowCount))}getBlocksInOrder(){const e=(i,o)=>i.getId()-o.getId();return W.getAllValuesInObject(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.getId()],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){if(this.isAlive()){this.destroyAllBlocksPastVirtualRowCount();const e={type:p.EVENT_STORE_UPDATED};this.eventService.dispatchEvent(e)}}destroyAllBlocksPastVirtualRowCount(){const e=[];this.getBlocksInOrder().forEach(s=>{s.getId()*this.params.blockSize>=this.rowCount&&e.push(s)}),e.length>0&&e.forEach(s=>this.destroyBlock(s))}purgeCache(){this.getBlocksInOrder().forEach(e=>this.removeBlockFromCache(e)),this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,s){const i=[];let o=-1,r=!1;const n=new Fi;W.missing(e)&&(r=!0);let l=!1;return this.getBlocksInOrder().forEach(d=>{if(!l){if(r&&o+1!==d.getId()){l=!0;return}o=d.getId(),d.forEachNode(h=>{const c=h===e||h===s;(r||c)&&i.push(h),c&&(r=!r)},n,this.rowCount)}}),l||r?[]:i}};eo.MAX_EMPTY_BLOCKS_TO_KEEP=2,rt([f("rowRenderer")],eo.prototype,"rowRenderer",2),rt([f("focusService")],eo.prototype,"focusService",2),rt([tC(0,Tt("loggerFactory"))],eo.prototype,"setBeans",1),rt([tt],eo.prototype,"destroyAllBlocks",1);var sC=eo,Zt=class extends L{getRowBounds(t){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*t}}ensureRowHeightsValid(t,e,s,i){return!1}init(){this.gos.isRowModelType("infinite")&&(this.rowHeight=this.gos.getRowHeightAsNumber(),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache()),this.verifyProps())}verifyProps(){this.gos.exists("initialGroupOrderComparator")&&W.warnOnce("initialGroupOrderComparator cannot be used with Infinite Row Model as sorting is done on the server side")}start(){this.setDatasource(this.gos.get("datasource"))}destroyDatasource(){this.datasource&&(this.getContext().destroyBean(this.datasource),this.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedListener(this.eventService,p.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,p.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverything.bind(this)),this.addManagedListener(this.eventService,p.EVENT_STORE_UPDATED,this.onCacheUpdated.bind(this)),this.addManagedPropertyListener("datasource",()=>this.setDatasource(this.gos.get("datasource"))),this.addManagedPropertyListener("cacheBlockSize",()=>this.resetCache()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=this.gos.getRowHeightAsNumber(),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onFilterChanged(){this.reset()}onSortChanged(){this.reset()}onColumnEverything(){let t;this.cacheParams?t=this.isSortModelDifferent():t=!0,t&&this.reset()}isSortModelDifferent(){return!W.jsonEquals(this.cacheParams.sortModel,this.sortController.getSortModel())}getType(){return"infinite"}setDatasource(t){this.destroyDatasource(),this.datasource=t,t&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(t,e){return this.infiniteCache?this.infiniteCache.getRowNodesInRange(t,e):[]}reset(){if(!this.datasource)return;this.gos.getCallback("getRowId")!=null||this.selectionService.reset("rowDataChanged"),this.resetCache()}createModelUpdatedEvent(){return{type:p.EVENT_MODEL_UPDATED,newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1}}resetCache(){this.destroyCache(),this.cacheParams={datasource:this.datasource,filterModel:this.filterManager.getFilterModel(),sortModel:this.sortController.getSortModel(),rowNodeBlockLoader:this.rowNodeBlockLoader,initialRowCount:this.gos.get("infiniteInitialRowCount"),maxBlocksInCache:this.gos.get("maxBlocksInCache"),rowHeight:this.gos.getRowHeightAsNumber(),overflowSize:this.gos.get("cacheOverflowSize"),blockSize:this.gos.get("cacheBlockSize"),lastAccessedSequence:new Fi},this.infiniteCache=this.createBean(new sC(this.cacheParams)),this.eventService.dispatchEventOnce({type:p.EVENT_ROW_COUNT_READY});const t=this.createModelUpdatedEvent();this.eventService.dispatchEvent(t)}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)});const t=this.createModelUpdatedEvent();this.eventService.dispatchEvent(t)}destroyCache(){this.infiniteCache&&(this.infiniteCache=this.destroyBean(this.infiniteCache))}onCacheUpdated(){const t=this.createModelUpdatedEvent();this.eventService.dispatchEvent(t)}getRow(t){if(this.infiniteCache&&!(t>=this.infiniteCache.getRowCount()))return this.infiniteCache.getRow(t)}getRowNode(t){let e;return this.forEachNode(s=>{s.id===t&&(e=s)}),e}forEachNode(t){this.infiniteCache&&this.infiniteCache.forEachNodeDeep(t)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(t){return t}getRowIndexAtPixel(t){if(this.rowHeight!==0){const e=Math.floor(t/this.rowHeight),s=this.getRowCount()-1;return e>s?s:e}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(t){return!!this.getRowNode(t.id)}refreshCache(){this.infiniteCache&&this.infiniteCache.refreshCache()}purgeCache(){this.infiniteCache&&this.infiniteCache.purgeCache()}isLastRowIndexKnown(){return this.infiniteCache?this.infiniteCache.isLastRowIndexKnown():!1}setRowCount(t,e){this.infiniteCache&&this.infiniteCache.setRowCount(t,e)}};rt([f("filterManager")],Zt.prototype,"filterManager",2),rt([f("sortController")],Zt.prototype,"sortController",2),rt([f("selectionService")],Zt.prototype,"selectionService",2),rt([f("rowRenderer")],Zt.prototype,"rowRenderer",2),rt([f("rowNodeBlockLoader")],Zt.prototype,"rowNodeBlockLoader",2),rt([M],Zt.prototype,"init",1),rt([tt],Zt.prototype,"destroyDatasource",1),Zt=rt([O("rowModel")],Zt);var iC="31.3.4",oC={version:iC,moduleName:"@ag-grid-community/infinite-row-model",rowModel:"infinite",beans:[Zt]},rC=Object.defineProperty,nC=Object.getOwnPropertyDescriptor,mt=(t,e,s,i)=>{for(var o=i>1?void 0:i?nC(e,s):e,r=t.length-1,n;r>=0;r--)(n=t[r])&&(o=(i?n(e,s,o):n(o))||o);return i&&o&&rC(e,s,o),o},lC=class{setBeans(t){this.beans=t}getFileName(t){const e=this.getDefaultFileExtension();return(t==null||!t.length)&&(t=this.getDefaultFileName()),t.indexOf(".")===-1?`${t}.${e}`:t}getData(t){const e=this.createSerializingSession(t);return this.beans.gridSerializer.serialize(e,t)}getDefaultFileName(){return`export.${this.getDefaultFileExtension()}`}},aC=class{constructor(t){this.groupColumns=[];const{columnModel:e,valueService:s,gos:i,processCellCallback:o,processHeaderCallback:r,processGroupHeaderCallback:n,processRowGroupCallback:l}=t;this.columnModel=e,this.valueService=s,this.gos=i,this.processCellCallback=o,this.processHeaderCallback=r,this.processGroupHeaderCallback=n,this.processRowGroupCallback=l}prepare(t){this.groupColumns=t.filter(e=>!!e.getColDef().showRowGroup)}extractHeaderValue(t){const e=this.getHeaderName(this.processHeaderCallback,t);return e??""}extractRowCellValue(t,e,s,i,o){const n=(!this.gos.get("groupHideOpenParents")||o.footer)&&this.shouldRenderGroupSummaryCell(o,t,e)?this.createValueForGroupNode(t,o):this.valueService.getValue(t,o);return this.processCell({accumulatedRowIndex:s,rowNode:o,column:t,value:n,processCellCallback:this.processCellCallback,type:i})}shouldRenderGroupSummaryCell(t,e,s){var i;if(!(t&&t.group))return!1;if(this.groupColumns.indexOf(e)!==-1){if(((i=t.groupData)==null?void 0:i[e.getId()])!=null||this.gos.isRowModelType("serverSide")&&t.group)return!0;if(t.footer&&t.level===-1){const l=e.getColDef();return l==null||l.showRowGroup===!0||l.showRowGroup===this.columnModel.getRowGroupColumns()[0].getId()}}const n=this.gos.isGroupUseEntireRow(this.columnModel.isPivotMode());return s===0&&n}getHeaderName(t,e){return t?t(this.gos.addGridCommonParams({column:e})):this.columnModel.getDisplayNameForColumn(e,"csv",!0)}createValueForGroupNode(t,e){if(this.processRowGroupCallback)return this.processRowGroupCallback(this.gos.addGridCommonParams({column:t,node:e}));const s=this.gos.get("treeData"),i=this.gos.get("suppressGroupMaintainValueType"),o=a=>{var d,h;if(s||i)return a.key;const c=(d=a.groupData)==null?void 0:d[t.getId()];return!c||!a.rowGroupColumn||a.rowGroupColumn.getColDef().useValueFormatterForExport===!1?c:(h=this.valueService.formatValue(a.rowGroupColumn,a,c))!=null?h:c},r=e.footer,n=[o(e)];if(!this.gos.isGroupMultiAutoColumn())for(;e.parent;)e=e.parent,n.push(o(e));const l=n.reverse().join(" -> ");return r?`Total ${l}`:l}processCell(t){var e;const{accumulatedRowIndex:s,rowNode:i,column:o,value:r,processCellCallback:n,type:l}=t;return n?{value:(e=n(this.gos.addGridCommonParams({accumulatedRowIndex:s,column:o,node:i,value:r,type:l,parseValue:a=>this.valueService.parseValue(o,i,a,this.valueService.getValue(o,i)),formatValue:a=>{var d;return(d=this.valueService.formatValue(o,i,a))!=null?d:a}})))!=null?e:""}:o.getColDef().useValueFormatterForExport!==!1?{value:r??"",valueFormatted:this.valueService.formatValue(o,i,r)}:{value:r??""}}},dC=class{static download(t,e){const s=document.defaultView||window;if(!s){console.warn("AG Grid: There is no `window` associated with the current `document`");return}const i=document.createElement("a"),o=s.URL.createObjectURL(e);i.setAttribute("href",o),i.setAttribute("download",t),i.style.display="none",document.body.appendChild(i),i.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:s})),document.body.removeChild(i),s.setTimeout(()=>{s.URL.revokeObjectURL(o)},0)}},Bh=`\r
331
+ `,uC=class extends aC{constructor(t){super(t),this.isFirstLine=!0,this.result="";const{suppressQuotes:e,columnSeparator:s}=t;this.suppressQuotes=e,this.columnSeparator=s}addCustomContent(t){t&&(typeof t=="string"?(/^\s*\n/.test(t)||this.beginNewLine(),t=t.replace(/\r?\n/g,Bh),this.result+=t):t.forEach(e=>{this.beginNewLine(),e.forEach((s,i)=>{i!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(s.data.value||""),s.mergeAcross&&this.appendEmptyCells(s.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(t,e,s,i){s!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(e),this.appendEmptyCells(i)}appendEmptyCells(t){for(let e=1;e<=t;e++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(t,e){e!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(t))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(t,e,s){var i;e!=0&&(this.result+=this.columnSeparator);const o=this.extractRowCellValue(t,e,e,"csv",s);this.result+=this.putInQuotes((i=o.valueFormatted)!=null?i:o.value)}putInQuotes(t){if(this.suppressQuotes)return t;if(t==null)return'""';let e;return typeof t=="string"?e=t:typeof t.toString=="function"?e=t.toString():(console.warn("AG Grid: unknown value type during csv conversion"),e=""),'"'+e.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=Bh),this.isFirstLine=!1}},Ms=class extends lC{postConstruct(){this.setBeans({gridSerializer:this.gridSerializer,gos:this.gos})}getMergedParams(t){const e=this.gos.get("defaultCsvExportParams");return Object.assign({},e,t)}export(t){if(this.isExportSuppressed()){console.warn("AG Grid: Export cancelled. Export is not allowed as per your configuration.");return}const e=this.getMergedParams(t),s=this.getData(e),i=new Blob(["\uFEFF",s],{type:"text/plain"}),o=typeof e.fileName=="function"?e.fileName(this.gos.getGridCommonParams()):e.fileName;dC.download(this.getFileName(o),i)}exportDataAsCsv(t){this.export(t)}getDataAsCsv(t,e=!1){const s=e?Object.assign({},t):this.getMergedParams(t);return this.getData(s)}getDefaultFileExtension(){return"csv"}createSerializingSession(t){const{columnModel:e,valueService:s,gos:i}=this,{processCellCallback:o,processHeaderCallback:r,processGroupHeaderCallback:n,processRowGroupCallback:l,suppressQuotes:a,columnSeparator:d}=t;return new uC({columnModel:e,valueService:s,gos:i,processCellCallback:o||void 0,processHeaderCallback:r||void 0,processGroupHeaderCallback:n||void 0,processRowGroupCallback:l||void 0,suppressQuotes:a||!1,columnSeparator:d||","})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};mt([f("columnModel")],Ms.prototype,"columnModel",2),mt([f("valueService")],Ms.prototype,"valueService",2),mt([f("gridSerializer")],Ms.prototype,"gridSerializer",2),mt([f("gridOptionsService")],Ms.prototype,"gos",2),mt([M],Ms.prototype,"postConstruct",1),Ms=mt([O("csvCreator")],Ms);var $t=class extends L{serialize(t,e={}){const{allColumns:s,columnKeys:i,skipRowGroups:o}=e,r=this.getColumnsToExport(s,o,i);return W.compose(this.prepareSession(r),this.prependContent(e),this.exportColumnGroups(e,r),this.exportHeaders(e,r),this.processPinnedTopRows(e,r),this.processRows(e,r),this.processPinnedBottomRows(e,r),this.appendContent(e))(t).parse()}processRow(t,e,s,i){const o=e.shouldRowBeSkipped||(()=>!1),r=this.gos.get("groupRemoveSingleChildren"),n=this.gos.get("groupRemoveLowestSingleChildren"),a=e.rowPositions!=null||!!e.onlySelected,d=this.gos.get("groupHideOpenParents")&&!a,h=this.columnModel.isPivotMode()?i.leafGroup:!i.group,c=!!i.footer;e.skipRowGroups;const m=n&&i.leafGroup,C=i.allChildrenCount===1&&(r||m);if(!h&&!c&&(e.skipRowGroups||C||d)||e.onlySelected&&!i.isSelected()||e.skipPinnedTop&&i.rowPinned==="top"||e.skipPinnedBottom&&i.rowPinned==="bottom"||i.level===-1&&!h&&!c||o(this.gos.addGridCommonParams({node:i})))return;const w=t.onNewBodyRow(i);if(s.forEach((R,y)=>{w.onColumn(R,y,i)}),e.getCustomContentBelowRow){const R=e.getCustomContentBelowRow(this.gos.addGridCommonParams({node:i}));R&&t.addCustomContent(R)}}appendContent(t){return e=>{const s=t.appendContent;return s&&e.addCustomContent(s),e}}prependContent(t){return e=>{const s=t.prependContent;return s&&e.addCustomContent(s),e}}prepareSession(t){return e=>(e.prepare(t),e)}exportColumnGroups(t,e){return s=>{if(!t.skipColumnGroupHeaders){const i=new Yd,o=this.displayedGroupCreator.createDisplayedGroups(e,i,null);this.recursivelyAddHeaderGroups(o,s,t.processGroupHeaderCallback)}return s}}exportHeaders(t,e){return s=>{if(!t.skipColumnHeaders){const i=s.onNewHeaderRow();e.forEach((o,r)=>{i.onColumn(o,r,void 0)})}return s}}processPinnedTopRows(t,e){return s=>{const i=this.processRow.bind(this,s,t,e);return t.rowPositions?t.rowPositions.filter(o=>o.rowPinned==="top").sort((o,r)=>o.rowIndex-r.rowIndex).map(o=>this.pinnedRowModel.getPinnedTopRow(o.rowIndex)).forEach(i):this.pinnedRowModel.forEachPinnedTopRow(i),s}}processRows(t,e){return s=>{const i=this.rowModel,o=i.getType(),r=o==="clientSide",n=o==="serverSide",l=!r&&t.onlySelected,a=this.processRow.bind(this,s,t,e),{exportedRows:d="filteredAndSorted"}=t;if(t.rowPositions)t.rowPositions.filter(h=>h.rowPinned==null).sort((h,c)=>h.rowIndex-c.rowIndex).map(h=>i.getRow(h.rowIndex)).forEach(a);else if(this.columnModel.isPivotMode())r?i.forEachPivotNode(a,!0):n?i.forEachNodeAfterFilterAndSort(a,!0):i.forEachNode(a);else if(t.onlySelectedAllPages||l){const h=this.selectionService.getSelectedNodes();this.replicateSortedOrder(h),h.forEach(a)}else d==="all"?i.forEachNode(a):r||n?i.forEachNodeAfterFilterAndSort(a,!0):i.forEachNode(a);return s}}replicateSortedOrder(t){const e=this.sortController.getSortOptions(),s=(i,o)=>{var r,n,l,a;return i.rowIndex!=null&&o.rowIndex!=null?i.rowIndex-o.rowIndex:i.level===o.level?((r=i.parent)==null?void 0:r.id)===((n=o.parent)==null?void 0:n.id)?this.rowNodeSorter.compareRowNodes(e,{rowNode:i,currentPos:(l=i.rowIndex)!=null?l:-1},{rowNode:o,currentPos:(a=o.rowIndex)!=null?a:-1}):s(i.parent,o.parent):i.level>o.level?s(i.parent,o):s(i,o.parent)};t.sort(s)}processPinnedBottomRows(t,e){return s=>{const i=this.processRow.bind(this,s,t,e);return t.rowPositions?t.rowPositions.filter(o=>o.rowPinned==="bottom").sort((o,r)=>o.rowIndex-r.rowIndex).map(o=>this.pinnedRowModel.getPinnedBottomRow(o.rowIndex)).forEach(i):this.pinnedRowModel.forEachPinnedBottomRow(i),s}}getColumnsToExport(t=!1,e=!1,s){const i=this.columnModel.isPivotMode();if(s&&s.length)return this.columnModel.getGridColumns(s);const o=this.gos.get("treeData");let r=[];return t&&!i?r=this.columnModel.getAllGridColumns():r=this.columnModel.getAllDisplayedColumns(),e&&!o&&(r=r.filter(n=>n.getColId()!==yi)),r}recursivelyAddHeaderGroups(t,e,s){const i=[];t.forEach(o=>{const r=o;r.getChildren&&r.getChildren().forEach(n=>i.push(n))}),t.length>0&&t[0]instanceof He&&this.doAddHeaderHeader(e,t,s),i&&i.length>0&&this.recursivelyAddHeaderGroups(i,e,s)}doAddHeaderHeader(t,e,s){const i=t.onNewHeaderGroupingRow();let o=0;e.forEach(r=>{const n=r;let l;s?l=s(this.gos.addGridCommonParams({columnGroup:n})):l=this.columnModel.getDisplayNameForColumnGroup(n,"header");const a=n.getLeafColumns().reduce((d,h,c,m)=>{let C=W.last(d);return h.getColumnGroupShow()==="open"?(!C||C[1]!=null)&&(C=[c],d.push(C)):C&&C[1]==null&&(C[1]=c-1),c===m.length-1&&C&&C[1]==null&&(C[1]=c),d},[]);i.onColumn(n,l||"",o++,n.getLeafColumns().length-1,a)})}};mt([f("displayedGroupCreator")],$t.prototype,"displayedGroupCreator",2),mt([f("columnModel")],$t.prototype,"columnModel",2),mt([f("rowModel")],$t.prototype,"rowModel",2),mt([f("pinnedRowModel")],$t.prototype,"pinnedRowModel",2),mt([f("selectionService")],$t.prototype,"selectionService",2),mt([f("rowNodeSorter")],$t.prototype,"rowNodeSorter",2),mt([f("sortController")],$t.prototype,"sortController",2),$t=mt([O("gridSerializer")],$t);var hC="31.3.4",cC={version:hC,moduleName:"@ag-grid-community/csv-export",beans:[Ms,$t]},{utf8_encode:kv}=W;ne.__registerModules([Zm,oC,cC],!1,void 0);var pC=Object.defineProperty,gC=Object.defineProperties,fC=Object.getOwnPropertyDescriptors,Wh=Object.getOwnPropertySymbols,mC=Object.prototype.hasOwnProperty,CC=Object.prototype.propertyIsEnumerable,Uh=(t,e,s)=>e in t?pC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,Te=(t,e)=>{for(var s in e||(e={}))mC.call(e,s)&&Uh(t,s,e[s]);if(Wh)for(var s of Wh(e))CC.call(e,s)&&Uh(t,s,e[s]);return t},nt=(t,e)=>gC(t,fC(e)),Aa=g.createContext({setMethods:()=>{}}),vC=t=>{const{initialProps:e,addUpdateCallback:s,CustomComponentClass:i,setMethods:o}=t,[r,n]=g.useState(e);return g.useEffect(()=>{s(l=>n(l))},[]),g.createElement(Aa.Provider,{value:{setMethods:o}},g.createElement(i,Te({},r)))},wC=g.memo(vC),SC=0;function zh(){return`agPortalKey_${++SC}`}var Kh=class{constructor(t,e,s,i){this.portal=null,this.oldPortal=null,this.reactComponent=t,this.portalManager=e,this.componentType=s,this.suppressFallbackMethods=!!i,this.statelessComponent=this.isStateless(this.reactComponent),this.key=zh(),this.portalKey=zh(),this.instanceCreated=this.isStatelessComponent()?xe.resolve(!1):new xe(o=>{this.resolveInstanceCreated=o})}getGui(){return this.eParentElement}getRootElement(){return this.eParentElement.firstChild}destroy(){return this.componentInstance&&typeof this.componentInstance.destroy=="function"&&this.componentInstance.destroy(),this.portalManager.destroyPortal(this.portal)}createParentElement(t){const e=this.portalManager.getComponentWrappingElement(),s=document.createElement(e||"div");return s.classList.add("ag-react-container"),t.reactContainer=s,s}addParentContainerStyleAndClasses(){this.componentInstance&&(this.componentInstance.getReactContainerStyle&&this.componentInstance.getReactContainerStyle()&&(W.warnOnce('Since v31.1 "getReactContainerStyle" is deprecated. Apply styling directly to ".ag-react-container" if needed.'),Object.assign(this.eParentElement.style,this.componentInstance.getReactContainerStyle())),this.componentInstance.getReactContainerClasses&&this.componentInstance.getReactContainerClasses()&&(W.warnOnce('Since v31.1 "getReactContainerClasses" is deprecated. Apply styling directly to ".ag-react-container" if needed.'),this.componentInstance.getReactContainerClasses().forEach(e=>this.eParentElement.classList.add(e))))}statelessComponentRendered(){return this.eParentElement.childElementCount>0||this.eParentElement.childNodes.length>0}getFrameworkComponentInstance(){return this.componentInstance}isStatelessComponent(){return this.statelessComponent}getReactComponentName(){return this.reactComponent.name}getMemoType(){return this.hasSymbol()?Symbol.for("react.memo"):60115}hasSymbol(){return typeof Symbol=="function"&&Symbol.for}isStateless(t){return typeof t=="function"&&!(t.prototype&&t.prototype.isReactComponent)||typeof t=="object"&&t.$$typeof===this.getMemoType()}hasMethod(t){const e=this.getFrameworkComponentInstance();return!!e&&e[t]!=null||this.fallbackMethodAvailable(t)}callMethod(t,e){const s=this.getFrameworkComponentInstance();if(this.isStatelessComponent())return this.fallbackMethod(t,e&&e[0]?e[0]:{});if(!s){setTimeout(()=>this.callMethod(t,e));return}const i=s[t];if(i)return i.apply(s,e);if(this.fallbackMethodAvailable(t))return this.fallbackMethod(t,e&&e[0]?e[0]:{})}addMethod(t,e){this[t]=e}init(t){return this.eParentElement=this.createParentElement(t),this.params=t,this.createOrUpdatePortal(t),new xe(e=>this.createReactComponent(e))}createOrUpdatePortal(t){this.isStatelessComponent()||(this.ref=e=>{var s;this.componentInstance=e,this.addParentContainerStyleAndClasses(),(s=this.resolveInstanceCreated)==null||s.call(this,!0),this.resolveInstanceCreated=void 0},t.ref=this.ref),this.reactElement=this.createElement(this.reactComponent,nt(Te({},t),{key:this.key})),this.portal=lo.createPortal(this.reactElement,this.eParentElement,this.portalKey)}createElement(t,e){return g.createElement(t,e)}createReactComponent(t){this.portalManager.mountReactPortal(this.portal,this,e=>{t(e)})}isNullValue(){return this.valueRenderedIsNull(this.params)}rendered(){return this.isStatelessComponent()&&this.statelessComponentRendered()||!!(!this.isStatelessComponent()&&this.getFrameworkComponentInstance())}valueRenderedIsNull(t){if(!this.componentType.cellRenderer)return!1;const e=console.error;try{return console.error=()=>{},Bc.renderToStaticMarkup(g.createElement(this.reactComponent,t))===""}catch{}finally{console.error=e}return!1}refreshComponent(t){this.oldPortal=this.portal,this.createOrUpdatePortal(t),this.portalManager.updateReactPortal(this.oldPortal,this.portal)}fallbackMethod(t,e){const s=this[`${t}Component`];if(!this.suppressFallbackMethods&&s)return s.bind(this)(e)}fallbackMethodAvailable(t){return this.suppressFallbackMethods?!1:!!this[`${t}Component`]}};function Pa(t,e,s){t.forEach(i=>{const o=e[i];o&&(s[i]=o)})}var Is=class extends Kh{constructor(){super(...arguments),this.awaitUpdateCallback=new xe(t=>{this.resolveUpdateCallback=t}),this.wrapperComponent=wC}init(t){return this.sourceParams=t,super.init(this.getProps())}addMethod(){}getInstance(){return this.instanceCreated.then(()=>this.componentInstance)}getFrameworkComponentInstance(){return this}createElement(t,e){return super.createElement(this.wrapperComponent,{initialProps:e,CustomComponentClass:t,setMethods:s=>this.setMethods(s),addUpdateCallback:s=>{this.updateCallback=()=>(s(this.getProps()),new xe(i=>{setTimeout(()=>{i()})})),this.resolveUpdateCallback()}})}setMethods(t){this.providedMethods=t,Pa(this.getOptionalMethods(),this.providedMethods,this)}getOptionalMethods(){return[]}getProps(){return nt(Te({},this.sourceParams),{key:this.key,ref:this.ref})}refreshProps(){return this.updateCallback?this.updateCallback():new xe(t=>this.awaitUpdateCallback.then(()=>{this.updateCallback().then(()=>t())}))}},EC=class extends Is{constructor(){super(...arguments),this.date=null,this.onDateChange=t=>this.updateDate(t)}getDate(){return this.date}setDate(t){this.date=t,this.refreshProps()}refresh(t){this.sourceParams=t,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled"]}updateDate(t){this.setDate(t),this.sourceParams.onDateChanged()}getProps(){const t=super.getProps();return t.date=this.date,t.onDateChange=this.onDateChange,delete t.onDateChanged,t}},yC=class extends Is{constructor(){super(...arguments),this.model=null,this.onModelChange=t=>this.updateModel(t),this.onUiChange=()=>this.sourceParams.filterChangedCallback()}isFilterActive(){return this.model!=null}doesFilterPass(t){return this.providedMethods.doesFilterPass(t)}getModel(){return this.model}setModel(t){return this.model=t,this.refreshProps()}refresh(t){return this.sourceParams=t,this.refreshProps(),!0}getOptionalMethods(){return["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onAnyFilterChanged"]}updateModel(t){this.setModel(t).then(()=>this.sourceParams.filterChangedCallback())}getProps(){const t=super.getProps();return t.model=this.model,t.onModelChange=this.onModelChange,t.onUiChange=this.onUiChange,delete t.filterChangedCallback,delete t.filterModifiedCallback,delete t.valueGetter,t}};function Yh(t,e){t.parentFilterInstance(s=>{(s.setModel(e)||xe.resolve()).then(()=>{t.filterParams.filterChangedCallback()})})}var RC=class{constructor(t,e){this.floatingFilterParams=t,this.refreshProps=e,this.model=null,this.onModelChange=s=>this.updateModel(s)}getProps(){return nt(Te({},this.floatingFilterParams),{model:this.model,onModelChange:this.onModelChange})}onParentModelChanged(t){this.model=t,this.refreshProps()}refresh(t){this.floatingFilterParams=t,this.refreshProps()}setMethods(t){Pa(this.getOptionalMethods(),t,this)}getOptionalMethods(){return["afterGuiAttached"]}updateModel(t){this.model=t,this.refreshProps(),Yh(this.floatingFilterParams,t)}},bC=class extends Is{constructor(){super(...arguments),this.model=null,this.onModelChange=t=>this.updateModel(t)}onParentModelChanged(t){this.model=t,this.refreshProps()}refresh(t){this.sourceParams=t,this.refreshProps()}getOptionalMethods(){return["afterGuiAttached"]}updateModel(t){this.model=t,this.refreshProps(),Yh(this.sourceParams,t)}getProps(){const t=super.getProps();return t.model=this.model,t.onModelChange=this.onModelChange,t}},TC=class extends Is{refresh(t){this.sourceParams=t,this.refreshProps()}},DC=class extends Is{constructor(){super(...arguments),this.active=!1,this.expanded=!1,this.onActiveChange=t=>this.updateActive(t)}setActive(t){this.awaitSetActive(t)}setExpanded(t){this.expanded=t,this.refreshProps()}getOptionalMethods(){return["select","configureDefaults"]}awaitSetActive(t){return this.active=t,this.refreshProps()}updateActive(t){const e=this.awaitSetActive(t);t&&e.then(()=>this.sourceParams.onItemActivated())}getProps(){const t=super.getProps();return t.active=this.active,t.expanded=this.expanded,t.onActiveChange=this.onActiveChange,delete t.onItemActivated,t}},AC=class extends Is{refresh(t){this.sourceParams=t,this.refreshProps()}},PC=class extends Is{refresh(t){return this.sourceParams=t,this.refreshProps(),!0}},FC=class extends Is{constructor(){super(...arguments),this.onStateChange=t=>this.updateState(t)}refresh(t){return this.sourceParams=t,this.refreshProps(),!0}getState(){return this.state}updateState(t){this.state=t,this.refreshProps(),this.sourceParams.onStateUpdated()}getProps(){const t=super.getProps();return t.state=this.state,t.onStateChange=this.onStateChange,t}},jh=class Hc{constructor(e,s,i){this.destroyed=!1,this.portals=[],this.hasPendingPortalUpdate=!1,this.wrappingElement=s||"div",this.refresher=e,this.maxComponentCreationTimeMs=i||Hc.MAX_COMPONENT_CREATION_TIME_IN_MS}getPortals(){return this.portals}destroy(){this.destroyed=!0}destroyPortal(e){this.portals=this.portals.filter(s=>s!==e),this.batchUpdate()}getComponentWrappingElement(){return this.wrappingElement}mountReactPortal(e,s,i){this.portals=[...this.portals,e],this.waitForInstance(s,i),this.batchUpdate()}updateReactPortal(e,s){this.portals[this.portals.indexOf(e)]=s,this.batchUpdate()}batchUpdate(){this.hasPendingPortalUpdate||(setTimeout(()=>{this.destroyed||(this.refresher(),this.hasPendingPortalUpdate=!1)}),this.hasPendingPortalUpdate=!0)}waitForInstance(e,s,i=Date.now()){if(this.destroyed){s(null);return}if(e.rendered())s(e);else{if(Date.now()-i>=this.maxComponentCreationTimeMs&&!this.hasPendingPortalUpdate){if(e.isNullValue()){s(e);return}console.error(`AG Grid: React Component '${e.getReactComponentName()}' not created within ${this.maxComponentCreationTimeMs}ms.`),console.error(" If the component is using `forwardRef` but not `useImperativeHandle`, add the following: `useImperativeHandle(ref, () => ({}));`");return}window.setTimeout(()=>{this.waitForInstance(e,s,i)})}}};jh.MAX_COMPONENT_CREATION_TIME_IN_MS=1e3;var LC=jh,lt=g.createContext({}),Wt=(...t)=>t.filter(s=>s!=null&&s!=="").join(" "),Nt=class kc{constructor(...e){this.classesMap={},e.forEach(s=>{this.classesMap[s]=!0})}setClass(e,s){if(!!this.classesMap[e]==s)return this;const o=new kc;return o.classesMap=Te({},this.classesMap),o.classesMap[e]=s,o}toString(){return Object.keys(this.classesMap).filter(s=>this.classesMap[s]).join(" ")}},to=t=>{const e=()=>typeof Symbol=="function"&&Symbol.for,s=()=>e()?Symbol.for("react.memo"):60115;return typeof t=="function"&&!(t.prototype&&t.prototype.isReactComponent)||typeof t=="object"&&t.$$typeof===s()},MC=lo.createRoot!=null&&lo.flushSync!=null,Tn=!1;function IC(t){return Tn||setTimeout(()=>Tn=!1,0),Tn=!0,t()}var Fa=(t,e)=>{MC&&t&&!Tn?lo.flushSync(e):e()};function La(t,e,s){if(e==null||t==null)return e;if(t===e||e.length===0&&t.length===0)return t;if(s||t.length===0&&e.length>0||t.length>0&&e.length===0)return e;const i=[],o=[],r=new Map,n=new Map;for(let l=0;l<e.length;l++){const a=e[l];n.set(a.getInstanceId(),a)}for(let l=0;l<t.length;l++){const a=t[l];r.set(a.getInstanceId(),a),n.has(a.getInstanceId())&&i.push(a)}for(let l=0;l<e.length;l++){const a=e[l],d=a.getInstanceId();r.has(d)||o.push(a)}return i.length===t.length&&o.length===0?t:i.length===0&&o.length===e.length?e:i.length===0?o:o.length===0?i:[...i,...o]}var lr=(t,e,s,i)=>{if(!t||t.componentFromFramework||e.isDestroyed())return;const r=t.newAgStackInstance();if(!r)return;let n,l,a=!1;return r.then(d=>{if(a){e.destroyBean(d);return}n=d,l=n.getGui(),s.appendChild(l),qh(i,n)}),()=>{a=!0,n&&(l&&l.parentElement&&l.parentElement.removeChild(l),e.destroyBean(n),i&&qh(i,void 0))}},qh=(t,e)=>{if(t)if(t instanceof Function)t(e);else{const s=t;s.current=e}},NC=t=>{const e=t.newAgStackInstance();if(e)return e.resolveNow(null,s=>s)},Qh=g.forwardRef((t,e)=>{var s;const i=g.useContext(lt).context,o=g.useRef(null),r=g.useRef(null),n=g.useRef(null),l=g.useRef(null),a=g.useRef(null),d=g.useRef(),[h,c]=g.useState(),[m,C]=g.useState(),[v,S]=g.useState(),[w,R]=g.useState(()=>new Nt),[y,b]=g.useState(()=>new Nt("ag-hidden")),[T,D]=g.useState(()=>new Nt("ag-hidden")),[A,F]=g.useState(()=>new Nt("ag-invisible"));g.useImperativeHandle(e,()=>({refresh(){return!1}})),g.useLayoutEffect(()=>lr(h,i,r.current),[h]);const k=g.useCallback(pe=>{if(o.current=pe,!o.current){i.destroyBean(d.current),d.current=null;return}const ee={setInnerRenderer:(Q,se)=>{c(Q),S(se)},setChildCount:Q=>C(Q),addOrRemoveCssClass:(Q,se)=>R(De=>De.setClass(Q,se)),setContractedDisplayed:Q=>D(se=>se.setClass("ag-hidden",!Q)),setExpandedDisplayed:Q=>b(se=>se.setClass("ag-hidden",!Q)),setCheckboxVisible:Q=>F(se=>se.setClass("ag-invisible",!Q))};d.current=i.createBean(new Ys),d.current.init(ee,o.current,n.current,l.current,a.current,Qh,t)},[]),x=g.useMemo(()=>`ag-cell-wrapper ${w.toString()}`,[w]),N=g.useMemo(()=>`ag-group-expanded ${y.toString()}`,[y]),G=g.useMemo(()=>`ag-group-contracted ${T.toString()}`,[T]),U=g.useMemo(()=>`ag-group-checkbox ${A.toString()}`,[A]),V=h&&h.componentFromFramework,te=V?h.componentClass:void 0,ae=h==null&&v!=null,ce=W.escapeString(v,!0);return g.createElement("span",Te({className:x,ref:k},t.colDef?{}:{role:(s=d.current)==null?void 0:s.getCellAriaRole()}),g.createElement("span",{className:N,ref:l}),g.createElement("span",{className:G,ref:a}),g.createElement("span",{className:U,ref:n}),g.createElement("span",{className:"ag-group-value",ref:r},ae&&g.createElement(g.Fragment,null,ce),V&&g.createElement(te,Te({},h.params))),g.createElement("span",{className:"ag-group-child-count"},m))}),Xh=Qh,xC=t=>{const{ctrl:e}=t,s=e.isAlive(),{context:i}=g.useContext(lt),o=s?e.getColId():void 0,[r,n]=g.useState(),l=g.useRef(null),a=g.useRef(null),d=g.useRef(null),h=g.useRef();let c=g.useRef();s&&!c.current&&(c.current=new Po(()=>l.current));const m=g.useCallback(w=>{var R;if(l.current=w,!l.current||!s)return;const y={setWidth:T=>{l.current&&(l.current.style.width=T)},addOrRemoveCssClass:(T,D)=>c.current.addOrRemoveCssClass(T,D),setAriaSort:T=>{l.current&&(T?W.setAriaSort(l.current,T):W.removeAriaSort(l.current))},setUserCompDetails:T=>n(T),getUserCompInstance:()=>h.current||void 0};e.setComp(y,l.current,a.current,d.current);const b=e.getSelectAllGui();(R=a.current)==null||R.insertAdjacentElement("afterend",b)},[]);g.useLayoutEffect(()=>lr(r,i,d.current,h),[r]),g.useEffect(()=>{e.setDragSource(l.current)},[r]);const C=g.useMemo(()=>!!((r==null?void 0:r.componentFromFramework)&&to(r.componentClass)),[r]),v=r&&r.componentFromFramework,S=r&&r.componentClass;return g.createElement("div",{ref:m,className:"ag-header-cell","col-id":o,role:"columnheader"},g.createElement("div",{ref:a,className:"ag-header-cell-resize",role:"presentation"}),g.createElement("div",{ref:d,className:"ag-header-cell-comp-wrapper",role:"presentation"},v&&C&&g.createElement(S,Te({},r.params)),v&&!C&&g.createElement(S,nt(Te({},r.params),{ref:h}))))},GC=g.memo(xC),OC=t=>{const{context:e}=g.useContext(lt),{ctrl:s}=t,[i,o]=g.useState(()=>new Nt),[r,n]=g.useState(()=>new Nt),[l,a]=g.useState("false"),[d,h]=g.useState(),[c,m]=g.useState(),C=g.useMemo(()=>s.getColId(),[]),v=g.useRef(null),S=g.useRef(null),w=g.useRef(),R=g.useCallback(F=>{if(v.current=F,!v.current)return;const k={setWidth:x=>{v.current&&(v.current.style.width=x)},addOrRemoveCssClass:(x,N)=>o(G=>G.setClass(x,N)),setUserCompDetails:x=>m(x),setResizableDisplayed:x=>{n(N=>N.setClass("ag-hidden",!x)),a(x?"false":"true")},setAriaExpanded:x=>h(x),getUserCompInstance:()=>w.current||void 0};s.setComp(k,v.current,S.current)},[]);g.useLayoutEffect(()=>lr(c,e,v.current),[c]),g.useEffect(()=>{v.current&&s.setDragSource(v.current)},[c]);const y=g.useMemo(()=>!!((c==null?void 0:c.componentFromFramework)&&to(c.componentClass)),[c]),b=g.useMemo(()=>"ag-header-group-cell "+i.toString(),[i]),T=g.useMemo(()=>"ag-header-cell-resize "+r.toString(),[r]),D=c&&c.componentFromFramework,A=c&&c.componentClass;return g.createElement("div",{ref:R,className:b,"col-id":C,role:"columnheader","aria-expanded":d},D&&y&&g.createElement(A,Te({},c.params)),D&&!y&&g.createElement(A,nt(Te({},c.params),{ref:w})),g.createElement("div",{ref:S,"aria-hidden":l,className:T}))},_C=g.memo(OC);function Ma(){W.warnOnce("Using custom components without `reactiveCustomComponents = true` is deprecated.")}var VC=t=>{const{context:e,gos:s}=g.useContext(lt),[i,o]=g.useState(()=>new Nt("ag-header-cell","ag-floating-filter")),[r,n]=g.useState(()=>new Nt),[l,a]=g.useState(()=>new Nt("ag-floating-filter-button","ag-hidden")),[d,h]=g.useState("false"),[c,m]=g.useState(),[C,v]=g.useState(1),S=g.useRef(null),w=g.useRef(null),R=g.useRef(null),y=g.useRef(null),b=g.useRef(),T=g.useRef(),D=pe=>{pe!=null&&b.current&&b.current(pe)},{ctrl:A}=t,F=g.useCallback(pe=>{if(S.current=pe,!S.current)return;T.current=new xe(Q=>{b.current=Q});const ee={addOrRemoveCssClass:(Q,se)=>o(De=>De.setClass(Q,se)),addOrRemoveBodyCssClass:(Q,se)=>n(De=>De.setClass(Q,se)),setButtonWrapperDisplayed:Q=>{a(se=>se.setClass("ag-hidden",!Q)),h(Q?"false":"true")},setWidth:Q=>{S.current&&(S.current.style.width=Q)},setCompDetails:Q=>m(Q),getFloatingFilterComp:()=>T.current?T.current:null,setMenuIcon:Q=>{var se;return(se=y.current)==null?void 0:se.appendChild(Q)}};A.setComp(ee,S.current,y.current,w.current)},[]);g.useLayoutEffect(()=>lr(c,e,w.current,D),[c]);const k=g.useMemo(()=>i.toString(),[i]),x=g.useMemo(()=>r.toString(),[r]),N=g.useMemo(()=>l.toString(),[l]),G=g.useMemo(()=>!!(c&&c.componentFromFramework&&to(c.componentClass)),[c]),U=g.useMemo(()=>s.get("reactiveCustomComponents"),[]),V=g.useMemo(()=>{if(c)if(U){const pe=new RC(c.params,()=>v(ee=>ee+1));return D(pe),pe}else c.componentFromFramework&&Ma()},[c]),te=V==null?void 0:V.getProps(),ae=c&&c.componentFromFramework,ce=c&&c.componentClass;return g.createElement("div",{ref:F,className:k,role:"gridcell"},g.createElement("div",{ref:w,className:x,role:"presentation"},ae&&!U&&g.createElement(ce,nt(Te({},c.params),{ref:G?()=>{}:D})),ae&&U&&g.createElement(Aa.Provider,{value:{setMethods:pe=>V.setMethods(pe)}},g.createElement(ce,Te({},te)))),g.createElement("div",{ref:R,"aria-hidden":d,className:N,role:"presentation"},g.createElement("button",{ref:y,type:"button",className:"ag-button ag-floating-filter-button-button",tabIndex:-1})))},HC=g.memo(VC),kC=t=>{const{ctrl:e}=t,{topOffset:s,rowHeight:i}=g.useMemo(()=>e.getTopAndHeight(),[]),o=e.getAriaRowIndex(),r=e.getHeaderRowClass(),[n,l]=g.useState(()=>i+"px"),[a,d]=g.useState(()=>s+"px"),h=g.useRef(null),c=g.useRef(null),[m,C]=g.useState(()=>e.getHeaderCtrls()),v=g.useRef(null),S=g.useCallback(y=>{if(v.current=y,!y)return;const b={setHeight:T=>l(T),setTop:T=>d(T),setHeaderCtrls:(T,D,A)=>{c.current=h.current,h.current=T;const F=La(c.current,T,D);F!==c.current&&Fa(A,()=>C(F))},setWidth:T=>{v.current&&(v.current.style.width=T)}};e.setComp(b,!1)},[]),w=g.useMemo(()=>({height:n,top:a}),[n,a]),R=g.useCallback(y=>{switch(e.getType()){case sa.COLUMN_GROUP:return g.createElement(_C,{ctrl:y,key:y.getInstanceId()});case sa.FLOATING_FILTER:return g.createElement(HC,{ctrl:y,key:y.getInstanceId()});default:return g.createElement(GC,{ctrl:y,key:y.getInstanceId()})}},[]);return g.createElement("div",{ref:S,className:r,role:"row",style:w,"aria-rowindex":o},m.map(R))},BC=g.memo(kC),WC=t=>{const[e,s]=g.useState(!0),[i,o]=g.useState([]),{context:r}=g.useContext(lt),n=g.useRef(null),l=g.useRef(null),a=g.useRef(null),d=t.pinned==="left",h=t.pinned==="right",c=!d&&!h,m=g.useCallback(S=>{if(n.current=S,!n.current){r.destroyBean(a.current),a.current=null;return}const w={setDisplayed:s,setCtrls:R=>o(R),setCenterWidth:R=>{l.current&&(l.current.style.width=R)},setViewportScrollLeft:R=>{n.current&&(n.current.scrollLeft=R)},setPinnedContainerWidth:R=>{n.current&&(n.current.style.width=R,n.current.style.minWidth=R,n.current.style.maxWidth=R)}};a.current=r.createBean(new Es(t.pinned)),a.current.setComp(w,n.current)},[]),C=e?"":"ag-hidden",v=()=>i.map(S=>g.createElement(BC,{ctrl:S,key:S.getInstanceId()}));return g.createElement(g.Fragment,null,d&&g.createElement("div",{ref:m,className:"ag-pinned-left-header "+C,"aria-hidden":!e,role:"rowgroup"},v()),h&&g.createElement("div",{ref:m,className:"ag-pinned-right-header "+C,"aria-hidden":!e,role:"rowgroup"},v()),c&&g.createElement("div",{ref:m,className:"ag-header-viewport "+C,role:"presentation"},g.createElement("div",{ref:l,className:"ag-header-container",role:"rowgroup"},v())))},Ia=g.memo(WC),UC=()=>{const[t,e]=g.useState(()=>new Nt),[s,i]=g.useState(),{context:o}=g.useContext(lt),r=g.useRef(null),n=g.useRef(null),l=g.useCallback(h=>{if(r.current=h,!h){o.destroyBean(n.current),n.current=null;return}const c={addOrRemoveCssClass:(m,C)=>e(v=>v.setClass(m,C)),setHeightAndMinHeight:m=>i(m)};n.current=o.createBean(new ys),n.current.setComp(c,r.current,r.current)},[]),a=g.useMemo(()=>"ag-header "+t.toString(),[t]),d=g.useMemo(()=>({height:s,minHeight:s}),[s]);return g.createElement("div",{ref:l,className:a,style:d,role:"presentation"},g.createElement(Ia,{pinned:"left"}),g.createElement(Ia,{pinned:null}),g.createElement(Ia,{pinned:"right"}))},zC=g.memo(UC),KC=(t,e)=>{g.useEffect(()=>{const s=e.current;if(s){const i=s.parentElement;if(i){const o=document.createComment(t);return i.insertBefore(o,s),()=>{i.removeChild(o)}}}},[t])},gi=KC,YC=t=>{const e=g.useRef(t),s=g.useRef(),i=g.useRef(!1),o=g.useRef(!1),[,r]=g.useState(0);i.current&&(o.current=!0),g.useEffect(()=>(i.current||(s.current=e.current(),i.current=!0),r(n=>n+1),()=>{o.current&&s.current&&s.current()}),[])},jC=t=>{const[e,s]=g.useState(),{context:i,popupService:o,localeService:r,gos:n}=g.useContext(lt);return YC(()=>{const{editDetails:l,cellCtrl:a,eParentCell:d}=t,{compDetails:h}=l,c=n.get("stopEditingWhenCellsLoseFocus"),m=i.createBean(new Ah(h.params)),C=m.getGui();if(t.jsChildComp){const b=t.jsChildComp.getGui();b&&C.appendChild(b)}const v={column:a.getColumn(),rowNode:a.getRowNode(),type:"popupCellEditor",eventSource:d,ePopup:C,position:l.popupPosition,keepWithinBounds:!0},S=o.positionPopupByComponent.bind(o,v),w=r.getLocaleTextFunc(),R=o.addPopup({modal:c,eChild:C,closeOnEsc:!0,closedCallback:()=>{a.onPopupEditorClosed()},anchorToElement:d,positionCallback:S,ariaLabel:w("ariaLabelCellEditor","Cell Editor")}),y=R?R.hideFunc:void 0;return s(m),t.jsChildComp&&t.jsChildComp.afterGuiAttached&&t.jsChildComp.afterGuiAttached(),()=>{y!=null&&y(),i.destroyBean(m)}}),g.createElement(g.Fragment,null,e&&t.wrappedContent&&lo.createPortal(t.wrappedContent,e.getGui()))},Jh=g.memo(jC),qC=(t,e,s,i,o,r)=>{const{context:n}=g.useContext(lt),l=g.useCallback(()=>{const a=o.current;if(!a)return;const d=a.getGui();d&&d.parentElement&&d.parentElement.removeChild(d),n.destroyBean(a),o.current=void 0},[]);g.useEffect(()=>{const a=t!=null,d=t&&t.compDetails&&!t.compDetails.componentFromFramework,h=e&&s==null;if(!(a&&d&&!h)){l();return}const m=t.compDetails;if(o.current){const R=o.current,b=R.refresh!=null&&t.force==!1?R.refresh(m.params):!1;if(b===!0||b===void 0)return;l()}const C=m.newAgStackInstance();if(!C)return;const v=C.resolveNow(null,R=>R);if(!v)return;const S=v.getGui();if(!S)return;(e?s:r.current).appendChild(S),o.current=v},[t,e,i]),g.useEffect(()=>l,[])},QC=qC,XC=class{constructor(t,e){this.cellEditorParams=t,this.refreshProps=e,this.instanceCreated=new xe(s=>{this.resolveInstanceCreated=s}),this.onValueChange=s=>this.updateValue(s),this.value=t.value}getProps(){return nt(Te({},this.cellEditorParams),{initialValue:this.cellEditorParams.value,value:this.value,onValueChange:this.onValueChange})}getValue(){return this.value}refresh(t){this.cellEditorParams=t,this.refreshProps()}setMethods(t){Pa(this.getOptionalMethods(),t,this)}getInstance(){return this.instanceCreated.then(()=>this.componentInstance)}setRef(t){var e;this.componentInstance=t,(e=this.resolveInstanceCreated)==null||e.call(this),this.resolveInstanceCreated=void 0}getOptionalMethods(){return["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached"]}updateValue(t){this.value=t,this.refreshProps()}},JC=(t,e,s)=>{const i=s.getColumn();if(!t&&e.isPopup&&e.isPopup()){const o=`AG Grid: Found an issue in column ${i.getColId()}. If using React, specify an editor is a popup using colDef.cellEditorPopup=true. AG Grid React cannot depend on the editor component specifying if it's in a popup (via the isPopup() method on the editor), as React needs to know this information BEFORE the component is created.`;W.doOnce(()=>console.warn(o),"jsEditorComp-isPopup-"+s.getColumn().getColId())}if(t&&e.getPopupPosition&&e.getPopupPosition()!=null){const o=`AG Grid: Found an issue in column ${i.getColId()}. If using React, specify an editor popup position using colDef.cellEditorPopupPosition=true. AG Grid React cannot depend on the editor component specifying it's position (via the getPopupPosition() method on the editor), as React needs to know this information BEFORE the component is created.`;W.doOnce(()=>console.warn(o),"jsEditorComp-getPopupPosition-"+s.getColumn().getColId())}},ZC=(t,e,s)=>{const{compProxy:i}=t;s(i);const o=i.getProps(),r=to(e);return g.createElement(Aa.Provider,{value:{setMethods:n=>i.setMethods(n)}},r&&g.createElement(e,Te({},o)),!r&&g.createElement(e,nt(Te({},o),{ref:n=>i.setRef(n)})))},Zh=(t,e,s)=>{const i=t.compProxy;return g.createElement(g.Fragment,null,!i&&g.createElement(e,nt(Te({},t.compDetails.params),{ref:s})),i&&ZC(t,e,s))},$C=(t,e,s,i,o,r)=>{const n=t.compDetails,l=n.componentClass,a=n.componentFromFramework&&!t.popup,d=n.componentFromFramework&&t.popup,h=!n.componentFromFramework&&t.popup;return g.createElement(g.Fragment,null,a&&Zh(t,l,e),d&&g.createElement(Jh,{editDetails:t,cellCtrl:o,eParentCell:i,wrappedContent:Zh(t,l,s)}),h&&r&&g.createElement(Jh,{editDetails:t,cellCtrl:o,eParentCell:i,jsChildComp:r}))},ev=(t,e,s,i,o,r,n)=>{const{compDetails:l,value:a}=t,d=!l,h=l&&l.componentFromFramework,c=l&&l.componentClass,m=a!=null&&a.toString?a.toString():a,C=()=>g.createElement(g.Fragment,null,d&&g.createElement(g.Fragment,null,m),h&&!r&&g.createElement(c,nt(Te({},l.params),{key:e,ref:i})),h&&r&&g.createElement(c,nt(Te({},l.params),{key:e})));return g.createElement(g.Fragment,null,o?g.createElement("span",{role:"presentation",id:`cell-${s}`,className:"ag-cell-value",ref:n},C()):C())},tv=t=>{const{context:e}=g.useContext(lt),{cellCtrl:s,printLayout:i,editingRow:o}=t,r=s.getTabIndex(),n=s.getColumnIdSanitised(),l=s.getInstanceId(),[a,d]=g.useState(()=>s.isCellRenderer()?void 0:{compDetails:void 0,value:s.getValueToDisplay(),force:!1}),[h,c]=g.useState(),[m,C]=g.useState(1),[v,S]=g.useState(),[w,R]=g.useState(!1),[y,b]=g.useState(!1),[T,D]=g.useState(!1),[A,F]=g.useState(),k=g.useMemo(()=>s.isForceWrapper(),[s]),x=g.useMemo(()=>s.getCellAriaRole(),[s]),N=g.useRef(null),G=g.useRef(null),U=g.useRef(),V=g.useRef(),te=g.useRef(),ae=g.useRef([]),ce=g.useRef(),[pe,ee]=g.useState(0),Q=g.useCallback(re=>{ce.current=re,ee(ue=>ue+1)},[]),se=a!=null&&(w||T||y),De=k||se,oe=g.useCallback((re,ue)=>{V.current=ue,ue&&(JC(re,ue,s),ue.isCancelBeforeStart&&ue.isCancelBeforeStart()&&setTimeout(()=>{s.stopEditing(!0),s.focusCell(!0)}))},[s]),ve=g.useCallback(re=>oe(!0,re),[oe]),Rt=g.useCallback(re=>oe(!1,re),[oe]);let B=g.useRef();B.current||(B.current=new Po(()=>N.current)),QC(a,De,ce.current,pe,U,N);const Ce=g.useRef();g.useLayoutEffect(()=>{const re=Ce.current,ue=a;if(Ce.current=a,re==null||re.compDetails==null||ue==null||ue.compDetails==null)return;const Fe=re.compDetails,Y=ue.compDetails;if(Fe.componentClass!=Y.componentClass||G.current==null||G.current.refresh==null)return;G.current.refresh(Y.params)!=!0&&C(Ct=>Ct+1)},[a]),g.useLayoutEffect(()=>{if(!(h&&!h.compDetails.componentFromFramework))return;const ue=h.compDetails,Fe=h.popup===!0,Y=NC(ue);if(!Y)return;const Se=Y.getGui();if(oe(Fe,Y),!Fe){const Ct=(k?te:N).current;Ct==null||Ct.appendChild(Se),Y.afterGuiAttached&&Y.afterGuiAttached()}return F(Y),()=>{e.destroyBean(Y),oe(Fe,void 0),F(void 0),Se&&Se.parentElement&&Se.parentElement.removeChild(Se)}},[h]);const de=g.useCallback(re=>{if(te.current=re,!te.current){ae.current.forEach(Fe=>Fe()),ae.current=[];return}const ue=Fe=>{var Y;if(Fe){const Se=Fe.getGui();(Y=te.current)==null||Y.insertAdjacentElement("afterbegin",Se),ae.current.push(()=>{e.destroyBean(Fe),W.removeFromParent(Se)})}return Fe};if(w){const Fe=s.createSelectionCheckbox();ue(Fe)}T&&ue(s.createDndSource()),y&&ue(s.createRowDragComp())},[s,e,T,y,w]),Ge=g.useCallback(re=>{if(N.current=re,!N.current||!s)return;const ue={addOrRemoveCssClass:(Y,Se)=>B.current.addOrRemoveCssClass(Y,Se),setUserStyles:Y=>S(Y),getFocusableElement:()=>N.current,setIncludeSelection:Y=>R(Y),setIncludeRowDrag:Y=>b(Y),setIncludeDndSource:Y=>D(Y),getCellEditor:()=>V.current||null,getCellRenderer:()=>G.current?G.current:U.current,getParentOfValue:()=>ce.current?ce.current:te.current?te.current:N.current,setRenderDetails:(Y,Se,Ct)=>{d(Ut=>(Ut==null?void 0:Ut.compDetails)!==Y||(Ut==null?void 0:Ut.value)!==Se||(Ut==null?void 0:Ut.force)!==Ct?{value:Se,compDetails:Y,force:Ct}:Ut)},setEditDetails:(Y,Se,Ct,Ut)=>{if(Y){let fi;Ut?fi=new XC(Y.params,()=>C(xa=>xa+1)):Y.componentFromFramework&&Ma(),c({compDetails:Y,popup:Se,popupPosition:Ct,compProxy:fi}),Se||d(void 0)}else c(fi=>{fi!=null&&fi.compProxy&&(V.current=void 0)})}},Fe=te.current||void 0;s.setComp(ue,N.current,Fe,i,o)},[]),Je=g.useMemo(()=>!!(a&&a.compDetails&&a.compDetails.componentFromFramework&&to(a.compDetails.componentClass)),[a]);g.useLayoutEffect(()=>{var re;N.current&&(B.current.addOrRemoveCssClass("ag-cell-value",!De),B.current.addOrRemoveCssClass("ag-cell-inline-editing",!!h&&!h.popup),B.current.addOrRemoveCssClass("ag-cell-popup-editing",!!h&&!!h.popup),B.current.addOrRemoveCssClass("ag-cell-not-inline-editing",!h||!!h.popup),(re=s.getRowCtrl())==null||re.setInlineEditingCss(!!h),s.shouldRestoreFocus()&&!s.isEditing()&&N.current.focus({preventScroll:!0}))});const Ve=()=>g.createElement(g.Fragment,null,a!=null&&ev(a,m,l,G,De,Je,Q),h!=null&&$C(h,Rt,ve,N.current,s,A));return g.createElement("div",{ref:Ge,style:v,tabIndex:r,role:x,"col-id":n},De?g.createElement("div",{className:"ag-cell-wrapper",role:"presentation",ref:de},Ve()):Ve())},sv=g.memo(tv),iv=t=>{const{context:e,gos:s}=g.useContext(lt),{rowCtrl:i,containerType:o}=t,r=i.getTabIndex(),n=g.useRef(i.getDomOrder()),l=i.isFullWidth(),a=i.getRowNode().displayed,[d,h]=g.useState(()=>a?i.getRowIndex():null),[c,m]=g.useState(()=>i.getRowId()),[C,v]=g.useState(()=>i.getBusinessKey()),[S,w]=g.useState(()=>i.getRowStyles()),R=g.useRef(null),y=g.useRef(null),[b,T]=g.useState(()=>null),[D,A]=g.useState(),[F,k]=g.useState(()=>a?i.getInitialRowTop(o):void 0),[x,N]=g.useState(()=>a?i.getInitialTransform(o):void 0),G=g.useRef(null),U=g.useRef(),V=g.useRef(!1),[te,ae]=g.useState(0);g.useEffect(()=>{var B;if(V.current||!D||te>10)return;const Ce=(B=G.current)==null?void 0:B.firstChild;Ce?(i.setupDetailRowAutoHeight(Ce),V.current=!0):ae(de=>de+1)},[D,te]);let ce=g.useRef();ce.current||(ce.current=new Po(()=>G.current));const pe=g.useCallback(B=>{if(G.current=B,!G.current){i.unsetComp(o);return}if(!i.isAlive())return;const Ce={setTop:k,setTransform:N,addOrRemoveCssClass:(de,Ge)=>ce.current.addOrRemoveCssClass(de,Ge),setDomOrder:de=>n.current=de,setRowIndex:h,setRowId:m,setRowBusinessKey:v,setUserStyles:w,setCellCtrls:(de,Ge)=>{y.current=R.current,R.current=de;const Je=La(y.current,de,n.current);Je!==y.current&&Fa(Ge,()=>T(Je))},showFullWidth:de=>A(de),getFullWidthCellRenderer:()=>U.current,refreshFullWidth:de=>oe.current?(A(Ge=>nt(Te({},Ge),{params:de()})),!0):!U.current||!U.current.refresh?!1:U.current.refresh(de())};i.setComp(Ce,G.current,o)},[]);g.useLayoutEffect(()=>lr(D,e,G.current,U),[D]);const ee=g.useMemo(()=>{const B={top:F,transform:x};return Object.assign(B,S),B},[F,x,S]),Q=l&&D&&D.componentFromFramework,se=!l&&b!=null,De=g.useMemo(()=>!!((D==null?void 0:D.componentFromFramework)&&to(D.componentClass)),[D]),oe=g.useRef(!1);g.useEffect(()=>{oe.current=De&&!!D&&!!s.get("reactiveCustomComponents")},[De,D]);const ve=()=>b==null?void 0:b.map(B=>g.createElement(sv,{cellCtrl:B,editingRow:i.isEditing(),printLayout:i.isPrintLayout(),key:B.getInstanceId()})),Rt=()=>{const B=D.componentClass;return g.createElement(g.Fragment,null,De&&g.createElement(B,Te({},D.params)),!De&&g.createElement(B,nt(Te({},D.params),{ref:U})))};return g.createElement("div",{ref:pe,role:"row",style:ee,"row-index":d,"row-id":c,"row-business-key":C,tabIndex:r},se&&ve(),Q&&Rt())},ov=g.memo(iv),rv=t=>{const{context:e}=g.useContext(lt),{name:s}=t,i=g.useMemo(()=>Dh(s),[s]),o=g.useRef(null),r=g.useRef(null),n=g.useRef([]),l=g.useRef([]),[a,d]=g.useState(()=>[]),h=g.useRef(!1),c=g.useRef(),m=g.useMemo(()=>rn.getRowContainerCssClasses(s),[s]),C=g.useMemo(()=>Wt(m.viewport),[m]),v=g.useMemo(()=>Wt(m.container),[m]),S=s===Re.CENTER||s===Re.TOP_CENTER||s===Re.BOTTOM_CENTER||s===Re.STICKY_TOP_CENTER||s===Re.STICKY_BOTTOM_CENTER,w=S?o:r;gi(" AG Row Container "+s+" ",w);const R=g.useCallback(()=>S?o.current!=null&&r.current!=null:r.current!=null,[]),y=g.useCallback(()=>S?o.current==null&&r.current==null:r.current==null,[]),b=g.useCallback(()=>{if(y()&&(e.destroyBean(c.current),c.current=null),R()){const F=x=>{const N=La(l.current,n.current,h.current);N!==l.current&&(l.current=N,Fa(x,()=>d(N)))},k={setViewportHeight:x=>{o.current&&(o.current.style.height=x)},setRowCtrls:({rowCtrls:x,useFlushSync:N})=>{const G=!!N&&n.current.length>0&&x.length>0;n.current=x,F(G)},setDomOrder:x=>{h.current!=x&&(h.current=x,F(!1))},setContainerWidth:x=>{r.current&&(r.current.style.width=x)}};c.current=e.createBean(new rn(s)),c.current.setComp(k,r.current,o.current)}},[R,y]),T=g.useCallback(F=>{r.current=F,b()},[b]),D=g.useCallback(F=>{o.current=F,b()},[b]),A=()=>g.createElement("div",{className:v,ref:T,role:"rowgroup"},a.map(F=>g.createElement(ov,{rowCtrl:F,containerType:i,key:F.getInstanceId()})));return g.createElement(g.Fragment,null,S?g.createElement("div",{className:C,ref:D,role:"presentation"},A()):A())},nv=g.memo(rv),lv=()=>{const{context:t,agStackComponentsRegistry:e,resizeObserverService:s}=g.useContext(lt),[i,o]=g.useState(""),[r,n]=g.useState(0),[l,a]=g.useState(0),[d,h]=g.useState("0px"),[c,m]=g.useState("0px"),[C,v]=g.useState("100%"),[S,w]=g.useState("0px"),[R,y]=g.useState("0px"),[b,T]=g.useState("100%"),[D,A]=g.useState(""),[F,k]=g.useState(""),[x,N]=g.useState(null),[G,U]=g.useState(""),[V,te]=g.useState(null),[ae,ce]=g.useState("ag-layout-normal");let pe=g.useRef();pe.current||(pe.current=new Po(()=>ee.current));const ee=g.useRef(null),Q=g.useRef(null),se=g.useRef(null),De=g.useRef(null),oe=g.useRef(null),ve=g.useRef(null),Rt=g.useRef(null),B=g.useRef([]),Ce=g.useRef([]);gi(" AG Grid Body ",ee),gi(" AG Pinned Top ",Q),gi(" AG Sticky Top ",se),gi(" AG Middle ",ve),gi(" AG Pinned Bottom ",Rt);const de=g.useCallback(so=>{if(ee.current=so,!ee.current){t.destroyBeans(B.current),Ce.current.forEach(Ke=>Ke()),B.current=[],Ce.current=[];return}if(!t)return;const dr=Ke=>{const es=e.getComponentClass(Ke),nc=t.createBean(new es);return B.current.push(nc),nc},Ns=(Ke,es)=>{Ke.appendChild(es),Ce.current.push(()=>Ke.removeChild(es))};Ns(ee.current,document.createComment(" AG Fake Horizontal Scroll ")),Ns(ee.current,dr("AG-FAKE-HORIZONTAL-SCROLL").getGui()),Ns(ee.current,document.createComment(" AG Overlay Wrapper ")),Ns(ee.current,dr("AG-OVERLAY-WRAPPER").getGui()),oe.current&&(Ns(oe.current,document.createComment(" AG Fake Vertical Scroll ")),Ns(oe.current,dr("AG-FAKE-VERTICAL-SCROLL").getGui()));const Ga={setRowAnimationCssOnBodyViewport:o,setColumnCount:Ke=>{ee.current&&W.setAriaColCount(ee.current,Ke)},setRowCount:Ke=>{ee.current&&W.setAriaRowCount(ee.current,Ke)},setTopHeight:n,setBottomHeight:a,setStickyTopHeight:h,setStickyTopTop:m,setStickyTopWidth:v,setTopDisplay:A,setBottomDisplay:k,setColumnMovingCss:(Ke,es)=>pe.current.addOrRemoveCssClass(Ke,es),updateLayoutClasses:ce,setAlwaysVerticalScrollClass:N,setPinnedTopBottomOverflowY:U,setCellSelectableCss:(Ke,es)=>te(es?Ke:null),setBodyViewportWidth:Ke=>{ve.current&&(ve.current.style.width=Ke)},registerBodyViewportResizeListener:Ke=>{if(ve.current){const es=s.observeResize(ve.current,Ke);Ce.current.push(()=>es())}},setStickyBottomHeight:w,setStickyBottomBottom:y,setStickyBottomWidth:T},rc=t.createBean(new Qe);B.current.push(rc),rc.setComp(Ga,ee.current,ve.current,Q.current,Rt.current,se.current,De.current)},[]),Ge=g.useMemo(()=>Wt("ag-root","ag-unselectable",ae),[ae]),Je=g.useMemo(()=>Wt("ag-body-viewport",i,ae,x,V),[i,ae,x,V]),Ve=g.useMemo(()=>Wt("ag-body",ae),[ae]),re=g.useMemo(()=>Wt("ag-floating-top",V),[V]),ue=g.useMemo(()=>Wt("ag-sticky-top",V),[V]),Fe=g.useMemo(()=>Wt("ag-sticky-bottom",V),[V]),Y=g.useMemo(()=>Wt("ag-floating-bottom",V),[V]),Se=g.useMemo(()=>({height:r,minHeight:r,display:D,overflowY:G}),[r,D,G]),Ct=g.useMemo(()=>({height:d,top:c,width:C}),[d,c,C]),Ut=g.useMemo(()=>({height:S,bottom:R,width:b}),[S,R,b]),fi=g.useMemo(()=>({height:l,minHeight:l,display:F,overflowY:G}),[l,F,G]),xa=so=>g.createElement(nv,{name:so,key:`${so}-container`}),ar=({section:so,children:dr,className:Ns,style:Ga})=>g.createElement("div",{ref:so,className:Ns,role:"presentation",style:Ga},dr.map(xa));return g.createElement("div",{ref:de,className:Ge,role:"treegrid"},g.createElement(zC,null),ar({section:Q,className:re,style:Se,children:[Re.TOP_LEFT,Re.TOP_CENTER,Re.TOP_RIGHT,Re.TOP_FULL_WIDTH]}),g.createElement("div",{className:Ve,ref:oe,role:"presentation"},ar({section:ve,className:Je,children:[Re.LEFT,Re.CENTER,Re.RIGHT,Re.FULL_WIDTH]})),ar({section:se,className:ue,style:Ct,children:[Re.STICKY_TOP_LEFT,Re.STICKY_TOP_CENTER,Re.STICKY_TOP_RIGHT,Re.STICKY_TOP_FULL_WIDTH]}),ar({section:De,className:Fe,style:Ut,children:[Re.STICKY_BOTTOM_LEFT,Re.STICKY_BOTTOM_CENTER,Re.STICKY_BOTTOM_RIGHT,Re.STICKY_BOTTOM_FULL_WIDTH]}),ar({section:Rt,className:Y,style:fi,children:[Re.BOTTOM_LEFT,Re.BOTTOM_CENTER,Re.BOTTOM_RIGHT,Re.BOTTOM_FULL_WIDTH]}))},av=g.memo(lv),dv=(t,e)=>{const{children:s,eFocusableElement:i,onTabKeyDown:o,gridCtrl:r,forceFocusOutWhenTabGuardsAreEmpty:n}=t,{context:l}=g.useContext(lt),a=g.useRef(null),d=g.useRef(null),h=g.useRef(),c=w=>{const R=w==null?void 0:parseInt(w,10).toString();[a,d].forEach(y=>{var b,T;R===void 0?(b=y.current)==null||b.removeAttribute("tabindex"):(T=y.current)==null||T.setAttribute("tabindex",R)})};g.useImperativeHandle(e,()=>({forceFocusOutOfContainer(w){var R;(R=h.current)==null||R.forceFocusOutOfContainer(w)}}));const m=g.useCallback(()=>{if(!a.current&&!d.current){l.destroyBean(h.current),h.current=null;return}if(a.current&&d.current){const w={setTabIndex:c};h.current=l.createBean(new un({comp:w,eTopGuard:a.current,eBottomGuard:d.current,eFocusableElement:i,onTabKeyDown:o,forceFocusOutWhenTabGuardsAreEmpty:n,focusInnerElement:R=>r.focusInnerElement(R)}))}},[]),C=g.useCallback(w=>{a.current=w,m()},[m]),v=g.useCallback(w=>{d.current=w,m()},[m]),S=w=>{const R=w==="top"?dn.TAB_GUARD_TOP:dn.TAB_GUARD_BOTTOM;return g.createElement("div",{className:`${dn.TAB_GUARD} ${R}`,role:"presentation",ref:w==="top"?C:v})};return g.createElement(g.Fragment,null,S("top"),s,S("bottom"))},uv=g.forwardRef(dv),hv=g.memo(uv),cv=({context:t})=>{const[e,s]=g.useState(""),[i,o]=g.useState(""),[r,n]=g.useState(""),[l,a]=g.useState(null),[d,h]=g.useState(null),[c,m]=g.useState(!1),[C,v]=g.useState(),S=g.useRef(null),w=g.useRef(null),R=g.useRef(),[y,b]=g.useState(null),T=g.useRef(()=>{}),D=g.useCallback(()=>{},[]),A=g.useMemo(()=>t.isDestroyed()?null:t.getBean("beans"),[t]);gi(" AG Grid ",w);const F=g.useCallback(U=>{if(w.current=U,!w.current){t.destroyBean(S.current),S.current=null;return}if(t.isDestroyed())return;S.current=t.createBean(new Fs);const V=S.current;T.current=V.focusInnerElement.bind(V);const te={destroyGridUi:()=>{},setRtlClass:s,forceFocusOutOfContainer:ae=>{var ce;(ce=R.current)==null||ce.forceFocusOutOfContainer(ae)},updateLayoutClasses:n,getFocusableContainers:()=>{var ae,ce;const pe=[],ee=(ae=w.current)==null?void 0:ae.querySelector(".ag-root"),Q=(ce=w.current)==null?void 0:ce.querySelector(".ag-side-bar:not(.ag-hidden)");return ee&&pe.push(ee),Q&&pe.push(Q),pe},setCursor:a,setUserSelect:h};V.setComp(te,w.current,w.current),m(!0)},[]);g.useEffect(()=>{if(!C||!A||!S.current||!y||!w.current)return;const U=S.current,V=[],{agStackComponentsRegistry:te}=A,ae=te.getComponentClass("AG-GRID-HEADER-DROP-ZONES"),ce=te.getComponentClass("AG-SIDE-BAR"),pe=te.getComponentClass("AG-STATUS-BAR"),ee=te.getComponentClass("AG-WATERMARK"),Q=te.getComponentClass("AG-PAGINATION"),se=[],De=w.current;if(U.showDropZones()&&ae){const oe=t.createBean(new ae),ve=oe.getGui();De.insertAdjacentElement("afterbegin",ve),se.push(ve),V.push(oe)}if(U.showSideBar()&&ce){const oe=t.createBean(new ce),ve=oe.getGui(),Rt=y.querySelector(".ag-tab-guard-bottom");Rt&&(Rt.insertAdjacentElement("beforebegin",ve),se.push(ve)),V.push(oe)}if(U.showStatusBar()&&pe){const oe=t.createBean(new pe),ve=oe.getGui();De.insertAdjacentElement("beforeend",ve),se.push(ve),V.push(oe)}if(Q){const oe=t.createBean(new Q),ve=oe.getGui();De.insertAdjacentElement("beforeend",ve),se.push(ve),V.push(oe)}if(U.showWatermark()&&ee){const oe=t.createBean(new ee),ve=oe.getGui();De.insertAdjacentElement("beforeend",ve),se.push(ve),V.push(oe)}return()=>{t.destroyBeans(V),se.forEach(oe=>{oe.parentElement&&oe.parentElement.removeChild(oe)})}},[C,y,A]);const k=g.useMemo(()=>Wt("ag-root-wrapper",e,i,r),[e,i,r]),x=g.useMemo(()=>Wt("ag-root-wrapper-body","ag-focus-managed",r),[r]),N=g.useMemo(()=>({userSelect:d??"",WebkitUserSelect:d??"",cursor:l??""}),[d,l]),G=g.useCallback(U=>{R.current=U,v(U!==null)},[]);return g.createElement("div",{ref:F,className:k,style:N,role:"presentation"},g.createElement("div",{className:x,ref:b,role:"presentation"},c&&y&&A&&g.createElement(lt.Provider,{value:A},g.createElement(hv,{ref:G,eFocusableElement:y,onTabKeyDown:D,gridCtrl:S.current,forceFocusOutWhenTabGuardsAreEmpty:!0},g.createElement(av,null)))))},pv=g.memo(cv),$h=t=>{var e,s;const i=g.useRef(),o=g.useRef(null),r=g.useRef(null),n=g.useRef([]),l=g.useRef([]),a=g.useRef(t),d=g.useRef(!1),[h,c]=g.useState(void 0),[,m]=g.useState(0),C=g.useCallback(w=>{if(o.current=w,!o.current){n.current.forEach(F=>F()),n.current.length=0;return}const R=t.modules||[];r.current||(r.current=new LC(()=>m(F=>F+1),t.componentWrappingElement,t.maxComponentCreationTimeMs),n.current.push(()=>{var F;(F=r.current)==null||F.destroy(),r.current=null}));const y=Mr.combineAttributesAndGridOptions(t.gridOptions,t),b={providedBeanInstances:{frameworkComponentWrapper:new fv(r.current,!!y.reactiveCustomComponents)},modules:R,frameworkOverrides:new Cv},T=F=>{c(F),n.current.push(()=>{F.destroy()}),F.getBean(li.NAME).whenReady(()=>{if(F.isDestroyed())return;const x=i.current;x&&t.setGridApi&&t.setGridApi(x,new zi(x))})},D=F=>{F.getBean(li.NAME).whenReady(()=>{l.current.forEach(x=>x()),l.current.length=0,d.current=!0})},A=new qm;i.current=A.create(o.current,y,T,D,b)},[]),v=g.useMemo(()=>Te({height:"100%"},t.containerStyle||{}),[t.containerStyle]),S=g.useCallback(w=>{d.current?w():l.current.push(w)},[]);return g.useEffect(()=>{const w=gv(a.current,t);a.current=t,S(()=>{i.current&&Mr.processOnChange(w,i.current)})},[t]),g.createElement("div",{style:v,className:t.className,ref:C},h&&!h.isDestroyed()?g.createElement(pv,{context:h}):null,(s=(e=r.current)==null?void 0:e.getPortals())!=null?s:null)};function gv(t,e){const s={};return Object.keys(e).forEach(i=>{const o=e[i];t[i]!==o&&(s[i]=o)}),s}var fv=class extends Qm{constructor(t,e){super(),this.parent=t,this.reactiveCustomComponents=e}createWrapper(t,e){if(this.reactiveCustomComponents){const o=(r=>{switch(r){case"filter":return yC;case"floatingFilterComponent":return bC;case"dateComponent":return EC;case"loadingOverlayComponent":return TC;case"noRowsOverlayComponent":return AC;case"statusPanel":return PC;case"toolPanel":return FC;case"menuItem":return DC}})(e.propertyName);if(o)return new o(t,this.parent,e)}else switch(e.propertyName){case"filter":case"floatingFilterComponent":case"dateComponent":case"loadingOverlayComponent":case"noRowsOverlayComponent":case"statusPanel":case"toolPanel":case"menuItem":Ma();break}const s=!e.cellRenderer&&e.propertyName!=="toolPanel";return new Kh(t,this.parent,e,s)}},mv=g.forwardRef((t,e)=>{const{ctrlsFactory:s,context:i,gos:o,resizeObserverService:r,clientSideRowModel:n,serverSideRowModel:l}=g.useContext(lt),[a,d]=g.useState(()=>new Nt),[h,c]=g.useState(()=>new Nt),[m,C]=g.useState(),[v,S]=g.useState(),w=g.useRef(),R=g.useRef(null),y=g.useRef(),b=g.useMemo(()=>ne.__getGridRegisteredModules(t.api.getGridId()),[t]),T=g.useMemo(()=>a.toString()+" ag-details-row",[a]),D=g.useMemo(()=>h.toString()+" ag-details-grid",[h]);e&&g.useImperativeHandle(e,()=>({refresh(){var k,x;return(x=(k=w.current)==null?void 0:k.refresh())!=null?x:!1}})),t.template&&W.warnOnce("detailCellRendererParams.template is not supported by AG Grid React. To change the template, provide a Custom Detail Cell Renderer. See https://ag-grid.com/react-data-grid/master-detail-custom-detail/");const A=g.useCallback(k=>{if(R.current=k,!R.current){i.destroyBean(w.current),y.current&&y.current();return}const x={addOrRemoveCssClass:(G,U)=>d(V=>V.setClass(G,U)),addOrRemoveDetailGridCssClass:(G,U)=>c(V=>V.setClass(G,U)),setDetailGrid:G=>C(G),setRowData:G=>S(G),getGui:()=>R.current},N=s.getInstance("detailCellRenderer");if(N&&(i.createBean(N),N.init(x,t),w.current=N,o.get("detailRowAutoHeight"))){const G=()=>{if(R.current==null)return;const U=R.current.clientHeight;U!=null&&U>0&&setTimeout(()=>{t.node.setRowHeight(U),n?n.onRowHeightChanged():l&&l.onRowHeightChanged()},0)};y.current=r.observeResize(R.current,G),G()}},[]),F=g.useCallback((k,x)=>{var N;(N=w.current)==null||N.registerDetailWithMaster(k,x)},[]);return g.createElement("div",{className:T,ref:A},m&&g.createElement($h,nt(Te({className:D},m),{modules:b,rowData:v,setGridApi:F})))}),Cv=class extends Nh{constructor(){super("react"),this.frameworkComponents={agGroupCellRenderer:Xh,agGroupRowRenderer:Xh,agDetailCellRenderer:mv},this.wrapIncoming=(t,e)=>e==="ensureVisible"?IC(t):t(),this.renderingEngine="react"}frameworkComponent(t){return this.frameworkComponents[t]}isFrameworkComponent(t){if(!t)return!1;const e=t.prototype;return!(e&&"getGui"in e)}},vv=class extends g.Component{constructor(){super(...arguments),this.apiListeners=[],this.setGridApi=(t,e)=>{this.api=t,this.columnApi=e,this.apiListeners.forEach(s=>s(t))}}registerApiListener(t){this.apiListeners.push(t)}componentWillUnmount(){this.apiListeners.length=0}render(){return g.createElement($h,nt(Te({},this.props),{setGridApi:this.setGridApi}))}};const Na={fill:"currentColor",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16"},ec=t=>g.createElement("svg",{...Na,...t,t:"1688438905306","p-id":"2388"},g.createElement("path",{d:"M804.571 621.714a36.206 36.206 0 0 1-10.861 25.71l-256 256c-6.84 6.839-16.019 10.862-25.71 10.862s-18.87-3.987-25.71-10.862l-256-256a36.425 36.425 0 0 1-10.861-25.71c0-20.004 16.566-36.571 36.571-36.571h512c20.005 0 36.571 16.567 36.571 36.571z","p-id":"2389"})),tc=t=>g.createElement("svg",{...Na,...t,t:"1688438923470","p-id":"2523"},g.createElement("path",{d:"M804.571 402.286c0 20.004-16.566 36.571-36.571 36.571H256c-20.005 0-36.571-16.567-36.571-36.571a36.206 36.206 0 0 1 10.861-25.71l256-256c6.84-6.839 16.019-10.862 25.71-10.862s18.87 3.987 25.71 10.862l256 256a36.425 36.425 0 0 1 10.861 25.71z","p-id":"2524"})),sc=t=>g.createElement("svg",{...Na,...t,t:"1688438886160","p-id":"2253"},g.createElement("path",{d:"M804.571 621.714a36.206 36.206 0 0 1-10.861 25.71l-256 256c-6.84 6.839-16.019 10.862-25.71 10.862s-18.87-3.987-25.71-10.862l-256-256a36.425 36.425 0 0 1-10.861-25.71c0-20.004 16.566-36.571 36.571-36.571h512c20.005 0 36.571 16.567 36.571 36.571z m0-219.428c0 20.004-16.566 36.571-36.571 36.571H256c-20.005 0-36.571-16.567-36.571-36.571a36.206 36.206 0 0 1 10.861-25.71l256-256c6.84-6.839 16.019-10.862 25.71-10.862s18.87 3.987 25.71 10.862l256 256a36.425 36.425 0 0 1 10.861 25.71z","p-id":"2254"})),ic=t=>{const[e,s]=g.useState("inactive"),[i,o]=g.useState("inactive"),[r,n]=g.useState("inactive"),l=g.useRef(null),[a,d]=g.useState(!1),[h,c]=g.useState(null),m=()=>{t.showColumnMenu(l.current)};g.useEffect(()=>{var T;const b=Array.isArray(t.filterKey)?t.filterKey:[];c(((T=Ka(b,"field").get(t.field))==null?void 0:T.value)??null)},[t.filterKey,t.field]);const C=()=>{const b=t.column.getSort();s(b==="asc"?"active":"inactive"),o(b==="desc"?"active":"inactive"),n(b?"inactive":"active")},v=(b,T)=>{t.setSort(b,T.shiftKey)};g.useEffect(()=>{const b=t.column;if(!(!b||typeof b.addEventListener!="function"))return b.addEventListener("sortChanged",C),C(),()=>{b.removeEventListener("sortChanged",C)}},[t.column]),t.enableFilterButton&&`${t.menuIcon}`;let S=null;t.enableSorting&&(S=g.createElement("div",{className:vt.sortNames},g.createElement("div",{onClick:b=>v("",b),onTouchEnd:b=>v("",b),className:`${vt.customSort} ${vt[e]}`},g.createElement(tc,null)),g.createElement("div",{onClick:b=>v("asc",b),onTouchEnd:b=>v("desc",b),className:`${vt.customSort} ${vt[i]}`},g.createElement(ec,null)),g.createElement("div",{onClick:b=>v("desc",b),onTouchEnd:b=>v("",b),className:`${vt.customSort} ${vt.customUnSort} ${vt[r]}`},g.createElement(sc,null))));const w={width:"100%"},R=g.useMemo(()=>{var T,D;let b=((T=t.filterSearchRender[t.field])==null?void 0:T.render)||Ze.Input;return g.createElement(b,{...((D=t.filterSearchRender[t.field])==null?void 0:D.tPropty)||{},value:h,onChange:A=>{c(A.target?A.target.value:A)},style:w})},[t.field,h]);let y=null;return t.search&&(y=g.createElement("div",null,g.createElement(Ze.Popover,{arrow:!1,open:a,trigger:"click",overlayClassName:vt.popoverContext,onOpenChange:b=>d(b),placement:"bottom",content:g.createElement("div",{className:vt.contextRender},R,g.createElement("div",{className:vt.contextRenderFooter},g.createElement(Ze.Button,{type:"primary",onClick:()=>{const b=t.filterKey.filter(D=>D.field!=t.field);h!=null&&h.length&&b.push({field:t.field,value:h});const T=b!=null&&b.length?b:[];t.onSearch(T),t.setfilterKey(T),d(!1)}},t.language?"Search":"搜索"),g.createElement(Ze.Button,{style:{marginLeft:10},onClick:()=>{const b=t.filterKey.filter(D=>D.field!=t.field),T=b!=null&&b.length?b:[];d(!1),t.setfilterKey(T),c(null),t.onSearch(T)}},t.language?"Reset":"重置")))},g.createElement(vd,{style:{color:h?"#1890ff":"rgba(0, 0, 0, 0.25)",marginLeft:10,cursor:"pointer"}})))),g.createElement("div",{className:vt.customHead},g.createElement("div",{className:"customHeaderLabel"},t.displayName),S,y)},oc=({columnDefs:t=[],loading:e,customBottomTotal:s=!1,onChange:i=()=>{},tableRef:o,tableData:r,pagination:n=!1,reset:l={},customColumn:a=[],filterSearchRender:d={},setfilterKey:h,filterKey:c,rowHeight:m=42,headerHeight:C=48})=>{const v=g.useMemo(()=>({width:"100%",height:"100%",position:"relative"}),[]),S=g.useMemo(()=>({height:"100%",width:"100%"}),[]),w=Ba.useSelector(N=>N.controller.language),R=g.useMemo(()=>{const N=n&&typeof n=="object"?n.total:void 0;return typeof N=="number"&&!Number.isNaN(N)?N:Array.isArray(r)?r.length:0},[n,r]),y=g.useMemo(()=>{let N={};return t.map((G,U)=>{if(U==0)N[G.field]="Total",N.fromData="total";else{let V=G.lockPosition?"":0;r.map(te=>{let ae=G.field!=G.key&&G.key?G.key:G.field,ce=["jobCurrency","industries","jobSalaryRange"];!isNaN(Number(te[ae]))&&!ce.includes(G.field)&&(V+=Number(te[ae]))}),N[G.field]=typeof V=="number"&&V>0?V:"--"}}),[N]},[r,t]),b={visible:!0,sortable:!0,active:!1,unSortIcon:!0,minWidth:200,comparator:(N,G,U,V,te)=>0,headerComponent:ic},T=g.useMemo(()=>({width:170,lockPinned:!0}),[]),D=g.useCallback(N=>{o&&(o.current=N)},[]),A=N=>{var te;const{isNotTip:G,render:U}=N.colDef||{},V=((te=N.data)==null?void 0:te.fromData)==="total";return U&&!V?U(N):g.createElement(Ze.Tooltip,{title:G?"":N.value||"",arrow:!0,placement:"top"},typeof N.value=="number"||N.value?N.value:"--")},F=g.useCallback(N=>{var U;const G=((U=N.api.getState().sort)==null?void 0:U.sortModel)??[];i({sort:G[0]??null,optType:"sort"})},[i]),k=N=>{i({column:N.api.getColumnDefs().filter(G=>G.field).map(G=>({...G,pinned:void 0,field:G.field,hide:G.hide,visible:G.visible}))})},x=(N,G)=>{i({optType:"mergeColum",pagination:{page:N,size:G}})};return g.createElement("div",{style:v},e?g.createElement("div",{className:"loadingContent"},g.createElement(Ze.Spin,null)):null,g.createElement("div",{style:S,className:"pk-ag-grid AgGridReact"},g.createElement(vv,{rowData:r,rowHeight:m,headerHeight:C,pinnedBottomRowData:s?y:[],defaultColDef:T,suppressRowTransform:!0,onSortChanged:F,onDragStopped:k,suppressDragLeaveHidesColumns:!0,suppressMovableColumns:!1,...l,columnDefs:[...t.map(N=>({...b,...N,headerName:w?N.enDisplay:N.cnDisplay,cellRenderer:A,headerComponentParams:{onSearch:G=>{console.log(G,"搜索"),i({filter:G||{}})},setfilterKey:h,filterKey:c,language:w,filterSearchRender:d,...N}})),...a],icons:{sortAscending:`<span style="font-size: inherit;color: rgb(24, 144, 255);vertical-align:-webkit-baseline-middle">
2
332
  <svg t="1688438905306" fill="currentColor" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2388" width="16" height="16"><path d="M804.571 621.714a36.206 36.206 0 0 1-10.861 25.71l-256 256c-6.84 6.839-16.019 10.862-25.71 10.862s-18.87-3.987-25.71-10.862l-256-256a36.425 36.425 0 0 1-10.861-25.71c0-20.004 16.566-36.571 36.571-36.571h512c20.005 0 36.571 16.567 36.571 36.571z" p-id="2389"></path></svg>
3
333
  </span>`,sortDescending:`<span style="font-size: inherit;color:rgb(24, 144, 255);vertical-align:-webkit-baseline-middle">
4
334
  <svg t="1688438923470" fill="currentColor" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2523" width="16" height="16"><path d="M804.571 402.286c0 20.004-16.566 36.571-36.571 36.571H256c-20.005 0-36.571-16.567-36.571-36.571a36.206 36.206 0 0 1 10.861-25.71l256-256c6.84-6.839 16.019-10.862 25.71-10.862s18.87 3.987 25.71 10.862l256 256a36.425 36.425 0 0 1 10.861 25.71z" p-id="2524"></path></svg>
5
335
  </span>`,sortUnSort:`<span style="font-size: inherit;color: rgb(153, 153, 153);vertical-align:-webkit-baseline-middle">
6
336
  <svg t="1688438886160" fill="currentColor" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2253" width="16" height="16"><path d="M804.571 621.714a36.206 36.206 0 0 1-10.861 25.71l-256 256c-6.84 6.839-16.019 10.862-25.71 10.862s-18.87-3.987-25.71-10.862l-256-256a36.425 36.425 0 0 1-10.861-25.71c0-20.004 16.566-36.571 36.571-36.571h512c20.005 0 36.571 16.567 36.571 36.571z m0-219.428c0 20.004-16.566 36.571-36.571 36.571H256c-20.005 0-36.571-16.567-36.571-36.571a36.206 36.206 0 0 1 10.861-25.71l256-256c6.84-6.839 16.019-10.862 25.71-10.862s18.87 3.987 25.71 10.862l256 256a36.425 36.425 0 0 1 10.861 25.71z" p-id="2254"></path></svg>
7
- </span>`},onGridReady:s})),g?t.createElement(S.Pagination,{total:G,onChange:Z,...g}):null)},Ke=(e={},r={})=>{var pe;const{sessionKey:n,renderKey:o,setParamsList:a,configKey:i,tableUrl:g,tableRequest:_,getColConfigRequest:k,saveColConfigRequest:A}={...r,...e},u=typeof window<"u"&&!!window.sessionStorage,w=t.useCallback(m=>{if(u)try{window.sessionStorage.setItem(n,JSON.stringify(m))}catch(p){console.warn("[useTableModule] sessionStorage 写入失败:",p)}},[n,u]),O=t.useCallback(()=>{if(!u)return null;try{const m=window.sessionStorage.getItem(n);return m?JSON.parse(m):null}catch(m){return console.warn("[useTableModule] sessionStorage 读取失败:",m),null}},[n,u]),v=t.useRef([]),[N,G]=t.useState([]),[U,J]=t.useState([]),[K,s]=t.useState(void 0),[h,C]=t.useState(!0),f=t.useRef(O()||{}),[Z,c]=t.useState(((pe=O())==null?void 0:pe.filter)||[]),d=t.useRef(0),D=t.useRef(_);D.current=_;const L=t.useRef(g);L.current=g;const P=t.useRef(a);P.current=a;const Q=t.useRef(o);Q.current=o;const X=t.useRef(k);X.current=k;const ye=t.useRef(A);ye.current=A;const V=t.useCallback(()=>{const{sort:m}=f.current,p=v.current.map(b=>({...b,sort:m&&m.colId==b.field?m.sort:void 0}));G(H(p))},[]),te=t.useCallback(()=>{const m=ye.current;if(!m){console.warn("[useTableModule] 未注入 saveColConfigRequest,跳过列配置保存");return}const p={subcategory:i,userConfig:{pageConfig:{pageSize:f.current.size?f.current.size:null},columnConfig:v.current}},b=m(p);b&&typeof b.catch=="function"&&b.catch(B=>console.error("[useTableModule] 列配置保存失败:",B))},[i]),q=t.useCallback(()=>{const m=D.current;if(!m){console.warn("[useTableModule] 未注入 tableRequest,跳过列表加载"),C(!1);return}d.current+=1;const p=d.current,b=P.current,B=b?b(f.current):f.current;return C(!0),m(B,L.current).then(z=>{if(p!==d.current)return;const E=z==null?void 0:z.response,M=Array.isArray(E)?E:(E==null?void 0:E.data)||[],x=Array.isArray(E)||E==null?void 0:E.total;typeof x=="number"&&!Number.isNaN(x)&&s(x);const ne=M.map(y=>({...y,...y._source||{}}));J(ne),C(!1)},z=>{p===d.current&&(console.error("[useTableModule] 列表加载失败:",z),C(!1))})},[]),R=t.useCallback(m=>{const{column:p,optType:b,sort:B,pagination:z,filter:E}=m;let M=[];if(p){const x=new Map(p.map(y=>[y.field,y]));M=v.current.map(y=>{const F=x.get(y.field);if(!F)return{...y};const Se=F.visible!==void 0?F.visible:!F.hide;return{...y,hide:!Se,visible:Se}});const ne=new Set(v.current.map(y=>y.field));p.forEach(y=>{if(!ne.has(y.field)){const F=y.visible!==void 0?y.visible:!y.hide;M.push({...y,hide:!F,visible:F})}}),v.current=M,te()}b=="mergeColum"&&G(H(M!=null&&M.length?M:v.current)),b=="sort"&&(f.current={...f.current,sort:B},w(f.current),V(),q()),z&&(f.current={...f.current,...z},w(f.current),q()),E&&(f.current={...f.current,filter:E},f.current.page&&f.current.page>1&&(f.current.page=1),w(f.current),q())},[w,te,V,q]),Ce=t.useCallback(()=>{const m=X.current;if(!m){console.warn("[useTableModule] 未注入 getColConfigRequest,跳过列配置加载"),C(!1);return}const{sort:p}=f.current,b=Q.current;m(i).then(({response:B})=>{var M;const E=(((M=B==null?void 0:B.userConfig)==null?void 0:M.columnConfig)||[]).map(x=>({...x,hide:!x.visible,visible:x.visible,sort:p&&p.colId==x.field?p.sort:void 0,render:b?b[x.field]:void 0}));G(H(E)),v.current=H(E),q()},B=>{console.error("[useTableModule] 列配置加载失败:",B),C(!1)})},[i,q]),We=t.useCallback(()=>{const m=O()||{};f.current=m,c(m.filter||[]),V(),q()},[O,V,q]);t.useEffect(()=>{i&&Ce()},[i]);const je=t.useCallback((m={})=>React.createElement(ue,{columRef:v,onChange:R,...m}),[R]),Je=t.useCallback((m={})=>React.createElement(he,{filterKey:Z,setfilterKey:c,loading:h,columnDefs:N,pagination:{current:f.current.page,pageSize:f.current.size,total:K},onChange:R,tableData:U,...m}),[Z,h,N,U,K,R]);return{SettingTableRender:je,TableListRender:Je,getTableData:q,getColConfig:Ce,saveColConfig:te,resetSesstion:We,tableData:U,setloading:C,loading:h,columnDefs:N,paramsCurrent:f,total:K,filterKey:Z}},Ue={width:"100%"},Fe=({dataIndex:e,language:r,onChange:n,value:o,...a})=>{const i=t.useMemo(()=>React.createElement(S.Input,{value:o!=null&&o.length?o:null,style:Ue,...a,onChange:g=>{n(g.target.value)}}),[e,o]);return React.createElement("div",{style:{marginBottom:8}},i)};l.AG_GRID_THEMES=ce,l.ActionCell=He,l.CustomHeader=ge,l.DEFAULT_AG_GRID_THEME=$,l.DICT_COLOR_MAP=Oe,l.EllipsisCell=Be,l.LinkCell=xe,l.MayList=ie,l.MoneyCell=ke,l.NumberCell=Ae,l.OtherSlot=Fe,l.ROW_HEIGHT_PRESETS=qe,l.STATUS_PRESETS=Ie,l.SettingTable=ue,l.SortAscending=de,l.SortDescending=fe,l.SortUnSort=me,l.TableList=he,l.TagCell=De,l.TextCell=Me,l.agGridClass=Pe,l.crmTheme=Le,l.cx=Ne,l.debounce=we,l.deepClone=H,l.formatMoney=se,l.formatNumber=Y,l.formatPercent=le,l.get=oe,l.groupBy=Te,l.isEmpty=j,l.omitEmpty=_e,l.useTableModule=Ke,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
337
+ </span>`},onGridReady:D})),n?g.createElement(Ze.Pagination,{total:R,onChange:x,...n}):null)},wv=(t={},e={})=>{var Rt;const{sessionKey:s,renderKey:i,setParamsList:o,configKey:r,tableUrl:n,tableRequest:l,getColConfigRequest:a,saveColConfigRequest:d}={...e,...t},h=typeof window<"u"&&!!window.sessionStorage,c=g.useCallback(B=>{if(h)try{window.sessionStorage.setItem(s,JSON.stringify(B))}catch(Ce){console.warn("[useTableModule] sessionStorage 写入失败:",Ce)}},[s,h]),m=g.useCallback(()=>{if(!h)return null;try{const B=window.sessionStorage.getItem(s);return B?JSON.parse(B):null}catch(B){return console.warn("[useTableModule] sessionStorage 读取失败:",B),null}},[s,h]),C=g.useRef([]),[v,S]=g.useState([]),[w,R]=g.useState([]),[y,b]=g.useState(void 0),[T,D]=g.useState(!0),A=g.useRef(m()||{}),[F,k]=g.useState(((Rt=m())==null?void 0:Rt.filter)||[]),x=g.useRef(0),N=g.useRef(l);N.current=l;const G=g.useRef(n);G.current=n;const U=g.useRef(o);U.current=o;const V=g.useRef(i);V.current=i;const te=g.useRef(a);te.current=a;const ae=g.useRef(d);ae.current=d;const ce=g.useCallback(()=>{const{sort:B}=A.current,Ce=C.current.map(de=>({...de,sort:B&&B.colId==de.field?B.sort:void 0}));S(zt(Ce))},[]),pe=g.useCallback(()=>{const B=ae.current;if(!B){console.warn("[useTableModule] 未注入 saveColConfigRequest,跳过列配置保存");return}const Ce={subcategory:r,userConfig:{pageConfig:{pageSize:A.current.size?A.current.size:null},columnConfig:C.current}},de=B(Ce);de&&typeof de.catch=="function"&&de.catch(Ge=>console.error("[useTableModule] 列配置保存失败:",Ge))},[r]),ee=g.useCallback(()=>{const B=N.current;if(!B){console.warn("[useTableModule] 未注入 tableRequest,跳过列表加载"),D(!1);return}x.current+=1;const Ce=x.current,de=U.current,Ge=de?de(A.current):A.current;return D(!0),B(Ge,G.current).then(Je=>{if(Ce!==x.current)return;const Ve=Je==null?void 0:Je.response,re=Array.isArray(Ve)?Ve:(Ve==null?void 0:Ve.data)||[],ue=Array.isArray(Ve)||Ve==null?void 0:Ve.total;typeof ue=="number"&&!Number.isNaN(ue)&&b(ue);const Fe=re.map(Y=>({...Y,...Y._source||{}}));R(Fe),D(!1)},Je=>{Ce===x.current&&(console.error("[useTableModule] 列表加载失败:",Je),D(!1))})},[]),Q=g.useCallback(B=>{const{column:Ce,optType:de,sort:Ge,pagination:Je,filter:Ve}=B;let re=[];if(Ce){const ue=new Map(Ce.map(Y=>[Y.field,Y]));re=C.current.map(Y=>{const Se=ue.get(Y.field);if(!Se)return{...Y};const Ct=Se.visible!==void 0?Se.visible:!Se.hide;return{...Y,hide:!Ct,visible:Ct}});const Fe=new Set(C.current.map(Y=>Y.field));Ce.forEach(Y=>{if(!Fe.has(Y.field)){const Se=Y.visible!==void 0?Y.visible:!Y.hide;re.push({...Y,hide:!Se,visible:Se})}}),C.current=re,pe()}de=="mergeColum"&&S(zt(re!=null&&re.length?re:C.current)),de=="sort"&&(A.current={...A.current,sort:Ge},c(A.current),ce(),ee()),Je&&(A.current={...A.current,...Je},c(A.current),ee()),Ve&&(A.current={...A.current,filter:Ve},A.current.page&&A.current.page>1&&(A.current.page=1),c(A.current),ee())},[c,pe,ce,ee]),se=g.useCallback(()=>{const B=te.current;if(!B){console.warn("[useTableModule] 未注入 getColConfigRequest,跳过列配置加载"),D(!1);return}const{sort:Ce}=A.current,de=V.current;B(r).then(({response:Ge})=>{var re;const Ve=(((re=Ge==null?void 0:Ge.userConfig)==null?void 0:re.columnConfig)||[]).map(ue=>({...ue,hide:!ue.visible,visible:ue.visible,sort:Ce&&Ce.colId==ue.field?Ce.sort:void 0,render:de?de[ue.field]:void 0}));S(zt(Ve)),C.current=zt(Ve),ee()},Ge=>{console.error("[useTableModule] 列配置加载失败:",Ge),D(!1)})},[r,ee]),De=g.useCallback(()=>{const B=m()||{};A.current=B,k(B.filter||[]),ce(),ee()},[m,ce,ee]);g.useEffect(()=>{r&&se()},[r]);const oe=g.useCallback((B={})=>React.createElement(Sd,{columRef:C,onChange:Q,...B}),[Q]),ve=g.useCallback((B={})=>React.createElement(oc,{filterKey:F,setfilterKey:k,loading:T,columnDefs:v,pagination:{current:A.current.page,pageSize:A.current.size,total:y},onChange:Q,tableData:w,...B}),[F,T,v,w,y,Q]);return{SettingTableRender:oe,TableListRender:ve,getTableData:ee,getColConfig:se,saveColConfig:pe,resetSesstion:De,tableData:w,setloading:D,loading:T,columnDefs:v,paramsCurrent:A,total:y,filterKey:F}},Sv={width:"100%"},Ev=({dataIndex:t,language:e,onChange:s,value:i,...o})=>{const r=g.useMemo(()=>React.createElement(Ze.Input,{value:i!=null&&i.length?i:null,style:Sv,...o,onChange:n=>{s(n.target.value)}}),[t,i]);return React.createElement("div",{style:{marginBottom:8}},r)};X.AG_GRID_SCOPE_CLASS=Ya,X.AG_GRID_THEMES=ip,X.ActionCell=$c,X.CustomHeader=ic,X.DEFAULT_AG_GRID_THEME=ja,X.DICT_COLOR_MAP=sp,X.EllipsisCell=Jc,X.LinkCell=Zc,X.MayList=Ka,X.MoneyCell=qc,X.NumberCell=Qc,X.OtherSlot=Ev,X.ROW_HEIGHT_PRESETS=rp,X.STATUS_PRESETS=tp,X.SettingTable=Sd,X.SortAscending=ec,X.SortDescending=tc,X.SortUnSort=sc,X.TableList=oc,X.TagCell=Xc,X.TextCell=jc,X.agGridClass=op,X.crmTheme=ep,X.cx=Yc,X.debounce=Kc,X.deepClone=zt,X.formatMoney=Ua,X.formatNumber=fr,X.formatPercent=za,X.get=Wa,X.groupBy=Uc,X.isEmpty=ao,X.omitEmpty=zc,X.useTableModule=wv,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"})});
8
338
  //# sourceMappingURL=index.umd.cjs.map