import{BeanStub as jd,_getDocument as $d}from"ag-grid-community";var Yd=class{constructor(){this.ieCompatibility=!1}init(){this.ieCompatibility=this.md5("hello")!="5d41402abc4b2a76b9719d911017c592"}md5cycle(e,t){let s=e[0],i=e[1],r=e[2],a=e[3];s=this.ff(s,i,r,a,t[0],7,-680876936),a=this.ff(a,s,i,r,t[1],12,-389564586),r=this.ff(r,a,s,i,t[2],17,606105819),i=this.ff(i,r,a,s,t[3],22,-1044525330),s=this.ff(s,i,r,a,t[4],7,-176418897),a=this.ff(a,s,i,r,t[5],12,1200080426),r=this.ff(r,a,s,i,t[6],17,-1473231341),i=this.ff(i,r,a,s,t[7],22,-45705983),s=this.ff(s,i,r,a,t[8],7,1770035416),a=this.ff(a,s,i,r,t[9],12,-1958414417),r=this.ff(r,a,s,i,t[10],17,-42063),i=this.ff(i,r,a,s,t[11],22,-1990404162),s=this.ff(s,i,r,a,t[12],7,1804603682),a=this.ff(a,s,i,r,t[13],12,-40341101),r=this.ff(r,a,s,i,t[14],17,-1502002290),i=this.ff(i,r,a,s,t[15],22,1236535329),s=this.gg(s,i,r,a,t[1],5,-165796510),a=this.gg(a,s,i,r,t[6],9,-1069501632),r=this.gg(r,a,s,i,t[11],14,643717713),i=this.gg(i,r,a,s,t[0],20,-373897302),s=this.gg(s,i,r,a,t[5],5,-701558691),a=this.gg(a,s,i,r,t[10],9,38016083),r=this.gg(r,a,s,i,t[15],14,-660478335),i=this.gg(i,r,a,s,t[4],20,-405537848),s=this.gg(s,i,r,a,t[9],5,568446438),a=this.gg(a,s,i,r,t[14],9,-1019803690),r=this.gg(r,a,s,i,t[3],14,-187363961),i=this.gg(i,r,a,s,t[8],20,1163531501),s=this.gg(s,i,r,a,t[13],5,-1444681467),a=this.gg(a,s,i,r,t[2],9,-51403784),r=this.gg(r,a,s,i,t[7],14,1735328473),i=this.gg(i,r,a,s,t[12],20,-1926607734),s=this.hh(s,i,r,a,t[5],4,-378558),a=this.hh(a,s,i,r,t[8],11,-2022574463),r=this.hh(r,a,s,i,t[11],16,1839030562),i=this.hh(i,r,a,s,t[14],23,-35309556),s=this.hh(s,i,r,a,t[1],4,-1530992060),a=this.hh(a,s,i,r,t[4],11,1272893353),r=this.hh(r,a,s,i,t[7],16,-155497632),i=this.hh(i,r,a,s,t[10],23,-1094730640),s=this.hh(s,i,r,a,t[13],4,681279174),a=this.hh(a,s,i,r,t[0],11,-358537222),r=this.hh(r,a,s,i,t[3],16,-722521979),i=this.hh(i,r,a,s,t[6],23,76029189),s=this.hh(s,i,r,a,t[9],4,-640364487),a=this.hh(a,s,i,r,t[12],11,-421815835),r=this.hh(r,a,s,i,t[15],16,530742520),i=this.hh(i,r,a,s,t[2],23,-995338651),s=this.ii(s,i,r,a,t[0],6,-198630844),a=this.ii(a,s,i,r,t[7],10,1126891415),r=this.ii(r,a,s,i,t[14],15,-1416354905),i=this.ii(i,r,a,s,t[5],21,-57434055),s=this.ii(s,i,r,a,t[12],6,1700485571),a=this.ii(a,s,i,r,t[3],10,-1894986606),r=this.ii(r,a,s,i,t[10],15,-1051523),i=this.ii(i,r,a,s,t[1],21,-2054922799),s=this.ii(s,i,r,a,t[8],6,1873313359),a=this.ii(a,s,i,r,t[15],10,-30611744),r=this.ii(r,a,s,i,t[6],15,-1560198380),i=this.ii(i,r,a,s,t[13],21,1309151649),s=this.ii(s,i,r,a,t[4],6,-145523070),a=this.ii(a,s,i,r,t[11],10,-1120210379),r=this.ii(r,a,s,i,t[2],15,718787259),i=this.ii(i,r,a,s,t[9],21,-343485551),e[0]=this.add32(s,e[0]),e[1]=this.add32(i,e[1]),e[2]=this.add32(r,e[2]),e[3]=this.add32(a,e[3])}cmn(e,t,s,i,r,a){return t=this.add32(this.add32(t,e),this.add32(i,a)),this.add32(t<>>32-r,s)}ff(e,t,s,i,r,a,o){return this.cmn(t&s|~t&i,e,t,r,a,o)}gg(e,t,s,i,r,a,o){return this.cmn(t&i|s&~i,e,t,r,a,o)}hh(e,t,s,i,r,a,o){return this.cmn(t^s^i,e,t,r,a,o)}ii(e,t,s,i,r,a,o){return this.cmn(s^(t|~i),e,t,r,a,o)}md51(e){const t=e.length,s=[1732584193,-271733879,-1732584194,271733878];let i;for(i=64;i<=e.length;i+=64)this.md5cycle(s,this.md5blk(e.substring(i-64,i)));e=e.substring(i-64);const r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(i=0;i>2]|=e.charCodeAt(i)<<(i%4<<3);if(r[i>>2]|=128<<(i%4<<3),i>55)for(this.md5cycle(s,r),i=0;i<16;i++)r[i]=0;return r[14]=t*8,this.md5cycle(s,r),s}md5blk(e){const t=[];for(let s=0;s<64;s+=4)t[s>>2]=e.charCodeAt(s)+(e.charCodeAt(s+1)<<8)+(e.charCodeAt(s+2)<<16)+(e.charCodeAt(s+3)<<24);return t}rhex(e){const t="0123456789abcdef".split("");let s="",i=0;for(;i<4;i++)s+=t[e>>i*8+4&15]+t[e>>i*8&15];return s}hex(e){for(let t=0;t>16)+(t>>16)+(s>>16)<<16|s&65535}},cs={"01":"GRID","02":"CHARTS","0102":"BOTH"},da="https://www.ag-grid.com/licensing/",ha=class ee{constructor(t){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=t,this.md5=new Yd,this.md5.init()}validateLicense(){const t=this.getLicenseDetails(ee.licenseKey),s=`AG Grid ${t.currentLicenseType==="BOTH"?"and AG Charts ":""}Enterprise`,i=t.suppliedLicenseType===void 0?"":`AG ${t.suppliedLicenseType==="BOTH"?"Grid and AG Charts":t.suppliedLicenseType==="GRID"?"Grid":"Charts"} Enterprise`;if(t.missing)(!this.isWebsiteUrl()||this.isForceWatermark())&&this.outputMissingLicenseKey(s);else if(t.expired){const r=ee.getGridReleaseDate(),a=ee.formatDate(r);this.outputExpiredKey(t.expiry,a,s,i)}else t.valid?t.isTrial&&t.trialExpired&&this.outputExpiredTrialKey(t.expiry,s,i):this.outputInvalidLicenseKey(!!t.incorrectLicenseType,s,i)}static extractExpiry(t){const s=t.substring(t.lastIndexOf("_")+1,t.length);return new Date(parseInt(ee.decode(s),10))}static extractLicenseComponents(t){let s=t.replace(/[\u200B-\u200D\uFEFF]/g,"");if(s=s.replace(/\r?\n|\r/g,""),t.length<=32)return{md5:null,license:t,version:null,isTrial:null};const i=s.length-32,r=s.substring(i),a=s.substring(0,i),[o,n,l]=ee.extractBracketedInformation(s);return{md5:r,license:a,version:o,isTrial:n,type:l}}getLicenseDetails(t){const s=ee.chartsLicenseManager?"BOTH":"GRID";if(!t?.length)return{licenseKey:t,valid:!1,missing:!0,currentLicenseType:s};const i=ee.getGridReleaseDate(),{md5:r,license:a,version:o,isTrial:n,type:l}=ee.extractLicenseComponents(t);let c=r===this.md5.md5(a)&&t.indexOf("For_Trialing_ag-Grid_Only")===-1,d,h,u=null,p=!1,g;function m(){d=uu,o){case"legacy":case"2":{n&&m();break}case"3":l?.length?(g=l,l!==cs["01"]&&l!==cs["0102"]||s==="BOTH"&&g!=="BOTH"?(c=!1,p=!0):n&&m()):c=!1}return c?{licenseKey:t,valid:c,expiry:ee.formatDate(u),expired:h,version:o,isTrial:n,trialExpired:d,incorrectLicenseType:p,currentLicenseType:s,suppliedLicenseType:g}:{licenseKey:t,valid:c,incorrectLicenseType:p,currentLicenseType:s,suppliedLicenseType:g}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isWebsiteUrl()&&!!this.watermarkMessage?.length}getWatermarkMessage(){return this.watermarkMessage||""}getHostname(){const s=(this.document.defaultView||window).location,{hostname:i=""}=s;return i}isForceWatermark(){const s=(this.document.defaultView||window).location,{pathname:i}=s;return i?i.indexOf("forceWatermark")!==-1:!1}isWebsiteUrl(){return this.getHostname().match(/^((?:[\w-]+\.)?ag-grid\.com)$/)!==null}isLocalhost(){return this.getHostname().match(/^(?:127\.0\.0\.1|localhost)$/)!==null}static formatDate(t){const s=["January","February","March","April","May","June","July","August","September","October","November","December"],i=t.getDate(),r=t.getMonth(),a=t.getFullYear();return i+" "+s[r]+" "+a}static getGridReleaseDate(){return new Date(parseInt(ee.decode(ee.RELEASE_INFORMATION),10))}static decode(t){const s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let i="",r,a,o,n,l,c,d,h=0;const u=t.replace(/[^A-Za-z0-9+/=]/g,"");for(;h>4,a=(l&15)<<4|c>>2,o=(c&3)<<6|d,i=i+String.fromCharCode(r),c!=64&&(i=i+String.fromCharCode(a)),d!=64&&(i=i+String.fromCharCode(o));return i=ee.utf8_decode(i),i}static utf8_decode(t){t=t.replace(/rn/g,"n");let s="";for(let i=0;i127&&r<2048?(s+=String.fromCharCode(r>>6|192),s+=String.fromCharCode(r&63|128)):(s+=String.fromCharCode(r>>12|224),s+=String.fromCharCode(r>>6&63|128),s+=String.fromCharCode(r&63|128))}return s}static setChartsLicenseManager(t){this.chartsLicenseManager=t}static setLicenseKey(t){this.licenseKey=t,this.chartsLicenseManager?.setLicenseKey(t,!0)}static extractBracketedInformation(t){if(!t.includes("["))return["legacy",!1,void 0];const s=t.match(/\[(.*?)\]/g).map(n=>n.replace("[","").replace("]",""));if(!s||s.length===0)return["legacy",!1,void 0];const i=s.filter(n=>n==="TRIAL").length===1,r=s.filter(n=>n.indexOf("v")===0)[0],a=r?r.replace("v",""):"legacy",o=cs[s.filter(n=>cs[n])[0]];return[a,i,o]}centerPadAndOutput(t){const s=this.totalMessageLength-t.length;console.error(t.padStart(s/2+t.length,"*").padEnd(this.totalMessageLength,"*"))}padAndOutput(t,s="*",i=""){console.error(t.padEnd(this.totalMessageLength-i.length,s)+i)}outputInvalidLicenseKey(t,s,i){t?(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${s} License `),this.centerPadAndOutput(" Incompatible License Key "),this.padAndOutput(`* Your license key is for ${i} only and does not cover you for ${s}.`," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${da}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")):(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${s} License `),this.centerPadAndOutput(" Invalid License Key "),this.padAndOutput("* Your license key is not valid."," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${da}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="Invalid License"}outputExpiredTrialKey(t,s,i){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${s} License `),this.centerPadAndOutput(" Trial Period Expired. "),this.padAndOutput(`* Your trial only license for ${i} expired on ${t}.`," ","*"),this.padAndOutput("* Please email info@ag-grid.com to purchase a license."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="Trial Period Expired"}outputMissingLicenseKey(t){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(" License Key Not Found "),this.padAndOutput(`* All ${t} features are unlocked for trial.`," ","*"),this.padAndOutput("* If you want to hide the watermark please email info@ag-grid.com for a trial license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="For Trial Use Only"}outputExpiredKey(t,s,i,r){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Incompatible Software Version "),this.padAndOutput(`* Your license key works with versions of ${r} released before ${t}.`," ","*"),this.padAndOutput(`* The version you are trying to use was released on ${s}.`," ","*"),this.padAndOutput("* Please contact info@ag-grid.com to renew your license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="License Expired"}};ha.RELEASE_INFORMATION="MTczOTgwMzI0NzgzNQ==";var bt=ha;import{Component as Xd,RefPlaceholder as qd}from"ag-grid-community";var Zd='.ag-watermark{bottom:20px;color:#9b9b9b;opacity:.7;position:absolute;transition:opacity 1s ease-out 3s;&:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDkiIGhlaWdodD0iMzYiIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyMDkgMzYiPjxwYXRoIGZpbGw9IiM5QjlCOUIiIGQ9Ik0xOTIuOTkzIDIzLjY1OHYtNy45NDZoLTEzLjU0MWwtNy45NDcgNy45NDZ6TTIwOC4yNSAzLjk1aC0xNi45NzRsLTguMDEgNy45NDdoMjQuOTg0ek0xNjMuNjIyIDMxLjYwNWw0LjA2OS00LjA2OWgxMy43MzJ2Ny45NDdoLTE3LjgwMXoiLz48cGF0aCBmaWxsPSIjOUI5QjlCIiBkPSJNMTY2LjYxIDE5Ljc4aDguNzczbDguMDEtNy45NDZIMTY2LjYxek0xNTcuMDExIDMxLjYwNWg2LjYxMWw3Ljg4My03Ljk0N2gtMTQuNDk0ek0xOTEuMjc2IDMuOTVsLTQuMDY4IDQuMDdIMTYxLjI3Vi4wNzJoMzAuMDA2ek0yMC44NCAzMC4yMDZIOC4zNzhsLTIuMTYyIDUuMzRILjc1TDEyLjI1NyA4LjU5Mmg0Ljc2OEwyOC41MyAzNS41NDZoLTUuNTN6bS0xLjcxNy00LjI2TDE0LjYwOSAxNC45NWwtNC41MTQgMTAuOTk4ek0xMDQuNDM3IDE4LjUwOWMxLjU4OS0yLjM1MiA1LjU5NC0yLjYwNyA3LjI0Ny0yLjYwN3Y0LjU3OGMtMi4wMzQgMC00LjA2OS4wNjMtNS4yNzcuOTUzLTEuMjA3Ljg5LTEuODQzIDIuMDk4LTEuODQzIDMuNTZ2MTAuNTUzaC00Ljk1OVYxNS45MDJoNC43Njh6TTExOS4zNzYgMTUuOTAyaC00Ljk1OHYxOS42NDRoNC45NTh6TTExOS4zNzYgNy4xM2gtNC45NTh2NS44NDhoNC45NTh6TTE0My45NzkgNy4xM3YyOC40MTZoLTQuNzY4bC0uMTI3LTIuOTg4YTguMyA4LjMgMCAwIDEtMi42NyAyLjQ4Yy0xLjA4MS41NzItMi40MTYuODktMy45NDIuODktMS4zMzUgMC0yLjYwNi0uMjU1LTMuNjg3LS43LTEuMTQ0LS41MDgtMi4xNjItMS4xNDQtMi45ODgtMi4wMzRhOS42IDkuNiAwIDAgMS0xLjk3MS0zLjE3OWMtLjUwOC0xLjIwNy0uNjk5LTIuNjA2LS42OTktNC4xMzJzLjI1NC0yLjkyNC42OTktNC4xOTZjLjUwOS0xLjI3MSAxLjE0NS0yLjM1MiAxLjk3MS0zLjI0MnMxLjg0NC0xLjU4OSAyLjk4OC0yLjA5OCAyLjM1Mi0uNzYzIDMuNjg3LS43NjNjMS41MjYgMCAyLjc5Ny4yNTUgMy44NzguODI3czEuOTcxIDEuMzM1IDIuNjcgMi40MTZWNy4xOTNoNC45NTl6bS0xMC40MjYgMjQuNTM4YzEuNjUzIDAgMi45MjQtLjU3MiAzLjk0MS0xLjY1M3MxLjUyNi0yLjU0MyAxLjUyNi00LjMyMy0uNTA5LTMuMTc4LTEuNTI2LTQuMzIyYy0xLjAxNy0xLjA4MS0yLjI4OC0xLjY1My0zLjk0MS0xLjY1My0xLjU5IDAtMi45MjUuNTcyLTMuODc4IDEuNjUzLTEuMDE3IDEuMDgtMS41MjYgMi41NDMtMS41MjYgNC4zMjIgMCAxLjc4LjUwOSAzLjE4IDEuNTI2IDQuMjYgMS4wMTcgMS4xNDQgMi4yODggMS43MTYgMy44NzggMS43MTZNNTcuMjAyIDIwLjM1M0g0NC45MzN2NC4yNTloNi45OTNjLS4xOSAyLjE2MS0xLjAxNyAzLjgxNC0yLjQxNiA1LjE1LTEuMzk4IDEuMjctMy4xNzggMS45MDYtNS40NjcgMS45MDYtMS4yNzEgMC0yLjQ4LS4yNTQtMy40OTYtLjY5OWE3IDcgMCAwIDEtMi43MzQtMS45N2MtLjc2My0uODI3LTEuMzM1LTEuODQ0LTEuNzgtMy4wNTJzLS42MzYtMi40OC0uNjM2LTMuOTQyLjE5LTIuNzMzLjYzNi0zLjk0MWMuMzgxLTEuMjA4IDEuMDE3LTIuMTYyIDEuNzgtMy4wNTIuNzYzLS44MjYgMS42NTMtMS40NjIgMi43MzMtMS45N2E5LjEgOS4xIDAgMCAxIDMuNTYtLjdxNC4wMDUgMCA2LjEwMyAxLjkwN2wzLjMwNi0zLjMwNWMtMi40OC0xLjkwNy01LjY1OC0yLjkyNS05LjQwOS0yLjkyNS0yLjA5NyAwLTQuMDA0LjMxOC01LjcyMSAxLjAxOC0xLjcxNi42OTktMy4xNzkgMS41ODktNC4zODYgMi43OTdBMTIuMSAxMi4xIDAgMCAwIDMxLjIgMTYuMjJjLS42MzUgMS43MTctLjk1MyAzLjYyNC0uOTUzIDUuNjU4cy4zMTggMy45NDIgMS4wMTcgNS42NThjLjcgMS43MTcgMS41OSAzLjE3OSAyLjc5NyA0LjM4N2ExMi4xIDEyLjEgMCAwIDAgNC4zODcgMi43OTdjMS43MTYuNyAzLjYyMyAxLjAxNyA1LjY1NyAxLjAxNyAyLjAzNSAwIDMuODc4LS4zMTggNS41MzEtMS4wMTcgMS42NTMtLjcgMy4wNTItMS41OSA0LjE5Ni0yLjc5N3ExLjcxNi0xLjgxMiAyLjY3LTQuMzg3Yy42MzYtMS43MTYuOTU0LTMuNjIzLjk1NC01LjY1OHYtLjgyNmMtLjE5MS0uMTI3LS4yNTUtLjQ0NS0uMjU1LS43TTk1Ljk4MiAyMC4zNTNoLTEyLjI3djQuMjU5aDYuOTkzYy0uMTkgMi4xNjEtMS4wMTcgMy44MTQtMi40MTYgNS4xNS0xLjM5OCAxLjI3LTMuMTc4IDEuOTA2LTUuNDY3IDEuOTA2LTEuMjcxIDAtMi40OC0uMjU0LTMuNDk2LS42OTlhNyA3IDAgMCAxLTIuNzM0LTEuOTdjLS43NjMtLjgyNy0xLjMzNS0xLjg0NC0xLjc4LTMuMDUycy0uNjM2LTIuNDgtLjYzNi0zLjk0Mi4xOS0yLjczMy42MzYtMy45NDFjLjM4MS0xLjIwOCAxLjAxNy0yLjE2MiAxLjc4LTMuMDUyLjc2My0uODI2IDEuNjUzLTEuNDYyIDIuNzM0LTEuOTdhOS4xIDkuMSAwIDAgMSAzLjU2LS43cTQuMDA1IDAgNi4xMDMgMS45MDdsMy4zMDUtMy4zMDVjLTIuNDc5LTEuOTA3LTUuNjU4LTIuOTI1LTkuNDA4LTIuOTI1LTIuMDk4IDAtNC4wMDUuMzE4LTUuNzIyIDEuMDE4LTEuNzE2LjY5OS0zLjE3OCAxLjU4OS00LjM4NiAyLjc5N2ExMi4xIDEyLjEgMCAwIDAtMi43OTcgNC4zODZjLS42MzYgMS43MTctLjk1NCAzLjYyNC0uOTU0IDUuNjU4cy4zMTggMy45NDIgMS4wMTcgNS42NThjLjcgMS43MTcgMS41OSAzLjE3OSAyLjc5NyA0LjM4N2ExMi4xIDEyLjEgMCAwIDAgNC4zODcgMi43OTdjMS43MTYuNyAzLjYyMyAxLjAxNyA1LjY1OCAxLjAxNyAyLjAzNCAwIDMuODc4LS4zMTggNS41My0xLjAxNyAxLjY1My0uNyAzLjA1Mi0xLjU5IDQuMTk2LTIuNzk3cTEuNzE4LTEuODEyIDIuNjctNC4zODdjLjYzNi0xLjcxNi45NTQtMy42MjMuOTU0LTUuNjU4di0uODI2Yy0uMTktLjEyNy0uMjU1LS40NDUtLjI1NS0uNyIvPjwvc3ZnPg==");background-repeat:no-repeat;background-size:170px 40px;content:"";display:block;height:40px;width:170px}}:where(.ag-ltr) .ag-watermark{right:25px}:where(.ag-rtl) .ag-watermark{left:25px}.ag-watermark-text{font-family:Impact,sans-serif;font-size:19px;font-weight:700;opacity:.5}:where(.ag-ltr) .ag-watermark-text{padding-left:.7rem}:where(.ag-rtl) .ag-watermark-text{padding-right:.7rem}',Jd=class extends Xd{constructor(){super(`
`),this.eLicenseTextRef=qd,this.registerCSS(Zd)}wireBeans(e){this.licenseManager=e.licenseManager}postConstruct(){const e=this.shouldDisplayWatermark();this.setDisplayed(e),e&&(this.eLicenseTextRef.textContent=this.licenseManager.getWatermarkMessage(),window.setTimeout(()=>this.addCssClass("ag-opacity-zero"),0),window.setTimeout(()=>this.setDisplayed(!1),5e3))}shouldDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}},Qd={selector:"AG-WATERMARK",component:Jd},ua=class extends jd{constructor(){super(...arguments),this.beanName="licenseManager"}postConstruct(){this.validateLicense()}validateLicense(){this.licenseManager=new bt($d(this.beans)),this.licenseManager.validateLicense()}static getLicenseDetails(e){return new bt(null).getLicenseDetails(e)}getWatermarkSelector(){return Qd}isDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}getWatermarkMessage(){return this.licenseManager.getWatermarkMessage()}static setLicenseKey(e){bt.setLicenseKey(e)}static setChartsLicenseManager(e){bt.setChartsLicenseManager(e)}};import{BaseCreator as eh,_addGridCommonParams as pa,_downloadFile as ga,_getHeaderClassesFromColDef as th,_warn as ma}from"ag-grid-community";import{BaseGridSerializingSession as sh,_addGridCommonParams as ui,_last as ih,_mergeDeep as rh,_warn as ah}from"ag-grid-community";import{_escapeString as oh}from"ag-grid-community";var nh=9525,fa={0:1,"0.00":2,"#,##0":3,"#,##0.00":4,"0%":9,"0.00%":10,"0.00E+00":11,"# ?/?":12,"# ??/??":13,"mm-dd-yy":14,"d-mmm-yy":15,"d-mmm":16,"mmm-yy":17,"h:mm AM/PM":18,"h:mm:ss AM/PM":19,"h:mm":20,"h:mm:ss":21,"m/d/yy h:mm":22,"#,##0 ;(#,##0)":37,"#,##0 ;[Red](#,##0)":38,"#,##0.00;(#,##0.00)":39,"#,##0.00;[Red](#,##0.00)":40,"mm:ss":45,"[h]:mm:ss":46,"mmss.0":47,"##0.0E+0":48,"@":49},ds=`\r `;function Ca(e,t,s){if(!t&&t!==""&&t!==0)return"";let i=t;return typeof t=="boolean"&&s&&(i=s(t)),` ${e}="${i}"`}function lh(e={}){const t="",i=["version"];e.version||(e.version="1.0"),e.encoding&&i.push("encoding"),e.standalone&&i.push("standalone");const r=i.map(a=>`${a}="${e[a]}"`).join(" ");return`${t}xml ${r} ${s}`}function va(e,t){let s="";e.properties&&(e.properties.prefixedAttributes&&e.properties.prefixedAttributes.forEach(r=>{Object.keys(r.map).forEach(a=>{s+=Ca(r.prefix+a,r.map[a],t)})}),e.properties.rawMap&&Object.keys(e.properties.rawMap).forEach(r=>{s+=Ca(r,e.properties.rawMap[r],t)}));let i="<"+e.name+s;return!e.children&&e.textNode==null?i+"/>"+ds:e.textNode!=null?i+">"+e.textNode+""+ds:(i+=">"+ds,e.children&&e.children.forEach(r=>{i+=va(r,t)}),i+""+ds)}var ch=e=>Math.round(e*96/72),rt=e=>Math.ceil(e*nh),dh=e=>{if(e===void 0)return;const s=["Automatic","Roman","Swiss","Modern","Script","Decorative"].indexOf(e||"Automatic");return Math.max(s,0)},hs=(e,t)=>{if(!t)return;let s;return typeof t=="number"?s=t:s=t({rowIndex:e}),s},hh=(e,t)=>{const{colSpan:s,column:i}=e.position;if(e.width)if(s){const r=t.slice(i-1,i+s-1);let a=0;for(let o=0;o{const{rowSpan:s,row:i}=e.position;if(e.height)if(s){let r=0,a=0;for(let o=i;o{const s=lh({encoding:"UTF-8",standalone:"yes"}),i=va(e);return t?i:`${s}${i}`},ze=e=>{const i=String.fromCharCode,r=Math.floor(e/26),a=e%26;return!r||e===26?i(65+e-1):a?r<26?i(65+r-1)+i(65+a-1):ze(r)+i(65+a-1):ze(r-1)+"Z"},pi=e=>{if(e==null)return null;let t="";for(let s=0;s=0&&i<=31&&i!==10){const o=`_x${i.toString(16).toUpperCase().padStart(4,"0")}_`;t+=o}else t+=e[s]}return t},ph=e=>{const t=[];for(const s of e.keys()){const i=s.toString(),r={name:"t",textNode:oh(pi(i),!1)};i.trim().length!==i.length&&(r.properties={rawMap:{"xml:space":"preserve"}}),t.push({name:"si",children:[r]})}return t};import{_escapeString as gh,_getHeaderRowCount as mh,_warn as gi}from"ag-grid-community";var fh={getTemplate(e){const{name:t,ContentType:s,Extension:i,PartName:r}=e;return{name:t,properties:{rawMap:{Extension:i,PartName:r,ContentType:s}}}}},Ch=fh,us=e=>e==="jpg"?"jpeg":e,vh={getTemplate(e){const t=new Array(e).fill(void 0).map((c,d)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",PartName:`/xl/worksheets/sheet${d+1}.xml`})),s=We.size,i=Ee.size,r={};ot.forEach(c=>{r[us(c.type)]=!0});const a=new Array(s).fill(void 0).map((c,d)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml",PartName:`/xl/drawings/drawing${d+1}.xml`})),o=[];ve.forEach(({name:c})=>{o.push({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",PartName:`/xl/tables/${c}.xml`})});const n=Object.keys(r).map(c=>({name:"Default",ContentType:`image/${c}`,Extension:c}));i&&n.push({name:"Default",Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"});const l=[...n,{name:"Default",Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"},{name:"Default",ContentType:"application/xml",Extension:"xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",PartName:"/xl/workbook.xml"},...t,{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml",PartName:"/xl/theme/theme1.xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",PartName:"/xl/styles.xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",PartName:"/xl/sharedStrings.xml"},...a,...o,{name:"Override",ContentType:"application/vnd.openxmlformats-package.core-properties+xml",PartName:"/docProps/core.xml"}].map(c=>Ch.getTemplate(c));return{name:"Types",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"}},children:l}}},yh=vh,Sh={getTemplate(e){const s=new Date().toJSON();return{name:"cp:coreProperties",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",xsi:"http://www.w3.org/2001/XMLSchema-instance"}}]},children:[{name:"dc:creator",textNode:e},{name:"dc:title",textNode:"Workbook"},{name:"dcterms:created",properties:{rawMap:{"xsi:type":"dcterms:W3CDTF"}},textNode:s},{name:"dcterms:modified",properties:{rawMap:{"xsi:type":"dcterms:W3CDTF"}},textNode:s}]}}},bh=Sh,ya=(e,t)=>({name:`xdr:${e}`,children:[{name:"xdr:col",textNode:t.col.toString()},{name:"xdr:colOff",textNode:t.offsetX.toString()},{name:"xdr:row",textNode:t.row.toString()},{name:"xdr:rowOff",textNode:t.offsetY.toString()}]}),wh=e=>{const t=[{name:"a:ext",properties:{rawMap:{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"}},children:[{name:"a16:creationId",properties:{rawMap:{id:"{822E6D20-D7BC-2841-A643-D49A6EF008A2}","xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main"}}}]}];switch(e.recolor&&e.recolor.toLowerCase()){case"grayscale":case"sepia":case"washout":t.push({name:"a:ext",properties:{rawMap:{uri:"{C183D7F6-B498-43B3-948B-1728B52AA6E4}"}},children:[{name:"adec:decorative",properties:{rawMap:{val:"0","xmlns:adec":"http://schemas.microsoft.com/office/drawing/2017/decorative"}}}]})}return{name:"a:extLst",children:t}},xh=(e,t)=>({name:"xdr:nvPicPr",children:[{name:"xdr:cNvPr",properties:{rawMap:{id:t,name:e.id,descr:e.altText!=null?e.altText:void 0}},children:[wh(e)]},{name:"xdr:cNvPicPr",properties:{rawMap:{preferRelativeResize:"0"}},children:[{name:"a:picLocks"}]}]}),Sa=e=>{if(!e.saturation&&!e.tint)return;const t=[];return e.saturation&&t.push({name:"a:satMod",properties:{rawMap:{val:e.saturation*1e3}}}),e.tint&&t.push({name:"a:tint",properties:{rawMap:{val:e.tint*1e3}}}),t},Th=(e,t)=>({name:"a:duotone",children:[{name:"a:prstClr",properties:{rawMap:{val:e.color}},children:Sa(e)},{name:"a:srgbClr",properties:{rawMap:{val:t.color}},children:Sa(t)}]}),Mh=(e,t)=>{let s;if(e.transparency){const i=Math.min(Math.max(e.transparency,0),100);s=[{name:"a:alphaModFix",properties:{rawMap:{amt:1e5-Math.round(i*1e3)}}}]}if(e.recolor)switch(s||(s=[]),e.recolor.toLocaleLowerCase()){case"grayscale":s.push({name:"a:grayscl"});break;case"sepia":s.push(Th({color:"black"},{color:"D9C3A5",tint:50,saturation:180}));break;case"washout":s.push({name:"a:lum",properties:{rawMap:{bright:"70000",contrast:"-70000"}}});break;default:}return{name:"xdr:blipFill",children:[{name:"a:blip",properties:{rawMap:{cstate:"print","r:embed":`rId${t}`,"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}},children:s},{name:"a:stretch",children:[{name:"a:fillRect"}]}]}},Ph=(e,t)=>{const s={name:"a:xfrm",children:[{name:"a:off",properties:{rawMap:{x:0,y:0}}},{name:"a:ext",properties:{rawMap:{cx:t.width,cy:t.height}}}]};if(e.rotation){const a=e.rotation;s.properties={rawMap:{rot:Math.min(Math.max(a,0),360)*6e4}}}return{name:"xdr:spPr",children:[s,{name:"a:prstGeom",properties:{rawMap:{prst:"rect"}},children:[{name:"a:avLst"}]}]}},Fh=e=>{e.fitCell=!!e.fitCell||!e.width||!e.height;const{position:t={},fitCell:s,width:i=0,height:r=0,totalHeight:a,totalWidth:o}=e,{offsetX:n=0,offsetY:l=0,row:c=1,rowSpan:d=1,column:h=1,colSpan:u=1}=t;return{from:{row:c-1,col:h-1,offsetX:rt(n),offsetY:rt(l)},to:{row:c-1+(s?1:d-1),col:h-1+(s?1:u-1),offsetX:rt(i+n),offsetY:rt(r+l)},height:rt(a||r),width:rt(o||i)}},Ah=(e,t,s,i)=>({name:"xdr:pic",children:[xh(e,t+1),Mh(e,s+1),Ph(e,i)]}),Rh={getTemplate(e){const{sheetIndex:t}=e,s=We.get(t),i=Ft.get(t),r=s.map((a,o)=>{const n=Fh(a);return{name:"xdr:twoCellAnchor",properties:{rawMap:{editAs:"absolute"}},children:[ya("from",n.from),ya("to",n.to),Ah(a,o,i.get(a.id).index,n),{name:"xdr:clientData"}]}});return{name:"xdr:wsDr",properties:{rawMap:{"xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main","xmlns:xdr":"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"}},children:r}}},Eh=Rh,Ih={getTemplate(e){const{Id:t,Type:s,Target:i}=e;return{name:"Relationship",properties:{rawMap:{Id:t,Type:s,Target:i}}}}},Dh=Ih,Lh={getTemplate(e){const t=e.map(s=>Dh.getTemplate(s));return{name:"Relationships",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"}},children:t}}},wt=Lh,kh={getTemplate(e){return{name:"sst",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",count:e.size,uniqueCount:e.size}},children:ph(e)}}},Gh=kh,Oh=e=>{switch(e){case 1:return"thin";case 2:return"medium";case 3:return"thick";default:return"hair"}},Nh={None:"None",Dot:"Dotted",Dash:"Dashed",Double:"Double",DashDot:"DashDot",DashDotDot:"DashDotDot",SlantDashDot:"SlantDashDot",Continuous:"Continuous"},Bh=["Dashed","DashDot","DashDotDot"],_h={None:"none",Solid:"solid",Gray50:"mediumGray",Gray75:"darkGray",Gray25:"lightGray",HorzStripe:"darkHorizontal",VertStripe:"darkVertical",ReverseDiagStripe:"darkDown",DiagStripe:"darkUp",DiagCross:"darkGrid",ThickDiagCross:"darkTrellis",ThinHorzStripe:"lightHorizontal",ThinVertStripe:"lightVertical",ThinReverseDiagStripe:"lightDown",ThinDiagStripe:"lightUp",ThinHorzCross:"lightGrid",ThinDiagCross:"lightTrellis",Gray125:"gray125",Gray0625:"gray0625"},Vh={Automatic:"general",Left:"left",Center:"center",Right:"right",Fill:"fill",Justify:"justify",CenterAcrossSelection:"centerContinuous",Distributed:"distributed",JustifyDistributed:"justify"},Hh={Automatic:void 0,Top:"top",Bottom:"bottom",Center:"center",Justify:"justify",Distributed:"distributed",JustifyDistributed:"justify"},zh=e=>e?_h[e]||e:"none",Re=e=>e==null?e:(e.charAt(0)==="#"&&(e=e.substring(1)),e.length===6?"FF"+e:e),ps=(e,t)=>{if(!e)return"thin";const s=Oh(t);if(e==="Continuous")return s;const i=Nh[e];return s==="medium"&&Bh.some(r=>r===i)?`medium${i}`:`${i.charAt(0).toLowerCase()}${i.substring(1)}`},Uh=e=>Vh[e]||"general",Kh=e=>Hh[e]||void 0,xt=e=>({name:"color",properties:{rawMap:{rgb:Re(e||"#000000")}}}),Wh={getTemplate(e){const{left:t,right:s,top:i,bottom:r,diagonal:a}=e,o=t?[xt(t.color)]:void 0,n=s?[xt(s.color)]:void 0,l=i?[xt(i.color)]:void 0,c=r?[xt(r.color)]:void 0,d=a?[xt(a.color)]:void 0;return{name:"border",children:[{name:"left",properties:{rawMap:{style:t&&t.style}},children:o},{name:"right",properties:{rawMap:{style:s&&s.style}},children:n},{name:"top",properties:{rawMap:{style:i&&i.style}},children:l},{name:"bottom",properties:{rawMap:{style:r&&r.style}},children:c},{name:"diagonal",properties:{rawMap:{style:a&&a.style}},children:d}]}}},jh=Wh,$h={getTemplate(e){return{name:"borders",properties:{rawMap:{count:e.length}},children:e.map(t=>jh.getTemplate(t))}}},Yh=$h,Xh=e=>{const s=["Context","LeftToRight","RightToLeft"].indexOf(e);return Math.max(s,0)},qh={getTemplate(e){const{horizontal:t,indent:s,readingOrder:i,rotate:r,shrinkToFit:a,vertical:o,wrapText:n}=e;return{name:"alignment",properties:{rawMap:{horizontal:t&&Uh(t),indent:s,readingOrder:i&&Xh(i),textRotation:r,shrinkToFit:a,vertical:o&&Kh(o),wrapText:n}}}}},Zh=qh,Jh={getTemplate(e){const t=e.protected===!1?0:1;return{name:"protection",properties:{rawMap:{hidden:e.hideFormula===!0?1:0,locked:t}}}}},Qh=Jh,eu={getTemplate(e){const{alignment:t,borderId:s,fillId:i,fontId:r,numFmtId:a,protection:o,quotePrefix:n,xfId:l}=e,c=[];return t&&c.push(Zh.getTemplate(t)),o&&c.push(Qh.getTemplate(o)),{name:"xf",properties:{rawMap:{applyAlignment:t?1:void 0,applyProtection:o?1:void 0,applyBorder:s?1:void 0,applyFill:i?1:void 0,borderId:s,fillId:i,applyFont:r?1:void 0,fontId:r,applyNumberFormat:a?1:void 0,numFmtId:a,quotePrefix:n?1:void 0,xfId:l}},children:c.length?c:void 0}}},ba=eu,tu={getTemplate(e){return{name:"cellStyleXfs",properties:{rawMap:{count:e.length}},children:e.map(t=>ba.getTemplate(t))}}},su=tu,iu={getTemplate(e){const{builtinId:t,name:s,xfId:i}=e;return{name:"cellStyle",properties:{rawMap:{builtinId:t,name:s,xfId:i}}}}},ru=iu,au={getTemplate(e){return{name:"cellStyles",properties:{rawMap:{count:e.length}},children:e.map(t=>ru.getTemplate(t))}}},ou=au,nu={getTemplate(e){return{name:"cellXfs",properties:{rawMap:{count:e.length}},children:e.map(t=>ba.getTemplate(t))}}},lu=nu,cu={getTemplate(e){const{patternType:t,fgTheme:s,fgTint:i,fgRgb:r,bgRgb:a,bgIndexed:o}=e,n={name:"patternFill",properties:{rawMap:{patternType:t}}};return(s||i||r)&&(n.children=[{name:"fgColor",properties:{rawMap:{theme:s,tint:i,rgb:r}}}]),(o||a)&&(n.children||(n.children=[]),n.children.push({name:"bgColor",properties:{rawMap:{indexed:o,rgb:a}}})),{name:"fill",children:[n]}}},du=cu,hu={getTemplate(e){return{name:"fills",properties:{rawMap:{count:e.length}},children:e.map(t=>du.getTemplate(t))}}},uu=hu,pu={getTemplate(e){const{size:t,colorTheme:s,color:i="FF000000",fontName:r="Calibri",family:a,scheme:o,italic:n,bold:l,strikeThrough:c,outline:d,shadow:h,underline:u,verticalAlign:p}=e,g=[{name:"sz",properties:{rawMap:{val:t}}},{name:"color",properties:{rawMap:{theme:s,rgb:i}}},{name:"name",properties:{rawMap:{val:r}}}];return a&&g.push({name:"family",properties:{rawMap:{val:a}}}),o&&g.push({name:"scheme",properties:{rawMap:{val:o}}}),n&&g.push({name:"i"}),l&&g.push({name:"b"}),c&&g.push({name:"strike"}),d&&g.push({name:"outline"}),h&&g.push({name:"shadow"}),u&&g.push({name:"u",properties:{rawMap:{val:u}}}),p&&g.push({name:"vertAlign",properties:{rawMap:{val:p}}}),{name:"font",children:g}}},gu=pu,mu={getTemplate(e){return{name:"fonts",properties:{rawMap:{count:e.length}},children:e.map(t=>gu.getTemplate(t))}}},fu=mu;import{_escapeString as Cu}from"ag-grid-community";function vu(e){const t=e.split(/(\[[^\]]*\])/);for(let s=0;sSu.getTemplate(t))}}},wu=bu,gs,at,Tt,Mt,Pt,wa,ms,xa,mi,Ta=(e,t)=>(e.indexOf("mixedStyle")!==-1&&t>1&&(e+=`_${t}`),e),Ma=()=>{gs={base:0},at=[],Tt=[{fontName:"Calibri",colorTheme:"1",family:"2",scheme:"minor"}],Mt=[{patternType:"none"},{patternType:"gray125"}],Pt=[{left:void 0,right:void 0,top:void 0,bottom:void 0,diagonal:void 0}],wa=[{borderId:0,fillId:0,fontId:0,numFmtId:0}],ms=[{borderId:0,fillId:0,fontId:0,numFmtId:0,xfId:0}],xa=[{builtinId:0,name:"Normal",xfId:0}]},xu=e=>{const t=zh(e.pattern),s=Re(e.color),i=Re(e.patternColor);let r=Mt.findIndex(a=>{const{patternType:o,fgRgb:n,bgRgb:l}=a;return!(o!=t||n!=s||l!=i)});return r===-1&&(r=Mt.length,Mt.push({patternType:t,fgRgb:s,bgRgb:i})),r},Tu=e=>{if(fa[e])return fa[e];let t=at.findIndex(s=>s.formatCode===e);return t===-1?(t=at.length+164,at.push({formatCode:e,numFmtId:t})):t=at[t].numFmtId,t},Mu=e=>{const{borderBottom:t,borderTop:s,borderLeft:i,borderRight:r}=e;let a,o,n,l,c,d,h,u;i&&(n=ps(i.lineStyle,i.weight),h=Re(i.color)),r&&(l=ps(r.lineStyle,r.weight),u=Re(r.color)),t&&(a=ps(t.lineStyle,t.weight),c=Re(t.color)),s&&(o=ps(s.lineStyle,s.weight),d=Re(s.color));let p=Pt.findIndex(g=>{const{left:m,right:C,top:f,bottom:v}=g;if(!m&&(n||h)||!C&&(l||u)||!f&&(o||d)||!v&&(a||c))return!1;const{style:y,color:x}=m||{},{style:S,color:w}=C||{},{style:T,color:P}=f||{},{style:F,color:A}=v||{};return!(y!=n||x!=h||S!=l||w!=u||T!=o||P!=d||F!=a||A!=c)});return p===-1&&(p=Pt.length,Pt.push({left:{style:n,color:h},right:{style:l,color:u},top:{style:o,color:d},bottom:{style:a,color:c},diagonal:{style:void 0,color:void 0}})),p},Pu=e=>{const{fontName:t="Calibri",color:s,size:i,bold:r,italic:a,outline:o,shadow:n,strikeThrough:l,underline:c,family:d,verticalAlign:h}=e,u=Re(s),p=dh(d),g=c?c.toLocaleLowerCase():void 0,m=h?h.toLocaleLowerCase():void 0;let C=Tt.findIndex(f=>!(f.fontName!=t||f.color!=u||f.size!=i||f.bold!=r||f.italic!=a||f.outline!=o||f.shadow!=n||f.strikeThrough!=l||f.underline!=g||f.verticalAlign!=m||f.family!=p));return C===-1&&(C=Tt.length,Tt.push({fontName:t,color:u,size:i,bold:r,italic:a,outline:o,shadow:n,strikeThrough:l,underline:g,verticalAlign:m,family:p?.toString()})),C},Fu=e=>{const{alignment:t,borders:s,font:i,interior:r,numberFormat:a,protection:o,quotePrefix:n}=e;let{id:l}=e,c=0,d=0,h=0,u=0;l&&(l=Ta(l,mi),gs[l]==null&&(r&&(c=xu(r)),s&&(d=Mu(s)),i&&(h=Pu(i)),a&&(u=Tu(a.format)),gs[l]=ms.length,ms.push({alignment:t,borderId:d||0,fillId:c||0,fontId:h||0,numFmtId:u||0,protection:o,quotePrefix:n,xfId:0})))},Au={getTemplate(e){const t=wu.getTemplate(at),s=fu.getTemplate(Tt.map(l=>({...l,size:l.size!=null?l.size:e}))),i=uu.getTemplate(Mt),r=Yh.getTemplate(Pt),a=su.getTemplate(wa),o=lu.getTemplate(ms),n=ou.getTemplate(xa);return Ma(),{name:"styleSheet",properties:{rawMap:{"mc:Ignorable":"x14ac x16r2 xr",xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac","xmlns:x16r2":"http://schemas.microsoft.com/office/spreadsheetml/2015/02/main","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision"}},children:[t,s,i,r,a,o,n,{name:"tableStyles",properties:{rawMap:{count:0,defaultPivotStyle:"PivotStyleLight16",defaultTableStyle:"TableStyleMedium2"}}}]}}},Ru=(e,t)=>gs[Ta(e,t)]||0,Eu=(e,t)=>{mi=t,mi===1&&Ma(),e.forEach(Fu)},Iu=Au,Du={getTemplate(e,t){const{name:s,columns:i,rowRange:r,displayName:a,showRowStripes:o,showColumnStripes:n,showFilterButtons:l,highlightFirstColumn:c,highlightLastColumn:d}=e||{},h=!r||r[0]-r[1]===0;if(!e||!s||!Array.isArray(i)||!i.length||h)return{name:"table"};const u=i.map((v,y)=>({name:"filterColumn",properties:{rawMap:{colId:y.toString(),hiddenButton:l[y]?0:1}}})),p=`A${r[0]}`,g=`${ze(i.length)}${r[1]}`,m=`${p}:${g}`,C=`${t+1}`,f=t?`${a}_${C}`:a;return{name:"table",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"xr xr3","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision","xmlns:xr3":"http://schemas.microsoft.com/office/spreadsheetml/2016/revision3",name:s,displayName:f,ref:m,totalsRowShown:0,id:C}},children:[{name:"autoFilter",properties:{rawMap:{ref:m}},children:u},{name:"tableColumns",properties:{rawMap:{count:i.length}},children:i.map((v,y)=>({name:"tableColumn",properties:{rawMap:{id:(y+1).toString(),name:v,dataCellStyle:"Normal"}}}))},{name:"tableStyleInfo",properties:{rawMap:{name:"TableStyleLight1",showFirstColumn:c?1:0,showLastColumn:d?1:0,showRowStripes:o?1:0,showColumnStripes:n?1:0}}}]}}},Lu=Du,re=e=>{const[t,s,i,r]=e;return{name:`a:${t}`,children:[{name:`a:${s}`,properties:{rawMap:{val:i,lastClr:r}}}]}},ku={getTemplate(){return{name:"a:clrScheme",properties:{rawMap:{name:"Office"}},children:[re(["dk1","sysClr","windowText","000000"]),re(["lt1","sysClr","window","FFFFFF"]),re(["dk2","srgbClr","44546A"]),re(["lt2","srgbClr","E7E6E6"]),re(["accent1","srgbClr","4472C4"]),re(["accent2","srgbClr","ED7D31"]),re(["accent3","srgbClr","A5A5A5"]),re(["accent4","srgbClr","FFC000"]),re(["accent5","srgbClr","5B9BD5"]),re(["accent6","srgbClr","70AD47"]),re(["hlink","srgbClr","0563C1"]),re(["folHlink","srgbClr","954F72"])]}}},Gu=ku,b=e=>{const[t,s,i,r]=e;return{name:`a:${t}`,properties:{rawMap:{script:i,typeface:s,panose:r}}}},Ou={getTemplate(){return{name:"a:fontScheme",properties:{rawMap:{name:"Office"}},children:[{name:"a:majorFont",children:[b(["latin","Calibri Light",void 0,"020F0302020204030204"]),b(["ea",""]),b(["cs",""]),b(["font","\u6E38\u30B4\u30B7\u30C3\u30AF Light","Jpan"]),b(["font","\uB9D1\uC740 \uACE0\uB515","Hang"]),b(["font","\u7B49\u7EBF Light","Hans"]),b(["font","\u65B0\u7D30\u660E\u9AD4","Hant"]),b(["font","Times New Roman","Arab"]),b(["font","Times New Roman","Hebr"]),b(["font","Tahoma","Thai"]),b(["font","Nyala","Ethi"]),b(["font","Vrinda","Beng"]),b(["font","Shruti","Gujr"]),b(["font","MoolBoran","Khmr"]),b(["font","Tunga","Knda"]),b(["font","Raavi","Guru"]),b(["font","Euphemia","Cans"]),b(["font","Plantagenet Cherokee","Cher"]),b(["font","Microsoft Yi Baiti","Yiii"]),b(["font","Microsoft Himalaya","Tibt"]),b(["font","MV Boli","Thaa"]),b(["font","Mangal","Deva"]),b(["font","Gautami","Telu"]),b(["font","Latha","Taml"]),b(["font","Estrangelo Edessa","Syrc"]),b(["font","Kalinga","Orya"]),b(["font","Kartika","Mlym"]),b(["font","DokChampa","Laoo"]),b(["font","Iskoola Pota","Sinh"]),b(["font","Mongolian Baiti","Mong"]),b(["font","Times New Roman","Viet"]),b(["font","Microsoft Uighur","Uigh"]),b(["font","Sylfaen","Geor"]),b(["font","Arial","Armn"]),b(["font","Leelawadee UI","Bugi"]),b(["font","Microsoft JhengHei","Bopo"]),b(["font","Javanese Text","Java"]),b(["font","Segoe UI","Lisu"]),b(["font","Myanmar Text","Mymr"]),b(["font","Ebrima","Nkoo"]),b(["font","Nirmala UI","Olck"]),b(["font","Ebrima","Osma"]),b(["font","Phagspa","Phag"]),b(["font","Estrangelo Edessa","Syrn"]),b(["font","Estrangelo Edessa","Syrj"]),b(["font","Estrangelo Edessa","Syre"]),b(["font","Nirmala UI","Sora"]),b(["font","Microsoft Tai Le","Tale"]),b(["font","Microsoft New Tai Lue","Talu"]),b(["font","Ebrima","Tfng"])]},{name:"a:minorFont",children:[b(["latin","Calibri",void 0,"020F0502020204030204"]),b(["ea",""]),b(["cs",""]),b(["font","\u6E38\u30B4\u30B7\u30C3\u30AF","Jpan"]),b(["font","\uB9D1\uC740 \uACE0\uB515","Hang"]),b(["font","\u7B49\u7EBF","Hans"]),b(["font","\u65B0\u7D30\u660E\u9AD4","Hant"]),b(["font","Arial","Arab"]),b(["font","Arial","Hebr"]),b(["font","Tahoma","Thai"]),b(["font","Nyala","Ethi"]),b(["font","Vrinda","Beng"]),b(["font","Shruti","Gujr"]),b(["font","DaunPenh","Khmr"]),b(["font","Tunga","Knda"]),b(["font","Raavi","Guru"]),b(["font","Euphemia","Cans"]),b(["font","Plantagenet Cherokee","Cher"]),b(["font","Microsoft Yi Baiti","Yiii"]),b(["font","Microsoft Himalaya","Tibt"]),b(["font","MV Boli","Thaa"]),b(["font","Mangal","Deva"]),b(["font","Gautami","Telu"]),b(["font","Latha","Taml"]),b(["font","Estrangelo Edessa","Syrc"]),b(["font","Kalinga","Orya"]),b(["font","Kartika","Mlym"]),b(["font","DokChampa","Laoo"]),b(["font","Iskoola Pota","Sinh"]),b(["font","Mongolian Baiti","Mong"]),b(["font","Arial","Viet"]),b(["font","Microsoft Uighur","Uigh"]),b(["font","Sylfaen","Geor"]),b(["font","Arial","Armn"]),b(["font","Leelawadee UI","Bugi"]),b(["font","Microsoft JhengHei","Bopo"]),b(["font","Javanese Text","Java"]),b(["font","Segoe UI","Lisu"]),b(["font","Myanmar Text","Mymr"]),b(["font","Ebrima","Nkoo"]),b(["font","Nirmala UI","Olck"]),b(["font","Ebrima","Osma"]),b(["font","Phagspa","Phag"]),b(["font","Estrangelo Edessa","Syrn"]),b(["font","Estrangelo Edessa","Syrj"]),b(["font","Estrangelo Edessa","Syre"]),b(["font","Nirmala UI","Sora"]),b(["font","Microsoft Tai Le","Tale"]),b(["font","Microsoft New Tai Lue","Talu"]),b(["font","Ebrima","Tfng"])]}]}}},Nu=Ou,ue=(e,t,s)=>({name:`a:${e}`,properties:{rawMap:{val:t}},children:s}),fi=e=>{const[t,s,i,r,a,o]=e,n=[];return n.push(ue("satMod",i)),r&&n.push(ue("lumMod",r)),a&&n.push(ue("tint",a)),o&&n.push(ue("shade",o)),{name:"a:gs",properties:{rawMap:{pos:t}},children:[{name:"a:schemeClr",properties:{rawMap:{val:s}},children:n}]}},fs=(e,t)=>({name:"a:solidFill",children:[ue("schemeClr",e,t)]}),Ci=e=>{const[t,s,i,r,a]=e,[o,n]=a;return{name:"a:gradFill",properties:{rawMap:{rotWithShape:t}},children:[{name:"a:gsLst",children:[fi(s),fi(i),fi(r)]},{name:"a:lin",properties:{rawMap:{ang:o,scaled:n}}}]}},vi=e=>{const[t,s,i,r]=e;return{name:"a:ln",properties:{rawMap:{w:t,cap:s,cmpd:i,algn:r}},children:[fs("phClr"),ue("prstDash","solid"),{name:"a:miter",properties:{rawMap:{lim:"800000"}}}]}},yi=e=>{const t=[];if(e){const[s,i,r,a,o]=e;t.push({name:"a:outerShdw",properties:{rawMap:{blurRad:s,dist:i,dir:r,algn:a,rotWithShape:o}},children:[ue("srgbClr","000000",[ue("alpha","63000")])]})}return{name:"a:effectStyle",children:[Object.assign({},{name:"a:effectLst"},t.length?{children:t}:{})]}},Bu=()=>({name:"a:fillStyleLst",children:[fs("phClr"),Ci(["1",["0","phClr","105000","110000","67000"],["50000","phClr","103000","105000","73000"],["100000","phClr","109000","105000","81000"],["5400000","0"]]),Ci(["1",["0","phClr","103000","102000","94000"],["50000","phClr","110000","100000",void 0,"100000"],["100000","phClr","120000","99000",void 0,"78000"],["5400000","0"]])]}),_u=()=>({name:"a:lnStyleLst",children:[vi(["6350","flat","sng","ctr"]),vi(["12700","flat","sng","ctr"]),vi(["19050","flat","sng","ctr"])]}),Vu=()=>({name:"a:effectStyleLst",children:[yi(),yi(),yi(["57150","19050","5400000","ctr","0"])]}),Hu=()=>({name:"a:bgFillStyleLst",children:[fs("phClr"),fs("phClr",[ue("tint","95000"),ue("satMod","170000")]),Ci(["1",["0","phClr","150000","102000","93000","98000"],["50000","phClr","130000","103000","98000","90000"],["100000","phClr","120000",void 0,void 0,"63000"],["5400000","0"]])]}),zu={getTemplate(){return{name:"a:fmtScheme",properties:{rawMap:{name:"Office"}},children:[Bu(),_u(),Vu(),Hu()]}}},Uu=zu,Ku={getTemplate(){return{name:"a:themeElements",children:[Gu.getTemplate(),Nu.getTemplate(),Uu.getTemplate()]}}},Wu=Ku,ju={getTemplate(){return{name:"a:theme",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{a:"http://schemas.openxmlformats.org/drawingml/2006/main"}}],rawMap:{name:"Office Theme"}},children:[Wu.getTemplate(),{name:"a:objectDefaults"},{name:"a:extraClrSchemeLst"}]}}},$u=ju,Yu=()=>({name:"o:shapelayout",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}]},children:[{name:"o:idmap",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}],rawMap:{data:"1"}}}]}),Xu=()=>({name:"v:stroke",properties:{rawMap:{joinstyle:"miter"}}}),qu=e=>({name:"v:formulas",children:e.map(t=>({name:"v:f",properties:{rawMap:{eqn:t}}}))}),Zu=()=>({name:"v:path",properties:{prefixedAttributes:[{prefix:"o:",map:{connecttype:"rect",extrusionok:"f"}}],rawMap:{gradientshapeok:"t"}}}),Pa=e=>{const{aspectratio:t,rotation:s}=e||{},i={};return t&&(i.aspectratio="t"),s&&(i.rotation="t"),{name:"o:lock",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}],rawMap:i}}};function Ju(e,t,s,i,r){return(e-t)/(s-t)*(r-i)+i}var Qu=(e,t)=>{let s;const{recolor:i,brightness:r,contrast:a,id:o}=e;if(i&&(s={},(i==="Washout"||i==="Grayscale")&&(s.gain="19661f",s.blacklevel="22938f"),(i==="Black & White"||i==="Grayscale")&&(s.grayscale="t",i==="Black & White"&&(s.bilevel="t"))),!i||i==="Grayscale"){if(s||(s={}),a!=null&&a!==50){let n="1";a>=0&&(a<50?n=String(a/50):a<100?n=String(50/(100-a)):a===100&&(n="2147483647f")),s.gain=n}r!=null&&r!==50&&(s.blacklevel=Ju(r,0,100,-.5,.5).toString())}return{name:"v:imagedata",properties:{prefixedAttributes:[{prefix:"o:",map:{relid:`rId${t}`,title:o}}],rawMap:s}}},ep=()=>{const e=["if lineDrawn pixelLineWidth 0","sum @0 1 0","sum 0 0 @1","prod @2 1 2","prod @3 21600 pixelWidth","prod @3 21600 pixelHeight","sum @0 0 1","prod @6 1 2","prod @7 21600 pixelWidth","sum @8 21600 0","prod @7 21600 pixelHeight","sum @10 21600 0"];return{name:"v:shapetype",properties:{prefixedAttributes:[{prefix:"o:",map:{spt:"75",preferrelative:"t"}}],rawMap:{coordsize:"21600,21600",filled:"f",id:"_x0000_t75",path:"m@4@5l@4@11@9@11@9@5xe",stroked:"f"}},children:[Xu(),qu(e),Zu(),Pa({aspectratio:!0})]}},Fa=e=>Math.floor((e??0)*.74999943307122),tp=(e,t)=>{const{width:s=0,height:i=0,altText:r}=e,a=Fa(s),o=Fa(i);return{name:"v:shape",properties:{rawMap:{id:e.headerFooterPosition,"o:spid":"_x0000_s1025",style:`position: absolute; margin-left: 0; margin-top: 10in; margin-bottom: 0; margin-right: 0; width: ${a}pt; height: ${o}pt; z-index: ${t+1}`,type:"#_x0000_t75",alt:r}},children:[Qu(e,t+1),Pa({rotation:!0})]}},sp={getTemplate(e){const t=Ee.get(e.sheetIndex)||[],s=[Yu(),ep(),...t.map((i,r)=>tp(i,r))];return{name:"xml",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{v:"urn:schemas-microsoft-com:vml",o:"urn:schemas-microsoft-com:office:office",x:"urn:schemas-microsoft-com:office:excel"}}]},children:s}}},ip=sp,rp={getTemplate(e,t){const s=(t+1).toString();return{name:"sheet",properties:{rawMap:{name:e,sheetId:s,"r:id":`rId${s}`}}}}},ap=rp,op={getTemplate(e){return{name:"sheets",children:e.map((t,s)=>ap.getTemplate(t,s))}}},np=op,lp={getTemplate(e,t){return{name:"workbook",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}}],rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},children:[{name:"bookViews",children:[{name:"workbookView",properties:{rawMap:{activeTab:t}}}]},np.getTemplate(e)]}}},cp=lp;import{_escapeString as dp}from"ag-grid-community";var hp=e=>Math.ceil((e-12)/7+1),up={getTemplate(e){const{min:t,max:s,outlineLevel:i,s:r,width:a,hidden:o,bestFit:n}=e;let l=1,c="0";return a>1&&(l=hp(a),c="1"),{name:"col",properties:{rawMap:{min:t,max:s,outlineLevel:i??void 0,width:l,style:r,hidden:o?"1":"0",bestFit:n?"1":"0",customWidth:c}}}}},pp=up,gp={getTemplate(e){return{name:"mergeCell",properties:{rawMap:{ref:e}}}}},mp=gp;import{_escapeString as Aa}from"ag-grid-community";var fp=e=>{const t=e.charAt(0).toLowerCase();return t==="s"?"inlineStr":t},Cp={getTemplate(e,t,s){const{ref:i,data:r,styleId:a}=e,{type:o,value:n}=r||{type:"empty",value:null};let l=o;o==="f"?l="str":o.charAt(0)===o.charAt(0).toUpperCase()&&(l=fp(o));const c={name:"c",properties:{rawMap:{r:i,t:l==="empty"?void 0:l,s:a?Ru(a,s):void 0}}};if(l==="empty")return c;let d;return l==="str"&&o==="f"?d=[{name:"f",textNode:Aa(pi(n),!1)}]:l==="inlineStr"?d=[{name:"is",children:[{name:"t",textNode:Aa(pi(n),!1)}]}]:d=[{name:"v",textNode:n}],Object.assign({},c,{children:d})}},vp=Cp,yp=(e,t)=>{const s=[];let i=0;for(let r=0;r=0;r--){const a=[],o=e[s[r].pos];for(let n=1;n<=o.mergeAcross;n++)a.push({ref:`${ze(s[r].excelPos+1+n)}${t+1}`,styleId:o.styleId,data:{type:"empty",value:null}});a.length&&e.splice(s[r].pos+1,0,...a)}},Sp=e=>e.data?.value!==""||e.styleId!==void 0,bp={getTemplate(e,t,s){const{collapsed:i,hidden:r,height:a,outlineLevel:o,cells:n=[]}=e;yp(n,t);const l=n.filter(Sp).map((c,d)=>vp.getTemplate(c,d,s));return{name:"row",properties:{rawMap:{r:t+1,collapsed:i?"1":"0",hidden:r?"1":"0",ht:a,customHeight:a!=null?"1":"0",spans:"1:1",outlineLevel:o||void 0}},children:l}}},wp=bp,xp=(e,t,s)=>{const i=[],r=[];e.forEach((n,l)=>{const c=n.cells;let d=0,h;c.forEach((u,p)=>{const g=p+d+1,m=ze(g),C=l+1;if(u.mergeAcross){d+=u.mergeAcross;const v=ze(p+d+1);i.push(`${m}${C}:${v}${C}`)}t[g-1]||(t[g-1]={});const{collapsibleRanges:f}=u;f&&f.forEach(v=>{r.push([g+v[0],g+v[1]])}),h=t[g-1],h.min=g,h.max=g,u.ref=`${m}${C}`})}),r.sort((n,l)=>n[0]!==l[0]?n[0]-l[0]:l[1]-n[1]);const a=new Map,o=new Map;return r.filter(n=>{const l=n.toString();return a.get(l)?!1:(a.set(l,!0),!0)}).forEach(n=>{const l=t.find(d=>d.min==n[0]&&d.max==n[1]),c=o.get(n[0]);t.push({min:n[0],max:n[1],outlineLevel:s?void 0:c||1,width:(l||{width:100}).width}),o.set(n[0],(c||0)+1)}),i},Tp=e=>!e||e!=="Portrait"&&e!=="Landscape"?"portrait":e.toLocaleLowerCase(),Mp=e=>{if(e==null)return 1;const s=["Letter","Letter Small","Tabloid","Ledger","Legal","Statement","Executive","A3","A4","A4 Small","A5","A6","B4","B5","Folio","Envelope","Envelope DL","Envelope C5","Envelope B5","Envelope C3","Envelope C4","Envelope C6","Envelope Monarch","Japanese Postcard","Japanese Double Postcard"].indexOf(e);return s===-1?1:s+1},Pp=e=>{const t={"&[Page]":"&P","&[Pages]":"&N","&[Date]":"&D","&[Time]":"&T","&[Tab]":"&A","&[Path]":"&Z","&[File]":"&F","&[Picture]":"&G"};for(const s of Object.keys(t))e=e.replace(s,t[s]);return e},Fp=e=>e==="Center"?"C":e==="Right"?"R":"L",Ap=(e,t)=>(t&&(e+="&"",e+=t.fontName||"Calibri",t.bold!==t.italic?e+=t.bold?",Bold":",Italic":t.bold?e+=",Bold Italic":e+=",Regular",e+=""",t.size&&(e+=`&${t.size}`),t.strikeThrough&&(e+="&S"),t.underline&&(e+=`&${t.underline==="Double"?"E":"U"}`),t.color&&(e+=`&K${t.color.replace("#","").toUpperCase()}`)),e),Rp=(e,t,s)=>e.reduce((i,r,a)=>{const o=Fp(r.position),n=Ap(`${i}&${o}`,r.font),l=["Left","Center","Right"];r.position||(r.position=l[a]);const{image:c}=r;if(r.value==="&[Picture]"&&c){const d=`${o}${t}${s}`;Qp(c,d)}return`${n}${dp(Pp(r.value))}`},""),Ep=e=>{const t=["all","first","even"],s=[];return t.forEach(i=>{const r=e[i],a=i==="all"?"odd":i;if(r)for(const o of Object.keys(r)){const n=r[o],l=`${o.charAt(0).toUpperCase()}${o.slice(1)}`,c=o[0].toUpperCase();if(n){const d=i==="all"?"":i.toUpperCase();s.push({name:`${a}${l}`,properties:{rawMap:{"xml:space":"preserve"}},textNode:Rp(n,c,d)})}}}),s},Ip=e=>t=>(e.length&&t.children.push({name:"cols",children:e.map(s=>pp.getTemplate(s))}),t),Dp=(e,t)=>s=>(e.length&&s.children.push({name:"sheetData",children:e.map((i,r)=>wp.getTemplate(i,r,t))}),s),Lp=e=>t=>(e.length&&t.children.push({name:"mergeCells",properties:{rawMap:{count:e.length}},children:e.map(s=>mp.getTemplate(s))}),t),kp=e=>t=>{const{top:s=.75,right:i=.7,bottom:r=.75,left:a=.7,header:o=.3,footer:n=.3}=e;return t.children.push({name:"pageMargins",properties:{rawMap:{bottom:r,footer:n,header:o,left:a,right:i,top:s}}}),t},Gp=e=>t=>(e&&t.children.push({name:"pageSetup",properties:{rawMap:{horizontalDpi:0,verticalDpi:0,orientation:Tp(e.orientation),paperSize:Mp(e.pageSize)}}}),t),Op=e=>t=>{if(!e)return t;const s=e.first!=null?1:0,i=e.even!=null?1:0;return t.children.push({name:"headerFooter",properties:{rawMap:{differentFirst:s,differentOddEven:i}},children:Ep(e)}),t},Np=e=>t=>(e&&t.children.push({name:"tableParts",properties:{rawMap:{count:"1"}},children:[{name:"tablePart",properties:{rawMap:{"r:id":`rId${++t.rIdCounter}`}}}]}),t),Bp=e=>t=>(We.get(e)?.length&&t.children.push({name:"drawing",properties:{rawMap:{"r:id":`rId${++t.rIdCounter}`}}}),t),_p=e=>t=>(Ee.get(e)&&t.children.push({name:"legacyDrawingHF",properties:{rawMap:{"r:id":`rId${++t.rIdCounter}`}}}),t),Vp=(e=0,t=0)=>{const s=e>0||t>0;return s?[{name:"pane",properties:{rawMap:{state:s?"frozen":void 0,topLeftCell:s?`${ze(e+1)}${t+1}`:void 0,xSplit:e===0?void 0:e,ySplit:t===0?void 0:t}}}]:void 0},Hp=(e=!1,t,s)=>i=>(i.children.push({name:"sheetViews",children:[{name:"sheetView",properties:{rawMap:{rightToLeft:e===!0?"1":"0",workbookViewId:"0"}},children:Vp(t,s)}]}),i),zp=()=>e=>(e.children.push({name:"sheetPr",children:[{name:"outlinePr",properties:{rawMap:{summaryBelow:0}}}]}),e),Up=e=>t=>{const s=e.reduce((i,r)=>r.outlineLevel&&r.outlineLevel>i?r.outlineLevel:i,0);return t.children.push({name:"sheetFormatPr",properties:{rawMap:{baseColWidth:10,defaultRowHeight:16,outlineLevelRow:s||void 0}}}),t},Kp={getTemplate(e){const{worksheet:t,currentSheet:s,config:i}=e,{margins:r={},pageSetup:a,headerFooterConfig:o,suppressColumnOutline:n,rightToLeft:l,frozenRowCount:c,frozenColumnCount:d}=i,{table:h}=t,{rows:u,columns:p}=h,g=p&&p.length?xp(u,p,!!n):[],m=ve.get(s),{children:C}=[zp(),Hp(l,d,c),Up(u),Ip(p),Dp(u,s+1),Lp(g),kp(r),Gp(a),Op(o),Bp(s),_p(s),Np(m)].reduce((f,v)=>v(f),{children:[],rIdCounter:0});return{name:"worksheet",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}}],rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},children:C}}},Wp=Kp,Ue=new Map,Ce=[],Ke=new Map,We=new Map,Ee=new Map,ot=new Map,Ft=new Map,ve=new Map,jp="AG-GRID-TABLE",Si="SINGLE_SHEET";function $p(){return Si}function Yp(e){Si=e}function Xp(e,t,s){tg(t),Eu(e,Ce.length);const i=Object.assign({},s);return s.exportAsExcelTable&&(s.colModel.isPivotActive()&&(Ra("pivot mode"),i.exportAsExcelTable=!1),s.gos.get("masterDetail")&&(Ra("master/detail"),i.exportAsExcelTable=!1)),Jp(t,i),fg(t,i)}function Ra(e){gi(163,{featureName:e})}function qp(e){return e.replace(/^[^a-zA-Z_]+/,"_").replace(/\s/g,"_").replace(/[^a-zA-Z0-9_]/g,"_")}function Zp(e,t){if(ve.has(e)){gi(164);return}ve.set(e,t)}function Jp(e,t){const{exportAsExcelTable:s,prependContent:i,appendContent:r,colModel:a}=t;if(!s)return;const o=typeof s=="boolean"?{}:s,{name:n,showColumnStripes:l,showRowStripes:c,showFilterButton:d,highlightFirstColumn:h,highlightLastColumn:u}=o,p=qp(n||jp),g=Ce.length-1,{table:m}=e,{rows:C,columns:f}=m,v=mh(a),y=i?i.length:0,x=r?r.length:0,S=C.length,w=f.length,T=[],P=[];for(let F=0;Fa.id===e.id)||r.push(e)}function eg(e,t,s,i,r){const a=Ce.length,{row:o,column:n}=e.position||{},l=e;i&&(t!=null&&s!=null&&(!o||!n)&&(e.position||(e.position={}),e.position=Object.assign({},e.position,{row:t,column:i.indexOf(s)+1})),hh(l,i),uh(l,r)),Ea({imageToAdd:l,idx:a});let c=Ft.get(a);c||(c=new Map,Ft.set(a,c));const d=We.get(a);d?d.push(l):We.set(a,[l]),c.get(e.id)||c.set(e.id,{index:c.size,type:e.imageType})}function Ea(e){const{imageToAdd:t,idx:s}=e,i=Ke.get(t.id);if(i){const r=i.find(a=>a.sheetId===s);r?r.image.push(t):i.push({sheetId:s,image:[t]})}else Ke.set(t.id,[{sheetId:s,image:[t]}]),ot.set(t.id,{type:t.imageType,index:ot.size})}function tg(e){const t=gh(e.name)||"";let s="";for(;Ce.indexOf(`${t}${s}`)!==-1;)s===""?s="_1":s=`_${parseInt(s.slice(1),10)+1}`;e.name=`${t}${s}`,Ce.push(e.name)}function Ia(e){return Ue.has(e)?Ue.get(e):(Ue.set(e,Ue.size),Ue.size-1)}function Da(){Ue.clear(),Ke.clear(),We.clear(),Ee.clear(),ot.clear(),Ft.clear(),ve.clear(),Ce=[],Si="SINGLE_SHEET"}function sg(e){return Z(cp.getTemplate(Ce,e))}function ig(e){return Z(Iu.getTemplate(e))}function rg(){return Z(Gh.getTemplate(Ue))}function ag(e){return Z(bh.getTemplate(e))}function og(e){return Z(yh.getTemplate(e))}function ng(){const e=wt.getTemplate([{Id:"rId1",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",Target:"xl/workbook.xml"},{Id:"rId2",Type:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",Target:"docProps/core.xml"}]);return Z(e)}function lg(){return Z($u.getTemplate())}function cg(e,t){return Z(Lu.getTemplate(e,t))}function dg(e){const t=new Array(e).fill(void 0).map((i,r)=>({Id:`rId${r+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",Target:`worksheets/sheet${r+1}.xml`})),s=wt.getTemplate([...t,{Id:`rId${e+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",Target:"theme/theme1.xml"},{Id:`rId${e+2}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Target:"styles.xml"},{Id:`rId${e+3}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",Target:"sharedStrings.xml"}]);return Z(s)}function hg(e){return Z(Eh.getTemplate({sheetIndex:e}))}function ug(e){const t=Ft.get(e)||[],s=[];for(const[i,r]of t){const{index:a,type:o}=r;s.push({Id:`rId${a+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/image${ot.get(i).index+1}.${us(o)}`})}return Z(wt.getTemplate(s))}function pg(e){return Z(ip.getTemplate({sheetIndex:e}),!0)}function gg(e){const t=Ee.get(e)||[],s=[];for(let i=0;i{this.stylesByIds[t.id]=t}),this.excelStyles=[...this.config.baseExcelStyles,{id:"_quotePrefix",quotePrefix:1}]}addCustomContent(e){e.forEach(t=>{const s=this.rows.length+1;let i;!this.config.suppressRowOutline&&t.outlineLevel!=null&&(i=t.outlineLevel);const r={height:hs(s,t.height||this.config.rowHeight),cells:(t.cells||[]).map((a,o)=>{const n=this.addImage(s,this.columnsToExport[o],a.data?.value);let l=null;a.styleId&&(l=typeof a.styleId=="string"?[a.styleId]:a.styleId);const c=this.getStyleId(l);if(n)return this.createCell(c,this.getDataTypeForValue(n.value),n.value==null?"":n.value);const d=a.data?.value??"",h=this.getDataTypeForValue(d);return a.mergeAcross?this.createMergedCell(c,h,d,a.mergeAcross):this.createCell(c,h,d)}),outlineLevel:i};t.collapsed!=null&&(r.collapsed=t.collapsed),t.hidden!=null&&(r.hidden=t.hidden),this.rows.push(r)})}onNewHeaderGroupingRow(){const e=[],{freezeRows:t,headerRowHeight:s}=this.config;return this.rows.push({cells:e,height:hs(this.rows.length+1,s)}),t&&this.frozenRowCount++,{onColumn:(i,r,a,o,n)=>{const l=this.config.styleLinker({rowType:"HEADER_GROUPING",rowIndex:1,value:`grouping-${r}`,columnGroup:i});e.push({...this.createMergedCell(this.getStyleId(l),this.getDataTypeForValue("string"),r,o),collapsibleRanges:n})}}}onNewHeaderRow(){const{freezeRows:e,headerRowHeight:t}=this.config;return e&&this.frozenRowCount++,this.onNewRow(this.onNewHeaderColumn,t)}onNewBodyRow(e){const{freezeRows:t,rowHeight:s}=this.config;this.skipFrozenRows||(t==="headersAndPinnedRows"&&e?.rowPinned==="top"?this.frozenRowCount++:typeof t=="function"?t(ui(this.gos,{node:e}))?this.frozenRowCount++:this.skipFrozenRows=!0:this.skipFrozenRows=!0);const i=this.onNewRow(this.onNewBodyColumn,s);return e&&this.addRowOutlineIfNecessary(e),i}prepare(e){super.prepare(e),this.columnsToExport=[...e],this.cols=e.map((t,s)=>this.convertColumnToExcel(t,s))}parse(){const e=this.rows.reduce((r,a)=>Math.max(r,a.cells.length),0);for(;this.cols.length{const i=this.extractHeaderValue(s),r=this.config.styleLinker({rowType:"HEADER",rowIndex:e,value:i,column:s});t.push(this.createCell(this.getStyleId(r),this.getDataTypeForValue("string"),i))}}onNewBodyColumn(e,t){let s=0;const{freezeColumns:i,rightToLeft:r}=this.config;return(a,o,n)=>{if(s>0){s-=1;return}if(!this.skipFrozenColumns){const g=a.getPinned();i==="pinned"&&g&&(g===!0||g==="left")!==r?this.frozenColumnCount++:typeof i=="function"&&i(ui(this.gos,{column:a}))?this.frozenColumnCount++:this.skipFrozenColumns=!0}const{value:l,valueFormatted:c}=this.extractRowCellValue(a,o,e,"excel",n),d=this.config.styleLinker({rowType:"BODY",rowIndex:e,value:l,column:a,node:n}),h=this.getStyleId(d),u=a.getColSpan(n),p=this.addImage(e,a,l);p?t.push(this.createCell(h,this.getDataTypeForValue(p.value),p.value==null?"":p.value)):u>1?(s=u-1,t.push(this.createMergedCell(h,this.getDataTypeForValue(l),l,u-1))):t.push(this.createCell(h,this.getDataTypeForValue(l),l,c))}}onNewRow(e,t){const s=[];return this.rows.push({cells:s,height:hs(this.rows.length+1,t)}),{onColumn:e.bind(this,this.rows.length,s)()}}createExcel(e){const{excelStyles:t,config:s}=this;return this.frozenColumnCount&&(s.frozenColumnCount=this.frozenColumnCount),this.frozenRowCount&&(s.frozenRowCount=this.frozenRowCount),Xp(t,e,s)}getDataTypeForValue(e){return e===void 0?"empty":this.isNumerical(e)?"n":"s"}getTypeFromStyle(e,t){if(this.isFormula(t))return"f";if(e&&e.dataType)switch(e.dataType.toLocaleLowerCase()){case"formula":return"f";case"string":return"s";case"number":return"n";case"datetime":return"d";case"error":return"e";case"boolean":return"b";default:ah(162,{id:e.id,dataType:e.dataType})}return null}addImage(e,t,s){if(!this.config.addImageToCell)return;const i=this.config.addImageToCell(e,t,s);if(i)return eg(i.image,e,t,this.columnsToExport,this.config.rowHeight),i}createCell(e,t,s,i){const r=this.getStyleById(e);!r?.dataType&&t==="s"&&i&&(s=i);const a=this.getTypeFromStyle(r,s)||t,{value:o,escaped:n}=this.getCellValue(a,s),l=[];return r&&l.push(e),n&&l.push("_quotePrefix"),e=this.getStyleId(l)||void 0,{styleId:e,data:{type:a,value:o}}}createMergedCell(e,t,s,i){const r=s??"";return{styleId:this.getStyleById(e)?e:void 0,data:{type:t,value:t==="s"?Ia(r).toString():s},mergeAcross:i}}getCellValue(e,t){let s=!1;if(t==null||e==="s"&&t==="")return{value:"",escaped:!1};if(e==="s")t&&t[0]==="'"&&(s=!0,t=t.slice(1)),t=Ia(t).toString();else if(e==="f")t=t.slice(1);else if(e==="n"){const i=Number(t);isNaN(i)?t="":t!==""&&(t=i.toString())}return{value:t,escaped:s}}getStyleId(e){if(!e||!e.length)return null;if(e.length===1)return e[0];const t=e.join("-");return this.mixedStyles[t]||this.addNewMixedStyle(e),this.mixedStyles[t].excelID}deepCloneObject(e){return JSON.parse(JSON.stringify(e))}addNewMixedStyle(e){this.mixedStyleCounter+=1;const t=`mixedStyle${this.mixedStyleCounter}`,s={};for(const r of e)for(const a of this.excelStyles)a.id===r&&rh(s,this.deepCloneObject(a));s.id=t;const i=e.join("-");this.mixedStyles[i]={excelID:t,key:i,result:s},this.excelStyles.push(s),this.stylesByIds[t]=s}isFormula(e){return e==null?!1:this.config.autoConvertFormulas&&e.toString().startsWith("=")}isNumerical(e){return typeof e=="bigint"?!0:isFinite(e)&&e!==""&&!isNaN(parseFloat(e))}getStyleById(e){return e==null?null:this.stylesByIds[e]||null}};import{_errMsg as vg}from"ag-grid-community";var yg=async e=>{let t=0;const s=[],i=new WritableStream({write:o=>{s.push(o),t+=o.length}}),r=new ReadableStream({start:o=>{const n=new FileReader;n.onload=l=>{l.target?.result&&o.enqueue(l.target.result),o.close()},n.readAsArrayBuffer(e)}}),a=new window.CompressionStream("deflate-raw");return await r.pipeThrough(a).pipeTo(i),{size:t,content:new Blob(s)}},Sg=async e=>{const t=new Blob([e]),{size:s,content:i}=await yg(t),r=new Uint8Array(await i.arrayBuffer());return{size:s,content:r}},bg=e=>{let t=e.getHours();return t<<=6,t=t|e.getMinutes(),t<<=5,t=t|e.getSeconds()/2,t},wg=e=>{let t=e.getFullYear()-1980;return t<<=4,t=t|e.getMonth()+1,t<<=5,t=t|e.getDate(),t};function j(e,t){let s="";for(let i=0;i>>=8;return s}var La=e=>{if(!e.length)return 0;let t=-1,s=0,i=0,r=0;for(let a=0;a>>8^r;return t^-1},ka=e=>e.length?La(typeof e=="string"?new TextEncoder().encode(e):e):0,xg=new Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function Tg(e){const t=String.fromCharCode;function s(h){const u=[];if(!h)return[];const p=h.length;let g=0,m,C;for(;g=55296&&m<=56319&&g=55296&&h<=57343)throw Error(vg(255,{point:h}))}function r(h,u){return t(h>>u&63|128)}function a(h){if(!(h&4294967168))return t(h);let u="";return h&4294965248?h&4294901760?h&4292870144||(u=t(h>>18&7|240),u+=r(h,12),u+=r(h,6)):(i(h),u=t(h>>12&15|224),u+=r(h,6)):u=t(h>>6&31|192),u+=t(h&63|128),u}const o=s(e),n=o.length;let l=-1,c,d="";for(;++l{const{content:o,path:n,created:l}=e,c=bg(l),d=wg(l),h=ka(r),u=a!==void 0?a:i,p=Tg(n),g=p!==n;let m="";if(g){const y=j(1,1)+j(ka(p),4)+p;m="up"+j(y.length,2)+y}const C="\0"+(g?"\0\b":"\0\0")+j(t?8:0,2)+j(c,2)+j(d,2)+j(u?h:0,4)+j(a??i,4)+j(i,4)+j(p.length,2)+j(m.length,2),f="PK"+C+p+m,v="PK\0"+C+"\0\0\0\0\0\0"+(o?"\0\0\0\0":"\0\0\0")+j(s,4)+p+m;return{localFileHeader:Uint8Array.from(f,y=>y.charCodeAt(0)),centralDirectoryHeader:Uint8Array.from(v,y=>y.charCodeAt(0))}},Oa=e=>{let t;if(typeof e=="string"){const s=atob(e.split(";base64,")[1]);t=Uint8Array.from(s,i=>i.charCodeAt(0))}else t=e;return{size:t.length,content:t}},Mg=async(e,t)=>{const{content:s}=e,{size:i,content:r}=s?Oa(s):{size:0,content:Uint8Array.from([])};let a,o,n=!1;if(e.type==="file"&&r&&i>0){const d=await Sg(r);a=d.content,o=d.size,n=!0}return{...Ga(e,n,t,i,r,o),content:a||r,isCompressed:n}},Pg=(e,t)=>{const{content:s}=e,{content:i}=s?Oa(s):{content:Uint8Array.from([])};return{...Ga(e,!1,t,i.length,i,void 0),content:i,isCompressed:!1}},Fg=(e,t,s)=>{const i="PK\0\0\0\0"+j(e,2)+j(e,2)+j(t,4)+j(s,4)+"\0\0";return Uint8Array.from(i,r=>r.charCodeAt(0))},Na=class{constructor(){this.folders=[],this.files=[]}addFolders(e){e.forEach(this.addFolder.bind(this))}addFolder(e){this.folders.push({path:e,created:new Date,isBase64:!1,type:"folder"})}addFile(e,t,s=!1){this.files.push({path:e,created:new Date,content:s?t:new TextEncoder().encode(t),isBase64:s,type:"file"})}async getZipFile(e="application/zip"){const t=await this.buildCompressedFileStream();return this.clearStream(),new Blob([t],{type:e})}getUncompressedZipFile(e="application/zip"){const t=this.buildFileStream();return this.clearStream(),new Blob([t],{type:e})}clearStream(){this.folders=[],this.files=[]}packageFiles(e){let t=0,s=0;for(const c of e){const{localFileHeader:d,centralDirectoryHeader:h,content:u}=c;t+=d.length+u.length,s+=h.length}const i=new Uint8Array(t),r=new Uint8Array(s);let a=0,o=0;for(const c of e){const{localFileHeader:d,centralDirectoryHeader:h,content:u}=c;i.set(d,a),a+=d.length,i.set(u,a),a+=u.length,r.set(h,o),o+=h.length}const n=Fg(e.length,s,t),l=new Uint8Array(i.length+r.length+n.length);return l.set(i),l.set(r,i.length),l.set(n,i.length+r.length),l}async buildCompressedFileStream(){const e=[...this.folders,...this.files],t=[];let s=0;for(const i of e){const r=await Mg(i,s),{localFileHeader:a,content:o}=r;t.push(r),s+=a.length+o.length}return this.packageFiles(t)}buildFileStream(){const e=[...this.folders,...this.files],t=[];let s=0;for(const i of e){const r=Pg(i,s),{localFileHeader:a,content:o}=r;t.push(r),s+=a.length+o.length}return this.packageFiles(t)}},Ag=e=>{if(e.addFolders(["_rels/","docProps/","xl/","xl/theme/","xl/_rels/","xl/worksheets/"]),!Ke.size)return;e.addFolders(["xl/worksheets/_rels","xl/drawings/","xl/drawings/_rels","xl/media/"]);let t=0;Ke.forEach(s=>{const i=s[0].image[0],{base64:r,imageType:a}=i;e.addFile(`xl/media/image${++t}.${us(a)}`,r,!0)})},Rg=(e,t)=>{let s=0,i=0;for(let r=0;r0&&We.has(r),n=ve.size>0&&ve.get(r),l=Ke.size&&Ee.has(r);if(!o&&!n&&!l)continue;let c,d,h;o&&(Eg(e,r,s),d=s,s++),l&&(Ig(e,r,i),h=i,i++),n&&(c=n.name);const u=`xl/worksheets/_rels/sheet${r+1}.xml.rels`;e.addFile(u,mg({tableName:c,drawingIndex:d,vmlDrawingIndex:h}))}},Eg=(e,t,s)=>{const i="xl/drawings",r=`${i}/drawing${s+1}.xml`,a=`${i}/_rels/drawing${s+1}.xml.rels`;e.addFile(a,ug(t)),e.addFile(r,hg(t))},Ig=(e,t,s)=>{const i="xl/drawings",r=`${i}/vmlDrawing${s+1}.vml`,a=`${i}/_rels/vmlDrawing${s+1}.vml.rels`;e.addFile(r,pg(t)),e.addFile(a,gg(t))},Dg=e=>{const t=ve,s=Array.from(t.keys());for(let i=0;i{e.addFile("xl/workbook.xml",sg(r)),e.addFile("xl/styles.xml",ig(t)),e.addFile("xl/sharedStrings.xml",rg()),e.addFile("xl/theme/theme1.xml",lg()),e.addFile("xl/_rels/workbook.xml.rels",dg(i)),e.addFile("docProps/core.xml",ag(s)),e.addFile("[Content_Types].xml",og(i)),e.addFile("_rels/.rels",ng())},Ba=(e,t,s={})=>{if(!t||t.length===0)return ma(159),Da(),!1;const{fontSize:i=11,author:r="AG Grid",activeTab:a=0}=s,o=t.length,n=Math.max(Math.min(a,o-1),0);return Ag(e),Dg(e),Rg(e,t),Lg(e,i,r,o,n),Da(),!0},_a=e=>{const{data:t,fontSize:s,author:i,activeSheetIndex:r}=e,a=e.mimeType||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",o=new Na;return Ba(o,t,{author:i,fontSize:s,activeTab:r})?o.getZipFile(a):Promise.resolve(void 0)},bi=e=>{const{data:t,fontSize:s,author:i,activeSheetIndex:r}=e,a=e.mimeType||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",o=new Na;if(Ba(o,t,{author:i,fontSize:s,activeTab:r}))return o.getUncompressedZipFile(a)},Va=e=>{const{fileName:t="export.xlsx"}=e;_a(e).then(s=>{if(s){const i=typeof t=="function"?t():t;ga(i,s)}})},kg=class extends eh{constructor(){super(...arguments),this.beanName="excelCreator"}getMergedParams(e){const t=this.gos.get("defaultExcelExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){ma(160);return}const t=this.getMergedParams(e),i={data:[this.getData(t)],fontSize:t.fontSize,author:t.author,mimeType:t.mimeType};this.packageCompressedFile(i).then(r=>{if(r){const{fileName:a}=t,o=typeof a=="function"?a(pa(this.gos,{})):a;ga(this.getFileName(o),r)}})}exportDataAsExcel(e){this.export(e)}getDataAsExcel(e){const t=this.getMergedParams(e),i={data:[this.getData(t)],fontSize:t.fontSize,author:t.author,mimeType:t.mimeType};return this.packageFile(i)}setFactoryMode(e){Yp(e)}getFactoryMode(){return $p()}getSheetDataForExcel(e){const t=this.getMergedParams(e);return this.getData(t)}getMultipleSheetsAsExcel(e){return bi(e)}exportMultipleSheetsAsExcel(e){Va(e)}getDefaultFileExtension(){return"xlsx"}createSerializingSession(e){const{colModel:t,colNames:s,rowGroupColsSvc:i,valueSvc:r,gos:a}=this.beans,o={...e,colModel:t,colNames:s,rowGroupColsSvc:i,valueSvc:r,gos:a,suppressRowOutline:e.suppressRowOutline||e.skipRowGroups,headerRowHeight:e.headerRowHeight||e.rowHeight,baseExcelStyles:a.get("excelStyles")||[],rightToLeft:e.rightToLeft??a.get("enableRtl"),styleLinker:this.styleLinker.bind(this)};return new Cg(o)}styleLinker(e){const{rowType:t,rowIndex:s,value:i,column:r,columnGroup:a,node:o}=e,n=t==="HEADER",l=t==="HEADER_GROUPING",c=n?r:a;let d=[];const{gos:h,cellStyles:u}=this.beans;if(n||l)return d.push("header"),l&&d.push("headerGroup"),c&&(d=d.concat(th(c.getDefinition(),h,r||null,a||null))),d;const p=h.get("excelStyles"),g=["cell"];if(!p||!p.length)return g;const m=p.map(f=>f.id),C=r.getDefinition();return u?.processAllCellClasses(C,pa(h,{value:i,data:o.data,node:o,colDef:C,column:r,rowIndex:s}),f=>{m.indexOf(f)>-1&&g.push(f)}),g.sort((f,v)=>m.indexOf(f)*{width:var(--ag-advanced-filter-builder-indent-size)}.ag-advanced-filter-builder-item-tree-line-root{width:var(--ag-icon-size);&:before{height:50%;top:50%}}.ag-advanced-filter-builder-item-tree-line-horizontal,.ag-advanced-filter-builder-item-tree-line-vertical,.ag-advanced-filter-builder-item-tree-line-vertical-bottom,.ag-advanced-filter-builder-item-tree-line-vertical-top{align-items:center;display:flex;height:100%;position:relative;&:after,&:before{content:"";height:100%;position:absolute}}.ag-advanced-filter-builder-item-tree-line-horizontal:after{border-bottom:1px solid var(--ag-border-color);height:50%;top:0;width:calc(var(--ag-advanced-filter-builder-indent-size) - var(--ag-icon-size))}:where(.ag-ltr) .ag-advanced-filter-builder-item-tree-line-horizontal:after{left:calc(var(--ag-icon-size)/2)}:where(.ag-rtl) .ag-advanced-filter-builder-item-tree-line-horizontal:after{right:calc(var(--ag-icon-size)/2)}.ag-advanced-filter-builder-item-tree-line-vertical:before{top:0;width:calc(var(--ag-advanced-filter-builder-indent-size) - var(--ag-icon-size)/2)}:where(.ag-ltr) .ag-advanced-filter-builder-item-tree-line-vertical:before{border-left:1px solid var(--ag-border-color);left:calc(var(--ag-icon-size)/2)}:where(.ag-rtl) .ag-advanced-filter-builder-item-tree-line-vertical:before{border-right:1px solid var(--ag-border-color);right:calc(var(--ag-icon-size)/2)}.ag-advanced-filter-builder-item-tree-line-vertical-top:before{height:50%;top:0;width:calc(var(--ag-advanced-filter-builder-indent-size) - var(--ag-icon-size)/2)}:where(.ag-ltr) .ag-advanced-filter-builder-item-tree-line-vertical-top:before{border-left:1px solid var(--ag-border-color);left:calc(var(--ag-icon-size)/2)}:where(.ag-rtl) .ag-advanced-filter-builder-item-tree-line-vertical-top:before{border-right:1px solid var(--ag-border-color);right:calc(var(--ag-icon-size)/2)}.ag-advanced-filter-builder-item-tree-line-vertical-bottom:before{height:calc(50% - var(--ag-icon-size)*1.5/2);top:calc(50% + var(--ag-icon-size)*1.5/2);width:calc(var(--ag-icon-size)/2)}:where(.ag-ltr) .ag-advanced-filter-builder-item-tree-line-vertical-bottom:before{border-left:1px solid var(--ag-border-color);left:calc(var(--ag-icon-size)/2)}:where(.ag-rtl) .ag-advanced-filter-builder-item-tree-line-vertical-bottom:before{border-right:1px solid var(--ag-border-color);right:calc(var(--ag-icon-size)/2)}.ag-advanced-filter-builder-item-condition{padding-bottom:var(--ag-spacing);padding-top:var(--ag-spacing)}.ag-advanced-filter-builder-item,.ag-advanced-filter-builder-item-buttons,.ag-advanced-filter-builder-item-condition,.ag-advanced-filter-builder-item-tree-lines,.ag-advanced-filter-builder-pill,.ag-advanced-filter-builder-pill-wrapper{align-items:center;display:flex;height:100%}.ag-advanced-filter-builder-pill-wrapper{margin:0 var(--ag-spacing)}.ag-advanced-filter-builder-pill{border-radius:var(--ag-border-radius);min-height:calc(100% - var(--ag-spacing)*3);min-width:calc(var(--ag-spacing)*2);padding:var(--ag-spacing) calc(var(--ag-spacing)*2);position:relative}:where(.ag-advanced-filter-builder-pill){.ag-advanced-filter-builder-value-number{font-family:monospace;font-weight:700}.ag-advanced-filter-builder-value-empty{color:var(--ag-subtle-text-color)}}:where(.ag-ltr) :where(.ag-advanced-filter-builder-pill){.ag-picker-field-display{margin-right:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-advanced-filter-builder-pill){.ag-picker-field-display{margin-left:var(--ag-spacing)}}.ag-advanced-filter-builder-pill-display{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-advanced-filter-builder-join-pill{background-color:var(--ag-advanced-filter-builder-join-pill-color);cursor:pointer}.ag-advanced-filter-builder-column-pill{background-color:var(--ag-advanced-filter-builder-column-pill-color);cursor:pointer}.ag-advanced-filter-builder-option-pill{background-color:var(--ag-advanced-filter-builder-option-pill-color);cursor:pointer}.ag-advanced-filter-builder-value-pill{background-color:var(--ag-advanced-filter-builder-value-pill-color);cursor:text;max-width:140px;:where(.ag-advanced-filter-builder-pill-display){display:block}}.ag-advanced-filter-builder-item-buttons>*{margin:0 calc(var(--ag-spacing)*.5)}.ag-advanced-filter-builder-item-button{color:var(--ag-subtle-text-color);cursor:pointer;position:relative}.ag-advanced-filter-builder-item-button,.ag-advanced-filter-builder-pill{&:focus-visible{box-shadow:var(--ag-focus-shadow)}}.ag-advanced-filter-builder-item-button-disabled{cursor:default;opacity:.5}.ag-advanced-filter-builder-virtual-list-container{top:var(--ag-spacing)}.ag-advanced-filter-builder-virtual-list-item{cursor:default;display:flex;height:var(--ag-list-item-height);&:hover{background-color:var(--ag-row-hover-color);:where(.ag-advanced-filter-builder-item-button){opacity:1}}}.ag-advanced-filter-builder-invalid{color:var(--ag-invalid-color);cursor:default;margin:0 var(--ag-spacing)}:where(.ag-advanced-filter-builder-validation) .ag-advanced-filter-builder-invalid,:where(.ag-advanced-filter-builder-virtual-list-item-highlight) .ag-advanced-filter-builder-item-button:focus-visible{opacity:1}';function Vg(e){return e.filterManager?.getAdvFilterModel()??null}function Hg(e,t){e.filterManager?.setAdvFilterModel(t)}function zg(e){e.filterManager?.toggleAdvFilterBuilder(!0,"api")}function Ug(e){e.filterManager?.toggleAdvFilterBuilder(!1,"api")}import{BeanStub as Kg,_exists as Wg,_parseDateTimeFromString as Ha,_serialiseDate as za,_toStringOrNull as wi}from"ag-grid-community";var jg={ariaAdvancedFilterBuilderItem:e=>`${e[0]}. Level ${e[1]}. Press ENTER to edit`,ariaAdvancedFilterBuilderItemValidation:e=>`${e[0]}. Level ${e[1]}. ${e[2]} Press ENTER to edit`,ariaAdvancedFilterBuilderList:"Advanced Filter Builder List",ariaAdvancedFilterBuilderFilterItem:"Filter Condition",ariaAdvancedFilterBuilderGroupItem:"Filter Group",ariaAdvancedFilterBuilderColumn:"Column",ariaAdvancedFilterBuilderOption:"Option",ariaAdvancedFilterBuilderValue:"Value",ariaAdvancedFilterBuilderJoinOperator:"Join Operator",ariaAdvancedFilterInput:"Advanced Filter Input",ariaLabelAdvancedFilterAutocomplete:"Advanced Filter Autocomplete",advancedFilterContains:"contains",advancedFilterNotContains:"does not contain",advancedFilterTextEquals:"equals",advancedFilterTextNotEqual:"does not equal",advancedFilterStartsWith:"begins with",advancedFilterEndsWith:"ends with",advancedFilterBlank:"is blank",advancedFilterNotBlank:"is not blank",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"is true",advancedFilterFalse:"is false",advancedFilterAnd:"AND",advancedFilterOr:"OR",advancedFilterApply:"Apply",advancedFilterBuilder:"Builder",advancedFilterValidationMissingColumn:"Column is missing",advancedFilterValidationMissingOption:"Option is missing",advancedFilterValidationMissingValue:"Value is missing",advancedFilterValidationInvalidColumn:"Column not found",advancedFilterValidationInvalidOption:"Option not found",advancedFilterValidationMissingQuote:"Value is missing an end quote",advancedFilterValidationNotANumber:"Value is not a number",advancedFilterValidationInvalidDate:"Value is not a valid date",advancedFilterValidationMissingCondition:"Condition is missing",advancedFilterValidationJoinOperatorMismatch:"Join operators within a condition must be the same",advancedFilterValidationInvalidJoinOperator:"Join operator not found",advancedFilterValidationMissingEndBracket:"Missing end bracket",advancedFilterValidationExtraEndBracket:"Too many end brackets",advancedFilterValidationMessage:e=>`Expression has an error. ${e[0]} - ${e[1]}.`,advancedFilterValidationMessageAtEnd:e=>`Expression has an error. ${e[0]} at end of expression.`,advancedFilterBuilderTitle:"Advanced Filter",advancedFilterBuilderApply:"Apply",advancedFilterBuilderCancel:"Cancel",advancedFilterBuilderAddButtonTooltip:"Add Filter or Group",advancedFilterBuilderRemoveButtonTooltip:"Remove",advancedFilterBuilderMoveUpButtonTooltip:"Move Up",advancedFilterBuilderMoveDownButtonTooltip:"Move Down",advancedFilterBuilderAddJoin:"Add Group",advancedFilterBuilderAddCondition:"Add Filter",advancedFilterBuilderSelectColumn:"Select a column",advancedFilterBuilderSelectOption:"Select an option",advancedFilterBuilderEnterValue:"Enter a value...",advancedFilterBuilderValidationAlreadyApplied:"Current filter already applied.",advancedFilterBuilderValidationIncomplete:"Not all conditions are complete.",advancedFilterBuilderValidationSelectColumn:"Must select a column.",advancedFilterBuilderValidationSelectOption:"Must select an option.",advancedFilterBuilderValidationEnterValue:"Must enter a value."};function xi(e,t,s){if(!e)return"";const i=s-t;return i?e.slice(0,e.length-i):e}function Ie(e,t,s,i,r,a,o){const n=s+(!e.length||o?0:1);let l=0;return r&&(e[n]===" "?l=1:(i+=" ",a&&(i+='"'))),{updatedValue:e.slice(0,t)+i+e.slice(n),updatedPosition:t+i.length+l}}function $g(e,t,s){let i=t;for(;i{const a=Yg(i),o=t==null?"":`, params.operands[${t}]`;return`params.operators[${s}].evaluator(expressionProxy.getValue('${a}', node), node, params.evaluatorParams[${r}]${o})`})}getFunctionParsed(e){return this.getFunctionCommon(e,(t,s,i,r)=>(a,o,n)=>n.operators[s].evaluator(a.getValue(i,o),o,n.evaluatorParams[r],t==null?void 0:n.operands[t]))}getAutocompleteListParams(e){if(this.isColumnPosition(e))return this.getColumnAutocompleteListParams(e);if(this.isOperatorPosition(e))return this.getOperatorAutocompleteListParams(e);if(!this.isBeyondEndPosition(e))return{enabled:!1}}updateExpression(e,t,s){const{expression:i}=this.params;if(this.isColumnPosition(e))return Ie(this.params.expression,this.startPosition,this.columnParser?.getColId()?this.columnParser.endPosition:Ti(i,e).endPosition,this.params.advFilterExpSvc.getColumnValue(t),!0);if(this.isOperatorPosition(e)){const r=this.getBaseCellDataTypeFromOperatorAutocompleteType(s),a=this.hasOperand(r,t.key),o=a&&this.doesOperandNeedQuotes(r);let n;if(this.operatorParser?.startPosition!=null&&ethis.endPosition+1&&this.endPosition+10,r=this.columnParser?.hasEndChar&&s.length===t.length+2;return i?s.slice(1,r?-1:void 0):s}getOperatorAutocompleteListParams(e){const t=this.columnParser?.column;if(!t)return{enabled:!1};const s=this.columnParser.baseCellDataType,i=this.operatorParser?.startPosition!=null&&e0}doesOperandNeedQuotes(e){return e!=="number"}addToListAndGetIndex(e,t){const s=e.length;return e.push(t),s}};function Cs(e,t,s){let i=!1;const r=e.toLocaleLowerCase(),a=r+" ",o=Object.keys(t).find(n=>{const l=t[n],c=s(l).toLocaleLowerCase();return c.startsWith(a)&&(i=!0),c===r});return o||(i?null:void 0)}function Ai(e,t){return(t??Object.keys(e)).map(i=>({key:i,displayValue:e[i].displayValue}))}var Ua=class{constructor(e){this.params=e,this.initOperators()}getEntries(e){return Ai(this.operators,e)}findOperator(e){return Cs(e,this.operators,({displayValue:t})=>t)}initOperators(){const{translate:e}=this.params;this.operators={contains:{displayValue:e("advancedFilterContains"),evaluator:(t,s,i,r)=>this.evaluateExpression(t,s,i,r,!1,(a,o)=>a.includes(o)),numOperands:1},notContains:{displayValue:e("advancedFilterNotContains"),evaluator:(t,s,i,r)=>this.evaluateExpression(t,s,i,r,!0,(a,o)=>!a.includes(o)),numOperands:1},equals:{displayValue:e("advancedFilterTextEquals"),evaluator:(t,s,i,r)=>this.evaluateExpression(t,s,i,r,!1,(a,o)=>a===o),numOperands:1},notEqual:{displayValue:e("advancedFilterTextNotEqual"),evaluator:(t,s,i,r)=>this.evaluateExpression(t,s,i,r,!0,(a,o)=>a!=o),numOperands:1},startsWith:{displayValue:e("advancedFilterStartsWith"),evaluator:(t,s,i,r)=>this.evaluateExpression(t,s,i,r,!1,(a,o)=>a.startsWith(o)),numOperands:1},endsWith:{displayValue:e("advancedFilterEndsWith"),evaluator:(t,s,i,r)=>this.evaluateExpression(t,s,i,r,!1,(a,o)=>a.endsWith(o)),numOperands:1},blank:{displayValue:e("advancedFilterBlank"),evaluator:t=>t==null||typeof t=="string"&&t.trim().length===0,numOperands:0},notBlank:{displayValue:e("advancedFilterNotBlank"),evaluator:t=>t!=null&&(typeof t!="string"||t.trim().length>0),numOperands:0}}}evaluateExpression(e,t,s,i,r,a){return e==null?r:s.caseSensitive?a(s.valueConverter(e,t),i):a(s.valueConverter(e,t).toLocaleLowerCase(),i.toLocaleLowerCase())}},Ri=class{constructor(e){this.params=e,this.initOperators()}getEntries(e){return Ai(this.operators,e)}findOperator(e){return Cs(e,this.operators,({displayValue:t})=>t)}initOperators(){const{translate:e,equals:t}=this.params;this.operators={equals:{displayValue:e("advancedFilterEquals"),evaluator:(s,i,r,a)=>this.evaluateSingleOperandExpression(s,i,r,a,!!r.includeBlanksInEquals,t),numOperands:1},notEqual:{displayValue:e("advancedFilterNotEqual"),evaluator:(s,i,r,a)=>this.evaluateSingleOperandExpression(s,i,r,a,!!r.includeBlanksInEquals,(o,n)=>!t(o,n)),numOperands:1},greaterThan:{displayValue:e("advancedFilterGreaterThan"),evaluator:(s,i,r,a)=>this.evaluateSingleOperandExpression(s,i,r,a,!!r.includeBlanksInGreaterThan,(o,n)=>o>n),numOperands:1},greaterThanOrEqual:{displayValue:e("advancedFilterGreaterThanOrEqual"),evaluator:(s,i,r,a)=>this.evaluateSingleOperandExpression(s,i,r,a,!!r.includeBlanksInGreaterThan,(o,n)=>o>=n),numOperands:1},lessThan:{displayValue:e("advancedFilterLessThan"),evaluator:(s,i,r,a)=>this.evaluateSingleOperandExpression(s,i,r,a,!!r.includeBlanksInLessThan,(o,n)=>othis.evaluateSingleOperandExpression(s,i,r,a,!!r.includeBlanksInLessThan,(o,n)=>o<=n),numOperands:1},blank:{displayValue:e("advancedFilterBlank"),evaluator:s=>s==null,numOperands:0},notBlank:{displayValue:e("advancedFilterNotBlank"),evaluator:s=>s!=null,numOperands:0}}}evaluateSingleOperandExpression(e,t,s,i,r,a){return e==null?r:a(s.valueConverter(e,t),i)}},Qg=class{constructor(e){this.params=e,this.initOperators()}getEntries(e){return Ai(this.operators,e)}findOperator(e){return Cs(e,this.operators,({displayValue:t})=>t)}initOperators(){const{translate:e}=this.params;this.operators={true:{displayValue:e("advancedFilterTrue"),evaluator:t=>!!t,numOperands:0},false:{displayValue:e("advancedFilterFalse"),evaluator:t=>t===!1,numOperands:0},blank:{displayValue:e("advancedFilterBlank"),evaluator:t=>t==null,numOperands:0},notBlank:{displayValue:e("advancedFilterNotBlank"),evaluator:t=>t!=null,numOperands:0}}}},em=class extends Kg{constructor(){super(...arguments),this.beanName="advFilterExpSvc",this.columnNameToIdMap={},this.columnAutocompleteEntries=null,this.expressionEvaluatorParams={}}wireBeans(e){this.valueSvc=e.valueSvc,this.colModel=e.colModel,this.colNames=e.colNames,this.dataTypeSvc=e.dataTypeSvc}postConstruct(){this.expressionJoinOperators=this.generateExpressionJoinOperators(),this.expressionOperators=this.generateExpressionOperators()}parseJoinOperator(e){const{type:t}=e;return this.expressionJoinOperators[t]??t}getColumnDisplayValue(e){const{colId:t}=e,i=this.getColumnAutocompleteEntries().find(({key:a})=>a===t);let r;return i?(r=i.displayValue,this.columnNameToIdMap[r.toLocaleUpperCase()]={colId:t,columnName:r}):r=t,r}getOperatorDisplayValue(e){return this.getExpressionOperator(e.filterType,e.type)?.displayValue??e.type}getOperandModelValue(e,t,s){switch(t){case"number":return Wg(e)?Number(e):null;case"date":return za(this.valueSvc.parseValue(s,null,e,void 0),!1);case"dateString":{const i=this.valueSvc.parseValue(s,null,e,void 0);return this.dataTypeSvc?za(this.dataTypeSvc.getDateParserFunction(s)(i)??null,!1):i}}return e}getOperandDisplayValue(e,t){const{colId:s,filter:i}=e,r=this.colModel.getColDefCol(s);let a="";if(i!=null){let o;switch(e.filterType){case"number":o=wi(i)??"";break;case"date":{const n=Ha(i);o=r?this.valueSvc.formatValue(r,null,n):null;break}case"dateString":{let n;if(this.dataTypeSvc){const l=Ha(i);n=r?this.dataTypeSvc?.getDateFormatterFunction(r)(l??void 0):null}else n=i;o=r?this.valueSvc.formatValue(r,null,n):null;break}}e.filterType!=="number"&&(o=o??wi(i)??"",t||(o=`"${o}"`)),a=t?o:` ${o}`}return a}parseColumnFilterModel(e){const t=this.getColumnDisplayValue(e)??"",s=this.getOperatorDisplayValue(e)??"",i=this.getOperandDisplayValue(e);return`[${t}] ${s}${i}`}updateAutocompleteCache(e,t){if(t==="column"){const{key:s,displayValue:i}=e;this.columnNameToIdMap[e.displayValue.toLocaleUpperCase()]={colId:s,columnName:i}}}translate(e,t){let s=jg[e];return typeof s=="function"&&(s=s(t)),this.getLocaleTextFunc()(e,s,t)}generateAutocompleteListParams(e,t,s){return{enabled:!0,type:t,searchString:s,entries:e}}getColumnAutocompleteEntries(){if(this.columnAutocompleteEntries)return this.columnAutocompleteEntries;const e=this.colModel.getColDefCols()??[],t=[],s=this.gos.get("includeHiddenColumnsInAdvancedFilter");return e.forEach(i=>{i.getColDef().filter&&(s||i.isVisible()||i.isRowGroupActive())&&t.push({key:i.getColId(),displayValue:this.colNames.getDisplayNameForColumn(i,"advancedFilter")})}),t.sort((i,r)=>{const a=i.displayValue??"",o=r.displayValue??"";return aa?1:0}),t}getOperatorAutocompleteEntries(e,t){const s=this.getActiveOperators(e);return this.getDataTypeExpressionOperator(t).getEntries(s)}getJoinOperatorAutocompleteEntries(){return Object.entries(this.expressionJoinOperators).map(([e,t])=>({key:e,displayValue:t}))}getDefaultAutocompleteListParams(e){return this.generateAutocompleteListParams(this.getColumnAutocompleteEntries(),"column",e)}getDataTypeExpressionOperator(e){return this.expressionOperators[e]}getExpressionOperator(e,t){return this.getDataTypeExpressionOperator(e)?.operators?.[t]}getExpressionJoinOperators(){return this.expressionJoinOperators}getColId(e){const t=e.toLocaleUpperCase(),s=this.columnNameToIdMap[t];if(s)return s;const r=this.getColumnAutocompleteEntries().find(({displayValue:a})=>a.toLocaleUpperCase()===t);if(r){const{key:a,displayValue:o}=r,n={colId:a,columnName:o};return this.columnNameToIdMap[t]=n,n}return null}getExpressionEvaluatorParams(e){let t=this.expressionEvaluatorParams[e];if(t)return t;const s=this.colModel.getColDefCol(e);if(!s)return{valueConverter:a=>a};switch(this.dataTypeSvc?.getBaseDataType(s)){case"dateString":t={valueConverter:this.dataTypeSvc?.getDateParserFunction(s)??(a=>a)};break;case"object":s.getColDef().filterValueGetter?t={valueConverter:a=>a}:t={valueConverter:(a,o)=>this.valueSvc.formatValue(s,o,a)??(typeof a.toString=="function"?a.toString():"")};break;case"text":case void 0:t={valueConverter:a=>wi(a)};break;default:t={valueConverter:a=>a};break}const{filterParams:r}=s.getColDef();return r&&["caseSensitive","includeBlanksInEquals","includeBlanksInLessThan","includeBlanksInGreaterThan"].forEach(a=>{const o=r[a];o&&(t[a]=o)}),this.expressionEvaluatorParams[e]=t,t}getColumnDetails(e){const t=this.colModel.getColDefCol(e)??void 0,s=(t?this.dataTypeSvc?.getBaseDataType(t):void 0)??"text";return{column:t,baseCellDataType:s}}generateExpressionOperators(){const e=(t,s)=>this.translate(t,s);return{text:new Ua({translate:e}),boolean:new Qg({translate:e}),object:new Ua({translate:e}),number:new Ri({translate:e,equals:(t,s)=>t===s}),date:new Ri({translate:e,equals:(t,s)=>t.getTime()===s.getTime()}),dateString:new Ri({translate:e,equals:(t,s)=>t.getTime()===s.getTime()})}}getColumnValue({displayValue:e}){return`${Pi}${e}${Fi}`}generateExpressionJoinOperators(){return{AND:this.translate("advancedFilterAnd"),OR:this.translate("advancedFilterOr")}}getActiveOperators(e){const t=e.getColDef().filterParams?.filterOptions;return t&&t.every(i=>typeof i=="string")?t:void 0}resetColumnCaches(){this.columnAutocompleteEntries=null,this.columnNameToIdMap={},this.expressionEvaluatorParams={}}};import{BeanStub as tm,_exists as sm,_isClientSideRowModel as im,_isServerSideRowModel as rm,_warn as am}from"ag-grid-community";import{BeanStub as om,_getAbsoluteHeight as nm,_getAbsoluteWidth as lm,_removeFromParent as cm}from"ag-grid-community";import{Component as dm,TabGuardFeature as hm,_createIconNoSpan as Ka,_findNextFocusableElement as um,_focusNextGridCoreContainer as pm,_setDisplayed as Wa}from"ag-grid-community";import{Component as ja,PositionableFeature as gm,RefPlaceholder as vs,_createIconNoSpan as mm,_getActiveDomElement as fm,_getInnerHeight as Cm,_getInnerWidth as vm,_isVisible as ym,_setDisplayed as Sm}from"ag-grid-community";var bm=".ag-panel{background-color:var(--ag-panel-background-color);display:flex;flex-direction:column;overflow:hidden;position:relative}.ag-dialog{border:var(--ag-dialog-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dialog-shadow);position:absolute}.ag-panel-title-bar{align-items:center;background-color:var(--ag-panel-title-bar-background-color);border-bottom:var(--ag-panel-title-bar-border);color:var(--ag-panel-title-bar-text-color);cursor:default;display:flex;flex:none;font-weight:var(--ag-panel-title-bar-font-weight);height:var(--ag-header-height);padding:var(--ag-spacing) var(--ag-cell-horizontal-padding)}.ag-panel-title-bar-button{color:var(--ag-panel-title-bar-icon-color);cursor:pointer}:where(.ag-ltr) .ag-panel-title-bar-button{margin-left:calc(var(--ag-spacing)*2);margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-panel-title-bar-button{margin-left:var(--ag-spacing);margin-right:calc(var(--ag-spacing)*2)}.ag-panel-title-bar-title{flex:1 1 auto}.ag-panel-title-bar-buttons{display:flex}.ag-panel-content-wrapper{display:flex;flex:1 1 auto;overflow:hidden;position:relative}:where(.ag-dragging-fill-handle) .ag-dialog,:where(.ag-dragging-range-handle) .ag-dialog{opacity:.7;pointer-events:none}";function wm(e){const t=e.cssIdentifier||"default";return`
`}var xm='
',$a=class extends ja{constructor(e){super(wm(e)),this.config=e,this.closable=!0,this.eContentWrapper=vs,this.eTitleBar=vs,this.eTitleBarButtons=vs,this.eTitle=vs,this.registerCSS(bm)}postConstruct(){const{component:e,closable:t,hideTitleBar:s,title:i,minWidth:r=250,width:a,minHeight:o=250,height:n,centered:l,popup:c,x:d,y:h}=this.config;this.positionableFeature=new gm(this.getGui(),{minWidth:r,width:a,minHeight:o,height:n,centered:l,x:d,y:h,popup:c,calculateTopBuffer:()=>this.positionableFeature.getHeight()-this.getBodyHeight()}),this.createManagedBean(this.positionableFeature);const u=this.getGui();e&&this.setBodyComponent(e),s?Sm(this.eTitleBar,!1):(i&&this.setTitle(i),this.setClosable(t??this.closable)),this.addManagedElementListeners(this.eTitleBar,{mousedown:p=>{if(u.contains(p.relatedTarget)||u.contains(fm(this.beans))||this.eTitleBarButtons.contains(p.target)){p.preventDefault();return}const g=this.eContentWrapper.querySelector("button, [href], input, select, textarea, [tabindex]");g&&g.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 t=this.closeButtonComp=new ja(xm);this.createBean(t);const s=t.getGui(),i=mm("close",this.beans);i.classList.add("ag-panel-title-bar-button-icon"),s.appendChild(i),this.addTitleBarButton(t),t.addManagedElementListeners(s,{click:this.onBtClose.bind(this)})}else if(this.closeButtonComp){const t=this.closeButtonComp.getGui();t.parentElement.removeChild(t),this.closeButtonComp=this.destroyBean(this.closeButtonComp)}}setBodyComponent(e){e.setParentComponent(this),this.eContentWrapper.appendChild(e.getGui())}addTitleBarButton(e,t){const s=this.eTitleBarButtons,i=s.children,r=i.length;t==null&&(t=r),t=Math.max(0,Math.min(t,r)),e.addCssClass("ag-panel-title-bar-button");const a=e.getGui();t===0?s.insertAdjacentElement("afterbegin",a):t===r?s.insertAdjacentElement("beforeend",a):i[t-1].insertAdjacentElement("afterend",a),e.setParentComponent(this)}getBodyHeight(){return Cm(this.eContentWrapper)}getBodyWidth(){return vm(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&&ym(e)&&this.close(),super.destroy()}},At=class extends $a{constructor(e){super({...e,popup:!0}),this.isMaximizable=!1,this.isMaximized=!1,this.maximizeListeners=[],this.resizeListenerDestroy=null,this.lastPosition={x:0,y:0,width:0,height:0}}wireBeans(e){this.popupSvc=e.popupSvc}postConstruct(){const e=this.getGui(),{movable:t,resizable:s,maximizable:i,modal:r,postProcessPopupParams:a}=this.config;if(this.addCssClass("ag-dialog"),super.postConstruct(),a){const{type:o,eventSource:n,column:l,mouseEvent:c,rowNode:d}=a;this.popupSvc?.callPostProcessPopup(o,e,n,c,l,d)}if(this.tabGuardFeature=this.createManagedBean(new hm(this)),this.tabGuardFeature.initialiseTabGuard({isFocusableContainer:!0,onFocusIn:()=>{this.popupSvc?.bringPopupToFront(e)},onTabKeyDown:o=>{if(r)return;const n=o.shiftKey,l=um(this.beans,e,!1,n);(!l||this.tabGuardFeature.getTabGuardCtrl().isTabGuard(l))&&pm(this.beans,n)&&o.preventDefault()}}),t&&this.setMovable(t),i&&this.setMaximizable(i),s&&this.setResizable(s),!this.config.modal){const o=this.beans.ctrlsSvc.get("gridCtrl");o.addFocusableContainer(this),this.addDestroyFunc(()=>o.removeFocusableContainer(this))}}setAllowFocus(e){this.tabGuardFeature.getTabGuardCtrl().setAllowFocus(e)}renderComponent(){const e=this.getGui(),{alwaysOnTop:t,modal:s,title:i,afterGuiAttached:r}=this.config,a=this.getLocaleTextFunc(),o=this.popupSvc?.addPopup({modal:s,eChild:e,closeOnEsc:!0,closedCallback:this.onClosed.bind(this),alwaysOnTop:t,ariaLabel:i||a("ariaLabelDialog","Dialog"),afterGuiAttached:r});o&&(this.close=o.hideFunc)}onClosed(e){this.destroy(),this.config.closedCallback?.(e)}toggleMaximize(){const e=this.positionableFeature.getPosition();if(this.isMaximized){const{x:t,y:s,width:i,height:r}=this.lastPosition;this.setWidth(i),this.setHeight(r),this.positionableFeature.offsetElement(t,s)}else this.lastPosition.width=this.getWidth(),this.lastPosition.height=this.getHeight(),this.lastPosition.x=e.x,this.lastPosition.y=e.y,this.positionableFeature.offsetElement(0,0),this.setHeight("100%"),this.setWidth("100%");this.isMaximized=!this.isMaximized,this.refreshMaximizeIcon()}refreshMaximizeIcon(){Wa(this.maximizeIcon,!this.isMaximized),Wa(this.minimizeIcon,this.isMaximized)}clearMaximizebleListeners(){this.maximizeListeners.length&&(this.maximizeListeners.forEach(e=>e()),this.maximizeListeners.length=0),this.resizeListenerDestroy&&(this.resizeListenerDestroy(),this.resizeListenerDestroy=null)}destroy(){this.maximizeButtonComp=this.destroyBean(this.maximizeButtonComp),this.clearMaximizebleListeners(),super.destroy()}setResizable(e){this.positionableFeature.setResizable(e)}setMovable(e){this.positionableFeature.setMovable(e,this.eTitleBar)}setMaximizable(e){if(!e){this.clearMaximizebleListeners(),this.maximizeButtonComp&&(this.destroyBean(this.maximizeButtonComp),this.maximizeButtonComp=this.maximizeIcon=this.minimizeIcon=void 0);return}const t=this.eTitleBar;if(!t||e===this.isMaximizable)return;const s=this.buildMaximizeAndMinimizeElements();this.refreshMaximizeIcon(),s.addManagedElementListeners(s.getGui(),{click:this.toggleMaximize.bind(this)}),this.addTitleBarButton(s,0),this.maximizeListeners.push(...this.addManagedElementListeners(t,{dblclick:this.toggleMaximize.bind(this)})),[this.resizeListenerDestroy]=this.addManagedListeners(this.positionableFeature,{resize:()=>{this.isMaximized=!1,this.refreshMaximizeIcon()}})}buildMaximizeAndMinimizeElements(){const e=this.maximizeButtonComp=this.createBean(new dm('
')),t=e.getGui();return this.maximizeIcon=Ka("maximize",this.beans),t.appendChild(this.maximizeIcon),this.maximizeIcon.classList.add("ag-panel-title-bar-button-icon"),this.minimizeIcon=Ka("minimize",this.beans),t.appendChild(this.minimizeIcon),this.minimizeIcon.classList.add("ag-panel-title-bar-button-icon"),e}};import{Component as Tm,RefPlaceholder as Rt,_createIconNoSpan as Mm,_makeNull as Pm,_setDisabled as nt}from"ag-grid-community";import{AgInputTextFieldSelector as Fm,Component as Am,KeyCode as pe,RefPlaceholder as Rm,_isNothingFocused as Em,_makeNull as Ya}from"ag-grid-community";var Im=".ag-autocomplete{align-items:center;display:flex;width:100%;>*{flex:1 1 auto}}.ag-autocomplete-list-popup{background-color:var(--ag-background-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);padding:0;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-autocomplete-list{height:calc(var(--ag-row-height)*6.5);min-width:200px;position:relative;width:100%}.ag-autocomplete-virtual-list-item{cursor:default;display:flex;height:var(--ag-list-item-height);&:focus-visible:after{content:none}&:hover{background-color:var(--ag-row-hover-color)}}.ag-autocomplete-row{align-items:center;display:flex;flex:1 1 auto;overflow:hidden}.ag-autocomplete-row-label{margin:0 var(--ag-widget-container-horizontal-padding);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-autocomplete-row-selected{background-color:var(--ag-selected-row-background-color)}";import{KeyCode as Dm,PopupComponent as Lm,RefPlaceholder as km,_exists as Gm,_fuzzySuggestions as Om}from"ag-grid-community";import{KeyCode as ce,RefPlaceholder as Nm,TabGuardComp as Bm,_getAriaPosInSet as _m,_observeResize as Vm,_requestAnimationFrame as Xa,_setAriaLabel as Hm,_setAriaPosInSet as zm,_setAriaRole as qa,_setAriaSetSize as Um,_stopPropagationForAgGrid as Km,_waitUntil as Wm,_warn as jm}from"ag-grid-community";function $m(e){return``}var lt=class extends Bm{constructor(e){super($m(e?.cssIdentifier||"default")),this.renderedRows=new Map,this.rowHeight=20,this.pageSize=-1,this.isScrolling=!1,this.isHeightFromTheme=!0,this.eContainer=Nm,this.awaitStableCallbacks=[];const{cssIdentifier:t="default",ariaRole:s="listbox",listName:i}=e||{};this.cssIdentifier=t,this.ariaRole=s,this.listName=i}wireBeans(e){this.environment=e.environment}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.addManagedEventListeners({gridStylesChanged:this.onGridStylesChanged.bind(this)})}onGridStylesChanged(e){e.listItemHeightChanged&&(this.rowHeight=this.getItemHeight(),this.refresh())}setAriaProperties(){const t=this.getLocaleTextFunc()("ariaDefaultListName",this.listName||"List"),s=this.eContainer;qa(s,this.ariaRole),Hm(s,t)}addResizeObserver(){const e=()=>Xa(this.beans,()=>this.drawVirtualRows()),t=Vm(this.beans,this.getGui(),e);this.addDestroyFunc(t)}focusInnerElement(e){return this.focusRow(e?this.model.getRowCount()-1:0),!0}onFocusIn(e){const t=e.target;t.classList.contains("ag-virtual-list-item")&&(this.lastFocusedRowIndex=_m(t)-1)}onFocusOut(e){this.getFocusableElement().contains(e.relatedTarget)||(this.lastFocusedRowIndex=null)}handleKeyDown(e){switch(e.key){case ce.UP:case ce.DOWN:e.preventDefault(),this.navigate(e.key===ce.UP);break;case ce.PAGE_HOME:case ce.PAGE_END:case ce.PAGE_UP:case ce.PAGE_DOWN:this.navigateToPage(e.key)!==null&&e.preventDefault();break}}onTabKeyDown(e){Km(e),this.forceFocusOutOfContainer(e.shiftKey)}navigate(e){if(this.lastFocusedRowIndex==null)return;const t=this.lastFocusedRowIndex+(e?-1:1);t<0||t>=this.model.getRowCount()||this.focusRow(t)}navigateToPage(e,t="focused"){let s=!1;t==="focused"&&(t=this.getLastFocusedRow(),s=!0);const i=this.model.getRowCount()-1;let r=-1;return e===ce.PAGE_HOME?r=0:e===ce.PAGE_END?r=i:e===ce.PAGE_DOWN?r=Math.min(t+this.pageSize,i):e===ce.PAGE_UP&&(r=Math.max(t-this.pageSize,0)),r===-1?null:(s?this.focusRow(r):this.ensureIndexVisible(r),r)}getLastFocusedRow(){return this.lastFocusedRowIndex}focusRow(e){this.isScrolling||(this.isScrolling=!0,this.ensureIndexVisible(e),Xa(this.beans,()=>{if(this.isScrolling=!1,!this.isAlive())return;const t=this.renderedRows.get(e);t&&t.eDiv.focus()}))}getComponentAt(e){const t=this.renderedRows.get(e);return t&&t.rowComponent}forEachRenderedRow(e){this.renderedRows.forEach((t,s)=>e(t.rowComponent,s))}getItemHeight(){return this.isHeightFromTheme?this.environment.getDefaultListItemHeight():this.rowHeight}ensureIndexVisible(e,t=!0){const s=this.model.getRowCount();if(typeof e!="number"||e<0||e>=s)return jm(229,{index:e}),!1;const i=e*this.rowHeight,r=i+this.rowHeight,a=this.getGui(),o=a.scrollTop,n=a.offsetHeight,l=o+n,c=t?0:this.rowHeight,d=o>i+c,h=l{this.isAlive()&&(this.canSoftRefresh(e)?this.drawVirtualRows(!0):(this.clearVirtualRows(),this.drawVirtualRows()))})}awaitStable(e){if(this.awaitStableCallbacks.push(e),this.awaitStableCallbacks.length>1)return;const t=this.model.getRowCount();Wm(()=>this.eContainer.clientHeight>=t*this.rowHeight,()=>{if(!this.isAlive())return;const s=this.awaitStableCallbacks;this.awaitStableCallbacks=[],s.forEach(i=>i())})}canSoftRefresh(e){return!!(e&&this.renderedRows.size&&typeof this.model.areRowsEqual=="function"&&this.componentUpdater)}clearVirtualRows(){this.renderedRows.forEach((e,t)=>this.removeRow(t))}drawVirtualRows(e){if(!this.isAlive()||!this.model)return;const t=this.getGui(),s=t.scrollTop,i=s+t.offsetHeight,r=Math.floor(s/this.rowHeight),a=Math.floor(i/this.rowHeight);this.pageSize=Math.floor((i-s)/this.rowHeight),this.ensureRowsRendered(r,a,e)}ensureRowsRendered(e,t,s){this.renderedRows.forEach((i,r)=>{(rt)&&r!==this.lastFocusedRowIndex&&this.removeRow(r)}),s&&this.refreshRows();for(let i=e;i<=t;i++)this.renderedRows.has(i)||ithis.lastFocusedRowIndex=e),s.appendChild(i.getGui()),this.renderedRows.has(e-1)?this.renderedRows.get(e-1).eDiv.insertAdjacentElement("afterend",s):this.renderedRows.has(e+1)?this.renderedRows.get(e+1).eDiv.insertAdjacentElement("beforebegin",s):this.eContainer.appendChild(s),this.renderedRows.set(e,{rowComponent:i,eDiv:s,value:t})}removeRow(e){const t=this.renderedRows.get(e);this.eContainer.removeChild(t.eDiv),this.destroyBean(t.rowComponent),this.renderedRows.delete(e)}refreshRows(){const e=this.model.getRowCount();this.renderedRows.forEach((t,s)=>{if(s>=e)this.removeRow(s);else{const i=this.model.getRow(s);this.model.areRowsEqual?.(t.value,i)?this.componentUpdater(i,t.rowComponent):this.removeRow(s)}})}addScrollListener(){this.addGuiEventListener("scroll",()=>this.drawVirtualRows(),{passive:!0})}setModel(e){this.model=e}getAriaElement(){return this.eContainer}destroy(){this.isAlive()&&(this.clearVirtualRows(),this.awaitStableCallbacks.length=0,super.destroy())}};import{Component as Ym,_escapeString as ys,_exists as Xm}from"ag-grid-community";var qm=class extends Ym{constructor(){super(` `),this.hasHighlighting=!1}setState(e,t){this.value=e,this.render(),this.updateSelected(t)}updateSelected(e){this.addOrRemoveCssClass("ag-autocomplete-row-selected",e)}setSearchString(e){let t=!1;if(Xm(e)){const s=this.value?.toLocaleLowerCase().indexOf(e.toLocaleLowerCase());if(s>=0){t=!0,this.hasHighlighting=!0;const i=s+e.length,r=ys(this.value.slice(0,s)),a=ys(this.value.slice(s,i)),o=ys(this.value.slice(i));this.getGui().lastElementChild.innerHTML=`${r}${a}${o}`}}!t&&this.hasHighlighting&&(this.hasHighlighting=!1,this.render())}render(){this.getGui().lastElementChild.innerHTML=ys(this.value)??" "}},Zm=class extends Lm{constructor(e){super(`
`),this.params=e,this.eList=km,this.searchString=""}postConstruct(){this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList=this.createManagedBean(new lt({cssIdentifier:"autocomplete"})),this.virtualList.setComponentCreator(this.createRowComponent.bind(this)),this.eList.appendChild(this.virtualList.getGui()),this.virtualList.setModel({getRowCount:()=>this.autocompleteEntries.length,getRow:t=>this.autocompleteEntries[t]});const e=this.virtualList.getGui();this.addManagedListeners(e,{click:()=>this.params.onConfirmed(),mousemove:this.onMouseMove.bind(this),mousedown:t=>t.preventDefault()}),this.setSelectedValue(0)}onNavigationKeyDown(e,t){e.preventDefault();const s=this.autocompleteEntries.indexOf(this.selectedValue),i=t===Dm.UP?s-1:s+1;this.checkSetSelectedValue(i)}setSearch(e){this.searchString=e,Gm(e)?this.runSearch():(this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList.refresh(),this.checkSetSelectedValue(0)),this.updateSearchInList()}runContainsSearch(e,t){let s,i=!1;const r=e.toLocaleLowerCase(),a=t.filter(o=>{const l=o.toLocaleLowerCase().indexOf(r),c=l===0,d=l>=0;return d&&(!s||!i&&c||i===c&&o.lengthl.displayValue??l.key);let r,a;if(t)r=Om({inputValue:this.searchString,allSuggestions:i,hideIrrelevant:!0,addSequentialWeight:!0}).values,a=r.length?r[0]:void 0;else{const l=this.runContainsSearch(this.searchString,i);r=l.allMatches,a=l.topMatch}let o=e.filter(({key:l,displayValue:c})=>r.includes(c??l));if(!o.length&&this.selectedValue&&s?.(this.selectedValue,this.searchString)&&(o=[this.selectedValue]),this.autocompleteEntries=o,this.virtualList.refresh(),!a)return;const n=r.indexOf(a);this.checkSetSelectedValue(n)}updateSearchInList(){this.virtualList.forEachRenderedRow(e=>e.setSearchString(this.searchString))}checkSetSelectedValue(e){e>=0&&e{s.updateSelected(e===i)}))}createRowComponent(e){const t=new qm;return this.createBean(t),t.setState(e.displayValue??e.key,e===this.selectedValue),t}onMouseMove(e){const t=this.virtualList,s=t.getGui().getBoundingClientRect(),i=t.getScrollTop(),r=e.clientY-s.top+i,a=Math.floor(r/t.getRowHeight());this.checkSetSelectedValue(a)}afterGuiAttached(){this.virtualList.refresh()}getSelectedValue(){return this.autocompleteEntries.length?this.selectedValue??null:null}},Jm=class extends Am{constructor(){super(` `,[Fm]),this.eAutocompleteInput=Rm,this.isListOpen=!1,this.lastPosition=0,this.valid=!0,this.registerCSS(Im)}wireBeans(e){this.popupSvc=e.popupSvc}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 t=Ya(e);this.updateValue(t),this.updateAutocompleteList(t)}updateValue(e){this.updateLastPosition(),this.dispatchLocalEvent({type:"eventValueChanged",value:e}),this.validate(e)}updateAutocompleteList(e){const t=this.listGenerator?.(e,this.lastPosition)??{enabled:!1};(!t.type||t.type!==this.autocompleteListParams?.type)&&this.isListOpen&&this.closeList();const s=this.isListOpen;if(this.autocompleteListParams=t,t?.enabled){s||this.openList();const{searchString:i}=t;this.autocompleteList.setSearch(i??"")}else s&&this.closeList()}onKeyDown(e){const t=e.key;switch(this.updateLastPosition(),t){case pe.ENTER:this.onEnterKeyDown(e);break;case pe.TAB:this.onTabKeyDown(e);break;case pe.DOWN:case pe.UP:this.onUpDownKeyDown(e,t);break;case pe.LEFT:case pe.RIGHT:case pe.PAGE_HOME:case pe.PAGE_END:setTimeout(()=>{this.updatePositionAndList()});break;case pe.ESCAPE:this.onEscapeKeyDown(e);break;case pe.SPACE:e.ctrlKey&&!this.isListOpen&&(e.preventDefault(),this.forceOpenList());break}}confirmSelection(){const e=this.autocompleteList?.getSelectedValue();e&&(this.closeList(),this.dispatchLocalEvent({type:"eventOptionSelected",value:this.getValue(),position:this.lastPosition,updateEntry:e,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,t){e.preventDefault(),this.isListOpen?this.autocompleteList?.onNavigationKeyDown(e,t):this.forceOpenList()}onEscapeKeyDown(e){this.isListOpen&&(e.preventDefault(),e.stopPropagation(),this.closeList(),this.setCaret(this.lastPosition,!0))}onFocusOut(){this.isListOpen&&this.closeList()}updatePositionAndList(){this.updateLastPosition(),this.updateAutocompleteList(this.eAutocompleteInput.getValue()??null)}setCaret(e,t){t&&Em(this.beans)&&this.eAutocompleteInput.getFocusableElement().focus();const s=this.eAutocompleteInput.getInputElement();s.setSelectionRange(e,e),e===s.value.length&&(s.scrollLeft=s.scrollWidth)}forceOpenList(){this.onValueChanged(this.eAutocompleteInput.getValue())}updateLastPosition(){this.lastPosition=this.eAutocompleteInput.getInputElement().selectionStart??0}validate(e){if(!this.validator)return;const t=this.validationMessage=this.validator(e);this.eAutocompleteInput.getInputElement().setCustomValidity(t??""),this.valid=!t,this.dispatchLocalEvent({type:"eventValidChanged",isValid:this.valid,validationMessage:t})}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(),t={ePopup:e,type:"autocomplete",eventSource:this.getGui(),position:"under",alignSide:this.gos.get("enableRtl")?"right":"left",keepWithinBounds:!0},s=this.popupSvc.addPopup({eChild:e,anchorToElement:this.getGui(),positionCallback:()=>this.popupSvc.positionPopupByComponent(t),ariaLabel:this.listAriaLabel});this.hidePopup=s.hideFunc,this.autocompleteList.afterGuiAttached()}closeList(){this.isListOpen=!1,this.hidePopup(),this.destroyBean(this.autocompleteList),this.autocompleteList=null}onCompleted(){this.isListOpen&&this.closeList(),this.dispatchLocalEvent({type:"eventValueConfirmed",value:this.getValue(),isValid:this.isValid()})}getValue(){return Ya(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:t,position:s,silent:i,updateListOnlyIfOpen:r,restoreFocus:a}=e;this.eAutocompleteInput.setValue(t,!0),this.setCaret(s??this.lastPosition,a),i||this.updateValue(t),(!r||this.isListOpen)&&this.updateAutocompleteList(t)}setForceLastSelection(e){return this.forceLastSelection=e,this}setInputDisabled(e){return this.eAutocompleteInput.setDisabled(e),this}},Qm={selector:"AG-AUTOCOMPLETE",component:Jm},Za=class extends Tm{constructor(){super(` `,[Qm]),this.eAutocomplete=Rt,this.eApplyFilterButton=Rt,this.eBuilderFilterButton=Rt,this.eBuilderFilterButtonIcon=Rt,this.eBuilderFilterButtonLabel=Rt,this.expressionParser=null,this.isApplyDisabled=!0,this.builderOpen=!1}wireBeans(e){this.advFilterExpSvc=e.advFilterExpSvc,this.advancedFilter=e.advancedFilter,this.filterManager=e.filterManager,this.registry=e.registry}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui(),getTooltipShowDelayOverride:()=>1e3,getLocation:()=>"advancedFilter"})),this.eAutocomplete.setListGenerator((e,t)=>this.generateAutocompleteListParams(t)).setValidator(()=>this.validateValue()).setForceLastSelection((e,t)=>this.forceLastSelection(e,t)).setInputAriaLabel(this.advFilterExpSvc.translate("ariaAdvancedFilterInput")).setListAriaLabel(this.advFilterExpSvc.translate("ariaLabelAdvancedFilterAutocomplete")),this.refresh(),this.addManagedListeners(this.eAutocomplete,{eventValueChanged:({value:e})=>this.onValueChanged(e),eventValueConfirmed:({isValid:e})=>this.onValueConfirmed(e),eventOptionSelected:({position:e,updateEntry:t,autocompleteType:s})=>this.onOptionSelected(e,t,s),eventValidChanged:({isValid:e,validationMessage:t})=>this.onValidChanged(e,t)}),this.setupApplyButton(),this.setupBuilderButton()}refresh(){const e=this.advancedFilter.getExpressionDisplayValue();this.eAutocomplete.setValue({value:e??"",position:e?.length,updateListOnlyIfOpen:!0})}setInputDisabled(e){this.eAutocomplete.setInputDisabled(e),nt(this.eApplyFilterButton,e||this.isApplyDisabled)}setupApplyButton(){this.eApplyFilterButton.innerText=this.advFilterExpSvc.translate("advancedFilterApply"),this.activateTabIndex([this.eApplyFilterButton]),this.addManagedElementListeners(this.eApplyFilterButton,{click:()=>this.onValueConfirmed(this.eAutocomplete.isValid())}),nt(this.eApplyFilterButton,this.isApplyDisabled)}setupBuilderButton(){this.eBuilderFilterButtonIcon.appendChild(Mm("advancedFilterBuilder",this.beans)),this.eBuilderFilterButtonLabel.innerText=this.advFilterExpSvc.translate("advancedFilterBuilder"),this.activateTabIndex([this.eBuilderFilterButton]),this.addManagedElementListeners(this.eBuilderFilterButton,{click:()=>this.openBuilder()}),this.addManagedListeners(this.advancedFilter.getCtrl(),{advancedFilterBuilderClosed:()=>this.closeBuilder()})}onValueChanged(e){e=Pm(e),this.advancedFilter.setExpressionDisplayValue(e),this.expressionParser=this.advancedFilter.createExpressionParser(e);const t=this.expressionParser?.parseExpression();t&&t!==e&&this.eAutocomplete.setValue({value:t,silent:!0,restoreFocus:!0})}onValueConfirmed(e){!e||this.isApplyDisabled||(nt(this.eApplyFilterButton,!0),this.advancedFilter.applyExpression(),this.filterManager?.onFilterChanged({source:"advancedFilter"}))}onOptionSelected(e,t,s){const{updatedValue:i,updatedPosition:r,hideAutocomplete:a}=this.updateExpression(e,t,s);this.eAutocomplete.setValue({value:i,position:r,updateListOnlyIfOpen:a,restoreFocus:!0})}validateValue(){return this.expressionParser?.isValid()?null:this.expressionParser?.getValidationMessage()??null}onValidChanged(e,t){this.isApplyDisabled=!e||this.advancedFilter.isCurrentExpressionApplied(),nt(this.eApplyFilterButton,this.isApplyDisabled),this.tooltipFeature?.setTooltipAndRefresh(t)}generateAutocompleteListParams(e){return this.expressionParser?this.expressionParser.getAutocompleteListParams(e):this.advFilterExpSvc.getDefaultAutocompleteListParams("")}updateExpression(e,t,s){return this.advFilterExpSvc.updateAutocompleteCache(t,s),this.expressionParser?.updateExpression(e,t,s)??this.advancedFilter.getDefaultExpression(t)}forceLastSelection({key:e,displayValue:t},s){return!!s.toLocaleLowerCase().match(`^${(t??e).toLocaleLowerCase()}\\s*$`)}openBuilder(){this.builderOpen||(this.builderOpen=!0,nt(this.eBuilderFilterButton,!0),this.advancedFilter.getCtrl().toggleFilterBuilder({source:"ui",eventSource:this.eBuilderFilterButton}))}closeBuilder(){this.builderOpen&&(this.builderOpen=!1,nt(this.eBuilderFilterButton,!1),this.eBuilderFilterButton.focus())}};import{Component as ef,KeyCode as Et,_clearElement as tf,_findNextFocusableElement as sf,_focusInto as rf,_getActiveDomElement as af,_getFloatingFiltersHeight as of,_setAriaColIndex as nf,_setAriaColSpan as lf,_setAriaRole as cf,_setAriaRowIndex as df,_setDisplayed as hf}from"ag-grid-community";var uf=class extends ef{constructor(e){super(`
`),this.enabled=e}wireBeans(e){this.colModel=e.colModel,this.focusSvc=e.focusSvc,this.ctrlsSvc=e.ctrlsSvc}postConstruct(){this.setupAdvancedFilter(this.enabled),this.addDestroyFunc(()=>this.destroyBean(this.eAdvancedFilter));const e=()=>{this.enabled&&this.setEnabledHeight()};this.addManagedEventListeners({gridColumnsChanged:()=>this.onGridColumnsChanged(),columnHeaderHeightChanged:e,gridStylesChanged:e}),this.addManagedPropertyListener("headerHeight",e),this.addManagedPropertyListener("floatingFiltersHeight",e),this.addGuiEventListener("keydown",t=>this.onKeyDown(t)),this.addGuiEventListener("focusout",t=>{this.getFocusableElement().contains(t.relatedTarget)||this.focusSvc.clearAdvancedFilterColumn()})}getFocusableElement(){return this.eAdvancedFilter?.getGui()??this.getGui()}setEnabled(e){e!==this.enabled&&this.setupAdvancedFilter(e)}refresh(){this.eAdvancedFilter?.refresh()}getHeight(){return this.height}setInputDisabled(e){this.eAdvancedFilter?.setInputDisabled(e)}setupAdvancedFilter(e){const t=this.getGui();if(e){this.eAdvancedFilter=this.createBean(new Za);const s=this.eAdvancedFilter.getGui();this.eAdvancedFilter.addCssClass("ag-advanced-filter-header-cell"),this.setEnabledHeight(),this.setAriaRowIndex(),cf(s,"gridcell"),nf(s,1),this.setAriaColumnCount(s),t.appendChild(s)}else tf(t),this.destroyBean(this.eAdvancedFilter),this.height=0;hf(t,e),this.enabled=e}setEnabledHeight(){const e=this.getGui();this.height=of(this.beans);const t=`${this.height}px`;e.style.height=t,e.style.minHeight=t}setAriaColumnCount(e){lf(e,this.colModel.getCols().length)}setAriaRowIndex(){df(this.getGui(),this.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0)}onGridColumnsChanged(){this.eAdvancedFilter&&(this.setAriaColumnCount(this.eAdvancedFilter.getGui()),this.setAriaRowIndex())}onKeyDown(e){switch(e.key){case Et.ENTER:{this.hasFocus()&&rf(this.getFocusableElement())&&e.preventDefault();break}case Et.ESCAPE:this.hasFocus()||this.getFocusableElement().focus();break;case Et.UP:this.navigateUpDown(!0,e);break;case Et.DOWN:this.navigateUpDown(!1,e);break;case Et.TAB:if(this.hasFocus())this.navigateLeftRight(e);else{const t=sf(this.beans,this.getFocusableElement(),null,e.shiftKey);t?(e.preventDefault(),t.focus()):this.navigateLeftRight(e)}break}}navigateUpDown(e,t){this.hasFocus()&&this.focusSvc.focusNextFromAdvancedFilter(e)&&t.preventDefault()}navigateLeftRight(e){(e.shiftKey?this.focusSvc.focusLastHeader():this.focusSvc.focusNextFromAdvancedFilter(!1,!0))&&e.preventDefault()}hasFocus(){return af(this.beans)===this.getFocusableElement()}};import{Component as pf,RefPlaceholder as Ei,_exists as gf,_setDisabled as mf}from"ag-grid-community";import{BeanStub as ff,DragSourceType as Cf}from"ag-grid-community";import{AutoScrollService as vf,BeanStub as yf,_radioCssClass as Ja}from"ag-grid-community";var Ii="ag-list-item-hovered",Qa=class extends yf{constructor(e,t,s){super(),this.comp=e,this.virtualList=t,this.params=s,this.currentDragValue=null,this.lastHoveredListItem=null}wireBeans(e){this.dragAndDrop=e.dragAndDrop}postConstruct(){this.addManagedListeners(this.params.eventSource,{[this.params.listItemDragStartEvent]:this.listItemDragStart.bind(this),[this.params.listItemDragEndEvent]:this.listItemDragEnd.bind(this)}),this.createDropTarget(),this.createAutoScrollService()}listItemDragStart(e){this.currentDragValue=this.params.getCurrentDragValue(e),this.moveBlocked=this.params.isMoveBlocked(this.currentDragValue)}listItemDragEnd(){window.setTimeout(()=>{this.currentDragValue=null,this.moveBlocked=!1},10)}createDropTarget(){const e={isInterestedIn:t=>t===this.params.dragSourceType,getIconName:()=>this.moveBlocked?"pinned":"move",getContainer:()=>this.comp.getGui(),onDragging:t=>this.onDragging(t),onDragStop:()=>this.onDragStop(),onDragLeave:()=>this.onDragLeave(),onDragCancel:()=>this.onDragCancel()};this.dragAndDrop?.addDropTarget(e)}createAutoScrollService(){const e=this.virtualList.getGui();this.autoScrollService=new vf({scrollContainer:e,scrollAxis:"y",getVerticalPosition:()=>e.scrollTop,setVerticalPosition:t=>e.scrollTop=t})}onDragging(e){if(!this.currentDragValue||this.moveBlocked)return;const t=this.getListDragItem(e),s=this.virtualList.getComponentAt(t.rowIndex);if(!s)return;const i=s.getGui().parentElement;this.lastHoveredListItem&&this.lastHoveredListItem.rowIndex===t.rowIndex&&this.lastHoveredListItem.position===t.position||(this.autoScrollService.check(e.event),this.clearHoveredItems(),this.lastHoveredListItem=t,Ja(i,Ii),Ja(i,`ag-item-highlight-${t.position}`))}getListDragItem(e){const t=this.virtualList.getGui(),s=parseFloat(window.getComputedStyle(t).paddingTop),i=this.virtualList.getRowHeight(),r=this.virtualList.getScrollTop(),a=Math.max(0,(e.y-s+r)/i),o=this.params.getNumRows(this.comp)-1,n=Math.min(o,a)|0;return{rowIndex:n,position:Math.round(a)>a||a>o?"bottom":"top",component:this.virtualList.getComponentAt(n)}}onDragStop(){this.moveBlocked||(this.params.moveItem(this.currentDragValue,this.lastHoveredListItem),this.clearDragProperties())}onDragCancel(){this.clearDragProperties()}onDragLeave(){this.clearDragProperties()}clearDragProperties(){this.clearHoveredItems(),this.autoScrollService.ensureCleared()}clearHoveredItems(){this.virtualList.getGui().querySelectorAll(`.${Ii}`).forEach(t=>{[Ii,"ag-item-highlight-top","ag-item-highlight-bottom"].forEach(s=>{t.classList.remove(s)})}),this.lastHoveredListItem=null}},Sf=class extends ff{constructor(e,t){super(),this.comp=e,this.virtualList=t}postConstruct(){this.createManagedBean(new Qa(this.comp,this.virtualList,{dragSourceType:Cf.AdvancedFilterBuilder,listItemDragStartEvent:"advancedFilterBuilderDragStarted",listItemDragEndEvent:"advancedFilterBuilderDragEnded",eventSource:this,getCurrentDragValue:e=>this.getCurrentDragValue(e),isMoveBlocked:()=>!1,getNumRows:e=>e.getNumItems(),moveItem:(e,t)=>this.moveItem(e,t)}))}getCurrentDragValue(e){return e.item}moveItem(e,t){this.comp.moveItem(e,t)}};import{Component as bf,RefPlaceholder as wf,_setAriaLabel as xf,_setAriaLevel as Tf}from"ag-grid-community";import{AgInputTextFieldSelector as Mf,_setAriaLabel as Pf,_setAriaLabelledBy as Ff,_setDisplayed as Af,_stopPropagationForAgGrid as Rf}from"ag-grid-community";import{AgInputTextFieldSelector as Ef,AgPickerField as If,KeyCode as $,RefPlaceholder as eo,_addGridCommonParams as Df,_bindCellRendererToHtmlElement as Lf,_clearElement as Di,_createIconNoSpan as kf,_debounce as Gf,_escapeString as Of,_exists as to,_fuzzySuggestions as Nf,_getActiveDomElement as Bf,_getEditorRendererDetails as _f,_isEventFromPrintableCharacter as Vf,_isVisible as Hf,_setAriaActiveDescendant as zf,_shouldDisplayTooltip as Uf,_stopPropagationForAgGrid as Kf}from"ag-grid-community";import{Component as Wf,KeyCode as ct,_clearElement as jf,_findFocusableElements as $f,_findNextFocusableElement as Yf,_getActiveDomElement as so,_getDocument as Xf,_setAriaPosInSet as qf,_setAriaSetSize as Zf}from"ag-grid-community";import{RefPlaceholder as io}from"ag-grid-community";import{Component as Jf}from"ag-grid-community";var Qf=class extends Jf{constructor(e){super(`
`),this.config=e,this.eText=io,this.eButton=io}postConstruct(){const{config:e,eButton:t}=this,{onKeyDown:s,onButtonClick:i}=e;this.getGui().setAttribute("tabindex",String(this.gos.get("tabIndex"))),this.addGuiEventListener("focus",()=>{this.eButton.focus()}),s&&this.addGuiEventListener("keydown",s),i&&this.addManagedElementListeners(t,{click:i})}toggleCloseButtonClass(e,t){this.eButton.classList.toggle(e,t)}setText(e){this.eText.textContent=e}getText(){return this.eText.textContent}},eC=class extends Wf{constructor(){super(`
`),this.pills=[]}init(e){this.params=e,this.refresh()}refresh(){this.clearPills();const{params:e,onPillKeyDown:t}=this;let s=e.getValue();if(!Array.isArray(s)){if(s==null)return;s=[s]}const i=e.valueFormatter??(a=>String(a)),r=s.length;for(let a=0;athis.onPillButtonClick(n),onKeyDown:t.bind(this)})),l=n.getGui();qf(l,a+1),Zf(l,r),e.onPillMouseDown&&n.addGuiEventListener("mousedown",e.onPillMouseDown),e.announceItemFocus&&n.addGuiEventListener("focus",e.announceItemFocus),n.setText(i(o)??""),n.toggleCloseButtonClass("ag-icon-cancel",!0),this.appendChild(l),this.pills.push(n)}}onNavigationKeyDown(e){const{key:t}=e;if(!this.pills.length||t!==ct.LEFT&&t!==ct.RIGHT)return;e.preventDefault();const{params:s,beans:i}=this,r=so(i),a=this.getGui();if(a.contains(r)){const o=Yf(i,a,!1,t===ct.LEFT);o?o.focus():s.eWrapper&&s.eWrapper.focus()}else{const o=$f(a);o.length>0&&o[t===ct.RIGHT?0:o.length-1].focus()}}clearPills(){const e=this.getGui();e.contains(so(this.beans))&&this.params.eWrapper&&this.params.eWrapper.focus(),jf(e),this.destroyBeans(this.pills),this.pills=[]}onPillButtonClick(e){this.deletePill(e)}onPillKeyDown(e){const t=e.key;if(t!==ct.DELETE&&t!==ct.BACKSPACE)return;e.preventDefault();const s=Xf(this.beans),i=this.pills.findIndex(a=>a.getGui().contains(s.activeElement));if(i===-1)return;const r=this.pills[i];r&&this.deletePill(r,i)}deletePill(e,t){const s=e.getText(),i=(this.params.getValue()||[]).filter(r=>r!==s);if(this.params.setValue(i),!i.length&&this.params.eWrapper)this.params.eWrapper.focus();else if(t!=null){const r=this.pills[Math.min(t,this.pills.length-1)];r&&r.getFocusableElement().focus()}}destroy(){this.clearPills(),super.destroy()}},tC=".ag-rich-select{cursor:default;height:100%}.ag-rich-select-value{align-items:center;background-color:var(--ag-picker-button-background-color);display:flex;height:100%;padding:var(--ag-spacing);:where(.ag-picker-field-display){overflow:hidden;text-overflow:ellipsis;&:where(.ag-display-as-placeholder){opacity:.5}}}.ag-rich-select-list{background-color:var(--ag-picker-list-background-color);border:var(--ag-picker-list-border);border-radius:var(--ag-input-border-radius);box-shadow:var(--ag-dropdown-shadow);height:auto;position:relative;width:100%;:where(.ag-loading-text){padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}}.ag-rich-select-row{align-items:center;display:flex;flex:1 1 auto;height:100%;overflow:hidden;padding:0 var(--ag-spacing);white-space:nowrap}.ag-rich-select-row-selected{background-color:var(--ag-selected-row-background-color)}.ag-rich-select-row-highlighted,.ag-rich-select-row:hover{background-image:linear-gradient(var(--ag-row-hover-color),var(--ag-row-hover-color))}.ag-rich-select-row-text-highlight{font-weight:700}.ag-rich-select-field-input{flex:1 1 auto;:where(.ag-input-field-input){border:none!important;box-shadow:none!important;padding:0!important;text-overflow:ellipsis;&::-moz-placeholder{opacity:.8}&::placeholder{opacity:.8}}}:where(.ag-ltr) .ag-rich-select-field-input{left:var(--ag-spacing)}:where(.ag-rtl) .ag-rich-select-field-input{right:var(--ag-spacing)}:where(.ag-popup-editor) .ag-rich-select-value{height:var(--ag-row-height);min-width:200px}.ag-rich-select-virtual-list-item{cursor:default;height:var(--ag-list-item-height)}.ag-pill-container{display:flex;flex-wrap:nowrap;gap:.25rem}.ag-pill{align-items:center;background:var(--ag-select-cell-background-color);border:var(--ag-select-cell-border);border-radius:var(--ag-border-radius);display:flex;padding:0 .25rem;white-space:nowrap}.ag-pill-button{border:none;padding:0;&:hover{color:var(--ag-accent-color);cursor:pointer}}:where(.ag-ltr) .ag-pill-button{margin-left:var(--ag-spacing)}:where(.ag-rtl) .ag-pill-button{margin-right:var(--ag-spacing)}";import{KeyCode as sC,_getDocument as iC,_requestAnimationFrame as ro,_setAriaActiveDescendant as rC,_setAriaControls as aC,_setAriaLabel as oC}from"ag-grid-community";import{Component as nC,_addGridCommonParams as lC,_bindCellRendererToHtmlElement as cC,_escapeString as Ss,_exists as It,_getDocument as dC,_getEditorRendererDetails as hC,_setAriaSelected as uC,_shouldDisplayTooltip as pC}from"ag-grid-community";var gC=class extends nC{constructor(e){super(''),this.params=e}wireBeans(e){this.userCompFactory=e.userCompFactory,this.registry=e.registry}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui(),shouldDisplayTooltip:()=>this.shouldDisplayTooltip?.()??!0}))}setState(e){const{params:t}=this,s=t.valueFormatter?.(e)??"";this.populateWithRenderer(e,s)||this.populateWithoutRenderer(e,s),this.value=e}highlightString(e){const{parsedValue:t}=this;if(this.params.cellRenderer||!It(t))return;let s=It(e);if(s){const i=t?.toLocaleLowerCase().indexOf(e.toLocaleLowerCase());if(i>=0){const r=i+e.length,a=Ss(t.slice(0,i),!0),o=Ss(t.slice(i,r),!0),n=Ss(t.slice(r));this.renderValueWithoutRenderer(`${a}${o}${n}`)}else s=!1}s||this.renderValueWithoutRenderer(t)}updateSelected(e){const t=this.getGui();uC(t.parentElement,e),this.addOrRemoveCssClass("ag-rich-select-row-selected",e)}getValue(){return this.value}toggleHighlighted(e){this.addOrRemoveCssClass("ag-rich-select-row-highlighted",e)}populateWithoutRenderer(e,t){const s=dC(this.beans),i=this.getGui(),r=s.createElement("span");r.style.overflow="hidden",r.style.textOverflow="ellipsis";const a=Ss(It(t)?t:e,!0);this.parsedValue=It(a)?a:null,i.appendChild(r),this.renderValueWithoutRenderer(a),this.shouldDisplayTooltip=pC(()=>r),this.tooltipFeature?.setTooltipAndRefresh(this.parsedValue)}renderValueWithoutRenderer(e){const t=this.getGui().querySelector("span");t&&(t.innerHTML=It(e)?e:" ")}populateWithRenderer(e,t){let s,i;if(this.params.cellRenderer){const r=this.getParentComponent()?.getParentComponent();i=hC(this.userCompFactory,this.params,lC(this.gos,{value:e,valueFormatted:t,getValue:()=>r?.getValue(),setValue:a=>{r?.setValue(a,!0)},setTooltip:(a,o)=>{this.gos.assertModuleRegistered("Tooltip",3),this.shouldDisplayTooltip=o,this.tooltipFeature?.setTooltipAndRefresh(a)}}))}return i&&(s=i.newAgStackInstance()),s&&cC(s,this.getGui()),s?(s.then(r=>{this.addDestroyFunc(()=>{this.destroyBean(r)})}),!0):!1}},ao="ag-rich-select-list",oo="ag-rich-select-row",mC=class extends lt{constructor(e,t,s){super({cssIdentifier:"rich-select"}),this.params=e,this.richSelectWrapper=t,this.getSearchString=s,this.lastRowHovered=-1,this.selectedItems=new Set,this.params=e,this.setComponentCreator(this.createRowComponent.bind(this)),this.setComponentUpdater(()=>{})}postConstruct(){super.postConstruct(),this.createLoadingElement();const{cellRowHeight:e,pickerAriaLabelKey:t,pickerAriaLabelValue:s}=this.params;e&&this.setRowHeight(e);const i=this.getGui(),r=this.getAriaElement();this.addManagedListeners(i,{mousemove:this.onMouseMove.bind(this),mouseout:this.onMouseOut.bind(this),mousedown:this.onMouseDown.bind(this),click:this.onClick.bind(this)}),i.classList.add(ao);const a=`${ao}-${this.getCompId()}`;r.setAttribute("id",a);const n=this.getLocaleTextFunc()(t,s);oC(r,n),aC(this.richSelectWrapper,r)}navigateToPage(e){const t=super.navigateToPage(e,this.lastRowHovered);return t!=null&&ro(this.beans,()=>{if(!this.isAlive())return null;this.highlightIndex(t)}),t}drawVirtualRows(e){super.drawVirtualRows(e),this.refreshSelectedItems()}highlightFilterMatch(e){this.forEachRenderedRow(t=>{t.highlightString(e)})}onNavigationKeyDown(e,t){ro(this.beans,()=>{if(!this.currentList||!this.isAlive())return;const s=this.currentList.length,i=this.lastRowHovered,r=e===sC.DOWN?1:-1,a=Math.min(Math.max(i===-1?0:i+r,0),s-1);this.highlightIndex(a),t()})}selectValue(e){if(!this.currentList)return this.eLoading&&this.appendChild(this.eLoading),!1;if(this.eLoading?.offsetParent&&this.eLoading.parentElement?.removeChild(this.eLoading),e==null)return!1;const t=this.getIndicesForValues(e),s=t.length>0;return s&&(this.refresh(),this.ensureIndexVisible(t[0]),this.refresh(!0)),this.selectListItems(Array.isArray(e)?e:[e]),s}selectListItems(e,t=!1){t||this.selectedItems.clear();for(let s=0;se.length,getRow:t=>e[t],areRowsEqual:(t,s)=>t===s})}getSelectedItems(){return this.selectedItems}getLastItemHovered(){return this.currentList[this.lastRowHovered]}highlightIndex(e,t){this.currentList&&(e<0||e>=this.currentList.length?this.lastRowHovered=-1:(this.lastRowHovered=e,this.ensureIndexVisible(e,!t)&&!t&&this.refresh(!0)),this.forEachRenderedRow((s,i)=>{const r=e===i;if(s.toggleHighlighted(r),r){const a=`${oo}-${s.getCompId()}`;rC(this.richSelectWrapper,a),this.richSelectWrapper.setAttribute("data-active-option",a)}}))}getIndicesForValues(e){const{currentList:t}=this;if(!t||t.length===0||e==null)return[];if(Array.isArray(e)||(e=[e]),e.length===0)return[];const{valueFormatter:s}=this.params,i=[],r=typeof e[0]=="object",a=t.map(s);for(const o of e){let n=-1;r?n=a.indexOf(s(o)):n=t.indexOf(o),n>=0&&i.push(n)}return i}toggleListItemSelection(e){this.selectedItems.has(e)?this.selectedItems.delete(e):this.selectedItems.add(e),this.refreshSelectedItems(),this.dispatchValueSelected()}refreshSelectedItems(){this.forEachRenderedRow(e=>{const t=this.selectedItems.has(e.getValue());e.updateSelected(t)})}createLoadingElement(){const e=iC(this.beans),t=this.getLocaleTextFunc(),s=e.createElement("div");s.classList.add("ag-loading-text"),s.innerText=t("loadingOoo","Loading..."),this.eLoading=s}createRowComponent(e,t){const s=new gC(this.params);t.setAttribute("id",`${oo}-${s.getCompId()}`),s.setParentComponent(this),this.createBean(s),s.setState(e);const{highlightMatch:i,searchType:r="fuzzy"}=this.params;return i&&r!=="fuzzy"&&s.highlightString(this.getSearchString()),s}getRowForMouseEvent(e){const s=this.getGui().getBoundingClientRect(),i=this.getScrollTop(),r=e.clientY-s.top+i;return Math.floor(r/this.getRowHeight())}onMouseMove(e){const t=this.getRowForMouseEvent(e);t!==-1&&t!=this.lastRowHovered&&(this.lastRowHovered=t,this.highlightIndex(t,!0))}onMouseDown(e){e.preventDefault()}onMouseOut(e){this.getGui().contains(e.relatedTarget)||this.highlightIndex(-1)}onClick(e){const{multiSelect:t}=this.params;if(!this.currentList)return;const s=this.getRowForMouseEvent(e),i=this.currentList[s];t?this.toggleListItemSelection(i):(this.selectListItems([i]),this.dispatchValueSelected())}dispatchValueSelected(){this.dispatchLocalEvent({type:"richSelectListRowSelected",fromEnterKey:!1,value:this.selectedItems})}destroy(){super.destroy(),this.eLoading=void 0}},Li=class extends If{constructor(e){super({pickerAriaLabelKey:"ariaLabelRichSelectField",pickerAriaLabelValue:"Rich Select Field",pickerType:"ag-list",className:"ag-rich-select",pickerIcon:"richSelectOpen",ariaRole:"combobox",template:e?.template??` `,agComponents:[Ef],modalPicker:!1,...e,maxPickerHeight:e?.maxPickerHeight??"calc(var(--ag-row-height) * 6.5)"}),this.searchString="",this.searchStringCreator=null,this.eInput=eo,this.eDeselect=eo,this.skipWrapperAnnouncement=!1;const{value:t,valueList:s,searchStringCreator:i}=e||{};t!==void 0&&(this.value=t),i&&(this.searchStringCreator=i),s!=null&&this.setValues(s),this.registerCSS(tC)}wireBeans(e){this.userCompFactory=e.userCompFactory,this.ariaAnnounce=e.ariaAnnounce,this.registry=e.registry}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui(),shouldDisplayTooltip:()=>this.shouldDisplayTooltip?.()??!0})),super.postConstruct(),this.createListComponent(),this.eDeselect.appendChild(kf("richSelectRemove",this.beans));const{allowTyping:e,placeholder:t,suppressDeselectAll:s}=this.config;this.eDeselect.classList.add("ag-hidden"),e?(this.eInput.setAutoComplete(!1).setInputPlaceholder(t),this.eDisplayField.classList.add("ag-hidden")):this.eInput.setDisplayed(!1),this.setupAriaProperties();const{searchDebounceDelay:i=300}=this.config;this.clearSearchString=Gf(this,this.clearSearchString.bind(this),i),this.renderSelectedValue(),e&&this.eInput.onValueChange(r=>this.searchTextFromString(r)),this.addManagedElementListeners(this.eWrapper,{focus:this.onWrapperFocus.bind(this)}),this.addManagedElementListeners(this.eWrapper,{focusout:this.onWrapperFocusOut.bind(this)}),s||this.addManagedElementListeners(this.eDeselect,{mousedown:this.onDeselectAllMouseDown.bind(this),click:this.onDeselectAllClick.bind(this)})}setupAriaProperties(){const{eWrapper:e,gos:t}=this;e.tabIndex=t.get("tabIndex");const s=this.getLocaleTextFunc();this.ariaDeleteSelection=s("ariaLabelRichSelectDeleteSelection","Press DELETE to deselect item"),this.ariaDeselectAllItems=s("ariaLabelRichSelectDeselectAllItems","Press DELETE to deselect all items"),this.ariaToggleSelection=s("ariaLabelRichSelectToggleSelection","Press SPACE to toggle selection")}createListComponent(){this.listComponent=this.createBean(new mC(this.config,this.eWrapper,()=>this.searchString)),this.listComponent.setParentComponent(this),this.addManagedListeners(this.listComponent,{richSelectListRowSelected:e=>{this.onListValueSelected(e.value,e.fromEnterKey)}})}renderSelectedValue(){const{value:e,eDisplayField:t,config:s,gos:i}=this,{allowTyping:r,cellRenderer:a,initialInputValue:o,multiSelect:n,suppressDeselectAll:l,suppressMultiSelectPillRenderer:c}=s,d=s.valueFormatter?.(e)??String(e);if(r){this.eInput.setValue(o??d);return}if(n&&!l){const p=e==null||Array.isArray(e)&&e.length===0;this.eDeselect.classList.toggle("ag-hidden",p)}let h;if(n&&!c){this.createOrUpdatePillContainer(t);return}a&&(h=_f(this.userCompFactory,s,Df(this.gos,{value:e,valueFormatted:d,getValue:()=>this.getValue(),setValue:p=>{this.setValue(p,!0)},setTooltip:(p,g)=>{i.assertModuleRegistered("Tooltip",3),this.shouldDisplayTooltip=g,this.tooltipFeature?.setTooltipAndRefresh(p)}})));let u;if(h&&(u=h.newAgStackInstance()),u)Di(t),Lf(u,t),u.then(p=>{this.addDestroyFunc(()=>this.destroyBean(p))});else{if(to(this.value))t.innerText=d,t.classList.remove("ag-display-as-placeholder");else{const{placeholder:p}=s;to(p)?(t.innerHTML=`${Of(p)}`,t.classList.add("ag-display-as-placeholder")):Di(t)}this.shouldDisplayTooltip=Uf(()=>this.eDisplayField),this.tooltipFeature?.setTooltipAndRefresh(d??null)}}createPickerComponent(){const{values:e}=this;return e&&this.setValueList({valueList:e}),this.listComponent}setSearchStringCreator(e){this.searchStringCreator=e}setValueList(e){const{valueList:t,refresh:s}=e;!this.listComponent||this.listComponent.getCurrentList()===t||(this.listComponent.setCurrentList(t),s&&(this.values?this.listComponent.refresh(!0):(this.setValues(t),this.isPickerDisplayed&&(this.listComponent.selectValue(this.value)||this.listComponent.refresh())),this.alignPickerToComponent()))}setValues(e){this.values=e,this.searchStrings=this.getSearchStringsFromValues(e)}showPicker(){super.showPicker();const{listComponent:e,value:t}=this;if(!e)return;let s=null;e.selectValue(this.value),this.value!=null&&(s=e.getIndicesForValues(Array.isArray(t)?t:[t])[0]),s!=null?e.highlightIndex(s):e.refresh(),this.displayOrHidePicker()}beforeHidePicker(){super.beforeHidePicker()}createOrUpdatePillContainer(e){if(!this.pillContainer){const t=this.pillContainer=this.createBean(new eC);this.addDestroyFunc(()=>{this.destroyBean(this.pillContainer),this.pillContainer=null}),Di(e),e.appendChild(t.getGui());const{config:s,eWrapper:i,ariaDeleteSelection:r}=this,{valueFormatter:a}=s;t.init({eWrapper:i,valueFormatter:a,onPillMouseDown:o=>{o.stopImmediatePropagation()},announceItemFocus:()=>{this.announceAriaValue(r)},getValue:()=>this.getValue(),setValue:o=>this.setValue(o,!0)})}this.doWhileBlockingAnnouncement(()=>this.pillContainer?.refresh())}doWhileBlockingAnnouncement(e){this.skipWrapperAnnouncement=!0,e(),this.skipWrapperAnnouncement=!1}onWrapperFocus(){const{eInput:e,config:t}=this,{allowTyping:s,multiSelect:i,suppressDeselectAll:r}=t;if(s){const a=e.getFocusableElement();a.focus(),a.select()}else i&&!r&&!this.skipWrapperAnnouncement&&this.announceAriaValue(this.ariaDeselectAllItems)}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}onDeselectAllMouseDown(e){e.stopImmediatePropagation()}onDeselectAllClick(){this.setValue([],!0)}buildSearchStringFromKeyboardEvent(e){let{key:t}=e;if(t===$.BACKSPACE)this.searchString=this.searchString.slice(0,-1),t="";else if(!Vf(e))return;e.preventDefault(),this.searchTextFromCharacter(t)}searchTextFromCharacter(e){this.searchString+=e,this.runSearch(),this.clearSearchString()}searchTextFromString(e){e==null&&(e=""),this.searchString=e,this.runSearch()}getSearchStringsFromValues(e){const{config:t}=this,{valueFormatter:s=i=>String(i)}=t;return typeof e[0]=="object"&&this.searchStringCreator?this.searchStringCreator(e):e.map(i=>s(i))}filterListModel(e){const{filterList:t}=this.config;t&&this.setValueList({valueList:e,refresh:!0})}runSearch(){if(!this.listComponent)return;const{values:e}=this,t=this.searchStrings;if(!t){this.listComponent.highlightIndex(-1);return}const{suggestions:s,filteredValues:i}=this.getSuggestionsAndFilteredValues(this.searchString,t),{filterList:r,highlightMatch:a,searchType:o="fuzzy"}=this.config,n=!!(r&&this.searchString!=="");this.filterListModel(n?i:e),this.highlightEmptyValue()||this.highlightListValue(s,i,n),a&&o!=="fuzzy"&&this.listComponent?.highlightFilterMatch(this.searchString),this.displayOrHidePicker()}highlightEmptyValue(){if(this.searchString===""){const e=this.searchStrings?.indexOf("");if(e!==void 0&&e!==-1)return this.listComponent?.highlightIndex(e),!0}return!1}highlightListValue(e,t,s){if(e.length){const i=s?0:this.searchStrings?.indexOf(e[0]);i!==void 0&&this.listComponent?.highlightIndex(i)}else if(this.listComponent?.highlightIndex(-1),!s||t.length)this.listComponent?.ensureIndexVisible(0);else if(s){this.getAriaElement().removeAttribute("data-active-option");const i=this.listComponent?.getAriaElement();i&&zf(i,null)}}getSuggestionsAndFilteredValues(e,t){let s=[];const i=[];if(!e.length)return{suggestions:s,filteredValues:i};const{searchType:r="fuzzy",filterList:a}=this.config;if(r==="fuzzy"){const o=Nf({inputValue:e,allSuggestions:t,hideIrrelevant:!0,addSequentialWeight:!0});s=o.values;const n=o.indices;if(a&&n.length)for(let l=0;l{const l=o.toLocaleLowerCase(),c=this.searchString.toLocaleLowerCase(),d=r==="match"?l.startsWith(c):l.indexOf(c)!==-1;return a&&d&&i.push(this.values[n]),d});return{suggestions:s,filteredValues:i}}displayOrHidePicker(){if(!this.listComponent)return;const e=this.listComponent.getGui(),t=this.listComponent.getCurrentList(),s=t?t.length===0:!1;e.classList.toggle("ag-hidden",s)}clearSearchString(){this.searchString=""}setValue(e,t,s,i){if(this.value===e)return this;const r=Array.isArray(e);if(e!=null){if(!r){const a=this.listComponent?.getCurrentList();if((a?a.indexOf(e):-1)===-1)return this}s||this.listComponent?.selectValue(e)}return super.setValue(e,t),i||this.renderSelectedValue(),this}onNavigationKeyDown(e,t,s){e.preventDefault();const i=t===$.DOWN;if(!this.isPickerDisplayed&&i){this.showPicker();return}this.listComponent?.onNavigationKeyDown(t,s)}onEnterKeyDown(e){if(this.isPickerDisplayed&&(e.preventDefault(),this.listComponent?.getCurrentList())){const t=this.listComponent.getLastItemHovered();this.config.multiSelect||t==null?this.dispatchPickerEventAndHidePicker(this.value,!0):this.onListValueSelected(new Set([t]),!0)}}onDeleteKeyDown(e){const{eWrapper:t,beans:s}=this;Bf(s)===t&&(e.preventDefault(),this.setValue([],!0))}onTabKeyDown(){const{config:e,isPickerDisplayed:t,listComponent:s}=this,{multiSelect:i}=e;if(!(!t||!s)){if(i){const r=this.getValueFromSet(s.getSelectedItems());r&&this.setValue(r,!1,!0,!0)}else this.setValue(s.getLastItemHovered(),!1,!0);this.hidePicker()}}getValueFromSet(e){const{multiSelect:t}=this.config;let s=null;for(const i of e){if(e.size===1&&!t){s=i;break}s||(s=[]),s.push(i)}return Array.isArray(s)&&s.sort(),s}onListValueSelected(e,t){const s=this.getValueFromSet(e);this.setValue(s,!1,!0),this.config.multiSelect||this.dispatchPickerEventAndHidePicker(s,t)}dispatchPickerEventAndHidePicker(e,t){const s={type:"fieldPickerValueSelected",fromEnterKey:t,value:e};this.dispatchLocalEvent(s),this.hidePicker()}getFocusableElement(){const{allowTyping:e}=this.config;return e?this.eInput.getFocusableElement():super.getFocusableElement()}onKeyDown(e){const{key:t}=e,{isPickerDisplayed:s,config:i,listComponent:r,pickerComponent:a}=this,{allowTyping:o,multiSelect:n,suppressDeselectAll:l}=i;switch(t){case $.LEFT:case $.RIGHT:(!o||this.pillContainer)&&(e.preventDefault(),this.pillContainer&&(this.listComponent?.highlightIndex(-1),this.pillContainer.onNavigationKeyDown(e)));break;case $.PAGE_HOME:case $.PAGE_END:if(o){e.preventDefault();const c=this.eInput.getInputElement(),d=t===$.PAGE_HOME?0:c.value.length;c.setSelectionRange(d,d);break}case $.PAGE_UP:case $.PAGE_DOWN:e.preventDefault(),a&&r?.navigateToPage(t);break;case $.DOWN:case $.UP:this.onNavigationKeyDown(e,t,()=>{n&&(this.doWhileBlockingAnnouncement(()=>this.eWrapper.focus()),this.announceAriaValue(this.ariaToggleSelection))});break;case $.ESCAPE:s&&(Hf(this.listComponent.getGui())&&(e.preventDefault(),Kf(e)),this.hidePicker());break;case $.ENTER:this.onEnterKeyDown(e);break;case $.SPACE:if(s&&n&&r){e.preventDefault();const c=r.getLastItemHovered();c&&r.toggleListItemSelection(c)}break;case $.TAB:this.onTabKeyDown();break;case $.DELETE:n&&!l&&this.onDeleteKeyDown(e);break;default:o||this.buildSearchStringFromKeyboardEvent(e)}}announceAriaValue(e){this.ariaAnnounce?.announceValue(e,"richSelect")}destroy(){this.listComponent&&(this.listComponent=this.destroyBean(this.listComponent)),this.searchStrings=void 0,super.destroy()}},no=class extends Li{constructor(e){super({...e,template:` `,agComponents:[Mf]}),this.params=e}showPicker(){setTimeout(()=>super.showPicker())}hidePicker(){setTimeout(()=>super.hidePicker())}postConstruct(){super.postConstruct();const{wrapperClassName:e,ariaLabel:t}=this.params;Af(this.eDisplayField,!1),e&&this.eWrapper.classList.add(e),Ff(this.eWrapper,""),Pf(this.eWrapper,t)}onEnterKeyDown(e){Rf(e),this.isPickerDisplayed?super.onEnterKeyDown(e):(e.preventDefault(),this.showPicker())}};import{BeanStub as fC,KeyCode as Dt,_getActiveDomElement as lo,_isStopPropagationForAgGrid as co,_stopPropagationForAgGrid as bs}from"ag-grid-community";var ho=class extends fC{constructor(e,t,s){super(),this.eGui=e,this.focusWrapper=t,this.eFocusableComp=s}postConstruct(){this.addManagedElementListeners(this.eGui,{keydown:t=>{switch(t.key){case Dt.TAB:t.defaultPrevented||bs(t);break;case Dt.UP:case Dt.DOWN:bs(t);break;case Dt.ESCAPE:if(co(t))return;this.eGui.contains(lo(this.beans))&&(t.preventDefault(),bs(t),this.focusWrapper.focus());break}}});const e="ag-advanced-filter-builder-virtual-list-item-highlight";this.addManagedListeners(this.focusWrapper,{keydown:t=>{switch(t.key){case Dt.ENTER:if(co(t))return;lo(this.beans)===this.focusWrapper&&(t.preventDefault(),bs(t),this.eFocusableComp.getFocusableElement().focus());break}},focusin:()=>{this.focusWrapper.classList.add(e)},focusout:t=>{this.focusWrapper.contains(t.relatedTarget)||this.focusWrapper.classList.remove(e)}})}};function uo(e,t){return{pickerAriaLabelKey:"ariaLabelAdvancedFilterBuilderAddField",pickerAriaLabelValue:"Advanced Filter Builder Add Field",pickerType:"ag-list",valueList:[{key:"condition",displayValue:e("advancedFilterBuilderAddCondition")},{key:"join",displayValue:e("advancedFilterBuilderAddJoin")}],valueFormatter:s=>s==null?"":s.displayValue??s.key,pickerIcon:"advancedFilterBuilderAdd",maxPickerWidth:`${t??120}px`,wrapperClassName:"ag-advanced-filter-builder-item-button",ariaLabel:e("advancedFilterBuilderAddButtonTooltip")}}var CC=class extends bf{constructor(e,t){super(` `),this.item=e,this.focusWrapper=t,this.eItem=wf}wireBeans(e){this.advFilterExpSvc=e.advFilterExpSvc,this.registry=e.registry}postConstruct(){Tf(this.focusWrapper,2);const e=uo(s=>this.advFilterExpSvc.translate(s),this.gos.get("advancedFilterBuilderParams")?.addSelectWidth),t=this.createManagedBean(new no(e));this.addManagedListeners(t,{fieldPickerValueSelected:({value:s})=>{this.dispatchLocalEvent({type:"advancedFilterBuilderAdded",item:this.item,isJoin:s.key==="join"})}}),this.eItem.appendChild(t.getGui()),this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>t.getGui(),getLocation:()=>"advancedFilter",getTooltipValue:()=>this.advFilterExpSvc.translate("advancedFilterBuilderAddButtonTooltip")})),this.createManagedBean(new ho(this.getGui(),this.focusWrapper,t)),xf(this.focusWrapper,this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderItem",[this.advFilterExpSvc.translate("advancedFilterBuilderAddButtonTooltip"),`${this.item.level+1}`]))}afterAdd(){}};import{DragSourceType as vC,KeyCode as ki,RefPlaceholder as De,TabGuardComp as yC,_createIconNoSpan as Lt,_removeAriaExpanded as SC,_setAriaDisabled as po,_setAriaExpanded as go,_setAriaLabel as ws,_setAriaLevel as bC,_setDisplayed as xs,_setVisible as wC,_stopPropagationForAgGrid as Gi}from"ag-grid-community";import{Component as xC,_exists as kt,_removeFromParent as TC,_toStringOrNull as MC}from"ag-grid-community";var PC=class extends xC{constructor(){super(` `),this.validationMessage=null}wireBeans(e){this.advFilterExpSvc=e.advFilterExpSvc}init(e){const{item:t,createPill:s}=e;this.item=t,this.createPill=s,this.filterModel=t.filterModel,this.setupColumnCondition(this.filterModel),this.validate(),this.addDestroyFunc(()=>this.destroyBeans([this.eColumnPill,this.eOperatorPill,this.eOperandPill]))}getDragName(){return this.filterModel.colId?this.advFilterExpSvc.parseColumnFilterModel(this.filterModel):this.getDefaultColumnDisplayValue()}getAriaLabel(){return`${this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderFilterItem")} ${this.getDragName()}`}getValidationMessage(){return this.validationMessage}getFocusableElement(){return this.eColumnPill.getFocusableElement()}setupColumnCondition(e){const t=this.advFilterExpSvc.getColumnDetails(e.colId);this.baseCellDataType=t.baseCellDataType,this.column=t.column,this.numOperands=this.getNumOperands(this.getOperatorKey()),this.eColumnPill=this.createPill({key:this.getColumnKey(),displayValue:this.getColumnDisplayValue()??this.getDefaultColumnDisplayValue(),cssClass:"ag-advanced-filter-builder-column-pill",isSelect:!0,getEditorParams:()=>({values:this.advFilterExpSvc.getColumnAutocompleteEntries()}),update:s=>this.setColumnKey(s),pickerAriaLabelKey:"ariaLabelAdvancedFilterBuilderColumnSelectField",pickerAriaLabelValue:"Advanced Filter Builder Column Select Field",ariaLabel:this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderColumn")}),this.getGui().appendChild(this.eColumnPill.getGui()),kt(this.getColumnKey())&&(this.createOperatorPill(),this.hasOperand()&&this.createOperandPill())}createOperatorPill(){this.eOperatorPill=this.createPill({key:this.getOperatorKey(),displayValue:this.getOperatorDisplayValue()??this.getDefaultOptionSelectValue(),cssClass:"ag-advanced-filter-builder-option-pill",isSelect:!0,getEditorParams:()=>({values:this.getOperatorAutocompleteEntries()}),update:e=>this.setOperatorKey(e),pickerAriaLabelKey:"ariaLabelAdvancedFilterBuilderOptionSelectField",pickerAriaLabelValue:"Advanced Filter Builder Option Select Field",ariaLabel:this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderOption")}),this.eColumnPill.getGui().insertAdjacentElement("afterend",this.eOperatorPill.getGui())}createOperandPill(){const{filter:e}=this.filterModel,t=(typeof e=="number"?MC(e):e)??"";this.eOperandPill=this.createPill({key:t,valueFormatter:s=>this.advFilterExpSvc.getOperandDisplayValue({...this.filterModel,filter:s},!0),baseCellDataType:this.baseCellDataType,cssClass:"ag-advanced-filter-builder-value-pill",isSelect:!1,update:s=>this.setOperand(s),ariaLabel:this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderValue")}),this.getGui().appendChild(this.eOperandPill.getGui())}getColumnKey(){return this.filterModel.colId}getColumnDisplayValue(){return this.advFilterExpSvc.getColumnDisplayValue(this.filterModel)}getOperatorKey(){return this.filterModel.type}getOperatorDisplayValue(){return this.advFilterExpSvc.getOperatorDisplayValue(this.filterModel)}getOperandDisplayValue(){return this.advFilterExpSvc.getOperandDisplayValue(this.filterModel,!0)}hasOperand(){return this.numOperands>0}getOperatorAutocompleteEntries(){return this.column?this.advFilterExpSvc.getOperatorAutocompleteEntries(this.column,this.baseCellDataType):[]}setColumnKey(e){this.eOperatorPill||this.createOperatorPill();const t=this.advFilterExpSvc.getColumnDetails(e);this.column=t.column;const s=t.baseCellDataType;this.baseCellDataType!==s&&(this.baseCellDataType=s,this.setOperatorKey(void 0),this.eOperatorPill&&(TC(this.eOperatorPill.getGui()),this.destroyBean(this.eOperatorPill),this.createOperatorPill()),this.validate()),this.filterModel.colId=e,this.filterModel.filterType=this.baseCellDataType}setOperatorKey(e){const t=this.getNumOperands(e);t!==this.numOperands&&(this.numOperands=t,t===0?this.destroyOperandPill():(this.createOperandPill(),this.baseCellDataType!=="number"&&this.setOperand(""))),this.filterModel.type=e,this.validate()}setOperand(e){let t=e;this.baseCellDataType==="number"&&(t=kt(e)?Number(e):""),this.filterModel.filter=t,this.validate()}getNumOperands(e){return this.advFilterExpSvc.getExpressionOperator(this.baseCellDataType,e)?.numOperands??0}destroyOperandPill(){delete this.filterModel.filter,this.getGui().removeChild(this.eOperandPill.getGui()),this.destroyBean(this.eOperandPill),this.eOperandPill=void 0}validate(){let e=null;kt(this.getColumnKey())?kt(this.getOperatorKey())?this.numOperands>0&&!kt(this.getOperandDisplayValue())&&(e=this.advFilterExpSvc.translate("advancedFilterBuilderValidationEnterValue")):e=this.advFilterExpSvc.translate("advancedFilterBuilderValidationSelectOption"):e=this.advFilterExpSvc.translate("advancedFilterBuilderValidationSelectColumn"),this.item.valid=!e,e!==this.validationMessage&&(this.validationMessage=e,this.dispatchLocalEvent({type:"advancedFilterBuilderValidChanged"}))}getDefaultColumnDisplayValue(){return this.advFilterExpSvc.translate("advancedFilterBuilderSelectColumn")}getDefaultOptionSelectValue(){return this.advFilterExpSvc.translate("advancedFilterBuilderSelectOption")}};import{AgInputDateField as FC,AgInputNumberField as AC,AgInputTextField as RC,Component as EC,KeyCode as Oi,RefPlaceholder as mo,_exists as IC,_setAriaDescribedBy as DC,_setAriaLabel as LC,_setDisplayed as fo,_stopPropagationForAgGrid as Ni}from"ag-grid-community";var kC=class extends EC{constructor(e){super(` `),this.params=e,this.ePill=mo,this.eLabel=mo;const{value:t,valueFormatter:s}=e;this.value=t,this.displayValue=s(t)}wireBeans(e){this.advFilterExpSvc=e.advFilterExpSvc}postConstruct(){const{cssClass:e,ariaLabel:t}=this.params;this.ePill.classList.add(e),this.activateTabIndex([this.ePill]),this.eLabel.id=`${this.getCompId()}`,DC(this.ePill,this.eLabel.id),LC(this.ePill,t),this.renderValue(),this.addManagedListeners(this.ePill,{click:s=>{s.preventDefault(),this.showEditor()},keydown:s=>{switch(s.key){case Oi.ENTER:s.preventDefault(),Ni(s),this.showEditor();break}}}),this.addDestroyFunc(()=>this.destroyBean(this.eEditor))}getFocusableElement(){return this.ePill}showEditor(){if(this.eEditor)return;fo(this.ePill,!1),this.eEditor=this.createEditorComp(this.params.type),this.eEditor.setValue(this.value);const e=this.eEditor.getGui();this.eEditor.addManagedElementListeners(e,{keydown:t=>{switch(t.key){case Oi.ENTER:t.preventDefault(),Ni(t),this.updateValue(!0);break;case Oi.ESCAPE:t.preventDefault(),Ni(t),this.hideEditor(!0);break}},focusout:()=>this.updateValue(!1)}),this.getGui().appendChild(e),this.eEditor.getFocusableElement().focus()}createEditorComp(e){let t;switch(e){case"text":t=new RC;break;case"number":t=new AC;break;case"date":t=new FC;break}return this.createBean(t)}hideEditor(e){const{eEditor:t}=this;t&&(this.eEditor=void 0,this.getGui().removeChild(t.getGui()),this.destroyBean(t),fo(this.ePill,!0),e&&this.ePill.focus())}renderValue(){let e;const{displayValue:t,eLabel:s}=this,{classList:i}=s;i.remove("ag-advanced-filter-builder-value-empty","ag-advanced-filter-builder-value-number","ag-advanced-filter-builder-value-text"),IC(t)?this.params.type==="number"?(e=t,i.add("ag-advanced-filter-builder-value-number")):(e=`"${t}"`,i.add("ag-advanced-filter-builder-value-text")):(e=this.advFilterExpSvc.translate("advancedFilterBuilderEnterValue"),i.add("ag-advanced-filter-builder-value-empty")),s.innerText=e}updateValue(e){if(!this.eEditor)return;const t=this.eEditor.getValue()??"";this.dispatchLocalEvent({type:"fieldValueChanged",value:t}),this.value=t,this.displayValue=this.params.valueFormatter(t),this.renderValue(),this.hideEditor(e)}};import{Component as GC}from"ag-grid-community";var OC=class extends GC{wireBeans(e){this.advFilterExpSvc=e.advFilterExpSvc}constructor(){super(` `)}init(e){const{item:t,createPill:s}=e,i=t.filterModel;this.filterModel=i,this.ePill=s({key:i.type,displayValue:this.advFilterExpSvc.parseJoinOperator(i),cssClass:"ag-advanced-filter-builder-join-pill",isSelect:!0,getEditorParams:()=>({values:this.advFilterExpSvc.getJoinOperatorAutocompleteEntries()}),update:r=>i.type=r,pickerAriaLabelKey:"ariaLabelAdvancedFilterBuilderJoinSelectField",pickerAriaLabelValue:"Advanced Filter Builder Join Operator Select Field",ariaLabel:this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderJoinOperator")}),this.getGui().appendChild(this.ePill.getGui()),this.addDestroyFunc(()=>this.destroyBean(this.ePill))}getDragName(){return this.advFilterExpSvc.parseJoinOperator(this.filterModel)}getAriaLabel(){return`${this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderGroupItem")} ${this.getDragName()}`}getValidationMessage(){return null}getFocusableElement(){return this.ePill.getFocusableElement()}};import{AgInputTextFieldSelector as NC,_setAriaLabel as BC,_setAriaLabelledBy as _C,_stopPropagationForAgGrid as VC}from"ag-grid-community";var HC=class extends Li{constructor(e){super({...e,template:` `,agComponents:[NC]}),this.params=e}getFocusableElement(){return this.eWrapper}showPicker(){setTimeout(()=>super.showPicker())}hidePicker(){setTimeout(()=>super.hidePicker())}postConstruct(){super.postConstruct();const{wrapperClassName:e,ariaLabel:t}=this.params;this.eWrapper.classList.add(e),_C(this.eWrapper,""),BC(this.eWrapper,t)}createPickerComponent(){if(!this.values){const{values:e}=this.params.getEditorParams();this.values=e;const t=this.value.key,s=e.find(i=>i.key===t)??{key:t,displayValue:this.value.displayValue};this.value=s}return super.createPickerComponent()}onEnterKeyDown(e){VC(e),this.isPickerDisplayed?super.onEnterKeyDown(e):(e.preventDefault(),this.showPicker())}},Bi=class extends yC{constructor(e,t,s){super(` `),this.item=e,this.dragFeature=t,this.focusWrapper=s,this.eTreeLines=De,this.eDragHandle=De,this.eButtons=De,this.eValidation=De,this.eMoveUpButton=De,this.eMoveDownButton=De,this.eAddButton=De,this.eRemoveButton=De,this.moveUpDisabled=!1,this.moveDownDisabled=!1}wireBeans(e){this.dragAndDrop=e.dragAndDrop,this.advFilterExpSvc=e.advFilterExpSvc,this.registry=e.registry}postConstruct(){const{filterModel:e,level:t,showMove:s}=this.item,i=e.filterType==="join";if(this.ePillWrapper=this.createManagedBean(i?new OC:new PC),this.ePillWrapper.init({item:this.item,createPill:r=>this.createPill(r)}),this.eDragHandle.insertAdjacentElement("afterend",this.ePillWrapper.getGui()),t===0){const r=document.createElement("div");r.classList.add("ag-advanced-filter-builder-item-tree-line-vertical-bottom"),r.classList.add("ag-advanced-filter-builder-item-tree-line-root"),this.eTreeLines.appendChild(r),xs(this.eDragHandle,!1),xs(this.eButtons,!1),go(this.focusWrapper,!0)}else this.setupTreeLines(t),this.eDragHandle.appendChild(Lt("advancedFilterBuilderDrag",this.beans)),this.setupValidation(),this.setupMoveButtons(s),this.setupAddButton(),this.setupRemoveButton(),this.setupDragging(),this.updateAriaExpanded();bC(this.focusWrapper,t+1),this.initialiseTabGuard({}),this.createManagedBean(new ho(this.getGui(),this.focusWrapper,this.ePillWrapper)),this.updateAriaLabel(),this.addManagedListeners(this.ePillWrapper,{advancedFilterBuilderValueChanged:()=>this.dispatchLocalEvent({type:"advancedFilterBuilderValueChanged"}),advancedFilterBuilderValidChanged:()=>this.updateValidity()})}setState(e){const{level:t}=this.item;if(t===0)return;const{showMove:s}=this.item,{disableMoveUp:i,disableMoveDown:r,treeLines:a,showStartTreeLine:o}=e;this.updateTreeLines(a,o),this.updateAriaExpanded(),s&&(this.moveUpDisabled=!!i,this.moveDownDisabled=!!r,this.eMoveUpButton.classList.toggle("ag-advanced-filter-builder-item-button-disabled",i),this.eMoveDownButton.classList.toggle("ag-advanced-filter-builder-item-button-disabled",r),po(this.eMoveUpButton,!!i),po(this.eMoveDownButton,!!r),this.moveUpTooltipFeature?.refreshTooltip(),this.moveDownTooltipFeature?.refreshTooltip())}focusMoveButton(e){(e?this.eMoveUpButton:this.eMoveDownButton).focus()}afterAdd(){this.ePillWrapper.getFocusableElement().focus()}setupTreeLines(e){for(let t=0;tthis.eValidation,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.ePillWrapper.getValidationMessage(),getTooltipShowDelayOverride:()=>1e3})),this.updateValidity()}setupAddButton(){const e=uo(s=>this.advFilterExpSvc.translate(s),this.gos.get("advancedFilterBuilderParams")?.addSelectWidth),t=this.createManagedBean(new no(e));this.addManagedListeners(t,{fieldPickerValueSelected:({value:s})=>this.dispatchLocalEvent({type:"advancedFilterBuilderAdded",item:this.item,isJoin:s.key==="join"})}),this.eAddButton.appendChild(t.getGui()),this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.eAddButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.advFilterExpSvc.translate("advancedFilterBuilderAddButtonTooltip")}))}setupRemoveButton(){this.eRemoveButton.appendChild(Lt("advancedFilterBuilderRemove",this.beans)),this.addManagedListeners(this.eRemoveButton,{click:()=>this.removeItem(),keydown:e=>{switch(e.key){case ki.ENTER:e.preventDefault(),Gi(e),this.removeItem();break}}}),this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.eRemoveButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.advFilterExpSvc.translate("advancedFilterBuilderRemoveButtonTooltip")})),ws(this.eRemoveButton,this.advFilterExpSvc.translate("advancedFilterBuilderRemoveButtonTooltip")),this.activateTabIndex([this.eRemoveButton])}setupMoveButtons(e){e?(this.eMoveUpButton.appendChild(Lt("advancedFilterBuilderMoveUp",this.beans)),this.addManagedListeners(this.eMoveUpButton,{click:()=>this.moveItem(!0),keydown:t=>{switch(t.key){case ki.ENTER:t.preventDefault(),Gi(t),this.moveItem(!0);break}}}),this.moveUpTooltipFeature=this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.eMoveUpButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.moveUpDisabled?null:this.advFilterExpSvc.translate("advancedFilterBuilderMoveUpButtonTooltip")})),ws(this.eMoveUpButton,this.advFilterExpSvc.translate("advancedFilterBuilderMoveUpButtonTooltip")),this.eMoveDownButton.appendChild(Lt("advancedFilterBuilderMoveDown",this.beans)),this.addManagedListeners(this.eMoveDownButton,{click:()=>this.moveItem(!1),keydown:t=>{switch(t.key){case ki.ENTER:t.preventDefault(),Gi(t),this.moveItem(!1);break}}}),this.moveDownTooltipFeature=this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.eMoveDownButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.moveDownDisabled?null:this.advFilterExpSvc.translate("advancedFilterBuilderMoveDownButtonTooltip")})),ws(this.eMoveDownButton,this.advFilterExpSvc.translate("advancedFilterBuilderMoveDownButtonTooltip")),this.activateTabIndex([this.eMoveUpButton,this.eMoveDownButton])):(xs(this.eMoveUpButton,!1),xs(this.eMoveDownButton,!1))}updateValidity(){wC(this.eValidation,!this.item.valid),this.validationTooltipFeature?.refreshTooltip(),this.updateAriaLabel()}createPill(e){const{key:t,cssClass:s,update:i,ariaLabel:r}=e,a=o=>{o!=null&&(i(o),this.dispatchLocalEvent({type:"advancedFilterBuilderValueChanged"}))};if(e.isSelect){const{getEditorParams:o,pickerAriaLabelKey:n,pickerAriaLabelValue:l,displayValue:c}=e,d=this.gos.get("advancedFilterBuilderParams"),h=`${d?.pillSelectMinWidth??140}px`,u=`${d?.pillSelectMaxWidth??200}px`,p=this.createBean(new HC({pickerAriaLabelKey:n,pickerAriaLabelValue:l,pickerType:"ag-list",value:{key:t,displayValue:c},valueFormatter:g=>g==null?"":g.displayValue??g.key,variableWidth:!0,minPickerWidth:h,maxPickerWidth:u,getEditorParams:o,wrapperClassName:s,ariaLabel:r,pickerIcon:"advancedFilterBuilderSelectOpen"}));return this.addManagedListeners(p,{fieldPickerValueSelected:({value:g})=>a(g?.key)}),p}else{const{baseCellDataType:o,valueFormatter:n}=e,l=this.createBean(new kC({value:t,valueFormatter:n,cssClass:s,type:this.getInputType(o),ariaLabel:r}));return this.addManagedListeners(l,{fieldValueChanged:({value:c})=>a(c)}),l}}getInputType(e){switch(e){case"text":case"object":case"boolean":return"text";case"number":return"number";case"date":case"dateString":return"date"}}setupDragging(){const e={type:vC.AdvancedFilterBuilder,eElement:this.eDragHandle,dragItemName:()=>this.ePillWrapper.getDragName(),getDefaultIconName:()=>"notAllowed",getDragItem:()=>({}),onDragStarted:()=>this.dragFeature.dispatchLocalEvent({type:"advancedFilterBuilderDragStarted",item:this.item}),onDragStopped:()=>this.dragFeature.dispatchLocalEvent({type:"advancedFilterBuilderDragEnded"})};this.dragAndDrop.addDragSource(e,!0),this.addDestroyFunc(()=>this.dragAndDrop.removeDragSource(e))}updateAriaLabel(){const e=this.ePillWrapper.getAriaLabel(),t=`${this.item.level+1}`,s=this.ePillWrapper.getValidationMessage();let i;s?i=this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderItemValidation",[e,t,s]):i=this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderItem",[e,t]),ws(this.focusWrapper,i)}updateAriaExpanded(){SC(this.focusWrapper);const{filterModel:e}=this.item;e?.filterType==="join"&&e.conditions.length&&go(this.focusWrapper,!0)}removeItem(){this.dispatchLocalEvent({type:"advancedFilterBuilderRemoved",item:this.item})}moveItem(e){this.dispatchLocalEvent({type:"advancedFilterBuilderMoved",item:this.item,backwards:e})}},zC=class extends pf{constructor(){super(` `),this.eList=Ei,this.eApplyFilterButton=Ei,this.eCancelFilterButton=Ei,this.validationMessage=null}wireBeans(e){this.filterManager=e.filterManager,this.advancedFilter=e.advancedFilter,this.advFilterExpSvc=e.advFilterExpSvc,this.registry=e.registry}postConstruct(){const{showMoveButtons:e}=this.gos.get("advancedFilterBuilderParams")??{};this.showMove=!!e,this.addManagedPropertyListener("advancedFilterBuilderParams",({currentValue:t})=>{this.showMove=!!t?.showMoveButtons,this.refreshList(!1)}),this.filterModel=this.setupFilterModel(),this.setupVirtualList(),this.dragFeature=this.createManagedBean(new Sf(this,this.virtualList)),this.setupButtons()}refresh(){const e=this.virtualList;let t=e.getLastFocusedRow();this.setupFilterModel(),this.validateItems(),this.refreshList(!1),t!=null&&(e.getComponentAt(t)||(t=0),e.focusRow(t))}getNumItems(){return this.items.length}moveItem(e,t){!t||!e||this.moveItemToIndex(e,t.rowIndex,t.position)}afterGuiAttached(){this.virtualList.awaitStable(()=>this.virtualList.focusRow(0))}setupVirtualList(){const e=this.virtualList=this.createManagedBean(new lt({cssIdentifier:"advanced-filter-builder",ariaRole:"tree",listName:this.advFilterExpSvc.translate("ariaAdvancedFilterBuilderList")}));e.setComponentCreator(this.createItemComponent.bind(this)),e.setComponentUpdater(this.updateItemComponent.bind(this)),e.setRowHeight(40),this.eList.appendChild(e.getGui()),e.setModel({getRowCount:()=>this.items.length,getRow:t=>this.items[t],areRowsEqual:(t,s)=>t===s}),this.buildList(),e.refresh()}setupButtons(){this.eApplyFilterButton.innerText=this.advFilterExpSvc.translate("advancedFilterBuilderApply"),this.activateTabIndex([this.eApplyFilterButton]),this.addManagedElementListeners(this.eApplyFilterButton,{click:()=>{this.advancedFilter.setModel(this.filterModel),this.filterManager?.onFilterChanged({source:"advancedFilter"}),this.close()}}),this.validationTooltipFeature=this.createOptionalManagedBean(this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.eApplyFilterButton,getLocation:()=>"advancedFilter",getTooltipValue:()=>this.validationMessage,getTooltipShowDelayOverride:()=>1e3})),this.validate();const e=t=>this.addOrRemoveCssClass("ag-advanced-filter-builder-validation",t);this.addManagedListeners(this.eApplyFilterButton,{mouseenter:()=>e(!0),mouseleave:()=>e(!1)}),this.eCancelFilterButton.innerText=this.advFilterExpSvc.translate("advancedFilterBuilderCancel"),this.activateTabIndex([this.eCancelFilterButton]),this.addManagedElementListeners(this.eCancelFilterButton,{click:()=>this.close()})}removeItemFromParent(e){const t=e.parent.conditions.indexOf(e.filterModel);return e.parent.conditions.splice(t,1),t}moveItemToIndex(e,t,s){const i=this.items[t],r=i.filterModel?.filterType==="join"&&s==="bottom",a=r?i.filterModel:i.parent;if(!a||this.isChildOrSelf(a,e.filterModel)||i===e)return;this.removeItemFromParent(e);let o;r?o=0:(o=a.conditions.indexOf(i.filterModel),o===-1?o=a.conditions.length:s==="bottom"&&(o+=1)),a.conditions.splice(o,0,e.filterModel),this.refreshList(!1)}isChildOrSelf(e,t){return e===t||t.filterType==="join"&&t.conditions.some(s=>this.isChildOrSelf(e,s))}setupFilterModel(){const e=this.formatFilterModel(this.advancedFilter.getModel());return this.stringifiedModel=JSON.stringify(e),e}formatFilterModel(e){return e=e??{filterType:"join",type:"AND",conditions:[]},e.filterType!=="join"&&(e={filterType:"join",type:"AND",conditions:[e]}),e}buildList(){const e=(t,s,i,r)=>{s.push({filterModel:t,level:i,parent:r,valid:!0,showMove:this.showMove}),t.filterType==="join"&&(t.conditions.forEach(a=>e(a,s,i+1,t)),i===0&&s.push({filterModel:null,level:i+1,parent:t,valid:!0}))};this.items=[],e(this.filterModel,this.items,0)}refreshList(e){if(!e){const t=[];this.items.forEach(s=>{s.valid||t.push(s.filterModel)}),this.buildList(),t.length&&this.items.forEach(s=>{s.filterModel&&t.includes(s.filterModel)&&(s.valid=!1)})}this.virtualList.refresh(e),this.validate()}updateItemComponent(e,t){const s=this.items.indexOf(e),i=(n,l)=>{const d=this.items.find(h=>h.filterModel===n)?.parent;if(d){const{conditions:h}=d;i(d,l),l.push(h[h.length-1]===n)}},r=[],{filterModel:a}=e;a&&(i(a,r),r[0]=!1);const o=a?.filterType==="join"&&!!a.conditions.length;t.setState({disableMoveUp:s===1,disableMoveDown:!this.canMoveDown(e,s),treeLines:r,showStartTreeLine:o})}createItemComponent(e,t){const s=this.createBean(e.filterModel?new Bi(e,this.dragFeature,t):new CC(e,t));return s.addManagedListeners(s,{advancedFilterBuilderRemoved:({item:i})=>this.removeItem(i),advancedFilterBuilderValueChanged:()=>this.validate(),advancedFilterBuilderAdded:({item:i,isJoin:r})=>this.addItem(i,r),advancedFilterBuilderMoved:({item:i,backwards:r})=>this.moveItemUpDown(i,r)}),s instanceof Bi&&this.updateItemComponent(e,s),s}addItem(e,t){const{parent:s,level:i,filterModel:r}=e,a=r?.filterType==="join",o=t?{filterType:"join",type:"AND",conditions:[]}:{},n=a?r:s;let l=a?0:n.conditions.indexOf(r);l>=0?(a||(l+=1),n.conditions.splice(l,0,o)):n.conditions.push(o);let c=this.items.indexOf(e);const d=c>=0;if(d){e.filterModel&&c++;const h=[{filterModel:o,level:a?i+1:i,parent:n,valid:t,showMove:this.showMove}];this.items.splice(c,0,...h)}this.refreshList(d),d&&this.virtualList.getComponentAt(c)?.afterAdd()}removeItem(e){const t=e.parent,{filterModel:s}=e,i=t.conditions.indexOf(s);t.conditions.splice(i,1);const r=e.filterModel?.filterType==="join",a=this.items.indexOf(e),o=!r&&a>=0;o&&this.items.splice(a,1),this.refreshList(o),a>=0&&this.virtualList.focusRow(a)}moveItemUpDown(e,t){const s=this.items.indexOf(e),i=t?s-1:s+1;if(i===0||!t&&!this.canMoveDown(e,s))return;const r=this.items[i],a=this.removeItemFromParent(e),{level:o,filterModel:n,parent:l}=e,{level:c,filterModel:d,parent:h}=r;if(t)if(c===o&&d.filterType==="join")d.conditions.push(n);else if(c<=o){const p=h.conditions.indexOf(d);h.conditions.splice(p,0,n)}else l.conditions[a-1].conditions.push(n);else if(c===o)if(d.filterType==="join")d.conditions.splice(0,0,n);else{const p=h.conditions.indexOf(d);h.conditions.splice(p+1,0,n)}else if(am.filterModel===l),g=p.parent.conditions.indexOf(p.filterModel)+1;p.parent.conditions.splice(g,0,n)}this.refreshList(!1);const u=this.items.findIndex(({filterModel:p})=>p===n);if(u>=0){const p=this.virtualList.getComponentAt(u);p instanceof Bi&&p.focusMoveButton(t)}}canMoveDown(e,t){return!(e.level===1&&t===this.items.length-2||e.level===1&&e.parent.conditions[e.parent.conditions.length-1]===e.filterModel)}close(){this.advancedFilter.getCtrl().toggleFilterBuilder({source:"ui"})}validate(){let e=!this.items.every(({valid:t})=>t);e?this.validationMessage=this.advFilterExpSvc.translate("advancedFilterBuilderValidationIncomplete"):(e=JSON.stringify(this.filterModel)===this.stringifiedModel,e?this.validationMessage=this.advFilterExpSvc.translate("advancedFilterBuilderValidationAlreadyApplied"):this.validationMessage=null),mf(this.eApplyFilterButton,e),this.validationTooltipFeature?.refreshTooltip()}validateItems(){const e=s=>{s.type=void 0},t=s=>{delete s.filter};this.items.forEach(s=>{if(!s.valid||!s.filterModel||s.filterModel.filterType==="join")return;const{filterModel:i}=s,{colId:r}=i,a=this.advFilterExpSvc.getColumnAutocompleteEntries().find(({key:c})=>c===r),o=this.advFilterExpSvc.getColumnDetails(i.colId);if(!a||!o.column){s.valid=!1,i.colId=void 0,e(i),t(i);return}const l=this.advFilterExpSvc.getDataTypeExpressionOperator(o.baseCellDataType).operators[i.type];if(!l){s.valid=!1,e(i),t(i);return}if(l.numOperands>0&&!gf(i.filter)){s.valid=!1;return}})}},UC=class extends om{constructor(e){super(),this.enabled=e}wireBeans(e){this.ctrlsSvc=e.ctrlsSvc,this.popupSvc=e.popupSvc,this.advFilterExpSvc=e.advFilterExpSvc,this.environment=e.environment}postConstruct(){this.hasAdvancedFilterParent=!!this.gos.get("advancedFilterParent"),this.ctrlsSvc.whenReady(this,()=>this.setAdvancedFilterComp()),this.addManagedEventListeners({advancedFilterEnabledChanged:({enabled:e})=>this.onEnabledChanged(e)}),this.addManagedPropertyListener("advancedFilterParent",()=>this.updateComps()),this.addDestroyFunc(()=>{this.destroyAdvancedFilterComp(),this.destroyBean(this.eBuilderComp),this.eBuilderDialog&&this.eBuilderDialog.isAlive()&&this.destroyBean(this.eBuilderDialog)})}setupHeaderComp(e){this.eHeaderComp&&(this.eHeaderComp?.getGui().remove(),this.destroyBean(this.eHeaderComp)),this.eHeaderComp=this.createManagedBean(new uf(this.enabled&&!this.hasAdvancedFilterParent)),e.insertAdjacentElement("beforebegin",this.eHeaderComp.getGui())}focusHeaderComp(){return this.eHeaderComp?(this.eHeaderComp.getFocusableElement().focus(),!0):!1}refreshComp(){this.eFilterComp?.refresh(),this.eHeaderComp?.refresh()}refreshBuilderComp(){this.eBuilderComp?.refresh()}getHeaderHeight(){return this.eHeaderComp?.getHeight()??0}setInputDisabled(e){this.eFilterComp?.setInputDisabled(e),this.eHeaderComp?.setInputDisabled(e)}toggleFilterBuilder(e){const{source:t,force:s,eventSource:i}=e;if(s&&this.eBuilderDialog||s===!1&&!this.eBuilderDialog)return;if(this.eBuilderDialog){this.builderDestroySource=t,this.destroyBean(this.eBuilderDialog);return}this.setInputDisabled(!0);const{width:r,height:a,minWidth:o}=this.getBuilderDialogSize();this.eBuilderComp=this.createBean(new zC),this.eBuilderDialog=this.createBean(new At({title:this.advFilterExpSvc.translate("advancedFilterBuilderTitle"),component:this.eBuilderComp,width:r,height:a,resizable:!0,movable:!0,maximizable:!0,centered:!0,closable:!0,minWidth:o,afterGuiAttached:()=>this.eBuilderComp?.afterGuiAttached(),postProcessPopupParams:{type:"advancedFilterBuilder",eventSource:i}})),this.dispatchFilterBuilderVisibleChangedEvent(t,!0),this.eBuilderDialog.addEventListener("destroyed",()=>{this.destroyBean(this.eBuilderComp),this.eBuilderComp=void 0,this.eBuilderDialog=void 0,this.setInputDisabled(!1),this.dispatchLocalEvent({type:"advancedFilterBuilderClosed"}),this.dispatchFilterBuilderVisibleChangedEvent(this.builderDestroySource??"ui",!1),this.builderDestroySource=void 0})}dispatchFilterBuilderVisibleChangedEvent(e,t){this.eventSvc.dispatchEvent({type:"advancedFilterBuilderVisibleChanged",source:e,visible:t})}getBuilderDialogSize(){const e=this.gos.get("advancedFilterBuilderParams")?.minWidth??500,t=this.popupSvc.getPopupParent(),s=Math.round(lm(t))-2,i=Math.round(nm(t)*.75)-2,r=Math.min(Math.max(600,e),s),a=Math.min(600,i);return{width:r,height:a,minWidth:e}}onEnabledChanged(e){this.enabled=e,this.updateComps()}updateComps(){this.setAdvancedFilterComp(),this.setHeaderCompEnabled(),this.eventSvc.dispatchEvent({type:"headerHeightChanged"})}setAdvancedFilterComp(){if(this.destroyAdvancedFilterComp(),!this.enabled)return;const e=this.gos.get("advancedFilterParent");if(this.hasAdvancedFilterParent=!!e,e){const t=this.createBean(new Za),s=t.getGui();this.environment.applyThemeClasses(s),s.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr"),e.appendChild(s),this.eFilterComp=t}}setHeaderCompEnabled(){this.eHeaderComp?.setEnabled(this.enabled&&!this.hasAdvancedFilterParent)}destroyAdvancedFilterComp(){this.eFilterComp&&(cm(this.eFilterComp.getGui()),this.destroyBean(this.eFilterComp))}},KC=class{constructor(e){this.params=e,this.operators=[],this.operatorStartPositions=[],this.operatorEndPositions=[],this.activeOperator=0,this.validationError=null}parseExpression(e){this.operators.push(""),this.operatorStartPositions.push(e),this.operatorEndPositions.push(void 0);const{expression:t}=this.params;for(;er===this.parsedOperator)),this.params.advFilterExpSvc.generateAutocompleteListParams(i,"join",s)}updateExpression(e,t,s){let{expression:i}=this.params;const r=t.displayValue??t.key;if(s===0)for(let n=this.operatorEndPositions.length-1;n>0;n--){const l=this.operatorEndPositions[n];l!=null&&(i=Ie(i,this.operatorStartPositions[n],l,r).updatedValue)}const a=this.operatorStartPositions.length>s?this.operatorStartPositions[s]:e,o=(this.operatorEndPositions.length>s?this.operatorEndPositions[s]:void 0)??Ti(i,e,!0).endPosition;return Ie(i,a,o,r,!0)}getNumOperators(){return this.operators.length}getLastOperatorEndPosition(){return this.operatorEndPositions[this.operatorEndPositions.length-1]}parseOperator(e){const t=this.operators.length>this.activeOperator?this.operators[this.activeOperator]:"",s=this.params.advFilterExpSvc.getExpressionJoinOperators(),i=Cs(t,s,r=>r);if(i){this.operatorEndPositions[this.activeOperator]=e;const r=s[i];if(this.activeOperator){if(i!==this.parsedOperator)return this.validationError||(this.validationError={message:this.params.advFilterExpSvc.translate("advancedFilterValidationJoinOperatorMismatch"),startPosition:e-t.length+1,endPosition:e}),!1}else this.parsedOperator=i;return t!==r&&(Mi(this.params,t,r,e),this.operators[this.activeOperator]=r),!0}else return i===null?!1:(this.validationError||(this.validationError={message:this.params.advFilterExpSvc.translate("advancedFilterValidationInvalidJoinOperator"),startPosition:e-t.length+1,endPosition:e}),!0)}},WC=class Kd{constructor(t,s){this.params=t,this.startPosition=s,this.expectingExpression=!0,this.expectingOperator=!1,this.expressionParsers=[],this.operatorParser=new KC(this.params),this.missingEndBracket=!1,this.extraEndBracket=!1}parseExpression(){let t=this.startPosition;const{expression:s}=this.params;for(;t0&&(this.missingEndBracket=!0),t}isValid(){return!this.missingEndBracket&&!this.extraEndBracket&&this.expressionParsers.length===this.operatorParser.getNumOperators()+1&&this.operatorParser.isValid()&&this.expressionParsers.every(t=>t.isValid())}getValidationError(){const t=this.operatorParser.getValidationError();for(let i=0;i1,i=this.expressionParsers.map(r=>r.getFunctionString(t)).join(` ${this.operatorParser.getFunction()} `);return s?`(${i})`:i}getFunctionParsed(t){const s=this.operatorParser.getFunction(),i=this.expressionParsers.map(a=>a.getFunctionParsed(t)),r=s==="&&"?"every":"some";return(a,o,n)=>i[r](l=>l(a,o,n))}getAutocompleteListParams(t){if(this.endPosition!=null&&t>this.endPosition+1)return;if(!this.expressionParsers.length)return this.getColumnAutocompleteListParams();const s=this.getExpressionParserIndex(t);if(s==null)return this.params.expression[t]==="("?{enabled:!1}:this.getColumnAutocompleteListParams();const r=this.expressionParsers[s].getAutocompleteListParams(t);if(!r){if(sthis.endPosition+1?null:this.operatorParser.updateExpression(t,s,a))}getModel(){return this.expressionParsers.length>1?{filterType:"join",type:this.operatorParser.getModel(),conditions:this.expressionParsers.map(t=>t.getModel())}:this.expressionParsers[0].getModel()}getColumnAutocompleteListParams(){return this.params.advFilterExpSvc.generateAutocompleteListParams(this.params.advFilterExpSvc.getColumnAutocompleteEntries(),"column","")}getExpressionParserIndex(t){let s;for(let i=0;it);i++)s=i;return s}},jC=class{constructor(e){this.params=e,this.valid=!1}parseExpression(){this.joinExpressionParser=new WC(this.params,0);const e=this.joinExpressionParser.parseExpression();return this.valid=e>=this.params.expression.length-1&&this.joinExpressionParser.isValid(),this.params.expression}isValid(){return this.valid}getValidationMessage(){const e=this.joinExpressionParser.getValidationError();if(!e)return null;const{message:t,startPosition:s,endPosition:i}=e;return s{const s=this.colModel.getColDefCol(e);return s?this.filterValueSvc.getValue(s,t):void 0}},this.addManagedPropertyListener("enableAdvancedFilter",e=>this.setEnabled(!!e.currentValue)),this.addManagedEventListeners({newColumnsLoaded:e=>this.onNewColumnsLoaded(e)}),this.addManagedPropertyListener("includeHiddenColumnsInAdvancedFilter",()=>this.updateValidity())}isEnabled(){return this.enabled}isFilterPresent(){return!!this.expressionFunction}doesFilterPass(e){return this.expressionFunction(this.expressionProxy,e,this.expressionParams)}getModel(){const e=this.createExpressionParser(this.appliedExpression);return e?.parseExpression(),e?.getModel()??null}setModel(e){const t=(i,r)=>{if(i.filterType==="join"){const a=this.advFilterExpSvc.parseJoinOperator(i),o=i.conditions.map(n=>t(n)).filter(n=>sm(n)).join(` ${a} `);return r||i.conditions.length<=1?o:`(${o})`}else return this.advFilterExpSvc.parseColumnFilterModel(i)},s=e?t(e,!0):null;this.setExpressionDisplayValue(s),this.applyExpression(),this.ctrl.refreshComp(),this.ctrl.refreshBuilderComp()}getExpressionDisplayValue(){return this.expression}setExpressionDisplayValue(e){this.expression=e}isCurrentExpressionApplied(){return this.appliedExpression===this.expression}createExpressionParser(e){return e?new jC({expression:e,colModel:this.colModel,dataTypeSvc:this.dataTypeSvc,valueSvc:this.valueSvc,advFilterExpSvc:this.advFilterExpSvc}):null}getDefaultExpression(e){const t=this.advFilterExpSvc.getColumnValue(e)+" ";return{updatedValue:t,updatedPosition:t.length}}isHeaderActive(){return!this.gos.get("advancedFilterParent")}getCtrl(){return this.ctrl}setEnabled(e,t){const s=this.enabled,i=im(this.gos)||rm(this.gos);e&&!i&&am(123),this.enabled=e&&i,!t&&this.enabled!==s&&this.eventSvc.dispatchEvent({type:"advancedFilterEnabledChanged",enabled:this.enabled})}applyExpression(){const e=this.createExpressionParser(this.expression);e?.parseExpression(),this.applyExpressionFromParser(e)}applyExpressionFromParser(e){if(this.isValid=!e||e.isValid(),!e||!this.isValid){this.expressionFunction=null,this.expressionParams=null,this.appliedExpression=null;return}const{expressionFunction:t,params:s}=this.getFunction(e);this.expressionFunction=t,this.expressionParams=s,this.appliedExpression=this.expression}getFunction(e){if(this.gos.get("suppressAdvancedFilterEval"))return e.getFunctionParsed();{const{functionString:t,params:s}=e.getFunctionString();return{expressionFunction:new Function("expressionProxy","node","params",t),params:s}}}updateValidity(){this.advFilterExpSvc.resetColumnCaches();const e=this.createExpressionParser(this.expression);e?.parseExpression();const s=(!e||e.isValid())!==this.isValid;return this.applyExpressionFromParser(e),this.ctrl.refreshComp(),this.ctrl.refreshBuilderComp(),s}onNewColumnsLoaded(e){if(e.source!=="gridInitializing"||!this.dataTypeSvc?.isPendingInference)return;this.ctrl.setInputDisabled(!0);const[t]=this.addManagedEventListeners({dataTypesInferred:()=>{t?.(),this.ctrl.setInputDisabled(!1)}})}},Co={moduleName:"AdvancedFilter",version:R,beans:[$C,em],icons:{advancedFilterBuilder:"group",advancedFilterBuilderDrag:"grip",advancedFilterBuilderInvalid:"not-allowed",advancedFilterBuilderMoveUp:"up",advancedFilterBuilderMoveDown:"down",advancedFilterBuilderAdd:"plus",advancedFilterBuilderRemove:"minus",advancedFilterBuilderSelectOpen:"small-down",richSelectRemove:"cancel"},apiFunctions:{getAdvancedFilterModel:Vg,setAdvancedFilterModel:Hg,showAdvancedFilterBuilder:zg,hideAdvancedFilterBuilder:Ug},dependsOn:[G,Gg,Bg,Ng,Og],css:[_g]};import{_ColumnMoveModule as YC,_PopupModule as XC,_SharedDragAndDropModule as qC}from"ag-grid-community";import{_HorizontalResizeModule as ZC}from"ag-grid-community";import{_unwrapUserComp as JC}from"ag-grid-community";function QC(e){return e.sideBar?.comp.isDisplayed()??!1}function ev(e,t){e.sideBar?.comp.setDisplayed(t)}function tv(e,t){e.sideBar?.comp.setSideBarPosition(t)}function sv(e,t){e.sideBar?.comp.openToolPanel(t,"api")}function iv(e){e.sideBar?.comp.close("api")}function rv(e){return e.sideBar?.comp.openedItem()??null}function av(e){e.sideBar?.comp.refresh()}function ov(e){return e.sideBar?.comp.isToolPanelShowing()??!1}function nv(e,t){const s=e.sideBar?.comp.getToolPanelInstance(t);return JC(s)}function lv(e){return e.sideBar?.comp.getDef()}import{BeanStub as cv}from"ag-grid-community";import{Component as dv,KeyCode as Ts,ManagedFocusFeature as hv,RefPlaceholder as uv,_addFocusableContainerListener as pv,_addGridCommonParams as vo,_findNextFocusableElement as gv,_focusInto as mv,_focusNextGridCoreContainer as yo,_getActiveDomElement as So,_removeFromParent as bo,_setAriaControls as fv,_warn as _i}from"ag-grid-community";import{TabGuardClassNames as Cv,_FOCUS_MANAGED_CLASS as vv,_findFocusableElements as yv}from"ag-grid-community";function Vi(e,t){if(!t)return null;const s=yv(e),i=s.indexOf(t);if(i===-1)return null;let r=-1;for(let a=i-1;a>=0;a--)if(s[a].classList.contains(Cv.TAB_GUARD_TOP)){r=a;break}return r<=0?null:s[r-1]}function wo(e,t){if(!t)return!1;const s=e.querySelectorAll(`.${vv}`);if(!s.length)return!1;for(let i=0;i
`}setLabel(){const e=this.getLocaleTextFunc(),t=this.toolPanelDef,s=e(t.labelKey,t.labelDefault);this.eLabel.innerText=s}setIcon(){this.eIconWrapper.insertAdjacentElement("afterbegin",Fv(this.toolPanelDef.iconKey,this.beans))}onButtonPressed(){this.dispatchLocalEvent({type:"toggleButtonClicked"})}setSelected(e){this.addOrRemoveCssClass("ag-selected",e),Av(this.eToggleButton,e)}},Ev=class extends bv{constructor(){super('
'),this.buttonComps=[]}postConstruct(){this.addManagedElementListeners(this.getFocusableElement(),{keydown:this.handleKeyDown.bind(this)})}handleKeyDown(e){if(!(e.key!==wv.TAB||!e.shiftKey)){if(Tv(this.beans,!0)){e.preventDefault();return}Mv(e)}}setActiveButton(e){this.buttonComps.forEach(t=>{t.setSelected(e===t.getToolPanelId())})}addButtonComp(e){const t=this.createBean(new Rv(e));return this.buttonComps.push(t),this.appendChild(t),t.addEventListener("toggleButtonClicked",()=>{this.dispatchLocalEvent({type:"sideBarButtonClicked",toolPanelId:e.id})}),t}clearButtons(){this.buttonComps=this.destroyBeans(this.buttonComps),xv(this.getGui()),super.destroy()}destroy(){this.clearButtons(),super.destroy()}},Iv={selector:"AG-SIDE-BAR-BUTTONS",component:Ev};import{_warn as xo}from"ag-grid-community";var To={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columnsToolPanel",toolPanel:"agColumnsToolPanel"},Mo={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filtersToolPanel",toolPanel:"agFiltersToolPanel"},Ms={columns:To,filters:Mo};function zi(e){if(!e)return;if(e===!0)return{toolPanels:[To,Mo],defaultToolPanel:"columns"};if(typeof e=="string")return zi([e]);if(Array.isArray(e)){const s=[];return e.forEach(i=>{const r=Ms[i];if(!r){xo(215,{key:i,defaultByKey:Ms});return}s.push(r)}),s.length===0?void 0:{toolPanels:s,defaultToolPanel:s[0].id}}return{toolPanels:Dv(e.toolPanels),defaultToolPanel:e.defaultToolPanel,hiddenByDefault:e.hiddenByDefault,position:e.position}}function Dv(e){const t=[];return e&&e.forEach(s=>{let i=null;if(typeof s=="string"){const r=Ms[s];if(!r){xo(215,{key:s,defaultByKey:Ms});return}i=r}else i=s;t.push(i)}),t}import{Component as Lv}from"ag-grid-community";import{Component as kv}from"ag-grid-community";var Gv=class extends kv{constructor(){super('
'),this.minWidth=100,this.maxWidth=null}postConstruct(){const e=this.beans.horizontalResizeSvc.addResizeBar({eResizeBar:this.getGui(),dragStartPixels:1,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this),onResizeEnd:this.onResizeEnd.bind(this)});this.addDestroyFunc(e),this.inverted=this.gos.get("enableRtl")}dispatchResizeEvent(e,t,s){this.eventSvc.dispatchEvent({type:"toolPanelSizeChanged",width:s,started:e,ended:t})}onResizeStart(){this.startingWidth=this.elementToResize.offsetWidth,this.dispatchResizeEvent(!0,!1,this.startingWidth)}onResizeEnd(e){return this.onResizing(e,!0)}onResizing(e,t=!1){const s=this.inverted?-1:1;let i=Math.max(this.minWidth,Math.floor(this.startingWidth-e*s));this.maxWidth!=null&&(i=Math.min(this.maxWidth,i)),this.elementToResize.style.width=`${i}px`,this.dispatchResizeEvent(!1,t,i)}};function Ov(e,t,s){return e.getCompDetails(t,Nv,void 0,s,!0)}var Nv={name:"toolPanel",optionalMethods:["refresh","getState"]},Bv=class extends Lv{constructor(){super('
')}postConstruct(){const e=this.getGui(),t=this.resizeBar=this.createManagedBean(new Gv);e.setAttribute("id",`ag-${this.getCompId()}`),t.elementToResize=e,this.appendChild(t)}getToolPanelId(){return this.toolPanelId}setToolPanelDef(e,t){const{id:s,minWidth:i,maxWidth:r,width:a}=e;this.toolPanelId=s,this.width=a;const o=Ov(this.beans.userCompFactory,e,t);if(o==null)return!1;const n=o.newAgStackInstance();this.params=o.params,n.then(this.setToolPanelComponent.bind(this));const l=this.resizeBar;return i!=null&&(l.minWidth=i),r!=null&&(l.maxWidth=r),!0}setToolPanelComponent(e){this.toolPanelCompInstance=e,this.appendChild(e.getGui()),this.addDestroyFunc(()=>{this.destroyBean(e)});const t=this.width;t&&(this.getGui().style.width=`${t}px`)}getToolPanelInstance(){return this.toolPanelCompInstance}setResizerSizerSide(e){const t=this.gos.get("enableRtl"),s=e==="left",i=t?s:!s;this.resizeBar.inverted=i}refresh(){this.toolPanelCompInstance?.refresh(this.params)}},_v=class extends dv{constructor(){super(`
`,[Iv]),this.sideBarButtons=uv,this.toolPanelWrappers=[],this.registerCSS(Sv)}postConstruct(){this.sideBarButtons.addEventListener("sideBarButtonClicked",this.onToolPanelButtonClicked.bind(this));const{beans:e,gos:t}=this,{sideBar:s}=t.get("initialState")??{};this.setSideBarDef({sideBarDef:zi(t.get("sideBar")),sideBarState:s}),this.addManagedPropertyListener("sideBar",this.onSideBarUpdated.bind(this)),e.sideBar.comp=this;const i=this.getFocusableElement();this.createManagedBean(new hv(i,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)})),pv(e,this,i)}onTabKeyDown(e){if(e.defaultPrevented)return;const{beans:t,sideBarButtons:s}=this,i=this.getGui(),r=s.getGui(),a=So(t),o=i.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)"),n=e.target,l=e.shiftKey;if(!o)return yo(t,l)?(e.preventDefault(),!0):yo(t,l,!0);if(r.contains(a)){mv(o,l)&&e.preventDefault();return}if(!l)return;let c=null;o.contains(a)?c=gv(t,o,void 0,!0):wo(o,n)&&l&&(c=Vi(o,n)),c||(c=r.querySelector(".ag-selected button")),c&&c!==e.target&&(e.preventDefault(),c.focus())}handleKeyDown(e){const t=So(this.beans),s=this.sideBarButtons;if(!s.getGui().contains(t))return;const i=s.getGui(),r=Array.prototype.slice.call(i.querySelectorAll(".ag-side-button")),a=r.findIndex(l=>l.contains(t));let o=null;switch(e.key){case Ts.LEFT:case Ts.UP:o=Math.max(0,a-1);break;case Ts.RIGHT:case Ts.DOWN:o=Math.min(a+1,r.length-1);break}if(o===null)return;const n=r[o].querySelector("button");n&&(n.focus(),e.preventDefault())}onToolPanelButtonClicked(e){const t=e.toolPanelId;this.openedItem()===t?this.openToolPanel(void 0,"sideBarButtonClicked"):this.openToolPanel(t,"sideBarButtonClicked")}clearDownUi(){this.sideBarButtons.clearButtons(),this.destroyToolPanelWrappers()}setSideBarDef({sideBarDef:e,sideBarState:t,existingToolPanelWrappers:s}){if(this.setDisplayed(!1),this.sideBar=e,e&&e.toolPanels){const i=e.toolPanels;if(this.createToolPanelsAndSideButtons(i,t,s),!this.toolPanelWrappers.length)return;const r=t?t.visible:!e.hiddenByDefault;if(this.setDisplayed(r),this.setSideBarPosition(t?t.position:e.position),r)if(t){const{openToolPanel:a}=t;a&&this.openToolPanel(a,"sideBarInitializing")}else this.openToolPanel(e.defaultToolPanel,"sideBarInitializing")}}getDef(){return this.sideBar}setSideBarPosition(e){e||(e="right"),this.position=e;const t=e==="left",s=t?"right":"left";return this.addOrRemoveCssClass("ag-side-bar-left",t),this.addOrRemoveCssClass("ag-side-bar-right",!t),this.toolPanelWrappers.forEach(i=>{i.setResizerSizerSide(s)}),this.dispatchSideBarUpdated(),this}setDisplayed(e,t){super.setDisplayed(e,t),this.dispatchSideBarUpdated()}getState(){const e={};return this.toolPanelWrappers.forEach(t=>{e[t.getToolPanelId()]=t.getToolPanelInstance()?.getState?.()}),{visible:this.isDisplayed(),position:this.position,openToolPanel:this.openedItem(),toolPanels:e}}createToolPanelsAndSideButtons(e,t,s){for(const i of e)this.createToolPanelAndSideButton(i,t?.toolPanels?.[i.id],s?.[i.id])}validateDef(e){return e.id==null?(_i(212),!1):e.toolPanel==="agFiltersToolPanel"&&this.beans.filterManager?.isAdvFilterEnabled()?(_i(213),!1):!0}createToolPanelAndSideButton(e,t,s){if(!this.validateDef(e))return;let i;if(s)i=s;else if(i=this.createBean(new Bv),!i.setToolPanelDef(e,vo(this.gos,{initialState:t,onStateUpdated:()=>this.dispatchSideBarUpdated()})))return;i.setDisplayed(!1);const r=i.getGui();this.appendChild(r),this.toolPanelWrappers.push(i);const a=this.sideBarButtons.addButtonComp(e);fv(a.eToggleButton,r)}refresh(){this.toolPanelWrappers.forEach(e=>e.refresh())}openToolPanel(e,t="api"){const s=this.openedItem();if(s===e)return;this.toolPanelWrappers.forEach(a=>{const o=e===a.getToolPanelId();a.setDisplayed(o)});const i=this.openedItem();s!==i&&(this.sideBarButtons.setActiveButton(e),this.raiseToolPanelVisibleEvent(e,s??void 0,t))}getToolPanelInstance(e){const t=this.toolPanelWrappers.filter(s=>s.getToolPanelId()===e)[0];if(!t){_i(214,{key:e});return}return t.getToolPanelInstance()}raiseToolPanelVisibleEvent(e,t,s){const i=!!e&&!!t,r=this.eventSvc;t&&r.dispatchEvent({type:"toolPanelVisibleChanged",source:s,key:t,visible:!1,switchingToolPanel:i}),e&&r.dispatchEvent({type:"toolPanelVisibleChanged",source:s,key:e,visible:!0,switchingToolPanel:i})}close(e="api"){this.openToolPanel(void 0,e)}isToolPanelShowing(){return!!this.openedItem()}openedItem(){let e=null;return this.toolPanelWrappers.forEach(t=>{t.isDisplayed()&&(e=t.getToolPanelId())}),e}onSideBarUpdated(){const e=zi(this.gos.get("sideBar")),t={};e&&this.sideBar&&e.toolPanels?.forEach(s=>{const{id:i}=s;if(!i)return;const r=this.sideBar.toolPanels?.find(l=>l.id===i);if(!r||s.toolPanel!==r.toolPanel)return;const a=this.toolPanelWrappers.find(l=>l.getToolPanelId()===i);if(!a)return;const o=vo(this.gos,{...s.toolPanelParams??{},onStateUpdated:()=>this.dispatchSideBarUpdated()});a.getToolPanelInstance()?.refresh(o)===!0&&(this.toolPanelWrappers=this.toolPanelWrappers.filter(l=>l!==a),bo(a.getGui()),t[i]=a)}),this.clearDownUi(),this.setSideBarDef({sideBarDef:e,existingToolPanelWrappers:t})}dispatchSideBarUpdated(){this.eventSvc.dispatchEvent({type:"sideBarUpdated"})}destroyToolPanelWrappers(){this.toolPanelWrappers.forEach(e=>{bo(e.getGui()),this.destroyBean(e)}),this.toolPanelWrappers.length=0}destroy(){this.destroyToolPanelWrappers(),super.destroy()}},Vv={selector:"AG-SIDE-BAR",component:_v},Hv=class extends cv{constructor(){super(...arguments),this.beanName="sideBar"}getSelector(){return Vv}},Ps={moduleName:"SideBar",version:R,beans:[Hv],apiFunctions:{isSideBarVisible:QC,setSideBarVisible:ev,setSideBarPosition:tv,openToolPanel:sv,closeToolPanel:iv,getOpenedToolPanel:rv,refreshToolPanel:av,isToolPanelShowing:ov,getToolPanelInstance:nv,getSideBar:lv},dependsOn:[G,ZC]};import{Component as zv,_createIconNoSpan as Po,_isNodeOrElement as Uv,_loadTemplate as Fs,_setAriaChecked as Kv,_setAriaExpanded as Wv,_warn as jv}from"ag-grid-community";var Fo=class extends zv{constructor(){super(),this.setTemplate("
")}init(e){this.params=e,this.cssClassPrefix=this.params.cssClassPrefix??"ag-menu-option",this.addAriaAttributes(),this.addIcon(),this.addName(),this.addShortcut(),this.addSubMenu()}configureDefaults(){return!0}addAriaAttributes(){const{checked:e,subMenu:t}=this.params,s=this.getGui();e&&Kv(s,e),t&&Wv(s,!1)}addIcon(){if(this.params.isCompact)return;const e=Fs(``),{checked:t,icon:s}=this.params;t?e.appendChild(Po("check",this.beans)):s&&(Uv(s)?e.appendChild(s):typeof s=="string"?e.innerHTML=s:jv(227)),this.getGui().appendChild(e)}addName(){const e=Fs(`${this.params.name||""}`);this.getGui().appendChild(e)}addShortcut(){if(this.params.isCompact)return;const e=Fs(`${this.params.shortcut||""}`);this.getGui().appendChild(e)}addSubMenu(){const e=Fs(``),t=this.getGui();if(this.params.subMenu){const s=this.gos.get("enableRtl")?"subMenuOpenRtl":"subMenuOpen";e.appendChild(Po(s,this.beans))}t.appendChild(e)}getClassName(e){return`${this.cssClassPrefix}-${e}`}},$v='.ag-menu-list{cursor:default;display:table;padding:var(--ag-spacing) 0;width:100%}.ag-menu-option,.ag-menu-separator{display:table-row}.ag-menu-option-part,.ag-menu-separator-part{display:table-cell;vertical-align:middle}.ag-menu-option{cursor:pointer;font-weight:500}:where(.ag-ltr) :where(.ag-menu-option-popup-pointer) .ag-icon{text-align:right}:where(.ag-rtl) :where(.ag-menu-option-popup-pointer) .ag-icon{text-align:left}.ag-menu-option-text{white-space:nowrap}.ag-menu-option-custom{display:contents}.ag-compact-menu-option{display:flex;flex-wrap:nowrap;width:100%}.ag-compact-menu-option-text{flex:1 1 auto;white-space:nowrap}.ag-menu-separator{height:calc(var(--ag-spacing)*2 + 1px)}.ag-menu-separator-part:after{border-top:1px solid var(--ag-menu-separator-color);content:"";display:block}.ag-compact-menu-option-active,.ag-menu-option-active{background-color:var(--ag-row-hover-color)}.ag-compact-menu-option-part,.ag-menu-option-part{line-height:var(--ag-icon-size);padding:calc(var(--ag-spacing) + 2px) 0}.ag-compact-menu-option-disabled,.ag-menu-option-disabled{cursor:not-allowed;opacity:.5}.ag-compact-menu-option-icon,.ag-menu-option-icon{width:var(--ag-icon-size)}:where(.ag-ltr) .ag-compact-menu-option-icon,:where(.ag-ltr) .ag-menu-option-icon{padding-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-compact-menu-option-icon,:where(.ag-rtl) .ag-menu-option-icon{padding-right:calc(var(--ag-spacing)*2)}.ag-compact-menu-option-text,.ag-menu-option-text{padding-left:calc(var(--ag-spacing)*2);padding-right:calc(var(--ag-spacing)*2)}:where(.ag-ltr) .ag-compact-menu-option-shortcut,:where(.ag-ltr) .ag-menu-option-shortcut{padding-right:var(--ag-spacing)}:where(.ag-rtl) .ag-compact-menu-option-shortcut,:where(.ag-rtl) .ag-menu-option-shortcut{padding-left:var(--ag-spacing)}:where(.ag-ltr) .ag-compact-menu-option-popup-pointer,:where(.ag-ltr) .ag-menu-option-popup-pointer{padding-right:var(--ag-spacing)}:where(.ag-rtl) .ag-compact-menu-option-popup-pointer,:where(.ag-rtl) .ag-menu-option-popup-pointer{padding-left:var(--ag-spacing)}.ag-menu-column-select-wrapper{height:265px;overflow:auto;:where(.ag-column-select){height:100%}}.ag-menu:where(.ag-tabs){min-width:290px}.ag-context-menu-loading-icon{pointer-events:none;position:absolute}',As={moduleName:"MenuItem",version:R,userComponents:{agMenuItem:Fo},icons:{check:"tick",subMenuOpen:"small-right",subMenuOpenRtl:"small-left"},css:[$v]};import{Component as Yv,_addGridCommonParams as Xv,_clearElement as qv,_last as Zv}from"ag-grid-community";import{Component as Jv,PositionableFeature as Qv,RefPlaceholder as Ao}from"ag-grid-community";var ey=".ag-column-select{display:flex;flex:3 1 0px;flex-direction:column;overflow:hidden;position:relative}.ag-column-select-header{align-items:center;display:flex;flex:none;gap:var(--ag-widget-horizontal-spacing);height:var(--ag-header-height);padding-left:var(--ag-widget-container-horizontal-padding);padding-right:var(--ag-widget-container-horizontal-padding);position:relative}.ag-column-select-column,.ag-column-select-column-group{align-items:center;display:flex;gap:var(--ag-widget-horizontal-spacing);height:100%;position:relative;&:where(:not(:last-child)){margin-bottom:var(--ag-widget-vertical-spacing)}}:where(.ag-ltr) .ag-column-select-column,:where(.ag-ltr) .ag-column-select-column-group{padding-left:calc(var(--ag-indentation-level)*var(--ag-column-select-indent-size))}:where(.ag-rtl) .ag-column-select-column,:where(.ag-rtl) .ag-column-select-column-group{padding-right:calc(var(--ag-indentation-level)*var(--ag-column-select-indent-size))}.ag-column-select-header-icon{border-radius:var(--ag-border-radius);cursor:pointer;height:var(--ag-icon-size);position:relative;width:var(--ag-icon-size);&:focus-visible{box-shadow:var(--ag-focus-shadow)}}.ag-column-select-header-filter-wrapper{flex:1 1 auto}.ag-column-select-header-filter{width:100%}.ag-column-select-list{flex:1 1 0px;overflow:hidden}:where(.ag-ltr) .ag-column-select-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-spacing)*1.5)}:where(.ag-rtl) .ag-column-select-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-spacing)*1.5)}.ag-column-select-column-group-readonly,.ag-column-select-column-readonly{opacity:.5;pointer-events:none}.ag-column-select-virtual-list-viewport{padding:calc(var(--ag-widget-container-vertical-padding)*.5) 0}.ag-column-select-virtual-list-item{padding:0 var(--ag-widget-container-horizontal-padding)}.ag-column-select-column-label{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-column-select-checkbox{display:flex}";import{AgCheckboxSelector as ty,AgInputTextFieldSelector as sy,Component as iy,KeyCode as ry,RefPlaceholder as Ui,_createIconNoSpan as Ki,_debounce as ay,_setDisplayed as dt}from"ag-grid-community";var oy=300,ny=class extends iy{constructor(){super(``,[ty,sy]),this.eExpand=Ui,this.eSelect=Ui,this.eFilterTextField=Ui}postConstruct(){this.createExpandIcons(),this.addManagedListeners(this.eExpand,{click:this.onExpandClicked.bind(this),keydown:t=>{t.key===ry.SPACE&&(t.preventDefault(),this.onExpandClicked())}}),this.addManagedElementListeners(this.eSelect.getInputElement(),{click:this.onSelectClicked.bind(this)}),this.addManagedPropertyListener("functionsReadOnly",()=>this.onFunctionsReadOnlyPropChanged()),this.eFilterTextField.setAutoComplete(!1).onValueChange(()=>this.onFilterTextChanged()),this.addManagedEventListeners({newColumnsLoaded:this.showOrHideOptions.bind(this)});const e=this.getLocaleTextFunc();this.eSelect.setInputAriaLabel(e("ariaColumnSelectAll","Toggle All Columns Visibility")),this.eFilterTextField.setInputAriaLabel(e("ariaFilterColumnsInput","Filter Columns Input")),this.activateTabIndex([this.eExpand])}onFunctionsReadOnlyPropChanged(){const e=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(e),this.eSelect.addOrRemoveCssClass("ag-column-select-column-readonly",e)}init(e){this.params=e;const t=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(t),this.eSelect.addOrRemoveCssClass("ag-column-select-column-readonly",t),this.beans.colModel.ready&&this.showOrHideOptions()}createExpandIcons(){const e=this.beans;this.eExpand.appendChild(this.eExpandChecked=Ki("columnSelectOpen",e)),this.eExpand.appendChild(this.eExpandUnchecked=Ki("columnSelectClosed",e)),this.eExpand.appendChild(this.eExpandIndeterminate=Ki("columnSelectIndeterminate",e)),this.setExpandState(0)}showOrHideOptions(){const e=this.params,t=!e.suppressColumnFilter,s=!e.suppressColumnSelectAll,i=!e.suppressColumnExpandAll,r=!!this.beans.colModel.colDefCols?.treeDepth,a=this.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(a("searchOoo","Search...")),dt(this.eFilterTextField.getGui(),t),dt(this.eSelect.getGui(),s),dt(this.eExpand,i&&r)}onFilterTextChanged(){this.onFilterTextChangedDebounced||(this.onFilterTextChangedDebounced=ay(this,()=>{const e=this.eFilterTextField.getValue();this.dispatchLocalEvent({type:"filterChanged",filterText:e})},oy)),this.onFilterTextChangedDebounced()}onSelectClicked(){this.dispatchLocalEvent({type:this.selectState?"unselectAll":"selectAll"})}onExpandClicked(){this.dispatchLocalEvent({type:this.expandState===0?"collapseAll":"expandAll"})}setExpandState(e){this.expandState=e,dt(this.eExpandChecked,e===0),dt(this.eExpandUnchecked,e===1),dt(this.eExpandIndeterminate,e===2)}setSelectionState(e){this.selectState=e,this.eSelect.setValue(this.selectState)}},ly={selector:"AG-PRIMARY-COLS-HEADER",component:ny};import{Component as cy,_exists as Ro,_setAriaLabel as dy,_setAriaLevel as hy,_warn as uy,isProvidedColumnGroup as py}from"ag-grid-community";import{AgProvidedColumnGroup as gy,_warn as my,isProvidedColumnGroup as fy}from"ag-grid-community";import{_last as Cy}from"ag-grid-community";function ht(e){return!!e&&typeof e.children<"u"}function Le(e){return ht(e)?e.groupId:e.colId}function Eo(e,t,s){const i=(o,n)=>{const c=o.children.map(Le).includes(Le(n)),d=Cy(o.children),h=d&&Le(d)!==Le(n);return c&&h};if(!ht(e))return!0;const r=e,a=s;if(i(r,a)||r.groupId===t&&!r.children.map(Le).includes(Le(a)))return r.children.push(a),!0;for(let o=r.children.length-1;o>=0&&!Eo(r.children[o],t,s);o--);return!1}function vy(e){const t=(r,a)=>ht(r)&&ht(a)&&Le(r)===Le(a),s=(r,a)=>{if(!ht(a))return r;const o=r,n=a;return n.children&&n.groupId&&Eo(o,n.groupId,n.children[0])||n.children.forEach(l=>s(o,l)),o},i=[];for(let r=1;r<=e.length;r++){const a=e[r-1],o=e[r];t(a,o)?e[r]=s(a,o):i.push(a)}return i}function Io(e,t){const s=[],i=(a,o)=>{if(ht(a)){const n=a,l=typeof n.groupId<"u"?n.groupId:n.headerName,c=new gy(n,l,!1,o),d=[];return n.children.forEach(h=>{const u=i(h,o+1);u&&d.push(u)}),c.setChildren(d),c}else{const n=a,l=n.colId?n.colId:n.field,c=e.getColDefCol(l);return c||s.push(n),c}},r=[];return t.forEach(a=>{const o=i(a,0);o&&r.push(o)}),s.length>0&&my(217,{invalidColIds:s}),r}function Do(e,t){const s=yy(e),i=vy(s);t(i)}function yy(e){const t=(r,a)=>{let o;if(fy(r))if(r.isPadding())o=a;else{const l=Object.assign({},r.getColGroupDef());l.groupId=r.getGroupId(),l.children=[a],o=l}else{const l=Object.assign({},r.getColDef());l.colId=r.getColId(),o=l}const n=r.getOriginalParent();return n?t(n,o):o};return e.getCols().filter(r=>{const a=r.getColDef();return r.isPrimary()&&!a.showRowGroup}).map(r=>t(r,r.getColDef()))}import{LocalEventService as Sy}from"ag-grid-community";var Lo=class{constructor(e,t,s,i=!1,r){this.displayName=e,this.depth=s,this.group=i,this.localEventService=new Sy,i?(this.columnGroup=t,this._expanded=r,this.children=[]):this.column=t}get expanded(){return!!this._expanded}set expanded(e){e!==this._expanded&&(this._expanded=e,this.localEventService.dispatchEvent({type:"expandedChanged"}))}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}};import{_applyColumnState as Wi}from"ag-grid-community";function ko(e,t,s,i){const r=by(t);Go(e,r,s,i)}function Go(e,t,s,i){e.colModel.isPivotMode()?xy(e,t,s,i):wy(e,t,s,i)}function by(e){const t=[],s=i=>{i.forEach(r=>{r.passesFilter&&(r.group?s(r.children):t.push(r.column))})};return s(e),t}function wy(e,t,s,i){const r=[];t.forEach(a=>{a.getColDef().lockVisible||a.isVisible()!=s&&r.push({colId:a.getId(),hide:!s})}),r.length>0&&Wi(e,{state:r},i),e.selectionColSvc?.refreshVisibility(i)}function xy(e,t,s,i){Ty(e,t,s,i)}function Ty(e,t,s,i){const r=[],n=s?l=>{if(!l.isAnyFunctionActive())if(l.isAllowValue()){const c=typeof l.getAggFunc()=="string"?l.getAggFunc():e.aggFuncSvc?.getDefaultAggFunc(l);r.push({colId:l.getId(),aggFunc:c})}else l.isAllowRowGroup()?r.push({colId:l.getId(),rowGroup:!0}):l.isAllowPivot()&&r.push({colId:l.getId(),pivot:!0})}:l=>{(l.isPivotActive()||l.isRowGroupActive()||l.isValueActive())&&r.push({colId:l.getId(),pivot:!1,rowGroup:!1,aggFunc:null})};t.forEach(n),r.length>0&&Wi(e,{state:r},i)}function Oo(e,t){const{columns:s,visibleState:i,pivotState:r,eventType:a}=t,o=s.map(n=>{const l=n.getColId();if(e.colModel.isPivotMode()){const c=r?.[l];return{colId:l,pivot:c?.pivot,rowGroup:c?.rowGroup,aggFunc:c?.aggFunc}}else return{colId:l,hide:!i?.[l]}});Wi(e,{state:o},a)}function No(e){return{pivot:e.isPivotActive(),rowGroup:e.isRowGroupActive(),aggFunc:e.isValueActive()?e.getAggFunc():void 0}}import{BeanStub as My,DragSourceType as Py,isProvidedColumnGroup as Fy}from"ag-grid-community";import{AgCheckboxSelector as Ay,Component as Ry,DragSourceType as Ey,KeyCode as ji,RefPlaceholder as Gt,TouchListener as Iy,_createIcon as Bo,_createIconNoSpan as Dy,_getShouldDisplayTooltip as Ly,_getToolPanelClassesFromColDef as ky,_setAriaDescribedBy as Gy,_setAriaExpanded as Oy,_setAriaLabel as Ny,_setDisplayed as $i}from"ag-grid-community";import{Component as By,_createIconNoSpan as _o,_focusInto as _y,isColumn as Vy,isProvidedColumnGroup as Hy}from"ag-grid-community";function Rs(e,t,s,i){const r=t.getCol(s);e.groupData||(e.groupData={});const a=r.getColId(),o=e.groupData[a];o!==i&&(e.groupData[a]=i,e.dispatchCellChangedEvent(r,i,o))}function Vo(e,t,s){e.group!==s&&(e.group&&!s&&(e.expanded=!1),e.group=s,e.updateHasChildren(),t.selectionSvc?.updateRowSelectable(e),e.dispatchRowEvent("groupChanged"))}function Ot(e,t){const{gos:s,rowGroupColsSvc:i}=t;if(!i||!e)return!1;const r=s.get("groupLockGroupColumns");if(!e.isRowGroupActive()||r===0)return!1;if(r===-1)return!0;const a=i.columns.findIndex(o=>o.getColId()===e.getColId());return r>a}import{AgPromise as Yi,KeyCode as ge,TabGuardComp as zy,_last as Uy,_loadTemplate as Ky,_preserveRangesWhile as Wy,_stopPropagationForAgGrid as jy,_warn as $y}from"ag-grid-community";import{AgPromise as Yy,BeanStub as Xy,KeyCode as Ho,_addGridCommonParams as zo,_loadTemplate as qy,_preserveRangesWhile as Zy,_setAriaDisabled as Jy,_setAriaExpanded as Qy,_setAriaHasPopup as eS,_setAriaRole as tS}from"ag-grid-community";import{KeyCode as sS,TabGuardComp as iS}from"ag-grid-community";var rS=class extends iS{constructor(e){super(),this.setTemplateFromElement(e.getGui(),void 0,void 0,!0)}postConstruct(){this.initialiseTabGuard({onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)})}handleKeyDown(e){e.key===sS.ESCAPE&&this.closePanel()}onTabKeyDown(e){e.defaultPrevented||(this.closePanel(),e.preventDefault())}closePanel(){const e=this.parentComponent;e.closeSubMenu(),setTimeout(()=>e.getGui().focus(),0)}};function aS(e,t,s){return e.getCompDetails(t,oS,"agMenuItem",s,!0)}var oS={name:"menuItem",optionalMethods:["setActive","select","setExpanded","configureDefaults"]},Xi=class extends Xy{constructor(){super(...arguments),this.ACTIVATION_DELAY=80,this.isActive=!1,this.subMenuIsOpen=!1,this.subMenuIsOpening=!1,this.suppressRootStyles=!0,this.suppressAria=!0,this.suppressFocus=!0}wireBeans(e){this.popupSvc=e.popupSvc,this.userCompFactory=e.userCompFactory,this.registry=e.registry}init(e){const{menuItemDef:t,isAnotherSubMenuOpen:s,level:i,childComponent:r,contextParams:a}=e;return this.params=e.menuItemDef,this.level=i,this.isAnotherSubMenuOpen=s,this.childComponent=r,this.contextParams=a,this.cssClassPrefix=this.params.menuItemParams?.cssClassPrefix??"ag-menu-option",aS(this.userCompFactory,this.params,zo(this.gos,{...t,level:i,isAnotherSubMenuOpen:s,openSubMenu:n=>this.openSubMenu(n),closeSubMenu:()=>this.closeSubMenu(),closeMenu:n=>this.closeMenu(n),updateTooltip:(n,l)=>this.refreshTooltip(n,l),onItemActivated:()=>this.onItemActivated()}))?.newAgStackInstance().then(n=>{this.menuItemComp=n;const l=n.configureDefaults?.();l&&this.configureDefaults(l===!0?void 0:l)})??Yy.resolve()}addListeners(e,t){t?.suppressClick||this.addManagedElementListeners(e,{click:s=>this.onItemSelected(s)}),t?.suppressKeyboardSelect||this.addManagedElementListeners(e,{keydown:s=>{(s.key===Ho.ENTER||s.key===Ho.SPACE)&&(s.preventDefault(),this.onItemSelected(s))}}),t?.suppressMouseDown||this.addManagedElementListeners(e,{mousedown:s=>{s.stopPropagation(),s.preventDefault()}}),t?.suppressMouseOver||this.addManagedElementListeners(e,{mouseenter:()=>this.onMouseEnter(),mouseleave:()=>this.onMouseLeave()})}isDisabled(){return!!this.params.disabled}openSubMenu(e=!1,t){if(this.closeSubMenu(),!this.params.subMenu)return;this.subMenuIsOpening=!0;const s=qy('');this.eSubMenuGui=s;let i,r=()=>{this.subMenuIsOpening=!1};if(this.childComponent){const c=this.createBean(new rS(this.childComponent));c.setParentComponent(this);const d=c.getGui(),h="mouseenter",u=()=>this.cancelDeactivate();d.addEventListener(h,u),i=()=>{d.removeEventListener(h,u),this.destroyBean(c)},s.appendChild(d),this.childComponent.afterGuiAttached&&(r=()=>{this.childComponent.afterGuiAttached(),this.subMenuIsOpening=!1})}else if(this.params.subMenu){const c=this.createBean(new Nt(this.level+1,this.contextParams));c.setParentComponent(this),c.addMenuItems(this.params.subMenu),s.appendChild(c.getGui()),this.addManagedListeners(c,{closeMenu:d=>this.dispatchLocalEvent(d)}),c.addGuiEventListener("mouseenter",()=>this.cancelDeactivate()),i=()=>this.destroyBean(c),e&&(r=()=>{c.activateFirstItem(),this.subMenuIsOpening=!1})}const{popupSvc:a}=this,o=()=>{const c=this.eGui,{column:d,node:h}=this.contextParams;a?.positionPopupForMenu({eventSource:c,ePopup:s,event:t instanceof MouseEvent?t:void 0,column:d,node:h})},n=this.getLocaleTextFunc(),l=a?.addPopup({modal:!0,eChild:s,positionCallback:o,anchorToElement:this.eGui,ariaLabel:n("ariaLabelSubMenu","SubMenu"),afterGuiAttached:r});this.subMenuIsOpen=!0,this.setAriaExpanded(!0),this.hideSubMenu=()=>{l&&l.hideFunc(),this.subMenuIsOpen=!1,this.setAriaExpanded(!1),i(),this.menuItemComp.setExpanded?.(!1),this.eSubMenuGui=void 0},this.menuItemComp.setExpanded?.(!0)}setAriaExpanded(e){this.suppressAria||Qy(this.eGui,e)}closeSubMenu(){this.hideSubMenu&&(this.hideSubMenu(),this.hideSubMenu=null,this.setAriaExpanded(!1))}isSubMenuOpen(){return this.subMenuIsOpen}isSubMenuOpening(){return this.subMenuIsOpening}activate(e,t){this.cancelActivate(),!(this.params.disabled&&!t)&&(this.isActive=!0,this.suppressRootStyles||this.eGui.classList.add(`${this.cssClassPrefix}-active`),this.menuItemComp.setActive?.(!0),this.suppressFocus||Zy(this.beans,()=>this.eGui.focus({preventScroll:!t})),e&&this.params.subMenu&&window.setTimeout(()=>{this.isAlive()&&this.isActive&&this.openSubMenu()},300),this.onItemActivated())}deactivate(){this.cancelDeactivate(),this.suppressRootStyles||this.eGui.classList.remove(`${this.cssClassPrefix}-active`),this.menuItemComp.setActive?.(!1),this.isActive=!1,this.subMenuIsOpen&&this.closeSubMenu()}getGui(){return this.menuItemComp.getGui()}getParentComponent(){return this.parentComponent}setParentComponent(e){this.parentComponent=e}getSubMenuGui(){return this.eSubMenuGui}onItemSelected(e){this.menuItemComp.select?.(),this.params.action?this.beans.frameworkOverrides.wrapOutgoing(()=>this.params.action(zo(this.gos,{...this.contextParams}))):this.openSubMenu(e&&e.type==="keydown",e),!(this.params.subMenu&&!this.params.action||this.params.suppressCloseOnSelect)&&this.closeMenu(e)}closeMenu(e){const t={type:"closeMenu"};e&&(e instanceof MouseEvent?t.mouseEvent=e:t.keyboardEvent=e),this.dispatchLocalEvent(t)}onItemActivated(){const e={type:"menuItemActivated",menuItem:this};this.dispatchLocalEvent(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),this.ACTIVATION_DELAY):this.activate(!0)}onMouseLeave(){this.cancelActivate(),this.isSubMenuOpen()?this.deactivateTimeoutId=window.setTimeout(()=>this.deactivate(),this.ACTIVATION_DELAY):this.deactivate()}configureDefaults(e){if(!this.menuItemComp){setTimeout(()=>this.configureDefaults(e));return}let t=this.menuItemComp.getGui();const{suppressRootStyles:s,suppressTooltip:i,suppressAria:r,suppressTabIndex:a,suppressFocus:o}=e||{},n=this.menuItemComp.getRootElement?.();n&&(s||t.classList.add("ag-menu-option-custom"),t=n),this.eGui=t,this.suppressRootStyles=!!s,this.suppressRootStyles||(t.classList.add(this.cssClassPrefix),this.params.cssClasses?.forEach(l=>t.classList.add(l)),this.params.disabled&&t.classList.add(`${this.cssClassPrefix}-disabled`)),i||this.refreshTooltip(this.params.tooltip),this.suppressAria=!!r,this.suppressAria||(tS(t,"menuitem"),this.params.subMenu&&eS(t,this.params.subMenuRole??"menu"),this.params.disabled&&Jy(t,!0)),a||t.setAttribute("tabindex","-1"),this.params.disabled||this.addListeners(t,e),this.suppressFocus=!!o}refreshTooltip(e,t){if(this.tooltip=e,this.tooltipFeature=this.destroyBean(this.tooltipFeature),!e||!this.menuItemComp)return;const s=this.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui(),getTooltipValue:()=>this.tooltip,getLocation:()=>"menu",shouldDisplayTooltip:t});s&&(this.tooltipFeature=this.createBean(s))}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),this.menuItemComp?.destroy?.(),super.destroy()}},Nt=class extends zy{constructor(e=0,t){super(''),this.level=e,this.menuItems=[],this.params=t??{column:null,node:null,value:null}}postConstruct(){this.initialiseTabGuard({onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>Wy(this.beans,()=>this.handleKeyDown(e)),onFocusIn:e=>this.handleFocusIn(e),onFocusOut:e=>this.handleFocusOut(e)})}onTabKeyDown(e){this.getParentComponent()?.getGui()?.classList.contains("ag-focus-managed")||e.preventDefault(),e.shiftKey&&this.closeIfIsChild(e)}handleKeyDown(e){switch(e.key){case ge.UP:case ge.RIGHT:case ge.DOWN:case ge.LEFT:e.preventDefault(),this.handleNavKey(e.key);break;case ge.ESCAPE:this.closeIfIsChild()&&jy(e);break}}handleFocusIn(e){const t=e.relatedTarget;!this.tabGuardFeature.getTabGuardCtrl().isTabGuard(t)&&(this.getGui().contains(t)||this.activeMenuItem?.getSubMenuGui()?.contains(t))||(this.activeMenuItem?this.activeMenuItem.activate():this.activateFirstItem())}handleFocusOut(e){const t=e.relatedTarget;!this.activeMenuItem||this.getGui().contains(t)||this.activeMenuItem.getSubMenuGui()?.contains(t)||this.activeMenuItem.isSubMenuOpening()||this.activeMenuItem.deactivate()}clearActiveItem(){this.activeMenuItem&&(this.activeMenuItem.deactivate(),this.activeMenuItem=null)}addMenuItems(e){e!=null&&Yi.all(e.map(t=>t==="separator"?Yi.resolve({eGui:this.createSeparator()}):typeof t=="string"?($y(228,{menuItemOrString:t}),Yi.resolve({eGui:null})):this.addItem(t))).then(t=>{(t??[]).forEach(s=>{s?.eGui&&(this.appendChild(s.eGui),s.comp&&this.menuItems.push(s.comp))})})}addItem(e){const t=this.createManagedBean(new Xi);return t.init({menuItemDef:e,isAnotherSubMenuOpen:()=>this.menuItems.some(s=>s.isSubMenuOpen()),level:this.level,contextParams:this.params}).then(()=>(t.setParentComponent(this),this.addManagedListeners(t,{closeMenu:s=>{this.dispatchLocalEvent(s)},menuItemActivated:s=>{this.activeMenuItem&&this.activeMenuItem!==s.menuItem&&this.activeMenuItem.deactivate(),this.activeMenuItem=s.menuItem}}),{comp:t,eGui:t.getGui()}))}activateFirstItem(){const e=this.menuItems.filter(t=>!t.isDisabled())[0];e&&e.activate()}createSeparator(){return Ky(` `)}handleNavKey(e){switch(e){case ge.UP:case ge.DOWN:{const s=this.findNextItem(e===ge.UP);s&&s!==this.activeMenuItem&&s.activate(!1,!0);return}}const t=this.gos.get("enableRtl")?ge.RIGHT:ge.LEFT;e===t?this.closeIfIsChild():this.openChild()}closeIfIsChild(e){const t=this.getParentComponent();return t&&t instanceof Xi?(e&&e.preventDefault(),t.closeSubMenu(),t.getGui().focus(),!0):!1}openChild(){this.activeMenuItem&&this.activeMenuItem.openSubMenu(!0)}findNextItem(e){const t=[...this.menuItems];if(!t.length)return;if(!this.activeMenuItem)return e?Uy(t):t[0];e&&t.reverse();let s,i=!1;for(const r of t){if(!i){r===this.activeMenuItem&&(i=!0);continue}s=r;break}return i&&!s?t[0]:s||this.activeMenuItem}destroy(){this.clearActiveItem(),super.destroy()}},Uo=class extends By{constructor(e,t,s){super('
'),this.column=e,this.mouseEvent=t,this.parentEl=s,this.displayName=null}postConstruct(){const{column:e,beans:{colNames:t}}=this;this.initializeProperties(e);let s;if(Vy(e)?s=t.getDisplayNameForColumn(e,"columnToolPanel"):s=t.getDisplayNameForProvidedColumnGroup(null,e,"columnToolPanel"),this.displayName=s,this.buildMenuItemMap(),this.isActive()){this.mouseEvent.preventDefault();const i=this.getMappedMenuItems();if(i.length===0)return;this.displayContextMenu(i)}}initializeProperties(e){let t;Hy(e)?t=e.getLeafColumns():t=[e],this.columns=t,this.allowGrouping=t.some(s=>s.isPrimary()&&s.isAllowRowGroup()),this.allowValues=t.some(s=>s.isPrimary()&&s.isAllowValue()),this.allowPivoting=this.beans.colModel.isPivotMode()&&t.some(s=>s.isPrimary()&&s.isAllowPivot())}buildMenuItemMap(){const e=this.getLocaleTextFunc(),{beans:t,displayName:s}=this,{rowGroupColsSvc:i,valueColsSvc:r,pivotColsSvc:a,colModel:o}=t,n=new Map;this.menuItemMap=n,n.set("rowGroup",{allowedFunction:l=>l.isPrimary()&&l.isAllowRowGroup()&&!Ot(l,t),activeFunction:l=>l.isRowGroupActive(),activateLabel:()=>`${e("groupBy","Group by")} ${s}`,deactivateLabel:()=>`${e("ungroupBy","Un-Group by")} ${s}`,activateFunction:()=>i?.setColumns(this.addColumnsToList(i.columns),"toolPanelUi"),deActivateFunction:()=>i?.setColumns(this.removeColumnsFromList(i.columns),"toolPanelUi"),addIcon:"menuAddRowGroup",removeIcon:"menuRemoveRowGroup"}),n.set("value",{allowedFunction:l=>l.isPrimary()&&l.isAllowValue(),activeFunction:l=>l.isValueActive(),activateLabel:()=>e("addToValues",`Add ${s} to values`,[s]),deactivateLabel:()=>e("removeFromValues",`Remove ${s} from values`,[s]),activateFunction:()=>r?.setColumns(this.addColumnsToList(r.columns),"toolPanelUi"),deActivateFunction:()=>r?.setColumns(this.removeColumnsFromList(r.columns),"toolPanelUi"),addIcon:"valuePanel",removeIcon:"valuePanel"}),n.set("pivot",{allowedFunction:l=>o.isPivotMode()&&l.isPrimary()&&l.isAllowPivot(),activeFunction:l=>l.isPivotActive(),activateLabel:()=>e("addToLabels",`Add ${s} to labels`,[s]),deactivateLabel:()=>e("removeFromLabels",`Remove ${s} from labels`,[s]),activateFunction:()=>a?.setColumns(this.addColumnsToList(a.columns),"toolPanelUi"),deActivateFunction:()=>a?.setColumns(this.removeColumnsFromList(a.columns),"toolPanelUi"),addIcon:"pivotPanel",removeIcon:"pivotPanel"})}addColumnsToList(e){return[...e].concat(this.columns.filter(t=>e.indexOf(t)===-1))}removeColumnsFromList(e){return e.filter(t=>this.columns.indexOf(t)===-1)}displayContextMenu(e){const t=this.getGui(),s=this.createBean(new Nt),i=this.getLocaleTextFunc();let r=()=>{};t.appendChild(s.getGui()),s.addMenuItems(e),s.addManagedListeners(s,{closeMenu:()=>{this.parentEl.focus(),r()}});const a=this.beans.popupSvc,o=a.addPopup({modal:!0,eChild:t,closeOnEsc:!0,afterGuiAttached:()=>_y(s.getGui()),ariaLabel:i("ariaLabelContextMenu","Context Menu"),closedCallback:n=>{n instanceof KeyboardEvent&&this.parentEl.focus(),this.destroyBean(s)}});o&&(r=o.hideFunc),a.positionPopupUnderMouseEvent({type:"columnContextMenu",mouseEvent:this.mouseEvent,ePopup:t})}isActive(){return this.allowGrouping||this.allowValues||this.allowPivoting}getMappedMenuItems(){const e=[],{menuItemMap:t,columns:s,displayName:i,beans:r}=this;for(const a of t.values()){const o=s.some(l=>a.allowedFunction(l)&&!a.activeFunction(l)),n=s.some(l=>a.allowedFunction(l)&&a.activeFunction(l));o&&e.push({name:a.activateLabel(i),icon:_o(a.addIcon,r,null),action:()=>a.activateFunction()}),n&&e.push({name:a.deactivateLabel(i),icon:_o(a.removeIcon,r,null),action:()=>a.deActivateFunction()})}return e}},Ko=class extends Ry{constructor(e,t,s,i){super(),this.modelItem=e,this.allowDragging=t,this.eventType=s,this.focusWrapper=i,this.cbSelect=Gt,this.eLabel=Gt,this.eGroupOpenedIcon=Gt,this.eGroupClosedIcon=Gt,this.eColumnGroupIcons=Gt,this.processingColumnStateChange=!1;const{columnGroup:r,depth:a,displayName:o}=e;this.columnGroup=r,this.columnDepth=a,this.displayName=o}postConstruct(){this.setTemplate(`
`,[Ay]);const{beans:e,cbSelect:t,eLabel:s,displayName:i,columnDepth:r,modelItem:a,focusWrapper:o,columnGroup:n}=this,{registry:l,gos:c}=e,d=Dy("columnDrag",e);this.eDragHandle=d,d.classList.add("ag-drag-handle","ag-column-select-column-group-drag-handle");const h=t.getGui(),u=t.getInputElement();h.insertAdjacentElement("afterend",d),u.setAttribute("tabindex","-1"),s.innerHTML=i??"",this.setupExpandContract(),this.addCssClass("ag-column-select-indent-"+r),this.getGui().style.setProperty("--ag-indentation-level",String(r)),this.tooltipFeature=this.createOptionalManagedBean(l.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui(),getLocation:()=>"columnToolPanelColumnGroup",shouldDisplayTooltip:Ly(c,()=>s)})),this.addManagedEventListeners({columnPivotModeChanged:this.onColumnStateChanged.bind(this)}),this.addManagedElementListeners(s,{click:this.onLabelClicked.bind(this)}),this.addManagedListeners(t,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedListeners(a,{expandedChanged:this.onExpandChanged.bind(this)}),this.addManagedListeners(o,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)}),this.setOpenClosedIcons(),this.setupDragging(),this.onColumnStateChanged(),this.addVisibilityListenersToAllChildren(),this.refreshAriaExpanded(),this.refreshAriaLabel(),this.setupTooltip(),ky(n.getColGroupDef(),c,null,n).forEach(g=>this.addOrRemoveCssClass(g,!0))}getColumns(){return this.columnGroup.getLeafColumns()}setupTooltip(){const e=this.columnGroup.getColGroupDef();if(!e)return;const t=()=>this.tooltipFeature?.setTooltipAndRefresh(e.headerTooltip);t(),this.addManagedEventListeners({newColumnsLoaded:t})}handleKeyDown(e){switch(e.key){case ji.LEFT:e.preventDefault(),this.modelItem.expanded=!1;break;case ji.RIGHT:e.preventDefault(),this.modelItem.expanded=!0;break;case ji.SPACE:e.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected());break}}onContextMenu(e){const{columnGroup:t,gos:s}=this;if(s.get("functionsReadOnly"))return;const i=this.createBean(new Uo(t,e,this.focusWrapper));this.addDestroyFunc(()=>{i.isAlive()&&this.destroyBean(i)})}addVisibilityListenersToAllChildren(){const e=this.onColumnStateChanged.bind(this);this.columnGroup.getLeafColumns().forEach(t=>{this.addManagedListeners(t,{visibleChanged:e,columnValueChanged:e,columnPivotChanged:e,columnRowGroupChanged:e})})}setupDragging(){if(!this.allowDragging){$i(this.eDragHandle,!1);return}const e=this.beans,{gos:t,eventSvc:s,dragAndDrop:i}=e;let r=!t.get("suppressDragLeaveHidesColumns");const a={type:Ey.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>r?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{r=!t.get("suppressDragLeaveHidesColumns"),s.dispatchEvent({type:"columnPanelItemDragStart",column:this.columnGroup})},onDragStopped:()=>{s.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:o=>{r&&Oo(e,{columns:this.columnGroup.getLeafColumns(),visibleState:o?.visibleState,pivotState:o?.pivotState,eventType:this.eventType})},onGridExit:()=>{r&&this.onChangeCommon(!1)}};i.addDragSource(a,!0),this.addDestroyFunc(()=>i.removeDragSource(a))}createDragItem(){const e=this.columnGroup.getLeafColumns(),t={},s={};return e.forEach(i=>{const r=i.getId();t[r]=i.isVisible(),s[r]=No(i)}),{columns:e,visibleState:t,pivotState:s}}setupExpandContract(){const{beans:e,eGroupClosedIcon:t,eGroupOpenedIcon:s,eColumnGroupIcons:i}=this;t.appendChild(Bo("columnSelectClosed",e,null)),s.appendChild(Bo("columnSelectOpen",e,null));const r=this.onExpandOrContractClicked.bind(this);this.addManagedElementListeners(t,{click:r}),this.addManagedElementListeners(s,{click:r});const a=new Iy(i,!0);this.addManagedListeners(a,{tap:r}),this.addDestroyFunc(a.destroy.bind(a))}onLabelClicked(){const e=!this.cbSelect.getValue();this.onChangeCommon(e)}onCheckboxChanged(e){this.onChangeCommon(e.selected)}getVisibleLeafColumns(){const e=[],t=s=>{s.forEach(i=>{i.passesFilter&&(i.group?t(i.children):e.push(i.column))})};return t(this.modelItem.children),e}onChangeCommon(e){this.refreshAriaLabel(),!this.processingColumnStateChange&&ko(this.beans,this.modelItem.children,e,this.eventType)}refreshAriaLabel(){const{cbSelect:e,focusWrapper:t,displayName:s}=this,i=this.getLocaleTextFunc(),r=i("ariaColumnGroup","Column Group"),a=e.getValue(),o=a===void 0?i("ariaIndeterminate","indeterminate"):a?i("ariaVisible","visible"):i("ariaHidden","hidden"),n=i("ariaToggleVisibility","Press SPACE to toggle visibility");Ny(t,`${s} ${r}`),e.setInputAriaLabel(`${n} (${o})`),Gy(t,e.getInputElement().id)}onColumnStateChanged(){const e=this.workOutSelectedValue(),t=this.workOutReadOnlyValue();this.processingColumnStateChange=!0;const s=this.cbSelect;s.setValue(e),s.setReadOnly(t),this.addOrRemoveCssClass("ag-column-select-column-group-readonly",t),this.processingColumnStateChange=!1}workOutSelectedValue(){const e=this.beans.colModel.isPivotMode(),t=this.getVisibleLeafColumns();let s=0,i=0;if(t.forEach(r=>{!e&&r.getColDef().lockVisible||(this.isColumnChecked(r,e)?s++:i++)}),!(s>0&&i>0))return s>0}workOutReadOnlyValue(){const e=this.beans.colModel.isPivotMode();let t=0;return this.columnGroup.getLeafColumns().forEach(s=>{e?s.isAnyFunctionAllowed()&&t++:s.getColDef().lockVisible||t++}),t===0}isColumnChecked(e,t){if(t){const s=e.isPivotActive(),i=e.isRowGroupActive(),r=e.isValueActive();return s||i||r}return e.isVisible()}onExpandOrContractClicked(){const e=this.modelItem,t=e.expanded;e.expanded=!t}onExpandChanged(){this.setOpenClosedIcons(),this.refreshAriaExpanded()}setOpenClosedIcons(){const e=this.modelItem.expanded;$i(this.eGroupClosedIcon,!e),$i(this.eGroupOpenedIcon,e)}refreshAriaExpanded(){Oy(this.focusWrapper,this.modelItem.expanded)}getDisplayName(){return this.displayName}onSelectAllChanged(e){const t=this.cbSelect,s=t.getValue();!t.isReadOnly()&&(e&&!s||!e&&s)&&t.toggle()}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}setSelected(e){this.cbSelect.setValue(e,!0)}},nS=class extends My{constructor(e,t){super(),this.comp=e,this.virtualList=t}postConstruct(){this.createManagedBean(new Qa(this.comp,this.virtualList,{dragSourceType:Py.ToolPanel,listItemDragStartEvent:"columnPanelItemDragStart",listItemDragEndEvent:"columnPanelItemDragEnd",eventSource:this.eventSvc,getCurrentDragValue:e=>this.getCurrentDragValue(e),isMoveBlocked:e=>this.isMoveBlocked(e),getNumRows:e=>e.getDisplayedColsList().length,moveItem:(e,t)=>this.moveItem(this.getCurrentColumnsBeingMoved(e),t)}))}getCurrentDragValue(e){return e.column}getCurrentColumnsBeingMoved(e){return Fy(e)?e.getLeafColumns():e?[e]:[]}isMoveBlocked(e){return this.gos.get("suppressMovableColumns")?!0:!!this.getCurrentColumnsBeingMoved(e).find(r=>{const a=r.getColDef();return!!a.suppressMovable||!!a.lockPosition})}moveItem(e,t){if(!t)return;const{component:s}=t;let i=null,r=t.position==="top";if(s instanceof Ko?(i=s.getColumns()[0],r=!0):s&&(i=s.column),!i)return;const a=this.getMoveTargetIndex({currentColumns:e,lastHoveredColumn:i,isBefore:r});a!=null&&this.beans.colMoves?.moveColumns(e,a,"toolPanelUi")}getMoveTargetIndex(e){const{currentColumns:t,lastHoveredColumn:s,isBefore:i}=e;if(!s||!t)return null;const r=this.beans.colModel.getCols(),a=r.indexOf(s),o=i?a:a+1,n=this.getMoveDiff(r,t,o);return o-n}getMoveDiff(e,t,s){if(!t)return 0;const i=t[0],r=t.length;return e.indexOf(i)
`,[lS]);const{beans:e,cbSelect:t,displayName:s,eLabel:i,columnDept:r,groupsExist:a,column:o,gos:n,focusWrapper:l}=this,c=uS("columnDrag",e);this.eDragHandle=c,c.classList.add("ag-drag-handle","ag-column-select-column-drag-handle");const d=t.getGui(),h=t.getInputElement();d.insertAdjacentElement("afterend",c),h.setAttribute("tabindex","-1");const u=pS(s);i.innerHTML=u,a&&this.addCssClass("ag-column-select-add-group-indent"),this.addCssClass(`ag-column-select-indent-${r}`),this.getGui().style.setProperty("--ag-indentation-level",String(r)),this.tooltipFeature=this.createOptionalManagedBean(e.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui(),getLocation:()=>"columnToolPanelColumn",getColDef:()=>o.getColDef(),shouldDisplayTooltip:gS(n,()=>i)})),this.setupDragging();const p=this.onColumnStateChanged.bind(this);this.addManagedEventListeners({columnPivotModeChanged:p}),this.addManagedListeners(o,{columnValueChanged:p,columnPivotChanged:p,columnRowGroupChanged:p,visibleChanged:p}),this.addManagedListeners(l,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)}),this.addManagedPropertyListener("functionsReadOnly",this.onColumnStateChanged.bind(this)),this.addManagedListeners(t,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedElementListeners(i,{click:this.onLabelClicked.bind(this)}),this.onColumnStateChanged(),this.refreshAriaLabel(),this.setupTooltip(),mS(o.getColDef(),n,o,null).forEach(m=>this.addOrRemoveCssClass(m,!0))}getColumn(){return this.column}setupTooltip(){const e=()=>this.tooltipFeature?.setTooltipAndRefresh(this.column.getColDef().headerTooltip);e(),this.addManagedEventListeners({newColumnsLoaded:e})}onContextMenu(e){const{column:t,gos:s}=this;if(s.get("functionsReadOnly"))return;const i=this.createBean(new Uo(t,e,this.focusWrapper));this.addDestroyFunc(()=>{i.isAlive()&&this.destroyBean(i)})}handleKeyDown(e){e.key===hS.SPACE&&(e.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected()))}onLabelClicked(){if(this.gos.get("functionsReadOnly"))return;const e=!this.cbSelect.getValue();this.onChangeCommon(e)}onCheckboxChanged(e){this.onChangeCommon(e.selected)}onChangeCommon(e){this.cbSelect.isReadOnly()||(this.refreshAriaLabel(),!this.processingColumnStateChange&&Go(this.beans,[this.column],e,"toolPanelUi"))}refreshAriaLabel(){const{cbSelect:e,focusWrapper:t,displayName:s}=this,i=this.getLocaleTextFunc(),r=i("ariaColumn","Column"),a=e.getValue()?i("ariaVisible","visible"):i("ariaHidden","hidden"),o=i("ariaToggleVisibility","Press SPACE to toggle visibility");CS(t,`${s} ${r}`),this.cbSelect.setInputAriaLabel(`${o} (${a})`),fS(t,e.getInputElement().id)}setupDragging(){const e=this.eDragHandle;if(!this.allowDragging){vS(e,!1);return}const t=this.beans,{gos:s,eventSvc:i,dragAndDrop:r}=t;let a=!s.get("suppressDragLeaveHidesColumns");const o={type:dS.ToolPanel,eElement:e,dragItemName:this.displayName,getDefaultIconName:()=>a?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{a=!s.get("suppressDragLeaveHidesColumns"),i.dispatchEvent({type:"columnPanelItemDragStart",column:this.column})},onDragStopped:()=>{i.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:n=>{a&&Oo(t,{columns:[this.column],visibleState:n?.visibleState,pivotState:n?.pivotState,eventType:"toolPanelUi"})},onGridExit:()=>{a&&this.onChangeCommon(!1)}};r.addDragSource(o,!0),this.addDestroyFunc(()=>r.removeDragSource(o))}createDragItem(){const e=this.column.getColId(),t={[e]:this.column.isVisible()},s={[e]:No(this.column)};return{columns:[this.column],visibleState:t,pivotState:s}}onColumnStateChanged(){this.processingColumnStateChange=!0;const e=this.beans.colModel.isPivotMode();if(e){const i=this.column.isAnyFunctionActive();this.cbSelect.setValue(i)}else this.cbSelect.setValue(this.column.isVisible());let t=!0,s=!0;if(e){const i=this.gos.get("functionsReadOnly"),r=!this.column.isAnyFunctionAllowed();t=!i&&!r,s=t}else{const{enableRowGroup:i,enableValue:r,lockPosition:a,suppressMovable:o,lockVisible:n}=this.column.getColDef(),l=!!i||!!r,c=!!a||!!o;t=!n,s=l||!c}this.cbSelect.setReadOnly(!t),this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!s),this.addOrRemoveCssClass("ag-column-select-column-readonly",!s&&!t),this.cbSelect.setPassive(!1),this.processingColumnStateChange=!1}getDisplayName(){return this.displayName}onSelectAllChanged(e){const t=this.cbSelect;e!==t.getValue()&&(t.isReadOnly()||t.toggle())}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}isExpandable(){return!1}setExpanded(e){yS(158)}},bS=class{constructor(e){this.items=e}getRowCount(){return this.items.length}getRow(e){return this.items[e]}},wS="ag-column-select-list",xS=class extends cy{constructor(){super(``),this.destroyColumnItemFuncs=[],this.hasLoadedInitialState=!1,this.isInitialState=!1}wireBeans(e){this.colModel=e.colModel}destroy(){this.destroyColumnTree(),super.destroy()}destroyColumnTree(){this.allColsTree=[],this.destroyColumnItemFuncs.forEach(e=>e()),this.destroyColumnItemFuncs=[]}init(e,t,s){this.params=e,this.allowDragging=t,this.eventType=s,e.suppressSyncLayoutWithGrid||this.addManagedEventListeners({columnMoved:this.onColumnsChanged.bind(this)}),this.addManagedEventListeners({newColumnsLoaded:this.onColumnsChanged.bind(this)});const i=this.fireSelectionChangedEvent.bind(this);this.addManagedEventListeners({columnPivotChanged:i,columnPivotModeChanged:i,columnRowGroupChanged:i,columnValueChanged:i,columnVisible:i,newColumnsLoaded:i}),this.expandGroupsByDefault=!e.contractColumnSelection;const r=this.createManagedBean(new lt({cssIdentifier:"column-select",ariaRole:"tree"}));this.virtualList=r,this.appendChild(r.getGui()),r.setComponentCreator((a,o)=>(hy(o,a.depth+1),this.createComponentFromItem(a,o))),this.colModel.ready&&this.onColumnsChanged(),!e.suppressColumnMove&&this.createManagedBean(new nS(this,r))}createComponentFromItem(e,t){const s=this.allowDragging;if(e.group){const r=new Ko(e,s,this.eventType,t);return this.createBean(r),r}const i=new SS(e,s,this.groupsExist,t);return this.createBean(i),i}onColumnsChanged(){const e=this.params;this.hasLoadedInitialState||(this.hasLoadedInitialState=!0,this.isInitialState=!!e.initialState);const t=this.getExpandedStates(),s=this.colModel.isPivotMode();!e.suppressSyncLayoutWithGrid&&!s?this.buildTreeFromWhatGridIsDisplaying():this.buildTreeFromProvidedColumnDefs(),this.setExpandedStates(t),this.markFilteredColumns(),this.flattenAndFilterModel(),this.isInitialState=!1}getDisplayedColsList(){return this.displayedColsList}getExpandedStates(){const e={};if(this.isInitialState){const{expandedGroupIds:t}=this.params.initialState;return t.forEach(s=>{e[s]=!0}),e}return this.allColsTree?(this.forEachItem(t=>{if(!t.group)return;const s=t.columnGroup;s&&(e[s.getId()]=t.expanded)}),e):{}}setExpandedStates(e){if(!this.allColsTree)return;const{isInitialState:t}=this;this.forEachItem(s=>{if(!s.group)return;const i=s.columnGroup;if(i){const r=e[i.getId()];(r!=null||t)&&(s.expanded=!!r)}})}buildTreeFromWhatGridIsDisplaying(){Do(this.colModel,this.setColumnLayout.bind(this))}setColumnLayout(e){const t=Io(this.colModel,e);this.buildListModel(t),this.groupsExist=e.some(s=>s&&typeof s.children<"u"),this.markFilteredColumns(),this.flattenAndFilterModel()}buildTreeFromProvidedColumnDefs(){const e=this.colModel;this.buildListModel(e.getColDefColTree()),this.groupsExist=!!e.colDefCols?.treeDepth}buildListModel(e){const t=this.onColumnExpanded.bind(this),s=n=>{n.addEventListener("expandedChanged",t);const l=n.removeEventListener.bind(n,"expandedChanged",t);this.destroyColumnItemFuncs.push(l)},i=this.beans.colNames,r=(n,l,c)=>{n.forEach(d=>{py(d)?a(d,l,c):o(d,l,c)})},a=(n,l,c)=>{const d=n.getColGroupDef();if(d&&d.suppressColumnsToolPanel)return;if(n.isPadding()){r(n.getChildren(),l,c);return}const u=i.getDisplayNameForProvidedColumnGroup(null,n,"columnToolPanel"),p=new Lo(u,n,l,!0,this.expandGroupsByDefault);c.push(p),s(p),r(n.getChildren(),l+1,p.children)},o=(n,l,c)=>{if(n.getColDef()&&n.getColDef().suppressColumnsToolPanel)return;const h=i.getDisplayNameForColumn(n,"columnToolPanel");c.push(new Lo(h,n,l))};this.destroyColumnTree(),r(e,0,this.allColsTree)}onColumnExpanded(){this.flattenAndFilterModel()}flattenAndFilterModel(){this.displayedColsList=[];const e=i=>{i.passesFilter&&(this.displayedColsList.push(i),i.group&&i.expanded&&i.children.forEach(e))},t=this.virtualList;this.allColsTree.forEach(e),t.setModel(new bS(this.displayedColsList));const s=t.getLastFocusedRow();t.refresh(),s!=null&&this.focusRowIfAlive(s),this.notifyListeners(),this.refreshAriaLabel()}refreshAriaLabel(){const e=this.getLocaleTextFunc(),t=e("ariaColumnPanelList","Column List"),s=e("columns","Columns"),i=this.displayedColsList.length;dy(this.virtualList.getAriaElement(),`${t} ${i} ${s}`)}focusRowIfAlive(e){window.setTimeout(()=>{this.isAlive()&&this.virtualList.focusRow(e)},0)}forEachItem(e){const t=i=>{i.forEach(r=>{e(r),r.group&&t(r.children)})},s=this.allColsTree;s&&t(s)}doSetExpandedAll(e){this.forEachItem(t=>{t.group&&(t.expanded=e)})}setGroupsExpanded(e,t){if(!t){this.doSetExpandedAll(e);return}const s=[];this.forEachItem(r=>{if(!r.group)return;const a=r.columnGroup.getId();t.indexOf(a)>=0&&(r.expanded=e,s.push(a))});const i=t.filter(r=>!s.includes(r));i.length>0&&uy(157,{unrecognisedGroupIds:i})}getExpandState(){let e=0,t=0;return this.forEachItem(s=>{s.group&&(s.expanded?e++:t++)}),e>0&&t>0?2:t>0?1:0}doSetSelectedAll(e){ko(this.beans,this.allColsTree,e,this.eventType)}getSelectionState(){let e=0,t=0;const s=this.colModel.isPivotMode();if(this.forEachItem(i=>{if(i.group||!i.passesFilter)return;const r=i.column,a=r.getColDef();let o;if(s){if(!r.isAllowPivot()&&!r.isAllowRowGroup()&&!r.isAllowValue())return;o=r.isValueActive()||r.isPivotActive()||r.isRowGroupActive()}else{if(a.lockVisible)return;o=r.isVisible()}o?e++:t++}),!(e>0&&t>0))return!(e===0||t>0)}setFilterText(e){this.filterText=Ro(e)?e.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()}markFilteredColumns(){const e=s=>{if(!Ro(this.filterText))return!0;const i=s.displayName;return i==null||i.toLowerCase().indexOf(this.filterText)!==-1},t=(s,i)=>{let r=!1;if(s.group){const o=e(s);s.children.forEach(n=>{const l=t(n,o||i);l&&(r=l)})}const a=i||r?!0:e(s);return s.passesFilter=a,a};this.allColsTree.forEach(s=>t(s,!1))}notifyListeners(){this.fireGroupExpandedEvent(),this.fireSelectionChangedEvent()}fireGroupExpandedEvent(){const e=this.getExpandState();this.dispatchLocalEvent({type:"groupExpanded",state:e})}fireSelectionChangedEvent(){if(!this.allColsTree)return;const e=this.getSelectionState();this.dispatchLocalEvent({type:"selectionChanged",state:e})}getExpandedGroups(){const e=[];return this.allColsTree&&this.forEachItem(t=>{t.group&&t.expanded&&e.push(t.columnGroup.getId())}),e}},TS={selector:"AG-PRIMARY-COLS-LIST",component:xS},jo=class extends Jv{constructor(){super(`
`,[ly,TS]),this.primaryColsHeaderPanel=Ao,this.primaryColsListPanel=Ao,this.registerCSS(ey)}init(e,t,s){const{primaryColsHeaderPanel:i,primaryColsListPanel:r}=this;i.init(t);const a=t.suppressColumnFilter,o=t.suppressColumnSelectAll;t.suppressColumnExpandAll&&a&&o&&i.setDisplayed(!1),this.addManagedListeners(r,{groupExpanded:l=>{i.setExpandState(l.state),t.onStateUpdated()},selectionChanged:l=>i.setSelectionState(l.state)}),r.init(t,e,s),this.addManagedListeners(i,{expandAll:r.doSetExpandedAll.bind(r,!0),collapseAll:r.doSetExpandedAll.bind(r,!1),selectAll:r.doSetSelectedAll.bind(r,!0),unselectAll:r.doSetSelectedAll.bind(r,!1),filterChanged:l=>r.setFilterText(l.filterText)}),this.positionableFeature=this.createManagedBean(new Qv(this.getGui(),{minHeight:100}))}toggleResizable(e){this.positionableFeature.setResizable(e?{bottom:!0}:!1)}expandGroups(e){this.primaryColsListPanel.setGroupsExpanded(!0,e)}collapseGroups(e){this.primaryColsListPanel.setGroupsExpanded(!1,e)}setColumnLayout(e){this.primaryColsListPanel.setColumnLayout(e)}syncLayoutWithGrid(){this.primaryColsListPanel.onColumnsChanged()}getExpandedGroups(){return this.primaryColsListPanel.getExpandedGroups()}},MS=".ag-column-panel{display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.ag-pivot-mode-panel{display:flex;height:var(--ag-header-height)}.ag-pivot-mode-select{align-items:center;display:flex}:where(.ag-ltr) .ag-pivot-mode-select{margin-left:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-pivot-mode-select{margin-right:var(--ag-widget-container-horizontal-padding)}.ag-column-panel-column-select{border-bottom:var(--ag-tool-panel-separator-border)}.ag-column-panel-column-select:where(:nth-child(n+2 of :not(.ag-hidden))){border-top:var(--ag-tool-panel-separator-border)}:where(.ag-column-panel) .ag-column-drop-vertical{flex:1 1 0px;min-height:50px;&:where(:not(.ag-last-column-drop)){border-bottom:var(--ag-tool-panel-separator-border)}}",PS=class extends Yv{constructor(){super('
'),this.initialised=!1,this.childDestroyFuncs=[],this.registerCSS(MS)}wireBeans(e){this.colToolPanelFactory=e.colToolPanelFactory}setVisible(e){super.setDisplayed(e),e&&!this.initialised&&this.init(this.params)}init(e){const s={...Xv(this.gos,{suppressColumnMove:!1,suppressColumnSelectAll:!1,suppressColumnFilter:!1,suppressColumnExpandAll:!1,contractColumnSelection:!1,suppressPivotMode:!1,suppressRowGroups:!1,suppressValues:!1,suppressPivots:!1,suppressSyncLayoutWithGrid:!1}),...e};this.params=s;const{childDestroyFuncs:i,colToolPanelFactory:r,gos:a}=this,o=a.isModuleRegistered("SharedPivot"),n=o||a.isModuleRegistered("SharedRowGrouping");!s.suppressPivotMode&&r&&o&&(this.pivotModePanel=r.createPivotModePanel(this,i));const l=this.createBean(new jo);if(this.primaryColsPanel=l,i.push(()=>this.destroyBean(this.primaryColsPanel)),l.init(!0,s,"toolPanelUi"),l.addCssClass("ag-column-panel-column-select"),this.appendChild(l),r){!s.suppressRowGroups&&n&&(this.rowGroupDropZonePanel=r.createRowGroupPanel(this,i)),!s.suppressValues&&n&&(this.valuesDropZonePanel=r.createValuesPanel(this,i)),!s.suppressPivots&&o&&(this.pivotDropZonePanel=r.createPivotPanel(this,i)),this.setLastVisible();const[c]=this.addManagedEventListeners({columnPivotModeChanged:()=>{this.resetChildrenHeight(),this.setLastVisible()}});i.push(()=>c())}this.initialised=!0}setPivotModeSectionVisible(e){const t=this.colToolPanelFactory;t&&(this.pivotModePanel=t.setPanelVisible(this.pivotModePanel,e,t.createPivotModePanel.bind(t,this,this.childDestroyFuncs,!0)),this.setLastVisible())}setRowGroupsSectionVisible(e){const t=this.colToolPanelFactory;t&&(this.rowGroupDropZonePanel=t.setPanelVisible(this.rowGroupDropZonePanel,e,t.createRowGroupPanel.bind(t,this,this.childDestroyFuncs)),this.setLastVisible())}setValuesSectionVisible(e){const t=this.colToolPanelFactory;t&&(this.valuesDropZonePanel=t.setPanelVisible(this.valuesDropZonePanel,e,t.createValuesPanel.bind(t,this,this.childDestroyFuncs)),this.setLastVisible())}setPivotSectionVisible(e){const t=this.colToolPanelFactory;t&&(this.pivotDropZonePanel=t.setPanelVisible(this.pivotDropZonePanel,e,t.createPivotPanel.bind(t,this,this.childDestroyFuncs)),this.pivotDropZonePanel?.setDisplayed(e),this.setLastVisible())}setResizers(){[this.primaryColsPanel,this.rowGroupDropZonePanel,this.valuesDropZonePanel,this.pivotDropZonePanel].forEach(e=>{if(!e)return;const t=e.getGui();e.toggleResizable(!t.classList.contains("ag-last-column-drop")&&!t.classList.contains("ag-hidden"))})}setLastVisible(){const e=this.getGui();Array.prototype.slice.call(e.querySelectorAll(".ag-column-drop")).forEach(r=>r.classList.remove("ag-last-column-drop"));const s=e.querySelectorAll(".ag-column-drop:not(.ag-hidden)"),i=Zv(s);i&&i.classList.add("ag-last-column-drop"),this.setResizers()}resetChildrenHeight(){const t=this.getGui().children;for(let s=0;st()),e.length=0,qv(this.getGui())}refresh(e){return this.destroyChildren(),this.init(e),!0}getState(){return{expandedGroupIds:this.primaryColsPanel.getExpandedGroups()}}destroy(){this.destroyChildren(),super.destroy()}};import{BeanStub as FS}from"ag-grid-community";import{_createIconNoSpan as AS}from"ag-grid-community";import{DragSourceType as $o,_shouldUpdateColVisibilityAfterGroup as RS}from"ag-grid-community";import{Component as ES,KeyCode as ut,ManagedFocusFeature as IS,PositionableFeature as DS,_areEqual as LS,_clearElement as Yo,_createIconNoSpan as kS,_findFocusableElements as GS,_findNextFocusableElement as qi,_getActiveDomElement as Xo,_isKeyboardMode as OS,_last as NS,_setAriaHidden as BS,_setAriaLabel as _S,_setAriaPosInSet as VS,_setAriaRole as HS,_setAriaSetSize as zS}from"ag-grid-community";var US=".ag-column-drop{align-items:center;display:inline-flex;overflow:auto;position:relative;width:100%}.ag-column-drop-list{align-items:center;display:flex}.ag-column-drop-cell{align-items:center;background-color:var(--ag-column-drop-cell-background-color);border:var(--ag-column-drop-cell-border);border-radius:500px;color:var(--ag-column-drop-cell-text-color);display:flex;padding:calc(var(--ag-spacing)*.25);position:relative;&:focus-visible{box-shadow:var(--ag-focus-shadow)}:where(.ag-drag-handle){color:var(--ag-column-drop-cell-drag-handle-color)}}:where(.ag-ltr) .ag-column-drop-cell{padding-left:calc(var(--ag-spacing)*.75)}:where(.ag-rtl) .ag-column-drop-cell{padding-right:calc(var(--ag-spacing)*.75)}.ag-column-drop-cell-text{flex:1 1 auto;margin:0 var(--ag-spacing);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-column-drop-vertical{align-items:stretch;display:flex;flex-direction:column;min-height:75px;overflow:hidden}.ag-column-drop-vertical-title-bar{align-items:center;display:flex;flex:none;padding:var(--ag-widget-container-vertical-padding) calc(var(--ag-spacing)*2) 0}.ag-column-drop-vertical-list{align-items:stretch;flex-direction:column;flex-grow:1;overflow-x:auto;padding-bottom:var(--ag-spacing);padding-left:var(--ag-spacing);padding-right:var(--ag-spacing);position:relative;>*{flex:none}}:where(.ag-column-drop-empty) .ag-column-drop-vertical-list{overflow:hidden}.ag-column-drop-cell-button{cursor:pointer;min-width:0;opacity:.75;&:hover{opacity:1}}.ag-column-drop-wrapper{display:flex}.ag-column-drop-horizontal-half-width{width:50%!important}.ag-column-drop-cell-ghost{opacity:.5}.ag-column-drop-horizontal{background-color:var(--ag-header-background-color);border-bottom:var(--ag-header-row-border);gap:var(--ag-cell-widget-spacing);height:var(--ag-header-height);overflow:hidden;white-space:nowrap}:where(.ag-ltr) .ag-column-drop-horizontal{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-column-drop-horizontal{padding-right:var(--ag-cell-horizontal-padding)}.ag-column-drop-horizontal-list{gap:var(--ag-cell-widget-spacing)}.ag-column-drop-vertical-cell{margin-top:var(--ag-spacing)}:where(.ag-ltr) .ag-column-drop-vertical-icon{margin-right:var(--ag-widget-horizontal-spacing)}:where(.ag-rtl) .ag-column-drop-vertical-icon{margin-left:var(--ag-widget-horizontal-spacing)}.ag-select-agg-func-popup{background:var(--ag-background-color);border:1px solid var(--ag-border-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);height:calc(var(--ag-spacing)*5*3.5);padding:0;position:absolute}.ag-select-agg-func-virtual-list-item{cursor:default;&:hover{background-color:var(--ag-selected-row-background-color)}}:where(.ag-ltr) .ag-select-agg-func-virtual-list-item{padding-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-select-agg-func-virtual-list-item{padding-right:calc(var(--ag-spacing)*2)}:where(.ag-ltr) .ag-column-drop-horizontal-half-width:where(:not(:last-child)){border-right:1px solid var(--ag-border-color)}:where(.ag-rtl) .ag-column-drop-horizontal-half-width:where(:not(:last-child)){border-left:1px solid var(--ag-border-color)}";function qo(e,t,s){e==null||t==null||e.splice(s,0,...t)}var Zo=class extends ES{constructor(e){super(''),this.horizontal=e,this.state="notDragging",this.guiDestroyFunctions=[],this.childPillComponents=[],this.resizeEnabled=!1,this.addElementClasses(this.getGui()),this.ePillDropList=document.createElement("div"),this.addElementClasses(this.ePillDropList,"list"),HS(this.ePillDropList,"listbox"),this.registerCSS(US)}toggleResizable(e){this.positionableFeature.setResizable(e?{bottom:!0}:!1),this.resizeEnabled=e}isSourceEventFromTarget(e){const{dropZoneTarget:t,dragSource:s}=e;return t.contains(s.eElement)}destroy(){this.destroyGui(),super.destroy()}destroyGui(){this.guiDestroyFunctions.forEach(e=>e()),this.guiDestroyFunctions.length=0,this.childPillComponents.length=0,Yo(this.getGui()),Yo(this.ePillDropList)}init(e){this.params=e??{},this.createManagedBean(new IS(this.getFocusableElement(),{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.onKeyDown.bind(this)})),this.setupDropTarget(),this.positionableFeature=new DS(this.getGui()),this.createManagedBean(this.positionableFeature),this.refreshGui(),_S(this.ePillDropList,this.getAriaLabel())}onTabKeyDown(e){const t=GS(this.getFocusableElement(),null,!0),s=t.length;if(s===0)return;const{shiftKey:i}=e,r=Xo(this.beans),a=r===t[0],o=r===NS(t);s===1||a&&i||o&&!i||t[i?0:s-1].focus()}onKeyDown(e){const{key:t}=e,s=!this.horizontal;let i=t===ut.DOWN,r=t===ut.UP;if(!s){const o=this.gos.get("enableRtl");i=!o&&t===ut.RIGHT||o&&t===ut.LEFT,r=!o&&t===ut.LEFT||o&&t===ut.RIGHT}if(!i&&!r)return;const a=qi(this.beans,this.getFocusableElement(),!1,r);a&&(e.preventDefault(),a.focus())}addElementClasses(e,t){t=t?`-${t}`:"";const s=this.horizontal?"horizontal":"vertical";e.classList.add(`ag-column-drop${t}`,`ag-column-drop-${s}${t}`)}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),onDragCancel:this.onDragCancel.bind(this),isInterestedIn:this.isInterestedIn.bind(this)},this.beans.dragAndDrop?.addDropTarget(this.dropTarget)}minimumAllowedNewInsertIndex(){return 0}checkInsertIndex(e){const t=this.getNewInsertIndex(e);if(t<0)return!1;const s=this.minimumAllowedNewInsertIndex(),i=Math.max(s,t),r=i!==this.insertIndex;return r&&(this.insertIndex=i),r}getNewInsertIndex(e){const t=e.event,s=this.horizontal?t.clientX:t.clientY,i=this.childPillComponents.map(a=>a.getGui().getBoundingClientRect()),r=i.findIndex(a=>this.horizontal?a.right>s&&a.lefts);if(r===-1){const a=this.gos.get("enableRtl");return i.every(l=>s>(this.horizontal?l.right:l.bottom))?a&&this.horizontal?0:this.childPillComponents.length:i.every(l=>s<(this.horizontal?l.left:l.top))?a&&this.horizontal?this.childPillComponents.length:0:this.insertIndex}return this.insertIndex<=r?r+1:r}checkDragStartedBySelf(e){this.state==="notDragging"&&(this.state="rearrangeItems",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 t=this.getItems(e.dragSource.getDragItem());this.state="newItemsIn";const s=t.filter(r=>this.isItemDroppable(r,e)),i=s.every(r=>this.childPillComponents.map(a=>a.getItem()).indexOf(r)!==-1);if(s.length!==0){if(this.potentialDndItems=s,i){this.state="notDragging";return}this.handleDragEnterEnd(e),this.checkInsertIndex(e),this.refreshGui()}}isPotentialDndItems(){return!!this.potentialDndItems?.length}handleDragLeaveEnd(e){}onDragLeave(e){if(this.state==="rearrangeItems"){const t=this.getItems(e.dragSource.getDragItem());this.removeItems(t)}this.isPotentialDndItems()&&(this.handleDragLeaveEnd(e),this.potentialDndItems=[],this.refreshGui()),this.state="notDragging"}onDragCancel(e){this.isPotentialDndItems()&&(this.state==="newItemsIn"&&this.handleDragLeaveEnd(e),this.potentialDndItems=[],this.refreshGui()),this.state="notDragging"}onDragStop(){this.isPotentialDndItems()&&(this.state==="newItemsIn"?this.addItems(this.potentialDndItems):this.rearrangeItems(this.potentialDndItems),this.potentialDndItems=[],this.refreshGui()),this.state="notDragging"}removeItems(e){const t=this.getExistingItems().filter(s=>!e.includes(s));this.updateItems(t)}addItems(e){if(!e)return;const t=this.getExistingItems().slice(),s=e.filter(i=>t.indexOf(i)<0);qo(t,s,this.insertIndex),this.updateItems(t)}addItem(e){this.insertIndex=this.getExistingItems().length,this.addItems([e]),this.refreshGui()}rearrangeItems(e){const t=this.getNonGhostItems().slice();return qo(t,e,this.insertIndex),LS(t,this.getExistingItems())?!1:(this.updateItems(t),!0)}refreshGui(){const e=this.ePillDropList.scrollTop,t=this.resizeEnabled,s=this.getFocusedItem(),{eGridDiv:i}=this.beans;let r=qi(this.beans,i);r||(r=qi(this.beans,i,!1,!0)),this.toggleResizable(!1),this.destroyGui(),this.addIconAndTitleToGui(),this.addEmptyMessageToGui(),this.addItemsToGui(),this.horizontal||(this.ePillDropList.scrollTop=e),t&&this.toggleResizable(t),OS()&&this.restoreFocus(s,r)}getFocusedItem(){const e=this.getGui(),t=Xo(this.beans);return e.contains(t)?Array.from(e.querySelectorAll(".ag-column-drop-cell")).indexOf(t):-1}restoreFocus(e,t){const s=this.getGui(),i=Array.from(s.querySelectorAll(".ag-column-drop-cell"));if(e===-1)return;i.length===0&&t.focus();const r=Math.min(i.length-1,e),a=i[r];a&&a.focus()}focusList(e){const t=e?this.childPillComponents.length-1:0;this.restoreFocus(t,this.getFocusableElement())}getNonGhostItems(){const e=this.getExistingItems();return this.isPotentialDndItems()?e.filter(t=>!this.potentialDndItems.includes(t)):e}addItemsToGui(){const t=this.getNonGhostItems().map(s=>this.createItemComponent(s,!1));if(this.isPotentialDndItems()){const s=this.potentialDndItems.map(i=>this.createItemComponent(i,!0));this.insertIndex>=t.length?t.push(...s):t.splice(this.insertIndex,0,...s)}this.appendChild(this.ePillDropList),t.forEach((s,i)=>{i>0&&this.addArrow(this.ePillDropList),this.ePillDropList.appendChild(s.getGui())}),this.addAriaLabelsToComponents()}addAriaLabelsToComponents(){this.childPillComponents.forEach((e,t)=>{const s=e.getGui();VS(s,t+1),zS(s,this.childPillComponents.length)})}createItemComponent(e,t){const s=this.createPillComponent(e,this.dropTarget,t,this.horizontal);return s.addEventListener("columnRemove",this.removeItems.bind(this,[e])),this.createBean(s),this.guiDestroyFunctions.push(()=>this.destroyBean(s)),t||this.childPillComponents.push(s),s}addIconAndTitleToGui(){const{title:e,icon:t}=this.params;if(!e||!t)return;const s=document.createElement("div");if(BS(s,!0),this.addElementClasses(s,"title-bar"),this.addElementClasses(t,"icon"),this.addOrRemoveCssClass("ag-column-drop-empty",this.isExistingItemsEmpty()),s.appendChild(t),!this.horizontal){const i=document.createElement("span");this.addElementClasses(i,"title"),i.innerHTML=e,s.appendChild(i)}this.appendChild(s)}isExistingItemsEmpty(){return this.getExistingItems().length===0}addEmptyMessageToGui(){const{emptyMessage:e}=this.params;if(!e||!this.isExistingItemsEmpty()||this.isPotentialDndItems())return;const t=document.createElement("span");t.innerHTML=e,this.addElementClasses(t,"empty-message"),this.ePillDropList.appendChild(t)}addArrow(e){if(this.horizontal){const t=this.gos.get("enableRtl"),s=kS(t?"panelDelimiterRtl":"panelDelimiter",this.beans);this.addElementClasses(s,"cell-separator"),e.appendChild(s)}}};import{Component as KS,DragSourceType as WS,KeyCode as Es,RefPlaceholder as jS,_loadTemplate as $S}from"ag-grid-community";import{Component as YS,KeyCode as XS,RefPlaceholder as Zi,TouchListener as qS,_createIconNoSpan as Jo,_escapeString as ZS,_setAriaLabel as JS,_setDisplayed as QS}from"ag-grid-community";var Qo=class extends YS{constructor(e,t,s,i,r){super(),this.dragSourceDropTarget=e,this.ghost=t,this.horizontal=s,this.template=i,this.agComponents=r,this.eText=Zi,this.eDragHandle=Zi,this.eButton=Zi}postConstruct(){this.setTemplate(this.template??` `,this.agComponents);const e=this.getGui(),{beans:t,eDragHandle:s,eText:i,eButton:r}=this;this.addElementClasses(e),this.addElementClasses(s,"drag-handle"),this.addElementClasses(i,"text"),this.addElementClasses(r,"button"),s.appendChild(Jo("columnDrag",t)),r.appendChild(Jo("cancel",t)),this.tooltipFeature=this.createOptionalManagedBean(t.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui()})),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.getLocaleTextFunc(),t=[this.getAriaDisplayName()];this.addAdditionalAriaInstructions(t,e),JS(this.getGui(),t.join(". "))}addAdditionalAriaInstructions(e,t){if(this.isRemovable()){const s=t("ariaDropZoneColumnComponentDescription","Press DELETE to remove");e.push(s)}}setupTooltip(){const e=()=>this.tooltipFeature?.setTooltipAndRefresh(this.getTooltip());e(),this.addManagedEventListeners({newColumnsLoaded:e})}getDragSourceId(){}getDefaultIconName(){return"notAllowed"}addDragSource(){const{beans:{dragAndDrop:e},eDragHandle:t}=this,s=this.createGetDragItem(),i=this.getDefaultIconName(),r={type:this.getDragSourceType(),sourceId:this.getDragSourceId(),eElement:t,getDefaultIconName:()=>i,getDragItem:s,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(){QS(this.eButton,this.isRemovable())}setupRemove(){this.refreshRemove();const e={type:"columnRemove"};this.addGuiEventListener("keydown",s=>this.onKeyDown(s)),this.addManagedElementListeners(this.eButton,{click:s=>{this.dispatchLocalEvent(e),s.stopPropagation()}});const t=new qS(this.eButton);this.addManagedListeners(t,{tap:()=>this.dispatchLocalEvent(e)}),this.addDestroyFunc(t.destroy.bind(t))}onKeyDown(e){e.key===XS.DELETE&&this.isRemovable()&&(e.preventDefault(),this.dispatchLocalEvent({type:"columnRemove"}))}getDisplayValue(){return this.getDisplayName()}setTextValue(){const e=this.getDisplayValue(),t=ZS(e);this.eText.innerHTML=t}addElementClasses(e,t){t=t?`-${t}`:"";const s=this.horizontal?"horizontal":"vertical";e.classList.add(`ag-column-drop-cell${t}`,`ag-column-drop-${s}-cell${t}`)}destroy(){super.destroy(),this.dragSourceDropTarget=null}},eb=class extends Qo{constructor(e,t,s,i,r){super(t,s,r),this.column=e,this.dropZonePurpose=i,this.eSortIndicator=jS,this.popupShowing=!1}postConstruct(){const{sortSvc:e,colNames:t}=this.beans;this.template=` ${e?'':""} `,e&&(this.agComponents=[e.getSortIndicatorSelector()]),this.displayName=t.getDisplayNameForColumn(this.column,"columnDrop"),super.postConstruct(),e&&(this.setupSort(),this.addManagedEventListeners({sortChanged:()=>{this.setupAria()}})),this.isGroupingZone()&&this.addManagedPropertyListener("groupLockGroupColumns",()=>{this.refreshRemove(),this.refreshDraggable(),this.setupAria()})}getItem(){return this.column}getDisplayName(){return this.displayName}getTooltip(){return this.column.getColDef().headerTooltip}addAdditionalAriaInstructions(e,t){const s=this.gos.get("rowGroupPanelSuppressSort"),i=this.gos.get("functionsReadOnly");if(this.isAggregationZone()&&!i){const r=t("ariaDropZoneColumnValueItemDescription","Press ENTER to change the aggregation type");e.push(r)}if(this.isGroupingZone()&&this.column.isSortable()&&!s){const r=t("ariaDropZoneColumnGroupItemDescription","Press ENTER to sort");e.push(r)}super.addAdditionalAriaInstructions(e,t)}isDraggable(){return this.isReadOnly()}isRemovable(){return this.isReadOnly()}isReadOnly(){return!this.isGroupingAndLocked()&&!this.gos.get("functionsReadOnly")}getAriaDisplayName(){const e=this.getLocaleTextFunc(),{name:t,aggFuncName:s}=this.getColumnAndAggFuncName(),i=e("ariaDropZoneColumnComponentAggFuncSeparator"," of "),r={asc:e("ariaDropZoneColumnComponentSortAscending","ascending"),desc:e("ariaDropZoneColumnComponentSortDescending","descending")},a=this.column.getSort(),o=this.gos.get("rowGroupPanelSuppressSort");return[s&&`${s}${i}`,t,this.isGroupingZone()&&!o&&a&&`, ${r[a]}`].filter(n=>!!n).join("")}getColumnAndAggFuncName(){const e=this.displayName;let t="";if(this.isAggregationZone()){const s=this.column.getAggFunc(),i=typeof s=="string"?s:"agg";t=this.getLocaleTextFunc()(i,i)}return{name:e,aggFuncName:t}}setupSort(){if(!(!this.column.isSortable()||!this.isGroupingZone())&&!this.gos.get("rowGroupPanelSuppressSort")){this.eSortIndicator.setupSort(this.column,!0);const e=t=>{t.preventDefault(),this.beans.sortSvc.progressSortFromEvent(this.column,t)};this.addGuiEventListener("click",e),this.addGuiEventListener("keydown",t=>{t.key===Es.ENTER&&this.isGroupingZone()&&e(t)})}}getDefaultIconName(){return"hide"}createGetDragItem(){const{column:e}=this;return()=>{const t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t}}}setupComponents(){super.setupComponents(),this.isAggregationZone()&&!this.gos.get("functionsReadOnly")&&this.addGuiEventListener("click",this.onShowAggFuncSelection.bind(this))}onKeyDown(e){super.onKeyDown(e),e.key===Es.ENTER&&this.isAggregationZone()&&!this.gos.get("functionsReadOnly")&&(e.preventDefault(),this.onShowAggFuncSelection())}getDisplayValue(){const{name:e,aggFuncName:t}=this.getColumnAndAggFuncName();return this.isAggregationZone()?`${t}(${e})`:e}onShowAggFuncSelection(){if(this.popupShowing)return;this.popupShowing=!0;const{aggFuncSvc:e,popupSvc:t}=this.beans,s=new lt({cssIdentifier:"select-agg-func"}),i=e.getFuncNames(this.column),r=this.getGui(),a=s.getGui();s.setModel({getRow:function(u){return i[u]},getRowCount:function(){return i.length}}),this.createBean(s);const o=$S('
');o.style.top="0px",o.style.left="0px",o.appendChild(a),o.style.width=`${r.clientWidth}px`;const[n]=this.addManagedElementListeners(o,{focusout:u=>{!o.contains(u.relatedTarget)&&d&&d.hideFunc()}}),l=u=>{this.destroyBean(s),this.popupShowing=!1,u?.key==="Escape"&&r.focus(),n&&n()},c=this.getLocaleTextFunc(),d=t.addPopup({modal:!0,eChild:o,closeOnEsc:!0,closedCallback:l,ariaLabel:c("ariaLabelAggregationFunction","Aggregation Function")});d&&s.setComponentCreator(this.createAggSelect.bind(this,d.hideFunc)),s.addGuiEventListener("keydown",u=>{if(u.key===Es.ENTER||u.key===Es.SPACE){const p=s.getLastFocusedRow();if(p==null)return;const g=s.getComponentAt(p);g&&g.selectItem()}}),t.positionPopupByComponent({type:"aggFuncSelect",eventSource:r,ePopup:o,keepWithinBounds:!0,column:this.column,position:"under"}),s.refresh();let h=i.findIndex(u=>u===this.column.getAggFunc());h===-1&&(h=0),s.focusRow(h)}createAggSelect(e,t){const s=()=>{e(),this.getGui().focus(),this.beans.valueColsSvc?.setColumnAggFunc?.(this.column,t,"toolPanelDragAndDrop")},i=this.getLocaleTextFunc(),r=t.toString(),a=i(r,r);return new tb(s,a)}isGroupingAndLocked(){return this.isGroupingZone()&&Ot(this.column,this.beans)}isAggregationZone(){return this.dropZonePurpose==="aggregation"}isGroupingZone(){return this.dropZonePurpose==="rowGroup"}getDragSourceType(){return WS.ToolPanel}destroy(){super.destroy(),this.column=null}},tb=class extends KS{constructor(e,t){super('
'),this.selectItem=e,this.getGui().innerText=t,this.addGuiEventListener("click",this.selectItem)}},Ji=class extends Zo{constructor(e,t){super(e),this.dropZonePurpose=t,this.addElementClasses(this.getGui(),this.dropZonePurpose.toLowerCase())}init(e){super.init(e),this.addManagedEventListeners({newColumnsLoaded:this.refreshGui.bind(this)}),this.addManagedPropertyListeners(["functionsReadOnly","rowGroupPanelSuppressSort","groupLockGroupColumns"],this.refreshGui.bind(this))}getItems(e){return e.columns??[]}isInterestedIn(e){return e===$o.HeaderCell||e===$o.ToolPanel}minimumAllowedNewInsertIndex(){const{gos:e,rowGroupColsSvc:t}=this.beans,s=e.get("groupLockGroupColumns"),i=t?.columns.length??0;return s===-1?i:Math.min(s,i)}showOrHideColumnOnExit(e){return this.isRowGroupPanel()&&RS(this.gos,!0)&&!e.fromNudge}handleDragEnterEnd(e){if(this.showOrHideColumnOnExit(e)){const i=e.dragSource.getDragItem().columns;this.setColumnsVisible(i,!1,"uiColumnDragged")}}handleDragLeaveEnd(e){if(this.showOrHideColumnOnExit(e)){const s=e.dragSource.getDragItem();this.setColumnsVisible(s.columns,!0,"uiColumnDragged")}}setColumnsVisible(e,t,s){if(e){const i=e.filter(r=>!r.getColDef().lockVisible);this.beans.colModel.setColsVisible(i,t,s)}}isRowGroupPanel(){return this.dropZonePurpose==="rowGroup"}createPillComponent(e,t,s,i){return new eb(e,t,s,this.dropZonePurpose,i)}},en=class extends Ji{constructor(e){super(e,"pivot")}postConstruct(){const e=this.getLocaleTextFunc(),t=e("pivotColumnsEmptyMessage","Drag here to set column labels"),s=e("pivots","Column Labels");super.init({icon:AS("pivotPanel",this.beans,null),emptyMessage:t,title:s}),this.addManagedEventListeners({newColumnsLoaded:this.refresh.bind(this),columnPivotChanged:this.refresh.bind(this),columnPivotModeChanged:this.checkVisibility.bind(this)}),this.refresh()}getAriaLabel(){return this.getLocaleTextFunc()("ariaPivotDropZonePanelLabel","Column Labels")}refresh(){this.checkVisibility(),this.refreshGui()}checkVisibility(){const e=this.beans.colModel,t=e.isPivotMode();if(this.horizontal)switch(this.gos.get("pivotPanelShow")){case"always":this.setDisplayed(t);break;case"onlyWhenPivoting":{const s=e.isPivotActive();this.setDisplayed(t&&s);break}default:this.setDisplayed(!1);break}else this.setDisplayed(t)}isItemDroppable(e,t){return this.gos.get("functionsReadOnly")||!e.isPrimary()?!1:e.isAllowPivot()&&(!e.isPivotActive()||this.isSourceEventFromTarget(t))}updateItems(e){this.beans.pivotColsSvc?.setColumns(e,"toolPanelUi")}getIconName(){return this.isPotentialDndItems()?"pivot":"notAllowed"}getExistingItems(){return this.beans.pivotColsSvc?.columns??[]}};import{_createIconNoSpan as sb}from"ag-grid-community";var tn=class extends Ji{constructor(e){super(e,"rowGroup")}postConstruct(){const e=this.getLocaleTextFunc(),t=e("rowGroupColumnsEmptyMessage","Drag here to set row groups"),s=e("groups","Row Groups");super.init({icon:sb("rowGroupPanel",this.beans,null),emptyMessage:t,title:s}),this.addManagedEventListeners({columnRowGroupChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.getLocaleTextFunc()("ariaRowGroupDropZonePanelLabel","Row Groups")}isItemDroppable(e,t){return this.gos.get("functionsReadOnly")||!e.isPrimary()||e.colDef.showRowGroup?!1:e.isAllowRowGroup()&&(!e.isRowGroupActive()||this.isSourceEventFromTarget(t))}updateItems(e){this.beans.rowGroupColsSvc?.setColumns(e,"toolPanelUi")}getIconName(){return this.isPotentialDndItems()?"group":"notAllowed"}getExistingItems(){return this.beans.rowGroupColsSvc?.columns??[]}};import{_createIconNoSpan as ib}from"ag-grid-community";var rb=class extends Ji{constructor(e){super(e,"aggregation")}postConstruct(){const e=this.getLocaleTextFunc(),t=e("valueColumnsEmptyMessage","Drag here to aggregate"),s=e("values","Values");super.init({icon:ib("valuePanel",this.beans,null),emptyMessage:t,title:s}),this.addManagedEventListeners({columnValueChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.getLocaleTextFunc()("ariaValuesDropZonePanelLabel","Values")}getIconName(){return this.isPotentialDndItems()?"aggregate":"notAllowed"}isItemDroppable(e,t){return this.gos.get("functionsReadOnly")||!e.isPrimary()?!1:e.isAllowValue()&&(!e.isValueActive()||this.isSourceEventFromTarget(t))}updateItems(e){this.beans.valueColsSvc?.setColumns(e,"toolPanelUi")}getExistingItems(){return this.beans.valueColsSvc?.columns??[]}};import{AgToggleButtonSelector as ab,Component as ob,RefPlaceholder as nb}from"ag-grid-community";var lb=class extends ob{constructor(){super(...arguments),this.cbPivotMode=nb}createTemplate(){return`
`}postConstruct(){this.setTemplate(this.createTemplate(),[ab]);const e=this.cbPivotMode,{colModel:t,ctrlsSvc:s,gos:i}=this.beans;e.setValue(t.isPivotMode());const r=this.getLocaleTextFunc();e.setLabel(r("pivotMode","Pivot Mode"));const a=()=>{const n=!!e.getValue();n!==t.isPivotMode()&&(i.updateGridOptions({options:{pivotMode:n},source:"toolPanelUi"}),s.getHeaderRowContainerCtrls().forEach(l=>l.refresh()))},o=()=>{const n=t.isPivotMode();e.setValue(n)};this.addManagedListeners(e,{fieldValueChanged:a}),this.addManagedEventListeners({newColumnsLoaded:o,columnPivotModeChanged:o})}},cb=class extends FS{constructor(){super(...arguments),this.beanName="colToolPanelFactory"}setPanelVisible(e,t,s){return e?e.setDisplayed(t):t&&(e=s()),e}createRowGroupPanel(e,t){return this.createPanel(e,t,new tn(!1))}createValuesPanel(e,t){return this.createPanel(e,t,new rb(!1))}createPivotPanel(e,t){return this.createPanel(e,t,new en(!1))}createPivotModePanel(e,t,s){return this.createPanel(e,t,new lb,s)}createPanel(e,t,s,i){return s=e.createBean(s),t.push(()=>e.destroyBean(s)),i?e.prependChild(s):e.appendChild(s),s}},sn={moduleName:"ColumnsToolPanel",version:R,beans:[cb],userComponents:{agColumnsToolPanel:PS},icons:{columnsToolPanel:"columns",menuAddRowGroup:"group",menuRemoveRowGroup:"group",pivotPanel:"pivot",rowGroupPanel:"group",valuePanel:"aggregation",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate"},dependsOn:[G,Ps,YC,qC,XC,As]};import{_ColumnMoveModule as db,_PopupModule as hb,_SharedDragAndDropModule as ub,_SharedMenuModule as pb}from"ag-grid-community";import{BeanStub as gb,_createIconNoSpan as rn,_warn as an}from"ag-grid-community";var mb=class extends gb{constructor(){super(...arguments),this.beanName="chartMenuItemMapper"}getChartItems(e){const t=this.beans,s=t.chartSvc,i=e==="pivotChart";if(!s)return null;const r=this.getLocaleTextFunc.bind(this),a=i?new fb(t,s,r):new Cb(t,s,r),o=s.isEnterprise();let n=a.getMenuItem();if(n&&n.subMenu&&!o){const c=d=>({...d,subMenu:d.subMenu?.filter(h=>!h._enterprise).map(h=>c(h))});n=c(n)}const l=this.gos.get("chartToolPanelsDef")?.settingsPanel?.chartGroupsDef;return l&&(n=this.filterAndOrderChartMenu(n,l,a.getConfigLookup())),this.cleanInternals(n)}cleanInternals(e){if(!e)return e;const t=s=>(delete s?._key,delete s?._enterprise,s?.subMenu?.forEach(i=>t(i)),s);return t(e)}buildLookup(e){const t={},s=i=>{t[i._key]=i,i.subMenu&&i.subMenu.forEach(r=>s(r))};return s(e),t}filterAndOrderChartMenu(e,t,s){const i=this.buildLookup(e),r={...e,subMenu:[]};for(const a of Object.keys(t)){const o=t[a],n=s[a];if(n===null)continue;if(n==null){an(173,{group:a});continue}const l=i[n._key];if(l)if(l.subMenu){const c=o.map(d=>{const h=n[d];if(h==null){an(174,{group:a,chartType:d});return}return i[h]}).filter(d=>d!==void 0);c.length>0&&(l.subMenu=c,r.subMenu?.push(l))}else r.subMenu?.push(l)}return r.subMenu?.length==0?null:r}},fb=class{constructor(e,t,s){this.beans=e,this.chartSvc=t,this.getLocaleTextFunc=s}getMenuItem(){const e=this.getLocaleTextFunc(),t=(s,i,r,a,o=!1)=>({name:e(s,i),action:()=>this.chartSvc.createPivotChart({chartType:r}),_key:a,_enterprise:o});return{name:e("pivotChart","Pivot Chart"),_key:"pivotChart",subMenu:[{_key:"pivotColumnChart",name:e("columnChart","Column"),subMenu:[t("groupedColumn","Grouped‎","groupedColumn","pivotGroupedColumn"),t("stackedColumn","Stacked‎","stackedColumn","pivotStackedColumn"),t("normalizedColumn","100% Stacked‎","normalizedColumn","pivotNormalizedColumn")]},{_key:"pivotBarChart",name:e("barChart","Bar"),subMenu:[t("groupedBar","Grouped‎","groupedBar","pivotGroupedBar"),t("stackedBar","Stacked‎","stackedBar","pivotStackedBar"),t("normalizedBar","100% Stacked‎","normalizedBar","pivotNormalizedBar")]},{_key:"pivotPieChart",name:e("pieChart","Pie"),subMenu:[t("pie","Pie‎","pie","pivotPie"),t("donut","Donut‎","donut","pivotDonut")]},{_key:"pivotLineChart",name:e("lineChart","Line"),subMenu:[t("lineChart","Line‎","line","pivotLineChart"),t("stackedLine","Stacked‎","stackedLine","pivotStackedLine"),t("normalizedLine","100% Stacked‎","normalizedLine","pivotNormalizedLine")]},{_key:"pivotAreaChart",name:e("areaChart","Area"),subMenu:[t("areaChart","Area‎","area","pivotArea"),t("stackedArea","Stacked‎","stackedArea","pivotStackedArea"),t("normalizedArea","100% Stacked‎","normalizedArea","pivotNormalizedArea")]},{_key:"pivotXYChart",name:e("xyChart","X Y (Scatter)"),subMenu:[t("scatter","Scatter‎","scatter","pivotScatter"),t("bubble","Bubble‎","bubble","pivotBubble")]},{_key:"pivotStatisticalChart",_enterprise:!1,name:e("statisticalChart","Statistical"),subMenu:[t("histogramChart","Histogram‎","histogram","pivotHistogram",!1)]},{_key:"pivotHierarchicalChart",_enterprise:!0,name:e("hierarchicalChart","Hierarchical"),subMenu:[t("treemapChart","Treemap‎","treemap","pivotTreemap",!0),t("sunburstChart","Sunburst‎","sunburst","pivotSunburst",!0)]},{_key:"pivotFunnel",name:e("funnel","Funnel"),subMenu:[t("funnel","Funnel‎","funnel","pivotFunnel"),t("coneFunnel","Cone Funnel‎","coneFunnel","pivotConeFunnel"),t("pyramid","Pyramid‎","pyramid","pivotPyramid")]},{_key:"pivotCombinationChart",name:e("combinationChart","Combination"),subMenu:[t("columnLineCombo","Column & Line‎","columnLineCombo","pivotColumnLineCombo"),t("AreaColumnCombo","Area & Column‎","areaColumnCombo","pivotAreaColumnCombo")]}],icon:rn("chart",this.beans,void 0)}}getConfigLookup(){return{columnGroup:{_key:"pivotColumnChart",column:"pivotGroupedColumn",stackedColumn:"pivotStackedColumn",normalizedColumn:"pivotNormalizedColumn"},barGroup:{_key:"pivotBarChart",bar:"pivotGroupedBar",stackedBar:"pivotStackedBar",normalizedBar:"pivotNormalizedBar"},pieGroup:{_key:"pivotPieChart",pie:"pivotPie",donut:"pivotDonut",doughnut:"pivotDonut"},lineGroup:{_key:"pivotLineChart",line:"pivotLineChart",stackedLine:"pivotStackedLine",normalizedLine:"pivotNormalizedLine"},areaGroup:{_key:"pivotAreaChart",area:"pivotArea",stackedArea:"pivotStackedArea",normalizedArea:"pivotNormalizedArea"},scatterGroup:{_key:"pivotXYChart",bubble:"pivotBubble",scatter:"pivotScatter"},combinationGroup:{_key:"pivotCombinationChart",columnLineCombo:"pivotColumnLineCombo",areaColumnCombo:"pivotAreaColumnCombo",customCombo:null},hierarchicalGroup:{_key:"pivotHierarchicalChart",treemap:"pivotTreemap",sunburst:"pivotSunburst"},statisticalGroup:{_key:"pivotStatisticalChart",histogram:"pivotHistogram",rangeBar:null,rangeArea:null,boxPlot:null},funnelGroup:{_key:"pivotFunnel",funnel:"pivotFunnel",coneFunnel:"pivotConeFunnel",pyramid:"pivotPyramid"},polarGroup:null,specializedGroup:null}}},Cb=class{constructor(e,t,s){this.beans=e,this.chartSvc=t,this.getLocaleTextFunc=s}getMenuItem(){const e=this.getLocaleTextFunc(),t=(s,i,r,a,o=!1)=>({name:e(s,i),action:()=>this.chartSvc.createChartFromCurrentRange(r),_key:a,_enterprise:o});return{name:e("chartRange","Chart Range"),_key:"chartRange",subMenu:[{name:e("columnChart","Column"),subMenu:[t("groupedColumn","Grouped‎","groupedColumn","rangeGroupedColumn"),t("stackedColumn","Stacked‎","stackedColumn","rangeStackedColumn"),t("normalizedColumn","100% Stacked‎","normalizedColumn","rangeNormalizedColumn")],_key:"rangeColumnChart"},{name:e("barChart","Bar"),subMenu:[t("groupedBar","Grouped‎","groupedBar","rangeGroupedBar"),t("stackedBar","Stacked‎","stackedBar","rangeStackedBar"),t("normalizedBar","100% Stacked‎","normalizedBar","rangeNormalizedBar")],_key:"rangeBarChart"},{name:e("pieChart","Pie"),subMenu:[t("pie","Pie‎","pie","rangePie"),t("donut","Donut‎","donut","rangeDonut")],_key:"rangePieChart"},{name:e("lineChart","Line"),subMenu:[t("lineChart","Line‎","line","rangeLineChart"),t("stackedLine","Stacked‎","stackedLine","rangeStackedLine"),t("normalizedLine","100% Stacked‎","normalizedLine","rangeNormalizedLine")],_key:"rangeLineChart"},{name:e("areaChart","Area"),subMenu:[t("areaChart","Area‎","area","rangeArea"),t("stackedArea","Stacked‎","stackedArea","rangeStackedArea"),t("normalizedArea","100% Stacked‎","normalizedArea","rangeNormalizedArea")],_key:"rangeAreaChart"},{name:e("xyChart","X Y (Scatter)"),subMenu:[t("scatter","Scatter‎","scatter","rangeScatter"),t("bubble","Bubble‎","bubble","rangeBubble")],_key:"rangeXYChart"},{name:e("polarChart","Polar"),subMenu:[t("radarLine","Radar Line‎","radarLine","rangeRadarLine"),t("radarArea","Radar Area‎","radarArea","rangeRadarArea"),t("nightingale","Nightingale‎","nightingale","rangeNightingale"),t("radialColumn","Radial Column‎","radialColumn","rangeRadialColumn"),t("radialBar","Radial Bar‎","radialBar","rangeRadialBar")],_key:"rangePolarChart",_enterprise:!0},{name:e("statisticalChart","Statistical"),subMenu:[t("boxPlot","Box Plot‎","boxPlot","rangeBoxPlot",!0),t("histogramChart","Histogram‎","histogram","rangeHistogram",!1),t("rangeBar","Range Bar‎","rangeBar","rangeRangeBar",!0),t("rangeArea","Range Area‎","rangeArea","rangeRangeArea",!0)],_key:"rangeStatisticalChart",_enterprise:!1},{name:e("hierarchicalChart","Hierarchical"),subMenu:[t("treemap","Treemap‎","treemap","rangeTreemap"),t("sunburst","Sunburst‎","sunburst","rangeSunburst")],_key:"rangeHierarchicalChart",_enterprise:!0},{name:e("specializedChart","Specialized"),subMenu:[t("heatmap","Heatmap‎","heatmap","rangeHeatmap"),t("waterfall","Waterfall‎","waterfall","rangeWaterfall")],_key:"rangeSpecializedChart",_enterprise:!0},{name:e("funnel","Funnel"),subMenu:[t("funnel","Funnel‎","funnel","rangeFunnel"),t("coneFunnel","Cone Funnel‎","coneFunnel","rangeConeFunnel"),t("pyramid","Pyramid‎","pyramid","rangePyramid")],_key:"rangeFunnel",_enterprise:!0},{name:e("combinationChart","Combination"),subMenu:[t("columnLineCombo","Column & Line‎","columnLineCombo","rangeColumnLineCombo"),t("AreaColumnCombo","Area & Column‎","areaColumnCombo","rangeAreaColumnCombo")],_key:"rangeCombinationChart"}],icon:rn("chart",this.beans,void 0)}}getConfigLookup(){return{columnGroup:{_key:"rangeColumnChart",column:"rangeGroupedColumn",stackedColumn:"rangeStackedColumn",normalizedColumn:"rangeNormalizedColumn"},barGroup:{_key:"rangeBarChart",bar:"rangeGroupedBar",stackedBar:"rangeStackedBar",normalizedBar:"rangeNormalizedBar"},pieGroup:{_key:"rangePieChart",pie:"rangePie",donut:"rangeDonut",doughnut:"rangeDonut"},lineGroup:{_key:"rangeLineChart",line:"rangeLineChart",stackedLine:"rangeStackedLine",normalizedLine:"rangeNormalizedLine"},areaGroup:{_key:"rangeAreaChart",area:"rangeArea",stackedArea:"rangeStackedArea",normalizedArea:"rangeNormalizedArea"},scatterGroup:{_key:"rangeXYChart",bubble:"rangeBubble",scatter:"rangeScatter"},polarGroup:{_key:"rangePolarChart",radarLine:"rangeRadarLine",radarArea:"rangeRadarArea",nightingale:"rangeNightingale",radialColumn:"rangeRadialColumn",radialBar:"rangeRadialBar"},statisticalGroup:{_key:"rangeStatisticalChart",boxPlot:"rangeBoxPlot",histogram:"rangeHistogram",rangeBar:"rangeRangeBar",rangeArea:"rangeRangeArea"},hierarchicalGroup:{_key:"rangeHierarchicalChart",treemap:"rangeTreemap",sunburst:"rangeSunburst"},specializedGroup:{_key:"rangeSpecializedChart",heatmap:"rangeHeatmap",waterfall:"rangeWaterfall"},funnelGroup:{_key:"rangeFunnel",funnel:"rangeFunnel",coneFunnel:"rangeConeFunnel",pyramid:"rangePyramid"},combinationGroup:{_key:"rangeCombinationChart",columnLineCombo:"rangeColumnLineCombo",areaColumnCombo:"rangeAreaColumnCombo",customCombo:null}}}};import{BeanStub as vb,_addGridCommonParams as yb,_findNextFocusableElement as Sb}from"ag-grid-community";var bb=class extends vb{constructor(){super(...arguments),this.beanName="colChooserFactory"}createColumnSelectPanel(e,t,s,i){const r=e.createManagedBean(new jo),a=i??t?.getColDef().columnChooserParams??{},{contractColumnSelection:o,suppressColumnExpandAll:n,suppressColumnFilter:l,suppressColumnSelectAll:c,suppressSyncLayoutWithGrid:d,columnLayout:h}=a;return r.init(!!s,yb(this.gos,{suppressColumnMove:!1,suppressValues:!1,suppressPivots:!1,suppressRowGroups:!1,suppressPivotMode:!1,contractColumnSelection:!!o,suppressColumnExpandAll:!!n,suppressColumnFilter:!!l,suppressColumnSelectAll:!!c,suppressSyncLayoutWithGrid:!!h||!!d,onStateUpdated:()=>{}}),"columnMenu"),h&&r.setColumnLayout(h),r}showColumnChooser({column:e,chooserParams:t,eventSource:s,headerPosition:i}){this.hideActiveColumnChooser();const r=this.createColumnSelectPanel(this,e,!0,t),a=this.getLocaleTextFunc(),o=this.beans,{visibleCols:n,focusSvc:l,menuUtils:c}=o,d=n.allCols.indexOf(e),h=e?l.focusedHeader??i??null:null;this.activeColumnChooserDialog=this.createBean(new At({title:a("chooseColumns","Choose Columns"),component:r,width:300,height:300,resizable:!0,movable:!0,centered:!0,closable:!0,afterGuiAttached:()=>{Sb(o,r.getGui())?.focus({preventScroll:!0}),this.dispatchVisibleChangedEvent(!0,e)},closedCallback:u=>{const p=this.activeColumnChooser.getGui();this.destroyBean(this.activeColumnChooser),this.activeColumnChooser=void 0,this.activeColumnChooserDialog=void 0,this.dispatchVisibleChangedEvent(!1,e),e&&c.restoreFocusOnClose({column:e,headerPosition:h,columnIndex:d,eventSource:s},p,u,!0)},postProcessPopupParams:{type:"columnChooser",column:e,eventSource:s}})),this.activeColumnChooser=r}hideActiveColumnChooser(){this.destroyBean(this.activeColumnChooserDialog)}dispatchVisibleChangedEvent(e,t){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:"columnChooser",column:t??null})}};import{BeanStub as wb,_addGridCommonParams as xb,_isClientSideRowModel as Tb,_isLegacyMenuEnabled as Mb}from"ag-grid-community";import{BeanStub as Pb,_createIconNoSpan as U,_escapeString as Qi,_exists as Fb,_getRowNode as Ab,_resetColumnState as Rb,_warn as Eb}from"ag-grid-community";var je="separator";function on(e,t){if(e)for(let s=e.length-2;s>=0;s--){const i=e[s]===t,r=e[s+1]===t;i&&r&&e.splice(s+1,1)}}var Ib=class extends Pb{constructor(){super(...arguments),this.beanName="menuItemMapper"}mapWithStockItems(e,t,s,i){if(!e)return[];const r=[],a=this.getLocaleTextFunc(),{beans:o,gos:n}=this,{validation:l,pinnedCols:c,colAutosize:d,aggFuncSvc:h,rowGroupColsSvc:u,colNames:p,colModel:g,clipboardSvc:m,expansionSvc:C,focusSvc:f,csvCreator:v,excelCreator:y,menuSvc:x,colChooserFactory:S,sortSvc:w,chartMenuItemMapper:T,valueColsSvc:P}=o,F=(A,M,L,I)=>{switch(l?.validateMenuItem(A),A){case"pinSubMenu":return c&&M?{name:a("pinColumn","Pin Column"),icon:U("menuPin",o,null),subMenu:["clearPinned","pinLeft","pinRight"]}:null;case"pinLeft":return c&&M?{name:a("pinLeft","Pin Left"),action:()=>c.setColsPinned([M],"left",I),checked:!!M&&M.isPinnedLeft()}:null;case"pinRight":return c&&M?{name:a("pinRight","Pin Right"),action:()=>c.setColsPinned([M],"right",I),checked:!!M&&M.isPinnedRight()}:null;case"clearPinned":return c&&M?{name:a("noPin","No Pin"),action:()=>c.setColsPinned([M],null,I),checked:!!M&&!M.isPinned()}:null;case"valueAggSubMenu":return h&&P&&(M?.isPrimary()||M?.getColDef().pivotValueColumn)?{name:a("valueAggregation","Value Aggregation"),icon:U("menuValue",o,null),subMenu:Db(M,h,P,a),disabled:n.get("functionsReadOnly")}:null;case"autoSizeThis":return d?{name:a("autosizeThisColumn","Autosize This Column"),action:()=>d.autoSizeColumn(M,I,n.get("skipHeaderOnAutoSize"))}:null;case"autoSizeAll":return d?{name:a("autosizeAllColumns","Autosize All Columns"),action:()=>d.autoSizeAllColumns(I,n.get("skipHeaderOnAutoSize"))}:null;case"rowGroup":return u?{name:a("groupBy","Group by")+" "+Qi(p.getDisplayNameForColumn(M,"header")),disabled:n.get("functionsReadOnly")||M?.isRowGroupActive()||!M?.getColDef().enableRowGroup,action:()=>u.addColumns([M],I),icon:U("menuAddRowGroup",o,null)}:null;case"rowUnGroup":if(u&&n.isModuleRegistered("SharedRowGrouping")){const D=M?.getColDef().showRowGroup,E=n.get("groupLockGroupColumns");let k,V,ne;if(D===!0)k=a("ungroupAll","Un-Group All"),V=n.get("functionsReadOnly")||E===-1||E>=(u.columns.length??0),ne=()=>u.setColumns(u.columns.slice(0,E),I);else if(typeof D=="string"){const he=g.getColDefCol(D),le=he!=null?Qi(p.getDisplayNameForColumn(he,"header")):D;k=a("ungroupBy","Un-Group by")+" "+le,V=n.get("functionsReadOnly")||Ot(he,o),ne=()=>{u.removeColumns([D],I)}}else k=a("ungroupBy","Un-Group by")+" "+Qi(p.getDisplayNameForColumn(M,"header")),V=n.get("functionsReadOnly")||!M?.isRowGroupActive()||!M?.getColDef().enableRowGroup||Ot(M,o),ne=()=>u.removeColumns([M],I);return{name:k,disabled:V,action:ne,icon:U("menuRemoveRowGroup",o,null)}}else return null;case"resetColumns":return{name:a("resetColumns","Reset Columns"),action:()=>Rb(o,I)};case"expandAll":return C?{name:a("expandAll","Expand All Row Groups"),action:()=>C.expandAll(!0)}:null;case"contractAll":return C?{name:a("collapseAll","Collapse All Row Groups"),action:()=>C.expandAll(!1)}:null;case"copy":return m?{name:a("copy","Copy"),shortcut:a("ctrlC","Ctrl+C"),icon:U("clipboardCopy",o,null),action:()=>m.copyToClipboard()}:null;case"copyWithHeaders":return m?{name:a("copyWithHeaders","Copy with Headers"),icon:U("clipboardCopy",o,null),action:()=>m.copyToClipboard({includeHeaders:!0})}:null;case"copyWithGroupHeaders":return m?{name:a("copyWithGroupHeaders","Copy with Group Headers"),icon:U("clipboardCopy",o,null),action:()=>m.copyToClipboard({includeHeaders:!0,includeGroupHeaders:!0})}:null;case"cut":if(m){const D=f.getFocusedCell(),E=D?Ab(o,D):null,k=E?D?.column.isCellEditable(E):!1;return{name:a("cut","Cut"),shortcut:a("ctrlX","Ctrl+X"),icon:U("clipboardCut",o,null),disabled:!k||n.get("suppressCutToClipboard"),action:()=>m.cutToClipboard(void 0,"contextMenu")}}else return null;case"paste":return m?{name:a("paste","Paste"),shortcut:a("ctrlV","Ctrl+V"),disabled:!0,icon:U("clipboardPaste",o,null),action:()=>m.pasteFromClipboard()}:null;case"export":{const D=[];return!n.get("suppressCsvExport")&&v&&D.push("csvExport"),!n.get("suppressExcelExport")&&y&&D.push("excelExport"),D.length?{name:a("export","Export"),subMenu:D,icon:U("save",o,null)}:null}case"csvExport":return v?{name:a("csvExport","CSV Export"),icon:U("csvExport",o,null),action:()=>v.exportDataAsCsv()}:null;case"excelExport":return y?{name:a("excelExport","Excel Export"),icon:U("excelExport",o,null),action:()=>y.exportDataAsExcel()}:null;case"separator":return"separator";case"pivotChart":case"chartRange":return T.getChartItems(A);case"columnFilter":return x&&M?{name:a("columnFilter","Column Filter"),icon:U("filter",o,null),action:()=>x.showFilterMenu({column:M,buttonElement:L(),containerType:"columnFilter",positionBy:"button"})}:null;case"columnChooser":{const D=f.focusedHeader;return S?{name:a("columnChooser","Choose Columns"),icon:U("columns",o,null),action:()=>S.showColumnChooser({column:M,eventSource:L(),headerPosition:D})}:null}case"sortAscending":return w?{name:a("sortAscending","Sort Ascending"),icon:U("sortAscending",o,null),action:()=>w.setSortForColumn(M,"asc",!1,I)}:null;case"sortDescending":return w?{name:a("sortDescending","Sort Descending"),icon:U("sortDescending",o,null),action:()=>w.setSortForColumn(M,"desc",!1,I)}:null;case"sortUnSort":return w?{name:a("sortUnSort","Clear Sort"),icon:U("sortUnSort",o,null),action:()=>w.setSortForColumn(M,null,!1,I)}:null;default:return Eb(176,{key:A}),null}};return e.forEach(A=>{let M;if(typeof A=="string"?M=F(A,t,s,i):M={...A},!M)return;const L=M,{subMenu:I}=L;I&&I instanceof Array&&(L.subMenu=this.mapWithStockItems(I,t,s,i)),M!=null&&r.push(M)}),on(r,je),r}};function Db(e,t,s,i){let r;if(e.isPrimary())r=e;else{const o=e.getColDef().pivotValueColumn;r=Fb(o)?o:void 0}const a=[];if(r){const o=r.isValueActive(),n=t.getFuncNames(r);a.push({name:i("noAggregation","None"),action:()=>{s.removeColumns([r],"contextMenu"),s.setColumnAggFunc(r,void 0,"contextMenu")},checked:!o}),n.forEach(l=>{a.push({name:i(l,t.getDefaultFuncLabel(l)),action:()=>{s.setColumnAggFunc(r,l,"contextMenu"),s.addColumns([r],"contextMenu")},checked:o&&r.getAggFunc()===l})})}return a}var Lb=class extends wb{constructor(){super(...arguments),this.beanName="colMenuFactory"}createMenu(e,t,s,i){const r=e.createManagedBean(new Nt(0,{column:s??null,node:null,value:null})),a=this.beans.menuItemMapper.mapWithStockItems(t,s??null,i,"columnMenu");return r.addMenuItems(a),r}getMenuItems(e=null,t=null){const s=this.getDefaultMenuOptions(e);let i;const r=(e?.getColDef()??t?.getColGroupDef())?.mainMenuItems;if(Array.isArray(r))i=r;else if(typeof r=="function")i=r(xb(this.gos,{column:e,columnGroup:t,defaultItems:s}));else{const a=this.gos.getCallback("getMainMenuItems");a?i=a({column:e,columnGroup:t,defaultItems:s}):i=s}return on(i,je),i}getDefaultMenuOptions(e){const t=[],{beans:s,gos:i}=this,{colChooserFactory:r,rowGroupColsSvc:a,colModel:o,expansionSvc:n,sortSvc:l,menuSvc:c,pinnedCols:d,aggFuncSvc:h,colAutosize:u}=s,p=Mb(i),g=()=>{!p&&r&&t.push("columnChooser"),t.push("resetColumns")};if(!e)return g(),t;const{colDef:m}=e,C=d&&!m.lockPinned,f=a?.columns.length??0,v=f>0,y=e.isPrimary(),x=h&&y&&v&&e.isAllowValue()||!y;if(l&&!p&&e.isSortable()){const S=e.getSort();S!=="asc"&&t.push("sortAscending"),S!=="desc"&&t.push("sortDescending"),S&&t.push("sortUnSort"),t.push(je)}if(c?.isFilterMenuItemEnabled(e)&&(t.push("columnFilter"),t.push(je)),C&&t.push("pinSubMenu"),x&&t.push("valueAggSubMenu"),(C||x)&&t.push(je),u&&(t.push("autoSizeThis"),t.push("autoSizeAll"),t.push(je)),a&&i.isModuleRegistered("SharedRowGrouping")){const S=t.length;m.showRowGroup?t.push("rowUnGroup"):e.isAllowRowGroup()&&y&&(e.isRowGroupActive()?Ot(e,s)||t.push("rowUnGroup"):t.push("rowGroup")),t.length>S&&t.push(je)}return g(),n&&Tb(i)&&(i.get("treeData")||f>(o.isPivotMode()?1:0))&&(t.push("expandAll"),t.push("contractAll")),t}};import{BeanStub as kb,Component as Gb,_addGridCommonParams as Ob,_anchorElementToMouseMoveEvent as nn,_areCellsEqual as Nb,_createIconNoSpan as Bb,_exists as ln,_focusInto as _b,_getPageBody as Vb,_getRootNode as Hb,_isIOSUserAgent as zb,_isKeyboardMode as Ub,_isNothingFocused as Kb,_isPromise as Wb,_isVisible as jb,_preserveRangesWhile as cn,_warn as $b}from"ag-grid-community";var Yb="ag-menu",dn="ag-context-menu-open",Xb="ag-context-menu-loading-icon",qb=class extends kb{constructor(){super(...arguments),this.beanName="contextMenuSvc",this.destroyLoadingSpinner=null,this.lastPromise=0}hideActiveMenu(){this.destroyBean(this.activeMenu)}getMenuItems(e,t,s,i){const r=[],{clipboardSvc:a,chartSvc:o,csvCreator:n,excelCreator:l,colModel:c,rangeSvc:d,gos:h}=this.beans;if(ln(e)&&a&&t&&(h.get("suppressCutToClipboard")||r.push("cut"),r.push("copy","copyWithHeaders","copyWithGroupHeaders","paste","separator")),h.get("enableCharts")&&o&&(c.isPivotMode()&&r.push("pivotChart"),d&&!d.isEmpty()&&r.push("chartRange")),ln(e)){const m=h.get("suppressExcelExport")||!l,C=h.get("suppressCsvExport")||!n;!zb()&&(!m||!C)&&r.push("export")}const u=r.length?r:void 0,p=t?.getColDef().contextMenuItems;return Array.isArray(p)?p:typeof p=="function"?p(Ob(h,{column:t,node:e,value:s,defaultItems:u,event:i})):h.getCallback("getContextMenuItems")?.({column:t,node:e,value:s,defaultItems:u,event:i})??r}getContextMenuPosition(e,t){const s=this.getRowCtrl(e),i=this.getCellGui(s,t);if(!i)return{x:0,y:s?.getRowYPosition()??0};const r=i.getBoundingClientRect();return{x:r.x+r.width/2,y:r.y+r.height/2}}showContextMenu(e){const t=e.rowNode??null,s=e.column??null;let{anchorToElement:i,value:r,source:a}=e;t&&s&&r==null&&(r=this.beans.valueSvc.getValueForDisplay(s,t)),i==null&&(i=this.getContextMenuAnchorElement(t,s)),this.beans.menuUtils.onContextMenu({mouseEvent:e.mouseEvent??null,touchEvent:e.touchEvent??null,showMenuCallback:o=>this.showMenu(t,s,r,o,i),source:a})}handleContextMenuMouseEvent(e,t,s,i){const r=i?.rowNode??s?.rowNode??null,a=i?.column??s?.findFullWidthInfoForEvent(e||t)?.column??null,{valueSvc:o,ctrlsSvc:n}=this.beans,l=a?o.getValue(a,r):null,c=n.getGridBodyCtrl(),d=i?i.eGui:c.eGridBody;this.showContextMenu({mouseEvent:e,touchEvent:t,rowNode:r,column:a,value:l,anchorToElement:d,source:"ui"})}showMenu(e,t,s,i,r){const a=this.getMenuItems(e,t,s,i);if(Wb(a)){const o=this.lastPromise+1;return this.lastPromise=o,this.destroyLoadingSpinner||this.createLoadingIcon(i),a.then(n=>{if(this.lastPromise!==o)return;n&&n.length&&jb(i.target)&&!this.beans.overlays?.isExclusive()&&this.createContextMenu({menuItems:n,node:e,column:t,value:s,mouseEvent:i,anchorToElement:r}),this.destroyLoadingSpinner?.()}),!0}return a===void 0||!a?.length?!1:(this.createContextMenu({menuItems:a,node:e,column:t,value:s,mouseEvent:i,anchorToElement:r}),!0)}createLoadingIcon(e){const{beans:t}=this,s=this.getLocaleTextFunc(),i=Bb("loadingMenuItems",t),r=document.createElement("div");r.classList.add(Xb),r.appendChild(i);const a=Hb(t),o=Vb(t);if(!o){$b(54);return}o.appendChild(r),t.ariaAnnounce?.announceValue(s("ariaLabelLoadingContextMenu","Loading Context Menu"),"contextmenu"),t.environment.applyThemeClasses(r),nn(r,e,t);const n=l=>{nn(r,l,t)};a.addEventListener("mousemove",n),this.destroyLoadingSpinner=()=>{a.removeEventListener("mousemove",n),o.removeChild(r),this.destroyLoadingSpinner=null}}createContextMenu(e){const{menuItems:t,node:s,column:i,value:r,mouseEvent:a,anchorToElement:o}=e,{ctrlsSvc:n,focusSvc:l,popupSvc:c}=this.beans,d=n.getGridBodyCtrl().eGridBody,h=new Zb(t,i,s,r);this.createBean(h);const u=h.getGui();i||l.clearFocusedCell();const p={column:i,rowNode:s,type:"contextMenu",mouseEvent:a,ePopup:u,nudgeY:1},g=this.getLocaleTextFunc(),m=c?.addPopup({modal:!0,eChild:u,closeOnEsc:!0,closedCallback:f=>{cn(this.beans,()=>{d.classList.remove(dn),this.destroyBean(h),this.dispatchVisibleChangedEvent(!1,f===void 0?"api":"ui")})},click:a,positionCallback:()=>{const f=this.gos.get("enableRtl");c?.positionPopupUnderMouseEvent({...p,nudgeX:f?(u.offsetWidth+1)*-1:1})},anchorToElement:o,ariaLabel:g("ariaLabelContextMenu","Context Menu")});m&&(d.classList.add(dn),h.afterGuiAttached({container:"contextMenu",hidePopup:m.hideFunc})),this.activeMenu&&this.hideActiveMenu(),this.activeMenu=h,h.addEventListener("destroyed",()=>{this.activeMenu===h&&(this.activeMenu=null)}),m&&h.addEventListener("closeMenu",f=>m.hideFunc({mouseEvent:f.mouseEvent??void 0,keyboardEvent:f.keyboardEvent??void 0,forceHide:!0}));const C=a&&a instanceof MouseEvent&&a.type==="mousedown";this.dispatchVisibleChangedEvent(!0,C?"api":"ui")}dispatchVisibleChangedEvent(e,t="ui"){this.eventSvc.dispatchEvent({type:"contextMenuVisibleChanged",visible:e,source:t})}getRowCtrl(e){const{rowIndex:t,rowPinned:s}=e||{};if(t!=null)return this.beans.rowRenderer.getRowByPosition({rowIndex:t,rowPinned:s})||void 0}getCellGui(e,t){return!e||!t?void 0:e.getCellCtrl(t)?.eGui||void 0}getContextMenuAnchorElement(e,t){const s=this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody,i=this.getRowCtrl(e);if(!i)return s;const r=this.getCellGui(i,t);return r||(i.isFullWidth()?i.getFullWidthElement():s)}destroy(){this.destroyLoadingSpinner?.(),super.destroy()}},Zb=class extends Gb{constructor(e,t,s,i){super(``),this.menuItems=e,this.column=t,this.node=s,this.value=i,this.menuList=null,this.focusedCell=null}postConstruct(){const e=this.createManagedBean(new Nt(0,{column:this.column,node:this.node,value:this.value})),t=this.beans.menuItemMapper.mapWithStockItems(this.menuItems,null,()=>this.getGui(),"contextMenu");e.addMenuItems(t),this.appendChild(e),this.menuList=e,e.addEventListener("closeMenu",s=>this.dispatchLocalEvent(s))}afterGuiAttached({hidePopup:e}){e&&this.addDestroyFunc(e),this.focusedCell=this.beans.focusSvc.getFocusedCell();const t=this.menuList;t&&cn(this.beans,()=>_b(t.getGui()))}restoreFocusedCell(){const{beans:e,focusedCell:t}=this,s=e.focusSvc,i=s.getFocusedCell();if(i&&t&&Nb(i,t)){const{rowIndex:r,rowPinned:a,column:o}=t;Kb(e)&&s.setFocusedCell({rowIndex:r,column:o,rowPinned:a,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!Ub()})}}destroy(){super.destroy(),this.restoreFocusedCell()}};import{AgPromise as er,BeanStub as hn,Component as Jb,FilterWrapperComp as Qb,RefPlaceholder as ew,_createIconNoSpan as tr,_error as tw,_focusInto as sw,_isColumnMenuAnchoringEnabled as iw,_isLegacyMenuEnabled as Is,_setColMenuVisible as un,_warn as rw,isColumn as aw}from"ag-grid-community";import{KeyCode as Bt,RefPlaceholder as pn,TabGuardComp as ow,_clearElement as nw,_createIconNoSpan as lw,_findNextFocusableElement as cw,_focusInto as gn,_getActiveDomElement as mn,_getDocument as sr,_isKeyboardMode as dw,_setAriaLabel as fn,_setAriaRole as Ds}from"ag-grid-community";function hw(e){return`
`}var Cn=class extends ow{constructor(e){super(hw(e.cssClass)),this.eHeader=pn,this.eBody=pn,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(()=>this.activeItem?.tabbedItem?.afterDetachedCallback?.())}setupHeader(){const{enableCloseButton:e,cssClass:t}=this.params,s=(i,r)=>{i.classList.add(`ag-tabs-${r}`),t&&i.classList.add(`${t}-${r}`)};e?(this.setupCloseButton(s),this.eTabHeader=sr(this.beans).createElement("div"),s(this.eHeader,"header-wrapper"),Ds(this.eHeader,"presentation"),this.eHeader.appendChild(this.eTabHeader)):this.eTabHeader=this.eHeader,Ds(this.eTabHeader,"tablist"),s(this.eTabHeader,"header")}setupCloseButton(e){const t=sr(this.beans),s=t.createElement("button");e(s,"close-button");const i=lw("close",this.beans);fn(s,this.params.closeButtonAriaLabel),s.appendChild(i),this.addManagedElementListeners(s,{click:()=>this.params.onCloseClicked?.()});const r=t.createElement("div");e(r,"close-button-wrapper"),Ds(r,"presentation"),r.appendChild(s),this.eHeader.appendChild(r),this.eCloseButton=s}handleKeyDown(e){switch(e.key){case Bt.RIGHT:case Bt.LEFT:{if(!this.eTabHeader.contains(mn(this.beans)))return;const t=e.key===Bt.RIGHT,s=this.gos.get("enableRtl"),i=this.items.indexOf(this.activeItem),r=t!==s?Math.min(i+1,this.items.length-1):Math.max(i-1,0);if(i===r)return;e.preventDefault();const a=this.items[r];this.showItemWrapper(a),a.eHeaderButton.focus();break}case Bt.UP:case Bt.DOWN:e.stopPropagation();break}}onTabKeyDown(e){if(e.defaultPrevented)return;const{beans:t,eHeader:s,eBody:i,activeItem:r,params:a}=this,{suppressTrapFocus:o,enableCloseButton:n}=a,l=mn(t),c=e.target,d=e.shiftKey;if(s.contains(l)){e.preventDefault(),n&&d&&!this.eCloseButton?.contains(l)?this.eCloseButton?.focus():o&&d?Vi(sr(t).body,c)?.focus():this.focusBody(e.shiftKey);return}let h=null;if(wo(i,c)&&(d&&(h=Vi(i,c)),!h&&!o&&(h=r.eHeaderButton)),!h&&i.contains(l)&&(h=cw(t,i,!1,d),!h)){o&&!d?this.forceFocusOutOfContainer(d):n&&!d?(e.preventDefault(),this.eCloseButton?.focus()):(e.preventDefault(),this.focusHeader());return}h&&(e.preventDefault(),h.focus())}focusInnerElement(e){return e?this.focusBody(!0):(this.focusHeader(),!0)}focusHeader(e){this.activeItem.eHeaderButton.focus({preventScroll:e})}focusBody(e){return gn(this.eBody,e)}setAfterAttachedParams(e){this.afterAttachedParams=e}showFirstItem(){this.items.length>0&&this.showItemWrapper(this.items[0])}addItem(e){const t=document.createElement("span");Ds(t,"tab"),t.setAttribute("tabindex","-1"),t.appendChild(e.title),t.classList.add("ag-tab"),this.eTabHeader.appendChild(t),fn(t,e.titleLabel);const s={tabbedItem:e,eHeaderButton:t};this.items.push(s),t.addEventListener("click",this.showItemWrapper.bind(this,s))}showItem(e){const t=this.items.find(s=>s.tabbedItem===e);t&&this.showItemWrapper(t)}showItemWrapper(e){const{tabbedItem:t,eHeaderButton:s}=e;if(this.params.onItemClicked?.({item:t}),this.activeItem===e){this.params.onActiveItemClicked?.();return}this.lastScrollListener&&(this.lastScrollListener=this.lastScrollListener()),nw(this.eBody),t.bodyPromise.then(i=>{this.eBody.appendChild(i);const r=!dw();if(this.params.suppressFocusBodyOnOpen||gn(this.eBody,!1,r),t.afterAttachedCallback&&t.afterAttachedCallback(this.afterAttachedParams),this.params.keepScrollPosition){const a=t.getScrollableContainer&&t.getScrollableContainer()||i;[this.lastScrollListener]=this.addManagedElementListeners(a,{scroll:()=>{this.tabbedItemScrollMap.set(t.name,a.scrollTop)}});const o=this.tabbedItemScrollMap.get(t.name);o!==void 0&&setTimeout(()=>{a.scrollTop=o},0)}}),this.activeItem&&(this.activeItem.eHeaderButton.classList.remove("ag-tab-selected"),this.activeItem.tabbedItem.afterDetachedCallback?.()),s.classList.add("ag-tab-selected"),this.activeItem=e}},ke="filterMenuTab",Ge="generalMenuTab",$e="columnsMenuTab",Ls=[Ge,ke,$e],uw=class extends hn{constructor(){super(...arguments),this.beanName="enterpriseMenuFactory"}hideActiveMenu(){this.destroyBean(this.activeMenu)}showMenuAfterMouseEvent(e,t,s,i,r){const{column:a,columnGroup:o}=this.splitColumnOrGroup(e),n=r?"filterMenuTab":void 0;this.showMenu(a,o,l=>{const c=l.getGui();this.beans.popupSvc.positionPopupUnderMouseEvent({type:s,column:a,mouseEvent:t,ePopup:c}),n&&l.showTab?.(n),this.dispatchVisibleChangedEvent(!0,!1,a,o,n)},s,n,void 0,t.target,i)}splitColumnOrGroup(e){const t=e&&aw(e);return{column:t?e:void 0,columnGroup:t?void 0:e}}showMenuAfterButtonClick(e,t,s,i,r){let a=-1,o="left";this.gos.get("enableRtl")&&(a=1,o="right");const n=r?"filterMenuTab":void 0,l=n?[n]:void 0,c=Is(this.gos),d=(c?9:4)*a,h=c?-23:4,{column:u,columnGroup:p}=this.splitColumnOrGroup(e);this.showMenu(u,p,g=>{const m=g.getGui();this.beans.popupSvc.positionPopupByComponent({type:s,column:u,eventSource:t,ePopup:m,alignSide:o,nudgeX:d,nudgeY:h,position:"under",keepWithinBounds:!0}),n&&g.showTab?.(n),this.dispatchVisibleChangedEvent(!0,!1,u,p,n)},s,n,l,t,i)}showMenu(e,t,s,i,r,a,o,n){const l=this.getMenuParams(e,t,a,o);if(!l)return;const{menu:c,eMenuGui:d,anchorToElement:h,restoreFocusParams:u}=l,p=[],{menuUtils:g,popupSvc:m}=this.beans;p.push(f=>{const v=c.getGui();this.destroyBean(c),e&&(un(e,!1,"contextMenu"),g.restoreFocusOnClose(u,v,f)),n?.()});const C=this.getLocaleTextFunc();if(m.addPopup({modal:!0,eChild:d,closeOnEsc:!0,closedCallback:f=>{p.forEach(v=>v(f)),this.dispatchVisibleChangedEvent(!1,!1,e,t,r)},afterGuiAttached:f=>c.afterGuiAttached(Object.assign({},{container:i},f)),positionCallback:r?()=>s(c):void 0,ariaLabel:C("ariaLabelColumnMenu","Column Menu")}),r||(c.showTabBasedOnPreviousSelection?.(),s(c)),iw(this.gos)){const f=m.setPopupPositionRelatedToElement(d,h);f&&e&&this.addStopAnchoring(f,e,p)}c.addEventListener("tabSelected",f=>{this.dispatchVisibleChangedEvent(!1,!0,e),this.lastSelectedTab=f.key,this.dispatchVisibleChangedEvent(!0,!0,e)}),e&&un(e,!0,"contextMenu"),this.activeMenu=c,c.addEventListener("destroyed",()=>{this.activeMenu===c&&(this.activeMenu=null)})}addStopAnchoring(e,t,s){e.then(i=>{t.__addEventListener("leftChanged",i),t.__addEventListener("visibleChanged",i),s.push(()=>{t.__removeEventListener("leftChanged",i),t.__removeEventListener("visibleChanged",i)})})}getMenuParams(e,t,s,i){const{focusSvc:r,visibleCols:a,ctrlsSvc:o}=this.beans,n={column:e,headerPosition:r.focusedHeader,columnIndex:a.allCols.indexOf(e),eventSource:i},l=this.createMenu(e,t,n,s,i);return l?{menu:l,eMenuGui:l.getGui(),anchorToElement:i||o.getGridBodyCtrl().eGridBody,restoreFocusParams:n}:void 0}createMenu(e,t,s,i,r){if(Is(this.gos))return this.createBean(new pw(e,s,this.lastSelectedTab,i,r));{const a=this.beans.colMenuFactory.getMenuItems(e,t);return a.length?this.createBean(new gw(a,e,s,r)):void 0}}dispatchVisibleChangedEvent(e,t,s,i,r){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:t,key:this.lastSelectedTab??r??(Is(this.gos)?Ge:"columnMenu"),column:s??null,columnGroup:i??null})}isMenuEnabled(e){if(!Is(this.gos))return!0;const t=!this.beans.filterManager?.isFilterAllowed(e),s=e.getColDef().menuTabs??Ls;return(t&&s.includes(ke)?s.length-1:s.length)>0}showMenuAfterContextMenuEvent(e,t,s){this.beans.menuUtils.onContextMenu({mouseEvent:t,touchEvent:s,source:"ui",showMenuCallback:i=>(this.showMenuAfterMouseEvent(e,i,"columnMenu"),!0)})}},pw=class extends hn{constructor(e,t,s,i,r){super(),this.column=e,this.restoreFocusParams=t,this.initialSelection=s,this.restrictTo=i,this.sourceElement=r,this.tabFactories={},this.includeChecks={};const{tabFactories:a,includeChecks:o}=this;a[Ge]=this.createMainPanel.bind(this),a[ke]=this.createFilterPanel.bind(this),a[$e]=this.createColumnsPanel.bind(this),o[Ge]=()=>!0,o[ke]=()=>e?!!this.beans.filterManager?.isFilterAllowed(e):!1,o[$e]=()=>!0}postConstruct(){const e=this.getTabsToCreate().map(s=>this.createTab(s)),t=new Cn({items:e,cssClass:"ag-menu",onActiveItemClicked:this.onHidePopup.bind(this),onItemClicked:this.onTabItemClicked.bind(this)});this.tabbedLayout=this.createBean(t),this.mainMenuList?.setParentComponent(t),this.addDestroyFunc(()=>this.destroyBean(t))}getTabsToCreate(){return this.restrictTo?this.restrictTo:(this.column?.getColDef().menuTabs??Ls).filter(e=>this.isValidMenuTabItem(e)&&this.isNotSuppressed(e))}isValidMenuTabItem(e){let t=!0,s=Ls;return this.restrictTo!=null&&(t=this.restrictTo.indexOf(e)>-1,s=this.restrictTo),t=t&&Ls.indexOf(e)>-1,t||rw(175,{menuTabName:e,itemsToConsider:s}),t}isNotSuppressed(e){return this.includeChecks[e]()}createTab(e){return this.tabFactories[e]()}showTabBasedOnPreviousSelection(){this.showTab(this.initialSelection)}showTab(e){const{tabItemColumns:t,tabbedLayout:s,tabItemFilter:i,tabItemGeneral:r}=this;t&&e===$e?s.showItem(t):i&&e===ke?s.showItem(i):r&&e===Ge?s.showItem(r):s.showFirstItem()}onTabItemClicked(e){let t=null;switch(e.item){case this.tabItemColumns:t=$e;break;case this.tabItemFilter:t=ke;break;case this.tabItemGeneral:t=Ge;break}t&&this.activateTab(t)}activateTab(e){const t={type:"tabSelected",key:e};this.dispatchLocalEvent(t)}createMainPanel(){const{beans:e,column:t}=this,s=e.colMenuFactory,i=s.createMenu(this,s.getMenuItems(t),this.column,()=>this.sourceElement??this.getGui());this.mainMenuList=i,i.addEventListener("closeMenu",this.onHidePopup.bind(this));const r={title:tr("legacyMenu",e,t),titleLabel:Ge.replace("MenuTab",""),bodyPromise:er.resolve(i.getGui()),name:Ge};return this.tabItemGeneral=r,r}onHidePopup(e){this.beans.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,e)}createFilterPanel(){const e=this.column?this.createBean(new Qb(this.column,"COLUMN_MENU")):null;this.filterComp=e,e?.hasFilter()||tw(119);const t=i=>e?.afterGuiAttached(i),s=()=>e?.afterGuiDetached();return this.tabItemFilter={title:tr("filterTab",this.beans,this.column),titleLabel:ke.replace("MenuTab",""),bodyPromise:er.resolve(e?.getGui()),afterAttachedCallback:t,afterDetachedCallback:s,name:ke},this.tabItemFilter}createColumnsPanel(){const e=document.createElement("div");e.classList.add("ag-menu-column-select-wrapper");const{beans:t,column:s}=this,r=t.colChooserFactory.createColumnSelectPanel(this,s).getGui();r.classList.add("ag-menu-column-select"),e.appendChild(r);const a={title:tr("columns",t,s),titleLabel:$e.replace("MenuTab",""),bodyPromise:er.resolve(e),name:$e};return this.tabItemColumns=a,a}afterGuiAttached(e){const{container:t,hidePopup:s}=e;this.tabbedLayout.setAfterAttachedParams({container:t,hidePopup:s}),s&&(this.hidePopupFunc=s,this.addDestroyFunc(s))}getGui(){return this.tabbedLayout.getGui()}destroy(){super.destroy(),this.destroyBean(this.filterComp)}},gw=class extends Jb{constructor(e,t,s,i){super(` `),this.menuItems=e,this.column=t,this.restoreFocusParams=s,this.sourceElement=i,this.eColumnMenu=ew}postConstruct(){const e=this.beans.colMenuFactory.createMenu(this,this.menuItems,this.column,()=>this.sourceElement??this.getGui());this.mainMenuList=e,e.addEventListener("closeMenu",this.onHidePopup.bind(this)),this.eColumnMenu.appendChild(e.getGui())}onHidePopup(e){this.beans.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,e)}afterGuiAttached({hidePopup:e}){e&&(this.hidePopupFunc=e,this.addDestroyFunc(e)),sw(this.mainMenuList.getGui())}};function mw(e,t){const{contextMenuSvc:s}=e;if(!s)return;const{rowNode:i,column:r,value:a,x:o,y:n}=t||{};let{x:l,y:c}=s.getContextMenuPosition(i,r);o!=null&&(l=o),n!=null&&(c=n),s.showContextMenu({mouseEvent:new MouseEvent("mousedown",{clientX:l,clientY:c}),rowNode:i,column:r,value:a,source:"api"})}function fw(e,t){e.colChooserFactory?.showColumnChooser({chooserParams:t})}function Cw(e){e.colChooserFactory?.hideActiveColumnChooser()}import{BeanStub as vw,_findTabbableParent as yw,_getActiveDomElement as Sw,_isNothingFocused as vn,_isVisible as bw,_last as ww}from"ag-grid-community";var xw=class extends vw{constructor(){super(...arguments),this.beanName="menuUtils"}restoreFocusOnClose(e,t,s,i){const{eventSource:r}=e,a=s instanceof KeyboardEvent;if(!i&&!a||!r)return;const o=Sw(this.beans);!t.contains(o)&&!vn(this.beans)||this.focusHeaderCell(e)}closePopupAndRestoreFocusOnSelect(e,t,s){let i;s&&s.keyboardEvent&&(i=s.keyboardEvent),e(i&&{keyboardEvent:i});const r=this.beans,a=r.focusSvc,o=a.getFocusedCell();if(vn(r))if(o){const{rowIndex:n,rowPinned:l,column:c}=o;a.setFocusedCell({rowIndex:n,column:c,rowPinned:l,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}else this.focusHeaderCell(t)}onContextMenu(e){const{mouseEvent:t,touchEvent:s,showMenuCallback:i,source:r}=e;if(!this.gos.get("allowContextMenuWithControlKey")&&t&&(t.ctrlKey||t.metaKey)||(t&&this.blockMiddleClickScrollsIfNeeded(t),r==="ui"&&this.gos.get("suppressContextMenu")))return;const a=t??s.touches[0];if(i(a)){const o=t??s;o&&o.cancelable&&o.preventDefault()}}async focusHeaderCell(e){const{column:t,columnIndex:s,headerPosition:i,eventSource:r}=e,{visibleCols:a,headerNavigation:o,focusSvc:n}=this.beans,l=await a.allCols.some(c=>c===t);if(this.isAlive()){if(t?.isAlive()&&l&&r&&bw(r)){const c=yw(r);c&&(o?.scrollToColumn(t),c.focus())}else if(i&&s!==-1){const c=a.allCols,d=c[s]||ww(c);d&&n.focusHeaderPosition({headerPosition:{headerRowIndex:i.headerRowIndex,column:d}})}}}blockMiddleClickScrollsIfNeeded(e){this.gos.get("suppressMiddleClickScrolls")&&e.which===2&&e.preventDefault()}},yn={moduleName:"MenuCore",version:R,beans:[Ib,mb,xw],icons:{chart:"chart",columns:"columns",loadingMenuItems:"loading",menuPin:"pin",menuValue:"aggregation",menuAddRowGroup:"group",menuRemoveRowGroup:"group",clipboardCopy:"copy",clipboardCut:"cut",clipboardPaste:"paste",save:"save",csvExport:"csv",excelExport:"excel",sortAscending:"asc",sortDescending:"desc",sortUnSort:"none"},dependsOn:[G,hb,pb,As]},ir={moduleName:"ColumnMenu",version:R,beans:[uw,Lb,bb],icons:{legacyMenu:"menu",filterTab:"filter",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate"},apiFunctions:{showColumnChooser:fw,hideColumnChooser:Cw},dependsOn:[yn,ub,db]},rr={moduleName:"ContextMenu",version:R,beans:[qb],apiFunctions:{showContextMenu:mw},dependsOn:[yn]},Tw={moduleName:"Menu",version:R,dependsOn:[ir,rr]};import{_EditCoreModule as Mw}from"ag-grid-community";import{PopupComponent as Pw,_addGridCommonParams as Fw,_missing as Aw,_warn as ar}from"ag-grid-community";var Sn=class extends Pw{constructor(){super('
'),this.isAsync=!1}init(e){this.params=e;const{cellStartedEdit:t,values:s,eventKey:i}=e;Aw(s)&&ar(180);const{params:r,valuesPromise:a}=this.buildRichSelectParams(),o=this.createManagedBean(new Li(r));this.richSelect=o,o.addCssClass("ag-cell-editor"),this.appendChild(o),a&&(this.isAsync=!0,a.then(n=>{o.setValueList({valueList:n,refresh:!0});const l=this.getSearchStringCallback(n);l&&o.setSearchStringCreator(l),this.processEventKey(i)})),this.addManagedListeners(o,{fieldPickerValueSelected:this.onEditorPickerValueSelected.bind(this)}),this.focusAfterAttached=t}onEditorPickerValueSelected(e){setTimeout(()=>this.params.stopEditing(!e.fromEnterKey))}buildRichSelectParams(){const e=this.params,{cellRenderer:t,cellHeight:s,value:i,values:r,formatValue:a,searchDebounceDelay:o,valueListGap:n,valueListMaxHeight:l,valueListMaxWidth:c,allowTyping:d,filterList:h,searchType:u,highlightMatch:p,valuePlaceholder:g,eventKey:m,multiSelect:C,suppressDeselectAll:f,suppressMultiSelectPillRenderer:v}=e,y={value:i,cellRenderer:t,cellRowHeight:s,searchDebounceDelay:o,valueFormatter:a,pickerAriaLabelKey:"ariaLabelRichSelectField",pickerAriaLabelValue:"Rich Select Field",pickerType:"virtual-list",pickerGap:n,allowTyping:d,filterList:h,searchType:u,highlightMatch:p,maxPickerHeight:l,maxPickerWidth:c,placeholder:g,initialInputValue:m?.length===1?m:void 0,multiSelect:C,suppressDeselectAll:f,suppressMultiSelectPillRenderer:v};let x,S;return typeof r=="function"?x=r(e):x=r??[],Array.isArray(x)?(y.valueList=x,y.searchStringCreator=this.getSearchStringCallback(x)):S=x,C&&d&&(e.allowTyping=y.allowTyping=!1,ar(181)),{params:y,valuesPromise:S}}getSearchStringCallback(e){if(typeof e[0]!="object")return;const t=this.params,{colDef:s,formatValue:i}=t;if(s.cellEditorParams?.formatValue)return a=>a.map(i);const{keyCreator:r}=s;if(r){ar(266);const{column:a,node:o,data:n}=t;return l=>l.map(c=>{const d=Fw(this.gos,{value:c,colDef:s,column:a,node:o,data:n});return r(d)})}return a=>a.map(i)}afterGuiAttached(){const{focusAfterAttached:e,params:t}=this;setTimeout(()=>{if(!this.isAlive())return;const s=this.richSelect,{allowTyping:i,eventKey:r}=t;if(e){const a=s.getFocusableElement();a.focus(),i&&(!r||r.length!==1)&&a.select()}s.showPicker(),this.isAsync||this.processEventKey(r)})}processEventKey(e){e&&e?.length===1&&this.richSelect.searchTextFromString(e)}focusIn(){this.richSelect.getFocusableElement().focus()}getValue(){const{params:e}=this,t=this.richSelect.getValue();return e.parseValue?.(t)??t}isPopup(){return!1}},bn={moduleName:"RichSelect",version:R,beans:[],userComponents:{agRichSelect:Sn,agRichSelectCellEditor:Sn},icons:{richSelectOpen:"small-down",richSelectRemove:"cancel"},dependsOn:[G,Mw]};import{_ColumnFilterModule as Rw}from"ag-grid-community";import{AgInputTextFieldSelector as Ew,AgPromise as Iw,GROUP_AUTO_COLUMN_ID as Dw,KeyCode as _t,ProvidedFilter as Lw,RefPlaceholder as Vt,_areEqual as kw,_createIconNoSpan as Gw,_error as wn,_getActiveDomElement as Ow,_last as Nw,_makeNull as xn,_setDisplayed as or,_toStringOrNull as nr,_warn as Bw}from"ag-grid-community";var Ye="__AG_SELECT_ALL__",Xe="__AG_ADD_SELECTION_TO_FILTER__",_w={loadingOoo:"Loading...",blanks:"(Blanks)",searchOoo:"Search...",selectAll:"(Select All)",selectAllSearchResults:"(Select All Search Results)",addCurrentSelectionToFilter:"Add current selection to filter",noMatches:"No matches."};import{AgCheckboxSelector as Vw,Component as Hw,RefPlaceholder as ks,_addGridCommonParams as zw,_createIcon as lr,_getCellRendererDetails as Tn,_getShouldDisplayTooltip as Uw,_isShowTooltipWhenTruncated as Kw,_setAriaChecked as Ww,_setAriaDescribedBy as jw,_setAriaExpanded as $w,_setAriaLabel as Yw,_setAriaLabelledBy as Xw,_setAriaLevel as qw,_setDisplayed as cr,_toStringOrNull as Mn,_warn as Zw}from"ag-grid-community";var Jw=class extends Hw{constructor(e){super(e.isGroup?` `:`
`,[Vw]),this.eCheckbox=ks,this.eGroupOpenedIcon=ks,this.eGroupClosedIcon=ks,this.eGroupIndeterminateIcon=ks,this.formattedValue=null,this.focusWrapper=e.focusWrapper,this.value=e.value,this.params=e.params,this.translate=e.translate,this.valueFormatter=e.valueFormatter,this.item=e.item,this.isSelected=e.isSelected,this.isTree=e.isTree,this.depth=e.depth??0,this.isGroup=e.isGroup,this.groupsExist=e.groupsExist,this.isExpanded=e.isExpanded,this.hasIndeterminateExpandState=e.hasIndeterminateExpandState}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui(),getColDef:()=>this.params.colDef,getColumn:()=>this.params.column,getLocation:()=>"setFilterValue",shouldDisplayTooltip:()=>this.shouldDisplayTooltip?.()??!0,getValueFormatted:()=>this.formattedValue,getAdditionalParams:()=>this.isTree?{level:this.depth}:{}})),this.addDestroyFunc(()=>this.destroyCellRendererComponent?.()),this.render(),this.eCheckbox.setLabelEllipsis(!0).setValue(this.isSelected,!0).setDisabled(!!this.params.readOnly).getInputElement().setAttribute("tabindex","-1"),this.refreshVariableAriaLabels(),this.isTree&&(this.depth>0&&(this.addCssClass("ag-set-filter-indent-"+this.depth),this.getGui().style.setProperty("--ag-indentation-level",String(this.depth))),this.isGroup?this.setupExpansion():this.groupsExist&&this.addCssClass("ag-set-filter-add-group-indent"),qw(this.getAriaElement(),this.depth+1)),this.refreshAriaChecked(),!this.params.readOnly&&this.eCheckbox.onValueChange(e=>this.onCheckboxChanged(!!e))}getFocusableElement(){return this.focusWrapper}setupExpansion(){const{eGroupClosedIcon:e,eGroupOpenedIcon:t,eGroupIndeterminateIcon:s,hasIndeterminateExpandState:i,beans:r}=this;e.appendChild(lr("setFilterGroupClosed",r,null)),t.appendChild(lr("setFilterGroupOpen",r,null));const a=this.onExpandOrContractClicked.bind(this);this.addManagedElementListeners(e,{click:a}),this.addManagedElementListeners(t,{click:a}),i&&(s.appendChild(lr("setFilterGroupIndeterminate",r,null)),this.addManagedElementListeners(s,{click:a})),this.setExpandedIcons(),this.refreshAriaExpanded()}onExpandOrContractClicked(){this.setExpanded(!this.isExpanded)}setExpanded(e,t){if(this.isGroup&&e!==this.isExpanded){this.isExpanded=e;const s={type:"expandedChanged",isExpanded:!!e,item:this.item};t||this.dispatchLocalEvent(s),this.setExpandedIcons(),this.refreshAriaExpanded()}}setExpandedIcons(){const{isExpanded:e,hasIndeterminateExpandState:t,eGroupClosedIcon:s,eGroupOpenedIcon:i,eGroupIndeterminateIcon:r}=this;cr(s,t?e===!1:!e),cr(i,e===!0),t&&cr(r,e===void 0)}onCheckboxChanged(e){this.isSelected=e;const t={type:"selectionChanged",isSelected:e,item:this.item};this.dispatchLocalEvent(t),this.refreshVariableAriaLabels(),this.refreshAriaChecked()}toggleSelected(){this.params.readOnly||this.setSelected(!this.isSelected)}setSelected(e,t){this.isSelected=e,this.eCheckbox.setValue(e,t),this.refreshAriaChecked()}refreshVariableAriaLabels(){if(!this.isTree)return;const e=this.getLocaleTextFunc(),t=this.eCheckbox.getValue(),s=t===void 0?e("ariaIndeterminate","indeterminate"):t?e("ariaVisible","visible"):e("ariaHidden","hidden"),i=e("ariaToggleVisibility","Press SPACE to toggle visibility");Xw(this.eCheckbox.getInputElement(),void 0),this.eCheckbox.setInputAriaLabel(`${i} (${s})`)}setupFixedAriaLabels(e){if(!this.isTree)return;const s=this.getLocaleTextFunc()("ariaFilterValue","Filter Value"),i=this.getAriaElement();Yw(i,`${e} ${s}`),jw(i,this.eCheckbox.getInputElement().id)}refreshAriaChecked(){const e=this.getAriaElement();Ww(e,this.eCheckbox.getValue())}refreshAriaExpanded(){$w(this.getAriaElement(),!!this.isExpanded)}refresh(e,t,s){this.item=e,t!==this.isSelected&&this.setSelected(t,!0),this.setExpanded(s,!0);const{cellRendererComponent:i,cellRendererParams:r,beans:a,params:o}=this;if(this.valueFunction){const n=this.valueFunction();this.setTooltipAndCellRendererParams(n,n),i||this.renderCellWithoutCellRenderer()}if(i){const n=Tn(a.userCompFactory,o,r);if(!i.refresh?.(n?.params??r)){const c=i;this.renderCell(),this.destroyBean(c)}}}render(){const{params:{column:e}}=this;let{value:t}=this,s=null;typeof t=="function"?(this.valueFunction=t,s=this.valueFunction(),t=s):this.isTree?s=Mn(t):s=this.getFormattedValue(e,t),this.formattedValue=s,this.setTooltipAndCellRendererParams(t,s),this.renderCell()}setTooltipAndCellRendererParams(e,t){const s=this.gos;if(this.params.showTooltips&&(!Kw(s)||!this.params.cellRenderer)){const i=t??Mn(e);this.shouldDisplayTooltip=Uw(s,()=>this.eCheckbox.getGui().querySelector(".ag-label")),this.tooltipFeature?.setTooltipAndRefresh(i)}this.cellRendererParams=zw(s,{value:e,valueFormatted:t,colDef:this.params.colDef,column:this.params.column,setTooltip:(i,r)=>{s.assertModuleRegistered("Tooltip",3),this.shouldDisplayTooltip=r,this.tooltipFeature?.setTooltipAndRefresh(i)}})}getFormattedValue(e,t){return this.beans.valueSvc.formatValue(e,null,t,this.valueFormatter,!1)}renderCell(){const t=Tn(this.beans.userCompFactory,this.params,this.cellRendererParams)?.newAgStackInstance();if(t==null){this.renderCellWithoutCellRenderer();return}t.then(s=>{s&&(this.cellRendererComponent=s,this.eCheckbox.setLabel(s.getGui()),this.destroyCellRendererComponent=()=>this.destroyBean(s))})}renderCellWithoutCellRenderer(){const{valueFormatted:e,value:t}=this.cellRendererParams;let s=e??t??this.translate("blanks");typeof s!="string"&&(Zw(208),s=""),this.eCheckbox.setLabel(s),this.setupFixedAriaLabels(s)}getComponentHolder(){return this.params.column.getColDef()}},Pn=class{getModelAsString(e,t){const{values:s}=e||t.getModel()||{},i=t.getValueModel();if(s==null||i==null)return"";const r=s.filter(n=>i.isKeyAvailable(n)),a=r.length,o=r.slice(0,10).map(n=>t.getFormattedValue(n));return`(${a}) ${o.join(",")}${a>10?",...":""}`}};import{_last as Qw,_makeNull as ex,_toStringOrNull as tx}from"ag-grid-community";function dr(e,t,s){let i=e;return i?(i=i.map(r=>tx(ex(r))),!t&&s&&i.some(r=>r==null)?Qw(i)==null?null:i.filter(r=>r!=null):i):null}import{AgPromise as pt,LocalEventService as sx,_addGridCommonParams as ix,_defaultComparator as hr,_error as rx,_exists as ax,_isClientSideRowModel as ox,_makeNull as ur,_warn as Fn}from"ag-grid-community";import{AgPromise as nx,_makeNull as lx}from"ag-grid-community";var cx=class{constructor(e,t,s,i,r,a,o,n,l,c){this.rowModel=e,this.filterParams=t,this.createKey=s,this.caseFormat=i,this.valueSvc=r,this.treeDataOrGrouping=a,this.treeData=o,this.groupAllowUnbalanced=n,this.addManagedEventListeners=l,this.rowGroupColsSvc=c}extractUniqueValuesAsync(e,t){return new nx(s=>{if(this.rowModel.isRowDataLoaded())s(this.extractUniqueValues(e,t));else{const[i]=this.addManagedEventListeners({rowCountReady:()=>{i?.(),s(this.extractUniqueValues(e,t))}})}})}extractUniqueValues(e,t){const s=new Map,i=this.extractExistingFormattedKeys(t),r=new Set,a=this.treeData,o=this.rowGroupColsSvc?.columns,n=(l,c)=>{const d=this.caseFormat(l);if(!r.has(d)){r.add(d);let h=l,u=lx(c);const p=i?.get(d);p!=null&&(h=p,u=t.get(p)),s.set(h,u)}};return this.rowModel.forEachLeafNode(l=>{if(!l.data||!e(l))return;if(this.treeDataOrGrouping){this.addValueForTreeDataOrGrouping(l,a,o,n);return}const c=this.getValue(l);c!=null&&Array.isArray(c)?(c.forEach(d=>{n(this.createKey(d,l),d)}),c.length===0&&n(null,null)):n(this.createKey(c,l),c)}),s}addValueForTreeDataOrGrouping(e,t,s=[],i){let r;if(t){if(e.childrenAfterGroup?.length)return;r=e.getRoute()??[e.key??e.id]}else r=s.map(o=>this.valueSvc.getKeyForNode(o,e)),r.push(this.getValue(e));const a=dr(r,t,this.groupAllowUnbalanced);i(this.createKey(a),a)}getValue(e){return this.filterParams.getValue(e)}extractExistingFormattedKeys(e){if(!e)return null;const t=new Map;return e.forEach((s,i)=>{t.set(this.caseFormat(i),i)}),t}},dx=class{constructor({caseFormat:e}){this.filteringKeys=null,this.filteringKeysCaseFormatted=null,this.hasNoAppliedFilteringKeys=!1,this.caseFormat=e}allFilteringKeys(){return this.filteringKeys}allFilteringKeysCaseFormatted(){return this.filteringKeysCaseFormatted}setFilteringKeys(e){this.filteringKeys=new Set(e),this.hasNoAppliedFilteringKeys=!this.filteringKeys||this.filteringKeys.size===0,this.filteringKeysCaseFormatted=new Set,this.filteringKeys.forEach(t=>this.filteringKeysCaseFormatted.add(this.caseFormat(t)))}addFilteringKey(e){this.filteringKeys==null&&(this.filteringKeys=new Set,this.filteringKeysCaseFormatted=new Set),this.filteringKeys.add(e),this.filteringKeysCaseFormatted.add(this.caseFormat(e)),this.hasNoAppliedFilteringKeys&&(this.hasNoAppliedFilteringKeys=!1)}hasCaseFormattedFilteringKey(e){return this.filteringKeysCaseFormatted.has(this.caseFormat(e))}hasFilteringKey(e){return this.filteringKeys.has(e)}reset(){this.filteringKeys=null,this.filteringKeysCaseFormatted=null,this.hasNoAppliedFilteringKeys=!1}},hx=class{constructor(e,t,s,i){this.valueSvc=e,this.valueFormatter=t,this.formatter=s,this.column=i,this.displayedKeys=[]}updateDisplayedValuesToAllAvailable(e,t,s){this.displayedKeys=Array.from(s)}updateDisplayedValuesToMatchMiniFilter(e,t,s,i,r){this.displayedKeys=[];for(const a of s)if(a==null)r&&this.displayedKeys.push(a);else{const o=e(a),n=this.valueSvc.formatValue(this.column,null,o,this.valueFormatter,!1),l=this.formatter(n);i(l)&&this.displayedKeys.push(a)}}getDisplayedValueCount(){return this.displayedKeys.length}getDisplayedItem(e){return this.displayedKeys[e]}getSelectAllItem(){return Ye}getAddSelectionToFilterItem(){return Xe}getDisplayedKeys(){return this.displayedKeys}forEachDisplayedKey(e){this.displayedKeys.forEach(e)}someDisplayedKey(e){return this.displayedKeys.some(e)}hasGroups(){return!1}refresh(){}};import{_missing as ux,_warn as px}from"ag-grid-community";var gx=e=>ux(e)?null:!(e instanceof Date)||isNaN(e.getTime())?["NaN"]:[String(e.getFullYear()),String(e.getMonth()+1),String(e.getDate())],An=class{constructor(e,t,s,i){this.formatter=e,this.treeListPathGetter=t,this.treeListFormatter=s,this.treeDataOrGrouping=i,this.allDisplayedItemsTree=[],this.activeDisplayedItemsFlat=[],this.selectAllItem={depth:0,filterPasses:!0,available:!0,treeKey:Ye,children:this.allDisplayedItemsTree,expanded:!0,key:Ye,parentTreeKeys:[]},this.addSelectionToFilterItem={depth:0,filterPasses:!0,available:!0,treeKey:Xe,expanded:!0,key:Xe,parentTreeKeys:[]}}updateOnParamsChange(e){this.treeListFormatter=e}updateDisplayedValuesToAllAvailable(e,t,s,i){i==="reload"?this.generateItemTree(e,t,s):i==="otherFilter"?(this.updateAvailable(s),this.updateExpandAll()):i==="miniFilter"&&(this.resetFilter(),this.updateExpandAll()),this.flattenItems()}updateDisplayedValuesToMatchMiniFilter(e,t,s,i,r,a){a==="reload"?this.generateItemTree(e,t,s):a==="otherFilter"&&this.updateAvailable(s),this.updateFilter(i,r),this.updateExpandAll(),this.flattenItems()}generateItemTree(e,t,s){this.allDisplayedItemsTree=[],this.groupsExist=!1;const i=this.getTreeListPathGetter(e,s);for(const r of t){const a=e(r),o=i(a)??[null];o.length>1&&(this.groupsExist=!0);const n=s.has(r);let l=this.allDisplayedItemsTree,c,d=[];o.forEach((h,u)=>{l||(l=[],c.children=l),c=l.find(p=>p.treeKey?.toUpperCase()===h?.toUpperCase()),c||(c={treeKey:h,depth:u,filterPasses:!0,expanded:!1,available:n,parentTreeKeys:d},u===o.length-1&&(c.key=r),l.push(c)),l=c.children,d=[...d,h]})}this.updateAvailable(s),this.selectAllItem.children=this.allDisplayedItemsTree,this.selectAllItem.expanded=!1}getTreeListPathGetter(e,t){if(this.treeListPathGetter)return this.treeListPathGetter;if(this.treeDataOrGrouping)return i=>i;let s=!1;for(const i of t){const r=e(i);if(r instanceof Date){s=!0;break}else if(r!=null)break}return s?gx:(px(211),i=>[String(i)])}flattenItems(){this.activeDisplayedItemsFlat=[];const e=t=>{t.forEach(s=>{!s.filterPasses||!s.available||(this.activeDisplayedItemsFlat.push(s),s.children&&s.expanded&&e(s.children))})};e(this.allDisplayedItemsTree)}resetFilter(){const e=t=>{t.children&&t.children.forEach(s=>{e(s)}),t.filterPasses=!0};this.allDisplayedItemsTree.forEach(t=>e(t))}updateFilter(e,t){const s=i=>i.available?i.treeKey==null?t:e(this.formatter(this.treeListFormatter?this.treeListFormatter(i.treeKey,i.depth,i.parentTreeKeys):i.treeKey)):!1;this.allDisplayedItemsTree.forEach(i=>this.recursiveItemCheck(i,!1,s,"filterPasses"))}getDisplayedValueCount(){return this.activeDisplayedItemsFlat.length}getDisplayedItem(e){return this.activeDisplayedItemsFlat[e]}getSelectAllItem(){return this.selectAllItem}getAddSelectionToFilterItem(){return this.addSelectionToFilterItem}getDisplayedKeys(){const e=[];return this.forEachDisplayedKey(t=>e.push(t)),e}forEachDisplayedKey(e){const t=(s,i)=>{s.children?(!s.expanded||!i)&&s.children.forEach(r=>{r.filterPasses&&t(r,!1)}):e(s.key)};this.activeDisplayedItemsFlat.forEach(s=>t(s,!0))}someDisplayedKey(e){const t=(s,i)=>{if(s.children){if(!s.expanded||!i)return s.children.some(r=>r.filterPasses?t(r,!1):!1)}else return e(s.key);return!1};return this.activeDisplayedItemsFlat.some(s=>t(s,!0))}hasGroups(){return this.groupsExist}refresh(){this.updateExpandAll(),this.flattenItems()}updateExpandAll(){const e=(s,i,r)=>{for(const a of s){if(!a.filterPasses||!a.available||!a.children)continue;if(i=i||!!a.expanded,r=r||!a.expanded,i&&r)return;const o=e(a.children,i,r);if(o===void 0)return;o?i=!0:r=!0}return i&&r?void 0:i},t=this.getSelectAllItem();t.expanded=e(t.children,!1,!1)}recursiveItemCheck(e,t,s,i){let r=!1;e.children&&e.children.forEach(o=>{const n=this.recursiveItemCheck(o,t||s(e),s,i);r=r||n});const a=t||r||s(e);return e[i]=a,a}updateAvailable(e){const t=s=>e.has(s.key);this.allDisplayedItemsTree.forEach(s=>this.recursiveItemCheck(s,!1,t,"available"))}},mx=class{constructor(e){this.localEventService=new sx,this.miniFilterText=null,this.addCurrentSelectionToFilter=!1,this.providedValues=null,this.allValues=new Map,this.availableKeys=new Set,this.selectedKeys=new Set,this.initialised=!1;const{usingComplexObjects:t,rowGroupColsSvc:s,valueSvc:i,treeDataTreeList:r,groupingTreeList:a,filterParams:o,gos:n,valueFormatter:l,addManagedEventListeners:c}=e,{column:d,colDef:h,textFormatter:u,doesRowPassOtherFilter:p,suppressSorting:g,comparator:m,rowModel:C,values:f,caseSensitive:v,treeList:y,treeListPathGetter:x,treeListFormatter:S}=o;this.filterParams=o,this.gos=n,this.setIsLoading=e.setIsLoading,this.translate=e.translate,this.caseFormat=e.caseFormat,this.createKey=e.createKey,this.usingComplexObjects=!!e.usingComplexObjects,this.formatter=u??(F=>F??null),this.doesRowPassOtherFilters=p,this.suppressSorting=g||!1,this.filteringKeys=new dx({caseFormat:this.caseFormat});const w=m??h.comparator,T=!!r||!!a;this.compareByValue=!!(t&&w||T||y&&!x),T&&!w?this.entryComparator=this.createTreeDataOrGroupingComparator():y&&!x&&!w?this.entryComparator=([F,A],[M,L])=>hr(A,L):this.entryComparator=([F,A],[M,L])=>w(A,L),this.keyComparator=w??hr,this.caseSensitive=!!v;const P=n.get("groupAllowUnbalanced");ox(n,C)&&(this.clientSideValuesExtractor=new cx(C,this.filterParams,this.createKey,this.caseFormat,i,T,!!r,P,c,s)),f==null?this.valuesType=2:(this.valuesType=Array.isArray(f)?0:1,this.providedValues=f),this.displayValueModel=y?new An(this.formatter,x,S,r||a):new hx(i,l,this.formatter,d),this.updateAllValues().then(F=>this.resetSelectionState(F||[]))}addEventListener(e,t,s){this.localEventService.addEventListener(e,t,s)}removeEventListener(e,t,s){this.localEventService.removeEventListener(e,t,s)}updateOnParamsChange(e){return new pt(t=>{const{values:s,textFormatter:i,suppressSorting:r,treeListFormatter:a}=e,o=this.providedValues,n=this.suppressSorting;if(this.filterParams=e,this.formatter=i??(l=>l??null),this.suppressSorting=r||!1,this.providedValues=s??null,this.displayValueModel instanceof An&&this.displayValueModel.updateOnParamsChange(a),this.providedValues!==o||this.suppressSorting!==n){!s||s.length===0?(this.valuesType=2,this.providedValues=null):this.valuesType=Array.isArray(s)?0:1;const l=this.getModel();this.updateAllValues().then(()=>{this.setModel(l).then(()=>t())})}else t()})}refreshValues(){return new pt(e=>{this.allValuesPromise.then(()=>{const t=this.getModel();this.updateAllValues(),this.setModel(t).then(()=>e())})})}overrideValues(e){return new pt(t=>{this.allValuesPromise.then(()=>{this.valuesType=0,this.providedValues=e,this.refreshValues().then(()=>t())})})}refreshAfterAnyFilterChanged(){return this.showAvailableOnly()?this.allValuesPromise.then(e=>(this.updateAvailableKeys(e??[],"otherFilter"),!0)):pt.resolve(!1)}isInitialised(){return this.initialised}updateAllValues(){return this.allValuesPromise=new pt(e=>{switch(this.valuesType){case 2:this.getValuesFromRowsAsync(!1).then(t=>e(this.processAllValues(t)));break;case 0:{e(this.processAllValues(this.uniqueValues(this.validateProvidedValues(this.providedValues))));break}case 1:{this.setIsLoading(!0);const t=this.providedValues,{column:s,colDef:i}=this.filterParams,r=ix(this.gos,{success:a=>{this.setIsLoading(!1),e(this.processAllValues(this.uniqueValues(this.validateProvidedValues(a))))},colDef:i,column:s});window.setTimeout(()=>t(r),0);break}}}),this.allValuesPromise.then(e=>this.updateAvailableKeys(e||[],"reload")).then(()=>this.initialised=!0),this.allValuesPromise}processAllValues(e){const t=this.sortKeys(e);return this.allValues=e??new Map,t}validateProvidedValues(e){if(this.usingComplexObjects&&e?.length){const t=e[0];t&&typeof t!="object"&&typeof t!="function"&&(this.createKey(t)==null?Fn(209):Fn(210))}return e}setValuesType(e){this.valuesType=e}getValuesType(){return this.valuesType}isKeyAvailable(e){return this.availableKeys.has(e)}showAvailableOnly(){return this.valuesType===2}updateAvailableKeys(e,t){const s=this.showAvailableOnly()?this.sortKeys(this.getValuesFromRows(!0)):e;this.availableKeys=new Set(s),this.localEventService.dispatchEvent({type:"availableValuesChanged"}),this.updateDisplayedValues(t,e)}sortKeys(e){const t=e??new Map;if(this.suppressSorting)return Array.from(t.keys());let s;return this.compareByValue?s=Array.from(t.entries()).sort(this.entryComparator).map(([i])=>i):s=Array.from(t.keys()).sort(this.keyComparator),this.filterParams.excelMode&&t.has(null)&&(s=s.filter(i=>i!=null),s.push(null)),s}getParamsForValuesFromRows(e=!1){if(!this.clientSideValuesExtractor)return rx(113),null;const t=i=>!e||this.doesRowPassOtherFilters(i),s=e&&!this.caseSensitive?this.allValues:void 0;return{predicate:t,existingValues:s}}getValuesFromRows(e=!1){const t=this.getParamsForValuesFromRows(e);return t?this.clientSideValuesExtractor.extractUniqueValues(t.predicate,t.existingValues):null}getValuesFromRowsAsync(e=!1){const t=this.getParamsForValuesFromRows(e);return t?this.clientSideValuesExtractor.extractUniqueValuesAsync(t.predicate,t.existingValues):pt.resolve(null)}setMiniFilter(e){return e=ur(e),this.miniFilterText===e?!1:(e===null&&this.setAddCurrentSelectionToFilter(!1),this.miniFilterText=e,this.updateDisplayedValues("miniFilter"),!0)}getMiniFilter(){return this.miniFilterText}updateDisplayedValues(e,t){if(e==="expansion"){this.displayValueModel.refresh();return}if(this.miniFilterText==null){this.displayValueModel.updateDisplayedValuesToAllAvailable(a=>this.getValue(a),t,this.availableKeys,e);return}const s=this.caseFormat(this.formatter(this.miniFilterText)||""),i=a=>a!=null&&this.caseFormat(a).indexOf(s)>=0,r=!!this.filterParams.excelMode&&i(this.translate("blanks"));this.displayValueModel.updateDisplayedValuesToMatchMiniFilter(a=>this.getValue(a),t,this.availableKeys,i,r,e)}getDisplayedValueCount(){return this.displayValueModel.getDisplayedValueCount()}getDisplayedItem(e){return this.displayValueModel.getDisplayedItem(e)}getSelectAllItem(){return this.displayValueModel.getSelectAllItem()}getAddSelectionToFilterItem(){return this.displayValueModel.getAddSelectionToFilterItem()}hasSelections(){return this.filterParams.defaultToNothingSelected?this.selectedKeys.size>0:this.allValues.size!==this.selectedKeys.size}getKeys(){return Array.from(this.allValues.keys())}getValues(){return Array.from(this.allValues.values())}getValue(e){return this.allValues.get(e)}setAddCurrentSelectionToFilter(e){this.addCurrentSelectionToFilter=e}isInWindowsExcelMode(){return this.filterParams.excelMode==="windows"}isAddCurrentSelectionToFilterChecked(){return this.isInWindowsExcelMode()&&this.addCurrentSelectionToFilter}showAddCurrentSelectionToFilter(){return this.isInWindowsExcelMode()&&ax(this.miniFilterText)&&this.miniFilterText.length>0}selectAllMatchingMiniFilter(e=!1){this.miniFilterText==null?this.selectedKeys=new Set(this.allValues.keys()):(e&&this.selectedKeys.clear(),this.displayValueModel.forEachDisplayedKey(t=>this.selectedKeys.add(t)))}deselectAllMatchingMiniFilter(){this.miniFilterText==null?this.selectedKeys.clear():this.displayValueModel.forEachDisplayedKey(e=>this.selectedKeys.delete(e))}selectKey(e){this.selectedKeys.add(e)}deselectKey(e){this.filterParams.excelMode&&this.isEverythingVisibleSelected()&&this.resetSelectionState(this.displayValueModel.getDisplayedKeys()),this.selectedKeys.delete(e)}isKeySelected(e){return this.selectedKeys.has(e)}isEverythingVisibleSelected(){return!this.displayValueModel.someDisplayedKey(e=>!this.isKeySelected(e))}isNothingVisibleSelected(){return!this.displayValueModel.someDisplayedKey(e=>this.isKeySelected(e))}getModel(){if(!this.hasSelections())return null;const e=this.isAddCurrentSelectionToFilterChecked()?this.filteringKeys.allFilteringKeys():null;if(e&&e.size>0){if(this.selectedKeys){const t=new Set([...Array.from(e),...Array.from(this.selectedKeys).filter(s=>!e.has(s))]);return Array.from(t)}return Array.from(e)}return Array.from(this.selectedKeys)}setModel(e){return this.allValuesPromise.then(t=>{if(e==null)this.resetSelectionState(t??[]);else{this.selectedKeys.clear();const s=new Map;this.allValues.forEach((i,r)=>{s.set(this.caseFormat(r),r)}),e.forEach(i=>{const r=this.caseFormat(ur(i)),a=s.get(r);a!==void 0&&this.selectKey(a)})}})}uniqueValues(e){const t=new Map,s=new Set;return(e??[]).forEach(i=>{const r=ur(i),a=this.createKey(r),o=this.caseFormat(a);s.has(o)||(s.add(o),t.set(a,r))}),t}resetSelectionState(e){this.filterParams.defaultToNothingSelected?this.selectedKeys.clear():this.selectedKeys=new Set(e)}hasGroups(){return this.displayValueModel.hasGroups()}createTreeDataOrGroupingComparator(){return([e,t],[s,i])=>{if(t==null)return i==null?0:-1;if(i==null)return 1;for(let r=0;r=i.length)return 1;const a=hr(t[r],i[r]);if(a!==0)return a}return 0}}setAppliedModelKeys(e){this.filteringKeys.setFilteringKeys(e)}addToAppliedModelKeys(e){this.filteringKeys.addFilteringKey(e)}getAppliedModelKeys(){return this.filteringKeys.allFilteringKeys()}getCaseFormattedAppliedModelKeys(){return this.filteringKeys.allFilteringKeysCaseFormatted()}hasAppliedModelKey(e){return this.filteringKeys.hasCaseFormattedFilteringKey(e)}hasAnyAppliedModelKey(){return!this.filteringKeys.hasNoAppliedFilteringKeys}},Rn=class extends Lw{constructor(){super("setFilter"),this.filterType="set",this.eMiniFilter=Vt,this.eFilterLoading=Vt,this.eFilterLoadingIcon=Vt,this.eSetFilterList=Vt,this.eFilterNoMatches=Vt,this.caseSensitive=!1,this.treeDataTreeList=!1,this.groupingTreeList=!1,this.hardRefreshVirtualList=!1,this.noValueFormatterSupplied=!1,this.filterModelFormatter=new Pn,this.updateSetFilterOnParamsChange=e=>{this.setFilterParams=e,this.caseSensitive=!!e.caseSensitive;const t=e.keyCreator??e.colDef.keyCreator;this.setValueFormatter(e.valueFormatter,t,!!e.treeList,!!e.colDef.refData);const s=e.column.getId().startsWith(Dw);this.treeDataTreeList=this.gos.get("treeData")&&!!e.treeList&&s,this.groupingTreeList=!!this.rowGroupColsSvc?.columns.length&&!!e.treeList&&s,this.createKey=this.generateCreateKey(t,this.treeDataTreeList||this.groupingTreeList)}}wireBeans(e){this.rowGroupColsSvc=e.rowGroupColsSvc,this.valueSvc=e.valueSvc,this.dataTypeSvc=e.dataTypeSvc}postConstruct(){super.postConstruct()}updateUiVisibility(){}createBodyTemplate(){return`
${this.translateForSetFilter("loadingOoo")}
${this.translateForSetFilter("noMatches")}
`}getAgComponents(){return[Ew]}handleKeyDown(e){if(super.handleKeyDown(e),!e.defaultPrevented)switch(e.key){case _t.SPACE:this.handleKeySpace(e);break;case _t.ENTER:this.handleKeyEnter(e);break;case _t.LEFT:this.handleKeyLeft(e);break;case _t.RIGHT:this.handleKeyRight(e);break}}handleKeySpace(e){this.getComponentForKeyEvent(e)?.toggleSelected()}handleKeyEnter(e){const{excelMode:t,readOnly:s}=this.setFilterParams;!t||s||(e.preventDefault(),this.onBtApply(!1,!1,e),this.setFilterParams.excelMode==="mac"&&this.eMiniFilter.getInputElement().select())}handleKeyLeft(e){this.getComponentForKeyEvent(e)?.setExpanded(!1)}handleKeyRight(e){this.getComponentForKeyEvent(e)?.setExpanded(!0)}getComponentForKeyEvent(e){if(!this.eSetFilterList.contains(Ow(this.beans)))return;const t=this.virtualList.getLastFocusedRow();if(t==null)return;const s=this.virtualList.getComponentAt(t);if(s==null)return;e.preventDefault();const{readOnly:i}=this.setFilterParams;if(!i)return s}getCssIdentifier(){return"set-filter"}setModel(e){return e==null&&this.valueModel.getModel()==null?(this.setMiniFilter(null),Iw.resolve()):super.setModel(e)}refresh(e){if(this.applyExcelModeOptions(e),!super.refresh(e))return!1;const t=this.setFilterParams;return["treeList","treeListPathGetter","caseSensitive","comparator","excelMode"].some(i=>e[i]!==t?.[i])||this.haveColDefParamsChanged(e)?!1:(super.updateParams(e),this.updateSetFilterOnParamsChange(e),this.updateMiniFilter(),e.suppressSelectAll!==t?.suppressSelectAll&&this.createVirtualListModel(e),this.valueModel.updateOnParamsChange(e).then(()=>{this.isAlive()&&this.refreshFilterValues()}),!0)}haveColDefParamsChanged(e){const{colDef:t,keyCreator:s}=e,{colDef:i,keyCreator:r}=this.setFilterParams,a=s??t.keyCreator,o=r??i?.keyCreator,n=t.filterValueGetter!==i?.filterValueGetter,l=a!==o,c=!!this.dataTypeSvc&&!!a&&this.dataTypeSvc.getFormatValue(t.cellDataType)===a&&t.valueFormatter!==i?.valueFormatter;return n||l||c}setModelAndRefresh(e){return this.valueModel.setModel(e).then(()=>{this.isAlive()&&this.checkAndRefreshVirtualList()})}resetUiToDefaults(){return this.setMiniFilter(null),this.setModelAndRefresh(null)}setModelIntoUi(e){this.setMiniFilter(null);const t=e==null?null:e.values;return this.setModelAndRefresh(t)}getModelFromUi(){const e=this.valueModel.getModel();return e?{values:e,filterType:this.filterType}:null}getValueModel(){return this.valueModel}areModelsEqual(e,t){return e==null&&t==null?!0:e!=null&&t!=null&&kw(e.values,t.values)}setParams(e){this.applyExcelModeOptions(e),super.setParams(e),this.updateSetFilterOnParamsChange(e);const t=e.keyCreator??e.colDef.keyCreator;this.valueModel=new mx({filterParams:e,setIsLoading:s=>this.setIsLoading(s),translate:s=>this.translateForSetFilter(s),caseFormat:s=>this.caseFormat(s),createKey:this.createKey,valueFormatter:this.valueFormatter,usingComplexObjects:!!t,gos:this.gos,rowGroupColsSvc:this.rowGroupColsSvc,valueSvc:this.valueSvc,treeDataTreeList:this.treeDataTreeList,groupingTreeList:this.groupingTreeList,addManagedEventListeners:s=>this.addManagedEventListeners(s)}),this.initialiseFilterBodyUi(),this.addEventListenersForDataChanges()}onAddCurrentSelectionToFilterChange(e){this.valueModel.setAddCurrentSelectionToFilter(e)}setValueFormatter(e,t,s,i){let r=e;if(!r){if(t&&!s){wn(249);return}this.noValueFormatterSupplied=!0,i||(r=a=>nr(a.value))}this.valueFormatter=r}generateCreateKey(e,t){return t&&!e?(wn(250),()=>null):e?(s,i=null)=>{const r=this.getKeyCreatorParams(s,i);return xn(e(r))}:s=>xn(nr(s))}getFormattedValue(e){let t=this.valueModel.getValue(e);this.noValueFormatterSupplied&&(this.treeDataTreeList||this.groupingTreeList)&&Array.isArray(t)&&(t=Nw(t));const s=this.valueSvc.formatValue(this.setFilterParams.column,null,t,this.valueFormatter,!1);return s??nr(t)??this.translateForSetFilter("blanks")}applyExcelModeOptions(e){e.excelMode==="windows"?(e.buttons||(e.buttons=["apply","cancel"]),e.closeOnApply==null&&(e.closeOnApply=!0)):e.excelMode==="mac"&&(e.buttons||(e.buttons=["reset"]),e.applyMiniFilterWhileTyping==null&&(e.applyMiniFilterWhileTyping=!0),e.debounceMs==null&&(e.debounceMs=500)),e.excelMode&&e.defaultToNothingSelected&&(e.defaultToNothingSelected=!1,Bw(207))}addEventListenersForDataChanges(){this.isValuesTakenFromGrid()&&(this.addManagedPropertyListeners(["groupAllowUnbalanced"],()=>{this.syncAfterDataChange()}),this.addManagedEventListeners({cellValueChanged:e=>{e.column===this.setFilterParams.column&&this.syncAfterDataChange()}}))}syncAfterDataChange(){const e=!this.applyActive||this.areModelsEqual(this.getModel(),this.getModelFromUi());return this.valueModel.refreshValues().then(()=>{this.isAlive()&&(this.checkAndRefreshVirtualList(),e&&this.onBtApply(!1,!0))})}setIsLoading(e){or(this.eFilterLoading,e),e||(this.hardRefreshVirtualList=!0)}initialiseFilterBodyUi(){this.initVirtualList(),this.initMiniFilter(),this.initLoading()}initLoading(){const e=Gw("setFilterLoading",this.beans,this.setFilterParams.column);e&&this.eFilterLoadingIcon.appendChild(e)}initVirtualList(){const t=this.getLocaleTextFunc()("ariaFilterList","Filter List"),s=!!this.setFilterParams.treeList,i=this.virtualList=this.createBean(new lt({cssIdentifier:"filter",ariaRole:s?"tree":"listbox",listName:t})),r=this.eSetFilterList;s&&r.classList.add("ag-set-filter-tree-list"),r&&r.appendChild(i.getGui());const{cellHeight:a}=this.setFilterParams;a!=null&&i.setRowHeight(a);const o=(l,c)=>this.createSetListItem(l,s,c);i.setComponentCreator(o);const n=(l,c)=>this.updateSetListItem(l,c);i.setComponentUpdater(n),this.createVirtualListModel(this.setFilterParams)}createVirtualListModel(e){let t;e.suppressSelectAll?t=new fx(this.valueModel):t=new Cx(this.valueModel,()=>this.isSelectAllSelected()),e.treeList&&(t=new vx(t)),this.virtualList.setModel(t)}getSelectAllLabel(){const e=this.valueModel.getMiniFilter()==null||!this.setFilterParams.excelMode?"selectAll":"selectAllSearchResults";return this.translateForSetFilter(e)}getAddSelectionToFilterLabel(){return this.translateForSetFilter("addCurrentSelectionToFilter")}createSetListItem(e,t,s){const i=this.valueModel.hasGroups(),{isSelected:r,isExpanded:a}=this.isSelectedExpanded(e),{value:o,depth:n,isGroup:l,hasIndeterminateExpandState:c,selectedListener:d,expandedListener:h}=this.newSetListItemAttributes(e),u={focusWrapper:s,value:o,params:this.setFilterParams,translate:g=>this.translateForSetFilter(g),valueFormatter:this.valueFormatter,item:e,isSelected:r,isTree:t,depth:n,groupsExist:i,isGroup:l,isExpanded:a,hasIndeterminateExpandState:c},p=this.createBean(new Jw(u));return p.addEventListener("selectionChanged",d),h&&p.addEventListener("expandedChanged",h),p}newSetTreeItemAttributes(e){const t=this.valueModel.hasGroups();return e.key===Ye?{value:()=>this.getSelectAllLabel(),isGroup:t,depth:e.depth,hasIndeterminateExpandState:!0,selectedListener:s=>this.onSelectAll(s.isSelected),expandedListener:s=>this.onExpandAll(s.item,s.isExpanded)}:e.key===Xe?{value:()=>this.getAddSelectionToFilterLabel(),depth:e.depth,isGroup:!1,hasIndeterminateExpandState:!1,selectedListener:s=>{this.onAddCurrentSelectionToFilterChange(s.isSelected)}}:e.children?{value:this.setFilterParams.treeListFormatter?.(e.treeKey,e.depth,e.parentTreeKeys)??e.treeKey,depth:e.depth,isGroup:!0,selectedListener:s=>this.onGroupItemSelected(s.item,s.isSelected),expandedListener:s=>this.onExpandedChanged(s.item,s.isExpanded)}:{value:this.setFilterParams.treeListFormatter?.(e.treeKey,e.depth,e.parentTreeKeys)??e.treeKey,depth:e.depth,selectedListener:s=>this.onItemSelected(s.item.key,s.isSelected)}}newSetListItemAttributes(e){return this.isSetFilterModelTreeItem(e)?this.newSetTreeItemAttributes(e):e===Ye?{value:()=>this.getSelectAllLabel(),selectedListener:t=>this.onSelectAll(t.isSelected)}:e===Xe?{value:()=>this.getAddSelectionToFilterLabel(),selectedListener:t=>{this.onAddCurrentSelectionToFilterChange(t.isSelected)}}:{value:this.valueModel.getValue(e),selectedListener:t=>this.onItemSelected(t.item,t.isSelected)}}updateSetListItem(e,t){const{isSelected:s,isExpanded:i}=this.isSelectedExpanded(e);t.refresh(e,s,i)}isSelectedExpanded(e){let t,s;return this.isSetFilterModelTreeItem(e)?(s=e.expanded,e.key===Ye?t=this.isSelectAllSelected():e.key===Xe?t=this.valueModel.isAddCurrentSelectionToFilterChecked():e.children?t=this.areAllChildrenSelected(e):t=this.valueModel.isKeySelected(e.key)):e===Ye?t=this.isSelectAllSelected():e===Xe?t=this.valueModel.isAddCurrentSelectionToFilterChecked():t=this.valueModel.isKeySelected(e),{isSelected:t,isExpanded:s}}isSetFilterModelTreeItem(e){return e?.treeKey!==void 0}initMiniFilter(){const{eMiniFilter:e}=this,t=this.getLocaleTextFunc();e.setDisplayed(!this.setFilterParams.suppressMiniFilter),e.setValue(this.valueModel.getMiniFilter()),e.onValueChange(()=>this.onMiniFilterInput()),e.setInputAriaLabel(t("ariaSearchFilterValues","Search filter values")),this.addManagedElementListeners(e.getInputElement(),{keydown:s=>this.onMiniFilterKeyDown(s)})}updateMiniFilter(){const{eMiniFilter:e}=this;e.isDisplayed()!==!this.setFilterParams.suppressMiniFilter&&e.setDisplayed(!this.setFilterParams.suppressMiniFilter);const t=this.valueModel.getMiniFilter();e.getValue()!==t&&e.setValue(t)}afterGuiAttached(e){super.afterGuiAttached(e),this.resetExpansion(),this.refreshVirtualList();const{eMiniFilter:t}=this;t.setInputPlaceholder(this.translateForSetFilter("searchOoo")),(!e||!e.suppressFocus)&&(t.isDisplayed()?t.getFocusableElement().focus():this.virtualList.awaitStable(()=>this.virtualList.focusRow(0)))}afterGuiDetached(){super.afterGuiDetached(),this.setFilterParams.excelMode&&this.resetMiniFilter();const e=this.getModel();(this.setFilterParams.excelMode||!this.areModelsEqual(e,this.getModelFromUi()))&&(this.resetUiToActiveModel(e),this.showOrHideResults())}applyModel(e="api"){this.setFilterParams.excelMode&&e!=="rowDataUpdated"&&this.valueModel.isEverythingVisibleSelected()&&this.valueModel.selectAllMatchingMiniFilter();const t=this.valueModel.showAddCurrentSelectionToFilter()&&this.valueModel.isAddCurrentSelectionToFilterChecked();if(t&&!this.getModel())return!1;const s=super.applyModel(e),i=this.getModel();return i?(t||this.valueModel.setAppliedModelKeys(new Set),i.values.forEach(r=>{this.valueModel.addToAppliedModelKeys(r)})):t||this.valueModel.setAppliedModelKeys(null),s}isModelValid(e){return this.setFilterParams.excelMode?e==null||e.values.length>0:!0}doesFilterPass(e){if(!this.valueModel.getCaseFormattedAppliedModelKeys())return!0;if(!this.valueModel.hasAnyAppliedModelKey())return!1;const{node:t}=e;if(this.treeDataTreeList)return this.doesFilterPassForTreeData(t);if(this.groupingTreeList)return this.doesFilterPassForGrouping(t);const s=this.getValueFromNode(t);return s!=null&&Array.isArray(s)?s.length===0?this.valueModel.hasAppliedModelKey(null):s.some(i=>this.isInAppliedModel(this.createKey(i,t))):this.isInAppliedModel(this.createKey(s,t))}doesFilterPassForTreeData(e){return e.childrenAfterGroup?.length?!1:this.isInAppliedModel(this.createKey(dr(e.getRoute()??[e.key??e.id],!0,this.gos.get("groupAllowUnbalanced"))))}doesFilterPassForGrouping(e){const t=(this.rowGroupColsSvc?.columns??[]).map(s=>this.valueSvc.getKeyForNode(s,e));return t.push(this.getValueFromNode(e)),this.isInAppliedModel(this.createKey(dr(t,!1,this.gos.get("groupAllowUnbalanced"))))}isInAppliedModel(e){return this.valueModel.hasAppliedModelKey(e)}getValueFromNode(e){return this.setFilterParams.getValue(e)}getKeyCreatorParams(e,t=null){const{colDef:s,column:i,api:r,context:a}=this.setFilterParams;return{value:e,colDef:s,column:i,node:t,data:t?.data,api:r,context:a}}onNewRowsLoaded(){this.isValuesTakenFromGrid()&&this.syncAfterDataChange()}isValuesTakenFromGrid(){return this.valueModel.getValuesType()===2}setFilterValues(e){this.valueModel.overrideValues(e).then(()=>{this.isAlive()&&(this.checkAndRefreshVirtualList(),this.onUiChanged())})}resetFilterValues(){this.valueModel.setValuesType(2),this.syncAfterDataChange()}refreshFilterValues(){this.valueModel.isInitialised()&&this.valueModel.refreshValues().then(()=>{this.isAlive()&&(this.hardRefreshVirtualList=!0,this.checkAndRefreshVirtualList(),this.onUiChanged())})}onAnyFilterChanged(){setTimeout(()=>{this.isAlive()&&this.valueModel.refreshAfterAnyFilterChanged().then(e=>{e&&this.isAlive()&&(this.checkAndRefreshVirtualList(),this.showOrHideResults())})},0)}onMiniFilterInput(){if(!this.valueModel.setMiniFilter(this.eMiniFilter.getValue()))return;const{applyMiniFilterWhileTyping:e,readOnly:t}=this.setFilterParams;!t&&e?this.filterOnAllVisibleValues(!1):this.updateUiAfterMiniFilterChange()}updateUiAfterMiniFilterChange(){const{excelMode:e,readOnly:t}=this.setFilterParams;e==null||t?this.checkAndRefreshVirtualList():this.valueModel.getMiniFilter()==null?this.resetUiToActiveModel(this.getModel()):(this.valueModel.selectAllMatchingMiniFilter(!0),this.checkAndRefreshVirtualList(),this.onUiChanged()),this.showOrHideResults()}showOrHideResults(){const e=this.valueModel.getMiniFilter()!=null&&this.valueModel.getDisplayedValueCount()<1;or(this.eFilterNoMatches,e),or(this.eSetFilterList,!e)}resetMiniFilter(){this.eMiniFilter.setValue(null,!0),this.valueModel.setMiniFilter(null)}resetUiToActiveModel(e,t){this.setModelAndRefresh(e==null?null:e.values).then(()=>{this.isAlive()&&(this.onUiChanged(!1,"prevent"),t?.())})}handleCancelEnd(e){this.setMiniFilter(null),super.handleCancelEnd(e)}onMiniFilterKeyDown(e){const{excelMode:t,readOnly:s}=this.setFilterParams;e.key===_t.ENTER&&!t&&!s&&this.filterOnAllVisibleValues()}filterOnAllVisibleValues(e=!0){this.valueModel.selectAllMatchingMiniFilter(!0),this.checkAndRefreshVirtualList(),this.onUiChanged(!1,e?"immediately":"debounce"),this.showOrHideResults()}focusRowIfAlive(e){e!=null&&window.setTimeout(()=>{this.isAlive()&&this.virtualList.focusRow(e)},0)}onSelectAll(e){e?this.valueModel.selectAllMatchingMiniFilter():this.valueModel.deselectAllMatchingMiniFilter(),this.refreshAfterSelection()}onGroupItemSelected(e,t){const s=i=>{i.filterPasses&&(i.children?i.children.forEach(r=>s(r)):this.selectItem(i.key,t))};s(e),this.refreshAfterSelection()}onItemSelected(e,t){this.selectItem(e,t),this.refreshAfterSelection()}selectItem(e,t){t?this.valueModel.selectKey(e):this.valueModel.deselectKey(e)}onExpandAll(e,t){const s=i=>{i.filterPasses&&i.available&&i.children&&(i.children.forEach(r=>s(r)),i.expanded=t)};s(e),this.refreshAfterExpansion()}onExpandedChanged(e,t){e.expanded=t,this.refreshAfterExpansion()}refreshAfterExpansion(){const e=this.virtualList.getLastFocusedRow();this.valueModel.updateDisplayedValues("expansion"),this.checkAndRefreshVirtualList(),this.focusRowIfAlive(e)}refreshAfterSelection(){const e=this.virtualList.getLastFocusedRow();this.checkAndRefreshVirtualList(),this.onUiChanged(),this.focusRowIfAlive(e)}setMiniFilter(e){this.eMiniFilter.setValue(e),this.onMiniFilterInput()}getMiniFilter(){return this.valueModel.getMiniFilter()}checkAndRefreshVirtualList(){this.virtualList.refresh(!this.hardRefreshVirtualList),this.hardRefreshVirtualList&&(this.hardRefreshVirtualList=!1)}getFilterKeys(){return this.valueModel.getKeys()}getFilterValues(){return this.valueModel.getValues()}getValues(){return this.getFilterKeys()}refreshVirtualList(){this.setFilterParams.refreshValuesOnOpen?this.refreshFilterValues():this.checkAndRefreshVirtualList()}translateForSetFilter(e){return this.getLocaleTextFunc()(e,_w[e])}isSelectAllSelected(){if(this.setFilterParams.defaultToNothingSelected){if(this.valueModel.hasSelections()&&this.valueModel.isEverythingVisibleSelected())return!0;if(this.valueModel.isNothingVisibleSelected())return!1}else{if(this.valueModel.hasSelections()&&this.valueModel.isNothingVisibleSelected())return!1;if(this.valueModel.isEverythingVisibleSelected())return!0}}areAllChildrenSelected(e){const t=s=>{if(s.children){let i=!1,r=!1;return s.children.some(o=>{if(!o.filterPasses||!o.available)return!1;const n=t(o);return n===void 0?!0:(n?i=!0:r=!0,i&&r)})?void 0:i}else return this.valueModel.isKeySelected(s.key)};return this.setFilterParams.defaultToNothingSelected?this.valueModel.hasSelections()&&t(e):t(e)}destroy(){this.virtualList=this.destroyBean(this.virtualList),super.destroy()}caseFormat(e){return e==null||typeof e!="string"||this.caseSensitive?e:e.toUpperCase()}resetExpansion(){if(!this.setFilterParams.treeList)return;const e=this.valueModel.getSelectAllItem();if(this.isSetFilterModelTreeItem(e)){const t=s=>{s.children&&(s.children.forEach(i=>t(i)),s.expanded=!1)};t(e),this.valueModel.updateDisplayedValues("expansion")}}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e,this)}getPositionableElement(){return this.eSetFilterList}},fx=class{constructor(e){this.model=e}getRowCount(){return this.model.getDisplayedValueCount()}getRow(e){return this.model.getDisplayedItem(e)}areRowsEqual(e,t){return e===t}},Cx=class{constructor(e,t){this.model=e,this.isSelectAllSelected=t}getRowCount(){const t=this.model.showAddCurrentSelectionToFilter()?2:1;return this.model.getDisplayedValueCount()+t}getRow(e){if(e===0)return this.model.getSelectAllItem();const t=this.model.showAddCurrentSelectionToFilter(),s=t?2:1;return e===1&&t?this.model.getAddSelectionToFilterItem():this.model.getDisplayedItem(e-s)}areRowsEqual(e,t){return e===t}},vx=class{constructor(e){this.model=e}getRowCount(){return this.model.getRowCount()}getRow(e){return this.model.getRow(e)}areRowsEqual(e,t){return e==null&&t==null?!0:e!=null&&t!=null&&e.treeKey===t.treeKey&&e.depth===t.depth}};import{AgInputTextFieldSelector as yx,Component as Sx,RefPlaceholder as bx,_error as wx}from"ag-grid-community";var xx=class extends Sx{constructor(){super(` `,[yx]),this.eFloatingFilterText=bx,this.availableValuesListenerAdded=!1,this.filterModelFormatter=new Pn}wireBeans(e){this.colNames=e.colNames}init(e){this.params=e,this.eFloatingFilterText.setDisabled(!0).addGuiEventListener("click",()=>this.params.showParentFilter()),this.setParams(e)}setParams(e){const t=this.colNames.getDisplayNameForColumn(e.column,"header",!0),s=this.getLocaleTextFunc();this.eFloatingFilterText.setInputAriaLabel(`${t} ${s("ariaFilterInput","Filter Input")}`)}refresh(e){this.params=e,this.setParams(e)}onParentModelChanged(e){this.updateFloatingFilterText(e)}parentSetFilterInstance(e){this.params.parentFilterInstance(t=>{if(!(t instanceof Rn)){wx(248);return}e(t)})}addAvailableValuesListener(){this.parentSetFilterInstance(e=>{const t=e.getValueModel();t&&this.addManagedListeners(t,{availableValuesChanged:()=>this.updateFloatingFilterText()})}),this.availableValuesListenerAdded=!0}updateFloatingFilterText(e){this.availableValuesListenerAdded||this.addAvailableValuesListener(),this.parentSetFilterInstance(t=>{this.eFloatingFilterText.setValue(this.filterModelFormatter.getModelAsString(e,t))})}},En={moduleName:"SetFilter",version:R,userComponents:{agSetColumnFilter:Rn,agSetColumnFloatingFilter:xx},icons:{setFilterGroupClosed:"tree-closed",setFilterGroupOpen:"tree-open",setFilterGroupIndeterminate:"tree-indeterminate",setFilterLoading:"loading"},dependsOn:[G,Rw]};import{_KeyboardNavigationModule as Tx}from"ag-grid-community";import{AgPromise as Gs,Component as Mx,RefPlaceholder as pr,_addGridCommonParams as In,_removeFromParent as Px}from"ag-grid-community";var Fx=".ag-status-bar{border-top:var(--ag-footer-row-border);display:flex;justify-content:space-between;line-height:1.5;overflow:hidden;padding-left:calc(var(--ag-spacing)*4);padding-right:calc(var(--ag-spacing)*4)}.ag-status-panel{display:inline-flex}.ag-status-name-value{color:var(--ag-status-bar-label-color);font-weight:var(--ag-status-bar-label-font-weight);margin-left:var(--ag-spacing);margin-right:var(--ag-spacing);padding-bottom:var(--ag-widget-container-vertical-padding);padding-top:var(--ag-widget-container-vertical-padding);white-space:nowrap}.ag-status-name-value-value{color:var(--ag-status-bar-value-color);font-weight:var(--ag-status-bar-value-font-weight)}.ag-status-bar-left{display:inline-flex}.ag-status-bar-center{display:inline-flex;text-align:center}.ag-status-bar-right{display:inline-flex}";function Ax(e,t,s){return e.getCompDetails(t,Rx,void 0,s,!0)}var Rx={name:"statusPanel",optionalMethods:["refresh"]},Ex=class extends Mx{constructor(){super(`
`),this.updateQueued=!1,this.panelsPromise=Gs.resolve(),this.eStatusBarLeft=pr,this.eStatusBarCenter=pr,this.eStatusBarRight=pr,this.compDestroyFunctions={},this.registerCSS(Fx)}wireBeans(e){this.userCompFactory=e.userCompFactory,this.statusBarSvc=e.statusBarSvc}postConstruct(){this.processStatusPanels(new Map),this.addManagedPropertyListeners(["statusBar"],this.handleStatusBarChanged.bind(this))}processStatusPanels(e){const t=this.gos.get("statusBar")?.statusPanels;if(t){const s=t.filter(a=>a.align==="left"),i=t.filter(a=>a.align==="center"),r=t.filter(a=>!a.align||a.align==="right");this.panelsPromise=Gs.all([this.createAndRenderComponents(s,this.eStatusBarLeft,e),this.createAndRenderComponents(i,this.eStatusBarCenter,e),this.createAndRenderComponents(r,this.eStatusBarRight,e)])}else this.setDisplayed(!1)}handleStatusBarChanged(){this.updateQueued||(this.updateQueued=!0,this.panelsPromise.then(()=>{this.updateStatusBar(),this.updateQueued=!1}))}updateStatusBar(){const e=this.gos.get("statusBar")?.statusPanels,t=Array.isArray(e)&&e.length>0;this.setDisplayed(t);const s=new Map;t&&e.forEach(i=>{const r=i.key??i.statusPanel,a=this.statusBarSvc.getStatusPanel(r);if(a?.refresh){const o=In(this.gos,i.statusPanelParams??{});a.refresh(o)&&(s.set(r,a),delete this.compDestroyFunctions[r],Px(a.getGui()))}}),this.resetStatusBar(),t&&this.processStatusPanels(s)}resetStatusBar(){this.eStatusBarLeft.innerHTML="",this.eStatusBarCenter.innerHTML="",this.eStatusBarRight.innerHTML="",this.destroyComponents(),this.statusBarSvc.unregisterAllComponents()}destroy(){this.destroyComponents(),super.destroy()}destroyComponents(){Object.values(this.compDestroyFunctions).forEach(e=>e()),this.compDestroyFunctions={}}createAndRenderComponents(e,t,s){const i=[];return e.forEach(r=>{const a=r.key||r.statusPanel,o=s.get(a);let n;if(o)n=Gs.resolve(o);else{const l=Ax(this.userCompFactory,r,In(this.gos,{}));if(l==null)return;n=l.newAgStackInstance()}i.push({key:a,promise:n})}),Gs.all(i.map(r=>r.promise)).then(()=>{i.forEach(r=>{r.promise.then(a=>{const o=()=>{this.destroyBean(a)};this.isAlive()?(this.statusBarSvc.registerStatusPanel(r.key,a),t.appendChild(a.getGui()),this.compDestroyFunctions[r.key]=o):o()})})})}},Ix={selector:"AG-STATUS-BAR",component:Ex};import{Component as Dx,RefPlaceholder as Ht,_createCellId as Lx,_exists as kx,_formatNumberCommas as Gx,_getRowNode as Ox,_isClientSideRowModel as Nx,_isRowBefore as Bx,_isServerSideRowModel as _x,_missing as gr,_warn as Vx}from"ag-grid-community";import{Component as Hx,RefPlaceholder as Dn}from"ag-grid-community";var zt=class extends Hx{constructor(){super(`
`),this.eLabel=Dn,this.eValue=Dn}setLabel(e,t){this.setDisplayed(!1);const s=this.getLocaleTextFunc();this.eLabel.innerHTML=s(e,t)}setValue(e){this.eValue.innerHTML=e}},zx={selector:"AG-NAME-VALUE",component:zt};function Ux(e,t){return typeof e!="number"?"":Gx(Math.round(e*100)/100,t)}var Kx=class extends Dx{constructor(){super(`
`,[zx]),this.sumAggregationComp=Ht,this.countAggregationComp=Ht,this.minAggregationComp=Ht,this.maxAggregationComp=Ht,this.avgAggregationComp=Ht}postConstruct(){if(!Nx(this.gos)&&!_x(this.gos)){Vx(221);return}this.avgAggregationComp.setLabel("avg","Average"),this.countAggregationComp.setLabel("count","Count"),this.minAggregationComp.setLabel("min","Min"),this.maxAggregationComp.setLabel("max","Max"),this.sumAggregationComp.setLabel("sum","Sum"),this.addManagedEventListeners({cellSelectionChanged:this.onCellSelectionChanged.bind(this),modelUpdated:this.onCellSelectionChanged.bind(this)})}init(e){this.refresh(e)}refresh(e){return this.params=e,this.onCellSelectionChanged(),!0}setAggregationComponentValue(e,t,s){const i=this.getAllowedAggregationValueComponent(e);kx(i)&&i?(i.setValue(Ux(t,this.getLocaleTextFunc.bind(this))),i.setDisplayed(s)):this.getAggregationValueComponent(e)?.setDisplayed(!1)}getAllowedAggregationValueComponent(e){const{aggFuncs:t}=this.params;return!t||t.includes(e)?this.getAggregationValueComponent(e):null}getAggregationValueComponent(e){const t=`${e}AggregationComp`;return this[t]}onCellSelectionChanged(){const e=this.beans,{rangeSvc:t,valueSvc:s,cellNavigation:i}=e,r=t?.getCellRanges();let a=0,o=0,n=0,l=null,c=null;const d={};if(r?.length&&t)for(let p=0;p{if(m===null)return;const y=Lx({rowPinned:m.rowPinned,column:v,rowIndex:m.rowIndex});if(d[y])return;d[y]=!0;const x=Ox(e,m);if(gr(x))return;let S=s.getValue(v,x);gr(S)||S===""||(o++,!(typeof S=="object"&&"value"in S&&(S=S.value,S===""))&&(typeof S=="string"&&(S=Number(S)),typeof S=="number"&&!isNaN(S)&&(a+=S,(c===null||S>c)&&(c=S),(l===null||S1,u=n>1;this.setAggregationComponentValue("count",o,h),this.setAggregationComponentValue("sum",a,u),this.setAggregationComponentValue("min",l,u),this.setAggregationComponentValue("max",c,u),this.setAggregationComponentValue("avg",a/n,u)}};import{_formatNumberCommas as Wx,_isClientSideRowModel as jx,_warn as $x}from"ag-grid-community";var Yx=class extends zt{postConstruct(){if(this.setLabel("filteredRows","Filtered"),!jx(this.gos)){$x(222);return}this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-filtered-row-count"),this.setDisplayed(!0);const e=this.onDataChanged.bind(this);this.addManagedEventListeners({modelUpdated:e}),e()}onDataChanged(){const e=this.getTotalRowCountValue(),t=this.getFilteredRowCountValue();this.setValue(Wx(t,this.getLocaleTextFunc.bind(this))),this.setDisplayed(e!==t)}getTotalRowCountValue(){let e=0;return this.beans.rowModel.forEachNode(()=>e+=1),e}getFilteredRowCountValue(){let e=0;return this.beans.rowModel.forEachNodeAfterFilter(t=>{t.group||(e+=1)}),e}init(){}refresh(){return!0}};import{_formatNumberCommas as Xx,_isClientSideRowModel as qx,_isServerSideRowModel as Zx,_warn as Jx}from"ag-grid-community";var Qx=class extends zt{postConstruct(){const e=this.gos;if(!qx(e)&&!Zx(e)){Jx(223);return}this.setLabel("selectedRows","Selected"),this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-selected-row-count"),this.onRowSelectionChanged();const t=this.onRowSelectionChanged.bind(this);this.addManagedEventListeners({modelUpdated:t,selectionChanged:t})}onRowSelectionChanged(){const e=this.beans.selectionSvc?.getSelectionCount()??0;if(e<0){this.setValue("?"),this.setDisplayed(!0);return}this.setValue(Xx(e,this.getLocaleTextFunc.bind(this))),this.setDisplayed(e>0)}init(){}refresh(){return!0}};import{_formatNumberCommas as Ln,_isClientSideRowModel as eT,_warn as tT}from"ag-grid-community";var sT=class extends zt{postConstruct(){if(!eT(this.gos)){tT(224);return}this.setLabel("totalAndFilteredRows","Rows"),this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-total-and-filtered-row-count"),this.setDisplayed(!0),this.addManagedEventListeners({modelUpdated:this.onDataChanged.bind(this)}),this.onDataChanged()}onDataChanged(){const e=this.getLocaleTextFunc.bind(this),t=Ln(this.getFilteredRowCountValue(),e),s=Ln(this.getTotalRowCount(),e);if(t===s)this.setValue(t);else{const i=this.getLocaleTextFunc();this.setValue(`${t} ${i("of","of")} ${s}`)}}getFilteredRowCountValue(){let e=0;return this.beans.rowModel.forEachNodeAfterFilter(t=>{t.group||e++}),e}getTotalRowCount(){let e=0;return this.beans.rowModel.forEachNode(t=>{t.group||e++}),e}init(){}refresh(){return!0}};import{_formatNumberCommas as iT,_isClientSideRowModel as rT,_warn as aT}from"ag-grid-community";var oT=class extends zt{postConstruct(){if(this.setLabel("totalRows","Total Rows"),!rT(this.gos)){aT(225);return}this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-total-row-count"),this.setDisplayed(!0),this.addManagedEventListeners({modelUpdated:this.onDataChanged.bind(this)}),this.onDataChanged()}onDataChanged(){this.setValue(iT(this.getRowCountValue(),this.getLocaleTextFunc.bind(this)))}getRowCountValue(){let e=0;return this.beans.rowModel.forEachLeafNode(()=>e+=1),e}init(){}refresh(){return!0}};import{_unwrapUserComp as nT}from"ag-grid-community";function lT(e,t){const s=e.statusBarSvc?.getStatusPanel(t);return nT(s)}import{BeanStub as cT}from"ag-grid-community";var dT=class extends cT{constructor(){super(),this.beanName="statusBarSvc",this.comps=new Map}registerStatusPanel(e,t){this.comps.set(e,t)}unregisterStatusPanel(e){this.comps.delete(e)}unregisterAllComponents(){this.comps.clear()}getStatusPanel(e){return this.comps.get(e)}destroy(){this.unregisterAllComponents(),super.destroy()}},kn={moduleName:"StatusBar",version:R,beans:[dT],userComponents:{agAggregationComponent:Kx,agTotalRowCountComponent:oT,agFilteredRowCountComponent:Yx,agTotalAndFilteredRowCountComponent:sT,agSelectedRowCountComponent:Qx},selectors:[Ix],apiFunctions:{getStatusPanel:lT},dependsOn:[G,Tx]};import{_SharedExportModule as hT}from"ag-grid-community";import{_warn as uT}from"ag-grid-community";function Gn(e){return e.excelCreator?.getFactoryMode()==="MULTI_SHEET"?(uT(161),!1):!0}function pT(e,t){if(Gn(e))return e.excelCreator?.getDataAsExcel(t)}function gT(e,t){Gn(e)&&e.excelCreator?.exportDataAsExcel(t)}function mT(e,t){return e.excelCreator?.setFactoryMode("MULTI_SHEET"),e.excelCreator?.getSheetDataForExcel(t)}function fT(e,t){return e.excelCreator?.getMultipleSheetsAsExcel(t)}function CT(e,t){e.excelCreator?.exportMultipleSheetsAsExcel(t)}var On={moduleName:"ExcelExport",version:R,beans:[kg],apiFunctions:{getDataAsExcel:pT,exportDataAsExcel:gT,getSheetDataForExcel:mT,getMultipleSheetsAsExcel:fT,exportMultipleSheetsAsExcel:CT},dependsOn:[hT,G]};import{_ColumnFilterModule as vT}from"ag-grid-community";import{AgPromise as ye,KeyCode as Ut,ProvidedFilter as Nn,TabGuardComp as yT,_focusInto as ST,_getActiveDomElement as bT,_getFilterDetails as wT,_isNothingFocused as xT,_loadTemplate as TT,_removeFromArray as MT,_setAriaRole as PT}from"ag-grid-community";import{AgCheckboxSelector as FT,AgToggleButton as AT,Component as Os,KeyCode as Kt,RefPlaceholder as gt,_createIcon as Bn,_setAriaExpanded as RT,_setDisplayed as qe}from"ag-grid-community";function ET(e){const t=e.cssIdentifier||"default",s=e.direction||"vertical";return` `}var Se=class extends Os{constructor(e={}){super(ET(e),[FT]),this.params=e,this.suppressEnabledCheckbox=!0,this.suppressToggleExpandOnEnableChange=!1,this.eToolbar=gt,this.cbGroupEnabled=gt,this.eContainer=gt;const{enabled:t,items:s,suppressEnabledCheckbox:i,expanded:r,suppressToggleExpandOnEnableChange:a,useToggle:o}=e;this.cssIdentifier=e.cssIdentifier||"default",this.enabled=t??!0,this.items=s||[],this.useToggle=o??!1,this.alignItems=e.alignItems||"center",this.expanded=r??!0,i!=null&&(this.suppressEnabledCheckbox=i),a!=null&&(this.suppressToggleExpandOnEnableChange=a)}postConstruct(){if(this.setupTitleBar(),this.items.length){const r=this.items;this.items=[],this.addItems(r)}const e=this.getLocaleTextFunc();this.cbGroupEnabled.setLabel(e("enabled","Enabled")),this.enabled&&this.setEnabled(this.enabled,void 0,!0),this.setAlignItems(this.alignItems);const{onEnableChange:t,onExpandedChange:s,suppressOpenCloseIcons:i}=this.params;this.hideEnabledCheckbox(this.suppressEnabledCheckbox),this.hideOpenCloseIcons(i??!1),this.refreshChildDisplay(),qe(this.eContainer,this.expanded),this.cbGroupEnabled.onValueChange(r=>{this.setEnabled(r,!0,this.suppressToggleExpandOnEnableChange),this.dispatchEnableChangeEvent(r)}),t!=null&&this.onEnableChange(t),s!=null&&this.onExpandedChange(s)}refreshChildDisplay(){qe(this.eToolbar,this.expanded&&!this.suppressEnabledCheckbox),this.eTitleBar?.refreshOnExpand(this.expanded)}isExpanded(){return this.expanded}setAlignItems(e){this.alignItems!==e&&this.removeCssClass(`ag-group-item-alignment-${this.alignItems}`),this.alignItems=e;const t=`ag-group-item-alignment-${this.alignItems}`;return this.addCssClass(t),this}toggleGroupExpand(e,t){if(this.eTitleBar?.isSuppressCollapse()&&!this.useToggle)e=!0,t=!0;else if(e=e??!this.expanded,this.expanded===e)return this;return this.expanded=e,this.refreshChildDisplay(),qe(this.eContainer,e),t||this.dispatchLocalEvent({type:e?"expanded":"collapsed"}),this}addItems(e){e.forEach(t=>this.addItem(t))}prependItem(e){this.insertItem(e,!0)}addItem(e){this.insertItem(e,!1)}insertItem(e,t){const s=this.eContainer,i=e instanceof Os?e.getGui():e;i.classList.add("ag-group-item",`ag-${this.cssIdentifier}-group-item`),t?(s.insertAdjacentElement("afterbegin",i),this.items.unshift(i)):(s.appendChild(i),this.items.push(i))}hideItem(e,t){const s=this.items[t];qe(s,!e)}getItemIndex(e){const t=e instanceof Os?e.getGui():e;return this.items.indexOf(t)}setTitle(e){return this.eTitleBar?.setTitle(e),this}addTitleBarWidget(e){return this.eTitleBar?.addWidget(e),this}addCssClassToTitleBar(e){this.eTitleBar?.addCssClass(e)}dispatchEnableChangeEvent(e){const t={type:"enableChange",enabled:e};this.dispatchLocalEvent(t)}setEnabled(e,t,s){return this.enabled=e,this.refreshDisabledStyles(),s||this.toggleGroupExpand(e),t||(this.cbGroupEnabled.setValue(e),this.eToggle?.setValue(e)),this}isEnabled(){return this.enabled}onEnableChange(e){return this.addManagedListeners(this,{enableChange:t=>e(t.enabled)}),this}onExpandedChange(e){return this.addManagedListeners(this,{expanded:()=>e(!0),collapsed:()=>e(!1)}),this}hideEnabledCheckbox(e){return this.suppressEnabledCheckbox=e,this.refreshChildDisplay(),this.refreshDisabledStyles(),this}hideOpenCloseIcons(e){return this.eTitleBar?.hideOpenCloseIcons(e),this}refreshDisabledStyles(){const e=!this.enabled;this.eContainer.classList.toggle("ag-disabled",e),this.eTitleBar?.refreshDisabledStyles(this.suppressEnabledCheckbox&&e),this.eContainer.classList.toggle("ag-disabled-group-container",e)}setupTitleBar(){const e=this.useToggle?this.createToggleTitleBar():this.createDefaultTitleBar();this.eToolbar.insertAdjacentElement("beforebegin",e.getGui())}createDefaultTitleBar(){const e=this.createManagedBean(new DT(this.params));return this.eTitleBar=e,e.refreshOnExpand(this.expanded),this.addManagedListeners(e,{expandedChanged:t=>this.toggleGroupExpand(t.expanded)}),e}createToggleTitleBar(){const e=this.createManagedBean(new AT({value:this.enabled,label:this.params.title,labelAlignment:"left",labelWidth:"flex",onValueChange:t=>{this.setEnabled(t,!0),this.dispatchEnableChangeEvent(t)}}));return e.addCssClass("ag-group-title-bar"),e.addCssClass(`ag-${this.params.cssIdentifier??"default"}-group-title-bar ag-unselectable`),this.eToggle=e,this.toggleGroupExpand(this.enabled),e}},mr="ag-disabled-group-title-bar";function IT(e){const t=e.cssIdentifier??"default",s=e.suppressKeyboardNavigation?"presentation":"role";return`
`}var DT=class extends Os{constructor(e={}){super(IT(e)),this.suppressOpenCloseIcons=!1,this.suppressKeyboardNavigation=!1,this.eGroupOpenedIcon=gt,this.eGroupClosedIcon=gt,this.eTitle=gt;const{title:t,suppressOpenCloseIcons:s,suppressKeyboardNavigation:i}=e;t&&t.length>0&&(this.title=t),s!=null&&(this.suppressOpenCloseIcons=s),this.suppressKeyboardNavigation=i??!1}postConstruct(){this.setTitle(this.title),this.hideOpenCloseIcons(this.suppressOpenCloseIcons),this.setupExpandContract()}setupExpandContract(){this.eGroupClosedIcon.appendChild(Bn("accordionClosed",this.beans,null)),this.eGroupOpenedIcon.appendChild(Bn("accordionOpen",this.beans,null)),this.addManagedElementListeners(this.getGui(),{click:()=>this.dispatchExpandChanged(),keydown:e=>{switch(e.key){case Kt.ENTER:case Kt.SPACE:e.preventDefault(),this.dispatchExpandChanged();break;case Kt.RIGHT:case Kt.LEFT:e.preventDefault(),this.dispatchExpandChanged(e.key===Kt.RIGHT);break}}})}refreshOnExpand(e){this.refreshAriaStatus(e),this.refreshOpenCloseIcons(e)}refreshAriaStatus(e){this.suppressOpenCloseIcons||RT(this.getGui(),e)}refreshOpenCloseIcons(e){const t=!this.suppressOpenCloseIcons;qe(this.eGroupOpenedIcon,t&&e),qe(this.eGroupClosedIcon,t&&!e)}isSuppressCollapse(){return this.suppressOpenCloseIcons}dispatchExpandChanged(e){const t={type:"expandedChanged",expanded:e};this.dispatchLocalEvent(t)}setTitle(e){const t=this.getGui(),s=!!e&&e.length>0;e=s?e:void 0,this.eTitle.textContent=e??"",qe(t,s),e!==this.title&&(this.title=e);const i=t.classList.contains(mr);return this.refreshDisabledStyles(i),this}addWidget(e){return this.getGui().appendChild(e),this}hideOpenCloseIcons(e){return this.suppressOpenCloseIcons=e,e&&this.dispatchExpandChanged(!0),this}refreshDisabledStyles(e){const t=this.getGui();e?(t.classList.add(mr),t.removeAttribute("tabindex")):(t.classList.remove(mr),typeof this.title=="string"&&!this.suppressKeyboardNavigation?t.setAttribute("tabindex","0"):t.removeAttribute("tabindex"))}},N={selector:"AG-GROUP-COMPONENT",component:Se};function _n(e){const{filters:t}=e;return t&&t.length>0?t:[{filter:"agTextColumnFilter"},{filter:"agSetColumnFilter"}]}function Vn(e,t){if(e!=null)for(let s=e.length-1;s>=0;s--)t(e[s],s)}function LT(e,t){return t.title!=null?t.title:e instanceof Nn?e.getFilterTitle():"Filter"}var Hn=class extends yT{constructor(){super('
'),this.filterType="multi",this.filterDefs=[],this.filters=[],this.guiDestroyFuncs=[],this.filterGuis=[],this.activeFilterIndices=[],this.lastActivatedMenuItem=null,this.afterFiltersReadyFuncs=[]}postConstruct(){this.initialiseTabGuard({onFocusIn:e=>this.onFocusIn(e)})}init(e){this.params=e,this.filterDefs=_n(e);const{column:t,filterChangedCallback:s}=e;this.column=t,this.filterChangedCallback=s;const i=[];return this.filterDefs.forEach((r,a)=>{const o=this.createFilter(r,a);o!=null&&i.push(o)}),new ye(r=>{ye.all(i).then(a=>{this.filters=a,this.refreshGui("columnMenu").then(()=>{r()})})}).then(()=>{this.afterFiltersReadyFuncs.forEach(r=>r()),this.afterFiltersReadyFuncs.length=0})}refreshGui(e){return e===this.lastOpenedInContainer?ye.resolve():(this.tabGuardFeature.removeAllChildrenExceptTabGuards(),this.destroyChildren(),ye.all(this.filters.map((t,s)=>{const i=this.filterDefs[s],r=LT(t,i);let a;if(i.display==="subMenu"&&e!=="toolPanel")a=this.insertFilterMenu(t,r).then(o=>o.getGui());else if(i.display==="subMenu"||i.display==="accordion"){const o=this.insertFilterGroup(t,r);a=ye.resolve(o.getGui())}else a=ye.resolve(t.getGui());return a})).then(t=>{t.forEach((s,i)=>{i>0&&this.appendChild(TT('
')),this.appendChild(s)}),this.filterGuis=t,this.lastOpenedInContainer=e}))}destroyChildren(){this.guiDestroyFuncs.forEach(e=>e()),this.guiDestroyFuncs.length=0,this.filterGuis.length=0}insertFilterMenu(e,t){const s=this.createBean(new Xi);return s.init({menuItemDef:{name:t,subMenu:[],subMenuRole:"dialog",cssClasses:["ag-multi-filter-menu-item"],menuItem:Fo,menuItemParams:{cssClassPrefix:"ag-compact-menu-option",isCompact:!0}},level:0,isAnotherSubMenuOpen:()=>!1,childComponent:e,contextParams:{column:null,node:null,value:null}}).then(()=>{s.setParentComponent(this),this.guiDestroyFuncs.push(()=>this.destroyBean(s)),this.addManagedListeners(s,{menuItemActivated:r=>{this.lastActivatedMenuItem&&this.lastActivatedMenuItem!==r.menuItem&&this.lastActivatedMenuItem.deactivate(),this.lastActivatedMenuItem=r.menuItem}});const i=s.getGui();return s.addManagedElementListeners(i,{keydown:r=>{const{key:a}=r;switch(a){case Ut.UP:case Ut.RIGHT:case Ut.DOWN:case Ut.LEFT:r.preventDefault(),a===Ut.RIGHT&&s.openSubMenu(!0);break}},focusin:()=>s.activate(),focusout:()=>{!s.isSubMenuOpen()&&!s.isSubMenuOpening()&&s.deactivate()}}),s})}insertFilterGroup(e,t){const s=this.createBean(new Se({title:t,cssIdentifier:"multi-filter"}));return this.guiDestroyFuncs.push(()=>this.destroyBean(s)),s.addItem(e.getGui()),s.toggleGroupExpand(!1),e.afterGuiAttached&&s.addManagedListeners(s,{expanded:()=>e.afterGuiAttached({container:this.lastOpenedInContainer,suppressFocus:!0,hidePopup:this.hidePopup})}),s}isFilterActive(){return this.filters.some(e=>e.isFilterActive())}getLastActiveFilterIndex(){const e=this.activeFilterIndices;return e.length>0?e[e.length-1]:null}doesFilterPass(e,t){let s=!0;return this.filters.forEach(i=>{!s||i===t||!i.isFilterActive()||(s=i.doesFilterPass(e))}),s}getModelFromUi(){return{filterType:this.filterType,filterModels:this.filters.map(t=>{const s=t;return typeof s.getModelFromUi=="function"?s.getModelFromUi():null})}}getModel(){return this.isFilterActive()?{filterType:this.filterType,filterModels:this.filters.map(t=>t.isFilterActive()?t.getModel():null)}:null}setModel(e){const t=(i,r)=>new ye(a=>{const o=i.setModel(r);o?o.then(()=>a()):a()});let s=[];return e==null?s=this.filters.map((i,r)=>t(i,null).then(()=>{this.updateActiveList(r)})):this.filters.forEach((i,r)=>{const a=e.filterModels.length>r?e.filterModels[r]:null,o=t(i,a).then(()=>{this.updateActiveList(r)});s.push(o)}),ye.all(s).then(()=>{})}applyModel(e="api"){let t=!1;return this.filters.forEach(s=>{s instanceof Nn&&(t=s.applyModel(e)||t)}),t}getChildFilterInstance(e){return this.filters[e]}afterGuiAttached(e){let t;e?(this.hidePopup=e.hidePopup,t=this.refreshGui(e.container)):(this.hidePopup=void 0,t=ye.resolve());const s=e?.suppressFocus;t.then(()=>{const{filterDefs:i,filters:r,filterGuis:a,beans:o}=this;let n=!!s;i&&Vn(i,(c,d)=>{const h=d===0,u=c.display&&c.display!=="inline",p=s||!h||u,g={...e??{},suppressFocus:p},m=r?.[d];if(m&&(this.executeFunctionIfExistsOnFilter(m,"afterGuiAttached",g),h&&!p&&(n=!0)),!s&&h&&u){const C=a[d];C&&(ST(C)||C.focus({preventScroll:!0}),n=!0)}});const l=bT(o);!n&&(xT(o)||this.getGui().contains(l))&&this.forceFocusOutOfContainer(!0)})}afterGuiDetached(){this.executeFunctionIfExists("afterGuiDetached")}onAnyFilterChanged(){this.executeFunctionIfExists("onAnyFilterChanged")}onNewRowsLoaded(){this.executeFunctionIfExists("onNewRowsLoaded")}destroy(){this.filters.forEach(e=>this.destroyBean(e)),this.filters.length=0,this.destroyChildren(),this.hidePopup=void 0,super.destroy()}executeFunctionIfExists(e,...t){Vn(this.filters,s=>{this.executeFunctionIfExistsOnFilter(s,e,t)})}executeFunctionIfExistsOnFilter(e,t,...s){const i=e[t];typeof i=="function"&&i.apply(e,s)}createFilter(e,t){const{filterModifiedCallback:s,doesRowPassOtherFilter:i}=this.params,{filterManager:r,userCompFactory:a}=this.beans;let o;const n={...r.createFilterParams(this.column,this.column.getColDef()),filterModifiedCallback:s,filterChangedCallback:d=>{this.executeWhenAllFiltersReady(()=>this.filterChanged(t,d))},doesRowPassOtherFilter:d=>i(d)&&this.doesFilterPass({node:d,data:d.data},o)},l=wT(a,e,n,"agTextColumnFilter");if(!l)return null;const c=l.newAgStackInstance();return c.then(d=>{if(d&&(o=d,e.display==="subMenu")){const h=d.getGui();PT(h,"dialog")}}),c}executeWhenAllFiltersReady(e){(this.filters?.length??0)>0?e():this.afterFiltersReadyFuncs.push(e)}updateActiveList(e){const{filters:t,activeFilterIndices:s}=this,i=t[e];MT(s,e),i.isFilterActive()&&s.push(e)}filterChanged(e,t){this.updateActiveList(e),this.filterChangedCallback(t);const s=this.filters[e];this.filters.forEach(i=>{i!==s&&typeof i.onAnyFilterChanged=="function"&&i.onAnyFilterChanged()})}onFocusIn(e){const t=this.lastActivatedMenuItem;t!=null&&!t.getGui().contains(e.target)&&(t.deactivate(),this.lastActivatedMenuItem=null)}getModelAsString(e){if(!this.filters||!e?.filterModels?.length)return"";const t=this.getLastActiveFilterIndex()??0;return this.filters[t].getModelAsString?.(e.filterModels[t])??""}};import{AgPromise as kT,Component as GT,_clearElement as OT,_error as NT,_getDefaultFloatingFilterType as BT,_getFloatingFilterCompDetails as _T,_mergeDeep as VT,_setDisplayed as fr}from"ag-grid-community";var HT=class extends GT{constructor(){super('
'),this.floatingFilters=[],this.compDetailsList=[]}init(e){this.params=e;const{compDetailsList:t}=this.getCompDetailsList(e);return this.setParams(t)}setParams(e){const t=[];return e.forEach(s=>{const i=s?.newAgStackInstance();i!=null&&(this.compDetailsList.push(s),t.push(i))}),kT.all(t).then(s=>{s.forEach((i,r)=>{this.floatingFilters.push(i);const a=i.getGui();this.appendChild(a),r>0&&fr(a,!1)})})}refresh(e){this.params=e;const{compDetailsList:t,floatingFilterParamsList:s}=this.getCompDetailsList(e);t.length===this.compDetailsList.length&&t.every((r,a)=>!this.beans.filterManager?.areFilterCompsDifferent(this.compDetailsList[a],r))?s.forEach((r,a)=>{this.floatingFilters[a].refresh?.(r)}):(OT(this.getGui()),this.destroyBeans(this.floatingFilters),this.floatingFilters=[],this.compDetailsList=[],this.setParams(t))}getCompDetailsList(e){const t=[],s=[],i=e.filterParams,r=e.currentParentModel;return _n(i).forEach((a,o)=>{const n={...e,parentFilterInstance:c=>{this.parentMultiFilterInstance(d=>{const h=d.getChildFilterInstance(o);h!=null&&c(h)})},currentParentModel:()=>r()?.filterModels?.[o]??null};VT(n.filterParams,a.filterParams);const l=this.getCompDetails(a,n);l&&(t.push(l),s.push(n))}),{compDetailsList:t,floatingFilterParamsList:s}}onParentModelChanged(e,t){t&&t.afterFloatingFilter||this.parentMultiFilterInstance(s=>{if(e==null)this.floatingFilters.forEach((i,r)=>{i.onParentModelChanged(null,t),fr(i.getGui(),r===0)});else{const i=s.getLastActiveFilterIndex();this.floatingFilters.forEach((r,a)=>{const o=e.filterModels.length>a?e.filterModels[a]:null;r.onParentModelChanged(o,t);const n=i==null?a===0:a===i;fr(r.getGui(),n)})}})}destroy(){this.destroyBeans(this.floatingFilters),this.floatingFilters.length=0,super.destroy()}getCompDetails(e,t){const{filterManager:s,frameworkOverrides:i,userCompFactory:r}=this.beans,a=BT(i,e,()=>s.getDefaultFloatingFilter(this.params.column))??"agReadOnlyFloatingFilter";return _T(r,e,t,a)}parentMultiFilterInstance(e){this.params.parentFilterInstance(t=>{t instanceof Hn||NT(120),e(t)})}},zn={moduleName:"MultiFilter",version:R,userComponents:{agMultiColumnFilter:Hn,agMultiColumnFloatingFilter:HT},dependsOn:[G,vT,As]};import{_ColumnFilterModule as zT,_PopupModule as UT}from"ag-grid-community";import{BeanStub as KT,_exists as WT}from"ag-grid-community";var jT=class extends KT{constructor(){super(...arguments),this.beanName="aggColNameSvc"}getHeaderName(e,t){if(this.gos.get("suppressAggFuncInHeader"))return t;const{valueColsSvc:s,colModel:i,rowGroupColsSvc:r}=this.beans,a=e.getColDef().pivotValueColumn,o=WT(a);let n=null,l;if(o){const c=s?.columns??[],d=this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&c.length===1,h=e.getColDef().pivotTotalColumnIds!==void 0;if(d&&!h)return t;n=a?a.getAggFunc():null,l=!0}else{const c=e.isValueActive(),d=i.isPivotMode()||r?.columns.length!==0;c&&d?(n=e.getAggFunc(),l=!0):l=!1}if(l){const c=typeof n=="string"?n:"func";return`${this.getLocaleTextFunc()(c,c)}(${t})`}return t}};import{BeanStub as $T,_exists as Un,_last as YT}from"ag-grid-community";var XT={sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},qT=class extends $T{constructor(){super(...arguments),this.beanName="aggFuncSvc",this.aggFuncsMap={},this.initialised=!1}postConstruct(){this.init()}init(){this.initialised||(this.initialiseWithDefaultAggregations(),this.addAggFuncs(this.gos.get("aggFuncs")))}initialiseWithDefaultAggregations(){const e=this.aggFuncsMap;e.sum=ZT,e.first=JT,e.last=QT,e.min=eM,e.max=tM,e.count=sM,e.avg=iM,this.initialised=!0}isAggFuncPossible(e,t){const i=this.getFuncNames(e).includes(t),r=Un(this.aggFuncsMap[t]);return i&&r}getDefaultFuncLabel(e){return XT[e]??e}getDefaultAggFunc(e){const t=e.getColDef().defaultAggFunc;if(Un(t)&&this.isAggFuncPossible(e,t))return t;if(this.isAggFuncPossible(e,"sum"))return"sum";const s=this.getFuncNames(e);return s?.length?s[0]:null}addAggFuncs(e){if(this.init(),!!e)for(const t of Object.keys(e))this.aggFuncsMap[t]=e[t]}getAggFunc(e){return this.init(),this.aggFuncsMap[e]}getFuncNames(e){const t=e.getColDef().allowedAggFuncs;return t??Object.keys(this.aggFuncsMap).sort()}clear(){this.aggFuncsMap={}}};function ZT(e){const{values:t}=e;let s=null;for(let i=0;i0?e.values[0]:null}function QT(e){return e.values.length>0?YT(e.values):null}function eM(e){const{values:t}=e;let s=null;for(let i=0;ir)&&(s=r)}return s}function tM(e){const{values:t}=e;let s=null;for(let i=0;i0&&(r=s/(typeof s=="number"?i:BigInt(i)));const a=e.rowNode?.aggData?.[e.column?.getColId()];return a&&a.count===i&&a.value===r?a:{count:i,value:r,toString:function(){return typeof this.value=="number"||typeof this.value=="bigint"?this.value.toString():""},toNumber:function(){return this.value}}}function rM(e,t){e.aggFuncSvc&&e.aggFuncSvc.addAggFuncs(t)}function aM(e){e.aggFuncSvc&&e.aggFuncSvc.clear()}function oM(e,t,s){e.valueColsSvc?.setColumnAggFunc?.(t,s,"api")}import{BeanStub as nM,_addGridCommonParams as lM,_error as cM,_getGrandTotalRow as dM,_getGroupAggFiltering as hM}from"ag-grid-community";var uM=class extends nM{constructor(){super(...arguments),this.beanName="aggStage",this.refreshProps=new Set(["getGroupRowAgg","alwaysAggregateAtRootLevel","suppressAggFilteredOnly","grandTotalRow"]),this.step="aggregate"}wireBeans(e){this.colModel=e.colModel,this.aggFuncSvc=e.aggFuncSvc,this.pivotColsSvc=e.pivotColsSvc,this.valueColsSvc=e.valueColsSvc,this.pivotResultCols=e.pivotResultCols,this.valueSvc=e.valueSvc}execute(e){const t=!this.valueColsSvc?.columns?.length,s=!this.gos.getCallback("getGroupRowAgg");if(t&&s&&e.changedPath?.active)return;const i=this.createAggDetails(e);this.recursivelyCreateAggData(i)}createAggDetails(e){const t=this.colModel.isPivotActive(),s=this.valueColsSvc?.columns,i=t&&this.pivotColsSvc?this.pivotColsSvc.columns:[];return{alwaysAggregateAtRootLevel:this.gos.get("alwaysAggregateAtRootLevel"),groupIncludeTotalFooter:!!dM(this.gos),changedPath:e.changedPath,valueColumns:s??[],pivotColumns:i,filteredOnly:!this.isSuppressAggFilteredOnly(),userAggFunc:this.gos.getCallback("getGroupRowAgg")}}isSuppressAggFilteredOnly(){return hM(this.gos)!==void 0||this.gos.get("suppressAggFilteredOnly")}recursivelyCreateAggData(e){const t=s=>{if(!s.hasChildren()){s.aggData&&this.setAggData(s,null);return}if(s.level===-1&&!e.groupIncludeTotalFooter){const a=!this.colModel.isPivotMode();if(!e.alwaysAggregateAtRootLevel&&a){this.setAggData(s,null);return}}this.aggregateRowNode(s,e)};e.changedPath.forEachChangedNodeDepthFirst(t,!0)}aggregateRowNode(e,t){const s=t.valueColumns.length===0,i=t.pivotColumns.length===0;let r;t.userAggFunc?r=t.userAggFunc({nodes:e.childrenAfterFilter}):s?r=null:i?r=this.aggregateRowNodeUsingValuesOnly(e,t):r=this.aggregateRowNodeUsingValuesAndPivot(e),this.setAggData(e,r),e.sibling&&this.setAggData(e.sibling,r)}aggregateRowNodeUsingValuesAndPivot(e){const t={},s=this.pivotResultCols?.getPivotResultCols()?.list??[];let i=!0;for(let r=0;rt[l]);t[o.colId]=this.aggregateValues(n,o.pivotValueColumn.getAggFunc(),o.pivotValueColumn,e,a)}return t}aggregateRowNodeUsingValuesOnly(e,t){const s={},{changedPath:i,valueColumns:r,filteredOnly:a}=t,o=i.active?i.getValueColumnsForNode(e,r):r,n=i.active?i.getNotValueColumnsForNode(e,r):null,l=this.getValuesNormal(e,o,a),c=e.aggData;return o.forEach((d,h)=>{s[d.getId()]=this.aggregateValues(l[h],d.getAggFunc(),d,e)}),n&&c&&n.forEach(d=>{s[d.getId()]=c[d.getId()]}),s}getValuesPivotNonLeaf(e,t){return e.childrenAfterFilter.map(s=>s.aggData[t])}getValuesFromMappedSet(e,t,s){let i=e;for(let r=0;rthis.valueSvc.getValue(s,r)):[]}getValuesNormal(e,t,s){const i=[];t.forEach(()=>i.push([]));const r=t.length,a=s?e.childrenAfterFilter:e.childrenAfterGroup,o=a.length;for(let n=0;n{const a=e.aggData?e.aggData[r]:void 0,o=s?s[r]:void 0;if(a===o)return;const n=this.colModel.getCol(r);n&&e.dispatchCellChangedEvent(n,a,o)};if(s)for(const r of Object.keys(s))i(r);if(t)for(const r of Object.keys(t))(!s||!(r in s))&&i(r)}}};import{BeanStub as pM,_getGroupAggFiltering as gM}from"ag-grid-community";var mM=class extends pM{constructor(){super(...arguments),this.beanName="filterAggStage",this.refreshProps=new Set([]),this.step="filter_aggregates"}wireBeans(e){this.filterManager=e.filterManager}execute(e){const t=this.beans.colModel.isPivotMode(),s=this.filterManager?.isAggregateFilterPresent()||this.filterManager?.isAggregateQuickFilterPresent(),i=c=>!c.node.group,r=c=>c.node.leafGroup,a=gM(this.gos)||(t?r:i),{changedPath:o}=e,n=(c,d=!1)=>{c.childrenAfterFilter&&(c.childrenAfterAggFilter=c.childrenAfterFilter,d&&c.childrenAfterAggFilter.forEach(h=>n(h,d)),this.setAllChildrenCount(c)),c.sibling&&(c.sibling.childrenAfterAggFilter=c.childrenAfterAggFilter)},l=c=>{c.childrenAfterAggFilter=c.childrenAfterFilter?.filter(d=>a({node:d})&&this.filterManager.doesRowPassAggregateFilters({rowNode:d})?(n(d,!0),!0):d.childrenAfterAggFilter?.length)||null,this.setAllChildrenCount(c),c.sibling&&(c.sibling.childrenAfterAggFilter=c.childrenAfterAggFilter)};o.forEachChangedNodeDepthFirst(s?l:n,!0)}setAllChildrenCountTreeData(e){const t=e.childrenAfterAggFilter;let s=0;if(t){const i=t.length;s=i;for(let r=0;r=0?null:s)}setAllChildrenCountGridGrouping(e){let t=0;e.childrenAfterAggFilter.forEach(s=>{s.group?t+=s.allChildrenCount:t++}),e.setAllChildrenCount(t)}setAllChildrenCount(e){if(!e.hasChildren()){e.setAllChildrenCount(null);return}this.gos.get("treeData")?this.setAllChildrenCountTreeData(e):this.setAllChildrenCountGridGrouping(e)}};import{BeanStub as fM,_getGrandTotalRow as CM,_getGroupTotalRowCallback as vM}from"ag-grid-community";import{RowNode as yM}from"ag-grid-community";var SM=new Set(["__localEventService","__objectId","sticky","__autoHeights","__checkAutoHeightsDebounced"]);function be(e,t){if(e.sibling)return;const s=new yM(t);Object.keys(e).forEach(i=>{SM.has(i)||(s[i]=e[i])}),s.footer=!0,s.setRowTop(null),s.setRowIndex(null),s.oldRowTop=null,s.id="rowGroupFooter_"+e.id,s.sibling=e,e.sibling=s}function Cr(e){e.sibling&&(e.sibling.setRowTop(null),e.sibling.setRowIndex(null),e.sibling=void 0)}var bM=class extends fM{constructor(){super(...arguments),this.beanName="footerSvc"}addTotalRows(e,t,s,i,r,a){let o=e;if(r)return(i&&CM(this.gos))===a&&(be(t,this.beans),s(t.sibling,o++)),o;const n=vM(this.gos);return(i&&n({node:t}))===a&&(be(t,this.beans),s(t.sibling,o++)),o}getTopDisplayIndex(e,t,s,i){let r=t;if(e[0].footer){if(t===0)return 0;r-=1}const a=e[e.length-1],o=r>=s.length;return a.footer&&o?a.rowIndex:i(r)}};import{BaseColsService as wM,_exists as xM,_removeFromArray as TM,_warn as MM}from"ag-grid-community";var Kn=class extends wM{constructor(){super(...arguments),this.beanName="valueColsSvc",this.eventName="columnValueChanged",this.columnProcessors={set:(e,t,s)=>this.setValueActive(t,e,s),add:(e,t,s)=>this.setValueActive(!0,e,s),remove:(e,t,s)=>this.setValueActive(!1,e,s)},this.columnExtractors={setFlagFunc:(e,t,s)=>this.setColValueActive(e,t,s),getIndexFunc:()=>{},getInitialIndexFunc:()=>{},getValueFunc:e=>{const t=e.aggFunc;if(t===null||t==="")return null;if(t!==void 0)return!!t},getInitialValueFunc:e=>e.initialAggFunc!=null&&e.initialAggFunc!=""},this.modifyColumnsNoEventsCallbacks={addCol:e=>this.columns.push(e),removeCol:e=>TM(this.columns,e)}}extractCols(e,t){return this.columns=super.extractCols(e,t),this.columns.forEach(s=>{const i=s.getColDef();i.aggFunc!=null&&i.aggFunc!=""?this.setColAggFunc(s,i.aggFunc):s.getAggFunc()||this.setColAggFunc(s,i.initialAggFunc)}),this.columns}setColumnAggFunc(e,t,s){if(!e)return;const i=this.colModel.getColDefCol(e);i&&(this.setColAggFunc(i,t),this.dispatchColumnChangedEvent(this.eventSvc,this.eventName,[i],s))}syncColumnWithState(e,t,s){const i=s("aggFunc").value1;i!==void 0&&(typeof i=="string"?(this.setColAggFunc(e,i),e.isValueActive()||(this.setColValueActive(e,!0,t),this.modifyColumnsNoEventsCallbacks.addCol(e))):(xM(i)&&MM(33),e.isValueActive()&&(this.setColValueActive(e,!1,t),this.modifyColumnsNoEventsCallbacks.removeCol(e))))}setValueActive(e,t,s){if(e!==t.isValueActive()&&(this.setColValueActive(t,e,s),e&&!t.getAggFunc()&&this.aggFuncSvc)){const i=this.aggFuncSvc.getDefaultAggFunc(t);this.setColAggFunc(t,i)}}setColAggFunc(e,t){e.aggFunc=t,e.dispatchStateUpdatedEvent("aggFunc")}setColValueActive(e,t,s){e.aggregationActive!==t&&(e.aggregationActive=t,e.dispatchColEvent("columnValueChanged",s))}},vr={moduleName:"SharedAggregation",version:R,beans:[qT,jT,bM,Kn],apiFunctions:{addAggFuncs:rM,clearAggFuncs:aM,setColumnAggFunc:oM},dependsOn:[G]},yr={moduleName:"Aggregation",version:R,beans:[uM,mM],rowModels:["clientSide"],dependsOn:[vr]};import{BaseColsService as PM,_removeFromArray as FM}from"ag-grid-community";var Wn=class extends PM{constructor(){super(...arguments),this.beanName="pivotColsSvc",this.eventName="columnPivotChanged",this.columnProcessors={set:(e,t,s)=>this.setColPivotActive(e,t,s),add:(e,t,s)=>this.setColPivotActive(e,!0,s),remove:(e,t,s)=>this.setColPivotActive(e,!1,s)},this.columnOrdering={enableProp:"pivot",initialEnableProp:"initialPivot",indexProp:"pivotIndex",initialIndexProp:"initialPivotIndex"},this.columnExtractors={setFlagFunc:(e,t,s)=>this.setColPivotActive(e,t,s),getIndexFunc:e=>e.pivotIndex,getInitialIndexFunc:e=>e.initialPivotIndex,getValueFunc:e=>e.pivot,getInitialValueFunc:e=>e.initialPivot},this.modifyColumnsNoEventsCallbacks={addCol:e=>this.columns.push(e),removeCol:e=>FM(this.columns,e)}}syncColumnWithState(e,t,s,i){const{value1:r,value2:a}=s("pivot","pivotIndex");(r!==void 0||a!==void 0)&&(typeof a=="number"||r?(e.isPivotActive()||(this.setColPivotActive(e,!0,t),this.modifyColumnsNoEventsCallbacks.addCol(e)),i&&typeof a=="number"&&(i[e.getId()]=a)):e.isPivotActive()&&(this.setColPivotActive(e,!1,t),this.modifyColumnsNoEventsCallbacks.removeCol(e)))}setColPivotActive(e,t,s){e.pivotActive!==t&&(e.pivotActive=t,e.dispatchColEvent("columnPivotChanged",s)),e.dispatchStateUpdatedEvent("pivot")}};import{BaseColsService as AM,_removeFromArray as RM,_shouldUpdateColVisibilityAfterGroup as EM}from"ag-grid-community";var IM=class extends AM{constructor(){super(...arguments),this.beanName="rowGroupColsSvc",this.eventName="columnRowGroupChanged",this.columnProcessors={set:(e,t,s)=>this.setActive(t,e,s),add:(e,t,s)=>this.setActive(!0,e,s),remove:(e,t,s)=>this.setActive(!1,e,s)},this.columnOrdering={enableProp:"rowGroup",initialEnableProp:"initialRowGroup",indexProp:"rowGroupIndex",initialIndexProp:"initialRowGroupIndex"},this.columnExtractors={setFlagFunc:(e,t,s)=>this.setColRowGroupActive(e,t,s),getIndexFunc:e=>e.rowGroupIndex,getInitialIndexFunc:e=>e.initialRowGroupIndex,getValueFunc:e=>e.rowGroup,getInitialValueFunc:e=>e.initialRowGroup},this.modifyColumnsNoEventsCallbacks={addCol:e=>this.columns.push(e),removeCol:e=>RM(this.columns,e)}}moveColumn(e,t,s){if(this.columns.length===0)return;const i=this.columns[e],r=this.columns.slice(e,t);this.columns.splice(e,1),this.columns.splice(t,0,i),this.eventSvc.dispatchEvent({type:this.eventName,columns:r,column:r.length===1?r[0]:null,source:s})}syncColumnWithState(e,t,s,i){const{value1:r,value2:a}=s("rowGroup","rowGroupIndex");(r!==void 0||a!==void 0)&&(typeof a=="number"||r?(e.isRowGroupActive()||(this.setColRowGroupActive(e,!0,t),this.modifyColumnsNoEventsCallbacks.addCol(e)),i&&typeof a=="number"&&(i[e.getId()]=a)):e.isRowGroupActive()&&(this.setColRowGroupActive(e,!1,t),this.modifyColumnsNoEventsCallbacks.removeCol(e)))}setActive(e,t,s){e!==t.isRowGroupActive()&&(this.setColRowGroupActive(t,e,s),EM(this.gos,e)&&this.colModel.setColsVisible([t],!e,s))}setColRowGroupActive(e,t,s){e.rowGroupActive!==t&&(e.rowGroupActive=t,e.dispatchColEvent("columnRowGroupChanged",s)),e.dispatchStateUpdatedEvent("rowGroup")}};import{AgColumn as DM,BeanStub as LM,GROUP_AUTO_COLUMN_ID as jn,_addColumnDefaultAndTypes as kM,_applyColumnState as GM,_areColIdsEqual as OM,_columnsMatch as NM,_convertColumnEventSourceType as BM,_destroyColumnTree as $n,_isColumnsSortingCoupledToGroup as _M,_isGroupMultiAutoColumn as VM,_isGroupUseEntireRow as HM,_mergeDeep as zM,_missing as Sr,_updateColsMap as UM,_warn as KM,isColumnGroupAutoCol as WM}from"ag-grid-community";var jM=class extends LM{constructor(){super(...arguments),this.beanName="autoColSvc"}postConstruct(){this.addManagedPropertyListener("autoGroupColumnDef",this.updateColumns.bind(this))}addColumns(e){this.columns!=null&&(e.list=this.columns.list.concat(e.list),e.tree=this.columns.tree.concat(e.tree),UM(e))}createColumns(e,t){const s=this.beans,{colModel:i,gos:r,rowGroupColsSvc:a,colGroupSvc:o}=s,n=i.isPivotMode(),l=HM(r,n),c=n?r.get("pivotSuppressAutoColumn"):this.isSuppressAutoCol(),d=a?.columns,u=!(d&&d.length>0||r.get("treeData"))||c||l,p=()=>{this.columns&&($n(s,this.columns.tree),this.columns=null)};if(u){p();return}const g=this.generateAutoCols(d),m=OM(g,this.columns?.list||null),C=e.treeDepth,v=(this.columns?this.columns.treeDepth:-1)==C;if(m&&v)return;p();const y=o?.findDepth(e.tree)??0,x=o?.balanceTreeForAutoCols(g,y)??[];this.columns={list:g,tree:x,treeDepth:y,map:{}},t(w=>{if(!w)return null;const T=w.filter(P=>!WM(P));return[...g,...T]})}updateColumns(e){const t=BM(e.source);this.columns?.list.forEach((s,i)=>this.updateOneAutoCol(s,i,t))}getColumn(e){return this.columns?.list.find(t=>NM(t,e))??null}getColumns(){return this.columns?.list??null}generateAutoCols(e=[]){const t=[],s=this.gos.get("treeData");let i=VM(this.gos);return s&&i&&(KM(182),i=!1),i?e.forEach((r,a)=>{t.push(this.createOneAutoCol(r,a))}):t.push(this.createOneAutoCol()),t}isSuppressAutoCol(){const e=this.gos;return e.get("groupDisplayType")==="custom"?!0:e.get("treeDataDisplayType")==="custom"}createOneAutoCol(e,t){let s;e?s=`${jn}-${e.getId()}`:s=jn;const i=this.createAutoColDef(s,e,t);i.colId=s;const r=new DM(i,null,s,!0);return this.createBean(r),r}updateOneAutoCol(e,t,s){const i=e.getColDef(),r=typeof i.showRowGroup=="string"?i.showRowGroup:void 0,a=this.beans,o=r!=null?a.colModel.getColDefCol(r):void 0,n=e.getId(),l=this.createAutoColDef(n,o??void 0,t);e.setColDef(l,null,s),GM(a,{state:[{colId:n,...l}]},s)}createAutoColDef(e,t,s){let i=this.createBaseColDef(t);const r=this.gos.get("autoGroupColumnDef");zM(i,r),i=kM(this.beans,i,e,!0),this.gos.get("treeData")||Sr(i.field)&&Sr(i.valueGetter)&&Sr(i.filterValueGetter)&&i.filter!=="agGroupColumnFilter"&&(i.filter=!1),s&&s>0&&(i.headerCheckboxSelection=!1);const a=_M(this.gos),o=i.valueGetter||i.field!=null;return a&&!o&&(i.sortIndex=void 0,i.initialSort=void 0),i}createBaseColDef(e){const t=this.gos.get("autoGroupColumnDef"),i={headerName:this.getLocaleTextFunc()("group","Group")};if(t&&(t.cellRenderer||t.cellRendererSelector)||(i.cellRenderer="agGroupCellRenderer"),e){const a=e.getColDef();Object.assign(i,{headerName:this.beans.colNames.getDisplayNameForColumn(e,"header"),headerValueGetter:a.headerValueGetter}),a.cellRenderer&&Object.assign(i,{cellRendererParams:{innerRenderer:a.cellRenderer,innerRendererParams:a.cellRendererParams}}),i.showRowGroup=e.getColId()}else i.showRowGroup=!0;return i}destroy(){$n(this.beans,this.columns?.tree),super.destroy()}};import{_exists as $M}from"ag-grid-community";import{BeanStub as YM,_createGlobalRowEvent as XM,_setAriaExpanded as qM}from"ag-grid-community";var Yn=class extends YM{addExpandedCss(e,t){t.isExpandable()&&(e.push("ag-row-group"),e.push(t.expanded?"ag-row-group-expanded":"ag-row-group-contracted"))}getRowExpandedListeners(e){const{rowNode:t}=e,s=this.updateExpandedCss.bind(this,e,t);return{expandedChanged:s,hasChildrenChanged:s}}setExpanded(e,t,s,i){if(e.expanded===t)return;e.expanded=t,e.dispatchRowEvent("expandedChanged");const r={...XM(e,this.gos,"rowGroupOpened"),expanded:t,event:s||null};this.dispatchExpandedEvent(r,i),this.beans.rowRenderer.refreshCells({rowNodes:[e]})}isExpandable(e){return e.footer?!1:this.beans.colModel.isPivotMode()?e.hasChildren()&&!e.leafGroup:e.hasChildren()||e.master}updateExpandedCss(e,t){const s=t.isExpandable(),i=t.expanded==!0;e.forEachGui(void 0,r=>{const a=r.rowComp;a.addOrRemoveCssClass("ag-row-group",s),a.addOrRemoveCssClass("ag-row-group-expanded",s&&i),a.addOrRemoveCssClass("ag-row-group-contracted",s&&!i),qM(r.element,s&&i)})}},ZM=class extends Yn{constructor(){super(...arguments),this.beanName="expansionSvc",this.events=[]}wireBeans(e){this.rowModel=e.rowModel}expandRows(e){const t=new Set(e);this.rowModel.forEachNode(s=>{s.id&&t.has(s.id)&&(s.expanded=!0)}),this.onGroupExpandedOrCollapsed()}expandAll(e){const{gos:t,colModel:s,eventSvc:i}=this.beans,r=this.rowModel,a=t.get("treeData"),o=s.isPivotActive(),n=c=>{c&&c.forEach(d=>{const h=()=>{d.expanded=e,n(d.childrenAfterGroup)};if(a){$M(d.childrenAfterGroup)&&h();return}if(o){!d.leafGroup&&h();return}d.group&&h()})},l=r.rootNode;l&&n(l.childrenAfterGroup),r.refreshModel({step:"map"}),i.dispatchEvent({type:"expandOrCollapseAll",source:e?"expandAll":"collapseAll"})}onGroupExpandedOrCollapsed(){this.rowModel.refreshModel({step:"map"})}dispatchExpandedEvent(e,t){this.events.push(e);const s=()=>{this.rowModel.onRowGroupOpened(),this.events.forEach(i=>this.eventSvc.dispatchEvent(i)),this.events=[]};t?s():(this.dispatchExpandedDebounced==null&&(this.dispatchExpandedDebounced=this.debounce(s)),this.dispatchExpandedDebounced())}debounce(e){const t=this.beans.animationFrameSvc;if(!t)return()=>window.setTimeout(e,0);let s=!1;return()=>{if(!t.active){window.setTimeout(e,0);return}s||(s=!0,t.addDestroyTask(()=>{s=!1,e()}))}}};import{BeanStub as JM,_getGrandTotalRow as QM,_getGroupTotalRowCallback as eP,_isGroupMultiAutoColumn as tP}from"ag-grid-community";var sP=class extends JM{constructor(){super(...arguments),this.beanName="flattenStage",this.refreshProps=new Set(["groupHideParentOfSingleChild","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupTotalRow","masterDetail"]),this.step="map"}execute(e){const t=e.rowNode,s=[],i=this.beans.colModel.isPivotMode(),r=i&&t.leafGroup,a=r?[t]:t.childrenAfterSort,o=this.getFlattenDetails();this.recursivelyAddToRowsToDisplay(o,a,s,i,0);const n=s.length>0;if(!r&&n&&o.grandTotalRow){be(t,this.beans);const c=o.grandTotalRow==="top";this.addRowNodeToRowsToDisplay(o,t.sibling,s,0,c)}return s}getFlattenDetails(){let e=this.gos.get("groupHideParentOfSingleChild");return e||(e=this.gos.get("groupRemoveSingleChildren"),!e&&this.gos.get("groupRemoveLowestSingleChildren")&&(e="leafGroupsOnly")),{groupHideParentOfSingleChild:e,isGroupMultiAutoColumn:tP(this.gos),hideOpenParents:this.gos.get("groupHideOpenParents"),grandTotalRow:QM(this.gos),groupTotalRow:eP(this.gos)}}recursivelyAddToRowsToDisplay(e,t,s,i,r){if(t?.length)for(let a=0;af.getColId()===l?.showRowGroup),u=this.gos.get("groupDisplayType")!="multipleColumns"||this.gos.get("treeData")||this.gos.get("showOpenedGroup")&&this.rowGroupColsSvc&&!n.footer&&(!n.group||n.rowGroupIndex!=null&&n.rowGroupIndex>this.rowGroupColsSvc?.columns.findIndex(f=>f.getColId()===l?.showRowGroup)),p=!n.group&&(l?.field||l?.valueGetter),g=this.isExpandable(),m=this.colModel.isPivotMode()&&n.leafGroup&&n.rowGroupColumn?.getColId()===l?.showRowGroup;if(!this.showingValueForOpenedParent&&!g&&!p&&!u&&!d&&!m)return}this.addExpandAndContract(),this.addFullWidthRowDraggerIfNeeded(),this.addCheckboxIfNeeded(),this.addValueElement(),this.setupIndent(),this.refreshAriaExpanded(),this.addManagedPropertyListener("rowSelection",({currentValue:d,previousValue:h})=>{const u=typeof d=="object"?d:void 0,p=typeof h=="object"?h:void 0;u?.checkboxLocation!==p?.checkboxLocation&&this.refreshCheckbox()})}getCellAriaRole(){const e=this.params.colDef?.cellAriaRole,t=this.params.column?.getColDef().cellAriaRole;return e||t||"gridcell"}destroy(){super.destroy(),this.expandListener=null,this.destroyCheckbox()}refreshAriaExpanded(){const{node:e,eGridCell:t}=this.params;if(this.expandListener&&(this.expandListener=this.expandListener()),!this.isExpandable()){gP(t);return}const s=()=>{mP(t,this.showingValueForOpenedParent||!!e.expanded)};[this.expandListener]=this.addManagedListeners(e,{expandedChanged:s})||null,s()}isTopLevelFooter(){if(!hP(this.gos)||this.params.value!=null||this.params.node.level!=-1)return!1;const t=this.params.colDef;if(t==null||t.showRowGroup===!0)return!0;const i=this.rowGroupColsSvc?.columns;return!i||i.length===0?!0:i[0].getId()===t.showRowGroup}isEmbeddedRowMismatch(){if(!this.params.fullWidth||!this.gos.get("embedFullWidthRows"))return!1;const e=this.params.pinned==="left",t=this.params.pinned==="right",s=!e&&!t;return this.gos.get("enableRtl")?this.visibleCols.isPinningLeft()?!t:!s:this.visibleCols.isPinningLeft()?!e:!s}findDisplayedGroupNode(){const e=this.params.column,t=this.params.node;if(this.showingValueForOpenedParent){let s=t.parent;for(;s!=null;){if(s.rowGroupColumn&&e.isRowGroupDisplayed(s.rowGroupColumn.getId())){this.displayedGroupNode=s;break}s=s.parent}}pP(this.displayedGroupNode)&&(this.displayedGroupNode=t)}setupShowingValueForOpenedParent(){this.showingValueForOpenedParent=this.groupHideOpenParentsSvc?.isShowingValueForOpenedParent(this.params.node,this.params.column)??!1}addValueElement(){this.displayedGroupNode.footer?this.addFooterValue():(this.addGroupValue(),this.addChildCount())}addGroupValue(){const e=this.adjustParamsWithDetailsFromRelatedColumn(),t=this.getInnerCompDetails(e),{valueFormatted:s,value:i}=e;let r=s;if(r==null){const a=this.displayedGroupNode.rowGroupColumn&&this.params.column?.isRowGroupDisplayed(this.displayedGroupNode.rowGroupColumn.getId());this.displayedGroupNode.key===""&&this.displayedGroupNode.group&&a?r=this.getLocaleTextFunc()("blanks","(Blanks)"):r=i??null}this.comp.setInnerRenderer(t,r)}adjustParamsWithDetailsFromRelatedColumn(){const e=this.displayedGroupNode.rowGroupColumn,t=this.params.column;if(!e)return this.params;if(t!=null&&!t.isRowGroupDisplayed(e.getId()))return this.params;const i=this.params,{value:r,node:a}=this.params,o=this.valueSvc.formatValue(e,a,r);return{...i,valueFormatted:o}}addFooterValue(){const e=this.params.totalValueGetter;let t="";if(e){const i={...this.params,value:this.params.value};typeof e=="function"?t=e(i):typeof e=="string"?t=this.expressionSvc?this.expressionSvc.evaluate(e,i):"":CP(179)}else t=this.getLocaleTextFunc()("footerTotal","Total")+" "+(this.params.value!=null?this.params.value:"");const s=this.getInnerCompDetails(this.params);this.comp.setInnerRenderer(s,t)}getInnerCompDetails(e){if(e.fullWidth)return br(this.userCompFactory,this.gos.get("groupRowRendererParams"),e);const t=br(this.userCompFactory,e,e),s=o=>o&&o.componentClass==this.compClass;if(t&&!s(t))return t;const r=this.displayedGroupNode.rowGroupColumn?.getColDef();if(!r)return;const a=lP(this.userCompFactory,r,e);if(a&&!s(a))return a;if(s(a)&&r.cellRendererParams&&r.cellRendererParams.innerRenderer)return br(this.userCompFactory,r.cellRendererParams,e)}addChildCount(){this.params.suppressCount||(this.addManagedListeners(this.displayedGroupNode,{allChildrenCountChanged:this.updateChildCount.bind(this)}),this.updateChildCount())}updateChildCount(){const e=this.displayedGroupNode.allChildrenCount,i=this.isShowRowGroupForThisRow()&&e!=null&&e>=0?`(${e})`:"";this.comp.setChildCount(i)}isShowRowGroupForThisRow(){if(this.gos.get("treeData"))return!0;const e=this.displayedGroupNode.rowGroupColumn;if(!e)return!1;const t=this.params.column;return t==null||t.isRowGroupDisplayed(e.getId())}addExpandAndContract(){const e=this.params,t=(a,o)=>{const n=nP(a,this.beans,null);n&&(o.appendChild(n),this.addDestroyFunc(()=>o.removeChild(n)))};t("groupExpanded",this.eExpanded),t("groupContracted",this.eContracted);const s=e.eGridCell;!(this.params.column?.isCellEditable(e.node)&&this.gos.get("enableGroupEdit"))&&this.isExpandable()&&!e.suppressDoubleClickExpand&&this.addManagedListeners(s,{dblclick:this.onCellDblClicked.bind(this)}),this.addManagedListeners(this.eExpanded,{click:this.onExpandClicked.bind(this)}),this.addManagedListeners(this.eContracted,{click:this.onExpandClicked.bind(this)}),this.addManagedListeners(s,{keydown:this.onKeyDown.bind(this)}),this.addManagedListeners(e.node,{expandedChanged:this.showExpandAndContractIcons.bind(this)}),this.showExpandAndContractIcons();const r=this.onRowNodeIsExpandableChanged.bind(this);this.addManagedListeners(this.displayedGroupNode,{allChildrenCountChanged:r,masterChanged:r,groupChanged:r,hasChildrenChanged:r})}onExpandClicked(e){Zn(e)||(fP(e),this.onExpandOrContract(e))}onExpandOrContract(e){const t=this.displayedGroupNode,s=!t.expanded;!s&&t.sticky&&this.scrollToStickyNode(t),t.setExpanded(s,e)}scrollToStickyNode(e){this.ctrlsSvc.getScrollFeature().setVerticalScrollPosition(e.rowTop-e.stickyRowTop)}isExpandable(){if(this.showingValueForOpenedParent)return!0;const e=this.displayedGroupNode,t=this.colModel.isPivotMode()&&e.leafGroup;if(!(e.isExpandable()&&!e.footer&&!t))return!1;const i=this.params.column;return i!=null&&typeof i.getColDef().showRowGroup=="string"?this.isShowRowGroupForThisRow():!0}showExpandAndContractIcons(){const{params:e,displayedGroupNode:t,colModel:s}=this,{node:i}=e,r=this.isExpandable();if(r){const c=this.showingValueForOpenedParent?!0:i.expanded;this.comp.setExpandedDisplayed(c),this.comp.setContractedDisplayed(!c)}else this.comp.setExpandedDisplayed(!1),this.comp.setContractedDisplayed(!1);const a=s.isPivotMode(),o=a&&t.leafGroup,n=r&&!o,l=i.footer&&i.level===-1;this.comp.addOrRemoveCssClass("ag-cell-expandable",n),this.comp.addOrRemoveCssClass("ag-row-group",n),a?this.comp.addOrRemoveCssClass("ag-pivot-leaf-group",!!o):l||this.comp.addOrRemoveCssClass("ag-row-group-leaf-indent",!n)}onRowNodeIsExpandableChanged(){this.showExpandAndContractIcons(),this.setIndent(),this.refreshAriaExpanded()}setupIndent(){const e=this.params.node;this.params.suppressPadding||(this.addManagedListeners(e,{uiLevelChanged:this.setIndent.bind(this)}),this.setIndent())}setIndent(){if(this.gos.get("groupHideOpenParents"))return;const e=this.params,t=e.node,s=!!e.colDef,i=this.gos.get("treeData"),a=!s||i||e.colDef.showRowGroup===!0?t.uiLevel:0;this.indentClass&&this.comp.addOrRemoveCssClass(this.indentClass,!1),this.indentClass="ag-row-group-indent-"+a,this.comp.addOrRemoveCssClass(this.indentClass,!0),this.eGui.style.setProperty("--ag-indentation-level",String(a))}addFullWidthRowDraggerIfNeeded(){if(!this.params.fullWidth||!this.params.rowDrag||!this.rowDragSvc)return;const e=this.rowDragSvc.createRowDragComp(()=>this.params.value,this.params.node);this.createManagedBean(e),this.eGui.insertAdjacentElement("afterbegin",e.getGui())}addCheckboxIfNeeded(){const e=this.displayedGroupNode,t=this.gos.get("rowSelection"),s=cP(t),i=typeof t=="object"?s==="autoGroupColumn"&&dP(t):this.params.checkbox,a=(typeof i=="function"||i===!0)&&!e.footer&&!e.rowPinned&&!e.detail&&!!this.selectionSvc&&uP(this.gos);if(a){const o=this.selectionSvc.createCheckboxSelectionComponent();this.cbComp=o,this.createBean(o),o.init({rowNode:this.params.node,column:this.params.column,overrides:{isVisible:i,callbackParams:this.params,removeHidden:!0}}),this.eCheckbox.appendChild(o.getGui())}this.comp.setCheckboxVisible(a)}destroyCheckbox(){this.cbComp&&this.eCheckbox.removeChild(this.cbComp.getGui()),this.cbComp=this.destroyBean(this.cbComp)}refreshCheckbox(){this.destroyCheckbox(),this.addCheckboxIfNeeded()}onKeyDown(e){!(e.key===oP.ENTER)||this.params.suppressEnterExpand||this.params.column&&this.params.column.isCellEditable(this.params.node)||this.onExpandOrContract(e)}onCellDblClicked(e){if(Zn(e))return;qn(this.eExpanded,e)||qn(this.eContracted,e)||this.onExpandOrContract(e)}},vP=` `,Qn=class extends iP{constructor(){super(vP),this.eExpanded=Wt,this.eContracted=Wt,this.eCheckbox=Wt,this.eValue=Wt,this.eChildCount=Wt}init(e){const t={setInnerRenderer:(a,o)=>this.setRenderDetails(a,o),setChildCount:a=>this.eChildCount.textContent=a,addOrRemoveCssClass:(a,o)=>this.addOrRemoveCssClass(a,o),setContractedDisplayed:a=>Xn(this.eContracted,a),setExpandedDisplayed:a=>Xn(this.eExpanded,a),setCheckboxVisible:a=>this.eCheckbox.classList.toggle("ag-invisible",!a)},s=this.createManagedBean(new Jn),i=!e.colDef,r=this.getGui();s.init(t,r,this.eCheckbox,this.eExpanded,this.eContracted,this.constructor,e),i&&rP(r,s.getCellAriaRole())}setRenderDetails(e,t){e?e.newAgStackInstance().then(s=>{if(!s)return;const i=()=>this.destroyBean(s);this.isAlive()?(this.eValue.appendChild(s.getGui()),this.addDestroyFunc(i)):i()}):this.eValue.innerText=t}destroy(){this.destroyBean(this.innerCellRenderer),super.destroy()}refresh(){return!1}};import{BeanStub as yP}from"ag-grid-community";var SP=class extends yP{constructor(){super(...arguments),this.beanName="showRowGroupCols"}refresh(){this.showRowGroupCols=[],this.showRowGroupColsMap={};const{colModel:e,rowGroupColsSvc:t}=this.beans;e.getCols().forEach(s=>{const r=s.getColDef().showRowGroup,a=typeof r=="string";!a&&!(r===!0)||(this.showRowGroupCols.push(s),a?this.showRowGroupColsMap[r]=s:t&&t.columns.forEach(n=>{this.showRowGroupColsMap[n.getId()]=s}))})}getShowRowGroupCols(){return this.showRowGroupCols}getShowRowGroupCol(e){return this.showRowGroupColsMap[e]}getSourceColumnsForGroupColumn(e){const t=e.getColDef().showRowGroup;if(!t)return null;const{rowGroupColsSvc:s,colModel:i}=this.beans;if(t===!0&&s)return s.columns.slice(0);const r=i.getColDefCol(t);return r?[r]:null}isRowGroupDisplayed(e,t){const{colDef:s}=e;if(s?.showRowGroup==null)return!1;const i=s.showRowGroup===!0,r=s.showRowGroup===t;return i||r}};import{BeanStub as bP,_isClientSideRowModel as wP,_isGroupRowsSticky as xP,_isServerSideRowModel as TP}from"ag-grid-community";import{BeanStub as MP,_getRowHeightForNode as PP,_isClientSideRowModel as FP,_isGroupRowsSticky as AP,_last as RP}from"ag-grid-community";var EP=class extends MP{constructor(e,t){super(),this.createRowCon=e,this.destroyRowCtrls=t,this.stickyTopRowCtrls=[],this.stickyBottomRowCtrls=[],this.extraTopHeight=0,this.extraBottomHeight=0}postConstruct(){this.isClientSide=FP(this.gos),this.beans.ctrlsSvc.whenReady(this,e=>{this.gridBodyCtrl=e.gridBodyCtrl}),this.resetStickyContainers()}setOffsetTop(e){this.extraTopHeight!==e&&(this.extraTopHeight=e,this.eventSvc.dispatchEvent({type:"stickyTopOffsetChanged",offset:e}))}setOffsetBottom(e){this.extraBottomHeight!==e&&(this.extraBottomHeight=e)}resetOffsets(){this.setOffsetBottom(0),this.setOffsetTop(0)}getLastPixelOfGroup(e){return this.isClientSide?DP(e):IP(e)}getFirstPixelOfGroup(e){return e.footer?e.sibling.rowTop+e.sibling.rowHeight-1:e.hasChildren()?e.rowTop-1:0}updateStickyRows(e){const t=e==="top";let s=0;if(!this.canRowsBeSticky())return this.refreshNodesAndContainerHeight(e,new Set,s);const{rowModel:i,rowRenderer:r}=this.beans,a=t?r.firstVisibleVPixel-this.extraTopHeight:r.lastVisibleVPixel-this.extraTopHeight,o=new Set,n=h=>{if(o.add(h),t){const u=this.getLastPixelOfGroup(h),p=a+s+h.rowHeight;up?h.stickyRowTop=s-(u-p):h.stickyRowTop=s}s=0,o.forEach(u=>{const p=u.stickyRowTop+u.rowHeight;s{if(!h.displayed)return!1;if(h.footer){if(l===!0||l==="grand"&&h.level===-1||l==="group"&&h.level>-1)return!1;const u=h.sibling.rowIndex?h.sibling.rowIndex+1===h.rowIndex:!1;return e==="bottom"&&u?!1:!o.has(h)}return h.isExpandable()?c===!0||e==="bottom"?!1:!o.has(h)&&h.expanded:!1};for(let h=0;h<100;h++){let u=a+s;t||(u=a-s);const p=i.getRowIndexAtPixel(u),g=i.getRow(p);if(g==null)break;const C=this.getStickyAncestors(g).find(v=>(t?v.rowIndexp)&&d(v));if(C){n(C);continue}if((t?g.rowTopu)&&d(g)){n(g);continue}break}return t||o.forEach(h=>{h.stickyRowTop=s-(h.stickyRowTop+h.rowHeight)}),this.refreshNodesAndContainerHeight(e,o,s)}areFooterRowsStickySuppressed(){const e=this.gos.get("suppressStickyTotalRow");if(e===!0)return!0;const t=e==="group",s=e==="grand";return t&&s?!0:s?"grand":t?"group":!1}canRowsBeSticky(){const e=AP(this.gos),t=this.areFooterRowsStickySuppressed(),s=this.gos.get("suppressGroupRowsSticky");return e&&(!t||!s)}getStickyAncestors(e){const t=[];let s=e.footer?e.sibling:e.parent;for(;s;)s.sibling&&t.push(s.sibling),t.push(s),s=s.parent;return t.reverse()}checkStickyRows(){const e=this.updateStickyRows("top"),t=this.updateStickyRows("bottom");return e||t}destroyStickyCtrls(){this.resetStickyContainers()}resetStickyContainers(){this.refreshNodesAndContainerHeight("top",new Set,0),this.refreshNodesAndContainerHeight("bottom",new Set,0)}refreshStickyNode(e){const t=new Set;if(this.stickyTopRowCtrls.some(s=>s.rowNode===e)){for(let s=0;s{n.has(p)||(p.sticky=!0,l.push(this.createRowCon(p,!1,!1)))});let c=!!l.length||o.length!==r.length;i?this.topContainerHeight!==s&&(this.topContainerHeight=s,this.gridBodyCtrl.setStickyTopHeight(s),c=!0):this.bottomContainerHeight!==s&&(this.bottomContainerHeight=s,this.gridBodyCtrl.setStickyBottomHeight(s),c=!0),this.destroyRowCtrls(a,!1);const d=[...o,...l];d.sort((p,g)=>g.rowNode.rowIndex-p.rowNode.rowIndex),i||d.reverse(),d.forEach(p=>p.setRowTop(p.rowNode.stickyRowTop));const h=this.beans.pageBounds;let u=0;return i?(t.forEach(p=>{p.rowIndexthis.topContainerHeight&&(u=this.topContainerHeight),this.setOffsetTop(u)):(t.forEach(p=>{p.rowIndex>h.getLastRow()&&(u+=p.rowHeight)}),u>this.bottomContainerHeight&&(u=this.bottomContainerHeight),this.setOffsetBottom(u)),c?(i?this.stickyTopRowCtrls=d:this.stickyBottomRowCtrls=d,!0):!1}ensureRowHeightsValid(){let e=!1;const t=s=>{const i=s.rowNode;if(i.rowHeightEstimated){const r=PP(this.beans,i);i.setRowHeight(r.height),e=!0}};return this.stickyTopRowCtrls.forEach(t),this.stickyBottomRowCtrls.forEach(t),e}};function IP(e){if(e.isExpandable()||e.footer){if(e.master&&e.detailNode)return e.detailNode.rowTop+e.detailNode.rowHeight;if(!e.sibling||Math.abs(e.sibling.rowIndex-e.rowIndex)===1){let s=e.childStore?.getStoreBounds();return e.footer&&(s=e.sibling.childStore?.getStoreBounds()),(s?.heightPx??0)+(s?.topPx??0)}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}function DP(e){if(e.isExpandable()||e.footer){if(e.footer&&e.rowIndex===0)return Number.MAX_SAFE_INTEGER;if(!e.sibling||Math.abs(e.sibling.rowIndex-e.rowIndex)===1){let i=e.footer?e.sibling:e;for(;i.isExpandable()&&i.expanded;)if(i.master&&i.detailNode)i=i.detailNode;else if(i.childrenAfterSort){if(i.childrenAfterSort.length===0)break;i=RP(i.childrenAfterSort)}return i.rowTop+i.rowHeight}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}var LP=class extends bP{constructor(){super(...arguments),this.beanName="stickyRowSvc"}createStickyRowFeature(e,t,s){const i=this.gos;if(xP(i)&&wP(i)||TP(i))return e.createManagedBean(new EP(t,s))}},el={moduleName:"GroupCellRenderer",version:R,userComponents:{agGroupRowRenderer:Qn,agGroupCellRenderer:Qn},dynamicBeans:{groupCellRendererCtrl:Jn},icons:{groupContracted:"tree-closed",groupExpanded:"tree-open"},dependsOn:[G]},tl={moduleName:"GroupColumn",version:R,beans:[jM,SP,IM,Wn,Kn],dependsOn:[G,el]},Ns={moduleName:"ClientSideRowModelHierarchy",version:R,rowModels:["clientSide"],beans:[sP,ZM],dependsOn:[G]},wr={moduleName:"StickyRow",version:R,beans:[LP]};import{Component as kP,_setAriaRole as GP}from"ag-grid-community";var OP=class extends kP{constructor(){super()}postConstruct(){this.setGui(this.createNorthPanel());const e=this.onRowGroupChanged.bind(this);this.addManagedEventListeners({columnRowGroupChanged:e,newColumnsLoaded:e}),this.addManagedPropertyListener("rowGroupPanelShow",e),this.addManagedPropertyListener("pivotPanelShow",()=>this.onPivotPanelShow()),this.onRowGroupChanged()}createNorthPanel(){const e=document.createElement("div");e.classList.add("ag-column-drop-wrapper"),GP(e,"presentation");const t=new tn(!0);this.rowGroupComp=this.createManagedBean(t);const s=new en(!0);this.pivotComp=this.createManagedBean(s),e.appendChild(t.getGui()),e.appendChild(s.getGui());const i=this.onDropPanelVisible.bind(this);return this.addManagedListeners(t,{displayChanged:i}),this.addManagedListeners(s,{displayChanged:i}),this.onDropPanelVisible(),e}onDropPanelVisible(){const{rowGroupComp:e,pivotComp:t}=this,s=e.isDisplayed()&&t.isDisplayed(),i="ag-column-drop-horizontal-half-width";e.addOrRemoveCssClass(i,s),t.addOrRemoveCssClass(i,s)}onRowGroupChanged(){const e=this.rowGroupComp;if(!e)return;const t=this.gos.get("rowGroupPanelShow");if(t==="always")e.setDisplayed(!0);else if(t==="onlyWhenGrouping"){const s=this.beans.rowGroupColsSvc?.columns?.length!==0;e.setDisplayed(s)}else e.setDisplayed(!1)}onPivotPanelShow(){const e=this.pivotComp;if(!e)return;const t=this.gos.get("pivotPanelShow");if(t==="always")e.setDisplayed(!0);else if(t==="onlyWhenPivoting"){const s=this.beans.colModel.isPivotActive();e.setDisplayed(s)}else e.setDisplayed(!1)}},NP={selector:"AG-GRID-HEADER-DROP-ZONES",component:OP};import{AgPromise as mt,AgSelect as BP,FilterWrapperComp as _P,RefPlaceholder as sl,TabGuardComp as VP,_clearElement as xr,_loadTemplate as HP,_setDisplayed as Tr,_warn as jt}from"ag-grid-community";var zP=class extends VP{constructor(){super(`
`),this.filterType="group",this.eGroupField=sl,this.eUnderlyingFilter=sl}wireBeans(e){this.filterManager=e.filterManager,this.showRowGroupCols=e.showRowGroupCols}postConstruct(){this.initialiseTabGuard({})}init(e){return this.updateParams(e).then(()=>{this.addManagedEventListeners({columnRowGroupChanged:()=>this.onColumnRowGroupChanged(),filterDestroyed:t=>this.onFilterDestroyed(t)})})}refresh(e){return this.updateParams(e),!0}updateParams(e){return this.params=e,this.validateParams(),this.updateGroups()}validateParams(){const{colDef:e}=this.params;e.field&&jt(234),e.filterValueGetter&&jt(235),e.filterParams&&jt(236)}updateGroups(){const e=this.updateGroupField();return this.getUnderlyingFilters(e)}getSourceColumns(){if(this.groupColumn=this.params.column,this.gos.get("treeData"))return jt(237),[];const e=this.showRowGroupCols?.getSourceColumnsForGroupColumn(this.groupColumn);return e||(jt(183),[])}updateGroupField(){const e=this.eGroupField;xr(e),this.eGroupFieldSelect&&this.destroyBean(this.eGroupFieldSelect);const t=this.getSourceColumns(),s=t.filter(i=>i.isFilterAllowed());return s.length?(t.length===1?(this.selectedColumn=s[0],Tr(e,!1)):((!this.selectedColumn||!s.some(i=>i.getId()===this.selectedColumn.getId()))&&(this.selectedColumn=s[0]),this.createGroupFieldSelectElement(s),e.appendChild(this.eGroupFieldSelect.getGui()),e.appendChild(HP('
')),Tr(e,!0)),s):(this.selectedColumn=void 0,Tr(e,!1),null)}createGroupFieldSelectElement(e){const t=this.createManagedBean(new BP);this.eGroupFieldSelect=t;const s=this.getLocaleTextFunc();t.setLabel(s("groupFilterSelect","Select field:")),t.setLabelAlignment("top"),t.addOptions(e.map(i=>({value:i.getId(),text:this.beans.colNames.getDisplayNameForColumn(i,"groupFilter",!1)??void 0}))),t.setValue(this.selectedColumn.getId()),t.onValueChange(i=>this.updateSelectedColumn(i)),t.addCssClass("ag-group-filter-field-select-wrapper"),e.length===1&&t.setDisabled(!0)}getUnderlyingFilters(e){if(!e)return this.filterColumnPairs=void 0,this.selectedFilter=void 0,this.beans.colFilter?.setColFilterActive(this.groupColumn,!1,"columnRowGroupChanged"),mt.resolve();const t=[],s=[];return e.forEach(i=>{const r=this.filterManager.getOrCreateFilterWrapper(i);r?.filterPromise&&t.push(r.filterPromise.then(a=>(a&&s.push({filter:a,column:i}),i.getId()===this.selectedColumn.getId()&&(this.selectedFilter=a??void 0),a)))}),mt.all(t).then(()=>{this.filterColumnPairs=s,this.beans.colFilter?.setColFilterActive(this.groupColumn,this.isFilterActive(),"columnRowGroupChanged")})}addUnderlyingFilterElement(){if(xr(this.eUnderlyingFilter),!this.selectedColumn)return mt.resolve();const e=this.createManagedBean(new _P(this.selectedColumn,"COLUMN_MENU"));return this.filterWrapperComp=e,e.hasFilter()?(this.eUnderlyingFilter.appendChild(e.getGui()),e.getFilter()?.then(()=>{e.afterGuiAttached?.(this.afterGuiAttachedParams),!this.afterGuiAttachedParams?.suppressFocus&&this.eGroupFieldSelect&&!this.eGroupFieldSelect.isDisabled()&&this.eGroupFieldSelect.getFocusableElement().focus()})??mt.resolve()):mt.resolve()}updateSelectedColumn(e){if(!e)return;this.filterWrapperComp?.afterGuiDetached(),this.destroyBean(this.filterWrapperComp);const t=this.getFilterColumnPair(e);this.selectedColumn=t?.column,this.selectedFilter=t?.filter,this.dispatchLocalEvent({type:"selectedColumnChanged"}),this.addUnderlyingFilterElement()}isFilterActive(){return!!this.filterColumnPairs?.some(({filter:e})=>e.isFilterActive())}doesFilterPass(){return!0}getModel(){return null}setModel(){return mt.resolve()}afterGuiAttached(e){this.afterGuiAttachedParams=e,this.addUnderlyingFilterElement()}afterGuiDetached(){xr(this.eUnderlyingFilter),this.selectedFilter?.afterGuiDetached?.()}onColumnRowGroupChanged(){this.updateGroups().then(()=>{this.dispatchLocalEvent({type:"columnRowGroupChanged"})})}onFilterDestroyed({column:e,source:t}){if(t==="gridDestroyed")return;const s=e.getColId();this.filterColumnPairs?.some(({column:i})=>i.getColId()===s)&&setTimeout(()=>{this.isAlive()&&this.updateGroups()})}getFilterColumnPair(e){if(e)return this.filterColumnPairs?.find(({column:t})=>t.getId()===e)}getSelectedFilter(){return this.selectedFilter}getSelectedColumn(){return this.selectedColumn}isFilterAllowed(){return!!this.selectedColumn}};import{AgInputTextField as UP,AgPromise as il,Component as KP,RefPlaceholder as WP,_clearElement as jP}from"ag-grid-community";var $P=class extends KP{constructor(){super(` `),this.eFloatingFilter=WP,this.haveAddedColumnListeners=!1}wireBeans(e){this.filterManager=e.filterManager}init(e){this.params=e;const t=this.gos.get("groupDisplayType")==="multipleColumns";return new il(s=>{this.params.parentFilterInstance(i=>{this.parentFilterInstance=i,t?this.setupUnderlyingFloatingFilterElement().then(()=>s()):(this.setupReadOnlyFloatingFilterElement(),s())})}).then(()=>{const s=this.onColChange.bind(this);this.addManagedListeners(this.parentFilterInstance,{selectedColumnChanged:s,columnRowGroupChanged:s})})}refresh(e){this.params=e,this.setParams()}setParams(){const e=this.beans.colNames.getDisplayNameForColumn(this.params.column,"header",!0),t=this.getLocaleTextFunc();this.eFloatingFilterText?.setInputAriaLabel(`${e} ${t("ariaFilterInput","Filter Input")}`)}setupReadOnlyFloatingFilterElement(){this.eFloatingFilterText||(this.eFloatingFilterText=this.createManagedBean(new UP),this.eFloatingFilterText.setDisabled(!0).addGuiEventListener("click",()=>this.params.showParentFilter()),this.setParams()),this.updateDisplayedValue(),this.eFloatingFilter.appendChild(this.eFloatingFilterText.getGui())}setupUnderlyingFloatingFilterElement(){this.showingUnderlyingFloatingFilter=!1,this.underlyingFloatingFilter=void 0,jP(this.eFloatingFilter);const e=this.parentFilterInstance.getSelectedColumn();if(e&&!e.isVisible()){const t=this.filterManager.getFloatingFilterCompDetails(e,this.params.showParentFilter);if(t)return this.haveAddedColumnListeners||(this.haveAddedColumnListeners=!0,this.addManagedListeners(e,{visibleChanged:this.onColumnVisibleChanged.bind(this),colDefChanged:this.onColDefChanged.bind(this)})),t.newAgStackInstance().then(s=>{this.underlyingFloatingFilter=s,this.underlyingFloatingFilter?.onParentModelChanged(this.parentFilterInstance.getSelectedFilter()?.getModel()),this.appendChild(s.getGui()),this.showingUnderlyingFloatingFilter=!0})}return this.setupReadOnlyFloatingFilterElement(),il.resolve()}onColumnVisibleChanged(){this.setupUnderlyingFloatingFilterElement()}onColDefChanged(e){if(!e.column)return;const t=this.filterManager.getFloatingFilterCompDetails(e.column,this.params.showParentFilter);t&&this.underlyingFloatingFilter?.refresh?.(t.params)}onParentModelChanged(e,t){this.showingUnderlyingFloatingFilter?this.underlyingFloatingFilter?.onParentModelChanged(this.parentFilterInstance.getSelectedFilter()?.getModel(),t):this.updateDisplayedValue()}updateDisplayedValue(){const{eFloatingFilterText:e,parentFilterInstance:t}=this;if(!t||!e)return;const s=t.getSelectedFilter();if(!s){e.setValue(""),e.setDisplayed(!1);return}if(e.setDisplayed(!0),s.getModelAsString){const i=s.getModel();e.setValue(i==null?"":s.getModelAsString(i))}else e.setValue("")}onColChange(){this.showingUnderlyingFloatingFilter||this.updateDisplayedValue()}};import{BeanStub as YP,_error as XP,_missing as qP}from"ag-grid-community";var ZP=class extends YP{constructor(){super(...arguments),this.beanName="groupHideOpenParentsSvc"}updateGroupDataForHideOpenParents(e){if(!this.gos.get("groupHideOpenParents")||this.gos.get("treeData"))return;const t=s=>{this.pullDownGroupDataForHideOpenParents(s.childrenAfterSort,!1),s.childrenAfterSort.forEach(i=>{i.hasChildren()&&t(i)})};e&&e.executeFromRootNode(s=>t(s))}pullDownGroupDataForHideOpenParents(e,t){if(!this.gos.get("groupHideOpenParents")||qP(e))return;const{colModel:s,showRowGroupCols:i}=this.beans;e.forEach(r=>{(i?.getShowRowGroupCols()??[]).forEach(o=>{const n=o.getColDef().showRowGroup;if(typeof n!="string"){XP(110);return}const l=n,c=s.getColDefCol(l);if(c!==r.rowGroupColumn)if(t)Rs(r,s,o.getId(),void 0);else{const h=this.getFirstChildOfFirstChild(r,c);h&&Rs(r,s,o.getId(),h.key)}})})}isShowingValueForOpenedParent(e,t){if(!this.gos.get("groupHideOpenParents")||!e.groupData)return!1;if(e.rowGroupColumn!=null){const i=e.rowGroupColumn.getId();if(t.isRowGroupDisplayed(i))return!1}return e.groupData[t.getId()]!=null}getFirstChildOfFirstChild(e,t){let s=e;for(;s;){const i=s.parent;if(i?.childrenAfterSort&&s===i.childrenAfterSort[0]){if(i.rowGroupColumn===t)return i}else return null;s=i}return null}};import{BeanStub as JP,RowNode as QP,_ROW_ID_PREFIX_ROW_GROUP as eF,_areEqual as Mr,_exists as rl,_removeFromArray as tF,_warn as sF}from"ag-grid-community";var Pr=class{constructor(){this.allSets={},this.allParents=[]}removeFromChildrenAfterGroup(e,t){const s=this.getSet(e);s.removeFromChildrenAfterGroup[t.id]=!0}isRemoveFromAllLeafChildren(e,t){return!!this.getSet(e).removeFromAllLeafChildren[t.id]}preventRemoveFromAllLeafChildren(e,t){const s=this.getSet(e);delete s.removeFromAllLeafChildren[t.id]}removeFromAllLeafChildren(e,t){const s=this.getSet(e);s.removeFromAllLeafChildren[t.id]=!0}getSet(e){return this.allSets[e.id]||(this.allSets[e.id]={removeFromAllLeafChildren:{},removeFromChildrenAfterGroup:{}},this.allParents.push(e)),this.allSets[e.id]}getAllParents(){return this.allParents}flush(){this.allParents.forEach(e=>{const t=this.allSets[e.id];e.childrenAfterGroup=e.childrenAfterGroup.filter(i=>!t.removeFromChildrenAfterGroup[i.id]),e.allLeafChildren=e.allLeafChildren?.filter(i=>!t.removeFromAllLeafChildren[i.id])??null,e.updateHasChildren();const s=e.sibling;s&&(s.childrenAfterGroup=e.childrenAfterGroup,s.allLeafChildren=e.allLeafChildren)}),this.allSets={},this.allParents.length=0}};function iF(e){if(!e)return!1;const t=e.length;if(t<2)return!1;let s=!1;for(let i=1;i0){s=!0;break}return s?(e.sort(al),!0):!1}function al(e,t){const s=e.sourceRowIndex,i=t.sourceRowIndex,r=s>=0,a=i>=0,o=r&&a,n=!r&&!a;return o?s-i:n?e.__objectId-t.__objectId:r?1:-1}var rF=class extends JP{constructor(){super(...arguments),this.beanName="groupStage",this.refreshProps=new Set(["groupDefaultExpanded","groupAllowUnbalanced","initialGroupOrderComparator","groupHideOpenParents","groupDisplayType"]),this.step="group"}wireBeans(e){this.colModel=e.colModel,this.rowGroupColsSvc=e.rowGroupColsSvc,this.valueSvc=e.valueSvc,this.selectionSvc=e.selectionSvc,this.showRowGroupCols=e.showRowGroupCols}execute(e){const t=this.createGroupingDetails(e),s=e.changedRowNodes;s?this.handleDeltaUpdate(t,s):this.shotgunResetEverything(t,!!e.afterColumnsChanged);const i=e.changedPath;this.positionLeafsAndGroups(i),this.orderGroups(t),this.selectionSvc?.updateSelectableAfterGrouping(i)}positionLeafsAndGroups(e){e.forEachChangedNodeDepthFirst(t=>{if(t.childrenAfterGroup){const s=[],i=[];let r;t.childrenAfterGroup.forEach(a=>{a.childrenAfterGroup?.length?a.key===""&&!r?r=a:i.push(a):s.push(a)}),r&&i.push(r),t.childrenAfterGroup=[...s,...i]}},!1)}createGroupingDetails(e){const{rowNode:t,changedPath:s,rowNodesOrderChanged:i}=e,r=this.rowGroupColsSvc?.columns;return{expandByDefault:this.gos.get("groupDefaultExpanded"),groupedCols:r,rootNode:t,pivotMode:this.colModel.isPivotMode(),groupedColCount:r?.length??0,rowNodesOrderChanged:!!i,changedPath:s,groupAllowUnbalanced:this.gos.get("groupAllowUnbalanced"),isGroupOpenByDefault:this.gos.getCallback("isGroupOpenByDefault"),initialGroupOrderComparator:this.gos.getCallback("initialGroupOrderComparator"),keyCreators:r?.map(o=>o.getColDef().keyCreator)??[]}}handleDeltaUpdate(e,{removals:t,updates:s,adds:i}){const r=new Pr;t.size&&this.removeNodes(t,e,r);for(const n of s)this.moveNodeInWrongPath(n,e,r);const a=e.changedPath;for(const n of i)this.insertOneNode(n,e),a.active&&a.addParentNode(n.parent);const o=r.getAllParents().slice();r.flush(),this.removeEmptyGroups(o,e),e.rowNodesOrderChanged&&this.sortChildren(e)}sortChildren(e){e.changedPath.forEachChangedNodeDepthFirst(t=>{iF(t.childrenAfterGroup)&&e.changedPath.addParentNode(t)},!1,!0)}orderGroups(e){const t=e.initialGroupOrderComparator;rl(t)&&s(e.rootNode);function s(i){rl(i.childrenAfterGroup)&&!i.leafGroup&&(i.childrenAfterGroup.sort((a,o)=>t({nodeA:a,nodeB:o})),i.childrenAfterGroup.forEach(a=>s(a)))}}getExistingPathForNode(e,t){const s=[];let i=e.parent;for(;i&&i!==t.rootNode;)s.push({key:i.key,rowGroupColumn:i.rowGroupColumn,field:i.field}),i=i.parent;return s.reverse(),s}moveNodeInWrongPath(e,t,s){t.changedPath.active&&t.changedPath.addParentNode(e.parent);const i=n=>n.key,r=this.getExistingPathForNode(e,t).map(i),a=this.getGroupInfo(e,t).map(i);Mr(r,a)||this.moveNode(e,t,s)}moveNode(e,t,s){if(this.removeNodesFromParents([e],t,s),this.insertOneNode(e,t,s),e.setData(e.data),t.changedPath.active){const i=e.parent;t.changedPath.addParentNode(i)}}removeNodes(e,t,s){if(this.removeNodesFromParents(e,t,s),t.changedPath.active)for(const i of e)t.changedPath.addParentNode(i.parent)}forEachParentGroup(e,t,s){let i=t;for(;i&&i!==e.rootNode;)s(i),i=i.parent}removeNodesFromParents(e,t,s){const i=s==null,r=s||new Pr;for(const a of e)this.removeFromParent(a,r),this.forEachParentGroup(t,a.parent,o=>{r.removeFromAllLeafChildren(o,a)});i&&r.flush()}removeEmptyGroups(e,t){let s=!0;const i=r=>{const a=this.getChildrenMappedKey(r.key,r.rowGroupColumn),o=r.parent;return(o?.childrenMapped?!o.childrenMapped[a]:!0)?!1:!!r.group&&(r.childrenAfterGroup?.length??0)===0};for(;s;){s=!1;const r=new Pr;e.forEach(a=>{this.forEachParentGroup(t,a,o=>{i(o)&&(s=!0,this.removeFromParent(o,r),this.selectionSvc?.setNodesSelected({nodes:[o],newValue:!1,source:"rowGroupChanged"}))})}),r.flush()}}removeFromParent(e,t){e.parent&&(t?t.removeFromChildrenAfterGroup(e.parent,e):(tF(e.parent.childrenAfterGroup,e),e.parent.updateHasChildren()));const s=this.getChildrenMappedKey(e.key,e.rowGroupColumn);e.parent?.childrenMapped&&delete e.parent.childrenMapped[s],e.setRowTop(null),e.setRowIndex(null)}addToParent(e,t){const s=this.getChildrenMappedKey(e.key,e.rowGroupColumn);t?.childrenMapped&&t.childrenMapped[s]!==e&&(t.childrenMapped[s]=e,t.childrenAfterGroup.push(e),Vo(t,this.beans,!0))}areGroupColsEqual(e,t){return e==null||t==null||e.pivotMode!==t.pivotMode?!1:Mr(e.groupedCols,t.groupedCols)&&Mr(e.keyCreators,t.keyCreators)}checkAllGroupDataAfterColsChanged(e){const t=s=>{s&&s.forEach(i=>{if(!i.group)return;const a={field:i.field,key:i.key,rowGroupColumn:i.rowGroupColumn,leafNode:i.allLeafChildren?.[0]};this.setGroupData(i,a),t(i.childrenAfterGroup)})};t(e.rootNode.childrenAfterGroup)}shotgunResetEverything(e,t){if(this.noChangeInGroupingColumns(e,t))return;this.selectionSvc?.filterFromSelection?.(a=>!a.group);const{groupedCols:s}=e,i=e.rootNode;i.leafGroup=s.length===0,i.childrenAfterGroup=[],i.childrenMapped={},i.updateHasChildren();const r=i.sibling;r&&(r.childrenAfterGroup=i.childrenAfterGroup,r.childrenMapped=i.childrenMapped),this.insertNodes(i.allLeafChildren,e)}noChangeInGroupingColumns(e,t){let s=!1;const i=this.showRowGroupCols.getShowRowGroupCols(),r=i?i.map(a=>a.getId()).join("-"):"";return t&&(s=this.areGroupColsEqual(e,this.oldGroupingDetails),this.oldGroupDisplayColIds!==r&&this.checkAllGroupDataAfterColsChanged(e)),this.oldGroupingDetails=e,this.oldGroupDisplayColIds=r,s}insertNodes(e,t){e.forEach(s=>{this.insertOneNode(s,t),t.changedPath.active&&t.changedPath.addParentNode(s.parent)})}insertOneNode(e,t,s){const i=this.getGroupInfo(e,t),r=this.findParentForNode(e,i,t,s);r.group||sF(184,{parentGroupData:r.data,childNodeData:e.data}),e.parent=r,e.level=i.length,r.childrenAfterGroup.push(e),r.updateHasChildren()}findParentForNode(e,t,s,i){let r=s.rootNode;return t.forEach((a,o)=>{r=this.getOrCreateNextNode(r,a,o,s),i?.isRemoveFromAllLeafChildren(r,e)?i?.preventRemoveFromAllLeafChildren(r,e):r.allLeafChildren.push(e)}),r}getOrCreateNextNode(e,t,s,i){const r=this.getChildrenMappedKey(t.key,t.rowGroupColumn);let a=e?.childrenMapped?.[r];return a||(a=this.createGroup(t,e,s,i),this.addToParent(a,e)),a}createGroup(e,t,s,i){const r=new QP(this.beans);return r.group=!0,r.field=e.field,r.rowGroupColumn=e.rowGroupColumn,this.setGroupData(r,e),r.key=e.key,r.id=this.createGroupId(r,t,s),r.level=s,r.leafGroup=s===i.groupedColCount-1,r.allLeafChildren=[],r.setAllChildrenCount(0),r.rowGroupIndex=s,r.childrenAfterGroup=[],r.childrenMapped={},r.updateHasChildren(),r.parent=t,this.setExpandedInitialValue(i,r),r}createGroupId(e,t,s){const i=(r,a)=>{if(!r.rowGroupColumn)return null;const o=a?i(a,a.parent,0):null;return`${o==null?"":o+"-"}${r.rowGroupColumn.getColId()}-${r.key}`};return eF+i(e,t,s)}setGroupData(e,t){e.groupData={},this.showRowGroupCols.getShowRowGroupCols().forEach(i=>{const r=e.rowGroupColumn;r!==null&&i.isRowGroupDisplayed(r.getId())&&(e.groupData[i.getColId()]=this.valueSvc.getValue(r,t.leafNode))})}getChildrenMappedKey(e,t){return t?t.getId()+"-"+e:e}setExpandedInitialValue(e,t){if(e.pivotMode&&t.leafGroup){t.expanded=!1;return}const s=e.isGroupOpenByDefault;if(s){const i={rowNode:t,field:t.field,key:t.key,level:t.level,rowGroupColumn:t.rowGroupColumn};t.expanded=s(i)==!0;return}if(e.expandByDefault===-1){t.expanded=!0;return}t.expanded=t.level{let r=this.valueSvc.getKeyForNode(i,e),a=r!=null&&r!=="";if((t.pivotMode||!t.groupAllowUnbalanced)&&!a&&(r="",a=!0),a){const n={key:r,field:i.getColDef().field,rowGroupColumn:i,leafNode:e};s.push(n)}}),s}};function aF(e,t){e.rowGroupColsSvc?.setColumns(t,"api")}function oF(e,t){e.rowGroupColsSvc?.removeColumns(t,"api")}function nF(e,t){e.rowGroupColsSvc?.addColumns(t,"api")}function lF(e,t,s){e.rowGroupColsSvc?.moveColumn?.(t,s,"api")}function cF(e){return e.rowGroupColsSvc?.columns??[]}var ol={moduleName:"SharedRowGrouping",version:R,beans:[ZP],apiFunctions:{setRowGroupColumns:aF,removeRowGroupColumns:oF,addRowGroupColumns:nF,getRowGroupColumns:cF,moveRowGroupColumn:lF},dependsOn:[G,vr,tl,wr]},Fr={moduleName:"RowGrouping",version:R,beans:[rF],rowModels:["clientSide"],dependsOn:[ol,yr,Ns]},nl={moduleName:"RowGroupingPanel",version:R,selectors:[NP],icons:{pivotPanel:"pivot",rowGroupPanel:"group",panelDelimiter:"small-right",panelDelimiterRtl:"small-left"},dependsOn:[G,UT]},ll={moduleName:"GroupFilter",version:R,userComponents:{agGroupColumnFilter:zP,agGroupColumnFloatingFilter:$P},dependsOn:[G,zT]};import{BeanStub as dF,RowNode as hF,_getRowHeightAsNumber as cl,_missing as uF,_warn as pF}from"ag-grid-community";var gF=class extends dF{constructor(){super(...arguments),this.beanName="rowModel",this.firstRow=-1,this.lastRow=-1,this.rowCount=-1,this.rowNodesByIndex={}}ensureRowHeightsValid(e,t,s,i){return!1}postConstruct(){const e=this.beans;this.rowHeight=cl(e),this.addManagedEventListeners({viewportChanged:this.onViewportChanged.bind(this)}),this.addManagedPropertyListener("viewportDatasource",()=>this.updateDatasource()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=cl(e),this.updateRowHeights()})}start(){this.updateDatasource()}isLastRowIndexKnown(){return!0}destroy(){this.destroyDatasource(),super.destroy()}destroyDatasource(){const e=this.datasource;e&&(e.destroy?.(),this.beans.rowRenderer.datasourceChanged(),this.firstRow=-1,this.lastRow=-1)}updateDatasource(){const e=this.gos.get("viewportDatasource");e&&this.setViewportDatasource(e)}getPageSize(){return this.gos.get("viewportRowModelPageSize")}getBufferSize(){return this.gos.get("viewportRowModelBufferSize")}calculateFirstRow(e){const t=this.getBufferSize(),s=this.getPageSize(),i=e-t;return i<0?0:Math.floor(i/s)*s}calculateLastRow(e){if(e===-1)return e;const t=this.getBufferSize(),s=this.getPageSize(),i=e+t,r=Math.ceil(i/s)*s,a=this.rowCount-1;return Math.min(r,a)}onViewportChanged(e){const t=this.calculateFirstRow(e.firstRow),s=this.calculateLastRow(e.lastRow);(this.firstRow!==t||this.lastRow!==s)&&(this.firstRow=t,this.lastRow=s,this.purgeRowsNotInViewport(),this.datasource?.setViewportRange(this.firstRow,this.lastRow))}purgeRowsNotInViewport(){const e=this.rowNodesByIndex;Object.keys(e).forEach(t=>{const s=parseInt(t,10);if(sthis.lastRow){if(this.isRowFocused(s))return;delete e[s]}})}isRowFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();return!t||t.rowPinned!=null?!1:t.rowIndex===e}setViewportDatasource(e){this.destroyDatasource(),this.datasource=e,this.rowCount=-1,e.init?e.init({setRowCount:this.setRowCount.bind(this),setRowData:this.setRowData.bind(this),getRow:this.getRow.bind(this)}):pF(226)}getType(){return"viewport"}getRow(e){return this.rowNodesByIndex[e]||(this.rowNodesByIndex[e]=this.createBlankRowNode(e)),this.rowNodesByIndex[e]}getRowNode(e){let t;return this.forEachNode(s=>{s.id===e&&(t=s)}),t}getRowCount(){return this.rowCount===-1?0:this.rowCount}getRowIndexAtPixel(e){return this.rowHeight!==0?Math.floor(e/this.rowHeight):0}getRowBounds(e){const t=this.rowHeight;return{rowHeight:t,rowTop:t*e}}updateRowHeights(){const e=this.rowHeight;this.forEachNode(t=>{t.setRowHeight(e),t.setRowTop(e*t.rowIndex)}),this.eventSvc.dispatchEvent({type:"modelUpdated",newData:!1,newPage:!1,keepRenderedRows:!0,animate:!1})}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}isEmpty(){return this.rowCount>0}isRowsToRender(){return this.rowCount>0}getNodesInRangeForSelection(e,t){const s=e.rowIndex,i=t.rowIndex,r=sthis.lastRow,a=ithis.lastRow;if(r||a)return[];const o=[],n=s<=i?s:i,l=s<=i?i:s;for(let c=n;c<=l;c++)o.push(this.rowNodesByIndex[c]);return o}forEachNode(e){let t=0;Object.keys(this.rowNodesByIndex).forEach(s=>{const i=parseInt(s,10),r=this.rowNodesByIndex[i];e(r,t),t++})}setRowData(e){const t=this.rowNodesByIndex;for(const s of Object.keys(e)){const i=e[s],r=parseInt(s,10);if(r>=this.firstRow&&r<=this.lastRow){let a=t[r];uF(a)&&(a=this.createBlankRowNode(r),t[r]=a),a.setDataAndId(i,r.toString())}}}createBlankRowNode(e){const t=new hF(this.beans),s=this.rowHeight;return t.setRowHeight(s),t.setRowTop(s*e),t.setRowIndex(e),t}setRowCount(e,t=!1){if(e===this.rowCount)return;this.rowCount=e;const s=this.eventSvc;s.dispatchEventOnce({type:"rowCountReady"}),s.dispatchEvent({type:"modelUpdated",newData:!1,newPage:!1,keepRenderedRows:t,animate:!1})}isRowPresent(e){return!!this.getRowNode(e.id)}},dl={moduleName:"ViewportRowModel",version:R,rowModels:["viewport"],beans:[gF],dependsOn:[G]};import{CsvExportModule as mF,HighlightChangesModule as fF,_KeyboardNavigationModule as CF}from"ag-grid-community";function vF(e,t){e.clipboardSvc?.copyToClipboard(t)}function yF(e,t){e.clipboardSvc?.cutToClipboard(t)}function SF(e,t){e.clipboardSvc?.copySelectedRowsToClipboard(t)}function bF(e,t){e.clipboardSvc?.copySelectedRangeToClipboard(t)}function wF(e){e.clipboardSvc?.copyRangeDown()}function xF(e){e.clipboardSvc?.pasteFromClipboard()}import{BeanStub as TF,ChangedPath as MF,_createCellId as ft,_exists as PF,_getActiveDomElement as FF,_getDocument as hl,_getRowNode as Ar,_isClientSideRowModel as AF,_isSameRow as ul,_last as RF,_removeFromArray as EF,_warn as Bs}from"ag-grid-community";var Rr="paste",Er="dragCopy",pl="clipboard";function IF(e,t=","){const s=[],i=a=>a==="\r"||a===` `;let r=!1;if(e==="")return[[""]];for(let a=0,o=0,n=0;n{s[a]||(s[a]=[]),s[a][o]||(s[a][o]="")};if(h(),c==='"'&&(r?d==='"'?(s[a][o]+='"',n++):r=!1:(l===void 0||l===t||i(l))&&(r=!0)),!r&&c!=='"'){if(c===t){o++,h();continue}else if(i(c)){o=0,a++,h(),c==="\r"&&d===` `&&n++;continue}}s[a][o]+=c}return s}var DF=class extends TF{constructor(){super(...arguments),this.beanName="clipboardSvc",this.clientSideRowModel=null,this.gridCtrl=null,this.lastPasteOperationTime=0,this.navigatorApiFailed=!1}postConstruct(){const{gos:e,rowModel:t,ctrlsSvc:s}=this.beans;AF(e,t)&&(this.clientSideRowModel=t),s.whenReady(this,i=>{this.gridCtrl=i.gridCtrl})}destroy(){super.destroy(),this.clientSideRowModel=null,this.gridCtrl=null}pasteFromClipboard(){!this.gos.get("suppressClipboardApi")&&!this.navigatorApiFailed&&navigator.clipboard&&navigator.clipboard.readText?navigator.clipboard.readText().then(this.processClipboardData.bind(this)).catch(t=>{Bs(40,{e:t,method:"readText"}),this.navigatorApiFailed=!0,this.pasteFromClipboardLegacy()}):this.pasteFromClipboardLegacy()}pasteFromClipboardLegacy(){let e=!1;const t=s=>{const i=new Date().getTime();i-this.lastPasteOperationTime<50&&(e=!0,s.preventDefault()),this.lastPasteOperationTime=i};this.executeOnTempElement(s=>{s.addEventListener("paste",t),s.focus({preventScroll:!0})},s=>{const i=s.value;e?this.refocusLastFocusedCell():this.processClipboardData(i),s.removeEventListener("paste",t)})}refocusLastFocusedCell(){const{focusSvc:e}=this.beans,t=e.getFocusedCell();t&&e.setFocusedCell({rowIndex:t.rowIndex,column:t.column,rowPinned:t.rowPinned,forceBrowserFocus:!0})}getClipboardDelimiter(){const e=this.gos.get("clipboardDelimiter");return PF(e)?e:" "}processClipboardData(e){if(e==null)return;let t=IF(e,this.getClipboardDelimiter());const s=this.gos.getCallback("processDataFromClipboard");if(s&&(t=s({data:t})),t==null)return;this.gos.get("suppressLastEmptyLineOnPaste")&&this.removeLastLineIfBlank(t);const{rangeSvc:i}=this.beans,r=(a,o,n,l)=>{i?.isMoreThanOneCell()&&!this.hasOnlyOneValueToPaste(t)?this.pasteIntoActiveRange(i,t,a,o,l):this.pasteStartingFromFocusedCell(t,a,o,n,l)};this.doPasteOperation(r)}doPasteOperation(e){const t="clipboard",{eventSvc:s,focusSvc:i,rowRenderer:r,gos:a}=this.beans;s.dispatchEvent({type:"pasteStart",source:t});const{clientSideRowModel:o}=this,n=o?.rootNode,l=n&&new MF(a.get("aggregateOnlyChangedColumns"),n),c={},d=[],h=i.getFocusedCell();e(c,d,h,l);const u=[...d];l&&(o.doAggregate(l),l.forEachChangedNodeDepthFirst(p=>{u.push(p)})),r.refreshCells({rowNodes:u}),this.dispatchFlashCells(c),this.fireRowChanged(d),this.refocusLastFocusedCell(),s.dispatchEvent({type:"pasteEnd",source:t})}pasteIntoActiveRange(e,t,s,i,r){const a=this.getRangeSize(e)%t.length!=0;let o=0,n=0;const l=(c,d,h,u)=>{if(u-o>=t.length){if(a)return;o+=n,n=0}const g=t[u-o];i.push(d);const m=this.gos.getCallback("processCellFromClipboard");h.forEach((C,f)=>{if(!C.isCellEditable(d)||C.isSuppressPaste(d))return;f>=g.length&&(f=f%g.length);const v=this.processCell(d,C,g[f],Er,m,!0);d.setDataValue(C,v,Rr),r&&r.addParentNode(d.parent,[C]);const{rowIndex:y,rowPinned:x}=c,S=ft({rowIndex:y,column:C,rowPinned:x});s[S]=!0}),n++};this.iterateActiveRanges(!1,l)}getDisplayedColumnsStartingAt(e){let t=e;const s=[],i=this.beans.visibleCols;for(;t!=null;)s.push(t),t=i.getColAfter(t);return s}pasteStartingFromFocusedCell(e,t,s,i,r){if(!i)return;const a={rowIndex:i.rowIndex,rowPinned:i.rowPinned},o=this.getDisplayedColumnsStartingAt(i.column);this.isPasteSingleValueIntoRange(e)?this.pasteSingleValueIntoRange(e,s,t,r):this.pasteMultipleValues(e,a,s,o,t,pl,r)}isPasteSingleValueIntoRange(e){const t=this.beans.rangeSvc;return this.hasOnlyOneValueToPaste(e)&&!!t&&!t.isEmpty()}pasteSingleValueIntoRange(e,t,s,i){const r=e[0][0],a=(o,n,l)=>{t.push(n),l.forEach(c=>this.updateCellValue(n,c,r,s,pl,i))};this.iterateActiveRanges(!1,a)}hasOnlyOneValueToPaste(e){return e.length===1&&e[0].length===1}copyRangeDown(){const{rangeSvc:e,gos:t,valueSvc:s}=this.beans;if(!e||e.isEmpty())return;const i=[],r=(a,o,n,l)=>{const c=t.getCallback("processCellForClipboard"),d=t.getCallback("processCellFromClipboard"),h=(u,p,g)=>{i.length?(o.push(p),g.forEach((m,C)=>{if(!m.isCellEditable(p)||m.isSuppressPaste(p))return;const f=this.processCell(p,m,i[C],Er,d,!0);p.setDataValue(m,f,Rr),l&&l.addParentNode(p.parent,[m]);const{rowIndex:v,rowPinned:y}=u,x=ft({rowIndex:v,column:m,rowPinned:y});a[x]=!0})):g.forEach(m=>{const C=this.processCell(p,m,s.getValue(m,p),Er,c,!1,!0);i.push(C)})};this.iterateActiveRanges(!0,h)};this.doPasteOperation(r)}removeLastLineIfBlank(e){const t=RF(e);if(t&&t.length===1&&t[0]===""){if(e.length===1)return;EF(e,t)}}fireRowChanged(e){this.gos.get("editType")==="fullRow"&&e.forEach(t=>{this.eventSvc.dispatchEvent({type:"rowValueChanged",node:t,data:t.data,rowIndex:t.rowIndex,rowPinned:t.rowPinned})})}pasteMultipleValues(e,t,s,i,r,a,o){let n=t;const l=this.beans,{gos:c,cellNavigation:d}=l,h=this.clientSideRowModel!=null&&!c.get("enableGroupEdit")&&!c.get("treeData"),u=()=>{for(;;){if(!n)return null;const p=Ar(l,n);if(n=d.getRowBelow({rowPinned:n.rowPinned,rowIndex:n.rowIndex}),p==null)return null;if(!(p.detail||p.footer||h&&p.group))return p}};e.forEach(p=>{const g=u();g&&(p.forEach((m,C)=>this.updateCellValue(g,i[C],m,r,a,o)),s.push(g))})}updateCellValue(e,t,s,i,r,a){if(!e||!t||!t.isCellEditable(e)||t.isSuppressPaste(e))return;const o=this.processCell(e,t,s,r,this.gos.getCallback("processCellFromClipboard"),!0);e.setDataValue(t,o,Rr);const{rowIndex:n,rowPinned:l}=e,c=ft({rowIndex:n,column:t,rowPinned:l});i[c]=!0,a&&a.addParentNode(e.parent,[t])}copyToClipboard(e={}){this.copyOrCutToClipboard(e)}cutToClipboard(e={},t="api"){this.gos.get("suppressCutToClipboard")||(this.eventSvc.dispatchEvent({type:"cutStart",source:t}),this.copyOrCutToClipboard(e,!0),this.eventSvc.dispatchEvent({type:"cutEnd",source:t}))}copyOrCutToClipboard(e,t){let{includeHeaders:s,includeGroupHeaders:i}=e;const{gos:r,focusSvc:a}=this.beans;s==null&&(s=r.get("copyHeadersToClipboard")),i==null&&(i=r.get("copyGroupHeadersToClipboard"));const o={includeHeaders:s,includeGroupHeaders:i},n=r.get("rowSelection"),l=r.get("cellSelection");let c=null;this.shouldCopyCells(l,n)?(this.copySelectedRangeToClipboard(o),c=0):this.shouldCopyRows(n)?(this.copySelectedRowsToClipboard(o),c=1):a.isAnyCellFocused()&&(this.copyFocusedCellToClipboard(o),c=2),t&&c!==null&&this.clearCellsAfterCopy(c)}shouldCopyCells(e,t){const{rangeSvc:s,selectionSvc:i,gos:r}=this.beans;if(!s||s.isEmpty())return!1;if(e)return!(typeof t=="object"&&t.copySelectedRows&&!i?.isEmpty());{const a=r.get("suppressCopySingleCellRanges");return!(!s.isMoreThanOneCell()&&a)}}shouldCopyRows(e){const{selectionSvc:t,gos:s}=this.beans;return t?.isEmpty()??!0?!1:e&&typeof e!="string"?e.copySelectedRows??!1:!s.get("suppressCopyRowsToClipboard")}clearCellsAfterCopy(e){const t=this.beans,{rangeSvc:s,focusSvc:i,eventSvc:r}=t;if(r.dispatchEvent({type:"keyShortcutChangedCellStart"}),e===0)s.clearCellRangeCellValues({cellEventSource:"clipboardSvc"});else if(e===1)this.clearSelectedRows();else{const a=i.getFocusedCell();if(a==null)return;const o=Ar(t,a);o&&this.clearCellValue(o,a.column)}r.dispatchEvent({type:"keyShortcutChangedCellEnd"})}clearSelectedRows(){const{selectionSvc:e,visibleCols:t}=this.beans,s=e?.getSelectedNodes()??[],i=t.allCols;for(const r of s)for(const a of i)this.clearCellValue(r,a)}clearCellValue(e,t){if(!t.isCellEditable(e))return;const s=this.beans.valueSvc.getDeleteValue(t,e);e.setDataValue(t,s,"clipboardSvc")}iterateActiveRanges(e,t,s){const i=this.beans.rangeSvc;if(!i||i.isEmpty())return;const r=i.getCellRanges();e?this.iterateActiveRange(r[0],t,s,!0):r.forEach((a,o)=>this.iterateActiveRange(a,t,s,o===r.length-1))}iterateActiveRange(e,t,s,i){const{rangeSvc:r,cellNavigation:a}=this.beans;if(!r)return;let o=r.getRangeStartRow(e);const n=r.getRangeEndRow(e);s&&e.columns&&s(e.columns);let l=0,c=!1;for(;!c&&o!=null;){const d=Ar(this.beans,o);c=ul(o,n),t(o,d,e.columns,l++,c&&i),o=a.getRowBelow(o)}}copySelectedRangeToClipboard(e={}){const t=this.beans.rangeSvc;if(!t||t.isEmpty())return;const s=t.areAllRangesAbleToMerge(),{data:i,cellsToFlash:r}=s?this.buildDataFromMergedRanges(t,e):this.buildDataFromRanges(t,e);this.copyDataToClipboard(i),this.dispatchFlashCells(r)}buildDataFromMergedRanges(e,t){const s=new Set,i=e.getCellRanges(),r=new Map,a=[],o={};i.forEach(d=>{d.columns.forEach(p=>s.add(p));const{rowPositions:h,cellsToFlash:u}=this.getRangeRowPositionsAndCellsToFlash(e,d);h.forEach(p=>{const g=`${p.rowIndex}-${p.rowPinned||"null"}`;r.get(g)||(r.set(g,!0),a.push(p))}),Object.assign(o,u)});const n=this.beans.visibleCols.allCols,l=Array.from(s);return l.sort((d,h)=>{const u=n.indexOf(d),p=n.indexOf(h);return u-p}),{data:this.buildExportParams({columns:l,rowPositions:a,includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders}),cellsToFlash:o}}buildDataFromRanges(e,t){const s=e.getCellRanges(),i=[],r={};return s.forEach(a=>{const{rowPositions:o,cellsToFlash:n}=this.getRangeRowPositionsAndCellsToFlash(e,a);Object.assign(r,n),i.push(this.buildExportParams({columns:a.columns,rowPositions:o,includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders}))}),{data:i.join(` `),cellsToFlash:r}}getRangeRowPositionsAndCellsToFlash(e,t){const s=[],i={},r=e.getRangeStartRow(t),a=e.getRangeEndRow(t);let o=r;for(;o&&(s.push(o),t.columns.forEach(n=>{const{rowIndex:l,rowPinned:c}=o,d=ft({rowIndex:l,column:n,rowPinned:c});i[d]=!0}),!ul(o,a));)o=this.beans.cellNavigation.getRowBelow(o);return{rowPositions:s,cellsToFlash:i}}getCellsToFlashFromRowNodes(e){const t=this.beans.visibleCols.allCols,s={};for(let i=0;ithis.processRowGroupCallback(l),processHeaderCallback:a.getCallback("processHeaderForClipboard"),processGroupHeaderCallback:a.getCallback("processGroupHeaderForClipboard")};return o.getDataAsCsv(n,!0)}getValueFromNode(e,t){const{gos:s,valueSvc:i}=this.beans,r=s.get("treeData"),a=s.get("groupDisplayType")==="groupRows";if(r||a||!t)return e.key;const o=e.groupData?.[t.getId()];return!o||!e.rowGroupColumn||e.rowGroupColumn.getColDef().useValueFormatterForExport===!1?o:i.formatValue(e.rowGroupColumn,e,o)??o}processRowGroupCallback({node:e,column:t}){let s=this.getValueFromNode(e,t);const i=this.getLocaleTextFunc();if(e.footer){let r="";s&&s.length&&(r=` ${s}`),s=`${i("footerTotal","Total")}${r}`}return s||""}dispatchFlashCells(e){window.setTimeout(()=>{this.eventSvc.dispatchEvent({type:"flashCells",cells:e})},0)}processCell(e,t,s,i,r,a,o){const n=this.beans.valueSvc;return r?r({column:t,node:e,value:s,type:i,formatValue:c=>n.formatValue(t,e??null,c)??c,parseValue:c=>n.parseValue(t,e??null,c,n.getValue(t,e))}):a&&t.getColDef().useValueParserForImport!==!1?n.parseValue(t,e??null,s,n.getValue(t,e)):o&&t.getColDef().useValueFormatterForExport!==!1?n.formatValue(t,e??null,s)??s:s}copyDataToClipboard(e){const t=this.gos.getCallback("sendToClipboard");if(t){t({data:e});return}if(!this.gos.get("suppressClipboardApi")&&navigator.clipboard){navigator.clipboard.writeText(e).catch(i=>{Bs(40,{e:i,method:"writeText"}),this.copyDataToClipboardLegacy(e)});return}this.copyDataToClipboardLegacy(e)}copyDataToClipboardLegacy(e){this.executeOnTempElement(t=>{const s=hl(this.beans),i=FF(this.beans);t.value=e||" ",t.select(),t.focus({preventScroll:!0}),s.execCommand("copy")||Bs(41),i!=null&&i.focus!=null&&i.focus({preventScroll:!0})})}executeOnTempElement(e,t){if(!this.gridCtrl)return;const s=hl(this.beans),i=s.createElement("textarea"),r=i.style;r.width="1px",r.height="1px";const a=s.documentElement;r.top=a.scrollTop+"px",r.left=a.scrollLeft+"px",r.position="absolute",r.opacity="0";const o=this.gridCtrl.getGui();o.appendChild(i);try{e(i)}catch{Bs(42)}t?window.setTimeout(()=>{t(i),o.removeChild(i)},100):o.removeChild(i)}getRangeSize(e){const t=e.getCellRanges();let s=0,i=0;return t.length>0&&(s=e.getRangeStartRow(t[0]).rowIndex,i=e.getRangeEndRow(t[0]).rowIndex),s-i+1}},gl={moduleName:"Clipboard",version:R,beans:[DF],apiFunctions:{copyToClipboard:vF,cutToClipboard:yF,copySelectedRowsToClipboard:SF,copySelectedRangeToClipboard:bF,copySelectedRangeDown:wF,pasteFromClipboard:xF},dependsOn:[G,mF,CF,fF]};import{CellStyleModule as LF}from"ag-grid-community";var kF='.ag-row-number-cell{background-color:var(--ag-header-background-color);color:var(--ag-header-text-color);font-family:var(--ag-header-font-family);font-size:var(--ag-header-font-size);font-weight:var(--ag-header-font-weight);overflow:hidden;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap;width:100%}:where(.ag-ltr) .ag-row-number-cell{text-align:right}:where(.ag-rtl) .ag-row-number-cell{text-align:left}:where(.ag-row-number-header.ag-row-number-selection-enabled){cursor:cell}.ag-row-number-range-highlight{background-color:var(--ag-range-header-highlight-color)}.ag-row-number-range-selected{background-color:var(--ag-row-numbers-selected-color)}:where(.ag-ltr){.ag-row-number-header,:where(.ag-cell.ag-row-number-cell):not(.ag-cell-last-left-pinned){border-right:var(--ag-pinned-column-border)}:where(.ag-cell.ag-row-number-cell.ag-row-number-selection-enabled){cursor:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjUiPjxwYXRoIGQ9Ik0zLjQ0NSA4LjkxMVY3LjQwOUg5Ljc1VjYuMDE0bDIuNTM1IDIuMTQ2LTIuNTM1IDIuMTQ2VjguOTExeiIgc3R5bGU9InN0cm9rZTojZmZmO3N0cm9rZS13aWR0aDouNDFweCIgdHJhbnNmb3JtPSJtYXRyaXgoMS41Nzg0IDAgMCAxLjg2NDI5IC00LjQxMyAtNy4yMTIpIi8+PC9zdmc+"),auto}}:where(.ag-rtl){.ag-row-number-header,:where(.ag-cell.ag-row-number-cell):not(.ag-cell-first-right-pinned){border-left:var(--ag-pinned-column-border)}:where(.ag-cell.ag-row-number-cell.ag-row-number-selection-enabled){cursor:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjUiPjxwYXRoIGQ9Ik01Ljk3OSA4LjkxMXYxLjM5NUwzLjQ0NSA4LjE2bDIuNTM0LTIuMTQ2djEuMzk1aDYuMzA2djEuNTAyeiIgc3R5bGU9InN0cm9rZTojZmZmO3N0cm9rZS13aWR0aDouNDFweCIgdHJhbnNmb3JtPSJtYXRyaXgoMS41Nzg0IDAgMCAxLjg2NDI5IC00LjQxMyAtNy4yMTIpIi8+PC9zdmc+"),auto}}';import{AgColumn as GF,BeanStub as OF,KeyCode as NF,ROW_NUMBERS_COLUMN_ID as BF,_addGridCommonParams as _F,_applyColumnState as VF,_areColIdsEqual as HF,_convertColumnEventSourceType as zF,_debounce as UF,_destroyColumnTree as ml,_getRowNode as KF,_selectAllCells as fl,_setAriaLabel as WF,_updateColsMap as jF,isRowNumberCol as _s}from"ag-grid-community";var $F=class extends OF{constructor(){super(...arguments),this.beanName="rowNumbersSvc",this.isIntegratedWithSelection=!1}postConstruct(){const e=UF(this,this.refreshCells.bind(this,!1,!0),10);this.addManagedEventListeners({modelUpdated:e,rangeSelectionChanged:()=>this.refreshCells(!0)}),this.addManagedPropertyListeners(["rowNumbers","cellSelection"],t=>{this.refreshSelectionIntegration(),this.updateColumns(t)}),this.refreshSelectionIntegration()}addColumns(e){this.columns!=null&&(e.list=this.columns.list.concat(e.list),e.tree=this.columns.tree.concat(e.tree),jF(e))}createColumns(e,t){const s=()=>{ml(this.beans,this.columns?.tree),this.columns=null},i=e.treeDepth,a=(this.columns?.treeDepth??-1)==i,o=this.generateRowNumberCols();if(HF(o,this.columns?.list??[])&&a)return;s();const{colGroupSvc:l}=this.beans,c=l?.findDepth(e.tree)??0,d=l?.balanceTreeForAutoCols(o,c)??[];this.columns={list:o,tree:d,treeDepth:c,map:{}},t(this.putRowNumbersColsFirstInList)}handleMouseDownOnCell(e,t){return this.isIntegratedWithSelection?(t.shiftKey||setTimeout(()=>{this.focusFirstRenderedCellAtRowPosition(e)}),!0):!1}updateColumns(e){const t=zF(e.source);this.refreshSelectionIntegration(),this.columns?.list.forEach(s=>{const i=this.createRowNumbersColDef();s.setColDef(i,null,t),VF(this.beans,{state:[{colId:s.getColId(),...i}]},t)})}getColumn(){return this.columns?.list.find(_s)??null}getColumns(){return this.columns?.list??null}setupForHeader(e){const{column:t,eGridHeader:s}=e.params;_s(t)&&(WF(s,"Row Number"),this.addManagedElementListeners(s,{click:this.onHeaderClick.bind(this),keydown:this.onHeaderKeyDown.bind(this),focus:this.onHeaderFocus.bind(this)}))}refreshSelectionIntegration(){const{beans:e}=this,{gos:t,rangeSvc:s}=e,i=t.get("cellSelection");this.refreshRowNumberOverrides(),this.isIntegratedWithSelection=!!s&&!!i&&!this.isSuppressCellSelectionIntegration}refreshRowNumberOverrides(){const e=this.gos.get("rowNumbers");if(this.rowNumberOverrides={},!e||typeof e!="object")return;e.suppressCellSelectionIntegration&&(this.isSuppressCellSelectionIntegration=!0);const t=["contextMenuItems","context","onCellClicked","onCellContextMenu","onCellDoubleClicked","headerTooltip","headerStyle","headerComponent","headerComponentParams","suppressHeaderKeyboardEvent","tooltipField","tooltipValueGetter","tooltipComponent","tooltipComponentParams","valueGetter","valueFormatter","width","maxWidth","minWidth","resizable"];for(const s of t)e[s]!=null&&(this.rowNumberOverrides[s]=e[s])}onHeaderFocus(){this.beans.ariaAnnounce?.announceValue("Press Space to select all cells","ariaSelectAllCells")}onHeaderKeyDown(e){!this.isIntegratedWithSelection||e.key!==NF.SPACE||fl(this.beans)}onHeaderClick(){this.isIntegratedWithSelection&&fl(this.beans)}refreshCells(e,t){const s=this.getColumn();if(s){if(t){const i=this.beans.autoWidthCalc?.getPreferredWidthForElements([this.createDummyElement(s)],2);i!=null&&this.beans.colResize?.setColumnWidths([{key:s,newWidth:i}],!1,!0,"rowNumbersService")}this.beans.rowRenderer.refreshCells({columns:[s],force:e})}}createDummyElement(e){const t=document.createElement("div");t.classList.add("ag-cell-value","ag-cell");let s=String(this.beans.rowModel.getRowCount()+1);if(typeof this.rowNumberOverrides.valueFormatter=="function"){const i=_F(this.beans.gos,{data:void 0,value:s,node:null,column:e,colDef:e.colDef});s=this.rowNumberOverrides.valueFormatter(i)}return t.textContent=s,t}putRowNumbersColsFirstInList(e,t){if(!t)return null;const s=t.filter(i=>!_s(i));return[...e,...s]}createRowNumbersColDef(){const{gos:e,contextMenuSvc:t}=this.beans,s=e.get("enableRtl");return{minWidth:60,width:60,resizable:!1,valueGetter:this.valueGetter,contextMenuItems:this.isIntegratedWithSelection||!t?void 0:()=>[],...this.rowNumberOverrides,colId:BF,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPinned:!0,pinned:s?"right":"left",lockPosition:s?"right":"left",editable:!1,suppressFillHandle:!0,suppressAutoSize:!0,suppressSizeToFit:!0,suppressHeaderContextMenu:!0,suppressNavigable:!0,headerClass:this.getHeaderClass(),cellClass:this.getCellClass.bind(this),cellAriaRole:"rowheader"}}valueGetter(e){return String((e.node?.rowIndex||0)+1)}getHeaderClass(){const e=["ag-row-number-header"];return this.isIntegratedWithSelection&&e.push("ag-row-number-selection-enabled"),e}getCellClass(e){const{beans:t}=this,{rangeSvc:s,gos:i}=t,{node:r}=e,a=["ag-row-number-cell"],o=i.get("cellSelection");if(!s||!o)return a;this.isIntegratedWithSelection&&a.push("ag-row-number-selection-enabled");const n=s.getCellRanges();if(!n.length)return a;const l=this.beans.visibleCols.allCols.length-1,c=typeof o=="object"&&o.enableHeaderHighlight;for(const d of n)s.isRowInRange(r.rowIndex,r.rowPinned,d)&&(c&&a.push("ag-row-number-range-highlight"),d.columns.length===l&&a.push("ag-row-number-range-selected"));return a}generateRowNumberCols(){const{gos:e,beans:t}=this;if(!e.get("rowNumbers"))return[];const s=this.createRowNumbersColDef(),i=s.colId;t.validation?.validateColDef(s,i,!0);const r=new GF(s,null,i,!1);return this.createBean(r),[r]}focusFirstRenderedCellAtRowPosition(e){const{beans:t,gos:s}=this,{visibleCols:i,colViewport:r}=t,a=s.get("enableRtl")?i.rightCols:i.leftCols;let o;if(a.length==1){const d=KF(t,e);if(!d)return;o=r.getColsWithinViewport(d)}else o=a;const n=o.find(d=>!_s(d));if(!n)return;const{rowPinned:l,rowIndex:c}=e;t.focusSvc.setFocusedCell({rowIndex:c,rowPinned:l,column:n,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}destroy(){ml(this.beans,this.columns?.tree),this.rowNumberOverrides=null,super.destroy()}},Cl={moduleName:"RowNumbers",version:R,beans:[$F],dependsOn:[G,LF],css:[kF]};import{_ColumnFilterModule as YF}from"ag-grid-community";import{Component as XF,RefPlaceholder as vl,_addGridCommonParams as qF}from"ag-grid-community";import{AgInputTextFieldSelector as ZF,Component as JF,RefPlaceholder as yl,_createIconNoSpan as Ir,_debounce as QF,_setDisplayed as $t}from"ag-grid-community";var eA=class extends JF{constructor(){super(...arguments),this.eExpand=yl,this.eFilterTextField=yl}postConstruct(){this.setTemplate(``,[ZF]);const e=this.getLocaleTextFunc();this.eFilterTextField.setAutoComplete(!1).setInputAriaLabel(e("ariaFilterColumnsInput","Filter Columns Input")).onValueChange(this.onSearchTextChanged.bind(this)),this.createExpandIcons(),this.setExpandState(0),this.addManagedElementListeners(this.eExpand,{click:this.onExpandClicked.bind(this)}),this.addManagedEventListeners({newColumnsLoaded:this.showOrHideOptions.bind(this)})}init(e){this.params=e,this.beans.colModel.ready&&this.showOrHideOptions()}createExpandIcons(){const{eExpand:e,beans:t}=this;e.appendChild(this.eExpandChecked=Ir("accordionOpen",t)),e.appendChild(this.eExpandUnchecked=Ir("accordionClosed",t)),e.appendChild(this.eExpandIndeterminate=Ir("accordionIndeterminate",t))}showOrHideOptions(){const{params:e,eFilterTextField:t}=this,s=!e.suppressFilterSearch,i=!e.suppressExpandAll,r=this.getLocaleTextFunc();t.setInputPlaceholder(r("searchOoo","Search..."));const a=n=>n.getOriginalParent()&&n.isFilterAllowed(),o=this.beans.colModel.getCols().some(a);$t(t.getGui(),s),$t(this.eExpand,i&&o)}onSearchTextChanged(){this.onSearchTextChangedDebounced||(this.onSearchTextChangedDebounced=QF(this,()=>this.dispatchLocalEvent({type:"searchChanged",searchText:this.eFilterTextField.getValue()}),300)),this.onSearchTextChangedDebounced()}onExpandClicked(){const e=this.currentExpandState===0?{type:"collapseAll"}:{type:"expandAll"};this.dispatchLocalEvent(e)}setExpandState(e){this.currentExpandState=e,$t(this.eExpandChecked,e===0),$t(this.eExpandUnchecked,e===1),$t(this.eExpandIndeterminate,e===2)}},tA={selector:"AG-FILTERS-TOOL-PANEL-HEADER",component:eA};import{Component as sA,_addGridCommonParams as iA,_clearElement as rA,_exists as Dr,_getActiveDomElement as aA,_mergeDeep as oA,_setAriaLabel as nA,_warn as Sl,isProvidedColumnGroup as bl}from"ag-grid-community";import{Component as lA,FilterWrapperComp as cA,KeyCode as wl,RefPlaceholder as Yt,_clearElement as dA,_createIconNoSpan as Lr,_loadTemplate as hA,_setAriaExpanded as xl,_setDisplayed as Oe}from"ag-grid-community";var Tl=class extends lA{constructor(e,t){super(`
`),this.hideHeader=e,this.expandedCallback=t,this.eFilterToolPanelHeader=Yt,this.eFilterName=Yt,this.agFilterToolPanelBody=Yt,this.eFilterIcon=Yt,this.eExpand=Yt,this.expanded=!1}postConstruct(){const{beans:e,eExpand:t}=this,s=Lr("accordionOpen",e);this.eExpandChecked=s;const i=Lr("accordionClosed",e);this.eExpandUnchecked=i,t.appendChild(s),t.appendChild(i)}setColumn(e){this.column=e;const{beans:t,eFilterToolPanelHeader:s,eFilterIcon:i,eExpandChecked:r,hideHeader:a}=this;this.eFilterName.innerText=t.colNames.getDisplayNameForColumn(e,"filterToolPanel",!1)||"",this.addManagedListeners(s,{click:this.toggleExpanded.bind(this),keydown:this.onKeyDown.bind(this)}),this.addManagedEventListeners({filterOpened:this.onFilterOpened.bind(this)}),this.addInIcon("filterActive",i,e),Oe(i,this.isFilterActive(),{skipAriaHidden:!0}),Oe(r,!1),a?(Oe(s,!1),s.removeAttribute("tabindex")):s.setAttribute("tabindex","0"),this.addManagedListeners(e,{filterChanged:this.onFilterChanged.bind(this)})}onKeyDown(e){const{key:t}=e,{ENTER:s,SPACE:i,LEFT:r,RIGHT:a}=wl;t!==s&&t!==i&&t!==r&&t!==a||(e.preventDefault(),t===s||t===i?this.toggleExpanded():t===wl.LEFT?this.collapse():this.expand())}getColumn(){return this.column}getColumnFilterName(){return this.beans.colNames.getDisplayNameForColumn(this.column,"filterToolPanel",!1)}addCssClassToTitleBar(e){this.eFilterToolPanelHeader.classList.add(e)}addInIcon(e,t,s){if(t==null)return;const i=Lr(e,this.beans,s);t.appendChild(i)}isFilterActive(){return!!this.beans.filterManager?.isFilterActive(this.column)}onFilterChanged(){Oe(this.eFilterIcon,this.isFilterActive(),{skipAriaHidden:!0}),this.dispatchLocalEvent({type:"filterChanged"})}toggleExpanded(){this.expanded?this.collapse():this.expand()}expand(){this.expanded||(this.expanded=!0,xl(this.eFilterToolPanelHeader,!0),Oe(this.eExpandChecked,!0),Oe(this.eExpandUnchecked,!1),this.addFilterElement(),this.expandedCallback())}addFilterElement(e){const t=hA('
'),s=this.createManagedBean(new cA(this.column,"TOOLBAR"));this.filterWrapperComp=s,s.hasFilter()&&s.getFilter()?.then(i=>{this.underlyingFilter=i,i&&(t.appendChild(s.getGui()),this.agFilterToolPanelBody.appendChild(t),s.afterGuiAttached({container:"toolPanel",suppressFocus:e}))})}collapse(){if(!this.expanded)return;this.expanded=!1,xl(this.eFilterToolPanelHeader,!1),this.removeFilterElement(),Oe(this.eExpandChecked,!1),Oe(this.eExpandUnchecked,!0);const e=this.filterWrapperComp;e?.afterGuiDetached(),this.destroyBean(e),this.expandedCallback()}removeFilterElement(){dA(this.agFilterToolPanelBody)}isExpanded(){return this.expanded}refreshFilter(e){if(!this.expanded)return;const t=this.underlyingFilter;t&&(e?typeof t.refreshVirtualList=="function"&&t.refreshVirtualList():t.afterGuiDetached?.())}onFilterOpened(e){e.source==="COLUMN_MENU"&&e.column===this.column&&this.expanded&&this.collapse()}};import{Component as uA,RefPlaceholder as pA,_clearElement as gA,_createIconNoSpan as mA,_getShouldDisplayTooltip as fA,isProvidedColumnGroup as Vs}from"ag-grid-community";var Ne=class Wd extends uA{constructor(t,s,i,r,a){super(),this.columnGroup=t,this.childFilterComps=s,this.expandedCallback=i,this.depth=r,this.showingColumn=a,this.filterGroupComp=pA}postConstruct(){const t={cssIdentifier:"filter-toolpanel",direction:"vertical"};this.setTemplate(`
`,[N],{filterGroupComp:t}),this.setGroupTitle();const{filterGroupComp:s,depth:i,childFilterComps:r,gos:a}=this;s.setAlignItems("stretch"),s.addCssClass(`ag-filter-toolpanel-group-level-${i}`),s.getGui().style.setProperty("--ag-indentation-level",String(i)),s.addCssClassToTitleBar(`ag-filter-toolpanel-group-level-${i}-header`),r.forEach(o=>{s.addItem(o),o.addCssClassToTitleBar(`ag-filter-toolpanel-group-level-${i+1}-header`),o.getGui().style.setProperty("--ag-indentation-level",String(i+1))}),this.tooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui(),getLocation:()=>"filterToolPanelColumnGroup",shouldDisplayTooltip:fA(a,()=>s.getGui().querySelector(".ag-group-title"))})),this.refreshFilterClass(),this.addExpandCollapseListeners(),this.addFilterChangedListeners(),this.setupTooltip(),this.addInIcon("filterActive")}setupTooltip(){if(!this.showingColumn)return;const t=()=>{this.tooltipFeature?.setTooltipAndRefresh(this.columnGroup.getColDef().headerTooltip)};t(),this.addManagedEventListeners({newColumnsLoaded:t})}addCssClassToTitleBar(t){this.filterGroupComp.addCssClassToTitleBar(t)}refreshFilters(t){this.childFilterComps.forEach(s=>{s instanceof Wd?s.refreshFilters(t):s.refreshFilter(t)})}isColumnGroup(){return Vs(this.columnGroup)}isExpanded(){return this.filterGroupComp.isExpanded()}getChildren(){return this.childFilterComps}getFilterGroupName(){return this.filterGroupName??""}getFilterGroupId(){return this.columnGroup.getId()}hideGroupItem(t,s){this.filterGroupComp.hideItem(t,s)}hideGroup(t){this.setDisplayed(!t)}addInIcon(t){const s=mA(t,this.beans);s&&s.classList.add("ag-filter-toolpanel-group-instance-header-icon"),this.filterGroupComp.addTitleBarWidget(s)}forEachToolPanelFilterChild(t){this.childFilterComps.forEach(s=>{s instanceof Tl&&t(s)})}addExpandCollapseListeners(){const t=this.isColumnGroup()?()=>this.expandedCallback():()=>this.forEachToolPanelFilterChild(i=>i.expand()),s=this.isColumnGroup()?()=>this.expandedCallback():()=>this.forEachToolPanelFilterChild(i=>i.collapse());this.addManagedListeners(this.filterGroupComp,{expanded:t,collapsed:s})}getColumns(){return Vs(this.columnGroup)?this.columnGroup.getLeafColumns():[this.columnGroup]}addFilterChangedListeners(){this.getColumns().forEach(t=>{this.addManagedListeners(t,{filterChanged:()=>this.refreshFilterClass()})}),Vs(this.columnGroup)||this.addManagedEventListeners({filterOpened:this.onFilterOpened.bind(this)})}refreshFilterClass(){const t=this.getColumns(),s=()=>t.some(i=>i.isFilterActive());this.filterGroupComp.addOrRemoveCssClass("ag-has-filter",s())}onFilterOpened(t){t.source==="COLUMN_MENU"&&t.column===this.columnGroup&&this.isExpanded()&&this.collapse()}expand(){this.filterGroupComp.toggleGroupExpand(!0)}collapse(){this.filterGroupComp.toggleGroupExpand(!1)}setGroupTitle(){const t=this.columnGroup,s=Vs(t)?this.getColumnGroupName(t):this.getColumnName(t);this.filterGroupName=s,this.filterGroupComp.setTitle(s||"")}getColumnGroupName(t){return this.beans.colNames.getDisplayNameForProvidedColumnGroup(null,t,"filterToolPanel")}getColumnName(t){return this.beans.colNames.getDisplayNameForColumn(t,"filterToolPanel",!1)}destroyFilters(){this.childFilterComps=this.destroyBeans(this.childFilterComps),gA(this.getGui())}destroy(){this.destroyFilters(),super.destroy()}},CA=class extends sA{constructor(){super('
'),this.initialised=!1,this.hasLoadedInitialState=!1,this.isInitialState=!1,this.filterGroupComps=[],this.suppressOnColumnsChanged=!1,this.onColumnsChangedPending=!1}wireBeans(e){this.colModel=e.colModel}init(e){this.initialised=!0;const t=iA(this.gos,{suppressExpandAll:!1,suppressFilterSearch:!1,suppressSyncLayoutWithGrid:!1});oA(t,e),this.params=t,t.suppressSyncLayoutWithGrid||this.addManagedEventListeners({columnMoved:()=>this.onColumnsChanged()}),this.addManagedEventListeners({newColumnsLoaded:()=>this.onColumnsChanged(),toolPanelVisibleChanged:s=>{s.key==="filters"&&this.refreshFilters(s.visible)},dragStarted:()=>{this.suppressOnColumnsChanged=!0},dragStopped:()=>{this.suppressOnColumnsChanged=!1,this.onColumnsChangedPending&&(this.onColumnsChangedPending=!1,this.onColumnsChanged())}}),this.colModel.ready&&this.onColumnsChanged()}onColumnsChanged(){if(this.suppressOnColumnsChanged){this.onColumnsChangedPending=!0;return}const e=this.colModel.isPivotMode();!this.params.suppressSyncLayoutWithGrid&&!e?this.syncFilterLayout():this.buildTreeFromProvidedColumnDefs(),this.refreshAriaLabel()}syncFilterLayout(){Do(this.colModel,this.setFiltersLayout.bind(this)),this.refreshAriaLabel()}buildTreeFromProvidedColumnDefs(){const e=this.colModel.getColDefColTree();this.recreateFilters(e)}setFiltersLayout(e){const t=Io(this.colModel,e);this.recreateFilters(t)}recreateFilters(e){const t=aA(this.beans);this.hasLoadedInitialState||(this.hasLoadedInitialState=!0,this.isInitialState=!!this.params.initialState);const s=this.getExpansionState();this.destroyFilters();const i=this.recursivelyAddComps(e,0,s);this.filterGroupComps=i;const r=i.length;r&&(i.forEach(o=>this.appendChild(o)),this.setFirstAndLastVisible(0,r-1));const a=this.searchFilterText;Dr(a)&&this.searchFilters(a),this.fireExpandedEvent(),this.getGui().contains(t)&&t.focus(),this.isInitialState=!1,this.refreshAriaLabel()}recursivelyAddComps(e,t,s){return e.map(i=>{if(bl(i))return this.recursivelyAddFilterGroupComps(i,t,s)?.flatMap(l=>l)??[];const r=i;if(!this.shouldDisplayFilter(r))return[];const a=t===0,o=new Tl(a,()=>this.onFilterExpanded());if(this.createBean(o),o.setColumn(r),s.get(r.getId())&&o.expand(),t>0)return o;const n=this.createBean(new Ne(r,[o],this.onGroupExpanded.bind(this),t,!0));return n.addCssClassToTitleBar("ag-filter-toolpanel-header"),s.get(n.getFilterGroupId())||n.collapse(),n}).flatMap(i=>i)}refreshAriaLabel(){const e=this.getLocaleTextFunc(),t=e("ariaFilterPanelList","Filter List"),s=e("filters","Filters"),l=this.getGui().querySelectorAll(".ag-filter-toolpanel-group-item:not(.ag-filter-toolpanel-group-wrapper, .ag-hidden)").length;nA(this.getAriaElement(),`${t} ${l} ${s}`)}recursivelyAddFilterGroupComps(e,t,s){if(!this.filtersExistInChildren(e.getChildren()))return;const i=e.getColGroupDef();if(i&&i.suppressFiltersToolPanel)return[];const r=e.isPadding()?t:t+1,a=this.recursivelyAddComps(e.getChildren(),r,s).flatMap(l=>l);if(e.isPadding())return a;const o=new Ne(e,a,this.onGroupExpanded.bind(this),t,!1);this.createBean(o),o.addCssClassToTitleBar("ag-filter-toolpanel-header");const n=s.get(o.getFilterGroupId());return(this.isInitialState&&!n||n===!1)&&o.collapse(),[o]}filtersExistInChildren(e){return e.some(t=>bl(t)?this.filtersExistInChildren(t.getChildren()):this.shouldDisplayFilter(t))}shouldDisplayFilter(e){const t=e.getColDef()&&e.getColDef().suppressFiltersToolPanel;return e.isFilterAllowed()&&!t}getExpansionState(){const e=new Map;if(this.isInitialState){const{expandedColIds:s,expandedGroupIds:i}=this.params.initialState;return s.forEach(r=>e.set(r,!0)),i.forEach(r=>e.set(r,!0)),e}const t=s=>{e.set(s.getFilterGroupId(),s.isExpanded()),s.getChildren().forEach(i=>{i instanceof Ne?t(i):e.set(i.getColumn().getId(),i.isExpanded())})};return this.filterGroupComps.forEach(t),e}refresh(){}setVisible(e){super.setDisplayed(e),e&&!this.initialised&&this.init(this.params)}expandFilterGroups(e,t){const s=[],i=r=>{const a=r.getFilterGroupId();(!t||t.includes(a))&&(e&&r.isColumnGroup()?r.expand():r.collapse(),s.push(a)),r.getChildren().forEach(n=>{n instanceof Ne&&i(n)})};if(this.filterGroupComps.forEach(i),this.onGroupExpanded(),t){const r=t.filter(a=>s.indexOf(a)<0);r.length>0&&Sl(166,{unrecognisedGroupIds:r})}}expandFilters(e,t){const s=[],i=r=>{if(r instanceof Ne){let n=!1;return r.getChildren().forEach(l=>{i(l)&&(e?(r.expand(),n=!0):r.isColumnGroup()||r.collapse())}),n}const a=r.getColumn().getColId(),o=!t||t.includes(a);return o&&(e?r.expand():r.collapse(),s.push(a)),o};if(this.filterGroupComps.forEach(i),this.onGroupExpanded(),t){const r=t.filter(a=>s.indexOf(a)<0);r.length>0&&Sl(167,{unrecognisedColIds:r})}}onGroupExpanded(){this.fireExpandedEvent()}onFilterExpanded(){this.dispatchLocalEvent({type:"filterExpanded"})}fireExpandedEvent(){let e=0,t=0;const s=r=>{r.isColumnGroup()&&(r.isExpanded()?e++:t++,r.getChildren().forEach(a=>{a instanceof Ne&&s(a)}))};this.filterGroupComps.forEach(s);let i;e>0&&t>0?i=2:t>0?i=1:i=0,this.dispatchLocalEvent({type:"groupExpanded",state:i})}performFilterSearch(e){this.searchFilterText=Dr(e)?e.toLowerCase():null,this.searchFilters(this.searchFilterText)}searchFilters(e){const t=a=>!Dr(e)||a.toLowerCase().indexOf(e)!==-1,s=(a,o)=>{if(!(a instanceof Ne))return t(a.getColumnFilterName()||"");const n=a.getChildren(),l=t(a.getFilterGroupName()),c=o||l;if(c){a.hideGroup(!1);for(let h=0;h{const p=s(h,o);a.hideGroupItem(!p,u),p&&(d=!0)}),a.hideGroup(!d),d};let i,r;this.filterGroupComps.forEach((a,o)=>{s(a,!1),i===void 0?a.containsCssClass("ag-hidden")||(i=o,r=o):!a.containsCssClass("ag-hidden")&&r!==o&&(r=o)}),this.setFirstAndLastVisible(i,r),this.refreshAriaLabel()}setFirstAndLastVisible(e,t){this.filterGroupComps.forEach((s,i)=>{s.removeCssClass("ag-first-group-visible"),s.removeCssClass("ag-last-group-visible"),i===e&&s.addCssClass("ag-first-group-visible"),i===t&&s.addCssClass("ag-last-group-visible")})}refreshFilters(e){this.filterGroupComps.forEach(t=>t.refreshFilters(e))}getExpandedFiltersAndGroups(){const e=[],t=new Set,s=i=>{if(i instanceof Ne){i.getChildren().forEach(a=>s(a));const r=i.getFilterGroupId();i.isExpanded()&&!t.has(r)&&e.push(r)}else i.isExpanded()&&t.add(i.getColumn().getColId())};return this.filterGroupComps.forEach(s),{expandedGroupIds:e,expandedColIds:Array.from(t)}}destroyFilters(){this.filterGroupComps=this.destroyBeans(this.filterGroupComps),rA(this.getGui())}destroy(){this.destroyFilters(),super.destroy()}},vA={selector:"AG-FILTERS-TOOL-PANEL-LIST",component:CA},yA=".ag-filter-toolpanel{flex:1 1 0px;min-width:0}.ag-filter-toolpanel-header,.ag-filter-toolpanel-search{align-items:center;color:var(--ag-header-text-color);display:flex;font-weight:var(--ag-header-font-weight);padding:0 var(--ag-spacing);>*{align-items:center;display:flex}}.ag-filter-toolpanel-header{padding-bottom:var(--ag-spacing);padding-top:var(--ag-spacing);position:relative;&:focus-visible{border-radius:var(--ag-border-radius);box-shadow:inset var(--ag-focus-shadow)}}:where(.ag-ltr) .ag-filter-toolpanel-group-instance-header-icon,:where(.ag-ltr) .ag-filter-toolpanel-instance-header-icon{margin-left:var(--ag-spacing)}:where(.ag-rtl) .ag-filter-toolpanel-group-instance-header-icon,:where(.ag-rtl) .ag-filter-toolpanel-instance-header-icon{margin-right:var(--ag-spacing)}.ag-filter-toolpanel-search{min-height:var(--ag-header-height);padding-bottom:var(--ag-spacing);padding-top:var(--ag-widget-container-vertical-padding)}:where(.ag-filter-toolpanel-group:not(.ag-has-filter)>.ag-group-title-bar) .ag-filter-toolpanel-group-instance-header-icon{display:none}.ag-filter-toolpanel-search-input{flex-grow:1;height:calc(var(--ag-spacing)*4)}:where(.ag-ltr) .ag-filter-toolpanel-group-title-bar-icon{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-filter-toolpanel-group-title-bar-icon{margin-left:var(--ag-spacing)}.ag-filter-toolpanel-expand{cursor:pointer}:where(.ag-ltr) .ag-filter-toolpanel-expand{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-filter-toolpanel-expand{margin-left:var(--ag-spacing)}:where(.ag-ltr) .ag-filter-toolpanel-group-title-bar,:where(.ag-ltr) .ag-filter-toolpanel-instance-header{padding-left:calc(var(--ag-spacing) + var(--ag-filter-tool-panel-group-indent)*var(--ag-indentation-level))}:where(.ag-rtl) .ag-filter-toolpanel-group-title-bar,:where(.ag-rtl) .ag-filter-toolpanel-instance-header{padding-right:calc(var(--ag-spacing) + var(--ag-filter-tool-panel-group-indent)*var(--ag-indentation-level))}:where(.ag-ltr) .ag-filter-toolpanel-instance-body{margin-left:var(--ag-filter-tool-panel-group-indent)}:where(.ag-rtl) .ag-filter-toolpanel-instance-body{margin-right:var(--ag-filter-tool-panel-group-indent)}.ag-filter-toolpanel-instance-filter{background-color:var(--ag-chrome-background-color)}.ag-filter-toolpanel-group-level-0{border-top:none}",SA=class extends XF{constructor(){super(`
`,[tA,vA]),this.filtersToolPanelHeaderPanel=vl,this.filtersToolPanelListPanel=vl,this.initialised=!1,this.listenerDestroyFuncs=[],this.registerCSS(yA)}init(e){this.initialised&&(this.listenerDestroyFuncs.forEach(n=>n()),this.listenerDestroyFuncs=[]),this.initialised=!0;const s={...qF(this.gos,{suppressExpandAll:!1,suppressFilterSearch:!1,suppressSyncLayoutWithGrid:!1}),...e};this.params=s;const{filtersToolPanelHeaderPanel:i,filtersToolPanelListPanel:r}=this;i.init(s),r.init(s);const a=s.suppressExpandAll,o=s.suppressFilterSearch;a&&o&&i.setDisplayed(!1),this.listenerDestroyFuncs.push(...this.addManagedListeners(i,{expandAll:()=>r.expandFilterGroups(!0),collapseAll:()=>r.expandFilterGroups(!1),searchChanged:n=>r.performFilterSearch(n.searchText)}),...this.addManagedListeners(r,{filterExpanded:s.onStateUpdated,groupExpanded:n=>{i.setExpandState(n.state),s.onStateUpdated()}}))}setVisible(e){super.setDisplayed(e),e&&!this.initialised&&this.init(this.params)}setFilterLayout(e){this.filtersToolPanelListPanel.setFiltersLayout(e)}expandFilterGroups(e){this.filtersToolPanelListPanel.expandFilterGroups(!0,e)}collapseFilterGroups(e){this.filtersToolPanelListPanel.expandFilterGroups(!1,e)}expandFilters(e){this.filtersToolPanelListPanel.expandFilters(!0,e)}collapseFilters(e){this.filtersToolPanelListPanel.expandFilters(!1,e)}syncLayoutWithGrid(){this.filtersToolPanelListPanel.syncFilterLayout()}refresh(e){return this.init(e),!0}getState(){return this.filtersToolPanelListPanel.getExpandedFiltersAndGroups()}},Ml={moduleName:"FiltersToolPanel",version:R,userComponents:{agFiltersToolPanel:SA},icons:{filtersToolPanel:"filter"},dependsOn:[Ps,G,YF]};import{EventApiModule as bA}from"ag-grid-community";import{Component as wA,RefPlaceholder as xA,_getGridRegisteredModules as TA,_missing as MA,_warn as Pl,createGrid as PA}from"ag-grid-community";import{BeanStub as FA,_addGridCommonParams as AA,_focusInto as RA,_isSameRow as EA,_missing as IA,_warn as Hs}from"ag-grid-community";var Fl=class extends FA{constructor(){super(...arguments),this.loadRowDataVersion=0}wireBeans(e){this.environment=e.environment}init(e,t){this.params=t,this.comp=e,t.pinned==null&&(this.setAutoHeightClasses(),this.setupRefreshStrategy(),this.createDetailGrid(),this.loadRowData(),this.addManagedEventListeners({fullWidthRowFocused:this.onFullWidthRowFocused.bind(this)}))}onFullWidthRowFocused(e){const t=this.params,s={rowIndex:t.node.rowIndex,rowPinned:t.node.rowPinned},i={rowIndex:e.rowIndex,rowPinned:e.rowPinned};EA(s,i)&&RA(this.comp.getGui(),e.fromBelow)}setAutoHeightClasses(){const e=this.gos.get("detailRowAutoHeight"),t=e?"ag-details-row-auto-height":"ag-details-row-fixed-height",s=e?"ag-details-grid-auto-height":"ag-details-grid-fixed-height",i=this.comp;i.addOrRemoveCssClass(t,!0),i.addOrRemoveDetailGridCssClass(s,!0)}setupRefreshStrategy(){const e=this.params.refreshStrategy;if(e=="everything"||e=="nothing"||e=="rows"){this.refreshStrategy=e;return}e!=null&&Hs(170,{providedStrategy:e}),this.refreshStrategy="rows"}createDetailGrid(){const{params:e,gos:t}=this;if(IA(e.detailGridOptions)){Hs(171);return}const s=t.get("theme"),i=e.detailGridOptions.theme;i&&i!==s&&Hs(267);const r={themeStyleContainer:this.environment.eStyleContainer,...e.detailGridOptions,theme:s};t.get("detailRowAutoHeight")&&(r.domLayout="autoHeight"),this.comp.setDetailGrid(r)}registerDetailWithMaster(e){const{params:t,beans:{selectionSvc:s}}=this,i=t.node.id,r=t.api,a={id:i,api:e},o=t.node;if(r.isDestroyed())return;r.addDetailGridInfo(i,a),o.detailGridInfo=a;const n=o.parent;function l(){n&&s?.refreshMasterNodeState(n)}function c({node:d,source:h}){d!==n||h==="masterDetail"||s?.setDetailSelectionState(n,t.detailGridOptions,e)}e.addEventListener("firstDataRendered",()=>{s?.setDetailSelectionState(n,t.detailGridOptions,e),e.addEventListener("selectionChanged",l),r.addEventListener("rowSelected",c)}),this.addDestroyFunc(()=>{e.removeEventListener("selectionChanged",l),r.removeEventListener("rowSelected",c),o.detailGridInfo===a&&(r.isDestroyed()||r.removeDetailGridInfo(i),o.detailGridInfo=null)})}loadRowData(){this.loadRowDataVersion++;const e=this.loadRowDataVersion,t=this.params;if(t.detailGridOptions?.rowModelType==="serverSide"){t.node.detailGridInfo?.api?.refreshServerSide({purge:!0});return}const s=t.getDetailRowData;if(!s){Hs(172);return}const i=a=>{this.loadRowDataVersion===e&&this.comp.setRowData(a)},r={node:t.node,data:t.node.data,successCallback:i,context:AA(this.gos,{}).context};s(r)}refresh(){switch(this.refreshStrategy){case"nothing":return!0;case"everything":return!1}return this.loadRowData(),!0}},DA=class{constructor(e){this.parentWrapper=e}wrap(e,t,s,i){return this.parentWrapper.wrap(e,t,s,i)}},LA=class extends wA{constructor(){super(...arguments),this.eDetailGrid=xA}wireBeans(e){this.context=e.context}init(e){this.params=e,this.selectAndSetTemplate();const t={addOrRemoveCssClass:(s,i)=>this.addOrRemoveCssClass(s,i),addOrRemoveDetailGridCssClass:(s,i)=>this.eDetailGrid.classList.toggle(s,i),setDetailGrid:s=>this.setDetailGrid(s),setRowData:s=>this.setRowData(s),getGui:()=>this.eDetailGrid};this.ctrl=this.createManagedBean(new Fl),this.ctrl.init(t,e)}refresh(){return this.ctrl?.refresh()??!1}selectAndSetTemplate(){const e=this.params;if(e.pinned){this.setTemplate('
');return}const t=()=>{this.setTemplate(`
`)};if(MA(e.template))t();else if(typeof e.template=="string")this.setTemplate(e.template,[]);else if(typeof e.template=="function"){const s=e.template,i=s(e);this.setTemplate(i,[])}else Pl(168),t();this.eDetailGrid==null&&Pl(169)}setDetailGrid(e){if(!this.eDetailGrid)return;const t=this.context.getBean("frameworkCompWrapper"),s=new DA(t),{frameworkOverrides:i}=this.beans,r=PA(this.eDetailGrid,e,{frameworkOverrides:i,providedBeanInstances:{frameworkCompWrapper:s},modules:TA(this.params.api.getGridId(),e.rowModelType??"clientSide")});this.detailApi=r,this.ctrl?.registerDetailWithMaster(r),this.addDestroyFunc(()=>{r.destroy()})}setRowData(e){this.detailApi?.setGridOption("rowData",e)}};function zs(e,t){const s=e.masterDetailSvc?.store;return s?t(s):void 0}function kA(e,t,s){zs(e,i=>{i[t]=s})}function GA(e,t){zs(e,s=>{delete s[t]})}function OA(e,t){return zs(e,s=>s[t])}function NA(e,t){zs(e,s=>{let i=0;Object.values(s).forEach(r=>{r&&t(r,i++)})})}var BA=".ag-details-row{width:100%}.ag-details-row-fixed-height{height:100%}.ag-details-grid{width:100%}.ag-details-grid-fixed-height{height:100%}";import{BeanStub as _A,RowNode as VA,_exists as HA,_getClientSideRowModel as zA,_isClientSideRowModel as Al,_isServerSideRowModel as UA,_observeResize as KA}from"ag-grid-community";var WA=class extends _A{constructor(){super(...arguments),this.beanName="masterDetailSvc",this.store={}}isEnabled(){const e=this.gos;return e.get("masterDetail")&&!e.get("treeData")}postConstruct(){Al(this.gos)&&(this.enabled=this.isEnabled(),this.addManagedEventListeners({beforeRefreshModel:this.beforeRefreshModel.bind(this)}))}beforeRefreshModel({params:e}){if(e.changedProps){const t=this.isEnabled();if(this.enabled!==t){this.setMasters(null);return}}e.rowDataUpdated&&this.setMasters(e.changedRowNodes)}setMasters(e){const t=this.isEnabled();this.enabled=t;const s=this.gos,i=s.get("isRowMaster"),r=s.get("groupDefaultExpanded"),a=(o,n,l)=>{const c=o.master;let d=t;if(t)if(n||l){if(i){const h=o.data;d=!!h&&!!i(h)}}else d=c;if(d&&n)if(r===-1)o.expanded=!0;else{const h=this.beans.rowGroupColsSvc?.columns.length??0;o.expanded=h{const o=t.clientHeight;if(o!=null&&o>0){const n=()=>{const{rowModel:l}=this.beans,{rowNode:c}=e;c.setRowHeight(o),(Al(s,l)||UA(s,l))&&l.onRowHeightChanged()};window.setTimeout(n,0)}},a=KA(i,t,r);e.addDestroyFunc(a),r()}destroy(){this.store={},super.destroy()}},jA={moduleName:"SharedMasterDetail",version:R,beans:[WA],userComponents:{agDetailCellRenderer:LA},dynamicBeans:{detailCellRendererCtrl:Fl},apiFunctions:{addDetailGridInfo:kA,removeDetailGridInfo:GA,getDetailGridInfo:OA,forEachDetailGridInfo:NA},dependsOn:[G,el,wr],css:[BA]},Rl={moduleName:"MasterDetail",version:R,dependsOn:[jA,Ns,bA]};import{_DragModule as $A,_KeyboardNavigationModule as YA}from"ag-grid-community";import{_addGridCommonParams as XA,_getCellByPosition as Us,_getFillHandle as kr,_getNormalisedMousePosition as El,_getRowNode as qA,_isRowBefore as ZA,_isSameRow as ae,_last as Ks,_toStringOrNull as JA,_warn as QA,isRowNumberCol as eR}from"ag-grid-community";import{Component as tR,_areCellsEqual as sR,_getCellPositionForEvent as iR,_isRowBefore as rR,_isVisible as aR,_last as oR,_setDisplayed as nR}from"ag-grid-community";var Il=class extends tR{constructor(){super(...arguments),this.changedCalculatedValues=!1,this.dragging=!1,this.shouldDestroyOnEndDragging=!1}postConstruct(){const{dragSvc:e,rangeSvc:t}=this.beans;e.addDragSource({dragStartPixels:0,eElement:this.getGui(),onDragStart:this.onDragStart.bind(this),onDragging:s=>{this.dragging=!0,t.autoScrollService.check(s),this.changedCalculatedValues&&(this.onDrag(s),this.changedCalculatedValues=!1)},onDragStop:s=>{this.dragging=!1,this.onDragEnd(s),this.clearDragProperties(),this.shouldDestroyOnEndDragging&&this.destroy()},onDragCancel:()=>{this.dragging=!1,this.onDragCancel(),this.clearDragProperties()}}),this.addManagedElementListeners(this.getGui(),{mousedown:this.preventRangeExtension.bind(this)})}getLastCellHovered(){return this.lastCellHovered}preventRangeExtension(e){e.stopPropagation()}onDragStart(e){[this.cellHoverListener]=this.addManagedElementListeners(this.beans.ctrlsSvc.get("gridCtrl").getGui(),{mousemove:this.updateValuesOnMove.bind(this)}),document.body.classList.add(this.getDraggingCssClass())}getDraggingCssClass(){return`ag-dragging-${this.type===0?"fill":"range"}-handle`}updateValuesOnMove(e){const t=iR(this.gos,e);!t||this.shouldSkipCell(t)||this.lastCellHovered&&sR(t,this.lastCellHovered)||(this.lastCellHovered=t,this.changedCalculatedValues=!0)}clearDragProperties(){this.clearValues(),this.beans.rangeSvc.autoScrollService.ensureCleared(),document.body.classList.remove(this.getDraggingCssClass())}getType(){return this.type}refresh(e){const t=this.cellCtrl,s=this.getGui(),i=oR(this.beans.rangeSvc.getCellRanges()),r=i.startRow,a=i.endRow;if(r&&a&&(rR(a,r)?(this.rangeStartRow=a,this.rangeEndRow=r):(this.rangeStartRow=r,this.rangeEndRow=a)),t!==e||!aR(s)){this.cellCtrl=e;const o=e.comp.getParentOfValue();o&&o.appendChild(s)}this.cellRange=i}clearValues(){this.lastCellHovered=void 0,this.removeListeners()}removeListeners(){const e=this.cellHoverListener;e&&(e(),this.cellHoverListener=void 0)}destroy(){if(!this.shouldDestroyOnEndDragging&&this.dragging){nR(this.getGui(),!1),this.shouldDestroyOnEndDragging=!0;return}this.shouldDestroyOnEndDragging=!1,super.destroy(),this.removeListeners();const e=this.getGui();e.parentElement?.removeChild(e)}};function lR(e){const t=e.length;let s=0;if(t<=1)return e;for(let h=0;h1){s=Math.max(s,parseInt(p[1],10));continue}Math.floor(u)!==u&&(s=Math.max(s,u.toString().split(".")[1].length))}let i=0,r=0,a=0,o=0,n=0;for(let h=0;h
'),this.markedCells=[],this.cellValues=[],this.isUp=!1,this.isLeft=!1,this.isReduce=!1,this.type=0}updateValuesOnMove(e){super.updateValuesOnMove(e),this.initialXY||(this.initialXY=El(this.beans,e));const{x:t,y:s}=this.initialXY,{x:i,y:r}=El(this.beans,e),a=Math.abs(t-i),o=Math.abs(s-r),n=this.getFillHandleDirection();let l;n==="xy"?l=a>o?"x":"y":l=n,l!==this.dragAxis&&(this.dragAxis=l,this.changedCalculatedValues=!0)}shouldSkipCell(e){return eR(e.column)}onDrag(e){if(!this.initialPosition){const s=this.cellCtrl;if(!s)return;this.initialPosition=s.cellPosition}const t=this.getLastCellHovered();t&&this.markPathFrom(this.initialPosition,t)}onDragEnd(e){if(this.initialXY=null,!this.markedCells.length)return;const t=this.dragAxis==="x",{cellRange:s,rangeStartRow:i,rangeEndRow:r,beans:a}=this,o=s.columns.length;let n;const{rangeSvc:l,eventSvc:c}=a;if(!this.isUp&&!this.isLeft)n=l.createCellRangeFromCellRangeParams({rowStartIndex:i.rowIndex,rowStartPinned:i.rowPinned,columnStart:s.columns[0],rowEndIndex:t?r.rowIndex:this.lastCellMarked.rowIndex,rowEndPinned:t?r.rowPinned:this.lastCellMarked.rowPinned,columnEnd:t?this.lastCellMarked.column:s.columns[o-1]});else{const d=t?i:this.lastCellMarked;n=l.createCellRangeFromCellRangeParams({rowStartIndex:d.rowIndex,rowStartPinned:d.rowPinned,columnStart:t?this.lastCellMarked.column:s.columns[0],rowEndIndex:r.rowIndex,rowEndPinned:r.rowPinned,columnEnd:s.columns[o-1]})}n&&(c.dispatchEvent({type:"fillStart"}),this.handleValueChanged(s,n,e),l.setCellRanges([n]),c.dispatchEvent({type:"fillEnd",initialRange:s,finalRange:n}))}onDragCancel(){this.initialXY=null,this.markedCells.length&&this.clearMarkedPath()}getFillHandleDirection(){const e=kr(this.gos)?.direction;return e?e!=="x"&&e!=="y"&&e!=="xy"?(QA(177),"xy"):e:"xy"}handleValueChanged(e,t,s){const{rangeSvc:i,gos:r,cellNavigation:a,valueSvc:o}=this.beans,n=i.getRangeEndRow(e),l=i.getRangeStartRow(e),c=i.getRangeEndRow(t),d=i.getRangeStartRow(t),h=this.dragAxis==="y";if(this.isReduce&&!kr(r)?.suppressClearOnFillReduction){const S=h?e.columns:e.columns.filter(T=>t.columns.indexOf(T)<0),w=h?a.getRowBelow(c):d;w&&this.clearCellsInRange(w,n,S);return}const u=[],p=[],g=[],m=[];let C=!0,f=0;const v=()=>{u.length=0,p.length=0,g.length=0,m.length=0,f=0},y=(S,w)=>{let T=this.isUp?n:l,P=!1;for(h&&(C=!0,v());!P&&T;){const F=qA(this.beans,T);if(!F)break;h&&S?x(u,S,F,()=>!ae(T,this.isUp?l:n)):w&&(C=!0,v(),w.forEach(A=>x(u,A,F,()=>A!==(this.isLeft?e.columns[0]:Ks(e.columns))))),P=ae(T,this.isUp?d:c),T=this.isUp?a.getRowAbove(T):a.getRowBelow(T)}},x=(S,w,T,P)=>{let F,A=!1;if(C)F=o.getValue(w,T),p.push(F),g.push(o.getValue(w,T,!0)),m.push(o.formatValue(w,T,F)),C=P();else{const{value:M,fromUserFunction:L,sourceCol:I,sourceRowNode:D}=this.processValues({event:s,values:S,initialValues:p,initialNonAggregatedValues:g,initialFormattedValues:m,col:w,rowNode:T,idx:f++});if(F=M,w.isCellEditable(T)){const E=o.getValue(w,T);if(!L){if(I){const k=I.getColDef();if(k.useValueFormatterForExport!==!1&&k.valueFormatter){const V=o.formatValue(I,D,F);V!=null&&(F=V)}}w.getColDef().useValueParserForImport!==!1&&(F=o.parseValue(w,T,I?F:JA(F),E))}!L||E!==F?T.setDataValue(w,F,"rangeSvc"):A=!0}}A||S.push({value:F,column:w,rowNode:T})};if(h)e.columns.forEach(S=>{y(S)});else{const S=this.isLeft?[...t.columns].reverse():t.columns;y(void 0,S)}}clearCellsInRange(e,t,s){const i={startRow:e,endRow:t,columns:s,startColumn:s[0]};this.beans.rangeSvc.clearCellRangeCellValues({cellRanges:[i]})}processValues(e){const{event:t,values:s,initialValues:i,initialNonAggregatedValues:r,initialFormattedValues:a,col:o,rowNode:n,idx:l}=e,c=kr(this.gos)?.setFillValue,d=this.dragAxis==="y";let h;if(d?h=this.isUp?"up":"down":h=this.isLeft?"left":"right",c){const p=XA(this.gos,{event:t,values:s.map(({value:m})=>m),initialValues:i,initialNonAggregatedValues:r,initialFormattedValues:a,currentIndex:l,currentCellValue:this.beans.valueSvc.getValue(o,n),direction:h,column:o,rowNode:n}),g=c(p);if(g!==!1)return{value:g,fromUserFunction:!0}}const u=!s.some(({value:p})=>{const g=parseFloat(p);return isNaN(g)||g.toString()!==p.toString()});if(t.altKey||!u){if(u&&i.length===1){const C=this.isUp||this.isLeft?-1:1;return{value:parseFloat(Ks(s).value)+1*C,fromUserFunction:!1}}const{value:p,column:g,rowNode:m}=s[l%s.length];return{value:p,fromUserFunction:!1,sourceCol:g,sourceRowNode:m}}return{value:Ks(lR(s.map(({value:p})=>Number(p)))),fromUserFunction:!1}}clearValues(){this.clearMarkedPath(),this.clearCellValues(),this.lastCellMarked=void 0,super.clearValues()}clearMarkedPath(){this.markedCells.forEach(e=>{if(!e.isAlive())return;const{comp:t}=e;t.addOrRemoveCssClass("ag-selection-fill-top",!1),t.addOrRemoveCssClass("ag-selection-fill-right",!1),t.addOrRemoveCssClass("ag-selection-fill-bottom",!1),t.addOrRemoveCssClass("ag-selection-fill-left",!1)}),this.markedCells.length=0,this.isUp=!1,this.isLeft=!1,this.isReduce=!1}clearCellValues(){this.cellValues.length=0}markPathFrom(e,t){if(this.clearMarkedPath(),this.clearCellValues(),this.dragAxis==="y"){if(ae(t,e))return;const s=ZA(t,e),{rangeStartRow:i,rangeEndRow:r}=this;s&&(t.rowPinned==i.rowPinned&&t.rowIndex>=i.rowIndex||i.rowPinned!=r.rowPinned&&t.rowPinned==r.rowPinned&&t.rowIndex<=r.rowIndex)?(this.reduceVertical(e,t),this.isReduce=!0):(this.extendVertical(e,t,s),this.isReduce=!1)}else{const s=e.column,i=t.column;if(s===i)return;const r=this.beans.visibleCols.allCols,a=r.indexOf(s),o=r.indexOf(i);o<=a&&o>=r.indexOf(this.cellRange.columns[0])?(this.reduceHorizontal(e,t),this.isReduce=!0):(this.extendHorizontal(e,t,o{let g=h,m=!1;do{m=ae(g,u);const C=Us(i,{rowIndex:g.rowIndex,rowPinned:g.rowPinned,column:p});if(C){this.markedCells.push(C);const f=C.comp;f.addOrRemoveCssClass("ag-selection-fill-top",ae(g,h)),f.addOrRemoveCssClass("ag-selection-fill-bottom",ae(g,u)),s?(this.isLeft=!0,f.addOrRemoveCssClass("ag-selection-fill-left",p===d[0])):f.addOrRemoveCssClass("ag-selection-fill-right",p===Ks(d))}g=a.getRowBelow(g)}while(!m)})}reduceHorizontal(e,t){const s=this.beans,{visibleCols:i,cellNavigation:r}=s,a=i.allCols,o=a.indexOf(t.column),n=a.indexOf(e.column),l=a.slice(o,n),{rangeStartRow:c,rangeEndRow:d}=this;l.forEach(h=>{let u=c,p=!1;do{p=ae(u,d);const g=Us(this.beans,{rowIndex:u.rowIndex,rowPinned:u.rowPinned,column:h});g&&(this.markedCells.push(g),g.comp.addOrRemoveCssClass("ag-selection-fill-right",h===l[0])),u=r.getRowBelow(u)}while(!p)})}refresh(e){const t=this.beans.rangeSvc.getCellRanges()[0];if(!t.startRow||!t.endRow){this.destroy();return}super.refresh(e)}};import{CellRangeType as Dl,_isSameRow as dR,_last as Ll}from"ag-grid-community";var hR=class extends Il{constructor(){super('
'),this.type=1,this.rangeFixed=!1}onDrag(e){const t=this.getLastCellHovered();if(!t)return;const s=this.beans.rangeSvc,i=s.getCellRanges(),r=Ll(i);this.rangeFixed||(this.fixRangeStartEnd(r),this.rangeFixed=!0),this.endPosition={rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:t.column},i.length===2&&i[0].type===Dl.DIMENSION&&r.type===Dl.VALUE&&!dR(this.endPosition,s.getRangeEndRow(r))&&s.updateRangeEnd(i[0],{...this.endPosition,column:i[0].columns[0]},!0),s.extendLatestRangeToCell(this.endPosition)}shouldSkipCell(e){return!1}onDragEnd(e){const t=Ll(this.beans.rangeSvc.getCellRanges());this.fixRangeStartEnd(t),this.rangeFixed=!1}onDragCancel(){this.rangeFixed=!1}fixRangeStartEnd(e){const t=this.beans.rangeSvc,s=t.getRangeStartRow(e),i=t.getRangeEndRow(e),r=e.columns[0];e.startRow=s,e.endRow=i,e.startColumn=r}},uR=".ag-body-viewport:not(.ag-has-focus) .ag-cell-range-single-cell:not(.ag-cell-inline-editing),.ag-cell-range-selected.ag-cell-range-chart,.ag-cell-range-selected:not(.ag-cell-focus){background-color:var(--ag-range-selection-background-color);&.ag-cell-range-chart{background-color:var(--ag-range-selection-chart-background-color)!important;&.ag-cell-range-chart-category{background-color:var(--ag-range-selection-chart-category-background-color)!important}}}.ag-cell-range-selected-1.ag-cell-range-chart,.ag-cell-range-selected-1:not(.ag-cell-focus),.ag-root:not(.ag-context-menu-open) .ag-body-viewport:not(.ag-has-focus) .ag-cell-range-selected-1:not(.ag-cell-inline-editing){background-color:var(--ag-range-selection-background-color)}.ag-cell-range-selected-2.ag-cell-range-chart,.ag-cell-range-selected-2:not(.ag-cell-focus){background-image:linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color))}.ag-cell-range-selected-3.ag-cell-range-chart,.ag-cell-range-selected-3:not(.ag-cell-focus){background-image:linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color)),linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color))}.ag-cell-range-selected-4.ag-cell-range-chart,.ag-cell-range-selected-4:not(.ag-cell-focus){background-image:linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color)),linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color)),linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color))}.ag-cell.ag-cell-range-selected:not(.ag-cell-range-single-cell){&.ag-cell-range-top{border-top-color:var(--ag-range-selection-border-color);border-top-style:var(--ag-range-selection-border-style)}&.ag-cell-range-right{border-right-color:var(--ag-range-selection-border-color);border-right-style:var(--ag-range-selection-border-style)}&.ag-cell-range-bottom{border-bottom-color:var(--ag-range-selection-border-color);border-bottom-style:var(--ag-range-selection-border-style)}&.ag-cell-range-left{border-left-color:var(--ag-range-selection-border-color);border-left-style:var(--ag-range-selection-border-style)}}.ag-cell.ag-selection-fill-top,.ag-cell.ag-selection-fill-top.ag-cell-range-selected{border-top:1px dashed;border-top-color:var(--ag-range-selection-border-color)}:where(.ag-ltr) .ag-cell.ag-selection-fill-right,:where(.ag-ltr) .ag-cell.ag-selection-fill-right.ag-cell-range-selected{border-right:1px dashed var(--ag-range-selection-border-color)!important}:where(.ag-rtl) .ag-cell.ag-selection-fill-right,:where(.ag-rtl) .ag-cell.ag-selection-fill-right.ag-cell-range-selected{border-left:1px dashed var(--ag-range-selection-border-color)!important}.ag-cell.ag-selection-fill-bottom,.ag-cell.ag-selection-fill-bottom.ag-cell-range-selected{border-bottom:1px dashed;border-bottom-color:var(--ag-range-selection-border-color)}:where(.ag-ltr) .ag-cell.ag-selection-fill-left,:where(.ag-ltr) .ag-cell.ag-selection-fill-left.ag-cell-range-selected{border-left:1px dashed var(--ag-range-selection-border-color)!important}:where(.ag-rtl) .ag-cell.ag-selection-fill-left,:where(.ag-rtl) .ag-cell.ag-selection-fill-left.ag-cell-range-selected{border-right:1px dashed var(--ag-range-selection-border-color)!important}.ag-fill-handle,.ag-range-handle{background-color:var(--ag-range-selection-border-color);bottom:-1px;height:6px;position:absolute;width:6px}:where(.ag-ltr) .ag-fill-handle,:where(.ag-ltr) .ag-range-handle{right:-1px}:where(.ag-rtl) .ag-fill-handle,:where(.ag-rtl) .ag-range-handle{left:-1px}.ag-fill-handle{cursor:cell}:where(.ag-ltr) .ag-range-handle{cursor:nwse-resize}:where(.ag-rtl) .ag-range-handle{cursor:nesw-resize}";function pR(e){return e.rangeSvc?.getCellRanges()??null}function gR(e,t){e.rangeSvc?.addCellRange(t)}function kl(e){e.rangeSvc?.removeAllCellRanges()}import{AutoScrollService as mR,BeanStub as fR,_areCellsEqual as CR,_areEqual as Gl,_exists as vR,_getCellCtrlForEventTarget as yR,_getRowNode as Ol,_getSuppressMultiRanges as Ws,_isCellSelectionEnabled as js,_isDomLayout as SR,_isRowBefore as oe,_isSameRow as bR,_isUsingNewCellSelectionAPI as wR,_last as se,_makeNull as Nl,_missing as xR,_warn as Gr,isRowNumberCol as Or}from"ag-grid-community";import{CellRangeType as $s,_isSameRow as Bl,_last as _l,_missing as TR,_setAriaSelected as MR}from"ag-grid-community";var Xt="ag-cell-range-selected",PR="ag-cell-range-chart",FR="ag-cell-range-single-cell",AR="ag-cell-range-chart-category",RR="ag-cell-range-handle",ER="ag-cell-range-top",IR="ag-cell-range-right",DR="ag-cell-range-bottom",LR="ag-cell-range-left";function kR(e){const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"?t.handle?.mode==="range":!1:e.get("enableRangeHandle")}function Vl(e){const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"?t.handle?.mode==="fill":!1:e.get("enableFillHandle")}var GR=class{constructor(e,t){this.beans=e,this.cellCtrl=t,this.rangeSvc=e.rangeSvc}setComp(e){this.cellComp=e,this.eGui=this.cellCtrl.eGui,this.onCellSelectionChanged()}onCellSelectionChanged(){const e=this.cellComp;if(!e)return;const{rangeSvc:t,cellCtrl:s,eGui:i}=this,r=t.getCellRangeCount(s.cellPosition);this.rangeCount=r;const a=this.getHasChartRange();this.hasChartRange=a,e.addOrRemoveCssClass(Xt,r!==0),e.addOrRemoveCssClass(`${Xt}-1`,r===1),e.addOrRemoveCssClass(`${Xt}-2`,r===2),e.addOrRemoveCssClass(`${Xt}-3`,r===3),e.addOrRemoveCssClass(`${Xt}-4`,r>=4),e.addOrRemoveCssClass(PR,a),MR(i,r>0?!0:void 0),e.addOrRemoveCssClass(FR,this.isSingleCell()),this.updateRangeBorders(),this.refreshHandle()}updateRangeBorders(){const e=this.getRangeBorders(),t=this.isSingleCell(),s=!t&&e.top,i=!t&&e.right,r=!t&&e.bottom,a=!t&&e.left,o=this.cellComp;o.addOrRemoveCssClass(ER,s),o.addOrRemoveCssClass(IR,i),o.addOrRemoveCssClass(DR,r),o.addOrRemoveCssClass(LR,a)}isSingleCell(){const{rangeSvc:e}=this;return this.rangeCount===1&&!!e&&!e.isMoreThanOneCell()}getHasChartRange(){const{rangeSvc:e}=this;if(!this.rangeCount||!e)return!1;const t=e.getCellRanges();return t.length>0&&t.every(s=>[$s.DIMENSION,$s.VALUE].includes(s.type))}updateRangeBordersIfRangeCount(){this.rangeCount>0&&(this.updateRangeBorders(),this.refreshHandle())}getRangeBorders(){const e=this.beans.gos.get("enableRtl");let t=!1,s=!1,i=!1,r=!1;const{rangeSvc:a,beans:{visibleCols:o},cellCtrl:{cellPosition:n}}=this,l=n.column;let c,d;e?(c=o.getColAfter(l),d=o.getColBefore(l)):(c=o.getColBefore(l),d=o.getColAfter(l));const h=a.getCellRanges().filter(u=>a.isCellInSpecificRange(n,u));c||(r=!0),d||(s=!0);for(let u=0;u{Hl(t)?o():n()}),this.addDestroyFunc(n),Hl(t)&&o()}};import{BeanStub as BR}from"ag-grid-community";var _R=class extends BR{constructor(e,t){super(),this.column=e,this.comp=t,this.columnMap=new Map,this.isActive=!1,this.resetColumnMap()}postConstruct(){this.addManagedPropertyListener("cellSelection",()=>{this.refreshActive()}),this.refreshActive(),this.setupRangeHeaderHighlight()}resetColumnMap(){this.columnMap.clear();let e;this.column.isColumn?e=[this.column]:e=this.column.getDisplayedLeafColumns();for(const t of e)this.columnMap.set(t,!1)}refreshActive(){const{gos:e,rangeSvc:t}=this.beans,s=e.get("cellSelection");this.isActive=!!(s&&t&&typeof s=="object"&&s.enableHeaderHighlight)}setupRangeHeaderHighlight(){const e=this.onRangeSelectionChanged.bind(this);this.addManagedEventListeners({rangeSelectionChanged:e,columnPinned:e,columnMoved:e,columnGroupOpened:e}),e()}onRangeSelectionChanged(){if(!this.isActive)return;this.resetColumnMap();const e=this.beans.rangeSvc.getCellRanges();let t=!1,s=!0;for(const i of e){if(t)break;for(const r of i.columns)this.columnMap.has(r)&&(this.columnMap.set(r,!0),t||(t=!0))}for(const i of Array.from(this.columnMap.values()))if(i===!1){s=!1;break}this.comp.addOrRemoveCssClass("ag-header-range-highlight",t&&s)}destroy(){super.destroy(),this.comp=null,this.column=null}},VR=class extends fR{constructor(){super(...arguments),this.beanName="rangeSvc",this.cellRanges=[],this.bodyScrollListener=this.onBodyScroll.bind(this),this.dragging=!1,this.intersectionRange=!1}wireBeans(e){this.rowModel=e.rowModel,this.dragSvc=e.dragSvc,this.colModel=e.colModel,this.visibleCols=e.visibleCols,this.cellNavigation=e.cellNavigation,this.pinnedRowModel=e.pinnedRowModel,this.ctrlsSvc=e.ctrlsSvc,this.valueSvc=e.valueSvc}postConstruct(){const e=this.onColumnsChanged.bind(this),t=()=>this.removeAllCellRanges(),s=this.refreshLastRangeStart.bind(this);this.addManagedEventListeners({newColumnsLoaded:e,columnVisible:e,columnValueChanged:e,columnPivotModeChanged:t,columnRowGroupChanged:t,columnPivotChanged:t,columnGroupOpened:s,columnMoved:s,columnPinned:s}),this.ctrlsSvc.whenReady(this,i=>{const r=i.gridBodyCtrl;this.autoScrollService=new mR({scrollContainer:r.eBodyViewport,scrollAxis:"xy",getVerticalPosition:()=>r.scrollFeature.getVScrollPosition().top,setVerticalPosition:a=>r.scrollFeature.setVerticalScrollPosition(a),getHorizontalPosition:()=>r.scrollFeature.getHScrollPosition().left,setHorizontalPosition:a=>r.scrollFeature.setHorizontalScrollPosition(a),shouldSkipVerticalScroll:()=>!SR(this.gos,"normal"),shouldSkipHorizontalScroll:()=>!r.scrollFeature.isHorizontalScrollShowing()})})}onDragStart(e){if(!js(this.gos))return;const{ctrlKey:t,metaKey:s,shiftKey:i}=e,r=t||s,o=!Ws(this.gos)?r:!1,n=i&&!!this.cellRanges?.length;!o&&(!n||vR(se(this.cellRanges).type))&&this.removeAllCellRanges(!0);const l=this.dragSvc.startTarget;if(l&&this.updateValuesOnMove(l),!!this.lastCellHovered){if(this.dragging=!0,this.lastMouseEvent=e,this.intersectionRange=o&&this.getCellRangeCount(this.lastCellHovered)>1,n||this.setNewestRangeStartCell(this.lastCellHovered),this.cellRanges.length>0)this.draggingRange=se(this.cellRanges);else{const c={rowIndex:this.lastCellHovered.rowIndex,rowPinned:this.lastCellHovered.rowPinned},d=this.getColumnsFromModel([this.lastCellHovered.column]);if(!d||!d.length)return;this.draggingRange={startRow:c,endRow:c,columns:d,startColumn:this.newestRangeStartCell.column},this.cellRanges.push(this.draggingRange)}this.ctrlsSvc.getGridBodyCtrl().eBodyViewport.addEventListener("scroll",this.bodyScrollListener,{passive:!0}),this.dispatchChangedEvent(!0,!1,this.draggingRange.id)}}onDragging(e){const{dragging:t,lastCellHovered:s,newestRangeStartCell:i,autoScrollService:r,cellHasChanged:a}=this;if(!t||!e)return;this.updateValuesOnMove(e.target),this.lastMouseEvent=e;const o=p=>s&&s.rowPinned===p&&i.rowPinned===p,n=o("top")||o("bottom");if(r.check(e,n),!a||!s)return;const l=i?.column,c=s?.column,d=this.calculateColumnsBetween(l,c);if(!d)return;const{rowIndex:h,rowPinned:u}=s;this.draggingRange.endRow={rowIndex:h,rowPinned:u},this.draggingRange.columns=d,this.dispatchChangedEvent(!1,!1,this.draggingRange.id)}onDragStop(){if(!this.dragging)return;const{id:e}=this.draggingRange;this.autoScrollService.ensureCleared(),this.ctrlsSvc.getGridBodyCtrl().eBodyViewport.removeEventListener("scroll",this.bodyScrollListener),this.lastMouseEvent=null,this.dragging=!1,this.draggingRange=void 0,this.lastCellHovered=void 0,this.intersectionRange&&(this.intersectionRange=!1,this.intersectLastRange()),this.dispatchChangedEvent(!1,!0,e)}onColumnsChanged(){this.refreshLastRangeStart();const e=this.visibleCols.allCols;this.cellRanges.forEach(s=>{const i=s.columns;s.columns=s.columns.filter(a=>a.isVisible()&&e.indexOf(a)!==-1),!Gl(i,s.columns)&&this.dispatchChangedEvent(!1,!0,s.id)});const t=this.cellRanges.length;this.cellRanges=this.cellRanges.filter(s=>s.columns.length>0),t>this.cellRanges.length&&this.dispatchChangedEvent(!1,!0)}refreshLastRangeStart(){const e=se(this.cellRanges);e&&this.refreshRangeStart(e)}isContiguousRange(e){const t=e.columns;if(!t.length)return!1;const s=this.visibleCols.allCols,i=t.map(r=>s.indexOf(r)).sort((r,a)=>r-a);return se(i)-i[0]+1===t.length}getRangeStartRow(e){return e.startRow&&e.endRow?oe(e.startRow,e.endRow)?e.startRow:e.endRow:{rowIndex:0,rowPinned:(this.pinnedRowModel?.getPinnedTopRowCount()??0)>0?"top":null}}getRangeEndRow(e){if(e.startRow&&e.endRow)return oe(e.startRow,e.endRow)?e.endRow:e.startRow;const t=this.pinnedRowModel?.getPinnedBottomRowCount()??0;return t>0?{rowIndex:t-1,rowPinned:"bottom"}:{rowIndex:this.rowModel.getRowCount()-1,rowPinned:null}}setRangeToCell(e,t=!1){const{gos:s}=this;if(!js(s))return;const i=s.get("rowNumbers"),r=Or(e.column);i&&this.setSelectionMode(r);const a=this.calculateColumnsBetween(e.column,e.column);if(!a)return;(Ws(this.gos)||!t||xR(this.cellRanges))&&this.removeAllCellRanges(!0);const n={rowIndex:e.rowIndex,rowPinned:e.rowPinned},l={startRow:n,endRow:n,columns:a,startColumn:e.column};this.cellRanges.push(l),this.setNewestRangeStartCell(e),this.onDragStop(),this.dispatchChangedEvent(!0,!0)}extendLatestRangeToCell(e){if(this.isEmpty()||!this.newestRangeStartCell)return;const t=se(this.cellRanges);this.setSelectionMode(Or(e.column)),this.updateRangeEnd(t,e)}updateRangeEnd(e,t,s=!1){const i=t.column,r=this.calculateColumnsBetween(e.startColumn,i);!r||this.isLastCellOfRange(e,t)||(e.columns=r,e.endRow={rowIndex:t.rowIndex,rowPinned:t.rowPinned},s||this.dispatchChangedEvent(!0,!0,e.id))}getRangeEdgeColumns(e){const t=this.visibleCols.allCols,s=e.columns.map(i=>t.indexOf(i)).filter(i=>i>-1).sort((i,r)=>i-r);return{left:t[s[0]],right:t[se(s)]}}extendLatestRangeInDirection(e){if(this.isEmpty()||!this.newestRangeStartCell)return;const t=e.key,s=e.ctrlKey||e.metaKey,i=se(this.cellRanges),r=this.newestRangeStartCell,a=i.columns[0],o=se(i.columns),n=i.endRow.rowIndex,l=i.endRow.rowPinned,d={column:r.column===a?o:a,rowIndex:n,rowPinned:l},h=this.cellNavigation.getNextCellToFocus(t,d,s);if(h)return this.setCellRange({rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,rowEndIndex:h.rowIndex,rowEndPinned:h.rowPinned,columnStart:r.column,columnEnd:h.column}),h}setCellRange(e){js(this.gos)&&(this.removeAllCellRanges(!0),this.addCellRange(e))}setCellRanges(e){if(!Gl(this.cellRanges,e)&&this.verifyCellRanges(this.gos)){this.removeAllCellRanges(!0);for(const t of e){if(t.columns&&t.startRow){const s=this.getColumnsFromModel(t.columns);if(!s||s.length===0)continue;t.columns=s;const{startRow:i}=t;this.setNewestRangeStartCell({rowIndex:i.rowIndex,rowPinned:i.rowPinned,column:t.columns[0]})}this.cellRanges.push(t)}this.dispatchChangedEvent(!1,!0)}}clearCellRangeCellValues(e){const{beans:t,valueSvc:s,eventSvc:i}=this,{cellEventSource:r="rangeSvc",dispatchWrapperEvents:a,wrapperEventSource:o="deleteKey"}=e;let{cellRanges:n}=e;a&&(i.dispatchEvent({type:"cellSelectionDeleteStart",source:o}),i.dispatchEvent({type:"rangeDeleteStart",source:o})),n||(n=this.cellRanges),n.forEach(l=>{this.forEachRowInRange(l,c=>{const d=Ol(t,c);if(d)for(let h=0;h1)return!0;const t=this.cellRanges[0],s=this.getRangeStartRow(t),i=this.getRangeEndRow(t);return s.rowPinned!==i.rowPinned||s.rowIndex!==i.rowIndex||t.columns.length!==1}areAllRangesAbleToMerge(){const e=new Map;if(this.cellRanges.length<=1)return!0;this.cellRanges.forEach(i=>{this.forEachRowInRange(i,r=>{const a=`${r.rowPinned||"normal"}_${r.rowIndex}`,o=e.get(a),n=i.columns.map(l=>l.getId());if(o){const l=n.filter(c=>o.indexOf(c)===-1);o.push(...l)}else e.set(a,n)})});let s;for(const i of e.values()){const r=i.sort().join();if(s===void 0){s=r;continue}if(s!==r)return!1}return!0}removeAllCellRanges(e){this.isEmpty()||(this.onDragStop(),this.cellRanges.length=0,e||this.dispatchChangedEvent(!1,!0))}isCellInAnyRange(e){return this.getCellRangeCount(e)>0}isCellInSpecificRange(e,t){const s=t.columns!==null&&t.columns.includes(e.column),i=this.isRowInRange(e.rowIndex,e.rowPinned,t);return s&&i}isBottomRightCell(e,t){const s=this.visibleCols.allCols,i=e.columns.map(c=>s.indexOf(c)).sort((c,d)=>c-d),{startRow:r,endRow:a}=e,o=oe(r,a)?a:r,n=s.indexOf(t.column)===se(i),l=t.rowIndex===o.rowIndex&&Nl(t.rowPinned)===Nl(o.rowPinned);return n&&l}getCellRangeCount(e){return this.isEmpty()?0:this.cellRanges.filter(t=>this.isCellInSpecificRange(e,t)).length}isRowInRange(e,t,s){const i=this.getRangeStartRow(s),r=this.getRangeEndRow(s),a={rowIndex:e,rowPinned:t||null},o=a.rowIndex===i.rowIndex&&a.rowPinned==i.rowPinned,n=a.rowIndex===r.rowIndex&&a.rowPinned==r.rowPinned;if(o||n)return!0;const l=!oe(a,i),c=oe(a,r);return l&&c}intersectLastRange(e){if(e&&this.dragging||Ws(this.gos)||this.isEmpty())return;const t=se(this.cellRanges),s=this.getRangeStartRow(t),i=this.getRangeEndRow(t),r=[];this.cellRanges.slice(0,-1).forEach(a=>{const o=this.getRangeStartRow(a),n=this.getRangeEndRow(a),l=a.columns,c=l.filter(h=>t.columns.indexOf(h)===-1);if(c.length===l.length){r.push(a);return}if(oe(i,o)||oe(n,s)){r.push(a);return}const d=r.length;if(oe(o,s)){const h={columns:[...l],startColumn:t.startColumn,startRow:{...o},endRow:this.cellNavigation.getRowAbove(s)};r.push(h)}if(c.length>0){const h={columns:c,startColumn:c.includes(t.startColumn)?t.startColumn:c[0],startRow:this.rowMax([{...s},{...o}]),endRow:this.rowMin([{...i},{...n}])};r.push(h)}oe(i,n)&&r.push({columns:[...l],startColumn:t.startColumn,startRow:this.cellNavigation.getRowBelow(i),endRow:{...n}}),r.length-d===1&&(r[r.length-1].id=a.id)}),this.cellRanges=r,e&&this.dispatchChangedEvent(!1,!0)}createRangeHighlightFeature(e,t,s){e.createManagedBean(new _R(t,s))}setSelectionMode(e){this.selectionMode=e?1:0}focusFirstRenderedCellAtRowPosition(e,t){const{beans:s}=this,i=Ol(s,e);if(!i)return;const r=s.colViewport.getColsWithinViewport(i),a=t.find(l=>r.indexOf(l)!==-1);if(!a)return;const{rowPinned:o,rowIndex:n}=e;s.focusSvc.setFocusedCell({rowIndex:n,rowPinned:o,column:a,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}refreshRangeStart(e){const{startColumn:t,columns:s}=e,i=(l,c)=>{const d=e.columns.filter(h=>h!==l);l?(e.startColumn=l,e.columns=c?[l,...d]:[...d,l]):e.columns=d},{left:r,right:a}=this.getRangeEdgeColumns(e);if(t===s[0]&&t!==r){i(r,!0);return}if(t===se(s)&&t===a){i(a,!1);return}}setNewestRangeStartCell(e){this.newestRangeStartCell=e}getColumnsFromParams(e,t,s){const i=!e&&!t&&!s;let r,a=!1;return i||e?r=this.getColumnsFromModel(i?void 0:e):t&&s&&(r=this.calculateColumnsBetween(t,s),r&&r.length&&(a=r[0]!==this.getColumnFromModel(t))),r?{columns:r,startsOnTheRight:a}:void 0}createRowPosition(e,t){return e!=null?{rowIndex:e,rowPinned:t}:void 0}verifyCellRanges(e){const t=wR(e)&&Ws(e)&&this.cellRanges.length>0;return t&&Gr(93),!t}forEachRowInRange(e,t){const s=this.getRangeStartRow(e),i=this.getRangeEndRow(e);let r=s;for(;r&&(t(r),!bR(r,i));)r=this.cellNavigation.getRowBelow(r)}onBodyScroll(){this.dragging&&this.lastMouseEvent&&this.onDragging(this.lastMouseEvent)}isLastCellOfRange(e,t){const{startRow:s,endRow:i}=e,r=oe(s,i)?i:s,a=t.rowIndex===r.rowIndex&&t.rowPinned===r.rowPinned,o=e.columns[0],n=se(e.columns),l=e.startColumn===o?n:o;return t.column===l&&a}rowMax(e){let t;return e.forEach(s=>{(t===void 0||oe(t,s))&&(t=s)}),t}rowMin(e){let t;return e.forEach(s=>{(t===void 0||oe(s,t))&&(t=s)}),t}updateValuesOnMove(e){const t=yR(this.gos,e),s=t?.cellPosition;if(this.cellHasChanged=!1,!(!s||this.lastCellHovered&&CR(s,this.lastCellHovered))){if(t?.editing){this.dragSvc.cancelDrag(e);return}this.lastCellHovered&&(this.cellHasChanged=!0),this.lastCellHovered=s}}shouldSkipCurrentColumn(e){return Or(e)}dispatchChangedEvent(e,t,s){this.eventSvc.dispatchEvent({type:"cellSelectionChanged",started:e,finished:t,id:s}),this.eventSvc.dispatchEvent({type:"rangeSelectionChanged",started:e,finished:t,id:s})}getColumnFromModel(e){return typeof e=="string"?this.colModel.getCol(e):e}getColumnsFromModel(e){const{gos:t,visibleCols:s}=this,i=t.get("rowNumbers");(!e||this.selectionMode===1)&&(e=s.allCols);const r=[];for(const a of e){const o=this.getColumnFromModel(a);!o||i&&this.shouldSkipCurrentColumn(o)||r.push(o)}return r.length?r:void 0}calculateColumnsBetween(e,t){const s=this.visibleCols.allCols,i=this.getColumnFromModel(e),r=this.getColumnFromModel(t),a=i===r,o=s.indexOf(i);if(o<0){Gr(178,{colId:i.getId()});return}const n=a?o:s.indexOf(r);if(n<0){Gr(178,{colId:r.getId()});return}if(a||this.selectionMode===1)return this.getColumnsFromModel([i]);const l=Math.min(o,n),c=l===o?n:o,d=[];for(let h=l;h<=c;h++)d.push(s[h]);return this.getColumnsFromModel(d)}createDragListenerFeature(e){return new NR(e)}createCellRangeFeature(e,t){return new GR(e,t)}},Ys={moduleName:"CellSelection",version:R,beans:[VR],dynamicBeans:{fillHandle:cR,rangeHandle:hR},apiFunctions:{getCellRanges:pR,addCellRange:gR,clearRangeSelection:kl,clearCellSelection:kl},dependsOn:[G,YA,$A],css:[uR]},HR={moduleName:"RangeSelection",version:R,dependsOn:[Ys]};import{_CsrmSsrmSharedApiModule as zR,_SharedRowSelectionModule as UR,_SortModule as KR,_SsrmInfiniteSharedApiModule as WR}from"ag-grid-community";import{Component as jR,RefPlaceholder as zl,_createIconNoSpan as $R}from"ag-grid-community";var YR=class extends jR{constructor(){super(`
`),this.eLoadingIcon=zl,this.eLoadingText=zl}init(e){e.node.failedLoad?this.setupFailed():this.setupLoading()}setupFailed(){const e=this.getLocaleTextFunc();this.eLoadingText.innerText=e("loadingError","ERR")}setupLoading(){const e=$R("groupLoading",this.beans,null);e&&this.eLoadingIcon.appendChild(e);const t=this.getLocaleTextFunc();this.eLoadingText.innerText=t("loadingOoo","Loading")}refresh(e){return!1}};import{Component as XR,_getDocument as qR,_setAriaLabel as Ul,_setAriaLabelledBy as Kl}from"ag-grid-community";var ZR=class extends XR{constructor(){super('
')}init(e){const t=`ag-cell-skeleton-renderer-${this.getCompId()}`;this.getGui().setAttribute("id",t),this.addDestroyFunc(()=>Kl(e.eParentOfValue)),Kl(e.eParentOfValue,t),e.node.failedLoad?this.setupFailed():this.setupLoading(e)}setupFailed(){const e=this.getLocaleTextFunc();this.getGui().innerText=e("loadingError","ERR");const t=e("ariaSkeletonCellLoadingFailed","Row failed to load");Ul(this.getGui(),t)}setupLoading(e){const s=qR(this.beans).createElement("div");s.classList.add("ag-skeleton-effect");const i=e.node.rowIndex;if(i!=null){const o=75+25*(i%2===0?Math.sin(i):Math.cos(i));s.style.width=`${o}%`}this.getGui().appendChild(s);const a=this.getLocaleTextFunc()("ariaSkeletonCellLoading","Row data is loading");Ul(this.getGui(),a)}refresh(e){return!1}},JR={moduleName:"LoadingCellRenderer",version:R,userComponents:{agLoadingCellRenderer:YR},icons:{groupLoading:"loading"},dependsOn:[G]},QR={moduleName:"SkeletonCellRenderer",version:R,userComponents:{agSkeletonCellRenderer:ZR},dependsOn:[G]};import{_ColumnGroupModule as eE}from"ag-grid-community";function tE(e){return e.colModel.isPivotMode()}function sE(e,t,s){return e.pivotResultCols?.lookupPivotResultCol(t,s)??null}function iE(e,t){e.valueColsSvc?.setColumns(t,"api")}function rE(e){return e.valueColsSvc?.columns??[]}function aE(e,t){e.valueColsSvc?.removeColumns(t,"api")}function oE(e,t){e.valueColsSvc?.addColumns(t,"api")}function nE(e,t){e.pivotColsSvc?.setColumns(t,"api")}function lE(e,t){e.pivotColsSvc?.removeColumns(t,"api")}function cE(e,t){e.pivotColsSvc?.addColumns(t,"api")}function dE(e){return e.pivotColsSvc?.columns??[]}function hE(e,t){e.pivotResultCols?.setPivotResultCols(t,"api")}function uE(e){const t=e.pivotResultCols?.getPivotResultCols();return t?t.list:null}import{BeanStub as pE}from"ag-grid-community";var Wl="PivotRowTotal_",gE=class extends pE{constructor(){super(...arguments),this.beanName="pivotColDefSvc"}wireBeans(e){this.colModel=e.colModel,this.pivotColsSvc=e.pivotColsSvc,this.valueColsSvc=e.valueColsSvc,this.colNames=e.colNames}postConstruct(){const e=()=>this.gos.get("serverSidePivotResultFieldSeparator")??"_";this.fieldSeparator=e(),this.addManagedPropertyListener("serverSidePivotResultFieldSeparator",()=>{this.fieldSeparator=e()});const t=()=>this.gos.get("pivotDefaultExpanded");this.pivotDefaultExpanded=t(),this.addManagedPropertyListener("pivotDefaultExpanded",()=>{this.pivotDefaultExpanded=t()})}createPivotColumnDefs(e){const t=this.createPivotColumnsFromUniqueValues(e);function s(a,o=[]){return a.forEach(n=>{n.children!==void 0?s(n.children,o):o.push(n)}),o}const i=s(t);this.addRowGroupTotals(t,i),this.addExpandablePivotGroups(t,i),this.addPivotTotalsToGroups(t,i);const r=i.map(a=>({...a}));return{pivotColumnGroupDefs:t,pivotColumnDefs:r}}createPivotColumnsFromUniqueValues(e){const t=this.pivotColsSvc?.columns??[],s=t.length;return this.recursivelyBuildGroup(0,e,[],s,t)}recursivelyBuildGroup(e,t,s,i,r){const a=this.valueColsSvc?.columns;if(e>=i)return this.buildMeasureCols(s);const o=r[e].getColDef(),n=this.headerNameComparator.bind(this,o.pivotComparator);if(a?.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&e===i-1){const c=[];for(const d of Object.keys(t)){const h=[...s,d],u=this.createColDef(a[0],d,h);u.columnGroupShow="open",c.push(u)}return c.sort(n),c}const l=[];for(const c of Object.keys(t)){const d=this.pivotDefaultExpanded===-1||e{const i=this.colNames.getDisplayNameForColumn(s,"header");return{...this.createColDef(s,i,e),columnGroupShow:"open"}})}addExpandablePivotGroups(e,t){const s=this.gos.get("suppressExpandablePivotGroups");if(s||this.gos.get("pivotColumnGroupTotals"))return;const i=(r,a,o)=>{if("children"in r){const{valueColsSvc:c}=this,{columns:d=[]}=c??{},h=new Map;r.children.forEach(g=>{i(g,a,h)});const u=!r.children.some(g=>g.children),p=u&&d.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn");d.forEach(g=>{const m=this.colNames.getDisplayNameForColumn(g,"header"),C=this.createColDef(g,m,r.pivotKeys);C.pivotTotalColumnIds=h.get(g.getColId()),C.columnGroupShow=s?"open":"closed",C.aggFunc=g.getAggFunc(),(!u||p)&&(r.children.push(C),a.push(C))}),this.merge(o,h);return}if(!r.pivotValueColumn)return;const n=r.pivotValueColumn.getColId();o.has(n)?o.get(n).push(r.colId):o.set(n,[r.colId])};e.forEach(r=>{i(r,t,new Map)})}addPivotTotalsToGroups(e,t){if(!this.gos.get("pivotColumnGroupTotals"))return;const s=this.gos.get("pivotColumnGroupTotals")==="after",i=this.valueColsSvc?.columns,r=i?.map(a=>a.getAggFunc());if(!(!r||r.length<1||!this.sameAggFuncs(r))&&i){const a=i[0];e.forEach(o=>{this.recursivelyAddPivotTotal(o,t,a,s)})}}recursivelyAddPivotTotal(e,t,s,i){const r=e;if(!r.children){const o=e;return o.colId?[o.colId]:null}let a=[];if(r.children.forEach(o=>{const n=this.recursivelyAddPivotTotal(o,t,s,i);n&&(a=a.concat(n))}),r.children.length>1){const n=this.getLocaleTextFunc()("pivotColumnGroupTotals","Total"),l=this.createColDef(s,n,e.pivotKeys,!0);l.pivotTotalColumnIds=a,l.aggFunc=s.getAggFunc(),l.columnGroupShow=this.gos.get("suppressExpandablePivotGroups")?"open":void 0;const c=e.children;i?c.push(l):c.unshift(l),t.push(l)}return a}addRowGroupTotals(e,t){if(!this.gos.get("pivotRowTotals"))return;const s=this.gos.get("pivotRowTotals")==="after",r=(this.valueColsSvc?.columns??[]).slice();s||r.reverse();const a=r.length>1||!this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(let o=0;oa.data?.[a.colDef.field],r.pivotKeys=s,r.pivotValueColumn=e,r.filter===!0&&(r.filter="agNumberColumnFilter"),r}sameAggFuncs(e){if(e.length==1)return!0;for(let t=1;ts.headerName?1:0}merge(e,t){t.forEach((s,i)=>{const a=[...e.has(i)?e.get(i):[],...s];e.set(i,a)})}generateColumnGroupId(e){return`pivotGroup_${(this.pivotColsSvc?.columns??[]).map(s=>s.getColId()).join("-")}_${e.join("-")}`}generateColumnId(e,t){return`pivot_${(this.pivotColsSvc?.columns??[]).map(i=>i.getColId()).join("-")}_${e.join("-")}_${t}`}createColDefsFromFields(e){const t={};for(let r=0;r{const l=[];for(const h of Object.keys(o)){const u=o[h],p=s(`${r}${this.fieldSeparator}${h}`,h,u,n+1);l.push(p)}if(l.length===0){const h=this.colModel.getColDefCol(a);if(h){const p=this.colNames.getDisplayNameForColumn(h,"header")??a,g=this.createColDef(h,p,void 0,!1);return g.colId=r,g.aggFunc=h.getAggFunc(),g.valueGetter=m=>m.data?.[r],g}return{colId:r,headerName:a,valueGetter:p=>p.data?.[r]}}return this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&l.length===1&&"colId"in l[0]?(l[0].headerName=a,l[0]):{openByDefault:this.pivotDefaultExpanded===-1||n{const a=r.getColDef().pivotKeys,o=r.getColDef().pivotValueColumn;fE(a,e)&&o===s&&(i=r)}),i}getPivotResultCols(){return this.pivotResultCols}getPivotResultCol(e){return this.pivotResultCols?this.colModel.getColFromCollection(e,this.pivotResultCols):null}setPivotResultCols(e,t){if(this.colModel.ready&&!(e==null&&this.pivotResultCols==null)){if(e){this.processPivotResultColDef(e);const s=CE(this.beans,e,!1,this.pivotResultCols?.tree||this.previousPivotResultCols||void 0,t);jl(this.beans,this.pivotResultCols?.tree,s.columnTree);const i=s.columnTree,r=s.treeDept,a=yE(i),o={};this.pivotResultCols={tree:i,treeDepth:r,list:a,map:o},this.pivotResultCols.list.forEach(l=>this.pivotResultCols.map[l.getId()]=l);const n=!!this.previousPivotResultCols;this.previousPivotResultCols=null,this.colModel.refreshCols(!n)}else this.previousPivotResultCols=this.pivotResultCols?this.pivotResultCols.tree:null,this.pivotResultCols=null,this.colModel.refreshCols(!1);this.visibleCols.refresh(t)}}processPivotResultColDef(e){const t=this.gos.get("processPivotResultColDef"),s=this.gos.get("processPivotResultColGroupDef");if(!t&&!s)return;const i=r=>{r.forEach(a=>{if(vE(a.children)){const n=a;s&&s(n),i(n.children)}else t&&t(a)})};e&&i(e)}};import{BeanStub as bE,_missing as wE}from"ag-grid-community";var $l="Exceeded maximum allowed pivot column count.",xE=class extends bE{constructor(){super(...arguments),this.beanName="pivotStage",this.refreshProps=new Set(["removePivotHeaderRowWhenSingleValueColumn","pivotRowTotals","pivotColumnGroupTotals","suppressExpandablePivotGroups"]),this.step="pivot",this.uniqueValues={},this.lastTimeFailed=!1,this.maxUniqueValues=-1,this.currentUniqueCount=0}wireBeans(e){this.valueSvc=e.valueSvc,this.colModel=e.colModel,this.pivotResultCols=e.pivotResultCols,this.rowGroupColsSvc=e.rowGroupColsSvc,this.valueColsSvc=e.valueColsSvc,this.pivotColsSvc=e.pivotColsSvc,this.pivotColDefSvc=e.pivotColDefSvc}execute(e){const t=e.changedPath;this.colModel.isPivotActive()?this.executePivotOn(t):this.executePivotOff(t)}executePivotOff(e){this.aggregationColumnsHashLastTime=null,this.uniqueValues={},this.pivotResultCols.isPivotResultColsPresent()&&(this.pivotResultCols.setPivotResultCols(null,"rowModelUpdated"),e&&(e.active=!1))}executePivotOn(e){const t=this.valueColsSvc?.columns.length??1,s=this.gos.get("pivotMaxGeneratedColumns");this.maxUniqueValues=s===-1?-1:s/t;let i;try{i=this.bucketUpRowNodes(e)}catch(f){if(f.message===$l){this.pivotResultCols.setPivotResultCols([],"rowModelUpdated"),this.eventSvc.dispatchEvent({type:"pivotMaxColumnsExceeded",message:f.message}),this.lastTimeFailed=!0;return}throw f}const r=this.setUniqueValues(i),a=this.valueColsSvc?.columns??[],o=a.map(f=>`${f.getId()}-${f.getColDef().headerName}`).join("#"),n=a.map(f=>f.getAggFunc().toString()).join("#"),l=this.aggregationColumnsHashLastTime!==o,c=this.aggregationFuncsHashLastTime!==n;this.aggregationColumnsHashLastTime=o,this.aggregationFuncsHashLastTime=n;const d=(this.rowGroupColsSvc?.columns??[]).map(f=>f.getId()).join("#"),h=d!==this.groupColumnsHashLastTime;this.groupColumnsHashLastTime=d;const u=this.gos.get("pivotRowTotals"),p=this.gos.get("pivotColumnGroupTotals"),g=this.gos.get("suppressExpandablePivotGroups"),m=this.gos.get("removePivotHeaderRowWhenSingleValueColumn"),C=u!==this.pivotRowTotalsLastTime||p!==this.pivotColumnGroupTotalsLastTime||g!==this.suppressExpandablePivotGroupsLastTime||m!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=u,this.pivotColumnGroupTotalsLastTime=p,this.suppressExpandablePivotGroupsLastTime=g,this.removePivotHeaderRowWhenSingleValueColumnLastTime=m,this.lastTimeFailed||r||l||h||c||C){const{pivotColumnGroupDefs:f,pivotColumnDefs:v}=this.pivotColDefSvc.createPivotColumnDefs(this.uniqueValues);this.pivotColumnDefs=v,this.pivotResultCols.setPivotResultCols(f,"rowModelUpdated"),e&&(e.active=!1)}this.lastTimeFailed=!1}setUniqueValues(e){const t=JSON.stringify(e),s=JSON.stringify(this.uniqueValues);return t!==s?(this.uniqueValues=e,!0):!1}bucketUpRowNodes(e){this.currentUniqueCount=0;const t={};e.forEachChangedNodeDepthFirst(i=>{i.leafGroup&&(i.childrenMapped=null)});const s=i=>{i.leafGroup?this.bucketRowNode(i,t):i.childrenAfterFilter?.forEach(s)};return e.executeFromRootNode(s),t}bucketRowNode(e,t){const s=this.pivotColsSvc?.columns;s?.length===0?e.childrenMapped=null:e.childrenMapped=this.bucketChildren(e.childrenAfterFilter,s,0,t),e.sibling&&(e.sibling.childrenMapped=e.childrenMapped)}bucketChildren(e,t=[],s,i){const r={},a=t[s];if(e.forEach(o=>{let n=this.valueSvc.getKeyForNode(a,o);if(wE(n)&&(n=""),!i[n]){this.currentUniqueCount+=1,i[n]={};const l=this.maxUniqueValues!==-1,c=this.currentUniqueCount>this.maxUniqueValues;if(l&&c)throw Error($l)}r[n]||(r[n]=[]),r[n].push(o)}),s===t.length-1)return r;{const o={};for(const n of Object.keys(r))o[n]=this.bucketChildren(r[n],t,s+1,i[n]);return o}}getPivotColumnDefs(){return this.pivotColumnDefs}},Yl={moduleName:"SharedPivot",version:R,beans:[SE,gE,Wn],apiFunctions:{isPivotMode:tE,getPivotResultColumn:sE,setValueColumns:iE,getValueColumns:rE,removeValueColumns:aE,addValueColumns:oE,setPivotColumns:nE,removePivotColumns:lE,addPivotColumns:cE,getPivotColumns:dE,setPivotResultColumns:hE,getPivotResultColumns:uE},dependsOn:[ol,eE]},Xl={moduleName:"Pivot",version:R,rowModels:["clientSide"],beans:[xE],dependsOn:[Yl,Fr,Ns]};import{ChangedPath as TE,_error as ME,_getRowIdCallback as PE,_warn as ql}from"ag-grid-community";import{AbstractClientSideNodeManager as FE,RowNode as AE,_ROW_ID_PREFIX_ROW_GROUP as RE,_warn as EE}from"ag-grid-community";import{_EmptyArray as we}from"ag-grid-community";var IE=(e,t)=>e.treeNode.sourceIdx-t.treeNode.sourceIdx,DE=we.values(),LE=class ca{constructor(t,s){this.parent=t,this.key=s,this.children=null,this.invalidatedHead=null,this.invalidatedNext=void 0,this.row=null,this.oldRow=null,this.duplicateRows=null,this.childrenAfterGroup=we,this.allLeafChildren=we,this.childrenChanged=!1,this.leafChildrenChanged=!1,this.sourceIdx=-1}get size(){return this.children?.size??0}isEmptyFillerNode(){return!this.row?.data&&!this.children?.size}enumChildren(){return this.children?.values()??DE}upsertKey(t){typeof t!="string"&&(t=String(t));let s=this.children?.get(t);return s||(s=new ca(this,t),(this.children??(this.children=new Map))?.set(s.key,s)),s}appendKey(t){const s=this.children;typeof t!="string"&&(t=String(t));let i=s?.get(t);return i?(s.delete(t),s.set(t,i)):(i=new ca(this,t),(this.children??(this.children=new Map))?.set(i.key,i)),i}destroy(){const{row:t,parent:s}=this;t!==null&&t.treeNode===this&&(t.treeNode=null),s!==null&&(this.parent=null,s.children?.delete(this.key))}setRow(t){const s=this.row;return s===t?!1:(s!==null&&(s.treeNode=null),t!==null&&(t.treeNode=this),this.row=t,!0)}removeRow(t){const{row:s,duplicateRows:i}=this;if(s===t){if(this.row=null,i!==null)for(const r of i){this.row=r,i.delete(r);break}}else if(!i?.delete(t))return!1;return i?.size===0&&(this.duplicateRows=null),t.treeNode=null,!0}addDuplicateRow(t){let s=this.duplicateRows;if(s===null)s=new Set,this.duplicateRows=s;else if(s.has(t))return!1;return s.add(t),t.treeNode=this,t.childrenAfterGroup=we,t.allLeafChildren=we,!0}sortFirstDuplicateRow(){const t=this.duplicateRows,s=this.row;if(!s||!t)return s;let i=s;for(const r of t)r.sourceRowIndex1||!t.row?.data)&&(t.childrenChanged=!0,t.invalidate())}getNewSourceIdx(){const t=this.row;return t?.data?t.sourceRowIndex:this.childrenAfterGroup[0]?.treeNode?.sourceIdx??this.sourceIdx}updateChildrenAfterGroup(t,s){this.childrenChanged=!1;const i=t&&this.children?.size;if(!i)return this.childrenAfterGroup.length===0?!1:(this.childrenAfterGroup=s?[]:we,this.leafChildrenChanged=!0,!0);let r=!1,a=this.childrenAfterGroup;a===we?(a=new Array(i),this.childrenAfterGroup=a,r=!0):a.length!==i&&(a.length=i,r=!0);let o=0,n=-1,l=!1;for(const c of this.enumChildren()){const d=c.getNewSourceIdx();d=o||a[n]!==p)&&(a[n]=p,i=!0),++n}else c.data&&((n>=o||a[n]!==c)&&(a[n]=c,i=!0),++n)}o!==n&&(a.length=n,i=!0)}i&&t&&(t.leafChildrenChanged=!0)}},kE=e=>(e.treeNodeFlags&1)!==0,Zl=e=>(e.treeNodeFlags&2)!==0,Jl=e=>(e.treeNodeFlags&4)!==0,GE=e=>(e.treeNodeFlags&8)!==0,Ql=e=>(e.treeNodeFlags&16)!==0,ec=(e,t)=>{t?e.treeNodeFlags|=2:e.treeNodeFlags&=-3},OE=e=>{const t=e.treeNodeFlags;t&1&&(e.treeNodeFlags=t|4)},NE=e=>{const t=e.treeNodeFlags;t&1&&(e.treeNodeFlags=t|12)},xe=e=>{e&&(e.treeNodeFlags|=16)},tc=e=>{const t=e.level<0,s=e.treeNodeFlags,i=(s&1)!==0;if(e.treeNodeFlags=1|s&-29,!i||t){const r=e.childrenAfterGroup;e.childrenAfterFilter=r,e.childrenAfterAggFilter=r,e.childrenAfterSort=r}if(t){const r=e.sibling;r&&(r.childrenAfterGroup=e.childrenAfterGroup,r.childrenMapped=e.childrenMapped)}},qt=e=>{e.treeNodeFlags=0},BE=(e,t,s)=>{if(t!==s&&t!==null&&t.group&&Zl(t)&&!e.isGroupOpenByDefault)return t.expanded;const i=e.isGroupOpenByDefault;return i?i({rowNode:s,field:s.field,key:s.key,level:s.level,rowGroupColumn:s.rowGroupColumn})==!0:e.expandByDefault===-1||s.level0,d=c||!r.data;o!==d?(xe(r),Vo(r,this.beans,d),!d&&!r.expanded&&ec(r,!1)):r.hasChildren()!==c&&(xe(r),r.updateHasChildren()),d&&!Zl(r)&&(r.expanded=BE(e,a,r),ec(r,!0)),Jl(r)&&(xe(i.row),GE(r)&&r.setData(r.data))}a!==r&&(t.oldRow=r,a!==null&&(o||t.size!==0)&&xe(r),i.childrenChanged=!0,xe(i.row)),Ql(r)&&(this.treeData?e.activeChangedPath?.addParentNode(r):xe(e.rootNode)),tc(r),t.duplicateRows?.size&&!t.duplicateRowsWarned&&(t.duplicateRowsWarned=!0,EE(186,{rowId:r.id,rowData:r.data,duplicateRowsData:Array.from(t.duplicateRows).map(c=>c.data)})),s&&r.rowIndex!==null&&r.clearRowTopAndRowIndex();const n=t.getNewSourceIdx(),l=t.sourceIdx;l!==n&&(t.sourceIdx=n,l!==-1&&(i.childrenChanged=!0))}createFillerRow(e,t){const s=new AE(this.beans);s.key=e.key,s.group=!0,s.field=null,s.leafGroup=!1,s.rowGroupIndex=null,s.allChildrenCount=null;let i=t+"-"+e.key,r=e.parent;for(;r!==null;){const a=r.parent;if(a===null)break;--t,i=`${t}-${r.key}-${i}`,r=a}return s.id=RE+i,s}setGroupData(e,t){const s={};e.groupData=s;const i=this.beans.showRowGroupCols?.getShowRowGroupCols();if(i)for(const r of i)s[r.getColId()]=t}treeClear(e){const{parent:t,oldRow:s}=e;if(t!==null&&s!==null&&(t.childrenChanged=!0,t.row!==null&&xe(t.row)),e!==this.treeRoot){let i=e.row;for(;i!==null&&e.removeRow(i);)this.destroyRow(i,!i.data),i=e.row}for(const i of e.enumChildren())this.treeClear(i);e.destroy()}treeDestroy(e){const{row:t,duplicateRows:s}=e;if(t&&(e!==this.treeRoot&&!t.data?this.destroyRow(t,!0):qt(t)),s)for(const i of s)e!==this.treeRoot&&!i.data?this.destroyRow(i,!0):qt(i);for(const i of e.enumChildren())this.treeDestroy(i);e.destroy()}destroyRow(e,t){if(e.isSelected())t=!1;else if(!kE(e)){qt(e);return}if(!t){(this.rowsPendingDestruction??(this.rowsPendingDestruction=new Set)).add(e);return}qt(e),e.clearRowTopAndRowIndex(),e.groupData=null}commitDestroyedRows(){const{rowsPendingDestruction:e}=this;let t=null;if(e!==null){for(const s of e)this.destroyRow(s,!0),s.isSelected()&&(t??(t=[])).push(s);this.rowsPendingDestruction=null}t&&this.deselectNodes(t)}refreshModel(e,t){if(t&&this.treeCommitPending&&this.treeCommit(e.changedPath),!!e.afterColumnsChanged)if(this.treeData){const s=this.beans.showRowGroupCols?.getShowRowGroupCols()?.map(i=>i.getId()).join("-")??"";if(this.oldGroupDisplayColIds!==s){this.oldGroupDisplayColIds=s;const i=this.rootNode?.childrenAfterGroup;if(i)for(let r=0,a=i.length??0;r{if(typeof e!="string"||!e.length)return[];const t=e.split(".");return t.includes("__proto__")?[]:t},VE=e=>{const t=_E(e);let s=null;const i=t.length-1;return i===0?s=r=>r?.[e]:i>0?s=r=>{let a=r;for(let o=0;o<=i&&a!==null&&a!==void 0;++o)if(a=a[t[o]],o{},s.path=e,s},HE=class extends sc{constructor(){super(...arguments),this.beanName="csrmChildrenTreeNodeSvc",this.childrenGetter=null}get treeData(){return this.gos.get("treeData")}extractRowData(){const e=this.treeRoot;return e&&Array.from(e.enumChildren(),t=>t.row.data)}destroy(){super.destroy(),this.childrenGetter=null}activate(e){const t=this.childrenGetter,s=this.gos.get("treeDataChildrenField");(!t||t.path!==s)&&(this.childrenGetter=VE(s)),super.activate(e)}updateRowData(e,t){return ql(268),{changedRowNodes:t,rowNodeTransaction:{add:[],remove:[],update:[]},rowsInserted:!1}}loadNewRowData(e){const t=this.treeRoot,s=this.rootNode,i=this.childrenGetter,r=new Map,a=[];s.allLeafChildren=a,this.treeClear(t),this.treeSetRootNode(s);const o=(n,l)=>{let c=r.get(l);if(c!==void 0){ME(2,{nodeId:c.id});return}c=this.createRowNode(l,a.length),r.set(l,c),a.push(c),n=n.upsertKey(c.id),this.treeSetRow(n,c,!0);const d=i?.(l);if(d)for(let h=0,u=d.length;h{const P=w?.length;let F=!0,A=-1;for(let M=0;M=0&&(L{for(let P=0,F=w.length;P{let P=l.get(w);if(P!==void 0)return ql(2,{nodeId:P.id}),-1;const F=o({data:w,level:T});let A=!1;P=this.getRowNode(F),P?P.data!==w&&(d.update(P),P.updateData(w),!P.selectable&&P.isSelected()&&p.push(P)):(P=this.createRowNode(w,-1),d.add(P),A=!0),l.set(w,P);let M,L;n?(L=S.appendKey(P.id),M=P.sourceRowIndex,P.sourceRowIndex=u.push(P)-1):(L=S.upsertKey(P.id),M=-1),this.treeSetRow(L,P,A)&&(m=!0);const I=a?.(w);return I&&v(L,I,T+1),M};if(v(i,t,0),h)for(let S=0,w=h.length;S{for(const T of w.enumChildren()){const P=T.row;P&&(P.sourceRowIndex=u.push(P)-1,S(T))}};S(i)}r.allLeafChildren=u,i.allLeafChildren=u,p.length&&this.deselectNodes(p),this.treeCommitPending=!0;const x=r.sibling;x&&(x.allLeafChildren=u),(m||g)&&(e.rowDataUpdated=!0,e.rowNodesOrderChanged||(e.rowNodesOrderChanged=g))}refreshModel(e,t){const s=this.rootNode;if(s&&e.changedProps?.has("treeData")&&!e.newData){this.treeSetRootNode(s);const i=this.treeRoot,r=s.allLeafChildren;if(r)for(let a=0,o=r.length;a{YE(190,{rowGroupId:e.rowGroupColumn?.getId(),data:e.data})},"SSBlock-BadKey"),this.gos.get("groupAllowUnbalanced")&&e.key===""){const r=this.serverSideRowModel.getParams();e.childStore=this.createBean(this.storeFactory.createStore(r,e))}ac(this.beans.gos)({node:e})&&(be(e,this.beans),e.sibling&&(e.sibling.uiLevel=e.uiLevel+1))}setMasterDetailInfo(e){const t=this.gos.get("isRowMaster");t!=null?e.master=t(e.data):e.master=!0}updateDataIntoRowNode(e,t){e.updateData(t),this.gos.get("treeData")?(this.setTreeGroupInfo(e),this.setChildCountIntoRowNode(e)):e.group?(this.setChildCountIntoRowNode(e),e.footer||(ac(this.beans.gos)({node:e})?e.sibling?e.sibling.updateData(t):be(e,this.beans):e.sibling&&Cr(e))):this.gos.get("masterDetail")}setDataIntoRowNode(e,t,s,i){e.stub=!1;const r=this.gos.get("treeData");e.setDataAndId(t,s),r?this.setTreeGroupInfo(e):e.group?this.setRowGroupInfo(e):this.gos.get("masterDetail")&&this.setMasterDetailInfo(e),(r||e.group)&&(this.setGroupDataIntoRowNode(e),this.setChildCountIntoRowNode(e)),Nr(t)&&(e.setRowHeight(oc(this.beans,e,!1,i).height),e.sibling?.setRowHeight(oc(this.beans,e.sibling,!1,i).height))}setChildCountIntoRowNode(e){const t=this.gos.get("getChildCount");t&&e.setAllChildrenCount(t(e.data))}setGroupDataIntoRowNode(e){const t=this.showRowGroupCols?.getShowRowGroupCols()??[],s=this.gos.get("treeData");t.forEach(i=>{if(e.groupData==null&&(e.groupData={}),s)e.groupData[i.getColId()]=e.key;else if(i.isRowGroupDisplayed(e.rowGroupColumn.getId())){const r=this.valueSvc.getValue(e.rowGroupColumn,e);e.groupData[i.getColId()]=r}})}clearDisplayIndex(e){e.clearRowTopAndRowIndex(),e.hasChildren()&&!!e.childStore&&e.childStore?.clearDisplayIndexes(),e.master&&e.detailNode&&e.detailNode?.clearRowTopAndRowIndex()}setDisplayIndex(e,t,s,i){const r=this.gos.get("groupAllowUnbalanced")&&e.group&&e.key==="";if(this.gos.get("groupHideOpenParents")&&e.group&&e.expanded||r?(e.setRowIndex(null),e.setRowTop(null)):(e.setRowIndex(t.value++),e.setRowTop(s.value),s.value+=e.rowHeight),e.setUiLevel(i),e.footer)return;if(e.master&&(e.expanded&&e.detailNode?(e.detailNode.setRowIndex(t.value++),e.detailNode.setRowTop(s.value),s.value+=e.detailNode.rowHeight):e.detailNode&&e.detailNode.clearRowTopAndRowIndex()),e.hasChildren()&&!!e.childStore){const l=e.childStore;e.expanded||r?l.setDisplayIndexes(t,s,r?i:i+1):l.clearDisplayIndexes()}}extractRowBounds(e,t){const s=i=>({rowHeight:i.rowHeight,rowTop:i.rowTop});if(e.rowIndex===t)return s(e);if(e.hasChildren()&&e.expanded&&e.childStore){const i=e.childStore;if(i.isDisplayIndexInStore(t))return i.getRowBounds(t)}else if(e.master&&e.expanded&&e.detailNode&&e.detailNode.rowIndex===t)return s(e.detailNode)}isPixelInNodeRange(e,t){return!Nr(e.rowTop)||!Nr(e.rowHeight)?!1:t>=e.rowTop&&t=0;)s.key===""?t.push(XE):t.push(s.key),s=s.parent;if(t.length>0)return t.reverse().join("-")}checkOpenByDefault(e){return this.expansionSvc?.checkOpenByDefault(e)}};import{BeanStub as ZE,RowNode as JE,_exists as Br,_getRowHeightForNode as QE,_isServerSideRowModel as e0,_missing as t0}from"ag-grid-community";var s0=class extends ZE{constructor(){super(...arguments),this.beanName="ssrmExpandListener"}wireBeans(e){this.serverSideRowModel=e.rowModel,this.storeFactory=e.ssrmStoreFactory}postConstruct(){e0(this.gos)&&this.addManagedEventListeners({rowGroupOpened:this.onRowGroupOpened.bind(this)})}onRowGroupOpened(e){const t=e.node;if(t.expanded){if(t.master)this.createDetailNode(t);else if(t0(t.childStore)){const s=this.serverSideRowModel.getParams();t.childStore=this.createBean(this.storeFactory.createStore(s,t))}}else this.gos.get("purgeClosedRowNodes")&&Br(t.childStore)&&(t.childStore=this.destroyBean(t.childStore));this.eventSvc.dispatchEvent({type:"storeUpdated"})}createDetailNode(e){if(Br(e.detailNode))return e.detailNode;const t=new JE(this.beans);t.detail=!0,t.selectable=!1,t.parent=e,Br(e.id)&&(t.id="detail_"+e.id),t.data=e.data,t.level=e.level+1;const s=200,i=QE(this.beans,t).height;return t.rowHeight=i||s,e.detailNode=t,t}};import{BeanStub as i0,_isServerSideRowModel as r0}from"ag-grid-community";var a0=class extends i0{constructor(){super(...arguments),this.beanName="ssrmFilterListener"}wireBeans(e){this.serverSideRowModel=e.rowModel,this.filterManager=e.filterManager,this.listenerUtils=e.ssrmListenerUtils}postConstruct(){r0(this.gos)&&this.addManagedEventListeners({advancedFilterEnabledChanged:()=>this.onFilterChanged(!0),filterChanged:()=>this.onFilterChanged()})}onFilterChanged(e){const t=this.serverSideRowModel.getParams();if(!t)return;const s=t.filterModel;let i,r;if(this.filterManager?.isAdvFilterEnabled()){i=this.filterManager.getAdvFilterModel();const l=e?Object.keys(s??{}):this.getAdvancedFilterColumns(s),c=this.getAdvancedFilterColumns(i);l.forEach(d=>c.add(d)),r=Array.from(c)}else if(i=this.filterManager?.getFilterModel()??{},e){const l=this.getAdvancedFilterColumns(s);Object.keys(i).forEach(c=>l.add(c)),r=Array.from(l)}else r=this.findChangedColumns(s,i);const a=this.listenerUtils.isSortingWithValueColumn(r),o=this.listenerUtils.isSortingWithSecondaryColumn(r),n={valueColChanged:a,secondaryColChanged:o,changedColumns:r};this.serverSideRowModel.refreshAfterFilter(i,n)}findChangedColumns(e,t){const s={};Object.keys(e).forEach(r=>s[r]=!0),Object.keys(t).forEach(r=>s[r]=!0);const i=[];return Object.keys(s).forEach(r=>{const a=JSON.stringify(e[r]),o=JSON.stringify(t[r]);a!=o&&i.push(r)}),i}getAdvancedFilterColumns(e){const t=new Set;if(!e)return t;const s=i=>{i.filterType==="join"?i.conditions.forEach(r=>s(r)):t.add(i.colId)};return s(e),t}};import{BeanStub as o0}from"ag-grid-community";var n0=class extends o0{constructor(){super(...arguments),this.beanName="ssrmListenerUtils"}wireBeans(e){this.pivotResultCols=e.pivotResultCols,this.valueColsSvc=e.valueColsSvc}isSortingWithValueColumn(e){const t=(this.valueColsSvc?.columns??[]).map(s=>s.getColId());for(let s=0;s-1)return!0;return!1}isSortingWithSecondaryColumn(e){const t=this.pivotResultCols?.getPivotResultCols();if(!t)return!1;const s=t.list.map(i=>i.getColId());for(let i=0;i-1)return!0;return!1}};import{BeanStub as l0,_isServerSideRowModel as c0}from"ag-grid-community";var d0=class extends l0{constructor(){super(...arguments),this.beanName="ssrmSortSvc"}wireBeans(e){this.sortSvc=e.sortSvc,this.serverSideRowModel=e.rowModel,this.listenerUtils=e.ssrmListenerUtils}postConstruct(){c0(this.gos)&&this.addManagedEventListeners({sortChanged:this.onSortChanged.bind(this)})}onSortChanged(){const e=this.serverSideRowModel.getParams();if(!e)return;const t=this.sortSvc.getSortModel(),s=e.sortModel,i=this.findChangedColumnsInSort(t,s),r=this.listenerUtils.isSortingWithValueColumn(i),a=this.listenerUtils.isSortingWithSecondaryColumn(i),o={valueColChanged:r,secondaryColChanged:a,changedColumns:i};this.serverSideRowModel.refreshAfterSort(t,o)}findChangedColumnsInSort(e,t){let s=[];[e,t].forEach(a=>{if(a){const o=a.map(n=>n.colId);s=s.concat(o)}});const i=(a,o)=>{const n=a?a.sort:null,l=o?o.sort:null;return n!==l},r=(a,o)=>{const n=a?t.indexOf(a):-1,l=o?e.indexOf(o):-1;return n!==l};return s.filter(a=>{const o=t.find(l=>l.colId===a),n=e.find(l=>l.colId===a);return i(o,n)||r(o,n)})}};import{BeanStub as h0,_warn as u0}from"ag-grid-community";var p0=class extends h0{constructor(){super(...arguments),this.beanName="ssrmNodeManager",this.rowNodes={}}addRowNode(e){const t=e.id;this.rowNodes[t]&&u0(187,{rowId:t,firstData:this.rowNodes[t].data,secondData:e.data}),this.rowNodes[t]=e}removeNode(e){const t=e.id;this.rowNodes[t]&&(this.rowNodes[t]=void 0)}destroy(){this.clear(),super.destroy()}clear(){this.rowNodes={},super.destroy()}};import{BeanStub as g0,RowNode as m0,_debounce as f0,_getRowHeightAsNumber as C0,_getRowHeightForNode as Zt,_isGetRowHeightFunction as v0,_isRowSelection as y0,_jsonEquals as S0,_warn as b0}from"ag-grid-community";var w0=class extends g0{constructor(){super(...arguments),this.beanName="rowModel",this.pauseStoreUpdateListening=!1,this.started=!1,this.managingPivotResultColumns=!1,this.onRowHeightChanged_debounced=f0(this,this.onRowHeightChanged.bind(this),100)}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.pivotResultCols=e.pivotResultCols,this.rowGroupColsSvc=e.rowGroupColsSvc,this.pivotColsSvc=e.pivotColsSvc,this.valueColsSvc=e.valueColsSvc,this.filterManager=e.filterManager,this.sortSvc=e.sortSvc,this.rowRenderer=e.rowRenderer,this.nodeManager=e.ssrmNodeManager,this.storeFactory=e.ssrmStoreFactory,this.pivotColDefSvc=e.pivotColDefSvc}ensureRowHeightsValid(){return!1}start(){this.started=!0,this.updateDatasource()}destroyDatasource(){this.datasource&&(this.datasource.destroy&&this.datasource.destroy(),this.rowRenderer.datasourceChanged(),this.datasource=void 0)}postConstruct(){const e=this.resetRootStore.bind(this);this.addManagedEventListeners({newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.onStoreUpdated.bind(this),columnValueChanged:e,columnPivotChanged:e,columnRowGroupChanged:e,columnPivotModeChanged:e}),this.addManagedPropertyListeners(["masterDetail","treeData","removePivotHeaderRowWhenSingleValueColumn","cacheBlockSize"],e),this.addManagedPropertyListener("groupAllowUnbalanced",()=>this.onStoreUpdated()),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights()),this.verifyProps(),this.addManagedPropertyListener("serverSideDatasource",()=>this.updateDatasource())}updateDatasource(){const e=this.gos.get("serverSideDatasource");e&&this.setDatasource(e)}verifyProps(){y0(this.gos)&&!this.gos.exists("getRowId")&&b0(188)}setDatasource(e){this.started&&(this.destroyDatasource(),this.datasource=e,this.resetRootStore())}applyRowData(e,t,s){const i=this.getRootStore();if(!i)return;const r=i.getChildStore(s);r&&r.applyRowData(e,t,e.rowData.length)}isLastRowIndexKnown(){const e=this.getRootStore();return e?e.isLastRowIndexKnown():!1}onColumnEverything(){if(!this.storeParams){this.resetRootStore();return}const e=this.columnsToValueObjects(this.rowGroupColsSvc?.columns),t=this.columnsToValueObjects(this.valueColsSvc?.columns),s=this.columnsToValueObjects(this.pivotColsSvc?.columns),i=c=>{const d={};c.oldCols.forEach(p=>d[p.id]=p);const h=c.newCols.every(p=>{const g=d[p.id];return g&&delete d[p.id],g&&g.field===p.field&&g.aggFunc===p.aggFunc}),u=!c.allowRemovedColumns&&!!Object.values(d).length;return h&&!u},r=!S0(this.storeParams.sortModel,this.sortSvc?.getSortModel()??[]),a=!i({oldCols:this.storeParams.rowGroupCols,newCols:e}),o=!i({oldCols:this.storeParams.pivotCols,newCols:s}),n=!!e?.length&&!i({oldCols:this.storeParams.valueCols,newCols:t,allowRemovedColumns:!0});if(r||a||o||n)this.resetRootStore();else{const c=this.createStoreParams();this.storeParams.rowGroupCols=c.rowGroupCols,this.storeParams.pivotCols=c.pivotCols,this.storeParams.valueCols=c.valueCols}}destroyRootStore(){!this.rootNode||!this.rootNode.childStore||(this.rootNode.childStore=this.destroyBean(this.rootNode.childStore),this.nodeManager.clear())}refreshAfterSort(e,t){this.storeParams&&(this.storeParams.sortModel=e);const s=this.getRootStore();s&&(s.refreshAfterSort(t),this.onStoreUpdated())}generateSecondaryColumns(e){if(!this.pivotColDefSvc){this.gos.assertModuleRegistered("SharedPivot",2);return}const t=this.pivotColDefSvc.createColDefsFromFields(e);this.managingPivotResultColumns=!0,this.pivotResultCols?.setPivotResultCols(t,"rowModelUpdated")}resetRowHeights(){const e=this.resetRowHeightsForAllRowNodes(),t=Zt(this.beans,this.rootNode);if(this.rootNode.setRowHeight(t.height,t.estimated),this.rootNode.sibling){const s=Zt(this.beans,this.rootNode.sibling);this.rootNode.sibling.setRowHeight(s.height,s.estimated)}e&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{const s=Zt(this.beans,t);t.setRowHeight(s.height,s.estimated);const i=t.detailNode;if(i){const r=Zt(this.beans,i);i.setRowHeight(r.height,r.estimated)}if(t.sibling){const r=Zt(this.beans,t.sibling);i?.setRowHeight(r.height,r.estimated)}e=!0}),e}resetRootStore(){this.destroyRootStore(),this.rootNode=new m0(this.beans),this.rootNode.group=!0,this.rootNode.level=-1,this.datasource&&(this.storeParams=this.createStoreParams(),this.rootNode.childStore=this.createBean(this.storeFactory.createStore(this.storeParams,this.rootNode)),this.updateRowIndexesAndBounds()),this.managingPivotResultColumns&&(this.pivotResultCols?.setPivotResultCols(null,"api"),this.managingPivotResultColumns=!1),this.dispatchModelUpdated(!0)}columnsToValueObjects(e=[]){return e.map(t=>({id:t.getId(),aggFunc:t.getAggFunc(),displayName:this.colNames.getDisplayNameForColumn(t,"model"),field:t.getColDef().field}))}createStoreParams(){const e=this.columnsToValueObjects(this.rowGroupColsSvc?.columns),t=this.columnsToValueObjects(this.valueColsSvc?.columns),s=this.columnsToValueObjects(this.pivotColsSvc?.columns),i=v0(this.gos);return{valueCols:t,rowGroupCols:e,pivotCols:s,pivotMode:this.colModel.isPivotMode(),filterModel:this.filterManager?.isAdvFilterEnabled()?this.filterManager?.getAdvFilterModel():this.filterManager?.getFilterModel()??{},sortModel:this.sortSvc?.getSortModel()??[],datasource:this.datasource,lastAccessedSequence:{value:0},dynamicRowHeight:i}}getParams(){return this.storeParams}dispatchModelUpdated(e=!1){this.eventSvc.dispatchEvent({type:"modelUpdated",animate:!e,keepRenderedRows:!e,newPage:!1,newData:!1})}onStoreUpdated(){this.pauseStoreUpdateListening||(this.updateRowIndexesAndBounds(),this.dispatchModelUpdated())}onRowHeightChanged(){this.updateRowIndexesAndBounds(),this.dispatchModelUpdated()}updateRowIndexesAndBounds(){const e=this.getRootStore();e&&e.setDisplayIndexes({value:0},{value:0},0)}retryLoads(){const e=this.getRootStore();e&&(e.retryLoads(),this.onStoreUpdated())}getRow(e){const t=this.getRootStore();if(t)return t.getRowUsingDisplayIndex(e)}setPaused(e){this.pauseStoreUpdateListening=e}expandAll(e){this.pauseStoreUpdateListening=!0,this.forEachNode(t=>{t.stub||t.hasChildren()&&t.setExpanded(e)}),this.pauseStoreUpdateListening=!1,this.onStoreUpdated()}refreshAfterFilter(e,t){this.storeParams&&(this.storeParams.filterModel=e);const s=this.getRootStore();s&&(s.refreshAfterFilter(t),this.onStoreUpdated())}getRootStore(){return this.rootNode?.childStore}getRowCount(){const e=this.getRootStore();return e?e.getDisplayIndexEnd():0}getTopLevelRowCount(){const e=this.getRootStore();return e?e.getRowCount():1}getTopLevelRowDisplayedIndex(e){const t=this.getRootStore();return t?t.getTopLevelRowDisplayedIndex(e):e}getRowBounds(e){const t=this.getRootStore();return t?t.getRowBounds(e):{rowTop:0,rowHeight:C0(this.beans)}}getBlockStates(){const e=this.getRootStore();if(!e)return;const t={};return e.forEachStoreDeep(s=>{const i=s.getBlockStates();for(const r of Object.keys(i))t[r]=i[r]}),t}getRowIndexAtPixel(e){const t=this.getRootStore();return e<=0||!t?0:t.getRowIndexAtPixel(e)}isEmpty(){return!1}isRowsToRender(){return this.getRootStore()!=null&&this.getRowCount()>0}getType(){return"serverSide"}forEachNode(e){const t=this.getRootStore();t&&t.forEachNodeDeep(e)}forEachDisplayedNode(e){const t=(s,i)=>{s.stub||!s.displayed||e(s,i)};this.forEachNode(t)}forEachNodeAfterFilterAndSort(e,t=!1){const s=this.getRootStore();s&&s.forEachNodeDeepAfterFilterAndSort(e,void 0,t)}executeOnStore(e,t){if(!this.started)return!1;const s=this.getRootStore();if(!s)return!0;const i=s.getChildStore(e);return i&&t(i),!0}refreshStore(e={}){const t=e.route?e.route:[];this.executeOnStore(t,s=>s.refreshStore(e.purge==!0))}getStoreState(){const e=[],t=this.getRootStore();return t&&t.addStoreStates(e),e}getNodesInRangeForSelection(e,t){const s=e.rowIndex,i=t.rowIndex;if(s===null&&i===null)return[];if(i===null)return e?[e]:[];if(s===null)return[t];const r=[],[a,o]=[s,i].sort((n,l)=>n-l);return this.forEachNode(n=>{const l=n.rowIndex;l==null||n.stub||l>=a&&l<=o&&r.push(n)}),r.length!==o-a+1?null:r}getRowNode(e){let t;return this.forEachNode(s=>{s.id===e&&(t=s),s.detailNode&&s.detailNode.id===e&&(t=s.detailNode)}),t}isRowPresent(e){return!!this.getRowNode(e.id)}setRowCount(e,t){const s=this.getRootStore();s&&s.setRowCount(e,t)}destroy(){this.destroyDatasource(),this.destroyRootStore(),super.destroy()}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}};import{_getServerSideRowModel as Xs,_warn as x0}from"ag-grid-community";function T0(e){return e.selectionSvc?.getSelectionState()??null}function M0(e,t){e.selectionSvc?.setSelectionState(t,"api")}function P0(e,t){return e.ssrmTxnManager?.applyTransaction(t)}function F0(e,t){const s=t.startRow??0,i=t.route??[];if(s<0){x0(189,{startRow:s});return}Xs(e)?.applyRowData(t.successParams,s,i)}function A0(e,t,s){return e.ssrmTxnManager?.applyTransactionAsync(t,s)}function R0(e){Xs(e)?.retryLoads()}function E0(e){return e.ssrmTxnManager?.flushAsyncTransactions()}function I0(e,t){Xs(e)?.refreshStore(t)}function D0(e){return Xs(e)?.getStoreState()??[]}var L0=class extends Yn{constructor(){super(...arguments),this.beanName="expansionSvc",this.queuedRowIds=new Set}wireBeans(e){this.serverSideRowModel=e.rowModel}postConstruct(){this.addManagedEventListeners({columnRowGroupChanged:()=>{this.queuedRowIds.clear()}})}checkOpenByDefault(e){if(!e.isExpandable())return;if(this.queuedRowIds.has(e.id)){this.queuedRowIds.delete(e.id),e.setExpanded(!0);return}const t=this.gos.getCallback("isServerSideGroupOpenByDefault");if(!t)return;const s={data:e.data,rowNode:e};t(s)&&e.setExpanded(!0)}expandRows(e){e.forEach(t=>{const s=this.serverSideRowModel.getRowNode(t);s?s.setExpanded(!0):this.queuedRowIds.add(t)})}expandAll(e){this.serverSideRowModel.expandAll(e)}onGroupExpandedOrCollapsed(){}dispatchExpandedEvent(e){this.eventSvc.dispatchEvent(e)}};import{BaseSelectionService as k0,_error as G0,_getGroupSelectsDescendants as nc,_getRowSelectionMode as lc,_isMultiRowSelection as O0,_isRowSelection as qs,_isUsingNewRowSelectionAPI as N0,_warn as Ze}from"ag-grid-community";import{BeanStub as B0,_error as Zs,_isMultiRowSelection as cc,_isUsingNewRowSelectionAPI as _0,_warn as Js}from"ag-grid-community";var _r=class extends B0{constructor(){super(...arguments),this.selectedState={selectAll:!1,toggledNodes:new Set},this.selectAllUsed=!1,this.selectedNodes={}}getSelectedState(){return{selectAll:this.selectedState.selectAll,toggledNodes:[...this.selectedState.toggledNodes]}}setSelectedState(e){if(typeof e!="object"){Zs(116);return}if(!("selectAll"in e)){Zs(116);return}if(typeof e.selectAll!="boolean"){Zs(117);return}if(!("toggledNodes"in e)||!Array.isArray(e.toggledNodes))return Js(197);const t={selectAll:e.selectAll,toggledNodes:new Set};e.toggledNodes.forEach(i=>{typeof i=="string"?t.toggledNodes.add(i):Js(196,{key:i})});const s=t.selectAll||t.toggledNodes.size>1;if(_0(this.gos)&&!cc(this.gos)&&s){Js(130);return}this.selectedState=t}deleteSelectionStateFromParent(e,t){if(this.selectedState.toggledNodes.size===0)return!1;let s=!1;return t.forEach(i=>{this.selectedState.toggledNodes.delete(i)&&(s=!0)}),s}setNodesSelected(e){const{nodes:t,clearSelection:s,newValue:i}=e;if(t.length===0)return 0;const r=s&&i;if(!cc(this.gos)||r){if(t.length>1)return Zs(130),0;const o=t[0],n=o.footer?o.sibling:o;return i&&n.selectable?(this.selectedNodes={[n.id]:n},this.selectedState={selectAll:!1,toggledNodes:new Set([n.id])}):(this.selectedNodes={},this.selectedState={selectAll:!1,toggledNodes:new Set}),1}const a=(o,n=i)=>{const l=o.footer?o.sibling:o;n&&l.selectable?this.selectedNodes[l.id]=l:delete this.selectedNodes[l.id],n===this.selectedState.selectAll||!l.selectable?this.selectedState.toggledNodes.delete(l.id):this.selectedState.toggledNodes.add(l.id)};return t.forEach(o=>a(o)),1}processNewRow(e){this.selectedNodes[e.id]&&(this.selectedNodes[e.id]=e)}isNodeSelected(e){const t=this.selectedState.toggledNodes.has(e.id);return this.selectedState.selectAll?!t:t}getSelectedNodes(){return this.selectAllUsed&&Js(199),Object.values(this.selectedNodes)}getSelectedRows(){return this.getSelectedNodes().map(e=>e.data)}getSelectionCount(){return this.selectedState.selectAll?-1:this.selectedState.toggledNodes.size}isEmpty(){return!this.selectedState.selectAll&&!this.selectedState.toggledNodes?.size}selectAllRowNodes(){this.selectedState={selectAll:!0,toggledNodes:new Set},this.selectedNodes={},this.selectAllUsed=!0}deselectAllRowNodes(){this.selectedState={selectAll:!1,toggledNodes:new Set},this.selectedNodes={}}getSelectAllState(){return this.selectedState.selectAll?this.selectedState.toggledNodes.size>0?null:!0:this.selectedState.toggledNodes.size>0?null:!1}};import{BeanStub as V0,_error as Je,_isMultiRowSelection as H0,_warn as z0}from"ag-grid-community";var Vr=class extends V0{constructor(){super(...arguments),this.selectedState={selectAllChildren:!1,toggledNodes:new Map}}wireBeans(e){this.rowModel=e.rowModel,this.rowGroupColsSvc=e.rowGroupColsSvc,this.filterManager=e.filterManager,this.selectionSvc=e.selectionSvc}postConstruct(){this.addManagedEventListeners({modelUpdated:()=>this.removeRedundantState(),columnRowGroupChanged:()=>this.selectionSvc.reset("rowGroupChanged")})}getSelectedState(){const e=this.gos.get("treeData"),t=(s,i,r)=>{const a={nodeId:r};if((e||this.rowGroupColsSvc&&i<=this.rowGroupColsSvc?.columns.length)&&(a.selectAllChildren=s.selectAllChildren),s.toggledNodes.size){const o=[];s.toggledNodes.forEach((n,l)=>{const c=t(n,i+1,l);o.push(c)}),a.toggledNodes=o}return a};return t(this.selectedState,0)}setSelectedState(e){if("selectAll"in e){Je(111);return}const t=(s,i)=>{if(typeof s!="object")throw Je(243),new Error;if("selectAllChildren"in s&&typeof s.selectAllChildren!="boolean")throw Je(244),new Error;if("toggledNodes"in s){if(!Array.isArray(s.toggledNodes))throw Je(245),new Error;if(!s.toggledNodes.every(l=>typeof l=="object"&&"nodeId"in l&&typeof l.nodeId=="string"))throw Je(246),new Error}const r=s.selectAllChildren??!i,a=s.toggledNodes?.map(n=>[n.nodeId,t(n,r)]);if(a?.some(([,n])=>r===n.selectAllChildren&&n.toggledNodes.size===0))throw Je(247),new Error;return{selectAllChildren:r,toggledNodes:new Map(a)}};try{this.selectedState=t(e,!!e.selectAllChildren)}catch{}}deleteSelectionStateFromParent(e,t){let s=this.selectedState;const i=[...e];for(;s&&i.length;)s=s.toggledNodes.get(i.pop());if(!s)return!1;let r=!1;return t.forEach(a=>{s?.toggledNodes.delete(a)&&(r=!0)}),r&&this.removeRedundantState(),r}setNodesSelected({nodes:e,newValue:t,clearSelection:s}){if(e.length===0)return 0;const i=s&&t;if(!H0(this.gos)||i){if(e.length>1)return Je(130),0;this.deselectAllRowNodes()}return e.forEach(r=>{const a=r.footer?r.sibling:r,o=this.getRouteToNode(a);this.recursivelySelectNode(o,this.selectedState,t)}),this.removeRedundantState(),1}isNodeSelected(e){const t=this.getRouteToNode(e);return this.isNodePathSelected(t,this.selectedState)}isNodePathSelected([e,...t],s){if(t.length===0){const i=s.toggledNodes.has(e.id);if(e.hasChildren()){const r=s.toggledNodes.get(e.id);if(r&&r.toggledNodes.size)return}return s.selectAllChildren?!i:i}if(s.toggledNodes.has(e.id)){const i=s.toggledNodes.get(e.id);if(i)return this.isNodePathSelected(t,i)}return s.selectAllChildren}getRouteToNode(e){const t=[];let s=e;for(;s.parent;)t.push(s),s=s.parent;return t.reverse()}removeRedundantState(){if(this.filterManager?.isAnyFilterPresent())return;const e=(t=this.selectedState,s,i)=>{if(t.toggledNodes.forEach((o,n)=>{e(o,n,t)}),s){const n=this.rowModel.getRowNode(s)?.childStore;if(n?.isLastRowIndexKnown()&&t.toggledNodes.size>=n.getRowCount()){for(const d of t.toggledNodes.entries()){const[h,u]=d;if(u.toggledNodes.size>0||!this.rowModel.getRowNode(h))return}t.selectAllChildren=!t.selectAllChildren,t.toggledNodes.clear()}}const r=t.toggledNodes.size===0,a=i?.selectAllChildren===t.selectAllChildren;r&&a&&i?.toggledNodes.delete(s)};e()}recursivelySelectNode([e,...t],s,i){if(!e)return;if(!t.length){const n=e.selectable;if(s.selectAllChildren===i||!n){s.toggledNodes.delete(e.id);return}const c={selectAllChildren:i,toggledNodes:new Map};s.toggledNodes.set(e.id,c);return}const a=s.toggledNodes.has(e.id),o=s.toggledNodes.get(e.id)??{selectAllChildren:s.selectAllChildren,toggledNodes:new Map};a||s.toggledNodes.set(e.id,o),this.recursivelySelectNode(t,o,i),s.selectAllChildren===o.selectAllChildren&&o.toggledNodes.size===0&&s.toggledNodes.delete(e.id)}getSelectedNodes(){z0(202);const e=[];return this.rowModel.forEachNode(t=>{t.isSelected()&&e.push(t)}),e}processNewRow(){}getSelectedRows(){return this.getSelectedNodes().map(e=>e.data)}getSelectionCount(){return-1}isEmpty(){return!this.selectedState.selectAllChildren&&!this.selectedState.toggledNodes?.size}selectAllRowNodes(){this.selectedState={selectAllChildren:!0,toggledNodes:new Map}}deselectAllRowNodes(){this.selectedState={selectAllChildren:!1,toggledNodes:new Map}}getSelectAllState(){return this.selectedState.selectAllChildren?this.selectedState.toggledNodes.size>0?null:!0:this.selectedState.toggledNodes.size>0?null:!1}},U0=class extends k0{constructor(){super(...arguments),this.beanName="selectionSvc"}postConstruct(){super.postConstruct(),this.addManagedPropertyListeners(["groupSelectsChildren","rowSelection"],()=>{const s=nc(this.gos),i=s&&this.selectionStrategy instanceof _r?Vr:!s&&this.selectionStrategy instanceof Vr?_r:void 0;i&&(this.destroyBean(this.selectionStrategy),this.selectionStrategy=this.createManagedBean(new i),this.shotgunResetNodeSelectionState(),this.dispatchSelectionChanged("api"))}),this.addManagedPropertyListeners(["rowSelection"],()=>{const s=lc(this.gos);s!==this.selectionMode&&(this.selectionMode=s,this.deselectAllRowNodes({source:"api"}))}),this.selectionMode=lc(this.gos);const t=nc(this.gos)?Vr:_r;this.selectionStrategy=this.createManagedBean(new t)}handleSelectionEvent(e,t,s){if(this.isRowSelectionBlocked(t))return 0;let i=0;const r=this.inferNodeSelections(t,e.shiftKey,e.metaKey||e.ctrlKey,s);return r==null?0:(this.selectionCtx.selectAll=!1,"select"in r?(r.reset?this.selectionStrategy.deselectAllRowNodes({source:"api"}):this.selectionStrategy.setNodesSelected({nodes:r.deselect,newValue:!1,source:s}),i=this.selectionStrategy.setNodesSelected({nodes:r.select,newValue:!0,source:s})):i=this.selectionStrategy.setNodesSelected({nodes:[r.node],newValue:r.newValue,clearSelection:r.clearSelection,event:e,source:s}),this.shotgunResetNodeSelectionState(),this.dispatchSelectionChanged(s),i)}getSelectionState(){return this.selectionStrategy.getSelectedState()}setSelectionState(e,t){if(!qs(this.gos)){Ze(132);return}Array.isArray(e)||(this.selectionStrategy.setSelectedState(e),this.shotgunResetNodeSelectionState(),this.dispatchSelectionChanged(t))}setNodesSelected(e){if(!qs(this.gos)&&e.newValue)return Ze(132),0;const{nodes:t,...s}=e;if(t.length>1&&this.selectionMode!=="multiRow")return Ze(130),0;const i={nodes:t.filter(a=>a.selectable),...s};if(!i.nodes.length)return 0;const r=this.selectionStrategy.setNodesSelected(i);return this.shotgunResetNodeSelectionState(i.source),this.dispatchSelectionChanged(i.source),r}deleteSelectionStateFromParent(e,t){this.selectionStrategy.deleteSelectionStateFromParent(e,t)&&(this.shotgunResetNodeSelectionState(),this.dispatchSelectionChanged("api"))}shotgunResetNodeSelectionState(e){this.beans.rowModel.forEachNode(t=>{if(t.stub)return;const s=this.selectionStrategy.isNodeSelected(t);s!==t.isSelected()&&this.selectRowNode(t,s,void 0,e)})}getSelectedNodes(){return this.selectionStrategy.getSelectedNodes()}getSelectedRows(){return this.selectionStrategy.getSelectedRows()}getSelectionCount(){return this.selectionStrategy.getSelectionCount()}syncInRowNode(e){this.selectionStrategy.processNewRow(e);const t=this.selectionStrategy.isNodeSelected(e);if(t!=!1&&!e.selectable){this.selectionStrategy.setNodesSelected({nodes:[e],newValue:!1,source:"api"}),this.shotgunResetNodeSelectionState(),this.dispatchSelectionChanged("api");return}e.__selected=t}reset(){this.selectionStrategy.deselectAllRowNodes({source:"api"}),this.selectionCtx.reset()}isEmpty(){return this.selectionStrategy.isEmpty()}hasNodesToSelect(){return!0}selectAllRowNodes(e){if(!qs(this.gos)){Ze(132);return}if(dc(e),N0(this.gos)&&!O0(this.gos))return Ze(130);this.selectionStrategy.selectAllRowNodes(e),this.selectionCtx.selectAll=!0,this.beans.rowModel.forEachNode(t=>{t.stub||this.selectRowNode(t,!0,void 0,e.source)}),this.dispatchSelectionChanged(e.source)}deselectAllRowNodes(e){dc(e),this.selectionStrategy.deselectAllRowNodes(e),this.selectionCtx.selectAll=!1,this.beans.rowModel.forEachNode(t=>{t.stub||this.selectRowNode(t,!1,void 0,e.source)}),this.dispatchSelectionChanged(e.source)}getSelectAllState(e){return this.selectionStrategy.getSelectAllState(e)}getBestCostNodeSelection(){return Ze(194,{method:"getBestCostNodeSelection"})}updateSelectable(){if(!qs(this.gos))return;const e=[];this.beans.rowModel.forEachNode(t=>{!this.updateRowSelectable(t,!0)&&t.isSelected()&&e.push(t)}),e.length&&this.setNodesSelected({nodes:e,newValue:!1,source:"selectableChanged"})}updateSelectableAfterGrouping(){return G0(194,{method:"updateSelectableAfterGrouping"})}refreshMasterNodeState(){}setDetailSelectionState(){}};function dc({selectAll:e}){(e==="filtered"||e==="currentPage")&&Ze(195,{justCurrentPage:e==="currentPage"})}import{BeanStub as K0}from"ag-grid-community";var W0=class extends K0{constructor(){super(...arguments),this.beanName="rowChildrenSvc"}getHasChildrenValue(e){const t=this.gos.get("treeData"),s=this.gos.get("isServerSideGroup");return!e.stub&&!e.footer&&(t?!!s&&s(e.data):!!e.group)}};import{BeanStub as j0,_addGridCommonParams as $0,_getMaxConcurrentDatasourceRequests as Y0}from"ag-grid-community";var X0=class extends j0{constructor(){super(...arguments),this.beanName="lazyBlockLoadingSvc",this.outboundRequests=0,this.cacheLoadingNodesMap=new Map,this.isCheckQueued=!1,this.nextBlockToLoad=void 0}wireBeans(e){this.rowRenderer=e.rowRenderer,this.rowModel=e.rowModel}postConstruct(){this.maxOutboundRequests=Y0(this.gos)}subscribe(e){this.cacheLoadingNodesMap.set(e,new Set)}unsubscribe(e){this.cacheLoadingNodesMap.delete(e)}queueLoadCheck(){this.isCheckQueued||(this.isCheckQueued=!0,window.queueMicrotask(()=>{this.queueLoadAction(),this.isCheckQueued=!1}))}onLoadComplete(){this.outboundRequests-=1,this.queueLoadCheck()}hasAvailableLoadBandwidth(){return this.maxOutboundRequests===void 0?!0:this.outboundRequests{i.isAlive()&&(this.loaderTimeout=void 0,this.attemptLoad(i,s,r),this.nextBlockToLoad=void 0)},this.gos.get("blockLoadDebounceMillis"))}}attemptLoad(e,t,s){this.hasAvailableLoadBandwidth()&&(this.executeLoad(e,t,s),this.queueLoadCheck())}executeLoad(e,t,s){const i=e.getSsrmParams(),r={startRow:t,endRow:s,rowGroupCols:i.rowGroupCols,valueCols:i.valueCols,pivotCols:i.pivotCols,pivotMode:i.pivotMode,groupKeys:e.store.getParentNode().getRoute()??[],filterModel:i.filterModel,sortModel:i.sortModel},a=this.cacheLoadingNodesMap.get(e),o=()=>{for(let h=0;h{for(let h=0;h{this.onLoadComplete(),e.onLoadSuccess(t,s-t,h),o()},c=()=>{this.onLoadComplete(),e.onLoadFailed(t,s-t),o()},d=$0(this.gos,{request:r,success:l,fail:c,parentNode:e.store.getParentNode()});n(),this.outboundRequests+=1,e.getSsrmParams().datasource?.getRows(d)}getBlockToLoad(){const e=this.rowRenderer.firstRenderedRow,t=this.rowRenderer.lastRenderedRow;for(let n=e;n<=t;n++){const l=this.rowModel.getRow(n);if(!l)continue;const c=l.parent?.childStore;if(!c)continue;const d=c.getCache(),h=d.getNodes().getBy("node",l);if(!(!h||this.cacheLoadingNodesMap.get(d)?.has(h.index))&&(l.__needsRefreshWhenVisible||l.stub&&!l.failedLoad))return{cache:d,index:d.getBlockStartIndex(h.index)}}let s=null,i=null,r=Number.MAX_SAFE_INTEGER;for(const n of this.cacheLoadingNodesMap.keys())n.getNodesToRefresh().forEach(c=>{if(c.rowIndex==null){i=c,s=n;return}const d=n.getNodes().getBy("node",c);if(!d||this.cacheLoadingNodesMap.get(n)?.has(d.index))return;const u=Math.abs(e-c.rowIndex),p=Math.abs(c.rowIndex-t);u[t,new Map]))}getSize(){return this.maps.get(this.indexes[0]).size}getBy(e,t){return this.maps.get(e).get(t)}set(e){this.indexes.forEach(t=>{this.maps.get(t).set(e[t],e)})}delete(e){this.indexes.forEach(t=>{this.maps.get(t).delete(e[t])})}clear(){this.maps.forEach(e=>e.clear())}getIterator(e){return this.maps.get(e).values()}forEach(e){const t=this.getIterator(this.indexes[0]);let s;for(;(s=t.next())&&!s.done;)e(s.value)}find(e){const t=this.getIterator(this.indexes[0]);let s;for(;(s=t.next())&&!s.done;)if(e(s.value))return s.value}filter(e){const t=this.getIterator(this.indexes[0]);let s;const i=[];for(;(s=t.next())&&!s.done;)e(s.value)&&i.push(s.value);return i}},aI=100,zr=class extends eI{constructor(e,t,s,i){super(),this.live=!0,this.removedNodeCache=new Map,this.store=e,this.numberOfRows=t,this.isLastRowKnown=s,this.storeParams=i}wireBeans(e){this.rowRenderer=e.rowRenderer,this.blockUtils=e.ssrmBlockUtils,this.focusSvc=e.focusSvc,this.nodeManager=e.ssrmNodeManager,this.serverSideRowModel=e.rowModel,this.rowNodeSorter=e.rowNodeSorter,this.sortSvc=e.sortSvc,this.lazyBlockLoadingSvc=e.lazyBlockLoadingSvc,this.colModel=e.colModel}postConstruct(){this.lazyBlockLoadingSvc.subscribe(this),this.nodeMap=new rI("index","id","node"),this.nodeDisplayIndexMap=new Map,this.nodesToRefresh=new Set,this.defaultNodeIdPrefix=this.blockUtils.createNodeIdPrefix(this.store.getParentNode()),this.getRowIdFunc=sI(this.gos),this.isMasterDetail=this.gos.get("masterDetail")}destroy(){this.lazyBlockLoadingSvc.unsubscribe(this),this.numberOfRows=0,this.nodeMap.forEach(e=>this.blockUtils.destroyRowNode(e.node)),this.nodeMap.clear(),this.nodeDisplayIndexMap.clear(),this.nodesToRefresh.clear(),this.live=!1,super.destroy()}getRowByDisplayIndex(e){if(!this.store.isDisplayIndexInStore(e))return;const t=this.nodeDisplayIndexMap.get(e);if(t)return(t.stub||t.__needsRefreshWhenVisible)&&this.lazyBlockLoadingSvc.queueLoadCheck(),t;if(this.gos.get("groupHideOpenParents")||this.gos.get("groupAllowUnbalanced")){const l=this.nodeMap.find(c=>!!c.node.childStore?.isDisplayIndexInStore(e));if(l)return l.node.childStore?.getRowUsingDisplayIndex(e)}if(e===this.store.getDisplayIndexStart())return this.createStubNode(0,e);const i=this.nodeDisplayIndexMap.get(e-1);if(i){if(this.isMasterDetail&&i.master&&i.expanded)return i.detailNode;if(i.expanded&&i.childStore?.isDisplayIndexInStore(e))return i.childStore?.getRowUsingDisplayIndex(e);const l=this.nodeMap.getBy("node",i);return this.createStubNode(l.index+1,e)}const r=this.getSurroundingNodesByDisplayIndex(e);if(r==null){const l=this.store.getRowCount()-(this.store.getDisplayIndexEnd()-e);return this.createStubNode(l,e)}const{previousNode:a,nextNode:o}=r;if(a&&a.node.expanded&&a.node.childStore?.isDisplayIndexInStore(e))return a.node.childStore?.getRowUsingDisplayIndex(e);if(o){const l=o.node.rowIndex-e,c=o.index-l;return this.createStubNode(c,e)}const n=this.store.getRowCount()-(this.store.getDisplayIndexEnd()-e);return this.createStubNode(n,e)}createStubNode(e,t){const s=this.store.getRowBounds(t),i=this.createRowAtIndex(e,null,r=>{r.setRowIndex(t),r.setRowTop(s.rowTop),this.nodeDisplayIndexMap.set(t,r)});if(e===0&&this.gos.get("groupHideOpenParents")){const r=this.store.getParentNode().groupData;if(r)for(const a of Object.keys(r))Rs(i,this.colModel,a,r[a])}return this.lazyBlockLoadingSvc.queueLoadCheck(),i}getRowByStoreIndex(e){return this.nodeMap.getBy("index",e)?.node}skipDisplayIndexes(e,t,s){if(e===0)return;const i=tI(this.beans);t.value+=e,s.value+=e*i}setDisplayIndexes(e,t,s){this.nodeDisplayIndexMap.clear();const i={};this.nodeMap.forEach(o=>{i[o.index]=o.node});let r=-1;for(const o of Object.keys(i)){const n=i[o],l=Number(o),c=l-1-r;this.skipDisplayIndexes(c,e,t);const d=l===0;if(n.setFirstChild(d),d&&this.gos.get("groupHideOpenParents")){const h=this.store.getParentNode().groupData;if(h)for(const u of Object.keys(h))Rs(n,this.colModel,u,d?h[u]:void 0)}this.blockUtils.setDisplayIndex(n,e,t,s),n.rowIndex!=null&&this.nodeDisplayIndexMap.set(n.rowIndex,n),r=l}const a=this.numberOfRows-1-r;this.skipDisplayIndexes(a,e,t),this.purgeExcessRows()}getRowCount(){return this.numberOfRows}setRowCount(e,t){this.numberOfRows=e,t!=null&&(this.isLastRowKnown=t,t===!1&&(this.numberOfRows+=1)),this.fireStoreUpdatedEvent()}getNodes(){return this.nodeMap}getNodeCachedByDisplayIndex(e){return this.nodeDisplayIndexMap.get(e)??null}getNodesToRefresh(){return this.nodesToRefresh}getSurroundingNodesByDisplayIndex(e){let t,s;return this.nodeMap.forEach(i=>{if(e>i.node.rowIndex){(s==null||s.node.rowIndexi.node.rowIndex){t=i;return}}),!s&&!t?null:{previousNode:s,nextNode:t}}getDisplayIndexFromStoreIndex(e){const t=this.nodeMap.getBy("index",e);if(t)return t.node.rowIndex;let s,i;if(this.nodeMap.forEach(o=>{if(e>o.index){(i==null||i.indexo.index){s=o;return}}),!s)return this.store.getDisplayIndexEnd()-(this.numberOfRows-e);if(!i)return this.store.getDisplayIndexStart()+e;const r=e-i.index;return(i.node.childStore?.getDisplayIndexEnd()??i.node.rowIndex)+r}createRowAtIndex(e,t,s){const i=this.nodeMap.getBy("index",e);if(i){const{node:a}=i;if(a.__needsRefreshWhenVisible=!1,this.doesNodeMatch(t,a))return this.blockUtils.updateDataIntoRowNode(a,t),this.nodesToRefresh.delete(a),a;if(this.getRowIdFunc==null&&a.hasChildren()&&a.expanded)return this.nodesToRefresh.delete(a),a;this.destroyRowAtIndex(e)}if(t&&this.getRowIdFunc!=null){const a=this.getRowId(t),o=a&&this.removedNodeCache?.get(a);if(o)return this.removedNodeCache?.delete(a),this.blockUtils.updateDataIntoRowNode(o,t),this.nodeMap.set({id:o.id,node:o,index:e}),this.nodesToRefresh.delete(o),o.__needsRefreshWhenVisible=!1,o;const n=this.nodeMap.getBy("id",a);if(n){this.nodeMap.delete(n);const{node:l,index:c}=n;return this.blockUtils.updateDataIntoRowNode(l,t),this.nodeMap.set({id:l.id,node:l,index:e}),this.nodesToRefresh.delete(l),l.__needsRefreshWhenVisible=!1,this.getBlockStartIndex(c)===this.getBlockStartIndex(e)||this.markBlockForVerify(c),l}}const r=this.blockUtils.createRowNode(this.store.getRowDetails());if(t!=null){const a=this.getPrefixedId(this.store.getIdSequence().value++);this.blockUtils.setDataIntoRowNode(r,t,a,void 0),this.serverSideRowModel.setPaused(!0),this.blockUtils.checkOpenByDefault(r),this.serverSideRowModel.setPaused(!1),this.nodeManager.addRowNode(r)}return this.nodeMap.set({id:r.id,node:r,index:e}),s&&s(r),r}getBlockStates(){const e={},t={};this.nodeMap.forEach(({node:a,index:o})=>{const n=this.getBlockStartIndex(o);!a.stub&&!a.failedLoad&&(e[n]=(e[n]??0)+1);let l="loaded";a.failedLoad?l="failed":this.lazyBlockLoadingSvc.isRowLoading(this,n)?l="loading":(this.nodesToRefresh.has(a)||a.stub)&&(l="needsLoading"),t[n]||(t[n]=new Set),t[n].add(l)});const s={loading:4,failed:3,needsLoading:2,loaded:1},i=this.blockUtils.createNodeIdPrefix(this.store.getParentNode()),r={};for(const a of Object.keys(t)){const n=[...t[a]].sort((d,h)=>(s[d]??0)-(s[h]??0))[0],l=Number(a)/this.getBlockSize(),c=i?`${i}-${l}`:String(l);r[c]={blockNumber:l,startRow:Number(a),endRow:Number(a)+this.getBlockSize(),pageStatus:n,loadedRowCount:e[a]??0}}return r}destroyRowAtIndex(e){const t=this.nodeMap.getBy("index",e);t&&(this.nodeMap.delete(t),this.nodeDisplayIndexMap.delete(t.node.rowIndex),this.nodesToRefresh.size>0?this.removedNodeCache.set(t.node.id,t.node):this.blockUtils.destroyRowNode(t.node),this.nodesToRefresh.delete(t.node))}getSsrmParams(){return this.store.getSsrmParams()}getPrefixedId(e){return this.defaultNodeIdPrefix?this.defaultNodeIdPrefix+"-"+e:e.toString()}markBlockForVerify(e){const[t,s]=this.getBlockBounds(e);this.nodeMap.filter(r=>r.index>=t&&r.index{r.__needsRefreshWhenVisible=!0})}doesNodeMatch(e,t){if(t.stub)return!1;const s=this.getRowId(e);return s===null?t.data===e:t.id===s}purgeStubsOutsideOfViewport(){const{firstRenderedRow:e,lastRenderedRow:t}=this.rowRenderer,s=this.getBlockStartIndex(e),[,i]=this.getBlockBounds(t);this.nodeMap.forEach(r=>{this.lazyBlockLoadingSvc.isRowLoading(this,r.index)||r.node.failedLoad||r.node.stub&&(r.indexi)&&this.destroyRowAtIndex(r.index)})}getBlocksDistanceFromRow(e,t){const s={};return e.forEach(({node:i,index:r})=>{const[a,o]=this.getBlockBounds(r);if(a in s)return;const n=Math.abs(i.rowIndex-t);let l;const c=this.nodeMap.getBy("index",[o-1]);c&&(l=Math.abs(c.node.rowIndex-t));const d=l==null||n{const m=this.getBlockStartIndex(p);s.add(m),g.rowIndex>=e&&g.rowIndex<=t&&i.add(m)});const r=Math.max(i.size,this.storeParams.maxBlocksInCache??0),o=s.size-r;if(o<=0)return;let n=Number.MAX_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER;i.forEach(p=>{n>p&&(n=p),l{const m=this.getBlockStartIndex(g);return!(m>=n&&m<=l)&&!this.isNodeCached(p)});if(c.length===0)return;const d=e+(t-e)/2,h=this.getBlocksDistanceFromRow(c,d),u=this.getBlockSize();h.sort((p,g)=>Math.sign(g[1]-p[1]));for(let p=0;p{const r=this.getRowId(i);if(t.has(r)){s.add(r);return}t.add(r)}),[...s]}onLoadSuccess(e,t,s){if(!this.live)return;const i=s.groupLevelInfo;if(this.store.setStoreInfo(i),this.getRowIdFunc!=null){const o=this.extractDuplicateIds(s.rowData);if(o.length>0){const n=o.join(", ");iI(205,{duplicateIdText:n}),this.onLoadFailed(e,t);return}}s.pivotResultFields&&this.serverSideRowModel.generateSecondaryColumns(s.pivotResultFields);const r=this.nodesToRefresh.size>0;if(s.rowData.forEach((o,n)=>{const l=e+n,c=this.nodeMap.getBy("index",l);if(c?.node?.stub){this.createRowAtIndex(l,o);return}if(c&&this.doesNodeMatch(o,c.node)){this.blockUtils.updateDataIntoRowNode(c.node,o),this.nodesToRefresh.delete(c.node),c.node.__needsRefreshWhenVisible=!1;return}this.createRowAtIndex(l,o)}),s.rowCount!=null&&s.rowCount!==-1)this.numberOfRows=s.rowCount,this.isLastRowKnown=!0;else if(t>s.rowData.length)this.numberOfRows=e+s.rowData.length,this.isLastRowKnown=!0;else if(!this.isLastRowKnown){const o=e+s.rowData.length+1;o>this.numberOfRows&&(this.numberOfRows=o)}this.isLastRowKnown&&this.nodeMap.filter(n=>n.index>=this.numberOfRows).forEach(n=>this.destroyRowAtIndex(n.index)),this.fireStoreUpdatedEvent();const a=this.nodesToRefresh.size===0;r&&a&&this.fireRefreshFinishedEvent()}fireRefreshFinishedEvent(){this.nodesToRefresh.size===0&&(this.removedNodeCache.forEach(t=>{this.blockUtils.destroyRowNode(t)}),this.removedNodeCache=new Map,this.store.fireRefreshFinishedEvent())}isStoreFullyLoaded(){const e=this.isLastRowKnown,t=this.nodeMap.getSize()===this.numberOfRows;if(!e||!t||this.nodesToRefresh.size>0)return;let s=-1;return this.nodeMap.find(r=>(s+=1,!!(r.index!==s||r.node.__needsRefreshWhenVisible||r.node.stub)))==null}isLastRowIndexKnown(){return this.isLastRowKnown}onLoadFailed(e,t){if(!this.live)return;const s=this.nodesToRefresh.size>0;for(let r=e;r{e.node.stub&&!e.node.failedLoad||this.nodesToRefresh.add(e.node)}),this.lazyBlockLoadingSvc.queueLoadCheck(),this.isLastRowKnown&&this.numberOfRows===0&&(this.numberOfRows=1,this.isLastRowKnown=!1,this.fireStoreUpdatedEvent())}isNodeInCache(e){return!!this.nodeMap.getBy("id",e)}fireStoreUpdatedEvent(){this.live&&this.store.fireStoreUpdatedEvent()}getRowId(e){if(this.getRowIdFunc==null)return null;const{level:t}=this.store.getRowDetails(),s=this.store.getParentNode().getRoute()??[];return this.getRowIdFunc({data:e,parentKeys:s.length>0?s:void 0,level:t})}getOrderedNodeMap(){const e={};return this.nodeMap.forEach(t=>e[t.index]=t),e}clearDisplayIndexes(){this.nodeDisplayIndexMap.clear()}clientSideSortRows(){const e=this.sortSvc?.getSortOptions()??[];if(!e.some(r=>r.sort!=null)||!this.rowNodeSorter)return;const s=new Array(this.nodeMap.getSize());this.nodeMap.forEach(r=>s[r.index]=r.node),this.nodeMap.clear(),this.rowNodeSorter.doFullSort(s,e).forEach((r,a)=>{this.nodeMap.set({id:r.id,node:r,index:a})})}updateRowNodes(e){const t=[];return e.forEach(s=>{const i=this.getRowId(s),r=this.nodeMap.getBy("id",i);r&&(this.blockUtils.updateDataIntoRowNode(r.node,s),t.push(r.node))}),t}insertRowNodes(e,t){const s=this.store.getRowCount()-(this.store.getParentNode().sibling?1:0),i=t==null&&this.isLastRowKnown?s:t;if(i==null||s{const c=this.getRowId(l);c&&this.isNodeInCache(c)||(r[c]=l)});const a=Object.values(r),o=a.length;if(o===0)return[];const n=this.nodeMap.filter(l=>l.index>=i);return n.forEach(l=>this.nodeMap.delete(l)),n.forEach(l=>{this.nodeMap.set({node:l.node,index:l.index+o,id:l.id})}),this.numberOfRows+=o,a.map((l,c)=>this.createRowAtIndex(i+c,l))}removeRowNodes(e){const t=[],s=[];let i=0;const r=[...e],a=this.getOrderedNodeMap();let o=-1;for(const n of Object.keys(a)){o+=1;const l=a[n],c=r.findIndex(h=>h===l.id);if(c!==-1){r.splice(c,1),this.destroyRowAtIndex(Number(n)),t.push(l.node),i+=1;continue}if(i===0)continue;const d=Number(n);o!==d&&s.push(l.node),this.nodeMap.delete(l),this.nodeMap.set({id:l.id,node:l.node,index:d-i})}return this.numberOfRows-=this.isLastRowIndexKnown()?e.length:i,r.length>0&&s.length>0&&(s.forEach(n=>n.__needsRefreshWhenVisible=!0),this.lazyBlockLoadingSvc.queueLoadCheck()),t}getBlockSize(){return this.storeParams.cacheBlockSize||aI}getBlockStartIndex(e){const t=this.getBlockSize();return e-e%t}getBlockBounds(e){const t=this.getBlockStartIndex(e),s=this.getBlockSize();return[t,t+s]}},oI=class extends Z0{constructor(e,t,s){super(),this.idSequence={value:0},this.ssrmParams=e,this.parentRowNode=s,this.storeParams=t,this.level=s.level+1,this.group=e.rowGroupCols?this.levelt({level:this.level,parentKeys:this.parentRowNode.getRoute()??[],data:u})),h=[...new Set(d)];o=this.cache.removeRowNodes(h)}const n=this.gos.get("serverSideEnableClientSideSort"),l=r?.length||a?.length;return i&&n&&l&&this.cache.clientSideSortRows(),this.updateSelectionAfterTransaction(r,o),{status:Hr.Applied,update:r,add:a,remove:o}}updateSelectionAfterTransaction(e,t){if(!this.selectionSvc)return;const s=[];e?.forEach(i=>{i.isSelected()&&!i.selectable&&s.push(i)}),t?.forEach(i=>{i.isSelected()&&s.push(i)}),s.length&&this.selectionSvc.setNodesSelected({newValue:!1,clearSelection:!1,nodes:s,source:"rowDataChanged"})}clearDisplayIndexes(){this.displayIndexStart=void 0,this.displayIndexEnd=void 0,this.cache.getNodes().forEach(e=>this.blockUtils.clearDisplayIndex(e.node)),this.parentRowNode.sibling&&this.blockUtils.clearDisplayIndex(this.parentRowNode.sibling),this.cache.clearDisplayIndexes()}getDisplayIndexStart(){return this.displayIndexStart}getDisplayIndexEnd(){return this.displayIndexEnd}getRowCount(){return this.parentRowNode.sibling?this.cache.getRowCount()+1:this.cache.getRowCount()}setRowCount(e,t){this.cache.setRowCount(e,t)}isDisplayIndexInStore(e){return this.cache.getRowCount()===0?!1:this.displayIndexStart<=e&&e-1&&uc(this.gos)({node:this.parentRowNode});i||Cr(this.parentRowNode),i==="top"&&(be(this.parentRowNode,this.beans),this.blockUtils.setDisplayIndex(this.parentRowNode.sibling,e,t,s)),this.cache.setDisplayIndexes(e,t,s),i==="bottom"&&(be(this.parentRowNode,this.beans),this.blockUtils.setDisplayIndex(this.parentRowNode.sibling,e,t,s)),this.displayIndexEnd=e.value,this.heightPx=t.value-this.topPx}forEachStoreDeep(e,t={value:0}){e(this,t.value++),this.cache.getNodes().forEach(s=>{const i=s.node.childStore;i&&i.forEachStoreDeep(e,t)})}forEachNodeDeep(e,t={value:0}){this.cache.getNodes().forEach(s=>{e(s.node,t.value++);const i=s.node.childStore;i&&i.forEachNodeDeep(e,t)})}forEachNodeDeepAfterFilterAndSort(e,t={value:0},s=!1){const i=this.parentRowNode.level>-1&&uc(this.gos)({node:this.parentRowNode});i==="top"&&e(this.parentRowNode.sibling,t.value++);const r=this.cache.getOrderedNodeMap();for(const a of Object.values(r)){e(a.node,t.value++);const o=a.node.childStore;o&&o.forEachNodeDeepAfterFilterAndSort(e,t,s)}i==="bottom"&&e(this.parentRowNode.sibling,t.value++)}retryLoads(){this.cache.getNodes().forEach(({node:e})=>{e.failedLoad&&(e.failedLoad=!1,e.__needsRefreshWhenVisible=!0,e.stub=!0)}),this.forEachChildStoreShallow(e=>e.retryLoads()),this.fireStoreUpdatedEvent()}getRowUsingDisplayIndex(e){return this.parentRowNode.sibling&&e===this.parentRowNode.sibling.rowIndex?this.parentRowNode.sibling:this.cache.getRowByDisplayIndex(e)}getRowBounds(e){if(!this.isDisplayIndexInStore(e))return null;const t=this.cache.getNodeCachedByDisplayIndex(e);if(t){const n=this.blockUtils.extractRowBounds(t,e);if(n)return n}const{previousNode:s,nextNode:i}=this.cache.getSurroundingNodesByDisplayIndex(e)??{};if(s){const n=this.blockUtils.extractRowBounds(s.node,e);if(n!=null)return n}const r=pc(this.beans);if(i){const n=(i.node.rowIndex-e)*r;return{rowTop:i.node.rowTop-n,rowHeight:r}}const a=this.topPx+this.heightPx,o=(this.getDisplayIndexEnd()-e)*r;return{rowTop:a-o,rowHeight:r}}isPixelInRange(e){return e>=this.topPx&&e=this.topPx+this.heightPx)return this.getDisplayIndexEnd()-1;if(this.parentRowNode.sibling&&e>this.parentRowNode.sibling.rowTop&&e{const c=Math.abs(e-l.rowTop);if(l.rowTop{const s=this.cache.getNodes().find(i=>i.node.key==t);return s?s.node:null})}forEachChildStoreShallow(e){this.cache.getNodes().forEach(({node:t})=>{t.childStore&&e(t.childStore)})}refreshAfterSort(e){if(this.storeUtils.isServerSideSortAllLevels()||this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,e)){const s=this.cache.isStoreFullyLoaded(),i=this.gos.get("serverSideEnableClientSideSort");if(!(s&&i)){const a=this.cache.getRowCount(),o=this.cache.isLastRowIndexKnown();this.destroyBean(this.cache),this.cache=this.createManagedBean(new zr(this,a,o,this.storeParams));return}this.cache.clientSideSortRows()}this.forEachChildStoreShallow(s=>s.refreshAfterSort(e))}refreshAfterFilter(e){if(!this.storeUtils.isServerSideOnlyRefreshFilteredGroups()||this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,e)){this.refreshStore(!0);return}this.forEachChildStoreShallow(s=>s.refreshAfterFilter(e))}refreshStore(e){if(e){this.destroyBean(this.cache),this.cache=this.createManagedBean(new zr(this,1,!1,this.storeParams)),this.fireStoreUpdatedEvent();return}this.cache.markNodesForRefresh()}getTopLevelRowDisplayedIndex(e){return this.cache.getDisplayIndexFromStoreIndex(e)??e}isLastRowIndexKnown(){return this.cache.isLastRowIndexKnown()}getRowNodesInRange(e,t){return this.cache.getNodes().filter(({node:s})=>s.rowIndex>=e.rowIndex&&s.rowIndex<=t.rowIndex).map(({node:s})=>s)}addStoreStates(e){e.push({route:this.parentRowNode.getRoute()??[],rowCount:this.getRowCount(),lastRowIndexKnown:this.isLastRowIndexKnown(),info:this.info,maxBlocksInCache:this.storeParams.maxBlocksInCache,cacheBlockSize:this.storeParams.cacheBlockSize}),this.forEachChildStoreShallow(t=>t.addStoreStates(e))}getIdSequence(){return this.idSequence}getParentNode(){return this.parentRowNode}getRowDetails(){return{field:this.groupField,group:this.group,leafGroup:this.leafGroup,level:this.level,parent:this.parentRowNode,rowGroupColumn:this.rowGroupColumn}}getSsrmParams(){return this.ssrmParams}setStoreInfo(e){e&&Object.assign(this.info,e)}fireStoreUpdatedEvent(){this.eventSvc.dispatchEvent({type:"storeUpdated"})}fireRefreshFinishedEvent(){this.eventSvc.dispatchEvent({type:"storeRefreshed",route:this.parentRowNode.getRoute()})}getBlockStates(){return this.cache.getBlockStates()}getStoreBounds(){return{topPx:this.topPx,heightPx:this.heightPx}}getCache(){return this.cache}},nI=class extends q0{constructor(){super(...arguments),this.beanName="ssrmStoreFactory"}wireBeans(e){this.colModel=e.colModel,this.rowGroupColsSvc=e.rowGroupColsSvc,this.pivotColsSvc=e.pivotColsSvc,this.rowAutoHeight=e.rowAutoHeight}createStore(e,t){const s=this.getStoreParams(e,t);return new oI(e,s,t)}getStoreParams(e,t){const s=this.getLevelSpecificParams(t),i=this.getBlockSize(s),r=this.getMaxBlocksInCache(e,s);return{cacheBlockSize:i,maxBlocksInCache:r}}getMaxBlocksInCache(e,t){const s=t&&t.maxBlocksInCache!=null?t.maxBlocksInCache:this.gos.get("maxBlocksInCache");if(s!=null&&s>=0){if(e.dynamicRowHeight){hc(203);return}if(this.rowAutoHeight?.active){hc(204);return}return s}}getBlockSize(e){const t=e&&e.cacheBlockSize!=null?e.cacheBlockSize:this.gos.get("cacheBlockSize");return t!=null&&t>0?t:100}getLevelSpecificParams(e){const t=this.gos.getCallback("getServerSideGroupLevelParams");if(!t)return;const s={level:e.level+1,parentRowNode:e.level>=0?e:void 0,rowGroupColumns:this.rowGroupColsSvc?.columns??[],pivotColumns:this.pivotColsSvc?.columns??[],pivotMode:this.colModel.isPivotMode()};return t(s)}};import{BeanStub as lI,_isServerSideRowModel as gc}from"ag-grid-community";var cI=class extends lI{constructor(){super(...arguments),this.beanName="ssrmStoreUtils"}wireBeans(e){this.colModel=e.colModel,this.serverSideRowModel=e.rowModel,this.storeFactory=e.ssrmStoreFactory}getChildStore(e,t,s){if(!e?.length)return t;const i=e[0],r=s(i);if(r){if(e.length===1&&!r.childStore){const n=this.serverSideRowModel.getParams();r.childStore=this.createBean(this.storeFactory.createStore(n,r))}const a=e.slice(1,e.length),o=r.childStore;return o?o.getChildStore(a):null}return null}isServerRefreshNeeded(e,t,s){if(s.valueColChanged||s.secondaryColChanged)return!0;const i=e.level+1;if(!(i-1?!0:this.colModel.getCols().filter(d=>d.getColDef().showRowGroup&&s.changedColumns.includes(d.getId())).map(d=>d.getColDef().showRowGroup).some(d=>d===!0||d===o)}getServerSideInitialRowCount(){return this.gos.get("serverSideInitialRowCount")}isServerSideSortAllLevels(){return this.gos.get("serverSideSortAllLevels")&&gc(this.gos)}isServerSideOnlyRefreshFilteredGroups(){return this.gos.get("serverSideOnlyRefreshFilteredGroups")&&gc(this.gos)}};import{BeanStub as dI,ServerSideTransactionResultStatus as Ct,_isServerSideRowModel as hI}from"ag-grid-community";var uI=class extends dI{constructor(){super(...arguments),this.beanName="ssrmTxnManager",this.asyncTransactions=[]}wireBeans(e){this.valueCache=e.valueCache,this.serverSideRowModel=e.rowModel,this.selectionSvc=e.selectionSvc}postConstruct(){hI(this.gos)}applyTransactionAsync(e,t){this.asyncTransactionsTimeout==null&&this.scheduleExecuteAsync(),this.asyncTransactions.push({transaction:e,callback:t})}scheduleExecuteAsync(){const e=this.gos.get("asyncTransactionWaitMillis");this.asyncTransactionsTimeout=window.setTimeout(()=>{this.executeAsyncTransactions()},e)}executeAsyncTransactions(){if(!this.asyncTransactions)return;const e=[],t=[],s=[];let i=!1;this.asyncTransactions.forEach(r=>{let a;if(this.serverSideRowModel.executeOnStore(r.transaction.route,l=>{a=l.applyTransaction(r.transaction)})?a==null&&(a={status:Ct.StoreNotFound}):a={status:Ct.StoreNotStarted},t.push(a),a.status==Ct.StoreLoading){s.push(r);return}r.callback&&e.push(()=>r.callback(a)),a.status===Ct.Applied&&(i=!0)}),e.length>0&&window.setTimeout(()=>{e.forEach(r=>r())},0),this.asyncTransactionsTimeout=void 0,this.asyncTransactions=s,i&&(this.valueCache?.onDataChanged(),this.eventSvc.dispatchEvent({type:"storeUpdated"})),t.length>0&&this.eventSvc.dispatchEvent({type:"asyncTransactionsFlushed",results:t})}flushAsyncTransactions(){this.asyncTransactionsTimeout!=null&&clearTimeout(this.asyncTransactionsTimeout),this.executeAsyncTransactions()}applyTransaction(e){let t;if(this.serverSideRowModel.executeOnStore(e.route,i=>{t=i.applyTransaction(e)}))if(t){if(this.valueCache?.onDataChanged(),t.remove&&this.selectionSvc){const i=t.remove.map(r=>r.id);this.selectionSvc.deleteSelectionStateFromParent(e.route||[],i)}return this.eventSvc.dispatchEvent({type:"storeUpdated"}),t}else return{status:Ct.StoreNotFound};else return{status:Ct.StoreNotStarted}}},mc={moduleName:"ServerSideRowModel",version:R,rowModels:["serverSide"],beans:[w0,s0,cI,qE,p0,uI,a0,nI,n0,U0,X0,W0,L0,d0],dependsOn:[G,KR,UR,Yl,ic,JR,QR]},fc={moduleName:"ServerSideRowModelApi",version:R,apiFunctions:{getServerSideSelectionState:T0,setServerSideSelectionState:M0,applyServerSideTransaction:P0,applyServerSideTransactionAsync:A0,applyServerSideRowData:F0,retryServerSideLoads:R0,flushServerSideAsyncTransactions:E0,refreshServerSide:I0,getServerSideGroupLevelState:D0},dependsOn:[G,zR,WR]};import{_preInitErrMsg as pI}from"ag-grid-community";var gI=".ag-sparkline-wrapper{height:100%;line-height:normal;position:absolute;top:0;width:100%}:where(.ag-ltr) .ag-sparkline-wrapper{left:0}:where(.ag-rtl) .ag-sparkline-wrapper{right:0}";import{Component as mI,RefPlaceholder as fI,_observeResize as CI}from"ag-grid-community";var Ur=Symbol("WrappedFunctionMarker"),Cc=(e,t)=>{if(e[Ur])return e;const s=(...i)=>t(e,...i);return s[Ur]=Ur,s},vI=["ag-default","ag-material","ag-sheets","ag-polychroma","ag-vivid"],yI=class extends mI{constructor(){super(`
`),this.eSparkline=fI}postConstruct(){this.addManagedPropertyListeners(["chartThemeOverrides","chartThemes"],e=>this.refresh(this.params))}init(e){this.refresh(e);const t=CI(this.beans,this.getGui(),()=>this.refresh(e));this.addDestroyFunc(()=>t())}getThemeName(){return(this.gos.get("chartThemes")||vI)[0]}refresh(e){this.params=e;const{clientWidth:t,clientHeight:s}=this.getGui();if(!this.sparklineInstance&&e&&t>0&&s){this.sparklineOptions={container:this.eSparkline,width:t,height:s,...e.sparklineOptions,data:this.processData(e.value)},this.sparklineOptions.tooltip?.renderer?this.wrapTooltipRenderer():this.sparklineOptions.tooltip={...this.sparklineOptions.tooltip,renderer:r=>({content:this.createDefaultContent(r)})};const i=this.sparklineOptions?.theme;return this.sparklineOptions.type==="bar"&&this.sparklineOptions.itemStyler?this.wrapItemStyler(this.sparklineOptions):i?.overrides?.bar?.series?.itemStyler&&this.wrapItemStyler(i.overrides.bar.series),this.updateTheme(this.sparklineOptions),this.sparklineInstance=e.createSparkline(this.sparklineOptions),!0}else if(this.sparklineInstance){const i=e?.value;return this.sparklineOptions.width=t,this.sparklineOptions.height=s,this.sparklineOptions.data=this.processData(i),this.updateTheme(this.sparklineOptions),this.sparklineInstance.updateDelta(this.sparklineOptions),!0}return!1}updateTheme(e){const t=this.getThemeName();typeof e.theme=="string"||!e.theme?e.theme=t:e.theme&&(e.theme.baseTheme=t)}processData(e=[]){return e.length===0?e:e.filter(t=>t!=null)}createContext(){return{data:this.params?.data,cellData:this.params?.value}}createDefaultContent(e,t){const s=t?.title,i=this.sparklineOptions.xKey,r=Array.isArray(this.sparklineOptions.data?.[0]);return`${!s&&(i||r)?`${e.xValue} `:""}${e.yValue}`}wrapItemStyler(e){e.itemStyler=Cc(e.itemStyler,(t,s)=>t({...s,context:this.createContext()}))}wrapTooltipRenderer(){this.sparklineOptions.tooltip={...this.sparklineOptions.tooltip,renderer:Cc(this.sparklineOptions.tooltip.renderer,(e,t)=>{const s=e({...t,context:this.createContext()});return typeof s=="string"?s:{content:this.createDefaultContent(t,s),...s}})}}destroy(){super.destroy(),this.sparklineInstance?.destroy()}},vc="Sparklines",yc={moduleName:vc,version:R,dependsOn:[G],validate:()=>({isValid:!1,message:pI(258)}),with:e=>(e.setup(),{moduleName:vc,version:R,dependsOn:[G],css:[gI],userComponents:{agSparklineCellRenderer:{classImp:yI,params:{createSparkline:e.createSparkline}}},validate:()=>({isValid:!0})})};import{_PopupModule as SI,_SharedDragAndDropModule as bI,_preInitErrMsg as Sc}from"ag-grid-community";import{BeanStub as wI}from"ag-grid-community";var xI=class extends wI{constructor(e){super(),this.beanName="agChartsExports",this.isEnterprise=!1,this.create=e.create,this._Theme=e._Theme,this._Scene=e._Scene,this.isEnterprise=e.isEnterprise,this._Util=e._Util}};import{BeanStub as TI}from"ag-grid-community";function bc(e){return e.chart!=null?e.chart:e}function Qe(e,t,s){if(e==null)return s;const i=t.split(".");let r=e;for(;i.length>1;)if(r=r[i.shift()],r==null)return s;const a=r[i[0]];return a??s}function MI(e,t,s){if(e==null)return;const i=t.split(".");let r=e;i.forEach((a,o)=>{r[a]||(r[a]={}),o{const y=x=>x?Object.keys(x).some(S=>Qe(x[S],"title.enabled",!1)):!1;return y(u)||y(p)})()):void 0,UI(),i,m,u,p,{...a??{}},r].filter(y=>!!y).reduce((y,x)=>({baseTheme:y,overrides:x}),h);if(o&&c===n){const y=e.agChartsExports._Theme.getChartTheme(h).palette;_I(o,y)||(v.palette=o)}return v}function _I(e,t){const s=(i,r)=>i===r?!0:i?.length!==r?.length?!1:i?.every((a,o)=>a===r?.[o])??!1;return s(e.fills,t.fills)&&s(e.strokes,t.strokes)}function Yr(e,t){return Object.keys(t.themes).includes(e)}function VI(e,t,s){const i={listeners:{legendItemClick:r=>{const a=e.getChart(),o=[r.seriesId,`${r.seriesId}-filtered-out`];a.series.filter(n=>o.includes(n.id)).forEach(n=>n.toggleSeriesItem(void 0,"category",r.itemId,void 0))}}};return{[s]:{tooltip:{delay:500},legend:i,listeners:{click:r=>t.crossFilterCallback(r,!0)}}}}var HI=Fc.reduce((e,t)=>({...e,[t]:{title:{_enabledFromTheme:!0}}}),{});function zI(e,t,s){const i=e.getExtraPaddingDirections();return{common:{...t?{animation:{duration:500}}:void 0,axes:HI,padding:{top:!s&&i.includes("top")?40:20,right:i.includes("right")?30:20,bottom:i.includes("bottom")?40:20,left:i.includes("left")?30:20},suppressFieldDotNotation:!0}}}function UI(){return{pie:{series:{title:{_enabledFromTheme:!0},calloutLabel:{_enabledFromTheme:!0},sectorLabel:{enabled:!1,_enabledFromTheme:!0}}},donut:{series:{title:{_enabledFromTheme:!0},calloutLabel:{_enabledFromTheme:!0},sectorLabel:{enabled:!1,_enabledFromTheme:!0}}}}}function KI(e){let t=e.getChartThemeName();const s=e.getChartThemes();return s.includes(t)||(t=s[0]),t}function Ac(e,t){const{customChartThemes:s}=e,i=s&&s[t];return i||OI(140,{name:t}),i}var vt=class{constructor(e){this.chartProxyParams=e,this.clearThemeOverrides=!1,this.agChartsExports=e.agChartsExports,this.chart=e.chartInstance,this.chartType=e.chartType,this.crossFiltering=e.crossFiltering,this.crossFilterCallback=e.crossFilterCallback,this.standaloneChartType=B(this.chartType),this.chart==null?this.chart=e.agChartsExports.create(this.getCommonChartOptions()):this.clearThemeOverrides=!0}crossFilteringReset(){}update(e){this.getChartRef().update(this.getUpdateOptions(e,this.getCommonChartOptions(e.updatedOverrides)))}updateThemeOverrides(e){this.getChartRef().updateDelta({theme:{overrides:e}})}getChart(){return bc(this.chart)}getChartRef(){return this.chart}downloadChart(e,t,s){const{chart:i}=this,r=bc(i),a=t||(r.title?r.title.text:"chart"),{width:o,height:n}=e||{};i.download({width:o,height:n,fileName:a,fileFormat:s})}getChartImageDataURL(e){return this.getChart().getCanvasDataURL(e)}getChartOptions(){return this.chart.getOptions()}getChartThemeOverrides(){return this.getChartOptions().theme.overrides??{}}getChartPalette(){return this.agChartsExports._Theme.getChartTheme(this.getChartOptions().theme).palette}setPaired(e){const t=B(this.chartProxyParams.chartType);this.chart.updateDelta({theme:{overrides:{[t]:{paired:e}}}})}isPaired(){const e=B(this.chartProxyParams.chartType);return Qe(this.getChartThemeOverrides(),`${e}.paired`,!0)}lookupCustomChartTheme(e){return Ac(this.chartProxyParams,e)}getSeriesGroupType(){}transformCategoryData(e,t){return e.map((s,i)=>{const r=s[t],a=r&&r.toString?r.toString():"",o={...s};return o[t]={id:i,value:r,toString:()=>a},o})}getCommonChartOptions(e){const t=this.clearThemeOverrides?{}:this.chart?.getOptions()??{},s=this.chart!=null?this.getActiveFormattingPanelOverrides():void 0;this.clearThemeOverrides=!1;const i=BI(this.chartProxyParams,this,this.agChartsExports.isEnterprise,this.getChartThemeDefaults(),e??s),r={...t,mode:"integrated"};return r.theme=i,r.container=this.chartProxyParams.parentElement,r}getChartThemeDefaults(){const e=this.getSeriesChartThemeDefaults(),t=e?{[this.standaloneChartType]:e}:{},s={enabled:!0,snap:!0,label:{enabled:!1}},i=this.agChartsExports.isEnterprise?{zoom:{enabled:!0},animation:{enabled:!0,duration:500},axes:{number:{crosshair:s},category:{crosshair:s},log:{crosshair:s},time:{crosshair:s}}}:{};return i.minHeight=0,i.minWidth=0,i.navigator={enabled:!1},{common:i,...t}}getSeriesChartThemeDefaults(){}getActiveFormattingPanelOverrides(){return this.clearThemeOverrides?{}:this.chart?.getOptions().theme?.overrides??{}}destroy({keepChartInstance:e=!1}={}){if(e)return this.chart.resetAnimations(),this.chart;this.destroyChart()}destroyChart(){this.chart&&(this.chart.destroy(),this.chart=void 0)}},Ve=class extends vt{constructor(){super(...arguments),this.crossFilteringAllPoints=new Set,this.crossFilteringSelectedPoints=[]}getUpdateOptions(e,t){const s=this.getAxes(e,t);return{...t,data:this.getData(e,s),axes:s,series:this.getSeries(e)}}getData(e,t){const s=["area","line"].includes(this.standaloneChartType);return this.crossFiltering&&s?this.getCrossFilterData(e):this.getDataTransformedData(e,t)}getDataTransformedData(e,t){const s=t[0].type,{categories:i,data:r}=e,[a]=i;switch(s){case"category":return this.transformCategoryData(r,a.id);case"time":return this.transformTimeData(r,a.id);default:return r}}getXAxisType(e){return e.grouping?"grouped-category":this.isXAxisOfType(e,"time",t=>t instanceof Date)?"time":this.isXAxisOfType(e,"number")?"number":"category"}isXAxisOfType(e,t,s){const[i]=e.categories;if(i?.chartDataType)return i.chartDataType===t;if(!s)return!1;const r=e.data[0];return r?s(r[i.id]):!1}transformTimeData(e,t){return e[0]?.[t]instanceof Date?e:e.map(i=>{const r=i[t];return typeof r=="string"?{...i,[t]:new Date(r)}:i})}crossFilteringReset(){this.crossFilteringSelectedPoints=[],this.crossFilteringAllPoints.clear()}crossFilteringPointSelected(e){return this.crossFilteringSelectedPoints.length==0||this.crossFilteringSelectedPoints.includes(e)}crossFilteringDeselectedPoints(){return this.crossFilteringSelectedPoints.length>0&&this.crossFilteringAllPoints.size!==this.crossFilteringSelectedPoints.length}extractLineAreaCrossFilterSeries(e,t){const[s]=t.categories,i=r=>this.standaloneChartType==="area"?t.getCrossFilteringContext().lastSelectedChartId===t.chartId?r+"-total":r:r+"-total";return e.map(r=>(r.yKey=i(r.yKey),r.listeners={nodeClick:a=>{const o=a.datum[r.xKey],n=a.event.metaKey||a.event.ctrlKey;this.crossFilteringAddSelectedPoint(n,o),this.crossFilterCallback(a)}},r.marker={itemStyler:a=>{const o=a.datum[s.id];return{fill:a.highlighted?"yellow":a.fill,size:a.highlighted?14:this.crossFilteringPointSelected(o)?8:0}}},this.standaloneChartType==="area"&&(r.fillOpacity=this.crossFilteringDeselectedPoints()?.3:1),this.standaloneChartType==="line"&&(r.strokeOpacity=this.crossFilteringDeselectedPoints()?.3:1),r))}getCrossFilterData(e){this.crossFilteringAllPoints.clear();const[t]=e.categories,s=e.fields[0].colId,i=`${s}-filtered-out`,r=e.getCrossFilteringContext().lastSelectedChartId;return e.data.map(a=>{const o=a[t.id];this.crossFilteringAllPoints.add(o);const n=this.crossFilteringPointSelected(o);return this.standaloneChartType==="area"&&r===e.chartId&&(a[`${s}-total`]=n?a[s]:a[s]+a[i]),this.standaloneChartType==="line"&&(a[`${s}-total`]=n?a[s]:a[s]+a[i]),a})}crossFilteringAddSelectedPoint(e,t){e?this.crossFilteringSelectedPoints.push(t):this.crossFilteringSelectedPoints=[t]}isHorizontal(e){const t=this.standaloneChartType;if(t!=="waterfall"&&t!=="box-plot"&&t!=="range-bar")return!1;const s=e.theme,i=r=>{const a=r?.overrides?.[t]?.series?.direction;return a!=null?a==="horizontal":typeof r?.baseTheme=="object"?i(r.baseTheme):!1};return i(s)}},WI=class extends Ve{getSeries(e){const t=e.fields[0];return[{type:this.standaloneChartType,xKey:t.colId,xName:t.displayName,yName:this.chartProxyParams.translate("histogramFrequency"),areaPlot:!1}]}getAxes(e){return[{type:"number",position:"bottom"},{type:"number",position:"left"}]}},jI=class extends Ve{getAxes(e,t){return[{type:this.getXAxisType(e),position:this.isHorizontal(t)?"left":"bottom"},{type:"number",position:this.isHorizontal(t)?"bottom":"left"}]}getSeries(e){const[t]=e.categories,[s]=e.fields;return[{type:this.standaloneChartType,xKey:t.id,xName:t.name,yKey:s.colId,yName:s.displayName??void 0}]}},$I=class extends vt{getUpdateOptions(e,t){return{...t,data:this.transformFunnelCategories(e),series:this.getSeries(e)}}transformFunnelCategories(e){const{data:t}=e,[{id:s}]=e.categories;return t.map((i,r)=>({...i,[s]:{name:i[s],id:r,toString:()=>i[s]}}))}getSeriesChartThemeDefaults(){const e={crosshair:{enabled:!1}};return{axes:{category:e,number:e}}}getSeries(e){const[{id:t}]=e.categories,[{colId:s}]=e.fields;return[{type:this.standaloneChartType,stageKey:t,valueKey:s}]}};import{GROUP_AUTO_COLUMN_ID as YI}from"ag-grid-community";var ei="AG-GRID-DEFAULT-LABEL-KEY";function XI(e,t){const s=Rc(e,i,r);return Xr(s);function i(o){return t.length}function r(o,n){const l=t[n],c=o[l];return a(c)}function a(o){return o==null?null:String(o)}}function qI(e,t){const s=Rc(e,i,r);return Xr(s);function i(a){return t(a)?.length??0}function r(a,o){const n=t(a);if(!n)return null;const l=n.length-1-o;return n[l]}}function Xr(e,t=null,s){const{depth:i,rootValues:r,value:a,children:o}=e;if(r)return r.map(l=>({[ei]:t,...l}));if(i===0)return[{[ei]:t,...a}];const n=[];for(const[l,c]of o.entries())n.push(...Xr(c,l,!0));return s?[{[ei]:t,children:n,...a??{}}]:n}function Rc(e,t,s){const i={depth:0,children:new Map};return e.forEach(a=>{const o=t(a);r(a,o,s,0,i)}),i;function r(a,o,n,l,c){if(l===o)return l===0?(c.rootValues||(c.rootValues=[]),c.rootValues.push(a)):c.value=a,c;{const d=n(a,l),h=c.children.get(d),u=r(a,o,n,l+1,h||{depth:0,children:new Map});return c.children.set(d,u),c.depth=Math.max(1+u.depth,c.depth),c}}}var ZI=class extends vt{getUpdateOptions(e,t){const{fields:s}=e,[i,r]=s;return{...t,series:this.getSeries(i,r),data:this.getData(e,i,r)}}getSeriesChartThemeDefaults(){return{gradientLegend:{gradient:{preferredLength:200}}}}getSeries(e,t){return[{type:this.standaloneChartType,labelKey:ei,sizeKey:e?.colId,sizeName:e?.displayName??void 0,colorKey:t?.colId,colorName:t?.displayName??void 0}]}getData(e,t,s){const{categories:i,data:r,groupData:a,grouping:o}=e;if(o){const n=s?r.concat(a?.map(l=>{const c={...l};return delete c[t.colId],c})??[]):r;return qI(n,l=>l[YI]?.labels??null)}else{const n=i.map(({id:l})=>l);return XI(r,n)}}},JI=class extends vt{getAxes(e){const t=this.standaloneChartType==="radial-bar";return[{type:t?"angle-number":"angle-category"},{type:t?"radius-category":"radius-number"}]}getSeries(e){const{fields:t,categories:s,seriesGroupType:i}=e,[r]=s,a=this.standaloneChartType==="radial-bar",o=this.getSeriesGroupTypeOptions(i);return t.map(n=>({type:this.standaloneChartType,angleKey:a?n.colId:r.id,angleName:a?n.displayName??void 0:r.name,radiusKey:a?r.id:n.colId,radiusName:a?r.name:n.displayName??void 0,...o}))}getSeriesGroupType(){const e=this.standaloneChartType;if(!["nightingale","radial-bar","radial-column"].includes(e))return;const t=this.getChart().series?.[0]?.properties.toJson(),s=()=>t.normalizedTo?"normalized":"stacked";return e==="nightingale"?t.grouped?"grouped":s():t.stacked?s():"grouped"}getUpdateOptions(e,t){const s=this.getAxes(e);return{...t,data:this.getData(e,s),axes:s,series:this.getSeries(e)}}getData(e,t){if(t.some(i=>i.type==="angle-category"||i.type==="radius-category")){const[i]=e.categories;return this.transformCategoryData(e.data,i.id)}else return e.data}getSeriesGroupTypeOptions(e){return e?{grouped:e==="grouped"||void 0,stacked:e!=="grouped"||void 0,normalizedTo:e==="normalized"?100:void 0}:{}}};function QI(e,t){return e.reduce((s,i,r,a)=>s.concat(t(i,r,a)),new Array)}var eD="AG-GRID-DEFAULT-HEATMAP-CATEGORY-KEY",tD="AG-GRID-DEFAULT-HEATMAP-SERIES-KEY",sD="AG-GRID-DEFAULT-HEATMAP-VALUE-KEY",iD=class extends vt{getUpdateOptions(e,t){const s=tD,i=sD,r=eD;return{...t,series:this.getSeries(e,s,i,r),data:this.getData(e,s,i,r)}}getSeries(e,t,s,i){const[r]=e.categories;return[{type:this.standaloneChartType,yKey:i,xKey:t,colorKey:s,yName:r.name,xName:void 0,colorName:void 0}]}getData(e,t,s,i){const[r]=e.categories;return QI(e.data,(a,o)=>{const n=a[r.id],l=n==null?"":String(n),c={id:o,value:n,toString:()=>l};return e.fields.map(({colId:d,displayName:h})=>({...a,[t]:h,[s]:a[d],[i]:c}))})}getSeriesChartThemeDefaults(){return{gradientLegend:{gradient:{preferredLength:200}},series:{tooltip:{renderer:rD}}}}};function rD(e){const{xKey:t,yKey:s,colorKey:i,yName:r,datum:a}=e;return{title:"",data:[{label:r,value:a[s]},{label:a[t],value:i&&a[i]}].map(({label:n,value:l})=>({label:String(n),value:String(l)}))}}import{BeanStub as aD,CellRangeType as Qt}from"ag-grid-community";import{BeanStub as oD,_isClientSideRowModel as nD,_isServerSideRowModel as lD,_last as cD,_warn as Ec}from"ag-grid-community";var dD=class extends oD{wireBeans(e){this.sortSvc=e.sortSvc,this.gridRowModel=e.rowModel,this.colModel=e.colModel,this.valueSvc=e.valueSvc,this.pivotResultCols=e.pivotResultCols,this.rowNodeSorter=e.rowNodeSorter,this.aggStage=e.aggStage}getData(e){if(e.crossFiltering){if(e.grouping)return Ec(141),{chartData:[],colNames:{}};if(!nD(this.gos))return Ec(142),{chartData:[],colNames:{}}}lD(this.gos)&&e.pivoting&&this.updatePivotKeysForSSRM();const s=this.extractRowsFromGridRowModel(e);return s.chartData=this.aggregateRowsByDimension(e,s.chartData),s}extractRowsFromGridRowModel(e){const{crossFiltering:t,startRow:s,endRow:i,valueCols:r,dimensionCols:a,grouping:o}=e;let n=[];const l={},c={},d={};let h={},u=[],p;if(t)h=this.getFilteredRowNodes(),u=this.getAllRowNodes(),p=u.length;else{const f=this.gridRowModel.getRowCount()-1;s===i&&s===0&&a.length===0&&r.length===0?p=0:p=(i>=0?Math.min(i,f):f)-s+1}p>0&&r.forEach(f=>{let v=[];const y=f.getColDef().pivotKeys;y&&(v=y.slice());const x=f.getColDef().headerName;x&&v.push(x),v.length>0&&(l[f.getId()]=v)});let g=0,m=0;for(let f=0;f{const S=x.colId,w=this.colModel.getCol(S);if(w){const T=this.valueSvc.getValue(w,v);if(o){const P=T?.toString?String(T.toString()):"",F=this.getGroupLabels(v,P),A=F.slice().reverse();y[S]={value:A,id:m++,toString:()=>A.filter(Boolean).join(" - ")},v.group&&(c[F.toString()]=f-g);const M=F.slice(1,F.length).toString();M&&(d[M]=c[M])}else y[S]=T}else y[me]=f+1}),r.forEach(x=>{const S=x.getColId();if(t){const w=S+"-filtered-out",T=this.valueSvc.getValue(x,v),P=T!=null&&typeof T.toNumber=="function"?T.toNumber():T;h[v.id]?(y[S]=P,y[w]=e.aggFunc||e.isScatter?void 0:0):(y[S]=e.aggFunc||e.isScatter?void 0:0,y[w]=P)}else{let w=this.valueSvc.getValue(x,v);w&&Object.prototype.hasOwnProperty.call(w,"toString")&&(w=parseFloat(w.toString())),y[S]=w!=null&&typeof w.toNumber=="function"?w.toNumber():w}}),n.push(y)}let C;if(o){const f=Object.values(d),v=n;n=[],C=[];for(let y=0;y{let l=a;s.forEach(c=>{const d=c.colId,h=n[d];if(d===r){let u=l[h];u||(u={__children:[]},s.forEach(p=>{const g=p.colId;u[g]=n[g]}),l[h]=u,o.push(u)),u.__children.push(n)}else l[h]||(l[h]={}),l=l[h]})}),this.gos.assertModuleRegistered("SharedRowGrouping",1)){const n=this.aggStage;o.forEach(l=>e.valueCols.forEach(c=>{if(e.crossFiltering)e.valueCols.forEach(d=>{const h=d.getColId(),u=l.__children.filter(f=>typeof f[h]<"u").map(f=>f[h]),p=n.aggregateValues(u,e.aggFunc);l[d.getId()]=p&&typeof p.value<"u"?p.value:p;const g=`${h}-filtered-out`,m=l.__children.filter(f=>typeof f[g]<"u").map(f=>f[g]),C=n.aggregateValues(m,e.aggFunc);l[g]=C&&typeof C.value<"u"?C.value:C});else{const d=l.__children.map(u=>u[c.getId()]),h=n.aggregateValues(d,e.aggFunc);l[c.getId()]=h&&typeof h.value<"u"?h.value:h}}))}return o}updatePivotKeysForSSRM(){const e=this.pivotResultCols?.getPivotResultCols()?.list;if(!e)return;const t=this.extractPivotKeySeparator(e);e.forEach(s=>{if(t==="")s.getColDef().pivotKeys=[];else{const i=s.getColId().split(t);s.getColDef().pivotKeys=i.slice(0,i.length-1)}})}extractPivotKeySeparator(e){if(e.length===0)return"";const t=(i,r)=>{const a=i.getGroupId();return i.getParent()?t(i.getParent(),a):r.split(a)[1][0]},s=e[0];return s.getParent()==null?"":t(s.getParent(),s.getColId())}getGroupLabels(e,t){const s=[t];for(;e&&e.level!==0;)e=e.parent,e&&s.push(e.key);return s}getFilteredRowNodes(){const e={};return this.gridRowModel.forEachNodeAfterFilterAndSort(t=>{e[t.id]=t}),e}getAllRowNodes(){const e=[];return this.gridRowModel.forEachNode(t=>{e.push(t)}),this.sortRowNodes(e)}sortRowNodes(e){const t=this.sortSvc?.getSortOptions();return!t||t.length==0||!this.rowNodeSorter?e:this.rowNodeSorter.doFullSort(e,t)}};import{BeanStub as hD,_getRowNode as uD,_warn as Ic}from"ag-grid-community";var pD=class extends hD{constructor(){super(...arguments),this.beanName="chartColSvc",this.valueColsWithoutSeriesType=new Set}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.valueSvc=e.valueSvc}postConstruct(){const e=()=>this.valueColsWithoutSeriesType.clear();this.addManagedEventListeners({newColumnsLoaded:e,rowDataUpdated:e})}getColumn(e){return this.colModel.getColDefCol(e)}getAllDisplayedColumns(){return this.beans.visibleCols.allCols}getColDisplayName(e,t){const s="chart",i=this.colNames.getDisplayNameForColumn(e,s);if(t){const r=[i],a=o=>{if(!o)return;const n=this.colNames.getDisplayNameForColumnGroup(o,s);n?.length&&(r.unshift(n),a(o.getParent()))};return a(e.getParent()),r.join(" - ")}return i}getRowGroupColumns(){return this.beans.rowGroupColsSvc?.columns??[]}getGroupDisplayColumns(){return this.beans.showRowGroupCols?.getShowRowGroupCols()??[]}isPivotMode(){return this.colModel.isPivotMode()}isPivotActive(){return this.colModel.isPivotActive()}getChartColumns(){const e=this.colModel.getCols(),t=new Set,s=new Set;return e.forEach(i=>{const r=i.getColDef(),a=r.chartDataType;if(a)switch(a){case"category":case"time":t.add(i);return;case"series":s.add(i);return;case"excluded":return;default:Ic(153,{chartDataType:a});break}if(r.colId==="ag-Grid-AutoColumn"){t.add(i);return}if(!i.isPrimary()){s.add(i);return}(this.isInferredValueCol(i)?s:t).add(i)}),{dimensionCols:t,valueCols:s}}isInferredValueCol(e){const t=e.getColId();if(t==="ag-Grid-AutoColumn")return!1;const s=uD(this.beans,{rowIndex:0,rowPinned:null});if(!s)return this.valueColsWithoutSeriesType.has(t);let i=this.valueSvc.getValue(e,s);i==null&&(i=this.extractLeafData(s,e)),i!=null&&typeof i.toNumber=="function"&&(i=i.toNumber());const r=typeof i=="number"||e.colDef.cellDataType==="number"||["series","time"].includes(e.colDef.chartDataType);return r?this.valueColsWithoutSeriesType.add(t):i==null&&e.colDef.cellDataType!=="number"&&Ic(265,{colId:t}),r}extractLeafData(e,t){if(!e.allLeafChildren)return null;for(let s=0;s0;(this.chartDataModel.chartType==="customCombo"||e)&&(this.chartDataModel.chartType="customCombo",this.savedCustomSeriesChartTypes=this.seriesChartTypes||[])}updateSeriesChartTypes(){if(this.chartDataModel.isComboChart()){if(this.seriesChartTypes=this.seriesChartTypes.map(e=>{const t=["groupedColumn","stackedColumn","stackedArea"].includes(e.chartType);return e.secondaryAxis=t?!1:e.secondaryAxis,e}),this.chartDataModel.chartType==="customCombo"){this.updateSeriesChartTypesForCustomCombo();return}this.updateChartSeriesTypesForBuiltInCombos()}}updateSeriesChartTypesForCustomCombo(){!(this.seriesChartTypes&&this.seriesChartTypes.length>0)&&!this.suppressComboChartWarnings&&qr(150),this.seriesChartTypes=this.seriesChartTypes.map(i=>(mD.has(i.chartType)||(qr(151,{chartType:i.chartType}),i.chartType="line"),i));const t=i=>{(!this.savedCustomSeriesChartTypes||this.savedCustomSeriesChartTypes.length===0)&&(this.savedCustomSeriesChartTypes=this.seriesChartTypes);const r=this.savedCustomSeriesChartTypes.find(a=>a.colId===i.colId);return r||(i.selected&&!this.suppressComboChartWarnings&&qr(152,{colId:i.colId}),{colId:i.colId,chartType:"line",secondaryAxis:!1})},s=this.chartDataModel.valueColState.map(t);this.seriesChartTypes=s,this.savedCustomSeriesChartTypes=s,this.suppressComboChartWarnings=!0}updateChartSeriesTypesForBuiltInCombos(){const{chartType:e,valueColState:t}=this.chartDataModel,s=e==="columnLineCombo"?"groupedColumn":"stackedArea",i=e==="columnLineCombo"?"line":"groupedColumn",r=t.filter(o=>o.selected),a=Math.ceil(r.length/2);this.seriesChartTypes=r.map((o,n)=>{const l=n>=a?i:s;return{colId:o.colId,chartType:l,secondaryAxis:!1}})}},me="AG-GRID-DEFAULT-CATEGORY",CD=class extends aD{constructor(e){super(),this.unlinked=!1,this.chartData=[],this.valueColState=[],this.dimensionColState=[],this.colNames={},this.crossFiltering=!1,this.grouping=!1,this.params=e,this.chartId=e.chartId,this.setParams(e)}wireBeans(e){this.rangeSvc=e.rangeSvc,this.chartTranslation=e.chartTranslation}setParams(e){const{chartType:t,pivotChart:s,chartThemeName:i,switchCategorySeries:r,aggFunc:a,cellRange:o,suppressChartRanges:n,unlinkChart:l,crossFiltering:c,seriesGroupType:d}=e;this.chartType=t,this.pivotChart=s??!1,this.chartThemeName=i,this.switchCategorySeries=!!r,this.aggFunc=a,this.referenceCellRange=o,this.suppliedCellRange=o,this.suppressChartRanges=n??!1,this.unlinked=!!l,this.crossFiltering=!!c,this.seriesGroupType=d}postConstruct(){this.datasource=this.createManagedBean(new dD),this.chartColSvc=this.createManagedBean(new pD),this.comboChartModel=this.createManagedBean(new fD(this)),this.updateCellRanges({setColsFromRange:!0}),this.updateData()}updateModel(e){const{cellRange:t,seriesChartTypes:s}=e;t!==this.suppliedCellRange&&(this.dimensionCellRange=void 0,this.valueCellRange=void 0),this.setParams(e),this.updateSelectedDimensions(t?.columns),this.updateCellRanges({setColsFromRange:!0}),(this.isComboChart()||s)&&this.comboChartModel.update(s),this.unlinked||this.updateData()}updateCellRanges(e){const{updatedColState:t,resetOrder:s,maintainColState:i,setColsFromRange:r}=e??{};this.valueCellRange&&(this.referenceCellRange=this.valueCellRange);const{dimensionCols:a,valueCols:o}=this.chartColSvc.getChartColumns(),n=this.getAllColumnsFromRanges();t&&this.updateColumnState(t,s),this.setDimensionCellRange(a,n,t),this.setValueCellRange(o,n,r),!t&&!i&&(this.resetColumnState(),this.syncDimensionCellRange()),this.comboChartModel.updateSeriesChartTypes()}updateData(){const{startRow:e,endRow:t}=this.getRowIndexes();this.pivotChart&&this.resetColumnState(),this.grouping=this.isGrouping();const s={aggFunc:this.aggFunc,dimensionCols:this.getSelectedDimensions(),grouping:this.grouping,pivoting:this.isPivotActive(),crossFiltering:this.crossFiltering,valueCols:this.getSelectedValueCols(),startRow:e,endRow:t,isScatter:["scatter","bubble"].includes(this.chartType)},{chartData:i,colNames:r,groupChartData:a}=this.datasource.getData(s);this.chartData=i,this.groupChartData=a,this.colNames=r,this.categoryAxisType=void 0}isGrouping(){const e=this.gos.get("treeData"),t=e?null:this.chartColSvc.getRowGroupColumns(),s=e||t&&t.length>0,i=this.getSelectedDimensions().map(({colId:o})=>o),a=this.chartColSvc.getGroupDisplayColumns().map(o=>o.getColId()).some(o=>i.includes(o));return!!s&&a}getSelectedValueCols(){return this.valueColState.filter(e=>e.selected).map(e=>e.column)}getSelectedDimensions(){return this.dimensionColState.filter(e=>e.selected)}getColDisplayName(e,t){return this.chartColSvc.getColDisplayName(e,t)}isPivotMode(){return this.chartColSvc.isPivotMode()}getChartDataType(e){const t=this.chartColSvc.getColumn(e);return t?t.getColDef().chartDataType:void 0}isPivotActive(){return this.chartColSvc.isPivotActive()}createCellRange(e,...t){return{id:this.chartId,startRow:this.referenceCellRange.startRow,endRow:this.referenceCellRange.endRow,columns:t,startColumn:e===Qt.DIMENSION||this.referenceCellRange.startColumn==null?t[0]:this.referenceCellRange.startColumn,type:e}}getAllColumnsFromRanges(){if(this.pivotChart)return new Set(this.chartColSvc.getAllDisplayedColumns());const e=this.dimensionCellRange||this.valueCellRange?[]:this.referenceCellRange.columns;return this.dimensionCellRange&&e.push(...this.dimensionCellRange.columns),this.valueCellRange&&e.push(...this.valueCellRange.columns),new Set(e)}getRowIndexes(){let e=0,t=0;const{rangeSvc:s,valueCellRange:i,dimensionCellRange:r}=this,a=i||r;if(s&&a){e=s.getRangeStartRow(a).rowIndex;const o=s.getRangeEndRow(a);t=o.rowPinned==="bottom"?-1:o.rowIndex}return{startRow:e,endRow:t}}resetColumnState(){const{dimensionCols:e,valueCols:t}=this.chartColSvc.getChartColumns(),s=this.getAllColumnsFromRanges(),i=this.valueColState.length<1;this.dimensionColState=[],this.valueColState=[];const r=et(B(this.chartType));let a=!1,o=1;const n=this.suppliedCellRange.columns[0];e.forEach(d=>{const h=d.getColId()==="ag-Grid-AutoColumn";let u=!1;this.crossFiltering&&this.aggFunc?n.getColId()===d.getColId()&&(u=!0):u=h?!0:(!a||r)&&s.has(d),this.dimensionColState.push({column:d,colId:d.getColId(),displayName:this.getColDisplayName(d),selected:u,order:o++}),u&&(a=!0)});const l={colId:me,displayName:this.chartTranslation.translate("defaultCategory"),selected:!a,order:0};this.dimensionColState.unshift(l);const c=this.referenceCellRange.columns.filter(d=>t.has(d));t.forEach(d=>{i&&this.referenceCellRange.columns.includes(d)&&(d=c.shift()),this.valueColState.push({column:d,colId:d.getColId(),displayName:this.getColDisplayName(d),selected:s.has(d),order:o++})})}updateColumnState(e,t){const s=c=>c.colId===e.colId,{dimensionColState:i,valueColState:r}=this,a=i.find(s),o=r.find(s);if(a)if(et(B(this.chartType)))a.selected=e.selected;else{const d=e.selected?a:i.filter(h=>h!==a).find(({selected:h})=>h);i.forEach(h=>h.selected=h===d)}else o&&(o.selected=e.selected);const n=[...i,...r],l=[];t||(n.forEach((c,d)=>{d===e.order&&l.push(e.colId),c.colId!==e.colId&&l.push(c.colId)}),n.forEach(c=>{const d=l.indexOf(c.colId);c.order=d>=0?l.indexOf(c.colId):n.length-1})),this.reorderColState()}reorderColState(){const e=(t,s)=>t.order-s.order;this.dimensionColState.sort(e),this.valueColState.sort(e)}setDimensionCellRange(e,t,s){this.dimensionCellRange=void 0;const i=et(B(this.chartType));if(!s&&!this.dimensionColState.length){const n=new Array;e.forEach(l=>{n.length>0&&!i||!t.has(l)||n.push(l)}),n.length>0&&(this.dimensionCellRange=this.createCellRange(Qt.DIMENSION,...n));return}let r=s?[s]:[];if(this.crossFiltering&&this.aggFunc){const n=this.suppliedCellRange.columns[0];r=this.dimensionColState.filter(l=>l.colId===n.getColId())}else(i||r.length===0||r.some(({column:n})=>!n||!e.has(n)))&&(r=this.dimensionColState.filter(n=>n.selected));const a=r.length===1?r[0].colId===me:!1,o=r.map(({column:n})=>n).filter(n=>n!=null);o.length>0&&!a&&(this.dimensionCellRange=this.createCellRange(Qt.DIMENSION,...o))}setValueCellRange(e,t,s){this.valueCellRange=void 0;const i=[],r=Qs(this.chartType);let a=0;if(e.forEach(o=>{s?(r==null||an.selected&&n.colId===o.getColId())&&i.push(o)}),i.length>0){let o=[];this.valueColState.length>0?o=this.valueColState.map(n=>n.colId):t.forEach(n=>o.push(n.getColId())),i.sort((n,l)=>o.indexOf(n.getColId())-o.indexOf(l.getColId())),this.valueCellRange=this.createCellRange(Qt.VALUE,...i)}}resetCellRanges(e,t){if(!e&&!t)return;const{dimensionCols:s,valueCols:i}=this.chartColSvc.getChartColumns(),r=this.getAllColumnsFromRanges();e&&this.setDimensionCellRange(s,r),t&&this.setValueCellRange(i,r)}updateSelectedDimensions(e){const t=new Set(e.map(i=>i.getColId()));if(et(B(this.chartType))){const i=this.dimensionColState.filter(a=>t.has(a.colId)),r=new Set(i.map(a=>a.colId));this.dimensionColState=this.dimensionColState.map(a=>({...a,selected:r.has(a.colId)}))}else{const r=(this.dimensionColState.find(a=>t.has(a.colId))||this.dimensionColState[0]).colId;this.dimensionColState=this.dimensionColState.map(a=>({...a,selected:a.colId===r}))}}syncDimensionCellRange(){const e=this.getSelectedDimensions();if(e.length===0)return;const t=e.map(({column:s})=>s).filter(s=>s!=null);t.length>0&&(this.dimensionCellRange=this.createCellRange(Qt.DIMENSION,...t))}isComboChart(e){return Kr(e??this.chartType)}},Dc=class extends Ve{getAxes(e,t){return[{type:this.getXAxisType(e),position:this.isHorizontal(t)?"left":"bottom"},{type:"number",position:this.isHorizontal(t)?"bottom":"left"}]}computeSeriesStatistics(e,t){const{data:s,fields:i}=e,[r]=e.categories,a=r.id||me,o=this.groupDataByCategory(a,s);return Array.from(o).map(([n,l])=>{const c={[r.id]:n};return i.forEach((d,h)=>{const u=l.map(g=>g[d.colId]).filter(g=>typeof g=="number"&&!isNaN(g)),p=t(u);for(const g of Object.keys(p)){const m=`${g}:${h}`;c[m]=u.length>0?p[g]:null}}),c})}groupDataByCategory(e,t){const s=i=>{if(e===me)return 1;const r=i[e];return r==null?"":r instanceof Date?r.getTime():r};return t.reduce((i,r)=>{const a=s(r),o=i.get(a);return o?o.push(r):i.set(a,[r]),i},new Map)}},vD=class extends Dc{getSeries(e){const[t]=e.categories;return e.fields.map((s,i)=>({type:this.standaloneChartType,xKey:t.id,xName:t.name,yName:s.displayName??void 0,minName:"Min",q1Name:"Q1",medianName:"Median",q3Name:"Q3",maxName:"Max",minKey:`min:${i}`,q1Key:`q1:${i}`,medianKey:`median:${i}`,q3Key:`q3:${i}`,maxKey:`max:${i}`}))}getData(e){return this.computeSeriesStatistics(e,t=>{const s=t.sort((i,r)=>i-r);return{min:s[0],q1:this.quantile(s,.25),median:this.quantile(s,.5),q3:this.quantile(s,.75),max:s[s.length-1]}})}quantile(e,t){const s=(e.length-1)*t,i=Math.floor(s),r=s-i;return e[i+1]!==void 0?e[i]+r*(e[i+1]-e[i]):e[i]}},yD=class extends Dc{getSeries(e){const[t]=e.categories;return e.fields.map((s,i)=>({type:this.standaloneChartType,xKey:t.id,xName:t.name,yName:s.displayName??void 0,yLowName:"Min",yHighName:"Max",yLowKey:`min:${i}`,yHighKey:`max:${i}`}))}getData(e){return this.computeSeriesStatistics(e,t=>({min:Math.min(...t),max:Math.max(...t)}))}},SD=class extends TI{constructor(){super(...arguments),this.beanName="enterpriseChartProxyFactory"}createChartProxy(e){switch(e.chartType){case"histogram":return new WI(e);case"radarLine":case"radarArea":case"nightingale":case"radialColumn":case"radialBar":return new JI(e);case"rangeBar":case"rangeArea":return new yD(e);case"boxPlot":return new vD(e);case"treemap":case"sunburst":return new ZI(e);case"heatmap":return new iD(e);case"waterfall":return new jI(e);case"funnel":case"coneFunnel":case"pyramid":return new $I(e)}}};import{BeanStub as bD,TabGuardComp as wD,_findFocusableElements as Lc,_findNextFocusableElement as xD}from"ag-grid-community";import{Component as TD}from"ag-grid-community";import{BeanStub as MD,_removeFromParent as PD}from"ag-grid-community";var kc=class extends MD{constructor(e,t,s,i){super(),this.chartController=e,this.eGui=t,this.cssClass=s,this.createPanels=i,this.panels=[]}postConstruct(){this.addManagedListeners(this.chartController,{chartUpdated:()=>this.refreshPanels(!0),chartApiUpdate:()=>this.refreshPanels(!1)})}addComponent(e){this.createBean(e),this.panels.push(e),e.addCssClass(this.cssClass),this.eGui.appendChild(e.getGui())}refreshPanels(e){const t=this.chartController.getChartType(),s=this.chartController.isGrouping(),i=B(t);e&&t===this.chartType&&s===this.isGrouping||(this.destroyPanels(),this.createPanels(t,i),this.chartType=t,this.isGrouping=s)}destroyPanels(){this.panels.forEach(e=>{PD(e.getGui()),this.destroyBean(e)}),this.panels=[]}destroy(){this.destroyPanels(),super.destroy()}};import{AgInputNumberFieldSelector as FD,Component as AD}from"ag-grid-community";var RD=class extends AD{constructor(e){super(),this.chartMenuParamsFactory=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e=this.chartMenuParamsFactory.addEnableParams("animation.enabled",{cssIdentifier:"charts-advanced-settings-top-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("animation"),suppressEnabledCheckbox:!0,useToggle:!0}),t=this.chartMenuParamsFactory.getDefaultNumberInputParams("animation.duration","durationMillis",{min:0});this.setTemplate(`
`,[N,FD],{animationGroup:e,animationHeightInput:t})}};import{AgCheckboxSelector as ED,Component as ID}from"ag-grid-community";import{AgPickerField as DD,_getDocument as LD}from"ag-grid-community";import{Component as kD,KeyCode as Te,RefPlaceholder as Me,_exists as GD,_setDisplayed as OD}from"ag-grid-community";import{AgInputTextField as ND,RefPlaceholder as BD}from"ag-grid-community";var _D=class extends ND{constructor(){super({template:` `}),this.eColor=BD}wireBeans(e){this.chartTranslation=e.chartTranslation,this.color=e.agChartsExports._Util.Color}setColor(e){const t=e.toRgbaString();this.setValue(this.color.fromString(t).toHexString().toUpperCase(),!0),this.eColor.style.backgroundColor=t}setValue(e,t){const s=this.color.validColorString(e??"");return this.eInput.setCustomValidity(s?"":this.chartTranslation.translate("invalidColor")),super.setValue(e,t),s&&!t&&this.dispatchLocalEvent({type:"colorChanged"}),this}onColorChanged(e){this.addManagedListeners(this,{colorChanged:()=>e(this.color.fromString(this.value))})}},VD={selector:"AG-COLOR-INPUT",component:_D},Gc=8,ti=[],HD=class extends kD{constructor(e){super(`
`,[VD]),this.H=1,this.S=1,this.B=1,this.A=1,this.isSpectrumDragging=!1,this.isSpectrumHueDragging=!1,this.isSpectrumAlphaDragging=!1,this.colorChanged=!1,this.spectrumColor=Me,this.spectrumVal=Me,this.spectrumDragger=Me,this.spectrumHue=Me,this.spectrumHueSlider=Me,this.spectrumAlpha=Me,this.spectrumAlphaSlider=Me,this.colorInput=Me,this.recentColors=Me,this.picker=e.picker}wireBeans(e){this._Color=e.agChartsExports._Util.Color}postConstruct(){this.initTabIndex(),this.initRecentColors(),this.addGuiEventListener("focus",()=>this.spectrumColor.focus()),this.addGuiEventListener("keydown",e=>{e.key===Te.ENTER&&!e.defaultPrevented&&this.destroy()}),this.addManagedListeners(this.spectrumColor,{keydown:e=>this.moveDragger(e)}),this.addManagedListeners(this.spectrumAlphaSlider,{keydown:e=>this.moveAlphaSlider(e)}),this.addManagedListeners(this.spectrumHueSlider,{keydown:e=>this.moveHueSlider(e)}),this.addManagedListeners(this.spectrumVal,{mousedown:this.onSpectrumDraggerDown.bind(this)}),this.addManagedListeners(this.spectrumHue,{mousedown:this.onSpectrumHueDown.bind(this)}),this.addManagedListeners(this.spectrumAlpha,{mousedown:this.onSpectrumAlphaDown.bind(this)}),this.addGuiEventListener("mousemove",e=>{this.onSpectrumDraggerMove(e),this.onSpectrumHueMove(e),this.onSpectrumAlphaMove(e)}),this.addManagedListeners(document,{mouseup:this.onMouseUp.bind(this)}),this.colorInput.onColorChanged(this.setColor.bind(this)),this.addManagedListeners(this.recentColors,{click:this.onRecentColorClick.bind(this),keydown:e=>{(e.key===Te.ENTER||e.key===Te.SPACE)&&(e.preventDefault(),this.onRecentColorClick(e))}})}initTabIndex(){const e=this.tabIndex=this.gos.get("tabIndex").toString();this.spectrumColor.setAttribute("tabindex",e),this.spectrumHueSlider.setAttribute("tabindex",e),this.spectrumAlphaSlider.setAttribute("tabindex",e)}refreshSpectrumRect(){return this.spectrumValRect=this.spectrumVal.getBoundingClientRect()}refreshHueRect(){return this.spectrumHueRect=this.spectrumHue.getBoundingClientRect()}refreshAlphaRect(){return this.spectrumAlphaRect=this.spectrumAlpha.getBoundingClientRect()}onSpectrumDraggerDown(e){e.preventDefault(),this.refreshSpectrumRect(),this.isSpectrumDragging=!0,this.moveDragger(e)}onSpectrumDraggerMove(e){this.isSpectrumDragging&&this.moveDragger(e)}onSpectrumHueDown(e){this.refreshHueRect(),this.isSpectrumHueDragging=!0,this.moveHueSlider(e)}onSpectrumHueMove(e){this.isSpectrumHueDragging&&this.moveHueSlider(e)}onSpectrumAlphaDown(e){this.refreshAlphaRect(),this.isSpectrumAlphaDragging=!0,this.moveAlphaSlider(e)}onSpectrumAlphaMove(e){this.isSpectrumAlphaDragging&&this.moveAlphaSlider(e)}onMouseUp(){this.isSpectrumDragging=!1,this.isSpectrumHueDragging=!1,this.isSpectrumAlphaDragging=!1}moveDragger(e){const t=this.spectrumValRect;if(!t)return;let s,i;if(e instanceof MouseEvent)s=e.clientX-t.left,i=e.clientY-t.top;else{const r=e.key===Te.LEFT,a=e.key===Te.RIGHT,o=e.key===Te.UP,n=e.key===Te.DOWN,l=o||n,c=r||a;if(!l&&!c)return;e.preventDefault();const{x:d,y:h}=this.getSpectrumValue();s=d+(c?r?-5:5:0),i=h+(l?o?-5:5:0)}s=Math.max(s,0),s=Math.min(s,t.width),i=Math.max(i,0),i=Math.min(i,t.height),this.setSpectrumValue(s/t.width,1-i/t.height)}moveHueSlider(e){const t=this.spectrumHueRect;if(!t)return;const s=this.moveSlider(this.spectrumHueSlider,e);s!=null&&(this.H=1-s/t.width,this.update())}moveAlphaSlider(e){const t=this.spectrumAlphaRect;if(!t)return;const s=this.moveSlider(this.spectrumAlphaSlider,e);s!=null&&(this.A=s/t.width,this.update())}moveSlider(e,t){const s=e.getBoundingClientRect(),i=e.parentElement?.getBoundingClientRect();if(!e||!i)return null;const r=s.width/2;let a;if(t instanceof MouseEvent)a=Math.floor(t.clientX-i.left);else{const o=t.key===Te.LEFT,n=t.key===Te.RIGHT;if(!o&&!n)return null;t.preventDefault();const l=o?-5:5;a=parseFloat(e.style.left)+r+l}return a=Math.max(a,0),a=Math.min(a,i.width),e.style.left=a-r+"px",a}update(e){const{A:t,S:s,B:i,H:r,_Color:a}=this,o=r*360,n=a.fromHSB(o,s,i,t),l=n.toRgbaString(),d=a.fromHSB(o,s,i).toRgbaString(),u=a.fromHSB(o,1,1).toRgbaString(),p=this.picker;a.fromString(p.getValue()).toRgbaString()!==l&&(this.colorChanged=!0),p.setValue(l),this.spectrumColor.style.backgroundColor=u,this.spectrumDragger.style.backgroundColor=d,this.spectrumHueSlider.style.backgroundColor=u,this.spectrumAlpha.style.setProperty("--ag-internal-spectrum-alpha-color-from",a.fromHSB(o,s,i,0).toRgbaString()),this.spectrumAlpha.style.setProperty("--ag-internal-spectrum-alpha-color-to",d),this.spectrumAlpha.style.setProperty("--ag-internal-spectrum-alpha-color",l),e||this.colorInput.setColor(n)}setSpectrumValue(e,t,s){const i=this.spectrumValRect||this.refreshSpectrumRect();if(i==null)return;const r=this.spectrumDragger,a=r.getBoundingClientRect();e=Math.max(0,e),e=Math.min(1,e),t=Math.max(0,t),t=Math.min(1,t),this.S=e,this.B=t,r.style.left=e*i.width-a.width/2+"px",r.style.top=(1-t)*i.height-a.height/2+"px",this.update(s)}getSpectrumValue(){const e=this.spectrumDragger,t=e.getBoundingClientRect(),s=parseFloat(e.style.left)+t.width/2,i=parseFloat(e.style.top)+t.height/2;return{x:s,y:i}}initRecentColors(){const e=ti,t=e.map((s,i)=>`
`);this.recentColors.innerHTML=t.join(""),OD(this.recentColors,!!e.length)}setValue(e){const t=this._Color.fromString(e);this.setColor(t,!0)}setColor(e,t){const[s,i,r]=e.toHSB();this.H=(isNaN(s)?0:s)/360,this.A=e.a;const a=this.spectrumHueRect||this.refreshHueRect(),o=this.spectrumAlphaRect||this.refreshAlphaRect();this.spectrumHueSlider.style.left=`${(this.H-1)*-a.width-this.spectrumHueSlider.getBoundingClientRect().width/2}px`,this.spectrumAlphaSlider.style.left=`${this.A*o.width-this.spectrumAlphaSlider.getBoundingClientRect().width/2}px`,this.setSpectrumValue(i,r,!t)}onRecentColorClick(e){const t=e.target;if(!GD(t.id))return;const s=parseInt(t.id,10);this.setValue(ti[s]),this.destroy()}addRecentColor(){const t=this._Color.fromHSB(this.H*360,this.S,this.B,this.A).toRgbaString();let s=ti;!this.colorChanged||s[0]===t||(s=s.filter(i=>i!=t),s=[t].concat(s),s.length>Gc&&(s=s.slice(0,Gc)),ti=s)}destroy(){this.addRecentColor(),super.destroy()}},Oc=class extends DD{constructor(e){super({pickerAriaLabelKey:"ariaLabelColorPicker",pickerAriaLabelValue:"Color Picker",pickerType:"ag-list",className:"ag-color-picker",pickerIcon:"chartsColorPicker",...e})}postConstruct(){const e=LD(this.beans);this.eDisplayFieldColor=e.createElement("span"),this.eDisplayFieldColor.classList.add("ag-color-picker-color"),this.eDisplayFieldText=e.createElement("span"),this.eDisplayFieldText.classList.add("ag-color-picker-value"),this.eDisplayField.appendChild(this.eDisplayFieldColor),this.eDisplayField.appendChild(this.eDisplayFieldText),super.postConstruct(),this.value&&this.setValue(this.value)}createPickerComponent(){const e=this.eWrapper.getBoundingClientRect(),t=this.beans.popupSvc.getParentRect();return this.createBean(new At({closable:!1,modal:!0,hideTitleBar:!0,minWidth:190,width:190,height:250,x:e.right-t.left-190,y:e.top-t.top-250-(this.config.pickerGap??0),postProcessPopupParams:{type:"colorPicker",eventSource:this.eWrapper}}))}renderAndPositionPicker(){const e=this.pickerComponent,t=this.createBean(new HD({picker:this}));return e.addCssClass("ag-color-dialog"),t.addDestroyFunc(()=>{e.isAlive()&&this.destroyBean(e)}),e.setParentComponent(this),e.setBodyComponent(t),t.setValue(this.getValue()),t.getGui().focus(),e.addDestroyFunc(()=>{this.isDestroyingPicker?this.isDestroyingPicker=!1:(this.beforeHidePicker(),this.isDestroyingPicker=!0,t.isAlive()&&this.destroyBean(t),this.isAlive()&&this.getFocusableElement().focus())}),()=>this.pickerComponent?.close()}setValue(e){return this.value===e?this:(this.eDisplayFieldColor.style.backgroundColor=e,this.eDisplayFieldText.textContent=this.beans.agChartsExports._Util.Color.fromString(e).toHexString().toUpperCase(),super.setValue(e))}getValue(){return this.value}},fe={selector:"AG-COLOR-PICKER",component:Oc},zD=class extends ID{constructor(e){super(),this.chartMenuParamsFactory=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e=this.chartMenuParamsFactory.addEnableParams("crosshair.enabled",{cssIdentifier:"charts-advanced-settings-top-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("crosshair"),suppressEnabledCheckbox:!0,useToggle:!0}),t=this.chartMenuParamsFactory.getDefaultCheckboxParams("crosshair.label.enabled","crosshairLabel"),s=this.chartMenuParamsFactory.getDefaultCheckboxParams("crosshair.snap","crosshairSnap"),i=this.chartMenuParamsFactory.getDefaultColorPickerParams("crosshair.stroke","color");this.setTemplate(`
`,[N,ED,fe],{crosshairGroup:e,crosshairLabelCheckbox:t,crosshairSnapCheckbox:s,crosshairStrokeColorPicker:i})}};import{AgCheckboxSelector as UD,Component as KD}from"ag-grid-community";import{AgAbstractLabel as WD,AgInputNumberFieldSelector as jD,RefPlaceholder as Zr}from"ag-grid-community";import{AgAbstractInputField as $D}from"ag-grid-community";var YD=class extends $D{constructor(e){super(e,"ag-range-field","range")}postConstruct(){super.postConstruct();const{min:e,max:t,step:s}=this.config;e!=null&&this.setMinValue(e),t!=null&&this.setMaxValue(t),this.setStep(s||1)}addInputListeners(){this.addManagedElementListeners(this.eInput,{input:e=>{const t=e.target.value;this.setValue(t)}})}setMinValue(e){return this.min=e,this.eInput.setAttribute("min",e.toString()),this}setMaxValue(e){return this.max=e,this.eInput.setAttribute("max",e.toString()),this}setStep(e){return this.eInput.setAttribute("step",e.toString()),this}setValue(e,t){this.min!=null&&(e=Math.max(parseFloat(e),this.min).toString()),this.max!=null&&(e=Math.min(parseFloat(e),this.max).toString());const s=super.setValue(e,t);return this.eInput.value=e,s}},XD={selector:"AG-INPUT-RANGE",component:YD},ie=class extends WD{constructor(e){super(e,`
`,[XD,jD]),this.eLabel=Zr,this.eSlider=Zr,this.eText=Zr,this.labelAlignment="top"}postConstruct(){super.postConstruct(),this.eSlider.addCssClass("ag-slider-field");const{minValue:e,maxValue:t,textFieldWidth:s,step:i,value:r,onValueChange:a}=this.config;e!=null&&this.setMinValue(e),t!=null&&this.setMaxValue(t),s!=null&&this.setTextFieldWidth(s),i!=null&&this.setStep(i),r!=null&&this.setValue(r),a!=null&&this.onValueChange(a)}onValueChange(e){return this.addManagedListeners(this.eText,{fieldValueChanged:()=>{const t=parseFloat(this.eText.getValue());this.eSlider.setValue(t.toString(),!0),e(t||0)}}),this.addManagedListeners(this.eSlider,{fieldValueChanged:()=>{const t=this.eSlider.getValue();this.eText.setValue(t,!0),e(parseFloat(t))}}),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,t){return this.getValue()===e?this:(this.eText.setValue(e,!0),this.eSlider.setValue(e,!0),t||this.dispatchLocalEvent({type:"fieldValueChanged"}),this)}setStep(e){return this.eSlider.setStep(e),this.eText.setStep(e),this}},Q={selector:"AG-SLIDER",component:ie},qD=class extends KD{constructor(e){super(),this.chartMenuParamsFactory=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e=this.chartMenuParamsFactory.addEnableParams("navigator.enabled",{cssIdentifier:"charts-advanced-settings-top-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("navigator"),suppressEnabledCheckbox:!0,useToggle:!0}),t=this.chartMenuParamsFactory.getDefaultSliderParams("navigator.height","height",60);t.minValue=10;const s=this.chartMenuParamsFactory.getDefaultCheckboxParams("navigator.miniChart.enabled","miniChart");this.setTemplate(`
`,[N,Q,UD],{navigatorGroup:e,navigatorHeightSlider:t,navigatorMiniChartCheckbox:s})}};import{AgCheckboxSelector as ZD,Component as JD,RefPlaceholder as QD}from"ag-grid-community";var eL=class extends JD{constructor(e){super(),this.chartMenuParamsFactory=e,this.zoomScrollingStepInput=QD}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e=this.chartMenuParamsFactory.addEnableParams("zoom.enabled",{cssIdentifier:"charts-advanced-settings-top-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("zoom"),suppressEnabledCheckbox:!0,useToggle:!0}),t=this.chartMenuParamsFactory.getDefaultCheckboxParams("zoom.enableScrolling","scrollingZoom"),s=this.chartMenuParamsFactory.getDefaultSliderParams("zoom.scrollingStep","scrollingStep",1);s.step=.01,s.minValue=s.step;const i=this.chartMenuParamsFactory.getDefaultCheckboxParams("zoom.enableSelecting","selectingZoom");t.onValueChange=(r=>a=>{r&&(r(a),this.zoomScrollingStepInput.setDisabled(!a))})(t.onValueChange),this.setTemplate(`
`,[N,ZD,Q],{zoomGroup:e,zoomScrollingCheckbox:t,zoomScrollingStepInput:s,zoomSelectingCheckbox:i}),this.zoomScrollingStepInput.setDisabled(!t.value)}},tL=["navigator","zoom","animation","crosshair"],sL=class extends TD{constructor(e){super('
'),this.chartMenuContext=e}postConstruct(){this.chartPanelFeature=this.createManagedBean(new kc(this.chartMenuContext.chartController,this.getGui(),"ag-chart-advanced-settings-section",(e,t)=>this.createPanels(e,t))),this.chartPanelFeature.refreshPanels()}createPanels(e,t){tL.forEach(s=>{if(!this.isGroupPanelShownForSeries(s,t))return;const i=this.createPanel(s);this.chartPanelFeature.addComponent(i)})}isGroupPanelShownForSeries(e,t){return e==="animation"||_e(t)}createPanel(e){const{chartMenuParamsFactory:t,chartAxisMenuParamsFactory:s}=this.chartMenuContext;switch(e){case"navigator":return new qD(t);case"zoom":return new eL(t);case"animation":return new RD(t);case"crosshair":return new zD(s)}}},iL=class extends bD{constructor(){super(...arguments),this.beanName="advSettingsMenuFactory"}showMenu(e,t){this.hideMenu();const s=this.createBean(new rL(e));this.activeDialog=this.createBean(new At({title:this.beans.chartTranslation.translate("advancedSettings"),component:s,width:300,height:400,resizable:!0,movable:!0,centered:!0,closable:!0,afterGuiAttached:()=>{Lc(s.getGui())[0]?.focus()},closedCallback:()=>{this.activeMenu=this.destroyBean(this.activeMenu),this.activeDialog=void 0,t?.focus({preventScroll:!0})}})),this.activeMenu=s}hideMenu(){this.activeDialog&&this.destroyBean(this.activeDialog)}destroy(){this.activeMenu=this.destroyBean(this.activeMenu),this.activeDialog=this.destroyBean(this.activeDialog),super.destroy()}},rL=class extends wD{constructor(e){super('
'),this.chartMenuContext=e}postConstruct(){this.advancedSettingsPanel=this.createManagedBean(new sL(this.chartMenuContext)),this.getGui().appendChild(this.advancedSettingsPanel.getGui()),this.initialiseTabGuard({onTabKeyDown:this.onTabKeyDown.bind(this),focusTrapActive:!0})}onTabKeyDown(e){if(e.defaultPrevented)return;e.preventDefault();const t=e.shiftKey,s=this.advancedSettingsPanel.getGui(),i=xD(this.beans,s,!1,t);if(i)i.focus();else{const r=Lc(s);r.length&&r[t?r.length-1:0].focus()}}};import{BeanStub as aL,Component as oL,RefPlaceholder as nL,_addGridCommonParams as lL,_createIconNoSpan as cL,_focusInto as dL,_isNothingFocused as hL}from"ag-grid-community";var uL=class extends aL{constructor(){super(...arguments),this.beanName="chartMenuListFactory"}wireBeans(e){this.popupSvc=e.popupSvc,this.chartMenuSvc=e.chartMenuSvc,this.chartTranslation=e.chartTranslation}showMenuList(e){const{eventSource:t,showMenu:s,chartMenuContext:i}=e,r=this.chartMenuSvc.doChartToolPanelsExist(i.chartController),a=this.mapWithStockItems(this.getMenuItems(i.chartController,r),i,s,t,r);if(!a.length)return;const o=this.createBean(new pL(a));this.activeChartMenuList=o;let n=-1,l="left";this.gos.get("enableRtl")&&(n=1,l="right");const c=o.getGui();this.popupSvc.addPopup({modal:!0,eChild:c,closeOnEsc:!0,closedCallback:()=>{this.destroyBean(o),this.activeChartMenuList=void 0,hL(this.beans)&&t.focus({preventScroll:!0})},afterGuiAttached:d=>o.afterGuiAttached(d),positionCallback:()=>{this.popupSvc.positionPopupByComponent({type:"chartMenu",eventSource:t,ePopup:c,alignSide:l,nudgeX:4*n,nudgeY:4,position:"under",keepWithinBounds:!0})},ariaLabel:"Chart Menu"})}getMenuItems(e,t){const s=[...t?["chartEdit"]:[],...e.isEnterprise()?["chartAdvancedSettings"]:[],e.isChartLinked()?"chartUnlink":"chartLink","chartDownload"],i=this.gos.get("chartMenuItems");return i?Array.isArray(i)?i:i(lL(this.gos,{defaultItems:s})):s}mapWithStockItems(e,t,s,i,r){if(!e)return[];const a=[];return e.forEach(o=>{let n;if(typeof o=="string"?n=this.getStockMenuItem(o,t,s,i,r):n={...o},!n)return;const{subMenu:l}=n;Array.isArray(l)&&(n.subMenu=this.mapWithStockItems(l,t,s,i,r)),a.push(n)}),a}getStockMenuItem(e,t,s,i,r){switch(e){case"chartEdit":return r?this.createMenuItem(this.chartTranslation.translate("chartEdit"),"chartsMenuEdit",s):null;case"chartAdvancedSettings":return this.createMenuItem(this.chartTranslation.translate("chartAdvancedSettings"),"chartsMenuAdvancedSettings",()=>this.chartMenuSvc.openAdvancedSettings(t,i));case"chartUnlink":return t.chartController.isChartLinked()?this.createMenuItem(this.chartTranslation.translate("chartUnlink"),"unlinked",()=>this.chartMenuSvc.toggleLinked(t)):null;case"chartLink":return t.chartController.isChartLinked()?null:this.createMenuItem(this.chartTranslation.translate("chartLink"),"linked",()=>this.chartMenuSvc.toggleLinked(t));case"chartDownload":return this.createMenuItem(this.chartTranslation.translate("chartDownload"),"chartsDownload",()=>this.chartMenuSvc.downloadChart(t))}return null}createMenuItem(e,t,s){return{name:e,icon:cL(t,this.beans,null),action:s}}destroy(){this.destroyBean(this.activeChartMenuList),super.destroy()}},pL=class extends oL{constructor(e){super(` `),this.menuItems=e,this.eChartsMenu=nL}postConstruct(){this.mainMenuList=this.createManagedBean(new Nt(0)),this.mainMenuList.addMenuItems(this.menuItems),this.mainMenuList.addEventListener("closeMenu",this.onHidePopup.bind(this)),this.eChartsMenu.appendChild(this.mainMenuList.getGui())}onHidePopup(){this.hidePopupFunc?.()}afterGuiAttached({hidePopup:e}){e&&(this.hidePopupFunc=e,this.addDestroyFunc(e)),dL(this.mainMenuList.getGui())}};import{BeanStub as gL,_isClientSideRowModel as mL,_warn as fL}from"ag-grid-community";var CL=class extends gL{constructor(){super(...arguments),this.beanName="chartCrossFilterSvc"}wireBeans(e){this.colModel=e.colModel,this.valueSvc=e.valueSvc,this.filterManager=e.filterManager,mL(this.gos,e.rowModel)&&(this.clientSideRowModel=e.rowModel)}filter(e,t=!1){const s=this.filterManager?.getFilterModel()??{};if(t){this.resetFilters(s);return}const i=this.extractFilterColId(e);this.isValidColumnFilter(i)?this.updateFilters(s,e,i):fL(154,{colId:i})}resetFilters(e){Object.keys(e).length>0&&(this.filterManager?.setFilterModel(null),this.filterManager?.onFilterChanged({source:"api"}))}updateFilters(e,t,s){const i=this.extractFilterColId(t),r=t.datum[i];if(r===void 0)return;const a=r.toString();if(t.event.metaKey||t.event.ctrlKey){const o=this.getCurrentGridValuesForCategory(s),n=o.includes(a);let l;n?l=o.filter(c=>c!==a):(l=o,l.push(a)),e[s]=this.getUpdatedFilterModel(s,l)}else{const o=[a];e={[s]:this.getUpdatedFilterModel(s,o)}}this.filterManager?.setFilterModel(e)}getUpdatedFilterModel(e,t){return this.getColumnFilterType(e)==="agMultiColumnFilter"?{filterType:"multi",filterModels:[null,{filterType:"set",values:t}]}:{filterType:"set",values:t}}getCurrentGridValuesForCategory(e){const t=[],s=this.getColumnById(e);return this.clientSideRowModel?.forEachNodeAfterFilter(i=>{if(s&&!i.group){const r=this.valueSvc.getValue(s,i)+"";t.includes(r)||t.push(r)}}),t}extractFilterColId(e){return e.xKey||e.calloutLabelKey}isValidColumnFilter(e){e.indexOf("-filtered-out")&&(e=e.replace("-filtered-out",""));const t=this.getColumnFilterType(e);return typeof t=="boolean"?t:["agSetColumnFilter","agMultiColumnFilter"].includes(t)}getColumnFilterType(e){const t=this.getColumnById(e);if(t)return t.getColDef().filter}getColumnById(e){return this.colModel.getCol(e)}};import{BeanStub as vL,_warn as Nc}from"ag-grid-community";var yL=["chartUnlink","chartLink","chartDownload","chartMenu"],si={settings:"chartSettings",data:"chartData",format:"chartFormat"},SL=class extends vL{constructor(){super(...arguments),this.beanName="chartMenuSvc"}wireBeans(e){this.advSettingsMenuFactory=e.advSettingsMenuFactory}downloadChart(e,t,s,i){e.chartController.getChartProxy().downloadChart(t,s,i)}toggleLinked(e){e.chartController.detachChartRange()}openAdvancedSettings(e,t){this.advSettingsMenuFactory?.showMenu(e,t)}hideAdvancedSettings(){this.advSettingsMenuFactory?.hideMenu()}getChartToolbarOptions(){const e=["chartMenu"],t=this.gos.getCallback("getChartToolbarItems");return t?t({defaultItems:e}).filter(i=>yL.includes(i)?!0:(Nc(155,{option:i}),!1)):e}getChartToolPanels(e){const t=this.gos.get("chartToolPanelsDef");let i=t?.panels?.map(o=>{const n=si[o];return n||Nc(156,{panel:o}),n}).filter(o=>!!o)??Object.values(si);e.isPivotChart()&&(i=i.filter(o=>o!=="chartData"));const r=t?.defaultToolPanel,a=r&&si[r]||i[0];return{panels:i,defaultPanel:a}}doesChartToolbarExist(){return this.getChartToolbarOptions().length>0}doChartToolPanelsExist(e){const{panels:t}=this.getChartToolPanels(e);return t.length>0}};import{BeanStub as bL}from"ag-grid-community";var wL={pivotChartTitle:"Pivot Chart",rangeChartTitle:"Range Chart",settings:"Chart",data:"Set Up",format:"Customize",categories:"Categories",defaultCategory:"(None)",series:"Series",switchCategorySeries:"Switch Category / Series",categoryValues:"Category Values",seriesLabels:"Series Labels",aggregate:"Aggregate",xyValues:"X Y Values",paired:"Paired Mode",axis:"Axis",xAxis:"Horizontal Axis",yAxis:"Vertical Axis",polarAxis:"Polar Axis",radiusAxis:"Radius Axis",navigator:"Navigator",zoom:"Zoom",animation:"Animation",crosshair:"Crosshair",color:"Color",thickness:"Thickness",preferredLength:"Preferred Length",xType:"X Type",axisType:"Axis Type",automatic:"Automatic",category:"Category",number:"Number",time:"Time",timeFormat:"Time Format",autoRotate:"Auto Rotate",labelRotation:"Rotation",circle:"Circle",polygon:"Polygon",square:"Square",cross:"Cross",diamond:"Diamond",plus:"Plus",triangle:"Triangle",heart:"Heart",orientation:"Orientation",fixed:"Fixed",parallel:"Parallel",perpendicular:"Perpendicular",radiusAxisPosition:"Position",ticks:"Ticks",gridLines:"Grid Lines",width:"Width",height:"Height",length:"Length",padding:"Padding",spacing:"Spacing",chartStyle:"Chart Style",title:"Title",chartTitles:"Titles",chartTitle:"Chart Title",chartSubtitle:"Subtitle",horizontalAxisTitle:"Horizontal Axis Title",verticalAxisTitle:"Vertical Axis Title",polarAxisTitle:"Polar Axis Title",titlePlaceholder:"Chart Title",background:"Background",font:"Font",weight:"Weight",top:"Top",right:"Right",bottom:"Bottom",left:"Left",labels:"Labels",calloutLabels:"Callout Labels",sectorLabels:"Sector Labels",positionRatio:"Position Ratio",size:"Size",shape:"Shape",minSize:"Minimum Size",maxSize:"Maximum Size",legend:"Legend",position:"Position",markerSize:"Marker Size",markerStroke:"Marker Stroke",markerPadding:"Marker Padding",itemSpacing:"Item Spacing",itemPaddingX:"Item Padding X",itemPaddingY:"Item Padding Y",layoutHorizontalSpacing:"Horizontal Spacing",layoutVerticalSpacing:"Vertical Spacing",strokeWidth:"Stroke Width",offset:"Offset",offsets:"Offsets",tooltips:"Tooltips",callout:"Callout",markers:"Markers",shadow:"Shadow",blur:"Blur",xOffset:"X Offset",yOffset:"Y Offset",lineWidth:"Line Width",lineDash:"Line Dash",lineDashOffset:"Dash Offset",scrollingZoom:"Scrolling",scrollingStep:"Scrolling Step",selectingZoom:"Selecting",durationMillis:"Duration (ms)",crosshairLabel:"Label",crosshairSnap:"Snap to Node",normal:"Normal",bold:"Bold",italic:"Italic",boldItalic:"Bold Italic",predefined:"Predefined",fillOpacity:"Fill Opacity",strokeColor:"Line Color",strokeOpacity:"Line Opacity",miniChart:"Mini-Chart",histogramBinCount:"Bin count",connectorLine:"Connector Line",seriesItems:"Series Items",seriesItemType:"Item Type",seriesItemPositive:"Positive",seriesItemNegative:"Negative",seriesItemLabels:"Item Labels",columnGroup:"Column",barGroup:"Bar",pieGroup:"Pie",lineGroup:"Line",scatterGroup:"X Y (Scatter)",areaGroup:"Area",polarGroup:"Polar",statisticalGroup:"Statistical",hierarchicalGroup:"Hierarchical",specializedGroup:"Specialized",combinationGroup:"Combination",groupedColumnTooltip:"Grouped",stackedColumnTooltip:"Stacked",normalizedColumnTooltip:"100% Stacked",groupedBarTooltip:"Grouped",stackedBarTooltip:"Stacked",normalizedBarTooltip:"100% Stacked",pieTooltip:"Pie",donutTooltip:"Donut",lineTooltip:"Line",stackedLineTooltip:"Stacked",normalizedLineTooltip:"100% Stacked",groupedAreaTooltip:"Area",stackedAreaTooltip:"Stacked",normalizedAreaTooltip:"100% Stacked",scatterTooltip:"Scatter",bubbleTooltip:"Bubble",histogramTooltip:"Histogram",radialColumnTooltip:"Radial Column",radialBarTooltip:"Radial Bar",radarLineTooltip:"Radar Line",radarAreaTooltip:"Radar Area",nightingaleTooltip:"Nightingale",rangeBarTooltip:"Range Bar",rangeAreaTooltip:"Range Area",boxPlotTooltip:"Box Plot",treemapTooltip:"Treemap",sunburstTooltip:"Sunburst",waterfallTooltip:"Waterfall",heatmapTooltip:"Heatmap",columnLineComboTooltip:"Column & Line",areaColumnComboTooltip:"Area & Column",customComboTooltip:"Custom Combination",innerRadius:"Inner Radius",startAngle:"Start Angle",endAngle:"End Angle",reverseDirection:"Reverse Direction",groupPadding:"Group Padding",seriesPadding:"Series Padding",tile:"Tile",whisker:"Whisker",cap:"Cap",capLengthRatio:"Length Ratio",labelPlacement:"Placement",inside:"Inside",outside:"Outside",noDataToChart:"No data available to be charted.",pivotChartRequiresPivotMode:"Pivot Chart requires Pivot Mode enabled.",chartSettingsToolbarTooltip:"Menu",chartLinkToolbarTooltip:"Linked to Grid",chartUnlinkToolbarTooltip:"Unlinked from Grid",chartDownloadToolbarTooltip:"Download Chart",chartMenuToolbarTooltip:"Menu",chartEdit:"Edit Chart",chartAdvancedSettings:"Advanced Settings",chartLink:"Link to Grid",chartUnlink:"Unlink from Grid",chartDownload:"Download Chart",histogramFrequency:"Frequency",seriesChartType:"Series Chart Type",seriesType:"Series Type",secondaryAxis:"Secondary Axis",seriesAdd:"Add a series",categoryAdd:"Add a category",bar:"Bar",column:"Column",histogram:"Histogram",advancedSettings:"Advanced Settings",direction:"Direction",horizontal:"Horizontal",vertical:"Vertical",seriesGroupType:"Group Type",groupedSeriesGroupType:"Grouped",stackedSeriesGroupType:"Stacked",normalizedSeriesGroupType:"100% Stacked",legendEnabled:"Enabled",invalidColor:"Color value is invalid",groupedColumnFull:"Grouped Column",stackedColumnFull:"Stacked Column",normalizedColumnFull:"100% Stacked Column",groupedBarFull:"Grouped Bar",stackedBarFull:"Stacked Bar",normalizedBarFull:"100% Stacked Bar",stackedAreaFull:"Stacked Area",normalizedAreaFull:"100% Stacked Area",stackedLineFull:"Stacked Line",normalizedLineFull:"100% Stacked Line",customCombo:"Custom Combination",funnel:"Funnel",coneFunnel:"Cone Funnel",pyramid:"Pyramid",funnelGroup:"Funnel",funnelTooltip:"Funnel",coneFunnelTooltip:"Cone Funnel",pyramidTooltip:"Pyramid",dropOff:"Drop-Off",stageLabels:"Stage Labels",reverse:"Reverse",groupedColumn:"Grouped",stackedColumn:"Stacked",pie:"Pie",donut:"Donut",line:"Line",scatter:"Scatter",bubble:"Bubble",area:"Area",stackedArea:"Stacked",radarLine:"Radar Line",radarArea:"Radar Area",nightingale:"Nightingale",radialColumn:"Radial Column",radialBar:"Radial Bar",boxPlot:"Box Plot",rangeBar:"Range Bar",rangeArea:"Range Area",treemap:"Treemap",sunburst:"Sunburst",waterfall:"Waterfall",heatmap:"Heatmap",columnLineCombo:"Column & Line",AreaColumnCombo:"Area & Column",ariaChartMenuClose:"Close Chart Edit Menu",ariaChartSelected:"Selected",group:"Group",timeFormatSlashesDDMMYYYY:"DD/MM/YYYY",timeFormatSlashesMMDDYYYY:"MM/DD/YYYY",timeFormatSlashesDDMMYY:"DD/MM/YY",timeFormatSlashesMMDDYY:"MM/DD/YY",timeFormatDotsDDMYY:"DD.M.YY",timeFormatDotsMDDYY:"M.DD.YY",timeFormatDashesYYYYMMDD:"YYYY-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM YYYY",timeFormatHHMMSS:"HH:MM:SS",timeFormatHHMMSSAmPm:"HH:MM:SS AM/PM",sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},xL=class extends bL{constructor(){super(...arguments),this.beanName="chartTranslation"}translate(e){const t=this.getLocaleTextFunc(),s=wL[e];return t(e,s)}};import{BeanStub as TL,_focusInto as ML,_warn as ii}from"ag-grid-community";import{Component as PL,RefPlaceholder as es,_clearElement as FL,_errMsg as Bc,_focusGridInnerElement as AL,_focusInto as RL,_getAbsoluteHeight as EL,_getAbsoluteWidth as IL,_mergeDeep as DL,_removeFromParent as LL,_setDisplayed as _c,_warn as Vc}from"ag-grid-community";import{BeanStub as kL,_warn as Hc}from"ag-grid-community";import{_warnOnce as ts}from"ag-grid-community";var yt=e=>t=>t==null?!0:e(t),zc=e=>typeof e=="string",Uc=e=>typeof e=="boolean",GL=e=>typeof e=="object",Pe=(e,t)=>s=>`AG Grid - unable to update chart as invalid params supplied: \`${e}: ${s}\`, expected ${t}.`,Kc=e=>`${e} is not supported in AG Charts Community ('ag-charts-enterprise' hasn't been loaded). See https://www.ag-grid.com/javascript-data-grid/integrated-charts-installation/ for more details.`,OL=["doughnut"],Jr=["type","chartId","chartType","chartThemeName","chartThemeOverrides","unlinkChart"];function NL(e){return!!Tc(e)||Kr(e)}function BL(e){return OL.includes(e)}var _L=yt(e=>{if(NL(e))return!0;if(BL(e)){const t=Jt(e);return ts(`The chart type '${e}' has been deprecated. Please use '${t}' instead.`),t}return!1}),VL=yt(e=>typeof e=="object"),HL=yt(e=>typeof e=="object"),zL=yt(e=>typeof e=="string"||typeof e=="function"),Wc=e=>({property:"chartType",validationFn:yt(t=>e||!t||!EI(t)),warnMessage:t=>Kc(`The '${t}' chart type`)}),jc=e=>({property:"switchCategorySeries",validationFn:yt(t=>{if(!t||e)return!0}),warnMessage:()=>Kc("'switchCategorySeries' has been ignored as it"),warnIfFixed:!0}),Qr=()=>[{property:"chartId",validationFn:zc,warnMessage:Pe("chartId","string")},{property:"chartType",validationFn:_L,warnMessage:Pe("chartType","ChartType")},{property:"chartThemeName",validationFn:zc,warnMessage:Pe("chartThemeName","string")},{property:"chartThemeOverrides",validationFn:VL,warnMessage:Pe("chartThemeOverrides","AgChartThemeOverrides")},{property:"unlinkChart",validationFn:Uc,warnMessage:Pe("unlinkChart","boolean")}],$c=e=>[{property:"cellRange",validationFn:HL,warnMessage:Pe("cellRange","ChartParamsCellRange")},{property:"suppressChartRanges",validationFn:Uc,warnMessage:Pe("suppressChartRanges","boolean")},{property:"aggFunc",validationFn:zL,warnMessage:Pe("aggFunc","string or IAggFunc")},jc(e)];function UL(e,t){switch(e.type){case"rangeChartUpdate":return WL(e,t);case"pivotChartUpdate":return jL(e);case"crossFilterChartUpdate":return $L(e,t);default:return ts(`Invalid value supplied for 'type': ${e.type}. It must be either 'rangeChartUpdate', 'pivotChartUpdate', or 'crossFilterChartUpdate'.`),!1}}function KL(e,t){return ri(e,[Wc(t),jc(t)])}function WL(e,t){const s=[...Qr(),Wc(t),...$c(t),{property:"seriesChartTypes",validationFn:i=>i===void 0||Array.isArray(i)&&i.every(GL),warnMessage:Pe("seriesChartTypes","Array of SeriesChartType")}];return ri(e,s,[...Jr,"cellRange","suppressChartRanges","switchCategorySeries","aggFunc","seriesChartTypes","seriesGroupType"],"UpdateRangeChartParams")}function jL(e){const t=[...Qr()];return ri(e,t,[...Jr],"UpdatePivotChartParams")}function $L(e,t){const s=[...Qr(),...$c(t)];return ri(e,s,[...Jr,"cellRange","suppressChartRanges","aggFunc"],"UpdateCrossFilterChartParams")}function ri(e,t,s,i){let r;for(const a of t){const{property:o,validationFn:n,warnMessage:l,warnIfFixed:c}=a;if(o in e){const d=e[o],h=n(d);if(h===!0)continue;if(h===!1)return ts(l(d)),!1;r=r||{...e},r[o]=h,c&&ts(l(d))}}if(s){for(const a of Object.keys(e))if(!s.includes(a))return ts(`Unexpected property supplied. ${i} does not contain: \`${a}\`.`),!1}return r||!0}var Yc=["ag-default","ag-material","ag-sheets","ag-polychroma","ag-vivid"],YL=class extends kL{constructor(e){super(),this.model=e,this.isEnterprise=()=>this.agChartsExports.isEnterprise}wireBeans(e){this.rangeSvc=e.rangeSvc,this.agChartsExports=e.agChartsExports}postConstruct(){this.setChartRange(),this.model.unlinked&&this.rangeSvc&&this.rangeSvc.setCellRanges([]);const e=this.updateForGridChange.bind(this,{});this.addManagedEventListeners({cellSelectionChanged:t=>{t.id&&t.id===this.model.chartId&&this.updateForRangeChange()},columnMoved:e,columnPinned:e,columnVisible:e,columnRowGroupChanged:e,modelUpdated:e,cellValueChanged:this.updateForDataChange.bind(this)})}update(e){if(!this.validUpdateType(e))return!1;const t=UL(e,this.agChartsExports.isEnterprise);if(!t)return!1;const s=t===!0?e:t;return this.applyValidatedChartParams(s),!0}applyValidatedChartParams(e){const{chartId:t,chartType:s,chartThemeName:i,unlinkChart:r}=e,o={...{chartId:t,pivotChart:this.model.pivotChart,chartType:s??this.model.chartType,chartThemeName:i??this.model.chartThemeName,unlinkChart:r??this.model.unlinked,cellRange:this.model.suppliedCellRange,switchCategorySeries:this.model.switchCategorySeries,aggFunc:this.model.aggFunc,seriesChartTypes:void 0,suppressChartRanges:!1,crossFiltering:!1}};switch(e.type){case"rangeChartUpdate":o.cellRange=this.createCellRange(e)??this.model.suppliedCellRange,o.switchCategorySeries=e.switchCategorySeries??this.model.switchCategorySeries,o.aggFunc=e.aggFunc??this.model.aggFunc,o.seriesChartTypes=e.seriesChartTypes,o.suppressChartRanges=e.suppressChartRanges??this.model.suppressChartRanges,o.seriesGroupType=e.seriesGroupType??this.model.seriesGroupType;break;case"crossFilterChartUpdate":o.cellRange=this.createCellRange(e)??this.model.suppliedCellRange,o.switchCategorySeries=!1,o.aggFunc=e.aggFunc??this.model.aggFunc,o.crossFiltering=!0,o.suppressChartRanges=e.suppressChartRanges??this.model.suppressChartRanges;break;case"pivotChartUpdate":o.switchCategorySeries=!1;break}this.model.updateModel(o),o.unlinkChart||o.suppressChartRanges?this.rangeSvc?.setCellRanges([]):this.setChartRange()}updateForGridChange(e){if(this.model.unlinked)return;const{maintainColState:t,setColsFromRange:s}=e??{};this.model.updateCellRanges({maintainColState:t,setColsFromRange:s}),this.model.updateData(),this.setChartRange()}updateForDataChange(){this.model.unlinked||(this.model.updateData(),this.raiseChartModelUpdateEvent())}updateForRangeChange(){this.updateForGridChange({setColsFromRange:!0}),this.raiseChartRangeSelectionChangedEvent()}updateForPanelChange(e){this.model.updateCellRanges(e),this.model.updateData(),e.skipAnimation&&this.getChartProxy().getChartRef().skipAnimations(),this.setChartRange(),this.raiseChartRangeSelectionChangedEvent()}updateThemeOverrides(e){this.chartProxy.updateThemeOverrides(e)}getChartUpdateParams(e){const s=this.getSelectedValueColState().map(o=>({colId:o.colId,displayName:o.displayName})),i=this.getChartData(),r=this.getSelectedDimensions(),a={data:i,groupData:this.model.groupChartData,grouping:this.isGrouping(),categories:r.map(o=>({id:o.colId,name:o.displayName,chartDataType:this.model.categoryAxisType??this.model.getChartDataType(o.colId)})),fields:s,chartId:this.getChartId(),getCrossFilteringContext:()=>({lastSelectedChartId:"xxx"}),seriesChartTypes:this.getSeriesChartTypes(),updatedOverrides:e,seriesGroupType:this.model.seriesGroupType};return this.isCategorySeriesSwitched()?this.invertCategorySeriesParams(a):a}invertCategorySeriesParams(e){const[t]=e.categories,s=[{id:me,name:""}],i=e.data.map((a,o)=>{const n=`${t.id}:${o}`,l=a[t.id],c=l==null?"":String(l);return{colId:n,displayName:c}}),r=e.fields.map(a=>{const o={[me]:a.displayName};for(const[n,l]of e.data.entries()){const c=`${t.id}:${n}`,d=l[a.colId];o[c]=d}return o});return{...e,categories:s,fields:i,data:r}}getChartModel(){const e=this.model.pivotChart?"pivot":"range",t=this.isComboChart()?this.model.comboChartModel.seriesChartTypes:void 0;return{modelType:e,chartId:this.model.chartId,chartType:this.model.chartType,chartThemeName:this.getChartThemeName(),chartOptions:this.chartProxy?.getChartThemeOverrides(),chartPalette:this.chartProxy?.getChartPalette(),cellRange:this.getCellRangeParams(),switchCategorySeries:this.model.switchCategorySeries,suppressChartRanges:this.model.suppressChartRanges,aggFunc:this.model.aggFunc,unlinkChart:this.model.unlinked,seriesChartTypes:t,seriesGroupType:this.model.seriesGroupType}}getChartId(){return this.model.chartId}getChartData(){return this.model.chartData}getChartType(){return this.model.chartType}setChartType(e){this.updateMultiSeriesAndCategory(this.model.chartType,e),this.model.chartType=e,this.model.comboChartModel.updateSeriesChartTypes(),this.model.switchCategorySeries=!1,this.model.categoryAxisType=void 0,this.model.seriesGroupType=void 0,this.raiseChartModelUpdateEvent()}isCategorySeriesSwitched(){return this.model.switchCategorySeries&&!this.model.isGrouping()}switchCategorySeries(e){Pc(this.getChartType())&&(this.model.switchCategorySeries=e,this.raiseChartModelUpdateEvent())}getAggFunc(){return this.model.aggFunc}setAggFunc(e,t){this.model.aggFunc!==e&&(this.model.aggFunc=e,!t&&(this.model.updateData(),this.raiseChartModelUpdateEvent()))}updateMultiSeriesAndCategory(e,t){const s=(n,l)=>{let c=0;for(const d of n)d.selected&&(c>=l?d.selected=!1:c++);c===0&&(n[0].selected=!0)},i=jr(t),r=Qs(t),a=i!=null&&(jr(e)??100)>(i??100),o=r!=null&&(Qs(e)??100)>(r??100);a&&s(this.model.dimensionColState,i),o&&s(this.model.valueColState,r),(a||o)&&(this.model.resetCellRanges(a,o),this.setChartRange(!0))}setChartThemeName(e,t){this.model.chartThemeName=e,t||this.raiseChartModelUpdateEvent()}getChartThemeName(){return this.model.chartThemeName}isPivotChart(){return this.model.pivotChart}isPivotMode(){return this.model.isPivotMode()}isGrouping(){return this.model.isGrouping()}isCrossFilterChart(){return this.model.crossFiltering}getThemeNames(){return this.gos.get("chartThemes")||Yc}getThemes(){return this.getThemeNames().map(t=>{const i=Yr(t,this.agChartsExports._Theme)?t:this.chartProxy.lookupCustomChartTheme(t);return this.agChartsExports._Theme.getChartTheme(i)})}getPalettes(){return this.getThemes().map(t=>t.palette)}getThemeTemplateParameters(){return this.getThemes().map(t=>t.getTemplateParameters())}getValueColState(){return this.model.valueColState.map(this.displayNameMapper.bind(this))}getSelectedValueColState(){return this.getValueColState().filter(e=>e.selected)}getSelectedDimensions(){return this.model.getSelectedDimensions()}displayNameMapper(e){const{column:t}=e;if(t)e.displayName=this.model.getColDisplayName(t,this.model.isPivotMode());else{const s=this.model.colNames[e.colId];e.displayName=s?s.join(" - "):this.model.getColDisplayName(t)}return e}getColStateForMenu(){return{dimensionCols:this.model.dimensionColState,valueCols:this.getValueColState()}}setChartRange(e=!1){this.rangeSvc&&!this.model.suppressChartRanges&&!this.model.unlinked&&this.rangeSvc.setCellRanges(this.getCellRanges()),e||this.raiseChartModelUpdateEvent()}detachChartRange(){this.model.unlinked=!this.model.unlinked,this.model.unlinked?this.rangeSvc&&this.rangeSvc.setCellRanges([]):this.updateForGridChange(),this.dispatchLocalEvent({type:"chartLinkedChanged"})}setChartProxy(e){this.chartProxy=e}getChartProxy(){return this.chartProxy}isActiveXYChart(){return["scatter","bubble"].includes(this.getChartType())}isChartLinked(){return!this.model.unlinked}customComboExists(){const e=this.model.comboChartModel.savedCustomSeriesChartTypes;return e&&e.length>0}getSeriesChartTypes(){return this.model.comboChartModel.seriesChartTypes}isComboChart(e){return this.model.isComboChart(e)}updateSeriesChartType(e,t,s){const i=this.model.comboChartModel.seriesChartTypes.find(r=>r.colId===e);if(i){const r=this.model.chartType!=="customCombo";r&&(this.model.chartType="customCombo");const a=i.chartType;t!=null&&(i.chartType=t),s!=null&&(i.secondaryAxis=s),this.model.comboChartModel.savedCustomSeriesChartTypes=this.model.comboChartModel.seriesChartTypes,this.model.comboChartModel.updateSeriesChartTypes(),this.updateForDataChange(),r&&this.dispatchLocalEvent({type:"chartTypeChanged"}),a!==t&&this.dispatchLocalEvent({type:"chartSeriesChartTypeChanged"}),this.raiseChartOptionsChangedEvent()}}getActiveSeriesChartTypes(){const e=this.getSelectedValueColState().map(t=>t.colId);return this.getSeriesChartTypes().filter(t=>e.includes(t.colId))}getChartSeriesTypes(e){const t=e??this.getChartType();return this.isComboChart(t)?["line","bar","area"]:[B(t)]}getChartSeriesType(){const e=this.getSeriesChartTypes();if(e.length===0)return"bar";const t=e[0].chartType;return t==="columnLineCombo"?"bar":t==="areaColumnCombo"?"area":B(t)}getCellRanges(){return[this.model.dimensionCellRange,this.model.valueCellRange].filter(e=>e)}createCellRange(e){return e.cellRange&&this.rangeSvc?.createPartialCellRangeFromRangeParams(e.cellRange,!0)}validUpdateType(e){if(!e.type)return Hc(136),!1;const t={"Range Chart":()=>!this.isPivotChart()&&!this.isCrossFilterChart(),"Pivot Chart":()=>this.isPivotChart(),"Cross Filter Chart":()=>this.isCrossFilterChart()},s=Object.keys(t).find(r=>t[r]())??"Range Chart",i=e.type===`${s[0].toLowerCase()}${s.slice(1).replace(/ /g,"")}Update`;return i||Hc(137,{currentChartType:s,type:e.type}),i}getCellRangeParams(){const e=this.getCellRanges(),t=e[0],s=t&&t.startRow||null,i=t&&t.endRow||null;return{rowStartIndex:s&&s.rowIndex,rowStartPinned:s&&s.rowPinned,rowEndIndex:i&&i.rowIndex,rowEndPinned:i&&i.rowPinned,columns:e.reduce((r,a)=>r.concat(a.columns.map(o=>o.getId())),[])}}setCategoryAxisType(e){this.model.categoryAxisType=e,this.raiseChartModelUpdateEvent()}getSeriesGroupType(){return this.model.seriesGroupType??this.chartProxy.getSeriesGroupType()}setSeriesGroupType(e){this.model.seriesGroupType=e,this.raiseChartModelUpdateEvent()}raiseChartModelUpdateEvent(){this.dispatchLocalEvent({type:"chartModelUpdate"}),this.raiseChartOptionsChangedEvent()}raiseChartUpdatedEvent(){this.dispatchLocalEvent({type:"chartUpdated"})}raiseChartApiUpdateEvent(){this.dispatchLocalEvent({type:"chartApiUpdate"})}raiseChartOptionsChangedEvent(){const{chartId:e,chartType:t}=this.getChartModel();this.eventSvc.dispatchEvent({type:"chartOptionsChanged",chartId:e,chartType:t,chartThemeName:this.getChartThemeName(),chartOptions:this.chartProxy?.getChartThemeOverrides()})}raiseChartRangeSelectionChangedEvent(){this.eventSvc.dispatchEvent({type:"chartRangeSelectionChanged",id:this.model.chartId,chartId:this.model.chartId,cellRange:this.getCellRangeParams()})}destroy(){super.destroy(),this.rangeSvc&&this.rangeSvc.setCellRanges([])}},XL=class extends Ve{getAxes(e){const t=[{type:this.getXAxisType(e),position:"bottom"},{type:"number",position:"left"}];if(this.isNormalised()){const s=t[1];s.label={...s.label,formatter:i=>Math.round(i.value)+"%"}}return t}getSeries(e){const[t]=e.categories,s=e.fields.map(i=>({type:this.standaloneChartType,xKey:t.id,xName:t.name,yKey:i.colId,yName:i.displayName,normalizedTo:this.chartType==="normalizedArea"?100:void 0,stacked:["normalizedArea","stackedArea"].includes(this.chartType)}));return this.crossFiltering?this.extractLineAreaCrossFilterSeries(s,e):s}isNormalised(){return!this.crossFiltering&&this.chartType==="normalizedArea"}};function Xc(e,t){const s=parseInt(e.slice(1,3),16),i=parseInt(e.slice(3,5),16),r=parseInt(e.slice(5,7),16);return t?`rgba(${s}, ${i}, ${r}, ${t})`:`rgba(${s}, ${i}, ${r})`}var qL=new Set(["bar","groupedBar","stackedBar","normalizedBar"]),ZL=class extends Ve{getAxes(e){const t=[{type:this.getXAxisType(e),position:this.isHorizontal()?"left":"bottom"},{type:"number",position:this.isHorizontal()?"bottom":"left"}];if(this.isNormalised()){const s=t[1];s.label={...s.label,formatter:i=>Math.round(i.value)+"%"}}return t}getSeries(e){const[t]=e.categories,s=e.fields.map(i=>({type:this.standaloneChartType,direction:this.isHorizontal()?"horizontal":"vertical",stacked:this.crossFiltering||DI(this.chartType),normalizedTo:this.isNormalised()?100:void 0,xKey:t.id,xName:t.name,yKey:i.colId,yName:i.displayName}));return this.crossFiltering?this.extractCrossFilterSeries(s):s}extractCrossFilterSeries(e){const t=this.getChartPalette(),s=(a,o)=>({...a,highlightStyle:{item:{fill:void 0}},fill:t?.fills?.[o],stroke:t?.strokes?.[o],listeners:{nodeClick:this.crossFilterCallback}}),i=a=>{const o=a.yKey+"-filtered-out";return{...a,yKey:o,fill:Xc(a.fill,"0.3"),stroke:Xc(a.stroke,"0.3"),showInLegend:!1}},r=[];for(let a=0;aMath.round(i.value)+"%"}}return t}getSeries(e){const[t]=e.categories,s=["normalizedLine","stackedLine"].includes(this.chartType),i=e.fields.map(r=>({type:this.standaloneChartType,xKey:t.id,xName:t.name,yKey:r.colId,yName:r.displayName,normalizedTo:s&&this.isNormalised()?100:void 0,stacked:s}));return this.crossFiltering?this.extractLineAreaCrossFilterSeries(i,e):i}isNormalised(){const e=["normalizedLine"];return!this.crossFiltering&&e.includes(this.chartType)}},QL=class extends Ve{getAxes(e){return[{type:"number",position:"bottom"},{type:"number",position:"left"}]}getSeries(e){const[t]=e.categories,s=this.isPaired(),i=this.getSeriesDefinitions(e.fields,s),r=t.id===me?void 0:t,a=i.map(o=>o?.sizeField?{type:"bubble",xKey:o.xField.colId,xName:o.xField.displayName??void 0,yKey:o.yField.colId,yName:o.yField.displayName??void 0,title:`${o.yField.displayName} vs ${o.xField.displayName}`,sizeKey:o.sizeField.colId,sizeName:o.sizeField.displayName??"",labelKey:r?r.id:o.yField.colId,labelName:r?r.name:void 0}:{type:"scatter",xKey:o.xField.colId,xName:o.xField.displayName??void 0,yKey:o.yField.colId,yName:o.yField.displayName??void 0,title:`${o.yField.displayName} vs ${o.xField.displayName}`,labelKey:r?r.id:o.yField.colId,labelName:r?r.name:void 0});return this.crossFiltering?this.extractCrossFilterSeries(a,e):a}extractCrossFilterSeries(e,t){const{data:s}=t,i=this.getChartPalette(),r=c=>`${c}-filtered-out`,a=(c,d)=>{const h=[1/0,-1/0];if(d!=null)for(const u of c){const p=u[d]??u[r(d)];ph[1]&&(h[1]=p)}if(h[0]<=h[1])return h},o=(c,d)=>{const h=i?.fills?.[d],u=i?.strokes?.[d];let p;if(c.type==="bubble"){const{sizeKey:g}=c;p=a(s,g)}return{...c,fill:h,stroke:u,domain:p,highlightStyle:{item:{fill:"yellow"}},listeners:{...c.listeners,nodeClick:this.crossFilterCallback}}},n=c=>{const{yKey:d,xKey:h}=c;let u={};return c.type==="bubble"&&(u={sizeKey:r(c.sizeKey)}),{...c,...u,yKey:r(d),xKey:r(h),fillOpacity:.3,strokeOpacity:.3,showInLegend:!1,listeners:{...c.listeners,nodeClick:p=>{const g=p.datum[r(h)],m={...p,xKey:h,datum:{...p.datum,[h]:g}};this.crossFilterCallback(m)}}}},l=e.map(o);return[...l,...l.map(n)]}getSeriesDefinitions(e,t){if(e.length<2)return[];const s=this.chartType==="bubble";if(t)return s?e.map((r,a)=>a%3===0?{xField:r,yField:e[a+1],sizeField:e[a+2]}:null).filter(r=>r&&r.yField&&r.sizeField):e.map((r,a)=>a%2===0?{xField:r,yField:e[a+1]}:null).filter(r=>r&&r.yField);const i=e[0];return s?e.map((r,a)=>a%2===1?{xField:i,yField:r,sizeField:e[a+1]}:null).filter(r=>r&&r.sizeField):e.filter((r,a)=>a>0).map(r=>({xField:i,yField:r}))}},ek=class extends Ve{getAxes(e){const t=e?e.fields:[],s=new Map(t.map(o=>[o.colId,o])),{primaryYKeys:i,secondaryYKeys:r}=this.getYKeys(t,e.seriesChartTypes),a=[{type:this.getXAxisType(e),position:"bottom"}];return i.length>0&&a.push({type:"number",keys:i,position:"left"}),r.length>0&&r.forEach(o=>{const n=s.get(o);if(!(n&&n.colId===o))return;const c={type:"number",keys:[o],position:"right"};a.push(c)}),a}getSeries(e){const{fields:t,seriesChartTypes:s}=e,[i]=e.categories;return t.map(r=>{const a=s.find(o=>o.colId===r.colId);if(a){const o=a.chartType,l=["groupedColumn","groupedBar"].includes(o)?{grouped:!0}:{};return{type:B(o),xKey:i.id,yKey:r.colId,yName:r.displayName,stacked:["stackedArea","stackedColumn"].includes(o),...l}}})}getYKeys(e,t){const s=[],i=[];return e.forEach(r=>{const a=r.colId,o=t.find(n=>n.colId===a);o&&(o.secondaryAxis?i.push(a):s.push(a))}),{primaryYKeys:s,secondaryYKeys:i}}};function tk(e){const t=e.currentOffset;e.currentOffset-=e.offsetAmount;const s=e.currentOffset;return e.currentOffset-=e.offsetAmount,{outerRadiusOffset:t,innerRadiusOffset:s}}var sk=class extends vt{getUpdateOptions(e,t){return{...t,data:this.crossFiltering?this.getCrossFilterData(e):e.data,series:this.getSeries(e)}}getSeries(e){const[t]=e.categories,s=e.fields.length,i={currentOffset:0,offsetAmount:s>1?20:40},r=this.getFields(e).map(a=>{const o={type:this.standaloneChartType,angleKey:a.colId,angleName:a.displayName,sectorLabelKey:a.colId,calloutLabelName:t.name,calloutLabelKey:t.id};if(this.chartType==="donut"||this.chartType==="doughnut"){const{outerRadiusOffset:n,innerRadiusOffset:l}=tk(i),c=a.displayName?{title:{text:a.displayName,showInLegend:s>1}}:void 0;return{...o,type:"donut",outerRadiusOffset:n,innerRadiusOffset:l,...c,calloutLine:{colors:this.getChartPalette()?.strokes}}}return o});return this.crossFiltering?this.extractCrossFilterSeries(r):r}getCrossFilterData(e){const t=e.fields[0].colId,s=`${t}-filtered-out`;return e.data.map(i=>{const r=i[t]+i[s];return i[`${t}-total`]=r,i[s]=1,i[t]=i[t]/r,i})}extractCrossFilterSeries(e){const t=this.getChartPalette(),s=n=>({...n,legendItemKey:n.calloutLabelKey,calloutLabel:{enabled:!1},highlightStyle:{item:{fill:void 0}},radiusKey:n.angleKey,angleKey:n.angleKey+"-total",radiusMin:0,radiusMax:1,listeners:{nodeClick:this.crossFilterCallback}}),i=(n,l)=>({...o,radiusKey:l+"-filtered-out",fills:this.changeOpacity(n.fills??t?.fills??[],.3),strokes:this.changeOpacity(n.strokes??t?.strokes??[],.3),showInLegend:!1}),r=e[0],a=r.angleKey,o=s(r);return[i(s(r),a),o]}getFields(e){return this.chartType==="pie"?e.fields.slice(0,1):e.fields}changeOpacity(e,t){const s=this.agChartsExports._Util.Color;return e.map(i=>{const r=s.fromString(i);return new s(r.r,r.g,r.b,t).toHexString()})}};import{AgPromise as ik,Component as rk,_warn as ak}from"ag-grid-community";import{Component as ok,RefPlaceholder as nk,_clearElement as lk,_createIconNoSpan as ck,_getDocument as dk}from"ag-grid-community";var hk=class extends ok{constructor(){super('
'),this.eMenu=nk,this.buttonListenersDestroyFuncs=[]}wireBeans(e){this.chartTranslation=e.chartTranslation}updateParams(e){const{buttons:t}=e;this.createButtons(t)}createButtons(e){this.buttonListenersDestroyFuncs.forEach(s=>s?.()),this.buttonListenersDestroyFuncs=[];const t=this.eMenu;lk(t),e.forEach(s=>{const{buttonName:i,iconName:r,callback:a}=s,o=this.createButton(r),n=this.chartTranslation.translate(i+"ToolbarTooltip");n&&o instanceof HTMLElement&&(o.title=n),this.buttonListenersDestroyFuncs.push(...this.addManagedElementListeners(o,{click:l=>a(l.currentTarget)})),t.appendChild(o)})}createButton(e){const t=ck(e,this.beans);t.classList.add("ag-chart-menu-icon");const s=dk(this.beans).createElement("button");return s.appendChild(t),s.classList.add("ag-chart-menu-toolbar-button"),s}destroy(){this.buttonListenersDestroyFuncs=[],super.destroy()}};import{AgPromise as uk,Component as pk}from"ag-grid-community";import{AgToggleButton as gk,Component as mk,_getDocument as fk,_setDisplayed as Ck,_warn as vk}from"ag-grid-community";import{AgSelect as yk,AgToggleButton as Sk}from"ag-grid-community";import{AgSelect as bk,Component as wk}from"ag-grid-community";import{AgSelect as xk,Component as Tk,DragSourceType as qc,_escapeString as Mk,_getActiveDomElement as Pk,_removeFromParent as Fk}from"ag-grid-community";var Ak=".ag-pill-select{display:flex;flex-direction:column}:where(.ag-pill-select){.ag-column-drop-list{padding:0}.ag-select{padding-top:var(--ag-spacing)}.ag-picker-field-wrapper{background-color:transparent;border:0}.ag-picker-field-display{cursor:pointer;font-weight:500}.ag-picker-field-display,.ag-picker-field-icon{color:var(--ag-chart-menu-label-color)}}",Rk=class extends Tk{constructor(e){super(''),this.config=e??{};const{selectedValueList:t,valueFormatter:s,valueList:i}=this.config;this.selectedValues=t??[],this.valueList=i??[],this.valueFormatter=s??(r=>Mk(r)),this.registerCSS(Ak)}postConstruct(){const{ariaLabel:e,onValuesChange:t,dragSourceId:s}=this.config;this.dropZonePanel=this.createManagedBean(new Ik({getValues:()=>this.selectedValues,setValues:r=>this.updateValues(r),isDraggable:()=>this.selectedValues.length>1},r=>this.valueFormatter(r),e,s)),this.getGui().appendChild(this.dropZonePanel.getGui()),this.initSelect(),t!=null&&(this.onValuesChange=t)}setValues(e,t){const{added:s,removed:i,updated:r}=this.getChanges(this.valueList,e);let a=!1;return(s.length||i.length||r.length)&&(a=!0),this.valueList=e,this.updateValues(t,a,!0),this}setValueFormatter(e){return this.valueFormatter=e,this}initSelect(){const e=this.createSelectOptions();if(!e.length)return!1;const{selectPlaceholder:t}=this.config;return this.eSelect=this.createBean(new xk({options:e,placeholder:t,onValueChange:s=>this.addValue(s),pickerIcon:"chartsMenuAdd"})),this.getGui().appendChild(this.eSelect.getGui()),!0}createSelectOptions(){const e=[],{maxSelection:t}=this.config;return t&&this.selectedValues.length>=t||this.valueList.forEach(s=>{this.selectedValues.includes(s)||e.push({value:s,text:this.valueFormatter(s)})}),e}addValue(e){this.dropZonePanel.addItem(e)}updateValues(e,t,s){const i=this.selectedValues;this.selectedValues=e;const r=this.getChanges(i,e),a=t||r.added.length||r.removed.length,o=Pk(this.beans),n=this.eSelect?.getGui().contains(o),l=this.dropZonePanel?.getGui().contains(o);s||this.onValuesChange?.(r);const c=a?!this.refreshSelect():!1;this.dropZonePanel.refreshGui(),a&&n&&(c?this.dropZonePanel.focusList(!0):this.eSelect?.getFocusableElement().focus()),l&&!e.length&&this.eSelect?.getFocusableElement().focus()}getChanges(e,t){const s=t.filter(a=>!e.includes(a)),i=e.filter(a=>!t.includes(a)),r=t.filter((a,o)=>e[o]!==a);return{added:s,removed:i,updated:r,selected:t}}refreshSelect(){if(!this.eSelect)return this.initSelect();const e=this.createSelectOptions();return e.length?(this.eSelect.clearOptions().addOptions(e).setValue(void 0,!0),!0):(Fk(this.eSelect.getGui()),this.eSelect=this.destroyBean(this.eSelect),!1)}destroy(){this.destroyBean(this.eSelect),super.destroy()}},Ek=class extends Qo{constructor(e,t,s,i,r,a){super(t,s,!1),this.value=e,this.valueFormatter=i,this.draggable=r,this.sourceId=a}getItem(){return this.value}getDisplayName(){return this.valueFormatter(this.value)}getAriaDisplayName(){return this.getDisplayName()}getTooltip(){}createGetDragItem(){return()=>({value:this.value})}getDragSourceType(){return qc.ChartPanel}getDragSourceId(){return this.sourceId}isDraggable(){return this.draggable}},Ik=class extends Zo{constructor(e,t,s,i){super(!1),this.model=e,this.valueFormatter=t,this.ariaLabel=s,this.sourceId=i}postConstruct(){super.init()}isItemDroppable(e,t){return this.isSourceEventFromTarget(t)||this.sourceId!=null&&this.sourceId===t.dragSource.sourceId}updateItems(e){this.model.setValues(e)}getExistingItems(){return this.model.getValues()}getIconName(){return this.isPotentialDndItems()?"move":"notAllowed"}getAriaLabel(){return this.ariaLabel}createPillComponent(e,t,s){return new Ek(e,t,s,this.valueFormatter,this.model.isDraggable(),this.sourceId)}getItems(e){return[e.value]}isInterestedIn(e){return e===qc.ChartPanel}},Zc=class extends wk{constructor(e,t,s,i){super(i),this.chartController=e,this.allowMultipleSelection=t,this.maxSelection=s}wireBeans(e){this.chartTranslation=e.chartTranslation}addItem(e){this.groupComp.addItem(e)}createGroup(e,t,s,i,r){if(this.allowMultipleSelection){const a=e.filter(o=>o.selected);this.valuePillSelect=this.groupComp.createManagedBean(new Rk({valueList:e,selectedValueList:a,valueFormatter:t,selectPlaceholder:this.chartTranslation.translate(s),dragSourceId:i,onValuesChange:o=>this.onValueChange(o),maxSelection:this.maxSelection})),this.groupComp.addItem(this.valuePillSelect)}else{const a=this.createValueSelectParams(e);a.onValueChange=o=>{e.forEach(n=>{n.selected=!1}),o.selected=!0,o.colId===me&&this.chartController.setAggFunc(void 0,!0),this.chartController.updateForPanelChange({updatedColState:o,skipAnimation:r?.()})},this.valueSelect=this.groupComp.createManagedBean(new bk(a)),this.groupComp.addItem(this.valueSelect)}}refreshValueSelect(e){if(!this.valueSelect)return;const{options:t,value:s}=this.createValueSelectParams(e);this.valueSelect.clearOptions().addOptions(t).setValue(s,!0)}createValueSelectParams(e){let t;return{options:e.map(i=>{const r=i.displayName??"";return i.selected&&(t=i),{value:i,text:r}}),value:t}}onValueChange({added:e,updated:t,removed:s,selected:i}){let r,a;const o=()=>{i.forEach((n,l)=>{n.order=l}),a=!0};e.length?(r=e[0],r.selected=!0,o()):s.length?(r=s[0],r.selected=!1):t.length&&(o(),r=t[0]),r&&this.chartController.updateForPanelChange({updatedColState:r,resetOrder:a})}destroy(){this.valuePillSelect=void 0,this.valueSelect=void 0,super.destroy()}},Dk="sum",Lk=class extends Zc{constructor(e,t,s,i,r){super(e,s,void 0,'
'),this.title=t,this.dimensionCols=i,this.isOpen=r}postConstruct(){this.groupComp=this.createBean(new Se({title:this.title,enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!1,cssIdentifier:"charts-data",expanded:this.isOpen})),this.createGroup(this.dimensionCols,e=>e.displayName??"","categoryAdd","categorySelect",()=>!this.chartController.getAggFunc()),this.createAggFuncControls(this.dimensionCols),this.getGui().appendChild(this.groupComp.getGui())}refresh(e){this.valuePillSelect?.setValues(e,e.filter(t=>t.selected)),this.refreshValueSelect(e),this.refreshAggFuncControls(e,this.chartController.getAggFunc())}createAggFuncControls(e){const t=this.chartController.getAggFunc();this.groupComp.addItem(this.aggFuncToggle=this.createBean(new Sk({label:this.chartTranslation.translate("aggregate"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",value:t!=null,onValueChange:s=>{const i=s?Dk:void 0;this.chartController.setAggFunc(i),this.aggFuncSelect?.setValue(i,!0),this.aggFuncSelect?.setDisplayed(i!=null)}}))),this.groupComp.addItem(this.aggFuncSelect=this.createBean(new yk({options:[{value:"sum",text:this.chartTranslation.translate("sum")},{value:"first",text:this.chartTranslation.translate("first")},{value:"last",text:this.chartTranslation.translate("last")},{value:"min",text:this.chartTranslation.translate("min")},{value:"max",text:this.chartTranslation.translate("max")},{value:"count",text:this.chartTranslation.translate("count")},{value:"avg",text:this.chartTranslation.translate("avg")}],value:typeof t=="string"?t:void 0,onValueChange:s=>{this.chartController.setAggFunc(s)}}))),this.refreshAggFuncControls(e,t)}refreshAggFuncControls(e,t){const i=e.filter(r=>r.selected).some(r=>r.colId!==me);this.aggFuncToggle?.setValue(t!=null),this.aggFuncSelect?.setValue(typeof t=="string"?t:void 0,!0),this.aggFuncToggle?.setDisplayed(i),this.aggFuncSelect?.setDisplayed(i&&t!=null)}clearAggFuncControls(){this.aggFuncToggle=this.destroyBean(this.aggFuncToggle),this.aggFuncSelect=this.destroyBean(this.aggFuncSelect)}destroy(){this.clearAggFuncControls(),this.groupComp=this.destroyBean(this.groupComp),super.destroy()}};import{AgSelect as Jc,AgToggleButton as kk,Component as Gk,RefPlaceholder as Ok}from"ag-grid-community";import{BeanStub as Nk}from"ag-grid-community";var tt=class extends Nk{constructor(e){super(),this.chartOptionsProxy=e}wireBeans(e){this.chartTranslation=e.chartTranslation}getDefaultColorPickerParams(e,t,s){return this.addValueParams(e,{label:this.chartTranslation.translate(t??"color"),labelWidth:"flex",inputWidth:"flex",labelAlignment:"top",pickerGap:6},s)}getDefaultNumberInputParams(e,t,s){return this.addValueParams(e,{label:this.chartTranslation.translate(t),labelAlignment:"top",labelWidth:"flex",inputWidth:"flex",precision:s?.precision,step:s?.step,min:s?.min,max:s?.max},{parseInputValue:i=>{const r=Number(i);return isNaN(r)?void 0:r},formatInputValue:i=>i==null?"":`${i}`})}getDefaultSliderParams(e,t,s,i){let r=this.chartOptionsProxy.getValue(e)??0;i&&Array.isArray(r)&&(r=r[0]);const a=this.getDefaultSliderParamsWithoutValueParams(r,t,s);return a.onValueChange=o=>this.chartOptionsProxy.setValue(e,i?[o]:o),a}getDefaultSliderParamsWithoutValueParams(e,t,s){return{label:this.chartTranslation.translate(t),minValue:0,maxValue:Math.max(e,s),textFieldWidth:45,value:`${e}`}}getDefaultCheckboxParams(e,t,s){const i=this.chartOptionsProxy.getValue(e),r={label:this.chartTranslation.translate(t),value:i,readOnly:s?.readOnly,passive:s?.passive};return r.onValueChange=a=>{this.chartOptionsProxy.setValue(e,typeof a=="boolean"?a:void 0)},r}getDefaultToggleParams(e,t,s){const i=this.chartOptionsProxy.getValue(e),r={label:this.chartTranslation.translate(t),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",value:i,readOnly:s?.readOnly,passive:s?.passive};return r.onValueChange=a=>{this.chartOptionsProxy.setValue(e,typeof a=="boolean"?a:void 0)},r}getDefaultSelectParams(e,t,s){return this.getDefaultSelectParamsWithoutValueParams(t,s,this.chartOptionsProxy.getValue(e),i=>{this.chartOptionsProxy.setValue(e,i)})}getDefaultSelectParamsWithoutValueParams(e,t,s,i){return{label:this.chartTranslation.translate(e),labelAlignment:"top",options:t,pickerGap:6,value:s,onValueChange:i}}getDefaultFontPanelParams(e,t){const s=i=>`${e}.${i}`;return this.addEnableParams(s("enabled"),{name:this.chartTranslation.translate(t),suppressEnabledCheckbox:!1,chartMenuParamsFactory:this,keyMapper:s})}addValueParams(e,t,s){const i=this.chartOptionsProxy.getValue(e);return t.value=s?.formatInputValue?s.formatInputValue(i):i,t.onValueChange=r=>{const a=s?.parseInputValue?s.parseInputValue(r):r;this.chartOptionsProxy.setValue(e,a)},t}addEnableParams(e,t){return t.enabled=this.chartOptionsProxy.getValue(e)??!1,t.onEnableChange=s=>this.chartOptionsProxy.setValue(e,s),t}getChartOptions(){return this.chartOptionsProxy}},Bk=class extends Gk{constructor(e,t){super(),this.chartMenuContext=e,this.isOpen=t,this.chartSpecificGroup=Ok,this.hasContent=!1}wireBeans(e){this.chartTranslation=e.chartTranslation,this.chartSvc=e.chartSvc}postConstruct(){const t={title:this.getTitle(),enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!1,cssIdentifier:"charts-data",expanded:this.isOpen,items:[...this.createDirectionSelect(),this.createReverseSelect(),this.createGroupTypeSelect()]};this.setTemplate(`
`,[N],{chartSpecificGroup:t}),this.setDisplayed(this.hasContent)}refresh(){this.hasContent=!1,this.chartSpecificGroup.setTitle(this.getTitle()),this.updateDirectionSelect(),this.updateReverseSelect(),this.updateGroupTypeSelect(),this.setDisplayed(this.hasContent)}getTitle(){const e=this.chartMenuContext.chartController.getChartType();return this.chartTranslation.translate($r(e))}createDirectionSelect(){if(!this.chartSvc.isEnterprise())return[];const{chartOptionsService:e,chartController:t}=this.chartMenuContext,s=e.getSeriesOptionsProxy(()=>B(t.getChartType())),i=this.createManagedBean(new tt(s)),r=["horizontal","vertical"].map(n=>({value:n,text:this.chartTranslation.translate(n)})),a=i.getDefaultSelectParams("direction","direction",r),o=a.onValueChange;return a.onValueChange=n=>{o(n),t.raiseChartModelUpdateEvent()},this.directionSelect=this.createManagedBean(new Jc(a)),this.updateDirectionSelect(),[this.directionSelect]}createReverseSelect(){const{chartMenuParamsFactory:e}=this.chartMenuContext,t=e.getDefaultToggleParams("series.reverse","reverse");return this.reverseToggle=this.createManagedBean(new kk(t)),this.updateReverseSelect(),this.reverseToggle}updateReverseSelect(){const e=this.chartMenuContext.chartController.getChartType()==="pyramid";this.updateDisplayed(this.reverseToggle,e)}updateDirectionSelect(){const e=GI(this.chartMenuContext.chartController.getChartType());this.updateDisplayed(this.directionSelect,e)}createGroupTypeSelect(){const{chartController:e,chartMenuParamsFactory:t}=this.chartMenuContext;return this.groupTypeSelect=this.createManagedBean(new Jc(t.getDefaultSelectParamsWithoutValueParams("seriesGroupType",AI.map(s=>({value:s,text:this.chartTranslation.translate(`${s}SeriesGroupType`)})),e.getSeriesGroupType(),s=>e.setSeriesGroupType(s)))),this.updateGroupTypeSelect(),this.groupTypeSelect}updateGroupTypeSelect(){const e=["radialColumn","radialBar","nightingale"].includes(this.chartMenuContext.chartController.getChartType());this.updateDisplayed(this.groupTypeSelect,e)}updateDisplayed(e,t){e?.setDisplayed(t),e&&(this.hasContent=this.hasContent||t)}};import{AgCheckbox as _k,AgSelect as Vk,Component as Hk,_areEqual as zk,_clearElement as Uk}from"ag-grid-community";var Kk=class extends Hk{constructor(e,t,s){super('
'),this.chartController=e,this.columns=t,this.isOpen=s,this.selectedColIds=[],this.chartTypeComps=new Map,this.secondaryAxisComps=new Map}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){this.createSeriesChartTypeGroup(this.columns)}refresh(e){zk(this.getValidColIds(e),this.selectedColIds)?this.refreshComps():this.recreate(e)}recreate(e){this.isOpen=this.seriesChartTypeGroupComp.isExpanded(),Uk(this.getGui()),this.destroyBean(this.seriesChartTypeGroupComp),this.columns=e,this.selectedColIds=[],this.clearComps(),this.postConstruct()}getValidColIds(e){const t=this.chartController.getSeriesChartTypes();return e.filter(s=>s.selected&&!!t.filter(i=>i.colId===s.colId)[0]).map(({colId:s})=>s)}createSeriesChartTypeGroup(e){this.seriesChartTypeGroupComp=this.createBean(new Se({title:this.chartTranslation.translate("seriesChartType"),enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!1,cssIdentifier:"charts-data",expanded:this.isOpen}));const t=this.chartController.getSeriesChartTypes();e.forEach(s=>{if(!s.selected)return;const i=t.filter(c=>c.colId===s.colId)[0];if(!i)return;this.selectedColIds.push(s.colId);const r=this.seriesChartTypeGroupComp.createManagedBean(new Se({title:s.displayName,enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!0,cssIdentifier:"charts-format-sub-level"})),a=c=>["groupedColumn","stackedColumn","stackedArea"].includes(c),o=this.seriesChartTypeGroupComp.createManagedBean(new _k({label:this.chartTranslation.translate("secondaryAxis"),labelWidth:"flex",disabled:a(i.chartType),value:!!i.secondaryAxis,onValueChange:c=>this.chartController.updateSeriesChartType(s.colId,void 0,c)}));r.addItem(o);const n=["line","area","stackedArea","groupedColumn","stackedColumn"].map(c=>({value:c,text:this.chartTranslation.translate($r(c))})),l=r.createManagedBean(new Vk({options:n,value:i.chartType,onValueChange:c=>this.chartController.updateSeriesChartType(s.colId,c)}));r.addItem(l),this.seriesChartTypeGroupComp.addItem(r),this.chartTypeComps.set(s.colId,l),this.secondaryAxisComps.set(s.colId,o)}),this.getGui().appendChild(this.seriesChartTypeGroupComp.getGui())}refreshComps(){const e=this.chartController.getSeriesChartTypes();this.selectedColIds.forEach(t=>{const s=e.find(a=>a.colId===t);if(!s)return;const i=this.chartTypeComps.get(t),r=this.secondaryAxisComps.get(t);i?.setValue(s.chartType),r?.setValue(!!s.secondaryAxis),r?.setDisabled(this.isSecondaryAxisDisabled(s.chartType))})}clearComps(){this.chartTypeComps.clear(),this.secondaryAxisComps.clear()}isSecondaryAxisDisabled(e){return["groupedColumn","stackedColumn","stackedArea"].includes(e)}destroy(){this.clearComps(),this.seriesChartTypeGroupComp=this.destroyBean(this.seriesChartTypeGroupComp),super.destroy()}};import{AgToggleButton as Wk}from"ag-grid-community";var jk=class extends Zc{constructor(e,t,s,i,r,a,o){super(e,i,r,'
'),this.chartOptionsService=t,this.title=s,this.valueCols=a,this.isOpen=o}postConstruct(){if(this.groupComp=this.createBean(new Se({title:this.title,enabled:!0,suppressEnabledCheckbox:!0,suppressOpenCloseIcons:!1,cssIdentifier:"charts-data",expanded:this.isOpen})),this.chartController.isActiveXYChart()){const e=this.groupComp.createManagedBean(new Wk({label:this.chartTranslation.translate("paired"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",value:this.chartOptionsService.getPairedMode(),onValueChange:t=>{this.chartOptionsService.setPairedMode(!!t),this.chartController.updateForGridChange({maintainColState:!0})}}));this.groupComp.addItem(e)}this.createGroup(this.valueCols,this.generateGetSeriesLabel(this.valueCols),"seriesAdd","seriesSelect"),this.getGui().appendChild(this.groupComp.getGui())}refresh(e){this.valuePillSelect?.setValueFormatter(this.generateGetSeriesLabel(e)),this.valuePillSelect?.setValues(e,e.filter(t=>t.selected)),this.refreshValueSelect(e)}generateGetSeriesLabel(e){if(!this.chartController.isActiveXYChart())return a=>a.displayName??"";const t=e.filter(a=>a.selected),s=this.chartController.getChartType()==="bubble",i=this.chartOptionsService.getPairedMode(),r=new Map;return r.set(0,"X"),r.set(1,"Y"),r.set(2,"size"),a=>{const o=a.displayName??"";if(!a.selected)return o;const n=t.indexOf(a);if(n===-1)return o;let l;return i?l=r.get(n%(s?3:2)):n===0?l="X":l=s&&n%2===0?"size":"Y",`${o} (${l})`}}destroy(){this.groupComp=this.destroyBean(this.groupComp),super.destroy()}},$k={groups:[{type:"categories",isOpen:!0},{type:"series",isOpen:!0},{type:"seriesChartType",isOpen:!0},{type:"chartSpecific",isOpen:!0}]},Yk=class extends mk{constructor(e){super('
'),this.chartMenuContext=e,this.isSwitchCategorySeriesToggled=!1,this.restoreSwitchCategorySeriesToggleFocus=!1,this.panels=[],this.chartController=e.chartController}wireBeans(e){this.chartTranslation=e.chartTranslation,this.chartSvc=e.chartSvc}postConstruct(){this.createSwitchCategorySeriesToggle(),this.isSwitchCategorySeriesToggled=this.chartController.isCategorySeriesSwitched(),this.updatePanels();const e=this.updatePanels.bind(this);this.addManagedListeners(this.chartController,{chartModelUpdate:e,chartApiUpdate:e})}destroy(){this.clearPanelComponents(),super.destroy()}updatePanels(){const e=this.chartType,t=this.isSwitchCategorySeriesToggled,{dimensionCols:s,valueCols:i}=this.chartController.getColStateForMenu();this.chartType=this.chartController.getChartType(),this.isSwitchCategorySeriesToggled=this.chartController.isCategorySeriesSwitched();const r=this.isSwitchCategorySeriesToggled!==t;this.canRefresh(e,this.chartType)&&!r?(this.categoriesDataPanel?.refresh(s),this.seriesDataPanel?.refresh(i),this.seriesChartTypePanel?.refresh(i),this.chartSpecificPanel?.refresh()):this.recreatePanels(s,i);const a=Pc(this.chartType)&&this.chartSvc.isEnterprise()&&!this.chartController.isGrouping();Ck(this.switchCategorySeriesToggle.getGui(),a),r&&this.switchCategorySeriesToggle?.setValue(this.chartController.isCategorySeriesSwitched()),this.restoreSwitchCategorySeriesToggleFocus&&(this.restoreSwitchCategorySeriesToggleFocus=!1,a&&this.switchCategorySeriesToggle.getFocusableElement().focus())}canRefresh(e,t){if(e===void 0)return!1;if(e===t)return!0;const s=i=>["columnLineCombo","areaColumnCombo","customCombo"].includes(i);return!!(s(e)&&s(t))}recreatePanels(e,t){this.clearPanelComponents();const{chartType:s}=this;if(!s)return;const i=this.chartController.isCategorySeriesSwitched();this.getDataPanelDef().groups?.forEach(({type:r,isOpen:a})=>{r===(i?"series":"categories")?(this.categoriesDataPanel=this.createBean(new Lk(this.chartController,this.getCategoryGroupTitle(i),this.getCategoryGroupMultipleSelect(s,i),e,a)),this.panels.push(this.categoriesDataPanel)):r===(i?"categories":"series")?(this.seriesDataPanel=this.createBean(new jk(this.chartController,this.chartMenuContext.chartOptionsService,this.getSeriesGroupTitle(i),this.getSeriesGroupMultipleSelect(s,i),this.getSeriesGroupMaxSelection(s,i),t,a)),this.panels.push(this.seriesDataPanel)):r==="seriesChartType"?this.chartController.isComboChart()&&(this.seriesChartTypePanel=this.createBean(new Kk(this.chartController,t,a)),this.panels.push(this.seriesChartTypePanel)):r==="chartSpecific"?(this.chartSpecificPanel=this.createBean(new Bk(this.chartMenuContext,a)),this.panels.push(this.chartSpecificPanel)):vk(144,{type:r})}),(i?this.categoriesDataPanel:this.seriesDataPanel)?.addItem(this.switchCategorySeriesToggle.getGui()),this.addPanelComponents()}addPanelComponents(){if(!this.panels.length)return;const t=fk(this.beans).createDocumentFragment();for(const s of this.panels)s.addCssClass("ag-chart-data-section"),t.appendChild(s.getGui());this.getGui().appendChild(t)}clearPanelComponents(){const e=this.getGui();this.panels.forEach(t=>{e.removeChild(t.getGui()),this.destroyBean(t)}),this.panels=[]}getDataPanelDef(){return this.gos.get("chartToolPanelsDef")?.dataPanel??$k}getCategoryGroupTitle(e){return e?this.chartTranslation.translate("seriesLabels"):this.chartTranslation.translate(this.chartController.isActiveXYChart()?"labels":"categories")}getCategoryGroupMultipleSelect(e,t){return t?!1:jr(e)!==1}getSeriesGroupTitle(e){return e?this.chartTranslation.translate("categoryValues"):this.chartTranslation.translate(this.chartController.isActiveXYChart()?"xyValues":"series")}getSeriesGroupMultipleSelect(e,t){return this.getSeriesGroupMaxSelection(e,t)!==1}getSeriesGroupMaxSelection(e,t){if(!t)return Qs(e)}createSwitchCategorySeriesToggle(){this.switchCategorySeriesToggle=this.createManagedBean(new gk({label:this.chartTranslation.translate("switchCategorySeries"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex",value:this.chartController.isCategorySeriesSwitched(),onValueChange:e=>{this.restoreSwitchCategorySeriesToggleFocus=!0,this.chartController.switchCategorySeries(e)}}))}};import{Component as Xk,_warn as Qc}from"ag-grid-community";import{AgCheckbox as qk,AgSelectSelector as Zk,Component as Jk,RefPlaceholder as ai,_removeFromParent as ed,_setDisplayed as Qk}from"ag-grid-community";import{AgAbstractLabel as eG,AgInputNumberFieldSelector as tG,RefPlaceholder as oi,_exists as sG,_getActiveDomElement as iG,_setFixedWidth as rG}from"ag-grid-community";var aG=class extends eG{constructor(e){super(e,`
`,[tG]),this.eLabel=oi,this.eParentCircle=oi,this.eChildCircle=oi,this.eAngleValue=oi,this.radius=0,this.offsetX=0,this.offsetY=0}wireBeans(e){this.dragSvc=e.dragSvc}postConstruct(){super.postConstruct();const{value:e,onValueChange:t}=this.config;e!=null&&this.setValue(e,void 0,!0),t!=null&&this.onValueChange(t),this.dragListener={eElement:this.eParentCircle,dragStartPixels:0,onDragStart:()=>{this.parentCircleRect=this.eParentCircle.getBoundingClientRect()},onDragging:s=>this.calculateAngleDrag(s),onDragStop:()=>{}},this.dragSvc?.addDragSource(this.dragListener),this.eAngleValue.setLabel("").setLabelWidth(5).setInputWidth(45).setMin(0).setMax(360).setValue(`${this.degrees}`).onValueChange(s=>{(s==null||s==="")&&(s="0"),s=this.eAngleValue.normalizeValue(s);let i=parseFloat(s);i>180&&(i=i-360),this.setValue(i)}),this.updateNumberInput(),sG(this.getValue())&&this.eAngleValue.setValue(this.normalizeNegativeValue(this.getValue()).toString()),this.addManagedListeners(this,{fieldValueChanged:()=>{this.eAngleValue.getInputElement().contains(iG(this.beans))||this.updateNumberInput()}})}updateNumberInput(){const e=this.normalizeNegativeValue(this.getValue());this.eAngleValue.setValue(e.toString())}positionChildCircle(e){const t=this.parentCircleRect||{width:24,height:24},s=this.eChildCircle,i=t.width/2,r=t.height/2;s.style.left=`${i+Math.cos(e)*8}px`,s.style.top=`${r+Math.sin(e)*8}px`}calculatePolar(){const e=this.offsetX,t=this.offsetY,s=Math.atan2(t,e);this.degrees=this.toDegrees(s),this.radius=Math.sqrt(e*e+t*t),this.positionChildCircle(s)}calculateCartesian(){const e=this.toRadians(this.getValue()),t=this.getRadius();this.setOffsetX(Math.cos(e)*t).setOffsetY(Math.sin(e)*t)}setOffsetX(e){return this.offsetX!==e&&(this.offsetX=e,this.calculatePolar()),this}setOffsetY(e){return this.offsetY!==e&&(this.offsetY=e,this.calculatePolar()),this}calculateAngleDrag(e){const t=this.parentCircleRect,s=t.width/2,i=t.height/2,r=e.clientX-t.left,a=e.clientY-t.top,o=r-s,n=a-i,l=Math.atan2(n,o);this.setValue(l,!0)}toDegrees(e){return e/Math.PI*180}toRadians(e){return e/180*Math.PI}normalizeNegativeValue(e){return e<0?360+e:e}normalizeAngle180(e){return e%=Math.PI*2,e<-Math.PI?e+=Math.PI*2:e>=Math.PI&&(e-=Math.PI*2),e}getRadius(){return this.radius}setRadius(e){return this.radius===e?this:(this.radius=e,this.calculateCartesian(),this)}onValueChange(e){return this.addManagedListeners(this,{fieldValueChanged:()=>{e(this.degrees)}}),this}getValue(e){return e?this.toRadians(this.degrees):this.degrees}setValue(e,t,s){let i;return t?i=e:i=this.normalizeAngle180(this.toRadians(e)),e=this.toDegrees(i),this.degrees!==e&&(this.degrees=Math.floor(e),this.calculateCartesian(),this.positionChildCircle(i),s||this.dispatchLocalEvent({type:"fieldValueChanged"})),this}setWidth(e){return rG(this.getGui(),e),this}setDisabled(e){return super.setDisabled(e),this.eAngleValue.setDisabled(e),this}destroy(){this.dragSvc?.removeDragSource(this.dragListener),super.destroy()}};import{AgSelectSelector as oG,Component as nG,RefPlaceholder as lG,_removeFromParent as cG}from"ag-grid-community";function dG(e){return e[0].toUpperCase()+e.substring(1).toLowerCase()}var He=class extends nG{constructor(e){super(),this.params=e,this.fontGroup=lG,this.activeComps=[],this.chartOptions=e.chartMenuParamsFactory.getChartOptions()}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const{cssIdentifier:e="charts-format-sub-level",name:t,enabled:s,onEnableChange:i,suppressEnabledCheckbox:r,chartMenuParamsFactory:a,keyMapper:o}=this.params,n={cssIdentifier:e,direction:"vertical",suppressOpenCloseIcons:!0,title:t,enabled:s,suppressEnabledCheckbox:!0,onEnableChange:l=>{i&&i(l)},useToggle:!r};this.setTemplate(`
`,[N,oG,fe],{fontGroup:n,familySelect:this.getFamilySelectParams(),weightStyleSelect:this.getWeightStyleSelectParams(),sizeSelect:this.getSizeSelectParams(),colorPicker:a.getDefaultColorPickerParams(o("color"))}),this.addOrRemoveCssClass("ag-font-panel-no-header",!t)}addItem(e,t){t?this.fontGroup.prependItem(e):this.fontGroup.addItem(e),this.activeComps.push(e)}setEnabled(e){this.fontGroup.setEnabled(e)}getFamilySelectParams(){const e=["Arial, sans-serif","Aria Black, sans-serif","Book Antiqua, serif","Charcoal, sans-serif","Comic Sans MS, cursive","Courier, monospace","Courier New, monospace","Gadget, sans-serif","Geneva, sans-serif","Helvetica, sans-serif","Impact, sans-serif","Lucida Console, monospace","Lucida Grande, sans-serif","Lucida Sans Unicode, sans-serif","Monaco, monospace","Palatino Linotype, serif","Palatino, serif","Times New Roman, serif","Times, serif","Verdana, sans-serif"],t=this.getInitialFontValue("fontFamily");let s=e[0];if(t){const a=e.map(o=>o.toLowerCase()).indexOf(t.toLowerCase());if(a>=0)s=e[a];else{const o=dG(t);e.push(o),s=o}}const i=e.sort().map(r=>({value:r,text:r}));return this.params.chartMenuParamsFactory.getDefaultSelectParamsWithoutValueParams("font",i,`${s}`,r=>this.setFont({fontFamily:r}))}getSizeSelectParams(){const e=[8,10,12,14,16,18,20,22,24,26,28,30,32,34,36],t=this.getInitialFontValue("fontSize");e.includes(t)||e.push(t);const s=e.sort((i,r)=>i-r).map(i=>({value:`${i}`,text:`${i}`}));return this.params.chartMenuParamsFactory.getDefaultSelectParamsWithoutValueParams("size",s,`${t}`,i=>this.setFont({fontSize:parseInt(i,10)}))}getWeightStyleSelectParams(){const e=this.getInitialFontValue("fontWeight")??"normal",t=this.getInitialFontValue("fontStyle")??"normal",s=[{name:"normal",weight:"normal",style:"normal"},{name:"bold",weight:"bold",style:"normal"},{name:"italic",weight:"normal",style:"italic"},{name:"boldItalic",weight:"bold",style:"italic"}];let i=s.find(a=>a.weight===e&&a.style===t);i||(i={name:"predefined",weight:e,style:t},s.unshift(i));const r=s.map(a=>({value:a.name,text:this.chartTranslation.translate(a.name)}));return this.params.chartMenuParamsFactory.getDefaultSelectParamsWithoutValueParams("weight",r,i.name,a=>{const o=s.find(n=>n.name===a);this.setFont({fontWeight:o.weight,fontStyle:o.style})})}destroyActiveComps(){this.activeComps.forEach(e=>{cG(e.getGui()),this.destroyBean(e)})}destroy(){this.destroyActiveComps(),super.destroy()}setFont(e){const{keyMapper:t}=this.params;for(const s of Object.keys(e)){const i=e[s];i&&this.chartOptions.setValue(t(s),i)}}getInitialFontValue(e){const{keyMapper:t}=this.params;return this.chartOptions.getValue(t(e))}};import{Component as hG,RefPlaceholder as uG}from"ag-grid-community";var pG=class extends hG{constructor(e){super(),this.chartMenuUtils=e,this.axisTicksSizeSlider=uG}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const{chartMenuUtils:e}=this,t=e.addEnableParams("tick.enabled",{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("ticks"),suppressEnabledCheckbox:!0,useToggle:!0}),s=e.getDefaultColorPickerParams("tick.stroke"),i=e.getDefaultSliderParams("tick.width","width",10),r=e.getDefaultSliderParams("tick.size","length",30);this.setTemplate(`
`,[N,fe,Q],{axisTicksGroup:t,axisTicksColorPicker:s,axisTicksWidthSlider:i,axisTicksSizeSlider:r})}setTickSizeSliderDisplayed(e){this.axisTicksSizeSlider.setDisplayed(e)}};import{Component as gG}from"ag-grid-community";var mG=class extends gG{constructor(e){super(),this.chartMenuUtils=e,this.chartOptions=e.getChartOptions()}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e=this.chartMenuUtils.addEnableParams("gridLine.enabled",{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("gridLines"),suppressEnabledCheckbox:!0,useToggle:!0}),t=this.getGridLineColorPickerParams("color"),s=this.getGridLineWidthSliderParams("thickness"),i=this.getGridLineDashSliderParams("lineDash");this.setTemplate(`
`,[N,fe,Q],{gridLineGroup:e,gridLineColorPicker:t,gridLineWidthSlider:s,gridLineLineDashSlider:i})}getGridLineColorPickerParams(e){return this.chartMenuUtils.getDefaultColorPickerParams("gridLine.style",e,{formatInputValue:t=>t?.[0]?.stroke,parseInputValue:t=>{const s=this.chartOptions.getValue("gridLine.style")??[];return s.length===0?[{stroke:t,lineDash:[]}]:[{...s[0],stroke:t}]}})}getGridLineWidthSliderParams(e){return this.chartMenuUtils.getDefaultSliderParams("gridLine.width",e,10)}getGridLineDashSliderParams(e){const s=this.chartOptions.getValue("gridLine.style")?.[0]?.lineDash?.[0],i=this.chartMenuUtils.getDefaultSliderParamsWithoutValueParams(s??0,e,30);return i.onValueChange=r=>{const a=this.chartOptions.getValue("gridLine.style.0.stroke");this.chartOptions.setValue("gridLine.style",[{lineDash:[r],stroke:a}])},i}},fG="%d %B %Y",ni=class extends Jk{constructor(e,t){super(),this.axisType=e,this.options=t,this.axisGroup=ai,this.axisTypeSelect=ai,this.axisPositionSelect=ai,this.axisTimeFormatSelect=ai,this.activePanels=[],this.updateFuncs=[];const{chartOptionsService:s,seriesType:i,chartController:r}=t;this.chartOptionsService=s,this.chartController=r,this.chartOptionsSeriesProxy=s.getSeriesOptionsProxy(()=>i)}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const{isExpandedOnInit:e,chartOptionsService:t,registerGroupComponent:s}=this.options,i=this.axisType,r={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.translate(i),expanded:e,suppressEnabledCheckbox:!0},a=t.getCartesianAxisOptionsProxy(this.axisType),o=this.createManagedBean(new tt(a)),n=this.createManagedBean(new tt(t.getCartesianAxisThemeOverridesProxy(this.axisType))),l=this.getAxisTypeSelectParams(o,t.getCartesianAxisAppliedThemeOverridesProxy(this.axisType)),c=this.getAxisPositionSelectParams(o),d=this.getAxisTimeFormatSelectParams(o),h=this.getAxisColorInputParams(n),u=this.getAxisLineWidthSliderParams(n);this.setTemplate(`
`,[N,Zk,fe,Q],{axisGroup:r,axisTypeSelect:l??void 0,axisPositionSelect:c??void 0,axisTimeFormatSelect:d??void 0,axisColorInput:h,axisLineWidthSlider:u}),s(this.axisGroup),this.axisTypeSelect.setDisplayed(!!l.options?.length),c||this.removeTemplateComponent(this.axisPositionSelect);const p=()=>{const m=a.getValue("type")==="time";Qk(this.axisTimeFormatSelect.getGui(),m)};d?(p(),this.addManagedEventListeners({chartOptionsChanged:()=>{p()}})):this.removeTemplateComponent(this.axisTimeFormatSelect),this.initGridLines(n),this.initAxisTicks(n),this.initAxisLabels(n);const g=()=>this.updateFuncs.forEach(m=>m());this.addManagedListeners(this.chartController,{chartUpdated:g,chartModelUpdate:()=>setTimeout(()=>{this.isAlive()&&(this.refreshAxisTypeSelect(o),p())})})}getAxisTypeSelectParams(e,t){const s=e.getChartOptions(),i=this.getAxisTypeSelectOptions(),r=e.getDefaultSelectParams("type","axisType",i);return r.onValueChange=a=>{const o=s.getValue("type");if(a===o)return;const n=t.getValue("*"),l=o==="time",c=a==="time",d=l!==c?c?fG:void 0:null;if(this.chartOptionsService.setCartesianCategoryAxisType(this.axisType,a),d!==null){const h=s.getValue("label")??{};s.setValue("label",{...h,format:d})}t.setValue("*",n)},r}refreshAxisTypeSelect(e){const t=this.getAxisTypeSelectOptions(),s=!!t.length;this.axisTypeSelect.setDisplayed(s),s&&this.axisTypeSelect.clearOptions().addOptions(t).setValue(e.getChartOptions().getValue("type"))}getAxisTypeSelectOptions(){const e=this.chartController,t=e.getChartType(),s=()=>{const i=e.getChartData()[0];return i?e.getSelectedDimensions().every(r=>!isNaN(parseFloat(i[r.colId]))):!1};return["heatmap","histogram","boxPlot","rangeBar","scatter","bubble"].includes(t)||e.isGrouping()||!this.isCategoryAxis()||e.isCategorySeriesSwitched()||!s()?[]:["category","number","time"].map(i=>({value:i,text:this.translate(i)}))}isCategoryAxis(){const e=this.chartOptionsSeriesProxy.getValue("direction")==="horizontal";return e&&this.axisType==="yAxis"||!e&&this.axisType==="xAxis"}getAxisPositionSelectParams(e){const t=((s,i)=>{switch(s){case"heatmap":return null;default:switch(i){case"xAxis":return[{value:"top",text:this.translate("top")},{value:"bottom",text:this.translate("bottom")}];case"yAxis":return[{value:"left",text:this.translate("left")},{value:"right",text:this.translate("right")}]}}})(this.chartController.getChartType(),this.axisType);return t?e.getDefaultSelectParams("position","position",t):null}getAxisTimeFormatSelectParams(e){if(!this.isCategoryAxis())return null;const t=[{value:"%d/%m/%Y",text:this.translate("timeFormatSlashesDDMMYYYY")},{value:"%m/%d/%Y",text:this.translate("timeFormatSlashesMMDDYYYY")},{value:"%d/%m/%y",text:this.translate("timeFormatSlashesDDMMYY")},{value:"%m/%d/%y",text:this.translate("timeFormatSlashesMMDDYY")},{value:"%d.%e.%y",text:this.translate("timeFormatDotsDDMYY")},{value:"%e.%d.%y",text:this.translate("timeFormatDotsMDDYY")},{value:"%Y-%m-%d",text:this.translate("timeFormatDashesYYYYMMDD")},{value:"%d %B %Y",text:this.translate("timeFormatSpacesDDMMMMYYYY")},{value:"%H:%M:%S",text:this.translate("timeFormatHHMMSS")},{value:"%I:%M:%S %p",text:this.translate("timeFormatHHMMSSAmPm")}];return e.getDefaultSelectParams("label.format","timeFormat",t)}getAxisColorInputParams(e){return e.getDefaultColorPickerParams("line.stroke")}getAxisLineWidthSliderParams(e){const t=e.getChartOptions(),s=()=>t.getValue("line.enabled")?t.getValue("line.width"):null,i=a=>{t.setValues([{expression:"line.enabled",value:a!=null},{expression:"line.width",value:a??0}])},r=e.getDefaultSliderParamsWithoutValueParams(s()??0,"thickness",10);return r.onValueChange=a=>{i(a===0?null:a)},r}initGridLines(e){if(this.chartController.getChartType()==="heatmap")return;const s=this.createBean(new mG(e));this.axisGroup.addItem(s),this.activePanels.push(s)}initAxisTicks(e){if(!this.hasConfigurableAxisTicks())return;const t=this.createBean(new pG(e));this.axisGroup.addItem(t),this.activePanels.push(t);const s=()=>t.setTickSizeSliderDisplayed(this.isGroupedCategoryAxis());this.updateFuncs.push(s),s()}hasConfigurableAxisTicks(){switch(this.chartController.getChartType()){case"radarLine":case"radarArea":case"rangeBar":case"boxPlot":case"waterfall":return!1;default:return!0}}initAxisLabels(e){const t={name:this.translate("labels"),enabled:!0,suppressEnabledCheckbox:!0,chartMenuParamsFactory:e,keyMapper:i=>`label.${i}`},s=this.createBean(new He(t));this.axisGroup.addItem(s),this.activePanels.push(s),this.addAdditionalLabelComps(s,e)}addAdditionalLabelComps(e,t){this.addLabelPadding(e,t);const s=this.createRotationWidget("labelRotation",t),i=this.initLabelRotation(s,t);e.addItem(i),e.addItem(s)}initLabelRotation(e,t){const s=t.getChartOptions(),i=()=>s.getValue("label.rotation"),r=()=>s.getValue("label.autoRotate"),a=d=>{d&&(this.prevRotation=i()),s.setValues([{expression:"label.autoRotate",value:d},{expression:"label.rotation",value:d?void 0:this.prevRotation}]),e.setDisplayed(!d)},n=typeof i()=="number"?!1:r(),l=this.createBean(new qk({label:this.translate("autoRotate"),value:n,onValueChange:a}));e.setDisplayed(!n);const c=()=>l.setDisplayed(this.isGroupedCategoryAxis());return this.updateFuncs.push(c),c(),l}createRotationWidget(e,t){const s=t.getChartOptions(),i=()=>s.getValue("label.rotation"),r=l=>s.setValue("label.rotation",l),o=`${this.chartTranslation.translate(e)} \xB0`,n=new aG({label:o,labelWidth:"flex",value:i()??0,onValueChange:r});return this.updateFuncs.push(()=>{n.setValue(i()??0)}),this.createBean(n)}isGroupedCategoryAxis(){return this.chartOptionsService.getCartesianAxisOptionsProxy(this.axisType).getValue("type")==="grouped-category"?!this.isCategoryAxis():!0}addLabelPadding(e,t){const s=this.createBean(new ie(t.getDefaultSliderParams("label.spacing","padding",30)));e.addItem(s)}translate(e){return this.chartTranslation.translate(e)}removeTemplateComponent(e){ed(e.getGui()),this.destroyBean(e)}destroyActivePanels(){this.activePanels.forEach(e=>{ed(e.getGui()),this.destroyBean(e)})}destroy(){this.destroyActivePanels(),super.destroy()}};import{AgSelect as CG,Component as vG,RefPlaceholder as yG}from"ag-grid-community";var SG=class extends vG{constructor(e){super(),this.options=e,this.axisGroup=yG}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const{isExpandedOnInit:e,chartAxisMenuParamsFactory:t,registerGroupComponent:s}=this.options,i={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.translate("polarAxis"),expanded:e,suppressEnabledCheckbox:!0},r=t.getDefaultColorPickerParams("line.stroke"),a=t.getDefaultSliderParams("line.width","thickness",10);this.setTemplate(`
`,[N,fe,Q],{axisGroup:i,axisColorInput:r,axisLineWidthSlider:a}),s(this.axisGroup),this.initAxis(),this.initAxisLabels(),this.initRadiusAxis()}initAxis(){const e=this.options.chartController.getChartType();if(["radarLine","radarArea"].includes(e)){const s=[{value:"circle",text:this.translate("circle")},{value:"polygon",text:this.translate("polygon")}];this.axisGroup.addItem(this.createSelect({labelKey:"shape",options:s,property:"shape"}))}e!=="pie"&&this.axisGroup.addItem(this.createSlider({labelKey:"innerRadius",defaultMaxValue:1,property:"innerRadiusRatio"}))}initAxisLabels(){const e={name:this.translate("labels"),enabled:!0,suppressEnabledCheckbox:!0,chartMenuParamsFactory:this.options.chartAxisMenuParamsFactory,keyMapper:i=>`label.${i}`},t=this.createManagedBean(new He(e)),s=this.createOrientationWidget();t.addItem(s),this.axisGroup.addItem(t)}createOrientationWidget(){const e=[{value:"fixed",text:this.translate("fixed")},{value:"parallel",text:this.translate("parallel")},{value:"perpendicular",text:this.translate("perpendicular")}];return this.createSelect({labelKey:"orientation",options:e,property:"label.orientation"})}initRadiusAxis(){const e=B(this.options.chartController.getChartType());if(!LI(e))return;const t=[this.createSlider({labelKey:"groupPadding",defaultMaxValue:1,property:"paddingInner"}),this.createSlider({labelKey:"seriesPadding",defaultMaxValue:1,property:"groupPaddingInner"})],s=this.createManagedBean(new Se({cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,enabled:!0,suppressEnabledCheckbox:!0,title:this.translate("padding"),items:t})).hideEnabledCheckbox(!0).hideOpenCloseIcons(!0);this.axisGroup.addItem(s)}createSlider(e){const{labelKey:t,defaultMaxValue:s,step:i=.05,property:r}=e,a=this.options.chartAxisMenuParamsFactory.getDefaultSliderParams(r,t,s);return a.step=i,this.createManagedBean(new ie(a))}createSelect(e){const{labelKey:t,options:s,property:i}=e;return this.createManagedBean(new CG(this.options.chartAxisMenuParamsFactory.getDefaultSelectParams(i,t,s)))}translate(e){return this.chartTranslation.translate(e)}};import{Component as bG,RefPlaceholder as wG}from"ag-grid-community";import{Component as xG}from"ag-grid-community";var TG=class extends xG{constructor(e){super(),this.chartMenuUtils=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e=this.chartMenuUtils.addEnableParams("background.visible",{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("background"),suppressEnabledCheckbox:!0,useToggle:!0}),t=this.chartMenuUtils.getDefaultColorPickerParams("background.fill");this.setTemplate(`
`,[N,fe],{chartBackgroundGroup:e,colorPicker:t})}};import{Component as MG,RefPlaceholder as PG}from"ag-grid-community";var FG=class extends MG{constructor(e,t){super(),this.chartMenuUtils=e,this.chartController=t,this.paddingTopSlider=PG}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e={cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("padding"),suppressEnabledCheckbox:!0},t=s=>this.chartMenuUtils.getDefaultSliderParams("padding."+s,s,200);this.setTemplate(`
`,[N,Q],{chartPaddingGroup:e,paddingTopSlider:t("top"),paddingRightSlider:t("right"),paddingBottomSlider:t("bottom"),paddingLeftSlider:t("left")}),this.addManagedEventListeners({chartOptionsChanged:s=>{this.updateTopPadding(s.chartOptions)}})}updateTopPadding(e){const t=[...this.chartController.getChartSeriesTypes(),"common"].map(s=>e[s]?.padding?.top).find(s=>s!=null);t!=null&&this.paddingTopSlider.setValue(`${t}`)}},AG=class extends bG{constructor(e){super(),this.options=e,this.chartGroup=wG}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const{chartController:e,chartMenuParamsFactory:t,isExpandedOnInit:s,registerGroupComponent:i}=this.options,r={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.chartTranslation.translate("chartStyle"),expanded:s,suppressEnabledCheckbox:!0,items:[this.createManagedBean(new FG(t,e)),this.createManagedBean(new TG(t))]};this.setTemplate(`
`,[N],{chartGroup:r}),i(this.chartGroup)}};import{BeanStub as RG}from"ag-grid-community";var EG=class extends RG{constructor(e){super(),this.groupContainer=e,this.id=0,this.groupComponents=new Map}addGroupComponent(e){const t=this.id++;this.groupComponents.set(t,e),e.isExpanded()&&(this.expandedGroupComponent=t),e.onExpandedChange(s=>{if(s){const i=this.expandedGroupComponent;if(this.expandedGroupComponent=t,i!=null){const r=e.getGui(),a=r.offsetTop-this.groupContainer.parentElement.scrollTop;this.groupComponents.get(i)?.toggleGroupExpand(!1,!0);let o=r.offsetTop-a;o<0&&(o=0),o!==this.groupContainer.parentElement.scrollTop&&(this.groupContainer.parentElement.scrollTop=o)}}else this.expandedGroupComponent=void 0})}destroy(){this.groupComponents.clear(),super.destroy()}};import{AgCheckbox as IG,AgSelect as DG,Component as LG,RefPlaceholder as td}from"ag-grid-community";var kG=class extends LG{constructor(e,t){super(),this.options=e,this.chartMenuContext=t,this.legendGroup=td,this.enabledGroup=td,this.isGradient=["treemap","sunburst","heatmap"].includes(e.seriesType),this.key=this.isGradient?"gradientLegend":"legend",this.chartController=t.chartController}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const{chartMenuParamsFactory:e,isExpandedOnInit:t,registerGroupComponent:s}=this.options,i=this.createManagedBean(new DG(e.getDefaultSelectParams(`${this.key}.position`,"position",["top","right","bottom","left"].map(o=>({value:o,text:this.chartTranslation.translate(o)})))));this.enabledGroup=this.createManagedBean(new Se(e.addEnableParams(`${this.key}.enabled`,{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("legendEnabled"),suppressEnabledCheckbox:!0,useToggle:!0,items:[this.createLabelPanel(e),i,...this.getItems(e)]})));const r={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.chartTranslation.translate("legend"),suppressEnabledCheckbox:!0,expanded:t,items:[this.enabledGroup]};this.setTemplate(`
`,[N],{legendGroup:r}),s(this.legendGroup);const a=this.updateLegendEnabledState.bind(this);this.addManagedListeners(this.chartController,{chartModelUpdate:a,chartApiUpdate:a})}updateLegendEnabledState(){const{valueCols:e}=this.chartController.getColStateForMenu();this.enabledGroup.setEnabled(e.filter(t=>t.selected).length>1)}getItems(e){const t=(s,i,r)=>this.createManagedBean(new ie(e.getDefaultSliderParams(`${this.key}.${s}`,i,r)));return this.isGradient?[this.createManagedBean(new IG(e.addValueParams("gradientLegend.reverseOrder",{label:this.chartTranslation.translate("reverseDirection"),labelWidth:"flex"}))),t("gradient.thickness","thickness",40),t("gradient.preferredLength","preferredLength",300),t("spacing","spacing",200)]:[t("spacing","spacing",200),t("item.marker.size","markerSize",40),t("item.marker.strokeWidth","markerStroke",10),t("item.marker.padding","itemSpacing",20),t("item.paddingX","layoutHorizontalSpacing",50),t("item.paddingY","layoutVerticalSpacing",50)]}createLabelPanel(e){const t=this.isGradient?"gradientLegend.scale.label":"legend.item.label",s={enabled:!0,suppressEnabledCheckbox:!0,chartMenuParamsFactory:e,keyMapper:i=>`${t}.${i}`,cssIdentifier:"charts-format-sub-level-no-header"};return this.createManagedBean(new He(s))}};import{AgSelect as ea,AgToggleButton as GG,Component as OG,RefPlaceholder as NG,_error as BG,_removeFromParent as _G}from"ag-grid-community";import{Component as VG,RefPlaceholder as HG,_removeFromParent as zG}from"ag-grid-community";var UG=class extends VG{constructor(e){super(),this.params=e,this.toggleableGroup=HG,this.activeComps=[],this.chartOptions=e.chartMenuParamsFactory.getChartOptions()}postConstruct(){const{tag:e,cssIdentifier:t="charts-format-sub-level",title:s,suppressEnabledCheckbox:i}=this.params,r=this.params.chartMenuParamsFactory.addEnableParams(`${e}.enabled`,{cssIdentifier:t,direction:"vertical",suppressOpenCloseIcons:!0,title:s,suppressEnabledCheckbox:!0,useToggle:!i});this.setTemplate(`
`,[N],{toggleableGroup:r}),this.addOrRemoveCssClass("ag-toggleable-group-panel-no-header",!s)}addItem(e,t){t?this.toggleableGroup.prependItem(e):this.toggleableGroup.addItem(e),this.activeComps.push(e)}setEnabled(e){this.toggleableGroup.setEnabled(e)}destroyActiveComps(){this.activeComps.forEach(e=>{zG(e.getGui()),this.destroyBean(e)})}destroy(){this.destroyActiveComps(),super.destroy()}};import{Component as KG}from"ag-grid-community";var WG=class extends KG{constructor(e){super(),this.chartMenuUtils=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslation.translate("callout"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(`
`,[N,Q],{calloutGroup:e,calloutLengthSlider:this.chartMenuUtils.getDefaultSliderParams("calloutLine.length","length",40),calloutStrokeWidthSlider:this.chartMenuUtils.getDefaultSliderParams("calloutLine.strokeWidth","strokeWidth",10),labelOffsetSlider:this.chartMenuUtils.getDefaultSliderParams("calloutLabel.offset","offset",30)})}};import{Component as jG}from"ag-grid-community";var $G=class extends jG{constructor(e){super(),this.chartMenuUtils=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslation.translate("cap"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0},t=this.chartMenuUtils.getDefaultSliderParams("cap.lengthRatio","capLengthRatio",1);t.step=.05,this.setTemplate(`
`,[N,Q],{capsGroup:e,capLengthRatioSlider:t})}};import{Component as YG}from"ag-grid-community";var XG=class extends YG{constructor(e){super(),this.chartMenuUtils=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslation.translate("connectorLine"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(`
`,[N,fe,Q],{lineGroup:e,lineColorPicker:this.chartMenuUtils.getDefaultColorPickerParams("line.stroke"),lineStrokeWidthSlider:this.getSliderParams("strokeWidth",10,"line.strokeWidth"),lineDashSlider:this.getSliderParams("lineDash",30,"line.lineDash",1,!0),lineOpacitySlider:this.getSliderParams("strokeOpacity",1,"line.strokeOpacity",.05)})}getSliderParams(e,t,s,i=1,r=!1){const a=this.chartMenuUtils.getDefaultSliderParams(s,e,t,r);return a.step=i,a}};import{AgSelectSelector as qG,Component as ZG}from"ag-grid-community";function sd(e){return["square","circle","cross","diamond","plus","triangle","heart"].map(t=>({value:t,text:e.translate(t)}))}var JG=class extends ZG{constructor(e){super(),this.chartMenuUtils=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e=this.chartMenuUtils.addEnableParams("marker.enabled",{cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslation.translate("markers"),suppressEnabledCheckbox:!0,useToggle:!0,suppressOpenCloseIcons:!0});this.setTemplate(`
`,[N,qG,Q],{seriesMarkersGroup:e,seriesMarkerShapeSelect:this.chartMenuUtils.getDefaultSelectParams("marker.shape","shape",sd(this.chartTranslation)),seriesMarkerSizeSlider:this.chartMenuUtils.getDefaultSliderParams("marker.size","size",60),seriesMarkerStrokeWidthSlider:this.chartMenuUtils.getDefaultSliderParams("marker.strokeWidth","strokeWidth",10)})}};import{AgSelectSelector as QG,Component as eO,RefPlaceholder as tO,_removeFromParent as sO}from"ag-grid-community";var iO=class extends eO{constructor(e){super(),this.chartMenuUtils=e,this.seriesItemsGroup=tO,this.activePanels=[]}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslation.translate("seriesItems"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(`
`,[N,QG],{seriesItemsGroup:e,seriesItemSelect:this.getSeriesItemsParams()}),this.initSeriesControls()}getSeriesItemsParams(){const e=[{value:"positive",text:this.chartTranslation.translate("seriesItemPositive")},{value:"negative",text:this.chartTranslation.translate("seriesItemNegative")}],t=s=>{this.destroyActivePanels(),this.initSeriesControls(s)};return this.chartMenuUtils.getDefaultSelectParamsWithoutValueParams("seriesItemType",e,"positive",t)}initSeriesControls(e="positive"){this.initSlider("strokeWidth",10,`item.${e}.strokeWidth`),this.initSlider("lineDash",30,`item.${e}.lineDash`,1,!0),this.initSlider("strokeOpacity",1,`item.${e}.strokeOpacity`,.05,!1),this.initSlider("fillOpacity",1,`item.${e}.fillOpacity`,.05,!1),this.initItemLabels(e)}initSlider(e,t,s,i=1,r=!1){const a=this.chartMenuUtils.getDefaultSliderParams(s,e,t,r);a.step=i;const o=this.seriesItemsGroup.createManagedBean(new ie(a));this.seriesItemsGroup.addItem(o),this.activePanels.push(o)}initItemLabels(e){const t=this.chartMenuUtils.getDefaultFontPanelParams(`item.${e}.label`,"seriesItemLabels"),s=this.createBean(new He(t));this.seriesItemsGroup.addItem(s),this.activePanels.push(s)}destroyActivePanels(){this.activePanels.forEach(e=>{sO(e.getGui()),this.destroyBean(e)})}destroy(){this.destroyActivePanels(),super.destroy()}};import{Component as rO}from"ag-grid-community";var aO=class extends rO{constructor(e,t="shadow"){super(),this.chartMenuUtils=e,this.propertyKey=t}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e=this.propertyKey,t=this.chartMenuUtils.addEnableParams(`${e}.enabled`,{cssIdentifier:"charts-format-sub-level",direction:"vertical",suppressOpenCloseIcons:!0,title:this.chartTranslation.translate("shadow"),suppressEnabledCheckbox:!0,useToggle:!0}),s=this.chartMenuUtils.getDefaultColorPickerParams(`${e}.color`);this.setTemplate(`
`,[N,fe,Q],{shadowGroup:t,shadowColorPicker:s,shadowBlurSlider:this.getSliderParams("blur",0,20),shadowXOffsetSlider:this.getSliderParams("xOffset",-10,10),shadowYOffsetSlider:this.getSliderParams("yOffset",-10,10)})}getSliderParams(e,t,s){const i=`${this.propertyKey}.${e}`,r=this.chartMenuUtils.getDefaultSliderParams(i,e,s);return r.minValue=t,r}};import{Component as oO}from"ag-grid-community";var nO=class extends oO{constructor(e){super(),this.chartMenuUtils=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e={cssIdentifier:"charts-format-sub-level",direction:"vertical",enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(`
`,[N,Q],{groupSpacing:{...e,title:this.chartTranslation.translate("group")},tileSpacing:{...e,title:this.chartTranslation.translate("tile")},groupPaddingSlider:this.getSliderParams("padding","group.padding"),groupSpacingSlider:this.getSliderParams("spacing","group.gap"),tilePaddingSlider:this.getSliderParams("padding","tile.padding"),tileSpacingSlider:this.getSliderParams("spacing","tile.gap")})}getSliderParams(e,t){return this.chartMenuUtils.getDefaultSliderParams(t,e,10)}};import{Component as lO}from"ag-grid-community";var cO=class extends lO{constructor(e){super(),this.chartMenuUtils=e}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const e={cssIdentifier:"charts-format-sub-level",direction:"vertical",title:this.chartTranslation.translate("whisker"),enabled:!0,suppressOpenCloseIcons:!0,suppressEnabledCheckbox:!0};this.setTemplate(`
`,[N,fe,Q],{whiskersGroup:e,whiskerColorPicker:this.chartMenuUtils.getDefaultColorPickerParams("whisker.stroke"),whiskerThicknessSlider:this.chartMenuUtils.getDefaultSliderParams("whisker.strokeWidth","strokeWidth",10),whiskerOpacitySlider:this.chartMenuUtils.getDefaultSliderParams("whisker.strokeOpacity","strokeOpacity",1),whiskerLineDashSlider:this.chartMenuUtils.getDefaultSliderParams("whisker.lineDash","lineDash",30,!0),whiskerLineDashOffsetSlider:this.chartMenuUtils.getDefaultSliderParams("whisker.lineDashOffset","lineDashOffset",30)})}},_="tooltips",K="strokeWidth",ss="lineWidth",Y="lineDash",z="lineOpacity",X="fillOpacity",H="labels",Fe="shadow",li="stageLabels",is="markers",dO=class extends OG{constructor(e){super(),this.options=e,this.seriesGroup=NG,this.activePanels=[],this.widgetFuncs={lineWidth:()=>this.initStrokeWidth(ss),[K]:()=>this.initStrokeWidth("strokeWidth"),lineColor:()=>this.initLineColor(),[Y]:()=>this.initLineDash(),[z]:()=>this.initOpacity("strokeOpacity"),[X]:()=>this.initOpacity("fillOpacity"),markers:()=>new JG(this.chartMenuUtils),[H]:()=>this.initLabels(),sectorLabels:()=>this.initSectorLabels(),[Fe]:()=>new aO(this.chartMenuUtils),[_]:()=>this.initTooltips(),bins:()=>this.initBins(),whiskers:()=>new cO(this.chartMenuUtils),caps:()=>new $G(this.chartMenuUtils),connectorLine:()=>new XG(this.chartMenuUtils),seriesItems:()=>new iO(this.chartMenuUtils),tileSpacing:()=>new nO(this.chartMenuUtils),shape:()=>this.initShape(),size:()=>this.initSize("size","size"),minSize:()=>this.initSize("size","minSize"),maxSize:()=>this.initSize("maxSize","maxSize"),dropoff:()=>this.initDropOff(),stageLabels:()=>this.initStageLabels()},this.seriesWidgetMappings={bar:[_,K,Y,z,X,H,Fe],pie:[_,K,z,X,H,"sectorLabels",Fe],donut:[_,K,z,X,H,"sectorLabels",Fe],line:[_,ss,Y,z,is,H],scatter:[_,"shape","size",K,H],bubble:[_,"shape","minSize","maxSize",K,H],area:[_,ss,Y,z,X,is,H,Fe],histogram:[_,"bins",K,Y,z,X,H,Fe],"radial-column":[_,K,Y,z,X,H],"radial-bar":[_,K,Y,z,X,H],"radar-line":[_,K,Y,z,is,H],"radar-area":[_,K,Y,z,X,is,H],nightingale:[_,K,Y,z,X,H],"box-plot":[_,K,Y,z,X,"whiskers","caps"],"range-bar":[_,K,Y,z,X,H],"range-area":[_,ss,Y,z,X,is,H,Fe],treemap:[_,"tileSpacing"],sunburst:[_],heatmap:[_,H,"lineColor",ss,z],waterfall:[_,"connectorLine","seriesItems"],funnel:[_,K,Y,z,X,H,"dropoff",li,Fe],"cone-funnel":[_,K,Y,z,X,H,li],pyramid:[_,K,Y,z,X,H,li,Fe]},this.seriesType=e.seriesType}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const{isExpandedOnInit:e,chartOptionsService:t,chartController:s,registerGroupComponent:i}=this.options,r={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.translate("series"),expanded:e,suppressEnabledCheckbox:!0};this.setTemplate(`
`,[N],{seriesGroup:r}),i(this.seriesGroup),this.chartMenuUtils=this.createManagedBean(new tt(t.getSeriesOptionsProxy(()=>this.seriesType))),this.addManagedListeners(s,{chartSeriesChartTypeChanged:this.refreshWidgets.bind(this)}),this.refreshWidgets()}refreshWidgets(){const{chartController:e}=this.options;this.destroyActivePanels(),e.getChartProxy().getChart().waitForUpdate().then(()=>{this.isAlive()&&(e.isComboChart()&&(this.updateSeriesType(),this.initSeriesSelect()),(this.seriesWidgetMappings[this.seriesType]??[]).forEach(i=>{const r=this.widgetFuncs[i]();let a;if(Array.isArray(r)){const o=this.createBean(r[0]);a=o,r[1](o)}else a=this.createBean(r);this.seriesGroup.addItem(a),this.activePanels.push(a)}))}).catch(s=>BG(105,{e:s}))}initSeriesSelect(){const e=this.createBean(new ea(this.chartMenuUtils.getDefaultSelectParamsWithoutValueParams("seriesType",this.getSeriesSelectOptions(),`${this.seriesType}`,t=>{this.seriesType=t,this.refreshWidgets()})));this.seriesGroup.addItem(e),this.activePanels.push(e)}initTooltips(){return new GG(this.chartMenuUtils.addValueParams("tooltip.enabled",{label:this.translate("tooltips"),labelAlignment:"left",labelWidth:"flex",inputWidth:"flex"}))}initLineColor(){return new Oc(this.chartMenuUtils.getDefaultColorPickerParams("stroke","strokeColor"))}initStrokeWidth(e,t){return new ie(this.chartMenuUtils.getDefaultSliderParams(t?`${t}.${e}`:"strokeWidth",e,10))}initLineDash(e){return new ie(this.chartMenuUtils.getDefaultSliderParams(e?`${e}.lineDash`:"lineDash","lineDash",30,!0))}initOpacity(e,t){const s=this.chartMenuUtils.getDefaultSliderParams(t?`${t}.${e}`:e,e,1);return s.step=.05,new ie(s)}initDropOff(){return[new UG({tag:"dropOff",cssIdentifier:"charts-format-sub-level",title:this.translate("dropOff"),suppressEnabledCheckbox:!1,chartMenuParamsFactory:this.chartMenuUtils}),s=>{[this.initStrokeWidth("strokeWidth","dropOff"),this.initLineDash("dropOff"),this.initOpacity("strokeOpacity","dropOff"),this.initOpacity("fillOpacity","dropOff")].forEach(i=>{const r=s.createManagedBean(i);s.addItem(r),this.activePanels.push(r)})}]}initLabels(){const e=Mc(this.seriesType),t=e?"calloutLabel":"label",s=e?"calloutLabels":"labels",i=this.chartMenuUtils.getDefaultFontPanelParams(t,s);return[new He(i),o=>{if(e){const n=o.createManagedBean(new WG(this.chartMenuUtils));o.addItem(n),this.activePanels.push(n)}if(this.seriesType==="range-bar"){const n=[{value:"inside",text:this.translate("inside")},{value:"outside",text:this.translate("outside")}],l=o.createManagedBean(new ea(this.chartMenuUtils.getDefaultSelectParams("label.placement","labelPlacement",n)));o.addItem(l),this.activePanels.push(l);const c=o.createManagedBean(new ie(this.chartMenuUtils.getDefaultSliderParams("label.padding","padding",200)));o.addItem(c),this.activePanels.push(c)}}]}initSectorLabels(){const e=this.chartMenuUtils.getDefaultFontPanelParams("sectorLabel","sectorLabels");return[new He(e),i=>{const r=this.chartMenuUtils.getDefaultSliderParams("sectorLabel.positionRatio","positionRatio",1);r.step=.05;const a=i.createManagedBean(new ie(r));i.addItem(a)}]}initStageLabels(){return new He(this.chartMenuUtils.getDefaultFontPanelParams("stageLabel",li))}initBins(){const e=this.chartMenuUtils.getDefaultSliderParams("binCount","histogramBinCount",20),t=this.chartMenuUtils.getChartOptions(),s=(t.getValue("bins")??t.getValue("calculatedBins",!0)).length;return e.value=`${s}`,e.maxValue=Math.max(s,20),new ie(e)}initShape(){return new ea(this.chartMenuUtils.getDefaultSelectParams("shape","shape",sd(this.chartTranslation)))}initSize(e,t){return new ie(this.chartMenuUtils.getDefaultSliderParams(e,t,60))}getSeriesSelectOptions(){const e=this.getActiveSeriesTypes();return["area","bar","line"].filter(t=>e.includes(t)).map(t=>({value:t,text:this.translate(t)}))}updateSeriesType(){const e=this.getActiveSeriesTypes();!e.includes(this.seriesType)&&e.length>0&&(this.seriesType=e[0])}getActiveSeriesTypes(){return this.options.chartController.getActiveSeriesChartTypes().map(e=>B(e.chartType))}translate(e){return this.chartTranslation.translate(e)}destroyActivePanels(){this.activePanels.forEach(e=>{_G(e.getGui()),this.destroyBean(e)})}destroy(){this.destroyActivePanels(),super.destroy()}};import{Component as hO,RefPlaceholder as uO}from"ag-grid-community";import{AgInputTextField as pO,Component as gO}from"ag-grid-community";var rs=class extends gO{constructor(e,t,s){super("
"),this.chartMenuUtils=e,this.name=t,this.key=s,this.chartOptions=e.getChartOptions()}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){this.initFontPanel()}hasTitle(){const e=this.chartOptions.getValue(this.key);return e&&e.enabled&&e.text&&e.text.length>0}initFontPanel(){const e=this.hasTitle(),t={name:this.chartTranslation.translate(this.name),enabled:e,suppressEnabledCheckbox:!1,chartMenuParamsFactory:this.chartMenuUtils,keyMapper:s=>`${this.key}.${s}`,onEnableChange:s=>this.onEnableChange(s)};this.fontPanel=this.createManagedBean(new He(t)),this.fontPanel.addItem(this.createBean(new pO(this.getTextInputParams())),!0),this.fontPanel.addItem(this.createBean(new ie(this.getSpacingSliderParams()))),this.getGui().appendChild(this.fontPanel.getGui())}getTextInputParams(){return this.chartMenuUtils.addValueParams(`${this.key}.text`,{label:this.chartTranslation.translate("title"),labelAlignment:"top"})}getSpacingSliderParams(){return this.chartMenuUtils.getDefaultSliderParams(`${this.key}.spacing`,"spacing",100)}onEnableChange(e){this.chartOptions.setValue(`${this.key}.enabled`,e)}},mO=class extends rs{wireBeans(e){super.wireBeans(e),this.chartMenuSvc=e.chartMenuSvc}postConstruct(){this.titlePlaceholder=this.chartTranslation.translate("titlePlaceholder"),super.postConstruct(),this.addManagedEventListeners({chartTitleEdit:()=>{this.fontPanel.setEnabled(this.hasTitle())}})}getTextInputParams(){const e=super.getTextInputParams();return this.shouldOverrideTextWithPlaceholder(e.value)&&(e.value=this.titlePlaceholder),e}getSpacingSliderParams(){const e=super.getSpacingSliderParams();return e.value="10",e}onEnableChange(e){if(this.chartMenuSvc.doesChartToolbarExist()){const s=this.chartOptions.getValue("padding.top");this.chartOptions.setValue("padding.top",e?s-20:s+20)}this.chartOptions.setValue(`${this.key}.enabled`,e);const t=this.chartOptions.getValue(`${this.key}.text`);e&&this.shouldOverrideTextWithPlaceholder(t)&&this.chartOptions.setValue(`${this.key}.text`,this.titlePlaceholder)}shouldOverrideTextWithPlaceholder(e){return e==="Title"||e?.trim().length===0}},fO=class extends hO{constructor(e){super(),this.options=e,this.titleGroup=uO}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){const{chartMenuParamsFactory:e,chartAxisMenuParamsFactory:t,chartOptionsService:s,seriesType:i,isExpandedOnInit:r=!1,registerGroupComponent:a}=this.options,o=[];if(_e(i)&&i!=="pyramid"){const l=c=>this.createManagedBean(new tt(s.getCartesianAxisThemeOverridesProxy(c)));o.push(this.createManagedBean(new rs(l("xAxis"),"horizontalAxisTitle","title"))),o.push(this.createManagedBean(new rs(l("yAxis"),"verticalAxisTitle","title")))}else Wr(i)&&o.push(this.createManagedBean(new rs(t,"polarAxisTitle","title")));const n={cssIdentifier:"charts-format-top-level",direction:"vertical",title:this.chartTranslation.translate("chartTitles"),expanded:r,suppressEnabledCheckbox:!0,items:[this.createManagedBean(new mO(e,"chartTitle","title")),this.createManagedBean(new rs(e,"chartSubtitle","subtitle")),...o]};this.setTemplate(`
`,[N],{titleGroup:n}),a(this.titleGroup)}},CO={groups:[{type:"chart"},{type:"titles"},{type:"legend"},{type:"series"},{type:"axis"}]},id=["axis","horizontalAxis","verticalAxis"],vO=class extends Xk{constructor(e){super('
'),this.chartMenuContext=e}postConstruct(){this.groupExpansionFeature=this.createManagedBean(new EG(this.getGui())),this.chartPanelFeature=this.createManagedBean(new kc(this.chartMenuContext.chartController,this.getGui(),"ag-chart-format-section",(e,t)=>this.createPanels(t))),this.chartPanelFeature.refreshPanels()}createPanels(e){let t=!1;this.getFormatPanelDef().groups?.forEach(({type:s,isOpen:i=!1})=>{if(!this.isGroupPanelShownInSeries(s,e))return;i&&(t&&Qc(145,{group:s}),t=!0);const r=o=>this.groupExpansionFeature.addGroupComponent(o),a={...this.chartMenuContext,isExpandedOnInit:i,seriesType:e,registerGroupComponent:r};switch(s){case"chart":this.chartPanelFeature.addComponent(new AG(a));break;case"titles":this.chartPanelFeature.addComponent(new fO(a));break;case"legend":this.chartPanelFeature.addComponent(new kG(a,this.chartMenuContext));break;case"axis":Wr(e)?this.chartPanelFeature.addComponent(new SG(a)):_e(e)&&(this.chartPanelFeature.addComponent(new ni("xAxis",a)),this.chartPanelFeature.addComponent(new ni("yAxis",a)));break;case"horizontalAxis":this.chartPanelFeature.addComponent(new ni("xAxis",a));break;case"verticalAxis":this.chartPanelFeature.addComponent(new ni("yAxis",a));break;case"series":this.chartPanelFeature.addComponent(new dO(a));break;default:Qc(147,{group:s})}})}getFormatPanelDef(){const e=this.gos.get("chartToolPanelsDef")?.formatPanel;return e||CO}isGroupPanelShownInSeries(e,t){const s=["chart","titles","legend","series"].includes(e)||_e(t)&&id.includes(e)||Wr(t)&&e==="axis",i=xc(t)&&e==="legend"||xc(t)&&id.includes(e);return s&&!i}};import{Component as yO,RefPlaceholder as as,_areEqual as SO,_clearElement as rd,_createIconNoSpan as ad,_getAbsoluteWidth as bO,_radioCssClass as od,_setDisplayed as wO}from"ag-grid-community";import{Component as xO,KeyCode as nd,_setAriaLabel as TO,_warn as ld}from"ag-grid-community";import{Component as MO,_error as PO}from"ag-grid-community";var FO="ag-chart-mini-thumbnail-canvas",st=class extends MO{constructor(e,t,s){super(),this.agChartsExports=t,this.tooltipName=s,this.size=58,this.padding=5;const{_Scene:i}=t;this.root=new i.Group;const r=new i.Scene({width:this.size,height:this.size});r.canvas.element.classList.add(FO),r.setRoot(this.root),r.setContainer(e),this.scene=r}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){this.scene.canvas.element.title=this.chartTranslation.translate(this.tooltipName);try{this.scene.render()}catch(e){PO(108,{e})}}};import{_last as cd}from"ag-grid-community";function os(e){const{stacked:t,size:s,padding:i,xScalePadding:r,xScaleDomain:a,yScaleDomain:o,agChartsExports:{_Scene:n}}=e,l=new n.CategoryScale;l.domain=a,l.range=[i,s-i],l.paddingInner=r,l.paddingOuter=r;const c=new n.LinearScale;c.domain=o,c.range=[s-i,i];const d=(h,u,p)=>h.map((g,m)=>{const C=p.convert(g),f=new n.Rect;return f.x=u.convert(m),f.y=C,f.width=u.bandwidth,f.height=p.convert(0)-C,f.strokeWidth=0,f.crisp=!0,f});return t?e.data.map(h=>d(h,l,c)):d(e.data,l,c)}function AO(e,t,s,i){const r=[],a=[];t.forEach(l=>{l.forEach(([c,d])=>{r.push(c),a.push(d)})});const o=new e.LinearScale;o.domain=[Math.min(...r),Math.max(...r)],o.range=[i,s-i];const n=new e.LinearScale;return n.domain=[Math.min(...a),Math.max(...a)],n.range=[s-i,i],{xScale:o,yScale:n}}function dd(e,t,s,i){const r=[0,t[0].length-1],a=t.reduce((l,c)=>(c.forEach(d=>{dl[1]&&(l[1]=d)}),l),[1/0,-1/0]);a[0]--,a[a.length-1]++;const o=new e.LinearScale;o.domain=r,o.range=[i,s-i];const n=new e.LinearScale;return n.domain=a,n.range=[s-i,i],{xScale:o,yScale:n}}function hd(e,t,s){return e.map(i=>i.map((r,a)=>[a>0?"lineTo":"moveTo",t.convert(a),s.convert(r)]))}function RO(e,t,s){return e.map(([i,r],a)=>[a>0?"lineTo":"moveTo",t.convert(i),s.convert(r)])}function EO(e){const t=e[0],s=e[1],i=cd(e);return(s[1]!==i[1]||s[2]!==i[2])&&e.push([t[0],s[1],s[2]]),e}function ud(e,t){const s=new e.Path;return t.forEach(([i,r,a])=>s.path[i](r,a)),s}function IO(e,t,s){return e.map((i,r,a)=>{const n=[...s?DO(a,r,t):pd(i,t)].reverse().map(([d,h,u])=>["lineTo",h,u]),l=i[0],c=cd(n);return(l[1]!==c[1]||l[2]!==c[2])&&n.push(["lineTo",l[1],l[2]]),[...i,...n]})}function DO(e,t,s){return t===0?pd(e[t],s):[...e[t-1]]}function pd(e,t){return e.map(([s,i])=>[s,i,t.convert(0)])}function gd(e,t){const s=ud(e,t);return s.fill=void 0,s.lineCap="round",s.strokeWidth=3,s}function LO({_Scene:e},t,s,i,r){const{xScale:a,yScale:o}=AO(e,s,i,r),d=s.map(u=>RO(u,a,o)).map(u=>EO(u)).map(u=>gd(e,u)).reduce((u,p)=>u.concat(p),[]),h=new e.Group;return h.setClipRect(new e.BBox(r,r,i-r*2,i-r*2)),h.append(d),t.append(h),d}function ta({_Scene:e},t,s,i,r){const{xScale:a,yScale:o}=dd(e,s,i,r),l=hd(s,a,o).map(d=>gd(e,d)),c=new e.Group;return c.setClipRect(new e.BBox(r,r,i-r*2,i-r*2)),c.append(l),t.append(c),l}function kO(e,t,s,i,r,a=!1){const{xScale:o,yScale:n}=dd(e,s,i,r),l=IO(hd(s,o,n),n,a),c=new e.Group;c.setClipRect(new e.BBox(r,r,i-r*2,i-r*2));const d=l.map(h=>ud(e,h));return c.append(d),t.append(c),d}function md(e){return e.map((t,s,i)=>t.map((r,a)=>i.slice(0,s+1).reduce((o,n)=>o+n[a],0)))}function fd(e){const t=e.map((s,i)=>e.reduce((r,a)=>Math.max(r,a[i]),0));return e.map(s=>s.map((i,r)=>i/t[r]*19))}function Cd(e,t,s,i,r,a,o=0){const{_Scene:n}=e,l=new n.LinearScale;l.domain=[0,7],l.range=[-Math.PI,Math.PI].map(g=>g+Math.PI/2);const c=new n.LinearScale;c.domain=[0,10],c.range=[r,a];const d=[],h=i/2,u=s.map(g=>{const m=new n.Path;return m.strokeWidth=1,m.strokeOpacity=.5,m.lineCap="round",m.fill=void 0,m.fillOpacity=.8,g.forEach((C,f)=>{const v=l.convert(f),y=r+a-c.convert(C),x=y*Math.cos(v)+h,S=y*Math.sin(v)+h;if(m.path[f>0?"lineTo":"moveTo"](x,S),o>0){const w=new n.Marker({shape:"circle"});w.x=x,w.y=S,w.size=o,d.push(w)}}),m.path.closePath(),m}),p=new n.Group;return p.append([...u,...d]),t.append(p),{paths:u,markers:d}}function ci(e){let[t,s]=[1/0,-1/0];return{processedData:e.reduce((r,a,o)=>{const n=o>0?r[o-1]:void 0;r[o]??(r[o]=[]);const l=r[o];return a.forEach((c,d)=>{n&&(c+=n[d]),l[d]=c,l[d]s&&(s=l[d])}),r},[]),min:t,max:s}}var GO=[[[13,16],[13,12],[3,12],[3,16]],[[12,11],[12,7],[4,7],[4,11]],[[10.125,6],[10.125,1.5],[5.875,1.5],[5.875,6]]],sa=class extends st{constructor(e,t,s,i,r,a,o="funnelTooltip",n=GO){super(e,t,o),this.shapes=LO(t,this.root,n,this.size,this.padding),this.updateColors(s,i)}updateColors(e,t){this.shapes.forEach(s=>{s.fill=e[0],s.stroke=t[0],s.strokeWidth=0})}},OO={chartType:"funnel",miniChart:sa},NO=[[[13,16],[10.75,11.5],[5.25,11.5],[3,16]],[[10.75,11.5],[8.875,6],[7.125,6],[5.25,11.5]],[[8.875,6],[8.875,1.5],[7.125,1.5],[7.125,6]]],BO=class extends sa{constructor(e,t,s,i,r,a,o="coneFunnelTooltip"){super(e,t,s,i,r,a,o,NO)}updateColors(e,t){this.shapes.forEach((s,i)=>{s.fill=e[0],s.fillOpacity=1-i*.2,s.stroke=t[0],s.strokeWidth=0})}},_O={chartType:"coneFunnel",miniChart:BO},VO=[[[8,16],[10,12],[6,12]],[[10.5,11],[12.5,7],[3.5,7],[5.5,11]],[[13,6],[15.5,1.5],[.5,1.5],[3,6]]],HO=class extends sa{constructor(e,t,s,i,r,a,o="pyramidTooltip"){super(e,t,s,i,r,a,o,VO)}updateColors(e,t){this.shapes.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i],s.strokeWidth=0})}},zO={chartType:"pyramid",miniChart:HO},J=class extends st{constructor(e,t,s){super(e,t,s),this.stroke="gray",this.axisOvershoot=3}postConstruct(){const{_Scene:e}=this.agChartsExports,t=this.size,s=this.padding,i=new e.Line;i.x1=s,i.y1=s,i.x2=s,i.y2=t-s+this.axisOvershoot,i.stroke=this.stroke;const r=new e.Line;r.x1=s-this.axisOvershoot+1,r.y1=t-s,r.x2=t-s+1,r.y2=t-s,r.stroke=this.stroke;const a=this.root;a.append(i),a.append(r),super.postConstruct()}},UO=class extends J{constructor(e,t,s,i){super(e,t,"groupedColumnTooltip"),this.columnData=[2,3,4];const{root:r,columnData:a,size:o,padding:n}=this;this.columns=os({stacked:!1,root:r,data:a,size:o,padding:n,xScaleDomain:[0,1,2],yScaleDomain:[0,4],xScalePadding:.3,agChartsExports:t}),r.append(this.columns),this.updateColors(s,i)}updateColors(e,t){this.columns.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i]})}},KO={chartType:"groupedColumn",miniChart:UO},WO=[[8,12,16],[6,9,12],[2,3,4]],vd=class extends J{constructor(e,t,s,i,r,a,o=WO,n=[0,16],l="stackedColumnTooltip"){super(e,t,l);const{root:c,size:d,padding:h}=this;this.stackedColumns=os({stacked:!0,root:c,data:o,size:d,padding:h,xScaleDomain:[0,1,2],yScaleDomain:n,xScalePadding:.3,agChartsExports:t}),c.append([].concat.apply([],this.stackedColumns)),this.updateColors(s,i)}updateColors(e,t){this.stackedColumns.forEach((s,i)=>s.forEach(r=>{r.fill=e[i],r.stroke=t[i]}))}},jO={chartType:"stackedColumn",miniChart:vd},$O=[[10,10,10],[6,7,8],[2,4,6]],YO=class extends vd{constructor(e,t,s,i,r,a){super(e,t,s,i,r,a,$O,[0,10],"normalizedColumnTooltip")}},XO={chartType:"normalizedColumn",miniChart:YO},qO=class extends J{constructor(e,t,s,i){super(e,t,"groupedBarTooltip");const{_Scene:r}=t,a=this.padding,o=this.size,n=[2,3,4],l=new r.CategoryScale;l.domain=[0,1,2],l.range=[a,o-a],l.paddingInner=.3,l.paddingOuter=.3;const c=new r.LinearScale;c.domain=[0,4],c.range=[o-a,a];const d=c.convert(0),h=l.bandwidth;this.bars=n.map((u,p)=>{const g=new r.Rect;return g.x=a,g.y=l.convert(p),g.width=d-c.convert(u),g.height=h,g.strokeWidth=0,g.crisp=!0,g}),this.updateColors(s,i),this.root.append(this.bars)}updateColors(e,t){this.bars.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i]})}},ZO={chartType:"groupedBar",miniChart:qO},JO=[[8,12,16],[6,9,12],[2,3,4]],yd=class extends J{constructor(e,t,s,i,r,a,o=JO,n=[0,16],l="stackedBarTooltip"){super(e,t,l);const{_Scene:c}=t,d=this.size,h=this.padding,u=new c.CategoryScale;u.domain=[0,1,2],u.range=[h,d-h],u.paddingInner=.3,u.paddingOuter=.3;const p=new c.LinearScale;p.domain=n,p.range=[d-h,h];const g=p.convert(0),m=u.bandwidth;this.bars=o.map(C=>C.map((f,v)=>{const y=new c.Rect;return y.x=h,y.y=u.convert(v),y.width=g-p.convert(f),y.height=m,y.strokeWidth=0,y.crisp=!0,y})),this.updateColors(s,i),this.root.append([].concat.apply([],this.bars))}updateColors(e,t){this.bars.forEach((s,i)=>s.forEach(r=>{r.fill=e[i],r.stroke=t[i]}))}},QO={chartType:"stackedBar",miniChart:yd},e1=[[10,10,10],[6,7,8],[2,4,6]],t1=class extends yd{constructor(e,t,s,i,r,a){super(e,t,s,i,r,a,e1,[0,10],"normalizedBarTooltip")}},s1={chartType:"normalizedBar",miniChart:t1},Sd=class extends st{constructor(e,t,s,i,r,a,o=.6,n="donutTooltip"){super(e,t,n);const{size:l,padding:c,agChartsExports:{_Scene:d}}=this,h=(l-c*2)/2,u=h+c,p=d.toRadians,g=[[p(-90),p(30)],[p(30),p(120)],[p(120),p(180)],[p(180),p(210)],[p(210),p(240)],[p(240),p(270)]];this.sectors=g.map(([m,C])=>{const f=new d.Sector;return f.centerX=u,f.centerY=u,f.innerRadius=h*o,f.outerRadius=h,f.startAngle=m,f.endAngle=C,f.stroke=void 0,f.strokeWidth=0,f.inset=.75,f}),this.updateColors(s,i),this.root.append(this.sectors)}updateColors(e,t){this.sectors.forEach((s,i)=>{s.fill=e[i%e.length],s.stroke=t[i%t.length]})}},bd={chartType:"donut",miniChart:Sd},i1=class extends Sd{constructor(e,t,s,i,r,a){super(e,t,s,i,r,a,0,"pieTooltip")}},r1={chartType:"pie",miniChart:i1},ia=[[1,3,5],[2,6,4],[5,3,1]],ra=class extends J{constructor(e,t,s,i,r,a,o=ia,n="lineTooltip"){super(e,t,n);const{size:l,padding:c,root:d}=this;this.lines=ta(t,d,o,l,c),this.updateColors(s,i)}updateColors(e,t){this.lines.forEach((s,i)=>{s.stroke=e[i]})}},a1={chartType:"line",miniChart:ra},wd=md(ia),o1=class extends ra{constructor(e,t,s,i,r,a,o=wd,n="stackedLineTooltip"){super(e,t,s,i,r,a,o,n)}},n1={chartType:"stackedLine",miniChart:o1},l1=fd(wd),c1=class extends ra{constructor(e,t,s,i,r,a,o=l1,n="normalizedLineTooltip"){super(e,t,s,i,r,a,o,n)}},d1={chartType:"normalizedLine",miniChart:c1},h1=class extends J{constructor(e,t,s,i){super(e,t,"scatterTooltip");const{size:r,padding:a,agChartsExports:{_Scene:o}}=this,n=[[[.3,3],[1.1,.9],[2,.4],[3.4,2.4]],[[0,.3],[1,2],[2.4,1.4],[3,0]]],l=new o.LinearScale;l.domain=[-.5,4],l.range=[a*2,r-a];const c=new o.LinearScale;c.domain=[-.5,3.5],c.range=[r-a,a];const d=[];n.forEach(u=>{u.forEach(([p,g])=>{const m=new o.Arc;m.strokeWidth=0,m.centerX=l.convert(p),m.centerY=c.convert(g),m.radius=2.5,d.push(m)})}),this.points=d,this.updateColors(s,i);const h=new o.Group;h.setClipRect(new o.BBox(a,a,r-a*2,r-a*2)),h.append(this.points),this.root.append(h)}updateColors(e,t){this.points.forEach((s,i)=>{s.stroke=t[i%t.length],s.fill=e[i%e.length]})}},u1={chartType:"scatter",miniChart:h1},p1=class extends J{constructor(e,t,s,i){super(e,t,"bubbleTooltip");const{size:r,padding:a,agChartsExports:{_Scene:o}}=this,n=[[[.1,.3,5],[.5,.4,7],[.2,.8,7]],[[.8,.7,5],[.7,.3,9]]],l=new o.LinearScale;l.domain=[0,1],l.range=[a*2,r-a];const c=new o.LinearScale;c.domain=[0,1],c.range=[r-a,a];const d=[];n.forEach(u=>{u.forEach(([p,g,m])=>{const C=new o.Arc;C.strokeWidth=0,C.centerX=l.convert(p),C.centerY=c.convert(g),C.radius=m,C.fillOpacity=.7,d.push(C)})}),this.points=d,this.updateColors(s,i);const h=new o.Group;h.setClipRect(new o.BBox(a,a,r-a*2,r-a*2)),h.append(this.points),this.root.append(h)}updateColors(e,t){this.points.forEach((s,i)=>{s.stroke=t[i%t.length],s.fill=e[i%e.length]})}},g1={chartType:"bubble",miniChart:p1},xd=ia,Td=class extends J{constructor(e,t,s,i,r,a,o=xd,n="groupedAreaTooltip",l=!1){super(e,t,n),this.areas=kO(t._Scene,this.root,o,this.size,this.padding,l),this.updateColors(s,i)}updateColors(e,t){this.areas.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i],s.strokeWidth=1,s.strokeOpacity=.75,s.fillOpacity=.7})}},m1={chartType:"area",miniChart:Td},Md=md(xd),Pd=class extends Td{constructor(e,t,s,i,r,a,o=Md,n="stackedAreaTooltip"){super(e,t,s,i,r,a,o,n,!0)}updateColors(e,t){this.areas.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i]})}},f1={chartType:"stackedArea",miniChart:Pd},C1=fd(Md),v1=class extends Pd{constructor(e,t,s,i,r,a,o=C1,n="normalizedAreaTooltip"){super(e,t,s,i,r,a,o,n)}},y1={chartType:"normalizedArea",miniChart:v1},S1=class extends J{constructor(e,t,s,i){super(e,t,"histogramTooltip");const{padding:r,size:a,agChartsExports:{_Scene:o}}=this,n=[2,5,11,13,10,6,1],l=new o.LinearScale;l.domain=[0,n.length],l.range=[r,a-r];const c=new o.LinearScale;c.domain=[0,n.reduce((h,u)=>Math.max(h,u),0)],c.range=[a-r,r];const d=c.convert(0);this.bars=n.map((h,u)=>{const p=c.convert(h),g=l.convert(u),m=l.convert(u+1),C=new o.Rect;return C.x=g,C.y=p,C.width=m-g,C.height=d-p,C.strokeWidth=1,C.strokeOpacity=.75,C.crisp=!0,C}),this.updateColors(s,i),this.root.append(this.bars)}updateColors([e],[t]){this.bars.forEach(s=>{s.fill=e,s.stroke=t})}},b1={chartType:"histogram",miniChart:S1},St=class extends st{constructor(e,t,s){super(e,t,s),this.stroke="gray",this.showRadiusAxisLine=!0,this.showAngleAxisLines=!0}postConstruct(){const{_Scene:e}=this.agChartsExports,t=this.size,s=this.padding,i=s*2,r=(t-i)/2,a=this.showAngleAxisLines?[r,r*.8,r*.6,r*.4]:[],o=new e.Line;o.x1=t/2,o.y1=s,o.x2=t/2,o.y2=t-s-r-a[a.length-1],o.stroke=this.stroke,o.strokeOpacity=.5,o.fill=void 0,o.visible=this.showRadiusAxisLine;const n=s+r;this.gridLines=a.map((c,d)=>{const h=new e.Path;return h.path.arc(n,n,c,0,2*Math.PI),h.strokeWidth=1,h.stroke=this.stroke,h.strokeOpacity=d===0?.5:.2,h.fill=void 0,h});const l=this.root;l.append(o),this.gridLines.length>0&&l.append(this.gridLines),super.postConstruct()}},w1=class extends St{constructor(e,t,s,i){super(e,t,"radialColumnTooltip"),this.data=[[6,8,10,2,6,5],[4,4,3,6,4,4],[5,4,2,9,8,9]],this.showRadiusAxisLine=!1;const{padding:r,size:a,data:o,agChartsExports:{_Scene:n}}=this,l=(a-r*2)/2,d=l*.4,h=new n.CategoryScale;h.domain=o[0].map((f,v)=>v),h.range=[0,2*Math.PI],h.paddingInner=0,h.paddingOuter=0;const u=h.bandwidth*.7,{processedData:p,max:g}=ci(o),m=new n.LinearScale;m.domain=[0,g],m.range=[d,l];const C=this.size/2;this.series=p.map((f,v)=>{const x=v===0?void 0:p[v-1],S=new n.TranslatableGroup({zIndex:1e6}),w=f.map((T,P)=>{const F=x?.[P],A=m.convert(T),M=m.convert(F??0),L=h.convert(P),I=L+u,D=n.getRadialColumnWidth(L,I,l,.5,.5),E=new n.RadialColumnShape;return E.columnWidth=D,E.innerRadius=M,E.outerRadius=A,E.startAngle=L,E.endAngle=I,E.isBeveled=!0,E.axisInnerRadius=d,E.axisOuterRadius=l,E.stroke=void 0,E.strokeWidth=0,E});return S.append(w),S.translationX=C,S.translationY=C,S}),this.root.append(this.series),this.updateColors(s,i)}updateColors(e,t){this.series.forEach((s,i)=>{for(const r of s.children())r.fill=e[i%e.length],r.stroke=t[i%t.length]})}},x1={chartType:"radialColumn",miniChart:w1},T1=class extends St{constructor(e,t,s,i){super(e,t,"radialBarTooltip"),this.data=[[6,8,10],[4,4,3],[5,4,2]],this.showRadiusAxisLine=!1;const{size:r,padding:a,data:o,agChartsExports:{_Scene:n}}=this,l=(r-a)/2,d=l*.4,h=new n.CategoryScale;h.domain=o[0].map((y,x)=>x),h.range=[d,l],h.paddingInner=.5,h.paddingOuter=0;const u=h.bandwidth,{processedData:p,max:g}=ci(o),m=new n.LinearScale;m.domain=[0,Math.ceil(g*1.5)];const C=3/2*Math.PI,f=C+2*Math.PI;m.range=[C,f];const v=r/2;this.series=p.map((y,x)=>{const S=x<0?void 0:p[x-1],w=new n.Group({zIndex:1e6}),T=y.map((P,F)=>{const A=S?.[F]??0,M=h.convert(F),L=M-u,I=m.convert(A),D=m.convert(P),E=new n.Sector;return E.centerX=v,E.centerY=v,E.innerRadius=L,E.outerRadius=M,E.startAngle=I,E.endAngle=D,E.stroke=void 0,E.strokeWidth=0,E});return w.append(T),w}),this.root.append(this.series),this.updateColors(s,i)}updateColors(e,t){this.series.forEach((s,i)=>{for(const r of s.children())r.fill=e[i%e.length],r.stroke=t[i%t.length]})}},M1={chartType:"radialBar",miniChart:T1},P1=class extends St{constructor(e,t,s,i){super(e,t,"radarLineTooltip"),this.markerSize=4,this.data=[[8,7,8,7,8,8,7,8],[6,8,5,10,6,7,4,6],[0,3,3,5,4,4,2,0]],this.showRadiusAxisLine=!1;const{size:r,padding:a,root:o,data:n}=this,l=(r-a*2)/2,c=0,{paths:d,markers:h}=Cd(t,o,n,r,l,c,this.markerSize);this.lines=d,this.markers=h,this.updateColors(s,i)}updateColors(e,t){this.lines.forEach((s,i)=>{const r=this.data[i].length;s.stroke=e[i];const a=i*r,o=a+r;this.markers.slice(a,o).forEach(l=>{l.stroke=t[i],l.fill=e[i]})})}},F1={chartType:"radarLine",miniChart:P1},A1=class extends St{constructor(e,t,s,i){super(e,t,"radarAreaTooltip"),this.data=[[8,10,5,7,4,1,5,8],[1,1,2,7,7,8,10,1],[4,5,9,9,4,2,3,4]];const{size:r,padding:a,root:o,data:n}=this;this.showRadiusAxisLine=!1;const l=(r-a*2)/2,c=l-r*.3;this.areas=Cd(t,o,n,r,l,c).paths,this.updateColors(s,i)}updateColors(e,t){this.areas.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i]})}},R1={chartType:"radarArea",miniChart:A1},E1=class extends St{constructor(e,t,s,i){super(e,t,"nightingaleTooltip"),this.data=[[6,10,9,8,7,8],[4,6,5,4,5,5],[3,5,4,3,4,7]],this.showRadiusAxisLine=!1;const{size:r,padding:a,data:o,agChartsExports:{_Scene:n}}=this,l=(r-a*2)/2,c=new n.CategoryScale;c.domain=o[0].map((m,C)=>C),c.range=[-Math.PI,Math.PI],c.paddingInner=0,c.paddingOuter=0;const d=c.bandwidth*.7,{processedData:h,max:u}=ci(o),p=new n.LinearScale;p.domain=[0,u],p.range=[0,l];const g=r/2;this.series=h.map((m,C)=>{const f=C<0?void 0:h[C-1],v=new n.Group({zIndex:1e6}),y=m.map((x,S)=>{const w=f?.[S],T=p.convert(x),P=p.convert(w??0),F=c.convert(S),A=F+d,M=new n.Sector;return M.centerX=g,M.centerY=g,M.innerRadius=P,M.outerRadius=T,M.startAngle=F,M.endAngle=A,M.stroke=void 0,M.strokeWidth=0,M});return v.append(y),v}),this.root.append(this.series),this.updateColors(s,i)}updateColors(e,t){this.series.forEach((s,i)=>{for(const r of s.children())r.fill=e[i%e.length],r.stroke=t[i%t.length]})}},I1={chartType:"nightingale",miniChart:E1},D1=class extends J{constructor(e,t,s,i){super(e,t,"rangeBarTooltip");const r=[3,3.5,3];this.bars=this.createRangeBar(this.root,r,this.size,this.padding,"vertical"),this.updateColors(s,i)}updateColors(e,t){this.bars.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i]})}createRangeBar(e,t,s,i,r){const a=r==="horizontal",o=2*i,{_Scene:n}=this.agChartsExports,l=new n.CategoryScale;l.domain=t.map((g,m)=>m),l.range=[i,s-i],l.paddingInner=.3,l.paddingOuter=.3;const c=.7,d=1.3,h=new n.LinearScale;h.domain=[t.reduce((g,m)=>Math.min(g,m),1/0)*c,t.reduce((g,m)=>Math.max(g,m),0)*d],h.range=[o,s-o];const u=l.bandwidth,p=t.map((g,m)=>{const[C,f]=[g*c,g*d],v=l.convert(m),y=h.convert(C),x=h.convert(f)-y,S=new n.Rect;return S.x=a?y:v,S.y=a?v:y,S.width=a?x:u,S.height=a?u:x,S.strokeWidth=0,S.crisp=!0,S});return e.append(p),p}},L1={chartType:"rangeBar",miniChart:D1},k1=class extends J{constructor(e,t,s,i){super(e,t,"rangeAreaTooltip");const r=4,a=[aa({offset:.375*r,length:r,pattern:{low:3,high:5,period:r}}),aa({offset:.375*r,length:r,pattern:{low:2.25,high:4.25,period:r}}),aa({offset:.75*r,length:r,pattern:{low:2.5,high:4.5,period:r}})],o=1.75,n=a.map(d=>d.map(([h,u])=>({x:h,low:u-.5*o,high:u+.5*o}))),{lines:l,areas:c}=this.createRangeArea(this.root,n,this.size,this.padding);this.lines=l,this.areas=c,this.updateColors(s,i)}updateColors(e,t){e=Ad(e,1,2),t=Ad(t,1,2),this.lines.forEach(([s,i],r)=>{s.fill=void 0,s.stroke=t[r],i.fill=void 0,i.stroke=t[r]}),this.areas.forEach((s,i)=>{s.fill=e[i]})}createRangeArea(e,t,s,i){const r=t.reduce((m,C)=>C.reduce((f,{x:v})=>Math.min(f,v),m),1/0),a=t.reduce((m,C)=>C.reduce((f,{x:v})=>Math.max(f,v),m),-1/0),o=t.reduce((m,C)=>C.reduce((f,{low:v})=>Math.min(f,v),m),1/0),n=t.reduce((m,C)=>C.reduce((f,{high:v})=>Math.max(f,v),m),-1/0),{_Scene:l}=this.agChartsExports,c=new l.LinearScale;c.domain=[r,a],c.range=[i,s-i];const d=2*i,h=new l.LinearScale;h.domain=[o,n],h.range=[s-d,d];const u=[],p=[];return t.map(m=>{const C=new l.Path,f=new l.Path,v=new l.Path;return u.push([C,f]),p.push(v),C.strokeWidth=0,f.strokeWidth=0,v.strokeWidth=0,v.fillOpacity=.8,C.path.clear(),f.path.clear(),v.path.clear(),m.map((y,x)=>{const{x:S,low:w,high:T}=y,P=c.convert(S),F=h.convert(w),A=h.convert(T),M=x>0?"lineTo":"moveTo";return C.path[M](P,A),f.path[M](P,F),v.path[M](P,A),[P,F]})}).forEach((m,C)=>{const f=m.length-1,v=p[C];for(let y=f;y>=0;y--){const[x,S]=m[y];v.path.lineTo(x,S)}}),e.append(p.concat(...u)),{lines:u,areas:p}}};function aa(e){const{offset:t,length:s,pattern:i}=e,r=n(t,s,i),a=0,o=s;return(r.length===0||r[0][0]!==a)&&r.unshift(l(a,t,i)),r[r.length-1][0]!==o&&r.push(l(o,t,i)),r;function n(d,h,u){const{period:p}=u,g=d/p,C=[0,.5].map(v=>v-g).map(Fd).sort((v,y)=>v-y);return Array.from({length:Math.floor(C.length*(p/h))},(v,y)=>C[y%C.length]+Math.floor(y/C.length)).map(v=>v*p).map(v=>l(v,d,u))}function l(d,h,u){return[d,c(h+d,u)]}function c(d,h){const{low:u,high:p,period:g}=h,m=Fd(d/g),C=m>.5?1-2*(m-.5):2*m;return u+(p-u)*C}}function Fd(e){const t=e%1;return t<0?t+1:t}function Ad(e,t,s){const i=[...e],r=i[t];return i[t]=i[s],i[s]=r,i}var G1={chartType:"rangeArea",miniChart:k1},O1=class extends J{constructor(e,t,s,i,r,a){super(e,t,"boxPlotTooltip");const{size:o,padding:n,agChartsExports:{_Scene:l}}=this,c=[11,11.5,10.5],d=1.2,h=1.1,u=.9,p=.8,g=new l.LinearScale;g.domain=[c.reduce((v,y)=>Math.min(v,y),1/0)*p,c.reduce((v,y)=>Math.max(v,y),0)*d],g.range=[o-1.5*n,n];const m=new l.CategoryScale;m.domain=c.map((v,y)=>y),m.range=[n,o-n],m.paddingInner=.4,m.paddingOuter=.2;const C=Math.round(m.bandwidth),f=Math.round(m.bandwidth/2);this.boxPlotGroups=c.map((v,y)=>{const[x,S,w,T]=[v*p,v*u,v*h,v*d],P=Math.round(g.convert(w)),F=Math.round(m.convert(y)),A=Math.round(F+C),M=Math.round(g.convert(S)),L=Math.round(g.convert(x)),I=Math.round(g.convert(v)),D=Math.round(g.convert(T)),E=F+f,k=new l.Group,V=new l.Rect,ne=new l.Line,he=new l.Line,le=new l.Line,it=new l.Line,te=new l.Line;return V.x=F,V.y=P,V.width=C,V.height=M-P,V.strokeWidth=1,V.strokeOpacity=.75,V.crisp=!0,this.setLineProperties(ne,F,A,I,I),this.setLineProperties(he,E,E,D,P),this.setLineProperties(le,E,E,L,M),this.setLineProperties(it,F,A,D,D),this.setLineProperties(te,F,A,L,L),k.append([V,ne,he,le,it,te]),k}),this.updateColors(s,i,r,a),this.root.append(this.boxPlotGroups)}updateColors(e,t,s,i){const{agChartsExports:{_Util:r,_Theme:a}}=this,o=s?.get(a.themeSymbols.DEFAULT_BACKGROUND_COLOUR),n=(Array.isArray(o)?o[0]:o)??"white";this.boxPlotGroups.forEach((l,c)=>{for(const d of l.children()){const h=e[c%e.length];d.fill=i?h:r.interpolateColor(h,n)(.7),d.stroke=t[c%t.length]}})}setLineProperties(e,t,s,i,r){e.x1=t,e.x2=s,e.y1=i,e.y2=r,e.strokeOpacity=.75}},N1={chartType:"boxPlot",miniChart:O1},B1=class extends st{constructor(e,t,s,i,r,a){super(e,t,"treemapTooltip");const{size:o,padding:n,agChartsExports:{_Scene:l}}=this,c=[[1,1],[3,2,1]],h=c.length%2===0?.3:.2,u=[n,o-n],p=c.length,g=p*(p+1)/2,m=h/(p-1),C=u[1]-u[0],f=C-h;let v=u[0];this.rects=c.reduce((x,S,w)=>{x??(x=[]);const T=(p-w)/g,P=f*T,F=S.length,A=S.reduce((E,k)=>E+=k,0),M=h/(F-1||1),L=F>1?C-h:C;let I=u[0];const D=S.map(E=>{const k=new l.Rect,V=L*E/A;return k.x=v,k.y=I,k.width=P,k.height=V,k.strokeWidth=.75,k.crisp=!0,I+=V+M,k});return v+=P+m,x.push(...D),x},[]),this.updateColors(s,i,r,a);const y=new l.Group;y.setClipRect(new l.BBox(n,n,o-n,o-n)),y.append(this.rects),this.root.append(y)}updateColors(e,t,s,i){const r=s?.get(this.agChartsExports._Theme.themeSymbols.DEFAULT_BACKGROUND_COLOUR),a=(Array.isArray(r)?r[0]:r)??"white";this.rects.forEach((o,n)=>{o.fill=e[n%t.length],o.stroke=i?t[n%t.length]:a})}},_1={chartType:"treemap",miniChart:B1},V1=class extends St{constructor(e,t,s,i){super(e,t,"sunburstTooltip"),this.data=[[[],[]],[[],[]],[[],[]]],this.angleOffset=-Math.PI/2,this.innerRadiusRatio=0,this.showRadiusAxisLine=!1,this.showAngleAxisLines=!1;const{data:r,size:a,padding:o,angleOffset:n,innerRadiusRatio:l,agChartsExports:{_Scene:c}}=this,d=(a-o*2)/2,h=[n+0,n+2*Math.PI],u=Math.abs(h[1]-h[0]),p=[d*l,d],g=Math.abs(p[1]-p[0]);let m=0;const C=(S,w)=>{S.forEach(T=>{const P=w+1;m=Math.max(m,P),C(T,P)})};C(r,0);const f=g/m,v=this.size/2,y=h[0];this.series=[];const x=(S,w,T,P,F)=>{if(!Array.isArray(S))return;const M=w+1;let L=T;S.forEach((I,D,E)=>{let k=F;k||(k=new c.Group,this.series.push(k));const V=p[0]+w*f,ne=p[0]+M*f,he=1/E.length,le=L,it=le+P*he,te=new c.Sector;te.centerX=v,te.centerY=v,te.innerRadius=V,te.outerRadius=ne,te.startAngle=le,te.endAngle=it,te.stroke=void 0,te.strokeWidth=0,te.inset=.75,L=it,k.append(te),x(I,M,le,Math.abs(it-le),k)})};x(r,0,y,u),this.root.append(this.series),this.updateColors(s,i)}updateColors(e,t){this.series.forEach((s,i)=>{for(const r of s.children())r.fill=e[i%e.length],r.stroke=t[i%t.length]})}},H1={chartType:"sunburst",miniChart:V1},z1=class extends st{constructor(e,t,s,i,r,a){super(e,t,"heatmapTooltip");const{size:o,padding:n,agChartsExports:{_Scene:l}}=this,c=3,d=Array.from({length:c},(f,v)=>Array.from({length:c},(y,x)=>x)),h=d.map((f,v)=>v),u=new l.CategoryScale;u.domain=h,u.range=[n,o-n],u.paddingInner=.01,u.paddingOuter=.1;const p=new l.CategoryScale;p.domain=h,p.range=[n,o-n],p.paddingInner=.01,p.paddingOuter=.1;const g=u.bandwidth??0,m=p.bandwidth??0;this.rects=d.reduce((f,v,y)=>{f??(f=[]);const x=v.map((S,w)=>{const T=new l.Rect;return T.x=u.convert(y),T.y=p.convert(w),T.width=g,T.height=m,T.strokeWidth=0,T.crisp=!0,T});return f.push(...x),f},[]),this.updateColors(s,i,r,a);const C=new l.Group;C.setClipRect(new l.BBox(n,n,o-n,o-n)),C.append(this.rects),this.root.append(C)}updateColors(e,t,s,i){const{_Theme:r,_Util:a}=this.agChartsExports,o=s?.get(r.themeSymbols.DEFAULT_DIVERGING_SERIES_COLOR_RANGE),n=s?.get(r.themeSymbols.DEFAULT_BACKGROUND_COLOUR),l=(Array.isArray(n)?n[0]:n)??"white",c=i?[e[0],e[1]]:o,d=i?t[0]:l,h=a.interpolateColor(c[0],c[1]);this.rects.forEach((u,p)=>{u.fill=h(p*.2),u.stroke=d})}},U1={chartType:"heatmap",miniChart:z1},K1=class extends J{constructor(e,t,s,i,r,a){super(e,t,"waterfallTooltip"),this.data=[4,3,-3,6,-3],this.bars=this.createWaterfall(this.root,this.data,this.size,this.padding,"vertical").bars,this.updateColors(s,i,r,a)}updateColors(e,t,s,i){const{data:r,agChartsExports:{_Theme:{themeSymbols:a}}}=this,o={fill:i?e[0]:s?.get(a.PALETTE_ALT_UP_FILL),stroke:i?t[0]:s?.get(a.PALETTE_ALT_UP_STROKE)},n={fill:i?e[1]:s?.get(a.PALETTE_ALT_DOWN_FILL),stroke:i?t[1]:s?.get(a.PALETTE_ALT_DOWN_STROKE)};this.bars.forEach((l,c)=>{const d=r[c]>=0;l.fill=d?o.fill:n.fill,l.stroke=d?o.stroke:n.stroke})}createWaterfall(e,t,s,i,r){const a=2*i,{processedData:o,min:n,max:l}=ci(t.map(y=>[y])),c=o.reduce((y,x)=>y.concat(x),[]),{_Scene:d}=this.agChartsExports,h=new d.LinearScale;h.domain=[Math.min(n,0),l],h.range=[s-a,a];const u=new d.CategoryScale;u.domain=t.map((y,x)=>x),u.range=[i,s-i],u.paddingInner=.2,u.paddingOuter=.3;const p=u.bandwidth,g=new d.Path;g.stroke="#575757",g.strokeWidth=0;const m=Math.floor(g.strokeWidth)%2/2,C=g.path;C.clear();const f=r==="horizontal",v=c.map((y,x)=>{const S=x>0?c[x-1]:0,T=t[x]>0,P=Math.round(h.convert(y)),F=Math.round(h.convert(S)),A=(T?P:F)-m,M=(T?F:P)+m,L=Math.abs(M-A),I=u.convert(x),D=new d.Rect;D.x=f?A:I,D.y=f?I:A,D.width=f?L:p,D.height=f?p:L,D.strokeWidth=0,D.crisp=!0;const E=P+m,k=F+m;if(x>0){const he=f?k:D.x,le=f?D.y:k;C.lineTo(he,le)}const V=f?E:D.x,ne=f?D.y:E;return C.moveTo(V,ne),D});return e.append([g,...v]),{bars:v}}},W1={chartType:"waterfall",miniChart:K1},j1=class extends J{constructor(e,t,s,i){super(e,t,"columnLineComboTooltip"),this.columnData=[3,4],this.lineData=[[5,4,6,5,4]];const{root:r,columnData:a,lineData:o,size:n,padding:l}=this;this.columns=os({stacked:!1,root:r,data:a,size:n,padding:l,xScaleDomain:[0,1],yScaleDomain:[0,4],xScalePadding:.5,agChartsExports:t}),r.append(this.columns),this.lines=ta(t,r,o,n,l),this.updateColors(s,i)}updateColors(e,t){this.columns.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i]}),this.lines.forEach((s,i)=>{s.stroke=e[i+2]})}},$1={chartType:"columnLineCombo",miniChart:j1},Y1=class extends J{constructor(e,t,s,i){super(e,t,"areaColumnComboTooltip"),this.columnData=[3,4.5],this.areaData=[[5,4,6,5,4]];const{root:r,columnData:a,areaData:o,size:n,padding:l,agChartsExports:{_Scene:c}}=this;this.columns=os({stacked:!1,root:r,data:a,size:n,padding:l,xScaleDomain:[0,1],yScaleDomain:[0,6],xScalePadding:.5,agChartsExports:t});const d=new c.CategoryScale;d.range=[l,n-l],d.domain=[0,1,2,3,4],d.paddingInner=1,d.paddingOuter=0;const h=new c.LinearScale;h.range=[n-l,l],h.domain=[0,6];const u=[],p=h.convert(0),g=d.convert(0);o.forEach((f,v)=>{const y=u[v]||(u[v]=[]);f.forEach((S,w)=>{const T=S,P=w,F=d.convert(P),A=h.convert(T);y[w]={x:F,y:A}});const x=d.convert(f.length-1);u[v].push({x,y:p},{x:g,y:p})}),this.areas=u.map(f=>{const v=new c.Path;v.strokeWidth=0,v.fillOpacity=.8;const y=v.path;return f.forEach((x,S)=>y[S>0?"lineTo":"moveTo"](x.x,x.y)),v});const m=new c.Group;m.setClipRect(new c.BBox(l,l,n-l*2,n-l*2));const C=new c.Group;C.setClipRect(new c.BBox(l,l,n-l*2,n-l*2)),m.append(this.areas),C.append(this.columns),r.append(m),r.append(C),this.updateColors(s,i)}updateColors(e,t){this.areas.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i]}),this.columns.forEach((s,i)=>{s.fill=e[i+1],s.stroke=t[i+1]})}},X1={chartType:"areaColumnCombo",miniChart:Y1},q1=class extends st{constructor(e,t,s,i){super(e,t,"customComboTooltip"),this.columnData=[3,4],this.lineData=[[5,4,6,5,4]];const{root:r,columnData:a,lineData:o,size:n,padding:l,agChartsExports:{_Scene:c}}=this;this.columns=os({stacked:!1,root:r,data:a,size:n,padding:l,xScaleDomain:[0,1],yScaleDomain:[0,4],xScalePadding:.5,agChartsExports:t}),r.append(this.columns),this.lines=ta(this.agChartsExports,r,o,n,l);const d="grey",h=3,u=new c.Line;u.x1=l,u.y1=l,u.x2=l,u.y2=n-l+h,u.stroke=d;const p=new c.Line;p.x1=l-h+1,p.y1=n-l,p.x2=n-l+1,p.y2=n-l,p.stroke=d;const g=new c.Path;this.buildPenIconPath(g),g.fill="whitesmoke",g.stroke="darkslategrey",g.strokeWidth=1,r.append([p,u,g]),this.updateColors(s,i)}updateColors(e,t){this.columns.forEach((s,i)=>{s.fill=e[i],s.stroke=t[i]}),this.lines.forEach((s,i)=>{s.stroke=e[i+2]})}buildPenIconPath(e){const{path:t}=e;t.moveTo(25.76,43.46),t.lineTo(31.27,48.53),t.moveTo(49.86,22),t.lineTo(49.86,22),t.cubicCurveTo(49.01994659053345,21.317514933510974,47.89593834348529,21.09645997825817,46.86,21.41),t.lineTo(46.86,21.41),t.cubicCurveTo(45.55460035985361,21.77260167850787,44.38777081121966,22.517979360321792,43.51,23.55),t.lineTo(25.51,43.8),t.lineTo(25.43,43.89),t.lineTo(23.01,51.89),t.lineTo(22.83,52.46),t.lineTo(31.02,48.86),t.lineTo(49.02,28.52),t.lineTo(49.02,28.52),t.cubicCurveTo(49.940716461596224,27.521914221246085,50.54302631059587,26.2720342455763,50.75,24.93),t.lineTo(50.75,24.93),t.cubicCurveTo(50.95363374988308,23.866379846512814,50.62080640232334,22.77066734274871,49.86,22),t.closePath(),t.moveTo(41.76,25.5),t.lineTo(47.34,30.5),t.moveTo(40.74,26.65),t.lineTo(46.25,31.71)}},Z1={chartType:"customCombo",miniChart:q1},Rd={columnGroup:{column:{range:!0,pivot:!0,enterprise:!1,icon:KO},stackedColumn:{range:!0,pivot:!0,enterprise:!1,icon:jO},normalizedColumn:{range:!0,pivot:!0,enterprise:!1,icon:XO}},barGroup:{bar:{range:!0,pivot:!0,enterprise:!1,icon:ZO},stackedBar:{range:!0,pivot:!0,enterprise:!1,icon:QO},normalizedBar:{range:!0,pivot:!0,enterprise:!1,icon:s1}},pieGroup:{pie:{range:!0,pivot:!0,enterprise:!1,icon:r1},donut:{range:!0,pivot:!0,enterprise:!1,icon:bd},doughnut:{range:!0,pivot:!0,enterprise:!1,icon:bd}},lineGroup:{line:{range:!0,pivot:!0,enterprise:!1,icon:a1},stackedLine:{range:!0,pivot:!0,enterprise:!1,icon:n1},normalizedLine:{range:!0,pivot:!0,enterprise:!1,icon:d1}},scatterGroup:{scatter:{range:!0,pivot:!0,enterprise:!1,icon:u1},bubble:{range:!0,pivot:!0,enterprise:!1,icon:g1}},areaGroup:{area:{range:!0,pivot:!0,enterprise:!1,icon:m1},stackedArea:{range:!0,pivot:!0,enterprise:!1,icon:f1},normalizedArea:{range:!0,pivot:!0,enterprise:!1,icon:y1}},polarGroup:{radarLine:{range:!0,pivot:!1,enterprise:!0,icon:F1},radarArea:{range:!0,pivot:!1,enterprise:!0,icon:R1},nightingale:{range:!0,pivot:!1,enterprise:!0,icon:I1},radialColumn:{range:!0,pivot:!1,enterprise:!0,icon:x1},radialBar:{range:!0,pivot:!1,enterprise:!0,icon:M1}},statisticalGroup:{boxPlot:{range:!0,pivot:!1,enterprise:!0,icon:N1},histogram:{range:!0,pivot:!1,enterprise:!1,icon:b1},rangeBar:{range:!0,pivot:!1,enterprise:!0,icon:L1},rangeArea:{range:!0,pivot:!1,enterprise:!0,icon:G1}},hierarchicalGroup:{treemap:{range:!0,pivot:!0,enterprise:!0,icon:_1},sunburst:{range:!0,pivot:!0,enterprise:!0,icon:H1}},specializedGroup:{heatmap:{range:!0,pivot:!1,enterprise:!0,icon:U1},waterfall:{range:!0,pivot:!1,enterprise:!0,icon:W1}},combinationGroup:{columnLineCombo:{range:!0,pivot:!0,enterprise:!1,icon:$1},areaColumnCombo:{range:!0,pivot:!0,enterprise:!1,icon:X1},customCombo:{range:!0,pivot:!0,enterprise:!1,icon:Z1}},funnelGroup:{funnel:{range:!0,pivot:!1,enterprise:!0,icon:OO},coneFunnel:{range:!0,pivot:!1,enterprise:!0,icon:_O},pyramid:{range:!0,pivot:!1,enterprise:!0,icon:zO}}},J1={columnGroup:["column","stackedColumn","normalizedColumn"],barGroup:["bar","stackedBar","normalizedBar"],pieGroup:["pie","donut"],lineGroup:["line","stackedLine","normalizedLine"],areaGroup:["area","stackedArea","normalizedArea"],scatterGroup:["scatter","bubble"],polarGroup:["radarLine","radarArea","nightingale","radialColumn","radialBar"],statisticalGroup:["boxPlot","histogram","rangeBar","rangeArea"],hierarchicalGroup:["treemap","sunburst"],specializedGroup:["heatmap","waterfall"],funnelGroup:["funnel","coneFunnel","pyramid"],combinationGroup:["columnLineCombo","areaColumnCombo","customCombo"]},Q1=class extends xO{constructor(e,t,s,i,r,a=J1){super('
'),this.wrappers=new Map,this.chartController=e,this.fills=t,this.strokes=s,this.themeTemplateParameters=i,this.isCustomTheme=r,this.chartGroups={...a}}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){!this.chartController.customComboExists()&&this.chartGroups.combinationGroup&&(this.chartGroups.combinationGroup=this.chartGroups.combinationGroup.filter(a=>a!=="customCombo"));const e=this.getGui(),t=this.chartController.isEnterprise(),s=this.chartController.isPivotChart(),i=!s,r=Object.keys(this.chartGroups).map(a=>{const o=a in Rd?Rd[a]:void 0;if(!o)return ld(148,{group:a}),null;const l=(this.chartGroups[a]??[]).map(c=>{const d=c in o?o[c]:void 0;return d?!t&&d.enterprise?null:i&&d.range||s&&d.pivot?d:null:(ld(149,{group:a,chartType:c}),null)}).filter(c=>c!=null);return l.length===0?null:{label:this.chartTranslation.translate(a),items:l}}).filter(a=>a!=null);for(const{label:a,items:o}of r){const n=this.createBean(new Se({title:a,suppressEnabledCheckbox:!0,enabled:!0,suppressOpenCloseIcons:!0,cssIdentifier:"charts-settings",direction:"horizontal",suppressKeyboardNavigation:!0}));for(const l of o){const{miniChart:c,chartType:d}=l.icon,h=document.createElement("div");h.classList.add("ag-chart-mini-thumbnail"),h.setAttribute("tabindex","0"),h.setAttribute("role","button");const u=d,p=()=>{this.chartController.setChartType(u),this.updateSelectedMiniChart()};this.addManagedListeners(h,{click:p,keydown:g=>{(g.key==nd.ENTER||g.key===nd.SPACE)&&(g.preventDefault(),p())}}),this.wrappers.set(u,h),this.createBean(new c(h,this.beans.agChartsExports,this.fills,this.strokes,this.themeTemplateParameters,this.isCustomTheme)),n.addItem(h)}e.appendChild(n.getGui())}this.updateSelectedMiniChart()}updateSelectedMiniChart(){const e=this.chartController.getChartType();this.wrappers.forEach((t,s)=>{const i=s===e;t.classList.toggle("ag-selected",i);const r=this.chartTranslation.translate($r(s)),a=i?`${r}. ${this.chartTranslation.translate("ariaChartSelected")}`:r;TO(t,a)})}destroy(){this.wrappers.clear(),super.destroy()}},eN=class extends yO{constructor(e){super(`
`),this.chartController=e,this.eMiniChartsContainer=as,this.eNavBar=as,this.eCardSelector=as,this.ePrevBtn=as,this.eNextBtn=as,this.miniChartsContainers=[],this.cardItems=[],this.activePaletteIndex=0,this.palettes=[],this.themes=[]}postConstruct(){this.resetPalettes(),this.ePrevBtn.insertAdjacentElement("afterbegin",ad("chartsThemePrevious",this.beans)),this.eNextBtn.insertAdjacentElement("afterbegin",ad("chartsThemeNext",this.beans)),this.addManagedElementListeners(this.ePrevBtn,{click:()=>this.setActivePalette(this.getPrev(),"left")}),this.addManagedElementListeners(this.eNextBtn,{click:()=>this.setActivePalette(this.getNext(),"right")});const e=()=>this.resetPalettes(!0);this.addManagedListeners(this.chartController,{chartTypeChanged:e,chartApiUpdate:e}),this.scrollSelectedIntoView()}scrollSelectedIntoView(){setTimeout(()=>{const e=i=>!i.getGui().classList.contains("ag-hidden"),s=this.miniChartsContainers.find(e).getGui().querySelector(".ag-selected");if(s){const i=s.offsetParent;i&&this.eMiniChartsContainer.scrollTo(0,i.offsetTop)}},250)}resetPalettes(e){const t=this.chartController.getPalettes(),s=this.chartController.getThemeTemplateParameters(),i=this.gos.get("chartToolPanelsDef")?.settingsPanel?.chartGroupsDef;if(SO(t,this.palettes)&&!e||this.isAnimating)return;this.palettes=t,this.themes=this.chartController.getThemeNames(),this.activePaletteIndex=this.themes.findIndex(a=>a===this.chartController.getChartThemeName()),this.cardItems=[],rd(this.eCardSelector),this.destroyMiniCharts();const{themes:r}=this;this.palettes.forEach((a,o)=>{const n=this.activePaletteIndex===o,{fills:l=[],strokes:c=[]}=a,d=r[o],h=!Yr(d,this.beans.agChartsExports._Theme),u=this.createBean(new Q1(this.chartController,l,c,s[o],h,i));this.miniChartsContainers.push(u),this.eMiniChartsContainer.appendChild(u.getGui()),this.addCardLink(o),n?u.updateSelectedMiniChart():u.setDisplayed(!1)}),wO(this.eNavBar,this.palettes.length>1),od(this.cardItems[this.activePaletteIndex],"ag-selected","ag-not-selected")}addCardLink(e){const t=document.createElement("div");t.classList.add("ag-chart-settings-card-item"),this.addManagedElementListeners(t,{click:()=>{this.setActivePalette(e,e=this.palettes.length&&(e=0),e}setActivePalette(e,t){if(this.isAnimating||this.activePaletteIndex===e)return;od(this.cardItems[e],"ag-selected","ag-not-selected");const s=this.miniChartsContainers[this.activePaletteIndex],i=s.getGui(),r=this.miniChartsContainers[e],a=r.getGui();s.updateSelectedMiniChart(),r.updateSelectedMiniChart();const o=t==="left"?-1:1,n=a.style.left=`${bO(this.getGui())*o}px`;this.activePaletteIndex=e,this.isAnimating=!0;const l="ag-animating";r.setDisplayed(!0),s.addCssClass(l),r.addCssClass(l),this.chartController.setChartThemeName(this.themes[e]),window.setTimeout(()=>{i.style.left=`${-parseFloat(n)}px`,a.style.left="0px"},0),window.setTimeout(()=>{this.isAnimating=!1,s.removeCssClass(l),r.removeCssClass(l),s.setDisplayed(!1)},300)}destroyMiniCharts(){rd(this.eMiniChartsContainer),this.miniChartsContainers=this.destroyBeans(this.miniChartsContainers)}destroy(){this.destroyMiniCharts(),super.destroy()}},tN="data",sN="format",iN=class extends pk{constructor(e,t){super(),this.panels=e,this.chartMenuContext=t,this.tabs=[]}wireBeans(e){this.chartTranslation=e.chartTranslation}postConstruct(){this.panels.forEach(e=>{const t=e.replace("chart","").toLowerCase(),s=this.createPanel(t),i=this.createTab(e,t,s);this.tabs.push(i),this.addDestroyFunc(()=>this.destroyBean(s))}),this.tabbedLayout=new Cn({items:this.tabs,cssClass:"ag-chart-tabbed-menu",keepScrollPosition:!0,suppressFocusBodyOnOpen:!0,suppressTrapFocus:!0,enableCloseButton:!0,closeButtonAriaLabel:this.chartTranslation.translate("ariaChartMenuClose"),onCloseClicked:()=>{this.eventSource?.focus({preventScroll:!0}),this.dispatchLocalEvent({type:"closed"})}}),this.createBean(this.tabbedLayout)}createTab(e,t,s){const i=document.createElement("div");i.classList.add("ag-chart-tab",`ag-chart-${t}`),this.createBean(s),i.appendChild(s.getGui());const r=document.createElement("div"),a=this.chartTranslation.translate(t);return r.innerText=a,{title:r,titleLabel:a,bodyPromise:uk.resolve(i),getScrollableContainer:()=>i.querySelector(".ag-scrollable-container")||i,name:e}}showTab(e){const t=this.tabs[e];this.tabbedLayout.showItem(t)}getGui(){return this.tabbedLayout&&this.tabbedLayout.getGui()}showMenu(e,t){this.eventSource=e,t||this.tabbedLayout?.focusHeader(!0)}destroy(){this.parentComponent&&this.parentComponent.isAlive()&&this.destroyBean(this.parentComponent),super.destroy()}createPanel(e){switch(e){case tN:return new Yk(this.chartMenuContext);case sN:return new vO(this.chartMenuContext);default:return new eN(this.chartMenuContext.chartController)}}},rN=class extends rk{constructor(e,t,s){super('
'),this.eChartContainer=e,this.eMenuPanelContainer=t,this.chartMenuContext=s,this.buttons={chartLink:{iconName:"linked",callback:()=>this.chartMenuSvc.toggleLinked(this.chartMenuContext)},chartUnlink:{iconName:"unlinked",callback:()=>this.chartMenuSvc.toggleLinked(this.chartMenuContext)},chartDownload:{iconName:"chartsDownload",callback:()=>this.chartMenuSvc.downloadChart(this.chartMenuContext)},chartMenu:{iconName:"chartsMenu",callback:i=>this.showMenuList(i)}},this.panels=[],this.menuVisible=!1,this.chartController=s.chartController}wireBeans(e){this.chartMenuSvc=e.chartMenuSvc,this.chartMenuListFactory=e.chartMenuListFactory,this.environment=e.environment}postConstruct(){this.chartToolbar=this.createManagedBean(new hk),this.getGui().appendChild(this.chartToolbar.getGui()),this.refreshToolbarAndPanels(),this.addManagedEventListeners({chartCreated:e=>{e.chartId===this.chartController.getChartId()&&this.gos.get("chartToolPanelsDef")?.defaultToolPanel&&this.showMenu({panel:this.defaultPanel,suppressFocus:!0})}}),this.addManagedListeners(this.chartController,{chartLinkedChanged:this.refreshToolbarAndPanels.bind(this)}),this.refreshMenuClasses(),this.addManagedListeners(this.chartController,{chartApiUpdate:this.refreshToolbarAndPanels.bind(this)})}isVisible(){return this.menuVisible}getExtraPaddingDirections(){return["chartMenu","chartLink","chartUnlink","chartDownload"].some(e=>this.chartToolbarOptions.includes(e))?["top"]:[]}refreshToolbarAndPanels(){this.initToolbarOptionsAndPanels(),this.updateToolbar()}initToolbarOptionsAndPanels(){const{panels:e,defaultPanel:t}=this.chartMenuSvc.getChartToolPanels(this.chartController);this.panels=e,this.defaultPanel=t,this.chartToolbarOptions=this.chartMenuSvc.getChartToolbarOptions()}updateToolbar(){const e=this.chartToolbarOptions.map(t=>{const{iconName:s,callback:i}=this.buttons[t];return{buttonName:t,iconName:s,callback:i}});this.chartToolbar.updateParams({buttons:e})}createMenuPanel(e){const t=this.menuPanel=this.createBean(new $a({height:"100%",closable:!0,hideTitleBar:!0,cssIdentifier:"chart-menu"}));return t.setParentComponent(this),this.eMenuPanelContainer.appendChild(t.getGui()),this.tabbedMenu=this.createBean(new iN(this.panels,this.chartMenuContext)),this.addManagedListeners(this.tabbedMenu,{closed:()=>{this.hideMenu()}}),this.addManagedListeners(t,{destroyed:()=>this.destroyBean(this.tabbedMenu)}),new ik(s=>{window.setTimeout(()=>{t.setBodyComponent(this.tabbedMenu),this.tabbedMenu.showTab(e),s(t)},100)})}showContainer(e,t){this.menuPanel&&(this.menuVisible=!0,this.refreshMenuClasses(),this.tabbedMenu.showMenu(e,t))}showMenu(e){const{panel:t,eventSource:s,suppressFocus:i}=e??{};if(this.menuPanel&&!t)this.showContainer(s,i);else{const r=t||this.defaultPanel;let a=this.panels.indexOf(r);a<0&&(ak(143,{panel:t}),a=this.panels.indexOf(this.defaultPanel)),this.menuPanel?(this.tabbedMenu.showTab(a),this.showContainer(s,i)):this.createMenuPanel(a).then(()=>this.showContainer(s,i))}}hideMenu(){this.menuVisible=!1,this.refreshMenuClasses()}refreshMenuClasses(){this.eChartContainer.classList.toggle("ag-chart-menu-visible",this.menuVisible),this.eChartContainer.classList.toggle("ag-chart-menu-hidden",!this.menuVisible)}showMenuList(e){this.chartMenuListFactory.showMenuList({eventSource:e,showMenu:()=>this.showMenu({eventSource:e}),chartMenuContext:this.chartMenuContext})}destroy(){super.destroy(),this.menuPanel&&this.menuPanel.isAlive()&&this.destroyBean(this.menuPanel),this.tabbedMenu&&this.tabbedMenu.isAlive()&&this.destroyBean(this.tabbedMenu)}};import{BeanStub as aN,_error as oN}from"ag-grid-community";var Ed=["number","category","time","grouped-category"],nN=["angle-category","angle-number","radius-category","radius-number"],lN=[...Ed,...nN],cN=class extends aN{constructor(e){super(),this.chartController=e}getChartThemeOverridesProxy(){return{getValue:e=>this.getChartOption(e),setValue:(e,t)=>this.setChartThemeOverrides([{expression:e,value:t}]),setValues:e=>this.setChartThemeOverrides(e)}}getAxisThemeOverridesProxy(){return{getValue:e=>this.getAxisProperty(e),setValue:(e,t)=>this.setAxisThemeOverrides([{expression:e,value:t}]),setValues:e=>this.setAxisThemeOverrides(e)}}getCartesianAxisOptionsProxy(e){return{getValue:t=>this.getCartesianAxisProperty(e,t),setValue:(t,s)=>this.setCartesianAxisOptions(e,[{expression:t,value:s}]),setValues:t=>this.setCartesianAxisOptions(e,t)}}getCartesianAxisThemeOverridesProxy(e){return{getValue:t=>this.getCartesianAxisProperty(e,t),setValue:(t,s)=>this.setCartesianAxisThemeOverrides(e,[{expression:t,value:s}]),setValues:t=>this.setCartesianAxisThemeOverrides(e,t)}}getCartesianAxisAppliedThemeOverridesProxy(e){return{getValue:t=>this.getCartesianAxisThemeOverride(e,t==="*"?null:t),setValue:(t,s)=>this.setCartesianAxisThemeOverrides(e,[{expression:t==="*"?null:t,value:s}]),setValues:t=>this.setCartesianAxisThemeOverrides(e,t)}}getSeriesOptionsProxy(e){return{getValue:(t,s)=>this.getSeriesOption(e(),t,s),setValue:(t,s)=>this.setSeriesOptions(e(),[{expression:t,value:s}]),setValues:t=>this.setSeriesOptions(e(),t)}}getPersistedChartThemeOverrides(e,t,s,i){const r=this.getRetainedChartThemeOverrideKeys(s,i),a=this.getRetainedChartAxisThemeOverrideKeys(null,s,i),o=this.createChartOptions();for(const n of r){const l=this.retrieveChartOptionsThemeOverride(e,s,n);l!==void 0&&this.assignChartOptionsThemeOverride(o,i,n,l)}return t&&this.assignPersistedAxisOverrides({existingAxes:t,retainedChartAxisThemeOverrideKeys:a,existingChartOptions:e,targetChartOptions:o,existingChartType:s,targetChartType:i}),o.theme.overrides}assignPersistedAxisOverrides(e){const{existingAxes:t,retainedChartAxisThemeOverrideKeys:s,existingChartOptions:i,targetChartOptions:r,existingChartType:a,targetChartType:o}=e;for(const{expression:n,targetAxisTypes:l}of s)for(const c of t.map(d=>d.type)){const d=this.retrieveChartOptionsThemeOverride(i,a,["axes",c,n].join("."));if(d!==void 0)for(const h of l)this.assignChartOptionsThemeOverride(r,o,["axes",h,n].join("."),d)}}getRetainedChartThemeOverrideKeys(e,t){const s=["animation"],i=["zoom","navigator"],r=((a,o)=>{const n=new Array;return _e(B(a))&&_e(B(o))&&n.push(...i),n})(e,t);return[...s,...r]}getRetainedChartAxisThemeOverrideKeys(e,t,s){return _e(B(t))&&_e(B(s))?this.getRetainedCartesianAxisThemeOverrideKeys(e).map(r=>({expression:r,targetAxisTypes:Ed})):[]}getRetainedCartesianAxisThemeOverrideKeys(e){const t=e==="xAxis"?["",".top",".bottom"]:e==="yAxis"?["",".left",".right"]:["",".left",".right",".top",".bottom"],s=["crosshair"],i=new Array;for(const r of s)for(const a of t)i.push(`${r}${a}`);return i}getChartOption(e){return Qe(this.getChart(),e,void 0)}setChartThemeOverrides(e){const t=this.getChartType(),s=this.createChartOptions();for(const{expression:i,value:r}of e)this.assignChartOptionsThemeOverride(s,t,i,r);this.applyChartOptions(s)}applyChartOptions(e,t){if(Object.keys(e).length===0)return;this.updateChart(e),!t?.silent&&this.raiseChartOptionsChangedEvent()}awaitChartOptionUpdate(e){this.chartController.getChartProxy().getChart().waitForUpdate().then(()=>e()).catch(s=>oN(108,{e:s}))}getAxisProperty(e){return Qe(this.getChart().axes?.[0],e,void 0)}setAxisThemeOverrides(e){const t=this.getChart(),s=this.getChartType(),i=this.createChartOptions();for(const{expression:r,value:a}of e){const o=t.axes?.filter(n=>{const l=r.split(".");let c=n;for(const d of l){if(!(d in c))return!1;c=c[d]}return!0});if(o)for(const n of o)this.isValidAxisType(n)&&this.assignChartAxisThemeOverride(i,s,n.type,null,r,a)}this.applyChartOptions(i)}getCartesianAxisProperty(e,t){const s=this.getChartAxes(),i=this.getCartesianAxis(s,e);return Qe(i,t,void 0)}getCartesianAxisThemeOverride(e,t){const s=this.getChartAxes(),i=this.getCartesianAxis(s,e);if(!i||!this.isValidAxisType(i))return;const r=this.getChartType(),a=this.getChart().getOptions();return this.retrieveChartAxisThemeOverride(a,r,i.type,e==="yAxis"?["left","right"]:["bottom","top"],t)}setCartesianAxisThemeOverrides(e,t){const s=this.getChartAxes(),i=this.getCartesianAxis(s,e);if(!i||!this.isValidAxisType(i))return;const r=this.getChartType(),a=this.createChartOptions();for(const{expression:o,value:n}of t)this.assignChartAxisThemeOverride(a,r,i.type,e==="yAxis"?["left","right"]:["bottom","top"],o,n);this.applyChartOptions(a)}setCartesianAxisOptions(e,t){this.updateCartesianAxisOptions(e,(s,i,r)=>{const a=i.indexOf(r);for(const{expression:o,value:n}of t)this.assignChartOption(s,`axes.${a}.${o}`,n)})}updateCartesianAxisOptions(e,t){const s=this.getChart().getOptions(),i="axes"in s?s.axes:void 0;if(!s||!i)return;const r=this.getChartAxes(),a=this.getCartesianAxis(r,e);if(!a)return;const o=this.createChartOptions();o.axes=i,t(o,r,a,s),this.applyChartOptions(o)}setCartesianCategoryAxisType(e,t){this.updateCartesianAxisOptions(e,(s,i,r,a)=>{const o=this.getChartType();this.assignPersistedAxisOverrides({existingAxes:[r],retainedChartAxisThemeOverrideKeys:this.getRetainedChartAxisThemeOverrideKeys(e,o,o),existingChartOptions:a,targetChartOptions:s,existingChartType:o,targetChartType:o}),this.assignChartOption(s,"axes.0.type",t),this.chartController.setCategoryAxisType(t)})}getCartesianAxis(e,t){if(!(e.length<2))switch(t){case"xAxis":return e[0].direction==="x"?e[0]:e[1];case"yAxis":return e[1].direction==="y"?e[1]:e[0]}}getSeriesOption(e,t,s){const i=this.getChart().series.find(r=>dN(e,r));return Qe(s?i:i?.properties.toJson(),t,void 0)}setSeriesOptions(e,t){const s=this.createChartOptions();for(const{expression:i,value:r}of t)this.assignChartOptionsSeriesThemeOverride(s,e,`series.${i}`,r);this.applyChartOptions(s)}getPairedMode(){return this.chartController.getChartProxy().isPaired()}setPairedMode(e){this.chartController.getChartProxy().setPaired(e)}getChartAxes(){return this.getChart().axes??[]}retrieveChartAxisThemeOverride(e,t,s,i,r){if(i)for(const a of i){const o=this.retrieveChartOptionsThemeOverride(e,t,["axes",s,a,...r?[r]:[]].join("."));if(o!==void 0)return o}else return this.retrieveChartOptionsThemeOverride(e,t,["axes",s,...r?[r]:[]].join("."))}assignChartAxisThemeOverride(e,t,s,i,r,a){if(i)for(const o of i)this.assignChartOptionsThemeOverride(e,t,["axes",s,o,...r?[r]:[]].join("."),a);else this.assignChartOptionsThemeOverride(e,t,["axes",s,...r?[r]:[]].join("."),a)}isValidAxisType(e){return lN.includes(e.type)}getChartType(){return this.chartController.getChartType()}getChart(){return this.chartController.getChartProxy().getChart()}updateChart(e){const t=this.chartController.getChartProxy().getChartRef();t.skipAnimations(),t.updateDelta(e)}createChartOptions(){return{theme:{overrides:{}}}}retrieveChartOptionsThemeOverride(e,t,s){const i=this.getChartThemeOverridesSeriesTypeKeys(t);for(const r of i){const a=this.retrieveChartOptionsSeriesThemeOverride(e,r,s);if(a!==void 0)return a}}assignChartOptionsThemeOverride(e,t,s,i){const r=this.getChartThemeOverridesSeriesTypeKeys(t);for(const a of r)this.assignChartOptionsSeriesThemeOverride(e,a,s,i)}retrieveChartOptionsSeriesThemeOverride(e,t,s){return this.retrieveChartOption(e,["theme","overrides",t,...s?[s]:[]].join("."))}assignChartOptionsSeriesThemeOverride(e,t,s,i){this.assignChartOption(e,["theme","overrides",t,...s?[s]:[]].join("."),i)}getChartThemeOverridesSeriesTypeKeys(e){const t=this.chartController.getChartSeriesTypes(e);return this.chartController.isComboChart()&&t.push("common"),t}retrieveChartOption(e,t){return Qe(e,t,void 0)}assignChartOption(e,t,s){MI(e,t,s)}raiseChartOptionsChangedEvent(){const e=this.chartController.getChartModel();this.eventSvc.dispatchEvent({type:"chartOptionsChanged",chartId:e.chartId,chartType:e.chartType,chartThemeName:this.chartController.getChartThemeName(),chartOptions:e.chartOptions})}};function dN(e,t){return RI(e)&&t.type===e}var hN=class extends PL{constructor(e){super(`
`),this.eChart=es,this.eWrapper=es,this.eChartContainer=es,this.eMenuContainer=es,this.eEmpty=es,this.params=e}wireBeans(e){this.crossFilterService=e.chartCrossFilterSvc,this.chartTranslation=e.chartTranslation,this.chartMenuSvc=e.chartMenuSvc,this.focusSvc=e.focusSvc,this.popupSvc=e.popupSvc,this.enterpriseChartProxyFactory=e.enterpriseChartProxyFactory,this.environment=e.environment}postConstruct(){const e={...this.params,chartType:Jt(this.params.chartType),chartThemeName:this.getThemeName()},t=this.gos.get("enableRtl");this.eWrapper.classList.add(t?"ag-rtl":"ag-ltr");const s=this.createBean(new CD(e));this.chartController=this.createManagedBean(new YL(s)),this.chartOptionsService=this.createManagedBean(new cN(this.chartController)),this.validateCustomThemes(),this.createChart(),this.params.insideDialog?this.addDialog():(this.addManagedEventListeners({gridStylesChanged:this.updateTheme.bind(this)}),this.updateTheme()),this.addMenu(),this.addManagedElementListeners(this.getGui(),{focusin:this.setActiveChartCellRange.bind(this)}),this.addManagedListeners(this.chartController,{chartModelUpdate:this.update.bind(this)}),this.addManagedPropertyListeners(["chartThemeOverrides","chartThemes"],this.reactivePropertyUpdate.bind(this)),this.update(),this.raiseChartCreatedEvent()}updateTheme(){this.environment.applyThemeClasses(this.getGui())}createChart(){let e;this.chartProxy&&(e=this.chartProxy.destroy({keepChartInstance:!0}));const t=(r,a)=>{const o=this.params.crossFilteringContext;o.lastSelectedChartId=a?"":this.chartController.getChartId(),a&&this.params.crossFilteringResetCallback(),this.crossFilterService.filter(r,a)},s=this.chartController.getChartType(),i={agChartsExports:this.beans.agChartsExports,chartType:s,chartInstance:e,getChartThemeName:this.getChartThemeName.bind(this),getChartThemes:this.getChartThemes.bind(this),customChartThemes:this.gos.get("customChartThemes"),getGridOptionsChartThemeOverrides:()=>this.getGridOptionsChartThemeOverrides(),getExtraPaddingDirections:()=>this.chartMenu?.getExtraPaddingDirections()??[],apiChartThemeOverrides:this.params.chartThemeOverrides,crossFiltering:this.params.crossFiltering??!1,crossFilterCallback:t,parentElement:this.eChart,grouping:this.chartController.isGrouping(),chartThemeToRestore:this.params.chartThemeName,chartOptionsToRestore:this.params.chartOptionsToRestore,chartPaletteToRestore:this.params.chartPaletteToRestore,seriesChartTypes:this.chartController.getSeriesChartTypes(),translate:r=>this.chartTranslation.translate(r)};if(this.params.chartOptionsToRestore=void 0,this.chartType=s,this.chartProxy=this.createChartProxy(i),!this.chartProxy){Vc(138,{chartType:i.chartType});return}this.chartController.setChartProxy(this.chartProxy),this.createMenuContext()}createMenuContext(){if(this.chartMenuContext)return;const e=this.createManagedBean(new tt(this.chartOptionsService.getChartThemeOverridesProxy())),t=this.createManagedBean(new tt(this.chartOptionsService.getAxisThemeOverridesProxy()));this.chartMenuContext={chartController:this.chartController,chartOptionsService:this.chartOptionsService,chartMenuParamsFactory:e,chartAxisMenuParamsFactory:t}}getChartThemeName(){return this.chartController.getChartThemeName()}getChartThemes(){return this.chartController.getThemeNames()}getGridOptionsChartThemeOverrides(){return this.gos.get("chartThemeOverrides")}createChartProxy(e){const{chartType:t}=e;switch(t){case"column":case"bar":case"groupedColumn":case"stackedColumn":case"normalizedColumn":case"groupedBar":case"stackedBar":case"normalizedBar":return new ZL(e);case"pie":case"donut":case"doughnut":return new sk(e);case"area":case"stackedArea":case"normalizedArea":return new XL(e);case"line":case"stackedLine":case"normalizedLine":return new JL(e);case"scatter":case"bubble":return new QL(e);case"columnLineCombo":case"areaColumnCombo":case"customCombo":return new ek(e)}const s=this.enterpriseChartProxyFactory?.createChartProxy(e);if(!s)throw Bc(251,{chartType:t});return s}addDialog(){const e=this.chartTranslation.translate(this.params.pivotChart?"pivotChartTitle":"rangeChartTitle"),{width:t,height:s}=this.getBestDialogSize(),i=this.params.focusDialogOnOpen?()=>setTimeout(()=>RL(this.getGui())):void 0;this.chartDialog=new At({resizable:!0,movable:!0,maximizable:!0,title:e,width:t,height:s,component:this,centered:!0,closable:!0,afterGuiAttached:i,postProcessPopupParams:{type:"chart"}}),this.createBean(this.chartDialog),this.chartDialog.addEventListener("destroyed",()=>{this.destroy(),this.chartMenuSvc.hideAdvancedSettings();const r=this.focusSvc.getFocusedCell();setTimeout(()=>{this.focusSvc.isAlive()&&(r?this.focusSvc.setFocusedCell({...r,forceBrowserFocus:!0}):AL(this.beans))})})}getBestDialogSize(){const e=this.popupSvc.getPopupParent(),t=IL(e)*.75,s=EL(e)*.75,i=.553,r=this.chartProxy.getChart();let a=this.params.insideDialog?850:r.width,o=this.params.insideDialog?470:r.height;return(a>t||o>s)&&(a=Math.min(a,t),o=Math.round(a*i),o>s&&(o=s,a=Math.min(a,Math.round(o/i)))),{width:a,height:o}}addMenu(){this.params.crossFiltering||(this.chartMenu=this.createBean(new rN(this.eChartContainer,this.eMenuContainer,this.chartMenuContext)),this.eChartContainer.appendChild(this.chartMenu.getGui()))}update(e){if(e?.chartId&&!this.chartController.update(e))return;const t=this.chartTypeChanged(e),s=t||this.chartEmpty?(r=>{const a=this.chartType,o=r,n=this.chartProxy.getChart(),l=n?.getOptions(),c=n?.axes;return this.chartOptionsService.getPersistedChartThemeOverrides(l,c,a,o??a)})(t):void 0;t&&this.createChart(),s&&e?.chartThemeOverrides&&DL(s,e.chartThemeOverrides);const i=s??e?.chartThemeOverrides;this.updateChart(i),e?.chartId&&this.chartProxy.getChart().waitForUpdate().then(()=>{this.chartController.raiseChartApiUpdateEvent()})}updateChart(e){const{chartProxy:t}=this,s=this.chartController.getSelectedValueColState(),i=this.chartController.getChartData(),r=this.handleEmptyChart(i,s.length);if(this.chartEmpty=r,r){e&&this.chartController.updateThemeOverrides(e);return}const a=this.chartController.getChartUpdateParams(e);t.update(a),this.chartProxy.getChart().waitForUpdate().then(()=>{this.chartController.raiseChartUpdatedEvent()})}chartTypeChanged(e){const[t,s]=[this.chartController.getChartType(),e?.chartType],i=s?Jt(s):void 0;return this.chartType!==t?i??t:i&&t!==i?i:null}getChartModel(){return this.chartController.getChartModel()}getChartImageDataURL(e){return this.chartProxy.getChartImageDataURL(e)}handleEmptyChart(e,t){const s=this.chartController.isPivotChart()&&!this.chartController.isPivotMode(),i=this.chartController.getChartType();let r=1;this.chartController.isActiveXYChart()?r=i==="bubble"?3:2:et(B(i))&&(r=0);const a=ts!=null).forEach(s=>{Object.keys(s).forEach(i=>t[i]=null)}),Object.keys(t)}validateCustomThemes(){const e=this.getChartThemes(),t=this.gos.get("customChartThemes");t&&this.getAllKeysInObjects([t]).forEach(s=>{e.includes(s)||Vc(139,{customThemeName:s})})}reactivePropertyUpdate(){this.chartController.setChartThemeName(this.getThemeName(),!0);const e=this.getChartId(),t=this.chartController.isCrossFilterChart()?"crossFilter":this.getChartModel().modelType,s=this.gos.get("chartThemeOverrides")||{};this.update({type:`${t}ChartUpdate`,chartId:e,chartThemeOverrides:s})}raiseChartCreatedEvent(){this.chartProxy.getChart().waitForUpdate().then(()=>{this.eventSvc.dispatchEvent({type:"chartCreated",chartId:this.chartController.getChartId()})})}raiseChartDestroyedEvent(){this.eventSvc.dispatchEvent({type:"chartDestroyed",chartId:this.chartController.getChartId()})}destroy(){super.destroy(),this.chartProxy&&this.chartProxy.destroy(),this.destroyBean(this.chartMenu),this.chartDialog&&this.chartDialog.isAlive()&&this.destroyBean(this.chartDialog),this.onDestroyColorSchemeChangeListener?.();const e=this.getGui();FL(e),LL(e),this.raiseChartDestroyedEvent()}};import{_errMsg as uN}from"ag-grid-community";var ns=!1;function pN(e){const t=e.version;return e.version==null&&(e.version=AN(e)),e=q("23.0.0",e,gN),e=q("24.0.0",e,mN),e=q("25.1.0",e,fN),e=q("26.0.0",e,CN),e=q("26.1.0",e,vN),e=q("26.2.0",e,yN),e=q("28.0.0",e,SN),e=q("28.2.0",e,bN),e=q("29.0.0",e,wN),e=q("29.1.0",e,Id),e=q("29.2.0",e,Dd),e=q("30.0.0",e,xN),e=q("31.0.0",e,TN),e=q("32.0.0",e,MN),e=q("33.0.0",e,PN),e=FN(e),e=q(R,e,s=>s),ns&&t!==e.version&&console.log("AG Grid: ChartModel migration complete",{model:e}),e}function gN(e){return e=W("chartOptions.legend.item.marker.type","shape",e),e=W("chartOptions.seriesDefaults.marker.type","shape",e),e=W("chartOptions.legend.padding","spacing",e),e}function mN(e){e=O("chartOptions.seriesDefaults.marker.minSize",e);const{chartType:t,chartPalette:s,chartOptions:{xAxis:i,yAxis:r,...a},...o}=e,l=NI(t)?.map((d,h)=>({type:d,...h===0?i:r}));return{chartType:t,chartThemeName:{borneo:"ag-default",material:"ag-material",bright:"ag-vivid"}[s]??"ag-default",chartOptions:{...a,axes:l,xAxis:i,yAxis:r},...o}}function fN(e){return e=W("chartOptions.seriesDefaults.label.minRequiredAngle","minAngle",e),e}function CN(e){return e=Ae("chartOptions.seriesDefaults.highlightStyle",e,({dimOpacity:s,...i})=>({...i,...s!=null?{series:{dimOpacity:s}}:{}})),e=O("chart",e),e=O("chartOptions.seriesDefaults.tooltipClass",e),e=O("chartOptions.seriesDefaults.tooltipTracking",e),e=kd("chartOptions.axes[].label.rotation",0,e),e=kd("chartOptions.axes[].label.rotation",335,e),e}function vN(e){const t=({item:s,series:i,...r})=>({item:{...r,...s},...i?{series:i}:{}});return e=Ae("chartOptions.seriesDefaults.highlightStyle",e,t),e=Ae("chartOptions.series[].highlightStyle",e,t),e}function yN(e){e=di("chartOptions.seriesDefaults.fill.opacity","chartOptions.seriesDefaults.fillOpacity",e),e=di("chartOptions.seriesDefaults.stroke.opacity","chartOptions.seriesDefaults.strokeOpacity",e),e=di("chartOptions.seriesDefaults.stroke.width","chartOptions.seriesDefaults.strokeWidth",e),e=O("chartOptions.seriesDefaults.fill",e),e=O("chartOptions.seriesDefaults.stroke",e),e=O("chartOptions.seriesDefaults.callout.colors",e),e=O("chartOptions.xAxis",e),e=O("chartOptions.yAxis",e);const{chartType:t,chartOptions:{axes:s,series:i,seriesDefaults:r,...a},...o}=e,n=Jt(t),l=B(n),c=[l],d={};if(!Mc(l)){const u={top:{},bottom:{},left:{},right:{}},p=s.map(({type:g,...m})=>({[g]:{...u,...m}})).reduce(Nd,{});Fc.filter(g=>p[g]==null).forEach(g=>{p[g]={...u}}),d.axes=p}const h=c.map(u=>({[u]:{...d,series:r,...a}})).reduce(Nd,{});return e={...o,chartType:n,chartOptions:h},e}function SN(e){return e=O("chartOptions.*.title.padding",e),e=O("chartOptions.*.subtitle.padding",e),e=O("chartOptions.*.axes.*.title.padding",e),e=oa("chartOptions.*.axes.*.title.enabled",!1,e),e}function bN(e){return e=W("chartOptions.pie.series.callout","calloutLine",e),e=W("chartOptions.pie.series.label","calloutLabel",e),e=W("chartOptions.pie.series.labelKey","sectorLabelKey",e),e=W("chartOptions.pie.series.labelName","sectorLabelName",e),e=W("chartOptions.donut.series.callout","calloutLine",e),e=W("chartOptions.donut.series.label","calloutLabel",e),e=W("chartOptions.donut.series.labelKey","sectorLabelKey",e),e=W("chartOptions.donut.series.labelName","sectorLabelName",e),e}function wN(e){return e=ls("chartOptions.scatter.series.fill","chartOptions.scatter.series.marker.fill",e),e=ls("chartOptions.scatter.series.fillOpacity","chartOptions.scatter.series.marker.fillOpacity",e),e=ls("chartOptions.scatter.series.stroke","chartOptions.scatter.series.marker.stroke",e),e=ls("chartOptions.scatter.series.strokeOpacity","chartOptions.scatter.series.marker.strokeOpacity",e),e=ls("chartOptions.scatter.series.strokeWidth","chartOptions.scatter.series.marker.strokeWidth",e),e=di("chartOptions.scatter.series.paired","chartOptions.scatter.paired",e),e}function Id(e){return e=O("chartOptions.axes[].tick.count",e),e}function Dd(e){return e=Ae("chartOptions.*.tooltip",e,({tracking:s,...i})=>{const r={...i};return s===!1?(r.position??(r.position={type:"pointer"}),r.range??(r.range="nearest")):s===!0&&(r.position??(r.position={type:"node"}),r.range??(r.range="nearest")),r}),e}function xN(e){return e=W("chartOptions.pie.series.labelKey","sectorLabelKey",e),e=W("chartOptions.pie.series.labelName","sectorLabelName",e),e=Id(e),e=Dd(e),e=O("chartOptions.*.series.flipXY",e),e=Gd("chartOptions.common.legend.enabled",!0,e),e=oa("chartOptions.common.legend.position","right",e),e}function TN(e){const t={"ag-pastel":"ag-sheets","ag-solar":"ag-polychroma"},s=W("chartOptions.column","bar",e),i=t[s.chartThemeName]||s.chartThemeName;return{...s,chartThemeName:i}}function MN(e){return e=de("chartOptions.*.autoSize",!0,e,(t,s)=>{t[s]===!0||t[s]===!1&&(t.minHeight=600,t.minWidth=300),delete t[s]}),e}function PN(e){return e=O("chartOptions.*.axes.category.label.format",e),e=O("chartOptions.*.axes.category.crosshair.label.format",e),e=O("chartOptions.*.axes.angle-category.label.format",e),e=O("chartOptions.*.axes.radius-category.label.format",e),e=W("chartOptions.*.axes.*.label.padding","spacing",e),e=W("chartOptions.*.navigator.miniChart.label.padding","spacing",e),e=O("chartOptions.*.axes.*.crossLines.label.className",e),e=de("chartOptions.*.axes.*.crossLines.label.position",!0,e,(t,s)=>{typeof t[s]=="string"&&(t[s]=t[s].replace(/([A-Z])/,"-$1").toLowerCase())}),e=O("chartOptions.bullet",e),e=Od("chartOptions.bar.series.label.placement",e,{inside:"inside-center",outside:"inside-end"}),e=Od("chartOptions.waterfall.series.item.*.label.placement",e,{inside:"inside-center",start:"outside-start",end:"outside-end"}),e=O("chartOptions.*.navigator.min",e),e=O("chartOptions.*.navigator.max",e),e=O("chartOptions.*.zoom.ratioX",e),e=O("chartOptions.*.zoom.ratioY",e),e=O("chartOptions.*.zoom.rangeX",e),e=O("chartOptions.*.zoom.rangeY",e),e}function FN(e){return e=O("chartOptions.*.width",e),e=O("chartOptions.*.height",e),e=oa("chartOptions.*.axes.category.label.autoRotate",!0,e),e}function AN(e){const t=e;if(e.version!=null)return e.version;const s=(c,...d)=>Object.keys(c||{}).some(h=>d.includes(h)),i=t.chartOptions,r=s(i,"seriesDefaults")?i?.seriesDefaults:i?.[Object.keys(i)[0]],a={"27.0.0":s(t,"seriesChartTypes"),"26.2.0":!s(i,"seriesDefaults"),"26.1.0":s(r?.highlightStyle,"item"),"26.0.0":s(r?.highlightStyle,"series"),"25.1.0":s(r?.label,"minAngle"),"25.0.0":s(t,"modelType","aggFunc","unlinkChart","suppressChartRanges")||s(r,"lineDash","lineDashOffset"),"24.0.0":s(t,"chartThemeName","chart")||s(i,"series"),"23.2.0":s(i,"navigator"),"23.0.0":s(i?.legend?.item?.marker,"shape"),"22.1.0":s(t,"chartPalette","chartType")},o="27.1.0",n=Object.entries(a).filter(([c,d])=>d);ns&&console.log("AG Grid: ChartModel migration",{heuristicVersionCandidates:n});const[l=o]=n[0];return ns&&console.log("AG Grid: ChartModel migration",{heuristicVersion:l}),l}function q(e,t,s){if(Ld(e)>Ld(t.version)){ns&&console.log("AG Grid: ChartModel migration",{migratingTo:e});const i=s(t);return i.version=e,ns&&console.log("AG Grid: ChartModel migration",{migratedTo:e,result:i}),i}return t}function RN(e){const t=e.includes("-beta")?e.replace(/-beta.*/,""):e,s=typeof t=="string"?t.split(".").map(i=>Number(i)):[];if(s.length!==3||s.some(i=>isNaN(i)))throw new Error(uN(253,{version:t}));return{major:s[0],minor:s[1],patch:s[2]}}function Ld(e){const{major:t,minor:s,patch:i}=RN(e);return t*1e4+s*100+i}function kd(e,t,s){return de(e,!0,s,(i,r)=>{i[r]===t&&delete i[r]})}function oa(e,t,s){return de(e,!1,s,(i,r)=>{i[r]==null&&(i[r]=t)})}function Gd(e,t,s){typeof e=="string"&&(e=e.split("."));const i=e[0];return e.length>1&&(s[i]=Gd(e.slice(1),t,s[i]??{})),Object.keys(s).includes(i)||(s[i]=t),s}function di(e,t,s){let i,r=!1;return s=de(e,!0,s,(a,o)=>{r=!0,i=a[o],delete a[o]}),r?de(t,!1,s,(a,o)=>{a[o]=i}):s}function ls(e,t,s){let i,r=!1;return s=de(e,!0,s,(a,o)=>{r=!0,i=a[o],delete a[o]}),r?de(t,!1,s,(a,o)=>{a[o]===void 0&&(a[o]=i)}):s}function W(e,t,s){return de(e,!0,s,(i,r)=>{i[t]=i[r],delete i[r]})}function O(e,t){return de(e,!0,t,(s,i)=>delete s[i])}function de(e,t,s,i){const r=e instanceof Array?e:e.split("."),a=r.slice(0,r.length-1),o=r[r.length-1];return Ae(a,s,n=>{const l=Object.keys(n).includes(o);if(t&&!l)return n;const c={...n};return i(c,o),c})}function Ae(e,t,s){const i=e instanceof Array?e:e.split(".");if(t={...t},i.length===0)return s(t);if(i[0].startsWith("{")){const r=i[0].substring(1,i[0].lastIndexOf("}")).split(",");for(const a of r)t[a]!=null&&(t[a]=Ae(i.slice(1),t[a],s))}else if(i[0].endsWith("[]")){const r=i[0].substring(0,e[0].indexOf("["));t[r]instanceof Array&&(t[r]=t[r].map(a=>Ae(i.slice(1),a,s)))}else if(i[0]==="*")for(const r of Object.keys(t))t[r]=Ae(i.slice(1),t[r],s);else t[i[0]]!=null&&(t[i[0]]=Ae(i.slice(1),t[i[0]],s));return t}function Od(e,t,s){return de(e,!0,t,(i,r)=>{typeof i[r]=="string"&&(i[r]=s[r]??r)})}var Nd=(e,t)=>({...e,...t}),EN=class extends TL{constructor(){super(...arguments),this.beanName="chartSvc",this.activeCharts=new Set,this.activeChartComps=new Set,this.crossFilteringContext={lastSelectedChartId:""},this.isEnterprise=()=>this.agChartsExports.isEnterprise}wireBeans(e){this.visibleCols=e.visibleCols,this.rangeSvc=e.rangeSvc,this.agChartsExports=e.agChartsExports}updateChart(e){if(this.activeChartComps.size===0){ii(124);return}const t=[...this.activeChartComps].find(s=>s.getChartId()===e.chartId);if(!t){ii(125,{chartId:e.chartId});return}t.update(e)}getChartModels(){const e=[],t=s=>({...s,version:R});return this.activeChartComps.forEach(s=>e.push(t(s.getChartModel()))),e}getChartRef(e){let t;return this.activeCharts.forEach(s=>{s.chartId===e&&(t=s)}),t}getChartComp(e){let t;return this.activeChartComps.forEach(s=>{s.getChartId()===e&&(t=s)}),t}getChartImageDataURL(e){let t;return this.activeChartComps.forEach(s=>{s.getChartId()===e.chartId&&(t=s.getChartImageDataURL(e.fileFormat))}),t}downloadChart(e){Array.from(this.activeChartComps).find(s=>s.getChartId()===e.chartId)?.downloadChart(e.dimensions,e.fileName,e.fileFormat)}openChartToolPanel(e){Array.from(this.activeChartComps).find(s=>s.getChartId()===e.chartId)?.openChartToolPanel(e.panel)}closeChartToolPanel(e){Array.from(this.activeChartComps).find(s=>s.getChartId()===e)?.closeChartToolPanel()}createChartFromCurrentRange(e="groupedColumn",t){const s=this.getSelectedRange();return this.createChart({cellRange:s,chartType:e,focusDialogOnOpen:!t})}restoreChart(e,t){if(!e){ii(126);return}e.version!==R&&(e=pN(e));let s,i,r,a;if(e.modelType==="pivot"?(this.gos.updateGridOptions({options:{pivotMode:!0},source:"pivotChart"}),s=this.createCellRange(void 0,!0),i=!0,r=!0):(s=this.createCellRange(e.cellRange),a=e.chartPalette,r=e.suppressChartRanges),!!s)return this.createChart({...e,cellRange:s,pivotChart:i,suppressChartRanges:r,chartContainer:t,chartOptionsToRestore:e.chartOptions,chartPaletteToRestore:a})}createRangeChart(e,t){const s=this.createCellRange(e.cellRange);if(s)return this.createChart({...e,cellRange:s,focusDialogOnOpen:!t})}createPivotChart(e,t){this.gos.updateGridOptions({options:{pivotMode:!0},source:"pivotChart"});const s=this.createCellRange(void 0,!0);if(s)return this.createChart({...e,cellRange:s,pivotChart:!0,suppressChartRanges:!0,focusDialogOnOpen:!t})}createCrossFilterChart(e,t){const s=this.createCellRange(e.cellRange);if(!s)return;const r=typeof e.suppressChartRanges<"u"&&e.suppressChartRanges!==null?e.suppressChartRanges:!0;return this.createChart({...e,cellRange:s,suppressChartRanges:r,crossFiltering:!0,focusDialogOnOpen:!t})}createChart(e){const t=KL(e,this.agChartsExports.isEnterprise);if(!t)return;e=t===!0?e:t;const{chartType:s,chartContainer:i}=e,r=this.gos.getCallback("createChartContainer"),a={...e,chartId:this.generateId(),chartType:Jt(s),insideDialog:!(i||r),crossFilteringContext:this.crossFilteringContext,crossFilteringResetCallback:()=>this.activeChartComps.forEach(l=>l.crossFilteringReset())},o=new hN(a);this.createBean(o);const n=this.createChartRef(o);return i?i.appendChild(n.chartElement):r?r(n):o.addEventListener("destroyed",()=>{this.activeChartComps.delete(o),this.activeCharts.delete(n)}),n}createChartRef(e){const t={destroyChart:()=>{this.activeCharts.has(t)&&(this.destroyBean(e),this.activeChartComps.delete(e),this.activeCharts.delete(t))},focusChart:()=>{ML(e.getGui())},chartElement:e.getGui(),chart:e.getUnderlyingChart(),chartId:e.getChartModel().chartId};return this.activeCharts.add(t),this.activeChartComps.add(e),t}getSelectedRange(){const e=this.rangeSvc?.getCellRanges()??[];return e.length>0?e[0]:{columns:[]}}generateId(){return`id-${Math.random().toString(36).substring(2,18)}`}createCellRange(e,t){const s=t?{rowStartIndex:null,rowStartPinned:void 0,rowEndIndex:null,rowEndPinned:void 0,columns:this.visibleCols.allCols.map(r=>r.getColId())}:e,i=s&&this.rangeSvc?.createPartialCellRangeFromRangeParams(s,!0);return i||ii(127,{allRange:t}),i}destroy(){this.activeCharts.forEach(e=>e.destroyChart()),super.destroy()}};function IN(e){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.getChartModels())}function DN(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.getChartRef(t))}function LN(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.getChartImageDataURL(t))}function kN(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.downloadChart(t))}function GN(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.openChartToolPanel(t))}function ON(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.closeChartToolPanel(t.chartId))}function NN(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.createRangeChart(t,!0))}function BN(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.createPivotChart(t,!0))}function _N(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.createCrossFilterChart(t,!0))}function VN(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.updateChart(t))}function HN(e,t,s){return e.frameworkOverrides.wrapIncoming(()=>e.chartSvc?.restoreChart(t,s))}var zN=`.ag-chart{display:flex;height:100%;position:relative;width:100%}.ag-chart-components-wrapper{display:flex}.ag-chart-canvas-wrapper,.ag-chart-components-wrapper{flex:1 1 auto;position:relative}.ag-chart-menu{background:var(--ag-background-color);background-color:color-mix(in srgb,transparent,var(--ag-background-color) 30%);border-radius:var(--ag-border-radius);display:flex;flex-direction:row;gap:20px;padding:4px 2px;position:absolute;top:8px;width:auto;--ag-icon-size:20px}:where(.ag-ltr) .ag-chart-menu{justify-content:right;right:calc(var(--ag-cell-horizontal-padding) + var(--ag-spacing) - 4px)}:where(.ag-rtl) .ag-chart-menu{justify-content:left;left:calc(var(--ag-cell-horizontal-padding) + var(--ag-spacing) - 4px)}.ag-chart-docked-container{min-width:var(--ag-chart-menu-panel-width);position:relative}:where(.ag-chart-menu-hidden)~.ag-chart-docked-container{display:none}.ag-chart-tabbed-menu{display:flex;flex-direction:column;height:100%;overflow:hidden;width:100%}.ag-chart-tabbed-menu-header{cursor:default;flex:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-chart-tabbed-menu-body{align-items:stretch;display:flex;flex:1 1 auto;overflow:hidden;position:relative;&:after{background:linear-gradient(var(--ag-background-color),transparent);content:"";display:block;height:16px;left:0;position:absolute;right:0;top:0}}.ag-chart-tab{overflow:hidden;overflow-y:auto;width:100%}.ag-chart-settings{overflow-x:hidden}.ag-chart-settings-wrapper{display:flex;flex-direction:column;height:100%;overflow:hidden;position:relative;width:100%}.ag-chart-settings-nav-bar{align-items:center;border-top:1px solid var(--ag-border-color);display:flex;height:30px;padding:0 10px;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.ag-chart-settings-card-selector{align-items:center;display:flex;flex:1 1 auto;height:100%;justify-content:space-around;padding:0 10px}.ag-chart-settings-card-item{background-color:var(--ag-foreground-color);border-radius:4px;cursor:pointer;height:8px;position:relative;width:8px;&.ag-not-selected{opacity:.2}&:before{background-color:transparent;content:" ";display:block;height:20px;left:50%;margin-left:-10px;margin-top:-10px;position:absolute;top:50%;width:20px}&.ag-selected{background-color:var(--ag-accent-color)}}.ag-chart-settings-next,.ag-chart-settings-prev{flex:none;position:relative;&:focus-within{border-radius:1px;box-shadow:var(--ag-focus-shadow)}}.ag-chart-settings-next-button,.ag-chart-settings-prev-button{cursor:pointer;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%}.ag-chart-settings-mini-charts-container{flex:1 1 auto;overflow:hidden auto;position:relative}.ag-chart-settings-mini-wrapper{display:flex;flex-direction:column;left:0;min-height:100%;overflow:hidden;padding-bottom:var(--ag-widget-container-vertical-padding);position:absolute;top:0;width:100%;&.ag-animating{transition:left .3s;transition-timing-function:ease-in-out}}.ag-chart-mini-thumbnail{border:1px solid var(--ag-border-color);border-radius:5px;cursor:pointer;padding:1px;&.ag-selected{border-color:var(--ag-accent-color);border-width:2px;padding:unset}&:focus-visible{border-color:var(--ag-accent-color);box-shadow:var(--ag-focus-shadow)}}.ag-chart-mini-thumbnail-canvas{display:block}.ag-chart-advanced-settings-wrapper,.ag-chart-data-wrapper,.ag-chart-format-wrapper{display:flex;flex-direction:column;padding-bottom:16px;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-chart-advanced-settings-wrapper,.ag-chart-data-wrapper{height:100%;overflow-y:auto}.ag-chart-advanced-settings{background-color:var(--ag-chrome-background-color)}.ag-chart-advanced-settings,.ag-chart-advanced-settings-wrapper{width:100%}.ag-chart-advanced-settings-wrapper{padding-bottom:0}.ag-chart-advanced-settings-section{border-bottom:1px solid var(--ag-border-color);display:flex;margin:0;padding-bottom:var(--ag-widget-container-vertical-padding);padding-top:var(--ag-widget-container-vertical-padding)}.ag-chart-empty-text{align-items:center;background-color:var(--ag-background-color);display:flex;height:100%;justify-content:center;top:0;width:100%}.ag-charts-font-size-color{align-self:stretch;display:flex;justify-content:space-between}.ag-charts-data-group-item{padding-bottom:var(--ag-widget-container-vertical-padding);position:relative}.ag-charts-data-group-item:where(:not(:last-child)){margin-bottom:var(--ag-spacing)}.ag-chart-menu-icon{border-radius:var(--ag-border-radius);cursor:pointer;margin:2px 0;opacity:.8;&:hover{opacity:1}}.ag-chart-menu-toolbar-button{background-color:unset;border:0;border-radius:1px;padding:0 2px}.ag-chart-data-column-drag-handle{margin-left:var(--ag-spacing)}.ag-charts-advanced-settings-top-level-group-title-bar{background-color:unset;position:relative}.ag-charts-data-group-container{padding:calc(var(--ag-widget-container-vertical-padding)*.5) var(--ag-widget-container-horizontal-padding)}.ag-charts-data-group-item:where(:not(.ag-charts-format-sub-level-group,.ag-pill-select,.ag-select)){height:var(--ag-list-item-height)}.ag-charts-data-group-item:where(.ag-picker-field){margin-top:var(--ag-spacing)}.ag-charts-advanced-settings-top-level-group-container,.ag-charts-format-top-level-group-container{margin-left:calc(var(--ag-spacing)*2);padding:var(--ag-spacing)}.ag-charts-advanced-settings-top-level-group-item,.ag-charts-format-top-level-group-item{margin:var(--ag-spacing) 0}.ag-charts-format-sub-level-group-container{display:flex;flex-direction:column;padding:var(--ag-widget-vertical-spacing) 0}.ag-charts-settings-group-container{display:grid;grid-template-columns:60px 1fr 60px 1fr 60px;padding:var(--ag-spacing);row-gap:8px;:where(.ag-chart-mini-thumbnail:nth-child(3n+1)){grid-column:1}:where(.ag-chart-mini-thumbnail:nth-child(3n+2)){grid-column:3}:where(.ag-chart-mini-thumbnail:nth-child(3n+3)){grid-column:5}}.ag-chart-data-section,.ag-chart-format-section{display:flex;margin:0;:where(.ag-label:not(.ag-group-title-bar)){color:var(--ag-chart-menu-label-color)}:where(.ag-label-align-top .ag-label){margin-bottom:var(--ag-widget-vertical-spacing);margin-top:calc(var(--ag-widget-vertical-spacing)*.5)}:where(.ag-slider.ag-label-align-top .ag-label){margin-bottom:0}:where(label){display:inline-block}}.ag-chart-menu-panel{--ag-panel-background-color:var(--ag-chrome-background-color)}:where(.ag-ltr) .ag-chart-menu-panel{border-left:1px solid var(--ag-border-color)}:where(.ag-rtl) .ag-chart-menu-panel{border-right:1px solid var(--ag-border-color)}.ag-charts-data-group-title-bar,.ag-charts-format-top-level-group-title-bar,.ag-charts-settings-group-container,.ag-charts-settings-group-title-bar{border-top:none;font-weight:500;padding:0 calc(var(--ag-spacing)*1.5)}.ag-charts-format-sub-level-group-title-bar{background:none;font-weight:500;padding:var(--ag-widget-vertical-spacing) 0}.ag-chart-data-wrapper,.ag-chart-format-wrapper,.ag-charts-data-group-container,.ag-charts-data-group-title-bar,.ag-charts-format-sub-level-group,.ag-charts-format-sub-level-group-container>*,.ag-charts-format-sub-level-group-item:last-child,.ag-charts-format-top-level-group,.ag-charts-format-top-level-group-item,.ag-charts-format-top-level-group-title-bar,.ag-charts-settings-group-container,.ag-charts-settings-group-title-bar,:where(.ag-charts-format-top-level-group) .ag-charts-format-top-level-group-container{margin:0;padding:0}.ag-charts-data-group-title-bar,.ag-charts-format-top-level-group-title-bar,.ag-charts-settings-group-title-bar{padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:relative}.ag-charts-data-group,.ag-charts-format-top-level-group{border-top:1px solid var(--ag-border-color)}:where(.ag-charts-data-group) .ag-charts-data-group-container,:where(.ag-charts-format-top-level-group) .ag-charts-format-top-level-group-container,:where(.ag-charts-settings-group) .ag-charts-settings-group-container{padding:0 var(--ag-widget-container-horizontal-padding)}.ag-charts-format-sub-level-group-container>*,.ag-charts-format-sub-level-no-header-group-container>*,.ag-charts-format-top-level-group-container>*{margin-bottom:var(--ag-widget-vertical-spacing)}.ag-charts-advanced-settings-top-level-group-container{margin:0}:where(.ag-charts-advanced-settings-top-level-group){.ag-charts-advanced-settings-top-level-group-container,.ag-charts-advanced-settings-top-level-group-title-bar{padding:0 var(--ag-widget-container-horizontal-padding)}}.ag-charts-advanced-settings-top-level-group-item{margin-bottom:0;margin-top:calc(var(--ag-widget-vertical-spacing)*2)}.ag-chart-settings-card-item.ag-not-selected:hover{opacity:.35}.ag-angle-select{align-items:center;display:flex}.ag-angle-select-wrapper{display:flex}.ag-angle-select-parent-circle{background-color:var(--ag-background-color);border:1px solid;border-color:var(--ag-border-color);border-radius:12px;display:block;height:24px;position:relative;width:24px}.ag-angle-select-child-circle{background-color:var(--ag-foreground-color);border-radius:3px;height:6px;left:12px;margin-left:-3px;margin-top:-4px;position:absolute;top:4px;width:6px}.ag-slider-wrapper{display:flex;:where(.ag-input-field){flex:1 1 auto}}.ag-color-panel{display:flex;flex-direction:column;padding:var(--ag-spacing);text-align:center;width:100%}.ag-spectrum-color{cursor:default;flex:1 1 auto;overflow:visible;position:relative}.ag-spectrum-fill{inset:0;position:absolute}.ag-spectrum-val{background-image:linear-gradient(0deg,#000,hsla(20,42%,65%,0));cursor:pointer}.ag-spectrum-dragger{background:#000;border:3px solid #fff;border-radius:18px;box-shadow:0 0 2px 0 rgba(0,0,0,.24);cursor:pointer;height:18px;pointer-events:none;position:absolute;width:18px}.ag-spectrum-alpha,.ag-spectrum-hue{cursor:default}.ag-spectrum-hue-background{background:linear-gradient(270deg,red 3%,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);height:100%;width:100%}.ag-spectrum-alpha-background{background:linear-gradient(to right,var(--ag-internal-spectrum-alpha-color-from),var(--ag-internal-spectrum-alpha-color-to)),url('data:image/svg+xml;utf8,') 0 0 /4px 4px;height:100%;width:100%}.ag-spectrum-tool{border-radius:2px;cursor:pointer;height:11px;margin-bottom:10px;position:relative}.ag-spectrum-slider{border:2px solid #fff;border-radius:13px;box-shadow:0 1px 4px 0 rgba(0,0,0,.37);height:13px;margin-top:-12px;pointer-events:none;position:absolute;width:13px}:where(.ag-spectrum-alpha) .ag-spectrum-slider{background:linear-gradient(to bottom,var(--ag-internal-spectrum-alpha-color),var(--ag-internal-spectrum-alpha-color)) var(--ag-background-color)}.ag-recent-colors{display:flex;gap:6px;margin-bottom:2px;margin-left:var(--ag-spacing);margin-right:var(--ag-spacing)}.ag-recent-color{border:1px solid var(--ag-border-color);cursor:pointer}.ag-angle-select[disabled]{opacity:.5;pointer-events:none}:where(.ag-ltr) .ag-angle-select-field,:where(.ag-ltr) .ag-slider-field{margin-right:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-angle-select-field,:where(.ag-rtl) .ag-slider-field{margin-left:calc(var(--ag-spacing)*2)}.ag-color-dialog{border-radius:5px}:where(.ag-color-picker){.ag-picker-field-wrapper{padding-left:var(--ag-spacing);padding-right:var(--ag-spacing)}.ag-picker-field-display{align-items:center;display:flex;flex-direction:row;min-height:var(--ag-list-item-height)}}:where(.ag-ltr) .ag-color-picker-color,:where(.ag-ltr) .ag-color-picker-value{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-color-picker-color,:where(.ag-rtl) .ag-color-picker-value{margin-left:var(--ag-spacing)}.ag-spectrum-tools{padding-bottom:0;padding-left:0;padding-right:0}.ag-spectrum-alpha-background,.ag-spectrum-hue-background{border-radius:2px}.ag-color-input-color,.ag-color-picker-color,.ag-recent-color{border-radius:4px}.ag-spectrum-sat{background-image:linear-gradient(90deg,#fff,hsla(20,42%,65%,0))}.ag-recent-color,.ag-spectrum-color,.ag-spectrum-slider{&:where(:not(:disabled,[readonly])):focus-visible{box-shadow:var(--ag-focus-shadow)}}.ag-color-input-color,.ag-color-picker-color{border:1px solid var(--ag-border-color);border-radius:2px;height:var(--ag-icon-size);width:var(--ag-icon-size)}:where(.ag-color-input){.ag-color-input-color{position:absolute}}:where(.ag-ltr) :where(.ag-color-input){.ag-input-field-input{padding-left:calc(var(--ag-icon-size) + var(--ag-spacing)*2)}.ag-color-input-color{margin-left:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-color-input){.ag-input-field-input{padding-right:calc(var(--ag-icon-size) + var(--ag-spacing)*2)}.ag-color-input-color{margin-right:var(--ag-spacing)}}.ag-range-field{align-items:center;display:flex;:where(.ag-input-wrapper){height:100%}}.ag-range-field-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;height:100%;overflow:visible;padding:0;width:100%;&:disabled{opacity:.5}}.ag-range-field-input{&::-webkit-slider-runnable-track{background-color:var(--ag-border-color);border-radius:1.5px;height:3px;margin:0;padding:0;width:100%}&::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background-color:var(--ag-background-color);border:1px solid var(--ag-border-color);border-radius:100%;height:var(--ag-icon-size);margin:0;padding:0;transform:translateY(calc(var(--ag-icon-size)*-.5 + 1.5px));width:var(--ag-icon-size)}&:focus::-webkit-slider-thumb{border-color:var(--ag-accent-color);box-shadow:var(--ag-focus-shadow)}&:active::-webkit-slider-runnable-track{background-color:var(--ag-accent-color)}}.ag-range-field-input{&::-moz-range-track{background-color:var(--ag-border-color);border-radius:1.5px;height:3px;margin:0;padding:0;width:100%}&::-moz-ag-range-thumb{-moz-appearance:none;appearance:none;background-color:var(--ag-background-color);border:1px solid var(--ag-border-color);border-radius:100%;height:var(--ag-icon-size);margin:0;padding:0;transform:translateY(calc(var(--ag-icon-size)*-.5 + 1.5px));width:var(--ag-icon-size)}&:focus::-moz-ag-range-thumb{border-color:var(--ag-accent-color);box-shadow:var(--ag-focus-shadow)}&:active::-moz-ag-range-track{background-color:var(--ag-accent-color)}}`,Bd=28,_d=6;function na(e){return e&&e.match(/\d+\.\d+\.\d+/)}function UN({gridMajorVersion:e,chartsMajorVersion:t}){const s=parseInt(e,10),i=parseInt(t,10),r=s-Bd,a=i-_d,o=r>=0;return r===a&&o}function KN(e){if(!e||!na(e))return;const[t,s]=e.split(".")||[],i=`${t}.${s}.x`,a=parseInt(t,10)-Bd+_d;if(a<0)return;const n=`${a}.${s}.x`;return{gridMajorMinor:i,chartsMajorMinor:n}}function hi({type:e,gridVersion:t,chartsVersion:s}){const i="AG Grid: AG Grid version is incompatible. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.";if(!t)return i;const r=KN(t);if(!r)return i;const{gridMajorMinor:a,chartsMajorMinor:o}=r;return e==="incompatible"?`AG Grid version ${t} and AG Charts version ${s} is not supported. AG Grid version ${a} should be used with AG Chart ${o}. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.`:e==="invalidCharts"?`AG Grid version ${a} should be used with AG Chart ${o} not ${s}. Please see https://www.ag-grid.com/javascript-data-grid/modules/ for more information.`:i}function WN({gridVersion:e,chartsVersion:t}){if(!na(t))return{isValid:!1,message:hi({type:"invalidCharts",gridVersion:e,chartsVersion:t})};if(!na(e))return{isValid:!1,message:hi({type:"invalidGrid",gridVersion:e,chartsVersion:t})};const[s,i]=e.split(".")||[],[r,a,o]=t.split(".")||[],n=UN({gridMajorVersion:s,chartsMajorVersion:r});return n&&i===a||o.includes("beta")?{isValid:!0}:!n||i!==a?{isValid:!1,message:hi({type:"incompatible",gridVersion:e,chartsVersion:t})}:{isValid:!1,message:hi({type:"invalid",gridVersion:e,chartsVersion:t})}}var jN={linked:"linked",unlinked:"unlinked",chartsMenu:"menu-alt",chartsDownload:"save",chartsMenuEdit:"chart",chartsMenuAdvancedSettings:"settings",chartsMenuAdd:"plus",chartsColorPicker:"small-down",chartsThemePrevious:"previous",chartsThemeNext:"next"},$N={getChartModels:IN,getChartRef:DN,getChartImageDataURL:LN,downloadChart:kN,openChartToolPanel:GN,closeChartToolPanel:ON,createRangeChart:NN,createPivotChart:BN,createCrossFilterChart:_N,updateChart:VN,restoreChart:HN},la=[Ys,G,bI,SI,As],Vd="IntegratedCharts",YN={moduleName:"GridCharts",version:R,dependsOn:la,validate:()=>({isValid:!1,message:`AG Grid: As of v33, the "GridChartsModule" has been deprecated. Please use "IntegratedChartsModule.with(...)" instead. ${Sc(257)}`})},Hd={moduleName:Vd,version:R,dependsOn:la,validate:()=>({isValid:!1,message:Sc(257)}),with:e=>{if(e.setup(),e.setGridContext?.(!0),e.isEnterprise&&e.setLicenseKey){const t={setLicenseKey:e.setLicenseKey};bt.setChartsLicenseManager(t)}return{moduleName:Vd,version:R,icons:jN,apiFunctions:$N,dependsOn:la,css:[zN],validate:()=>WN({gridVersion:R,chartsVersion:e.VERSION}),beans:[xI.bind(null,e),EN,xL,CL,uL,SL,SD,iL]}}};import{AllCommunityModule as XN}from"ag-grid-community";var zd=[XN,gl,sn,On,Ml,Rl,ir,rr,Ys,bn,Cl,Fr,nl,ll,mc,fc,En,zn,Co,Ps,kn,dl,Xl,rc],Ud="AllEnterprise",qN={with:e=>({moduleName:Ud,version:R,dependsOn:[...zd,Hd.with(e),yc.with(e)]}),moduleName:Ud,version:R,dependsOn:zd};export*from"ag-grid-community";export{Co as AdvancedFilterModule,yr as AggregationModule,qN as AllEnterpriseModule,Ys as CellSelectionModule,gl as ClipboardModule,ir as ColumnMenuModule,sn as ColumnsToolPanelModule,rr as ContextMenuModule,On as ExcelExportModule,Ml as FiltersToolPanelModule,YN as GridChartsModule,ll as GroupFilterModule,Hd as IntegratedChartsModule,ua as LicenseManager,Rl as MasterDetailModule,Tw as MenuModule,zn as MultiFilterModule,Xl as PivotModule,HR as RangeSelectionModule,bn as RichSelectModule,Fr as RowGroupingModule,nl as RowGroupingPanelModule,Cl as RowNumbersModule,fc as ServerSideRowModelApiModule,mc as ServerSideRowModelModule,En as SetFilterModule,Ps as SideBarModule,yc as SparklinesModule,kn as StatusBarModule,rc as TreeDataModule,dl as ViewportRowModelModule,Va as exportMultipleSheetsAsExcel,bi as getMultipleSheetsAsExcel};