[o[e++],o[e]];let i=0;const t=[];let r;do{const[o,s]=a(u);r=s;let l=1;if(o.partName==="literal")l=o.partValue.length;else if(o.partName==="timeZoneName")l=Yl(n.substring(i));else if(o.token in gt)l=gt[o.token];else if(s)if(s.partName==="literal"){if(l=n.indexOf(s.partValue,i)-i,l<0)throw new Error}else if(s.partName==="dayPeriod"){for(let E=1;E<=4;E++)if(isNaN(Number(n.charAt(i+E)))){l=E;break}}else{const E=n.substring(i).search(/\d/);E!==-1&&(l=i+E)}else l=n.length;t.push({...o,value:n.substring(i,i+l)}),i+=l}while(r);return t}function $0(n,u=!1){let e;switch(n){case p.dateTime:case p.dateTimeIso:e="YYYY-MM-DD HH:mm:ss";break;case p.dateTimeIsoAmPm:e="YYYY-MM-DD hh:mm:ss a";break;case p.dateTimeIsoAM_PM:e="YYYY-MM-DD hh:mm:ss A";break;case p.dateTimeShortIso:e="YYYY-MM-DD HH:mm";break;case p.dateEuro:e="DD/MM/YYYY";break;case p.dateEuroShort:e=u?"DD/MM/YY":"D/M/YY";break;case p.dateTimeEuro:e="DD/MM/YYYY HH:mm:ss";break;case p.dateTimeShortEuro:e=u?"DD/MM/YYYY HH:mm":"D/M/YYYY H:m";break;case p.dateTimeEuroAmPm:e="DD/MM/YYYY hh:mm:ss a";break;case p.dateTimeEuroAM_PM:e="DD/MM/YYYY hh:mm:ss A";break;case p.dateTimeEuroShort:e=u?"DD/MM/YY HH:mm:ss":"D/M/YY H:m:s";break;case p.dateTimeEuroShortAmPm:e=u?"DD/MM/YY hh:mm:ss a":"D/M/YY h:m:s a";break;case p.dateTimeEuroShortAM_PM:e=u?"DD/MM/YY hh:mm:ss A":"D/M/YY h:m:s A";break;case p.dateUs:e="MM/DD/YYYY";break;case p.dateUsShort:e=u?"MM/DD/YY":"M/D/YY";break;case p.dateTimeUs:e="MM/DD/YYYY HH:mm:ss";break;case p.dateTimeUsAmPm:e="MM/DD/YYYY hh:mm:ss a";break;case p.dateTimeUsAM_PM:e="MM/DD/YYYY hh:mm:ss A";break;case p.dateTimeUsShort:e=u?"MM/DD/YY HH:mm:ss":"M/D/YY H:m:s";break;case p.dateTimeUsShortAmPm:e=u?"MM/DD/YY hh:mm:ss a":"M/D/YY h:m:s a";break;case p.dateTimeUsShortAM_PM:e=u?"MM/DD/YY hh:mm:ss A":"M/D/YY h:m:s A";break;case p.dateTimeShortUs:e=u?"MM/DD/YYYY HH:mm":"M/D/YYYY H:m";break;case p.dateUtc:e="ISO8601";break;case p.date:case p.dateIso:default:e="YYYY-MM-DD";break}return e}function le(n,u,e){const a=u?$0(u):void 0,i=$0(e),t=n instanceof Date?n:Be(n,a);return t&&n!==void 0?e===p.dateUtc?t.toISOString():l0(t,i,"en-US"):""}function Be(n,u,e=!1){try{return n?n instanceof Date?n:pt({date:n,format:u,dateOverflow:e?"throw":"backward",locale:"en-US"}):!1}catch{return!1}}function sD(n){return i1(n,Ct(n,"utc"))}function lD(n){let u="";if(typeof n=="string"&&/^[0-9\-/]*$/.test(n)){const e=decodeURIComponent(n),a=eD(e,"utc");a&&(u=a.toISOString().replace(/(.*)([.\d]{4})(Z)/gi,"$1$3"))}return u}function us(n,u,e,a,i){let t=0;if(n===u)t=0;else{let r=Be(n,a,i),o=Be(u,a,i);r||(r=new Date(1001,1,1)),o||(o=new Date(1001,1,1)),t=r.valueOf()-o.valueOf()}return e*t}function Ru(n){const u=n===p.date?void 0:$0(n);return(e,a,i)=>u===void 0?us(e,a,i,u,!1):us(e,a,i,u,!0)}const S0={boolean:P5,date:Ru(p.date),dateIso:Ru(p.dateIso),dateUtc:Ru(p.dateUtc),dateTime:Ru(p.dateTime),dateTimeIso:Ru(p.dateTimeIso),dateTimeIsoAmPm:Ru(p.dateTimeIsoAmPm),dateTimeIsoAM_PM:Ru(p.dateTimeIsoAM_PM),dateTimeShortIso:Ru(p.dateTimeShortIso),dateEuro:Ru(p.dateEuro),dateEuroShort:Ru(p.dateEuroShort),dateTimeShortEuro:Ru(p.dateTimeShortEuro),dateTimeEuro:Ru(p.dateTimeEuro),dateTimeEuroAmPm:Ru(p.dateTimeEuroAmPm),dateTimeEuroAM_PM:Ru(p.dateTimeEuroAM_PM),dateTimeEuroShort:Ru(p.dateTimeEuroShort),dateTimeEuroShortAmPm:Ru(p.dateTimeEuroShortAmPm),dateTimeEuroShortAM_PM:Ru(p.dateTimeEuroShortAM_PM),dateUs:Ru(p.dateUs),dateUsShort:Ru(p.dateUsShort),dateTimeShortUs:Ru(p.dateTimeShortUs),dateTimeUs:Ru(p.dateTimeUs),dateTimeUsAmPm:Ru(p.dateTimeUsAmPm),dateTimeUsAM_PM:Ru(p.dateTimeUsAM_PM),dateTimeUsShort:Ru(p.dateTimeUsShort),dateTimeUsShortAmPm:Ru(p.dateTimeUsShortAmPm),dateTimeUsShortAM_PM:Ru(p.dateTimeUsShortAM_PM),numeric:ql,objectString:j5,string:I5};function Ma(n,u,e,a,i,t){let r=0;switch(n){case p.boolean:r=S0.boolean(u,e,a,i,t);break;case p.float:case p.integer:case p.number:r=S0.numeric(u,e,a,i,t);break;case p.date:case p.dateIso:case p.dateUtc:case p.dateTime:case p.dateTimeIso:case p.dateTimeIsoAmPm:case p.dateTimeIsoAM_PM:case p.dateTimeShortIso:case p.dateEuro:case p.dateEuroShort:case p.dateTimeShortEuro:case p.dateTimeEuro:case p.dateTimeEuroAmPm:case p.dateTimeEuroAM_PM:case p.dateTimeEuroShort:case p.dateTimeEuroShortAmPm:case p.dateTimeEuroShortAM_PM:case p.dateUs:case p.dateUsShort:case p.dateTimeShortUs:case p.dateTimeUs:case p.dateTimeUsAmPm:case p.dateTimeUsAM_PM:case p.dateTimeUsShort:case p.dateTimeUsShortAmPm:case p.dateTimeUsShortAM_PM:r=Ru(n).call(this,u,e,a,i,t);break;case p.object:r=S0.objectString(u,e,a,i,t);break;case p.string:case p.text:case p.password:case p.readonly:default:r=S0.string(u,e,a,i,t);break}return r}const ED=Object.freeze(Object.defineProperty({__proto__:null,sortByFieldType:Ma},Symbol.toStringTag,{value:"Module"}));var I0;(function(n){n.camelCase="camelCase",n.kebabCase="kebabCase",n.lowerCase="lowerCase",n.lowerCaseWithoutOnPrefix="lowerCaseWithoutOnPrefix"})(I0||(I0={}));class n1{get elementSource(){return this._elementSource}set elementSource(u){this._elementSource=u}get subscribedEvents(){return this._subscribedEvents}get subscribedEventNames(){return this._subscribedEvents.map(u=>u.name)}constructor(u){this._subscribedEvents=[],this.eventNamingStyle=I0.camelCase,this._elementSource=u||document.createElement("div")}dispose(){var u;this.unsubscribeAll(),this._subscribedEvents=[],clearTimeout(this._timer),(u=this._elementSource)==null||u.remove(),this._elementSource=null}dispatchCustomEvent(u,e,a=!0,i=!0,t){var s;const r={bubbles:a,cancelable:i};e&&(r.detail=e);const o=new CustomEvent(u,r);return typeof t=="function"&&t(o),(s=this._elementSource)==null?void 0:s.dispatchEvent(o)}getEventNameByNamingConvention(u,e){let a="";switch(this.eventNamingStyle){case I0.camelCase:a=e!==""?`${e}${N0(u)}`:u;break;case I0.kebabCase:a=e!==""?`${e}-${gi(u)}`:gi(u);break;case I0.lowerCase:a=`${e}${u}`.toLowerCase();break;case I0.lowerCaseWithoutOnPrefix:a=`${e}${u.replace(/^on/,"")}`.toLowerCase();break}return a}publish(u,e,a,i){const t=this.getEventNameByNamingConvention(u,"");return a?new Promise(r=>{clearTimeout(this._timer),this._timer=setTimeout(()=>r(this.dispatchCustomEvent(t,e,!0,!0,i)),a)}):this.dispatchCustomEvent(t,e,!0,!0,i)}subscribe(u,e){const a=this.getEventNameByNamingConvention(u,"");return this._elementSource.addEventListener(a,i=>e.call(null,i.detail)),this._subscribedEvents.push({name:a,listener:e}),{unsubscribe:()=>this.unsubscribe(a,e)}}subscribeEvent(u,e){const a=this.getEventNameByNamingConvention(u,"");return this._elementSource.addEventListener(a,e),this._subscribedEvents.push({name:a,listener:e}),{unsubscribe:()=>this.unsubscribe(a,e)}}unsubscribe(u,e,a=!0){const i=this.getEventNameByNamingConvention(u,"");this._elementSource.removeEventListener(i,e),a&&this.removeSubscribedEventWhenFound(u,e)}unsubscribeAll(u){if(Array.isArray(u)){let e;do e=u.pop(),e!=null&&e.dispose?e.dispose():e!=null&&e.unsubscribe&&e.unsubscribe();while(e)}else{let e=this._subscribedEvents.pop();for(;e;)this.unsubscribe(e.name,e.listener,!1),e=this._subscribedEvents.pop()}}removeSubscribedEventWhenFound(u,e){const a=this._subscribedEvents.findIndex(i=>i.name===u&&i.listener===e);a>=0&&this._subscribedEvents.splice(a,1)}}function Ft(n){var u=document,e=n.container||u.createElement("div"),a=n.preventSubmit||0;e.id=e.id||"autocomplete-"+F();var i=e.style,t=n.debounceWaitMs||0,r=n.disableAutoSelect||!1,o=e.parentElement,s=[],l="",E=2,d=n.showOnFocus,c,D=0,m,h=!1,x=!1;if(n.minLength!==void 0&&(E=n.minLength),!n.input)throw new Error("input undefined");var g=n.input;e.className="autocomplete "+(n.className||""),e.setAttribute("role","listbox"),g.setAttribute("role","combobox"),g.setAttribute("aria-expanded","false"),g.setAttribute("aria-autocomplete","list"),g.setAttribute("aria-controls",e.id),g.setAttribute("aria-owns",e.id),g.setAttribute("aria-activedescendant",""),g.setAttribute("aria-haspopup","listbox"),i.position="absolute";function F(){return Date.now().toString(36)+Math.random().toString(36).substring(2)}function C(){var V=e.parentNode;V&&V.removeChild(e)}function A(){m&&window.clearTimeout(m)}function b(){e.parentNode||(o||u.body).appendChild(e)}function y(){return!!e.parentNode}function S(){D++,s=[],l="",c=void 0,g.setAttribute("aria-activedescendant",""),g.setAttribute("aria-expanded","false"),C()}function z(){if(!y())return;g.setAttribute("aria-expanded","true"),i.height="auto",i.width=g.offsetWidth+"px";var V=0,Cu;function Nu(){var n0=u.documentElement,x0=n0.clientTop||u.body.clientTop||0,r0=n0.clientLeft||u.body.clientLeft||0,X0=window.pageYOffset||n0.scrollTop,M0=window.pageXOffset||n0.scrollLeft;Cu=g.getBoundingClientRect();var g0=Cu.top+g.offsetHeight+X0-x0,Pe=Cu.left+M0-r0;i.top=g0+"px",i.left=Pe+"px",V=window.innerHeight-(Cu.top+g.offsetHeight),V<0&&(V=0),i.top=g0+"px",i.bottom="",i.left=Pe+"px",i.maxHeight=V+"px"}Nu(),Nu(),n.customize&&Cu&&n.customize(g,Cu,e,V)}function M(){e.textContent="",g.setAttribute("aria-activedescendant","");var V=function(r0,X0,M0){var g0=u.createElement("div");return g0.textContent=r0.label||"",g0};n.render&&(V=n.render);var Cu=function(r0,X0){var M0=u.createElement("div");return M0.textContent=r0,M0};n.renderGroup&&(Cu=n.renderGroup);var Nu=u.createDocumentFragment(),n0=F();if(s.forEach(function(r0,X0){if(r0.group&&r0.group!==n0){n0=r0.group;var M0=Cu(r0.group,l);M0&&(M0.className+=" group",Nu.appendChild(M0))}var g0=V(r0,l,X0);g0&&(g0.id=e.id+"_"+X0,g0.setAttribute("role","option"),g0.addEventListener("click",function(Pe){x=!0;try{n.onSelect(r0,g)}finally{x=!1}S(),Pe.preventDefault(),Pe.stopPropagation()}),r0===c&&(g0.className+=" selected",g0.setAttribute("aria-selected","true"),g.setAttribute("aria-activedescendant",g0.id)),Nu.appendChild(g0))}),e.appendChild(Nu),s.length<1)if(n.emptyMsg){var x0=u.createElement("div");x0.id=e.id+"_"+F(),x0.className="empty",x0.textContent=n.emptyMsg,e.appendChild(x0),g.setAttribute("aria-activedescendant",x0.id)}else{S();return}b(),z(),Y()}function w(){y()&&M()}function R(){w()}function G(V){V.target!==e?w():V.preventDefault()}function L(){x||iu(0)}function Y(){var V=e.getElementsByClassName("selected");if(V.length>0){var Cu=V[0],Nu=Cu.previousElementSibling;if(Nu&&Nu.className.indexOf("group")!==-1&&!Nu.previousElementSibling&&(Cu=Nu),Cu.offsetTopx0&&(e.scrollTop+=n0-x0)}}}function lu(){var V=s.indexOf(c);c=V===-1?void 0:s[(V+s.length-1)%s.length],Eu(V)}function hu(){var V=s.indexOf(c);c=s.length<1?void 0:V===-1?s[0]:s[(V+1)%s.length],Eu(V)}function Eu(V){s.length>0&&(Vu(V),du(s.indexOf(c)),Y())}function du(V){var Cu=u.getElementById(e.id+"_"+V);Cu&&(Cu.classList.add("selected"),Cu.setAttribute("aria-selected","true"),g.setAttribute("aria-activedescendant",Cu.id))}function Vu(V){var Cu=u.getElementById(e.id+"_"+V);Cu&&(Cu.classList.remove("selected"),Cu.removeAttribute("aria-selected"),g.removeAttribute("aria-activedescendant"))}function Au(V,Cu){var Nu=y();if(Cu==="Escape")S();else{if(!Nu||s.length<1)return;Cu==="ArrowUp"?lu():hu()}V.preventDefault(),Nu&&V.stopPropagation()}function mu(V){if(c){a===2&&V.preventDefault(),x=!0;try{n.onSelect(c,g)}finally{x=!1}S()}a===1&&V.preventDefault()}function au(V){var Cu=V.key;switch(Cu){case"ArrowUp":case"ArrowDown":case"Escape":Au(V,Cu);break;case"Enter":mu(V);break}}function Lu(){d&&iu(1)}function iu(V){g.value.length>=E||V===1?(A(),m=window.setTimeout(function(){return zu(g.value,V,g.selectionStart||0)},V===0||V===2?t:0)):S()}function zu(V,Cu,Nu){if(!h){var n0=++D;n.fetch(V,function(x0){D===n0&&x0&&(s=x0,l=V,c=s.length<1||r?void 0:s[0],M())},Cu,Nu)}}function ru(V){if(n.keyup){n.keyup({event:V,fetch:function(){return iu(0)}});return}!y()&&V.key==="ArrowDown"&&iu(0)}function Bu(V){n.click&&n.click({event:V,fetch:function(){return iu(2)}})}function c0(){setTimeout(function(){u.activeElement!==g&&S()},200)}function re(){zu(g.value,3,g.selectionStart||0)}e.addEventListener("mousedown",function(V){V.stopPropagation(),V.preventDefault()}),e.addEventListener("focus",function(){return g.focus()}),C();function W0(){g.removeEventListener("focus",Lu),g.removeEventListener("keyup",ru),g.removeEventListener("click",Bu),g.removeEventListener("keydown",au),g.removeEventListener("input",L),g.removeEventListener("blur",c0),window.removeEventListener("resize",R),u.removeEventListener("scroll",G,!0),g.removeAttribute("role"),g.removeAttribute("aria-expanded"),g.removeAttribute("aria-autocomplete"),g.removeAttribute("aria-controls"),g.removeAttribute("aria-activedescendant"),g.removeAttribute("aria-owns"),g.removeAttribute("aria-haspopup"),A(),S(),h=!0}return g.addEventListener("keyup",ru),g.addEventListener("click",Bu),g.addEventListener("keydown",au),g.addEventListener("input",L),g.addEventListener("blur",c0),g.addEventListener("focus",Lu),window.addEventListener("resize",R),u.addEventListener("scroll",G,!0),{destroy:W0,fetch:re}}function r1(n,u){const e=u.fetch;e&&(u.fetch=(a,i,t,r)=>{n.classList.add("slick-autocomplete-loading");const o=i;e(a,l=>{o(l),n.classList.remove("slick-autocomplete-loading")},t,r)})}function kt(n,u,e,a,i){const t=e,r=a.outputType||i.type||a.type||p.dateUtc,o=i.type||a.type,s=$0(p.dateIso),l=o?$0(o):void 0,E=Array.isArray(t)?t:[t||""];if(E.length&&E[0]){const d=[];for(const c of E){const D=c instanceof Date?c:Be(c,l);D&&d.push(D)}d.length&&(u.settings.selected={dates:[d.map(c=>l0(c,s)).join(":")],month:d[0].getMonth(),year:d[0].getFullYear(),time:l==="ISO8601"||(l||"").toLowerCase().includes("h")?l0(d[0],"HH:mm"):void 0}),n.value=E.length?d.map(c=>le(c,void 0,r)).join(" — "):""}}function Kr(n,u){const e=v("select",{className:"form-control"});for(const a of n){const i=document.createElement("option");i.value=a.operator,u.applyHtmlCode(i,`${Gl(a.operatorAlt||a.operator,3)}${a.descAlt||a.desc}`),e.appendChild(i)}return e}function dD(n,u,e){const a=(u==null?void 0:u.filter)??{},i=(a==null?void 0:a.collectionOptions)??{};if(i&&i.collectionInsideObjectProperty){const t=i.collectionInsideObjectProperty;n=Yu(n,t)}if(!Array.isArray(n))throw new Error('Something went wrong while trying to pull the collection from the "collectionAsync" call in the Filter, the collection is not a valid array.');a.collection=n,e(n)}async function o1(n,u,e,a,i){const t=(u==null?void 0:u.filter)??{},r=(t==null?void 0:t.collectionOptions)??{};let o=null;if(n){const s=(a==null?void 0:a.isObservable(n))??!1;s&&a&&(o=await Pl(a,n));const l=await n;if(Array.isArray(l)?o=l:(l==null?void 0:l.status)>=200&&l.status<300&&typeof l.json=="function"?o=await l.json():l&&l.content&&(o=l.content),!Array.isArray(o)&&(r!=null&&r.collectionInsideObjectProperty)){const E=o||l,d=r.collectionInsideObjectProperty;o=Yu(E,d||"")}if(!Array.isArray(o))throw new Error('Something went wrong while trying to pull the collection from the "collectionAsync" call in the Filter, the collection is not a valid array.');t.collection=o,e(o),s&&cD(u,e,a,i)}return o}function cD(n,u,e,a){const i=(n==null?void 0:n.filter)??{},t=e==null?void 0:e.createSubject();i.collectionAsync=t,a&&t&&a.push(t.subscribe(r=>dD(r,n,u)))}function q0(n,u,e,a,i){if(a!=null&&a.enableTranslate&&(i!=null&&i.translate)){const r=Q0(a);return i.translate(`${r}${n}`)}const t=a.locales||T.locales;return(t==null?void 0:t[u])??e}function DD(n,u){const e=[{operator:"",desc:q0("CONTAINS","TEXT_CONTAINS","Contains",n,u)},{operator:"<>",desc:q0("NOT_CONTAINS","TEXT_NOT_CONTAINS","Not Contains",n,u)},{operator:"=",desc:q0("EQUALS","TEXT_EQUALS","Equals",n,u)},{operator:"!=",desc:q0("NOT_EQUAL_TO","TEXT_NOT_EQUAL_TO","Not equal to",n,u)},{operator:"a*",desc:q0("STARTS_WITH","TEXT_STARTS_WITH","Starts with",n,u)},{operator:"*z",desc:q0("ENDS_WITH","TEXT_ENDS_WITH","Ends with",n,u)}];return s1(n,e,"text"),e}function Hr(n,u){const e=[{operator:"",desc:""},{operator:"=",desc:q0("EQUAL_TO","TEXT_EQUAL_TO","Equal to",n,u)},{operator:"<",desc:q0("LESS_THAN","TEXT_LESS_THAN","Less than",n,u)},{operator:"<=",desc:q0("LESS_THAN_OR_EQUAL_TO","TEXT_LESS_THAN_OR_EQUAL_TO","Less than or equal to",n,u)},{operator:">",desc:q0("GREATER_THAN","TEXT_GREATER_THAN","Greater than",n,u)},{operator:">=",desc:q0("GREATER_THAN_OR_EQUAL_TO","TEXT_GREATER_THAN_OR_EQUAL_TO","Greater than or equal to",n,u)},{operator:"<>",desc:q0("NOT_EQUAL_TO","TEXT_NOT_EQUAL_TO","Not equal to",n,u)}];return s1(n,e,"numeric"),e}function s1(n,u,e){if(n.compoundOperatorAltTexts){for(const a of u)if(n.compoundOperatorAltTexts.hasOwnProperty(e)){const i=n.compoundOperatorAltTexts[e][a.operator];a.operatorAlt=(i==null?void 0:i.operatorAlt)||"",a.descAlt=(i==null?void 0:i.descAlt)||""}}}class mD{constructor(u,e,a){this.translaterService=u,this.collectionService=e,this.rxjs=a,this._clearFilterTriggered=!1,this._shouldTriggerQuery=!0,this.searchTerms=[],this.isFilled=!1,this.isItemSelected=!1,this.valueName="label",this.enableTranslateLabel=!1,this.subscriptions=[],this._bindEventService=new vu}get autocompleterOptions(){return this._autocompleterOptions||{}}get collectionOptions(){var u,e;return((e=(u=this.columnDef)==null?void 0:u.filter)==null?void 0:e.collectionOptions)??{}}get collection(){return this._collection}get columnFilter(){var u;return((u=this.columnDef)==null?void 0:u.filter)||{}}get filterDomElement(){return this._filterElm}get filterOptions(){var u,e;return{...(u=this.gridOptions.defaultFilterOptions)==null?void 0:u.autocompleter,...(e=this.columnFilter)==null?void 0:e.filterOptions}}get customStructure(){var a,i,t,r,o;let u=(a=this.columnFilter)==null?void 0:a.customStructure;const e=((i=this.columnFilter)==null?void 0:i.type)??((t=this.columnDef)==null?void 0:t.type);return!u&&e===p.object&&((r=this.columnDef)!=null&&r.dataKey)&&((o=this.columnDef)!=null&&o.labelKey)&&(u={label:this.columnDef.labelKey,value:this.columnDef.dataKey}),u}get defaultOperator(){return P.equal}get gridOptions(){var u;return((u=this.grid)==null?void 0:u.getOptions())??{}}get instance(){return this._instance}get operator(){var u;return((u=this.columnFilter)==null?void 0:u.operator)??this.defaultOperator}set operator(u){this.columnFilter&&(this.columnFilter.operator=u)}init(u){var a,i,t,r,o,s;if(!u)throw new Error('[Slickgrid-Universal] A filter must always have an "init()" with valid arguments.');if(this.grid=u.grid,this.callback=u.callback,this.columnDef=u.columnDef,this.searchTerms=(u.hasOwnProperty("searchTerms")?u.searchTerms:[])||[],this.filterContainerElm=u.filterContainerElm,!this.grid||!this.columnDef||!this.columnFilter||!this.columnFilter.collection&&!this.columnFilter.collectionAsync&&!this.columnFilter.filterOptions)throw new Error(`[Slickgrid-Universal] You need to pass a "collection" (or "collectionAsync") for the AutoComplete Filter to work correctly. Also each option should include a value/label pair (or value/labelKey when using Locale). For example:: { filter: model: Filters.autocompleter, collection: [{ value: true, label: 'True' }, { value: false, label: 'False'}] }`);this.enableTranslateLabel=((a=this.columnFilter)==null?void 0:a.enableTranslateLabel)??!1,this.labelName=((i=this.customStructure)==null?void 0:i.label)??"label",this.valueName=((t=this.customStructure)==null?void 0:t.value)??"value",this.labelPrefixName=((r=this.customStructure)==null?void 0:r.labelPrefix)??"labelPrefix",this.labelSuffixName=((o=this.customStructure)==null?void 0:o.labelSuffix)??"labelSuffix",this._locales=((s=this.gridOptions)==null?void 0:s.locales)??T.locales;const e=this.columnFilter.collection;return this._collection=e,this.renderDomElement(e),new Promise(async(l,E)=>{try{const d=this.columnFilter.collectionAsync;let c;d&&!this.columnFilter.collection?(c=o1(d,this.columnDef,this.renderDomElement.bind(this),this.rxjs,this.subscriptions),l(c)):(c=e,l(e)),(d||this.columnFilter.enableCollectionWatch)&&(await(c??d),this.watchCollectionChanges())}catch(d){E(d)}})}clear(u=!0){this._filterElm&&(this._clearFilterTriggered=!0,this._shouldTriggerQuery=u,this.searchTerms=[],this._filterElm.value="",this._filterElm.dispatchEvent(new CustomEvent("input")),this._filterElm.classList.remove("filled"))}destroy(){var u,e,a;typeof((u=this._instance)==null?void 0:u.destroy)=="function"&&this._instance.destroy(),this._filterElm,(a=(e=this._filterElm)==null?void 0:e.remove)==null||a.call(e),this._collection=void 0,this._bindEventService.unbindAll(),$t(this.subscriptions)}getValues(){var u;return(u=this._filterElm)==null?void 0:u.value}setValues(u,e){var i;u&&this._filterElm&&(this._filterElm.value=u);const a=this.getValues()!==""?"add":"remove";(i=this._filterElm)==null||i.classList[a]("filled"),this.operator=e||this.defaultOperator}filterCollection(u){var a;let e=u;if(this.columnFilter&&this.columnFilter.collectionFilterBy){const i=this.columnFilter.collectionFilterBy,t=this.columnFilter.collectionOptions&&this.columnFilter.collectionOptions.filterResultAfterEachPass||null;e=((a=this.collectionService)==null?void 0:a.filterCollection(e,i,t))||[]}return e}sortCollection(u){var a;let e=u;if(this.columnFilter&&this.columnFilter.collectionSortBy){const i=this.columnFilter.collectionSortBy;e=((a=this.collectionService)==null?void 0:a.sortCollection(this.columnDef,e,i,this.enableTranslateLabel))||[]}return e}watchCollectionChanges(){var u;(u=this.columnFilter)!=null&&u.collection&&(Di(this.columnFilter.collection,e=>{this.renderDomElement(this.columnFilter.collection||e||[])}),yr(this.columnFilter,"collection",e=>{this.renderDomElement(e||[]),this.columnFilter.collection&&Di(this.columnFilter.collection,a=>{this.renderDomElement(this.columnFilter.collection||a||[])})}))}renderDomElement(u){var i;if(!Array.isArray(u)&&((i=this.collectionOptions)!=null&&i.collectionInsideObjectProperty)){const t=this.collectionOptions.collectionInsideObjectProperty;u=Yu(u,t||"")}let e=u;e&&(e=this.filterCollection(e),e=this.sortCollection(e));const a=Array.isArray(this.searchTerms)&&this.searchTerms.length>=0?this.searchTerms[0]:"";this._collection=e,this._filterElm=this.createFilterElement(e,a),this._bindEventService.bind(this._filterElm,"input",this.handleOnInputChange.bind(this)),this._bindEventService.bind(this._filterElm,"blur",()=>{this.isItemSelected||this.clear()})}createFilterElement(u,e){var o,s,l,E,d,c,D,m,h,x,g;this._collection=u;const a=((o=this.columnDef)==null?void 0:o.id)??"";bu(this.filterContainerElm);let i=((s=this.gridOptions)==null?void 0:s.defaultFilterPlaceholder)??"";(l=this.columnFilter)!=null&&l.placeholder&&(i=this.columnFilter.placeholder),this._filterElm=v("input",{type:"text",ariaLabel:((E=this.columnFilter)==null?void 0:E.ariaLabel)??`${de(a+"")} Search Filter`,autocomplete:"off",ariaAutoComplete:"none",placeholder:i,className:`form-control search-filter filter-${a} slick-autocomplete-container`,value:e??"",dataset:{columnid:`${a}`}});const t=e;Array.isArray(u)&&(u.every(F=>bi(F))?u=u.map(F=>({label:F,value:F})):u=u.map(F=>({label:F==null?void 0:F[this.labelName],value:F==null?void 0:F[this.valueName],labelPrefix:(F==null?void 0:F[this.labelPrefixName])??"",labelSuffix:(F==null?void 0:F[this.labelSuffixName])??""}))),this._autocompleterOptions={input:this._filterElm,debounceWaitMs:200,className:`slick-autocomplete ${((d=this.filterOptions)==null?void 0:d.className)??""}`.trim(),emptyMsg:this.gridOptions.enableTranslate&&((c=this.translaterService)!=null&&c.translate)?this.translaterService.translate("NO_ELEMENTS_FOUND"):((D=this._locales)==null?void 0:D.TEXT_NO_ELEMENTS_FOUND)??"No elements found",customize:(F,C,A)=>{A.style.width=""},onSelect:F=>{this.isItemSelected=!0,this.handleSelect(F)},...this.filterOptions},(m=this.gridOptions)!=null&&m.darkMode&&(this._autocompleterOptions.className+=" slick-dark-mode"),this.autocompleterOptions.className=_u(this.autocompleterOptions.className).join(" "),(h=this._autocompleterOptions.renderItem)!=null&&h.layout?(this._autocompleterOptions.className+=` autocomplete-custom-${gi(this._autocompleterOptions.renderItem.layout)}`,this._autocompleterOptions.render=this.renderCustomItem.bind(this)):Array.isArray(u)?this._autocompleterOptions.render=((x=this._autocompleterOptions.render)==null?void 0:x.bind(this))??this.renderCollectionItem.bind(this):this._autocompleterOptions.render||(this._autocompleterOptions.render=this.renderRegularItem.bind(this)),(g=this.filterOptions)!=null&&g.fetch?(r1(this._filterElm,this._autocompleterOptions),this._instance=Ft(this._autocompleterOptions)):this._instance=Ft({...this._autocompleterOptions,fetch:(F,C)=>{u&&C(u.filter(A=>((typeof A=="string"?A:A==null?void 0:A.label)||"").toLowerCase().includes(F.toLowerCase())))}}),this._filterElm.value=t??"";const r=v("div",{className:"autocomplete-filter-container"});return r.appendChild(this._filterElm),r.appendChild(v("span")),e&&this._filterElm.classList.add("filled"),this.filterContainerElm.appendChild(r),this.filterContainerElm.appendChild(document.createElement("span")),this._filterElm}handleSelect(u){var e,a;if(u!==void 0){const t=((e=this.filterOptions)==null?void 0:e.renderItem)??!1,r=typeof u=="string"?u:t?u[this.labelName]:u.label;let o=typeof u=="string"?u:t?u[this.valueName]:u.value;o=this.trimWhitespaceWhenEnabled(o);const s=o===""?"remove":"add";(a=this._filterElm)==null||a.classList[s]("filled"),this.setValues(r),this.callback(void 0,{columnDef:this.columnDef,operator:this.operator,searchTerms:[o],shouldTriggerQuery:this._shouldTriggerQuery}),this._clearFilterTriggered=!1,this._shouldTriggerQuery=!0}return!1}handleOnInputChange(u){var i,t,r;let e=((i=u==null?void 0:u.target)==null?void 0:i.value)??"";const a=this.filterOptions.triggerOnEveryKeyStroke??!1;if(e=this.trimWhitespaceWhenEnabled(e),this._clearFilterTriggered||e===""||a){const o={columnDef:this.columnDef,shouldTriggerQuery:this._shouldTriggerQuery};this._clearFilterTriggered?o.clearFilterTriggered=this._clearFilterTriggered:(o.operator=this.operator,o.searchTerms=[e]),e!==""?(this.isItemSelected=!0,(t=this._filterElm)==null||t.classList.add("filled")):(this.isItemSelected=!1,(r=this._filterElm)==null||r.classList.remove("filled")),this.callback(u,o)}this._clearFilterTriggered=!1,this._shouldTriggerQuery=!0}renderRegularItem(u){const e=typeof u=="string"?u:(u==null?void 0:u.label)??"";return v("div",{textContent:e||""})}renderCustomItem(u){var i,t;const e=((t=(i=this._autocompleterOptions)==null?void 0:i.renderItem)==null?void 0:t.templateCallback(u))??"",a=document.createElement("div");return this.grid.applyHtmlCode(a,e),a}renderCollectionItem(u){var l;const e=((l=this.columnFilter)==null?void 0:l.enableRenderHtml)??!1,a=u.labelPrefix||"",i=u.label||"",t=u.labelSuffix||"",r=a+i+t,o=this.grid.sanitizeHtmlString(r)||"",s=document.createElement("div");return s[e?"innerHTML":"textContent"]=o,s}trimWhitespaceWhenEnabled(u){let e=u;const a=this.gridOptions.enableFilterTrimWhiteSpace||this.columnFilter.enableTrimWhiteSpace;return typeof u=="string"&&a&&(e=u.trim()),e}}/*! name: vanilla-calendar-picker | url: https://github.com/uvarov-frontend/vanilla-calendar-picker */var hD=Object.defineProperty,es=Object.getOwnPropertySymbols,xD=Object.prototype.hasOwnProperty,gD=Object.prototype.propertyIsEnumerable,Qn=(n,u,e)=>u in n?hD(n,u,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[u]=e,l1=(n,u)=>{for(var e in u||(u={}))xD.call(u,e)&&Qn(n,e,u[e]);if(es)for(var e of es(u))gD.call(u,e)&&Qn(n,e,u[e]);return n},xu=(n,u,e)=>(Qn(n,typeof u!="symbol"?u+"":u,e),e);const CD={calendar:"vanilla-calendar",calendarDefault:"vanilla-calendar_default",calendarMultiple:"vanilla-calendar_multiple",calendarMonth:"vanilla-calendar_month",calendarYear:"vanilla-calendar_year",calendarHidden:"vanilla-calendar_hidden",calendarToInput:"vanilla-calendar_to-input",calendarToInputTop:"vanilla-calendar_to-input_top",calendarToInputBottom:"vanilla-calendar_to-input_bottom",controls:"vanilla-calendar-controls",grid:"vanilla-calendar-grid",gridDisabled:"vanilla-calendar-grid_disabled",column:"vanilla-calendar-column",columnMonth:"vanilla-calendar-column_month",columnYear:"vanilla-calendar-column_year",header:"vanilla-calendar-header",headerContent:"vanilla-calendar-header__content",month:"vanilla-calendar-month",monthDisabled:"vanilla-calendar-month_disabled",year:"vanilla-calendar-year",yearDisabled:"vanilla-calendar-year_disabled",arrow:"vanilla-calendar-arrow",arrowPrev:"vanilla-calendar-arrow_prev",arrowNext:"vanilla-calendar-arrow_next",wrapper:"vanilla-calendar-wrapper",content:"vanilla-calendar-content",week:"vanilla-calendar-week",weekDay:"vanilla-calendar-week__day",weekDayWeekend:"vanilla-calendar-week__day_weekend",days:"vanilla-calendar-days",daysSelecting:"vanilla-calendar-days_selecting",months:"vanilla-calendar-months",monthsSelecting:"vanilla-calendar-months_selecting",monthsMonth:"vanilla-calendar-months__month",monthsMonthSelected:"vanilla-calendar-months__month_selected",monthsMonthDisabled:"vanilla-calendar-months__month_disabled",years:"vanilla-calendar-years",yearsSelecting:"vanilla-calendar-years_selecting",yearsYear:"vanilla-calendar-years__year",yearsYearSelected:"vanilla-calendar-years__year_selected",yearsYearDisabled:"vanilla-calendar-years__year_disabled",time:"vanilla-calendar-time",timeContent:"vanilla-calendar-time__content",timeHours:"vanilla-calendar-time__hours",timeMinutes:"vanilla-calendar-time__minutes",timeKeeping:"vanilla-calendar-time__keeping",timeRanges:"vanilla-calendar-time__ranges",timeRange:"vanilla-calendar-time__range",day:"vanilla-calendar-day",dayHoverFirst:"vanilla-calendar-day_hover-first",dayHoverLast:"vanilla-calendar-day_hover-last",dayHoverIntermediate:"vanilla-calendar-day_hover-intermediate",daySelectedFirst:"vanilla-calendar-day_selected-first",daySelectedLast:"vanilla-calendar-day_selected-last",daySelectedIntermediate:"vanilla-calendar-day_selected-intermediate",dayPopup:"vanilla-calendar-day__popup",dayBtn:"vanilla-calendar-day__btn",dayBtnPrev:"vanilla-calendar-day__btn_prev",dayBtnNext:"vanilla-calendar-day__btn_next",dayBtnToday:"vanilla-calendar-day__btn_today",dayBtnSelected:"vanilla-calendar-day__btn_selected",dayBtnHover:"vanilla-calendar-day__btn_hover",dayBtnDisabled:"vanilla-calendar-day__btn_disabled",dayBtnWeekend:"vanilla-calendar-day__btn_weekend",dayBtnHoliday:"vanilla-calendar-day__btn_holiday",weekNumbers:"vanilla-calendar-week-numbers",weekNumbersTitle:"vanilla-calendar-week-numbers__title",weekNumbersContent:"vanilla-calendar-week-numbers__content",weekNumber:"vanilla-calendar-week-number",isFocus:"vanilla-calendar-is-focus"},pD=n=>`<#WeekNumbers />
<#Week /><#Days />
<#ControlTime />`,FD=n=>`<#ArrowPrev /><#ArrowNext />
<#Multiple>
<#WeekNumbers />
<#Week /><#Days />
<#/Multiple>
<#ControlTime />`,kD=n=>``,vD=n=>``;class AD{constructor(){xu(this,"isInit",!1),xu(this,"input",!1),xu(this,"type","default"),xu(this,"months",2),xu(this,"jumpMonths",1),xu(this,"toggleSelected",!0),xu(this,"jumpToSelectedDate",!1),xu(this,"date",{min:"1970-01-01",max:"2470-12-31",today:new Date}),xu(this,"settings",{lang:"en",iso8601:!0,range:{min:this.date.min,max:this.date.max,disablePast:!1,disableGaps:!1,edgesOnly:!1,disableAllDays:!1,disableWeekday:void 0,disabled:void 0,enabled:void 0},selection:{day:"single",month:!0,year:!0,time:!1,controlTime:"all",stepHours:1,stepMinutes:1,cancelableDay:!0},selected:{dates:void 0,month:void 0,year:void 0,holidays:void 0,time:void 0},visibility:{theme:"system",themeDetect:"html[data-theme]",monthShort:!0,weekNumbers:!1,weekend:!0,today:!0,disabled:!1,daysOutside:!0,positionToInput:"left"}}),xu(this,"locale",{months:[],weekday:[]}),xu(this,"sanitizer",u=>u),xu(this,"actions",{clickDay:null,clickWeekNumber:null,clickMonth:null,clickYear:null,clickArrow:null,changeTime:null,changeToInput:null,getDays:null,getMonths:null,getYears:null,initCalendar:null,updateCalendar:null,destroyCalendar:null,showCalendar:null,hideCalendar:null}),xu(this,"popups",{}),xu(this,"CSSClasses",l1({},CD)),xu(this,"DOMTemplates",{default:pD(this.CSSClasses),multiple:FD(this.CSSClasses),month:kD(this.CSSClasses),year:vD(this.CSSClasses)}),xu(this,"HTMLElement"),xu(this,"HTMLOriginalElement"),xu(this,"HTMLInputElement"),xu(this,"rangeMin"),xu(this,"rangeMax"),xu(this,"rangeDisabled"),xu(this,"rangeEnabled"),xu(this,"selectedDates"),xu(this,"selectedHolidays"),xu(this,"selectedMonth"),xu(this,"selectedYear"),xu(this,"selectedHours"),xu(this,"selectedMinutes"),xu(this,"selectedKeeping"),xu(this,"selectedTime"),xu(this,"currentType"),xu(this,"correctMonths"),xu(this,"viewYear"),xu(this,"dateMin"),xu(this,"dateMax")}}const ce=n=>`${n.getFullYear()}-${String(n.getMonth()+1).padStart(2,"0")}-${String(n.getDate()).padStart(2,"0")}`,Gu=n=>new Date(`${n}T00:00:00`),Na=n=>n.reduce((u,e)=>{if(e instanceof Date||typeof e=="number"){const a=e instanceof Date?e:new Date(e);u.push(a.toISOString().substring(0,10))}else e.match(/^(\d{4}-\d{2}-\d{2})$/g)?u.push(e):e.replace(/(\d{4}-\d{2}-\d{2}).*?(\d{4}-\d{2}-\d{2})/g,(a,i,t)=>{const r=Gu(i),o=Gu(t),s=new Date(r.getTime());for(;s<=o;s.setDate(s.getDate()+1))u.push(ce(s));return a});return u},[]),as=()=>{const n=new Date;return new Date(n.getTime()-6e4*n.getTimezoneOffset()).toISOString().substring(0,10)},Ci=n=>n?{0:"12",13:"01",14:"02",15:"03",16:"04",17:"05",18:"06",19:"07",20:"08",21:"09",22:"10",23:"11"}[Number(n)]||String(n):"",Oa={notFoundSelector:n=>`${n} is not found, check the first argument passed to new VanillaCalendar.`,notInit:'The calendar has not been initialized, please initialize it using the "init()" method first.',notLocale:'You specified "define" for "settings.lang" but did not provide the required values for "locale.weekday" or "locale.months".',incorrectTheme:'Incorrect name of theme in "settings.visibility.theme".',incorrectTime:"The value of the time property can be: false, true, 12 or 24."},bD=n=>{var u;if(n.jumpToSelectedDate&&((u=n.settings.selected.dates)!=null&&u.length)&&n.settings.selected.month===void 0&&n.settings.selected.year===void 0){const i=Gu(Na(n.settings.selected.dates)[0]);n.settings.selected.month=i.getMonth(),n.settings.selected.year=i.getFullYear()}const e=n.settings.selected.month!==void 0&&Number(n.settings.selected.month)>=0&&Number(n.settings.selected.month)<12,a=n.settings.selected.year!==void 0&&Number(n.settings.selected.year)>=0&&Number(n.settings.selected.year)<=9999;n.selectedMonth=e?Number(n.settings.selected.month):n.date.today.getMonth(),n.selectedYear=a?Number(n.settings.selected.year):n.date.today.getFullYear(),n.viewYear=n.selectedYear},fD=n=>{var u,e,a;n.settings.range.min==="today"&&(n.settings.range.min=as()),n.settings.range.max==="today"&&(n.settings.range.max=as()),n.settings.range.min=Gu(n.date.min)>=Gu(n.settings.range.min)?n.date.min:n.settings.range.min,n.settings.range.max=Gu(n.date.max)<=Gu(n.settings.range.max)?n.date.max:n.settings.range.max;const i=n.settings.range.disablePast&&!n.settings.range.disableAllDays&&Gu(n.settings.range.min)1&&n.rangeDisabled.sort((t,r)=>+new Date(t)-+new Date(r)),n.rangeEnabled=n.settings.range.enabled?Na(n.settings.range.enabled):[],(u=n.rangeEnabled)!=null&&u[0]&&((e=n.rangeDisabled)!=null&&e[0])&&(n.rangeDisabled=n.rangeDisabled.filter(t=>!n.rangeEnabled.includes(t))),n.rangeEnabled.length>1&&n.rangeEnabled.sort((t,r)=>+new Date(t)-+new Date(r)),(a=n.rangeEnabled)!=null&&a[0]&&n.settings.range.disableAllDays&&(n.rangeMin=n.rangeEnabled[0],n.rangeMax=n.rangeEnabled[n.rangeEnabled.length-1])},BD=n=>{var u,e;n.selectedDates=(u=n.settings.selected.dates)!=null&&u[0]?Na(n.settings.selected.dates):[],n.selectedHolidays=(e=n.settings.selected.holidays)!=null&&e[0]?Na(n.settings.selected.holidays):[]},yD=n=>{n.dateMin=n.settings.visibility.disabled?Gu(n.date.min):Gu(n.rangeMin),n.dateMax=n.settings.visibility.disabled?Gu(n.date.max):Gu(n.rangeMax)},zD=n=>{const u=n.settings.selection.time===!0||n.settings.selection.time===12;if(u||n.settings.selection.time===24){let e=!1;if(typeof n.settings.selected.time=="string"){const a=u?/^([0-9]|0[1-9]|1[0-2]):([0-5][0-9])|(AM|PM)/g:/^([0-1]?[0-9]|2[0-3]):([0-5][0-9])/g;n.settings.selected.time.replace(a,(i,t,r,o)=>(t&&r&&(e=!0,n.selectedHours=t,n.selectedMinutes=r),o&&u?n.selectedKeeping=o:u&&(n.selectedKeeping="AM"),""))}!e&&u?(n.selectedHours=Ci(String(n.date.today.getHours())),n.selectedMinutes=String(n.date.today.getMinutes()),n.selectedKeeping=Number(n.date.today.getHours())>=12?"PM":"AM"):e||(n.selectedHours=String(n.date.today.getHours()),n.selectedMinutes=String(n.date.today.getMinutes())),n.selectedHours=Number(n.selectedHours)<10?`0${Number(n.selectedHours)}`:`${n.selectedHours}`,n.selectedMinutes=Number(n.selectedMinutes)<10?`0${Number(n.selectedMinutes)}`:`${n.selectedMinutes}`,n.selectedTime=`${n.selectedHours}:${n.selectedMinutes}${n.selectedKeeping?` ${n.selectedKeeping}`:""}`}else if(n.settings.selection.time)throw new Error(Oa.incorrectTime)},SD=n=>{n.correctMonths=n.type==="multiple"?n.months===1?2:n.months>12?12:n.months:1},E1=n=>{n.currentType=n.type,bD(n),fD(n),BD(n),yD(n),zD(n),SD(n)},is=({arrowPrev:n,arrowNext:u,isPrevHidden:e,isNextHidden:a})=>{n.style.visibility=e?"hidden":"",u.style.visibility=a?"hidden":""},Or=n=>{var u,e;if(n.currentType==="month")return;const a=(u=n.HTMLElement)==null?void 0:u.querySelector(`.${n.CSSClasses.arrowPrev}`),i=(e=n.HTMLElement)==null?void 0:e.querySelector(`.${n.CSSClasses.arrowNext}`);!a||!i||{default:()=>{const t=Gu(ce(new Date(n.selectedYear,n.selectedMonth,1))),r=new Date(t.getTime()),o=new Date(t.getTime());r.setMonth(r.getMonth()-n.jumpMonths),o.setMonth(o.getMonth()+n.jumpMonths),n.settings.selection.year||(n.dateMin.setFullYear(t.getFullYear()),n.dateMax.setFullYear(t.getFullYear()));const s=!n.settings.selection.month||r.getFullYear()n.dateMax.getFullYear()||o.getFullYear()===n.dateMax.getFullYear()&&o.getMonth()>n.dateMax.getMonth();is({arrowPrev:a,arrowNext:i,isPrevHidden:s,isNextHidden:l})},year:()=>{is({arrowPrev:a,arrowNext:i,isPrevHidden:n.dateMin.getFullYear()&&n.viewYear-7<=n.dateMin.getFullYear(),isNextHidden:n.dateMax.getFullYear()&&n.viewYear+7>=n.dateMax.getFullYear()})}}[n.currentType==="multiple"?"default":n.currentType]()},d1=(n,u)=>{if(!n)return null;const e=Gu(n),a=u?e.getDay()||7:e.getDay();e.setDate(e.getDate()+4-a);const i=new Date(e.getFullYear(),0,1),t=Math.ceil(((+e-+i)/864e5+1)/7);return{year:e.getFullYear(),week:t}},wD=(n,u,e,a)=>{const i=e.querySelector(`[data-calendar-day="${n}"]`);i&&(u!=null&&u.modifier&&i.classList.add(...u.modifier.trim().split(" ")),u!=null&&u.html&&(i.parentElement.innerHTML+=`${u.html}
`))},MD=(n,u)=>{var e;n.popups&&((e=Object.entries(n.popups))==null||e.forEach(([a,i])=>wD(a,i,u,n.CSSClasses.dayPopup)))},TD=(n,u,e,a,i)=>{const t=u[e].querySelector(`.${n.CSSClasses.dayBtn}`),r=d1(t==null?void 0:t.dataset.calendarDay,n.settings.iso8601);if(!r)return;const o=a.cloneNode(!0);o.innerText=String(r.week),o.dataset.calendarYearWeek=String(r.year),i.appendChild(o)},_D=(n,u,e,a,i)=>{if(!n.settings.visibility.weekNumbers)return;a.textContent="";const t=document.createElement("b");t.className=n.CSSClasses.weekNumbersTitle,t.innerText="#",a.appendChild(t);const r=document.createElement("div");r.className=n.CSSClasses.weekNumbersContent,a.appendChild(r);const o=document.createElement("button");o.type="button",o.className=n.CSSClasses.weekNumber;const s=i.querySelectorAll(`.${n.CSSClasses.day}`),l=Math.ceil((u+e)/7);for(let E=0;E{var a,i,t,r,o;const s=(a=n.settings.range.disableWeekday)==null?void 0:a.includes(e),l=n.settings.range.disableAllDays&&!!((i=n.rangeEnabled)!=null&&i[0]);!s&&!l||(t=n.rangeEnabled)!=null&&t.includes(u)||(r=n.rangeDisabled)!=null&&r.includes(u)||(n.rangeDisabled.push(u),(o=n.rangeDisabled)==null||o.sort((E,d)=>+new Date(E)-+new Date(d)))},jD=(n,u,e,a,i,t,r)=>{var o,s,l;if((Gu(n.rangeMin)>Gu(t)||Gu(n.rangeMax)1&&n.settings.selection.day==="multiple-ranged"&&(n.selectedDates[0]===t&&e.classList.add(n.CSSClasses.daySelectedFirst),n.selectedDates[n.selectedDates.length-1]===t&&e.classList.add(n.CSSClasses.daySelectedLast),n.selectedDates[0]!==t&&n.selectedDates[n.selectedDates.length-1]!==t&&e.classList.add(n.CSSClasses.daySelectedIntermediate))),n.settings.range.edgesOnly&&n.selectedDates.length>1&&n.settings.selection.day==="multiple-ranged"){const E=+new Date(n.selectedDates[0]),d=+new Date(n.selectedDates[n.selectedDates.length-1]),c=+new Date(t);c>E&&c{const s=document.createElement("div");s.className=n.CSSClasses.day;const l=document.createElement("button");l.className=`${n.CSSClasses.dayBtn}${o?` ${o}`:""}`,l.type="button",l.innerText=String(a),l.dataset.calendarDay=t,n.settings.visibility.weekNumbers&&(()=>{const E=d1(t,n.settings.iso8601);E&&(l.dataset.calendarWeekNumber=String(E.week))})(),r?n.settings.visibility.daysOutside&&s.appendChild(l):s.appendChild(l),PD(n,t,i),jD(n,u,s,l,i,t,r),e.appendChild(s),n.actions.getDays&&n.actions.getDays(a,t,s,l,n)},LD=(n,u,e,a,i)=>{let t=new Date(e,a,0).getDate()-(i-1);const r=a===0?e-1:e,o=a===0?12:a<10?`0${a}`:a;for(let s=i;s>0;s--,t++){const l=`${r}-${o}-${t}`,E=Gu(l).getDay();Ir(n,e,u,t,E,l,!0,n.CSSClasses.dayBtnPrev)}},ND=(n,u,e,a,i)=>{for(let t=1;t<=e;t++){const r=new Date(a,i,t),o=ce(r),s=r.getDay();Ir(n,a,u,t,s,o,!1,null)}},RD=(n,u,e,a,i,t)=>{const r=t+e,o=7*Math.ceil(r/7)-r,s=i+1===12?a+1:a,l=i+1===12?"01":i+2<10?`0${i+2}`:i+2;for(let E=1;E<=o;E++){const d=`${s}-${l}-${E<10?`0${E}`:String(E)}`,c=Gu(d).getDay();Ir(n,a,u,E,c,d,!0,n.CSSClasses.dayBtnNext)}},vt=n=>{const u=n.HTMLElement.querySelectorAll(`.${n.CSSClasses.days}`),e=n.HTMLElement.querySelectorAll(`.${n.CSSClasses.weekNumbers}`),a=new Date(n.selectedYear,n.selectedMonth,1);u.forEach((i,t)=>{const r=new Date(a);r.setMonth(r.getMonth()+t);const o=r.getMonth(),s=r.getFullYear(),l=new Date(s,o,1),E=new Date(s,o+1,0).getDate(),d=n.settings.iso8601?(l.getDay()!==0?l.getDay():7)-1:l.getDay();n.settings.selection.day&&i.classList.add(n.CSSClasses.daysSelecting),i.textContent="",LD(n,i,s,o,d),ND(n,i,E,s,o),RD(n,i,E,s,o,d),_D(n,d,E,e[t],i),MD(n,i)})},KD=(n,u,e,a)=>{const i=new Date(a.setMonth(n.selectedMonth+e)).getMonth(),t=n.settings.selection.month===!1||n.settings.selection.month==="only-arrows";u.tabIndex=t?-1:0,u.classList.toggle(n.CSSClasses.monthDisabled,t),u.setAttribute("data-calendar-selected-month",String(i)),u.innerText=n.locale.months[i]},HD=(n,u,e,a)=>{const i=new Date(a.setFullYear(n.selectedYear,n.selectedMonth+e)).getFullYear(),t=n.settings.selection.year===!1||n.settings.selection.year==="only-arrows";u.tabIndex=t?-1:0,u.classList.toggle(n.CSSClasses.yearDisabled,t),u.setAttribute("data-calendar-selected-year",String(i)),u.innerText=String(i)},Wt=n=>{var u,e;const a=(u=n.HTMLElement)==null?void 0:u.querySelectorAll("[data-calendar-selected-month]"),i=(e=n.HTMLElement)==null?void 0:e.querySelectorAll("[data-calendar-selected-year]");if(!(a!=null&&a[0])&&(i!=null&&i[0]))return;const t=new Date(n.selectedYear,n.selectedMonth,1);a==null||a.forEach((r,o)=>KD(n,r,o,t)),i==null||i.forEach((r,o)=>HD(n,r,o,t))},Xn=(n,u)=>{const e=Gu(ce(new Date(n.selectedYear,n.selectedMonth,1)));({prev:()=>e.setMonth(e.getMonth()-n.jumpMonths),next:()=>e.setMonth(e.getMonth()+n.jumpMonths)})[u](),[n.selectedMonth,n.selectedYear]=[e.getMonth(),e.getFullYear()],Wt(n),Or(n),vt(n)},OD=n=>` `,ID=n=>` `,GD=n=>` `,VD=n=>` `,$D=n=>`
`,JD=n=>`
`,WD=n=>`
`,UD=n=>`
`,qD=n=>n.settings.visibility.weekNumbers?`
`:"",ZD=n=>n.settings.selection.time?`
`:"",YD=Object.freeze(Object.defineProperty({__proto__:null,ArrowNext:ID,ArrowPrev:OD,ControlTime:ZD,Days:JD,Month:GD,Months:WD,Week:$D,WeekNumbers:qD,Year:VD,Years:UD},Symbol.toStringTag,{value:"Module"})),QD=n=>YD[n],Za=(n,u)=>u.replace(/[\n\t]/g,"").replace(/<#(?!\/?Multiple)(.*?)>/g,(e,a)=>{const i=QD(a.replace(/[/\s\n\t]/g,"")),t=i?i(n):"";return n.sanitizer(t)}).replace(/[\n\t]/g,""),XD=(n,u)=>u.replace(/<#Multiple>(.*?)<#\/Multiple>/g,(e,a)=>{let i="";for(let t=0;t{const{HTMLElement:e,CSSClasses:a,DOMTemplates:i,type:t,currentType:r,correctMonths:o}=n,s=(E,d)=>{if(!u)return;const c=e.querySelector(`.${a.controls}`);c&&e.removeChild(c),e.querySelector(`.${a.grid}`).classList.add(a.gridDisabled);const D=u.closest(`.${a.column}`);D.classList.add(E),D.innerHTML=Za(n,d)},l={default:()=>{e.classList.add(a.calendarDefault),e.classList.remove(a.calendarMonth,a.calendarYear),e.innerHTML=Za(n,i.default)},multiple:()=>{o&&(e.classList.add(a.calendarMultiple),e.classList.remove(a.calendarMonth,a.calendarYear),e.innerHTML=XD(n,Za(n,i.multiple)))},month:()=>{t!=="multiple"?(e.classList.add(a.calendarMonth),e.classList.remove(a.calendarDefault,a.calendarYear),e.innerHTML=Za(n,i.month)):s(a.columnMonth,i.month)},year:()=>{t!=="multiple"?(e.classList.add(a.calendarYear),e.classList.remove(a.calendarDefault,a.calendarMonth),e.innerHTML=Za(n,i.year)):s(a.columnYear,i.year)}};e.classList.add(a.calendar),l[r]()},um=(n,u,e,a,i)=>{const t=u.cloneNode(!1);return t.className=`${n.CSSClasses.yearsYear}${e===i?` ${n.CSSClasses.yearsYearSelected}`:a?` ${n.CSSClasses.yearsYearDisabled}`:""}`,t.dataset.calendarYear=String(i),t.title=String(i),t.innerText=String(i),a&&(t.tabIndex=-1),t},Vr=(n,u)=>{const e=u!=null&&u.dataset.calendarSelectedYear?Number(u==null?void 0:u.dataset.calendarSelectedYear):n.selectedYear;n.currentType="year",Gr(n,u),Wt(n),Or(n);const a=n.HTMLElement.querySelector(`.${n.CSSClasses.years}`);if(!n.settings.selection.year||!a)return;a.classList.add(n.CSSClasses.yearsSelecting);const i=n.type!=="multiple"||n.selectedYear===e?0:1,t=document.createElement("button");t.type="button";for(let r=n.viewYear-7;rn.dateMax.getFullYear(),s=um(n,t,e,o,r);a.appendChild(s),n.actions.getYears&&n.actions.getYears(r,s,n)}},em=(n,u)=>{const e=u.target.closest(`.${n.CSSClasses.arrow}`);e&&(["default","multiple"].includes(n.currentType)?Xn(n,e.dataset.calendarArrow):n.currentType==="year"&&n.viewYear!==void 0&&(n.viewYear+={prev:-15,next:15}[e.dataset.calendarArrow],Vr(n,u.target)),n.actions.clickArrow&&n.actions.clickArrow(u,n))},am=(n,u)=>{var e;if(!n.settings.visibility.weekNumbers||!n.actions.clickWeekNumber)return;const a=u.target.closest(`.${n.CSSClasses.weekNumber}`),i=(e=n.HTMLElement)==null?void 0:e.querySelectorAll("[data-calendar-week-number]");if(!a||!i)return;const t=Number(a.innerText),r=Number(a.dataset.calendarYearWeek),o=Array.from(i).filter(s=>Number(s.dataset.calendarWeekNumber)===t);n.actions.clickWeekNumber(u,t,o,r,n)},c1=n=>`${n.charAt(0).toUpperCase()}${n.substring(1,n.length)}`.replace(/\./,""),im=(n,u)=>{const e=new Date(`1978-01-0${u+1}T00:00:00.000Z`).toLocaleString(n.settings.lang,{weekday:"short",timeZone:"UTC"});n.locale.weekday.push(c1(e))},tm=(n,u)=>{const e=new Date(`1978-${u+1<=9?`0${u+1}`:u+1}-01T00:00:00.000Z`).toLocaleString(n.settings.lang,{month:"long",timeZone:"UTC"});n.locale.months.push(c1(e))},nm=n=>{if(n.settings.lang!=="define"||!n.locale.weekday[6]||!n.locale.months[11]){if(n.settings.lang==="define")throw new Error(Oa.notLocale);n.locale.weekday=[],n.locale.months=[];for(let u=0;u<7;u++)im(n,u);for(let u=0;u<12;u++)tm(n,u)}},ts=n=>{if(n.type!=="multiple")return 0;const u=n.HTMLElement.querySelectorAll(`.${n.CSSClasses.column}`),e=Array.from(u).findIndex(a=>a.classList.contains(`${n.CSSClasses.columnMonth}`));return e>0?e:0},rm=(n,u,e,a,i,t)=>{const r=u.cloneNode(!1);return r.className=`${n.CSSClasses.monthsMonth}${e===t?` ${n.CSSClasses.monthsMonthSelected}`:i?` ${n.CSSClasses.monthsMonthDisabled}`:""}`,r.title=a,r.innerText=`${n.settings.visibility.monthShort?a.substring(0,3):a}`,r.dataset.calendarMonth=String(t),i&&(r.tabIndex=-1),r},D1=(n,u)=>{var e,a;const i=u!=null&&u.dataset.calendarSelectedMonth?Number(u.dataset.calendarSelectedMonth):n.selectedMonth,t=(e=u==null?void 0:u.closest(`.${n.CSSClasses.column}`))==null?void 0:e.querySelector(`.${n.CSSClasses.year}`),r=t?Number(t.dataset.calendarSelectedYear):n.selectedYear;n.currentType="month",Gr(n,u),Wt(n);const o=(a=n.HTMLElement)==null?void 0:a.querySelector(`.${n.CSSClasses.months}`);if(!n.settings.selection.month||!o)return;o.classList.add(n.CSSClasses.monthsSelecting);const s=n.jumpMonths>1?n.locale.months.map((E,d)=>i-n.jumpMonths*d).concat(n.locale.months.map((E,d)=>i+n.jumpMonths*d)).filter(E=>E>=0&&E<=12):Array.from(Array(12).keys()),l=document.createElement("button");l.type="button";for(let E=0;E<12;E++){const d=n.locale.months[E],c=En.dateMax.getMonth()+ts(n)&&r>=n.dateMax.getFullYear()||E!==i&&!s.includes(E),D=rm(n,l,i,d,c,E);o.appendChild(D),n.actions.getMonths&&n.actions.getMonths(E,D,n)}},$r=(n,u)=>n&&u?{0:{AM:"00",PM:"12"},1:{AM:"01",PM:"13"},2:{AM:"02",PM:"14"},3:{AM:"03",PM:"15"},4:{AM:"04",PM:"16"},5:{AM:"05",PM:"17"},6:{AM:"06",PM:"18"},7:{AM:"07",PM:"19"},8:{AM:"08",PM:"20"},9:{AM:"09",PM:"21"},10:{AM:"10",PM:"22"},11:{AM:"11",PM:"23"},12:{AM:"12",PM:"12"}}[Number(n)][u]:"",Ti=(n,u,e)=>n.querySelector(`.${u}${e?` input[name="${e}"]`:""}`),ns=(n,u,e)=>{n.addEventListener("mouseover",()=>u.classList.add(e)),n.addEventListener("mouseout",()=>u.classList.remove(e))},la=(n,u,e,a)=>{({hours:()=>{n.selectedHours=e},minutes:()=>{n.selectedMinutes=e}})[a](),n.selectedTime=`${n.selectedHours}:${n.selectedMinutes}${n.selectedKeeping?` ${n.selectedKeeping}`:""}`,n.actions.changeTime&&n.actions.changeTime(u,n),n.input&&n.HTMLInputElement&&n.actions.changeToInput&&n.actions.changeToInput(u,n)},rs=(n,u,e,a,i,t)=>{u.addEventListener("input",r=>{const o=r.target,s=Number(o.value),l=s<10?`0${s}`:`${s}`;if(i!=="hours"||t!==12)return e.value=l,void la(n,r,l,i);s0?(e.value=l,n.selectedKeeping="AM",a.innerText=n.selectedKeeping,la(n,r,l,i)):(s===0?(n.selectedKeeping="AM",a.innerText="AM"):(n.selectedKeeping="PM",a.innerText="PM"),e.value=Ci(o.value),la(n,r,Ci(o.value),i))})},os=(n,u,e,a,i,t)=>{e.addEventListener("change",r=>{const o=r.target,s=Number(o.value),l=s<10?`0${s}`:`${s}`;i==="hours"&&t===12?o.value&&s<=t&&s>0?(o.value=l,u.value=$r(l,n.selectedKeeping),la(n,r,l,i)):o.value&&s<24&&(s>t||s===0)?(s===0?(n.selectedKeeping="AM",a.innerText="AM"):(n.selectedKeeping="PM",a.innerText="PM"),o.value=Ci(o.value),u.value=l,la(n,r,Ci(o.value),i)):o.value=n.selectedHours:o.value&&s<=t&&s>=0?(o.value=l,u.value=l,la(n,r,l,i)):i==="hours"?o.value=n.selectedHours:i==="minutes"&&(o.value=n.selectedMinutes)})},om=(n,u,e)=>{u.addEventListener("click",a=>{n.selectedKeeping=u.innerText.includes("AM")?"PM":"AM",u.innerText=n.selectedKeeping,e.value=$r(n.selectedHours,n.selectedKeeping),la(n,a,n.selectedHours,"hours")})},sm=(n,u,e)=>{const a=e===24?23:e||12,i=Ti(u,n.CSSClasses.timeRange,"hours"),t=Ti(u,n.CSSClasses.timeRange,"minutes"),r=Ti(u,n.CSSClasses.timeHours,"hours"),o=Ti(u,n.CSSClasses.timeMinutes,"minutes"),s=u.querySelector(`.${n.CSSClasses.timeKeeping}`);ns(i,r,n.CSSClasses.isFocus),ns(t,o,n.CSSClasses.isFocus),rs(n,i,r,s,"hours",a),rs(n,t,o,s,"minutes",0),os(n,i,r,s,"hours",a),os(n,t,o,s,"minutes",59),s&&om(n,s,i)},ss=(n,u,e,a)=>` `,ls=(n,u,e,a,i,t)=>` `,lm=n=>{const u=n.HTMLElement.querySelector(`.${n.CSSClasses.time}`);if(!u)return;const e=n.settings.selection.time===!0?12:n.settings.selection.time,a=n.settings.selection.controlTime==="range",[i,t]=[0,23],[r,o]=[0,59];u.innerHTML=n.sanitizer(`${ss("hours",n.CSSClasses.timeHours,n.selectedHours,a)}${ss("minutes",n.CSSClasses.timeMinutes,n.selectedMinutes,a)}${e===12?`${n.selectedKeeping} `:""}
${ls("hours",n.CSSClasses.timeRange,i,t,n.settings.selection.stepHours,n.selectedKeeping?$r(n.selectedHours,n.selectedKeeping):n.selectedHours)}${ls("minutes",n.CSSClasses.timeRange,r,o,n.settings.selection.stepMinutes,n.selectedMinutes)}
`),sm(n,u,e)},Em=(n,u,e)=>{const a=document.createElement("b");u.textContent="";for(let i=0;i{const u=[...n.locale.weekday];u[0]&&(n.settings.iso8601&&u.push(u.shift()),n.HTMLElement.querySelectorAll(`.${n.CSSClasses.week}`).forEach(e=>Em(n,e,u)))},m1=["light","dark","system"],At={value:!1,set:()=>{At.value=!0},check:()=>At.value},h1=(n,u)=>m1.find(e=>{var a;return e!=="system"&&((a=n.getAttribute(u))==null?void 0:a.includes(e))}),Ea=(n,u)=>{n.dataset.calendarTheme=u},ds=(n,u)=>{var e;if(e=u,Ea(n.HTMLElement,e.matches?"dark":"light"),n.settings.visibility.theme!=="system"||At.check())return;const a=i=>{const t=document.querySelectorAll(`.${n.CSSClasses.calendar}`);t==null||t.forEach(r=>Ea(r,i.matches?"dark":"light"))};u.addEventListener?u.addEventListener("change",a):u.addListener(a),At.set()},dm=(n,u,e)=>{new MutationObserver(a=>{for(let i=0;i{const e=n.settings.visibility.themeDetect?document.querySelector(n.settings.visibility.themeDetect):null;if(!e)return void ds(n,u);const a=n.settings.visibility.themeDetect.replace(/^.*\[(.+)\]/g,(t,r)=>r),i=h1(e,a);i?(Ea(n.HTMLElement,i),dm(n,e,a)):ds(n,u)},Dm=n=>{if(!m1.includes(n.settings.visibility.theme))throw new Error(Oa.incorrectTheme);if(window.matchMedia("(prefers-color-scheme)").media==="not all")return void Ea(n.HTMLElement,"light");({light:()=>Ea(n.HTMLElement,"light"),dark:()=>Ea(n.HTMLElement,"dark"),system:()=>cm(n,window.matchMedia("(prefers-color-scheme: dark)"))})[n.settings.visibility.theme]()},fi=n=>{const u={default:()=>{Es(n),vt(n)},multiple:()=>{Es(n),vt(n)},month:()=>D1(n),year:()=>Vr(n)};Dm(n),nm(n),Gr(n),Wt(n),Or(n),lm(n),u[n.currentType]()},Fu={self:null,rangeMin:void 0,rangeMax:void 0},cs=()=>{var n;if(!((n=Fu.self)!=null&&n.HTMLElement))return;const{CSSClasses:u}=Fu.self;Fu.self.HTMLElement.querySelectorAll(`.${Fu.self.CSSClasses.dayBtnHover}`).forEach(e=>{var a;e.classList.remove(Fu.self.CSSClasses.dayBtnHover),(a=e.parentElement)==null||a.classList.remove(u.dayHoverIntermediate,u.dayHoverFirst,u.dayHoverLast)})},mm=(n,u,e)=>{var a,i,t;if(!((a=Fu.self)!=null&&a.selectedDates))return;const r=ce(n),{CSSClasses:o}=Fu.self;if((i=Fu.self.rangeDisabled)!=null&&i.includes(r))return;const s=(t=Fu.self.HTMLElement)==null?void 0:t.querySelectorAll(`[data-calendar-day="${r}"]`);s==null||s.forEach(l=>{var E;l.classList.add(o.dayBtnHover),(E=l.parentElement)==null||E.classList.add(o.dayHoverIntermediate)}),u==null||u.forEach(l=>{var E;return(E=l.parentElement)==null?void 0:E.classList.add(o.dayHoverFirst)}),e==null||e.forEach(l=>{var E;return(E=l.parentElement)==null?void 0:E.classList.add(o.dayHoverLast)})},ur=n=>{var u;if(!n.target||!((u=Fu.self)!=null&&u.selectedDates))return;if(!n.target.closest(`.${Fu.self.CSSClasses.days}`))return void cs();const e=n.target.closest("[data-calendar-day]");if(!e)return;const a=e.dataset.calendarDay,i=Gu(Fu.self.selectedDates[0]),t=Gu(a),r=Fu.self.HTMLElement.querySelectorAll(`[data-calendar-day="${Fu.self.selectedDates[0]}"]`),o=Fu.self.HTMLElement.querySelectorAll(`[data-calendar-day="${a}"]`),[s,l]=i{Fu.self&&n.key==="Escape"&&(Fu.self.selectedDates=[],Fu.self.HTMLElement.removeEventListener("mousemove",ur),document.removeEventListener("keydown",er),fi(Fu.self))},hm=()=>{var n,u,e;if(!((u=(n=Fu.self)==null?void 0:n.selectedDates)!=null&&u[0])||!Fu.self.rangeDisabled||((e=Fu.self.rangeDisabled)==null?void 0:e.length)<2)return;const a=Gu(Fu.self.selectedDates[0]),[i,t]=Fu.self.rangeDisabled.map(r=>Gu(r)).reduce(([r,o],s)=>[a>=s?s:r,a{Fu.self&&(Fu.self.rangeMin=Fu.rangeMin,Fu.self.rangeMax=Fu.rangeMax)},x1=(n,u)=>{var e;if(u){const a=n.selectedDates.length===1&&n.selectedDates[0].includes(u);n.selectedDates=a&&!n.settings.selection.cancelableDay?[u,u]:a&&n.settings.selection.cancelableDay?[]:n.selectedDates.length>1?[u]:[...n.selectedDates,u],(e=n.selectedDates)==null||e.sort((i,t)=>+new Date(i)-+new Date(t))}n.settings.range.disableGaps&&(Fu.rangeMin=Fu.rangeMin?Fu.rangeMin:n.rangeMin,Fu.rangeMax=Fu.rangeMax?Fu.rangeMax:n.rangeMax),Fu.self=n,{set:()=>{n.HTMLElement.addEventListener("mousemove",ur),document.addEventListener("keydown",er),n.settings.range.disableGaps&&hm()},reset:()=>{const[a,i]=[n.selectedDates[0],n.selectedDates[n.selectedDates.length-1]];n.selectedDates=n.selectedDates[0]!==n.selectedDates[n.selectedDates.length-1]?n.settings.range.edgesOnly?[a,i]:Na([`${a}:${i}`]):[n.selectedDates[0],n.selectedDates[0]],n.HTMLElement.removeEventListener("mousemove",ur),document.removeEventListener("keydown",er),n.settings.range.disableGaps&&xm()}}[n.selectedDates.length===1?"set":"reset"]()},Ds=(n,u,e)=>{if(!u.dataset.calendarDay)return;const a=u.dataset.calendarDay,i=u.classList.contains(n.CSSClasses.dayBtnSelected);if(i&&!n.settings.selection.cancelableDay)return;let t=!0;n.toggleSelected!==void 0&&(t=typeof n.toggleSelected=="function"?n.toggleSelected(n):n.toggleSelected),i&&!t||(n.selectedDates=i?n.selectedDates.filter(r=>r!==a):e?[...n.selectedDates,a]:[a])},gm=(n,u)=>{var e;const a=u.target,i=s=>a.closest(`.${s}`),t=i(n.CSSClasses.dayBtn);if(!n.settings.selection.day||!["single","multiple","multiple-ranged"].includes(n.settings.selection.day)||!t)return;({single:()=>Ds(n,t,!1),multiple:()=>Ds(n,t,!0),"multiple-ranged":()=>x1(n,t.dataset.calendarDay)})[n.settings.selection.day](),(e=n.selectedDates)==null||e.sort((s,l)=>+new Date(s)-+new Date(l)),n.actions.clickDay&&n.actions.clickDay(u,n),n.input&&n.HTMLInputElement&&n.HTMLElement&&n.actions.changeToInput&&n.actions.changeToInput(u,n);const r=i(n.CSSClasses.dayBtnPrev),o=i(n.CSSClasses.dayBtnNext);({prev:()=>Xn(n,"prev"),next:()=>Xn(n,"next"),default:()=>vt(n)})[r?"prev":o?"next":"default"]()},ms=(n,u,e,a,i)=>{const t=n.HTMLElement.querySelectorAll(`.${n.CSSClasses.column}`),r=Array.from(t).findIndex(s=>s.classList.contains(u)),o=Number(t[r].querySelector(`.${e}`).getAttribute(i));return n.currentType==="month"&&r>=0?a-r:n.currentType==="year"&&n.selectedYear!==o?a-1:a},Cm=(n,u,e,a,i)=>{const t={year:()=>{var r,o;return(o=(r=n.actions).clickYear)==null?void 0:o.call(r,u,n)},month:()=>{var r,o;return(o=(r=n.actions).clickMonth)==null?void 0:o.call(r,u,n)}};({year:()=>{if(n.type==="multiple"){const r=ms(n,n.CSSClasses.columnYear,n.CSSClasses.year,Number(i.dataset.calendarYear),"data-calendar-selected-year"),o=n.selectedMonthn.dateMax.getMonth()&&r>=n.dateMax.getFullYear(),l=rn.dateMax.getFullYear();o||l?(n.selectedYear=n.dateMin.getFullYear(),n.selectedMonth=n.dateMin.getMonth()):s||E?(n.selectedYear=n.dateMax.getFullYear(),n.selectedMonth=n.dateMax.getMonth()):n.selectedYear=r}else n.selectedYear=Number(i.dataset.calendarYear)},month:()=>{if(n.type==="multiple"){const r=ms(n,n.CSSClasses.columnMonth,n.CSSClasses.month,Number(i.dataset.calendarMonth),"data-calendar-selected-month"),o=i.closest(`.${a.column}`).querySelector(`.${n.CSSClasses.year}`);n.selectedYear=Number(o.dataset.calendarSelectedYear);const s=rn.dateMax.getMonth()&&n.selectedYear>=n.dateMax.getFullYear();n.selectedMonth=s?n.dateMin.getMonth():l?n.dateMax.getMonth():r}else n.selectedMonth=Number(i.dataset.calendarMonth)}})[e](),t[e](),n.currentType=n.type,fi(n)},hs=(n,u,e,a)=>{if(!n.settings.selection[e])return;const i=u.target,t=E=>i.closest(`.${E}`),r=t(a.header),o=t(a.item),s=t(n.CSSClasses.grid),l=t(n.CSSClasses.column);n.currentType!==e&&r?{year:()=>Vr(n,i),month:()=>D1(n,i)}[e]():o?Cm(n,u,e,a,o):(n.currentType===e&&r||n.type==="multiple"&&n.currentType===e&&s&&!l)&&(n.currentType=n.type,fi(n))},g1=n=>{const u=e=>{em(n,e),am(n,e),gm(n,e),hs(n,e,"month",{header:n.CSSClasses.month,item:n.CSSClasses.monthsMonth,column:n.CSSClasses.columnMonth}),hs(n,e,"year",{header:n.CSSClasses.year,item:n.CSSClasses.yearsYear,column:n.CSSClasses.columnYear})};return n.HTMLElement.addEventListener("click",u),()=>n.HTMLElement.removeEventListener("click",u)},C1=(n,{year:u,month:e,dates:a,holidays:i,time:t}={})=>{var r;const o=l1({},n.settings.selected);n.settings.selected.year=u?o.year:n.selectedYear,n.settings.selected.month=e?o.month:n.selectedMonth,n.settings.selected.holidays=i?o.holidays:n.selectedHolidays,n.settings.selected.time=t?o.time:n.selectedTime,n.settings.selected.dates=a==="only-first"&&((r=n.selectedDates)!=null&&r[0])?[n.selectedDates[0]]:a===!0?o.dates:n.selectedDates,E1(n),fi(n),n.settings.selected=o,n.settings.selection.day==="multiple-ranged"&&a&&x1(n)};function p1(n){if(!n||!n.getBoundingClientRect)return;const u=n.getBoundingClientRect(),e=document.documentElement;return{bottom:u.bottom,right:u.right,top:u.top+window.pageYOffset-e.clientTop,left:u.left+window.pageXOffset-e.clientLeft}}function pm(){return{left:window.pageXOffset||document.documentElement.scrollLeft||0,top:window.pageYOffset||document.documentElement.scrollTop||0}}function F1(){return{vw:Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),vh:Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)}}function Fm(n){var u,e;let a=0,i=0,t=0,r=0;const o=pm(),s=p1(n),{vh:l,vw:E}=F1(),d=o.top,c=o.left;if(s){const D=(u=s.top)!=null?u:0,m=(e=s.left)!=null?e:0;i=D-d,t=m-c,a=l-(D-d+n.clientHeight),r=E-(m-c+n.clientWidth)}return{top:i,bottom:a,left:t,right:r}}function km(n,u,e=5){const a={top:!0,bottom:!0,left:!0,right:!0},i=[];if(u&&n){const{bottom:t,top:r}=Fm(n),{top:o,left:s}=p1(n),{height:l,width:E}=u.getBoundingClientRect(),{vh:d,vw:c}=F1(),D={x:c/2,y:d/2};oD.y&&i.push("bottom"),sD.x&&i.push("right"),l>r-e&&(a.top=!1),l>t-e&&(a.bottom=!1),E>s&&(a.left=!1),c-s{if(n){const i=e==="auto"?vm(n,u):e,t={top:-u.offsetHeight,bottom:n.offsetHeight,left:0,center:n.offsetWidth/2-u.offsetWidth/2,right:n.offsetWidth-u.offsetWidth},r=Array.isArray(i)?i[0]:"bottom",o=Array.isArray(i)?i[1]:i;u.classList.add(r==="bottom"?a.calendarToInputBottom:a.calendarToInputTop);const s=n.getBoundingClientRect(),l=window.scrollX||document.documentElement.scrollLeft,E=window.scrollY||document.documentElement.scrollTop,d=s.top+E+t[r],c=s.left+l+t[o];Object.assign(u.style,{left:`${c}px`,top:`${d}px`})}},Am=n=>{let u=!0;const e=[];n.HTMLInputElement=n.HTMLElement;const a=()=>hn(n.HTMLInputElement,n.HTMLElement,n.settings.visibility.positionToInput,n.CSSClasses),i=t=>{var r;n&&t.target!==n.HTMLInputElement&&!((r=n.HTMLElement)!=null&&r.contains(t.target))&&(n.HTMLInputElement&&n.HTMLElement&&n.hide(),window.removeEventListener("resize",a),document.removeEventListener("click",i,{capture:!0}))};return n.HTMLInputElement.addEventListener("click",()=>{u?e.push((()=>{const t=document.createElement("div");return t.className=`${n.CSSClasses.calendar} ${n.CSSClasses.calendarToInput} ${n.CSSClasses.calendarHidden}`,n.HTMLElement=t,document.body.appendChild(n.HTMLElement),u=!1,setTimeout(()=>{hn(n.HTMLInputElement,t,n.settings.visibility.positionToInput,n.CSSClasses),n.show()},0),C1(n,{year:!0,month:!0,dates:!0,holidays:!0,time:!0}),n.actions.initCalendar&&n.actions.initCalendar(n),g1(n)})()):(hn(n.HTMLInputElement,n.HTMLElement,n.settings.visibility.positionToInput,n.CSSClasses),n.show()),window.addEventListener("resize",a),document.addEventListener("click",i,{capture:!0})}),()=>{e.forEach(t=>t())}},bm=n=>(n.HTMLOriginalElement=n.HTMLElement.cloneNode(!0),n.isInit=!0,n.input?Am(n):(E1(n),fi(n),n.actions.initCalendar&&n.actions.initCalendar(n),g1(n))),fm=(n,{year:u,month:e,dates:a,holidays:i,time:t}={})=>{if(!n.isInit)throw new Error(Oa.notInit);C1(n,{year:u,month:e,dates:a,holidays:i,time:t}),n.actions.updateCalendar&&n.actions.updateCalendar(n)},Bm=n=>{var u,e,a,i,t,r;if(!n.isInit)throw new Error(Oa.notInit);n.input?((e=(u=n.HTMLElement)==null?void 0:u.parentElement)==null||e.removeChild(n.HTMLElement),(i=(a=n.HTMLInputElement)==null?void 0:a.replaceWith)==null||i.call(a,n.HTMLOriginalElement),n.HTMLInputElement=void 0):(r=(t=n.HTMLElement)==null?void 0:t.replaceWith)==null||r.call(t,n.HTMLOriginalElement),n.HTMLElement=n.HTMLOriginalElement,n.actions.destroyCalendar&&n.actions.destroyCalendar(n)},ym=n=>{n.currentType?(n.HTMLElement.classList.remove(n.CSSClasses.calendarHidden),n.actions.showCalendar&&n.actions.showCalendar(n)):n.HTMLElement.click()},zm=n=>{n.currentType&&(n.HTMLElement.classList.add(n.CSSClasses.calendarHidden),n.actions.hideCalendar&&n.actions.hideCalendar(n))};function ar(n,...u){const e=i=>i&&typeof i=="object"&&!Array.isArray(i);if(!u.length)return n;const a=u.shift();return e(n)&&e(a)&&Object.keys(a).forEach(i=>{e(a[i])?(n[i]||Object.assign(n,{[i]:{}}),ar(n[i],a[i])):Object.assign(n,{[i]:a[i]})}),ar(n,...u)}function Sm(n,u,e){n.settings=ar(n.settings,{[u]:e})}class k1 extends AD{constructor(u,e){if(super(),xu(this,"init",()=>bm(this)),xu(this,"update",i=>fm(this,i)),xu(this,"destroy",()=>Bm(this)),xu(this,"show",()=>ym(this)),xu(this,"hide",()=>zm(this)),xu(this,"changeSetting",(i,t)=>Sm(this,i,t)),this.HTMLElement=typeof u=="string"?document.querySelector(u):u,!this.HTMLElement)throw new Error(Oa.notFoundSelector(u));if(!e)return;const a=(i,t)=>{Object.keys(t).forEach(r=>{typeof i[r]!="object"||typeof t[r]!="object"||t[r]instanceof Date?i[r]=t[r]:a(i[r],t[r])})};a(this,e)}}class v1{constructor(u){this.translaterService=u,this._clearFilterTriggered=!1,this._lastClickIsDate=!1,this._shouldTriggerQuery=!0,this.hasTimePicker=!1,this.inputFilterType="range",this.searchTerms=[],this._bindEventService=new vu}get gridOptions(){var u;return((u=this.grid)==null?void 0:u.getOptions())??{}}get columnFilter(){var u;return((u=this.columnDef)==null?void 0:u.filter)||{}}get currentDateOrDates(){return this._currentDateOrDates}get defaultOperator(){return this.inputFilterType==="compound"?P.empty:this.gridOptions.defaultFilterRangeOperator||P.rangeInclusive}get pickerOptions(){return this._pickerOptions||{}}get filterOptions(){var u,e;return{...(u=this.gridOptions.defaultFilterOptions)==null?void 0:u.date,...(e=this.columnFilter)==null?void 0:e.filterOptions}}get operator(){var u;return this.inputFilterType==="compound"?this._operator||this.columnFilter.operator||this.defaultOperator:((u=this.columnFilter)==null?void 0:u.operator)??this.defaultOperator}set operator(u){this.inputFilterType==="compound"?this._operator=u:this.columnFilter&&(this.columnFilter.operator=u)}init(u){if(!u)throw new Error('[Slickgrid-Universal] A filter must always have an "init()" with valid arguments.');this.grid=u.grid,this.callback=u.callback,this.columnDef=u.columnDef,this.inputFilterType==="compound"&&(this.operator=u.operator||""),this.searchTerms=(u==null?void 0:u.searchTerms)??[],this.filterContainerElm=u.filterContainerElm;const e=this.inputFilterType==="compound"?Array.isArray(this.searchTerms)&&this.searchTerms.length>=0?this.searchTerms[0]:"":this.searchTerms;this._filterElm=this.createDomFilterElement(e),this.searchTerms.length&&this._filterElm.classList.add("filled"),this._selectOperatorElm&&this._bindEventService.bind(this._selectOperatorElm,"change",this.onTriggerEvent.bind(this)),this._bindEventService.bind(document.body,"keydown",a=>{(a.key==="Escape"||a.key==="Tab")&&this.hide()}),this._bindEventService.bind(this._dateInputElm,"keydown",a=>{a.key==="Backspace"&&this.clear(!0)})}clear(u=!0){this.calendarInstance&&(this._clearFilterTriggered=!0,this._shouldTriggerQuery=u,this.searchTerms=[],this._selectOperatorElm&&(this._selectOperatorElm.selectedIndex=0),this.calendarInstance.input&&(this.calendarInstance.settings.selected.dates=[],this._dateInputElm.value="")),this.onTriggerEvent(new Event("keyup")),this._filterElm.classList.remove("filled")}destroy(){var u,e,a,i;this._bindEventService.unbindAll(),(u=this.calendarInstance)==null||u.destroy(),bu(this.filterContainerElm),(e=this.filterContainerElm)==null||e.remove(),(a=this._selectOperatorElm)==null||a.remove(),(i=this._filterElm)==null||i.remove()}hide(){var u;typeof((u=this.calendarInstance)==null?void 0:u.hide)=="function"&&this.calendarInstance.hide()}show(){var u;typeof((u=this.calendarInstance)==null?void 0:u.show)=="function"&&this.calendarInstance.show()}getValues(){return this._currentDateOrDates}setValues(u,e){let a;this.inputFilterType==="compound"?a=Array.isArray(u)?u[0]:u:typeof u=="string"||Array.isArray(u)&&typeof u[0]=="string"&&u[0].indexOf("..")>0?a=typeof u=="string"?[u]:u[0].split(".."):Array.isArray(u)&&(a=u),this.calendarInstance&&a!==void 0&&(kt(this._dateInputElm,this.calendarInstance,a,this.columnDef,this.columnFilter),this._currentDateOrDates=u&&a?a:void 0);const i=this.getValues()||[];if(this.getValues()||Array.isArray(i)&&i.length>0&&u?this._filterElm.classList.add("filled"):this._filterElm.classList.remove("filled"),this.operator=e||this.defaultOperator,e&&this._selectOperatorElm){const t=ja(this.operator);this._selectOperatorElm.value=t}}buildDatePickerInput(u){var c,D,m,h,x,g,F,C,A,b,y;const e=((c=this.columnDef)==null?void 0:c.id)??"",a=this.columnFilter.type||this.columnDef.type||p.dateIso,i=this.columnDef.outputType||this.columnFilter.type||this.columnDef.type||p.dateUtc,t=$0(i),r=this.columnFilter.type||this.columnDef.type||p.dateIso;t&&this.inputFilterType!=="range"&&(t==="ISO8601"||t.toLowerCase().includes("h"))&&(this.hasTimePicker=!0);const o=$0(this.hasTimePicker?p.dateTimeIsoAM_PM:p.dateIso),s=(((D=this.filterOptions)==null?void 0:D.locale)??((h=(m=this.translaterService)==null?void 0:m.getCurrentLanguage)==null?void 0:h.call(m)))||this.gridOptions.locale||"en";let l;this.inputFilterType==="compound"?u&&(l=u,this._currentDateOrDates=u):(typeof u=="string"||Array.isArray(u)&&typeof u[0]=="string"&&u[0].indexOf("..")>0?l=typeof u=="string"?[u]:u[0].split(".."):Array.isArray(u)&&(l=u),Array.isArray(l)&&(this._currentDateOrDates=l,this._currentDateStrings=l.map(S=>le(S,void 0,r))));const E={input:!0,jumpToSelectedDate:!0,type:this.inputFilterType==="range"?"multiple":"default",sanitizer:S=>this.grid.sanitizeHtmlString(S),toggleSelected:!1,actions:{clickDay:S=>{this._lastClickIsDate=!0},changeToInput:(S,z)=>{if(z.HTMLInputElement){let M=[],w="",R="";if(z.selectedDates[1]){z.selectedDates.sort((Y,lu)=>+new Date(Y)-+new Date(lu)),w=z.selectedDates[0],R=z.selectedDates[z.selectedDates.length-1];const G=l0(z.selectedDates[0],t,"en-US"),L=l0(R,t,"en-US");z.HTMLInputElement.value=`${G} — ${L}`,M=[w,R]}else z.selectedDates[0]?(w=z.selectedDates[0],z.HTMLInputElement.value=le(w,p.dateIso,i),M=z.selectedDates):z.HTMLInputElement.value="";if(this.hasTimePicker&&w){const G=pt(w,o);G.setHours(+(z.selectedHours||0)),G.setMinutes(+(z.selectedMinutes||0)),z.HTMLInputElement.value=le(G,void 0,i),M=[G]}if(this.inputFilterType==="compound"?this._currentValue=le(M[0],void 0,a):Array.isArray(M)&&(this._currentDateStrings=M.map(G=>le(G,void 0,a)),this._currentValue=this._currentDateStrings.join("..")),this._currentDateOrDates=M.map(G=>G instanceof Date?G:pt(G,o)),this._currentValue){const G=this.hasTimePicker?new Event("keyup"):void 0;this.onTriggerEvent(G)}this.inputFilterType==="range"&&z.selectedDates.length<2&&(this._lastClickIsDate=!1),this._lastClickIsDate&&(z.hide(),this._lastClickIsDate=!1)}}},settings:{lang:s,iso8601:!1,visibility:{theme:(x=this.gridOptions)!=null&&x.darkMode?"dark":"light",positionToInput:"auto",weekend:!1}}};this.inputFilterType==="range"&&(E.type="multiple",E.months=2,E.jumpMonths=2,E.settings={...E.settings,range:{edgesOnly:!0},selection:{day:"multiple-ranged"},visibility:{...(g=E.settings)==null?void 0:g.visibility,daysOutside:!1}}),this.hasTimePicker&&((F=E.settings).selection??(F.selection={}),E.settings.selection.time=24),this._pickerOptions=wu(!0,{},E,{settings:this.filterOptions});let d=((C=this.gridOptions)==null?void 0:C.defaultFilterPlaceholder)??"";(A=this.columnFilter)!=null&&A.placeholder&&(d=this.columnFilter.placeholder),this._dateInputElm=v("input",{type:"text",className:"form-control date-picker",placeholder:d,readOnly:!0,dataset:{input:"",columnid:`${e}`}}),this.calendarInstance=new k1(this._dateInputElm,this._pickerOptions),this.calendarInstance.init(),(y=(b=this._pickerOptions.settings)==null?void 0:b.selected)!=null&&y.dates&&(l=this._pickerOptions.settings.selected.dates),l&&kt(this._dateInputElm,E,l,this.columnDef,this.columnFilter)}getOperatorOptionValues(){var u;return(u=this.columnFilter)!=null&&u.compoundOperatorList?this.columnFilter.compoundOperatorList:Hr(this.gridOptions,this.translaterService)}createDomFilterElement(u){var a;const e=((a=this.columnDef)==null?void 0:a.id)??"";if(bu(this.filterContainerElm),this.buildDatePickerInput(u),this.inputFilterType==="range"){const i=v("div",{className:`date-picker form-group search-filter filter-${e}`});return Array.isArray(u)&&u.length>0&&u[0]!==""&&(this._currentDateOrDates=u,this._currentValue=u[0]),i.appendChild(this._dateInputElm),i&&this.filterContainerElm.appendChild(i),i}else{this._selectOperatorElm=Kr(this.getOperatorOptionValues(),this.grid);const i=v("div",{className:`date-picker form-group search-filter filter-${e}`}),t=v("div",{className:"input-group date-picker"},i);if(v("div",{className:"input-group-addon input-group-prepend operator"},t).appendChild(this._selectOperatorElm),t.appendChild(this._dateInputElm),this.operator){const o=ja(this.operator);this._selectOperatorElm.value=o}return this._currentDateOrDates=u,this._currentValue=u,i&&this.filterContainerElm.appendChild(i),i}}onTriggerEvent(u){if(this._clearFilterTriggered)this.callback(u,{columnDef:this.columnDef,clearFilterTriggered:this._clearFilterTriggered,shouldTriggerQuery:this._shouldTriggerQuery}),this._filterElm.classList.remove("filled");else if(this.inputFilterType==="range")this._currentDateStrings?this._filterElm.classList.add("filled"):this._filterElm.classList.remove("filled"),this.callback(u,{columnDef:this.columnDef,searchTerms:this._currentDateStrings?this._currentDateStrings:[this._currentValue],operator:this.operator||"",shouldTriggerQuery:this._shouldTriggerQuery});else if(this.inputFilterType==="compound"&&this._selectOperatorElm){const e=this._selectOperatorElm.value;this._currentValue?this._filterElm.classList.add("filled"):this._filterElm.classList.remove("filled"),(!(this.columnFilter.skipCompoundOperatorFilterWithNullInput??this.gridOptions.skipCompoundOperatorFilterWithNullInput??this.gridOptions.skipCompoundOperatorFilterWithNullInput===void 0)||this._currentDateOrDates!==void 0)&&this.callback(u,{columnDef:this.columnDef,searchTerms:this._currentValue?[this._currentValue]:null,operator:e||"",shouldTriggerQuery:this._shouldTriggerQuery})}this._clearFilterTriggered=!1,this._shouldTriggerQuery=!0}}class wm extends v1{constructor(u){super(u),this.translaterService=u,this.inputFilterType="compound"}}class A1{constructor(u){this.translaterService=u}filterCollection(u,e,a=Sa.chain){let i=[];return Array.isArray(e)?(i=a===Sa.merge?[]:[...u],e.forEach(t=>{if(a===Sa.merge){const r=this.singleFilterCollection(u,t);i=Ul([...i,...r])}else i=this.singleFilterCollection(i,t)})):i=this.singleFilterCollection(u,e),i}singleFilterCollection(u,e){let a=[];if(e){const i=e.property,t=e.operator||P.equal,r=typeof e.value>"u"?"":e.value;switch(t){case P.equal:i?a=u.filter(o=>o[i]===r):a=u.filter(o=>o===r);break;case P.contains:i?a=u.filter(o=>{var s;return((s=o[i])==null?void 0:s.toString().indexOf(r.toString()))!==-1}):a=u.filter(o=>o!=null&&o.toString().indexOf(r.toString())!==-1);break;case P.notContains:i?a=u.filter(o=>{var s;return((s=o[i])==null?void 0:s.toString().indexOf(r.toString()))===-1}):a=u.filter(o=>o!=null&&o.toString().indexOf(r.toString())===-1);break;case P.notEqual:default:i?a=u.filter(o=>o[i]!==r):a=u.filter(o=>o!==r)}}return a}sortCollection(u,e,a,i){if(i&&(!this.translaterService||!this.translaterService.translate))throw new Error('[Slickgrid-Universal] requires a Translate Service to be installed and configured when the grid option "enableTranslate" is enabled.');let t=[];if(a){if(Array.isArray(a))t=e.sort((r,o)=>{var s,l;for(let E=0,d=a.length;E{var m,h;const d=i?((m=this.translaterService)==null?void 0:m.translate)&&this.translaterService.translate(l[r]||" "):l[r],c=i?((h=this.translaterService)==null?void 0:h.translate)&&this.translaterService.translate(E[r]||" "):E[r],D=Ma(s,d,c,o,u);return D!==ju.neutral?D:ju.neutral})}else if(a&&!a.property){const r=a.sortDesc?ju.desc:ju.asc,o=(a==null?void 0:a.fieldType)??(u==null?void 0:u.type)??p.string;t=e.sort((s,l)=>{var D,m;const E=i?((D=this.translaterService)==null?void 0:D.translate)&&this.translaterService.translate(s||" "):s,d=i?((m=this.translaterService)==null?void 0:m.translate)&&this.translaterService.translate(l||" "):l,c=Ma(o,E,d,r,u);return c!==ju.neutral?c:ju.neutral})}}return t}}function b1(n,u,e,a,i=!1,t,r){var z,M,w,R,G;const o=(e==null?void 0:e.id)??"",s=a.getOptions(),l=(n==="editor"?e==null?void 0:e.editor:e==null?void 0:e.filter)??{},E=(l==null?void 0:l.collectionOptions)??{},d=(E==null?void 0:E.separatorBetweenTextLabels)??"",c=(l==null?void 0:l.enableTranslateLabel)??!1,D=(s==null?void 0:s.enableTranslate)??!1,m=(l==null?void 0:l.enableRenderHtml)??!1,h=((z=l==null?void 0:l.customStructure)==null?void 0:z.label)??"label",x=((M=l==null?void 0:l.customStructure)==null?void 0:M.labelPrefix)??"labelPrefix",g=((w=l==null?void 0:l.customStructure)==null?void 0:w.labelSuffix)??"labelSuffix",F=((R=l==null?void 0:l.customStructure)==null?void 0:R.optionLabel)??"value",C=((G=l==null?void 0:l.customStructure)==null?void 0:G.value)??"value",A=v("select",{className:"ms-filter search-filter"}),b=n==="filter"?["search-filter",`filter-${o}`]:["select-editor",`editor-${o}`];A.classList.add(...b),A.multiple=i;const y=[];let S=!1;return Array.isArray(u)&&(u.every(L=>typeof L=="number"||typeof L=="string")?u.forEach(L=>{const Y={text:L,value:L};n==="filter"&&Array.isArray(r)&&(Y.selected=r.findIndex(lu=>lu===L)>=0),y.push(Y),(Y.selected&&i||Y.selected&&!i&&L!=="")&&(S=!0)}):u.forEach(L=>{if(L===void 0||typeof L=="object"&&L[h]===void 0&&L.labelKey===void 0)throw new Error("[Slickgrid-Universal] Select Filter/Editor collection with value/label (or value/labelKey when using Locale) is required to populate the Select list, for example:: { filter: model: Filters.multipleSelect, collection: [ { value: '1', label: 'One' } ]')");const Y=L.labelKey||L[h],lu=(L.labelKey||c&&t)&&Y&&D?t==null?void 0:t.translate(Y||" "):Y;let hu=L[x]||"",Eu=L[g]||"",du=L.hasOwnProperty(F)?L[F]:"";du!=null&&du.toString&&(du=du.toString().replace(/"/g,"'")),hu=c&&t&&hu&&typeof hu=="string"?t.translate(hu||" "):hu,Eu=c&&t&&Eu&&typeof Eu=="string"?t.translate(Eu||" "):Eu,du=c&&t&&du&&typeof du=="string"?t.translate(du||" "):du;let Au=[hu,typeof lu=="string"||typeof lu=="number"?lu.toString():lu,Eu].filter(Lu=>Lu).join(d);const mu={text:"",value:""};m&&(Au=a.sanitizeHtmlString(Au)),mu.text=Au;let au=L[C];au==null&&(au=""),n==="filter"&&Array.isArray(r)&&(mu.selected=r.findIndex(Lu=>`${Lu}`==`${L[C]}`)>=0),mu.value=`${au??""}`,y.push(mu),(mu.selected&&i||mu.selected&&!i&&L[C]!=="")&&(S=!0)})),{selectElement:A,dataCollection:y,hasFoundSearchTerm:S}}class Mm{constructor(u,e,a){this.sharedService=u,this.backendUtilities=e,this.translaterService=a}getPickerTitleOutputString(u,e){var d,c,D,m,h,x,g,F,C,A,b,y,S,z;if((d=this.sharedService.gridOptions)!=null&&d.enableTranslate&&!((c=this.translaterService)!=null&&c.translate))throw new Error('[Slickgrid-Universal] requires a Translate Service to be installed and configured when the grid option "enableTranslate" is enabled.');let a="";const i=((D=this.sharedService.gridOptions)==null?void 0:D[e])??{},t=((m=this.sharedService.gridOptions)==null?void 0:m.enableTranslate)??!1,r=((h=this.sharedService.gridOptions)==null?void 0:h.locales)??T.locales,o=i==null?void 0:i[u],s=i==null?void 0:i[`${u}Key`],l=this.sharedService.gridOptions,E=Q0(l);if(s&&((x=this.translaterService)!=null&&x.translate))a=this.translaterService.translate(s||" ");else switch(u){case"commandTitle":a=o||t&&((g=this.translaterService)==null?void 0:g.getCurrentLanguage)&&((F=this.translaterService)==null?void 0:F.translate(`${E}COMMANDS`))||(r==null?void 0:r.TEXT_COMMANDS);break;case"columnTitle":a=o||t&&((C=this.translaterService)==null?void 0:C.getCurrentLanguage)&&((A=this.translaterService)==null?void 0:A.translate(`${E}COLUMNS`))||(r==null?void 0:r.TEXT_COLUMNS);break;case"forceFitTitle":a=o||t&&((b=this.translaterService)==null?void 0:b.getCurrentLanguage)&&((y=this.translaterService)==null?void 0:y.translate(`${E}FORCE_FIT_COLUMNS`))||(r==null?void 0:r.TEXT_FORCE_FIT_COLUMNS);break;case"syncResizeTitle":a=o||t&&((S=this.translaterService)==null?void 0:S.getCurrentLanguage)&&((z=this.translaterService)==null?void 0:z.translate(`${E}SYNCHRONOUS_RESIZE`))||(r==null?void 0:r.TEXT_SYNCHRONOUS_RESIZE);break;default:a=o;break}return a}readjustFrozenColumnIndexWhenNeeded(u,e,a){if(u>=0){const i=a.findIndex(t=>t.id===this.sharedService.frozenVisibleColumnId);i>=0&&i!==u&&(this.sharedService.gridOptions.frozenColumn=i,this.sharedService.slickGrid.setOptions({frozenColumn:i})),Array.isArray(a)&&Array.isArray(e)&&a.length!==e.length&&this.sharedService.slickGrid.setColumns(a)}}refreshBackendDataset(u){var a;let e=this.sharedService.gridOptions;u&&(e={...this.sharedService.gridOptions,...u},this.sharedService.gridOptions=e),(a=this.backendUtilities)==null||a.refreshBackendDataset(e)}runOverrideFunctionWhenExists(u,e){return typeof u=="function"?!!u.call(this,e):!0}sortItems(u,e){Array.isArray(u)&&u.sort((a,i)=>a&&i&&a.hasOwnProperty(e)&&i.hasOwnProperty(e)?a[e]-i[e]:0)}translateItems(u,e,a){var i,t;if(Array.isArray(u))for(const r of u)r.hasOwnProperty(e)&&(r[a]=(t=(i=this.translaterService)==null?void 0:i.translate)==null?void 0:t.call(i,r[e]))}translateMenuItemsFromTitleKey(u,e="commandItems"){for(const a of u)typeof a=="object"&&(a.titleKey&&(a.title=this.translateWhenEnabledAndServiceExist(`${a.titleKey}`,`TEXT_${a.titleKey}`)),a.subMenuTitleKey&&(a.subMenuTitle=this.translateWhenEnabledAndServiceExist(`${a.subMenuTitleKey}`,`TEXT_${a.subMenuTitleKey}`))),Array.isArray(a==null?void 0:a[e])&&this.translateMenuItemsFromTitleKey(a==null?void 0:a[e])}translateWhenEnabledAndServiceExist(u,e,a){var o,s;let i="";const t=(o=this.sharedService)==null?void 0:o.gridOptions,r=(t==null?void 0:t.locales)??T.locales;return a?i=a:t.enableTranslate&&((s=this.translaterService)!=null&&s.translate)?i=this.translaterService.translate(u||" "):e in r?i=r[e]:i=e,i}}class Pu{get defaultPrevented(){return this._isDefaultPrevented}constructor(u,e){this.event=u,this.args=e,this._isPropagationStopped=!1,this._isImmediatePropagationStopped=!1,this._isDefaultPrevented=!1,this.returnValue=void 0,this.nativeEvent=u,this._arguments=e,u&&["altKey","ctrlKey","metaKey","shiftKey","key","keyCode","clientX","clientY","offsetX","offsetY","pageX","pageY","bubbles","target","type","which","x","y"].forEach(a=>this[a]=u[a]),this._eventTarget=this.nativeEvent?this.nativeEvent.target:void 0}stopPropagation(){var u;this._isPropagationStopped=!0,(u=this.nativeEvent)==null||u.stopPropagation()}isPropagationStopped(){return this._isPropagationStopped}stopImmediatePropagation(){this._isImmediatePropagationStopped=!0,this.nativeEvent&&this.nativeEvent.stopImmediatePropagation()}isImmediatePropagationStopped(){return this._isImmediatePropagationStopped}getNativeEvent(){return this.nativeEvent}preventDefault(){this.nativeEvent&&this.nativeEvent.preventDefault(),this._isDefaultPrevented=!0}isDefaultPrevented(){return this.nativeEvent?this.nativeEvent.defaultPrevented:this._isDefaultPrevented}addReturnValue(u){this.returnValue===void 0&&u!==void 0&&(this.returnValue=u)}getReturnValue(){return this.returnValue}getArguments(){return this._arguments}resetReturnValue(){this.returnValue=void 0}}class N{get subscriberCount(){return this._handlers.length}constructor(u,e){this.eventName=u,this.pubSub=e,this._handlers=[],this._pubSubService=e}subscribe(u){this._handlers.push(u)}unsubscribe(u){for(let e=this._handlers.length-1;e>=0;e--)this._handlers[e]===u&&this._handlers.splice(e,1)}notify(u,e,a,i=!1){var r;const t=e instanceof Pu?e:new Pu(e,u);i&&t.resetReturnValue(),a=a||this;for(let o=0;ot.nativeEvent??(t.nativeEvent=s));t.addReturnValue(o)}return t}setPubSubService(u){this._pubSubService=u}}class Tu{constructor(){this.handlers=[]}get subscriberCount(){return this.handlers.length}subscribe(u,e){return this.handlers.push({event:u,handler:e}),u.subscribe(e),this}unsubscribe(u,e){let a=this.handlers.length;for(;a--;)if(this.handlers[a].event===u&&this.handlers[a].handler===e){this.handlers.splice(a,1),u.unsubscribe(e);return}return this}unsubscribeAll(){let u=this.handlers.length;for(;u--;)this.handlers[u].event.unsubscribe(this.handlers[u].handler);return this.handlers=[],this}}class V0{constructor(u,e,a,i){a===void 0&&i===void 0&&(a=u,i=e),this.fromRow=Math.min(u,a),this.fromCell=Math.min(e,i),this.toRow=Math.max(u,a),this.toCell=Math.max(e,i)}isSingleCell(){return this.fromRow===this.toRow&&this.fromCell===this.toCell}isSingleRow(){return this.fromRow===this.toRow}contains(u,e){return u>=this.fromRow&&u<=this.toRow&&e>=this.fromCell&&e<=this.toCell}toString(){return this.isSingleCell()?`(${this.fromRow}:${this.fromCell})`:`(${this.fromRow}:${this.fromCell} - ${this.toRow}:${this.toCell})`}}class f1{constructor(){this.__nonDataRow=!0}}class bt extends f1{constructor(){super(),this.__group=!0,this.level=0,this.count=0,this.value=null,this.title=null,this.collapsed=!1,this.selectChecked=!1,this.totals=null,this.rows=[],this.groups=null,this.groupingKey=""}equals(u){return this.value===u.value&&this.count===u.count&&this.collapsed===u.collapsed&&this.title===u.title}}class Tm extends f1{constructor(){super(),this.__groupTotals=!0,this.group=null,this.initialized=!1}}class _m{constructor(){this.activeEditController=null}isActive(u){return u?this.activeEditController===u:this.activeEditController!==null}activate(u){if(u!==this.activeEditController){if(this.activeEditController!==null)throw new Error("SlickEditorLock.activate: an editController is still active, can't activate another editController");if(!u.commitCurrentEdit)throw new Error("SlickEditorLock.activate: editController must implement .commitCurrentEdit()");if(!u.cancelCurrentEdit)throw new Error("SlickEditorLock.activate: editController must implement .cancelCurrentEdit()");this.activeEditController=u}}deactivate(u){if(this.activeEditController){if(this.activeEditController!==u)throw new Error("SlickEditorLock.deactivate: specified editController is not the currently active one");this.activeEditController=null}}commitCurrentEdit(){return this.activeEditController?this.activeEditController.commitCurrentEdit():!0}cancelCurrentEdit(){return this.activeEditController?this.activeEditController.cancelCurrentEdit():!0}}class B{static height(u,e){if(u){if(e===void 0)return u.getBoundingClientRect().height;B.setStyleSize(u,"height",e)}}static width(u,e){if(!(!u||!u.getBoundingClientRect)){if(e===void 0)return u.getBoundingClientRect().width;B.setStyleSize(u,"width",e)}}static setStyleSize(u,e,a){typeof a=="function"&&(a=a()),u.style[e]=typeof a=="string"?a:`${a}px`}static isHidden(u){return u.offsetWidth===0&&u.offsetHeight===0}static parents(u,e){const a=[],i=e===":visible",t=e===":hidden";for(;(u=u.parentNode)&&u!==document&&!(!u||!u.parentNode);)t?B.isHidden(u)&&a.push(u):i?B.isHidden(u)||a.push(u):(!e||u.matches(e))&&a.push(u);return a}static toFloat(u){const e=parseFloat(u);return isNaN(e)?0:e}static show(u,e=""){Array.isArray(u)?u.forEach(a=>a.style.display=e):u.style.display=e}static hide(u){Array.isArray(u)?u.forEach(e=>e.style.display="none"):u.style.display="none"}static applyDefaults(u,e){typeof e=="object"&&Object.keys(e).forEach(a=>{e.hasOwnProperty(a)&&!u.hasOwnProperty(a)&&(u[a]=e[a])})}static addSlickEventPubSubWhenDefined(u,e){if(u)for(const a in e)e[a]instanceof N&&typeof e[a].setPubSubService=="function"&&e[a].setPubSubService(u)}}B.storage={_storage:new WeakMap,put:function(n,u,e){this._storage.has(n)||this._storage.set(n,new Map),this._storage.get(n).set(u,e)},get:function(n,u){const e=this._storage.get(n);return e?e.get(u):null},remove:function(n,u){const e=this._storage.get(n).delete(u);return this._storage.get(n).size!==0&&this._storage.delete(n),e}};const Z0=new _m,Pm="slick-edit-preclick";class B1{constructor(u){this.pluginName="GroupItemMetadataProvider",this._defaults={groupCssClass:"slick-group",groupTitleCssClass:"slick-group-title",totalsCssClass:"slick-group-totals",groupFocusable:!0,indentation:15,totalsFocusable:!1,toggleCssClass:"slick-group-toggle",toggleExpandedCssClass:"expanded",toggleCollapsedCssClass:"collapsed",enableExpandCollapse:!0,groupFormatter:this.defaultGroupCellFormatter.bind(this),totalsFormatter:this.defaultTotalsCellFormatter.bind(this),includeHeaderTotals:!1},this._eventHandler=new Tu,this._options=wu(!0,{},this._defaults,u)}get eventHandler(){return this._eventHandler}get dataView(){var u;return((u=this._grid)==null?void 0:u.getData())??{}}get gridOptions(){var u;return((u=this._grid)==null?void 0:u.getOptions())||{}}init(u,e){this._grid=u,this._options={...this._defaults,...e},this._eventHandler.subscribe(u.onClick,this.handleGridClick.bind(this)),this._eventHandler.subscribe(u.onKeyDown,this.handleGridKeyDown.bind(this))}destroy(){this.dispose()}dispose(){var u;(u=this._eventHandler)==null||u.unsubscribeAll()}getOptions(){return this._options}setOptions(u){this._options={...this._options,...u}}getGroupRowMetadata(u){return{selectable:!1,focusable:this._options.groupFocusable,cssClasses:`${this._options.groupCssClass} slick-group-level-${(u==null?void 0:u.level)||0}`,formatter:this._options.includeHeaderTotals&&this._options.totalsFormatter||void 0,columns:{0:{colspan:this._options.includeHeaderTotals?"1":"*",formatter:this._options.groupFormatter,editorClass:null}}}}getTotalsRowMetadata(u){var e;return{selectable:!1,focusable:this._options.totalsFocusable,cssClasses:`${this._options.totalsCssClass} slick-group-level-${((e=u==null?void 0:u.group)==null?void 0:e.level)||0}`,formatter:this._options.totalsFormatter,editorClass:null}}defaultGroupCellFormatter(u,e,a,i,t){var c,D;if(!this._options.enableExpandCollapse)return t.title;const r=t.level||0,o=((c=this._options)==null?void 0:c.indentation)??15,s=`${r*o}px`,l=t.collapsed?this._options.toggleCollapsedCssClass:this._options.toggleExpandedCssClass,E=(D=this.gridOptions)!=null&&D.preventDocumentFragmentUsage?document.createElement("span"):new DocumentFragment;E.appendChild(v("span",{className:`${this._options.toggleCssClass} ${l}`,ariaExpanded:String(!t.collapsed),style:{marginLeft:s}}));const d=v("span",{className:this._options.groupTitleCssClass||""});return d.setAttribute("level",r),t.title instanceof HTMLElement||t.title instanceof DocumentFragment?d.appendChild(t.title):this._grid.applyHtmlCode(d,t.title??""),E.appendChild(d),E}defaultTotalsCellFormatter(u,e,a,i,t,r){var o;return((o=i==null?void 0:i.groupTotalsFormatter)==null?void 0:o.call(i,t,i,r))??""}handleGridClick(u,e){var t;const a=u.target,i=(t=this._grid)==null?void 0:t.getDataItem(e.row);i instanceof bt&&a.classList.contains(this._options.toggleCssClass||"")&&(this.handleDataViewExpandOrCollapse(i),u.stopImmediatePropagation(),u.preventDefault())}handleGridKeyDown(u){var e;if(this._options.enableExpandCollapse&&u.key===" "){const a=(e=this._grid)==null?void 0:e.getActiveCell();if(a){const i=this._grid.getDataItem(a.row);i instanceof bt&&(this.handleDataViewExpandOrCollapse(i),u.stopImmediatePropagation(),u.preventDefault())}}}handleDataViewExpandOrCollapse(u){var a;const e=(a=this._grid)==null?void 0:a.getRenderedRange();this.dataView.setRefreshHints({ignoreDiffsBefore:e.top,ignoreDiffsAfter:e.bottom+1}),u.collapsed?this.dataView.expandGroup(u.groupingKey):this.dataView.collapseGroup(u.groupingKey)}}class jm{constructor(u,e){this.externalPubSub=e,this.defaults={groupItemMetadataProvider:null,inlineFilters:!1,useCSPSafeFilter:!1},this.idProperty="id",this.items=[],this.rows=[],this.idxById=new Map,this.rowsById=void 0,this.filter=null,this.filterCSPSafe=null,this.updated=null,this.suspend=!1,this.isBulkSuspend=!1,this.bulkDeleteIds=new Map,this.sortAsc=!0,this.refreshHints={},this.prevRefreshHints={},this.filteredItems=[],this.filterCache=[],this.groupingInfoDefaults={getter:void 0,formatter:void 0,comparer:(a,i)=>a.value===i.value?0:a.value>i.value?1:-1,predefinedValues:[],aggregators:[],aggregateEmpty:!1,aggregateCollapsed:!1,aggregateChildGroups:!1,collapsed:!1,displayTotalsRow:!0,lazyTotalsCalculation:!1},this.groupingInfos=[],this.groups=[],this.toggledGroupsByLevel=[],this.groupingDelimiter=":|:",this.selectedRowIds=[],this.pagesize=0,this.pagenum=0,this.totalRows=0,this.onBeforePagingInfoChanged=new N("onBeforePagingInfoChanged",e),this.onGroupExpanded=new N("onGroupExpanded",e),this.onGroupCollapsed=new N("onGroupCollapsed",e),this.onPagingInfoChanged=new N("onPagingInfoChanged",e),this.onRowCountChanged=new N("onRowCountChanged",e),this.onRowsChanged=new N("onRowsChanged",e),this.onRowsOrCountChanged=new N("onRowsOrCountChanged",e),this.onSelectedRowIdsChanged=new N("onSelectedRowIdsChanged",e),this.onSetItemsCalled=new N("onSetItemsCalled",e),this._options=wu(!0,{},this.defaults,u)}beginUpdate(u){this.suspend=!0,this.isBulkSuspend=u===!0}endUpdate(){const u=this.isBulkSuspend;this.isBulkSuspend=!1,this.suspend=!1,u&&(this.processBulkDelete(),this.ensureIdUniqueness()),this.refresh()}destroy(){var u,e,a;this.items=[],this.idProperty="id",this.idxById=null,this.rowsById=null,this.filter=null,this.filterCSPSafe=null,this.updated=null,this.sortComparer=null,this.filterCache=[],this.filteredItems=[],this.compiledFilter=null,this.compiledFilterCSPSafe=null,this.compiledFilterWithCaching=null,this.compiledFilterWithCachingCSPSafe=null,this._grid&&((u=this._grid.onSelectedRowsChanged)==null||u.unsubscribe(),(e=this._grid.onCellCssStylesChanged)==null||e.unsubscribe()),(a=this.onRowsOrCountChanged)==null||a.unsubscribe()}setRefreshHints(u){this.refreshHints=u}getFilterArgs(){return this.filterArgs}setFilterArgs(u){this.filterArgs=u}processBulkDelete(){if(!this.idxById)return;let u,e,a=0;for(let i=0,t=this.items.length;i=0;--a)this.items.splice(e[a],1);this.updateIdxById(e[0]),this.refresh()}}sortedAddItem(u){if(!this.sortComparer)throw new Error("[SlickGrid DataView] sortedAddItem() requires a sort comparer, use sort()");this.insertItem(this.sortedIndex(u),u)}sortedUpdateItem(u,e){if(!this.idxById)return;if(!this.idxById.has(u)||u!==e[this.idProperty])throw new Error(`[SlickGrid DataView] Invalid or non-matching id ${u}`);if(!this.sortComparer)throw new Error("[SlickGrid DataView] sortedUpdateItem() requires a sort comparer, use sort()");const a=this.getItemById(u);this.sortComparer(a,e)!==0?(this.deleteItem(u),this.sortedAddItem(e)):this.updateItem(u,e)}sortedIndex(u){let e=0,a=this.items.length;for(;e>>1;this.sortComparer(this.items[i],u)===-1?e=i+1:a=i}return e}getItemCount(){return this.items.length}getLength(){return this.rows.length}getItem(u){var a;const e=this.rows[u];if(e!=null&&e.__group&&e.totals&&!((a=e.totals)!=null&&a.initialized)){const i=this.groupingInfos[e.level];i.displayTotalsRow||(this.calculateTotals(e.totals),e.title=i.formatter?i.formatter(e):e.value)}else e!=null&&e.__groupTotals&&!e.initialized&&this.calculateTotals(e);return e}getItemMetadata(u){const e=this.rows[u];return e===void 0?null:e.__group?this._options.groupItemMetadataProvider.getGroupRowMetadata(e):e.__groupTotals?this._options.groupItemMetadataProvider.getTotalsRowMetadata(e):null}expandCollapseAllGroups(u,e){if($u(u))this.toggledGroupsByLevel[u]={},this.groupingInfos[u].collapsed=e,e===!0?this.onGroupCollapsed.notify({level:u,groupingKey:null}):this.onGroupExpanded.notify({level:u,groupingKey:null});else for(let a=0;a=D?r[r.length]=c:(a=e[c],i=u[c],(!a||this.groupingInfos.length&&(t=a.__nonDataRow||i.__nonDataRow)&&a.__group!==i.__group||a.__group&&!a.equals(i)||t&&(a.__groupTotals||i.__groupTotals)||a[this.idProperty]!==i[this.idProperty]||(d=this.updated)!=null&&d[a[this.idProperty]])&&(r[r.length]=c));return r}recalc(u){this.rowsById=void 0,(this.refreshHints.isFilterNarrowing!==this.prevRefreshHints.isFilterNarrowing||this.refreshHints.isFilterExpanding!==this.prevRefreshHints.isFilterExpanding)&&(this.filterCache=[]);const e=this.getFilteredAndPagedItems(u);this.totalRows=e.totalRows;let a=e.rows;this.groups=[],this.groupingInfos.length&&(this.groups=this.extractGroups(a),this.groups.length&&(a=this.flattenGroupedRows(this.groups)));const i=this.getRowDiffs(this.rows,a);return this.rows=a,i}refresh(){if(this.suspend)return;const u=wu(!0,{},this.getPagingInfo()),e=this.rows.length,a=this.totalRows;let i=this.recalc(this.items);this.pagesize&&this.totalRows0},null,this),i.length>0&&this.onRowsChanged.notify({rows:i,itemCount:this.items.length,dataView:this,calledOnRowCountChanged:e!==this.rows.length},null,this),(e!==this.rows.length||i.length>0)&&this.onRowsOrCountChanged.notify({rowsDiff:i,previousRowCount:e,currentRowCount:this.rows.length,itemCount:this.items.length,rowCountChanged:e!==this.rows.length,rowsChanged:i.length>0,dataView:this},null,this)}syncGridSelection(u,e,a){this._grid=u;let i;this.selectedRowIds=this.mapRowsToIds(u.getSelectedRows());const t=u.getOptions(),r=s=>{s===!1?this.selectedRowIds=[]:this.selectedRowIds.sort().join(",")!==s.sort().join(",")&&(this.selectedRowIds=s)},o=()=>{if((this.selectedRowIds||[]).length>0&&!i){i=!0;const s=this.mapIdsToRows(this.selectedRowIds||[]);if(!e){const l={grid:this._grid,ids:this.mapRowsToIds(s),rows:s,dataView:this};this.preSelectedRowIdsChangeFn(l),this.onSelectedRowIdsChanged.notify(Object.assign(l,{selectedRowIds:this.selectedRowIds,filteredIds:this.getAllSelectedFilteredIds()}),new Pu,this)}u.setSelectedRows(s),i=!1}};return u.onSelectedRowsChanged.subscribe((s,l)=>{if(!i){const E=this.mapRowsToIds(l.rows),d={grid:this._grid,ids:E,rows:l.rows,added:!0,dataView:this};this.preSelectedRowIdsChangeFn(d),this.onSelectedRowIdsChanged.notify(Object.assign(d,{selectedRowIds:this.selectedRowIds,filteredIds:this.getAllSelectedFilteredIds()}),new Pu,this)}}),this.preSelectedRowIdsChangeFn=s=>{var l,E;if(!i){if(i=!0,typeof s.added>"u")r(s.ids);else{let c;s.added?a&&t.multiSelect?c=((l=this.selectedRowIds)==null?void 0:l.filter(m=>this.getRowById(m)===void 0)).concat(s.ids):c=s.ids:a&&t.multiSelect?c=(E=this.selectedRowIds)==null?void 0:E.filter(D=>s.ids.indexOf(D)===-1):c=[],r(c)}i=!1}},this.onRowsOrCountChanged.subscribe(o.bind(this)),this.onSelectedRowIdsChanged}getAllSelectedIds(){return this.selectedRowIds}getAllSelectedFilteredIds(){return this.getAllSelectedFilteredItems().map(u=>u[this.idProperty])}setSelectedIds(u,e){var s;let a=e==null?void 0:e.isRowBeingAdded;const i=e==null?void 0:e.shouldTriggerEvent,t=e==null?void 0:e.applyRowSelectionToGrid;a!==!1&&(a=!0);const r=this.mapIdsToRows(u),o={grid:this._grid,ids:u,rows:r,added:a,dataView:this};(s=this.preSelectedRowIdsChangeFn)==null||s.call(this,o),i!==!1&&this.onSelectedRowIdsChanged.notify(Object.assign(o,{selectedRowIds:this.selectedRowIds,filteredIds:this.getAllSelectedFilteredIds()}),new Pu,this),t!==!1&&this._grid&&this._grid.setSelectedRows(r)}getAllSelectedItems(){const u=[];return this.getAllSelectedIds().forEach(a=>{u.push(this.getItemById(a))}),u}getAllSelectedFilteredItems(){return Array.isArray(this.selectedRowIds)?this.filteredItems.filter(e=>this.selectedRowIds.some(a=>e[this.idProperty]===a))||[]:[]}syncGridCellCssStyles(u,e){let a,i;const t=o=>{a={},typeof o=="object"&&Object.keys(o).forEach(s=>{if(o&&this.rows[s]){const l=this.rows[s][this.idProperty];a[l]=o[s]}})};t(u.getCellCssStyles(e));const r=()=>{if(typeof a=="object"){i=!0,this.ensureRowsByIdCache();const o={};Object.keys(a).forEach(s=>{var E;const l=(E=this.rowsById)==null?void 0:E[s];$u(l)&&(o[l]=a[s])}),u.setCellCssStyles(e,o),i=!1}};u.onCellCssStylesChanged.subscribe((o,s)=>{i||e!==s.key||(s.hash?t(s.hash):(u.onCellCssStylesChanged.unsubscribe(),this.onRowsOrCountChanged.unsubscribe(r)))}),this.onRowsOrCountChanged.subscribe(r.bind(this))}}/**!
+var S5=Object.defineProperty;var w5=(n,u,e)=>u in n?S5(n,u,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[u]=e;var k=(n,u,e)=>(w5(n,typeof u!="symbol"?u+"":u,e),e);(function(){const u=document.createElement("link").relList;if(u&&u.supports&&u.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))a(i);new MutationObserver(i=>{for(const t of i)if(t.type==="childList")for(const r of t.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&a(r)}).observe(document,{childList:!0,subtree:!0});function e(i){const t={};return i.integrity&&(t.integrity=i.integrity),i.referrerPolicy&&(t.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?t.credentials="include":i.crossOrigin==="anonymous"?t.credentials="omit":t.credentials="same-origin",t}function a(i){if(i.ep)return;i.ep=!0;const t=e(i);fetch(i.href,t)}})();class ki{constructor(u){this._value=null,this._boundedEventWithListeners=[],this._elementBindings=[],this._binding=u,this._property=u.property||"",this._elementBindings=[],u.property&&u.variable&&(u.variable.hasOwnProperty(u.property)||u.property in u.variable)?this._value=u.variable[u.property]:this._value=u.variable,typeof u.variable=="object"&&Object.defineProperty(u.variable,u.property,{get:this.valueGetter.bind(this),set:this.valueSetter.bind(this)})}get boundedEventWithListeners(){return this._boundedEventWithListeners}get elementBindings(){return this._elementBindings}get property(){return this._property}dispose(){this.unbindAll(),this._boundedEventWithListeners=[],this._elementBindings=[]}valueGetter(){return this._value}valueSetter(u){if(this._value=u,Array.isArray(this._elementBindings))for(const e of this._elementBindings)e!=null&&e.element&&(e!=null&&e.attribute)&&(e.element[e.attribute]=u)}bind(u,e,a,i){return u&&u.forEach?u.forEach(t=>this.bindSingleElement(t,e,a,i)):u&&this.bindSingleElement(u,e,a,i),this}unbind(u,e,a,i,t){if(u){u.removeEventListener(e,a,i);const r=this._boundedEventWithListeners.findIndex(o=>o.uid===t);r>=0&&this._boundedEventWithListeners.splice(r,1)}}unbindAll(){let u=this._boundedEventWithListeners.pop();for(;u;){const{element:e,eventName:a,listener:i,uid:t}=u;this.unbind(e,a,i,void 0,t),u=this._boundedEventWithListeners.pop()}this._boundedEventWithListeners=[]}bindSingleElement(u,e,a,i){const t={element:u,attribute:e};if(u){if(a){const r=()=>{let o=u[e];if(this.hasData(o)&&(u==null?void 0:u.type)==="number"&&(o=+o),this.valueSetter(o),(this._binding.variable.hasOwnProperty(this._binding.property)||this._binding.property in this._binding.variable)&&(this._binding.variable[this._binding.property]=this.valueGetter()),typeof i=="function")return i(this.valueGetter())};t.event=a,t.listener=r,u.addEventListener(a,r),this._boundedEventWithListeners.push({element:u,eventName:a,listener:r,uid:this.generateUuidV4()})}this._elementBindings.push(t),u[e]=this._value}}generateUuidV4(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,u=>{const e=Math.random()*16|0;return(u==="x"?e:e&3|8).toString(16)})}hasData(u){return u!=null&&u!==""}}class Pl{constructor(){this._observers=[],this._querySelectorPrefix=""}get querySelectorPrefix(){return this._querySelectorPrefix||""}set querySelectorPrefix(u){this._querySelectorPrefix=u}get observers(){return this._observers}dispose(){let u=this._observers.pop();for(;u;)u.dispose(),u=this._observers.pop();this._observers=[]}addElementBinding(u,e,a,i,t,r){const o=document.querySelectorAll(`${this.querySelectorPrefix}${a}`);let s=this._observers.find(l=>l.property===u);s||(s=new ki({variable:u,property:e})),Array.isArray(t)?t.forEach(l=>s==null?void 0:s.bind(o,i,l,r)):s==null||s.bind(o,i,t,r),this._observers.push(s)}bindEventHandler(u,e,a,i){document.querySelectorAll(`${this.querySelectorPrefix}${u}`).forEach(r=>{r!=null&&r.addEventListener&&r.addEventListener(e,a,i)})}setElementAttributeValue(u,e,a){document.querySelectorAll(`${this.querySelectorPrefix}${u}`).forEach(t=>{t.textContent="",t&&e in t&&(t[e]=a)})}}class vu{constructor(){this._boundedEvents=[]}get boundedEvents(){return this._boundedEvents}dispose(){this.unbindAll(),this._boundedEvents=[]}bind(u,e,a,i,t=""){const r=Array.isArray(e)?e:[e];if(u!=null&&u.forEach)u.forEach(o=>{for(const s of r)o.addEventListener(s,a,i),this._boundedEvents.push({element:o,eventName:s,listener:a,groupName:t})});else for(const o of r)u.addEventListener(o,a,i),this._boundedEvents.push({element:u,eventName:o,listener:a,groupName:t})}unbind(u,e,a){const i=Array.isArray(u)?u:[u],t=Array.isArray(e)?e:[e];for(const r of t)for(const o of i)typeof(o==null?void 0:o.removeEventListener)=="function"&&o.removeEventListener(r,a)}unbindByEventName(u,e){const a=this._boundedEvents.find(i=>i.element===u&&i.eventName===e);a&&this.unbind(a.element,a.eventName,a.listener)}unbindAll(u){if(u){const e=Array.isArray(u)?u:[u];for(let a=this._boundedEvents.length-1;a>=0;--a){const i=this._boundedEvents[a];if(e.some(t=>t===i.groupName)){const{element:t,eventName:r,listener:o}=i;this.unbind(t,r,o),this._boundedEvents.splice(a,1)}}}else for(;this._boundedEvents.length>0;){const e=this._boundedEvents.pop(),{element:a,eventName:i,listener:t}=e;this.unbind(a,i,t)}}}class yr{constructor(u){k(this,"_className","");k(this,"_viewModel");k(this,"_observers",[]);this.viewTemplate=u,this.viewTemplate.textContent="Loading..."}get className(){return this._className}dispose(){let u=this._observers.pop();for(;u;)u.dispose(),u=this._observers.pop();this._observers=[]}getModuleClassName(u){let e="";const a=typeof u=="object"&&Object.keys(u);return Array.isArray(a)&&a.length>0?e=a[0]:u!=null&&u.name&&(e=u.name),e}loadView(u){const e=this.parseTemplate(u);this.render(e)}loadViewModel(u){return this._className=this.getModuleClassName(u),this._viewModel=u!=null&&u.name?new u:new u[this._className],this._className?(window[this._className]=this._viewModel,this._viewModel):null}parseTemplate(u){return u.replace(/([a-z]*){1}.(delegate)="?(.*?)(\))"/gi,this.parseMethodBinding.bind(this)).replace(/([a-z]*){1}.(bind)="?([^">\s]*)"?/gi,this.parsePropertyBinding.bind(this)).replace(/\${(.*)}/gi,this.parseLogicExecution.bind(this))}parseLogicExecution(u,e){return window[this._className][e]}parseMethodBinding(u,e,a,i,t){let r="";switch(a){case"delegate":r=`${e.toLowerCase()}="window.${this._className.trim()}.${i.trim()}${t}"`;break}return r||""}parsePropertyBinding(u,e,a,i){return setTimeout(()=>{const t=document.querySelectorAll(`[${e}\\.${a}=${i}]`),r=e.toLowerCase();let o=this._observers.find(s=>s.property===i);switch(o||(o=new ki({variable:window[this._className],property:i}),this._observers.push(o)),r){case"class":o.bind(t,"className");break;case"innerhtml":case"innerHTML":o.bind(t,"innerHTML");break;case"innertext":case"innerText":o.bind(t,"innerText");break;case"style":o.bind(t,"style");break;case"textcontent":case"textContent":o.bind(t,"textContent");break;case"value":o.bind(t,r,"change").bind(t,r,"keyup");break;case"checked":case"min":case"max":default:o.bind(t,r,"change");break}},0),u}render(u){return this.viewTemplate.innerHTML=u,this.viewTemplate}renderError(u){this.viewTemplate.innerHTML+=`${u}
`}}var Hu;(function(n){n.local="local",n.remote="remote"})(Hu||(Hu={}));class jl{constructor(u){this.rxjs=u}addRxJsResource(u){this.rxjs=u}executeBackendProcessesCallback(u,e,a,i){const t=new Date;e&&a.service.postProcess&&a.service.postProcess(e),e&&(a!=null&&a.internalPostProcess)&&a.internalPostProcess(e),a.postProcess!==void 0&&(e instanceof Object&&(e.metrics={startTime:u,endTime:t,executionTime:t.valueOf()-u.valueOf(),itemCount:i,totalItemCount:i}),a.postProcess(e))}onBackendError(u,e){if(typeof(e==null?void 0:e.onError)=="function")e.onError(u);else throw u}executeBackendCallback(u,e,a,i,t,r){var o;if(u){a&&!a.clearFilterTriggered&&!a.clearSortTriggered&&(r!=null&&r.emitActionChangedCallback)&&r.emitActionChangedCallback.call(this,Hu.remote);const s=u.process(e);if(s instanceof Promise&&s.then)s.then(l=>{var E;this.executeBackendProcessesCallback(i,l,u,t),(E=r==null?void 0:r.successCallback)==null||E.call(this,a)}).catch(l=>{var E;(E=r==null?void 0:r.errorCallback)==null||E.call(this,a),this.onBackendError(l,u)});else if((o=this.rxjs)!=null&&o.isObservable(s)){const l=this.rxjs;l.isObservable(r==null?void 0:r.httpCancelRequestSubject)&&(r==null||r.httpCancelRequestSubject.next()),s.pipe(l.takeUntil(l.iif(()=>l.isObservable(r==null?void 0:r.httpCancelRequestSubject),r==null?void 0:r.httpCancelRequestSubject,l.EMPTY))).subscribe(E=>{var d;this.executeBackendProcessesCallback(i,E,u,t),(d=r==null?void 0:r.successCallback)==null||d.call(this,a)},E=>{var d;(d=r==null?void 0:r.errorCallback)==null||d.call(this,a),this.onBackendError(E,u)})}}}refreshBackendDataset(u){var i;let e="";const a=u==null?void 0:u.backendServiceApi;if(!a||!a.service||!a.process)throw new Error('BackendServiceApi requires at least a "process" function and a "service" defined');if(a.service&&(e=a.service.buildQuery()),e&&e!==""){const t=new Date;a.preProcess&&a.preProcess();const r=((i=u==null?void 0:u.pagination)==null?void 0:i.totalItems)??0;this.executeBackendCallback(a,e,null,t,r)}}}const M5=Object.freeze(Object.defineProperty({__proto__:null,BackendUtilityService:jl},Symbol.toStringTag,{value:"Module"}));function mi(n,u){["pop","push","reverse","shift","unshift","splice","sort"].forEach(a=>{n[a]=(...i)=>{const t=Array.prototype[a].apply(n,i);return u.apply(n,[n,i]),t}})}function zr(n,u,e){let a=n[u];Object.defineProperty(n,u,{configurable:!0,get(){return a},set(i){a=i,e.apply(n,[i,n[u]])}})}const T5=Object.freeze(Object.defineProperty({__proto__:null,collectionObserver:mi,propertyObserver:zr},Symbol.toStringTag,{value:"Module"})),_5=n=>n;function P5(n,u,e=_5,a=()=>{}){const i=n&&n.length?[{pointer:n,offset:0}]:[],t=[];let r;for(;i.length;)for(r=i.pop();r.offset{if(u)throw new vi("Cancelled Promise");return e}),cancel:()=>u=!0}:n}function Nl(n,u,e=""){let a=u;if(u instanceof Promise)return u;if(n.isObservable(u)&&(a=n.firstValueFrom(u)),!(a instanceof Promise))throw new Error(`Something went wrong, Slickgrid-Universal ${e} is not able to convert the Observable into a Promise.`);return a}function Jt(n,u,e=0){const a=(u==null?void 0:u.childrenPropName)??T.treeDataProperties.CHILDREN_PROP;Array.isArray(n)&&n.forEach(i=>{i&&(Array.isArray(i[a])&&i[a].length>0&&(e++,Jt(i[a],u,e),e--),i[u.levelPropName]=e)})}function Ai(n,u,e=0,a=null){const i=(u==null?void 0:u.childrenPropName)??T.treeDataProperties.CHILDREN_PROP,{aggregator:t}=u;Array.isArray(n)&&n.forEach(r=>{if(r){const o=Array.isArray(r[i]);Array.isArray(r[i])&&r[i].length>0&&(t.init(r,!0),e++,Ai(r[i],u,e,r),e--),a&&t.isInitialized&&typeof t.accumulate=="function"&&!(r!=null&&r.__filteredOut)&&(t.accumulate(r,o),t.storeResult(a.__treeTotals)),r[u.levelPropName]=e}})}function Rl(n,u){const e=(u==null?void 0:u.identifierPropName)??"id",a=(u==null?void 0:u.childrenPropName)??T.treeDataProperties.CHILDREN_PROP,i=(u==null?void 0:u.hasChildrenPropName)??T.treeDataProperties.HAS_CHILDREN_PROP,t=(u==null?void 0:u.parentPropName)??T.treeDataProperties.PARENT_PROP,r=(u==null?void 0:u.levelPropName)??T.treeDataProperties.TREE_LEVEL_PROP;return u!=null&&u.shouldAddTreeLevelNumber&&(u!=null&&u.aggregators?u.aggregators.forEach(s=>{Ai(n,{childrenPropName:a,levelPropName:r,aggregator:s})}):Jt(n,{childrenPropName:a,levelPropName:r})),P5(n,s=>s[a],(s,l)=>({[e]:s[e],[t]:l!==void 0?l[e]:null,[i]:!!s[a],...Ol(s,a)}))}function Kl(n,u){const e=(u==null?void 0:u.identifierPropName)??"id",a=(u==null?void 0:u.childrenPropName)??T.treeDataProperties.CHILDREN_PROP,i=(u==null?void 0:u.parentPropName)??T.treeDataProperties.PARENT_PROP,t=(u==null?void 0:u.levelPropName)??T.treeDataProperties.TREE_LEVEL_PROP,r=(u==null?void 0:u.collapsedPropName)??T.treeDataProperties.COLLAPSED_PROP,o=n||[],s=[],l={};return o.forEach(E=>l[E[e]]=E),Object.keys(l).forEach(E=>{const d=l[E];if(!(i in d)||d[i]===null||d[i]===void 0||d[i]==="")s.push(d);else if(d[i]in l){const c=l[d[i]];a in c||(c[a]=[]),c[a].push(d),c[r]===void 0&&(c[r]=(u==null?void 0:u.initiallyCollapsed)??!1)}}),u!=null&&u.aggregators?u.aggregators.forEach(E=>{Ai(s,{childrenPropName:a,levelPropName:t,aggregator:E},0)}):Jt(s,{childrenPropName:a,levelPropName:t},0),s}function Je(n,u,e){if(!e)throw new Error('findRecursive requires parameter "childrenPropertyName"');const a=n.find(u),i=n.filter(t=>(t==null?void 0:t.hasOwnProperty(e))&&t[e]);if(a)return a;if(i.length){const t=[];return i.forEach(r=>{r!=null&&r.hasOwnProperty(e)&&t.push(...r[e])}),Je(t,u,e)}}function ne(n,u,e,a=".",i=""){if(isNaN(+n))return n;const t=u===void 0?2:u,r=e===void 0?2:e;let o=String(Math.round(+n*Math.pow(10,r))/Math.pow(10,r));for(o.indexOf(".")<0&&t>0&&(o+=".");o.length-o.indexOf(".")<=t;)o+="0";const s=o.split(".");let l,E;i?l=s.length>=1?ve(s[0],i):void 0:l=s.length>=1?s[0]:o,s.length>1&&(E=s[1]);let d="";return l!==void 0&&E!==void 0?d=`${l}${a}${E}`:l!=null&&(d=l),d}function Uu(n,u,e,a,i="",t="",r=".",o=""){if(isNaN(+n))return n;const s=Math.round(parseFloat(n)*1e6)/1e6;if(s<0){const l=Math.abs(s);if(a){if(!isNaN(u)||!isNaN(e))return`(${i}${ne(l,u,e,r,o)}${t})`;const E=ve(`${l}`,o);return`(${i}${E}${t})`}else{if(!isNaN(u)||!isNaN(e))return`-${i}${ne(l,u,e,r,o)}${t}`;const E=ve(`${l}`,o);return`-${i}${E}${t}`}}else{if(!isNaN(u)||!isNaN(e))return`${i}${ne(n,u,e,r,o)}${t}`;const l=ve(`${n}`,o);return`${i}${l}${t}`}}function hi(n,u,e){if(typeof n.queryFieldNameGetterFn=="function"){const a=n.queryFieldNameGetterFn(u);(a==null?void 0:a.indexOf("."))>=0?e=Yu(u,a):e=u.hasOwnProperty(a)?u[a]:e}return e}function Yu(n,u){return!n||!u?n:u.split(".").reduce((e,a)=>e&&e[a],n)}function X0(n){return n&&n.translationNamespace?n.translationNamespace+(n.translationNamespaceSeparator||""):""}function xi(n){return n.outputType||n.type||p.string}function wr(n){switch(n){case p.date:case p.dateTime:case p.dateIso:case p.dateTimeIso:case p.dateTimeShortIso:case p.dateTimeIsoAmPm:case p.dateTimeIsoAM_PM:case p.dateEuro:case p.dateEuroShort:case p.dateTimeEuro:case p.dateTimeShortEuro:case p.dateTimeEuroAmPm:case p.dateTimeEuroAM_PM:case p.dateTimeEuroShort:case p.dateTimeEuroShortAmPm:case p.dateTimeEuroShortAM_PM:case p.dateUs:case p.dateUsShort:case p.dateTimeUs:case p.dateTimeShortUs:case p.dateTimeUsAmPm:case p.dateTimeUsAM_PM:case p.dateTimeUsShort:case p.dateTimeUsShortAmPm:case p.dateTimeUsShortAM_PM:case p.dateUtc:return!0;default:return!1}}function Hl(n){let u;switch(n){case"<":case"LT":u=P.lessThan;break;case"<=":case"LE":u=P.lessThanOrEqual;break;case">":case"GT":u=P.greaterThan;break;case">=":case"GE":u=P.greaterThanOrEqual;break;case"<>":case"!=":case"NE":u=P.notEqual;break;case"*":case"a*":case"StartsWith":u=P.startsWith;break;case"*z":case"EndsWith":u=P.endsWith;break;case"=":case"==":case"EQ":u=P.equal;break;case"IN":u=P.in;break;case"NIN":case"NOT_IN":u=P.notIn;break;case"Not_Contains":case"NOT_CONTAINS":u=P.notContains;break;case"Contains":case"CONTAINS":default:u=P.contains;break}return u}function La(n){let u="";switch(n){case P.greaterThan:case">":u=">";break;case P.greaterThanOrEqual:case">=":u=">=";break;case P.lessThan:case"<":u="<";break;case P.lessThanOrEqual:case"<=":u="<=";break;case P.notEqual:case"<>":u="<>";break;case P.equal:case"=":case"==":case"EQ":u="=";break;case P.startsWith:case"a*":case"*":u="a*";break;case P.endsWith:case"*z":u="*z";break;default:u=n;break}return u}function gi(n){let u;if(wr(n))u=P.equal;else switch(n){case p.unknown:case p.string:case p.text:case p.password:case p.readonly:u=P.contains;break;case p.float:case p.number:default:u=P.equal;break}return u}function Ol(n,u){return Object.keys(n).reduce((e,a)=>(a!==u&&(e[a]=n[a]),e),{})}function ve(n,u=","){if(n!=null){const e=`${n}`,a=e.split(".");return a.length===2?`${a[0].replace(/\B(?=(\d{3})+(?!\d))/g,u)}.${a[1]}`:e.replace(/\B(?=(\d{3})+(?!\d))/g,u)}return n}function Ae(n,u,e={}){return Array.isArray(n)?n.find(u)||e:n}function Wt(n){if(Array.isArray(n))for(;n.length>0;){const u=n.pop();u!=null&&u.unsubscribe&&u.unsubscribe()}return n}const j5=Object.freeze(Object.defineProperty({__proto__:null,CancelledException:vi,addTreeLevelAndAggregatorsByMutation:Ai,addTreeLevelByMutation:Jt,cancellablePromise:Ll,castObservableToPromise:Nl,decimalFormatted:ne,findItemInTreeStructure:Je,findOrDefault:Ae,flattenToParentChildArray:Rl,formatNumber:Uu,getCellValueFromQueryFieldGetter:hi,getColumnFieldType:xi,getDescendantProperty:Yu,getTranslationPrefix:X0,isColumnDateType:wr,mapOperatorByFieldType:gi,mapOperatorToShorthandDesignation:La,mapOperatorType:Hl,objectWithoutKey:Ol,thousandSeparatorFormatted:ve,unflattenParentChildArrayToTree:Kl,unsubscribeAll:Wt},Symbol.toStringTag,{value:"Module"})),L5=(n,u,e)=>{e==null&&(e=ju.neutral);let a=0;return n===u?a=0:n===null?a=-1:u===null?a=1:e?a=n{if(!a||!a.dataKey)throw new Error('Sorting a "FieldType.object" requires you to provide the "dataKey" (object property name) of the object so that we can use it to sort correctly');const t=n!=null&&n.hasOwnProperty(a.dataKey)?n[a.dataKey]:n,r=u!=null&&u.hasOwnProperty(a.dataKey)?u[a.dataKey]:u,o=(a==null?void 0:a.valueCouldBeUndefined)??(i==null?void 0:i.cellValueCouldBeUndefined)??!1;e==null&&(e=ju.neutral);let s=0;return typeof n!="object"?s=-99e10:typeof u!="object"?s=99e10:t===null||o&&t===void 0?s=-1:r===null||o&&r===void 0?s=1:t===r?s=0:e?s=t{i==="innerHTML"&&console.warn(`[Slickgrid-Universal] For better CSP (Content Security Policy) support, do not use "innerHTML" directly in "createDomElement('${n}', { innerHTML: 'some html'})", it is better as separate assignment: "const elm = createDomElement('span'); elm.innerHTML = 'some html';"`);const t=u[i];typeof t=="object"?Object.assign(a[i],t):a[i]=u[i]}),e!=null&&e.appendChild&&e.appendChild(a),a}function _u(n=""){return n.split(" ").filter(u=>u)}function Mr(n){typeof n=="object"&&Object.keys(n).forEach(u=>{Array.isArray(n[u])&&Mr(n[u]),n[u]instanceof HTMLElement&&(n[u]=null)})}function bu(n){for(;n!=null&&n.firstChild;)n.removeChild(n.firstChild);return n}function E0(n,u="innerHTML"){return n instanceof DocumentFragment?[].map.call(n.childNodes,e=>e[u]).join("")||n.textContent||"":n instanceof HTMLElement?n[u]:String(n??"")}function Il(n,u){if(!n||!u)return;const e=n.getBoundingClientRect(),a=u.getBoundingClientRect();return{top:a.top-e.top,right:a.right-e.right,bottom:a.bottom-e.bottom,left:a.left-e.left}}function Iu(n){if(!n||!n.getBoundingClientRect)return;const u=n.getBoundingClientRect(),e=document.documentElement;let a=0,i=0,t=0,r=0;return(u==null?void 0:u.top)!==void 0&&u.left!==void 0&&(a=u.top+window.pageYOffset-e.clientTop,i=u.left+window.pageXOffset-e.clientLeft,r=u.right,t=u.bottom),{top:a,left:i,bottom:t,right:r}}function gt(n,u){let e=0;if(n){const a=u==="height"?"clientHeight":"clientWidth",i=u==="height"?["top","bottom"]:["left","right"];e=n[a];for(const t of i){const r=parseFloat(Gl(n,`padding-${t}`)||"")||0;e-=r}}return e}function Gl(n,u){return n?window.getComputedStyle(n).getPropertyValue(u):null}function ni(n,u){if(n)for(const e of u){const a=n.getAttribute(e);if(a)return a}return null}function be(n,u="auto"){return(/^[0-9]+$/i.test(`${n}`)?`${+n}px`:n)||u}function Vl(n){const u=typeof n=="string"?n:String(n),e={"&":"&","<":"<",">":">",'"':""","'":"'"};return(u||"").toString().replace(/[&<>"']/g,a=>e[a])}function $l(n){return n.replace(/(\d+);/g,(u,e)=>String.fromCharCode(e))}function Jl(n,u){const e=n.length;let a=Vl(n);if(e"u"||nt.call(u,i)},Uo=function(u,e){Vo&&e.name==="__proto__"?Vo(u,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):u[e.name]=e.newValue},qo=function(u,e){if(e==="__proto__")if(nt.call(u,e)){if($o)return $o(u,e).value}else return;return u[e]};function wu(...n){let u,e,a,i,t,r,o=n[0],s=1;const l=n.length;let E=!1;for(typeof o=="boolean"&&(E=o,o=n[1]||{},s=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});si[e]===u[e]):a=n.findIndex(i=>i===u),a<0&&n.push(u)}function Na(n,u=" "){let e="";for(let a=0;au!==a)}function sa(n){if(!Array.isArray(n)&&!Ve(n))return n;const u=Array.isArray(n)?[]:{};return wu(!0,u,n)}function ca(n,...u){if(!u.length)return n;const e=u.shift();return n=!Ve(n)&&Ve(e)?{}:n,Ve(n)&&Ve(e)&&Object.keys(e).forEach(a=>{e.hasOwnProperty(a)&&(a in n?typeof n[a]!="object"||typeof e[a]!="object"?n[a]=e[a]:n[a].concat&&e[a].concat?n[a]=n[a].concat(e[a]):n[a]=ca(n[a],e[a]):n[a]=e[a])}),ca(n,...u)}function ql(n){return Ve(n)&&Object.keys(n).forEach(u=>{n.hasOwnProperty(u)&&delete n[u]}),n=null,n={},n}function Yn(n,u=!0){let e=!1;const a=t=>{const r=t.toString();if(e=r.includes("async "),r.replaceAll(" ","").includes("=>({")){const l=r.match(/(({.*}))/g)||[];return l.length>=1?`return ${l[0].trimStart()}`:r}const o=!r.includes("{")&&r.includes("=>"),s=r.substring(r.indexOf("{")+1||r.indexOf("=>")+2,r.includes("}")?r.lastIndexOf("}"):r.length);return u&&o&&!s.startsWith("return")?"return "+s.trimStart():s};return{params:(t=>{const r=/(\/\/.*$)|(\/\*[\s\S]*?\*\/)|(\s*=[^,)]*(('(?:\\'|[^'\r\n])*')|("(?:\\"|[^"\r\n])*"))|(\s*=[^,)]*))/mg,o=/([^\s,]+)/g,s=t.toString().replace(r,"");return s.slice(s.indexOf("(")+1,s.indexOf(")")).match(o)??[]})(n),body:a(n),isAsync:e}}function Qn(n){return n==null?!0:Object.entries(n).length===0}function $u(n){return n!=null&&n!==""}function ta(n){return n!==null&&!isNaN(n)&&n!==""}function Ve(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)&&!(n instanceof Date)}function fi(n){return typeof n=="boolean"||typeof n=="number"||typeof n=="string"||n===null||n===void 0}function Da(n){return n instanceof HTMLElement||n instanceof DocumentFragment||fi(n)}function Ut(n){return n!=null&&n!==""}function su(n,u=!1){return u?n==null||typeof n=="string"?!1:!isNaN(n):n==null||n===""?!1:!isNaN(+n)}function Zl(n){return!n||n&&typeof n=="object"&&Object.keys(n).length===0}function Ct(n){return/(true|1)/i.test(n+"")}function Ma(n,u=!1){const e=typeof n.normalize=="function"?n.normalize("NFD").replace(/[\u0300-\u036f]/g,""):n;return u?e.toLowerCase():e}function B0(n,u,e){if(typeof u=="string"&&(u=u.split(".")),u.length>1){const a=u.shift();n&&a!==void 0&&B0(n[a]=Ut(n[a])&&(Array.isArray(n[a])||Object.prototype.toString.call(n[a])==="[object Object]")?n[a]:{},u,e)}else n&&u[0]&&(n[u[0]]=e)}function N0(n,u=!1){return typeof n=="string"?u?n.replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.substring(1).toLowerCase()):n.charAt(0).toUpperCase()+n.slice(1):n}function Pr(n){return typeof n=="string"?n.replace(/(?:^\w|[A-Z]|\b\w|[\s+\-_/])/g,(u,e)=>/[\s+\-_/]/.test(u)?"":e===0?u.toLowerCase():u.toUpperCase()):n}function Ci(n){return typeof n=="string"?Pr(n).replace(/([A-Z])/g,"-$1").toLowerCase():n}function de(n){if(typeof n=="string"){const u=n.replace(/([A-Z])|(-)/g," $1").replace(/\s+/g," ").trim();return u.charAt(0).toUpperCase()+u.slice(1)}return n}function K5(n){return typeof n=="string"?Pr(n).replace(/([A-Z])/g,"_$1").toLowerCase():n}function Yl(n){return Array.isArray(n)&&n.length>0?n.filter((u,e)=>n.indexOf(u)>=e):n}function H5(n,u="id"){if(Array.isArray(n)&&n.length>0){const e=[],a=new Map;for(const i of n)i&&!a.has(i[u])&&(a.set(i[u],!0),e.push({id:i[u],name:i.name}));return e}return n}const Za=Symbol("plaintext"),Zo=Symbol("html"),Yo=Symbol("comment"),O5=/<(\w*)>/g,I5=/<\/?([^\s/>]+)/;function Wu(n,u,e){function a(s,l,E){if(typeof s!="string"&&(su(s)||typeof s=="boolean"))return String(s);if(s instanceof HTMLElement&&(s=s.innerHTML),typeof s!="string"&&s!==void 0&&s!==null)throw new TypeError("'html' parameter must be a string");return t(s||"",i(l||"",E||""))}function i(s,l){return{allowable_tags:r(s),tag_replacement:l,state:Za,tag_buffer:"",depth:0,in_quote_char:""}}function t(s,l){const E=l.allowable_tags,d=l.tag_replacement;let c=l.state,D=l.tag_buffer,m=l.depth,h=l.in_quote_char,x="";for(let g=0,F=s.length;g":if(h)break;if(m){m--;break}h="",c=Za,D+=">",E.has(o(D))?x+=D:x+=d,D="";break;case'"':case"'":C===h?h="":h=h||C,D+=C;break;case"-":D==="":D.slice(-2)==="--"&&(c=Za),D="";break;default:D+=C;break}}return l.state=c,l.tag_buffer=D,l.depth=m,l.in_quote_char=h,x}function r(s){let l=new Set;if(typeof s=="string"){let E;for(;E=O5.exec(s);)l.add(E[1])}else typeof s[Symbol.iterator]=="function"&&(l=new Set(s));return l}function o(s){const l=I5.exec(s);return l?l[1].toLowerCase():null}return a(n,u,e)}const G5=Object.freeze(Object.defineProperty({__proto__:null,addToArrayWhenNotExists:R5,addWhiteSpaces:Na,arrayRemoveItemByIndex:_r,calculateAvailableSpace:bi,classNameToList:_u,createDomElement:v,deepCopy:sa,deepMerge:ca,destroyAllElementProps:Mr,emptyElement:bu,emptyObject:ql,extend:wu,findFirstAttribute:ni,findWidthOrDefault:be,getFunctionDetails:Yn,getHtmlStringOutput:E0,getInnerSize:gt,getOffset:Iu,getOffsetRelativeToParent:Il,getStyleProp:Gl,hasData:Ut,htmlEncode:Vl,htmlEncodeWithPadding:Jl,htmlEntityDecode:$l,insertAfterElement:Wl,isDefined:$u,isDefinedNumber:ta,isEmptyObject:Qn,isNumber:su,isObject:Ve,isObjectEmpty:Zl,isPrimitiveOrHTML:Da,isPrimitiveValue:fi,parseBoolean:Ct,removeAccentFromText:Ma,setDeepValue:B0,stripTags:Wu,titleCase:N0,toCamelCase:Pr,toKebabCase:Ci,toSentenceCase:de,toSnakeCase:K5,uniqueArray:Yl,uniqueObjectArray:H5,windowScrollPosition:Tr},Symbol.toStringTag,{value:"Module"})),V5=(n,u,e,a,i)=>{e==null&&(e=ju.neutral);let t=0;const r=(a==null?void 0:a.valueCouldBeUndefined)??(i==null?void 0:i.cellValueCouldBeUndefined)??!1;return n===u?t=0:n===null||r&&n===void 0?t=-1:u===null||r&&u===void 0?t=1:(i!=null&&i.ignoreAccentOnStringFilterAndSort&&(n=Ma(n,!1),u=Ma(u,!1)),e?t=n{const t=(a==null?void 0:a.valueCouldBeUndefined)??(i==null?void 0:i.cellValueCouldBeUndefined)??!1,r=isNaN(n)||n===""||n===null||t&&n===void 0?-99e10:parseFloat(n),o=isNaN(u)||u===""||u===null||t&&u===void 0?-99e10:parseFloat(u);return e*(r===o?0:r>o?1:-1)};var Xl=/^([0-9]{4})-([0-1][0-9])(?:-([0-3][0-9]))?(?:[T ]?([0-2][0-9])(?::([0-5][0-9]))?(?::([0-5][0-9]))?)?(?:\.[0-9]+)?(Z|(?:\+|\-)[0-9]{2}:?[0-9]{2})?$/;function $5(n){const u=n.match(Xl);if(u){const e=Number(u[2]);if(e<1||e>12)return!1;if(typeof u[3]!==void 0){const a=Number(u[3]);if(a<1||a>31)return!1}if(typeof u[4]!==void 0){const a=Number(u[4]);if(a<0||a>23)return!1}return!0}return!1}function J5(n){const u=n.match(Xl);return u&&typeof u[4]>"u"?n+="T00:00:00":n}function xe(n){if(n||(n=new Date),n instanceof Date){const u=new Date(n);return u.setMilliseconds(0),u}if(n=n.trim(),$5(n))return new Date(J5(n));throw new Error(`Non ISO 8601 compliant date (${n}).`)}function Fa(n,u=1){const e=xe(n);return e.setDate(e.getDate()+u),e}function W5(n){const u=xe(n);return u.setDate(1),u.setMonth(u.getMonth()+1),u.setDate(0),u}function U5(n){return W5(n).getDate()}var jr="1999-03-04T02:05:01.000Z",mn=new Map,Lr=[["YYYY",{year:"numeric"}],["YY",{year:"2-digit"}],["MMMM",{month:"long"}],["MMM",{month:"short"}],["MM",{month:"2-digit"}],["M",{month:"numeric"}],["DD",{day:"2-digit"}],["D",{day:"numeric"}],["dddd",{weekday:"long"}],["ddd",{weekday:"short"}],["d",{weekday:"narrow"}],["mm",{minute:"2-digit"}],["m",{minute:"numeric"}],["ss",{second:"2-digit"}],["s",{second:"numeric"}],["ZZ",{timeZoneName:"long"}],["Z",{timeZoneName:"short"}]],Nr=[["HH",{hour:"2-digit"}],["H",{hour:"numeric"}]],Rr=[["hh",{hour:"2-digit"}],["h",{hour:"numeric"}],["a",{dayPeriod:"narrow"}],["A",{dayPeriod:"narrow"}]],pt={DD:2,HH:2,MM:2,YY:2,YYYY:4,hh:2,mm:2,ss:2};function u1(n){if(/^[+-]\d{2}:\d{2}/.test(n))return 6;if(/^[+-]\d{4}/.test(n))return 5;throw new Error("Invalid offset format")}var q5=["MMMM","MMM","dddd","ddd"],Xu=new Map([...Lr,...Nr,...Rr].map(n=>[n[0],n])),Qo=new Map,e1=["full","long","medium","short"],je=n=>String(n).padStart(2,"0"),hn=n=>String(n).padStart(2,"0");function fe(n){return n.type==="literal"&&(n.value=n.value.normalize("NFKC")),n}function Z5(n,u,e,a=!1,i=null){const t=Y5(n,u,e,a),r=xe(n);function o({partName:s,partValue:l,token:E}){if(s==="literal")return l;const d=t[s];if(s==="hour"&&E==="H")return d.replace(/^0/,"")||"0";if(["mm","ss","MM"].includes(E)&&d.length===1)return`0${d}`;if(s==="dayPeriod"){const c=za(r.getUTCHours()<12?"am":"pm",e);return E==="A"?c.toUpperCase():c.toLowerCase()}return s==="timeZoneName"?i??a1(-1*r.getTimezoneOffset(),E):d}return u.map(s=>({...s,value:o(s)}))}function Y5(n,u,e,a=!1){const i=xe(n),t=u.filter(E=>E.hour12),r=u.filter(E=>!E.hour12),o=[],s=[];function l(E,d=!1){const c=`${e}-u-hc-${d?"h12":"h23"}`;if(o.push(...new Intl.DateTimeFormat(c,E.reduce((D,m)=>m.partName==="literal"?D:(a&&q5.includes(m.token)&&s.push(m),Object.assign(D,m.option)),{timeZone:"UTC"})).formatToParts(i).map(fe)),a&&s.length)for(const D of s){let m=[];switch(D.token){case"MMMM":m=new Intl.DateTimeFormat(c,{dateStyle:"long",timeZone:"UTC"}).formatToParts(i).map(fe);break;case"MMM":m=new Intl.DateTimeFormat(c,{dateStyle:"medium",timeZone:"UTC"}).formatToParts(i).map(fe);break}const h=m.find(g=>g.type===D.partName),x=o.findIndex(g=>g.type===D.partName);h&&x>-1&&(o[x]=h)}}return t.length&&l(t,!0),r.length&&l(r),o.reduce((E,d)=>(E[d.type]=d.value,E),{})}function a1(n,u="Z"){const e=String(Math.floor(Math.abs(n/60))).padStart(2,"0"),a=String(Math.abs(n%60)).padStart(2,"0"),i=n<0?"-":"+";return u==="ZZ"?`${i}${e}${a}`:`${i}${e}:${a}`}function Q5(n,u){i1(n,u);const[e,a,i,t]=n.match(/([+-])([0-3][0-9]):?([0-6][0-9])/),r=Number(i)*60+Number(t);return a==="+"?r:-r}function i1(n,u="Z"){if(!(a=>{switch(a){case"Z":return/^([+-])[0-3][0-9]:[0-6][0-9]$/.test(n);case"ZZ":return/^([+-])[0-3][0-9][0-6][0-9]$/.test(n)}})(u))throw new Error(`Invalid offset: ${n}`);return n}function X5(n){return Lr.concat(Nr).concat(Rr).sort((u,e)=>u[0].length>e[0].length?1:-1).reduce((u,e)=>u.replace(e[0],`\\${e[0]}`),n)}function uD(n){return["numeric","2-digit"].includes(n.partValue)}function eD(n){let u;for(const e of n){if(e.partName==="literal"&&!isNaN(parseFloat(e.partValue)))throw new Error(`Numbers in format (${e.partValue}).`);if(u&&u.partName!=="literal"&&e.partName!=="literal"&&!(u.token in pt)&&!(e.token in pt)&&!(uD(u)&&e.token.toLowerCase()==="a"))throw new Error(`Illegal adjacent tokens (${u.token}, ${e.token})`);u=e}return n}function aD(n){return typeof n=="string"?n.includes("ZZ")?"ZZ":"Z":"time"in n&&n.time==="full"?"Z":"ZZ"}function za(n,u){const e=Qo.get(u);if(e&&e[n])return e[n];const a=new Date(jr);a.setUTCHours(n==="am"?5:20);const t=new Intl.DateTimeFormat(u,{timeStyle:"full",timeZone:"UTC",hour12:!0}).formatToParts(a).map(fe).find(r=>r.type==="dayPeriod");if(t){const r=e||{};return Qo.set(u,Object.assign(r,{[n]:t.value})),t.value}return n}function t1(n,u="+00:00"){const e=xe(n),a=(()=>{switch(u1(u)){case 5:return"ZZ";case 6:return"Z"}})(),i=Q5(u,a);return new Date(e.getTime()+i*1e3*60)}function n1(){return Intl.DateTimeFormat().resolvedOptions().timeZone}function Xo(n,u){const e=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZone:u,hourCycle:"h23"}).formatToParts(n).map(fe),a={};return e.forEach(i=>{a[i.type]=i.value}),new Date(`${a.year}-${a.month}-${a.day}T${a.hour}:${a.minute}:${a.second}Z`)}function Ft(n,u="UTC",e="device",a="Z"){var i;e=e==="device"?(i=n1())!=null?i:"utc":e;const t=xe(n),r=Xo(t,u),s=(Xo(t,e).getTime()-r.getTime())/1e3/60;return a1(s,a)}function iD(n,u){const e=xe(n);return t1(e,Ft(e,u))}function us(n){const u=xe(n);return u.setHours(0,0,0),u}function Kr(n,u){if(e1.includes(n)||typeof n=="object")return tD(n,u);let e=n,a=0;const i=E=>{if(E[2]||(E[2]=new RegExp(`(.)?(${E[0]})`,"g")),E[2].test(e)){let d=0;return e=e.replace(E[2],(c,D,m)=>D==="\\"?m:`${typeof D=="string"?D:""}{!${d++?a:a++}!}`),!!d}return!1};function t(E){const d=E.map(D=>D.partName),c=new Set(d);if(d.length>c.size)throw new Error("Cannot reuse format tokens.");return E}function r(E,[d,c,D]){const m=Object.keys(c)[0],h=c[m];return{option:c,partName:m,partValue:h,token:d,pattern:D,hour12:E}}const o=Lr.filter(i).concat(Nr.filter(i)).map(r.bind(null,!1)),s=t(o.concat(Rr.filter(i).map(r.bind(null,!0)))),l=/^\{!(\d+)!\}$/;return e.split(/(\{!\d+!\})/).map(E=>{const d=E.match(l);return d?s[Number(d[1])]:{option:{literal:E},partName:"literal",partValue:E,token:E,pattern:new RegExp(""),hour12:!1}}).filter(E=>!(E.partName==="literal"&&E.partValue===""))}function tD(n,u){const e={timeZone:"UTC"};typeof n=="string"?e.dateStyle=n:("date"in n&&(e.dateStyle=n.date),"time"in n&&(e.timeStyle=n.time));const a=new Intl.DateTimeFormat(u,e),i=a.formatToParts(new Date(jr)).map(fe),r=a.formatToParts(new Date("1999-04-05T23:05:01.000Z")).map(fe).find(s=>s.type==="hour"),o=r&&r.value==="23"?24:12;return i.map(s=>{const l=s.type,E=nD(s.type,s.value,u,s.type==="hour"?o:void 0,e);if(E===void 0)return;const d=E[1][l];if(d)return E[2]||(E[2]=new RegExp(`${E[0]}`,"g")),{option:{[l]:d},partName:l,partValue:d,token:E[0],pattern:E[2],hour12:o===12}}).filter(s=>!!s)}function nD(n,u,e,a,i){const t=u.length,r=!isNaN(Number(u));let o;switch(n){case"year":return t===2?Xu.get("YY"):Xu.get("YYYY");case"month":if(r)return t===1?Xu.get("M"):Xu.get("MM");switch(o=es(e,n,u),o){case"long":return Xu.get("MMMM");default:return Xu.get("MMM")}case"day":return t===1?Xu.get("D"):Xu.get("DD");case"weekday":switch(o=es(e,n,u),o){case"narrow":return Xu.get("d");case"short":return Xu.get("ddd");default:return Xu.get("dddd")}case"hour":return a===12?t===1?Xu.get("h"):Xu.get("hh"):t===1?Xu.get("H"):Xu.get("HH");case"minute":return t===1?Xu.get("m"):Xu.get("mm");case"second":return t===1?Xu.get("s"):Xu.get("ss");case"dayPeriod":return/^[A-Z]+$/u.test(u)?Xu.get("A"):Xu.get("a");case"literal":return[u,{literal:u},new RegExp("")];case"timeZoneName":return i.timeStyle==="full"?Xu.get("Z"):Xu.get("ZZ");default:return}}function es(n,u,e){if(!mn.has(n)){const i=new Date(jr),t=[3,8,9,7,6,4,3],r=["weekday","month","dayPeriod"],o=["long","short","narrow"],s={};for(let l=0;l<12;l++){i.setMonth(0+l),l in t&&i.setDate(t[l]),i.setUTCHours(8+l);for(const E of o){const d=new Intl.DateTimeFormat(n,r.reduce((c,D)=>Object.assign(c,{[D]:E}),{hour12:!0,timeZone:"UTC"})).formatToParts(i).map(fe);if(E==="long"||E==="short"){const D=new Intl.DateTimeFormat(n,{dateStyle:E==="short"?"medium":"long",timeZone:"UTC"}).formatToParts(i).map(fe).find(h=>h.type==="month"),m=d.findIndex(h=>h.type==="month");m>-1&&D&&(d[m]=D)}d.forEach(c=>{if(c.type==="literal")return;const D=c.type;s[D]=Object.assign(s[D]||{},{[c.value]:E})})}}mn.set(n,s)}const a=mn.get(n);return a?a[u][e]:void 0}function r1(n,u="+00:00"){const e=u.slice(0,1)==="+";return t1(n,u.replace(e?"+":"-",e?"-":"+"))}function rD(){return Intl.DateTimeFormat().resolvedOptions().locale}function l0(n,u="long",e="device",a=!1,i){let t,r;return typeof n=="object"&&!(n instanceof Date)&&({date:n,format:u,locale:e,genitive:a,partFilter:i,tz:t}=n),u==="ISO8601"?xe(n).toISOString():(t&&(r=Ft(n,"utc",t,aD(u))),t??(t=n1()),(t==null?void 0:t.toLowerCase())!=="utc"&&(n=r1(n,Ft(n,t,"utc"))),(!e||e==="device")&&(e=rD()),Z5(n,Kr(u,e).filter(i??(()=>!0)),e,a,r).map(o=>o.value).join(""))}function oD(n,u="en",e=!1,a=()=>!0){return Kr(n,u).filter(a).reduce((i,t)=>i+=e&&t.partName==="literal"?X5(t.token):t.token,"").normalize("NFKC")}function sD(n){const u=new Date().getFullYear(),e=u%100,a=Math.floor(u/100),i=Number(n);return(a+(i>e+20?-1:0))*100+i}function o1(n,u="en",e=!1){const a=(i,t)=>Array(i).fill("").map((r,o)=>`${t(o)}`);if(n==="M")return a(12,i=>i+1);if(n==="MM")return a(12,i=>{const t=i+1;return t<10?`0${t}`:t});if(n.startsWith("M"))return o1("MM").map(i=>l0(`2000-${i}-05`,n,u,e));if(n.startsWith("d"))return a(7,i=>`0${i+2}`).map(i=>l0(`2022-10-${i}`,n,u));if(n==="a")return[za("am",u).toLowerCase(),za("pm",u).toLowerCase()];if(n==="A")return[za("am",u).toUpperCase(),za("pm",u).toUpperCase()];if(n.startsWith("Y")){const i=new Date().getFullYear();return a(120,t=>t+1).reduce((t,r)=>(r!=="120"&&t.push(l0(`${i+Number(r)}-06-06`,n,u)),t.unshift(l0(`${i-Number(r)}-06-06`,n,u)),t),[l0(`${i}-06-06`,n,u)])}return n.startsWith("D")?a(31,i=>`${n==="DD"&&i<9?"0":""}${i+1}`):n.startsWith("H")?a(24,i=>`${n==="HH"&&i<10?"0":""}${i}`):n.startsWith("h")?a(12,i=>`${n==="hh"&&i<9?"0":""}${i+1}`):n.startsWith("m")||n.startsWith("s")?a(60,i=>`${n.length>1&&i<10?"0":""}${i}`):[]}function kt(n,u="ISO8601",e="device"){let a=()=>!0,i,t="backward";if(typeof n=="object"?{date:i,format:u="ISO8601",locale:e="device",dateOverflow:t="backward",partFilter:a=()=>!0}=n:i=n,!i)throw new Error("parse() requires a date string.");const r=()=>{throw new Error(`Date (${i}) does not match format (${oD(u,e)})`)};if(u==="ISO8601")return xe(i);const o=e1.includes(u)||typeof u=="object",s=eD(Kr(u,e).filter(a));if(!s.length)throw new Error("parse() requires a pattern.");let l;try{l=lD(i,s)}catch{return r()}const E=new Date,d=new Map([["YYYY",E.getFullYear()],["MM",E.getMonth()+1],["DD",E.getDate()],["HH",0],["mm",0],["ss",0]]);let c=null,D="";l.forEach(z=>{if(z.partName==="literal")return;if(z.token===z.value)return r();const M=Number(z.value);if(d.has(z.token))d.set(z.token,M);else if(z.token==="YY")d.set("YYYY",sD(z.value));else{const w=z.token;if(w.startsWith("d"))return;if(w==="D")d.set("DD",M);else if(w==="H"||w.startsWith("h"))d.set("HH",M);else if(w==="M")d.set("MM",M);else if(w==="a"||w==="A")c=z.value.toLowerCase()===za("am",e).toLowerCase();else if(w==="Z"||w==="ZZ")D=i1(z.value,w);else{const G=o1(w,e,o).indexOf(z.value);if(G!==-1)switch(w){case"MMM":case"MMMM":d.set("MM",G+1);break}}}});let m=d.get("HH")||0;c===!1?(m+=m===12?0:12,d.set("HH",m===24?0:m)):c===!0&&m===12&&d.set("HH",0),d.set("MM",(d.get("MM")||1)-1);let[h,x,g,F,C,A]=Array.from(d.values());const b=U5(new Date(`${hn(h)}-${je(x+1)}-10`));if(b[o[e++],o[e]];let i=0;const t=[];let r;do{const[o,s]=a(u);r=s;let l=1;if(o.partName==="literal")l=o.partValue.length;else if(o.partName==="timeZoneName")l=u1(n.substring(i));else if(o.token in pt)l=pt[o.token];else if(s)if(s.partName==="literal"){if(l=n.indexOf(s.partValue,i)-i,l<0)throw new Error}else if(s.partName==="dayPeriod"){for(let E=1;E<=4;E++)if(isNaN(Number(n.charAt(i+E)))){l=E;break}}else{const E=n.substring(i).search(/\d/);E!==-1&&(l=i+E)}else l=n.length;t.push({...o,value:n.substring(i,i+l)}),i+=l}while(r);return t}function J0(n,u=!1){let e;switch(n){case p.dateTime:case p.dateTimeIso:e="YYYY-MM-DD HH:mm:ss";break;case p.dateTimeIsoAmPm:e="YYYY-MM-DD hh:mm:ss a";break;case p.dateTimeIsoAM_PM:e="YYYY-MM-DD hh:mm:ss A";break;case p.dateTimeShortIso:e="YYYY-MM-DD HH:mm";break;case p.dateEuro:e="DD/MM/YYYY";break;case p.dateEuroShort:e=u?"DD/MM/YY":"D/M/YY";break;case p.dateTimeEuro:e="DD/MM/YYYY HH:mm:ss";break;case p.dateTimeShortEuro:e=u?"DD/MM/YYYY HH:mm":"D/M/YYYY H:m";break;case p.dateTimeEuroAmPm:e="DD/MM/YYYY hh:mm:ss a";break;case p.dateTimeEuroAM_PM:e="DD/MM/YYYY hh:mm:ss A";break;case p.dateTimeEuroShort:e=u?"DD/MM/YY HH:mm:ss":"D/M/YY H:m:s";break;case p.dateTimeEuroShortAmPm:e=u?"DD/MM/YY hh:mm:ss a":"D/M/YY h:m:s a";break;case p.dateTimeEuroShortAM_PM:e=u?"DD/MM/YY hh:mm:ss A":"D/M/YY h:m:s A";break;case p.dateUs:e="MM/DD/YYYY";break;case p.dateUsShort:e=u?"MM/DD/YY":"M/D/YY";break;case p.dateTimeUs:e="MM/DD/YYYY HH:mm:ss";break;case p.dateTimeUsAmPm:e="MM/DD/YYYY hh:mm:ss a";break;case p.dateTimeUsAM_PM:e="MM/DD/YYYY hh:mm:ss A";break;case p.dateTimeUsShort:e=u?"MM/DD/YY HH:mm:ss":"M/D/YY H:m:s";break;case p.dateTimeUsShortAmPm:e=u?"MM/DD/YY hh:mm:ss a":"M/D/YY h:m:s a";break;case p.dateTimeUsShortAM_PM:e=u?"MM/DD/YY hh:mm:ss A":"M/D/YY h:m:s A";break;case p.dateTimeShortUs:e=u?"MM/DD/YYYY HH:mm":"M/D/YYYY H:m";break;case p.dateUtc:e="ISO8601";break;case p.date:case p.dateIso:default:e="YYYY-MM-DD";break}return e}function le(n,u,e){const a=u?J0(u):void 0,i=J0(e),t=n instanceof Date?n:Be(n,a);return t&&n!==void 0?e===p.dateUtc?t.toISOString():l0(t,i,"en-US"):""}function Be(n,u,e=!1){try{return n?n instanceof Date?n:kt({date:n,format:u,dateOverflow:e?"throw":"backward",locale:"en-US"}):!1}catch{return!1}}function ED(n){return r1(n,Ft(n,"utc"))}function dD(n){let u="";if(typeof n=="string"&&/^[0-9\-/]*$/.test(n)){const e=decodeURIComponent(n),a=iD(e,"utc");a&&(u=a.toISOString().replace(/(.*)([.\d]{4})(Z)/gi,"$1$3"))}return u}function as(n,u,e,a,i){let t=0;if(n===u)t=0;else{let r=Be(n,a,i),o=Be(u,a,i);r||(r=new Date(1001,1,1)),o||(o=new Date(1001,1,1)),t=r.valueOf()-o.valueOf()}return e*t}function Ru(n){const u=n===p.date?void 0:J0(n);return(e,a,i)=>u===void 0?as(e,a,i,u,!1):as(e,a,i,u,!0)}const M0={boolean:L5,date:Ru(p.date),dateIso:Ru(p.dateIso),dateUtc:Ru(p.dateUtc),dateTime:Ru(p.dateTime),dateTimeIso:Ru(p.dateTimeIso),dateTimeIsoAmPm:Ru(p.dateTimeIsoAmPm),dateTimeIsoAM_PM:Ru(p.dateTimeIsoAM_PM),dateTimeShortIso:Ru(p.dateTimeShortIso),dateEuro:Ru(p.dateEuro),dateEuroShort:Ru(p.dateEuroShort),dateTimeShortEuro:Ru(p.dateTimeShortEuro),dateTimeEuro:Ru(p.dateTimeEuro),dateTimeEuroAmPm:Ru(p.dateTimeEuroAmPm),dateTimeEuroAM_PM:Ru(p.dateTimeEuroAM_PM),dateTimeEuroShort:Ru(p.dateTimeEuroShort),dateTimeEuroShortAmPm:Ru(p.dateTimeEuroShortAmPm),dateTimeEuroShortAM_PM:Ru(p.dateTimeEuroShortAM_PM),dateUs:Ru(p.dateUs),dateUsShort:Ru(p.dateUsShort),dateTimeShortUs:Ru(p.dateTimeShortUs),dateTimeUs:Ru(p.dateTimeUs),dateTimeUsAmPm:Ru(p.dateTimeUsAmPm),dateTimeUsAM_PM:Ru(p.dateTimeUsAM_PM),dateTimeUsShort:Ru(p.dateTimeUsShort),dateTimeUsShortAmPm:Ru(p.dateTimeUsShortAmPm),dateTimeUsShortAM_PM:Ru(p.dateTimeUsShortAM_PM),numeric:Ql,objectString:N5,string:V5};function Ta(n,u,e,a,i,t){let r=0;switch(n){case p.boolean:r=M0.boolean(u,e,a,i,t);break;case p.float:case p.integer:case p.number:r=M0.numeric(u,e,a,i,t);break;case p.date:case p.dateIso:case p.dateUtc:case p.dateTime:case p.dateTimeIso:case p.dateTimeIsoAmPm:case p.dateTimeIsoAM_PM:case p.dateTimeShortIso:case p.dateEuro:case p.dateEuroShort:case p.dateTimeShortEuro:case p.dateTimeEuro:case p.dateTimeEuroAmPm:case p.dateTimeEuroAM_PM:case p.dateTimeEuroShort:case p.dateTimeEuroShortAmPm:case p.dateTimeEuroShortAM_PM:case p.dateUs:case p.dateUsShort:case p.dateTimeShortUs:case p.dateTimeUs:case p.dateTimeUsAmPm:case p.dateTimeUsAM_PM:case p.dateTimeUsShort:case p.dateTimeUsShortAmPm:case p.dateTimeUsShortAM_PM:r=Ru(n).call(this,u,e,a,i,t);break;case p.object:r=M0.objectString(u,e,a,i,t);break;case p.string:case p.text:case p.password:case p.readonly:default:r=M0.string(u,e,a,i,t);break}return r}const cD=Object.freeze(Object.defineProperty({__proto__:null,sortByFieldType:Ta},Symbol.toStringTag,{value:"Module"}));var G0;(function(n){n.camelCase="camelCase",n.kebabCase="kebabCase",n.lowerCase="lowerCase",n.lowerCaseWithoutOnPrefix="lowerCaseWithoutOnPrefix"})(G0||(G0={}));class s1{get elementSource(){return this._elementSource}set elementSource(u){this._elementSource=u}get subscribedEvents(){return this._subscribedEvents}get subscribedEventNames(){return this._subscribedEvents.map(u=>u.name)}constructor(u){this._subscribedEvents=[],this.eventNamingStyle=G0.camelCase,this._elementSource=u||document.createElement("div")}dispose(){var u;this.unsubscribeAll(),this._subscribedEvents=[],clearTimeout(this._timer),(u=this._elementSource)==null||u.remove(),this._elementSource=null}dispatchCustomEvent(u,e,a=!0,i=!0,t){var s;const r={bubbles:a,cancelable:i};e&&(r.detail=e);const o=new CustomEvent(u,r);return typeof t=="function"&&t(o),(s=this._elementSource)==null?void 0:s.dispatchEvent(o)}getEventNameByNamingConvention(u,e){let a="";switch(this.eventNamingStyle){case G0.camelCase:a=e!==""?`${e}${N0(u)}`:u;break;case G0.kebabCase:a=e!==""?`${e}-${Ci(u)}`:Ci(u);break;case G0.lowerCase:a=`${e}${u}`.toLowerCase();break;case G0.lowerCaseWithoutOnPrefix:a=`${e}${u.replace(/^on/,"")}`.toLowerCase();break}return a}publish(u,e,a,i){const t=this.getEventNameByNamingConvention(u,"");return a?new Promise(r=>{clearTimeout(this._timer),this._timer=setTimeout(()=>r(this.dispatchCustomEvent(t,e,!0,!0,i)),a)}):this.dispatchCustomEvent(t,e,!0,!0,i)}subscribe(u,e){const a=this.getEventNameByNamingConvention(u,"");return this._elementSource.addEventListener(a,i=>e.call(null,i.detail)),this._subscribedEvents.push({name:a,listener:e}),{unsubscribe:()=>this.unsubscribe(a,e)}}subscribeEvent(u,e){const a=this.getEventNameByNamingConvention(u,"");return this._elementSource.addEventListener(a,e),this._subscribedEvents.push({name:a,listener:e}),{unsubscribe:()=>this.unsubscribe(a,e)}}unsubscribe(u,e,a=!0){const i=this.getEventNameByNamingConvention(u,"");this._elementSource.removeEventListener(i,e),a&&this.removeSubscribedEventWhenFound(u,e)}unsubscribeAll(u){if(Array.isArray(u)){let e;do e=u.pop(),e!=null&&e.dispose?e.dispose():e!=null&&e.unsubscribe&&e.unsubscribe();while(e)}else{let e=this._subscribedEvents.pop();for(;e;)this.unsubscribe(e.name,e.listener,!1),e=this._subscribedEvents.pop()}}removeSubscribedEventWhenFound(u,e){const a=this._subscribedEvents.findIndex(i=>i.name===u&&i.listener===e);a>=0&&this._subscribedEvents.splice(a,1)}}function vt(n){var u=document,e=n.container||u.createElement("div"),a=n.preventSubmit||0;e.id=e.id||"autocomplete-"+F();var i=e.style,t=n.debounceWaitMs||0,r=n.disableAutoSelect||!1,o=e.parentElement,s=[],l="",E=2,d=n.showOnFocus,c,D=0,m,h=!1,x=!1;if(n.minLength!==void 0&&(E=n.minLength),!n.input)throw new Error("input undefined");var g=n.input;e.className="autocomplete "+(n.className||""),e.setAttribute("role","listbox"),g.setAttribute("role","combobox"),g.setAttribute("aria-expanded","false"),g.setAttribute("aria-autocomplete","list"),g.setAttribute("aria-controls",e.id),g.setAttribute("aria-owns",e.id),g.setAttribute("aria-activedescendant",""),g.setAttribute("aria-haspopup","listbox"),i.position="absolute";function F(){return Date.now().toString(36)+Math.random().toString(36).substring(2)}function C(){var V=e.parentNode;V&&V.removeChild(e)}function A(){m&&window.clearTimeout(m)}function b(){e.parentNode||(o||u.body).appendChild(e)}function B(){return!!e.parentNode}function S(){D++,s=[],l="",c=void 0,g.setAttribute("aria-activedescendant",""),g.setAttribute("aria-expanded","false"),C()}function z(){if(!B())return;g.setAttribute("aria-expanded","true"),i.height="auto",i.width=g.offsetWidth+"px";var V=0,pu;function Nu(){var n0=u.documentElement,x0=n0.clientTop||u.body.clientTop||0,r0=n0.clientLeft||u.body.clientLeft||0,ue=window.pageYOffset||n0.scrollTop,_0=window.pageXOffset||n0.scrollLeft;pu=g.getBoundingClientRect();var g0=pu.top+g.offsetHeight+ue-x0,Pe=pu.left+_0-r0;i.top=g0+"px",i.left=Pe+"px",V=window.innerHeight-(pu.top+g.offsetHeight),V<0&&(V=0),i.top=g0+"px",i.bottom="",i.left=Pe+"px",i.maxHeight=V+"px"}Nu(),Nu(),n.customize&&pu&&n.customize(g,pu,e,V)}function M(){e.textContent="",g.setAttribute("aria-activedescendant","");var V=function(r0,ue,_0){var g0=u.createElement("div");return g0.textContent=r0.label||"",g0};n.render&&(V=n.render);var pu=function(r0,ue){var _0=u.createElement("div");return _0.textContent=r0,_0};n.renderGroup&&(pu=n.renderGroup);var Nu=u.createDocumentFragment(),n0=F();if(s.forEach(function(r0,ue){if(r0.group&&r0.group!==n0){n0=r0.group;var _0=pu(r0.group,l);_0&&(_0.className+=" group",Nu.appendChild(_0))}var g0=V(r0,l,ue);g0&&(g0.id=e.id+"_"+ue,g0.setAttribute("role","option"),g0.addEventListener("click",function(Pe){x=!0;try{n.onSelect(r0,g)}finally{x=!1}S(),Pe.preventDefault(),Pe.stopPropagation()}),r0===c&&(g0.className+=" selected",g0.setAttribute("aria-selected","true"),g.setAttribute("aria-activedescendant",g0.id)),Nu.appendChild(g0))}),e.appendChild(Nu),s.length<1)if(n.emptyMsg){var x0=u.createElement("div");x0.id=e.id+"_"+F(),x0.className="empty",x0.textContent=n.emptyMsg,e.appendChild(x0),g.setAttribute("aria-activedescendant",x0.id)}else{S();return}b(),z(),Y()}function w(){B()&&M()}function N(){w()}function G(V){V.target!==e?w():V.preventDefault()}function L(){x||iu(0)}function Y(){var V=e.getElementsByClassName("selected");if(V.length>0){var pu=V[0],Nu=pu.previousElementSibling;if(Nu&&Nu.className.indexOf("group")!==-1&&!Nu.previousElementSibling&&(pu=Nu),pu.offsetTopx0&&(e.scrollTop+=n0-x0)}}}function lu(){var V=s.indexOf(c);c=V===-1?void 0:s[(V+s.length-1)%s.length],Eu(V)}function hu(){var V=s.indexOf(c);c=s.length<1?void 0:V===-1?s[0]:s[(V+1)%s.length],Eu(V)}function Eu(V){s.length>0&&(Vu(V),du(s.indexOf(c)),Y())}function du(V){var pu=u.getElementById(e.id+"_"+V);pu&&(pu.classList.add("selected"),pu.setAttribute("aria-selected","true"),g.setAttribute("aria-activedescendant",pu.id))}function Vu(V){var pu=u.getElementById(e.id+"_"+V);pu&&(pu.classList.remove("selected"),pu.removeAttribute("aria-selected"),g.removeAttribute("aria-activedescendant"))}function Au(V,pu){var Nu=B();if(pu==="Escape")S();else{if(!Nu||s.length<1)return;pu==="ArrowUp"?lu():hu()}V.preventDefault(),Nu&&V.stopPropagation()}function mu(V){if(c){a===2&&V.preventDefault(),x=!0;try{n.onSelect(c,g)}finally{x=!1}S()}a===1&&V.preventDefault()}function au(V){var pu=V.key;switch(pu){case"ArrowUp":case"ArrowDown":case"Escape":Au(V,pu);break;case"Enter":mu(V);break}}function Lu(){d&&iu(1)}function iu(V){g.value.length>=E||V===1?(A(),m=window.setTimeout(function(){return zu(g.value,V,g.selectionStart||0)},V===0||V===2?t:0)):S()}function zu(V,pu,Nu){if(!h){var n0=++D;n.fetch(V,function(x0){D===n0&&x0&&(s=x0,l=V,c=s.length<1||r?void 0:s[0],M())},pu,Nu)}}function ru(V){if(n.keyup){n.keyup({event:V,fetch:function(){return iu(0)}});return}!B()&&V.key==="ArrowDown"&&iu(0)}function Bu(V){n.click&&n.click({event:V,fetch:function(){return iu(2)}})}function c0(){setTimeout(function(){u.activeElement!==g&&S()},200)}function re(){zu(g.value,3,g.selectionStart||0)}e.addEventListener("mousedown",function(V){V.stopPropagation(),V.preventDefault()}),e.addEventListener("focus",function(){return g.focus()}),C();function W0(){g.removeEventListener("focus",Lu),g.removeEventListener("keyup",ru),g.removeEventListener("click",Bu),g.removeEventListener("keydown",au),g.removeEventListener("input",L),g.removeEventListener("blur",c0),window.removeEventListener("resize",N),u.removeEventListener("scroll",G,!0),g.removeAttribute("role"),g.removeAttribute("aria-expanded"),g.removeAttribute("aria-autocomplete"),g.removeAttribute("aria-controls"),g.removeAttribute("aria-activedescendant"),g.removeAttribute("aria-owns"),g.removeAttribute("aria-haspopup"),A(),S(),h=!0}return g.addEventListener("keyup",ru),g.addEventListener("click",Bu),g.addEventListener("keydown",au),g.addEventListener("input",L),g.addEventListener("blur",c0),g.addEventListener("focus",Lu),window.addEventListener("resize",N),u.addEventListener("scroll",G,!0),{destroy:W0,fetch:re}}function l1(n,u){const e=u.fetch;e&&(u.fetch=(a,i,t,r)=>{n.classList.add("slick-autocomplete-loading");const o=i;e(a,l=>{o(l),n.classList.remove("slick-autocomplete-loading")},t,r)})}function At(n,u,e,a,i){const t=e,r=a.outputType||i.type||a.type||p.dateUtc,o=i.type||a.type,s=J0(p.dateIso),l=o?J0(o):void 0,E=Array.isArray(t)?t:[t||""];if(E.length&&E[0]){const d=[];for(const c of E){const D=c instanceof Date?c:Be(c,l);D&&d.push(D)}d.length&&(u.settings.selected={dates:[d.map(c=>l0(c,s)).join(":")],month:d[0].getMonth(),year:d[0].getFullYear(),time:l==="ISO8601"||(l||"").toLowerCase().includes("h")?l0(d[0],"HH:mm"):void 0}),n.value=E.length?d.map(c=>le(c,void 0,r)).join(" — "):""}}function Hr(n,u){const e=v("select",{className:"form-control"});for(const a of n){const i=document.createElement("option");i.value=a.operator,u.applyHtmlCode(i,`${Jl(a.operatorAlt||a.operator,3)}${a.descAlt||a.desc}`),e.appendChild(i)}return e}function DD(n,u,e){const a=(u==null?void 0:u.filter)??{},i=(a==null?void 0:a.collectionOptions)??{};if(i&&i.collectionInsideObjectProperty){const t=i.collectionInsideObjectProperty;n=Yu(n,t)}if(!Array.isArray(n))throw new Error('Something went wrong while trying to pull the collection from the "collectionAsync" call in the Filter, the collection is not a valid array.');a.collection=n,e(n)}async function E1(n,u,e,a,i){const t=(u==null?void 0:u.filter)??{},r=(t==null?void 0:t.collectionOptions)??{};let o=null;if(n){const s=(a==null?void 0:a.isObservable(n))??!1;s&&a&&(o=await Nl(a,n));const l=await n;if(Array.isArray(l)?o=l:(l==null?void 0:l.status)>=200&&l.status<300&&typeof l.json=="function"?o=await l.json():l&&l.content&&(o=l.content),!Array.isArray(o)&&(r!=null&&r.collectionInsideObjectProperty)){const E=o||l,d=r.collectionInsideObjectProperty;o=Yu(E,d||"")}if(!Array.isArray(o))throw new Error('Something went wrong while trying to pull the collection from the "collectionAsync" call in the Filter, the collection is not a valid array.');t.collection=o,e(o),s&&mD(u,e,a,i)}return o}function mD(n,u,e,a){const i=(n==null?void 0:n.filter)??{},t=e==null?void 0:e.createSubject();i.collectionAsync=t,a&&t&&a.push(t.subscribe(r=>DD(r,n,u)))}function Z0(n,u,e,a,i){if(a!=null&&a.enableTranslate&&(i!=null&&i.translate)){const r=X0(a);return i.translate(`${r}${n}`)}const t=a.locales||T.locales;return(t==null?void 0:t[u])??e}function hD(n,u){const e=[{operator:"",desc:Z0("CONTAINS","TEXT_CONTAINS","Contains",n,u)},{operator:"<>",desc:Z0("NOT_CONTAINS","TEXT_NOT_CONTAINS","Not Contains",n,u)},{operator:"=",desc:Z0("EQUALS","TEXT_EQUALS","Equals",n,u)},{operator:"!=",desc:Z0("NOT_EQUAL_TO","TEXT_NOT_EQUAL_TO","Not equal to",n,u)},{operator:"a*",desc:Z0("STARTS_WITH","TEXT_STARTS_WITH","Starts with",n,u)},{operator:"*z",desc:Z0("ENDS_WITH","TEXT_ENDS_WITH","Ends with",n,u)}];return d1(n,e,"text"),e}function Or(n,u){const e=[{operator:"",desc:""},{operator:"=",desc:Z0("EQUAL_TO","TEXT_EQUAL_TO","Equal to",n,u)},{operator:"<",desc:Z0("LESS_THAN","TEXT_LESS_THAN","Less than",n,u)},{operator:"<=",desc:Z0("LESS_THAN_OR_EQUAL_TO","TEXT_LESS_THAN_OR_EQUAL_TO","Less than or equal to",n,u)},{operator:">",desc:Z0("GREATER_THAN","TEXT_GREATER_THAN","Greater than",n,u)},{operator:">=",desc:Z0("GREATER_THAN_OR_EQUAL_TO","TEXT_GREATER_THAN_OR_EQUAL_TO","Greater than or equal to",n,u)},{operator:"<>",desc:Z0("NOT_EQUAL_TO","TEXT_NOT_EQUAL_TO","Not equal to",n,u)}];return d1(n,e,"numeric"),e}function d1(n,u,e){if(n.compoundOperatorAltTexts){for(const a of u)if(n.compoundOperatorAltTexts.hasOwnProperty(e)){const i=n.compoundOperatorAltTexts[e][a.operator];a.operatorAlt=(i==null?void 0:i.operatorAlt)||"",a.descAlt=(i==null?void 0:i.descAlt)||""}}}class xD{constructor(u,e,a){this.translaterService=u,this.collectionService=e,this.rxjs=a,this._clearFilterTriggered=!1,this._shouldTriggerQuery=!0,this.searchTerms=[],this.isFilled=!1,this.isItemSelected=!1,this.valueName="label",this.enableTranslateLabel=!1,this.subscriptions=[],this._bindEventService=new vu}get autocompleterOptions(){return this._autocompleterOptions||{}}get collectionOptions(){var u,e;return((e=(u=this.columnDef)==null?void 0:u.filter)==null?void 0:e.collectionOptions)??{}}get collection(){return this._collection}get columnFilter(){var u;return((u=this.columnDef)==null?void 0:u.filter)||{}}get filterDomElement(){return this._filterElm}get filterOptions(){var u,e;return{...(u=this.gridOptions.defaultFilterOptions)==null?void 0:u.autocompleter,...(e=this.columnFilter)==null?void 0:e.filterOptions}}get customStructure(){var a,i,t,r,o;let u=(a=this.columnFilter)==null?void 0:a.customStructure;const e=((i=this.columnFilter)==null?void 0:i.type)??((t=this.columnDef)==null?void 0:t.type);return!u&&e===p.object&&((r=this.columnDef)!=null&&r.dataKey)&&((o=this.columnDef)!=null&&o.labelKey)&&(u={label:this.columnDef.labelKey,value:this.columnDef.dataKey}),u}get defaultOperator(){return P.equal}get gridOptions(){var u;return((u=this.grid)==null?void 0:u.getOptions())??{}}get instance(){return this._instance}get operator(){var u;return((u=this.columnFilter)==null?void 0:u.operator)??this.defaultOperator}set operator(u){this.columnFilter&&(this.columnFilter.operator=u)}init(u){var a,i,t,r,o,s;if(!u)throw new Error('[Slickgrid-Universal] A filter must always have an "init()" with valid arguments.');if(this.grid=u.grid,this.callback=u.callback,this.columnDef=u.columnDef,this.searchTerms=(u.hasOwnProperty("searchTerms")?u.searchTerms:[])||[],this.filterContainerElm=u.filterContainerElm,!this.grid||!this.columnDef||!this.columnFilter||!this.columnFilter.collection&&!this.columnFilter.collectionAsync&&!this.columnFilter.filterOptions)throw new Error(`[Slickgrid-Universal] You need to pass a "collection" (or "collectionAsync") for the AutoComplete Filter to work correctly. Also each option should include a value/label pair (or value/labelKey when using Locale). For example:: { filter: model: Filters.autocompleter, collection: [{ value: true, label: 'True' }, { value: false, label: 'False'}] }`);this.enableTranslateLabel=((a=this.columnFilter)==null?void 0:a.enableTranslateLabel)??!1,this.labelName=((i=this.customStructure)==null?void 0:i.label)??"label",this.valueName=((t=this.customStructure)==null?void 0:t.value)??"value",this.labelPrefixName=((r=this.customStructure)==null?void 0:r.labelPrefix)??"labelPrefix",this.labelSuffixName=((o=this.customStructure)==null?void 0:o.labelSuffix)??"labelSuffix",this._locales=((s=this.gridOptions)==null?void 0:s.locales)??T.locales;const e=this.columnFilter.collection;return this._collection=e,this.renderDomElement(e),new Promise(async(l,E)=>{try{const d=this.columnFilter.collectionAsync;let c;d&&!this.columnFilter.collection?(c=E1(d,this.columnDef,this.renderDomElement.bind(this),this.rxjs,this.subscriptions),l(c)):(c=e,l(e)),(d||this.columnFilter.enableCollectionWatch)&&(await(c??d),this.watchCollectionChanges())}catch(d){E(d)}})}clear(u=!0){this._filterElm&&(this._clearFilterTriggered=!0,this._shouldTriggerQuery=u,this.searchTerms=[],this._filterElm.value="",this._filterElm.dispatchEvent(new CustomEvent("input")),this._filterElm.classList.remove("filled"))}destroy(){var u,e,a;typeof((u=this._instance)==null?void 0:u.destroy)=="function"&&this._instance.destroy(),this._filterElm,(a=(e=this._filterElm)==null?void 0:e.remove)==null||a.call(e),this._collection=void 0,this._bindEventService.unbindAll(),Wt(this.subscriptions)}getValues(){var u;return(u=this._filterElm)==null?void 0:u.value}setValues(u,e){var i;u&&this._filterElm&&(this._filterElm.value=u);const a=this.getValues()!==""?"add":"remove";(i=this._filterElm)==null||i.classList[a]("filled"),this.operator=e||this.defaultOperator}filterCollection(u){var a;let e=u;if(this.columnFilter&&this.columnFilter.collectionFilterBy){const i=this.columnFilter.collectionFilterBy,t=this.columnFilter.collectionOptions&&this.columnFilter.collectionOptions.filterResultAfterEachPass||null;e=((a=this.collectionService)==null?void 0:a.filterCollection(e,i,t))||[]}return e}sortCollection(u){var a;let e=u;if(this.columnFilter&&this.columnFilter.collectionSortBy){const i=this.columnFilter.collectionSortBy;e=((a=this.collectionService)==null?void 0:a.sortCollection(this.columnDef,e,i,this.enableTranslateLabel))||[]}return e}watchCollectionChanges(){var u;(u=this.columnFilter)!=null&&u.collection&&(mi(this.columnFilter.collection,e=>{this.renderDomElement(this.columnFilter.collection||e||[])}),zr(this.columnFilter,"collection",e=>{this.renderDomElement(e||[]),this.columnFilter.collection&&mi(this.columnFilter.collection,a=>{this.renderDomElement(this.columnFilter.collection||a||[])})}))}renderDomElement(u){var i;if(!Array.isArray(u)&&((i=this.collectionOptions)!=null&&i.collectionInsideObjectProperty)){const t=this.collectionOptions.collectionInsideObjectProperty;u=Yu(u,t||"")}let e=u;e&&(e=this.filterCollection(e),e=this.sortCollection(e));const a=Array.isArray(this.searchTerms)&&this.searchTerms.length>=0?this.searchTerms[0]:"";this._collection=e,this._filterElm=this.createFilterElement(e,a),this._bindEventService.bind(this._filterElm,"input",this.handleOnInputChange.bind(this)),this._bindEventService.bind(this._filterElm,"blur",()=>{this.isItemSelected||this.clear()})}createFilterElement(u,e){var o,s,l,E,d,c,D,m,h,x,g;this._collection=u;const a=((o=this.columnDef)==null?void 0:o.id)??"";bu(this.filterContainerElm);let i=((s=this.gridOptions)==null?void 0:s.defaultFilterPlaceholder)??"";(l=this.columnFilter)!=null&&l.placeholder&&(i=this.columnFilter.placeholder),this._filterElm=v("input",{type:"text",ariaLabel:((E=this.columnFilter)==null?void 0:E.ariaLabel)??`${de(a+"")} Search Filter`,autocomplete:"off",ariaAutoComplete:"none",placeholder:i,className:`form-control search-filter filter-${a} slick-autocomplete-container`,value:e??"",dataset:{columnid:`${a}`}});const t=e;Array.isArray(u)&&(u.every(F=>fi(F))?u=u.map(F=>({label:F,value:F})):u=u.map(F=>({label:F==null?void 0:F[this.labelName],value:F==null?void 0:F[this.valueName],labelPrefix:(F==null?void 0:F[this.labelPrefixName])??"",labelSuffix:(F==null?void 0:F[this.labelSuffixName])??""}))),this._autocompleterOptions={input:this._filterElm,debounceWaitMs:200,className:`slick-autocomplete ${((d=this.filterOptions)==null?void 0:d.className)??""}`.trim(),emptyMsg:this.gridOptions.enableTranslate&&((c=this.translaterService)!=null&&c.translate)?this.translaterService.translate("NO_ELEMENTS_FOUND"):((D=this._locales)==null?void 0:D.TEXT_NO_ELEMENTS_FOUND)??"No elements found",customize:(F,C,A)=>{A.style.width=""},onSelect:F=>{this.isItemSelected=!0,this.handleSelect(F)},...this.filterOptions},(m=this.gridOptions)!=null&&m.darkMode&&(this._autocompleterOptions.className+=" slick-dark-mode"),this.autocompleterOptions.className=_u(this.autocompleterOptions.className).join(" "),(h=this._autocompleterOptions.renderItem)!=null&&h.layout?(this._autocompleterOptions.className+=` autocomplete-custom-${Ci(this._autocompleterOptions.renderItem.layout)}`,this._autocompleterOptions.render=this.renderCustomItem.bind(this)):Array.isArray(u)?this._autocompleterOptions.render=((x=this._autocompleterOptions.render)==null?void 0:x.bind(this))??this.renderCollectionItem.bind(this):this._autocompleterOptions.render||(this._autocompleterOptions.render=this.renderRegularItem.bind(this)),(g=this.filterOptions)!=null&&g.fetch?(l1(this._filterElm,this._autocompleterOptions),this._instance=vt(this._autocompleterOptions)):this._instance=vt({...this._autocompleterOptions,fetch:(F,C)=>{u&&C(u.filter(A=>((typeof A=="string"?A:A==null?void 0:A.label)||"").toLowerCase().includes(F.toLowerCase())))}}),this._filterElm.value=t??"";const r=v("div",{className:"autocomplete-filter-container"});return r.appendChild(this._filterElm),r.appendChild(v("span")),e&&this._filterElm.classList.add("filled"),this.filterContainerElm.appendChild(r),this.filterContainerElm.appendChild(document.createElement("span")),this._filterElm}handleSelect(u){var e,a;if(u!==void 0){const t=((e=this.filterOptions)==null?void 0:e.renderItem)??!1,r=typeof u=="string"?u:t?u[this.labelName]:u.label;let o=typeof u=="string"?u:t?u[this.valueName]:u.value;o=this.trimWhitespaceWhenEnabled(o);const s=o===""?"remove":"add";(a=this._filterElm)==null||a.classList[s]("filled"),this.setValues(r),this.callback(void 0,{columnDef:this.columnDef,operator:this.operator,searchTerms:[o],shouldTriggerQuery:this._shouldTriggerQuery}),this._clearFilterTriggered=!1,this._shouldTriggerQuery=!0}return!1}handleOnInputChange(u){var i,t,r;let e=((i=u==null?void 0:u.target)==null?void 0:i.value)??"";const a=this.filterOptions.triggerOnEveryKeyStroke??!1;if(e=this.trimWhitespaceWhenEnabled(e),this._clearFilterTriggered||e===""||a){const o={columnDef:this.columnDef,shouldTriggerQuery:this._shouldTriggerQuery};this._clearFilterTriggered?o.clearFilterTriggered=this._clearFilterTriggered:(o.operator=this.operator,o.searchTerms=[e]),e!==""?(this.isItemSelected=!0,(t=this._filterElm)==null||t.classList.add("filled")):(this.isItemSelected=!1,(r=this._filterElm)==null||r.classList.remove("filled")),this.callback(u,o)}this._clearFilterTriggered=!1,this._shouldTriggerQuery=!0}renderRegularItem(u){const e=typeof u=="string"?u:(u==null?void 0:u.label)??"";return v("div",{textContent:e||""})}renderCustomItem(u){var i,t;const e=((t=(i=this._autocompleterOptions)==null?void 0:i.renderItem)==null?void 0:t.templateCallback(u))??"",a=document.createElement("div");return this.grid.applyHtmlCode(a,e),a}renderCollectionItem(u){var l;const e=((l=this.columnFilter)==null?void 0:l.enableRenderHtml)??!1,a=u.labelPrefix||"",i=u.label||"",t=u.labelSuffix||"",r=a+i+t,o=this.grid.sanitizeHtmlString(r)||"",s=document.createElement("div");return s[e?"innerHTML":"textContent"]=o,s}trimWhitespaceWhenEnabled(u){let e=u;const a=this.gridOptions.enableFilterTrimWhiteSpace||this.columnFilter.enableTrimWhiteSpace;return typeof u=="string"&&a&&(e=u.trim()),e}}/*! name: vanilla-calendar-picker | url: https://github.com/uvarov-frontend/vanilla-calendar-picker */var gD=Object.defineProperty,is=Object.getOwnPropertySymbols,CD=Object.prototype.hasOwnProperty,pD=Object.prototype.propertyIsEnumerable,Xn=(n,u,e)=>u in n?gD(n,u,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[u]=e,c1=(n,u)=>{for(var e in u||(u={}))CD.call(u,e)&&Xn(n,e,u[e]);if(is)for(var e of is(u))pD.call(u,e)&&Xn(n,e,u[e]);return n},gu=(n,u,e)=>(Xn(n,typeof u!="symbol"?u+"":u,e),e);const FD={calendar:"vanilla-calendar",calendarDefault:"vanilla-calendar_default",calendarMultiple:"vanilla-calendar_multiple",calendarMonth:"vanilla-calendar_month",calendarYear:"vanilla-calendar_year",calendarHidden:"vanilla-calendar_hidden",calendarToInput:"vanilla-calendar_to-input",calendarToInputTop:"vanilla-calendar_to-input_top",calendarToInputBottom:"vanilla-calendar_to-input_bottom",controls:"vanilla-calendar-controls",grid:"vanilla-calendar-grid",gridDisabled:"vanilla-calendar-grid_disabled",column:"vanilla-calendar-column",columnMonth:"vanilla-calendar-column_month",columnYear:"vanilla-calendar-column_year",header:"vanilla-calendar-header",headerContent:"vanilla-calendar-header__content",month:"vanilla-calendar-month",monthDisabled:"vanilla-calendar-month_disabled",year:"vanilla-calendar-year",yearDisabled:"vanilla-calendar-year_disabled",arrow:"vanilla-calendar-arrow",arrowPrev:"vanilla-calendar-arrow_prev",arrowNext:"vanilla-calendar-arrow_next",wrapper:"vanilla-calendar-wrapper",content:"vanilla-calendar-content",week:"vanilla-calendar-week",weekDay:"vanilla-calendar-week__day",weekDayWeekend:"vanilla-calendar-week__day_weekend",days:"vanilla-calendar-days",daysSelecting:"vanilla-calendar-days_selecting",months:"vanilla-calendar-months",monthsSelecting:"vanilla-calendar-months_selecting",monthsMonth:"vanilla-calendar-months__month",monthsMonthSelected:"vanilla-calendar-months__month_selected",monthsMonthDisabled:"vanilla-calendar-months__month_disabled",years:"vanilla-calendar-years",yearsSelecting:"vanilla-calendar-years_selecting",yearsYear:"vanilla-calendar-years__year",yearsYearSelected:"vanilla-calendar-years__year_selected",yearsYearDisabled:"vanilla-calendar-years__year_disabled",time:"vanilla-calendar-time",timeContent:"vanilla-calendar-time__content",timeHours:"vanilla-calendar-time__hours",timeMinutes:"vanilla-calendar-time__minutes",timeKeeping:"vanilla-calendar-time__keeping",timeRanges:"vanilla-calendar-time__ranges",timeRange:"vanilla-calendar-time__range",day:"vanilla-calendar-day",dayHoverFirst:"vanilla-calendar-day_hover-first",dayHoverLast:"vanilla-calendar-day_hover-last",dayHoverIntermediate:"vanilla-calendar-day_hover-intermediate",daySelectedFirst:"vanilla-calendar-day_selected-first",daySelectedLast:"vanilla-calendar-day_selected-last",daySelectedIntermediate:"vanilla-calendar-day_selected-intermediate",dayPopup:"vanilla-calendar-day__popup",dayBtn:"vanilla-calendar-day__btn",dayBtnPrev:"vanilla-calendar-day__btn_prev",dayBtnNext:"vanilla-calendar-day__btn_next",dayBtnToday:"vanilla-calendar-day__btn_today",dayBtnSelected:"vanilla-calendar-day__btn_selected",dayBtnHover:"vanilla-calendar-day__btn_hover",dayBtnDisabled:"vanilla-calendar-day__btn_disabled",dayBtnWeekend:"vanilla-calendar-day__btn_weekend",dayBtnHoliday:"vanilla-calendar-day__btn_holiday",weekNumbers:"vanilla-calendar-week-numbers",weekNumbersTitle:"vanilla-calendar-week-numbers__title",weekNumbersContent:"vanilla-calendar-week-numbers__content",weekNumber:"vanilla-calendar-week-number",isFocus:"vanilla-calendar-is-focus"},kD=n=>`<#WeekNumbers />
<#Week /><#Days />
<#ControlTime />`,vD=n=>`<#ArrowPrev /><#ArrowNext />
<#Multiple>
<#WeekNumbers />
<#Week /><#Days />
<#/Multiple>
<#ControlTime />`,AD=n=>``,bD=n=>``;class fD{constructor(){gu(this,"isInit",!1),gu(this,"input",!1),gu(this,"type","default"),gu(this,"months",2),gu(this,"jumpMonths",1),gu(this,"toggleSelected",!0),gu(this,"jumpToSelectedDate",!1),gu(this,"date",{min:"1970-01-01",max:"2470-12-31",today:new Date}),gu(this,"settings",{lang:"en",iso8601:!0,range:{min:this.date.min,max:this.date.max,disablePast:!1,disableGaps:!1,edgesOnly:!1,disableAllDays:!1,disableWeekday:void 0,disabled:void 0,enabled:void 0},selection:{day:"single",month:!0,year:!0,time:!1,controlTime:"all",stepHours:1,stepMinutes:1,cancelableDay:!0},selected:{dates:void 0,month:void 0,year:void 0,holidays:void 0,time:void 0},visibility:{theme:"system",themeDetect:"html[data-theme]",monthShort:!0,weekNumbers:!1,weekend:!0,today:!0,disabled:!1,daysOutside:!0,positionToInput:"left"}}),gu(this,"locale",{months:[],weekday:[]}),gu(this,"sanitizer",u=>u),gu(this,"actions",{clickDay:null,clickWeekNumber:null,clickMonth:null,clickYear:null,clickArrow:null,changeTime:null,changeToInput:null,getDays:null,getMonths:null,getYears:null,initCalendar:null,updateCalendar:null,destroyCalendar:null,showCalendar:null,hideCalendar:null}),gu(this,"popups",{}),gu(this,"CSSClasses",c1({},FD)),gu(this,"DOMTemplates",{default:kD(this.CSSClasses),multiple:vD(this.CSSClasses),month:AD(this.CSSClasses),year:bD(this.CSSClasses)}),gu(this,"HTMLElement"),gu(this,"HTMLOriginalElement"),gu(this,"HTMLInputElement"),gu(this,"rangeMin"),gu(this,"rangeMax"),gu(this,"rangeDisabled"),gu(this,"rangeEnabled"),gu(this,"selectedDates"),gu(this,"selectedHolidays"),gu(this,"selectedMonth"),gu(this,"selectedYear"),gu(this,"selectedHours"),gu(this,"selectedMinutes"),gu(this,"selectedKeeping"),gu(this,"selectedTime"),gu(this,"currentType"),gu(this,"correctMonths"),gu(this,"viewYear"),gu(this,"dateMin"),gu(this,"dateMax")}}const ce=n=>`${n.getFullYear()}-${String(n.getMonth()+1).padStart(2,"0")}-${String(n.getDate()).padStart(2,"0")}`,Gu=n=>new Date(`${n}T00:00:00`),Ra=n=>n.reduce((u,e)=>{if(e instanceof Date||typeof e=="number"){const a=e instanceof Date?e:new Date(e);u.push(a.toISOString().substring(0,10))}else e.match(/^(\d{4}-\d{2}-\d{2})$/g)?u.push(e):e.replace(/(\d{4}-\d{2}-\d{2}).*?(\d{4}-\d{2}-\d{2})/g,(a,i,t)=>{const r=Gu(i),o=Gu(t),s=new Date(r.getTime());for(;s<=o;s.setDate(s.getDate()+1))u.push(ce(s));return a});return u},[]),ts=()=>{const n=new Date;return new Date(n.getTime()-6e4*n.getTimezoneOffset()).toISOString().substring(0,10)},pi=n=>n?{0:"12",13:"01",14:"02",15:"03",16:"04",17:"05",18:"06",19:"07",20:"08",21:"09",22:"10",23:"11"}[Number(n)]||String(n):"",Ia={notFoundSelector:n=>`${n} is not found, check the first argument passed to new VanillaCalendar.`,notInit:'The calendar has not been initialized, please initialize it using the "init()" method first.',notLocale:'You specified "define" for "settings.lang" but did not provide the required values for "locale.weekday" or "locale.months".',incorrectTheme:'Incorrect name of theme in "settings.visibility.theme".',incorrectTime:"The value of the time property can be: false, true, 12 or 24."},BD=n=>{var u;if(n.jumpToSelectedDate&&((u=n.settings.selected.dates)!=null&&u.length)&&n.settings.selected.month===void 0&&n.settings.selected.year===void 0){const i=Gu(Ra(n.settings.selected.dates)[0]);n.settings.selected.month=i.getMonth(),n.settings.selected.year=i.getFullYear()}const e=n.settings.selected.month!==void 0&&Number(n.settings.selected.month)>=0&&Number(n.settings.selected.month)<12,a=n.settings.selected.year!==void 0&&Number(n.settings.selected.year)>=0&&Number(n.settings.selected.year)<=9999;n.selectedMonth=e?Number(n.settings.selected.month):n.date.today.getMonth(),n.selectedYear=a?Number(n.settings.selected.year):n.date.today.getFullYear(),n.viewYear=n.selectedYear},yD=n=>{var u,e,a;n.settings.range.min==="today"&&(n.settings.range.min=ts()),n.settings.range.max==="today"&&(n.settings.range.max=ts()),n.settings.range.min=Gu(n.date.min)>=Gu(n.settings.range.min)?n.date.min:n.settings.range.min,n.settings.range.max=Gu(n.date.max)<=Gu(n.settings.range.max)?n.date.max:n.settings.range.max;const i=n.settings.range.disablePast&&!n.settings.range.disableAllDays&&Gu(n.settings.range.min)1&&n.rangeDisabled.sort((t,r)=>+new Date(t)-+new Date(r)),n.rangeEnabled=n.settings.range.enabled?Ra(n.settings.range.enabled):[],(u=n.rangeEnabled)!=null&&u[0]&&((e=n.rangeDisabled)!=null&&e[0])&&(n.rangeDisabled=n.rangeDisabled.filter(t=>!n.rangeEnabled.includes(t))),n.rangeEnabled.length>1&&n.rangeEnabled.sort((t,r)=>+new Date(t)-+new Date(r)),(a=n.rangeEnabled)!=null&&a[0]&&n.settings.range.disableAllDays&&(n.rangeMin=n.rangeEnabled[0],n.rangeMax=n.rangeEnabled[n.rangeEnabled.length-1])},zD=n=>{var u,e;n.selectedDates=(u=n.settings.selected.dates)!=null&&u[0]?Ra(n.settings.selected.dates):[],n.selectedHolidays=(e=n.settings.selected.holidays)!=null&&e[0]?Ra(n.settings.selected.holidays):[]},SD=n=>{n.dateMin=n.settings.visibility.disabled?Gu(n.date.min):Gu(n.rangeMin),n.dateMax=n.settings.visibility.disabled?Gu(n.date.max):Gu(n.rangeMax)},wD=n=>{const u=n.settings.selection.time===!0||n.settings.selection.time===12;if(u||n.settings.selection.time===24){let e=!1;if(typeof n.settings.selected.time=="string"){const a=u?/^([0-9]|0[1-9]|1[0-2]):([0-5][0-9])|(AM|PM)/g:/^([0-1]?[0-9]|2[0-3]):([0-5][0-9])/g;n.settings.selected.time.replace(a,(i,t,r,o)=>(t&&r&&(e=!0,n.selectedHours=t,n.selectedMinutes=r),o&&u?n.selectedKeeping=o:u&&(n.selectedKeeping="AM"),""))}!e&&u?(n.selectedHours=pi(String(n.date.today.getHours())),n.selectedMinutes=String(n.date.today.getMinutes()),n.selectedKeeping=Number(n.date.today.getHours())>=12?"PM":"AM"):e||(n.selectedHours=String(n.date.today.getHours()),n.selectedMinutes=String(n.date.today.getMinutes())),n.selectedHours=Number(n.selectedHours)<10?`0${Number(n.selectedHours)}`:`${n.selectedHours}`,n.selectedMinutes=Number(n.selectedMinutes)<10?`0${Number(n.selectedMinutes)}`:`${n.selectedMinutes}`,n.selectedTime=`${n.selectedHours}:${n.selectedMinutes}${n.selectedKeeping?` ${n.selectedKeeping}`:""}`}else if(n.settings.selection.time)throw new Error(Ia.incorrectTime)},MD=n=>{n.correctMonths=n.type==="multiple"?n.months===1?2:n.months>12?12:n.months:1},D1=n=>{n.currentType=n.type,BD(n),yD(n),zD(n),SD(n),wD(n),MD(n)},ns=({arrowPrev:n,arrowNext:u,isPrevHidden:e,isNextHidden:a})=>{n.style.visibility=e?"hidden":"",u.style.visibility=a?"hidden":""},Ir=n=>{var u,e;if(n.currentType==="month")return;const a=(u=n.HTMLElement)==null?void 0:u.querySelector(`.${n.CSSClasses.arrowPrev}`),i=(e=n.HTMLElement)==null?void 0:e.querySelector(`.${n.CSSClasses.arrowNext}`);!a||!i||{default:()=>{const t=Gu(ce(new Date(n.selectedYear,n.selectedMonth,1))),r=new Date(t.getTime()),o=new Date(t.getTime());r.setMonth(r.getMonth()-n.jumpMonths),o.setMonth(o.getMonth()+n.jumpMonths),n.settings.selection.year||(n.dateMin.setFullYear(t.getFullYear()),n.dateMax.setFullYear(t.getFullYear()));const s=!n.settings.selection.month||r.getFullYear()n.dateMax.getFullYear()||o.getFullYear()===n.dateMax.getFullYear()&&o.getMonth()>n.dateMax.getMonth();ns({arrowPrev:a,arrowNext:i,isPrevHidden:s,isNextHidden:l})},year:()=>{ns({arrowPrev:a,arrowNext:i,isPrevHidden:n.dateMin.getFullYear()&&n.viewYear-7<=n.dateMin.getFullYear(),isNextHidden:n.dateMax.getFullYear()&&n.viewYear+7>=n.dateMax.getFullYear()})}}[n.currentType==="multiple"?"default":n.currentType]()},m1=(n,u)=>{if(!n)return null;const e=Gu(n),a=u?e.getDay()||7:e.getDay();e.setDate(e.getDate()+4-a);const i=new Date(e.getFullYear(),0,1),t=Math.ceil(((+e-+i)/864e5+1)/7);return{year:e.getFullYear(),week:t}},TD=(n,u,e,a)=>{const i=e.querySelector(`[data-calendar-day="${n}"]`);i&&(u!=null&&u.modifier&&i.classList.add(...u.modifier.trim().split(" ")),u!=null&&u.html&&(i.parentElement.innerHTML+=`${u.html}
`))},_D=(n,u)=>{var e;n.popups&&((e=Object.entries(n.popups))==null||e.forEach(([a,i])=>TD(a,i,u,n.CSSClasses.dayPopup)))},PD=(n,u,e,a,i)=>{const t=u[e].querySelector(`.${n.CSSClasses.dayBtn}`),r=m1(t==null?void 0:t.dataset.calendarDay,n.settings.iso8601);if(!r)return;const o=a.cloneNode(!0);o.innerText=String(r.week),o.dataset.calendarYearWeek=String(r.year),i.appendChild(o)},jD=(n,u,e,a,i)=>{if(!n.settings.visibility.weekNumbers)return;a.textContent="";const t=document.createElement("b");t.className=n.CSSClasses.weekNumbersTitle,t.innerText="#",a.appendChild(t);const r=document.createElement("div");r.className=n.CSSClasses.weekNumbersContent,a.appendChild(r);const o=document.createElement("button");o.type="button",o.className=n.CSSClasses.weekNumber;const s=i.querySelectorAll(`.${n.CSSClasses.day}`),l=Math.ceil((u+e)/7);for(let E=0;E{var a,i,t,r,o;const s=(a=n.settings.range.disableWeekday)==null?void 0:a.includes(e),l=n.settings.range.disableAllDays&&!!((i=n.rangeEnabled)!=null&&i[0]);!s&&!l||(t=n.rangeEnabled)!=null&&t.includes(u)||(r=n.rangeDisabled)!=null&&r.includes(u)||(n.rangeDisabled.push(u),(o=n.rangeDisabled)==null||o.sort((E,d)=>+new Date(E)-+new Date(d)))},ND=(n,u,e,a,i,t,r)=>{var o,s,l;if((Gu(n.rangeMin)>Gu(t)||Gu(n.rangeMax)1&&n.settings.selection.day==="multiple-ranged"&&(n.selectedDates[0]===t&&e.classList.add(n.CSSClasses.daySelectedFirst),n.selectedDates[n.selectedDates.length-1]===t&&e.classList.add(n.CSSClasses.daySelectedLast),n.selectedDates[0]!==t&&n.selectedDates[n.selectedDates.length-1]!==t&&e.classList.add(n.CSSClasses.daySelectedIntermediate))),n.settings.range.edgesOnly&&n.selectedDates.length>1&&n.settings.selection.day==="multiple-ranged"){const E=+new Date(n.selectedDates[0]),d=+new Date(n.selectedDates[n.selectedDates.length-1]),c=+new Date(t);c>E&&c{const s=document.createElement("div");s.className=n.CSSClasses.day;const l=document.createElement("button");l.className=`${n.CSSClasses.dayBtn}${o?` ${o}`:""}`,l.type="button",l.innerText=String(a),l.dataset.calendarDay=t,n.settings.visibility.weekNumbers&&(()=>{const E=m1(t,n.settings.iso8601);E&&(l.dataset.calendarWeekNumber=String(E.week))})(),r?n.settings.visibility.daysOutside&&s.appendChild(l):s.appendChild(l),LD(n,t,i),ND(n,u,s,l,i,t,r),e.appendChild(s),n.actions.getDays&&n.actions.getDays(a,t,s,l,n)},RD=(n,u,e,a,i)=>{let t=new Date(e,a,0).getDate()-(i-1);const r=a===0?e-1:e,o=a===0?12:a<10?`0${a}`:a;for(let s=i;s>0;s--,t++){const l=`${r}-${o}-${t}`,E=Gu(l).getDay();Gr(n,e,u,t,E,l,!0,n.CSSClasses.dayBtnPrev)}},KD=(n,u,e,a,i)=>{for(let t=1;t<=e;t++){const r=new Date(a,i,t),o=ce(r),s=r.getDay();Gr(n,a,u,t,s,o,!1,null)}},HD=(n,u,e,a,i,t)=>{const r=t+e,o=7*Math.ceil(r/7)-r,s=i+1===12?a+1:a,l=i+1===12?"01":i+2<10?`0${i+2}`:i+2;for(let E=1;E<=o;E++){const d=`${s}-${l}-${E<10?`0${E}`:String(E)}`,c=Gu(d).getDay();Gr(n,a,u,E,c,d,!0,n.CSSClasses.dayBtnNext)}},bt=n=>{const u=n.HTMLElement.querySelectorAll(`.${n.CSSClasses.days}`),e=n.HTMLElement.querySelectorAll(`.${n.CSSClasses.weekNumbers}`),a=new Date(n.selectedYear,n.selectedMonth,1);u.forEach((i,t)=>{const r=new Date(a);r.setMonth(r.getMonth()+t);const o=r.getMonth(),s=r.getFullYear(),l=new Date(s,o,1),E=new Date(s,o+1,0).getDate(),d=n.settings.iso8601?(l.getDay()!==0?l.getDay():7)-1:l.getDay();n.settings.selection.day&&i.classList.add(n.CSSClasses.daysSelecting),i.textContent="",RD(n,i,s,o,d),KD(n,i,E,s,o),HD(n,i,E,s,o,d),jD(n,d,E,e[t],i),_D(n,i)})},OD=(n,u,e,a)=>{const i=new Date(a.setMonth(n.selectedMonth+e)).getMonth(),t=n.settings.selection.month===!1||n.settings.selection.month==="only-arrows";u.tabIndex=t?-1:0,u.classList.toggle(n.CSSClasses.monthDisabled,t),u.setAttribute("data-calendar-selected-month",String(i)),u.innerText=n.locale.months[i]},ID=(n,u,e,a)=>{const i=new Date(a.setFullYear(n.selectedYear,n.selectedMonth+e)).getFullYear(),t=n.settings.selection.year===!1||n.settings.selection.year==="only-arrows";u.tabIndex=t?-1:0,u.classList.toggle(n.CSSClasses.yearDisabled,t),u.setAttribute("data-calendar-selected-year",String(i)),u.innerText=String(i)},qt=n=>{var u,e;const a=(u=n.HTMLElement)==null?void 0:u.querySelectorAll("[data-calendar-selected-month]"),i=(e=n.HTMLElement)==null?void 0:e.querySelectorAll("[data-calendar-selected-year]");if(!(a!=null&&a[0])&&(i!=null&&i[0]))return;const t=new Date(n.selectedYear,n.selectedMonth,1);a==null||a.forEach((r,o)=>OD(n,r,o,t)),i==null||i.forEach((r,o)=>ID(n,r,o,t))},ur=(n,u)=>{const e=Gu(ce(new Date(n.selectedYear,n.selectedMonth,1)));({prev:()=>e.setMonth(e.getMonth()-n.jumpMonths),next:()=>e.setMonth(e.getMonth()+n.jumpMonths)})[u](),[n.selectedMonth,n.selectedYear]=[e.getMonth(),e.getFullYear()],qt(n),Ir(n),bt(n)},GD=n=>` `,VD=n=>` `,$D=n=>` `,JD=n=>` `,WD=n=>`
`,UD=n=>`
`,qD=n=>`
`,ZD=n=>`
`,YD=n=>n.settings.visibility.weekNumbers?`
`:"",QD=n=>n.settings.selection.time?`
`:"",XD=Object.freeze(Object.defineProperty({__proto__:null,ArrowNext:VD,ArrowPrev:GD,ControlTime:QD,Days:UD,Month:$D,Months:qD,Week:WD,WeekNumbers:YD,Year:JD,Years:ZD},Symbol.toStringTag,{value:"Module"})),um=n=>XD[n],Ya=(n,u)=>u.replace(/[\n\t]/g,"").replace(/<#(?!\/?Multiple)(.*?)>/g,(e,a)=>{const i=um(a.replace(/[/\s\n\t]/g,"")),t=i?i(n):"";return n.sanitizer(t)}).replace(/[\n\t]/g,""),em=(n,u)=>u.replace(/<#Multiple>(.*?)<#\/Multiple>/g,(e,a)=>{let i="";for(let t=0;t{const{HTMLElement:e,CSSClasses:a,DOMTemplates:i,type:t,currentType:r,correctMonths:o}=n,s=(E,d)=>{if(!u)return;const c=e.querySelector(`.${a.controls}`);c&&e.removeChild(c),e.querySelector(`.${a.grid}`).classList.add(a.gridDisabled);const D=u.closest(`.${a.column}`);D.classList.add(E),D.innerHTML=Ya(n,d)},l={default:()=>{e.classList.add(a.calendarDefault),e.classList.remove(a.calendarMonth,a.calendarYear),e.innerHTML=Ya(n,i.default)},multiple:()=>{o&&(e.classList.add(a.calendarMultiple),e.classList.remove(a.calendarMonth,a.calendarYear),e.innerHTML=em(n,Ya(n,i.multiple)))},month:()=>{t!=="multiple"?(e.classList.add(a.calendarMonth),e.classList.remove(a.calendarDefault,a.calendarYear),e.innerHTML=Ya(n,i.month)):s(a.columnMonth,i.month)},year:()=>{t!=="multiple"?(e.classList.add(a.calendarYear),e.classList.remove(a.calendarDefault,a.calendarMonth),e.innerHTML=Ya(n,i.year)):s(a.columnYear,i.year)}};e.classList.add(a.calendar),l[r]()},am=(n,u,e,a,i)=>{const t=u.cloneNode(!1);return t.className=`${n.CSSClasses.yearsYear}${e===i?` ${n.CSSClasses.yearsYearSelected}`:a?` ${n.CSSClasses.yearsYearDisabled}`:""}`,t.dataset.calendarYear=String(i),t.title=String(i),t.innerText=String(i),a&&(t.tabIndex=-1),t},$r=(n,u)=>{const e=u!=null&&u.dataset.calendarSelectedYear?Number(u==null?void 0:u.dataset.calendarSelectedYear):n.selectedYear;n.currentType="year",Vr(n,u),qt(n),Ir(n);const a=n.HTMLElement.querySelector(`.${n.CSSClasses.years}`);if(!n.settings.selection.year||!a)return;a.classList.add(n.CSSClasses.yearsSelecting);const i=n.type!=="multiple"||n.selectedYear===e?0:1,t=document.createElement("button");t.type="button";for(let r=n.viewYear-7;rn.dateMax.getFullYear(),s=am(n,t,e,o,r);a.appendChild(s),n.actions.getYears&&n.actions.getYears(r,s,n)}},im=(n,u)=>{const e=u.target.closest(`.${n.CSSClasses.arrow}`);e&&(["default","multiple"].includes(n.currentType)?ur(n,e.dataset.calendarArrow):n.currentType==="year"&&n.viewYear!==void 0&&(n.viewYear+={prev:-15,next:15}[e.dataset.calendarArrow],$r(n,u.target)),n.actions.clickArrow&&n.actions.clickArrow(u,n))},tm=(n,u)=>{var e;if(!n.settings.visibility.weekNumbers||!n.actions.clickWeekNumber)return;const a=u.target.closest(`.${n.CSSClasses.weekNumber}`),i=(e=n.HTMLElement)==null?void 0:e.querySelectorAll("[data-calendar-week-number]");if(!a||!i)return;const t=Number(a.innerText),r=Number(a.dataset.calendarYearWeek),o=Array.from(i).filter(s=>Number(s.dataset.calendarWeekNumber)===t);n.actions.clickWeekNumber(u,t,o,r,n)},h1=n=>`${n.charAt(0).toUpperCase()}${n.substring(1,n.length)}`.replace(/\./,""),nm=(n,u)=>{const e=new Date(`1978-01-0${u+1}T00:00:00.000Z`).toLocaleString(n.settings.lang,{weekday:"short",timeZone:"UTC"});n.locale.weekday.push(h1(e))},rm=(n,u)=>{const e=new Date(`1978-${u+1<=9?`0${u+1}`:u+1}-01T00:00:00.000Z`).toLocaleString(n.settings.lang,{month:"long",timeZone:"UTC"});n.locale.months.push(h1(e))},om=n=>{if(n.settings.lang!=="define"||!n.locale.weekday[6]||!n.locale.months[11]){if(n.settings.lang==="define")throw new Error(Ia.notLocale);n.locale.weekday=[],n.locale.months=[];for(let u=0;u<7;u++)nm(n,u);for(let u=0;u<12;u++)rm(n,u)}},rs=n=>{if(n.type!=="multiple")return 0;const u=n.HTMLElement.querySelectorAll(`.${n.CSSClasses.column}`),e=Array.from(u).findIndex(a=>a.classList.contains(`${n.CSSClasses.columnMonth}`));return e>0?e:0},sm=(n,u,e,a,i,t)=>{const r=u.cloneNode(!1);return r.className=`${n.CSSClasses.monthsMonth}${e===t?` ${n.CSSClasses.monthsMonthSelected}`:i?` ${n.CSSClasses.monthsMonthDisabled}`:""}`,r.title=a,r.innerText=`${n.settings.visibility.monthShort?a.substring(0,3):a}`,r.dataset.calendarMonth=String(t),i&&(r.tabIndex=-1),r},x1=(n,u)=>{var e,a;const i=u!=null&&u.dataset.calendarSelectedMonth?Number(u.dataset.calendarSelectedMonth):n.selectedMonth,t=(e=u==null?void 0:u.closest(`.${n.CSSClasses.column}`))==null?void 0:e.querySelector(`.${n.CSSClasses.year}`),r=t?Number(t.dataset.calendarSelectedYear):n.selectedYear;n.currentType="month",Vr(n,u),qt(n);const o=(a=n.HTMLElement)==null?void 0:a.querySelector(`.${n.CSSClasses.months}`);if(!n.settings.selection.month||!o)return;o.classList.add(n.CSSClasses.monthsSelecting);const s=n.jumpMonths>1?n.locale.months.map((E,d)=>i-n.jumpMonths*d).concat(n.locale.months.map((E,d)=>i+n.jumpMonths*d)).filter(E=>E>=0&&E<=12):Array.from(Array(12).keys()),l=document.createElement("button");l.type="button";for(let E=0;E<12;E++){const d=n.locale.months[E],c=En.dateMax.getMonth()+rs(n)&&r>=n.dateMax.getFullYear()||E!==i&&!s.includes(E),D=sm(n,l,i,d,c,E);o.appendChild(D),n.actions.getMonths&&n.actions.getMonths(E,D,n)}},Jr=(n,u)=>n&&u?{0:{AM:"00",PM:"12"},1:{AM:"01",PM:"13"},2:{AM:"02",PM:"14"},3:{AM:"03",PM:"15"},4:{AM:"04",PM:"16"},5:{AM:"05",PM:"17"},6:{AM:"06",PM:"18"},7:{AM:"07",PM:"19"},8:{AM:"08",PM:"20"},9:{AM:"09",PM:"21"},10:{AM:"10",PM:"22"},11:{AM:"11",PM:"23"},12:{AM:"12",PM:"12"}}[Number(n)][u]:"",Pi=(n,u,e)=>n.querySelector(`.${u}${e?` input[name="${e}"]`:""}`),os=(n,u,e)=>{n.addEventListener("mouseover",()=>u.classList.add(e)),n.addEventListener("mouseout",()=>u.classList.remove(e))},Ea=(n,u,e,a)=>{({hours:()=>{n.selectedHours=e},minutes:()=>{n.selectedMinutes=e}})[a](),n.selectedTime=`${n.selectedHours}:${n.selectedMinutes}${n.selectedKeeping?` ${n.selectedKeeping}`:""}`,n.actions.changeTime&&n.actions.changeTime(u,n),n.input&&n.HTMLInputElement&&n.actions.changeToInput&&n.actions.changeToInput(u,n)},ss=(n,u,e,a,i,t)=>{u.addEventListener("input",r=>{const o=r.target,s=Number(o.value),l=s<10?`0${s}`:`${s}`;if(i!=="hours"||t!==12)return e.value=l,void Ea(n,r,l,i);s0?(e.value=l,n.selectedKeeping="AM",a.innerText=n.selectedKeeping,Ea(n,r,l,i)):(s===0?(n.selectedKeeping="AM",a.innerText="AM"):(n.selectedKeeping="PM",a.innerText="PM"),e.value=pi(o.value),Ea(n,r,pi(o.value),i))})},ls=(n,u,e,a,i,t)=>{e.addEventListener("change",r=>{const o=r.target,s=Number(o.value),l=s<10?`0${s}`:`${s}`;i==="hours"&&t===12?o.value&&s<=t&&s>0?(o.value=l,u.value=Jr(l,n.selectedKeeping),Ea(n,r,l,i)):o.value&&s<24&&(s>t||s===0)?(s===0?(n.selectedKeeping="AM",a.innerText="AM"):(n.selectedKeeping="PM",a.innerText="PM"),o.value=pi(o.value),u.value=l,Ea(n,r,pi(o.value),i)):o.value=n.selectedHours:o.value&&s<=t&&s>=0?(o.value=l,u.value=l,Ea(n,r,l,i)):i==="hours"?o.value=n.selectedHours:i==="minutes"&&(o.value=n.selectedMinutes)})},lm=(n,u,e)=>{u.addEventListener("click",a=>{n.selectedKeeping=u.innerText.includes("AM")?"PM":"AM",u.innerText=n.selectedKeeping,e.value=Jr(n.selectedHours,n.selectedKeeping),Ea(n,a,n.selectedHours,"hours")})},Em=(n,u,e)=>{const a=e===24?23:e||12,i=Pi(u,n.CSSClasses.timeRange,"hours"),t=Pi(u,n.CSSClasses.timeRange,"minutes"),r=Pi(u,n.CSSClasses.timeHours,"hours"),o=Pi(u,n.CSSClasses.timeMinutes,"minutes"),s=u.querySelector(`.${n.CSSClasses.timeKeeping}`);os(i,r,n.CSSClasses.isFocus),os(t,o,n.CSSClasses.isFocus),ss(n,i,r,s,"hours",a),ss(n,t,o,s,"minutes",0),ls(n,i,r,s,"hours",a),ls(n,t,o,s,"minutes",59),s&&lm(n,s,i)},Es=(n,u,e,a)=>` `,ds=(n,u,e,a,i,t)=>` `,dm=n=>{const u=n.HTMLElement.querySelector(`.${n.CSSClasses.time}`);if(!u)return;const e=n.settings.selection.time===!0?12:n.settings.selection.time,a=n.settings.selection.controlTime==="range",[i,t]=[0,23],[r,o]=[0,59];u.innerHTML=n.sanitizer(`${Es("hours",n.CSSClasses.timeHours,n.selectedHours,a)}${Es("minutes",n.CSSClasses.timeMinutes,n.selectedMinutes,a)}${e===12?`${n.selectedKeeping} `:""}
${ds("hours",n.CSSClasses.timeRange,i,t,n.settings.selection.stepHours,n.selectedKeeping?Jr(n.selectedHours,n.selectedKeeping):n.selectedHours)}${ds("minutes",n.CSSClasses.timeRange,r,o,n.settings.selection.stepMinutes,n.selectedMinutes)}
`),Em(n,u,e)},cm=(n,u,e)=>{const a=document.createElement("b");u.textContent="";for(let i=0;i{const u=[...n.locale.weekday];u[0]&&(n.settings.iso8601&&u.push(u.shift()),n.HTMLElement.querySelectorAll(`.${n.CSSClasses.week}`).forEach(e=>cm(n,e,u)))},g1=["light","dark","system"],ft={value:!1,set:()=>{ft.value=!0},check:()=>ft.value},C1=(n,u)=>g1.find(e=>{var a;return e!=="system"&&((a=n.getAttribute(u))==null?void 0:a.includes(e))}),da=(n,u)=>{n.dataset.calendarTheme=u},Ds=(n,u)=>{var e;if(e=u,da(n.HTMLElement,e.matches?"dark":"light"),n.settings.visibility.theme!=="system"||ft.check())return;const a=i=>{const t=document.querySelectorAll(`.${n.CSSClasses.calendar}`);t==null||t.forEach(r=>da(r,i.matches?"dark":"light"))};u.addEventListener?u.addEventListener("change",a):u.addListener(a),ft.set()},Dm=(n,u,e)=>{new MutationObserver(a=>{for(let i=0;i{const e=n.settings.visibility.themeDetect?document.querySelector(n.settings.visibility.themeDetect):null;if(!e)return void Ds(n,u);const a=n.settings.visibility.themeDetect.replace(/^.*\[(.+)\]/g,(t,r)=>r),i=C1(e,a);i?(da(n.HTMLElement,i),Dm(n,e,a)):Ds(n,u)},hm=n=>{if(!g1.includes(n.settings.visibility.theme))throw new Error(Ia.incorrectTheme);if(window.matchMedia("(prefers-color-scheme)").media==="not all")return void da(n.HTMLElement,"light");({light:()=>da(n.HTMLElement,"light"),dark:()=>da(n.HTMLElement,"dark"),system:()=>mm(n,window.matchMedia("(prefers-color-scheme: dark)"))})[n.settings.visibility.theme]()},Bi=n=>{const u={default:()=>{cs(n),bt(n)},multiple:()=>{cs(n),bt(n)},month:()=>x1(n),year:()=>$r(n)};hm(n),om(n),Vr(n),qt(n),Ir(n),dm(n),u[n.currentType]()},Fu={self:null,rangeMin:void 0,rangeMax:void 0},ms=()=>{var n;if(!((n=Fu.self)!=null&&n.HTMLElement))return;const{CSSClasses:u}=Fu.self;Fu.self.HTMLElement.querySelectorAll(`.${Fu.self.CSSClasses.dayBtnHover}`).forEach(e=>{var a;e.classList.remove(Fu.self.CSSClasses.dayBtnHover),(a=e.parentElement)==null||a.classList.remove(u.dayHoverIntermediate,u.dayHoverFirst,u.dayHoverLast)})},xm=(n,u,e)=>{var a,i,t;if(!((a=Fu.self)!=null&&a.selectedDates))return;const r=ce(n),{CSSClasses:o}=Fu.self;if((i=Fu.self.rangeDisabled)!=null&&i.includes(r))return;const s=(t=Fu.self.HTMLElement)==null?void 0:t.querySelectorAll(`[data-calendar-day="${r}"]`);s==null||s.forEach(l=>{var E;l.classList.add(o.dayBtnHover),(E=l.parentElement)==null||E.classList.add(o.dayHoverIntermediate)}),u==null||u.forEach(l=>{var E;return(E=l.parentElement)==null?void 0:E.classList.add(o.dayHoverFirst)}),e==null||e.forEach(l=>{var E;return(E=l.parentElement)==null?void 0:E.classList.add(o.dayHoverLast)})},er=n=>{var u;if(!n.target||!((u=Fu.self)!=null&&u.selectedDates))return;if(!n.target.closest(`.${Fu.self.CSSClasses.days}`))return void ms();const e=n.target.closest("[data-calendar-day]");if(!e)return;const a=e.dataset.calendarDay,i=Gu(Fu.self.selectedDates[0]),t=Gu(a),r=Fu.self.HTMLElement.querySelectorAll(`[data-calendar-day="${Fu.self.selectedDates[0]}"]`),o=Fu.self.HTMLElement.querySelectorAll(`[data-calendar-day="${a}"]`),[s,l]=i{Fu.self&&n.key==="Escape"&&(Fu.self.selectedDates=[],Fu.self.HTMLElement.removeEventListener("mousemove",er),document.removeEventListener("keydown",ar),Bi(Fu.self))},gm=()=>{var n,u,e;if(!((u=(n=Fu.self)==null?void 0:n.selectedDates)!=null&&u[0])||!Fu.self.rangeDisabled||((e=Fu.self.rangeDisabled)==null?void 0:e.length)<2)return;const a=Gu(Fu.self.selectedDates[0]),[i,t]=Fu.self.rangeDisabled.map(r=>Gu(r)).reduce(([r,o],s)=>[a>=s?s:r,a{Fu.self&&(Fu.self.rangeMin=Fu.rangeMin,Fu.self.rangeMax=Fu.rangeMax)},p1=(n,u)=>{var e;if(u){const a=n.selectedDates.length===1&&n.selectedDates[0].includes(u);n.selectedDates=a&&!n.settings.selection.cancelableDay?[u,u]:a&&n.settings.selection.cancelableDay?[]:n.selectedDates.length>1?[u]:[...n.selectedDates,u],(e=n.selectedDates)==null||e.sort((i,t)=>+new Date(i)-+new Date(t))}n.settings.range.disableGaps&&(Fu.rangeMin=Fu.rangeMin?Fu.rangeMin:n.rangeMin,Fu.rangeMax=Fu.rangeMax?Fu.rangeMax:n.rangeMax),Fu.self=n,{set:()=>{n.HTMLElement.addEventListener("mousemove",er),document.addEventListener("keydown",ar),n.settings.range.disableGaps&&gm()},reset:()=>{const[a,i]=[n.selectedDates[0],n.selectedDates[n.selectedDates.length-1]];n.selectedDates=n.selectedDates[0]!==n.selectedDates[n.selectedDates.length-1]?n.settings.range.edgesOnly?[a,i]:Ra([`${a}:${i}`]):[n.selectedDates[0],n.selectedDates[0]],n.HTMLElement.removeEventListener("mousemove",er),document.removeEventListener("keydown",ar),n.settings.range.disableGaps&&Cm()}}[n.selectedDates.length===1?"set":"reset"]()},hs=(n,u,e)=>{if(!u.dataset.calendarDay)return;const a=u.dataset.calendarDay,i=u.classList.contains(n.CSSClasses.dayBtnSelected);if(i&&!n.settings.selection.cancelableDay)return;let t=!0;n.toggleSelected!==void 0&&(t=typeof n.toggleSelected=="function"?n.toggleSelected(n):n.toggleSelected),i&&!t||(n.selectedDates=i?n.selectedDates.filter(r=>r!==a):e?[...n.selectedDates,a]:[a])},pm=(n,u)=>{var e;const a=u.target,i=s=>a.closest(`.${s}`),t=i(n.CSSClasses.dayBtn);if(!n.settings.selection.day||!["single","multiple","multiple-ranged"].includes(n.settings.selection.day)||!t)return;({single:()=>hs(n,t,!1),multiple:()=>hs(n,t,!0),"multiple-ranged":()=>p1(n,t.dataset.calendarDay)})[n.settings.selection.day](),(e=n.selectedDates)==null||e.sort((s,l)=>+new Date(s)-+new Date(l)),n.actions.clickDay&&n.actions.clickDay(u,n),n.input&&n.HTMLInputElement&&n.HTMLElement&&n.actions.changeToInput&&n.actions.changeToInput(u,n);const r=i(n.CSSClasses.dayBtnPrev),o=i(n.CSSClasses.dayBtnNext);({prev:()=>ur(n,"prev"),next:()=>ur(n,"next"),default:()=>bt(n)})[r?"prev":o?"next":"default"]()},xs=(n,u,e,a,i)=>{const t=n.HTMLElement.querySelectorAll(`.${n.CSSClasses.column}`),r=Array.from(t).findIndex(s=>s.classList.contains(u)),o=Number(t[r].querySelector(`.${e}`).getAttribute(i));return n.currentType==="month"&&r>=0?a-r:n.currentType==="year"&&n.selectedYear!==o?a-1:a},Fm=(n,u,e,a,i)=>{const t={year:()=>{var r,o;return(o=(r=n.actions).clickYear)==null?void 0:o.call(r,u,n)},month:()=>{var r,o;return(o=(r=n.actions).clickMonth)==null?void 0:o.call(r,u,n)}};({year:()=>{if(n.type==="multiple"){const r=xs(n,n.CSSClasses.columnYear,n.CSSClasses.year,Number(i.dataset.calendarYear),"data-calendar-selected-year"),o=n.selectedMonthn.dateMax.getMonth()&&r>=n.dateMax.getFullYear(),l=rn.dateMax.getFullYear();o||l?(n.selectedYear=n.dateMin.getFullYear(),n.selectedMonth=n.dateMin.getMonth()):s||E?(n.selectedYear=n.dateMax.getFullYear(),n.selectedMonth=n.dateMax.getMonth()):n.selectedYear=r}else n.selectedYear=Number(i.dataset.calendarYear)},month:()=>{if(n.type==="multiple"){const r=xs(n,n.CSSClasses.columnMonth,n.CSSClasses.month,Number(i.dataset.calendarMonth),"data-calendar-selected-month"),o=i.closest(`.${a.column}`).querySelector(`.${n.CSSClasses.year}`);n.selectedYear=Number(o.dataset.calendarSelectedYear);const s=rn.dateMax.getMonth()&&n.selectedYear>=n.dateMax.getFullYear();n.selectedMonth=s?n.dateMin.getMonth():l?n.dateMax.getMonth():r}else n.selectedMonth=Number(i.dataset.calendarMonth)}})[e](),t[e](),n.currentType=n.type,Bi(n)},gs=(n,u,e,a)=>{if(!n.settings.selection[e])return;const i=u.target,t=E=>i.closest(`.${E}`),r=t(a.header),o=t(a.item),s=t(n.CSSClasses.grid),l=t(n.CSSClasses.column);n.currentType!==e&&r?{year:()=>$r(n,i),month:()=>x1(n,i)}[e]():o?Fm(n,u,e,a,o):(n.currentType===e&&r||n.type==="multiple"&&n.currentType===e&&s&&!l)&&(n.currentType=n.type,Bi(n))},F1=n=>{const u=e=>{im(n,e),tm(n,e),pm(n,e),gs(n,e,"month",{header:n.CSSClasses.month,item:n.CSSClasses.monthsMonth,column:n.CSSClasses.columnMonth}),gs(n,e,"year",{header:n.CSSClasses.year,item:n.CSSClasses.yearsYear,column:n.CSSClasses.columnYear})};return n.HTMLElement.addEventListener("click",u),()=>n.HTMLElement.removeEventListener("click",u)},k1=(n,{year:u,month:e,dates:a,holidays:i,time:t}={})=>{var r;const o=c1({},n.settings.selected);n.settings.selected.year=u?o.year:n.selectedYear,n.settings.selected.month=e?o.month:n.selectedMonth,n.settings.selected.holidays=i?o.holidays:n.selectedHolidays,n.settings.selected.time=t?o.time:n.selectedTime,n.settings.selected.dates=a==="only-first"&&((r=n.selectedDates)!=null&&r[0])?[n.selectedDates[0]]:a===!0?o.dates:n.selectedDates,D1(n),Bi(n),n.settings.selected=o,n.settings.selection.day==="multiple-ranged"&&a&&p1(n)};function v1(n){if(!n||!n.getBoundingClientRect)return;const u=n.getBoundingClientRect(),e=document.documentElement;return{bottom:u.bottom,right:u.right,top:u.top+window.pageYOffset-e.clientTop,left:u.left+window.pageXOffset-e.clientLeft}}function km(){return{left:window.pageXOffset||document.documentElement.scrollLeft||0,top:window.pageYOffset||document.documentElement.scrollTop||0}}function A1(){return{vw:Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),vh:Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)}}function vm(n){var u,e;let a=0,i=0,t=0,r=0;const o=km(),s=v1(n),{vh:l,vw:E}=A1(),d=o.top,c=o.left;if(s){const D=(u=s.top)!=null?u:0,m=(e=s.left)!=null?e:0;i=D-d,t=m-c,a=l-(D-d+n.clientHeight),r=E-(m-c+n.clientWidth)}return{top:i,bottom:a,left:t,right:r}}function Am(n,u,e=5){const a={top:!0,bottom:!0,left:!0,right:!0},i=[];if(u&&n){const{bottom:t,top:r}=vm(n),{top:o,left:s}=v1(n),{height:l,width:E}=u.getBoundingClientRect(),{vh:d,vw:c}=A1(),D={x:c/2,y:d/2};oD.y&&i.push("bottom"),sD.x&&i.push("right"),l>r-e&&(a.top=!1),l>t-e&&(a.bottom=!1),E>s&&(a.left=!1),c-s{if(n){const i=e==="auto"?bm(n,u):e,t={top:-u.offsetHeight,bottom:n.offsetHeight,left:0,center:n.offsetWidth/2-u.offsetWidth/2,right:n.offsetWidth-u.offsetWidth},r=Array.isArray(i)?i[0]:"bottom",o=Array.isArray(i)?i[1]:i;u.classList.add(r==="bottom"?a.calendarToInputBottom:a.calendarToInputTop);const s=n.getBoundingClientRect(),l=window.scrollX||document.documentElement.scrollLeft,E=window.scrollY||document.documentElement.scrollTop,d=s.top+E+t[r],c=s.left+l+t[o];Object.assign(u.style,{left:`${c}px`,top:`${d}px`})}},fm=n=>{let u=!0;const e=[];n.HTMLInputElement=n.HTMLElement;const a=()=>xn(n.HTMLInputElement,n.HTMLElement,n.settings.visibility.positionToInput,n.CSSClasses),i=t=>{var r;n&&t.target!==n.HTMLInputElement&&!((r=n.HTMLElement)!=null&&r.contains(t.target))&&(n.HTMLInputElement&&n.HTMLElement&&n.hide(),window.removeEventListener("resize",a),document.removeEventListener("click",i,{capture:!0}))};return n.HTMLInputElement.addEventListener("click",()=>{u?e.push((()=>{const t=document.createElement("div");return t.className=`${n.CSSClasses.calendar} ${n.CSSClasses.calendarToInput} ${n.CSSClasses.calendarHidden}`,n.HTMLElement=t,document.body.appendChild(n.HTMLElement),u=!1,setTimeout(()=>{xn(n.HTMLInputElement,t,n.settings.visibility.positionToInput,n.CSSClasses),n.show()},0),k1(n,{year:!0,month:!0,dates:!0,holidays:!0,time:!0}),n.actions.initCalendar&&n.actions.initCalendar(n),F1(n)})()):(xn(n.HTMLInputElement,n.HTMLElement,n.settings.visibility.positionToInput,n.CSSClasses),n.show()),window.addEventListener("resize",a),document.addEventListener("click",i,{capture:!0})}),()=>{e.forEach(t=>t())}},Bm=n=>(n.HTMLOriginalElement=n.HTMLElement.cloneNode(!0),n.isInit=!0,n.input?fm(n):(D1(n),Bi(n),n.actions.initCalendar&&n.actions.initCalendar(n),F1(n))),ym=(n,{year:u,month:e,dates:a,holidays:i,time:t}={})=>{if(!n.isInit)throw new Error(Ia.notInit);k1(n,{year:u,month:e,dates:a,holidays:i,time:t}),n.actions.updateCalendar&&n.actions.updateCalendar(n)},zm=n=>{var u,e,a,i,t,r;if(!n.isInit)throw new Error(Ia.notInit);n.input?((e=(u=n.HTMLElement)==null?void 0:u.parentElement)==null||e.removeChild(n.HTMLElement),(i=(a=n.HTMLInputElement)==null?void 0:a.replaceWith)==null||i.call(a,n.HTMLOriginalElement),n.HTMLInputElement=void 0):(r=(t=n.HTMLElement)==null?void 0:t.replaceWith)==null||r.call(t,n.HTMLOriginalElement),n.HTMLElement=n.HTMLOriginalElement,n.actions.destroyCalendar&&n.actions.destroyCalendar(n)},Sm=n=>{n.currentType?(n.HTMLElement.classList.remove(n.CSSClasses.calendarHidden),n.actions.showCalendar&&n.actions.showCalendar(n)):n.HTMLElement.click()},wm=n=>{n.currentType&&(n.HTMLElement.classList.add(n.CSSClasses.calendarHidden),n.actions.hideCalendar&&n.actions.hideCalendar(n))};function ir(n,...u){const e=i=>i&&typeof i=="object"&&!Array.isArray(i);if(!u.length)return n;const a=u.shift();return e(n)&&e(a)&&Object.keys(a).forEach(i=>{e(a[i])?(n[i]||Object.assign(n,{[i]:{}}),ir(n[i],a[i])):Object.assign(n,{[i]:a[i]})}),ir(n,...u)}function Mm(n,u,e){n.settings=ir(n.settings,{[u]:e})}class b1 extends fD{constructor(u,e){if(super(),gu(this,"init",()=>Bm(this)),gu(this,"update",i=>ym(this,i)),gu(this,"destroy",()=>zm(this)),gu(this,"show",()=>Sm(this)),gu(this,"hide",()=>wm(this)),gu(this,"changeSetting",(i,t)=>Mm(this,i,t)),this.HTMLElement=typeof u=="string"?document.querySelector(u):u,!this.HTMLElement)throw new Error(Ia.notFoundSelector(u));if(!e)return;const a=(i,t)=>{Object.keys(t).forEach(r=>{typeof i[r]!="object"||typeof t[r]!="object"||t[r]instanceof Date?i[r]=t[r]:a(i[r],t[r])})};a(this,e)}}class f1{constructor(u){this.translaterService=u,this._clearFilterTriggered=!1,this._lastClickIsDate=!1,this._shouldTriggerQuery=!0,this.hasTimePicker=!1,this.inputFilterType="range",this.searchTerms=[],this._bindEventService=new vu}get gridOptions(){var u;return((u=this.grid)==null?void 0:u.getOptions())??{}}get columnFilter(){var u;return((u=this.columnDef)==null?void 0:u.filter)||{}}get currentDateOrDates(){return this._currentDateOrDates}get defaultOperator(){return this.inputFilterType==="compound"?P.empty:this.gridOptions.defaultFilterRangeOperator||P.rangeInclusive}get pickerOptions(){return this._pickerOptions||{}}get filterOptions(){var u,e;return{...(u=this.gridOptions.defaultFilterOptions)==null?void 0:u.date,...(e=this.columnFilter)==null?void 0:e.filterOptions}}get operator(){var u;return this.inputFilterType==="compound"?this._operator||this.columnFilter.operator||this.defaultOperator:((u=this.columnFilter)==null?void 0:u.operator)??this.defaultOperator}set operator(u){this.inputFilterType==="compound"?this._operator=u:this.columnFilter&&(this.columnFilter.operator=u)}init(u){if(!u)throw new Error('[Slickgrid-Universal] A filter must always have an "init()" with valid arguments.');this.grid=u.grid,this.callback=u.callback,this.columnDef=u.columnDef,this.inputFilterType==="compound"&&(this.operator=u.operator||""),this.searchTerms=(u==null?void 0:u.searchTerms)??[],this.filterContainerElm=u.filterContainerElm;const e=this.inputFilterType==="compound"?Array.isArray(this.searchTerms)&&this.searchTerms.length>=0?this.searchTerms[0]:"":this.searchTerms;this._filterElm=this.createDomFilterElement(e),this.searchTerms.length&&this._filterElm.classList.add("filled"),this._selectOperatorElm&&this._bindEventService.bind(this._selectOperatorElm,"change",this.onTriggerEvent.bind(this)),this._bindEventService.bind(document.body,"keydown",a=>{(a.key==="Escape"||a.key==="Tab")&&this.hide()}),this._bindEventService.bind(this._dateInputElm,"keydown",a=>{a.key==="Backspace"&&this.clear(!0)})}clear(u=!0){this.calendarInstance&&(this._clearFilterTriggered=!0,this._shouldTriggerQuery=u,this.searchTerms=[],this._selectOperatorElm&&(this._selectOperatorElm.selectedIndex=0),this.calendarInstance.input&&(this.calendarInstance.settings.selected.dates=[],this._dateInputElm.value="")),this.onTriggerEvent(new Event("keyup")),this._filterElm.classList.remove("filled")}destroy(){var u,e,a,i;this._bindEventService.unbindAll(),(u=this.calendarInstance)==null||u.destroy(),bu(this.filterContainerElm),(e=this.filterContainerElm)==null||e.remove(),(a=this._selectOperatorElm)==null||a.remove(),(i=this._filterElm)==null||i.remove()}hide(){var u;typeof((u=this.calendarInstance)==null?void 0:u.hide)=="function"&&this.calendarInstance.hide()}show(){var u;typeof((u=this.calendarInstance)==null?void 0:u.show)=="function"&&this.calendarInstance.show()}getValues(){return this._currentDateOrDates}setValues(u,e){let a;this.inputFilterType==="compound"?a=Array.isArray(u)?u[0]:u:typeof u=="string"||Array.isArray(u)&&typeof u[0]=="string"&&u[0].indexOf("..")>0?a=typeof u=="string"?[u]:u[0].split(".."):Array.isArray(u)&&(a=u),this.calendarInstance&&a!==void 0&&(At(this._dateInputElm,this.calendarInstance,a,this.columnDef,this.columnFilter),this._currentDateOrDates=u&&a?a:void 0);const i=this.getValues()||[];if(this.getValues()||Array.isArray(i)&&i.length>0&&u?this._filterElm.classList.add("filled"):this._filterElm.classList.remove("filled"),this.operator=e||this.defaultOperator,e&&this._selectOperatorElm){const t=La(this.operator);this._selectOperatorElm.value=t}}buildDatePickerInput(u){var c,D,m,h,x,g,F,C,A,b,B;const e=((c=this.columnDef)==null?void 0:c.id)??"",a=this.columnFilter.type||this.columnDef.type||p.dateIso,i=this.columnDef.outputType||this.columnFilter.type||this.columnDef.type||p.dateUtc,t=J0(i),r=this.columnFilter.type||this.columnDef.type||p.dateIso;t&&this.inputFilterType!=="range"&&(t==="ISO8601"||t.toLowerCase().includes("h"))&&(this.hasTimePicker=!0);const o=J0(this.hasTimePicker?p.dateTimeIsoAM_PM:p.dateIso),s=(((D=this.filterOptions)==null?void 0:D.locale)??((h=(m=this.translaterService)==null?void 0:m.getCurrentLanguage)==null?void 0:h.call(m)))||this.gridOptions.locale||"en";let l;this.inputFilterType==="compound"?u&&(l=u,this._currentDateOrDates=u):(typeof u=="string"||Array.isArray(u)&&typeof u[0]=="string"&&u[0].indexOf("..")>0?l=typeof u=="string"?[u]:u[0].split(".."):Array.isArray(u)&&(l=u),Array.isArray(l)&&(this._currentDateOrDates=l,this._currentDateStrings=l.map(S=>le(S,void 0,r))));const E={input:!0,jumpToSelectedDate:!0,type:this.inputFilterType==="range"?"multiple":"default",sanitizer:S=>this.grid.sanitizeHtmlString(S),toggleSelected:!1,actions:{clickDay:S=>{this._lastClickIsDate=!0},changeToInput:(S,z)=>{if(z.HTMLInputElement){let M=[],w="",N="";if(z.selectedDates[1]){z.selectedDates.sort((Y,lu)=>+new Date(Y)-+new Date(lu)),w=z.selectedDates[0],N=z.selectedDates[z.selectedDates.length-1];const G=l0(z.selectedDates[0],t,"en-US"),L=l0(N,t,"en-US");z.HTMLInputElement.value=`${G} — ${L}`,M=[w,N]}else z.selectedDates[0]?(w=z.selectedDates[0],z.HTMLInputElement.value=le(w,p.dateIso,i),M=z.selectedDates):z.HTMLInputElement.value="";if(this.hasTimePicker&&w){const G=kt(w,o);G.setHours(+(z.selectedHours||0)),G.setMinutes(+(z.selectedMinutes||0)),z.HTMLInputElement.value=le(G,void 0,i),M=[G]}if(this.inputFilterType==="compound"?this._currentValue=le(M[0],void 0,a):Array.isArray(M)&&(this._currentDateStrings=M.map(G=>le(G,void 0,a)),this._currentValue=this._currentDateStrings.join("..")),this._currentDateOrDates=M.map(G=>G instanceof Date?G:kt(G,o)),this._currentValue){const G=this.hasTimePicker?new Event("keyup"):void 0;this.onTriggerEvent(G)}this.inputFilterType==="range"&&z.selectedDates.length<2&&(this._lastClickIsDate=!1),this._lastClickIsDate&&(z.hide(),this._lastClickIsDate=!1)}}},settings:{lang:s,iso8601:!1,visibility:{theme:(x=this.gridOptions)!=null&&x.darkMode?"dark":"light",positionToInput:"auto",weekend:!1}}};this.inputFilterType==="range"&&(E.type="multiple",E.months=2,E.jumpMonths=2,E.settings={...E.settings,range:{edgesOnly:!0},selection:{day:"multiple-ranged"},visibility:{...(g=E.settings)==null?void 0:g.visibility,daysOutside:!1}}),this.hasTimePicker&&((F=E.settings).selection??(F.selection={}),E.settings.selection.time=24),this._pickerOptions=wu(!0,{},E,{settings:this.filterOptions});let d=((C=this.gridOptions)==null?void 0:C.defaultFilterPlaceholder)??"";(A=this.columnFilter)!=null&&A.placeholder&&(d=this.columnFilter.placeholder),this._dateInputElm=v("input",{type:"text",className:"form-control date-picker",placeholder:d,readOnly:!0,dataset:{input:"",columnid:`${e}`}}),this.calendarInstance=new b1(this._dateInputElm,this._pickerOptions),this.calendarInstance.init(),(B=(b=this._pickerOptions.settings)==null?void 0:b.selected)!=null&&B.dates&&(l=this._pickerOptions.settings.selected.dates),l&&At(this._dateInputElm,E,l,this.columnDef,this.columnFilter)}getOperatorOptionValues(){var u;return(u=this.columnFilter)!=null&&u.compoundOperatorList?this.columnFilter.compoundOperatorList:Or(this.gridOptions,this.translaterService)}createDomFilterElement(u){var a;const e=((a=this.columnDef)==null?void 0:a.id)??"";if(bu(this.filterContainerElm),this.buildDatePickerInput(u),this.inputFilterType==="range"){const i=v("div",{className:`date-picker form-group search-filter filter-${e}`});return Array.isArray(u)&&u.length>0&&u[0]!==""&&(this._currentDateOrDates=u,this._currentValue=u[0]),i.appendChild(this._dateInputElm),i&&this.filterContainerElm.appendChild(i),i}else{this._selectOperatorElm=Hr(this.getOperatorOptionValues(),this.grid);const i=v("div",{className:`date-picker form-group search-filter filter-${e}`}),t=v("div",{className:"input-group date-picker"},i);if(v("div",{className:"input-group-addon input-group-prepend operator"},t).appendChild(this._selectOperatorElm),t.appendChild(this._dateInputElm),this.operator){const o=La(this.operator);this._selectOperatorElm.value=o}return this._currentDateOrDates=u,this._currentValue=u,i&&this.filterContainerElm.appendChild(i),i}}onTriggerEvent(u){if(this._clearFilterTriggered)this.callback(u,{columnDef:this.columnDef,clearFilterTriggered:this._clearFilterTriggered,shouldTriggerQuery:this._shouldTriggerQuery}),this._filterElm.classList.remove("filled");else if(this.inputFilterType==="range")this._currentDateStrings?this._filterElm.classList.add("filled"):this._filterElm.classList.remove("filled"),this.callback(u,{columnDef:this.columnDef,searchTerms:this._currentDateStrings?this._currentDateStrings:[this._currentValue],operator:this.operator||"",shouldTriggerQuery:this._shouldTriggerQuery});else if(this.inputFilterType==="compound"&&this._selectOperatorElm){const e=this._selectOperatorElm.value;this._currentValue?this._filterElm.classList.add("filled"):this._filterElm.classList.remove("filled"),(!(this.columnFilter.skipCompoundOperatorFilterWithNullInput??this.gridOptions.skipCompoundOperatorFilterWithNullInput??this.gridOptions.skipCompoundOperatorFilterWithNullInput===void 0)||this._currentDateOrDates!==void 0)&&this.callback(u,{columnDef:this.columnDef,searchTerms:this._currentValue?[this._currentValue]:null,operator:e||"",shouldTriggerQuery:this._shouldTriggerQuery})}this._clearFilterTriggered=!1,this._shouldTriggerQuery=!0}}class Tm extends f1{constructor(u){super(u),this.translaterService=u,this.inputFilterType="compound"}}class B1{constructor(u){this.translaterService=u}filterCollection(u,e,a=wa.chain){let i=[];return Array.isArray(e)?(i=a===wa.merge?[]:[...u],e.forEach(t=>{if(a===wa.merge){const r=this.singleFilterCollection(u,t);i=Yl([...i,...r])}else i=this.singleFilterCollection(i,t)})):i=this.singleFilterCollection(u,e),i}singleFilterCollection(u,e){let a=[];if(e){const i=e.property,t=e.operator||P.equal,r=typeof e.value>"u"?"":e.value;switch(t){case P.equal:i?a=u.filter(o=>o[i]===r):a=u.filter(o=>o===r);break;case P.contains:i?a=u.filter(o=>{var s;return((s=o[i])==null?void 0:s.toString().indexOf(r.toString()))!==-1}):a=u.filter(o=>o!=null&&o.toString().indexOf(r.toString())!==-1);break;case P.notContains:i?a=u.filter(o=>{var s;return((s=o[i])==null?void 0:s.toString().indexOf(r.toString()))===-1}):a=u.filter(o=>o!=null&&o.toString().indexOf(r.toString())===-1);break;case P.notEqual:default:i?a=u.filter(o=>o[i]!==r):a=u.filter(o=>o!==r)}}return a}sortCollection(u,e,a,i){if(i&&(!this.translaterService||!this.translaterService.translate))throw new Error('[Slickgrid-Universal] requires a Translate Service to be installed and configured when the grid option "enableTranslate" is enabled.');let t=[];if(a){if(Array.isArray(a))t=e.sort((r,o)=>{var s,l;for(let E=0,d=a.length;E{var m,h;const d=i?((m=this.translaterService)==null?void 0:m.translate)&&this.translaterService.translate(l[r]||" "):l[r],c=i?((h=this.translaterService)==null?void 0:h.translate)&&this.translaterService.translate(E[r]||" "):E[r],D=Ta(s,d,c,o,u);return D!==ju.neutral?D:ju.neutral})}else if(a&&!a.property){const r=a.sortDesc?ju.desc:ju.asc,o=(a==null?void 0:a.fieldType)??(u==null?void 0:u.type)??p.string;t=e.sort((s,l)=>{var D,m;const E=i?((D=this.translaterService)==null?void 0:D.translate)&&this.translaterService.translate(s||" "):s,d=i?((m=this.translaterService)==null?void 0:m.translate)&&this.translaterService.translate(l||" "):l,c=Ta(o,E,d,r,u);return c!==ju.neutral?c:ju.neutral})}}return t}}function y1(n,u,e,a,i=!1,t,r){var z,M,w,N,G;const o=(e==null?void 0:e.id)??"",s=a.getOptions(),l=(n==="editor"?e==null?void 0:e.editor:e==null?void 0:e.filter)??{},E=(l==null?void 0:l.collectionOptions)??{},d=(E==null?void 0:E.separatorBetweenTextLabels)??"",c=(l==null?void 0:l.enableTranslateLabel)??!1,D=(s==null?void 0:s.enableTranslate)??!1,m=(l==null?void 0:l.enableRenderHtml)??!1,h=((z=l==null?void 0:l.customStructure)==null?void 0:z.label)??"label",x=((M=l==null?void 0:l.customStructure)==null?void 0:M.labelPrefix)??"labelPrefix",g=((w=l==null?void 0:l.customStructure)==null?void 0:w.labelSuffix)??"labelSuffix",F=((N=l==null?void 0:l.customStructure)==null?void 0:N.optionLabel)??"value",C=((G=l==null?void 0:l.customStructure)==null?void 0:G.value)??"value",A=v("select",{className:"ms-filter search-filter"}),b=n==="filter"?["search-filter",`filter-${o}`]:["select-editor",`editor-${o}`];A.classList.add(...b),A.multiple=i;const B=[];let S=!1;return Array.isArray(u)&&(u.every(L=>typeof L=="number"||typeof L=="string")?u.forEach(L=>{const Y={text:L,value:L};n==="filter"&&Array.isArray(r)&&(Y.selected=r.findIndex(lu=>lu===L)>=0),B.push(Y),(Y.selected&&i||Y.selected&&!i&&L!=="")&&(S=!0)}):u.forEach(L=>{if(L===void 0||typeof L=="object"&&L[h]===void 0&&L.labelKey===void 0)throw new Error("[Slickgrid-Universal] Select Filter/Editor collection with value/label (or value/labelKey when using Locale) is required to populate the Select list, for example:: { filter: model: Filters.multipleSelect, collection: [ { value: '1', label: 'One' } ]')");const Y=L.labelKey||L[h],lu=(L.labelKey||c&&t)&&Y&&D?t==null?void 0:t.translate(Y||" "):Y;let hu=L[x]||"",Eu=L[g]||"",du=L.hasOwnProperty(F)?L[F]:"";du!=null&&du.toString&&(du=du.toString().replace(/"/g,"'")),hu=c&&t&&hu&&typeof hu=="string"?t.translate(hu||" "):hu,Eu=c&&t&&Eu&&typeof Eu=="string"?t.translate(Eu||" "):Eu,du=c&&t&&du&&typeof du=="string"?t.translate(du||" "):du;let Au=[hu,typeof lu=="string"||typeof lu=="number"?lu.toString():lu,Eu].filter(Lu=>Lu).join(d);const mu={text:"",value:""};m&&(Au=a.sanitizeHtmlString(Au)),mu.text=Au;let au=L[C];au==null&&(au=""),n==="filter"&&Array.isArray(r)&&(mu.selected=r.findIndex(Lu=>`${Lu}`==`${L[C]}`)>=0),mu.value=`${au??""}`,B.push(mu),(mu.selected&&i||mu.selected&&!i&&L[C]!=="")&&(S=!0)})),{selectElement:A,dataCollection:B,hasFoundSearchTerm:S}}class _m{constructor(u,e,a){this.sharedService=u,this.backendUtilities=e,this.translaterService=a}getPickerTitleOutputString(u,e){var d,c,D,m,h,x,g,F,C,A,b,B,S,z;if((d=this.sharedService.gridOptions)!=null&&d.enableTranslate&&!((c=this.translaterService)!=null&&c.translate))throw new Error('[Slickgrid-Universal] requires a Translate Service to be installed and configured when the grid option "enableTranslate" is enabled.');let a="";const i=((D=this.sharedService.gridOptions)==null?void 0:D[e])??{},t=((m=this.sharedService.gridOptions)==null?void 0:m.enableTranslate)??!1,r=((h=this.sharedService.gridOptions)==null?void 0:h.locales)??T.locales,o=i==null?void 0:i[u],s=i==null?void 0:i[`${u}Key`],l=this.sharedService.gridOptions,E=X0(l);if(s&&((x=this.translaterService)!=null&&x.translate))a=this.translaterService.translate(s||" ");else switch(u){case"commandTitle":a=o||t&&((g=this.translaterService)==null?void 0:g.getCurrentLanguage)&&((F=this.translaterService)==null?void 0:F.translate(`${E}COMMANDS`))||(r==null?void 0:r.TEXT_COMMANDS);break;case"columnTitle":a=o||t&&((C=this.translaterService)==null?void 0:C.getCurrentLanguage)&&((A=this.translaterService)==null?void 0:A.translate(`${E}COLUMNS`))||(r==null?void 0:r.TEXT_COLUMNS);break;case"forceFitTitle":a=o||t&&((b=this.translaterService)==null?void 0:b.getCurrentLanguage)&&((B=this.translaterService)==null?void 0:B.translate(`${E}FORCE_FIT_COLUMNS`))||(r==null?void 0:r.TEXT_FORCE_FIT_COLUMNS);break;case"syncResizeTitle":a=o||t&&((S=this.translaterService)==null?void 0:S.getCurrentLanguage)&&((z=this.translaterService)==null?void 0:z.translate(`${E}SYNCHRONOUS_RESIZE`))||(r==null?void 0:r.TEXT_SYNCHRONOUS_RESIZE);break;default:a=o;break}return a}readjustFrozenColumnIndexWhenNeeded(u,e,a){if(u>=0){const i=a.findIndex(t=>t.id===this.sharedService.frozenVisibleColumnId);i>=0&&i!==u&&(this.sharedService.gridOptions.frozenColumn=i,this.sharedService.slickGrid.setOptions({frozenColumn:i})),Array.isArray(a)&&Array.isArray(e)&&a.length!==e.length&&this.sharedService.slickGrid.setColumns(a)}}refreshBackendDataset(u){var a;let e=this.sharedService.gridOptions;u&&(e={...this.sharedService.gridOptions,...u},this.sharedService.gridOptions=e),(a=this.backendUtilities)==null||a.refreshBackendDataset(e)}runOverrideFunctionWhenExists(u,e){return typeof u=="function"?!!u.call(this,e):!0}sortItems(u,e){Array.isArray(u)&&u.sort((a,i)=>a&&i&&a.hasOwnProperty(e)&&i.hasOwnProperty(e)?a[e]-i[e]:0)}translateItems(u,e,a){var i,t;if(Array.isArray(u))for(const r of u)r.hasOwnProperty(e)&&(r[a]=(t=(i=this.translaterService)==null?void 0:i.translate)==null?void 0:t.call(i,r[e]))}translateMenuItemsFromTitleKey(u,e="commandItems"){for(const a of u)typeof a=="object"&&(a.titleKey&&(a.title=this.translateWhenEnabledAndServiceExist(`${a.titleKey}`,`TEXT_${a.titleKey}`)),a.subMenuTitleKey&&(a.subMenuTitle=this.translateWhenEnabledAndServiceExist(`${a.subMenuTitleKey}`,`TEXT_${a.subMenuTitleKey}`))),Array.isArray(a==null?void 0:a[e])&&this.translateMenuItemsFromTitleKey(a==null?void 0:a[e])}translateWhenEnabledAndServiceExist(u,e,a){var o,s;let i="";const t=(o=this.sharedService)==null?void 0:o.gridOptions,r=(t==null?void 0:t.locales)??T.locales;return a?i=a:t.enableTranslate&&((s=this.translaterService)!=null&&s.translate)?i=this.translaterService.translate(u||" "):e in r?i=r[e]:i=e,i}}class Pu{get defaultPrevented(){return this._isDefaultPrevented}constructor(u,e){this.event=u,this.args=e,this._isPropagationStopped=!1,this._isImmediatePropagationStopped=!1,this._isDefaultPrevented=!1,this.returnValue=void 0,this.nativeEvent=u,this._arguments=e,u&&["altKey","ctrlKey","metaKey","shiftKey","key","keyCode","clientX","clientY","offsetX","offsetY","pageX","pageY","bubbles","target","type","which","x","y"].forEach(a=>this[a]=u[a]),this._eventTarget=this.nativeEvent?this.nativeEvent.target:void 0}stopPropagation(){var u;this._isPropagationStopped=!0,(u=this.nativeEvent)==null||u.stopPropagation()}isPropagationStopped(){return this._isPropagationStopped}stopImmediatePropagation(){this._isImmediatePropagationStopped=!0,this.nativeEvent&&this.nativeEvent.stopImmediatePropagation()}isImmediatePropagationStopped(){return this._isImmediatePropagationStopped}getNativeEvent(){return this.nativeEvent}preventDefault(){this.nativeEvent&&this.nativeEvent.preventDefault(),this._isDefaultPrevented=!0}isDefaultPrevented(){return this.nativeEvent?this.nativeEvent.defaultPrevented:this._isDefaultPrevented}addReturnValue(u){this.returnValue===void 0&&u!==void 0&&(this.returnValue=u)}getReturnValue(){return this.returnValue}getArguments(){return this._arguments}resetReturnValue(){this.returnValue=void 0}}class R{get subscriberCount(){return this._handlers.length}constructor(u,e){this.eventName=u,this.pubSub=e,this._handlers=[],this._pubSubService=e}subscribe(u){this._handlers.push(u)}unsubscribe(u){for(let e=this._handlers.length-1;e>=0;e--)this._handlers[e]===u&&this._handlers.splice(e,1)}notify(u,e,a,i=!1){var r;const t=e instanceof Pu?e:new Pu(e,u);i&&t.resetReturnValue(),a=a||this;for(let o=0;ot.nativeEvent??(t.nativeEvent=s));t.addReturnValue(o)}return t}setPubSubService(u){this._pubSubService=u}}class Tu{constructor(){this.handlers=[]}get subscriberCount(){return this.handlers.length}subscribe(u,e){return this.handlers.push({event:u,handler:e}),u.subscribe(e),this}unsubscribe(u,e){let a=this.handlers.length;for(;a--;)if(this.handlers[a].event===u&&this.handlers[a].handler===e){this.handlers.splice(a,1),u.unsubscribe(e);return}return this}unsubscribeAll(){let u=this.handlers.length;for(;u--;)this.handlers[u].event.unsubscribe(this.handlers[u].handler);return this.handlers=[],this}}class $0{constructor(u,e,a,i){a===void 0&&i===void 0&&(a=u,i=e),this.fromRow=Math.min(u,a),this.fromCell=Math.min(e,i),this.toRow=Math.max(u,a),this.toCell=Math.max(e,i)}isSingleCell(){return this.fromRow===this.toRow&&this.fromCell===this.toCell}isSingleRow(){return this.fromRow===this.toRow}contains(u,e){return u>=this.fromRow&&u<=this.toRow&&e>=this.fromCell&&e<=this.toCell}toString(){return this.isSingleCell()?`(${this.fromRow}:${this.fromCell})`:`(${this.fromRow}:${this.fromCell} - ${this.toRow}:${this.toCell})`}}class z1{constructor(){this.__nonDataRow=!0}}class Bt extends z1{constructor(){super(),this.__group=!0,this.level=0,this.count=0,this.value=null,this.title=null,this.collapsed=!1,this.selectChecked=!1,this.totals=null,this.rows=[],this.groups=null,this.groupingKey=""}equals(u){return this.value===u.value&&this.count===u.count&&this.collapsed===u.collapsed&&this.title===u.title}}class Pm extends z1{constructor(){super(),this.__groupTotals=!0,this.group=null,this.initialized=!1}}class jm{constructor(){this.activeEditController=null}isActive(u){return u?this.activeEditController===u:this.activeEditController!==null}activate(u){if(u!==this.activeEditController){if(this.activeEditController!==null)throw new Error("SlickEditorLock.activate: an editController is still active, can't activate another editController");if(!u.commitCurrentEdit)throw new Error("SlickEditorLock.activate: editController must implement .commitCurrentEdit()");if(!u.cancelCurrentEdit)throw new Error("SlickEditorLock.activate: editController must implement .cancelCurrentEdit()");this.activeEditController=u}}deactivate(u){if(this.activeEditController){if(this.activeEditController!==u)throw new Error("SlickEditorLock.deactivate: specified editController is not the currently active one");this.activeEditController=null}}commitCurrentEdit(){return this.activeEditController?this.activeEditController.commitCurrentEdit():!0}cancelCurrentEdit(){return this.activeEditController?this.activeEditController.cancelCurrentEdit():!0}}class y{static height(u,e){if(u){if(e===void 0)return u.getBoundingClientRect().height;y.setStyleSize(u,"height",e)}}static width(u,e){if(!(!u||!u.getBoundingClientRect)){if(e===void 0)return u.getBoundingClientRect().width;y.setStyleSize(u,"width",e)}}static setStyleSize(u,e,a){typeof a=="function"&&(a=a()),u.style[e]=typeof a=="string"?a:`${a}px`}static isHidden(u){return u.offsetWidth===0&&u.offsetHeight===0}static parents(u,e){const a=[],i=e===":visible",t=e===":hidden";for(;(u=u.parentNode)&&u!==document&&!(!u||!u.parentNode);)t?y.isHidden(u)&&a.push(u):i?y.isHidden(u)||a.push(u):(!e||u.matches(e))&&a.push(u);return a}static toFloat(u){const e=parseFloat(u);return isNaN(e)?0:e}static show(u,e=""){Array.isArray(u)?u.forEach(a=>a.style.display=e):u.style.display=e}static hide(u){Array.isArray(u)?u.forEach(e=>e.style.display="none"):u.style.display="none"}static applyDefaults(u,e){typeof e=="object"&&Object.keys(e).forEach(a=>{e.hasOwnProperty(a)&&!u.hasOwnProperty(a)&&(u[a]=e[a])})}static addSlickEventPubSubWhenDefined(u,e){if(u)for(const a in e)e[a]instanceof R&&typeof e[a].setPubSubService=="function"&&e[a].setPubSubService(u)}}y.storage={_storage:new WeakMap,put:function(n,u,e){this._storage.has(n)||this._storage.set(n,new Map),this._storage.get(n).set(u,e)},get:function(n,u){const e=this._storage.get(n);return e?e.get(u):null},remove:function(n,u){const e=this._storage.get(n).delete(u);return this._storage.get(n).size!==0&&this._storage.delete(n),e}};const Y0=new jm,Lm="slick-edit-preclick";class S1{constructor(u){this.pluginName="GroupItemMetadataProvider",this._defaults={groupCssClass:"slick-group",groupTitleCssClass:"slick-group-title",totalsCssClass:"slick-group-totals",groupFocusable:!0,indentation:15,totalsFocusable:!1,toggleCssClass:"slick-group-toggle",toggleExpandedCssClass:"expanded",toggleCollapsedCssClass:"collapsed",enableExpandCollapse:!0,groupFormatter:this.defaultGroupCellFormatter.bind(this),totalsFormatter:this.defaultTotalsCellFormatter.bind(this),includeHeaderTotals:!1},this._eventHandler=new Tu,this._options=wu(!0,{},this._defaults,u)}get eventHandler(){return this._eventHandler}get dataView(){var u;return((u=this._grid)==null?void 0:u.getData())??{}}get gridOptions(){var u;return((u=this._grid)==null?void 0:u.getOptions())||{}}init(u,e){this._grid=u,this._options={...this._defaults,...e},this._eventHandler.subscribe(u.onClick,this.handleGridClick.bind(this)),this._eventHandler.subscribe(u.onKeyDown,this.handleGridKeyDown.bind(this))}destroy(){this.dispose()}dispose(){var u;(u=this._eventHandler)==null||u.unsubscribeAll()}getOptions(){return this._options}setOptions(u){this._options={...this._options,...u}}getGroupRowMetadata(u){return{selectable:!1,focusable:this._options.groupFocusable,cssClasses:`${this._options.groupCssClass} slick-group-level-${(u==null?void 0:u.level)||0}`,formatter:this._options.includeHeaderTotals&&this._options.totalsFormatter||void 0,columns:{0:{colspan:this._options.includeHeaderTotals?"1":"*",formatter:this._options.groupFormatter,editorClass:null}}}}getTotalsRowMetadata(u){var e;return{selectable:!1,focusable:this._options.totalsFocusable,cssClasses:`${this._options.totalsCssClass} slick-group-level-${((e=u==null?void 0:u.group)==null?void 0:e.level)||0}`,formatter:this._options.totalsFormatter,editorClass:null}}defaultGroupCellFormatter(u,e,a,i,t){var c,D;if(!this._options.enableExpandCollapse)return t.title;const r=t.level||0,o=((c=this._options)==null?void 0:c.indentation)??15,s=`${r*o}px`,l=t.collapsed?this._options.toggleCollapsedCssClass:this._options.toggleExpandedCssClass,E=(D=this.gridOptions)!=null&&D.preventDocumentFragmentUsage?document.createElement("span"):new DocumentFragment;E.appendChild(v("span",{className:`${this._options.toggleCssClass} ${l}`,ariaExpanded:String(!t.collapsed),style:{marginLeft:s}}));const d=v("span",{className:this._options.groupTitleCssClass||""});return d.setAttribute("level",r),t.title instanceof HTMLElement||t.title instanceof DocumentFragment?d.appendChild(t.title):this._grid.applyHtmlCode(d,t.title??""),E.appendChild(d),E}defaultTotalsCellFormatter(u,e,a,i,t,r){var o;return((o=i==null?void 0:i.groupTotalsFormatter)==null?void 0:o.call(i,t,i,r))??""}handleGridClick(u,e){var t;const a=u.target,i=(t=this._grid)==null?void 0:t.getDataItem(e.row);i instanceof Bt&&a.classList.contains(this._options.toggleCssClass||"")&&(this.handleDataViewExpandOrCollapse(i),u.stopImmediatePropagation(),u.preventDefault())}handleGridKeyDown(u){var e;if(this._options.enableExpandCollapse&&u.key===" "){const a=(e=this._grid)==null?void 0:e.getActiveCell();if(a){const i=this._grid.getDataItem(a.row);i instanceof Bt&&(this.handleDataViewExpandOrCollapse(i),u.stopImmediatePropagation(),u.preventDefault())}}}handleDataViewExpandOrCollapse(u){var a;const e=(a=this._grid)==null?void 0:a.getRenderedRange();this.dataView.setRefreshHints({ignoreDiffsBefore:e.top,ignoreDiffsAfter:e.bottom+1}),u.collapsed?this.dataView.expandGroup(u.groupingKey):this.dataView.collapseGroup(u.groupingKey)}}class Nm{constructor(u,e){this.externalPubSub=e,this.defaults={groupItemMetadataProvider:null,inlineFilters:!1,useCSPSafeFilter:!1},this.idProperty="id",this.items=[],this.rows=[],this.idxById=new Map,this.rowsById=void 0,this.filter=null,this.filterCSPSafe=null,this.updated=null,this.suspend=!1,this.isBulkSuspend=!1,this.bulkDeleteIds=new Map,this.sortAsc=!0,this.refreshHints={},this.prevRefreshHints={},this.filteredItems=[],this.filterCache=[],this.groupingInfoDefaults={getter:void 0,formatter:void 0,comparer:(a,i)=>a.value===i.value?0:a.value>i.value?1:-1,predefinedValues:[],aggregators:[],aggregateEmpty:!1,aggregateCollapsed:!1,aggregateChildGroups:!1,collapsed:!1,displayTotalsRow:!0,lazyTotalsCalculation:!1},this.groupingInfos=[],this.groups=[],this.toggledGroupsByLevel=[],this.groupingDelimiter=":|:",this.selectedRowIds=[],this.pagesize=0,this.pagenum=0,this.totalRows=0,this.onBeforePagingInfoChanged=new R("onBeforePagingInfoChanged",e),this.onGroupExpanded=new R("onGroupExpanded",e),this.onGroupCollapsed=new R("onGroupCollapsed",e),this.onPagingInfoChanged=new R("onPagingInfoChanged",e),this.onRowCountChanged=new R("onRowCountChanged",e),this.onRowsChanged=new R("onRowsChanged",e),this.onRowsOrCountChanged=new R("onRowsOrCountChanged",e),this.onSelectedRowIdsChanged=new R("onSelectedRowIdsChanged",e),this.onSetItemsCalled=new R("onSetItemsCalled",e),this._options=wu(!0,{},this.defaults,u)}beginUpdate(u){this.suspend=!0,this.isBulkSuspend=u===!0}endUpdate(){const u=this.isBulkSuspend;this.isBulkSuspend=!1,this.suspend=!1,u&&(this.processBulkDelete(),this.ensureIdUniqueness()),this.refresh()}destroy(){var u,e,a;this.items=[],this.idProperty="id",this.idxById=null,this.rowsById=null,this.filter=null,this.filterCSPSafe=null,this.updated=null,this.sortComparer=null,this.filterCache=[],this.filteredItems=[],this.compiledFilter=null,this.compiledFilterCSPSafe=null,this.compiledFilterWithCaching=null,this.compiledFilterWithCachingCSPSafe=null,this._grid&&((u=this._grid.onSelectedRowsChanged)==null||u.unsubscribe(),(e=this._grid.onCellCssStylesChanged)==null||e.unsubscribe()),(a=this.onRowsOrCountChanged)==null||a.unsubscribe()}setRefreshHints(u){this.refreshHints=u}getFilterArgs(){return this.filterArgs}setFilterArgs(u){this.filterArgs=u}processBulkDelete(){if(!this.idxById)return;let u,e,a=0;for(let i=0,t=this.items.length;i=0;--a)this.items.splice(e[a],1);this.updateIdxById(e[0]),this.refresh()}}sortedAddItem(u){if(!this.sortComparer)throw new Error("[SlickGrid DataView] sortedAddItem() requires a sort comparer, use sort()");this.insertItem(this.sortedIndex(u),u)}sortedUpdateItem(u,e){if(!this.idxById)return;if(!this.idxById.has(u)||u!==e[this.idProperty])throw new Error(`[SlickGrid DataView] Invalid or non-matching id ${u}`);if(!this.sortComparer)throw new Error("[SlickGrid DataView] sortedUpdateItem() requires a sort comparer, use sort()");const a=this.getItemById(u);this.sortComparer(a,e)!==0?(this.deleteItem(u),this.sortedAddItem(e)):this.updateItem(u,e)}sortedIndex(u){let e=0,a=this.items.length;for(;e>>1;this.sortComparer(this.items[i],u)===-1?e=i+1:a=i}return e}getItemCount(){return this.items.length}getLength(){return this.rows.length}getItem(u){var a;const e=this.rows[u];if(e!=null&&e.__group&&e.totals&&!((a=e.totals)!=null&&a.initialized)){const i=this.groupingInfos[e.level];i.displayTotalsRow||(this.calculateTotals(e.totals),e.title=i.formatter?i.formatter(e):e.value)}else e!=null&&e.__groupTotals&&!e.initialized&&this.calculateTotals(e);return e}getItemMetadata(u){const e=this.rows[u];return e===void 0?null:e.__group?this._options.groupItemMetadataProvider.getGroupRowMetadata(e):e.__groupTotals?this._options.groupItemMetadataProvider.getTotalsRowMetadata(e):null}expandCollapseAllGroups(u,e){if($u(u))this.toggledGroupsByLevel[u]={},this.groupingInfos[u].collapsed=e,e===!0?this.onGroupCollapsed.notify({level:u,groupingKey:null}):this.onGroupExpanded.notify({level:u,groupingKey:null});else for(let a=0;a=D?r[r.length]=c:(a=e[c],i=u[c],(!a||this.groupingInfos.length&&(t=a.__nonDataRow||i.__nonDataRow)&&a.__group!==i.__group||a.__group&&!a.equals(i)||t&&(a.__groupTotals||i.__groupTotals)||a[this.idProperty]!==i[this.idProperty]||(d=this.updated)!=null&&d[a[this.idProperty]])&&(r[r.length]=c));return r}recalc(u){this.rowsById=void 0,(this.refreshHints.isFilterNarrowing!==this.prevRefreshHints.isFilterNarrowing||this.refreshHints.isFilterExpanding!==this.prevRefreshHints.isFilterExpanding)&&(this.filterCache=[]);const e=this.getFilteredAndPagedItems(u);this.totalRows=e.totalRows;let a=e.rows;this.groups=[],this.groupingInfos.length&&(this.groups=this.extractGroups(a),this.groups.length&&(a=this.flattenGroupedRows(this.groups)));const i=this.getRowDiffs(this.rows,a);return this.rows=a,i}refresh(){if(this.suspend)return;const u=wu(!0,{},this.getPagingInfo()),e=this.rows.length,a=this.totalRows;let i=this.recalc(this.items);this.pagesize&&this.totalRows0},null,this),i.length>0&&this.onRowsChanged.notify({rows:i,itemCount:this.items.length,dataView:this,calledOnRowCountChanged:e!==this.rows.length},null,this),(e!==this.rows.length||i.length>0)&&this.onRowsOrCountChanged.notify({rowsDiff:i,previousRowCount:e,currentRowCount:this.rows.length,itemCount:this.items.length,rowCountChanged:e!==this.rows.length,rowsChanged:i.length>0,dataView:this},null,this)}syncGridSelection(u,e,a){this._grid=u;let i;this.selectedRowIds=this.mapRowsToIds(u.getSelectedRows());const t=u.getOptions(),r=s=>{s===!1?this.selectedRowIds=[]:this.selectedRowIds.sort().join(",")!==s.sort().join(",")&&(this.selectedRowIds=s)},o=()=>{if((this.selectedRowIds||[]).length>0&&!i){i=!0;const s=this.mapIdsToRows(this.selectedRowIds||[]);if(!e){const l={grid:this._grid,ids:this.mapRowsToIds(s),rows:s,dataView:this};this.preSelectedRowIdsChangeFn(l),this.onSelectedRowIdsChanged.notify(Object.assign(l,{selectedRowIds:this.selectedRowIds,filteredIds:this.getAllSelectedFilteredIds()}),new Pu,this)}u.setSelectedRows(s),i=!1}};return u.onSelectedRowsChanged.subscribe((s,l)=>{if(!i){const E=this.mapRowsToIds(l.rows),d={grid:this._grid,ids:E,rows:l.rows,added:!0,dataView:this};this.preSelectedRowIdsChangeFn(d),this.onSelectedRowIdsChanged.notify(Object.assign(d,{selectedRowIds:this.selectedRowIds,filteredIds:this.getAllSelectedFilteredIds()}),new Pu,this)}}),this.preSelectedRowIdsChangeFn=s=>{var l,E;if(!i){if(i=!0,typeof s.added>"u")r(s.ids);else{let c;s.added?a&&t.multiSelect?c=((l=this.selectedRowIds)==null?void 0:l.filter(m=>this.getRowById(m)===void 0)).concat(s.ids):c=s.ids:a&&t.multiSelect?c=(E=this.selectedRowIds)==null?void 0:E.filter(D=>s.ids.indexOf(D)===-1):c=[],r(c)}i=!1}},this.onRowsOrCountChanged.subscribe(o.bind(this)),this.onSelectedRowIdsChanged}getAllSelectedIds(){return this.selectedRowIds}getAllSelectedFilteredIds(){return this.getAllSelectedFilteredItems().map(u=>u[this.idProperty])}setSelectedIds(u,e){var s;let a=e==null?void 0:e.isRowBeingAdded;const i=e==null?void 0:e.shouldTriggerEvent,t=e==null?void 0:e.applyRowSelectionToGrid;a!==!1&&(a=!0);const r=this.mapIdsToRows(u),o={grid:this._grid,ids:u,rows:r,added:a,dataView:this};(s=this.preSelectedRowIdsChangeFn)==null||s.call(this,o),i!==!1&&this.onSelectedRowIdsChanged.notify(Object.assign(o,{selectedRowIds:this.selectedRowIds,filteredIds:this.getAllSelectedFilteredIds()}),new Pu,this),t!==!1&&this._grid&&this._grid.setSelectedRows(r)}getAllSelectedItems(){const u=[];return this.getAllSelectedIds().forEach(a=>{u.push(this.getItemById(a))}),u}getAllSelectedFilteredItems(){return Array.isArray(this.selectedRowIds)?this.filteredItems.filter(e=>this.selectedRowIds.some(a=>e[this.idProperty]===a))||[]:[]}syncGridCellCssStyles(u,e){let a,i;const t=o=>{a={},typeof o=="object"&&Object.keys(o).forEach(s=>{if(o&&this.rows[s]){const l=this.rows[s][this.idProperty];a[l]=o[s]}})};t(u.getCellCssStyles(e));const r=()=>{if(typeof a=="object"){i=!0,this.ensureRowsByIdCache();const o={};Object.keys(a).forEach(s=>{var E;const l=(E=this.rowsById)==null?void 0:E[s];$u(l)&&(o[l]=a[s])}),u.setCellCssStyles(e,o),i=!1}};u.onCellCssStylesChanged.subscribe((o,s)=>{i||e!==s.key||(s.hash?t(s.hash):(u.onCellCssStylesChanged.unsubscribe(),this.onRowsOrCountChanged.unsubscribe(r)))}),this.onRowsOrCountChanged.subscribe(r.bind(this))}}/**!
* Sortable 1.15.2
* @author RubaXa
* @author owenm
* @license MIT
- */function xs(n,u){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);u&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),e.push.apply(e,a)}return e}function De(n){for(var u=1;u=0)&&(e[i]=n[i]);return e}function Rm(n,u){if(n==null)return{};var e=Nm(n,u),a,i;if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(n,a)&&(e[a]=n[a])}return e}var Km="1.15.2";function ye(n){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(n)}var Te=ye(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Bi=ye(/Edge/i),gs=ye(/firefox/i),si=ye(/safari/i)&&!ye(/chrome/i)&&!ye(/android/i),y1=ye(/iP(ad|od|hone)/i),z1=ye(/chrome/i)&&ye(/android/i),S1={capture:!1,passive:!1};function Su(n,u,e){n.addEventListener(u,e,!Te&&S1)}function yu(n,u,e){n.removeEventListener(u,e,!Te&&S1)}function ft(n,u){if(u){if(u[0]===">"&&(u=u.substring(1)),n)try{if(n.matches)return n.matches(u);if(n.msMatchesSelector)return n.msMatchesSelector(u);if(n.webkitMatchesSelector)return n.webkitMatchesSelector(u)}catch{return!1}return!1}}function Hm(n){return n.host&&n!==document&&n.host.nodeType?n.host:n.parentNode}function ie(n,u,e,a){if(n){e=e||document;do{if(u!=null&&(u[0]===">"?n.parentNode===e&&ft(n,u):ft(n,u))||a&&n===e)return n;if(n===e)break}while(n=Hm(n))}return null}var Cs=/\s+/g;function H0(n,u,e){if(n&&u)if(n.classList)n.classList[e?"add":"remove"](u);else{var a=(" "+n.className+" ").replace(Cs," ").replace(" "+u+" "," ");n.className=(a+(e?" "+u:"")).replace(Cs," ")}}function nu(n,u,e){var a=n&&n.style;if(a){if(e===void 0)return document.defaultView&&document.defaultView.getComputedStyle?e=document.defaultView.getComputedStyle(n,""):n.currentStyle&&(e=n.currentStyle),u===void 0?e:e[u];!(u in a)&&u.indexOf("webkit")===-1&&(u="-webkit-"+u),a[u]=e+(typeof e=="string"?"":"px")}}function Ta(n,u){var e="";if(typeof n=="string")e=n;else do{var a=nu(n,"transform");a&&a!=="none"&&(e=a+" "+e)}while(!u&&(n=n.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(e)}function w1(n,u,e){if(n){var a=n.getElementsByTagName(u),i=0,t=a.length;if(e)for(;i=t:r=i<=t,!r)return a;if(a===Ee())break;a=$e(a,!1)}return!1}function Ra(n,u,e,a){for(var i=0,t=0,r=n.children;t2&&arguments[2]!==void 0?arguments[2]:{},i=a.evt,t=Rm(a,Um);yi.pluginEvent.bind(uu)(u,e,De({dragEl:H,parentEl:a0,ghostEl:cu,rootEl:Zu,nextEl:ta,lastDownEl:nt,cloneEl:u0,cloneHidden:Oe,dragStarted:ni,putSortable:C0,activeSortable:uu.active,originalEvent:i,oldIndex:za,oldDraggableIndex:Ei,newIndex:O0,newDraggableIndex:He,hideGhostForTarget:R1,unhideGhostForTarget:K1,cloneNowHidden:function(){Oe=!0},cloneNowShown:function(){Oe=!1},dispatchSortableEvent:function(o){y0({sortable:e,name:o,originalEvent:i})}},t))};function y0(n){Wm(De({putSortable:C0,cloneEl:u0,targetEl:H,rootEl:Zu,oldIndex:za,oldDraggableIndex:Ei,newIndex:O0,newDraggableIndex:He},n))}var H,a0,cu,Zu,ta,nt,u0,Oe,za,O0,Ei,He,_i,C0,Aa=!1,Bt=!1,yt=[],Xe,ee,Cn,pn,ks,vs,ni,ka,di,ci=!1,Pi=!1,rt,b0,Fn=[],ir=!1,zt=[],Ut=typeof document<"u",ji=y1,As=Bi||Te?"cssFloat":"float",qm=Ut&&!z1&&!y1&&"draggable"in document.createElement("div"),j1=function(){if(Ut){if(Te)return!1;var n=document.createElement("x");return n.style.cssText="pointer-events:auto",n.style.pointerEvents==="auto"}}(),L1=function(u,e){var a=nu(u),i=parseInt(a.width)-parseInt(a.paddingLeft)-parseInt(a.paddingRight)-parseInt(a.borderLeftWidth)-parseInt(a.borderRightWidth),t=Ra(u,0,e),r=Ra(u,1,e),o=t&&nu(t),s=r&&nu(r),l=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+s0(t).width,E=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+s0(r).width;if(a.display==="flex")return a.flexDirection==="column"||a.flexDirection==="column-reverse"?"vertical":"horizontal";if(a.display==="grid")return a.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(t&&o.float&&o.float!=="none"){var d=o.float==="left"?"left":"right";return r&&(s.clear==="both"||s.clear===d)?"vertical":"horizontal"}return t&&(o.display==="block"||o.display==="flex"||o.display==="table"||o.display==="grid"||l>=i&&a[As]==="none"||r&&a[As]==="none"&&l+E>i)?"vertical":"horizontal"},Zm=function(u,e,a){var i=a?u.left:u.top,t=a?u.right:u.bottom,r=a?u.width:u.height,o=a?e.left:e.top,s=a?e.right:e.bottom,l=a?e.width:e.height;return i===o||t===s||i+r/2===o+l/2},Ym=function(u,e){var a;return yt.some(function(i){var t=i[G0].options.emptyInsertThreshold;if(!(!t||Jr(i))){var r=s0(i),o=u>=r.left-t&&u<=r.right+t,s=e>=r.top-t&&e<=r.bottom+t;if(o&&s)return a=i}}),a},N1=function(u){function e(t,r){return function(o,s,l,E){var d=o.options.group.name&&s.options.group.name&&o.options.group.name===s.options.group.name;if(t==null&&(r||d))return!0;if(t==null||t===!1)return!1;if(r&&t==="clone")return t;if(typeof t=="function")return e(t(o,s,l,E),r)(o,s,l,E);var c=(r?o:s).options.group.name;return t===!0||typeof t=="string"&&t===c||t.join&&t.indexOf(c)>-1}}var a={},i=u.group;(!i||tt(i)!="object")&&(i={name:i}),a.name=i.name,a.checkPull=e(i.pull,!0),a.checkPut=e(i.put),a.revertClone=i.revertClone,u.group=a},R1=function(){!j1&&cu&&nu(cu,"display","none")},K1=function(){!j1&&cu&&nu(cu,"display","")};Ut&&!z1&&document.addEventListener("click",function(n){if(Bt)return n.preventDefault(),n.stopPropagation&&n.stopPropagation(),n.stopImmediatePropagation&&n.stopImmediatePropagation(),Bt=!1,!1},!0);var ua=function(u){if(H){u=u.touches?u.touches[0]:u;var e=Ym(u.clientX,u.clientY);if(e){var a={};for(var i in u)u.hasOwnProperty(i)&&(a[i]=u[i]);a.target=a.rootEl=e,a.preventDefault=void 0,a.stopPropagation=void 0,e[G0]._onDragOver(a)}}},Qm=function(u){H&&H.parentNode[G0]._isOutsideThisEl(u.target)};function uu(n,u){if(!(n&&n.nodeType&&n.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(n));this.el=n,this.options=u=we({},u),n[G0]=this;var e={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(n.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return L1(n,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(r,o){r.setData("Text",o.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:uu.supportPointer!==!1&&"PointerEvent"in window&&!si,emptyInsertThreshold:5};yi.initializePlugins(this,n,e);for(var a in e)!(a in u)&&(u[a]=e[a]);N1(u);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=u.forceFallback?!1:qm,this.nativeDraggable&&(this.options.touchStartThreshold=1),u.supportPointer?Su(n,"pointerdown",this._onTapStart):(Su(n,"mousedown",this._onTapStart),Su(n,"touchstart",this._onTapStart)),this.nativeDraggable&&(Su(n,"dragover",this),Su(n,"dragenter",this)),yt.push(this.el),u.store&&u.store.get&&this.sort(u.store.get(this)||[]),we(this,Vm())}uu.prototype={constructor:uu,_isOutsideThisEl:function(u){!this.el.contains(u)&&u!==this.el&&(ka=null)},_getDirection:function(u,e){return typeof this.options.direction=="function"?this.options.direction.call(this,u,e,H):this.options.direction},_onTapStart:function(u){if(u.cancelable){var e=this,a=this.el,i=this.options,t=i.preventOnFilter,r=u.type,o=u.touches&&u.touches[0]||u.pointerType&&u.pointerType==="touch"&&u,s=(o||u).target,l=u.target.shadowRoot&&(u.path&&u.path[0]||u.composedPath&&u.composedPath()[0])||s,E=i.filter;if(rh(a),!H&&!(/mousedown|pointerdown/.test(r)&&u.button!==0||i.disabled)&&!l.isContentEditable&&!(!this.nativeDraggable&&si&&s&&s.tagName.toUpperCase()==="SELECT")&&(s=ie(s,i.draggable,a,!1),!(s&&s.animated)&&nt!==s)){if(za=U0(s),Ei=U0(s,i.draggable),typeof E=="function"){if(E.call(this,u,s,this)){y0({sortable:e,rootEl:l,name:"filter",targetEl:s,toEl:a,fromEl:a}),j0("filter",e,{evt:u}),t&&u.cancelable&&u.preventDefault();return}}else if(E&&(E=E.split(",").some(function(d){if(d=ie(l,d.trim(),a,!1),d)return y0({sortable:e,rootEl:d,name:"filter",targetEl:s,fromEl:a,toEl:a}),j0("filter",e,{evt:u}),!0}),E)){t&&u.cancelable&&u.preventDefault();return}i.handle&&!ie(l,i.handle,a,!1)||this._prepareDragStart(u,o,s)}}},_prepareDragStart:function(u,e,a){var i=this,t=i.el,r=i.options,o=t.ownerDocument,s;if(a&&!H&&a.parentNode===t){var l=s0(a);if(Zu=t,H=a,a0=H.parentNode,ta=H.nextSibling,nt=a,_i=r.group,uu.dragged=H,Xe={target:H,clientX:(e||u).clientX,clientY:(e||u).clientY},ks=Xe.clientX-l.left,vs=Xe.clientY-l.top,this._lastX=(e||u).clientX,this._lastY=(e||u).clientY,H.style["will-change"]="all",s=function(){if(j0("delayEnded",i,{evt:u}),uu.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!gs&&i.nativeDraggable&&(H.draggable=!0),i._triggerDragStart(u,e),y0({sortable:i,name:"choose",originalEvent:u}),H0(H,r.chosenClass,!0)},r.ignore.split(",").forEach(function(E){w1(H,E.trim(),kn)}),Su(o,"dragover",ua),Su(o,"mousemove",ua),Su(o,"touchmove",ua),Su(o,"mouseup",i._onDrop),Su(o,"touchend",i._onDrop),Su(o,"touchcancel",i._onDrop),gs&&this.nativeDraggable&&(this.options.touchStartThreshold=4,H.draggable=!0),j0("delayStart",this,{evt:u}),r.delay&&(!r.delayOnTouchOnly||e)&&(!this.nativeDraggable||!(Bi||Te))){if(uu.eventCanceled){this._onDrop();return}Su(o,"mouseup",i._disableDelayedDrag),Su(o,"touchend",i._disableDelayedDrag),Su(o,"touchcancel",i._disableDelayedDrag),Su(o,"mousemove",i._delayedDragTouchMoveHandler),Su(o,"touchmove",i._delayedDragTouchMoveHandler),r.supportPointer&&Su(o,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(s,r.delay)}else s()}},_delayedDragTouchMoveHandler:function(u){var e=u.touches?u.touches[0]:u;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){H&&kn(H),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var u=this.el.ownerDocument;yu(u,"mouseup",this._disableDelayedDrag),yu(u,"touchend",this._disableDelayedDrag),yu(u,"touchcancel",this._disableDelayedDrag),yu(u,"mousemove",this._delayedDragTouchMoveHandler),yu(u,"touchmove",this._delayedDragTouchMoveHandler),yu(u,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(u,e){e=e||u.pointerType=="touch"&&u,!this.nativeDraggable||e?this.options.supportPointer?Su(document,"pointermove",this._onTouchMove):e?Su(document,"touchmove",this._onTouchMove):Su(document,"mousemove",this._onTouchMove):(Su(H,"dragend",this),Su(Zu,"dragstart",this._onDragStart));try{document.selection?ot(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(u,e){if(Aa=!1,Zu&&H){j0("dragStarted",this,{evt:e}),this.nativeDraggable&&Su(document,"dragover",Qm);var a=this.options;!u&&H0(H,a.dragClass,!1),H0(H,a.ghostClass,!0),uu.active=this,u&&this._appendGhost(),y0({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(ee){this._lastX=ee.clientX,this._lastY=ee.clientY,R1();for(var u=document.elementFromPoint(ee.clientX,ee.clientY),e=u;u&&u.shadowRoot&&(u=u.shadowRoot.elementFromPoint(ee.clientX,ee.clientY),u!==e);)e=u;if(H.parentNode[G0]._isOutsideThisEl(u),e)do{if(e[G0]){var a=void 0;if(a=e[G0]._onDragOver({clientX:ee.clientX,clientY:ee.clientY,target:u,rootEl:e}),a&&!this.options.dragoverBubble)break}u=e}while(e=e.parentNode);K1()}},_onTouchMove:function(u){if(Xe){var e=this.options,a=e.fallbackTolerance,i=e.fallbackOffset,t=u.touches?u.touches[0]:u,r=cu&&Ta(cu,!0),o=cu&&r&&r.a,s=cu&&r&&r.d,l=ji&&b0&&Fs(b0),E=(t.clientX-Xe.clientX+i.x)/(o||1)+(l?l[0]-Fn[0]:0)/(o||1),d=(t.clientY-Xe.clientY+i.y)/(s||1)+(l?l[1]-Fn[1]:0)/(s||1);if(!uu.active&&!Aa){if(a&&Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))=0&&(y0({rootEl:a0,name:"add",toEl:a0,fromEl:Zu,originalEvent:u}),y0({sortable:this,name:"remove",toEl:a0,originalEvent:u}),y0({rootEl:a0,name:"sort",toEl:a0,fromEl:Zu,originalEvent:u}),y0({sortable:this,name:"sort",toEl:a0,originalEvent:u})),C0&&C0.save()):O0!==za&&O0>=0&&(y0({sortable:this,name:"update",toEl:a0,originalEvent:u}),y0({sortable:this,name:"sort",toEl:a0,originalEvent:u})),uu.active&&((O0==null||O0===-1)&&(O0=za,He=Ei),y0({sortable:this,name:"end",toEl:a0,originalEvent:u}),this.save()))),this._nulling()},_nulling:function(){j0("nulling",this),Zu=H=a0=cu=ta=u0=nt=Oe=Xe=ee=ni=O0=He=za=Ei=ka=di=C0=_i=uu.dragged=uu.ghost=uu.clone=uu.active=null,zt.forEach(function(u){u.checked=!0}),zt.length=Cn=pn=0},handleEvent:function(u){switch(u.type){case"drop":case"dragend":this._onDrop(u);break;case"dragenter":case"dragover":H&&(this._onDragOver(u),Xm(u));break;case"selectstart":u.preventDefault();break}},toArray:function(){for(var u=[],e,a=this.el.children,i=0,t=a.length,r=this.options;ii.right+t||n.clientY>a.bottom&&n.clientX>a.left:n.clientY>i.bottom+t||n.clientX>a.right&&n.clientY>a.top}function ih(n,u,e,a,i,t,r,o){var s=a?n.clientY:n.clientX,l=a?e.height:e.width,E=a?e.top:e.left,d=a?e.bottom:e.right,c=!1;if(!r){if(o&&rtE+l*t/2:sd-rt)return-di}else if(s>E+l*(1-i)/2&&sd-l*t/2)?s>E+l/2?1:-1:0}function th(n){return U0(H){B.hide(a)}),this._options.showTopPanel||this._topPanelScrollers.forEach(a=>{B.hide(a)}),this._options.showHeaderRow||this._headerRowScroller.forEach(a=>{B.hide(a)}),this._viewportTopL=v("div",{className:"slick-viewport slick-viewport-top slick-viewport-left",tabIndex:0},this._paneTopL),this._viewportTopR=v("div",{className:"slick-viewport slick-viewport-top slick-viewport-right",tabIndex:0},this._paneTopR),this._viewportBottomL=v("div",{className:"slick-viewport slick-viewport-bottom slick-viewport-left",tabIndex:0},this._paneBottomL),this._viewportBottomR=v("div",{className:"slick-viewport slick-viewport-bottom slick-viewport-right",tabIndex:0},this._paneBottomR),this._viewport=[this._viewportTopL,this._viewportTopR,this._viewportBottomL,this._viewportBottomR],this._options.viewportClass&&this._viewport.forEach(a=>{a.classList.add(..._u(this._options.viewportClass))}),this._activeViewportNode=this._viewportTopL,this._canvasTopL=v("div",{className:"grid-canvas grid-canvas-top grid-canvas-left",tabIndex:0},this._viewportTopL),this._canvasTopR=v("div",{className:"grid-canvas grid-canvas-top grid-canvas-right",tabIndex:0},this._viewportTopR),this._canvasBottomL=v("div",{className:"grid-canvas grid-canvas-bottom grid-canvas-left",tabIndex:0},this._viewportBottomL),this._canvasBottomR=v("div",{className:"grid-canvas grid-canvas-bottom grid-canvas-right",tabIndex:0},this._viewportBottomR),this._canvas=[this._canvasTopL,this._canvasTopR,this._canvasBottomL,this._canvasBottomR],this.scrollbarDimensions=this.scrollbarDimensions||this.measureScrollbar(),this._activeCanvasNode=this._canvasTopL,this._preHeaderPanelSpacer&&B.width(this._preHeaderPanelSpacer,this.getCanvasWidth()+this.scrollbarDimensions.width),this._headers.forEach(a=>{B.width(a,this.getHeadersWidth())}),B.width(this._headerRowSpacerL,this.getCanvasWidth()+this.scrollbarDimensions.width),B.width(this._headerRowSpacerR,this.getCanvasWidth()+this.scrollbarDimensions.width),this._options.createFooterRow&&(this._footerRowScrollerR=v("div",{className:"slick-footerrow slick-state-default"},this._paneTopR),this._footerRowScrollerL=v("div",{className:"slick-footerrow slick-state-default"},this._paneTopL),this._footerRowScroller=[this._footerRowScrollerL,this._footerRowScrollerR],this._footerRowSpacerL=v("div",{style:{display:"block",height:"1px",position:"absolute",top:"0px",left:"0px"}},this._footerRowScrollerL),B.width(this._footerRowSpacerL,this.getCanvasWidth()+this.scrollbarDimensions.width),this._footerRowSpacerR=v("div",{style:{display:"block",height:"1px",position:"absolute",top:"0px",left:"0px"}},this._footerRowScrollerR),B.width(this._footerRowSpacerR,this.getCanvasWidth()+this.scrollbarDimensions.width),this._footerRowL=v("div",{className:"slick-footerrow-columns slick-footerrow-columns-left"},this._footerRowScrollerL),this._footerRowR=v("div",{className:"slick-footerrow-columns slick-footerrow-columns-right"},this._footerRowScrollerR),this._footerRow=[this._footerRowL,this._footerRowR],this._options.showFooterRow||this._footerRowScroller.forEach(a=>{B.hide(a)})),this._focusSink2=this._focusSink.cloneNode(!0),this._container.appendChild(this._focusSink2),this._options.explicitInitialization||this.finishInitialization()}finishInitialization(){this.initialized||(this.initialized=!0,this.getViewportWidth(),this.getViewportHeight(),this.measureCellPaddingAndBorder(),this.disableSelection(this._headers),this._options.enableTextSelectionOnCells||this._viewport.forEach(u=>{this._bindingEventService.bind(u,"selectstart",e=>{e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement})}),this.setFrozenOptions(),this.setPaneVisibility(),this.setScroller(),this.setOverflow(),this.updateColumnCaches(),this.createColumnHeaders(),this.createColumnFooter(),this.setupColumnSort(),this.createCssRules(),this.resizeCanvas(),this.bindAncestorScrollEvents(),this._bindingEventService.bind(this._container,"resize",this.resizeCanvas.bind(this)),this._viewport.forEach(u=>{this._bindingEventService.bind(u,"scroll",this.handleScroll.bind(this))}),this._options.enableMouseWheelScrollHandler&&this._viewport.forEach(u=>{this.slickMouseWheelInstances.push(Bs({element:u,onMouseWheel:this.handleMouseWheel.bind(this)}))}),this._headerScroller.forEach(u=>{this._bindingEventService.bind(u,"contextmenu",this.handleHeaderContextMenu.bind(this)),this._bindingEventService.bind(u,"click",this.handleHeaderClick.bind(this))}),this._headerRowScroller.forEach(u=>{this._bindingEventService.bind(u,"scroll",this.handleHeaderRowScroll.bind(this))}),this._options.createFooterRow&&(this._footerRow.forEach(u=>{this._bindingEventService.bind(u,"contextmenu",this.handleFooterContextMenu.bind(this)),this._bindingEventService.bind(u,"click",this.handleFooterClick.bind(this))}),this._footerRowScroller.forEach(u=>{this._bindingEventService.bind(u,"scroll",this.handleFooterRowScroll.bind(this))})),this._options.createPreHeaderPanel&&this._bindingEventService.bind(this._preHeaderPanelScroller,"scroll",this.handlePreHeaderPanelScroll.bind(this)),this._bindingEventService.bind(this._focusSink,"keydown",this.handleKeyDown.bind(this)),this._bindingEventService.bind(this._focusSink2,"keydown",this.handleKeyDown.bind(this)),this._canvas.forEach(u=>{this._bindingEventService.bind(u,"keydown",this.handleKeyDown.bind(this)),this._bindingEventService.bind(u,"click",this.handleClick.bind(this)),this._bindingEventService.bind(u,"dblclick",this.handleDblClick.bind(this)),this._bindingEventService.bind(u,"contextmenu",this.handleContextMenu.bind(this)),this._bindingEventService.bind(u,"mouseover",this.handleCellMouseOver.bind(this)),this._bindingEventService.bind(u,"mouseout",this.handleCellMouseOut.bind(this))}),fs&&(this.slickDraggableInstance=fs({containerElement:this._container,allowDragFrom:"div.slick-cell",allowDragFromClosest:"div.slick-cell.dnd, div.slick-cell.cell-reorder",onDragInit:this.handleDragInit.bind(this),onDragStart:this.handleDragStart.bind(this),onDrag:this.handleDrag.bind(this),onDragEnd:this.handleDragEnd.bind(this)})),this._options.suppressCssChangesOnHiddenInit||this.restoreCssFromHiddenInit())}cacheCssForHiddenInit(){this._hiddenParents=B.parents(this._container,":hidden"),this._hiddenParents.forEach(u=>{const e={};Object.keys(this.cssShow).forEach(a=>{this.cssShow&&(e[a]=u.style[a],u.style[a]=this.cssShow[a])}),this.oldProps.push(e)})}restoreCssFromHiddenInit(){let u=0;this._hiddenParents&&this._hiddenParents.forEach(e=>{const a=this.oldProps[u++];Object.keys(this.cssShow).forEach(i=>{this.cssShow&&(e.style[i]=a[i])})})}hasFrozenColumns(){return this._options.frozenColumn>-1}registerPlugin(u){this.plugins.unshift(u),u.init(this)}unregisterPlugin(u){var e;for(let a=this.plugins.length;a>=0;a--)if(this.plugins[a]===u){(e=this.plugins[a])==null||e.destroy(),this.plugins.splice(a,1);break}}getPluginByName(u){var e;for(let a=this.plugins.length-1;a>=0;a--)if(((e=this.plugins[a])==null?void 0:e.pluginName)===u)return this.plugins[a]}getPubSubService(){return this._pubSubService}setSelectionModel(u){this.selectionModel&&(this.selectionModel.onSelectedRangesChanged.unsubscribe(this.handleSelectedRangesChanged.bind(this)),this.selectionModel.destroy&&this.selectionModel.destroy()),this.selectionModel=u,this.selectionModel&&(this.selectionModel.init(this),this.selectionModel.onSelectedRangesChanged.subscribe(this.handleSelectedRangesChanged.bind(this)))}getSelectionModel(){return this.selectionModel}getCanvasNode(u,e){return this._getContainerElement(this.getCanvases(),u,e)}getActiveCanvasNode(u){var e;return u===void 0?this._activeCanvasNode:(u instanceof Pu&&(u=u.getNativeEvent()),this._activeCanvasNode=(e=u==null?void 0:u.target)==null?void 0:e.closest(".grid-canvas"),this._activeCanvasNode)}getCanvases(){return this._canvas}getViewportNode(u,e){return this._getContainerElement(this.getViewports(),u,e)}getViewports(){return this._viewport}getActiveViewportNode(u){return this.setActiveViewportNode(u),this._activeViewportNode}setActiveViewportNode(u){var e;return u instanceof Pu&&(u=u.getNativeEvent()),this._activeViewportNode=(e=u==null?void 0:u.target)==null?void 0:e.closest(".slick-viewport"),this._activeViewportNode}_getContainerElement(u,e,a){if(!u)return;e||(e=0),a||(a=0);const i=typeof e=="number"?e:this.getColumnIndex(e),t=this.hasFrozenRows&&a>=this.actualFrozenRow+(this._options.frozenBottom?0:1),r=this.hasFrozenColumns()&&i>this._options.frozenColumn;return u[(t?2:0)+(r?1:0)]}measureScrollbar(){let u="";this._viewport.forEach(t=>u+=t.className);const e=v("div",{className:u,style:{position:"absolute",top:"-10000px",left:"-10000px",overflow:"auto",width:"100px",height:"100px"}},document.body),a=v("div",{style:{width:"200px",height:"200px",overflow:"auto"}},e),i={width:e.offsetWidth-e.clientWidth,height:e.offsetHeight-e.clientHeight};return a.remove(),e.remove(),i}getHeadersWidth(){var i,t,r,o;this.headersWidth=this.headersWidthL=this.headersWidthR=0;const u=!this._options.autoHeight;let e=0;const a=this.columns.length;for(e=0;e-1&&e>this._options.frozenColumn?this.headersWidthR+=s||0:this.headersWidthL+=s||0}return u&&(this._options.frozenColumn>-1&&e>this._options.frozenColumn?this.headersWidthR+=((i=this.scrollbarDimensions)==null?void 0:i.width)||0:this.headersWidthL+=((t=this.scrollbarDimensions)==null?void 0:t.width)||0),this.hasFrozenColumns()?(this.headersWidthL=this.headersWidthL+1e3,this.headersWidthR=Math.max(this.headersWidthR,this.viewportW)+this.headersWidthL,this.headersWidthR+=((r=this.scrollbarDimensions)==null?void 0:r.width)||0):(this.headersWidthL+=((o=this.scrollbarDimensions)==null?void 0:o.width)||0,this.headersWidthL=Math.max(this.headersWidthL,this.viewportW)+1e3),this.headersWidth=this.headersWidthL+this.headersWidthR,Math.max(this.headersWidth,this.viewportW)+1e3}getCanvasWidth(){var i;const u=this.viewportHasVScroll?this.viewportW-(((i=this.scrollbarDimensions)==null?void 0:i.width)||0):this.viewportW;let e=this.columns.length;for(this.canvasWidthL=this.canvasWidthR=0;e--;)!this.columns[e]||this.columns[e].hidden||(this.hasFrozenColumns()&&e>this._options.frozenColumn?this.canvasWidthR+=this.columns[e].width||0:this.canvasWidthL+=this.columns[e].width||0);let a=this.canvasWidthL+this.canvasWidthR;if(this._options.fullWidthRows){const t=Math.max(a,u)-a;t>0&&(a+=t,this.hasFrozenColumns()?this.canvasWidthR+=t:this.canvasWidthL+=t)}return a}updateCanvasWidth(u){var r,o,s,l,E;const e=this.canvasWidth,a=this.canvasWidthL,i=this.canvasWidthR;this.canvasWidth=this.getCanvasWidth();const t=this.canvasWidth!==e||this.canvasWidthL!==a||this.canvasWidthR!==i;if(t||this.hasFrozenColumns()||this.hasFrozenRows)if(B.width(this._canvasTopL,this.canvasWidthL),this.getHeadersWidth(),B.width(this._headerL,this.headersWidthL),B.width(this._headerR,this.headersWidthR),this.hasFrozenColumns()){const d=B.width(this._container)||0;if(d>0&&this.canvasWidthL>d&&this._options.throwWhenFrozenNotAllViewable)throw new Error("[SlickGrid] Frozen columns cannot be wider than the actual grid container width. Make sure to have less columns freezed or make your grid container wider");B.width(this._canvasTopR,this.canvasWidthR),B.width(this._paneHeaderL,this.canvasWidthL),B.setStyleSize(this._paneHeaderR,"left",this.canvasWidthL),B.setStyleSize(this._paneHeaderR,"width",this.viewportW-this.canvasWidthL),B.width(this._paneTopL,this.canvasWidthL),B.setStyleSize(this._paneTopR,"left",this.canvasWidthL),B.width(this._paneTopR,this.viewportW-this.canvasWidthL),B.width(this._headerRowScrollerL,this.canvasWidthL),B.width(this._headerRowScrollerR,this.viewportW-this.canvasWidthL),B.width(this._headerRowL,this.canvasWidthL),B.width(this._headerRowR,this.canvasWidthR),this._options.createFooterRow&&(B.width(this._footerRowScrollerL,this.canvasWidthL),B.width(this._footerRowScrollerR,this.viewportW-this.canvasWidthL),B.width(this._footerRowL,this.canvasWidthL),B.width(this._footerRowR,this.canvasWidthR)),this._options.createPreHeaderPanel&&B.width(this._preHeaderPanel,this.canvasWidth),B.width(this._viewportTopL,this.canvasWidthL),B.width(this._viewportTopR,this.viewportW-this.canvasWidthL),this.hasFrozenRows&&(B.width(this._paneBottomL,this.canvasWidthL),B.setStyleSize(this._paneBottomR,"left",this.canvasWidthL),B.width(this._viewportBottomL,this.canvasWidthL),B.width(this._viewportBottomR,this.viewportW-this.canvasWidthL),B.width(this._canvasBottomL,this.canvasWidthL),B.width(this._canvasBottomR,this.canvasWidthR))}else B.width(this._paneHeaderL,"100%"),B.width(this._paneTopL,"100%"),B.width(this._headerRowScrollerL,"100%"),B.width(this._headerRowL,this.canvasWidth),this._options.createFooterRow&&(B.width(this._footerRowScrollerL,"100%"),B.width(this._footerRowL,this.canvasWidth)),this._options.createPreHeaderPanel&&B.width(this._preHeaderPanel,this.canvasWidth),B.width(this._viewportTopL,"100%"),this.hasFrozenRows&&(B.width(this._viewportBottomL,"100%"),B.width(this._canvasBottomL,this.canvasWidthL));this.viewportHasHScroll=this.canvasWidth>=this.viewportW-(((r=this.scrollbarDimensions)==null?void 0:r.width)||0),B.width(this._headerRowSpacerL,this.canvasWidth+(this.viewportHasVScroll&&((o=this.scrollbarDimensions)==null?void 0:o.width)||0)),B.width(this._headerRowSpacerR,this.canvasWidth+(this.viewportHasVScroll&&((s=this.scrollbarDimensions)==null?void 0:s.width)||0)),this._options.createFooterRow&&(B.width(this._footerRowSpacerL,this.canvasWidth+(this.viewportHasVScroll&&((l=this.scrollbarDimensions)==null?void 0:l.width)||0)),B.width(this._footerRowSpacerR,this.canvasWidth+(this.viewportHasVScroll&&((E=this.scrollbarDimensions)==null?void 0:E.width)||0))),(t||u)&&this.applyColumnWidths()}disableSelection(u){u.forEach(e=>{e.setAttribute("unselectable","on"),e.style.mozUserSelect="none",this._bindingEventService.bind(e,"selectstart",()=>!1)})}getMaxSupportedCssHeight(){let u=1e6;const e=navigator.userAgent.toLowerCase().match(/firefox/)?this._options.ffMaxSupportedCssHeight:this._options.maxSupportedCssHeight,a=v("div",{style:{display:"hidden"}},document.body);let i=!0;for(;i;){const t=u*2;B.height(a,t);const r=B.height(a);if(t>e||r!==t){i=!1;break}else u=t}return a.remove(),u}getUID(){return this.uid}getHeaderColumnWidthDiff(){return this.headerColumnWidthDiff}getScrollbarDimensions(){return this.scrollbarDimensions}getDisplayedScrollbarDimensions(){var u,e;return{width:this.viewportHasVScroll&&((u=this.scrollbarDimensions)==null?void 0:u.width)||0,height:this.viewportHasHScroll&&((e=this.scrollbarDimensions)==null?void 0:e.height)||0}}getAbsoluteColumnMinWidth(){return this.absoluteColumnMinWidth}bindAncestorScrollEvents(){let u=this.hasFrozenRows&&!this._options.frozenBottom?this._canvasBottomL:this._canvasTopL;for(;(u=u.parentNode)!==document.body&&u;)(u===this._viewportTopL||u.scrollWidth!==u.clientWidth||u.scrollHeight!==u.clientHeight)&&(this._boundAncestors.push(u),this._bindingEventService.bind(u,"scroll",this.handleActiveCellPositionChange.bind(this)))}unbindAncestorScrollEvents(){this._boundAncestors.forEach(u=>{this._bindingEventService.unbindByEventName(u,"scroll")}),this._boundAncestors=[]}updateColumnHeader(u,e,a){if(this.initialized){const i=this.getColumnIndex(u);if(!$u(i))return;const t=this.columns[i],r=this.getColumnByIndex(i);return r&&(e!==void 0&&(this.columns[i].name=e),a!==void 0&&(this.columns[i].toolTip=a),this.triggerEvent(this.onBeforeHeaderCellDestroy,{node:r,column:t,grid:this}),r.setAttribute("title",a||""),e!==void 0&&this.applyHtmlCode(r.children[0],e),this.triggerEvent(this.onHeaderCellRendered,{node:r,column:t,grid:this})),r}}getHeader(u){if(!u)return this.hasFrozenColumns()?this._headers:this._headerL;const e=this.getColumnIndex(u.id);return this.hasFrozenColumns()?e<=this._options.frozenColumn?this._headerL:this._headerR:this._headerL}getHeaderColumn(u){const e=typeof u=="number"?u:this.getColumnIndex(u),a=this.hasFrozenColumns()?e<=this._options.frozenColumn?this._headerL:this._headerR:this._headerL,i=this.hasFrozenColumns()?e<=this._options.frozenColumn?e:e-this._options.frozenColumn-1:e;return a.children[i]}getHeaderRow(){var u;return this.hasFrozenColumns()?this._headerRows:(u=this._headerRows)==null?void 0:u[0]}getFooterRow(){var u;return this.hasFrozenColumns()?this._footerRow:(u=this._footerRow)==null?void 0:u[0]}getPreHeaderPanel(){return this._preHeaderPanel}getPreHeaderPanelLeft(){return this._preHeaderPanel}getPreHeaderPanelRight(){return this._preHeaderPanelR}getHeaderRowColumn(u){let e=typeof u=="number"?u:this.getColumnIndex(u),a;return this.hasFrozenColumns()?e<=this._options.frozenColumn?a=this._headerRowL:(a=this._headerRowR,e-=this._options.frozenColumn+1):a=this._headerRowL,a.children[e]}getFooterRowColumn(u){let e=typeof u=="number"?u:this.getColumnIndex(u),a;return this.hasFrozenColumns()?e<=this._options.frozenColumn?a=this._footerRowL:(a=this._footerRowR,e-=this._options.frozenColumn+1):a=this._footerRowL,a==null?void 0:a.children[e]}createColumnFooter(){if(this._options.createFooterRow){this._footerRow.forEach(u=>{u.querySelectorAll(".slick-footerrow-column").forEach(a=>{const i=B.storage.get(a,"column");this.triggerEvent(this.onBeforeFooterRowCellDestroy,{node:a,column:i,grid:this})})}),bu(this._footerRowL),bu(this._footerRowR);for(let u=0;uthis._options.frozenColumn?this._footerRowR:this._footerRowL),i=this.hasFrozenColumns()&&u<=this._options.frozenColumn?"frozen":null;i&&a.classList.add(i),B.storage.put(a,"column",e),this.triggerEvent(this.onFooterRowCellRendered,{node:a,column:e,grid:this})}}}handleHeaderMouseHoverOn(u){u==null||u.target.classList.add("slick-state-hover")}handleHeaderMouseHoverOff(u){u==null||u.target.classList.remove("slick-state-hover")}createColumnHeaders(){this._headers.forEach(u=>{u.querySelectorAll(".slick-header-column").forEach(a=>{const i=B.storage.get(a,"column");i&&this.triggerEvent(this.onBeforeHeaderCellDestroy,{node:a,column:i,grid:this})})}),bu(this._headerL),bu(this._headerR),this.getHeadersWidth(),B.width(this._headerL,this.headersWidthL),B.width(this._headerR,this.headersWidthR),this._headerRows.forEach(u=>{u.querySelectorAll(".slick-headerrow-column").forEach(a=>{const i=B.storage.get(a,"column");i&&this.triggerEvent(this.onBeforeHeaderRowCellDestroy,{node:this,column:i,grid:this})})}),bu(this._headerRowL),bu(this._headerRowR),this._options.createFooterRow&&(this._footerRowL.querySelectorAll(".slick-footerrow-column").forEach(e=>{const a=B.storage.get(e,"column");a&&this.triggerEvent(this.onBeforeFooterRowCellDestroy,{node:this,column:a,grid:this})}),bu(this._footerRowL),this.hasFrozenColumns()&&(this._footerRowR.querySelectorAll(".slick-footerrow-column").forEach(a=>{const i=B.storage.get(a,"column");i&&this.triggerEvent(this.onBeforeFooterRowCellDestroy,{node:this,column:i,grid:this})}),bu(this._footerRowR)));for(let u=0;u{e.headerCellAttrs.hasOwnProperty(s)&&t.setAttribute(s,e.headerCellAttrs[s])}),e.sortable&&(t.classList.add("slick-header-sortable"),v("div",{className:`slick-sort-indicator ${this._options.numberedMultiColumnSort&&!this._options.sortColNumberInSeparateSpan?" slick-sort-indicator-numbered":""}`},t),this._options.numberedMultiColumnSort&&this._options.sortColNumberInSeparateSpan&&v("div",{className:"slick-sort-indicator-numbered"},t)),this.triggerEvent(this.onHeaderCellRendered,{node:t,column:e,grid:this}),this._options.showHeaderRow){const s=v("div",{className:`slick-state-default slick-headerrow-column l${u} r${u}`},i),l=this.hasFrozenColumns()&&u<=this._options.frozenColumn?"frozen":null;l&&s.classList.add(l),this._bindingEventService.bind(s,"mouseenter",this.handleHeaderRowMouseEnter.bind(this)),this._bindingEventService.bind(s,"mouseleave",this.handleHeaderRowMouseLeave.bind(this)),this._bindingEventService.bind(s,"mouseover",this.handleHeaderRowMouseOver.bind(this)),this._bindingEventService.bind(s,"mouseout",this.handleHeaderRowMouseOut.bind(this)),B.storage.put(s,"column",e),this.triggerEvent(this.onHeaderRowCellRendered,{node:s,column:e,grid:this})}if(this._options.createFooterRow&&this._options.showFooterRow){const s=this.hasFrozenColumns()?u<=this._options.frozenColumn?this._footerRow[0]:this._footerRow[1]:this._footerRow[0],l=v("div",{className:`slick-state-default slick-footerrow-column l${u} r${u}`},s);B.storage.put(l,"column",e),this.triggerEvent(this.onFooterRowCellRendered,{node:l,column:e,grid:this})}}this.setSortColumns(this.sortColumns),this.setupColumnResize(),this._options.enableColumnReorder&&(typeof this._options.enableColumnReorder=="function"?this._options.enableColumnReorder(this,this._headers,this.headerColumnWidthDiff,this.setColumns,this.setupColumnResize,this.columns,this.getColumnIndex,this.uid,this.triggerEvent):this.setupColumnReorder())}setupColumnSort(){this._headers.forEach(u=>{this._bindingEventService.bind(u,"click",e=>{var t;if(this.columnResizeDragging||e.target.classList.contains("slick-resizable-handle"))return;const a=e.target.closest(".slick-header-column");if(!a)return;const i=B.storage.get(a,"column");if(i!=null&&i.sortable){if(!((t=this.getEditorLock())!=null&&t.commitCurrentEdit()))return;const r=this.sortColumns.slice();let o=null,s=0;for(;s{const c=this.columns[this.getColumnIndex(d.columnId)];return!c||c.hidden?null:{columnId:c.id,sortCol:c,sortAsc:d.sortAsc}}).filter(d=>d)}:E={multiColumnSort:!1,previousSortColumns:r,columnId:this.sortColumns.length>0?i.id:null,sortCol:this.sortColumns.length>0?i:null,sortAsc:this.sortColumns.length>0?this.sortColumns[0].sortAsc:!0},this.triggerEvent(this.onBeforeSort,E,e).getReturnValue()!==!1&&(this.setSortColumns(this.sortColumns),this.triggerEvent(this.onSort,E,e))}})})}setupColumnReorder(){var r,o;(r=this.sortableSideLeftInstance)==null||r.destroy(),(o=this.sortableSideRightInstance)==null||o.destroy();let u=null;const e=()=>this._viewportScrollContainerX.scrollLeft+=10,a=()=>this._viewportScrollContainerX.scrollLeft-=10;let i=!1;const t={animation:50,direction:"horizontal",chosenClass:"slick-header-column-active",ghostClass:"slick-sortable-placeholder",draggable:".slick-header-column",dragoverBubble:!1,revertClone:!0,scroll:!this.hasFrozenColumns(),filter:`.${this._options.unorderableColumnCssClass}`,onMove:s=>!s.related.classList.contains(this._options.unorderableColumnCssClass),onStart:s=>{i=!this.hasFrozenColumns()||Iu(s.item).left>Iu(this._viewportScrollContainerX).left,i&&s.originalEvent.pageX>this._container.clientWidth?u||(u=setInterval(e,100)):i&&s.originalEvent.pageX{var d,c,D;if(clearInterval(u),u=null,!((d=this.getEditorLock())!=null&&d.commitCurrentEdit()))return;let l=((c=this.sortableSideLeftInstance)==null?void 0:c.toArray())??[];l=l.concat(((D=this.sortableSideRightInstance)==null?void 0:D.toArray())??[]);const E=[];for(let m=0;m"u")throw new Error('SlickResizable is undefined, make sure to import "slick.interactions.js"');let u,e,a,i,t,r,o,s=-1,l=0;const E=this.getHeaderChildren(),d=this.getVisibleColumns();for(let c=0;ch.remove()),!(c>=d.length||!d[c])&&d[c].resizable&&(o===void 0&&(o=c),s=c);if(o!==void 0)for(let c=0;c=d.length||!d[c]||c=s)continue;const m=v("div",{className:"slick-resizable-handle",role:"separator",ariaOrientation:"horizontal"},D);this._bindingEventService.bind(m,"dblclick",this.handleResizeableDoubleClick.bind(this)),this.slickResizableInstances.push(ys({resizeableElement:D,resizeableHandleElement:m,onResizeStart:(h,x)=>{var y;const g=h.touches?h.changedTouches[0]:h;if(!((y=this.getEditorLock())!=null&&y.commitCurrentEdit()))return!1;i=g.pageX,l=0,x.resizeableElement.classList.add("slick-header-column-active");let F=null,C=null;for(let S=0;S=d.length||!d[S]||(d[S].previousWidth=E[S].offsetWidth);if(this._options.forceFitColumns)for(F=0,C=0,u=c+1;u{var z;const g=h.touches?h.changedTouches[0]:h;this.columnResizeDragging=!0;let F;const C=Math.min(r,Math.max(t,g.pageX))-i;let A,b=0,y=0;const S=this.viewportHasVScroll?this.viewportW-(((z=this.scrollbarDimensions)==null?void 0:z.width)||0):this.viewportW;if(C<0){for(A=C,u=c;u>=0;u--)a=d[u],a&&a.resizable&&!a.hidden&&(F=Math.max(a.minWidth||0,this.absoluteColumnMinWidth),A&&(a.previousWidth||0)+Athis._options.frozenColumn?y+=a.width||0:b+=a.width||0);if(this._options.forceFitColumns)for(A=-C,u=c+1;uthis._options.frozenColumn?y+=a.width||0:b+=a.width||0);else for(u=c+1;uthis._options.frozenColumn?y+=a.width||0:b+=a.width||0);if(this._options.forceFitColumns)for(A=-C,u=c+1;u=0;u--)if(a=d[u],!(!a||a.hidden)&&a.resizable)if(A&&a.maxWidth&&a.maxWidth-(a.previousWidth||0)l&&wS?l:M):a.width=M,A=0}for(e=0;e<=c;e++)a=d[e],!(!a||a.hidden)&&(this.hasFrozenColumns()&&e>this._options.frozenColumn?y+=a.width||0:b+=a.width||0);if(this._options.forceFitColumns)for(A=-C,u=c+1;uthis._options.frozenColumn?y+=a.width||0:b+=a.width||0);else for(u=c+1;uthis._options.frozenColumn?y+=a.width||0:b+=a.width||0)}this.hasFrozenColumns()&&b!==this.canvasWidthL&&(B.width(this._headerL,b+1e3),B.setStyleSize(this._paneHeaderR,"left",b)),this.applyColumnHeaderWidths(),this._options.syncColumnCellResize&&this.applyColumnWidths(),this.triggerEvent(this.onColumnsDrag,{triggeredByColumn:x.resizeableElement,resizeHandle:x.resizeableHandleElement})},onResizeEnd:(h,x)=>{x.resizeableElement.classList.remove("slick-header-column-active");const g=x.resizeableElement.id.replace(this.uid,"");this.triggerEvent(this.onBeforeColumnsResize,{triggeredByColumn:g}).getReturnValue()===!0&&this.applyColumnHeaderWidths();let F;for(u=0;uthis.columnResizeDragging=!1,this._options.columnResizingDelay)}}))}}getVBoxDelta(u){const e=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],a=getComputedStyle(u);let i=0;return e.forEach(t=>i+=B.toFloat(a[t])),i}setFrozenOptions(){if(this._options.frozenColumn=this._options.frozenColumn>=0&&this._options.frozenColumn-1){this.hasFrozenRows=!0,this.frozenRowsHeight=this._options.frozenRow*this._options.rowHeight;const u=this.getDataLength();this.actualFrozenRow=this._options.frozenBottom?u-this._options.frozenRow:this._options.frozenRow}else this.hasFrozenRows=!1}setPaneVisibility(){this.hasFrozenColumns()?(B.show(this._paneHeaderR),B.show(this._paneTopR),this.hasFrozenRows?(B.show(this._paneBottomL),B.show(this._paneBottomR)):(B.hide(this._paneBottomR),B.hide(this._paneBottomL))):(B.hide(this._paneHeaderR),B.hide(this._paneTopR),B.hide(this._paneBottomR),this.hasFrozenRows?B.show(this._paneBottomL):(B.hide(this._paneBottomR),B.hide(this._paneBottomL)))}setOverflow(){if(this._viewportTopL.style.overflowX=this.hasFrozenColumns()?this.hasFrozenRows&&!this._options.alwaysAllowHorizontalScroll?"hidden":"scroll":this.hasFrozenRows&&!this._options.alwaysAllowHorizontalScroll?"hidden":"auto",this._viewportTopL.style.overflowY=!this.hasFrozenColumns()&&this._options.alwaysShowVerticalScroll?"scroll":this.hasFrozenColumns()?(this.hasFrozenRows,"hidden"):this.hasFrozenRows?"scroll":"auto",this._viewportTopR.style.overflowX=this.hasFrozenColumns()?this.hasFrozenRows&&!this._options.alwaysAllowHorizontalScroll?"hidden":"scroll":this.hasFrozenRows&&!this._options.alwaysAllowHorizontalScroll?"hidden":"auto",this._viewportTopR.style.overflowY=this._options.alwaysShowVerticalScroll?"scroll":this.hasFrozenColumns()?this.hasFrozenRows?"scroll":"auto":this.hasFrozenRows?"scroll":"auto",this._viewportBottomL.style.overflowX=this.hasFrozenColumns()?this.hasFrozenRows&&!this._options.alwaysAllowHorizontalScroll?"scroll":"auto":(this.hasFrozenRows&&!this._options.alwaysAllowHorizontalScroll,"auto"),this._viewportBottomL.style.overflowY=!this.hasFrozenColumns()&&this._options.alwaysShowVerticalScroll?"scroll":this.hasFrozenColumns()?(this.hasFrozenRows,"hidden"):this.hasFrozenRows?"scroll":"auto",this._viewportBottomR.style.overflowX=this.hasFrozenColumns()?this.hasFrozenRows&&!this._options.alwaysAllowHorizontalScroll?"scroll":"auto":(this.hasFrozenRows&&!this._options.alwaysAllowHorizontalScroll,"auto"),this._viewportBottomR.style.overflowY=this._options.alwaysShowVerticalScroll?"scroll":this.hasFrozenColumns()?(this.hasFrozenRows,"auto"):(this.hasFrozenRows,"auto"),this._options.viewportClass){const u=_u(this._options.viewportClass);this._viewportTopL.classList.add(...u),this._viewportTopR.classList.add(...u),this._viewportBottomL.classList.add(...u),this._viewportBottomR.classList.add(...u)}}setScroller(){this.hasFrozenColumns()?(this._headerScrollContainer=this._headerScrollerR,this._headerRowScrollContainer=this._headerRowScrollerR,this._footerRowScrollContainer=this._footerRowScrollerR,this.hasFrozenRows?this._options.frozenBottom?(this._viewportScrollContainerX=this._viewportBottomR,this._viewportScrollContainerY=this._viewportTopR):this._viewportScrollContainerX=this._viewportScrollContainerY=this._viewportBottomR:this._viewportScrollContainerX=this._viewportScrollContainerY=this._viewportTopR):(this._headerScrollContainer=this._headerScrollerL,this._headerRowScrollContainer=this._headerRowScrollerL,this._footerRowScrollContainer=this._footerRowScrollerL,this.hasFrozenRows?this._options.frozenBottom?(this._viewportScrollContainerX=this._viewportBottomL,this._viewportScrollContainerY=this._viewportTopL):this._viewportScrollContainerX=this._viewportScrollContainerY=this._viewportBottomL:this._viewportScrollContainerX=this._viewportScrollContainerY=this._viewportTopL)}measureCellPaddingAndBorder(){const u=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],e=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],a=this._headers[0];this.headerColumnWidthDiff=this.headerColumnHeightDiff=0,this.cellWidthDiff=this.cellHeightDiff=0;let i=v("div",{className:"slick-state-default slick-header-column",style:{visibility:"hidden"},textContent:"-"},a),t=getComputedStyle(i);t.boxSizing!=="border-box"&&(u.forEach(o=>this.headerColumnWidthDiff+=B.toFloat(t[o])),e.forEach(o=>this.headerColumnHeightDiff+=B.toFloat(t[o]))),i.remove();const r=v("div",{className:"slick-row"},this._canvas[0]);i=v("div",{className:"slick-cell",id:"",style:{visibility:"hidden"},textContent:"-"},r),t=getComputedStyle(i),t.boxSizing!=="border-box"&&(u.forEach(o=>this.cellWidthDiff+=B.toFloat(t[o])),e.forEach(o=>this.cellHeightDiff+=B.toFloat(t[o]))),r.remove(),this.absoluteColumnMinWidth=Math.max(this.headerColumnWidthDiff,this.cellWidthDiff)}createCssRules(){this._style=document.createElement("style"),this._style.nonce=this._options.nonce||"",(this._options.shadowRoot||document.head).appendChild(this._style);const u=this._options.rowHeight-this.cellHeightDiff,e=[`.${this.uid} .slick-group-header-column { left: 1000px; }`,`.${this.uid} .slick-header-column { left: 1000px; }`,`.${this.uid} .slick-top-panel { height: ${this._options.topPanelHeight}px; }`,`.${this.uid} .slick-preheader-panel { height: ${this._options.preHeaderPanelHeight}px; }`,`.${this.uid} .slick-headerrow-columns { height: ${this._options.headerRowHeight}px; }`,`.${this.uid} .slick-footerrow-columns { height: ${this._options.footerRowHeight}px; }`,`.${this.uid} .slick-cell { height: ${u}px; }`,`.${this.uid} .slick-row { height: ${this._options.rowHeight}px; }`],a=this._style.sheet;if(a){e.forEach(i=>{a.insertRule(i)});for(let i=0;i ',this._style=e.content.firstChild,(this._options.shadowRoot||document.head).appendChild(this._style);for(let a=0;a=0&&(a[this._options.devMode.ownerNodeIndex].ownerNode=this._style),e=0;e{this._bindingEventService.unbindByEventName(s,"keydown"),this._bindingEventService.unbindByEventName(s,"click"),this._bindingEventService.unbindByEventName(s,"dblclick"),this._bindingEventService.unbindByEventName(s,"contextmenu"),this._bindingEventService.unbindByEventName(s,"mouseover"),this._bindingEventService.unbindByEventName(s,"mouseout")}),this._viewport.forEach(s=>{this._bindingEventService.unbindByEventName(s,"scroll")}),this._headerScroller.forEach(s=>{this._bindingEventService.unbindByEventName(s,"contextmenu"),this._bindingEventService.unbindByEventName(s,"click")}),this._headerRowScroller.forEach(s=>{this._bindingEventService.unbindByEventName(s,"scroll")}),this._footerRow&&this._footerRow.forEach(s=>{this._bindingEventService.unbindByEventName(s,"contextmenu"),this._bindingEventService.unbindByEventName(s,"click")}),this._footerRowScroller&&this._footerRowScroller.forEach(s=>{this._bindingEventService.unbindByEventName(s,"scroll")}),this._preHeaderPanelScroller&&this._bindingEventService.unbindByEventName(this._preHeaderPanelScroller,"scroll"),this._bindingEventService.unbindByEventName(this._focusSink,"keydown"),this._bindingEventService.unbindByEventName(this._focusSink2,"keydown");const a=this._container.querySelectorAll(".slick-resizable-handle");[].forEach.call(a,s=>{this._bindingEventService.unbindByEventName(s,"dblclick")});const i=this._container.querySelectorAll(".slick-header-column");[].forEach.call(i,s=>{this._bindingEventService.unbindByEventName(s,"mouseenter"),this._bindingEventService.unbindByEventName(s,"mouseleave"),this._bindingEventService.unbindByEventName(s,"mouseover"),this._bindingEventService.unbindByEventName(s,"mouseout")}),bu(this._container),this._container.classList.remove(this.uid),this.clearAllTimers(),u&&wr(this)}destroyAllInstances(u){if(u){const e=Array.isArray(u)?u:[u];let a;for(;$u(a=e.pop());)a&&typeof a.destroy=="function"&&a.destroy()}return u=Array.isArray(u)?[]:null,u}autosizeColumns(){this.legacyAutosizeColumns()}legacyAutosizeColumns(){var l;let u,e,a=0,i=0,t=0;const r=[],o=this.viewportHasVScroll?this.viewportW-(((l=this.scrollbarDimensions)==null?void 0:l.width)||0):this.viewportW;for(u=0;uo&&a;){const E=(i-o)/a;for(u=0;uo;u++){if(e=this.columns[u],!e||e.hidden)continue;const d=r[u];if(!e.resizable||d<=e.minWidth||d<=this.absoluteColumnMinWidth)continue;const c=Math.max(e.minWidth,this.absoluteColumnMinWidth);let D=Math.floor(E*(d-c))||1;D=Math.min(D,d-c),i-=D,a-=D,r[u]-=D}if(t<=i)break;t=i}for(t=i;i=i)break;t=i}let s=!1;for(u=0;u!u.hidden)}triggerEvent(u,e,a){const i=a||new Pu(a,e),t=e||{};return t.grid=this,u.notify(t,i,this)}getEditorLock(){return this._options.editorLock}getEditController(){return this.editController}getColumnIndex(u){return this.columnsById[u]}applyColumnHeaderWidths(){if(this.initialized){let u=0;const e=this.getVisibleColumns();this._headers.forEach(a=>{for(let i=0;ithis._options.frozenColumn?this.canvasWidthR:this.canvasWidthL)-u-e+"px",this._options.frozenColumn!==t&&(u+=this.columns[t].width)),this._options.frozenColumn===t&&(u=0)}setSortColumn(u,e){this.setSortColumns([{columnId:u,sortAsc:e}])}getColumnByIndex(u){let e;return this._headers.every(a=>{const i=a.children.length;return u1;this._headers.forEach(i=>{let t=i.querySelectorAll(".slick-header-column-sorted");t.forEach(r=>r.classList.remove("slick-header-column-sorted")),t=i.querySelectorAll(".slick-sort-indicator"),t.forEach(r=>r.classList.remove("slick-sort-indicator-asc","slick-sort-indicator-desc")),t=i.querySelectorAll(".slick-sort-indicator-numbered"),t.forEach(r=>r.textContent="")});let a=1;this.sortColumns.forEach(i=>{$u(i.sortAsc)||(i.sortAsc=!0);const t=this.getColumnIndex(i.columnId);if($u(t)){const r=this.getColumnByIndex(t);if(r){r.classList.add("slick-header-column-sorted");let o=r.querySelector(".slick-sort-indicator");o==null||o.classList.add(i.sortAsc?"slick-sort-indicator-asc":"slick-sort-indicator-desc"),e&&(o=r.querySelector(".slick-sort-indicator-numbered"),o&&(o.textContent=String(a)))}}a++})}getSortColumns(){return this.sortColumns}handleSelectedRangesChanged(u,e){var r;const a=u.getNativeEvent(),i=this.selectedRows.slice(0);this.selectedRows=[];const t={};for(let o=0;oi.indexOf(E)<0),l=i.filter(E=>this.getSelectedRows().indexOf(E)<0);this.triggerEvent(this.onSelectedRowsChanged,{rows:this.getSelectedRows(),previousSelectedRows:i,caller:o,changedSelectedRows:s,changedUnselectedRows:l},u)}}simpleArrayEquals(u,e){return Array.isArray(u)&&Array.isArray(e)&&e.sort().toString()!==u.sort().toString()}getColumns(){return this.columns}updateColumnCaches(){this.columnPosLeft=[],this.columnPosRight=[];let u=0;for(let e=0,a=this.columns.length;ee.maxWidth&&(e.width=e.maxWidth)}}setColumns(u){this.triggerEvent(this.onBeforeSetColumns,{previousColumns:this.columns,newColumns:u,grid:this}),this.columns=u,this.updateColumnsInternal(),this.triggerEvent(this.onAfterSetColumns,{newColumns:u,grid:this})}updateColumns(){this.triggerEvent(this.onBeforeUpdateColumns,{columns:this.columns,grid:this}),this.updateColumnsInternal()}updateColumnsInternal(){var u;this.updateColumnProps(),this.updateColumnCaches(),this.initialized&&(this.setPaneVisibility(),this.setOverflow(),this.invalidateAllRows(),this.createColumnHeaders(),this.createColumnFooter(),this.removeCssRules(),this.createCssRules(),this.resizeCanvas(),this.updateCanvasWidth(),this.applyColumnWidths(),this.handleScroll(),(u=this.getSelectionModel())==null||u.refreshSelections())}getOptions(){return this._options}setOptions(u,e,a,i){this.prepareForOptionsChange(),this._options.enableAddRow!==u.enableAddRow&&this.invalidateRow(this.getDataLength()),u.frozenColumn&&(this.getViewports().forEach(r=>r.scrollLeft=0),this.handleScroll());const t=wu(!0,{},this._options);this._options=wu(this._options,u),this.triggerEvent(this.onSetOptions,{optionsBefore:t,optionsAfter:this._options}),this.internal_setOptions(e,a,i)}activateChangedOptions(u,e,a){this.prepareForOptionsChange(),this.invalidateRow(this.getDataLength()),this.triggerEvent(this.onActivateChangedOptions,{options:this._options}),this.internal_setOptions(u,e,a)}prepareForOptionsChange(){var u;(u=this.getEditorLock())!=null&&u.commitCurrentEdit()&&this.makeActiveCellNormal()}internal_setOptions(u,e,a){this._options.showColumnHeader!==void 0&&this.setColumnHeaderVisibility(this._options.showColumnHeader),this.validateAndEnforceOptions(),this.setFrozenOptions(),this._options.frozenBottom!==void 0&&(this.enforceFrozenRowHeightRecalc=!0),this._viewport.forEach(i=>{i.style.overflowY=this._options.autoHeight?"hidden":"auto"}),u||this.render(),this.setScroller(),a||this.setOverflow(),e||this.setColumns(this.columns),this._options.enableMouseWheelScrollHandler&&this._viewport&&(!this.slickMouseWheelInstances||this.slickMouseWheelInstances.length===0)?this._viewport.forEach(i=>{this.slickMouseWheelInstances.push(Bs({element:i,onMouseWheel:this.handleMouseWheel.bind(this)}))}):this._options.enableMouseWheelScrollHandler===!1&&this.destroyAllInstances(this.slickMouseWheelInstances)}validateAndEnforceOptions(){this._options.autoHeight&&(this._options.leaveSpaceForNewRows=!1)}setData(u,e){this.data=u,this.invalidateAllRows(),this.updateRowCount(),e&&this.scrollTo(0)}getData(){return this.data}getDataLength(){var u;return this.data.getLength?this.data.getLength():((u=this.data)==null?void 0:u.length)||0}getDataLengthIncludingAddNew(){return this.getDataLength()+(this._options.enableAddRow&&(!this.pagingActive||this.pagingIsLastPage)?1:0)}getDataItem(u){return this.data.getItem?this.data.getItem(u):this.data[u]}getTopPanel(){return this._topPanels[0]}getTopPanels(){return this._topPanels}hasDataView(){return!Array.isArray(this.data)}togglePanelVisibility(u,e,a){this._options[u]!==a&&(this._options[u]=a,a?B.show(e):B.hide(e),this.resizeCanvas())}setTopPanelVisibility(u){this.togglePanelVisibility("showTopPanel",this._topPanelScrollers,u)}setHeaderRowVisibility(u){this.togglePanelVisibility("showHeaderRow",this._headerRowScroller,u)}setColumnHeaderVisibility(u){this.togglePanelVisibility("showColumnHeader",this._headerScroller,u)}setFooterRowVisibility(u){this.togglePanelVisibility("showFooterRow",this._footerRowScroller,u)}setPreHeaderPanelVisibility(u){this.togglePanelVisibility("showPreHeaderPanel",[this._preHeaderPanelScroller,this._preHeaderPanelScrollerR],u)}getContainerNode(){return this._container}getRowTop(u){return this._options.rowHeight*u-this.offset}getRowFromPosition(u){return Math.floor((u+this.offset)/this._options.rowHeight)}scrollTo(u){var i;u=Math.max(u,0),u=Math.min(u,(this.th||0)-B.height(this._viewportScrollContainerY)+((this.viewportHasHScroll||this.hasFrozenColumns())&&((i=this.scrollbarDimensions)==null?void 0:i.height)||0));const e=this.offset;this.offset=Math.round(this.page*(this.cj||0)),this.page=Math.min((this.n||0)-1,Math.floor(u/(this.ph||0)));const a=u-this.offset;if(this.offset!==e){const t=this.getVisibleRange(a);this.cleanupRows(t),this.updateRowPositions()}this.prevScrollTop!==a&&(this.vScrollDir=this.prevScrollTop+e /g,">"):""}getFormatter(u,e){var t,r,o;const a=(r=(t=this.data)==null?void 0:t.getItemMetadata)==null?void 0:r.call(t,u),i=(a==null?void 0:a.columns)&&(a.columns[e.id]||a.columns[this.getColumnIndex(e.id)]);return(i==null?void 0:i.formatter)||(a==null?void 0:a.formatter)||e.formatter||((o=this._options.formatterFactory)==null?void 0:o.getFormatter(e))||this._options.defaultFormatter}getEditor(u,e){var r,o,s,l,E,d;const a=this.columns[e],i=(o=(r=this.data)==null?void 0:r.getItemMetadata)==null?void 0:o.call(r,u),t=i==null?void 0:i.columns;return((s=t==null?void 0:t[a.id])==null?void 0:s.editorClass)!==void 0?t[a.id].editorClass:((l=t==null?void 0:t[e])==null?void 0:l.editorClass)!==void 0?t[e].editorClass:a.editorClass||((d=(E=this._options)==null?void 0:E.editorFactory)==null?void 0:d.getEditor(a))}getDataItemValueForColumn(u,e){return this._options.dataItemColumnValueExtractor?this._options.dataItemColumnValueExtractor(u,e):u[e.field]}appendRowHtml(u,e,a,i,t){var h,x;const r=this.getDataItem(a),o=ai.leftPx){if(!m.alwaysRenderColumn&&this.columnPosLeft[g]>i.rightPx)break;this.hasFrozenColumns()&&g>this._options.frozenColumn?this.appendCellHtml(c,a,g,D,r):this.appendCellHtml(d,a,g,D,r)}else(m.alwaysRenderColumn||this.hasFrozenColumns()&&g<=this._options.frozenColumn)&&this.appendCellHtml(d,a,g,D,r);D>1&&(g+=D-1)}}appendCellHtml(u,e,a,i,t){const r=this.columns[a];let o="slick-cell l"+a+" r"+Math.min(this.columns.length-1,a+i-1)+(r.cssClass?" "+r.cssClass:"");this.hasFrozenColumns()&&a<=this._options.frozenColumn&&(o+=" frozen"),e===this.activeRow&&a===this.activeCell&&this._options.showCellSelection&&(o+=" active"),Object.keys(this.cellCssClasses).forEach(h=>{var x;(x=this.cellCssClasses[h][e])!=null&&x[r.id]&&(o+=` ${this.cellCssClasses[h][e][r.id]}`)});let s=null,l="";t&&(s=this.getDataItemValueForColumn(t,r),l=this.getFormatter(e,r)(e,a,s,r,t,this),l==null&&(l=""));const d=this.triggerEvent(this.onBeforeAppendCell,{row:e,cell:a,value:s,dataContext:t}).getReturnValue();let c=typeof d=="string"?d:"";l!=null&&l.addClasses&&(c+=_u((c?" ":"")+l.addClasses).join(" "));const D=l!=null&&l.toolTip?`${l.toolTip}`:"",m=v("div",{className:_u(`${o} ${c||""}`).join(" "),role:"gridcell",tabIndex:-1});if(m.setAttribute("aria-describedby",this.uid+r.id),D&&m.setAttribute("title",D),r.hasOwnProperty("cellAttrs")&&r.cellAttrs instanceof Object&&Object.keys(r.cellAttrs).forEach(h=>{r.cellAttrs.hasOwnProperty(h)&&m.setAttribute(h,r.cellAttrs[h])}),t){const h=ca(l)?l:l.html||l.text;this.applyHtmlCode(m,h)}u.appendChild(m),l.insertElementAfterTarget&&Vl(m,l.insertElementAfterTarget),this.rowsCache[e].cellRenderQueue.push(a),this.rowsCache[e].cellColSpans[a]=i}cleanupRows(u){Object.keys(this.rowsCache).forEach(e=>{if(this.rowsCache){let a=+e,i=!0;this.hasFrozenRows&&(this._options.frozenBottom&&a>=this.actualFrozenRow||!this._options.frozenBottom&&a<=this.actualFrozenRow)&&(i=!1),(a=parseInt(e,10))!==this.activeRow&&(au.bottom)&&i&&this.removeRowFromCache(a)}}),this._options.enableAsyncPostRenderCleanup&&this.startPostProcessingCleanup()}invalidate(){this.updateRowCount(),this.invalidateAllRows(),this.render()}invalidateAllRows(){this.currentEditor&&this.makeActiveCellNormal(),typeof this.rowsCache=="object"&&Object.keys(this.rowsCache).forEach(u=>{this.rowsCache&&this.removeRowFromCache(+u)}),this._options.enableAsyncPostRenderCleanup&&this.startPostProcessingCleanup()}invalidateRows(u){if(u!=null&&u.length){this.vScrollDir=0;const e=u.length;for(let a=0;a=0&&this.invalidateRows([u])}queuePostProcessedRowForCleanup(u,e,a){var i;this.postProcessgroupId++,typeof e=="object"&&Object.keys(e).forEach(t=>{e.hasOwnProperty(t)&&this.postProcessedCleanupQueue.push({actionType:"C",groupId:this.postProcessgroupId,node:u.cellNodesByColumnIdx[+t],columnIdx:+t,rowIdx:a})}),u.rowNode||(u.rowNode=[]),this.postProcessedCleanupQueue.push({actionType:"R",groupId:this.postProcessgroupId,node:u.rowNode}),(i=u.rowNode)==null||i.forEach(t=>t.remove())}queuePostProcessedCellForCleanup(u,e,a){this.postProcessedCleanupQueue.push({actionType:"C",groupId:this.postProcessgroupId,node:u,columnIdx:e,rowIdx:a}),u.remove()}removeRowFromCache(u){var a;const e=this.rowsCache[u];e!=null&&e.rowNode&&(this._options.enableAsyncPostRenderCleanup&&this.postProcessedRows[u]?this.queuePostProcessedRowForCleanup(e,this.postProcessedRows[u],u):(a=e.rowNode)==null||a.forEach(i=>{var t;return(t=i.parentElement)==null?void 0:t.removeChild(i)}),delete this.rowsCache[u],delete this.postProcessedRows[u],this.renderedRows--,this.counter_rows_removed++)}applyFormatResultToCellNode(u,e,a){if(u==null&&(u=""),ca(u)){this.applyHtmlCode(e,u);return}const i=u.html||u.text;this.applyHtmlCode(e,i),u.removeClasses&&!a&&e.classList.remove(..._u(u.removeClasses)),u.addClasses&&e.classList.add(..._u(u.addClasses)),u.toolTip&&e.setAttribute("title",u.toolTip)}updateCell(u,e){const a=this.getCellNode(u,e);if(a){const i=this.columns[e],t=this.getDataItem(u);if(this.currentEditor&&this.activeRow===u&&this.activeCell===e)this.currentEditor.loadValue(t);else{const r=t?this.getFormatter(u,i)(u,e,this.getDataItemValueForColumn(t,i),i,t,this):"";this.applyFormatResultToCellNode(r,a),this.invalidatePostProcessingResults(u)}}}updateRow(u){const e=this.rowsCache[u];if(!e)return;this.ensureCellNodesInRowsCache(u);let a;const i=this.getDataItem(u);Object.keys(e.cellNodesByColumnIdx).forEach(t=>{if(!e.cellNodesByColumnIdx.hasOwnProperty(t))return;const r=+t,o=this.columns[r],s=e.cellNodesByColumnIdx[r];this.currentEditor&&u===this.activeRow&&r===this.activeCell?this.currentEditor.loadValue(i):i?(a=this.getFormatter(u,o)(u,r,this.getDataItemValueForColumn(i,o),o,i,this),this.applyFormatResultToCellNode(a,s)):bu(s)}),this.invalidatePostProcessingResults(u)}getViewportRowCount(){var a;const u=this.getViewportHeight(),e=((a=this.getScrollbarDimensions())==null?void 0:a.height)||0;return Math.floor((u-e)/this._options.rowHeight)}getViewportHeight(){var u;if((!this._options.autoHeight||this._options.frozenColumn!==-1)&&(this.topPanelH=this._options.showTopPanel?this._options.topPanelHeight+this.getVBoxDelta(this._topPanelScrollers[0]):0,this.headerRowH=this._options.showHeaderRow?this._options.headerRowHeight+this.getVBoxDelta(this._headerRowScroller[0]):0,this.footerRowH=this._options.showFooterRow?this._options.footerRowHeight+this.getVBoxDelta(this._footerRowScroller[0]):0),this._options.autoHeight){let e=this._paneHeaderL.offsetHeight;e+=this._options.showHeaderRow?this._options.headerRowHeight+this.getVBoxDelta(this._headerRowScroller[0]):0,e+=this._options.showFooterRow?this._options.footerRowHeight+this.getVBoxDelta(this._footerRowScroller[0]):0,e+=this.getCanvasWidth()>this.viewportW&&((u=this.scrollbarDimensions)==null?void 0:u.height)||0,this.viewportH=this._options.rowHeight*this.getDataLengthIncludingAddNew()+(this._options.frozenColumn===-1?e:0)}else{const e=this._options.showColumnHeader?B.toFloat(B.height(this._headerScroller[0]))+this.getVBoxDelta(this._headerScroller[0]):0,a=this._options.createPreHeaderPanel&&this._options.showPreHeaderPanel?this._options.preHeaderPanelHeight+this.getVBoxDelta(this._preHeaderPanelScroller):0,i=getComputedStyle(this._container);this.viewportH=B.toFloat(i.height)-B.toFloat(i.paddingTop)-B.toFloat(i.paddingBottom)-e-this.topPanelH-this.headerRowH-this.footerRowH-a}return this.numVisibleRows=Math.ceil(this.viewportH/this._options.rowHeight),this.viewportH}getViewportWidth(){return this.viewportW=parseFloat(ht(this._container,"width"))||this._options.devMode&&this._options.devMode.containerClientWidth||0,this.viewportW}resizeCanvas(){var u,e,a;if(this.initialized){if(this.paneTopH=0,this.paneBottomH=0,this.viewportTopH=0,this.viewportBottomH=0,this.getViewportWidth(),this.getViewportHeight(),this.hasFrozenRows?this._options.frozenBottom?(this.paneTopH=this.viewportH-this.frozenRowsHeight-(((u=this.scrollbarDimensions)==null?void 0:u.height)||0),this.paneBottomH=this.frozenRowsHeight+(((e=this.scrollbarDimensions)==null?void 0:e.height)||0)):(this.paneTopH=this.frozenRowsHeight,this.paneBottomH=this.viewportH-this.frozenRowsHeight):this.paneTopH=this.viewportH,this.paneTopH+=this.topPanelH+this.headerRowH+this.footerRowH,this.hasFrozenColumns()&&this._options.autoHeight&&(this.paneTopH+=((a=this.scrollbarDimensions)==null?void 0:a.height)||0),this.viewportTopH=this.paneTopH-this.topPanelH-this.headerRowH-this.footerRowH,this._options.autoHeight){if(this.hasFrozenColumns()){const t=getComputedStyle(this._headerScrollerL);B.height(this._container,this.paneTopH+B.toFloat(t.height))}this._paneTopL.style.position="relative"}B.setStyleSize(this._paneTopL,"top",B.height(this._paneHeaderL)||(this._options.showHeaderRow?this._options.headerRowHeight:0)+(this._options.showPreHeaderPanel?this._options.preHeaderPanelHeight:0)),B.height(this._paneTopL,this.paneTopH);const i=this._paneTopL.offsetTop+this.paneTopH;this._options.autoHeight||B.height(this._viewportTopL,this.viewportTopH),this.hasFrozenColumns()?(B.setStyleSize(this._paneTopR,"top",B.height(this._paneHeaderL)),B.height(this._paneTopR,this.paneTopH),B.height(this._viewportTopR,this.viewportTopH),this.hasFrozenRows&&(B.setStyleSize(this._paneBottomL,"top",i),B.height(this._paneBottomL,this.paneBottomH),B.setStyleSize(this._paneBottomR,"top",i),B.height(this._paneBottomR,this.paneBottomH),B.height(this._viewportBottomR,this.paneBottomH))):this.hasFrozenRows&&(B.width(this._paneBottomL,"100%"),B.height(this._paneBottomL,this.paneBottomH),B.setStyleSize(this._paneBottomL,"top",i)),this.hasFrozenRows?(B.height(this._viewportBottomL,this.paneBottomH),this._options.frozenBottom?(B.height(this._canvasBottomL,this.frozenRowsHeight),this.hasFrozenColumns()&&B.height(this._canvasBottomR,this.frozenRowsHeight)):(B.height(this._canvasTopL,this.frozenRowsHeight),this.hasFrozenColumns()&&B.height(this._canvasTopR,this.frozenRowsHeight))):B.height(this._viewportTopR,this.viewportTopH),(!this.scrollbarDimensions||!this.scrollbarDimensions.width)&&(this.scrollbarDimensions=this.measureScrollbar()),this._options.forceFitColumns&&this.legacyAutosizeColumns(),this.updateRowCount(),this.handleScroll(),this.lastRenderedScrollLeft=-1,this.render()}}updatePagingStatusFromView(u){this.pagingActive=u.pageSize!==0,this.pagingIsLastPage=u.pageNum===u.totalPages-1}updateRowCount(){var u,e;if(this.initialized){const a=this.getDataLength(),i=this.getDataLengthIncludingAddNew();let t=0,r=this.hasFrozenRows&&!this._options.frozenBottom?B.height(this._canvasBottomL):B.height(this._canvasTopL);this.hasFrozenRows?t=this.getDataLength()-this._options.frozenRow:t=i+(this._options.leaveSpaceForNewRows?this.numVisibleRows-1:0);const o=B.height(this._viewportScrollContainerY),s=this.viewportHasVScroll;this.viewportHasVScroll=this._options.alwaysShowVerticalScroll||!this._options.autoHeight&&t*this._options.rowHeight>o,this.makeActiveCellNormal();const l=a-1;typeof this.rowsCache=="object"&&Object.keys(this.rowsCache).forEach(d=>{const c=+d;c>l&&this.removeRowFromCache(c)}),this._options.enableAsyncPostRenderCleanup&&this.startPostProcessingCleanup(),this.activeCellNode&&this.activeRow>l&&this.resetActiveCell(),r=this.h,this._options.autoHeight?this.h=this._options.rowHeight*t:(this.th=Math.max(this._options.rowHeight*t,o-(((u=this.scrollbarDimensions)==null?void 0:u.height)||0)),this.th1&&(t=t.concat(Array.from(i[1].children)));let r=t.length-1;for(;e.cellRenderQueue.length;){const o=e.cellRenderQueue.pop();e.cellNodesByColumnIdx[o]=t[r--]}}}cleanUpCells(u,e){var o,s;if(this.hasFrozenRows&&(this._options.frozenBottom&&e>this.actualFrozenRow||e<=this.actualFrozenRow))return;const a=this.rowsCache[e],i=[];Object.keys(a.cellNodesByColumnIdx).forEach(l=>{var c;if(!a.cellNodesByColumnIdx.hasOwnProperty(l))return;const E=+l;if(E<=this._options.frozenColumn||Array.isArray(this.columns)&&((c=this.columns[E])!=null&&c.alwaysRenderColumn))return;const d=a.cellColSpans[E];(this.columnPosLeft[E]>u.rightPx||this.columnPosRight[Math.min(this.columns.length-1,(E||0)+d-1)]u.rightPx)break;if($u(r=e.cellColSpans[h])){h+=r>1?r-1:0;continue}if(r=1,D){const F=D[this.columns[h].id]||D[h];r=(F==null?void 0:F.colspan)??1,r==="*"&&(r=x-h)}const g=r;this.columnPosRight[Math.min(x-1,h+g-1)]>u.leftPx&&(this.appendCellHtml(a,d,h,g,m),t++),h+=g>1?g-1:0}t&&i.push(d)}if(!a.children.length)return;let o,s;for(;$u(o=i.pop());){e=this.rowsCache[o];let d;for(;$u(d=e.cellRenderQueue.pop());)s=a.lastChild,s&&(this.hasFrozenColumns()&&d>this._options.frozenColumn?e.rowNode[1].appendChild(s):e.rowNode[0].appendChild(s),e.cellNodesByColumnIdx[d]=s)}}renderRows(u){var l,E,d,c;const e=[],a=[],i=[];let t=!1;const r=this.getDataLength();for(let D=u.top,m=u.bottom;D<=m;D++)this.rowsCache[D]||this.hasFrozenRows&&this._options.frozenBottom&&D===this.getDataLength()||(this.renderedRows++,i.push(D),this.rowsCache[D]={rowNode:null,cellColSpans:[],cellNodesByColumnIdx:[],cellRenderQueue:[]},this.appendRowHtml(e,a,D,u,r),this.activeCellNode&&this.activeRow===D&&(t=!0),this.counter_rows_rendered++);if(!i.length)return;const o=document.createElement("div"),s=document.createElement("div");e.forEach(D=>o.appendChild(D)),a.forEach(D=>s.appendChild(D));for(let D=0,m=i.length;D=this.actualFrozenRow?this.hasFrozenColumns()?(l=this.rowsCache)!=null&&l.hasOwnProperty(i[D])&&o.firstChild&&s.firstChild&&(this.rowsCache[i[D]].rowNode=[o.firstChild,s.firstChild],this._canvasBottomL.appendChild(o.firstChild),this._canvasBottomR.appendChild(s.firstChild)):(E=this.rowsCache)!=null&&E.hasOwnProperty(i[D])&&o.firstChild&&(this.rowsCache[i[D]].rowNode=[o.firstChild],this._canvasBottomL.appendChild(o.firstChild)):this.hasFrozenColumns()?(d=this.rowsCache)!=null&&d.hasOwnProperty(i[D])&&o.firstChild&&s.firstChild&&(this.rowsCache[i[D]].rowNode=[o.firstChild,s.firstChild],this._canvasTopL.appendChild(o.firstChild),this._canvasTopR.appendChild(s.firstChild)):(c=this.rowsCache)!=null&&c.hasOwnProperty(i[D])&&o.firstChild&&(this.rowsCache[i[D]].rowNode=[o.firstChild],this._canvasTopL.appendChild(o.firstChild));t&&(this.activeCellNode=this.getCellNode(this.activeRow,this.activeCell))}startPostProcessing(){this._options.enableAsyncPostRender&&(clearTimeout(this.h_postrender),this.h_postrender=setTimeout(this.asyncPostProcessRows.bind(this),this._options.asyncPostRenderDelay))}startPostProcessingCleanup(){this._options.enableAsyncPostRenderCleanup&&(clearTimeout(this.h_postrenderCleanup),this.h_postrenderCleanup=setTimeout(this.asyncPostProcessCleanupRows.bind(this),this._options.asyncPostRenderCleanupDelay))}invalidatePostProcessingResults(u){typeof this.postProcessedRows[u]=="object"&&Object.keys(this.postProcessedRows[u]).forEach(e=>{this.postProcessedRows[u].hasOwnProperty(e)&&(this.postProcessedRows[u][e]="C")}),this.postProcessFromRow=Math.min(this.postProcessFromRow,u),this.postProcessToRow=Math.max(this.postProcessToRow,u),this.startPostProcessing()}updateRowPositions(){this.rowsCache&&typeof this.rowsCache=="object"&&Object.keys(this.rowsCache).forEach(u=>{const e=u?parseInt(u,10):0;B.setStyleSize(this.rowsCache[e].rowNode[0],"top",this.getRowTop(e))})}render(){if(this.initialized){this.scrollThrottle.dequeue();const u=this.getVisibleRange(),e=this.getRenderedRange();if(this.cleanupRows(e),this.lastRenderedScrollLeft!==this.scrollLeft){if(this.hasFrozenRows){const a=wu(!0,{},e);this._options.frozenBottom?(a.top=this.actualFrozenRow,a.bottom=this.getDataLength()):(a.top=0,a.bottom=this._options.frozenRow),this.cleanUpAndRenderCells(a)}this.cleanUpAndRenderCells(e)}this.renderRows(e),this.hasFrozenRows&&(this._options.frozenBottom?this.renderRows({top:this.actualFrozenRow,bottom:this.getDataLength()-1,leftPx:e.leftPx,rightPx:e.rightPx}):this.renderRows({top:0,bottom:this._options.frozenRow-1,leftPx:e.leftPx,rightPx:e.rightPx})),this.postProcessFromRow=u.top,this.postProcessToRow=Math.min(this.getDataLengthIncludingAddNew()-1,u.bottom),this.startPostProcessing(),this.lastRenderedScrollTop=this.scrollTop,this.lastRenderedScrollLeft=this.scrollLeft,this.h_render=null,this.triggerEvent(this.onRendered,{startRow:u.top,endRow:u.bottom,grid:this})}}handleHeaderRowScroll(){const u=this._headerRowScrollContainer.scrollLeft;u!==this._viewportScrollContainerX.scrollLeft&&(this._viewportScrollContainerX.scrollLeft=u)}handleFooterRowScroll(){const u=this._footerRowScrollContainer.scrollLeft;u!==this._viewportScrollContainerX.scrollLeft&&(this._viewportScrollContainerX.scrollLeft=u)}handlePreHeaderPanelScroll(){this.handleElementScroll(this._preHeaderPanelScroller)}handleElementScroll(u){const e=u.scrollLeft;e!==this._viewportScrollContainerX.scrollLeft&&(this._viewportScrollContainerX.scrollLeft=e)}handleScroll(){return this.scrollTop=this._viewportScrollContainerY.scrollTop,this.scrollLeft=this._viewportScrollContainerX.scrollLeft,this._handleScroll(!1)}_handleScroll(u){let e=this._viewportScrollContainerY.scrollHeight-this._viewportScrollContainerY.clientHeight,a=this._viewportScrollContainerY.scrollWidth-this._viewportScrollContainerY.clientWidth;e=Math.max(0,e),a=Math.max(0,a),this.scrollTop>e&&(this.scrollTop=e),this.scrollLeft>a&&(this.scrollLeft=a);const i=Math.abs(this.scrollTop-this.prevScrollTop),t=Math.abs(this.scrollLeft-this.prevScrollLeft);if(t&&(this.prevScrollLeft=this.scrollLeft,this._viewportScrollContainerX.scrollLeft=this.scrollLeft,this._headerScrollContainer.scrollLeft=this.scrollLeft,this._topPanelScrollers[0].scrollLeft=this.scrollLeft,this._options.createFooterRow&&(this._footerRowScrollContainer.scrollLeft=this.scrollLeft),this._options.createPreHeaderPanel&&(this.hasFrozenColumns()?this._preHeaderPanelScrollerR.scrollLeft=this.scrollLeft:this._preHeaderPanelScroller.scrollLeft=this.scrollLeft),this.hasFrozenColumns()?(this.hasFrozenRows&&(this._viewportTopR.scrollLeft=this.scrollLeft),this._headerRowScrollerR.scrollLeft=this.scrollLeft):(this.hasFrozenRows&&(this._viewportTopL.scrollLeft=this.scrollLeft),this._headerRowScrollerL.scrollLeft=this.scrollLeft)),i&&!this._options.autoHeight)if(this.vScrollDir=this.prevScrollTop20||o>20)&&(this._options.forceSyncScrolling||o{a?i=!0:o()},r=()=>{i=!1},o=()=>{a=!0,clearTimeout(this._executionBlockTimer),this._executionBlockTimer=setTimeout(s,e),u.call(this)},s=()=>{i?(r(),o()):a=!1};return{enqueue:t.bind(this),dequeue:r.bind(this)}}asyncPostProcessRows(){const u=this.getDataLength();for(;this.postProcessFromRow<=this.postProcessToRow;){const e=this.vScrollDir>=0?this.postProcessFromRow++:this.postProcessToRow--,a=this.rowsCache[e];if(!(!a||e>=u)){this.postProcessedRows[e]||(this.postProcessedRows[e]={}),this.ensureCellNodesInRowsCache(e),Object.keys(a.cellNodesByColumnIdx).forEach(i=>{if(a.cellNodesByColumnIdx.hasOwnProperty(i)){const t=+i,r=this.columns[t],o=this.postProcessedRows[e][t];if(r.asyncPostRender&&o!=="R"){const s=a.cellNodesByColumnIdx[t];s&&r.asyncPostRender(s,e,this.getDataItem(e),r,o==="C"),this.postProcessedRows[e][t]="R"}}}),this.h_postrender=setTimeout(this.asyncPostProcessRows.bind(this),this._options.asyncPostRenderDelay);return}}}asyncPostProcessCleanupRows(){if(this.postProcessedCleanupQueue.length>0){const u=this.postProcessedCleanupQueue[0].groupId;for(;this.postProcessedCleanupQueue.length>0&&this.postProcessedCleanupQueue[0].groupId===u;){const e=this.postProcessedCleanupQueue.shift();if((e==null?void 0:e.actionType)==="R"&&e.node.forEach(a=>{a.remove()}),(e==null?void 0:e.actionType)==="C"){const a=this.columns[e.columnIdx];a.asyncPostRenderCleanup&&e.node&&a.asyncPostRenderCleanup(e.node,e.rowIdx,a)}}this.h_postrenderCleanup=setTimeout(this.asyncPostProcessCleanupRows.bind(this),this._options.asyncPostRenderCleanupDelay)}}updateCellCssStylesOnRenderedRows(u,e){let a,i,t;typeof this.rowsCache=="object"&&Object.keys(this.rowsCache).forEach(r=>{this.rowsCache&&(t=e==null?void 0:e[r],i=u==null?void 0:u[r],t&&Object.keys(t).forEach(o=>{(!i||t[o]!==i[o])&&(a=this.getCellNode(+r,this.getColumnIndex(o)),a&&a.classList.remove(t[o]))}),i&&Object.keys(i).forEach(o=>{(!t||t[o]!==i[o])&&(a=this.getCellNode(+r,this.getColumnIndex(o)),a&&a.classList.add(i[o]))}))})}addCellCssStyles(u,e){if(this.cellCssClasses[u])throw new Error(`SlickGrid addCellCssStyles: cell CSS hash with key "${u}" already exists.`);this.cellCssClasses[u]=e,this.updateCellCssStylesOnRenderedRows(e,null),this.triggerEvent(this.onCellCssStylesChanged,{key:u,hash:e,grid:this})}removeCellCssStyles(u){this.cellCssClasses[u]&&(this.updateCellCssStylesOnRenderedRows(null,this.cellCssClasses[u]),delete this.cellCssClasses[u],this.triggerEvent(this.onCellCssStylesChanged,{key:u,hash:null,grid:this}))}setCellCssStyles(u,e){const a=this.cellCssClasses[u];this.cellCssClasses[u]=e,this.updateCellCssStylesOnRenderedRows(e,a),this.triggerEvent(this.onCellCssStylesChanged,{key:u,hash:e,grid:this})}getCellCssStyles(u){return this.cellCssClasses[u]}flashCell(u,e,a=250){const i=(t,r)=>{r<1||(clearTimeout(this._flashCellTimer),this._flashCellTimer=setTimeout(()=>{r%2===0?t.classList.add(this._options.cellFlashingCssClass||""):t.classList.remove(this._options.cellFlashingCssClass||""),i(t,r-1)},a))};if(this.rowsCache[u]){const t=this.getCellNode(u,e);t&&i(t,5)}}highlightRow(u,e){const a=this.rowsCache[u];e||(e=this._options.rowHighlightDuration),Array.isArray(a==null?void 0:a.rowNode)&&this._options.rowHighlightCssClass&&(a.rowNode.forEach(i=>i.classList.add(..._u(this._options.rowHighlightCssClass))),clearTimeout(this._highlightRowTimer),this._highlightRowTimer=setTimeout(()=>{var i;(i=a.rowNode)==null||i.forEach(t=>t.classList.remove(..._u(this._options.rowHighlightCssClass)))},e))}handleMouseWheel(u,e,a,i){this.scrollTop=Math.max(0,this._viewportScrollContainerY.scrollTop-i*this._options.rowHeight),this.scrollLeft=this._viewportScrollContainerX.scrollLeft+a*10,this._handleScroll(!0)&&u.preventDefault()}handleDragInit(u,e){const a=this.getCellFromEvent(u);if(!a||!this.cellExists(a.row,a.cell))return!1;const i=this.triggerEvent(this.onDragInit,e,u);return i.isImmediatePropagationStopped()?i.getReturnValue():!1}handleDragStart(u,e){const a=this.getCellFromEvent(u);if(!a||!this.cellExists(a.row,a.cell))return!1;const i=this.triggerEvent(this.onDragStart,e,u);return i.isImmediatePropagationStopped()?i.getReturnValue():!1}handleDrag(u,e){return this.triggerEvent(this.onDrag,e,u).getReturnValue()}handleDragEnd(u,e){this.triggerEvent(this.onDragEnd,e,u)}handleKeyDown(u){var i,t,r;let a=this.triggerEvent(this.onKeyDown,{row:this.activeRow,cell:this.activeCell},u).isImmediatePropagationStopped();if(!a&&!u.shiftKey&&!u.altKey){if(this._options.editable&&((i=this.currentEditor)!=null&&i.keyCaptureList)&&this.currentEditor.keyCaptureList.indexOf(u.which)>-1)return;u.key==="Home"?a=u.ctrlKey?this.navigateTop():this.navigateRowStart():u.key==="End"&&(a=u.ctrlKey?this.navigateBottom():this.navigateRowEnd())}if(!a)if(!u.shiftKey&&!u.altKey&&!u.ctrlKey)if(u.key==="Escape"){if(!((t=this.getEditorLock())!=null&&t.isActive()))return;this.cancelEditAndSetFocus()}else u.key==="PageDown"?(this.navigatePageDown(),a=!0):u.key==="PageUp"?(this.navigatePageUp(),a=!0):u.key==="ArrowLeft"?a=this.navigateLeft():u.key==="ArrowRight"?a=this.navigateRight():u.key==="ArrowUp"?a=this.navigateUp():u.key==="ArrowDown"?a=this.navigateDown():u.key==="Tab"?a=this.navigateNext():u.key==="Enter"&&(this._options.editable&&(this.currentEditor?this.activeRow===this.getDataLength()?this.navigateDown():this.commitEditAndSetFocus():(r=this.getEditorLock())!=null&&r.commitCurrentEdit()&&this.makeActiveCellEditable(void 0,void 0,u)),a=!0);else u.key==="Tab"&&u.shiftKey&&!u.ctrlKey&&!u.altKey&&(a=this.navigatePrev());a&&(u.stopPropagation(),u.preventDefault())}handleClick(u){var i,t,r;const e=u instanceof Pu?u.getNativeEvent():u;if(!this.currentEditor&&(e.target!==document.activeElement||e.target.classList.contains("slick-cell"))){const o=this.getTextSelection();this.setFocus(),this.setTextSelection(o)}const a=this.getCellFromEvent(e);if(!(!a||this.currentEditor!==null&&this.activeRow===a.row&&this.activeCell===a.cell)&&(u=this.triggerEvent(this.onClick,{row:a.row,cell:a.cell},u||e),!(u.isImmediatePropagationStopped()||e.defaultPrevented)&&this.canCellBeActive(a.row,a.cell)&&(!((i=this.getEditorLock())!=null&&i.isActive())||(t=this.getEditorLock())!=null&&t.commitCurrentEdit()))){this.scrollRowIntoView(a.row,!1);const o=((r=e.target)==null?void 0:r.className)===Pm,s=this.columns[a.cell],l=!!(this._options.editable&&(s!=null&&s.editorClass)&&this._options.suppressActiveCellChangeOnEdit);this.setActiveCellInternal(this.getCellNode(a.row,a.cell),null,o,l,e)}}handleContextMenu(u){const e=u.target.closest(".slick-cell");e&&(this.activeCellNode===e&&this.currentEditor!==null||this.triggerEvent(this.onContextMenu,{},u))}handleDblClick(u){const e=this.getCellFromEvent(u);!e||this.currentEditor!==null&&this.activeRow===e.row&&this.activeCell===e.cell||(this.triggerEvent(this.onDblClick,{row:e.row,cell:e.cell},u),!u.defaultPrevented&&this._options.editable&&this.gotoCell(e.row,e.cell,!0,u))}handleHeaderMouseEnter(u){const e=B.storage.get(u.target.closest(".slick-header-column"),"column");e&&this.triggerEvent(this.onHeaderMouseEnter,{column:e,grid:this},u)}handleHeaderMouseOver(u){const e=B.storage.get(u.target.closest(".slick-header-column"),"column");e&&this.triggerEvent(this.onHeaderMouseOver,{column:e,grid:this},u)}handleHeaderMouseLeave(u){const e=B.storage.get(u.target.closest(".slick-header-column"),"column");e&&this.triggerEvent(this.onHeaderMouseLeave,{column:e,grid:this},u)}handleHeaderMouseOut(u){const e=B.storage.get(u.target.closest(".slick-header-column"),"column");e&&this.triggerEvent(this.onHeaderMouseOut,{column:e,grid:this},u)}handleHeaderRowMouseEnter(u){const e=B.storage.get(u.target.closest(".slick-headerrow-column"),"column");e&&this.triggerEvent(this.onHeaderRowMouseEnter,{column:e,grid:this},u)}handleHeaderRowMouseOver(u){const e=B.storage.get(u.target.closest(".slick-headerrow-column"),"column");e&&this.triggerEvent(this.onHeaderRowMouseOver,{column:e,grid:this},u)}handleHeaderRowMouseLeave(u){const e=B.storage.get(u.target.closest(".slick-headerrow-column"),"column");e&&this.triggerEvent(this.onHeaderRowMouseLeave,{column:e,grid:this},u)}handleHeaderRowMouseOut(u){const e=B.storage.get(u.target.closest(".slick-headerrow-column"),"column");e&&this.triggerEvent(this.onHeaderRowMouseOut,{column:e,grid:this},u)}handleHeaderContextMenu(u){const e=u.target.closest(".slick-header-column"),a=e&&B.storage.get(e,"column");this.triggerEvent(this.onHeaderContextMenu,{column:a},u)}handleHeaderClick(u){if(this.columnResizeDragging)return;const e=u.target.closest(".slick-header-column"),a=e&&B.storage.get(e,"column");a&&this.triggerEvent(this.onHeaderClick,{column:a},u)}handleFooterContextMenu(u){const e=u.target.closest(".slick-footerrow-column"),a=e&&B.storage.get(e,"column");this.triggerEvent(this.onFooterContextMenu,{column:a},u)}handleFooterClick(u){const e=u.target.closest(".slick-footerrow-column"),a=e&&B.storage.get(e,"column");this.triggerEvent(this.onFooterClick,{column:a},u)}handleCellMouseOver(u){this.triggerEvent(this.onMouseEnter,{},u)}handleCellMouseOut(u){this.triggerEvent(this.onMouseLeave,{},u)}cellExists(u,e){return!(u<0||u>=this.getDataLength()||e<0||e>=this.columns.length)}getCellFromPoint(u,e){let a=this.getRowFromPosition(e),i=0,t=0;for(let r=0;r=this.actualFrozenRow?this.h=this.actualFrozenRow?e=this.frozenRowsHeight:e=0:e=0,e}getCellFromEvent(u){const e=u instanceof Pu?u.getNativeEvent():u;if(!e)return null;const a=e.touches?e.touches[0]:e,i=e.target.closest(".slick-cell");if(!i)return null;let t=this.getRowFromNode(i.parentNode);if(this.hasFrozenRows){let o=0;const s=Iu(B.parents(i,".grid-canvas")[0]);B.parents(i,".grid-canvas-bottom").length&&(o=this._options.frozenBottom?B.height(this._canvasTopL):this.frozenRowsHeight);const E=a.clientX-s.left,d=a.clientY-s.top+o+document.documentElement.scrollTop;t=this.getCellFromPoint(E,d).row}const r=this.getCellFromNode(i);return!ia(t)||!ia(r)?null:{row:t,cell:r}}getCellNodeBox(u,e){var s;if(!this.cellExists(u,e))return null;const a=this.getFrozenRowOffset(u),i=this.getRowTop(u)-a,t=i+this._options.rowHeight-1;let r=0;for(let l=0;l1?i-1:0)])}internalScrollColumnIntoView(u,e){var i;const a=this.scrollLeft+B.width(this._viewportScrollContainerX)-(this.viewportHasVScroll&&((i=this.scrollbarDimensions)==null?void 0:i.width)||0);ua&&(this._viewportScrollContainerX.scrollLeft=Math.min(u,e-this._viewportScrollContainerX.clientWidth),this.handleScroll(),this.render())}scrollColumnIntoView(u){this.internalScrollColumnIntoView(this.columnPosLeft[u],this.columnPosRight[u])}setActiveCellInternal(u,e,a,i,t){var r,o,s,l;if($u(this.activeCellNode)&&(this.makeActiveCellNormal(),this.activeCellNode.classList.remove("active"),(o=(r=this.rowsCache[this.activeRow])==null?void 0:r.rowNode)==null||o.forEach(E=>E.classList.remove("active"))),this.activeCellNode=u,$u(this.activeCellNode)){const E=Iu(this.activeCellNode);let d=Math.floor(Iu(B.parents(this.activeCellNode,".grid-canvas")[0]).top);const c=B.parents(this.activeCellNode,".grid-canvas-bottom").length;this.hasFrozenRows&&c&&(d-=this._options.frozenBottom?B.height(this._canvasTopL):this.frozenRowsHeight);const D=this.getCellFromPoint(E.left,Math.ceil(E.top)-d);this.activeRow=D.row,this.activeCell=this.activePosX=this.activeCell=this.activePosX=this.getCellFromNode(this.activeCellNode),!$u(e)&&this._options.autoEditNewRow&&(e=this.activeRow===this.getDataLength()||this._options.autoEdit),this._options.showCellSelection&&(this.activeCellNode.classList.add("active"),(l=(s=this.rowsCache[this.activeRow])==null?void 0:s.rowNode)==null||l.forEach(m=>m.classList.add("active"))),this._options.editable&&e&&this.isCellPotentiallyEditable(this.activeRow,this.activeCell)&&(this._options.asyncEditorLoading?(clearTimeout(this.h_editorLoader),this.h_editorLoader=setTimeout(()=>{this.makeActiveCellEditable(void 0,a,t)},this._options.asyncEditorLoadDelay)):this.makeActiveCellEditable(void 0,a,t))}else this.activeRow=this.activeCell=null;i||this.triggerEvent(this.onActiveCellChanged,this.getActiveCell())}clearTextSelection(){var u;if((u=document.selection)!=null&&u.empty)try{document.selection.empty()}catch{}else if(window.getSelection){const e=window.getSelection();e!=null&&e.removeAllRanges&&e.removeAllRanges()}}isCellPotentiallyEditable(u,e){const a=this.getDataLength();return!(u=a||!this.columns[e]||this.columns[e].hidden||!this.getEditor(u,e))}makeActiveCellNormal(u=!1){var e;if(this.currentEditor){if(this.triggerEvent(this.onBeforeCellEditorDestroy,{editor:this.currentEditor}),this.currentEditor.destroy(),this.currentEditor=null,this.activeCellNode){const a=this.getDataItem(this.activeRow);if(this.activeCellNode.classList.remove("editable"),this.activeCellNode.classList.remove("invalid"),a){const i=this.columns[this.activeCell],r=this.getFormatter(this.activeRow,i)(this.activeRow,this.activeCell,this.getDataItemValueForColumn(a,i),i,a,this);this.applyFormatResultToCellNode(r,this.activeCellNode),this.invalidatePostProcessingResults(this.activeRow)}u&&this.setFocus()}navigator.userAgent.toLowerCase().match(/msie/)&&this.clearTextSelection(),(e=this.getEditorLock())==null||e.deactivate(this.editController)}}editActiveCell(u,e,a){this.makeActiveCellEditable(u,e,a)}makeActiveCellEditable(u,e,a){var o,s,l,E,d,c;if(!this.activeCellNode)return;if(!this._options.editable)throw new Error("SlickGrid makeActiveCellEditable : should never get called when grid options.editable is false");if(clearTimeout(this.h_editorLoader),!this.isCellPotentiallyEditable(this.activeRow,this.activeCell))return;const i=this.columns[this.activeCell],t=this.getDataItem(this.activeRow);if(this.triggerEvent(this.onBeforeEditCell,{row:this.activeRow,cell:this.activeCell,item:t,column:i,target:"grid"}).getReturnValue()===!1){this.setFocus();return}(o=this.getEditorLock())==null||o.activate(this.editController),this.activeCellNode.classList.add("editable");const r=u||this.getEditor(this.activeRow,this.activeCell);if(typeof r=="function"){!u&&!r.suppressClearOnEdit&&bu(this.activeCellNode);let D=(l=(s=this.data)==null?void 0:s.getItemMetadata)==null?void 0:l.call(s,this.activeRow);D=D==null?void 0:D.columns;const m=D&&(D[i.id]||D[this.activeCell]),h={grid:this,gridPosition:this.absBox(this._container),position:this.absBox(this.activeCellNode),container:this.activeCellNode,column:i,columnMetaData:m,item:t||{},event:a,commitChanges:this.commitEditAndSetFocus.bind(this),cancelChanges:this.cancelEditAndSetFocus.bind(this)};this.currentEditor=new r(h),t&&this.currentEditor&&(this.currentEditor.loadValue(t),e&&typeof((E=this.currentEditor)==null?void 0:E.preClick)=="function"&&this.currentEditor.preClick()),this.serializedEditorValue=(d=this.currentEditor)==null?void 0:d.serializeValue(),(c=this.currentEditor)!=null&&c.position&&this.handleActiveCellPositionChange()}}commitEditAndSetFocus(){var u;(u=this.getEditorLock())!=null&&u.commitCurrentEdit()&&(this.setFocus(),this._options.autoEdit&&!this._options.autoCommitEdit&&this.navigateDown())}cancelEditAndSetFocus(){var u;(u=this.getEditorLock())!=null&&u.cancelCurrentEdit()&&this.setFocus()}absBox(u){const e={top:u.offsetTop,left:u.offsetLeft,bottom:0,right:0,width:u.offsetWidth,height:u.offsetWidth,visible:!0};e.bottom=e.top+e.height,e.right=e.left+e.width;let a=u.offsetParent;for(;(u=u.parentNode)!==document.body&&!(!u||!u.parentNode);){const i=getComputedStyle(u);e.visible&&u.scrollHeight!==u.offsetHeight&&i.overflowY!=="visible"&&(e.visible=e.bottom>u.scrollTop&&e.topu.scrollLeft&&e.left0&&(u=e.getRangeAt(0))}return u}setTextSelection(u){if(window.getSelection&&u){const e=window.getSelection();e&&(e.removeAllRanges(),e.addRange(u))}}scrollRowIntoView(u,e){var a;if(!this.hasFrozenRows||!this._options.frozenBottom&&u>this.actualFrozenRow-1||this._options.frozenBottom&&uthis.scrollTop+i+this.offset?(this.scrollTo(e?r:o),this.render()):t*this._options.rowHeight=t&&(i=t-1),i<0&&(i=0);let r=0,o=null;const s=this.activePosX;for(;r<=this.activePosX;)this.canCellBeActive(i,r)&&(o=r),r+=this.getColspan(i,r);o!==null?(this.setActiveCellInternal(this.getCellNode(i,o)),this.activePosX=s):this.resetActiveCell()}}navigatePageDown(){this.scrollPage(1)}navigatePageUp(){this.scrollPage(-1)}navigateTop(){this.navigateToRow(0)}navigateBottom(){return this.navigateToRow(this.getDataLength()-1)}navigateToRow(u){const e=this.getDataLength();if(!e)return!0;if(u<0?u=0:u>=e&&(u=e-1),this.scrollCellIntoView(u,0,!0),this._options.enableCellNavigation&&$u(this.activeRow)){let a=0,i=null;const t=this.activePosX;for(;a<=this.activePosX;)this.canCellBeActive(u,a)&&(i=a),a+=this.getColspan(u,a);i!==null?(this.setActiveCellInternal(this.getCellNode(u,i)),this.activePosX=t):this.resetActiveCell()}return!0}getColspan(u,e){var r,o;const a=(o=(r=this.data)==null?void 0:r.getItemMetadata)==null?void 0:o.call(r,u);if(!a||!a.columns)return 1;const i=a.columns[this.columns[e].id]||a.columns[e];let t=i==null?void 0:i.colspan;return t==="*"?t=this.columns.length-e:t=t||1,t}findFirstFocusableCell(u){let e=0;for(;e=this.columns.length)return null;do e+=this.getColspan(u,e);while(e=e)return null;let t={row:u,cell:i,posX:i},r,o=!0;for(;o;){if(r=this.gotoRight(t.row,t.cell,t.posX),!r)return o=!1,null;if(r.cell>=e)return o=!1,t;t=r}}gotoDown(u,e,a){let i;const t=this.getDataLengthIncludingAddNew();let r=!0;for(;r;){if(++u>=t)return r=!1,null;for(i=e=0;e<=a;)i=e,e+=this.getColspan(u,e);if(this.canCellBeActive(u,i))return r=!1,{row:u,cell:i,posX:a}}}gotoUp(u,e,a){let i,t=!0;for(;t;){if(--u<0)return t=!1,null;for(i=e=0;e<=a;)i=e,e+=this.getColspan(u,e);if(this.canCellBeActive(u,i))return t=!1,{row:u,cell:i,posX:a}}}gotoNext(u,e,a){if(!ia(u)&&!ia(e)&&(u=e=a=0,this.canCellBeActive(u,e)))return{row:u,cell:e,posX:e};const i=this.gotoRight(u,e,a);if(i)return i;let t=null;const r=this.getDataLengthIncludingAddNew();for(u===r-1&&u--;++u=this.actualFrozenRow||this._options.frozenBottom&&t.rowe?this.rowsCache[u].cellNodesByColumnIdx[e]:null}catch{return this.rowsCache[u].cellNodesByColumnIdx[e]}}return null}setActiveCell(u,e,a,i,t){!this.initialized||!this._options.enableCellNavigation||u>this.getDataLength()||u<0||e>=this.columns.length||e<0||(this.scrollCellIntoView(u,e,!1),this.setActiveCellInternal(this.getCellNode(u,e),a,i,t))}setActiveRow(u,e,a){e??(e=0),!(!this.initialized||u>this.getDataLength()||u<0||e>=this.columns.length||e<0)&&(this.activeRow=u,a||this.scrollCellIntoView(u,e,!1))}canCellBeActive(u,e){var t,r,o,s;if(!this._options.enableCellNavigation||u>=this.getDataLengthIncludingAddNew()||u<0||e>=this.columns.length||e<0||!this.columns[e]||this.columns[e].hidden)return!1;const a=(r=(t=this.data)==null?void 0:t.getItemMetadata)==null?void 0:r.call(t,u);if((a==null?void 0:a.focusable)!==void 0)return!!a.focusable;const i=a==null?void 0:a.columns;return((o=i==null?void 0:i[this.columns[e].id])==null?void 0:o.focusable)!==void 0?!!i[this.columns[e].id].focusable:((s=i==null?void 0:i[e])==null?void 0:s.focusable)!==void 0?!!i[e].focusable:!!this.columns[e].focusable}canCellBeSelected(u,e){var t,r;if(u>=this.getDataLength()||u<0||e>=this.columns.length||e<0||!this.columns[e]||this.columns[e].hidden)return!1;const a=(r=(t=this.data)==null?void 0:t.getItemMetadata)==null?void 0:r.call(t,u);if((a==null?void 0:a.selectable)!==void 0)return!!a.selectable;const i=(a==null?void 0:a.columns)&&(a.columns[this.columns[e].id]||a.columns[e]);return(i==null?void 0:i.selectable)!==void 0?!!i.selectable:!!this.columns[e].selectable}gotoCell(u,e,a,i){var s;if(!this.initialized||!this.canCellBeActive(u,e)||!((s=this.getEditorLock())!=null&&s.commitCurrentEdit()))return;this.scrollCellIntoView(u,e,!1);const t=this.getCellNode(u,e),r=this.columns[e],o=!!(this._options.editable&&(r!=null&&r.editorClass)&&this._options.suppressActiveCellChangeOnEdit);this.setActiveCellInternal(t,a||u===this.getDataLength()||this._options.autoEdit,null,o,i),this.currentEditor||this.setFocus()}commitCurrentEdit(){var i;const u=this,e=u.getDataItem(u.activeRow),a=u.columns[u.activeCell];if(u.currentEditor){if(u.currentEditor.isValueChanged()){const t=u.currentEditor.validate();if(t.valid){const r=u.activeRow,o=u.activeCell,s=u.currentEditor,l=u.currentEditor.serializeValue(),E=u.serializedEditorValue;if(u.activeRow{s.applyValue(e,l),u.updateRow(r),u.triggerEvent(u.onCellChange,{command:"execute",row:r,cell:o,item:e,column:a})},undo:()=>{s.applyValue(e,E),u.updateRow(r),u.triggerEvent(u.onCellChange,{command:"undo",row:r,cell:o,item:e,column:a})}};u._options.editCommandHandler?(u.makeActiveCellNormal(!0),u._options.editCommandHandler(e,a,d)):(d.execute(),u.makeActiveCellNormal(!0))}else{const d={};u.currentEditor.applyValue(d,u.currentEditor.serializeValue()),u.makeActiveCellNormal(!0),u.triggerEvent(u.onAddNewRow,{item:d,column:a})}return!((i=u.getEditorLock())!=null&&i.isActive())}else return u.activeCellNode&&(u.activeCellNode.classList.remove("invalid"),B.width(u.activeCellNode),u.activeCellNode.classList.add("invalid")),u.triggerEvent(u.onValidationError,{editor:u.currentEditor,cellNode:u.activeCellNode,validationResults:t,row:u.activeRow,cell:u.activeCell,column:a}),u.currentEditor.focus(),!1}u.makeActiveCellNormal(!0)}return!0}cancelCurrentEdit(){return this.makeActiveCellNormal(),!0}rowsToRanges(u){const e=[],a=this.columns.length-1;for(let i=0;i((r=this._addonOptions)==null?void 0:r.maxToolTipLength)&&(s=s.substring(0,this._addonOptions.maxToolTipLength-3)+"...")):s="",o.title=s),o=null}}handleHeaderMouseEnter(u,e){const a=e.column;let i;const t=u.target;if(t&&(i=t.closest(".slick-header-column"),i&&!(a!=null&&a.toolTip))){const r=t.clientWidth{this._addonOptions&&typeof this._addonOptions.onCopyCells=="function"&&this._addonOptions.onCopyCells(a,i)}),this._eventHandler.subscribe(this._cellExternalCopyManagerPlugin.onCopyCancelled,(a,i)=>{this._addonOptions&&typeof this._addonOptions.onCopyCancelled=="function"&&this._addonOptions.onCopyCancelled(a,i)}),this._eventHandler.subscribe(this._cellExternalCopyManagerPlugin.onPasteCells,(a,i)=>{this._addonOptions&&typeof this._addonOptions.onPasteCells=="function"&&this._addonOptions.onPasteCells(a,i)})}dispose(){var u,e;this._eventHandler.unsubscribeAll(),this._bindingEventService.unbindAll(),(u=this._cellSelectionModel)==null||u.dispose(),(e=this._cellExternalCopyManagerPlugin)==null||e.dispose()}createUndoRedoBuffer(){let u=0;this._commandQueue=[],this._undoRedoBuffer={queueAndExecuteCommand:e=>{this._commandQueue[u]=e,u++,e.execute()},undo:()=>{if(u===0)return;u--;const e=this._commandQueue[u];e&&Z0.cancelCurrentEdit()&&e.undo()},redo:()=>{if(u>=this._commandQueue.length)return;const e=this._commandQueue[u];u++,e&&Z0.cancelCurrentEdit()&&e.execute()}}}getDefaultOptions(){let u=0;return{clipboardCommandHandler:e=>{this._undoRedoBuffer.queueAndExecuteCommand.call(this._undoRedoBuffer,e)},dataItemColumnValueExtractor:(e,a,i=0,t=0)=>{var s,l;const r=this._grid.getActiveCell(),o=this._grid.getCellEditor()&&(r==null?void 0:r.row)===i&&(r==null?void 0:r.cell)===t;if(!this.gridOptions.editable||!a.editor||!o){const E=a.exportWithFormatter!==void 0?a.exportWithFormatter:(s=this.gridOptions.textExportOptions)==null?void 0:s.exportWithFormatter;if(a.formatter&&E){const d=a.formatter(i,t,e[a.field],a,e,this._grid),c=ca(d)?d:d.html||d.text;if(a.sanitizeDataExport||(l=this.gridOptions.textExportOptions)!=null&&l.sanitizeDataExport){const D=c instanceof HTMLElement?c.innerHTML:c;return Wu(D??"")}return d}}return null},readOnlyMode:!1,includeHeaderWhenCopying:!1,newRowCreator:e=>{for(let a=0;a{};class ch{constructor(){this.pluginName="CellExternalCopyManager",this.onCopyCells=new N("onCopyCells"),this.onCopyCancelled=new N("onCopyCancelled"),this.onPasteCells=new N("onPasteCells"),this.onBeforePasteCell=new N("onBeforePasteCell"),this._bodyElement=document.body,this._copiedCellStyle="copied",this._copiedCellStyleLayerKey="copy-manager",this._copiedRanges=null,this._eventHandler=new Tu}get addonOptions(){return this._addonOptions}get eventHandler(){return this._eventHandler}init(u,e){var t;this._grid=u,this._addonOptions={...this._addonOptions,...e},this._copiedCellStyleLayerKey=this._addonOptions.copiedCellStyleLayerKey||"copy-manager",this._copiedCellStyle=this._addonOptions.copiedCellStyle||"copied",this._bodyElement=this._addonOptions.bodyElement||document.body,this._onCopyInit=this._addonOptions.onCopyInit||void 0,this._onCopySuccess=this._addonOptions.onCopySuccess||void 0;const a=u.getPubSubService();a&&B.addSlickEventPubSubWhenDefined(a,this),this._eventHandler.subscribe(this._grid.onKeyDown,this.handleKeyDown.bind(this));const i=u.getSelectionModel();if(!i)throw new Error("Selection model is mandatory for this plugin. Please set a selection model on the grid before adding this plugin: grid.setSelectionModel(new SlickCellSelectionModel())");if(this._eventHandler.subscribe(i.onSelectedRangesChanged,()=>{this._grid.getEditorLock().isActive()||this._grid.focus()}),u&&typeof((t=this._addonOptions)==null?void 0:t.onBeforePasteCell)=="function"){const r=u==null?void 0:u.getData();this._eventHandler.subscribe(this.onBeforePasteCell,(o,s)=>{var d,c;const l=u.getColumns()[s.cell],E={row:s.row,cell:s.cell,dataView:r,grid:u,columnDef:l,dataContext:u.getDataItem(s.row)};return(c=(d=this._addonOptions).onBeforePasteCell)==null?void 0:c.call(d,o,E)})}}dispose(){this._eventHandler.unsubscribeAll()}clearCopySelection(){this._grid.removeCellCssStyles(this._copiedCellStyleLayerKey)}getHeaderValueForColumn(u){if(typeof this._addonOptions.headerColumnValueExtractor=="function"){const e=E0(this._addonOptions.headerColumnValueExtractor(u),"innerHTML");if(e)return Wu(e)}return E0(u.name||"","innerHTML")}getDataItemValueForColumn(u,e,a,i,t){if(typeof this._addonOptions.dataItemColumnValueExtractor=="function"){const o=this._addonOptions.dataItemColumnValueExtractor(u,e,a,i);if(o)return o instanceof HTMLElement?Wu(o.innerHTML):o}let r="";if(e)if(e.editorClass){const o=document.createElement("p"),s=new e.editorClass({container:o,column:e,event:t,position:{top:0,left:0},gridPosition:{top:0,left:0},grid:this._grid,cancelChanges:Ni,commitChanges:Ni});s.loadValue(u),r=s.serializeValue(),s.destroy(),o.remove()}else r=u[e.field||""];return r}setDataItemValueForColumn(u,e,a){if(!(e!=null&&e.denyPaste)){if(this._addonOptions.dataItemColumnValueSetter)return this._addonOptions.dataItemColumnValueSetter(u,e,a);if(e.editorClass){const i=document.createElement("div"),t=new e.editorClass({container:i,column:e,event:null,position:{top:0,left:0},gridPosition:{top:0,left:0},grid:this._grid,cancelChanges:Ni,commitChanges:Ni});t.loadValue(u);const r=t.validate(void 0,a);if(!r.valid){const o=this._grid.getActiveCell();this._grid.onValidationError.notify({editor:t,cellNode:this._grid.getActiveCellNode(),validationResults:r,row:o==null?void 0:o.row,cell:o==null?void 0:o.cell,column:e,grid:this._grid})}t.applyValue(u,a),t.destroy(),i.remove()}else u[e.field]=a}}setIncludeHeaderWhenCopying(u){this._addonOptions.includeHeaderWhenCopying=u}createTextBox(u){const e=v("textarea",{value:u,style:{position:"absolute",left:"-1000px",top:`${document.body.scrollTop}px`}},this._bodyElement);return e.select(),e}decodeTabularData(u,e){var A;const a=u.getColumns(),t=e.value.split(/[\n\f\r]/);t[t.length-1]===""&&t.pop();let r=0;const o=[];this._bodyElement.removeChild(e);for(const b of t)o[r++]=b!==""?b.split(" "):[""];const s=this._grid.getActiveCell(),l=(A=this._grid.getSelectionModel())==null?void 0:A.getSelectedRanges(),E=l!=null&&l.length?l[0]:null;let d,c;if(E)d=E.fromRow,c=E.fromCell;else if(s)d=s.row,c=s.cell;else return;let D=!1,m=o.length,h=o.length?o[0].length:0;o.length===1&&o[0].length===1&&E&&(D=!0,m=E.toRow-E.fromRow+1,h=E.toCell-E.fromCell+1);const x=this._grid.getData().length-d;let g=0;if(xthis._grid.getDataLength()&&typeof this._addonOptions.newRowCreator=="function"){const b=d+m-this._grid.getDataLength();this._addonOptions.newRowCreator(b)}const C={isClipboardCommand:!0,clippedRange:o,oldValues:[],cellExternalCopyManager:this,_options:this._addonOptions,setDataItemValueForColumn:this.setDataItemValueForColumn,markCopySelection:this.markCopySelection,oneCellToMultiple:D,activeRow:d,activeCell:c,destH:m,destW:h,maxDestY:this._grid.getDataLength(),maxDestX:this._grid.getColumns().length,h:0,w:0,execute:()=>{var y;C.h=0;for(let S=0;S{var y;for(let S=0;S1){const S=this._grid.getData();for(;g>1;g--)S.splice(S.length-1,1);this._grid.setData(S),this._grid.render()}}};this._addonOptions.clipboardCommandHandler?this._addonOptions.clipboardCommandHandler(C):C.execute()}handleKeyDown(u){var a,i,t;let e;if(!this._grid.getEditorLock().isActive()||this._grid.getOptions().autoEdit){if(u.key==="Escape"&&this._copiedRanges&&(u.preventDefault(),this.clearCopySelection(),this.onCopyCancelled.notify({ranges:this._copiedRanges}),typeof this._addonOptions.onCopyCancelled=="function"&&this._addonOptions.onCopyCancelled(u,{ranges:this._copiedRanges}),this._copiedRanges=null),(u.key==="c"||u.key==="Insert")&&(u.ctrlKey||u.metaKey)&&!u.shiftKey&&(typeof this._onCopyInit=="function"&&this._onCopyInit.call(this),e=((a=this._grid.getSelectionModel())==null?void 0:a.getSelectedRanges())??[],e.length!==0)){this._copiedRanges=e,this.markCopySelection(e),this.onCopyCells.notify({ranges:e}),typeof this._addonOptions.onCopyCells=="function"&&this._addonOptions.onCopyCells(u,{ranges:e});const r=this._grid.getColumns();let o="";for(let s=0;s0&&!r[h].hidden&&m.push(this.getHeaderValueForColumn(r[h]));E.push(m.join(" "))}for(let m=l.fromCell;m0&&!r[m].hidden&&c.push(this.getDataItemValueForColumn(D,r[m],d,m,u));E.push(c.join(" "))}o+=E.join(`\r
+ */function Cs(n,u){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);u&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),e.push.apply(e,a)}return e}function De(n){for(var u=1;u=0)&&(e[i]=n[i]);return e}function Hm(n,u){if(n==null)return{};var e=Km(n,u),a,i;if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(n,a)&&(e[a]=n[a])}return e}var Om="1.15.2";function ye(n){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(n)}var Te=ye(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),yi=ye(/Edge/i),ps=ye(/firefox/i),li=ye(/safari/i)&&!ye(/chrome/i)&&!ye(/android/i),w1=ye(/iP(ad|od|hone)/i),M1=ye(/chrome/i)&&ye(/android/i),T1={capture:!1,passive:!1};function Su(n,u,e){n.addEventListener(u,e,!Te&&T1)}function yu(n,u,e){n.removeEventListener(u,e,!Te&&T1)}function yt(n,u){if(u){if(u[0]===">"&&(u=u.substring(1)),n)try{if(n.matches)return n.matches(u);if(n.msMatchesSelector)return n.msMatchesSelector(u);if(n.webkitMatchesSelector)return n.webkitMatchesSelector(u)}catch{return!1}return!1}}function Im(n){return n.host&&n!==document&&n.host.nodeType?n.host:n.parentNode}function ie(n,u,e,a){if(n){e=e||document;do{if(u!=null&&(u[0]===">"?n.parentNode===e&&yt(n,u):yt(n,u))||a&&n===e)return n;if(n===e)break}while(n=Im(n))}return null}var Fs=/\s+/g;function O0(n,u,e){if(n&&u)if(n.classList)n.classList[e?"add":"remove"](u);else{var a=(" "+n.className+" ").replace(Fs," ").replace(" "+u+" "," ");n.className=(a+(e?" "+u:"")).replace(Fs," ")}}function nu(n,u,e){var a=n&&n.style;if(a){if(e===void 0)return document.defaultView&&document.defaultView.getComputedStyle?e=document.defaultView.getComputedStyle(n,""):n.currentStyle&&(e=n.currentStyle),u===void 0?e:e[u];!(u in a)&&u.indexOf("webkit")===-1&&(u="-webkit-"+u),a[u]=e+(typeof e=="string"?"":"px")}}function _a(n,u){var e="";if(typeof n=="string")e=n;else do{var a=nu(n,"transform");a&&a!=="none"&&(e=a+" "+e)}while(!u&&(n=n.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(e)}function _1(n,u,e){if(n){var a=n.getElementsByTagName(u),i=0,t=a.length;if(e)for(;i=t:r=i<=t,!r)return a;if(a===Ee())break;a=$e(a,!1)}return!1}function Ka(n,u,e,a){for(var i=0,t=0,r=n.children;t2&&arguments[2]!==void 0?arguments[2]:{},i=a.evt,t=Hm(a,Zm);zi.pluginEvent.bind(uu)(u,e,De({dragEl:H,parentEl:a0,ghostEl:cu,rootEl:Zu,nextEl:na,lastDownEl:ot,cloneEl:u0,cloneHidden:Oe,dragStarted:ri,putSortable:p0,activeSortable:uu.active,originalEvent:i,oldIndex:Sa,oldDraggableIndex:di,newIndex:I0,newDraggableIndex:He,hideGhostForTarget:O1,unhideGhostForTarget:I1,cloneNowHidden:function(){Oe=!0},cloneNowShown:function(){Oe=!1},dispatchSortableEvent:function(o){S0({sortable:e,name:o,originalEvent:i})}},t))};function S0(n){qm(De({putSortable:p0,cloneEl:u0,targetEl:H,rootEl:Zu,oldIndex:Sa,oldDraggableIndex:di,newIndex:I0,newDraggableIndex:He},n))}var H,a0,cu,Zu,na,ot,u0,Oe,Sa,I0,di,He,ji,p0,ba=!1,zt=!1,St=[],Xe,ee,pn,Fn,As,bs,ri,va,ci,Di=!1,Li=!1,st,b0,kn=[],tr=!1,wt=[],Zt=typeof document<"u",Ni=w1,fs=yi||Te?"cssFloat":"float",Ym=Zt&&!M1&&!w1&&"draggable"in document.createElement("div"),R1=function(){if(Zt){if(Te)return!1;var n=document.createElement("x");return n.style.cssText="pointer-events:auto",n.style.pointerEvents==="auto"}}(),K1=function(u,e){var a=nu(u),i=parseInt(a.width)-parseInt(a.paddingLeft)-parseInt(a.paddingRight)-parseInt(a.borderLeftWidth)-parseInt(a.borderRightWidth),t=Ka(u,0,e),r=Ka(u,1,e),o=t&&nu(t),s=r&&nu(r),l=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+s0(t).width,E=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+s0(r).width;if(a.display==="flex")return a.flexDirection==="column"||a.flexDirection==="column-reverse"?"vertical":"horizontal";if(a.display==="grid")return a.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(t&&o.float&&o.float!=="none"){var d=o.float==="left"?"left":"right";return r&&(s.clear==="both"||s.clear===d)?"vertical":"horizontal"}return t&&(o.display==="block"||o.display==="flex"||o.display==="table"||o.display==="grid"||l>=i&&a[fs]==="none"||r&&a[fs]==="none"&&l+E>i)?"vertical":"horizontal"},Qm=function(u,e,a){var i=a?u.left:u.top,t=a?u.right:u.bottom,r=a?u.width:u.height,o=a?e.left:e.top,s=a?e.right:e.bottom,l=a?e.width:e.height;return i===o||t===s||i+r/2===o+l/2},Xm=function(u,e){var a;return St.some(function(i){var t=i[V0].options.emptyInsertThreshold;if(!(!t||Wr(i))){var r=s0(i),o=u>=r.left-t&&u<=r.right+t,s=e>=r.top-t&&e<=r.bottom+t;if(o&&s)return a=i}}),a},H1=function(u){function e(t,r){return function(o,s,l,E){var d=o.options.group.name&&s.options.group.name&&o.options.group.name===s.options.group.name;if(t==null&&(r||d))return!0;if(t==null||t===!1)return!1;if(r&&t==="clone")return t;if(typeof t=="function")return e(t(o,s,l,E),r)(o,s,l,E);var c=(r?o:s).options.group.name;return t===!0||typeof t=="string"&&t===c||t.join&&t.indexOf(c)>-1}}var a={},i=u.group;(!i||rt(i)!="object")&&(i={name:i}),a.name=i.name,a.checkPull=e(i.pull,!0),a.checkPut=e(i.put),a.revertClone=i.revertClone,u.group=a},O1=function(){!R1&&cu&&nu(cu,"display","none")},I1=function(){!R1&&cu&&nu(cu,"display","")};Zt&&!M1&&document.addEventListener("click",function(n){if(zt)return n.preventDefault(),n.stopPropagation&&n.stopPropagation(),n.stopImmediatePropagation&&n.stopImmediatePropagation(),zt=!1,!1},!0);var ua=function(u){if(H){u=u.touches?u.touches[0]:u;var e=Xm(u.clientX,u.clientY);if(e){var a={};for(var i in u)u.hasOwnProperty(i)&&(a[i]=u[i]);a.target=a.rootEl=e,a.preventDefault=void 0,a.stopPropagation=void 0,e[V0]._onDragOver(a)}}},uh=function(u){H&&H.parentNode[V0]._isOutsideThisEl(u.target)};function uu(n,u){if(!(n&&n.nodeType&&n.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(n));this.el=n,this.options=u=we({},u),n[V0]=this;var e={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(n.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return K1(n,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(r,o){r.setData("Text",o.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:uu.supportPointer!==!1&&"PointerEvent"in window&&!li,emptyInsertThreshold:5};zi.initializePlugins(this,n,e);for(var a in e)!(a in u)&&(u[a]=e[a]);H1(u);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=u.forceFallback?!1:Ym,this.nativeDraggable&&(this.options.touchStartThreshold=1),u.supportPointer?Su(n,"pointerdown",this._onTapStart):(Su(n,"mousedown",this._onTapStart),Su(n,"touchstart",this._onTapStart)),this.nativeDraggable&&(Su(n,"dragover",this),Su(n,"dragenter",this)),St.push(this.el),u.store&&u.store.get&&this.sort(u.store.get(this)||[]),we(this,Jm())}uu.prototype={constructor:uu,_isOutsideThisEl:function(u){!this.el.contains(u)&&u!==this.el&&(va=null)},_getDirection:function(u,e){return typeof this.options.direction=="function"?this.options.direction.call(this,u,e,H):this.options.direction},_onTapStart:function(u){if(u.cancelable){var e=this,a=this.el,i=this.options,t=i.preventOnFilter,r=u.type,o=u.touches&&u.touches[0]||u.pointerType&&u.pointerType==="touch"&&u,s=(o||u).target,l=u.target.shadowRoot&&(u.path&&u.path[0]||u.composedPath&&u.composedPath()[0])||s,E=i.filter;if(sh(a),!H&&!(/mousedown|pointerdown/.test(r)&&u.button!==0||i.disabled)&&!l.isContentEditable&&!(!this.nativeDraggable&&li&&s&&s.tagName.toUpperCase()==="SELECT")&&(s=ie(s,i.draggable,a,!1),!(s&&s.animated)&&ot!==s)){if(Sa=q0(s),di=q0(s,i.draggable),typeof E=="function"){if(E.call(this,u,s,this)){S0({sortable:e,rootEl:l,name:"filter",targetEl:s,toEl:a,fromEl:a}),L0("filter",e,{evt:u}),t&&u.cancelable&&u.preventDefault();return}}else if(E&&(E=E.split(",").some(function(d){if(d=ie(l,d.trim(),a,!1),d)return S0({sortable:e,rootEl:d,name:"filter",targetEl:s,fromEl:a,toEl:a}),L0("filter",e,{evt:u}),!0}),E)){t&&u.cancelable&&u.preventDefault();return}i.handle&&!ie(l,i.handle,a,!1)||this._prepareDragStart(u,o,s)}}},_prepareDragStart:function(u,e,a){var i=this,t=i.el,r=i.options,o=t.ownerDocument,s;if(a&&!H&&a.parentNode===t){var l=s0(a);if(Zu=t,H=a,a0=H.parentNode,na=H.nextSibling,ot=a,ji=r.group,uu.dragged=H,Xe={target:H,clientX:(e||u).clientX,clientY:(e||u).clientY},As=Xe.clientX-l.left,bs=Xe.clientY-l.top,this._lastX=(e||u).clientX,this._lastY=(e||u).clientY,H.style["will-change"]="all",s=function(){if(L0("delayEnded",i,{evt:u}),uu.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!ps&&i.nativeDraggable&&(H.draggable=!0),i._triggerDragStart(u,e),S0({sortable:i,name:"choose",originalEvent:u}),O0(H,r.chosenClass,!0)},r.ignore.split(",").forEach(function(E){_1(H,E.trim(),vn)}),Su(o,"dragover",ua),Su(o,"mousemove",ua),Su(o,"touchmove",ua),Su(o,"mouseup",i._onDrop),Su(o,"touchend",i._onDrop),Su(o,"touchcancel",i._onDrop),ps&&this.nativeDraggable&&(this.options.touchStartThreshold=4,H.draggable=!0),L0("delayStart",this,{evt:u}),r.delay&&(!r.delayOnTouchOnly||e)&&(!this.nativeDraggable||!(yi||Te))){if(uu.eventCanceled){this._onDrop();return}Su(o,"mouseup",i._disableDelayedDrag),Su(o,"touchend",i._disableDelayedDrag),Su(o,"touchcancel",i._disableDelayedDrag),Su(o,"mousemove",i._delayedDragTouchMoveHandler),Su(o,"touchmove",i._delayedDragTouchMoveHandler),r.supportPointer&&Su(o,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(s,r.delay)}else s()}},_delayedDragTouchMoveHandler:function(u){var e=u.touches?u.touches[0]:u;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){H&&vn(H),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var u=this.el.ownerDocument;yu(u,"mouseup",this._disableDelayedDrag),yu(u,"touchend",this._disableDelayedDrag),yu(u,"touchcancel",this._disableDelayedDrag),yu(u,"mousemove",this._delayedDragTouchMoveHandler),yu(u,"touchmove",this._delayedDragTouchMoveHandler),yu(u,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(u,e){e=e||u.pointerType=="touch"&&u,!this.nativeDraggable||e?this.options.supportPointer?Su(document,"pointermove",this._onTouchMove):e?Su(document,"touchmove",this._onTouchMove):Su(document,"mousemove",this._onTouchMove):(Su(H,"dragend",this),Su(Zu,"dragstart",this._onDragStart));try{document.selection?lt(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(u,e){if(ba=!1,Zu&&H){L0("dragStarted",this,{evt:e}),this.nativeDraggable&&Su(document,"dragover",uh);var a=this.options;!u&&O0(H,a.dragClass,!1),O0(H,a.ghostClass,!0),uu.active=this,u&&this._appendGhost(),S0({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(ee){this._lastX=ee.clientX,this._lastY=ee.clientY,O1();for(var u=document.elementFromPoint(ee.clientX,ee.clientY),e=u;u&&u.shadowRoot&&(u=u.shadowRoot.elementFromPoint(ee.clientX,ee.clientY),u!==e);)e=u;if(H.parentNode[V0]._isOutsideThisEl(u),e)do{if(e[V0]){var a=void 0;if(a=e[V0]._onDragOver({clientX:ee.clientX,clientY:ee.clientY,target:u,rootEl:e}),a&&!this.options.dragoverBubble)break}u=e}while(e=e.parentNode);I1()}},_onTouchMove:function(u){if(Xe){var e=this.options,a=e.fallbackTolerance,i=e.fallbackOffset,t=u.touches?u.touches[0]:u,r=cu&&_a(cu,!0),o=cu&&r&&r.a,s=cu&&r&&r.d,l=Ni&&b0&&vs(b0),E=(t.clientX-Xe.clientX+i.x)/(o||1)+(l?l[0]-kn[0]:0)/(o||1),d=(t.clientY-Xe.clientY+i.y)/(s||1)+(l?l[1]-kn[1]:0)/(s||1);if(!uu.active&&!ba){if(a&&Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))=0&&(S0({rootEl:a0,name:"add",toEl:a0,fromEl:Zu,originalEvent:u}),S0({sortable:this,name:"remove",toEl:a0,originalEvent:u}),S0({rootEl:a0,name:"sort",toEl:a0,fromEl:Zu,originalEvent:u}),S0({sortable:this,name:"sort",toEl:a0,originalEvent:u})),p0&&p0.save()):I0!==Sa&&I0>=0&&(S0({sortable:this,name:"update",toEl:a0,originalEvent:u}),S0({sortable:this,name:"sort",toEl:a0,originalEvent:u})),uu.active&&((I0==null||I0===-1)&&(I0=Sa,He=di),S0({sortable:this,name:"end",toEl:a0,originalEvent:u}),this.save()))),this._nulling()},_nulling:function(){L0("nulling",this),Zu=H=a0=cu=na=u0=ot=Oe=Xe=ee=ri=I0=He=Sa=di=va=ci=p0=ji=uu.dragged=uu.ghost=uu.clone=uu.active=null,wt.forEach(function(u){u.checked=!0}),wt.length=pn=Fn=0},handleEvent:function(u){switch(u.type){case"drop":case"dragend":this._onDrop(u);break;case"dragenter":case"dragover":H&&(this._onDragOver(u),eh(u));break;case"selectstart":u.preventDefault();break}},toArray:function(){for(var u=[],e,a=this.el.children,i=0,t=a.length,r=this.options;ii.right+t||n.clientY>a.bottom&&n.clientX>a.left:n.clientY>i.bottom+t||n.clientX>a.right&&n.clientY>a.top}function nh(n,u,e,a,i,t,r,o){var s=a?n.clientY:n.clientX,l=a?e.height:e.width,E=a?e.top:e.left,d=a?e.bottom:e.right,c=!1;if(!r){if(o&&stE+l*t/2:sd-st)return-ci}else if(s>E+l*(1-i)/2&&sd-l*t/2)?s>E+l/2?1:-1:0}function rh(n){return q0(H){y.hide(a)}),this._options.showTopPanel||this._topPanelScrollers.forEach(a=>{y.hide(a)}),this._options.showHeaderRow||this._headerRowScroller.forEach(a=>{y.hide(a)}),this._viewportTopL=v("div",{className:"slick-viewport slick-viewport-top slick-viewport-left",tabIndex:0},this._paneTopL),this._viewportTopR=v("div",{className:"slick-viewport slick-viewport-top slick-viewport-right",tabIndex:0},this._paneTopR),this._viewportBottomL=v("div",{className:"slick-viewport slick-viewport-bottom slick-viewport-left",tabIndex:0},this._paneBottomL),this._viewportBottomR=v("div",{className:"slick-viewport slick-viewport-bottom slick-viewport-right",tabIndex:0},this._paneBottomR),this._viewport=[this._viewportTopL,this._viewportTopR,this._viewportBottomL,this._viewportBottomR],this._options.viewportClass&&this._viewport.forEach(a=>{a.classList.add(..._u(this._options.viewportClass))}),this._activeViewportNode=this._viewportTopL,this._canvasTopL=v("div",{className:"grid-canvas grid-canvas-top grid-canvas-left",tabIndex:0},this._viewportTopL),this._canvasTopR=v("div",{className:"grid-canvas grid-canvas-top grid-canvas-right",tabIndex:0},this._viewportTopR),this._canvasBottomL=v("div",{className:"grid-canvas grid-canvas-bottom grid-canvas-left",tabIndex:0},this._viewportBottomL),this._canvasBottomR=v("div",{className:"grid-canvas grid-canvas-bottom grid-canvas-right",tabIndex:0},this._viewportBottomR),this._canvas=[this._canvasTopL,this._canvasTopR,this._canvasBottomL,this._canvasBottomR],this.scrollbarDimensions=this.scrollbarDimensions||this.measureScrollbar(),this._activeCanvasNode=this._canvasTopL,this._preHeaderPanelSpacer&&y.width(this._preHeaderPanelSpacer,this.getCanvasWidth()+this.scrollbarDimensions.width),this._headers.forEach(a=>{y.width(a,this.getHeadersWidth())}),y.width(this._headerRowSpacerL,this.getCanvasWidth()+this.scrollbarDimensions.width),y.width(this._headerRowSpacerR,this.getCanvasWidth()+this.scrollbarDimensions.width),this._options.createFooterRow&&(this._footerRowScrollerR=v("div",{className:"slick-footerrow slick-state-default"},this._paneTopR),this._footerRowScrollerL=v("div",{className:"slick-footerrow slick-state-default"},this._paneTopL),this._footerRowScroller=[this._footerRowScrollerL,this._footerRowScrollerR],this._footerRowSpacerL=v("div",{style:{display:"block",height:"1px",position:"absolute",top:"0px",left:"0px"}},this._footerRowScrollerL),y.width(this._footerRowSpacerL,this.getCanvasWidth()+this.scrollbarDimensions.width),this._footerRowSpacerR=v("div",{style:{display:"block",height:"1px",position:"absolute",top:"0px",left:"0px"}},this._footerRowScrollerR),y.width(this._footerRowSpacerR,this.getCanvasWidth()+this.scrollbarDimensions.width),this._footerRowL=v("div",{className:"slick-footerrow-columns slick-footerrow-columns-left"},this._footerRowScrollerL),this._footerRowR=v("div",{className:"slick-footerrow-columns slick-footerrow-columns-right"},this._footerRowScrollerR),this._footerRow=[this._footerRowL,this._footerRowR],this._options.showFooterRow||this._footerRowScroller.forEach(a=>{y.hide(a)})),this._focusSink2=this._focusSink.cloneNode(!0),this._container.appendChild(this._focusSink2),this._options.explicitInitialization||this.finishInitialization()}finishInitialization(){this.initialized||(this.initialized=!0,this.getViewportWidth(),this.getViewportHeight(),this.measureCellPaddingAndBorder(),this.disableSelection(this._headers),this._options.enableTextSelectionOnCells||this._viewport.forEach(u=>{this._bindingEventService.bind(u,"selectstart",e=>{e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement})}),this.setFrozenOptions(),this.setPaneVisibility(),this.setScroller(),this.setOverflow(),this.updateColumnCaches(),this.createColumnHeaders(),this.createColumnFooter(),this.setupColumnSort(),this.createCssRules(),this.resizeCanvas(),this.bindAncestorScrollEvents(),this._bindingEventService.bind(this._container,"resize",this.resizeCanvas.bind(this)),this._viewport.forEach(u=>{this._bindingEventService.bind(u,"scroll",this.handleScroll.bind(this))}),this._options.enableMouseWheelScrollHandler&&this._viewport.forEach(u=>{this.slickMouseWheelInstances.push(zs({element:u,onMouseWheel:this.handleMouseWheel.bind(this)}))}),this._headerScroller.forEach(u=>{this._bindingEventService.bind(u,"contextmenu",this.handleHeaderContextMenu.bind(this)),this._bindingEventService.bind(u,"click",this.handleHeaderClick.bind(this))}),this._headerRowScroller.forEach(u=>{this._bindingEventService.bind(u,"scroll",this.handleHeaderRowScroll.bind(this))}),this._options.createFooterRow&&(this._footerRow.forEach(u=>{this._bindingEventService.bind(u,"contextmenu",this.handleFooterContextMenu.bind(this)),this._bindingEventService.bind(u,"click",this.handleFooterClick.bind(this))}),this._footerRowScroller.forEach(u=>{this._bindingEventService.bind(u,"scroll",this.handleFooterRowScroll.bind(this))})),this._options.createPreHeaderPanel&&this._bindingEventService.bind(this._preHeaderPanelScroller,"scroll",this.handlePreHeaderPanelScroll.bind(this)),this._bindingEventService.bind(this._focusSink,"keydown",this.handleKeyDown.bind(this)),this._bindingEventService.bind(this._focusSink2,"keydown",this.handleKeyDown.bind(this)),this._canvas.forEach(u=>{this._bindingEventService.bind(u,"keydown",this.handleKeyDown.bind(this)),this._bindingEventService.bind(u,"click",this.handleClick.bind(this)),this._bindingEventService.bind(u,"dblclick",this.handleDblClick.bind(this)),this._bindingEventService.bind(u,"contextmenu",this.handleContextMenu.bind(this)),this._bindingEventService.bind(u,"mouseover",this.handleCellMouseOver.bind(this)),this._bindingEventService.bind(u,"mouseout",this.handleCellMouseOut.bind(this))}),ys&&(this.slickDraggableInstance=ys({containerElement:this._container,allowDragFrom:"div.slick-cell",allowDragFromClosest:"div.slick-cell.dnd, div.slick-cell.cell-reorder",onDragInit:this.handleDragInit.bind(this),onDragStart:this.handleDragStart.bind(this),onDrag:this.handleDrag.bind(this),onDragEnd:this.handleDragEnd.bind(this)})),this._options.suppressCssChangesOnHiddenInit||this.restoreCssFromHiddenInit())}cacheCssForHiddenInit(){this._hiddenParents=y.parents(this._container,":hidden"),this._hiddenParents.forEach(u=>{const e={};Object.keys(this.cssShow).forEach(a=>{this.cssShow&&(e[a]=u.style[a],u.style[a]=this.cssShow[a])}),this.oldProps.push(e)})}restoreCssFromHiddenInit(){let u=0;this._hiddenParents&&this._hiddenParents.forEach(e=>{const a=this.oldProps[u++];Object.keys(this.cssShow).forEach(i=>{this.cssShow&&(e.style[i]=a[i])})})}hasFrozenColumns(){return this._options.frozenColumn>-1}registerPlugin(u){this.plugins.unshift(u),u.init(this)}unregisterPlugin(u){var e;for(let a=this.plugins.length;a>=0;a--)if(this.plugins[a]===u){(e=this.plugins[a])==null||e.destroy(),this.plugins.splice(a,1);break}}getPluginByName(u){var e;for(let a=this.plugins.length-1;a>=0;a--)if(((e=this.plugins[a])==null?void 0:e.pluginName)===u)return this.plugins[a]}getPubSubService(){return this._pubSubService}setSelectionModel(u){this.selectionModel&&(this.selectionModel.onSelectedRangesChanged.unsubscribe(this.handleSelectedRangesChanged.bind(this)),this.selectionModel.destroy&&this.selectionModel.destroy()),this.selectionModel=u,this.selectionModel&&(this.selectionModel.init(this),this.selectionModel.onSelectedRangesChanged.subscribe(this.handleSelectedRangesChanged.bind(this)))}getSelectionModel(){return this.selectionModel}getCanvasNode(u,e){return this._getContainerElement(this.getCanvases(),u,e)}getActiveCanvasNode(u){var e;return u===void 0?this._activeCanvasNode:(u instanceof Pu&&(u=u.getNativeEvent()),this._activeCanvasNode=(e=u==null?void 0:u.target)==null?void 0:e.closest(".grid-canvas"),this._activeCanvasNode)}getCanvases(){return this._canvas}getViewportNode(u,e){return this._getContainerElement(this.getViewports(),u,e)}getViewports(){return this._viewport}getActiveViewportNode(u){return this.setActiveViewportNode(u),this._activeViewportNode}setActiveViewportNode(u){var e;return u instanceof Pu&&(u=u.getNativeEvent()),this._activeViewportNode=(e=u==null?void 0:u.target)==null?void 0:e.closest(".slick-viewport"),this._activeViewportNode}_getContainerElement(u,e,a){if(!u)return;e||(e=0),a||(a=0);const i=typeof e=="number"?e:this.getColumnIndex(e),t=this.hasFrozenRows&&a>=this.actualFrozenRow+(this._options.frozenBottom?0:1),r=this.hasFrozenColumns()&&i>this._options.frozenColumn;return u[(t?2:0)+(r?1:0)]}measureScrollbar(){let u="";this._viewport.forEach(t=>u+=t.className);const e=v("div",{className:u,style:{position:"absolute",top:"-10000px",left:"-10000px",overflow:"auto",width:"100px",height:"100px"}},document.body),a=v("div",{style:{width:"200px",height:"200px",overflow:"auto"}},e),i={width:e.offsetWidth-e.clientWidth,height:e.offsetHeight-e.clientHeight};return a.remove(),e.remove(),i}getHeadersWidth(){var i,t,r,o;this.headersWidth=this.headersWidthL=this.headersWidthR=0;const u=!this._options.autoHeight;let e=0;const a=this.columns.length;for(e=0;e-1&&e>this._options.frozenColumn?this.headersWidthR+=s||0:this.headersWidthL+=s||0}return u&&(this._options.frozenColumn>-1&&e>this._options.frozenColumn?this.headersWidthR+=((i=this.scrollbarDimensions)==null?void 0:i.width)||0:this.headersWidthL+=((t=this.scrollbarDimensions)==null?void 0:t.width)||0),this.hasFrozenColumns()?(this.headersWidthL=this.headersWidthL+1e3,this.headersWidthR=Math.max(this.headersWidthR,this.viewportW)+this.headersWidthL,this.headersWidthR+=((r=this.scrollbarDimensions)==null?void 0:r.width)||0):(this.headersWidthL+=((o=this.scrollbarDimensions)==null?void 0:o.width)||0,this.headersWidthL=Math.max(this.headersWidthL,this.viewportW)+1e3),this.headersWidth=this.headersWidthL+this.headersWidthR,Math.max(this.headersWidth,this.viewportW)+1e3}getCanvasWidth(){var i;const u=this.viewportHasVScroll?this.viewportW-(((i=this.scrollbarDimensions)==null?void 0:i.width)||0):this.viewportW;let e=this.columns.length;for(this.canvasWidthL=this.canvasWidthR=0;e--;)!this.columns[e]||this.columns[e].hidden||(this.hasFrozenColumns()&&e>this._options.frozenColumn?this.canvasWidthR+=this.columns[e].width||0:this.canvasWidthL+=this.columns[e].width||0);let a=this.canvasWidthL+this.canvasWidthR;if(this._options.fullWidthRows){const t=Math.max(a,u)-a;t>0&&(a+=t,this.hasFrozenColumns()?this.canvasWidthR+=t:this.canvasWidthL+=t)}return a}updateCanvasWidth(u){var r,o,s,l,E;const e=this.canvasWidth,a=this.canvasWidthL,i=this.canvasWidthR;this.canvasWidth=this.getCanvasWidth();const t=this.canvasWidth!==e||this.canvasWidthL!==a||this.canvasWidthR!==i;if(t||this.hasFrozenColumns()||this.hasFrozenRows)if(y.width(this._canvasTopL,this.canvasWidthL),this.getHeadersWidth(),y.width(this._headerL,this.headersWidthL),y.width(this._headerR,this.headersWidthR),this.hasFrozenColumns()){const d=y.width(this._container)||0;if(d>0&&this.canvasWidthL>d&&this._options.throwWhenFrozenNotAllViewable)throw new Error("[SlickGrid] Frozen columns cannot be wider than the actual grid container width. Make sure to have less columns freezed or make your grid container wider");y.width(this._canvasTopR,this.canvasWidthR),y.width(this._paneHeaderL,this.canvasWidthL),y.setStyleSize(this._paneHeaderR,"left",this.canvasWidthL),y.setStyleSize(this._paneHeaderR,"width",this.viewportW-this.canvasWidthL),y.width(this._paneTopL,this.canvasWidthL),y.setStyleSize(this._paneTopR,"left",this.canvasWidthL),y.width(this._paneTopR,this.viewportW-this.canvasWidthL),y.width(this._headerRowScrollerL,this.canvasWidthL),y.width(this._headerRowScrollerR,this.viewportW-this.canvasWidthL),y.width(this._headerRowL,this.canvasWidthL),y.width(this._headerRowR,this.canvasWidthR),this._options.createFooterRow&&(y.width(this._footerRowScrollerL,this.canvasWidthL),y.width(this._footerRowScrollerR,this.viewportW-this.canvasWidthL),y.width(this._footerRowL,this.canvasWidthL),y.width(this._footerRowR,this.canvasWidthR)),this._options.createPreHeaderPanel&&y.width(this._preHeaderPanel,this._options.preHeaderPanelWidth??this.canvasWidth),y.width(this._viewportTopL,this.canvasWidthL),y.width(this._viewportTopR,this.viewportW-this.canvasWidthL),this.hasFrozenRows&&(y.width(this._paneBottomL,this.canvasWidthL),y.setStyleSize(this._paneBottomR,"left",this.canvasWidthL),y.width(this._viewportBottomL,this.canvasWidthL),y.width(this._viewportBottomR,this.viewportW-this.canvasWidthL),y.width(this._canvasBottomL,this.canvasWidthL),y.width(this._canvasBottomR,this.canvasWidthR))}else y.width(this._paneHeaderL,"100%"),y.width(this._paneTopL,"100%"),y.width(this._headerRowScrollerL,"100%"),y.width(this._headerRowL,this.canvasWidth),this._options.createFooterRow&&(y.width(this._footerRowScrollerL,"100%"),y.width(this._footerRowL,this.canvasWidth)),this._options.createPreHeaderPanel&&y.width(this._preHeaderPanel,this._options.preHeaderPanelWidth??this.canvasWidth),y.width(this._viewportTopL,"100%"),this.hasFrozenRows&&(y.width(this._viewportBottomL,"100%"),y.width(this._canvasBottomL,this.canvasWidthL));this.viewportHasHScroll=this.canvasWidth>=this.viewportW-(((r=this.scrollbarDimensions)==null?void 0:r.width)||0),y.width(this._headerRowSpacerL,this.canvasWidth+(this.viewportHasVScroll&&((o=this.scrollbarDimensions)==null?void 0:o.width)||0)),y.width(this._headerRowSpacerR,this.canvasWidth+(this.viewportHasVScroll&&((s=this.scrollbarDimensions)==null?void 0:s.width)||0)),this._options.createFooterRow&&(y.width(this._footerRowSpacerL,this.canvasWidth+(this.viewportHasVScroll&&((l=this.scrollbarDimensions)==null?void 0:l.width)||0)),y.width(this._footerRowSpacerR,this.canvasWidth+(this.viewportHasVScroll&&((E=this.scrollbarDimensions)==null?void 0:E.width)||0))),(t||u)&&this.applyColumnWidths()}disableSelection(u){u.forEach(e=>{e.setAttribute("unselectable","on"),e.style.mozUserSelect="none",this._bindingEventService.bind(e,"selectstart",()=>!1)})}getMaxSupportedCssHeight(){let u=1e6;const e=navigator.userAgent.toLowerCase().match(/firefox/)?this._options.ffMaxSupportedCssHeight:this._options.maxSupportedCssHeight,a=v("div",{style:{display:"hidden"}},document.body);let i=!0;for(;i;){const t=u*2;y.height(a,t);const r=y.height(a);if(t>e||r!==t){i=!1;break}else u=t}return a.remove(),u}getUID(){return this.uid}getHeaderColumnWidthDiff(){return this.headerColumnWidthDiff}getScrollbarDimensions(){return this.scrollbarDimensions}getDisplayedScrollbarDimensions(){var u,e;return{width:this.viewportHasVScroll&&((u=this.scrollbarDimensions)==null?void 0:u.width)||0,height:this.viewportHasHScroll&&((e=this.scrollbarDimensions)==null?void 0:e.height)||0}}getAbsoluteColumnMinWidth(){return this.absoluteColumnMinWidth}bindAncestorScrollEvents(){let u=this.hasFrozenRows&&!this._options.frozenBottom?this._canvasBottomL:this._canvasTopL;for(;(u=u.parentNode)!==document.body&&u;)(u===this._viewportTopL||u.scrollWidth!==u.clientWidth||u.scrollHeight!==u.clientHeight)&&(this._boundAncestors.push(u),this._bindingEventService.bind(u,"scroll",this.handleActiveCellPositionChange.bind(this)))}unbindAncestorScrollEvents(){this._boundAncestors.forEach(u=>{this._bindingEventService.unbindByEventName(u,"scroll")}),this._boundAncestors=[]}updateColumnHeader(u,e,a){if(this.initialized){const i=this.getColumnIndex(u);if(!$u(i))return;const t=this.columns[i],r=this.getColumnByIndex(i);return r&&(e!==void 0&&(this.columns[i].name=e),a!==void 0&&(this.columns[i].toolTip=a),this.triggerEvent(this.onBeforeHeaderCellDestroy,{node:r,column:t,grid:this}),r.setAttribute("title",a||""),e!==void 0&&this.applyHtmlCode(r.children[0],e),this.triggerEvent(this.onHeaderCellRendered,{node:r,column:t,grid:this})),r}}getHeader(u){if(!u)return this.hasFrozenColumns()?this._headers:this._headerL;const e=this.getColumnIndex(u.id);return this.hasFrozenColumns()?e<=this._options.frozenColumn?this._headerL:this._headerR:this._headerL}getHeaderColumn(u){const e=typeof u=="number"?u:this.getColumnIndex(u),a=this.hasFrozenColumns()?e<=this._options.frozenColumn?this._headerL:this._headerR:this._headerL,i=this.hasFrozenColumns()?e<=this._options.frozenColumn?e:e-this._options.frozenColumn-1:e;return a.children[i]}getHeaderRow(){var u;return this.hasFrozenColumns()?this._headerRows:(u=this._headerRows)==null?void 0:u[0]}getFooterRow(){var u;return this.hasFrozenColumns()?this._footerRow:(u=this._footerRow)==null?void 0:u[0]}getPreHeaderPanel(){return this._preHeaderPanel}getPreHeaderPanelLeft(){return this._preHeaderPanel}getPreHeaderPanelRight(){return this._preHeaderPanelR}getHeaderRowColumn(u){let e=typeof u=="number"?u:this.getColumnIndex(u),a;return this.hasFrozenColumns()?e<=this._options.frozenColumn?a=this._headerRowL:(a=this._headerRowR,e-=this._options.frozenColumn+1):a=this._headerRowL,a.children[e]}getFooterRowColumn(u){let e=typeof u=="number"?u:this.getColumnIndex(u),a;return this.hasFrozenColumns()?e<=this._options.frozenColumn?a=this._footerRowL:(a=this._footerRowR,e-=this._options.frozenColumn+1):a=this._footerRowL,a==null?void 0:a.children[e]}createColumnFooter(){if(this._options.createFooterRow){this._footerRow.forEach(u=>{u.querySelectorAll(".slick-footerrow-column").forEach(a=>{const i=y.storage.get(a,"column");this.triggerEvent(this.onBeforeFooterRowCellDestroy,{node:a,column:i,grid:this})})}),bu(this._footerRowL),bu(this._footerRowR);for(let u=0;uthis._options.frozenColumn?this._footerRowR:this._footerRowL),i=this.hasFrozenColumns()&&u<=this._options.frozenColumn?"frozen":null;i&&a.classList.add(i),y.storage.put(a,"column",e),this.triggerEvent(this.onFooterRowCellRendered,{node:a,column:e,grid:this})}}}handleHeaderMouseHoverOn(u){u==null||u.target.classList.add("slick-state-hover")}handleHeaderMouseHoverOff(u){u==null||u.target.classList.remove("slick-state-hover")}createColumnHeaders(){this._headers.forEach(u=>{u.querySelectorAll(".slick-header-column").forEach(a=>{const i=y.storage.get(a,"column");i&&this.triggerEvent(this.onBeforeHeaderCellDestroy,{node:a,column:i,grid:this})})}),bu(this._headerL),bu(this._headerR),this.getHeadersWidth(),y.width(this._headerL,this.headersWidthL),y.width(this._headerR,this.headersWidthR),this._headerRows.forEach(u=>{u.querySelectorAll(".slick-headerrow-column").forEach(a=>{const i=y.storage.get(a,"column");i&&this.triggerEvent(this.onBeforeHeaderRowCellDestroy,{node:this,column:i,grid:this})})}),bu(this._headerRowL),bu(this._headerRowR),this._options.createFooterRow&&(this._footerRowL.querySelectorAll(".slick-footerrow-column").forEach(e=>{const a=y.storage.get(e,"column");a&&this.triggerEvent(this.onBeforeFooterRowCellDestroy,{node:this,column:a,grid:this})}),bu(this._footerRowL),this.hasFrozenColumns()&&(this._footerRowR.querySelectorAll(".slick-footerrow-column").forEach(a=>{const i=y.storage.get(a,"column");i&&this.triggerEvent(this.onBeforeFooterRowCellDestroy,{node:this,column:i,grid:this})}),bu(this._footerRowR)));for(let u=0;u{e.headerCellAttrs.hasOwnProperty(s)&&t.setAttribute(s,e.headerCellAttrs[s])}),e.sortable&&(t.classList.add("slick-header-sortable"),v("div",{className:`slick-sort-indicator ${this._options.numberedMultiColumnSort&&!this._options.sortColNumberInSeparateSpan?" slick-sort-indicator-numbered":""}`},t),this._options.numberedMultiColumnSort&&this._options.sortColNumberInSeparateSpan&&v("div",{className:"slick-sort-indicator-numbered"},t)),this.triggerEvent(this.onHeaderCellRendered,{node:t,column:e,grid:this}),this._options.showHeaderRow){const s=v("div",{className:`slick-state-default slick-headerrow-column l${u} r${u}`},i),l=this.hasFrozenColumns()&&u<=this._options.frozenColumn?"frozen":null;l&&s.classList.add(l),this._bindingEventService.bind(s,"mouseenter",this.handleHeaderRowMouseEnter.bind(this)),this._bindingEventService.bind(s,"mouseleave",this.handleHeaderRowMouseLeave.bind(this)),this._bindingEventService.bind(s,"mouseover",this.handleHeaderRowMouseOver.bind(this)),this._bindingEventService.bind(s,"mouseout",this.handleHeaderRowMouseOut.bind(this)),y.storage.put(s,"column",e),this.triggerEvent(this.onHeaderRowCellRendered,{node:s,column:e,grid:this})}if(this._options.createFooterRow&&this._options.showFooterRow){const s=this.hasFrozenColumns()?u<=this._options.frozenColumn?this._footerRow[0]:this._footerRow[1]:this._footerRow[0],l=v("div",{className:`slick-state-default slick-footerrow-column l${u} r${u}`},s);y.storage.put(l,"column",e),this.triggerEvent(this.onFooterRowCellRendered,{node:l,column:e,grid:this})}}this.setSortColumns(this.sortColumns),this.setupColumnResize(),this._options.enableColumnReorder&&(typeof this._options.enableColumnReorder=="function"?this._options.enableColumnReorder(this,this._headers,this.headerColumnWidthDiff,this.setColumns,this.setupColumnResize,this.columns,this.getColumnIndex,this.uid,this.triggerEvent):this.setupColumnReorder())}setupColumnSort(){this._headers.forEach(u=>{this._bindingEventService.bind(u,"click",e=>{var t;if(this.columnResizeDragging||e.target.classList.contains("slick-resizable-handle"))return;const a=e.target.closest(".slick-header-column");if(!a)return;const i=y.storage.get(a,"column");if(i!=null&&i.sortable){if(!((t=this.getEditorLock())!=null&&t.commitCurrentEdit()))return;const r=this.sortColumns.slice();let o=null,s=0;for(;s{const c=this.columns[this.getColumnIndex(d.columnId)];return!c||c.hidden?null:{columnId:c.id,sortCol:c,sortAsc:d.sortAsc}}).filter(d=>d)}:E={multiColumnSort:!1,previousSortColumns:r,columnId:this.sortColumns.length>0?i.id:null,sortCol:this.sortColumns.length>0?i:null,sortAsc:this.sortColumns.length>0?this.sortColumns[0].sortAsc:!0},this.triggerEvent(this.onBeforeSort,E,e).getReturnValue()!==!1&&(this.setSortColumns(this.sortColumns),this.triggerEvent(this.onSort,E,e))}})})}setupColumnReorder(){var r,o;(r=this.sortableSideLeftInstance)==null||r.destroy(),(o=this.sortableSideRightInstance)==null||o.destroy();let u=null;const e=()=>this._viewportScrollContainerX.scrollLeft+=10,a=()=>this._viewportScrollContainerX.scrollLeft-=10;let i=!1;const t={animation:50,direction:"horizontal",chosenClass:"slick-header-column-active",ghostClass:"slick-sortable-placeholder",draggable:".slick-header-column",dragoverBubble:!1,revertClone:!0,scroll:!this.hasFrozenColumns(),filter:`.${this._options.unorderableColumnCssClass}`,onMove:s=>!s.related.classList.contains(this._options.unorderableColumnCssClass),onStart:s=>{i=!this.hasFrozenColumns()||Iu(s.item).left>Iu(this._viewportScrollContainerX).left,i&&s.originalEvent.pageX>this._container.clientWidth?u||(u=setInterval(e,100)):i&&s.originalEvent.pageX{var d,c,D;if(clearInterval(u),u=null,!((d=this.getEditorLock())!=null&&d.commitCurrentEdit()))return;let l=((c=this.sortableSideLeftInstance)==null?void 0:c.toArray())??[];l=l.concat(((D=this.sortableSideRightInstance)==null?void 0:D.toArray())??[]);const E=[];for(let m=0;m"u")throw new Error('SlickResizable is undefined, make sure to import "slick.interactions.js"');let u,e,a,i,t,r,o,s=-1,l=0;const E=this.getHeaderChildren(),d=this.getVisibleColumns();for(let D=0;Dx.remove()),D=d.length||!d[D]||D=s)continue;const h=v("div",{className:"slick-resizable-handle",role:"separator",ariaOrientation:"horizontal"},m);this._bindingEventService.bind(h,"dblclick",this.handleResizeableDoubleClick.bind(this)),this.slickResizableInstances.push(Ss({resizeableElement:m,resizeableHandleElement:h,onResizeStart:(x,g)=>{var S;const F=x.touches?x.changedTouches[0]:x;if(!((S=this.getEditorLock())!=null&&S.commitCurrentEdit()))return!1;i=F.pageX,l=0,g.resizeableElement.classList.add("slick-header-column-active");let C=null,A=null;for(let z=0;z{var M;const F=x.touches?x.changedTouches[0]:x;this.columnResizeDragging=!0;let C;const A=Math.min(r,Math.max(t,F.pageX))-i;let b,B=0,S=0;const z=this.viewportHasVScroll?this.viewportW-(((M=this.scrollbarDimensions)==null?void 0:M.width)||0):this.viewportW;if(A<0){for(b=A,u=D;u>=0;u--)a=d[u],a&&a.resizable&&!a.hidden&&(C=Math.max(a.minWidth||0,this.absoluteColumnMinWidth),b&&(a.previousWidth||0)+bthis._options.frozenColumn?S+=a.width||0:B+=a.width||0);if(this._options.forceFitColumns)for(b=-A,u=D+1;uthis._options.frozenColumn?S+=a.width||0:B+=a.width||0);else for(u=D+1;uthis._options.frozenColumn?S+=a.width||0:B+=a.width||0);if(this._options.forceFitColumns)for(b=-A,u=D+1;u=0;u--)if(a=d[u],!(!a||a.hidden)&&a.resizable)if(b&&a.maxWidth&&a.maxWidth-(a.previousWidth||0)l&&Nz?l:w):a.width=w,b=0}for(e=0;e<=D;e++)a=d[e],!(!a||a.hidden)&&(this.hasFrozenColumns()&&e>this._options.frozenColumn?S+=a.width||0:B+=a.width||0);if(this._options.forceFitColumns)for(b=-A,u=D+1;uthis._options.frozenColumn?S+=a.width||0:B+=a.width||0);else for(u=D+1;uthis._options.frozenColumn?S+=a.width||0:B+=a.width||0)}this.hasFrozenColumns()&&B!==this.canvasWidthL&&(y.width(this._headerL,B+1e3),y.setStyleSize(this._paneHeaderR,"left",B)),this.applyColumnHeaderWidths(),this._options.syncColumnCellResize&&this.applyColumnWidths(),this.triggerEvent(this.onColumnsDrag,{triggeredByColumn:g.resizeableElement,resizeHandle:g.resizeableHandleElement})},onResizeEnd:(x,g)=>{g.resizeableElement.classList.remove("slick-header-column-active");const F=g.resizeableElement.id.replace(this.uid,"");this.triggerEvent(this.onBeforeColumnsResize,{triggeredByColumn:F}).getReturnValue()===!0&&this.applyColumnHeaderWidths();let C;for(u=0;uthis.columnResizeDragging=!1,this._options.columnResizingDelay)}}))}}getVBoxDelta(u){const e=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],a=getComputedStyle(u);let i=0;return e.forEach(t=>i+=y.toFloat(a[t])),i}setFrozenOptions(){if(this._options.frozenColumn=this._options.frozenColumn>=0&&this._options.frozenColumn-1){this.hasFrozenRows=!0,this.frozenRowsHeight=this._options.frozenRow*this._options.rowHeight;const u=this.getDataLength();this.actualFrozenRow=this._options.frozenBottom?u-this._options.frozenRow:this._options.frozenRow}else this.hasFrozenRows=!1}setPaneVisibility(){this.hasFrozenColumns()?(y.show(this._paneHeaderR),y.show(this._paneTopR),this.hasFrozenRows?(y.show(this._paneBottomL),y.show(this._paneBottomR)):(y.hide(this._paneBottomR),y.hide(this._paneBottomL))):(y.hide(this._paneHeaderR),y.hide(this._paneTopR),y.hide(this._paneBottomR),this.hasFrozenRows?y.show(this._paneBottomL):(y.hide(this._paneBottomR),y.hide(this._paneBottomL)))}setOverflow(){if(this._viewportTopL.style.overflowX=this.hasFrozenColumns()?this.hasFrozenRows&&!this._options.alwaysAllowHorizontalScroll?"hidden":"scroll":this.hasFrozenRows&&!this._options.alwaysAllowHorizontalScroll?"hidden":"auto",this._viewportTopL.style.overflowY=!this.hasFrozenColumns()&&this._options.alwaysShowVerticalScroll?"scroll":this.hasFrozenColumns()?(this.hasFrozenRows,"hidden"):this.hasFrozenRows?"scroll":"auto",this._viewportTopR.style.overflowX=this.hasFrozenColumns()?this.hasFrozenRows&&!this._options.alwaysAllowHorizontalScroll?"hidden":"scroll":this.hasFrozenRows&&!this._options.alwaysAllowHorizontalScroll?"hidden":"auto",this._viewportTopR.style.overflowY=this._options.alwaysShowVerticalScroll?"scroll":this.hasFrozenColumns()?this.hasFrozenRows?"scroll":"auto":this.hasFrozenRows?"scroll":"auto",this._viewportBottomL.style.overflowX=this.hasFrozenColumns()?this.hasFrozenRows&&!this._options.alwaysAllowHorizontalScroll?"scroll":"auto":(this.hasFrozenRows&&!this._options.alwaysAllowHorizontalScroll,"auto"),this._viewportBottomL.style.overflowY=!this.hasFrozenColumns()&&this._options.alwaysShowVerticalScroll?"scroll":this.hasFrozenColumns()?(this.hasFrozenRows,"hidden"):this.hasFrozenRows?"scroll":"auto",this._viewportBottomR.style.overflowX=this.hasFrozenColumns()?this.hasFrozenRows&&!this._options.alwaysAllowHorizontalScroll?"scroll":"auto":(this.hasFrozenRows&&!this._options.alwaysAllowHorizontalScroll,"auto"),this._viewportBottomR.style.overflowY=this._options.alwaysShowVerticalScroll?"scroll":this.hasFrozenColumns()?(this.hasFrozenRows,"auto"):(this.hasFrozenRows,"auto"),this._options.viewportClass){const u=_u(this._options.viewportClass);this._viewportTopL.classList.add(...u),this._viewportTopR.classList.add(...u),this._viewportBottomL.classList.add(...u),this._viewportBottomR.classList.add(...u)}}setScroller(){this.hasFrozenColumns()?(this._headerScrollContainer=this._headerScrollerR,this._headerRowScrollContainer=this._headerRowScrollerR,this._footerRowScrollContainer=this._footerRowScrollerR,this.hasFrozenRows?this._options.frozenBottom?(this._viewportScrollContainerX=this._viewportBottomR,this._viewportScrollContainerY=this._viewportTopR):this._viewportScrollContainerX=this._viewportScrollContainerY=this._viewportBottomR:this._viewportScrollContainerX=this._viewportScrollContainerY=this._viewportTopR):(this._headerScrollContainer=this._headerScrollerL,this._headerRowScrollContainer=this._headerRowScrollerL,this._footerRowScrollContainer=this._footerRowScrollerL,this.hasFrozenRows?this._options.frozenBottom?(this._viewportScrollContainerX=this._viewportBottomL,this._viewportScrollContainerY=this._viewportTopL):this._viewportScrollContainerX=this._viewportScrollContainerY=this._viewportBottomL:this._viewportScrollContainerX=this._viewportScrollContainerY=this._viewportTopL)}measureCellPaddingAndBorder(){const u=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],e=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],a=this._headers[0];this.headerColumnWidthDiff=this.headerColumnHeightDiff=0,this.cellWidthDiff=this.cellHeightDiff=0;let i=v("div",{className:"slick-state-default slick-header-column",style:{visibility:"hidden"},textContent:"-"},a),t=getComputedStyle(i);t.boxSizing!=="border-box"&&(u.forEach(o=>this.headerColumnWidthDiff+=y.toFloat(t[o])),e.forEach(o=>this.headerColumnHeightDiff+=y.toFloat(t[o]))),i.remove();const r=v("div",{className:"slick-row"},this._canvas[0]);i=v("div",{className:"slick-cell",id:"",style:{visibility:"hidden"},textContent:"-"},r),t=getComputedStyle(i),t.boxSizing!=="border-box"&&(u.forEach(o=>this.cellWidthDiff+=y.toFloat(t[o])),e.forEach(o=>this.cellHeightDiff+=y.toFloat(t[o]))),r.remove(),this.absoluteColumnMinWidth=Math.max(this.headerColumnWidthDiff,this.cellWidthDiff)}createCssRules(){this._style=document.createElement("style"),this._style.nonce=this._options.nonce||"",(this._options.shadowRoot||document.head).appendChild(this._style);const u=this._options.rowHeight-this.cellHeightDiff,e=[`.${this.uid} .slick-group-header-column { left: 1000px; }`,`.${this.uid} .slick-header-column { left: 1000px; }`,`.${this.uid} .slick-top-panel { height: ${this._options.topPanelHeight}px; }`,`.${this.uid} .slick-preheader-panel { height: ${this._options.preHeaderPanelHeight}px; }`,`.${this.uid} .slick-headerrow-columns { height: ${this._options.headerRowHeight}px; }`,`.${this.uid} .slick-footerrow-columns { height: ${this._options.footerRowHeight}px; }`,`.${this.uid} .slick-cell { height: ${u}px; }`,`.${this.uid} .slick-row { height: ${this._options.rowHeight}px; }`],a=this._style.sheet;if(a){e.forEach(i=>{a.insertRule(i)});for(let i=0;i ',this._style=e.content.firstChild,(this._options.shadowRoot||document.head).appendChild(this._style);for(let a=0;a=0&&(a[this._options.devMode.ownerNodeIndex].ownerNode=this._style),e=0;e{this._bindingEventService.unbindByEventName(s,"keydown"),this._bindingEventService.unbindByEventName(s,"click"),this._bindingEventService.unbindByEventName(s,"dblclick"),this._bindingEventService.unbindByEventName(s,"contextmenu"),this._bindingEventService.unbindByEventName(s,"mouseover"),this._bindingEventService.unbindByEventName(s,"mouseout")}),this._viewport.forEach(s=>{this._bindingEventService.unbindByEventName(s,"scroll")}),this._headerScroller.forEach(s=>{this._bindingEventService.unbindByEventName(s,"contextmenu"),this._bindingEventService.unbindByEventName(s,"click")}),this._headerRowScroller.forEach(s=>{this._bindingEventService.unbindByEventName(s,"scroll")}),this._footerRow&&this._footerRow.forEach(s=>{this._bindingEventService.unbindByEventName(s,"contextmenu"),this._bindingEventService.unbindByEventName(s,"click")}),this._footerRowScroller&&this._footerRowScroller.forEach(s=>{this._bindingEventService.unbindByEventName(s,"scroll")}),this._preHeaderPanelScroller&&this._bindingEventService.unbindByEventName(this._preHeaderPanelScroller,"scroll"),this._bindingEventService.unbindByEventName(this._focusSink,"keydown"),this._bindingEventService.unbindByEventName(this._focusSink2,"keydown");const a=this._container.querySelectorAll(".slick-resizable-handle");[].forEach.call(a,s=>{this._bindingEventService.unbindByEventName(s,"dblclick")});const i=this._container.querySelectorAll(".slick-header-column");[].forEach.call(i,s=>{this._bindingEventService.unbindByEventName(s,"mouseenter"),this._bindingEventService.unbindByEventName(s,"mouseleave"),this._bindingEventService.unbindByEventName(s,"mouseover"),this._bindingEventService.unbindByEventName(s,"mouseout")}),bu(this._container),this._container.classList.remove(this.uid),this.clearAllTimers(),u&&Mr(this)}destroyAllInstances(u){if(u){const e=Array.isArray(u)?u:[u];let a;for(;$u(a=e.pop());)a&&typeof a.destroy=="function"&&a.destroy()}return u=Array.isArray(u)?[]:null,u}autosizeColumns(){this.legacyAutosizeColumns()}legacyAutosizeColumns(){var l;let u,e,a=0,i=0,t=0;const r=[],o=this.viewportHasVScroll?this.viewportW-(((l=this.scrollbarDimensions)==null?void 0:l.width)||0):this.viewportW;for(u=0;uo&&a;){const E=(i-o)/a;for(u=0;uo;u++){if(e=this.columns[u],!e||e.hidden)continue;const d=r[u];if(!e.resizable||d<=e.minWidth||d<=this.absoluteColumnMinWidth)continue;const c=Math.max(e.minWidth,this.absoluteColumnMinWidth);let D=Math.floor(E*(d-c))||1;D=Math.min(D,d-c),i-=D,a-=D,r[u]-=D}if(t<=i)break;t=i}for(t=i;i=i)break;t=i}let s=!1;for(u=0;u!u.hidden)}triggerEvent(u,e,a){const i=a||new Pu(a,e),t=e||{};return t.grid=this,u.notify(t,i,this)}getEditorLock(){return this._options.editorLock}getEditController(){return this.editController}getColumnIndex(u){return this.columnsById[u]}applyColumnHeaderWidths(){if(this.initialized){let u=0;const e=this.getVisibleColumns();this._headers.forEach(a=>{for(let i=0;ithis._options.frozenColumn?this.canvasWidthR:this.canvasWidthL)-u-e+"px",this._options.frozenColumn!==t&&(u+=this.columns[t].width)),this._options.frozenColumn===t&&(u=0)}setSortColumn(u,e){this.setSortColumns([{columnId:u,sortAsc:e}])}getColumnByIndex(u){let e;return this._headers.every(a=>{const i=a.children.length;return u1;this._headers.forEach(i=>{let t=i.querySelectorAll(".slick-header-column-sorted");t.forEach(r=>r.classList.remove("slick-header-column-sorted")),t=i.querySelectorAll(".slick-sort-indicator"),t.forEach(r=>r.classList.remove("slick-sort-indicator-asc","slick-sort-indicator-desc")),t=i.querySelectorAll(".slick-sort-indicator-numbered"),t.forEach(r=>r.textContent="")});let a=1;this.sortColumns.forEach(i=>{$u(i.sortAsc)||(i.sortAsc=!0);const t=this.getColumnIndex(i.columnId);if($u(t)){const r=this.getColumnByIndex(t);if(r){r.classList.add("slick-header-column-sorted");let o=r.querySelector(".slick-sort-indicator");o==null||o.classList.add(i.sortAsc?"slick-sort-indicator-asc":"slick-sort-indicator-desc"),e&&(o=r.querySelector(".slick-sort-indicator-numbered"),o&&(o.textContent=String(a)))}}a++})}getSortColumns(){return this.sortColumns}handleSelectedRangesChanged(u,e){var r;const a=u.getNativeEvent(),i=this.selectedRows.slice(0);this.selectedRows=[];const t={};for(let o=0;oi.indexOf(E)<0),l=i.filter(E=>this.getSelectedRows().indexOf(E)<0);this.triggerEvent(this.onSelectedRowsChanged,{rows:this.getSelectedRows(),previousSelectedRows:i,caller:o,changedSelectedRows:s,changedUnselectedRows:l},u)}}simpleArrayEquals(u,e){return Array.isArray(u)&&Array.isArray(e)&&e.sort().toString()!==u.sort().toString()}getColumns(){return this.columns}updateColumnCaches(){this.columnPosLeft=[],this.columnPosRight=[];let u=0;for(let e=0,a=this.columns.length;ee.maxWidth&&(e.width=e.maxWidth)}}setColumns(u){this.triggerEvent(this.onBeforeSetColumns,{previousColumns:this.columns,newColumns:u,grid:this}),this.columns=u,this.updateColumnsInternal(),this.triggerEvent(this.onAfterSetColumns,{newColumns:u,grid:this})}updateColumns(){this.triggerEvent(this.onBeforeUpdateColumns,{columns:this.columns,grid:this}),this.updateColumnsInternal()}updateColumnsInternal(){var u;this.updateColumnProps(),this.updateColumnCaches(),this.initialized&&(this.setPaneVisibility(),this.setOverflow(),this.invalidateAllRows(),this.createColumnHeaders(),this.createColumnFooter(),this.removeCssRules(),this.createCssRules(),this.resizeCanvas(),this.updateCanvasWidth(),this.applyColumnWidths(),this.handleScroll(),(u=this.getSelectionModel())==null||u.refreshSelections())}getOptions(){return this._options}setOptions(u,e,a,i){this.prepareForOptionsChange(),this._options.enableAddRow!==u.enableAddRow&&this.invalidateRow(this.getDataLength()),u.frozenColumn&&(this.getViewports().forEach(r=>r.scrollLeft=0),this.handleScroll());const t=wu(!0,{},this._options);this._options=wu(this._options,u),this.triggerEvent(this.onSetOptions,{optionsBefore:t,optionsAfter:this._options}),this.internal_setOptions(e,a,i)}activateChangedOptions(u,e,a){this.prepareForOptionsChange(),this.invalidateRow(this.getDataLength()),this.triggerEvent(this.onActivateChangedOptions,{options:this._options}),this.internal_setOptions(u,e,a)}prepareForOptionsChange(){var u;(u=this.getEditorLock())!=null&&u.commitCurrentEdit()&&this.makeActiveCellNormal()}internal_setOptions(u,e,a){this._options.showColumnHeader!==void 0&&this.setColumnHeaderVisibility(this._options.showColumnHeader),this.validateAndEnforceOptions(),this.setFrozenOptions(),this._options.frozenBottom!==void 0&&(this.enforceFrozenRowHeightRecalc=!0),this._viewport.forEach(i=>{i.style.overflowY=this._options.autoHeight?"hidden":"auto"}),u||this.render(),this.setScroller(),a||this.setOverflow(),e||this.setColumns(this.columns),this._options.enableMouseWheelScrollHandler&&this._viewport&&(!this.slickMouseWheelInstances||this.slickMouseWheelInstances.length===0)?this._viewport.forEach(i=>{this.slickMouseWheelInstances.push(zs({element:i,onMouseWheel:this.handleMouseWheel.bind(this)}))}):this._options.enableMouseWheelScrollHandler===!1&&this.destroyAllInstances(this.slickMouseWheelInstances)}validateAndEnforceOptions(){this._options.autoHeight&&(this._options.leaveSpaceForNewRows=!1)}setData(u,e){this.data=u,this.invalidateAllRows(),this.updateRowCount(),e&&this.scrollTo(0)}getData(){return this.data}getDataLength(){var u;return this.data.getLength?this.data.getLength():((u=this.data)==null?void 0:u.length)||0}getDataLengthIncludingAddNew(){return this.getDataLength()+(this._options.enableAddRow&&(!this.pagingActive||this.pagingIsLastPage)?1:0)}getDataItem(u){return this.data.getItem?this.data.getItem(u):this.data[u]}getTopPanel(){return this._topPanels[0]}getTopPanels(){return this._topPanels}hasDataView(){return!Array.isArray(this.data)}togglePanelVisibility(u,e,a){this._options[u]!==a&&(this._options[u]=a,a?y.show(e):y.hide(e),this.resizeCanvas())}setTopPanelVisibility(u){this.togglePanelVisibility("showTopPanel",this._topPanelScrollers,u)}setHeaderRowVisibility(u){this.togglePanelVisibility("showHeaderRow",this._headerRowScroller,u)}setColumnHeaderVisibility(u){this.togglePanelVisibility("showColumnHeader",this._headerScroller,u)}setFooterRowVisibility(u){this.togglePanelVisibility("showFooterRow",this._footerRowScroller,u)}setPreHeaderPanelVisibility(u){this.togglePanelVisibility("showPreHeaderPanel",[this._preHeaderPanelScroller,this._preHeaderPanelScrollerR],u)}getContainerNode(){return this._container}getRowTop(u){return this._options.rowHeight*u-this.offset}getRowFromPosition(u){return Math.floor((u+this.offset)/this._options.rowHeight)}scrollTo(u){var i;u=Math.max(u,0),u=Math.min(u,(this.th||0)-y.height(this._viewportScrollContainerY)+((this.viewportHasHScroll||this.hasFrozenColumns())&&((i=this.scrollbarDimensions)==null?void 0:i.height)||0));const e=this.offset;this.offset=Math.round(this.page*(this.cj||0)),this.page=Math.min((this.n||0)-1,Math.floor(u/(this.ph||0)));const a=u-this.offset;if(this.offset!==e){const t=this.getVisibleRange(a);this.cleanupRows(t),this.updateRowPositions()}this.prevScrollTop!==a&&(this.vScrollDir=this.prevScrollTop+e /g,">"):""}getFormatter(u,e){var t,r,o;const a=(r=(t=this.data)==null?void 0:t.getItemMetadata)==null?void 0:r.call(t,u),i=(a==null?void 0:a.columns)&&(a.columns[e.id]||a.columns[this.getColumnIndex(e.id)]);return(i==null?void 0:i.formatter)||(a==null?void 0:a.formatter)||e.formatter||((o=this._options.formatterFactory)==null?void 0:o.getFormatter(e))||this._options.defaultFormatter}getEditor(u,e){var r,o,s,l,E,d;const a=this.columns[e],i=(o=(r=this.data)==null?void 0:r.getItemMetadata)==null?void 0:o.call(r,u),t=i==null?void 0:i.columns;return((s=t==null?void 0:t[a.id])==null?void 0:s.editorClass)!==void 0?t[a.id].editorClass:((l=t==null?void 0:t[e])==null?void 0:l.editorClass)!==void 0?t[e].editorClass:a.editorClass||((d=(E=this._options)==null?void 0:E.editorFactory)==null?void 0:d.getEditor(a))}getDataItemValueForColumn(u,e){return this._options.dataItemColumnValueExtractor?this._options.dataItemColumnValueExtractor(u,e):u[e.field]}appendRowHtml(u,e,a,i,t){var h,x;const r=this.getDataItem(a),o=ai.leftPx){if(!m.alwaysRenderColumn&&this.columnPosLeft[g]>i.rightPx)break;this.hasFrozenColumns()&&g>this._options.frozenColumn?this.appendCellHtml(c,a,g,D,r):this.appendCellHtml(d,a,g,D,r)}else(m.alwaysRenderColumn||this.hasFrozenColumns()&&g<=this._options.frozenColumn)&&this.appendCellHtml(d,a,g,D,r);D>1&&(g+=D-1)}}appendCellHtml(u,e,a,i,t){const r=this.columns[a];let o="slick-cell l"+a+" r"+Math.min(this.columns.length-1,a+i-1)+(r.cssClass?" "+r.cssClass:"");this.hasFrozenColumns()&&a<=this._options.frozenColumn&&(o+=" frozen"),e===this.activeRow&&a===this.activeCell&&this._options.showCellSelection&&(o+=" active"),Object.keys(this.cellCssClasses).forEach(h=>{var x;(x=this.cellCssClasses[h][e])!=null&&x[r.id]&&(o+=` ${this.cellCssClasses[h][e][r.id]}`)});let s=null,l="";t&&(s=this.getDataItemValueForColumn(t,r),l=this.getFormatter(e,r)(e,a,s,r,t,this),l==null&&(l=""));const d=this.triggerEvent(this.onBeforeAppendCell,{row:e,cell:a,value:s,dataContext:t}).getReturnValue();let c=typeof d=="string"?d:"";l!=null&&l.addClasses&&(c+=_u((c?" ":"")+l.addClasses).join(" "));const D=l!=null&&l.toolTip?`${l.toolTip}`:"",m=v("div",{className:_u(`${o} ${c||""}`).join(" "),role:"gridcell",tabIndex:-1});if(m.setAttribute("aria-describedby",this.uid+r.id),D&&m.setAttribute("title",D),r.hasOwnProperty("cellAttrs")&&r.cellAttrs instanceof Object&&Object.keys(r.cellAttrs).forEach(h=>{r.cellAttrs.hasOwnProperty(h)&&m.setAttribute(h,r.cellAttrs[h])}),t){const h=Da(l)?l:l.html||l.text;this.applyHtmlCode(m,h)}u.appendChild(m),l.insertElementAfterTarget&&Wl(m,l.insertElementAfterTarget),this.rowsCache[e].cellRenderQueue.push(a),this.rowsCache[e].cellColSpans[a]=i}cleanupRows(u){Object.keys(this.rowsCache).forEach(e=>{if(this.rowsCache){let a=+e,i=!0;this.hasFrozenRows&&(this._options.frozenBottom&&a>=this.actualFrozenRow||!this._options.frozenBottom&&a<=this.actualFrozenRow)&&(i=!1),(a=parseInt(e,10))!==this.activeRow&&(au.bottom)&&i&&this.removeRowFromCache(a)}}),this._options.enableAsyncPostRenderCleanup&&this.startPostProcessingCleanup()}invalidate(){this.updateRowCount(),this.invalidateAllRows(),this.render()}invalidateAllRows(){this.currentEditor&&this.makeActiveCellNormal(),typeof this.rowsCache=="object"&&Object.keys(this.rowsCache).forEach(u=>{this.rowsCache&&this.removeRowFromCache(+u)}),this._options.enableAsyncPostRenderCleanup&&this.startPostProcessingCleanup()}invalidateRows(u){if(u!=null&&u.length){this.vScrollDir=0;const e=u.length;for(let a=0;a=0&&this.invalidateRows([u])}queuePostProcessedRowForCleanup(u,e,a){var i;this.postProcessgroupId++,typeof e=="object"&&Object.keys(e).forEach(t=>{e.hasOwnProperty(t)&&this.postProcessedCleanupQueue.push({actionType:"C",groupId:this.postProcessgroupId,node:u.cellNodesByColumnIdx[+t],columnIdx:+t,rowIdx:a})}),u.rowNode||(u.rowNode=[]),this.postProcessedCleanupQueue.push({actionType:"R",groupId:this.postProcessgroupId,node:u.rowNode}),(i=u.rowNode)==null||i.forEach(t=>t.remove())}queuePostProcessedCellForCleanup(u,e,a){this.postProcessedCleanupQueue.push({actionType:"C",groupId:this.postProcessgroupId,node:u,columnIdx:e,rowIdx:a}),u.remove()}removeRowFromCache(u){var a;const e=this.rowsCache[u];e!=null&&e.rowNode&&(this._options.enableAsyncPostRenderCleanup&&this.postProcessedRows[u]?this.queuePostProcessedRowForCleanup(e,this.postProcessedRows[u],u):(a=e.rowNode)==null||a.forEach(i=>{var t;return(t=i.parentElement)==null?void 0:t.removeChild(i)}),delete this.rowsCache[u],delete this.postProcessedRows[u],this.renderedRows--,this.counter_rows_removed++)}applyFormatResultToCellNode(u,e,a){if(u==null&&(u=""),Da(u)){this.applyHtmlCode(e,u);return}const i=u.html||u.text;this.applyHtmlCode(e,i),u.removeClasses&&!a&&e.classList.remove(..._u(u.removeClasses)),u.addClasses&&e.classList.add(..._u(u.addClasses)),u.toolTip&&e.setAttribute("title",u.toolTip)}updateCell(u,e){const a=this.getCellNode(u,e);if(a){const i=this.columns[e],t=this.getDataItem(u);if(this.currentEditor&&this.activeRow===u&&this.activeCell===e)this.currentEditor.loadValue(t);else{const r=t?this.getFormatter(u,i)(u,e,this.getDataItemValueForColumn(t,i),i,t,this):"";this.applyFormatResultToCellNode(r,a),this.invalidatePostProcessingResults(u)}}}updateRow(u){const e=this.rowsCache[u];if(!e)return;this.ensureCellNodesInRowsCache(u);let a;const i=this.getDataItem(u);Object.keys(e.cellNodesByColumnIdx).forEach(t=>{if(!e.cellNodesByColumnIdx.hasOwnProperty(t))return;const r=+t,o=this.columns[r],s=e.cellNodesByColumnIdx[r];this.currentEditor&&u===this.activeRow&&r===this.activeCell?this.currentEditor.loadValue(i):i?(a=this.getFormatter(u,o)(u,r,this.getDataItemValueForColumn(i,o),o,i,this),this.applyFormatResultToCellNode(a,s)):bu(s)}),this.invalidatePostProcessingResults(u)}getViewportRowCount(){var a;const u=this.getViewportHeight(),e=((a=this.getScrollbarDimensions())==null?void 0:a.height)||0;return Math.floor((u-e)/this._options.rowHeight)}getViewportHeight(){var u;if((!this._options.autoHeight||this._options.frozenColumn!==-1)&&(this.topPanelH=this._options.showTopPanel?this._options.topPanelHeight+this.getVBoxDelta(this._topPanelScrollers[0]):0,this.headerRowH=this._options.showHeaderRow?this._options.headerRowHeight+this.getVBoxDelta(this._headerRowScroller[0]):0,this.footerRowH=this._options.showFooterRow?this._options.footerRowHeight+this.getVBoxDelta(this._footerRowScroller[0]):0),this._options.autoHeight){let e=this._paneHeaderL.offsetHeight;e+=this._options.showHeaderRow?this._options.headerRowHeight+this.getVBoxDelta(this._headerRowScroller[0]):0,e+=this._options.showFooterRow?this._options.footerRowHeight+this.getVBoxDelta(this._footerRowScroller[0]):0,e+=this.getCanvasWidth()>this.viewportW&&((u=this.scrollbarDimensions)==null?void 0:u.height)||0,this.viewportH=this._options.rowHeight*this.getDataLengthIncludingAddNew()+(this._options.frozenColumn===-1?e:0)}else{const e=this._options.showColumnHeader?y.toFloat(y.height(this._headerScroller[0]))+this.getVBoxDelta(this._headerScroller[0]):0,a=this._options.createPreHeaderPanel&&this._options.showPreHeaderPanel?this._options.preHeaderPanelHeight+this.getVBoxDelta(this._preHeaderPanelScroller):0,i=getComputedStyle(this._container);this.viewportH=y.toFloat(i.height)-y.toFloat(i.paddingTop)-y.toFloat(i.paddingBottom)-e-this.topPanelH-this.headerRowH-this.footerRowH-a}return this.numVisibleRows=Math.ceil(this.viewportH/this._options.rowHeight),this.viewportH}getViewportWidth(){return this.viewportW=parseFloat(gt(this._container,"width"))||this._options.devMode&&this._options.devMode.containerClientWidth||0,this.viewportW}resizeCanvas(){var u,e,a;if(this.initialized){if(this.paneTopH=0,this.paneBottomH=0,this.viewportTopH=0,this.viewportBottomH=0,this.getViewportWidth(),this.getViewportHeight(),this.hasFrozenRows?this._options.frozenBottom?(this.paneTopH=this.viewportH-this.frozenRowsHeight-(((u=this.scrollbarDimensions)==null?void 0:u.height)||0),this.paneBottomH=this.frozenRowsHeight+(((e=this.scrollbarDimensions)==null?void 0:e.height)||0)):(this.paneTopH=this.frozenRowsHeight,this.paneBottomH=this.viewportH-this.frozenRowsHeight):this.paneTopH=this.viewportH,this.paneTopH+=this.topPanelH+this.headerRowH+this.footerRowH,this.hasFrozenColumns()&&this._options.autoHeight&&(this.paneTopH+=((a=this.scrollbarDimensions)==null?void 0:a.height)||0),this.viewportTopH=this.paneTopH-this.topPanelH-this.headerRowH-this.footerRowH,this._options.autoHeight){if(this.hasFrozenColumns()){const t=getComputedStyle(this._headerScrollerL);y.height(this._container,this.paneTopH+y.toFloat(t.height))}this._paneTopL.style.position="relative"}y.setStyleSize(this._paneTopL,"top",y.height(this._paneHeaderL)||(this._options.showHeaderRow?this._options.headerRowHeight:0)+(this._options.showPreHeaderPanel?this._options.preHeaderPanelHeight:0)),y.height(this._paneTopL,this.paneTopH);const i=this._paneTopL.offsetTop+this.paneTopH;this._options.autoHeight||y.height(this._viewportTopL,this.viewportTopH),this.hasFrozenColumns()?(y.setStyleSize(this._paneTopR,"top",y.height(this._paneHeaderL)),y.height(this._paneTopR,this.paneTopH),y.height(this._viewportTopR,this.viewportTopH),this.hasFrozenRows&&(y.setStyleSize(this._paneBottomL,"top",i),y.height(this._paneBottomL,this.paneBottomH),y.setStyleSize(this._paneBottomR,"top",i),y.height(this._paneBottomR,this.paneBottomH),y.height(this._viewportBottomR,this.paneBottomH))):this.hasFrozenRows&&(y.width(this._paneBottomL,"100%"),y.height(this._paneBottomL,this.paneBottomH),y.setStyleSize(this._paneBottomL,"top",i)),this.hasFrozenRows?(y.height(this._viewportBottomL,this.paneBottomH),this._options.frozenBottom?(y.height(this._canvasBottomL,this.frozenRowsHeight),this.hasFrozenColumns()&&y.height(this._canvasBottomR,this.frozenRowsHeight)):(y.height(this._canvasTopL,this.frozenRowsHeight),this.hasFrozenColumns()&&y.height(this._canvasTopR,this.frozenRowsHeight))):y.height(this._viewportTopR,this.viewportTopH),(!this.scrollbarDimensions||!this.scrollbarDimensions.width)&&(this.scrollbarDimensions=this.measureScrollbar()),this._options.forceFitColumns&&this.legacyAutosizeColumns(),this.updateRowCount(),this.handleScroll(),this.lastRenderedScrollLeft=-1,this.render()}}updatePagingStatusFromView(u){this.pagingActive=u.pageSize!==0,this.pagingIsLastPage=u.pageNum===u.totalPages-1}updateRowCount(){var u,e;if(this.initialized){const a=this.getDataLength(),i=this.getDataLengthIncludingAddNew();let t=0,r=this.hasFrozenRows&&!this._options.frozenBottom?y.height(this._canvasBottomL):y.height(this._canvasTopL);this.hasFrozenRows?t=this.getDataLength()-this._options.frozenRow:t=i+(this._options.leaveSpaceForNewRows?this.numVisibleRows-1:0);const o=y.height(this._viewportScrollContainerY),s=this.viewportHasVScroll;this.viewportHasVScroll=this._options.alwaysShowVerticalScroll||!this._options.autoHeight&&t*this._options.rowHeight>o,this.makeActiveCellNormal();const l=a-1;typeof this.rowsCache=="object"&&Object.keys(this.rowsCache).forEach(d=>{const c=+d;c>l&&this.removeRowFromCache(c)}),this._options.enableAsyncPostRenderCleanup&&this.startPostProcessingCleanup(),this.activeCellNode&&this.activeRow>l&&this.resetActiveCell(),r=this.h,this._options.autoHeight?this.h=this._options.rowHeight*t:(this.th=Math.max(this._options.rowHeight*t,o-(((u=this.scrollbarDimensions)==null?void 0:u.height)||0)),this.th1&&(t=t.concat(Array.from(i[1].children)));let r=t.length-1;for(;e.cellRenderQueue.length;){const o=e.cellRenderQueue.pop();e.cellNodesByColumnIdx[o]=t[r--]}}}cleanUpCells(u,e){var o,s;if(this.hasFrozenRows&&(this._options.frozenBottom&&e>this.actualFrozenRow||e<=this.actualFrozenRow))return;const a=this.rowsCache[e],i=[];Object.keys(a.cellNodesByColumnIdx).forEach(l=>{var c;if(!a.cellNodesByColumnIdx.hasOwnProperty(l))return;const E=+l;if(E<=this._options.frozenColumn||Array.isArray(this.columns)&&((c=this.columns[E])!=null&&c.alwaysRenderColumn))return;const d=a.cellColSpans[E];(this.columnPosLeft[E]>u.rightPx||this.columnPosRight[Math.min(this.columns.length-1,(E||0)+d-1)]u.rightPx)break;if($u(r=e.cellColSpans[h])){h+=r>1?r-1:0;continue}if(r=1,D){const F=D[this.columns[h].id]||D[h];r=(F==null?void 0:F.colspan)??1,r==="*"&&(r=x-h)}const g=r;this.columnPosRight[Math.min(x-1,h+g-1)]>u.leftPx&&(this.appendCellHtml(a,d,h,g,m),t++),h+=g>1?g-1:0}t&&i.push(d)}if(!a.children.length)return;let o,s;for(;$u(o=i.pop());){e=this.rowsCache[o];let d;for(;$u(d=e.cellRenderQueue.pop());)s=a.lastChild,s&&(this.hasFrozenColumns()&&d>this._options.frozenColumn?e.rowNode[1].appendChild(s):e.rowNode[0].appendChild(s),e.cellNodesByColumnIdx[d]=s)}}renderRows(u){var l,E,d,c;const e=[],a=[],i=[];let t=!1;const r=this.getDataLength();for(let D=u.top,m=u.bottom;D<=m;D++)this.rowsCache[D]||this.hasFrozenRows&&this._options.frozenBottom&&D===this.getDataLength()||(this.renderedRows++,i.push(D),this.rowsCache[D]={rowNode:null,cellColSpans:[],cellNodesByColumnIdx:[],cellRenderQueue:[]},this.appendRowHtml(e,a,D,u,r),this.activeCellNode&&this.activeRow===D&&(t=!0),this.counter_rows_rendered++);if(!i.length)return;const o=document.createElement("div"),s=document.createElement("div");e.forEach(D=>o.appendChild(D)),a.forEach(D=>s.appendChild(D));for(let D=0,m=i.length;D=this.actualFrozenRow?this.hasFrozenColumns()?(l=this.rowsCache)!=null&&l.hasOwnProperty(i[D])&&o.firstChild&&s.firstChild&&(this.rowsCache[i[D]].rowNode=[o.firstChild,s.firstChild],this._canvasBottomL.appendChild(o.firstChild),this._canvasBottomR.appendChild(s.firstChild)):(E=this.rowsCache)!=null&&E.hasOwnProperty(i[D])&&o.firstChild&&(this.rowsCache[i[D]].rowNode=[o.firstChild],this._canvasBottomL.appendChild(o.firstChild)):this.hasFrozenColumns()?(d=this.rowsCache)!=null&&d.hasOwnProperty(i[D])&&o.firstChild&&s.firstChild&&(this.rowsCache[i[D]].rowNode=[o.firstChild,s.firstChild],this._canvasTopL.appendChild(o.firstChild),this._canvasTopR.appendChild(s.firstChild)):(c=this.rowsCache)!=null&&c.hasOwnProperty(i[D])&&o.firstChild&&(this.rowsCache[i[D]].rowNode=[o.firstChild],this._canvasTopL.appendChild(o.firstChild));t&&(this.activeCellNode=this.getCellNode(this.activeRow,this.activeCell))}startPostProcessing(){this._options.enableAsyncPostRender&&(clearTimeout(this.h_postrender),this.h_postrender=setTimeout(this.asyncPostProcessRows.bind(this),this._options.asyncPostRenderDelay))}startPostProcessingCleanup(){this._options.enableAsyncPostRenderCleanup&&(clearTimeout(this.h_postrenderCleanup),this.h_postrenderCleanup=setTimeout(this.asyncPostProcessCleanupRows.bind(this),this._options.asyncPostRenderCleanupDelay))}invalidatePostProcessingResults(u){typeof this.postProcessedRows[u]=="object"&&Object.keys(this.postProcessedRows[u]).forEach(e=>{this.postProcessedRows[u].hasOwnProperty(e)&&(this.postProcessedRows[u][e]="C")}),this.postProcessFromRow=Math.min(this.postProcessFromRow,u),this.postProcessToRow=Math.max(this.postProcessToRow,u),this.startPostProcessing()}updateRowPositions(){this.rowsCache&&typeof this.rowsCache=="object"&&Object.keys(this.rowsCache).forEach(u=>{const e=u?parseInt(u,10):0;y.setStyleSize(this.rowsCache[e].rowNode[0],"top",this.getRowTop(e))})}render(){if(this.initialized){this.scrollThrottle.dequeue();const u=this.getVisibleRange(),e=this.getRenderedRange();if(this.cleanupRows(e),this.lastRenderedScrollLeft!==this.scrollLeft){if(this.hasFrozenRows){const a=wu(!0,{},e);this._options.frozenBottom?(a.top=this.actualFrozenRow,a.bottom=this.getDataLength()):(a.top=0,a.bottom=this._options.frozenRow),this.cleanUpAndRenderCells(a)}this.cleanUpAndRenderCells(e)}this.renderRows(e),this.hasFrozenRows&&(this._options.frozenBottom?this.renderRows({top:this.actualFrozenRow,bottom:this.getDataLength()-1,leftPx:e.leftPx,rightPx:e.rightPx}):this.renderRows({top:0,bottom:this._options.frozenRow-1,leftPx:e.leftPx,rightPx:e.rightPx})),this.postProcessFromRow=u.top,this.postProcessToRow=Math.min(this.getDataLengthIncludingAddNew()-1,u.bottom),this.startPostProcessing(),this.lastRenderedScrollTop=this.scrollTop,this.lastRenderedScrollLeft=this.scrollLeft,this.h_render=null,this.triggerEvent(this.onRendered,{startRow:u.top,endRow:u.bottom,grid:this})}}handleHeaderRowScroll(){const u=this._headerRowScrollContainer.scrollLeft;u!==this._viewportScrollContainerX.scrollLeft&&(this._viewportScrollContainerX.scrollLeft=u)}handleFooterRowScroll(){const u=this._footerRowScrollContainer.scrollLeft;u!==this._viewportScrollContainerX.scrollLeft&&(this._viewportScrollContainerX.scrollLeft=u)}handlePreHeaderPanelScroll(){this.handleElementScroll(this._preHeaderPanelScroller)}handleElementScroll(u){const e=u.scrollLeft;e!==this._viewportScrollContainerX.scrollLeft&&(this._viewportScrollContainerX.scrollLeft=e)}handleScroll(){return this.scrollTop=this._viewportScrollContainerY.scrollTop,this.scrollLeft=this._viewportScrollContainerX.scrollLeft,this._handleScroll(!1)}_handleScroll(u){let e=this._viewportScrollContainerY.scrollHeight-this._viewportScrollContainerY.clientHeight,a=this._viewportScrollContainerY.scrollWidth-this._viewportScrollContainerY.clientWidth;e=Math.max(0,e),a=Math.max(0,a),this.scrollTop>e&&(this.scrollTop=e),this.scrollLeft>a&&(this.scrollLeft=a);const i=Math.abs(this.scrollTop-this.prevScrollTop),t=Math.abs(this.scrollLeft-this.prevScrollLeft);if(t&&(this.prevScrollLeft=this.scrollLeft,this._viewportScrollContainerX.scrollLeft=this.scrollLeft,this._headerScrollContainer.scrollLeft=this.scrollLeft,this._topPanelScrollers[0].scrollLeft=this.scrollLeft,this._options.createFooterRow&&(this._footerRowScrollContainer.scrollLeft=this.scrollLeft),this._options.createPreHeaderPanel&&(this.hasFrozenColumns()?this._preHeaderPanelScrollerR.scrollLeft=this.scrollLeft:this._preHeaderPanelScroller.scrollLeft=this.scrollLeft),this.hasFrozenColumns()?(this.hasFrozenRows&&(this._viewportTopR.scrollLeft=this.scrollLeft),this._headerRowScrollerR.scrollLeft=this.scrollLeft):(this.hasFrozenRows&&(this._viewportTopL.scrollLeft=this.scrollLeft),this._headerRowScrollerL.scrollLeft=this.scrollLeft)),i&&!this._options.autoHeight)if(this.vScrollDir=this.prevScrollTop20||o>20)&&(this._options.forceSyncScrolling||o{a?i=!0:o()},r=()=>{i=!1},o=()=>{a=!0,clearTimeout(this._executionBlockTimer),this._executionBlockTimer=setTimeout(s,e),u.call(this)},s=()=>{i?(r(),o()):a=!1};return{enqueue:t.bind(this),dequeue:r.bind(this)}}asyncPostProcessRows(){const u=this.getDataLength();for(;this.postProcessFromRow<=this.postProcessToRow;){const e=this.vScrollDir>=0?this.postProcessFromRow++:this.postProcessToRow--,a=this.rowsCache[e];if(!(!a||e>=u)){this.postProcessedRows[e]||(this.postProcessedRows[e]={}),this.ensureCellNodesInRowsCache(e),Object.keys(a.cellNodesByColumnIdx).forEach(i=>{if(a.cellNodesByColumnIdx.hasOwnProperty(i)){const t=+i,r=this.columns[t],o=this.postProcessedRows[e][t];if(r.asyncPostRender&&o!=="R"){const s=a.cellNodesByColumnIdx[t];s&&r.asyncPostRender(s,e,this.getDataItem(e),r,o==="C"),this.postProcessedRows[e][t]="R"}}}),this.h_postrender=setTimeout(this.asyncPostProcessRows.bind(this),this._options.asyncPostRenderDelay);return}}}asyncPostProcessCleanupRows(){if(this.postProcessedCleanupQueue.length>0){const u=this.postProcessedCleanupQueue[0].groupId;for(;this.postProcessedCleanupQueue.length>0&&this.postProcessedCleanupQueue[0].groupId===u;){const e=this.postProcessedCleanupQueue.shift();if((e==null?void 0:e.actionType)==="R"&&e.node.forEach(a=>{a.remove()}),(e==null?void 0:e.actionType)==="C"){const a=this.columns[e.columnIdx];a.asyncPostRenderCleanup&&e.node&&a.asyncPostRenderCleanup(e.node,e.rowIdx,a)}}this.h_postrenderCleanup=setTimeout(this.asyncPostProcessCleanupRows.bind(this),this._options.asyncPostRenderCleanupDelay)}}updateCellCssStylesOnRenderedRows(u,e){let a,i,t;typeof this.rowsCache=="object"&&Object.keys(this.rowsCache).forEach(r=>{this.rowsCache&&(t=e==null?void 0:e[r],i=u==null?void 0:u[r],t&&Object.keys(t).forEach(o=>{(!i||t[o]!==i[o])&&(a=this.getCellNode(+r,this.getColumnIndex(o)),a&&a.classList.remove(t[o]))}),i&&Object.keys(i).forEach(o=>{(!t||t[o]!==i[o])&&(a=this.getCellNode(+r,this.getColumnIndex(o)),a&&a.classList.add(i[o]))}))})}addCellCssStyles(u,e){if(this.cellCssClasses[u])throw new Error(`SlickGrid addCellCssStyles: cell CSS hash with key "${u}" already exists.`);this.cellCssClasses[u]=e,this.updateCellCssStylesOnRenderedRows(e,null),this.triggerEvent(this.onCellCssStylesChanged,{key:u,hash:e,grid:this})}removeCellCssStyles(u){this.cellCssClasses[u]&&(this.updateCellCssStylesOnRenderedRows(null,this.cellCssClasses[u]),delete this.cellCssClasses[u],this.triggerEvent(this.onCellCssStylesChanged,{key:u,hash:null,grid:this}))}setCellCssStyles(u,e){const a=this.cellCssClasses[u];this.cellCssClasses[u]=e,this.updateCellCssStylesOnRenderedRows(e,a),this.triggerEvent(this.onCellCssStylesChanged,{key:u,hash:e,grid:this})}getCellCssStyles(u){return this.cellCssClasses[u]}flashCell(u,e,a=250){const i=(t,r)=>{r<1||(clearTimeout(this._flashCellTimer),this._flashCellTimer=setTimeout(()=>{r%2===0?t.classList.add(this._options.cellFlashingCssClass||""):t.classList.remove(this._options.cellFlashingCssClass||""),i(t,r-1)},a))};if(this.rowsCache[u]){const t=this.getCellNode(u,e);t&&i(t,5)}}highlightRow(u,e){const a=this.rowsCache[u];e||(e=this._options.rowHighlightDuration),Array.isArray(a==null?void 0:a.rowNode)&&this._options.rowHighlightCssClass&&(a.rowNode.forEach(i=>i.classList.add(..._u(this._options.rowHighlightCssClass))),clearTimeout(this._highlightRowTimer),this._highlightRowTimer=setTimeout(()=>{var i;(i=a.rowNode)==null||i.forEach(t=>t.classList.remove(..._u(this._options.rowHighlightCssClass)))},e))}handleMouseWheel(u,e,a,i){this.scrollTop=Math.max(0,this._viewportScrollContainerY.scrollTop-i*this._options.rowHeight),this.scrollLeft=this._viewportScrollContainerX.scrollLeft+a*10,this._handleScroll(!0)&&u.preventDefault()}handleDragInit(u,e){const a=this.getCellFromEvent(u);if(!a||!this.cellExists(a.row,a.cell))return!1;const i=this.triggerEvent(this.onDragInit,e,u);return i.isImmediatePropagationStopped()?i.getReturnValue():!1}handleDragStart(u,e){const a=this.getCellFromEvent(u);if(!a||!this.cellExists(a.row,a.cell))return!1;const i=this.triggerEvent(this.onDragStart,e,u);return i.isImmediatePropagationStopped()?i.getReturnValue():!1}handleDrag(u,e){return this.triggerEvent(this.onDrag,e,u).getReturnValue()}handleDragEnd(u,e){this.triggerEvent(this.onDragEnd,e,u)}handleKeyDown(u){var i,t,r;let a=this.triggerEvent(this.onKeyDown,{row:this.activeRow,cell:this.activeCell},u).isImmediatePropagationStopped();if(!a&&!u.shiftKey&&!u.altKey){if(this._options.editable&&((i=this.currentEditor)!=null&&i.keyCaptureList)&&this.currentEditor.keyCaptureList.indexOf(u.which)>-1)return;u.key==="Home"?a=u.ctrlKey?this.navigateTop():this.navigateRowStart():u.key==="End"&&(a=u.ctrlKey?this.navigateBottom():this.navigateRowEnd())}if(!a)if(!u.shiftKey&&!u.altKey&&!u.ctrlKey)if(u.key==="Escape"){if(!((t=this.getEditorLock())!=null&&t.isActive()))return;this.cancelEditAndSetFocus()}else u.key==="PageDown"?(this.navigatePageDown(),a=!0):u.key==="PageUp"?(this.navigatePageUp(),a=!0):u.key==="ArrowLeft"?a=this.navigateLeft():u.key==="ArrowRight"?a=this.navigateRight():u.key==="ArrowUp"?a=this.navigateUp():u.key==="ArrowDown"?a=this.navigateDown():u.key==="Tab"?a=this.navigateNext():u.key==="Enter"&&(this._options.editable&&(this.currentEditor?this.activeRow===this.getDataLength()?this.navigateDown():this.commitEditAndSetFocus():(r=this.getEditorLock())!=null&&r.commitCurrentEdit()&&this.makeActiveCellEditable(void 0,void 0,u)),a=!0);else u.key==="Tab"&&u.shiftKey&&!u.ctrlKey&&!u.altKey&&(a=this.navigatePrev());a&&(u.stopPropagation(),u.preventDefault())}handleClick(u){var i,t,r;const e=u instanceof Pu?u.getNativeEvent():u;if(!this.currentEditor&&(e.target!==document.activeElement||e.target.classList.contains("slick-cell"))){const o=this.getTextSelection();this.setFocus(),this.setTextSelection(o)}const a=this.getCellFromEvent(e);if(!(!a||this.currentEditor!==null&&this.activeRow===a.row&&this.activeCell===a.cell)&&(u=this.triggerEvent(this.onClick,{row:a.row,cell:a.cell},u||e),!(u.isImmediatePropagationStopped()||e.defaultPrevented)&&this.canCellBeActive(a.row,a.cell)&&(!((i=this.getEditorLock())!=null&&i.isActive())||(t=this.getEditorLock())!=null&&t.commitCurrentEdit()))){this.scrollRowIntoView(a.row,!1);const o=((r=e.target)==null?void 0:r.className)===Lm,s=this.columns[a.cell],l=!!(this._options.editable&&(s!=null&&s.editorClass)&&this._options.suppressActiveCellChangeOnEdit);this.setActiveCellInternal(this.getCellNode(a.row,a.cell),null,o,l,e)}}handleContextMenu(u){const e=u.target.closest(".slick-cell");e&&(this.activeCellNode===e&&this.currentEditor!==null||this.triggerEvent(this.onContextMenu,{},u))}handleDblClick(u){const e=this.getCellFromEvent(u);!e||this.currentEditor!==null&&this.activeRow===e.row&&this.activeCell===e.cell||(this.triggerEvent(this.onDblClick,{row:e.row,cell:e.cell},u),!u.defaultPrevented&&this._options.editable&&this.gotoCell(e.row,e.cell,!0,u))}handleHeaderMouseEnter(u){const e=y.storage.get(u.target.closest(".slick-header-column"),"column");e&&this.triggerEvent(this.onHeaderMouseEnter,{column:e,grid:this},u)}handleHeaderMouseOver(u){const e=y.storage.get(u.target.closest(".slick-header-column"),"column");e&&this.triggerEvent(this.onHeaderMouseOver,{column:e,grid:this},u)}handleHeaderMouseLeave(u){const e=y.storage.get(u.target.closest(".slick-header-column"),"column");e&&this.triggerEvent(this.onHeaderMouseLeave,{column:e,grid:this},u)}handleHeaderMouseOut(u){const e=y.storage.get(u.target.closest(".slick-header-column"),"column");e&&this.triggerEvent(this.onHeaderMouseOut,{column:e,grid:this},u)}handleHeaderRowMouseEnter(u){const e=y.storage.get(u.target.closest(".slick-headerrow-column"),"column");e&&this.triggerEvent(this.onHeaderRowMouseEnter,{column:e,grid:this},u)}handleHeaderRowMouseOver(u){const e=y.storage.get(u.target.closest(".slick-headerrow-column"),"column");e&&this.triggerEvent(this.onHeaderRowMouseOver,{column:e,grid:this},u)}handleHeaderRowMouseLeave(u){const e=y.storage.get(u.target.closest(".slick-headerrow-column"),"column");e&&this.triggerEvent(this.onHeaderRowMouseLeave,{column:e,grid:this},u)}handleHeaderRowMouseOut(u){const e=y.storage.get(u.target.closest(".slick-headerrow-column"),"column");e&&this.triggerEvent(this.onHeaderRowMouseOut,{column:e,grid:this},u)}handleHeaderContextMenu(u){const e=u.target.closest(".slick-header-column"),a=e&&y.storage.get(e,"column");this.triggerEvent(this.onHeaderContextMenu,{column:a},u)}handleHeaderClick(u){if(this.columnResizeDragging)return;const e=u.target.closest(".slick-header-column"),a=e&&y.storage.get(e,"column");a&&this.triggerEvent(this.onHeaderClick,{column:a},u)}handleFooterContextMenu(u){const e=u.target.closest(".slick-footerrow-column"),a=e&&y.storage.get(e,"column");this.triggerEvent(this.onFooterContextMenu,{column:a},u)}handleFooterClick(u){const e=u.target.closest(".slick-footerrow-column"),a=e&&y.storage.get(e,"column");this.triggerEvent(this.onFooterClick,{column:a},u)}handleCellMouseOver(u){this.triggerEvent(this.onMouseEnter,{},u)}handleCellMouseOut(u){this.triggerEvent(this.onMouseLeave,{},u)}cellExists(u,e){return!(u<0||u>=this.getDataLength()||e<0||e>=this.columns.length)}getCellFromPoint(u,e){let a=this.getRowFromPosition(e),i=0,t=0;for(let r=0;r=this.actualFrozenRow?this.h=this.actualFrozenRow?e=this.frozenRowsHeight:e=0:e=0,e}getCellFromEvent(u){const e=u instanceof Pu?u.getNativeEvent():u;if(!e)return null;const a=e.touches?e.touches[0]:e,i=e.target.closest(".slick-cell");if(!i)return null;let t=this.getRowFromNode(i.parentNode);if(this.hasFrozenRows){let o=0;const s=Iu(y.parents(i,".grid-canvas")[0]);y.parents(i,".grid-canvas-bottom").length&&(o=this._options.frozenBottom?y.height(this._canvasTopL):this.frozenRowsHeight);const E=a.clientX-s.left,d=a.clientY-s.top+o+document.documentElement.scrollTop;t=this.getCellFromPoint(E,d).row}const r=this.getCellFromNode(i);return!ta(t)||!ta(r)?null:{row:t,cell:r}}getCellNodeBox(u,e){var s;if(!this.cellExists(u,e))return null;const a=this.getFrozenRowOffset(u),i=this.getRowTop(u)-a,t=i+this._options.rowHeight-1;let r=0;for(let l=0;l1?i-1:0)])}internalScrollColumnIntoView(u,e){var i;const a=this.scrollLeft+y.width(this._viewportScrollContainerX)-(this.viewportHasVScroll&&((i=this.scrollbarDimensions)==null?void 0:i.width)||0);ua&&(this._viewportScrollContainerX.scrollLeft=Math.min(u,e-this._viewportScrollContainerX.clientWidth),this.handleScroll(),this.render())}scrollColumnIntoView(u){this.internalScrollColumnIntoView(this.columnPosLeft[u],this.columnPosRight[u])}setActiveCellInternal(u,e,a,i,t){var r,o,s,l;if($u(this.activeCellNode)&&(this.makeActiveCellNormal(),this.activeCellNode.classList.remove("active"),(o=(r=this.rowsCache[this.activeRow])==null?void 0:r.rowNode)==null||o.forEach(E=>E.classList.remove("active"))),this.activeCellNode=u,$u(this.activeCellNode)){const E=Iu(this.activeCellNode);let d=Math.floor(Iu(y.parents(this.activeCellNode,".grid-canvas")[0]).top);const c=y.parents(this.activeCellNode,".grid-canvas-bottom").length;this.hasFrozenRows&&c&&(d-=this._options.frozenBottom?y.height(this._canvasTopL):this.frozenRowsHeight);const D=this.getCellFromPoint(E.left,Math.ceil(E.top)-d);this.activeRow=D.row,this.activeCell=this.activePosX=this.activeCell=this.activePosX=this.getCellFromNode(this.activeCellNode),!$u(e)&&this._options.autoEditNewRow&&(e=this.activeRow===this.getDataLength()||this._options.autoEdit),this._options.showCellSelection&&(this.activeCellNode.classList.add("active"),(l=(s=this.rowsCache[this.activeRow])==null?void 0:s.rowNode)==null||l.forEach(m=>m.classList.add("active"))),this._options.editable&&e&&this.isCellPotentiallyEditable(this.activeRow,this.activeCell)&&(this._options.asyncEditorLoading?(clearTimeout(this.h_editorLoader),this.h_editorLoader=setTimeout(()=>{this.makeActiveCellEditable(void 0,a,t)},this._options.asyncEditorLoadDelay)):this.makeActiveCellEditable(void 0,a,t))}else this.activeRow=this.activeCell=null;i||this.triggerEvent(this.onActiveCellChanged,this.getActiveCell())}clearTextSelection(){var u;if((u=document.selection)!=null&&u.empty)try{document.selection.empty()}catch{}else if(window.getSelection){const e=window.getSelection();e!=null&&e.removeAllRanges&&e.removeAllRanges()}}isCellPotentiallyEditable(u,e){const a=this.getDataLength();return!(u=a||!this.columns[e]||this.columns[e].hidden||!this.getEditor(u,e))}makeActiveCellNormal(u=!1){var e;if(this.currentEditor){if(this.triggerEvent(this.onBeforeCellEditorDestroy,{editor:this.currentEditor}),this.currentEditor.destroy(),this.currentEditor=null,this.activeCellNode){const a=this.getDataItem(this.activeRow);if(this.activeCellNode.classList.remove("editable"),this.activeCellNode.classList.remove("invalid"),a){const i=this.columns[this.activeCell],r=this.getFormatter(this.activeRow,i)(this.activeRow,this.activeCell,this.getDataItemValueForColumn(a,i),i,a,this);this.applyFormatResultToCellNode(r,this.activeCellNode),this.invalidatePostProcessingResults(this.activeRow)}u&&this.setFocus()}navigator.userAgent.toLowerCase().match(/msie/)&&this.clearTextSelection(),(e=this.getEditorLock())==null||e.deactivate(this.editController)}}editActiveCell(u,e,a){this.makeActiveCellEditable(u,e,a)}makeActiveCellEditable(u,e,a){var o,s,l,E,d,c;if(!this.activeCellNode)return;if(!this._options.editable)throw new Error("SlickGrid makeActiveCellEditable : should never get called when grid options.editable is false");if(clearTimeout(this.h_editorLoader),!this.isCellPotentiallyEditable(this.activeRow,this.activeCell))return;const i=this.columns[this.activeCell],t=this.getDataItem(this.activeRow);if(this.triggerEvent(this.onBeforeEditCell,{row:this.activeRow,cell:this.activeCell,item:t,column:i,target:"grid"}).getReturnValue()===!1){this.setFocus();return}(o=this.getEditorLock())==null||o.activate(this.editController),this.activeCellNode.classList.add("editable");const r=u||this.getEditor(this.activeRow,this.activeCell);if(typeof r=="function"){!u&&!r.suppressClearOnEdit&&bu(this.activeCellNode);let D=(l=(s=this.data)==null?void 0:s.getItemMetadata)==null?void 0:l.call(s,this.activeRow);D=D==null?void 0:D.columns;const m=D&&(D[i.id]||D[this.activeCell]),h={grid:this,gridPosition:this.absBox(this._container),position:this.absBox(this.activeCellNode),container:this.activeCellNode,column:i,columnMetaData:m,item:t||{},event:a,commitChanges:this.commitEditAndSetFocus.bind(this),cancelChanges:this.cancelEditAndSetFocus.bind(this)};this.currentEditor=new r(h),t&&this.currentEditor&&(this.currentEditor.loadValue(t),e&&typeof((E=this.currentEditor)==null?void 0:E.preClick)=="function"&&this.currentEditor.preClick()),this.serializedEditorValue=(d=this.currentEditor)==null?void 0:d.serializeValue(),(c=this.currentEditor)!=null&&c.position&&this.handleActiveCellPositionChange()}}commitEditAndSetFocus(){var u;(u=this.getEditorLock())!=null&&u.commitCurrentEdit()&&(this.setFocus(),this._options.autoEdit&&!this._options.autoCommitEdit&&this.navigateDown())}cancelEditAndSetFocus(){var u;(u=this.getEditorLock())!=null&&u.cancelCurrentEdit()&&this.setFocus()}absBox(u){const e={top:u.offsetTop,left:u.offsetLeft,bottom:0,right:0,width:u.offsetWidth,height:u.offsetWidth,visible:!0};e.bottom=e.top+e.height,e.right=e.left+e.width;let a=u.offsetParent;for(;(u=u.parentNode)!==document.body&&!(!u||!u.parentNode);){const i=getComputedStyle(u);e.visible&&u.scrollHeight!==u.offsetHeight&&i.overflowY!=="visible"&&(e.visible=e.bottom>u.scrollTop&&e.topu.scrollLeft&&e.left0&&(u=e.getRangeAt(0))}return u}setTextSelection(u){if(window.getSelection&&u){const e=window.getSelection();e&&(e.removeAllRanges(),e.addRange(u))}}scrollRowIntoView(u,e){var a;if(!this.hasFrozenRows||!this._options.frozenBottom&&u>this.actualFrozenRow-1||this._options.frozenBottom&&uthis.scrollTop+i+this.offset?(this.scrollTo(e?r:o),this.render()):t*this._options.rowHeight=t&&(i=t-1),i<0&&(i=0);let r=0,o=null;const s=this.activePosX;for(;r<=this.activePosX;)this.canCellBeActive(i,r)&&(o=r),r+=this.getColspan(i,r);o!==null?(this.setActiveCellInternal(this.getCellNode(i,o)),this.activePosX=s):this.resetActiveCell()}}navigatePageDown(){this.scrollPage(1)}navigatePageUp(){this.scrollPage(-1)}navigateTop(){this.navigateToRow(0)}navigateBottom(){return this.navigateToRow(this.getDataLength()-1)}navigateToRow(u){const e=this.getDataLength();if(!e)return!0;if(u<0?u=0:u>=e&&(u=e-1),this.scrollCellIntoView(u,0,!0),this._options.enableCellNavigation&&$u(this.activeRow)){let a=0,i=null;const t=this.activePosX;for(;a<=this.activePosX;)this.canCellBeActive(u,a)&&(i=a),a+=this.getColspan(u,a);i!==null?(this.setActiveCellInternal(this.getCellNode(u,i)),this.activePosX=t):this.resetActiveCell()}return!0}getColspan(u,e){var r,o;const a=(o=(r=this.data)==null?void 0:r.getItemMetadata)==null?void 0:o.call(r,u);if(!a||!a.columns)return 1;const i=a.columns[this.columns[e].id]||a.columns[e];let t=i==null?void 0:i.colspan;return t==="*"?t=this.columns.length-e:t=t||1,t}findFirstFocusableCell(u){let e=0;for(;e=this.columns.length)return null;do e+=this.getColspan(u,e);while(e=e)return null;let t={row:u,cell:i,posX:i},r,o=!0;for(;o;){if(r=this.gotoRight(t.row,t.cell,t.posX),!r)return o=!1,null;if(r.cell>=e)return o=!1,t;t=r}}gotoDown(u,e,a){let i;const t=this.getDataLengthIncludingAddNew();let r=!0;for(;r;){if(++u>=t)return r=!1,null;for(i=e=0;e<=a;)i=e,e+=this.getColspan(u,e);if(this.canCellBeActive(u,i))return r=!1,{row:u,cell:i,posX:a}}}gotoUp(u,e,a){let i,t=!0;for(;t;){if(--u<0)return t=!1,null;for(i=e=0;e<=a;)i=e,e+=this.getColspan(u,e);if(this.canCellBeActive(u,i))return t=!1,{row:u,cell:i,posX:a}}}gotoNext(u,e,a){if(!ta(u)&&!ta(e)&&(u=e=a=0,this.canCellBeActive(u,e)))return{row:u,cell:e,posX:e};const i=this.gotoRight(u,e,a);if(i)return i;let t=null;const r=this.getDataLengthIncludingAddNew();for(u===r-1&&u--;++u=this.actualFrozenRow||this._options.frozenBottom&&t.rowe?this.rowsCache[u].cellNodesByColumnIdx[e]:null}catch{return this.rowsCache[u].cellNodesByColumnIdx[e]}}return null}setActiveCell(u,e,a,i,t){!this.initialized||!this._options.enableCellNavigation||u>this.getDataLength()||u<0||e>=this.columns.length||e<0||(this.scrollCellIntoView(u,e,!1),this.setActiveCellInternal(this.getCellNode(u,e),a,i,t))}setActiveRow(u,e,a){e??(e=0),!(!this.initialized||u>this.getDataLength()||u<0||e>=this.columns.length||e<0)&&(this.activeRow=u,a||this.scrollCellIntoView(u,e,!1))}canCellBeActive(u,e){var t,r,o,s;if(!this._options.enableCellNavigation||u>=this.getDataLengthIncludingAddNew()||u<0||e>=this.columns.length||e<0||!this.columns[e]||this.columns[e].hidden)return!1;const a=(r=(t=this.data)==null?void 0:t.getItemMetadata)==null?void 0:r.call(t,u);if((a==null?void 0:a.focusable)!==void 0)return!!a.focusable;const i=a==null?void 0:a.columns;return((o=i==null?void 0:i[this.columns[e].id])==null?void 0:o.focusable)!==void 0?!!i[this.columns[e].id].focusable:((s=i==null?void 0:i[e])==null?void 0:s.focusable)!==void 0?!!i[e].focusable:!!this.columns[e].focusable}canCellBeSelected(u,e){var t,r;if(u>=this.getDataLength()||u<0||e>=this.columns.length||e<0||!this.columns[e]||this.columns[e].hidden)return!1;const a=(r=(t=this.data)==null?void 0:t.getItemMetadata)==null?void 0:r.call(t,u);if((a==null?void 0:a.selectable)!==void 0)return!!a.selectable;const i=(a==null?void 0:a.columns)&&(a.columns[this.columns[e].id]||a.columns[e]);return(i==null?void 0:i.selectable)!==void 0?!!i.selectable:!!this.columns[e].selectable}gotoCell(u,e,a,i){var s;if(!this.initialized||!this.canCellBeActive(u,e)||!((s=this.getEditorLock())!=null&&s.commitCurrentEdit()))return;this.scrollCellIntoView(u,e,!1);const t=this.getCellNode(u,e),r=this.columns[e],o=!!(this._options.editable&&(r!=null&&r.editorClass)&&this._options.suppressActiveCellChangeOnEdit);this.setActiveCellInternal(t,a||u===this.getDataLength()||this._options.autoEdit,null,o,i),this.currentEditor||this.setFocus()}commitCurrentEdit(){var i;const u=this,e=u.getDataItem(u.activeRow),a=u.columns[u.activeCell];if(u.currentEditor){if(u.currentEditor.isValueChanged()){const t=u.currentEditor.validate();if(t.valid){const r=u.activeRow,o=u.activeCell,s=u.currentEditor,l=u.currentEditor.serializeValue(),E=u.serializedEditorValue;if(u.activeRow{s.applyValue(e,l),u.updateRow(r),u.triggerEvent(u.onCellChange,{command:"execute",row:r,cell:o,item:e,column:a})},undo:()=>{s.applyValue(e,E),u.updateRow(r),u.triggerEvent(u.onCellChange,{command:"undo",row:r,cell:o,item:e,column:a})}};u._options.editCommandHandler?(u.makeActiveCellNormal(!0),u._options.editCommandHandler(e,a,d)):(d.execute(),u.makeActiveCellNormal(!0))}else{const d={};u.currentEditor.applyValue(d,u.currentEditor.serializeValue()),u.makeActiveCellNormal(!0),u.triggerEvent(u.onAddNewRow,{item:d,column:a})}return!((i=u.getEditorLock())!=null&&i.isActive())}else return u.activeCellNode&&(u.activeCellNode.classList.remove("invalid"),y.width(u.activeCellNode),u.activeCellNode.classList.add("invalid")),u.triggerEvent(u.onValidationError,{editor:u.currentEditor,cellNode:u.activeCellNode,validationResults:t,row:u.activeRow,cell:u.activeCell,column:a}),u.currentEditor.focus(),!1}u.makeActiveCellNormal(!0)}return!0}cancelCurrentEdit(){return this.makeActiveCellNormal(),!0}rowsToRanges(u){const e=[],a=this.columns.length-1;for(let i=0;i((r=this._addonOptions)==null?void 0:r.maxToolTipLength)&&(s=s.substring(0,this._addonOptions.maxToolTipLength-3)+"...")):s="",o.title=s),o=null}}handleHeaderMouseEnter(u,e){const a=e.column;let i;const t=u.target;if(t&&(i=t.closest(".slick-header-column"),i&&!(a!=null&&a.toolTip))){const r=t.clientWidth{this._addonOptions&&typeof this._addonOptions.onCopyCells=="function"&&this._addonOptions.onCopyCells(a,i)}),this._eventHandler.subscribe(this._cellExternalCopyManagerPlugin.onCopyCancelled,(a,i)=>{this._addonOptions&&typeof this._addonOptions.onCopyCancelled=="function"&&this._addonOptions.onCopyCancelled(a,i)}),this._eventHandler.subscribe(this._cellExternalCopyManagerPlugin.onPasteCells,(a,i)=>{this._addonOptions&&typeof this._addonOptions.onPasteCells=="function"&&this._addonOptions.onPasteCells(a,i)})}dispose(){var u,e;this._eventHandler.unsubscribeAll(),this._bindingEventService.unbindAll(),(u=this._cellSelectionModel)==null||u.dispose(),(e=this._cellExternalCopyManagerPlugin)==null||e.dispose()}createUndoRedoBuffer(){let u=0;this._commandQueue=[],this._undoRedoBuffer={queueAndExecuteCommand:e=>{this._commandQueue[u]=e,u++,e.execute()},undo:()=>{if(u===0)return;u--;const e=this._commandQueue[u];e&&Y0.cancelCurrentEdit()&&e.undo()},redo:()=>{if(u>=this._commandQueue.length)return;const e=this._commandQueue[u];u++,e&&Y0.cancelCurrentEdit()&&e.execute()}}}getDefaultOptions(){let u=0;return{clipboardCommandHandler:e=>{this._undoRedoBuffer.queueAndExecuteCommand.call(this._undoRedoBuffer,e)},dataItemColumnValueExtractor:(e,a,i=0,t=0)=>{var s,l;const r=this._grid.getActiveCell(),o=this._grid.getCellEditor()&&(r==null?void 0:r.row)===i&&(r==null?void 0:r.cell)===t;if(!this.gridOptions.editable||!a.editor||!o){const E=a.exportWithFormatter!==void 0?a.exportWithFormatter:(s=this.gridOptions.textExportOptions)==null?void 0:s.exportWithFormatter;if(a.formatter&&E){const d=a.formatter(i,t,e[a.field],a,e,this._grid),c=Da(d)?d:d.html||d.text;if(a.sanitizeDataExport||(l=this.gridOptions.textExportOptions)!=null&&l.sanitizeDataExport){const D=c instanceof HTMLElement?c.innerHTML:c;return Wu(D??"")}return d}}return null},readOnlyMode:!1,includeHeaderWhenCopying:!1,newRowCreator:e=>{for(let a=0;a{};class mh{constructor(){this.pluginName="CellExternalCopyManager",this.onCopyCells=new R("onCopyCells"),this.onCopyCancelled=new R("onCopyCancelled"),this.onPasteCells=new R("onPasteCells"),this.onBeforePasteCell=new R("onBeforePasteCell"),this._bodyElement=document.body,this._copiedCellStyle="copied",this._copiedCellStyleLayerKey="copy-manager",this._copiedRanges=null,this._eventHandler=new Tu}get addonOptions(){return this._addonOptions}get eventHandler(){return this._eventHandler}init(u,e){var t;this._grid=u,this._addonOptions={...this._addonOptions,...e},this._copiedCellStyleLayerKey=this._addonOptions.copiedCellStyleLayerKey||"copy-manager",this._copiedCellStyle=this._addonOptions.copiedCellStyle||"copied",this._bodyElement=this._addonOptions.bodyElement||document.body,this._onCopyInit=this._addonOptions.onCopyInit||void 0,this._onCopySuccess=this._addonOptions.onCopySuccess||void 0;const a=u.getPubSubService();a&&y.addSlickEventPubSubWhenDefined(a,this),this._eventHandler.subscribe(this._grid.onKeyDown,this.handleKeyDown.bind(this));const i=u.getSelectionModel();if(!i)throw new Error("Selection model is mandatory for this plugin. Please set a selection model on the grid before adding this plugin: grid.setSelectionModel(new SlickCellSelectionModel())");if(this._eventHandler.subscribe(i.onSelectedRangesChanged,()=>{this._grid.getEditorLock().isActive()||this._grid.focus()}),u&&typeof((t=this._addonOptions)==null?void 0:t.onBeforePasteCell)=="function"){const r=u==null?void 0:u.getData();this._eventHandler.subscribe(this.onBeforePasteCell,(o,s)=>{var d,c;const l=u.getColumns()[s.cell],E={row:s.row,cell:s.cell,dataView:r,grid:u,columnDef:l,dataContext:u.getDataItem(s.row)};return(c=(d=this._addonOptions).onBeforePasteCell)==null?void 0:c.call(d,o,E)})}}dispose(){this._eventHandler.unsubscribeAll()}clearCopySelection(){this._grid.removeCellCssStyles(this._copiedCellStyleLayerKey)}getHeaderValueForColumn(u){if(typeof this._addonOptions.headerColumnValueExtractor=="function"){const e=E0(this._addonOptions.headerColumnValueExtractor(u),"innerHTML");if(e)return Wu(e)}return E0(u.name||"","innerHTML")}getDataItemValueForColumn(u,e,a,i,t){if(typeof this._addonOptions.dataItemColumnValueExtractor=="function"){const o=this._addonOptions.dataItemColumnValueExtractor(u,e,a,i);if(o)return o instanceof HTMLElement?Wu(o.innerHTML):o}let r="";if(e)if(e.editorClass){const o=document.createElement("p"),s=new e.editorClass({container:o,column:e,event:t,position:{top:0,left:0},gridPosition:{top:0,left:0},grid:this._grid,cancelChanges:Ki,commitChanges:Ki});s.loadValue(u),r=s.serializeValue(),s.destroy(),o.remove()}else r=u[e.field||""];return r}setDataItemValueForColumn(u,e,a){if(!(e!=null&&e.denyPaste)){if(this._addonOptions.dataItemColumnValueSetter)return this._addonOptions.dataItemColumnValueSetter(u,e,a);if(e.editorClass){const i=document.createElement("div"),t=new e.editorClass({container:i,column:e,event:null,position:{top:0,left:0},gridPosition:{top:0,left:0},grid:this._grid,cancelChanges:Ki,commitChanges:Ki});t.loadValue(u);const r=t.validate(void 0,a);if(!r.valid){const o=this._grid.getActiveCell();this._grid.onValidationError.notify({editor:t,cellNode:this._grid.getActiveCellNode(),validationResults:r,row:o==null?void 0:o.row,cell:o==null?void 0:o.cell,column:e,grid:this._grid})}t.applyValue(u,a),t.destroy(),i.remove()}else u[e.field]=a}}setIncludeHeaderWhenCopying(u){this._addonOptions.includeHeaderWhenCopying=u}createTextBox(u){const e=v("textarea",{value:u,style:{position:"absolute",left:"-1000px",top:`${document.body.scrollTop}px`}},this._bodyElement);return e.select(),e}decodeTabularData(u,e){var A;const a=u.getColumns(),t=e.value.split(/[\n\f\r]/);t[t.length-1]===""&&t.pop();let r=0;const o=[];this._bodyElement.removeChild(e);for(const b of t)o[r++]=b!==""?b.split(" "):[""];const s=this._grid.getActiveCell(),l=(A=this._grid.getSelectionModel())==null?void 0:A.getSelectedRanges(),E=l!=null&&l.length?l[0]:null;let d,c;if(E)d=E.fromRow,c=E.fromCell;else if(s)d=s.row,c=s.cell;else return;let D=!1,m=o.length,h=o.length?o[0].length:0;o.length===1&&o[0].length===1&&E&&(D=!0,m=E.toRow-E.fromRow+1,h=E.toCell-E.fromCell+1);const x=this._grid.getData().length-d;let g=0;if(xthis._grid.getDataLength()&&typeof this._addonOptions.newRowCreator=="function"){const b=d+m-this._grid.getDataLength();this._addonOptions.newRowCreator(b)}const C={isClipboardCommand:!0,clippedRange:o,oldValues:[],cellExternalCopyManager:this,_options:this._addonOptions,setDataItemValueForColumn:this.setDataItemValueForColumn,markCopySelection:this.markCopySelection,oneCellToMultiple:D,activeRow:d,activeCell:c,destH:m,destW:h,maxDestY:this._grid.getDataLength(),maxDestX:this._grid.getColumns().length,h:0,w:0,execute:()=>{var B;C.h=0;for(let S=0;S{var B;for(let S=0;S1){const S=this._grid.getData();for(;g>1;g--)S.splice(S.length-1,1);this._grid.setData(S),this._grid.render()}}};this._addonOptions.clipboardCommandHandler?this._addonOptions.clipboardCommandHandler(C):C.execute()}handleKeyDown(u){var a,i,t;let e;if(!this._grid.getEditorLock().isActive()||this._grid.getOptions().autoEdit){if(u.key==="Escape"&&this._copiedRanges&&(u.preventDefault(),this.clearCopySelection(),this.onCopyCancelled.notify({ranges:this._copiedRanges}),typeof this._addonOptions.onCopyCancelled=="function"&&this._addonOptions.onCopyCancelled(u,{ranges:this._copiedRanges}),this._copiedRanges=null),(u.key==="c"||u.key==="Insert")&&(u.ctrlKey||u.metaKey)&&!u.shiftKey&&(typeof this._onCopyInit=="function"&&this._onCopyInit.call(this),e=((a=this._grid.getSelectionModel())==null?void 0:a.getSelectedRanges())??[],e.length!==0)){this._copiedRanges=e,this.markCopySelection(e),this.onCopyCells.notify({ranges:e}),typeof this._addonOptions.onCopyCells=="function"&&this._addonOptions.onCopyCells(u,{ranges:e});const r=this._grid.getColumns();let o="";for(let s=0;s0&&!r[h].hidden&&m.push(this.getHeaderValueForColumn(r[h]));E.push(m.join(" "))}for(let m=l.fromCell;m0&&!r[m].hidden&&c.push(this.getDataItemValueForColumn(D,r[m],d,m,u));E.push(c.join(" "))}o+=E.join(`\r
`)+`\r
-`}if(window.clipboardData)return window.clipboardData.setData("Text",o),!0;{const s=document.activeElement,l=this.createTextBox(o);if(l.focus(),setTimeout(()=>{this._bodyElement.removeChild(l),s?s.focus():console.log("No element to restore focus to after copy?")},((i=this.addonOptions)==null?void 0:i.clipboardPasteDelay)??zs),typeof this._onCopySuccess=="function"){const E=e.length===1?e[0].toRow+1-e[0].fromRow:e.length;this._onCopySuccess(E)}return!1}}if(!this._addonOptions.readOnlyMode&&(u.key==="v"&&(u.ctrlKey||u.metaKey)&&!u.shiftKey||u.key==="Insert"&&u.shiftKey&&!u.ctrlKey)){const r=this.createTextBox("");return setTimeout(()=>this.decodeTabularData(this._grid,r),((t=this.addonOptions)==null?void 0:t.clipboardPasteDelay)??zs),!1}}}markCopySelection(u){var i;this.clearCopySelection();const e=this._grid.getColumns(),a={};for(const t of u)for(let r=t.fromRow;r<=t.toRow;r++){a[r]={};for(let o=t.fromCell;o<=t.toCell&&othis.clearCopySelection(),((i=this.addonOptions)==null?void 0:i.clearCopySelectionDelay)||dh)}}class qt{constructor(u,e,a){this.extensionUtility=u,this.pubSubService=e,this.sharedService=a,this._addonOptions={},this._camelPluginName="",this._gridUid="",this._menuCssPrefix="",this._menuPluginCssPrefix="",this._bindEventService=new vu,this._eventHandler=new Tu}get addonOptions(){return this._addonOptions}set addonOptions(u){this._addonOptions=u}get eventHandler(){return this._eventHandler}get grid(){return this.sharedService.slickGrid}get gridOptions(){return this.sharedService.gridOptions??{}}get gridUid(){var u;return this._gridUid||(((u=this.grid)==null?void 0:u.getUID())??"")}get gridUidSelector(){return this.gridUid?`.${this.gridUid}`:""}get menuCssClass(){return this._menuPluginCssPrefix||this._menuCssPrefix}get menuElement(){return this._menuElm||document.querySelector(`.${this.menuCssClass}${this.gridUidSelector}`)}dispose(){var u,e,a,i,t;(u=this._eventHandler)==null||u.unsubscribeAll(),this._bindEventService.unbindAll(),this.pubSubService.unsubscribeAll(),(e=this._commandTitleElm)==null||e.remove(),(a=this._optionTitleElm)==null||a.remove(),this.disposeAllMenus(),bu(this._menuElm),(i=this.menuElement)==null||i.remove(),(t=this._menuElm)==null||t.remove()}disposeAllMenus(){this.disposeSubMenus(),this._bindEventService.unbindAll("parent-menu"),document.querySelectorAll(`.${this.menuCssClass}${this.gridUidSelector}`).forEach(u=>u.remove())}disposeSubMenus(){this._bindEventService.unbindAll("sub-menu"),document.querySelectorAll(`.${this.menuCssClass}.slick-submenu${this.gridUidSelector}`).forEach(u=>u.remove())}setOptions(u){this._addonOptions={...this._addonOptions,...u}}addSubMenuTitleWhenExists(u,e){if(u!=="divider"&&(u!=null&&u.subMenuTitle)){const a=document.createElement("div");a.className="slick-menu-title",a.textContent=u.subMenuTitle;const i=u.subMenuTitleCssClass;i&&a.classList.add(..._u(i)),e.appendChild(a)}}populateCommandOrOptionItems(u,e,a,i,t,r,o){if(t&&i&&e)for(const s of i)this.populateSingleCommandOrOptionItem(u,e,a,s,t,r,o)}populateCommandOrOptionTitle(u,e,a,i){var t;if(e){const r=i>0,o=((t=this._menuElm)==null?void 0:t.querySelector(`.slick-${u}-header`))??v("div",{className:`slick-${u}-header`}),s=`${u}Title`;r||(e!=null&&e[s]?(bu(o),this[`_${u}TitleElm`]=v("span",{className:"slick-menu-title",textContent:e[s]}),o.appendChild(this[`_${u}TitleElm`]),o.classList.add("with-title")):o.classList.add("no-title"),a.appendChild(o))}}populateSingleCommandOrOptionItem(u,e,a,i,t,r,o){var l;let s=null;if(t&&i&&e){const E=(t==null?void 0:t.level)||0,d=this._camelPluginName==="headerButtons"?"":"-item",c=`${this._menuCssPrefix}${d}`;let D=!0,m=!0;if(typeof i=="object"&&(D=this.extensionUtility.runOverrideFunctionWhenExists(i.itemVisibilityOverride,t),m=this.extensionUtility.runOverrideFunctionWhenExists(i.itemUsabilityOverride,t)),!D)return null;if(typeof i=="object"&&i.itemUsabilityOverride&&(i.disabled=!m),s=v("li",{className:c,role:"menuitem"}),typeof i=="object"&&Jt(i[u])&&(s.dataset[u]=i==null?void 0:i[u]),a&&a.appendChild(s),typeof i=="object"&&i.divider||i==="divider")return s.classList.add(`${c}-divider`),s;if(i.disabled&&s.classList.add(`${c}-disabled`),(i.hidden||i.showOnHover)&&s.classList.add(`${c}-hidden`),i.cssClass&&s.classList.add(..._u(i.cssClass)),i.tooltip&&(s.title=i.tooltip),this._camelPluginName!=="headerButtons"){const x=v("div",{className:`${this._menuCssPrefix}-icon`});s.appendChild(x),i.iconCssClass?x.classList.add(..._u(i.iconCssClass)):!i.commandItems&&!i.optionItems&&(x.textContent="◦");const g=v("span",{className:`${this._menuCssPrefix}-content`,textContent:typeof i=="object"&&i.title||""},s);i.textCssClass&&g.classList.add(..._u(i.textCssClass))}const h=E>0?"sub-menu":"parent-menu";if(this._bindEventService.bind(s,"click",x=>r.call(this,x,u,i,E,t==null?void 0:t.column),void 0,h),((l=this._addonOptions)==null?void 0:l.subMenuOpenByEvent)==="mouseover"&&typeof o=="function"&&this._bindEventService.bind(s,"mouseover",x=>o.call(this,x,u,i,E),void 0,h),i.commandItems||i.optionItems){const x=document.createElement("span");x.className="sub-item-chevron",this._addonOptions.subItemChevronClass?x.classList.add(..._u(this._addonOptions.subItemChevronClass)):x.textContent="⮞",s.classList.add("slick-submenu-item"),s.appendChild(x)}}return s}}class O1 extends qt{constructor(u,e,a){super(u,e,a),this.extensionUtility=u,this.pubSubService=e,this.sharedService=a,this._currentCell=-1,this._currentRow=-1,this._lastMenuTypeClicked="",this._subMenuParentId=""}createParentMenu(u){var a,i,t,r,o;(a=this.menuElement)==null||a.remove(),this._menuElm=void 0;const e=this.grid.getCellFromEvent(u);if(e){this._currentCell=e.cell??0,this._currentRow=e.row??0;const s=((i=this._addonOptions)==null?void 0:i.commandItems)||[],l=((t=this._addonOptions)==null?void 0:t.optionItems)||[],E={cell:this._currentCell,row:this._currentRow,grid:this.grid};if(this.closeMenu(u,E),typeof u.stopPropagation=="function"&&(this.pubSubService.publish(`on${N0(this._camelPluginName)}BeforeMenuShow`,E),typeof((r=this.addonOptions)==null?void 0:r.onBeforeMenuShow)=="function"&&this.addonOptions.onBeforeMenuShow(u,E)===!1)||(this._menuElm=this.createMenu(s,l),this._menuElm&&(this._menuElm.style.top=`${(u.pageY||0)+5}px`,this._menuElm.style.left=`${u.pageX}px`,this._menuElm.style.display="block",document.body.appendChild(this._menuElm)),this.pubSubService.publish(`on${N0(this._camelPluginName)}AfterMenuShow`,E),typeof((o=this.addonOptions)==null?void 0:o.onAfterMenuShow)=="function"&&this.addonOptions.onAfterMenuShow(u,E)===!1))return}return this._menuElm}createMenu(u,e,a=0,i){var g,F,C,A,b;const t=this.grid.getColumns()[this._currentCell],r=this.grid.getDataItem(this._currentRow),o=(i==null?void 0:i.command)||(i==null?void 0:i.option);let s=a===1&&o?String(o).replace(/\s/g,""):"";s&&(this._subMenuParentId=s),a>1&&(s=this._subMenuParentId);let l=!0,E=!0;if(this._camelPluginName==="contextMenu"){if(l=this.checkIsColumnAllowed(((g=this._addonOptions)==null?void 0:g.optionShownOverColumnIds)??[],t.id),E=this.checkIsColumnAllowed(((F=this._addonOptions)==null?void 0:F.commandShownOverColumnIds)??[],t.id),!t||(!E||!u.length)&&(!l||!e.length)){this.hideMenu();return}}else if(!t||!t.cellMenu||!u.length&&!e.length)return;const d=`${this.menuCssClass} slick-menu-level-${a} ${this.gridUid}`,c=document.body.querySelector(`.${this.menuCssClass}.slick-menu-level-${a}${this.gridUidSelector}`);if(c){if(c.dataset.subMenuParent===s)return c;this.disposeSubMenus()}const D=document.createElement("div");D.className=d,a>0&&(D.classList.add("slick-submenu"),(C=this.gridOptions)!=null&&C.darkMode&&D.classList.add("slick-dark-mode"),s&&(D.dataset.subMenuParent=s));const m=isNaN(this.addonOptions.maxHeight)?this.addonOptions.maxHeight:`${this.addonOptions.maxHeight??0}px`,h=isNaN(this.addonOptions.maxWidth)?this.addonOptions.maxWidth:`${this.addonOptions.maxWidth??0}px`;m&&(D.style.maxHeight=m),h&&(D.style.maxWidth=h),(A=this.addonOptions)!=null&&A.width&&(D.style.width=be((b=this.addonOptions)==null?void 0:b.width));const x=v("button",{ariaLabel:"Close",className:"close",type:"button",textContent:"×",dataset:{dismiss:this._menuCssPrefix}});if(!this.addonOptions.hideOptionSection&&l&&e.length>0){const y=v("div",{className:`${this._menuCssPrefix}-option-list`,role:"menu"},D);this.populateCommandOrOptionTitle("option",this.addonOptions,y,a),!this.addonOptions.hideCloseButton&&a<1&&this.populateCommandOrOptionCloseBtn("option",x,y),i&&a>0&&this.addSubMenuTitleWhenExists(i,y),this.populateCommandOrOptionItems("option",this.addonOptions,y,e,{cell:this._currentCell,row:this._currentRow,column:t,dataContext:r,grid:this.grid,level:a},this.handleMenuItemCommandClick,this.handleMenuItemMouseOver)}if(!this.addonOptions.hideCommandSection&&E&&u.length>0){const y=v("div",{className:`${this._menuCssPrefix}-command-list`,role:"menu"},D);this.populateCommandOrOptionTitle("command",this.addonOptions,y,a),!this.addonOptions.hideCloseButton&&a<1&&(!l||e.length===0||this.addonOptions.hideOptionSection)&&this.populateCommandOrOptionCloseBtn("command",x,y),i&&a>0&&this.addSubMenuTitleWhenExists(i,y),this.populateCommandOrOptionItems("command",this.addonOptions,y,u,{cell:this._currentCell,row:this._currentRow,column:t,dataContext:r,grid:this.grid,level:a},this.handleMenuItemCommandClick,this.handleMenuItemMouseOver)}return a++,D}closeMenu(u,e){var a;if(this.menuElement){if(typeof((a=this.addonOptions)==null?void 0:a.onBeforeMenuClose)=="function"&&this.addonOptions.onBeforeMenuClose(u,e)===!1)return;this.hideMenu()}}hideMenu(){var u;(u=this.menuElement)==null||u.remove(),this._menuElm=null,this.disposeSubMenus()}checkIsColumnAllowed(u,e){return(u==null?void 0:u.length)>0?u.findIndex(a=>a===e)>=0:!0}handleBodyMouseDown(u){if(this.menuElement){let e=!1;const a=u.target.closest(`.${this.menuCssClass}`);(this.menuElement.contains(u.target)||a)&&(e=!0),(this.menuElement!==u.target&&!e&&!u.defaultPrevented||u.target.className==="close"&&a)&&this.closeMenu(u,{cell:this._currentCell,row:this._currentRow,grid:this.grid})}}handleCloseButtonClicked(u){u.defaultPrevented||this.closeMenu(u,{cell:0,row:0,grid:this.grid})}handleMenuItemMouseOver(u,e,a,i=0){(a==null?void 0:a[e])!==void 0&&a!=="divider"&&!a.disabled&&!a.divider&&(a.commandItems||a.optionItems?(this.repositionSubMenu(a,e,i,u),this._lastMenuTypeClicked=e):i===0&&this.disposeSubMenus())}handleMenuItemCommandClick(u,e,a,i=0){var t;if((a==null?void 0:a[e])!==void 0&&a!=="divider"&&!a.disabled&&!a.divider&&this._currentCell!==void 0&&this._currentRow!==void 0){if(e==="option"&&!this.grid.getEditorLock().commitCurrentEdit())return;const r=this._currentCell,o=this._currentRow,s=this.grid.getColumns()[this._currentCell],l=this.grid.getDataItem(this._currentRow),E=a[e]!==void 0?a[e]:"";if(E!==void 0&&!a[`${e}Items`]){const d={cell:this._currentCell,row:this._currentRow,grid:this.grid,[e]:E,item:a,column:s,dataContext:l},c=e==="command"?"onCommand":"onOptionSelected",D=`${this._camelPluginName}:${c}`;this.pubSubService.publish(D,d),typeof((t=this._addonOptions)==null?void 0:t[c])=="function"&&this._addonOptions[c](u,d),typeof a.action=="function"&&a.action.call(this,u,d),u.defaultPrevented||this.closeMenu(u,{cell:r,row:o,grid:this.grid})}else(a.commandItems||a.optionItems)&&this.repositionSubMenu(a,e,i,u);this._lastMenuTypeClicked=e}}populateCommandOrOptionCloseBtn(u,e,a){this._bindEventService.bind(e,"click",t=>this.handleCloseButtonClicked(t),void 0,"parent-menu");const i=a.querySelector(`.slick-${u}-header`)??v("div",{className:`slick-${u}-header`});i==null||i.appendChild(e),a.appendChild(i),i.classList.add("with-close")}repositionSubMenu(u,e,a,i){(i.target.classList.contains("slick-cell")||this._lastMenuTypeClicked!==e)&&this.disposeSubMenus();const t=this.createMenu((u==null?void 0:u.commandItems)||[],(u==null?void 0:u.optionItems)||[],a+1,u);t&&(t.style.display="block",document.body.appendChild(t),this.repositionMenu(i,t))}repositionMenu(u,e){var t;const a=e==null?void 0:e.classList.contains("slick-submenu"),i=a?u.target.closest(`.${this._menuCssPrefix}-item`):u.target.closest(".slick-cell");if(e&&i){e.style.top="0px",e.style.left="0px";const r=((t=u==null?void 0:u.touches)==null?void 0:t[0])??u,o=Iu(i);let s=i&&this._camelPluginName==="cellMenu"?(o==null?void 0:o.left)??0:r.pageX,l=i&&this._camelPluginName==="cellMenu"?(o==null?void 0:o.top)??0:r.pageY;a&&this._camelPluginName==="contextMenu"&&(s=(o==null?void 0:o.left)??0,l=(o==null?void 0:o.top)??0);const E=i.offsetWidth||0,d=(e==null?void 0:e.offsetHeight)||0,c=(e==null?void 0:e.offsetWidth)||this._addonOptions.width||0,D=this.gridOptions.rowHeight||0,m=Number(this._addonOptions.autoAdjustDropOffset||0),h=Number(this._addonOptions.autoAlignSideOffset||0);if(this._addonOptions.autoAdjustDrop||this._addonOptions.dropDirection){const{bottom:x,top:g}=Ai(i),F=x+m-D,C=g-m+D;(FF?"top":"bottom")==="top"||this._addonOptions.dropDirection==="top"?(e.classList.remove("dropdown"),e.classList.add("dropup"),a?l-=d-m-i.clientHeight:l-=d-m):(e.classList.remove("dropup"),e.classList.add("dropdown"),l=l+m,this._camelPluginName==="cellMenu"&&(a?l+=m:l+=D+m))}if(this._addonOptions.autoAlignSide||this._addonOptions.dropSide==="left"){const x=this.grid.getGridPosition();let g=s+Number(c);a&&(g+=i.clientWidth);const F=document.documentElement.clientWidth;(g>=x.width||g>=F?"left":"right")==="left"||!a&&this._addonOptions.dropSide==="left"?(e.classList.remove("dropright"),e.classList.add("dropleft"),this._camelPluginName==="cellMenu"&&!a?s-=Number(c)-E-h:s-=Number(c)-h):(e.classList.remove("dropleft"),e.classList.add("dropright"),a?s+=h+i.offsetWidth:s+=h)}e.style.top=`${l}px`,e.style.left=`${s}px`}}}class Dh extends O1{constructor(u,e,a){super(u,e,a),this.extensionUtility=u,this.pubSubService=e,this.sharedService=a,this.pluginName="CellMenu",this._defaults={autoAdjustDrop:!0,autoAlignSide:!0,autoAdjustDropOffset:0,autoAlignSideOffset:0,hideMenuOnScroll:!0,subMenuOpenByEvent:"mouseover"},this._camelPluginName="cellMenu",this._menuCssPrefix="slick-menu",this._menuPluginCssPrefix="slick-cell-menu",this.init(a.gridOptions.cellMenu)}init(u){this._addonOptions={...this._defaults,...u},this.sortMenuItems(this.sharedService.allColumns),this._eventHandler.subscribe(this.grid.onClick,this.handleCellClick.bind(this)),this._addonOptions.hideMenuOnScroll&&this._eventHandler.subscribe(this.grid.onScroll,this.closeMenu.bind(this))}translateCellMenu(){var a;const u=(a=this.sharedService)==null?void 0:a.gridOptions,e=this.sharedService.allColumns;u!=null&&u.enableTranslate&&Array.isArray(e)&&e.forEach(i=>{if(i!=null&&i.cellMenu&&(Array.isArray(i.cellMenu.commandItems)||Array.isArray(i.cellMenu.optionItems))){const t=i.cellMenu.commandItems||[],r=i.cellMenu.optionItems||[];i.cellMenu.commandTitleKey&&(i.cellMenu.commandTitle=this.extensionUtility.translateWhenEnabledAndServiceExist(i.cellMenu.commandTitleKey,"TEXT_COMMANDS")||i.cellMenu.commandTitle),i.cellMenu.optionTitleKey&&(i.cellMenu.optionTitle=this.extensionUtility.translateWhenEnabledAndServiceExist(i.cellMenu.optionTitleKey,"TEXT_COMMANDS")||i.cellMenu.optionTitle),this.extensionUtility.translateMenuItemsFromTitleKey(t,"commandItems"),this.extensionUtility.translateMenuItemsFromTitleKey(r,"optionItems")}})}handleCellClick(u,e){this.disposeAllMenus();const a=this.grid.getCellFromEvent(u);if(a){const i=this.grid.getDataItem(a.row),t=this.grid.getColumns()[a.cell];t!=null&&t.cellMenu&&u.preventDefault(),this._addonOptions={...this._addonOptions,...t.cellMenu};const r=e||{};if(r.column=t,r.dataContext=i,r.grid=this.grid,!this.extensionUtility.runOverrideFunctionWhenExists(this._addonOptions.menuUsabilityOverride,r))return;this._menuElm=this.createParentMenu(u),this._menuElm&&(this.repositionMenu(u,this._menuElm),this._menuElm.ariaExpanded="true",this._menuElm.style.display="block",this.gridOptions.darkMode&&this._menuElm.classList.add("slick-dark-mode")),this._bindEventService.bind(document.body,"mousedown",this.handleBodyMouseDown.bind(this))}}sortMenuItems(u){u.forEach(e=>{var a,i;(a=e==null?void 0:e.cellMenu)!=null&&a.commandItems&&this.extensionUtility.sortItems(e.cellMenu.commandItems||[],"positionOrder"),(i=e==null?void 0:e.cellMenu)!=null&&i.optionItems&&this.extensionUtility.sortItems(e.cellMenu.optionItems||[],"positionOrder")})}}class mh{constructor(u,e){this.grid=u,this.pluginName="CellRangeDecorator",this._defaults={selectionCssClass:"slick-range-decorator",selectionCss:{border:"2px dashed red",zIndex:"9999"},offset:{top:-1,left:-1,height:-2,width:-2}},this._options=da(this._defaults,e)}get addonOptions(){return this._options}get addonElement(){return this._elem}destroy(){this.hide()}init(){}hide(){var u;(u=this._elem)==null||u.remove(),this._elem=null}show(u){var i,t;this._elem||(this._elem=v("div",{className:this._options.selectionCssClass}),Object.keys(this._options.selectionCss).forEach(r=>{this._elem.style[r]=this._options.selectionCss[r]}),this._elem.style.position="absolute",(i=this.grid.getActiveCanvasNode())==null||i.appendChild(this._elem));const e=this.grid.getCellNodeBox(u.fromRow,u.fromCell),a=this.grid.getCellNodeBox(u.toRow,u.toCell);return e&&a&&((t=this._options)!=null&&t.offset)&&(this._elem.style.top=`${e.top+this._options.offset.top}px`,this._elem.style.left=`${e.left+this._options.offset.left}px`,this._elem.style.height=`${a.bottom-e.top+this._options.offset.height}px`,this._elem.style.width=`${a.right-e.left+this._options.offset.width}px`),this._elem}}class wt{constructor(u){this.pluginName="CellRangeSelector",this.onBeforeCellRangeSelected=new N("onBeforeCellRangeSelected"),this.onCellRangeSelecting=new N("onCellRangeSelecting"),this.onCellRangeSelected=new N("onCellRangeSelected"),this._currentlySelectedRange=null,this._canvas=null,this._dragging=!1,this._gridUid="",this._columnOffset=0,this._rowOffset=0,this._isRightCanvas=!1,this._isBottomCanvas=!1,this._xDelayForNextCell=0,this._yDelayForNextCell=0,this._viewportHeight=0,this._viewportWidth=0,this._isRowMoveRegistered=!1,this._scrollLeft=0,this._scrollTop=0,this._defaults={autoScroll:!0,minIntervalToShowNextCell:30,maxIntervalToShowNextCell:600,accelerateInterval:5,selectionCss:{border:"2px dashed blue"}},this._eventHandler=new Tu,this._options=da(this._defaults,u)}get addonOptions(){return this._options}get eventHandler(){return this._eventHandler}get gridUid(){var u;return this._gridUid||(((u=this._grid)==null?void 0:u.getUID())??"")}get gridUidSelector(){return this.gridUid?`.${this.gridUid}`:""}init(u){this._grid=u,this._decorator=this._options.cellDecorator||new mh(u,this._options),this._canvas=u.getCanvasNode(),this._gridOptions=u.getOptions(),this._gridUid=u.getUID();const e=u.getPubSubService();e&&B.addSlickEventPubSubWhenDefined(e,this),this._eventHandler.subscribe(this._grid.onDrag,this.handleDrag.bind(this)).subscribe(this._grid.onDragInit,this.handleDragInit.bind(this)).subscribe(this._grid.onDragStart,this.handleDragStart.bind(this)).subscribe(this._grid.onDragEnd,this.handleDragEnd.bind(this)).subscribe(this._grid.onScroll,this.handleScroll.bind(this))}destroy(){this.dispose()}dispose(){var u,e;(u=this._eventHandler)==null||u.unsubscribeAll(),bu(this._activeCanvas),bu(this._canvas),(e=this._decorator)==null||e.destroy(),this.stopIntervalTimer()}getCellDecorator(){return this._decorator}getCurrentRange(){return this._currentlySelectedRange}getMouseOffsetViewport(u,e){var m;const a=((m=u==null?void 0:u.touches)==null?void 0:m[0])??u,i=this._activeViewport.scrollLeft,t=this._activeViewport.scrollTop,r=i+this._viewportWidth,o=t+this._viewportHeight,s=Iu(this._activeViewport),l=(s==null?void 0:s.left)??0,E=(s==null?void 0:s.top)??0,d=l+this._viewportWidth,c=E+this._viewportHeight,D={e:u,dd:e,viewport:{left:i,top:t,right:r,bottom:o,offset:{left:l,top:E,right:d,bottom:c}},offset:{x:0,y:0},isOutsideViewport:!1};return a.pageXd&&(D.offset.x=a.pageX-d),a.pageYc&&(D.offset.y=c-a.pageY),D.isOutsideViewport=!!D.offset.x||!!D.offset.y,D}stopIntervalTimer(){this._autoScrollTimerId&&(clearInterval(this._autoScrollTimerId),this._autoScrollTimerId=void 0)}handleDrag(u,e){if(!this._dragging&&!this._gridOptions.enableRowMoveManager)return;this._gridOptions.enableRowMoveManager||u.stopImmediatePropagation();const a=u.getNativeEvent();if(this.addonOptions.autoScroll&&(this._draggingMouseOffset=this.getMouseOffsetViewport(a,e),this._draggingMouseOffset.isOutsideViewport))return this.handleDragOutsideViewport();this.stopIntervalTimer(),this.handleDragTo(a,e)}handleDragOutsideViewport(){if(this._xDelayForNextCell=this.addonOptions.maxIntervalToShowNextCell-Math.abs(this._draggingMouseOffset.offset.x)*this.addonOptions.accelerateInterval,this._yDelayForNextCell=this.addonOptions.maxIntervalToShowNextCell-Math.abs(this._draggingMouseOffset.offset.y)*this.addonOptions.accelerateInterval,!this._autoScrollTimerId){let u=0,e=0;this._autoScrollTimerId=setInterval(()=>{let a=!1,i=!1;this._draggingMouseOffset.offset.x?(u+=this.addonOptions.minIntervalToShowNextCell,a=u>=this._xDelayForNextCell):u=0,this._draggingMouseOffset.offset.y?(e+=this.addonOptions.minIntervalToShowNextCell,i=e>=this._yDelayForNextCell):e=0,(a||i)&&(a&&(u=0),i&&(e=0),this.handleDragToNewPosition(a,i))},this.addonOptions.minIntervalToShowNextCell)}}handleDragToNewPosition(u,e){let a=this._draggingMouseOffset.e.pageX,i=this._draggingMouseOffset.e.pageY;const t=this._draggingMouseOffset.offset.x,r=this._draggingMouseOffset.offset.y,o=this._draggingMouseOffset.viewport.offset;u&&t&&(t>0?a=o.right+this._moveDistanceForOneCell.x:a=o.left-this._moveDistanceForOneCell.x),e&&r&&(r>0?i=o.top-this._moveDistanceForOneCell.y:i=o.bottom+this._moveDistanceForOneCell.y),this.handleDragTo({pageX:a,pageY:i},this._draggingMouseOffset.dd)}handleDragTo(u,e){var t,r,o;const a=((t=u==null?void 0:u.touches)==null?void 0:t[0])??u,i=this._grid.getCellFromPoint(a.pageX-(((r=Iu(this._activeCanvas))==null?void 0:r.left)??0)+this._columnOffset,a.pageY-(((o=Iu(this._activeCanvas))==null?void 0:o.top)??0)+this._rowOffset);if(i!==void 0){if(this._gridOptions.frozenColumn>=0&&(!this._isRightCanvas&&i.cell>this._gridOptions.frozenColumn||this._isRightCanvas&&i.cell<=this._gridOptions.frozenColumn)||this._gridOptions.frozenRow>=0&&(!this._isBottomCanvas&&i.row>=this._gridOptions.frozenRow||this._isBottomCanvas&&i.rowl.right||s.topl.bottom)&&this._grid.scrollCellIntoView(i.row,i.cell)}}if(!this._grid.canCellBeSelected(i.row,i.cell))return;if(e!=null&&e.range){e.range.end=i;const s=new V0(e.range.start.row??0,e.range.start.cell??0,i.row,i.cell);this._decorator.show(s),this.onCellRangeSelecting.notify({range:s})}}}handleDragEnd(u,e){this._decorator.hide(),this._dragging&&(this._dragging=!1,u.stopImmediatePropagation(),this.stopIntervalTimer(),this.onCellRangeSelected.notify({range:new V0(e.range.start.row??0,e.range.start.cell??0,e.range.end.row,e.range.end.cell)}))}handleDragInit(u){var t,r;this._activeCanvas=this._grid.getActiveCanvasNode(u),this._activeViewport=this._grid.getActiveViewportNode(u);const e=this._grid.getDisplayedScrollbarDimensions();if(this._viewportWidth=this._activeViewport.offsetWidth-e.width,this._viewportHeight=this._activeViewport.offsetHeight-e.height,this._moveDistanceForOneCell={x:this._grid.getAbsoluteColumnMinWidth()/2,y:this._gridOptions.rowHeight/2},this._rowOffset=0,this._columnOffset=0,this._isBottomCanvas=this._activeCanvas.classList.contains("grid-canvas-bottom"),this._gridOptions.frozenRow>-1&&this._isBottomCanvas){const o=`${this.gridUidSelector} .grid-canvas-${this._gridOptions.frozenBottom?"bottom":"top"}`;this._rowOffset=((t=document.querySelector(o))==null?void 0:t.clientHeight)??0}this._isRightCanvas=this._activeCanvas.classList.contains("grid-canvas-right"),this._gridOptions.frozenColumn>-1&&this._isRightCanvas&&(this._columnOffset=((r=document.querySelector(`${this.gridUidSelector} .grid-canvas-left`))==null?void 0:r.clientWidth)??0);const a=this._grid.getCellFromEvent(u),i=this._grid.getActiveCell();(!this._grid.getEditorLock().isActive()||!(i&&a&&i.row===a.row&&i.cell===a.cell))&&(u.stopImmediatePropagation(),u.preventDefault())}handleDragStart(u,e){const a=this._grid.getCellFromEvent(u);if(a&&this.onBeforeCellRangeSelected.notify(a).getReturnValue()!==!1&&this._grid.canCellBeSelected(a.row,a.cell)&&(this._dragging=!0,u.stopImmediatePropagation()),!this._dragging)return;this._grid.focus();const i=Iu(this._canvas);let t=e.startX-((i==null?void 0:i.left)??0);this._gridOptions.frozenColumn>=0&&this._isRightCanvas&&(t+=this._scrollLeft);let r=e.startY-((i==null?void 0:i.top)??0);this._gridOptions.frozenRow>=0&&this._isBottomCanvas&&(r+=this._scrollTop);const o=this._grid.getCellFromPoint(t,r);return e.range={start:o,end:{}},this._currentlySelectedRange=e.range,this._decorator.show(new V0(o.row,o.cell))}handleScroll(u,e){this._scrollTop=e.scrollTop,this._scrollLeft=e.scrollLeft}}class I1{constructor(u){this.onSelectedRangesChanged=new N("onSelectedRangesChanged"),this.pluginName="CellSelectionModel",this._cachedPageRowCount=0,this._prevKeyDown="",this._ranges=[],this._defaults={selectActiveCell:!0},this._eventHandler=new Tu,u===void 0||u.cellRangeSelector===void 0?this._selector=new wt({selectionCss:{border:"2px solid black"}}):this._selector=u.cellRangeSelector,this._addonOptions=u}get addonOptions(){return this._addonOptions}get cellRangeSelector(){return this._selector}get eventHandler(){return this._eventHandler}init(u){this._grid=u,u.hasDataView()&&(this._dataView=u.getData()),this._addonOptions={...this._defaults,...this._addonOptions};const e=u.getPubSubService();e&&this.onSelectedRangesChanged.setPubSubService(e),this._eventHandler.subscribe(this._grid.onActiveCellChanged,this.handleActiveCellChange.bind(this)).subscribe(this._grid.onKeyDown,this.handleKeyDown.bind(this)).subscribe(this._selector.onBeforeCellRangeSelected,this.handleBeforeCellRangeSelected.bind(this)).subscribe(this._selector.onCellRangeSelected,this.handleCellRangeSelected.bind(this)),u.registerPlugin(this._selector)}destroy(){this.dispose()}dispose(){var u,e;this._selector&&(this._selector.onBeforeCellRangeSelected.unsubscribe(this.handleBeforeCellRangeSelected.bind(this)),this._selector.onCellRangeSelected.unsubscribe(this.handleCellRangeSelected.bind(this))),this._eventHandler.unsubscribeAll(),(u=this._grid)==null||u.unregisterPlugin(this._selector),(e=this._selector)==null||e.dispose()}getSelectedRanges(){return this._ranges}rangesAreEqual(u,e){let a=u.length!==e.length;if(!a){for(let i=0;ie===u)}handleKeyDown(u){var o;let e,a;const i=this._grid.getColumns().length,t=this._grid.getActiveCell();let r=0;if(this._dataView&&"getPagingInfo"in this._dataView?r=((o=this._dataView)==null?void 0:o.getPagingInfo().pageSize)||this._dataView.getLength():r=this._grid.getDataLength(),t&&(u.shiftKey||u.ctrlKey)&&!u.altKey&&this.isKeyAllowed(u.key)&&(e=this.getSelectedRanges().slice(),e.length||e.push(new V0(t.row,t.cell)),a=e.pop(),typeof(a==null?void 0:a.contains)=="function")){a.contains(t.row,t.cell)||(a=new V0(t.row,t.cell));let s=a.toRow-a.fromRow,l=a.toCell-a.fromCell;const E=t.row===a.fromRow?1:-1,d=t.cell===a.fromCell?1:-1,c=u.key.startsWith("Arrow");let D,m=0;c&&!u.ctrlKey?(u.key==="ArrowLeft"?l-=d:u.key==="ArrowRight"?l+=d:u.key==="ArrowUp"?s-=E:u.key==="ArrowDown"&&(s+=E),m=t.row+E*s):(this._cachedPageRowCount<1&&(this._cachedPageRowCount=this._grid.getViewportRowCount()),this._prevSelectedRow===void 0&&(this._prevSelectedRow=t.row),u.shiftKey&&!u.ctrlKey&&u.key==="Home"?(D=0,m=t.row):u.shiftKey&&!u.ctrlKey&&u.key==="End"?(D=i-1,m=t.row):u.ctrlKey&&u.shiftKey&&u.key==="Home"?(D=0,m=0):u.ctrlKey&&u.shiftKey&&u.key==="End"?(D=i-1,m=r-1):u.key==="PageUp"?(this._prevSelectedRow>=0&&(m=this._prevSelectedRow-this._cachedPageRowCount),m<0&&(m=0)):u.key==="PageDown"&&(this._prevSelectedRow<=r-1&&(m=this._prevSelectedRow+this._cachedPageRowCount),m>r-1&&(m=r-1)),this._prevSelectedRow=m),D??(D=t.cell+d*l);const h=new V0(t.row,t.cell,m,D);if(this.removeInvalidRanges([h]).length){e.push(h);const x=E>0?h.toRow:h.fromRow,g=d>0?h.toCell:h.fromCell;c?(this._grid.scrollRowIntoView(x),this._grid.scrollCellIntoView(x,g,!1)):(this._grid.scrollRowIntoView(m),this._grid.scrollCellIntoView(m,g,!1))}else e.push(a);this.setSelectedRanges(e),u.preventDefault(),u.stopPropagation(),this._prevKeyDown=u.key}}}class Zt{constructor(u){this.pluginName="RowSelectionModel",this.onSelectedRangesChanged=new N("onSelectedRangesChanged"),this._inHandler=!1,this._ranges=[],this._defaults={autoScrollWhenDrag:!0,cellRangeSelector:void 0,dragToSelect:!1,selectActiveRow:!0},this._eventHandler=new Tu,this._options={...this._defaults,...u}}get addonOptions(){return this._options}get eventHandler(){return this._eventHandler}get gridOptions(){var u;return(u=this._grid)==null?void 0:u.getOptions()}init(u){this._grid=u,this._options={...this._defaults,...this._options},this._selector=this.addonOptions.cellRangeSelector;const e=u.getPubSubService();e&&this.onSelectedRangesChanged.setPubSubService(e),!this._selector&&this._options.dragToSelect&&(this._selector=new wt({selectionCss:{border:"none"},autoScroll:this._options.autoScrollWhenDrag}),this.addonOptions.cellRangeSelector=this._selector),this._eventHandler.subscribe(this._grid.onActiveCellChanged,this.handleActiveCellChange.bind(this)).subscribe(this._grid.onClick,this.handleClick.bind(this)).subscribe(this._grid.onKeyDown,this.handleKeyDown.bind(this)),this._selector&&(this._grid.registerPlugin(this._selector),this._selector.onCellRangeSelecting.subscribe(this.handleCellRangeSelected.bind(this)),this._selector.onCellRangeSelected.subscribe(this.handleCellRangeSelected.bind(this)),this._selector.onBeforeCellRangeSelected.subscribe(this.handleBeforeCellRangeSelected.bind(this)))}destroy(){this.dispose()}dispose(){this._eventHandler.unsubscribeAll(),this.disposeSelector()}disposeSelector(){var u,e;this._selector&&(this._selector.onCellRangeSelecting.unsubscribe(this.handleCellRangeSelected.bind(this)),this._selector.onCellRangeSelected.unsubscribe(this.handleCellRangeSelected.bind(this)),this._selector.onBeforeCellRangeSelected.unsubscribe(this.handleBeforeCellRangeSelected.bind(this)),this._grid.unregisterPlugin(this._selector),(u=this._selector)==null||u.destroy(),(e=this._selector)==null||e.dispose())}getCellRangeSelector(){return this._selector}getSelectedRanges(){return this._ranges}getSelectedRows(){return this.rangesToRows(this._ranges)}refreshSelections(){this.setSelectedRows(this.getSelectedRows())}setSelectedRows(u){this.setSelectedRanges(this.rowsToRanges(u),"SlickRowSelectionModel.setSelectedRows")}setSelectedRanges(u,e="SlickRowSelectionModel.setSelectedRanges"){if((!this._ranges||this._ranges.length===0)&&(!u||u.length===0))return;this._ranges=u;const a=new Pu(new CustomEvent("click",{detail:{caller:e}}),this._ranges);this.onSelectedRangesChanged.notify(this._ranges,a)}getRowsRange(u,e){let a;const i=[];for(a=u;a<=e;a++)i.push(a);for(a=e;ar!==e.row),this._grid.setActiveCell(e.row,e.cell);else if(a.length&&u.shiftKey){const r=a.pop(),o=Math.min(e.row,r),s=Math.max(e.row,r);a=[];for(let l=o;l<=s;l++)l!==r&&a.push(l);a.push(r),this._grid.setActiveCell(e.row,e.cell)}const t=this.rowsToRanges(a);return this.setSelectedRanges(t),u.stopImmediatePropagation(),!0}handleKeyDown(u){const e=this._grid.getActiveCell();if(this.gridOptions.multiSelect&&e&&u.shiftKey&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&(u.key==="ArrowUp"||u.key==="ArrowDown")){let a=this.getSelectedRows();a.sort((o,s)=>o-s),a.length||(a=[e.row]);let i,t=a[0],r=a[a.length-1];if(u.key==="ArrowDown"?i=e.row=0&&ie.push(new V0(i,0,i,a))),e}}const Ss="mdi-icon-check",ws="mdi-icon-uncheck";class Ms{constructor(u,e){this.pubSubService=u,this.pluginName="CheckboxSelectColumn",this._defaults={columnId:"_checkbox_selector",cssClass:null,field:"_checkbox_selector",hideSelectAllCheckbox:!1,name:"",toolTip:"Select/Deselect All",width:30,reorderable:!1,applySelectOnAllPages:!0,hideInColumnTitleRow:!1,hideInFilterHeaderRow:!0},this._addonOptions=this._defaults,this._checkboxColumnCellIndex=null,this._isSelectAllChecked=!1,this._isUsingDataView=!1,this._selectedRowsLookup={},this._selectAll_UID=this.createUID(),this._bindEventService=new vu,this._eventHandler=new Tu,this._addonOptions={...this._defaults,...e}}get addonOptions(){return this._addonOptions}get headerRowNode(){return this._headerRowNode}get gridOptions(){var u;return((u=this._grid)==null?void 0:u.getOptions())??{}}get selectAllUid(){return this._selectAll_UID}set selectedRowsLookup(u){this._selectedRowsLookup=u}init(u){this._grid=u,this._isUsingDataView=!Array.isArray(u.getData()),this._isUsingDataView&&(this._dataView=u.getData()),this.gridOptions.backendServiceApi&&(this._addonOptions.applySelectOnAllPages=!1),this._eventHandler.subscribe(u.onSelectedRowsChanged,this.handleSelectedRowsChanged.bind(this)).subscribe(u.onClick,this.handleClick.bind(this)).subscribe(u.onKeyDown,this.handleKeyDown.bind(this)),this._isUsingDataView&&this._dataView&&(this._eventHandler.subscribe(u.onAfterSetColumns,this.handleDataViewSelectedIdsChanged.bind(this)),this._addonOptions.applySelectOnAllPages&&this._eventHandler.subscribe(this._dataView.onSelectedRowIdsChanged,this.handleDataViewSelectedIdsChanged.bind(this)).subscribe(this._dataView.onPagingInfoChanged,this.handleDataViewSelectedIdsChanged.bind(this))),this._addonOptions.hideInFilterHeaderRow||this.addCheckboxToFilterHeaderRow(u),this._addonOptions.hideInColumnTitleRow||this._eventHandler.subscribe(this._grid.onHeaderClick,this.handleHeaderClick.bind(this)),(!this._rowSelectionModel||!this._grid.getSelectionModel())&&(this._rowSelectionModel=new Zt(this.gridOptions.rowSelectionOptions),this._grid.setSelectionModel(this._rowSelectionModel)),this.gridOptions.preselectedRows&&this._rowSelectionModel&&this._grid.getSelectionModel()&&setTimeout(()=>this.selectRows(this.gridOptions.preselectedRows||[])),typeof this._addonOptions.selectableOverride=="function"&&this.selectableOverride(this._addonOptions.selectableOverride)}dispose(){this._bindEventService.unbindAll(),this._eventHandler.unsubscribeAll()}create(u,e){var a;if(this._addonOptions={...this._defaults,...e.checkboxSelector},Array.isArray(u)&&e){const i=this.getColumnDefinition();if(!u.some(t=>t.id===i.id)){const t=((a=e==null?void 0:e.checkboxSelector)==null?void 0:a.columnIndexPosition)??0;t>0?u.splice(t,0,i):u.unshift(i),this.pubSubService.publish("onPluginColumnsChanged",{columns:u,pluginName:this.pluginName})}}return this}getOptions(){return this._addonOptions}setOptions(u){var e;if(this._addonOptions={...this._addonOptions,...u},this._addonOptions.hideSelectAllCheckbox)this.hideSelectAllFromColumnHeaderTitleRow(),this.hideSelectAllFromColumnHeaderFilterRow();else if(this._addonOptions.hideInColumnTitleRow?(this.hideSelectAllFromColumnHeaderTitleRow(),this._addonOptions.name&&this._grid.updateColumnHeader(this._addonOptions.columnId||"",this._addonOptions.name,"")):(this.renderSelectAllCheckbox(this._isSelectAllChecked),this._eventHandler.subscribe(this._grid.onHeaderClick,this.handleHeaderClick.bind(this))),this._addonOptions.hideInFilterHeaderRow)this.hideSelectAllFromColumnHeaderFilterRow();else{const a=(e=this.headerRowNode)==null?void 0:e.querySelector("#filter-checkbox-selectall-container");if(a){a.style.display="flex",a.ariaChecked=String(this._isSelectAllChecked);const i=a.querySelector('input[type="checkbox"]');i&&(i.ariaChecked=String(this._isSelectAllChecked),i.checked=this._isSelectAllChecked)}}}deSelectRows(u){const e=[];for(const a of u)this._selectedRowsLookup[a]&&(e[e.length]=a);this._grid.setSelectedRows(this._grid.getSelectedRows().filter(a=>e.indexOf(a)<0),"SlickCheckboxSelectColumn.deSelectRows")}selectRows(u){var i;const e=[];for(const t of u)this._selectedRowsLookup[t]&&(e[e.length]=t);const a=(i=this._grid.getSelectedRows())==null?void 0:i.concat(e);this._grid.setSelectedRows(a)}createCheckboxElement(u,e=!1){const a=new DocumentFragment,i=v("label",{className:"checkbox-selector-label",htmlFor:u}),t=v("div",{className:"icon-checkbox-container"});return t.appendChild(v("input",{id:u,type:"checkbox",checked:e,ariaChecked:String(e)})),t.appendChild(v("div",{className:`mdi ${e?Ss:ws}`})),i.appendChild(t),a.appendChild(i),a}getColumnDefinition(){var e;const u=String(((e=this._addonOptions)==null?void 0:e.columnId)??this._defaults.columnId);return{id:u,name:this._addonOptions.hideSelectAllCheckbox||this._addonOptions.hideInColumnTitleRow?this._addonOptions.name||"":this.createCheckboxElement(`header-selector${this._selectAll_UID}`),toolTip:this._addonOptions.hideSelectAllCheckbox||this._addonOptions.hideInColumnTitleRow?"":this._addonOptions.toolTip,field:u,cssClass:this._addonOptions.cssClass,excludeFromExport:!0,excludeFromColumnPicker:!0,excludeFromGridMenu:!0,excludeFromQuery:!0,excludeFromHeaderMenu:!0,hideSelectAllCheckbox:this._addonOptions.hideSelectAllCheckbox,resizable:!1,reorderable:this._addonOptions.reorderable,sortable:!1,width:this._addonOptions.width||30,maxWidth:this._addonOptions.width||30,formatter:this.checkboxSelectionFormatter.bind(this)}}hideSelectAllFromColumnHeaderTitleRow(){this._grid.updateColumnHeader(this._addonOptions.columnId||"",this._addonOptions.name||"","")}hideSelectAllFromColumnHeaderFilterRow(){var e;const u=(e=this.headerRowNode)==null?void 0:e.querySelector("#filter-checkbox-selectall-container");u&&(u.style.display="none")}toggleRowSelection(u){this.toggleRowSelectionWithEvent(null,u)}toggleRowSelectionWithEvent(u,e){const a=this._grid.getDataItem(e);if(!this.checkSelectableOverride(e,a,this._grid))return;const i=this._grid.getSelectedRows();typeof this._addonOptions.onRowToggleStart=="function"&&this._addonOptions.onRowToggleStart(u,{row:e,previousSelectedRows:i});const t=this._selectedRowsLookup[e]?this._grid.getSelectedRows().filter(r=>r!==e):this._grid.getSelectedRows().concat(e);this._grid.setSelectedRows(t,"click.toggle"),this._grid.setActiveCell(e,this.getCheckboxColumnCellIndex()),this._addonOptions.onRowToggleEnd&&this._addonOptions.onRowToggleEnd(u,{row:e,previousSelectedRows:i})}selectableOverride(u){this._selectableOverride=u}addCheckboxToFilterHeaderRow(u){this._eventHandler.subscribe(u.onHeaderRowCellRendered,(e,a)=>{if(a.column.field===(this._addonOptions.field||"_checkbox_selector")){bu(a.node);const i=`header-filter-selector${this._selectAll_UID}`,t=v("label",{id:"filter-checkbox-selectall-container",htmlFor:i}),r=v("div",{className:"icon-checkbox-container"});r.appendChild(v("input",{id:i,type:"checkbox",ariaChecked:"false"})),r.appendChild(v("div",{className:"mdi mdi-icon-uncheck"})),t.appendChild(r),a.node.appendChild(t),this._headerRowNode=a.node,this._headerRowNode.classList.add("checkbox-header"),this._bindEventService.bind(t,"click",o=>this.handleHeaderClick(o,a))}})}checkboxSelectionFormatter(u,e,a,i,t,r){if(t&&this.checkSelectableOverride(u,t,r)){const o=this.createUID()+u;return this.createCheckboxElement(`selector${o}`,!!this._selectedRowsLookup[u])}return null}checkSelectableOverride(u,e,a){return typeof this._selectableOverride=="function"?this._selectableOverride(u,e,a):!0}createUID(){return Math.round(1e7*Math.random())}getCheckboxColumnCellIndex(){if(this._checkboxColumnCellIndex===null){this._checkboxColumnCellIndex=0;const u=this._grid.getColumns();for(let e=0;e0)for(let r=0;rd[s]===l)>=0&&!this.checkSelectableOverride(r,o,this._grid)&&a++}if(this._isSelectAllChecked=u.length+a>=e.length,!this._addonOptions.hideInColumnTitleRow&&!this._addonOptions.hideSelectAllCheckbox&&this.renderSelectAllCheckbox(this._isSelectAllChecked),!this._addonOptions.hideInFilterHeaderRow){const r=(i=this.headerRowNode)==null?void 0:i.querySelector(`#header-filter-selector${this._selectAll_UID}`),o=(t=this.headerRowNode)==null?void 0:t.querySelector(".icon-checkbox-container .mdi");r&&(r.ariaChecked=String(this._isSelectAllChecked),r.checked=this._isSelectAllChecked),o&&(o.className=`mdi ${this._isSelectAllChecked?Ss:ws}`)}}handleClick(u,e){if(this._grid.getColumns()[e.cell].id===this._addonOptions.columnId&&u.target.type==="checkbox"){if(u.target.ariaChecked=String(u.target.checked),this._grid.getEditorLock().isActive()&&!this._grid.getEditorLock().commitCurrentEdit()){u.preventDefault(),u.stopImmediatePropagation();return}this.toggleRowSelectionWithEvent(u,e.row),u.stopPropagation(),u.stopImmediatePropagation()}}handleHeaderClick(u,e){if(e.column.id===this._addonOptions.columnId&&u.target.type==="checkbox"){if(u.target.ariaChecked=String(u.target.checked),this._grid.getEditorLock().isActive()&&!this._grid.getEditorLock().commitCurrentEdit()){u.preventDefault(),u.stopImmediatePropagation();return}let a=u.target.checked;const i=a?"click.selectAll":"click.unselectAll",t=this._grid.getSelectedRows();this._addonOptions.onSelectAllToggleStart&&this._addonOptions.onSelectAllToggleStart(u,{previousSelectedRows:t,caller:i});let r=[];if(a){const o=[];for(let s=0;s{l!==void 0&&this._grid.invalidateRow(+l)}),this._selectedRowsLookup=e,this._grid.render(),this._isSelectAllChecked=((u==null?void 0:u.length)??0)+r>=this._grid.getDataLength(),(!this._isUsingDataView||!this._addonOptions.applySelectOnAllPages)&&(!this._addonOptions.hideInColumnTitleRow&&!this._addonOptions.hideSelectAllCheckbox&&this.renderSelectAllCheckbox(this._isSelectAllChecked),!this._addonOptions.hideInFilterHeaderRow)){const l=(s=this.headerRowNode)==null?void 0:s.querySelector(`#header-filter-selector${this._selectAll_UID}`);l&&(l.ariaChecked=String(this._isSelectAllChecked),l.checked=this._isSelectAllChecked)}if(o.length>0){for(const l of o){const E=u.indexOf(l);u.splice(E,1)}this._grid.setSelectedRows(u,"click.toggle")}}renderSelectAllCheckbox(u){const e=this._grid.updateColumnHeader(this._addonOptions.columnId||"",this.createCheckboxElement(`header-selector${this._selectAll_UID}`,!!u),this._addonOptions.toolTip);e==null||e.classList.add("header-checkbox-selectall")}}class G1 extends qt{constructor(u,e,a,i,t){var r;super(u,a,i),this.extensionUtility=u,this.filterService=e,this.pubSubService=a,this.sharedService=i,this.sortService=t,this.onAfterMenuShow=new N("onAfterMenuShow"),this.onBeforeMenuShow=new N("onBeforeMenuShow"),this.onMenuClose=new N("onMenuClose"),this.onCommand=new N("onCommand"),this.onColumnsChanged=new N("onColumnsChanged"),this._areVisibleColumnDifferent=!1,this._columns=[],this._columnCheckboxes=[],this._commandMenuElm=null,this._headerElm=null,this._isMenuOpen=!1,this._subMenuParentId="",this._defaults={dropSide:"left",showButton:!0,hideForceFitButton:!1,hideSyncResizeButton:!1,forceFitTitle:"Force fit columns",marginBottom:15,menuWidth:18,minHeight:250,contentMinWidth:0,resizeOnShowHeaderRow:!1,syncResizeTitle:"Synchronous resize",subMenuOpenByEvent:"mouseover",headerColumnValueExtractor:o=>E0(o.name||"","innerHTML")},this._menuCssPrefix="slick-menu",this._menuPluginCssPrefix="slick-grid-menu",this._camelPluginName="gridMenu",this._columns=this.sharedService.allColumns??[],this._gridUid=((r=this.grid)==null?void 0:r.getUID())??"",this.initEventHandlers(),this.init()}get addonOptions(){return this._addonOptions||{}}get columns(){return this._columns}set columns(u){this._columns=u}get gridOptions(){var u;return((u=this.grid)==null?void 0:u.getOptions())||{}}get gridUidSelector(){return this.gridUid?`.${this.gridUid}`:""}initEventHandlers(){this._eventHandler.subscribe(this.grid.onColumnsReordered,Mt.bind(this)),this._eventHandler.subscribe(this.grid.onClick,u=>this.hideMenu(u)),this._eventHandler.subscribe(this.grid.onBeforeDestroy,this.dispose.bind(this)),this._eventHandler.subscribe(this.grid.onSetOptions,(u,e)=>{if(e&&e.optionsBefore&&e.optionsAfter){const a=e.optionsBefore.frozenColumn>=0&&e.optionsAfter.frozenColumn===-1,i=e.optionsBefore.frozenColumn===-1&&e.optionsAfter.frozenColumn>=0;(a||i)&&this.recreateGridMenu()}})}init(){this._gridUid=this.grid.getUID()??"",B.addSlickEventPubSubWhenDefined(this.pubSubService,this),this._userOriginalGridMenu={...this.sharedService.gridOptions.gridMenu},this._addonOptions={...this._defaults,...this.getDefaultGridMenuOptions(),...this.sharedService.gridOptions.gridMenu},this.sharedService.gridOptions.gridMenu=this._addonOptions;const u=this._userOriginalGridMenu.commandItems,e=this._userOriginalGridMenu&&Array.isArray(u)?u:[];this._addonOptions.commandItems=[...e,...this.addGridMenuCustomCommands(e)],this.extensionUtility.translateMenuItemsFromTitleKey(this._addonOptions.commandItems||[],"commandItems"),this.extensionUtility.sortItems(this._addonOptions.commandItems,"positionOrder"),this.createGridMenu()}dispose(){this.deleteMenu(),super.dispose()}deleteMenu(){var u,e;this._bindEventService.unbindAll(),(u=this._menuElm)==null||u.remove(),this._menuElm=null,(e=this._gridMenuButtonElm)==null||e.remove(),this._headerElm&&(this._headerElm.style.width="100%")}createColumnPickerContainer(){this._menuElm&&(W1.call(this,this._menuElm),this._listElm=v("div",{className:"slick-column-picker-list",role:"menu"}),this._bindEventService.bind(this._menuElm,"click",U1.bind(this),void 0,"parent-menu"))}createGridMenu(){var t,r;const u=this._gridUid?`.${this._gridUid}`:"",e=((t=this._addonOptions)==null?void 0:t.menuWidth)||this._defaults.menuWidth,a=this.gridOptions.hasOwnProperty("frozenColumn")&&this.gridOptions.frozenColumn>=0?"right":"left",i=this.grid.getContainerNode();if(this._headerElm=i.querySelector(`.slick-header-${a}`),this._headerElm&&this._addonOptions){if(this._headerElm.style.width=`calc(100% - ${e}px)`,(this._addonOptions.resizeOnShowHeaderRow??this._defaults.resizeOnShowHeaderRow)&&this.gridOptions.showHeaderRow){const l=i.querySelector(`${u} .slick-headerrow`);l&&(l.style.width=`calc(100% - ${e}px)`)}(this._addonOptions.showButton??this._defaults.showButton)&&(this._gridMenuButtonElm=v("button",{className:"slick-grid-menu-button",ariaLabel:"Grid Menu"}),(r=this._addonOptions)!=null&&r.iconCssClass&&this._gridMenuButtonElm.classList.add(..._u(this._addonOptions.iconCssClass)),this._headerElm.parentElement.insertBefore(this._gridMenuButtonElm,this._headerElm.parentElement.firstChild),this._bindEventService.bind(this._gridMenuButtonElm,"click",this.showGridMenu.bind(this))),this.sharedService.gridOptions.gridMenu={...this._defaults,...this._addonOptions},this.translateTitleLabels(this._addonOptions),this.translateTitleLabels(this.sharedService.gridOptions.gridMenu),this._bindEventService.bind(document.body,"mousedown",this.handleBodyMouseDown.bind(this)),this._bindEventService.bind(document.body,"beforeunload",this.dispose.bind(this))}}createCommandMenu(u,e=0,a){const i=a==null?void 0:a.command;let t=e===1&&i?i.replace(/\s/g,""):"";t&&(this._subMenuParentId=t),e>1&&(t=this._subMenuParentId);const r=`${this.menuCssClass} slick-menu-level-${e} ${this._gridUid}`,o=document.body.querySelector(`.${this.menuCssClass}.slick-menu-level-${e}${this.gridUidSelector}`);if(o){if(o.dataset.subMenuParent===t)return o;this.disposeSubMenus()}const s=v("div",{role:"menu",className:r,ariaLabel:e>1?"SubMenu":"Grid Menu"});e>0&&(s.classList.add("slick-submenu"),t&&(s.dataset.subMenuParent=t));const l={grid:this.grid,menu:this._menuElm,columns:this.columns,allColumns:this.getAllColumns(),visibleColumns:this.getVisibleColumns(),level:e};return this._commandMenuElm=this.recreateCommandList(u,s,l,a),e++,s}getAllColumns(){return this._columns}getVisibleColumns(){return this.grid.getColumns()}hideMenu(u){var a,i,t;const e={grid:this.grid,menu:this._menuElm,allColumns:this.columns,visibleColumns:this.getVisibleColumns()};if(this.pubSubService.publish("onGridMenuMenuClose",e),!(typeof((a=this._addonOptions)==null?void 0:a.onMenuClose)=="function"&&this._addonOptions.onMenuClose(u,e)===!1||this.onMenuClose.notify(e,null,this).getReturnValue()===!1)){if(this._isMenuOpen=!1,typeof((i=this.grid)==null?void 0:i.autosizeColumns)=="function"){const r=this.grid.getUID()||"";this._areVisibleColumnDifferent&&r&&document.querySelector(`.${r}`)!==null&&(this.gridOptions.enableAutoSizeColumns&&this.grid.autosizeColumns(),this._areVisibleColumnDifferent=!1)}this.disposeSubMenus(),(t=this._menuElm)==null||t.remove(),this._menuElm=null}}recreateGridMenu(){this.deleteMenu(),this.init()}repositionMenu(u,e,a,i){var s,l;const t=((s=u==null?void 0:u.touches)==null?void 0:s[0])??u,r=e.classList.contains("slick-submenu"),o=r?u.target.closest(".slick-menu-item"):t.target;if(o){const E=a||this._gridMenuButtonElm,d=Iu(a),c=Iu(o),D=i??this._addonOptions,m=getComputedStyle(E),h=parseInt((m==null?void 0:m.width)??((l=this._defaults)==null?void 0:l.menuWidth),10),x=(e==null?void 0:e.offsetWidth)??0,g=(D==null?void 0:D.contentMinWidth)??this._defaults.contentMinWidth??0,F=(g>x?g:x)||0,C=(d==null?void 0:d.top)??0,A=(d==null?void 0:d.right)??0;let b,y;if(r?(y=(c==null?void 0:c.top)??0,b=(c==null?void 0:c.left)??0):(y=C+E.offsetHeight,b=(D==null?void 0:D.dropSide)==="right"?A-h:A-F),r){const R=(e==null?void 0:e.clientHeight)||0,{bottom:G,top:L}=Ai(o);(GG?"top":"bottom")==="top"?(e.classList.remove("dropdown"),e.classList.add("dropup"),y-=R-o.clientHeight):(e.classList.remove("dropup"),e.classList.add("dropdown"))}const S=this.grid.getGridPosition();let z=b+Number(x);r&&(z+=o.clientWidth);const M=document.documentElement.clientWidth;(z>=S.width||z>=M?"left":"right")==="left"||!r&&(D==null?void 0:D.dropSide)==="left"?(e.classList.remove("dropright"),e.classList.add("dropleft"),r&&(b-=Number(x))):(e.classList.remove("dropleft"),e.classList.add("dropright"),r&&(b+=o.offsetWidth)),e.style.top=`${y}px`,e.style.left=`${b}px`,g>0&&(e.style.minWidth=`${g}px`),e.style.opacity="1",e.style.display="block"}}openGridMenu(){const u=new MouseEvent("click",{bubbles:!0,cancelable:!0,composed:!1});Object.defineProperty(u,"target",{writable:!0,configurable:!0,value:v("button",{className:"slick-grid-menu-button"})}),this.showGridMenu(u)}showGridMenu(u,e){var i,t,r;const a=((i=u==null?void 0:u.touches)==null?void 0:i[0])??u;if(u.preventDefault(),bu(this._menuElm),(t=this._menuElm)==null||t.remove(),this._addonOptions){const o={grid:this.grid,menu:this._menuElm,columns:this.columns,allColumns:this.getAllColumns(),visibleColumns:this.getVisibleColumns()},s={...this._addonOptions,...e};if(s&&!this.extensionUtility.runOverrideFunctionWhenExists(s.menuUsabilityOverride,o)||typeof u.stopPropagation=="function"&&(this.pubSubService.publish("onGridMenuBeforeMenuShow",o),typeof(s==null?void 0:s.onBeforeMenuShow)=="function"&&s.onBeforeMenuShow(u,o)===!1||this.onBeforeMenuShow.notify(o,null,this).getReturnValue()===!1))return;this._menuElm=this.createCommandMenu(((r=this._addonOptions)==null?void 0:r.commandItems)??[]),this.createColumnPickerContainer(),Mt.call(this),this._columnCheckboxes=[],q1.call(this,s),document.body.appendChild(this._menuElm),this.gridOptions.darkMode&&this._menuElm.classList.add("slick-dark-mode"),this._menuElm.style.opacity="0";const l=((s==null?void 0:s.marginBottom)!==void 0?s.marginBottom:this._defaults.marginBottom)||0;this._menuElm.style.minHeight=be(s==null?void 0:s.minHeight,""),(s==null?void 0:s.height)!==void 0?this._menuElm.style.height=be(s.height,""):this._menuElm.style.maxHeight=be(s==null?void 0:s.maxHeight,`${window.innerHeight-a.clientY-l}px`);let E=u.target.nodeName==="BUTTON"?u.target:u.target.querySelector("button");E||(E=u.target.parentElement),this._menuElm.ariaExpanded="true",this._menuElm.appendChild(this._listElm),this.repositionMenu(u,this._menuElm,E,s),this._isMenuOpen=!0,this.pubSubService.publish("onGridMenuAfterMenuShow",o),typeof(s==null?void 0:s.onAfterMenuShow)=="function"&&s.onAfterMenuShow(u,o),this.onAfterMenuShow.notify(o,null,this)}}translateGridMenu(){var u;if(this.sharedService.gridOptions.gridMenu){this.sharedService.gridOptions.gridMenu.commandItems=[],this.sharedService.gridOptions.gridMenu.commandTitle="",this.sharedService.gridOptions.gridMenu.columnTitle="",this.sharedService.gridOptions.gridMenu.forceFitTitle="",this.sharedService.gridOptions.gridMenu.syncResizeTitle="";const e=this._userOriginalGridMenu&&Array.isArray(this._userOriginalGridMenu.commandItems)?this._userOriginalGridMenu.commandItems:[];this.sharedService.gridOptions.gridMenu.commandItems=[...e,...this.addGridMenuCustomCommands(e)],this.extensionUtility.translateMenuItemsFromTitleKey(((u=this._addonOptions)==null?void 0:u.commandItems)||[],"commandItems"),this.extensionUtility.sortItems(this.sharedService.gridOptions.gridMenu.commandItems,"positionOrder"),this.translateTitleLabels(this.sharedService.gridOptions.gridMenu),this.translateTitleLabels(this._addonOptions),this.extensionUtility.translateItems(this._columns,"nameKey","name")}}translateTitleLabels(u){u&&(u.commandTitle=this.extensionUtility.getPickerTitleOutputString("commandTitle","gridMenu"),u.columnTitle=this.extensionUtility.getPickerTitleOutputString("columnTitle","gridMenu"),u.forceFitTitle=this.extensionUtility.getPickerTitleOutputString("forceFitTitle","gridMenu"),u.syncResizeTitle=this.extensionUtility.getPickerTitleOutputString("syncResizeTitle","gridMenu"))}addGridMenuCustomCommands(u){var o,s;const e=this.gridOptions.backendServiceApi||null,a=[],i=this.gridOptions,t=Q0(i),r=(o=this._addonOptions)==null?void 0:o.commandLabels;if(this._addonOptions&&this.gridOptions){if(!this._addonOptions.hideClearFrozenColumnsCommand){const E="clear-pinning";u.some(d=>d!=="divider"&&d.hasOwnProperty("command")&&d.command===E)||a.push({iconCssClass:this._addonOptions.iconClearFrozenColumnsCommand||"mdi mdi-pin-off-outline",titleKey:`${t}${(r==null?void 0:r.clearFrozenColumnsCommandKey)??"CLEAR_PINNING"}`,disabled:!1,command:E,positionOrder:52})}if(this.gridOptions.enableFiltering&&!this.sharedService.hideHeaderRowAfterPageLoad){if(!this._addonOptions.hideClearAllFiltersCommand){const E="clear-filter";u.some(d=>d!=="divider"&&d.hasOwnProperty("command")&&d.command===E)||a.push({iconCssClass:this._addonOptions.iconClearAllFiltersCommand||"mdi mdi-filter-remove-outline",titleKey:`${t}${(r==null?void 0:r.clearAllFiltersCommandKey)??"CLEAR_ALL_FILTERS"}`,disabled:!1,command:E,positionOrder:50})}if(!this._addonOptions.hideToggleFilterCommand){const E="toggle-filter";u.some(d=>d!=="divider"&&d.hasOwnProperty("command")&&d.command===E)||a.push({iconCssClass:this._addonOptions.iconToggleFilterCommand||"mdi mdi-flip-vertical",titleKey:`${t}${(r==null?void 0:r.toggleFilterCommandKey)??"TOGGLE_FILTER_ROW"}`,disabled:!1,command:E,positionOrder:53})}if(e&&!this._addonOptions.hideRefreshDatasetCommand){const E="refresh-dataset";u.some(d=>d!=="divider"&&d.hasOwnProperty("command")&&d.command===E)||a.push({iconCssClass:this._addonOptions.iconRefreshDatasetCommand||"mdi mdi-sync",titleKey:`${t}${(r==null?void 0:r.refreshDatasetCommandKey)??"REFRESH_DATASET"}`,disabled:!1,command:E,positionOrder:58})}}if(!this._addonOptions.hideToggleDarkModeCommand){const E="toggle-dark-mode";u.some(d=>d!=="divider"&&d.hasOwnProperty("command")&&d.command===E)||a.push({iconCssClass:this._addonOptions.iconToggleDarkModeCommand||"mdi mdi-brightness-4",titleKey:`${t}${(r==null?void 0:r.toggleDarkModeCommandKey)??"TOGGLE_DARK_MODE"}`,disabled:!1,command:E,positionOrder:54})}if(this.gridOptions.showPreHeaderPanel&&!this._addonOptions.hideTogglePreHeaderCommand){const E="toggle-preheader";u.some(d=>d!=="divider"&&d.hasOwnProperty("command")&&d.command===E)||a.push({iconCssClass:this._addonOptions.iconTogglePreHeaderCommand||"mdi mdi-flip-vertical",titleKey:`${t}${(r==null?void 0:r.togglePreHeaderCommandKey)??"TOGGLE_PRE_HEADER_ROW"}`,disabled:!1,command:E,positionOrder:53})}if(this.gridOptions.enableSorting&&!this._addonOptions.hideClearAllSortingCommand){const E="clear-sorting";u.some(d=>d!=="divider"&&d.hasOwnProperty("command")&&d.command===E)||a.push({iconCssClass:this._addonOptions.iconClearAllSortingCommand||"mdi mdi-sort-variant-off",titleKey:`${t}${(r==null?void 0:r.clearAllSortingCommandKey)??"CLEAR_ALL_SORTING"}`,disabled:!1,command:E,positionOrder:51})}if(this.gridOptions.enableTextExport&&!this._addonOptions.hideExportCsvCommand){const E="export-csv";u.some(d=>d!=="divider"&&d.hasOwnProperty("command")&&d.command===E)||a.push({iconCssClass:this._addonOptions.iconExportCsvCommand||"mdi mdi-download",titleKey:`${t}${(r==null?void 0:r.exportCsvCommandKey)??"EXPORT_TO_CSV"}`,disabled:!1,command:E,positionOrder:55})}if(this.gridOptions.enableExcelExport&&!this._addonOptions.hideExportExcelCommand){const E="export-excel";u.some(d=>d!=="divider"&&d.hasOwnProperty("command")&&d.command===E)||a.push({iconCssClass:this._addonOptions.iconExportExcelCommand||"mdi mdi-file-excel-outline text-success",titleKey:`${t}${(r==null?void 0:r.exportExcelCommandKey)??"EXPORT_TO_EXCEL"}`,disabled:!1,command:E,positionOrder:56})}if(this.gridOptions.enableTextExport&&!this._addonOptions.hideExportTextDelimitedCommand){const E="export-text-delimited";u.some(d=>d!=="divider"&&d.hasOwnProperty("command")&&d.command===E)||a.push({iconCssClass:this._addonOptions.iconExportTextDelimitedCommand||"mdi mdi-download",titleKey:`${t}${(r==null?void 0:r.exportTextDelimitedCommandKey)??"EXPORT_TO_TAB_DELIMITED"}`,disabled:!1,command:E,positionOrder:57})}const l=((s=this._addonOptions)==null?void 0:s.commandItems)||[];(Array.isArray(a)&&a.length>0||Array.isArray(l)&&l.length>0)&&(this._addonOptions.commandTitle=this._addonOptions.commandTitle||this.extensionUtility.getPickerTitleOutputString("commandTitle","gridMenu"))}return a}executeGridMenuInternalCustomCommands(u,e){var i,t,r;const a=((i=this.sharedService)==null?void 0:i.externalRegisteredResources)||[];if(e!=null&&e.command)switch(e.command){case"clear-pinning":const o=[...this.sharedService.visibleColumns],s={frozenColumn:-1,frozenRow:-1,frozenBottom:!1,enableMouseWheelScrollHandler:!1};this.grid.setOptions(s),this.sharedService.gridOptions.frozenColumn=s.frozenColumn,this.sharedService.gridOptions.frozenRow=s.frozenRow,this.sharedService.gridOptions.frozenBottom=s.frozenBottom,this.sharedService.gridOptions.enableMouseWheelScrollHandler=s.enableMouseWheelScrollHandler,Array.isArray(o)&&this.grid.setColumns(o),this.gridOptions.enableAutoSizeColumns&&this.grid.autosizeColumns(),this.pubSubService.publish("onGridMenuClearAllPinning");break;case"clear-filter":this.filterService.clearFilters(),this.sharedService.dataView.refresh(),this.pubSubService.publish("onGridMenuClearAllFilters");break;case"clear-sorting":this.sortService.clearSorting(),this.sharedService.dataView.refresh(),this.pubSubService.publish("onGridMenuClearAllSorting");break;case"export-csv":const E=a.find(x=>x.className==="TextExportService");E!=null&&E.exportToFile?E.exportToFile({delimiter:Se.comma,format:Ou.csv}):console.error("[Slickgrid-Universal] You must register the TextExportService to properly use Export to File in the Grid Menu. Example:: this.gridOptions = { enableTextExport: true, externalResources: [new TextExportService()] };");break;case"export-excel":const d=a.find(x=>x.className==="ExcelExportService");d!=null&&d.exportToExcel?d.exportToExcel():console.error("[Slickgrid-Universal] You must register the ExcelExportService to properly use Export to Excel in the Grid Menu. Example:: this.gridOptions = { enableExcelExport: true, externalResources: [new ExcelExportService()] };");break;case"export-text-delimited":const c=a.find(x=>x.className==="TextExportService");c!=null&&c.exportToFile?c.exportToFile({delimiter:Se.tab,format:Ou.txt}):console.error("[Slickgrid-Universal] You must register the TextExportService to properly use Export to File in the Grid Menu. Example:: this.gridOptions = { enableTextExport: true, externalResources: [new TextExportService()] };");break;case"toggle-dark-mode":const D=this.sharedService.gridOptions.darkMode;this.grid.setOptions({darkMode:!D}),this.sharedService.gridOptions.darkMode=!D;break;case"toggle-filter":let m=((t=this.gridOptions)==null?void 0:t.showHeaderRow)??!1;m=!m,this.grid.setHeaderRowVisibility(m),m===!0&&(this.grid.setColumns(this.sharedService.columnDefinitions),this.grid.scrollColumnIntoView(0));break;case"toggle-preheader":const h=((r=this.gridOptions)==null?void 0:r.showPreHeaderPanel)??!1;this.grid.setPreHeaderPanelVisibility(!h);break;case"refresh-dataset":this.extensionUtility.refreshBackendDataset();break}}getDefaultGridMenuOptions(){return{commandTitle:void 0,columnTitle:this.extensionUtility.getPickerTitleOutputString("columnTitle","gridMenu"),forceFitTitle:this.extensionUtility.getPickerTitleOutputString("forceFitTitle","gridMenu"),syncResizeTitle:this.extensionUtility.getPickerTitleOutputString("syncResizeTitle","gridMenu"),iconCssClass:"mdi mdi-menu",menuWidth:18,commandItems:[],hideClearAllFiltersCommand:!1,hideRefreshDatasetCommand:!1,hideToggleFilterCommand:!1}}handleBodyMouseDown(u){if(this.menuElement){let e=!1;const a=u.target.closest(`.${this.menuCssClass}`);(this.menuElement.contains(u.target)||a)&&(e=!0),(this._isMenuOpen&&this.menuElement!==u.target&&!e&&!u.defaultPrevented||u.target.className==="close"&&a)&&this.hideMenu(u)}}handleMenuItemCommandClick(u,e,a,i=0){var t,r;if(a!=="divider"&&!a.disabled&&!a.divider)if((a.command||"")&&!a.commandItems){const s={grid:this.grid,command:a.command,item:a,allColumns:this.columns,visibleColumns:this.getVisibleColumns()};this.executeGridMenuInternalCustomCommands(u,s),this.pubSubService.publish("onGridMenuCommand",s),typeof((t=this._addonOptions)==null?void 0:t.onCommand)=="function"&&this._addonOptions.onCommand(u,s),this.onCommand.notify(s,null,this),typeof a.action=="function"&&a.action.call(this,u,s),!((r=this._addonOptions)!=null&&r.leaveOpen)&&!u.defaultPrevented&&this.hideMenu(u),u.preventDefault(),u.stopPropagation()}else a.commandItems&&this.repositionSubMenu(u,a,i)}handleMenuItemMouseOver(u,e,a,i=0){a!=="divider"&&!a.disabled&&!a.divider&&(a.commandItems?this.repositionSubMenu(u,a,i):i===0&&this.disposeSubMenus())}recreateCommandList(u,e,a,i){const t=a.level||0;if(u.length>0){const r=v("div",{className:`${this._menuCssPrefix}-command-list`,role:"menu"},e);if(t===0){this.populateCommandOrOptionTitle("command",this.addonOptions,r,t);const o=e.querySelector(".slick-command-header")??v("div",{className:"slick-command-header"});o.classList.add("with-close"),J1.call(this,o),r.appendChild(o)}return i&&t>0&&this.addSubMenuTitleWhenExists(i,r),this.populateCommandOrOptionItems("command",this._addonOptions,r,u,a,this.handleMenuItemCommandClick,this.handleMenuItemMouseOver),r}return null}repositionSubMenu(u,e,a){const i=(e==null?void 0:e.commandItems)||[],t=this.createCommandMenu(i,a+1,e);t.style.display="block",document.body.appendChild(t),this.repositionMenu(u,t)}}const V1="mdi-icon-picker-check",$1="mdi-icon-picker-uncheck";function J1(n){const e=v("button",{type:"button",className:"close",ariaLabel:"Close",textContent:"×",dataset:{dismiss:this instanceof qr?"slick-column-picker":"slick-grid-menu"}});n.appendChild(e)}function W1(n){var e,a;const u=this;(e=u.addonOptions)!=null&&e.columnTitle&&(u._columnTitleElm=v("div",{className:"slick-menu-title",textContent:((a=u.addonOptions)==null?void 0:a.columnTitle)??u._defaults.columnTitle},n))}function U1(n){var r,o;const u=this,e=u instanceof qr?"columnPicker":"gridMenu",a=(r=n.target)==null?void 0:r.closest(".icon-checkbox-container"),i=a==null?void 0:a.querySelector(".mdi"),t=!!n.target.checked;if(n.target.ariaChecked=String(t),Ts(i,t),n.target.dataset.option==="autoresize"){const s=u.getVisibleColumns();u.grid.setOptions({forceFitColumns:t}),u.grid.setColumns(s);return}if(n.target.dataset.option==="syncresize"){u.grid.setOptions({syncColumnCellResize:t});return}if(n.target.type==="checkbox"){u._areVisibleColumnDifferent=!0;const s=n.target.dataset.columnid||"",l=[];if(u._columnCheckboxes.forEach((c,D)=>{c.checked&&l.push(u.columns[D])}),!l.length){n.target.checked=!0,Ts(i,!0);return}if(u.grid.setColumns(l),(!u.sharedService.visibleColumns||Array.isArray(l)&&l.length!==u.sharedService.visibleColumns.length)&&(u.sharedService.visibleColumns=l),u.gridOptions.enableRowSelection&&t){const c=u.grid.getSelectedRows();u.grid.setSelectedRows(c)}const E=u.gridOptions.frozenColumn??-1;E>=0&&u.extensionUtility.readjustFrozenColumnIndexWhenNeeded(E,u.columns,l);const d={columnId:s,showing:t,allColumns:u.columns,visibleColumns:l,columns:l,grid:u.grid};u.pubSubService.publish(`on${N0(e)}ColumnsChanged`,d),typeof((o=u.addonOptions)==null?void 0:o.onColumnsChanged)=="function"&&u.addonOptions.onColumnsChanged(n,d),u.onColumnsChanged.notify(d,null,u)}}function Ts(n,u=!1){n&&(n.className=`mdi ${u?V1:$1}`)}function fn(n,u,e,a=!1){const i=v("label",{className:"checkbox-picker-label",htmlFor:u}),t=v("div",{className:"icon-checkbox-container"}),r=v("input",{id:u,type:"checkbox",dataset:e}),o=v("div",{className:`mdi ${a?V1:$1}`}),s=v("span",{className:"checkbox-label"});return t.appendChild(r),t.appendChild(o),i.appendChild(t),i.appendChild(s),n.appendChild(i),a&&(r.ariaChecked="true",r.checked=!0),{inputElm:r,labelElm:i,labelSpanElm:s}}function q1(n){const u=this,e=u instanceof G1?"gridmenu-":"";for(const a of u.columns){const i=a.id,t=document.createElement("li");a.excludeFromColumnPicker&&(t.className="hidden");const r=`${u._gridUid}-${e}colpicker-${i}`,o=u.grid.getColumnIndex(i)>=0,{inputElm:s,labelElm:l,labelSpanElm:E}=fn(t,r,{columnid:`${i}`},o);u._columnCheckboxes.push(s);const c=(typeof(n==null?void 0:n.headerColumnValueExtractor)=="function"?n.headerColumnValueExtractor:u._defaults.headerColumnValueExtractor)(a,u.gridOptions);this.grid.applyHtmlCode(E,c),t.appendChild(l),u._listElm.appendChild(t)}if((!n.hideForceFitButton||!n.hideSyncResizeButton)&&u._listElm.appendChild(document.createElement("hr")),!(n!=null&&n.hideForceFitButton)){const a=document.createElement("li"),i=`${u._gridUid}-${e}colpicker-forcefit`,{labelSpanElm:t}=fn(a,i,{option:"autoresize"},u.gridOptions.forceFitColumns);t.textContent=(n==null?void 0:n.forceFitTitle)??"",u._listElm.appendChild(a)}if(!(n!=null&&n.hideSyncResizeButton)){const a=document.createElement("li"),i=`${u._gridUid}-${e}colpicker-syncresize`,{labelSpanElm:t}=fn(a,i,{option:"syncresize"},u.gridOptions.forceFitColumns);t.textContent=(n==null?void 0:n.syncResizeTitle)??"",u._listElm.appendChild(a)}}function Mt(){const n=this,u=n.grid.getColumns().slice(0),e=new Array(n.columns.length);for(let a=0;aE0(r.name||"","innerHTML")},this._bindEventService=new vu,this._eventHandler=new Tu,this._columns=this.sharedService.allColumns??[],this._gridUid=((t=(i=this.grid)==null?void 0:i.getUID)==null?void 0:t.call(i))??"",this.init()}get addonOptions(){return this.gridOptions.columnPicker||{}}get eventHandler(){return this._eventHandler}get columns(){return this._columns}set columns(u){this._columns=u}get gridOptions(){return this.sharedService.gridOptions??{}}get grid(){return this.sharedService.slickGrid}get menuElement(){return this._menuElm}init(){this._gridUid=this.grid.getUID()??"",this.gridOptions.columnPicker={...this._defaults,...this.gridOptions.columnPicker},this.onColumnsChanged.setPubSubService(this.pubSubService),this.addonOptions.columnTitle=this.extensionUtility.getPickerTitleOutputString("columnTitle","columnPicker"),this.addonOptions.forceFitTitle=this.extensionUtility.getPickerTitleOutputString("forceFitTitle","columnPicker"),this.addonOptions.syncResizeTitle=this.extensionUtility.getPickerTitleOutputString("syncResizeTitle","columnPicker"),this._eventHandler.subscribe(this.grid.onHeaderContextMenu,this.handleHeaderContextMenu.bind(this)),this._eventHandler.subscribe(this.grid.onColumnsReordered,Mt.bind(this)),this._eventHandler.subscribe(this.grid.onClick,this.disposeMenu.bind(this)),this._bindEventService.bind(document.body,"mousedown",this.handleBodyMouseDown.bind(this),void 0,"body"),this._bindEventService.bind(document.body,"beforeunload",this.dispose.bind(this),void 0,"body")}dispose(){this._eventHandler.unsubscribeAll(),this._bindEventService.unbindAll(),this.disposeMenu()}disposeMenu(){var u,e;this._bindEventService.unbindAll("parent-menu"),(u=this._listElm)==null||u.remove(),(e=this._menuElm)==null||e.remove(),this._menuElm=null}createPickerMenu(){const u=v("div",{ariaExpanded:"true",className:`slick-column-picker ${this._gridUid}`,role:"menu"});return Mt.call(this),W1.call(this,u),J1.call(this,u),this._listElm=v("div",{className:"slick-column-picker-list",role:"menu"}),this._bindEventService.bind(u,"click",U1.bind(this),void 0,"parent-menu"),document.body.appendChild(u),u}getAllColumns(){return this._columns}getVisibleColumns(){return this.grid.getColumns()}translateColumnPicker(){this.addonOptions&&(this.addonOptions.columnTitle="",this.addonOptions.forceFitTitle="",this.addonOptions.syncResizeTitle="",this.addonOptions.columnTitle=this.extensionUtility.getPickerTitleOutputString("columnTitle","columnPicker"),this.addonOptions.forceFitTitle=this.extensionUtility.getPickerTitleOutputString("forceFitTitle","columnPicker"),this.addonOptions.syncResizeTitle=this.extensionUtility.getPickerTitleOutputString("syncResizeTitle","columnPicker")),this.extensionUtility.translateItems(this._columns,"nameKey","name"),this.translateTitleLabels(this.addonOptions)}handleBodyMouseDown(u){var e;(this._menuElm!==u.target&&!((e=this._menuElm)!=null&&e.contains(u.target))||u.target.className==="close"&&u.target.closest(".slick-column-picker"))&&this.disposeMenu()}handleHeaderContextMenu(u){u.preventDefault(),bu(this._listElm),this._columnCheckboxes=[],this._menuElm=this.createPickerMenu(),this.gridOptions.darkMode&&this._menuElm.classList.add("slick-dark-mode"),q1.call(this,this.addonOptions),document.body.appendChild(this._menuElm),this.repositionMenu(u)}repositionMenu(u){var a;const e=((a=u==null?void 0:u.touches)==null?void 0:a[0])??u;this._menuElm&&(this._menuElm.style.top=`${e.pageY-10}px`,this._menuElm.style.left=`${e.pageX-10}px`,this._menuElm.style.minHeight=be(this.addonOptions.minHeight,""),this._menuElm.style.maxHeight=be(this.addonOptions.maxHeight,`${window.innerHeight-e.clientY}px`),this._menuElm.style.display="block",this._menuElm.ariaExpanded="true",this._menuElm.appendChild(this._listElm))}translateTitleLabels(u){u&&(u.columnTitle=this.extensionUtility.getPickerTitleOutputString("columnTitle","gridMenu"))}}const lt=(n,u,e,a,i,t)=>{const r=a.params||{};if(!r.formatters||!Array.isArray(r.formatters))throw new Error(`[Slickgrid-Universal] The multiple formatter requires the "formatters" to be provided as a column params.
- For example: this.columnDefinitions = [{ id: title, field: title, formatter: Formatters.multiple, params: { formatters: [Formatters.lowercase, Formatters.uppercase] }`);const o=r.formatters;let s=e;return o.forEach((l,E)=>{if(typeof l!="function")throw new Error(`[Slickgrid-Universal] the "params.formatters" at index(${E}) to be used by "Formatters.multiple" is invalid, please verify all formatter functions.`);s=l.call(void 0,n,u,s,a,i,t)}),s};function _s(n,u){if(Array.isArray(n)){for(const e of n)if(e.editor)if(e.formatter&&e.formatter!==lt&&e.formatter!==u){const a=e.formatter;e.formatter=lt,e.params={...e.params,formatters:[a,u]}}else e.formatter&&e.formatter===lt&&e.params?e.params.formatters.findIndex(a=>a===u)===-1&&(e.params.formatters=[...e.params.formatters,u]):e.formatter=u}}function Qu(n,u,e,a){let i,t,r="",o="";switch(e){case"currency":i=T.DEFAULT_FORMATTER_CURRENCY_MIN_DECIMAL,t=T.DEFAULT_FORMATTER_CURRENCY_MAX_DECIMAL;break;case"decimal":i=T.DEFAULT_FORMATTER_NUMBER_MIN_DECIMAL,t=T.DEFAULT_FORMATTER_NUMBER_MAX_DECIMAL;break;case"percent":i=T.DEFAULT_FORMATTER_PERCENT_MIN_DECIMAL,t=T.DEFAULT_FORMATTER_PERCENT_MAX_DECIMAL;break}const s=u&&typeof u.getOptions=="function"?u.getOptions():{},l=oe("minDecimal",n,s,i),E=oe("maxDecimal",n,s,t),d=oe("decimalSeparator",n,s,T.DEFAULT_NUMBER_DECIMAL_SEPARATOR),c=oe("thousandSeparator",n,s,T.DEFAULT_NUMBER_THOUSAND_SEPARATOR),D=oe("displayNegativeNumberWithParentheses",n,s,T.DEFAULT_NEGATIVE_NUMBER_WRAPPED_IN_BRAQUET),m=oe("currencyPrefix",n,s,""),h=oe("currencySuffix",n,s,"");return a==="cell"&&(r=oe("numberPrefix",n,s,""),o=oe("numberSuffix",n,s,"")),{minDecimal:l,maxDecimal:E,decimalSeparator:d,thousandSeparator:c,wrapNegativeNumber:D,currencyPrefix:m,currencySuffix:h,numberPrefix:r,numberSuffix:o}}function oe(n,u,e,a){var t;const i=u&&u.params;return i&&i.hasOwnProperty(n)?i[n]:(t=e==null?void 0:e.formatterOptions)!=null&&t.hasOwnProperty(n)?e.formatterOptions[n]:a}function qu(n,u){const e=$0(n,!0);return(a,i,t,r,o,s)=>{var x,g;const l=s&&typeof s.getOptions=="function"?s.getOptions():{},E=((x=l==null?void 0:l.formatterOptions)==null?void 0:x.dateSeparator)??u,d=(r==null?void 0:r.type)??p.date,c=$0(d,!0),D=((g=r==null?void 0:r.params)==null?void 0:g.parseDateAsUtc)??!1,m=Be(t,c);let h=t;if(m){let F=t;D&&(F=sD(m)),h=l0(F,e,"en-US")}if(h&&E!==u){const F=new RegExp(u,"ig");h=h.replace(F,E)}return h}}function Zr(n,u,e,a,i,t){let r=!1;e!=null&&e.hasOwnProperty("exportWithFormatter")?r=!!e.exportWithFormatter:t!=null&&t.hasOwnProperty("exportWithFormatter")&&(r=!!t.exportWithFormatter);let o;a&&e.exportCustomFormatter?o=e.exportCustomFormatter:r&&e.formatter&&(o=e.formatter);const s=Yt(o,n,u,e,a,i);return t!=null&&t.sanitizeDataExport&&typeof s=="string"?Wu(s):s}function Yt(n,u,e,a,i,t){let r="",s=a.field||a.id||"";if(typeof a.field=="string"&&a.field.indexOf(".")>0){const E=a.field.split(".");s=E.length>0?E[0]:a.field}const l=i!=null&&i.hasOwnProperty(s)?i[s]:null;if(typeof n=="function"){const E=n(u,e,l,a,i,t),d=ca(E)?E:E.html||E.text;r=E0(d)}else r=i!=null&&i.hasOwnProperty(s)?l:"";return r==null&&(r=""),typeof r=="object"&&!(r instanceof Date)&&Object.entries(r).length===0&&(r=""),r}class hh extends O1{constructor(u,e,a,i){super(u,e,a),this.extensionUtility=u,this.pubSubService=e,this.sharedService=a,this.treeDataService=i,this._defaults={autoAdjustDrop:!0,autoAlignSide:!0,autoAdjustDropOffset:0,autoAlignSideOffset:0,hideMenuOnScroll:!1,optionShownOverColumnIds:[],commandShownOverColumnIds:[],subMenuOpenByEvent:"mouseover"},this.pluginName="ContextMenu",this._camelPluginName="contextMenu",this._menuCssPrefix="slick-menu",this._menuPluginCssPrefix="slick-context-menu",this.init(a.gridOptions.contextMenu)}init(u){this._addonOptions={...this._defaults,...u};const e=this._addonOptions&&Array.isArray(this._addonOptions.commandItems)?this._addonOptions.commandItems:[];this._addonOptions.commandItems=[...e,...this.addMenuCustomCommands(e)],this._addonOptions={...this._addonOptions},this.sharedService.gridOptions.contextMenu=this._addonOptions,this.sortMenuItems(),this._eventHandler.subscribe(this.grid.onContextMenu,this.handleOnContextMenu.bind(this)),this._eventHandler.subscribe(this.grid.onClick,this.hideMenu.bind(this)),this._addonOptions.hideMenuOnScroll&&this._eventHandler.subscribe(this.grid.onScroll,this.closeMenu.bind(this))}translateContextMenu(){var a;const u=((a=this.sharedService)==null?void 0:a.gridOptions)??{},e=this.sharedService.gridOptions.contextMenu;if(e&&(u!=null&&u.enableTranslate)){const i=e.commandItems||[],t=e.optionItems||[];e.commandTitleKey&&(e.commandTitle=this.extensionUtility.translateWhenEnabledAndServiceExist(e.commandTitleKey,"TEXT_COMMANDS")||e.commandTitle),e.optionTitleKey&&(e.optionTitle=this.extensionUtility.translateWhenEnabledAndServiceExist(e.optionTitleKey,"TEXT_COMMANDS")||e.optionTitle),this.extensionUtility.translateMenuItemsFromTitleKey(i,"commandItems"),this.extensionUtility.translateMenuItemsFromTitleKey(t,"optionItems")}}handleOnContextMenu(u,e){this.disposeAllMenus();const a=this.grid.getCellFromEvent(u);if(a){const i=this.grid.getDataItem(a.row),t=this.grid.getColumns()[a.cell],r=e||{};if(r.cell=a.cell,r.row=a.row,r.column=t,r.dataContext=i,r.grid=this.grid,!this.extensionUtility.runOverrideFunctionWhenExists(this._addonOptions.menuUsabilityOverride,r))return;this._menuElm=this.createParentMenu(u),this._menuElm&&u.preventDefault(),this._menuElm&&this.gridOptions.darkMode&&this._menuElm.classList.add("slick-dark-mode"),this._menuElm&&(this.repositionMenu(u,this._menuElm),this._menuElm.ariaExpanded="true",this._menuElm.style.display="block"),this._bindEventService.bind(document.body,"mousedown",this.handleBodyMouseDown.bind(this))}}addMenuCustomCommands(u){var o;const e=[],a=this.sharedService&&this.sharedService.gridOptions||{},i=a==null?void 0:a.contextMenu,t=(o=this.sharedService)==null?void 0:o.dataView,r=Q0(a);if(i&&!i.hideCopyCellValueCommand){const s="copy";u.some(l=>l!=="divider"&&l.hasOwnProperty("command")&&l.command===s)||e.push({iconCssClass:i.iconCopyCellValueCommand||"mdi mdi-content-copy",titleKey:`${r}COPY`,disabled:!1,command:s,positionOrder:50,action:(l,E)=>{this.copyToClipboard(E)},itemUsabilityOverride:l=>{const E=l==null?void 0:l.column,d=l==null?void 0:l.dataContext;if(typeof E.queryFieldNameGetterFn=="function"){const c=mi(E,d,"");if(c!==""&&c!==void 0)return!0}else if(E&&d.hasOwnProperty(E.field))return d[E.field]!==""&&d[E.field]!==null&&d[E.field]!==void 0;return!1}})}if(a!=null&&a.enableTextExport&&i&&!i.hideExportCsvCommand){const s="export-csv";u.some(l=>l!=="divider"&&l.hasOwnProperty("command")&&l.command===s)||e.push({iconCssClass:i.iconExportCsvCommand||"mdi mdi-download",titleKey:`${r}EXPORT_TO_CSV`,disabled:!1,command:s,positionOrder:51,action:()=>{var d;const E=(((d=this.sharedService)==null?void 0:d.externalRegisteredResources)||[]).find(c=>c.className==="TextExportService");if(E!=null&&E.exportToFile)E.exportToFile({delimiter:Se.comma,format:Ou.csv});else throw new Error("[Slickgrid-Universal] You must register the TextExportService to properly use Export to File in the Context Menu. Example:: this.gridOptions = { enableTextExport: true, externalResources: [new TextExportService()] };")}})}if(a&&a.enableExcelExport&&i&&!i.hideExportExcelCommand){const s="export-excel";u.some(l=>l!=="divider"&&l.hasOwnProperty("command")&&l.command===s)||e.push({iconCssClass:i.iconExportExcelCommand||"mdi mdi-file-excel-outline text-success",titleKey:`${r}EXPORT_TO_EXCEL`,disabled:!1,command:s,positionOrder:52,action:()=>{var d;const E=(((d=this.sharedService)==null?void 0:d.externalRegisteredResources)||[]).find(c=>c.className==="ExcelExportService");if(E!=null&&E.exportToExcel)E.exportToExcel();else throw new Error("[Slickgrid-Universal] You must register the ExcelExportService to properly use Export to Excel in the Context Menu. Example:: this.gridOptions = { enableExcelExport: true, externalResources: [new ExcelExportService()] };")}})}if(a!=null&&a.enableTextExport&&i&&!i.hideExportTextDelimitedCommand){const s="export-text-delimited";u.some(l=>l!=="divider"&&l.hasOwnProperty("command")&&l.command===s)||e.push({iconCssClass:i.iconExportTextDelimitedCommand||"mdi mdi-download",titleKey:`${r}EXPORT_TO_TAB_DELIMITED`,disabled:!1,command:s,positionOrder:53,action:()=>{var d;const E=(((d=this.sharedService)==null?void 0:d.externalRegisteredResources)||[]).find(c=>c.className==="TextExportService");if(E!=null&&E.exportToFile)E.exportToFile({delimiter:Se.tab,format:Ou.txt});else throw new Error("[Slickgrid-Universal] You must register the TextExportService to properly use Export to File in the Context Menu. Example:: this.gridOptions = { enableTextExport: true, externalResources: [new TextExportService()] };")}})}if(a&&(a.enableGrouping||a.enableDraggableGrouping||a.enableTreeData)){if(i&&!i.hideCopyCellValueCommand&&e.push({divider:!0,command:"",positionOrder:54}),a&&!a.enableTreeData&&i&&!i.hideClearAllGrouping){const s="clear-grouping";u.some(l=>l!=="divider"&&l.hasOwnProperty("command")&&l.command===s)||e.push({iconCssClass:i.iconClearGroupingCommand||"mdi mdi-close",titleKey:`${r}CLEAR_ALL_GROUPING`,disabled:!1,command:s,positionOrder:55,action:()=>{t.setGrouping([]),this.pubSubService.publish("onContextMenuClearGrouping")},itemUsabilityOverride:()=>{const l=t&&t.getGrouping&&t.getGrouping();return Array.isArray(l)&&l.length>0}})}if(a&&i&&!i.hideCollapseAllGroups){const s="collapse-all-groups";u.some(l=>l!=="divider"&&l.hasOwnProperty("command")&&l.command===s)||e.push({iconCssClass:i.iconCollapseAllGroupsCommand||"mdi mdi-arrow-collapse",titleKey:`${r}COLLAPSE_ALL_GROUPS`,disabled:!1,command:s,positionOrder:56,action:()=>{a.enableTreeData?this.treeDataService.toggleTreeDataCollapse(!0):t.collapseAllGroups(),this.pubSubService.publish("onContextMenuCollapseAllGroups")},itemUsabilityOverride:()=>{if(a.enableTreeData)return!0;const l=t&&t.getGrouping&&t.getGrouping();return Array.isArray(l)&&l.length>0}})}if(a&&i&&!i.hideExpandAllGroups){const s="expand-all-groups";u.some(l=>l!=="divider"&&l.hasOwnProperty("command")&&l.command===s)||e.push({iconCssClass:i.iconExpandAllGroupsCommand||"mdi mdi-arrow-expand",titleKey:`${r}EXPAND_ALL_GROUPS`,disabled:!1,command:s,positionOrder:57,action:()=>{a.enableTreeData?this.treeDataService.toggleTreeDataCollapse(!1):t.expandAllGroups(),this.pubSubService.publish("onContextMenuExpandAllGroups")},itemUsabilityOverride:()=>{if(a.enableTreeData)return!0;const l=t&&t.getGrouping&&t.getGrouping();return Array.isArray(l)&&l.length>0}})}}return this.extensionUtility.translateMenuItemsFromTitleKey(e),e}copyToClipboard(u){var e,a;try{if(u&&u.grid&&u.command){const i=((e=this.sharedService)==null?void 0:e.gridOptions)??{},t=(u==null?void 0:u.cell)??0,r=(u==null?void 0:u.row)??0,o=u==null?void 0:u.column,s=u==null?void 0:u.dataContext,l=(a=this.sharedService)==null?void 0:a.slickGrid,E=i&&(i.excelExportOptions||i.textExportOptions);let d=Zr(r,t,o,s,l,E);typeof o.queryFieldNameGetterFn=="function"&&(d=mi(o,s,""));let c=d;typeof d=="string"&&(c=d.replace(/^([·|⮞|⮟]\s*)|([·|⮞|⮟])\s*/gi,"").replace(/[\u00b7|\u034f]/gi,"").trim());const D=document.createElement("textarea");D&&document.body&&(D.style.position="absolute",D.style.opacity="0",D.value=c,document.body.appendChild(D),D.select(),document.execCommand("copy",!1,c)&&D.remove())}}catch{}}sortMenuItems(){var e,a;const u=(a=(e=this.sharedService)==null?void 0:e.gridOptions)==null?void 0:a.contextMenu;u&&(this.extensionUtility.sortItems(u.commandItems||[],"positionOrder"),this.extensionUtility.sortItems(u.optionItems||[],"positionOrder"))}}class xh{constructor(u,e,a){this.extensionUtility=u,this.pubSubService=e,this.sharedService=a,this.columnsGroupBy=[],this.pluginName="DraggableGrouping",this._gridColumns=[],this._gridUid="",this._reorderedColumns=[],this._subscriptions=[],this._defaults={dropPlaceHolderText:"Drop a column header here to group by the column",hideGroupSortIcons:!1,hideToggleAllButton:!1,toggleAllButtonText:"",toggleAllPlaceholderText:"Toggle all Groups"},this._bindingEventService=new vu,this._eventHandler=new Tu,this.onGroupChanged=new N("onGroupChanged")}get addonOptions(){return this._addonOptions}get dataView(){var u;return((u=this.grid)==null?void 0:u.getData())??{}}get dropboxElement(){return this._dropzoneElm}get droppableInstance(){return this._droppableInstance}get sortableLeftInstance(){return this._sortableLeftInstance}get sortableRightInstance(){return this._sortableRightInstance}get eventHandler(){return this._eventHandler}get grid(){return this._grid??this.sharedService.slickGrid??{}}get gridOptions(){return this.sharedService.gridOptions??{}}get gridUid(){var u;return this._gridUid||(((u=this.grid)==null?void 0:u.getUID())??"")}get gridContainer(){return this.grid.getContainerNode()}init(u,e){var a,i;if(this._addonOptions={...this._defaults,...e},this._grid=u,u){if(this._gridUid=u.getUID(),this._gridColumns=u.getColumns(),this._dropzoneElm=u.getPreHeaderPanel(),this._dropzoneElm.classList.add("slick-dropzone"),this.onGroupChanged.setPubSubService(this.pubSubService),!this._addonOptions.hideToggleAllButton){this._groupToggler=v("div",{className:"slick-group-toggle-all",title:this._addonOptions.toggleAllPlaceholderText??"",style:{display:"none"}});const t=v("span",{className:"slick-group-toggle-all-icon"},this._groupToggler);this.gridOptions.enableTranslate&&this._addonOptions.toggleAllButtonTextKey&&(this._addonOptions.toggleAllButtonText=this.extensionUtility.translateWhenEnabledAndServiceExist(this._addonOptions.toggleAllButtonTextKey,"TEXT_TOGGLE_ALL_GROUPS")),this.gridOptions.enableTranslate&&this._addonOptions.toggleAllPlaceholderTextKey&&(this._addonOptions.toggleAllPlaceholderText=this.extensionUtility.translateWhenEnabledAndServiceExist(this._addonOptions.toggleAllPlaceholderTextKey,"TEXT_TOGGLE_ALL_GROUPS")),this._groupToggler.title=this._addonOptions.toggleAllPlaceholderText??"",this._addonOptions.toggleAllButtonText&&this._groupToggler.appendChild(v("span",{className:"slick-group-toggle-all-text",textContent:this._addonOptions.toggleAllButtonText||""})),this._dropzoneElm.appendChild(this._groupToggler),this._subscriptions.push(this.pubSubService.subscribe("onContextMenuCollapseAllGroups",()=>this.toggleGroupToggler(t,!0,!1)),this.pubSubService.subscribe("onContextMenuExpandAllGroups",()=>this.toggleGroupToggler(t,!1,!1)))}this._dropzonePlaceholderElm=v("div",{className:"slick-draggable-dropzone-placeholder"},this._dropzoneElm),this.gridOptions.enableTranslate&&((a=this._addonOptions)!=null&&a.dropPlaceHolderTextKey)&&(this._addonOptions.dropPlaceHolderText=this.extensionUtility.translateWhenEnabledAndServiceExist(this._addonOptions.dropPlaceHolderTextKey,"TEXT_TOGGLE_ALL_GROUPS")),this._dropzonePlaceholderElm.textContent=((i=this._addonOptions)==null?void 0:i.dropPlaceHolderText)??this._defaults.dropPlaceHolderText??"",this.setupColumnDropbox(),this._eventHandler.subscribe(u.onHeaderCellRendered,(t,r)=>{var s;const o=r.node;if(!Yn((s=r.column)==null?void 0:s.grouping)&&o&&(o.style.cursor="pointer",this._addonOptions.groupIconCssClass)){const l=v("span",{className:"slick-column-groupable"},o);this._addonOptions.groupIconCssClass&&l.classList.add(..._u(this._addonOptions.groupIconCssClass))}}),this._subscriptions.push(this.pubSubService.subscribe("onContextMenuClearGrouping",()=>this.clearDroppedGroups()));for(const t of this._gridColumns){const r=t.field;u.updateColumnHeader(r)}}return this}dispose(){var u,e;this.destroySortableInstances(),(u=this._droppableInstance)!=null&&u.el&&((e=this._droppableInstance)==null||e.destroy()),this.onGroupChanged.unsubscribe(),this._eventHandler.unsubscribeAll(),this.pubSubService.unsubscribeAll(this._subscriptions),this._bindingEventService.unbindAll(),bu(this.gridContainer.querySelector(`.${this.gridUid} .slick-preheader-panel`))}clearDroppedGroups(){this.columnsGroupBy=[],this.updateGroupBy("clear-all");const u=this._dropzoneElm.querySelectorAll(".slick-dropped-grouping");for(const e of Array.from(u)){const a=this._dropzoneElm.querySelector(".slick-groupby-remove");a==null||a.remove(),e==null||e.remove()}this._dropzonePlaceholderElm.style.display="inline-block",this._groupToggler&&(this._groupToggler.style.display="none")}destroySortableInstances(){var u,e,a,i;(u=this._sortableLeftInstance)!=null&&u.el&&((e=this._sortableLeftInstance)==null||e.destroy()),(a=this._sortableRightInstance)!=null&&a.el&&((i=this._sortableRightInstance)==null||i.destroy())}setAddonOptions(u){this._addonOptions={...this._addonOptions,...u}}setColumns(u){this._gridColumns=u}setDroppedGroups(u){this._dropzonePlaceholderElm.style.display="none";const e=Array.isArray(u)?u:[u];for(const a of e){const i=this.grid.getHeaderColumn(a);this.handleGroupByDrop(this._dropzoneElm,i)}}setupColumnReorder(u,e,a,i,t,r,o,s,l){this.destroySortableInstances();const E=u.getPreHeaderPanel(),d=E.querySelector(".slick-draggable-dropzone-placeholder"),c=E.querySelector(".slick-group-toggle-all"),D={animation:50,chosenClass:"slick-header-column-active",ghostClass:"slick-sortable-placeholder",draggable:".slick-header-column",dataIdAttr:"data-id",group:{name:"shared",pull:"clone",put:!1},revertClone:!0,onStart:()=>{d&&(d.style.display="inline-block"),E.querySelectorAll(".slick-dropped-grouping").forEach(h=>h.style.display="none"),c&&(c.style.display="none")},onEnd:m=>{var C,A,b;E==null||E.classList.remove("slick-dropzone-hover"),(C=d==null?void 0:d.parentElement)==null||C.classList.remove("slick-dropzone-placeholder-hover");const h=E.querySelectorAll(".slick-dropped-grouping");if(h.forEach(y=>y.style.display="flex"),h.length&&(d&&(d.style.display="none"),c&&(c.style.display="inline-flex")),!u.getEditorLock().commitCurrentEdit())return;const x=((A=this.sortableLeftInstance)==null?void 0:A.toArray())??[];if(e.length>1){const y=((b=this._sortableRightInstance)==null?void 0:b.toArray())??[];for(const S of y)x.push(S)}const g=[],F=u.getColumns();for(const y of x)g.push(F[o.call(u,y)]);i.call(u,g),l.call(u,u.onColumnsReordered,{grid:u}),m.stopPropagation(),t.call(u)}};return this._sortableLeftInstance=uu.create(this.gridContainer.querySelector(`.${u.getUID()} .slick-header-columns.slick-header-columns-left`),D),this._sortableRightInstance=uu.create(this.gridContainer.querySelector(`.${u.getUID()} .slick-header-columns.slick-header-columns-right`),D),{sortableLeftInstance:this._sortableLeftInstance,sortableRightInstance:this._sortableRightInstance}}addColumnGroupBy(u){this.columnsGroupBy.push(u),this.updateGroupBy("add-group")}addGroupByRemoveClickHandler(u,e,a,i){this._bindingEventService.bind(e,"click",()=>{const t=this._bindingEventService.boundedEvents.filter(r=>r.element===e);for(const r of t)this._bindingEventService.unbind(r.element,"click",r.listener);this.removeGroupBy(u,a,i)})}addGroupSortClickHandler(u,e){const{grouping:a,type:i}=u;this._bindingEventService.bind(e,"click",()=>{if(this.toggleGroupAll(u,!1),a){const t=a.sortAsc?ju.desc:ju.asc;a.comparer=(r,o)=>Ma(i||"text",r.value,o.value,t,u,this.gridOptions),this.getGroupBySortIcon(e,!a.sortAsc),this.updateGroupBy("sort-group"),a.sortAsc=!a.sortAsc,this.grid.invalidate()}})}getGroupBySortIcon(u,e=!0){e?this._addonOptions.sortAscIconCssClass?(u.classList.remove(..._u(this._addonOptions.sortDescIconCssClass)),u.classList.add(..._u(this._addonOptions.sortAscIconCssClass))):(u.classList.add("slick-groupby-sort-asc-icon"),u.classList.remove("slick-groupby-sort-desc-icon")):this._addonOptions.sortDescIconCssClass?(u.classList.remove(..._u(this._addonOptions.sortAscIconCssClass)),u.classList.add(..._u(this._addonOptions.sortDescIconCssClass))):this._addonOptions.sortDescIconCssClass||(u.classList.add("slick-groupby-sort-desc-icon"),u.classList.remove("slick-groupby-sort-asc-icon"))}handleGroupByDrop(u,e){var t,r,o;const a=(t=e.getAttribute("data-id"))==null?void 0:t.replace(this._gridUid,"");let i=!0;for(const s of this.columnsGroupBy)s.id===a&&(i=!1);if(i){for(const s of this._gridColumns)if(s.id===a&&s.grouping&&!Yn(s.grouping)){const l=e.querySelector(".slick-column-name"),E=v("div",{id:`${this._gridUid}_${s.id}_entry`,className:"slick-dropped-grouping",dataset:{id:`${s.id}`}});v("div",{className:"slick-dropped-grouping-title",style:{display:"inline-flex"},textContent:l?l.textContent:e.textContent},E);const d=v("div",{className:"slick-groupby-remove"});this._addonOptions.deleteIconCssClass&&d.classList.add(..._u(this._addonOptions.deleteIconCssClass)),this._addonOptions.deleteIconCssClass||d.classList.add("slick-groupby-remove-icon");let c;((r=this._addonOptions)==null?void 0:r.hideGroupSortIcons)!==!0&&s.sortable&&(((o=s.grouping)==null?void 0:o.sortAsc)===void 0&&(s.grouping.sortAsc=!0),c=v("div",{className:"slick-groupby-sort"},E),this.getGroupBySortIcon(c,s.grouping.sortAsc)),E.appendChild(d),E.appendChild(document.createElement("div")),u.appendChild(E),this._groupToggler&&this.columnsGroupBy.length===0&&this.toggleGroupAll(s),this.addColumnGroupBy(s),this.addGroupByRemoveClickHandler(s.id,d,e,E),c&&this.addGroupSortClickHandler(s,c)}this._groupToggler&&this.columnsGroupBy.length>0&&(this._groupToggler.style.display="inline-flex")}}toggleGroupAll({grouping:u},e){var i;const a=(i=this._groupToggler)==null?void 0:i.querySelector(".slick-group-toggle-all-icon");e===!0||u!=null&&u.collapsed?(a==null||a.classList.add("collapsed"),a==null||a.classList.remove("expanded")):(a==null||a.classList.add("expanded"),a==null||a.classList.remove("collapsed"))}removeFromArray(u,e){if(Array.isArray(u)){const a=u.findIndex(i=>i.id===e.id);a>=0&&u.splice(a,1)}return u}removeGroupBy(u,e,a){a.remove();const i=[];this._gridColumns.forEach(t=>i[t.id]=t),this.removeFromArray(this.columnsGroupBy,i[u]),this.columnsGroupBy.length===0&&(this._dropzonePlaceholderElm.style.display="inline-block",this._groupToggler&&(this._groupToggler.style.display="none")),this.updateGroupBy("remove-group")}addDragOverDropzoneListeners(){const u=this._dropzoneElm.querySelector(".slick-draggable-dropzone-placeholder");u&&this._dropzoneElm&&(this._bindingEventService.bind(u,"dragover",e=>e.preventDefault()),this._bindingEventService.bind(u,"dragenter",()=>this._dropzoneElm.classList.add("slick-dropzone-hover")),this._bindingEventService.bind(u,"dragleave",()=>this._dropzoneElm.classList.remove("slick-dropzone-hover")))}setupColumnDropbox(){const u=this._dropzoneElm;this._droppableInstance=uu.create(u,{group:"shared",ghostClass:"slick-droppable-sortitem-hover",draggable:".slick-dropped-grouping",dragoverBubble:!0,onAdd:e=>{var i,t;const a=e.item;(i=a.getAttribute("id"))!=null&&i.replace(this._gridUid,"")&&this.handleGroupByDrop(u,uu.utils.clone(e.item)),(t=a.parentNode)==null||t.removeChild(a)},onUpdate:()=>{var i;const e=((i=this._droppableInstance)==null?void 0:i.toArray())??[],a=[];for(const t of e)for(const r of this.columnsGroupBy)if(r.id===t){a.push(r);break}this.columnsGroupBy=a,this.updateGroupBy("sort-group")}}),this.addDragOverDropzoneListeners(),this._groupToggler&&this._bindingEventService.bind(this._groupToggler,"click",e=>{const a=e.target.classList.contains("slick-group-toggle-all-icon")?e.target:e.currentTarget.querySelector(".slick-group-toggle-all-icon");this.toggleGroupToggler(a,a==null?void 0:a.classList.contains("expanded"))})}toggleGroupToggler(u,e=!0,a=!0){u&&(e===!0?(u.classList.add("collapsed"),u.classList.remove("expanded"),a&&this.dataView.collapseAllGroups()):(u.classList.remove("collapsed"),u.classList.add("expanded"),a&&this.dataView.expandAllGroups()))}updateGroupBy(u){if(this.columnsGroupBy.length===0){this.dataView.setGrouping([]),this._dropzonePlaceholderElm.style.display="inline-block",this.triggerOnGroupChangedEvent({caller:u,groupColumns:[]});return}const e=[];this.columnsGroupBy.forEach(a=>e.push(a.grouping)),this.dataView.setGrouping(e),this._dropzonePlaceholderElm.style.display="none",this.triggerOnGroupChangedEvent({caller:u,groupColumns:e})}triggerOnGroupChangedEvent(u){this._addonOptions&&typeof this._addonOptions.onGroupChanged=="function"&&this._addonOptions.onGroupChanged(new Pu,u),this.onGroupChanged.notify(u)}}class gh extends qt{constructor(u,e,a){super(u,e,a),this.extensionUtility=u,this.pubSubService=e,this.sharedService=a,this._buttonElms=[],this._defaults={buttonCssClass:"slick-header-button"},this.pluginName="HeaderButtons",this._menuCssPrefix="slick-header-button",this._camelPluginName="headerButtons",this._bindEventService=new vu,this._eventHandler=new Tu,this.init(a.gridOptions.headerButton)}get addonOptions(){return this._addonOptions}set addonOptions(u){this._addonOptions=u}get eventHandler(){return this._eventHandler}get grid(){return this.sharedService.slickGrid}init(u){this._addonOptions={...this._defaults,...u},this._eventHandler.subscribe(this.grid.onHeaderCellRendered,this.handleHeaderCellRendered.bind(this)),this._eventHandler.subscribe(this.grid.onBeforeHeaderCellDestroy,this.handleBeforeHeaderCellDestroy.bind(this)),this.grid.setColumns(this.grid.getColumns())}dispose(){super.dispose(),this._buttonElms.forEach(u=>u.remove())}handleHeaderCellRendered(u,e){var i;const a=e.column;if((i=a.header)!=null&&i.buttons&&Array.isArray(a.header.buttons)){let t=a.header.buttons.length;for(;t--;){const r=a.header.buttons[t],o=this.populateSingleCommandOrOptionItem("command",this.addonOptions,null,r,e,this.handleButtonClick.bind(this));o&&r.handler&&!r.disabled&&this._bindEventService.bind(o,"click",s=>r.handler.call(this,s)),o&&(this._buttonElms.push(o),e.node.appendChild(o))}}}handleBeforeHeaderCellDestroy(u,e){var i,t,r;if((i=e.column.header)!=null&&i.buttons&&((t=this._addonOptions)!=null&&t.buttonCssClass)){const o=(((r=this._addonOptions)==null?void 0:r.buttonCssClass)||"").replace(/(\s+)/g,".");o&&e.node.querySelectorAll(`.${o}`).forEach(s=>s.remove())}}handleButtonClick(u,e,a,i,t){var r;if(a.command&&!a.disabled){const o=a.command||"",s={grid:this.grid,column:t,button:a};o&&(s.command=o),typeof a.action=="function"&&!a.disabled&&a.action.call(this,u,s),o!==null&&!a.disabled&&((r=this._addonOptions)!=null&&r.onCommand)&&(this.pubSubService.publish("onHeaderButtonCommand",s),this._addonOptions.onCommand(u,s),t!=null&&t.id&&this.grid.updateColumnHeader(t.id))}u.preventDefault(),u.stopPropagation()}}class Ch extends qt{constructor(u,e,a,i,t){super(u,a,i),this.extensionUtility=u,this.filterService=e,this.pubSubService=a,this.sharedService=i,this.sortService=t,this._subMenuParentId="",this._defaults={autoAlign:!0,autoAlignOffset:0,buttonCssClass:null,buttonImage:null,minWidth:100,hideColumnHideCommand:!1,hideSortCommands:!1,title:"",subMenuOpenByEvent:"mouseover"},this.pluginName="HeaderMenu",this._menuCssPrefix="slick-menu",this._menuPluginCssPrefix="slick-header-menu",this._camelPluginName="headerMenu",this.sharedService.gridOptions.headerMenu=this.addHeaderMenuCustomCommands(this.sharedService.columnDefinitions),this.init(i.gridOptions.headerMenu)}init(u){this._addonOptions={...this._defaults,...u},this._eventHandler.subscribe(this.grid.onBeforeSetColumns,(e,a)=>{this.sharedService.gridOptions.headerMenu=this.addHeaderMenuCustomCommands(a.newColumns)}),this._eventHandler.subscribe(this.grid.onHeaderCellRendered,this.handleHeaderCellRendered.bind(this)),this._eventHandler.subscribe(this.grid.onBeforeHeaderCellDestroy,this.handleBeforeHeaderCellDestroy.bind(this)),this._eventHandler.subscribe(this.grid.onClick,this.hideMenu.bind(this)),this.grid.setColumns(this.grid.getColumns()),this._bindEventService.bind(document.body,"mousedown",this.handleBodyMouseDown.bind(this))}dispose(){var u;super.dispose(),this._menuElm=this._menuElm||document.body.querySelector(`.slick-header-menu${this.gridUidSelector}`),(u=this._menuElm)==null||u.remove(),this._activeHeaderColumnElm=void 0}hideColumn(u){var e,a;if((a=(e=this.sharedService)==null?void 0:e.slickGrid)!=null&&a.getColumnIndex){const i=this.sharedService.slickGrid.getColumnIndex(u.id),t=this.sharedService.slickGrid.getColumns(),r=this.sharedService.gridOptions.frozenColumn??-1;r>=0&&r>=i&&(this.sharedService.gridOptions.frozenColumn=r-1,this.sharedService.slickGrid.setOptions({frozenColumn:this.sharedService.gridOptions.frozenColumn}));const o=Tr(t,i);this.sharedService.visibleColumns=o,this.sharedService.slickGrid.setColumns(o),this.pubSubService.publish("onHeaderMenuHideColumns",{columns:o,hiddenColumn:u})}}hideMenu(){var u;this.disposeSubMenus(),(u=this._menuElm)==null||u.remove(),this._menuElm=void 0}repositionSubMenu(u,e,a,i){const t=this.createCommandMenu(e.commandItems||[],i,a+1,e);document.body.appendChild(t),this.repositionMenu(u,t)}repositionMenu(u,e){var c,D;const a=u.target,i=e.classList.contains("slick-submenu"),t=i?u.target.closest(".slick-menu-item"):a,r=Kl(this.sharedService.gridContainerElement,a),o=this.grid.getGridPosition(),s=e.offsetWidth,l=Iu(t);let E=i?(l==null?void 0:l.left)??0:(r==null?void 0:r.left)??0,d=i?(l==null?void 0:l.top)??0:((r==null?void 0:r.top)??0)+(((c=this.addonOptions)==null?void 0:c.menuOffsetTop)??0)+a.clientHeight;if(i){const m=(e==null?void 0:e.clientHeight)||0,{bottom:h,top:x}=Ai(t);(hh?"top":"bottom")==="top"?(e.classList.remove("dropdown"),e.classList.add("dropup"),d-=m-t.clientHeight):(e.classList.remove("dropup"),e.classList.add("dropdown"))}if(i&&t){const m=E+Number(s)+t.clientWidth,h=document.documentElement.clientWidth;(m>=o.width||m>=h?"left":"right")==="left"?(e.classList.remove("dropright"),e.classList.add("dropleft"),E-=s):(e.classList.remove("dropleft"),e.classList.add("dropright"),E+=t.offsetWidth)}else E=(r==null?void 0:r.left)??0,this.addonOptions.autoAlign&&(o!=null&&o.width)&&E+(e.clientWidth??0)>=o.width&&(E=E+a.clientWidth-e.clientWidth+(((D=this.addonOptions)==null?void 0:D.autoAlignOffset)||0));e.style.top=`${d}px`,e.style.left=`${E}px`}translateHeaderMenu(){var u;(u=this.sharedService.gridOptions)!=null&&u.headerMenu&&this.resetHeaderMenuTranslations(this.sharedService.visibleColumns)}handleHeaderCellRendered(u,e){var t;const i=(t=e.column.header)==null?void 0:t.menu;if(i&&e.node){if(!this.extensionUtility.runOverrideFunctionWhenExists(this.addonOptions.menuUsabilityOverride,e))return;const r=v("div",{className:"slick-header-menu-button",ariaLabel:"Header Menu"},e.node);this.addonOptions.buttonCssClass&&r.classList.add(..._u(this.addonOptions.buttonCssClass)),this.addonOptions.tooltip&&(r.title=this.addonOptions.tooltip),this._bindEventService.bind(r,"click",o=>{this.disposeAllMenus(),this.createParentMenu(o,e.column,i)})}}handleBeforeHeaderCellDestroy(u,e){var i;(i=e.column.header)!=null&&i.menu&&e.node.querySelectorAll(".slick-header-menu-button").forEach(t=>t.remove())}handleBodyMouseDown(u){if(this.menuElement){let e=!1;const a=u.target.closest(`.${this.menuCssClass}`);(this.menuElement.contains(u.target)||a)&&(e=!0),(this._menuElm!==u.target&&!e&&!u.defaultPrevented||u.target.className==="close"&&a)&&this.hideMenu()}}handleMenuItemCommandClick(u,e,a,i=0,t){var r;if(a!=="divider"&&!a.disabled&&!a.divider)if((a.command||"")&&!a.commandItems){const s={grid:this.grid,command:a.command,column:t,item:a};this.executeHeaderMenuInternalCommands(u,s),this.pubSubService.publish("onHeaderMenuCommand",s),typeof((r=this.addonOptions)==null?void 0:r.onCommand)=="function"&&this.addonOptions.onCommand(u,s),typeof a.action=="function"&&a.action.call(this,u,s),u.defaultPrevented||this.hideMenu(),u.preventDefault(),u.stopPropagation()}else a.commandItems&&this.repositionSubMenu(u,a,i,t)}handleMenuItemMouseOver(u,e,a,i=0,t){a!=="divider"&&!a.disabled&&!a.divider&&(a.commandItems?this.repositionSubMenu(u,a,i,t):i===0&&this.disposeSubMenus())}addHeaderMenuCustomCommands(u){const e=this.sharedService.gridOptions,a=e.headerMenu||{},i=Q0(e);return Array.isArray(u)&&e.enableHeaderMenu&&u.forEach(t=>{var r,o;if(t&&!t.excludeFromHeaderMenu){t.header?t.header.menu||(t.header.menu={commandItems:[]}):t.header={menu:{commandItems:[]}};const s=((o=(r=t==null?void 0:t.header)==null?void 0:r.menu)==null?void 0:o.commandItems)??[];let l=!1;a&&!a.hideFreezeColumnsCommand&&(l=!0,s.some(E=>E!=="divider"&&(E==null?void 0:E.command)==="freeze-columns")||s.push({iconCssClass:a.iconFreezeColumns||"mdi mdi-pin-outline",titleKey:`${i}FREEZE_COLUMNS`,command:"freeze-columns",positionOrder:47})),a&&!a.hideColumnResizeByContentCommand&&this.sharedService.gridOptions.enableColumnResizeOnDoubleClick&&(l=!0,s.some(E=>E!=="divider"&&(E==null?void 0:E.command)==="column-resize-by-content")||s.push({iconCssClass:a.iconColumnResizeByContentCommand||"mdi mdi-arrow-expand-horizontal",titleKey:`${i}COLUMN_RESIZE_BY_CONTENT`,command:"column-resize-by-content",positionOrder:48})),l&&!s.some(E=>E!=="divider"&&E.positionOrder===49)&&s.push({divider:!0,command:"",positionOrder:49}),e.enableSorting&&t.sortable&&a&&!a.hideSortCommands&&(s.some(E=>E!=="divider"&&(E==null?void 0:E.command)==="sort-asc")||s.push({iconCssClass:a.iconSortAscCommand||"mdi mdi-sort-ascending",titleKey:`${i}SORT_ASCENDING`,command:"sort-asc",positionOrder:50}),s.some(E=>E!=="divider"&&(E==null?void 0:E.command)==="sort-desc")||s.push({iconCssClass:a.iconSortDescCommand||"mdi mdi-sort-descending",titleKey:`${i}SORT_DESCENDING`,command:"sort-desc",positionOrder:51}),s.some(E=>E!=="divider"&&E.positionOrder===52)||s.push({divider:!0,command:"",positionOrder:52}),!a.hideClearSortCommand&&!s.some(E=>E!=="divider"&&(E==null?void 0:E.command)==="clear-sort")&&s.push({iconCssClass:a.iconClearSortCommand||"mdi mdi-sort-variant-off",titleKey:`${i}REMOVE_SORT`,command:"clear-sort",positionOrder:54})),e.enableFiltering&&t.filterable&&a&&!a.hideFilterCommand&&!a.hideClearFilterCommand&&!s.some(E=>E!=="divider"&&(E==null?void 0:E.command)==="clear-filter")&&s.push({iconCssClass:a.iconClearFilterCommand||"mdi mdi-filter-remove-outline",titleKey:`${i}REMOVE_FILTER`,command:"clear-filter",positionOrder:53}),a&&!a.hideColumnHideCommand&&!s.some(E=>E!=="divider"&&(E==null?void 0:E.command)==="hide-column")&&s.push({iconCssClass:a.iconColumnHideCommand||"mdi mdi-close",titleKey:`${i}HIDE_COLUMN`,command:"hide-column",positionOrder:55}),this.extensionUtility.translateMenuItemsFromTitleKey(s),this.extensionUtility.sortItems(s,"positionOrder")}}),a}clearColumnFilter(u,e){e!=null&&e.column&&this.filterService.clearFilterByColumnId(u,e.column.id)}clearColumnSort(u,e){e!=null&&e.column&&this.sharedService&&this.sortService.clearSortByColumnId(u,e.column.id)}executeHeaderMenuInternalCommands(u,e){var a;if(e!=null&&e.command)switch(e.command){case"hide-column":this.hideColumn(e.column),(a=this.sharedService.gridOptions)!=null&&a.enableAutoSizeColumns&&this.sharedService.slickGrid.autosizeColumns();break;case"clear-filter":this.clearColumnFilter(u,e);break;case"clear-sort":this.clearColumnSort(u,e);break;case"column-resize-by-content":this.pubSubService.publish("onHeaderMenuColumnResizeByContent",{columnId:e.column.id});break;case"freeze-columns":const i=[...this.sharedService.visibleColumns],r={frozenColumn:i.findIndex(E=>E.id===e.column.id),enableMouseWheelScrollHandler:!0},o=this.sharedService.slickGrid.getColumns();this.sharedService.slickGrid.setOptions(r,!1,!0),this.sharedService.gridOptions.frozenColumn=r.frozenColumn,this.sharedService.gridOptions.enableMouseWheelScrollHandler=r.enableMouseWheelScrollHandler,this.sharedService.frozenVisibleColumnId=e.column.id,this.sharedService.hasColumnsReordered||Array.isArray(i)&&Array.isArray(this.sharedService.allColumns)&&i.length!==this.sharedService.allColumns.length?this.sharedService.slickGrid.setColumns(i):this.sharedService.slickGrid.setColumns(o),this.sharedService.slickGrid.getOptions().enableAutoSizeColumns&&this.sharedService.slickGrid.autosizeColumns();break;case"sort-asc":case"sort-desc":const l=e.command==="sort-asc";this.sortColumn(u,e,l);break}}createParentMenu(u,e,a){var t,r,o,s,l;const i={grid:this.grid,column:e,menu:a};typeof u.stopPropagation=="function"&&(this.pubSubService.publish("onHeaderMenuBeforeMenuShow",i),typeof((t=this.addonOptions)==null?void 0:t.onBeforeMenuShow)=="function"&&((r=this.addonOptions)==null?void 0:r.onBeforeMenuShow(u,i))===!1)||(this._menuElm=this.createCommandMenu(a.commandItems,e),(o=this.grid.getContainerNode())==null||o.appendChild(this._menuElm),this.repositionMenu(u,this._menuElm),this.pubSubService.publish("onHeaderMenuAfterMenuShow",i),!(typeof((s=this.addonOptions)==null?void 0:s.onAfterMenuShow)=="function"&&((l=this.addonOptions)==null?void 0:l.onAfterMenuShow(u,i))===!1)&&(u.preventDefault(),u.stopPropagation()))}createCommandMenu(u,e,a=0,i){const t=i==null?void 0:i.command;let r=a===1&&t?t.replace(/\s/g,""):"";r&&(this._subMenuParentId=r),a>1&&(r=this._subMenuParentId);const o=`${this.menuCssClass} slick-menu-level-${a} ${this.gridUid}`,s=document.body.querySelector(`.${this.menuCssClass}.slick-menu-level-${a}${this.gridUidSelector}`);if(s){if(s.dataset.subMenuParent===r)return s;this.disposeSubMenus()}const l=v("div",{ariaExpanded:"true",ariaLabel:a>1?"SubMenu":"Header Menu",role:"menu",className:o,style:{minWidth:`${this.addonOptions.minWidth}px`}});a>0&&(l.classList.add("slick-submenu"),r&&(l.dataset.subMenuParent=r));const E=v("div",{className:`${this._menuCssPrefix}-command-list`,role:"menu"},l),d={grid:this.grid,column:e,level:a,menu:{commandItems:u}};return i&&a>0&&this.addSubMenuTitleWhenExists(i,E),this.populateCommandOrOptionItems("command",this.addonOptions,E,u,d,this.handleMenuItemCommandClick,this.handleMenuItemMouseOver),a++,l}resetHeaderMenuTranslations(u){u.forEach(e=>{var a,i;if((i=(a=e==null?void 0:e.header)==null?void 0:a.menu)!=null&&i.commandItems&&!e.excludeFromHeaderMenu){const t=e.header.menu.commandItems||[];this.extensionUtility.translateMenuItemsFromTitleKey(t)}})}sortColumn(u,e,a=!0){if(e!=null&&e.column){const i=e.column,t=this.sharedService.gridOptions.multiColumnSort?this.sortService.getCurrentColumnSorts(i.id+""):[];let r=Hu.local;t.push({columnId:i.id,sortCol:i,sortAsc:a}),this.sharedService.gridOptions.backendServiceApi?(this.sortService.onBackendSortChanged(u,{multiColumnSort:!0,sortCols:t,grid:this.sharedService.slickGrid}),r=Hu.remote):this.sharedService.dataView?(this.sortService.onLocalSortChanged(this.sharedService.slickGrid,t),r=Hu.local):e.grid.onSort.notify(t);const o=t.map(s=>{var l;return{columnId:((l=s==null?void 0:s.sortCol)==null?void 0:l.id)??"",sortAsc:(s==null?void 0:s.sortAsc)??!0}});if(this.sharedService.slickGrid.setSortColumns(o),r){const s=[];o.forEach(l=>{s.push({columnId:`${l.columnId}`,direction:l.sortAsc?"ASC":"DESC"})}),this.sortService.emitSortChanged(r,s)}}}}const Ri="slick-rbe-editmode",ph="slick-rbe-unsaved-cell",Ps="slick-rbe-unsaved-highlight",Bn="action-btns--delete",yn="action-btns--edit",zn="action-btns--update",Sn="action-btns--cancel";class js{constructor(u,e,a){this.extensionUtility=u,this.pubSubService=e,this.pluginName="RowBasedEdit",this._defaults={actionsColumnLabel:"Actions",allowMultipleRows:!1,columnId:"_slick_rowbasededit_action",columnIndexPosition:-1,reorderable:!1},this._editedRows=new Map,this._currentLang="en",this._translations={},this.onBeforeEditCellHandler=(i,t)=>{var r;return this._editedRows.has((r=t.item)==null?void 0:r[this.gridOptions.datasetIdPropertyName??"id"])},this._eventHandler=new Tu,this._addonOptions=a}get addonOptions(){return this._addonOptions}get gridOptions(){return this._grid.getOptions()||{}}get eventHandler(){return this._eventHandler}init(u,e){var t,r;this._grid=u,this._gridService=e,this._addonOptions={...this._defaults,...this.addonOptions};const a=this._grid.getData();if(this._eventHandler.subscribe(this._grid.onBeforeEditCell,this.onBeforeEditCellHandler),this.checkOptionsRequirements(this.gridOptions),this.gridOptions.autoEdit||(this._grid.setOptions({autoEdit:!0}),console.warn('[Slickgrid-Universal] The Row Based Edit Plugin works best with the gridOption "autoEdit" enabled, the option has now been set automatically for you.')),this._existingEditCommandHandler=this.gridOptions.editCommandHandler,this._grid.setOptions({editCommandHandler:this.rowBasedEditCommandHandler.bind(this)}),this.gridOptions.enableExcelCopyBuffer===!0){const o=(t=this.gridOptions.excelCopyBufferOptions)==null?void 0:t.onBeforePasteCell;this._grid.setOptions({excelCopyBufferOptions:{...this.gridOptions.excelCopyBufferOptions,onBeforePasteCell:(s,l)=>{let E=!0;if(o&&(E=o(s,l),E===!1))return!1;const d=a.getItem(l.row),c=this.gridOptions.datasetIdPropertyName??"id";return!!(this._editedRows.has(d[c])&&E===!0)}}})}const i=a.getItemMetadata;a.getItemMetadata=this.updateItemMetadata((r=i==null?void 0:i.bind)==null?void 0:r.call(i,a)),this._eventHandler.subscribe(this._grid.onSetOptions,this.optionsUpdatedHandler.bind(this)),this._eventHandler.subscribe(a.onRowsOrCountChanged,this.handleAllRowRerender.bind(this)),this.translate()}destroy(){this.dispose()}dispose(){var u,e;(u=this._eventHandler)==null||u.unsubscribeAll(),(e=this.pubSubService)==null||e.unsubscribeAll()}create(u,e){var a;if(this._addonOptions={...this._defaults,...e.rowBasedEditOptions},Array.isArray(u)&&e){const i=this.getColumnDefinition();if(!u.some(t=>t.id===i.id)){const t=((a=e==null?void 0:e.rowBasedEditOptions)==null?void 0:a.columnIndexPosition)??-1;t===-1?u.push(i):t>0&&tc.editor!==void 0),o=[],s=this.gridOptions.datasetIdPropertyName??"id";i.forEach((c,D)=>{const m=i[D],h=t[D];if(m!==h||h===""){const x=Array.isArray(a.prevSerializedValue)?r==null?void 0:r[D]:e;if(!x)return;this._grid.invalidate(),a.execute(),this.renderUnsavedCellStyling(u[s],x),o.push(x)}});const l=this._editedRows.get(u[s]),E=[...(l==null?void 0:l.editCommands)||[]];o.length>0&&E.push(a),this._editedRows.set(u[s],{columns:[...(l==null?void 0:l.columns)||[],...o],editCommands:E,cssStyleKeys:(l==null?void 0:l.cssStyleKeys)||[]})}translate(u=!1){var e;return this._currentLang=((e=this.extensionUtility.translaterService)==null?void 0:e.getCurrentLanguage())??"en",(!this._translations[this._currentLang]||u)&&(this._translations[this._currentLang]={btnUpdateTitle:this.getTitleOrDefault("updateButtonTitle","Update the row"),btnEditTitle:this.getTitleOrDefault("editButtonTitle","Edit the Row"),btnDeleteTitle:this.getTitleOrDefault("deleteButtonTitle","Delete the Row"),btnCancelTitle:this.getTitleOrDefault("cancelButtonTitle","Cancel changes of the Row")}),this._translations[this._currentLang]}checkOptionsRequirements(u){if(!(u!=null&&u.enableCellNavigation))throw new Error("[Slickgrid-Universal] Row Based Edit Plugin requires the gridOption cell navigation (enableCellNavigation = true)");if(!(u!=null&&u.editable))throw new Error("[Slickgrid-Universal] Row Based Edit Plugin requires the gridOption editable (editable = true)")}undoRowEdit(u){const e=this.gridOptions.datasetIdPropertyName??"id",a=this._editedRows.get(u[e]),i=this._grid.getData().getRowByItem(u);if(i!==void 0&&(a!=null&&a.editCommands)&&a.editCommands.length||Z0.cancelCurrentEdit()){for(;a.editCommands.length>0;){const t=a.editCommands.pop();t&&t.undo()}a.columns.forEach(t=>{this.removeUnsavedStylingFromCell(t,i)}),a.columns=[],this._grid.invalidate()}}renderUnsavedCellStyling(u,e){var a,i;if(e){const t=(a=this._grid.getData())==null?void 0:a.getRowById(u);if(t!==void 0&&t>=0){const r={[t]:{[e.id]:ph}},o=`${Ps}_${[e.id]}${t}`;this._grid.setCellCssStyles(o,r),(i=this._editedRows.get(u))==null||i.cssStyleKeys.push(o)}}}handleAllRowRerender(u,e){this._editedRows.forEach((a,i)=>{a.cssStyleKeys.forEach(t=>{this._grid.removeCellCssStyles(t)}),a.cssStyleKeys=[],a.columns.forEach(t=>{this.renderUnsavedCellStyling(i,t)})})}removeUnsavedStylingFromCell(u,e){const a=`${Ps}_${[u.id]}${e}`;this._grid.removeCellCssStyles(a)}removeUnsavedStylingFromRow(u){this._grid.getColumns().forEach(e=>{this.removeUnsavedStylingFromCell(e,u)})}optionsUpdatedHandler(u,e){this._addonOptions={...this._defaults,...e.optionsAfter.rowBasedEditOptions}}async onCellClickHandler(u,e){var o,s,l,E,d,c,D,m,h,x,g,F,C,A,b;const a=e.dataContext,i=u.target,t=this.gridOptions.datasetIdPropertyName??"id",r=this._editedRows.get(a[t]);if((i.classList.contains(Bn)||(o=i.parentElement)!=null&&o.classList.contains(Bn))&&this._gridService){if((l=(s=this._addonOptions)==null?void 0:s.actionButtons)!=null&&l.deleteButtonPrompt&&!window.confirm(this._addonOptions.actionButtons.deleteButtonPrompt))return;this.toggleEditmode(a,!1),this._gridService.deleteItem(a)}else if(i.classList.contains(yn)||(E=i.parentElement)!=null&&E.classList.contains(yn)){if(!((d=this._addonOptions)!=null&&d.allowMultipleRows)&&this._editedRows.size>0)return;typeof((c=this._addonOptions)==null?void 0:c.onBeforeEditMode)=="function"&&this._addonOptions.onBeforeEditMode(e),this.toggleEditmode(a,!0)}else if(i.classList.contains(zn)||(D=i.parentElement)!=null&&D.classList.contains(zn)){if((h=(m=this._addonOptions)==null?void 0:m.actionButtons)!=null&&h.updateButtonPrompt&&((r==null?void 0:r.editCommands.length)||0)>0&&!window.confirm(this._addonOptions.actionButtons.updateButtonPrompt)||(this._grid.getCellEditor()&&((x=this._grid.getActiveCell())==null?void 0:x.row)===e.row&&((g=this._grid.getEditController())==null||g.commitCurrentEdit()),(F=this._addonOptions)!=null&&F.onBeforeRowUpdated&&await this._addonOptions.onBeforeRowUpdated(e)!==!0))return;this.removeUnsavedStylingFromRow(e.row),this.toggleEditmode(a,!1)}else if(i.classList.contains(Sn)||(C=i.parentElement)!=null&&C.classList.contains(Sn)){if((b=(A=this._addonOptions)==null?void 0:A.actionButtons)!=null&&b.cancelButtonPrompt&&((r==null?void 0:r.editCommands.length)||0)>0&&!window.confirm(this._addonOptions.actionButtons.cancelButtonPrompt))return;this.undoRowEdit(a),this.toggleEditmode(a,!1)}}actionColumnFormatter(u,e,a,i,t){var E,d,c,D,m,h,x,g,F,C,A,b,y,S,z,M;const r=this.gridOptions,o=this._editedRows.has(t==null?void 0:t[r.datasetIdPropertyName??"id"]),s=this._translations[this._currentLang]??this.translate(),l=document.createDocumentFragment();return l.appendChild(v("span",{className:`${((d=(E=r.rowBasedEditOptions)==null?void 0:E.actionButtons)==null?void 0:d.editButtonClassName)||"button-style padding-1px mr-2"} action-btns `+yn,title:s.btnEditTitle,style:{display:o?"none":""}})).appendChild(v("span",{className:((D=(c=r.rowBasedEditOptions)==null?void 0:c.actionButtons)==null?void 0:D.iconEditButtonClassName)||"mdi mdi-table-edit text-color-primary"})),l.appendChild(v("span",{className:`${((h=(m=r.rowBasedEditOptions)==null?void 0:m.actionButtons)==null?void 0:h.deleteButtonClassName)||"button-style padding-1px"} action-btns `+Bn,title:s.btnDeleteTitle,style:{display:o?"none":""}})).appendChild(v("span",{className:((g=(x=r.rowBasedEditOptions)==null?void 0:x.actionButtons)==null?void 0:g.iconDeleteButtonClassName)||"mdi mdi-close text-color-danger"})),l.appendChild(v("span",{className:`${((C=(F=r.rowBasedEditOptions)==null?void 0:F.actionButtons)==null?void 0:C.updateButtonClassName)||"button-style padding-1px mr-2"} action-btns `+zn,title:s.btnUpdateTitle,style:{display:o?"":"none"}})).appendChild(v("span",{className:((b=(A=r.rowBasedEditOptions)==null?void 0:A.actionButtons)==null?void 0:b.iconUpdateButtonClassName)||"mdi mdi-check-bold text-color-success"})),l.appendChild(v("span",{className:`${((S=(y=r.rowBasedEditOptions)==null?void 0:y.actionButtons)==null?void 0:S.cancelButtonClassName)||"button-style padding-1px"} action-btns `+Sn,title:s.btnCancelTitle,style:{display:o?"":"none"}})).appendChild(v("span",{className:((M=(z=r.rowBasedEditOptions)==null?void 0:z.actionButtons)==null?void 0:M.iconCancelButtonClassName)||"mdi mdi-cancel text-color-danger"})),l}toggleEditmode(u,e){const a=this.gridOptions.datasetIdPropertyName??"id";e?this._editedRows.set(u[a],{columns:[],editCommands:[],cssStyleKeys:[]}):this._editedRows.delete(u[a]),this._grid.invalidate()}updateItemMetadata(u){return e=>{const a=this._grid.getData().getItem(e);let i={cssClasses:""};if(typeof u=="function"){const t=u(e);t&&(i=t)}if(i&&a){const t=this.gridOptions.datasetIdPropertyName??"id";this._editedRows.has(a[t])&&!i.cssClasses.includes(Ri)?i.cssClasses=(i.cssClasses||"")+" "+Ri:!this._editedRows.has(a[t])&&i.cssClasses.includes(Ri)&&(i.cssClasses=i.cssClasses.replace(Ri,""))}return i}}getTitleOrDefault(u,e){var i,t,r;const a=(i=this.gridOptions.rowBasedEditOptions)==null?void 0:i.actionButtons;return(a==null?void 0:a[u+"Key"])&&((r=(t=this.extensionUtility.translaterService)==null?void 0:t.translate)==null?void 0:r.call(t,(a==null?void 0:a[u+"Key"])||""))||(a==null?void 0:a[u])||e}}class Ls{constructor(u){this.pubSubService=u,this.onBeforeMoveRows=new N("onBeforeMoveRows"),this.onMoveRows=new N("onMoveRows"),this.pluginName="RowMoveManager",this._dragging=!1,this._defaults={autoScroll:!0,columnId:"_move",cssClass:"slick-row-move-column",cancelEditOnDrag:!1,disableRowSelection:!1,hideRowMoveShadow:!0,reorderable:!1,rowMoveShadowMarginTop:0,rowMoveShadowMarginLeft:0,rowMoveShadowOpacity:.9,rowMoveShadowScale:.75,singleRowMove:!1,width:40},this._eventHandler=new Tu}get addonOptions(){return this._addonOptions}get eventHandler(){return this._eventHandler}get gridOptions(){var u;return((u=this._grid)==null?void 0:u.getOptions())??{}}init(u,e){var a;this._addonOptions={...this._defaults,...e},this._grid=u,this._canvas=this._grid.getCanvasNode(),B.addSlickEventPubSubWhenDefined(this.pubSubService,this),typeof((a=this._addonOptions)==null?void 0:a.usabilityOverride)=="function"&&this.usabilityOverride(this._addonOptions.usabilityOverride),this._eventHandler.subscribe(this._grid.onDragInit,this.handleDragInit.bind(this)).subscribe(this._grid.onDragStart,this.handleDragStart.bind(this)).subscribe(this._grid.onDrag,this.handleDrag.bind(this)).subscribe(this._grid.onDragEnd,this.handleDragEnd.bind(this))}dispose(){var u;(u=this._eventHandler)==null||u.unsubscribeAll()}create(u,e){var a;if(this._addonOptions={...this._defaults,...e.rowMoveManager},Array.isArray(u)&&e){const i=this.getColumnDefinition();if(!u.some(t=>t.id===i.id)){const t=Array.isArray(u)&&u.find(s=>(s==null?void 0:s.behavior)==="selectAndMove"),r=t||i,o=((a=e==null?void 0:e.rowMoveManager)==null?void 0:a.columnIndexPosition)??0;o>0?u.splice(o,0,r):u.unshift(r),this.pubSubService.publish("onPluginColumnsChanged",{columns:u,pluginName:this.pluginName})}}return this}getColumnDefinition(){var e;const u=String(((e=this._addonOptions)==null?void 0:e.columnId)??this._defaults.columnId);return{id:u,name:"",behavior:"selectAndMove",excludeFromExport:!0,excludeFromColumnPicker:!0,excludeFromGridMenu:!0,excludeFromQuery:!0,excludeFromHeaderMenu:!0,field:u,reorderable:this._addonOptions.reorderable,resizable:!1,width:this._addonOptions.width||40,formatter:this.moveIconFormatter.bind(this)}}usabilityOverride(u){this._usabilityOverride=u}setOptions(u){this._addonOptions={...this._addonOptions,...u}}handleDragInit(u){u.stopImmediatePropagation()}handleDragEnd(u,e){var a,i,t;if(this._dragging&&(this._dragging=!1,u.stopImmediatePropagation(),(a=e.guide)==null||a.remove(),(i=e.selectionProxy)==null||i.remove(),(t=e.clonedSlickRow)==null||t.remove(),e.canMove)){const r={grid:this._grid,rows:e.selectedRows,insertBefore:e.insertBefore};typeof this._addonOptions.onMoveRows=="function"&&this._addonOptions.onMoveRows(u instanceof Pu?u.getNativeEvent():u,r),this.onMoveRows.notify(r)}}handleDrag(u,e){var a,i,t,r;if(this._dragging){u.stopImmediatePropagation();const o=u.getNativeEvent(),l=(((a=o==null?void 0:o.touches)==null?void 0:a[0])??o).pageY-(((i=Iu(this._canvas))==null?void 0:i.top)??0);e.selectionProxy.style.top=`${l-5}px`,e.selectionProxy.style.display="block",e.clonedSlickRow&&(e.clonedSlickRow.style.top=`${l-6}px`,e.clonedSlickRow.style.display="block");const E=Math.max(0,Math.min(Math.round(l/(this.gridOptions.rowHeight||0)),this._grid.getDataLength()));if(E!==e.insertBefore){const d={grid:this._grid,rows:e.selectedRows,insertBefore:E};if(((r=(t=this._addonOptions)==null?void 0:t.onBeforeMoveRows)==null?void 0:r.call(t,o,d))===!1||this.onBeforeMoveRows.notify(d).getReturnValue()===!1?e.canMove=!1:e.canMove=!0,this._usabilityOverride&&e.canMove){const c=this._grid.getDataItem(E);e.canMove=this.checkUsabilityOverride(E,c,this._grid)}e.canMove?e.guide.style.top=`${E*(this.gridOptions.rowHeight||0)}px`:e.guide.style.top="-1000px",e.insertBefore=E}}}handleDragStart(u,e){var r,o,s,l,E;const a=this._grid.getCellFromEvent(u)||{cell:-1,row:-1},i=a.row,t=this._grid.getDataItem(i);if(this.checkUsabilityOverride(i,t,this._grid)){if(this._addonOptions.cancelEditOnDrag&&this._grid.getEditorLock().isActive()&&this._grid.getEditorLock().cancelCurrentEdit(),this._grid.getEditorLock().isActive()||!/move|selectAndMove/.test(this._grid.getColumns()[a.cell].behavior||""))return!1;if(this._dragging=!0,u.stopImmediatePropagation(),!this.addonOptions.hideRowMoveShadow){const D=(r=this._grid.getCellNode(a.row,a.cell))==null?void 0:r.closest(".slick-row");D&&(e.clonedSlickRow=D.cloneNode(!0),e.clonedSlickRow.classList.add("slick-reorder-shadow-row"),e.clonedSlickRow.style.display="none",e.clonedSlickRow.style.marginLeft=be((o=this._addonOptions)==null?void 0:o.rowMoveShadowMarginLeft,"0px"),e.clonedSlickRow.style.marginTop=be((s=this._addonOptions)==null?void 0:s.rowMoveShadowMarginTop,"0px"),e.clonedSlickRow.style.opacity=`${((l=this._addonOptions)==null?void 0:l.rowMoveShadowOpacity)??.95}`,e.clonedSlickRow.style.transform=`scale(${((E=this.addonOptions)==null?void 0:E.rowMoveShadowScale)??.75})`,this._canvas.appendChild(e.clonedSlickRow))}let d=this._addonOptions.singleRowMove?[a.row]:this._grid.getSelectedRows();(d.length===0||!d.some(D=>D===a.row))&&(d=[a.row],this._addonOptions.disableRowSelection||this._grid.setSelectedRows(d));const c=this.gridOptions.rowHeight;e.selectedRows=d,e.selectionProxy=v("div",{className:"slick-reorder-proxy",style:{display:"none",position:"absolute",zIndex:"99999",width:`${this._canvas.clientWidth}px`,height:`${c*d.length}px`}},this._canvas),e.guide=v("div",{className:"slick-reorder-guide",style:{position:"absolute",zIndex:"99999",width:`${this._canvas.clientWidth}px`,top:"-1000px"}},this._canvas),e.insertBefore=-1}}checkUsabilityOverride(u,e,a){return typeof this._usabilityOverride=="function"?this._usabilityOverride(u,e,a):!0}moveIconFormatter(u,e,a,i,t,r){return this.checkUsabilityOverride(u,t,r)?{addClasses:"cell-reorder dnd",html:v("div",{className:this._addonOptions.cssClass||""})}:""}}class Fh{get extensionList(){return this._extensionList}get gridOptions(){return this.sharedService.gridOptions||{}}constructor(u,e,a,i,t,r,o,s){this.extensionUtility=u,this.filterService=e,this.pubSubService=a,this.sharedService=i,this.sortService=t,this.treeDataService=r,this.translaterService=o,this.lazyGridService=s,this._extensionCreatedList={},this._extensionList={}}dispose(){if(this.sharedService.visibleColumns=[],typeof this._extensionList=="object"){const u=Object.keys(this._extensionList);u.forEach(e=>{var a;if(this._extensionList.hasOwnProperty(e)){const i=this._extensionList[e];typeof((a=i==null?void 0:i.instance)==null?void 0:a.dispose)=="function"&&i.instance.dispose()}}),u.forEach(e=>{delete this._extensionList[e]})}this._cellMenuPlugin=null,this._cellExcelCopyManagerPlugin=null,this._checkboxSelectColumn=null,this._contextMenuPlugin=null,this._columnPickerControl=null,this._draggleGroupingPlugin=null,this._gridMenuControl=null,this._groupItemMetadataProviderService=null,this._headerMenuPlugin=null,this._rowMoveManagerPlugin=null,this._rowSelectionModel=null,this._extensionCreatedList=null,this._extensionList={}}addExtensionToList(u,e){this._extensionList[u]=e}getAllColumns(){return this.sharedService.allColumns||[]}getVisibleColumns(){return this.sharedService.visibleColumns||[]}getCreatedExtensionByName(u){var e;if((e=this._extensionCreatedList)!=null&&e.hasOwnProperty(u))return this._extensionCreatedList[u]}getExtensionByName(u){var e;return(e=this._extensionList)==null?void 0:e[u]}getExtensionInstanceByName(u){var e;return(e=this.getExtensionByName(u))==null?void 0:e.instance}autoResizeColumns(){this.sharedService.slickGrid.autosizeColumns()}bindDifferentExtensions(){var u,e,a,i,t,r,o,s,l,E,d,c,D;if(this.gridOptions){if(this.gridOptions.enableTranslate&&this.translateItems(this.sharedService.allColumns,"nameKey","name"),this.gridOptions.enableRowBasedEdit){this._rowBasedEdit=this._rowBasedEdit||new js(this.extensionUtility,this.pubSubService,this.gridOptions.rowBasedEditOptions);const m=(u=this.lazyGridService)==null?void 0:u.call(this);if(!m)throw new Error("[Slickgrid-Universal] the RowBasedEdit Plugin requires a GridService to be configured and available");this._rowBasedEdit.init(this.sharedService.slickGrid,m),(e=this.gridOptions.rowBasedEditOptions)!=null&&e.onExtensionRegistered&&this.gridOptions.rowBasedEditOptions.onExtensionRegistered(this._rowBasedEdit),this._extensionList[ou.rowBasedEdit]={name:ou.rowBasedEdit,instance:this._rowBasedEdit}}if(this.gridOptions.enableAutoTooltip){const m=new lh((a=this.gridOptions)==null?void 0:a.autoTooltipOptions);this.sharedService.slickGrid.registerPlugin(m),this._extensionList[ou.autoTooltip]={name:ou.autoTooltip,instance:m}}if(this.gridOptions.enableExcelCopyBuffer&&(this._cellExcelCopyManagerPlugin=new Eh,this._cellExcelCopyManagerPlugin.init(this.sharedService.slickGrid,this.sharedService.gridOptions.excelCopyBufferOptions),(i=this.gridOptions.excelCopyBufferOptions)!=null&&i.onExtensionRegistered&&this.gridOptions.excelCopyBufferOptions.onExtensionRegistered(this._cellExcelCopyManagerPlugin),this._extensionList[ou.cellExternalCopyManager]={name:ou.cellExternalCopyManager,instance:this._cellExcelCopyManagerPlugin}),this.gridOptions.enableCellMenu&&(this._cellMenuPlugin=new Dh(this.extensionUtility,this.pubSubService,this.sharedService),(t=this.gridOptions.cellMenu)!=null&&t.onExtensionRegistered&&this.gridOptions.cellMenu.onExtensionRegistered(this._cellMenuPlugin),this._extensionList[ou.cellMenu]={name:ou.cellMenu,instance:this._cellMenuPlugin}),!this._rowSelectionModel&&(this.gridOptions.enableRowSelection||this.gridOptions.enableCheckboxSelector||this.gridOptions.enableRowDetailView||this.gridOptions.enableRowMoveManager)){if(!this._rowSelectionModel||!this.sharedService.slickGrid.getSelectionModel()){const m=this.gridOptions.rowSelectionOptions??{};this.gridOptions.enableRowMoveManager&&((r=this.gridOptions.rowMoveManager)==null?void 0:r.dragToSelect)!==!1&&(m.dragToSelect=!0),this._rowSelectionModel=new Zt(m),this.sharedService.slickGrid.setSelectionModel(this._rowSelectionModel)}this._extensionList[ou.rowSelection]={name:ou.rowSelection,instance:this._rowSelectionModel}}if(this.gridOptions.enableCheckboxSelector){this._checkboxSelectColumn=this._checkboxSelectColumn||new Ms(this.pubSubService,this.gridOptions.checkboxSelector),this._checkboxSelectColumn.init(this.sharedService.slickGrid);const m=this.getCreatedExtensionByName(ou.checkboxSelector),h=m==null?void 0:m.instance;h&&((o=this.gridOptions.checkboxSelector)!=null&&o.onExtensionRegistered&&this.gridOptions.checkboxSelector.onExtensionRegistered(h),this._extensionList[ou.checkboxSelector]={name:ou.checkboxSelector,instance:this._checkboxSelectColumn})}if(this.gridOptions.enableColumnPicker&&(this._columnPickerControl=new qr(this.extensionUtility,this.pubSubService,this.sharedService),(s=this.gridOptions.columnPicker)!=null&&s.onExtensionRegistered&&this.gridOptions.columnPicker.onExtensionRegistered(this._columnPickerControl),this._extensionList[ou.columnPicker]={name:ou.columnPicker,instance:this._columnPickerControl}),this.gridOptions.enableContextMenu&&(this._contextMenuPlugin=new hh(this.extensionUtility,this.pubSubService,this.sharedService,this.treeDataService),(l=this.gridOptions.contextMenu)!=null&&l.onExtensionRegistered&&this.gridOptions.contextMenu.onExtensionRegistered(this._contextMenuPlugin),this._extensionList[ou.contextMenu]={name:ou.contextMenu,instance:this._contextMenuPlugin}),this.gridOptions.enableDraggableGrouping&&(this._draggleGroupingPlugin&&(this._draggleGroupingPlugin.init(this.sharedService.slickGrid,this.gridOptions.draggableGrouping),(E=this.gridOptions.draggableGrouping)!=null&&E.onExtensionRegistered&&this.gridOptions.draggableGrouping.onExtensionRegistered(this._draggleGroupingPlugin),this._extensionList[ou.contextMenu]={name:ou.contextMenu,instance:this._draggleGroupingPlugin}),this._extensionList[ou.draggableGrouping]={name:ou.draggableGrouping,instance:this._draggleGroupingPlugin}),this.gridOptions.enableGridMenu&&(this._gridMenuControl=new G1(this.extensionUtility,this.filterService,this.pubSubService,this.sharedService,this.sortService),(d=this.gridOptions.gridMenu)!=null&&d.onExtensionRegistered&&this.gridOptions.gridMenu.onExtensionRegistered(this._gridMenuControl),this._extensionList[ou.gridMenu]={name:ou.gridMenu,instance:this._gridMenuControl}),this.gridOptions.enableHeaderButton){const m=new gh(this.extensionUtility,this.pubSubService,this.sharedService);(c=this.gridOptions.headerButton)!=null&&c.onExtensionRegistered&&this.gridOptions.headerButton.onExtensionRegistered(m),this._extensionList[ou.headerButton]={name:ou.headerButton,instance:m}}if(this.gridOptions.enableHeaderMenu&&(this._headerMenuPlugin=new Ch(this.extensionUtility,this.filterService,this.pubSubService,this.sharedService,this.sortService),(D=this.gridOptions.headerMenu)!=null&&D.onExtensionRegistered&&this.gridOptions.headerMenu.onExtensionRegistered(this._headerMenuPlugin),this._extensionList[ou.headerMenu]={name:ou.headerMenu,instance:this._headerMenuPlugin}),this.gridOptions.enableRowMoveManager){this._rowMoveManagerPlugin=this._rowMoveManagerPlugin||new Ls(this.pubSubService),this._rowMoveManagerPlugin.init(this.sharedService.slickGrid,this.gridOptions.rowMoveManager);const m=this.getCreatedExtensionByName(ou.rowMoveManager);(m==null?void 0:m.instance)&&(this._extensionList[ou.rowMoveManager]={name:ou.rowMoveManager,instance:this._rowMoveManagerPlugin})}}}createExtensionsBeforeGridCreation(u,e){var i,t,r;const a=[];e.enableCheckboxSelector&&(this.getCreatedExtensionByName(ou.checkboxSelector)||(this._checkboxSelectColumn=new Ms(this.pubSubService,this.sharedService.gridOptions.checkboxSelector),a.push({name:ou.checkboxSelector,extension:this._checkboxSelectColumn,columnIndexPosition:((i=e==null?void 0:e.checkboxSelector)==null?void 0:i.columnIndexPosition)??a.length}))),e.enableRowMoveManager&&(this.getCreatedExtensionByName(ou.rowMoveManager)||(this._rowMoveManagerPlugin=new Ls(this.pubSubService),a.push({name:ou.rowMoveManager,extension:this._rowMoveManagerPlugin,columnIndexPosition:((t=e==null?void 0:e.rowMoveManager)==null?void 0:t.columnIndexPosition)??a.length}))),e.enableRowBasedEdit&&(this.getCreatedExtensionByName(ou.rowBasedEdit)||(this._rowBasedEdit=new js(this.extensionUtility,this.pubSubService),a.push({name:ou.rowBasedEdit,extension:this._rowBasedEdit,columnIndexPosition:((r=e==null?void 0:e.rowMoveManager)==null?void 0:r.columnIndexPosition)??a.length}))),this.createExtensionByTheirColumnIndex(a,u,e),e.enableDraggableGrouping&&(this.getCreatedExtensionByName(ou.draggableGrouping)||(this._draggleGroupingPlugin=new xh(this.extensionUtility,this.pubSubService,this.sharedService),this._draggleGroupingPlugin&&(e.enableColumnReorder=this._draggleGroupingPlugin.setupColumnReorder.bind(this._draggleGroupingPlugin),this._extensionCreatedList[ou.draggableGrouping]={name:ou.draggableGrouping,instance:this._draggleGroupingPlugin})))}hideColumn(u){var e,a;if(typeof((a=(e=this.sharedService)==null?void 0:e.slickGrid)==null?void 0:a.getColumns)=="function"){const i=this.sharedService.slickGrid.getColumnIndex(u.id);this.sharedService.visibleColumns=this.removeColumnByIndex(this.sharedService.slickGrid.getColumns(),i),this.sharedService.slickGrid.setColumns(this.sharedService.visibleColumns)}}refreshBackendDataset(u){this.extensionUtility.refreshBackendDataset(u)}removeColumnByIndex(u,e){return Array.isArray(u)?u.filter((a,i)=>e!==i):u}translateAllExtensions(u){this.translateCellMenu(),this.translateContextMenu(),this.translateHeaderMenu(),this.translateRowEditPlugin(),this.translateColumnHeaders(u)}translateCellMenu(){var u;(u=this._cellMenuPlugin)==null||u.translateCellMenu()}translateColumnPicker(){var u;(u=this._columnPickerControl)==null||u.translateColumnPicker()}translateContextMenu(){var u;(u=this._contextMenuPlugin)==null||u.translateContextMenu()}translateGridMenu(){var u;(u=this._gridMenuControl)==null||u.translateGridMenu()}translateHeaderMenu(){var u;(u=this._headerMenuPlugin)==null||u.translateHeaderMenu()}translateRowEditPlugin(){var u;(u=this._rowBasedEdit)==null||u.translate()}translateColumnHeaders(u,e){var i;if(this.sharedService&&this.gridOptions&&this.gridOptions.enableTranslate&&(!this.translaterService||!this.translaterService.translate))throw new Error('[Slickgrid-Universal] requires a Translate Service to be installed and configured when the grid option "enableTranslate" is enabled.');u&&((i=this.translaterService)!=null&&i.use)&&this.translaterService.getCurrentLanguage()!==u&&this.translaterService.use(u);let a=e;a||(a=this.sharedService.columnDefinitions),this.translateItems(a,"nameKey","name"),this.translateItems(this.sharedService.allColumns,"nameKey","name"),this.translateItems(this.sharedService.allColumns,"columnGroupKey","columnGroup"),this.renderColumnHeaders(a,Array.isArray(e))}renderColumnHeaders(u,e=!1){var i;let a=u;a||(a=this.sharedService.columnDefinitions),Array.isArray(a)&&((i=this.sharedService.slickGrid)!=null&&i.setColumns)&&((a.length>this.sharedService.allColumns.length||e)&&(this.sharedService.allColumns=a),this.sharedService.slickGrid.setColumns(a)),this.gridOptions.enableColumnPicker&&this._columnPickerControl&&(this._columnPickerControl.columns=this.sharedService.allColumns,this._columnPickerControl.translateColumnPicker()),this.gridOptions.enableGridMenu&&this._gridMenuControl&&(this._gridMenuControl.columns=this.sharedService.allColumns??[],this._gridMenuControl.recreateGridMenu(),this._gridMenuControl.translateGridMenu())}createExtensionByTheirColumnIndex(u,e,a){u.sort((i,t)=>i.columnIndexPosition-t.columnIndexPosition),u.forEach(i=>{const t=i.extension.create(e,a);t&&(this._extensionCreatedList[i.name]={name:i.name,instance:t})})}translateItems(u,e,a){var i,t;if((i=this.gridOptions)!=null&&i.enableTranslate&&!((t=this.translaterService)!=null&&t.translate))throw new Error('[Slickgrid-Universal] requires a Translate Service to be installed and configured when the grid option "enableTranslate" is enabled.');this.extensionUtility.translateItems(u,e,a)}}var Ns=Object.prototype.hasOwnProperty;function me(n,u){var e,a;if(n===u)return!0;if(n&&u&&(e=n.constructor)===u.constructor){if(e===Date)return n.getTime()===u.getTime();if(e===RegExp)return n.toString()===u.toString();if(e===Array){if((a=n.length)===u.length)for(;a--&&me(n[a],u[a]););return a===-1}if(!e||typeof n=="object"){a=0;for(e in n)if(Ns.call(n,e)&&++a&&!Ns.call(u,e)||!(e in u)||!me(n[e],u[e]))return!1;return Object.keys(u).length===a}}return n!==n&&u!==u}function Rs(n,u,e){if(e&&(n!=null&&n.hasOwnProperty(e)||u!=null&&u.hasOwnProperty(e)))return n[e]===u||n===u[e]||n[e]===u[e];if(typeof n=="object"&&typeof u=="object"&&Object.keys(n).length!==Object.keys(u).length)return!1;for(const a in n)if(n.hasOwnProperty(a)&&n[a]!==u[a])return!1;return!0}function kh(n){switch(n&&n.toUpperCase()||""){case"IN":case"NIN":case"NOT_IN":case"IN_CONTAINS":case"NIN_CONTAINS":case"NOT_IN_CONTAINS":case"IN_COLLECTION":case"NOT_IN_COLLECTION":return!0;default:return!1}}const ze=(n,u,e)=>{switch(n.toUpperCase()){case"<":case"LT":return u":case"GT":return u>e;case">=":case"GE":return u>=e;case"!=":case"<>":case"NE":return u!==e;case"=":case"==":case"EQ":return u===e;case"IN":return e&&Array.isArray(e)?e.includes(u):!1;case"NIN":case"NOT_IN":return e&&Array.isArray(e)?!e.includes(u):!1;case"IN_CONTAINS":return e&&Array.isArray(e)&&typeof u=="string"?e.some(a=>u.split(/[,]+/).map(i=>i.trim()).includes(a)):!1;case"NIN_CONTAINS":case"NOT_IN_CONTAINS":return e&&Array.isArray(e)&&typeof u=="string"?!e.some(a=>u.split(/[,]+/).map(i=>i.trim()).includes(a)):!1;case"IN_COLLECTION":return u&&e&&Array.isArray(u)&&Array.isArray(e)?e.some(a=>u.includes(a)):!1;case"NOT_IN_COLLECTION":return u&&e&&Array.isArray(u)&&Array.isArray(e)?!e.some(a=>u.includes(a)):!1}return!0},Z1=(n,u)=>{let[e,a]=u;if(e===void 0&&!n.operator)return!0;n.cellValue=n.cellValue===void 0||n.cellValue===null?"":n.cellValue.toString();const i=n!=null&&n.ignoreAccentOnStringFilterAndSort?wa(n.cellValue,!0):n.cellValue.toLowerCase();if(typeof e=="string"&&(e=n!=null&&n.ignoreAccentOnStringFilterAndSort?wa(e,!0):e.toLowerCase()),typeof a=="string"&&(a=n!=null&&n.ignoreAccentOnStringFilterAndSort?wa(a,!0):a.toLowerCase()),e!==void 0&&a!==void 0){let r=(n==null?void 0:n.operator)??n.defaultFilterRangeOperator;r!==P.rangeInclusive&&r!==P.rangeExclusive&&(r=n.defaultFilterRangeOperator);const o=r===P.rangeInclusive,s=wn(o?">=":">",i,e,n.searchInputLastChar),l=wn(o?"<=":"<",i,a,n.searchInputLastChar);return s&&l}return wn(n.operator,i,e,n.searchInputLastChar)};function vh(n){const e=Array.isArray(n)&&n||[""],a=[];let i,t;if(e.length===2||typeof e[0]=="string"&&e[0].indexOf("..")>0){const r=e.length===2?e:e[0].split("..");i=`${Array.isArray(r)?r[0]:""}`,t=`${Array.isArray(r)?r[1]:""}`}else{const r=Array.isArray(n)&&n.length>0?n[0]:"";i=r==null?"":`${r}`}return i!==void 0&&t!==void 0?a.push(i,t):i!==void 0&&a.push(i),a}function wn(n,u,e,a){return n==="*"||n===P.endsWith||n==="*z"?u.endsWith(e):n===""&&a==="*"||n===P.startsWith||n==="a*"?u.startsWith(e):n===""||n===P.contains?u.indexOf(e)>-1:n==="<>"||n===P.notContains?u.indexOf(e)===-1:ze(n||"==",u,e)}const Ah=(n,u)=>{if(u===void 0&&!n.operator)return!0;switch((n.operator||"").toUpperCase()){case"!=":case"<>":case"NE":return!Rs(n.cellValue,u,n.dataKey);case"=":case"==":case"EQ":default:return Rs(n.cellValue,u,n.dataKey)}};function bh(n){return(Array.isArray(n)&&n.length>0?n[0]:"")||""}const Y1=(n,u)=>{const e=parseFloat(n.cellValue),[a,i]=u;if(a===void 0&&!n.operator)return!0;if(a!==void 0&&i!==void 0){let t=(n==null?void 0:n.operator)??n.defaultFilterRangeOperator;t!==P.rangeInclusive&&t!==P.rangeExclusive&&(t=n.defaultFilterRangeOperator);const r=t===P.rangeInclusive,o=ze(r?">=":">",e,+a),s=ze(r?"<=":"<",e,+i);return o&&s}return ze(n.operator||"==",e,+a)};function fh(n){const e=Array.isArray(n)&&n||[0],a=[];let i,t;if(e.length===2||typeof e[0]=="string"&&e[0].indexOf("..")>0){const r=e.length===2?e:e[0].split("..");i=parseFloat(Array.isArray(r)?r[0]:""),t=parseFloat(Array.isArray(r)?r[1]:"")}else i=parseFloat(e[0]);return su(i,!0)&&su(t,!0)?a.push(i,t):su(i,!0)&&a.push(i),a}const Q1=(n,u)=>xt(n.cellValue)===xt(u);function Bh(n){const u=Array.isArray(n)&&n[0]||!1;return xt(u)}const X1=n=>{const u=n.operator;let e;return Array.isArray(n.cellValue)&&(u==="IN_COLLECTION"||u==="NOT_IN_COLLECTION")?e=n.cellValue.length?n.cellValue.map(a=>`${a}`):[]:e=n.cellValue===void 0||n.cellValue===null?"":`${n.cellValue}`,ze(u||"IN",e,n.searchTerms||[])};function yh(n,u){const e=n&&(n.filterSearchType||n.fieldType)||p.dateIso,a=$0(e),[i,t]=u,r=Be(n.cellValue,a,!0);if(!i&&!t||!r)return!1;const o=a==="ISO8601"||a.toLowerCase().includes("h")?r.valueOf():Qo(new Date(r)).valueOf();if(i&&t){let l=(n==null?void 0:n.operator)??n.defaultFilterRangeOperator;l!==P.rangeInclusive&&l!==P.rangeExclusive&&(l=n.defaultFilterRangeOperator);const E=l===P.rangeInclusive,d=ze(E?">=":">",o,i.valueOf()),c=ze(E?"<=":"<",o,t.valueOf());return d&&c}const s=a==="ISO8601"||a.toLowerCase().includes("h")?i.valueOf():Qo(new Date(i)).valueOf();return ze(n.operator||"==",o,s)}function zh(n,u){const e=Array.isArray(n)&&n||[],a=u||p.dateIso,i=$0(a),t=[];if(e.length===2||typeof e[0]=="string"&&e[0].indexOf("..")>0){const r=e.length===2?e:e[0].split(".."),o=Array.isArray(r)&&r[0]||"",s=Array.isArray(r)&&r[1]||"",l=Be(o,i,!0),E=Be(s,i,!0);if(!l||!E)return[];t.push(l,E)}else{const r=Be(e[0],i,!0);if(!r)return[];t.push(r)}return t}const Sh=(n,u)=>{if(kh(n.operator))return X1(n);switch(u4(n.filterSearchType||n.fieldType)){case"boolean":return Q1(n,u);case"date":return yh(n,u||[]);case"number":return Y1(n,u||[]);case"object":return Ah(n,u);case"string":default:return Z1(n,u||[])}};function Ki(n,u){const e=u4(u);let a;switch(e){case"boolean":a=Bh(n);break;case"date":a=zh(n,u);break;case"number":a=fh(n);break;case"object":a=bh(n);break;case"string":a=vh(n);break}return a}function u4(n){switch(n){case p.boolean:return"boolean";case p.date:case p.dateIso:case p.dateUtc:case p.dateTime:case p.dateTimeIso:case p.dateTimeIsoAmPm:case p.dateTimeIsoAM_PM:case p.dateTimeShortIso:case p.dateEuro:case p.dateEuroShort:case p.dateTimeShortEuro:case p.dateTimeEuro:case p.dateTimeEuroAmPm:case p.dateTimeEuroAM_PM:case p.dateTimeEuroShort:case p.dateTimeEuroShortAmPm:case p.dateTimeEuroShortAM_PM:case p.dateUs:case p.dateUsShort:case p.dateTimeShortUs:case p.dateTimeUs:case p.dateTimeUsAmPm:case p.dateTimeUsAM_PM:case p.dateTimeUsShort:case p.dateTimeUsShortAmPm:case p.dateTimeUsShortAM_PM:return"date";case p.integer:case p.float:case p.number:return"number";case p.object:return"object";case p.string:case p.text:case p.password:case p.readonly:default:return"string"}}const Ks={executeFilterConditionTest:Sh,booleanFilter:Q1,collectionSearchFilter:X1,numberFilter:Y1,stringFilter:Z1,testFilter:ze};class wh{constructor(u,e,a,i,t){this.filterFactory=u,this.pubSubService=e,this.sharedService=a,this.backendUtilities=i,this.rxjs=t,this._isFilterFirstRender=!0,this._firstColumnIdRendered="",this._filtersMetadata=[],this._columnFilters={},this._isTreePresetExecuted=!1,this._previousFilters=[],this._onSearchChange=new N,this._eventHandler=new Tu,this.rxjs&&(this.httpCancelRequests$=this.rxjs.createSubject())}get eventHandler(){return this._eventHandler}get isFilterFirstRender(){return this._isFilterFirstRender}get onSearchChange(){return this._onSearchChange}get _gridOptions(){var u;return((u=this._grid)==null?void 0:u.getOptions())??{}}get _columnDefinitions(){var u;return((u=this._grid)==null?void 0:u.getColumns())??[]}get _dataView(){var u;return((u=this._grid)==null?void 0:u.getData())??{}}addRxJsResource(u){this.rxjs=u}init(u){this._grid=u,this._gridOptions&&this._gridOptions.enableTreeData&&this._gridOptions.treeDataOptions&&this._grid.setSortColumns([{columnId:this._gridOptions.treeDataOptions.columnId,sortAsc:!0}])}dispose(){var u;this._eventHandler.unsubscribeAll(),this.httpCancelRequests$&&((u=this.rxjs)!=null&&u.isObservable(this.httpCancelRequests$))&&(this.httpCancelRequests$.next(),this.httpCancelRequests$.complete()),this.disposeColumnFilters(),this._onSearchChange=null}disposeColumnFilters(){if(this.removeAllColumnFiltersProperties(),Array.isArray(this._filtersMetadata)){let u=this._filtersMetadata.pop();for(;u;)typeof(u==null?void 0:u.destroy)=="function"&&u.destroy(),u=this._filtersMetadata.pop()}}bindBackendOnFilter(u){this._filtersMetadata=[],this._eventHandler.subscribe(u.onHeaderRowCellRendered,(e,a)=>{a.column.id===this._firstColumnIdRendered&&(this._isFilterFirstRender=!1),this.addFilterTemplateToHeaderRow(a,this._isFilterFirstRender),this._firstColumnIdRendered===""&&(this._firstColumnIdRendered=a.column.id)}),this.subscribeToOnHeaderRowCellRendered(u),this._onSearchChange&&this._eventHandler.subscribe(this._onSearchChange,this.onBackendFilterChange.bind(this))}bindLocalOnFilter(u){this._filtersMetadata=[],this._dataView.setFilterArgs({columnFilters:this._columnFilters,grid:this._grid,dataView:this._dataView}),this._dataView.setFilter(this.customLocalFilter.bind(this)),this._onSearchChange&&this._eventHandler.subscribe(this._onSearchChange,async(e,a)=>{const i=(a==null?void 0:a.clearFilterTriggered)??!1;i||await this.emitFilterChanged(Hu.local,!0),this._gridOptions.enableTreeData===!0&&(this._tmpPreFilteredData=this.preFilterTreeData(this._dataView.getItems(),this._columnFilters)),a.columnId!==null&&this._dataView.refresh(),i||await this.emitFilterChanged(Hu.local),this._previousFilters=this.extractBasicFilterDetails(this._columnFilters)}),this._eventHandler.subscribe(u.onHeaderRowCellRendered,(e,a)=>{this.addFilterTemplateToHeaderRow(a)}),this.subscribeToOnHeaderRowCellRendered(u)}async clearFilterByColumnId(u,e){await this.pubSubService.publish("onBeforeFilterClear",{columnId:e},0);const a=this._gridOptions.backendServiceApi??!1,i=a?Hu.remote:Hu.local,t=Object.keys(this._columnFilters);let r;Array.isArray(t)&&(r=t.find(s=>s===`${e}`));const o=this._filtersMetadata.find(s=>s.columnDef.id===e);return o!=null&&o.clear&&o.clear(!0),a&&r!==void 0&&this.onBackendFilterChange(u,{grid:this._grid,columnFilters:this._columnFilters}),await this.emitFilterChanged(i),!0}async clearFilters(u=!0){var a,i;u&&await this.pubSubService.publish("onBeforeFilterClear",!0,0),this._filtersMetadata.forEach(t=>{t!=null&&t.clear&&t.clear(!1)}),this.removeAllColumnFiltersProperties(),Array.isArray(this._columnDefinitions)&&this._columnDefinitions.forEach(t=>{var r;(r=t.filter)!=null&&r.searchTerms&&delete t.filter.searchTerms}),this._dataView&&this._grid&&(this._dataView.refresh(),this._grid.invalidate());const e=this._gridOptions.backendServiceApi;if(e&&u){const t={clearFilterTriggered:!0,shouldTriggerQuery:u,grid:this._grid,columnFilters:this._columnFilters},o=e.service.processOnFilterChanged(void 0,t),s=((a=this._gridOptions.pagination)==null?void 0:a.totalItems)??0;(i=this.backendUtilities)==null||i.executeBackendCallback(e,o,t,new Date,s,{errorCallback:this.resetToPreviousSearchFilters.bind(this),successCallback:l=>this._previousFilters=this.extractBasicFilterDetails(l.columnFilters),emitActionChangedCallback:this.emitFilterChanged.bind(this)})}else this._previousFilters=this.extractBasicFilterDetails(this._columnFilters);u&&this.pubSubService.publish("onFilterCleared",!0)}customLocalFilter(u,e){const a=e==null?void 0:e.grid,i=(e==null?void 0:e.columnFilters)??{},t=this._gridOptions.enableTreeData??!1,r=this._gridOptions.treeDataOptions;if(t&&r){const o=r.collapsedPropName??T.treeDataProperties.COLLAPSED_PROP,s=r.parentPropName??T.treeDataProperties.PARENT_PROP,l=(r==null?void 0:r.childrenPropName)??T.treeDataProperties.CHILDREN_PROP,E=this._gridOptions.datasetIdPropertyName??"id",d=r.autoRecalcTotalsOnFilterChange??!1;let c=!1;if(u[s]!==null){let D=this._dataView.getItemById(u[s]);for(;D;){if(D[o])if(d)c=!0;else return!1;D=this._dataView.getItemById(D[s])}}if(this._tmpPreFilteredData instanceof Set){const D=this._tmpPreFilteredData.has(u[E]);if(d){const m=Je(this.sharedService.hierarchicalDataset,h=>h[E]===u[E],l);if(m&&(m.__filteredOut=!D),c)return!1}return D}}else if(typeof i=="object")for(const o of Object.keys(i)){const s=i[o],l=this.preProcessFilterConditionOnDataContext(u,s,a);if(typeof l=="boolean")return l;let E=s==null?void 0:s.parsedSearchTerms;if(E===void 0&&(E=Ki(s.searchTerms,s.columnDef.type||p.string),E!==void 0&&(s.parsedSearchTerms=E)),!Ks.executeFilterConditionTest(l,E))return!1}return!0}parseFormInputFilterConditions(u,e){var d;const a=wu(!0,[],u)||[];let i=Array.isArray(a)&&a.length===1?a[0]:"";const t=e.columnDef,r=((d=t.filter)==null?void 0:d.type)??t.type??p.string;let o=null;r!==p.object&&(i=i==null?"":`${i}`,o=(t.autoParseInputFilterOperator??this._gridOptions.autoParseInputFilterOperator)!==!1?i.match(/^([<>!=*]{0,2})(.*[^<>!=*])?([*]?)$/):[i,"",i,""]);let s=(o==null?void 0:o[1])||e.operator;const l=(o==null?void 0:o[2])||"",E=(o==null?void 0:o[3])||(s==="*z"?"*":"");return typeof i=="string"&&(i=i.replace("'","''"),s==="*"||s==="*z"?s=P.endsWith:(s==="a*"||E==="*")&&(s=P.startsWith)),Array.isArray(o)&&o.length>=1&&Array.isArray(a)&&a.length===1&&(a[0]=l),{dataKey:t.dataKey,fieldType:r,searchTerms:a||[],operator:s,searchInputLastChar:E,filterSearchType:t.filterSearchType,defaultFilterRangeOperator:this._gridOptions.defaultFilterRangeOperator}}preProcessFilterConditionOnDataContext(u,e,a){var c,D,m;const i=e.columnDef,t=e.columnId;let r=a.getColumnIndex(t);if(!i&&this.sharedService&&Array.isArray(this.sharedService.allColumns)&&(r=this.sharedService.allColumns.findIndex(h=>h.field===t)),!i)return!0;if(this._gridOptions.enableRowDetailView){const h=this._gridOptions.rowDetailView&&this._gridOptions.rowDetailView.keyPrefix||"__";u[`${h}isPadding`]&&u[`${h}parent`]&&(u=u[`${h}parent`])}let o=((c=i.filter)==null?void 0:c.queryField)||i.queryFieldFilter||i.queryField||i.field||"";typeof i.queryFieldNameGetterFn=="function"&&(o=i.queryFieldNameGetterFn(u));const s=((D=i.filter)==null?void 0:D.type)??i.type??p.string;let l=u[o];(o==null?void 0:o.indexOf("."))>=0&&(l=Yu(u,o));const E=e.operator,d=e.searchTerms||[];if(!d||Array.isArray(d)&&(d.length===0||d.length===1&&E===d[0]))return!0;if(d&&Array.isArray(d)&&s!==p.object)for(let h=0,x=d.length;h{D[y[o]]=y,delete D[y[o]].__used}),typeof e=="object"&&Object.keys(e).forEach(y=>{var L;const S=e[y],z=S!=null&&S.searchTerms?wu(!0,[],S.searchTerms):[],M=this.parseFormInputFilterConditions(z,S),w=S.columnDef,R=((L=w==null?void 0:w.filter)==null?void 0:L.type)??(w==null?void 0:w.type)??p.string,G=Ki(M.searchTerms,R);G!==void 0&&(S.parsedSearchTerms=G)}),u.forEach(y=>{const S=y[r];let z=!0;for(const M of Object.keys(e)){const w=e[M],R=this.preProcessFilterConditionOnDataContext(y,w,this._grid);if(R){const G=w==null?void 0:w.parsedSearchTerms,L=typeof R=="boolean"?R:Ks.executeFilterConditionTest(R,G);if(L&&c&&S&&w.columnId===E){h.set(y[o],!0);break}if(L||!d&&h.get(y[t])===!0){if(S&&w.columnId===E&&h.set(y[o],!0),L||!d&&w.columnId===E)continue}else S&&h.get(y[t])!==!0&&w.columnId!==E&&h.set(y[o],!1)}z=!1}if(z){m.add(y[o]);let M=D[y[t]]??!1;const w=!l;for(!this._isTreePresetExecuted&&Array.isArray(s)&&s.some(R=>R.itemId===M.id&&R.isCollapsed===w)&&(M[i]=w);M;)M.__used??m.add(M[o]),D[M[o]].__used=!0,M=D[M[t]]??!1}})),this._isTreePresetExecuted=!0,m}getColumnFilters(){return this._columnFilters}getPreviousFilters(){return this._previousFilters}getFiltersMetadata(){return this._filtersMetadata}getCurrentLocalFilters(){var e;const u=[];if(this._columnFilters)for(const a of Object.keys(this._columnFilters)){const i=this._columnFilters[a],t={columnId:a||""},r=this.sharedService.allColumns.find(s=>s.id===t.columnId),o=((e=r==null?void 0:r.filter)==null?void 0:e.emptySearchTermReturnAllValues)??!0;i!=null&&i.searchTerms&&(t.searchTerms=i.searchTerms),i.operator&&(t.operator=i.operator),i.targetSelector&&(t.targetSelector=i.targetSelector),Array.isArray(t.searchTerms)&&t.searchTerms.length>0&&(!o||t.searchTerms[0]!=="")&&u.push(t)}return u}emitFilterChanged(u,e=!1){const a=e?"onBeforeFilterChange":"onFilterChanged";if(u===Hu.remote&&this._gridOptions.backendServiceApi){let i=[];const t=this._gridOptions.backendServiceApi.service;return t!=null&&t.getCurrentFilters&&(i=t.getCurrentFilters()),this.pubSubService.publish(a,i)}else if(u===Hu.local)return this.pubSubService.publish(a,this.getCurrentLocalFilters())}async onBackendFilterChange(u,e){var r,o;const a=e==null?void 0:e.shouldTriggerQuery;if(a&&await this.emitFilterChanged(Hu.remote,!0),!e||!e.grid)throw new Error('Something went wrong when trying to bind the "onBackendFilterChange(event, args)" function, it seems that "args" is not populated correctly');const i=this._gridOptions.backendServiceApi;if(!i||!i.process||!i.service)throw new Error('BackendServiceApi requires at least a "process" function and a "service" defined');const t=new Date;if(i.preProcess&&i.preProcess(),a){const s=await i.service.processOnFilterChanged(u,e),l=((r=this._gridOptions.pagination)==null?void 0:r.totalItems)??0;(o=this.backendUtilities)==null||o.executeBackendCallback(i,s,e,t,l,{errorCallback:this.resetToPreviousSearchFilters.bind(this),successCallback:E=>this._previousFilters=this.extractBasicFilterDetails(E.columnFilters),emitActionChangedCallback:this.emitFilterChanged.bind(this),httpCancelRequestSubject:this.httpCancelRequests$})}}populateColumnFilterSearchTermPresets(u){return Array.isArray(u)&&(this._columnDefinitions.forEach(e=>{var i;(i=e.filter)!=null&&i.searchTerms&&delete e.filter.searchTerms;const a=u.find(t=>t.columnId===e.id);a&&Array.isArray(a==null?void 0:a.searchTerms)&&(e.filter=e.filter||{},e.filter.operator=a.operator||e.filter.operator||"",e.filter.searchTerms=a.searchTerms)}),this._gridOptions.enableTreeData&&this.refreshTreeDataFilters(),this._previousFilters=this.extractBasicFilterDetails(this._columnFilters)),this._columnDefinitions}refreshTreeDataFilters(u){var a;const e=u??((a=this._dataView)==null?void 0:a.getItems())??[];this._dataView&&this._gridOptions.enableTreeData&&e.length>0?(this._tmpPreFilteredData=this.preFilterTreeData(e,this._columnFilters),this._dataView.refresh()):e.length===0&&Array.isArray(this.sharedService.hierarchicalDataset)&&this.sharedService.hierarchicalDataset.length>0&&setTimeout(()=>this.refreshTreeDataFilters())}disableFilterFunctionality(u=!0,e=!0){const i=!this._gridOptions.enableFiltering;i!==u&&(e&&u&&this.clearFilters(),this.disableAllFilteringCommands(u),this._grid.setOptions({enableFiltering:i},!1,!0),this._grid.setHeaderRowVisibility(i),this._gridOptions.enableFiltering=!u,this.sharedService.gridOptions=this._gridOptions,this._grid.setColumns(this.sharedService.columnDefinitions))}resetToPreviousSearchFilters(){this.updateFilters(this._previousFilters,!1,!1,!1)}toggleFilterFunctionality(u=!0){const e=this._gridOptions.enableFiltering;this.disableFilterFunctionality(e,u)}toggleHeaderFilterRow(){let u=this._gridOptions.showHeaderRow??!1;u=!u,this._grid.setHeaderRowVisibility(u),u===!0&&this._grid.setColumns(this.sharedService.columnDefinitions)}setSortColumnIcons(u){this._grid&&Array.isArray(u)&&this._grid.setSortColumns(u)}async updateFilters(u,e=!0,a=!0,i=!1){var t;if(!this._filtersMetadata||this._filtersMetadata.length===0||!this._gridOptions||!this._gridOptions.enableFiltering)throw new Error('[Slickgrid-Universal] in order to use "updateFilters" method, you need to have Filterable Columns defined in your grid and "enableFiltering" set in your Grid Options');if(Array.isArray(u)){this.clearFilters(!1),u.forEach(s=>{const l=this._filtersMetadata.find(E=>s.columnId===E.columnDef.id);if(s&&l){const E=s.operator||l.defaultOperator;this.updateColumnFilters(s.searchTerms,l.columnDef,E),l.setValues(s.searchTerms||[],E),(i||this._gridOptions.enableTreeData)&&this.callbackSearchEvent(void 0,{columnDef:l.columnDef,operator:E,searchTerms:s.searchTerms,shouldTriggerQuery:!0,forceOnSearchChangeEvent:!0})}});const r=this._gridOptions.backendServiceApi,o=r?Hu.remote:Hu.local;if(e&&await this.emitFilterChanged(o,!0),this._dataView.refresh(),r){const s=r==null?void 0:r.service;s!=null&&s.updateFilters&&(s.updateFilters(u,!0),a&&((t=this.backendUtilities)==null||t.refreshBackendDataset(this._gridOptions)))}e&&await this.emitFilterChanged(o)}return!0}async updateSingleFilter(u,e=!0,a=!0){var t,r;const i=this.sharedService.allColumns.find(o=>o.id===u.columnId);if(i&&u.columnId){this._columnFilters={};const o=((t=i.filter)==null?void 0:t.emptySearchTermReturnAllValues)??!0;Array.isArray(u.searchTerms)&&(u.searchTerms.length>1||u.searchTerms.length===1&&(!o||u.searchTerms[0]!==""))&&(this._columnFilters[u.columnId]={columnId:u.columnId,operator:u.operator,searchTerms:u.searchTerms,columnDef:i,type:i.type??p.string});const s=this._gridOptions.backendServiceApi,l=s?Hu.remote:Hu.local;if(e&&await this.emitFilterChanged(l,!0),s){const E=s==null?void 0:s.service;E!=null&&E.updateFilters&&(E.updateFilters(this._columnFilters,!0),a&&((r=this.backendUtilities)==null||r.refreshBackendDataset(this._gridOptions)))}else this._dataView.setFilterArgs({columnFilters:this._columnFilters,grid:this._grid}),this._gridOptions.enableTreeData&&this.refreshTreeDataFilters(),this._dataView.refresh();e&&await this.emitFilterChanged(l)}return!0}drawFilterTemplate(u,e){let a;if(typeof e=="string"){if(a=document.querySelector(e),a===null)return null}else a=e;const i=typeof u=="string"?this.sharedService.allColumns.find(r=>r.id===u):u;if(((i==null?void 0:i.id)??"")!=="selector"&&(i!=null&&i.filterable)){let r,o;const s=this.filterFactory.createFilter(i.filter);o=i&&i.filter&&i.filter.operator||s&&s.operator,this._columnFilters[i.id]?(r=this._columnFilters[i.id].searchTerms||void 0,o=this._columnFilters[i.id].operator||void 0):i.filter&&(r=i.filter.searchTerms||void 0,this.updateColumnFilters(r,i,o));const l={grid:this._grid,operator:o,searchTerms:r,columnDef:i,filterContainerElm:a,callback:this.callbackSearchEvent.bind(this)};return s&&(s.init(l),r&&s.setValues&&s.setValues(r,o)),s}return null}addFilterTemplateToHeaderRow(u,e=!0){const a=u.column,i=(a==null?void 0:a.id)??"";if(i!=="selector"&&(a!=null&&a.filterable)){let t,r;const o=this.filterFactory.createFilter(a.filter);r=a&&a.filter&&a.filter.operator||o&&o.operator,this._columnFilters[a.id]?(t=this._columnFilters[a.id].searchTerms||void 0,r=this._columnFilters[a.id].operator||void 0):a.filter&&(t=a.filter.searchTerms||void 0,this.updateColumnFilters(t,a,r));const s={grid:this._grid,operator:r,searchTerms:t,columnDef:a,filterContainerElm:this._grid.getHeaderRowColumn(i),callback:this.callbackSearchEvent.bind(this)};if(o){o.init(s,e);const l=this._filtersMetadata.findIndex(E=>o.columnDef.id===E.columnDef.id);l===-1?this._filtersMetadata.push(o):this._filtersMetadata[l]=o,t&&o.setValues&&o.setValues(t,r)}}}callbackSearchEvent(u,e){var a,i;if(e){const t=u!=null&&u.target?u.target.value:void 0,r=e.searchTerms&&Array.isArray(e.searchTerms)?e.searchTerms:t?[t]:void 0,o=e.columnDef||null,s=(o==null?void 0:o.id)??"",l=((a=o==null?void 0:o.filter)==null?void 0:a.type)??(o==null?void 0:o.type)??p.string,E=e.operator||void 0,d=r&&Array.isArray(r),c=d&&r&&r.length,D={...this._columnFilters},m=((i=o.filter)==null?void 0:i.emptySearchTermReturnAllValues)??!0;let h;if(o&&s)if(!d||c===0||c===1&&Array.isArray(r)&&m&&r[0]==="")delete this._columnFilters[s];else{const F=`${s}`,C={columnId:F,columnDef:o,parsedSearchTerms:[],type:l,targetSelector:this.getSelectorStringFromElement(u==null?void 0:u.target)},A=this.parseFormInputFilterConditions(r,C);C.operator=E||A.operator||xi(l),h=Ki(A.searchTerms,l),h!==void 0&&(C.parsedSearchTerms=h),C.searchTerms=A.searchTerms||[],this._columnFilters[F]=C}const x=u&&typeof u.isPropagationStopped!="function"?wu({},new Pu,u):u,g=u==null?void 0:u.key;if(this._onSearchChange&&(e.forceOnSearchChangeEvent||g==="Enter"||!me(D,this._columnFilters))){const F={clearFilterTriggered:e.clearFilterTriggered,shouldTriggerQuery:e.shouldTriggerQuery,columnId:s,columnDef:o,columnFilters:this._columnFilters,operator:E||xi(l),searchTerms:r,parsedSearchTerms:h,grid:this._grid,target:u==null?void 0:u.target};this.pubSubService.publish("onBeforeSearchChange",F)===!1?this._gridOptions.resetFilterSearchValueAfterOnBeforeCancellation&&this.resetToPreviousSearchFilters():this._onSearchChange.notify(F,x)}}}disableAllFilteringCommands(u=!0){var i;const e=this._grid.getColumns();e.forEach(t=>{var r,o;(r=t==null?void 0:t.header)!=null&&r.menu&&((o=t.header.menu.commandItems)==null||o.forEach(s=>{s&&typeof s!="string"&&s.command==="clear-filter"&&(s.hidden=u)}))});const a=(i=this._gridOptions.gridMenu)==null?void 0:i.commandItems;return a&&a.forEach(t=>{if(t&&typeof t!="string"){const r=t.command;(r==="clear-filter"||r==="toggle-filter")&&(t.hidden=u)}}),e}extractBasicFilterDetails(u){const e=[];if(u&&typeof u=="object")for(const a of Object.keys(u)){const{operator:i,searchTerms:t}=u[`${a}`];e.push({columnId:a,operator:i,searchTerms:t})}return e}getSelectorStringFromElement(u){return u!=null&&u.localName?u!=null&&u.className?`${u.localName}.${Array.from(u.classList).join(".")}`:u.localName:""}removeAllColumnFiltersProperties(){typeof this._columnFilters=="object"&&Object.keys(this._columnFilters).forEach(u=>{u&&this._columnFilters[u]&&delete this._columnFilters[u]})}subscribeToOnHeaderRowCellRendered(u){this._eventHandler.subscribe(u.onBeforeHeaderRowCellDestroy,(e,a)=>{var t;const i=this._filtersMetadata.find(r=>r.columnDef.id===a.column.id);(t=i==null?void 0:i.destroy)==null||t.call(i)})}updateColumnFilters(u,e,a){var r;const i=((r=e.filter)==null?void 0:r.type)??e.type??p.string,t=Ki(u,i);u&&e&&(this._columnFilters[e.id]={columnId:e.id,columnDef:e,searchTerms:u,operator:a,parsedSearchTerms:t,type:i})}}const Hi={skipError:!1,triggerEvent:!0},Ya={highlightRow:!0,resortGrid:!1,selectRow:!1,scrollRowIntoView:!0,skipError:!1,triggerEvent:!0},Mn={highlightRow:!1,selectRow:!1,scrollRowIntoView:!1,skipError:!1,triggerEvent:!0},Hs={autoResizeColumns:!0,triggerEvent:!0,hideFromColumnPicker:!1,hideFromGridMenu:!1};class Mh{constructor(u,e,a,i,t,r,o){this.gridStateService=u,this.filterService=e,this.pubSubService=a,this.paginationService=i,this.sharedService=t,this.sortService=r,this.treeDataService=o}get _dataView(){var u;return(u=this._grid)==null?void 0:u.getData()}get _gridOptions(){var u;return((u=this._grid)==null?void 0:u.getOptions())??{}}dispose(){var u;(u=this._rowSelectionPlugin)==null||u.dispose()}init(u){this._grid=u}clearAllFiltersAndSorts(){this.sortService&&this.sortService.clearSorting&&this.sortService.clearSorting(!1),this.filterService&&this.filterService.clearFilters&&this.filterService.clearFilters()}clearPinning(u=!0){const e=[...this.sharedService.visibleColumns];this.sharedService.slickGrid.setOptions({frozenColumn:-1,frozenRow:-1,frozenBottom:!1,enableMouseWheelScrollHandler:!1}),u&&Array.isArray(e)&&this.sharedService.slickGrid.setColumns(e)}setPinning(u,e=!0,a=!1,i=!0){Wl(u)?this.clearPinning():(this.sharedService.slickGrid.setOptions(u,a,i),this.sharedService.gridOptions={...this.sharedService.gridOptions,...u}),e&&this.sharedService.slickGrid.autosizeColumns()}getAllColumnDefinitions(){return this.sharedService.allColumns}getVisibleColumnDefinitions(){return this.sharedService.visibleColumns}getColumnFromEventArguments(u){if(!u||!u.grid||!u.grid.getColumns||!u.grid.getDataItem)throw new Error("[Slickgrid-Universal] To get the column definition and data, we need to have these arguments passed as objects (row, cell, grid)");return{row:u.row,cell:u.cell,columnDef:u.grid.getColumns()[u.cell],dataContext:u.grid.getDataItem(u.row),dataView:this._dataView,grid:this._grid}}getDataItemByRowNumber(u){if(!this._grid||typeof this._grid.getDataItem!="function")throw new Error(`[Slickgrid-Universal] We could not find SlickGrid Grid object or it's "getDataItem" method`);return this._grid.getDataItem(u)}getDataItemByRowIndex(u){if(!this._grid||typeof this._grid.getDataItem!="function")throw new Error('[Slickgrid-Universal] We could not find SlickGrid Grid object and/or "getDataItem" method');return this._grid.getDataItem(u)}getDataItemByRowIndexes(u){if(!this._grid||typeof this._grid.getDataItem!="function")throw new Error('[Slickgrid-Universal] We could not find SlickGrid Grid object and/or "getDataItem" method');const e=[];return Array.isArray(u)&&u.forEach(a=>{e.push(this._grid.getDataItem(a))}),e}getSelectedRows(){if(!this._grid||typeof this._grid.getSelectedRows!="function")throw new Error('[Slickgrid-Universal] We could not find SlickGrid Grid object and/or "getSelectedRows" method');return this._grid.getSelectedRows()}getSelectedRowsDataItem(){if(!this._grid||typeof this._grid.getSelectedRows!="function")throw new Error('[Slickgrid-Universal] We could not find SlickGrid Grid object and/or "getSelectedRows" method');const u=this._grid.getSelectedRows();return this.getDataItemByRowIndexes(u)}hideColumnById(u,e){if(e={...Hs,...e},this._grid&&this._grid.getColumns&&this._grid.setColumns){const a=this._grid.getColumns(),i=a.findIndex(t=>t.id===u);if(i>=0){const t=Tr(a,i);this.sharedService.visibleColumns=t,this._grid.setColumns(t);const r=this.sharedService.allColumns.findIndex(o=>o.id===u);return r&&(e!=null&&e.hideFromColumnPicker&&(this.sharedService.allColumns[r].excludeFromColumnPicker=!0),e!=null&&e.hideFromGridMenu&&(this.sharedService.allColumns[r].excludeFromGridMenu=!0)),e!=null&&e.autoResizeColumns&&this._grid.autosizeColumns(),e!=null&&e.triggerEvent&&this.pubSubService.publish("onHeaderMenuHideColumns",{columns:t}),i}}return-1}hideColumnByIds(u,e){if(e={...Hs,...e},Array.isArray(u)){for(const a of u)this.hideColumnById(a,{...e,triggerEvent:!1,autoResizeColumns:!1});e!=null&&e.autoResizeColumns&&this._grid.autosizeColumns(),e!=null&&e.triggerEvent&&this.pubSubService.publish("onHeaderMenuHideColumns",{columns:this.sharedService.visibleColumns})}}highlightRow(u,e){this._grid.getSelectionModel()||(this._rowSelectionPlugin=new Zt(this._gridOptions.rowSelectionOptions),this._grid.setSelectionModel(this._rowSelectionPlugin)),e||(e=this._gridOptions.rowHighlightDuration),Array.isArray(u)?u.forEach(a=>this._grid.highlightRow(a)):this._grid.highlightRow(u,e)}setSelectedRow(u){var e;(e=this._grid)!=null&&e.setSelectedRows&&this._grid.setSelectedRows([u])}setSelectedRows(u){var e;(e=this._grid)!=null&&e.setSelectedRows&&this._grid.setSelectedRows(u)}renderGrid(){var u;typeof((u=this._grid)==null?void 0:u.invalidate)=="function"&&this._grid.invalidate()}resetGrid(u){var e,a,i;if(this.clearPinning(!1),this._grid){const t=this.sharedService.allColumns||[];Array.isArray(t)&&t.length>0&&(this._grid.setColumns(t),(e=this._gridOptions)!=null&&e.enableAutoSizeColumns&&this._grid.autosizeColumns(),this.gridStateService.resetColumns(u))}typeof((a=this.filterService)==null?void 0:a.clearFilters)=="function"&&this.filterService.clearFilters(),typeof((i=this.sortService)==null?void 0:i.clearSorting)=="function"&&this.sortService.clearSorting()}addItem(u,e){var l,E,d,c;const a={...Ya,...e};if(!(a!=null&&a.skipError)&&(!this._grid||!this._gridOptions||!this._dataView))throw new Error("[Slickgrid-Universal] We could not find SlickGrid Grid, DataView objects");const i=this._gridOptions.datasetIdPropertyName||"id";if(!(a!=null&&a.skipError)&&(!u||!u.hasOwnProperty(i)))throw new Error(`[Slickgrid-Universal] Adding an item requires the item to include an "${i}" property`);if((l=this._gridOptions)!=null&&l.enableTreeData&&(e==null?void 0:e.position)==="top")throw new Error('[Slickgrid-Universal] Please note that `addItem({ position: "top" })` is not supported when used with Tree Data because of the extra complexity.');const t=a==null?void 0:a.position;t==="bottom"||(E=this._gridOptions)!=null&&E.enableTreeData?this._dataView.addItem(u):this._dataView.insertItem(0,u);let r=0;const o=(u==null?void 0:u[i])??"";return(d=this._gridOptions)!=null&&d.enableTreeData?(this.invalidateHierarchicalDataset(),r=this._dataView.getRowById(o),a.scrollRowIntoView&&this._grid.scrollRowIntoView(r??0,!1)):a.resortGrid?(this._dataView.reSort(),r=this._dataView.getRowById(o)):(r=t==="bottom"?this._dataView.getRowById(o):0,a.scrollRowIntoView&&this._grid.scrollRowIntoView(r??0)),a.highlightRow&&r!==void 0&&this.highlightRow(r),r!==void 0&&a.selectRow&&this._gridOptions&&(this._gridOptions.enableCheckboxSelector||this._gridOptions.enableRowSelection)&&this.setSelectedRow(r),a.triggerEvent&&this.pubSubService.publish("onItemAdded",u),!((c=this._gridOptions)!=null&&c.backendServiceApi)&&this._gridOptions.enablePagination&&(t==="bottom"?this.paginationService.goToLastPage():this.paginationService.goToFirstPage()),r}addItems(u,e){var o,s,l,E;const a={...Ya,...e},i=this._gridOptions.datasetIdPropertyName||"id",t=a==null?void 0:a.position,r=[];if(Array.isArray(u))this._dataView.beginUpdate(!0),t==="bottom"||(o=this._gridOptions)!=null&&o.enableTreeData?this._dataView.addItems(u):this._dataView.insertItems(0,u),this._dataView.endUpdate();else return[this.addItem(u,a)||0];if((s=this._gridOptions)!=null&&s.enableTreeData){this.invalidateHierarchicalDataset();const d=((l=u[0])==null?void 0:l[i])??"",c=this._dataView.getRowById(d);a.scrollRowIntoView&&this._grid.scrollRowIntoView(c??0,!1)}else a.resortGrid&&this._dataView.reSort();return t&&a.scrollRowIntoView&&!((E=this._gridOptions)!=null&&E.enableTreeData)&&(t==="bottom"?this._grid.navigateBottom():this._grid.navigateTop()),u.forEach(d=>r.push(this._dataView.getRowById(d[i]))),a.highlightRow&&this.highlightRow(r),a.selectRow&&this._gridOptions&&(this._gridOptions.enableCheckboxSelector||this._gridOptions.enableRowSelection)&&this.setSelectedRows(r),a.triggerEvent&&this.pubSubService.publish("onItemAdded",u),r}deleteItem(u,e){e={...Hi,...e};const a=this._gridOptions.datasetIdPropertyName||"id";if(!(e!=null&&e.skipError)&&(!u||!u.hasOwnProperty(a)))throw new Error(`[Slickgrid-Universal] Deleting an item requires the item to include an "${a}" property`);return this.deleteItemById(u[a],e)}deleteItems(u,e){e={...Hi,...e};const a=this._gridOptions.datasetIdPropertyName||"id";if(!Array.isArray(u))return this.deleteItem(u,e),[u[a]];this._dataView.beginUpdate(!0);const i=[];return u.forEach(t=>{(t==null?void 0:t[a])!==void 0&&i.push(t[a])}),this._dataView.deleteItems(i),this._dataView.endUpdate(),e.triggerEvent&&this.pubSubService.publish("onItemDeleted",u),i}deleteItemById(u,e){if(e={...Hi,...e},!(e!=null&&e.skipError)&&u==null)throw new Error('[Slickgrid-Universal] Cannot delete a row without a valid "id"');return!(this.gridStateService&&this.gridStateService.needToPreserveRowSelection()||!1)&&this._grid&&this._gridOptions&&(this._gridOptions.enableCheckboxSelector||this._gridOptions.enableRowSelection)&&this.setSelectedRows([]),this._dataView.deleteItem(u),e.triggerEvent&&this.pubSubService.publish("onItemDeleted",u),u}deleteItemByIds(u,e){if(e={...Hi,...e},Array.isArray(u)){this._dataView.beginUpdate(!0);for(let a=0;a{const s=!o||!o.hasOwnProperty(a)?void 0:o[a];if(t.push(s),this._dataView.getIdxById(s)!==void 0){const l=this._dataView.getRowById(s);l!==void 0&&(i.push(l),this._grid.updateRow(l))}}),this._dataView.updateItems(t,u),this._dataView.endUpdate(),(r=this._gridOptions)!=null&&r.enableTreeData&&this.invalidateHierarchicalDataset(),e.highlightRow&&this.highlightRow(i),e.selectRow&&this._gridOptions&&(this._gridOptions.enableCheckboxSelector||this._gridOptions.enableRowSelection)&&this.setSelectedRows(i),e.triggerEvent&&this.pubSubService.publish("onItemUpdated",u),i}updateItemById(u,e,a){var t;if(a={...Mn,...a},!(a!=null&&a.skipError)&&u===void 0)throw new Error('[Slickgrid-Universal] Cannot update a row without a valid "id"');const i=this._dataView.getRowById(u);if(!(a!=null&&a.skipError)&&!e&&!this._gridOptions.enablePagination)throw new Error(`[Slickgrid-Universal] The item to update in the grid was not found with id: ${u}`);return this._dataView.getIdxById(u)!==void 0&&(this._dataView.updateItem(u,e),i!==void 0&&this._grid.updateRow(i),(t=this._gridOptions)!=null&&t.enableTreeData&&this.invalidateHierarchicalDataset(),a.scrollRowIntoView&&i!==void 0&&this._grid.scrollRowIntoView(i),a.highlightRow&&i!==void 0&&this.highlightRow(i),i!==void 0&&a.selectRow&&this._gridOptions&&(this._gridOptions.enableCheckboxSelector||this._gridOptions.enableRowSelection)&&this.setSelectedRow(i),a.triggerEvent&&this.pubSubService.publish("onItemUpdated",e)),i}upsertItem(u,e){e={...Ya,...e};const a=this._gridOptions.datasetIdPropertyName||"id",i=!u||!u.hasOwnProperty(a)?void 0:u[a];if(!(e!=null&&e.skipError)&&i===void 0)throw new Error(`[Slickgrid-Universal] Calling Upsert of an item requires the item to include an "${a}" property`);return this.upsertItemById(i,u,e)}upsertItems(u,e){if(e={...Ya,...e},!Array.isArray(u))return[this.upsertItem(u,e)];this._dataView.beginUpdate(!0);const a=[];u.forEach(t=>{a.push(this.upsertItem(t,{...e,highlightRow:!1,resortGrid:!1,selectRow:!1,triggerEvent:!1}))}),this._dataView.endUpdate();const i=a.map(t=>t.added!==void 0?t.added:t.updated);if(e.highlightRow&&this.highlightRow(i),e.selectRow&&this._gridOptions&&(this._gridOptions.enableCheckboxSelector||this._gridOptions.enableRowSelection)&&this.setSelectedRows(i),e.triggerEvent){this.pubSubService.publish("onItemUpserted",u);const t=a.filter(o=>o.added!==void 0);Array.isArray(t)&&t.length>0&&this.pubSubService.publish("onItemAdded",t);const r=a.filter(o=>o.updated!==void 0);Array.isArray(r)&&r.length>0&&this.pubSubService.publish("onItemUpdated",r)}return a}upsertItemById(u,e,a){let i=!1;if(a={...Ya,...a},!(a!=null&&a.skipError)&&u===void 0&&!this.hasRowSelectionEnabled())throw new Error('[Slickgrid-Universal] Calling Upsert of an item requires the item to include a valid and unique "id" property');let t,r;return this._dataView.getRowById(u)===void 0?(t=this.addItem(e,a),i=!0):(r=this.updateItem(e,{highlightRow:a.highlightRow,selectRow:a.selectRow,triggerEvent:a.triggerEvent}),i=!1),a.triggerEvent&&(this.pubSubService.publish("onItemUpserted",e),i?this.pubSubService.publish("onItemAdded",e):this.pubSubService.publish("onItemUpdated",e)),{added:t,updated:r}}invalidateHierarchicalDataset(u){var e;if((e=this._gridOptions)!=null&&e.enableTreeData&&this.treeDataService){const a=u??this._dataView.getItems(),i=this.treeDataService.convertFlatParentChildToTreeDatasetAndSort(a||[],this.sharedService.allColumns,this._gridOptions);this.sharedService.hierarchicalDataset=i.hierarchical,this.filterService.refreshTreeDataFilters(u),this._dataView.setItems(i.flat),this._grid.invalidate()}}hasRowSelectionEnabled(){const u=this._grid.getSelectionModel();return(this._gridOptions.enableRowSelection||this._gridOptions.enableCheckboxSelector)&&u}}class Th{get eventHandler(){return this._eventHandler}constructor(){this._eventHandler=new Tu}dispose(){this._eventHandler.unsubscribeAll()}bindOnBeforeEditCell(u){const e=u==null?void 0:u.getData();this._eventHandler.subscribe(u.onBeforeEditCell,(a,i)=>{if(!a||!i||!u||i.cell===void 0||!u.getColumns||!u.getDataItem)return;const t=u.getColumns()[i.cell];if(typeof t.onBeforeEditCell=="function"){const r={row:i.row,cell:i.cell,dataView:e,grid:u,columnDef:t,dataContext:u.getDataItem(i.row)};t.onBeforeEditCell(a instanceof Pu?a.getNativeEvent():a,r)}})}bindOnCellChange(u){const e=u==null?void 0:u.getData();this._eventHandler.subscribe(u.onCellChange,(a,i)=>{if(!a||!i||!u||i.cell===void 0||!u.getColumns||!u.getDataItem)return;const t=u.getColumns()[i.cell];if(typeof t.onCellChange=="function"){const r={row:i.row,cell:i.cell,dataView:e,grid:u,columnDef:t,dataContext:u.getDataItem(i.row)};t.onCellChange(a instanceof Pu?a.getNativeEvent():a,r)}})}bindOnClick(u){const e=u==null?void 0:u.getData();this._eventHandler.subscribe(u.onClick,(a,i)=>{if(!a||!i||!u||i.cell===void 0||!u.getColumns||!u.getDataItem)return;const t=u.getColumns()[i.cell];if(typeof t.onCellClick=="function"){const r={row:i.row,cell:i.cell,dataView:e,grid:u,columnDef:t,dataContext:u.getDataItem(i.row)};t.onCellClick(a instanceof Pu?a.getNativeEvent():a,r)}})}}class _h{constructor(u,e,a,i,t,r){this.extensionService=u,this.filterService=e,this.pubSubService=a,this.sharedService=i,this.sortService=t,this.treeDataService=r,this._eventHandler=new Tu,this._columns=[],this._subscriptions=[],this._selectedRowIndexes=[],this._selectedRowDataContextIds=[],this._wasRecheckedAfterPageChange=!0}get _dataView(){var u;return((u=this._grid)==null?void 0:u.getData())??{}}get _gridOptions(){var u;return((u=this._grid)==null?void 0:u.getOptions())??{}}get selectedRowDataContextIds(){return this._selectedRowDataContextIds}set selectedRowDataContextIds(u){this._selectedRowDataContextIds=u}init(u){this._grid=u,this.subscribeToAllGridChanges(u)}dispose(){this._columns=[],this._eventHandler.unsubscribeAll(),this.pubSubService.unsubscribeAll(this._subscriptions)}changeColumnsArrangement(u,e=!0,a=!1){var i,t,r,o,s,l;if(Array.isArray(u)&&u.length>0){const E=this.getAssociatedGridColumns(this._grid,u);if(E&&Array.isArray(E)&&E.length>0){if(Array.isArray(this.sharedService.allColumns)){const d=[];if(this._gridOptions.enableCheckboxSelector){const c=((t=(i=this._gridOptions)==null?void 0:i.checkboxSelector)==null?void 0:t.columnIndexPosition)??0;d.push({columnId:"_checkbox_selector",columnIndexPosition:c})}if(this._gridOptions.enableRowDetailView){const c=((o=(r=this._gridOptions)==null?void 0:r.rowDetailView)==null?void 0:o.columnIndexPosition)??0;d.push({columnId:"_detail_selector",columnIndexPosition:c})}if(this._gridOptions.enableRowMoveManager){const c=((l=(s=this._gridOptions)==null?void 0:s.rowMoveManager)==null?void 0:l.columnIndexPosition)??0;d.push({columnId:"_move",columnIndexPosition:c})}this.addColumnDynamicWhenFeatureEnabled(d,this.sharedService.allColumns,E)}E.forEach(d=>d.originalWidth=d.width||d.originalWidth),this._grid.setColumns(E),this.sharedService.visibleColumns=E,e?this._grid.autosizeColumns():(a||this._gridOptions.enableAutoResizeColumnsByCellContent&&!this._gridOptions.autosizeColumnsByCellContentOnFirstLoad)&&this.pubSubService.publish("onFullResizeByContentRequested",{caller:"GridStateService"})}}}getCurrentGridState(){var r;const{frozenColumn:u,frozenRow:e,frozenBottom:a}=this.sharedService.gridOptions,i={columns:this.getCurrentColumns(),filters:this.getCurrentFilters(),sorters:this.getCurrentSorters(),pinning:{frozenColumn:u,frozenRow:e,frozenBottom:a}},t=this.getCurrentPagination();if(t&&(i.pagination=t),this.hasRowSelectionEnabled()){const o=this.getCurrentRowSelections();o&&(i.rowSelection=o)}if((r=this._gridOptions)!=null&&r.enableTreeData){const o=this.getCurrentTreeDataToggleState();o&&(i.treeData=o)}return i}getColumns(){return this._columns}getAssociatedCurrentColumns(u){const e=[];return u&&Array.isArray(u)&&u.forEach(a=>{a!=null&&a.id&&e.push({columnId:a.id,cssClass:a.cssClass||"",headerCssClass:a.headerCssClass||"",width:a.width||0})}),e}getAssociatedGridColumns(u,e){const a=[],i=this.sharedService.allColumns||u.getColumns();return e&&Array.isArray(e)&&e.forEach(t=>{const r=i.find(o=>o.id===t.columnId);r!=null&&r.id&&a.push({...r,cssClass:t.cssClass||r.cssClass,headerCssClass:t.headerCssClass||r.headerCssClass,width:t.width})}),this._columns=a,a}getCurrentColumns(){return this.getAssociatedCurrentColumns(this._grid.getColumns()||[])}getCurrentFilters(){var u,e;if((u=this._gridOptions)!=null&&u.backendServiceApi){const a=this._gridOptions.backendServiceApi.service;if(a!=null&&a.getCurrentFilters)return a.getCurrentFilters()}else if((e=this.filterService)!=null&&e.getCurrentLocalFilters)return this.filterService.getCurrentLocalFilters();return null}getCurrentPagination(){var u;if((u=this._gridOptions)!=null&&u.enablePagination)if(this._gridOptions.backendServiceApi){const e=this._gridOptions.backendServiceApi.service;if(e!=null&&e.getCurrentPagination)return e.getCurrentPagination()}else return this.sharedService.currentPagination;return null}getCurrentRowSelections(){return this._grid&&this._dataView&&this.hasRowSelectionEnabled()?{gridRowIndexes:this._grid.getSelectedRows()||[],dataContextIds:this._dataView.getAllSelectedIds()||[],filteredDataContextIds:this._dataView.getAllSelectedFilteredIds()||[]}:null}getCurrentSorters(){var u,e;if((u=this._gridOptions)!=null&&u.backendServiceApi){const a=this._gridOptions.backendServiceApi.service;if(a!=null&&a.getCurrentSorters)return a.getCurrentSorters()}else if((e=this.sortService)!=null&&e.getCurrentLocalSorters)return this.sortService.getCurrentLocalSorters();return null}getCurrentTreeDataToggleState(){var u;return(u=this._gridOptions)!=null&&u.enableTreeData&&this.treeDataService?this.treeDataService.getCurrentToggleState():null}needToPreserveRowSelection(){var e;let u=!1;if((e=this._gridOptions)!=null&&e.dataView&&this._gridOptions.dataView.hasOwnProperty("syncGridSelection")){const a=this._gridOptions.dataView.syncGridSelection;typeof a=="boolean"?u=this._gridOptions.dataView.syncGridSelection:typeof a=="object"&&(u=a.preserveHidden||a.preserveHiddenOnSelectionChange),u&&this._gridOptions.backendServiceApi&&this._gridOptions.dataView.hasOwnProperty("syncGridSelectionWithBackendService")&&(u=this._gridOptions.dataView.syncGridSelectionWithBackendService)}return u}resetColumns(u){const e=u||this._columns,a=this.getAssociatedCurrentColumns(e);this.pubSubService.publish("onGridStateChanged",{change:{newValues:a,type:p0.columns},gridState:this.getCurrentGridState()})}resetToOriginalColumns(u=!0){this._grid.setColumns(this.sharedService.allColumns),this.sharedService.visibleColumns=this.sharedService.allColumns,u&&this._grid.autosizeColumns()}resetRowSelectionWhenRequired(){var u,e;if(!this.needToPreserveRowSelection()&&(this._gridOptions.enableRowSelection||this._gridOptions.enableCheckboxSelector)){const a=(e=(u=this.extensionService)==null?void 0:u.getExtensionByName)==null?void 0:e.call(u,ou.rowSelection);a!=null&&a.instance&&this._grid.setSelectedRows([])}}subscribeToAllGridChanges(u){this._subscriptions.push(this.pubSubService.subscribe("onFilterChanged",e=>{this.resetRowSelectionWhenRequired(),this.pubSubService.publish("onGridStateChanged",{change:{newValues:e,type:p0.filter},gridState:this.getCurrentGridState()})})),this._subscriptions.push(this.pubSubService.subscribe("onFilterCleared",()=>{this.resetRowSelectionWhenRequired(),this.pubSubService.publish("onGridStateChanged",{change:{newValues:[],type:p0.filter},gridState:this.getCurrentGridState()})})),this._subscriptions.push(this.pubSubService.subscribe("onSortChanged",e=>{this.resetRowSelectionWhenRequired(),this.pubSubService.publish("onGridStateChanged",{change:{newValues:e,type:p0.sorter},gridState:this.getCurrentGridState()})})),this._subscriptions.push(this.pubSubService.subscribe("onSortCleared",()=>{this.resetRowSelectionWhenRequired(),this.pubSubService.publish("onGridStateChanged",{change:{newValues:[],type:p0.sorter},gridState:this.getCurrentGridState()})})),this.bindExtensionAddonEventToGridStateChange(ou.columnPicker,"onColumnsChanged"),this.bindExtensionAddonEventToGridStateChange(ou.gridMenu,"onColumnsChanged"),this.bindSlickGridColumnChangeEventToGridStateChange("onColumnsReordered",u),this.bindSlickGridColumnChangeEventToGridStateChange("onColumnsResized",u),this.bindSlickGridOnSetOptionsEventToGridStateChange(u),(this._gridOptions.enableRowSelection||this._gridOptions.enableCheckboxSelector)&&this._eventHandler.subscribe(this._dataView.onSelectedRowIdsChanged,(e,a)=>{const i=(this._selectedRowIndexes||[]).slice(),t=(this.selectedRowDataContextIds||[]).slice();if(this.selectedRowDataContextIds=a.filteredIds,this._selectedRowIndexes=a.rows,!me(this.selectedRowDataContextIds,t)||!me(this._selectedRowIndexes,i)){const r={gridRowIndexes:this._selectedRowIndexes||[],dataContextIds:a.selectedRowIds,filteredDataContextIds:a.filteredIds};this.pubSubService.publish("onGridStateChanged",{change:{newValues:r,type:p0.rowSelection},gridState:this.getCurrentGridState()})}}),this._subscriptions.push(this.pubSubService.subscribe("onHeaderMenuHideColumns",e=>{const a=this.getAssociatedCurrentColumns(e);this.pubSubService.publish("onGridStateChanged",{change:{newValues:a,type:p0.columns},gridState:this.getCurrentGridState()})})),this._subscriptions.push(this.pubSubService.subscribe("onTreeItemToggled",e=>{this.pubSubService.publish("onGridStateChanged",{change:{newValues:e,type:p0.treeData},gridState:this.getCurrentGridState()})})),this._subscriptions.push(this.pubSubService.subscribe("onTreeFullToggleEnd",e=>{this.pubSubService.publish("onGridStateChanged",{change:{newValues:e,type:p0.treeData},gridState:this.getCurrentGridState()})}))}addColumnDynamicWhenFeatureEnabled(u,e,a){u.sort((i,t)=>i.columnIndexPosition-t.columnIndexPosition),u.forEach(i=>{const t=e.findIndex(o=>o.id===i.columnId),r=a.findIndex(o=>o.id===i.columnId);if(t>=0&&r===-1){const o=e[t];t===0?a.unshift(o):a.splice(t,0,o)}})}bindExtensionAddonEventToGridStateChange(u,e){var t,r,o;const a=(r=(t=this.extensionService)==null?void 0:t.getExtensionByName)==null?void 0:r.call(t,u),i=(o=a==null?void 0:a.instance)==null?void 0:o[e];i&&typeof i.subscribe=="function"&&this._eventHandler.subscribe(i,(s,l)=>{const E=l==null?void 0:l.columns,d=this.getAssociatedCurrentColumns(E);this.pubSubService.publish("onGridStateChanged",{change:{newValues:d,type:p0.columns},gridState:this.getCurrentGridState()})})}bindSlickGridColumnChangeEventToGridStateChange(u,e){const a=e==null?void 0:e[u];a&&typeof a.subscribe=="function"&&this._eventHandler.subscribe(a,()=>{const i=e.getColumns(),t=this.getAssociatedCurrentColumns(i);this.pubSubService.publish("onGridStateChanged",{change:{newValues:t,type:p0.columns},gridState:this.getCurrentGridState()})})}bindSlickGridOnSetOptionsEventToGridStateChange(u){const e=u.onSetOptions;this._eventHandler.subscribe(e,(a,i)=>{const{frozenBottom:t,frozenColumn:r,frozenRow:o}=i.optionsBefore,{frozenBottom:s,frozenColumn:l,frozenRow:E}=i.optionsAfter;if(t!==s||r!==l||o!==E){const d={frozenBottom:s,frozenColumn:l,frozenRow:E},c=this.getCurrentGridState();this.pubSubService.publish("onGridStateChanged",{change:{newValues:d,type:p0.pinning},gridState:c})}})}hasRowSelectionEnabled(){const u=this._grid.getSelectionModel();return(this._gridOptions.enableRowSelection||this._gridOptions.enableCheckboxSelector)&&u}}class Ph{constructor(u,e){this.extensionUtility=u,this.pubSubService=e,this._subscriptions=[],this._eventHandler=new Tu}get _dataView(){var u;return((u=this._grid)==null?void 0:u.getData())??{}}get eventHandler(){return this._eventHandler}get _gridOptions(){var u;return((u=this._grid)==null?void 0:u.getOptions())??{}}get _columnDefinitions(){var u;return((u=this._grid)==null?void 0:u.getColumns())??[]}init(u){if(this._grid=u,u&&this._gridOptions&&this._gridOptions.createPreHeaderPanel){this._gridOptions.enableTranslate&&this.translateGroupingAndColSpan(),this._eventHandler.subscribe(u.onSort,()=>this.renderPreHeaderRowGroupingTitles()),this._eventHandler.subscribe(u.onRendered,()=>this.renderPreHeaderRowGroupingTitles()),this._eventHandler.subscribe(u.onAutosizeColumns,()=>this.renderPreHeaderRowGroupingTitles()),this._eventHandler.subscribe(u.onColumnsResized,()=>this.renderPreHeaderRowGroupingTitles()),this._eventHandler.subscribe(u.onColumnsReordered,()=>this.renderPreHeaderRowGroupingTitles()),this._eventHandler.subscribe(this._dataView.onRowCountChanged,()=>this.delayRenderPreHeaderRowGroupingTitles(0)),this._subscriptions.push(this.pubSubService.subscribe("onColumnPickerColumnsChanged",()=>this.renderPreHeaderRowGroupingTitles()),this.pubSubService.subscribe("onHeaderMenuHideColumns",()=>this.delayRenderPreHeaderRowGroupingTitles(0)),this.pubSubService.subscribe("onGridMenuColumnsChanged",()=>this.renderPreHeaderRowGroupingTitles()),this.pubSubService.subscribe("onGridMenuMenuClose",()=>this.renderPreHeaderRowGroupingTitles()));const e=u.getPluginByName("Resizer");e!=null&&e.onGridAfterResize&&this._eventHandler.subscribe(e.onGridAfterResize,()=>this.renderPreHeaderRowGroupingTitles()),this._eventHandler.subscribe(u.onSetOptions,(a,i)=>{var t,r;((t=i==null?void 0:i.optionsBefore)==null?void 0:t.frozenColumn)!==((r=i==null?void 0:i.optionsAfter)==null?void 0:r.frozenColumn)&&this.delayRenderPreHeaderRowGroupingTitles(0)}),this.delayRenderPreHeaderRowGroupingTitles(75)}}dispose(){this._eventHandler.unsubscribeAll(),this.pubSubService.unsubscribeAll(this._subscriptions)}delayRenderPreHeaderRowGroupingTitles(u=0){setTimeout(()=>this.renderPreHeaderRowGroupingTitles(),u)}renderPreHeaderRowGroupingTitles(){var u;if(this._gridOptions&&this._gridOptions.frozenColumn!==void 0&&this._gridOptions.frozenColumn>=0){let e=this._grid.getPreHeaderPanelLeft();this.renderHeaderGroups(e,0,this._gridOptions.frozenColumn+1),e=this._grid.getPreHeaderPanelRight(),this.renderHeaderGroups(e,((u=this._gridOptions)==null?void 0:u.frozenColumn)+1,this._columnDefinitions.length)}else{const e=this._grid.getPreHeaderPanel();this.renderHeaderGroups(e,0,this._columnDefinitions.length)}}renderHeaderGroups(u,e,a){var d,c;bu(u),u.className="slick-header-columns",u.style.left="-1000px",u.style.width=`${this._grid.getHeadersWidth()}px`,u.parentElement&&u.parentElement.classList.add("slick-header");const i=this._grid.getHeaderColumnWidthDiff();let t,r=null,o="",s=0;const l=((d=this._gridOptions)==null?void 0:d.frozenHeaderWidthCalcDifferential)??0,E=((c=this._gridOptions)==null?void 0:c.frozenColumn)!==void 0&&this._gridOptions.frozenColumn>=0;for(let D=e;D0?(s+=t.width||0,r!=null&&r.style&&(r.style.width=`${s-i-l}px`)):(s=t.width||0,r=v("div",{className:`slick-state-default slick-header-column ${E?"frozen":""}`,style:{width:`${s-i}px`}}),v("span",{className:"slick-column-name",textContent:t.columnGroup||""},r),u.appendChild(r)),o=t.columnGroup||"")}translateGroupingAndColSpan(){const u=this._grid.getColumns();this.extensionUtility.translateItems(u,"columnGroupKey","columnGroup"),this._grid.setColumns(u),this.renderPreHeaderRowGroupingTitles()}}class jh{constructor(u,e,a,i){this.pubSubService=u,this.sharedService=e,this.backendUtilities=a,this.rxjs=i,this._eventHandler=new Tu,this._initialized=!1,this._isLocalGrid=!0,this._dataFrom=1,this._dataTo=1,this._itemsPerPage=0,this._pageCount=1,this._pageNumber=1,this._totalItems=0,this._availablePageSizes=[],this._subscriptions=[],this._isCursorBased=!1}get dataView(){var u;return((u=this.grid)==null?void 0:u.getData())??{}}set paginationOptions(u){this._paginationOptions=u}get paginationOptions(){return this._paginationOptions}get availablePageSizes(){return this._availablePageSizes}get dataFrom(){return this._dataFrom}get dataTo(){return this._dataTo}get itemsPerPage(){return this._itemsPerPage}get pageCount(){return this._pageCount}get pageNumber(){return this._pageNumber}get totalItems(){return this._totalItems}set totalItems(u){this._totalItems=u,this._initialized&&this.refreshPagination()}get isCursorBased(){return this._isCursorBased}addRxJsResource(u){this.rxjs=u}init(u,e,a){var t;if(this._availablePageSizes=e.pageSizes,this.grid=u,this._backendServiceApi=a,this._paginationOptions=e,this._isLocalGrid=!a,this._pageNumber=e.pageNumber||1,this._isCursorBased=((t=a==null?void 0:a.options)==null?void 0:t.useCursor)??!1,a&&(!a.service||!a.process))throw new Error('BackendServiceApi requires the following 2 properties "process" and "service" to be defined.');this._isLocalGrid&&this.dataView&&(this._eventHandler.subscribe(this.dataView.onPagingInfoChanged,(r,o)=>{this._totalItems!==o.totalRows&&(this.updateTotalItems(o.totalRows),this._previousPagination={pageNumber:o.pageNum,pageSize:o.pageSize,pageSizes:this.availablePageSizes,totalItems:o.totalRows})}),setTimeout(()=>{this.dataView&&(this.dataView.setRefreshHints({isFilterUnchanged:!0}),this.dataView.setPagingOptions({pageSize:this.paginationOptions.pageSize,pageNum:this._pageNumber-1}))})),this._subscriptions.push(this.pubSubService.subscribe("onFilterChanged",()=>this.resetPagination())),this._subscriptions.push(this.pubSubService.subscribe("onFilterCleared",()=>this.resetPagination())),this.dataView&&(this._subscriptions.push(this.pubSubService.subscribe("onItemAdded",r=>this.processOnItemAddedOrRemoved(r,!0))),this._subscriptions.push(this.pubSubService.subscribe("onItemDeleted",r=>this.processOnItemAddedOrRemoved(r,!1)))),this.refreshPagination(!1,!1,!0);const i=this.getFullPagination();this._previousPagination={pageNumber:i.pageNumber,pageSize:i.pageSize,pageSizes:i.pageSizes,totalItems:this.totalItems},this._initialized=!0}dispose(){this._initialized=!1,this._eventHandler.unsubscribeAll(),this.pubSubService.unsubscribeAll(this._subscriptions)}getCurrentPagination(){return{pageNumber:this._pageNumber,pageSize:this._itemsPerPage,pageSizes:this._availablePageSizes}}getFullPagination(){return{pageCount:this._pageCount,pageNumber:this._pageNumber,pageSize:this._itemsPerPage,pageSizes:this._availablePageSizes,totalItems:this._totalItems,dataFrom:this._dataFrom,dataTo:this._dataTo}}getCurrentPageNumber(){return this._pageNumber}getCurrentItemPerPage(){return this._itemsPerPage}changeItemPerPage(u,e,a=!0){return this._pageNumber=1,this._pageCount=Math.ceil(this._totalItems/u),this._itemsPerPage=u,a?this.processOnPageChanged(this._pageNumber,e):Promise.resolve(this.getFullPagination())}goToFirstPage(u,e=!0){return this._pageNumber=1,e?this.isCursorBased&&this._cursorPageInfo?this.processOnPageChanged(this._pageNumber,u,{newPage:this._pageNumber,pageSize:this._itemsPerPage,first:this._itemsPerPage}):this.processOnPageChanged(this._pageNumber,u):Promise.resolve(this.getFullPagination())}goToLastPage(u,e=!0){return this._pageNumber=this._pageCount||1,e?this.isCursorBased&&this._cursorPageInfo?this.processOnPageChanged(this._pageNumber,u,{newPage:this._pageNumber,pageSize:this._itemsPerPage,last:this._itemsPerPage}):this.processOnPageChanged(this._pageNumber,u):Promise.resolve(this.getFullPagination())}goToNextPage(u,e=!0){return this._pageNumberthis._pageCount?this._pageNumber=this._pageCount:this._pageNumber=u,this._pageNumber!==i?a?this.processOnPageChanged(this._pageNumber,e):Promise.resolve(this.getFullPagination()):Promise.resolve(!1)}goToPreviousPage(u,e=!0){return this._pageNumber>1?(this._pageNumber--,e?this.isCursorBased&&this._cursorPageInfo?this.processOnPageChanged(this._pageNumber,u,{newPage:this._pageNumber,pageSize:this._itemsPerPage,last:this._itemsPerPage,before:this._cursorPageInfo.startCursor}):this.processOnPageChanged(this._pageNumber,u):Promise.resolve(this.getFullPagination())):Promise.resolve(!1)}refreshPagination(u=!1,e=!0,a=!1){var r,o,s;const i={...this.getFullPagination()};if(this._paginationOptions){const l=this._paginationOptions;this._itemsPerPage||(this._isLocalGrid?this._itemsPerPage=l.pageSize:this._itemsPerPage=+((s=(o=(r=this._backendServiceApi)==null?void 0:r.options)==null?void 0:o.paginationOptions)!=null&&s.first?this._backendServiceApi.options.paginationOptions.first:l.pageSize)),(u||this._totalItems!==l.totalItems)&&(u?(this._pageNumber=1,this.paginationOptions.pageNumber=1):!this._initialized&&l.pageNumber&&l.pageNumber>1&&(this._pageNumber=l.pageNumber||1),this._pageNumber===1&&this._backendServiceApi&&this._backendServiceApi.service.resetPaginationOptions()),this._availablePageSizes=l.pageSizes,!this._totalItems&&l.totalItems&&(this._totalItems=l.totalItems),this.recalculateFromToIndexes()}this._pageCount=Math.ceil(this._totalItems/this._itemsPerPage),this.sharedService.currentPagination=this.getCurrentPagination(),this.pubSubService.publish("onPaginationRefreshed",this.getFullPagination()),e&&!me(i,this.getFullPagination())&&this.pubSubService.publish("onPaginationChanged",this.getFullPagination()),a&&!me(i,this.getFullPagination())&&this.pubSubService.publish("onPaginationPresetsInitialized",this.getFullPagination());const t=this.getFullPagination();this._previousPagination={pageNumber:t.pageNumber,pageSize:t.pageSize,pageSizes:t.pageSizes,totalItems:this.totalItems}}resetPagination(u=!0){var e,a;this._isLocalGrid&&this.dataView&&((a=(e=this.sharedService)==null?void 0:e.gridOptions)!=null&&a.enablePagination)&&this.dataView.setPagingOptions({pageSize:this._itemsPerPage,pageNum:0}),this._cursorPageInfo=void 0,this.refreshPagination(!0,u)}togglePaginationVisibility(u){var e;if(this.grid&&((e=this.sharedService)!=null&&e.gridOptions)){const a=u!==void 0?u:!this.sharedService.gridOptions.enablePagination;if(a&&this.goToFirstPage(),this._isLocalGrid&&this.dataView){const i=u?this._itemsPerPage:0;this.dataView.setPagingOptions({pageSize:i,pageNum:0})}this.sharedService.gridOptions.enablePagination=a,this.pubSubService.publish("onPaginationVisibilityChanged",{visible:a})}}processOnPageChanged(u,e,a){return console.assert(!this.isCursorBased||a,"Configured for cursor based pagination - cursorArgs expected"),this.pubSubService.publish("onBeforePaginationChange",this.getFullPagination())===!1?(this.resetToPreviousPagination(),Promise.resolve(this.getFullPagination())):new Promise((i,t)=>{var r,o,s;if(this.recalculateFromToIndexes(),this._isLocalGrid&&this.dataView)this.dataView.setPagingOptions({pageSize:this._itemsPerPage,pageNum:u-1}),this.pubSubService.publish("onPaginationChanged",this.getFullPagination()),this.pubSubService.publish("onPaginationRefreshed",this.getFullPagination()),i(this.getFullPagination());else{const l=+this._itemsPerPage,E=new Date;if((r=this._backendServiceApi)!=null&&r.preProcess&&this._backendServiceApi.preProcess(),(o=this._backendServiceApi)!=null&&o.process){const d=this.isCursorBased&&a?this._backendServiceApi.service.processOnPaginationChanged(e,a):this._backendServiceApi.service.processOnPaginationChanged(e,{newPage:u,pageSize:l}),c=this._backendServiceApi.process(d);c instanceof Promise?c.then(D=>{var h;(h=this.backendUtilities)==null||h.executeBackendProcessesCallback(E,D,this._backendServiceApi,this._totalItems);const m=this.getFullPagination();this._previousPagination={pageNumber:m.pageNumber,pageSize:m.pageSize,pageSizes:m.pageSizes,totalItems:this.totalItems},i(this.getFullPagination())}).catch(D=>{var m,h,x;this.resetToPreviousPagination(),(m=this.backendUtilities)==null||m.onBackendError(D,this._backendServiceApi),(!((h=this._backendServiceApi)!=null&&h.onError)||!((x=this.backendUtilities)!=null&&x.onBackendError))&&t(c)}):(s=this.rxjs)!=null&&s.isObservable(c)&&this._subscriptions.push(c.subscribe(D=>{var h;const m=this.getFullPagination();this._previousPagination={pageNumber:m.pageNumber,pageSize:m.pageSize,pageSizes:m.pageSizes,totalItems:this.totalItems},i((h=this.backendUtilities)==null?void 0:h.executeBackendProcessesCallback(E,D,this._backendServiceApi,this._totalItems))},D=>{var m,h,x;this.resetToPreviousPagination(),(m=this.backendUtilities)==null||m.onBackendError(D,this._backendServiceApi),(!((h=this._backendServiceApi)!=null&&h.onError)||!((x=this.backendUtilities)!=null&&x.onBackendError))&&t(c)})),this.pubSubService.publish("onPaginationRefreshed",this.getFullPagination()),this.pubSubService.publish("onPaginationChanged",this.getFullPagination())}}})}recalculateFromToIndexes(){this._totalItems===0?(this._dataFrom=0,this._dataTo=1,this._pageNumber=0):(this._dataFrom=this._pageNumber>1?this._pageNumber*this._itemsPerPage-this._itemsPerPage+1:1,this._dataTo=this._totalItemsthis._totalItems&&(this._dataTo=this._totalItems)),this._pageNumber=this._totalItems>0&&this._pageNumber===0?1:this._pageNumber,this._dataTo>this._totalItems?this._dataTo=this._totalItems:this._totalItems{this._bodyElement.removeChild(l),s?s.focus():console.log("No element to restore focus to after copy?")},((i=this.addonOptions)==null?void 0:i.clipboardPasteDelay)??ws),typeof this._onCopySuccess=="function"){const E=e.length===1?e[0].toRow+1-e[0].fromRow:e.length;this._onCopySuccess(E)}return!1}}if(!this._addonOptions.readOnlyMode&&(u.key==="v"&&(u.ctrlKey||u.metaKey)&&!u.shiftKey||u.key==="Insert"&&u.shiftKey&&!u.ctrlKey)){const r=this.createTextBox("");return setTimeout(()=>this.decodeTabularData(this._grid,r),((t=this.addonOptions)==null?void 0:t.clipboardPasteDelay)??ws),!1}}}markCopySelection(u){var i;this.clearCopySelection();const e=this._grid.getColumns(),a={};for(const t of u)for(let r=t.fromRow;r<=t.toRow;r++){a[r]={};for(let o=t.fromCell;o<=t.toCell&&othis.clearCopySelection(),((i=this.addonOptions)==null?void 0:i.clearCopySelectionDelay)||Dh)}}class Yt{constructor(u,e,a){this.extensionUtility=u,this.pubSubService=e,this.sharedService=a,this._addonOptions={},this._camelPluginName="",this._gridUid="",this._menuCssPrefix="",this._menuPluginCssPrefix="",this._bindEventService=new vu,this._eventHandler=new Tu}get addonOptions(){return this._addonOptions}set addonOptions(u){this._addonOptions=u}get eventHandler(){return this._eventHandler}get grid(){return this.sharedService.slickGrid}get gridOptions(){return this.sharedService.gridOptions??{}}get gridUid(){var u;return this._gridUid||(((u=this.grid)==null?void 0:u.getUID())??"")}get gridUidSelector(){return this.gridUid?`.${this.gridUid}`:""}get menuCssClass(){return this._menuPluginCssPrefix||this._menuCssPrefix}get menuElement(){return this._menuElm||document.querySelector(`.${this.menuCssClass}${this.gridUidSelector}`)}dispose(){var u,e,a,i,t;(u=this._eventHandler)==null||u.unsubscribeAll(),this._bindEventService.unbindAll(),this.pubSubService.unsubscribeAll(),(e=this._commandTitleElm)==null||e.remove(),(a=this._optionTitleElm)==null||a.remove(),this.disposeAllMenus(),bu(this._menuElm),(i=this.menuElement)==null||i.remove(),(t=this._menuElm)==null||t.remove()}disposeAllMenus(){this.disposeSubMenus(),this._bindEventService.unbindAll("parent-menu"),document.querySelectorAll(`.${this.menuCssClass}${this.gridUidSelector}`).forEach(u=>u.remove())}disposeSubMenus(){this._bindEventService.unbindAll("sub-menu"),document.querySelectorAll(`.${this.menuCssClass}.slick-submenu${this.gridUidSelector}`).forEach(u=>u.remove())}setOptions(u){this._addonOptions={...this._addonOptions,...u}}addSubMenuTitleWhenExists(u,e){if(u!=="divider"&&(u!=null&&u.subMenuTitle)){const a=document.createElement("div");a.className="slick-menu-title",a.textContent=u.subMenuTitle;const i=u.subMenuTitleCssClass;i&&a.classList.add(..._u(i)),e.appendChild(a)}}populateCommandOrOptionItems(u,e,a,i,t,r,o){if(t&&i&&e)for(const s of i)this.populateSingleCommandOrOptionItem(u,e,a,s,t,r,o)}populateCommandOrOptionTitle(u,e,a,i){var t;if(e){const r=i>0,o=((t=this._menuElm)==null?void 0:t.querySelector(`.slick-${u}-header`))??v("div",{className:`slick-${u}-header`}),s=`${u}Title`;r||(e!=null&&e[s]?(bu(o),this[`_${u}TitleElm`]=v("span",{className:"slick-menu-title",textContent:e[s]}),o.appendChild(this[`_${u}TitleElm`]),o.classList.add("with-title")):o.classList.add("no-title"),a.appendChild(o))}}populateSingleCommandOrOptionItem(u,e,a,i,t,r,o){var l;let s=null;if(t&&i&&e){const E=(t==null?void 0:t.level)||0,d=this._camelPluginName==="headerButtons"?"":"-item",c=`${this._menuCssPrefix}${d}`;let D=!0,m=!0;if(typeof i=="object"&&(D=this.extensionUtility.runOverrideFunctionWhenExists(i.itemVisibilityOverride,t),m=this.extensionUtility.runOverrideFunctionWhenExists(i.itemUsabilityOverride,t)),!D)return null;if(typeof i=="object"&&i.itemUsabilityOverride&&(i.disabled=!m),s=v("li",{className:c,role:"menuitem"}),typeof i=="object"&&Ut(i[u])&&(s.dataset[u]=i==null?void 0:i[u]),a&&a.appendChild(s),typeof i=="object"&&i.divider||i==="divider")return s.classList.add(`${c}-divider`),s;if(i.disabled&&s.classList.add(`${c}-disabled`),(i.hidden||i.showOnHover)&&s.classList.add(`${c}-hidden`),i.cssClass&&s.classList.add(..._u(i.cssClass)),i.tooltip&&(s.title=i.tooltip),this._camelPluginName!=="headerButtons"){const x=v("div",{className:`${this._menuCssPrefix}-icon`});s.appendChild(x),i.iconCssClass?x.classList.add(..._u(i.iconCssClass)):!i.commandItems&&!i.optionItems&&(x.textContent="◦");const g=v("span",{className:`${this._menuCssPrefix}-content`,textContent:typeof i=="object"&&i.title||""},s);i.textCssClass&&g.classList.add(..._u(i.textCssClass))}const h=E>0?"sub-menu":"parent-menu";if(this._bindEventService.bind(s,"click",x=>r.call(this,x,u,i,E,t==null?void 0:t.column),void 0,h),((l=this._addonOptions)==null?void 0:l.subMenuOpenByEvent)==="mouseover"&&typeof o=="function"&&this._bindEventService.bind(s,"mouseover",x=>o.call(this,x,u,i,E),void 0,h),i.commandItems||i.optionItems){const x=document.createElement("span");x.className="sub-item-chevron",this._addonOptions.subItemChevronClass?x.classList.add(..._u(this._addonOptions.subItemChevronClass)):x.textContent="⮞",s.classList.add("slick-submenu-item"),s.appendChild(x)}}return s}}class V1 extends Yt{constructor(u,e,a){super(u,e,a),this.extensionUtility=u,this.pubSubService=e,this.sharedService=a,this._currentCell=-1,this._currentRow=-1,this._lastMenuTypeClicked="",this._subMenuParentId=""}createParentMenu(u){var a,i,t,r,o;(a=this.menuElement)==null||a.remove(),this._menuElm=void 0;const e=this.grid.getCellFromEvent(u);if(e){this._currentCell=e.cell??0,this._currentRow=e.row??0;const s=((i=this._addonOptions)==null?void 0:i.commandItems)||[],l=((t=this._addonOptions)==null?void 0:t.optionItems)||[],E={cell:this._currentCell,row:this._currentRow,grid:this.grid};if(this.closeMenu(u,E),typeof u.stopPropagation=="function"&&(this.pubSubService.publish(`on${N0(this._camelPluginName)}BeforeMenuShow`,E),typeof((r=this.addonOptions)==null?void 0:r.onBeforeMenuShow)=="function"&&this.addonOptions.onBeforeMenuShow(u,E)===!1)||(this._menuElm=this.createMenu(s,l),this._menuElm&&(this._menuElm.style.top=`${(u.pageY||0)+5}px`,this._menuElm.style.left=`${u.pageX}px`,this._menuElm.style.display="block",document.body.appendChild(this._menuElm)),this.pubSubService.publish(`on${N0(this._camelPluginName)}AfterMenuShow`,E),typeof((o=this.addonOptions)==null?void 0:o.onAfterMenuShow)=="function"&&this.addonOptions.onAfterMenuShow(u,E)===!1))return}return this._menuElm}createMenu(u,e,a=0,i){var g,F,C,A,b;const t=this.grid.getColumns()[this._currentCell],r=this.grid.getDataItem(this._currentRow),o=(i==null?void 0:i.command)||(i==null?void 0:i.option);let s=a===1&&o?String(o).replace(/\s/g,""):"";s&&(this._subMenuParentId=s),a>1&&(s=this._subMenuParentId);let l=!0,E=!0;if(this._camelPluginName==="contextMenu"){if(l=this.checkIsColumnAllowed(((g=this._addonOptions)==null?void 0:g.optionShownOverColumnIds)??[],t.id),E=this.checkIsColumnAllowed(((F=this._addonOptions)==null?void 0:F.commandShownOverColumnIds)??[],t.id),!t||(!E||!u.length)&&(!l||!e.length)){this.hideMenu();return}}else if(!t||!t.cellMenu||!u.length&&!e.length)return;const d=`${this.menuCssClass} slick-menu-level-${a} ${this.gridUid}`,c=document.body.querySelector(`.${this.menuCssClass}.slick-menu-level-${a}${this.gridUidSelector}`);if(c){if(c.dataset.subMenuParent===s)return c;this.disposeSubMenus()}const D=document.createElement("div");D.className=d,a>0&&(D.classList.add("slick-submenu"),(C=this.gridOptions)!=null&&C.darkMode&&D.classList.add("slick-dark-mode"),s&&(D.dataset.subMenuParent=s));const m=isNaN(this.addonOptions.maxHeight)?this.addonOptions.maxHeight:`${this.addonOptions.maxHeight??0}px`,h=isNaN(this.addonOptions.maxWidth)?this.addonOptions.maxWidth:`${this.addonOptions.maxWidth??0}px`;m&&(D.style.maxHeight=m),h&&(D.style.maxWidth=h),(A=this.addonOptions)!=null&&A.width&&(D.style.width=be((b=this.addonOptions)==null?void 0:b.width));const x=v("button",{ariaLabel:"Close",className:"close",type:"button",textContent:"×",dataset:{dismiss:this._menuCssPrefix}});if(!this.addonOptions.hideOptionSection&&l&&e.length>0){const B=v("div",{className:`${this._menuCssPrefix}-option-list`,role:"menu"},D);this.populateCommandOrOptionTitle("option",this.addonOptions,B,a),!this.addonOptions.hideCloseButton&&a<1&&this.populateCommandOrOptionCloseBtn("option",x,B),i&&a>0&&this.addSubMenuTitleWhenExists(i,B),this.populateCommandOrOptionItems("option",this.addonOptions,B,e,{cell:this._currentCell,row:this._currentRow,column:t,dataContext:r,grid:this.grid,level:a},this.handleMenuItemCommandClick,this.handleMenuItemMouseOver)}if(!this.addonOptions.hideCommandSection&&E&&u.length>0){const B=v("div",{className:`${this._menuCssPrefix}-command-list`,role:"menu"},D);this.populateCommandOrOptionTitle("command",this.addonOptions,B,a),!this.addonOptions.hideCloseButton&&a<1&&(!l||e.length===0||this.addonOptions.hideOptionSection)&&this.populateCommandOrOptionCloseBtn("command",x,B),i&&a>0&&this.addSubMenuTitleWhenExists(i,B),this.populateCommandOrOptionItems("command",this.addonOptions,B,u,{cell:this._currentCell,row:this._currentRow,column:t,dataContext:r,grid:this.grid,level:a},this.handleMenuItemCommandClick,this.handleMenuItemMouseOver)}return a++,D}closeMenu(u,e){var a;if(this.menuElement){if(typeof((a=this.addonOptions)==null?void 0:a.onBeforeMenuClose)=="function"&&this.addonOptions.onBeforeMenuClose(u,e)===!1)return;this.hideMenu()}}hideMenu(){var u;(u=this.menuElement)==null||u.remove(),this._menuElm=null,this.disposeSubMenus()}checkIsColumnAllowed(u,e){return(u==null?void 0:u.length)>0?u.findIndex(a=>a===e)>=0:!0}handleBodyMouseDown(u){if(this.menuElement){let e=!1;const a=u.target.closest(`.${this.menuCssClass}`);(this.menuElement.contains(u.target)||a)&&(e=!0),(this.menuElement!==u.target&&!e&&!u.defaultPrevented||u.target.className==="close"&&a)&&this.closeMenu(u,{cell:this._currentCell,row:this._currentRow,grid:this.grid})}}handleCloseButtonClicked(u){u.defaultPrevented||this.closeMenu(u,{cell:0,row:0,grid:this.grid})}handleMenuItemMouseOver(u,e,a,i=0){(a==null?void 0:a[e])!==void 0&&a!=="divider"&&!a.disabled&&!a.divider&&(a.commandItems||a.optionItems?(this.repositionSubMenu(a,e,i,u),this._lastMenuTypeClicked=e):i===0&&this.disposeSubMenus())}handleMenuItemCommandClick(u,e,a,i=0){var t;if((a==null?void 0:a[e])!==void 0&&a!=="divider"&&!a.disabled&&!a.divider&&this._currentCell!==void 0&&this._currentRow!==void 0){if(e==="option"&&!this.grid.getEditorLock().commitCurrentEdit())return;const r=this._currentCell,o=this._currentRow,s=this.grid.getColumns()[this._currentCell],l=this.grid.getDataItem(this._currentRow),E=a[e]!==void 0?a[e]:"";if(E!==void 0&&!a[`${e}Items`]){const d={cell:this._currentCell,row:this._currentRow,grid:this.grid,[e]:E,item:a,column:s,dataContext:l},c=e==="command"?"onCommand":"onOptionSelected",D=`${this._camelPluginName}:${c}`;this.pubSubService.publish(D,d),typeof((t=this._addonOptions)==null?void 0:t[c])=="function"&&this._addonOptions[c](u,d),typeof a.action=="function"&&a.action.call(this,u,d),u.defaultPrevented||this.closeMenu(u,{cell:r,row:o,grid:this.grid})}else(a.commandItems||a.optionItems)&&this.repositionSubMenu(a,e,i,u);this._lastMenuTypeClicked=e}}populateCommandOrOptionCloseBtn(u,e,a){this._bindEventService.bind(e,"click",t=>this.handleCloseButtonClicked(t),void 0,"parent-menu");const i=a.querySelector(`.slick-${u}-header`)??v("div",{className:`slick-${u}-header`});i==null||i.appendChild(e),a.appendChild(i),i.classList.add("with-close")}repositionSubMenu(u,e,a,i){(i.target.classList.contains("slick-cell")||this._lastMenuTypeClicked!==e)&&this.disposeSubMenus();const t=this.createMenu((u==null?void 0:u.commandItems)||[],(u==null?void 0:u.optionItems)||[],a+1,u);t&&(t.style.display="block",document.body.appendChild(t),this.repositionMenu(i,t))}repositionMenu(u,e){var t;const a=e==null?void 0:e.classList.contains("slick-submenu"),i=a?u.target.closest(`.${this._menuCssPrefix}-item`):u.target.closest(".slick-cell");if(e&&i){e.style.top="0px",e.style.left="0px";const r=((t=u==null?void 0:u.touches)==null?void 0:t[0])??u,o=Iu(i);let s=i&&this._camelPluginName==="cellMenu"?(o==null?void 0:o.left)??0:r.pageX,l=i&&this._camelPluginName==="cellMenu"?(o==null?void 0:o.top)??0:r.pageY;a&&this._camelPluginName==="contextMenu"&&(s=(o==null?void 0:o.left)??0,l=(o==null?void 0:o.top)??0);const E=i.offsetWidth||0,d=(e==null?void 0:e.offsetHeight)||0,c=(e==null?void 0:e.offsetWidth)||this._addonOptions.width||0,D=this.gridOptions.rowHeight||0,m=Number(this._addonOptions.autoAdjustDropOffset||0),h=Number(this._addonOptions.autoAlignSideOffset||0);if(this._addonOptions.autoAdjustDrop||this._addonOptions.dropDirection){const{bottom:x,top:g}=bi(i),F=x+m-D,C=g-m+D;(FF?"top":"bottom")==="top"||this._addonOptions.dropDirection==="top"?(e.classList.remove("dropdown"),e.classList.add("dropup"),a?l-=d-m-i.clientHeight:l-=d-m):(e.classList.remove("dropup"),e.classList.add("dropdown"),l=l+m,this._camelPluginName==="cellMenu"&&(a?l+=m:l+=D+m))}if(this._addonOptions.autoAlignSide||this._addonOptions.dropSide==="left"){const x=this.grid.getGridPosition();let g=s+Number(c);a&&(g+=i.clientWidth);const F=document.documentElement.clientWidth;(g>=x.width||g>=F?"left":"right")==="left"||!a&&this._addonOptions.dropSide==="left"?(e.classList.remove("dropright"),e.classList.add("dropleft"),this._camelPluginName==="cellMenu"&&!a?s-=Number(c)-E-h:s-=Number(c)-h):(e.classList.remove("dropleft"),e.classList.add("dropright"),a?s+=h+i.offsetWidth:s+=h)}e.style.top=`${l}px`,e.style.left=`${s}px`}}}class hh extends V1{constructor(u,e,a){super(u,e,a),this.extensionUtility=u,this.pubSubService=e,this.sharedService=a,this.pluginName="CellMenu",this._defaults={autoAdjustDrop:!0,autoAlignSide:!0,autoAdjustDropOffset:0,autoAlignSideOffset:0,hideMenuOnScroll:!0,subMenuOpenByEvent:"mouseover"},this._camelPluginName="cellMenu",this._menuCssPrefix="slick-menu",this._menuPluginCssPrefix="slick-cell-menu",this.init(a.gridOptions.cellMenu)}init(u){this._addonOptions={...this._defaults,...u},this.sortMenuItems(this.sharedService.allColumns),this._eventHandler.subscribe(this.grid.onClick,this.handleCellClick.bind(this)),this._addonOptions.hideMenuOnScroll&&this._eventHandler.subscribe(this.grid.onScroll,this.closeMenu.bind(this))}translateCellMenu(){var a;const u=(a=this.sharedService)==null?void 0:a.gridOptions,e=this.sharedService.allColumns;u!=null&&u.enableTranslate&&Array.isArray(e)&&e.forEach(i=>{if(i!=null&&i.cellMenu&&(Array.isArray(i.cellMenu.commandItems)||Array.isArray(i.cellMenu.optionItems))){const t=i.cellMenu.commandItems||[],r=i.cellMenu.optionItems||[];i.cellMenu.commandTitleKey&&(i.cellMenu.commandTitle=this.extensionUtility.translateWhenEnabledAndServiceExist(i.cellMenu.commandTitleKey,"TEXT_COMMANDS")||i.cellMenu.commandTitle),i.cellMenu.optionTitleKey&&(i.cellMenu.optionTitle=this.extensionUtility.translateWhenEnabledAndServiceExist(i.cellMenu.optionTitleKey,"TEXT_COMMANDS")||i.cellMenu.optionTitle),this.extensionUtility.translateMenuItemsFromTitleKey(t,"commandItems"),this.extensionUtility.translateMenuItemsFromTitleKey(r,"optionItems")}})}handleCellClick(u,e){this.disposeAllMenus();const a=this.grid.getCellFromEvent(u);if(a){const i=this.grid.getDataItem(a.row),t=this.grid.getColumns()[a.cell];t!=null&&t.cellMenu&&u.preventDefault(),this._addonOptions={...this._addonOptions,...t.cellMenu};const r=e||{};if(r.column=t,r.dataContext=i,r.grid=this.grid,!this.extensionUtility.runOverrideFunctionWhenExists(this._addonOptions.menuUsabilityOverride,r))return;this._menuElm=this.createParentMenu(u),this._menuElm&&(this.repositionMenu(u,this._menuElm),this._menuElm.ariaExpanded="true",this._menuElm.style.display="block",this.gridOptions.darkMode&&this._menuElm.classList.add("slick-dark-mode")),this._bindEventService.bind(document.body,"mousedown",this.handleBodyMouseDown.bind(this))}}sortMenuItems(u){u.forEach(e=>{var a,i;(a=e==null?void 0:e.cellMenu)!=null&&a.commandItems&&this.extensionUtility.sortItems(e.cellMenu.commandItems||[],"positionOrder"),(i=e==null?void 0:e.cellMenu)!=null&&i.optionItems&&this.extensionUtility.sortItems(e.cellMenu.optionItems||[],"positionOrder")})}}class xh{constructor(u,e){this.grid=u,this.pluginName="CellRangeDecorator",this._defaults={selectionCssClass:"slick-range-decorator",selectionCss:{border:"2px dashed red",zIndex:"9999"},offset:{top:-1,left:-1,height:-2,width:-2}},this._options=ca(this._defaults,e)}get addonOptions(){return this._options}get addonElement(){return this._elem}destroy(){this.hide()}init(){}hide(){var u;(u=this._elem)==null||u.remove(),this._elem=null}show(u){var i,t;this._elem||(this._elem=v("div",{className:this._options.selectionCssClass}),Object.keys(this._options.selectionCss).forEach(r=>{this._elem.style[r]=this._options.selectionCss[r]}),this._elem.style.position="absolute",(i=this.grid.getActiveCanvasNode())==null||i.appendChild(this._elem));const e=this.grid.getCellNodeBox(u.fromRow,u.fromCell),a=this.grid.getCellNodeBox(u.toRow,u.toCell);return e&&a&&((t=this._options)!=null&&t.offset)&&(this._elem.style.top=`${e.top+this._options.offset.top}px`,this._elem.style.left=`${e.left+this._options.offset.left}px`,this._elem.style.height=`${a.bottom-e.top+this._options.offset.height}px`,this._elem.style.width=`${a.right-e.left+this._options.offset.width}px`),this._elem}}class Tt{constructor(u){this.pluginName="CellRangeSelector",this.onBeforeCellRangeSelected=new R("onBeforeCellRangeSelected"),this.onCellRangeSelecting=new R("onCellRangeSelecting"),this.onCellRangeSelected=new R("onCellRangeSelected"),this._currentlySelectedRange=null,this._canvas=null,this._dragging=!1,this._gridUid="",this._columnOffset=0,this._rowOffset=0,this._isRightCanvas=!1,this._isBottomCanvas=!1,this._xDelayForNextCell=0,this._yDelayForNextCell=0,this._viewportHeight=0,this._viewportWidth=0,this._isRowMoveRegistered=!1,this._scrollLeft=0,this._scrollTop=0,this._defaults={autoScroll:!0,minIntervalToShowNextCell:30,maxIntervalToShowNextCell:600,accelerateInterval:5,selectionCss:{border:"2px dashed blue"}},this._eventHandler=new Tu,this._options=ca(this._defaults,u)}get addonOptions(){return this._options}get eventHandler(){return this._eventHandler}get gridUid(){var u;return this._gridUid||(((u=this._grid)==null?void 0:u.getUID())??"")}get gridUidSelector(){return this.gridUid?`.${this.gridUid}`:""}init(u){this._grid=u,this._decorator=this._options.cellDecorator||new xh(u,this._options),this._canvas=u.getCanvasNode(),this._gridOptions=u.getOptions(),this._gridUid=u.getUID();const e=u.getPubSubService();e&&y.addSlickEventPubSubWhenDefined(e,this),this._eventHandler.subscribe(this._grid.onDrag,this.handleDrag.bind(this)).subscribe(this._grid.onDragInit,this.handleDragInit.bind(this)).subscribe(this._grid.onDragStart,this.handleDragStart.bind(this)).subscribe(this._grid.onDragEnd,this.handleDragEnd.bind(this)).subscribe(this._grid.onScroll,this.handleScroll.bind(this))}destroy(){this.dispose()}dispose(){var u,e;(u=this._eventHandler)==null||u.unsubscribeAll(),bu(this._activeCanvas),bu(this._canvas),(e=this._decorator)==null||e.destroy(),this.stopIntervalTimer()}getCellDecorator(){return this._decorator}getCurrentRange(){return this._currentlySelectedRange}getMouseOffsetViewport(u,e){var m;const a=((m=u==null?void 0:u.touches)==null?void 0:m[0])??u,i=this._activeViewport.scrollLeft,t=this._activeViewport.scrollTop,r=i+this._viewportWidth,o=t+this._viewportHeight,s=Iu(this._activeViewport),l=(s==null?void 0:s.left)??0,E=(s==null?void 0:s.top)??0,d=l+this._viewportWidth,c=E+this._viewportHeight,D={e:u,dd:e,viewport:{left:i,top:t,right:r,bottom:o,offset:{left:l,top:E,right:d,bottom:c}},offset:{x:0,y:0},isOutsideViewport:!1};return a.pageXd&&(D.offset.x=a.pageX-d),a.pageYc&&(D.offset.y=c-a.pageY),D.isOutsideViewport=!!D.offset.x||!!D.offset.y,D}stopIntervalTimer(){this._autoScrollTimerId&&(clearInterval(this._autoScrollTimerId),this._autoScrollTimerId=void 0)}handleDrag(u,e){if(!this._dragging&&!this._gridOptions.enableRowMoveManager)return;this._gridOptions.enableRowMoveManager||u.stopImmediatePropagation();const a=u.getNativeEvent();if(this.addonOptions.autoScroll&&(this._draggingMouseOffset=this.getMouseOffsetViewport(a,e),this._draggingMouseOffset.isOutsideViewport))return this.handleDragOutsideViewport();this.stopIntervalTimer(),this.handleDragTo(a,e)}handleDragOutsideViewport(){if(this._xDelayForNextCell=this.addonOptions.maxIntervalToShowNextCell-Math.abs(this._draggingMouseOffset.offset.x)*this.addonOptions.accelerateInterval,this._yDelayForNextCell=this.addonOptions.maxIntervalToShowNextCell-Math.abs(this._draggingMouseOffset.offset.y)*this.addonOptions.accelerateInterval,!this._autoScrollTimerId){let u=0,e=0;this._autoScrollTimerId=setInterval(()=>{let a=!1,i=!1;this._draggingMouseOffset.offset.x?(u+=this.addonOptions.minIntervalToShowNextCell,a=u>=this._xDelayForNextCell):u=0,this._draggingMouseOffset.offset.y?(e+=this.addonOptions.minIntervalToShowNextCell,i=e>=this._yDelayForNextCell):e=0,(a||i)&&(a&&(u=0),i&&(e=0),this.handleDragToNewPosition(a,i))},this.addonOptions.minIntervalToShowNextCell)}}handleDragToNewPosition(u,e){let a=this._draggingMouseOffset.e.pageX,i=this._draggingMouseOffset.e.pageY;const t=this._draggingMouseOffset.offset.x,r=this._draggingMouseOffset.offset.y,o=this._draggingMouseOffset.viewport.offset;u&&t&&(t>0?a=o.right+this._moveDistanceForOneCell.x:a=o.left-this._moveDistanceForOneCell.x),e&&r&&(r>0?i=o.top-this._moveDistanceForOneCell.y:i=o.bottom+this._moveDistanceForOneCell.y),this.handleDragTo({pageX:a,pageY:i},this._draggingMouseOffset.dd)}handleDragTo(u,e){var t,r,o;const a=((t=u==null?void 0:u.touches)==null?void 0:t[0])??u,i=this._grid.getCellFromPoint(a.pageX-(((r=Iu(this._activeCanvas))==null?void 0:r.left)??0)+this._columnOffset,a.pageY-(((o=Iu(this._activeCanvas))==null?void 0:o.top)??0)+this._rowOffset);if(i!==void 0){if(this._gridOptions.frozenColumn>=0&&(!this._isRightCanvas&&i.cell>this._gridOptions.frozenColumn||this._isRightCanvas&&i.cell<=this._gridOptions.frozenColumn)||this._gridOptions.frozenRow>=0&&(!this._isBottomCanvas&&i.row>=this._gridOptions.frozenRow||this._isBottomCanvas&&i.rowl.right||s.topl.bottom)&&this._grid.scrollCellIntoView(i.row,i.cell)}}if(!this._grid.canCellBeSelected(i.row,i.cell))return;if(e!=null&&e.range){e.range.end=i;const s=new $0(e.range.start.row??0,e.range.start.cell??0,i.row,i.cell);this._decorator.show(s),this.onCellRangeSelecting.notify({range:s})}}}handleDragEnd(u,e){this._decorator.hide(),this._dragging&&(this._dragging=!1,u.stopImmediatePropagation(),this.stopIntervalTimer(),this.onCellRangeSelected.notify({range:new $0(e.range.start.row??0,e.range.start.cell??0,e.range.end.row,e.range.end.cell)}))}handleDragInit(u){var t,r;this._activeCanvas=this._grid.getActiveCanvasNode(u),this._activeViewport=this._grid.getActiveViewportNode(u);const e=this._grid.getDisplayedScrollbarDimensions();if(this._viewportWidth=this._activeViewport.offsetWidth-e.width,this._viewportHeight=this._activeViewport.offsetHeight-e.height,this._moveDistanceForOneCell={x:this._grid.getAbsoluteColumnMinWidth()/2,y:this._gridOptions.rowHeight/2},this._rowOffset=0,this._columnOffset=0,this._isBottomCanvas=this._activeCanvas.classList.contains("grid-canvas-bottom"),this._gridOptions.frozenRow>-1&&this._isBottomCanvas){const o=`${this.gridUidSelector} .grid-canvas-${this._gridOptions.frozenBottom?"bottom":"top"}`;this._rowOffset=((t=document.querySelector(o))==null?void 0:t.clientHeight)??0}this._isRightCanvas=this._activeCanvas.classList.contains("grid-canvas-right"),this._gridOptions.frozenColumn>-1&&this._isRightCanvas&&(this._columnOffset=((r=document.querySelector(`${this.gridUidSelector} .grid-canvas-left`))==null?void 0:r.clientWidth)??0);const a=this._grid.getCellFromEvent(u),i=this._grid.getActiveCell();(!this._grid.getEditorLock().isActive()||!(i&&a&&i.row===a.row&&i.cell===a.cell))&&(u.stopImmediatePropagation(),u.preventDefault())}handleDragStart(u,e){const a=this._grid.getCellFromEvent(u);if(a&&this.onBeforeCellRangeSelected.notify(a).getReturnValue()!==!1&&this._grid.canCellBeSelected(a.row,a.cell)&&(this._dragging=!0,u.stopImmediatePropagation()),!this._dragging)return;this._grid.focus();const i=Iu(this._canvas);let t=e.startX-((i==null?void 0:i.left)??0);this._gridOptions.frozenColumn>=0&&this._isRightCanvas&&(t+=this._scrollLeft);let r=e.startY-((i==null?void 0:i.top)??0);this._gridOptions.frozenRow>=0&&this._isBottomCanvas&&(r+=this._scrollTop);const o=this._grid.getCellFromPoint(t,r);return e.range={start:o,end:{}},this._currentlySelectedRange=e.range,this._decorator.show(new $0(o.row,o.cell))}handleScroll(u,e){this._scrollTop=e.scrollTop,this._scrollLeft=e.scrollLeft}}class $1{constructor(u){this.onSelectedRangesChanged=new R("onSelectedRangesChanged"),this.pluginName="CellSelectionModel",this._cachedPageRowCount=0,this._prevKeyDown="",this._ranges=[],this._defaults={selectActiveCell:!0},this._eventHandler=new Tu,u===void 0||u.cellRangeSelector===void 0?this._selector=new Tt({selectionCss:{border:"2px solid black"}}):this._selector=u.cellRangeSelector,this._addonOptions=u}get addonOptions(){return this._addonOptions}get cellRangeSelector(){return this._selector}get eventHandler(){return this._eventHandler}init(u){this._grid=u,u.hasDataView()&&(this._dataView=u.getData()),this._addonOptions={...this._defaults,...this._addonOptions};const e=u.getPubSubService();e&&this.onSelectedRangesChanged.setPubSubService(e),this._eventHandler.subscribe(this._grid.onActiveCellChanged,this.handleActiveCellChange.bind(this)).subscribe(this._grid.onKeyDown,this.handleKeyDown.bind(this)).subscribe(this._selector.onBeforeCellRangeSelected,this.handleBeforeCellRangeSelected.bind(this)).subscribe(this._selector.onCellRangeSelected,this.handleCellRangeSelected.bind(this)),u.registerPlugin(this._selector)}destroy(){this.dispose()}dispose(){var u,e;this._selector&&(this._selector.onBeforeCellRangeSelected.unsubscribe(this.handleBeforeCellRangeSelected.bind(this)),this._selector.onCellRangeSelected.unsubscribe(this.handleCellRangeSelected.bind(this))),this._eventHandler.unsubscribeAll(),(u=this._grid)==null||u.unregisterPlugin(this._selector),(e=this._selector)==null||e.dispose()}getSelectedRanges(){return this._ranges}rangesAreEqual(u,e){let a=u.length!==e.length;if(!a){for(let i=0;ie===u)}handleKeyDown(u){var o;let e,a;const i=this._grid.getColumns().length,t=this._grid.getActiveCell();let r=0;if(this._dataView&&"getPagingInfo"in this._dataView?r=((o=this._dataView)==null?void 0:o.getPagingInfo().pageSize)||this._dataView.getLength():r=this._grid.getDataLength(),t&&(u.shiftKey||u.ctrlKey)&&!u.altKey&&this.isKeyAllowed(u.key)&&(e=this.getSelectedRanges().slice(),e.length||e.push(new $0(t.row,t.cell)),a=e.pop(),typeof(a==null?void 0:a.contains)=="function")){a.contains(t.row,t.cell)||(a=new $0(t.row,t.cell));let s=a.toRow-a.fromRow,l=a.toCell-a.fromCell;const E=t.row===a.fromRow?1:-1,d=t.cell===a.fromCell?1:-1,c=u.key.startsWith("Arrow");let D,m=0;c&&!u.ctrlKey?(u.key==="ArrowLeft"?l-=d:u.key==="ArrowRight"?l+=d:u.key==="ArrowUp"?s-=E:u.key==="ArrowDown"&&(s+=E),m=t.row+E*s):(this._cachedPageRowCount<1&&(this._cachedPageRowCount=this._grid.getViewportRowCount()),this._prevSelectedRow===void 0&&(this._prevSelectedRow=t.row),u.shiftKey&&!u.ctrlKey&&u.key==="Home"?(D=0,m=t.row):u.shiftKey&&!u.ctrlKey&&u.key==="End"?(D=i-1,m=t.row):u.ctrlKey&&u.shiftKey&&u.key==="Home"?(D=0,m=0):u.ctrlKey&&u.shiftKey&&u.key==="End"?(D=i-1,m=r-1):u.key==="PageUp"?(this._prevSelectedRow>=0&&(m=this._prevSelectedRow-this._cachedPageRowCount),m<0&&(m=0)):u.key==="PageDown"&&(this._prevSelectedRow<=r-1&&(m=this._prevSelectedRow+this._cachedPageRowCount),m>r-1&&(m=r-1)),this._prevSelectedRow=m),D??(D=t.cell+d*l);const h=new $0(t.row,t.cell,m,D);if(this.removeInvalidRanges([h]).length){e.push(h);const x=E>0?h.toRow:h.fromRow,g=d>0?h.toCell:h.fromCell;c?(this._grid.scrollRowIntoView(x),this._grid.scrollCellIntoView(x,g,!1)):(this._grid.scrollRowIntoView(m),this._grid.scrollCellIntoView(m,g,!1))}else e.push(a);this.setSelectedRanges(e),u.preventDefault(),u.stopPropagation(),this._prevKeyDown=u.key}}}class Qt{constructor(u){this.pluginName="RowSelectionModel",this.onSelectedRangesChanged=new R("onSelectedRangesChanged"),this._inHandler=!1,this._ranges=[],this._defaults={autoScrollWhenDrag:!0,cellRangeSelector:void 0,dragToSelect:!1,selectActiveRow:!0},this._eventHandler=new Tu,this._options={...this._defaults,...u}}get addonOptions(){return this._options}get eventHandler(){return this._eventHandler}get gridOptions(){var u;return(u=this._grid)==null?void 0:u.getOptions()}init(u){this._grid=u,this._options={...this._defaults,...this._options},this._selector=this.addonOptions.cellRangeSelector;const e=u.getPubSubService();e&&this.onSelectedRangesChanged.setPubSubService(e),!this._selector&&this._options.dragToSelect&&(this._selector=new Tt({selectionCss:{border:"none"},autoScroll:this._options.autoScrollWhenDrag}),this.addonOptions.cellRangeSelector=this._selector),this._eventHandler.subscribe(this._grid.onActiveCellChanged,this.handleActiveCellChange.bind(this)).subscribe(this._grid.onClick,this.handleClick.bind(this)).subscribe(this._grid.onKeyDown,this.handleKeyDown.bind(this)),this._selector&&(this._grid.registerPlugin(this._selector),this._selector.onCellRangeSelecting.subscribe(this.handleCellRangeSelected.bind(this)),this._selector.onCellRangeSelected.subscribe(this.handleCellRangeSelected.bind(this)),this._selector.onBeforeCellRangeSelected.subscribe(this.handleBeforeCellRangeSelected.bind(this)))}destroy(){this.dispose()}dispose(){this._eventHandler.unsubscribeAll(),this.disposeSelector()}disposeSelector(){var u,e;this._selector&&(this._selector.onCellRangeSelecting.unsubscribe(this.handleCellRangeSelected.bind(this)),this._selector.onCellRangeSelected.unsubscribe(this.handleCellRangeSelected.bind(this)),this._selector.onBeforeCellRangeSelected.unsubscribe(this.handleBeforeCellRangeSelected.bind(this)),this._grid.unregisterPlugin(this._selector),(u=this._selector)==null||u.destroy(),(e=this._selector)==null||e.dispose())}getCellRangeSelector(){return this._selector}getSelectedRanges(){return this._ranges}getSelectedRows(){return this.rangesToRows(this._ranges)}refreshSelections(){this.setSelectedRows(this.getSelectedRows())}setSelectedRows(u){this.setSelectedRanges(this.rowsToRanges(u),"SlickRowSelectionModel.setSelectedRows")}setSelectedRanges(u,e="SlickRowSelectionModel.setSelectedRanges"){if((!this._ranges||this._ranges.length===0)&&(!u||u.length===0))return;this._ranges=u;const a=new Pu(new CustomEvent("click",{detail:{caller:e}}),this._ranges);this.onSelectedRangesChanged.notify(this._ranges,a)}getRowsRange(u,e){let a;const i=[];for(a=u;a<=e;a++)i.push(a);for(a=e;ar!==e.row),this._grid.setActiveCell(e.row,e.cell);else if(a.length&&u.shiftKey){const r=a.pop(),o=Math.min(e.row,r),s=Math.max(e.row,r);a=[];for(let l=o;l<=s;l++)l!==r&&a.push(l);a.push(r),this._grid.setActiveCell(e.row,e.cell)}const t=this.rowsToRanges(a);return this.setSelectedRanges(t),u.stopImmediatePropagation(),!0}handleKeyDown(u){const e=this._grid.getActiveCell();if(this.gridOptions.multiSelect&&e&&u.shiftKey&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&(u.key==="ArrowUp"||u.key==="ArrowDown")){let a=this.getSelectedRows();a.sort((o,s)=>o-s),a.length||(a=[e.row]);let i,t=a[0],r=a[a.length-1];if(u.key==="ArrowDown"?i=e.row=0&&ie.push(new $0(i,0,i,a))),e}}const Ms="mdi-icon-check",Ts="mdi-icon-uncheck";class _s{constructor(u,e){this.pubSubService=u,this.pluginName="CheckboxSelectColumn",this._defaults={columnId:"_checkbox_selector",cssClass:null,field:"_checkbox_selector",hideSelectAllCheckbox:!1,name:"",toolTip:"Select/Deselect All",width:30,reorderable:!1,applySelectOnAllPages:!0,hideInColumnTitleRow:!1,hideInFilterHeaderRow:!0},this._addonOptions=this._defaults,this._checkboxColumnCellIndex=null,this._isSelectAllChecked=!1,this._isUsingDataView=!1,this._selectedRowsLookup={},this._selectAll_UID=this.createUID(),this._bindEventService=new vu,this._eventHandler=new Tu,this._addonOptions={...this._defaults,...e}}get addonOptions(){return this._addonOptions}get headerRowNode(){return this._headerRowNode}get gridOptions(){var u;return((u=this._grid)==null?void 0:u.getOptions())??{}}get selectAllUid(){return this._selectAll_UID}set selectedRowsLookup(u){this._selectedRowsLookup=u}init(u){this._grid=u,this._isUsingDataView=!Array.isArray(u.getData()),this._isUsingDataView&&(this._dataView=u.getData()),this.gridOptions.backendServiceApi&&(this._addonOptions.applySelectOnAllPages=!1),this._eventHandler.subscribe(u.onSelectedRowsChanged,this.handleSelectedRowsChanged.bind(this)).subscribe(u.onClick,this.handleClick.bind(this)).subscribe(u.onKeyDown,this.handleKeyDown.bind(this)),this._isUsingDataView&&this._dataView&&(this._eventHandler.subscribe(u.onAfterSetColumns,this.handleDataViewSelectedIdsChanged.bind(this)),this._addonOptions.applySelectOnAllPages&&this._eventHandler.subscribe(this._dataView.onSelectedRowIdsChanged,this.handleDataViewSelectedIdsChanged.bind(this)).subscribe(this._dataView.onPagingInfoChanged,this.handleDataViewSelectedIdsChanged.bind(this))),this._addonOptions.hideInFilterHeaderRow||this.addCheckboxToFilterHeaderRow(u),this._addonOptions.hideInColumnTitleRow||this._eventHandler.subscribe(this._grid.onHeaderClick,this.handleHeaderClick.bind(this)),(!this._rowSelectionModel||!this._grid.getSelectionModel())&&(this._rowSelectionModel=new Qt(this.gridOptions.rowSelectionOptions),this._grid.setSelectionModel(this._rowSelectionModel)),this.gridOptions.preselectedRows&&this._rowSelectionModel&&this._grid.getSelectionModel()&&setTimeout(()=>this.selectRows(this.gridOptions.preselectedRows||[])),typeof this._addonOptions.selectableOverride=="function"&&this.selectableOverride(this._addonOptions.selectableOverride)}dispose(){this._bindEventService.unbindAll(),this._eventHandler.unsubscribeAll()}create(u,e){var a;if(this._addonOptions={...this._defaults,...e.checkboxSelector},Array.isArray(u)&&e){const i=this.getColumnDefinition();if(!u.some(t=>t.id===i.id)){const t=((a=e==null?void 0:e.checkboxSelector)==null?void 0:a.columnIndexPosition)??0;t>0?u.splice(t,0,i):u.unshift(i),this.pubSubService.publish("onPluginColumnsChanged",{columns:u,pluginName:this.pluginName})}}return this}getOptions(){return this._addonOptions}setOptions(u){var e;if(this._addonOptions={...this._addonOptions,...u},this._addonOptions.hideSelectAllCheckbox)this.hideSelectAllFromColumnHeaderTitleRow(),this.hideSelectAllFromColumnHeaderFilterRow();else if(this._addonOptions.hideInColumnTitleRow?(this.hideSelectAllFromColumnHeaderTitleRow(),this._addonOptions.name&&this._grid.updateColumnHeader(this._addonOptions.columnId||"",this._addonOptions.name,"")):(this.renderSelectAllCheckbox(this._isSelectAllChecked),this._eventHandler.subscribe(this._grid.onHeaderClick,this.handleHeaderClick.bind(this))),this._addonOptions.hideInFilterHeaderRow)this.hideSelectAllFromColumnHeaderFilterRow();else{const a=(e=this.headerRowNode)==null?void 0:e.querySelector("#filter-checkbox-selectall-container");if(a){a.style.display="flex",a.ariaChecked=String(this._isSelectAllChecked);const i=a.querySelector('input[type="checkbox"]');i&&(i.ariaChecked=String(this._isSelectAllChecked),i.checked=this._isSelectAllChecked)}}}deSelectRows(u){const e=[];for(const a of u)this._selectedRowsLookup[a]&&(e[e.length]=a);this._grid.setSelectedRows(this._grid.getSelectedRows().filter(a=>e.indexOf(a)<0),"SlickCheckboxSelectColumn.deSelectRows")}selectRows(u){var i;const e=[];for(const t of u)this._selectedRowsLookup[t]&&(e[e.length]=t);const a=(i=this._grid.getSelectedRows())==null?void 0:i.concat(e);this._grid.setSelectedRows(a)}createCheckboxElement(u,e=!1){const a=new DocumentFragment,i=v("label",{className:"checkbox-selector-label",htmlFor:u}),t=v("div",{className:"icon-checkbox-container"});return t.appendChild(v("input",{id:u,type:"checkbox",checked:e,ariaChecked:String(e)})),t.appendChild(v("div",{className:`mdi ${e?Ms:Ts}`})),i.appendChild(t),a.appendChild(i),a}getColumnDefinition(){var e;const u=String(((e=this._addonOptions)==null?void 0:e.columnId)??this._defaults.columnId);return{id:u,name:this._addonOptions.hideSelectAllCheckbox||this._addonOptions.hideInColumnTitleRow?this._addonOptions.name||"":this.createCheckboxElement(`header-selector${this._selectAll_UID}`),toolTip:this._addonOptions.hideSelectAllCheckbox||this._addonOptions.hideInColumnTitleRow?"":this._addonOptions.toolTip,field:u,cssClass:this._addonOptions.cssClass,excludeFromExport:!0,excludeFromColumnPicker:!0,excludeFromGridMenu:!0,excludeFromQuery:!0,excludeFromHeaderMenu:!0,hideSelectAllCheckbox:this._addonOptions.hideSelectAllCheckbox,resizable:!1,reorderable:this._addonOptions.reorderable,sortable:!1,width:this._addonOptions.width||30,maxWidth:this._addonOptions.width||30,formatter:this.checkboxSelectionFormatter.bind(this)}}hideSelectAllFromColumnHeaderTitleRow(){this._grid.updateColumnHeader(this._addonOptions.columnId||"",this._addonOptions.name||"","")}hideSelectAllFromColumnHeaderFilterRow(){var e;const u=(e=this.headerRowNode)==null?void 0:e.querySelector("#filter-checkbox-selectall-container");u&&(u.style.display="none")}toggleRowSelection(u){this.toggleRowSelectionWithEvent(null,u)}toggleRowSelectionWithEvent(u,e){const a=this._grid.getDataItem(e);if(!this.checkSelectableOverride(e,a,this._grid))return;const i=this._grid.getSelectedRows();typeof this._addonOptions.onRowToggleStart=="function"&&this._addonOptions.onRowToggleStart(u,{row:e,previousSelectedRows:i});const t=this._selectedRowsLookup[e]?this._grid.getSelectedRows().filter(r=>r!==e):this._grid.getSelectedRows().concat(e);this._grid.setSelectedRows(t,"click.toggle"),this._grid.setActiveCell(e,this.getCheckboxColumnCellIndex()),this._addonOptions.onRowToggleEnd&&this._addonOptions.onRowToggleEnd(u,{row:e,previousSelectedRows:i})}selectableOverride(u){this._selectableOverride=u}addCheckboxToFilterHeaderRow(u){this._eventHandler.subscribe(u.onHeaderRowCellRendered,(e,a)=>{if(a.column.field===(this._addonOptions.field||"_checkbox_selector")){bu(a.node);const i=`header-filter-selector${this._selectAll_UID}`,t=v("label",{id:"filter-checkbox-selectall-container",htmlFor:i}),r=v("div",{className:"icon-checkbox-container"});r.appendChild(v("input",{id:i,type:"checkbox",ariaChecked:"false"})),r.appendChild(v("div",{className:"mdi mdi-icon-uncheck"})),t.appendChild(r),a.node.appendChild(t),this._headerRowNode=a.node,this._headerRowNode.classList.add("checkbox-header"),this._bindEventService.bind(t,"click",o=>this.handleHeaderClick(o,a))}})}checkboxSelectionFormatter(u,e,a,i,t,r){if(t&&this.checkSelectableOverride(u,t,r)){const o=this.createUID()+u;return this.createCheckboxElement(`selector${o}`,!!this._selectedRowsLookup[u])}return null}checkSelectableOverride(u,e,a){return typeof this._selectableOverride=="function"?this._selectableOverride(u,e,a):!0}createUID(){return Math.round(1e7*Math.random())}getCheckboxColumnCellIndex(){if(this._checkboxColumnCellIndex===null){this._checkboxColumnCellIndex=0;const u=this._grid.getColumns();for(let e=0;e0)for(let r=0;rd[s]===l)>=0&&!this.checkSelectableOverride(r,o,this._grid)&&a++}if(this._isSelectAllChecked=u.length+a>=e.length,!this._addonOptions.hideInColumnTitleRow&&!this._addonOptions.hideSelectAllCheckbox&&this.renderSelectAllCheckbox(this._isSelectAllChecked),!this._addonOptions.hideInFilterHeaderRow){const r=(i=this.headerRowNode)==null?void 0:i.querySelector(`#header-filter-selector${this._selectAll_UID}`),o=(t=this.headerRowNode)==null?void 0:t.querySelector(".icon-checkbox-container .mdi");r&&(r.ariaChecked=String(this._isSelectAllChecked),r.checked=this._isSelectAllChecked),o&&(o.className=`mdi ${this._isSelectAllChecked?Ms:Ts}`)}}handleClick(u,e){if(this._grid.getColumns()[e.cell].id===this._addonOptions.columnId&&u.target.type==="checkbox"){if(u.target.ariaChecked=String(u.target.checked),this._grid.getEditorLock().isActive()&&!this._grid.getEditorLock().commitCurrentEdit()){u.preventDefault(),u.stopImmediatePropagation();return}this.toggleRowSelectionWithEvent(u,e.row),u.stopPropagation(),u.stopImmediatePropagation()}}handleHeaderClick(u,e){if(e.column.id===this._addonOptions.columnId&&u.target.type==="checkbox"){if(u.target.ariaChecked=String(u.target.checked),this._grid.getEditorLock().isActive()&&!this._grid.getEditorLock().commitCurrentEdit()){u.preventDefault(),u.stopImmediatePropagation();return}let a=u.target.checked;const i=a?"click.selectAll":"click.unselectAll",t=this._grid.getSelectedRows();this._addonOptions.onSelectAllToggleStart&&this._addonOptions.onSelectAllToggleStart(u,{previousSelectedRows:t,caller:i});let r=[];if(a){const o=[];for(let s=0;s{l!==void 0&&this._grid.invalidateRow(+l)}),this._selectedRowsLookup=e,this._grid.render(),this._isSelectAllChecked=((u==null?void 0:u.length)??0)+r>=this._grid.getDataLength(),(!this._isUsingDataView||!this._addonOptions.applySelectOnAllPages)&&(!this._addonOptions.hideInColumnTitleRow&&!this._addonOptions.hideSelectAllCheckbox&&this.renderSelectAllCheckbox(this._isSelectAllChecked),!this._addonOptions.hideInFilterHeaderRow)){const l=(s=this.headerRowNode)==null?void 0:s.querySelector(`#header-filter-selector${this._selectAll_UID}`);l&&(l.ariaChecked=String(this._isSelectAllChecked),l.checked=this._isSelectAllChecked)}if(o.length>0){for(const l of o){const E=u.indexOf(l);u.splice(E,1)}this._grid.setSelectedRows(u,"click.toggle")}}renderSelectAllCheckbox(u){const e=this._grid.updateColumnHeader(this._addonOptions.columnId||"",this.createCheckboxElement(`header-selector${this._selectAll_UID}`,!!u),this._addonOptions.toolTip);e==null||e.classList.add("header-checkbox-selectall")}}class J1 extends Yt{constructor(u,e,a,i,t){var r;super(u,a,i),this.extensionUtility=u,this.filterService=e,this.pubSubService=a,this.sharedService=i,this.sortService=t,this.onAfterMenuShow=new R("onAfterMenuShow"),this.onBeforeMenuShow=new R("onBeforeMenuShow"),this.onMenuClose=new R("onMenuClose"),this.onCommand=new R("onCommand"),this.onColumnsChanged=new R("onColumnsChanged"),this._areVisibleColumnDifferent=!1,this._columns=[],this._columnCheckboxes=[],this._commandMenuElm=null,this._headerElm=null,this._isMenuOpen=!1,this._subMenuParentId="",this._defaults={dropSide:"left",showButton:!0,hideForceFitButton:!1,hideSyncResizeButton:!1,forceFitTitle:"Force fit columns",marginBottom:15,menuWidth:18,minHeight:250,contentMinWidth:0,resizeOnShowHeaderRow:!1,syncResizeTitle:"Synchronous resize",subMenuOpenByEvent:"mouseover",headerColumnValueExtractor:o=>E0(o.name||"","innerHTML")},this._menuCssPrefix="slick-menu",this._menuPluginCssPrefix="slick-grid-menu",this._camelPluginName="gridMenu",this._columns=this.sharedService.allColumns??[],this._gridUid=((r=this.grid)==null?void 0:r.getUID())??"",this.initEventHandlers(),this.init()}get addonOptions(){return this._addonOptions||{}}get columns(){return this._columns}set columns(u){this._columns=u}get gridOptions(){var u;return((u=this.grid)==null?void 0:u.getOptions())||{}}get gridUidSelector(){return this.gridUid?`.${this.gridUid}`:""}initEventHandlers(){this._eventHandler.subscribe(this.grid.onColumnsReordered,_t.bind(this)),this._eventHandler.subscribe(this.grid.onClick,u=>this.hideMenu(u)),this._eventHandler.subscribe(this.grid.onBeforeDestroy,this.dispose.bind(this)),this._eventHandler.subscribe(this.grid.onSetOptions,(u,e)=>{if(e&&e.optionsBefore&&e.optionsAfter){const a=e.optionsBefore.frozenColumn>=0&&e.optionsAfter.frozenColumn===-1,i=e.optionsBefore.frozenColumn===-1&&e.optionsAfter.frozenColumn>=0;(a||i)&&this.recreateGridMenu()}})}init(){this._gridUid=this.grid.getUID()??"",y.addSlickEventPubSubWhenDefined(this.pubSubService,this),this._userOriginalGridMenu={...this.sharedService.gridOptions.gridMenu},this._addonOptions={...this._defaults,...this.getDefaultGridMenuOptions(),...this.sharedService.gridOptions.gridMenu},this.sharedService.gridOptions.gridMenu=this._addonOptions;const u=this._userOriginalGridMenu.commandItems,e=this._userOriginalGridMenu&&Array.isArray(u)?u:[];this._addonOptions.commandItems=[...e,...this.addGridMenuCustomCommands(e)],this.extensionUtility.translateMenuItemsFromTitleKey(this._addonOptions.commandItems||[],"commandItems"),this.extensionUtility.sortItems(this._addonOptions.commandItems,"positionOrder"),this.createGridMenu()}dispose(){this.deleteMenu(),super.dispose()}deleteMenu(){var u,e;this._bindEventService.unbindAll(),(u=this._menuElm)==null||u.remove(),this._menuElm=null,(e=this._gridMenuButtonElm)==null||e.remove(),this._headerElm&&(this._headerElm.style.width="100%")}createColumnPickerContainer(){this._menuElm&&(Z1.call(this,this._menuElm),this._listElm=v("div",{className:"slick-column-picker-list",role:"menu"}),this._bindEventService.bind(this._menuElm,"click",Y1.bind(this),void 0,"parent-menu"))}createGridMenu(){var t,r;const u=this._gridUid?`.${this._gridUid}`:"",e=((t=this._addonOptions)==null?void 0:t.menuWidth)||this._defaults.menuWidth,a=this.gridOptions.hasOwnProperty("frozenColumn")&&this.gridOptions.frozenColumn>=0?"right":"left",i=this.grid.getContainerNode();if(this._headerElm=i.querySelector(`.slick-header-${a}`),this._headerElm&&this._addonOptions){if(this._headerElm.style.width=`calc(100% - ${e}px)`,(this._addonOptions.resizeOnShowHeaderRow??this._defaults.resizeOnShowHeaderRow)&&this.gridOptions.showHeaderRow){const l=i.querySelector(`${u} .slick-headerrow`);l&&(l.style.width=`calc(100% - ${e}px)`)}if(this._addonOptions.showButton??this._defaults.showButton){this._gridMenuButtonElm=v("button",{className:"slick-grid-menu-button",ariaLabel:"Grid Menu"}),(r=this._addonOptions)!=null&&r.iconCssClass&&this._gridMenuButtonElm.classList.add(..._u(this._addonOptions.iconCssClass));const l=this._addonOptions.iconButtonContainer==="preheader"?"firstChild":"lastChild";this._headerElm.parentElement.insertBefore(this._gridMenuButtonElm,this._headerElm.parentElement[l]),this._bindEventService.bind(this._gridMenuButtonElm,"click",this.showGridMenu.bind(this))}this.sharedService.gridOptions.gridMenu={...this._defaults,...this._addonOptions},this.translateTitleLabels(this._addonOptions),this.translateTitleLabels(this.sharedService.gridOptions.gridMenu),this._bindEventService.bind(document.body,"mousedown",this.handleBodyMouseDown.bind(this)),this._bindEventService.bind(document.body,"beforeunload",this.dispose.bind(this))}}createCommandMenu(u,e=0,a){const i=a==null?void 0:a.command;let t=e===1&&i?i.replace(/\s/g,""):"";t&&(this._subMenuParentId=t),e>1&&(t=this._subMenuParentId);const r=`${this.menuCssClass} slick-menu-level-${e} ${this._gridUid}`,o=document.body.querySelector(`.${this.menuCssClass}.slick-menu-level-${e}${this.gridUidSelector}`);if(o){if(o.dataset.subMenuParent===t)return o;this.disposeSubMenus()}const s=v("div",{role:"menu",className:r,ariaLabel:e>1?"SubMenu":"Grid Menu"});e>0&&(s.classList.add("slick-submenu"),t&&(s.dataset.subMenuParent=t));const l={grid:this.grid,menu:this._menuElm,columns:this.columns,allColumns:this.getAllColumns(),visibleColumns:this.getVisibleColumns(),level:e};return this._commandMenuElm=this.recreateCommandList(u,s,l,a),e++,s}getAllColumns(){return this._columns}getVisibleColumns(){return this.grid.getColumns()}hideMenu(u){var a,i,t;const e={grid:this.grid,menu:this._menuElm,allColumns:this.columns,visibleColumns:this.getVisibleColumns()};if(this.pubSubService.publish("onGridMenuMenuClose",e),!(typeof((a=this._addonOptions)==null?void 0:a.onMenuClose)=="function"&&this._addonOptions.onMenuClose(u,e)===!1||this.onMenuClose.notify(e,null,this).getReturnValue()===!1)){if(this._isMenuOpen=!1,typeof((i=this.grid)==null?void 0:i.autosizeColumns)=="function"){const r=this.grid.getUID()||"";this._areVisibleColumnDifferent&&r&&document.querySelector(`.${r}`)!==null&&(this.gridOptions.enableAutoSizeColumns&&this.grid.autosizeColumns(),this._areVisibleColumnDifferent=!1)}this.disposeSubMenus(),(t=this._menuElm)==null||t.remove(),this._menuElm=null}}recreateGridMenu(){this.deleteMenu(),this.init()}repositionMenu(u,e,a,i){var s,l;const t=((s=u==null?void 0:u.touches)==null?void 0:s[0])??u,r=e.classList.contains("slick-submenu"),o=r?u.target.closest(".slick-menu-item"):t.target;if(o){const E=a||this._gridMenuButtonElm,d=Iu(a),c=Iu(o),D=i??this._addonOptions,m=getComputedStyle(E),h=parseInt((m==null?void 0:m.width)??((l=this._defaults)==null?void 0:l.menuWidth),10),x=(e==null?void 0:e.offsetWidth)??0,g=(D==null?void 0:D.contentMinWidth)??this._defaults.contentMinWidth??0,F=(g>x?g:x)||0,C=(d==null?void 0:d.top)??0,A=(d==null?void 0:d.right)??0;let b,B;if(r?(B=(c==null?void 0:c.top)??0,b=(c==null?void 0:c.left)??0):(B=C+E.offsetHeight,b=(D==null?void 0:D.dropSide)==="right"?A-h:A-F),r){const N=(e==null?void 0:e.clientHeight)||0,{bottom:G,top:L}=bi(o);(GG?"top":"bottom")==="top"?(e.classList.remove("dropdown"),e.classList.add("dropup"),B-=N-o.clientHeight):(e.classList.remove("dropup"),e.classList.add("dropdown"))}const S=this.grid.getGridPosition();let z=b+Number(x);r&&(z+=o.clientWidth);const M=document.documentElement.clientWidth;(z>=S.width||z>=M?"left":"right")==="left"||!r&&(D==null?void 0:D.dropSide)==="left"?(e.classList.remove("dropright"),e.classList.add("dropleft"),r&&(b-=Number(x))):(e.classList.remove("dropleft"),e.classList.add("dropright"),r&&(b+=o.offsetWidth)),e.style.top=`${B}px`,e.style.left=`${b}px`,g>0&&(e.style.minWidth=`${g}px`),e.style.opacity="1",e.style.display="block"}}openGridMenu(){const u=new MouseEvent("click",{bubbles:!0,cancelable:!0,composed:!1});Object.defineProperty(u,"target",{writable:!0,configurable:!0,value:v("button",{className:"slick-grid-menu-button"})}),this.showGridMenu(u)}showGridMenu(u,e){var i,t,r;const a=((i=u==null?void 0:u.touches)==null?void 0:i[0])??u;if(u.preventDefault(),bu(this._menuElm),(t=this._menuElm)==null||t.remove(),this._addonOptions){const o={grid:this.grid,menu:this._menuElm,columns:this.columns,allColumns:this.getAllColumns(),visibleColumns:this.getVisibleColumns()},s={...this._addonOptions,...e};if(s&&!this.extensionUtility.runOverrideFunctionWhenExists(s.menuUsabilityOverride,o)||typeof u.stopPropagation=="function"&&(this.pubSubService.publish("onGridMenuBeforeMenuShow",o),typeof(s==null?void 0:s.onBeforeMenuShow)=="function"&&s.onBeforeMenuShow(u,o)===!1||this.onBeforeMenuShow.notify(o,null,this).getReturnValue()===!1))return;this._menuElm=this.createCommandMenu(((r=this._addonOptions)==null?void 0:r.commandItems)??[]),this.createColumnPickerContainer(),_t.call(this),this._columnCheckboxes=[],Q1.call(this,s),document.body.appendChild(this._menuElm),this.gridOptions.darkMode&&this._menuElm.classList.add("slick-dark-mode"),this._menuElm.style.opacity="0";const l=((s==null?void 0:s.marginBottom)!==void 0?s.marginBottom:this._defaults.marginBottom)||0;this._menuElm.style.minHeight=be(s==null?void 0:s.minHeight,""),(s==null?void 0:s.height)!==void 0?this._menuElm.style.height=be(s.height,""):this._menuElm.style.maxHeight=be(s==null?void 0:s.maxHeight,`${window.innerHeight-a.clientY-l}px`);let E=u.target.nodeName==="BUTTON"?u.target:u.target.querySelector("button");E||(E=u.target.parentElement),this._menuElm.ariaExpanded="true",this._menuElm.appendChild(this._listElm),this.repositionMenu(u,this._menuElm,E,s),this._isMenuOpen=!0,this.pubSubService.publish("onGridMenuAfterMenuShow",o),typeof(s==null?void 0:s.onAfterMenuShow)=="function"&&s.onAfterMenuShow(u,o),this.onAfterMenuShow.notify(o,null,this)}}translateGridMenu(){var u;if(this.sharedService.gridOptions.gridMenu){this.sharedService.gridOptions.gridMenu.commandItems=[],this.sharedService.gridOptions.gridMenu.commandTitle="",this.sharedService.gridOptions.gridMenu.columnTitle="",this.sharedService.gridOptions.gridMenu.forceFitTitle="",this.sharedService.gridOptions.gridMenu.syncResizeTitle="";const e=this._userOriginalGridMenu&&Array.isArray(this._userOriginalGridMenu.commandItems)?this._userOriginalGridMenu.commandItems:[];this.sharedService.gridOptions.gridMenu.commandItems=[...e,...this.addGridMenuCustomCommands(e)],this.extensionUtility.translateMenuItemsFromTitleKey(((u=this._addonOptions)==null?void 0:u.commandItems)||[],"commandItems"),this.extensionUtility.sortItems(this.sharedService.gridOptions.gridMenu.commandItems,"positionOrder"),this.translateTitleLabels(this.sharedService.gridOptions.gridMenu),this.translateTitleLabels(this._addonOptions),this.extensionUtility.translateItems(this._columns,"nameKey","name")}}translateTitleLabels(u){u&&(u.commandTitle=this.extensionUtility.getPickerTitleOutputString("commandTitle","gridMenu"),u.columnTitle=this.extensionUtility.getPickerTitleOutputString("columnTitle","gridMenu"),u.forceFitTitle=this.extensionUtility.getPickerTitleOutputString("forceFitTitle","gridMenu"),u.syncResizeTitle=this.extensionUtility.getPickerTitleOutputString("syncResizeTitle","gridMenu"))}addGridMenuCustomCommands(u){var o,s;const e=this.gridOptions.backendServiceApi||null,a=[],i=this.gridOptions,t=X0(i),r=(o=this._addonOptions)==null?void 0:o.commandLabels;if(this._addonOptions&&this.gridOptions){if(!this._addonOptions.hideClearFrozenColumnsCommand){const E="clear-pinning";u.some(d=>d!=="divider"&&d.hasOwnProperty("command")&&d.command===E)||a.push({iconCssClass:this._addonOptions.iconClearFrozenColumnsCommand||"mdi mdi-pin-off-outline",titleKey:`${t}${(r==null?void 0:r.clearFrozenColumnsCommandKey)??"CLEAR_PINNING"}`,disabled:!1,command:E,positionOrder:52})}if(this.gridOptions.enableFiltering&&!this.sharedService.hideHeaderRowAfterPageLoad){if(!this._addonOptions.hideClearAllFiltersCommand){const E="clear-filter";u.some(d=>d!=="divider"&&d.hasOwnProperty("command")&&d.command===E)||a.push({iconCssClass:this._addonOptions.iconClearAllFiltersCommand||"mdi mdi-filter-remove-outline",titleKey:`${t}${(r==null?void 0:r.clearAllFiltersCommandKey)??"CLEAR_ALL_FILTERS"}`,disabled:!1,command:E,positionOrder:50})}if(!this._addonOptions.hideToggleFilterCommand){const E="toggle-filter";u.some(d=>d!=="divider"&&d.hasOwnProperty("command")&&d.command===E)||a.push({iconCssClass:this._addonOptions.iconToggleFilterCommand||"mdi mdi-flip-vertical",titleKey:`${t}${(r==null?void 0:r.toggleFilterCommandKey)??"TOGGLE_FILTER_ROW"}`,disabled:!1,command:E,positionOrder:53})}if(e&&!this._addonOptions.hideRefreshDatasetCommand){const E="refresh-dataset";u.some(d=>d!=="divider"&&d.hasOwnProperty("command")&&d.command===E)||a.push({iconCssClass:this._addonOptions.iconRefreshDatasetCommand||"mdi mdi-sync",titleKey:`${t}${(r==null?void 0:r.refreshDatasetCommandKey)??"REFRESH_DATASET"}`,disabled:!1,command:E,positionOrder:58})}}if(!this._addonOptions.hideToggleDarkModeCommand){const E="toggle-dark-mode";u.some(d=>d!=="divider"&&d.hasOwnProperty("command")&&d.command===E)||a.push({iconCssClass:this._addonOptions.iconToggleDarkModeCommand||"mdi mdi-brightness-4",titleKey:`${t}${(r==null?void 0:r.toggleDarkModeCommandKey)??"TOGGLE_DARK_MODE"}`,disabled:!1,command:E,positionOrder:54})}if(this.gridOptions.showPreHeaderPanel&&!this._addonOptions.hideTogglePreHeaderCommand){const E="toggle-preheader";u.some(d=>d!=="divider"&&d.hasOwnProperty("command")&&d.command===E)||a.push({iconCssClass:this._addonOptions.iconTogglePreHeaderCommand||"mdi mdi-flip-vertical",titleKey:`${t}${(r==null?void 0:r.togglePreHeaderCommandKey)??"TOGGLE_PRE_HEADER_ROW"}`,disabled:!1,command:E,positionOrder:53})}if(this.gridOptions.enableSorting&&!this._addonOptions.hideClearAllSortingCommand){const E="clear-sorting";u.some(d=>d!=="divider"&&d.hasOwnProperty("command")&&d.command===E)||a.push({iconCssClass:this._addonOptions.iconClearAllSortingCommand||"mdi mdi-sort-variant-off",titleKey:`${t}${(r==null?void 0:r.clearAllSortingCommandKey)??"CLEAR_ALL_SORTING"}`,disabled:!1,command:E,positionOrder:51})}if(this.gridOptions.enableTextExport&&!this._addonOptions.hideExportCsvCommand){const E="export-csv";u.some(d=>d!=="divider"&&d.hasOwnProperty("command")&&d.command===E)||a.push({iconCssClass:this._addonOptions.iconExportCsvCommand||"mdi mdi-download",titleKey:`${t}${(r==null?void 0:r.exportCsvCommandKey)??"EXPORT_TO_CSV"}`,disabled:!1,command:E,positionOrder:55})}if(this.gridOptions.enableExcelExport&&!this._addonOptions.hideExportExcelCommand){const E="export-excel";u.some(d=>d!=="divider"&&d.hasOwnProperty("command")&&d.command===E)||a.push({iconCssClass:this._addonOptions.iconExportExcelCommand||"mdi mdi-file-excel-outline text-success",titleKey:`${t}${(r==null?void 0:r.exportExcelCommandKey)??"EXPORT_TO_EXCEL"}`,disabled:!1,command:E,positionOrder:56})}if(this.gridOptions.enableTextExport&&!this._addonOptions.hideExportTextDelimitedCommand){const E="export-text-delimited";u.some(d=>d!=="divider"&&d.hasOwnProperty("command")&&d.command===E)||a.push({iconCssClass:this._addonOptions.iconExportTextDelimitedCommand||"mdi mdi-download",titleKey:`${t}${(r==null?void 0:r.exportTextDelimitedCommandKey)??"EXPORT_TO_TAB_DELIMITED"}`,disabled:!1,command:E,positionOrder:57})}const l=((s=this._addonOptions)==null?void 0:s.commandItems)||[];(Array.isArray(a)&&a.length>0||Array.isArray(l)&&l.length>0)&&(this._addonOptions.commandTitle=this._addonOptions.commandTitle||this.extensionUtility.getPickerTitleOutputString("commandTitle","gridMenu"))}return a}executeGridMenuInternalCustomCommands(u,e){var i,t,r;const a=((i=this.sharedService)==null?void 0:i.externalRegisteredResources)||[];if(e!=null&&e.command)switch(e.command){case"clear-pinning":const o=[...this.sharedService.visibleColumns],s={frozenColumn:-1,frozenRow:-1,frozenBottom:!1,enableMouseWheelScrollHandler:!1};this.grid.setOptions(s),this.sharedService.gridOptions.frozenColumn=s.frozenColumn,this.sharedService.gridOptions.frozenRow=s.frozenRow,this.sharedService.gridOptions.frozenBottom=s.frozenBottom,this.sharedService.gridOptions.enableMouseWheelScrollHandler=s.enableMouseWheelScrollHandler,Array.isArray(o)&&this.grid.setColumns(o),this.gridOptions.enableAutoSizeColumns&&this.grid.autosizeColumns(),this.pubSubService.publish("onGridMenuClearAllPinning");break;case"clear-filter":this.filterService.clearFilters(),this.sharedService.dataView.refresh(),this.pubSubService.publish("onGridMenuClearAllFilters");break;case"clear-sorting":this.sortService.clearSorting(),this.sharedService.dataView.refresh(),this.pubSubService.publish("onGridMenuClearAllSorting");break;case"export-csv":const E=a.find(x=>x.className==="TextExportService");E!=null&&E.exportToFile?E.exportToFile({delimiter:Se.comma,format:Ou.csv}):console.error("[Slickgrid-Universal] You must register the TextExportService to properly use Export to File in the Grid Menu. Example:: this.gridOptions = { enableTextExport: true, externalResources: [new TextExportService()] };");break;case"export-excel":const d=a.find(x=>x.className==="ExcelExportService");d!=null&&d.exportToExcel?d.exportToExcel():console.error("[Slickgrid-Universal] You must register the ExcelExportService to properly use Export to Excel in the Grid Menu. Example:: this.gridOptions = { enableExcelExport: true, externalResources: [new ExcelExportService()] };");break;case"export-text-delimited":const c=a.find(x=>x.className==="TextExportService");c!=null&&c.exportToFile?c.exportToFile({delimiter:Se.tab,format:Ou.txt}):console.error("[Slickgrid-Universal] You must register the TextExportService to properly use Export to File in the Grid Menu. Example:: this.gridOptions = { enableTextExport: true, externalResources: [new TextExportService()] };");break;case"toggle-dark-mode":const D=this.sharedService.gridOptions.darkMode;this.grid.setOptions({darkMode:!D}),this.sharedService.gridOptions.darkMode=!D;break;case"toggle-filter":let m=((t=this.gridOptions)==null?void 0:t.showHeaderRow)??!1;m=!m,this.grid.setHeaderRowVisibility(m),m===!0&&(this.grid.setColumns(this.sharedService.columnDefinitions),this.grid.scrollColumnIntoView(0));break;case"toggle-preheader":const h=((r=this.gridOptions)==null?void 0:r.showPreHeaderPanel)??!1;this.grid.setPreHeaderPanelVisibility(!h);break;case"refresh-dataset":this.extensionUtility.refreshBackendDataset();break}}getDefaultGridMenuOptions(){return{commandTitle:void 0,columnTitle:this.extensionUtility.getPickerTitleOutputString("columnTitle","gridMenu"),forceFitTitle:this.extensionUtility.getPickerTitleOutputString("forceFitTitle","gridMenu"),syncResizeTitle:this.extensionUtility.getPickerTitleOutputString("syncResizeTitle","gridMenu"),iconCssClass:"mdi mdi-menu",menuWidth:18,commandItems:[],hideClearAllFiltersCommand:!1,hideRefreshDatasetCommand:!1,hideToggleFilterCommand:!1}}handleBodyMouseDown(u){if(this.menuElement){let e=!1;const a=u.target.closest(`.${this.menuCssClass}`);(this.menuElement.contains(u.target)||a)&&(e=!0),(this._isMenuOpen&&this.menuElement!==u.target&&!e&&!u.defaultPrevented||u.target.className==="close"&&a)&&this.hideMenu(u)}}handleMenuItemCommandClick(u,e,a,i=0){var t,r;if(a!=="divider"&&!a.disabled&&!a.divider)if((a.command||"")&&!a.commandItems){const s={grid:this.grid,command:a.command,item:a,allColumns:this.columns,visibleColumns:this.getVisibleColumns()};this.executeGridMenuInternalCustomCommands(u,s),this.pubSubService.publish("onGridMenuCommand",s),typeof((t=this._addonOptions)==null?void 0:t.onCommand)=="function"&&this._addonOptions.onCommand(u,s),this.onCommand.notify(s,null,this),typeof a.action=="function"&&a.action.call(this,u,s),!((r=this._addonOptions)!=null&&r.leaveOpen)&&!u.defaultPrevented&&this.hideMenu(u),u.preventDefault(),u.stopPropagation()}else a.commandItems&&this.repositionSubMenu(u,a,i)}handleMenuItemMouseOver(u,e,a,i=0){a!=="divider"&&!a.disabled&&!a.divider&&(a.commandItems?this.repositionSubMenu(u,a,i):i===0&&this.disposeSubMenus())}recreateCommandList(u,e,a,i){const t=a.level||0;if(u.length>0){const r=v("div",{className:`${this._menuCssPrefix}-command-list`,role:"menu"},e);if(t===0){this.populateCommandOrOptionTitle("command",this.addonOptions,r,t);const o=e.querySelector(".slick-command-header")??v("div",{className:"slick-command-header"});o.classList.add("with-close"),q1.call(this,o),r.appendChild(o)}return i&&t>0&&this.addSubMenuTitleWhenExists(i,r),this.populateCommandOrOptionItems("command",this._addonOptions,r,u,a,this.handleMenuItemCommandClick,this.handleMenuItemMouseOver),r}return null}repositionSubMenu(u,e,a){const i=(e==null?void 0:e.commandItems)||[],t=this.createCommandMenu(i,a+1,e);t.style.display="block",document.body.appendChild(t),this.repositionMenu(u,t)}}const W1="mdi-icon-picker-check",U1="mdi-icon-picker-uncheck";function q1(n){const e=v("button",{type:"button",className:"close",ariaLabel:"Close",textContent:"×",dataset:{dismiss:this instanceof Zr?"slick-column-picker":"slick-grid-menu"}});n.appendChild(e)}function Z1(n){var e,a;const u=this;(e=u.addonOptions)!=null&&e.columnTitle&&(u._columnTitleElm=v("div",{className:"slick-menu-title",textContent:((a=u.addonOptions)==null?void 0:a.columnTitle)??u._defaults.columnTitle},n))}function Y1(n){var r,o;const u=this,e=u instanceof Zr?"columnPicker":"gridMenu",a=(r=n.target)==null?void 0:r.closest(".icon-checkbox-container"),i=a==null?void 0:a.querySelector(".mdi"),t=!!n.target.checked;if(n.target.ariaChecked=String(t),Ps(i,t),n.target.dataset.option==="autoresize"){const s=u.getVisibleColumns();u.grid.setOptions({forceFitColumns:t}),u.grid.setColumns(s);return}if(n.target.dataset.option==="syncresize"){u.grid.setOptions({syncColumnCellResize:t});return}if(n.target.type==="checkbox"){u._areVisibleColumnDifferent=!0;const s=n.target.dataset.columnid||"",l=[];if(u._columnCheckboxes.forEach((c,D)=>{c.checked&&l.push(u.columns[D])}),!l.length){n.target.checked=!0,Ps(i,!0);return}if(u.grid.setColumns(l),(!u.sharedService.visibleColumns||Array.isArray(l)&&l.length!==u.sharedService.visibleColumns.length)&&(u.sharedService.visibleColumns=l),u.gridOptions.enableRowSelection&&t){const c=u.grid.getSelectedRows();u.grid.setSelectedRows(c)}const E=u.gridOptions.frozenColumn??-1;E>=0&&u.extensionUtility.readjustFrozenColumnIndexWhenNeeded(E,u.columns,l);const d={columnId:s,showing:t,allColumns:u.columns,visibleColumns:l,columns:l,grid:u.grid};u.pubSubService.publish(`on${N0(e)}ColumnsChanged`,d),typeof((o=u.addonOptions)==null?void 0:o.onColumnsChanged)=="function"&&u.addonOptions.onColumnsChanged(n,d),u.onColumnsChanged.notify(d,null,u)}}function Ps(n,u=!1){n&&(n.className=`mdi ${u?W1:U1}`)}function Bn(n,u,e,a=!1){const i=v("label",{className:"checkbox-picker-label",htmlFor:u}),t=v("div",{className:"icon-checkbox-container"}),r=v("input",{id:u,type:"checkbox",dataset:e}),o=v("div",{className:`mdi ${a?W1:U1}`}),s=v("span",{className:"checkbox-label"});return t.appendChild(r),t.appendChild(o),i.appendChild(t),i.appendChild(s),n.appendChild(i),a&&(r.ariaChecked="true",r.checked=!0),{inputElm:r,labelElm:i,labelSpanElm:s}}function Q1(n){const u=this,e=u instanceof J1?"gridmenu-":"";for(const a of u.columns){const i=a.id,t=document.createElement("li");a.excludeFromColumnPicker&&(t.className="hidden");const r=`${u._gridUid}-${e}colpicker-${i}`,o=u.grid.getColumnIndex(i)>=0,{inputElm:s,labelElm:l,labelSpanElm:E}=Bn(t,r,{columnid:`${i}`},o);u._columnCheckboxes.push(s);const c=(typeof(n==null?void 0:n.headerColumnValueExtractor)=="function"?n.headerColumnValueExtractor:u._defaults.headerColumnValueExtractor)(a,u.gridOptions);this.grid.applyHtmlCode(E,c),t.appendChild(l),u._listElm.appendChild(t)}if((!n.hideForceFitButton||!n.hideSyncResizeButton)&&u._listElm.appendChild(document.createElement("hr")),!(n!=null&&n.hideForceFitButton)){const a=document.createElement("li"),i=`${u._gridUid}-${e}colpicker-forcefit`,{labelSpanElm:t}=Bn(a,i,{option:"autoresize"},u.gridOptions.forceFitColumns);t.textContent=(n==null?void 0:n.forceFitTitle)??"",u._listElm.appendChild(a)}if(!(n!=null&&n.hideSyncResizeButton)){const a=document.createElement("li"),i=`${u._gridUid}-${e}colpicker-syncresize`,{labelSpanElm:t}=Bn(a,i,{option:"syncresize"},u.gridOptions.forceFitColumns);t.textContent=(n==null?void 0:n.syncResizeTitle)??"",u._listElm.appendChild(a)}}function _t(){const n=this,u=n.grid.getColumns().slice(0),e=new Array(n.columns.length);for(let a=0;aE0(r.name||"","innerHTML")},this._bindEventService=new vu,this._eventHandler=new Tu,this._columns=this.sharedService.allColumns??[],this._gridUid=((t=(i=this.grid)==null?void 0:i.getUID)==null?void 0:t.call(i))??"",this.init()}get addonOptions(){return this.gridOptions.columnPicker||{}}get eventHandler(){return this._eventHandler}get columns(){return this._columns}set columns(u){this._columns=u}get gridOptions(){return this.sharedService.gridOptions??{}}get grid(){return this.sharedService.slickGrid}get menuElement(){return this._menuElm}init(){this._gridUid=this.grid.getUID()??"",this.gridOptions.columnPicker={...this._defaults,...this.gridOptions.columnPicker},this.onColumnsChanged.setPubSubService(this.pubSubService),this.addonOptions.columnTitle=this.extensionUtility.getPickerTitleOutputString("columnTitle","columnPicker"),this.addonOptions.forceFitTitle=this.extensionUtility.getPickerTitleOutputString("forceFitTitle","columnPicker"),this.addonOptions.syncResizeTitle=this.extensionUtility.getPickerTitleOutputString("syncResizeTitle","columnPicker"),this._eventHandler.subscribe(this.grid.onHeaderContextMenu,this.handleHeaderContextMenu.bind(this)),this._eventHandler.subscribe(this.grid.onColumnsReordered,_t.bind(this)),this._eventHandler.subscribe(this.grid.onClick,this.disposeMenu.bind(this)),this._bindEventService.bind(document.body,"mousedown",this.handleBodyMouseDown.bind(this),void 0,"body"),this._bindEventService.bind(document.body,"beforeunload",this.dispose.bind(this),void 0,"body")}dispose(){this._eventHandler.unsubscribeAll(),this._bindEventService.unbindAll(),this.disposeMenu()}disposeMenu(){var u,e;this._bindEventService.unbindAll("parent-menu"),(u=this._listElm)==null||u.remove(),(e=this._menuElm)==null||e.remove(),this._menuElm=null}createPickerMenu(){const u=v("div",{ariaExpanded:"true",className:`slick-column-picker ${this._gridUid}`,role:"menu"});return _t.call(this),Z1.call(this,u),q1.call(this,u),this._listElm=v("div",{className:"slick-column-picker-list",role:"menu"}),this._bindEventService.bind(u,"click",Y1.bind(this),void 0,"parent-menu"),document.body.appendChild(u),u}getAllColumns(){return this._columns}getVisibleColumns(){return this.grid.getColumns()}translateColumnPicker(){this.addonOptions&&(this.addonOptions.columnTitle="",this.addonOptions.forceFitTitle="",this.addonOptions.syncResizeTitle="",this.addonOptions.columnTitle=this.extensionUtility.getPickerTitleOutputString("columnTitle","columnPicker"),this.addonOptions.forceFitTitle=this.extensionUtility.getPickerTitleOutputString("forceFitTitle","columnPicker"),this.addonOptions.syncResizeTitle=this.extensionUtility.getPickerTitleOutputString("syncResizeTitle","columnPicker")),this.extensionUtility.translateItems(this._columns,"nameKey","name"),this.translateTitleLabels(this.addonOptions)}handleBodyMouseDown(u){var e;(this._menuElm!==u.target&&!((e=this._menuElm)!=null&&e.contains(u.target))||u.target.className==="close"&&u.target.closest(".slick-column-picker"))&&this.disposeMenu()}handleHeaderContextMenu(u){u.preventDefault(),bu(this._listElm),this._columnCheckboxes=[],this._menuElm=this.createPickerMenu(),this.gridOptions.darkMode&&this._menuElm.classList.add("slick-dark-mode"),Q1.call(this,this.addonOptions),document.body.appendChild(this._menuElm),this.repositionMenu(u)}repositionMenu(u){var a;const e=((a=u==null?void 0:u.touches)==null?void 0:a[0])??u;this._menuElm&&(this._menuElm.style.top=`${e.pageY-10}px`,this._menuElm.style.left=`${e.pageX-10}px`,this._menuElm.style.minHeight=be(this.addonOptions.minHeight,""),this._menuElm.style.maxHeight=be(this.addonOptions.maxHeight,`${window.innerHeight-e.clientY}px`),this._menuElm.style.display="block",this._menuElm.ariaExpanded="true",this._menuElm.appendChild(this._listElm))}translateTitleLabels(u){u&&(u.columnTitle=this.extensionUtility.getPickerTitleOutputString("columnTitle","gridMenu"))}}const dt=(n,u,e,a,i,t)=>{const r=a.params||{};if(!r.formatters||!Array.isArray(r.formatters))throw new Error(`[Slickgrid-Universal] The multiple formatter requires the "formatters" to be provided as a column params.
+ For example: this.columnDefinitions = [{ id: title, field: title, formatter: Formatters.multiple, params: { formatters: [Formatters.lowercase, Formatters.uppercase] }`);const o=r.formatters;let s=e;return o.forEach((l,E)=>{if(typeof l!="function")throw new Error(`[Slickgrid-Universal] the "params.formatters" at index(${E}) to be used by "Formatters.multiple" is invalid, please verify all formatter functions.`);s=l.call(void 0,n,u,s,a,i,t)}),s};function js(n,u){if(Array.isArray(n)){for(const e of n)if(e.editor)if(e.formatter&&e.formatter!==dt&&e.formatter!==u){const a=e.formatter;e.formatter=dt,e.params={...e.params,formatters:[a,u]}}else e.formatter&&e.formatter===dt&&e.params?e.params.formatters.findIndex(a=>a===u)===-1&&(e.params.formatters=[...e.params.formatters,u]):e.formatter=u}}function Qu(n,u,e,a){let i,t,r="",o="";switch(e){case"currency":i=T.DEFAULT_FORMATTER_CURRENCY_MIN_DECIMAL,t=T.DEFAULT_FORMATTER_CURRENCY_MAX_DECIMAL;break;case"decimal":i=T.DEFAULT_FORMATTER_NUMBER_MIN_DECIMAL,t=T.DEFAULT_FORMATTER_NUMBER_MAX_DECIMAL;break;case"percent":i=T.DEFAULT_FORMATTER_PERCENT_MIN_DECIMAL,t=T.DEFAULT_FORMATTER_PERCENT_MAX_DECIMAL;break}const s=u&&typeof u.getOptions=="function"?u.getOptions():{},l=oe("minDecimal",n,s,i),E=oe("maxDecimal",n,s,t),d=oe("decimalSeparator",n,s,T.DEFAULT_NUMBER_DECIMAL_SEPARATOR),c=oe("thousandSeparator",n,s,T.DEFAULT_NUMBER_THOUSAND_SEPARATOR),D=oe("displayNegativeNumberWithParentheses",n,s,T.DEFAULT_NEGATIVE_NUMBER_WRAPPED_IN_BRAQUET),m=oe("currencyPrefix",n,s,""),h=oe("currencySuffix",n,s,"");return a==="cell"&&(r=oe("numberPrefix",n,s,""),o=oe("numberSuffix",n,s,"")),{minDecimal:l,maxDecimal:E,decimalSeparator:d,thousandSeparator:c,wrapNegativeNumber:D,currencyPrefix:m,currencySuffix:h,numberPrefix:r,numberSuffix:o}}function oe(n,u,e,a){var t;const i=u&&u.params;return i&&i.hasOwnProperty(n)?i[n]:(t=e==null?void 0:e.formatterOptions)!=null&&t.hasOwnProperty(n)?e.formatterOptions[n]:a}function qu(n,u){const e=J0(n,!0);return(a,i,t,r,o,s)=>{var x,g;const l=s&&typeof s.getOptions=="function"?s.getOptions():{},E=((x=l==null?void 0:l.formatterOptions)==null?void 0:x.dateSeparator)??u,d=(r==null?void 0:r.type)??p.date,c=J0(d,!0),D=((g=r==null?void 0:r.params)==null?void 0:g.parseDateAsUtc)??!1,m=Be(t,c);let h=t;if(m){let F=t;D&&(F=ED(m)),h=l0(F,e,"en-US")}if(h&&E!==u){const F=new RegExp(u,"ig");h=h.replace(F,E)}return h}}function Yr(n,u,e,a,i,t){let r=!1;e!=null&&e.hasOwnProperty("exportWithFormatter")?r=!!e.exportWithFormatter:t!=null&&t.hasOwnProperty("exportWithFormatter")&&(r=!!t.exportWithFormatter);let o;a&&e.exportCustomFormatter?o=e.exportCustomFormatter:r&&e.formatter&&(o=e.formatter);const s=Xt(o,n,u,e,a,i);return t!=null&&t.sanitizeDataExport&&typeof s=="string"?Wu(s):s}function Xt(n,u,e,a,i,t){let r="",s=a.field||a.id||"";if(typeof a.field=="string"&&a.field.indexOf(".")>0){const E=a.field.split(".");s=E.length>0?E[0]:a.field}const l=i!=null&&i.hasOwnProperty(s)?i[s]:null;if(typeof n=="function"){const E=n(u,e,l,a,i,t),d=Da(E)?E:E.html||E.text;r=E0(d)}else r=i!=null&&i.hasOwnProperty(s)?l:"";return r==null&&(r=""),typeof r=="object"&&!(r instanceof Date)&&Object.entries(r).length===0&&(r=""),r}class gh extends V1{constructor(u,e,a,i){super(u,e,a),this.extensionUtility=u,this.pubSubService=e,this.sharedService=a,this.treeDataService=i,this._defaults={autoAdjustDrop:!0,autoAlignSide:!0,autoAdjustDropOffset:0,autoAlignSideOffset:0,hideMenuOnScroll:!1,optionShownOverColumnIds:[],commandShownOverColumnIds:[],subMenuOpenByEvent:"mouseover"},this.pluginName="ContextMenu",this._camelPluginName="contextMenu",this._menuCssPrefix="slick-menu",this._menuPluginCssPrefix="slick-context-menu",this.init(a.gridOptions.contextMenu)}init(u){this._addonOptions={...this._defaults,...u};const e=this._addonOptions&&Array.isArray(this._addonOptions.commandItems)?this._addonOptions.commandItems:[];this._addonOptions.commandItems=[...e,...this.addMenuCustomCommands(e)],this._addonOptions={...this._addonOptions},this.sharedService.gridOptions.contextMenu=this._addonOptions,this.sortMenuItems(),this._eventHandler.subscribe(this.grid.onContextMenu,this.handleOnContextMenu.bind(this)),this._eventHandler.subscribe(this.grid.onClick,this.hideMenu.bind(this)),this._addonOptions.hideMenuOnScroll&&this._eventHandler.subscribe(this.grid.onScroll,this.closeMenu.bind(this))}translateContextMenu(){var a;const u=((a=this.sharedService)==null?void 0:a.gridOptions)??{},e=this.sharedService.gridOptions.contextMenu;if(e&&(u!=null&&u.enableTranslate)){const i=e.commandItems||[],t=e.optionItems||[];e.commandTitleKey&&(e.commandTitle=this.extensionUtility.translateWhenEnabledAndServiceExist(e.commandTitleKey,"TEXT_COMMANDS")||e.commandTitle),e.optionTitleKey&&(e.optionTitle=this.extensionUtility.translateWhenEnabledAndServiceExist(e.optionTitleKey,"TEXT_COMMANDS")||e.optionTitle),this.extensionUtility.translateMenuItemsFromTitleKey(i,"commandItems"),this.extensionUtility.translateMenuItemsFromTitleKey(t,"optionItems")}}handleOnContextMenu(u,e){this.disposeAllMenus();const a=this.grid.getCellFromEvent(u);if(a){const i=this.grid.getDataItem(a.row),t=this.grid.getColumns()[a.cell],r=e||{};if(r.cell=a.cell,r.row=a.row,r.column=t,r.dataContext=i,r.grid=this.grid,!this.extensionUtility.runOverrideFunctionWhenExists(this._addonOptions.menuUsabilityOverride,r))return;this._menuElm=this.createParentMenu(u),this._menuElm&&u.preventDefault(),this._menuElm&&this.gridOptions.darkMode&&this._menuElm.classList.add("slick-dark-mode"),this._menuElm&&(this.repositionMenu(u,this._menuElm),this._menuElm.ariaExpanded="true",this._menuElm.style.display="block"),this._bindEventService.bind(document.body,"mousedown",this.handleBodyMouseDown.bind(this))}}addMenuCustomCommands(u){var o;const e=[],a=this.sharedService&&this.sharedService.gridOptions||{},i=a==null?void 0:a.contextMenu,t=(o=this.sharedService)==null?void 0:o.dataView,r=X0(a);if(i&&!i.hideCopyCellValueCommand){const s="copy";u.some(l=>l!=="divider"&&l.hasOwnProperty("command")&&l.command===s)||e.push({iconCssClass:i.iconCopyCellValueCommand||"mdi mdi-content-copy",titleKey:`${r}COPY`,disabled:!1,command:s,positionOrder:50,action:(l,E)=>{this.copyToClipboard(E)},itemUsabilityOverride:l=>{const E=l==null?void 0:l.column,d=l==null?void 0:l.dataContext;if(typeof E.queryFieldNameGetterFn=="function"){const c=hi(E,d,"");if(c!==""&&c!==void 0)return!0}else if(E&&d.hasOwnProperty(E.field))return d[E.field]!==""&&d[E.field]!==null&&d[E.field]!==void 0;return!1}})}if(a!=null&&a.enableTextExport&&i&&!i.hideExportCsvCommand){const s="export-csv";u.some(l=>l!=="divider"&&l.hasOwnProperty("command")&&l.command===s)||e.push({iconCssClass:i.iconExportCsvCommand||"mdi mdi-download",titleKey:`${r}EXPORT_TO_CSV`,disabled:!1,command:s,positionOrder:51,action:()=>{var d;const E=(((d=this.sharedService)==null?void 0:d.externalRegisteredResources)||[]).find(c=>c.className==="TextExportService");if(E!=null&&E.exportToFile)E.exportToFile({delimiter:Se.comma,format:Ou.csv});else throw new Error("[Slickgrid-Universal] You must register the TextExportService to properly use Export to File in the Context Menu. Example:: this.gridOptions = { enableTextExport: true, externalResources: [new TextExportService()] };")}})}if(a&&a.enableExcelExport&&i&&!i.hideExportExcelCommand){const s="export-excel";u.some(l=>l!=="divider"&&l.hasOwnProperty("command")&&l.command===s)||e.push({iconCssClass:i.iconExportExcelCommand||"mdi mdi-file-excel-outline text-success",titleKey:`${r}EXPORT_TO_EXCEL`,disabled:!1,command:s,positionOrder:52,action:()=>{var d;const E=(((d=this.sharedService)==null?void 0:d.externalRegisteredResources)||[]).find(c=>c.className==="ExcelExportService");if(E!=null&&E.exportToExcel)E.exportToExcel();else throw new Error("[Slickgrid-Universal] You must register the ExcelExportService to properly use Export to Excel in the Context Menu. Example:: this.gridOptions = { enableExcelExport: true, externalResources: [new ExcelExportService()] };")}})}if(a!=null&&a.enableTextExport&&i&&!i.hideExportTextDelimitedCommand){const s="export-text-delimited";u.some(l=>l!=="divider"&&l.hasOwnProperty("command")&&l.command===s)||e.push({iconCssClass:i.iconExportTextDelimitedCommand||"mdi mdi-download",titleKey:`${r}EXPORT_TO_TAB_DELIMITED`,disabled:!1,command:s,positionOrder:53,action:()=>{var d;const E=(((d=this.sharedService)==null?void 0:d.externalRegisteredResources)||[]).find(c=>c.className==="TextExportService");if(E!=null&&E.exportToFile)E.exportToFile({delimiter:Se.tab,format:Ou.txt});else throw new Error("[Slickgrid-Universal] You must register the TextExportService to properly use Export to File in the Context Menu. Example:: this.gridOptions = { enableTextExport: true, externalResources: [new TextExportService()] };")}})}if(a&&(a.enableGrouping||a.enableDraggableGrouping||a.enableTreeData)){if(i&&!i.hideCopyCellValueCommand&&e.push({divider:!0,command:"",positionOrder:54}),a&&!a.enableTreeData&&i&&!i.hideClearAllGrouping){const s="clear-grouping";u.some(l=>l!=="divider"&&l.hasOwnProperty("command")&&l.command===s)||e.push({iconCssClass:i.iconClearGroupingCommand||"mdi mdi-close",titleKey:`${r}CLEAR_ALL_GROUPING`,disabled:!1,command:s,positionOrder:55,action:()=>{t.setGrouping([]),this.pubSubService.publish("onContextMenuClearGrouping")},itemUsabilityOverride:()=>{const l=t&&t.getGrouping&&t.getGrouping();return Array.isArray(l)&&l.length>0}})}if(a&&i&&!i.hideCollapseAllGroups){const s="collapse-all-groups";u.some(l=>l!=="divider"&&l.hasOwnProperty("command")&&l.command===s)||e.push({iconCssClass:i.iconCollapseAllGroupsCommand||"mdi mdi-arrow-collapse",titleKey:`${r}COLLAPSE_ALL_GROUPS`,disabled:!1,command:s,positionOrder:56,action:()=>{a.enableTreeData?this.treeDataService.toggleTreeDataCollapse(!0):t.collapseAllGroups(),this.pubSubService.publish("onContextMenuCollapseAllGroups")},itemUsabilityOverride:()=>{if(a.enableTreeData)return!0;const l=t&&t.getGrouping&&t.getGrouping();return Array.isArray(l)&&l.length>0}})}if(a&&i&&!i.hideExpandAllGroups){const s="expand-all-groups";u.some(l=>l!=="divider"&&l.hasOwnProperty("command")&&l.command===s)||e.push({iconCssClass:i.iconExpandAllGroupsCommand||"mdi mdi-arrow-expand",titleKey:`${r}EXPAND_ALL_GROUPS`,disabled:!1,command:s,positionOrder:57,action:()=>{a.enableTreeData?this.treeDataService.toggleTreeDataCollapse(!1):t.expandAllGroups(),this.pubSubService.publish("onContextMenuExpandAllGroups")},itemUsabilityOverride:()=>{if(a.enableTreeData)return!0;const l=t&&t.getGrouping&&t.getGrouping();return Array.isArray(l)&&l.length>0}})}}return this.extensionUtility.translateMenuItemsFromTitleKey(e),e}copyToClipboard(u){var e,a;try{if(u&&u.grid&&u.command){const i=((e=this.sharedService)==null?void 0:e.gridOptions)??{},t=(u==null?void 0:u.cell)??0,r=(u==null?void 0:u.row)??0,o=u==null?void 0:u.column,s=u==null?void 0:u.dataContext,l=(a=this.sharedService)==null?void 0:a.slickGrid,E=i&&(i.excelExportOptions||i.textExportOptions);let d=Yr(r,t,o,s,l,E);typeof o.queryFieldNameGetterFn=="function"&&(d=hi(o,s,""));let c=d;typeof d=="string"&&(c=d.replace(/^([·|⮞|⮟]\s*)|([·|⮞|⮟])\s*/gi,"").replace(/[\u00b7|\u034f]/gi,"").trim());const D=document.createElement("textarea");D&&document.body&&(D.style.position="absolute",D.style.opacity="0",D.value=c,document.body.appendChild(D),D.select(),document.execCommand("copy",!1,c)&&D.remove())}}catch{}}sortMenuItems(){var e,a;const u=(a=(e=this.sharedService)==null?void 0:e.gridOptions)==null?void 0:a.contextMenu;u&&(this.extensionUtility.sortItems(u.commandItems||[],"positionOrder"),this.extensionUtility.sortItems(u.optionItems||[],"positionOrder"))}}class Ch{constructor(u,e,a){this.extensionUtility=u,this.pubSubService=e,this.sharedService=a,this.columnsGroupBy=[],this.pluginName="DraggableGrouping",this._gridColumns=[],this._gridUid="",this._reorderedColumns=[],this._subscriptions=[],this._defaults={dropPlaceHolderText:"Drop a column header here to group by the column",hideGroupSortIcons:!1,hideToggleAllButton:!1,toggleAllButtonText:"",toggleAllPlaceholderText:"Toggle all Groups"},this._bindingEventService=new vu,this._eventHandler=new Tu,this.onGroupChanged=new R("onGroupChanged")}get addonOptions(){return this._addonOptions}get dataView(){var u;return((u=this.grid)==null?void 0:u.getData())??{}}get dropboxElement(){return this._dropzoneElm}get droppableInstance(){return this._droppableInstance}get sortableLeftInstance(){return this._sortableLeftInstance}get sortableRightInstance(){return this._sortableRightInstance}get eventHandler(){return this._eventHandler}get grid(){return this._grid??this.sharedService.slickGrid??{}}get gridOptions(){return this.sharedService.gridOptions??{}}get gridUid(){var u;return this._gridUid||(((u=this.grid)==null?void 0:u.getUID())??"")}get gridContainer(){return this.grid.getContainerNode()}init(u,e){var a,i;if(this._addonOptions={...this._defaults,...e},this._grid=u,u){if(this._gridUid=u.getUID(),this._gridColumns=u.getColumns(),this._dropzoneElm=u.getPreHeaderPanel(),this._dropzoneElm.classList.add("slick-dropzone"),this.onGroupChanged.setPubSubService(this.pubSubService),!this._addonOptions.hideToggleAllButton){this._groupToggler=v("div",{className:"slick-group-toggle-all",title:this._addonOptions.toggleAllPlaceholderText??"",style:{display:"none"}});const t=v("span",{className:"slick-group-toggle-all-icon"},this._groupToggler);this.gridOptions.enableTranslate&&this._addonOptions.toggleAllButtonTextKey&&(this._addonOptions.toggleAllButtonText=this.extensionUtility.translateWhenEnabledAndServiceExist(this._addonOptions.toggleAllButtonTextKey,"TEXT_TOGGLE_ALL_GROUPS")),this.gridOptions.enableTranslate&&this._addonOptions.toggleAllPlaceholderTextKey&&(this._addonOptions.toggleAllPlaceholderText=this.extensionUtility.translateWhenEnabledAndServiceExist(this._addonOptions.toggleAllPlaceholderTextKey,"TEXT_TOGGLE_ALL_GROUPS")),this._groupToggler.title=this._addonOptions.toggleAllPlaceholderText??"",this._addonOptions.toggleAllButtonText&&this._groupToggler.appendChild(v("span",{className:"slick-group-toggle-all-text",textContent:this._addonOptions.toggleAllButtonText||""})),this._dropzoneElm.appendChild(this._groupToggler),this._subscriptions.push(this.pubSubService.subscribe("onContextMenuCollapseAllGroups",()=>this.toggleGroupToggler(t,!0,!1)),this.pubSubService.subscribe("onContextMenuExpandAllGroups",()=>this.toggleGroupToggler(t,!1,!1)))}this._dropzonePlaceholderElm=v("div",{className:"slick-draggable-dropzone-placeholder"},this._dropzoneElm),this.gridOptions.enableTranslate&&((a=this._addonOptions)!=null&&a.dropPlaceHolderTextKey)&&(this._addonOptions.dropPlaceHolderText=this.extensionUtility.translateWhenEnabledAndServiceExist(this._addonOptions.dropPlaceHolderTextKey,"TEXT_TOGGLE_ALL_GROUPS")),this._dropzonePlaceholderElm.textContent=((i=this._addonOptions)==null?void 0:i.dropPlaceHolderText)??this._defaults.dropPlaceHolderText??"",this.setupColumnDropbox(),this._eventHandler.subscribe(u.onHeaderCellRendered,(t,r)=>{var s;const o=r.node;if(!Qn((s=r.column)==null?void 0:s.grouping)&&o&&(o.style.cursor="pointer",this._addonOptions.groupIconCssClass)){const l=v("span",{className:"slick-column-groupable"},o);this._addonOptions.groupIconCssClass&&l.classList.add(..._u(this._addonOptions.groupIconCssClass))}}),this._subscriptions.push(this.pubSubService.subscribe("onContextMenuClearGrouping",()=>this.clearDroppedGroups()));for(const t of this._gridColumns){const r=t.field;u.updateColumnHeader(r)}}return this}dispose(){var u,e;this.destroySortableInstances(),(u=this._droppableInstance)!=null&&u.el&&((e=this._droppableInstance)==null||e.destroy()),this.onGroupChanged.unsubscribe(),this._eventHandler.unsubscribeAll(),this.pubSubService.unsubscribeAll(this._subscriptions),this._bindingEventService.unbindAll(),bu(this.gridContainer.querySelector(`.${this.gridUid} .slick-preheader-panel`))}clearDroppedGroups(){this.columnsGroupBy=[],this.updateGroupBy("clear-all");const u=this._dropzoneElm.querySelectorAll(".slick-dropped-grouping");for(const e of Array.from(u)){const a=this._dropzoneElm.querySelector(".slick-groupby-remove");a==null||a.remove(),e==null||e.remove()}this._dropzonePlaceholderElm.style.display="inline-block",this._groupToggler&&(this._groupToggler.style.display="none")}destroySortableInstances(){var u,e,a,i;(u=this._sortableLeftInstance)!=null&&u.el&&((e=this._sortableLeftInstance)==null||e.destroy()),(a=this._sortableRightInstance)!=null&&a.el&&((i=this._sortableRightInstance)==null||i.destroy())}setAddonOptions(u){this._addonOptions={...this._addonOptions,...u}}setColumns(u){this._gridColumns=u}setDroppedGroups(u){this._dropzonePlaceholderElm.style.display="none";const e=Array.isArray(u)?u:[u];for(const a of e){const i=this.grid.getHeaderColumn(a);this.handleGroupByDrop(this._dropzoneElm,i)}}setupColumnReorder(u,e,a,i,t,r,o,s,l){this.destroySortableInstances();const E=u.getPreHeaderPanel(),d=E.querySelector(".slick-draggable-dropzone-placeholder"),c=E.querySelector(".slick-group-toggle-all"),D={animation:50,chosenClass:"slick-header-column-active",ghostClass:"slick-sortable-placeholder",draggable:".slick-header-column",dataIdAttr:"data-id",group:{name:"shared",pull:"clone",put:!1},revertClone:!0,onStart:()=>{d&&(d.style.display="inline-block"),E.querySelectorAll(".slick-dropped-grouping").forEach(h=>h.style.display="none"),c&&(c.style.display="none")},onEnd:m=>{var C,A,b;E==null||E.classList.remove("slick-dropzone-hover"),(C=d==null?void 0:d.parentElement)==null||C.classList.remove("slick-dropzone-placeholder-hover");const h=E.querySelectorAll(".slick-dropped-grouping");if(h.forEach(B=>B.style.display="flex"),h.length&&(d&&(d.style.display="none"),c&&(c.style.display="inline-flex")),!u.getEditorLock().commitCurrentEdit())return;const x=((A=this.sortableLeftInstance)==null?void 0:A.toArray())??[];if(e.length>1){const B=((b=this._sortableRightInstance)==null?void 0:b.toArray())??[];for(const S of B)x.push(S)}const g=[],F=u.getColumns();for(const B of x)g.push(F[o.call(u,B)]);i.call(u,g),l.call(u,u.onColumnsReordered,{grid:u}),m.stopPropagation(),t.call(u)}};return this._sortableLeftInstance=uu.create(this.gridContainer.querySelector(`.${u.getUID()} .slick-header-columns.slick-header-columns-left`),D),this._sortableRightInstance=uu.create(this.gridContainer.querySelector(`.${u.getUID()} .slick-header-columns.slick-header-columns-right`),D),{sortableLeftInstance:this._sortableLeftInstance,sortableRightInstance:this._sortableRightInstance}}addColumnGroupBy(u){this.columnsGroupBy.push(u),this.updateGroupBy("add-group")}addGroupByRemoveClickHandler(u,e,a,i){this._bindingEventService.bind(e,"click",()=>{const t=this._bindingEventService.boundedEvents.filter(r=>r.element===e);for(const r of t)this._bindingEventService.unbind(r.element,"click",r.listener);this.removeGroupBy(u,a,i)})}addGroupSortClickHandler(u,e){const{grouping:a,type:i}=u;this._bindingEventService.bind(e,"click",()=>{if(this.toggleGroupAll(u,!1),a){const t=a.sortAsc?ju.desc:ju.asc;a.comparer=(r,o)=>Ta(i||"text",r.value,o.value,t,u,this.gridOptions),this.getGroupBySortIcon(e,!a.sortAsc),this.updateGroupBy("sort-group"),a.sortAsc=!a.sortAsc,this.grid.invalidate()}})}getGroupBySortIcon(u,e=!0){e?this._addonOptions.sortAscIconCssClass?(u.classList.remove(..._u(this._addonOptions.sortDescIconCssClass)),u.classList.add(..._u(this._addonOptions.sortAscIconCssClass))):(u.classList.add("slick-groupby-sort-asc-icon"),u.classList.remove("slick-groupby-sort-desc-icon")):this._addonOptions.sortDescIconCssClass?(u.classList.remove(..._u(this._addonOptions.sortAscIconCssClass)),u.classList.add(..._u(this._addonOptions.sortDescIconCssClass))):this._addonOptions.sortDescIconCssClass||(u.classList.add("slick-groupby-sort-desc-icon"),u.classList.remove("slick-groupby-sort-asc-icon"))}handleGroupByDrop(u,e){var t,r,o;const a=(t=e.getAttribute("data-id"))==null?void 0:t.replace(this._gridUid,"");let i=!0;for(const s of this.columnsGroupBy)s.id===a&&(i=!1);if(i){for(const s of this._gridColumns)if(s.id===a&&s.grouping&&!Qn(s.grouping)){const l=e.querySelector(".slick-column-name"),E=v("div",{id:`${this._gridUid}_${s.id}_entry`,className:"slick-dropped-grouping",dataset:{id:`${s.id}`}});v("div",{className:"slick-dropped-grouping-title",style:{display:"inline-flex"},textContent:l?l.textContent:e.textContent},E);const d=v("div",{className:"slick-groupby-remove"});this._addonOptions.deleteIconCssClass&&d.classList.add(..._u(this._addonOptions.deleteIconCssClass)),this._addonOptions.deleteIconCssClass||d.classList.add("slick-groupby-remove-icon");let c;((r=this._addonOptions)==null?void 0:r.hideGroupSortIcons)!==!0&&s.sortable&&(((o=s.grouping)==null?void 0:o.sortAsc)===void 0&&(s.grouping.sortAsc=!0),c=v("div",{className:"slick-groupby-sort"},E),this.getGroupBySortIcon(c,s.grouping.sortAsc)),E.appendChild(d),E.appendChild(document.createElement("div")),u.appendChild(E),this._groupToggler&&this.columnsGroupBy.length===0&&this.toggleGroupAll(s),this.addColumnGroupBy(s),this.addGroupByRemoveClickHandler(s.id,d,e,E),c&&this.addGroupSortClickHandler(s,c)}this._groupToggler&&this.columnsGroupBy.length>0&&(this._groupToggler.style.display="inline-flex")}}toggleGroupAll({grouping:u},e){var i;const a=(i=this._groupToggler)==null?void 0:i.querySelector(".slick-group-toggle-all-icon");e===!0||u!=null&&u.collapsed?(a==null||a.classList.add("collapsed"),a==null||a.classList.remove("expanded")):(a==null||a.classList.add("expanded"),a==null||a.classList.remove("collapsed"))}removeFromArray(u,e){if(Array.isArray(u)){const a=u.findIndex(i=>i.id===e.id);a>=0&&u.splice(a,1)}return u}removeGroupBy(u,e,a){a.remove();const i=[];this._gridColumns.forEach(t=>i[t.id]=t),this.removeFromArray(this.columnsGroupBy,i[u]),this.columnsGroupBy.length===0&&(this._dropzonePlaceholderElm.style.display="inline-block",this._groupToggler&&(this._groupToggler.style.display="none")),this.updateGroupBy("remove-group")}addDragOverDropzoneListeners(){const u=this._dropzoneElm.querySelector(".slick-draggable-dropzone-placeholder");u&&this._dropzoneElm&&(this._bindingEventService.bind(u,"dragover",e=>e.preventDefault()),this._bindingEventService.bind(u,"dragenter",()=>this._dropzoneElm.classList.add("slick-dropzone-hover")),this._bindingEventService.bind(u,"dragleave",()=>this._dropzoneElm.classList.remove("slick-dropzone-hover")))}setupColumnDropbox(){const u=this._dropzoneElm;this._droppableInstance=uu.create(u,{group:"shared",ghostClass:"slick-droppable-sortitem-hover",draggable:".slick-dropped-grouping",dragoverBubble:!0,onAdd:e=>{var i,t;const a=e.item;(i=a.getAttribute("id"))!=null&&i.replace(this._gridUid,"")&&this.handleGroupByDrop(u,uu.utils.clone(e.item)),(t=a.parentNode)==null||t.removeChild(a)},onUpdate:()=>{var i;const e=((i=this._droppableInstance)==null?void 0:i.toArray())??[],a=[];for(const t of e)for(const r of this.columnsGroupBy)if(r.id===t){a.push(r);break}this.columnsGroupBy=a,this.updateGroupBy("sort-group")}}),this.addDragOverDropzoneListeners(),this._groupToggler&&this._bindingEventService.bind(this._groupToggler,"click",e=>{const a=e.target.classList.contains("slick-group-toggle-all-icon")?e.target:e.currentTarget.querySelector(".slick-group-toggle-all-icon");this.toggleGroupToggler(a,a==null?void 0:a.classList.contains("expanded"))})}toggleGroupToggler(u,e=!0,a=!0){u&&(e===!0?(u.classList.add("collapsed"),u.classList.remove("expanded"),a&&this.dataView.collapseAllGroups()):(u.classList.remove("collapsed"),u.classList.add("expanded"),a&&this.dataView.expandAllGroups()))}updateGroupBy(u){if(this.columnsGroupBy.length===0){this.dataView.setGrouping([]),this._dropzonePlaceholderElm.style.display="inline-block",this.triggerOnGroupChangedEvent({caller:u,groupColumns:[]});return}const e=[];this.columnsGroupBy.forEach(a=>e.push(a.grouping)),this.dataView.setGrouping(e),this._dropzonePlaceholderElm.style.display="none",this.triggerOnGroupChangedEvent({caller:u,groupColumns:e})}triggerOnGroupChangedEvent(u){this._addonOptions&&typeof this._addonOptions.onGroupChanged=="function"&&this._addonOptions.onGroupChanged(new Pu,u),this.onGroupChanged.notify(u)}}class ph extends Yt{constructor(u,e,a){super(u,e,a),this.extensionUtility=u,this.pubSubService=e,this.sharedService=a,this._buttonElms=[],this._defaults={buttonCssClass:"slick-header-button"},this.pluginName="HeaderButtons",this._menuCssPrefix="slick-header-button",this._camelPluginName="headerButtons",this._bindEventService=new vu,this._eventHandler=new Tu,this.init(a.gridOptions.headerButton)}get addonOptions(){return this._addonOptions}set addonOptions(u){this._addonOptions=u}get eventHandler(){return this._eventHandler}get grid(){return this.sharedService.slickGrid}init(u){this._addonOptions={...this._defaults,...u},this._eventHandler.subscribe(this.grid.onHeaderCellRendered,this.handleHeaderCellRendered.bind(this)),this._eventHandler.subscribe(this.grid.onBeforeHeaderCellDestroy,this.handleBeforeHeaderCellDestroy.bind(this)),this.grid.setColumns(this.grid.getColumns())}dispose(){super.dispose(),this._buttonElms.forEach(u=>u.remove())}handleHeaderCellRendered(u,e){var i;const a=e.column;if((i=a.header)!=null&&i.buttons&&Array.isArray(a.header.buttons)){let t=a.header.buttons.length;for(;t--;){const r=a.header.buttons[t],o=this.populateSingleCommandOrOptionItem("command",this.addonOptions,null,r,e,this.handleButtonClick.bind(this));o&&r.handler&&!r.disabled&&this._bindEventService.bind(o,"click",s=>r.handler.call(this,s)),o&&(this._buttonElms.push(o),e.node.appendChild(o))}}}handleBeforeHeaderCellDestroy(u,e){var i,t,r;if((i=e.column.header)!=null&&i.buttons&&((t=this._addonOptions)!=null&&t.buttonCssClass)){const o=(((r=this._addonOptions)==null?void 0:r.buttonCssClass)||"").replace(/(\s+)/g,".");o&&e.node.querySelectorAll(`.${o}`).forEach(s=>s.remove())}}handleButtonClick(u,e,a,i,t){var r;if(a.command&&!a.disabled){const o=a.command||"",s={grid:this.grid,column:t,button:a};o&&(s.command=o),typeof a.action=="function"&&!a.disabled&&a.action.call(this,u,s),o!==null&&!a.disabled&&((r=this._addonOptions)!=null&&r.onCommand)&&(this.pubSubService.publish("onHeaderButtonCommand",s),this._addonOptions.onCommand(u,s),t!=null&&t.id&&this.grid.updateColumnHeader(t.id))}u.preventDefault(),u.stopPropagation()}}class Fh extends Yt{constructor(u,e,a,i,t){super(u,a,i),this.extensionUtility=u,this.filterService=e,this.pubSubService=a,this.sharedService=i,this.sortService=t,this._subMenuParentId="",this._defaults={autoAlign:!0,autoAlignOffset:0,buttonCssClass:null,buttonImage:null,minWidth:100,hideColumnHideCommand:!1,hideSortCommands:!1,title:"",subMenuOpenByEvent:"mouseover"},this.pluginName="HeaderMenu",this._menuCssPrefix="slick-menu",this._menuPluginCssPrefix="slick-header-menu",this._camelPluginName="headerMenu",this.sharedService.gridOptions.headerMenu=this.addHeaderMenuCustomCommands(this.sharedService.columnDefinitions),this.init(i.gridOptions.headerMenu)}init(u){this._addonOptions={...this._defaults,...u},this._eventHandler.subscribe(this.grid.onBeforeSetColumns,(e,a)=>{this.sharedService.gridOptions.headerMenu=this.addHeaderMenuCustomCommands(a.newColumns)}),this._eventHandler.subscribe(this.grid.onHeaderCellRendered,this.handleHeaderCellRendered.bind(this)),this._eventHandler.subscribe(this.grid.onBeforeHeaderCellDestroy,this.handleBeforeHeaderCellDestroy.bind(this)),this._eventHandler.subscribe(this.grid.onClick,this.hideMenu.bind(this)),this.grid.setColumns(this.grid.getColumns()),this._bindEventService.bind(document.body,"mousedown",this.handleBodyMouseDown.bind(this))}dispose(){var u;super.dispose(),this._menuElm=this._menuElm||document.body.querySelector(`.slick-header-menu${this.gridUidSelector}`),(u=this._menuElm)==null||u.remove(),this._activeHeaderColumnElm=void 0}hideColumn(u){var e,a;if((a=(e=this.sharedService)==null?void 0:e.slickGrid)!=null&&a.getColumnIndex){const i=this.sharedService.slickGrid.getColumnIndex(u.id),t=this.sharedService.slickGrid.getColumns(),r=this.sharedService.gridOptions.frozenColumn??-1;r>=0&&r>=i&&(this.sharedService.gridOptions.frozenColumn=r-1,this.sharedService.slickGrid.setOptions({frozenColumn:this.sharedService.gridOptions.frozenColumn}));const o=_r(t,i);this.sharedService.visibleColumns=o,this.sharedService.slickGrid.setColumns(o),this.pubSubService.publish("onHeaderMenuHideColumns",{columns:o,hiddenColumn:u})}}hideMenu(){var u;this.disposeSubMenus(),(u=this._menuElm)==null||u.remove(),this._menuElm=void 0}repositionSubMenu(u,e,a,i){const t=this.createCommandMenu(e.commandItems||[],i,a+1,e);document.body.appendChild(t),this.repositionMenu(u,t)}repositionMenu(u,e){var c,D;const a=u.target,i=e.classList.contains("slick-submenu"),t=i?u.target.closest(".slick-menu-item"):a,r=Il(this.sharedService.gridContainerElement,a),o=this.grid.getGridPosition(),s=e.offsetWidth,l=Iu(t);let E=i?(l==null?void 0:l.left)??0:(r==null?void 0:r.left)??0,d=i?(l==null?void 0:l.top)??0:((r==null?void 0:r.top)??0)+(((c=this.addonOptions)==null?void 0:c.menuOffsetTop)??0)+a.clientHeight;if(i){const m=(e==null?void 0:e.clientHeight)||0,{bottom:h,top:x}=bi(t);(hh?"top":"bottom")==="top"?(e.classList.remove("dropdown"),e.classList.add("dropup"),d-=m-t.clientHeight):(e.classList.remove("dropup"),e.classList.add("dropdown"))}if(i&&t){const m=E+Number(s)+t.clientWidth,h=document.documentElement.clientWidth;(m>=o.width||m>=h?"left":"right")==="left"?(e.classList.remove("dropright"),e.classList.add("dropleft"),E-=s):(e.classList.remove("dropleft"),e.classList.add("dropright"),E+=t.offsetWidth)}else E=(r==null?void 0:r.left)??0,this.addonOptions.autoAlign&&(o!=null&&o.width)&&E+(e.clientWidth??0)>=o.width&&(E=E+a.clientWidth-e.clientWidth+(((D=this.addonOptions)==null?void 0:D.autoAlignOffset)||0));e.style.top=`${d}px`,e.style.left=`${E}px`}translateHeaderMenu(){var u;(u=this.sharedService.gridOptions)!=null&&u.headerMenu&&this.resetHeaderMenuTranslations(this.sharedService.visibleColumns)}handleHeaderCellRendered(u,e){var t;const i=(t=e.column.header)==null?void 0:t.menu;if(i&&e.node){if(!this.extensionUtility.runOverrideFunctionWhenExists(this.addonOptions.menuUsabilityOverride,e))return;const r=v("div",{className:"slick-header-menu-button",ariaLabel:"Header Menu"},e.node);this.addonOptions.buttonCssClass&&r.classList.add(..._u(this.addonOptions.buttonCssClass)),this.addonOptions.tooltip&&(r.title=this.addonOptions.tooltip),this._bindEventService.bind(r,"click",o=>{this.disposeAllMenus(),this.createParentMenu(o,e.column,i)})}}handleBeforeHeaderCellDestroy(u,e){var i;(i=e.column.header)!=null&&i.menu&&e.node.querySelectorAll(".slick-header-menu-button").forEach(t=>t.remove())}handleBodyMouseDown(u){if(this.menuElement){let e=!1;const a=u.target.closest(`.${this.menuCssClass}`);(this.menuElement.contains(u.target)||a)&&(e=!0),(this._menuElm!==u.target&&!e&&!u.defaultPrevented||u.target.className==="close"&&a)&&this.hideMenu()}}handleMenuItemCommandClick(u,e,a,i=0,t){var r;if(a!=="divider"&&!a.disabled&&!a.divider)if((a.command||"")&&!a.commandItems){const s={grid:this.grid,command:a.command,column:t,item:a};this.executeHeaderMenuInternalCommands(u,s),this.pubSubService.publish("onHeaderMenuCommand",s),typeof((r=this.addonOptions)==null?void 0:r.onCommand)=="function"&&this.addonOptions.onCommand(u,s),typeof a.action=="function"&&a.action.call(this,u,s),u.defaultPrevented||this.hideMenu(),u.preventDefault(),u.stopPropagation()}else a.commandItems&&this.repositionSubMenu(u,a,i,t)}handleMenuItemMouseOver(u,e,a,i=0,t){a!=="divider"&&!a.disabled&&!a.divider&&(a.commandItems?this.repositionSubMenu(u,a,i,t):i===0&&this.disposeSubMenus())}addHeaderMenuCustomCommands(u){const e=this.sharedService.gridOptions,a=e.headerMenu||{},i=X0(e);return Array.isArray(u)&&e.enableHeaderMenu&&u.forEach(t=>{var r,o;if(t&&!t.excludeFromHeaderMenu){t.header?t.header.menu||(t.header.menu={commandItems:[]}):t.header={menu:{commandItems:[]}};const s=((o=(r=t==null?void 0:t.header)==null?void 0:r.menu)==null?void 0:o.commandItems)??[];let l=!1;a&&!a.hideFreezeColumnsCommand&&(l=!0,s.some(E=>E!=="divider"&&(E==null?void 0:E.command)==="freeze-columns")||s.push({iconCssClass:a.iconFreezeColumns||"mdi mdi-pin-outline",titleKey:`${i}FREEZE_COLUMNS`,command:"freeze-columns",positionOrder:47})),a&&!a.hideColumnResizeByContentCommand&&this.sharedService.gridOptions.enableColumnResizeOnDoubleClick&&(l=!0,s.some(E=>E!=="divider"&&(E==null?void 0:E.command)==="column-resize-by-content")||s.push({iconCssClass:a.iconColumnResizeByContentCommand||"mdi mdi-arrow-expand-horizontal",titleKey:`${i}COLUMN_RESIZE_BY_CONTENT`,command:"column-resize-by-content",positionOrder:48})),l&&!s.some(E=>E!=="divider"&&E.positionOrder===49)&&s.push({divider:!0,command:"",positionOrder:49}),e.enableSorting&&t.sortable&&a&&!a.hideSortCommands&&(s.some(E=>E!=="divider"&&(E==null?void 0:E.command)==="sort-asc")||s.push({iconCssClass:a.iconSortAscCommand||"mdi mdi-sort-ascending",titleKey:`${i}SORT_ASCENDING`,command:"sort-asc",positionOrder:50}),s.some(E=>E!=="divider"&&(E==null?void 0:E.command)==="sort-desc")||s.push({iconCssClass:a.iconSortDescCommand||"mdi mdi-sort-descending",titleKey:`${i}SORT_DESCENDING`,command:"sort-desc",positionOrder:51}),s.some(E=>E!=="divider"&&E.positionOrder===52)||s.push({divider:!0,command:"",positionOrder:52}),!a.hideClearSortCommand&&!s.some(E=>E!=="divider"&&(E==null?void 0:E.command)==="clear-sort")&&s.push({iconCssClass:a.iconClearSortCommand||"mdi mdi-sort-variant-off",titleKey:`${i}REMOVE_SORT`,command:"clear-sort",positionOrder:54})),e.enableFiltering&&t.filterable&&a&&!a.hideFilterCommand&&!a.hideClearFilterCommand&&!s.some(E=>E!=="divider"&&(E==null?void 0:E.command)==="clear-filter")&&s.push({iconCssClass:a.iconClearFilterCommand||"mdi mdi-filter-remove-outline",titleKey:`${i}REMOVE_FILTER`,command:"clear-filter",positionOrder:53}),a&&!a.hideColumnHideCommand&&!s.some(E=>E!=="divider"&&(E==null?void 0:E.command)==="hide-column")&&s.push({iconCssClass:a.iconColumnHideCommand||"mdi mdi-close",titleKey:`${i}HIDE_COLUMN`,command:"hide-column",positionOrder:55}),this.extensionUtility.translateMenuItemsFromTitleKey(s),this.extensionUtility.sortItems(s,"positionOrder")}}),a}clearColumnFilter(u,e){e!=null&&e.column&&this.filterService.clearFilterByColumnId(u,e.column.id)}clearColumnSort(u,e){e!=null&&e.column&&this.sharedService&&this.sortService.clearSortByColumnId(u,e.column.id)}executeHeaderMenuInternalCommands(u,e){var a;if(e!=null&&e.command)switch(e.command){case"hide-column":this.hideColumn(e.column),(a=this.sharedService.gridOptions)!=null&&a.enableAutoSizeColumns&&this.sharedService.slickGrid.autosizeColumns();break;case"clear-filter":this.clearColumnFilter(u,e);break;case"clear-sort":this.clearColumnSort(u,e);break;case"column-resize-by-content":this.pubSubService.publish("onHeaderMenuColumnResizeByContent",{columnId:e.column.id});break;case"freeze-columns":const i=[...this.sharedService.visibleColumns],r={frozenColumn:i.findIndex(E=>E.id===e.column.id),enableMouseWheelScrollHandler:!0},o=this.sharedService.slickGrid.getColumns();this.sharedService.slickGrid.setOptions(r,!1,!0),this.sharedService.gridOptions.frozenColumn=r.frozenColumn,this.sharedService.gridOptions.enableMouseWheelScrollHandler=r.enableMouseWheelScrollHandler,this.sharedService.frozenVisibleColumnId=e.column.id,this.sharedService.hasColumnsReordered||Array.isArray(i)&&Array.isArray(this.sharedService.allColumns)&&i.length!==this.sharedService.allColumns.length?this.sharedService.slickGrid.setColumns(i):this.sharedService.slickGrid.setColumns(o),this.sharedService.slickGrid.getOptions().enableAutoSizeColumns&&this.sharedService.slickGrid.autosizeColumns();break;case"sort-asc":case"sort-desc":const l=e.command==="sort-asc";this.sortColumn(u,e,l);break}}createParentMenu(u,e,a){var t,r,o,s,l;const i={grid:this.grid,column:e,menu:a};typeof u.stopPropagation=="function"&&(this.pubSubService.publish("onHeaderMenuBeforeMenuShow",i),typeof((t=this.addonOptions)==null?void 0:t.onBeforeMenuShow)=="function"&&((r=this.addonOptions)==null?void 0:r.onBeforeMenuShow(u,i))===!1)||(this._menuElm=this.createCommandMenu(a.commandItems,e),(o=this.grid.getContainerNode())==null||o.appendChild(this._menuElm),this.repositionMenu(u,this._menuElm),this.pubSubService.publish("onHeaderMenuAfterMenuShow",i),!(typeof((s=this.addonOptions)==null?void 0:s.onAfterMenuShow)=="function"&&((l=this.addonOptions)==null?void 0:l.onAfterMenuShow(u,i))===!1)&&(u.preventDefault(),u.stopPropagation()))}createCommandMenu(u,e,a=0,i){const t=i==null?void 0:i.command;let r=a===1&&t?t.replace(/\s/g,""):"";r&&(this._subMenuParentId=r),a>1&&(r=this._subMenuParentId);const o=`${this.menuCssClass} slick-menu-level-${a} ${this.gridUid}`,s=document.body.querySelector(`.${this.menuCssClass}.slick-menu-level-${a}${this.gridUidSelector}`);if(s){if(s.dataset.subMenuParent===r)return s;this.disposeSubMenus()}const l=v("div",{ariaExpanded:"true",ariaLabel:a>1?"SubMenu":"Header Menu",role:"menu",className:o,style:{minWidth:`${this.addonOptions.minWidth}px`}});a>0&&(l.classList.add("slick-submenu"),r&&(l.dataset.subMenuParent=r));const E=v("div",{className:`${this._menuCssPrefix}-command-list`,role:"menu"},l),d={grid:this.grid,column:e,level:a,menu:{commandItems:u}};return i&&a>0&&this.addSubMenuTitleWhenExists(i,E),this.populateCommandOrOptionItems("command",this.addonOptions,E,u,d,this.handleMenuItemCommandClick,this.handleMenuItemMouseOver),a++,l}resetHeaderMenuTranslations(u){u.forEach(e=>{var a,i;if((i=(a=e==null?void 0:e.header)==null?void 0:a.menu)!=null&&i.commandItems&&!e.excludeFromHeaderMenu){const t=e.header.menu.commandItems||[];this.extensionUtility.translateMenuItemsFromTitleKey(t)}})}sortColumn(u,e,a=!0){if(e!=null&&e.column){const i=e.column,t=this.sharedService.gridOptions.multiColumnSort?this.sortService.getCurrentColumnSorts(i.id+""):[];let r=Hu.local;t.push({columnId:i.id,sortCol:i,sortAsc:a}),this.sharedService.gridOptions.backendServiceApi?(this.sortService.onBackendSortChanged(u,{multiColumnSort:!0,sortCols:t,grid:this.sharedService.slickGrid}),r=Hu.remote):this.sharedService.dataView?(this.sortService.onLocalSortChanged(this.sharedService.slickGrid,t),r=Hu.local):e.grid.onSort.notify(t);const o=t.map(s=>{var l;return{columnId:((l=s==null?void 0:s.sortCol)==null?void 0:l.id)??"",sortAsc:(s==null?void 0:s.sortAsc)??!0}});if(this.sharedService.slickGrid.setSortColumns(o),r){const s=[];o.forEach(l=>{s.push({columnId:`${l.columnId}`,direction:l.sortAsc?"ASC":"DESC"})}),this.sortService.emitSortChanged(r,s)}}}}const Hi="slick-rbe-editmode",kh="slick-rbe-unsaved-cell",Ls="slick-rbe-unsaved-highlight",yn="action-btns--delete",zn="action-btns--edit",Sn="action-btns--update",wn="action-btns--cancel";class Ns{constructor(u,e,a){this.extensionUtility=u,this.pubSubService=e,this.pluginName="RowBasedEdit",this._defaults={actionsColumnLabel:"Actions",allowMultipleRows:!1,columnId:"_slick_rowbasededit_action",columnIndexPosition:-1,reorderable:!1},this._editedRows=new Map,this._currentLang="en",this._translations={},this.onBeforeEditCellHandler=(i,t)=>{var r;return this._editedRows.has((r=t.item)==null?void 0:r[this.gridOptions.datasetIdPropertyName??"id"])},this._eventHandler=new Tu,this._addonOptions=a}get addonOptions(){return this._addonOptions}get gridOptions(){return this._grid.getOptions()||{}}get eventHandler(){return this._eventHandler}init(u,e){var t,r;this._grid=u,this._gridService=e,this._addonOptions={...this._defaults,...this.addonOptions};const a=this._grid.getData();if(this._eventHandler.subscribe(this._grid.onBeforeEditCell,this.onBeforeEditCellHandler),this.checkOptionsRequirements(this.gridOptions),this.gridOptions.autoEdit||(this._grid.setOptions({autoEdit:!0}),console.warn('[Slickgrid-Universal] The Row Based Edit Plugin works best with the gridOption "autoEdit" enabled, the option has now been set automatically for you.')),this._existingEditCommandHandler=this.gridOptions.editCommandHandler,this._grid.setOptions({editCommandHandler:this.rowBasedEditCommandHandler.bind(this)}),this.gridOptions.enableExcelCopyBuffer===!0){const o=(t=this.gridOptions.excelCopyBufferOptions)==null?void 0:t.onBeforePasteCell;this._grid.setOptions({excelCopyBufferOptions:{...this.gridOptions.excelCopyBufferOptions,onBeforePasteCell:(s,l)=>{let E=!0;if(o&&(E=o(s,l),E===!1))return!1;const d=a.getItem(l.row),c=this.gridOptions.datasetIdPropertyName??"id";return!!(this._editedRows.has(d[c])&&E===!0)}}})}const i=a.getItemMetadata;a.getItemMetadata=this.updateItemMetadata((r=i==null?void 0:i.bind)==null?void 0:r.call(i,a)),this._eventHandler.subscribe(this._grid.onSetOptions,this.optionsUpdatedHandler.bind(this)),this._eventHandler.subscribe(a.onRowsOrCountChanged,this.handleAllRowRerender.bind(this)),this.translate()}destroy(){this.dispose()}dispose(){var u,e;(u=this._eventHandler)==null||u.unsubscribeAll(),(e=this.pubSubService)==null||e.unsubscribeAll()}create(u,e){var a;if(this._addonOptions={...this._defaults,...e.rowBasedEditOptions},Array.isArray(u)&&e){const i=this.getColumnDefinition();if(!u.some(t=>t.id===i.id)){const t=((a=e==null?void 0:e.rowBasedEditOptions)==null?void 0:a.columnIndexPosition)??-1;t===-1?u.push(i):t>0&&tc.editor!==void 0),o=[],s=this.gridOptions.datasetIdPropertyName??"id";i.forEach((c,D)=>{const m=i[D],h=t[D];if(m!==h||h===""){const x=Array.isArray(a.prevSerializedValue)?r==null?void 0:r[D]:e;if(!x)return;this._grid.invalidate(),a.execute(),this.renderUnsavedCellStyling(u[s],x),o.push(x)}});const l=this._editedRows.get(u[s]),E=[...(l==null?void 0:l.editCommands)||[]];o.length>0&&E.push(a),this._editedRows.set(u[s],{columns:[...(l==null?void 0:l.columns)||[],...o],editCommands:E,cssStyleKeys:(l==null?void 0:l.cssStyleKeys)||[]})}translate(u=!1){var e;return this._currentLang=((e=this.extensionUtility.translaterService)==null?void 0:e.getCurrentLanguage())??"en",(!this._translations[this._currentLang]||u)&&(this._translations[this._currentLang]={btnUpdateTitle:this.getTitleOrDefault("updateButtonTitle","Update the row"),btnEditTitle:this.getTitleOrDefault("editButtonTitle","Edit the Row"),btnDeleteTitle:this.getTitleOrDefault("deleteButtonTitle","Delete the Row"),btnCancelTitle:this.getTitleOrDefault("cancelButtonTitle","Cancel changes of the Row")}),this._translations[this._currentLang]}checkOptionsRequirements(u){if(!(u!=null&&u.enableCellNavigation))throw new Error("[Slickgrid-Universal] Row Based Edit Plugin requires the gridOption cell navigation (enableCellNavigation = true)");if(!(u!=null&&u.editable))throw new Error("[Slickgrid-Universal] Row Based Edit Plugin requires the gridOption editable (editable = true)")}undoRowEdit(u){const e=this.gridOptions.datasetIdPropertyName??"id",a=this._editedRows.get(u[e]),i=this._grid.getData().getRowByItem(u);if(i!==void 0&&(a!=null&&a.editCommands)&&a.editCommands.length||Y0.cancelCurrentEdit()){for(;a.editCommands.length>0;){const t=a.editCommands.pop();t&&t.undo()}a.columns.forEach(t=>{this.removeUnsavedStylingFromCell(t,i)}),a.columns=[],this._grid.invalidate()}}renderUnsavedCellStyling(u,e){var a,i;if(e){const t=(a=this._grid.getData())==null?void 0:a.getRowById(u);if(t!==void 0&&t>=0){const r={[t]:{[e.id]:kh}},o=`${Ls}_${[e.id]}${t}`;this._grid.setCellCssStyles(o,r),(i=this._editedRows.get(u))==null||i.cssStyleKeys.push(o)}}}handleAllRowRerender(u,e){this._editedRows.forEach((a,i)=>{a.cssStyleKeys.forEach(t=>{this._grid.removeCellCssStyles(t)}),a.cssStyleKeys=[],a.columns.forEach(t=>{this.renderUnsavedCellStyling(i,t)})})}removeUnsavedStylingFromCell(u,e){const a=`${Ls}_${[u.id]}${e}`;this._grid.removeCellCssStyles(a)}removeUnsavedStylingFromRow(u){this._grid.getColumns().forEach(e=>{this.removeUnsavedStylingFromCell(e,u)})}optionsUpdatedHandler(u,e){this._addonOptions={...this._defaults,...e.optionsAfter.rowBasedEditOptions}}async onCellClickHandler(u,e){var o,s,l,E,d,c,D,m,h,x,g,F,C,A,b;const a=e.dataContext,i=u.target,t=this.gridOptions.datasetIdPropertyName??"id",r=this._editedRows.get(a[t]);if((i.classList.contains(yn)||(o=i.parentElement)!=null&&o.classList.contains(yn))&&this._gridService){if((l=(s=this._addonOptions)==null?void 0:s.actionButtons)!=null&&l.deleteButtonPrompt&&!window.confirm(this._addonOptions.actionButtons.deleteButtonPrompt))return;this.toggleEditmode(a,!1),this._gridService.deleteItem(a)}else if(i.classList.contains(zn)||(E=i.parentElement)!=null&&E.classList.contains(zn)){if(!((d=this._addonOptions)!=null&&d.allowMultipleRows)&&this._editedRows.size>0)return;typeof((c=this._addonOptions)==null?void 0:c.onBeforeEditMode)=="function"&&this._addonOptions.onBeforeEditMode(e),this.toggleEditmode(a,!0)}else if(i.classList.contains(Sn)||(D=i.parentElement)!=null&&D.classList.contains(Sn)){if((h=(m=this._addonOptions)==null?void 0:m.actionButtons)!=null&&h.updateButtonPrompt&&((r==null?void 0:r.editCommands.length)||0)>0&&!window.confirm(this._addonOptions.actionButtons.updateButtonPrompt)||(this._grid.getCellEditor()&&((x=this._grid.getActiveCell())==null?void 0:x.row)===e.row&&((g=this._grid.getEditController())==null||g.commitCurrentEdit()),(F=this._addonOptions)!=null&&F.onBeforeRowUpdated&&await this._addonOptions.onBeforeRowUpdated(e)!==!0))return;this.removeUnsavedStylingFromRow(e.row),this.toggleEditmode(a,!1)}else if(i.classList.contains(wn)||(C=i.parentElement)!=null&&C.classList.contains(wn)){if((b=(A=this._addonOptions)==null?void 0:A.actionButtons)!=null&&b.cancelButtonPrompt&&((r==null?void 0:r.editCommands.length)||0)>0&&!window.confirm(this._addonOptions.actionButtons.cancelButtonPrompt))return;this.undoRowEdit(a),this.toggleEditmode(a,!1)}}actionColumnFormatter(u,e,a,i,t){var E,d,c,D,m,h,x,g,F,C,A,b,B,S,z,M;const r=this.gridOptions,o=this._editedRows.has(t==null?void 0:t[r.datasetIdPropertyName??"id"]),s=this._translations[this._currentLang]??this.translate(),l=document.createDocumentFragment();return l.appendChild(v("span",{className:`${((d=(E=r.rowBasedEditOptions)==null?void 0:E.actionButtons)==null?void 0:d.editButtonClassName)||"button-style padding-1px mr-2"} action-btns `+zn,title:s.btnEditTitle,style:{display:o?"none":""}})).appendChild(v("span",{className:((D=(c=r.rowBasedEditOptions)==null?void 0:c.actionButtons)==null?void 0:D.iconEditButtonClassName)||"mdi mdi-table-edit text-color-primary"})),l.appendChild(v("span",{className:`${((h=(m=r.rowBasedEditOptions)==null?void 0:m.actionButtons)==null?void 0:h.deleteButtonClassName)||"button-style padding-1px"} action-btns `+yn,title:s.btnDeleteTitle,style:{display:o?"none":""}})).appendChild(v("span",{className:((g=(x=r.rowBasedEditOptions)==null?void 0:x.actionButtons)==null?void 0:g.iconDeleteButtonClassName)||"mdi mdi-close text-color-danger"})),l.appendChild(v("span",{className:`${((C=(F=r.rowBasedEditOptions)==null?void 0:F.actionButtons)==null?void 0:C.updateButtonClassName)||"button-style padding-1px mr-2"} action-btns `+Sn,title:s.btnUpdateTitle,style:{display:o?"":"none"}})).appendChild(v("span",{className:((b=(A=r.rowBasedEditOptions)==null?void 0:A.actionButtons)==null?void 0:b.iconUpdateButtonClassName)||"mdi mdi-check-bold text-color-success"})),l.appendChild(v("span",{className:`${((S=(B=r.rowBasedEditOptions)==null?void 0:B.actionButtons)==null?void 0:S.cancelButtonClassName)||"button-style padding-1px"} action-btns `+wn,title:s.btnCancelTitle,style:{display:o?"":"none"}})).appendChild(v("span",{className:((M=(z=r.rowBasedEditOptions)==null?void 0:z.actionButtons)==null?void 0:M.iconCancelButtonClassName)||"mdi mdi-cancel text-color-danger"})),l}toggleEditmode(u,e){const a=this.gridOptions.datasetIdPropertyName??"id";e?this._editedRows.set(u[a],{columns:[],editCommands:[],cssStyleKeys:[]}):this._editedRows.delete(u[a]),this._grid.invalidate()}updateItemMetadata(u){return e=>{const a=this._grid.getData().getItem(e);let i={cssClasses:""};if(typeof u=="function"){const t=u(e);t&&(i=t)}if(i&&a){const t=this.gridOptions.datasetIdPropertyName??"id";this._editedRows.has(a[t])&&!i.cssClasses.includes(Hi)?i.cssClasses=(i.cssClasses||"")+" "+Hi:!this._editedRows.has(a[t])&&i.cssClasses.includes(Hi)&&(i.cssClasses=i.cssClasses.replace(Hi,""))}return i}}getTitleOrDefault(u,e){var i,t,r;const a=(i=this.gridOptions.rowBasedEditOptions)==null?void 0:i.actionButtons;return(a==null?void 0:a[u+"Key"])&&((r=(t=this.extensionUtility.translaterService)==null?void 0:t.translate)==null?void 0:r.call(t,(a==null?void 0:a[u+"Key"])||""))||(a==null?void 0:a[u])||e}}class Rs{constructor(u){this.pubSubService=u,this.onBeforeMoveRows=new R("onBeforeMoveRows"),this.onMoveRows=new R("onMoveRows"),this.pluginName="RowMoveManager",this._dragging=!1,this._defaults={autoScroll:!0,columnId:"_move",cssClass:"slick-row-move-column",cancelEditOnDrag:!1,disableRowSelection:!1,hideRowMoveShadow:!0,reorderable:!1,rowMoveShadowMarginTop:0,rowMoveShadowMarginLeft:0,rowMoveShadowOpacity:.9,rowMoveShadowScale:.75,singleRowMove:!1,width:40},this._eventHandler=new Tu}get addonOptions(){return this._addonOptions}get eventHandler(){return this._eventHandler}get gridOptions(){var u;return((u=this._grid)==null?void 0:u.getOptions())??{}}init(u,e){var a;this._addonOptions={...this._defaults,...e},this._grid=u,this._canvas=this._grid.getCanvasNode(),y.addSlickEventPubSubWhenDefined(this.pubSubService,this),typeof((a=this._addonOptions)==null?void 0:a.usabilityOverride)=="function"&&this.usabilityOverride(this._addonOptions.usabilityOverride),this._eventHandler.subscribe(this._grid.onDragInit,this.handleDragInit.bind(this)).subscribe(this._grid.onDragStart,this.handleDragStart.bind(this)).subscribe(this._grid.onDrag,this.handleDrag.bind(this)).subscribe(this._grid.onDragEnd,this.handleDragEnd.bind(this))}dispose(){var u;(u=this._eventHandler)==null||u.unsubscribeAll()}create(u,e){var a;if(this._addonOptions={...this._defaults,...e.rowMoveManager},Array.isArray(u)&&e){const i=this.getColumnDefinition();if(!u.some(t=>t.id===i.id)){const t=Array.isArray(u)&&u.find(s=>(s==null?void 0:s.behavior)==="selectAndMove"),r=t||i,o=((a=e==null?void 0:e.rowMoveManager)==null?void 0:a.columnIndexPosition)??0;o>0?u.splice(o,0,r):u.unshift(r),this.pubSubService.publish("onPluginColumnsChanged",{columns:u,pluginName:this.pluginName})}}return this}getColumnDefinition(){var e;const u=String(((e=this._addonOptions)==null?void 0:e.columnId)??this._defaults.columnId);return{id:u,name:"",behavior:"selectAndMove",excludeFromExport:!0,excludeFromColumnPicker:!0,excludeFromGridMenu:!0,excludeFromQuery:!0,excludeFromHeaderMenu:!0,field:u,reorderable:this._addonOptions.reorderable,resizable:!1,width:this._addonOptions.width||40,formatter:this.moveIconFormatter.bind(this)}}usabilityOverride(u){this._usabilityOverride=u}setOptions(u){this._addonOptions={...this._addonOptions,...u}}handleDragInit(u){u.stopImmediatePropagation()}handleDragEnd(u,e){var a,i,t;if(this._dragging&&(this._dragging=!1,u.stopImmediatePropagation(),(a=e.guide)==null||a.remove(),(i=e.selectionProxy)==null||i.remove(),(t=e.clonedSlickRow)==null||t.remove(),e.canMove)){const r={grid:this._grid,rows:e.selectedRows,insertBefore:e.insertBefore};typeof this._addonOptions.onMoveRows=="function"&&this._addonOptions.onMoveRows(u instanceof Pu?u.getNativeEvent():u,r),this.onMoveRows.notify(r)}}handleDrag(u,e){var a,i,t,r;if(this._dragging){u.stopImmediatePropagation();const o=u.getNativeEvent(),l=(((a=o==null?void 0:o.touches)==null?void 0:a[0])??o).pageY-(((i=Iu(this._canvas))==null?void 0:i.top)??0);e.selectionProxy.style.top=`${l-5}px`,e.selectionProxy.style.display="block",e.clonedSlickRow&&(e.clonedSlickRow.style.top=`${l-6}px`,e.clonedSlickRow.style.display="block");const E=Math.max(0,Math.min(Math.round(l/(this.gridOptions.rowHeight||0)),this._grid.getDataLength()));if(E!==e.insertBefore){const d={grid:this._grid,rows:e.selectedRows,insertBefore:E};if(((r=(t=this._addonOptions)==null?void 0:t.onBeforeMoveRows)==null?void 0:r.call(t,o,d))===!1||this.onBeforeMoveRows.notify(d).getReturnValue()===!1?e.canMove=!1:e.canMove=!0,this._usabilityOverride&&e.canMove){const c=this._grid.getDataItem(E);e.canMove=this.checkUsabilityOverride(E,c,this._grid)}e.canMove?e.guide.style.top=`${E*(this.gridOptions.rowHeight||0)}px`:e.guide.style.top="-1000px",e.insertBefore=E}}}handleDragStart(u,e){var r,o,s,l,E;const a=this._grid.getCellFromEvent(u)||{cell:-1,row:-1},i=a.row,t=this._grid.getDataItem(i);if(this.checkUsabilityOverride(i,t,this._grid)){if(this._addonOptions.cancelEditOnDrag&&this._grid.getEditorLock().isActive()&&this._grid.getEditorLock().cancelCurrentEdit(),this._grid.getEditorLock().isActive()||!/move|selectAndMove/.test(this._grid.getColumns()[a.cell].behavior||""))return!1;if(this._dragging=!0,u.stopImmediatePropagation(),!this.addonOptions.hideRowMoveShadow){const D=(r=this._grid.getCellNode(a.row,a.cell))==null?void 0:r.closest(".slick-row");D&&(e.clonedSlickRow=D.cloneNode(!0),e.clonedSlickRow.classList.add("slick-reorder-shadow-row"),e.clonedSlickRow.style.display="none",e.clonedSlickRow.style.marginLeft=be((o=this._addonOptions)==null?void 0:o.rowMoveShadowMarginLeft,"0px"),e.clonedSlickRow.style.marginTop=be((s=this._addonOptions)==null?void 0:s.rowMoveShadowMarginTop,"0px"),e.clonedSlickRow.style.opacity=`${((l=this._addonOptions)==null?void 0:l.rowMoveShadowOpacity)??.95}`,e.clonedSlickRow.style.transform=`scale(${((E=this.addonOptions)==null?void 0:E.rowMoveShadowScale)??.75})`,this._canvas.appendChild(e.clonedSlickRow))}let d=this._addonOptions.singleRowMove?[a.row]:this._grid.getSelectedRows();(d.length===0||!d.some(D=>D===a.row))&&(d=[a.row],this._addonOptions.disableRowSelection||this._grid.setSelectedRows(d));const c=this.gridOptions.rowHeight;e.selectedRows=d,e.selectionProxy=v("div",{className:"slick-reorder-proxy",style:{display:"none",position:"absolute",zIndex:"99999",width:`${this._canvas.clientWidth}px`,height:`${c*d.length}px`}},this._canvas),e.guide=v("div",{className:"slick-reorder-guide",style:{position:"absolute",zIndex:"99999",width:`${this._canvas.clientWidth}px`,top:"-1000px"}},this._canvas),e.insertBefore=-1}}checkUsabilityOverride(u,e,a){return typeof this._usabilityOverride=="function"?this._usabilityOverride(u,e,a):!0}moveIconFormatter(u,e,a,i,t,r){return this.checkUsabilityOverride(u,t,r)?{addClasses:"cell-reorder dnd",html:v("div",{className:this._addonOptions.cssClass||""})}:""}}class vh{get extensionList(){return this._extensionList}get gridOptions(){return this.sharedService.gridOptions||{}}constructor(u,e,a,i,t,r,o,s){this.extensionUtility=u,this.filterService=e,this.pubSubService=a,this.sharedService=i,this.sortService=t,this.treeDataService=r,this.translaterService=o,this.lazyGridService=s,this._extensionCreatedList={},this._extensionList={}}dispose(){if(this.sharedService.visibleColumns=[],typeof this._extensionList=="object"){const u=Object.keys(this._extensionList);u.forEach(e=>{var a;if(this._extensionList.hasOwnProperty(e)){const i=this._extensionList[e];typeof((a=i==null?void 0:i.instance)==null?void 0:a.dispose)=="function"&&i.instance.dispose()}}),u.forEach(e=>{delete this._extensionList[e]})}this._cellMenuPlugin=null,this._cellExcelCopyManagerPlugin=null,this._checkboxSelectColumn=null,this._contextMenuPlugin=null,this._columnPickerControl=null,this._draggleGroupingPlugin=null,this._gridMenuControl=null,this._groupItemMetadataProviderService=null,this._headerMenuPlugin=null,this._rowMoveManagerPlugin=null,this._rowSelectionModel=null,this._extensionCreatedList=null,this._extensionList={}}addExtensionToList(u,e){this._extensionList[u]=e}getAllColumns(){return this.sharedService.allColumns||[]}getVisibleColumns(){return this.sharedService.visibleColumns||[]}getCreatedExtensionByName(u){var e;if((e=this._extensionCreatedList)!=null&&e.hasOwnProperty(u))return this._extensionCreatedList[u]}getExtensionByName(u){var e;return(e=this._extensionList)==null?void 0:e[u]}getExtensionInstanceByName(u){var e;return(e=this.getExtensionByName(u))==null?void 0:e.instance}autoResizeColumns(){this.sharedService.slickGrid.autosizeColumns()}bindDifferentExtensions(){var u,e,a,i,t,r,o,s,l,E,d,c,D;if(this.gridOptions){if(this.gridOptions.enableTranslate&&this.translateItems(this.sharedService.allColumns,"nameKey","name"),this.gridOptions.enableRowBasedEdit){this._rowBasedEdit=this._rowBasedEdit||new Ns(this.extensionUtility,this.pubSubService,this.gridOptions.rowBasedEditOptions);const m=(u=this.lazyGridService)==null?void 0:u.call(this);if(!m)throw new Error("[Slickgrid-Universal] the RowBasedEdit Plugin requires a GridService to be configured and available");this._rowBasedEdit.init(this.sharedService.slickGrid,m),(e=this.gridOptions.rowBasedEditOptions)!=null&&e.onExtensionRegistered&&this.gridOptions.rowBasedEditOptions.onExtensionRegistered(this._rowBasedEdit),this._extensionList[ou.rowBasedEdit]={name:ou.rowBasedEdit,instance:this._rowBasedEdit}}if(this.gridOptions.enableAutoTooltip){const m=new dh((a=this.gridOptions)==null?void 0:a.autoTooltipOptions);this.sharedService.slickGrid.registerPlugin(m),this._extensionList[ou.autoTooltip]={name:ou.autoTooltip,instance:m}}if(this.gridOptions.enableExcelCopyBuffer&&(this._cellExcelCopyManagerPlugin=new ch,this._cellExcelCopyManagerPlugin.init(this.sharedService.slickGrid,this.sharedService.gridOptions.excelCopyBufferOptions),(i=this.gridOptions.excelCopyBufferOptions)!=null&&i.onExtensionRegistered&&this.gridOptions.excelCopyBufferOptions.onExtensionRegistered(this._cellExcelCopyManagerPlugin),this._extensionList[ou.cellExternalCopyManager]={name:ou.cellExternalCopyManager,instance:this._cellExcelCopyManagerPlugin}),this.gridOptions.enableCellMenu&&(this._cellMenuPlugin=new hh(this.extensionUtility,this.pubSubService,this.sharedService),(t=this.gridOptions.cellMenu)!=null&&t.onExtensionRegistered&&this.gridOptions.cellMenu.onExtensionRegistered(this._cellMenuPlugin),this._extensionList[ou.cellMenu]={name:ou.cellMenu,instance:this._cellMenuPlugin}),!this._rowSelectionModel&&(this.gridOptions.enableRowSelection||this.gridOptions.enableCheckboxSelector||this.gridOptions.enableRowDetailView||this.gridOptions.enableRowMoveManager)){if(!this._rowSelectionModel||!this.sharedService.slickGrid.getSelectionModel()){const m=this.gridOptions.rowSelectionOptions??{};this.gridOptions.enableRowMoveManager&&((r=this.gridOptions.rowMoveManager)==null?void 0:r.dragToSelect)!==!1&&(m.dragToSelect=!0),this._rowSelectionModel=new Qt(m),this.sharedService.slickGrid.setSelectionModel(this._rowSelectionModel)}this._extensionList[ou.rowSelection]={name:ou.rowSelection,instance:this._rowSelectionModel}}if(this.gridOptions.enableCheckboxSelector){this._checkboxSelectColumn=this._checkboxSelectColumn||new _s(this.pubSubService,this.gridOptions.checkboxSelector),this._checkboxSelectColumn.init(this.sharedService.slickGrid);const m=this.getCreatedExtensionByName(ou.checkboxSelector),h=m==null?void 0:m.instance;h&&((o=this.gridOptions.checkboxSelector)!=null&&o.onExtensionRegistered&&this.gridOptions.checkboxSelector.onExtensionRegistered(h),this._extensionList[ou.checkboxSelector]={name:ou.checkboxSelector,instance:this._checkboxSelectColumn})}if(this.gridOptions.enableColumnPicker&&(this._columnPickerControl=new Zr(this.extensionUtility,this.pubSubService,this.sharedService),(s=this.gridOptions.columnPicker)!=null&&s.onExtensionRegistered&&this.gridOptions.columnPicker.onExtensionRegistered(this._columnPickerControl),this._extensionList[ou.columnPicker]={name:ou.columnPicker,instance:this._columnPickerControl}),this.gridOptions.enableContextMenu&&(this._contextMenuPlugin=new gh(this.extensionUtility,this.pubSubService,this.sharedService,this.treeDataService),(l=this.gridOptions.contextMenu)!=null&&l.onExtensionRegistered&&this.gridOptions.contextMenu.onExtensionRegistered(this._contextMenuPlugin),this._extensionList[ou.contextMenu]={name:ou.contextMenu,instance:this._contextMenuPlugin}),this.gridOptions.enableDraggableGrouping&&(this._draggleGroupingPlugin&&(this._draggleGroupingPlugin.init(this.sharedService.slickGrid,this.gridOptions.draggableGrouping),(E=this.gridOptions.draggableGrouping)!=null&&E.onExtensionRegistered&&this.gridOptions.draggableGrouping.onExtensionRegistered(this._draggleGroupingPlugin),this._extensionList[ou.contextMenu]={name:ou.contextMenu,instance:this._draggleGroupingPlugin}),this._extensionList[ou.draggableGrouping]={name:ou.draggableGrouping,instance:this._draggleGroupingPlugin}),this.gridOptions.enableGridMenu&&(this._gridMenuControl=new J1(this.extensionUtility,this.filterService,this.pubSubService,this.sharedService,this.sortService),(d=this.gridOptions.gridMenu)!=null&&d.onExtensionRegistered&&this.gridOptions.gridMenu.onExtensionRegistered(this._gridMenuControl),this._extensionList[ou.gridMenu]={name:ou.gridMenu,instance:this._gridMenuControl}),this.gridOptions.enableHeaderButton){const m=new ph(this.extensionUtility,this.pubSubService,this.sharedService);(c=this.gridOptions.headerButton)!=null&&c.onExtensionRegistered&&this.gridOptions.headerButton.onExtensionRegistered(m),this._extensionList[ou.headerButton]={name:ou.headerButton,instance:m}}if(this.gridOptions.enableHeaderMenu&&(this._headerMenuPlugin=new Fh(this.extensionUtility,this.filterService,this.pubSubService,this.sharedService,this.sortService),(D=this.gridOptions.headerMenu)!=null&&D.onExtensionRegistered&&this.gridOptions.headerMenu.onExtensionRegistered(this._headerMenuPlugin),this._extensionList[ou.headerMenu]={name:ou.headerMenu,instance:this._headerMenuPlugin}),this.gridOptions.enableRowMoveManager){this._rowMoveManagerPlugin=this._rowMoveManagerPlugin||new Rs(this.pubSubService),this._rowMoveManagerPlugin.init(this.sharedService.slickGrid,this.gridOptions.rowMoveManager);const m=this.getCreatedExtensionByName(ou.rowMoveManager);(m==null?void 0:m.instance)&&(this._extensionList[ou.rowMoveManager]={name:ou.rowMoveManager,instance:this._rowMoveManagerPlugin})}}}createExtensionsBeforeGridCreation(u,e){var i,t,r;const a=[];e.enableCheckboxSelector&&(this.getCreatedExtensionByName(ou.checkboxSelector)||(this._checkboxSelectColumn=new _s(this.pubSubService,this.sharedService.gridOptions.checkboxSelector),a.push({name:ou.checkboxSelector,extension:this._checkboxSelectColumn,columnIndexPosition:((i=e==null?void 0:e.checkboxSelector)==null?void 0:i.columnIndexPosition)??a.length}))),e.enableRowMoveManager&&(this.getCreatedExtensionByName(ou.rowMoveManager)||(this._rowMoveManagerPlugin=new Rs(this.pubSubService),a.push({name:ou.rowMoveManager,extension:this._rowMoveManagerPlugin,columnIndexPosition:((t=e==null?void 0:e.rowMoveManager)==null?void 0:t.columnIndexPosition)??a.length}))),e.enableRowBasedEdit&&(this.getCreatedExtensionByName(ou.rowBasedEdit)||(this._rowBasedEdit=new Ns(this.extensionUtility,this.pubSubService),a.push({name:ou.rowBasedEdit,extension:this._rowBasedEdit,columnIndexPosition:((r=e==null?void 0:e.rowMoveManager)==null?void 0:r.columnIndexPosition)??a.length}))),this.createExtensionByTheirColumnIndex(a,u,e),e.enableDraggableGrouping&&(this.getCreatedExtensionByName(ou.draggableGrouping)||(this._draggleGroupingPlugin=new Ch(this.extensionUtility,this.pubSubService,this.sharedService),this._draggleGroupingPlugin&&(e.enableColumnReorder=this._draggleGroupingPlugin.setupColumnReorder.bind(this._draggleGroupingPlugin),this._extensionCreatedList[ou.draggableGrouping]={name:ou.draggableGrouping,instance:this._draggleGroupingPlugin})))}hideColumn(u){var e,a;if(typeof((a=(e=this.sharedService)==null?void 0:e.slickGrid)==null?void 0:a.getColumns)=="function"){const i=this.sharedService.slickGrid.getColumnIndex(u.id);this.sharedService.visibleColumns=this.removeColumnByIndex(this.sharedService.slickGrid.getColumns(),i),this.sharedService.slickGrid.setColumns(this.sharedService.visibleColumns)}}refreshBackendDataset(u){this.extensionUtility.refreshBackendDataset(u)}removeColumnByIndex(u,e){return Array.isArray(u)?u.filter((a,i)=>e!==i):u}translateAllExtensions(u){this.translateCellMenu(),this.translateContextMenu(),this.translateHeaderMenu(),this.translateRowEditPlugin(),this.translateColumnHeaders(u)}translateCellMenu(){var u;(u=this._cellMenuPlugin)==null||u.translateCellMenu()}translateColumnPicker(){var u;(u=this._columnPickerControl)==null||u.translateColumnPicker()}translateContextMenu(){var u;(u=this._contextMenuPlugin)==null||u.translateContextMenu()}translateGridMenu(){var u;(u=this._gridMenuControl)==null||u.translateGridMenu()}translateHeaderMenu(){var u;(u=this._headerMenuPlugin)==null||u.translateHeaderMenu()}translateRowEditPlugin(){var u;(u=this._rowBasedEdit)==null||u.translate()}translateColumnHeaders(u,e){var i;if(this.sharedService&&this.gridOptions&&this.gridOptions.enableTranslate&&(!this.translaterService||!this.translaterService.translate))throw new Error('[Slickgrid-Universal] requires a Translate Service to be installed and configured when the grid option "enableTranslate" is enabled.');u&&((i=this.translaterService)!=null&&i.use)&&this.translaterService.getCurrentLanguage()!==u&&this.translaterService.use(u);let a=e;a||(a=this.sharedService.columnDefinitions),this.translateItems(a,"nameKey","name"),this.translateItems(this.sharedService.allColumns,"nameKey","name"),this.translateItems(this.sharedService.allColumns,"columnGroupKey","columnGroup"),this.renderColumnHeaders(a,Array.isArray(e))}renderColumnHeaders(u,e=!1){var i;let a=u;a||(a=this.sharedService.columnDefinitions),Array.isArray(a)&&((i=this.sharedService.slickGrid)!=null&&i.setColumns)&&((a.length>this.sharedService.allColumns.length||e)&&(this.sharedService.allColumns=a),this.sharedService.slickGrid.setColumns(a)),this.gridOptions.enableColumnPicker&&this._columnPickerControl&&(this._columnPickerControl.columns=this.sharedService.allColumns,this._columnPickerControl.translateColumnPicker()),this.gridOptions.enableGridMenu&&this._gridMenuControl&&(this._gridMenuControl.columns=this.sharedService.allColumns??[],this._gridMenuControl.recreateGridMenu(),this._gridMenuControl.translateGridMenu())}createExtensionByTheirColumnIndex(u,e,a){u.sort((i,t)=>i.columnIndexPosition-t.columnIndexPosition),u.forEach(i=>{const t=i.extension.create(e,a);t&&(this._extensionCreatedList[i.name]={name:i.name,instance:t})})}translateItems(u,e,a){var i,t;if((i=this.gridOptions)!=null&&i.enableTranslate&&!((t=this.translaterService)!=null&&t.translate))throw new Error('[Slickgrid-Universal] requires a Translate Service to be installed and configured when the grid option "enableTranslate" is enabled.');this.extensionUtility.translateItems(u,e,a)}}var Ks=Object.prototype.hasOwnProperty;function me(n,u){var e,a;if(n===u)return!0;if(n&&u&&(e=n.constructor)===u.constructor){if(e===Date)return n.getTime()===u.getTime();if(e===RegExp)return n.toString()===u.toString();if(e===Array){if((a=n.length)===u.length)for(;a--&&me(n[a],u[a]););return a===-1}if(!e||typeof n=="object"){a=0;for(e in n)if(Ks.call(n,e)&&++a&&!Ks.call(u,e)||!(e in u)||!me(n[e],u[e]))return!1;return Object.keys(u).length===a}}return n!==n&&u!==u}function Hs(n,u,e){if(e&&(n!=null&&n.hasOwnProperty(e)||u!=null&&u.hasOwnProperty(e)))return n[e]===u||n===u[e]||n[e]===u[e];if(typeof n=="object"&&typeof u=="object"&&Object.keys(n).length!==Object.keys(u).length)return!1;for(const a in n)if(n.hasOwnProperty(a)&&n[a]!==u[a])return!1;return!0}function Ah(n){switch(n&&n.toUpperCase()||""){case"IN":case"NIN":case"NOT_IN":case"IN_CONTAINS":case"NIN_CONTAINS":case"NOT_IN_CONTAINS":case"IN_COLLECTION":case"NOT_IN_COLLECTION":return!0;default:return!1}}const ze=(n,u,e)=>{switch(n.toUpperCase()){case"<":case"LT":return u