@wangcheng051/plugin-kit 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,8 +1,338 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),S=require("antd"),ve=require("@ant-design/icons"),se=require("react-redux"),_e=require("ag-grid-react");function Re(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 $=Re(ve);function j(e){return e==null||e===""||typeof e=="number"&&Number.isNaN(e)?!0:Array.isArray(e)?e.length===0:!1}function le(e,r,n){if(!e||!r)return n;const o=String(r).split(".");let a=e;for(let s=0;s<o.length;s+=1){if(a==null)return n;a=a[o[s]]}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 ae(e,r={}){const{digits:n=2,symbol:o="¥",showSymbol:a=!0,showZeroZero:s=!1}=r;if(j(e))return"-";const m=Number(e);if(Number.isNaN(m))return"-";const v=Y(Math.abs(m),n),N=a?o:"";return m<0?`-${N}${v}`:`${N}${v}`}function ie(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):le(o,r);n[a]||(n[a]=[]),n[a].push(o)}),n}function we(e){const r={};return Object.keys(e||{}).forEach(n=>{j(e[n])||(r[n]=e[n])}),r}function Ne(e,r=300){let n=null;return function(...a){n&&clearTimeout(n),n=setTimeout(()=>{n=null,e.apply(this,a)},r)}}function xe(...e){return e.filter(Boolean).join(" ")}function ue(e=[],r="value"){return new Map((e||[]).map(n=>[(n==null?void 0:n[r])??(n==null?void 0:n.id),n]))}function B(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,s)=>{o[s]=B(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]=B(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}},ae(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?ie(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 s=n.find(m=>String(m.value)===String(e));s&&(a=s.label,o=o??s.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 Le({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 Oe={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}}},Pe={success:{color:"success",text:"成功"},warning:{color:"warning",text:"警告"},error:{color:"error",text:"异常"},processing:{color:"processing",text:"处理中"},info:{color:"processing",text:"进行中"},default:{color:"default",text:"未知"}},Ie={1:"success",0:"default",true:"success",false:"default"},de=["alpine","balham","material","quartz","classic"],ee="alpine";function qe(e=ee,r){return[`ag-theme-${de.includes(e)?e:ee}`,r].filter(Boolean).join(" ")}const ze={compact:28,normal:36,relaxed:48},fe=$.default&&typeof $.default=="object"?$.default:$,Ge=$.SearchOutlined||fe.SearchOutlined,Ke=$.SettingOutlined||fe.SettingOutlined,$e="_poper_cidv4_2",Ue="_antTable_cidv4_6",Fe="_detailTable_cidv4_10",We="_opts_cidv4_10",je="_commonDetail_cidv4_18",Je="_title_cidv4_18",Ze="_searchAndAdd_cidv4_25",Qe="_addIcons_cidv4_25",Ye="_noteTitle_cidv4_31",Xe="_customHead_cidv4_40",Ve="_sortNames_cidv4_43",et="_customSort_cidv4_48",tt="_customUnSort_cidv4_53",nt="_active_cidv4_56",rt="_inactive_cidv4_59",ot="_popoverContext_cidv4_63",ct="_contextRender_cidv4_68",st="_contextRenderFooter_cidv4_71",T={poper:$e,antTable:Ue,detailTable:Fe,opts:We,commonDetail:je,title:Je,searchAndAdd:Ze,addIcons:Qe,noteTitle:Ye,customHead:Xe,sortNames:Ve,customSort:et,customUnSort:tt,active:nt,inactive:rt,popoverContext:ot,contextRender:ct,contextRenderFooter:st},me=({onChange:e=()=>{},columRef:r})=>{const{language:n}=se.useSelector(i=>i.controller),[o,a]=t.useState(!1),[s,m]=t.useState(B(r.current));t.useEffect(()=>{const i=r==null?void 0:r.current;!i||!i.length||o||m(B(i))},[r==null?void 0:r.current,o]);const v=()=>{e({column:s,optType:"mergeColum"}),a(!1)},N=i=>{s[i].visible=!s[i].visible,m([...s])},x=()=>{m(B(r.current))};return React.createElement("div",null,React.createElement(S.Popover,{placement:"bottomLeft",trigger:"click",className:T.poper,open:!!o,onOpenChange:i=>{a(i)},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":"自定义列表"),s.map((i,_)=>React.createElement("div",{style:{height:"32px",display:"flex",alignItems:"center"},key:i+_},React.createElement(S.Checkbox,{color:"primary",checked:i.visible,disabled:i.disabled,onChange:L=>N(_)}),React.createElement("span",{style:{position:"relative",top:"2px",marginLeft:"8px"}},(n?i.enDisplay:i.cnDisplay)||i.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:v,type:"primary"},n?"Save":"保存"),React.createElement(S.Button,{onClick:()=>a(!1)},n?"Cancel":"取消")))},React.createElement(Ke,{onClick:()=>x()})))},te={fill:"currentColor",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16"},ge=e=>t.createElement("svg",{...te,...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"})),he=e=>t.createElement("svg",{...te,...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"})),pe=e=>t.createElement("svg",{...te,...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"})),ye=e=>{const[r,n]=t.useState("inactive"),[o,a]=t.useState("inactive"),[s,m]=t.useState("inactive"),v=t.useRef(null),[N,x]=t.useState(!1),[i,_]=t.useState(null),L=()=>{e.showColumnMenu(v.current)};t.useEffect(()=>{var g;const c=Array.isArray(e.filterKey)?e.filterKey:[];_(((g=ue(c,"field").get(e.field))==null?void 0:g.value)??null)},[e.filterKey,e.field]);const E=()=>{const c=e.column.getSort();console.log(c,"sort"),n(c==="asc"?"active":"inactive"),a(c==="desc"?"active":"inactive"),m(c?"inactive":"active")},R=(c,g)=>{e.setSort(c,g.shiftKey)};t.useEffect(()=>{const c=e.column;if(!(!c||typeof c.addEventListener!="function"))return c.addEventListener("sortChanged",E),E(),()=>{c.removeEventListener("sortChanged",E)}},[e.column]),e.enableFilterButton&&`${e.menuIcon}`;let q=null;e.enableSorting&&(q=t.createElement("div",{className:T.sortNames},t.createElement("div",{onClick:c=>R("",c),onTouchEnd:c=>R("",c),className:`${T.customSort} ${T[r]}`},t.createElement(he,null)),t.createElement("div",{onClick:c=>R("asc",c),onTouchEnd:c=>R("desc",c),className:`${T.customSort} ${T[o]}`},t.createElement(ge,null)),t.createElement("div",{onClick:c=>R("desc",c),onTouchEnd:c=>R("",c),className:`${T.customSort} ${T.customUnSort} ${T[s]}`},t.createElement(pe,null))));const G={width:"100%"},U=t.useMemo(()=>{var g,p;let c=((g=e.filterSearchRender[e.field])==null?void 0:g.render)||S.Input;return t.createElement(c,{...((p=e.filterSearchRender[e.field])==null?void 0:p.tPropty)||{},value:i,onChange:d=>{_(d.target?d.target.value:d)},style:G})},[e.field,i]);let z=null;return e.search&&(z=t.createElement("div",null,t.createElement(S.Popover,{arrow:!1,open:N,trigger:"click",overlayClassName:T.popoverContext,onOpenChange:c=>x(c),placement:"bottom",content:t.createElement("div",{className:T.contextRender},U,t.createElement("div",{className:T.contextRenderFooter},t.createElement(S.Button,{type:"primary",onClick:()=>{const c=e.filterKey.filter(p=>p.field!=e.field);i!=null&&i.length&&c.push({field:e.field,value:i});const g=c!=null&&c.length?c:[];e.onSearch(g),e.setfilterKey(g),x(!1)}},e.language?"Search":"搜索"),t.createElement(S.Button,{style:{marginLeft:10},onClick:()=>{const c=e.filterKey.filter(p=>p.field!=e.field),g=c!=null&&c.length?c:[];x(!1),e.setfilterKey(g),_(null),e.onSearch(g)}},e.language?"Reset":"重置")))},t.createElement(Ge,{style:{color:i?"#1890ff":"rgba(0, 0, 0, 0.25)",marginLeft:10,cursor:"pointer"}})))),t.createElement("div",{className:T.customHead},t.createElement("div",{className:"customHeaderLabel"},e.displayName),q,z)},Ce=({columnDefs:e=[],loading:r,customBottomTotal:n=!1,onChange:o=()=>{},tableRef:a,tableData:s,pagination:m=!1,reset:v={},customColumn:N=[],filterSearchRender:x={},setfilterKey:i,filterKey:_})=>{const L=t.useMemo(()=>({width:"100%",height:"100%",position:"relative"}),[]),E=t.useMemo(()=>({height:"100%",width:"100%"}),[]),R=se.useSelector(l=>l.controller.language),q=t.useMemo(()=>{const l=m&&typeof m=="object"?m.total:void 0;return typeof l=="number"&&!Number.isNaN(l)?l:Array.isArray(s)?s.length:0},[m,s]),G=t.useMemo(()=>{let l={};return e.map((u,M)=>{if(M==0)l[u.field]="Total",l.fromData="total";else{let D=u.lockPosition?"":0;s.map(H=>{let W=u.field!=u.key&&u.key?u.key:u.field,J=["jobCurrency","industries","jobSalaryRange"];!isNaN(Number(H[W]))&&!J.includes(u.field)&&(D+=Number(H[W]))}),l[u.field]=typeof D=="number"&&D>0?D:"--"}}),[l]},[s,e]),U={visible:!0,sortable:!0,active:!1,unSortIcon:!0,minWidth:200,comparator:(l,u,M,D,H)=>0,headerComponent:ye},z=t.useMemo(()=>({width:170,lockPinned:!0}),[]),c=t.useCallback(l=>{a&&(a.current=l)},[]),g=l=>{var H;const{isNotTip:u,render:M}=l.colDef||{},D=((H=l.data)==null?void 0:H.fromData)==="total";return M&&!D?M(l):t.createElement(S.Tooltip,{title:u?"":l.value||"",arrow:!0,placement:"top"},typeof l.value=="number"||l.value?l.value:"--")},p=t.useCallback(l=>{var M;const u=((M=l.api.getState().sort)==null?void 0:M.sortModel)??[];o({sort:u[0]??null,optType:"sort"})},[o]),d=l=>{o({column:l.api.getColumnDefs().filter(u=>u.field).map(u=>({...u,pinned:void 0,field:u.field,hide:u.hide,visible:u.visible}))})},F=(l,u)=>{o({optType:"mergeColum",pagination:{page:l,size:u}})};return t.createElement("div",{style:L},r?t.createElement("div",{className:"loadingContent"},t.createElement(S.Spin,null)):null,t.createElement("div",{style:E,className:"ag-theme-alpine AgGridReact"},t.createElement(_e.AgGridReact,{rowData:s,pinnedBottomRowData:n?G:[],defaultColDef:z,suppressRowTransform:!0,onSortChanged:p,onDragStopped:d,suppressDragLeaveHidesColumns:!0,suppressMovableColumns:!1,...v,columnDefs:[...e.map(l=>({...U,...l,headerName:R?l.enDisplay:l.cnDisplay,cellRenderer:g,headerComponentParams:{onSearch:u=>{console.log(u,"搜索"),o({filter:u||{}})},setfilterKey:i,filterKey:_,language:R,filterSearchRender:x,...l}})),...N],icons:{sortAscending:`<span style="font-size: inherit;color: rgb(24, 144, 255);vertical-align:-webkit-baseline-middle">
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),Je=require("antd"),Rd=require("react-redux"),wo=require("react-dom"),kh=require("react-dom/server");function Bh(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=Bh(g);function Yo(t){return t==null||t===""||typeof t=="number"&&Number.isNaN(t)?!0:Array.isArray(t)?t.length===0:!1}function bd(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 Yr(t,e=0){if(Yo(t))return"-";const s=Number(t);return Number.isNaN(s)?"-":s.toLocaleString("zh-CN",{minimumFractionDigits:e,maximumFractionDigits:e})}function Td(t,e={}){const{digits:s=2,symbol:i="¥",showSymbol:o=!0,showZeroZero:r=!1}=e;if(Yo(t))return"-";const n=Number(t);if(Number.isNaN(n))return"-";const a=Yr(Math.abs(n),s),l=o?i:"";return n<0?`-${l}${a}`:`${l}${a}`}function Dd(t,e=2){if(Yo(t))return"-";const s=Number(t);return Number.isNaN(s)?"-":`${Yr(s*100,e)}%`}function Wh(t,e){const s={};return(t||[]).forEach(i=>{const o=typeof e=="function"?e(i):bd(i,e);s[o]||(s[o]=[]),s[o].push(i)}),s}function Uh(t){const e={};return Object.keys(t||{}).forEach(s=>{Yo(t[s])||(e[s]=t[s])}),e}function zh(t,e=300){let s=null;return function(...o){s&&clearTimeout(s),s=setTimeout(()=>{s=null,t.apply(this,o)},e)}}function Kh(...t){return t.filter(Boolean).join(" ")}function Ad(t=[],e="value"){return new Map((t||[]).map(s=>[(s==null?void 0:s[e])??(s==null?void 0:s.id),s]))}function $t(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]=$t(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]=$t(t[i],e)}),s}const{Text:rs}=Je.Typography;function $h({value:t}){return t==null||t===""?g.createElement(rs,{type:"secondary"},"-"):g.createElement("span",null,String(t))}function Yh({value:t,digits:e=2,showSymbol:s=!0}){if(t==null||t==="")return g.createElement(rs,{type:"secondary"},"-");const i=Number(t);return Number.isNaN(i)?g.createElement(rs,{type:"secondary"},"-"):g.createElement("span",{style:{color:i<0?"#ff4d4f":void 0}},Td(i,{digits:e,showSymbol:s}))}function jh({value:t,digits:e=0,percent:s=!1}){if(t==null||t==="")return g.createElement(rs,{type:"secondary"},"-");const i=Number(t);return Number.isNaN(i)?g.createElement(rs,{type:"secondary"},"-"):g.createElement("span",null,s?Dd(i,e):Yr(i,e))}function qh({value:t,color:e,options:s}){if(t==null||t==="")return g.createElement(rs,{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(Je.Tag,{color:i||"default"},o)}function Qh({value:t,length:e=30}){if(t==null||t==="")return g.createElement(rs,{type:"secondary"},"-");const s=String(t);return s.length<=e?g.createElement("span",null,s):g.createElement(Je.Tooltip,{title:s},g.createElement(rs,{ellipsis:!0,style:{maxWidth:240}},s))}function Xh({value:t,onClick:e}){return t==null||t===""?g.createElement(rs,{type:"secondary"},"-"):g.createElement("a",{onClick:()=>e&&e(t)},String(t))}function Jh({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 Zh={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}}},ep={success:{color:"success",text:"成功"},warning:{color:"warning",text:"警告"},error:{color:"error",text:"异常"},processing:{color:"processing",text:"处理中"},info:{color:"processing",text:"进行中"},default:{color:"default",text:"未知"}},tp={1:"success",0:"default",true:"success",false:"default"},Pd="pk-ag-grid",sp=["alpine","balham","material","quartz","classic"],Fd="alpine";function ip(t=Fd,e){return[Pd,e].filter(Boolean).join(" ")}const op={compact:28,normal:36,relaxed:48};var Ld=g.createContext({});function So(){return So=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},So.apply(null,arguments)}function rp(t){if(Array.isArray(t))return t}function np(t,e){var s=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(s!=null){var i,o,r,n,a=[],l=!0,d=!1;try{if(r=(s=s.call(t)).next,e!==0)for(;!(l=(i=r.call(s)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(c){d=!0,o=c}finally{try{if(!l&&s.return!=null&&(n=s.return(),Object(n)!==n))return}finally{if(d)throw o}}return a}}function Wl(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 Wl(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)?Wl(t,e):void 0}}function lp(){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 Md(t,e){return rp(t)||np(t,e)||ap(t,e)||lp()}function Ys(t){"@babel/helpers - typeof";return Ys=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},Ys(t)}function dp(t,e){if(Ys(t)!="object"||!t)return t;var s;if(typeof Symbol<"u"&&(s=t[Symbol.toPrimitive])!==void 0){var i=s.call(t,e);if(Ys(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function up(t){var e=dp(t,"string");return Ys(e)=="symbol"?e:e+""}function Xe(t,e,s){return(e=up(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 Id(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 hp(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Nd={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 a=arguments[n];a&&(r=o(r,i(a)))}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 a in r)e.call(r,a)&&r[a]&&(n=o(n,a));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})()})(Nd);var pp=Nd.exports;const gp=hp(pp),Be=Math.round;function In(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 Ul=(t,e,s)=>s===0?t:t/100;function lo(t,e){const s=e||255;return t>s?s:t<0?0:t}class yi{constructor(e){Xe(this,"isValid",!0),Xe(this,"r",0),Xe(this,"g",0),Xe(this,"b",0),Xe(this,"a",1),Xe(this,"_h",void 0),Xe(this,"_s",void 0),Xe(this,"_l",void 0),Xe(this,"_v",void 0),Xe(this,"_max",void 0),Xe(this,"_min",void 0),Xe(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 yi)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=lo(e.r),this.g=lo(e.g),this.b=lo(e.b),this.a=typeof e.a=="number"?lo(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=a=>(i[a]-this[a])*o+this[a],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]=lo(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,a=0;const l=e/60,d=(1-Math.abs(2*i-1))*s,c=d*(1-Math.abs(l%2-1));l>=0&&l<1?(r=d,n=c):l>=1&&l<2?(r=c,n=d):l>=2&&l<3?(n=d,a=c):l>=3&&l<4?(n=c,a=d):l>=4&&l<5?(r=c,a=d):l>=5&&l<6&&(r=d,a=c);const h=i-d/2;this.r=Be((r+h)*255),this.g=Be((n+h)*255),this.b=Be((a+h)*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,a=Math.floor(n),l=n-a,d=Be(i*(1-s)*255),c=Be(i*(1-s*l)*255),h=Be(i*(1-s*(1-l))*255);switch(a){case 0:this.g=h,this.b=d;break;case 1:this.r=c,this.b=d;break;case 2:this.r=d,this.b=h;break;case 3:this.r=d,this.g=c;break;case 4:this.r=h,this.g=d;break;case 5:default:this.g=d,this.b=c;break}}fromHsvString(e){const s=In(e,Ul);this.fromHsv({h:s[0],s:s[1],v:s[2],a:s[3]})}fromHslString(e){const s=In(e,Ul);this.fromHsl({h:s[0],s:s[1],l:s[2],a:s[3]})}fromRgbString(e){const s=In(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 gr=2,zl=.16,fp=.05,mp=.05,Cp=.15,xd=5,Gd=4,vp=[{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 Kl(t,e,s){var i;return Math.round(t.h)>=60&&Math.round(t.h)<=240?i=s?Math.round(t.h)-gr*e:Math.round(t.h)+gr*e:i=s?Math.round(t.h)+gr*e:Math.round(t.h)-gr*e,i<0?i+=360:i>=360&&(i-=360),i}function $l(t,e,s){if(t.h===0&&t.s===0)return t.s;var i;return s?i=t.s-zl*e:e===Gd?i=t.s+zl:i=t.s+fp*e,i>1&&(i=1),s&&e===xd&&i>.1&&(i=.1),i<.06&&(i=.06),Math.round(i*100)/100}function Yl(t,e,s){var i;return s?i=t.v+mp*e:i=t.v-Cp*e,i=Math.max(0,Math.min(1,i)),Math.round(i*100)/100}function wp(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=[],i=new yi(t),o=i.toHsv(),r=xd;r>0;r-=1){var n=new yi({h:Kl(o,r,!0),s:$l(o,r,!0),v:Yl(o,r,!0)});s.push(n)}s.push(i);for(var a=1;a<=Gd;a+=1){var l=new yi({h:Kl(o,a),s:$l(o,a),v:Yl(o,a)});s.push(l)}return e.theme==="dark"?vp.map(function(d){var c=d.index,h=d.amount;return new yi(e.backgroundColor||"#141414").mix(s[c],h).toHexString()}):s.map(function(d){return d.toHexString()})}var Xn=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];Xn.primary=Xn[5];function jl(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 Yt(t){for(var e=1;e<arguments.length;e++){var s=arguments[e]!=null?arguments[e]:{};e%2?jl(Object(s),!0).forEach(function(i){Xe(t,i,s[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):jl(Object(s)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(s,i))})}return t}function Sp(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Ep(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 ql="data-rc-order",Ql="data-rc-priority",yp="rc-util-key",Jn=new Map;function Od(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.mark;return e?e.startsWith("data-")?e:"data-".concat(e):yp}function Fa(t){if(t.attachTo)return t.attachTo;var e=document.querySelector("head");return e||document.body}function Rp(t){return t==="queue"?"prependQueue":t?"prepend":"append"}function La(t){return Array.from((Jn.get(t)||t).children).filter(function(e){return e.tagName==="STYLE"})}function _d(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Sp())return null;var s=e.csp,i=e.prepend,o=e.priority,r=o===void 0?0:o,n=Rp(i),a=n==="prependQueue",l=document.createElement("style");l.setAttribute(ql,n),a&&r&&l.setAttribute(Ql,"".concat(r)),s!=null&&s.nonce&&(l.nonce=s==null?void 0:s.nonce),l.innerHTML=t;var d=Fa(e),c=d.firstChild;if(i){if(a){var h=(e.styles||La(d)).filter(function(m){if(!["prepend","prependQueue"].includes(m.getAttribute(ql)))return!1;var C=Number(m.getAttribute(Ql)||0);return r>=C});if(h.length)return d.insertBefore(l,h[h.length-1].nextSibling),l}d.insertBefore(l,c)}else d.appendChild(l);return l}function bp(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=Fa(e);return(e.styles||La(s)).find(function(i){return i.getAttribute(Od(e))===t})}function Tp(t,e){var s=Jn.get(t);if(!s||!Ep(document,s)){var i=_d("",e),o=i.parentNode;Jn.set(t,o),t.removeChild(i)}}function Dp(t,e){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=Fa(s),o=La(i),r=Yt(Yt({},s),{},{styles:o});Tp(i,r);var n=bp(e,r);if(n){var a,l;if((a=r.csp)!==null&&a!==void 0&&a.nonce&&n.nonce!==((l=r.csp)===null||l===void 0?void 0:l.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 c=_d(t,r);return c.setAttribute(Od(r),e),c}function Vd(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}function Ap(t){return Vd(t)instanceof ShadowRoot}function Pp(t){return Ap(t)?Vd(t):null}var Zn={},Ma=[],Fp=function(e){Ma.push(e)};function Lp(t,e){if(process.env.NODE_ENV!=="production"&&!t&&console!==void 0){var s=Ma.reduce(function(i,o){return o(i??"","warning")},e);s&&console.error("Warning: ".concat(s))}}function Mp(t,e){if(process.env.NODE_ENV!=="production"&&!t&&console!==void 0){var s=Ma.reduce(function(i,o){return o(i??"","note")},e);s&&console.warn("Note: ".concat(s))}}function Ip(){Zn={}}function Hd(t,e,s){!e&&!Zn[s]&&(t(!1,s),Zn[s]=!0)}function jr(t,e){Hd(Lp,t,e)}function Np(t,e){Hd(Mp,t,e)}jr.preMessage=Fp;jr.resetWarned=Ip;jr.noteOnce=Np;function xp(t){return t.replace(/-(.)/g,function(e,s){return s.toUpperCase()})}function Gp(t,e){jr(t,"[@ant-design/icons] ".concat(e))}function Xl(t){return Ys(t)==="object"&&typeof t.name=="string"&&typeof t.theme=="string"&&(Ys(t.icon)==="object"||typeof t.icon=="function")}function Jl(){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[xp(s)]=i}return e},{})}function ea(t,e,s){return s?g.createElement(t.tag,Yt(Yt({key:e},Jl(t.attrs)),s),(t.children||[]).map(function(i,o){return ea(i,"".concat(e,"-").concat(t.tag,"-").concat(o))})):g.createElement(t.tag,Yt({key:e},Jl(t.attrs)),(t.children||[]).map(function(i,o){return ea(i,"".concat(e,"-").concat(t.tag,"-").concat(o))}))}function kd(t){return wp(t)[0]}function Bd(t){return t?Array.isArray(t)?t:[t]:[]}var Op=`
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
+ `,_p=function(e){var s=g.useContext(Ld),i=s.csp,o=s.prefixCls,r=s.layer,n=Op;o&&(n=n.replace(/anticon/g,o)),r&&(n="@layer ".concat(r,` {
62
+ `).concat(n,`
63
+ }`)),g.useEffect(function(){var a=e.current,l=Pp(a);Dp(n,"@ant-design-icons",{prepend:!r,csp:i,attachTo:l})},[])},Vp=["icon","className","onClick","style","primaryColor","secondaryColor"],Co={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function Hp(t){var e=t.primaryColor,s=t.secondaryColor;Co.primaryColor=e,Co.secondaryColor=s||kd(e),Co.calculated=!!s}function kp(){return Yt({},Co)}var zi=function(e){var s=e.icon,i=e.className,o=e.onClick,r=e.style,n=e.primaryColor,a=e.secondaryColor,l=Id(e,Vp),d=is.useRef(),c=Co;if(n&&(c={primaryColor:n,secondaryColor:a||kd(n)}),_p(d),Gp(Xl(s),"icon should be icon definiton, but got ".concat(s)),!Xl(s))return null;var h=s;return h&&typeof h.icon=="function"&&(h=Yt(Yt({},h),{},{icon:h.icon(c.primaryColor,c.secondaryColor)})),ea(h.icon,"svg-".concat(h.name),Yt(Yt({className:i,onClick:o,style:r,"data-icon":h.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},l),{},{ref:d}))};zi.displayName="IconReact";zi.getTwoToneColors=kp;zi.setTwoToneColors=Hp;function Wd(t){var e=Bd(t),s=Md(e,2),i=s[0],o=s[1];return zi.setTwoToneColors({primaryColor:i,secondaryColor:o})}function Bp(){var t=zi.getTwoToneColors();return t.calculated?[t.primaryColor,t.secondaryColor]:t.primaryColor}var Wp=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];Wd(Xn.primary);var jo=is.forwardRef(function(t,e){var s=t.className,i=t.icon,o=t.spin,r=t.rotate,n=t.tabIndex,a=t.onClick,l=t.twoToneColor,d=Id(t,Wp),c=is.useContext(Ld),h=c.prefixCls,m=h===void 0?"anticon":h,C=c.rootClassName,v=gp(C,m,Xe(Xe({},"".concat(m,"-").concat(i.name),!!i.name),"".concat(m,"-spin"),!!o||i.name==="loading"),s),S=n;S===void 0&&a&&(S=-1);var w=r?{msTransform:"rotate(".concat(r,"deg)"),transform:"rotate(".concat(r,"deg)")}:void 0,R=Bd(l),y=Md(R,2),b=y[0],T=y[1];return is.createElement("span",So({role:"img","aria-label":i.name},d,{ref:e,tabIndex:S,onClick:a,className:v}),is.createElement(zi,{icon:i,primaryColor:b,secondaryColor:T,style:w}))});jo.displayName="AntdIcon";jo.getTwoToneColor=Bp;jo.setTwoToneColor=Wd;var Up={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"},zp=function(e,s){return is.createElement(jo,So({},e,{ref:s,icon:Up}))},Ud=is.forwardRef(zp);process.env.NODE_ENV!=="production"&&(Ud.displayName="SearchOutlined");var Kp={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"},$p=function(e,s){return is.createElement(jo,So({},e,{ref:s,icon:Kp}))},zd=is.forwardRef($p);process.env.NODE_ENV!=="production"&&(zd.displayName="SettingOutlined");const Yp="_poper_cidv4_2",jp="_antTable_cidv4_6",qp="_detailTable_cidv4_10",Qp="_opts_cidv4_10",Xp="_commonDetail_cidv4_18",Jp="_title_cidv4_18",Zp="_searchAndAdd_cidv4_25",eg="_addIcons_cidv4_25",tg="_noteTitle_cidv4_31",sg="_customHead_cidv4_40",ig="_sortNames_cidv4_43",og="_customSort_cidv4_48",rg="_customUnSort_cidv4_53",ng="_active_cidv4_56",ag="_inactive_cidv4_59",lg="_popoverContext_cidv4_63",dg="_contextRender_cidv4_68",ug="_contextRenderFooter_cidv4_71",vt={poper:Yp,antTable:jp,detailTable:qp,opts:Qp,commonDetail:Xp,title:Jp,searchAndAdd:Zp,addIcons:eg,noteTitle:tg,customHead:sg,sortNames:ig,customSort:og,customUnSort:rg,active:ng,inactive:ag,popoverContext:lg,contextRender:dg,contextRenderFooter:ug},Kd=({onChange:t=()=>{},columRef:e})=>{const{language:s}=Rd.useSelector(c=>c.controller),[i,o]=g.useState(!1),[r,n]=g.useState($t(e.current));g.useEffect(()=>{const c=e==null?void 0:e.current;!c||!c.length||i||n($t(c))},[e==null?void 0:e.current,i]);const a=()=>{t({column:r,optType:"mergeColum"}),o(!1)},l=c=>{r[c].visible=!r[c].visible,n([...r])},d=()=>{n($t(e.current))};return React.createElement("div",null,React.createElement(Je.Popover,{placement:"bottomLeft",trigger:"click",className:vt.poper,open:!!i,onOpenChange:c=>{o(c)},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((c,h)=>React.createElement("div",{style:{height:"32px",display:"flex",alignItems:"center"},key:c+h},React.createElement(Je.Checkbox,{color:"primary",checked:c.visible,disabled:c.disabled,onChange:m=>l(h)}),React.createElement("span",{style:{position:"relative",top:"2px",marginLeft:"8px"}},(s?c.enDisplay:c.cnDisplay)||c.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(Je.Button,{onClick:a,type:"primary"},s?"Save":"保存"),React.createElement(Je.Button,{onClick:()=>o(!1)},s?"Cancel":"取消")))},React.createElement(zd,{onClick:()=>d()})))};var Ia=Object.defineProperty,cg=Object.defineProperties,hg=Object.getOwnPropertyDescriptor,pg=Object.getOwnPropertyDescriptors,Dr=Object.getOwnPropertySymbols,$d=Object.prototype.hasOwnProperty,Yd=Object.prototype.propertyIsEnumerable,Zl=(t,e,s)=>e in t?Ia(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,O=(t,e)=>{for(var s in e||(e={}))$d.call(e,s)&&Zl(t,s,e[s]);if(Dr)for(var s of Dr(e))Yd.call(e,s)&&Zl(t,s,e[s]);return t},Ee=(t,e)=>cg(t,pg(e)),gg=(t,e)=>{var s={};for(var i in t)$d.call(t,i)&&e.indexOf(i)<0&&(s[i]=t[i]);if(t!=null&&Dr)for(var i of Dr(t))e.indexOf(i)<0&&Yd.call(t,i)&&(s[i]=t[i]);return s},ze=(t,e)=>{for(var s in e)Ia(t,s,{get:e[s],enumerable:!0})},u=(t,e,s,i)=>{for(var o=i>1?void 0:i?hg(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&&Ia(e,s,o),o},Ot=(t,e)=>(s,i)=>e(s,i,t),jd={};ze(jd,{attrToBoolean:()=>Ar,attrToNumber:()=>Cs,attrToString:()=>fg,defaultComparator:()=>mg,exists:()=>P,jsonEquals:()=>ta,makeNull:()=>qt,missing:()=>U,missingOrEmpty:()=>bt,toStringOrNull:()=>Eo,values:()=>ks});function qt(t){return t==null||t===""?null:t}function P(t,e=!1){return t!=null&&(t!==""||e)}function U(t){return!P(t)}function bt(t){return t==null||t.length===0}function Eo(t){return t!=null&&typeof t.toString=="function"?t.toString():null}function Cs(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 Ar(t){if(t!==void 0)return t===null||t===""?!1:typeof t=="boolean"?t:/true/i.test(t)}function fg(t){if(!(t==null||t===""))return t}function ta(t,e){const s=t?JSON.stringify(t):null,i=e?JSON.stringify(e):null;return s===i}function mg(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,a){return n>a?1:n<a?-1:0}if(typeof t!="string"||!s)return r(t,e);try{return t.localeCompare(e)}catch{return r(t,e)}}function ks(t){if(t instanceof Set||t instanceof Map){const e=[];return t.forEach(s=>e.push(s)),e}return Object.values(t)}var Cg=class{constructor(){this.existingKeys={}}addExistingKeys(t){for(let e=0;e<t.length;e++)this.existingKeys[t[e]]=!0}getUniqueKey(t,e){t=Eo(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++}}},qd={};ze(qd,{SKIP_JS_BUILTINS:()=>qr,cloneObject:()=>Na,deepCloneDefinition:()=>Pr,getAllValuesInObject:()=>vs,getValueUsingField:()=>Ti,isNonNullObject:()=>Fr,iterateObject:()=>Ye,mergeDeep:()=>dt,removeAllReferences:()=>Qd});var qr=new Set(["__proto__","constructor","prototype"]);function Ye(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 Na(t){const e={},s=Object.keys(t);for(let i=0;i<s.length;i++){if(qr.has(s[i]))continue;const o=s[i],r=t[o];e[o]=r}return e}function Pr(t,e){if(!t)return;const s=t,i={};return Object.keys(s).forEach(o=>{if(e&&e.indexOf(o)>=0||qr.has(o))return;const r=s[o];Fr(r)&&r.constructor===Object?i[o]=Pr(r):i[o]=r}),i}function vs(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 dt(t,e,s=!0,i=!1){P(e)&&Ye(e,(o,r)=>{if(qr.has(o))return;let n=t[o];n!==r&&(i&&n==null&&r!=null&&typeof r=="object"&&r.constructor===Object&&(n={},t[o]=n),Fr(r)&&Fr(n)&&!Array.isArray(n)?dt(n,r,s,i):(s||r!==void 0)&&(t[o]=r))})}function Ti(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 Qd(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 l=()=>{console.warn(r(n))};o[n]={value:l,writable:!0}}}),Object.defineProperties(t,o)}function Fr(t){return typeof t=="object"&&t!==null}var Xd={};ze(Xd,{compose:()=>vg,debounce:()=>Ze,doOnce:()=>Pi,errorOnce:()=>Vs,executeAfter:()=>Zd,executeInAWhile:()=>Jd,executeNextVMTurn:()=>sa,getFunctionName:()=>Qr,isFunction:()=>Xr,noop:()=>wg,throttle:()=>ia,waitUntil:()=>xa,warnOnce:()=>H});var ed={};function Pi(t,e){ed[e]||(t(),ed[e]=!0)}function H(t){Pi(()=>console.warn("AG Grid: "+t),t)}function Vs(t){Pi(()=>console.error("AG Grid: "+t),t)}function Qr(t){if(t.name)return t.name;const e=/function\s+([^\(]+)/.exec(t.toString());return e&&e.length===2?e[1].trim():null}function Xr(t){return!!(t&&t.constructor&&t.call&&t.apply)}function Jd(t){Zd(t,400)}var Nn=[],xn=!1;function sa(t){Nn.push(t),!xn&&(xn=!0,window.setTimeout(()=>{const e=Nn.slice();Nn.length=0,xn=!1,e.forEach(s=>s())},0))}function Zd(t,e=0){t.length>0&&window.setTimeout(()=>t.forEach(s=>s()),e)}function Ze(t,e){let s;return function(...i){const o=this;window.clearTimeout(s),s=window.setTimeout(function(){t.apply(o,i)},e)}}function ia(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 xa(t,e,s=100,i){const o=new Date().getTime();let r=null,n=!1;const a=()=>{const l=new Date().getTime()-o>s;(t()||l)&&(e(),n=!0,r!=null&&(window.clearInterval(r),r=null),l&&i&&console.warn(i))};a(),n||(r=window.setInterval(a,10))}function vg(...t){return e=>t.reduce((s,i)=>i(s),e)}var wg=()=>{},eu=(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))(eu||{}),Jr=class ce{static register(e){ce.__register(e,!0,void 0)}static registerModules(e){ce.__registerModules(e,!0,void 0)}static __register(e,s,i){ce.runVersionChecks(e),i!==void 0?(ce.areGridScopedModules=!0,ce.gridModulesMap[i]===void 0&&(ce.gridModulesMap[i]={}),ce.gridModulesMap[i][e.moduleName]=e):ce.globalModulesMap[e.moduleName]=e,ce.setModuleBased(s)}static __unRegisterGridModules(e){delete ce.gridModulesMap[e]}static __registerModules(e,s,i){ce.setModuleBased(s),e&&e.forEach(o=>ce.__register(o,s,i))}static isValidModuleVersion(e){const[s,i]=e.version.split(".")||[],[o,r]=ce.currentModuleVersion.split(".")||[];return s===o&&i===r}static runVersionChecks(e){if(ce.currentModuleVersion||(ce.currentModuleVersion=e.version),e.version?ce.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){ce.moduleBased===void 0?ce.moduleBased=e:ce.moduleBased!==e&&Pi(()=>{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(){ce.isBundled=!0}static __assertRegistered(e,s,i){var o;if(this.__isRegistered(e,i))return!0;const r=s+e;let n;if(ce.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(ce.moduleBased||ce.moduleBased===void 0){let a=(o=Object.entries(eu).find(([l,d])=>d===e))==null?void 0:o[0];n=`AG Grid: unable to use ${s} as the ${a} is not registered${ce.areGridScopedModules?` for gridId: ${i}`:""}. Check if you have registered the module:
70
+
71
+ import { ModuleRegistry } from '@ag-grid-community/core';
72
+ import { ${a} } from '${e}';
73
+
74
+ ModuleRegistry.registerModules([ ${a} ]);
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 Pi(()=>{console.warn(n)},r),!1}static __isRegistered(e,s){var i;return!!ce.globalModulesMap[e]||!!((i=ce.gridModulesMap[s])!=null&&i[e])}static __getRegisteredModules(e){return[...ks(ce.globalModulesMap),...ks(ce.gridModulesMap[e]||{})]}static __getGridRegisteredModules(e){var s;return ks((s=ce.gridModulesMap[e])!=null?s:{})||[]}static __isPackageBased(){return!ce.moduleBased}};Jr.globalModulesMap={};Jr.gridModulesMap={};Jr.areGridScopedModules=!1;var ne=Jr,Sg=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 ks(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)),Ye(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=Qr(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)=>{Ye(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&&Ye(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(a=>{a!=s&&(i[a]=!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 tu(t,e,s){const i=js(t.constructor);i.preConstructMethods||(i.preConstructMethods=[]),i.preConstructMethods.push(e)}function M(t,e,s){const i=js(t.constructor);i.postConstructMethods||(i.postConstructMethods=[]),i.postConstructMethods.push(e)}function it(t,e,s){const i=js(t.constructor);i.preDestroyMethods||(i.preDestroyMethods=[]),i.preDestroyMethods.push(e)}function G(t){return e=>{const s=js(e);s.beanName=t}}function f(t){return(e,s,i)=>{su(e,t,!1,e,s)}}function de(t){return(e,s,i)=>{su(e,t,!0,e,s)}}function su(t,e,s,i,o,r){if(e===null){console.error("AG Grid: Autowired name should not be null");return}const n=js(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=js(o),n=s):(r=js(o),n="agConstructor"),r.autowireMethods||(r.autowireMethods={}),r.autowireMethods[n]||(r.autowireMethods[n]={}),r.autowireMethods[n][i]=t}}}function js(t){return t.hasOwnProperty("__agBeanMetaData")||(t.__agBeanMetaData={}),t.__agBeanMetaData}var kt=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 l=t.event;l instanceof Event&&(t.eventPath=l.composedPath())}const o=(l,d)=>l.forEach(c=>{if(!d.has(c))return;const h=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>c(t)):()=>c(t);e?this.dispatchAsync(h):h()}),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(l=>{const d=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>l(i,t)):()=>l(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([Ot(0,Tt("gridOptionsService")),Ot(1,Tt("frameworkOverrides")),Ot(2,Tt("globalEventListener")),Ot(3,Tt("globalSyncEventListener"))],kt.prototype,"setBeans",1);kt=u([G("eventService")],kt);var Ga=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}},Eg={resizable:!0,sortable:!0},yg=0;function iu(){return yg++}var xe=class ou{constructor(e,s,i,o){this.instanceId=iu(),this.autoHeaderHeight=null,this.moving=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.eventService=new kt,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,a=e.initialFlex;n!==void 0?this.flex=n:a!==void 0&&(this.flex=a)}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 a=Cs(e.width),l=Cs(e.initialWidth);return a!=null?n=a:l!=null?n=l:n=200,Math.max(Math.min(n,r),o)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){if(U(this.colDef)||U(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 Ga(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:Eg[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 U(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&&dt(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(U(this.colDef.colSpan))return 1;const s=this.createBaseColDefParams(e),i=this.colDef.colSpan(s);return Math.max(i,1)}getRowSpan(e){if(U(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:ou.EVENT_STATE_UPDATED,key:e})}};xe.EVENT_MOVING_CHANGED="movingChanged";xe.EVENT_LEFT_CHANGED="leftChanged";xe.EVENT_WIDTH_CHANGED="widthChanged";xe.EVENT_LAST_LEFT_PINNED_CHANGED="lastLeftPinnedChanged";xe.EVENT_FIRST_RIGHT_PINNED_CHANGED="firstRightPinnedChanged";xe.EVENT_VISIBLE_CHANGED="visibleChanged";xe.EVENT_FILTER_CHANGED="filterChanged";xe.EVENT_FILTER_ACTIVE_CHANGED="filterActiveChanged";xe.EVENT_SORT_CHANGED="sortChanged";xe.EVENT_COL_DEF_CHANGED="colDefChanged";xe.EVENT_MENU_VISIBLE_CHANGED="menuVisibleChanged";xe.EVENT_ROW_GROUP_CHANGED="columnRowGroupChanged";xe.EVENT_PIVOT_CHANGED="columnPivotChanged";xe.EVENT_VALUE_CHANGED="columnValueChanged";xe.EVENT_STATE_UPDATED="columnStateUpdated";u([f("gridOptionsService")],xe.prototype,"gos",2);u([f("environment")],xe.prototype,"environment",2);u([f("columnHoverService")],xe.prototype,"columnHoverService",2);u([f("frameworkOverrides")],xe.prototype,"frameworkOverrides",2);u([M],xe.prototype,"initialise",1);var ge=xe,Zr=class co{constructor(e,s,i,o){this.localEventService=new kt,this.expandable=!1,this.instanceId=iu(),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:co.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 ge?e.push(s):s instanceof co&&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,a=o.length;n<a;n++){const l=o[n];if(!l.isVisible())continue;const d=l.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:co.EVENT_EXPANDABLE_CHANGED};this.localEventService.dispatchEvent(n)}}findChildrenRemovingPadding(){const e=[],s=i=>{i.forEach(o=>{o instanceof co&&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)}};Zr.EVENT_EXPANDED_CHANGED="expandedChanged";Zr.EVENT_EXPANDABLE_CHANGED="expandableChanged";u([it],Zr.prototype,"destroy",1);var Me=Zr,Rg={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}},ru={};ze(ru,{addSafePassiveEventListener:()=>fu,createEventPath:()=>pu,getCtrlForEventTarget:()=>Lr,getEventPath:()=>gu,isElementInEventPath:()=>Mr,isEventSupported:()=>_a,isStopPropagationForAgGrid:()=>Ht,stopPropagationForAgGrid:()=>Bt});var nu={};ze(nu,{areEqual:()=>jt,existsAndNotEmpty:()=>au,flatten:()=>cu,forEachReverse:()=>Ag,includes:()=>wt,insertArrayIntoArray:()=>oa,insertIntoArray:()=>yo,last:()=>ie,moveInArray:()=>ra,pushAll:()=>na,removeAllFromArray:()=>uu,removeAllFromUnorderedArray:()=>du,removeFromArray:()=>lt,removeFromUnorderedArray:()=>Oa,removeRepeatsFromArray:()=>Tg,shallowCompare:()=>bg,sortNumerically:()=>lu,toStrings:()=>Dg});function au(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 bg(t,e){return jt(t,e)}function lu(t){return t.sort((e,s)=>e-s)}function Tg(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 Oa(t,e){const s=t.indexOf(e);s>=0&&(t[s]=t[t.length-1],t.pop())}function lt(t,e){const s=t.indexOf(e);s>=0&&t.splice(s,1)}function du(t,e){for(let s=0;s<e.length;s++)Oa(t,e[s])}function uu(t,e){for(let s=0;s<e.length;s++)lt(t,e[s])}function yo(t,e,s){t.splice(s,0,e)}function oa(t,e,s){if(!(t==null||e==null))for(let i=e.length-1;i>=0;i--){const o=e[i];yo(t,o,s)}}function ra(t,e,s){uu(t,e),e.slice().reverse().forEach(i=>yo(t,i,s))}function wt(t,e){return t.indexOf(e)>-1}function cu(t){return[].concat.apply([],t)}function na(t,e){e==null||t==null||e.forEach(s=>t.push(s))}function Dg(t){return t.map(Eo)}function Ag(t,e){if(t!=null)for(let s=t.length-1;s>=0;s--)e(t[s],s)}var hu="__ag_Grid_Stop_Propagation",Pg=["touchstart","touchend","touchmove","touchcancel","scroll"],Gn={};function Bt(t){t[hu]=!0}function Ht(t){return t[hu]===!0}var _a=(()=>{const t={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return s=>{if(typeof Gn[s]=="boolean")return Gn[s];const i=document.createElement(t[s]||"div");return s="on"+s,Gn[s]=s in i}})();function Lr(t,e,s){let i=e;for(;i;){const o=t.getDomData(i,s);if(o)return o;i=i.parentElement}return null}function Mr(t,e){return!e||!t?!1:gu(e).indexOf(t)>=0}function pu(t){const e=[];let s=t.target;for(;s;)e.push(s),s=s.parentElement;return e}function gu(t){const e=t;return e.path?e.path:e.composedPath?e.composedPath():pu(e)}function fu(t,e,s,i){const r=wt(Pg,s)?{passive:!0}:void 0;t&&t.addEventListener&&t.addEventListener(e,s,i,r)}var ls=class mu{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:mu.EVENT_DESTROYED})}addEventListener(e,s){this.localEventService||(this.localEventService=new kt),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?fu(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[]}};ls.EVENT_DESTROYED="destroyed";u([f("frameworkOverrides")],ls.prototype,"frameworkOverrides",2);u([f("context")],ls.prototype,"context",2);u([f("eventService")],ls.prototype,"eventService",2);u([f("gridOptionsService")],ls.prototype,"gos",2);u([f("localeService")],ls.prototype,"localeService",2);u([f("environment")],ls.prototype,"environment",2);u([it],ls.prototype,"destroy",1);var L=ls,Ro=class extends L{setBeans(t){this.logger=t.create("ColumnFactory")}createColumnTree(t,e,s,i){const o=new Cg,{existingCols:r,existingGroups:n,existingColKeys:a}=this.extractExistingTreeData(s);o.addExistingKeys(a);const l=this.recursivelyCreateColumns(t,0,e,r,o,n,i),d=this.findMaxDept(l,0);this.logger.log("Number of levels for grouped columns is "+d);const c=this.balanceColumnTree(l,0,d,o);return ss(null,c,(m,C)=>{m instanceof Me&&m.setupExpandable(),m.setOriginalParent(C)}),{columnTree:c,treeDept:d}}extractExistingTreeData(t){const e=[],s=[],i=[];return t&&ss(null,t,o=>{if(o instanceof Me){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 Me(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 Me;)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 Me){const a=n,l=this.balanceColumnTree(a.getChildren(),e+1,s,i);a.setChildren(l),o.push(a)}else{let a,l;for(let d=s-1;d>=e;d--){const c=i.getUniqueKey(null,null),h=this.createMergedColGroupDef(null),m=new Me(h,c,!0,e);this.createBean(m),l&&l.setChildren([m]),l=m,a||(a=l)}if(a&&l)if(o.push(a),t.some(c=>c instanceof Me)){l.setChildren([n]);continue}else{l.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 Me){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 a=new Array(t.length);for(let l=0;l<a.length;l++){const d=t[l];this.isColumnGroup(d)?a[l]=this.createColumnGroup(s,d,e,i,o,r,n):a[l]=this.createColumn(s,d,i,o,n)}return a}createColumnGroup(t,e,s,i,o,r,n){const a=this.createMergedColGroupDef(e),l=o.getUniqueKey(a.groupId||null,null),d=new Me(a,l,!1,s);this.createBean(d);const c=this.findExistingGroup(e,r);c&&r.splice(c.idx,1);let h=c==null?void 0:c.group;h&&d.setExpanded(h.isExpanded());const m=this.recursivelyCreateColumns(a.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 a=this.addColumnDefaultAndTypes(e,n.getColId());n.setColDef(a,e,o),this.applyColumnState(n,a,o)}else{const a=i.getUniqueKey(e.colId,e.field),l=this.addColumnDefaultAndTypes(e,a);n=new ge(l,e,a,t),this.context.createBean(n)}return this.dataTypeService.addColumnListeners(n),n}applyColumnState(t,e,s){const i=Cs(e.flex);if(i!==void 0&&t.setFlex(i),t.getFlex()<=0){const a=Cs(e.width);if(a!=null)t.setActualWidth(a,s);else{const l=t.getActualWidth();t.setActualWidth(l,s)}}e.sort!==void 0&&(e.sort=="asc"||e.sort=="desc"?t.setSort(e.sort,s):t.setSort(void 0,s));const r=Cs(e.sortIndex);r!==void 0&&t.setSortIndex(r);const n=Ar(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");dt(s,i,!1,!0);const o=this.dataTypeService.updateColDefAndGetColumnType(s,t,e);o&&this.assignColumnTypes(o,s),dt(s,t,!1,!0);const r=this.gos.get("autoGroupColumnDef"),n=this.gos.isColumnsSortingCoupledToGroup();return t.rowGroup&&r&&n&&dt(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({},Rg),i=this.gos.get("columnTypes")||{};Ye(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?dt(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")],Ro.prototype,"dataTypeService",2);u([Ot(0,Tt("loggerFactory"))],Ro.prototype,"setBeans",1);Ro=u([G("columnFactory")],Ro);function ss(t,e,s){if(e)for(let i=0;i<e.length;i++){const o=e[i];o instanceof Me&&ss(o,o.getChildren(),s),s(o,t)}}var en=class zt{constructor(e,s,i,o){this.displayedChildren=[],this.localEventService=new kt,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 zt.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 zt&&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(zt.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 zt&&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 ge?e.push(s):s instanceof zt&&s.addDisplayedLeafColumns(e)})}addLeafColumns(e){this.children.forEach(s=>{s instanceof ge?e.push(s):s instanceof zt&&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(zt.EVENT_DISPLAYED_CHILDREN_CHANGED));return}this.children.forEach(i=>{if(i instanceof zt&&(!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(zt.EVENT_DISPLAYED_CHILDREN_CHANGED))}};en.EVENT_LEFT_CHANGED="leftChanged";en.EVENT_DISPLAYED_CHILDREN_CHANGED="displayedChildrenChanged";u([f("gridOptionsService")],en.prototype,"gos",2);var He=en,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 vr=new Set([p.EVENT_GRID_PRE_DESTROYED,p.EVENT_FILL_START]),Cu=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}},Fi="ag-Grid-AutoColumn",bo=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=`${Fi}-${t.getId()}`:s=Fi;const i=this.createAutoGroupColDef(s,t,e);i.colId=s;const o=new ge(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");dt(i,o),i=this.columnFactory.addColumnDefaultAndTypes(i,t),this.gos.get("treeData")||U(i.field)&&U(i.valueGetter)&&U(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")],bo.prototype,"columnModel",2);u([f("columnFactory")],bo.prototype,"columnFactory",2);bo=u([G("autoGroupColService")],bo);var vu={};ze(vu,{camelCaseToHumanText:()=>wu,camelCaseToHyphenated:()=>Su,capitalise:()=>Ig,escapeString:()=>Ie,utf8_encode:()=>Mg});var Fg=/[&<>"']/g,Lg={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Mg(t){const e=String.fromCharCode;function s(h){const m=[];if(!h)return[];const C=h.length;let v=0,S,w;for(;v<C;)S=h.charCodeAt(v++),S>=55296&&S<=56319&&v<C?(w=h.charCodeAt(v++),(w&64512)==56320?m.push(((S&1023)<<10)+(w&1023)+65536):(m.push(S),v--)):m.push(S);return m}function i(h){if(h>=55296&&h<=57343)throw Error("Lone surrogate U+"+h.toString(16).toUpperCase()+" is not a scalar value")}function o(h,m){return e(h>>m&63|128)}function r(h){if(h>=0&&h<=31&&h!==10)return`_x${h.toString(16).toUpperCase().padStart(4,"0")}_`;if(!(h&4294967168))return e(h);let m="";return h&4294965248?h&4294901760?h&4292870144||(m=e(h>>18&7|240),m+=o(h,12),m+=o(h,6)):(i(h),m=e(h>>12&15|224),m+=o(h,6)):m=e(h>>6&31|192),m+=e(h&63|128),m}const n=s(t),a=n.length;let l=-1,d,c="";for(;++l<a;)d=n[l],c+=r(d);return c}function Ig(t){return t[0].toUpperCase()+t.substring(1).toLowerCase()}function Ie(t,e){if(t==null)return null;const s=t.toString().toString();return e?s:s.replace(Fg,i=>Lg[i])}function wu(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 Su(t){return t.replace(/[A-Z]/g,e=>`-${e.toLocaleLowerCase()}`)}var Eu={};ze(Eu,{convertToMap:()=>ms,keys:()=>xg,mapById:()=>Ng});function ms(t){const e=new Map;return t.forEach(s=>e.set(s[0],s[1])),e}function Ng(t,e){const s=new Map;return t.forEach(i=>s.set(e(i),i)),s}function xg(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;ss(null,t,o=>{s[o.getInstanceId()]=o}),e&&ss(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(l=>this.primaryColumnsMap[l.getId()]=l),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(U(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 a=-1;const l=s??this.gos.get("skipHeaderOnAutoSize"),d=i??l;for(;a!==0;)a=0,this.actionOnGridColumns(e,c=>{if(n.indexOf(c)>=0)return!1;const h=this.autoWidthCalculator.getPreferredWidthForColumn(c,l);if(h>0){const m=this.normaliseColumnWidth(c,h);c.setActualWidth(m,r),n.push(c),a++}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(a=>{let l=a.getParent();for(;l&&l!=s;)l.isPadding()||i.add(l),l=l.getParent()});let r;const n=[];for(const a of i){for(const l of this.ctrlsService.getHeaderRowContainerCtrls())if(r=l.getHeaderCtrlForColumn(a),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 ge?e.push(r):r instanceof Me&&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 a=e[n],l=e.length-n,d=Math.min(a.getColSpan(t),l),c=[a];if(d>1){const m=d-1;for(let C=1;C<=m;C++)c.push(e[n+C]);n+=m}let h;s?(h=!1,c.forEach(m=>{s(m)&&(h=!0)})):h=!0,h&&(o.length===0&&r&&(i&&i(a))&&o.push(r),o.push(a)),r=a}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(l=>{if(!l)return;const d=this.getPrimaryColumn(l);if(d){if(s){if(e.indexOf(d)>=0)return;e.push(d)}else{if(e.indexOf(d)<0)return;lt(e,d)}i(d),n=!0}}),!n)return;this.autoGroupsNeedBuilding&&this.updateGridColumns(),this.updateDisplayedColumns(r);const a={type:o,columns:e,column:e.length===1?e[0]:null,source:r};this.eventService.dispatchEvent(a)}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((a,l)=>n.set(a,l)),e.length=0,P(t)&&t.forEach(a=>{const l=this.getPrimaryColumn(a);l&&e.push(l)}),e.forEach((a,l)=>{const d=n.get(a);if(d===void 0){n.set(a,0);return}i&&d!==l||n.delete(a)}),(this.primaryColumns||[]).forEach(a=>{const l=e.indexOf(a)>=0;o(l,a)}),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 l=this.getDisplayedColAfter(n);if(!l)return;const d=n.getActualWidth()-r.newWidth,c=l.getActualWidth()+d;o.push({width:c,ratios:[1],columns:[l]})}}),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(l=>{const d=l.getMinWidth();i+=d||0;const c=l.getMaxWidth();P(c)&&c>0?o+=c:r=!1});const n=s>=i,a=!r||s<=o;return n&&a}resizeColumnSets(t){const{resizeSets:e,finished:s,source:i}=t;if(!(!e||e.every(c=>this.checkMinAndMaxWidthsForSet(c)))){if(s){const c=e&&e.length>0?e[0].columns:null;this.dispatchColumnResizedEvent(c,s,i)}return}const r=[],n=[];e.forEach(c=>{const{width:h,columns:m,ratios:C}=c,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=h;m.forEach((A,F)=>{if(S[A.getId()])T-=v[A.getId()];else{y.push(A);const I=C[F];b+=I}});const D=1/b;y.forEach((A,F)=>{const x=F===y.length-1;let I;x?I=T:(I=Math.round(C[F]*h*D),T-=I);const V=A.getMinWidth(),_=A.getMaxWidth();P(V)&&I<V?(I=V,S[A.getId()]=!0,w=!0):P(_)&&_>0&&I>_&&(I=_,S[A.getId()]=!0,w=!0),v[A.getId()]=I})}m.forEach(y=>{const b=v[y.getId()];y.getActualWidth()!==b&&(y.setActualWidth(b,i),r.push(y))})});const a=r.length>0;let l=[];a&&(l=this.refreshFlexedColumns({resizingCols:n,skipSetLeft:!0}),this.setLeftValues(i),this.updateBodyWidths(),this.checkViewportColumns());const d=n.concat(l);(a||s)&&this.dispatchColumnResizedEvent(d,s,i,l)}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)&&(ra(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 ra(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 ss(null,this.gridBalancedTree,s=>{if(!(s instanceof Me))return;const i=s,o=i.getColGroupDef();if(!(o&&o.marryChildren))return;const n=[];i.getLeafColumns().forEach(h=>{const m=t.indexOf(h);n.push(m)});const a=Math.max.apply(Math,n),l=Math.min.apply(Math,n),d=a-l,c=i.getLeafColumns().length-1;d>c&&(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 a=this.getColumnGroupAtLevel(n,s);if(a!==t)return a}}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(U(this.primaryColumns)||!this.isAlive())return[];const e=this.getPrimaryAndSecondaryAndAutoColumns().map(this.createStateItemFromColumn.bind(this));return this.orderColumnStateList(e),e}orderColumnStateList(t){const e=ms(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 a=this.getColumnStateFromColDef(n);U(a.rowGroupIndex)&&a.rowGroup&&(a.rowGroupIndex=i++),U(a.pivotIndex)&&a.pivot&&(a.pivotIndex=o++),s.push(a)}),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),a=e(s.width,s.initialWidth),l=e(s.flex,s.initialFlex);let d=e(s.rowGroupIndex,s.initialRowGroupIndex),c=e(s.rowGroup,s.initialRowGroup);d==null&&(c==null||c==!1)&&(d=null,c=null);let h=e(s.pivotIndex,s.initialPivotIndex),m=e(s.pivot,s.initialPivot);h==null&&(m==null||m==!1)&&(h=null,m=null);const C=e(s.aggFunc,s.initialAggFunc);return{colId:t.getColId(),sort:i,sortIndex:o,hide:r,pinned:n,width:a,flex:l,rowGroup:c,rowGroupIndex:d,pivot:m,pivotIndex:h,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,a)=>{const l=this.compareColumnStatesAndDispatchEvents(e);this.autoGroupsNeedBuilding=!0;const d=n.slice(),c={},h={},m=[],C=[];let v=0;const S=this.rowGroupColumns.slice(),w=this.pivotColumns.slice();r.forEach(T=>{const D=T.colId||"";if(D.startsWith(Fi)){m.push(T),C.push(T);return}const F=a(D);F?(this.syncColumnWithStateItem(F,T,t.defaultState,c,h,!1,e),lt(d,F)):(C.push(T),v+=1)});const R=T=>this.syncColumnWithStateItem(T,null,t.defaultState,c,h,!1,e);d.forEach(R);const y=(T,D,A,F)=>{const x=T[A.getId()],I=T[F.getId()],V=x!=null,_=I!=null;if(V&&_)return x-I;if(V)return-1;if(_)return 1;const z=D.indexOf(A),k=D.indexOf(F),le=z>=0,he=k>=0;return le&&he?z-k:le?-1:1};this.rowGroupColumns.sort(y.bind(this,c,S)),this.pivotColumns.sort(y.bind(this,h,w)),this.updateGridColumns();const b=this.groupAutoColumns?this.groupAutoColumns.slice():[];return m.forEach(T=>{const D=this.getAutoColumn(T.colId);lt(b,D),this.syncColumnWithStateItem(D,T,t.defaultState,null,null,!0,e)}),b.forEach(R),this.applyOrderAfterApplyState(t),this.updateDisplayedColumns(e),this.dispatchEverythingChanged(e),l(),{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(Fi)?yo(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(I=>{A.delete(I)||A.add(I)});const F=[...A],x={type:S,columns:F,column:F.length===1?F[0]:null,source:t};this.eventService.dispatchEvent(x)},n=S=>{const w=[];return o.forEach(R=>{const y=i[R.getColId()];y&&S(y,R)&&w.push(R)}),w},a=S=>S.getColId();r(p.EVENT_COLUMN_ROW_GROUP_CHANGED,e.rowGroupColumns,this.rowGroupColumns,a),r(p.EVENT_COLUMN_PIVOT_CHANGED,e.pivotColumns,this.pivotColumns,a);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 c=(S,w)=>S.width!=w.getActualWidth();this.dispatchColumnResizedEvent(n(c),!0,t);const h=(S,w)=>S.pinned!=w.getPinned();this.dispatchColumnPinnedEvent(n(h),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(l=>i[l.colId]=l);const o={};t.forEach(l=>{i[l.colId]&&(o[l.colId]=!0)});const r=t.filter(l=>o[l.colId]),n=s.filter(l=>o[l.colId]),a=[];n.forEach((l,d)=>{const c=r&&r[d];if(c&&c.colId!==l.colId){const h=this.getGridColumn(c.colId);h&&a.push(h)}}),a.length&&this.dispatchColumnMovedEvent({movedColumns:a,source:e,finished:!0})}syncColumnWithStateItem(t,e,s,i,o,r,n){var a;if(!t)return;const l=(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=l("hide").value1;d!==void 0&&t.setVisible(!d,n);const c=l("pinned").value1;c!==void 0&&t.setPinned(c);const h=(a=t.getColDef().minWidth)!=null?a:this.environment.getMinColWidth(),m=l("flex").value1;if(m!==void 0&&t.setFlex(m),m==null){const T=l("width").value1;T!=null&&h!=null&&T>=h&&t.setActualWidth(T,n)}const C=l("sort").value1;C!==void 0&&(C==="desc"||C==="asc"?t.setSort(C,n):t.setSort(void 0,n));const v=l("sortIndex").value1;if(v!==void 0&&t.setSortIndex(v),r||!t.isPrimary())return;const S=l("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),lt(this.valueColumns,t))));const{value1:w,value2:R}=l("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),lt(this.rowGroupColumns,t)));const{value1:y,value2:b}=l("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),lt(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)||U(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 wu(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,a=t.getColDef().pivotTotalColumnIds!==void 0;if(n&&!a)return e;o=s?s.getAggFunc():null,r=!0}else{const n=t.isValueActive(),a=this.pivotMode||!this.isRowGroupEmpty();n&&a?(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 xs(s,!1,r=>{if(r instanceof He){const n=r;let a;i?a=t===n.getGroupId()&&e===n.getPartId():a=t===n.getGroupId(),a&&(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 a=[],l=[];(this.primaryColumns||[]).forEach(h=>{const m=t.indexOf(h)<0,C=h.getColDef(),v=Ar(r(C)),S=Ar(n(C)),w=Cs(i(C)),R=Cs(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(h)>=0,y&&((m?w!=null||R!=null:w!=null)?a.push(h):l.push(h))});const d=h=>{const m=i(h.getColDef()),C=o(h.getColDef());return m??C};a.sort((h,m)=>{const C=d(h),v=d(m);return C===v?0:C<v?-1:1});const c=[].concat(a);return e.forEach(h=>{l.indexOf(h)>=0&&c.push(h)}),l.forEach(h=>{c.indexOf(h)<0&&c.push(h)}),e.forEach(h=>{c.indexOf(h)<0&&s(h,!1)}),c.forEach(h=>{e.indexOf(h)<0&&s(h,!0)}),c}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=[];ss(null,this.primaryColumnTree,s=>{if(s instanceof Me){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 ss(null,this.gridBalancedTree,e=>{e instanceof Me&&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:Me.length===1?s[0]:void 0,columnGroups:s};this.eventService.dispatchEvent(i)}this.columnAnimationService.finish()}setColumnGroupOpened(t,e,s){let i;t instanceof Me?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 ss(null,this.gridBalancedTree,s=>{s instanceof Me&&s.getId()===t&&(e=s)}),e}calculateColumnsForDisplay(){let t;return this.pivotMode&&U(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&&U(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 a=r;s&&s(a),i(a.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=ms(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(U(t))return;const e=ms(t.map((l,d)=>[l,d]));let s=!0;if(this.gridColumns.forEach(l=>{e.has(l)&&(s=!1)}),s)return;const i=ms(this.gridColumns.map(l=>[l,!0])),o=t.filter(l=>i.has(l)),r=ms(o.map(l=>[l,!0])),n=this.gridColumns.filter(l=>!r.has(l)),a=o.slice();n.forEach(l=>{let d=l.getOriginalParent();if(!d){a.push(l);return}const c=[];for(;!c.length&&d;)d.getLeafColumns().forEach(v=>{const S=a.indexOf(v)>=0,w=c.indexOf(v)<0;S&&w&&c.push(v)}),d=d.getOriginalParent();if(!c.length){a.push(l);return}const h=c.map(C=>a.indexOf(C)),m=Math.max(...h);yo(a,l,m+1)}),this.gridColumns=a}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(U(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()})}du(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,xs(t,!0,s=>{s instanceof ge&&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 U(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 a=s[n];let l=!1;if(a instanceof ge)l=t[a.getId()]===!0;else{const c=a.getDisplayedChildren();c&&(l=e(c,i,o+1))}l&&(r=!0,i[o]||(i[o]=[]),i[o].push(a))}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,a=0;for(let m=0;m<this.displayedColumnsCenter.length;m++)this.displayedColumnsCenter[m].getFlex()&&m>i?(r.push(this.displayedColumnsCenter[m]),a+=this.displayedColumnsCenter[m].getFlex(),n+=(e=this.displayedColumnsCenter[m].getMinWidth())!=null?e:0):o+=this.displayedColumnsCenter[m].getActualWidth();if(!r.length)return[];let l=[];o+n>this.flexViewportWidth&&(r.forEach(m=>{var C;return m.setActualWidth((C=m.getMinWidth())!=null?C:0,s)}),l=r,r=[]);const d=[];let c;e:for(;;){c=this.flexViewportWidth-o;const m=c/a;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),Oa(r,v),a-=v.getFlex(),l.push(v),o+=v.getActualWidth();continue e}d[C]=Math.round(S)}break}let h=c;return r.forEach((m,C)=>{m.setActualWidth(Math.min(d[C],h),s),l.push(m),h-=d[C]}),t.skipSetLeft||this.setLeftValues(s),t.updateBodyWidths&&this.updateBodyWidths(),t.fireResizedEvent&&this.dispatchColumnResizedEvent(l,!0,s,r),r}sizeColumnsToFit(t,e="sizeColumnsToFit",s,i){var o,r,n,a,l;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=gg(y,["key"]);d[typeof b=="string"?b:b.getColId()]=T}));const c=this.getAllDisplayedColumns(),h=t===this.getWidthOfColsInList(c);if(t<=0||!c.length||h)return;const m=[],C=[];c.forEach(R=>{R.getColDef().suppressSizeToFit===!0?C.push(R):m.push(R)});const v=m.slice(0);let S=!1;const w=R=>{lt(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,x=(n=A==null?void 0:A.maxWidth)!=null?n:i==null?void 0:i.defaultMaxWidth,I=(a=D.getMinWidth())!=null?a:0,V=(l=D.getMaxWidth())!=null?l:Number.MAX_VALUE,_=typeof F=="number"&&F>I?F:D.getMinWidth(),z=typeof x=="number"&&x<V?x:D.getMaxWidth();let k=Math.round(D.getActualWidth()*y);P(_)&&k<_?(k=_,w(D),S=!1):P(z)&&k>z?(k=z,w(D),S=!1):T===0&&(k=b),D.setActualWidth(k,e,!0),b-=k}}}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 Cu;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};xs(this.displayedTreeCentre,!1,t),xs(this.displayedTreeLeft,!1,t),xs(this.displayedTreeRight,!1,t)}isDisplayed(t){return this.displayedColumnsAndGroupsMap[t.getUniqueId()]===t}updateOpenClosedVisibilityInColumnGroups(){const t=this.getAllDisplayedTrees();xs(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,a,l,d)=>{if(!r.length||!this.primaryColumns)return[];const c=Object.keys(o),h=new Set(c),m=new Set(c),C=new Set(r.map(D=>{const A=D.getColId();return m.delete(A),A}).concat(c)),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 x=v[F];m.has(x)&&(o[x][l]=R++,m.delete(x))}b=A};r.forEach(D=>{const A=D.getColId();if(h.has(A))T(A),o[A][l]=R++;else{const F=D.getColDef();(F[l]===null||F[l]===void 0&&F[d]==null)&&(y||(F[n]||F[n]===void 0&&F[a]?T(A):(m.forEach(V=>{o[V][l]=R+S[V]}),R+=v.length,y=!0)),s[A]||(s[A]={colId:A}),s[A][l]=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:a,maxWidth:l})=>({key:n,minWidth:a,maxWidth:l}));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([de("aggFuncService")],Ue.prototype,"aggFuncService",2);u([M],Ue.prototype,"init",1);u([it],Ue.prototype,"destroyColumns",1);u([Ot(0,Tt("loggerFactory"))],Ue.prototype,"setBeans",1);Ue=u([G("columnModel")],Ue);function Ri(t){return t==="gridOptionsUpdated"?"gridOptionsChanged":t}function xs(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();xs(r,e,s)}s(o)}}var aa=class extends L{createDisplayedGroups(t,e,s,i){const o=this.mapOldGroupsById(i),r=[];let n=t;for(;n.length;){const a=n;n=[];let l=0;const d=c=>{const h=l;l=c;const m=a[h],v=(m instanceof He?m.getProvidedColumnGroup():m).getOriginalParent();if(v==null){for(let w=h;w<c;w++)r.push(a[w]);return}const S=this.createColumnGroup(v,e,o,s);for(let w=h;w<c;w++)S.addChild(a[w]);n.push(S)};for(let c=1;c<a.length;c++){const h=a[c],C=(h instanceof He?h.getProvidedColumnGroup():h).getOriginalParent(),v=a[l],w=(v instanceof He?v.getProvidedColumnGroup():v).getOriginalParent();C!==w&&d(c)}l<a.length&&d(a.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 a=s[n];return a&&a.getProvidedColumnGroup()!==t&&(a=null),P(a)?a.reset():(a=new He(t,o,r,i),this.context.createBean(a)),a}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)}})}};aa=u([G("displayedGroupCreator")],aa);var Gg={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},_e=class{};_e.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"];_e.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"];_e.ARRAY_PROPERTIES=["sortingOrder","alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData","chartThemes","rowClass","paginationPageSizeSelector"];_e.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"];_e.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"];_e.OTHER_PROPERTIES=["suppressStickyTotalRow"];_e.FUNCTIONAL_PROPERTIES=["doesExternalFilterPass","processPivotResultColDef","processPivotResultColGroupDef","getBusinessKeyForNode","isRowSelectable","rowDragText","groupRowRenderer","fullWidthCellRenderer","loadingCellRenderer","loadingOverlayComponent","noRowsOverlayComponent","detailCellRenderer","quickFilterParser","quickFilterMatcher"];_e.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"];_e.FUNCTION_PROPERTIES=[..._e.FUNCTIONAL_PROPERTIES,..._e.CALLBACK_PROPERTIES];_e.ALL_PROPERTIES=[..._e.ARRAY_PROPERTIES,..._e.OBJECT_PROPERTIES,..._e.STRING_PROPERTIES,..._e.NUMBER_PROPERTIES,..._e.FUNCTION_PROPERTIES,..._e.BOOLEAN_PROPERTIES,..._e.OTHER_PROPERTIES];var To=_e,Ke=class wr{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=O({},e);return wr.getGridOptionKeys().forEach(r=>{const n=s[r];typeof n<"u"&&n!==wr.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(a=>wr.ALL_PROPERTIES_AND_CALLBACKS_SET.has(a)).forEach(a=>{o[a]=e[a],r=!0}),!r)return;s.__internalUpdateGridOptions(o,!0);const n={type:p.EVENT_COMPONENT_STATE_CHANGED};Ye(o,(a,l)=>{n[a]=l}),s.dispatchEvent(n)}};Ke.EVENTS=ks(p);Ke.VUE_OMITTED_PROPERTY="AG-VUE-OMITTED-PROPERTY";Ke.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];Ke.PUBLIC_EVENTS=Ke.EVENTS.filter(t=>!wt(Ke.EXCLUDED_INTERNAL_EVENTS,t));Ke.EVENT_CALLBACKS=Ke.EVENTS.map(t=>Ke.getCallbackForEvent(t));Ke.BOOLEAN_PROPERTIES=To.BOOLEAN_PROPERTIES;Ke.ALL_PROPERTIES=To.ALL_PROPERTIES;Ke.ALL_PROPERTIES_AND_CALLBACKS=[...Ke.ALL_PROPERTIES,...Ke.EVENT_CALLBACKS];Ke.ALL_PROPERTIES_AND_CALLBACKS_SET=new Set(Ke.ALL_PROPERTIES_AND_CALLBACKS);var Ir=Ke,la=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]}};la=u([G("agStackComponentsRegistry")],la);var yu={};ze(yu,{getAriaCheckboxStateName:()=>on,getAriaLabel:()=>Du,getAriaLevel:()=>Og,getAriaPosInSet:()=>Tu,getAriaSortState:()=>bu,removeAriaExpanded:()=>Lu,removeAriaSort:()=>Ou,setAriaActiveDescendant:()=>Ba,setAriaAtomic:()=>Au,setAriaChecked:()=>Vg,setAriaColCount:()=>Nu,setAriaColIndex:()=>Ua,setAriaColSpan:()=>xu,setAriaControls:()=>za,setAriaDescribedBy:()=>_g,setAriaDisabled:()=>ka,setAriaExpanded:()=>ns,setAriaHidden:()=>qo,setAriaLabel:()=>St,setAriaLabelledBy:()=>Li,setAriaLevel:()=>Fu,setAriaLive:()=>Ha,setAriaMultiSelectable:()=>Mu,setAriaPosInSet:()=>sn,setAriaRelevant:()=>Pu,setAriaRole:()=>Ae,setAriaRowCount:()=>Iu,setAriaRowIndex:()=>Wa,setAriaSelected:()=>Mi,setAriaSetSize:()=>tn,setAriaSort:()=>Gu});function Mt(t,e,s){s==null||typeof s=="string"&&s==""?Va(t,e):It(t,e,s)}function It(t,e,s){t.setAttribute(Ru(e),s.toString())}function Va(t,e){t.removeAttribute(Ru(e))}function Ru(t){return`aria-${t}`}function Ae(t,e){e?t.setAttribute("role",e):t.removeAttribute("role")}function bu(t){let e;return t==="asc"?e="ascending":t==="desc"?e="descending":t==="mixed"?e="other":e="none",e}function Og(t){return parseInt(t.getAttribute("aria-level"),10)}function Tu(t){return parseInt(t.getAttribute("aria-posinset"),10)}function Du(t){return t.getAttribute("aria-label")}function St(t,e){Mt(t,"label",e)}function Li(t,e){Mt(t,"labelledby",e)}function _g(t,e){Mt(t,"describedby",e)}function Ha(t,e){Mt(t,"live",e)}function Au(t,e){Mt(t,"atomic",e)}function Pu(t,e){Mt(t,"relevant",e)}function Fu(t,e){Mt(t,"level",e)}function ka(t,e){Mt(t,"disabled",e)}function qo(t,e){Mt(t,"hidden",e)}function Ba(t,e){Mt(t,"activedescendant",e)}function ns(t,e){It(t,"expanded",e)}function Lu(t){Va(t,"expanded")}function tn(t,e){It(t,"setsize",e)}function sn(t,e){It(t,"posinset",e)}function Mu(t,e){It(t,"multiselectable",e)}function Iu(t,e){It(t,"rowcount",e)}function Wa(t,e){It(t,"rowindex",e)}function Nu(t,e){It(t,"colcount",e)}function Ua(t,e){It(t,"colindex",e)}function xu(t,e){It(t,"colspan",e)}function Gu(t,e){It(t,"sort",e)}function Ou(t){Va(t,"sort")}function Mi(t,e){Mt(t,"selected",e)}function Vg(t,e){It(t,"checked",e===void 0?"mixed":e)}function za(t,e){Mt(t,"controls",e.id),Li(e,t.id)}function on(t,e){return e===void 0?t("ariaIndeterminate","indeterminate"):e===!0?t("ariaChecked","checked"):t("ariaUnchecked","unchecked")}var _u={};ze(_u,{browserSupportsPreventScroll:()=>ja,getBodyHeight:()=>ku,getBodyWidth:()=>Hu,getMaxDivHeight:()=>Vu,getSafariVersion:()=>Ka,getScrollbarWidth:()=>Bu,getTabIndex:()=>Nr,isBrowserChrome:()=>rn,isBrowserFirefox:()=>$a,isBrowserSafari:()=>Xt,isIOSUserAgent:()=>ds,isInvisibleScrollbar:()=>qa,isMacOsUserAgent:()=>Ya});var On,fr,_n,Vn,Hn,kn,da,ua;function Xt(){return On===void 0&&(On=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),On}function Ka(){if(fr===void 0)if(Xt()){const t=navigator.userAgent.match(/version\/(\d+)/i);t&&(fr=t[1]!=null?parseFloat(t[1]):0)}else fr=0;return fr}function rn(){if(_n===void 0){const t=window;_n=!!t.chrome&&(!!t.chrome.webstore||!!t.chrome.runtime)||/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}return _n}function $a(){return Vn===void 0&&(Vn=/(firefox)/i.test(navigator.userAgent)),Vn}function Ya(){return Hn===void 0&&(Hn=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),Hn}function ds(){return kn===void 0&&(kn=/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1),kn}function ja(){return!Xt()||Ka()>=15}function Nr(t){if(!t)return null;const e=t.tabIndex,s=t.getAttribute("tabIndex");return e===-1&&(s===null||s===""&&!$a())?null:e.toString()}function Vu(){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 Hu(){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 ku(){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 Bu(){return ua==null&&Wu(),ua}function Wu(){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&&(ua=s,da=s===0)}function qa(){return da==null&&Wu(),da}var Uu={};ze(Uu,{dateToFormattedString:()=>Ai,parseDateTimeFromString:()=>ut,serialiseDate:()=>At});var zu={};ze(zu,{cleanNumber:()=>Hg,createArrayOfNumbers:()=>Ku,decToHex:()=>kg,formatNumberCommas:()=>Qa,formatNumberTwoDecimalPlacesAndCommas:()=>Bg,padStartWidthZeros:()=>Di,sum:()=>Wg});function Di(t,e){return t.toString().padStart(e,"0")}function Ku(t,e){const s=[];for(let i=t;i<=e;i++)s.push(i);return s}function Hg(t){return typeof t=="string"&&(t=parseInt(t,10)),typeof t=="number"?Math.floor(t):null}function kg(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"?"":Qa(Math.round(t*100)/100,e,s)}function Qa(t,e,s){return typeof t!="number"?"":t.toString().replace(".",s).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${e}`)}function Wg(t){return t==null?null:t.reduce((e,s)=>e+s,0)}function At(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 Bn=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}${Bn(t.getMonth()+1)}`,M:()=>`${t.getMonth()+1}`,Do:()=>`${t.getDate()}${Bn(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()}${Bn(t.getDay())}`,d:()=>`${t.getDay()}`},n=new RegExp(Object.keys(r).join("|"),"g");return e.replace(n,a=>a in r?r[a]():a)}function ut(t){if(!t)return null;const[e,s]=t.split(" ");if(!e)return null;const i=e.split("-").map(h=>parseInt(h,10));if(i.filter(h=>!isNaN(h)).length!==3)return null;const[o,r,n]=i,a=new Date(o,r-1,n);if(a.getFullYear()!==o||a.getMonth()!==r-1||a.getDate()!==n)return null;if(!s||s==="00:00:00")return a;const[l,d,c]=s.split(":").map(h=>parseInt(h,10));return l>=0&&l<24&&a.setHours(l),d>=0&&d<60&&a.setMinutes(d),c>=0&&c<60&&a.setSeconds(c),a}var $u={};ze($u,{FOCUSABLE_EXCLUDE:()=>Xa,FOCUSABLE_SELECTOR:()=>Yu,addOrRemoveAttribute:()=>Qt,addStylesToElement:()=>ol,bindCellRendererToHtmlElement:()=>nl,clearElement:()=>Fe,copyNodeList:()=>Ju,ensureDomOrder:()=>sl,formatSize:()=>nn,getAbsoluteHeight:()=>Za,getAbsoluteWidth:()=>Do,getElementRectWithOffset:()=>el,getElementSize:()=>bs,getInnerHeight:()=>Qo,getInnerWidth:()=>ri,getScrollLeft:()=>Po,insertWithDomOrder:()=>qu,isElementChildOfClass:()=>Bs,isFocusableFormField:()=>Ja,isHorizontalScrollShowing:()=>Qu,isInDOM:()=>tl,isNodeOrElement:()=>Xo,isRtlNegativeScroll:()=>Ao,isVerticalScrollShowing:()=>Xu,isVisible:()=>pt,iterateNamedNodeMap:()=>Zu,loadTemplate:()=>ct,nodeListForEach:()=>rl,radioCssClass:()=>ca,removeFromParent:()=>_t,setDisabled:()=>Ii,setDisplayed:()=>Z,setDomChildOrder:()=>il,setElementHeight:()=>Ug,setElementWidth:()=>Lo,setFixedHeight:()=>Ws,setFixedWidth:()=>Pt,setScrollLeft:()=>Fo,setVisible:()=>ju});var mr;function ca(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]",Xa="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function Ja(t){const e=Element.prototype.matches||Element.prototype.msMatchesSelector,i=e.call(t,"input, select, button, textarea"),o=e.call(t,Xa),r=pt(t);return i&&!o&&r}function Z(t,e,s={}){const{skipAriaHidden:i}=s;t.classList.toggle("ag-hidden",!e),i||qo(t,!e)}function ju(t,e,s={}){const{skipAriaHidden:i}=s;t.classList.toggle("ag-invisible",!e),i||qo(t,!e)}function Ii(t,e){const s="disabled",i=e?o=>o.setAttribute(s,""):o=>o.removeAttribute(s);i(t),rl(t.querySelectorAll("input"),o=>i(o))}function Bs(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 bs(t){const{height:e,width:s,borderTopWidth:i,borderRightWidth:o,borderBottomWidth:r,borderLeftWidth:n,paddingTop:a,paddingRight:l,paddingBottom:d,paddingLeft:c,marginTop:h,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(a||"0"),paddingRight:parseFloat(l||"0"),paddingBottom:parseFloat(d||"0"),paddingLeft:parseFloat(c||"0"),marginTop:parseFloat(h||"0"),marginRight:parseFloat(m||"0"),marginBottom:parseFloat(C||"0"),marginLeft:parseFloat(v||"0"),boxSizing:S}}function Qo(t){const e=bs(t);return e.boxSizing==="border-box"?e.height-e.paddingTop-e.paddingBottom:e.height}function ri(t){const e=bs(t);return e.boxSizing==="border-box"?e.width-e.paddingLeft-e.paddingRight:e.width}function Za(t){const e=bs(t),s=e.marginBottom+e.marginTop;return Math.ceil(t.offsetHeight+s)}function Do(t){const e=bs(t),s=e.marginLeft+e.marginRight;return Math.ceil(t.offsetWidth+s)}function el(t){const e=t.getBoundingClientRect(),{borderTopWidth:s,borderLeftWidth:i,borderRightWidth:o,borderBottomWidth:r}=bs(t);return{top:e.top+(s||0),left:e.left+(i||0),right:e.right+(o||0),bottom:e.bottom+(r||0)}}function Ao(){if(typeof mr=="boolean")return mr;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,mr=Math.floor(t.scrollLeft)===0,document.body.removeChild(t),mr}function Po(t,e){let s=t.scrollLeft;return e&&(s=Math.abs(s),rn()&&!Ao()&&(s=t.scrollWidth-t.clientWidth-s)),s}function Fo(t,e,s){s&&(Ao()?e*=-1:(Xt()||rn())&&(e=t.scrollWidth-t.clientWidth-e)),t.scrollLeft=e}function Fe(t){for(;t&&t.firstChild;)t.removeChild(t.firstChild)}function _t(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function tl(t){return!!t.offsetParent}function pt(t){const e=t;return e.checkVisibility?e.checkVisibility({checkVisibilityCSS:!0}):!(!tl(t)||window.getComputedStyle(t).visibility!=="visible")}function ct(t){const e=document.createElement("div");return e.innerHTML=(t||"").trim(),e.firstChild}function sl(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 il(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 qu(t,e,s){s?s.insertAdjacentElement("afterend",e):t.firstChild?t.insertAdjacentElement("afterbegin",e):t.appendChild(e)}function ol(t,e){if(e)for(const[s,i]of Object.entries(e)){if(!s||!s.length||i==null)continue;const o=Su(s),r=i.toString(),n=r.replace(/\s*!important/g,""),a=n.length!=r.length?"important":void 0;t.style.setProperty(o,n,a)}}function Qu(t){return t.clientWidth<t.scrollWidth}function Xu(t){return t.clientHeight<t.scrollHeight}function Lo(t,e){e==="flex"?(t.style.removeProperty("width"),t.style.removeProperty("minWidth"),t.style.removeProperty("maxWidth"),t.style.flex="1 1 auto"):Pt(t,e)}function Pt(t,e){e=nn(e),t.style.width=e.toString(),t.style.maxWidth=e.toString(),t.style.minWidth=e.toString()}function Ug(t,e){e==="flex"?(t.style.removeProperty("height"),t.style.removeProperty("minHeight"),t.style.removeProperty("maxHeight"),t.style.flex="1 1 auto"):Ws(t,e)}function Ws(t,e){e=nn(e),t.style.height=e.toString(),t.style.maxHeight=e.toString(),t.style.minHeight=e.toString()}function nn(t){return typeof t=="number"?`${t}px`:t}function Xo(t){return t instanceof Node||t instanceof HTMLElement}function Ju(t){if(t==null)return[];const e=[];return rl(t,s=>e.push(s)),e}function Zu(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 rl(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 ec={};ze(ec,{fuzzyCheckStrings:()=>tc,fuzzySuggestions:()=>Jo});function tc(t,e,s){const i={},o=t.filter(r=>!e.some(n=>n===r));return o.length>0&&o.forEach(r=>i[r]=Jo(r,s).values),i}function Jo(t,e,s,i){let o=e.map((a,l)=>({value:a,relevance:zg(t.toLowerCase(),a.toLocaleLowerCase()),idx:l}));if(o.sort((a,l)=>l.relevance-a.relevance),s&&(o=o.filter(a=>a.relevance!==0)),o.length>0&&i&&i>0){const l=o[0].relevance*i;o=o.filter(d=>l-d.relevance<0)}const r=[],n=[];for(const a of o)r.push(a.value),n.push(a.idx);return{values:r,indices:n}}function zg(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 a=i.indexOf(s[n],r+1);a!==-1&&(r=a,o+=100-r*100/1e4*100)}return o}var sc={};ze(sc,{createIcon:()=>Rt,createIconNoSpan:()=>be,iconNameClassMap:()=>ic});var ic={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 Rt(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(Xo(n))return n;console.warn("AG Grid: iconRenderer should return back a string or a dom object")}else{const n=document.createElement("span");let a=ic[t];return a||(i?a=t:(console.warn(`AG Grid: Did not find icon ${t}`),a="")),n.setAttribute("class",`ag-icon ag-icon-${a}`),n.setAttribute("unselectable","on"),Ae(n,"presentation"),n}}var oc={};ze(oc,{isDeleteKey:()=>ac,isEventFromPrintableCharacter:()=>an,isUserSuppressingHeaderKeyboardEvent:()=>rc,isUserSuppressingKeyboardEvent:()=>xr,normaliseQwertyAzerty:()=>nc});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 Kg=65,$g=67,Yg=86,jg=68,qg=90,Qg=89;function an(t){return t.altKey||t.ctrlKey||t.metaKey?!1:t.key.length===1}function xr(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 rc(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 nc(t){const{keyCode:e}=t;let s;switch(e){case Kg:s=E.A;break;case $g:s=E.C;break;case Yg:s=E.V;break;case jg:s=E.D;break;case qg:s=E.Z;break;case Qg:s=E.Y;break;default:s=t.code}return s}function ac(t,e=!1){return t===E.DELETE?!0:!e&&t===E.BACKSPACE?Ya():!1}var lc={};ze(lc,{areEventsNear:()=>al});function al(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 dc={};ze(dc,{sortRowNodesByOrder:()=>Xg});function Xg(t,e){if(!t)return!1;const s=(n,a)=>{const l=e[n.id],d=e[a.id],c=l!==void 0,h=d!==void 0,m=c&&h,C=!c&&!h;return m?l-d:C?n.__objectId-a.__objectId:c?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 uc={};ze(uc,{convertToSet:()=>ll});function ll(t){const e=new Set;return t.forEach(s=>e.add(s)),e}var Jg=O(O(O(O(O(O(O(O(O(O(O(O(O(O(O(O(O(O({},yu),nu),_u),Uu),$u),ru),Xd),ec),jd),sc),oc),Eu),lc),zu),qd),dc),uc),vu),W=Jg,Ni=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}},Ne=class Sr{constructor(e){this.status=0,this.resolution=null,this.waiters=[],e(s=>this.onDone(s),s=>this.onReject(s))}static all(e){return new Sr(s=>{let i=e.length;const o=new Array(i);e.forEach((r,n)=>{r.then(a=>{o[n]=a,i--,i===0&&s(o)})})})}static resolve(e=null){return new Sr(s=>s(e))}then(e){return new Sr(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")}},Zo=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}}},er=class Gs 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()),!ds()&&(Gs.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||Gs.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=Gs.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=O({},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(),Gs.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 a={type:p.EVENT_TOOLTIP_SHOW,tooltipGui:o,parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(a),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(O({},e),{mouseEvent:this.lastMouseEvent})):this.popupService.positionPopupByComponent(Ee(O({},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(){Gs.isLocked=!0,this.interactiveTooltipTimeoutId=window.setTimeout(()=>{this.unlockService(),this.setToDoNothing()},this.INTERACTIVE_HIDE_DELAY)}unlockService(){Gs.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()}};er.isLocked=!1;u([f("popupService")],er.prototype,"popupService",2);u([f("userComponentFactory")],er.prototype,"userComponentFactory",2);u([M],er.prototype,"postConstruct",1);var Zg=er,us=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 Zg(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")],us.prototype,"beans",2);u([M],us.prototype,"postConstruct",1);var ef=new Ni,tr=class ha extends L{constructor(e){super(),this.displayed=!0,this.visible=!0,this.compId=ef.next(),this.cssClassManager=new Zo(()=>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 a=()=>this.tooltipText;s!=null&&(this.tooltipFeature=this.createBean(new us({getTooltipValue:a,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){Ju(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){ha.elementGettingCreated=e;const a=new n(r);return a.setParentComponent(this),this.createBean(a,null,s),a}return null}copyAttributesFromNode(e,s){Zu(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=Qr(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),Xo(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;ju(this.eGui,e,{skipAriaHidden:i})}}setDisplayed(e,s={}){if(e!==this.displayed){this.displayed=e;const{skipAriaHidden:i}=s;Z(this.eGui,e,{skipAriaHidden:i});const o={type:ha.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}"]`)}};tr.EVENT_DISPLAYED_CHANGED="displayedChanged";u([f("agStackComponentsRegistry")],tr.prototype,"agStackComponentsRegistry",2);u([tu],tr.prototype,"preConstructOnComponent",1);u([tu],tr.prototype,"createChildComponentsPreConstruct",1);var K=tr;function N(t){return tf.bind(this,`[ref=${t}]`,t)}function tf(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}sf(s,"querySelectors",{attributeName:i,querySelector:t,refSelector:e})}function sf(t,e,s){const i=of(t,Qr(t.constructor));i[e]||(i[e]=[]),i[e].push(s)}function of(t,e){return t.__agComponentMetaData||(t.__agComponentMetaData={}),t.__agComponentMetaData[e]||(t.__agComponentMetaData[e]={}),t.__agComponentMetaData[e]}var dl=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([N("eFloatingFilterText")],dl.prototype,"eFloatingFilterText",2);u([f("columnModel")],dl.prototype,"columnModel",2);var cc=class{constructor(t,e,s,i,o){this.alive=!0,this.context=t,this.eParent=i,e.getDateCompDetails(s).newAgStackInstance().then(a=>{if(!this.alive){t.destroyBean(a);return}this.dateComp=a,a&&(i.appendChild(a.getGui()),a.afterGuiAttached&&a.afterGuiAttached(),this.tempValue&&a.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){Z(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)}},hc=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]}},pc={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"},ln=class gc extends L{constructor(e,s={}){super(),this.eFocusableElement=e,this.callbacks=s,this.callbacks=O({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(gc.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||Ht(s))){if(this.callbacks.shouldStopEventPropagation(s)){Bt(s);return}s.key===E.TAB?this.callbacks.onTabKeyDown(s):this.callbacks.handleKeyDown&&this.callbacks.handleKeyDown(s)}})}};ln.FOCUS_MANAGED_CLASS="ag-focus-managed";u([f("focusService")],ln.prototype,"focusService",2);u([M],ln.prototype,"postConstruct",1);var Ts=ln,fc="ag-resizer-wrapper",rf=`<div class="${fc}">
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>`,Ki=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:a}=this.config;this.offsetParent||this.setOffsetParent();let l=0,d=0;const c=pt(this.element);if(c){const h=this.findBoundaryElement(),m=window.getComputedStyle(h);if(m.minWidth!=null){const C=h.offsetWidth-this.element.offsetWidth;d=parseInt(m.minWidth,10)-C}if(m.minHeight!=null){const C=h.offsetHeight-this.element.offsetHeight;l=parseInt(m.minHeight,10)-C}}if(this.minHeight=o||l,this.minWidth=s||d,i&&this.setWidth(i),r&&this.setHeight(r),(!i||!r)&&this.refreshSize(),t)this.center();else if(n||a)this.offsetElement(n,a);else if(c&&e){let h=this.boundaryEl,m=!0;if(h||(h=this.findBoundaryElement(),m=!1),h){const C=parseFloat(h.style.top),v=parseFloat(h.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)Ws(s,t),t=Za(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?Ws(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 a=0;if(e){const d=this.element.parentElement;if(d){const{bottom:c}=d.getBoundingClientRect();a=c-i.bottom}}return s+n-r-a}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)Pt(e,t),t=Do(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?Pt(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,a=e.clientY-this.dragStartPosition.y,l=this.shouldSkipX(e,!!s,!!o,n)?0:n,d=this.shouldSkipY(e,!!i,r,a)?0:a;return{movementX:l,movementY:d}}shouldSkipX(t,e,s,i){const o=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),n=this.boundaryEl.getBoundingClientRect(),a=this.config.popup?this.position.x:o.left;let l=a<=0&&r.left>=t.clientX||r.right<=t.clientX&&r.right<=n.right;return l?!0:(e?l=i<0&&t.clientX>a+r.left||i>0&&t.clientX<a+r.left:s?l=i<0&&t.clientX>n.right||i>0&&t.clientX<a+r.left:l=i<0&&t.clientX>n.right||i>0&&t.clientX<n.right,l)}shouldSkipY(t,e,s=0,i){const o=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),n=this.boundaryEl.getBoundingClientRect(),a=this.config.popup?this.position.y:o.top;let l=a<=0&&r.top>=t.clientY||r.bottom<=t.clientY&&r.bottom<=n.bottom;return l?!0:(e?l=i<0&&t.clientY>a+r.top+s||i>0&&t.clientY<a+r.top:l=i<0&&t.clientY>n.bottom||i>0&&t.clientY<n.bottom,l)}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(rf,"text/html").body;t.appendChild(s.firstChild),this.createResizeMap(),this.resizersAdded=!0}removeResizers(){this.resizerMap=void 0;const t=this.element.querySelector(`.${fc}`);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,a=this.minWidth||0;if(r){const l=window.getComputedStyle(o);l.minHeight&&(n=parseInt(l.minHeight,10)),l.minWidth&&(a=parseInt(l.minWidth,10))}else n=o.offsetHeight,a=o.offsetWidth;e+=n,s+=a}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,a=o||n,l=r||i,{movementX:d,movementY:c}=this.calculateMouseMovement({e:t,isLeft:n,isTop:i}),h=this.position.x,m=this.position.y;let C=0,v=0;if(a&&d){const S=n?-1:1,w=this.getWidth(),R=w+d*S;let y=!1;n&&(C=w-R,(h+C<=0||R<=this.minWidth)&&(y=!0,C=0)),y||this.setWidth(R)}if(l&&c){const S=i?-1:1,w=this.getHeight(),R=w+c*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(h+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")],Ki.prototype,"popupService",2);u([f("resizeObserverService")],Ki.prototype,"resizeObserverService",2);u([f("dragService")],Ki.prototype,"dragService",2);var dn=class ho 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 Ts(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=new Ki(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=ho.isUseApplyButton(e),this.resetButtonsPanel()}updateParams(e){this.providedFilterParams=e,this.applyActive=ho.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?(Fe(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&&_t(this.eButtonsPanel);return}const i=document.createDocumentFragment(),o=r=>{let n,a;switch(r){case"apply":n=this.translate("applyFilter"),a=c=>this.onBtApply(!1,!1,c);break;case"clear":n=this.translate("clearFilter"),a=()=>this.onBtClear();break;case"reset":n=this.translate("resetFilter"),a=()=>this.onBtReset();break;case"cancel":n=this.translate("cancelFilter"),a=c=>{this.onBtCancel(c)};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",a)),i.append(d)};ll(e).forEach(r=>o(r)),this.eButtonsPanel.append(i),this.getGui().appendChild(this.eButtonsPanel)}getDefaultDebounceMs(){return 0}setupOnBtApplyDebounce(){const e=ho.getDebounceMs(this.providedFilterParams,this.getDefaultDebounceMs()),s=Ze(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&&Ii(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 ho.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,pc[e])}getCellValue(e){return this.providedFilterParams.getValue(e)}getPositionableElement(){return this.eFilterBody}};u([f("rowModel")],dn.prototype,"rowModel",2);u([N("eFilterBody")],dn.prototype,"eFilterBody",2);u([M],dn.prototype,"postConstruct",1);var Gr=dn,ul=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(){Fe(this.eLabel),typeof this.label=="string"?this.eLabel.innerText=this.label+this.labelSeparator:this.label&&this.eLabel.appendChild(this.label),this.label===""?(Z(this.eLabel,!1),Ae(this.eLabel,"presentation")):(Z(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:(Lo(this.eLabel,t),this)}setDisabled(t){t=!!t;const e=this.getGui();return Ii(e,t),e.classList.toggle("ag-disabled",t),this.disabled=t,this}isDisabled(){return!!this.disabled}};u([M],ul.prototype,"postConstruct",1);var mc=class extends ul{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();Du(t)!==null?Li(t,""):Li(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 Pt(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)}},nf=`
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>`,ni=class extends mc{constructor(t){if(super(t,(t==null?void 0:t.template)||nf,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()),ns(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)},a=this.popupService.addPopup(n),{maxPickerHeight:l,minPickerWidth:d,maxPickerWidth:c,variableWidth:h}=this;h?(d&&(e.style.minWidth=d),e.style.width=nn(Do(this.eWrapper)),c&&(e.style.maxWidth=c)):Lo(e,c??Do(this.eWrapper));const m=l??`${Qo(this.popupService.getPopupParent())}px`;return e.style.setProperty("max-height",m),e.style.position="absolute",this.alignPickerToComponent(),a.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();ns(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 Lo(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")],ni.prototype,"popupService",2);u([N("eLabel")],ni.prototype,"eLabel",2);u([N("eWrapper")],ni.prototype,"eWrapper",2);u([N("eDisplayField")],ni.prototype,"eDisplayField",2);u([N("eIcon")],ni.prototype,"eIcon",2);var un=class Er 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=>{_t(e)}),this.itemEls=[]}updateIndices(){const e=this.getGui().querySelectorAll(".ag-list-item");e.forEach((s,i)=>{sn(s,i+1),tn(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 us({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(!pt(e))return;this.clearHighlighted(),this.highlightedEl=e,this.highlightedEl.classList.add(Er.ACTIVE_CLASS),Mi(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||!pt(this.highlightedEl)||(this.highlightedEl.classList.remove(Er.ACTIVE_CLASS),Mi(this.highlightedEl,!1),this.highlightedEl=null)}fireChangeEvent(){this.dispatchEvent({type:p.EVENT_FIELD_VALUE_CHANGED}),this.fireItemSelected()}fireItemSelected(){this.dispatchEvent({type:Er.EVENT_ITEM_SELECTED})}};un.EVENT_ITEM_SELECTED="selectedItem";un.ACTIVE_CLASS="ag-active-item";u([M],un.prototype,"init",1);var td=un,Cc=class vc extends ni{constructor(e){super(O({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 td("select",!0)),this.listComponent.setParentComponent(this);const e=this.listComponent.getAriaElement(),s=`ag-select-list-${this.listComponent.getCompId()}`;e.setAttribute("id",s),za(this.getAriaElement(),e),this.listComponent.addManagedListener(this.listComponent,td.EVENT_ITEM_SELECTED,()=>{this.hidePicker(),this.dispatchEvent({type:vc.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()}};Cc.EVENT_ITEM_SELECTED="selectedItem";var cn=Cc,Vt=class extends mc{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 Lo(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 Ii(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([N("eLabel")],Vt.prototype,"eLabel",2);u([N("eWrapper")],Vt.prototype,"eWrapper",2);u([N("eInput")],Vt.prototype,"eInput",2);var hn=class extends Vt{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)}},wc=class extends hn{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)}},cl=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:a,condition2:l}=i;o=[a,l]}const r=o.map(a=>this.getModelAsString(a)),n=i.operator==="AND"?"andCondition":"orCondition";return r.join(` ${s(n,pc[n])} `)}else{if(t.type===De.BLANK||t.type===De.NOT_BLANK)return s(t.type,t.type);{const i=t,o=this.optionsFactory.getCustomOption(i.type),{displayKey:r,displayName:n,numberOfInputs:a}=o||{};return r&&n&&a===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)}},ot=class vi extends Gr{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=[vi.EMPTY,vi.NOT_BLANK,vi.BLANK];return e&&i.indexOf(e)>=0?0:e===vi.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 a=e,l=s;n=this.areSimpleModelsEqual(a,l)}else{const a=e,l=s;n=a.operator===l.operator&&jt(a.conditions,l.conditions,(d,c)=>this.areSimpleModelsEqual(d,c))}return n}shouldRefresh(e){var s,i,o;const r=this.getModel(),n=r?(s=r.conditions)!=null?s:[r]:null,a=(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=>a.find(c=>c===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 a=r;a<o;a++)this.createJoinOperatorPanel(),this.createOption();const n=i.operator==="OR";this.eJoinOperatorsAnd.forEach(a=>a.setValue(!n,!0)),this.eJoinOperatorsOr.forEach(a=>a.setValue(n,!0)),i.conditions.forEach((a,l)=>{this.eTypes[l].setValue(a.type,!0),this.setConditionIntoUi(a,l)})}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(),Ne.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 a=i;r.push(...(s=a.conditions)!=null?s:[])}else r.push(i);return r[o&&o==="OR"?"some":"every"](a=>this.individualConditionPasses(e,a))}setParams(e){super.setParams(e),this.setNumConditions(e),this.defaultJoinOperator=this.getDefaultJoinOperator(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.optionsFactory=new hc,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 cn);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 wc);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&&(Ii(this.eJoinOperatorPanels[0],n),this.eJoinOperatorsAnd[0].setDisabled(n),this.eJoinOperatorsOr[0].setDisabled(n))}),this.eConditionBodies.forEach((o,r)=>{Z(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,a)=>{this.setElementDisplayed(o,r<a),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=>_t(r))}removeComponents(e,s,i){this.removeItems(e,s,i).forEach(r=>{_t(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 Vt&&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 a=this.getNumConditions()-1;a>=0;a--)if(this.isConditionUiComplete(a))s===-1&&(s=a,i=a);else{const l=a>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(a-1),d=a<s;(l||d)&&(this.removeConditionsAndOperators(a,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(Xr(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 Vt))return;const n=i===0&&r>1?"inRangeStart":i===0?"filterOoo":"inRangeEnd",a=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(a)})}setElementValue(e,s,i){e instanceof Vt&&e.setValue(s!=null?String(s):null,!0)}setElementDisplayed(e,s){e instanceof K&&Z(e.getGui(),s)}setElementDisabled(e,s){e instanceof K&&Ii(e.getGui(),s)}attachElementOnChange(e,s){e instanceof Vt&&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 a=r[n];a!=null&&i(a,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)===vi.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(),Ne.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,a)=>{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}};ot.EMPTY="empty";ot.BLANK="blank";ot.NOT_BLANK="notBlank";ot.EQUALS="equals";ot.NOT_EQUAL="notEqual";ot.LESS_THAN="lessThan";ot.LESS_THAN_OR_EQUAL="lessThanOrEqual";ot.GREATER_THAN="greaterThan";ot.GREATER_THAN_OR_EQUAL="greaterThanOrEqual";ot.IN_RANGE="inRange";ot.CONTAINS="contains";ot.NOT_CONTAINS="notContains";ot.STARTS_WITH="startsWith";ot.ENDS_WITH="endsWith";var De=ot,Oe=class Ve extends De{setParams(e){super.setParams(e),this.scalarFilterParams=e}evaluateNullValue(e){switch(e){case Ve.EQUALS:case Ve.NOT_EQUAL:if(this.scalarFilterParams.includeBlanksInEquals)return!0;break;case Ve.GREATER_THAN:case Ve.GREATER_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInGreaterThan)return!0;break;case Ve.LESS_THAN:case Ve.LESS_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInLessThan)return!0;break;case Ve.IN_RANGE:if(this.scalarFilterParams.includeBlanksInRange)return!0;break;case Ve.BLANK:return!0;case Ve.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 Ve.EQUALS:return r===0;case Ve.NOT_EQUAL:return r!==0;case Ve.GREATER_THAN:return r>0;case Ve.GREATER_THAN_OR_EQUAL:return r>=0;case Ve.LESS_THAN:return r<0;case Ve.LESS_THAN_OR_EQUAL:return r<=0;case Ve.IN_RANGE:{const n=o(e[1],s);return this.scalarFilterParams.inRangeInclusive?r>=0&&n<=0:r>0&&n<0}case Ve.BLANK:return this.isBlank(s);case Ve.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}}},sd=1e3,id=1/0,Sc=class extends cl{constructor(t,e,s){super(e,s),this.dateFilterParams=t}conditionToString(t,e){const{type:s}=t,{numberOfInputs:i}=e||{},o=s==De.IN_RANGE||i===2,r=ut(t.dateFrom),n=ut(t.dateTo),a=this.dateFilterParams.inRangeFloatingFilterDateFormat;if(o){const l=r!==null?Ai(r,a):"null",d=n!==null?Ai(n,a):"null";return`${l}-${d}`}return r!=null?Ai(r,a):`${s}`}updateParams(t){super.updateParams(t),this.dateFilterParams=t.dateFilterParams}},hl=class Ec extends Oe{constructor(){super("dateFilter"),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=sd,this.maxValidYear=id,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",sd),this.maxValidYear=s("maxValidYear",id),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 Sc(this.dateFilterParams,this.localeService,this.optionsFactory)}createDateCompWrapper(e){const s=new cc(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 Ec.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=At(o[0])),o.length>1&&(i.dateTo=At(o[1])),O({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===Oe.LESS_THAN?super.translate("before"):e===Oe.GREATER_THAN?super.translate("after"):super.translate(e)}getModelAsString(e){var s;return(s=this.filterModelFormatter.getModelAsString(e))!=null?s:""}};hl.DEFAULT_FILTER_OPTIONS=[Oe.EQUALS,Oe.NOT_EQUAL,Oe.LESS_THAN,Oe.GREATER_THAN,Oe.IN_RANGE,Oe.BLANK,Oe.NOT_BLANK];u([f("userComponentFactory")],hl.prototype,"userComponentFactory",2);var yc=hl,pl=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 hc,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=[De.IN_RANGE,De.EMPTY,De.BLANK,De.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")],pl.prototype,"columnModel",2);var pn=class extends pl{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 yc.DEFAULT_FILTER_OPTIONS}init(t){super.init(t),this.params=t,this.filterParams=t.filterParams,this.createDateComponent(),this.filterModelFormatter=new Sc(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){Z(this.eDateWrapper,t),Z(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=At(t);this.params.parentFilterInstance(s=>{if(s){const i=ut(e);s.onFloatingFilterChanged(this.getLastType()||null,i)}})}getDateComponentParams(){const t=Gr.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs());return{onDateChanged:Ze(this.onDateChanged.bind(this),t),filterParams:this.params.column.getColDef().filterParams}}createDateComponent(){this.dateComp=new cc(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")],pn.prototype,"userComponentFactory",2);u([N("eReadOnlyText")],pn.prototype,"eReadOnlyText",2);u([N("eDateWrapper")],pn.prototype,"eDateWrapper",2);var Rc=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&&Xt(),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[a,l]=[r,n].map(d=>d instanceof Date?d:ut(d));a&&l&&a.getTime()>l.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(At(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:rn()||$a()||Xt()&&Ka()>=14.1}};u([N("eDateInput")],Rc.prototype,"eDateInput",2);var ai=class extends Vt{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=>{an(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()})}},gl=class extends ai{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")}},bc=class extends cl{conditionToString(t,e){const{numberOfInputs:s}=e||{};return t.type==De.IN_RANGE||s===2?`${this.formatValue(t.filter)}-${this.formatValue(t.filterTo)}`:t.filter!=null?this.formatValue(t.filter):`${t.type}`}};function pa(t){const{allowedCharPattern:e}=t??{};return e??null}var Tc=class Dc extends Oe{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 bc(this.localeService,this.optionsFactory,this.numberFilterParams.numberFormatter)}getDefaultFilterOptions(){return Dc.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=pa(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 ai({allowedCharPattern:o}):new gl);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=qt(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}};Tc.DEFAULT_FILTER_OPTIONS=[Oe.EQUALS,Oe.NOT_EQUAL,Oe.GREATER_THAN,Oe.GREATER_THAN_OR_EQUAL,Oe.LESS_THAN,Oe.LESS_THAN_OR_EQUAL,Oe.IN_RANGE,Oe.BLANK,Oe.NOT_BLANK];var Ac=Tc,Pc=class extends cl{conditionToString(t,e){const{numberOfInputs:s}=e||{};return t.type==De.IN_RANGE||s===2?`${t.filter}-${t.filterTo}`:t.filter!=null?`${t.filter}`:`${t.type}`}},xt=class wi extends De{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?wi.DEFAULT_FORMATTER:wi.DEFAULT_LOWERCASE_FORMATTER),this.filterModelFormatter=new Pc(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||wi.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,a)=>{var l;if(r<a){let d=qt(o.getValue());s&&this.textFilterParams.trimInput&&(d=(l=wi.trimInput(d))!=null?l:null,o.setValue(d,!0)),i.push(d)}}),i}getDefaultFilterOptions(){return wi.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 ai);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=[De.NOT_EQUAL,De.NOT_CONTAINS,De.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:a,colDef:l,column:d,columnApi:c,context:h,textFormatter:m}=this.textFilterParams;if(i.type===De.BLANK)return this.isBlank(s);if(i.type===De.NOT_BLANK)return!this.isBlank(s);const C={api:a,colDef:l,column:d,columnApi:c,context:h,node:o.node,data:o.data,filterOption:i.type,value:n,textFormatter:m};return r.some(v=>this.matcher(Ee(O({},C),{filterText:v})))}getModelAsString(e){var s;return(s=this.filterModelFormatter.getModelAsString(e))!=null?s:""}};xt.DEFAULT_FILTER_OPTIONS=[De.CONTAINS,De.NOT_CONTAINS,De.EQUALS,De.NOT_EQUAL,De.STARTS_WITH,De.ENDS_WITH,De.BLANK,De.NOT_BLANK];xt.DEFAULT_FORMATTER=t=>t;xt.DEFAULT_LOWERCASE_FORMATTER=t=>t==null?null:t.toString().toLowerCase();xt.DEFAULT_MATCHER=({filterOption:t,value:e,filterText:s})=>{if(s==null)return!1;switch(t){case xt.CONTAINS:return e.indexOf(s)>=0;case xt.NOT_CONTAINS:return e.indexOf(s)<0;case xt.EQUALS:return e===s;case xt.NOT_EQUAL:return e!=s;case xt.STARTS_WITH:return e.indexOf(s)===0;case xt.ENDS_WITH:const i=e.lastIndexOf(s);return i>=0&&i===e.length-s.length;default:return!1}};var fl=xt,Fc=class extends L{constructor(t){super(),this.params=t,this.valueChangedListener=()=>{}}setupGui(t){var e;this.eFloatingFilterTextInput=this.createManagedBean(new ai((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)}},gn=class extends pl{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=Gr.isUseApplyButton(this.params.filterParams),!this.isReadOnly()){const i=Gr.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs()),o=Ze(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();Fe(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=fl.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([N("eFloatingFilterInputContainer")],gn.prototype,"eFloatingFilterInputContainer",2);u([M],gn.prototype,"postConstruct",1);var af=class extends L{constructor(){super(...arguments),this.valueChangedListener=()=>{},this.numberInputActive=!0}setupGui(t){this.eFloatingFilterNumberInput=this.createManagedBean(new gl),this.eFloatingFilterTextInput=this.createManagedBean(new ai),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)}},lf=class extends gn{init(t){var e;super.init(t),this.filterModelFormatter=new bc(this.localeService,this.optionsFactory,(e=t.filterParams)==null?void 0:e.numberFormatter)}onParamsUpdated(t){this.refresh(t)}refresh(t){pa(t.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(t),super.refresh(t),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return Ac.DEFAULT_FILTER_OPTIONS}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(t){return this.allowedCharPattern=pa(t.filterParams),this.allowedCharPattern?this.createManagedBean(new Fc({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new af)}},df=class extends gn{init(t){super.init(t),this.filterModelFormatter=new Pc(this.localeService,this.optionsFactory)}onParamsUpdated(t){this.refresh(t)}refresh(t){super.refresh(t),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return fl.DEFAULT_FILTER_OPTIONS}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(){return this.createManagedBean(new Fc)}},sr=class po{constructor(e,s=!1){this.destroyFuncs=[],this.touching=!1,this.eventService=new kt,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:po.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;!al(s,this.touchStart,4)&&(this.moved=!0)}onTouchEnd(e){if(this.touching){if(!this.moved){const s={type:po.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>po.DOUBLE_TAP_MILLIS){const i={type:po.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())}};sr.EVENT_TAP="tap";sr.EVENT_DOUBLE_TAP="doubleTap";sr.EVENT_LONG_TAP="longTap";sr.DOUBLE_TAP_MILLIS=500;var We=sr,cs=class Lc extends K{constructor(e){super(),e||this.setTemplate(Lc.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";Z(this.eSortAsc,s,{skipAriaHidden:!0})}if(this.eSortDesc){const s=e==="desc";Z(this.eSortDesc,s,{skipAriaHidden:!0})}if(this.eSortNone){const s=!this.column.getColDef().unSortIcon&&!this.gos.get("unSortIcon"),i=e==null;Z(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";Z(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 a;return(a=this.sortController.getDisplaySortIndexForColumn(n))!=null?a:!1}),r=i>=0&&o;Z(this.eSortOrder,r,{skipAriaHidden:!0}),i>=0?this.eSortOrder.textContent=(i+1).toString():Fe(this.eSortOrder)}};cs.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([N("eSortOrder")],cs.prototype,"eSortOrder",2);u([N("eSortAsc")],cs.prototype,"eSortAsc",2);u([N("eSortDesc")],cs.prototype,"eSortDesc",2);u([N("eSortMixed")],cs.prototype,"eSortMixed",2);u([N("eSortNone")],cs.prototype,"eSortNone",2);u([f("columnModel")],cs.prototype,"columnModel",2);u([f("sortController")],cs.prototype,"sortController",2);var ml=cs,qe=class Mc 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:Mc.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=Ie(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 We(this.getGui(),!0),i=this.shouldSuppressMenuHide(),o=i&&P(this.eMenu),r=o?new We(this.eMenu,!0):s;if(this.params.enableMenu){const n=o?"EVENT_TAP":"EVENT_LONG_TAP",a=l=>this.params.showColumnMenuAfterMouseClick(l.touchStart);this.addManagedListener(r,We[n],a)}if(this.params.enableSorting){const n=a=>{var l,d;const c=a.touchStart.target;i&&((l=this.eMenu)!=null&&l.contains(c)||(d=this.eFilterButton)!=null&&d.contains(c))||this.sortController.progressSort(this.params.column,!1,"uiColumnSorted")};this.addManagedListener(s,We.EVENT_TAP,n)}if(this.params.enableFilterButton){const n=new We(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){_t(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,a=this.menuService.isLegacyMenuEnabled();if(e&&!a){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 ml(!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,ge.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 l=this.gos.get("multiSortKey")==="ctrl"?s.ctrlKey||s.metaKey:s.shiftKey;this.params.progressSort(l)}});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 _t(s),!1;const{column:o}=this.params;return this.addInIcon("filter",s,o),this.addManagedListener(o,ge.EVENT_FILTER_CHANGED,i),i(),!0}onFilterChangedIcon(){const e=this.params.column.isFilterActive();Z(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([N("eFilter")],qe.prototype,"eFilter",2);u([N("eFilterButton")],qe.prototype,"eFilterButton",2);u([N("eSortIndicator")],qe.prototype,"eSortIndicator",2);u([N("eMenu")],qe.prototype,"eMenu",2);u([N("eLabel")],qe.prototype,"eLabel",2);u([N("eText")],qe.prototype,"eText",2);u([N("eSortOrder")],qe.prototype,"eSortOrder",2);u([N("eSortAsc")],qe.prototype,"eSortAsc",2);u([N("eSortDesc")],qe.prototype,"eSortDesc",2);u([N("eSortMixed")],qe.prototype,"eSortMixed",2);u([N("eSortNone")],qe.prototype,"eSortNone",2);var ga=qe,ir=class Ic extends K{constructor(){super(Ic.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(Ht(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=>{Bt(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,Me.EVENT_EXPANDED_CHANGED,this.updateIconVisibility.bind(this)),this.addManagedListener(i,Me.EVENT_EXPANDABLE_CHANGED,this.updateIconVisibility.bind(this))}addTouchAndClickListeners(e,s){const i=new We(e,!0);this.addManagedListener(i,We.EVENT_TAP,s),this.addDestroyFunc(()=>i.destroy()),this.addManagedListener(e,"click",s)}updateIconVisibility(){if(this.params.columnGroup.isExpandable()){const s=this.params.columnGroup.isExpanded();Z(this.eOpenIcon,s),Z(this.eCloseIcon,!s)}else Z(this.eOpenIcon,!1),Z(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()){Z(this.eOpenIcon,!1),Z(this.eCloseIcon,!1);return}}setupLabel(){var e;const{displayName:s,columnGroup:i}=this.params;if(P(s)){const o=Ie(s,!0);this.getRefElement("agLabel").textContent=o}this.addOrRemoveCssClass("ag-sticky-label",!((e=i.getColGroupDef())!=null&&e.suppressStickyLabel))}};ir.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")],ir.prototype,"columnModel",2);u([N("agOpened")],ir.prototype,"eOpenIcon",2);u([N("agClosed")],ir.prototype,"eCloseIcon",2);var uf=ir,li=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()}},Cl=class Nc extends li{constructor(){super(Nc.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)}};Cl.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([N("eTextArea")],Cl.prototype,"eTextArea",2);var cf=Cl,vl=class extends li{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(U(o)){console.warn("AG Grid: no values found for select cellEditor");return}this.startedByEnter=n!=null?n===E.ENTER:!1;let a=!1;o.forEach(h=>{const m={value:h},C=s.formatValue(t.column,null,h),v=C!=null;m.text=v?C:h,e.addOption(m),a=a||r===h}),a?e.setValue(t.value,!0):t.values.length&&e.setValue(t.values[0],!0);const{valueListGap:l,valueListMaxWidth:d,valueListMaxHeight:c}=t;l!=null&&e.setPickerGap(l),c!=null&&e.setPickerMaxHeight(c),d!=null&&e.setPickerMaxWidth(d),i.get("editType")!=="fullRow"&&this.addManagedListener(this.eSelect,cn.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")],vl.prototype,"valueService",2);u([N("eSelect")],vl.prototype,"eSelect",2);var or=class extends li{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;Xt()||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([N("eInput")],or.prototype,"eInput",2);var hf=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)}},od=class extends or{constructor(){super(new hf)}},pf="↑",gf="↓",xc=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=pf+o:this.eDelta.textContent=gf+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"),Fe(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:Fe(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")],xc.prototype,"filterManager",2);var Gc=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 U(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:Fe(this.eCurrent),!0)}};u([f("filterManager")],Gc.prototype,"filterManager",2);var ye=class ve{constructor(e){this.rowIndex=null,this.key=null,this.childrenMapped={},this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=ve.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:ve.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 ve(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(ve.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(ve.ID_PREFIX_ROW_GROUP)&&console.error(`AG Grid: Row IDs cannot start with ${ve.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(ve.EVENT_FIRST_CHILD_CHANGED)))}setLastChild(e){this.lastChild!==e&&(this.lastChild=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(ve.EVENT_LAST_CHILD_CHANGED)))}setChildIndex(e){this.childIndex!==e&&(this.childIndex=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(ve.EVENT_CHILD_INDEX_CHANGED)))}setRowTop(e){this.oldRowTop=this.rowTop,this.rowTop!==e&&(this.rowTop=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(ve.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(ve.EVENT_DISPLAYED_CHANGED)))}setDragging(e){this.dragging!==e&&(this.dragging=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(ve.EVENT_DRAGGING_CHANGED)))}setHighlighted(e){e!==this.highlighted&&(this.highlighted=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(ve.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(ve.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(ve.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(ve.EVENT_GROUP_CHANGED)))}setRowHeight(e,s=!1){this.rowHeight=e,this.rowHeightEstimated=s,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(ve.EVENT_HEIGHT_CHANGED))}setRowAutoHeight(e,s){this.__autoHeights||(this.__autoHeights={}),this.__autoHeights[s.getId()]=e,e!=null&&(this.checkAutoHeightsDebounced==null&&(this.checkAutoHeightsDebounced=Ze(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(a=>{let l=o[a.getId()];if(l==null)if(this.beans.columnModel.isColSpanActive()){let d=[];switch(a.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(a)){e=!0;return}l=-1}else{e=!0;return}else s=!1;l>i&&(i=l)}),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(ve.EVENT_ROW_INDEX_CHANGED)))}setUiLevel(e){this.uiLevel!==e&&(this.uiLevel=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(ve.EVENT_UI_LEVEL_CHANGED)))}setExpanded(e,s,i){if(this.expanded===e)return;this.expanded=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(ve.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 l;return typeof e!="string"?e:(l=this.beans.columnModel.getGridColumn(e))!=null?l:this.beans.columnModel.getPrimaryColumn(e)})(),n=this.getValueFromValueService(r);if(this.beans.gos.get("readOnlyEdit"))return this.dispatchEventForSaveValueReadOnly(r,n,s,i),!1;const a=this.beans.valueService.setValue(this,r,s,i);return this.dispatchCellChangedEvent(r,s,n),this.checkRowSelectable(),a}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 a=(s=this.beans.gos.get("groupTotalRow"))!=null?s:this.beans.gos.get("groupIncludeFooter");typeof a!="function"?n=!!a:n=!!((i=this.beans.gos.getCallback("groupTotalRow"))!=null?i:this.beans.gos.getCallback("groupIncludeFooter"))({node:this});const l=this.beans.gos.get("groupSuppressBlankHeader"),d=r&&n&&!l;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);U(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 a=this.beans.columnModel.lookupGridColumn(o);a&&this.dispatchCellChangedEvent(a,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(ve.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:ve.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 a=n.isSelected();if(!n.selectable){const l=n.calculateSelectedFromChildren();if(l===null)continue;a=l}switch(a){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(ve.EVENT_ROW_SELECTED));const n=this.sibling;n&&n.footer&&n.eventService&&n.dispatchLocalEvent(n.createLocalRowEvent(ve.EVENT_ROW_SELECTED));const a=Ee(O({},this.createGlobalRowEvent(p.EVENT_ROW_SELECTED)),{event:s||null,source:i});return this.beans.eventService.dispatchEvent(a),!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(O({},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 kt),this.beans.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.eventService.setFrameworkOverrides(this.beans.frameworkOverrides),this.frameworkEventListenerService=new Ga(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(ve.EVENT_MOUSE_ENTER))}onMouseLeave(){this.dispatchLocalEvent(this.createLocalRowEvent(ve.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 ve(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 Q=ye,fn=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=on(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=>{Bt(i)}),this.addManagedListener(this.eCheckbox.getInputElement(),"click",i=>{Bt(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,Q.EVENT_ROW_SELECTED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.rowNode,Q.EVENT_DATA_CHANGED,this.onDataChanged.bind(this)),this.addManagedListener(this.rowNode,Q.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,Q.EVENT_DATA_CHANGED,i),this.addManagedListener(this.rowNode,Q.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(O({},n),{node:this.rowNode,data:this.rowNode.data}));else{const a=this.column.createColumnFunctionCallbackParams(this.rowNode);i=o(O(O({},n),a))}}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([N("eCheckbox")],fn.prototype,"eCheckbox",2);u([M],fn.prototype,"postConstruct",1);var Oc=(t=>(t[t.Left=0]="Left",t[t.Right=1]="Right",t))(Oc||{}),Y=class extends L{constructor(){super(...arguments),this.dragSourceAndParamsList=[],this.dropTargets=[]}init(){this.ePinnedIcon=Rt("columnMovePin",this.gos,null),this.eHideIcon=Rt("columnMoveHide",this.gos,null),this.eMoveIcon=Rt("columnMoveMove",this.gos,null),this.eLeftIcon=Rt("columnMoveLeft",this.gos,null),this.eRightIcon=Rt("columnMoveRight",this.gos,null),this.eGroupIcon=Rt("columnMoveGroup",this.gos,null),this.eAggregateIcon=Rt("columnMoveValue",this.gos,null),this.ePivotIcon=Rt("columnMovePivot",this.gos,null),this.eDropNotAllowedIcon=Rt("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),lt(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),a=this.getVerticalDirection(t);this.eventLastTime=t,this.positionGhost(t);const l=this.dropTargets.filter(c=>this.isMouseOnDropTarget(t,c)),d=this.findCurrentDropTarget(t,l);if(d!==this.lastDropTarget)this.leaveLastTargetIfExists(t,n,a,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,a,e),this.lastDropTarget=d;else if(d&&d.onDragging){const c=this.createDropTargetEvent(d,t,n,a,e);d.onDragging(c)}}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(cu(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:a,columnApi:l,dragItem:d,dragSource:c}=this,h=e.clientX-n.left,m=e.clientY-n.top;return{event:e,x:h,y:m,vDirection:i,hDirection:s,dragSource:c,fromNudge:o,dragItem:d,api:a,columnApi:l,dropZoneTarget:r}}positionGhost(t){const e=this.eGhost;if(!e)return;const i=e.getBoundingClientRect().height,o=Hu()-2,r=ku()-2,n=el(e.offsetParent),{clientY:a,clientX:l}=t;let d=a-n.top-i/2,c=l-n.left-10;const h=this.gos.getDocument(),m=h.defaultView||window,C=m.pageYOffset||h.documentElement.scrollTop,v=m.pageXOffset||h.documentElement.scrollLeft;o>0&&c+e.clientWidth>o+v&&(c=o+v-e.clientWidth),c<0&&(c=0),r>0&&d+e.clientHeight>r+C&&(d=r+C-e.clientHeight),d<0&&(d=0),e.style.left=`${c}px`,e.style.top=`${d}px`}removeGhost(){this.eGhost&&this.eGhostParent&&this.eGhostParent.removeChild(this.eGhost),this.eGhost=null}createGhost(){this.eGhost=ct(Y.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;Xr(s)&&(s=s()),e.innerHTML=Ie(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){Fe(this.eGhostIcon);let s=null;switch(t||(t=this.dragSource.getDefaultIconName?this.dragSource.getDefaultIconName():Y.ICON_NOT_ALLOWED),t){case Y.ICON_PINNED:s=this.ePinnedIcon;break;case Y.ICON_MOVE:s=this.eMoveIcon;break;case Y.ICON_LEFT:s=this.eLeftIcon;break;case Y.ICON_RIGHT:s=this.eRightIcon;break;case Y.ICON_GROUP:s=this.eGroupIcon;break;case Y.ICON_AGGREGATE:s=this.eAggregateIcon;break;case Y.ICON_PIVOT:s=this.ePivotIcon;break;case Y.ICON_NOT_ALLOWED:s=this.eDropNotAllowedIcon;break;case Y.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)}};Y.ICON_PINNED="pinned";Y.ICON_MOVE="move";Y.ICON_LEFT="left";Y.ICON_RIGHT="right";Y.ICON_GROUP="group";Y.ICON_AGGREGATE="aggregate";Y.ICON_PIVOT="pivot";Y.ICON_NOT_ALLOWED="notAllowed";Y.ICON_HIDE="hide";Y.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")],Y.prototype,"dragService",2);u([f("mouseEventService")],Y.prototype,"mouseEventService",2);u([f("columnApi")],Y.prototype,"columnApi",2);u([f("gridApi")],Y.prototype,"gridApi",2);u([M],Y.prototype,"init",1);u([it],Y.prototype,"clearDragSourceParamsList",1);Y=u([G("dragAndDropService")],Y);var qs=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 Hc(this,this.beans,this.rowNode,this.column):new Vc(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")],qs.prototype,"beans",2);u([M],qs.prototype,"postConstruct",1);u([it],qs.prototype,"removeDragSource",1);var _c=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=Xr(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))}}},Vc=class extends _c{constructor(t,e,s,i){super(t,s,i),this.beans=e}postConstruct(){this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.addManagedListener(this.rowNode,Q.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,Q.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,Q.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],Vc.prototype,"postConstruct",1);var Hc=class extends _c{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,Q.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,Q.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],Hc.prototype,"postConstruct",1);var di=class extends L{init(t,e,s,i,o,r,n){var a,l,d,c;this.params=n,this.eGui=e,this.eCheckbox=s,this.eExpanded=i,this.eContracted=o,this.comp=t,this.compClass=r;const{node:h,value:m,colDef:C}=n,v=this.isTopLevelFooter();if(!v){if(this.isEmbeddedRowMismatch())return;if(h.footer&&this.gos.get("groupHideOpenParents")){const w=C&&C.showRowGroup,R=h.rowGroupColumn&&h.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=!h.group&&(((a=this.params.colDef)==null?void 0:a.field)||((l=this.params.colDef)==null?void 0:l.valueGetter)),b=this.isExpandable(),T=this.columnModel.isPivotMode()&&h.leafGroup&&((d=h.rowGroupColumn)==null?void 0:d.getColId())===((c=n.column)==null?void 0:c.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()){Lu(e);return}const s=()=>{ns(e,!!t.expanded)};this.expandListener=this.addManagedListener(t,Q.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}}U(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(O({},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=Na(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,Q.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,Q.EVENT_EXPANDED_CHANGED,this.showExpandAndContractIcons.bind(this)),this.showExpandAndContractIcons();const n=this.onRowNodeIsExpandableChanged.bind(this);this.addManagedListener(this.displayedGroupNode,Q.EVENT_ALL_CHILDREN_COUNT_CHANGED,n),this.addManagedListener(this.displayedGroupNode,Q.EVENT_MASTER_CHANGED,n),this.addManagedListener(this.displayedGroupNode,Q.EVENT_GROUP_CHANGED,n),this.addManagedListener(this.displayedGroupNode,Q.EVENT_HAS_CHILDREN_CHANGED,n)}onExpandClicked(t){Ht(t)||(Bt(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,a=o&&!n,l=i.footer&&i.level===-1;this.comp.addOrRemoveCssClass("ag-cell-expandable",a),this.comp.addOrRemoveCssClass("ag-row-group",a),r?this.comp.addOrRemoveCssClass("ag-pivot-leaf-group",n):l||this.comp.addOrRemoveCssClass("ag-row-group-leaf-indent",!a)}onRowNodeIsExpandableChanged(){this.showExpandAndContractIcons(),this.setIndent(),this.refreshAriaExpanded()}setupIndent(){const t=this.params.node;this.params.suppressPadding||(this.addManagedListener(t,Q.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 qs(()=>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 fn;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(Ht(t))return;Mr(this.eExpanded,t)||Mr(this.eContracted,t)||this.onExpandOrContract(t)}};u([f("expressionService")],di.prototype,"expressionService",2);u([f("valueService")],di.prototype,"valueService",2);u([f("columnModel")],di.prototype,"columnModel",2);u([f("userComponentFactory")],di.prototype,"userComponentFactory",2);u([f("ctrlsService")],di.prototype,"ctrlsService",2);var ui=class kc extends K{constructor(){super(kc.TEMPLATE)}init(e){const s={setInnerRenderer:(n,a)=>this.setRenderDetails(n,a),setChildCount:n=>this.eChildCount.textContent=n,addOrRemoveCssClass:(n,a)=>this.addOrRemoveCssClass(n,a),setContractedDisplayed:n=>Z(this.eContracted,n),setExpandedDisplayed:n=>Z(this.eExpanded,n),setCheckboxVisible:n=>this.eCheckbox.classList.toggle("ag-invisible",!n)},i=this.createManagedBean(new di),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}};ui.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([N("eExpanded")],ui.prototype,"eExpanded",2);u([N("eContracted")],ui.prototype,"eContracted",2);u([N("eCheckbox")],ui.prototype,"eCheckbox",2);u([N("eValue")],ui.prototype,"eValue",2);u([N("eChildCount")],ui.prototype,"eChildCount",2);var rd=ui,mn=class Bc extends K{constructor(){super(Bc.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()}};mn.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([N("eLoadingIcon")],mn.prototype,"eLoadingIcon",2);u([N("eLoadingText")],mn.prototype,"eLoadingText",2);var ff=mn,Wc=class Uc extends K{constructor(){super(Uc.TEMPLATE)}init(e){const s=`ag-cell-skeleton-renderer-${this.getCompId()}`;this.getGui().setAttribute("id",s),this.addDestroyFunc(()=>Li(e.eParentOfValue)),Li(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()}};Wc.TEMPLATE='<div class="ag-skeleton-container"></div>';var mf=Wc,zc=class Kc extends K{constructor(){super()}destroy(){super.destroy()}init(e){const s=this.gos.get("overlayLoadingTemplate");if(this.setTemplate(s??Kc.DEFAULT_LOADING_OVERLAY_TEMPLATE),!s){const i=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=i("loadingOoo","Loading...")})}}};zc.DEFAULT_LOADING_OVERLAY_TEMPLATE='<span aria-live="polite" aria-atomic="true" class="ag-overlay-loading-center"></span>';var Cf=zc,$c=class Yc extends K{constructor(){super()}destroy(){super.destroy()}init(e){const s=this.gos.get("overlayNoRowsTemplate");if(this.setTemplate(s??Yc.DEFAULT_NO_ROWS_TEMPLATE),!s){const i=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=i("noRowsToShow","No Rows To Show")})}}};$c.DEFAULT_NO_ROWS_TEMPLATE='<span class="ag-overlay-no-rows-center"></span>';var vf=$c,wf=class extends li{constructor(){super('<div class="ag-tooltip"></div>')}init(t){const{value:e}=t;this.getGui().textContent=Ie(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}},Ef=class extends or{constructor(){super(new Sf)}},yf=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 At(t,!1)}},Rf=class extends or{constructor(){super(new yf)}},bf=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 At((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)}},jc=class extends or{constructor(){super(new bf(()=>this.dataTypeService))}};u([f("dataTypeService")],jc.prototype,"dataTypeService",2);var wl=class qc extends K{constructor(){super(qc.TEMPLATE)}init(e){this.params=e,this.updateCheckbox(e);const s=this.eCheckbox.getInputElement();s.setAttribute("tabindex","-1"),Ha(s,"polite"),this.addManagedListener(s,"click",i=>{if(Bt(i),this.eCheckbox.isDisabled())return;const o=this.eCheckbox.getValue();this.onCheckboxChanged(o)}),this.addManagedListener(s,"dblclick",i=>{Bt(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 h=e.column.getColId();h.startsWith(Fi)?r=e.value==null||e.value===""?void 0:e.value==="true":e.node.aggData&&e.node.aggData[h]!==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 a=e.disabled!=null?e.disabled:!((o=e.column)!=null&&o.isCellEditable(e.node));this.eCheckbox.setDisabled(a);const l=this.localeService.getLocaleTextFunc(),d=on(l,r),c=a?d:`${l("ariaToggleCellValue","Press SPACE to toggle cell value")} (${d})`;this.eCheckbox.setInputAriaLabel(c)}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 a=this.params.node.setDataValue(this.params.column,e,"edit"),l={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:a};this.eventService.dispatchEvent(l)}};wl.TEMPLATE=`
166
+ <div class="ag-cell-wrapper ag-checkbox-cell" role="presentation">
167
+ <ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>
168
+ </div>`;u([N("eCheckbox")],wl.prototype,"eCheckbox",2);var Tf=wl,Qc=class extends li{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=on(e,t),i=e("ariaToggleCellValue","Press SPACE to toggle cell value");this.eCheckbox.setInputAriaLabel(`${i} (${s})`)}};u([N("eCheckbox")],Qc.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&&(Xo(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";ns(e,!1),t.appendChild(be(s,this.gos))}e.appendChild(t)}getClassName(t){return`${this.cssClassPrefix}-${t}`}destroy(){super.destroy()}},Or=class extends L{constructor(){super(...arguments),this.agGridDefaults={agDateInput:Rc,agColumnHeader:ga,agColumnGroupHeader:uf,agSortIndicator:ml,agTextColumnFloatingFilter:df,agNumberColumnFloatingFilter:lf,agDateColumnFloatingFilter:pn,agReadOnlyFloatingFilter:dl,agAnimateShowChangeCellRenderer:xc,agAnimateSlideCellRenderer:Gc,agGroupCellRenderer:rd,agGroupRowRenderer:rd,agLoadingCellRenderer:ff,agSkeletonCellRenderer:mf,agCheckboxCellRenderer:Tf,agCellEditor:od,agTextCellEditor:od,agNumberCellEditor:Ef,agDateCellEditor:Rf,agDateStringCellEditor:jc,agSelectCellEditor:vl,agLargeTextCellEditor:cf,agCheckboxCellEditor:Qc,agTextColumnFilter:fl,agNumberColumnFilter:Ac,agDateColumnFilter:yc,agLoadingOverlay:Cf,agNoRowsOverlay:vf,agTooltipComponent:wf,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&&Ye(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=(a,l)=>({componentFromFramework:l,component:a}),i=this.getFrameworkOverrides().frameworkComponent(e,this.gos.get("components"));if(i!=null)return s(i,!0);const o=this.jsComps[e];if(o){const a=this.getFrameworkOverrides().isFrameworkComponent(o);return s(o,a)}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()):Pi(()=>{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=Jo(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],Or.prototype,"init",1);Or=u([G("userComponentRegistry")],Or);var Af={propertyName:"dateComponent",cellRenderer:!1},Pf={propertyName:"headerComponent",cellRenderer:!1},Ff={propertyName:"headerGroupComponent",cellRenderer:!1},nd={propertyName:"cellRenderer",cellRenderer:!0},Lf={propertyName:"loadingCellRenderer",cellRenderer:!0},Mf={propertyName:"cellEditor",cellRenderer:!1},ad={propertyName:"innerRenderer",cellRenderer:!0},If={propertyName:"loadingOverlayComponent",cellRenderer:!1},Nf={propertyName:"noRowsOverlayComponent",cellRenderer:!1},xf={propertyName:"tooltipComponent",cellRenderer:!1},fa={propertyName:"filter",cellRenderer:!1},Gf={propertyName:"floatingFilterComponent",cellRenderer:!1},Of={propertyName:"toolPanel",cellRenderer:!1},_f={propertyName:"statusPanel",cellRenderer:!1},Vf={propertyName:"fullWidthCellRenderer",cellRenderer:!0},Hf={propertyName:"loadingCellRenderer",cellRenderer:!0},kf={propertyName:"groupRowRenderer",cellRenderer:!0},Bf={propertyName:"detailCellRenderer",cellRenderer:!0},Wf={propertyName:"menuItem",cellRenderer:!1},Xc=class{static getFloatingFilterType(t){return this.filterToFloatingFilterMapping[t]}};Xc.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 ws=class extends L{getHeaderCompDetails(t,e){return this.getCompDetails(t,Pf,"agColumnHeader",e)}getHeaderGroupCompDetails(t){const e=t.columnGroup.getColGroupDef();return this.getCompDetails(e,Ff,"agColumnGroupHeader",t)}getFullWidthCellRendererDetails(t){return this.getCompDetails(this.gridOptions,Vf,null,t,!0)}getFullWidthLoadingCellRendererDetails(t){return this.getCompDetails(this.gridOptions,Hf,"agLoadingCellRenderer",t,!0)}getFullWidthGroupCellRendererDetails(t){return this.getCompDetails(this.gridOptions,kf,"agGroupRowRenderer",t,!0)}getFullWidthDetailCellRendererDetails(t){return this.getCompDetails(this.gridOptions,Bf,"agDetailCellRenderer",t,!0)}getInnerRendererDetails(t,e){return this.getCompDetails(t,ad,null,e)}getFullWidthGroupRowInnerCellRenderer(t,e){return this.getCompDetails(t,ad,null,e)}getCellRendererDetails(t,e){return this.getCompDetails(t,nd,null,e)}getLoadingCellRendererDetails(t,e){return this.getCompDetails(t,Lf,"agSkeletonCellRenderer",e,!0)}getCellEditorDetails(t,e){return this.getCompDetails(t,Mf,"agCellEditor",e,!0)}getFilterDetails(t,e,s){return this.getCompDetails(t,fa,s,e,!0)}getDateCompDetails(t){return this.getCompDetails(this.gridOptions,Af,"agDateInput",t,!0)}getLoadingOverlayCompDetails(t){return this.getCompDetails(this.gridOptions,If,"agLoadingOverlay",t,!0)}getNoRowsOverlayCompDetails(t){return this.getCompDetails(this.gridOptions,Nf,"agNoRowsOverlay",t,!0)}getTooltipCompDetails(t){return this.getCompDetails(t.colDef,xf,"agTooltipComponent",t,!0)}getSetFilterCellRendererDetails(t,e){return this.getCompDetails(t,nd,null,e)}getFloatingFilterCompDetails(t,e,s){return this.getCompDetails(t,Gf,s,e)}getToolPanelCompDetails(t,e){return this.getCompDetails(t,Of,null,e,!0)}getStatusPanelCompDetails(t,e){return this.getCompDetails(t,_f,null,e,!0)}getMenuItemCompDetails(t,e){return this.getCompDetails(t,Wf,"agMenuItem",e,!0)}getCompDetails(t,e,s,i,o=!1){const{propertyName:r,cellRenderer:n}=e;let{compName:a,jsComp:l,fwComp:d,paramsFromSelector:c,popupFromSelector:h,popupPositionFromSelector:m}=this.getCompKeys(t,e,i);const C=R=>{const y=this.userComponentRegistry.retrieve(r,R);y&&(l=y.componentFromFramework?void 0:y.component,d=y.componentFromFramework?y.component:void 0)};if(a!=null&&C(a),l==null&&d==null&&s!=null&&C(s),l&&n&&!this.agComponentUtils.doesImplementIComponent(l)&&(l=this.agComponentUtils.adaptFunction(r,l)),!l&&!d){o&&console.error(`AG Grid: Could not find component ${a}, did you forget to configure this component?`);return}const v=this.mergeParamsWithApplicationProvidedParams(t,e,i,c),S=l==null,w=l||d;return{componentFromFramework:S,componentClass:w,params:v,type:e,popupFromSelector:h,popupPositionFromSelector:m,newAgStackInstance:()=>this.newAgStackInstance(w,S,v,e)}}getCompKeys(t,e,s){const{propertyName:i}=e;let o,r,n,a,l,d;if(t){const c=t,h=c[i+"Selector"],m=h?h(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),a=m.params,l=m.popup,d=m.popupPosition):C(c[i])}return{compName:o,jsComp:r,fwComp:n,paramsFromSelector:a,popupFromSelector:l,popupPositionFromSelector:d}}newAgStackInstance(t,e,s,i){const o=i.propertyName,r=!e;let n;if(r)n=new t;else{const l=this.componentMetadataProvider.retrieve(o);n=this.frameworkComponentWrapper.wrap(t,l.mandatoryMethodList,l.optionalMethodList,i)}const a=this.initComponent(n,s);return a==null?Ne.resolve(n):a.then(()=>n)}mergeParamsWithApplicationProvidedParams(t,e,s,i=null){const o=this.gos.getGridCommonParams();dt(o,s);const r=t,n=r&&r[e.propertyName+"Params"];if(typeof n=="function"){const a=n(s);dt(o,a)}else typeof n=="object"&&dt(o,n);return dt(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,fa);return i?s=Xc.getFloatingFilterType(i):o==null&&r==null&&t.filter===!0&&(s=e()),s}};u([f("gridOptions")],ws.prototype,"gridOptions",2);u([f("agComponentUtils")],ws.prototype,"agComponentUtils",2);u([f("componentMetadataProvider")],ws.prototype,"componentMetadataProvider",2);u([f("userComponentRegistry")],ws.prototype,"userComponentRegistry",2);u([de("frameworkComponentWrapper")],ws.prototype,"frameworkComponentWrapper",2);ws=u([G("userComponentFactory")],ws);var Jc=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)}},yt=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 Jc({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()?Y.ICON_NOT_ALLOWED:Y.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 a=this.clientSideRowModel.getRowIndexAtPixel(i)+1;this.clientSideRowModel.getHighlightPosition(i)===0&&a--,this.clientSideRowModel.updateRowData({add:o.map(l=>l.data).filter(l=>!this.clientSideRowModel.getRowNode(n?n({data:l,level:0}):l.id)),addIndex:a})}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(O({isInterestedIn:s=>s===2,getIconName:()=>Y.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")],yt.prototype,"dragAndDropService",2);u([f("rowModel")],yt.prototype,"rowModel",2);u([f("paginationProxy")],yt.prototype,"paginationProxy",2);u([f("columnModel")],yt.prototype,"columnModel",2);u([f("focusService")],yt.prototype,"focusService",2);u([f("sortController")],yt.prototype,"sortController",2);u([f("filterManager")],yt.prototype,"filterManager",2);u([f("selectionService")],yt.prototype,"selectionService",2);u([f("mouseEventService")],yt.prototype,"mouseEventService",2);u([f("ctrlsService")],yt.prototype,"ctrlsService",2);u([de("rangeService")],yt.prototype,"rangeService",2);u([M],yt.prototype,"postConstruct",1);var Mo=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),lt(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=a=>{Ja(a.target)||(a.cancelable&&(a.preventDefault(),o&&a.stopPropagation()),this.onTouchStart(t,a))},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=l=>this.onTouchMove(l,t.eElement),o=l=>this.onTouchUp(l,t.eElement),r=l=>{l.cancelable&&l.preventDefault()},n=e.target,a=[{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(a),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=l=>this.onMouseMove(l,t.eElement),o=l=>this.onMouseUp(l,t.eElement),r=l=>l.preventDefault(),n=this.gos.getRootNode(),a=[{target:n,type:"mousemove",listener:i},{target:n,type:"mouseup",listener:o},{target:n,type:"contextmenu",listener:r}];this.addTemporaryEvents(a),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 al(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;Xt()&&((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")],Mo.prototype,"mouseEventService",2);u([it],Mo.prototype,"removeAllListeners",1);Mo=u([G("dragService")],Mo);var Wn="ag-list-item-hovered",Zc=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?Y.ICON_PINNED:Y.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 Jc({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,ca(i,Wn),ca(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,a=Math.min(n,r)|0;return{rowIndex:a,position:Math.round(r)>r||r>n?"bottom":"top",component:this.virtualList.getComponentAt(a)}}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(`.${Wn}`).forEach(e=>{[Wn,"ag-item-highlight-top","ag-item-highlight-bottom"].forEach(s=>{e.classList.remove(s)})}),this.lastHoveredListItem=null}};u([f("dragAndDropService")],Zc.prototype,"dragAndDropService",2);u([M],Zc.prototype,"postConstruct",1);function Hs(t){const e=t;return e!=null&&e.getFrameworkComponentInstance!=null?e.getFrameworkComponentInstance():t}var X=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;Ye(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(U(this.clientSideRowModel)){this.logMissingRowModel("onGroupExpandedOrCollapsed","clientSide");return}this.expansionService.onGroupExpandedOrCollapsed()}refreshClientSideRowModel(t){if(U(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 U(this.serverSideRowModel)?(this.logMissingRowModel("getServerSideSelectionState","serverSide"),null):this.selectionService.getSelectionState()}setServerSideSelectionState(t){if(U(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(U(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(U(this.clientSideRowModel)){this.logMissingRowModel("forEachLeafNode","clientSide");return}this.clientSideRowModel.forEachLeafNode(t)}forEachNode(t,e){this.rowModel.forEachNode(t,e)}forEachNodeAfterFilter(t){if(U(this.clientSideRowModel)){this.logMissingRowModel("forEachNodeAfterFilter","clientSide");return}this.clientSideRowModel.forEachNodeAfterFilter(t)}forEachNodeAfterFilterAndSort(t){if(U(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 Hs(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 Hs(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(U(r))return null;const n=this.valueService.getValue(r,i);if(o){const a=this.valueService.formatValue(r,i,n);return a??Ie(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={},Qd(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:a}=this.menuService.getContextMenuPosition(e,s);o!=null&&(n=o),r!=null&&(a=r),this.menuService.showContextMenu({mouseEvent:new MouseEvent("mousedown",{clientX:n,clientY:a}),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(Hs)}getCellEditorInstances(t={}){return this.rowRenderer.getCellEditorInstances(t).map(Hs)}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")],X.prototype,"rowRenderer",2);u([f("navigationService")],X.prototype,"navigationService",2);u([f("filterManager")],X.prototype,"filterManager",2);u([f("columnModel")],X.prototype,"columnModel",2);u([f("selectionService")],X.prototype,"selectionService",2);u([f("gridOptionsService")],X.prototype,"gos",2);u([f("valueService")],X.prototype,"valueService",2);u([f("alignedGridsService")],X.prototype,"alignedGridsService",2);u([f("eventService")],X.prototype,"eventService",2);u([f("pinnedRowModel")],X.prototype,"pinnedRowModel",2);u([f("context")],X.prototype,"context",2);u([f("rowModel")],X.prototype,"rowModel",2);u([f("sortController")],X.prototype,"sortController",2);u([f("paginationProxy")],X.prototype,"paginationProxy",2);u([f("focusService")],X.prototype,"focusService",2);u([f("dragAndDropService")],X.prototype,"dragAndDropService",2);u([f("menuService")],X.prototype,"menuService",2);u([f("valueCache")],X.prototype,"valueCache",2);u([f("animationFrameService")],X.prototype,"animationFrameService",2);u([f("ctrlsService")],X.prototype,"ctrlsService",2);u([f("overlayService")],X.prototype,"overlayService",2);u([f("stateService")],X.prototype,"stateService",2);u([f("expansionService")],X.prototype,"expansionService",2);u([f("apiEventService")],X.prototype,"apiEventService",2);u([f("frameworkOverrides")],X.prototype,"frameworkOverrides",2);u([f("undoRedoService")],X.prototype,"undoRedoService",2);u([f("rowNodeBlockLoader")],X.prototype,"rowNodeBlockLoader",2);u([de("csvCreator")],X.prototype,"csvCreator",2);u([de("excelCreator")],X.prototype,"excelCreator",2);u([de("rangeService")],X.prototype,"rangeService",2);u([de("clipboardService")],X.prototype,"clipboardService",2);u([de("aggFuncService")],X.prototype,"aggFuncService",2);u([de("statusBarService")],X.prototype,"statusBarService",2);u([de("chartService")],X.prototype,"chartService",2);u([de("ssrmTransactionManager")],X.prototype,"serverSideTransactionManager",2);u([de("sideBarService")],X.prototype,"sideBarService",2);u([M],X.prototype,"init",1);X=u([G("gridApi")],X);var ht=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:ht.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:ht.EVENT_QUICK_FILTER_CHANGED}))}onQuickFilterColumnConfigChanged(){this.columnModel.refreshQuickFilterColumns(),this.resetQuickFilterCache(),this.isQuickFilterPresent()&&this.dispatchEvent({type:ht.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(ht.QUICK_FILTER_SEPARATOR)}};ht.EVENT_QUICK_FILTER_CHANGED="quickFilterChanged";ht.QUICK_FILTER_SEPARATOR=`
172
+ `;u([f("valueService")],ht.prototype,"valueService",2);u([f("columnModel")],ht.prototype,"columnModel",2);u([f("rowModel")],ht.prototype,"rowModel",2);u([M],ht.prototype,"postConstruct",1);ht=u([G("quickFilterService")],ht);var Ft=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,ht.EVENT_QUICK_FILTER_CHANGED,()=>this.onFilterChanged({source:"quickFilter"})),this.initialFilterModel=O({},(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=ll(Object.keys(t));this.allColumnFilters.forEach((r,n)=>{const a=t[n];s.push(this.setModelOnFilterWrapper(r.filterPromise,a)),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 a=this.getOrCreateFilterWrapper(n,"NO_UI");if(!a){console.warn("AG-Grid: setFilterModel() - unable to fully apply model, unable to create filter for colId: "+r);return}s.push(this.setModelOnFilterWrapper(a.filterPromise,t[r]))})}else this.allColumnFilters.forEach(o=>{s.push(this.setModelOnFilterWrapper(o.filterPromise,null))});Ne.all(s).then(()=>{const o=this.getFilterModel(),r=[];this.allColumnFilters.forEach((n,a)=>{const l=i?i[a]:null,d=o?o[a]:null;W.jsonEquals(l,d)||r.push(n.column)}),r.length>0&&this.onFilterChanged({columns:r,source:e})})}setModelOnFilterWrapper(t,e){return new Ne(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)||Ne.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 a=0;a<r.length;a++){const l=r[a];if(!(l==null||l===e)){if(typeof l.doesFilterPass!="function")throw new Error("Filter is missing method doesFilterPass");if(!l.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(a=>{a&&a!==s&&a.onAnyFilterChanged&&a.onAnyFilterChanged()})});const r={source:e,type:p.EVENT_FILTER_CHANGED,columns:o||[]};i&&dt(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(O({},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(a=>i=a),n},compDetails:r}:{filterPromise:null,compDetails:null}}createFilterParams(t,e){return this.gos.addGridCommonParams({column:t,colDef:Na(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=l=>{const d=this.getFilterComponent(t,"NO_UI");d!=null&&d.then(c=>{l(Hs(c))})},i=t.getColDef(),o=Ee(O({},this.createFilterParams(t,i)),{filterChangedCallback:()=>s(l=>this.filterChangedCallbackFactory(l,t)())}),r=this.userComponentFactory.mergeParamsWithApplicationProvidedParams(i,fa,o);let n=this.userComponentFactory.getDefaultFloatingFilterType(i,()=>this.getDefaultFloatingFilter(t));n==null&&(n="agReadOnlyFloatingFilter");const a={column:t,filterParams:r,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(t),parentFilterInstance:s,showParentFilter:e,suppressFilterButton:!1};return this.userComponentFactory.getFloatingFilterCompDetails(i,a,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(O(Ee(O({},this.createFilterParams(s,s.getColDef())),{filterModifiedCallback:this.filterModifiedCallbackFactory(r,s),filterChangedCallback:this.filterChangedCallbackFactory(r,s),doesRowPassOtherFilter:a=>this.doesRowPassOtherFilters(r,a)}),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,ge.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=Hs(o);e(r)});return Hs(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(a=>{r=a});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(a=>n(a))}))(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")],Ft.prototype,"valueService",2);u([f("columnModel")],Ft.prototype,"columnModel",2);u([f("rowModel")],Ft.prototype,"rowModel",2);u([f("userComponentFactory")],Ft.prototype,"userComponentFactory",2);u([f("rowRenderer")],Ft.prototype,"rowRenderer",2);u([f("dataTypeService")],Ft.prototype,"dataTypeService",2);u([f("quickFilterService")],Ft.prototype,"quickFilterService",2);u([de("advancedFilterService")],Ft.prototype,"advancedFilterService",2);u([M],Ft.prototype,"init",1);Ft=u([G("filterManager")],Ft);var Cn=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:Ne.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)&&(Fe(this.getGui()),this.createFilter())}destroy(){this.filterWrapper=null,super.destroy()}};u([f("filterManager")],Cn.prototype,"filterManager",2);u([f("columnModel")],Cn.prototype,"columnModel",2);u([M],Cn.prototype,"postConstruct",1);var Sl=class extends K{constructor(t,e){super(t),this.ctrl=e}getCtrl(){return this.ctrl}},ci=class eh extends Sl{constructor(e){super(eh.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=>Z(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()}}};ci.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([N("eFloatingFilterBody")],ci.prototype,"eFloatingFilterBody",2);u([N("eButtonWrapper")],ci.prototype,"eButtonWrapper",2);u([N("eButtonShowMainFilter")],ci.prototype,"eButtonShowMainFilter",2);u([M],ci.prototype,"postConstruct",1);u([it],ci.prototype,"destroyFloatingFilterComp",1);var Uf=ci,vn=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],vn.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=Ze(()=>this.lastScrollSource[1]=null,500),this.resetLastVScrollDebounced=Ze(()=>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?Ze(this.onVScroll.bind(this),100):this.onVScroll.bind(this),o=s?Ze(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:a,fakeHScrollComp:l}=this.ctrlsService.getParams();n.setHorizontalScroll(-s),a.setContainerTranslateX(s),i.setContainerTranslateX(s),o.setContainerTranslateX(s),r.setContainerTranslateX(s);const d=this.centerRowsCtrl.getViewportElement(),c=this.lastScrollSource[1]===0;t=Math.abs(t),c?l.setScrollPosition(t):Fo(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=Po(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(O({},e),{type:p.EVENT_BODY_SCROLL_END});this.eventService.dispatchEvent(s)},100)}shouldBlockScrollUpdate(t,e,s=!1){return s&&!ds()?!1:t===0?this.shouldBlockVerticalScroll(e):this.shouldBlockHorizontalScroll(e)}shouldBlockVerticalScroll(t){const e=Qo(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&&Ao()){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&&Ao()?t=t>0?0:i:t=Math.min(Math.max(t,0),i)),Fo(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(),a=r.getStickyBottomHeight(),l=this.paginationProxy.getRow(t);let d;do{const c=l.rowTop,h=l.rowHeight,m=this.paginationProxy.getPixelOffset(),C=l.rowTop-m,v=C+l.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,x=y-a<v;let I=null;e==="top"?I=T:e==="bottom"?I=D:e==="middle"?I=A:F?I=T-n:x&&(I=D+a),I!==null&&(this.setVerticalScrollPosition(I),this.rowRenderer.redraw({afterScroll:!0})),d=c!==l.rowTop||h!==l.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 a=(n?s:i)||o,l=n?i:s;e!=="auto"&&(a=e==="start",l=e==="end");const d=e==="middle";if(a||l||d){const{colLeft:c,colMiddle:h,colRight:m}=this.getColumnBounds(t);return d?h-r/2:a?n?m:c:n?c-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,a=r?s<i:e>i;return{columnBeforeStart:n,columnAfterEnd:a}}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,a=n+i*r,l=n+i/2*r;return{colLeft:n,colMiddle:l,colRight:a}}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 th="ag-force-vertical-scroll",zf="ag-selectable",Kf="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",a=>this.setCellTextSelection(a.currentValue)),this.createManagedBean(new vn(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=Bs(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=Bs(o,"ag-root",e);Bs(i,"ag-root",e)||(!r||n)&&e.classList.remove("ag-has-focus")})})}setColumnMovingCss(t){this.comp.setColumnMovingCss(Kf,t)}setCellTextSelection(t=!1){this.comp.setCellSelectableCss(zf,t)}onScrollVisibilityChanged(){const t=this.scrollVisibleService.isVerticalScrollShowing();this.setVerticalScrollPaddingVisible(t),this.setStickyWidth(t),this.setStickyBottomOffsetBottom();const e=t&&this.gos.getScrollbarWidth()||0,s=qa()?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(Nr(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?th:null,s=this.gos.isDomLayout("normal");return this.comp.setAlwaysVerticalScrollClass(e,t),t||s&&Xu(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(!ds())return;const e=new We(this.eBodyViewport),s=i=>{t(void 0,i.touchStart,i.touchEvent)};this.addManagedListener(e,We.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 yt(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=ri(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 uo="ag-cell-range-selected",$f="ag-cell-range-chart",Yf="ag-cell-range-single-cell",jf="ag-cell-range-chart-category",qf="ag-cell-range-handle",Qf="ag-cell-range-top",Xf="ag-cell-range-right",Jf="ag-cell-range-bottom",Zf="ag-cell-range-left",em=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(uo,this.rangeCount!==0),this.cellComp.addOrRemoveCssClass(`${uo}-1`,this.rangeCount===1),this.cellComp.addOrRemoveCssClass(`${uo}-2`,this.rangeCount===2),this.cellComp.addOrRemoveCssClass(`${uo}-3`,this.rangeCount===3),this.cellComp.addOrRemoveCssClass(`${uo}-4`,this.rangeCount>=4),this.cellComp.addOrRemoveCssClass($f,this.hasChartRange),Mi(this.eGui,this.rangeCount>0?!0:void 0),this.cellComp.addOrRemoveCssClass(Yf,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(Qf,s),this.cellComp.addOrRemoveCssClass(Xf,i),this.cellComp.addOrRemoveCssClass(Jf,o),this.cellComp.addOrRemoveCssClass(Zf,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 a,l;t?(a=n.getDisplayedColAfter(r),l=n.getDisplayedColBefore(r)):(a=n.getDisplayedColBefore(r),l=n.getDisplayedColAfter(r));const d=this.rangeService.getCellRanges().filter(c=>this.rangeService.isCellInSpecificRange(this.cellCtrl.getCellPosition(),c));a||(o=!0),l||(s=!0);for(let c=0;c<d.length&&!(e&&s&&i&&o);c++){const h=d[c],m=this.rangeService.getRangeStartRow(h),C=this.rangeService.getRangeEndRow(h);!e&&this.beans.rowPositionUtils.sameRow(m,this.cellCtrl.getCellPosition())&&(e=!0),!i&&this.beans.rowPositionUtils.sameRow(C,this.cellCtrl.getCellPosition())&&(i=!0),!o&&a&&h.columns.indexOf(a)<0&&(o=!0),!s&&l&&h.columns.indexOf(l)<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(qf,!!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 a=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(jf,d),a=i.type===0}return a&&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")&&U(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)}},tm=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||U(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()}},sm=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([de("rangeService")],q.prototype,"rangeService",2);u([de("selectionHandleFactory")],q.prototype,"selectionHandleFactory",2);u([M],q.prototype,"postConstruct",1);q=u([G("beans")],q);var im=class extends q{constructor(t,e,s){super(),this.cellCtrl=t,this.beans=e,this.column=s}onMouseEvent(t,e){if(!Ht(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(!ds()||_a("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:a,rangeService:l,focusService:d}=n;if(this.isRightClickInExistingRange(t))return;const c=l&&l.getCellRanges().length!=0;if(!i||!c){const h=Xt()&&!r.isEditing()&&!Ja(o);r.focusCell(h)}if(i&&c&&!d.isCellFocused(r.getCellPosition())){t.preventDefault();const h=d.getFocusedCell();if(h){const{column:m,rowIndex:C,rowPinned:v}=h,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(l){const h=this.cellCtrl.getCellPosition();if(i)l.extendLatestRangeToCell(h);else{const m=e||s;l.setRangeToCell(h,m)}}a.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 Bs(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(){}},om=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:a,eventService:l}=o;if(!i.isEditing()){if(l.dispatchEvent({type:p.EVENT_KEY_SHORTCUT_CHANGED_CELL_START}),ac(t,n.get("enableCellEditingOnBackspace"))){if(a&&n.get("enableRangeSelection"))a.clearCellRangeCellValues({dispatchWrapperEvents:!0,wrapperEventSource:"deleteKey"});else if(i.isCellEditable()){const d=i.getColumn(),c=(s=this.beans.valueService.parseValue(d,r,"",r.getValueFromValueService(d)))!=null?s:null;r.setDataValue(d,c,"cellClear")}}else i.startRowOrCellEdit(t,e);l.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()}},sh=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],sh.prototype,"postConstruct",1);var rm="ag-column-first",nm="ag-column-last",wn=class{static getHeaderClassesFromColDef(t,e,s,i){return U(t)?[]:this.getColumnClassesFromCollDef(t.headerClass,t,e,s,i)}static getToolPanelClassesFromColDef(t,e,s,i){return U(t)?[]:this.getColumnClassesFromCollDef(t.toolPanelClass,t,e,s,i)}static refreshFirstAndLastStyles(t,e,s){t.addOrRemoveCssClass(rm,s.isColumnAtEdge(e,"first")),t.addOrRemoveCssClass(nm,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(U(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]:[]}},am="ag-cell",lm="ag-cell-auto-height",dm="ag-cell-normal-height",um="ag-cell-focus",cm="ag-cell-first-right-pinned",hm="ag-cell-last-left-pinned",pm="ag-cell-not-inline-editing",gm="ag-column-hover",fm="ag-cell-wrap-text",mm=0,ih=class ma 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()+"-"+mm++,this.colIdSanitised=Ie(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 tm(this,this.beans),this.addDestroyFunc(()=>{var s;(s=this.cellPositionFeature)==null||s.destroy(),this.cellPositionFeature=null}),this.cellCustomStyleFeature=new sm(this,this.beans),this.addDestroyFunc(()=>{var s;(s=this.cellCustomStyleFeature)==null||s.destroy(),this.cellCustomStyleFeature=null}),this.cellMouseListenerFeature=new im(this,this.beans,this.column),this.addDestroyFunc(()=>{var s;(s=this.cellMouseListenerFeature)==null||s.destroy(),this.cellMouseListenerFeature=null}),this.cellKeyboardListenerFeature=new om(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 em(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(),a=this.rowNode.data;if(n.tooltipField&&P(a))return Ti(a,n.tooltipField,this.column.isTooltipFieldContainsDots());const l=n.tooltipValueGetter;return l?l(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(),a=n.children.length===0?n:n.querySelector(".ag-cell-value");return a?a.scrollWidth>a.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 us(r,this.beans)}disableTooltipFeature(){this.tooltipFeature&&(this.tooltipFeature.destroy(),this.tooltipFeature=null)}setComp(e,s,i,o,r){var n,a,l,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),(a=this.cellCustomStyleFeature)==null||a.setComp(e),(l=this.tooltipFeature)==null||l.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(c=>c()),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=a=>{if(this.editing||!this.isAlive())return;const{paddingTop:l,paddingBottom:d,borderBottomWidth:c,borderTopWidth:h}=bs(s),m=l+d+c+h,v=e.offsetHeight+m;if(a<5){const w=this.beans.gos.getDocument(),R=!w||!w.contains(e),y=v==0;if(R||y){window.setTimeout(()=>o(a+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 a=(n==null?void 0:n.popupFromSelector)!=null?n.popupFromSelector:!!r.cellEditorPopup,l=(n==null?void 0:n.popupPositionFromSelector)!=null?n.popupPositionFromSelector:r.cellEditorPopupPosition;this.setEditing(!0),this.cellComp.setEditDetails(n,a,l,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(O({},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(),a=e!=null&&!!e.newData,l=e!=null&&!!e.suppressFlash||!!n.suppressCellFlash,d=n.field==null&&n.valueGetter==null&&n.showRowGroup==null,c=e&&e.forceRefresh||d||a,h=!!this.cellComp,m=this.updateAndFormatValue(h),C=c||m;if(h){if(C){this.showValue(a);const v=this.beans.filterManager.isSuppressFlashingCellsBecauseFiltering();!l&&!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,ma.DOM_DATA_KEY_CELL_CTRL,this),this.addDestroyFunc(()=>this.beans.gos.setDomData(e,ma.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;wn.refreshFirstAndLastStyles(e,s,i.columnModel)}refreshAriaColIndex(){const e=this.beans.columnModel.getAriaColumnIndex(this.column);Ua(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(cm,e)}onLastLeftPinnedChanged(){if(!this.cellComp)return;const e=this.column.isLastLeftPinned();this.cellComp.addOrRemoveCssClass(hm,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(um,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:qt(this.rowNode.rowPinned),column:this.column}}applyStaticCssClasses(){this.cellComp.addOrRemoveCssClass(am,!0),this.cellComp.addOrRemoveCssClass(pm,!0);const e=this.column.isAutoHeight()==!0;this.cellComp.addOrRemoveCssClass(lm,e),this.cellComp.addOrRemoveCssClass(dm,!e)}onColumnHover(){if(!this.cellComp||!this.beans.gos.get("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.cellComp.addOrRemoveCssClass(gm,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(),a=this.beans.userComponentFactory.getCellEditorDetails(n,r);s.refresh(a.params)}}}setWrapText(){const e=this.column.getColDef().wrapText==!0;this.cellComp.addOrRemoveCssClass(fm,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 fn;return this.beans.context.createBean(e),e.init({rowNode:this.rowNode,column:this.column}),e}createDndSource(){const e=new sh(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 a=new qs(()=>this.value,this.rowNode,this.column,e,s,i);return this.beans.context.createBean(a),a}};ih.DOM_DATA_KEY_CELL_CTRL="cellCtrl";var Us=ih,Cm=0,oh=class Ca 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+"-"+Cm++,this.rowId=Ie(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=Ie(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&&ns(e.element,this.rowNode.expanded==!0),this.setRowCompRowId(i),this.setRowCompRowBusinessKey(i),s.setDomData(e.element,Ca.DOM_DATA_KEY_ROW_CTRL,this),this.addDestroyFunc(()=>s.setDomData(e.element,Ca.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=Ie(this.rowNode.id),this.rowId!=null&&e.setRowId(this.rowId)}executeSlideAndFadeAnimations(e){const{containerType:s}=e;this.slideInAnimation[s]&&(sa(()=>{this.onTopChanged()}),this.slideInAnimation[s]=!1),this.fadeInAnimation[s]&&(sa(()=>{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 qs(()=>`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,a)=>{o.list.push(a),o.map[n]=a};return s.forEach(n=>{const a=n.getInstanceId();let l=e.map[a];l||(l=new Us(n,this.rowNode,this.beans,this)),r(a,l)}),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(),a=this.beans.focusService.isCellFocused(e.getCellPosition());if(n||a){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=(a,l)=>a?a.rowComp.refreshFullWidth(()=>this.createFullWidthCompDetails(a.element,l).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,Q.EVENT_HEIGHT_CHANGED,()=>this.onRowHeightChanged()),this.addManagedListener(this.rowNode,Q.EVENT_ROW_SELECTED,()=>this.onRowSelected()),this.addManagedListener(this.rowNode,Q.EVENT_ROW_INDEX_CHANGED,this.onRowIndexChanged.bind(this)),this.addManagedListener(this.rowNode,Q.EVENT_TOP_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(this.rowNode,Q.EVENT_EXPANDED_CHANGED,this.updateExpandedCss.bind(this)),this.addManagedListener(this.rowNode,Q.EVENT_HAS_CHILDREN_CHANGED,this.updateExpandedCss.bind(this)),this.rowNode.detail&&this.addManagedListener(this.rowNode.parent,Q.EVENT_DATA_CHANGED,this.onRowNodeDataChanged.bind(this)),this.addManagedListener(this.rowNode,Q.EVENT_DATA_CHANGED,this.onRowNodeDataChanged.bind(this)),this.addManagedListener(this.rowNode,Q.EVENT_CELL_CHANGED,this.postProcessCss.bind(this)),this.addManagedListener(this.rowNode,Q.EVENT_HIGHLIGHT_CHANGED,this.onRowNodeHighlightChanged.bind(this)),this.addManagedListener(this.rowNode,Q.EVENT_DRAGGING_CHANGED,this.postProcessRowDragging.bind(this)),this.addManagedListener(this.rowNode,Q.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,Q.EVENT_ROW_INDEX_CHANGED,()=>{this.getAllCellCtrls().forEach(e=>e.onRowIndexChanged())}),this.addManagedListener(this.rowNode,Q.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),ns(i.element,e&&s)})}onDisplayedColumnsChanged(){this.updateColumnLists(!0),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights()}onVirtualColumnsChanged(){this.updateColumnLists(!1,!0)}getRowPosition(){return{rowPinned:qt(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}}onKeyboardNavigate(e){const s=this.allRowGuis.find(l=>l.element.contains(e.target));if(!((s?s.element:null)===e.target))return;const r=this.rowNode,n=this.beans.focusService.getFocusedCell(),a={rowIndex:r.rowIndex,rowPinned:r.rowPinned,column:n&&n.column};this.beans.navigationService.navigateToNextCell(e,e.key,a,!0),e.preventDefault()}onTabKeyDown(e){if(e.defaultPrevented||Ht(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=>pt(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(Ht(e))return;const s=this.createRowEventWithSource(p.EVENT_ROW_DOUBLE_CLICKED,e);this.beans.eventService.dispatchEvent(s)}onRowMouseDown(e){if(this.lastMouseDownOnDragger=Bs(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(Ht(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 a=this.gos.get("rowMultiSelectWithClick"),l=!this.gos.get("suppressRowDeselection"),d="rowClicked";if(this.rowNode.isSelected())a?this.rowNode.setSelectedParams({newValue:!1,event:e,source:d}):o?l&&this.rowNode.setSelectedParams({newValue:!1,event:e,source:d}):this.rowNode.setSelectedParams({newValue:!0,clearSelection:!r,rangeSelect:r,event:e,source:d});else{const c=a?!1:!o;this.rowNode.setSelectedParams({newValue:!0,clearSelection:c,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,a)=>this.addFullWidthRowDragging(o,r,n,a),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 us(i,this.beans))}addFullWidthRowDragging(e,s,i="",o){if(!this.isFullWidth())return;const r=new qs(()=>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 a=n===s;return a?n.startEditing(e,a,i):n.startEditing(null,a,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),Mi(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,Q.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,Q.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,a=>{a.element.style.height=`${s}px`,n&&a.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),Wa(n.element,r)})}};oh.DOM_DATA_KEY_ROW_CTRL="renderedRow";var zs=oh,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",_a("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)||Ht(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(!ds())return;const t=new We(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,We.EVENT_LONG_TAP,e),this.addDestroyFunc(()=>t.destroy())}getRowForEvent(t){let e=t.target;for(;e;){const s=this.gos.getDomData(e,zs.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 a=this.ctrlsService.getGridBodyCtrl(),l=i?i.getGui():a.getGridBodyElement();this.menuService.showContextMenu({mouseEvent:t,touchEvent:e,rowNode:o,column:r,value:n,anchorToElement:l})}getControlsForEventTarget(t){return{cellCtrl:Lr(this.gos,t,Us.DOM_DATA_KEY_CELL_CTRL),rowCtrl:Lr(this.gos,t,zs.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(!xr(this.gos,s,i,o,r)&&e==="keydown"&&(!r&&this.navigationService.handlePageScrollingKey(s)||t.onKeyDown(s),this.doGridOperations(s,t.isEditing()),an(s)&&t.processCharacter(s)),e==="keydown"){const a=t.createEvent(s,p.EVENT_CELL_KEY_DOWN);this.eventService.dispatchEvent(a)}}processFullWidthRowKeyboardEvent(t,e,s){const i=t.getRowNode(),o=this.focusService.getFocusedCell(),r=o&&o.column;if(!xr(this.gos,s,i,r,!1)){const a=s.key;if(e==="keydown")switch(a){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 a=t.createRowEvent(p.EVENT_CELL_KEY_DOWN,s);this.eventService.dispatchEvent(a)}}doGridOperations(t,e){if(!t.ctrlKey&&!t.metaKey||e||!this.mouseEventService.isEventFromThisGrid(t))return;const s=nc(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 a,l;r?(a=null,l=this.paginationProxy.getRowCount()-1):(a="bottom",l=e.getPinnedBottomRowData().length-1);const d=this.columnModel.getAllDisplayedColumns();if(bt(d))return;i.setCellRange({rowStartIndex:0,rowStartPinned:n,rowEndIndex:l,rowEndPinned:a,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([de("rangeService")],gt.prototype,"rangeService",2);u([de("clipboardService")],gt.prototype,"clipboardService",2);u([M],gt.prototype,"postConstruct",1);var $i=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=ri(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,a=0,l=0;const d=[];let c=i-l-t;for(;(a<o.length||n<r.length)&&c>0;){if(n<r.length){const h=r[n++];c-=h.getActualWidth(),d.push(h)}if(a<o.length&&c>0){const h=o[a++];c-=h.getActualWidth(),d.push(h)}}return d}checkViewportAndScrolls(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.getScrollFeature().checkScrollLeft()}getBodyHeight(){return this.bodyHeight}checkBodyHeight(){const t=this.gridBodyCtrl.getBodyViewportElement(),e=Qo(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")],$i.prototype,"ctrlsService",2);u([f("pinnedWidthService")],$i.prototype,"pinnedWidthService",2);u([f("columnModel")],$i.prototype,"columnModel",2);u([f("scrollVisibleService")],$i.prototype,"scrollVisibleService",2);u([M],$i.prototype,"postConstruct",1);var El=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;Z(this.element,e),Pt(this.element,t)}getWidth(){return this.pinnedWidthService.getPinnedLeftWidth()}};u([f("pinnedWidthService")],El.prototype,"pinnedWidthService",2);u([M],El.prototype,"postConstruct",1);var yl=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;Z(this.element,e),Pt(this.element,t)}getWidth(){return this.pinnedWidthService.getPinnedRightWidth()}};u([f("pinnedWidthService")],yl.prototype,"pinnedWidthService",2);u([M],yl.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 En=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")],En.prototype,"dragService",2);u([de("rangeService")],En.prototype,"rangeService",2);u([M],En.prototype,"postConstruct",1);var Yi=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")],Yi.prototype,"columnModel",2);u([f("scrollVisibleService")],Yi.prototype,"scrollVisibleService",2);u([M],Yi.prototype,"postConstruct",1);var Se=(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))(Se||{});function rh(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 vm=ms([["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"]]),wm=ms([["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"]]),hi=class nh 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=vm.get(e),i=wm.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 $i(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"],a=["bottomCenter","bottomLeft","bottomRight"],l=["center","left","right"],d=[...o,...a,...l,...r,...n],c=["center","left","right","fullWidth"],h=["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 El(this.eContainer)),this.addManagedListener(this.eventService,p.EVENT_LEFT_PINNED_WIDTH_CHANGED,()=>this.onPinnedWidthChanged())}),this.forContainers(C,()=>{this.pinnedWidthFeature=this.createManagedBean(new yl(this.eContainer)),this.addManagedListener(this.eventService,p.EVENT_RIGHT_PINNED_WIDTH_CHANGED,()=>this.onPinnedWidthChanged())}),this.forContainers(c,()=>this.createManagedBean(new Sn(this.eContainer,this.name==="center"?i:void 0))),this.forContainers(d,()=>this.createManagedBean(new En(this.eContainer))),this.forContainers(h,()=>this.createManagedBean(new Yi(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 ri(this.eViewport)}getCenterViewportScrollLeft(){return Po(this.eViewport,this.enableRtl)}registerViewportResizeListener(e){const s=this.resizeObserverService.observeResize(this.eViewport,e);this.addDestroyFunc(()=>s())}isViewportInTheDOMTree(){return tl(this.eViewport)}getViewportScrollLeft(){return Po(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){return this.gos.get("alwaysShowHorizontalScroll")||Qu(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){Fo(this.eViewport,e,this.enableRtl)}isContainerVisible(){return!nh.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(a=>{const l=a.isFullWidth();return this.isFullWithContainer?!r&&l:r||!l});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")],hi.prototype,"dragService",2);u([f("ctrlsService")],hi.prototype,"ctrlsService",2);u([f("columnModel")],hi.prototype,"columnModel",2);u([f("resizeObserverService")],hi.prototype,"resizeObserverService",2);u([f("rowRenderer")],hi.prototype,"rowRenderer",2);u([M],hi.prototype,"postConstruct",1);var _r=hi,Sm=`<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>`,Wt=class extends K{constructor(){super(Sm)}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=>Nu(this.getGui(),i),setRowCount:i=>Iu(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(th,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")&&Mu(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")],Wt.prototype,"resizeObserverService",2);u([de("rangeService")],Wt.prototype,"rangeService",2);u([N("eBodyViewport")],Wt.prototype,"eBodyViewport",2);u([N("eStickyTop")],Wt.prototype,"eStickyTop",2);u([N("eStickyBottom")],Wt.prototype,"eStickyBottom",2);u([N("eTop")],Wt.prototype,"eTop",2);u([N("eBottom")],Wt.prototype,"eBottom",2);u([N("gridHeader")],Wt.prototype,"headerRootComp",2);u([N("eBody")],Wt.prototype,"eBody",2);u([M],Wt.prototype,"init",1);var xi=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")],xi.prototype,"ctrlsService",2);u([f("columnAnimationService")],xi.prototype,"columnAnimationService",2);u([M],xi.prototype,"postConstruct",1);xi=u([G("scrollVisibleService")],xi);var os=class extends L{constructor(){super(...arguments),this.gridInstanceId=os.gridInstanceSequence.next()}stampTopLevelGridCompWithGridInstance(t){t[os.GRID_DOM_KEY]=this.gridInstanceId}getRenderedCellForEvent(t){return Lr(this.gos,t.target,Us.DOM_DATA_KEY_CELL_CTRL)}isEventFromThisGrid(t){return this.isElementInThisGrid(t.target)}isElementInThisGrid(t){let e=t;for(;e;){const s=e[os.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(),a=r.getScrollFeature().getHScrollPosition();i+=a.left,o+=n.top}return{x:i,y:o}}};os.gridInstanceSequence=new Ni;os.GRID_DOM_KEY="__ag_grid_instance";u([f("ctrlsService")],os.prototype,"ctrlsService",2);os=u([G("mouseEventService")],os);var je=class extends L{constructor(){super(),this.onPageDown=ia(this.onPageDown,100),this.onPageUp=ia(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 a=!1;switch(s){case E.PAGE_HOME:case E.PAGE_END:!o&&!i&&(this.onHomeOrEndKey(s),a=!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),a=!0);break;case E.PAGE_DOWN:case E.PAGE_UP:!o&&!i&&(a=this.handlePageUpDown(s,n,e));break}return a&&t.preventDefault(),a}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(),a=this.paginationProxy.getRow(t.rowIndex),l=s?(a==null?void 0:a.rowHeight)-i-n:i-n,d=(a==null?void 0:a.rowTop)+l;let c=this.paginationProxy.getRowIndexAtPixel(d+n);if(c===t.rowIndex){const m=s?-1:1;e=c=t.rowIndex+m}let h;s?(h="bottom",c<o&&(c=o),e<o&&(e=o)):(h="top",c>r&&(c=r),e>r&&(e=r)),this.isRowTallerThanView(c)&&(e=c,h="top"),this.navigateTo({scrollIndex:e,scrollType:h,scrollColumn:null,focusIndex:c,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,a=t.rowIndex;for(;a>=0&&a<=r;){const l=this.paginationProxy.getRow(a);if(l){const d=(s=l.rowHeight)!=null?s:0;if(n+d>o)break;n+=d}a+=i}return Math.max(0,Math.min(a,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 Us&&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 Us){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),a=this.isCellEditable(r),l=r&&i.rowIndex===r.rowIndex&&i.rowPinned===r.rowPinned;return n&&t.setFocusOutOnEditor(),l||(t.getRowCtrl().stopEditing(),o.getRowCtrl().startRowEditing(void 0,void 0,s)),a?(o.setFocusInOnEditor(),o.focusCell()):o.focusCell(!0),!0}moveToNextCellNotEditing(t,e){const s=this.columnModel.getAllDisplayedColumns();let i;t instanceof zs?i=Ee(O({},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 Us)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 l=this.headerNavigationService.getHeaderRowCount();return this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:l+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 a=this.getCellByPosition(o);if(!a){const l=this.rowRenderer.getRowByPosition(o);if(!l||!l.isFullWidth()||s)continue;return l}if(!a.isSuppressNavigable())return(i=this.rangeService)==null||i.setRangeToCell(o),a}}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=U(o);if(r&&t&&t.key===E.UP&&(o={rowIndex:-1,rowPinned:null,column:s.column}),i){const a=this.gos.getCallback("navigateToNextCell");if(P(a)){const d=a({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 a=this.headerNavigationService.getHeaderRowCount();this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:a+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,a={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(a),!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))&&U(t.rowPinned)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(t.rowIndex),t.column.isPinned()||this.gridBodyCon.getScrollFeature().ensureColumnVisible(t.column)}};u([f("mouseEventService")],je.prototype,"mouseEventService",2);u([f("paginationProxy")],je.prototype,"paginationProxy",2);u([f("focusService")],je.prototype,"focusService",2);u([f("columnModel")],je.prototype,"columnModel",2);u([f("rowModel")],je.prototype,"rowModel",2);u([f("ctrlsService")],je.prototype,"ctrlsService",2);u([f("rowRenderer")],je.prototype,"rowRenderer",2);u([f("headerNavigationService")],je.prototype,"headerNavigationService",2);u([f("rowPositionUtils")],je.prototype,"rowPositionUtils",2);u([f("cellNavigationService")],je.prototype,"cellNavigationService",2);u([f("pinnedRowModel")],je.prototype,"pinnedRowModel",2);u([de("rangeService")],je.prototype,"rangeService",2);u([M],je.prototype,"postConstruct",1);je=u([G("navigationService")],je);var Rl=class ah extends li{constructor(e){super('<div class="ag-popup-editor" tabindex="-1"/>'),this.params=e}postConstruct(){this.gos.setDomData(this.getGui(),ah.DOM_KEY_POPUP_EDITOR_WRAPPER,!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),s=this.params,i=o=>{xr(this.gos,o,s.node,s.column,!0)||s.onKeyDown(o)};this.addManagedListener(e,"keydown",i)}};Rl.DOM_KEY_POPUP_EDITOR_WRAPPER="popupEditorWrapper";u([M],Rl.prototype,"postConstruct",1);var lh=Rl,Em=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 a=this.getGui();this.forceWrapper=s.isForceWrapper(),this.refreshWrapper(!1);const l=(h,m)=>{m!=null&&m!=""?a.setAttribute(h,m):a.removeAttribute(h)};Ae(a,s.getCellAriaRole()),l("col-id",s.getColumnIdSanitised());const d=s.getTabIndex();d!==void 0&&l("tabindex",d.toString());const c={addOrRemoveCssClass:(h,m)=>this.addOrRemoveCssClass(h,m),setUserStyles:h=>ol(a,h),getFocusableElement:()=>this.getFocusableElement(),setIncludeSelection:h=>this.includeSelection=h,setIncludeRowDrag:h=>this.includeRowDrag=h,setIncludeDndSource:h=>this.includeDndSource=h,setRenderDetails:(h,m,C)=>this.setRenderDetails(h,m,C),setEditDetails:(h,m,C)=>this.setEditDetails(h,m,C),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue()};s.setComp(c,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 c=document.createElement("div");c.setAttribute("role","presentation"),c.setAttribute("class","ag-cell-wrapper"),this.eCellWrapper=c,this.getGui().appendChild(this.eCellWrapper)}const r=!i&&this.eCellWrapper!=null;r&&(_t(this.eCellWrapper),this.eCellWrapper=void 0),this.addOrRemoveCssClass("ag-cell-value",!i);const n=!e&&i,a=n&&this.eCellValue==null;if(a){const c=document.createElement("span");c.setAttribute("role","presentation"),c.setAttribute("class","ag-cell-value"),this.eCellValue=c,this.eCellWrapper.appendChild(this.eCellValue)}const l=!n&&this.eCellValue!=null;l&&(_t(this.eCellValue),this.eCellValue=void 0);const d=o||r||a||l;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(l=>this.afterCellEditorCreated(o,l,n,s,i)),U(this.cellEditor)&&n.cellStartedEdit&&this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(e){const s=this.getParentOfValue();Fe(s);const i=e!=null?Ie(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),_t(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),_t(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 l=e.newAgStackInstance(),d=this.afterCellRendererCreated.bind(this,o,r);l&&l.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();Fe(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 l=o||s.isPopup!==void 0&&s.isPopup();l?this.addPopupCellEditor(i,r):this.addInCellEditor(),this.refreshEditStyles(!0,l),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 lh(e));const o=this.cellEditorPopupWrapper.getGui();this.cellEditorGui&&o.appendChild(this.cellEditorGui);const r=this.beans.popupService,n=this.beans.gos.get("stopEditingWhenCellsLoseFocus"),a=s??(i.getPopupPosition?i.getPopupPosition():"over"),l=this.beans.gos.get("enableRtl"),d={ePopup:o,column:this.column,rowNode:this.rowNode,type:"popupCellEditor",eventSource:this.getGui(),position:a,alignSide:l?"right":"left",keepWithinBounds:!0},c=r.positionPopupByComponent.bind(r,d),h=this.beans.localeService.getLocaleTextFunc(),m=r.addPopup({modal:n,eChild:o,closeOnEsc:!0,closedCallback:()=>{this.cellCtrl.onPopupEditorClosed()},anchorToElement:this.getGui(),positionCallback:c,ariaLabel:h("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())&&ja()&&e.focus({preventScroll:!0}),Fe(this.getParentOfValue())}},ym=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 a=this.rowCtrl.getTabIndex();a!=null&&r.setAttribute("tabindex",a.toString());const l={setDomOrder:d=>this.domOrder=d,setCellCtrls:d=>this.setCellCtrls(d),showFullWidth:d=>this.showFullWidth(d),getFullWidthCellRenderer:()=>this.getFullWidthCellRenderer(),addOrRemoveCssClass:(d,c)=>this.addOrRemoveCssClass(d,c),setUserStyles:d=>ol(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(l,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=vs(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())}),il(this.getGui(),s)}newCellComp(e){const s=new Em(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=vs(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 Rm(){const t=K.elementGettingCreated.getAttribute("name"),e=_r.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 ji=class extends K{constructor(){super(Rm()),this.rowComps={},this.name=K.elementGettingCreated.getAttribute("name"),this.type=rh(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 _r(this.name)).setComp(e,this.eContainer,this.eViewport)}preDestroy(){this.setRowCtrls([])}setRowCtrls(e){const s=O({},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 a=new ym(o,this.beans,this.type);this.rowComps[r]=a,this.appendRow(a.getGui())}};e.forEach(i),vs(s).forEach(o=>{this.eContainer.removeChild(o.getGui()),o.destroy()}),Ae(this.eContainer,"rowgroup")}appendRow(e){this.domOrder?qu(this.eContainer,e,this.lastPlacedElement):this.eContainer.appendChild(e),this.lastPlacedElement=e}ensureDomOrder(e){this.domOrder&&(sl(this.eContainer,e,this.lastPlacedElement),this.lastPlacedElement=e)}};u([f("beans")],ji.prototype,"beans",2);u([N("eViewport")],ji.prototype,"eViewport",2);u([N("eContainer")],ji.prototype,"eContainer",2);u([M],ji.prototype,"postConstruct",1);u([it],ji.prototype,"preDestroy",1);var bl=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?Y.ICON_PINNED:Y.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")],bl.prototype,"columnModel",2);u([f("gridOptionsService")],bl.prototype,"gos",2);var Ks=class{static attemptMoveColumns(t){const{isFromHeader:e,hDirection:s,xPosition:i,fromEnter:o,fakeEvent:r,pinned:n,gos:a,columnModel:l}=t,d=s===0,c=s===1;let{allMovingColumns:h}=t;if(e){let T=[];h.forEach(D=>{var A;let F=null,x=D.getParent();for(;x!=null&&x.getDisplayedLeafColumns().length===1;)F=x,x=x.getParent();F!=null?(!!((A=F.getColGroupDef())!=null&&A.marryChildren)?F.getProvidedColumnGroup().getLeafColumns():F.getLeafColumns()).forEach(_=>{T.includes(_)||T.push(_)}):T.includes(D)||T.push(D)}),h=T}const m=h.slice();l.sortColumnsLikeGridColumns(m);const C=this.calculateValidMoves({movingCols:m,draggingRight:c,xPosition:i,pinned:n,gos:a,columnModel:l}),v=this.calculateOldIndex(m,l);if(C.length===0)return;const S=C[0];let w=v!==null&&!o;if(e&&(w=v!==null),w&&!r&&(d&&S>=v||c&&S<=v))return;const R=l.getAllDisplayedColumns();let y=[],b=null;for(let T=0;T<C.length;T++){const D=C[T],A=l.getProposedColumnOrder(m,D);if(!l.doesOrderPassRules(A))continue;const F=A.filter(I=>R.includes(I));if(b===null)b=F;else if(!jt(F,b))break;const x=this.groupFragCount(A);y.push({move:D,fragCount:x})}if(y.length!==0)return y.sort((T,D)=>T.fragCount-D.fragCount),this.moveColumns(h,y[0].move,"uiColumnMoved",!1,l)}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=lu(t.map(l=>s.indexOf(l))),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 l=this.getDisplayedColumns(n,o),d=n.getAllGridColumns(),c=l.filter(y=>wt(e,y)),h=l.filter(y=>!wt(e,y)),m=d.filter(y=>!wt(e,y));let C=0,v=i;if(s){let y=0;c.forEach(b=>y+=b.getActualWidth()),v-=y}if(v>0){for(let y=0;y<h.length;y++){const b=h[y];if(v-=b.getActualWidth(),v<0)break;C++}s&&C++}let S;if(C>0){const y=h[C-1];S=m.indexOf(y)+1}else S=m.indexOf(h[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&&l.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}},qi=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?Y.ICON_PINNED:Y.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:c,toIndex:h}=this.lastMovedInfo;Ks.moveColumns(c,h,"uiColumnMoved",!0,this.columnModel)}return}if(this.lastDraggingEvent=t,U(t.hDirection))return;const r=Ks.normaliseX(t.x,this.pinned,!1,this.gos,this.ctrlsService);e||this.checkCenterForScrolling(r);const n=this.normaliseDirection(t.hDirection),a=t.dragSource.type,l=((o=t.dragSource.getDragItem().columns)==null?void 0:o.filter(c=>c.getColDef().lockPinned?c.getPinned()==this.pinned:!0))||[],d=Ks.attemptMoveColumns({allMovingColumns:l,isFromHeader:a===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(Y.ICON_LEFT,!0):this.dragAndDropService.setGhostIcon(Y.ICON_RIGHT,!0))}ensureIntervalCleared(){this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.dragAndDropService.setGhostIcon(Y.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(Y.ICON_PINNED),this.failedMoveAttempts>7)){const r=this.needToMoveLeft?"left":"right";this.setColumnsPinned(o,r,"uiColumnDragged"),this.dragAndDropService.nudge()}}}};u([f("columnModel")],qi.prototype,"columnModel",2);u([f("dragAndDropService")],qi.prototype,"dragAndDropService",2);u([f("gridOptionsService")],qi.prototype,"gos",2);u([f("ctrlsService")],qi.prototype,"ctrlsService",2);u([M],qi.prototype,"init",1);var Qi=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 qi(this.pinned)),this.bodyDropPivotTarget=this.createManagedBean(new bl(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")],Qi.prototype,"dragAndDropService",2);u([f("columnModel")],Qi.prototype,"columnModel",2);u([f("ctrlsService")],Qi.prototype,"ctrlsService",2);u([M],Qi.prototype,"postConstruct",1);u([M],Qi.prototype,"init",1);var Xi=class dh extends Sl{constructor(e){super(dh.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?Gu(e,r):Ou(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())}};Xi.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([N("eResize")],Xi.prototype,"eResize",2);u([N("eHeaderCompWrapper")],Xi.prototype,"eHeaderCompWrapper",2);u([M],Xi.prototype,"postConstruct",1);u([it],Xi.prototype,"destroyHeaderComp",1);var bm=Xi,yn=class uh extends Sl{constructor(e){super(uh.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=>Z(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)}};yn.TEMPLATE=`<div class="ag-header-group-cell" role="columnheader">
220
+ <div ref="eResize" class="ag-header-cell-resize" role="presentation"></div>
221
+ </div>`;u([N("eResize")],yn.prototype,"eResize",2);u([M],yn.prototype,"postConstruct",1);var Tm=yn,va=(t=>(t.COLUMN_GROUP="group",t.COLUMN="column",t.FLOATING_FILTER="filter",t))(va||{}),Tl=class extends K{constructor(e){super(),this.headerComps={},this.ctrl=e,this.setTemplate(`<div class="${this.ctrl.getHeaderRowClass()}" role="row"></div>`)}init(){Wa(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}),Ye(i,(o,r)=>{this.getGui().removeChild(r.getGui()),this.destroyBean(r)}),s){const o=vs(this.headerComps);o.sort((n,a)=>{const l=n.getCtrl().getColumnGroupChild().getLeft(),d=a.getCtrl().getColumnGroupChild().getLeft();return l-d});const r=o.map(n=>n.getGui());il(this.getGui(),r)}}createHeaderComp(e){let s;switch(this.ctrl.getType()){case"group":s=new Tm(e);break;case"filter":s=new Uf(e);break;default:s=new bm(e);break}return this.createBean(s),s.setParentComponent(this),s}};u([M],Tl.prototype,"init",1);u([it],Tl.prototype,"destroyHeaderCtrls",1);var Dm=0,ps=class ch 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 rc(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;wn.refreshFirstAndLastStyles(e,s,i.columnModel)}refreshAriaColIndex(){const{beans:e,column:s}=this,i=e.columnModel.getAriaColumnIndex(s);Ua(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=Oc[r?"Left":"Right"];if(e.altKey){this.isResizing=!0,this.resizeMultiplier+=1;const a=this.getViewportAdjustedResizeDiff(e);this.resizeHeader(a,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=ri(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=ch.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 ge?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 Rn=ps,bn=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,ge.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 ge)this.columnOrGroup;else{const s=this.columnOrGroup.getLeafColumns();if(!s.length)return;s.length>1&&xu(this.ariaEl,s.length),s[0]}}};u([M],bn.prototype,"postConstruct",1);var rr=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")],rr.prototype,"columnHoverService",2);u([M],rr.prototype,"postConstruct",1);var Am=class extends Rn{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,ge.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 Ts(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&&Bs(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 a=r.shiftKey;this.focusService.focusInto(this.eGui,a)}}const o=this.getRowIndex();this.beans.focusService.setFocusedHeader(o,this.column)}setupHover(){this.createManagedBean(new rr([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 bn(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,ge.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,ge.EVENT_WIDTH_CHANGED,t),t()}setupFilterChangedListener(){this.active&&(this.destroyFilterChangedListener=this.addManagedListener(this.column,ge.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 a;!n||this.beans.filterManager.areFilterCompsDifferent((a=this.userCompDetails)!=null?a: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}},Ji=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(Z(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 a=this.gos.get("skipHeaderOnAutoSize"),l=()=>{this.columnModel.autoSizeColumn(this.column,"uiColumnResized",a)};this.eResize.addEventListener("dblclick",l);const d=new We(this.eResize);d.addEventListener(We.EVENT_DOUBLE_TAP,l),t.push(()=>{this.eResize.removeEventListener("dblclick",l),d.removeEventListener(We.EVENT_DOUBLE_TAP,l),d.destroy()})}},o=()=>{t.forEach(n=>n()),t.length=0},r=()=>{const n=this.column.isResizable(),a=!this.gos.get("suppressAutoSize")&&!this.column.getColDef().suppressAutoSize;(n!==e||a!==s)&&(e=n,s=a,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,a=[{key:s,newWidth:n}];if(this.column.getPinned()){const l=this.pinnedWidthService.getPinnedLeftWidth(),d=this.pinnedWidthService.getPinnedRightWidth(),c=ri(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50;if(l+d+(r-i)>c)return}this.lastResizeAmount=r,this.columnModel.setColumnWidths(a,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")],Ji.prototype,"horizontalResizeService",2);u([f("pinnedWidthService")],Ji.prototype,"pinnedWidthService",2);u([f("ctrlsService")],Ji.prototype,"ctrlsService",2);u([f("columnModel")],Ji.prototype,"columnModel",2);u([M],Ji.prototype,"postConstruct",1);var Dl=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 hn),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)),qo(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")],Dl.prototype,"rowModel",2);u([f("selectionService")],Dl.prototype,"selectionService",2);var Pm=class extends Rn{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 Ji(this.getPinned(),this.column,s,t,this)),this.createManagedBean(new rr([this.column],e)),this.createManagedBean(new bn(this.column,e,this.beans)),this.createManagedBean(new Ts(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,ge.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,a=Math.min(Math.max(o+t,r),n);this.beans.columnModel.setColumnWidths([{key:this.column,newWidth:a}],e,!0,"uiColumnResized")}moveHeader(t){const{eGui:e,column:s,gos:i,ctrlsService:o}=this,r=this.getPinned(),n=e.getBoundingClientRect().left,a=s.getActualWidth(),l=i.get("enableRtl"),d=t===0!==l,c=Ks.normaliseX(d?n-20:n+a+20,r,!0,i,o);Ks.attemptMoveColumns({allMovingColumns:[s],isFromHeader:!0,hDirection:t,xPosition:c,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 Dl(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 ga)||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 a=i.querySelector(".ag-header-cell-text");return a?a.scrollWidth>a.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 us(r));this.refreshFunctions.push(()=>n.refreshToolTip())}setupClassesFromColDef(){const t=()=>{const e=this.column.getColDef(),s=wn.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 a=!this.gos.get("suppressDragLeaveHidesColumns");const l=this.dragSource={type:1,eElement:t,getDefaultIconName:()=>a?Y.ICON_HIDE:Y.ICON_NOT_ALLOWED,getDragItem:()=>this.createDragItem(e),dragItemName:i,onDragStarted:()=>{a=!r.get("suppressDragLeaveHidesColumns"),e.setMoving(!0,"uiColumnMoved")},onDragStopped:()=>e.setMoving(!1,"uiColumnMoved"),onGridEnter:d=>{var c;if(a){const h=((c=d==null?void 0:d.columns)==null?void 0:c.filter(m=>!m.getColDef().lockVisible))||[];n.setColumnsVisible(h,!0,"uiColumnMoved")}},onGridExit:d=>{var c;if(a){const h=((c=d==null?void 0:d.columns)==null?void 0:c.filter(m=>!m.getColDef().lockVisible))||[];n.setColumnsVisible(h,!1,"uiColumnMoved")}}};o.addDragSource(l,!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,ge.EVENT_WIDTH_CHANGED,t),t()}setupMovingCss(){const t=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving())};this.addManagedListener(this.column,ge.EVENT_MOVING_CHANGED,t),t()}setupMenuClass(){const t=()=>{this.comp.addOrRemoveCssClass("ag-column-menu-visible",this.column.isMenuVisible())};this.addManagedListener(this.column,ge.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,ge.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,ge.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,a=n.getColumnHeaderRowHeight();if(o===0){s.addOrRemoveCssClass("ag-header-span-total",!1),t.style.setProperty("top","0px"),t.style.setProperty("height",`${a}px`);return}s.addOrRemoveCssClass("ag-header-span-total",r);const d=n.isPivotMode()?n.getPivotGroupHeaderHeight():n.getGroupHeaderHeight(),c=o*d;t.style.setProperty("top",`${-c}px`),t.style.setProperty("height",`${a+c}px`)}setupAutoHeight(t){const{columnModel:e,resizeObserverService:s}=this.beans,i=d=>{if(!this.isAlive())return;const{paddingTop:c,paddingBottom:h,borderBottomWidth:m,borderTopWidth:C}=bs(this.getGui()),v=c+h+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&&a(),!d&&o&&l()},a=()=>{o=!0,i(0),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!0),r=s.observeResize(t,()=>i(0))},l=()=>{o=!1,r&&r(),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!1),r=void 0};n(),this.addDestroyFunc(()=>l()),this.addManagedListener(this.column,ge.EVENT_WIDTH_CHANGED,()=>o&&i(0)),this.addManagedListener(this.eventService,ge.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(bu(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 ga?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}},nr=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(),a=o.groupAfterColumns=n.filter(d=>d.isResizable()),l=o.groupAfterStartWidth=this.getInitialSizeOfColumns(a);o.groupAfterRatios=this.getSizeRatiosOfColumns(a,l)}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:a,groupAfterStartWidth:l,groupAfterRatios:d}=t,c=[];if(c.push({columns:o,ratios:n,width:e}),a){const h=e-r;c.push({columns:a,ratios:d,width:l-h})}this.columnModel.resizeColumnSets({resizeSets:c,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")],nr.prototype,"horizontalResizeService",2);u([f("autoWidthCalculator")],nr.prototype,"autoWidthCalculator",2);u([f("columnModel")],nr.prototype,"columnModel",2);u([M],nr.prototype,"postConstruct",1);var hh=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],hh.prototype,"postConstruct",1);var Fm=class extends Rn{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 rr(o,e)),this.createManagedBean(new bn(this.column,e,this.beans)),this.createManagedBean(new hh(t,this.column)),this.resizeFeature=this.createManagedBean(new nr(t,s,i,this.column)),this.createManagedBean(new Ts(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"),a=t===0,l=this.getPinned(),d=s.getBoundingClientRect(),c=d.left,h=d.width,m=Ks.normaliseX(a!==n?c-20:c+h+20,l,!0,o,r),C=i.getGroupId(),v=this.focusService.getFocusedHeader();Ks.attemptMoveColumns({allMovingColumns:this.column.getLeafColumns(),isFromHeader:!0,hDirection:t,xPosition:m,pinned:l,fromEnter:!1,fakeEvent:!1,gos:o,columnModel:e.columnModel});const S=i.getDisplayedLeafColumns(),w=a?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(O({},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 us(r))}setupExpandable(){const t=this.column.getProvidedColumnGroup();this.refreshExpanded(),this.addManagedListener(t,Me.EVENT_EXPANDABLE_CHANGED,this.refreshExpanded.bind(this)),this.addManagedListener(t,Me.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=wn.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,ge.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,a=s.getProvidedColumnGroup().getLeafColumns();let l=!o.get("suppressDragLeaveHidesColumns");const d=this.dragSource={type:1,eElement:t,getDefaultIconName:()=>l?Y.ICON_HIDE:Y.ICON_NOT_ALLOWED,dragItemName:i,getDragItem:()=>this.getDragItemForGroup(s),onDragStarted:()=>{l=!o.get("suppressDragLeaveHidesColumns"),a.forEach(c=>c.setMoving(!0,"uiColumnDragged"))},onDragStopped:()=>a.forEach(c=>c.setMoving(!1,"uiColumnDragged")),onGridEnter:c=>{var h;if(l){const m=((h=c==null?void 0:c.columns)==null?void 0:h.filter(C=>!C.getColDef().lockVisible))||[];n.setColumnsVisible(m,!0,"uiColumnMoved")}},onGridExit:c=>{var h;if(l){const m=((h=c==null?void 0:c.columns)==null?void 0:h.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),lt(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")}},Lm=0,vo=class extends L{constructor(t,e,s){super(),this.instanceId=Lm++,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 ks(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(),a=1+o,l=s-a;for(let h=0;h<l;h++)i.push(r);i.push(n);for(let h=0;h<o;h++)i.push(t.getFloatingFiltersHeight());let d=0;for(let h=0;h<this.rowIndex;h++)d+=i[h];const c=i[this.rowIndex];return{topOffset:d,rowHeight:c}}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 Am(t,this.beans,this));break;case"group":i=this.createBean(new Fm(t,this.beans,this));break;default:i=this.createBean(new Pm(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 Ds=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 Qi(this.pinned,t);this.createManagedBean(e)}refresh(t=!1){const e=new Ni,s=this.focusService.getFocusHeaderToUseAfterRefresh(),i=()=>{const a=this.columnModel.getHeaderRowCount()-1;this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls);for(let l=0;l<a;l++){const d=this.createBean(new vo(e.next(),this.pinned,"group"));this.groupsRowCtrls.push(d)}},o=()=>{const a=e.next(),l=!this.hidden&&(this.columnsRowCtrl==null||!t||this.columnsRowCtrl.getRowIndex()!==a);(l||this.hidden)&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),l&&(this.columnsRowCtrl=this.createBean(new vo(a,this.pinned,"column")))},r=()=>{this.includeFloatingFilter=this.filterManager.hasFloatingFilters()&&!this.hidden;const a=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter){a();return}const l=e.next();if(this.filtersRowCtrl){const d=this.filtersRowCtrl.getRowIndex()!==l;(!t||d)&&a()}this.filtersRowCtrl||(this.filtersRowCtrl=this.createBean(new vo(l,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 Yi(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"),a=this.gos.getScrollbarWidth(),d=this.scrollVisibleService.isVerticalScrollShowing()&&(n&&t||!n&&e)?i+a: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 ge)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")],Ds.prototype,"ctrlsService",2);u([f("scrollVisibleService")],Ds.prototype,"scrollVisibleService",2);u([f("pinnedWidthService")],Ds.prototype,"pinnedWidthService",2);u([f("columnModel")],Ds.prototype,"columnModel",2);u([f("focusService")],Ds.prototype,"focusService",2);u([f("filterManager")],Ds.prototype,"filterManager",2);var pi=class yr 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 Ds(this.pinned)).setComp(e,this.getGui())}selectAndSetTemplate(){const e=this.pinned=="left",s=this.pinned=="right",i=e?yr.PINNED_LEFT_TEMPLATE:s?yr.PINNED_RIGHT_TEMPLATE:yr.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&&sl(this.eRowContainer,n,i),i=n};e.forEach(r=>{const n=r.getInstanceId(),a=s[n];delete s[n];const l=a||this.createBean(new Tl(r));this.headerRowComps[n]=l,this.rowCompsList.push(l),o(l)}),vs(s).forEach(r=>this.destroyRowComp(r))}};pi.PINNED_LEFT_TEMPLATE='<div class="ag-pinned-left-header" role="rowgroup"></div>';pi.PINNED_RIGHT_TEMPLATE='<div class="ag-pinned-right-header" role="rowgroup"></div>';pi.CENTER_TEMPLATE=`<div class="ag-header-viewport" role="presentation">
222
+ <div class="ag-header-container" ref="eCenterContainer" role="rowgroup"></div>
223
+ </div>`;u([N("eCenterContainer")],pi.prototype,"eCenterContainer",2);u([M],pi.prototype,"init",1);u([it],pi.prototype,"destroyRowComps",1);var Un=pi,Qs=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:a,column:l,headerRowIndexWithoutSpan:d}=n?this.headerPositionUtils.getColumnVisibleParent(o,i):this.headerPositionUtils.getColumnVisibleChild(o,i),c=!1;return a<0&&(a=0,l=o,c=!0),a>=r?(a=-1,this.setCurrentHeaderRowWithoutSpan(-1)):d!==void 0&&(this.currentHeaderRowWithoutSpan=d),!c&&!l?!1:this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:a,column:l},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,a;if(this.currentHeaderRowWithoutSpan!==-1?i.headerRowIndex=this.currentHeaderRowWithoutSpan:this.currentHeaderRowWithoutSpan=i.headerRowIndex,o!==r?(a="Before",n=this.headerPositionUtils.findHeader(i,a)):(a="After",n=this.headerPositionUtils.findHeader(i,a)),n||!e)return this.focusService.focusHeaderPosition({headerPosition:n,direction:a,fromTab:e,allowUserOverride:!0,event:s});if(e){const l=this.gos.getCallback("tabToNextHeader");if(l)return this.focusService.focusHeaderPositionFromUserFunc({userFunc:l,headerPosition:n,direction:a})}return this.focusNextHeaderRow(i,a,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:a}=this.headerPositionUtils.getHeaderIndexToFocus(o.column,o==null?void 0:o.headerRowIndex);return this.focusService.focusHeaderPosition({headerPosition:{column:n,headerRowIndex:a},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")],Qs.prototype,"focusService",2);u([f("headerPositionUtils")],Qs.prototype,"headerPositionUtils",2);u([f("ctrlsService")],Qs.prototype,"ctrlsService",2);u([M],Qs.prototype,"postConstruct",1);Qs=u([G("headerNavigationService")],Qs);var As=class extends L{setComp(t,e,s){this.comp=t,this.eGui=e,this.createManagedBean(new Ts(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(),a=1+e,l=s-a;if(i=e*t.getFloatingFiltersHeight(),i+=l*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(!ds())return;const e=new We(this.eGui),s=i=>{t(void 0,i.touchStart,i.touchEvent)};this.addManagedListener(e,We.EVENT_LONG_TAP,s),this.addDestroyFunc(()=>e.destroy())}};u([f("headerNavigationService")],As.prototype,"headerNavigationService",2);u([f("focusService")],As.prototype,"focusService",2);u([f("columnModel")],As.prototype,"columnModel",2);u([f("ctrlsService")],As.prototype,"ctrlsService",2);u([f("filterManager")],As.prototype,"filterManager",2);u([f("menuService")],As.prototype,"menuService",2);var Al=class ph extends K{constructor(){super(ph.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 As).setComp(e,this.getGui(),this.getFocusableElement());const i=o=>{this.createManagedBean(o),this.appendChild(o)};i(new Un("left")),i(new Un(null)),i(new Un("right"))}};Al.TEMPLATE='<div class="ag-header" role="presentation"/>';u([M],Al.prototype,"postConstruct",1);var Mm=Al,Io=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")],Io.prototype,"dragService",2);u([f("ctrlsService")],Io.prototype,"ctrlsService",2);Io=u([G("horizontalResizeService")],Io);var Ss=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,a=r?void 0:4;this.showPopup(t,l=>{this.popupService.positionPopupByComponent({type:s,eventSource:e,ePopup:l,nudgeX:n,nudgeY:a,alignSide:o,keepWithinBounds:!0,position:"under",column:t})},s,e,r)}showPopup(t,e,s,i,o){const r=t?this.createBean(new Cn(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 a;const l=()=>r==null?void 0:r.afterGuiDetached(),d=this.menuService.isColumnMenuAnchoringEnabled()?i??this.ctrlsService.getGridBodyCtrl().getGui():void 0,c=v=>{t.setMenuVisible(!1,"contextMenu");const S=v instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),S&&i&&pt(i)){const w=this.focusService.findTabbableParent(i);w&&w.focus()}l(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,s,t)},h=this.localeService.getLocaleTextFunc(),m=o&&s!=="columnFilter"?h("ariaLabelColumnMenu","Column Menu"):h("ariaLabelColumnFilter","Column Filter"),C=this.popupService.addPopup({modal:!0,eChild:n,closeOnEsc:!0,closedCallback:c,positionCallback:()=>e(n),anchorToElement:d,ariaLabel:m});C&&(this.hidePopup=a=C.hideFunc),r.afterInit().then(()=>{e(n),r.afterGuiAttached({container:s,hidePopup:a})}),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")],Ss.prototype,"filterManager",2);u([f("popupService")],Ss.prototype,"popupService",2);u([f("focusService")],Ss.prototype,"focusService",2);u([f("ctrlsService")],Ss.prototype,"ctrlsService",2);u([f("menuService")],Ss.prototype,"menuService",2);Ss=u([G("filterMenuFactory")],Ss);var Rr=(t=>(t.TAB_GUARD="ag-tab-guard",t.TAB_GUARD_TOP="ag-tab-guard-top",t.TAB_GUARD_BOTTOM="ag-tab-guard-bottom",t))(Rr||{}),Tn=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:a,onFocusOut:l,shouldStopEventPropagation:d,onTabKeyDown:c,handleKeyDown:h,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=a,this.providedFocusOut=l,this.providedShouldStopEventPropagation=d,this.providedOnTabKeyDown=c,this.providedHandleKeyDown=h}postConstruct(){this.createManagedBean(new Ts(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),a=this.gos.get("tabIndex");n.sort((l,d)=>{const c=parseInt(l.getAttribute("tabindex")||"0"),h=parseInt(d.getAttribute("tabindex")||"0");return h===a?1:c===a?-1:c===0?1:h===0?-1:c-h}),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")],Tn.prototype,"focusService",2);u([M],Tn.prototype,"postConstruct",1);var ar=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 Tn({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];Fe(this.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}appendChild(e,s){Xo(e)||(e=e.getGui());const{eBottomGuard:i}=this;i?i.insertAdjacentElement("beforebegin",e):super.appendChild(e,s)}},Dn=class gh extends ar{constructor(e){super(gh.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,a;return(a=(n=this.params).onCloseClicked)==null?void 0:a.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:a,eBody:l,activeItem:d,params:c}=this,{suppressTrapFocus:h,enableCloseButton:m}=c,C=this.gos.getActiveDomElement(),v=e.target,S=e.shiftKey;if(a.contains(C)){e.preventDefault(),m&&S&&!((s=this.eCloseButton)!=null&&s.contains(C))?(i=this.eCloseButton)==null||i.focus():h&&S?(o=this.focusService.findFocusableElementBeforeTabGuard(this.gos.getDocument().body,v))==null||o.focus():this.focusBody(e.shiftKey);return}let w=null;if(n.isTargetUnderManagedComponent(l,v)&&(S&&(w=this.focusService.findFocusableElementBeforeTabGuard(l,v)),!w&&!h&&(w=d.eHeaderButton)),!w&&l.contains(C)&&(w=n.findNextFocusableElement(l,!1,S),!w)){e.preventDefault(),h&&!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,a;const{tabbedItem:l,eHeaderButton:d}=e;if((i=(s=this.params).onItemClicked)==null||i.call(s,{item:l}),this.activeItem===e){(r=(o=this.params).onActiveItemClicked)==null||r.call(o);return}this.lastScrollListener&&(this.lastScrollListener=this.lastScrollListener()),Fe(this.eBody),l.bodyPromise.then(c=>{this.eBody.appendChild(c);const h=!this.focusService.isKeyboardMode();if(this.params.suppressFocusBodyOnOpen||this.focusService.focusInto(this.eBody,!1,h),l.afterAttachedCallback&&l.afterAttachedCallback(this.afterAttachedParams),this.params.keepScrollPosition){const m=l.getScrollableContainer&&l.getScrollableContainer()||c;this.lastScrollListener=this.addManagedListener(m,"scroll",()=>{this.tabbedItemScrollMap.set(l.name,m.scrollTop)});const C=this.tabbedItemScrollMap.get(l.name);C!==void 0&&setTimeout(()=>{m.scrollTop=C},0)}}),this.activeItem&&(this.activeItem.eHeaderButton.classList.remove("ag-tab-selected"),(a=(n=this.activeItem.tabbedItem).afterDetachedCallback)==null||a.call(n)),d.classList.add("ag-tab-selected"),this.activeItem=e}};u([f("focusService")],Dn.prototype,"focusService",2);u([N("eHeader")],Dn.prototype,"eHeader",2);u([N("eBody")],Dn.prototype,"eBody",2);u([M],Dn.prototype,"postConstruct",1);var Im=50,wa=class extends L{constructor(){super(...arguments),this.polyfillFunctions=[]}observeResize(t,e){const s=this.gos.getWindow(),i=()=>{const a=new s.ResizeObserver(e);return a.observe(t),()=>a.disconnect()},o=()=>{var a,l;let d=(a=t==null?void 0:t.clientWidth)!=null?a:0,c=(l=t==null?void 0:t.clientHeight)!=null?l:0,h=!0;const m=()=>{var C,v;if(h){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!==c)&&(d=S,c=w,e()),this.doNextPolyfillTurn(m)}};return m(),()=>h=!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,Im)}};wa=u([G("resizeObserverService")],wa);var Gi=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 a=new Date().getTime()-n;const l=t<=0,d=this.ctrlsService.getGridBodyCtrl();for(;l||a<t;){if(!d.getScrollFeature().scrollGridIfNeeded()){let h;if(s.length)this.sortTaskList(e),h=s.pop().task;else if(o.length)this.sortTaskList(i),h=o.pop().task;else if(r.length)h=r.pop();else{this.cancelledTasks.clear();break}this.cancelledTasks.has(h)||h()}a=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")],Gi.prototype,"ctrlsService",2);u([f("paginationProxy")],Gi.prototype,"paginationProxy",2);u([M],Gi.prototype,"init",1);Gi=u([G("animationFrameService")],Gi);var No=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")],No.prototype,"rowModel",2);u([M],No.prototype,"postConstruct",1);No=u([G("expansionService")],No);var Lt=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:a}=t;r&&o&&a==null&&(a=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,a,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!(ds()&&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")],Lt.prototype,"filterMenuFactory",2);u([f("ctrlsService")],Lt.prototype,"ctrlsService",2);u([f("animationFrameService")],Lt.prototype,"animationFrameService",2);u([f("filterManager")],Lt.prototype,"filterManager",2);u([f("rowRenderer")],Lt.prototype,"rowRenderer",2);u([de("columnChooserFactory")],Lt.prototype,"columnChooserFactory",2);u([de("contextMenuFactory")],Lt.prototype,"contextMenuFactory",2);u([de("enterpriseMenuFactory")],Lt.prototype,"enterpriseMenuFactory",2);u([M],Lt.prototype,"postConstruct",1);Lt=u([G("menuService")],Lt);var Xs=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(a=>s.classList.contains(a))?(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(l=>n.classList.contains(l))){for(let l=0;l<n.classList.length;l++){const d=n.classList[l];d!="ag-row-position-absolute"&&o.add(d)}break}n=n.parentElement}i.appendChild(s),e.appendChild(i)}};u([f("rowRenderer")],Xs.prototype,"rowRenderer",2);u([f("ctrlsService")],Xs.prototype,"ctrlsService",2);u([f("rowCssClassCalculator")],Xs.prototype,"rowCssClassCalculator",2);u([M],Xs.prototype,"postConstruct",1);Xs=u([G("autoWidthCalculator")],Xs);var lr=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 c=this.getLastPixelOfGroup(d),h=i+s+d.rowHeight;c<h?d.stickyRowTop=s+(c-h):d.stickyRowTop=s}else{const c=this.getFirstPixelOfGroup(d),h=i-(s+d.rowHeight);c>h?d.stickyRowTop=s-(c-h):d.stickyRowTop=s}s=0,o.forEach(c=>{const h=c.stickyRowTop+c.rowHeight;s<h&&(s=h)})},n=this.areFooterRowsStickySuppressed(),a=this.gos.get("suppressGroupRowsSticky"),l=d=>d.displayed?d.footer?n===!0||n==="grand"&&d.level===-1||n==="group"&&d.level>-1?!1:!o.has(d):d.isExpandable()?a===!0?!1:!o.has(d)&&d.expanded:!1:!1;for(let d=0;d<100;d++){let c=i+s;e||(c=i-s);const h=this.rowModel.getRowIndexAtPixel(c),m=this.rowModel.getRow(h);if(m==null)break;const v=this.getStickyAncestors(m).find(w=>(e?w.rowIndex<h:w.rowIndex>h)&&l(w));if(v){r(v);continue}if((e?m.rowTop<c:m.rowTop+m.rowHeight>c)&&l(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 h=0;h<o.length;h++){const m=o[h].getRowNode();if(!e.has(m)){r[m.id]=o[h],m.sticky=!1;continue}n.push(o[h])}const a=new Set;for(let h=0;h<n.length;h++)a.add(n[h].getRowNode());const l=[];e.forEach(h=>{a.has(h)||(h.sticky=!0,l.push(this.createRowCon(h,!1,!1)))});let d=!!l.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 c=[...n,...l];return c.sort((h,m)=>m.getRowNode().rowIndex-h.getRowNode().rowIndex),i||c.reverse(),c.forEach(h=>h.setRowTop(h.getRowNode().stickyRowTop)),d?(i?this.stickyTopRowCtrls=c:this.stickyBottomRowCtrls=c,!0):!1}};u([f("rowModel")],lr.prototype,"rowModel",2);u([f("rowRenderer")],lr.prototype,"rowRenderer",2);u([f("ctrlsService")],lr.prototype,"ctrlsService",2);u([M],lr.prototype,"postConstruct",1);var Et=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 lr(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 Nm(e)}}getKeepDetailRowsCount(){return this.gos.get("keepDetailRowsCount")}getStickyTopRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyTopRowCtrls():[]}getStickyBottomRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyBottomRowCtrls():[]}updateAllRowCtrls(){const t=vs(this.rowCtrlsByRowIndex),e=vs(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=l=>{this.getAllCellCtrls().forEach(d=>{d.getColumn()===e&&l(d)})},i=()=>{s(l=>l.onLeftChanged())},o=()=>{s(l=>l.onWidthChanged())},r=()=>{s(l=>l.onFirstRightPinnedChanged())},n=()=>{s(l=>l.onLastLeftPinnedChanged())},a=()=>{s(l=>l.onColDefChanged())};e.addEventListener("leftChanged",i),e.addEventListener("widthChanged",o),e.addEventListener("firstRightPinnedChanged",r),e.addEventListener("lastLeftPinnedChanged",n),e.addEventListener("colDefChanged",a),this.destroyFuncsForColumnListeners.push(()=>{e.removeEventListener("leftChanged",i),e.removeEventListener("widthChanged",o),e.removeEventListener("firstRightPinnedChanged",r),e.removeEventListener("lastLeftPinnedChanged",n),e.removeEventListener("colDefChanged",a)})})}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 zs(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,Us.DOM_DATA_KEY_CELL_CTRL),o=this.gos.getDomData(s,zs.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 a=0;a<n.length;a++){const l=n[a];l!=null&&i.push(l)}}),[...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=[];Ye(this.rowCtrlsByRowIndex,(s,i)=>{i.getRowNode().id==null&&t.push(s)}),this.removeRowCtrls(t);const e={};return Ye(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&&ja()&&(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 a=this.getCellToRestoreFocusToAfterRefresh();s!=null&&a==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=Ku(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)};Ye(this.rowCtrlsByRowIndex,s),Ye(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=[];Ye(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()}),Jd(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 a=this.getRowBufferInPixels(),l=this.ctrlsService.getGridBodyCtrl(),d=this.gos.get("suppressRowVirtualisation");let c=!1,h,m;do{const R=this.paginationProxy.getPixelOffset(),{pageFirstPixel:y,pageLastPixel:b}=this.paginationProxy.getCurrentPagePixelRange(),T=this.rowContainerHeightService.getDivStretchOffset(),D=l.getScrollFeature().getVScrollPosition(),A=D.top,F=D.bottom;d?(h=y+T,m=b+T):(h=Math.max(A+R-a,y)+T,m=Math.min(F+R+a,b)+T),this.firstVisibleVPixel=Math.max(A+R,y)+T,this.lastVisibleVPixel=Math.min(F+R,b)+T,c=this.ensureAllRowsInRangeHaveHeightsCalculated(h,m)}while(c);let C=this.paginationProxy.getRowIndexAtPixel(h),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 a={type:p.EVENT_VIEWPORT_CHANGED,firstRow:t,lastRow:e};this.eventService.dispatchEvent(a)}}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 zs(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")],Et.prototype,"animationFrameService",2);u([f("paginationProxy")],Et.prototype,"paginationProxy",2);u([f("columnModel")],Et.prototype,"columnModel",2);u([f("pinnedRowModel")],Et.prototype,"pinnedRowModel",2);u([f("rowModel")],Et.prototype,"rowModel",2);u([f("focusService")],Et.prototype,"focusService",2);u([f("beans")],Et.prototype,"beans",2);u([f("rowContainerHeightService")],Et.prototype,"rowContainerHeightService",2);u([f("ctrlsService")],Et.prototype,"ctrlsService",2);u([M],Et.prototype,"postConstruct",1);Et=u([G("rowRenderer")],Et);var Nm=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],lt(this.entriesList,s)}removeFromCache(t){const e=t.getRowNode().id;delete this.entriesMap[e],lt(this.entriesList,t)}getEntries(){return this.entriesList}},xo=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 Q(this.beans);n.data=o;const a=e?Q.ID_PREFIX_TOP_PINNED:Q.ID_PREFIX_BOTTOM_PINNED;n.id=a+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")],xo.prototype,"beans",2);u([M],xo.prototype,"init",1);xo=u([G("pinnedRowModel")],xo);var An=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()])}},Zi=class Os extends L{constructor(e){super(),this.state=Os.STATE_WAITING_TO_LOAD,this.version=0,this.id=e}getId(){return this.id}load(){this.state=Os.STATE_LOADING,this.loadFromDatasource()}getVersion(){return this.version}setStateWaitingToLoad(){this.version++,this.state=Os.STATE_WAITING_TO_LOAD}getState(){return this.state}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state=Os.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=Os.STATE_LOADED,this.processServerResult(s))}dispatchLoadCompleted(e=!0){const s={type:Os.EVENT_LOAD_COMPLETE,success:e,block:this};this.dispatchEvent(s)}};Zi.EVENT_LOAD_COMPLETE="loadComplete";Zi.STATE_WAITING_TO_LOAD="needsLoading";Zi.STATE_LOADING="loading";Zi.STATE_LOADED="loaded";Zi.STATE_FAILED="failed";var Sa=Zi,Jt=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(Sa.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:Jt.BLOCK_LOADED_EVENT}),this.activeBlockLoadsCount==0&&this.dispatchEvent({type:Jt.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()===Sa.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}};Jt.BLOCK_LOADED_EVENT="blockLoaded";Jt.BLOCK_LOADER_FINISHED_EVENT="blockLoaderFinished";u([f("rowModel")],Jt.prototype,"rowModel",2);u([M],Jt.prototype,"postConstruct",1);u([Ot(0,Tt("loggerFactory"))],Jt.prototype,"setBeans",1);Jt=u([G("rowNodeBlockLoader")],Jt);var Go=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 U(this.topRowBounds)||U(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")],Go.prototype,"rowModel",2);u([M],Go.prototype,"postConstruct",1);Go=u([G("paginationProxy")],Go);var Vr=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={},a=(l,d)=>{l.split(" ").forEach(c=>{c.trim()!=""&&d(c)})};if(e){const l=Object.keys(e);for(let d=0;d<l.length;d++){const c=l[d],h=e[c];let m;typeof h=="string"?m=this.expressionService.evaluate(h,s):typeof h=="function"&&(m=h(s)),a(c,C=>{m?r[C]=!0:n[C]=!0})}}t&&o&&Object.keys(t).forEach(l=>a(l,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")],Vr.prototype,"expressionService",2);Vr=u([G("stylingService")],Vr);var fh=class extends hn{constructor(t){super(t,"ag-toggle-button")}setValue(t,e){return super.setValue(t,e),this.addOrRemoveCssClass("ag-selected",this.getValue()),this}},xm=class extends Vt{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}},Gm=class extends ai{constructor(t){super(t,"ag-date-field","date")}postConstruct(){super.postConstruct(),this.addManagedListener(this.eInput,"wheel",this.onWheel.bind(this));const t=Xt();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=At(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=At(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(At(t??null,!1),e)}},Om=class extends Vt{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}},Pl=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=Ie(e.slice(0,i),!0),n=Ie(e.slice(i,o),!0),a=Ie(e.slice(o));this.renderValueWithoutRenderer(`${r}<span class="ag-rich-select-row-text-highlight">${n}</span>${a}`)}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();Ba(o,i),this.wrapperEl.setAttribute("data-active-option",i)}Mi(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=Ie(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")],Pl.prototype,"userComponentFactory",2);u([M],Pl.prototype,"postConstruct",1);var dr=class mh extends ar{constructor(e){super(mh.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=Tu(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():(Bt(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(),a=n.scrollTop,l=n.offsetHeight,d=a+l,c=s?0:this.rowHeight,h=a>o+c,m=d<r-c;if(h)return n.scrollTop=o,!0;if(m){const C=r-l;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`,xa(()=>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"),tn(i,this.model.getRowCount()),sn(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")],dr.prototype,"resizeObserverService",2);u([f("animationFrameService")],dr.prototype,"animationFrameService",2);u([N("eContainer")],dr.prototype,"eContainer",2);u([M],dr.prototype,"postConstruct",1);var Ch=dr,_m=`
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>`,Pn=class extends ni{constructor(t){var e,s;super(Ee(O({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:_m,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=Ze(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 Ch({cssIdentifier:"rich-select"})),this.listComponent.setComponentCreator(this.createRowComponent.bind(this));const t=(a,l)=>{};this.listComponent.setComponentUpdater(t),this.listComponent.setParentComponent(this),this.addManagedListener(this.listComponent,p.EVENT_FIELD_PICKER_VALUE_SELECTED,a=>{this.onListValueSelected(a.value,a.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",a=>a.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),za(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 a;if(n&&(a=n.newAgStackInstance()),a)Fe(e),nl(a,e),a.then(l=>{this.addDestroyFunc(()=>this.getContext().destroyBean(l))});else{if(P(this.value))e.innerText=r,e.classList.remove("ag-display-as-placeholder");else{const{placeholder:l}=s;P(l)?(e.innerHTML=`${Ie(l)}`,e.classList.add("ag-display-as-placeholder")):Fe(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(!an(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=Jo(this.searchString,e,!0);s=n.values;const a=n.indices;if(r&&a.length)for(let l=0;l<a.length;l++)i.push(this.values[a[l]])}else s=e.filter((n,a)=>{const l=n.toLocaleLowerCase(),d=this.searchString.toLocaleLowerCase(),c=o==="match"?l.startsWith(d):l.indexOf(d)!==-1;return r&&c&&i.push(this.values[a]),c});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:a,searchType:l="fuzzy"}=this.config,d=r.length,c=!!(n&&this.searchString!=="");if(this.filterListModel(c?r:s),o.length){const h=c?0:i.indexOf(o[0]);this.selectListItem(h)}else if(this.highlightSelectedValue(-1),!c||d)(t=this.listComponent)==null||t.ensureIndexVisible(0);else if(c){this.getAriaElement().removeAttribute("data-active-option");const h=(e=this.listComponent)==null?void 0:e.getAriaElement();h&&Ba(h,null)}a&&l!=="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 Pl(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&&(pt(this.listComponent.getGui())&&(t.preventDefault(),Bt(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")],Pn.prototype,"userComponentFactory",2);u([f("animationFrameService")],Pn.prototype,"animationFrameService",2);u([N("eInput")],Pn.prototype,"eInput",2);var eo=class vh extends ul{constructor(e){super(e,vh.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}};eo.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([N("eLabel")],eo.prototype,"eLabel",2);u([N("eSlider")],eo.prototype,"eSlider",2);u([N("eText")],eo.prototype,"eText",2);u([M],eo.prototype,"init",1);var Vm=eo,Ps=class Si extends K{constructor(e={}){super(Si.getTemplate(e)),this.params=e,this.suppressEnabledCheckbox=!0,this.suppressToggleExpandOnEnableChange=!1;const{enabled:s,items:i,suppressEnabledCheckbox:o,expanded:r,suppressToggleExpandOnEnableChange:n,useToggle:a}=e;this.cssIdentifier=e.cssIdentifier||"default",this.enabled=s??!0,this.items=i||[],this.useToggle=a??!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(),Z(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;Z(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(),Z(this.eContainer,e),i||this.dispatchEvent({type:e?Si.EVENT_EXPANDED:Si.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];Z(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:Si.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,Si.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 ld(this.params));return this.eTitleBar=e,e.refreshOnExpand(this.expanded),this.addManagedListener(e,ld.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}};Ps.EVENT_EXPANDED="expanded";Ps.EVENT_COLLAPSED="collapsed";Ps.EVENT_ENABLE_CHANGE="enableChange";u([N("eToolbar")],Ps.prototype,"eToolbar",2);u([N("cbGroupEnabled")],Ps.prototype,"cbGroupEnabled",2);u([N("eContainer")],Ps.prototype,"eContainer",2);u([M],Ps.prototype,"postConstruct",1);var Hm=Ps,zn="ag-disabled-group-title-bar",to=class Ea extends K{constructor(e={}){super(Ea.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(Rt("columnSelectClosed",this.gos,null)),this.eGroupOpenedIcon.appendChild(Rt("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||ns(this.getGui(),e)}refreshOpenCloseIcons(e){const s=!this.suppressOpenCloseIcons;Z(this.eGroupOpenedIcon,s&&e),Z(this.eGroupClosedIcon,s&&!e)}isSuppressCollapse(){return this.suppressOpenCloseIcons}dispatchExpandChanged(e){const s={type:Ea.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??"",Z(s,i),e!==this.title&&(this.title=e);const o=s.classList.contains(zn);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(zn),s.removeAttribute("tabindex")):(s.classList.remove(zn),typeof this.title=="string"?s.setAttribute("tabindex","0"):s.removeAttribute("tabindex"))}};to.EVENT_EXPAND_CHANGED="expandedChanged";u([N("eGroupOpenedIcon")],to.prototype,"eGroupOpenedIcon",2);u([N("eGroupClosedIcon")],to.prototype,"eGroupClosedIcon",2);u([N("eTitle")],to.prototype,"eTitle",2);u([M],to.prototype,"postConstruct",1);var ld=to,Fl=class extends ar{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()&&Bt(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&&Ne.all(t.map(e=>e==="separator"?Ne.resolve({eGui:this.createSeparator()}):typeof e=="string"?(console.warn(`AG Grid: unrecognised menu item ${e}`),Ne.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 Cr);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,Cr.EVENT_CLOSE_MENU,s=>{this.dispatchEvent(s)}),this.addManagedListener(e,Cr.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 Cr?(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")],Fl.prototype,"focusService",2);u([M],Fl.prototype,"postConstruct",1);var wh=class extends ar{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],wh.prototype,"postConstruct",1);var so=class Ei 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:a,contextParams:l}=e;return this.params=e.menuItemDef,this.level=n,this.isAnotherSubMenuOpen=r,this.childComponent=a,this.contextParams=l,this.cssClassPrefix=(i=(s=this.params.menuItemParams)==null?void 0:s.cssClassPrefix)!=null?i:"ag-menu-option",this.userComponentFactory.getMenuItemCompDetails(this.params,Ee(O({},o),{level:n,isAnotherSubMenuOpen:r,openSubMenu:c=>this.openSubMenu(c),closeSubMenu:()=>this.closeSubMenu(),closeMenu:c=>this.closeMenu(c),updateTooltip:(c,h)=>this.refreshTooltip(c,h),onItemActivated:()=>this.onItemActivated()})).newAgStackInstance().then(c=>{var h;this.menuItemComp=c;const m=(h=c.configureDefaults)==null?void 0:h.call(c);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 c=this.createBean(new wh(this.childComponent));c.setParentComponent(this);const h=c.getGui(),m="mouseenter",C=()=>this.cancelDeactivate();h.addEventListener(m,C),r=()=>h.removeEventListener(m,C),o.appendChild(h),this.childComponent.afterGuiAttached&&(n=()=>{this.childComponent.afterGuiAttached(),this.subMenuIsOpening=!1})}else if(this.params.subMenu){const c=this.createBean(new Fl(this.level+1,this.contextParams));c.setParentComponent(this),c.addMenuItems(this.params.subMenu),o.appendChild(c.getGui()),this.addManagedListener(c,Ei.EVENT_CLOSE_MENU,h=>this.dispatchEvent(h)),c.addGuiEventListener("mouseenter",()=>this.cancelDeactivate()),r=()=>this.destroyBean(c),e&&(n=()=>{c.activateFirstItem(),this.subMenuIsOpening=!1})}const a=this.popupService.positionPopupForMenu.bind(this.popupService,{eventSource:this.eGui,ePopup:o}),l=this.localeService.getLocaleTextFunc(),d=this.popupService.addPopup({modal:!0,eChild:o,positionCallback:a,anchorToElement:this.eGui,ariaLabel:l("ariaLabelSubMenu","SubMenu"),afterGuiAttached:n});this.subMenuIsOpen=!0,this.setAriaExpanded(!0),this.hideSubMenu=()=>{var c,h;d&&d.hideFunc(),this.subMenuIsOpen=!1,this.setAriaExpanded(!1),r(),(h=(c=this.menuItemComp).setExpanded)==null||h.call(c,!1),this.eSubMenuGui=void 0},(i=(s=this.menuItemComp).setExpanded)==null||i.call(s,!0)}setAriaExpanded(e){this.suppressAria||ns(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(O({},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:Ei.EVENT_CLOSE_MENU};e&&(e instanceof MouseEvent?s.mouseEvent=e:s.keyboardEvent=e),this.dispatchEvent(s)}onItemActivated(){const e={type:Ei.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),Ei.ACTIVATION_DELAY):this.activate(!0)}onMouseLeave(){this.cancelActivate(),this.isSubMenuOpen()?this.deactivateTimeoutId=window.setTimeout(()=>this.deactivate(),Ei.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(a=>r.classList.add(a)),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"),Fu(r,this.level+1),this.params.disabled&&ka(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 us({getGui:()=>this.getGui(),getTooltipValue:()=>this.tooltip,getLocation:()=>"menu",shouldDisplayTooltip:s})))}destroy(){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),super.destroy()}};so.EVENT_CLOSE_MENU="closeMenu";so.EVENT_MENU_ITEM_ACTIVATED="menuItemActivated";so.ACTIVATION_DELAY=80;u([f("popupService")],so.prototype,"popupService",2);u([f("userComponentFactory")],so.prototype,"userComponentFactory",2);var Cr=so,gi=class ya extends K{constructor(e){super(ya.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:a=250,height:l,centered:d,popup:c,x:h,y:m}=this.config;this.positionableFeature=new Ki(this.getGui(),{minWidth:r,width:n,minHeight:a,height:l,centered:d,x:h,y:m,popup:c,calculateTopBuffer:()=>this.positionableFeature.getHeight()-this.getBodyHeight()}),this.createManagedBean(this.positionableFeature);const C=this.getGui();e&&this.setBodyComponent(e),i?Z(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()}),!(c&&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(ya.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 Qo(this.eContentWrapper)}getBodyWidth(){return ri(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&&pt(e)&&this.close(),super.destroy()}};gi.CLOSE_BTN_TEMPLATE='<div class="ag-button"></div>';u([N("eContentWrapper")],gi.prototype,"eContentWrapper",2);u([N("eTitleBar")],gi.prototype,"eTitleBar",2);u([N("eTitleBarButtons")],gi.prototype,"eTitleBarButtons",2);u([N("eTitle")],gi.prototype,"eTitle",2);u([M],gi.prototype,"postConstruct",1);var km=gi,Bm=class extends km{constructor(t){super(Ee(O({},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(){Z(this.maximizeIcon,!this.isMaximized),Z(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 Wm=0,as=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),a=s.clientWidth>0?s.clientWidth:200;s.style.minWidth=`${a}px`;const d=r.right-r.left-a;let c;this.gos.get("enableRtl")?(c=m(),c<0&&(c=h(),this.setAlignedStyles(s,"left")),c>d&&(c=0,this.setAlignedStyles(s,"right"))):(c=h(),c>d&&(c=m(),this.setAlignedStyles(s,"right")),c<0&&(c=0,this.setAlignedStyles(s,"left"))),s.style.left=`${c}px`,s.style.top=`${n}px`;function h(){return o.right-r.left-2}function m(){return o.left-r.left-a}}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:a="over",column:l,rowNode:d,type:c}=t,h=r.getBoundingClientRect(),m=this.getParentRect(),C=this.getPopupIndex(e);if(C!==-1){const S=this.popupList[C];S.alignedToElement=r}const v=()=>{let S=h.left-m.left;n==="right"&&(S-=e.offsetWidth-h.width);let w;return a==="over"?(w=h.top-m.top,this.setAlignedStyles(e,"over")):(this.setAlignedStyles(e,"under"),this.shouldRenderUnderOrAbove(e,h,m,t.nudgeY||0)==="under"?w=h.top-m.top+h.height:w=h.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(c,e,r,null,l,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,a={width:0,height:0},l=(d=!1)=>{let{x:c,y:h}=n();d&&e.clientWidth===a.width&&e.clientHeight===a.height||(a.width=e.clientWidth,a.height=e.clientHeight,i&&(c+=i),o&&(h+=o),s&&(c=this.keepXYWithinBounds(e,c,1),h=this.keepXYWithinBounds(e,h,0)),e.style.left=`${c}px`,e.style.top=`${h}px`,t.postProcessCallback&&t.postProcessCallback())};if(l(),!r){const d=this.resizeObserverService.observeResize(e,()=>l(!0));setTimeout(()=>d(),as.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),el(e)}keepXYWithinBounds(t,e,s){const i=s===0,o=i?"clientHeight":"clientWidth",r=i?"top":"left",n=i?"offsetHeight":"offsetWidth",a=i?"scrollTop":"scrollLeft",l=this.gos.getDocument(),d=l.documentElement,c=this.getPopupParent(),h=c.getBoundingClientRect(),m=l.documentElement.getBoundingClientRect(),C=c===l.body,v=t[n];let w=C?(i?Za:Do)(d)+d[a]:c[o];C&&(w-=Math.abs(m[r]-h[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 a=this.getPopupIndex(s);if(a!==-1)return{hideFunc:this.popupList[a].hideFunc};this.initialisePopupPosition(s);const l=this.createPopupWrapper(s,i,!!o),d=this.addEventListenersToPopup(Ee(O({},t),{wrapperEl:l}));return r&&r(),this.addPopupToPopupList(s,l,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:a,modal:l}=t;let d=!1;const c=v=>{if(!i.contains(this.gos.getActiveDomElement()))return;v.key===E.ESCAPE&&!Ht(v)&&C({keyboardEvent:v})},h=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",c),e.removeEventListener("mousedown",h),e.removeEventListener("touchstart",m),e.removeEventListener("contextmenu",h),this.eventService.removeEventListener(p.EVENT_DRAG_STARTED,h),r&&r(S||w||R),this.removePopupFromPopupList(o))};return n&&n({hidePopup:C}),window.setTimeout(()=>{a&&e.addEventListener("keydown",c),l&&(e.addEventListener("mousedown",h),this.eventService.addEventListener(p.EVENT_DRAG_STARTED,h),e.addEventListener("touchstart",m),e.addEventListener("contextmenu",h))},0),C}addPopupToPopupList(t,e,s,i){this.popupList.push({element:t,wrapper:e,hideFunc:s,instanceId:Wm++,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,a=s.left-r.left;let l=n,d=a;const c=o.style.top,h=parseInt(c.substring(0,c.length-1),10),m=o.style.left,C=parseInt(m.substring(0,m.length-1),10);return new Ne(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!=l){const T=this.keepXYWithinBounds(o,h+n-y,0);o.style.top=`${T}px`}l=y;const b=S.left-w.left;if(b!=d){const T=this.keepXYWithinBounds(o,C+a-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 a=this.popupList[n];if(Mr(a.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 a=s.indexOf(n),l=n.querySelectorAll("div"),d=[];for(l.forEach(c=>{c.scrollTop!==0&&d.push([c,c.scrollTop])}),r?n.classList.contains("ag-always-on-top")?a!==i-1&&ie(o).insertAdjacentElement("afterend",n):a!==i-r-1&&o[0].insertAdjacentElement("beforebegin",n):a!==i-1&&ie(s).insertAdjacentElement("afterend",n);d.length;){const c=d.pop();c[0].scrollTop=c[1]}}};as.WAIT_FOR_POPUP_CONTENT_RESIZE=200;u([f("focusService")],as.prototype,"focusService",2);u([f("ctrlsService")],as.prototype,"ctrlsService",2);u([f("resizeObserverService")],as.prototype,"resizeObserverService",2);u([M],as.prototype,"postConstruct",1);as=u([G("popupService")],as);var Um=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=Ie(this.value.slice(0,i)),n=Ie(this.value.slice(i,o)),a=Ie(this.value.slice(o));this.getGui().lastElementChild.innerHTML=`${r}<b>${n}</b>${a}`}}!s&&this.hasHighlighting&&(this.hasHighlighting=!1,this.render())}render(){var t;this.getGui().lastElementChild.innerHTML=(t=Ie(this.value))!=null?t:"&nbsp;"}},Fn=class Sh extends li{constructor(e){super(Sh.TEMPLATE),this.params=e,this.searchString=""}destroy(){super.destroy()}init(){this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList=this.createManagedBean(new Ch({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(a=>{const d=a.toLocaleLowerCase().indexOf(r),c=d===0,h=d>=0;return h&&(!i||!o&&c||o===c&&a.length<i.length)&&(i=a,o=c),h});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 c;return(c=d.displayValue)!=null?c:d.key});let r,n;if(this.params.useFuzzySearch)r=Jo(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 a=i.filter(({key:d,displayValue:c})=>r.includes(c??d));if(!a.length&&this.selectedValue&&((s=(e=this.params)==null?void 0:e.forceLastSelection)!=null&&s.call(e,this.selectedValue,this.searchString))&&(a=[this.selectedValue]),this.autocompleteEntries=a,this.virtualList.refresh(),!n)return;const l=r.indexOf(n);this.checkSetSelectedValue(l)}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 Um;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}};Fn.TEMPLATE=`<div class="ag-autocomplete-list-popup">
271
+ <div ref="eList" class="ag-autocomplete-list"></div>
272
+ <div>`;u([N("eList")],Fn.prototype,"eList",2);u([M],Fn.prototype,"init",1);var zm=Fn,Fs=class go 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=qt(e);this.updateValue(s),this.updateAutocompleteList(s)}updateValue(e){this.updateLastPosition(),this.dispatchEvent({type:go.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:a}=this.autocompleteListParams;this.autocompleteList.setSearch(a??"")}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:go.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:go.EVENT_VALID_CHANGED,isValid:this.valid,validationMessage:this.validationMessage}))}openList(){this.isListOpen=!0,this.autocompleteList=this.createBean(new zm({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:go.EVENT_VALUE_CONFIRMED,value:this.getValue(),isValid:this.isValid()})}getValue(){return qt(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}};Fs.EVENT_VALUE_CHANGED="eventValueChanged";Fs.EVENT_VALUE_CONFIRMED="eventValueConfirmed";Fs.EVENT_OPTION_SELECTED="eventOptionSelected";Fs.EVENT_VALID_CHANGED="eventValidChanged";u([f("popupService")],Fs.prototype,"popupService",2);u([N("eAutocompleteInput")],Fs.prototype,"eAutocompleteInput",2);u([M],Fs.prototype,"postConstruct",1);var Km=Fs,Ls=class br 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:br.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 Y.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(){Z(this.eButton,this.isRemovable())}setupRemove(){this.refreshRemove();const e={type:br.EVENT_COLUMN_REMOVE};this.addGuiEventListener("keydown",i=>this.onKeyDown(i)),this.addManagedListener(this.eButton,"click",i=>{this.dispatchEvent(e),i.stopPropagation()});const s=new We(this.eButton);this.addManagedListener(s,We.EVENT_TAP,()=>{this.dispatchEvent(e)}),this.addDestroyFunc(s.destroy.bind(s))}onKeyDown(e){e.key===E.DELETE&&this.isRemovable()&&(e.preventDefault(),this.dispatchEvent({type:br.EVENT_COLUMN_REMOVE}))}getDisplayValue(){return this.getDisplayName()}setTextValue(){const e=this.getDisplayValue(),s=Ie(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}};Ls.EVENT_COLUMN_REMOVE="columnRemove";Ls.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")],Ls.prototype,"dragAndDropService",2);u([N("eText")],Ls.prototype,"eText",2);u([N("eDragHandle")],Ls.prototype,"eDragHandle",2);u([N("eButton")],Ls.prototype,"eButton",2);u([M],Ls.prototype,"init",1);var $m=Ls,ur=class Kt extends K{constructor(e){super('<div class="ag-unselectable" role="presentation"></div>'),this.horizontal=e,this.state=Kt.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,Fe(this.getGui()),Fe(this.ePillDropList)}init(e){this.params=e??{},this.createManagedBean(new Ts(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.setupDropTarget(),this.positionableFeature=new Ki(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===Kt.STATE_NOT_DRAGGING&&(this.state=Kt.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=Kt.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=Kt.STATE_NOT_DRAGGING;return}this.handleDragEnterEnd(e),this.checkInsertIndex(e),this.refreshGui()}}isPotentialDndItems(){return au(this.potentialDndItems)}handleDragLeaveEnd(e){}onDragLeave(e){if(this.state===Kt.STATE_REARRANGE_ITEMS){const s=this.getItems(e.dragSource.getDragItem());this.removeItems(s)}this.isPotentialDndItems()&&(this.handleDragLeaveEnd(e),this.potentialDndItems=[],this.refreshGui()),this.state=Kt.STATE_NOT_DRAGGING}refreshOnDragStop(){return!0}onDragStop(){if(this.isPotentialDndItems()){let e=!1;this.state===Kt.STATE_NEW_ITEMS_IN?(this.addItems(this.potentialDndItems),e=!0):e=this.rearrangeItems(this.potentialDndItems),this.potentialDndItems=[],(this.refreshOnDragStop()||!e)&&this.refreshGui()}this.state=Kt.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);oa(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 oa(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();sn(i,s+1),tn(i,this.childPillComponents.length)})}createItemComponent(e,s){const i=this.createPillComponent(e,this.dropTarget,s,this.horizontal);return i.addEventListener($m.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(qo(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)}}};ur.STATE_NOT_DRAGGING="notDragging";ur.STATE_NEW_ITEMS_IN="newItemsIn";ur.STATE_REARRANGE_ITEMS="rearrangeItems";u([f("focusService")],ur.prototype,"focusService",2);u([f("dragAndDropService")],ur.prototype,"dragAndDropService",2);var Ym=["touchstart","touchend","touchmove","touchcancel"],Eh=class{constructor(t="javascript"){this.frameworkName=t,this.renderingEngine="vanilla",this.wrapIncoming=e=>e(),this.wrapOutgoing=e=>e()}setInterval(t,e){return new Ne(s=>{s(window.setInterval(t,e))})}addEventListener(t,e,s,i){const o=wt(Ym,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}`:""}`}},Es=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 a=this.columnModel.getAllDisplayedColumns(),l=this.gos.get("enableRtl");n=e.rowIndex,r=o!==l?a[0]:ie(a)}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(a=>a.getRowNode().rowIndex===t.rowIndex);let i=[];s?i=[...this.rowRenderer.getStickyTopRowCtrls()].sort((a,l)=>a.getRowNode().rowIndex-l.getRowNode().rowIndex):i=[...this.rowRenderer.getStickyBottomRowCtrls()].sort((a,l)=>l.getRowNode().rowIndex-a.getRowNode().rowIndex);const o=e?-1:1,r=i.findIndex(a=>a.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(U(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(U(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")],Es.prototype,"columnModel",2);u([f("rowModel")],Es.prototype,"rowModel",2);u([f("rowRenderer")],Es.prototype,"rowRenderer",2);u([f("pinnedRowModel")],Es.prototype,"pinnedRowModel",2);u([f("paginationProxy")],Es.prototype,"paginationProxy",2);Es=u([G("cellNavigationService")],Es);var Js=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){Vs("alignedGrids contains an undefined option."),s||Vs(`You may want to configure via a callback to avoid setup race conditions:
280
+ "alignedGrids: () => [linkedGrid]"`),Vs(i());return}if(r instanceof X)return r;const a=r;return"current"in a?(n=a.current)==null?void 0:n.api:(a.api||Vs(`alignedGrids - No api found on the linked grid. If you are passing gridOptions to alignedGrids since v31 this is no longer valid. ${i()}`),a.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,h=t.api.getColumnState().map(m=>({colId:m.colId}));this.columnModel.applyColumnState({state:h,applyOrder:!0},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${t.type} toIndex = ${d.toIndex}`)}break;case p.EVENT_COLUMN_VISIBLE:{const d=t,h=t.api.getColumnState().map(m=>({colId:m.colId,hide:m.hide}));this.columnModel.applyColumnState({state:h},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${t.type} visible = ${d.visible}`)}break;case p.EVENT_COLUMN_PINNED:{const d=t,h=t.api.getColumnState().map(m=>({colId:m.colId,pinned:m.pinned}));this.columnModel.applyColumnState({state:h},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${t.type} pinned = ${d.pinned}`)}break;case p.EVENT_COLUMN_RESIZED:const a=t,l={};o.forEach(d=>{this.logger.log(`onColumnEvent-> processing ${t.type} actualWidth = ${d.getActualWidth()}`),l[d.getId()]={key:d.getColId(),newWidth:d.getActualWidth()}}),(e=a.flexColumns)==null||e.forEach(d=>{l[d.getId()]&&delete l[d.getId()]}),this.columnModel.setColumnWidths(Object.values(l),!1,a.finished,"alignedGridChanged");break}const n=this.ctrlsService.getGridBodyCtrl().isVerticalScrollShowing();this.getAlignedGridApis().forEach(a=>{a.setGridOption("alwaysShowVerticalScroll",n)})}};u([f("columnModel")],Js.prototype,"columnModel",2);u([f("ctrlsService")],Js.prototype,"ctrlsService",2);u([Ot(0,Tt("loggerFactory"))],Js.prototype,"setBeans",1);u([M],Js.prototype,"init",1);Js=u([G("alignedGridsService")],Js);var Zs=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:a,source:l="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,c=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(l==="checkboxSelected"&&s===!1&&this.lastRowNode&&(this.lastRowNode.id?m=this.lastRowNode:this.lastRowNode=null),m==null&&(m=this.getLastSelectedNode()),m){const C=c[0];if(C!==m&&this.isMultiselect())return this.selectRange(C,m,s,l)}}this.lastRowNode=s?null:c[0];let h=0;for(let m=0;m<c.length;m++){const C=c[m];d&&C.group||C.selectThisNode(s,a,l)&&h++,this.groupSelectsChildren&&((e=C.childrenAfterGroup)!=null&&e.length)&&(h+=this.selectChildren(C,s,d,l))}if(!o&&(s&&(i||!this.isMultiselect())&&(h+=this.clearOtherNodes(c[0],l)),h>0)){this.updateGroupsFromChildrenSelections(l);const C={type:p.EVENT_SELECTION_CHANGED,source:l};this.eventService.dispatchEvent(C)}return h}selectRange(t,e,s=!0,i){const o=this.rowModel.getNodesInRangeForSelection(t,e);let r=0;o.forEach(a=>{if(a.group&&this.groupSelectsChildren)return;a.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 U(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 An(!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 a=o[r];if(a.isSelected())s.push(a);else{const l=a;l.group&&l.children&&i(l.children)}}}return i(e),s}isEmpty(){let t=0;return this.selectedNodes.forEach(e=>{e&&t++}),t===0}deselectAllRowNodes(t){const e=a=>a.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(a=>{a&&e(a)}),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 a;s.push(n),(a=n.childrenAfterFilter)!=null&&a.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")],Zs.prototype,"rowModel",2);u([f("paginationProxy")],Zs.prototype,"paginationProxy",2);u([M],Zs.prototype,"init",1);Zs=u([G("selectionService")],Zs);var Oi=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")],Oi.prototype,"api",2);Oi=u([G("columnApi")],Oi);var ys=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(),a=e.data;let l;const d=e.groupData&&e.groupData[n]!==void 0,c=!i&&e.aggData&&e.aggData[n]!==void 0,h=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?l=this.executeFilterValueGetter(o.filterValueGetter,a,t,e):this.isTreeData&&c?l=e.aggData[n]:this.isTreeData&&o.valueGetter?l=this.executeValueGetter(o.valueGetter,a,t,e):this.isTreeData&&r&&a?l=Ti(a,r,t.isFieldContainsDots()):d?l=e.groupData[n]:c?l=e.aggData[n]:o.valueGetter?l=this.executeValueGetter(o.valueGetter,a,t,e):m?l=Ti(a,e.field,t.isFieldContainsDots()):r&&a&&!h&&(l=Ti(a,r,t.isFieldContainsDots())),this.cellExpressions&&typeof l=="string"&&l.indexOf("=")===0){const C=l.substring(1);l=this.executeValueGetter(C,a,t,e)}if(l==null){const C=this.getOpenedGroup(e,t);if(C!=null)return C}return l}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 a=t.getColDef();if(i?n=i:o&&(n=a.valueFormatter),n){const l=this.gos.addGridCommonParams({value:s,node:e,data:e?e.data:null,colDef:a,column:t});typeof n=="function"?r=n(l):r=this.expressionService.evaluate(n,l)}else if(a.refData)return a.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;U(t.data)&&(t.data={});const{field:r,valueSetter:n}=o.getColDef();if(U(r)&&U(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 a=this.gos.addGridCommonParams({node:t,data:t.data,oldValue:this.getValue(o,t),newValue:s,colDef:o.getColDef(),column:o});a.newValue=s;let l;if(P(n)?typeof n=="function"?l=n(a):l=this.expressionService.evaluate(n,a):l=this.setValueUsingField(t.data,r,s,o.isFieldContainsDots()),l===void 0&&(l=!0),!l)return!1;t.resetQuickFilterAggregateText(),this.valueCache.onDataChanged(),a.newValue=this.getValue(o,t);const d={type:p.EVENT_CELL_VALUE_CHANGED,event:null,rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:a.column,api:a.api,columnApi:a.columnApi,colDef:a.colDef,context:a.context,data:t.data,node:t,oldValue:a.oldValue,newValue:a.newValue,value:a.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 a=r.shift();r.length===0?(o=n[a]===s,o||(n[a]=s)):n=n[a]}}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 a;return typeof t=="function"?a=t(n):a=this.expressionService.evaluate(t,n),this.valueCache.setValue(i,o,a),a}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")],ys.prototype,"expressionService",2);u([f("columnModel")],ys.prototype,"columnModel",2);u([f("valueCache")],ys.prototype,"valueCache",2);u([f("dataTypeService")],ys.prototype,"dataTypeService",2);u([M],ys.prototype,"init",1);ys=u([G("valueService")],ys);var Hr=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([Ot(0,Tt("loggerFactory"))],Hr.prototype,"setBeans",1);Hr=u([G("expressionService")],Hr);var kr=class extends L{setBeans(t){this.logging=t.get("debug")}create(t){return new Ll(t,this.isLogging.bind(this))}isLogging(){return this.logging}};u([Ot(0,Tt("gridOptionsService"))],kr.prototype,"setBeans",1);kr=u([G("loggerFactory")],kr);var Ll=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)}},Ms=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:()=>Y.ICON_NOT_ALLOWED}),this.mouseEventService.stampTopLevelGridCompWithGridInstance(e),this.createManagedBean(new vn(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")],Ms.prototype,"focusService",2);u([f("resizeObserverService")],Ms.prototype,"resizeObserverService",2);u([f("columnModel")],Ms.prototype,"columnModel",2);u([f("ctrlsService")],Ms.prototype,"ctrlsService",2);u([f("mouseEventService")],Ms.prototype,"mouseEventService",2);u([f("dragAndDropService")],Ms.prototype,"dragAndDropService",2);var cr=class extends ar{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 Ms);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=>pt(s))}};u([f("loggerFactory")],cr.prototype,"loggerFactory",2);u([N("gridBody")],cr.prototype,"gridBodyComp",2);u([N("sideBar")],cr.prototype,"sideBarComp",2);u([N("rootWrapperBody")],cr.prototype,"eRootWrapperBody",2);u([M],cr.prototype,"postConstruct",1);var ei=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 l=this.columnModel.getSourceColumnsForGroupColumn(t),d=l==null?void 0:l.filter(c=>c.isSortable());d&&(r=[t,...d])}r.forEach(l=>l.setSort(e,i));const n=(s||this.gos.get("alwaysMultiSort"))&&!this.gos.get("suppressMultiSort"),a=[];if(!n){const l=this.clearSortBarTheseColumns(r,i);a.push(...l)}this.updateSortIndex(t),a.push(...r),this.dispatchSortChangedEvents(i,a)}updateSortIndex(t){const e=this.gos.isColumnsSortingCoupledToGroup(),s=this.columnModel.getGroupDisplayColumnForGroup(t.getId()),i=e&&s||t,o=this.getColumnsWithSortingOrdered();this.columnModel.getPrimaryAndSecondaryAndAutoColumns().forEach(a=>a.setSortIndex(null));const r=o.filter(a=>e&&a.getColDef().showRowGroup?!1:a!==i);(i.getSort()?[...r,i]:r).forEach((a,l)=>{a.setSortIndex(l)})}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=ei.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],ei.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 a=!!n.getAggFunc(),l=!n.isPrimary(),d=r?this.columnModel.getGroupDisplayColumnForGroup(n.getId()):n.getColDef().showRowGroup;return a||l||d})}const e=this.columnModel.getRowGroupColumns().filter(r=>!!r.getSort()),s={};t.forEach((r,n)=>s[r.getId()]=n),t.sort((r,n)=>{const a=r.getSortIndex(),l=n.getSortIndex();if(a!=null&&l!=null)return a-l;if(a==null&&l==null){const d=s[r.getId()],c=s[n.getId()];return d>c?1:-1}else return l==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)}};ei.DEFAULT_SORTING_ORDER=["asc","desc",null];u([f("columnModel")],ei.prototype,"columnModel",2);ei=u([G("sortController")],ei);var pe=class extends L{static addKeyboardModeEvents(t){this.instanceCount>0||(t.addEventListener("keydown",pe.toggleKeyboardMode),t.addEventListener("mousedown",pe.toggleKeyboardMode))}static removeKeyboardModeEvents(t){this.instanceCount>0||(t.addEventListener("keydown",pe.toggleKeyboardMode),t.addEventListener("mousedown",pe.toggleKeyboardMode))}static toggleKeyboardMode(t){const e=pe.keyboardModeActive,s=t.type==="keydown";s&&(t.ctrlKey||t.metaKey||t.altKey)||e!==s&&(pe.keyboardModeActive=s)}static unregisterGridCompController(t){pe.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();pe.addKeyboardModeEvents(t),pe.instanceCount++,this.addDestroyFunc(()=>{pe.instanceCount--,pe.unregisterGridCompController(t)})}onColumnEverythingChanged(){if(!this.focusedCellPosition)return;const t=this.focusedCellPosition.column,e=this.columnModel.getGridColumn(t.getId());t!==e&&this.clearFocusedCell()}isKeyboardMode(){return pe.keyboardModeActive}getFocusCellToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedCellPosition||this.isDomDataMissingInHierarchy(this.gos.getActiveDomElement(),zs.DOM_DATA_KEY_ROW_CTRL)?null:this.focusedCellPosition}getFocusHeaderToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedHeaderPosition||this.isDomDataMissingInHierarchy(this.gos.getActiveDomElement(),Rn.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=O({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:qt(i),column:n}:null;const a=Ee(O({type:p.EVENT_CELL_FOCUSED},this.getFocusEventParams()),{forceBrowserFocus:o,preventScrollOnBrowserFocus:r,floating:null});this.eventService.dispatchEvent(a)}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:a}=t;if(r&&this.filterManager.isAdvancedFilterHeaderActive())return this.focusAdvancedFilter(a);if(i){const l=this.getFocusedHeader(),d=this.headerNavigationService.getHeaderRowCount();if(s){const c=this.gos.getCallback("tabToNextHeader");c&&(a=this.getHeaderPositionFromUserFunc({userFunc:c,direction:e,currentPosition:l,headerPosition:a,headerRowCount:d}))}else{const c=this.gos.getCallback("navigateToNextHeader");if(c&&o){const h={key:o.key,previousHeaderPosition:l,nextHeaderPosition:a,headerRowCount:d,event:o};a=c(h)}}}return a?this.focusProvidedHeaderPosition({headerPosition:a,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(),a=this.getHeaderPositionFromUserFunc({userFunc:e,direction:i,currentPosition:r,headerPosition:s,headerRowCount:n});return!!a&&this.focusProvidedHeaderPosition({headerPosition:a,direction:i,event:o})}getHeaderPositionFromUserFunc(t){const{userFunc:e,direction:s,currentPosition:i,headerPosition:o,headerRowCount:r}=t,a=e({backwards:s==="Before",previousHeaderPosition:i,nextHeaderPosition:o,headerRowCount:r});return a===!0||a===null?(a===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):a===!1?null:a}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 a=this.ctrlsService.getHeaderRowContainerCtrl(e.column.getPinned()).focusHeader(e.headerRowIndex,e.column,r);return a&&(o!=null||i)&&this.headerNavigationService.setCurrentHeaderRowWithoutSpan(o??-1),a}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===qt(e)}findFocusableElements(t,e,s=!1){const i=Yu;let o=Xa;e&&(o+=", "+e),s&&(o+=', [tabindex="-1"]');const r=Array.prototype.slice.apply(t.querySelectorAll(i)).filter(l=>pt(l)),n=Array.prototype.slice.apply(t.querySelectorAll(o));return n.length?((l,d)=>l.filter(c=>d.indexOf(c)===-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(a=>a.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(`.${Ts.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&&Nr(t)===null&&++s<=e;)t=t.parentElement;return Nr(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:qt(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}};pe.keyboardModeActive=!1;pe.instanceCount=0;u([f("eGridDiv")],pe.prototype,"eGridDiv",2);u([f("columnModel")],pe.prototype,"columnModel",2);u([f("headerNavigationService")],pe.prototype,"headerNavigationService",2);u([f("headerPositionUtils")],pe.prototype,"headerPositionUtils",2);u([f("rowRenderer")],pe.prototype,"rowRenderer",2);u([f("rowPositionUtils")],pe.prototype,"rowPositionUtils",2);u([f("cellPositionUtils")],pe.prototype,"cellPositionUtils",2);u([f("navigationService")],pe.prototype,"navigationService",2);u([f("ctrlsService")],pe.prototype,"ctrlsService",2);u([f("filterManager")],pe.prototype,"filterManager",2);u([de("rangeService")],pe.prototype,"rangeService",2);u([de("advancedFilterService")],pe.prototype,"advancedFilterService",2);u([M],pe.prototype,"init",1);pe=u([G("focusService")],pe);var Ra=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}};Ra=u([G("columnHoverService")],Ra);var Oo=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")],Oo.prototype,"ctrlsService",2);u([M],Oo.prototype,"postConstruct",1);Oo=u([G("columnAnimationService")],Oo);var _i=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?Ze(()=>e(),50)():(e(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}};u([f("ctrlsService")],_i.prototype,"ctrlsService",2);u([f("paginationProxy")],_i.prototype,"paginationProxy",2);u([M],_i.prototype,"postConstruct",1);_i=u([G("paginationAutoPageSizeService")],_i);var Br=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],Br.prototype,"init",1);Br=u([G("valueCache")],Br);var jm="paste",Vi=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!==jm&&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 An(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")],Vi.prototype,"rowModel",2);u([f("rowRenderer")],Vi.prototype,"rowRenderer",2);u([M],Vi.prototype,"init",1);Vi=u([G("changeDetectionService")],Vi);var Wr=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")],Wr.prototype,"componentMetadataProvider",2);Wr=u([G("agComponentUtils")],Wr);var _o=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")],_o.prototype,"agComponentUtils",2);u([M],_o.prototype,"postConstruct",1);_o=u([G("componentMetadataProvider")],_o);var qm=25,dd=10,Kn=8,Qm=4,$n=4,Yn=6,Xm=16,ud=14,jn=8,Jm={"ag-theme-custom":{headerHeight:25,headerCellMinWidth:24,listItemHeight:Qm*5,rowHeight:25,chartMenuPanelWidth:220},"ag-theme-material":{headerHeight:Kn*7,headerCellMinWidth:48,listItemHeight:Kn*4,rowHeight:Kn*6,chartMenuPanelWidth:240},"ag-theme-balham":{headerHeight:$n*8,headerCellMinWidth:24,listItemHeight:$n*6,rowHeight:$n*7,chartMenuPanelWidth:220},"ag-theme-alpine":{headerHeight:Yn*8,headerCellMinWidth:36,listItemHeight:Yn*4,rowHeight:Yn*7,chartMenuPanelWidth:240},"ag-theme-quartz":{headerHeight:ud+jn*4.25,headerCellMinWidth:36,listItemHeight:Xm+jn,rowHeight:ud+jn*3.5,chartMenuPanelWidth:260}},cd={headerHeight:["ag-header-row"],headerCellMinWidth:["ag-header-cell"],listItemHeight:["ag-virtual-list-item"],rowHeight:["ag-row"],chartMenuPanelWidth:["ag-chart-docked-container"]},Vo=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=Jm[i][t],r=this.gos.getDocument();if(s||(s=this.eGridDiv),!cd[t])return o;const n=cd[t],a=r.createElement("div"),l=Array.from(s.classList);a.classList.add(e,...l),a.style.position="absolute";const d=n.reduce((h,m)=>{const C=r.createElement("div");return C.style.position="static",C.classList.add(m),h.appendChild(C),C},a);let c=0;if(r.body){r.body.appendChild(a);const h=t.toLowerCase().indexOf("height")!==-1?"height":"width";c=parseInt(window.getComputedStyle(d)[h],10),r.body.removeChild(a)}return c||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(qm,"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,dd):dd}destroy(){this.calculatedSizes=null,this.mutationObserver&&this.mutationObserver.disconnect(),super.destroy()}};u([f("eGridDiv")],Vo.prototype,"eGridDiv",2);u([M],Vo.prototype,"postConstruct",1);Vo=u([G("environment")],Vo);var Hi=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=Vu(),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")],Hi.prototype,"ctrlsService",2);u([Ot(0,Tt("loggerFactory"))],Hi.prototype,"agWire",1);u([M],Hi.prototype,"postConstruct",1);Hi=u([G("rowContainerHeightService")],Hi);var ki=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=a=>{if(t&&!a.group)return;if(o&&a.group){const d=a.childrenAfterGroup.some(c=>c.selectable===!0);a.setRowSelectable(d,!0);return}const l=s?s(a):!0;a.setRowSelectable(l,!0),!l&&a.isSelected()&&r.push(a)};if(o){const a=this.rowModel;new An(!1,a.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 Zs&&this.selectionService.updateGroupsFromChildrenSelections("selectableChanged")}};u([f("rowModel")],ki.prototype,"rowModel",2);u([f("selectionService")],ki.prototype,"selectionService",2);u([M],ki.prototype,"init",1);ki=u([G("selectableService")],ki);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 Qa(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"),a=t("lastPage","Last Page"),l=this.getCompId();return`<div class="ag-paging-panel ag-unselectable" id="ag-${l}">
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-${l}-first-row" ref="lbFirstRowOnPage" class="ag-paging-row-summary-panel-number"></span>
293
+ <span id="ag-${l}-to">${s}</span>
294
+ <span id="ag-${l}-last-row" ref="lbLastRowOnPage" class="ag-paging-row-summary-panel-number"></span>
295
+ <span id="ag-${l}-of">${i}</span>
296
+ <span id="ag-${l}-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-${l}-start-page">${e}</span>
303
+ <span id="ag-${l}-start-page-number" ref="lbCurrent" class="ag-paging-number"></span>
304
+ <span id="ag-${l}-of-page">${i}</span>
305
+ <span id="ag-${l}-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="${a}"></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){ka(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([N("btFirst")],ft.prototype,"btFirst",2);u([N("btPrevious")],ft.prototype,"btPrevious",2);u([N("btNext")],ft.prototype,"btNext",2);u([N("btLast")],ft.prototype,"btLast",2);u([N("lbRecordCount")],ft.prototype,"lbRecordCount",2);u([N("lbFirstRowOnPage")],ft.prototype,"lbFirstRowOnPage",2);u([N("lbLastRowOnPage")],ft.prototype,"lbLastRowOnPage",2);u([N("lbCurrent")],ft.prototype,"lbCurrent",2);u([N("lbTotal")],ft.prototype,"lbTotal",2);u([N("pageSizeComp")],ft.prototype,"pageSizeComp",2);u([M],ft.prototype,"postConstruct",1);var hr=class yh extends K{constructor(){super(yh.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 vn(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),Fe(this.eOverlayWrapper))}hideOverlay(){this.destroyActiveOverlay(),this.setDisplayed(!1,{skipAriaHidden:!0})}destroy(){this.destroyActiveOverlay(),super.destroy()}};hr.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")],hr.prototype,"overlayService",2);u([N("eOverlayWrapper")],hr.prototype,"eOverlayWrapper",2);u([M],hr.prototype,"postConstruct",1);var Zm=hr,Bi=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")],Bi.prototype,"rowModel",2);u([f("pinnedRowModel")],Bi.prototype,"pinnedRowModel",2);u([f("paginationProxy")],Bi.prototype,"paginationProxy",2);Bi=u([G("rowPositionUtils")],Bi);var ba=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}};ba=u([G("cellPositionUtils")],ba);var fo=class{constructor(t){this.cellValueChanges=t}},qn=class extends fo{constructor(t,e,s,i){super(t),this.initialRange=e,this.finalRange=s,this.ranges=i}},Rh=class bh{constructor(e){this.actionStack=[],this.maxStackSize=e||bh.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}};Rh.DEFAULT_STACK_SIZE=10;var hd=Rh,Zt=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:a,oldValue:l,value:d}=t,c={rowPinned:r,rowIndex:n,columnId:a.getColId(),newValue:d,oldValue:l};this.cellValueChanges.push(c)},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 hd(t),this.redoStack=new hd(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 qn?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,a={rowIndex:o,rowPinned:r},l=this.rowPositionUtils.getRowNode(a);l.displayed&&l.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 a={rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,rowEndIndex:n.rowIndex,rowEndPinned:n.rowPinned,columnStart:i.startColumn,columns:i.columns};t.addCellRange(a)})}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 a={rowIndex:s,column:n,rowPinned:o};this.focusService.setFocusedCell(Ee(O({},a),{forceBrowserFocus:!0})),e==null||e.setRangeToCell(a)}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 fo(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 fo(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 fo(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 qn(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 qn(this.cellValueChanges,void 0,void 0,[...this.rangeService.getCellRanges()]):t=new fo(this.cellValueChanges),this.pushActionsToUndoStack(t),this.isRangeInAction=!1})}pushActionsToUndoStack(t){this.undoStack.push(t),this.cellValueChanges=[],this.redoStack.clear()}};u([f("focusService")],Zt.prototype,"focusService",2);u([f("ctrlsService")],Zt.prototype,"ctrlsService",2);u([f("cellPositionUtils")],Zt.prototype,"cellPositionUtils",2);u([f("rowPositionUtils")],Zt.prototype,"rowPositionUtils",2);u([f("columnModel")],Zt.prototype,"columnModel",2);u([de("rangeService")],Zt.prototype,"rangeService",2);u([M],Zt.prototype,"init",1);Zt=u([G("undoRedoService")],Zt);var Ho=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 a=[s];for(;s.getParent();)s=s.getParent(),a.push(s);s=a[a.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,a=n;if(o&&this.isAnyChildSpanningHeaderHeight(t.getParent())){for(;r&&r.isPadding();)r=r.getParent(),n--;a=n,n<0&&(r=t,n=e,a=void 0)}return{column:r,headerRowIndex:n,headerRowIndexWithoutSpan:a}}getColumnVisibleChild(t,e,s="After"){const i=this.getHeaderRowType(e);let o=t,r=e+1,n=r;if(i==="group"){const a=t.getDisplayedLeafColumns(),l=s==="After"?a[0]:ie(a),d=[];let c=l;for(;c.getParent()!==t;)c=c.getParent(),d.push(c);if(o=l,l.isSpanHeaderHeight())for(let h=d.length-1;h>=0;h--){const m=d[h];if(!m.isPadding()){o=m;break}r++}else o=ie(d),o||(o=l)}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")],Ho.prototype,"columnModel",2);u([f("ctrlsService")],Ho.prototype,"ctrlsService",2);Ho=u([G("headerPositionUtils")],Ho);var Ta=class{buildColumnDefs(t,e,s){const i=[],o={};return t.forEach(r=>{const n=this.createDefFromColumn(r,e,s);let a=!0,l=n,d=r.getOriginalParent(),c=null;for(;d;){let h=null;if(d.isPadding()){d=d.getOriginalParent();continue}const m=o[d.getGroupId()];if(m){m.children.push(l),a=!1;break}if(h=this.createDefFromGroup(d),h&&(h.children=[l],o[h.groupId]=h,l=h,d=d.getOriginalParent()),d!=null&&c===d){a=!1;break}c=d}a&&i.push(l)}),i}createDefFromGroup(t){const e=Pr(t.getColGroupDef(),["children"]);return e&&(e.groupId=t.getGroupId()),e}createDefFromColumn(t,e,s){const i=Pr(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}};Ta=u([G("columnDefFactory")],Ta);var ko=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"),na(e,this.processClassesFromGridOptions(t.rowNode)),na(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")],ko.prototype,"stylingService",2);u([f("gridOptionsService")],ko.prototype,"gos",2);ko=u([G("rowCssClassCalculator")],ko);var Wi=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 a=t[r],l=a.sort==="desc",d=this.getValue(i,a.column),c=this.getValue(o,a.column);let h;const m=this.getComparator(a,i);if(m?h=m(d,c,i,o,l):h=W.defaultComparator(d,c,this.isAccentedSort),!isNaN(h)&&h!==0)return a.sort==="asc"?h:h*-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 a=(s=t.allLeafChildren)==null?void 0:s[0];return a?this.valueService.getValue(e,a,!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")],Wi.prototype,"valueService",2);u([f("columnModel")],Wi.prototype,"columnModel",2);u([M],Wi.prototype,"init",1);Wi=u([G("rowNodeSorter")],Wi);var $s=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}}};$s.NAME="ctrlsService";$s=u([G($s.NAME)],$s);var Da=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}};Da=u([G("ctrlsFactory")],Da);var fi=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",Ya()||ds())}initialiseInvisibleScrollbar(){this.invisibleScrollbar===void 0&&(this.invisibleScrollbar=qa(),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();xa(()=>pt(e),()=>this.setScrollPosition(t),100)}getViewport(){return this.eViewport}getContainer(){return this.eContainer}onScrollCallback(t){this.addManagedListener(this.getViewport(),"scroll",t)}};u([N("eViewport")],fi.prototype,"eViewport",2);u([N("eContainer")],fi.prototype,"eContainer",2);u([f("scrollVisibleService")],fi.prototype,"scrollVisibleService",2);u([f("ctrlsService")],fi.prototype,"ctrlsService",2);u([f("animationFrameService")],fi.prototype,"animationFrameService",2);var mi=class Th extends fi{constructor(){super(Th.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 Yi(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),Pt(this.eRightSpacer,s),this.eRightSpacer.classList.toggle("ag-scroller-corner",s<=o);let r=this.columnModel.getDisplayedColumnsLeftWidth();this.enableRtl&&e&&(r+=o),Pt(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),Ws(this.getGui(),n),Ws(this.eViewport,n),Ws(this.eContainer,n),this.setDisplayed(e,{skipAriaHidden:!0})}getScrollPosition(){return Po(this.getViewport(),this.enableRtl)}setScrollPosition(e){pt(this.getViewport())||this.attemptSettingScrollPosition(e),Fo(this.getViewport(),e,this.enableRtl)}};mi.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([N("eLeftSpacer")],mi.prototype,"eLeftSpacer",2);u([N("eRightSpacer")],mi.prototype,"eRightSpacer",2);u([f("columnModel")],mi.prototype,"columnModel",2);u([f("pinnedRowModel")],mi.prototype,"pinnedRowModel",2);u([M],mi.prototype,"postConstruct",1);var eC=mi,Bo=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")],Bo.prototype,"columnModel",2);u([M],Bo.prototype,"postConstruct",1);Bo=u([G("pinnedWidthService")],Bo);var Ui=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")],Ui.prototype,"animationFrameService",2);u([f("rowModel")],Ui.prototype,"rowModel",2);u([M],Ui.prototype,"postConstruct",1);Ui=u([G("rowNodeEventThrottle")],Ui);var tC={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`."}},fs=(t,e)=>{var s;return((s=e.rowModelType)!=null?s:"clientSide")==="clientSide"?{module:"@ag-grid-enterprise/row-grouping"}:null},sC={enableRowGroup:fs,rowGroup:fs,rowGroupIndex:fs,enablePivot:fs,enableValue:fs,pivot:fs,pivotIndex:fs,aggFunc:fs,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:()=>bi},iC={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},oC=Object.keys(iC),bi={objectName:"colDef",allProperties:oC,docsUrl:"column-properties/",deprecations:tC,validations:sC},rC={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."}},nC={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},aC={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:()=>bi,defaultColDef:()=>bi,defaultColGroupDef:()=>bi,autoGroupColumnDef:()=>bi},lC={objectName:"gridOptions",allProperties:[...To.ALL_PROPERTIES,...Ir.EVENT_CALLBACKS],propertyExceptions:["api","columnApi"],docsUrl:"grid-options/",deprecations:rC,validations:aC},ae=class{constructor(){this.destroyed=!1,this.domDataKey="__AG_"+Math.random().toString(),this.propertyEventService=new kt,this.globalEventHandlerFactory=t=>(e,s)=>{if(this.destroyed)return;const i=vr.has(e);if(i&&!t||!i&&t)return;const o=Ir.getCallbackForEvent(e),r=this.gridOptions[o];typeof r=="function"&&this.frameworkOverrides.wrapOutgoing(()=>{r(s)})}}get context(){return this.gridOptions.context}init(){this.columnApi=new Oi(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:nC[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=ae.toNumber(s);if(!(i==null||i<t||i>e))return i}}static getCoercedValue(t,e){const s=ae.PROPERTY_COERCIONS.get(t);return s?s(e):e}static getCoercedGridOptions(t){const e={};return Object.entries(t).forEach(([s,i])=>{const o=ae.getCoercedValue(s,i);e[s]=o}),e}updateGridOptions({options:t,force:e,source:s="api"}){const i={id:ae.changeSetId++,properties:[]},o=[];Object.entries(t).forEach(([r,n])=>{s==="api"&&Gg[r]&&H(`${r} is an initial property and cannot be updated.`);const a=ae.getCoercedValue(r,n),l=e||typeof a=="object"&&s==="api",d=this.gridOptions[r];if(l||d!==a){this.gridOptions[r]=a;const c={type:r,currentValue:a,previousValue:d,changeSet:i,source:s};o.push(c)}}),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:Bu();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"&&U(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||U(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];U(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}};ae.PROPERTY_COERCIONS=new Map([...To.BOOLEAN_PROPERTIES.map(t=>[t,ae.toBoolean]),...To.NUMBER_PROPERTIES.map(t=>[t,ae.toNumber]),["groupAggFiltering",t=>typeof t=="function"?t:ae.toBoolean(t)],["pageSize",ae.toConstrainedNum(1,Number.MAX_VALUE)],["autoSizePadding",ae.toConstrainedNum(0,Number.MAX_VALUE)],["keepDetailRowsCount",ae.toConstrainedNum(1,Number.MAX_VALUE)],["rowBuffer",ae.toConstrainedNum(0,Number.MAX_VALUE)],["infiniteInitialRowCount",ae.toConstrainedNum(1,Number.MAX_VALUE)],["cacheOverflowSize",ae.toConstrainedNum(1,Number.MAX_VALUE)],["cacheBlockSize",ae.toConstrainedNum(1,Number.MAX_VALUE)],["serverSideInitialRowCount",ae.toConstrainedNum(1,Number.MAX_VALUE)],["viewportRowModelPageSize",ae.toConstrainedNum(1,Number.MAX_VALUE)],["viewportRowModelBufferSize",ae.toConstrainedNum(0,Number.MAX_VALUE)]]);ae.changeSetId=0;u([f("gridOptions")],ae.prototype,"gridOptions",2);u([f("eventService")],ae.prototype,"eventService",2);u([f("environment")],ae.prototype,"environment",2);u([f("frameworkOverrides")],ae.prototype,"frameworkOverrides",2);u([f("eGridDiv")],ae.prototype,"eGridDiv",2);u([f("validationService")],ae.prototype,"validationService",2);u([f("gridApi")],ae.prototype,"api",2);u([M],ae.prototype,"init",1);u([it],ae.prototype,"destroy",1);ae=u([G("gridOptionsService")],ae);var Aa=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}}};Aa=u([G("localeService")],Aa);var Ml=class Dh extends fi{constructor(){super(Dh.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),Pt(this.getGui(),o),Pt(this.eViewport,o),Pt(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&&!pt(this.getViewport())&&this.attemptSettingScrollPosition(e),this.getViewport().scrollTop=e}};Ml.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],Ml.prototype,"postConstruct",1);var dC=Ml,pd={january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},gd=["january","february","march","april","may","june","july","august","september","october","november","december"],ti=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({},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=O(O({},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 a=e[r];if(n&&a&&(n=a),!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 a=this.processDataTypeDefinition(n,e,[...s,r],i);if(!a)return;o=this.mergeDataTypeDefinitions(a,t)}return Ee(O({},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(O({},e),{value:e.value.toNumber()}));if("value"in e.value)return t.valueFormatter(Ee(O({},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(ge.EVENT_STATE_UPDATED,s),this.columnStateUpdateListenerDestroyFuncs.push(()=>t.removeEventListener(ge.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(a=>{const l=r[a.trim()];return l&&this.doColDefPropsPreventInference(l,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=Ti(o,t,n)}else this.initWaitForRowData(e);if(i==null)return;const[r]=(s=Object.entries(this.dataTypeMatchers).find(([n,a])=>a(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 a=this.columnModel.getGridColumn(r);if(!a)return;const l=a.getColDef();if(!this.columnModel.resetColumnDefIntoColumn(a,"cellDataTypeInferred"))return;const d=a.getColDef();if(e&&d.type&&d.type!==l.type){const c=this.getUpdatedColumnState(a,n);c.rowGroup&&c.rowGroupIndex==null&&(i[r]=c),c.pivot&&c.pivotIndex==null&&(o[r]=c),s.push(c)}}),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=(a,l,d)=>{let c=a.getColDef().valueFormatter;return c===e.groupSafeValueFormatter&&(c=e.valueFormatter),this.valueService.formatValue(a,l,d,c)},o=ne.__isRegistered("@ag-grid-enterprise/set-filter",this.context.getGridId()),r=this.localeService.getLocaleTextFunc(),n=a=>{const{filterParams:l}=t;t.filterParams=typeof l=="object"?O(O({},l),a):a};switch(e.baseDataType){case"number":{t.cellEditor="agNumberCellEditor",o&&n({comparator:(a,l)=>{const d=a==null?0:parseInt(a),c=l==null?0:parseInt(l);return d===c?0:d>c?1:-1}});break}case"boolean":{t.cellEditor="agCheckboxCellEditor",t.cellRenderer="agCheckboxCellRenderer",t.suppressKeyboardEvent=a=>!!a.colDef.editable&&a.event.key===E.SPACE,n(o?{valueFormatter:a=>P(a.value)?r(String(a.value),a.value?"True":"False"):r("blanks","(Blanks)")}:{maxNumConditions:1,debounceMs:0,filterOptions:["empty",{displayKey:"true",displayName:"True",predicate:(a,l)=>l,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(a,l)=>l===!1,numberOfInputs:0}]});break}case"date":{t.cellEditor="agDateCellEditor",t.keyCreator=a=>i(a.column,a.node,a.value),o&&n({valueFormatter:a=>{const l=i(a.column,a.node,a.value);return P(l)?l:r("blanks","(Blanks)")},treeList:!0,treeListFormatter:(a,l)=>{if(l===1&&a!=null){const d=gd[Number(a)-1];return r(d,pd[d])}return a??r("blanks","(Blanks)")}});break}case"dateString":{t.cellEditor="agDateStringCellEditor",t.keyCreator=l=>i(l.column,l.node,l.value);const a=e.dateParser;n(o?{valueFormatter:l=>{const d=i(l.column,l.node,l.value);return P(d)?d:r("blanks","(Blanks)")},treeList:!0,treeListPathGetter:l=>{const d=a(l??void 0);return d?[String(d.getFullYear()),String(d.getMonth()+1),String(d.getDate())]:null},treeListFormatter:(l,d)=>{if(d===1&&l!=null){const c=gd[Number(l)-1];return r(c,pd[c])}return l??r("blanks","(Blanks)")}}:{comparator:(l,d)=>{const c=a(d);return d==null||c<l?-1:c>l?1:0}});break}case"object":{t.cellEditorParams={useFormatter:!0},t.comparator=(a,l)=>{const d=this.columnModel.getPrimaryColumn(s),c=d==null?void 0:d.getColDef();if(!d||!c)return 0;const h=a==null?"":i(d,null,a),m=l==null?"":i(d,null,l);return h===m?0:h>m?1:-1},t.keyCreator=a=>i(a.column,a.node,a.value),o?n({valueFormatter:a=>{const l=i(a.column,a.node,a.value);return P(l)?l:r("blanks","(Blanks)")}}):t.filterValueGetter=a=>i(a.column,a.node,this.valueService.getValue(a.column,a.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:Eo(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=At(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=At(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=Eo(s.value))!=null?i:""}}}}};u([f("rowModel")],ti.prototype,"rowModel",2);u([f("columnModel")],ti.prototype,"columnModel",2);u([f("valueService")],ti.prototype,"valueService",2);u([M],ti.prototype,"init",1);ti=u([G("dataTypeService")],ti);var si=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 Ll("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")],si.prototype,"ctrlsService",2);u([f("columnModel")],si.prototype,"columnModel",2);u([f("rowModel")],si.prototype,"rowModel",2);u([M],si.prototype,"postConstruct",1);si=u([G("syncService")],si);var ii=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(O({},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")],ii.prototype,"userComponentFactory",2);u([f("paginationProxy")],ii.prototype,"paginationProxy",2);u([f("columnModel")],ii.prototype,"columnModel",2);u([M],ii.prototype,"postConstruct",1);ii=u([G("overlayService")],ii);var et=class extends L{constructor(){super(...arguments),this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Ze(()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=Ze(()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),0),this.onRowSelectedDebounced=Ze(()=>{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=[],a=[],l=[],d=[],c=this.columnModel.getColumnState();for(let h=0;h<c.length;h++){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}=c[h];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&&a.push(m),(F||A)&&l.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:a.length?{hiddenColIds:a}:void 0,columnSizing:l.length?{columnSizingModel:l}: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:a,columnOrder:l}=t,d={},c=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=c(v);R.sort=S,R.sortIndex=w}),s&&s.groupColIds.forEach((v,S)=>{const w=c(v);w.rowGroup=!0,w.rowGroupIndex=S}),i&&i.aggregationModel.forEach(({colId:v,aggFunc:S})=>{c(v).aggFunc=S}),o&&(o.pivotColIds.forEach((v,S)=>{const w=c(v);w.pivot=!0,w.pivotIndex=S}),this.gos.updateGridOptions({options:{pivotMode:o.pivotMode},source:"gridInitializing"})),r&&(r.leftColIds.forEach(v=>{c(v).pinned="left"}),r.rightColIds.forEach(v=>{c(v).pinned="right"})),n&&n.hiddenColIds.forEach(v=>{c(v).hide=!0}),a&&a.columnSizingModel.forEach(({colId:v,flex:S,width:w})=>{const R=c(v);R.flex=S??null,R.width=w});const h=l==null?void 0:l.orderedColIds,m=!!(h!=null&&h.length),C=m?h.map(v=>c(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:a,startColumn:l}=s;return{id:i,type:o,startRow:r,endRow:n,colIds:a.map(d=>d.getColId()),startColId:l.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(a=>n.has(a))}e.push(Ee(O({},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])=>{ta(o,this.cachedState[i])||(s=!0)}),this.cachedState=O(O({},this.cachedState),e),s&&this.dispatchStateUpdateEvent(t)}updateCachedState(t,e){const s=this.cachedState[t];this.setCachedStateValue(t,e),ta(e,s)||this.dispatchStateUpdateEvent([t])}setCachedStateValue(t,e){this.cachedState=Ee(O({},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")],et.prototype,"filterManager",2);u([f("ctrlsService")],et.prototype,"ctrlsService",2);u([f("focusService")],et.prototype,"focusService",2);u([f("columnModel")],et.prototype,"columnModel",2);u([f("paginationProxy")],et.prototype,"paginationProxy",2);u([f("rowModel")],et.prototype,"rowModel",2);u([f("selectionService")],et.prototype,"selectionService",2);u([f("expansionService")],et.prototype,"expansionService",2);u([f("columnAnimationService")],et.prototype,"columnAnimationService",2);u([de("sideBarService")],et.prototype,"sideBarService",2);u([de("rangeService")],et.prototype,"rangeService",2);u([M],et.prototype,"postConstruct",1);et=u([G("stateService")],et);var Wo=class extends L{init(){this.processGridOptions(this.gridOptions)}processGridOptions(t){this.processOptions(t,lC)}processColumnDefs(t){this.processOptions(t,bi)}processOptions(t,e){const{validations:s,deprecations:i,allProperties:o,propertyExceptions:r,objectName:n,docsUrl:a}=e;o&&this.gridOptions.suppressPropertyNamesCheck!==!0&&this.checkProperties(t,[...r??[],...Object.keys(i)],o,n,a);const l=new Set;Object.keys(t).forEach(c=>{var h;const m=i[c];if(m)if("renamed"in m){const{renamed:b,version:T}=m;l.add(`As of v${T}, ${String(c)} is deprecated. Please use ${String(b)} instead.`),t[b]=t[c]}else{const{message:b,version:T}=m;l.add(`As of v${T}, ${String(c)} is deprecated. ${b??""}`)}const C=t[c];if(C==null||C===!1)return;const v=s[c];let S;if(v)if(typeof v=="function"){const b=v(t,this.gridOptions);if(!b)return;if("objectName"in b){const T=t[c];if(Array.isArray(T)){T.forEach(D=>{this.processOptions(D,b)});return}this.processOptions(t[c],b);return}S=b}else S=v;else return;const{module:w,dependencies:R,supportedRowModels:y}=S;if(y){const b=(h=this.gridOptions.rowModelType)!=null?h:"clientSide";if(!y.includes(b)){l.add(`${String(c)} 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(c),this.context.getGridId())||(T=!1,l.add(`${String(c)} is only available when ${D} is loaded.`))}),!T)return}if(R){const b=this.checkForWarning(c,R,t);if(b){l.add(b);return}}}),l.size>0&&l.forEach(c=>{H(c)})}checkForWarning(t,e,s){if(typeof e=="function")return e(s,this.gridOptions);const o=Object.entries(e).find(([a,l])=>{const d=s[a];return!l.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=tc(Object.getOwnPropertyNames(t),[...r,...e,...s],s);if(Ye(n,(a,l)=>{H(`invalid ${i} property '${a}' did you mean any of these: ${l.slice(0,8).join(", ")}`)}),Object.keys(n).length>0&&o){const a=this.getFrameworkOverrides().getDocLink(o);H(`to see all the valid ${i} properties please check: ${a}`)}}};u([f("gridOptions")],Wo.prototype,"gridOptions",2);u([M],Wo.prototype,"init",1);Wo=u([G("validationService")],Wo);var Ur=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 Ga(this.getFrameworkOverrides())}addEventListener(t,e){const s=this.frameworkEventWrappingService.wrap(e),i=this.gos.useAsyncEvents()&&!vr.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)=>{vr.has(r)&&e(r,n)},o=(r,n)=>{vr.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],Ur.prototype,"postConstruct",1);Ur=u([G("apiEventService")],Ur);var Il=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(){Fe(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(a=>({value:String(a),text:String(a)})),n=i("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new cn).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")],Il.prototype,"paginationProxy",2);u([M],Il.prototype,"init",1);var Uo=class extends L{constructor(){super(),this.descriptionContainer=null,this.announceValue=Ze(this.announceValue.bind(this),200)}postConstruct(){const t=this.gos.getDocument(),e=this.descriptionContainer=t.createElement("div");e.classList.add("ag-aria-description-container"),Ha(e,"polite"),Pu(e,"additions text"),Au(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&&(Fe(t),t.parentElement&&t.parentElement.removeChild(t)),this.descriptionContainer=null,this.eGridDiv=null}};u([f("eGridDiv")],Uo.prototype,"eGridDiv",2);u([M],Uo.prototype,"postConstruct",1);Uo=u([G("ariaAnnouncementService")],Uo);var Pa=class{};Pa.gridOptions=void 0;var uC=1,cC=class{create(t,e,s,i,o){var r;let n={};Pa.gridOptions?(dt(n,Pa.gridOptions,!0,!0),n=O(O({},n),e)):n=e;const a=ae.getCoercedGridOptions(n),l=!!a.debug,d=(r=a.gridId)!=null?r:String(uC++),c=this.getRegisteredModules(o,d),h=this.createBeansList(a.rowModelType,c,d),m=this.createProvidedBeans(t,a,o);if(!h){Vs("Failed to create grid.");return}const C={providedBeanInstances:m,beanClasses:h,debug:l,gridId:d},v=new Ll("Context",()=>C.debug),S=new Sg(C,v),w=S.getBean("beans");return this.registerModuleUserComponents(w,c),this.registerStackComponents(w,c),this.registerControllers(w,c),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=(a,l,d)=>{(h=>{r[h.moduleName]||(r[h.moduleName]=!0,o.push(h),ne.__register(h,a,d))})(l),l.dependantModules&&l.dependantModules.forEach(h=>n(a,h,d))};return s&&s.forEach(a=>n(!0,a,e)),i&&i.forEach(a=>n(!ne.__isPackageBased(),a,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;U(i)&&(i=new Eh);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:hn},{componentName:"AgRadioButton",componentClass:wc},{componentName:"AgToggleButton",componentClass:fh},{componentName:"AgInputTextField",componentClass:ai},{componentName:"AgInputTextArea",componentClass:xm},{componentName:"AgInputNumberField",componentClass:gl},{componentName:"AgInputDateField",componentClass:Gm},{componentName:"AgInputRange",componentClass:Om},{componentName:"AgRichSelect",componentClass:Pn},{componentName:"AgSelect",componentClass:cn},{componentName:"AgSlider",componentClass:Vm},{componentName:"AgGridBody",componentClass:Wt},{componentName:"AgHeaderRoot",componentClass:Mm},{componentName:"AgSortIndicator",componentClass:ml},{componentName:"AgPagination",componentClass:ft},{componentName:"AgPageSizeSelector",componentClass:Il},{componentName:"AgOverlayWrapper",componentClass:Zm},{componentName:"AgGroupComponent",componentClass:Hm},{componentName:"AgRowContainer",componentClass:ji},{componentName:"AgFakeHorizontalScroll",componentClass:eC},{componentName:"AgFakeVerticalScroll",componentClass:dC},{componentName:"AgAutocomplete",componentClass:Km}];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(l=>!l.rowModel||l.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]){Vs("Could not find row model for rowModelType = "+t);return}if(!ne.__assertRegistered(o[t],`rowModelType = '${t}'`,s))return;const r=[q,Bi,ba,Ho,_i,X,Or,Wr,_o,wa,ws,Hi,Io,Aa,Wo,xo,Mo,aa,kt,ae,as,Zs,Ft,Ue,Qs,Go,Et,Hr,Ro,Js,je,Br,ys,kr,Xs,Ss,Y,Oi,pe,os,Vo,Es,Vr,xi,ei,Ra,Oo,ki,bo,Vi,Gi,Zt,la,Ta,ko,Jt,Wi,$s,Bo,Ui,Da,ti,ht,si,ii,et,No,Ur,Uo,Lt],n=this.extractModuleEntity(i,l=>l.beans?l.beans:[]);r.push(...n);const a=[];return r.forEach(l=>{a.indexOf(l)<0&&a.push(l)}),a}extractModuleEntity(t,e){return[].concat(...t.map(e))}},hC=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)}}},io=typeof global>"u"?{}:global;io.HTMLElement=typeof HTMLElement>"u"?{}:HTMLElement;io.HTMLButtonElement=typeof HTMLButtonElement>"u"?{}:HTMLButtonElement;io.HTMLSelectElement=typeof HTMLSelectElement>"u"?{}:HTMLSelectElement;io.HTMLInputElement=typeof HTMLInputElement>"u"?{}:HTMLInputElement;io.Node=typeof Node>"u"?{}:Node;io.MouseEvent=typeof MouseEvent>"u"?{}:MouseEvent;var Nl=class mo{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=mo.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,mo.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(a=>this.createNode(a,this.rootNode,mo.TOP_LEVEL));if(typeof r=="number"&&r>=0){const{allLeafChildren:a}=this.rootNode,l=a.length;let d=r;if(this.gos.get("treeData")&&r>0&&l>0){for(let C=0;C<l;C++)if(((i=a[C])==null?void 0:i.rowIndex)==r-1){d=C+1;break}}const h=a.slice(0,d),m=a.slice(d,a.length);this.rootNode.allLeafChildren=[...h,...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 a=this.lookupRowNode(n);a&&(a.isSelected()&&i.push(a),a.clearRowTopAndRowIndex(),r[a.id]=!0,delete this.allNodesMap[a.id],s.remove.push(a))}),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,mo.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 Q(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 a=this.gos.get("isRowMaster");a?e.setMaster(a(s)):e.setMaster(!0)}else e.setMaster(!1);if(o){const a=this.columnModel.getRowGroupColumns(),l=a?a.length:0,d=i+l;e.expanded=e.master?this.isExpanded(d):!1}}}isExpanded(e){const s=this.gos.get("groupDefaultExpanded");return s===-1?!0:e<s}};Nl.TOP_LEVEL=0;Nl.ROOT_NODE_ID="ROOT_NODE_ID";var pC=Nl,tt=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 Q(this.beans),this.nodeManager=new pC(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([]),a=new Set(["groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupIncludeFooter","groupTotalRow"]),l=[...t,...e,...s,...i,...i,...o,...r,...n,...a];this.addManagedPropertyListeners(l,d=>{var c;const h=(c=d.changeSet)==null?void 0:c.properties;if(!h)return;const m=C=>h.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(a)&&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),a=this.getRowIndexAtPixel(e),l=Math.max(n,s),d=Math.min(a,i);for(let c=l;c<=d;c++){const h=this.getRow(c);if(h.rowHeightEstimated){const m=this.gos.getRowHeightForNode(h);h.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,a)=>{W.insertIntoArray(this.rootNode.allLeafChildren,n,Math.max(i+s,0)+a)}),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 An(!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),a=this.rowsToDisplay[n];if(this.isRowInPixel(a,t)||(a.rowTop<t?e=n+1:a.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=a=>{var l;const d=(l=e[0])==null?void 0:l.parent;if(!d)return;const c=o&&this.gos.getGrandTotalRow(),h=this.gos.getGroupTotalRowCallback(),m=o&&h({node:d});if(d===this.rootNode){c===a&&(d.createFooter(),s(d.sibling,r++));return}m===a&&(d.createFooter(),s(d.sibling,r++))};n("top");for(let a=0;a<e.length;a++){const l=e[a];if(s(l,r++),l.hasChildren()&&!l.footer){let d=null;switch(i){case 0:d=l.childrenAfterGroup;break;case 1:d=l.childrenAfterAggFilter;break;case 2:d=l.childrenAfterSort;break;case 3:d=l.leafGroup?null:l.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(a=>{const l=()=>{a.expanded=t,i(a.childrenAfterGroup)};if(e){W.exists(a.childrenAfterGroup)&&l();return}if(s){!a.leafGroup&&l();return}a.group&&l()})};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(Q.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")],tt.prototype,"columnModel",2);u([f("selectionService")],tt.prototype,"selectionService",2);u([f("valueCache")],tt.prototype,"valueCache",2);u([f("beans")],tt.prototype,"beans",2);u([f("filterStage")],tt.prototype,"filterStage",2);u([f("sortStage")],tt.prototype,"sortStage",2);u([f("flattenStage")],tt.prototype,"flattenStage",2);u([de("groupStage")],tt.prototype,"groupStage",2);u([de("aggregationStage")],tt.prototype,"aggregationStage",2);u([de("pivotStage")],tt.prototype,"pivotStage",2);u([de("filterAggregatesStage")],tt.prototype,"filterAggregatesStage",2);u([M],tt.prototype,"init",1);tt=u([G("rowModel")],tt);var zr=class extends L{execute(t){const{changedPath:e}=t;this.filterService.filter(e)}};u([f("filterService")],zr.prototype,"filterService",2);zr=u([G("filterStage")],zr);var zo=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")],zo.prototype,"sortService",2);u([f("sortController")],zo.prototype,"sortController",2);zo=u([G("sortStage")],zo);var Kr=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 a=s.length>0;if(!o&&a&&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],a=n.hasChildren(),l=i&&!a,d=t.groupRemoveSingleChildren&&a&&n.childrenAfterGroup.length===1,c=t.groupRemoveLowestSingleChildren&&a&&n.leafGroup&&n.childrenAfterGroup.length===1,h=i&&n.leafGroup,m=t.hideOpenParents&&n.expanded&&!n.master&&!h;if(!l&&!m&&!d&&!c&&this.addRowNodeToRowsToDisplay(t,n,s,o),!(i&&n.leafGroup)){if(a){const v=d||c;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 Q(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")],Kr.prototype,"beans",2);Kr=u([G("flattenStage")],Kr);var Ko=class extends L{sort(t,e,s,i,o,r){const n=this.gos.get("groupMaintainOrder"),a=this.columnModel.getAllGridColumns().some(m=>m.isRowGroupActive());let l={};s&&i&&(l=this.calculateDirtyNodes(i));const d=this.columnModel.isPivotMode(),c=this.gos.getCallback("postSortRows"),h=m=>{var C;this.pullDownGroupDataForHideOpenParents(m.childrenAfterAggFilter,!0);const v=d&&m.leafGroup;if(n&&a&&!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,l,o,t):m.childrenAfterSort=this.rowNodeSorter.doFullSort(m.childrenAfterAggFilter,t);if(m.sibling&&(m.sibling.childrenAfterSort=m.childrenAfterSort),this.updateChildIndexes(m),c){const w={nodes:m.childrenAfterSort};c(w)}};o&&o.forEachChangedNodeDepthFirst(h),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={},a=[];o.forEach(h=>{e[h.id]||!s.canSkip(h)?a.push(h):n[h.id]=!0});const l=r.filter(h=>n[h.id]),d=(h,m)=>({currentPos:m,rowNode:h}),c=a.map(d).sort((h,m)=>this.rowNodeSorter.compareRowNodes(i,h,m));return this.mergeSortedArrays(i,c,l.map(d)).map(({rowNode:h})=>h)}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,a=this.columnModel.getPrimaryColumn(n);if(a!==s.rowGroupColumn)if(e)s.setGroupValue(o.getId(),void 0);else{const d=s.getFirstChildOfFirstChild(a);d&&s.setGroupValue(o.getId(),d.key)}})})}};u([f("columnModel")],Ko.prototype,"columnModel",2);u([f("rowNodeSorter")],Ko.prototype,"rowNodeSorter",2);Ko=u([G("sortService")],Ko);var $r=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,a=r.data&&this.filterManager.doesRowPassFilter({rowNode:r});return n||a}):i.childrenAfterFilter=i.childrenAfterGroup,i.sibling&&(i.sibling.childrenAfterFilter=i.childrenAfterFilter)};if(this.doingTreeDataFiltering()){const i=(r,n)=>{if(r.childrenAfterGroup)for(let a=0;a<r.childrenAfterGroup.length;a++){const l=r.childrenAfterGroup[a],d=n||this.filterManager.doesRowPassFilter({rowNode:l});l.childrenAfterGroup?i(r.childrenAfterGroup[a],d):s(l,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")],$r.prototype,"filterManager",2);$r=u([G("filterService")],$r);var oi=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,a)=>{const l=e({data:n,level:0}),d=i[l];r&&(r[l]=a),d?(d.data!==n&&s.update.push(n),i[l]=void 0):s.add.push(n)}),W.iterateObject(i,(n,a)=>{a&&s.remove.push(a.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")],oi.prototype,"rowModel",2);u([f("rowRenderer")],oi.prototype,"rowRenderer",2);u([f("selectionService")],oi.prototype,"selectionService",2);u([M],oi.prototype,"postConstruct",1);oi=u([G("immutableService")],oi);var gC="31.3.4",fC={version:gC,moduleName:"@ag-grid-community/client-side-row-model",rowModel:"clientSide",beans:[tt,zr,zo,Kr,Ko,$r,oi]},mC=Object.defineProperty,CC=Object.getOwnPropertyDescriptor,rt=(t,e,s,i)=>{for(var o=i>1?void 0:i?CC(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&&mC(e,s,o),o},vC=(t,e)=>(s,i)=>e(s,i,t),$o=class extends Sa{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 Q(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 Q(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")],$o.prototype,"beans",2);rt([M],$o.prototype,"postConstruct",1);rt([it],$o.prototype,"destroyRowNodes",1);var oo=class Ah 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 $o(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(a=>a!=e),i=(a,l)=>l.getLastAccessed()-a.getLastAccessed();s.sort(i);const o=this.params.maxBlocksInCache>0,r=o?this.params.maxBlocksInCache-1:null,n=Ah.MAX_EMPTY_BLOCKS_TO_KEEP-1;s.forEach((a,l)=>{const d=a.getState()===$o.STATE_WAITING_TO_LOAD&&l>=n,c=o?l>=r:!1;if(d||c){if(this.isBlockCurrentlyDisplayed(a)||this.isBlockFocused(a))return;this.removeBlockFromCache(a)}})}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 Ni;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 Ni;W.missing(e)&&(r=!0);let a=!1;return this.getBlocksInOrder().forEach(d=>{if(!a){if(r&&o+1!==d.getId()){a=!0;return}o=d.getId(),d.forEachNode(c=>{const h=c===e||c===s;(r||h)&&i.push(c),h&&(r=!r)},n,this.rowCount)}}),a||r?[]:i}};oo.MAX_EMPTY_BLOCKS_TO_KEEP=2;rt([f("rowRenderer")],oo.prototype,"rowRenderer",2);rt([f("focusService")],oo.prototype,"focusService",2);rt([vC(0,Tt("loggerFactory"))],oo.prototype,"setBeans",1);rt([it],oo.prototype,"destroyAllBlocks",1);var wC=oo,es=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 Ni},this.infiniteCache=this.createBean(new wC(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")],es.prototype,"filterManager",2);rt([f("sortController")],es.prototype,"sortController",2);rt([f("selectionService")],es.prototype,"selectionService",2);rt([f("rowRenderer")],es.prototype,"rowRenderer",2);rt([f("rowNodeBlockLoader")],es.prototype,"rowNodeBlockLoader",2);rt([M],es.prototype,"init",1);rt([it],es.prototype,"destroyDatasource",1);es=rt([G("rowModel")],es);var SC="31.3.4",EC={version:SC,moduleName:"@ag-grid-community/infinite-row-model",rowModel:"infinite",beans:[es]},yC=Object.defineProperty,RC=Object.getOwnPropertyDescriptor,mt=(t,e,s,i)=>{for(var o=i>1?void 0:i?RC(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&&yC(e,s,o),o},bC=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()}`}},TC=class{constructor(t){this.groupColumns=[];const{columnModel:e,valueService:s,gos:i,processCellCallback:o,processHeaderCallback:r,processGroupHeaderCallback:n,processRowGroupCallback:a}=t;this.columnModel=e,this.valueService=s,this.gos=i,this.processCellCallback=o,this.processHeaderCallback=r,this.processGroupHeaderCallback=n,this.processRowGroupCallback=a}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 a=e.getColDef();return a==null||a.showRowGroup===!0||a.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=l=>{var d,c;if(s||i)return l.key;const h=(d=l.groupData)==null?void 0:d[t.getId()];return!h||!l.rowGroupColumn||l.rowGroupColumn.getColDef().useValueFormatterForExport===!1?h:(c=this.valueService.formatValue(l.rowGroupColumn,l,h))!=null?c:h},r=e.footer,n=[o(e)];if(!this.gos.isGroupMultiAutoColumn())for(;e.parent;)e=e.parent,n.push(o(e));const a=n.reverse().join(" -> ");return r?`Total ${a}`:a}processCell(t){var e;const{accumulatedRowIndex:s,rowNode:i,column:o,value:r,processCellCallback:n,type:a}=t;return n?{value:(e=n(this.gos.addGridCommonParams({accumulatedRowIndex:s,column:o,node:i,value:r,type:a,parseValue:l=>this.valueService.parseValue(o,i,l,this.valueService.getValue(o,i)),formatValue:l=>{var d;return(d=this.valueService.formatValue(o,i,l))!=null?d:l}})))!=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)}},fd=`\r
331
+ `,AC=class extends TC{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,fd),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+=fd),this.isFirstLine=!1}},Rs=class extends bC{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:a,suppressQuotes:l,columnSeparator:d}=t;return new AC({columnModel:e,valueService:s,gos:i,processCellCallback:o||void 0,processHeaderCallback:r||void 0,processGroupHeaderCallback:n||void 0,processRowGroupCallback:a||void 0,suppressQuotes:l||!1,columnSeparator:d||","})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};mt([f("columnModel")],Rs.prototype,"columnModel",2);mt([f("valueService")],Rs.prototype,"valueService",2);mt([f("gridSerializer")],Rs.prototype,"gridSerializer",2);mt([f("gridOptionsService")],Rs.prototype,"gos",2);mt([M],Rs.prototype,"postConstruct",1);Rs=mt([G("csvCreator")],Rs);var ts=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"),l=e.rowPositions!=null||!!e.onlySelected,d=this.gos.get("groupHideOpenParents")&&!l,c=this.columnModel.isPivotMode()?i.leafGroup:!i.group,h=!!i.footer;e.skipRowGroups;const m=n&&i.leafGroup,C=i.allChildrenCount===1&&(r||m);if(!c&&!h&&(e.skipRowGroups||C||d)||e.onlySelected&&!i.isSelected()||e.skipPinnedTop&&i.rowPinned==="top"||e.skipPinnedBottom&&i.rowPinned==="bottom"||i.level===-1&&!c&&!h||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 Cu,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",a=!r&&t.onlySelected,l=this.processRow.bind(this,s,t,e),{exportedRows:d="filteredAndSorted"}=t;if(t.rowPositions)t.rowPositions.filter(c=>c.rowPinned==null).sort((c,h)=>c.rowIndex-h.rowIndex).map(c=>i.getRow(c.rowIndex)).forEach(l);else if(this.columnModel.isPivotMode())r?i.forEachPivotNode(l,!0):n?i.forEachNodeAfterFilterAndSort(l,!0):i.forEachNode(l);else if(t.onlySelectedAllPages||a){const c=this.selectionService.getSelectedNodes();this.replicateSortedOrder(c),c.forEach(l)}else d==="all"?i.forEachNode(l):r||n?i.forEachNodeAfterFilterAndSort(l,!0):i.forEachNode(l);return s}}replicateSortedOrder(t){const e=this.sortController.getSortOptions(),s=(i,o)=>{var r,n,a,l;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:(a=i.rowIndex)!=null?a:-1},{rowNode:o,currentPos:(l=o.rowIndex)!=null?l:-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()!==Fi)),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 a;s?a=s(this.gos.addGridCommonParams({columnGroup:n})):a=this.columnModel.getDisplayNameForColumnGroup(n,"header");const l=n.getLeafColumns().reduce((d,c,h,m)=>{let C=W.last(d);return c.getColumnGroupShow()==="open"?(!C||C[1]!=null)&&(C=[h],d.push(C)):C&&C[1]==null&&(C[1]=h-1),h===m.length-1&&C&&C[1]==null&&(C[1]=h),d},[]);i.onColumn(n,a||"",o++,n.getLeafColumns().length-1,l)})}};mt([f("displayedGroupCreator")],ts.prototype,"displayedGroupCreator",2);mt([f("columnModel")],ts.prototype,"columnModel",2);mt([f("rowModel")],ts.prototype,"rowModel",2);mt([f("pinnedRowModel")],ts.prototype,"pinnedRowModel",2);mt([f("selectionService")],ts.prototype,"selectionService",2);mt([f("rowNodeSorter")],ts.prototype,"rowNodeSorter",2);mt([f("sortController")],ts.prototype,"sortController",2);ts=mt([G("gridSerializer")],ts);var PC="31.3.4",FC={version:PC,moduleName:"@ag-grid-community/csv-export",beans:[Rs,ts]},{utf8_encode:Yv}=W;ne.__registerModules([fC,EC,FC],!1,void 0);var LC=Object.defineProperty,MC=Object.defineProperties,IC=Object.getOwnPropertyDescriptors,md=Object.getOwnPropertySymbols,NC=Object.prototype.hasOwnProperty,xC=Object.prototype.propertyIsEnumerable,Cd=(t,e,s)=>e in t?LC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,Te=(t,e)=>{for(var s in e||(e={}))NC.call(e,s)&&Cd(t,s,e[s]);if(md)for(var s of md(e))xC.call(e,s)&&Cd(t,s,e[s]);return t},st=(t,e)=>MC(t,IC(e)),xl=g.createContext({setMethods:()=>{}}),GC=t=>{const{initialProps:e,addUpdateCallback:s,CustomComponentClass:i,setMethods:o}=t,[r,n]=g.useState(e);return g.useEffect(()=>{s(a=>n(a))},[]),g.createElement(xl.Provider,{value:{setMethods:o}},g.createElement(i,Te({},r)))},OC=g.memo(GC),_C=0;function vd(){return`agPortalKey_${++_C}`}var Ph=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=vd(),this.portalKey=vd(),this.instanceCreated=this.isStatelessComponent()?Ne.resolve(!1):new Ne(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 Ne(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,st(Te({},t),{key:this.key})),this.portal=wo.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=()=>{},kh.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 Gl(t,e,s){t.forEach(i=>{const o=e[i];o&&(s[i]=o)})}var Is=class extends Ph{constructor(){super(...arguments),this.awaitUpdateCallback=new Ne(t=>{this.resolveUpdateCallback=t}),this.wrapperComponent=OC}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 Ne(i=>{setTimeout(()=>{i()})})),this.resolveUpdateCallback()}})}setMethods(t){this.providedMethods=t,Gl(this.getOptionalMethods(),this.providedMethods,this)}getOptionalMethods(){return[]}getProps(){return st(Te({},this.sourceParams),{key:this.key,ref:this.ref})}refreshProps(){return this.updateCallback?this.updateCallback():new Ne(t=>this.awaitUpdateCallback.then(()=>{this.updateCallback().then(()=>t())}))}},VC=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}},HC=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 Fh(t,e){t.parentFilterInstance(s=>{(s.setModel(e)||Ne.resolve()).then(()=>{t.filterParams.filterChangedCallback()})})}var kC=class{constructor(t,e){this.floatingFilterParams=t,this.refreshProps=e,this.model=null,this.onModelChange=s=>this.updateModel(s)}getProps(){return st(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){Gl(this.getOptionalMethods(),t,this)}getOptionalMethods(){return["afterGuiAttached"]}updateModel(t){this.model=t,this.refreshProps(),Fh(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(),Fh(this.sourceParams,t)}getProps(){const t=super.getProps();return t.model=this.model,t.onModelChange=this.onModelChange,t}},WC=class extends Is{refresh(t){this.sourceParams=t,this.refreshProps()}},UC=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}},zC=class extends Is{refresh(t){this.sourceParams=t,this.refreshProps()}},KC=class extends Is{refresh(t){return this.sourceParams=t,this.refreshProps(),!0}},$C=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}},Lh=class Mh{constructor(e,s,i){this.destroyed=!1,this.portals=[],this.hasPendingPortalUpdate=!1,this.wrappingElement=s||"div",this.refresher=e,this.maxComponentCreationTimeMs=i||Mh.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)})}}};Lh.MAX_COMPONENT_CREATION_TIME_IN_MS=1e3;var YC=Lh,nt=g.createContext({}),Gt=(...t)=>t.filter(s=>s!=null&&s!=="").join(" "),Dt=class Ih{constructor(...e){this.classesMap={},e.forEach(s=>{this.classesMap[s]=!0})}setClass(e,s){if(!!this.classesMap[e]==s)return this;const o=new Ih;return o.classesMap=Te({},this.classesMap),o.classesMap[e]=s,o}toString(){return Object.keys(this.classesMap).filter(s=>this.classesMap[s]).join(" ")}},ro=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()},jC=wo.createRoot!=null&&wo.flushSync!=null,Tr=!1;function qC(t){return Tr||setTimeout(()=>Tr=!1,0),Tr=!0,t()}var Ol=(t,e)=>{jC&&t&&!Tr?wo.flushSync(e):e()};function _l(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 a=0;a<e.length;a++){const l=e[a];n.set(l.getInstanceId(),l)}for(let a=0;a<t.length;a++){const l=t[a];r.set(l.getInstanceId(),l),n.has(l.getInstanceId())&&i.push(l)}for(let a=0;a<e.length;a++){const l=e[a],d=l.getInstanceId();r.has(d)||o.push(l)}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 pr=(t,e,s,i)=>{if(!t||t.componentFromFramework||e.isDestroyed())return;const r=t.newAgStackInstance();if(!r)return;let n,a,l=!1;return r.then(d=>{if(l){e.destroyBean(d);return}n=d,a=n.getGui(),s.appendChild(a),wd(i,n)}),()=>{l=!0,n&&(a&&a.parentElement&&a.parentElement.removeChild(a),e.destroyBean(n),i&&wd(i,void 0))}},wd=(t,e)=>{if(t)if(t instanceof Function)t(e);else{const s=t;s.current=e}},QC=t=>{const e=t.newAgStackInstance();if(e)return e.resolveNow(null,s=>s)},Nh=g.forwardRef((t,e)=>{var s;const i=g.useContext(nt).context,o=g.useRef(null),r=g.useRef(null),n=g.useRef(null),a=g.useRef(null),l=g.useRef(null),d=g.useRef(),[c,h]=g.useState(),[m,C]=g.useState(),[v,S]=g.useState(),[w,R]=g.useState(()=>new Dt),[y,b]=g.useState(()=>new Dt("ag-hidden")),[T,D]=g.useState(()=>new Dt("ag-hidden")),[A,F]=g.useState(()=>new Dt("ag-invisible"));g.useImperativeHandle(e,()=>({refresh(){return!1}})),g.useLayoutEffect(()=>pr(c,i,r.current),[c]);const x=g.useCallback(ue=>{if(o.current=ue,!o.current){i.destroyBean(d.current),d.current=null;return}const J={setInnerRenderer:(j,ee)=>{h(j),S(ee)},setChildCount:j=>C(j),addOrRemoveCssClass:(j,ee)=>R(Re=>Re.setClass(j,ee)),setContractedDisplayed:j=>D(ee=>ee.setClass("ag-hidden",!j)),setExpandedDisplayed:j=>b(ee=>ee.setClass("ag-hidden",!j)),setCheckboxVisible:j=>F(ee=>ee.setClass("ag-invisible",!j))};d.current=i.createBean(new di),d.current.init(J,o.current,n.current,a.current,l.current,Nh,t)},[]),I=g.useMemo(()=>`ag-cell-wrapper ${w.toString()}`,[w]),V=g.useMemo(()=>`ag-group-expanded ${y.toString()}`,[y]),_=g.useMemo(()=>`ag-group-contracted ${T.toString()}`,[T]),z=g.useMemo(()=>`ag-group-checkbox ${A.toString()}`,[A]),k=c&&c.componentFromFramework,le=k?c.componentClass:void 0,he=c==null&&v!=null,fe=W.escapeString(v,!0);return g.createElement("span",Te({className:I,ref:x},t.colDef?{}:{role:(s=d.current)==null?void 0:s.getCellAriaRole()}),g.createElement("span",{className:V,ref:a}),g.createElement("span",{className:_,ref:l}),g.createElement("span",{className:z,ref:n}),g.createElement("span",{className:"ag-group-value",ref:r},he&&g.createElement(g.Fragment,null,fe),k&&g.createElement(le,Te({},c.params))),g.createElement("span",{className:"ag-group-child-count"},m))}),Sd=Nh,XC=t=>{const{ctrl:e}=t,s=e.isAlive(),{context:i}=g.useContext(nt),o=s?e.getColId():void 0,[r,n]=g.useState(),a=g.useRef(null),l=g.useRef(null),d=g.useRef(null),c=g.useRef();let h=g.useRef();s&&!h.current&&(h.current=new Zo(()=>a.current));const m=g.useCallback(w=>{var R;if(a.current=w,!a.current||!s)return;const y={setWidth:T=>{a.current&&(a.current.style.width=T)},addOrRemoveCssClass:(T,D)=>h.current.addOrRemoveCssClass(T,D),setAriaSort:T=>{a.current&&(T?W.setAriaSort(a.current,T):W.removeAriaSort(a.current))},setUserCompDetails:T=>n(T),getUserCompInstance:()=>c.current||void 0};e.setComp(y,a.current,l.current,d.current);const b=e.getSelectAllGui();(R=l.current)==null||R.insertAdjacentElement("afterend",b)},[]);g.useLayoutEffect(()=>pr(r,i,d.current,c),[r]),g.useEffect(()=>{e.setDragSource(a.current)},[r]);const C=g.useMemo(()=>!!((r==null?void 0:r.componentFromFramework)&&ro(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:l,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,st(Te({},r.params),{ref:c}))))},JC=g.memo(XC),ZC=t=>{const{context:e}=g.useContext(nt),{ctrl:s}=t,[i,o]=g.useState(()=>new Dt),[r,n]=g.useState(()=>new Dt),[a,l]=g.useState("false"),[d,c]=g.useState(),[h,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 x={setWidth:I=>{v.current&&(v.current.style.width=I)},addOrRemoveCssClass:(I,V)=>o(_=>_.setClass(I,V)),setUserCompDetails:I=>m(I),setResizableDisplayed:I=>{n(V=>V.setClass("ag-hidden",!I)),l(I?"false":"true")},setAriaExpanded:I=>c(I),getUserCompInstance:()=>w.current||void 0};s.setComp(x,v.current,S.current)},[]);g.useLayoutEffect(()=>pr(h,e,v.current),[h]),g.useEffect(()=>{v.current&&s.setDragSource(v.current)},[h]);const y=g.useMemo(()=>!!((h==null?void 0:h.componentFromFramework)&&ro(h.componentClass)),[h]),b=g.useMemo(()=>"ag-header-group-cell "+i.toString(),[i]),T=g.useMemo(()=>"ag-header-cell-resize "+r.toString(),[r]),D=h&&h.componentFromFramework,A=h&&h.componentClass;return g.createElement("div",{ref:R,className:b,"col-id":C,role:"columnheader","aria-expanded":d},D&&y&&g.createElement(A,Te({},h.params)),D&&!y&&g.createElement(A,st(Te({},h.params),{ref:w})),g.createElement("div",{ref:S,"aria-hidden":a,className:T}))},ev=g.memo(ZC);function Vl(){W.warnOnce("Using custom components without `reactiveCustomComponents = true` is deprecated.")}var tv=t=>{const{context:e,gos:s}=g.useContext(nt),[i,o]=g.useState(()=>new Dt("ag-header-cell","ag-floating-filter")),[r,n]=g.useState(()=>new Dt),[a,l]=g.useState(()=>new Dt("ag-floating-filter-button","ag-hidden")),[d,c]=g.useState("false"),[h,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=ue=>{ue!=null&&b.current&&b.current(ue)},{ctrl:A}=t,F=g.useCallback(ue=>{if(S.current=ue,!S.current)return;T.current=new Ne(j=>{b.current=j});const J={addOrRemoveCssClass:(j,ee)=>o(Re=>Re.setClass(j,ee)),addOrRemoveBodyCssClass:(j,ee)=>n(Re=>Re.setClass(j,ee)),setButtonWrapperDisplayed:j=>{l(ee=>ee.setClass("ag-hidden",!j)),c(j?"false":"true")},setWidth:j=>{S.current&&(S.current.style.width=j)},setCompDetails:j=>m(j),getFloatingFilterComp:()=>T.current?T.current:null,setMenuIcon:j=>{var ee;return(ee=y.current)==null?void 0:ee.appendChild(j)}};A.setComp(J,S.current,y.current,w.current)},[]);g.useLayoutEffect(()=>pr(h,e,w.current,D),[h]);const x=g.useMemo(()=>i.toString(),[i]),I=g.useMemo(()=>r.toString(),[r]),V=g.useMemo(()=>a.toString(),[a]),_=g.useMemo(()=>!!(h&&h.componentFromFramework&&ro(h.componentClass)),[h]),z=g.useMemo(()=>s.get("reactiveCustomComponents"),[]),k=g.useMemo(()=>{if(h)if(z){const ue=new kC(h.params,()=>v(J=>J+1));return D(ue),ue}else h.componentFromFramework&&Vl()},[h]),le=k==null?void 0:k.getProps(),he=h&&h.componentFromFramework,fe=h&&h.componentClass;return g.createElement("div",{ref:F,className:x,role:"gridcell"},g.createElement("div",{ref:w,className:I,role:"presentation"},he&&!z&&g.createElement(fe,st(Te({},h.params),{ref:_?()=>{}:D})),he&&z&&g.createElement(xl.Provider,{value:{setMethods:ue=>k.setMethods(ue)}},g.createElement(fe,Te({},le)))),g.createElement("div",{ref:R,"aria-hidden":d,className:V,role:"presentation"},g.createElement("button",{ref:y,type:"button",className:"ag-button ag-floating-filter-button-button",tabIndex:-1})))},sv=g.memo(tv),iv=t=>{const{ctrl:e}=t,{topOffset:s,rowHeight:i}=g.useMemo(()=>e.getTopAndHeight(),[]),o=e.getAriaRowIndex(),r=e.getHeaderRowClass(),[n,a]=g.useState(()=>i+"px"),[l,d]=g.useState(()=>s+"px"),c=g.useRef(null),h=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=>a(T),setTop:T=>d(T),setHeaderCtrls:(T,D,A)=>{h.current=c.current,c.current=T;const F=_l(h.current,T,D);F!==h.current&&Ol(A,()=>C(F))},setWidth:T=>{v.current&&(v.current.style.width=T)}};e.setComp(b,!1)},[]),w=g.useMemo(()=>({height:n,top:l}),[n,l]),R=g.useCallback(y=>{switch(e.getType()){case va.COLUMN_GROUP:return g.createElement(ev,{ctrl:y,key:y.getInstanceId()});case va.FLOATING_FILTER:return g.createElement(sv,{ctrl:y,key:y.getInstanceId()});default:return g.createElement(JC,{ctrl:y,key:y.getInstanceId()})}},[]);return g.createElement("div",{ref:S,className:r,role:"row",style:w,"aria-rowindex":o},m.map(R))},ov=g.memo(iv),rv=t=>{const[e,s]=g.useState(!0),[i,o]=g.useState([]),{context:r}=g.useContext(nt),n=g.useRef(null),a=g.useRef(null),l=g.useRef(null),d=t.pinned==="left",c=t.pinned==="right",h=!d&&!c,m=g.useCallback(S=>{if(n.current=S,!n.current){r.destroyBean(l.current),l.current=null;return}const w={setDisplayed:s,setCtrls:R=>o(R),setCenterWidth:R=>{a.current&&(a.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)}};l.current=r.createBean(new Ds(t.pinned)),l.current.setComp(w,n.current)},[]),C=e?"":"ag-hidden",v=()=>i.map(S=>g.createElement(ov,{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()),c&&g.createElement("div",{ref:m,className:"ag-pinned-right-header "+C,"aria-hidden":!e,role:"rowgroup"},v()),h&&g.createElement("div",{ref:m,className:"ag-header-viewport "+C,role:"presentation"},g.createElement("div",{ref:a,className:"ag-header-container",role:"rowgroup"},v())))},Qn=g.memo(rv),nv=()=>{const[t,e]=g.useState(()=>new Dt),[s,i]=g.useState(),{context:o}=g.useContext(nt),r=g.useRef(null),n=g.useRef(null),a=g.useCallback(c=>{if(r.current=c,!c){o.destroyBean(n.current),n.current=null;return}const h={addOrRemoveCssClass:(m,C)=>e(v=>v.setClass(m,C)),setHeightAndMinHeight:m=>i(m)};n.current=o.createBean(new As),n.current.setComp(h,r.current,r.current)},[]),l=g.useMemo(()=>"ag-header "+t.toString(),[t]),d=g.useMemo(()=>({height:s,minHeight:s}),[s]);return g.createElement("div",{ref:a,className:l,style:d,role:"presentation"},g.createElement(Qn,{pinned:"left"}),g.createElement(Qn,{pinned:null}),g.createElement(Qn,{pinned:"right"}))},av=g.memo(nv),lv=(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])},_s=lv,dv=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()}),[])},uv=t=>{const[e,s]=g.useState(),{context:i,popupService:o,localeService:r,gos:n}=g.useContext(nt);return dv(()=>{const{editDetails:a,cellCtrl:l,eParentCell:d}=t,{compDetails:c}=a,h=n.get("stopEditingWhenCellsLoseFocus"),m=i.createBean(new lh(c.params)),C=m.getGui();if(t.jsChildComp){const b=t.jsChildComp.getGui();b&&C.appendChild(b)}const v={column:l.getColumn(),rowNode:l.getRowNode(),type:"popupCellEditor",eventSource:d,ePopup:C,position:a.popupPosition,keepWithinBounds:!0},S=o.positionPopupByComponent.bind(o,v),w=r.getLocaleTextFunc(),R=o.addPopup({modal:h,eChild:C,closeOnEsc:!0,closedCallback:()=>{l.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&&wo.createPortal(t.wrappedContent,e.getGui()))},Ed=g.memo(uv),cv=(t,e,s,i,o,r)=>{const{context:n}=g.useContext(nt),a=g.useCallback(()=>{const l=o.current;if(!l)return;const d=l.getGui();d&&d.parentElement&&d.parentElement.removeChild(d),n.destroyBean(l),o.current=void 0},[]);g.useEffect(()=>{const l=t!=null,d=t&&t.compDetails&&!t.compDetails.componentFromFramework,c=e&&s==null;if(!(l&&d&&!c)){a();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;a()}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(()=>a,[])},hv=cv,pv=class{constructor(t,e){this.cellEditorParams=t,this.refreshProps=e,this.instanceCreated=new Ne(s=>{this.resolveInstanceCreated=s}),this.onValueChange=s=>this.updateValue(s),this.value=t.value}getProps(){return st(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){Gl(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()}},gv=(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())}},fv=(t,e,s)=>{const{compProxy:i}=t;s(i);const o=i.getProps(),r=ro(e);return g.createElement(xl.Provider,{value:{setMethods:n=>i.setMethods(n)}},r&&g.createElement(e,Te({},o)),!r&&g.createElement(e,st(Te({},o),{ref:n=>i.setRef(n)})))},yd=(t,e,s)=>{const i=t.compProxy;return g.createElement(g.Fragment,null,!i&&g.createElement(e,st(Te({},t.compDetails.params),{ref:s})),i&&fv(t,e,s))},mv=(t,e,s,i,o,r)=>{const n=t.compDetails,a=n.componentClass,l=n.componentFromFramework&&!t.popup,d=n.componentFromFramework&&t.popup,c=!n.componentFromFramework&&t.popup;return g.createElement(g.Fragment,null,l&&yd(t,a,e),d&&g.createElement(Ed,{editDetails:t,cellCtrl:o,eParentCell:i,wrappedContent:yd(t,a,s)}),c&&r&&g.createElement(Ed,{editDetails:t,cellCtrl:o,eParentCell:i,jsChildComp:r}))},Cv=(t,e,s,i,o,r,n)=>{const{compDetails:a,value:l}=t,d=!a,c=a&&a.componentFromFramework,h=a&&a.componentClass,m=l!=null&&l.toString?l.toString():l,C=()=>g.createElement(g.Fragment,null,d&&g.createElement(g.Fragment,null,m),c&&!r&&g.createElement(h,st(Te({},a.params),{key:e,ref:i})),c&&r&&g.createElement(h,st(Te({},a.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())},vv=t=>{const{context:e}=g.useContext(nt),{cellCtrl:s,printLayout:i,editingRow:o}=t,r=s.getTabIndex(),n=s.getColumnIdSanitised(),a=s.getInstanceId(),[l,d]=g.useState(()=>s.isCellRenderer()?void 0:{compDetails:void 0,value:s.getValueToDisplay(),force:!1}),[c,h]=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(),x=g.useMemo(()=>s.isForceWrapper(),[s]),I=g.useMemo(()=>s.getCellAriaRole(),[s]),V=g.useRef(null),_=g.useRef(null),z=g.useRef(),k=g.useRef(),le=g.useRef(),he=g.useRef([]),fe=g.useRef(),[ue,J]=g.useState(0),j=g.useCallback(se=>{fe.current=se,J(re=>re+1)},[]),ee=l!=null&&(w||T||y),Re=x||ee,te=g.useCallback((se,re)=>{k.current=re,re&&(gv(se,re,s),re.isCancelBeforeStart&&re.isCancelBeforeStart()&&setTimeout(()=>{s.stopEditing(!0),s.focusCell(!0)}))},[s]),Ce=g.useCallback(se=>te(!0,se),[te]),Ct=g.useCallback(se=>te(!1,se),[te]);let B=g.useRef();B.current||(B.current=new Zo(()=>V.current)),hv(l,Re,fe.current,ue,z,V);const me=g.useRef();g.useLayoutEffect(()=>{const se=me.current,re=l;if(me.current=l,se==null||se.compDetails==null||re==null||re.compDetails==null)return;const Pe=se.compDetails,$=re.compDetails;if(Pe.componentClass!=$.componentClass||_.current==null||_.current.refresh==null)return;_.current.refresh($.params)!=!0&&C(at=>at+1)},[l]),g.useLayoutEffect(()=>{if(!(c&&!c.compDetails.componentFromFramework))return;const re=c.compDetails,Pe=c.popup===!0,$=QC(re);if(!$)return;const we=$.getGui();if(te(Pe,$),!Pe){const at=(x?le:V).current;at==null||at.appendChild(we),$.afterGuiAttached&&$.afterGuiAttached()}return F($),()=>{e.destroyBean($),te(Pe,void 0),F(void 0),we&&we.parentElement&&we.parentElement.removeChild(we)}},[c]);const oe=g.useCallback(se=>{if(le.current=se,!le.current){he.current.forEach(Pe=>Pe()),he.current=[];return}const re=Pe=>{var $;if(Pe){const we=Pe.getGui();($=le.current)==null||$.insertAdjacentElement("afterbegin",we),he.current.push(()=>{e.destroyBean(Pe),W.removeFromParent(we)})}return Pe};if(w){const Pe=s.createSelectionCheckbox();re(Pe)}T&&re(s.createDndSource()),y&&re(s.createRowDragComp())},[s,e,T,y,w]),Le=g.useCallback(se=>{if(V.current=se,!V.current||!s)return;const re={addOrRemoveCssClass:($,we)=>B.current.addOrRemoveCssClass($,we),setUserStyles:$=>S($),getFocusableElement:()=>V.current,setIncludeSelection:$=>R($),setIncludeRowDrag:$=>b($),setIncludeDndSource:$=>D($),getCellEditor:()=>k.current||null,getCellRenderer:()=>_.current?_.current:z.current,getParentOfValue:()=>fe.current?fe.current:le.current?le.current:V.current,setRenderDetails:($,we,at)=>{d(Nt=>(Nt==null?void 0:Nt.compDetails)!==$||(Nt==null?void 0:Nt.value)!==we||(Nt==null?void 0:Nt.force)!==at?{value:we,compDetails:$,force:at}:Nt)},setEditDetails:($,we,at,Nt)=>{if($){let Ns;Nt?Ns=new pv($.params,()=>C(Ln=>Ln+1)):$.componentFromFramework&&Vl(),h({compDetails:$,popup:we,popupPosition:at,compProxy:Ns}),we||d(void 0)}else h(Ns=>{Ns!=null&&Ns.compProxy&&(k.current=void 0)})}},Pe=le.current||void 0;s.setComp(re,V.current,Pe,i,o)},[]),$e=g.useMemo(()=>!!(l&&l.compDetails&&l.compDetails.componentFromFramework&&ro(l.compDetails.componentClass)),[l]);g.useLayoutEffect(()=>{var se;V.current&&(B.current.addOrRemoveCssClass("ag-cell-value",!Re),B.current.addOrRemoveCssClass("ag-cell-inline-editing",!!c&&!c.popup),B.current.addOrRemoveCssClass("ag-cell-popup-editing",!!c&&!!c.popup),B.current.addOrRemoveCssClass("ag-cell-not-inline-editing",!c||!!c.popup),(se=s.getRowCtrl())==null||se.setInlineEditingCss(!!c),s.shouldRestoreFocus()&&!s.isEditing()&&V.current.focus({preventScroll:!0}))});const Ge=()=>g.createElement(g.Fragment,null,l!=null&&Cv(l,m,a,_,Re,$e,j),c!=null&&mv(c,Ct,Ce,V.current,s,A));return g.createElement("div",{ref:Le,style:v,tabIndex:r,role:I,"col-id":n},Re?g.createElement("div",{className:"ag-cell-wrapper",role:"presentation",ref:oe},Ge()):Ge())},wv=g.memo(vv),Sv=t=>{const{context:e,gos:s}=g.useContext(nt),{rowCtrl:i,containerType:o}=t,r=i.getTabIndex(),n=g.useRef(i.getDomOrder()),a=i.isFullWidth(),l=i.getRowNode().displayed,[d,c]=g.useState(()=>l?i.getRowIndex():null),[h,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,x]=g.useState(()=>l?i.getInitialRowTop(o):void 0),[I,V]=g.useState(()=>l?i.getInitialTransform(o):void 0),_=g.useRef(null),z=g.useRef(),k=g.useRef(!1),[le,he]=g.useState(0);g.useEffect(()=>{var B;if(k.current||!D||le>10)return;const me=(B=_.current)==null?void 0:B.firstChild;me?(i.setupDetailRowAutoHeight(me),k.current=!0):he(oe=>oe+1)},[D,le]);let fe=g.useRef();fe.current||(fe.current=new Zo(()=>_.current));const ue=g.useCallback(B=>{if(_.current=B,!_.current){i.unsetComp(o);return}if(!i.isAlive())return;const me={setTop:x,setTransform:V,addOrRemoveCssClass:(oe,Le)=>fe.current.addOrRemoveCssClass(oe,Le),setDomOrder:oe=>n.current=oe,setRowIndex:c,setRowId:m,setRowBusinessKey:v,setUserStyles:w,setCellCtrls:(oe,Le)=>{y.current=R.current,R.current=oe;const $e=_l(y.current,oe,n.current);$e!==y.current&&Ol(Le,()=>T($e))},showFullWidth:oe=>A(oe),getFullWidthCellRenderer:()=>z.current,refreshFullWidth:oe=>te.current?(A(Le=>st(Te({},Le),{params:oe()})),!0):!z.current||!z.current.refresh?!1:z.current.refresh(oe())};i.setComp(me,_.current,o)},[]);g.useLayoutEffect(()=>pr(D,e,_.current,z),[D]);const J=g.useMemo(()=>{const B={top:F,transform:I};return Object.assign(B,S),B},[F,I,S]),j=a&&D&&D.componentFromFramework,ee=!a&&b!=null,Re=g.useMemo(()=>!!((D==null?void 0:D.componentFromFramework)&&ro(D.componentClass)),[D]),te=g.useRef(!1);g.useEffect(()=>{te.current=Re&&!!D&&!!s.get("reactiveCustomComponents")},[Re,D]);const Ce=()=>b==null?void 0:b.map(B=>g.createElement(wv,{cellCtrl:B,editingRow:i.isEditing(),printLayout:i.isPrintLayout(),key:B.getInstanceId()})),Ct=()=>{const B=D.componentClass;return g.createElement(g.Fragment,null,Re&&g.createElement(B,Te({},D.params)),!Re&&g.createElement(B,st(Te({},D.params),{ref:z})))};return g.createElement("div",{ref:ue,role:"row",style:J,"row-index":d,"row-id":h,"row-business-key":C,tabIndex:r},ee&&Ce(),j&&Ct())},Ev=g.memo(Sv),yv=t=>{const{context:e}=g.useContext(nt),{name:s}=t,i=g.useMemo(()=>rh(s),[s]),o=g.useRef(null),r=g.useRef(null),n=g.useRef([]),a=g.useRef([]),[l,d]=g.useState(()=>[]),c=g.useRef(!1),h=g.useRef(),m=g.useMemo(()=>_r.getRowContainerCssClasses(s),[s]),C=g.useMemo(()=>Gt(m.viewport),[m]),v=g.useMemo(()=>Gt(m.container),[m]),S=s===Se.CENTER||s===Se.TOP_CENTER||s===Se.BOTTOM_CENTER||s===Se.STICKY_TOP_CENTER||s===Se.STICKY_BOTTOM_CENTER,w=S?o:r;_s(" 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(h.current),h.current=null),R()){const F=I=>{const V=_l(a.current,n.current,c.current);V!==a.current&&(a.current=V,Ol(I,()=>d(V)))},x={setViewportHeight:I=>{o.current&&(o.current.style.height=I)},setRowCtrls:({rowCtrls:I,useFlushSync:V})=>{const _=!!V&&n.current.length>0&&I.length>0;n.current=I,F(_)},setDomOrder:I=>{c.current!=I&&(c.current=I,F(!1))},setContainerWidth:I=>{r.current&&(r.current.style.width=I)}};h.current=e.createBean(new _r(s)),h.current.setComp(x,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"},l.map(F=>g.createElement(Ev,{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())},Rv=g.memo(yv),bv=()=>{const{context:t,agStackComponentsRegistry:e,resizeObserverService:s}=g.useContext(nt),[i,o]=g.useState(""),[r,n]=g.useState(0),[a,l]=g.useState(0),[d,c]=g.useState("0px"),[h,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,x]=g.useState(""),[I,V]=g.useState(null),[_,z]=g.useState(""),[k,le]=g.useState(null),[he,fe]=g.useState("ag-layout-normal");let ue=g.useRef();ue.current||(ue.current=new Zo(()=>J.current));const J=g.useRef(null),j=g.useRef(null),ee=g.useRef(null),Re=g.useRef(null),te=g.useRef(null),Ce=g.useRef(null),Ct=g.useRef(null),B=g.useRef([]),me=g.useRef([]);_s(" AG Grid Body ",J),_s(" AG Pinned Top ",j),_s(" AG Sticky Top ",ee),_s(" AG Middle ",Ce),_s(" AG Pinned Bottom ",Ct);const oe=g.useCallback(Ci=>{if(J.current=Ci,!J.current){t.destroyBeans(B.current),me.current.forEach(ke=>ke()),B.current=[],me.current=[];return}if(!t)return;const ao=ke=>{const Ut=e.getComponentClass(ke),Bl=t.createBean(new Ut);return B.current.push(Bl),Bl},gs=(ke,Ut)=>{ke.appendChild(Ut),me.current.push(()=>ke.removeChild(Ut))};gs(J.current,document.createComment(" AG Fake Horizontal Scroll ")),gs(J.current,ao("AG-FAKE-HORIZONTAL-SCROLL").getGui()),gs(J.current,document.createComment(" AG Overlay Wrapper ")),gs(J.current,ao("AG-OVERLAY-WRAPPER").getGui()),te.current&&(gs(te.current,document.createComment(" AG Fake Vertical Scroll ")),gs(te.current,ao("AG-FAKE-VERTICAL-SCROLL").getGui()));const Mn={setRowAnimationCssOnBodyViewport:o,setColumnCount:ke=>{J.current&&W.setAriaColCount(J.current,ke)},setRowCount:ke=>{J.current&&W.setAriaRowCount(J.current,ke)},setTopHeight:n,setBottomHeight:l,setStickyTopHeight:c,setStickyTopTop:m,setStickyTopWidth:v,setTopDisplay:A,setBottomDisplay:x,setColumnMovingCss:(ke,Ut)=>ue.current.addOrRemoveCssClass(ke,Ut),updateLayoutClasses:fe,setAlwaysVerticalScrollClass:V,setPinnedTopBottomOverflowY:z,setCellSelectableCss:(ke,Ut)=>le(Ut?ke:null),setBodyViewportWidth:ke=>{Ce.current&&(Ce.current.style.width=ke)},registerBodyViewportResizeListener:ke=>{if(Ce.current){const Ut=s.observeResize(Ce.current,ke);me.current.push(()=>Ut())}},setStickyBottomHeight:w,setStickyBottomBottom:y,setStickyBottomWidth:T},kl=t.createBean(new Qe);B.current.push(kl),kl.setComp(Mn,J.current,Ce.current,j.current,Ct.current,ee.current,Re.current)},[]),Le=g.useMemo(()=>Gt("ag-root","ag-unselectable",he),[he]),$e=g.useMemo(()=>Gt("ag-body-viewport",i,he,I,k),[i,he,I,k]),Ge=g.useMemo(()=>Gt("ag-body",he),[he]),se=g.useMemo(()=>Gt("ag-floating-top",k),[k]),re=g.useMemo(()=>Gt("ag-sticky-top",k),[k]),Pe=g.useMemo(()=>Gt("ag-sticky-bottom",k),[k]),$=g.useMemo(()=>Gt("ag-floating-bottom",k),[k]),we=g.useMemo(()=>({height:r,minHeight:r,display:D,overflowY:_}),[r,D,_]),at=g.useMemo(()=>({height:d,top:h,width:C}),[d,h,C]),Nt=g.useMemo(()=>({height:S,bottom:R,width:b}),[S,R,b]),Ns=g.useMemo(()=>({height:a,minHeight:a,display:F,overflowY:_}),[a,F,_]),Ln=Ci=>g.createElement(Rv,{name:Ci,key:`${Ci}-container`}),no=({section:Ci,children:ao,className:gs,style:Mn})=>g.createElement("div",{ref:Ci,className:gs,role:"presentation",style:Mn},ao.map(Ln));return g.createElement("div",{ref:oe,className:Le,role:"treegrid"},g.createElement(av,null),no({section:j,className:se,style:we,children:[Se.TOP_LEFT,Se.TOP_CENTER,Se.TOP_RIGHT,Se.TOP_FULL_WIDTH]}),g.createElement("div",{className:Ge,ref:te,role:"presentation"},no({section:Ce,className:$e,children:[Se.LEFT,Se.CENTER,Se.RIGHT,Se.FULL_WIDTH]})),no({section:ee,className:re,style:at,children:[Se.STICKY_TOP_LEFT,Se.STICKY_TOP_CENTER,Se.STICKY_TOP_RIGHT,Se.STICKY_TOP_FULL_WIDTH]}),no({section:Re,className:Pe,style:Nt,children:[Se.STICKY_BOTTOM_LEFT,Se.STICKY_BOTTOM_CENTER,Se.STICKY_BOTTOM_RIGHT,Se.STICKY_BOTTOM_FULL_WIDTH]}),no({section:Ct,className:$,style:Ns,children:[Se.BOTTOM_LEFT,Se.BOTTOM_CENTER,Se.BOTTOM_RIGHT,Se.BOTTOM_FULL_WIDTH]}))},Tv=g.memo(bv),Dv=(t,e)=>{const{children:s,eFocusableElement:i,onTabKeyDown:o,gridCtrl:r,forceFocusOutWhenTabGuardsAreEmpty:n}=t,{context:a}=g.useContext(nt),l=g.useRef(null),d=g.useRef(null),c=g.useRef(),h=w=>{const R=w==null?void 0:parseInt(w,10).toString();[l,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=c.current)==null||R.forceFocusOutOfContainer(w)}}));const m=g.useCallback(()=>{if(!l.current&&!d.current){a.destroyBean(c.current),c.current=null;return}if(l.current&&d.current){const w={setTabIndex:h};c.current=a.createBean(new Tn({comp:w,eTopGuard:l.current,eBottomGuard:d.current,eFocusableElement:i,onTabKeyDown:o,forceFocusOutWhenTabGuardsAreEmpty:n,focusInnerElement:R=>r.focusInnerElement(R)}))}},[]),C=g.useCallback(w=>{l.current=w,m()},[m]),v=g.useCallback(w=>{d.current=w,m()},[m]),S=w=>{const R=w==="top"?Rr.TAB_GUARD_TOP:Rr.TAB_GUARD_BOTTOM;return g.createElement("div",{className:`${Rr.TAB_GUARD} ${R}`,role:"presentation",ref:w==="top"?C:v})};return g.createElement(g.Fragment,null,S("top"),s,S("bottom"))},Av=g.forwardRef(Dv),Pv=g.memo(Av),Fv=({context:t})=>{const[e,s]=g.useState(""),[i,o]=g.useState(""),[r,n]=g.useState(""),[a,l]=g.useState(null),[d,c]=g.useState(null),[h,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]);_s(" AG Grid ",w);const F=g.useCallback(z=>{if(w.current=z,!w.current){t.destroyBean(S.current),S.current=null;return}if(t.isDestroyed())return;S.current=t.createBean(new Ms);const k=S.current;T.current=k.focusInnerElement.bind(k);const le={destroyGridUi:()=>{},setRtlClass:s,forceFocusOutOfContainer:he=>{var fe;(fe=R.current)==null||fe.forceFocusOutOfContainer(he)},updateLayoutClasses:n,getFocusableContainers:()=>{var he,fe;const ue=[],J=(he=w.current)==null?void 0:he.querySelector(".ag-root"),j=(fe=w.current)==null?void 0:fe.querySelector(".ag-side-bar:not(.ag-hidden)");return J&&ue.push(J),j&&ue.push(j),ue},setCursor:l,setUserSelect:c};k.setComp(le,w.current,w.current),m(!0)},[]);g.useEffect(()=>{if(!C||!A||!S.current||!y||!w.current)return;const z=S.current,k=[],{agStackComponentsRegistry:le}=A,he=le.getComponentClass("AG-GRID-HEADER-DROP-ZONES"),fe=le.getComponentClass("AG-SIDE-BAR"),ue=le.getComponentClass("AG-STATUS-BAR"),J=le.getComponentClass("AG-WATERMARK"),j=le.getComponentClass("AG-PAGINATION"),ee=[],Re=w.current;if(z.showDropZones()&&he){const te=t.createBean(new he),Ce=te.getGui();Re.insertAdjacentElement("afterbegin",Ce),ee.push(Ce),k.push(te)}if(z.showSideBar()&&fe){const te=t.createBean(new fe),Ce=te.getGui(),Ct=y.querySelector(".ag-tab-guard-bottom");Ct&&(Ct.insertAdjacentElement("beforebegin",Ce),ee.push(Ce)),k.push(te)}if(z.showStatusBar()&&ue){const te=t.createBean(new ue),Ce=te.getGui();Re.insertAdjacentElement("beforeend",Ce),ee.push(Ce),k.push(te)}if(j){const te=t.createBean(new j),Ce=te.getGui();Re.insertAdjacentElement("beforeend",Ce),ee.push(Ce),k.push(te)}if(z.showWatermark()&&J){const te=t.createBean(new J),Ce=te.getGui();Re.insertAdjacentElement("beforeend",Ce),ee.push(Ce),k.push(te)}return()=>{t.destroyBeans(k),ee.forEach(te=>{te.parentElement&&te.parentElement.removeChild(te)})}},[C,y,A]);const x=g.useMemo(()=>Gt("ag-root-wrapper",e,i,r),[e,i,r]),I=g.useMemo(()=>Gt("ag-root-wrapper-body","ag-focus-managed",r),[r]),V=g.useMemo(()=>({userSelect:d??"",WebkitUserSelect:d??"",cursor:a??""}),[d,a]),_=g.useCallback(z=>{R.current=z,v(z!==null)},[]);return g.createElement("div",{ref:F,className:x,style:V,role:"presentation"},g.createElement("div",{className:I,ref:b,role:"presentation"},h&&y&&A&&g.createElement(nt.Provider,{value:A},g.createElement(Pv,{ref:_,eFocusableElement:y,onTabKeyDown:D,gridCtrl:S.current,forceFocusOutWhenTabGuardsAreEmpty:!0},g.createElement(Tv,null)))))},Lv=g.memo(Fv),xh=t=>{var e,s;const i=g.useRef(),o=g.useRef(null),r=g.useRef(null),n=g.useRef([]),a=g.useRef([]),l=g.useRef(t),d=g.useRef(!1),[c,h]=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 YC(()=>m(F=>F+1),t.componentWrappingElement,t.maxComponentCreationTimeMs),n.current.push(()=>{var F;(F=r.current)==null||F.destroy(),r.current=null}));const y=Ir.combineAttributesAndGridOptions(t.gridOptions,t),b={providedBeanInstances:{frameworkComponentWrapper:new Iv(r.current,!!y.reactiveCustomComponents)},modules:R,frameworkOverrides:new xv},T=F=>{h(F),n.current.push(()=>{F.destroy()}),F.getBean($s.NAME).whenReady(()=>{if(F.isDestroyed())return;const I=i.current;I&&t.setGridApi&&t.setGridApi(I,new Oi(I))})},D=F=>{F.getBean($s.NAME).whenReady(()=>{a.current.forEach(I=>I()),a.current.length=0,d.current=!0})},A=new cC;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():a.current.push(w)},[]);return g.useEffect(()=>{const w=Mv(l.current,t);l.current=t,S(()=>{i.current&&Ir.processOnChange(w,i.current)})},[t]),g.createElement("div",{style:v,className:t.className,ref:C},c&&!c.isDestroyed()?g.createElement(Lv,{context:c}):null,(s=(e=r.current)==null?void 0:e.getPortals())!=null?s:null)};function Mv(t,e){const s={};return Object.keys(e).forEach(i=>{const o=e[i];t[i]!==o&&(s[i]=o)}),s}var Iv=class extends hC{constructor(t,e){super(),this.parent=t,this.reactiveCustomComponents=e}createWrapper(t,e){if(this.reactiveCustomComponents){const o=(r=>{switch(r){case"filter":return HC;case"floatingFilterComponent":return BC;case"dateComponent":return VC;case"loadingOverlayComponent":return WC;case"noRowsOverlayComponent":return zC;case"statusPanel":return KC;case"toolPanel":return $C;case"menuItem":return UC}})(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":Vl();break}const s=!e.cellRenderer&&e.propertyName!=="toolPanel";return new Ph(t,this.parent,e,s)}},Nv=g.forwardRef((t,e)=>{const{ctrlsFactory:s,context:i,gos:o,resizeObserverService:r,clientSideRowModel:n,serverSideRowModel:a}=g.useContext(nt),[l,d]=g.useState(()=>new Dt),[c,h]=g.useState(()=>new Dt),[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(()=>l.toString()+" ag-details-row",[l]),D=g.useMemo(()=>c.toString()+" ag-details-grid",[c]);e&&g.useImperativeHandle(e,()=>({refresh(){var x,I;return(I=(x=w.current)==null?void 0:x.refresh())!=null?I:!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(x=>{if(R.current=x,!R.current){i.destroyBean(w.current),y.current&&y.current();return}const I={addOrRemoveCssClass:(_,z)=>d(k=>k.setClass(_,z)),addOrRemoveDetailGridCssClass:(_,z)=>h(k=>k.setClass(_,z)),setDetailGrid:_=>C(_),setRowData:_=>S(_),getGui:()=>R.current},V=s.getInstance("detailCellRenderer");if(V&&(i.createBean(V),V.init(I,t),w.current=V,o.get("detailRowAutoHeight"))){const _=()=>{if(R.current==null)return;const z=R.current.clientHeight;z!=null&&z>0&&setTimeout(()=>{t.node.setRowHeight(z),n?n.onRowHeightChanged():a&&a.onRowHeightChanged()},0)};y.current=r.observeResize(R.current,_),_()}},[]),F=g.useCallback((x,I)=>{var V;(V=w.current)==null||V.registerDetailWithMaster(x,I)},[]);return g.createElement("div",{className:T,ref:A},m&&g.createElement(xh,st(Te({className:D},m),{modules:b,rowData:v,setGridApi:F})))}),xv=class extends Eh{constructor(){super("react"),this.frameworkComponents={agGroupCellRenderer:Sd,agGroupRowRenderer:Sd,agDetailCellRenderer:Nv},this.wrapIncoming=(t,e)=>e==="ensureVisible"?qC(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)}},Gv=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(xh,st(Te({},this.props),{setGridApi:this.setGridApi}))}};const Hl={fill:"currentColor",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16"},Gh=t=>g.createElement("svg",{...Hl,...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"})),Oh=t=>g.createElement("svg",{...Hl,...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"})),_h=t=>g.createElement("svg",{...Hl,...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"})),Vh=t=>{const[e,s]=g.useState("inactive"),[i,o]=g.useState("inactive"),[r,n]=g.useState("inactive"),a=g.useRef(null),[l,d]=g.useState(!1),[c,h]=g.useState(null),m=()=>{t.showColumnMenu(a.current)};g.useEffect(()=>{var T;const b=Array.isArray(t.filterKey)?t.filterKey:[];h(((T=Ad(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(Oh,null)),g.createElement("div",{onClick:b=>v("asc",b),onTouchEnd:b=>v("desc",b),className:`${vt.customSort} ${vt[i]}`},g.createElement(Gh,null)),g.createElement("div",{onClick:b=>v("desc",b),onTouchEnd:b=>v("",b),className:`${vt.customSort} ${vt.customUnSort} ${vt[r]}`},g.createElement(_h,null))));const w={width:"100%"},R=g.useMemo(()=>{var T,D;let b=((T=t.filterSearchRender[t.field])==null?void 0:T.render)||Je.Input;return g.createElement(b,{...((D=t.filterSearchRender[t.field])==null?void 0:D.tPropty)||{},value:c,onChange:A=>{h(A.target?A.target.value:A)},style:w})},[t.field,c]);let y=null;return t.search&&(y=g.createElement("div",null,g.createElement(Je.Popover,{arrow:!1,open:l,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(Je.Button,{type:"primary",onClick:()=>{const b=t.filterKey.filter(D=>D.field!=t.field);c!=null&&c.length&&b.push({field:t.field,value:c});const T=b!=null&&b.length?b:[];t.onSearch(T),t.setfilterKey(T),d(!1)}},t.language?"Search":"搜索"),g.createElement(Je.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),h(null),t.onSearch(T)}},t.language?"Reset":"重置")))},g.createElement(Ud,{style:{color:c?"#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)},Hh=({columnDefs:t=[],loading:e,customBottomTotal:s=!1,onChange:i=()=>{},tableRef:o,tableData:r,pagination:n=!1,reset:a={},customColumn:l=[],filterSearchRender:d={},setfilterKey:c,filterKey:h})=>{const m=g.useMemo(()=>({width:"100%",height:"100%",position:"relative"}),[]),C=g.useMemo(()=>({height:"100%",width:"100%"}),[]),v=Rd.useSelector(x=>x.controller.language),S=g.useMemo(()=>{const x=n&&typeof n=="object"?n.total:void 0;return typeof x=="number"&&!Number.isNaN(x)?x:Array.isArray(r)?r.length:0},[n,r]),w=g.useMemo(()=>{let x={};return t.map((I,V)=>{if(V==0)x[I.field]="Total",x.fromData="total";else{let _=I.lockPosition?"":0;r.map(z=>{let k=I.field!=I.key&&I.key?I.key:I.field,le=["jobCurrency","industries","jobSalaryRange"];!isNaN(Number(z[k]))&&!le.includes(I.field)&&(_+=Number(z[k]))}),x[I.field]=typeof _=="number"&&_>0?_:"--"}}),[x]},[r,t]),R={visible:!0,sortable:!0,active:!1,unSortIcon:!0,minWidth:200,comparator:(x,I,V,_,z)=>0,headerComponent:Vh},y=g.useMemo(()=>({width:170,lockPinned:!0}),[]),b=g.useCallback(x=>{o&&(o.current=x)},[]),T=x=>{var z;const{isNotTip:I,render:V}=x.colDef||{},_=((z=x.data)==null?void 0:z.fromData)==="total";return V&&!_?V(x):g.createElement(Je.Tooltip,{title:I?"":x.value||"",arrow:!0,placement:"top"},typeof x.value=="number"||x.value?x.value:"--")},D=g.useCallback(x=>{var V;const I=((V=x.api.getState().sort)==null?void 0:V.sortModel)??[];i({sort:I[0]??null,optType:"sort"})},[i]),A=x=>{i({column:x.api.getColumnDefs().filter(I=>I.field).map(I=>({...I,pinned:void 0,field:I.field,hide:I.hide,visible:I.visible}))})},F=(x,I)=>{i({optType:"mergeColum",pagination:{page:x,size:I}})};return g.createElement("div",{style:m},e?g.createElement("div",{className:"loadingContent"},g.createElement(Je.Spin,null)):null,g.createElement("div",{style:C,className:"pk-ag-grid AgGridReact"},g.createElement(Gv,{rowData:r,pinnedBottomRowData:s?w:[],defaultColDef:y,suppressRowTransform:!0,onSortChanged:D,onDragStopped:A,suppressDragLeaveHidesColumns:!0,suppressMovableColumns:!1,...a,columnDefs:[...t.map(x=>({...R,...x,headerName:v?x.enDisplay:x.cnDisplay,cellRenderer:T,headerComponentParams:{onSearch:I=>{console.log(I,"搜索"),i({filter:I||{}})},setfilterKey:c,filterKey:h,language:v,filterSearchRender:d,...x}})),...l],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:c})),m?t.createElement(S.Pagination,{total:q,onChange:F,...m}):null)},lt=(e={},r={})=>{var oe;const{sessionKey:n,renderKey:o,setParamsList:a,configKey:s,tableUrl:m,tableRequest:v,getColConfigRequest:N,saveColConfigRequest:x}={...r,...e},i=typeof window<"u"&&!!window.sessionStorage,_=t.useCallback(f=>{if(i)try{window.sessionStorage.setItem(n,JSON.stringify(f))}catch(y){console.warn("[useTableModule] sessionStorage 写入失败:",y)}},[n,i]),L=t.useCallback(()=>{if(!i)return null;try{const f=window.sessionStorage.getItem(n);return f?JSON.parse(f):null}catch(f){return console.warn("[useTableModule] sessionStorage 读取失败:",f),null}},[n,i]),E=t.useRef([]),[R,q]=t.useState([]),[G,U]=t.useState([]),[z,c]=t.useState(void 0),[g,p]=t.useState(!0),d=t.useRef(L()||{}),[F,l]=t.useState(((oe=L())==null?void 0:oe.filter)||[]),u=t.useRef(0),M=t.useRef(v);M.current=v;const D=t.useRef(m);D.current=m;const H=t.useRef(a);H.current=a;const W=t.useRef(o);W.current=o;const J=t.useRef(N);J.current=N;const ne=t.useRef(x);ne.current=x;const Z=t.useCallback(()=>{const{sort:f}=d.current,y=E.current.map(C=>({...C,sort:f&&f.colId==C.field?f.sort:void 0}));q(B(y))},[]),X=t.useCallback(()=>{const f=ne.current;if(!f){console.warn("[useTableModule] 未注入 saveColConfigRequest,跳过列配置保存");return}const y={subcategory:s,userConfig:{pageConfig:{pageSize:d.current.size?d.current.size:null},columnConfig:E.current}},C=f(y);C&&typeof C.catch=="function"&&C.catch(k=>console.error("[useTableModule] 列配置保存失败:",k))},[s]),O=t.useCallback(()=>{const f=M.current;if(!f){console.warn("[useTableModule] 未注入 tableRequest,跳过列表加载"),p(!1);return}u.current+=1;const y=u.current,C=H.current,k=C?C(d.current):d.current;return p(!0),f(k,D.current).then(P=>{if(y!==u.current)return;const b=P==null?void 0:P.response,w=Array.isArray(b)?b:(b==null?void 0:b.data)||[],A=Array.isArray(b)||b==null?void 0:b.total;typeof A=="number"&&!Number.isNaN(A)&&c(A);const V=w.map(h=>({...h,...h._source||{}}));U(V),p(!1)},P=>{y===u.current&&(console.error("[useTableModule] 列表加载失败:",P),p(!1))})},[]),Q=t.useCallback(f=>{const{column:y,optType:C,sort:k,pagination:P,filter:b}=f;let w=[];if(y){const A=new Map(y.map(h=>[h.field,h]));w=E.current.map(h=>{const K=A.get(h.field);if(!K)return{...h};const ce=K.visible!==void 0?K.visible:!K.hide;return{...h,hide:!ce,visible:ce}});const V=new Set(E.current.map(h=>h.field));y.forEach(h=>{if(!V.has(h.field)){const K=h.visible!==void 0?h.visible:!h.hide;w.push({...h,hide:!K,visible:K})}}),E.current=w,X()}C=="mergeColum"&&q(B(w!=null&&w.length?w:E.current)),C=="sort"&&(d.current={...d.current,sort:k},_(d.current),Z(),O()),P&&(d.current={...d.current,...P},_(d.current),O()),b&&(d.current={...d.current,filter:b},d.current.page&&d.current.page>1&&(d.current.page=1),_(d.current),O())},[_,X,Z,O]),re=t.useCallback(()=>{const f=J.current;if(!f){console.warn("[useTableModule] 未注入 getColConfigRequest,跳过列配置加载"),p(!1);return}const{sort:y}=d.current,C=W.current;f(s).then(({response:k})=>{var w;const b=(((w=k==null?void 0:k.userConfig)==null?void 0:w.columnConfig)||[]).map(A=>({...A,hide:!A.visible,visible:A.visible,sort:y&&y.colId==A.field?y.sort:void 0,render:C?C[A.field]:void 0}));q(B(b)),E.current=B(b),O()},k=>{console.error("[useTableModule] 列配置加载失败:",k),p(!1)})},[s,O]),be=t.useCallback(()=>{const f=L()||{};d.current=f,l(f.filter||[]),Z(),O()},[L,Z,O]);t.useEffect(()=>{s&&re()},[s]);const Se=t.useCallback((f={})=>React.createElement(me,{columRef:E,onChange:Q,...f}),[Q]),Ee=t.useCallback((f={})=>React.createElement(Ce,{filterKey:F,setfilterKey:l,loading:g,columnDefs:R,pagination:{current:d.current.page,pageSize:d.current.size,total:z},onChange:Q,tableData:G,...f}),[F,g,R,G,z,Q]);return{SettingTableRender:Se,TableListRender:Ee,getTableData:O,getColConfig:re,saveColConfig:X,resetSesstion:be,tableData:G,setloading:p,loading:g,columnDefs:R,paramsCurrent:d,total:z,filterKey:F}},at={width:"100%"},it=({dataIndex:e,language:r,onChange:n,value:o,...a})=>{const s=t.useMemo(()=>React.createElement(S.Input,{value:o!=null&&o.length?o:null,style:at,...a,onChange:m=>{n(m.target.value)}}),[e,o]);return React.createElement("div",{style:{marginBottom:8}},s)};exports.AG_GRID_THEMES=de;exports.ActionCell=He;exports.CustomHeader=ye;exports.DEFAULT_AG_GRID_THEME=ee;exports.DICT_COLOR_MAP=Ie;exports.EllipsisCell=Be;exports.LinkCell=Le;exports.MayList=ue;exports.MoneyCell=ke;exports.NumberCell=Ae;exports.OtherSlot=it;exports.ROW_HEIGHT_PRESETS=ze;exports.STATUS_PRESETS=Pe;exports.SettingTable=me;exports.SortAscending=ge;exports.SortDescending=he;exports.SortUnSort=pe;exports.TableList=Ce;exports.TagCell=De;exports.TextCell=Me;exports.agGridClass=qe;exports.crmTheme=Oe;exports.cx=xe;exports.debounce=Ne;exports.deepClone=B;exports.formatMoney=ae;exports.formatNumber=Y;exports.formatPercent=ie;exports.get=le;exports.groupBy=Te;exports.isEmpty=j;exports.omitEmpty=we;exports.useTableModule=lt;
337
+ </span>`},onGridReady:b})),n?g.createElement(Je.Pagination,{total:S,onChange:F,...n}):null)},Ov=(t={},e={})=>{var Ct;const{sessionKey:s,renderKey:i,setParamsList:o,configKey:r,tableUrl:n,tableRequest:a,getColConfigRequest:l,saveColConfigRequest:d}={...e,...t},c=typeof window<"u"&&!!window.sessionStorage,h=g.useCallback(B=>{if(c)try{window.sessionStorage.setItem(s,JSON.stringify(B))}catch(me){console.warn("[useTableModule] sessionStorage 写入失败:",me)}},[s,c]),m=g.useCallback(()=>{if(!c)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,c]),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,x]=g.useState(((Ct=m())==null?void 0:Ct.filter)||[]),I=g.useRef(0),V=g.useRef(a);V.current=a;const _=g.useRef(n);_.current=n;const z=g.useRef(o);z.current=o;const k=g.useRef(i);k.current=i;const le=g.useRef(l);le.current=l;const he=g.useRef(d);he.current=d;const fe=g.useCallback(()=>{const{sort:B}=A.current,me=C.current.map(oe=>({...oe,sort:B&&B.colId==oe.field?B.sort:void 0}));S($t(me))},[]),ue=g.useCallback(()=>{const B=he.current;if(!B){console.warn("[useTableModule] 未注入 saveColConfigRequest,跳过列配置保存");return}const me={subcategory:r,userConfig:{pageConfig:{pageSize:A.current.size?A.current.size:null},columnConfig:C.current}},oe=B(me);oe&&typeof oe.catch=="function"&&oe.catch(Le=>console.error("[useTableModule] 列配置保存失败:",Le))},[r]),J=g.useCallback(()=>{const B=V.current;if(!B){console.warn("[useTableModule] 未注入 tableRequest,跳过列表加载"),D(!1);return}I.current+=1;const me=I.current,oe=z.current,Le=oe?oe(A.current):A.current;return D(!0),B(Le,_.current).then($e=>{if(me!==I.current)return;const Ge=$e==null?void 0:$e.response,se=Array.isArray(Ge)?Ge:(Ge==null?void 0:Ge.data)||[],re=Array.isArray(Ge)||Ge==null?void 0:Ge.total;typeof re=="number"&&!Number.isNaN(re)&&b(re);const Pe=se.map($=>({...$,...$._source||{}}));R(Pe),D(!1)},$e=>{me===I.current&&(console.error("[useTableModule] 列表加载失败:",$e),D(!1))})},[]),j=g.useCallback(B=>{const{column:me,optType:oe,sort:Le,pagination:$e,filter:Ge}=B;let se=[];if(me){const re=new Map(me.map($=>[$.field,$]));se=C.current.map($=>{const we=re.get($.field);if(!we)return{...$};const at=we.visible!==void 0?we.visible:!we.hide;return{...$,hide:!at,visible:at}});const Pe=new Set(C.current.map($=>$.field));me.forEach($=>{if(!Pe.has($.field)){const we=$.visible!==void 0?$.visible:!$.hide;se.push({...$,hide:!we,visible:we})}}),C.current=se,ue()}oe=="mergeColum"&&S($t(se!=null&&se.length?se:C.current)),oe=="sort"&&(A.current={...A.current,sort:Le},h(A.current),fe(),J()),$e&&(A.current={...A.current,...$e},h(A.current),J()),Ge&&(A.current={...A.current,filter:Ge},A.current.page&&A.current.page>1&&(A.current.page=1),h(A.current),J())},[h,ue,fe,J]),ee=g.useCallback(()=>{const B=le.current;if(!B){console.warn("[useTableModule] 未注入 getColConfigRequest,跳过列配置加载"),D(!1);return}const{sort:me}=A.current,oe=k.current;B(r).then(({response:Le})=>{var se;const Ge=(((se=Le==null?void 0:Le.userConfig)==null?void 0:se.columnConfig)||[]).map(re=>({...re,hide:!re.visible,visible:re.visible,sort:me&&me.colId==re.field?me.sort:void 0,render:oe?oe[re.field]:void 0}));S($t(Ge)),C.current=$t(Ge),J()},Le=>{console.error("[useTableModule] 列配置加载失败:",Le),D(!1)})},[r,J]),Re=g.useCallback(()=>{const B=m()||{};A.current=B,x(B.filter||[]),fe(),J()},[m,fe,J]);g.useEffect(()=>{r&&ee()},[r]);const te=g.useCallback((B={})=>React.createElement(Kd,{columRef:C,onChange:j,...B}),[j]),Ce=g.useCallback((B={})=>React.createElement(Hh,{filterKey:F,setfilterKey:x,loading:T,columnDefs:v,pagination:{current:A.current.page,pageSize:A.current.size,total:y},onChange:j,tableData:w,...B}),[F,T,v,w,y,j]);return{SettingTableRender:te,TableListRender:Ce,getTableData:J,getColConfig:ee,saveColConfig:ue,resetSesstion:Re,tableData:w,setloading:D,loading:T,columnDefs:v,paramsCurrent:A,total:y,filterKey:F}},_v={width:"100%"},Vv=({dataIndex:t,language:e,onChange:s,value:i,...o})=>{const r=g.useMemo(()=>React.createElement(Je.Input,{value:i!=null&&i.length?i:null,style:_v,...o,onChange:n=>{s(n.target.value)}}),[t,i]);return React.createElement("div",{style:{marginBottom:8}},r)};exports.AG_GRID_SCOPE_CLASS=Pd;exports.AG_GRID_THEMES=sp;exports.ActionCell=Jh;exports.CustomHeader=Vh;exports.DEFAULT_AG_GRID_THEME=Fd;exports.DICT_COLOR_MAP=tp;exports.EllipsisCell=Qh;exports.LinkCell=Xh;exports.MayList=Ad;exports.MoneyCell=Yh;exports.NumberCell=jh;exports.OtherSlot=Vv;exports.ROW_HEIGHT_PRESETS=op;exports.STATUS_PRESETS=ep;exports.SettingTable=Kd;exports.SortAscending=Gh;exports.SortDescending=Oh;exports.SortUnSort=_h;exports.TableList=Hh;exports.TagCell=qh;exports.TextCell=$h;exports.agGridClass=ip;exports.crmTheme=Zh;exports.cx=Kh;exports.debounce=zh;exports.deepClone=$t;exports.formatMoney=Td;exports.formatNumber=Yr;exports.formatPercent=Dd;exports.get=bd;exports.groupBy=Wh;exports.isEmpty=Yo;exports.omitEmpty=Uh;exports.useTableModule=Ov;
8
338
  //# sourceMappingURL=index.cjs.map