@arbocollab/arbo-plugin-item-table 0.1.203 → 0.1.205
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/es/index.es.js +5 -6
- package/lib/style.css +1 -1
- package/lib/umd/index.umd.js +3 -3
- package/package.json +1 -1
package/lib/umd/index.umd.js
CHANGED
|
@@ -156,7 +156,7 @@ Caused by: `,y0=Symbol("causeStack");function See(e,t){const n=he.hasOwnProp(e,y
|
|
|
156
156
|
`),l=a===-1?-1:i.indexOf(`
|
|
157
157
|
`,a+1),c=l===-1?i:i.slice(l+1),u=String(o.stack),d=See(o,u),h=d===-1?u:u.slice(0,d),f=d===-1?"":u.slice(d);h.endsWith(c)||(o.stack=h+`
|
|
158
158
|
`+i+f)}}catch{}throw o}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Dc(this.defaults,n);const{transitional:o,paramsSerializer:s,headers:r}=n;o!==void 0&&Bv.assertOptions(o,{silentJSONParsing:Ao.transitional(Ao.boolean),forcedJSONParsing:Ao.transitional(Ao.boolean),clarifyTimeoutError:Ao.transitional(Ao.boolean),legacyInterceptorReqResOrdering:Ao.transitional(Ao.boolean),advertiseZstdAcceptEncoding:Ao.transitional(Ao.boolean),validateStatusUndefinedResolves:Ao.transitional(Ao.boolean),encodeBasicAuthUsername:Ao.transitional(Ao.boolean)},!1),s!=null&&(he.isFunction(s)?n.paramsSerializer={serialize:s}:Bv.assertOptions(s,{encode:Ao.function,serialize:Ao.function},!0)),n.allowAbsoluteUrls!==void 0||(he.hasOwnProp(this.defaults,"allowAbsoluteUrls")&&this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Bv.assertOptions(n,{baseUrl:Ao.spelling("baseURL"),withXsrfToken:Ao.spelling("withXSRFToken")},!0),n.method=(he.getSafeProp(n,"method")||he.getSafeProp(this.defaults,"method")||"get").toLowerCase();const i=he.getSafeProp(r,"common"),a=he.getSafeProp(r,n.method),l=r&&he.merge(O0(i)?i:void 0,O0(a)?a:void 0);r&&he.forEach(tM.concat("common"),v=>{O0(he.getSafeProp(r,v))&&delete r[v]}),n.headers=Do.concat(l,r);const c=[];let u=!0;this.interceptors.request.forEach(function(C){if(typeof C.runWhen=="function"&&C.runWhen(n)===!1)return;u=u&&C.synchronous;const S=n.transitional||S0;S&&S.legacyInterceptorReqResOrdering?c.unshift(C.fulfilled,C.rejected):c.push(C.fulfilled,C.rejected)});const d=[];this.interceptors.response.forEach(function(C){d.push(C.fulfilled,C.rejected)});let h,f=0,p;if(!u){const v=[A0.bind(this),void 0];for(v.unshift(...c),v.push(...d),p=v.length,h=Promise.resolve(n);f<p;)h=h.then(v[f++],v[f++]);return h}p=c.length;let g=n;for(;f<p;){const v=c[f++],C=c[f++];try{g=v?v(g):g}catch(S){if(!C){h=Promise.reject(S);break}try{const b=C.call(this,S);he.isThenable(b)&&(h=Promise.resolve(b).then(()=>A0.call(this,g)))}catch(b){h=Promise.reject(b)}break}}if(!h)try{h=A0.call(this,g)}catch(v){h=Promise.reject(v)}for(f=0,p=d.length;f<p;)h=h.then(d[f++],d[f++]);return h}getUri(t){t=Dc(this.defaults,t);const n=uM(t.baseURL,t.url,t.allowAbsoluteUrls,t);return jO(n,t.params,t.paramsSerializer)}};he.forEach(["delete","get","head","options"],function(t){Ic.prototype[t]=async function(n,o){return this.request(Dc(o||{},{method:t,url:n,data:o&&he.hasOwnProp(o,"data")?o.data:void 0}))}}),he.forEach(["post","put","patch","query"],function(t){function n(o){return async function(r,i,a){return this.request(Dc(a||{},{method:t,headers:o?{"Content-Type":"multipart/form-data"}:{},url:r,data:i}))}}Ic.prototype[t]=n(),t!=="query"&&(Ic.prototype[t+"Form"]=n(!0))});let bte=class qG{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(r){n=r});const o=this;this.promise.then(s=>{if(!o._listeners)return;let r=o._listeners.length;for(;r-- >0;)o._listeners[r](s);o._listeners=null}),this.promise.then=s=>{let r;const i=new Promise(a=>{o.subscribe(a),r=a}).then(s);return i.cancel=function(){o.unsubscribe(r)},i},t(function(r,i,a){o.reason||(o.reason=new Yf(r,i,a),n(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=o=>{t.abort(o)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new qG(function(s){t=s}),cancel:t}}};function Ste(e){return function(n){return e.apply(null,n)}}function Ete(e){return he.isObject(e)&&e.isAxiosError===!0}const $v={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries($v).forEach(([e,t])=>{$v[t]===void 0&&($v[t]=e)});function PM(e){const t=new Ic(e),n=IO(Ic.prototype.request,t);return he.extend(n,Ic.prototype,t,{allOwnKeys:!0}),he.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return PM(Dc(e,s))},n}const to=PM(qf);to.Axios=Ic,to.CanceledError=Yf,to.CancelToken=bte,to.isCancel=nM,to.VERSION=P0,to.toFormData=Av,to.AxiosError=at,to.Cancel=to.CanceledError,to.all=function(t){return Promise.all(t)},to.spread=Ste,to.isAxiosError=Ete,to.mergeConfig=Dc,to.AxiosHeaders=Do,to.formToJSON=e=>eM(he.isHTMLForm(e)?new FormData(e):e),to.getAdapter=DM.getAdapter,to.HttpStatusCode=$v,to.default=to;const{Axios:mIe,AxiosError:vIe,CanceledError:yIe,isCancel:wIe,CancelToken:CIe,VERSION:bIe,all:SIe,Cancel:EIe,isAxiosError:_te,spread:_Ie,toFormData:RIe,AxiosHeaders:TIe,HttpStatusCode:DIe,formToJSON:IIe,getAdapter:xIe,mergeConfig:PIe,create:kIe}=to;class Zf extends Error{constructor(t,n,o,s,r){super(t),this.name="ApiError",this.statusCode=n,this.code=o,this.details=s,this.type=r,Object.setPrototypeOf(this,Zf.prototype)}}const Rte=e=>{var t,n;if(_te(e)){const o=(t=e.response)==null?void 0:t.status,s=(n=e.response)==null?void 0:n.data,r=(s==null?void 0:s.message)||e.message||"An unexpected error occurred",i=(s==null?void 0:s.code)||e.code,a=(s==null?void 0:s.details)||s;let l="UNKNOWN";return!o||e.code==="ERR_NETWORK"||e.code==="ECONNABORTED"?l=e.code==="ECONNABORTED"?"TIMEOUT":"NETWORK":o>=500?l="SERVER":o===od.UNAUTHORIZED||o===od.FORBIDDEN?l="AUTH":o===od.UNPROCESSABLE_ENTITY||o===od.BAD_REQUEST?l="VALIDATION":o>=od.BAD_REQUEST&&(l="CLIENT"),new Zf(r,o,i,a,l)}return e instanceof Error?new Zf(e.message,void 0,void 0,void 0,"UNKNOWN"):new Zf("An unknown error occurred",void 0,void 0,void 0,"UNKNOWN")};function kM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function FM(e,t,n,o,s,r,i){try{var a=e[r](i),l=a.value}catch(c){return void n(c)}a.done?t(l):Promise.resolve(l).then(o,s)}function M0(e){return function(){var t=this,n=arguments;return new Promise(function(o,s){var r=e.apply(t,n);function i(l){FM(r,o,s,i,a,"next",l)}function a(l){FM(r,o,s,i,a,"throw",l)}i(void 0)})}}function N0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Tte(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,OM(o.key),o)}}function L0(e,t,n){return t&&Tte(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Dte(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=kte(e))||t){n&&(e=n);var o=0,s=function(){};return{s,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(l){throw l},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
159
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var r,i=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var l=n.next();return i=l.done,l},e:function(l){a=!0,r=l},f:function(){try{i||n.return==null||n.return()}finally{if(a)throw r}}}}function ad(e,t,n){return(t=OM(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,o)}return n}function ld(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AM(Object(n),!0).forEach(function(o){ad(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AM(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Ite(e,t){if(e==null)return{};var n,o,s=xte(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function xte(e,t){if(e==null)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)!==-1)continue;n[o]=e[o]}return n}function xc(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},o=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function r(f,p,g,v){var C=p&&p.prototype instanceof a?p:a,S=Object.create(C.prototype);return Us(S,"_invoke",function(b,y,_){var E,D,T,P=0,L=_||[],I=!1,x={p:0,n:0,v:e,a:O,f:O.bind(e,4),d:function(N,F){return E=N,D=0,T=e,x.n=F,i}};function O(N,F){for(D=N,T=F,t=0;!I&&P&&!z&&t<L.length;t++){var z,j=L[t],Q=x.p,re=j[2];N>3?(z=re===F)&&(T=j[(D=j[4])?5:(D=3,3)],j[4]=j[5]=e):j[0]<=Q&&((z=N<2&&Q<j[1])?(D=0,x.v=F,x.n=j[1]):Q<re&&(z=N<3||j[0]>F||F>re)&&(j[4]=N,j[5]=F,x.n=re,D=0))}if(z||N>1)return i;throw I=!0,F}return function(N,F,z){if(P>1)throw TypeError("Generator is already running");for(I&&F===1&&O(F,z),D=F,T=z;(t=D<2?e:T)||!I;){E||(D?D<3?(D>1&&(x.n=-1),O(D,T)):x.n=T:x.v=T);try{if(P=2,E){if(D||(N="next"),t=E[N]){if(!(t=t.call(E,T)))throw TypeError("iterator result is not an object");if(!t.done)return t;T=t.value,D<2&&(D=0)}else D===1&&(t=E.return)&&t.call(E),D<2&&(T=TypeError("The iterator does not provide a '"+N+"' method"),D=1);E=e}else if((t=(I=x.n<0)?T:b.call(y,x))!==i)break}catch(j){E=e,D=1,T=j}finally{P=1}}return{value:t,done:I}}}(f,g,v),!0),S}var i={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][o]?t(t([][o]())):(Us(t={},o,function(){return this}),t),d=c.prototype=a.prototype=Object.create(u);function h(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,c):(f.__proto__=c,Us(f,s,"GeneratorFunction")),f.prototype=Object.create(d),f}return l.prototype=c,Us(d,"constructor",c),Us(c,"constructor",l),l.displayName="GeneratorFunction",Us(c,s,"GeneratorFunction"),Us(d),Us(d,s,"Generator"),Us(d,o,function(){return this}),Us(d,"toString",function(){return"[object Generator]"}),(xc=function(){return{w:r,m:h}})()}function Us(e,t,n,o){var s=Object.defineProperty;try{s({},"",{})}catch{s=0}Us=function(r,i,a,l){function c(u,d){Us(r,u,function(h){return this._invoke(u,d,h)})}i?s?s(r,i,{value:a,enumerable:!l,configurable:!l,writable:!l}):r[i]=a:(c("next",0),c("throw",1),c("return",2))},Us(e,t,n,o)}function Pte(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function OM(e){var t=Pte(e,"string");return typeof t=="symbol"?t:t+""}function Hv(e){"@babel/helpers - typeof";return Hv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hv(e)}function kte(e,t){if(e){if(typeof e=="string")return kM(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kM(e,t):void 0}}var V0=function(e){return e.TOOLBOX_EXPORT_DATA="TOOLBOX_EXPORT_DATA",e.SW_APP_LOADER="SW_APP_LOADER",e}({});function MM(e){return Hv(e)==="object"&&e!==null&&!Array.isArray(e)}function NM(e,t){var n=Object.keys(e);return n.length===t.length&&t.every(function(o){return n.includes(o)})}function Fte(e){return typeof Blob<"u"&&e instanceof Blob}var Ate=function(t){return MM(t)&&NM(t,["file","fileName"])&&Fte(t.file)&&typeof t.fileName=="string"},Ote=function(t){return MM(t)&&NM(t,["scene_id","people_id","openGS","queryParams"])&&(typeof t.scene_id=="string"||t.scene_id===null)&&(typeof t.people_id=="string"||t.people_id===null)&&(typeof t.openGS=="boolean"||t.openGS===null)&&typeof t.queryParams=="string"},Mte=Object.freeze(ad(ad({},V0.TOOLBOX_EXPORT_DATA,Ate),V0.SW_APP_LOADER,Ote));function Nte(e){return Hv(e)==="object"&&e!==null&&!Array.isArray(e)}function Lte(e,t){var n=Object.keys(e);return n.length===t.length&&t.every(function(o){return n.includes(o)})}function Vte(e){if(!Nte(e))return{valid:!1,reason:"Message must be an object."};if(e.version!==1)return{valid:!1,reason:"Unsupported or missing message version."};if(typeof e.type!="string"||!Object.values(V0).includes(e.type))return{valid:!1,reason:"Unknown or missing message type."};if(e.id!==void 0&&typeof e.id!="string")return{valid:!1,reason:"Message id must be a string when provided."};var t=e.id===void 0?["version","type","payload"]:["version","type","payload","id"];if(!Lte(e,t))return{valid:!1,reason:"Message contains missing or unexpected fields."};var n=e.type;return Mte[n](e.payload)?{valid:!0,message:e}:{valid:!1,reason:"Payload does not match the ".concat(n," schema.")}}function Bte(e){var t=e.target,n=e.allowedOrigins,o=e.onMessage,s=e.onInvalidMessage,r=t??(typeof window>"u"?void 0:window);if(!r)throw new TypeError("A target window is required outside a browser environment.");if(!Array.isArray(n)||n.length===0)throw new TypeError("At least one allowed message origin must be configured.");if(n.some(function(a){return typeof a!="string"||a.length===0||a==="*"}))throw new TypeError("Allowed message origins must be explicit origin strings; wildcards are not allowed.");if(typeof o!="function")throw new TypeError("An onMessage callback is required.");var i=function(l){if(!n.includes(l.origin)){s==null||s(l.data,"Untrusted message origin: ".concat(l.origin),l);return}var c=Vte(l.data);if(c.valid===!1){s==null||s(l.data,c.reason,l);return}o(c.message,l)};return r.addEventListener("message",i),function(){return r.removeEventListener("message",i)}}let $te=class extends Error{},hl=class extends $te{constructor(){super("Zone is an abstract class")}},LM=class{get type(){throw new hl}get name(){throw new hl}get ianaName(){return this.name}get isUniversal(){throw new hl}offsetName(t,n){throw new hl}formatOffset(t,n){throw new hl}offset(t){throw new hl}equals(t){throw new hl}get isValid(){throw new hl}};const B0=new Map;function Hte(e){let t=B0.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),B0.set(e,t)),t}const Gte={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Ute(e,t){const n=e.format(t).replace(/\u200E/g,""),o=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,s,r,i,a,l,c,u]=o;return[i,s,r,a,l,c,u]}function Wte(e,t){const n=e.formatToParts(t),o=[];for(let s=0;s<n.length;s++){const{type:r,value:i}=n[s],a=Gte[r];r==="era"?o[a]=i:Gv(a)||(o[a]=parseInt(i,10))}return o}const $0=new Map;let zte=class xT extends LM{static create(t){let n=$0.get(t);return n===void 0&&$0.set(t,n=new xT(t)),n}static resetCache(){$0.clear(),B0.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=xT.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:o}){return Yte(t,n,o,this.name)}formatOffset(t,n){return Wv(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const o=Hte(this.name);let[s,r,i,a,l,c,u]=o.formatToParts?Wte(o,n):Ute(o,n);a==="BC"&&(s=-Math.abs(s)+1);const h=qte({year:s,month:r,day:i,hour:l===24?0:l,minute:c,second:u,millisecond:0});let f=+n;const p=f%1e3;return f-=p>=0?p:1e3+p,(h-f)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}},H0=null,jte=class yg extends LM{static get utcInstance(){return H0===null&&(H0=new yg(0)),H0}static instance(t){return t===0?yg.utcInstance:new yg(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new yg(BM(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Wv(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Wv(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Wv(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}};function Gv(e){return typeof e>"u"}function Uv(e,t=2){const n=e<0;let o;return n?o="-"+(""+-e).padStart(t,"0"):o=(""+e).padStart(t,"0"),o}function VM(e){if(!(Gv(e)||e===null||e===""))return parseInt(e,10)}function Kte(e){if(!(Gv(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function qte(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function Yte(e,t,n,o=null){const s=new Date(e),r={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};o&&(r.timeZone=o);const i={timeZoneName:t,...r},a=new Intl.DateTimeFormat(n,i).formatToParts(s).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function BM(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const o=parseInt(t,10)||0,s=n<0||Object.is(n,-0)?-o:o;return n*60+s}function Wv(e,t){const n=Math.trunc(Math.abs(e/60)),o=Math.trunc(Math.abs(e%60)),s=e>=0?"+":"-";switch(t){case"short":return`${s}${Uv(n,2)}:${Uv(o,2)}`;case"narrow":return`${s}${n}${o>0?`:${o}`:""}`;case"techie":return`${s}${Uv(n,2)}${Uv(o,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}const $M=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function cd(...e){const t=e.reduce((n,o)=>n+o.source,"");return RegExp(`^${t}$`)}function ud(...e){return t=>e.reduce(([n,o,s],r)=>{const[i,a,l]=r(t,s);return[{...n,...i},a||o,l]},[{},null,1]).slice(0,2)}function HM(...e){return(t,n)=>{const o={};let s;for(s=0;s<e.length;s++)o[e[s]]=VM(t[n+s]);return[o,null,n+s]}}const GM=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,Xte=`(?:${GM.source}?(?:\\[(${$M.source})\\])?)?`,UM=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,WM=RegExp(`${UM.source}${Xte}`),G0=RegExp(`(?:[Tt]${WM.source})?`),Zte=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Jte=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Qte=/(\d{4})-?(\d{3})/,ene=HM("weekYear","weekNumber","weekDay"),tne=HM("year","ordinal"),nne=/(\d{4})-(\d\d)-(\d\d)/,zM=RegExp(`${UM.source} ?(?:${GM.source}|(${$M.source}))?`),one=RegExp(`(?: ${zM.source})?`);function dd(e,t,n){const o=e[t];return Gv(o)?n:VM(o)}function sne(e,t){return[{year:dd(e,t),month:dd(e,t+1,1),day:dd(e,t+2,1)},null,t+3]}function hd(e,t){return[{hours:dd(e,t,0),minutes:dd(e,t+1,0),seconds:dd(e,t+2,0),milliseconds:Kte(e[t+3])},null,t+4]}function Jf(e,t){const n=!e[t]&&!e[t+1],o=BM(e[t+1],e[t+2]),s=n?null:jte.instance(o);return[{},s,t+3]}function Qf(e,t){const n=e[t]?zte.create(e[t]):null;return[{},n,t+1]}cd(Zte,G0),cd(Jte,G0),cd(Qte,G0),cd(WM),ud(sne,hd,Jf,Qf),ud(ene,hd,Jf,Qf),ud(tne,hd,Jf,Qf),ud(hd,Jf,Qf),ud(hd),cd(nne,one),cd(zM),ud(hd,Jf,Qf);var rne=["accessTokenKey","refreshTokenKey","domain","path","secure","sameSite","canSetTokens","cookieParser"];function Dt(){if(typeof sessionStorage<"u"&&sessionStorage.getItem("APP_DEBUG")==="1"){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];(e=console).log.apply(e,["[DEBUG COMMON_UTILS]"].concat(n))}}function ep(){if(typeof sessionStorage<"u"&&sessionStorage.getItem("APP_DEBUG")==="1"){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];(e=console).error.apply(e,["[DEBUG COMMON_UTILS]"].concat(n))}}function zv(){if(typeof sessionStorage<"u"&&sessionStorage.getItem("APP_DEBUG")==="1"){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];(e=console).warn.apply(e,["[DEBUG COMMON_UTILS]"].concat(n))}}function ine(){var e=typeof window<"u"?sessionStorage.getItem("BASE_DOMAIN_COOKIE")||window.location.hostname:void 0;return Dt("getStandardizedCookieConfig - domain:",e,"from BASE_DOMAIN_COOKIE:",sessionStorage.getItem("BASE_DOMAIN_COOKIE")),{accessTokenKey:"account.token",refreshTokenKey:"account.refresh_token",domain:e,path:"/",secure:!0,sameSite:"lax"}}function ane(){return{maxRetries:5,retryDelay:500,backoffFactor:1.5}}var jM=1e3,lne=1e4;function KM(e){if(!(typeof window>"u")){var t=window.self!==window.top;try{if(t&&window.top){Dt("Inside iframe - redirecting top window to:",e),window.top.location.replace(e);return}}catch(n){ep("Top window redirect blocked, redirecting current window instead:",n)}try{Dt("Redirecting current window to:",e),window.location.replace(e)}catch(n){ep("Failed to redirect:",n)}}}function jv(e){return typeof e!="string"||!e?e:e.length<=2?"*".repeat(e.length):"".concat(e[0]).concat("*".repeat(e.length-2)).concat(e[e.length-1])}function cne(e){return ld(ld({},e),{},{access_token:jv(e.access_token),token:jv(e.token),refresh_token:jv(e.refresh_token)})}function Kv(e){if(!e)return!1;var t=e.trim();return!!t&&t!=="undefined"&&t!=="null"}function qM(e){return Kv(e.getAccessToken())||Kv(e.getRefreshToken())}function une(e){if(!(typeof document>"u")){var t=typeof window<"u"?window.location.hostname:"",n=e||(typeof sessionStorage<"u"?sessionStorage.getItem("BASE_DOMAIN_COOKIE"):null)||t,o=Array.from(new Set([n,t].filter(Boolean)));Dt("Clearing all cookies - domains:",o);var s=document.cookie.split(";");s.forEach(function(r){var i=r.split("=")[0].trim();i&&(document.cookie="".concat(i,"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"),o.forEach(function(a){document.cookie="".concat(i,"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=").concat(a)}))})}}function dne(){typeof sessionStorage<"u"&&sessionStorage.clear()}function hne(e){return function(t){var n,o=(n=t.response)===null||n===void 0?void 0:n.status,s=qM(e);if(Dt("getStandardizedTokenExpiredDetection - status:",o,"userLoggedIn:",s),!s)return Dt("User not logged in - returning false"),!1;if(o===400){var r,i,a,l=(r=t.response)===null||r===void 0?void 0:r.data,c=(l==null?void 0:l.error)==="invalid_token"||(l==null||(i=l.error)===null||i===void 0?void 0:i.key)==="invalid_token";return Dt(" 400 error - isInvalidToken:",c,"error:",l==null?void 0:l.error,"error.key:",l==null||(a=l.error)===null||a===void 0?void 0:a.key),!1}if(o===401){var u,d,h=(u=t.response)===null||u===void 0?void 0:u.data,f=h==null||(d=h.error)===null||d===void 0?void 0:d.key,p=h==null?void 0:h.details;return Dt(" 401 error - errorKey:",f,"details:",p),f==="unauthenticated"&&(!p||Object.keys(p).length===0||p.reason==="refresh_token_expired")?(Dt(" 401 unauthenticated - triggering refresh"),!0):(Dt(" 401 error but not unauthenticated - returning false"),!1)}return o===425?(Dt(" 425 error - triggering refresh"),!0):(Dt("Status",o,"not handled - returning false"),!1)}}var fne=function(){function e(){var t,n,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};N0(this,e),this.accessTokenKey=o.accessTokenKey||"access_token",this.refreshTokenKey=o.refreshTokenKey||"refresh_token",this.domain=o.domain,this.path=o.path||"/",this.secure=(t=o.secure)!==null&&t!==void 0?t:!0,this.sameSite=o.sameSite||"lax",this.canSetTokens=(n=o.canSetTokens)!==null&&n!==void 0?n:!0,this.cookieParser=o.cookieParser}return L0(e,[{key:"getCookieValue",value:function(n){if(typeof document>"u")return null;var o=document.cookie.split(";"),s=Dte(o),r;try{for(s.s();!(r=s.n()).done;){var i=r.value;if(i=i.trim(),i.startsWith(n+"=")){var a=i.substring(n.length+1);return this.cookieParser?this.cookieParser(a,n):decodeURIComponent(a)}}}catch(l){s.e(l)}finally{s.f()}return null}},{key:"getAccessToken",value:function(){return this.getCookieValue(this.accessTokenKey)}},{key:"getRefreshToken",value:function(){return this.getCookieValue(this.refreshTokenKey)}},{key:"getExpiresInRefreshToken",value:function(){return this.getCookieValue("account.expires_in_refresh_token")}},{key:"setTokens",value:function(n){if(!this.canSetTokens||typeof document>"u"){zv(" CookieTokenStorage: Token setting is disabled or running in a non-browser environment");return}Dt(" setTokens called - storing tokens with keys:",this.accessTokenKey,this.refreshTokenKey,"domain:",this.domain);var o=this.domain?"; domain=".concat(this.domain):"",s=this.secure?"; secure":"",r="; samesite=".concat(this.sameSite),i="",a="";if(n.expires_in&&typeof n.expires_in=="number"){var l=new Date;l.setTime(l.getTime()+n.expires_in*1e3),i=";expires=".concat(l.toUTCString())}var c=this.getExpiresInRefreshToken();if(Dt("setTokens - refresh token data:",cne(n)),Dt("setTokens - refresh token expires_in value:",c),c){var u=new Date;u.setTime(u.getTime()+Number(c)*1e3),a=";expires=".concat(u.toUTCString())}if(n.access_token||n.token){var d=n.access_token||n.token,h="".concat(this.accessTokenKey,"=").concat(encodeURIComponent(d),"; path=").concat(this.path).concat(o).concat(s).concat(r).concat(i);document.cookie=h}if(n.refresh_token_expires_in&&typeof n.refresh_token_expires_in=="number"){var f=new Date;f.setTime(f.getTime()+n.refresh_token_expires_in*1e3),i=";expires=".concat(f.toUTCString())}if(n.refresh_token){Dt("setTokens - refresh token set to:",jv(n.refresh_token)),Dt("setTokens - refresh token expires_in set to:",a);var p="".concat(this.refreshTokenKey,"=").concat(encodeURIComponent(n.refresh_token),"; path=").concat(this.path).concat(o).concat(s).concat(r).concat(a);document.cookie=p}}},{key:"hasTokens",value:function(){return!!this.getAccessToken()&&!!this.getRefreshToken()}}])}(),pne=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"auth_state_channel",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"auth_state_event";N0(this,e),ad(this,"channel",null),this.channelName=t,this.storageKey=n,this.initChannel()}return L0(e,[{key:"initChannel",value:function(){if(typeof BroadcastChannel<"u")try{this.channel=new BroadcastChannel(this.channelName)}catch(n){console.error("Failed to create BroadcastChannel, falling back to storage events:",n),this.channel=null}}},{key:"broadcastEvent",value:function(n){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={type:n,data:s,timestamp:Date.now()};this.channel?this.channel.postMessage(r):typeof localStorage<"u"&&(localStorage.setItem(this.storageKey,JSON.stringify(r)),setTimeout(function(){return localStorage.removeItem(o.storageKey)},100))}},{key:"onEvent",value:function(n){var o=this;return this.channel?this.channel.onmessage=function(s){n(s.data)}:typeof window<"u"&&window.addEventListener("storage",function(s){if(s.key===o.storageKey&&s.newValue)try{var r=JSON.parse(s.newValue);n(r)}catch(i){console.error("Failed to parse auth event:",i)}}),function(){o.channel?o.channel.onmessage=null:typeof window<"u"&&window.removeEventListener("storage",function(){})}}},{key:"destroy",value:function(){this.channel&&(this.channel.close(),this.channel=null)}}])}(),gne=function(){function e(t){var n=this;if(N0(this,e),ad(this,"currentAttempt",0),ad(this,"isLoggingOut",!1),this.instanceId=Math.random().toString(36).substring(2,15),this.refreshTokenFn=t.refreshTokenFn,this.tokenStorage=t.storage,this.useStandardizedConfig=t.useStandardizedConfig===!0,Dt("RefreshTokenHandler initialized - useStandardizedConfig:",this.useStandardizedConfig),this.useStandardizedConfig){var o=ane();this.maxRetries=o.maxRetries,this.retryDelay=o.retryDelay,this.backoffFactor=o.backoffFactor,Dt(" Using standardized retry config - maxRetries:",this.maxRetries,"retryDelay:",this.retryDelay,"backoffFactor:",this.backoffFactor)}else this.maxRetries=t.maxRetries||3,this.retryDelay=t.retryDelay||1e3,this.backoffFactor=t.backoffFactor||2,Dt(" Using custom retry config - maxRetries:",this.maxRetries,"retryDelay:",this.retryDelay,"backoffFactor:",this.backoffFactor);this.onCrossTabLogout=t.onCrossTabLogout,this.authStateManager=new pne,this.initCrossTabListener(),this.onRefreshSuccess=t.onRefreshSuccess||function(){Dt("Token refresh successful")},this.onRefreshFailure=t.onRefreshFailure||function(s){console.error("Token refresh failed:",s)},this.onTokenInvalid=t.onTokenInvalid||function(){Dt("Token is invalid or cannot be refreshed");var s=new Error("No refresh token available");n.useStandardizedConfig?n.handleLogout("no_refresh_token",s):(n.onRefreshFailure(s),n.authStateManager.broadcastEvent("auth:logout",{sourceInstanceId:n.instanceId,reason:"no_refresh_token",error:"No refresh token available"}))}}return L0(e,[{key:"isLogoutInProgress",get:function(){return this.isLoggingOut}},{key:"handleLogout",value:function(n,o){if(this.isLoggingOut){Dt("handleLogout skipped - logout already in progress");return}Dt("handleLogout called with reason:",n),this.onRefreshFailure&&(Dt("Calling onRefreshFailure callback"),this.onRefreshFailure(o));var s=this.getLogoutTag(n,"this-tab");this.authStateManager.broadcastEvent("auth:logout",{sourceInstanceId:this.instanceId,reason:n,tag:s,error:(o==null?void 0:o.message)||"Token refresh failed"}),this.clearStateAndRedirectToLogin(s)}},{key:"getLogoutTag",value:function(n,o){return Kv(this.tokenStorage.getRefreshToken())?(console.error("False logout detected. Refresh token not expired. Reason: ".concat(n)),console.error("Sender channel: ".concat(o)),-1):1}},{key:"clearStateAndRedirectToLogin",value:function(n){if(!this.isLoggingOut){this.isLoggingOut=!0;var o=typeof sessionStorage<"u"&&sessionStorage.getItem("BASE_URL")||"",s=typeof sessionStorage<"u"&&sessionStorage.getItem("BASE_DOMAIN_COOKIE")||void 0;if(typeof localStorage<"u"&&typeof window<"u")try{var r="".concat(window.location.pathname).concat(window.location.search);localStorage.setItem("last_url_access_after_timeout",r),localStorage.removeItem("retryCount"),Dt("localStorage updated - saved last URL:",r)}catch(a){ep("Failed to update localStorage:",a)}Dt("Clearing sessionStorage and cookies"),dne(),une(s);var i="".concat(o,"/login?timeout=").concat(n);Dt("Redirecting to login in ".concat(jM,"ms:"),i),setTimeout(function(){return KM(i)},jM)}}},{key:"initCrossTabListener",value:function(){var n=this;this.authStateManager.onEvent(function(o){if(o.type==="auth:logout")if(Dt("Received logout event:",o.data),o.data&&o.data.sourceInstanceId!==n.instanceId){if(Dt("Logout event from different tab, executing logout handlers"),n.onCrossTabLogout?(Dt("Executing onCrossTabLogout with reason: ".concat(o.data.reason||"cross_tab_logout")),n.onCrossTabLogout(o.data.reason||"cross_tab_logout")):typeof n.onLogout=="function"?(Dt("Executing legacy onLogout with reason: ".concat(o.data.reason)),n.onLogout(o.data.reason)):n.useStandardizedConfig||console.warn("No logout handler defined for cross-tab events"),n.useStandardizedConfig){var s=o.data.tag===-1||o.data.tag===1,r=s?o.data.tag:n.getLogoutTag(o.data.reason||"cross_tab_logout","cross-tab");s&&r===-1&&(console.error("False logout detected. Reason: ".concat(o.data.reason||"cross_tab_logout")),console.error("Sender channel: cross-tab")),Dt("Standardized mode - logging out this tab after cross-tab event, tag:",r),n.clearStateAndRedirectToLogin(r)}}else Dt("Ignoring self-generated logout event")})}},{key:"handleTokenRefresh",value:function(){var t=M0(xc().m(function o(){var s=this,r,i,a,l;return xc().w(function(c){for(;;)switch(c.p=c.n){case 0:if(r=this.tokenStorage.getRefreshToken(),Dt(" handleTokenRefresh started, refreshToken available:",!!r),r){c.n=1;break}return Dt(" ERROR: No refresh token available - cannot refresh"),this.onTokenInvalid(),c.a(2,!1);case 1:return this.currentAttempt=0,c.p=2,c.n=3,this.executeWithRetry(function(){return Dt("Refresh attempt ".concat(s.currentAttempt+1,"/").concat(s.maxRetries)),s.refreshTokenFn(s.tokenStorage.getRefreshToken())});case 3:if(i=c.v,!(!i||!i.access_token&&!i.token)){c.n=4;break}throw console.error("Invalid token response received"),new Error("Invalid token response");case 4:return i.token&&!i.access_token&&(i.access_token=i.token),Dt(" Token refresh successful, saving new tokens"),this.tokenStorage.setTokens(i),Dt(" Calling onRefreshSuccess callback"),this.onRefreshSuccess(i),c.a(2,!0);case 5:return c.p=5,l=c.v,console.error("Token refresh failed after all attempts:",l),l===void 0&&(l=new Error("Undefined error during token refresh")),this.useStandardizedConfig?this.handleLogout("max_retry_reached",l):(this.onRefreshFailure(l),this.authStateManager.broadcastEvent("auth:logout",{sourceInstanceId:this.instanceId,reason:"max_retry_reached",error:((a=l)===null||a===void 0?void 0:a.message)||"Token refresh failed after maximum retries"})),c.a(2,!1)}},o,this,[[2,5]])}));function n(){return t.apply(this,arguments)}return n}()},{key:"executeWithRetry",value:function(){var t=M0(xc().m(function o(s){var r,i,a,l;return xc().w(function(c){for(;;)switch(c.p=c.n){case 0:return c.p=0,c.n=1,s();case 1:return c.a(2,c.v);case 2:if(c.p=2,l=c.v,this.currentAttempt++,!(this.currentAttempt>=this.maxRetries)){c.n=3;break}throw Dt("Maximum retry attempts (".concat(this.maxRetries,") reached")),l;case 3:return i=(l==null||(r=l.response)===null||r===void 0?void 0:r.status)===425,a=i?this.getRetryAfterDelay(l):this.retryDelay*Math.pow(this.backoffFactor,this.currentAttempt-1),Dt("Retry in ".concat(a,"ms, attempt ").concat(this.currentAttempt,"/").concat(this.maxRetries)),c.n=4,new Promise(function(u){return setTimeout(u,a)});case 4:return c.a(2,this.executeWithRetry(s))}},o,this,[[0,2]])}));function n(o){return t.apply(this,arguments)}return n}()},{key:"getRetryAfterDelay",value:function(n){var o;if(n!=null&&(o=n.response)!==null&&o!==void 0&&o.headers){var s=n.response.headers["retry-after"];if(s){var r=parseInt(s,10);if(!isNaN(r))return r*1e3;var i=new Date(s);if(!isNaN(i.getTime()))return i.getTime()-Date.now()}}return this.retryDelay*Math.pow(this.backoffFactor,this.currentAttempt-1)}},{key:"broadcastLogout",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"manual_logout";Dt("Broadcasting logout event with reason: ".concat(n)),this.authStateManager.broadcastEvent("auth:logout",{sourceInstanceId:this.instanceId,reason:n,timestamp:Date.now()})}}])}();function mne(e,t){var n,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=(n=o.useStandardizedConfig)!==null&&n!==void 0?n:t.useStandardizedConfig;Dt("createRefreshInterceptor called - useStandardizedConfig:",s);var r=s?hne(t.tokenStorage):o.tokenExpiredDetection||function(c){var u;return((u=c.response)===null||u===void 0?void 0:u.status)===401},i=s?[401,425]:o.retryStatusCodes||[401,425],a=o.tokenHeaderFormatter||function(c){return"Bearer ".concat(c)};Dt("Interceptor config - retryStatusCodes:",i,"using standardized detection:",s);var l=null;e.interceptors.response.use(function(c){return c},function(){var c=M0(xc().m(function u(d){var h,f,p,g,v,C,S,b,y,_,E,D,T,P,L,I,x,O,N,F,z;return xc().w(function(j){for(;;)switch(j.p=j.n){case 0:if(g=d.config,v=function(re){var q,V=s&&t.isLogoutInProgress;return zv(V?"HOLD ->":"REJECT ->",((g==null?void 0:g.method)||"").toUpperCase(),g==null?void 0:g.url,"| status:",(q=d.response)===null||q===void 0?void 0:q.status,"| reason:",re,"| logoutInProgress:",t.isLogoutInProgress,"| at:",new Date().toISOString().slice(11,23)),V?new Promise(function(k,G){setTimeout(function(){zv("Logout redirect did not happen in time - releasing held request:",g==null?void 0:g.url),G(d)},lne)}):Promise.reject(d)},g){j.n=1;break}return j.a(2,v("no request config"));case 1:if(!g._retry){j.n=2;break}return j.a(2,v("retried request failed again"));case 2:if(C=(h=d.response)===null||h===void 0?void 0:h.status,Dt(" Response error handler triggered - status:",C,"url:",g.url),S=r(d),Dt(" tokenExpiredDetection returned:",S),b=!1,C===400)if(E=(y=d.response)===null||y===void 0?void 0:y.data,D=(E==null?void 0:E.error)==="invalid_token"||(E==null||(_=E.error)===null||_===void 0?void 0:_.key)==="invalid_token",D)if(b=!1,s){if(Dt(" 400 invalid_token (standardized) - clearing account.token from cookies"),typeof document<"u")try{T=sessionStorage.getItem("BASE_DOMAIN_COOKIE")||window.location.hostname,Dt(" Clearing account.token - domain:",T),document.cookie="account.token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=".concat(T),document.cookie="account.token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/",Dt(" ✅ Removed account.token from cookies (prevents infinite 400 loop)")}catch(Q){ep(" Failed to clear account.token:",Q)}typeof window<"u"&&(P=sessionStorage.getItem("BASE_URL")||"",L="".concat(P,"/sw?redirect=1"),Dt("Redirecting to re-auth page - URL:",L),KM(L))}else Dt(" 400 invalid_token (custom config) - user handles via callbacks");else b=!1,Dt(" 400 non-invalid_token - skip refresh");else s&&C===401&&!qM(t.tokenStorage)?(I=typeof window<"u"&&window.location.pathname.includes("/login"),x=/login|refresh-token|refreshToken/i.test(g.url||""),I||x?Dt("401 with no tokens on login page/auth request - not redirecting"):(Dt("401 with no tokens - logging out and redirecting to /login"),t.handleLogout("no_tokens",new Error("No authentication tokens available"))),b=!1):(b=S&&i.includes(C),Dt(" Status",C,"- shouldRefresh:",S,"in retryStatusCodes:",i.includes(C),"canRetry:",b));if(b){j.n=3;break}return j.a(2,v("not eligible for refresh"));case 3:if(O=((f=g.url)===null||f===void 0?void 0:f.includes("refresh-token"))||((p=g.url)===null||p===void 0?void 0:p.includes("refreshToken")),!O){j.n=4;break}return j.a(2,v("refresh endpoint itself failed"));case 4:return g._retry=!0,j.p=5,l?Dt(" Using existing refresh promise"):(Dt(" Starting new token refresh"),l=t.handleTokenRefresh()),j.n=6,l;case 6:if(N=j.v,l=null,N){j.n=7;break}return j.a(2,v("token refresh failed (waiting request)"));case 7:return F=t.tokenStorage.getAccessToken(),Dt(" Token refreshed successfully, new token available:",!!F),F?(Dt(" Injecting refreshed token into Authorization header for retry"),g.headers.Authorization=a(F)):zv(" WARNING: Token refresh succeeded but no token in storage!"),Dt(" Retrying original request with new token"),j.a(2,e(g));case 8:return j.p=8,z=j.v,ep(" Error during refresh:",z),l=null,j.a(2,v("error thrown during refresh"))}},u,null,[[5,8]])}));return function(u){return c.apply(this,arguments)}}()),e.interceptors.request.use(function(c){var u=c.headers.Authorization;if(u){var d=String(u).replace(/^Bearer\s*/i,"").trim();if(d&&d!=="undefined"&&d!=="null")return c;Dt("Removing invalid Authorization header:",u),delete c.headers.Authorization}var h=t.tokenStorage.getAccessToken(),f=t.tokenStorage.getRefreshToken();return Dt(" Request interceptor: token exists:",!!h,"refreshToken exists:",!!f,"url:",c.url),h&&Kv(h)?(Dt(" Access token available - injecting into Authorization header"),c.headers.Authorization=a(h)):Dt(f?" Access token missing/empty but refresh token available - response interceptor will handle 401":" Both tokens missing/empty - allowing request (no token to inject)"),c},function(c){return Promise.reject(c)})}function vne(e){var t=e.useStandardizedConfig===!0;Dt("createCookieRefreshHandler called - useStandardizedConfig:",t);var n;if(t){var o=ine();n=ld(ld({},o),{},{canSetTokens:e.canSetTokens,cookieParser:e.cookieParser}),Dt(" Applied standardized cookie config:",n)}else{var s=e.accessTokenKey,r=e.refreshTokenKey,i=e.domain,a=e.path,l=e.secure,c=e.sameSite,u=e.canSetTokens,d=e.cookieParser;n={accessTokenKey:s,refreshTokenKey:r,domain:i,path:a,secure:l,sameSite:c,canSetTokens:u,cookieParser:d},Dt(" Applied custom cookie config:",n)}var h=new fne(n);e.accessTokenKey,e.refreshTokenKey,e.domain,e.path,e.secure,e.sameSite,e.canSetTokens,e.cookieParser;var f=Ite(e,rne);return new gne(ld(ld({},f),{},{storage:h,useStandardizedConfig:t}))}var Oo=function(e){return e.review="{reviewDomain}/{ws_code}",e.review_take="{reviewDomain}/{ws_code}?id={take_id}",e.review_scene="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",e.review_rendition="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",e.review_frame="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}&tab=comment&refresh_marker=true#type=frame&data={frame}",e.review_rendition_comment="{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}&tab=comment",e.review_comment="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",e.scene_hub="{baseDomain}/{ws_code}/{scene_id}?o=st",e.hub_rendition="{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",e.hub_comment="{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",e.people_insight="{baseDomain}/{ws_code}/{user_id}?o=pt",e.people_detail="{baseDomain}/{ws_code}/ws/ppl/{display_name}-{user_id}",e.project="{baseDomain}/{ws_code}/pl/dir/{entity_id}",e.project_focusMode="{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",e.woohoo="{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",e.update="{baseDomain}/{ws_code}/pl/au?id={entity_id}",e.core="{baseDomain}/{ws_code}",e}(Oo||{});Oo.review,Oo.review_take,Oo.review_scene,Oo.review_rendition,Oo.review_frame,Oo.review_rendition_comment,Oo.review_comment,Oo.scene_hub,Oo.hub_rendition,Oo.hub_comment,Oo.people_insight,Oo.people_detail,Oo.project,Oo.woohoo,Oo.update,Oo.core,Oo.project_focusMode;const YM={accessToken:"account.token",refreshToken:"account.refresh_token"},yne={baseUrl:"BASE_URL"},XM="/refresh-token",wne=3e5,Cne="*",ZM={Accept:"application/json","Content-Type":"application/json"},bne="undefined",Sne="No access token found",Pc={badRequest:400,unauthorized:401,tooEarly:425},Ene=[Pc.unauthorized,Pc.tooEarly,Pc.badRequest],_ne="unauthenticated",Rne="invalid_token",Tne="refresh_token_expired",Dne={type:"TOKEN_EXPIRED",message:"Authentication token has expired"},Ine="Session refreshed successfully",xne="Session expired. Please log in again.",Pne=e=>{const{error:t}=e??{};return typeof t=="string"?t:t==null?void 0:t.key},kne=e=>{var t,n;return((t=e==null?void 0:e.response)==null?void 0:t.status)!==Pc.badRequest?!1:Pne((n=e.response)==null?void 0:n.data)===Rne},Fne=()=>{},Ane=e=>sessionStorage.getItem(e)||"",U0=()=>{const e=lv.get(YM.accessToken);return e&&e!==bne?e:null},One=()=>!!lv.get(YM.refreshToken),Mne=()=>{const e=window.location.origin,t=Ane(yne.baseUrl);if(!t)return e;try{return new URL(t,e).origin}catch{return e}};class W0{constructor(t,n=Fne,o){this.client=t,this.showMessage=n,this.onAuthExpired=o}attach(){const t=vne({refreshTokenFn:n=>this.refresh(n),onRefreshSuccess:n=>{this.showMessage(Ine,"success"),this.client.defaults.headers.common.Authorization=`Bearer ${n.access_token}`},onRefreshFailure:()=>{this.showMessage(xne,"error")},useStandardizedConfig:!0});this.handler=t,mne(this.client,t,{retryStatusCodes:[...Ene],tokenExpiredDetection:W0.isTokenExpired})}refreshAccessToken(){return!this.handler||!One()?Promise.resolve(!1):(this.pendingRefresh??(this.pendingRefresh=this.handler.handleTokenRefresh().catch(()=>!1).finally(()=>{this.pendingRefresh=void 0})),this.pendingRefresh)}static isTokenExpired(t){var i,a;const n=(i=t==null?void 0:t.response)==null?void 0:i.status;if(n===Pc.tooEarly)return!0;const{error:o,details:s={}}=((a=t==null?void 0:t.response)==null?void 0:a.data)??{},r=typeof o=="string"?o:o==null?void 0:o.key;return n===Pc.badRequest||n!==Pc.unauthorized||typeof o=="string"||r!==_ne?!1:Object.keys(s).length===0||s.reason===Tne}async refresh(t){const n=await this.client.post(XM,{refresh_token:t}),o="data"in n&&n.data?n.data:n;return console.log("Refreshing tokens:",{tokens:o,res:n}),{access_token:o.access_token,refresh_token:o.refresh_token,expires_in:o.expires_in}}handleAuthExpired(){var t;if(window.self===window.top){(t=this.onAuthExpired)==null||t.call(this);return}window.parent.postMessage(Dne,Mne())}}class Nne{constructor(t={}){this.options={unwrapResponse:!0,withRefreshToken:!0,requireToken:!0,...t},this.client=to.create({baseURL:typeof t.baseURL=="string"?t.baseURL:"",timeout:t.timeout??wne,headers:{...ZM,...t.headers}}),this.setupRequestInterceptor(),this.setupResponseInterceptor(),this.setupErrorHandling()}get(t,n){return this.request({...n,method:"GET",url:t})}post(t,n,o){return this.request({...o,method:"POST",url:t,data:n})}put(t,n,o){return this.request({...o,method:"PUT",url:t,data:n})}patch(t,n,o){return this.request({...o,method:"PATCH",url:t,data:n})}delete(t,n){return this.request({...n,method:"DELETE",url:t})}request(t){return this.client.request(t)}setupRequestInterceptor(){this.client.interceptors.request.use(async t=>{const{baseURL:n,dynamicHeaders:o,requireToken:s}=this.options;typeof n=="function"&&(t.baseURL=n());const r=t.url===XM,i=r?U0():await this.resolveAccessToken();if(!i&&s&&!r)throw new Error(Sne);t.headers.set("Accept-Language",Cne),t.headers.has("Content-Type")||t.headers.set("Content-Type",ZM["Content-Type"]),t.headers.has("Content-Type")&&t.headers.get("Content-Type")==="multipart/form-data"&&t.headers.delete("Content-Type"),i&&t.headers.set("Authorization",`Bearer ${i}`);for(const[a,l]of Object.entries((o==null?void 0:o(t))??{}))t.headers.set(a,l);return t})}async resolveAccessToken(){const t=U0();return t||!this.tokenRefresher?t:(await this.tokenRefresher.refreshAccessToken(),U0())}setupResponseInterceptor(){this.client.interceptors.response.use(t=>this.options.unwrapResponse?t.data:t)}setupErrorHandling(){const{withRefreshToken:t,showMessage:n,onAuthExpired:o,onError:s}=this.options;t&&(this.tokenRefresher=new W0(this.client,n,o),this.tokenRefresher.attach()),this.client.interceptors.response.use(void 0,r=>(kne(r)&&(o==null||o("/sw?redirect=1")),Promise.reject(r))),s&&this.client.interceptors.response.use(void 0,s)}}const Lne=5,Vne=1e3,Bne=3,$ne="default",Hne=e=>new URL(e,"http://localhost").pathname;class Gne{constructor(t={}){this.groups=new Map,this.defaultLimit=t.defaultLimit??Lne,this.rules=t.rules??[],this.releaseDelayMs=t.releaseDelayMs??Vne}async run(t,n){const o=this.resolveGroup(t);await this.acquire(o);try{return await n()}finally{this.release(o)}}resolveGroup(t){const n=Hne(t),o=this.rules.find(i=>i.pattern.test(n)),s=o?o.pattern.source:$ne;let r=this.groups.get(s);return r||(r={limit:(o==null?void 0:o.limit)??this.defaultLimit,ongoing:0,queue:[]},this.groups.set(s,r)),r}acquire(t){return new Promise(n=>{const o=()=>{t.ongoing++,n()};t.ongoing<t.limit?o():t.queue.push(o)})}release(t){t.ongoing--;const n=t.queue.shift();n&&setTimeout(n,this.releaseDelayMs)}}const Une=(e,t)=>{const n=new Gne(t),o=to.getAdapter(e.defaults.adapter);return e.defaults.adapter=s=>n.run(s.url??"",()=>o(s)),n},Wne=(e,{maxRetries:t=Bne}={})=>{e.interceptors.response.use(void 0,async n=>{var a,l;const o=n.config;if(((a=n.response)==null?void 0:a.status)!==429||!o)return Promise.reject(n);const s=(o._retryCount??0)+1;if(s>t)return Promise.reject(n);o._retryCount=s;const r=Number.parseInt(String(((l=n.response.headers)==null?void 0:l["retry-after"])??""),10),i=Number.isNaN(r)?2**s*1e3:r*1e3;return await new Promise(c=>setTimeout(c,i)),e.request(o)})},zne=6e4,jne="/start",Kne=(e=jne)=>{const n=`${sessionStorage.getItem("BASE_URL")||""}${e}`;console.log("Redirecting to auth URL:",n),window.location.replace(n)};function qne(e,t){const n=sessionStorage.getItem(e)||"";return(n==null?void 0:n.length)>0?n:t}class Yne{constructor(t,n={}){const{concurrency:o,rateLimitRetry:s,...r}=n,i=()=>qne("API_BASE_URL","");this.callbackFunc=t,this.api=new Nne({baseURL:i,timeout:zne,requireToken:!0,onAuthExpired:Kne,...r,unwrapResponse:!1,showMessage:t}),this.axios=this.api.client,o!==!1&&Une(this.axios,o),s!==!1&&Wne(this.axios,s)}buildUrl(t=""){const n=t.replace(/^\//,"");return!n.startsWith("http://")&&!n.startsWith("https://")?`/${n}`:n}buildQueryParams(t){const n=new URLSearchParams;Object.entries(t).forEach(([s,r])=>{r!=null&&r!==""&&(Array.isArray(r)?r.forEach(i=>n.append(s,String(i))):typeof r=="object"?n.append(s,JSON.stringify(r)):n.append(s,String(r)))});const o=n.toString();return o?`?${o}`:""}async send(t,n,{params:o,data:s,options:r}={}){try{const i=o?this.buildQueryParams(o):"",a={...r,method:t,url:`${this.buildUrl(n)}${i}`};return s!==void 0&&(a.data=s),(await this.axios.request(a)).data}catch(i){throw Rte(i)}}get(t="",n,o){return this.send("GET",t,{params:n,options:o})}post(t="",n,o,s){return this.send("POST",t,{params:n,data:o,options:s})}put(t="",n,o){return this.send("PUT",t,{data:n,options:o})}patch(t="",n,o){return this.send("PATCH",t,{data:n,options:o})}delete(t="",n,o){return this.send("DELETE",t,{data:n,options:o})}}const Xne=({domainApi:e,wsCode:t,entityId:n})=>({list_cursor:{url:`${e}/v1/workspace/${t}/item/2`,method:"post",code:"list_cursor"},assignedUser:{url:`${e}/v1/workspace/${t}/item/2/assigned-users`,method:"post",code:"assignedUser"},metricValues:{url:`${e}/v1/workspace/${t}/item/2/metrics`,method:"post",code:"metricValues"},multipleAssignableUser:{url:`${e}/v1/workspace/${t}/item/2/assignable-users`,method:"post",code:"multipleAssignableUser"},assignableUser:{url:`${e}/v1/workspace/${t}/item/2/assignable-users`,method:"post",code:"assignableUser"},assignableStatus:{url:`${e}/v1/workspace/${t}/item/2/assignable-statuses`,method:"post",code:"assignableStatus"},delete_rendition:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-rendition`,method:"delete",code:"delete_rendition"},delete_thumbnail:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-thumbnail`,method:"delete",code:"delete_thumbnail"},archive_item:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"archive_item"},unarchive_item:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"unarchive_item"},removeAssignee:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-assignee`,method:"delete",code:"removeAssignee"},basicInfor:{url:`${e}/v1/workspace/${t}/tile/people/ws-user-roles/{userId}/basic-info`,method:"get",code:"basicInfor"},bulkDelete:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete`,method:"delete",code:"bulkDelete"},bulkArchive:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"bulkArchive"},bulkDateUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-date-update`,method:"put",code:"bulkDateUpdate"},bulkAssignUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-assignee-update`,method:"put",code:"bulkAssignUpdate"},bulkStatusUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-status-update`,method:"put",code:"bulkStatusUpdate"},bulkMetricUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-metric-update`,method:"put",code:"bulkMetricUpdate"},getPermission:{url:`${e}/v1/workspace/${t}/item/2/permissions`,method:"post",code:"getPermission"},getUserPermission:{url:`${e}/v1/workspace/${t}/permissions`,method:"get",code:"getUserPermission"},bulkUnarchive:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"bulkUnarchive"},downloadTemplate:{url:`${e}/v1/workspace/${t}/item/2/download-sample`,method:"get",code:"downloadTemplate"},importItems:{url:`${e}/v1/workspace/${t}/item/2/import-from-file`,method:"post",code:"importItems"},exportItems:{url:`${e}/v1/workspace/${t}/item/2/export`,method:"get",code:"exportItems"},updateFromFile:{url:`${e}/v1/workspace/${t}/item/2/update-from-file`,method:"post",code:"updateFromFile"},metricList:{url:`${e}/v1/workspace/${t}/entity/2/metrics`,method:"get",code:"metricList"},getEntityDetail:{url:`${e}/workspace/${t}/entities/${n}?include_permission=1`,method:"get",code:"getEntityDetail"},item:{url:`${e}/v1/workspace/${t}/item/2/update`,method:"put",code:"item"},me:{url:`${e}/v1/me`,method:"get",code:"me"},workspaces:{url:`${e}/v1/workspaces`,method:"get",code:"workspaces"},entityUserRoles:{url:`${e}/v1/workspace/${t}/entity/2/users`,method:"get",code:"entityUserRoles"},templateFlowStatuses:{url:`${e}/workspace/${t}/entities/${n}/template_flow_statuses`,method:"get",code:"templateFlowStatuses"},createNewItem:{url:`${e}/v1/workspace/${t}/item/2/new?entity_id=${n}`,method:"post",code:"createNewItem"},getAssignableStatuses:{url:`${e}/v1/workspace/${t}/entity/2/assignable-statuses`,method:"get",code:"getAssignableStatuses"},getAssignableAssignees:{url:`${e}/v1/workspace/${t}/entity/2/users`,method:"get",code:"getAssignableAssignees"},getFilterStatuses:{url:`${e}/v1/workspace/${t}/entity/2/statuses`,method:"get",code:"getFilterStatuses"},bulkRename:{url:`${e}/v1/workspace/${t}/item/2/bulk-rename`,method:"put",code:"bulkRename"}}),Zne=(e,t)=>{const n=new Blob([e]),o=globalThis.URL.createObjectURL(n),s=document.createElement("a");s.href=o,s.download=t,document.body.appendChild(s),s.click(),s.remove(),globalThis.URL.revokeObjectURL(o)};class JM extends Yne{constructor(t,n,o){const s=n==null?void 0:n.domainApi,r=n==null?void 0:n.wsCode,i=(n==null?void 0:n.entityId)||"";super(o,{concurrency:{rules:[{pattern:/^\/api\/v1\/workspace\/[^/]+\/item\/2$/,limit:1},{pattern:/^\/api\/v1\/workspace\/[^/]+\/item\/2\/metrics$/,limit:5}]}}),this.events=Object.create(null);const a=Xne({domainApi:s,wsCode:r,entityId:i}),l={};Object.entries(a).forEach(([c,u])=>{const d=c;t[d]?l[d]=t[d]:(console.warn(`API config for ${d} is missing, using base config.`),l[d]=u)}),this.apiConfig=l}on(t,n){var o;((o=this.events)[t]??(o[t]=[])).push(n)}off(t,n){const o=this.events[t];o&&(this.events[t]=o.filter(s=>s!==n))}emit(t,...n){const o=this.events[t];o!=null&&o.length&&o.forEach(s=>{try{s(...n)}catch(r){console.error(`Error in event listener for ${t}:`,r)}})}buildHeaders(t){return typeof FormData<"u"&&t instanceof FormData?{"Content-Type":"multipart/form-data"}:{}}async _requestHandler({method:t,path:n,params:o,payload:s,code:r,responseType:i,autoDownload:a=!0}){var u,d;const l=this.buildHeaders(s);let c;try{if(c=await this.axios.request({method:t,url:n,params:o,data:s,headers:l,responseType:i}),(((u=c.headers)==null?void 0:u["content-type"])||"").includes("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")){const f=((d=c.headers)==null?void 0:d["content-disposition"])||"",p=f.includes("filename=")?f.split("filename=")[1]:"exported_items.xlsx";a&&Zne(c.data,p)}if(c.status>=400&&c.status<=500)throw new Error(`Client error (${c.status}): ${c.statusText}`);return this.emit("call-api",{apiCode:r,path:n,params:o,payload:s,res:c,success:!0}),c.data}catch(h){throw console.error("API Request Error:",h),h.code==="ERR_NETWORK"||!navigator.onLine?this.emit("call-api",{path:n,params:o,payload:s,error:new Error("You are currently offline. Please check your network connection."),success:!1,apiCode:"offline"}):this.emit("call-api",{path:n,params:o,payload:s,error:h,success:!1,apiCode:r,res:h==null?void 0:h.response}),h}}generateUrl(t,n){let o=t;return Object.entries(n).forEach(([s,r])=>{o=o.replace(`{${s}}`,String(r))}),o}async request(t,n,o={}){const{url:s,code:r,method:i}=this.apiConfig[t],a=this.generateUrl(s,n);return this._requestHandler({method:i,path:a,params:o.params,payload:o.payload,code:r,responseType:o.responseType,autoDownload:o.autoDownload})}async getAllItem_cursor(t){var r;const n=t.workspaceId,o={entity_ids:((r=t.entityIds)==null?void 0:r.join(","))||"",cursor:t.cursor||void 0,per_page:t.pageSize||t.perPage||20,offset:t.offset||void 0,search:t.search||t.q||void 0,include_signature:1,include:"last_updated_by,property,last_completed_by",include_permission:"{include_permission}",assignee_any_ina:(t==null?void 0:t.assignee_any_ina)||"",assignee_all_ina:(t==null?void 0:t.assignee_all_ina)||void 0,with_not_assigned:t.with_not_assigned||void 0,status_ina:t.status_ina||void 0,status_eq:t.status_eq||void 0,start_date_gte:t.start_date_gte||void 0,start_date_lte:t.start_date_lte||void 0,start_date_btw:t.start_date_btw||void 0,due_date_gte:t.due_date_gte||void 0,due_date_lte:t.due_date_lte||void 0,due_date_btw:t.due_date_btw||void 0,condition_combine_type:t.condition_combine_type||"or",preflight_status:t.preflight_status||void 0},s=t.sortBy;return this.request("list_cursor",{workspaceId:n},{params:o,payload:{sort_by:s}})}async getAssignedUser(t){const n={item_ids:t.item_ids||[],metric_ids:t.metric_ids||[]},o={per_page:t.per_page};return this.request("assignedUser",{workspaceId:t.workspaceId},{params:o,payload:n})}async getMetricList({workspaceId:t,entityId:n,page:o,query:s,per_page:r}){return this.request("metricList",{workspaceId:t,entityId:n},{params:{status_ed:1,include:"metric_type",entity_id:n,include_permission:1,per_page:r||100,page:o||1,name_like:s||void 0,permission:"1,2"}})}async getMetricValues({workspaceId:t,item_ids:n,per_page:o,metric_ids:s}){const r={item_ids:n,metric_ids:s};return this.request("metricValues",{workspaceId:t},{params:{per_page:o,include_permission:1},payload:r})}async multipleAssignableUser(t){const n=t.workspaceId,o=t.itemIds,s={page:t.page||1,per_page:t.perPage,display_name_like:t.q||"",item_ids:o||[]};return o.length||(delete s.item_ids,s.entity_id=t.entityId),this.request("multipleAssignableUser",{workspaceId:n},{payload:s})}async getAssignableStatus(t){var s;const n=t.workspaceId,o={item_ids:t.itemIds||[],page:t.page||1,per_page:t.perPage||10,name_like:t.name_like||""};return((s=t.itemIds)==null?void 0:s.length)==0&&(o.entity_id=t.entityId,delete o.item_ids),this.request("assignableStatus",{workspaceId:n||""},{payload:o})}async updateSceneName({workspaceId:t,entityId:n,itemId:o,name:s}){const r={item_id:o,entity_id:n,name:s,include:"item_user_roles"};return this.request("item",{workspaceId:t,itemId:o},{payload:r})}async deleteScene(t,n,o){const s={item_ids:[o]};return this.request("bulkDelete",{workspaceId:t,entityId:n},{payload:s})}async deleteThumbnail({workspaceId:t,itemIds:n,entityId:o,filterParams:s}){const r={item_ids:n,entity_id:o};return!n||n.length===0?r.item_ids=void 0:r.entity_id=void 0,this.request("delete_thumbnail",{workspaceId:t},{payload:r,params:s})}async deleteRendition({workspaceId:t,itemIds:n,deleteAll:o=!1,entityId:s,filterParams:r}){const i={item_ids:n,delete_all:o?1:void 0,entity_id:s};return!n||n.length===0?i.item_ids=void 0:i.entity_id=void 0,this.request("delete_rendition",{workspaceId:t},{payload:i,params:r})}async archiveScene(t,n,o){const s={item_ids:o,status:0};return this.request("archive_item",{workspaceId:t,entityId:n},{payload:s})}async changeDate({workspaceId:t,itemIds:n,startDate:o,dueDate:s,entityId:r,filterParams:i}){const a={item_ids:n,start_date:o,due_date:s,entity_id:r};return this.request("bulkDateUpdate",{workspaceId:t},{payload:a,params:i})}async updateAssignee(t){const{workspaceId:n,itemIds:o,userIds:s,entityId:r}=t,i={item_ids:o,ws_user_role_ids:s,entity_id:r};return this.request("bulkAssignUpdate",{workspaceId:n},{payload:i,params:t.filterParams})}createUpdateEntityPayload(t){const{itemIds:n,userIds:o,entityId:s}=t,r={item_ids:n,ws_user_role_ids:o,entity_id:s};return!n||n.length===0?(r.item_ids=void 0,r.entity_id=s):(r.item_ids=n,r.entity_id=void 0),r}async removeAssignee(t){const n=this.createUpdateEntityPayload(t);return this.request("removeAssignee",{workspaceId:t.workspaceId},{payload:n,params:t.filterParams})}async replaceAssignee(t){const{workspaceId:n,itemIds:o,userIds:s,entityId:r}=t,i={item_ids:o,ws_user_role_ids:s,entity_id:r};return this.request("bulkAssignUpdate",{workspaceId:n},{params:{replace:1,...t.filterParams},payload:i})}async addAssignee({workspaceId:t,itemIds:n,userIds:o,entityId:s,filterParams:r}){const i={item_ids:n,ws_user_role_ids:o,entity_id:s};return this.request("bulkAssignUpdate",{workspaceId:t},{payload:i,params:r})}async unAssignAll(t){const{workspaceId:n,entityId:o,itemIds:s,filterParams:r}=t,i={item_ids:s,entity_id:o,ws_user_role_ids:[]};return!s||s.length===0?i.item_ids=void 0:i.entity_id=void 0,this.request("removeAssignee",{workspaceId:n,entityId:String(o)},{payload:i,params:r})}async updateItemStatus(t){const{workspaceId:n,itemIds:o=[],statusId:s,entityId:r}=t,i={item_ids:o,template_flow_status_id:s};return o.length||(i.item_ids=void 0,i.entity_id=r),this.request("bulkStatusUpdate",{workspaceId:n},{payload:i,params:t.filterParams})}async getUserInformation(t,n){return this.request("basicInfor",{workspaceId:t,userId:n})}async bulkDeleteItems({workspaceId:t,itemIds:n,entityId:o,filterParams:s}){const r={item_ids:n,entity_id:o};return!n||n.length===0?r.item_ids=void 0:r.entity_id=void 0,this.request("bulkDelete",{workspaceId:t},{payload:r,params:s})}async bulkUnarchiveItems({workspaceId:t,itemIds:n,entityId:o,filterParams:s}){const r={item_ids:n,status:1,entity_id:o};return!n||n.length===0?r.item_ids=void 0:r.entity_id=void 0,this.request("bulkUnarchive",{workspaceId:t},{payload:r,params:s})}async bulkArchiveItems({workspaceId:t,itemIds:n,entityId:o,filterParams:s}){const r={item_ids:n,status:0,entity_id:o};return!n||n.length===0?r.item_ids=void 0:r.entity_id=void 0,this.request("bulkArchive",{workspaceId:t},{payload:r,params:s})}async bulkUpdateMetric(t){const{workspaceId:n,itemIds:o,metricId:s,value:r,clear:i}=t,a={item_ids:o,metric_id:s,metric_value:r,clear:i??(r==null?1:0),entity_id:t.entityId};return t.itemIds===void 0?(delete a.item_ids,a.entity_id=String(t.entityId)):(a.item_ids=o,a.entity_id=void 0),this.request("bulkMetricUpdate",{workspaceId:n},{payload:a,params:t.filterParams})}async getPermissionForItems({workspaceId:t,itemIds:n}){const o={item_ids:n};return this.request("getPermission",{workspaceId:t},{payload:o,params:{per_page:50}})}async unarchiveScene(t,n,o){const s={item_ids:o,status:1};return this.request("unarchive_item",{workspaceId:t,entityId:n},{payload:s})}async getUserPermission(t){return this.request("getUserPermission",{workspaceId:t})}async getEntityDetail(t,n){return this.request("getEntityDetail",{workspaceId:t,entityId:n})}async downloadTemplate(t,n,o=!0){return this.request("downloadTemplate",{workspaceId:t,entityId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n},autoDownload:o})}async downloadExportedItemsFile(t,n,o=!0){return this.request("exportItems",{workspaceId:t,exportId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n},autoDownload:o})}async addNewSceneViaImportFile(t,n,o){return this.request("importItems",{workspaceId:t,entityId:n},{payload:o})}async overwriteScenesViaImportFile(t,n,o){return this.request("updateFromFile",{workspaceId:t,entityId:n},{payload:o})}async getMe(){return this.request("me",{})}async getWorkspaces(t){const n={page:1,per_page:1,"ws_user_role>status_eq":1,include:"owner",include_ws:t};return this.request("workspaces",{},{params:n})}async getEntityUserRoles(t){const{workspaceId:n,page:o,per_page:s,display_name_like:r,entity_ids:i}=t;return this.request("entityUserRoles",{workspaceId:n},{params:{page:o,per_page:s,display_name_like:r,entity_ids:i}})}async getTemplateFlowStatuses(t){const{workspaceId:n,entityId:o}=t;return this.request("templateFlowStatuses",{workspaceId:n,entityId:o},{params:{per_page:100,page:t.page??1,all:1,name_like:t.name_like}})}async addNewItem(t,n,o){return this.request("createNewItem",{workspaceId:t,entityId:n},{payload:o})}async getFilterStatuses(t,n,o){return this.request("getFilterStatuses",{workspaceId:t,entityId:n},{params:o})}async getAssignableStatuses(t,n){return this.request("getAssignableStatuses",{workspaceId:t},{params:n})}async getAssignableAssignees(t,n){return this.request("getAssignableAssignees",{workspaceId:t},{params:n})}async bulkRename(t){return this.request("bulkRename",{workspaceId:t.workspaceId,entityId:t.entityId},{payload:t.payload,params:t.filter})}}const Jne=(e,t,n,o,s,r,i)=>{const{apiServices:a}=io(n,o),l=H(!1),c=()=>{l.value=!0},u=()=>{ft(()=>{setTimeout(()=>{l.value=!1},500)})},d=Y(()=>!!(s!=null&&s.value&&(r!=null&&r.value))),h=In("filterParams",null);return{isUpdating:l,handleUpdate:async p=>{var v;const g=p.value;c();try{const C={itemIds:e.value.itemIds,metricId:p.id,workspaceId:String(e.value.workspaceId),filterParams:h!=null&&h.value?h.value:void 0};p.value==null?C.clear=1:C.value=g,d.value?(delete C.itemIds,C.entityId=String(o.entityId)):C.itemIds=e.value.itemIds;const S=await((v=a.value)==null?void 0:v.bulkUpdateMetric(C));(S==null?void 0:S.message)=="Done"&&t(p)}catch(C){console.error("Error during bulk metric update:",C)}u()}}},Qne=bt(tt({__name:"MetricUpdateButton",props:{workspaceId:{},entityId:{},variant:{},rowSelected:{},selectedIds:{},disabled:{type:Boolean},selectedAll:{type:Boolean}},emits:["update","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=_O(),o=H([]),s=e,r=t,i=H([]),a=H(null),l=j=>{var q,V,k;const Q=o.value.findIndex(G=>G.id===j.id);a.value=Q;const re=(q=i.value[Q])==null?void 0:q.$el;(V=_.value)==null||V.scrollTo(Q*30),re&&re.scrollIntoView({behavior:"smooth",block:"center"}),c(Q),(k=i.value[Q])==null||k.show()},c=j=>{a.value=j,i.value.forEach((Q,re)=>{re!==j&&Q&&Q.hide()})},u=H(""),d=()=>{u.value="",i.value.forEach(j=>{j==null||j.hide()}),a.value=null},h=Y(()=>s.selectedIds||[]),f=Y(()=>({itemIds:h.value,workspaceId:String(s.workspaceId)})),p=In("isSelectAll",H(!1)),g=In("bulkUpdate",H(!1)),v=H(null),{handleUpdate:C,isUpdating:S}=Jne(f,j=>{var Q;r("update",j),d(),(Q=v.value)==null||Q.hide()},!1,s,g,p),b=async j=>{var Q;r("update-start");try{await C(j),r("update-completed")}catch{r("update-failed"),(Q=v.value)==null||Q.open()}},y=j=>{d(),ft(()=>{var Q;(Q=_.value)==null||Q.focus()})},_=H(null),E=(j,Q)=>{var re;j?(re=_.value)==null||re.focus():d(),j&&Q!==j&&z("")},D=H(!0),T=H(!0),{apiServices:P}=io(!1,s),L=async(j,Q,re)=>{var q;try{return re?T.value=!0:D.value=!0,await((q=P.value)==null?void 0:q.getMetricList({workspaceId:s.workspaceId||"",entityId:s.entityId||"",page:j,query:Q,per_page:10}))}catch(V){throw console.error("Failed to fetch metric list:",V),V}finally{D.value=!1,T.value=!1}},I=H(0),x=H(!0),O=j=>({id:String(j.id),label:String(j.name),value:String(j.id),description:j.morpheme_value?`${String(j.morpheme_value)}`:"",type:n.checkEditType(j),metricConfig:j}),N=j=>j.filter(Q=>!Q.formula).filter(Q=>{var re;return((re=Q==null?void 0:Q.auth_permission)==null?void 0:re.permission)==2}).map(O),F=async()=>{I.value+=1;const j=await L(I.value,u.value,!0);if(j&&j.data){const Q=N(j.data);o.value=[...o.value,...Q],x.value=j.meta.last_page!=j.meta.current_page}else x.value=!1},z=async j=>{u.value=j,I.value=1;try{const Q=await L(I.value,u.value);Q&&Q.data?(o.value=N(Q.data),x.value=Q.meta.last_page!=Q.meta.current_page):o.value=[]}catch{o.value=[]}};return(j,Q)=>(K(),ze(Hf,{ref_key:"wrapperRef",ref:v,isUpdating:W(S),disabled:s.disabled||W(S),onOnVisibleChange:E},{trigger:be(({hide:re,disabled:q})=>[ye(pt,{variant:s.variant,loading:W(S),disabled:q,onEscape:re},{default:be(()=>[ye(ct,{src:"SquareRootVariable",class:"icon"}),Q[1]||(Q[1]=nt(" Metric ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:be(({isVisible:re,popupRef:q,hide:V})=>[qe(ye(ha,{ref_key:"searchListRef",ref:_,style:{width:"320px"},options:o.value,loading:D.value,"loading-more":T.value,"selected-id":void 0,"has-more":x.value,onSearch:z,onSelect:l,onLoadMore:Q[0]||(Q[0]=()=>F()),onCancel:V},{item:be(({item:k,index:G,selectedIndex:ee})=>[ye(lQ,{ref:ge=>i.value[G]=ge,label:k.label,type:k.type,morpheme:k.description||"",onFocusOnSearch:y,onOpen:ge=>c(G),attachTo:q,config:k.metricConfig,onHandleUpdate:b,class:se(["metric-update-item",{selected:a.value===G||ee===G}])},null,8,["label","type","morpheme","onOpen","attachTo","config","class"])]),"extra-item":be(()=>[...Q[2]||(Q[2]=[Te("div",{style:{width:"250px"}},null,-1)])]),"empty-list":be(()=>[...Q[3]||(Q[3]=[nt("No options available.",-1)])]),_:2},1032,["options","loading","loading-more","has-more","onCancel"]),[[lr,re]])]),default:be(()=>[Q[4]||(Q[4]=nt(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),[["__scopeId","data-v-a645d131"]]),qv=Sc("bulkUpdate",()=>{const e=H(At.UNCHECK),t=Go({loaded:0,total:0}),n=u=>{t.total=u},o=u=>{t.loaded=u},s=Go({isBulkUpdating:!1});function r(u){s.isBulkUpdating=u}const i=H({}),a=u=>{i.value=u},l=(u,d)=>{i.value[u]=d},c=u=>{e.value=u};return{bulkUpdateState:s,setIsBulkUpdating:r,selectionIds:i,setSelectionIds:a,setCheckedForId:l,setSelectionStatus:c,selectionStatus:e,rowCount:t,setTotalRowCount:n,setLoadedRowCount:o,handelSelectAll:()=>{c(At.CHECKED)}}}),eoe={class:"status-label"},QM=bt(tt({__name:"StatusItem",props:{status:{},selected:{type:Boolean},focused:{type:Boolean},hovered:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=Kt,o=e,s=t,r=a=>{s("select",a)},i=a=>new On(a).isLight()?"#f3f5f8":"#d7d7d7";return(a,l)=>(K(),ce("div",{class:se(["status-option",{selected:o.selected,focused:o.focused,hovered:o.hovered}]),onClick:l[0]||(l[0]=c=>r(e.status.id))},[Te("div",{class:"status-color",style:hn({backgroundColor:e.status.color,borderColor:i(e.status.color)})},null,4),qe((K(),ce("div",eoe,[xt(a.$slots,"label",{},()=>[nt(it(e.status.name),1)],!0)])),[[W(n),{content:e.status.name,delay:[1e3,0]}]])],2))}}),[["__scopeId","data-v-aeaa75a4"]]),toe=["innerHTML"],eN=bt(tt({__name:"StatusEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{},callback:{type:Function}},emits:["updated","error","cancel","start-update","finish-update"],setup(e,{expose:t,emit:n}){const o={PER_PAGE:50,INITIAL_PAGE:1},s=e,r=n,i=H([]),a=H(!1),l=H(!1),c=H(null),u=H(o.INITIAL_PAGE),d=H(!0),h=H(0),f=H(""),p=Y(()=>{var O;return(O=s.value)==null?void 0:O.id});Y(()=>!!(s.id||s.ids&&s.ids.length>0));const g=O=>({label:O.name,value:O.id,selected:p.value===O.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:O,id:O.id,color:O.color}),v=Y(()=>{const O=new Set;return s.id&&O.add(String(s.id)),s.ids&&s.ids.forEach(N=>{N&&O.add(String(N))}),Array.from(O)}),C=In("bulkUpdate",!1),{apiServices:S}=io(!C,s),b=qv(),{selectionStatus:y}=us(b),_=In("filterParams",null),E=async(O=o.INITIAL_PAGE,N="",F=!1)=>{var z,j,Q,re;F?l.value=!0:a.value=!0,c.value=null;try{const q={workspaceId:String(s.workspaceId),itemIds:v.value,page:O,perPage:o.PER_PAGE,name_like:N.trim(),..._||{},entityId:String(s.entityId)};if(((z=S.value)==null?void 0:z.getAssignableStatus)===void 0)throw new Error("API service getAssignableStatus is undefined");const V=await((j=S.value)==null?void 0:j.getAssignableStatus(q));if(!(V!=null&&V.data)){F||(i.value=[]),d.value=!1;return}const k=V.data.map(g);i.value=F?[...i.value,...k]:k,h.value=((Q=V.meta)==null?void 0:Q.total)??V.data.length,d.value=!((re=V.meta)!=null&&re.on_last_page),u.value=O}catch(q){console.error("Error fetching statuses:",q),c.value="Failed to load statuses",F||(i.value=[]),d.value=!1,r("error",c.value)}finally{a.value=!1,l.value=!1}},D=mr(async O=>{f.value=O,u.value=o.INITIAL_PAGE,await E(o.INITIAL_PAGE,O,!1)},Ci),T=async()=>{!d.value||l.value||await E(u.value+1,f.value,!0)},P=()=>{var O;r("cancel"),(O=s.params)==null||O.api.stopEditing()},L=async O=>{var N,F,z;try{const j={workspaceId:String(s.workspaceId),itemIds:v.value,statusId:String(O.value),entityId:String(s.entityId),filterParams:_!=null&&_.value?_==null?void 0:_.value:void 0};if(y.value==At.CHECKED&&C&&(j.itemIds=void 0,j.entityId=String(s.entityId)),r("start-update"),!await S.value.updateItemStatus(j))throw new Error("Status update failed: empty response");r("updated",{workspaceId:String(s.workspaceId),itemIds:v.value,isUpdateAll:y.value==At.CHECKED&&C,data:{id:O.id,name:O.label,color:O.color}}),s.params&&((F=s.params)==null||F.node.setData({...(N=s.params)==null?void 0:N.node.data,status:{id:O.id,name:O.label,color:O.color}}),(z=s.params)==null||z.api.stopEditing()),r("finish-update")}catch(j){console.error("Error updating status:",j),c.value="Failed to update status",r("error",c.value)}},I=Y(()=>i.value.map(O=>({...O})));Qe([()=>s.id,()=>s.workspaceId,()=>s.ids],()=>{E()},{deep:!0,immediate:!0});const x=H(null);return en(()=>{ft(()=>{var O;(O=x.value)==null||O.focus()})}),t({refresh:()=>E(o.INITIAL_PAGE,f.value,!1),loadMore:T,focus:()=>{var O;return(O=x.value)==null?void 0:O.focus()}}),(O,N)=>{var F;return K(),ze(ha,jt({ref_key:"popupRef",ref:x},s,{"selected-id":(F=s.value)==null?void 0:F.id,options:I.value,loading:a.value,"loading-more":l.value,"has-more":d.value,error:c.value,onSearch:W(D),onSelect:L,onLoadMore:T,onCancel:P,onClose:P}),{item:be(({item:z,selectedIndex:j,isSelected:Q,handleItemHover:re,getHighlightedLabel:q,query:V,idx:k})=>[(K(),ze(QM,{key:z.value,status:z.data,selected:Q(z),onMouseover:G=>re(k),onSelect:G=>L(z),hovered:k===j},{label:be(()=>[V?(K(),ce("span",{key:0,class:se([O.$style["item-label"],O.$style.match]),style:{flex:"1"},innerHTML:q(z.label)},null,10,toe)):(K(),ce("span",{key:1,class:se(O.$style["item-label"]),style:{flex:"1"}},it(z.label),3))]),_:2},1032,["status","selected","onMouseover","onSelect","hovered"]))]),_:1},16,["selected-id","options","loading","loading-more","has-more","error","onSearch"])}}}),[["__cssModules",{$style:{"item-label":"_item-label_7ir12_1"}}]]),noe=tt({__name:"StatusUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},disabled:{type:Boolean},selectedAll:{type:Boolean}},emits:["updated","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=e,o=Y(()=>{const f=ro();return f==null?void 0:f.appContext.config.globalProperties.apiServices}),s=t,r=H(!1),i=H(null),a=f=>{try{r.value=!1,s("updated",f)}catch(p){console.error("Error handling status update:",p)}finally{s("update-completed")}},l=Y(()=>({apiServices:o.value,ids:n.ids,workspaceId:n.workspaceId,entityId:n.entityId,selectedAll:n.selectedAll}));ui("bulkUpdate",!0);const c=f=>{var p,g;console.trace("handleUpdateCompleted called with success:",f),r.value=!1,f?(s("update-completed"),(p=i.value)==null||p.destroy()):(s("update-failed"),(g=i.value)==null||g.open())},u=H(null),d=(f,p)=>{var g;f&&((g=u.value)==null||g.focus())},h=()=>{r.value=!0,s("update-start")};return Qe(()=>n.ids,()=>{}),(f,p)=>(K(),ze(Hf,{ref_key:"wrapperRef",ref:i,isUpdating:r.value,disabled:n.disabled||r.value,onOnVisibleChange:d},{trigger:be(({hide:g,disabled:v})=>[ye(pt,{variant:n.variant,loading:r.value,disabled:v,onEscape:g},{default:be(()=>[ye(ct,{src:"Square",class:"icon"}),p[2]||(p[2]=nt(" Status ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:be(({hide:g})=>[ye(eN,jt({disabled:r.value,ref_key:"statusRef",ref:u},l.value,{onUpdated:a,onCancel:g,onStartUpdate:h,onFinishUpdate:p[0]||(p[0]=v=>c(!0)),onError:p[1]||(p[1]=v=>c(!1)),callback:()=>{}}),null,16,["disabled","onCancel"])]),default:be(()=>[p[3]||(p[3]=nt(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),jr=" ",z0=e=>e.replace(/[\r\n]+/g," "),Yv=e=>e instanceof HTMLElement&&e.classList.contains("locked-tag"),Ws=e=>(e==null?void 0:e.nodeType)===Node.TEXT_NODE,j0=e=>{var t;return((t=e instanceof Element?e:e.parentElement)==null?void 0:t.closest(".locked-tag"))??null},ga=e=>{let t=0,n=e.length;return Yv(e.previousSibling)&&e.data.startsWith(jr)&&(t=1),Yv(e.nextSibling)&&n>t&&e.data.endsWith(jr)&&(n-=1),{start:t,end:n}},ooe=e=>{if(!Ws(e))return!1;const{start:t,end:n}=ga(e);return n<=t},tN=e=>{const t=j0(e.startContainer),n=j0(e.endContainer);return t&&e.setStartAfter(t),n&&e.setEndAfter(n),e},soe=(e,t)=>e.length===t.length&&e.every((n,o)=>{const s=t[o];return typeof n=="string"||typeof s=="string"?n===s:n.id===s.id&&n.text===s.text&&n.direction===s.direction});class roe{constructor(t){Tn(this,"editor",null);Tn(this,"handleInput",()=>{this.editor&&(this.sanitize(),this.ensureTagPadding(),this.normalizeCaret(),this.options.onChange(this.parse()))});Tn(this,"handlePaste",t=>{var n;t.preventDefault(),this.insertPlainText(((n=t.clipboardData)==null?void 0:n.getData("text/plain"))??"")});Tn(this,"handleDrop",t=>{var o,s;t.preventDefault();const n=((o=t.dataTransfer)==null?void 0:o.getData("text/plain"))??"";n&&this.insertPlainText(n,(s=document.caretRangeFromPoint)==null?void 0:s.call(document,t.clientX,t.clientY))});Tn(this,"handleBeforeInput",t=>{const n=t.inputType;(n.startsWith("format")||n==="insertParagraph"||n==="insertLineBreak"||n==="insertFromDrop"||n==="insertFromYank")&&t.preventDefault()});Tn(this,"handleClick",t=>{const n=this.editor,o=window.getSelection();if(!n||!(o!=null&&o.isCollapsed)||t.target!==n)return;const s=document.createRange();if(s.selectNodeContents(n),t.clientX<=s.getBoundingClientRect().right)return;const[r,i]=this.getBoundaryPoint("end");o.collapse(r,i),n.scrollLeft=n.scrollWidth});Tn(this,"handleKeydown",t=>{var s;const n=this.editor;if(!n)return;if(t.key==="Enter"){t.preventDefault();return}const o=t.ctrlKey||t.metaKey;if(o&&!t.altKey&&t.key.toLowerCase()==="a"){t.preventDefault(),(s=window.getSelection())==null||s.selectAllChildren(n);return}if(t.key==="Home"||t.key==="End"){t.preventDefault(),this.moveToEdge(t.key==="Home"?"start":"end",t.shiftKey);return}if((t.key==="ArrowLeft"||t.key==="ArrowRight")&&!t.shiftKey&&!o&&!t.altKey){this.moveAcrossTag(t.key)&&t.preventDefault();return}if(t.key==="Backspace"||t.key==="Delete"){if(!o&&!t.altKey&&!t.shiftKey&&this.deleteCharacter(t.key)){t.preventDefault();return}const r=this.findAdjacentTag(t.key);r&&(t.preventDefault(),this.removeTag(r,t.key==="Backspace"?"after":"before"))}});Tn(this,"normalizeCaret",()=>{const t=this.editor,n=window.getSelection();if(!t||!(n!=null&&n.rangeCount)||!n.isCollapsed)return;const{startContainer:o,startOffset:s}=n.getRangeAt(0);if(!t.contains(o))return;const r=j0(o);if(!r&&o!==t)return;const i=r??t.childNodes[s-1]??null,a=r?r.nextSibling:t.childNodes[s]??null;if(this.ensureTagPadding(),Ws(i))n.collapse(i,ga(i).end);else if(Ws(a))n.collapse(a,ga(a).start);else if(Ws((i==null?void 0:i.nextSibling)??null)){const l=i.nextSibling;n.collapse(l,ga(l).start)}else if(Ws((a==null?void 0:a.previousSibling)??null)){const l=a.previousSibling;n.collapse(l,ga(l).end)}});this.options=t}mount(t,n=[]){this.editor=t,this.render(n),document.addEventListener("selectionchange",this.normalizeCaret)}destroy(){document.removeEventListener("selectionchange",this.normalizeCaret),this.editor=null}sync(t){this.editor&&(soe(t,this.parse())||this.render(t))}render(t){const n=this.editor;n&&(n.innerHTML="",t.forEach(o=>{typeof o=="string"?n.appendChild(document.createTextNode(z0(o))):this.options.isTagAllowed(o.id)&&n.appendChild(this.createTagNode(o))}),this.ensureTagPadding())}parse(){var o;const t=[];let n="";return(o=this.editor)==null||o.childNodes.forEach(s=>{Ws(s)?n+=s.data.replace(/\u00A0/g," "):this.isAllowedTagNode(s)&&(n&&(t.push(n),n=""),t.push({id:s.dataset.id||"unknown",text:s.innerText||"Tag",direction:s.dataset.direction??void 0}))}),n&&t.push(n),t}insertTag(t){const n=this.editor;if(!n||!this.options.isTagAllowed(t.id))return;const o=n.querySelector(`.locked-tag[data-id="${t.id}"]`);if(o instanceof HTMLElement){this.applyTagData(o,t),this.handleInput();return}const s=this.createTagNode(t),r=document.createTextNode(jr),i=this.getEditorRange();i?(i.deleteContents(),i.insertNode(r),i.insertNode(s)):n.append(s,r),n.normalize(),this.handleInput(),this.placeCaretAfterTag(r)}updateTag(t,n){var s;const o=(s=this.editor)==null?void 0:s.querySelector(`.locked-tag[data-id="${t}"]`);o instanceof HTMLElement&&(o.innerText=n,this.handleInput())}replaceTag(t,n){if(!this.editor||!this.options.isTagAllowed(n.id))return;const o=this.createTagNode({id:n.id,text:n.label,direction:n.direction}),s=this.editor.querySelector(`.locked-tag[data-id="${t.id}"]`);s instanceof HTMLElement&&(s.replaceWith(o),this.handleInput())}deleteTag(t){const n=this.editor;if(!n)return;const o=n.querySelector(`.locked-tag[data-id="${t}"]`);o instanceof HTMLElement&&this.removeTag(o,"after");const s=this.parse(),r=s[0];s.length===1&&typeof r=="string"&&r.trim()===""&&(n.innerHTML="",this.options.onChange(this.parse()))}isAllowedTagNode(t){return Yv(t)&&this.options.isTagAllowed(t.getAttribute("data-id")??"")}applyTagData(t,{text:n,direction:o}){t.innerText=n,o?t.dataset.direction=o:delete t.dataset.direction}createTagNode({id:t,text:n,direction:o}){const s=document.createElement("span");return s.contentEditable="false",s.className="locked-tag",s.dataset.id=t,this.applyTagData(s,{text:n,direction:o}),s}getEditorRange(){const t=window.getSelection();if(!this.editor||!(t!=null&&t.rangeCount))return null;const n=t.getRangeAt(0).cloneRange();return this.editor.contains(n.commonAncestorContainer)?tN(n):null}insertPlainText(t,n){const o=this.editor;if(!o)return;const s=window.getSelection();let r=n?tN(n):this.getEditorRange();(!r||!o.contains(r.commonAncestorContainer))&&(r=document.createRange(),r.selectNodeContents(o),r.collapse(!1)),r.deleteContents();const i=document.createTextNode(z0(t));r.insertNode(i),r.setStartAfter(i),r.collapse(!0),s==null||s.removeAllRanges(),s==null||s.addRange(r),this.handleInput()}sanitize(){const t=this.editor;if(!t)return;t.querySelectorAll(".locked-tag .locked-tag").forEach(o=>o.remove());let n=!1;if(Array.from(t.childNodes).forEach(o=>{if(Ws(o)||this.isAllowedTagNode(o))return;n=!0;const s=Yv(o)?"":z0(o.textContent??"");o.replaceWith(document.createTextNode(s))}),n){const o=window.getSelection(),s=document.createRange();s.selectNodeContents(t),s.collapse(!1),o==null||o.removeAllRanges(),o==null||o.addRange(s)}}ensureTagPadding(){var t;(t=this.editor)==null||t.querySelectorAll(".locked-tag").forEach(n=>{const o=n.previousSibling,s=n.nextSibling;Ws(o)?o.data.endsWith(jr)||o.appendData(jr):n.before(document.createTextNode(jr)),Ws(s)?s.data.startsWith(jr)||s.insertData(0,jr):n.after(document.createTextNode(jr))})}async placeCaretAfterTag(t){var s;(s=this.editor)==null||s.focus(),await Promise.resolve();const n=document.createRange();n.setStart(t,ga(t).start),n.collapse(!0);const o=window.getSelection();o==null||o.removeAllRanges(),o==null||o.addRange(n)}findAdjacentTag(t){const n=this.editor,o=window.getSelection();if(!n||!o||!o.isCollapsed||!o.rangeCount)return null;const{startContainer:s,startOffset:r}=o.getRangeAt(0);if(!n.contains(s))return null;const i=t==="Backspace";let a;if(s===n)a=i?n.childNodes[r-1]??null:n.childNodes[r]??null;else if(Ws(s)&&s.parentNode===n){const{start:l,end:c}=ga(s);if(i?Math.min(r,c)>l:Math.max(r,l)<c)return null;a=i?s.previousSibling:s.nextSibling}else return null;for(;ooe(a);)a=i?a.previousSibling:a.nextSibling;return a&&this.isAllowedTagNode(a)?a:null}getBoundaryPoint(t){const n=this.editor,o=t==="start"?n.firstChild:n.lastChild;return Ws(o)?[o,t==="start"?0:o.length]:[n,t==="start"?0:n.childNodes.length]}moveToEdge(t,n){const o=this.editor,s=window.getSelection();if(!o||!s)return;const[r,i]=this.getBoundaryPoint(t),a=n&&s.anchorNode&&o.contains(s.anchorNode)?{node:s.anchorNode,offset:s.anchorOffset}:{node:r,offset:i};s.setBaseAndExtent(a.node,a.offset,r,i),o.scrollLeft=t==="start"?0:o.scrollWidth}moveAcrossTag(t){const n=t==="ArrowLeft",o=this.findAdjacentTag(n?"Backspace":"Delete"),s=window.getSelection();if(!o||!s)return!1;const r=n?o.previousSibling:o.nextSibling;if(!Ws(r))return!1;const i=ga(r);return s.collapse(r,n?i.end:i.start),!0}deleteCharacter(t){const n=window.getSelection();if(!this.editor||!(n!=null&&n.isCollapsed)||!n.rangeCount)return!1;const{startContainer:o,startOffset:s}=n.getRangeAt(0);if(!Ws(o)||o.parentNode!==this.editor)return!1;const{start:r,end:i}=ga(o);let a,l=1,c=s;if(t==="Backspace"){if(a=Math.min(s,i)-1,a<r)return!1;/[\uDC00-\uDFFF]/.test(o.data[a])&&a>r&&(a--,l=2),c=s-l}else{if(a=Math.max(s,r),a>=i)return!1;/[\uD800-\uDBFF]/.test(o.data[a])&&a+1<i&&(l=2)}return o.deleteData(a,l),n.collapse(o,c),this.handleInput(),!0}removeTag(t,n){var r;const o=t.previousSibling,s=t.nextSibling;t.remove(),o instanceof Text&&s instanceof Text&&o.data.endsWith(jr)&&s.data.startsWith(jr)&&(n==="after"?o.deleteData(o.length-1,1):s.deleteData(0,1)),(r=this.editor)==null||r.normalize(),this.handleInput()}focus(){var o;console.log("Focusing editor"),(o=this.editor)==null||o.focus();const t=document.createRange();t.selectNodeContents(this.editor),t.collapse(!1);const n=window.getSelection();n==null||n.removeAllRanges(),n==null||n.addRange(t)}}const ioe={class:"input-wrapper"},aoe=["data-placeholder"],loe=bt(tt({__name:"DynamicInput",props:{modelValue:{type:Array,default:()=>[]},placeholder:{type:String,default:"Rename to"},allowedTags:{type:Array,default:void 0}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=H(null),i=new roe({isTagAllowed:a=>!o.allowedTags||o.allowedTags.includes(a),onChange:a=>s("update:modelValue",a)});return en(()=>{r.value&&i.mount(r.value,o.modelValue)}),Jn(()=>i.destroy()),Qe(()=>o.modelValue,a=>i.sync(a),{deep:!0}),t({insertTag:a=>i.insertTag(a),updateTag:(a,l)=>i.updateTag(a,l),replaceTag:(a,l)=>i.replaceTag(a,l),deleteTag:a=>i.deleteTag(a),focus:()=>{console.log("Focusing editor"),i.focus()}}),(a,l)=>(K(),ce("div",ioe,[Te("div",{ref_key:"editorRef",ref:r,class:"custom-input single-line",contenteditable:"true","data-placeholder":e.placeholder,onPaste:l[0]||(l[0]=(...c)=>W(i).handlePaste&&W(i).handlePaste(...c)),onDrop:l[1]||(l[1]=(...c)=>W(i).handleDrop&&W(i).handleDrop(...c)),onBeforeinput:l[2]||(l[2]=(...c)=>W(i).handleBeforeInput&&W(i).handleBeforeInput(...c)),onInput:l[3]||(l[3]=(...c)=>W(i).handleInput&&W(i).handleInput(...c)),onKeydown:l[4]||(l[4]=(...c)=>W(i).handleKeydown&&W(i).handleKeydown(...c)),onClick:l[5]||(l[5]=Nt((...c)=>W(i).handleClick&&W(i).handleClick(...c),["stop","prevent"]))},null,40,aoe)]))}}),[["__scopeId","data-v-e3be4ee2"]]),coe={key:0},uoe={key:1},nN=8,doe=bt(tt({__name:"PreviewName",props:{text:{}},setup(e){const t=Kt,n=e,o=H(null),s=H(null),r=H(n.text),i=H(!1),a=d=>{const h=s.value;return h.textContent=d,h.offsetWidth},l=(d,h)=>{const f=d.slice(-nN),p=d.length-nN-1;if(p<1||a(d)<=h)return d;let g=0,v=p;for(;g<v;){const C=Math.ceil((g+v)/2);a(`${d.slice(0,C)}…${f}`)<=h?g=C:v=C-1}return`${d.slice(0,g)}…${f}`},c=()=>{!o.value||!s.value||(r.value=l(n.text,o.value.clientWidth),i.value=r.value!==n.text)};let u;return en(()=>{c(),u=new ResizeObserver(c),u.observe(o.value)}),Jn(()=>u==null?void 0:u.disconnect()),Qe(()=>n.text,()=>ft(c)),(d,h)=>(K(),ce("div",{ref_key:"rootRef",ref:o,class:"preview-name"},[i.value?qe((K(),ce("span",coe,[nt(it(r.value),1)])),[[W(t),{content:e.text,delay:[1e3,0],bypassOverflowCheck:!0}]]):(K(),ce("span",uoe,it(e.text),1)),Te("span",{ref_key:"measureRef",ref:s,class:"measure","aria-hidden":"true"},null,512)],512))}}),[["__scopeId","data-v-f1310bab"]]),oN=10,sN=5,tp={number:{first:"000",step:"1"},letter:{first:"A",step:"1"}},hoe={up:{first:"Start at",step:"Increase by"},down:{first:"End at",step:"Decrease by"}},foe=/^[0-9]$/,poe=/^[A-Za-z]$/,rN=(e,t)=>t==="first"&&e==="letter"?poe:foe,goe=(e,t,n)=>rN(e,t).test(n),moe=e=>e==="first"?oN:sN,voe=e=>e&&e[0]===e[0].toLowerCase()?e.toLowerCase():e.toUpperCase(),yoe=(e,t,n)=>{const o=rN(e,t),s=Array.from(n).filter(r=>o.test(r)).join("").slice(0,moe(t));return t==="first"&&e==="letter"?voe(s):s},iN=(e,t)=>t!==""&&(e==="first"||Number(t)>0),woe=e=>Array.from(e.toUpperCase()).reduce((t,n)=>t*26+(n.charCodeAt(0)-64),0),Coe=e=>{let t="",n=e;for(;n>0;){const o=(n-1)%26;t=String.fromCharCode(65+o)+t,n=Math.floor((n-1)/26)}return t},aN=({type:e,direction:t,first:n,step:o,count:s})=>{const r=Number(o)||1,i=c=>(t==="up"?c:s-1-c)*r;if(e==="number"){const c=Number(n);return Array.from({length:s},(u,d)=>String(c+i(d)).padStart(n.length,"0"))}const a=woe(n),l=n!==""&&n[0]===n[0].toLowerCase();return Array.from({length:s},(c,u)=>{const d=Coe(a+i(u));return l?d.toLowerCase():d})},boe={class:"bulk-rename-popup",id:"bulk-rename-el"},Soe={class:"left-section"},Eoe={class:"modified-template-options"},_oe=["onClick"],Roe={class:"setting-count"},Toe={class:"field-label"},Doe={class:"field-label"},Ioe={class:"confirmation"},xoe={class:"preview-section"},Poe={class:"preview-list"},koe={key:0,class:"preview-more"},lN=8,cN=7,Foe=bt(tt({__name:"BulkRenamePopup",props:{item:{}},emits:["cancel","rename"],setup(e,{expose:t,emit:n}){const o=Kt,s=H(null),r=["number","letter","name"],i={number_up:"1→9",number_down:"9→1",letter_up:"A→Z",letter_down:"Z→A",name:"Name"},a=e,l=H([]),c=Y(()=>l.value.find(q=>typeof q!="string"&&(q.id==="number"||q.id==="letter"))),u=H("number"),d=H("up"),h=Go({...tp.number}),f=Go({...tp.number}),p=()=>{Object.assign(h,tp[u.value]),Object.assign(f,tp[u.value])};Qe(c,q=>{if(!q)return;const V=q.id;V!==u.value&&(u.value=V,p()),d.value=q.direction==="down"?"down":"up"},{immediate:!0,flush:"sync"});const g=Y(()=>hoe[d.value]),v=(q,V)=>{const k=yoe(u.value,q,V);h[q]=k,iN(q,k)&&(f[q]=k)},C=(q,V)=>{V.key.length===1&&!V.ctrlKey&&!V.metaKey&&!V.altKey&&!goe(u.value,q,V.key)&&V.preventDefault()},S=(q,V)=>{var Fe;V.preventDefault();const k=V.target,G=((Fe=V.clipboardData)==null?void 0:Fe.getData("text/plain"))??"",ee=k.selectionStart??k.value.length,ge=k.selectionEnd??k.value.length;k.value=k.value.slice(0,ee)+G+k.value.slice(ge),v(q,k.value),k.value=h[q]},b=q=>{if(iN(q,h[q]))return;const V=tp[u.value][q];h[q]=V,f[q]=V},y=Y(()=>c.value?aN({type:u.value,direction:d.value,first:f.first,step:f.step,count:a.item.length}):[]),_=Y(()=>l.value.every(q=>typeof q=="string"&&!q)),E=Y(()=>_.value||l.value.length==0&&l.value[0]===" "?a.item.map(q=>q.name):a.item.map((q,V)=>l.value.map(k=>typeof k=="string"?k:k.id==="name"?q.name:y.value[V]??"").join(""))),D=Y(()=>E.value.length>lN?E.value.length-cN:0),T=Y(()=>E.value.length>lN?E.value.slice(0,cN):E.value),P=[{id:"name",name:"Current name",icon:null,description:{active:"Remove from the name",inactive:"Add the current name"}},{id:"number_up",name:"Number",icon:"ArrowLeft",description:{active:"Remove from the name",inactive:"Add a number that counts up",switch:"Switch to a number that counts up"}},{id:"number_down",name:"Number",icon:"ArrowRight",description:{active:"Remove from the name",inactive:"Add a number that counts down",switch:"Switch to a number that counts down"}},{id:"letter_up",name:"Letter",icon:"ArrowLeft",description:{active:"Remove from the name",inactive:"Add a letter that counts up",switch:"Switch to a letter that counts up"}},{id:"letter_down",name:"Letter",icon:"ArrowRight",description:{active:"Remove from the name",inactive:"Add a letter that counts down",switch:"Switch to a letter that counts down"}}],L=q=>{x.value=[q];const V=q.id.split("_")[0],k=q.id.split("_")[1],G=i[q.id],ee=s.value;if(!ee)return;const ge=Ge=>l.value.find(fe=>typeof fe!="string"&&Ge.includes(fe.id));if(V==="name"){ge(["name"])?ee.deleteTag("name"):ee.insertTag({id:V,text:G,direction:void 0});return}const Fe=ge(["number","letter"]);if(Fe){const Ge=Fe.id===V,fe=Fe.direction===k;if(Ge&&fe){ee.deleteTag(Fe.id);return}ee.deleteTag(Fe.id),ee.insertTag({id:V,text:G,direction:k})}else ee.insertTag({id:V,text:G,direction:k})},I=q=>O(q.id)?q.description.active:!!c.value&&q.description.switch?q.description.switch:q.description.inactive,x=H(null),O=q=>{const[V,k]=q.split("_");return l.value.some(G=>typeof G!="string"&&G.id===V&&G.direction===k)},N=n,F=Y(()=>l.value.length===1&&typeof l.value.at(0)!="string"&&l.value[0].id==="name"),z=Y(()=>l.value.length===0||F.value),j=()=>{x.value=null,l.value=[],N("cancel")},Q=()=>{const q=l.value.map(V=>typeof V=="string"?{type:"text",value:V}:V.id==="name"?{type:"current_name"}:{type:"counter",value:h.first,direction:V.direction=="up"?"asc":"desc",format:V.id==="number"?"number":"letter",step:h.step});N("rename",q)};return t({reset:()=>{x.value=null,l.value=[]},focus:()=>{var q;(q=s.value)==null||q.focus()}}),en(()=>{console.log("Focusing template input"),setTimeout(()=>{var q;(q=s.value)==null||q.focus()},500)}),(q,V)=>(K(),ce("div",boe,[Te("div",Soe,[ye(loe,{modelValue:l.value,"onUpdate:modelValue":V[0]||(V[0]=k=>l.value=k),"allowed-tags":r,ref_key:"templateInputRef",ref:s},null,8,["modelValue"]),Te("div",Eoe,[(K(),ce(Ft,null,Pn(P,k=>qe((K(),ce("button",{onClick:G=>L(k),class:se(["template-option",{active:O(k.id)}]),key:k.id},[nt(it(k.name)+" ",1),k.icon?(K(),ze(W(ct),{key:0,src:k.icon,style:{transform:"rotate(90deg)"}},null,8,["src"])):Xe("",!0)],10,_oe)),[[W(o),{content:I(k),bypassOverflowCheck:!0,delay:[300,0],interactive:!1,hideOnClick:!1,appendTo:"parent"}]])),64))]),Te("div",Roe,[Te("span",Toe,it(g.value.first),1),ye(W($f),{"model-value":h.first,disabled:!c.value,"max-length":W(oN),onInput:V[1]||(V[1]=k=>v("first",k)),onKeydown:V[2]||(V[2]=k=>C("first",k)),onPaste:V[3]||(V[3]=k=>S("first",k)),onBlur:V[4]||(V[4]=k=>b("first")),"show-clear":!1},{clear:be(()=>[...V[9]||(V[9]=[Te("div",null,null,-1)])]),_:1},8,["model-value","disabled","max-length"]),Te("span",Doe,it(g.value.step),1),ye(W($f),{"model-value":h.step,disabled:!c.value,"max-length":W(sN),onInput:V[5]||(V[5]=k=>v("step",k)),onKeydown:V[6]||(V[6]=k=>C("step",k)),onPaste:V[7]||(V[7]=k=>S("step",k)),onBlur:V[8]||(V[8]=k=>b("step")),"show-clear":!1},null,8,["model-value","disabled","max-length"])]),Te("div",Ioe,[ye(W(pt),{variant:"secondary",onClick:j},{default:be(()=>[...V[10]||(V[10]=[nt(" Cancel ",-1)])]),_:1}),ye(W(pt),{onClick:Q,disabled:z.value},{default:be(()=>[...V[11]||(V[11]=[nt(" Rename ",-1)])]),_:1},8,["disabled"])])]),Te("div",xoe,[V[12]||(V[12]=Te("span",{class:"preview-title"},"Preview",-1)),Te("ul",Poe,[(K(!0),ce(Ft,null,Pn(T.value,(k,G)=>(K(),ce("li",{key:G},[ye(doe,{text:k},null,8,["text"])]))),128)),D.value>0?(K(),ce("li",koe," … "+it(D.value)+" more items ",1)):Xe("",!0)])])]))}}),[["__scopeId","data-v-270b322e"]]),Aoe=tt({__name:"BulkRenameButton",props:{item:{},totalItem:{}},emits:["cancel","rename"],setup(e,{expose:t,emit:n}){const{popupRef:o,show:s,hide:r,triggerRef:i}=mo({interactive:!0,trigger:"manually",placement:"top-end",showArrow:!1,offset:[-350,25],hideOnClick:!0,toggleOnClick:!0,onHide:()=>{console.log("Popup hidden"),h()},onShow:()=>{ft(()=>{var f;(f=d.value)==null||f.focus()})}}),a=e,l=()=>{r()},c=f=>{u("rename",f),r()},u=n,d=H(null),h=()=>{d.value&&d.value.reset()};return t({popupRef:o,hide:r,show:s,triggerRef:i}),(f,p)=>(K(),ce(Ft,null,[Te("div",{class:"trigger-el",ref_key:"triggerRef",ref:i},null,512),Te("div",{class:"popup-el",ref_key:"popupRef",ref:o},[ye(Foe,{item:a.item,"total-item":a.totalItem,ref_key:"bulkRenameRef",ref:d,onCancel:l,onRename:c},null,8,["item","total-item"])],512)],64))}}),Ooe={...{list_cursor:{error:"Failed to fetch data. Please reload table."},assignedUser:{error:"Failed to fetch assignees. Please reload table."},metricValues:{error:"Failed to fetch metric values. Please reload table."},assignableUser:{error:"Failed to fetch people. Please try again."},assignableStatus:{error:"Failed to fetch statuses. Please try again."},basicInfor:{error:"Failed to fetch basic information."},item:{error:"Update failed. Please try again."},removeAssignee:{error:"Update failed. Please try again."},metricList:{error:"Failed to fetch metrics. Please try again."},multipleAssignableUser:{error:"Failed to fetch data. Please reload table."},getPermission:{error:"Failed to fetch permissions."},delete_rendition:{success:"Deletion successful.",error:"Deletion failed. Please try again."},delete_thumbnail:{success:"Deletion successful.",error:"Deletion failed. Please try again."},archive_item:{success:"Archive successful.",error:"Archive failed. Please try again."},unarchive_item:{success:"Unarchive successful.",error:"Unarchive failed. Please try again."},bulkDelete:{success:"Deletion successful.",error:"Deletion failed. Please try again."},bulkArchive:{error:"Archive failed. Please try again."},bulkDateUpdate:{error:"Failed to update items."},bulkAssignUpdate:{error:"Failed to update assignees."},bulkStatusUpdate:{error:"Failed to update items."},getUserPermission:{error:"Failed to fetch user permissions."},getEntityDetail:{error:"Failed to fetch entity details."},bulkUnarchive:{error:"Unarchive failed. Please try again."},downloadTemplate:{},importItems:{},exportItems:{},updateFromFile:{},me:{},workspaces:{},entityUserRoles:{},templateFlowStatuses:{},bulkMetricUpdate:{error:"Update failed. Please try again."},createNewItem:{},getAssignableAssignees:{},getAssignableStatuses:{},getFilterStatuses:{},bulkRename:{}},offline:{error:"You are currently offline. Please check your network connection."}};function uN(e,t,n){return(t=Noe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Moe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Noe(e){var t=Moe(e,"string");return typeof t=="symbol"?t:t+""}function kc(e){"@babel/helpers - typeof";return kc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kc(e)}var dN=function(e){return e.TOOLBOX_EXPORT_DATA="TOOLBOX_EXPORT_DATA",e.SW_APP_LOADER="SW_APP_LOADER",e}({});function hN(e){return kc(e)==="object"&&e!==null&&!Array.isArray(e)}function fN(e,t){var n=Object.keys(e);return n.length===t.length&&t.every(function(o){return n.includes(o)})}function Loe(e){return typeof Blob<"u"&&e instanceof Blob}var Voe=function(t){return hN(t)&&fN(t,["file","fileName"])&&Loe(t.file)&&typeof t.fileName=="string"},Boe=function(t){return hN(t)&&fN(t,["scene_id","people_id","openGS","queryParams"])&&(typeof t.scene_id=="string"||t.scene_id===null)&&(typeof t.people_id=="string"||t.people_id===null)&&(typeof t.openGS=="boolean"||t.openGS===null)&&typeof t.queryParams=="string"};Object.freeze(uN(uN({},dN.TOOLBOX_EXPORT_DATA,Voe),dN.SW_APP_LOADER,Boe));class $oe extends Error{}class fl extends $oe{constructor(){super("Zone is an abstract class")}}class pN{get type(){throw new fl}get name(){throw new fl}get ianaName(){return this.name}get isUniversal(){throw new fl}offsetName(t,n){throw new fl}formatOffset(t,n){throw new fl}offset(t){throw new fl}equals(t){throw new fl}get isValid(){throw new fl}}const K0=new Map;function Hoe(e){let t=K0.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),K0.set(e,t)),t}const Goe={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Uoe(e,t){const n=e.format(t).replace(/\u200E/g,""),o=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,s,r,i,a,l,c,u]=o;return[i,s,r,a,l,c,u]}function Woe(e,t){const n=e.formatToParts(t),o=[];for(let s=0;s<n.length;s++){const{type:r,value:i}=n[s],a=Goe[r];r==="era"?o[a]=i:Zv(a)||(o[a]=parseInt(i,10))}return o}const q0=new Map;class Xv extends pN{static create(t){let n=q0.get(t);return n===void 0&&q0.set(t,n=new Xv(t)),n}static resetCache(){q0.clear(),K0.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=Xv.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:o}){return Koe(t,n,o,this.name)}formatOffset(t,n){return Qv(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const o=Hoe(this.name);let[s,r,i,a,l,c,u]=o.formatToParts?Woe(o,n):Uoe(o,n);a==="BC"&&(s=-Math.abs(s)+1);const h=joe({year:s,month:r,day:i,hour:l===24?0:l,minute:c,second:u,millisecond:0});let f=+n;const p=f%1e3;return f-=p>=0?p:1e3+p,(h-f)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let Y0=null;class fd extends pN{static get utcInstance(){return Y0===null&&(Y0=new fd(0)),Y0}static instance(t){return t===0?fd.utcInstance:new fd(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new fd(mN(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Qv(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Qv(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Qv(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}function Zv(e){return typeof e>"u"}function Jv(e,t=2){const n=e<0;let o;return n?o="-"+(""+-e).padStart(t,"0"):o=(""+e).padStart(t,"0"),o}function gN(e){if(!(Zv(e)||e===null||e===""))return parseInt(e,10)}function zoe(e){if(!(Zv(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function joe(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function Koe(e,t,n,o=null){const s=new Date(e),r={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};o&&(r.timeZone=o);const i={timeZoneName:t,...r},a=new Intl.DateTimeFormat(n,i).formatToParts(s).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function mN(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const o=parseInt(t,10)||0,s=n<0||Object.is(n,-0)?-o:o;return n*60+s}function Qv(e,t){const n=Math.trunc(Math.abs(e/60)),o=Math.trunc(Math.abs(e%60)),s=e>=0?"+":"-";switch(t){case"short":return`${s}${Jv(n,2)}:${Jv(o,2)}`;case"narrow":return`${s}${n}${o>0?`:${o}`:""}`;case"techie":return`${s}${Jv(n,2)}${Jv(o,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}const vN=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function pd(...e){const t=e.reduce((n,o)=>n+o.source,"");return RegExp(`^${t}$`)}function gd(...e){return t=>e.reduce(([n,o,s],r)=>{const[i,a,l]=r(t,s);return[{...n,...i},a||o,l]},[{},null,1]).slice(0,2)}function yN(...e){return(t,n)=>{const o={};let s;for(s=0;s<e.length;s++)o[e[s]]=gN(t[n+s]);return[o,null,n+s]}}const wN=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,qoe=`(?:${wN.source}?(?:\\[(${vN.source})\\])?)?`,CN=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,bN=RegExp(`${CN.source}${qoe}`),X0=RegExp(`(?:[Tt]${bN.source})?`),Yoe=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Xoe=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Zoe=/(\d{4})-?(\d{3})/,Joe=yN("weekYear","weekNumber","weekDay"),Qoe=yN("year","ordinal"),ese=/(\d{4})-(\d\d)-(\d\d)/,SN=RegExp(`${CN.source} ?(?:${wN.source}|(${vN.source}))?`),tse=RegExp(`(?: ${SN.source})?`);function md(e,t,n){const o=e[t];return Zv(o)?n:gN(o)}function nse(e,t){return[{year:md(e,t),month:md(e,t+1,1),day:md(e,t+2,1)},null,t+3]}function vd(e,t){return[{hours:md(e,t,0),minutes:md(e,t+1,0),seconds:md(e,t+2,0),milliseconds:zoe(e[t+3])},null,t+4]}function np(e,t){const n=!e[t]&&!e[t+1],o=mN(e[t+1],e[t+2]),s=n?null:fd.instance(o);return[{},s,t+3]}function op(e,t){const n=e[t]?Xv.create(e[t]):null;return[{},n,t+1]}pd(Yoe,X0),pd(Xoe,X0),pd(Zoe,X0),pd(bN),gd(nse,vd,np,op),gd(Joe,vd,np,op),gd(Qoe,vd,np,op),gd(vd,np,op),gd(vd),pd(ese,tse),pd(SN),gd(vd,np,op);var Mo=function(e){return e.review="{reviewDomain}/{ws_code}",e.review_take="{reviewDomain}/{ws_code}?id={take_id}",e.review_scene="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",e.review_rendition="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",e.review_frame="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}&tab=comment&refresh_marker=true#type=frame&data={frame}",e.review_rendition_comment="{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}&tab=comment",e.review_comment="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",e.scene_hub="{baseDomain}/{ws_code}/{scene_id}?o=st",e.hub_rendition="{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",e.hub_comment="{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",e.people_insight="{baseDomain}/{ws_code}/{user_id}?o=pt",e.people_detail="{baseDomain}/{ws_code}/ws/ppl/{display_name}-{user_id}",e.project="{baseDomain}/{ws_code}/pl/dir/{entity_id}",e.project_focusMode="{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",e.woohoo="{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",e.update="{baseDomain}/{ws_code}/pl/au?id={entity_id}",e.core="{baseDomain}/{ws_code}",e}(Mo||{});Mo.review,Mo.review_take,Mo.review_scene,Mo.review_rendition,Mo.review_frame,Mo.review_rendition_comment,Mo.review_comment,Mo.scene_hub,Mo.hub_rendition,Mo.hub_comment,Mo.people_insight,Mo.people_detail,Mo.project,Mo.woohoo,Mo.update,Mo.core,Mo.project_focusMode;var Z0=null;function ose(e){Z0=e}function ey(){if(!Z0)throw new Error("i18n instance not set. Call setI18nInstance(i18n) before using errorHelper.");return Z0}function EN(){try{var e=sessionStorage.getItem("APP_DEBUG")?"✅":"",t=ey();return"".concat(t.t("errorMessages.fallback.unknownError")," ").concat(e)}catch{return"An error occurred. Please try again or contact support."}}function sse(e,t,n,o){var s=e.replace(/{field}/g,t);if(o&&kc(o)==="object")Object.keys(o).forEach(function(i){var a="{".concat(i,"}"),l=o[i];Array.isArray(l)?l=l.join(", "):i==="value"&&(o.min||o.max)&&(l="".concat(o.min||o.value," and ").concat(o.max||o.value)),s=s.replace(new RegExp(a,"g"),l||"")});else if(Array.isArray(n)&&n.length>0){var r=n[0]||"";n.length>1?r="".concat(n[0]," and ").concat(n[1]):n.length===1&&Array.isArray(n[0])&&(r=n[0].join(", ")),s=s.replace(/{value}/g,r)}return s}function rse(e,t){for(var n=Object.keys(t),o=0,s=n;o<s.length;o++){var r=s[o],i=Array.isArray(t[r])?t[r].join(", "):String(t[r]);e=e.replace(new RegExp("\\{".concat(r,"\\}"),"g"),i)}if(n.length>0&&e.includes("{value}")){var a=t[n[0]],l=Array.isArray(a)?a.join(", "):String(a);e=e.replace(/{value}/g,l)}return e}function _N(e){return!!(e&&e.validation&&e.validation.fields&&Object.keys(e.validation.fields).length>0)}function RN(e,t){if(!e||kc(e)!=="object")return null;try{var n=ey();if(e.validation&&e.validation.fields)for(var o=e.validation.fields,s=Object.keys(o),r=0,i=s;r<i.length;r++){var a=i[r],l=o[a];if(l&&l.rule){var c=l.rule,u=l.data||[],d=l.params||{};try{var h,f,p=((h=n.messages)===null||h===void 0?void 0:h.value)||n.messages,g=((f=n.locale)===null||f===void 0?void 0:f.value)||n.locale,v=null;if(t){var C,S=t.toUpperCase();v=(C=p[g])===null||C===void 0||(C=C.errorMessages)===null||C===void 0||(C=C[S])===null||C===void 0||(C=C.validation_rules)===null||C===void 0?void 0:C[c]}if(!v){var b;v=(b=p[g])===null||b===void 0||(b=b.errorMessages)===null||b===void 0||(b=b.GEN)===null||b===void 0||(b=b.validation_rules)===null||b===void 0?void 0:b[c]}if(v&&typeof v=="string")return sse(v,a,u,d)}catch(y){console.error("Error in validation rules",y)}}}}catch(y){return console.error("Error in getValidationErrorMessage:",y),null}return null}function TN(e){var t=sessionStorage.getItem("APP_DEBUG")?"✅":"";if(!e)return EN();var n=e.code,o=e.error,s=e.details,r=e.message;if(_N(s)&&s){var i=RN(s,o==null?void 0:o.type);if(sessionStorage.getItem("APP_DEBUG")&&console.log("[Error Utils Debug]",i),i)return n!==""?"[".concat(n,"] ").concat(i," ").concat(t):"".concat(i);try{var a=ey();return a.t("errorMessages.GEN.validation_error")}catch{return"Validation error occurred."}}if(o&&kc(o)==="object"&&o.type&&o.key){var l=o.type.toUpperCase();try{var c,u,d,h="errorMessages.".concat(l,".").concat(o.key),f=ey(),p=((c=f.messages)===null||c===void 0?void 0:c.value)||f.messages,g=((u=f.locale)===null||u===void 0?void 0:u.value)||f.locale,v=(d=p[g])===null||d===void 0||(d=d.errorMessages)===null||d===void 0||(d=d[l])===null||d===void 0?void 0:d[o.key];if(v&&typeof v=="string"){var C=v;return s!=null&&s.context&&(C=rse(C,s.context),sessionStorage.getItem("APP_DEBUG")&&console.log("[Error Utils Debug]",C)),n!==""?"[".concat(n,"] ").concat(C," ").concat(t):"".concat(C," ").concat(t)}}catch(b){console.error("[Error Utils Debug]",b)}}if(o&&kc(o)!=="object"&&_N(s)){var S=RN(s);if(S)return n!==""?"[".concat(n,"] ").concat(S," ").concat(t):"".concat(S," ").concat(t)}return r?"".concat(r):EN()}const Es=Sc("toast",()=>{const e=c=>TN(c),t=c=>{var u;if((c==null?void 0:c.apiCode)==="offline")r({id:"offline",type:"error",message:"You are currently offline. Please check your network connection."});else{const d=TN((u=c==null?void 0:c.res)==null?void 0:u.data);r({id:c==null?void 0:c.apiCode,type:"error",message:d})}},n=H([]),o=(c,u)=>{const d=Ooe[c];if(d){const h=d[u];if(h){r({id:c,type:u,message:h});return}}else r({id:c,type:u,message:c})},s=new Map,r=(c,u=5e3)=>{const d={...c,id:c.id??Date.now()+Math.random()};if(n.value.push(d),u>0){const h=Date.now(),f=setTimeout(()=>{i(d.id),s.delete(d.id)},u);s.set(d.id,{timeoutId:f,remainingTime:u,startTime:h})}};function i(c){n.value=n.value.filter(d=>d.id!==c);const u=s.get(c);u&&(clearTimeout(u.timeoutId),s.delete(c))}function a(c){const u=s.get(c);if(u){clearTimeout(u.timeoutId);const d=Date.now()-u.startTime;u.remainingTime=Math.max(0,u.remainingTime-d)}}function l(c){const u=s.get(c);if(u&&u.remainingTime>0){const d=setTimeout(()=>{i(c),s.delete(c)},u.remainingTime);u.timeoutId=d,u.startTime=Date.now()}}return{notifications:n,addNotification:r,removeNotification:i,showMessage:o,showErrorNetMessage:t,pauseAutoDismiss:a,resumeAutoDismiss:l,getErrorMessageFromResponse:e}}),ise={style:{"max-width":"225px","line-height":"14px"}},ase={style:{"max-width":"100px","line-height":"14px"}},DN=500,lse=bt(tt({__name:"BulkUpdate",props:{selectRowData:{},workspaceId:{},entityId:{},gridApi:{},selectedAll:{type:Boolean},takeName:{},totalRows:{},visibleRows:{},loading:{type:Boolean}},emits:["close","assignStatus","assignAssignee","assignDate","assignMetric","moreActions","deleteSelected","unselect","updated","selectAll","refreshSelectedRow"],setup(e,{emit:t}){const n=Kt,o=Uo,s=e,r=t,i=qv(),{handelSelectAll:a}=i,{selectionStatus:l}=us(i),c=Y(()=>l.value===At.CHECKED),u=Y(()=>s.selectRowData.map(oe=>oe.id)),d=Y(()=>s.selectRowData.length>0);ui("bulkUpdate",d),ui("isSelectAll",c);const h=(oe,ae,ue)=>{const xe=oe.getRowNode(ae);xe&&xe.setData({...xe.data,...ue})},f=({itemIds:oe,data:ae})=>{const ue=s.gridApi;if(!ue){console.error("Grid API is undefined");return}oe.forEach(xe=>{const le=ue.getRowNode(xe);le&&!le.data.isLocked&&le.setData({...le.data,status:ae})})},p=({itemIds:oe,data:ae})=>{const ue=s.gridApi;if(!ue){console.error("Grid API is undefined");return}oe.forEach(xe=>{const le=ue.getRowNode(xe);if(le){const M=le.data.dateRange||[null,null];"startDate"in ae&&ae.startDate!==void 0&&(M[0]=ae.startDate?new Date(ae.startDate):null),"dueDate"in ae&&ae.dueDate!==void 0&&(M[1]=ae.dueDate?new Date(ae.dueDate):null);const $={...le.data,dateRange:M};le.setData($)}}),r("updated")},g=oe=>{const ae=s.gridApi,{id:ue,value:xe}=oe;if(!ae){console.error("Grid API is undefined");return}u.value.forEach(le=>h(ae,le,{[`metric_${ue}`]:xe})),r("updated")},v=["primary"],C=[{label:"Rename",icon:"Pen",id:"bulk-rename",type:"icon",value:"bulk-rename"},{label:"Delete Thumbnail",icon:"Image",id:"delete-thumbnail",type:"icon",value:"delete-thumbnail"},{label:"Delete Rendition",icon:"Film",id:"delete-rendition",type:"icon",value:"delete-rendition"},{label:"Unarchive",value:"UnBoxArchive",type:"icon",icon:"BoxArchive",id:"unarchive",clickable:!0},{label:"Archive",value:"BoxArchive",type:"icon",icon:"BoxArchive",id:"archive",clickable:!0},{label:"Delete",value:"delete",type:"icon",icon:"TrashCan",id:"delete",danger:!0,clickable:!0}],S=()=>{r("unselect")},b=r0(),{userPermissions:y}=us(b),_=Y(()=>y.value.includes(i0)),E=Y(()=>{if(!_.value){console.error("User does not have permission to open review.");return}return l.value==At.CHECKED?ls({type:"review_take",config:{reviewDomain:fn.getInstance().getItem("BASE_REVIEW_URL"),ws_code:s.workspaceId,take_id:s.entityId}}).url:ls({type:"review_multiple_scenes",config:{reviewDomain:fn.getInstance().getItem("BASE_REVIEW_URL"),ws_code:s.workspaceId,scene_ids:u.value.join(",")}}).url}),D=oe=>{const{assignees:ae,type:ue}=oe,xe=s.gridApi;if(!xe){console.error("Grid API is not available for bulk update.");return}const le=new Set(ae.map(M=>M.id));u.value.forEach(M=>{const $=xe.getRowNode(M);if(!$)return;const Ce=$.data.assignees||[];let Ee=[];switch(ue){case"add":{const me=new Set(Ce.map($e=>$e.id));Ee=[...Ce,...ae.filter($e=>!me.has($e.id))];break}case"overwrite":Ee=ae;break;case"remove":Ee=Ce.filter(me=>!le.has(me.id));break;case"removeAll":Ee=[];break}$.setData({...$.data,assignees:Ee})})},{apiServices:T}=io(!1,s),P=H(null),L=In("filterParams",void 0),I=Y(()=>({workspaceId:String(s.workspaceId),itemIds:d.value&&c.value?[]:u.value,entityId:s.entityId,filterParams:L!=null&&L.value?L.value:void 0})),x=async()=>{var xe;const oe=u.value,ae=s.gridApi;if(!ae){console.error("Grid API is not available for bulk delete.");return}const ue=await((xe=T.value)==null?void 0:xe.bulkDeleteItems(I.value));(ue==null?void 0:ue.message)=="Done"&&(oe.forEach(le=>h(ae,le,{isDeleted:!0,disabled:!0})),ae.deselectAll())},O=async({request:oe,apiUnavailableMessage:ae,failureMessage:ue,onSuccess:xe})=>{var Ce,Ee;const le=u.value,M=s.gridApi;if(!M){console.error(ae);return}const $=await oe();if(($==null?void 0:$.message)!="Done"){console.error(ue),(Ce=P.value)==null||Ce.open();return}xe(le,M),(Ee=P.value)==null||Ee.hide()},N=()=>O({request:()=>{var oe;return(oe=T.value)==null?void 0:oe.bulkUnarchiveItems(I.value)},apiUnavailableMessage:"Grid API is not available for bulk unarchive.",failureMessage:"Failed to unarchive items.",onSuccess:oe=>Q(oe,"isArchived",!1)}),F=()=>O({request:()=>{var oe;return(oe=T.value)==null?void 0:oe.bulkArchiveItems(I.value)},apiUnavailableMessage:"Grid API is not available for bulk archive.",failureMessage:"Failed to archive items.",onSuccess:oe=>Q(oe,"isArchived",!0)}),z=()=>O({request:()=>{var oe;return(oe=T.value)==null?void 0:oe.deleteThumbnail(I.value)},apiUnavailableMessage:"Grid API is not available for bulk thumbnail deletion.",failureMessage:"Failed to delete thumbnails.",onSuccess:(oe,ae)=>oe.forEach(ue=>h(ae,ue,{thumbnail:null}))}),j=()=>O({request:()=>{var oe;return(oe=T.value)==null?void 0:oe.deleteRendition(I.value)},apiUnavailableMessage:"Grid API is not available for bulk rendition deletion.",failureMessage:"Failed to delete renditions.",onSuccess:(oe,ae)=>oe.forEach(ue=>h(ae,ue,{rendition:null}))}),Q=(oe,ae,ue)=>{const xe=s.gridApi;if(!xe){console.error("Grid API is not available for bulk update.");return}const le=[];oe.forEach(M=>{const $=xe.getRowNode(M);$&&($.setData({...$.data,[ae]:typeof ue=="function"?ue():ue}),le.push($))}),xe.redrawRows({rowNodes:le})},re=H(!1),q=H(null),V=async oe=>{var ae,ue,xe;try{switch(G.value=!0,re.value=!0,oe.id){case"unarchive":await N();break;case"delete":await x();break;case"archive":await F();break;case"delete-thumbnail":await z();break;case"delete-rendition":await j();break;case"bulk-rename":await Ge(),(ae=P.value)==null||ae.hide();break;default:console.error("Unknown action:",oe.id),re.value=!1;break}}catch(le){console.error("Error performing action:",le),(ue=P.value)==null||ue.open()}finally{(xe=q.value)==null||xe.focus(),ft(()=>{G.value=!1,re.value=!1})}},k=(oe,ae)=>{var ue;!oe&&ae&&((ue=q.value)==null||ue.focus())},G=H(!0),ee=oe=>{ft(()=>{G.value=oe})};Qe(()=>s.selectRowData,()=>{G.value=!1},{deep:!0,immediate:!0});const ge=Y(()=>({workspaceId:s.workspaceId,entityId:s.entityId,variant:v,disabled:G.value,ids:l.value==At.CHECKED?[]:u.value})),Fe=H(null),Ge=async()=>{var oe;(oe=Fe.value)==null||oe.show()},fe=Y(()=>s.selectRowData.map((oe,ae)=>({name:oe.name,index:ae}))),X=(oe,{currentName:ae,counterValue:ue})=>oe.map(xe=>{switch(xe.type){case"text":return xe.value;case"current_name":return ae;case"counter":return ue;default:return""}}).join(""),we=(oe,ae)=>{const ue=oe.find(xe=>xe.type==="counter");return ue?aN({type:ue.format,direction:ue.direction==="asc"?"up":"down",first:ue.value,step:ue.step,count:ae}):[]},de=(oe,ae)=>{const ue=new Map(s.selectRowData.map(le=>[le.id,le.name||""])),xe=we(oe,ae.length);return ae.map((le,M)=>{const $=ue.get(le)??"",Ce=X(oe,{currentName:$,counterValue:xe[M]??""});return{id:le,from:$,to:Ce}})},B=({parameters:oe,segments:ae,renamedItems:ue,status:xe,response:le,error:M})=>{var Se,Me,Ct;const $=M!==void 0,Ce=xe.status??((Se=M==null?void 0:M.response)==null?void 0:Se.status),Ee=s.selectRowData.length,me=oe.itemIdsCount??null,$e=new Set(ue.map(Rt=>Rt.to)).size,Ye=[$?`FAILED: ${(M==null?void 0:M.message)??"unknown error"} (HTTP ${Ce??"n/a"})`:Ce===202?"OK: HTTP 202, rename queued; table names unchanged, rows set to processing (state 1)":`OK: request resolved (HTTP ${Ce??"unknown"})`,me===null?`Select-all: server resolves items from entity (${Ee} loaded locally)`:me===Ee?`All ${Ee} selected items were sent`:`MISMATCH: ${me} ids sent vs ${Ee} selected`,ue.length?$e===ue.length?"All generated names are unique":`WARNING: ${ue.length-$e} duplicate generated name(s)`:`Names not generated locally (more than ${DN} items); server applies the rename`,le==null||le===""?"Response body is empty":"Response body received"];console.group("[BulkRename] report"),console.log("1. Parameters",oe),console.log("2. Input (segments)",ae),console.log("2. Input (rows)",ue.map(({id:Rt,from:Lt})=>({id:Rt,name:Lt}))),console.log("3. Output (new names)"),console.table(ue),console.log("4. API status",{ok:!$,httpStatus:Ce??null,statusText:xe.statusText??((Me=M==null?void 0:M.response)==null?void 0:Me.statusText)??null}),console.log("5. Response body",$?((Ct=M==null?void 0:M.response)==null?void 0:Ct.data)??M:le),console.log("6. Conclusion",Ye.join(`
|
|
159
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var r,i=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var l=n.next();return i=l.done,l},e:function(l){a=!0,r=l},f:function(){try{i||n.return==null||n.return()}finally{if(a)throw r}}}}function ad(e,t,n){return(t=OM(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,o)}return n}function ld(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AM(Object(n),!0).forEach(function(o){ad(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AM(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Ite(e,t){if(e==null)return{};var n,o,s=xte(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)n=r[o],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function xte(e,t){if(e==null)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)!==-1)continue;n[o]=e[o]}return n}function xc(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},o=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function r(f,p,g,v){var C=p&&p.prototype instanceof a?p:a,S=Object.create(C.prototype);return Us(S,"_invoke",function(b,y,_){var E,D,T,P=0,L=_||[],I=!1,x={p:0,n:0,v:e,a:O,f:O.bind(e,4),d:function(N,F){return E=N,D=0,T=e,x.n=F,i}};function O(N,F){for(D=N,T=F,t=0;!I&&P&&!z&&t<L.length;t++){var z,j=L[t],Q=x.p,re=j[2];N>3?(z=re===F)&&(T=j[(D=j[4])?5:(D=3,3)],j[4]=j[5]=e):j[0]<=Q&&((z=N<2&&Q<j[1])?(D=0,x.v=F,x.n=j[1]):Q<re&&(z=N<3||j[0]>F||F>re)&&(j[4]=N,j[5]=F,x.n=re,D=0))}if(z||N>1)return i;throw I=!0,F}return function(N,F,z){if(P>1)throw TypeError("Generator is already running");for(I&&F===1&&O(F,z),D=F,T=z;(t=D<2?e:T)||!I;){E||(D?D<3?(D>1&&(x.n=-1),O(D,T)):x.n=T:x.v=T);try{if(P=2,E){if(D||(N="next"),t=E[N]){if(!(t=t.call(E,T)))throw TypeError("iterator result is not an object");if(!t.done)return t;T=t.value,D<2&&(D=0)}else D===1&&(t=E.return)&&t.call(E),D<2&&(T=TypeError("The iterator does not provide a '"+N+"' method"),D=1);E=e}else if((t=(I=x.n<0)?T:b.call(y,x))!==i)break}catch(j){E=e,D=1,T=j}finally{P=1}}return{value:t,done:I}}}(f,g,v),!0),S}var i={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][o]?t(t([][o]())):(Us(t={},o,function(){return this}),t),d=c.prototype=a.prototype=Object.create(u);function h(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,c):(f.__proto__=c,Us(f,s,"GeneratorFunction")),f.prototype=Object.create(d),f}return l.prototype=c,Us(d,"constructor",c),Us(c,"constructor",l),l.displayName="GeneratorFunction",Us(c,s,"GeneratorFunction"),Us(d),Us(d,s,"Generator"),Us(d,o,function(){return this}),Us(d,"toString",function(){return"[object Generator]"}),(xc=function(){return{w:r,m:h}})()}function Us(e,t,n,o){var s=Object.defineProperty;try{s({},"",{})}catch{s=0}Us=function(r,i,a,l){function c(u,d){Us(r,u,function(h){return this._invoke(u,d,h)})}i?s?s(r,i,{value:a,enumerable:!l,configurable:!l,writable:!l}):r[i]=a:(c("next",0),c("throw",1),c("return",2))},Us(e,t,n,o)}function Pte(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function OM(e){var t=Pte(e,"string");return typeof t=="symbol"?t:t+""}function Hv(e){"@babel/helpers - typeof";return Hv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hv(e)}function kte(e,t){if(e){if(typeof e=="string")return kM(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kM(e,t):void 0}}var V0=function(e){return e.TOOLBOX_EXPORT_DATA="TOOLBOX_EXPORT_DATA",e.SW_APP_LOADER="SW_APP_LOADER",e}({});function MM(e){return Hv(e)==="object"&&e!==null&&!Array.isArray(e)}function NM(e,t){var n=Object.keys(e);return n.length===t.length&&t.every(function(o){return n.includes(o)})}function Fte(e){return typeof Blob<"u"&&e instanceof Blob}var Ate=function(t){return MM(t)&&NM(t,["file","fileName"])&&Fte(t.file)&&typeof t.fileName=="string"},Ote=function(t){return MM(t)&&NM(t,["scene_id","people_id","openGS","queryParams"])&&(typeof t.scene_id=="string"||t.scene_id===null)&&(typeof t.people_id=="string"||t.people_id===null)&&(typeof t.openGS=="boolean"||t.openGS===null)&&typeof t.queryParams=="string"},Mte=Object.freeze(ad(ad({},V0.TOOLBOX_EXPORT_DATA,Ate),V0.SW_APP_LOADER,Ote));function Nte(e){return Hv(e)==="object"&&e!==null&&!Array.isArray(e)}function Lte(e,t){var n=Object.keys(e);return n.length===t.length&&t.every(function(o){return n.includes(o)})}function Vte(e){if(!Nte(e))return{valid:!1,reason:"Message must be an object."};if(e.version!==1)return{valid:!1,reason:"Unsupported or missing message version."};if(typeof e.type!="string"||!Object.values(V0).includes(e.type))return{valid:!1,reason:"Unknown or missing message type."};if(e.id!==void 0&&typeof e.id!="string")return{valid:!1,reason:"Message id must be a string when provided."};var t=e.id===void 0?["version","type","payload"]:["version","type","payload","id"];if(!Lte(e,t))return{valid:!1,reason:"Message contains missing or unexpected fields."};var n=e.type;return Mte[n](e.payload)?{valid:!0,message:e}:{valid:!1,reason:"Payload does not match the ".concat(n," schema.")}}function Bte(e){var t=e.target,n=e.allowedOrigins,o=e.onMessage,s=e.onInvalidMessage,r=t??(typeof window>"u"?void 0:window);if(!r)throw new TypeError("A target window is required outside a browser environment.");if(!Array.isArray(n)||n.length===0)throw new TypeError("At least one allowed message origin must be configured.");if(n.some(function(a){return typeof a!="string"||a.length===0||a==="*"}))throw new TypeError("Allowed message origins must be explicit origin strings; wildcards are not allowed.");if(typeof o!="function")throw new TypeError("An onMessage callback is required.");var i=function(l){if(!n.includes(l.origin)){s==null||s(l.data,"Untrusted message origin: ".concat(l.origin),l);return}var c=Vte(l.data);if(c.valid===!1){s==null||s(l.data,c.reason,l);return}o(c.message,l)};return r.addEventListener("message",i),function(){return r.removeEventListener("message",i)}}let $te=class extends Error{},hl=class extends $te{constructor(){super("Zone is an abstract class")}},LM=class{get type(){throw new hl}get name(){throw new hl}get ianaName(){return this.name}get isUniversal(){throw new hl}offsetName(t,n){throw new hl}formatOffset(t,n){throw new hl}offset(t){throw new hl}equals(t){throw new hl}get isValid(){throw new hl}};const B0=new Map;function Hte(e){let t=B0.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),B0.set(e,t)),t}const Gte={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Ute(e,t){const n=e.format(t).replace(/\u200E/g,""),o=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,s,r,i,a,l,c,u]=o;return[i,s,r,a,l,c,u]}function Wte(e,t){const n=e.formatToParts(t),o=[];for(let s=0;s<n.length;s++){const{type:r,value:i}=n[s],a=Gte[r];r==="era"?o[a]=i:Gv(a)||(o[a]=parseInt(i,10))}return o}const $0=new Map;let zte=class xT extends LM{static create(t){let n=$0.get(t);return n===void 0&&$0.set(t,n=new xT(t)),n}static resetCache(){$0.clear(),B0.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=xT.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:o}){return Yte(t,n,o,this.name)}formatOffset(t,n){return Wv(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const o=Hte(this.name);let[s,r,i,a,l,c,u]=o.formatToParts?Wte(o,n):Ute(o,n);a==="BC"&&(s=-Math.abs(s)+1);const h=qte({year:s,month:r,day:i,hour:l===24?0:l,minute:c,second:u,millisecond:0});let f=+n;const p=f%1e3;return f-=p>=0?p:1e3+p,(h-f)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}},H0=null,jte=class yg extends LM{static get utcInstance(){return H0===null&&(H0=new yg(0)),H0}static instance(t){return t===0?yg.utcInstance:new yg(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new yg(BM(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Wv(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Wv(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Wv(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}};function Gv(e){return typeof e>"u"}function Uv(e,t=2){const n=e<0;let o;return n?o="-"+(""+-e).padStart(t,"0"):o=(""+e).padStart(t,"0"),o}function VM(e){if(!(Gv(e)||e===null||e===""))return parseInt(e,10)}function Kte(e){if(!(Gv(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function qte(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function Yte(e,t,n,o=null){const s=new Date(e),r={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};o&&(r.timeZone=o);const i={timeZoneName:t,...r},a=new Intl.DateTimeFormat(n,i).formatToParts(s).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function BM(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const o=parseInt(t,10)||0,s=n<0||Object.is(n,-0)?-o:o;return n*60+s}function Wv(e,t){const n=Math.trunc(Math.abs(e/60)),o=Math.trunc(Math.abs(e%60)),s=e>=0?"+":"-";switch(t){case"short":return`${s}${Uv(n,2)}:${Uv(o,2)}`;case"narrow":return`${s}${n}${o>0?`:${o}`:""}`;case"techie":return`${s}${Uv(n,2)}${Uv(o,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}const $M=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function cd(...e){const t=e.reduce((n,o)=>n+o.source,"");return RegExp(`^${t}$`)}function ud(...e){return t=>e.reduce(([n,o,s],r)=>{const[i,a,l]=r(t,s);return[{...n,...i},a||o,l]},[{},null,1]).slice(0,2)}function HM(...e){return(t,n)=>{const o={};let s;for(s=0;s<e.length;s++)o[e[s]]=VM(t[n+s]);return[o,null,n+s]}}const GM=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,Xte=`(?:${GM.source}?(?:\\[(${$M.source})\\])?)?`,UM=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,WM=RegExp(`${UM.source}${Xte}`),G0=RegExp(`(?:[Tt]${WM.source})?`),Zte=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Jte=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Qte=/(\d{4})-?(\d{3})/,ene=HM("weekYear","weekNumber","weekDay"),tne=HM("year","ordinal"),nne=/(\d{4})-(\d\d)-(\d\d)/,zM=RegExp(`${UM.source} ?(?:${GM.source}|(${$M.source}))?`),one=RegExp(`(?: ${zM.source})?`);function dd(e,t,n){const o=e[t];return Gv(o)?n:VM(o)}function sne(e,t){return[{year:dd(e,t),month:dd(e,t+1,1),day:dd(e,t+2,1)},null,t+3]}function hd(e,t){return[{hours:dd(e,t,0),minutes:dd(e,t+1,0),seconds:dd(e,t+2,0),milliseconds:Kte(e[t+3])},null,t+4]}function Jf(e,t){const n=!e[t]&&!e[t+1],o=BM(e[t+1],e[t+2]),s=n?null:jte.instance(o);return[{},s,t+3]}function Qf(e,t){const n=e[t]?zte.create(e[t]):null;return[{},n,t+1]}cd(Zte,G0),cd(Jte,G0),cd(Qte,G0),cd(WM),ud(sne,hd,Jf,Qf),ud(ene,hd,Jf,Qf),ud(tne,hd,Jf,Qf),ud(hd,Jf,Qf),ud(hd),cd(nne,one),cd(zM),ud(hd,Jf,Qf);var rne=["accessTokenKey","refreshTokenKey","domain","path","secure","sameSite","canSetTokens","cookieParser"];function Dt(){if(typeof sessionStorage<"u"&&sessionStorage.getItem("APP_DEBUG")==="1"){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];(e=console).log.apply(e,["[DEBUG COMMON_UTILS]"].concat(n))}}function ep(){if(typeof sessionStorage<"u"&&sessionStorage.getItem("APP_DEBUG")==="1"){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];(e=console).error.apply(e,["[DEBUG COMMON_UTILS]"].concat(n))}}function zv(){if(typeof sessionStorage<"u"&&sessionStorage.getItem("APP_DEBUG")==="1"){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];(e=console).warn.apply(e,["[DEBUG COMMON_UTILS]"].concat(n))}}function ine(){var e=typeof window<"u"?sessionStorage.getItem("BASE_DOMAIN_COOKIE")||window.location.hostname:void 0;return Dt("getStandardizedCookieConfig - domain:",e,"from BASE_DOMAIN_COOKIE:",sessionStorage.getItem("BASE_DOMAIN_COOKIE")),{accessTokenKey:"account.token",refreshTokenKey:"account.refresh_token",domain:e,path:"/",secure:!0,sameSite:"lax"}}function ane(){return{maxRetries:5,retryDelay:500,backoffFactor:1.5}}var jM=1e3,lne=1e4;function KM(e){if(!(typeof window>"u")){var t=window.self!==window.top;try{if(t&&window.top){Dt("Inside iframe - redirecting top window to:",e),window.top.location.replace(e);return}}catch(n){ep("Top window redirect blocked, redirecting current window instead:",n)}try{Dt("Redirecting current window to:",e),window.location.replace(e)}catch(n){ep("Failed to redirect:",n)}}}function jv(e){return typeof e!="string"||!e?e:e.length<=2?"*".repeat(e.length):"".concat(e[0]).concat("*".repeat(e.length-2)).concat(e[e.length-1])}function cne(e){return ld(ld({},e),{},{access_token:jv(e.access_token),token:jv(e.token),refresh_token:jv(e.refresh_token)})}function Kv(e){if(!e)return!1;var t=e.trim();return!!t&&t!=="undefined"&&t!=="null"}function qM(e){return Kv(e.getAccessToken())||Kv(e.getRefreshToken())}function une(e){if(!(typeof document>"u")){var t=typeof window<"u"?window.location.hostname:"",n=e||(typeof sessionStorage<"u"?sessionStorage.getItem("BASE_DOMAIN_COOKIE"):null)||t,o=Array.from(new Set([n,t].filter(Boolean)));Dt("Clearing all cookies - domains:",o);var s=document.cookie.split(";");s.forEach(function(r){var i=r.split("=")[0].trim();i&&(document.cookie="".concat(i,"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"),o.forEach(function(a){document.cookie="".concat(i,"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=").concat(a)}))})}}function dne(){typeof sessionStorage<"u"&&sessionStorage.clear()}function hne(e){return function(t){var n,o=(n=t.response)===null||n===void 0?void 0:n.status,s=qM(e);if(Dt("getStandardizedTokenExpiredDetection - status:",o,"userLoggedIn:",s),!s)return Dt("User not logged in - returning false"),!1;if(o===400){var r,i,a,l=(r=t.response)===null||r===void 0?void 0:r.data,c=(l==null?void 0:l.error)==="invalid_token"||(l==null||(i=l.error)===null||i===void 0?void 0:i.key)==="invalid_token";return Dt(" 400 error - isInvalidToken:",c,"error:",l==null?void 0:l.error,"error.key:",l==null||(a=l.error)===null||a===void 0?void 0:a.key),!1}if(o===401){var u,d,h=(u=t.response)===null||u===void 0?void 0:u.data,f=h==null||(d=h.error)===null||d===void 0?void 0:d.key,p=h==null?void 0:h.details;return Dt(" 401 error - errorKey:",f,"details:",p),f==="unauthenticated"&&(!p||Object.keys(p).length===0||p.reason==="refresh_token_expired")?(Dt(" 401 unauthenticated - triggering refresh"),!0):(Dt(" 401 error but not unauthenticated - returning false"),!1)}return o===425?(Dt(" 425 error - triggering refresh"),!0):(Dt("Status",o,"not handled - returning false"),!1)}}var fne=function(){function e(){var t,n,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};N0(this,e),this.accessTokenKey=o.accessTokenKey||"access_token",this.refreshTokenKey=o.refreshTokenKey||"refresh_token",this.domain=o.domain,this.path=o.path||"/",this.secure=(t=o.secure)!==null&&t!==void 0?t:!0,this.sameSite=o.sameSite||"lax",this.canSetTokens=(n=o.canSetTokens)!==null&&n!==void 0?n:!0,this.cookieParser=o.cookieParser}return L0(e,[{key:"getCookieValue",value:function(n){if(typeof document>"u")return null;var o=document.cookie.split(";"),s=Dte(o),r;try{for(s.s();!(r=s.n()).done;){var i=r.value;if(i=i.trim(),i.startsWith(n+"=")){var a=i.substring(n.length+1);return this.cookieParser?this.cookieParser(a,n):decodeURIComponent(a)}}}catch(l){s.e(l)}finally{s.f()}return null}},{key:"getAccessToken",value:function(){return this.getCookieValue(this.accessTokenKey)}},{key:"getRefreshToken",value:function(){return this.getCookieValue(this.refreshTokenKey)}},{key:"getExpiresInRefreshToken",value:function(){return this.getCookieValue("account.expires_in_refresh_token")}},{key:"setTokens",value:function(n){if(!this.canSetTokens||typeof document>"u"){zv(" CookieTokenStorage: Token setting is disabled or running in a non-browser environment");return}Dt(" setTokens called - storing tokens with keys:",this.accessTokenKey,this.refreshTokenKey,"domain:",this.domain);var o=this.domain?"; domain=".concat(this.domain):"",s=this.secure?"; secure":"",r="; samesite=".concat(this.sameSite),i="",a="";if(n.expires_in&&typeof n.expires_in=="number"){var l=new Date;l.setTime(l.getTime()+n.expires_in*1e3),i=";expires=".concat(l.toUTCString())}var c=this.getExpiresInRefreshToken();if(Dt("setTokens - refresh token data:",cne(n)),Dt("setTokens - refresh token expires_in value:",c),c){var u=new Date;u.setTime(u.getTime()+Number(c)*1e3),a=";expires=".concat(u.toUTCString())}if(n.access_token||n.token){var d=n.access_token||n.token,h="".concat(this.accessTokenKey,"=").concat(encodeURIComponent(d),"; path=").concat(this.path).concat(o).concat(s).concat(r).concat(i);document.cookie=h}if(n.refresh_token_expires_in&&typeof n.refresh_token_expires_in=="number"){var f=new Date;f.setTime(f.getTime()+n.refresh_token_expires_in*1e3),i=";expires=".concat(f.toUTCString())}if(n.refresh_token){Dt("setTokens - refresh token set to:",jv(n.refresh_token)),Dt("setTokens - refresh token expires_in set to:",a);var p="".concat(this.refreshTokenKey,"=").concat(encodeURIComponent(n.refresh_token),"; path=").concat(this.path).concat(o).concat(s).concat(r).concat(a);document.cookie=p}}},{key:"hasTokens",value:function(){return!!this.getAccessToken()&&!!this.getRefreshToken()}}])}(),pne=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"auth_state_channel",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"auth_state_event";N0(this,e),ad(this,"channel",null),this.channelName=t,this.storageKey=n,this.initChannel()}return L0(e,[{key:"initChannel",value:function(){if(typeof BroadcastChannel<"u")try{this.channel=new BroadcastChannel(this.channelName)}catch(n){console.error("Failed to create BroadcastChannel, falling back to storage events:",n),this.channel=null}}},{key:"broadcastEvent",value:function(n){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={type:n,data:s,timestamp:Date.now()};this.channel?this.channel.postMessage(r):typeof localStorage<"u"&&(localStorage.setItem(this.storageKey,JSON.stringify(r)),setTimeout(function(){return localStorage.removeItem(o.storageKey)},100))}},{key:"onEvent",value:function(n){var o=this;return this.channel?this.channel.onmessage=function(s){n(s.data)}:typeof window<"u"&&window.addEventListener("storage",function(s){if(s.key===o.storageKey&&s.newValue)try{var r=JSON.parse(s.newValue);n(r)}catch(i){console.error("Failed to parse auth event:",i)}}),function(){o.channel?o.channel.onmessage=null:typeof window<"u"&&window.removeEventListener("storage",function(){})}}},{key:"destroy",value:function(){this.channel&&(this.channel.close(),this.channel=null)}}])}(),gne=function(){function e(t){var n=this;if(N0(this,e),ad(this,"currentAttempt",0),ad(this,"isLoggingOut",!1),this.instanceId=Math.random().toString(36).substring(2,15),this.refreshTokenFn=t.refreshTokenFn,this.tokenStorage=t.storage,this.useStandardizedConfig=t.useStandardizedConfig===!0,Dt("RefreshTokenHandler initialized - useStandardizedConfig:",this.useStandardizedConfig),this.useStandardizedConfig){var o=ane();this.maxRetries=o.maxRetries,this.retryDelay=o.retryDelay,this.backoffFactor=o.backoffFactor,Dt(" Using standardized retry config - maxRetries:",this.maxRetries,"retryDelay:",this.retryDelay,"backoffFactor:",this.backoffFactor)}else this.maxRetries=t.maxRetries||3,this.retryDelay=t.retryDelay||1e3,this.backoffFactor=t.backoffFactor||2,Dt(" Using custom retry config - maxRetries:",this.maxRetries,"retryDelay:",this.retryDelay,"backoffFactor:",this.backoffFactor);this.onCrossTabLogout=t.onCrossTabLogout,this.authStateManager=new pne,this.initCrossTabListener(),this.onRefreshSuccess=t.onRefreshSuccess||function(){Dt("Token refresh successful")},this.onRefreshFailure=t.onRefreshFailure||function(s){console.error("Token refresh failed:",s)},this.onTokenInvalid=t.onTokenInvalid||function(){Dt("Token is invalid or cannot be refreshed");var s=new Error("No refresh token available");n.useStandardizedConfig?n.handleLogout("no_refresh_token",s):(n.onRefreshFailure(s),n.authStateManager.broadcastEvent("auth:logout",{sourceInstanceId:n.instanceId,reason:"no_refresh_token",error:"No refresh token available"}))}}return L0(e,[{key:"isLogoutInProgress",get:function(){return this.isLoggingOut}},{key:"handleLogout",value:function(n,o){if(this.isLoggingOut){Dt("handleLogout skipped - logout already in progress");return}Dt("handleLogout called with reason:",n),this.onRefreshFailure&&(Dt("Calling onRefreshFailure callback"),this.onRefreshFailure(o));var s=this.getLogoutTag(n,"this-tab");this.authStateManager.broadcastEvent("auth:logout",{sourceInstanceId:this.instanceId,reason:n,tag:s,error:(o==null?void 0:o.message)||"Token refresh failed"}),this.clearStateAndRedirectToLogin(s)}},{key:"getLogoutTag",value:function(n,o){return Kv(this.tokenStorage.getRefreshToken())?(console.error("False logout detected. Refresh token not expired. Reason: ".concat(n)),console.error("Sender channel: ".concat(o)),-1):1}},{key:"clearStateAndRedirectToLogin",value:function(n){if(!this.isLoggingOut){this.isLoggingOut=!0;var o=typeof sessionStorage<"u"&&sessionStorage.getItem("BASE_URL")||"",s=typeof sessionStorage<"u"&&sessionStorage.getItem("BASE_DOMAIN_COOKIE")||void 0;if(typeof localStorage<"u"&&typeof window<"u")try{var r="".concat(window.location.pathname).concat(window.location.search);localStorage.setItem("last_url_access_after_timeout",r),localStorage.removeItem("retryCount"),Dt("localStorage updated - saved last URL:",r)}catch(a){ep("Failed to update localStorage:",a)}Dt("Clearing sessionStorage and cookies"),dne(),une(s);var i="".concat(o,"/login?timeout=").concat(n);Dt("Redirecting to login in ".concat(jM,"ms:"),i),setTimeout(function(){return KM(i)},jM)}}},{key:"initCrossTabListener",value:function(){var n=this;this.authStateManager.onEvent(function(o){if(o.type==="auth:logout")if(Dt("Received logout event:",o.data),o.data&&o.data.sourceInstanceId!==n.instanceId){if(Dt("Logout event from different tab, executing logout handlers"),n.onCrossTabLogout?(Dt("Executing onCrossTabLogout with reason: ".concat(o.data.reason||"cross_tab_logout")),n.onCrossTabLogout(o.data.reason||"cross_tab_logout")):typeof n.onLogout=="function"?(Dt("Executing legacy onLogout with reason: ".concat(o.data.reason)),n.onLogout(o.data.reason)):n.useStandardizedConfig||console.warn("No logout handler defined for cross-tab events"),n.useStandardizedConfig){var s=o.data.tag===-1||o.data.tag===1,r=s?o.data.tag:n.getLogoutTag(o.data.reason||"cross_tab_logout","cross-tab");s&&r===-1&&(console.error("False logout detected. Reason: ".concat(o.data.reason||"cross_tab_logout")),console.error("Sender channel: cross-tab")),Dt("Standardized mode - logging out this tab after cross-tab event, tag:",r),n.clearStateAndRedirectToLogin(r)}}else Dt("Ignoring self-generated logout event")})}},{key:"handleTokenRefresh",value:function(){var t=M0(xc().m(function o(){var s=this,r,i,a,l;return xc().w(function(c){for(;;)switch(c.p=c.n){case 0:if(r=this.tokenStorage.getRefreshToken(),Dt(" handleTokenRefresh started, refreshToken available:",!!r),r){c.n=1;break}return Dt(" ERROR: No refresh token available - cannot refresh"),this.onTokenInvalid(),c.a(2,!1);case 1:return this.currentAttempt=0,c.p=2,c.n=3,this.executeWithRetry(function(){return Dt("Refresh attempt ".concat(s.currentAttempt+1,"/").concat(s.maxRetries)),s.refreshTokenFn(s.tokenStorage.getRefreshToken())});case 3:if(i=c.v,!(!i||!i.access_token&&!i.token)){c.n=4;break}throw console.error("Invalid token response received"),new Error("Invalid token response");case 4:return i.token&&!i.access_token&&(i.access_token=i.token),Dt(" Token refresh successful, saving new tokens"),this.tokenStorage.setTokens(i),Dt(" Calling onRefreshSuccess callback"),this.onRefreshSuccess(i),c.a(2,!0);case 5:return c.p=5,l=c.v,console.error("Token refresh failed after all attempts:",l),l===void 0&&(l=new Error("Undefined error during token refresh")),this.useStandardizedConfig?this.handleLogout("max_retry_reached",l):(this.onRefreshFailure(l),this.authStateManager.broadcastEvent("auth:logout",{sourceInstanceId:this.instanceId,reason:"max_retry_reached",error:((a=l)===null||a===void 0?void 0:a.message)||"Token refresh failed after maximum retries"})),c.a(2,!1)}},o,this,[[2,5]])}));function n(){return t.apply(this,arguments)}return n}()},{key:"executeWithRetry",value:function(){var t=M0(xc().m(function o(s){var r,i,a,l;return xc().w(function(c){for(;;)switch(c.p=c.n){case 0:return c.p=0,c.n=1,s();case 1:return c.a(2,c.v);case 2:if(c.p=2,l=c.v,this.currentAttempt++,!(this.currentAttempt>=this.maxRetries)){c.n=3;break}throw Dt("Maximum retry attempts (".concat(this.maxRetries,") reached")),l;case 3:return i=(l==null||(r=l.response)===null||r===void 0?void 0:r.status)===425,a=i?this.getRetryAfterDelay(l):this.retryDelay*Math.pow(this.backoffFactor,this.currentAttempt-1),Dt("Retry in ".concat(a,"ms, attempt ").concat(this.currentAttempt,"/").concat(this.maxRetries)),c.n=4,new Promise(function(u){return setTimeout(u,a)});case 4:return c.a(2,this.executeWithRetry(s))}},o,this,[[0,2]])}));function n(o){return t.apply(this,arguments)}return n}()},{key:"getRetryAfterDelay",value:function(n){var o;if(n!=null&&(o=n.response)!==null&&o!==void 0&&o.headers){var s=n.response.headers["retry-after"];if(s){var r=parseInt(s,10);if(!isNaN(r))return r*1e3;var i=new Date(s);if(!isNaN(i.getTime()))return i.getTime()-Date.now()}}return this.retryDelay*Math.pow(this.backoffFactor,this.currentAttempt-1)}},{key:"broadcastLogout",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"manual_logout";Dt("Broadcasting logout event with reason: ".concat(n)),this.authStateManager.broadcastEvent("auth:logout",{sourceInstanceId:this.instanceId,reason:n,timestamp:Date.now()})}}])}();function mne(e,t){var n,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=(n=o.useStandardizedConfig)!==null&&n!==void 0?n:t.useStandardizedConfig;Dt("createRefreshInterceptor called - useStandardizedConfig:",s);var r=s?hne(t.tokenStorage):o.tokenExpiredDetection||function(c){var u;return((u=c.response)===null||u===void 0?void 0:u.status)===401},i=s?[401,425]:o.retryStatusCodes||[401,425],a=o.tokenHeaderFormatter||function(c){return"Bearer ".concat(c)};Dt("Interceptor config - retryStatusCodes:",i,"using standardized detection:",s);var l=null;e.interceptors.response.use(function(c){return c},function(){var c=M0(xc().m(function u(d){var h,f,p,g,v,C,S,b,y,_,E,D,T,P,L,I,x,O,N,F,z;return xc().w(function(j){for(;;)switch(j.p=j.n){case 0:if(g=d.config,v=function(re){var q,V=s&&t.isLogoutInProgress;return zv(V?"HOLD ->":"REJECT ->",((g==null?void 0:g.method)||"").toUpperCase(),g==null?void 0:g.url,"| status:",(q=d.response)===null||q===void 0?void 0:q.status,"| reason:",re,"| logoutInProgress:",t.isLogoutInProgress,"| at:",new Date().toISOString().slice(11,23)),V?new Promise(function(k,G){setTimeout(function(){zv("Logout redirect did not happen in time - releasing held request:",g==null?void 0:g.url),G(d)},lne)}):Promise.reject(d)},g){j.n=1;break}return j.a(2,v("no request config"));case 1:if(!g._retry){j.n=2;break}return j.a(2,v("retried request failed again"));case 2:if(C=(h=d.response)===null||h===void 0?void 0:h.status,Dt(" Response error handler triggered - status:",C,"url:",g.url),S=r(d),Dt(" tokenExpiredDetection returned:",S),b=!1,C===400)if(E=(y=d.response)===null||y===void 0?void 0:y.data,D=(E==null?void 0:E.error)==="invalid_token"||(E==null||(_=E.error)===null||_===void 0?void 0:_.key)==="invalid_token",D)if(b=!1,s){if(Dt(" 400 invalid_token (standardized) - clearing account.token from cookies"),typeof document<"u")try{T=sessionStorage.getItem("BASE_DOMAIN_COOKIE")||window.location.hostname,Dt(" Clearing account.token - domain:",T),document.cookie="account.token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=".concat(T),document.cookie="account.token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/",Dt(" ✅ Removed account.token from cookies (prevents infinite 400 loop)")}catch(Q){ep(" Failed to clear account.token:",Q)}typeof window<"u"&&(P=sessionStorage.getItem("BASE_URL")||"",L="".concat(P,"/sw?redirect=1"),Dt("Redirecting to re-auth page - URL:",L),KM(L))}else Dt(" 400 invalid_token (custom config) - user handles via callbacks");else b=!1,Dt(" 400 non-invalid_token - skip refresh");else s&&C===401&&!qM(t.tokenStorage)?(I=typeof window<"u"&&window.location.pathname.includes("/login"),x=/login|refresh-token|refreshToken/i.test(g.url||""),I||x?Dt("401 with no tokens on login page/auth request - not redirecting"):(Dt("401 with no tokens - logging out and redirecting to /login"),t.handleLogout("no_tokens",new Error("No authentication tokens available"))),b=!1):(b=S&&i.includes(C),Dt(" Status",C,"- shouldRefresh:",S,"in retryStatusCodes:",i.includes(C),"canRetry:",b));if(b){j.n=3;break}return j.a(2,v("not eligible for refresh"));case 3:if(O=((f=g.url)===null||f===void 0?void 0:f.includes("refresh-token"))||((p=g.url)===null||p===void 0?void 0:p.includes("refreshToken")),!O){j.n=4;break}return j.a(2,v("refresh endpoint itself failed"));case 4:return g._retry=!0,j.p=5,l?Dt(" Using existing refresh promise"):(Dt(" Starting new token refresh"),l=t.handleTokenRefresh()),j.n=6,l;case 6:if(N=j.v,l=null,N){j.n=7;break}return j.a(2,v("token refresh failed (waiting request)"));case 7:return F=t.tokenStorage.getAccessToken(),Dt(" Token refreshed successfully, new token available:",!!F),F?(Dt(" Injecting refreshed token into Authorization header for retry"),g.headers.Authorization=a(F)):zv(" WARNING: Token refresh succeeded but no token in storage!"),Dt(" Retrying original request with new token"),j.a(2,e(g));case 8:return j.p=8,z=j.v,ep(" Error during refresh:",z),l=null,j.a(2,v("error thrown during refresh"))}},u,null,[[5,8]])}));return function(u){return c.apply(this,arguments)}}()),e.interceptors.request.use(function(c){var u=c.headers.Authorization;if(u){var d=String(u).replace(/^Bearer\s*/i,"").trim();if(d&&d!=="undefined"&&d!=="null")return c;Dt("Removing invalid Authorization header:",u),delete c.headers.Authorization}var h=t.tokenStorage.getAccessToken(),f=t.tokenStorage.getRefreshToken();return Dt(" Request interceptor: token exists:",!!h,"refreshToken exists:",!!f,"url:",c.url),h&&Kv(h)?(Dt(" Access token available - injecting into Authorization header"),c.headers.Authorization=a(h)):Dt(f?" Access token missing/empty but refresh token available - response interceptor will handle 401":" Both tokens missing/empty - allowing request (no token to inject)"),c},function(c){return Promise.reject(c)})}function vne(e){var t=e.useStandardizedConfig===!0;Dt("createCookieRefreshHandler called - useStandardizedConfig:",t);var n;if(t){var o=ine();n=ld(ld({},o),{},{canSetTokens:e.canSetTokens,cookieParser:e.cookieParser}),Dt(" Applied standardized cookie config:",n)}else{var s=e.accessTokenKey,r=e.refreshTokenKey,i=e.domain,a=e.path,l=e.secure,c=e.sameSite,u=e.canSetTokens,d=e.cookieParser;n={accessTokenKey:s,refreshTokenKey:r,domain:i,path:a,secure:l,sameSite:c,canSetTokens:u,cookieParser:d},Dt(" Applied custom cookie config:",n)}var h=new fne(n);e.accessTokenKey,e.refreshTokenKey,e.domain,e.path,e.secure,e.sameSite,e.canSetTokens,e.cookieParser;var f=Ite(e,rne);return new gne(ld(ld({},f),{},{storage:h,useStandardizedConfig:t}))}var Oo=function(e){return e.review="{reviewDomain}/{ws_code}",e.review_take="{reviewDomain}/{ws_code}?id={take_id}",e.review_scene="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",e.review_rendition="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",e.review_frame="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}&tab=comment&refresh_marker=true#type=frame&data={frame}",e.review_rendition_comment="{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}&tab=comment",e.review_comment="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",e.scene_hub="{baseDomain}/{ws_code}/{scene_id}?o=st",e.hub_rendition="{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",e.hub_comment="{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",e.people_insight="{baseDomain}/{ws_code}/{user_id}?o=pt",e.people_detail="{baseDomain}/{ws_code}/ws/ppl/{display_name}-{user_id}",e.project="{baseDomain}/{ws_code}/pl/dir/{entity_id}",e.project_focusMode="{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",e.woohoo="{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",e.update="{baseDomain}/{ws_code}/pl/au?id={entity_id}",e.core="{baseDomain}/{ws_code}",e}(Oo||{});Oo.review,Oo.review_take,Oo.review_scene,Oo.review_rendition,Oo.review_frame,Oo.review_rendition_comment,Oo.review_comment,Oo.scene_hub,Oo.hub_rendition,Oo.hub_comment,Oo.people_insight,Oo.people_detail,Oo.project,Oo.woohoo,Oo.update,Oo.core,Oo.project_focusMode;const YM={accessToken:"account.token",refreshToken:"account.refresh_token"},yne={baseUrl:"BASE_URL"},XM="/refresh-token",wne=3e5,Cne="*",ZM={Accept:"application/json","Content-Type":"application/json"},bne="undefined",Sne="No access token found",Pc={badRequest:400,unauthorized:401,tooEarly:425},Ene=[Pc.unauthorized,Pc.tooEarly,Pc.badRequest],_ne="unauthenticated",Rne="invalid_token",Tne="refresh_token_expired",Dne={type:"TOKEN_EXPIRED",message:"Authentication token has expired"},Ine="Session refreshed successfully",xne="Session expired. Please log in again.",Pne=e=>{const{error:t}=e??{};return typeof t=="string"?t:t==null?void 0:t.key},kne=e=>{var t,n;return((t=e==null?void 0:e.response)==null?void 0:t.status)!==Pc.badRequest?!1:Pne((n=e.response)==null?void 0:n.data)===Rne},Fne=()=>{},Ane=e=>sessionStorage.getItem(e)||"",U0=()=>{const e=lv.get(YM.accessToken);return e&&e!==bne?e:null},One=()=>!!lv.get(YM.refreshToken),Mne=()=>{const e=window.location.origin,t=Ane(yne.baseUrl);if(!t)return e;try{return new URL(t,e).origin}catch{return e}};class W0{constructor(t,n=Fne,o){this.client=t,this.showMessage=n,this.onAuthExpired=o}attach(){const t=vne({refreshTokenFn:n=>this.refresh(n),onRefreshSuccess:n=>{this.showMessage(Ine,"success"),this.client.defaults.headers.common.Authorization=`Bearer ${n.access_token}`},onRefreshFailure:()=>{this.showMessage(xne,"error")},useStandardizedConfig:!0});this.handler=t,mne(this.client,t,{retryStatusCodes:[...Ene],tokenExpiredDetection:W0.isTokenExpired})}refreshAccessToken(){return!this.handler||!One()?Promise.resolve(!1):(this.pendingRefresh??(this.pendingRefresh=this.handler.handleTokenRefresh().catch(()=>!1).finally(()=>{this.pendingRefresh=void 0})),this.pendingRefresh)}static isTokenExpired(t){var i,a;const n=(i=t==null?void 0:t.response)==null?void 0:i.status;if(n===Pc.tooEarly)return!0;const{error:o,details:s={}}=((a=t==null?void 0:t.response)==null?void 0:a.data)??{},r=typeof o=="string"?o:o==null?void 0:o.key;return n===Pc.badRequest||n!==Pc.unauthorized||typeof o=="string"||r!==_ne?!1:Object.keys(s).length===0||s.reason===Tne}async refresh(t){const n=await this.client.post(XM,{refresh_token:t}),o="data"in n&&n.data?n.data:n;return console.log("Refreshing tokens:",{tokens:o,res:n}),{access_token:o.access_token,refresh_token:o.refresh_token,expires_in:o.expires_in}}handleAuthExpired(){var t;if(window.self===window.top){(t=this.onAuthExpired)==null||t.call(this);return}window.parent.postMessage(Dne,Mne())}}class Nne{constructor(t={}){this.options={unwrapResponse:!0,withRefreshToken:!0,requireToken:!0,...t},this.client=to.create({baseURL:typeof t.baseURL=="string"?t.baseURL:"",timeout:t.timeout??wne,headers:{...ZM,...t.headers}}),this.setupRequestInterceptor(),this.setupResponseInterceptor(),this.setupErrorHandling()}get(t,n){return this.request({...n,method:"GET",url:t})}post(t,n,o){return this.request({...o,method:"POST",url:t,data:n})}put(t,n,o){return this.request({...o,method:"PUT",url:t,data:n})}patch(t,n,o){return this.request({...o,method:"PATCH",url:t,data:n})}delete(t,n){return this.request({...n,method:"DELETE",url:t})}request(t){return this.client.request(t)}setupRequestInterceptor(){this.client.interceptors.request.use(async t=>{const{baseURL:n,dynamicHeaders:o,requireToken:s}=this.options;typeof n=="function"&&(t.baseURL=n());const r=t.url===XM,i=r?U0():await this.resolveAccessToken();if(!i&&s&&!r)throw new Error(Sne);t.headers.set("Accept-Language",Cne),t.headers.has("Content-Type")||t.headers.set("Content-Type",ZM["Content-Type"]),t.headers.has("Content-Type")&&t.headers.get("Content-Type")==="multipart/form-data"&&t.headers.delete("Content-Type"),i&&t.headers.set("Authorization",`Bearer ${i}`);for(const[a,l]of Object.entries((o==null?void 0:o(t))??{}))t.headers.set(a,l);return t})}async resolveAccessToken(){const t=U0();return t||!this.tokenRefresher?t:(await this.tokenRefresher.refreshAccessToken(),U0())}setupResponseInterceptor(){this.client.interceptors.response.use(t=>this.options.unwrapResponse?t.data:t)}setupErrorHandling(){const{withRefreshToken:t,showMessage:n,onAuthExpired:o,onError:s}=this.options;t&&(this.tokenRefresher=new W0(this.client,n,o),this.tokenRefresher.attach()),this.client.interceptors.response.use(void 0,r=>(kne(r)&&(o==null||o("/sw?redirect=1")),Promise.reject(r))),s&&this.client.interceptors.response.use(void 0,s)}}const Lne=5,Vne=1e3,Bne=3,$ne="default",Hne=e=>new URL(e,"http://localhost").pathname;class Gne{constructor(t={}){this.groups=new Map,this.defaultLimit=t.defaultLimit??Lne,this.rules=t.rules??[],this.releaseDelayMs=t.releaseDelayMs??Vne}async run(t,n){const o=this.resolveGroup(t);await this.acquire(o);try{return await n()}finally{this.release(o)}}resolveGroup(t){const n=Hne(t),o=this.rules.find(i=>i.pattern.test(n)),s=o?o.pattern.source:$ne;let r=this.groups.get(s);return r||(r={limit:(o==null?void 0:o.limit)??this.defaultLimit,ongoing:0,queue:[]},this.groups.set(s,r)),r}acquire(t){return new Promise(n=>{const o=()=>{t.ongoing++,n()};t.ongoing<t.limit?o():t.queue.push(o)})}release(t){t.ongoing--;const n=t.queue.shift();n&&setTimeout(n,this.releaseDelayMs)}}const Une=(e,t)=>{const n=new Gne(t),o=to.getAdapter(e.defaults.adapter);return e.defaults.adapter=s=>n.run(s.url??"",()=>o(s)),n},Wne=(e,{maxRetries:t=Bne}={})=>{e.interceptors.response.use(void 0,async n=>{var a,l;const o=n.config;if(((a=n.response)==null?void 0:a.status)!==429||!o)return Promise.reject(n);const s=(o._retryCount??0)+1;if(s>t)return Promise.reject(n);o._retryCount=s;const r=Number.parseInt(String(((l=n.response.headers)==null?void 0:l["retry-after"])??""),10),i=Number.isNaN(r)?2**s*1e3:r*1e3;return await new Promise(c=>setTimeout(c,i)),e.request(o)})},zne=6e4,jne="/start",Kne=(e=jne)=>{const n=`${sessionStorage.getItem("BASE_URL")||""}${e}`;console.log("Redirecting to auth URL:",n),window.location.replace(n)};function qne(e,t){const n=sessionStorage.getItem(e)||"";return(n==null?void 0:n.length)>0?n:t}class Yne{constructor(t,n={}){const{concurrency:o,rateLimitRetry:s,...r}=n,i=()=>qne("API_BASE_URL","");this.callbackFunc=t,this.api=new Nne({baseURL:i,timeout:zne,requireToken:!0,onAuthExpired:Kne,...r,unwrapResponse:!1,showMessage:t}),this.axios=this.api.client,o!==!1&&Une(this.axios,o),s!==!1&&Wne(this.axios,s)}buildUrl(t=""){const n=t.replace(/^\//,"");return!n.startsWith("http://")&&!n.startsWith("https://")?`/${n}`:n}buildQueryParams(t){const n=new URLSearchParams;Object.entries(t).forEach(([s,r])=>{r!=null&&r!==""&&(Array.isArray(r)?r.forEach(i=>n.append(s,String(i))):typeof r=="object"?n.append(s,JSON.stringify(r)):n.append(s,String(r)))});const o=n.toString();return o?`?${o}`:""}async send(t,n,{params:o,data:s,options:r}={}){try{const i=o?this.buildQueryParams(o):"",a={...r,method:t,url:`${this.buildUrl(n)}${i}`};return s!==void 0&&(a.data=s),(await this.axios.request(a)).data}catch(i){throw Rte(i)}}get(t="",n,o){return this.send("GET",t,{params:n,options:o})}post(t="",n,o,s){return this.send("POST",t,{params:n,data:o,options:s})}put(t="",n,o){return this.send("PUT",t,{data:n,options:o})}patch(t="",n,o){return this.send("PATCH",t,{data:n,options:o})}delete(t="",n,o){return this.send("DELETE",t,{data:n,options:o})}}const Xne=({domainApi:e,wsCode:t,entityId:n})=>({list_cursor:{url:`${e}/v1/workspace/${t}/item/2`,method:"post",code:"list_cursor"},assignedUser:{url:`${e}/v1/workspace/${t}/item/2/assigned-users`,method:"post",code:"assignedUser"},metricValues:{url:`${e}/v1/workspace/${t}/item/2/metrics`,method:"post",code:"metricValues"},multipleAssignableUser:{url:`${e}/v1/workspace/${t}/item/2/assignable-users`,method:"post",code:"multipleAssignableUser"},assignableUser:{url:`${e}/v1/workspace/${t}/item/2/assignable-users`,method:"post",code:"assignableUser"},assignableStatus:{url:`${e}/v1/workspace/${t}/item/2/assignable-statuses`,method:"post",code:"assignableStatus"},delete_rendition:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-rendition`,method:"delete",code:"delete_rendition"},delete_thumbnail:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-thumbnail`,method:"delete",code:"delete_thumbnail"},archive_item:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"archive_item"},unarchive_item:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"unarchive_item"},removeAssignee:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-assignee`,method:"delete",code:"removeAssignee"},basicInfor:{url:`${e}/v1/workspace/${t}/tile/people/ws-user-roles/{userId}/basic-info`,method:"get",code:"basicInfor"},bulkDelete:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete`,method:"delete",code:"bulkDelete"},bulkArchive:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"bulkArchive"},bulkDateUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-date-update`,method:"put",code:"bulkDateUpdate"},bulkAssignUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-assignee-update`,method:"put",code:"bulkAssignUpdate"},bulkStatusUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-status-update`,method:"put",code:"bulkStatusUpdate"},bulkMetricUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-metric-update`,method:"put",code:"bulkMetricUpdate"},getPermission:{url:`${e}/v1/workspace/${t}/item/2/permissions`,method:"post",code:"getPermission"},getUserPermission:{url:`${e}/v1/workspace/${t}/permissions`,method:"get",code:"getUserPermission"},bulkUnarchive:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"bulkUnarchive"},downloadTemplate:{url:`${e}/v1/workspace/${t}/item/2/download-sample`,method:"get",code:"downloadTemplate"},importItems:{url:`${e}/v1/workspace/${t}/item/2/import-from-file`,method:"post",code:"importItems"},exportItems:{url:`${e}/v1/workspace/${t}/item/2/export`,method:"get",code:"exportItems"},updateFromFile:{url:`${e}/v1/workspace/${t}/item/2/update-from-file`,method:"post",code:"updateFromFile"},metricList:{url:`${e}/v1/workspace/${t}/entity/2/metrics`,method:"get",code:"metricList"},getEntityDetail:{url:`${e}/workspace/${t}/entities/${n}?include_permission=1`,method:"get",code:"getEntityDetail"},item:{url:`${e}/v1/workspace/${t}/item/2/update`,method:"put",code:"item"},me:{url:`${e}/v1/me`,method:"get",code:"me"},workspaces:{url:`${e}/v1/workspaces`,method:"get",code:"workspaces"},entityUserRoles:{url:`${e}/v1/workspace/${t}/entity/2/users`,method:"get",code:"entityUserRoles"},templateFlowStatuses:{url:`${e}/workspace/${t}/entities/${n}/template_flow_statuses`,method:"get",code:"templateFlowStatuses"},createNewItem:{url:`${e}/v1/workspace/${t}/item/2/new?entity_id=${n}`,method:"post",code:"createNewItem"},getAssignableStatuses:{url:`${e}/v1/workspace/${t}/entity/2/assignable-statuses`,method:"get",code:"getAssignableStatuses"},getAssignableAssignees:{url:`${e}/v1/workspace/${t}/entity/2/users`,method:"get",code:"getAssignableAssignees"},getFilterStatuses:{url:`${e}/v1/workspace/${t}/entity/2/statuses`,method:"get",code:"getFilterStatuses"},bulkRename:{url:`${e}/v1/workspace/${t}/item/2/bulk-rename`,method:"put",code:"bulkRename"}}),Zne=(e,t)=>{const n=new Blob([e]),o=globalThis.URL.createObjectURL(n),s=document.createElement("a");s.href=o,s.download=t,document.body.appendChild(s),s.click(),s.remove(),globalThis.URL.revokeObjectURL(o)};class JM extends Yne{constructor(t,n,o){const s=n==null?void 0:n.domainApi,r=n==null?void 0:n.wsCode,i=(n==null?void 0:n.entityId)||"";super(o,{concurrency:{rules:[{pattern:/^\/api\/v1\/workspace\/[^/]+\/item\/2$/,limit:1},{pattern:/^\/api\/v1\/workspace\/[^/]+\/item\/2\/metrics$/,limit:5}]}}),this.events=Object.create(null);const a=Xne({domainApi:s,wsCode:r,entityId:i}),l={};Object.entries(a).forEach(([c,u])=>{const d=c;t[d]?l[d]=t[d]:(console.warn(`API config for ${d} is missing, using base config.`),l[d]=u)}),this.apiConfig=l}on(t,n){var o;((o=this.events)[t]??(o[t]=[])).push(n)}off(t,n){const o=this.events[t];o&&(this.events[t]=o.filter(s=>s!==n))}emit(t,...n){const o=this.events[t];o!=null&&o.length&&o.forEach(s=>{try{s(...n)}catch(r){console.error(`Error in event listener for ${t}:`,r)}})}buildHeaders(t){return typeof FormData<"u"&&t instanceof FormData?{"Content-Type":"multipart/form-data"}:{}}async _requestHandler({method:t,path:n,params:o,payload:s,code:r,responseType:i,autoDownload:a=!0}){var u,d;const l=this.buildHeaders(s);let c;try{if(c=await this.axios.request({method:t,url:n,params:o,data:s,headers:l,responseType:i}),(((u=c.headers)==null?void 0:u["content-type"])||"").includes("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")){const f=((d=c.headers)==null?void 0:d["content-disposition"])||"",p=f.includes("filename=")?f.split("filename=")[1]:"exported_items.xlsx";a&&Zne(c.data,p)}if(c.status>=400&&c.status<=500)throw new Error(`Client error (${c.status}): ${c.statusText}`);return this.emit("call-api",{apiCode:r,path:n,params:o,payload:s,res:c,success:!0}),c.data}catch(h){throw console.error("API Request Error:",h),h.code==="ERR_NETWORK"||!navigator.onLine?this.emit("call-api",{path:n,params:o,payload:s,error:new Error("You are currently offline. Please check your network connection."),success:!1,apiCode:"offline"}):this.emit("call-api",{path:n,params:o,payload:s,error:h,success:!1,apiCode:r,res:h==null?void 0:h.response}),h}}generateUrl(t,n){let o=t;return Object.entries(n).forEach(([s,r])=>{o=o.replace(`{${s}}`,String(r))}),o}async request(t,n,o={}){const{url:s,code:r,method:i}=this.apiConfig[t],a=this.generateUrl(s,n);return this._requestHandler({method:i,path:a,params:o.params,payload:o.payload,code:r,responseType:o.responseType,autoDownload:o.autoDownload})}async getAllItem_cursor(t){var r;const n=t.workspaceId,o={entity_ids:((r=t.entityIds)==null?void 0:r.join(","))||"",cursor:t.cursor||void 0,per_page:t.pageSize||t.perPage||20,offset:t.offset||void 0,search:t.search||t.q||void 0,include_signature:1,include:"last_updated_by,property,last_completed_by",include_permission:"{include_permission}",assignee_any_ina:(t==null?void 0:t.assignee_any_ina)||"",assignee_all_ina:(t==null?void 0:t.assignee_all_ina)||void 0,with_not_assigned:t.with_not_assigned||void 0,status_ina:t.status_ina||void 0,status_eq:t.status_eq||void 0,start_date_gte:t.start_date_gte||void 0,start_date_lte:t.start_date_lte||void 0,start_date_btw:t.start_date_btw||void 0,due_date_gte:t.due_date_gte||void 0,due_date_lte:t.due_date_lte||void 0,due_date_btw:t.due_date_btw||void 0,condition_combine_type:t.condition_combine_type||"or",preflight_status:t.preflight_status||void 0},s=t.sortBy;return this.request("list_cursor",{workspaceId:n},{params:o,payload:{sort_by:s}})}async getAssignedUser(t){const n={item_ids:t.item_ids||[],metric_ids:t.metric_ids||[]},o={per_page:t.per_page};return this.request("assignedUser",{workspaceId:t.workspaceId},{params:o,payload:n})}async getMetricList({workspaceId:t,entityId:n,page:o,query:s,per_page:r}){return this.request("metricList",{workspaceId:t,entityId:n},{params:{status_ed:1,include:"metric_type",entity_id:n,include_permission:1,per_page:r||100,page:o||1,name_like:s||void 0,permission:"1,2"}})}async getMetricValues({workspaceId:t,item_ids:n,per_page:o,metric_ids:s}){const r={item_ids:n,metric_ids:s};return this.request("metricValues",{workspaceId:t},{params:{per_page:o,include_permission:1},payload:r})}async multipleAssignableUser(t){const n=t.workspaceId,o=t.itemIds,s={page:t.page||1,per_page:t.perPage,display_name_like:t.q||"",item_ids:o||[]};return o.length||(delete s.item_ids,s.entity_id=t.entityId),this.request("multipleAssignableUser",{workspaceId:n},{payload:s})}async getAssignableStatus(t){var s;const n=t.workspaceId,o={item_ids:t.itemIds||[],page:t.page||1,per_page:t.perPage||10,name_like:t.name_like||""};return((s=t.itemIds)==null?void 0:s.length)==0&&(o.entity_id=t.entityId,delete o.item_ids),this.request("assignableStatus",{workspaceId:n||""},{payload:o})}async updateSceneName({workspaceId:t,entityId:n,itemId:o,name:s}){const r={item_id:o,entity_id:n,name:s,include:"item_user_roles"};return this.request("item",{workspaceId:t,itemId:o},{payload:r})}async deleteScene(t,n,o){const s={item_ids:[o]};return this.request("bulkDelete",{workspaceId:t,entityId:n},{payload:s})}async deleteThumbnail({workspaceId:t,itemIds:n,entityId:o,filterParams:s}){const r={item_ids:n,entity_id:o};return!n||n.length===0?r.item_ids=void 0:r.entity_id=void 0,this.request("delete_thumbnail",{workspaceId:t},{payload:r,params:s})}async deleteRendition({workspaceId:t,itemIds:n,deleteAll:o=!1,entityId:s,filterParams:r}){const i={item_ids:n,delete_all:o?1:void 0,entity_id:s};return!n||n.length===0?i.item_ids=void 0:i.entity_id=void 0,this.request("delete_rendition",{workspaceId:t},{payload:i,params:r})}async archiveScene(t,n,o){const s={item_ids:o,status:0};return this.request("archive_item",{workspaceId:t,entityId:n},{payload:s})}async changeDate({workspaceId:t,itemIds:n,startDate:o,dueDate:s,entityId:r,filterParams:i}){const a={item_ids:n,start_date:o,due_date:s,entity_id:r};return this.request("bulkDateUpdate",{workspaceId:t},{payload:a,params:i})}async updateAssignee(t){const{workspaceId:n,itemIds:o,userIds:s,entityId:r}=t,i={item_ids:o,ws_user_role_ids:s,entity_id:r};return this.request("bulkAssignUpdate",{workspaceId:n},{payload:i,params:t.filterParams})}createUpdateEntityPayload(t){const{itemIds:n,userIds:o,entityId:s}=t,r={item_ids:n,ws_user_role_ids:o,entity_id:s};return!n||n.length===0?(r.item_ids=void 0,r.entity_id=s):(r.item_ids=n,r.entity_id=void 0),r}async removeAssignee(t){const n=this.createUpdateEntityPayload(t);return this.request("removeAssignee",{workspaceId:t.workspaceId},{payload:n,params:t.filterParams})}async replaceAssignee(t){const{workspaceId:n,itemIds:o,userIds:s,entityId:r}=t,i={item_ids:o,ws_user_role_ids:s,entity_id:r};return this.request("bulkAssignUpdate",{workspaceId:n},{params:{replace:1,...t.filterParams},payload:i})}async addAssignee({workspaceId:t,itemIds:n,userIds:o,entityId:s,filterParams:r}){const i={item_ids:n,ws_user_role_ids:o,entity_id:s};return this.request("bulkAssignUpdate",{workspaceId:t},{payload:i,params:r})}async unAssignAll(t){const{workspaceId:n,entityId:o,itemIds:s,filterParams:r}=t,i={item_ids:s,entity_id:o,ws_user_role_ids:[]};return!s||s.length===0?i.item_ids=void 0:i.entity_id=void 0,this.request("removeAssignee",{workspaceId:n,entityId:String(o)},{payload:i,params:r})}async updateItemStatus(t){const{workspaceId:n,itemIds:o=[],statusId:s,entityId:r}=t,i={item_ids:o,template_flow_status_id:s};return o.length||(i.item_ids=void 0,i.entity_id=r),this.request("bulkStatusUpdate",{workspaceId:n},{payload:i,params:t.filterParams})}async getUserInformation(t,n){return this.request("basicInfor",{workspaceId:t,userId:n})}async bulkDeleteItems({workspaceId:t,itemIds:n,entityId:o,filterParams:s}){const r={item_ids:n,entity_id:o};return!n||n.length===0?r.item_ids=void 0:r.entity_id=void 0,this.request("bulkDelete",{workspaceId:t},{payload:r,params:s})}async bulkUnarchiveItems({workspaceId:t,itemIds:n,entityId:o,filterParams:s}){const r={item_ids:n,status:1,entity_id:o};return!n||n.length===0?r.item_ids=void 0:r.entity_id=void 0,this.request("bulkUnarchive",{workspaceId:t},{payload:r,params:s})}async bulkArchiveItems({workspaceId:t,itemIds:n,entityId:o,filterParams:s}){const r={item_ids:n,status:0,entity_id:o};return!n||n.length===0?r.item_ids=void 0:r.entity_id=void 0,this.request("bulkArchive",{workspaceId:t},{payload:r,params:s})}async bulkUpdateMetric(t){const{workspaceId:n,itemIds:o,metricId:s,value:r,clear:i}=t,a={item_ids:o,metric_id:s,metric_value:r,clear:i??(r==null?1:0),entity_id:t.entityId};return t.itemIds===void 0?(delete a.item_ids,a.entity_id=String(t.entityId)):(a.item_ids=o,a.entity_id=void 0),this.request("bulkMetricUpdate",{workspaceId:n},{payload:a,params:t.filterParams})}async getPermissionForItems({workspaceId:t,itemIds:n}){const o={item_ids:n};return this.request("getPermission",{workspaceId:t},{payload:o,params:{per_page:50}})}async unarchiveScene(t,n,o){const s={item_ids:o,status:1};return this.request("unarchive_item",{workspaceId:t,entityId:n},{payload:s})}async getUserPermission(t){return this.request("getUserPermission",{workspaceId:t})}async getEntityDetail(t,n){return this.request("getEntityDetail",{workspaceId:t,entityId:n})}async downloadTemplate(t,n,o=!0){return this.request("downloadTemplate",{workspaceId:t,entityId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n},autoDownload:o})}async downloadExportedItemsFile(t,n,o=!0){return this.request("exportItems",{workspaceId:t,exportId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n},autoDownload:o})}async addNewSceneViaImportFile(t,n,o){return this.request("importItems",{workspaceId:t,entityId:n},{payload:o})}async overwriteScenesViaImportFile(t,n,o){return this.request("updateFromFile",{workspaceId:t,entityId:n},{payload:o})}async getMe(){return this.request("me",{})}async getWorkspaces(t){const n={page:1,per_page:1,"ws_user_role>status_eq":1,include:"owner",include_ws:t};return this.request("workspaces",{},{params:n})}async getEntityUserRoles(t){const{workspaceId:n,page:o,per_page:s,display_name_like:r,entity_ids:i}=t;return this.request("entityUserRoles",{workspaceId:n},{params:{page:o,per_page:s,display_name_like:r,entity_ids:i}})}async getTemplateFlowStatuses(t){const{workspaceId:n,entityId:o}=t;return this.request("templateFlowStatuses",{workspaceId:n,entityId:o},{params:{per_page:100,page:t.page??1,all:1,name_like:t.name_like}})}async addNewItem(t,n,o){return this.request("createNewItem",{workspaceId:t,entityId:n},{payload:o})}async getFilterStatuses(t,n,o){return this.request("getFilterStatuses",{workspaceId:t,entityId:n},{params:o})}async getAssignableStatuses(t,n){return this.request("getAssignableStatuses",{workspaceId:t},{params:n})}async getAssignableAssignees(t,n){return this.request("getAssignableAssignees",{workspaceId:t},{params:n})}async bulkRename(t){return this.request("bulkRename",{workspaceId:t.workspaceId,entityId:t.entityId},{payload:t.payload,params:t.filter})}}const Jne=(e,t,n,o,s,r,i)=>{const{apiServices:a}=io(n,o),l=H(!1),c=()=>{l.value=!0},u=()=>{ft(()=>{setTimeout(()=>{l.value=!1},500)})},d=Y(()=>!!(s!=null&&s.value&&(r!=null&&r.value))),h=In("filterParams",null);return{isUpdating:l,handleUpdate:async p=>{var v;const g=p.value;c();try{const C={itemIds:e.value.itemIds,metricId:p.id,workspaceId:String(e.value.workspaceId),filterParams:h!=null&&h.value?h.value:void 0};p.value==null?C.clear=1:C.value=g,d.value?(delete C.itemIds,C.entityId=String(o.entityId)):C.itemIds=e.value.itemIds;const S=await((v=a.value)==null?void 0:v.bulkUpdateMetric(C));(S==null?void 0:S.message)=="Done"&&t(p)}catch(C){console.error("Error during bulk metric update:",C)}u()}}},Qne=bt(tt({__name:"MetricUpdateButton",props:{workspaceId:{},entityId:{},variant:{},rowSelected:{},selectedIds:{},disabled:{type:Boolean},selectedAll:{type:Boolean}},emits:["update","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=_O(),o=H([]),s=e,r=t,i=H([]),a=H(null),l=j=>{var q,V,k;const Q=o.value.findIndex(G=>G.id===j.id);a.value=Q;const re=(q=i.value[Q])==null?void 0:q.$el;(V=_.value)==null||V.scrollTo(Q*30),re&&re.scrollIntoView({behavior:"smooth",block:"center"}),c(Q),(k=i.value[Q])==null||k.show()},c=j=>{a.value=j,i.value.forEach((Q,re)=>{re!==j&&Q&&Q.hide()})},u=H(""),d=()=>{u.value="",i.value.forEach(j=>{j==null||j.hide()}),a.value=null},h=Y(()=>s.selectedIds||[]),f=Y(()=>({itemIds:h.value,workspaceId:String(s.workspaceId)})),p=In("isSelectAll",H(!1)),g=In("bulkUpdate",H(!1)),v=H(null),{handleUpdate:C,isUpdating:S}=Jne(f,j=>{var Q;r("update",j),d(),(Q=v.value)==null||Q.hide()},!1,s,g,p),b=async j=>{var Q;r("update-start");try{await C(j),r("update-completed")}catch{r("update-failed"),(Q=v.value)==null||Q.open()}},y=j=>{d(),ft(()=>{var Q;(Q=_.value)==null||Q.focus()})},_=H(null),E=(j,Q)=>{var re;j?(re=_.value)==null||re.focus():d(),j&&Q!==j&&z("")},D=H(!0),T=H(!0),{apiServices:P}=io(!1,s),L=async(j,Q,re)=>{var q;try{return re?T.value=!0:D.value=!0,await((q=P.value)==null?void 0:q.getMetricList({workspaceId:s.workspaceId||"",entityId:s.entityId||"",page:j,query:Q,per_page:10}))}catch(V){throw console.error("Failed to fetch metric list:",V),V}finally{D.value=!1,T.value=!1}},I=H(0),x=H(!0),O=j=>({id:String(j.id),label:String(j.name),value:String(j.id),description:j.morpheme_value?`${String(j.morpheme_value)}`:"",type:n.checkEditType(j),metricConfig:j}),N=j=>j.filter(Q=>!Q.formula).filter(Q=>{var re;return((re=Q==null?void 0:Q.auth_permission)==null?void 0:re.permission)==2}).map(O),F=async()=>{I.value+=1;const j=await L(I.value,u.value,!0);if(j&&j.data){const Q=N(j.data);o.value=[...o.value,...Q],x.value=j.meta.last_page!=j.meta.current_page}else x.value=!1},z=async j=>{u.value=j,I.value=1;try{const Q=await L(I.value,u.value);Q&&Q.data?(o.value=N(Q.data),x.value=Q.meta.last_page!=Q.meta.current_page):o.value=[]}catch{o.value=[]}};return(j,Q)=>(K(),ze(Hf,{ref_key:"wrapperRef",ref:v,isUpdating:W(S),disabled:s.disabled||W(S),onOnVisibleChange:E},{trigger:be(({hide:re,disabled:q})=>[ye(pt,{variant:s.variant,loading:W(S),disabled:q,onEscape:re},{default:be(()=>[ye(ct,{src:"SquareRootVariable",class:"icon"}),Q[1]||(Q[1]=nt(" Metric ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:be(({isVisible:re,popupRef:q,hide:V})=>[qe(ye(ha,{ref_key:"searchListRef",ref:_,style:{width:"320px"},options:o.value,loading:D.value,"loading-more":T.value,"selected-id":void 0,"has-more":x.value,onSearch:z,onSelect:l,onLoadMore:Q[0]||(Q[0]=()=>F()),onCancel:V},{item:be(({item:k,index:G,selectedIndex:ee})=>[ye(lQ,{ref:ge=>i.value[G]=ge,label:k.label,type:k.type,morpheme:k.description||"",onFocusOnSearch:y,onOpen:ge=>c(G),attachTo:q,config:k.metricConfig,onHandleUpdate:b,class:se(["metric-update-item",{selected:a.value===G||ee===G}])},null,8,["label","type","morpheme","onOpen","attachTo","config","class"])]),"extra-item":be(()=>[...Q[2]||(Q[2]=[Te("div",{style:{width:"250px"}},null,-1)])]),"empty-list":be(()=>[...Q[3]||(Q[3]=[nt("No options available.",-1)])]),_:2},1032,["options","loading","loading-more","has-more","onCancel"]),[[lr,re]])]),default:be(()=>[Q[4]||(Q[4]=nt(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),[["__scopeId","data-v-a645d131"]]),qv=Sc("bulkUpdate",()=>{const e=H(At.UNCHECK),t=Go({loaded:0,total:0}),n=u=>{t.total=u},o=u=>{t.loaded=u},s=Go({isBulkUpdating:!1});function r(u){s.isBulkUpdating=u}const i=H({}),a=u=>{i.value=u},l=(u,d)=>{i.value[u]=d},c=u=>{e.value=u};return{bulkUpdateState:s,setIsBulkUpdating:r,selectionIds:i,setSelectionIds:a,setCheckedForId:l,setSelectionStatus:c,selectionStatus:e,rowCount:t,setTotalRowCount:n,setLoadedRowCount:o,handelSelectAll:()=>{c(At.CHECKED)}}}),eoe={class:"status-label"},QM=bt(tt({__name:"StatusItem",props:{status:{},selected:{type:Boolean},focused:{type:Boolean},hovered:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=Kt,o=e,s=t,r=a=>{s("select",a)},i=a=>new On(a).isLight()?"#f3f5f8":"#d7d7d7";return(a,l)=>(K(),ce("div",{class:se(["status-option",{selected:o.selected,focused:o.focused,hovered:o.hovered}]),onClick:l[0]||(l[0]=c=>r(e.status.id))},[Te("div",{class:"status-color",style:hn({backgroundColor:e.status.color,borderColor:i(e.status.color)})},null,4),qe((K(),ce("div",eoe,[xt(a.$slots,"label",{},()=>[nt(it(e.status.name),1)],!0)])),[[W(n),{content:e.status.name,delay:[1e3,0]}]])],2))}}),[["__scopeId","data-v-aeaa75a4"]]),toe=["innerHTML"],eN=bt(tt({__name:"StatusEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},ids:{},callback:{type:Function}},emits:["updated","error","cancel","start-update","finish-update"],setup(e,{expose:t,emit:n}){const o={PER_PAGE:50,INITIAL_PAGE:1},s=e,r=n,i=H([]),a=H(!1),l=H(!1),c=H(null),u=H(o.INITIAL_PAGE),d=H(!0),h=H(0),f=H(""),p=Y(()=>{var O;return(O=s.value)==null?void 0:O.id});Y(()=>!!(s.id||s.ids&&s.ids.length>0));const g=O=>({label:O.name,value:O.id,selected:p.value===O.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:O,id:O.id,color:O.color}),v=Y(()=>{const O=new Set;return s.id&&O.add(String(s.id)),s.ids&&s.ids.forEach(N=>{N&&O.add(String(N))}),Array.from(O)}),C=In("bulkUpdate",!1),{apiServices:S}=io(!C,s),b=qv(),{selectionStatus:y}=us(b),_=In("filterParams",null),E=async(O=o.INITIAL_PAGE,N="",F=!1)=>{var z,j,Q,re;F?l.value=!0:a.value=!0,c.value=null;try{const q={workspaceId:String(s.workspaceId),itemIds:v.value,page:O,perPage:o.PER_PAGE,name_like:N.trim(),..._||{},entityId:String(s.entityId)};if(((z=S.value)==null?void 0:z.getAssignableStatus)===void 0)throw new Error("API service getAssignableStatus is undefined");const V=await((j=S.value)==null?void 0:j.getAssignableStatus(q));if(!(V!=null&&V.data)){F||(i.value=[]),d.value=!1;return}const k=V.data.map(g);i.value=F?[...i.value,...k]:k,h.value=((Q=V.meta)==null?void 0:Q.total)??V.data.length,d.value=!((re=V.meta)!=null&&re.on_last_page),u.value=O}catch(q){console.error("Error fetching statuses:",q),c.value="Failed to load statuses",F||(i.value=[]),d.value=!1,r("error",c.value)}finally{a.value=!1,l.value=!1}},D=mr(async O=>{f.value=O,u.value=o.INITIAL_PAGE,await E(o.INITIAL_PAGE,O,!1)},Ci),T=async()=>{!d.value||l.value||await E(u.value+1,f.value,!0)},P=()=>{var O;r("cancel"),(O=s.params)==null||O.api.stopEditing()},L=async O=>{var N,F,z;try{const j={workspaceId:String(s.workspaceId),itemIds:v.value,statusId:String(O.value),entityId:String(s.entityId),filterParams:_!=null&&_.value?_==null?void 0:_.value:void 0};if(y.value==At.CHECKED&&C&&(j.itemIds=void 0,j.entityId=String(s.entityId)),r("start-update"),!await S.value.updateItemStatus(j))throw new Error("Status update failed: empty response");r("updated",{workspaceId:String(s.workspaceId),itemIds:v.value,isUpdateAll:y.value==At.CHECKED&&C,data:{id:O.id,name:O.label,color:O.color}}),s.params&&((F=s.params)==null||F.node.setData({...(N=s.params)==null?void 0:N.node.data,status:{id:O.id,name:O.label,color:O.color}}),(z=s.params)==null||z.api.stopEditing()),r("finish-update")}catch(j){console.error("Error updating status:",j),c.value="Failed to update status",r("error",c.value)}},I=Y(()=>i.value.map(O=>({...O})));Qe([()=>s.id,()=>s.workspaceId,()=>s.ids],()=>{E()},{deep:!0,immediate:!0});const x=H(null);return en(()=>{ft(()=>{var O;(O=x.value)==null||O.focus()})}),t({refresh:()=>E(o.INITIAL_PAGE,f.value,!1),loadMore:T,focus:()=>{var O;return(O=x.value)==null?void 0:O.focus()}}),(O,N)=>{var F;return K(),ze(ha,jt({ref_key:"popupRef",ref:x},s,{"selected-id":(F=s.value)==null?void 0:F.id,options:I.value,loading:a.value,"loading-more":l.value,"has-more":d.value,error:c.value,onSearch:W(D),onSelect:L,onLoadMore:T,onCancel:P,onClose:P}),{item:be(({item:z,selectedIndex:j,isSelected:Q,handleItemHover:re,getHighlightedLabel:q,query:V,idx:k})=>[(K(),ze(QM,{key:z.value,status:z.data,selected:Q(z),onMouseover:G=>re(k),onSelect:G=>L(z),hovered:k===j},{label:be(()=>[V?(K(),ce("span",{key:0,class:se([O.$style["item-label"],O.$style.match]),style:{flex:"1"},innerHTML:q(z.label)},null,10,toe)):(K(),ce("span",{key:1,class:se(O.$style["item-label"]),style:{flex:"1"}},it(z.label),3))]),_:2},1032,["status","selected","onMouseover","onSelect","hovered"]))]),_:1},16,["selected-id","options","loading","loading-more","has-more","error","onSearch"])}}}),[["__cssModules",{$style:{"item-label":"_item-label_7ir12_1"}}]]),noe=tt({__name:"StatusUpdateButton",props:{ids:{},workspaceId:{},entityId:{},variant:{},disabled:{type:Boolean},selectedAll:{type:Boolean}},emits:["updated","update-start","update-completed","update-failed"],setup(e,{emit:t}){const n=e,o=Y(()=>{const f=ro();return f==null?void 0:f.appContext.config.globalProperties.apiServices}),s=t,r=H(!1),i=H(null),a=f=>{try{r.value=!1,s("updated",f)}catch(p){console.error("Error handling status update:",p)}finally{s("update-completed")}},l=Y(()=>({apiServices:o.value,ids:n.ids,workspaceId:n.workspaceId,entityId:n.entityId,selectedAll:n.selectedAll}));ui("bulkUpdate",!0);const c=f=>{var p,g;console.trace("handleUpdateCompleted called with success:",f),r.value=!1,f?(s("update-completed"),(p=i.value)==null||p.destroy()):(s("update-failed"),(g=i.value)==null||g.open())},u=H(null),d=(f,p)=>{var g;f&&((g=u.value)==null||g.focus())},h=()=>{r.value=!0,s("update-start")};return Qe(()=>n.ids,()=>{}),(f,p)=>(K(),ze(Hf,{ref_key:"wrapperRef",ref:i,isUpdating:r.value,disabled:n.disabled||r.value,onOnVisibleChange:d},{trigger:be(({hide:g,disabled:v})=>[ye(pt,{variant:n.variant,loading:r.value,disabled:v,onEscape:g},{default:be(()=>[ye(ct,{src:"Square",class:"icon"}),p[2]||(p[2]=nt(" Status ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:be(({hide:g})=>[ye(eN,jt({disabled:r.value,ref_key:"statusRef",ref:u},l.value,{onUpdated:a,onCancel:g,onStartUpdate:h,onFinishUpdate:p[0]||(p[0]=v=>c(!0)),onError:p[1]||(p[1]=v=>c(!1)),callback:()=>{}}),null,16,["disabled","onCancel"])]),default:be(()=>[p[3]||(p[3]=nt(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),jr=" ",z0=e=>e.replace(/[\r\n]+/g," "),Yv=e=>e instanceof HTMLElement&&e.classList.contains("locked-tag"),Ws=e=>(e==null?void 0:e.nodeType)===Node.TEXT_NODE,j0=e=>{var t;return((t=e instanceof Element?e:e.parentElement)==null?void 0:t.closest(".locked-tag"))??null},ga=e=>{let t=0,n=e.length;return Yv(e.previousSibling)&&e.data.startsWith(jr)&&(t=1),Yv(e.nextSibling)&&n>t&&e.data.endsWith(jr)&&(n-=1),{start:t,end:n}},ooe=e=>{if(!Ws(e))return!1;const{start:t,end:n}=ga(e);return n<=t},tN=e=>{const t=j0(e.startContainer),n=j0(e.endContainer);return t&&e.setStartAfter(t),n&&e.setEndAfter(n),e},soe=(e,t)=>e.length===t.length&&e.every((n,o)=>{const s=t[o];return typeof n=="string"||typeof s=="string"?n===s:n.id===s.id&&n.text===s.text&&n.direction===s.direction});class roe{constructor(t){Tn(this,"editor",null);Tn(this,"handleInput",()=>{this.editor&&(this.sanitize(),this.ensureTagPadding(),this.normalizeCaret(),this.options.onChange(this.parse()))});Tn(this,"handlePaste",t=>{var n;t.preventDefault(),this.insertPlainText(((n=t.clipboardData)==null?void 0:n.getData("text/plain"))??"")});Tn(this,"handleDrop",t=>{var o,s;t.preventDefault();const n=((o=t.dataTransfer)==null?void 0:o.getData("text/plain"))??"";n&&this.insertPlainText(n,(s=document.caretRangeFromPoint)==null?void 0:s.call(document,t.clientX,t.clientY))});Tn(this,"handleBeforeInput",t=>{const n=t.inputType;(n.startsWith("format")||n==="insertParagraph"||n==="insertLineBreak"||n==="insertFromDrop"||n==="insertFromYank")&&t.preventDefault()});Tn(this,"handleClick",t=>{const n=this.editor,o=window.getSelection();if(!n||!(o!=null&&o.isCollapsed)||t.target!==n)return;const s=document.createRange();if(s.selectNodeContents(n),t.clientX<=s.getBoundingClientRect().right)return;const[r,i]=this.getBoundaryPoint("end");o.collapse(r,i),n.scrollLeft=n.scrollWidth});Tn(this,"handleKeydown",t=>{var s;const n=this.editor;if(!n)return;if(t.key==="Enter"){t.preventDefault();return}const o=t.ctrlKey||t.metaKey;if(o&&!t.altKey&&t.key.toLowerCase()==="a"){t.preventDefault(),(s=window.getSelection())==null||s.selectAllChildren(n);return}if(t.key==="Home"||t.key==="End"){t.preventDefault(),this.moveToEdge(t.key==="Home"?"start":"end",t.shiftKey);return}if((t.key==="ArrowLeft"||t.key==="ArrowRight")&&!t.shiftKey&&!o&&!t.altKey){this.moveAcrossTag(t.key)&&t.preventDefault();return}if(t.key==="Backspace"||t.key==="Delete"){if(!o&&!t.altKey&&!t.shiftKey&&this.deleteCharacter(t.key)){t.preventDefault();return}const r=this.findAdjacentTag(t.key);r&&(t.preventDefault(),this.removeTag(r,t.key==="Backspace"?"after":"before"))}});Tn(this,"normalizeCaret",()=>{const t=this.editor,n=window.getSelection();if(!t||!(n!=null&&n.rangeCount)||!n.isCollapsed)return;const{startContainer:o,startOffset:s}=n.getRangeAt(0);if(!t.contains(o))return;const r=j0(o);if(!r&&o!==t)return;const i=r??t.childNodes[s-1]??null,a=r?r.nextSibling:t.childNodes[s]??null;if(this.ensureTagPadding(),Ws(i))n.collapse(i,ga(i).end);else if(Ws(a))n.collapse(a,ga(a).start);else if(Ws((i==null?void 0:i.nextSibling)??null)){const l=i.nextSibling;n.collapse(l,ga(l).start)}else if(Ws((a==null?void 0:a.previousSibling)??null)){const l=a.previousSibling;n.collapse(l,ga(l).end)}});this.options=t}mount(t,n=[]){this.editor=t,this.render(n),document.addEventListener("selectionchange",this.normalizeCaret)}destroy(){document.removeEventListener("selectionchange",this.normalizeCaret),this.editor=null}sync(t){this.editor&&(soe(t,this.parse())||this.render(t))}render(t){const n=this.editor;n&&(n.innerHTML="",t.forEach(o=>{typeof o=="string"?n.appendChild(document.createTextNode(z0(o))):this.options.isTagAllowed(o.id)&&n.appendChild(this.createTagNode(o))}),this.ensureTagPadding())}parse(){var o;const t=[];let n="";return(o=this.editor)==null||o.childNodes.forEach(s=>{Ws(s)?n+=s.data.replace(/\u00A0/g," "):this.isAllowedTagNode(s)&&(n&&(t.push(n),n=""),t.push({id:s.dataset.id||"unknown",text:s.innerText||"Tag",direction:s.dataset.direction??void 0}))}),n&&t.push(n),t}insertTag(t){const n=this.editor;if(!n||!this.options.isTagAllowed(t.id))return;const o=n.querySelector(`.locked-tag[data-id="${t.id}"]`);if(o instanceof HTMLElement){this.applyTagData(o,t),this.handleInput();return}const s=this.createTagNode(t),r=document.createTextNode(jr),i=this.getEditorRange();i?(i.deleteContents(),i.insertNode(r),i.insertNode(s)):n.append(s,r),n.normalize(),this.handleInput(),this.placeCaretAfterTag(r)}updateTag(t,n){var s;const o=(s=this.editor)==null?void 0:s.querySelector(`.locked-tag[data-id="${t}"]`);o instanceof HTMLElement&&(o.innerText=n,this.handleInput())}replaceTag(t,n){if(!this.editor||!this.options.isTagAllowed(n.id))return;const o=this.createTagNode({id:n.id,text:n.label,direction:n.direction}),s=this.editor.querySelector(`.locked-tag[data-id="${t.id}"]`);s instanceof HTMLElement&&(s.replaceWith(o),this.handleInput())}deleteTag(t){const n=this.editor;if(!n)return;const o=n.querySelector(`.locked-tag[data-id="${t}"]`);o instanceof HTMLElement&&this.removeTag(o,"after");const s=this.parse(),r=s[0];s.length===1&&typeof r=="string"&&r.trim()===""&&(n.innerHTML="",this.options.onChange(this.parse()))}isAllowedTagNode(t){return Yv(t)&&this.options.isTagAllowed(t.getAttribute("data-id")??"")}applyTagData(t,{text:n,direction:o}){t.innerText=n,o?t.dataset.direction=o:delete t.dataset.direction}createTagNode({id:t,text:n,direction:o}){const s=document.createElement("span");return s.contentEditable="false",s.className="locked-tag",s.dataset.id=t,this.applyTagData(s,{text:n,direction:o}),s}getEditorRange(){const t=window.getSelection();if(!this.editor||!(t!=null&&t.rangeCount))return null;const n=t.getRangeAt(0).cloneRange();return this.editor.contains(n.commonAncestorContainer)?tN(n):null}insertPlainText(t,n){const o=this.editor;if(!o)return;const s=window.getSelection();let r=n?tN(n):this.getEditorRange();(!r||!o.contains(r.commonAncestorContainer))&&(r=document.createRange(),r.selectNodeContents(o),r.collapse(!1)),r.deleteContents();const i=document.createTextNode(z0(t));r.insertNode(i),r.setStartAfter(i),r.collapse(!0),s==null||s.removeAllRanges(),s==null||s.addRange(r),this.handleInput()}sanitize(){const t=this.editor;if(!t)return;t.querySelectorAll(".locked-tag .locked-tag").forEach(o=>o.remove());let n=!1;if(Array.from(t.childNodes).forEach(o=>{if(Ws(o)||this.isAllowedTagNode(o))return;n=!0;const s=Yv(o)?"":z0(o.textContent??"");o.replaceWith(document.createTextNode(s))}),n){const o=window.getSelection(),s=document.createRange();s.selectNodeContents(t),s.collapse(!1),o==null||o.removeAllRanges(),o==null||o.addRange(s)}}ensureTagPadding(){var t;(t=this.editor)==null||t.querySelectorAll(".locked-tag").forEach(n=>{const o=n.previousSibling,s=n.nextSibling;Ws(o)?o.data.endsWith(jr)||o.appendData(jr):n.before(document.createTextNode(jr)),Ws(s)?s.data.startsWith(jr)||s.insertData(0,jr):n.after(document.createTextNode(jr))})}async placeCaretAfterTag(t){var s;(s=this.editor)==null||s.focus(),await Promise.resolve();const n=document.createRange();n.setStart(t,ga(t).start),n.collapse(!0);const o=window.getSelection();o==null||o.removeAllRanges(),o==null||o.addRange(n)}findAdjacentTag(t){const n=this.editor,o=window.getSelection();if(!n||!o||!o.isCollapsed||!o.rangeCount)return null;const{startContainer:s,startOffset:r}=o.getRangeAt(0);if(!n.contains(s))return null;const i=t==="Backspace";let a;if(s===n)a=i?n.childNodes[r-1]??null:n.childNodes[r]??null;else if(Ws(s)&&s.parentNode===n){const{start:l,end:c}=ga(s);if(i?Math.min(r,c)>l:Math.max(r,l)<c)return null;a=i?s.previousSibling:s.nextSibling}else return null;for(;ooe(a);)a=i?a.previousSibling:a.nextSibling;return a&&this.isAllowedTagNode(a)?a:null}getBoundaryPoint(t){const n=this.editor,o=t==="start"?n.firstChild:n.lastChild;return Ws(o)?[o,t==="start"?0:o.length]:[n,t==="start"?0:n.childNodes.length]}moveToEdge(t,n){const o=this.editor,s=window.getSelection();if(!o||!s)return;const[r,i]=this.getBoundaryPoint(t),a=n&&s.anchorNode&&o.contains(s.anchorNode)?{node:s.anchorNode,offset:s.anchorOffset}:{node:r,offset:i};s.setBaseAndExtent(a.node,a.offset,r,i),o.scrollLeft=t==="start"?0:o.scrollWidth}moveAcrossTag(t){const n=t==="ArrowLeft",o=this.findAdjacentTag(n?"Backspace":"Delete"),s=window.getSelection();if(!o||!s)return!1;const r=n?o.previousSibling:o.nextSibling;if(!Ws(r))return!1;const i=ga(r);return s.collapse(r,n?i.end:i.start),!0}deleteCharacter(t){const n=window.getSelection();if(!this.editor||!(n!=null&&n.isCollapsed)||!n.rangeCount)return!1;const{startContainer:o,startOffset:s}=n.getRangeAt(0);if(!Ws(o)||o.parentNode!==this.editor)return!1;const{start:r,end:i}=ga(o);let a,l=1,c=s;if(t==="Backspace"){if(a=Math.min(s,i)-1,a<r)return!1;/[\uDC00-\uDFFF]/.test(o.data[a])&&a>r&&(a--,l=2),c=s-l}else{if(a=Math.max(s,r),a>=i)return!1;/[\uD800-\uDBFF]/.test(o.data[a])&&a+1<i&&(l=2)}return o.deleteData(a,l),n.collapse(o,c),this.handleInput(),!0}removeTag(t,n){var r;const o=t.previousSibling,s=t.nextSibling;t.remove(),o instanceof Text&&s instanceof Text&&o.data.endsWith(jr)&&s.data.startsWith(jr)&&(n==="after"?o.deleteData(o.length-1,1):s.deleteData(0,1)),(r=this.editor)==null||r.normalize(),this.handleInput()}focus(){var o;console.log("Focusing editor"),(o=this.editor)==null||o.focus();const t=document.createRange();t.selectNodeContents(this.editor),t.collapse(!1);const n=window.getSelection();n==null||n.removeAllRanges(),n==null||n.addRange(t)}}const ioe={class:"input-wrapper"},aoe=["data-placeholder"],loe=bt(tt({__name:"DynamicInput",props:{modelValue:{type:Array,default:()=>[]},placeholder:{type:String,default:"Rename to"},allowedTags:{type:Array,default:void 0}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=H(null),i=new roe({isTagAllowed:a=>!o.allowedTags||o.allowedTags.includes(a),onChange:a=>s("update:modelValue",a)});return en(()=>{r.value&&i.mount(r.value,o.modelValue)}),Jn(()=>i.destroy()),Qe(()=>o.modelValue,a=>i.sync(a),{deep:!0}),t({insertTag:a=>i.insertTag(a),updateTag:(a,l)=>i.updateTag(a,l),replaceTag:(a,l)=>i.replaceTag(a,l),deleteTag:a=>i.deleteTag(a),focus:()=>{console.log("Focusing editor"),i.focus()}}),(a,l)=>(K(),ce("div",ioe,[Te("div",{ref_key:"editorRef",ref:r,class:"custom-input single-line",contenteditable:"true","data-placeholder":e.placeholder,onPaste:l[0]||(l[0]=(...c)=>W(i).handlePaste&&W(i).handlePaste(...c)),onDrop:l[1]||(l[1]=(...c)=>W(i).handleDrop&&W(i).handleDrop(...c)),onBeforeinput:l[2]||(l[2]=(...c)=>W(i).handleBeforeInput&&W(i).handleBeforeInput(...c)),onInput:l[3]||(l[3]=(...c)=>W(i).handleInput&&W(i).handleInput(...c)),onKeydown:l[4]||(l[4]=(...c)=>W(i).handleKeydown&&W(i).handleKeydown(...c)),onClick:l[5]||(l[5]=Nt((...c)=>W(i).handleClick&&W(i).handleClick(...c),["stop","prevent"]))},null,40,aoe)]))}}),[["__scopeId","data-v-e3be4ee2"]]),coe={key:0},uoe={key:1},nN=8,doe=bt(tt({__name:"PreviewName",props:{text:{}},setup(e){const t=Kt,n=e,o=H(null),s=H(null),r=H(n.text),i=H(!1),a=d=>{const h=s.value;return h.textContent=d,h.offsetWidth},l=(d,h)=>{const f=d.slice(-nN),p=d.length-nN-1;if(p<1||a(d)<=h)return d;let g=0,v=p;for(;g<v;){const C=Math.ceil((g+v)/2);a(`${d.slice(0,C)}…${f}`)<=h?g=C:v=C-1}return`${d.slice(0,g)}…${f}`},c=()=>{!o.value||!s.value||(r.value=l(n.text,o.value.clientWidth),i.value=r.value!==n.text)};let u;return en(()=>{c(),u=new ResizeObserver(c),u.observe(o.value)}),Jn(()=>u==null?void 0:u.disconnect()),Qe(()=>n.text,()=>ft(c)),(d,h)=>(K(),ce("div",{ref_key:"rootRef",ref:o,class:"preview-name"},[i.value?qe((K(),ce("span",coe,[nt(it(r.value),1)])),[[W(t),{content:e.text,delay:[1e3,0],bypassOverflowCheck:!0}]]):(K(),ce("span",uoe,it(e.text),1)),Te("span",{ref_key:"measureRef",ref:s,class:"measure","aria-hidden":"true"},null,512)],512))}}),[["__scopeId","data-v-f1310bab"]]),oN=10,sN=5,tp={number:{first:"000",step:"1"},letter:{first:"A",step:"1"}},hoe={up:{first:"Start at",step:"Increase by"},down:{first:"End at",step:"Decrease by"}},foe=/^[0-9]$/,poe=/^[A-Za-z]$/,rN=(e,t)=>t==="first"&&e==="letter"?poe:foe,goe=(e,t,n)=>rN(e,t).test(n),moe=e=>e==="first"?oN:sN,voe=e=>e&&e[0]===e[0].toLowerCase()?e.toLowerCase():e.toUpperCase(),yoe=(e,t,n)=>{const o=rN(e,t),s=Array.from(n).filter(r=>o.test(r)).join("").slice(0,moe(t));return t==="first"&&e==="letter"?voe(s):s},iN=(e,t)=>t!==""&&(e==="first"||Number(t)>0),woe=e=>Array.from(e.toUpperCase()).reduce((t,n)=>t*26+(n.charCodeAt(0)-64),0),Coe=e=>{let t="",n=e;for(;n>0;){const o=(n-1)%26;t=String.fromCharCode(65+o)+t,n=Math.floor((n-1)/26)}return t},aN=({type:e,direction:t,first:n,step:o,count:s})=>{const r=Number(o)||1,i=c=>(t==="up"?c:s-1-c)*r;if(e==="number"){const c=Number(n);return Array.from({length:s},(u,d)=>String(c+i(d)).padStart(n.length,"0"))}const a=woe(n),l=n!==""&&n[0]===n[0].toLowerCase();return Array.from({length:s},(c,u)=>{const d=Coe(a+i(u));return l?d.toLowerCase():d})},boe={class:"bulk-rename-popup",id:"bulk-rename-el"},Soe={class:"left-section"},Eoe={class:"modified-template-options"},_oe=["onClick"],Roe={class:"setting-count"},Toe={class:"field-label"},Doe={class:"field-label"},Ioe={class:"confirmation"},xoe={class:"preview-section"},Poe={class:"preview-list"},koe={key:0,class:"preview-more"},lN=8,cN=7,Foe=bt(tt({__name:"BulkRenamePopup",props:{item:{}},emits:["cancel","rename"],setup(e,{expose:t,emit:n}){const o=Kt,s=H(null),r=["number","letter","name"],i={number_up:"1→9",number_down:"9→1",letter_up:"A→Z",letter_down:"Z→A",name:"Name"},a=e,l=H([]),c=Y(()=>l.value.find(q=>typeof q!="string"&&(q.id==="number"||q.id==="letter"))),u=H("number"),d=H("up"),h=Go({...tp.number}),f=Go({...tp.number}),p=()=>{Object.assign(h,tp[u.value]),Object.assign(f,tp[u.value])};Qe(c,q=>{if(!q)return;const V=q.id;V!==u.value&&(u.value=V,p()),d.value=q.direction==="down"?"down":"up"},{immediate:!0,flush:"sync"});const g=Y(()=>hoe[d.value]),v=(q,V)=>{const k=yoe(u.value,q,V);h[q]=k,iN(q,k)&&(f[q]=k)},C=(q,V)=>{V.key.length===1&&!V.ctrlKey&&!V.metaKey&&!V.altKey&&!goe(u.value,q,V.key)&&V.preventDefault()},S=(q,V)=>{var Fe;V.preventDefault();const k=V.target,G=((Fe=V.clipboardData)==null?void 0:Fe.getData("text/plain"))??"",ee=k.selectionStart??k.value.length,ge=k.selectionEnd??k.value.length;k.value=k.value.slice(0,ee)+G+k.value.slice(ge),v(q,k.value),k.value=h[q]},b=q=>{if(iN(q,h[q]))return;const V=tp[u.value][q];h[q]=V,f[q]=V},y=Y(()=>c.value?aN({type:u.value,direction:d.value,first:f.first,step:f.step,count:a.item.length}):[]),_=Y(()=>l.value.every(q=>typeof q=="string"&&!q)),E=Y(()=>_.value||l.value.length==0&&l.value[0]===" "?a.item.map(q=>q.name):a.item.map((q,V)=>l.value.map(k=>typeof k=="string"?k:k.id==="name"?q.name:y.value[V]??"").join(""))),D=Y(()=>E.value.length>lN?E.value.length-cN:0),T=Y(()=>E.value.length>lN?E.value.slice(0,cN):E.value),P=[{id:"name",name:"Current name",icon:null,description:{active:"Remove from the name",inactive:"Add the current name"}},{id:"number_up",name:"Number",icon:"ArrowLeft",description:{active:"Remove from the name",inactive:"Add a number that counts up",switch:"Switch to a number that counts up"}},{id:"number_down",name:"Number",icon:"ArrowRight",description:{active:"Remove from the name",inactive:"Add a number that counts down",switch:"Switch to a number that counts down"}},{id:"letter_up",name:"Letter",icon:"ArrowLeft",description:{active:"Remove from the name",inactive:"Add a letter that counts up",switch:"Switch to a letter that counts up"}},{id:"letter_down",name:"Letter",icon:"ArrowRight",description:{active:"Remove from the name",inactive:"Add a letter that counts down",switch:"Switch to a letter that counts down"}}],L=q=>{x.value=[q];const V=q.id.split("_")[0],k=q.id.split("_")[1],G=i[q.id],ee=s.value;if(!ee)return;const ge=Ge=>l.value.find(fe=>typeof fe!="string"&&Ge.includes(fe.id));if(V==="name"){ge(["name"])?ee.deleteTag("name"):ee.insertTag({id:V,text:G,direction:void 0});return}const Fe=ge(["number","letter"]);if(Fe){const Ge=Fe.id===V,fe=Fe.direction===k;if(Ge&&fe){ee.deleteTag(Fe.id);return}ee.deleteTag(Fe.id),ee.insertTag({id:V,text:G,direction:k})}else ee.insertTag({id:V,text:G,direction:k})},I=q=>O(q.id)?q.description.active:!!c.value&&q.description.switch?q.description.switch:q.description.inactive,x=H(null),O=q=>{const[V,k]=q.split("_");return l.value.some(G=>typeof G!="string"&&G.id===V&&G.direction===k)},N=n,F=Y(()=>l.value.length===1&&typeof l.value.at(0)!="string"&&l.value[0].id==="name"),z=Y(()=>l.value.length===0||F.value),j=()=>{x.value=null,l.value=[],N("cancel")},Q=()=>{const q=l.value.map(V=>typeof V=="string"?{type:"text",value:V}:V.id==="name"?{type:"current_name"}:{type:"counter",value:h.first,direction:V.direction=="up"?"asc":"desc",format:V.id==="number"?"number":"letter",step:h.step});N("rename",q)};return t({reset:()=>{x.value=null,l.value=[]},focus:()=>{var q;(q=s.value)==null||q.focus()}}),en(()=>{console.log("Focusing template input"),setTimeout(()=>{var q;(q=s.value)==null||q.focus()},500)}),(q,V)=>(K(),ce("div",boe,[Te("div",Soe,[ye(loe,{modelValue:l.value,"onUpdate:modelValue":V[0]||(V[0]=k=>l.value=k),"allowed-tags":r,ref_key:"templateInputRef",ref:s},null,8,["modelValue"]),Te("div",Eoe,[(K(),ce(Ft,null,Pn(P,k=>qe((K(),ce("button",{onClick:G=>L(k),class:se(["template-option",{active:O(k.id)}]),key:k.id},[nt(it(k.name)+" ",1),k.icon?(K(),ze(W(ct),{key:0,src:k.icon,style:{transform:"rotate(90deg)"}},null,8,["src"])):Xe("",!0)],10,_oe)),[[W(o),{content:I(k),bypassOverflowCheck:!0,delay:[300,0],interactive:!1,hideOnClick:!1,appendTo:"parent"}]])),64))]),Te("div",Roe,[Te("span",Toe,it(g.value.first),1),ye(W($f),{"model-value":h.first,disabled:!c.value,"max-length":W(oN),onInput:V[1]||(V[1]=k=>v("first",k)),onKeydown:V[2]||(V[2]=k=>C("first",k)),onPaste:V[3]||(V[3]=k=>S("first",k)),onBlur:V[4]||(V[4]=k=>b("first")),"show-clear":!1},{clear:be(()=>[...V[9]||(V[9]=[Te("div",null,null,-1)])]),_:1},8,["model-value","disabled","max-length"]),Te("span",Doe,it(g.value.step),1),ye(W($f),{"model-value":h.step,disabled:!c.value,"max-length":W(sN),onInput:V[5]||(V[5]=k=>v("step",k)),onKeydown:V[6]||(V[6]=k=>C("step",k)),onPaste:V[7]||(V[7]=k=>S("step",k)),onBlur:V[8]||(V[8]=k=>b("step")),"show-clear":!1},null,8,["model-value","disabled","max-length"])]),Te("div",Ioe,[ye(W(pt),{variant:"secondary",onClick:j},{default:be(()=>[...V[10]||(V[10]=[nt(" Cancel ",-1)])]),_:1}),ye(W(pt),{onClick:Q,disabled:z.value},{default:be(()=>[...V[11]||(V[11]=[nt(" Rename ",-1)])]),_:1},8,["disabled"])])]),Te("div",xoe,[V[12]||(V[12]=Te("span",{class:"preview-title"},"Preview",-1)),Te("ul",Poe,[(K(!0),ce(Ft,null,Pn(T.value,(k,G)=>(K(),ce("li",{key:G},[ye(doe,{text:k},null,8,["text"])]))),128)),D.value>0?(K(),ce("li",koe," … "+it(D.value)+" more items ",1)):Xe("",!0)])])]))}}),[["__scopeId","data-v-4cce023f"]]),Aoe=tt({__name:"BulkRenameButton",props:{item:{},totalItem:{}},emits:["cancel","rename"],setup(e,{expose:t,emit:n}){const{popupRef:o,show:s,hide:r,triggerRef:i}=mo({interactive:!0,trigger:"manually",placement:"top-end",showArrow:!1,offset:[-350,25],hideOnClick:!0,toggleOnClick:!0,onHide:()=>{console.log("Popup hidden"),h()},onShow:()=>{ft(()=>{var f;(f=d.value)==null||f.focus()})}}),a=e,l=()=>{r()},c=f=>{u("rename",f),r()},u=n,d=H(null),h=()=>{d.value&&d.value.reset()};return t({popupRef:o,hide:r,show:s,triggerRef:i}),(f,p)=>(K(),ce(Ft,null,[Te("div",{class:"trigger-el",ref_key:"triggerRef",ref:i},null,512),Te("div",{class:"popup-el",ref_key:"popupRef",ref:o},[ye(Foe,{item:a.item,"total-item":a.totalItem,ref_key:"bulkRenameRef",ref:d,onCancel:l,onRename:c},null,8,["item","total-item"])],512)],64))}}),Ooe={...{list_cursor:{error:"Failed to fetch data. Please reload table."},assignedUser:{error:"Failed to fetch assignees. Please reload table."},metricValues:{error:"Failed to fetch metric values. Please reload table."},assignableUser:{error:"Failed to fetch people. Please try again."},assignableStatus:{error:"Failed to fetch statuses. Please try again."},basicInfor:{error:"Failed to fetch basic information."},item:{error:"Update failed. Please try again."},removeAssignee:{error:"Update failed. Please try again."},metricList:{error:"Failed to fetch metrics. Please try again."},multipleAssignableUser:{error:"Failed to fetch data. Please reload table."},getPermission:{error:"Failed to fetch permissions."},delete_rendition:{success:"Deletion successful.",error:"Deletion failed. Please try again."},delete_thumbnail:{success:"Deletion successful.",error:"Deletion failed. Please try again."},archive_item:{success:"Archive successful.",error:"Archive failed. Please try again."},unarchive_item:{success:"Unarchive successful.",error:"Unarchive failed. Please try again."},bulkDelete:{success:"Deletion successful.",error:"Deletion failed. Please try again."},bulkArchive:{error:"Archive failed. Please try again."},bulkDateUpdate:{error:"Failed to update items."},bulkAssignUpdate:{error:"Failed to update assignees."},bulkStatusUpdate:{error:"Failed to update items."},getUserPermission:{error:"Failed to fetch user permissions."},getEntityDetail:{error:"Failed to fetch entity details."},bulkUnarchive:{error:"Unarchive failed. Please try again."},downloadTemplate:{},importItems:{},exportItems:{},updateFromFile:{},me:{},workspaces:{},entityUserRoles:{},templateFlowStatuses:{},bulkMetricUpdate:{error:"Update failed. Please try again."},createNewItem:{},getAssignableAssignees:{},getAssignableStatuses:{},getFilterStatuses:{},bulkRename:{}},offline:{error:"You are currently offline. Please check your network connection."}};function uN(e,t,n){return(t=Noe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Moe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Noe(e){var t=Moe(e,"string");return typeof t=="symbol"?t:t+""}function kc(e){"@babel/helpers - typeof";return kc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kc(e)}var dN=function(e){return e.TOOLBOX_EXPORT_DATA="TOOLBOX_EXPORT_DATA",e.SW_APP_LOADER="SW_APP_LOADER",e}({});function hN(e){return kc(e)==="object"&&e!==null&&!Array.isArray(e)}function fN(e,t){var n=Object.keys(e);return n.length===t.length&&t.every(function(o){return n.includes(o)})}function Loe(e){return typeof Blob<"u"&&e instanceof Blob}var Voe=function(t){return hN(t)&&fN(t,["file","fileName"])&&Loe(t.file)&&typeof t.fileName=="string"},Boe=function(t){return hN(t)&&fN(t,["scene_id","people_id","openGS","queryParams"])&&(typeof t.scene_id=="string"||t.scene_id===null)&&(typeof t.people_id=="string"||t.people_id===null)&&(typeof t.openGS=="boolean"||t.openGS===null)&&typeof t.queryParams=="string"};Object.freeze(uN(uN({},dN.TOOLBOX_EXPORT_DATA,Voe),dN.SW_APP_LOADER,Boe));class $oe extends Error{}class fl extends $oe{constructor(){super("Zone is an abstract class")}}class pN{get type(){throw new fl}get name(){throw new fl}get ianaName(){return this.name}get isUniversal(){throw new fl}offsetName(t,n){throw new fl}formatOffset(t,n){throw new fl}offset(t){throw new fl}equals(t){throw new fl}get isValid(){throw new fl}}const K0=new Map;function Hoe(e){let t=K0.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),K0.set(e,t)),t}const Goe={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Uoe(e,t){const n=e.format(t).replace(/\u200E/g,""),o=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,s,r,i,a,l,c,u]=o;return[i,s,r,a,l,c,u]}function Woe(e,t){const n=e.formatToParts(t),o=[];for(let s=0;s<n.length;s++){const{type:r,value:i}=n[s],a=Goe[r];r==="era"?o[a]=i:Zv(a)||(o[a]=parseInt(i,10))}return o}const q0=new Map;class Xv extends pN{static create(t){let n=q0.get(t);return n===void 0&&q0.set(t,n=new Xv(t)),n}static resetCache(){q0.clear(),K0.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=Xv.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:o}){return Koe(t,n,o,this.name)}formatOffset(t,n){return Qv(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const o=Hoe(this.name);let[s,r,i,a,l,c,u]=o.formatToParts?Woe(o,n):Uoe(o,n);a==="BC"&&(s=-Math.abs(s)+1);const h=joe({year:s,month:r,day:i,hour:l===24?0:l,minute:c,second:u,millisecond:0});let f=+n;const p=f%1e3;return f-=p>=0?p:1e3+p,(h-f)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let Y0=null;class fd extends pN{static get utcInstance(){return Y0===null&&(Y0=new fd(0)),Y0}static instance(t){return t===0?fd.utcInstance:new fd(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new fd(mN(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Qv(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Qv(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Qv(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}function Zv(e){return typeof e>"u"}function Jv(e,t=2){const n=e<0;let o;return n?o="-"+(""+-e).padStart(t,"0"):o=(""+e).padStart(t,"0"),o}function gN(e){if(!(Zv(e)||e===null||e===""))return parseInt(e,10)}function zoe(e){if(!(Zv(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function joe(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function Koe(e,t,n,o=null){const s=new Date(e),r={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};o&&(r.timeZone=o);const i={timeZoneName:t,...r},a=new Intl.DateTimeFormat(n,i).formatToParts(s).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function mN(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const o=parseInt(t,10)||0,s=n<0||Object.is(n,-0)?-o:o;return n*60+s}function Qv(e,t){const n=Math.trunc(Math.abs(e/60)),o=Math.trunc(Math.abs(e%60)),s=e>=0?"+":"-";switch(t){case"short":return`${s}${Jv(n,2)}:${Jv(o,2)}`;case"narrow":return`${s}${n}${o>0?`:${o}`:""}`;case"techie":return`${s}${Jv(n,2)}${Jv(o,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}const vN=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function pd(...e){const t=e.reduce((n,o)=>n+o.source,"");return RegExp(`^${t}$`)}function gd(...e){return t=>e.reduce(([n,o,s],r)=>{const[i,a,l]=r(t,s);return[{...n,...i},a||o,l]},[{},null,1]).slice(0,2)}function yN(...e){return(t,n)=>{const o={};let s;for(s=0;s<e.length;s++)o[e[s]]=gN(t[n+s]);return[o,null,n+s]}}const wN=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,qoe=`(?:${wN.source}?(?:\\[(${vN.source})\\])?)?`,CN=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,bN=RegExp(`${CN.source}${qoe}`),X0=RegExp(`(?:[Tt]${bN.source})?`),Yoe=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Xoe=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Zoe=/(\d{4})-?(\d{3})/,Joe=yN("weekYear","weekNumber","weekDay"),Qoe=yN("year","ordinal"),ese=/(\d{4})-(\d\d)-(\d\d)/,SN=RegExp(`${CN.source} ?(?:${wN.source}|(${vN.source}))?`),tse=RegExp(`(?: ${SN.source})?`);function md(e,t,n){const o=e[t];return Zv(o)?n:gN(o)}function nse(e,t){return[{year:md(e,t),month:md(e,t+1,1),day:md(e,t+2,1)},null,t+3]}function vd(e,t){return[{hours:md(e,t,0),minutes:md(e,t+1,0),seconds:md(e,t+2,0),milliseconds:zoe(e[t+3])},null,t+4]}function np(e,t){const n=!e[t]&&!e[t+1],o=mN(e[t+1],e[t+2]),s=n?null:fd.instance(o);return[{},s,t+3]}function op(e,t){const n=e[t]?Xv.create(e[t]):null;return[{},n,t+1]}pd(Yoe,X0),pd(Xoe,X0),pd(Zoe,X0),pd(bN),gd(nse,vd,np,op),gd(Joe,vd,np,op),gd(Qoe,vd,np,op),gd(vd,np,op),gd(vd),pd(ese,tse),pd(SN),gd(vd,np,op);var Mo=function(e){return e.review="{reviewDomain}/{ws_code}",e.review_take="{reviewDomain}/{ws_code}?id={take_id}",e.review_scene="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",e.review_rendition="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",e.review_frame="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}&tab=comment&refresh_marker=true#type=frame&data={frame}",e.review_rendition_comment="{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}&tab=comment",e.review_comment="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",e.scene_hub="{baseDomain}/{ws_code}/{scene_id}?o=st",e.hub_rendition="{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",e.hub_comment="{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",e.people_insight="{baseDomain}/{ws_code}/{user_id}?o=pt",e.people_detail="{baseDomain}/{ws_code}/ws/ppl/{display_name}-{user_id}",e.project="{baseDomain}/{ws_code}/pl/dir/{entity_id}",e.project_focusMode="{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",e.woohoo="{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",e.update="{baseDomain}/{ws_code}/pl/au?id={entity_id}",e.core="{baseDomain}/{ws_code}",e}(Mo||{});Mo.review,Mo.review_take,Mo.review_scene,Mo.review_rendition,Mo.review_frame,Mo.review_rendition_comment,Mo.review_comment,Mo.scene_hub,Mo.hub_rendition,Mo.hub_comment,Mo.people_insight,Mo.people_detail,Mo.project,Mo.woohoo,Mo.update,Mo.core,Mo.project_focusMode;var Z0=null;function ose(e){Z0=e}function ey(){if(!Z0)throw new Error("i18n instance not set. Call setI18nInstance(i18n) before using errorHelper.");return Z0}function EN(){try{var e=sessionStorage.getItem("APP_DEBUG")?"✅":"",t=ey();return"".concat(t.t("errorMessages.fallback.unknownError")," ").concat(e)}catch{return"An error occurred. Please try again or contact support."}}function sse(e,t,n,o){var s=e.replace(/{field}/g,t);if(o&&kc(o)==="object")Object.keys(o).forEach(function(i){var a="{".concat(i,"}"),l=o[i];Array.isArray(l)?l=l.join(", "):i==="value"&&(o.min||o.max)&&(l="".concat(o.min||o.value," and ").concat(o.max||o.value)),s=s.replace(new RegExp(a,"g"),l||"")});else if(Array.isArray(n)&&n.length>0){var r=n[0]||"";n.length>1?r="".concat(n[0]," and ").concat(n[1]):n.length===1&&Array.isArray(n[0])&&(r=n[0].join(", ")),s=s.replace(/{value}/g,r)}return s}function rse(e,t){for(var n=Object.keys(t),o=0,s=n;o<s.length;o++){var r=s[o],i=Array.isArray(t[r])?t[r].join(", "):String(t[r]);e=e.replace(new RegExp("\\{".concat(r,"\\}"),"g"),i)}if(n.length>0&&e.includes("{value}")){var a=t[n[0]],l=Array.isArray(a)?a.join(", "):String(a);e=e.replace(/{value}/g,l)}return e}function _N(e){return!!(e&&e.validation&&e.validation.fields&&Object.keys(e.validation.fields).length>0)}function RN(e,t){if(!e||kc(e)!=="object")return null;try{var n=ey();if(e.validation&&e.validation.fields)for(var o=e.validation.fields,s=Object.keys(o),r=0,i=s;r<i.length;r++){var a=i[r],l=o[a];if(l&&l.rule){var c=l.rule,u=l.data||[],d=l.params||{};try{var h,f,p=((h=n.messages)===null||h===void 0?void 0:h.value)||n.messages,g=((f=n.locale)===null||f===void 0?void 0:f.value)||n.locale,v=null;if(t){var C,S=t.toUpperCase();v=(C=p[g])===null||C===void 0||(C=C.errorMessages)===null||C===void 0||(C=C[S])===null||C===void 0||(C=C.validation_rules)===null||C===void 0?void 0:C[c]}if(!v){var b;v=(b=p[g])===null||b===void 0||(b=b.errorMessages)===null||b===void 0||(b=b.GEN)===null||b===void 0||(b=b.validation_rules)===null||b===void 0?void 0:b[c]}if(v&&typeof v=="string")return sse(v,a,u,d)}catch(y){console.error("Error in validation rules",y)}}}}catch(y){return console.error("Error in getValidationErrorMessage:",y),null}return null}function TN(e){var t=sessionStorage.getItem("APP_DEBUG")?"✅":"";if(!e)return EN();var n=e.code,o=e.error,s=e.details,r=e.message;if(_N(s)&&s){var i=RN(s,o==null?void 0:o.type);if(sessionStorage.getItem("APP_DEBUG")&&console.log("[Error Utils Debug]",i),i)return n!==""?"[".concat(n,"] ").concat(i," ").concat(t):"".concat(i);try{var a=ey();return a.t("errorMessages.GEN.validation_error")}catch{return"Validation error occurred."}}if(o&&kc(o)==="object"&&o.type&&o.key){var l=o.type.toUpperCase();try{var c,u,d,h="errorMessages.".concat(l,".").concat(o.key),f=ey(),p=((c=f.messages)===null||c===void 0?void 0:c.value)||f.messages,g=((u=f.locale)===null||u===void 0?void 0:u.value)||f.locale,v=(d=p[g])===null||d===void 0||(d=d.errorMessages)===null||d===void 0||(d=d[l])===null||d===void 0?void 0:d[o.key];if(v&&typeof v=="string"){var C=v;return s!=null&&s.context&&(C=rse(C,s.context),sessionStorage.getItem("APP_DEBUG")&&console.log("[Error Utils Debug]",C)),n!==""?"[".concat(n,"] ").concat(C," ").concat(t):"".concat(C," ").concat(t)}}catch(b){console.error("[Error Utils Debug]",b)}}if(o&&kc(o)!=="object"&&_N(s)){var S=RN(s);if(S)return n!==""?"[".concat(n,"] ").concat(S," ").concat(t):"".concat(S," ").concat(t)}return r?"".concat(r):EN()}const Es=Sc("toast",()=>{const e=c=>TN(c),t=c=>{var u;if((c==null?void 0:c.apiCode)==="offline")r({id:"offline",type:"error",message:"You are currently offline. Please check your network connection."});else{const d=TN((u=c==null?void 0:c.res)==null?void 0:u.data);r({id:c==null?void 0:c.apiCode,type:"error",message:d})}},n=H([]),o=(c,u)=>{const d=Ooe[c];if(d){const h=d[u];if(h){r({id:c,type:u,message:h});return}}else r({id:c,type:u,message:c})},s=new Map,r=(c,u=5e3)=>{const d={...c,id:c.id??Date.now()+Math.random()};if(n.value.push(d),u>0){const h=Date.now(),f=setTimeout(()=>{i(d.id),s.delete(d.id)},u);s.set(d.id,{timeoutId:f,remainingTime:u,startTime:h})}};function i(c){n.value=n.value.filter(d=>d.id!==c);const u=s.get(c);u&&(clearTimeout(u.timeoutId),s.delete(c))}function a(c){const u=s.get(c);if(u){clearTimeout(u.timeoutId);const d=Date.now()-u.startTime;u.remainingTime=Math.max(0,u.remainingTime-d)}}function l(c){const u=s.get(c);if(u&&u.remainingTime>0){const d=setTimeout(()=>{i(c),s.delete(c)},u.remainingTime);u.timeoutId=d,u.startTime=Date.now()}}return{notifications:n,addNotification:r,removeNotification:i,showMessage:o,showErrorNetMessage:t,pauseAutoDismiss:a,resumeAutoDismiss:l,getErrorMessageFromResponse:e}}),ise={style:{"max-width":"225px","line-height":"14px"}},ase={style:{"max-width":"100px","line-height":"14px"}},DN=500,lse=bt(tt({__name:"BulkUpdate",props:{selectRowData:{},workspaceId:{},entityId:{},gridApi:{},selectedAll:{type:Boolean},takeName:{},totalRows:{},visibleRows:{},loading:{type:Boolean}},emits:["close","assignStatus","assignAssignee","assignDate","assignMetric","moreActions","deleteSelected","unselect","updated","selectAll","refreshSelectedRow"],setup(e,{emit:t}){const n=Kt,o=Uo,s=e,r=t,i=qv(),{handelSelectAll:a}=i,{selectionStatus:l}=us(i),c=Y(()=>l.value===At.CHECKED),u=Y(()=>s.selectRowData.map(oe=>oe.id)),d=Y(()=>s.selectRowData.length>0);ui("bulkUpdate",d),ui("isSelectAll",c);const h=(oe,ae,ue)=>{const xe=oe.getRowNode(ae);xe&&xe.setData({...xe.data,...ue})},f=({itemIds:oe,data:ae})=>{const ue=s.gridApi;if(!ue){console.error("Grid API is undefined");return}oe.forEach(xe=>{const le=ue.getRowNode(xe);le&&!le.data.isLocked&&le.setData({...le.data,status:ae})})},p=({itemIds:oe,data:ae})=>{const ue=s.gridApi;if(!ue){console.error("Grid API is undefined");return}oe.forEach(xe=>{const le=ue.getRowNode(xe);if(le){const M=le.data.dateRange||[null,null];"startDate"in ae&&ae.startDate!==void 0&&(M[0]=ae.startDate?new Date(ae.startDate):null),"dueDate"in ae&&ae.dueDate!==void 0&&(M[1]=ae.dueDate?new Date(ae.dueDate):null);const $={...le.data,dateRange:M};le.setData($)}}),r("updated")},g=oe=>{const ae=s.gridApi,{id:ue,value:xe}=oe;if(!ae){console.error("Grid API is undefined");return}u.value.forEach(le=>h(ae,le,{[`metric_${ue}`]:xe})),r("updated")},v=["primary"],C=[{label:"Rename",icon:"Pen",id:"bulk-rename",type:"icon",value:"bulk-rename"},{label:"Delete Thumbnail",icon:"Image",id:"delete-thumbnail",type:"icon",value:"delete-thumbnail"},{label:"Delete Rendition",icon:"Film",id:"delete-rendition",type:"icon",value:"delete-rendition"},{label:"Unarchive",value:"UnBoxArchive",type:"icon",icon:"BoxArchive",id:"unarchive",clickable:!0},{label:"Archive",value:"BoxArchive",type:"icon",icon:"BoxArchive",id:"archive",clickable:!0},{label:"Delete",value:"delete",type:"icon",icon:"TrashCan",id:"delete",danger:!0,clickable:!0}],S=()=>{r("unselect")},b=r0(),{userPermissions:y}=us(b),_=Y(()=>y.value.includes(i0)),E=Y(()=>{if(!_.value){console.error("User does not have permission to open review.");return}return l.value==At.CHECKED?ls({type:"review_take",config:{reviewDomain:fn.getInstance().getItem("BASE_REVIEW_URL"),ws_code:s.workspaceId,take_id:s.entityId}}).url:ls({type:"review_multiple_scenes",config:{reviewDomain:fn.getInstance().getItem("BASE_REVIEW_URL"),ws_code:s.workspaceId,scene_ids:u.value.join(",")}}).url}),D=oe=>{const{assignees:ae,type:ue}=oe,xe=s.gridApi;if(!xe){console.error("Grid API is not available for bulk update.");return}const le=new Set(ae.map(M=>M.id));u.value.forEach(M=>{const $=xe.getRowNode(M);if(!$)return;const Ce=$.data.assignees||[];let Ee=[];switch(ue){case"add":{const me=new Set(Ce.map($e=>$e.id));Ee=[...Ce,...ae.filter($e=>!me.has($e.id))];break}case"overwrite":Ee=ae;break;case"remove":Ee=Ce.filter(me=>!le.has(me.id));break;case"removeAll":Ee=[];break}$.setData({...$.data,assignees:Ee})})},{apiServices:T}=io(!1,s),P=H(null),L=In("filterParams",void 0),I=Y(()=>({workspaceId:String(s.workspaceId),itemIds:d.value&&c.value?[]:u.value,entityId:s.entityId,filterParams:L!=null&&L.value?L.value:void 0})),x=async()=>{var xe;const oe=u.value,ae=s.gridApi;if(!ae){console.error("Grid API is not available for bulk delete.");return}const ue=await((xe=T.value)==null?void 0:xe.bulkDeleteItems(I.value));(ue==null?void 0:ue.message)=="Done"&&(oe.forEach(le=>h(ae,le,{isDeleted:!0,disabled:!0})),ae.deselectAll())},O=async({request:oe,apiUnavailableMessage:ae,failureMessage:ue,onSuccess:xe})=>{var Ce,Ee;const le=u.value,M=s.gridApi;if(!M){console.error(ae);return}const $=await oe();if(($==null?void 0:$.message)!="Done"){console.error(ue),(Ce=P.value)==null||Ce.open();return}xe(le,M),(Ee=P.value)==null||Ee.hide()},N=()=>O({request:()=>{var oe;return(oe=T.value)==null?void 0:oe.bulkUnarchiveItems(I.value)},apiUnavailableMessage:"Grid API is not available for bulk unarchive.",failureMessage:"Failed to unarchive items.",onSuccess:oe=>Q(oe,"isArchived",!1)}),F=()=>O({request:()=>{var oe;return(oe=T.value)==null?void 0:oe.bulkArchiveItems(I.value)},apiUnavailableMessage:"Grid API is not available for bulk archive.",failureMessage:"Failed to archive items.",onSuccess:oe=>Q(oe,"isArchived",!0)}),z=()=>O({request:()=>{var oe;return(oe=T.value)==null?void 0:oe.deleteThumbnail(I.value)},apiUnavailableMessage:"Grid API is not available for bulk thumbnail deletion.",failureMessage:"Failed to delete thumbnails.",onSuccess:(oe,ae)=>oe.forEach(ue=>h(ae,ue,{thumbnail:null}))}),j=()=>O({request:()=>{var oe;return(oe=T.value)==null?void 0:oe.deleteRendition(I.value)},apiUnavailableMessage:"Grid API is not available for bulk rendition deletion.",failureMessage:"Failed to delete renditions.",onSuccess:(oe,ae)=>oe.forEach(ue=>h(ae,ue,{rendition:null}))}),Q=(oe,ae,ue)=>{const xe=s.gridApi;if(!xe){console.error("Grid API is not available for bulk update.");return}const le=[];oe.forEach(M=>{const $=xe.getRowNode(M);$&&($.setData({...$.data,[ae]:typeof ue=="function"?ue():ue}),le.push($))}),xe.redrawRows({rowNodes:le})},re=H(!1),q=H(null),V=async oe=>{var ae,ue,xe;try{switch(G.value=!0,re.value=!0,oe.id){case"unarchive":await N();break;case"delete":await x();break;case"archive":await F();break;case"delete-thumbnail":await z();break;case"delete-rendition":await j();break;case"bulk-rename":await Ge(),(ae=P.value)==null||ae.hide();break;default:console.error("Unknown action:",oe.id),re.value=!1;break}}catch(le){console.error("Error performing action:",le),(ue=P.value)==null||ue.open()}finally{(xe=q.value)==null||xe.focus(),ft(()=>{G.value=!1,re.value=!1})}},k=(oe,ae)=>{var ue;!oe&&ae&&((ue=q.value)==null||ue.focus())},G=H(!0),ee=oe=>{ft(()=>{G.value=oe})};Qe(()=>s.selectRowData,()=>{G.value=!1},{deep:!0,immediate:!0});const ge=Y(()=>({workspaceId:s.workspaceId,entityId:s.entityId,variant:v,disabled:G.value,ids:l.value==At.CHECKED?[]:u.value})),Fe=H(null),Ge=async()=>{var oe;(oe=Fe.value)==null||oe.show()},fe=Y(()=>s.selectRowData.map((oe,ae)=>({name:oe.name,index:ae}))),X=(oe,{currentName:ae,counterValue:ue})=>oe.map(xe=>{switch(xe.type){case"text":return xe.value;case"current_name":return ae;case"counter":return ue;default:return""}}).join(""),we=(oe,ae)=>{const ue=oe.find(xe=>xe.type==="counter");return ue?aN({type:ue.format,direction:ue.direction==="asc"?"up":"down",first:ue.value,step:ue.step,count:ae}):[]},de=(oe,ae)=>{const ue=new Map(s.selectRowData.map(le=>[le.id,le.name||""])),xe=we(oe,ae.length);return ae.map((le,M)=>{const $=ue.get(le)??"",Ce=X(oe,{currentName:$,counterValue:xe[M]??""});return{id:le,from:$,to:Ce}})},B=({parameters:oe,segments:ae,renamedItems:ue,status:xe,response:le,error:M})=>{var Se,Me,Ct;const $=M!==void 0,Ce=xe.status??((Se=M==null?void 0:M.response)==null?void 0:Se.status),Ee=s.selectRowData.length,me=oe.itemIdsCount??null,$e=new Set(ue.map(Rt=>Rt.to)).size,Ye=[$?`FAILED: ${(M==null?void 0:M.message)??"unknown error"} (HTTP ${Ce??"n/a"})`:Ce===202?"OK: HTTP 202, rename queued; table names unchanged, rows set to processing (state 1)":`OK: request resolved (HTTP ${Ce??"unknown"})`,me===null?`Select-all: server resolves items from entity (${Ee} loaded locally)`:me===Ee?`All ${Ee} selected items were sent`:`MISMATCH: ${me} ids sent vs ${Ee} selected`,ue.length?$e===ue.length?"All generated names are unique":`WARNING: ${ue.length-$e} duplicate generated name(s)`:`Names not generated locally (more than ${DN} items); server applies the rename`,le==null||le===""?"Response body is empty":"Response body received"];console.group("[BulkRename] report"),console.log("1. Parameters",oe),console.log("2. Input (segments)",ae),console.log("2. Input (rows)",ue.map(({id:Rt,from:Lt})=>({id:Rt,name:Lt}))),console.log("3. Output (new names)"),console.table(ue),console.log("4. API status",{ok:!$,httpStatus:Ce??null,statusText:xe.statusText??((Me=M==null?void 0:M.response)==null?void 0:Me.statusText)??null}),console.log("5. Response body",$?((Ct=M==null?void 0:M.response)==null?void 0:Ct.data)??M:le),console.log("6. Conclusion",Ye.join(`
|
|
160
160
|
- `)),console.groupEnd()},te=async oe=>{var Se,Me,Ct,Rt;if(!s.workspaceId||!s.entityId)return;const ae=ne(),ue={item_ids:ae,segments:oe};c.value&&(delete ue.item_ids,ue.entity_id=s.entityId);const xe={workspaceId:s.workspaceId,entityId:s.entityId,payload:ue,filter:L!=null&&L.value?L.value:void 0},le=s.selectRowData.length>DN,M=le?[]:de(oe,ae);let $={};const Ce=Lt=>{var qt;console.log("onCallApi event",Lt),((qt=Lt.res)==null?void 0:qt.status)==202&&(Es().addNotification({message:"Rename queued. This may take a moment. Names will update when complete",type:"interactive",id:"bulk-rename-queued"}),Q(ae,"isProcessing",{state:1}))};(Se=T.value)==null||Se.on("call-api",Ce);let Ee,me;try{Ee=await((Me=T.value)==null?void 0:Me.bulkRename(xe))}catch(Lt){throw me=Lt,Lt}finally{(Ct=T.value)==null||Ct.off("call-api",Ce),B({parameters:{workspaceId:xe.workspaceId,entityId:xe.entityId,isSelectAll:c.value,itemIdsCount:((Rt=ue.item_ids)==null?void 0:Rt.length)??null,itemIds:ue.item_ids,filter:xe.filter},segments:oe,renamedItems:M,status:$,response:Ee,error:me})}if($.status===202||le){Q(ae,"isProcessing",{state:1});return}const Ye=s.gridApi;Ye&&(M.forEach(({id:Lt,to:qt})=>{const tn=Ye.getRowNode(Lt);tn&&tn.setDataValue("name",qt)}),r("refreshSelectedRow"))},ne=()=>{const oe=s.gridApi;return oe==null?[]:s.selectRowData.map(ae=>{var ue;return[ae.id,(ue=oe.getRowNode(ae.id))==null?void 0:ue.rowIndex]}).sort((ae,ue)=>ae[1]-ue[1]).map(([ae])=>ae)};return(oe,ae)=>qe((K(),ce("div",{class:se(oe.$style["bulk-update-action"])},[Te("div",{class:se(oe.$style["left-actions"])},[Te("div",{class:se(oe.$style["selection-track"])},[ye(pt,{class:se(oe.$style["btn-close"]),variant:["tertiary","icon"],onClick:S,style:{background:"transparent"}},{prefix:be(()=>[ye(ct,{src:"XMarkSolid",source:"remote"})]),_:1},8,["class"]),W(l)==W(At).INDETERMINATE?(K(),ce("span",{key:0,class:se(oe.$style["selected-count"])},it(e.selectRowData.length)+" selected ",3)):Xe("",!0),W(l)==W(At).CHECKED?(K(),ce("span",{key:1,class:se(oe.$style["selected-count"]),style:{"line-height":"14px"}},[ae[12]||(ae[12]=nt(' All in " ',-1)),qe((K(),ce("span",ise,[nt(it(e.takeName),1)])),[[W(n),{content:e.takeName}]]),ae[13]||(ae[13]=nt(' " ',-1))],2)):Xe("",!0),!e.loading&&W(l)==W(At).INDETERMINATE&&e.totalRows>e.selectRowData.length&&e.selectRowData.length==e.visibleRows?(K(),ze(pt,{key:2,variant:"secondary",onHandleClick:W(a)},{default:be(()=>[Te("span",{class:se(oe.$style["selected-count"]),style:{"line-height":"14px"}},[ae[14]||(ae[14]=nt(' Select all in " ',-1)),qe((K(),ce("span",ase,[nt(it(e.takeName),1)])),[[W(n),{content:e.takeName}]]),ae[15]||(ae[15]=nt(' " ',-1))],2)]),_:1},8,["onHandleClick"])):Xe("",!0),Te("span",{class:se(oe.$style.divider)},null,2)],2),ye(noe,jt(ge.value,{onUpdated:f,onUpdateStart:ae[0]||(ae[0]=ue=>G.value=!0),onUpdateCompleted:ae[1]||(ae[1]=ue=>ee(!1)),onUpdateFailed:ae[2]||(ae[2]=ue=>ee(!1)),"selected-all":W(l)==W(At).CHECKED}),null,16,["selected-all"]),ye(MJ,jt({onUpdate:D,onUpdateStart:ae[3]||(ae[3]=ue=>G.value=!0),onUpdateCompleted:ae[4]||(ae[4]=ue=>ee(!1)),onUpdateFailed:ae[5]||(ae[5]=ue=>ee(!1)),"selected-all":W(l)==W(At).CHECKED},ge.value),null,16,["selected-all"]),ye(qJ,jt({"row-selected":e.selectRowData,"selected-all":W(l)==W(At).CHECKED},ge.value,{onUpdated:p,onUpdateStart:ae[6]||(ae[6]=ue=>G.value=!0),onUpdateCompleted:ae[7]||(ae[7]=ue=>ee(!1)),onUpdateFailed:ae[8]||(ae[8]=ue=>ee(!1))}),null,16,["row-selected","selected-all"]),ye(Qne,{disabled:G.value,onUpdate:g,onUpdateStart:ae[9]||(ae[9]=ue=>G.value=!0),onUpdateCompleted:ae[10]||(ae[10]=ue=>ee(!1)),onUpdateFailed:ae[11]||(ae[11]=ue=>ee(!1)),selectedIds:u.value,"workspace-id":e.workspaceId,variant:v,"entity-id":e.entityId,"selected-all":W(l)==W(At).CHECKED},null,8,["disabled","selectedIds","workspace-id","entity-id","selected-all"]),Te("span",{class:se(oe.$style.divider)},null,2),qe((K(),ce("div",null,[_.value?(K(),ze(pt,{key:0,class:se(oe.$style["action-button"]),variant:[...v,"icon"],href:E.value,disabled:s.selectRowData.length>40&&W(l)!=W(At).CHECKED},{default:be(()=>[ye(ct,{src:"PenRuler",class:se(oe.$style["icon-btn"])},null,8,["class"])]),_:1},8,["class","variant","href","disabled"])):Xe("",!0)])),[[W(n),s.selectRowData.length<=40||W(l)==W(At).CHECKED?"Open in Review":"Select fewer than 40 items to open in Review"]]),Te("span",{class:se(oe.$style.divider)},null,2),ye(Hf,{ref_key:"wrapperRef",ref:P,isUpdating:G.value,disabled:G.value,onOnVisibleChange:k},{trigger:be(({hide:ue,toggle:xe,isVisible:le,disabled:M})=>[qe((K(),ze(pt,{onEscape:ue,actived:le,ref_key:"moreActionRef",ref:q,class:se(oe.$style["action-button"]),variant:["secondary","icon"],loading:re.value,disabled:M||G.value,onClick:Nt(xe,["stop"])},{default:be(()=>[ye(ct,{src:"EllipsisVertical",class:se(oe.$style.icon),source:"remote"},null,8,["class"])]),_:1},8,["onEscape","actived","class","loading","disabled","onClick"])),[[W(o),"99999"],[W(n),{content:"More actions"}]])]),popup:be(({isVisible:ue,hide:xe})=>[(K(),ce(Ft,null,Pn(C,(le,M)=>ye(Ec,jt({clickable:!0,key:le.id},{ref_for:!0},le,{show:ue,style:{borderLeft:0},"focus-index":"99999."+M,onClick:()=>{V(le)},onEscape:xe}),null,16,["show","focus-index","onClick","onEscape"])),64))]),_:1},8,["isUpdating","disabled"])],2),ye(Aoe,{item:fe.value,totalItem:fe.value.length,onRename:te,ref_key:"bulkRenameButtonRef",ref:Fe},null,8,["item","totalItem"])],2)),[[lr,e.selectRowData.length>0]])}}),[["__cssModules",{$style:{"bulk-update-action":"_bulk-update-action_1odua_1","left-actions":"_left-actions_1odua_20","right-actions":"_right-actions_1odua_21","selection-track":"_selection-track_1odua_26","btn-close":"_btn-close_1odua_32","close-icon":"_close-icon_1odua_38","selected-count":"_selected-count_1odua_42",divider:"_divider_1odua_48","more-button":"_more-button_1odua_53",dropdown:"_dropdown_1odua_57","dropdown-content":"_dropdown-content_1odua_60",delete:"_delete_1odua_83","icon-btn":"_icon-btn_1odua_90","selected-list":"_selected-list_1odua_94"}}]]),pl=bt(tt({name:"LabelRenderer",__name:"LabelRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=Ns,n=Kt,o=e,s=Y(()=>({disabled:o.disabled,error:!1,readOnly:o.readOnly,isEmpty:o.value===void 0||o.value===null||o.value==="",clickable:!0})),{argsMain:r}=To(s),i=Y(()=>{var c,u,d;return!!((c=o.params)!=null&&c.api||(u=o.params)!=null&&u.node||(d=o.params)!=null&&d.context)}),a=Y(()=>{if(o.tooltip){if(typeof o.tooltip=="string")return{content:o.tooltip};if(typeof o.tooltip=="object"&&"display_name"in o.tooltip){const c=o.tooltip,u=document.createElement("div");u.classList.add("tooltip-user-info"),u.style.display="flex",u.style.alignItems="center",u.style.gap="4px";const d=document.createElement("div"),h=ye(df,{id:c.id,name:c.display_name,profile_image:c.profile_image,size:20,initial:c.initial,color:c.color});eb(h,d);const f=document.createElement("span");f.innerText=c.display_name,f.classList.add("tooltip-user-name");const p=document.createElement("span");p.style.whiteSpace="nowrap",p.innerText="By",u.appendChild(p),u.appendChild(d),u.appendChild(f);const g=document.getElementById("item-table-layout-id");return{content:u,allowHtml:!0,appendTo:g||document.body,bypassOverflowCheck:!0}}}return{content:void 0}}),l=Y(()=>o.value===void 0);return(c,u)=>qe((K(),ze(Fo,jt(W(r),{ref:"displayWrapperRef"}),{default:be(()=>[Te("span",{class:se(c.$style["item-table-label-renderer"])},it(o.value||"-"),3)]),_:1},16)),[[W(t),{isLoading:l.value||!i.value}],[W(n),a.value]])}}),[["__cssModules",{$style:{"item-table-label-renderer":"_item-table-label-renderer_s1gdy_1"}}]]),cse=["placeholder","maxlength"],use={key:0,class:"wrapper-suffix"},dse=bt(tt({name:"LabelEditor",__name:"LabelEditor",props:{value:{},placeholder:{default:"Enter name"},disabled:{type:Boolean},readOnly:{type:Boolean},maxLength:{},saveOnBlur:{type:Boolean,default:!0},bordered:{type:Boolean},keyboardFocusing:{type:Boolean}},emits:["update:value","enter","blur"],setup(e,{expose:t,emit:n}){const o=Ns,s=Kt,r=e,i=n,a=H(r.value),l=H(null),c=H(null),u=H(r.value||""),d=H(!1),h=H(!1),f=Y(()=>{var I;return{disabled:r.disabled,error:!1,readOnly:r.readOnly,isEmpty:((I=r.value)==null?void 0:I.length)===0,inputRef:l,wrapperRef:c,clickable:!0,focused:d.value||r.keyboardFocusing}}),{argsMain:p,isHover:g}=To(f),v=()=>u.value!==a.value,C=()=>{h.value=!0,d.value=!1,u.value=a.value,i("update:value",a.value),setTimeout(()=>{h.value=!1},100)},S=()=>{if(!d.value||!l.value)return;const I=l.value.value;if(!v()){d.value=!1;return}a.value=I,i("update:value",I),i("enter",I),d.value=!1},b=()=>{h.value||(r.saveOnBlur?S():C(),i("blur",u.value))},y=I=>{var x;if(I.key==="ArrowLeft"||I.key==="ArrowRight"){I.stopPropagation();return}I.ctrlKey&&(I.key=="a"||I.key=="A")?(I.stopPropagation(),(x=l.value)==null||x.select()):I.key==="Enter"?(I.preventDefault(),I.stopPropagation(),S()):I.key==="Escape"&&(I.preventDefault(),I.stopPropagation(),C())},_=()=>{a.value=r.value,u.value=r.value,d.value=!0,ft(()=>{var I,x;(I=l.value)==null||I.click(),(x=l.value)==null||x.focus()})},E=()=>{var I;d.value?C():(I=l.value)==null||I.blur(),i("blur",u.value)},D={focus:()=>{_()}};en(()=>{var x;const I=(x=c.value)==null?void 0:x.$el;I&&(I.__sceneNameEditor=D)}),Jn(()=>{const I=c.value;I&&delete I.__sceneNameEditor});const T=H(null),P=H(null);t({focus:_,blur:()=>{var I;return(I=l.value)==null?void 0:I.blur()},save:S,cancel:C,focusEditButton:()=>{ft(()=>{var I;(I=T.value)==null||I.focus()})},focusCancelButton:()=>{ft(()=>{var I;(I=P.value)==null||I.focus()})},startEdit:_});const L=Y(()=>r.value===void 0);return c0(c,()=>{d.value&&b()}),(I,x)=>qe((K(),ze(W(Fo),jt(W(p),{ref_key:"wrapperRef",ref:c,bordered:r.bordered,style:{paddingTop:"0px",paddingBottom:"0px"}}),Lh({default:be(()=>[d.value?Xe("",!0):xt(I.$slots,"default",{isEditting:d.value,isHover:W(g)},()=>[qe((K(),ce("span",{class:se(I.$style["label-renderer"])},[nt(it(u.value),1)],2)),[[W(s),{content:u.value||void 0}]])],void 0,0),qe(Te("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":x[0]||(x[0]=O=>u.value=O),class:se(I.$style["label-editor"]),placeholder:e.placeholder,maxlength:e.maxLength,onKeydown:y,onBlur:b},null,42,cse),[[lr,d.value],[Q1,u.value]])]),_:2},[!e.disabled&&!e.readOnly?{name:"suffix",fn:be(({hovered:O,focused:N})=>[O?(K(),ce("div",use,[O&&!N?qe((K(),ze(pt,{key:0,variant:["icon","secondary"],size:24,onClick:Nt(_,["prevent","stop"]),tabindex:"0",ref_key:"editButtonRef",ref:T,onKeydown:[Yn(Nt(_,["prevent","stop"]),["enter"]),Yn(Nt(E,["prevent","stop"]),["escape"])]},{default:be(()=>[ye(W(ct),{src:"Pen",source:"remote"})]),_:1},8,["onKeydown"])),[[W(s),"Edit"]]):Xe("",!0)])):Xe("",!0)]),key:"0"}:void 0]),1040,["bordered"])),[[W(o),{isLoading:L.value}]])}}),[["__cssModules",{$style:{"label-renderer":"_label-renderer_cyzth_1","label-editor":"_label-editor_cyzth_10"}}]]),hse=["tabindex"],IN=bt(tt({name:"SceneNameEditor",__name:"SceneNameEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},placeholder:{default:"Enter name"}},emits:["update:value","enter","blur"],setup(e,{expose:t,emit:n}){const o=Kt,s=Ns,r=e,i=n,a=H(r.value),l=H(r.value),c=H(null),u=H(null),d=In("bulkUpdate",!1),{apiServices:h}=io(!d,r),f=Y(()=>{var q;return{componentType:void 0,disabled:r.disabled,error:!1,readOnly:r.readOnly,isEmpty:((q=a==null?void 0:a.value)==null?void 0:q.length)===0,inputRef:c,wrapperRef:u,clickable:!0}}),{isFocus:p}=To(f),g=Y(()=>{const q=fn.getInstance().getItem("ws.code"),V=fn.getInstance().getItem("BASE_URL"),k=q||r.workspaceId;return ls({type:"scene_hub",config:{baseDomain:V,ws_code:k,scene_id:String(r.id)}}).url}),v=Y(()=>{var q,V,k;return((V=(q=r.data)==null?void 0:q.isProcessing)==null?void 0:V.state)==0||((k=r.data)==null?void 0:k.isDeleted)==!0}),C=Y(()=>r.readOnly||E.value),S=Y(()=>{var q,V,k,G,ee;return((q=r.data)==null?void 0:q.isDeleted)==!0||((k=(V=r.data)==null?void 0:V.isProcessing)==null?void 0:k.state)==0||((ee=(G=r.data)==null?void 0:G.isProcessing)==null?void 0:ee.state)==1}),b=Y(()=>{var q,V;return(V=(q=r.data)==null?void 0:q.isProcessing)==null?void 0:V.message}),y=Y(()=>{var q;return((q=r.data)==null?void 0:q.isArchived)==1}),_=Y(()=>{var q;return((q=r.data)==null?void 0:q.isLocked)==1}),E=Y(()=>r.value===void 0),D=Y(()=>{var q,V;return((V=(q=r.data)==null?void 0:q.permissions)==null?void 0:V.has_edit_permission)==1}),T=async q=>{var V,k,G,ee,ge,Fe,Ge,fe,X,we;a.value=q,p.value=!1;try{const de=await((k=(V=h.value)==null?void 0:V.updateSceneName)==null?void 0:k.call(V,{workspaceId:r.workspaceId,entityId:r.entityId,itemId:r.id,name:a.value})),B=lv.get(rF)||"UTC";if(de){const te=cF(de,B),ne={...r.data,...te};(G=r.params)==null||G.api.clearFocusedCell();const oe=((ge=(ee=r.params)==null?void 0:ee.column)==null?void 0:ge.getColId())||"",ae=((Ge=(Fe=r.params)==null?void 0:Fe.node)==null?void 0:Ge.rowIndex)||0;(fe=r.params)==null||fe.api.setFocusedCell(ae,oe),(we=(X=r.params)==null?void 0:X.node)==null||we.setData(ne),l.value=a.value,i("enter")}else a.value=l.value}catch(de){console.error("Failed to update scene name:",de),a.value=l.value}},P={focus:()=>{p.value=!0,ft(()=>{var q;return(q=u.value)==null?void 0:q.focus()})},startEdit:()=>{var q;(q=u.value)==null||q.startEdit()}},L=()=>u.value?"$el"in u.value?u.value.$el:u.value:null;Qe(()=>r.value,q=>{a.value=q,l.value=q}),en(()=>{const q=L();q&&(q.__sceneNameEditor=P)}),Jn(()=>{const q=u.value,V=q&&"$el"in q?q.$el:q;V&&delete V.__sceneNameEditor});const I=Vf(),{openSceneHub:x}=I,O=q=>{try{if(q.ctrlKey||q.metaKey){window.open(g.value,"_blank");return}x(String(r.id))}catch{window.open(g.value,"_blank")}finally{Q()}},N=()=>{setTimeout(()=>{re.value=!0,F.value=0,ft(()=>{var q;(q=z.value)==null||q.focus()})},300)},F=H(-1),z=H(null);t({focus:N,trigerFocus:N,startEdit:()=>{var q;(q=u.value)==null||q.startEdit()}});const j=q=>{if(q.key==="Enter"){q.preventDefault(),O(q);return}if(q.key==="Escape"){q.preventDefault(),Q();return}q.key==="Tab"&&(q.preventDefault(),q.stopPropagation(),q.stopImmediatePropagation(),ft(()=>{var V;(V=u.value)==null||V.focusEditButton()}))},Q=()=>{var k,G,ee,ge,Fe,Ge;re.value=!1,F.value=-1,(k=r.params)==null||k.api.clearFocusedCell();const q=((ee=(G=r.params)==null?void 0:G.column)==null?void 0:ee.getColId())||"",V=((Fe=(ge=r.params)==null?void 0:ge.node)==null?void 0:Fe.rowIndex)||0;(Ge=r.params)==null||Ge.api.setFocusedCell(V,q)},re=H(!1);return(q,V)=>qe((K(),ze(dse,{"save-on-blur":!0,ref_key:"wrapperRef",ref:u,disabled:r.disabled,"read-only":C.value,placeholder:r.placeholder,value:a.value,"onUpdate:value":V[0]||(V[0]=k=>a.value=k),id:`scene-name-${r.id}`,onEnter:T,"max-length":255,bordered:!0,keyboardFocusing:re.value,onBlur:Q},{default:be(({isHover:k,isEditting:G})=>[qe(Te("div",{class:se(q.$style["scene-name-display"])},[qe((K(),ce("a",{tabindex:F.value,ref_key:"nameRef",ref:z,onClick:Nt(O,["prevent"]),onKeydown:j,target:"_blank",class:se(q.$style["scene-name-text"]),style:{lineHeight:"28px"}},[nt(it(a.value),1)],42,hse)),[[W(o),{content:a.value,delay:[1e3,0]}]]),C.value||!k&&!G&&!C.value?(K(),ce(Ft,{key:0},[_.value?qe((K(),ce("div",{key:0,class:se([q.$style["icon-processing"],q.$style.isLocked])},[ye(ct,{src:"Lock",color:D.value?"#a6a6a6":"#232323"},null,8,["color"])],2)),[[W(o),{content:D.value?"Locked — You can still edit, or unlock by changing the status from completed":"Locked",delay:[1e3,0]}]]):Xe("",!0),y.value?qe((K(),ce("div",{key:1,class:se([q.$style["icon-processing"],q.$style.archived])},[ye(ct,{src:"BoxArchive"})],2)),[[W(o),{content:"Archived",delay:[1e3,0]}]]):Xe("",!0),S.value?qe((K(),ce("div",{key:2,class:se([q.$style["icon-processing"],q.$style.processing,v.value&&q.$style["icon-red"]])},[ye(ct,{src:"AnimatedHourglass",color:"inherit"})],2)),[[W(o),b.value]]):Xe("",!0)],64)):Xe("",!0)],2),[[lr,!W(p)]])]),_:1},8,["disabled","read-only","placeholder","value","id","keyboardFocusing"])),[[W(s),{isLoading:E.value}]])}}),[["__cssModules",{$style:{"scene-name-editor":"_scene-name-editor_nare0_1","scene-name-display":"_scene-name-display_nare0_11","icon-processing":"_icon-processing_nare0_18",archived:"_archived_nare0_28",locked:"_locked_nare0_31",processing:"_processing_nare0_34","icon-red":"_icon-red_nare0_38","scene-name-text":"_scene-name-text_nare0_43"}}]]),J0=bt(tt({__name:"ButtonDropdown",props:{label:{},value:{},variant:{},options:{default:()=>[]},size:{},placement:{default:"bottom"},disabled:{type:Boolean},readOnly:{type:Boolean},tabIndex:{}},emits:["select","handleClick","open"],setup(e,{expose:t,emit:n}){const o=Uo,s=H([]),r=e,i=H(null),a=Y(()=>typeof r.size=="number"?`${r.size}px`:{small:"24px",medium:"32px",large:"48px"}[r.size]??"32px"),l=Y(()=>{let C=[];return typeof r.variant=="string"?C.push(r.variant):Array.isArray(r.variant)&&(C=[...r.variant]),[...C,"icon"]}),c=n,{hide:u,isVisible:d,show:h,triggerRef:f,popupRef:p,instance:g}=mo({toggleOnClick:!0,offset:[0,0],onShow:()=>c("open")});function v(C){c("select",C),u()}return Mh(()=>{g.value&&g.value.setProps({placement:r.placement})}),t({show:h,hide:u,hideDropdown:()=>{u()},popupRef:p}),Qe(d,C=>{var S;C&&((S=p.value)==null||S.focus())}),(C,S)=>(K(),ce("div",{class:se(C.$style["button-dropdown-wrapper"]),style:hn({"--button-size":a.value})},[Te("div",{class:se(C.$style["button-group"])},[xt(C.$slots,"prefix"),Te("div",{ref_key:"triggerRef",ref:f,class:se(W(d)?C.$style.open:"")},[xt(C.$slots,"triggerDropdown",{open:W(d)},()=>[r.readOnly?Xe("",!0):qe((K(),ze(pt,{key:0,onEscape:W(u),ref_key:"mainButton",ref:i,actived:W(d),class:se(C.$style["button-dropdown-trigger"]),variant:l.value,size:e.size,disabled:r.disabled},{default:be(()=>[xt(C.$slots,"iconDropdown",{},()=>[ye(ct,{class:se(C.$style["icon-dropdown"]),src:"ChevronDown",source:"remote"},null,8,["class"])])]),_:3},8,["onEscape","actived","class","variant","size","disabled"])),[[W(o),e.tabIndex]])])],2)],2),Te("div",{ref_key:"popupRef",ref:p,tabindex:"0",class:se(C.$style["button-dropdown-list"]),style:{borderRadius:"var(--radius-lg)",overflow:"hidden"}},[(K(!0),ce(Ft,null,Pn(e.options,(b,y)=>qe((K(),ze(Ec,jt({ref_for:!0,ref:_=>s.value[y]=_,key:b.value},{ref_for:!0},{...b},{"icon-name":b.icon,onClick:Nt(_=>v(b.value||""),["stop","prevent"]),style:{borderLeft:0}}),{label:be(()=>[nt(it(b.label),1)]),_:2},1040,["icon-name","onClick"])),[[W(o),`${e.tabIndex}.${y}`]])),128))],2)],6))}}),[["__cssModules",{$style:{"button-dropdown-wrapper":"_button-dropdown-wrapper_1g99p_1","button-group":"_button-group_1g99p_7","overflow-elipsis":"_overflow-elipsis_1g99p_26","button-dropdown-list":"_button-dropdown-list_1g99p_33",show:"_show_1g99p_38","button-dropdown-item":"_button-dropdown-item_1g99p_41","icon-dropdown":"_icon-dropdown_1g99p_48",open:"_open_1g99p_51"}}]]),sp=bt(tt({__name:"CloseBadgeWrapper",props:{disableRemove:{type:Boolean,default:!0},tooltip:{default:"Unassign"}},emits:["clear"],setup(e,{emit:t}){const n=Kt,o=e,s=t,r=a=>{a.preventDefault(),a.stopImmediatePropagation(),a.stopPropagation(),s("clear")},i=Y(()=>({content:o.tooltip,contentClass:"extra-padding",appendTo:()=>globalThis.document.body}));return(a,l)=>(K(),ce("div",{class:se(a.$style["close-wrapper"])},[e.disableRemove?Xe("",!0):(K(),ce("div",{key:0,class:se(a.$style["close-button"])},[qe((K(),ze(pt,{variant:["icon","tertiary"],style:{background:"white"},"aria-label":"remove",onClick:r,size:16,rounded:!0},{default:be(()=>[ye(ct,{src:"CircleXMark",size:"16",color:"var(--primary-color)"})]),_:1})),[[W(n),i.value]])],2)),xt(a.$slots,"default")],2))}}),[["__cssModules",{$style:{"close-wrapper":"_close-wrapper_15u1e_1","close-button":"_close-button_15u1e_5"}}]]),fse=bt(tt({name:"AssigneeGroupRenderer",__name:"AssigneeGroupRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},maxVisible:{default:4}},setup(e){const t=Kt,n=Ns,o=e,{isEditing:s}=td(o),r=H(o.value),i=H(null),a=H(null),{apiServices:l}=io(!0,o),c=H(!0),u=()=>{c.value=o.value===void 0};Oh(()=>{u()}),en(()=>{u()}),Qe(()=>o.value,T=>{u()});const d=Y(()=>({disabled:o.disabled,readOnly:o.readOnly,error:o.error,inputRef:i,wrapperRef:a,clickable:!(o.readOnly||c.value),active:s})),{argsMain:h,isHover:f}=To(d),p=Y(()=>{var T;return((T=r.value)==null?void 0:T.slice(0,o.maxVisible))||[]}),g=Y(()=>{var T;return Math.max(0,(((T=r.value)==null?void 0:T.length)||0)-o.maxVisible)}),v=Y(()=>{var T;return g.value<=0?"":((T=r.value)==null?void 0:T.slice(o.maxVisible).map(P=>P.name).join(", "))||""}),C=Y(()=>p.value.map(T=>({id:T.id,name:T.name,initial:T.initial,avatarId:T.id,profile_image:T.profile_image,color:T.color,size:24,user:T}))),S=Y(()=>({color:f.value?"var(--primary-color)":"var(--grey-300)",display:"flex",alignItems:"center",marginLeft:"4px"}));Qe(()=>o.value,T=>{r.value=T},{immediate:!0,deep:!0});const b=async T=>{var L,I,x;await D(T)&&(r.value=(L=r.value)==null?void 0:L.filter(O=>O.id!==T),(x=o.params)==null||x.node.setData({...(I=o.params)==null?void 0:I.node.data,assignees:r.value}))},y=T=>{var L;const P=fn.getInstance().getItem("ws.code");return((L=l.value)==null?void 0:L.getUserInformation(P,T))||Promise.resolve(null)},{id:_}=Ag(o),E=T=>{var L,I;const P=(I=(L=o.params)==null?void 0:L.api)==null?void 0:I.getRowNode(String(_.value));P==null||P.setDataValue("assignees",Hm(T.assignees))},{removeAssignee:D}=hv({...o,entityId:o.entityId,updateRowData:E,value:o.value,errorCallback:()=>{}});return(T,P)=>qe((K(),ze(Fo,jt(W(h),{ref_key:"wrapperRef",ref:a,bordered:!0}),{default:be(()=>{var L;return[Te("div",{class:se(T.$style.assigneeGroupRenderer)},[((L=r.value)==null?void 0:L.length)===0?(K(),ze(ct,{key:0,src:"UserPlus",source:"remote",color:"#6B6B6B",style:hn(S.value)},null,8,["style"])):Xe("",!0),(K(!0),ce(Ft,null,Pn(C.value,I=>(K(),ze(sp,{key:I.id,"disable-remove":o.readOnly||o.disabled,onClear:x=>b(I.id),style:{marginLeft:"0"}},{default:be(()=>[ye(nd,{user:I.user,"show-profile":!0,apiUpdateFunction:y,class:se(T.$style["ib-assignee-avatar"])},null,8,["user","class"])]),_:2},1032,["disable-remove","onClear"]))),128)),g.value>0?qe((K(),ce("div",{key:1,class:se(T.$style["extra-avatars"])},[nt(" +"+it(g.value),1)],2)),[[W(t),v.value]]):Xe("",!0)],2)]}),_:1},16)),[[W(n),{isLoading:c.value}]])}}),[["__cssModules",{$style:{assigneeGroupRenderer:"_assigneeGroupRenderer_14fiu_1","ib-assignee-group-renderer":"_ib-assignee-group-renderer_14fiu_7","ib-assignee-avatar":"_ib-assignee-avatar_14fiu_16","assignee-wrapper":"_assignee-wrapper_14fiu_20","extra-avatars":"_extra-avatars_14fiu_27"}}]]),pse=bt(tt({name:"DateRangeRenderer",__name:"DateRangeRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!1},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{}},setup(e){var E,D;const t=Kt,n=Ns,o=xS(),s=e,r=H(null),i=H(null),{isEditing:a}=td(s),l=T=>{if(T){if(typeof T=="string")return T;if(T instanceof Date)return T.toISOString()}},c=Y(()=>s.value===void 0),u=Y(()=>{var T;return(T=s.data)==null?void 0:T.isStarted}),d=Y(()=>{var T;return(T=s.data)==null?void 0:T.isCompleted}),h=Y(()=>!!(s.value&&(s.value[0]||s.value[1]))),f=Y(()=>h.value?s.disabled&&!s.readOnly?"var(--disabled-color)":"var(--primary-color)":"var(--grey-300)"),p=Y(()=>({disabled:s.disabled,error:!1,readOnly:s.readOnly,inputRef:r,wrapperRef:i,clickable:!0,active:a})),{argsMain:g}=To(p),{startDate:v,endDate:C,startClasses:S,endClasses:b,fullStartDate:y,fullEndDate:_}=FY({start:l((E=s.value)==null?void 0:E[0]),end:l((D=s.value)==null?void 0:D[1]),isStarted:u.value,isEnded:d.value,timezone:s.timezone||o});return(T,P)=>qe((K(),ze(Fo,jt(W(g),{ref_key:"wrapperRef",ref:i,bordered:!0}),{default:be(()=>[c.value?Xe("",!0):(K(),ce("div",{key:0,class:se(T.$style.dateRangeRenderer)},[h.value?Xe("",!0):(K(),ze(ct,{key:0,src:"Calendar",class:se(T.$style.calendarIcon),color:f.value},null,8,["class","color"])),h.value?(K(),ce(Ft,{key:1},[qe((K(),ce("span",{class:se([T.$style.dateLabelDisplay,...W(S).map(L=>T.$style[L])])},[nt(it(W(v)),1)],2)),[[W(t),W(y)]]),P[0]||(P[0]=Te("span",null,"→",-1)),qe((K(),ce("span",{class:se([T.$style.dateLabelDisplay,...W(b).map(L=>T.$style[L])])},[nt(it(W(C)),1)],2)),[[W(t),W(_)]])],64)):Xe("",!0)],2))]),_:1},16)),[[W(n),{isLoading:c.value}]])}}),[["__cssModules",{$style:{dateRangeRenderer:"_dateRangeRenderer_rsfrm_1",calendarIcon:"_calendarIcon_rsfrm_8",dateSection:"_dateSection_rsfrm_12",dateLabelDisplay:"_dateLabelDisplay_rsfrm_19",empty:"_empty_rsfrm_29","end-today":"_end-today_rsfrm_35",actual:"_actual_rsfrm_38","end-tomorrow":"_end-tomorrow_rsfrm_41","end-yesterday":"_end-yesterday_rsfrm_47","end-past":"_end-past_rsfrm_53","end-future":"_end-future_rsfrm_59","start-today":"_start-today_rsfrm_62","start-tomorrow":"_start-tomorrow_rsfrm_68","start-yesterday":"_start-yesterday_rsfrm_74","start-past":"_start-past_rsfrm_80","start-future":"_start-future_rsfrm_86"}}]]),gse=tt({__name:"DateRangeEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{default:void 0},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{default:xS()}},emits:["closed"],setup(e,{expose:t,emit:n}){const o=H(null);en(()=>{ft(()=>{o.value&&o.value.focus()})});const s=e,r=n,i=()=>{var C;(C=s.params)==null||C.api.stopEditing(),r("closed")},a=C=>`${St.fromJSDate(C,{zone:"utc"}).toFormat("yyyy-MM-dd'T'HH:mm:ss.SSS")}999Z`,l=async C=>{await v({startDate:C[0]?a(C[0]):null,dueDate:C[1]?a(C[1]):null})},c=async()=>{await v({startDate:null})},u=async()=>{await v({dueDate:null})},d=async C=>{await v({startDate:C?a(C):null})},h=async C=>{await v({dueDate:C?a(C):null})},f=async()=>{await v({startDate:null,dueDate:null})},p=In("bulkUpdate",!1),{apiServices:g}=io(!p,s),v=async C=>{var S,b,y,_,E;try{const D=(S=o.value)==null?void 0:S.getValues(),T=await((y=(b=g.value)==null?void 0:b.changeDate)==null?void 0:y.call(b,{workspaceId:s.workspaceId,itemIds:[s.id],startDate:C.startDate,dueDate:C.dueDate}));T!=null&&T.message&&((E=s.params)==null||E.node.setData({...(_=s.params)==null?void 0:_.node.data,dateRange:D==null?void 0:D.dateRange}))}catch(D){console.error("Failed to update scene name:",D)}};return t({focus:()=>{ft(()=>{var C;(C=o.value)==null||C.focus()})}}),(C,S)=>(K(),ze(Dv,jt(s,{onUpdate:l,"onUpdate:end":h,"onUpdate:start":d,onClearAll:f,onClearDue:u,onClearStart:c,onClosed:i,ref_key:"calendarRef",ref:o}),null,16))}}),mse=bt(tt({__name:"item-table-layout",props:{isSidebarOpen:{type:Boolean,default:!1}},emits:["close-sidebar","sidebar-clear","sidebar-apply"],setup(e,{emit:t}){const n=H(null),o=H(0);let s=null;en(()=>{n.value&&(s=new ResizeObserver(i=>{for(const a of i)o.value=a.contentRect.height}),s.observe(n.value))}),Zl(()=>{s&&n.value&&s.unobserve(n.value)});const r=Y(()=>{const i=o.value;return i>120?i-42-36:0});return(i,a)=>(K(),ce("div",{class:se(i.$style["item-table-wrapper"]),ref_key:"itemTableWrapperRef",ref:n},[Te("div",{class:se(i.$style["item-header"])},[Te("div",{class:se(i.$style["item-header__left"])},[xt(i.$slots,"header-left",{},()=>[Te("h1",{class:se(i.$style["item-header__title"])},[xt(i.$slots,"title",{},()=>[a[0]||(a[0]=nt("Items",-1))])],2)])],2),Te("div",{class:se(i.$style["item-header__spacer"])},null,2),Te("div",{class:se(i.$style["item-header__actions"])},[xt(i.$slots,"header-actions")],2)],2),xt(i.$slots,"grid",{availableHeight:r.value}),Te("div",{class:se(i.$style.footer)},[xt(i.$slots,"footer")],2),xt(i.$slots,"new-row"),xt(i.$slots,"bulk-update-actions"),xt(i.$slots,"snackbar"),xt(i.$slots,"popup")],2))}}),[["__cssModules",{$style:{"item-table-wrapper":"_item-table-wrapper_1uqb9_1","item-header":"_item-header_1uqb9_14","item-header__left":"_item-header__left_1uqb9_22","item-header__title":"_item-header__title_1uqb9_27","item-header__spacer":"_item-header__spacer_1uqb9_32","item-header__actions":"_item-header__actions_1uqb9_35","main-content":"_main-content_1uqb9_41",sidebar:"_sidebar_1uqb9_48","is-open":"_is-open_1uqb9_64","sidebar-header":"_sidebar-header_1uqb9_68","sidebar-footer":"_sidebar-footer_1uqb9_69","sidebar-content":"_sidebar-content_1uqb9_89",footer:"_footer_1uqb9_94"}}]]),xN=bt(tt({name:"MoreOptionEditor",__name:"MoreOptionEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},optionBlock:{},isSubmenu:{type:Boolean,default:!1},layer:{default:0},focusableIndex:{}},emits:["actionExecuted"],setup(e,{expose:t,emit:n}){const o=Uo,s=e,r=Y(()=>(s==null?void 0:s.workspaceId)||""),i=Y(()=>(s==null?void 0:s.entityId)||""),a=()=>{var N,F,z;return(z=(N=s.params)==null?void 0:N.api)==null?void 0:z.getCellRendererInstances({columns:["options"],rowNodes:(F=s.params)!=null&&F.node?[s.params.node]:[]})[0]},l=()=>{var F,z,j,Q;const N=a();(z=(F=N==null?void 0:N.componsenExposed)==null?void 0:F.blur)==null||z.call(F),(Q=(j=N==null?void 0:N.container)==null?void 0:j.parentElement)==null||Q.classList.remove("ag-cell-focus")},c=()=>{var z,j,Q;(j=(z=s.params)==null?void 0:z.api)==null||j.stopEditing(),l();const N=`scene-name-${s.id}`,F=document.getElementById(N);(Q=F==null?void 0:F.__sceneNameEditor)==null||Q.startEdit()},{apiServices:u}=io(!0,s),d=Y(()=>{var N;return{ws_code:r.value,entity_id:i.value,scene_id:s.id,axiosService:u,optionBlock:s.optionBlock,permissions:(N=s.data)==null?void 0:N.permissions}}),h=N=>{var z,j,Q,re,q,V;let F=(j=(z=s.params)==null?void 0:z.api)==null?void 0:j.getRowNode(String(s.id));if(F){const k={...F.data,isDeleted:N==="deleted",isArchived:N==="archived"?!0:F.data.isArchived,isLocked:N==="locked"?!0:F.data.isLocked,disabled:!1};N=="deleted"&&(k.isLocked=!1,k.disabled=!0),N=="unarchived"&&(k.isArchived=!1),(re=(Q=s.params)==null?void 0:Q.api)==null||re.redrawRows({rowNodes:[F]}),F.setData(k),(V=(q=s.params)==null?void 0:q.api)==null||V.redrawRows({rowNodes:[F]})}},f=Vf(),{openSceneHub:p}=f,g=()=>{ft(()=>{var z,j,Q,re,q,V;const N=((j=(z=s.params)==null?void 0:z.node)==null?void 0:j.rowIndex)||0,F=((re=(Q=s.params)==null?void 0:Q.column)==null?void 0:re.getColId())||"";(V=(q=s.params)==null?void 0:q.api)==null||V.setFocusedCell(N,F)})};Y(()=>{var F,z;const N=(z=(F=s.params)==null?void 0:F.api)==null?void 0:z.getRowNode(String(s.id));return N==null?void 0:N.data});const{options:v}=hJ(d,h,c,p,g),C=n,S=()=>{var N,F,z,j,Q,re;console.trace("Focusing current cell for row:",s.id),(re=(N=s.params)==null?void 0:N.api)==null||re.setFocusedCell(((z=(F=s.params)==null?void 0:F.node)==null?void 0:z.rowIndex)||0,((Q=(j=s.params)==null?void 0:j.column)==null?void 0:Q.getColId())||"")},b=Y(()=>{var N;return(N=s.params)==null?void 0:N.api}),y=(N,F)=>{var z,j,Q,re,q,V,k,G;if(C("actionExecuted",N),N.id=="copy-link"){(q=b.value)==null||q.startEditingCell({rowIndex:(j=(z=s.params)==null?void 0:z.node)==null?void 0:j.rowIndex,colKey:(re=(Q=s.params)==null?void 0:Q.column)==null?void 0:re.getColId()});return}else{if(N.id!=="copy-link"&&((V=b.value)==null||V.stopEditing()),N.id==="rename")(k=b.value)==null||k.stopEditing(),(G=b.value)==null||G.clearFocusedCell(),l();else if(N.id==="copy-link"){const ee=document.getElementById(F);setTimeout(()=>{var ge,Fe,Ge;(Ge=(Fe=(ge=ee==null?void 0:ee.__vueParentComponent)==null?void 0:ge.exposed)==null?void 0:Fe.focus)==null||Ge.call(Fe)},300)}else if(["delete-rendition","delete-thumbnail"].includes(N.id)){setTimeout(()=>{S()},300);return}setTimeout(()=>{var ee,ge;(ge=(ee=s.params)==null?void 0:ee.api)==null||ge.clearFocusedCell()},300)}},_=()=>{var N,F;(F=(N=s.params)==null?void 0:N.api)==null||F.stopEditing()},E=N=>{var F,z,j,Q;return N==="archive"?!((z=(F=s.params)==null?void 0:F.data)!=null&&z.isArchived):N==="unarchive"?(Q=(j=s.params)==null?void 0:j.data)==null?void 0:Q.isArchived:!0},D=Y(()=>v.value.map(N=>({...N,options:N.options.filter(F=>!F.hide&&E(F.id))})).filter(N=>N.options.length>0)),T=H({}),P=H(null),L=Y(()=>{var F,z;if(s.focusableIndex)return s.focusableIndex;const N=(z=(F=s.params)==null?void 0:F.api)==null?void 0:z.getRowNode(String(s.id));return`${((N==null?void 0:N.rowIndex)??0)+10}`}),I=(N,F)=>`${L.value}.${N*10+F}`,x=(N,F)=>{if(F&&"focus"in F){T.value[N]=F;return}delete T.value[N]},O=N=>{N.preventDefault(),N.stopPropagation(),N.stopImmediatePropagation()};return en(()=>{var N;(N=P.value)==null||N.focus()}),t({focus(){var z;const N=`${L.value}.0`,F=T.value[N];F&&F.focus?F.focus():(z=P.value)==null||z.focus()}}),(N,F)=>qe((K(),ce("div",{onKeydown:O,class:se([N.$style["more-option-section"],{[N.$style.submenu]:e.isSubmenu}]),ref_key:"wrapperRef",ref:P,tabindex:"0",role:"menu"},[(K(!0),ce(Ft,null,Pn(D.value,(z,j)=>(K(),ce("div",{key:z.id,style:hn({"--g-number":Math.min(z.options.length,4),"--g-size":z.type==="column"?"36px":"auto"}),class:se([N.$style["option-block"],N.$style[z.type]])},[(K(!0),ce(Ft,null,Pn(z.options,(Q,re)=>(K(),ce("div",{key:Q.id,class:se(N.$style["option-item"])},[ye(yse,{layer:s.layer,"scene-id":String(s.id),option:Q,type:z.type,onActionExecuted:q=>y(q,`more-action-${q.id}-${s.id}`),focusableIndex:I(j,re),ref_for:!0,ref:q=>x(I(j,re),q),onHandleHide:_,id:`more-action-${Q.id}-${s.id}`,label:Q.label},null,8,["layer","scene-id","option","type","onActionExecuted","focusableIndex","id","label"])],2))),128))],6))),128))],34)),[[W(o),L.value]])}}),[["__cssModules",{$style:{"more-option-section":"_more-option-section_1jg4p_1","option-block":"_option-block_1jg4p_8","option-item":"_option-item_1jg4p_15",row:"_row_1jg4p_19",column:"_column_1jg4p_25",block:"_block_1jg4p_29"}}]]),vse={key:0,style:{height:"20px",width:"20px",display:"flex","align-items":"center","justify-content":"center"}},yse=bt(tt({__name:"MoreOptionItem",props:{option:{},sceneId:{},type:{},layer:{},focusableIndex:{}},emits:["actionExecuted","handleHide"],setup(e,{expose:t,emit:n}){const o=Uo,s=Kt,r=e,i=H(!1),a=H(!1),l=(T,P)=>{if(!P){p();return}const L=P.target;L.closest(".tippy-content")||L.closest(".tippy-box")||L.closest("[data-tippy-root]")||L.closest(".option-item")||p()},c=H(null),{triggerRef:u,popupRef:d,show:h,isVisible:f,hide:p}=mo({toggleOnClick:!0,interactive:!0,trigger:"click",placement:"left",showArrow:!1,offset:[0,4],hideOnClick:!1,allowHTML:!0,onClickOutside:l,appendTo:c.value||void 0}),g=n,v=async T=>{var P,L;if(!a.value){a.value=!0;try{await((L=(P=r.option).action)==null?void 0:L.call(P,T)),g("actionExecuted",r.option)}catch(I){console.error("Action execution failed:",I)}finally{a.value=!1,i.value=!1}}},C=async T=>{var P,L;if(T.preventDefault(),T.stopPropagation(),!a.value){if(r.option.isDanger){i.value=!i.value;return}if(r.option.subMenu)h();else{a.value=!0;try{await((L=(P=r.option).action)==null?void 0:L.call(P,T)),g("actionExecuted",r.option)}catch(I){console.error("Action execution failed:",I)}finally{a.value=!1}return}}},S=T=>{g("actionExecuted",T),p()},b=T=>{T.key==="Escape"&&p()},y=T=>({row:"small",column:"medium",block:"small"})[T]||"medium",_=T=>{const P=r.option.isDanger?["danger","tertiary"]:[];return{row:["secondary","icon",...P],column:["menu-item",...P],block:["secondary",...P]}[T]||[]},E=()=>{i.value?i.value=!1:f.value?p():g("handleHide")};t({focus:()=>{ft(()=>{u.value instanceof HTMLElement?u.value.focus():u.value&&"$el"in u.value?u.value.$el.focus():console.warn("Trigger ref is not an HTMLElement:",u.value)})},escape:()=>{p()},select:()=>{C(new MouseEvent("click"))}});const D=T=>{var P;T.stopPropagation(),T.preventDefault(),i.value=!1,(P=u.value)==null||P.focus()};return(T,P)=>{var L;return qe((K(),ce("div",{ref_key:"wrapperRef",ref:c,class:se(T.$style["option-item-wrapper"]),style:{width:"100%",overflow:"visible"},onClick:Nt(C,["stop","prevent"])},[qe((K(),ze(pt,{ref_key:"triggerRef",ref:u,class:se(T.$style["option-item"]),disabled:e.option.disabled||a.value,actived:W(f)||i.value,size:y(e.type),variant:_(e.type),onClick:Nt(C,["stop","prevent"]),onKeydown:b,onEscape:E,label:e.option.label},{prefix:be(()=>[e.option.icon?(K(),ce("div",vse,[ye(ct,{size:"14",src:e.option.icon,color:e.option.isDanger?void 0:"#a6a6a6",source:"remote"},null,8,["src","color"])])):Xe("",!0)]),suffix:be(()=>[e.option.subMenu?(K(),ze(ct,{key:0,src:"Play",source:"remote"})):Xe("",!0),e.option.isDanger&&i.value?(K(),ce("div",{key:1,class:se(T.$style["confirm-action"])},[qe((K(),ze(pt,{variant:["tertiary","icon","danger"],size:"small",onHandleClick:D},{default:be(()=>[ye(ct,{src:"XMarkSolid",source:"remote"})]),_:1})),[[W(o),`${r.focusableIndex}.0`],[W(s),{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),qe((K(),ze(pt,{variant:["danger","primary","icon"],size:"small",onClick:Nt(v,["stop","prevent"]),onEscape:P[0]||(P[0]=I=>i.value=!1)},{default:be(()=>[ye(ct,{src:"Check",source:"remote"})]),_:1})),[[W(o),`${r.focusableIndex}.1`],[W(s),{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Xe("",!0)]),_:1},8,["class","disabled","actived","size","variant","label"])),[[W(o),r.focusableIndex]]),e.option.subMenu?(K(),ce("div",{key:0,ref_key:"popupRef",ref:d,class:se(T.$style["submenu-container"])},[ye(xN,{focusableIndex:r.focusableIndex,layer:r.layer+1,ref:"submenuRef","option-block":[((L=e.option)==null?void 0:L.subMenu)||[]],"is-submenu":!1,onActionExecuted:S},null,8,["focusableIndex","layer","option-block"])],2)):Xe("",!0)],2)),[[W(s),{content:e.option.description,contentClass:["extra-padding"],theme:e.option.isDanger?"warning":"arbo",hideOnClick:!1,delay:[300,0]}]])}}}),[["__cssModules",{$style:{"option-item":"_option-item_8a5qn_1","icon-wrapper":"_icon-wrapper_8a5qn_11","confirm-action":"_confirm-action_8a5qn_19"}}]]),PN=(e,t)=>{const n=H(Number(e.value.value)),o=Y(()=>e.value.metricConfig),s=Y(()=>{var g,v;const l=o.value,c=t.value,u=e.value.value=="N/A"||e.value.value===null||e.value.value===void 0||String(e.value.value).length===0,d=!!e.value.error,h=(l==null?void 0:l.format_type)==="icon",{disabled:f}=e.value;return{pendingCalculation:e.value.value=="N/A"||u&&((g=l==null?void 0:l.metric_type)==null?void 0:g.code)==="formula",isEmpty:u,isError:d,hasPrefix:!u&&!d&&(l==null?void 0:l.morpheme_type)==="prefix",hasSuffix:!u&&!d&&(l==null?void 0:l.morpheme_type)==="suffix",isDropdown:(l==null?void 0:l.format_type)==="dropdown",isFormula:((v=l==null?void 0:l.metric_type)==null?void 0:v.code)==="formula",isLoading:e.value.value===void 0,isRating:h,showActions:c&&!u&&!f}}),r=17,i=Y(()=>{var l;return{maxRating:((l=o.value)==null?void 0:l.range)||5,readOnly:e.value.readOnly,disabled:e.value.disabled,size:r}});return{componentState:s,metricConfig:o,ICON_SIZE:r,ratingParams:i,standardNameforIcon:()=>{var c;return(((c=o.value)==null?void 0:c.format_symbol)||"BoltSolid").split(/[\s-_]+/).map(u=>u.charAt(0).toUpperCase()+u.slice(1)).join("").replace(/Outline|Solid/g,"")},internalValue:n}},wse=["aria-label"],kN=bt(tt({name:"MetricRenderer",__name:"MetricRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},config:{}},emits:["update:value","clear","copy"],setup(e,{emit:t}){const n=Ns,o=Kt,s=e,r=_h(!1),i=H(null),a=H(null),{isEditing:l}=td(s),c=Y(()=>{var F,z;return{value:s.value,metricConfig:((z=(F=s.params)==null?void 0:F.colDef)==null?void 0:z.context)||s.config,error:s.error,hovered:r.value,readOnly:s.readOnly,disabled:s.disabled,active:l}}),{componentState:u,metricConfig:d,internalValue:h}=PN(c,r),f=Y(()=>{var z,j;let F=!1;if(["number","formula"].includes(d.value.metric_type.code)){const Q=Number(s.value),re=Number((z=d.value)==null?void 0:z.format_value);Number.isFinite(re)&&re>=0&&(F=(((j=Q.toString().split(".")[1])==null?void 0:j.length)||0)>re)}return F}),p=Y(()=>{var F;return!!((F=d.value)!=null&&F.morpheme_value)||u.value.isEmpty||f.value}),g=Y(()=>{var j,Q,re;if(u.value.isError)return"Something went wrong. Review formula, inputs and retry.";if(u.value.pendingCalculation)return"Can’t calculate yet. Complete required fields.";if(u.value.isEmpty)return;const F=P.value,z=(j=d.value)==null?void 0:j.morpheme_type;return z==="prefix"?`${((Q=d.value)==null?void 0:Q.morpheme_value)||""} ${F}`.trim():z==="suffix"?`${F} ${((re=d.value)==null?void 0:re.morpheme_value)||""}`.trim():F}),v=Y(()=>{const{format_type:F,format_value:z}=d.value;if(F==="dropdown"&&typeof z=="string"&&z.startsWith("["))try{return JSON.parse(z)}catch{return[]}return[]}),C=Y(()=>({disabled:s.disabled,error:u.value.isError,inputRef:i,wrapperRef:a,clickable:!T.value,readOnly:s.readOnly||T.value,isEmpty:u.value.isEmpty})),{argsMain:S,isHover:b}=To(C),y=(F,z,j="en-US")=>new Intl.NumberFormat(j,{minimumFractionDigits:z,maximumFractionDigits:z}).format(F),_=Y(()=>{if(u.value.isEmpty)return"";if(u.value.pendingCalculation)return"pending";const F=s.value,{format_type:z,format_value:j,mapping:Q}=d.value;if(Q&&typeof Q=="object"&&!Array.isArray(Q)){const re=Q[`!${F}`];if(re)return re}if(z==="dropdown"){const re=v.value.find(q=>String(q.name)===String(F));if(re)return re.name}if(typeof F=="string"){const re=Number(F);return Number.isNaN(re)?F:F.replace(/[.-]/g,"").length>16?E(F,j):E(re,j)}return typeof F=="number"?E(F,j):String(F)}),E=(F,z)=>{const j=Number.parseInt(String(z)||"2",10),Q=Number.isFinite(j)&&j>=0?j:2;try{if(typeof F=="string"){const re=F.split("."),q=re[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),V=re[1]?re[1].substring(0,Q).padEnd(Q,"0"):"0".repeat(Q);return Q>0?`${q}.${V}`:q}return y(F,Q)}catch(re){return console.error("Error formatting metric value:",re,{num:F,decimals:Q}),String(F)}},D=(F,z)=>{const j=Number.parseInt(String(z)||"2",10),Q=Number.isFinite(j)&&j>=0?j:2;try{if(typeof F=="string"){const re=F.split("."),q=re[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),V=re[1]?re[1].length:0,k=Math.max(Q,V),G=re[1]?re[1].padEnd(k,"0"):"0".repeat(k);return k>0?`${q}.${G}`:q}return new Intl.NumberFormat("en-US",{minimumFractionDigits:Q,maximumFractionDigits:20}).format(F)}catch(re){return console.error("Error formatting exact metric value:",re,{num:F,decimals:Q}),String(F)}},T=Y(()=>{var F;return((F=d.value)==null?void 0:F.metric_type.code)==="formula"}),P=Y(()=>{if(u.value.isEmpty)return"";if(u.value.pendingCalculation)return"pending";const F=s.value,{format_type:z,format_value:j,mapping:Q}=d.value;if(Q&&typeof Q=="object"&&!Array.isArray(Q)){const re=Q[`!${F}`];if(re)return re}if(z==="dropdown"){const re=v.value.find(q=>String(q.name)===String(F));if(re)return re.name}if(typeof F=="string"){const re=Number(F);return Number.isNaN(re)?F:F.replace(/[.-]/g,"").length>16?D(F,j):D(re,j)}return typeof F=="number"?D(F,j):String(F)}),{tooltip:L}=pF(""),I=async F=>{F.stopPropagation(),F.preventDefault(),F.stopImmediatePropagation();try{await navigator.clipboard.writeText(P.value),L.value="Copied",setTimeout(()=>{L.value="Copy"},3e3)}catch(z){console.error("Failed to copy text:",z),L.value="Copy failed",setTimeout(()=>{L.value="Copy"},3e3)}};Qe(()=>s.value,(F,z)=>{const j=Number(F);Number.isFinite(j)&&j!==h.value?h.value=j:F==null&&h.value!==0&&(h.value=0)},{immediate:!0,deep:!0});const O=()=>{r.value=!0},N=()=>{r.value=!1};return(F,z)=>qe((K(),ze(Fo,jt(W(S),{onMouseenter:O,style:{"--icon-size":"24px"},onMouseleave:N,ref_key:"wrapperRef",ref:a,actived:W(l),bordered:!0}),{suffix:be(()=>[s.disabled?Xe("",!0):(K(),ce("div",{key:0,class:se([F.$style.suffix,"wrapper-suffix"])},[r.value&&!W(u).isEmpty&&!W(u).isError?qe((K(),ze(pt,{key:0,variant:["icon","secondary"],size:24,onClick:Nt(I,["prevent","stop"])},{default:be(()=>[ye(ct,{src:"Copy",source:"remote",size:12})]),_:1})),[[W(o),{content:W(L),hideOnClick:!1,contentClass:"extra-padding"}]]):Xe("",!0)],2))]),default:be(()=>[Te("div",{class:se(F.$style["metric-wrapper"]),"aria-label":W(d).format_value||void 0},[Te("div",{class:se([F.$style["metric-content"],s.disabled?F.$style.disabled:""])},[!W(u).isError&&W(u).isEmpty?(K(),ce(Ft,{key:0},[W(u).pendingCalculation?qe((K(),ce("span",{key:0,class:se(F.$style["metric-empty"])},[...z[0]||(z[0]=[nt(" - ",-1)])],2)),[[W(o),"Can’t calculate yet. Complete required fields."]]):W(u).isEmpty?(K(),ce("span",{key:1,class:se(F.$style["metric-empty"])}," - ",2)):Xe("",!0)],64)):Xe("",!0),W(u).isError?qe((K(),ce("div",{key:1,class:se(F.$style["metric-error"])},[...z[1]||(z[1]=[nt(" Error ",-1)])],2)),[[W(o),"Something went wrong. Review formula, inputs and retry."]]):Xe("",!0),!W(u).isEmpty&&!W(u).isError?qe((K(),ce("span",{key:2,class:se([F.$style["metric-value"],W(b)?F.$style.hovered:"",{[F.$style.disabled]:s.disabled}])},[nt(it(_.value),1)],2)),[[W(o),{content:g.value,bypassOverflowCheck:p.value}]]):Xe("",!0)],2)],10,wse)]),_:1},16,["actived"])),[[W(n),{isLoading:W(u).isLoading}]])}}),[["__cssModules",{$style:{"metric-wrapper":"_metric-wrapper_lu0ag_1","metric-content":"_metric-content_lu0ag_5",disabled:"_disabled_lu0ag_15","metric-value":"_metric-value_lu0ag_19",hovered:"_hovered_lu0ag_19","metric-error":"_metric-error_lu0ag_23","with-morpheme":"_with-morpheme_lu0ag_38","with-formula-icon":"_with-formula-icon_lu0ag_41","metric-value--number":"_metric-value--number_lu0ag_47","metric-value--currency":"_metric-value--currency_lu0ag_47","metric-value--percentage":"_metric-value--percentage_lu0ag_47","metric-morpheme":"_metric-morpheme_lu0ag_51","metric-empty":"_metric-empty_lu0ag_64","metric-icon":"_metric-icon_lu0ag_71"}}]]),Cse={key:0,style:{color:"#6b6b6b"}},bse=bt(tt({__name:"HeaderSorting",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean},modelValue:{}},emits:["sort-changed","update:modelValue","open"],setup(e,{expose:t,emit:n}){const o=Kt,s={START_ASC:{value:"start_asc",label:"Soonest to furthest start",id:"start_asc"},START_DESC:{value:"start_desc",label:"Furthest to soonest start",id:"start_desc"},DUE_ASC:{value:"due_asc",label:"Soonest to furthest due",id:"due_asc"},DUE_DESC:{value:"due_desc",label:"Furthest to soonest due",id:"due_desc"}},r={desc:{value:"desc",label:"Newest to oldest",id:"desc"},asc:{value:"asc",label:"Oldest to newest",id:"asc"}},i={asc:{value:"asc",label:"Smallest to largest",id:"asc"},desc:{value:"desc",label:"Largest to smallest",id:"desc"}},a={asc:{value:"asc",label:"Ascending",id:"asc"},desc:{value:"desc",label:"Descending",id:"desc"}},l=e,c={assignees:"default",completedOn:"date",dateRange:"dateRange",id:"number",isArchived:"default",isCompleted:"default",isDeleted:"default",isProcessing:"default",isStarted:"default",lastUpdated:"date",name:"default",status:"default",permissions:"default",options:"default",disabled:"number"},u=Y(()=>{var N,F;if(l.headerType)return l.headerType;if(((F=(N=l.params)==null?void 0:N.column)==null?void 0:F.getColId()).includes("metric"))return"default";const O=l.headerType??l.params.column.getColId();return c[O]||"default"}),d=H(),h=()=>{var O,N,F;const x=(N=(O=l.params)==null?void 0:O.column)==null?void 0:N.getColDef();if((F=x.colId)!=null&&F.includes("metric")){if(x.context.is_primary==1)return"primary";if(x.context.is_point_metric==1)return"secondary"}};Mh(()=>{d.value=h()}),en(()=>{d.value=h()});const f=Y(()=>{var x,O;return((O=(x=l.params)==null?void 0:x.column.getColDef().context)==null?void 0:O.morpheme_value)||void 0}),p=Y(()=>{var x;return(x=l.params)==null?void 0:x.displayName}),g=Y(()=>{let x=[];switch(u.value){case"dateRange":x=Object.values(s).map(O=>({...O,selected:C.value===O.value,type:"text",hover:T.value===O.value}));break;case"date":x=Object.values(r).map(O=>({...O,selected:C.value===O.value,type:"text",hover:T.value===O.value}));break;case"number":x=Object.values(i).map(O=>({...O,selected:C.value===O.value,type:"text",hover:T.value===O.value}));break;default:x=Object.values(a).map(O=>({...O,selected:C.value===O.value,type:"text",hover:T.value===O.value}));break}return C.value!=="none"&&x.push({id:"clear",label:"Clear",value:"none",selected:!1,type:"text",icon:"XMark",hover:T.value=="none"}),x}),v=Y(()=>String(C.value).endsWith("asc")?"SortUp":String(C.value).endsWith("desc")?"SortDown":"Sort"),C=H(l.modelValue??"none"),S=x=>{if(I.value){I.value=!1;return}E("update:modelValue",x),E("sort-changed",x)},b=x=>{C.value=x},y=mr(()=>{if(u.value==="date"||u.value==="default"||u.value==="number"){let x;C.value==="none"?x="asc":C.value==="asc"?x="desc":x="none",C.value=x}else{const x=[s.START_ASC.value,s.START_DESC.value,s.DUE_ASC.value,s.DUE_DESC.value,"none"],N=(x.indexOf(C.value)+1)%x.length;C.value=x[N]}},Ci),_=Y(()=>{if(C.value==="none")return"No sorting applied";const x=g.value.find(O=>O.value===C.value);return(x==null?void 0:x.label)||""}),E=n,D=Y(()=>{if(l.disabled&&!l.readOnly)return"var(--disabled-color)";if(C.value!=="none")return"var(--primary-color-hover)"});Qe(()=>l.modelValue,x=>{x!=C.value&&(C.value=x)}),Qe(C,x=>{x!==l.modelValue&&S(x)});const T=H(C.value);Qe(()=>C.value,x=>{T.value=x});const P=x=>{var z,j;if(l.readOnly||l.disabled)return;let O=0;x.key==="ArrowDown"?O=1:x.key==="ArrowUp"&&(O=-1);const N=g.value.findIndex(Q=>Q.value===T.value),F=g.value.length;if(x.key==="Enter"||x.key===" ")x.preventDefault(),C.value=T.value,(z=L.value)==null||z.hide();else if(O!==0){x.preventDefault();let Q=(N+O+F)%F;T.value=g.value[Q].value}else x.key==="Escape"&&((j=L.value)==null||j.hide())},L=H(null);en(()=>{var x,O;(O=(x=L.value)==null?void 0:x.$el)==null||O.addEventListener("keydown",P)}),Zl(()=>{var x,O;(O=(x=L.value)==null?void 0:x.$el)==null||O.removeEventListener("keydown",P)});const I=H(!1);return t({setDefaultSort:x=>{C.value=x?x.direction:"none",I.value=!0},clear:()=>{C.value="none"}}),(x,O)=>(K(),ze(J0,{ref_key:"dropdownRef",ref:L,options:g.value,label:p.value,readOnly:l.readOnly,onOpen:O[0]||(O[0]=N=>x.$emit("open")),disabled:l.disabled,variant:["icon","tertiary"],size:"small",onHandleClick:W(y),onSelect:O[1]||(O[1]=N=>b(N))},{prefix:be(()=>[ye(pt,{variant:["text"],onClick:W(y),size:"small"},{default:be(()=>[qe((K(),ce("b",null,[nt(it(p.value),1)])),[[W(o),{content:p.value}]]),f.value?(K(),ce("small",Cse," ("+it(f.value)+") ",1)):Xe("",!0),d.value=="primary"?qe((K(),ce("div",{key:1,class:se(x.$style["icon-metric"])},[ye(ct,{src:"ChartPie",color:"#A6A6A6",size:"14"})],2)),[[W(o),"Woohoo metric"]]):Xe("",!0),d.value=="secondary"?qe((K(),ce("div",{key:2,class:se(x.$style["icon-metric"])},[ye(ct,{src:"Bullseye",color:"#A6A6A6",size:"14"})],2)),[[W(o),"Point Metric"]]):Xe("",!0)]),_:1},8,["onClick"])]),iconDropdown:be(()=>[qe(ye(ct,{src:v.value,source:"remote",color:D.value},null,8,["src","color"]),[[W(o),_.value]])]),_:1},8,["options","label","readOnly","disabled","onHandleClick"]))}}),[["__cssModules",{$style:{"icon-metric":"_icon-metric_nh30n_1",iconSorting:"_iconSorting_nh30n_9","button-group":"_button-group_nh30n_15","ab-table-button":"_ab-table-button_nh30n_26","button-main":"_button-main_nh30n_32","button-dropdown-trigger":"_button-dropdown-trigger_nh30n_37",headerSorting:"_headerSorting_nh30n_47"}}]]),Sse=["disabled","readonly","checked","indeterminate"],FN=bt(tt({__name:"Checkbox",props:{modelValue:{},disabled:{type:Boolean},readOnly:{type:Boolean},focusIndex:{},tooltipText:{},allowIndeterminate:{type:Boolean},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=Kt,o=Uo,s=e,r=t,i=Y(()=>{if(typeof s.size=="string"){if(["small","medium","large"].includes(s.size))switch(s.size){case"small":return"14px";case"large":return"24px";case"medium":default:return"20px"}if(s.size.endsWith("px"))return s.size}return typeof s.size=="number"?`${s.size}px`:"20px"}),a=Y(()=>s.allowIndeterminate?[At.UNCHECK,At.INDETERMINATE,At.CHECKED]:[At.UNCHECK,At.CHECKED]),l=Y(()=>{if(typeof s.tooltipText=="string"||!s.tooltipText)return s.tooltipText||"";switch(u.value){case At.UNCHECK:return s.tooltipText.unchecked;case At.INDETERMINATE:return s.tooltipText.indeterminate;case At.CHECKED:return s.tooltipText.checked;default:return""}}),c=()=>{if(h.value)return;const p=(a.value.indexOf(u.value)+1)%a.value.length;u.value=a.value[p]},u=H(typeof s.modelValue=="boolean"?s.modelValue?At.CHECKED:At.UNCHECK:s.modelValue),d=Y(()=>({checked:u.value===At.CHECKED,indeterminate:u.value===At.INDETERMINATE,none:u.value===At.UNCHECK})),h=Y(()=>s.disabled||s.readOnly);return Qe(()=>u.value,f=>{r("update:modelValue",f===At.CHECKED)}),(f,p)=>qe((K(),ce("input",{disabled:s.disabled,key:u.value,readonly:s.readOnly,type:"checkbox",class:se([f.$style["input-checkbox"]]),checked:d.value.checked,indeterminate:d.value.indeterminate,onChange:c,"aria-label":"Select All Items",style:hn({"--input-size":i.value})},null,46,Sse)),[[W(n),{content:l.value,hideOnClick:!1,contentClass:"extra-padding"}],[W(o),s.focusIndex]])}}),[["__cssModules",{$style:{small:"_small_1kz1e_84",large:"_large_1kz1e_87",medium:"_medium_1kz1e_90"}}]]),Ese=bt(tt({name:"HeaderCheckbox",__name:"HeaderCheckbox",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=e,n=Kt,o=qv(),{setSelectionStatus:s}=o,{rowCount:r,selectionStatus:i}=us(o),a=H(new Set);Qe(i,y=>{s(y)},{immediate:!0});const l=Y(()=>i.value!==At.UNCHECK),c=Y(()=>({checked:i.value===At.CHECKED,indeterminate:i.value===At.INDETERMINATE,UNCHECK:i.value===At.UNCHECK})),u=Y(()=>({[At.UNCHECK]:"Click to select all",[At.INDETERMINATE]:"Click to clear selection",[At.CHECKED]:"Click to clear selection"})[i.value]||"Select items"),d=Y(()=>{const y=[{label:"Select all",value:"INDETERMINATE",type:"text",clickable:!0,id:"indeterminate"}];return l.value&&y.push({label:"None",value:"UNCHECK",type:"text",clickable:!0,id:"uncheck"}),y}),h=y=>({selected:y.getSelectedRows().length,total:r.value.total,loaded:r.value.loaded}),f=({api:y,state:_})=>{if(y)if(_===At.UNCHECK)y.deselectAll(),a.value.clear(),i.value=_;else if(_===At.CHECKED){const E=new Set;y.forEachNode(D=>{D.isSelected()&&E.add(D.id||"")}),a.value=E,y.forEachNode(D=>D.setSelected(!0)),i.value=_}else y.forEachNode(E=>E.setSelected(!0)),i.value=_},p=()=>{var E;const y=(E=t.params)==null?void 0:E.api;if(!y){console.error("[HeaderCheckbox] There is no API available");return}const _={[At.UNCHECK]:At.INDETERMINATE,[At.INDETERMINATE]:At.UNCHECK,[At.CHECKED]:At.UNCHECK};f({api:y,state:_[i.value]})},g=y=>{var D;const _=(D=t.params)==null?void 0:D.api;if(!_){console.error("no api");return}const E={INDETERMINATE:At.INDETERMINATE,GLOBAL:At.CHECKED,UNCHECK:At.UNCHECK};f({api:_,state:E[y]})},v=mr(y=>{const{selected:_,total:E}=h(y);if(E==0){i.value=At.UNCHECK;return}_===E?i.value=At.CHECKED:_===0?i.value=At.UNCHECK:i.value=At.INDETERMINATE},300);let C=[];const S=y=>{v(y)};en(()=>{var T;const y=(T=t.params)==null?void 0:T.api;if(!y)return;const _=P=>v(P.api),E=()=>S(y),D=()=>S(y);y.addEventListener("selectionChanged",_),y.addEventListener("rowDataUpdated",E),y.addEventListener("modelUpdated",E),C=[()=>y.removeEventListener("selectionChanged",_),()=>y.removeEventListener("rowDataUpdated",E),()=>y.removeEventListener("modelUpdated",D)]}),Jn(()=>{C.forEach(y=>y())});const b=`header-checkbox-${Math.random().toString(36).substr(2,9)}`;return(y,_)=>(K(),ze(J0,{tabIndex:"9",options:d.value,size:24,disabled:t.disabled,readOnly:t.readOnly,variant:["icon","tertiary"],placement:"bottom-start",onSelect:g},{prefix:be(()=>[qe((K(),ze(FN,{"tab-index":"8",id:b,disabled:t.disabled,key:W(i),readonly:t.readOnly,type:"checkbox",checked:c.value.checked,indeterminate:c.value.indeterminate,modelValue:W(i),"onUpdate:modelValue":_[0]||(_[0]=E=>yn(i)?i.value=E:null),onChange:p,"aria-label":W(i)===W(At).CHECKED?"All items selected":"Select visible items",class:se(y.$style["ag-checkbox-input"])},null,8,["disabled","readonly","checked","indeterminate","modelValue","aria-label","class"])),[[W(n),{content:u.value,hideOnClick:!1,contentClass:"extra-padding"}]])]),_:1},8,["options","disabled","readOnly"]))}}),[["__cssModules",{$style:{"ag-checkbox-input":"_ag-checkbox-input_4qktt_1","button-group":"_button-group_4qktt_62","button-main":"_button-main_4qktt_62",headerCheckbox:"_headerCheckbox_4qktt_66"}}]]),AN=bt(tt({name:"StatusRenderer",__name:"StatusRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=Ns,n=Kt,o=e,{isEditing:s}=td(o),r=H(null),i=H(null),a=Y(()=>o.value),l=Y(()=>a.value===void 0),c=Y(()=>{var g,v;return((g=a.value)==null?void 0:g.name)||((v=a.value)==null?void 0:v.label)||"No status"}),u=Y(()=>{var g;return{disabled:o.disabled,error:!1,readOnly:o.readOnly,isEmpty:w7((g=a.value)==null?void 0:g.label),inputRef:r,wrapperRef:i,clickable:!o.disabled&&!o.readOnly,active:s}}),{argsMain:d,isHover:h}=To(u),f=Y(()=>{var g;return((g=a.value)==null?void 0:g.color)||"#fff"}),p=Y(()=>new On(f.value).isLight()?"#000":"#fff");return(g,v)=>qe((K(),ze(W(Fo),jt(W(d),{ref_key:"wrapperRef",ref:i,bordered:!0,style:{background:`${f.value} !important`,color:p.value,"--border-color":!W(s)&&!W(h)||!a.value?"#f3f5f8":void 0}}),{default:be(()=>[l.value?Xe("",!0):(K(),ce("div",{key:0,class:se({[g.$style["status-renderer"]]:!0,[g.$style["has-status"]]:a.value,[g.$style["has-suffix"]]:!!g.$slots.suffix})},[a.value?(K(),ce(Ft,{key:0},[qe((K(),ce("div",{class:se(g.$style["status-renderer__status-name"])},[nt(it(c.value),1)],2)),[[W(n),{content:c.value,delay:[1e3,0]}]]),xt(g.$slots,"suffix")],64)):(K(),ce(Ft,{key:1},[Te("div",{class:se(g.$style["status-renderer__color-code"])},null,2),v[0]||(v[0]=Te("span",{style:{color:"#a6a6a6"}},"No status",-1)),xt(g.$slots,"suffix")],64))],2))]),_:3},16,["style"])),[[W(t),{isLoading:l.value}]])}}),[["__cssModules",{$style:{"status-renderer":"_status-renderer_k5c36_1","has-status":"_has-status_k5c36_9","has-suffix":"_has-suffix_k5c36_12","status-renderer__color-code":"_status-renderer__color-code_k5c36_22","status-renderer__status-name":"_status-renderer__status-name_k5c36_33"}}]]),ON=bt(tt({__name:"PopupLayout",props:{popupName:{},showOverlay:{type:Boolean,default:!0},overlayOpacity:{default:.5},closeOnOverlayClick:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0},minWidth:{default:"300px"},popupIndex:{default:109},showCloseBtn:{type:Boolean,default:!0}},emits:["shown","hidden"],setup(e,{expose:t,emit:n}){const o=e,s=Y(()=>Number(o.popupIndex)),{popupRef:r,show:i,hide:a,isVisible:l}=VY({useTrigger:!1,arrow:!1,centered:!0,showOverlay:o.showOverlay,overlayOpacity:o.overlayOpacity,closeOnOverlayClick:o.closeOnOverlayClick,appendTo(d){return document.body},zIndex:s.value}),c=d=>{o.closeOnEscape&&d.key==="Escape"&&l.value&&a()};en(()=>{document.addEventListener("keydown",c)}),Jn(()=>{document.removeEventListener("keydown",c)}),t({show:i,hide:a,isVisible:l});const u=n;return Qe(()=>l.value,d=>{u(d?"shown":"hidden")}),(d,h)=>{const f=Nh("tooltip");return K(),ce("div",{ref_key:"popupRef",ref:r,class:se(d.$style.popupContainer)},[Te("div",{class:se(d.$style.popupWrapper)},[Te("div",{class:se(d.$style.header)},[xt(d.$slots,"header",{},()=>[Te("span",{class:se(d.$style["header-title"])},it(e.popupName),3)]),o.showCloseBtn?qe((K(),ze(pt,{key:0,variant:["icon","text"],onClick:W(a),"aria-label":"Close popup",size:"small"},{default:be(()=>[ye(ct,{src:"Xmark",size:8})]),_:1},8,["onClick"])),[[f,"Close"]]):Xe("",!0)],2),Te("div",{class:se(d.$style.body)},[xt(d.$slots,"default")],2),d.$slots.footer?(K(),ce("div",{key:0,class:se(d.$style.footer)},[xt(d.$slots,"footer")],2)):Xe("",!0)],2)],2)}}}),[["__cssModules",{$style:{popupContainer:"_popupContainer_1986t_1",popupWrapper:"_popupWrapper_1986t_9",popupFadeIn:"_popupFadeIn_1986t_1",header:"_header_1986t_24","header-title":"_header-title_1986t_34",body:"_body_1986t_43",footer:"_footer_1986t_48"}}]]),_se=["onMouseenter","onMouseleave"],Rse=["innerHTML"],Tse=["innerHTML"],Dse=["data-tooltip"],Ise={key:2,style:{"min-width":"24px","min-height":"24px",position:"absolute",top:"0",right:"0",display:"flex","align-items":"center","justify-content":"center"}},xse=bt(tt({__name:"Snackbar",setup(e){const t=Kt,n=v3,o=Es(),{removeNotification:s}=o,{notifications:r}=us(o),i=f=>f.trim().startsWith("<svg"),a=H("Copy"),l=()=>{setTimeout(()=>{a.value="Copy"},3e3)},c=f=>{navigator.clipboard.writeText(f).then(()=>{a.value="Copied",l()},()=>{a.value="Copy failed",l()})},u=H(new Set),d=f=>{var p;u.value.add(f),(p=o.pauseAutoDismiss)==null||p.call(o,f)},h=f=>{var p;u.value.delete(f),(p=o.resumeAutoDismiss)==null||p.call(o,f)};return(f,p)=>(K(),ze(Zz,{name:"list",tag:"div",class:se(["notification-center",f.$style["notification-wrapper"]])},{default:be(()=>[(K(!0),ce(Ft,null,Pn(W(r),g=>{var v;return qe((K(),ce("div",{key:g.id,class:se([f.$style["notification-item"],f.$style[`notification--${g.type||"info"}`],!(g!=null&&g.actions)||((v=g==null?void 0:g.actions)==null?void 0:v.length)==0?f.$style["snackbar-type"]:""]),onMouseenter:C=>d(g.id),onMouseleave:C=>h(g.id)},[Te("p",{class:se(f.$style.snackbar__message)},[g.type!="white"?(K(),ce("span",{key:0,class:se(f.$style.snackbar__icon)},[!g.icon&&g.type=="success"?(K(),ze(ct,{key:0,src:"CircleCheck",source:"remote"})):Xe("",!0),!g.icon&&g.type=="interactive"?(K(),ze(ct,{key:1,src:"CircleCheck",source:"remote"})):!g.icon&&g.type=="error"?(K(),ze(ct,{key:2,src:"CircleXMark",source:"remote"})):g.icon&&i(g.icon)?(K(),ce("i",{key:3,class:se(f.$style["icon-draw"]),innerHTML:g.icon},null,10,Rse)):g.icon&&!i(g.icon)?(K(),ze(ct,{key:4,src:g.icon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Xe("",!0)],2)):Xe("",!0),Te("span",{class:se(f.$style["error-message"])},[Te("span",{class:se(f.$style.message),innerHTML:g.message},null,10,Tse)],2)],2),g.actions?(K(),ce("div",{key:0,class:se(f.$style["actions-notification"]),"data-notification":"true"},[(K(!0),ce(Ft,null,Pn(g.actions,C=>(K(),ze(pt,jt({key:C.label},{ref_for:!0},C,{onClick:Nt(C.action,["prevent","stop"]),variant:"secondary",size:"small"}),{prefix:be(()=>[C.btnIcon?(K(),ze(ct,{key:0,src:C.btnIcon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Xe("",!0)]),_:2},1040,["onClick"]))),128))],2)):Xe("",!0),g.type!=="interactive"&&g.type!=="white"?qe((K(),ce("div",{key:1,"data-tooltip":a.value,style:{"min-width":"24px"}},[ye(pt,{variant:"secondary",onClick:C=>c(g.message),class:se(f.$style["copy-btn"])},{prefix:be(()=>[ye(ct,{src:"Copy",source:"remote",color:"var(--primary-color)",size:"11"})]),_:1},8,["onClick","class"])],8,Dse)),[[W(t),a.value]]):Xe("",!0),g.type=="interactive"?qe((K(),ce("div",Ise,[ye(pt,{variant:"tertiary",onClick:C=>W(s)(g.id),class:se(f.$style["close-btn"]),size:18},{default:be(()=>[ye(ct,{src:"XMarkSolid",size:"9"})]),_:1},8,["onClick","class"])])),[[W(t),"Close"]]):Xe("",!0)],42,_se)),[[W(n)]])}),128))]),_:1},8,["class"]))}}),[["__cssModules",{$style:{"notification-wrapper":"_notification-wrapper_1gm88_1","notification-item":"_notification-item_1gm88_15","notification--success":"_notification--success_1gm88_30","notification--error":"_notification--error_1gm88_36","close-btn":"_close-btn_1gm88_42","notification--info":"_notification--info_1gm88_45","notification--warning":"_notification--warning_1gm88_52","notification--interactive":"_notification--interactive_1gm88_59","notification--white":"_notification--white_1gm88_67","snackbar-type":"_snackbar-type_1gm88_75",snackbar__message:"_snackbar__message_1gm88_84",message:"_message_1gm88_97","error-message":"_error-message_1gm88_105",snackbar__icon:"_snackbar__icon_1gm88_111","actions-notification":"_actions-notification_1gm88_120","icon-draw":"_icon-draw_1gm88_128","copy-btn":"_copy-btn_1gm88_136"}}]]);/*!
|
|
161
161
|
* vue-draggable-next v2.3.0
|
|
162
162
|
* (c) 2025 Anish George
|
|
@@ -251,7 +251,7 @@ See ${RB(e,t)}`;return Array.isArray(o)?o.concat(r):[o,r]}var QCe={1:"Charting A
|
|
|
251
251
|
`)}checkProperties(e,t,n,o,s){const r=["__ob__","__v_skip","__metadata__"],i=Cbe(Object.getOwnPropertyNames(e),[...r,...t,...n],n),a=Object.keys(i);for(const l of a){const c=i[l];let u=`invalid ${o} property '${l}' did you mean any of these: ${c.slice(0,8).join(", ")}.`;n.includes("context")&&(u+=`
|
|
252
252
|
If you are trying to annotate ${o} with application data, use the '${o}.context' property instead.`),Op(u)}if(a.length>0&&s){const l=this.beans.frameworkOverrides.getDocLink(s);Op(`to see all the valid ${o} properties please check: ${l}`)}}};function Cbe(e,t,n){const o={},s=e.filter(r=>!t.some(i=>i===r));if(s.length>0)for(const r of s)o[r]=A_({inputValue:r,allSuggestions:n}).values;return o}var bbe=new Set(["firstChildChanged","lastChildChanged","childIndexChanged"]),Sbe={moduleName:"Validation",version:ut,beans:[wbe]};function _H(e){const t=e.sibling;t&&(t.childrenAfterFilter=e.childrenAfterFilter)}var Ebe=class extends je{constructor(){super(...arguments),this.beanName="filterStage",this.step="filter",this.refreshProps=["excludeChildrenWhenTreeDataFiltering"]}wireBeans(e){this.filterManager=e.filterManager}execute(e){const{changedPath:t}=e;this.filter(t)}filter(e){var n;const t=!!((n=this.filterManager)!=null&&n.isChildFilterPresent());this.filterNodes(t,e)}filterNodes(e,t){const n=(o,s)=>{o.hasChildren()&&e&&!s?o.childrenAfterFilter=o.childrenAfterGroup.filter(r=>{const i=r.childrenAfterFilter&&r.childrenAfterFilter.length>0,a=r.data&&this.filterManager.doesRowPassFilter({rowNode:r});return i||a}):o.childrenAfterFilter=o.childrenAfterGroup,_H(o)};if(this.doingTreeDataFiltering()){const o=(r,i)=>{if(r.childrenAfterGroup)for(let a=0;a<r.childrenAfterGroup.length;a++){const l=r.childrenAfterGroup[a],c=i||this.filterManager.doesRowPassFilter({rowNode:l});l.childrenAfterGroup?o(r.childrenAfterGroup[a],c):n(l,c)}n(r,i)},s=r=>o(r,!1);t.executeFromRootNode(s)}else{const o=s=>n(s,!1);t.forEachChangedNodeDepthFirst(o,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}},_be=class extends cR{constructor(){super(...arguments),this.iconCreated=!1}wireComp(e,t,n,o,s){this.comp=e;const r=Hp(this,this.beans.context,s);this.eButtonShowMainFilter=n,this.eFloatingFilterBody=o,this.setGui(t,r),this.setupActive(),this.refreshHeaderStyles(),this.setupWidth(r),this.setupLeft(r),this.setupHover(r),this.setupFocus(r),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(r),this.setupUi(),r.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(r);const i=()=>this.onColDefChanged(r);r.addManagedListeners(this.column,{colDefChanged:i}),r.addManagedEventListeners({filterSwitched:({column:a})=>{a===this.column&&i()}}),r.addDestroyFunc(()=>{this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.clearComponent()})}resizeHeader(){}moveHeader(){}getHeaderClassParams(){const{column:e,beans:t}=this,n=e.colDef;return Ot(t.gos,{colDef:n,column:e,floatingFilter:!0})}setupActive(){const e=this.column.getColDef(),t=!!e.filter,n=!!e.floatingFilter;this.active=t&&n}setupUi(){if(this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton&&this.active),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body",this.suppressFilterButton),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body",!this.suppressFilterButton),!this.active||this.iconCreated)return;const e=xr("filter",this.beans,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(e){e.createManagedBean(new qd(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){const e=this.getLocaleTextFunc();Ad(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){var i;const{beans:t}=this;if(Kn(t)===this.eGui)return;const s=Xc(t,this.eGui,null,e.shiftKey);if(s){(i=t.headerNavigation)==null||i.scrollToColumn(this.column),e.preventDefault(),s.focus();return}const r=this.findNextColumnWithFloatingFilter(e.shiftKey);r&&t.focusSvc.focusHeaderPosition({headerPosition:{headerRowIndex:this.rowCtrl.rowIndex,column:r},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.visibleCols;let n=this.column;do if(n=e?t.getColBefore(n):t.getColAfter(n),!n)break;while(!n.getColDef().filter||!n.getColDef().floatingFilter);return n}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case Le.UP:case Le.DOWN:case Le.LEFT:case Le.RIGHT:if(t)return;Qc(e);case Le.ENTER:t&&Yc(this.eGui)&&e.preventDefault();break;case Le.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const n=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),o=!!e.relatedTarget&&Gc(e.relatedTarget,"ag-floating-filter");if(n&&o&&e.target===this.eGui){const s=this.lastFocusEvent,r=!!(s&&s.key===Le.TAB);if(s&&r){const i=s.shiftKey;Yc(this.eGui,i)}}this.focusThis()}setupHover(e){var t;(t=this.beans.colHover)==null||t.addHeaderFilterColumnHoverListener(e,this.comp,this.column,this.eGui)}setupLeft(e){const t=new lR(this.column,this.eGui,this.beans);e.createManagedBean(t)}setupFilterButton(){var e;this.suppressFilterButton=!((e=this.beans.menuSvc)!=null&&e.isFloatingFilterButtonEnabled(this.column)),this.highlightFilterButtonWhenActive=!Xs(this.gos)}setupUserComp(){var t;if(!this.active)return;const e=(t=this.beans.colFilter)==null?void 0:t.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){var t;const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;(t=this.beans.menuSvc)==null||t.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(e){if(!this.active)return;const{beans:{colFilter:t},column:n,gos:o}=this,s=r=>{if((r==null?void 0:r.source)==="filterDestroyed"&&(!this.isAlive()||!(t!=null&&t.isAlive())))return;const i=this.comp.getFloatingFilterComp();i&&i.then(a=>{if(a){if(o.get("enableFilterHandlers")){const u=r;let d="filter";u!=null&&u.afterFloatingFilter?d="ui":u!=null&&u.afterDataChange?d="dataChanged":(r==null?void 0:r.source)==="api"&&(d="api"),this.updateFloatingFilterParams(this.userCompDetails,d);return}const l=t==null?void 0:t.getCurrentFloatingFilterParentModel(n),c=r?{...r,columns:r.columns??[],source:r.source==="api"?"api":"columnFilter"}:null;a.onParentModelChanged(l,c)}})};[this.destroySyncListener]=e.addManagedListeners(n,{filterChanged:s}),t!=null&&t.isFilterActive(n)&&s(null)}setupWidth(e){const t=()=>{const n=`${this.column.getActualWidth()}px`;this.comp.setWidth(n)};e.addManagedListeners(this.column,{widthChanged:t}),t()}setupFilterChangedListener(e){this.active&&([this.destroyFilterChangedListener]=e.addManagedListeners(this.column,{filterChanged:this.updateFilterButton.bind(this)}),this.updateFilterButton())}updateFilterButton(){var e;if(!this.suppressFilterButton&&this.comp){const t=!!((e=this.beans.filterManager)!=null&&e.isFilterAllowed(this.column));this.comp.setButtonWrapperDisplayed(t),this.highlightFilterButtonWhenActive&&t&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(e){const t=this.active;this.setupActive();const n=!t&&this.active;t&&!this.active&&(this.destroySyncListener(),this.destroyFilterChangedListener());const o=this.beans.colFilter,s=this.active?o==null?void 0:o.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,r=this.comp.getFloatingFilterComp();!r||!s?this.updateCompDetails(e,s,n):r.then(i=>{!i||o!=null&&o.areFilterCompsDifferent(this.userCompDetails??null,s)?this.updateCompDetails(e,s,n):this.updateFloatingFilterParams(s,"colDef")})}updateCompDetails(e,t,n){this.isAlive()&&(this.setCompDetails(t),this.setupFilterButton(),this.setupUi(),n&&(this.setupSyncWithFilter(e),this.setupFilterChangedListener(e)))}updateFloatingFilterParams(e,t){var o;if(!e)return;let n=e.params;(o=this.comp.getFloatingFilterComp())==null||o.then(s=>{var r;typeof(s==null?void 0:s.refresh)=="function"&&(this.gos.get("enableFilterHandlers")&&(n={...n,model:Vo(((r=this.beans.colFilter)==null?void 0:r.model)??{},this.column.getColId()),source:t}),s.refresh(n))})}addResizeAndMoveKeyboardListeners(){}destroy(){super.destroy(),this.destroySyncListener=null,this.destroyFilterChangedListener=null}};function Rbe(e,t){var o;const n=e.colModel.getCol(t);if(!n){Rn(12,{colKey:t});return}(o=e.menuSvc)==null||o.showColumnMenu({column:n,positionBy:"auto"})}function Tbe(e){var t;(t=e.menuSvc)==null||t.hidePopupMenu()}var Dbe={moduleName:"SharedMenu",version:ut,beans:[Vpe],apiFunctions:{showColumnMenu:Rbe,hidePopupMenu:Tbe}},Ibe=class extends rfe{postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridCtrl=e.gridCtrl}),this.addManagedEventListeners({gridStylesChanged:this.handleThemeChange.bind(this)})}getDefaultPopupParent(){return this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:n,event:o}=e,s=t.getBoundingClientRect(),r=this.getParentRect();this.setAlignedTo(t,n);let i=!1;const a=()=>{const l=this.keepXYWithinBounds(n,s.top-r.top,0),c=n.clientWidth>0?n.clientWidth:200;i||(n.style.minWidth=`${c}px`,i=!0);const d=r.right-r.left-c;let h;return this.gos.get("enableRtl")?(h=p(),h<0&&(h=f(),this.setAlignedStyles(n,"left")),h>d&&(h=0,this.setAlignedStyles(n,"right"))):(h=f(),h>d&&(h=p(),this.setAlignedStyles(n,"right")),h<0&&(h=0,this.setAlignedStyles(n,"left"))),{x:h,y:l};function f(){return s.right-r.left-2}function p(){return s.left-r.left-c}};this.positionPopup({ePopup:n,keepWithinBounds:!0,updatePosition:a,postProcessCallback:()=>this.callPostProcessPopup(e,"subMenu",n,t,o instanceof MouseEvent?o:void 0)})}callPostProcessPopup(e,t,n,o,s){const r=this.gos.getCallback("postProcessPopup");if(r){const{column:i,rowNode:a}=e;r({column:i,rowNode:a,ePopup:n,type:t,eventSource:o,mouseEvent:s})}}getActivePopups(){return this.popupList.map(e=>e.element)}handleThemeChange(e){if(e.themeChanged){const t=this.beans.environment;for(const n of this.popupList)t.applyThemeClasses(n.wrapper)}}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isStopPropagation(e){return ka(e)}},xw={moduleName:"Popup",version:ut,beans:[Ibe]},xbe=".ag-set-filter{--ag-indentation-level:0}.ag-set-filter-item{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-set-filter-item{padding-left:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}:where(.ag-rtl) .ag-set-filter-item{padding-right:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}.ag-set-filter-item-checkbox{display:flex;height:100%;width:100%}.ag-set-filter-group-icons{display:block;>*{cursor:pointer}}:where(.ag-ltr) .ag-set-filter-group-icons{margin-right:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-set-filter-group-icons{margin-left:var(--ag-widget-container-horizontal-padding)}.ag-filter-body-wrapper{display:flex;flex-direction:column}:where(.ag-menu:not(.ag-tabs) .ag-filter) .ag-filter-body-wrapper,:where(.ag-menu:not(.ag-tabs) .ag-filter)>:not(.ag-filter-wrapper){min-width:180px}.ag-filter-filter{flex:1 1 0px}.ag-filter-condition{display:flex;justify-content:center}.ag-floating-filter-body{display:flex;flex:1 1 auto;height:100%;position:relative}.ag-floating-filter-full-body{align-items:center;display:flex;flex:1 1 auto;height:100%;overflow:hidden;width:100%}:where(.ag-floating-filter-full-body)>div{flex:1 1 auto}.ag-floating-filter-input{align-items:center;display:flex;width:100%;>*{flex:1 1 auto}:where(.ag-input-field-input[type=date]),:where(.ag-input-field-input[type=datetime-local]){width:1px}}.ag-floating-filter-button{display:flex;flex:none}.ag-date-floating-filter-wrapper{display:flex}.ag-set-floating-filter-input :where(input)[disabled]{pointer-events:none}.ag-floating-filter-button-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;height:var(--ag-icon-size);width:var(--ag-icon-size)}.ag-filter-loading{align-items:unset;background-color:var(--ag-chrome-background-color);height:100%;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;width:100%;z-index:1;:where(.ag-menu) &{background-color:var(--ag-menu-background-color)}}.ag-filter-separator{border-top:solid var(--ag-border-width) var(--menu-separator-color)}:where(.ag-filter-select) .ag-picker-field-wrapper{width:0}.ag-filter-condition-operator{height:17px}:where(.ag-ltr) .ag-filter-condition-operator-or{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-condition-operator-or{margin-right:calc(var(--ag-spacing)*2)}.ag-set-filter-select-all{padding-top:var(--ag-widget-container-vertical-padding)}.ag-filter-no-matches,.ag-set-filter-list{height:calc(var(--ag-list-item-height)*6)}.ag-filter-no-matches{padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}.ag-set-filter-tree-list{height:calc(var(--ag-list-item-height)*10)}.ag-set-filter-filter{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding);margin-top:var(--ag-widget-container-vertical-padding)}.ag-filter-to{margin-top:var(--ag-widget-vertical-spacing)}.ag-mini-filter{margin:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-set-filter-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-rtl) .ag-set-filter-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-filter-menu) .ag-set-filter-list{min-width:200px}.ag-filter-virtual-list-item:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-filter-apply-panel{display:flex;justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-vertical-spacing) var(--ag-widget-container-horizontal-padding) var(--ag-widget-container-vertical-padding)}.ag-filter-apply-panel-button{line-height:1.5}:where(.ag-ltr) .ag-filter-apply-panel-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-apply-panel-button{margin-right:calc(var(--ag-spacing)*2)}.ag-simple-filter-body-wrapper{display:flex;flex-direction:column;min-height:calc(var(--ag-list-item-height) + var(--ag-widget-container-vertical-padding) + var(--ag-widget-vertical-spacing));overflow-y:auto;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);padding-bottom:calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing));&>*{margin-bottom:var(--ag-widget-vertical-spacing)}:where(.ag-resizer-wrapper){margin:0}}.ag-multi-filter-menu-item{margin:var(--ag-spacing) 0}.ag-multi-filter-group-title-bar{background-color:transparent;color:var(--ag-header-text-color);font-weight:500;padding:calc(var(--ag-spacing)*1.5) var(--ag-spacing)}.ag-group-filter-field-select-wrapper{display:flex;flex-direction:column;gap:var(--ag-widget-vertical-spacing);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}";function Pbe(e){const t=e.filterManager;return!!(t!=null&&t.isColumnFilterPresent())||!!(t!=null&&t.isAggregateFilterPresent())}function kbe(e,t){var n;return((n=e.filterManager)==null?void 0:n.getColumnFilterInstance(t))??Promise.resolve(void 0)}function Fbe(e,t){var o;const n=e.colModel.getColDefCol(t);if(n)return(o=e.colFilter)==null?void 0:o.destroyFilter(n,"api")}function Abe(e,t){e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=e.filterManager)==null?void 0:n.setFilterModel(t)})}function Obe(e){var t;return((t=e.filterManager)==null?void 0:t.getFilterModel())??{}}function Mbe(e,t,n){const{gos:o,colModel:s,colFilter:r}=e;n&&!o.get("enableFilterHandlers")&&(Je(288),n=!1);const i=s.getColDefCol(t);return i?(r==null?void 0:r.getModelForColumn(i,n))??null:null}function Nbe(e,t,n){var o;return((o=e.filterManager)==null?void 0:o.setColumnFilterModel(t,n))??Promise.resolve()}function Lbe(e,t){var o;const n=e.colModel.getCol(t);if(!n){Rn(12,{colKey:t});return}(o=e.menuSvc)==null||o.showFilterMenu({column:n,containerType:"columnFilter",positionBy:"auto"})}function Vbe(e){var t;(t=e.menuSvc)==null||t.hideFilterMenu()}function Bbe(e,t){var o;const n=e.colModel.getCol(t);if(!n){Rn(12,{colKey:t});return}return(o=e.colFilter)==null?void 0:o.getHandler(n,!0)}function $be(e,t){const{colModel:n,colFilter:o,gos:s}=e;if(!s.get("enableFilterHandlers")){Je(287);return}const{colId:r,action:i}=t;if(r){const a=n.getColById(r);a&&(o==null||o.updateModel(a,i))}else o==null||o.updateAllModels(i)}var Hbe={filterHandler:()=>({doesFilterPass:()=>!0})},Gbe=class extends je{constructor(){super(...arguments),this.beanName="colFilter",this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.modelUpdates=[],this.columnModelUpdates=[],this.state=new Map,this.handlerMap={...M2},this.isGlobalButtons=!1,this.activeFilterComps=new Set}postConstruct(){var n,o;this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)});const e=this.gos,t={...((o=(n=e.get("initialState"))==null?void 0:n.filter)==null?void 0:o.filterModel)??{}};this.initialModel=t,this.model={...t},e.get("enableFilterHandlers")||delete this.handlerMap.agMultiColumnFilter}refreshModel(){this.onNewRowsLoaded("rowDataUpdated")}setModel(e,t="api",n){const{colModel:o,dataTypeSvc:s,filterManager:r}=this.beans;if(s!=null&&s.isPendingInference){this.modelUpdates.push({model:e,source:t});return}const i=[],a=this.getModel(!0);if(e){const l=new Set(Object.keys(e));this.allColumnFilters.forEach((c,u)=>{const d=e[u];i.push(this.setModelOnFilterWrapper(c,d)),l.delete(u)}),l.forEach(c=>{const u=o.getColDefCol(c)||o.getCol(c);if(!u){Je(62,{colId:c});return}if(!u.isFilterAllowed()){Je(63,{colId:c});return}const d=this.getOrCreateFilterWrapper(u,!0);if(!d){Je(64,{colId:c});return}i.push(this.setModelOnFilterWrapper(d,e[c],!0))})}else this.model={},this.allColumnFilters.forEach(l=>{i.push(this.setModelOnFilterWrapper(l,null))});Xn.all(i).then(()=>{const l=this.getModel(!0),c=[];this.allColumnFilters.forEach((u,d)=>{const h=a?a[d]:null,f=l?l[d]:null;Ep(h,f)||c.push(u.column)}),c.length>0?r==null||r.onFilterChanged({columns:c,source:t}):n&&this.updateActive("filterChanged")})}getModel(e){var r;const t={},{allColumnFilters:n,initialModel:o,beans:{colModel:s}}=this;if(n.forEach((i,a)=>{const l=this.getModelFromFilterWrapper(i);ht(l)&&(t[a]=l)}),!e)for(const i of Object.keys(o)){const a=o[i];ht(a)&&!n.has(i)&&((r=s.getCol(i))!=null&&r.isFilterAllowed())&&(t[i]=a)}return t}setState(e,t,n="api"){if(this.state.clear(),t)for(const o of Object.keys(t)){const s=t[o];this.state.set(o,{model:Vo(this.model,o),state:s})}this.setModel(e,n,!0)}getState(){const e=this.state;if(!e.size)return;const t={};let n=!1;return e.forEach((o,s)=>{const r=o.state;r!=null&&(n=!0,t[s]=r)}),n?t:void 0}getModelFromFilterWrapper(e){const n=e.column.getColId();if(e.isHandler)return Vo(this.model,n);const o=e.filter;return o?typeof o.getModel!="function"?(Je(66),null):o.getModel():Vo(this.initialModel,n)}isFilterPresent(){return this.activeColumnFilters.length>0}isAggFilterPresent(){return!!this.activeAggregateFilters.length}disableFilters(){this.initialModel={};const{allColumnFilters:e}=this;return e.size?(e.forEach(t=>this.disposeFilterWrapper(t,"advancedFilterEnabled")),!0):!1}updateActiveFilters(){const e=c=>c?c.isFilterActive?c.isFilterActive():(Je(67),!1):!1,{colModel:t,gos:n}=this.beans,o=!!f_(n),s=c=>{if(!c.isPrimary())return!0;const d=!t.isPivotActive();return!c.isValueActive()||!d?!1:t.isPivotMode()?!0:o},r=[],i=[],a=(c,u,d)=>{u&&(s(c)?r.push(d):i.push(d))},l=[];return this.allColumnFilters.forEach(c=>{const u=c.column,d=u.getColId();if(c.isHandler)l.push(Xn.resolve().then(()=>{a(u,this.isHandlerActive(u),{colId:d,isHandler:!0,handler:c.handler,handlerParams:c.handlerParams})}));else{const h=Fl(c);h&&l.push(h.then(f=>{a(u,e(f),{colId:d,isHandler:!1,comp:f})}))}}),Xn.all(l).then(()=>{this.activeAggregateFilters=r,this.activeColumnFilters=i})}updateFilterFlagInColumns(e,t){var o;const n=[];return this.allColumnFilters.forEach(s=>{const r=s.column;if(s.isHandler)n.push(Xn.resolve().then(()=>{this.setColFilterActive(r,this.isHandlerActive(r),e,t)}));else{const i=Fl(s);i&&n.push(i.then(a=>{this.setColFilterActive(r,a.isFilterActive(),e,t)}))}}),(o=this.beans.groupFilter)==null||o.updateFilterFlags(e,t),Xn.all(n)}doFiltersPass(e,t,n){const{data:o,aggData:s}=e,r=n?this.activeAggregateFilters:this.activeColumnFilters,i=n?s:o,a=this.model;for(let l=0;l<r.length;l++){const c=r[l],{colId:u,isHandler:d}=c;if(u!==t)if(d){const{handler:h,handlerParams:f}=c;if(!h.doesFilterPass({node:e,data:i,model:Vo(a,u),handlerParams:f}))return!1}else{const h=c.comp;if(typeof h.doesFilterPass!="function"){Rn(91);continue}if(!h.doesFilterPass({node:e,data:i}))return!1}}return!0}getHandlerParams(e){const t=this.allColumnFilters.get(e.getColId());return t!=null&&t.isHandler?t.handlerParams:void 0}callOnFilterChangedOutsideRenderCycle(e){const{rowRenderer:t,filterManager:n}=this.beans,o=()=>{this.isAlive()&&(n==null||n.onFilterChanged(e))};t.isRefreshInProgress()?setTimeout(o,0):o()}updateBeforeFilterChanged(e={}){const{column:t,additionalEventAttributes:n}=e,o=t==null?void 0:t.getColId();return this.updateActiveFilters().then(()=>this.updateFilterFlagInColumns("filterChanged",n).then(()=>{this.allColumnFilters.forEach(s=>{var a,l,c;const{column:r,isHandler:i}=s;o!==r.getColId()&&(i&&((l=(a=s.handler).onAnyFilterChanged)==null||l.call(a)),(c=Fl(s,i))==null||c.then(u=>{typeof(u==null?void 0:u.onAnyFilterChanged)=="function"&&u.onAnyFilterChanged()}))}),this.processingFilterChange=!0}))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!(this.gos.get("allowShowChangeAfterFilter")??!1)&&this.processingFilterChange}onNewRowsLoaded(e){const t=[];this.allColumnFilters.forEach(n=>{var r,i;const o=n.isHandler;o&&((i=(r=n.handler).onNewRowsLoaded)==null||i.call(r));const s=Fl(n,o);s&&t.push(s.then(a=>{var l;(l=a.onNewRowsLoaded)==null||l.call(a)}))}),Xn.all(t).then(()=>this.updateActive(e,{afterDataChange:!0}))}updateActive(e,t){this.updateFilterFlagInColumns(e,t).then(()=>this.updateActiveFilters())}createGetValue(e,t){const{filterValueSvc:n,colModel:o}=this.beans;return(s,r)=>{const i=r?o.getCol(r):e;return i?n.getValue(i,s,t):void 0}}isFilterActive(e){const t=this.cachedFilter(e);if(t!=null&&t.isHandler)return this.isHandlerActive(e);const n=t==null?void 0:t.filter;return n?n.isFilterActive():Vo(this.initialModel,e.getColId())!=null}isHandlerActive(e){const t=ht(Vo(this.model,e.getColId()));if(t)return t;const n=this.beans.groupFilter;return n!=null&&n.isGroupFilter(e)?n.isFilterActive(e):!1}getOrCreateFilterUi(e){const t=this.getOrCreateFilterWrapper(e,!0);return t?Fl(t):null}getFilterUiForDisplay(e){const t=this.getOrCreateFilterWrapper(e,!0);if(!t)return null;const n=Fl(t);return n?n.then(o=>({comp:o,params:t.filterUi.filterParams,isHandler:t.isHandler})):null}getHandler(e,t){const n=this.getOrCreateFilterWrapper(e,t);return n!=null&&n.isHandler?n.handler:void 0}getOrCreateFilterWrapper(e,t){if(!e.isFilterAllowed())return;let n=this.cachedFilter(e);return!n&&t&&(n=this.createFilterWrapper(e),this.setColumnFilterWrapper(e,n)),n}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e,t=!1){return this.getDefaultFilterFromDataType(()=>{var n;return(n=this.beans.dataTypeSvc)==null?void 0:n.getBaseDataType(e)},t)}getDefaultFilterFromDataType(e,t=!1){return Hue(this.gos)?t?"agSetColumnFloatingFilter":"agSetColumnFilter":xfe(e(),t)}getDefaultFloatingFilter(e){return this.getDefaultFilter(e,!0)}createFilterComp(e,t,n,o,s,r){const i=()=>{const c=this.createFilterCompParams(e,s,r),u=o(c,s);return Wde(this.beans.userCompFactory,t,u,n)},a=i();return a?{compDetails:a,createFilterUi:c=>(c?i():a).newAgStackInstance()}:null}createFilterInstance(e,t,n,o){var d,h;const s=this.beans.selectableFilter;s!=null&&s.isSelectable(t)&&(t=s.getFilterDef(e,t));const{handler:r,handlerParams:i,handlerGenerator:a}=this.createHandler(e,t,n)??{},l=this.createFilterComp(e,t,n,o,!!r,"init");if(!l)return{compDetails:null,createFilterUi:null,handler:r,handlerGenerator:a,handlerParams:i};const{compDetails:c,createFilterUi:u}=l;return this.isGlobalButtons&&((h=(d=c.params)==null?void 0:d.buttons)!=null&&h.length||Je(281,{colId:e.getColId()})),{compDetails:c,handler:r,handlerGenerator:a,handlerParams:i,createFilterUi:u}}createBaseFilterParams(e,t){const{filterManager:n,rowModel:o}=this.beans;return Ot(this.gos,{column:e,colDef:e.getColDef(),getValue:this.createGetValue(e),doesRowPassOtherFilter:t?()=>!0:s=>(n==null?void 0:n.doesRowPassOtherFilters(e.getColId(),s))??!0,rowModel:o})}createFilterCompParams(e,t,n,o){const s=this.filterChangedCallbackFactory(e),r=this.createBaseFilterParams(e,o);if(r.filterChangedCallback=s,r.filterModifiedCallback=o?()=>{}:i=>this.filterModified(e,i),t){const i=r,a=e.getColId(),l=Vo(this.model,a);i.model=l,i.state=this.state.get(a)??{model:l},i.onModelChange=(c,u)=>{this.updateStoredModel(a,c),this.refreshHandlerAndUi(e,c,"ui",!1,u).then(()=>{s({...u,source:"columnFilter"})})},i.onStateChange=c=>{this.updateState(e,c),this.updateOrRefreshFilterUi(e)},i.onAction=(c,u,d)=>{this.updateModel(e,c,u),this.dispatchLocalEvent({type:"filterAction",column:e,action:c,event:d})},i.getHandler=()=>this.getHandler(e,!0),i.onUiChange=c=>this.filterUiChanged(e,c),i.source=n}return r}createFilterUiForHandler(e,t){return t?{created:!1,create:t,filterParams:e.params,compDetails:e}:null}createFilterUiLegacy(e,t,n){const o=t(),s={created:!0,create:t,filterParams:e.params,compDetails:e,promise:o};return o.then(n),s}createFilterWrapper(e){var a;const{compDetails:t,handler:n,handlerGenerator:o,handlerParams:s,createFilterUi:r}=this.createFilterInstance(e,e.getColDef(),this.getDefaultFilter(e),l=>l),i=e.getColId();if(n)return delete this.initialModel[i],(a=n.init)==null||a.call(n,{...s,source:"init",model:Vo(this.model,i)}),{column:e,isHandler:!0,handler:n,handlerGenerator:o,handlerParams:s,filterUi:this.createFilterUiForHandler(t,r)};if(r){const l={column:e,filterUi:null,isHandler:!1};return l.filterUi=this.createFilterUiLegacy(t,r,c=>{l.filter=c??void 0}),l}return{column:e,filterUi:null,isHandler:!1}}createHandlerFunc(e,t,n){var f;const{gos:o,frameworkOverrides:s,registry:r}=this.beans;let i;const a=p=>{const g=p.filter;if(t2(g)){const v=g.handler;return v||(i=g.doesFilterPass,i?()=>({doesFilterPass:i}):void 0)}return typeof g=="string"?g:void 0},l=o.get("enableFilterHandlers"),c=l?a(t):void 0,u=p=>()=>this.createBean(r.createDynamicBean(p,!0));let d,h;if(typeof c=="string"){const p=(f=o.get("filterHandlers"))==null?void 0:f[c];p!=null?d=p:vfe.has(c)&&(d=u(c),h=c)}else d=c;if(!d){let p;const{compName:g,jsComp:v,fwComp:C}=i2(s,t);g?p=g:v==null&&C==null&&t.filter===!0&&(p=n),h=this.handlerMap[p],h&&(d=u(h))}return d?{filterHandler:d,handlerNameOrCallback:i??h}:l?(lo(o)&&Je(277,{colId:e.getColId()}),Hbe):void 0}createHandler(e,t,n){const o=this.createHandlerFunc(e,t,n);if(!o)return;const s=w_(this.beans.userCompFactory,t,this.createFilterCompParams(e,!0,"init")),{handlerNameOrCallback:r,filterHandler:i}=o,{handler:a,handlerParams:l}=this.createHandlerFromFunc(e,i,s);return{handler:a,handlerParams:l,handlerGenerator:r??i}}createHandlerFromFunc(e,t,n){const o=e.getColDef(),s=t(Ot(this.gos,{column:e,colDef:o})),r=this.createHandlerParams(e,n);return{handler:s,handlerParams:r}}createHandlerParams(e,t){const n=e.getColDef(),o=e.getColId(),s=this.filterChangedCallbackFactory(e);return Ot(this.gos,{colDef:n,column:e,getValue:this.createGetValue(e),doesRowPassOtherFilter:r=>{var i;return((i=this.beans.filterManager)==null?void 0:i.doesRowPassOtherFilters(o,r))??!0},onModelChange:(r,i)=>{this.updateStoredModel(o,r),this.refreshHandlerAndUi(e,r,"handler",!1,i).then(()=>{s({...i,source:"columnFilter"})})},filterParams:t})}onColumnsChanged(){const e=[],{colModel:t,filterManager:n,groupFilter:o}=this.beans;this.allColumnFilters.forEach((r,i)=>{let a;r.column.isPrimary()?a=t.getColDefCol(i):a=t.getCol(i),!(a&&a===r.column)&&(e.push(r.column),this.disposeFilterWrapper(r,"columnChanged"),this.disposeColumnListener(i))});const s=o&&e.every(r=>o.isGroupFilter(r));e.length>0&&!s&&(n==null||n.onFilterChanged({columns:e,source:"api"}))}isFilterAllowed(e){if(!e.isFilterAllowed())return!1;const n=this.beans.groupFilter;return n!=null&&n.isGroupFilter(e)?n.isFilterAllowed(e):!0}getFloatingFilterCompDetails(e,t){const{userCompFactory:n,frameworkOverrides:o,selectableFilter:s}=this.beans,r=h=>{const f=this.getOrCreateFilterUi(e);f!=null&&f.then(p=>{h(Up(p))})},i=e.getColDef(),a=s!=null&&s.isSelectable(i)?s.getFilterDef(e,i):i,l=Ofe(o,a,()=>this.getDefaultFloatingFilter(e))??"agReadOnlyFloatingFilter",c=this.gos.get("enableFilterHandlers"),u=w_(n,a,this.createFilterCompParams(e,c,"init",!0)),d=Ot(this.gos,{column:e,filterParams:u,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:r,showParentFilter:t});if(c){const h=d,f=e.getColId(),p=this.filterChangedCallbackFactory(e);h.onUiChange=g=>this.floatingFilterUiChanged(e,g),h.model=Vo(this.model,f),h.onModelChange=(g,v)=>{this.updateStoredModel(f,g),this.refreshHandlerAndUi(e,g,"floating",!0,v).then(()=>{p({...v,source:"columnFilter"})})},h.getHandler=()=>this.getHandler(e,!0),h.source="init"}return Yde(n,i,d,l)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilterUi(e,t,n,o){const s="paramsUpdated";if(e.isHandler){const r=t.getColId();delete this.initialModel[r],this.state.delete(r);const i=e.filterUi,a=this.createFilterUiForHandler(n,o);e.filterUi=a;const l=this.eventSvc;i!=null&&i.created?i.promise.then(c=>{this.destroyBean(c),l.dispatchEvent({type:"filterDestroyed",source:s,column:t})}):l.dispatchEvent({type:"filterHandlerDestroyed",source:s,column:t})}else this.destroyFilter(t,s)}destroyFilter(e,t="api"){const n=e.getColId(),o=this.allColumnFilters.get(n);this.disposeColumnListener(n),delete this.initialModel[n],o&&this.disposeFilterWrapper(o,t).then(s=>{var r;s&&this.isAlive()&&((r=this.beans.filterManager)==null||r.onFilterChanged({columns:[e],source:"api"}))})}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){let n=!1;const{column:o,isHandler:s,filterUi:r}=e,i=o.getColId();s&&(n=this.isHandlerActive(o),this.destroyBean(e.handler),delete this.model[i],this.state.delete(i));const a=()=>{this.setColFilterActive(o,!1,"filterDestroyed"),this.allColumnFilters.delete(i),this.eventSvc.dispatchEvent({type:"filterDestroyed",source:t,column:o})};if(r){if(r.created)return r.promise.then(l=>(n=s?n:!!(l!=null&&l.isFilterActive()),this.destroyBean(l),a(),n));a()}return Xn.resolve(n)}filterChangedCallbackFactory(e){return t=>{this.callOnFilterChangedOutsideRenderCycle({additionalEventAttributes:t,columns:[e],column:e,source:(t==null?void 0:t.source)??"columnFilter"})}}filterParamsChanged(e,t="api"){var v,C,S,b,y,_;const n=this.allColumnFilters.get(e);if(!n)return;const o=this.beans,s=n.column,r=s.getColDef(),i=s.isFilterAllowed(),a=this.getDefaultFilter(s),l=o.selectableFilter,c=l!=null&&l.isSelectable(r)?l.getFilterDef(s,r):r,u=i?this.createHandlerFunc(s,c,this.getDefaultFilter(s)):void 0,d=!!u,h=n.isHandler;if(h!=d){this.destroyFilter(s,"paramsUpdated");return}const{compDetails:f,createFilterUi:p}=(i?this.createFilterComp(s,c,a,E=>E,d,"colDef"):null)??{compDetails:null,createFilterUi:null},g=(f==null?void 0:f.params)??w_(o.userCompFactory,c,this.createFilterCompParams(s,d,"colDef"));if(h){const E=(u==null?void 0:u.handlerNameOrCallback)??(u==null?void 0:u.filterHandler),D=Vo(this.model,e);if(n.handlerGenerator!=E){const T=n.handler,{handler:P,handlerParams:L}=this.createHandlerFromFunc(s,u.filterHandler,g);n.handler=P,n.handlerParams=L,n.handlerGenerator=E,delete this.model[e],(v=P.init)==null||v.call(P,{...L,source:"init",model:null}),this.destroyBean(T),D!=null&&((C=this.beans.filterManager)==null||C.onFilterChanged({columns:[s],source:t}))}else{const T=this.createHandlerParams(s,f==null?void 0:f.params);n.handlerParams=T,(b=(S=n.handler).refresh)==null||b.call(S,{...T,source:"colDef",model:D})}}if(this.areFilterCompsDifferent(((y=n.filterUi)==null?void 0:y.compDetails)??null,f)||!n.filterUi||!f){this.destroyFilterUi(n,s,f,p);return}n.filterUi.filterParams=g,(_=Fl(n,h))==null||_.then(E=>{(E!=null&&E.refresh?E.refresh(g):!0)===!1?this.destroyFilterUi(n,s,f,p):this.dispatchLocalEvent({type:"filterParamsChanged",column:s,params:g})})}refreshHandlerAndUi(e,t,n,o,s){const r=this.cachedFilter(e);if(!r)return o&&this.getOrCreateFilterWrapper(e,!0),Xn.resolve();if(!r.isHandler)return Xn.resolve();const{filterUi:i,handler:a,handlerParams:l}=r;return yfe(()=>{if(i){const{created:c,filterParams:u}=i;if(c)return i.promise.then(d=>d?{filter:d,filterParams:u}:void 0);i.refreshed=!0}return Xn.resolve(void 0)},a,l,t,this.state.get(e.getColId())??{model:t},n,s)}setColumnFilterWrapper(e,t){const n=e.getColId();this.allColumnFilters.set(n,t),this.allColumnListeners.set(n,this.addManagedListeners(e,{colDefChanged:()=>this.filterParamsChanged(n)})[0])}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:n}=e,{componentClass:o}=t;return!(n===o||(n==null?void 0:n.render)&&(o==null?void 0:o.render)&&n.render===o.render)}hasFloatingFilters(){return this.beans.colModel.getCols().some(t=>t.getColDef().floatingFilter)}getFilterInstance(e){const t=this.beans.colModel.getColDefCol(e);if(!t)return Promise.resolve(void 0);const n=this.getOrCreateFilterUi(t);return n?new Promise(o=>{n.then(s=>{o(Up(s))})}):Promise.resolve(null)}processFilterModelUpdateQueue(){this.modelUpdates.forEach(({model:e,source:t})=>this.setModel(e,t)),this.modelUpdates=[],this.columnModelUpdates.forEach(({key:e,model:t,resolve:n})=>{this.setModelForColumn(e,t).then(()=>n())}),this.columnModelUpdates=[]}getModelForColumn(e,t){if(t){const{state:o,model:s}=this,r=e.getColId(),i=o.get(r);return i?i.model??null:Vo(s,r)}const n=this.cachedFilter(e);return n?this.getModelFromFilterWrapper(n):null}setModelForColumn(e,t){var n;if((n=this.beans.dataTypeSvc)!=null&&n.isPendingInference){let o=()=>{};const s=new Promise(r=>{o=r});return this.columnModelUpdates.push({key:e,model:t,resolve:o}),s}return new Promise(o=>{this.setModelForColumnLegacy(e,t).then(s=>o(s))})}getStateForColumn(e){return this.state.get(e)??{model:Vo(this.model,e)}}setModelForColumnLegacy(e,t){const n=this.beans.colModel.getColDefCol(e),o=n?this.getOrCreateFilterWrapper(n,!0):null;return o?this.setModelOnFilterWrapper(o,t):Xn.resolve()}setColDefPropsForDataType(e,t,n){var u;const o=e.filter,s=o===!0?this.getDefaultFilterFromDataType(()=>t.baseDataType):o;if(typeof s!="string")return;let r,i;const a=this.beans,{filterParams:l,filterValueGetter:c}=e;s==="agMultiColumnFilter"?{filterParams:r,filterValueGetter:i}=((u=a.multiFilter)==null?void 0:u.getParamsForDataType(l,c,t,n))??{}:{filterParams:r,filterValueGetter:i}=Tfe(s,l,c,t,n,a,this.getLocaleTextFunc()),e.filterParams=r,i&&(e.filterValueGetter=i)}setColFilterActive(e,t,n,o){e.filterActive!==t&&(e.filterActive=t,e.dispatchColEvent("filterActiveChanged",n)),e.dispatchColEvent("filterChanged",n,o)}setModelOnFilterWrapper(e,t,n){return new Xn(o=>{if(e.isHandler){const r=e.column,i=r.getColId(),a=this.model[i];if(this.updateStoredModel(i,t),n&&t===a){o();return}this.refreshHandlerAndUi(r,t,"api").then(()=>o());return}const s=Fl(e);if(s){s.then(r=>{if(typeof(r==null?void 0:r.setModel)!="function"){Je(65),o();return}(r.setModel(t)||Xn.resolve()).then(()=>o())});return}o()})}updateStoredModel(e,t){ht(t)?this.model[e]=t:delete this.model[e];const n=this.state.get(e),o={model:t,state:n==null?void 0:n.state};this.state.set(e,o)}filterModified(e,t){var n;(n=this.getOrCreateFilterUi(e))==null||n.then(o=>{this.eventSvc.dispatchEvent({type:"filterModified",column:e,filterInstance:o,...t})})}filterUiChanged(e,t){this.gos.get("enableFilterHandlers")&&this.eventSvc.dispatchEvent({type:"filterUiChanged",column:e,...t})}floatingFilterUiChanged(e,t){this.gos.get("enableFilterHandlers")&&this.eventSvc.dispatchEvent({type:"floatingFilterUiChanged",column:e,...t})}updateModel(e,t,n){var i;const o=e.getColId(),s=this.cachedFilter(e),r=()=>s==null?void 0:s.filterUi;V2(t,r,()=>Vo(this.model,o),()=>this.state.get(o),a=>this.updateState(e,a),a=>{var l,c;return(c=(l=r())==null?void 0:l.filterParams)==null?void 0:c.onModelChange(a,n)},s!=null&&s.isHandler?(i=s.handler.processModelToApply)==null?void 0:i.bind(s.handler):void 0)}updateAllModels(e,t){const n=[];this.allColumnFilters.forEach((o,s)=>{var i;const r=this.beans.colModel.getColDefCol(s);r&&V2(e,()=>o.filterUi,()=>Vo(this.model,s),()=>this.state.get(s),a=>this.updateState(r,a),a=>{this.updateStoredModel(s,a),this.dispatchLocalEvent({type:"filterAction",column:r,action:e}),n.push(this.refreshHandlerAndUi(r,a,"ui"))},o!=null&&o.isHandler?(i=o.handler.processModelToApply)==null?void 0:i.bind(o.handler):void 0)}),n.length&&Xn.all(n).then(()=>{this.callOnFilterChangedOutsideRenderCycle({source:"columnFilter",additionalEventAttributes:t,columns:[]})})}updateOrRefreshFilterUi(e){const t=e.getColId();L2(()=>{var n;return(n=this.cachedFilter(e))==null?void 0:n.filterUi},()=>Vo(this.model,t),()=>this.state.get(t))}updateState(e,t){this.state.set(e.getColId(),t),this.dispatchLocalEvent({type:"filterStateChanged",column:e,state:t})}canApplyAll(){const{state:e,model:t,activeFilterComps:n}=this;for(const s of n)if(s.source==="COLUMN_MENU")return!1;let o=!1;for(const s of e.keys()){const r=e.get(s);if(r.valid===!1)return!1;(r.model??null)!==Vo(t,s)&&(o=!0)}return o}hasUnappliedModel(e){var o;const{model:t,state:n}=this;return(((o=n.get(e))==null?void 0:o.model)??null)!==Vo(t,e)}setGlobalButtons(e){this.isGlobalButtons=e,this.dispatchLocalEvent({type:"filterGlobalButtons",isGlobal:e})}shouldKeepStateOnDetach(e,t){if(t==="newFiltersToolPanel")return!0;const n=this.beans.filterPanelSvc;return n!=null&&n.isActive?!!n.getState(e.getColId()):!1}destroy(){super.destroy(),this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear(),this.state.clear(),this.activeFilterComps.clear()}};function Ube(e){var t;return!!((t=e.filterManager)!=null&&t.isAnyFilterPresent())}function Wbe(e,t="api"){var n;(n=e.filterManager)==null||n.onFilterChanged({source:t})}var zbe=class extends je{constructor(){super(...arguments),this.beanName="filterManager",this.advFilterModelUpdateQueue=[]}wireBeans(e){this.quickFilter=e.quickFilter,this.advancedFilter=e.advancedFilter,this.colFilter=e.colFilter}postConstruct(){const e=this.refreshFiltersForAggregations.bind(this),t=this.updateAdvFilterColumns.bind(this);this.addManagedEventListeners({columnValueChanged:e,columnPivotChanged:e,columnPivotModeChanged:e,newColumnsLoaded:t,columnVisible:t,advancedFilterEnabledChanged:({enabled:o})=>this.onAdvFilterEnabledChanged(o),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],()=>{this.onFilterChanged({source:"api"})}),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",()=>{this.updateAggFiltering(),this.onFilterChanged()}),this.quickFilter&&this.addManagedListeners(this.quickFilter,{quickFilterChanged:()=>this.onFilterChanged({source:"quickFilter"})});const{gos:n}=this;this.alwaysPassFilter=n.get("alwaysPassFilter"),this.addManagedPropertyListener("alwaysPassFilter",()=>{this.alwaysPassFilter=n.get("alwaysPassFilter"),this.onFilterChanged({source:"api"})})}isExternalFilterPresentCallback(){const e=this.gos.getCallback("isExternalFilterPresent");return typeof e=="function"&&e({})}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return typeof t=="function"&&t(e)}setFilterState(e,t,n="api"){var o;this.isAdvFilterEnabled()||(o=this.colFilter)==null||o.setState(e,t,n)}setFilterModel(e,t="api",n){var o;if(this.isAdvFilterEnabled()){n||this.warnAdvFilters();return}(o=this.colFilter)==null||o.setModel(e,t)}getFilterModel(){var e;return((e=this.colFilter)==null?void 0:e.getModel())??{}}getFilterState(){var e;return(e=this.colFilter)==null?void 0:e.getState()}isColumnFilterPresent(){var e;return!!((e=this.colFilter)!=null&&e.isFilterPresent())}isAggregateFilterPresent(){var e;return!!((e=this.colFilter)!=null&&e.isAggFilterPresent())}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.externalFilterPresent||this.isAdvFilterPresent()}isAnyFilterPresent(){return this.isChildFilterPresent()||this.isAggregateFilterPresent()}isAdvFilterPresent(){return this.isAdvFilterEnabled()&&this.advancedFilter.isFilterPresent()}onAdvFilterEnabledChanged(e){var t,n;e?(t=this.colFilter)!=null&&t.disableFilters()&&this.onFilterChanged({source:"advancedFilter"}):(n=this.advancedFilter)!=null&&n.isFilterPresent()&&(this.advancedFilter.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvFilterEnabled(){var e;return!!((e=this.advancedFilter)!=null&&e.isEnabled())}isAdvFilterHeaderActive(){return this.isAdvFilterEnabled()&&this.advancedFilter.isHeaderActive()}refreshFiltersForAggregations(){f_(this.gos)&&this.isAnyFilterPresent()&&this.onFilterChanged()}onFilterChanged(e={}){const{source:t,additionalEventAttributes:n,columns:o=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.colFilter?this.colFilter.updateBeforeFilterChanged(e):Xn.resolve()).then(()=>{var r;const s={source:t,type:"filterChanged",columns:o};n&&ps(s,n),this.eventSvc.dispatchEvent(s),(r=this.colFilter)==null||r.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){var e;return!!((e=this.colFilter)!=null&&e.isSuppressFlashingCellsBecauseFiltering())}isQuickFilterPresent(){var e;return!!((e=this.quickFilter)!=null&&e.isFilterPresent())}updateAggFiltering(){this.aggFiltering=!!f_(this.gos)}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.beans.colModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(e,t){return this.doesRowPassFilter({rowNode:t,colIdToSkip:e})}doesRowPassAggregateFilters(e){var n;const{rowNode:t}=e;return(n=this.alwaysPassFilter)!=null&&n.call(this,t)?!0:!(this.isAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.isAggregateFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip,!0))}doesRowPassFilter(e){var n;const{rowNode:t}=e;return(n=this.alwaysPassFilter)!=null&&n.call(this,t)?!0:!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.externalFilterPresent&&!this.doesExternalFilterPass(t)||this.isColumnFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip)||this.isAdvFilterPresent()&&!this.advancedFilter.doesFilterPass(t))}isFilterAllowed(e){var t;return this.isAdvFilterEnabled()?!1:!!((t=this.colFilter)!=null&&t.isFilterAllowed(e))}getAdvFilterModel(){return this.isAdvFilterEnabled()?this.advancedFilter.getModel():null}setAdvFilterModel(e,t="api"){var n;if(this.isAdvFilterEnabled()){if((n=this.beans.dataTypeSvc)!=null&&n.isPendingInference){this.advFilterModelUpdateQueue.push(e);return}this.advancedFilter.setModel(e??null),this.onFilterChanged({source:t})}}toggleAdvFilterBuilder(e,t){this.isAdvFilterEnabled()&&this.advancedFilter.getCtrl().toggleFilterBuilder({source:t,force:e})}updateAdvFilterColumns(){this.isAdvFilterEnabled()&&this.advancedFilter.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){var e;return this.isAdvFilterEnabled()?!1:!!((e=this.colFilter)!=null&&e.hasFloatingFilters())}getColumnFilterInstance(e){var t;return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve(void 0)):((t=this.colFilter)==null?void 0:t.getFilterInstance(e))??Promise.resolve(void 0)}warnAdvFilters(){Je(68)}setupAdvFilterHeaderComp(e){var t;(t=this.advancedFilter)==null||t.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvFilterHeaderActive()?this.advancedFilter.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){for(const e of this.advFilterModelUpdateQueue)this.setAdvFilterModel(e);this.advFilterModelUpdateQueue=[]}setColumnFilterModel(e,t){var n;return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve()):((n=this.colFilter)==null?void 0:n.setModelForColumn(e,t))??Promise.resolve()}},jbe=class extends je{constructor(){super(...arguments),this.beanName="filterMenuFactory"}wireBeans(e){this.popupSvc=e.popupSvc}hideActiveMenu(){var e;(e=this.hidePopup)==null||e.call(this)}showMenuAfterMouseEvent(e,t,n,o){e&&!e.isColumn||this.showPopup(e,s=>{var r;(r=this.popupSvc)==null||r.positionPopupUnderMouseEvent({column:e,type:n,mouseEvent:t,ePopup:s})},n,t.target,Xs(this.gos),o)}showMenuAfterButtonClick(e,t,n,o){if(e&&!e.isColumn)return;let s=-1,r="left";const i=Xs(this.gos);!i&&this.gos.get("enableRtl")&&(s=1,r="right");const a=i?void 0:4*s,l=i?void 0:4;this.showPopup(e,c=>{var u;(u=this.popupSvc)==null||u.positionPopupByComponent({type:n,eventSource:t,ePopup:c,nudgeX:a,nudgeY:l,alignSide:r,keepWithinBounds:!0,position:"under",column:e})},n,t,i,o)}showPopup(e,t,n,o,s,r){var g;const i=e?this.createBean(new _fe(e,"COLUMN_MENU")):void 0;if(this.activeMenu=i,!(i!=null&&i.hasFilter())||!e){Rn(57);return}const a=uo({tag:"div",cls:`ag-menu${s?"":" ag-filter-menu"}`,role:"presentation"});[this.tabListener]=this.addManagedElementListeners(a,{keydown:v=>this.trapFocusWithin(v,a)}),a.appendChild(i==null?void 0:i.getGui());let l;const c=()=>i==null?void 0:i.afterGuiDetached(),u=Gue(this.gos)?o??this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody:void 0,d=v=>{l$(e,!1,"contextMenu");const C=v instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),C&&o&&Pi(o)){const S=f2(o);S==null||S.focus({preventScroll:!0})}c(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,n,e),r==null||r()},h=this.getLocaleTextFunc(),f=s&&n!=="columnFilter"?h("ariaLabelColumnMenu","Column Menu"):h("ariaLabelColumnFilter","Column Filter"),p=(g=this.popupSvc)==null?void 0:g.addPopup({modal:!0,eChild:a,closeOnEsc:!0,closedCallback:d,positionCallback:()=>t(a),anchorToElement:u,ariaLabel:f});p&&(this.hidePopup=l=p.hideFunc),i.afterInit().then(()=>{t(a),i.afterGuiAttached({container:n,hidePopup:l})}),l$(e,!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,n,e)}trapFocusWithin(e,t){e.key!==Le.TAB||e.defaultPrevented||Xc(this.beans,t,!1,e.shiftKey)||(e.preventDefault(),Yc(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,n){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:t,column:n??null,columnGroup:null})}isMenuEnabled(e){return e.isFilterAllowed()&&(e.getColDef().menuTabs??["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}},Kbe=class extends je{constructor(){super(...arguments),this.beanName="filterValueSvc"}getValue(e,t,n){if(!t)return;const o=e.getColDef(),{selectableFilter:s,valueSvc:r}=this.beans,i=n??(s==null?void 0:s.getFilterValueGetter(e.getColId()))??o.filterValueGetter;return i?this.executeFilterValueGetter(i,t.data,e,t,o):r.getValue(e,t)}executeFilterValueGetter(e,t,n,o,s){const{expressionSvc:r,valueSvc:i}=this.beans,a=Ot(this.gos,{data:t,node:o,column:n,colDef:s,getValue:i.getValueCallback.bind(i,o)});return typeof e=="function"?e(a):r==null?void 0:r.evaluate(e,a)}},qbe={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eFloatingFilterText"}]},Ybe=class extends Sn{constructor(){super(qbe,[nw]),this.eFloatingFilterText=dt}init(e){this.params=e;const t=this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0);if(this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`),this.gos.get("enableFilterHandlers")){const n=e,o=n.getHandler();if(o.getModelAsString){const s=o.getModelAsString(n.model);this.eFloatingFilterText.setValue(s)}}}onParentModelChanged(e){if(e==null){this.eFloatingFilterText.setValue("");return}this.params.parentFilterInstance(t=>{if(t.getModelAsString){const n=t.getModelAsString(e);this.eFloatingFilterText.setValue(n)}})}refresh(e){this.init(e)}},$R=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions??t,this.mapCustomOptions(),this.defaultOption=this.getDefaultItem(e.defaultOption)}refresh(e,t){const n=e.filterOptions??t;this.filterOptions!==n&&(this.filterOptions=n,this.customFilterOptions={},this.mapCustomOptions()),this.defaultOption=this.getDefaultItem(e.defaultOption)}mapCustomOptions(){const{filterOptions:e}=this;if(e)for(const t of e){if(typeof t=="string")continue;const n=[["displayKey"],["displayName"],["predicate","test"]],o=s=>s.some(r=>t[r]!=null)?!0:(Je(72,{keys:s}),!1);if(!n.every(o)){this.filterOptions=e.filter(s=>s===t)||[];continue}this.customFilterOptions[t.displayKey]=t}}getDefaultItem(e){const{filterOptions:t}=this;if(e)return e;if(t.length>=1){const n=t[0];if(typeof n=="string")return n;if(n.displayKey)return n.displayKey;Je(73)}else Je(74)}getCustomOption(e){return this.customFilterOptions[e]}};function ng(e,t,n){return n==null?e.splice(t):e.splice(t,n)}function Pw(e){return e==null||typeof e=="string"&&e.trim().length===0}function Xbe(e){return e==="AND"||e==="OR"?e:"AND"}function Zbe(e,t,n){if(e==null)return;const{predicate:o}=e;if(o!=null&&!t.some(s=>s==null))return o(t,n)}function Jbe(e,t){let n=e.length;return n>t&&(e.splice(t),Je(78),n=t),n}function og(e,t){const n=t.getCustomOption(e);if(n){const{numberOfInputs:s}=n;return s??1}return e&&["empty","notBlank","blank"].indexOf(e)>=0?0:e==="inRange"?2:1}var HR=class extends Afe{constructor(e,t,n){super(e,"simple-filter"),this.mapValuesFromModel=t,this.defaultOptions=n,this.eTypes=[],this.eJoinPanels=[],this.eJoinAnds=[],this.eJoinOrs=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}setParams(e){super.setParams(e);const t=new $R;this.optionsFactory=t,t.init(e,this.defaultOptions),this.commonUpdateSimpleParams(e),this.createOption(),this.createMissingConditionsAndOperators()}updateParams(e,t){this.optionsFactory.refresh(e,this.defaultOptions),super.updateParams(e,t),this.commonUpdateSimpleParams(e)}commonUpdateSimpleParams(e){this.setNumConditions(e),this.defaultJoinOperator=Xbe(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.createFilterListOptions();const t=this.getGui();this.isReadOnly()?t.setAttribute("tabindex","-1"):t.removeAttribute("tabindex")}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged("immediately",!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((t,n)=>{const o=n===0?e:this.optionsFactory.defaultOption;t.setValue(o,!0)})}getModelFromUi(){const e=this.getUiCompleteConditions();return e.length===0?null:this.maxNumConditions>1&&e.length>1?{filterType:this.filterType,operator:this.getJoinOperator(),conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map(e=>e.getValue())}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){const{eJoinOrs:e,defaultJoinOperator:t}=this;return e.length===0?t:e[0].getValue()===!0?"OR":"AND"}areNonNullModelsEqual(e,t){const n=!e.operator,o=!t.operator;if(!n&&o||n&&!o)return!1;let r;if(n){const i=e,a=t;r=this.areSimpleModelsEqual(i,a)}else{const i=e,a=t;r=i.operator===a.operator&&Il(i.conditions,a.conditions,(l,c)=>this.areSimpleModelsEqual(l,c))}return r}setModelIntoUi(e,t){if(e==null)return this.resetUiToDefaults(t),Xn.resolve();if(e.operator){const o=e;let s=o.conditions;s==null&&(s=[],Je(77));const r=Jbe(s,this.maxNumConditions),i=this.getNumConditions();if(r<i)this.removeConditionsAndOperators(r);else if(r>i)for(let l=i;l<r;l++)this.createJoinOperatorPanel(),this.createOption();const a=o.operator==="OR";this.eJoinAnds.forEach(l=>l.setValue(!a,!0)),this.eJoinOrs.forEach(l=>l.setValue(a,!0)),s.forEach((l,c)=>{this.eTypes[c].setValue(l.type,!0),this.setConditionIntoUi(l,c)})}else{const o=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(o.type,!0),this.setConditionIntoUi(o,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.updateUiVisibility(),t||this.params.onUiChange(this.getUiChangeEventParams()),Xn.resolve()}setNumConditions(e){let t=e.maxNumConditions??2;t<1&&(Je(79),t=1),this.maxNumConditions=t;let n=e.numAlwaysVisibleConditions??1;n<1&&(Je(80),n=1),n>t&&(Je(81),n=t),this.numAlwaysVisibleConditions=n}createOption(){const e=this.getGui(),t=this.createManagedBean(new V_);this.eTypes.push(t),t.addCss("ag-filter-select"),e.appendChild(t.getGui());const n=this.createEValue();this.eConditionBodies.push(n),e.appendChild(n),this.putOptionsIntoDropdown(t),this.resetType(t);const o=this.getNumConditions()-1;this.forEachPositionInput(o,s=>this.resetInput(s)),this.addChangedListeners(t,o)}createJoinOperatorPanel(){const e=uo({tag:"div",cls:"ag-filter-condition"});this.eJoinPanels.push(e);const t=this.createJoinOperator(this.eJoinAnds,e,"and"),n=this.createJoinOperator(this.eJoinOrs,e,"or");this.getGui().appendChild(e);const o=this.eJoinPanels.length-1,s=this.joinOperatorId++;this.resetJoinOperatorAnd(t,o,s),this.resetJoinOperatorOr(n,o,s),this.isReadOnly()||(t.onValueChange(this.listener),n.onValueChange(this.listener))}createJoinOperator(e,t,n){const o=this.createManagedBean(new uhe);e.push(o);const s="ag-filter-condition-operator";return o.addCss(s),o.addCss(`${s}-${n}`),t.appendChild(o.getGui()),o}createFilterListOptions(){this.filterListOptions=this.optionsFactory.filterOptions.map(e=>typeof e=="string"?this.createBoilerplateListOption(e):this.createCustomListOption(e))}putOptionsIntoDropdown(e){const{filterListOptions:t}=this;for(const n of t)e.addOption(n);e.setDisabled(t.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,n=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:n?this.getLocaleTextFunc()(n.displayKey,n.displayName):this.translate(t)}}createBodyTemplate(){return null}getAgComponents(){return[]}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){let e=-1,t=!0;for(let n=0;n<this.getNumConditions();n++)this.isConditionUiComplete(n)?e=n:t=!1;if(this.shouldAddNewConditionAtEnd(t))this.createJoinOperatorPanel(),this.createOption();else{const n=this.lastUiCompletePosition??this.getNumConditions()-2;if(e<n){this.removeConditionsAndOperators(n+1);const o=e+1,s=n-o;s>0&&this.removeConditionsAndOperators(o,s),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=e}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((o,s)=>{const r=this.isConditionDisabled(s,e);o.setDisabled(r||this.filterListOptions.length<=1),s===1&&(Dp(this.eJoinPanels[0],r),this.eJoinAnds[0].setDisabled(r),this.eJoinOrs[0].setDisabled(r))}),this.eConditionBodies.forEach((o,s)=>{Un(o,this.isConditionBodyVisible(s))});const n=(t??this.getJoinOperator())==="OR";for(const o of this.eJoinAnds)o.setValue(!n,!0);for(const o of this.eJoinOrs)o.setValue(n,!0);this.forEachInput((o,s,r,i)=>{this.setElementDisplayed(o,s<i),this.setElementDisabled(o,this.isConditionDisabled(r,e))}),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;const{eTypes:n,eConditionBodies:o,eJoinPanels:s,eJoinAnds:r,eJoinOrs:i}=this;this.removeComponents(n,e,t),this.removeElements(o,e,t),this.removeEValues(e,t);const a=Math.max(e-1,0);this.removeElements(s,a,t),this.removeComponents(r,a,t),this.removeComponents(i,a,t)}removeElements(e,t,n){const o=ng(e,t,n);for(const s of o)Jr(s)}removeComponents(e,t,n){const o=ng(e,t,n);for(const s of o)Jr(s.getGui()),this.destroyBean(s)}afterGuiAttached(e){var t;if(super.afterGuiAttached(e),this.resetPlaceholder(),!(e!=null&&e.suppressFocus)){let n;if(!this.isReadOnly()){const o=this.getInputs(0)[0];o instanceof Zc&&this.isConditionBodyVisible(0)?n=o.getInputElement():n=(t=this.eTypes[0])==null?void 0:t.getFocusableElement()}(n??this.getGui()).focus({preventScroll:!0})}}afterGuiDetached(){var i;super.afterGuiDetached();const e=this.params;if((i=this.beans.colFilter)!=null&&i.shouldKeepStateOnDetach(e.column))return;e.onStateChange({model:e.model});let t=-1,n=-1,o=!1;const s=this.getJoinOperator();for(let a=this.getNumConditions()-1;a>=0;a--)if(this.isConditionUiComplete(a))t===-1&&(t=a,n=a);else{const l=a>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(a-1),c=a<t;(l||c)&&(this.removeConditionsAndOperators(a,1),o=!0,c&&n--)}let r=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),r=!0),this.shouldAddNewConditionAtEnd(n===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),r=!0),r&&this.updateConditionStatusesAndValues(n,s),o&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=n}getModelAsString(e){var t,n;return((n=(t=this.params.getHandler())==null?void 0:t.getModelAsString)==null?void 0:n.call(t,e))??""}getPlaceholderText(e,t){let n=this.translate(e);if(typeof this.filterPlaceholder=="function"){const o=this.eTypes[t].getValue(),s=this.translate(o);n=this.filterPlaceholder({filterOptionKey:o,filterOption:s,placeholder:n})}else typeof this.filterPlaceholder=="string"&&(n=this.filterPlaceholder);return n}resetPlaceholder(){const e=this.getLocaleTextFunc();this.forEachInput((t,n,o,s)=>{if(!(t instanceof Zc))return;const r=n===0&&s>1?"inRangeStart":n===0?"filterOoo":"inRangeEnd",i=n===0&&s>1?e("ariaFilterFromValue","Filter from value"):n===0?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(r,o)),t.setInputAriaLabel(i)})}setElementValue(e,t,n){e instanceof Zc&&e.setValue(t!=null?String(t):null,!0)}setElementDisplayed(e,t){QB(e)&&Un(e.getGui(),t)}setElementDisabled(e,t){QB(e)&&Dp(e.getGui(),t)}attachElementOnChange(e,t){e instanceof Zc&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach((t,n)=>{this.forEachPositionTypeInput(n,t,e)})}forEachPositionInput(e,t){const n=this.getConditionType(e);this.forEachPositionTypeInput(e,n,t)}forEachPositionTypeInput(e,t,n){const o=og(t,this.optionsFactory),s=this.getInputs(e);for(let r=0;r<s.length;r++){const i=s[r];i!=null&&n(i,r,e,o)}}isConditionDisabled(e,t){return this.isReadOnly()?!0:e===0?!1:e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return og(t,this.optionsFactory)>0}isConditionUiComplete(e){return!(e>=this.getNumConditions()||this.getConditionType(e)==="empty"||this.getValues(e).some(n=>n==null))}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const e=[];for(let t=0;t<this.getNumConditions();t++)this.isConditionUiComplete(t)&&e.push(this.createCondition(t));return e}createMissingConditionsAndOperators(){if(!this.isReadOnly())for(let e=this.getNumConditions();e<this.numAlwaysVisibleConditions;e++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach(t=>this.resetType(t)),this.eJoinAnds.forEach((t,n)=>this.resetJoinOperatorAnd(t,n,this.joinOperatorId+n)),this.eJoinOrs.forEach((t,n)=>this.resetJoinOperatorOr(t,n,this.joinOperatorId+n)),this.joinOperatorId++,this.forEachInput(t=>this.resetInput(t)),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,this.updateUiVisibility(),e||this.params.onUiChange(this.getUiChangeEventParams())}resetType(e){const n=this.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.defaultOption,!0).setAriaLabel(n).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,n){this.resetJoinOperator(e,t,this.defaultJoinOperator==="AND",this.translate("andCondition"),n)}resetJoinOperatorOr(e,t,n){this.resetJoinOperator(e,t,this.defaultJoinOperator==="OR",this.translate("orCondition"),n)}resetJoinOperator(e,t,n,o,s){this.updateJoinOperatorDisabled(e.setValue(n,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${s}`).setLabel(o),t)}updateJoinOperatorsDisabled(){const e=(t,n)=>this.updateJoinOperatorDisabled(t,n);this.eJoinAnds.forEach(e),this.eJoinOrs.forEach(e)}updateJoinOperatorDisabled(e,t){e.setDisabled(this.isReadOnly()||t>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,t){const n=this.mapValuesFromModel(e,this.optionsFactory);this.forEachInput((o,s,r)=>{r===t&&this.setElementValue(o,n[s]!=null?n[s]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,n,o)=>{this.setElementValue(t,n===0&&o===0?e:null,!0)})}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,n=>{this.attachElementOnChange(n,this.listener)}))}hasInvalidInputs(){return!1}isReadOnly(){return!!this.params.readOnly}},RH=class{constructor(e,t,n,o,s,r){this.alive=!0,this.context=e,this.eParent=s;const i=zde(t,n,o);i&&i.newAgStackInstance().then(a=>{var u,d;if(!this.alive){e.destroyBean(a);return}if(this.dateComp=a,!a)return;s.appendChild(a.getGui()),(u=a==null?void 0:a.afterGuiAttached)==null||u.call(a);const{tempValue:l,disabled:c}=this;l&&a.setDate(l),c!=null&&((d=a.setDisabled)==null||d.call(a,c)),r==null||r(this)})}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){const t=this.dateComp;t?t.setDate(e):this.tempValue=e}setDisabled(e){var n;const t=this.dateComp;t?(n=t.setDisabled)==null||n.call(t,e):this.disabled=e}setDisplayed(e){Un(this.eParent,e)}setInputPlaceholder(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.setInputPlaceholder)==null||n.call(t,e)}setInputAriaLabel(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.setInputAriaLabel)==null||n.call(t,e)}afterGuiAttached(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.afterGuiAttached)==null||n.call(t,e)}updateParams(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.refresh)==null||n.call(t,e)}},GR=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"];function TH(e,t){const{dateFrom:n,dateTo:o,type:s}=e||{};return[n&&Ds(n,void 0,!0)||null,o&&Ds(o,void 0,!0)||null].slice(0,og(s,t))}var DH=1e3,IH=1/0,Qbe=class extends HR{constructor(){super("dateFilter",TH,GR),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=DH,this.maxValidYear=IH,this.minValidDate=null,this.maxValidDate=null,this.filterType="date"}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}commonUpdateSimpleParams(e){super.commonUpdateSimpleParams(e);const t=(l,c)=>{const u=e[l];if(u!=null)if(isNaN(u))Je(82,{param:l});else return u==null?c:Number(u);return c},n=t("minValidYear",DH),o=t("maxValidYear",IH);this.minValidYear=n,this.maxValidYear=o,n>o&&Je(83);const{minValidDate:s,maxValidDate:r}=e,i=s instanceof Date?s:Ds(s);this.minValidDate=i;const a=r instanceof Date?r:Ds(r);this.maxValidDate=a,i&&a&&i>a&&Je(84)}createDateCompWrapper(e){const{beans:{userCompFactory:t,context:n,gos:o},params:s}=this,r=new RH(n,t,s.colDef,Ot(o,{onDateChanged:()=>this.onUiChanged(),filterParams:s,location:"filter"}),e);return this.addDestroyFunc(()=>r.destroy()),r}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}createEValue(){const e=uo({tag:"div",cls:"ag-filter-body"});return this.createFromToElement(e,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(e,this.eConditionPanelsTo,this.dateConditionToComps,"to"),e}createFromToElement(e,t,n,o){const s=uo({tag:"div",cls:`ag-filter-${o} ag-filter-date-${o}`});t.push(s),e.appendChild(s),n.push(this.createDateCompWrapper(s))}removeEValues(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),ng(this.eConditionPanelsFrom,e,t),ng(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,n){const o=ng(e,t,n);for(const s of o)s.destroy()}isValidDateValue(e){if(e===null)return!1;const{minValidDate:t,maxValidDate:n,minValidYear:o,maxValidYear:s}=this;if(t){if(e<t)return!1}else if(e.getUTCFullYear()<o)return!1;if(n){if(e>n)return!1}else if(e.getUTCFullYear()>s)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput((n,o,s,r)=>{s!==e||!t||o>=r||(t=t&&this.isValidDateValue(n.getDate()))}),t}areSimpleModelsEqual(e,t){return e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}createCondition(e){const t=this.getConditionType(e),n={},o=this.getValues(e),s=this.params.useIsoSeparator?"T":" ";return o.length>0&&(n.dateFrom=Zs(o[0],!0,s)),o.length>1&&(n.dateTo=Zs(o[1],!0,s)),{dateFrom:null,dateTo:null,filterType:this.filterType,type:t,...n}}resetPlaceholder(){const e=this.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),n=e("ariaFilterValue","Filter Value");this.forEachInput(o=>{o.setInputPlaceholder(t),o.setInputAriaLabel(n)})}getInputs(e){const{dateConditionFromComps:t,dateConditionToComps:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(n,o,s,r)=>{o<r&&t.push(n.getDate())}),t}translate(e){return e==="lessThan"?super.translate("before"):e==="greaterThan"?super.translate("after"):super.translate(e)}},xH=class extends je{constructor(e,t){super(),this.mapValuesFromModel=e,this.defaultOptions=t}init(e){const t=e.filterParams,n=new $R;this.optionsFactory=n,n.init(t,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(n,t)),this.updateParams(e),this.validateModel(e)}refresh(e){if(e.source==="colDef"){const t=e.filterParams,n=this.optionsFactory;n.refresh(t,this.defaultOptions),this.filterModelFormatter.updateParams({optionsFactory:n,filterParams:t}),this.updateParams(e)}this.validateModel(e)}updateParams(e){this.params=e}doesFilterPass(e){const t=e.model;if(t==null)return!0;const{operator:n}=t,o=[];if(n){const i=t;o.push(...i.conditions??[])}else o.push(t);const s=n&&n==="OR"?"some":"every",r=this.params.getValue(e.node);return o[s](i=>this.individualConditionPasses(e,i,r))}getModelAsString(e,t){return this.filterModelFormatter.getModelAsString(e,t)??""}validateModel(e){const{model:t,filterParams:{filterOptions:n,maxNumConditions:o}}=e;if(t==null)return;let r=W2(t)?t.conditions:[t];const i=(n==null?void 0:n.map(u=>typeof u=="string"?u:u.displayKey))??this.defaultOptions;if(!(!r||r.every(u=>i.find(d=>d===u.type)!==void 0))){this.params={...e,model:null},e.onModelChange(null);return}let l=!1;const c=this.filterType;if((r&&!r.every(u=>u.filterType===c)||t.filterType!==c)&&(r=r.map(u=>({...u,filterType:c})),l=!0),typeof o=="number"&&r&&r.length>o&&(r=r.slice(0,o),l=!0),l){const u=r.length>1?{...t,filterType:c,conditions:r}:{...r[0],filterType:c};this.params={...e,model:u},e.onModelChange(u)}}individualConditionPasses(e,t,n){const o=this.optionsFactory,s=this.mapValuesFromModel(t,o),r=o.getCustomOption(t.type),i=Zbe(r,s,n);return i??(n==null?this.evaluateNullValue(t.type):this.evaluateNonNullValue(s,n,t,e))}},PH=class extends xH{evaluateNullValue(e){const{includeBlanksInEquals:t,includeBlanksInNotEqual:n,includeBlanksInGreaterThan:o,includeBlanksInLessThan:s,includeBlanksInRange:r}=this.params.filterParams;switch(e){case"equals":if(t)return!0;break;case"notEqual":if(n)return!0;break;case"greaterThan":case"greaterThanOrEqual":if(o)return!0;break;case"lessThan":case"lessThanOrEqual":if(s)return!0;break;case"inRange":if(r)return!0;break;case"blank":return!0;case"notBlank":return!1}return!1}evaluateNonNullValue(e,t,n){const o=n.type;if(!this.isValid(t))return o==="notEqual"||o==="notBlank";const s=this.comparator(),r=e[0]!=null?s(e[0],t):0;switch(o){case"equals":return r===0;case"notEqual":return r!==0;case"greaterThan":return r>0;case"greaterThanOrEqual":return r>=0;case"lessThan":return r<0;case"lessThanOrEqual":return r<=0;case"inRange":{const i=s(e[1],t);return this.params.filterParams.inRangeInclusive?r>=0&&i<=0:r>0&&i<0}case"blank":return Pw(t);case"notBlank":return!Pw(t);default:return Je(76,{filterModelType:o}),!0}}},kH={equals:"Equals",notEqual:"NotEqual",greaterThan:"GreaterThan",greaterThanOrEqual:"GreaterThanOrEqual",lessThan:"LessThan",lessThanOrEqual:"LessThanOrEqual",inRange:"InRange"},eSe={contains:"Contains",notContains:"NotContains",equals:"TextEquals",notEqual:"TextNotEqual",startsWith:"StartsWith",endsWith:"EndsWith",inRange:"InRange"},UR=class extends je{constructor(e,t,n){super(),this.optionsFactory=e,this.filterParams=t,this.valueFormatter=n}getModelAsString(e,t){const n=this.getLocaleTextFunc(),o=t==="filterToolPanel";if(!e)return o?Al(this,"filterSummaryInactive"):null;if(e.operator!=null){const r=e,a=(r.conditions??[]).map(c=>this.getModelAsString(c,t)),l=r.operator==="AND"?"andCondition":"orCondition";return a.join(` ${Al(this,l)} `)}else{if(e.type==="blank"||e.type==="notBlank")return o?Al(this,e.type==="blank"?"filterSummaryBlank":"filterSummaryNotBlank"):n(e.type,e.type);{const r=e,i=this.optionsFactory.getCustomOption(r.type),{displayKey:a,displayName:l,numberOfInputs:c}=i||{};return a&&l&&c===0?n(a,l):this.conditionToString(r,o,r.type==="inRange"||c===2,a,l)}}}updateParams(e){const{optionsFactory:t,filterParams:n}=e;this.optionsFactory=t,this.filterParams=n}conditionForToolPanel(e,t,n,o,s,r){let i;const a=this.getTypeKey(e);return a&&(i=Al(this,a)),s&&r&&(i=this.getLocaleTextFunc()(s,r)),i!=null?t?`${i} ${Al(this,"filterSummaryInRangeValues",[n(),o()])}`:`${i} ${n()}`:null}getTypeKey(e){const t=this.filterTypeKeys[e];return t?`filterSummary${t}`:null}formatValue(e){const t=this.valueFormatter;return t?t(e??null)??"":String(e)}},FH=class extends UR{constructor(e,t){super(e,t,n=>{const{dataTypeSvc:o,valueSvc:s}=this.beans,r=t.column,i=o==null?void 0:o.getDateFormatterFunction(r),a=i?i(n??void 0):n;return s.formatValue(r,null,a)}),this.filterTypeKeys=kH}conditionToString(e,t,n,o,s){const{type:r}=e,i=Ds(e.dateFrom),a=Ds(e.dateTo),l=this.filterParams.inRangeFloatingFilterDateFormat,c=t?this.formatValue.bind(this):h=>F_(h,l),u=()=>i!==null?c(i):"null",d=()=>a!==null?c(a):"null";if(t){const h=this.conditionForToolPanel(r,n,u,d,o,s);if(h!=null)return h}return n?`${u()}-${d()}`:i!=null?c(i):`${r}`}};function tSe(e,t){const n=t;return n<e?-1:n>e?1:0}var nSe=class extends PH{constructor(){super(TH,GR),this.filterType="date",this.FilterModelFormatterClass=FH}comparator(){return this.params.filterParams.comparator??tSe}isValid(e){const t=this.params.filterParams.isValidDate;return!t||t(e)}},AH=class extends Sn{constructor(){super(...arguments),this.defaultDebounceMs=0}setLastTypeFromModel(e){if(!e){this.lastType=this.optionsFactory.defaultOption;return}const t=e.operator;let n;t?n=e.conditions[0]:n=e,this.lastType=n.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const n=e;return this.isTypeEditable(n.type)}init(e){this.params=e;const t=this.gos.get("enableFilterHandlers");if(this.reactive=t,this.setParams(e),t){const n=e;this.onModelUpdated(n.model)}}setParams(e){const t=new $R;this.optionsFactory=t,t.init(e.filterParams,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(t,e.filterParams)),this.setSimpleParams(e,!1)}setSimpleParams(e,t=!0){const n=this.optionsFactory.defaultOption;t||(this.lastType=n),this.readOnly=!!e.filterParams.readOnly;const o=this.isTypeEditable(n);this.setEditable(o)}refresh(e){this.params=e;const t=e,n=this.reactive;if((!n||t.source==="colDef")&&this.updateParams(e),n){const{source:o,model:s}=t;if(o==="dataChanged"||o==="ui")return;this.onModelUpdated(s)}}updateParams(e){const t=this.optionsFactory;t.refresh(e.filterParams,this.defaultOptions),this.setSimpleParams(e),this.filterModelFormatter.updateParams({optionsFactory:t,filterParams:e.filterParams})}onParentModelChanged(e,t){t!=null&&t.afterFloatingFilter||t!=null&&t.afterDataChange||this.onModelUpdated(e)}hasSingleInput(e){var n;const t=(n=this.optionsFactory.getCustomOption(e))==null?void 0:n.numberOfInputs;return t==null||t==1}isTypeEditable(e){const t=["inRange","empty","blank","notBlank"];return!!e&&!this.readOnly&&this.hasSingleInput(e)&&t.indexOf(e)<0}getAriaLabel(e){return`${this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0)} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`}},oSe={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eReadOnlyText"},{tag:"div",ref:"eDateWrapper",cls:"ag-date-floating-filter-wrapper"}]},sSe=class extends AH{constructor(){super(oSe,[nw]),this.eReadOnlyText=dt,this.eDateWrapper=dt,this.FilterModelFormatterClass=FH,this.filterType="date",this.defaultOptions=GR}setParams(e){super.setParams(e),this.createDateComponent();const t=this.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput","Date Filter Input"))}updateParams(e){super.updateParams(e),this.dateComp.updateParams(this.getDateComponentParams()),this.updateCompOnModelChange(e.currentParentModel())}updateCompOnModelChange(e){const t=!this.readOnly&&this.canWeEditAfterModelFromParentFilter(e);if(this.setEditable(t),t){const n=e?Ds(e.dateFrom):null;this.dateComp.setDate(n),this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){Un(this.eDateWrapper,e),Un(this.eReadOnlyText.getGui(),!e)}onModelUpdated(e){super.setLastTypeFromModel(e),this.updateCompOnModelChange(e)}onDateChanged(){const e=this.dateComp.getDate();if(this.reactive){const t=this.params;t.onUiChange();const n=t.model,o=Zs(e),s=o==null?null:{...n??{filterType:this.filterType,type:this.lastType??this.optionsFactory.defaultOption},dateFrom:o};t.onModelChange(s,{afterFloatingFilter:!0})}else this.params.parentFilterInstance(t=>{t==null||t.onFloatingFilterChanged(this.lastType||null,e)})}getDateComponentParams(){const{filterParams:e}=this.params,t=K_(e,this.defaultDebounceMs);return Ot(this.gos,{onDateChanged:qo(this,this.onDateChanged.bind(this),t),filterParams:e,location:"floatingFilter"})}createDateComponent(){const{beans:{context:e,userCompFactory:t},eDateWrapper:n,params:o}=this;this.dateComp=new RH(e,t,o.column.getColDef(),this.getDateComponentParams(),n,s=>{s.setInputAriaLabel(this.getAriaLabel(o))}),this.addDestroyFunc(()=>this.dateComp.destroy())}},rSe={tag:"div",cls:"ag-filter-filter",children:[{tag:"ag-input-text-field",ref:"eDateInput",cls:"ag-date-filter"}]},iSe=class extends Sn{constructor(){super(rSe,[nw]),this.eDateInput=dt,this.isApply=!1,this.applyOnFocusOut=!1}init(e){this.params=e,this.setParams(e);const t=this.eDateInput.getInputElement();this.addManagedListeners(t,{mouseDown:()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||t.focus({preventScroll:!0})},input:this.handleInput.bind(this,!1),change:this.handleInput.bind(this,!0),focusout:this.handleFocusOut.bind(this)})}handleInput(e){if(!this.eDateInput.isDisabled()){if(this.isApply){this.applyOnFocusOut=!e,e&&this.params.onDateChanged();return}e||this.params.onDateChanged()}}handleFocusOut(){this.applyOnFocusOut&&(this.applyOnFocusOut=!1,this.params.onDateChanged())}setParams(e){var h;const t=this.eDateInput.getInputElement(),n=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=n&&xl();const{minValidYear:o,maxValidYear:s,minValidDate:r,maxValidDate:i,buttons:a,includeTime:l,colDef:c}=e.filterParams||{},u=this.beans.dataTypeSvc,d=l??((h=u==null?void 0:u.getDateIncludesTimeFlag)==null?void 0:h.call(u,c.cellDataType))??!1;if(n?d?(t.type="datetime-local",t.step="1"):t.type="date":t.type="text",r&&o&&Je(85),i&&s&&Je(86),r&&i){const[f,p]=[r,i].map(g=>g instanceof Date?g:Ds(g));f&&p&&f.getTime()>p.getTime()&&Je(87)}r?r instanceof Date?t.min=F_(r):t.min=r:o&&(t.min=`${o}-01-01`),i?i instanceof Date?t.max=F_(i):t.max=i:s&&(t.max=`${s}-12-31`),this.isApply=e.location==="floatingFilter"&&!!(a!=null&&a.includes("apply"))}refresh(e){this.params=e,this.setParams(e)}getDate(){return Ds(this.eDateInput.getValue())}setDate(e){var o;const t=this.params.filterParams.colDef.cellDataType,n=((o=this.beans.dataTypeSvc)==null?void 0:o.getDateIncludesTimeFlag(t))??!1;this.eDateInput.setValue(Zs(e,n))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setInputAriaLabel(e){this.eDateInput.setAriaLabel(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){e!=null&&e.suppressFocus||this.eDateInput.getInputElement().focus({preventScroll:!0})}shouldUseBrowserDatePicker(e){var t;return((t=e==null?void 0:e.filterParams)==null?void 0:t.browserDatePicker)??!0}},WR=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"];function zR(e){const{allowedCharPattern:t}=e??{};return t??null}function jR(e){return e==null||isNaN(e)?null:e}function OH(e,t){const{filter:n,filterTo:o,type:s}=e||{};return[jR(n),jR(o)].slice(0,og(s,t))}var aSe=class extends HR{constructor(){super("numberFilter",OH,WR),this.eValuesFrom=[],this.eValuesTo=[],this.filterType="number",this.defaultDebounceMs=500}setElementValue(e,t,n){const{numberFormatter:o}=this.params,s=!n&&o?o(t??null):t;super.setElementValue(e,s)}createEValue(){const e=zR(this.params),t=uo({tag:"div",cls:"ag-filter-body",role:"presentation"});return this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement(e,t,n,o){const s=this.createManagedBean(o?new Jc({allowedCharPattern:o}):new L_);s.addCss(`ag-filter-${n}`),s.addCss("ag-filter-filter"),t.push(s),e.appendChild(s.getGui())}removeEValues(e,t){const n=o=>this.removeComponents(o,e,t);n(this.eValuesFrom),n(this.eValuesTo)}getValues(e){const t=[];return this.forEachPositionInput(e,(n,o,s,r)=>{o<r&&t.push(jR(this.stringToFloat(n.getValue())))}),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}stringToFloat(e){if(typeof e=="number")return e;let t=Sa(e);t!=null&&t.trim()===""&&(t=null);const n=this.params.numberParser;return n?n(t):t==null||t.trim()==="-"?null:Number.parseFloat(t)}createCondition(e){const t=this.getConditionType(e),n={filterType:this.filterType,type:t},o=this.getValues(e);return o.length>0&&(n.filter=o[0]),o.length>1&&(n.filterTo=o[1]),n}getInputs(e){const{eValuesFrom:t,eValuesTo:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>{t.getInputElement().validity.valid||(e=!0)}),e}},MH=class extends UR{constructor(e,t){super(e,t,t.numberFormatter),this.filterTypeKeys=kH}conditionToString(e,t,n,o,s){const{filter:r,filterTo:i,type:a}=e,l=this.formatValue.bind(this);if(t){const c=this.conditionForToolPanel(a,n,()=>l(r),()=>l(i),o,s);if(c!=null)return c}return n?`${l(r)}-${l(i)}`:r!=null?l(r):`${a}`}},lSe=class extends PH{constructor(){super(OH,WR),this.filterType="number",this.FilterModelFormatterClass=MH}comparator(){return(e,t)=>e===t?0:e<t?1:-1}isValid(e){return!isNaN(e)}},NH=class extends je{constructor(e){super(),this.params=e,this.eInput=dt,this.onValueChanged=()=>{}}setupGui(e){var o;this.eInput=this.createManagedBean(new Jc((o=this.params)==null?void 0:o.config));const t=this.eInput.getGui();e.appendChild(t);const n=s=>this.onValueChanged(s);this.addManagedListeners(t,{input:n,keydown:n})}setEditable(e){this.eInput.setDisabled(!e)}getValue(){return this.eInput.getValue()}setValue(e,t){this.eInput.setValue(e,t)}setValueChangedListener(e){this.onValueChanged=e}setParams({ariaLabel:e,autoComplete:t}){const{eInput:n}=this;n.setInputAriaLabel(e),t!==void 0&&n.setAutoComplete(t)}};function KR(e){const t=e==null?void 0:e.trim();return t===""?e:t}function LH(e,t){const{filter:n,filterTo:o,type:s}=e||{};return[n||null,o||null].slice(0,og(s,t))}var cSe={tag:"div",ref:"eFloatingFilterInputContainer",cls:"ag-floating-filter-input",role:"presentation"},VH=class extends AH{constructor(){super(...arguments),this.eFloatingFilterInputContainer=dt,this.defaultDebounceMs=500}postConstruct(){this.setTemplate(cSe)}onModelUpdated(e){this.setLastTypeFromModel(e),this.setEditable(this.canWeEditAfterModelFromParentFilter(e)),this.inputSvc.setValue(this.filterModelFormatter.getModelAsString(e))}setParams(e){this.setupFloatingFilterInputService(e),super.setParams(e),this.setTextInputParams(e)}setupFloatingFilterInputService(e){this.inputSvc=this.createFloatingFilterInputService(e),this.inputSvc.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(e){const t=e.browserAutoComplete??!1,{inputSvc:n,defaultDebounceMs:o,readOnly:s}=this;if(n.setParams({ariaLabel:this.getAriaLabel(e),autoComplete:t}),this.applyActive=aw(e.filterParams),!s){const r=K_(e.filterParams,o),i=qo(this,this.syncUpWithParentFilter.bind(this),r);n.setValueChangedListener(i)}}updateParams(e){super.updateParams(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const{inputSvc:t}=this,n=t.getValue();Ko(this.eFloatingFilterInputContainer),this.destroyBean(t),this.setupFloatingFilterInputService(e),t.setValue(n,!0)}syncUpWithParentFilter(e){const t=e.key===Le.ENTER,n=this.reactive;if(n&&this.params.onUiChange(),this.applyActive&&!t)return;const{inputSvc:o,params:s,lastType:r}=this;let i=o.getValue();if(s.filterParams.trimInput&&(i=KR(i),o.setValue(i,!0)),n){const a=s,l=a.model,c=this.convertValue(i),u=c==null?null:{...l??{filterType:this.filterType,type:r??this.optionsFactory.defaultOption},filter:c};a.onModelChange(u,{afterFloatingFilter:!0})}else s.parentFilterInstance(a=>{a==null||a.onFloatingFilterChanged(r||null,i||null)})}convertValue(e){return e||null}setEditable(e){this.inputSvc.setEditable(e)}},uSe=class extends je{constructor(){super(...arguments),this.onValueChanged=()=>{},this.numberInputActive=!0}setupGui(e){this.eNumberInput=this.createManagedBean(new L_),this.eTextInput=this.createManagedBean(new Jc),this.eTextInput.setDisabled(!0);const t=this.eNumberInput.getGui(),n=this.eTextInput.getGui();e.appendChild(t),e.appendChild(n),this.setupListeners(t,o=>this.onValueChanged(o)),this.setupListeners(n,o=>this.onValueChanged(o))}setEditable(e){this.numberInputActive=e,this.eNumberInput.setDisplayed(this.numberInputActive),this.eTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(e){this.eNumberInput.setAutoComplete(e),this.eTextInput.setAutoComplete(e)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eNumberInput:this.eTextInput}setValueChangedListener(e){this.onValueChanged=e}setupListeners(e,t){this.addManagedListeners(e,{input:t,keydown:t})}setParams(e){this.setAriaLabel(e.ariaLabel),e.autoComplete!==void 0&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eNumberInput.setInputAriaLabel(e),this.eTextInput.setInputAriaLabel(e)}},dSe=class extends VH{constructor(){super(...arguments),this.FilterModelFormatterClass=MH,this.filterType="number",this.defaultOptions=WR}updateParams(e){zR(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.updateParams(e)}createFloatingFilterInputService(e){return this.allowedCharPattern=zR(e.filterParams),this.allowedCharPattern?this.createManagedBean(new NH({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new uSe)}convertValue(e){return e?Number(e):null}},qR=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],hSe=class extends HR{constructor(){super("textFilter",LH,qR),this.filterType="text",this.eValuesFrom=[],this.eValuesTo=[],this.defaultDebounceMs=500}createCondition(e){const t=this.getConditionType(e),n={filterType:this.filterType,type:t},o=this.getValues(e);return o.length>0&&(n.filter=o[0]),o.length>1&&(n.filterTo=o[1]),n}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){const{eValuesFrom:t,eValuesTo:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(n,o,s,r)=>{o<r&&t.push(Sa(n.getValue()))}),t}createEValue(){const e=uo({tag:"div",cls:"ag-filter-body",role:"presentation"}),{eValuesFrom:t,eValuesTo:n}=this;return this.createFromToElement(e,t,"from"),this.createFromToElement(e,n,"to"),e}createFromToElement(e,t,n){const o=this.createManagedBean(new Jc);o.addCss(`ag-filter-${n}`),o.addCss("ag-filter-filter"),t.push(o),e.appendChild(o.getGui())}removeEValues(e,t){const n=r=>this.removeComponents(r,e,t),{eValuesFrom:o,eValuesTo:s}=this;n(o),n(s)}},BH=class extends UR{constructor(){super(...arguments),this.filterTypeKeys=eSe}conditionToString(e,t,n,o,s){const{filter:r,filterTo:i,type:a}=e;if(t){const l=u=>()=>Al(this,"filterSummaryTextQuote",[u]),c=this.conditionForToolPanel(a,n,l(r),l(i),o,s);if(c!=null)return c}return n?`${r}-${i}`:r!=null?`${r}`:`${a}`}},fSe=({filterOption:e,value:t,filterText:n})=>{if(n==null)return!1;switch(e){case"contains":return t.includes(n);case"notContains":return!t.includes(n);case"equals":return t===n;case"notEqual":return t!=n;case"startsWith":return t.indexOf(n)===0;case"endsWith":{const o=t.lastIndexOf(n);return o>=0&&o===t.length-n.length}default:return!1}},pSe=e=>e,gSe=e=>e==null?null:e.toString().toLowerCase(),mSe=class extends xH{constructor(){super(LH,qR),this.filterType="text",this.FilterModelFormatterClass=BH}updateParams(e){super.updateParams(e);const t=e.filterParams;this.matcher=t.textMatcher??fSe,this.formatter=t.textFormatter??(t.caseSensitive?pSe:gSe)}evaluateNullValue(e){return e?["notEqual","notContains","blank"].indexOf(e)>=0:!1}evaluateNonNullValue(e,t,n,o){const s=e.map(h=>this.formatter(h))||[],r=this.formatter(t),{api:i,colDef:a,column:l,context:c,filterParams:{textFormatter:u}}=this.params;if(n.type==="blank")return Pw(t);if(n.type==="notBlank")return!Pw(t);const d={api:i,colDef:a,column:l,context:c,node:o.node,data:o.data,filterOption:n.type,value:r,textFormatter:u};return s.some(h=>this.matcher({...d,filterText:h}))}processModelToApply(e){if(e&&this.params.filterParams.trimInput){const t=n=>{const o={...n},{filter:s,filterTo:r}=n;return s&&(o.filter=KR(s)??null),r&&(o.filterTo=KR(r)??null),o};return W2(e)?{...e,conditions:e.conditions.map(t)}:t(e)}return e}},vSe=class extends VH{constructor(){super(...arguments),this.FilterModelFormatterClass=BH,this.filterType="text",this.defaultOptions=qR}createFloatingFilterInputService(){return this.createManagedBean(new NH)}};function ySe(e){var t;return!!((t=e.quickFilter)!=null&&t.isFilterPresent())}function wSe(e){var t;return(t=e.quickFilter)==null?void 0:t.getText()}function CSe(e){var t;(t=e.quickFilter)==null||t.resetCache()}var bSe=class extends je{constructor(){super(...arguments),this.beanName="quickFilter",this.quickFilter=null,this.quickFilterParts=null}postConstruct(){const e=this.resetCache.bind(this),t=this.gos;this.addManagedEventListeners({columnPivotModeChanged:e,newColumnsLoaded:e,columnRowGroupChanged:e,columnVisible:()=>{t.get("includeHiddenColumnsInQuickFilter")||this.resetCache()}}),this.addManagedPropertyListener("quickFilterText",n=>this.setFilter(n.currentValue)),this.addManagedPropertyListeners(["includeHiddenColumnsInQuickFilter","applyQuickFilterBeforePivotOrAgg"],()=>this.onColumnConfigChanged()),this.quickFilter=this.parseFilter(t.get("quickFilterText")),this.parser=t.get("quickFilterParser"),this.matcher=t.get("quickFilterMatcher"),this.setFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],()=>this.setParserAndMatcher())}refreshCols(){var l;const{autoColSvc:e,colModel:t,gos:n,pivotResultCols:o}=this.beans,s=t.isPivotMode(),r=e==null?void 0:e.getColumns(),i=t.getColDefCols();let a=(s&&!n.get("applyQuickFilterBeforePivotOrAgg")?(l=o==null?void 0:o.getPivotResultCols())==null?void 0:l.list:i)??[];r&&(a=a.concat(r)),this.colsToUse=n.get("includeHiddenColumnsInQuickFilter")?a:a.filter(c=>c.isVisible()||c.isRowGroupActive())}isFilterPresent(){return this.quickFilter!==null}doesRowPass(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassMatcher(t,e):this.quickFilterParts.every(n=>t?this.doesRowPassCache(e,n):this.doesRowPassNoCache(e,n))}resetCache(){this.beans.rowModel.forEachNode(e=>e.quickFilterAggregateText=null)}getText(){return this.gos.get("quickFilterText")}setFilterParts(){const{quickFilter:e,parser:t}=this;e?this.quickFilterParts=t?t(e):e.split(" "):this.quickFilterParts=null}parseFilter(e){return ht(e)?e.toUpperCase():null}setFilter(e){if(e!=null&&typeof e!="string"){Je(70,{newFilter:e});return}const t=this.parseFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}setParserAndMatcher(){const e=this.gos.get("quickFilterParser"),t=this.gos.get("quickFilterMatcher"),n=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,n&&(this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}onColumnConfigChanged(){this.refreshCols(),this.resetCache(),this.isFilterPresent()&&this.dispatchLocalEvent({type:"quickFilterChanged"})}doesRowPassNoCache(e,t){return this.colsToUse.some(n=>{const o=this.getTextForColumn(n,e);return ht(o)&&o.includes(t)})}doesRowPassCache(e,t){return this.checkGenerateAggText(e),e.quickFilterAggregateText.includes(t)}doesRowPassMatcher(e,t){let n;e?(this.checkGenerateAggText(t),n=t.quickFilterAggregateText):n=this.getAggText(t);const{quickFilterParts:o,matcher:s}=this;return s(o,n)}checkGenerateAggText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getAggText(e))}getTextForColumn(e,t){let n=this.beans.filterValueSvc.getValue(e,t);const o=e.getColDef();if(o.getQuickFilterText){const s=Ot(this.gos,{value:n,node:t,data:t.data,column:e,colDef:o});n=o.getQuickFilterText(s)}return ht(n)?n.toString().toUpperCase():null}getAggText(e){const t=[];for(const n of this.colsToUse){const o=this.getTextForColumn(n,e);ht(o)&&t.push(o)}return t.join(`
|
|
253
253
|
`)}},SSe={moduleName:"ClientSideRowModelFilter",version:ut,rowModels:["clientSide"],beans:[Ebe]},YR={moduleName:"FilterCore",version:ut,beans:[zbe],apiFunctions:{isAnyFilterPresent:Ube,onFilterChanged:Wbe},css:[xbe],dependsOn:[SSe]},$H={moduleName:"FilterValue",version:ut,beans:[Kbe]},kw={moduleName:"ColumnFilter",version:ut,beans:[Gbe,jbe],dynamicBeans:{headerFilterCellCtrl:_be},icons:{filter:"filter",filterActive:"filter"},apiFunctions:{isColumnFilterPresent:Pbe,getColumnFilterInstance:kbe,destroyFilter:Fbe,setFilterModel:Abe,getFilterModel:Obe,getColumnFilterModel:Mbe,setColumnFilterModel:Nbe,showColumnFilter:Lbe,hideColumnFilter:Vbe,getColumnFilterHandler:Bbe,doFilterAction:$be},dependsOn:[YR,xw,$H,Dbe]},ESe={moduleName:"CustomFilter",version:ut,userComponents:{agReadOnlyFloatingFilter:Ybe},dependsOn:[kw]},_Se={moduleName:"TextFilter",version:ut,dependsOn:[kw],userComponents:{agTextColumnFilter:{classImp:hSe,params:{useForm:!0}},agTextColumnFloatingFilter:vSe},dynamicBeans:{agTextColumnFilterHandler:mSe}},RSe={moduleName:"NumberFilter",version:ut,dependsOn:[kw],userComponents:{agNumberColumnFilter:{classImp:aSe,params:{useForm:!0}},agNumberColumnFloatingFilter:dSe},dynamicBeans:{agNumberColumnFilterHandler:lSe}},TSe={moduleName:"DateFilter",version:ut,dependsOn:[kw],userComponents:{agDateColumnFilter:{classImp:Qbe,params:{useForm:!0}},agDateInput:iSe,agDateColumnFloatingFilter:sSe},dynamicBeans:{agDateColumnFilterHandler:nSe}},DSe={moduleName:"QuickFilterCore",version:ut,rowModels:["clientSide"],beans:[bSe],dependsOn:[YR,$H]},ISe={moduleName:"QuickFilter",version:ut,apiFunctions:{isQuickFilterPresent:ySe,getQuickFilter:wSe,resetQuickFilter:CSe},dependsOn:[DSe]},xSe={moduleName:"ExternalFilter",version:ut,dependsOn:[YR]},PSe=".ag-tooltip{background-color:var(--ag-tooltip-background-color);border:var(--ag-tooltip-border);border-radius:var(--ag-border-radius);color:var(--ag-tooltip-text-color);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;white-space:normal;z-index:99999;&:where(.ag-cell-editor-tooltip){background-color:var(--ag-tooltip-error-background-color);border:var(--ag-tooltip-error-border);color:var(--ag-tooltip-error-text-color);font-weight:500}}.ag-tooltip-custom{position:absolute;z-index:99999}.ag-tooltip-custom:where(:not(.ag-tooltip-interactive)),.ag-tooltip:where(:not(.ag-tooltip-interactive)){pointer-events:none}.ag-tooltip-animate{transition:opacity 1s;&:where(.ag-tooltip-hiding){opacity:0}}",XR=(e,t,n)=>{var a,l,c;const{editModelSvc:o}=e,s=(l=(a=o==null?void 0:o.getCellValidationModel())==null?void 0:a.getCellValidation(t))==null?void 0:l.errorMessages,r=(c=o==null?void 0:o.getRowValidationModel().getRowValidation(t))==null?void 0:c.errorMessages,i=s||r;return i!=null&&i.length?i.join(n("tooltipValidationErrorSeparator",". ")):void 0},kSe=class extends je{constructor(){super(...arguments),this.beanName="tooltipSvc"}setupHeaderTooltip(e,t,n,o){e&&t.destroyBean(e);const s=this.gos,r=BR(s),{column:i,eGui:a}=t,l=i.getColDef();!o&&r&&!l.headerComponent&&(o=Ny(()=>a.querySelector(".ag-header-cell-text")));const c="header",d=this.beans.colNames.getDisplayNameForColumn(i,"header",!0),h=n??d,f={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,Ot(s,{location:c,colDef:l,column:i,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:o,getAdditionalParams:()=>({column:i,colDef:i.getColDef()})};let p=this.createTooltipFeature(f);return p&&(p=t.createBean(p),t.setRefreshFunction("tooltip",()=>p.refreshTooltip())),p}setupHeaderGroupTooltip(e,t,n,o){e&&t.destroyBean(e);const s=this.gos,r=BR(s),{column:i,eGui:a}=t,l=i.getColGroupDef();!o&&r&&!(l!=null&&l.headerGroupComponent)&&(o=Ny(()=>a.querySelector(".ag-header-group-text")));const c="headerGroup",d=this.beans.colNames.getDisplayNameForColumnGroup(i,"header"),h=n??d,f={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,Ot(s,{location:c,colDef:l,column:i,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:o,getAdditionalParams:()=>{const g={column:i};return l&&(g.colDef=l),g}},p=this.createTooltipFeature(f);return p&&t.createBean(p)}enableCellTooltipFeature(e,t,n){const{beans:o}=this,{gos:s,editSvc:r}=o,{column:i,rowNode:a}=e;let l="cell";const c=()=>{const f=!!!(r!=null&&r.isEditing(e))&&XR(o,e,this.getLocaleTextFunc());if(f)return l="cellEditor",f;l="cell";const p=i.getColDef(),g=a.data;if(p.tooltipField&&ht(g))return Jp(g,p.tooltipField,i.isTooltipFieldContainsDots());const v=p.tooltipValueGetter;return v?v(Ot(s,{location:"cell",colDef:i.getColDef(),column:i,rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,value:e.value,valueFormatted:e.valueFormatted})):null},u=BR(s);n||(u&&!e.isCellRenderer()?n=()=>{const h=!!(r!=null&&r.isEditing(e));if(!h&&XR(o,e,this.getLocaleTextFunc()))return!0;if(!i.isTooltipEnabled())return!1;const g=Ny(()=>{const v=e.eGui;return v.children.length===0?v:v.querySelector(".ag-cell-value")});return!h&&g()}:n=()=>!(r!=null&&r.isEditing(e)));const d={getGui:()=>e.eGui,getLocation:()=>l,getTooltipValue:t!=null?()=>t:c,shouldDisplayTooltip:n,getAdditionalParams:()=>({column:i,colDef:i.getColDef(),rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,valueFormatted:e.valueFormatted})};return this.createTooltipFeature(d,o)}setupFullWidthRowTooltip(e,t,n,o){const s={getGui:()=>t.getFullWidthElement(),getTooltipValue:()=>n,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:o},r=this.beans,i=r.context;e&&t.destroyBean(e,i);const a=this.createTooltipFeature(s,r);if(a)return t.createBean(a,i)}setupCellEditorTooltip(e,t){var a,l;const{beans:n}=this,{context:o}=n,s=((a=t.getValidationElement)==null?void 0:a.call(t,!0))||!((l=t.isPopup)!=null&&l.call(t))&&e.eGui;if(!s)return;const r={getGui:()=>s,getTooltipValue:()=>XR(n,e,this.getLocaleTextFunc()),getLocation:()=>"cellEditor",shouldDisplayTooltip:()=>{var p,g;const{editModelSvc:c}=n,u=(p=c==null?void 0:c.getRowValidationModel())==null?void 0:p.getRowValidationMap(),d=(g=c==null?void 0:c.getCellValidationModel())==null?void 0:g.getCellValidationMap(),h=!!u&&u.size>0,f=!!d&&d.size>0;return h||f}},i=this.createTooltipFeature(r,n);if(i)return e.createBean(i,o)}initCol(e){const{colDef:t}=e;e.tooltipEnabled=ht(t.tooltipField)||ht(t.tooltipValueGetter)||ht(t.tooltipComponent)}createTooltipFeature(e,t){return this.beans.registry.createDynamicBean("tooltipFeature",!1,e,t)}},FSe=class extends nfe{createTooltipComp(e,t){const n=qde(this.beans.userCompFactory,e);n==null||n.newAgStackInstance().then(t)}setEventHandlers(e){[this.onColumnMovedEventCallback]=this.addManagedEventListeners({columnMoved:e})}clearEventHandlers(){var e;(e=this.onColumnMovedEventCallback)==null||e.call(this),this.onColumnMovedEventCallback=void 0}},HH={moduleName:"Tooltip",version:ut,beans:[kSe],dynamicBeans:{tooltipFeature:D2,highlightTooltipFeature:ofe,tooltipStateManager:FSe},userComponents:{agTooltipComponent:ife},dependsOn:[xw],css:[PSe]},nh=class{constructor(e){this.cellValueChanges=e}},ZR=class extends nh{constructor(e,t,n,o){super(e),this.initialRange=t,this.finalRange=n,this.ranges=o}},ASe=10,GH=class{constructor(e){this.actionStack=[],this.maxStackSize=e||ASe,this.actionStack=new Array(this.maxStackSize)}pop(){return this.actionStack.pop()}push(e){e.cellValueChanges&&e.cellValueChanges.length>0&&(this.actionStack.length===this.maxStackSize&&this.actionStack.shift(),this.actionStack.push(e))}clear(){this.actionStack=[]}getCurrentStackSize(){return this.actionStack.length}},OSe=class extends je{constructor(){super(...arguments),this.beanName="undoRedo",this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.batchEditing=!1,this.bulkEditing=!1,this.onCellValueChanged=e=>{const t={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned},n=this.activeCellEdit!==null&&_$(this.activeCellEdit,t),o=this.activeRowEdit!==null&&ome(this.activeRowEdit,t);if(!(n||o||this.isPasting||this.isRangeInAction))return;const{rowPinned:r,rowIndex:i,column:a,oldValue:l,value:c}=e,u={rowPinned:r,rowIndex:i,columnId:a.getColId(),newValue:c,oldValue:l};this.cellValueChanges.push(u)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}postConstruct(){const{gos:e,ctrlsSvc:t}=this.beans;if(!e.get("undoRedoCellEditing"))return;const n=e.get("undoRedoCellEditingLimit");if(n<=0)return;this.undoStack=new GH(n),this.redoStack=new GH(n),this.addListeners();const o=this.clearStacks.bind(this);this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this),modelUpdated:s=>{s.keepUndoRedoStack||this.clearStacks()},columnPivotModeChanged:o,newColumnsLoaded:o,columnGroupOpened:o,columnRowGroupChanged:o,columnMoved:o,columnPinned:o,columnVisible:o,rowDragEnd:o}),t.whenReady(this,s=>{this.gridBodyCtrl=s.gridBodyCtrl})}getCurrentUndoStackSize(){var e;return((e=this.undoStack)==null?void 0:e.getCurrentStackSize())??0}getCurrentRedoStackSize(){var e;return((e=this.redoStack)==null?void 0:e.getCurrentStackSize())??0}undo(e){const{eventSvc:t,undoStack:n,redoStack:o}=this;t.dispatchEvent({type:"undoStarted",source:e});const s=this.undoRedo(n,o,"initialRange","oldValue","undo");t.dispatchEvent({type:"undoEnded",source:e,operationPerformed:s})}redo(e){const{eventSvc:t,undoStack:n,redoStack:o}=this;t.dispatchEvent({type:"redoStarted",source:e});const s=this.undoRedo(o,n,"finalRange","newValue","redo");t.dispatchEvent({type:"redoEnded",source:e,operationPerformed:s})}undoRedo(e,t,n,o,s){if(!e)return!1;const r=e.pop();return r!=null&&r.cellValueChanges?(this.processAction(r,i=>i[o],s),r instanceof ZR?this.processRange(r.ranges||[r[n]]):this.processCell(r.cellValueChanges),t.push(r),!0):!1}processAction(e,t,n){for(const o of e.cellValueChanges){const{rowIndex:s,rowPinned:r,columnId:i}=o,a={rowIndex:s,rowPinned:r},l=Fa(this.beans,a);l.displayed&&l.setDataValue(i,t(o),n)}}processRange(e){let t;const n=this.beans.rangeSvc;n.removeAllCellRanges(!0),e.forEach((o,s)=>{if(!o)return;const r=o.startRow,i=o.endRow;s===e.length-1&&(t={rowPinned:r.rowPinned,rowIndex:r.rowIndex,columnId:o.startColumn.getColId()},this.setLastFocusedCell(t));const a={rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,rowEndIndex:i.rowIndex,rowEndPinned:i.rowPinned,columnStart:o.startColumn,columns:o.columns};n.addCellRange(a)})}processCell(e){const t=e[0],{rowIndex:n,rowPinned:o}=t,s={rowIndex:n,rowPinned:o},r=Fa(this.beans,s),i={rowPinned:t.rowPinned,rowIndex:r.rowIndex,columnId:t.columnId};this.setLastFocusedCell(i)}setLastFocusedCell(e){const{rowIndex:t,columnId:n,rowPinned:o}=e,{colModel:s,focusSvc:r,rangeSvc:i}=this.beans,a=s.getCol(n);if(!a)return;const{scrollFeature:l}=this.gridBodyCtrl;l.ensureIndexVisible(t),l.ensureColumnVisible(a);const c={rowIndex:t,column:a,rowPinned:o};r.setFocusedCell({...c,forceBrowserFocus:!0}),i==null||i.setRangeToCell(c)}addListeners(){this.addManagedEventListeners({rowEditingStarted:e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}},rowEditingStopped:()=>{const e=new nh(this.cellValueChanges);this.pushActionsToUndoStack(e),this.activeRowEdit=null},cellEditingStarted:e=>{this.activeCellEdit={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned}},cellEditingStopped:e=>{if(this.activeCellEdit=null,e.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const n=new nh(this.cellValueChanges);this.pushActionsToUndoStack(n)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new nh(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new ZR(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1},keyShortcutChangedCellStart:()=>{this.isRangeInAction=!0},keyShortcutChangedCellEnd:()=>{let e;const{rangeSvc:t,gos:n}=this.beans;t&&_a(n)?e=new ZR(this.cellValueChanges,void 0,void 0,[...t.getCellRanges()]):e=new nh(this.cellValueChanges),this.pushActionsToUndoStack(e),this.isRangeInAction=!1},batchEditingStarted:()=>this.startBigChange("batchEditing"),batchEditingStopped:({changes:e})=>this.stopBigChange("batchEditing",e),bulkEditingStarted:()=>this.startBigChange("bulkEditing"),bulkEditingStopped:({changes:e})=>this.stopBigChange("bulkEditing",e)})}startBigChange(e){this.updateBigChange(e,!0)}updateBigChange(e,t){e==="bulkEditing"?this.bulkEditing=t:this.batchEditing=t}stopBigChange(e,t){if(e==="bulkEditing"&&!this.bulkEditing||e==="batchEditing"&&!this.batchEditing||(this.updateBigChange(e,!1),(t==null?void 0:t.length)===0))return;const n=new nh(t??[]);this.pushActionsToUndoStack(n),this.cellValueChanges=[]}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}},MSe=".ag-cell-inline-editing{border:var(--ag-cell-editing-border)!important;border-radius:var(--ag-border-radius);box-shadow:var(--ag-cell-editing-shadow);padding:0;z-index:1;.ag-cell-edit-wrapper,.ag-cell-editor,.ag-cell-wrapper,:where(.ag-cell-editor) .ag-input-field-input,:where(.ag-cell-editor) .ag-wrapper{height:100%;line-height:normal;min-height:100%;width:100%}&.ag-cell-editing-error{border-color:var(--ag-invalid-color)!important}}:where(.ag-popup-editor) .ag-large-text{background-color:var(--ag-background-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);padding:0}.ag-large-text-input{display:block;height:auto;padding:var(--ag-cell-horizontal-padding)}:where(.ag-rtl .ag-large-text-input) textarea{resize:none}:where(.ag-ltr) .ag-checkbox-edit{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-checkbox-edit{padding-right:var(--ag-cell-horizontal-padding)}:where(.ag-row.ag-row-editing-invalid .ag-cell-inline-editing){opacity:.8}.ag-popup-editor{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}",NSe={tag:"div",cls:"ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit",children:[{tag:"ag-checkbox",ref:"eEditor",role:"presentation"}]},LSe=class extends yw{constructor(){super(NSe,[N_]),this.eEditor=dt}initialiseEditor(e){const t=e.value??void 0,n=this.eEditor;n.setValue(t),n.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(t),this.addManagedListeners(n,{fieldValueChanged:s=>this.setAriaLabel(s.selected)})}getValue(){return this.eEditor.getValue()}focusIn(){this.eEditor.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.getLocaleTextFunc(),n=Fy(t,e),o=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eEditor.setInputAriaLabel(`${o} (${n})`)}getValidationElement(e){return e?this.params.eGridCell:this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{getValidationErrors:t}=e,n=this.getValue();return t?t({value:n,internalErrors:null,cellEditorParams:e}):null}},Fw=class extends yw{constructor(e){super(),this.cellEditorInput=e,this.eEditor=dt}initialiseEditor(e){const{cellEditorInput:t}=this;this.setTemplate({tag:"div",cls:"ag-cell-edit-wrapper",children:[t.getTemplate()]},t.getAgComponents());const{eEditor:n}=this,{cellStartedEdit:o,eventKey:s,suppressPreventDefault:r}=e;n.getInputElement().setAttribute("title",""),t.init(n,e);let i,a=!0;o?(this.focusAfterAttached=!0,s===Le.BACKSPACE||s===Le.DELETE?i="":s&&s.length===1?r?a=!1:i=s:(i=t.getStartValue(),s!==Le.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,i=t.getStartValue()),a&&i!=null&&n.setStartValue(i),this.addGuiEventListener("keydown",l=>{const{key:c}=l;(c===Le.PAGE_UP||c===Le.PAGE_DOWN)&&l.preventDefault()})}afterGuiAttached(){var o,s;const e=this.getLocaleTextFunc(),t=this.eEditor;if(t.setInputAriaLabel(e("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;xl()||t.getFocusableElement().focus();const n=t.getInputElement();this.highlightAllOnFocus?n.select():(s=(o=this.cellEditorInput).setCaret)==null||s.call(o)}focusIn(){const{eEditor:e}=this,t=e.getFocusableElement(),n=e.getInputElement();t.focus(),n.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){return this.cellEditorInput.getValidationErrors()}},VSe={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},BSe=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return VSe}getAgComponents(){return[g2]}init(e,t){var i,a;this.eEditor=e,this.params=t;const{min:n,max:o,step:s,colDef:r}=t;n!=null&&e.setMin(n),o!=null&&e.setMax(o),s!=null&&e.setStep(s),this.includeTime=t.includeTime??((a=(i=this.getDataTypeService())==null?void 0:i.getDateIncludesTimeFlag)==null?void 0:a.call(i,r.cellDataType)),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const t=this.eEditor.getInputElement().valueAsDate,{params:n}=this,{min:o,max:s,getValidationErrors:r}=n;let i=[];const a=this.getLocaleTextFunc();if(t instanceof Date&&!isNaN(t.getTime())){if(o){const l=o instanceof Date?o:new Date(o);if(t<l){const c=l.toLocaleDateString();i.push(a("minDateValidation",`Date must be after ${c}`,[c]))}}if(s){const l=s instanceof Date?s:new Date(s);if(t>l){const c=l.toLocaleDateString();i.push(a("maxDateValidation",`Date must be before ${c}`,[c]))}}}return i.length||(i=null),r?r({value:t,cellEditorParams:n,internalErrors:i}):i}getValue(){const{eEditor:e,params:t}=this,n=e.getDate();return!ht(n)&&!ht(t.value)?t.value:n??null}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return Zs(e,this.includeTime??!1)}},$Se=class extends Fw{constructor(){super(new BSe(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},HSe={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},GSe=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return HSe}getAgComponents(){return[g2]}init(e,t){var i,a;this.eEditor=e,this.params=t;const{min:n,max:o,step:s,colDef:r}=t;n!=null&&e.setMin(n),o!=null&&e.setMax(o),s!=null&&e.setStep(s),this.includeTime=t.includeTime??((a=(i=this.getDataTypeService())==null?void 0:i.getDateIncludesTimeFlag)==null?void 0:a.call(i,r.cellDataType)),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const{eEditor:e,params:t}=this,n=e.getInputElement().value,o=this.formatDate(this.parseDate(n??void 0)),{min:s,max:r,getValidationErrors:i}=t;let a=[];if(o){const l=new Date(o),c=this.getLocaleTextFunc();if(s){const u=new Date(s);if(l<u){const d=u.toLocaleDateString();a.push(c("minDateValidation",`Date must be after ${d}`,[d]))}}if(r){const u=new Date(r);if(l>u){const d=u.toLocaleDateString();a.push(c("maxDateValidation",`Date must be before ${d}`,[d]))}}}return a.length||(a=null),i?i({value:this.getValue(),cellEditorParams:t,internalErrors:a}):a}getValue(){const{params:e,eEditor:t}=this,n=this.formatDate(t.getDate());return!ht(n)&&!ht(e.value)?e.value:e.parseValue(n??"")}getStartValue(){return Zs(this.parseDate(this.params.value??void 0)??null,this.includeTime??!1)}parseDate(e){const t=this.getDataTypeService();return t?t.getDateParserFunction(this.params.column)(e):Ds(e)??void 0}formatDate(e){const t=this.getDataTypeService();return t?t.getDateFormatterFunction(this.params.column)(e):Zs(e??null,this.includeTime??!1)??void 0}},USe=class extends Fw{constructor(){super(new GSe(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},WSe={tag:"div",cls:"ag-large-text",children:[{tag:"ag-input-text-area",ref:"eEditor",cls:"ag-large-text-input"}]},zSe=class extends yw{constructor(){super(WSe,[hhe]),this.eEditor=dt}initialiseEditor(e){const{eEditor:t}=this,{cellStartedEdit:n,eventKey:o,maxLength:s,cols:r,rows:i}=e;this.focusAfterAttached=n,t.getInputElement().setAttribute("title",""),t.setMaxLength(s||200).setCols(r||60).setRows(i||10);let a;n?(this.focusAfterAttached=!0,o===Le.BACKSPACE||o===Le.DELETE?a="":o&&o.length===1?a=o:(a=this.getStartValue(e),o!==Le.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,a=this.getStartValue(e)),a!=null&&t.setValue(a,!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.activateTabIndex()}getStartValue(e){const{value:t}=e;return(t==null?void 0:t.toString())??t}onKeyDown(e){const t=e.key;(t===Le.LEFT||t===Le.UP||t===Le.RIGHT||t===Le.DOWN||e.shiftKey&&t===Le.ENTER)&&e.stopPropagation()}afterGuiAttached(){const{eEditor:e,focusAfterAttached:t,highlightAllOnFocus:n}=this,o=this.getLocaleTextFunc();e.setInputAriaLabel(o("ariaInputEditor","Input Editor")),t&&(e.getFocusableElement().focus(),n&&e.getInputElement().select())}getValue(){const{eEditor:e,params:t}=this,{value:n}=t,o=e.getValue();return!ht(o)&&!ht(n)?n:t.parseValue(o)}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:n}=e,o=this.getLocaleTextFunc(),s=this.getValue();let r=[];return typeof s=="string"&&t!=null&&s.length>t&&r.push(o("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),r.length||(r=null),n?n({value:s,internalErrors:r,cellEditorParams:e}):r}},jSe={tag:"ag-input-number-field",ref:"eEditor",cls:"ag-cell-editor"},KSe=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return jSe}getAgComponents(){return[fhe]}init(e,t){this.eEditor=e,this.params=t;const{max:n,min:o,precision:s,step:r}=t;n!=null&&e.setMax(n),o!=null&&e.setMin(o),s!=null&&e.setPrecision(s),r!=null&&e.setStep(r);const i=e.getInputElement();t.preventStepping?e.addManagedElementListeners(i,{keydown:this.preventStepping}):t.showStepperButtons&&i.classList.add("ag-number-field-input-stepper")}getValidationErrors(){const{params:e}=this,{min:t,max:n,getValidationErrors:o}=e,r=this.eEditor.getInputElement().valueAsNumber,i=this.getLocaleTextFunc();let a=[];return typeof r=="number"&&(t!=null&&r<t&&a.push(i("minValueValidation",`Must be greater than or equal to ${t}.`,[String(t)])),n!=null&&r>n&&a.push(i("maxValueValidation",`Must be less than or equal to ${n}.`,[String(n)]))),a.length||(a=null),o?o({value:r,cellEditorParams:e,internalErrors:a}):a}preventStepping(e){(e.key===Le.UP||e.key===Le.DOWN)&&e.preventDefault()}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();if(!ht(n)&&!ht(t.value))return t.value;let o=t.parseValue(n);if(o==null)return o;if(typeof o=="string"){if(o==="")return null;o=Number(o)}return isNaN(o)?null:o}getStartValue(){return this.params.value}setCaret(){xl()&&this.eEditor.getInputElement().focus({preventScroll:!0})}},qSe=class extends Fw{constructor(){super(new KSe(()=>this.getLocaleTextFunc()))}},YSe={tag:"div",cls:"ag-cell-edit-wrapper",children:[{tag:"ag-select",ref:"eEditor",cls:"ag-cell-editor"}]},XSe=class extends yw{constructor(){super(YSe,[_he]),this.eEditor=dt,this.startedByEnter=!1}wireBeans(e){this.valueSvc=e.valueSvc}initialiseEditor(e){this.focusAfterAttached=e.cellStartedEdit;const{eEditor:t,valueSvc:n,gos:o}=this,{values:s,value:r,eventKey:i}=e;if(Gn(s)){Je(58);return}this.startedByEnter=i!=null?i===Le.ENTER:!1;let a=!1;s.forEach(d=>{const h={value:d},f=n.formatValue(e.column,null,d),p=f!=null;h.text=p?f:d,t.addOption(h),a=a||r===d}),a?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:l,valueListMaxWidth:c,valueListMaxHeight:u}=e;l!=null&&t.setPickerGap(l),u!=null&&t.setPickerMaxHeight(u),c!=null&&t.setPickerMaxWidth(c),o.get("editType")!=="fullRow"&&this.addManagedListeners(this.eEditor,{selectedItem:()=>e.stopEditing()})}afterGuiAttached(){this.focusAfterAttached&&this.eEditor.getFocusableElement().focus(),this.startedByEnter&&setTimeout(()=>{this.isAlive()&&this.eEditor.showPicker()})}focusIn(){this.eEditor.getFocusableElement().focus()}getValue(){return this.eEditor.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getAriaElement()}getValidationErrors(){const{params:e}=this,{values:t,getValidationErrors:n}=e,o=this.getValue();let s=[];if(t&&!t.includes(o)){const r=this.getLocaleTextFunc();s.push(r("invalidSelectionValidation","Invalid selection."))}else s=null;return n?n({value:o,internalErrors:s,cellEditorParams:e}):s}},ZSe={tag:"ag-input-text-field",ref:"eEditor",cls:"ag-cell-editor"},JSe=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return ZSe}getAgComponents(){return[nw]}init(e,t){this.eEditor=e,this.params=t;const n=t.maxLength;n!=null&&e.setMaxLength(n)}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:n}=e,o=this.getValue(),s=this.getLocaleTextFunc();let r=[];return t!=null&&typeof o=="string"&&o.length>t&&r.push(s("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),r.length||(r=null),n?n({value:o,cellEditorParams:e,internalErrors:r}):r}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();return!ht(n)&&!ht(t.value)?t.value:t.parseValue(n)}getStartValue(){const e=this.params;return e.useFormatter||e.column.getColDef().refData?e.formatValue(e.value):e.value}setCaret(){xl()&&this.eEditor.getInputElement().focus({preventScroll:!0});const e=this.eEditor,t=e.getValue(),n=ht(t)&&t.length||0;n&&e.getInputElement().setSelectionRange(n,n)}},UH=class extends Fw{constructor(){super(new JSe(()=>this.getLocaleTextFunc()))}};function QSe(e){return e.ctrlsSvc.getScrollFeature().getVScrollPosition()}function e0e(e){return e.ctrlsSvc.getScrollFeature().getHScrollPosition()}function WH(e,t,n="auto"){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureColumnVisible(t,n),"ensureVisible")}function zH(e,t,n){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureIndexVisible(t,n),"ensureVisible")}function t0e(e,t,n=null){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureNodeVisible(t,n),"ensureVisible")}function n0e(e){var t;(t=e.undoRedo)==null||t.undo("api")}function o0e(e){var t;(t=e.undoRedo)==null||t.redo("api")}function s0e(e,t){var n;return(n=e.editModelSvc)==null?void 0:n.getEditRowDataValue(t,{checkSiblings:!0})}function r0e(e){var o;const t=(o=e.editModelSvc)==null?void 0:o.getEditMap(),n=[];return t==null||t.forEach((s,r)=>{const{rowIndex:i,rowPinned:a}=r;s.forEach((l,c)=>{const{editorValue:u,pendingValue:d,sourceValue:h,state:f}=l,p=Aa(l);let g=u??d;g===kr&&(g=void 0);const v={newValue:g,oldValue:h,state:f,column:c,colId:c.getColId(),colKey:c.getColId(),rowIndex:i,rowPinned:a};(f==="editing"||f==="changed"&&p)&&n.push(v)})}),n}function i0e(e,t=!1){var o;const{editSvc:n}=e;if(n!=null&&n.isBatchEditing()){if(t)for(const s of((o=e.editModelSvc)==null?void 0:o.getEditPositions())??[])s.state==="editing"&&n.revertSingleCellEdit(s);else ou(e,{persist:!0});Qd(e,void 0,{cancel:t})}else n==null||n.stopEditing(void 0,{cancel:t,source:"edit",forceStop:!t,forceCancel:t})}function a0e(e,t){var o;const n=qn(e,t);return((o=e.editSvc)==null?void 0:o.isEditing(n))??!1}function l0e(e,t){const{key:n,colKey:o,rowIndex:s,rowPinned:r}=t,{editSvc:i,colModel:a}=e,l=a.getCol(o);if(!l){Je(12,{colKey:o});return}const u=Fa(e,{rowIndex:s,rowPinned:r||null});if(!u){Je(290,{rowIndex:s,rowPinned:r});return}if(!l.isCellEditable(u))return;r==null&&zH(e,s),WH(e,o),i==null||i.startEditing({rowNode:u,column:l},{event:n?new KeyboardEvent("keydown",{key:n}):void 0,source:"api"})}function c0e(e){var t;return((t=e.editSvc)==null?void 0:t.validateEdit())||null}function u0e(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentUndoStackSize())??0}function d0e(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentRedoStackSize())??0}var h0e={tag:"div",cls:"ag-popup-editor",attrs:{tabindex:"-1"}},f0e=class extends C_{constructor(e){super(h0e),this.params=e}postConstruct(){jc(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params,n=o=>{tR(this.gos,o,t.node,t.column,!0)||t.onKeyDown(o)};this.addManagedElementListeners(e,{keydown:n})}};function p0e(e,{column:t},n,o,s="ui"){var c;if(n instanceof KeyboardEvent&&(n.key===Le.TAB||n.key===Le.ENTER||n.key===Le.F2||n.key===Le.BACKSPACE&&o))return!0;if((n==null?void 0:n.shiftKey)&&((c=e.rangeSvc)==null?void 0:c.getCellRanges().length)!=0)return!1;const i=t==null?void 0:t.getColDef(),a=g0e(e.gos,i),l=n==null?void 0:n.type;return l==="click"&&(n==null?void 0:n.detail)===1&&a===1||l==="dblclick"&&(n==null?void 0:n.detail)===2&&a===2?!0:s==="api"?o??!1:!1}function g0e(e,t){return e.get("suppressClickEdit")===!0?0:e.get("singleClickEdit")===!0||t!=null&&t.singleClickEdit?1:2}function JR(e,{rowNode:t,column:n},o="ui"){const s=n.getColDef().editable,r=e.editModelSvc;return n.isColumnFunc(t,s)||!!r&&r.hasEdits({rowNode:t,column:n},{withOpenEditor:!0})}function m0e(e,t,n="ui"){const o=JR(e,t,n);return o===!0||n==="ui"?o:e.colModel.getCols().some(r=>JR(e,{rowNode:t.rowNode,column:r},n))}var Aw=(e,t=!1)=>{if(e!==void 0)return Aa(e)||t&&e.state==="editing"};function jH(e,t,n=!1){var o;return Aw((o=e.editModelSvc)==null?void 0:o.getEdit(t),n)}var KH=(e,t,n)=>{if(e)for(let o=0,s=e.length;o<s;++o){const r=e[o];if(r.data&&(Aw(t==null?void 0:t.getEdit({rowNode:r,column:n}))||Aw(t==null?void 0:t.getEdit({rowNode:r.pinnedSibling,column:n})))||KH(r.childrenAfterGroup,t,n))return!0}};function qH(e,t){const{column:n,rowNode:o}=t;return e.gos.get("groupTotalRow")&&!(o!=null&&o.footer)?!1:KH(o==null?void 0:o.childrenAfterGroup,e.editModelSvc,n)}function YH(e,{rowNode:t,column:n}){var o;if(t=t.pinnedSibling,!!t)return Aw((o=e.editModelSvc)==null?void 0:o.getEdit({rowNode:t,column:n}))}var v0e=class extends je{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}setComp(e){this.cellComp=e,this.applyCellStyles()}applyCellStyles(){var s;const{cellCtrl:e,editSvc:t,beans:n}=this;if(t!=null&&t.isBatchEditing()&&t.isEditing()){const r=jH(n,e)||qH(n,e)||YH(n,e);this.applyBatchingStyle(r)}else this.applyBatchingStyle(!1);const o=!!((s=this.editModelSvc)!=null&&s.getCellValidationModel().hasCellValidation(this.cellCtrl));this.cellComp.toggleCss("ag-cell-editing-error",o)}applyBatchingStyle(e){var t;this.cellComp.toggleCss("ag-cell-editing",e??!1),this.cellComp.toggleCss("ag-cell-batch-edit",(e&&((t=this.editSvc)==null?void 0:t.isBatchEditing()))??!1)}},y0e=class extends je{constructor(e,t){super(),this.rowCtrl=e,this.beans=t,this.gos=t.gos,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}applyRowStyles(){var i;const{rowCtrl:e,editModelSvc:t,beans:n}=this;let o=e.rowNode,s=t==null?void 0:t.getEditRow(o);const r=(i=this.editModelSvc)==null?void 0:i.getRowValidationModel().hasRowValidation({rowNode:o});if(!s&&o.pinnedSibling&&(o=o.pinnedSibling,s=t==null?void 0:t.getEditRow(o)),s){const a=Array.from(s.keys()).some(l=>{const c={rowNode:o,column:l};return jH(n,c,!0)||qH(n,c)||YH(n,c)});this.applyStyle(r,a);return}this.applyStyle(r)}applyStyle(e=!1,t=!1){var s,r;const n=((s=this.editSvc)==null?void 0:s.isBatchEditing())??!1,o=this.gos.get("editType")==="fullRow";(r=this.rowCtrl)==null||r.forEachGui(void 0,({rowComp:i})=>{i.toggleCss("ag-row-editing",o&&t),i.toggleCss("ag-row-batch-edit",o&&t&&n),i.toggleCss("ag-row-inline-editing",t),i.toggleCss("ag-row-not-inline-editing",!t),i.toggleCss("ag-row-editing-invalid",o&&t&&e)})}},w0e=({rowModel:e,pinnedRowModel:t,editModelSvc:n},o)=>{const s=new Set;e.forEachNode(r=>o.has(r)&&s.add(r)),t==null||t.forEachPinnedRow("top",r=>o.has(r)&&s.add(r)),t==null||t.forEachPinnedRow("bottom",r=>o.has(r)&&s.add(r));for(const r of o)s.has(r)||n.removeEdits({rowNode:r});return s},C0e=({editModelSvc:e},t,n)=>{var o;for(const s of t)(o=e==null?void 0:e.getEditRow(s))==null||o.forEach((r,i)=>!n.has(i)&&e.removeEdits({rowNode:s,column:i}))},b0e=e=>()=>{const t=new Set(e.colModel.getCols()),n=e.editModelSvc.getEditMap(!0),o=new Set(n.keys());C0e(e,w0e(e,o),t)},S0e=new Set(["undo","redo","paste","bulk","rangeSvc"]),E0e=new Set(["ui","api"]),XH={paste:"api",rangeSvc:"api",fillHandle:"api",cellClear:"api",bulk:"api"},_0e=new Set(Object.keys(XH)),R0e=new Set(["paste","rangeSvc","renderer","cellClear","redo","undo"]),Ow={cancel:!0,source:"api"},T0e={cancel:!1,source:"api"},oh={checkSiblings:!0},sg={force:!0,suppressFlash:!0},D0e=class extends je{constructor(){super(...arguments),this.beanName="editSvc",this.batch=!1,this.stopping=!1,this.committing=!1}postConstruct(){const{beans:e}=this;this.model=e.editModelSvc,this.valueSvc=e.valueSvc,this.rangeSvc=e.rangeSvc,this.addManagedPropertyListener("editType",({currentValue:o})=>{this.stopEditing(void 0,Ow),this.createStrategy(o)});const t=b0e(e),n=()=>{const o=this.model.getCellValidationModel().getCellValidationMap().size>0,s=this.model.getRowValidationModel().getRowValidationMap().size>0;return o||s?this.stopEditing(void 0,Ow):this.isEditing()&&(this.isBatchEditing()?Qd(e,this.model.getEditPositions()):this.stopEditing(void 0,T0e)),!1};this.addManagedEventListeners({columnPinned:t,columnVisible:t,columnRowGroupChanged:t,rowExpansionStateChanged:t,pinnedRowsChanged:t,displayedRowsChanged:t,sortChanged:n,filterChanged:n,cellFocused:this.onCellFocused.bind(this)})}isBatchEditing(){return this.batch}setBatchEditing(e){e?(this.batch=!0,this.stopEditing(void 0,Ow)):(this.stopEditing(void 0,Ow),this.batch=!1)}createStrategy(e){const{beans:t,gos:n,strategy:o}=this,s=ZH(n,e);if(o){if(o.beanName===s)return o;this.destroyStrategy()}return this.strategy=this.createOptionalManagedBean(t.registry.createDynamicBean(s,!0))}destroyStrategy(){this.strategy&&(this.strategy.destroy(),this.strategy=this.destroyBean(this.strategy))}shouldStartEditing(e,t,n,o="ui"){const s=p0e(this.beans,e,t,n,o);return s&&(this.strategy??(this.strategy=this.createStrategy())),s}shouldStopEditing(e,t,n="ui"){var o;return((o=this.strategy)==null?void 0:o.shouldStop(e,t,n))??null}shouldCancelEditing(e,t,n="ui"){var o;return((o=this.strategy)==null?void 0:o.shouldCancel(e,t,n))??null}validateEdit(){return Gwe(this.beans)}isEditing(e,t){return this.model.hasEdits(e,t??oh)}isRowEditing(e,t){return(e&&this.model.hasRowEdits(e,t))??!1}startEditing(e,t){const{startedEdit:n=!0,event:o=null,source:s="ui",ignoreEventKey:r=!1,silent:i}=t;if(this.strategy??(this.strategy=this.createStrategy()),!this.isCellEditable(e,"api"))return;const a=qn(this.beans,e);if(a&&!a.comp){a.onCompAttachedFuncs.push(()=>this.startEditing(e,t));return}const l=this.shouldStartEditing(e,o,n,s);if(l===!1&&s!=="api"){this.isEditing(e)&&this.stopEditing();return}!this.batch&&this.shouldStopEditing(e,void 0,s)&&!t.continueEditing&&this.stopEditing(void 0,{source:s}),l&&this.isBatchEditing()&&this.dispatchBatchEvent("batchEditingStarted",new Map),this.strategy.start({position:e,event:o,source:s,ignoreEventKey:r,startedEdit:n,silent:i})}stopEditing(e,t){var v,C,S;const{event:n,cancel:o,source:s="ui",forceCancel:r,forceStop:i}=t||{},{beans:a,model:l}=this;if(_0e.has(s)&&this.isBatchEditing())return this.bulkRefresh(e),!1;const c=this.committing?XH[s]:s;if(!(this.committing||this.isEditing(e)||this.isBatchEditing()&&l.hasEdits(e,oh))||!this.strategy||this.stopping)return!1;this.stopping=!0;const d=qn(a,e);d&&(d.onEditorAttachedFuncs=[]);let h=l.getEditMap(!0),f=!1;const p=!o&&(!!this.shouldStopEditing(e,n,c)||this.committing&&!this.batch)||(i??!1),g=o&&!!this.shouldCancelEditing(e,n,c)||(r??!1);if(p||g){ou(a,{persist:!0,isCancelling:g||o,isStopping:p});const b=l.getEditMap(),y=this.processEdits(b,o,s);(v=this.strategy)==null||v.stop(o,n);for(const _ of y)l.clearEditValue(_);this.bulkRefresh(void 0,h);for(const _ of l.getEditPositions(b)){const E=qn(a,_),D=Aa(_);E==null||E.refreshCell({force:!0,suppressFlash:!D})}h=b,f||(f=p)}else if(n instanceof KeyboardEvent&&this.batch&&((C=this.strategy)!=null&&C.midBatchInputsAllowed(e))&&this.isEditing(e,{withOpenEditor:!0})){const{key:b}=n,y=b===Le.ENTER,_=b===Le.ESCAPE,E=b===Le.TAB;(y||E||_)&&(y||E?ou(a,{persist:!0}):_&&this.revertSingleCellEdit(d),this.isBatchEditing()?(S=this.strategy)==null||S.cleanupEditors():Qd(a,l.getEditPositions(),{event:n,cancel:_}),n.preventDefault(),this.bulkRefresh(e,h,{suppressFlash:!0}),h=l.getEditMap())}else ou(a,{persist:!0}),h=l.getEditMap();return f&&e&&this.model.removeEdits(e),this.navigateAfterEdit(t,d==null?void 0:d.cellPosition),kR(a),this.model.hasEdits()||(this.model.getCellValidationModel().clearCellValidationMap(),this.model.getRowValidationModel().clearRowValidationMap()),this.bulkRefresh(),g&&this.beans.rowRenderer.refreshRows({rowNodes:Array.from(h.keys())}),this.isBatchEditing()&&(this.beans.rowRenderer.refreshRows({suppressFlash:!0,force:!0}),f&&p&&this.dispatchBatchEvent("batchEditingStopped",h)),this.stopping=!1,f}navigateAfterEdit(e,t){var c;if(!e||!t)return;const{event:n,suppressNavigateAfterEdit:o}=e;if(!(n instanceof KeyboardEvent)||o)return;const{key:r,shiftKey:i}=n,a=this.gos.get("enterNavigatesVerticallyAfterEdit");if(r!==Le.ENTER||!a)return;const l=i?Le.UP:Le.DOWN;(c=this.beans.navigation)==null||c.navigateToNextCell(null,l,t,!1)}processEdits(e,t=!1,n){const o=Array.from(e.keys()),s=this.model.getCellValidationModel().getCellValidationMap().size>0||this.model.getRowValidationModel().getRowValidationMap().size>0,r=[];for(const i of o){const a=e.get(i);for(const l of a.keys()){const c=a.get(l),u={rowNode:i,column:l},d=Aa(c);!t&&d&&!s&&(this.setNodeDataValue(i,l,c.pendingValue,void 0,n)||r.push(u))}}return r}setNodeDataValue(e,t,n,o,s="edit"){const{beans:r}=this,i=qn(r,{rowNode:e,column:t}),a=E0e.has(s)?"edit":s;i&&(i.suppressRefreshCell=!0),this.commitNextEdit();const l=e.setDataValue(t,n,a);return i&&(i.suppressRefreshCell=!1),o&&(i==null||i.refreshCell(sg)),l}setEditMap(e,t){var o;this.strategy??(this.strategy=this.createStrategy()),(o=this.strategy)==null||o.setEditMap(e,t),this.bulkRefresh();let n=sg;t!=null&&t.forceRefreshOfEditCellsOnly&&(n={...I0e(e),...sg}),this.beans.rowRenderer.refreshCells(n)}dispatchEditValuesChanged({rowNode:e,column:t},n={}){if(!e||!t||!n)return;const{pendingValue:o,sourceValue:s}=n,{rowIndex:r,rowPinned:i,data:a}=e;this.beans.eventSvc.dispatchEvent({type:"cellEditValuesChanged",node:e,rowIndex:r,rowPinned:i,column:t,source:"api",data:a,newValue:o,oldValue:s,value:o,colDef:t.getColDef()})}bulkRefresh(e={},t,n={}){var a;const{beans:o,gos:s}=this,{editModelSvc:r,rowModel:i}=o;lo(s)&&(e.rowNode&&e.column?this.refCell(e,this.model.getEdit(e),n):t&&((a=r==null?void 0:r.getEditMap(!1))==null||a.forEach((l,c)=>{for(const u of l.keys())this.refCell({rowNode:c,column:u},l.get(u),n)})))}refCell({rowNode:e,column:t},n,o={}){var d,h,f;const{beans:s,gos:r}=this,i=new Set([e]),a=new Set,l=e.pinnedSibling;l&&i.add(l);const c=e.sibling;c&&a.add(c);let u=e.parent;for(;u;)(d=u.sibling)!=null&&d.footer&&r.get("groupTotalRow")||!u.parent&&u.sibling&&r.get("grandTotalRow")?a.add(u.sibling):a.add(u),u=u.parent;for(const p of i)this.dispatchEditValuesChanged({rowNode:p,column:t},n);for(const p of i)(h=qn(s,{rowNode:p,column:t}))==null||h.refreshCell(o);for(const p of a)(f=qn(s,{rowNode:p,column:t}))==null||f.refreshCell(o)}stopAllEditing(e=!1,t="ui"){this.isEditing()&&this.stopEditing(void 0,{cancel:e,source:t})}isCellEditable(e,t="ui"){const{rowNode:n}=e,{gos:o,beans:s}=this;if(n.group){if(o.get("treeData")){if(!n.data&&!o.get("enableGroupEdit"))return!1}else if(!o.get("enableGroupEdit"))return!1}const r=ZH(o)==="fullRow"?m0e(s,e,t):JR(s,e,t);return r&&(this.strategy??(this.strategy=this.createStrategy())),r}cellEditingInvalidCommitBlocks(){return this.gos.get("invalidEditValueMode")==="block"}checkNavWithValidation(e,t,n=!0){var o,s,r,i;if(this.hasValidationErrors(e)){const a=qn(this.beans,e);return this.cellEditingInvalidCommitBlocks()?((o=t==null?void 0:t.preventDefault)==null||o.call(t),n&&(!(a!=null&&a.hasBrowserFocus())&&(a==null||a.focusCell()),(i=(r=(s=a==null?void 0:a.comp)==null?void 0:s.getCellEditor())==null?void 0:r.focusIn)==null||i.call(r)),"block-stop"):(a&&this.revertSingleCellEdit(a),"revert-continue")}return"continue"}revertSingleCellEdit(e,t=!1){var o,s,r,i;const n=qn(this.beans,e);(o=n==null?void 0:n.comp)!=null&&o.getCellEditor()&&(Qd(this.beans,[e],{silent:!0}),this.model.clearEditValue(e),Jd(this.beans,e,{silent:!0}),su(this.beans),n==null||n.refreshCell(sg),t&&(n==null||n.focusCell(),(i=(r=(s=n==null?void 0:n.comp)==null?void 0:s.getCellEditor())==null?void 0:r.focusIn)==null||i.call(r)))}hasValidationErrors(e){var o;su(this.beans);const t=qn(this.beans,e);t&&(t.refreshCell(sg),(o=t.rowCtrl.rowEditStyleFeature)==null||o.applyRowStyles());let n=!1;return e!=null&&e.rowNode?(n||(n=this.model.getRowValidationModel().hasRowValidation({rowNode:e.rowNode})),e.column&&(n||(n=this.model.getCellValidationModel().hasCellValidation({rowNode:e.rowNode,column:e.column})))):(n||(n=this.model.getCellValidationModel().getCellValidationMap().size>0),n||(n=this.model.getRowValidationModel().getRowValidationMap().size>0)),n}moveToNextCell(e,t,n,o="ui"){var a;let s;const r=this.isEditing(),i=r&&this.checkNavWithValidation(void 0,n)==="block-stop";return e instanceof eh&&r&&(s=(a=this.strategy)==null?void 0:a.moveToNextEditingCell(e,t,n,o,i)),s===null||(s=s||!!this.beans.focusSvc.focusedHeader,s===!1&&!i&&this.stopEditing()),s}getCellDataValue({rowNode:e,column:t},n=!0){if(!e||!t)return;let o=this.model.getEdit({rowNode:e,column:t});const s=e.pinnedSibling;if(s){const i=this.model.getEdit({rowNode:s,column:t});i&&(o=i)}const r=n?(o==null?void 0:o.editorValue)??(o==null?void 0:o.pendingValue):o==null?void 0:o.pendingValue;return r===kr||!o?(o==null?void 0:o.sourceValue)??this.valueSvc.getValue(t,e,!1,"api"):r}addStopEditingWhenGridLosesFocus(e){Nwe(this,this.beans,e)}createPopupEditorWrapper(e){return new f0e(e)}commitNextEdit(){this.committing=!0}setDataValue(e,t,n){var o;try{if((!this.isEditing()||this.committing)&&!R0e.has(n))return;const{beans:s}=this;this.strategy??(this.strategy=this.createStrategy());const r=this.isBatchEditing()?"ui":this.committing?n??"api":"api";if(!n||S0e.has(n))return Rw(s,e,t,n,void 0,{persist:!0}),this.setNodeDataValue(e.rowNode,e.column,t,!0,n);const i=this.model.getEdit(e);if(i){if(i.pendingValue===t)return!1;if(i.sourceValue!==t)return Rw(s,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:r,suppressNavigateAfterEdit:!0}),!0;if(i.sourceValue===t)return(o=s.editModelSvc)==null||o.removeEdits(e),this.dispatchEditValuesChanged(e,{...i,pendingValue:t}),!0}return Rw(s,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:r,suppressNavigateAfterEdit:!0}),!0}finally{this.committing=!1}}handleColDefChanged(e){Bwe(this.beans,e)}destroy(){this.model.clear(),this.destroyStrategy(),super.destroy()}prepDetailsDuringBatch(e,t){if(!this.batch||!this.model.hasRowEdits(e.rowNode,oh))return;const{rowNode:o,column:s}=e,{compDetails:r,valueToDisplay:i}=t;if(r){const{params:l}=r;return l.data=this.model.getEditRowDataValue(o,oh),{compDetails:r}}const a=this.model.getEditRow(e.rowNode,oh);if(i!==void 0&&(a!=null&&a.has(s)))return{valueToDisplay:this.valueSvc.getValue(s,o)}}cleanupEditors(){var e;(e=this.strategy)==null||e.cleanupEditors()}dispatchCellEvent(e,t,n,o){var s;(s=this.strategy)==null||s.dispatchCellEvent(e,t,n,o)}dispatchBatchEvent(e,t){this.eventSvc.dispatchEvent(this.createBatchEditEvent(e,t))}createBatchEditEvent(e,t){return Ot(this.gos,{type:e,...e==="batchEditingStopped"?{changes:this.toEventChangeList(t)}:{}})}toEventChangeList(e){return this.model.getEditPositions(e).map(t=>({rowIndex:t.rowNode.rowIndex,rowPinned:t.rowNode.rowPinned,columnId:t.column.getColId(),newValue:t.pendingValue,oldValue:t.sourceValue}))}applyBulkEdit({rowNode:e,column:t},n){var c,u;if(!n||n.length===0)return;const{beans:o,rangeSvc:s,valueSvc:r}=this;ou(o,{persist:!0});const i=this.model.getEditMap(!0),a=(u=(c=i.get(e))==null?void 0:c.get(t))==null?void 0:u.pendingValue;this.batch||this.eventSvc.dispatchEvent({type:"bulkEditingStarted"}),n.forEach(d=>{if(s==null||s.forEachRowInRange(d,h=>{const f=Fa(o,h);if(f===void 0)return;const p=i.get(f)??new Map;for(const g of d.columns)if(g&&this.isCellEditable({rowNode:f,column:g},"api")){const v=r.getValue(g,f,!0,"api");let C=r.parseValue(g,f??null,a,v);Number.isNaN(C)&&(C=null),p.set(g,{editorValue:void 0,pendingValue:C,sourceValue:v,state:"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}p.size>0&&i.set(f,p)}),this.setEditMap(i),this.batch){this.cleanupEditors(),kR(o),this.bulkRefresh();return}this.commitNextEdit(),this.stopEditing(void 0,{source:"bulk"}),this.eventSvc.dispatchEvent({type:"bulkEditingStopped",changes:this.toEventChangeList(i)})}),this.bulkRefresh();const l=qn(o,{rowNode:e,column:t});l&&l.focusCell(!0)}createCellStyleFeature(e,t){return new v0e(e,t)}createRowStyleFeature(e,t){return new y0e(e,t)}setEditingCells(e,t){const{beans:n}=this,{colModel:o,valueSvc:s}=n,r=new Map;for(let{colId:i,column:a,colKey:l,rowIndex:c,rowPinned:u,newValue:d,state:h}of e){const f=i?o.getCol(i):l?o.getCol(l):a;if(!f)continue;const p=Fa(n,{rowIndex:c,rowPinned:u});if(!p)continue;const g=s.getValue(f,p,!0,"api");if(!(t!=null&&t.forceRefreshOfEditCellsOnly)&&!Aa({pendingValue:d,sourceValue:g})&&h!=="editing")continue;let v=r.get(p);v||(v=new Map,r.set(p,v)),d===void 0&&(d=kr),v.set(f,{editorValue:void 0,pendingValue:d,sourceValue:g,state:h??"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}this.setEditMap(r,t)}onCellFocused(e){var r;const t=qn(this.beans,e);if(!t||!this.isEditing(t,oh))return;const n=this.model.getEdit(t);if(!n||!Aa(n))return;const s=this.getLocaleTextFunc()("ariaPendingChange","Pending Change");(r=this.beans.ariaAnnounce)==null||r.announceValue(s,"pendingChange")}allowedFocusTargetOnValidation(e){return qn(this.beans,e)}};function I0e(e){return{rowNodes:e?Array.from(e.keys()):void 0,columns:e?[...new Set(Array.from(e.values()).flatMap(t=>Array.from(t.keys())))]:void 0}}function ZH(e,t){return t??e.get("editType")??"singleCell"}var JH=class extends je{postConstruct(){var e,t;this.model=this.beans.editModelSvc,this.editSvc=this.beans.editSvc,this.addManagedEventListeners({cellFocused:(e=this.onCellFocusChanged)==null?void 0:e.bind(this),cellFocusCleared:(t=this.onCellFocusChanged)==null?void 0:t.bind(this)})}clearEdits(e){this.model.clearEditValue(e)}onCellFocusChanged(e){let t;const n=e.previousParams,{editSvc:o,beans:s}=this,r=e.type==="cellFocused"?e.sourceEvent:null;n&&(t=qn(s,n));const{gos:i,editModelSvc:a}=s,l=e.type==="cellFocusCleared";if(o.isEditing(void 0,{withOpenEditor:!0})){const{column:c,rowIndex:u,rowPinned:d}=e,h={column:c,rowNode:Fa(s,{rowIndex:u,rowPinned:d})},f=i.get("invalidEditValueMode")==="block";if(f)return;const p=!f,g=!!(a!=null&&a.getCellValidationModel().hasCellValidation(h)),v=p&&g;(n||l?o.stopEditing(void 0,{cancel:v,source:l&&p?"api":void 0,event:r}):!0)||(o.isBatchEditing()?o.cleanupEditors():o.stopEditing(void 0,{source:"api"}))}t==null||t.refreshCell({suppressFlash:!0,force:!0})}stop(e,t){var s,r;const n=this.model.getEditPositions(),o={all:[],pass:[],fail:[]};for(const i of n){o.all.push(i);const a=this.model.getCellValidationModel().getCellValidation(i);if((((s=a==null?void 0:a.errorMessages)==null?void 0:s.length)??0)>0){o.fail.push(i);continue}o.pass.push(i)}if(e)for(const i of n)Tw(this.beans,i,{cancel:e}),this.model.stop(i);else{const i=this.processValidationResults(o);if(i.destroy.length>0)for(const a of i.destroy)Tw(this.beans,a,{event:t,cancel:e}),this.model.stop(a);if(i.keep.length>0)for(const a of i.keep){const l=qn(this.beans,a);(r=this.editSvc)!=null&&r.cellEditingInvalidCommitBlocks()||l&&this.editSvc.revertSingleCellEdit(l)}}return!0}cleanupEditors({rowNode:e}={},t){ou(this.beans,{persist:!1});const n=this.model.getEditPositions(),o=[];if(e)for(const s of n)s.rowNode!==e&&o.push(s);else for(const s of n)o.push(s);Qd(this.beans,o),kR(this.beans,t)}setFocusOutOnEditor(e){var t,n,o;(o=(n=(t=e.comp)==null?void 0:t.getCellEditor())==null?void 0:n.focusOut)==null||o.call(n)}setFocusInOnEditor(e){const t=e.comp,n=t==null?void 0:t.getCellEditor();if(n!=null&&n.focusIn)n.focusIn();else{const o=this.beans.gos.get("editType")==="fullRow";e.focusCell(o),e.onEditorAttachedFuncs.push(()=>{var s,r;return(r=(s=t==null?void 0:t.getCellEditor())==null?void 0:s.focusIn)==null?void 0:r.call(s)})}}setupEditors(e){const{event:t,ignoreEventKey:n=!1,startedEdit:o,position:s,cells:r=this.model.getEditPositions()}=e,i=t instanceof KeyboardEvent&&!n&&t.key||void 0;Vwe(this.beans,r,s,i,t,o)}dispatchCellEvent(e,t,n,o){const s=qn(this.beans,e);s&&this.eventSvc.dispatchEvent({...s.createEvent(t??null,n),...o})}dispatchRowEvent(e,t,n){if(n)return;const o=xR(this.beans,e);o&&this.eventSvc.dispatchEvent(o.createRowEvent(t))}shouldStop(e,t,n="ui"){const o=this.editSvc.isBatchEditing();return o&&n==="api"?!0:o&&(n==="ui"||n==="edit")?!1:n==="api"?!0:t instanceof KeyboardEvent&&!o?t.key===Le.ENTER:null}shouldCancel(e,t,n="ui"){const o=this.editSvc.isBatchEditing();return!!(t instanceof KeyboardEvent&&!o&&t.key===Le.ESCAPE||o&&n==="api"||n==="api")}setEditMap(e,t){var o;t!=null&&t.update||this.editSvc.stopEditing(void 0,{cancel:!0,source:"api"});const n=[];if(e.forEach((s,r)=>{s.forEach((i,a)=>{i.state==="editing"&&n.push({...i,rowNode:r,column:a})})}),t!=null&&t.update&&(e=new Map([...this.model.getEditMap(),...e])),(o=this.model)==null||o.setEditMap(e),n.length>0){const s=n.at(-1),r=s.pendingValue===kr?void 0:s.pendingValue;this.start({position:s,event:new KeyboardEvent("keydown",{key:r}),source:"api"});const i=qn(this.beans,s);i&&this.setFocusInOnEditor(i)}}destroy(){this.cleanupEditors(),super.destroy()}},x0e=class extends JH{constructor(){super(...arguments),this.beanName="fullRow",this.startedRows=[]}shouldStop(e,t,n="ui"){const{rowNode:o}=e||{};if(!xR(this.beans,{rowNode:this.rowNode}))return!0;const r=super.shouldStop({rowNode:this.rowNode},t,n);return r!==null?r:this.rowNode?o!==this.rowNode:!1}midBatchInputsAllowed({rowNode:e}){return e?this.model.hasEdits({rowNode:e}):!1}clearEdits(e){this.model.clearEditValue(e)}start(e){const{position:t,silent:n,startedEdit:o,event:s,ignoreEventKey:r}=e,{rowNode:i}=t;this.rowNode!==i&&super.cleanupEditors(t);const a=this.beans.visibleCols.allCols,l=[],c=[];for(const u of a)u.isCellEditable(i)&&c.push(u);if(c.length!=0){this.dispatchRowEvent({rowNode:i},"rowEditingStarted",n),this.startedRows.push(i);for(const u of c){const d={rowNode:i,column:u};l.push(d),this.model.hasEdits(d)||this.model.start(d)}this.rowNode=i,this.setupEditors({cells:l,position:t,startedEdit:o,event:s,ignoreEventKey:r})}}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){var s;const{rowNode:n}=this;if(n&&!this.model.hasRowEdits(n))return!1;const o=[];if(e||this.model.getEditMap().forEach((r,i)=>{if(!(!r||r.size===0)){for(const a of r.values())if(Aa(a)){o.push(i);break}}}),su(this.beans),!e&&((s=this.editSvc)==null?void 0:s.checkNavWithValidation({rowNode:n}))==="block-stop")return!1;super.stop(e,t);for(const r of o)this.dispatchRowEvent({rowNode:r},"rowValueChanged");return this.cleanupEditors({rowNode:n},!0),this.rowNode=void 0,!0}onCellFocusChanged(e){const{rowIndex:t}=e,n=e.previousParams;if((n==null?void 0:n.rowIndex)===t||e.sourceEvent instanceof KeyboardEvent)return;const o=qn(this.beans,n);this.gos.get("invalidEditValueMode")==="block"&&o&&(this.model.getCellValidationModel().getCellValidation(o)||this.model.getRowValidationModel().getRowValidation(o))||super.onCellFocusChanged(e)}cleanupEditors(e={},t){super.cleanupEditors(e,t);for(const n of this.startedRows)this.dispatchRowEvent({rowNode:n},"rowEditingStopped");this.startedRows.length=0}moveToNextEditingCell(e,t,n,o="ui",s=!1){var h,f,p,g;const r=e.cellPosition;let i;this.model.suspend(!0);try{i=(h=this.beans.navigation)==null?void 0:h.findNextCellToFocusOn(r,{backwards:t,startEditing:!0,skipToNextEditableCell:!1})}finally{this.model.suspend(!1)}if(i===!1)return null;if(i==null)return!1;const a=i.cellPosition,l=e.isCellEditable(),c=i.isCellEditable(),u=a&&r.rowIndex===a.rowIndex&&r.rowPinned===a.rowPinned;l&&this.setFocusOutOnEditor(e),this.restoreEditors();const d=this.gos.get("suppressStartEditOnTab");return c&&!s?d?i.focusCell(!0,n):((f=i.comp)!=null&&f.getCellEditor()||Jd(this.beans,i,{event:n,cellStartedEdit:!0}),this.setFocusInOnEditor(i),i.focusCell(!1,n)):(c&&s&&this.setFocusInOnEditor(i),i.focusCell(!0,n)),!u&&!s&&((p=this.editSvc)==null||p.stopEditing({rowNode:e.rowNode},{event:n}),this.cleanupEditors(i,!0),d?i.focusCell(!0,n):this.editSvc.startEditing(i,{startedEdit:!0,event:n,source:o,ignoreEventKey:!0})),(g=e.rowCtrl)==null||g.refreshRow({suppressFlash:!0,force:!0}),!0}restoreEditors(){this.model.getEditMap().forEach((e,t)=>e.forEach(({state:n},o)=>{var r;if(n!=="editing")return;const s=qn(this.beans,{rowNode:t,column:o});s&&!((r=s.comp)!=null&&r.getCellEditor())&&Jd(this.beans,s,{silent:!0})}))}destroy(){super.destroy(),this.rowNode=void 0,this.startedRows.length=0}},P0e=class extends JH{constructor(){super(...arguments),this.beanName="singleCell"}shouldStop(e,t,n="ui"){const o=super.shouldStop(e,t,n);if(o!==null)return o;const{rowNode:s,column:r}=e||{};return(!this.rowNode||!this.column)&&s&&r?null:this.rowNode!==s||this.column!==r}midBatchInputsAllowed(e){return this.model.hasEdits(e)}start(e){const{position:t,startedEdit:n,event:o,ignoreEventKey:s}=e;(this.rowNode!==t.rowNode||this.column!==t.column)&&super.cleanupEditors(),this.rowNode=t.rowNode,this.column=t.column,this.model.start(t),this.setupEditors({cells:[t],position:t,startedEdit:n,event:o,ignoreEventKey:s})}dispatchRowEvent(e,t,n){}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){return super.stop(e,t),this.rowNode=void 0,this.column=void 0,!0}onCellFocusChanged(e){const{colModel:t,editSvc:n}=this.beans,{rowIndex:o,column:s,rowPinned:r}=e,i=Fa(this.beans,{rowIndex:o,rowPinned:r}),a=PR(s),l=t.getCol(a),c=e.previousParams;if(c){const u=PR(c.column);if((c==null?void 0:c.rowIndex)===o&&u===a&&(c==null?void 0:c.rowPinned)===r)return}n!=null&&n.isEditing({rowNode:i,column:l},{withOpenEditor:!0})&&e.type==="cellFocused"||super.onCellFocusChanged(e)}moveToNextEditingCell(e,t,n,o="ui",s=!1){var p,g,v,C,S,b;const r=this.beans.focusSvc.getFocusedCell();r&&(e=Xd(this.beans,r)??e);const i=e.cellPosition;let a;const l=this.beans.gos.get("editType")==="fullRow";l&&this.model.suspend(!0),s||(e.eGui.focus(),(g=this.editSvc)==null||g.stopEditing(e,{source:(p=this.editSvc)!=null&&p.isBatchEditing()?"ui":"api",event:n}));try{a=(v=this.beans.navigation)==null?void 0:v.findNextCellToFocusOn(i,{backwards:t,startEditing:!0})}finally{l&&this.model.suspend(!1)}if(a===!1)return null;if(a==null)return!1;const c=a.cellPosition,u=e.isCellEditable(),d=a.isCellEditable(),h=c&&i.rowIndex===c.rowIndex&&i.rowPinned===c.rowPinned;u&&!s&&this.setFocusOutOnEditor(e);const f=this.gos.get("suppressStartEditOnTab");if(!h&&!s&&(super.cleanupEditors(a,!0),f?a.focusCell(!0,n):this.editSvc.startEditing(a,{startedEdit:!0,event:n,source:o,ignoreEventKey:!0})),d&&!s){if(a.focusCell(!1,n),f)a.focusCell(!0,n);else if(!((C=a.comp)!=null&&C.getCellEditor())){const y=(S=this.editSvc)==null?void 0:S.isEditing(a,{withOpenEditor:!0});Jd(this.beans,a,{event:n,cellStartedEdit:!0,silent:y}),this.setFocusInOnEditor(a),this.cleanupEditors(a)}}else d&&s&&this.setFocusInOnEditor(a),a.focusCell(!0,n);return(b=e.rowCtrl)==null||b.refreshRow({suppressFlash:!0,force:!0}),!0}destroy(){super.destroy(),this.rowNode=void 0,this.column=void 0}},Ll={moduleName:"EditCore",version:ut,beans:[Mwe,D0e],apiFunctions:{getEditingCells:r0e,getEditRowValues:s0e,getCellEditorInstances:Lwe,startEditingCell:l0e,stopEditing:i0e,isEditing:a0e,validateEdit:c0e},dynamicBeans:{singleCell:P0e,fullRow:x0e},dependsOn:[xw,HH],css:[MSe]},k0e={moduleName:"UndoRedoEdit",version:ut,beans:[OSe],apiFunctions:{undoCellEditing:n0e,redoCellEditing:o0e,getCurrentUndoSize:u0e,getCurrentRedoSize:d0e},dependsOn:[Ll]},F0e={moduleName:"TextEditor",version:ut,userComponents:{agCellEditor:UH,agTextCellEditor:UH},dependsOn:[Ll]},A0e={moduleName:"NumberEditor",version:ut,userComponents:{agNumberCellEditor:{classImp:qSe}},dependsOn:[Ll]},O0e={moduleName:"DateEditor",version:ut,userComponents:{agDateCellEditor:$Se,agDateStringCellEditor:USe},dependsOn:[Ll]},M0e={moduleName:"CheckboxEditor",version:ut,userComponents:{agCheckboxCellEditor:LSe},dependsOn:[Ll]},N0e={moduleName:"SelectEditor",version:ut,userComponents:{agSelectCellEditor:XSe},dependsOn:[Ll]},L0e={moduleName:"LargeTextEditor",version:ut,userComponents:{agLargeTextCellEditor:zSe},dependsOn:[Ll]},V0e={moduleName:"CustomEditor",version:ut,dependsOn:[Ll]},B0e=class extends je{constructor(){super(...arguments),this.beanName="selectionColSvc"}postConstruct(){this.addManagedPropertyListener("rowSelection",e=>{this.onSelectionOptionsChanged(e.currentValue,e.previousValue,Hd(e.source))}),this.addManagedPropertyListener("selectionColumnDef",this.updateColumns.bind(this))}addColumns(e){const t=this.columns;t!=null&&(e.list=t.list.concat(e.list),e.tree=t.tree.concat(e.tree),Xue(e))}createColumns(e,t){var h,f;const n=()=>{var p;Yy(this.beans,(p=this.columns)==null?void 0:p.tree),this.columns=null},o=e.treeDepth,r=(((h=this.columns)==null?void 0:h.treeDepth)??-1)==o,i=this.generateSelectionCols();if(Yue(i,((f=this.columns)==null?void 0:f.list)??[])&&r)return;n();const{colGroupSvc:l}=this.beans,c=(l==null?void 0:l.findDepth(e.tree))??0,u=(l==null?void 0:l.balanceTreeForAutoCols(i,c))??[];this.columns={list:i,tree:u,treeDepth:c,map:{}},t(p=>{if(!p)return null;const g=p.filter(v=>!Ta(v));return[...i,...g]})}updateColumns(e){var n;const t=Hd(e.source);for(const o of((n=this.columns)==null?void 0:n.list)??[]){const s=this.createSelectionColDef(e.currentValue);o.setColDef(s,null,t),ei(this.beans,{state:[{...s,colId:o.getColId()}]},t)}}getColumn(e){var t;return((t=this.columns)==null?void 0:t.list.find(n=>$p(n,e)))??null}getColumns(){var e;return((e=this.columns)==null?void 0:e.list)??null}isSelectionColumnEnabled(){var i,a;const{gos:e,beans:t}=this,n=e.get("rowSelection");if(typeof n!="object"||!Wc(e))return!1;const o=(((a=(i=t.autoColSvc)==null?void 0:i.getColumns())==null?void 0:a.length)??0)>0;if(n.checkboxLocation==="autoGroupColumn"&&o)return!1;const s=!!$d(n),r=Uy(n);return s||r}createSelectionColDef(e){const{gos:t}=this,n=e??t.get("selectionColumnDef"),o=t.get("enableRtl"),{rowSpan:s,spanRows:r,...i}=n??{};return{width:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:o?"right":"left",comparator(a,l,c,u){const d=c.isSelected(),h=u.isSelected();return d===h?0:d?1:-1},editable:!1,suppressFillHandle:!0,pinned:null,...i,colId:$B,chartDataType:"excluded"}}generateSelectionCols(){if(!this.isSelectionColumnEnabled())return[];const e=this.createSelectionColDef(),t=e.colId;this.gos.validateColDef(e,t,!0);const n=new Kc(e,null,t,!1);return this.createBean(n),[n]}onSelectionOptionsChanged(e,t,n){const o=t&&typeof t!="string"?$d(t):void 0,s=e&&typeof e!="string"?$d(e):void 0,r=o!==s,i=t&&typeof t!="string"?Uy(t):void 0,a=e&&typeof e!="string"?Uy(e):void 0,l=i!==a,c=Wy(e),u=Wy(t);(r||l||c!==u)&&this.beans.colModel.refreshAll(n)}destroy(){var e;Yy(this.beans,(e=this.columns)==null?void 0:e.tree),super.destroy()}refreshVisibility(e,t,n){var l,c;if(!((l=this.columns)!=null&&l.list.length))return;const o=e.length+t.length+n.length;if(o===0)return;const s=this.columns.list[0];if(!s.isVisible())return;const r=()=>{let u;switch(s.pinned){case"left":case!0:u=e;break;case"right":u=n;break;default:u=t}u&&Qr(u,s)};(((c=this.beans.rowNumbersSvc)==null?void 0:c.getColumn(HB))?2:1)===o&&r()}};function $0e(e,t){var i;if(!t.nodes.every(a=>a.rowPinned&&!Yp(a)?(Je(59),!1):a.id===void 0?(Je(60),!1):!0))return;const{nodes:o,source:s,newValue:r}=t;(i=e.selectionSvc)==null||i.setNodesSelected({nodes:o,source:s??"api",newValue:r})}function H0e(e,t,n="apiSelectAll"){var o;(o=e.selectionSvc)==null||o.selectAllRowNodes({source:n,selectAll:t})}function G0e(e,t,n="apiSelectAll"){var o;(o=e.selectionSvc)==null||o.deselectAllRowNodes({source:n,selectAll:t})}function U0e(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"filtered"})}function W0e(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"filtered"})}function z0e(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"currentPage"})}function j0e(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"currentPage"})}function K0e(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedNodes())??[]}function q0e(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedRows())??[]}var Y0e=class extends lge{constructor(){super(...arguments),this.beanName="selectionSvc",this.selectedNodes=new Map,this.detailSelection=new Map,this.masterSelectsDetail=!1}postConstruct(){super.postConstruct();const{gos:e}=this;this.mode=zy(e),this.groupSelectsDescendants=Vp(e),this.groupSelectsFiltered=jy(e)==="filteredDescendants",this.masterSelectsDetail=MB(e)==="detail",this.addManagedPropertyListeners(["groupSelectsChildren","groupSelectsFiltered","rowSelection"],()=>{const t=Vp(e),n=zy(e),o=jy(e)==="filteredDescendants";this.masterSelectsDetail=MB(e)==="detail",(t!==this.groupSelectsDescendants||o!==this.groupSelectsFiltered||n!==this.mode)&&(this.deselectAllRowNodes({source:"api"}),this.groupSelectsDescendants=t,this.groupSelectsFiltered=o,this.mode=n)}),this.addManagedEventListeners({rowSelected:this.onRowSelected.bind(this)})}destroy(){super.destroy(),this.resetNodes()}handleSelectionEvent(e,t,n){if(this.isRowSelectionBlocked(t))return 0;const o=this.inferNodeSelections(t,e.shiftKey,e.metaKey||e.ctrlKey,n);if(o==null)return 0;if(this.selectionCtx.selectAll=!1,"select"in o)return o.reset?this.resetNodes():this.selectRange(o.deselect,!1,n),this.selectRange(o.select,!0,n);{const s=o.checkFilteredNodes?eG(o.node):o.newValue;return this.setNodesSelected({nodes:[o.node],newValue:s,clearSelection:o.clearSelection,keepDescendants:o.keepDescendants,event:e,source:n})}}setNodesSelected({newValue:e,clearSelection:t,suppressFinishActions:n,nodes:o,event:s,source:r,keepDescendants:i=!1}){var c;if(o.length===0)return 0;const{gos:a}=this;if(!Wc(a)&&e)return Je(132),0;if(o.length>1&&!this.isMultiSelect())return Je(130),0;let l=0;for(let u=0;u<o.length;u++){const d=o[u],h=sh(d);if(h.rowPinned&&!Yp(h)){Je(59);continue}if(h.id===void 0){Je(60);continue}this.groupSelectsFiltered&&h.group&&!a.get("treeData")||this.selectRowNode(h,e,s,r)&&(this.detailSelection.delete(h.id),l++),this.groupSelectsDescendants&&((c=h.childrenAfterGroup)!=null&&c.length)&&(l+=this.selectChildren(h,e,r))}return n||(o.length===1&&r==="api"&&this.selectionCtx.setRoot(sh(o[0])),e&&(t||!this.isMultiSelect())&&(l+=this.clearOtherNodes(sh(o[0]),i,r)),l>0&&(this.updateGroupsFromChildrenSelections(r),this.dispatchSelectionChanged(r))),l}selectRange(e,t,n){let o=0;return e.forEach(s=>{const r=sh(s);if(r.group&&this.groupSelectsDescendants)return;this.selectRowNode(r,t,void 0,n)&&o++}),o>0&&(this.updateGroupsFromChildrenSelections(n),this.dispatchSelectionChanged(n)),o}selectChildren(e,t,n){const o=this.groupSelectsFiltered?e.childrenAfterAggFilter:e.childrenAfterGroup;return o?this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,source:n,nodes:o}):0}getSelectedNodes(){return Array.from(this.selectedNodes.values())}getSelectedRows(){const e=[];return this.selectedNodes.forEach(t=>t.data&&e.push(t.data)),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach((n,o)=>{e(n)&&t.set(o,n)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsDescendants)return!1;const{gos:n,rowModel:o}=this.beans;if(!lo(n))return!1;const s=o.rootNode;if(!s)return!1;t||(t=new Zp(!0,s),t.active=!1);let r=!1;return t.forEachChangedNodeDepthFirst(i=>{if(i!==s){const a=this.calculateSelectedFromChildren(i);r=this.selectRowNode(i,a===null?!1:a,void 0,e)||r}}),r}clearOtherNodes(e,t,n){const o=new Map;let s=0;return this.selectedNodes.forEach(r=>{const i=r.id==e.id;if((t?!Z0e(e,r):!0)&&!i){const l=this.selectedNodes.get(r.id);s+=this.setNodesSelected({nodes:[l],newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:n}),this.groupSelectsDescendants&&r.parent&&o.set(r.parent.id,r.parent)}}),o.forEach(r=>{const i=this.calculateSelectedFromChildren(r);this.selectRowNode(r,i===null?!1:i,void 0,n)}),s}onRowSelected(e){const t=e.node;this.groupSelectsDescendants&&t.group||(t.isSelected()?this.selectedNodes.set(t.id,t):this.selectedNodes.delete(t.id))}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}createDaemonNode(e){if(!e.id)return;const t=new kl(this.beans);return t.id=e.id,t.data=e.data,t.__selected=e.__selected,t.level=e.level,t}syncInOldRowNode(e,t){t&&e.id!==t.id&&this.selectedNodes.get(t.id)==e&&this.selectedNodes.set(t.id,t)}syncInNewRowNode(e){this.selectedNodes.has(e.id)?(e.__selected=!0,this.selectedNodes.set(e.id,e)):e.__selected=!1}reset(e){const t=this.getSelectionCount();this.resetNodes(),t&&this.dispatchSelectionChanged(e)}resetNodes(){this.selectedNodes.forEach(e=>{this.selectRowNode(e,!1)}),this.selectedNodes.clear()}getBestCostNodeSelection(){const{gos:e,rowModel:t}=this.beans;if(!lo(e))return;const n=t.getTopLevelNodes();if(n===null)return;const o=[];function s(r){for(let i=0,a=r.length;i<a;i++){const l=r[i];l.isSelected()?o.push(l):l.group&&l.childrenAfterGroup&&s(l.childrenAfterGroup)}}return s(n),o}isEmpty(){return this.getSelectionCount()===0}deselectAllRowNodes({source:e,selectAll:t}){const n=lo(this.gos);let o=!1;const s=r=>{const i=this.selectRowNode(sh(r),!1,void 0,e);o||(o=i)};if(t==="currentPage"||t==="filtered"){if(!n){Rn(102);return}this.getNodesToSelect(t).forEach(s)}else this.selectedNodes.forEach(s),this.reset(e);if(this.selectionCtx.selectAll=!1,n&&this.groupSelectsDescendants){const r=this.updateGroupsFromChildrenSelections(e);o||(o=r)}o&&this.dispatchSelectionChanged(e)}getSelectedCounts(e){let t=0,n=0;return this.getNodesToSelect(e).forEach(o=>{this.groupSelectsDescendants&&o.group||(o.isSelected()?t++:o.selectable&&n++)}),{selectedCount:t,notSelectedCount:n}}getSelectAllState(e){const{selectedCount:t,notSelectedCount:n}=this.getSelectedCounts(e);return QH(t,n)??null}hasNodesToSelect(e){return this.getNodesToSelect(e).filter(t=>t.selectable).length>0}getNodesToSelect(e){if(!this.canSelectAll())return[];const t=[],n=s=>t.push(s);if(e==="currentPage")return this.forEachNodeOnPage(s=>{if(!s.group){n(s);return}if(!s.expanded&&!s.footer){const r=i=>{var a;n(i),(a=i.childrenAfterFilter)==null||a.forEach(r)};r(s);return}this.groupSelectsDescendants||n(s)}),t;const o=this.beans.rowModel;return e==="filtered"?(o.forEachNodeAfterFilter(n),t):(o.forEachNode(n),t)}forEachNodeOnPage(e){const{pageBounds:t,rowModel:n}=this.beans,o=t.getFirstRow(),s=t.getLastRow();for(let r=o;r<=s;r++){const i=n.getRow(r);i&&e(i)}}selectAllRowNodes(e){const{gos:t,selectionCtx:n}=this;if(!Wc(t)){Je(132);return}if(Nue(t)&&!Lp(t)){Je(130);return}if(!this.canSelectAll())return;const{source:o,selectAll:s}=e;let r=!1;if(this.getNodesToSelect(s).forEach(i=>{const a=this.selectRowNode(sh(i),!0,void 0,o);r||(r=a)}),n.selectAll=!0,lo(t)&&this.groupSelectsDescendants){const i=this.updateGroupsFromChildrenSelections(o);r||(r=i)}r&&this.dispatchSelectionChanged(o)}getSelectionState(){return this.isEmpty()?null:Array.from(this.selectedNodes.keys())}setSelectionState(e,t,n){if(e||(e=[]),!Array.isArray(e)){Rn(103);return}const o=new Set(e),s=[];this.beans.rowModel.forEachNode(r=>{o.has(r.id)&&s.push(r)}),n&&this.resetNodes(),this.setNodesSelected({newValue:!0,nodes:s,source:t})}canSelectAll(){return lo(this.beans.gos)}updateSelectable(e){var l;const{gos:t,rowModel:n}=this.beans;if(!Wc(t))return;const o="selectableChanged",s=e!==void 0,r=lo(t)&&this.groupSelectsDescendants,i=[],a=c=>{var d;if(s&&!c.group)return;if(r&&c.group){const h=((d=c.childrenAfterGroup)==null?void 0:d.some(f=>f.selectable))??!1;this.setRowSelectable(c,h,!0);return}!this.updateRowSelectable(c,!0)&&c.isSelected()&&i.push(c)};if(r){if(e===void 0){const c=n.rootNode;e=c?new Zp(!1,c):void 0}e==null||e.forEachChangedNodeDepthFirst(a,!s,!s)}else n.forEachNode(a);i.length&&this.setNodesSelected({nodes:i,newValue:!1,source:o}),!s&&r&&((l=this.updateGroupsFromChildrenSelections)==null||l.call(this,o))}updateSelectableAfterGrouping(e){var t;this.updateSelectable(e),this.groupSelectsDescendants&&((t=this.updateGroupsFromChildrenSelections)!=null&&t.call(this,"rowGroupChanged",e))&&this.dispatchSelectionChanged("rowGroupChanged")}refreshMasterNodeState(e,t){var r,i;if(!this.masterSelectsDetail)return;const n=(i=(r=e.detailNode)==null?void 0:r.detailGridInfo)==null?void 0:i.api;if(!n)return;const o=X0e(n);if(e.isSelected()!==o&&this.selectRowNode(e,o,t,"masterDetail")&&this.dispatchSelectionChanged("masterDetail"),!o){const a=this.detailSelection.get(e.id)??new Set;for(const l of n.getSelectedNodes())a.add(l.id);this.detailSelection.set(e.id,a)}}setDetailSelectionState(e,t,n){if(this.masterSelectsDetail){if(!Lp(t)){Je(269);return}switch(e.isSelected()){case!0:{n.selectAll();break}case!1:{n.deselectAll();break}case void 0:{const o=this.detailSelection.get(e.id);if(o){const s=[];for(const r of o){const i=n.getRowNode(r);i&&s.push(i)}n.setNodesSelected({nodes:s,newValue:!0,source:"masterDetail"})}break}}}}dispatchSelectionChanged(e){this.eventSvc.dispatchEvent({type:"selectionChanged",source:e,selectedNodes:this.getSelectedNodes(),serverSideState:null})}};function sh(e){return Yp(e)?e.pinnedSibling:e.footer?e.sibling:e}function X0e(e){let t=0,n=0;return e.forEachNode(o=>{o.isSelected()?t++:o.selectable&&n++}),QH(t,n)}function QH(e,t){if(e===0&&t===0)return!1;if(!(e>0&&t>0))return e>0}function Z0e(e,t){let n=t.parent;for(;n;){if(n===e)return!0;n=n.parent}return!1}function eG(e){var o;const t=e.isSelected()===!1,n=((o=e.childrenAfterFilter)==null?void 0:o.some(eG))??!1;return t||n}var J0e={moduleName:"SharedRowSelection",version:ut,beans:[B0e],apiFunctions:{setNodesSelected:$0e,selectAll:H0e,deselectAll:G0e,selectAllFiltered:U0e,deselectAllFiltered:W0e,selectAllOnCurrentPage:z0e,deselectAllOnCurrentPage:j0e,getSelectedNodes:K0e,getSelectedRows:q0e}},Q0e={moduleName:"RowSelection",version:ut,rowModels:["clientSide","infinite","viewport"],beans:[Y0e],dependsOn:[J0e]};function eEe(e){var t;(t=e.expansionSvc)==null||t.expandAll(!0)}function tEe(e){var t;(t=e.expansionSvc)==null||t.expandAll(!1)}function tG(e){var t;(t=e.rowModel)==null||t.onRowHeightChanged()}function nG(e){var t,n;if((t=e.rowAutoHeight)!=null&&t.active){Je(3);return}(n=e.rowModel)==null||n.resetRowHeights()}function nEe(e,t,n){var s,r;const o=obe(e);if(o){if(((s=e.rowGroupColsSvc)==null?void 0:s.columns.length)===0){if(t<0){Rn(238);return}o.setRowCount(t,n);return}Rn(28);return}(r=Iw(e))==null||r.setRowCount(t,n)}function oEe(e){var t;return Ld(e.gos)?e.rowModel.getBlockStates():((t=e.rowNodeBlockLoader)==null?void 0:t.getBlockState())??{}}function sEe(e){return e.rowModel.isLastRowIndexKnown()}var rEe={moduleName:"CsrmSsrmSharedApi",version:ut,apiFunctions:{expandAll:eEe,collapseAll:tEe}},iEe={moduleName:"RowModelSharedApi",version:ut,apiFunctions:{onRowHeightChanged:tG,resetRowHeights:nG}},aEe={moduleName:"SsrmInfiniteSharedApi",version:ut,apiFunctions:{setRowCount:nEe,getCacheBlockState:oEe,isLastRowIndexKnown:sEe}},lEe=class extends je{constructor(){super(...arguments),this.beanName="alignedGridsSvc",this.consuming=!1}getAlignedGridApis(){let e=this.gos.get("alignedGrids")??[];const t=typeof e=="function";return typeof e=="function"&&(e=e()),e.map(o=>{var r;if(!o){Rn(18),t||Rn(20);return}if(this.isGridApi(o))return o;const s=o;return"current"in s?(r=s.current)==null?void 0:r.api:(s.api||Rn(19),s.api)}).filter(o=>!!o&&!o.isDestroyed())}isGridApi(e){return!!e&&!!e.dispatchEvent}postConstruct(){const e=this.fireColumnEvent.bind(this);this.addManagedEventListeners({columnMoved:e,columnVisible:e,columnPinned:e,columnGroupOpened:e,columnResized:e,bodyScroll:this.fireScrollEvent.bind(this),alignedGridColumn:({event:t})=>this.onColumnEvent(t),alignedGridScroll:({event:t})=>this.onScrollEvent(t)})}fireEvent(e){if(!this.consuming)for(const t of this.getAlignedGridApis())t.isDestroyed()||t.dispatchEvent(e)}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){this.fireEvent({type:"alignedGridColumn",event:e})}fireScrollEvent(e){e.direction==="horizontal"&&this.fireEvent({type:"alignedGridScroll",event:e})}onScrollEvent(e){this.onEvent(()=>{this.beans.ctrlsSvc.getScrollFeature().setHorizontalScrollPosition(e.left,!0)})}extractDataFromEvent(e,t){const n=[];return e.columns?e.columns.forEach(o=>{n.push(t(o))}):e.column&&n.push(t(e.column)),n}getMasterColumns(e){return this.extractDataFromEvent(e,t=>t)}getColumnIds(e){return this.extractDataFromEvent(e,t=>t.getColId())}onColumnEvent(e){this.onEvent(()=>{switch(e.type){case"columnMoved":case"columnVisible":case"columnPinned":case"columnResized":{this.processColumnEvent(e);break}case"columnGroupOpened":{this.processGroupOpenedEvent(e);break}case"columnPivotChanged":Je(21);break}})}processGroupOpenedEvent(e){const{colGroupSvc:t}=this.beans;if(t)for(const n of e.columnGroups){let o=null;n&&(o=t.getProvidedColGroup(n.getGroupId())),!(n&&!o)&&t.setColumnGroupOpened(o,n.isExpanded(),"alignedGridChanged")}}processColumnEvent(e){const t=e.column;let n=null;const o=this.beans,{colResize:s,ctrlsSvc:r,colModel:i}=o;if(t&&(n=i.getColDefCol(t.getColId())),t&&!n)return;const a=this.getMasterColumns(e);switch(e.type){case"columnMoved":{const d=e.api.getColumnState().map(h=>({colId:h.colId}));ei(o,{state:d,applyOrder:!0},"alignedGridChanged")}break;case"columnVisible":{const d=e.api.getColumnState().map(h=>({colId:h.colId,hide:h.hide}));ei(o,{state:d},"alignedGridChanged")}break;case"columnPinned":{const d=e.api.getColumnState().map(h=>({colId:h.colId,pinned:h.pinned}));ei(o,{state:d},"alignedGridChanged")}break;case"columnResized":{const u=e,d={};for(const h of a)d[h.getId()]={key:h.getColId(),newWidth:h.getActualWidth()};for(const h of u.flexColumns??[])d[h.getId()]&&delete d[h.getId()];s==null||s.setColumnWidths(Object.values(d),!1,u.finished,"alignedGridChanged");break}}const c=r.getGridBodyCtrl().isVerticalScrollShowing();for(const u of this.getAlignedGridApis())u.setGridOption("alwaysShowVerticalScroll",c)}},cEe={moduleName:"AlignedGrids",version:ut,beans:[lEe],dependsOn:[$$]},uEe=class extends je{constructor(e){super(),this.rootNode=e,this.nextId=0,this.allNodesMap={},oG(e)}getRowNode(e){return this.allNodesMap[e]}setNewRowData(e){const{selectionSvc:t,pinnedRowModel:n,groupStage:o}=this.beans;t==null||t.reset("rowDataChanged"),n!=null&&n.isManual()&&n.reset(),this.dispatchRowDataUpdateStarted(e),this.allNodesMap=Object.create(null),this.nextId=0;const s=oG(this.rootNode),r=new Array(e.length);s._leafs=r;let i=0;const a=o==null?void 0:o.getNestedDataGetter(),l=a?new Set:null,c=(u,d)=>{const h=u.level+1;for(let f=0,p=d.length;f<p;++f){const g=d[f];if(!g)continue;const v=this.createRowNode(g,h);if(v.sourceRowIndex=i,r[i++]=v,l&&!l.has(g)){l.add(g),v.treeParent=u;const C=a(g);C&&c(v,C)}}};c(s,e),r.length=i}setImmutableRowData(e,t){var C;const{rootNode:n,gos:o}=this;this.dispatchRowDataUpdateStarted(t);const s=Bd(o),r=e.changedRowNodes,{adds:i,updates:a}=r,l=new Set,c=[],u=(C=this.beans.groupStage)==null?void 0:C.getNestedDataGetter();let d=o.get("suppressMaintainUnsortedOrder")?void 0:!1,h=-1,f=!1;const p=(S,b)=>{if(!d&&d!==void 0){const y=S.sourceRowIndex;d=y<=h,h=y}S.data!==b&&(S.updateData(b),i.has(S)||a.add(S),!S.selectable&&S.isSelected()&&c.push(S))},g=(S,b,y)=>{for(let _=0,E=b.length;_<E;++_){const D=b[_];if(!D)continue;let T=this.getRowNode(s({data:D,level:y}));if(T?(p(T,D),f||(f=!!u&&T.treeParent!==S)):(T=this.createRowNode(D,y),i.add(T)),!u||l.has(T)){l.add(T);continue}l.add(T),T.treeParent=S;const P=u(D);P&&g(T,P,y+1)}};g(n,t,0);const v=this.deleteUnusedNodes(l,r,c)||d||i.size>0;if(v){const S=n._leafs??(n._leafs=[]);d===void 0?gEe(S,l,r):pEe(S,l)&&(r.reordered=!0)}(v||f||a.size)&&(e.rowDataUpdated=!0,this.deselect(c))}deleteUnusedNodes(e,{removals:t},n){const o=this.rootNode._leafs;for(let s=0,r=o.length;s<r;s++){const i=o[s];e.has(i)||(t.add(i),i.isSelected()&&n.push(i),this.deleteNode(i))}return t.size>0}updateRowData(e,t){var a;if(this.dispatchRowDataUpdateStarted(e.add),(a=this.beans.groupStage)!=null&&a.getNestedDataGetter())return Je(268),{remove:[],update:[],add:[]};const n=[],o=Bd(this.gos),s=this.executeRemove(o,e,t,n),r=this.executeUpdate(o,e,t,n),i=this.executeAdd(e,t);return this.deselect(n),{remove:s,update:r,add:i}}executeRemove(e,{remove:t},{adds:n,updates:o,removals:s},r){const i=this.rootNode._leafs,a=i==null?void 0:i.length,l=t==null?void 0:t.length;if(!l||!a)return[];let c=0,u=a,d=0,h;const f=new Array(l);for(let p=0;p<l;++p){const g=this.lookupNode(e,t[p]);if(!g)continue;const v=g.sourceRowIndex;v<u&&(u=v),v>d&&(d=v),g.isSelected()&&r.push(g),this.deleteNode(g),n.delete(g)?(h??(h=new Set),h.add(g)):(o.delete(g),s.add(g)),f[c++]=g}return f.length=c,c&&fEe(i,u,d,s,h),f}executeUpdate(e,{update:t},{adds:n,updates:o},s){const r=t==null?void 0:t.length;if(!r)return[];const i=new Array(r);let a=0;for(let l=0;l<r;l++){const c=t[l],u=this.lookupNode(e,c);u&&(u.updateData(c),!u.selectable&&u.isSelected()&&s.push(u),i[a++]=u,n.has(u)||o.add(u))}return i.length=a,i}executeAdd(e,t){var n;const o=(n=this.rootNode)._leafs??(n._leafs=[]),s=o.length,r=e.add,i=r==null?void 0:r.length;if(!i)return[];const a=s+i;let l=this.sanitizeAddIndex(o,e.addIndex);if(l<s){for(let d=s-1,h=a-1;d>=l;--d){const f=o[d];f.sourceRowIndex=h,o[h--]=f}t.reordered=!0}o.length=a;const c=new Array(i),u=t.adds;for(let d=0;d<i;d++){const h=this.createRowNode(r[d],0);u.add(h),h.sourceRowIndex=l,o[l]=h,c[d]=h,l++}return c}dispatchRowDataUpdateStarted(e){this.eventSvc.dispatchEvent({type:"rowDataUpdateStarted",firstRowData:e!=null&&e.length?e[0]:null})}deselect(e){var o;const t="rowDataChanged",n=this.beans.selectionSvc;e.length&&(n==null||n.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t})),(o=n==null?void 0:n.updateGroupsFromChildrenSelections)==null||o.call(n,t),e.length&&this.eventSvc.dispatchEvent({type:"selectionChanged",source:t,selectedNodes:(n==null?void 0:n.getSelectedNodes())??null,serverSideState:null})}createRowNode(e,t){const n=new kl(this.beans);n.parent=this.rootNode,n.level=t,n.group=!1,n.expanded=!1,n.setDataAndId(e,String(this.nextId++));const o=n.id,s=this.allNodesMap;return s[o]&&Je(2,{nodeId:o}),s[o]=n,n}deleteNode(e){var s;e.clearRowTopAndRowIndex();const t=e.id,n=this.allNodesMap;n[t]===e&&delete n[t];const o=e.pinnedSibling;o&&((s=this.beans.pinnedRowModel)==null||s.pinRow(o,null))}lookupNode(e,t){if(!e)return hEe(this.rootNode._leafs,t);const n=e({data:t,level:0}),o=this.allNodesMap[n];return o||(Rn(4,{id:n}),null)}sanitizeAddIndex(e,t){const n=e.length;if(typeof t!="number"||t<0||t>=n||Number.isNaN(t))return n;t=Math.ceil(t);const o=this.gos;return t>0&&o.get("treeData")&&o.get("getDataPath")&&(t=dEe(e,t)),t}},dEe=(e,t)=>{for(let n=0,o=e.length;n<o;n++){const s=e[n];if((s==null?void 0:s.rowIndex)==t-1)return n+1}return t},oG=e=>{var i;e.group=!0,e.level=-1,e.id="ROOT_NODE_ID",((i=e._leafs)==null?void 0:i.length)!==0&&(e._leafs=[]);const t=[],n=[],o=[],s=[];e.childrenAfterGroup=t,e.childrenAfterSort=n,e.childrenAfterAggFilter=o,e.childrenAfterFilter=s;const r=e.sibling;return r&&(r.childrenAfterGroup=t,r.childrenAfterSort=n,r.childrenAfterAggFilter=o,r.childrenAfterFilter=s,r.childrenMapped=e.childrenMapped),e.updateHasChildren(),e},hEe=(e,t)=>{if(e)for(let n=0,o=e.length;n<o;n++){const s=e[n];if(s.data===t)return s}return Rn(5,{data:t}),null},fEe=(e,t,n,o,s)=>{t=Math.max(0,t);for(let r=t,i=e.length;r<i;++r){const a=e[r];r<=n&&(o.has(a)||s!=null&&s.has(a))||(a.sourceRowIndex=t,e[t++]=a)}e.length=t},pEe=(e,t)=>{const n=t.size;e.length=n;let o=0,s=!1,r=!1;for(const i of t){const a=i.sourceRowIndex;a===o?r||(r=s):(a>=0?r=!0:s=!0,i.sourceRowIndex=o,e[o]=i),++o}return r},gEe=(e,t,{removals:n,adds:o})=>{const s=e.length;e.length=t.size;let r=0;for(let i=0;i<s;++i){const a=e[i];n.has(a)||(r!==i&&(a.sourceRowIndex=r,e[r]=a),++r)}for(const i of o)i.sourceRowIndex<0&&(i.sourceRowIndex=r,e[r++]=i);e.length=r},sG=e=>{const t=e.childrenAfterSort,n=e.sibling;if(n&&(n.childrenAfterSort=t),!!t)for(let o=0,s=t.length-1;o<=s;o++){const r=t[o],i=o===0,a=o===s;r.firstChild!==i&&(r.firstChild=i,r.dispatchRowEvent("firstChildChanged")),r.lastChild!==a&&(r.lastChild=a,r.dispatchRowEvent("lastChildChanged")),r.childIndex!==o&&(r.childIndex=o,r.dispatchRowEvent("childIndexChanged"))}},mEe=class extends je{constructor(){super(...arguments),this.beanName="sortStage",this.step="sort",this.refreshProps=["postSortRows","groupDisplayType","accentedSort"]}execute(e){const t=this.beans.sortSvc.getSortOptions(),n=t.length>0&&!!e.changedRowNodes&&this.gos.get("deltaSort");this.sort(t,n,e.changedRowNodes,e.changedPath)}sort(e,t,n,o){const{gos:s,colModel:r,rowGroupColsSvc:i,rowNodeSorter:a,rowRenderer:l,showRowGroupCols:c}=this.beans,u=s.get("groupMaintainOrder"),d=r.getCols().some(S=>S.isRowGroupActive()),h=i==null?void 0:i.columns,f=r.isPivotMode(),p=s.getCallback("postSortRows");let g=!1,v;const C=S=>{var E,D;const b=f&&S.leafGroup;let y=u&&d&&!S.leafGroup;y&&(v??(v=this.shouldSortContainsGroupCols(e)),y&&(y=!v));let _=null;if(y){let T=!1;if(h){const P=S.level+1;P<h.length&&(T=h[P].getSort()===null)}T||(_=wEe(S))}else!e.length||b||(t&&n?_=vEe(a,S,n,o,e):_=a.doFullSort(S.childrenAfterAggFilter,e));if(_||(_=((E=S.childrenAfterAggFilter)==null?void 0:E.slice(0))??[]),g||(g=((D=S.childrenAfterSort)==null?void 0:D[0])!==_[0]),S.childrenAfterSort=_,sG(S),p){const T={nodes:S.childrenAfterSort};p(T)}};if(o==null||o.forEachChangedNodeDepthFirst(C),g&&s.get("groupHideOpenParents")){const S=c==null?void 0:c.getShowRowGroupCols();S!=null&&S.length&&l.refreshCells({columns:S,force:!0})}}shouldSortContainsGroupCols(e){const t=e.length;if(!t)return!1;if(Oi(this.gos)){for(let n=0;n<t;++n){const o=e[n].column;if(o.isPrimary()&&o.isRowGroupActive())return!0}return!1}for(let n=0;n<t;++n)if(e[n].column.getColDef().showRowGroup)return!0;return!1}},vEe=(e,t,n,o,s)=>{const r=t.childrenAfterAggFilter,i=t.childrenAfterSort;if(!i)return e.doFullSort(r,s);const a=new Set,l=[],{updates:c,adds:u}=n;for(let h=0,f=r.length;h<f;++h){const p=r[h];c.has(p)||u.has(p)||o&&!o.canSkip(p)?l.push({currentPos:l.length,rowNode:p}):a.add(p)}const d=i.filter(h=>a.has(h)).map((h,f)=>({currentPos:f,rowNode:h}));return l.sort((h,f)=>e.compareRowNodes(s,h,f)),yEe(e,s,l,d)},yEe=(e,t,n,o)=>{let s=0,r=0;const i=n.length,a=o.length,l=new Array(i+a);let c=0;for(;s<i&&r<a;){const u=n[s],d=o[r];e.compareRowNodes(t,u,d)<0?(l[c++]=u.rowNode,++s):(l[c++]=d.rowNode,++r)}for(;s<i;)l[c++]=n[s++].rowNode;for(;r<a;)l[c++]=o[r++].rowNode;return l},wEe=e=>{const t=e.childrenAfterSort,n=e.childrenAfterAggFilter,o=t==null?void 0:t.length,s=n==null?void 0:n.length;if(!o||!s)return null;const r=new Array(s),i=new Set;for(let l=0;l<s;++l)i.add(n[l]);let a=0;for(let l=0;l<o;++l){const c=t[l];i.delete(c)&&(r[a++]=c)}if(i.size===0&&a===o)return t;for(const l of i)r[a++]=l;return r.length=a,r},CEe=class extends je{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null,this.rowCountReady=!1,this.nodeManager=void 0,this.rowsToDisplay=[],this.rowDataUpdatedPending=!1,this.asyncTransactions=null,this.asyncTransactionsTimer=0,this.started=!1,this.refreshingModel=!1,this.rowNodesCountReady=!1,this.stages=[],this.stagesRefreshProps=new Map,this.onRowHeightChanged_debounced=qo(this,this.onRowHeightChanged.bind(this),100)}postConstruct(){const e=this.beans,t=new kl(e);this.rootNode=t,this.nodeManager=this.createBean(new uEe(t));const n=this.refreshModel.bind(this,{step:"group"}),o=this.refreshModel.bind(this,{step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame")});this.addManagedEventListeners({newColumnsLoaded:o,columnRowGroupChanged:n,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:this.refreshModel.bind(this,{step:"pivot"}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),columnPivotModeChanged:n,gridStylesChanged:this.onGridStylesChanges.bind(this),gridReady:this.onGridReady.bind(this),rowExpansionStateChanged:this.onRowGroupOpened.bind(this)}),this.addPropertyListeners()}addPropertyListeners(){const{beans:e,stagesRefreshProps:t}=this,n=[e.groupStage,e.filterStage,e.pivotStage,e.aggStage,e.sortStage,e.filterAggStage,e.flattenStage].filter(o=>!!o);this.stages=n;for(let o=n.length-1;o>=0;--o)for(const s of n[o].refreshProps)t.set(s,o);this.addManagedPropertyListeners([...t.keys()],o=>{var r;const s=(r=o.changeSet)==null?void 0:r.properties;s&&this.onPropChange(s)}),this.addManagedPropertyListener("rowData",()=>this.onPropChange(["rowData"])),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){this.started=!0,this.rowNodesCountReady?this.refreshModel({step:"group",rowDataUpdated:!0,newData:!0}):this.setInitialData()}setInitialData(){this.gos.get("rowData")&&this.onPropChange(["rowData"])}ensureRowHeightsValid(e,t,n,o){let s,r=!1;do{s=!1;const i=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),l=Math.max(i,n),c=Math.min(a,o);for(let u=l;u<=c;u++){const d=this.getRow(u);if(d.rowHeightEstimated){const h=Tl(this.beans,d);d.setRowHeight(h.height),s=!0,r=!0}}s&&this.setRowTopAndRowIndex()}while(s);return r}onPropChange(e){const{nodeManager:t,gos:n,beans:o}=this,s=o.groupStage;if(!t)return;const r=new Set(e),i=s==null?void 0:s.onPropChange(r);let a;r.has("rowData")?a=n.get("rowData"):i&&(a=s==null?void 0:s.extractData()),a&&!Array.isArray(a)&&(a=null,Je(1));const l={step:"nothing",changedProps:r};a&&(!i&&!this.isEmpty()&&a.length>0&&n.exists("getRowId")&&!n.get("resetRowDataOnUpdate")?(l.keepRenderedRows=!0,l.animate=!n.get("suppressAnimationFrame"),l.changedRowNodes=new Cw,t.setImmutableRowData(l,a)):(l.rowDataUpdated=!0,l.newData=!0,t.setNewRowData(a),this.rowNodesCountReady=!0));const c=l.rowDataUpdated?"group":this.getRefreshedStage(e);c&&(l.step=c,this.refreshModel(l))}getRefreshedStage(e){const{stages:t,stagesRefreshProps:n}=this,o=t.length;let s=o;for(let r=0,i=e.length;r<i&&s;++r)s=Math.min(s,n.get(e[r])??s);return s<o?t[s].step:null}setRowTopAndRowIndex(e){const{beans:t,rowsToDisplay:n}=this,o=t.environment.getDefaultRowHeight();let s=0;const r=Yo(this.gos,"normal");for(let i=0,a=n.length;i<a;++i){const l=n[i],c=l.id;if(c!=null&&(e==null||e.add(c)),l.rowHeight==null){const u=Tl(t,l,r,o);l.setRowHeight(u.height,u.estimated)}l.setRowTop(s),l.setRowIndex(i),s+=l.rowHeight}}clearRowTopAndRowIndex(e,t){const n=e.active,o=i=>{(i==null?void 0:i.id)!=null&&!t.has(i.id)&&i.clearRowTopAndRowIndex()},s=i=>{o(i),o(i.detailNode),o(i.sibling);const a=i.childrenAfterGroup;if(!i.hasChildren()||!a)return;const l=i.level==-1;if(!(n&&!l&&!i.expanded))for(let u=0,d=a.length;u<d;++u)s(a[u])},r=this.rootNode;r&&s(r)}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay.length}getTopLevelRowCount(){var s,r;const{rootNode:e,rowsToDisplay:t}=this;if(!e||!t.length)return 0;if(t[0]===e)return 1;const o=(s=e.sibling)!=null&&s.displayed?1:0;return(((r=e.childrenAfterSort)==null?void 0:r.length)??0)+o}getTopLevelRowDisplayedIndex(e){const{beans:t,rootNode:n,rowsToDisplay:o}=this;if(!n||!o.length||o[0]===n)return e;const r=n.childrenAfterSort,i=l=>{let c=r[l];if(this.gos.get("groupHideOpenParents"))for(;c.expanded&&c.childrenAfterSort&&c.childrenAfterSort.length>0;)c=c.childrenAfterSort[0];return c.rowIndex},a=t.footerSvc;return a?a==null?void 0:a.getTopDisplayIndex(o,e,r,i):i(e)}getTopLevelIndexFromDisplayedIndex(e){var a;const{rootNode:t,rowsToDisplay:n}=this;if(!t||!n.length||n[0]===t)return e;let s=this.getRow(e);s.footer&&(s=s.sibling);let r=s.parent;for(;r&&r!==t;)s=r,r=s.parent;const i=((a=t.childrenAfterSort)==null?void 0:a.indexOf(s))??-1;return i>=0?i:e}getRowBounds(e){const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){this.refreshModel({step:"map",keepRenderedRows:!0,animate:Vd(this.gos)})}onFilterChanged({afterDataChange:e,columns:t}){if(!e){const o=t.length===0||t.some(s=>s.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:o,keepRenderedRows:!0,animate:Vd(this.gos)})}}onSortChanged(){this.refreshModel({step:"sort",keepRenderedRows:!0,animate:Vd(this.gos)})}getType(){return"clientSide"}onValueChanged(){this.refreshModel({step:this.beans.colModel.isPivotActive()?"pivot":"aggregate"})}createChangePath(e){const t=new Zp(!1,this.rootNode);return t.active=e,t}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;const{changedRowNodes:t,newData:n,rowDataUpdated:o}=e;return!(!t||n||!o||t.removals.size||t.adds.size)}refreshModel(e){var c,u;const{nodeManager:t,beans:n,eventSvc:o,started:s,refreshingModel:r}=this;if(!t)return;const i=!!e.rowDataUpdated,a=e.changedPath??(e.changedPath=this.createChangePath(!e.newData&&i));if(s&&i&&o.dispatchEvent({type:"rowDataUpdated"}),!s||r||n.colModel.changeEventsDispatching||this.isSuppressModelUpdateAfterUpdateTransaction(e)){this.rowDataUpdatedPending||(this.rowDataUpdatedPending=i);return}switch(this.rowDataUpdatedPending&&(this.rowDataUpdatedPending=!1,e.step="group"),this.refreshingModel=!0,(c=n.masterDetailSvc)==null||c.refreshModel(e),i&&e.step!=="group"&&((u=n.colFilter)==null||u.refreshModel()),e.step){case"group":this.doGrouping(e);case"filter":this.doFilter(a);case"pivot":this.doPivot(a);case"aggregate":this.doAggregate(a);case"filter_aggregates":this.doFilterAggregates(a);case"sort":this.doSort(e.changedRowNodes,a);case"map":this.doRowsToDisplay()}const l=new Set;this.setRowTopAndRowIndex(l),this.clearRowTopAndRowIndex(a,l),this.refreshingModel=!1,o.dispatchEvent({type:"modelUpdated",animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:!1,keepUndoRedoStack:e.keepUndoRedoStack})}isEmpty(){var e,t,n;return!((t=(e=this.rootNode)==null?void 0:e._leafs)!=null&&t.length)||!((n=this.beans.colModel)!=null&&n.ready)}isRowsToRender(){return this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let n=!1,o=!1;const s=[],r=Vp(this.gos);return this.forEachNodeAfterFilterAndSort(i=>{if(o)return;if(n&&(i===t||i===e)&&(o=!0,r&&i.group)){rG(s,i);return}if(!n){if(i!==t&&i!==e)return;n=!0,t===e&&(o=!0)}(!i.group||!r)&&s.push(i)}),s}getTopLevelNodes(){var e;return((e=this.rootNode)==null?void 0:e.childrenAfterGroup)??null}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){const t=this.rowsToDisplay,n=t.length;if(this.isEmpty()||n===0)return-1;let o=0,s=n-1;if(e<=0)return 0;if(t[s].rowTop<=e)return s;let i=-1,a=-1;for(;;){const l=Math.floor((o+s)/2),c=t[l];if(this.isRowInPixel(c,e)||(c.rowTop<e?o=l+1:c.rowTop>e&&(s=l-1),i===o&&a===s))return l;i=o,a=s}}isRowInPixel(e,t){const n=e.rowTop,o=n+e.rowHeight;return n<=t&&o>t}forEachLeafNode(e){var n;const t=(n=this.rootNode)==null?void 0:n._leafs;if(t)for(let o=0,s=t.length;o<s;++o)e(t[o],o)}forEachNode(e,t=!1){this.depthFirstSearchRowNodes(e,t)}forEachDisplayedNode(e){const t=this.rowsToDisplay;for(let n=0,o=t.length;n<o;++n)e(t[n],n)}forEachNodeAfterFilter(e,t=!1){this.depthFirstSearchRowNodes(e,t,n=>n.childrenAfterAggFilter)}forEachNodeAfterFilterAndSort(e,t=!1){this.depthFirstSearchRowNodes(e,t,n=>n.childrenAfterSort)}forEachPivotNode(e,t,n){const{colModel:o,rowGroupColsSvc:s}=this.beans;if(!o.isPivotMode())return;if(!(s!=null&&s.columns.length)){e(this.rootNode,0);return}const r=n?"childrenAfterSort":"childrenAfterGroup";this.depthFirstSearchRowNodes(e,t,i=>i.leafGroup?null:i[r])}depthFirstSearchRowNodes(e,t=!1,n=r=>r.childrenAfterGroup,o=this.rootNode,s=0){let r=s;if(!o)return r;const i=o===this.rootNode;if(i||e(o,r++),o.hasChildren()&&!o.footer){const a=n(o);if(a){const l=this.beans.footerSvc;r=(l==null?void 0:l.addTotalRows(r,o,e,t,i,"top"))??r;for(const c of a)r=this.depthFirstSearchRowNodes(e,t,n,c,r);return(l==null?void 0:l.addTotalRows(r,o,e,t,i,"bottom"))??r}}return r}doAggregate(e){var n;const t=this.rootNode;t&&((n=this.beans.aggStage)==null||n.execute({rowNode:t,changedPath:e}))}doFilterAggregates(e){const t=this.rootNode,n=this.beans.filterAggStage;if(n){n.execute({rowNode:t,changedPath:e});return}t.childrenAfterAggFilter=t.childrenAfterFilter}doSort(e,t){const n=this.beans.sortStage;if(n){n.execute({rowNode:this.rootNode,changedRowNodes:e,changedPath:t});return}t.forEachChangedNodeDepthFirst(o=>{o.childrenAfterSort=o.childrenAfterAggFilter.slice(0),sG(o)})}doGrouping(e){var s;const t=this.rootNode,n=this.beans.groupStage,o=n==null?void 0:n.execute({rowNode:t,changedRowNodes:e.changedRowNodes,changedPath:e.changedPath,afterColumnsChanged:!!e.afterColumnsChanged});if(o===void 0){const r=t._leafs;t.childrenAfterGroup=r,t.updateHasChildren();const i=t.sibling;i&&(i.childrenAfterGroup=r)}(o||e.rowDataUpdated)&&((s=this.beans.colFilter)==null||s.refreshModel()),!this.rowCountReady&&this.rowNodesCountReady&&(this.rowCountReady=!0,this.eventSvc.dispatchEventOnce({type:"rowCountReady"}))}doFilter(e){const t=this.beans.filterStage;if(t){t.execute({rowNode:this.rootNode,changedPath:e});return}e.forEachChangedNodeDepthFirst(n=>{n.childrenAfterFilter=n.childrenAfterGroup,_H(n)},!0)}doPivot(e){var t;(t=this.beans.pivotStage)==null||t.execute({rowNode:this.rootNode,changedPath:e})}getRowNode(e){var o,s;const t=(o=this.nodeManager)==null?void 0:o.getRowNode(e);return typeof t=="object"?t:typeof e=="string"&&e.indexOf(W_)===0?(s=this.beans.groupStage)==null?void 0:s.getNode(e):void 0}batchUpdateRowData(e,t){if(!this.asyncTransactionsTimer){this.asyncTransactions=[];const n=this.gos.get("asyncTransactionWaitMillis");this.asyncTransactionsTimer=setTimeout(()=>this.executeBatchUpdateRowData(),n)}this.asyncTransactions.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){const e=this.asyncTransactionsTimer;e&&(clearTimeout(e),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){var a;const{nodeManager:e,beans:t,eventSvc:n,asyncTransactions:o}=this;if(!e)return;(a=t.valueCache)==null||a.onDataChanged();const s=[],r=[],i=new Cw;for(const{rowDataTransaction:l,callback:c}of o??[]){this.rowNodesCountReady=!0;const u=e.updateRowData(l,i);s.push(u),c&&r.push(c.bind(null,u))}this.commitTransactions(i),r.length>0&&setTimeout(()=>{for(let l=0,c=r.length;l<c;l++)r[l]()},0),s.length>0&&n.dispatchEvent({type:"asyncTransactionsFlushed",results:s}),this.asyncTransactionsTimer=0,this.asyncTransactions=null}updateRowData(e){var s;const t=this.nodeManager;if(!t)return null;(s=this.beans.valueCache)==null||s.onDataChanged(),this.rowNodesCountReady=!0;const n=new Cw,o=t.updateRowData(e,n);return this.commitTransactions(n),o}commitTransactions(e){this.refreshModel({step:"group",rowDataUpdated:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame"),changedRowNodes:e,changedPath:this.createChangePath(!0)})}doRowsToDisplay(){const{beans:e,rootNode:t}=this,n=e.flattenStage;if(n){this.rowsToDisplay=n.execute({rowNode:t});return}const o=this.rootNode.childrenAfterSort??[];for(const s of o)s.setUiLevel(0);this.rowsToDisplay=o}onRowHeightChanged(){this.refreshModel({step:"map",keepRenderedRows:!0,keepUndoRedoStack:!0})}resetRowHeights(){const e=this.rootNode;if(!e)return;const t=this.resetRowHeightsForAllRowNodes();e.setRowHeight(e.rowHeight,!0);const n=e.sibling;n==null||n.setRowHeight(n.rowHeight,!0),t&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{t.setRowHeight(t.rowHeight,!0);const n=t.detailNode;n==null||n.setRowHeight(n.rowHeight,!0);const o=t.sibling;o==null||o.setRowHeight(o.rowHeight,!0),e=!0}),e}onGridStylesChanges(e){var t;e.rowHeightChanged&&!((t=this.beans.rowAutoHeight)!=null&&t.active)&&this.resetRowHeights()}onGridReady(){this.started||this.setInitialData()}destroy(){super.destroy(),this.nodeManager=this.destroyBean(this.nodeManager),this.started=!1,this.rootNode=null,this.rowsToDisplay=[],this.asyncTransactions=null,clearTimeout(this.asyncTransactionsTimer)}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}},rG=(e,t)=>{const n=t.childrenAfterGroup;if(n)for(let o=0,s=n.length;o<s;++o){const r=n[o];r.data&&e.push(r),r.group&&rG(e,r)}};function bEe(e){var t;(t=e.expansionSvc)==null||t.onGroupExpandedOrCollapsed()}function SEe(e,t){const n=Nl(e);n&&((!t||t==="everything")&&(t="group"),n.refreshModel({step:t,keepRenderedRows:!0,animate:!e.gos.get("suppressAnimationFrame")}))}function EEe(e){var t;return((t=Nl(e))==null?void 0:t.isEmpty())??!0}function _Ee(e,t){var n;(n=Nl(e))==null||n.forEachLeafNode(t)}function REe(e,t){var n;(n=Nl(e))==null||n.forEachNodeAfterFilter(t)}function TEe(e,t){var n;(n=Nl(e))==null||n.forEachNodeAfterFilterAndSort(t)}function DEe(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=Nl(e))==null?void 0:n.updateRowData(t)})}function IEe(e,t,n){e.frameworkOverrides.wrapIncoming(()=>{var o;return(o=Nl(e))==null?void 0:o.batchUpdateRowData(t,n)})}function xEe(e){e.frameworkOverrides.wrapIncoming(()=>{var t;return(t=Nl(e))==null?void 0:t.flushAsyncTransactions()})}function PEe(e){var t;return(t=e.selectionSvc)==null?void 0:t.getBestCostNodeSelection()}var iG={moduleName:"ClientSideRowModel",version:ut,rowModels:["clientSide"],beans:[CEe,mEe],dependsOn:[gH]},kEe={moduleName:"ClientSideRowModelApi",version:ut,apiFunctions:{onGroupExpandedOrCollapsed:bEe,refreshClientSideRowModel:SEe,isRowDataEmpty:EEe,forEachLeafNode:_Ee,forEachNodeAfterFilter:REe,forEachNodeAfterFilterAndSort:TEe,applyTransaction:DEe,applyTransactionAsync:IEe,flushAsyncTransactions:xEe,getBestCostNodeSelection:PEe,resetRowHeights:nG,onRowHeightChanged:tG},dependsOn:[rEe,iEe]},FEe=class extends je{constructor(){super(...arguments),this.beanName="gridSerializer"}wireBeans(e){this.visibleCols=e.visibleCols,this.colModel=e.colModel,this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel}serialize(e,t={}){const{allColumns:n,columnKeys:o,skipRowGroups:s,exportRowNumbers:r}=t,i=this.getColumnsToExport({allColumns:n,skipRowGroups:s,columnKeys:o,exportRowNumbers:r});return[this.prepareSession(i),this.prependContent(t),this.exportColumnGroups(t,i),this.exportHeaders(t,i),this.processPinnedTopRows(t,i),this.processRows(t,i),this.processPinnedBottomRows(t,i),this.appendContent(t)].reduce((a,l)=>l(a),e).parse()}processRow(e,t,n,o){var p;const s=t.shouldRowBeSkipped||(()=>!1),i=t.rowPositions!=null||!!t.onlySelected,a=this.gos.get("groupHideOpenParents")&&!i,l=this.colModel.isPivotMode()?o.leafGroup:!o.group,c=!!o.footer,u=o.allChildrenCount===1&&((p=o.childrenAfterGroup)==null?void 0:p.length)===1&&Oue(this.gos,o);if(!l&&!c&&(t.skipRowGroups||u||a)||t.onlySelected&&!o.isSelected()||t.skipPinnedTop&&o.rowPinned==="top"||t.skipPinnedBottom&&o.rowPinned==="bottom"||o.stub||o.level===-1&&!l&&!c||s(Ot(this.gos,{node:o})))return;const f=e.onNewBodyRow(o);if(n.forEach((g,v)=>{f.onColumn(g,v,o)}),t.getCustomContentBelowRow){const g=t.getCustomContentBelowRow(Ot(this.gos,{node:o}));g&&e.addCustomContent(g)}}appendContent(e){return t=>{const n=e.appendContent;return n&&t.addCustomContent(n),t}}prependContent(e){return t=>{const n=e.prependContent;return n&&t.addCustomContent(n),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return n=>{if(!e.skipColumnGroupHeaders){const o=new JB,{colGroupSvc:s}=this.beans,r=s?s.createColumnGroups({columns:t,idCreator:o,pinned:null,isStandaloneStructure:!0}):t;this.recursivelyAddHeaderGroups(r,n,e.processGroupHeaderCallback)}return n}}exportHeaders(e,t){return n=>{if(!e.skipColumnHeaders){const o=n.onNewHeaderRow();t.forEach((s,r)=>{o.onColumn(s,r,void 0)})}return n}}processPinnedTopRows(e,t){return n=>{var s,r;const o=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(i=>i.rowPinned==="top").sort((i,a)=>i.rowIndex-a.rowIndex).map(i=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedTopRow(i.rowIndex)}).forEach(o):(s=this.pinnedRowModel)!=null&&s.isManual()||(r=this.pinnedRowModel)==null||r.forEachPinnedRow("top",o),n}}processRows(e,t){return n=>{var c;const o=this.rowModel,s=lo(this.gos),r=Ld(this.gos),i=!s&&e.onlySelected,a=this.processRow.bind(this,n,e,t),{exportedRows:l="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(u=>u.rowPinned==null).sort((u,d)=>u.rowIndex-d.rowIndex).map(u=>o.getRow(u.rowIndex)).forEach(a);else if(this.colModel.isPivotMode())s?o.forEachPivotNode(a,!0,l==="filteredAndSorted"):r?o.forEachNodeAfterFilterAndSort(a,!0):o.forEachNode(a);else if(e.onlySelectedAllPages||i){const u=((c=this.beans.selectionSvc)==null?void 0:c.getSelectedNodes())??[];this.replicateSortedOrder(u),u.forEach(a)}else l==="all"?o.forEachNode(a):s||r?o.forEachNodeAfterFilterAndSort(a,!0):o.forEachNode(a);return n}}replicateSortedOrder(e){const{sortSvc:t,rowNodeSorter:n}=this.beans;if(!t||!n)return;const o=t.getSortOptions(),s=(r,i)=>{var a,l;return r.rowIndex!=null&&i.rowIndex!=null?r.rowIndex-i.rowIndex:r.level===i.level?((a=r.parent)==null?void 0:a.id)===((l=i.parent)==null?void 0:l.id)?n.compareRowNodes(o,{rowNode:r,currentPos:r.rowIndex??-1},{rowNode:i,currentPos:i.rowIndex??-1}):s(r.parent,i.parent):r.level>i.level?s(r.parent,i):s(r,i.parent)};e.sort(s)}processPinnedBottomRows(e,t){return n=>{var s,r;const o=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(i=>i.rowPinned==="bottom").sort((i,a)=>i.rowIndex-a.rowIndex).map(i=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedBottomRow(i.rowIndex)}).forEach(o):(s=this.pinnedRowModel)!=null&&s.isManual()||(r=this.pinnedRowModel)==null||r.forEachPinnedRow("bottom",o),n}}getColumnsToExport(e){const{allColumns:t=!1,skipRowGroups:n=!1,exportRowNumbers:o=!1,columnKeys:s}=e,{colModel:r,gos:i,visibleCols:a}=this,l=r.isPivotMode(),c=h=>Ta(h)?!1:!Da(h)||o;if(s!=null&&s.length)return r.getColsForKeys(s).filter(c);const u=i.get("treeData");let d=[];return t&&!l?d=r.getCols():d=a.allCols,d=d.filter(h=>c(h)&&(n&&!u?!m_(h):!0)),d}recursivelyAddHeaderGroups(e,t,n){const o=[];for(const s of e){const r=s;if(r.getChildren)for(const i of r.getChildren()??[])o.push(i)}e.length>0&&co(e[0])&&this.doAddHeaderHeader(t,e,n),o&&o.length>0&&this.recursivelyAddHeaderGroups(o,t,n)}doAddHeaderHeader(e,t,n){const o=e.onNewHeaderGroupingRow();let s=0;for(const r of t){const i=r;let a;n?a=n(Ot(this.gos,{columnGroup:i})):a=this.beans.colNames.getDisplayNameForColumnGroup(i,"header");const c=(i.isExpandable()?i.getLeafColumns():[]).reduce((u,d,h,f)=>{let p=An(u);return d.getColumnGroupShow()==="open"?(!p||p[1]!=null)&&(p=[h],u.push(p)):p&&p[1]==null&&(p[1]=h-1),h===f.length-1&&p&&p[1]==null&&(p[1]=h),u},[]);o.onColumn(i,a||"",s++,i.getLeafColumns().length-1,c)}}},AEe={moduleName:"SharedExport",version:ut,beans:[FEe]},aG=`\r
|
|
254
|
-
`,OEe=class extends cbe{constructor(e){super(e),this.config=e,this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:n}=e;this.suppressQuotes=t,this.columnSeparator=n}addCustomContent(e){e&&(typeof e=="string"?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,aG),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((n,o)=>{o!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(n.data.value||""),n.mergeAcross&&this.appendEmptyCells(n.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,n,o){n!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(o)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){t!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,n){t!=0&&(this.result+=this.columnSeparator);const o=this.extractRowCellValue(e,t,t,"csv",n);this.result+=this.putInQuotes(o.valueFormatted??o.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(e==null)return'""';let t;return typeof e=="string"?t=e:typeof e.toString=="function"?t=e.toString():(Je(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=aG),this.isFirstLine=!1}},MEe=class extends lbe{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.rowGroupColsSvc=e.rowGroupColsSvc,this.valueSvc=e.valueSvc}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){Je(51);return}const t=this.getMergedParams(e),n=this.getData(t),o=new Blob(["\uFEFF",n],{type:"text/plain"}),s=typeof t.fileName=="function"?t.fileName(Ot(this.gos,{})):t.fileName;ube(this.getFileName(s),o)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const n=t?Object.assign({},e):this.getMergedParams(e);return this.getData(n)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{colModel:t,colNames:n,rowGroupColsSvc:o,valueSvc:s,gos:r}=this,{processCellCallback:i,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:u,columnSeparator:d}=e;return new OEe({colModel:t,colNames:n,valueSvc:s,gos:r,processCellCallback:i||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:u||!1,columnSeparator:d||",",rowGroupColsSvc:o})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function NEe(e,t){var n;return(n=e.csvCreator)==null?void 0:n.getDataAsCsv(t)}function LEe(e,t){var n;(n=e.csvCreator)==null||n.exportDataAsCsv(t)}var VEe={moduleName:"CsvExport",version:ut,beans:[MEe],apiFunctions:{getDataAsCsv:NEe,exportDataAsCsv:LEe},dependsOn:[AEe]},BEe=class extends je{constructor(e,t,n){super(),this.id=e,this.parentCache=t,this.params=n,this.state="needsLoading",this.version=0,this.startRow=e*n.blockSize,this.endRow=this.startRow+n.blockSize}load(){this.state="loading",this.loadFromDatasource()}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed"),this.dispatchLocalEvent({type:"loadComplete"})}pageLoaded(e,t,n){this.successCommon(e,{rowData:t,rowCount:n})}isRequestMostRecentAndLive(e){const t=e===this.version,n=this.isAlive();return t&&n}successCommon(e,t){this.dispatchLocalEvent({type:"loadComplete"}),this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}postConstruct(){this.rowNodes=[];const{params:{blockSize:e,rowHeight:t},startRow:n,beans:o,rowNodes:s}=this;for(let r=0;r<e;r++){const i=n+r,a=new kl(o);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(i),a.setRowTop(t*i),s.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:n,state:o}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:n,pageStatus:o}}}setDataAndId(e,t,n){ht(t)?e.setDataAndId(t,n.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Gn(this.params.datasource.getRows)){Je(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:n,params:{sortModel:o,filterModel:s},gos:r}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,n),failCallback:this.pageLoadFailed.bind(this,n),sortModel:o,filterModel:s,context:Ot(r,{}).context}}forEachNode(e,t,n){this.rowNodes.forEach((o,s)=>{this.startRow+s<n&&e(o,t.value++)})}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.value++);const n=e-this.startRow;return this.rowNodes[n]}processServerResult(e){const{rowNodes:t,beans:n}=this;t.forEach((s,r)=>{const i=e.rowData?e.rowData[r]:void 0;!s.id&&s.alreadyRendered&&i&&(t[r]=new kl(n),t[r].setRowIndex(s.rowIndex),t[r].setRowTop(s.rowTop),t[r].setRowHeight(s.rowHeight),s.clearRowTopAndRowIndex()),this.setDataAndId(t[r],i,this.startRow+r)});const o=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,o)}destroy(){for(const e of this.rowNodes)e.clearRowTopAndRowIndex();super.destroy()}},$Ee=2,HEe=class extends je{constructor(e){super(),this.params=e,this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount}getRow(e,t=!1){const n=Math.floor(e/this.params.blockSize);let o=this.blocks[n];if(!o){if(t)return;o=this.createBlock(n)}return o.getRow(e)}createBlock(e){const t=this.params,n=this.createBean(new BEe(e,this,t));return this.blocks[n.id]=n,this.blockCount++,this.purgeBlocksIfNeeded(n),t.rowNodeBlockLoader.addBlock(n),n}refreshCache(){if(this.blockCount==0){this.purgeCache();return}for(const t of this.getBlocksInOrder())t.setStateWaitingToLoad();this.params.rowNodeBlockLoader.checkBlockToLoad()}destroy(){for(const e of this.getBlocksInOrder())this.destroyBlock(e);super.destroy()}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(Rl(this.gos,`InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(i=>i!=e),n=(i,a)=>a.lastAccessed-i.lastAccessed;t.sort(n);const o=this.params.maxBlocksInCache>0,s=o?this.params.maxBlocksInCache-1:null,r=$Ee-1;t.forEach((i,a)=>{const l=i.state==="needsLoading"&&a>=r,c=o?a>=s:!1;if(l||c){if(this.isBlockCurrentlyDisplayed(i)||this.isBlockFocused(i))return;this.removeBlockFromCache(i)}})}isBlockFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const{startRow:n,endRow:o}=e;return t.rowIndex>=n&&t.rowIndex<o}isBlockCurrentlyDisplayed(e){const{startRow:t,endRow:n}=e;return this.beans.rowRenderer.isRangeInRenderedViewport(t,n-1)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if(typeof t=="number"&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const{blockSize:n,overflowSize:o}=this.params,r=(e.id+1)*n+o;this.rowCount<r&&(this.rowCount=r)}}setRowCount(e,t){this.rowCount=e,ht(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t={value:0};for(const n of this.getBlocksInOrder())n.forEachNode(e,t,this.rowCount)}getBlocksInOrder(){const e=(n,o)=>n.id-o.id;return Object.values(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.id],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){this.isAlive()&&(this.destroyAllBlocksPastVirtualRowCount(),this.eventSvc.dispatchEvent({type:"storeUpdated"}))}destroyAllBlocksPastVirtualRowCount(){const e=[];for(const t of this.getBlocksInOrder())t.id*this.params.blockSize>=this.rowCount&&e.push(t);if(e.length>0)for(const t of e)this.destroyBlock(t)}purgeCache(){for(const e of this.getBlocksInOrder())this.removeBlockFromCache(e);this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const n=[];let o=-1,s=!1;const r={value:0};let i=!1;for(const l of this.getBlocksInOrder())if(!i){if(s&&o+1!==l.id){i=!0;continue}o=l.id,l.forEachNode(c=>{const u=c===e||c===t;(s||u)&&n.push(c),u&&(s=!s)},r,this.rowCount)}return i||s?[]:n}},GEe=class extends je{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(){return!1}postConstruct(){if(this.gos.get("rowModelType")!=="infinite")return;const e=this.beans,t=new kl(e);this.rootNode=t,t.level=-1,this.rowHeight=zc(e),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache())}start(){this.setDatasource(this.gos.get("datasource"))}destroy(){this.destroyDatasource(),super.destroy(),this.rootNode=null}destroyDatasource(){this.datasource&&(this.destroyBean(this.datasource),this.beans.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedEventListeners({filterChanged:this.reset.bind(this),sortChanged:this.reset.bind(this),newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.dispatchModelUpdatedEvent.bind(this)}),this.addManagedPropertyListener("datasource",()=>this.setDatasource(this.gos.get("datasource"))),this.addManagedPropertyListener("cacheBlockSize",()=>this.resetCache()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=zc(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){var t;let e;this.cacheParams?e=!Ep(this.cacheParams.sortModel,((t=this.beans.sortSvc)==null?void 0:t.getSortModel())??[]):e=!0,e&&this.reset()}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){var n;return((n=this.infiniteCache)==null?void 0:n.getRowNodesInRange(e,t))??[]}reset(){var n;if(!this.datasource)return;Bd(this.gos)!=null||(n=this.beans.selectionSvc)==null||n.reset("rowDataChanged"),this.resetCache()}dispatchModelUpdatedEvent(){this.eventSvc.dispatchEvent({type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1})}resetCache(){this.destroyCache();const e=this.beans,{filterManager:t,sortSvc:n,rowNodeBlockLoader:o,eventSvc:s,gos:r}=e;this.cacheParams={datasource:this.datasource,filterModel:(t==null?void 0:t.getFilterModel())??{},sortModel:(n==null?void 0:n.getSortModel())??[],rowNodeBlockLoader:o,initialRowCount:r.get("infiniteInitialRowCount"),maxBlocksInCache:r.get("maxBlocksInCache"),rowHeight:zc(e),overflowSize:r.get("cacheOverflowSize"),blockSize:r.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new HEe(this.cacheParams)),s.dispatchEventOnce({type:"rowCountReady"}),this.dispatchModelUpdatedEvent()}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)}),this.dispatchModelUpdatedEvent()}destroyCache(){this.infiniteCache=this.destroyBean(this.infiniteCache)}getRow(e){const t=this.infiniteCache;if(t&&!(e>=t.getRowCount()))return t.getRow(e)}getRowNode(e){let t;return this.forEachNode(n=>{n.id===e&&(t=n)}),t}forEachNode(e){var t;(t=this.infiniteCache)==null||t.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),n=this.getRowCount()-1;return t>n?n:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){var e;(e=this.infiniteCache)==null||e.refreshCache()}purgeCache(){var e;(e=this.infiniteCache)==null||e.purgeCache()}isLastRowIndexKnown(){var e;return((e=this.infiniteCache)==null?void 0:e.isLastRowIndexKnown())??!1}setRowCount(e,t){var n;(n=this.infiniteCache)==null||n.setRowCount(e,t)}resetRowHeights(){}onRowHeightChanged(){}};function UEe(e){var t;(t=Iw(e))==null||t.refreshCache()}function WEe(e){var t;(t=Iw(e))==null||t.purgeCache()}function zEe(e){var t;return(t=Iw(e))==null?void 0:t.getRowCount()}var jEe=class extends je{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=Mue(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=qo(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){Qr(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad()}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),this.maxConcurrentRequests!=null&&this.activeBlockLoadsCount>=this.maxConcurrentRequests){Rl(this.gos,"RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.maxConcurrentRequests!=null?this.maxConcurrentRequests-this.activeBlockLoadsCount:1,t=this.blocks.filter(n=>n.state==="needsLoading").slice(0,e);this.activeBlockLoadsCount+=t.length;for(const n of t)n.load();this.printCacheStatus()}getBlockState(){const e={};return this.blocks.forEach(t=>{const{id:n,state:o}=t.getBlockStateJson();e[n]=o}),e}printCacheStatus(){Rl(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},KEe={moduleName:"InfiniteRowModelCore",version:ut,rowModels:["infinite"],beans:[GEe,jEe]},qEe={moduleName:"InfiniteRowModel",version:ut,apiFunctions:{refreshInfiniteCache:UEe,purgeInfiniteCache:WEe,getInfiniteRowCount:zEe},dependsOn:[KEe,aEe]},YEe="↑",XEe="↓",ZEe={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},JEe=class extends Sn{constructor(){super(ZEe),this.eValue=dt,this.eDelta=dt,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const n=Math.abs(t),o=e.formatValue(n),s=ht(o)?o:n,r=t>=0,i=this.eDelta;r?i.textContent=YEe+s:i.textContent=XEe+s,i.classList.toggle("ag-value-change-delta-up",r),i.classList.toggle("ag-value-change-delta-down",!r)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),Ko(this.eDelta)}refresh(e,t=!1){var c;const{value:n,valueFormatted:o}=e,{eValue:s,lastValue:r,beans:i}=this;if(n===r||(ht(o)?s.textContent=o:ht(n)?s.textContent=n:Ko(s),(c=i.filterManager)!=null&&c.isSuppressFlashingCellsBecauseFiltering()))return!1;const a=n&&typeof n=="object"&&"toNumber"in n?n.toNumber():n,l=r&&typeof r=="object"&&"toNumber"in r?r.toNumber():r;if(a===l)return!1;if(typeof a=="number"&&typeof l=="number"){const u=a-l;this.showDelta(e,u)}return r&&s.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=n,!0}},QEe=".ag-value-slide-out{opacity:1}:where(.ag-ltr) .ag-value-slide-out{margin-right:5px;transition:opacity 3s,margin-right 3s}:where(.ag-rtl) .ag-value-slide-out{margin-left:5px;transition:opacity 3s,margin-left 3s}:where(.ag-ltr,.ag-rtl) .ag-value-slide-out{transition-timing-function:linear}.ag-value-slide-out-end{opacity:0}:where(.ag-ltr) .ag-value-slide-out-end{margin-right:10px}:where(.ag-rtl) .ag-value-slide-out-end{margin-left:10px}",e_e={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},t_e=class extends Sn{constructor(){super(e_e),this.eCurrent=dt,this.refreshCount=0,this.registerCSS(QEe)}init(e){this.refresh(e,!0)}addSlideAnimation(){var s;this.refreshCount++;const e=this.refreshCount;(s=this.ePrevious)==null||s.remove();const{beans:t,eCurrent:n}=this,o=uo({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=o,o.textContent=n.textContent,this.getGui().insertBefore(o,n),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{var r;e===this.refreshCount&&((r=this.ePrevious)==null||r.remove(),this.ePrevious=null)},3e3)})}refresh(e,t=!1){var s;let n=e.value;if(Gn(n)&&(n=""),n===this.lastValue||(s=this.beans.filterManager)!=null&&s.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=n;const o=this.eCurrent;return ht(e.valueFormatted)?o.textContent=e.valueFormatted:ht(e.value)?o.textContent=n:Ko(o),!0}},n_e=class extends je{constructor(){super(...arguments),this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(e,t,n=this.beans.gos.get("cellFlashDuration"),o=this.beans.gos.get("cellFadeDuration")){const s=this.animations[t];s.delete(e);const r=Date.now(),i=r+n,a=r+n+o,l={phase:"flash",flashEndTime:i,fadeEndTime:a};s.set(e,l);const c=`ag-cell-${t}`,u=`${c}-animation`,{comp:d,eGui:{style:h}}=e;d.toggleCss(c,!0),d.toggleCss(u,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&i+15<this.nextAnimationTime&&(clearTimeout(this.nextAnimationCycle),this.nextAnimationCycle=null,this.nextAnimationTime=null),this.nextAnimationCycle||(this.beans.frameworkOverrides.wrapIncoming(()=>{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),n)}),this.nextAnimationTime=i)}advanceAnimations(){const e=Date.now();let t=null;for(const n of Object.keys(this.animations)){const o=this.animations[n],s=`ag-cell-${n}`,r=`${s}-animation`;for(const[i,a]of o){if(!i.isAlive()||!i.comp){o.delete(i);continue}const{phase:l,flashEndTime:c,fadeEndTime:u}=a,d=l==="flash"?c:u;if(!(e+15>=d)){t=Math.min(d,t??1/0);continue}const{comp:f,eGui:{style:p}}=i;switch(l){case"flash":f.toggleCss(s,!1),f.toggleCss(r,!0),p.transition=`background-color ${u-c}ms`,p.transitionDelay=`${c-e}ms`,t=Math.min(u,t??1/0),a.phase="fade";break;case"fade":f.toggleCss(s,!1),f.toggleCss(r,!1),p.removeProperty("transition"),p.removeProperty("transition-delay"),o.delete(i);break}}}t==null?(this.nextAnimationTime=null,this.nextAnimationCycle=null):t&&(this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),t-e),this.nextAnimationTime=t)}onFlashCells(e,t){if(!e.comp)return;const n=tme(e.cellPosition);t.cells[n]&&this.animateCell(e,"highlight")}flashCell(e,t){this.animateCell(e,"data-changed",t==null?void 0:t.flashDuration,t==null?void 0:t.fadeDuration)}destroy(){for(const e of Object.keys(this.animations))this.animations[e].clear()}};function o_e(e,t={}){const{cellFlashSvc:n}=e;n&&e.frameworkOverrides.wrapIncoming(()=>{for(const o of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))n.flashCell(o,t)})}var s_e={moduleName:"HighlightChanges",version:ut,beans:[n_e],userComponents:{agAnimateShowChangeCellRenderer:JEe,agAnimateSlideCellRenderer:t_e},apiFunctions:{flashCells:o_e}};function r_e(e){var t;return((t=e.stateSvc)==null?void 0:t.getState())??{}}function i_e(e,t,n){var o;return(o=e.stateSvc)==null?void 0:o.setState(t,n)}function lG(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=a_e(e)),e.version=ut,e}function a_e(e){return e.cellSelection=l_e(e,"rangeSelection"),e}function l_e(e,t){if(e&&typeof e=="object")return e[t]}var c_e=class extends je{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=qo(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=qo(this,()=>{this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(this.updateCachedState("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowGroupExpansion",void 0)):(this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("ssrmRowGroupExpansion",void 0))},0),this.onRowSelectedDebounced=qo(this,()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}postConstruct(){const{gos:e,ctrlsSvc:t,colDelayRenderSvc:n}=this.beans;this.isClientSideRowModel=lo(e);const o=lG(e.get("initialState")??{}),s=o.partialColumnState;delete o.partialColumnState,this.cachedState=o;const r=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>r(()=>this.setupStateOnGridReady(o))),(o.columnOrder||o.columnVisibility||o.columnSizing||o.columnPinning||o.columnGroup)&&(n==null||n.hideColumns("columnState"));const[i,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:c})=>{c==="gridInitializing"&&(i(),r(()=>{this.setupStateOnColumnsInitialised(o,!!s),n==null||n.revealColumns("columnState")}))},rowCountReady:()=>{a==null||a(),r(()=>this.setupStateOnRowCountReady(o))},firstDataRendered:()=>{l==null||l(),r(()=>this.setupStateOnFirstDataRendered(o))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const n=lG(e);delete n.partialColumnState,this.cachedState=n,this.startSuppressEvents();const o="api",s=t?new Set(t):void 0;this.setGridReadyState(n,o,s),this.setColumnsInitialisedState(n,o,!!s,s),this.setRowCountState(n,o,s),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(n,o,s),this.stopSuppressEvents(o)})}setGridReadyState(e,t,n){var o,s;t==="api"&&!(n!=null&&n.has("sideBar"))&&((s=(o=this.beans.sideBar)==null?void 0:o.comp)==null||s.setState(e.sideBar)),this.updateCachedState("sideBar",this.getSideBarState())}setupStateOnGridReady(e){this.setGridReadyState(e,"gridInitializing");const t=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:t,sideBarUpdated:t})}updateColumnAndGroupState(){this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState())}setColumnsInitialisedState(e,t,n,o){this.setColumnState(e,t,n,o),this.setColumnGroupState(e,t,o),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const n=o=>()=>this.updateColumnState([o]);this.addManagedEventListeners({columnValueChanged:n("aggregation"),columnMoved:n("columnOrder"),columnPinned:n("columnPinning"),columnResized:n("columnSizing"),columnVisible:n("columnVisibility"),columnPivotChanged:n("pivot"),columnPivotModeChanged:n("pivot"),columnRowGroupChanged:n("rowGroup"),sortChanged:n("sort"),newColumnsLoaded:this.updateColumnAndGroupState.bind(this),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setRowCountState(e,t,n){const{filter:o,rowGroupExpansion:s,ssrmRowGroupExpansion:r,rowSelection:i,pagination:a}=e,l=(u,d)=>!(n!=null&&n.has(u))&&(d||t==="api");l("filter",o)&&this.setFilterState(o),l("rowGroupExpansion",s)&&this.setRowGroupExpansionState(r,s,t),l("rowSelection",i)&&this.setRowSelectionState(i,t),l("pagination",a)&&this.setPaginationState(a,t);const c=this.updateCachedState.bind(this);c("filter",this.getFilterState()),this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(c("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),c("rowGroupExpansion",void 0)):(c("rowGroupExpansion",this.getRowGroupExpansionState()),c("ssrmRowGroupExpansion",void 0)),c("rowSelection",this.getRowSelectionState()),c("pagination",this.getPaginationState())}setupStateOnRowCountReady(e){this.setRowCountState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>{this.updateRowGroupExpansionStateTimer=0,this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(t("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),t("rowGroupExpansion",void 0)):(t("rowGroupExpansion",this.getRowGroupExpansionState()),t("ssrmRowGroupExpansion",void 0))},o=()=>t("filter",this.getFilterState()),{gos:s,colFilter:r}=this.beans;this.addManagedEventListeners({filterChanged:o,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:n,columnRowGroupChanged:n,rowDataUpdated:()=>{(s.get("groupDefaultExpanded")!==0||s.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(n)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:i=>{(i.newPage||i.newPageSize)&&t("pagination",this.getPaginationState())}}),r&&this.addManagedListeners(r,{filterStateChanged:o})}setFirstDataRenderedState(e,t,n){const{scroll:o,cellSelection:s,focusedCell:r,columnOrder:i,rowPinning:a}=e,l=(d,h)=>!(n!=null&&n.has(d))&&(h||t==="api");l("focusedCell",r)&&this.setFocusedCellState(r),l("cellSelection",s)&&this.setCellSelectionState(s),l("scroll",o)&&this.setScrollState(o),l("rowPinning",a)&&this.setRowPinningState(a),this.setColumnPivotState(!!(i!=null&&i.orderedColIds),t);const c=this.updateCachedState.bind(this);c("sideBar",this.getSideBarState()),c("focusedCell",this.getFocusedCellState());const u=this.getRangeSelectionState();c("rangeSelection",u),c("cellSelection",u),c("scroll",this.getScrollState())}setupStateOnFirstDataRendered(e){this.setFirstDataRenderedState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>t("focusedCell",this.getFocusedCellState());this.addManagedEventListeners({cellFocused:n,cellFocusCleared:n,cellSelectionChanged:o=>{if(o.finished){const s=this.getRangeSelectionState();t("rangeSelection",s),t("cellSelection",s)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return rbe(Zy(e),e.colModel.isPivotMode())}setColumnState(e,t,n,o){const{sort:s,rowGroup:r,aggregation:i,pivot:a,columnPinning:l,columnVisibility:c,columnSizing:u,columnOrder:d}=e;let h=!1;const f=(I,x)=>{const O=!(o!=null&&o.has(I))&&!!(x||t==="api");return h||(h=O),O},p={},g=I=>{let x=p[I];return x||(x={colId:I},p[I]=x,x)},v={},C=f("sort",s);C&&(s==null||s.sortModel.forEach(({colId:I,sort:x},O)=>{const N=g(I);N.sort=x,N.sortIndex=O})),(C||!n)&&(v.sort=null,v.sortIndex=null);const S=f("rowGroup",r);S&&(r==null||r.groupColIds.forEach((I,x)=>{const O=g(I);O.rowGroup=!0,O.rowGroupIndex=x})),(S||!n)&&(v.rowGroup=null,v.rowGroupIndex=null);const b=f("aggregation",i);b&&(i==null||i.aggregationModel.forEach(({colId:I,aggFunc:x})=>{g(I).aggFunc=x})),(b||!n)&&(v.aggFunc=null);const y=f("pivot",a);y&&(a==null||a.pivotColIds.forEach((I,x)=>{const O=g(I);O.pivot=!0,O.pivotIndex=x}),this.gos.updateGridOptions({options:{pivotMode:!!(a!=null&&a.pivotMode)},source:t})),(y||!n)&&(v.pivot=null,v.pivotIndex=null);const _=f("columnPinning",l);if(_){for(const I of(l==null?void 0:l.leftColIds)??[])g(I).pinned="left";for(const I of(l==null?void 0:l.rightColIds)??[])g(I).pinned="right"}(_||!n)&&(v.pinned=null);const E=f("columnVisibility",c);if(E)for(const I of(c==null?void 0:c.hiddenColIds)??[])g(I).hide=!0;(E||!n)&&(v.hide=null);const D=f("columnSizing",u);if(D)for(const{colId:I,flex:x,width:O}of(u==null?void 0:u.columnSizingModel)??[]){const N=g(I);N.flex=x??null,N.width=O}(D||!n)&&(v.flex=null);const T=d==null?void 0:d.orderedColIds,P=!!(T!=null&&T.length)&&!(o!=null&&o.has("columnOrder")),L=P?T.map(I=>g(I)):Object.values(p);(L.length||h)&&(this.columnStates=L,ei(this.beans,{state:L,applyOrder:P,defaultState:v},t))}setColumnPivotState(e,t){const n=this.columnStates;this.columnStates=void 0;const o=this.columnGroupStates;this.columnGroupStates=void 0;const s=this.beans,{pivotResultCols:r,colGroupSvc:i}=s;if(r!=null&&r.isPivotResultColsPresent()){if(n){const a=[];for(const l of n)r.getPivotResultCol(l.colId)&&a.push(l);ei(s,{state:a,applyOrder:e},t)}o&&(i==null||i.setColumnGroupState(o,t))}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return ibe(t)}setColumnGroupState(e,t,n){var a;const o=this.beans.colGroupSvc;if(!o||n!=null&&n.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const s=new Set((a=e.columnGroup)==null?void 0:a.openColumnGroupIds),i=o.getColumnGroupState().map(({groupId:l})=>{const c=s.has(l);return c&&s.delete(l),{groupId:l,open:c}});for(const l of s)i.push({groupId:l,open:!0});i.length&&(this.columnGroupStates=i),o.setColumnGroupState(i,t)}getFilterState(){const e=this.beans.filterManager;let t=e==null?void 0:e.getFilterModel();t&&Object.keys(t).length===0&&(t=void 0);const n=e==null?void 0:e.getFilterState(),o=(e==null?void 0:e.getAdvFilterModel())??void 0;return t||o||n?{filterModel:t,columnFilterState:n,advancedFilterModel:o}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:n,columnFilterState:o,advancedFilterModel:s}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(n!==void 0||o!==void 0)&&(t==null||t.setFilterState(n??null,o??null,"columnFilter")),s!==void 0&&(t==null||t.setAdvFilterModel(s??null,"advancedFilter"))}getRangeSelectionState(){var t;const e=(t=this.beans.rangeSvc)==null?void 0:t.getCellRanges().map(n=>{const{id:o,type:s,startRow:r,endRow:i,columns:a,startColumn:l}=n;return{id:o,type:s,startRow:r,endRow:i,colIds:a.map(c=>c.getColId()),startColId:l.getColId()}});return e!=null&&e.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeSvc:n,colModel:o,visibleCols:s}=this.beans;if(!_a(t)||!n)return;const r=[];for(const i of(e==null?void 0:e.cellRanges)??[]){const a=[];for(const c of i.colIds){const u=o.getCol(c);u&&a.push(u)}if(!a.length)continue;let l=o.getCol(i.startColId);if(!l){const c=s.allCols,u=new Set(a);l=c.find(d=>u.has(d))}r.push({...i,columns:a,startColumn:l})}n.setCellRanges(r)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.beans.ctrlsSvc.getScrollFeature(),{left:t}=(e==null?void 0:e.getHScrollPosition())??{left:0},{top:n}=(e==null?void 0:e.getVScrollPosition())??{top:0};return n||t?{top:n,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:n}=e??{top:0,left:0},{frameworkOverrides:o,rowRenderer:s,animationFrameSvc:r,ctrlsSvc:i}=this.beans;o.wrapIncoming(()=>{var a;i.get("center").setCenterViewportScrollLeft(n),(a=i.getScrollFeature())==null||a.setVerticalScrollPosition(t),s.redraw({afterScroll:!0}),r==null||r.flushAllFrames()})}getSideBarState(){var e,t;return(t=(e=this.beans.sideBar)==null?void 0:e.comp)==null?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.beans.focusSvc.getFocusedCell();if(e){const{column:t,rowIndex:n,rowPinned:o}=e;return{colId:t.getColId(),rowIndex:n,rowPinned:o}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:n}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:o,rowIndex:s,rowPinned:r}=e;t.setFocusedCell({column:n.getCol(o),rowIndex:s,rowPinned:r,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const n=e.getCurrentPage(),o=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!n&&!o))return{page:n,pageSize:o}}setPaginationState(e,t){const{pagination:n,gos:o}=this.beans;if(!n)return;const{pageSize:s,page:r}=e??{page:0,pageSize:o.get("paginationPageSize")},i=t==="gridInitializing";s&&!o.get("paginationAutoPageSize")&&n.setPageSize(s,i?"initialState":"pageSizeSelector"),typeof r=="number"&&(i?n.setPage(r):n.goToPage(r))}getRowSelectionState(){var o;const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!((o=t==null?void 0:t.toggledNodes)!=null&&o.length)?void 0:t}setRowSelectionState(e,t){var n;(n=this.beans.selectionSvc)==null||n.setSelectionState(e,t,t==="api")}getRowGroupExpansionState(){const{expansionSvc:e}=this.beans;if(e)return e.getExpansionState()}getRowPinningState(){var e;return(e=this.beans.pinnedRowModel)==null?void 0:e.getPinnedState()}setRowPinningState(e){const t=this.beans.pinnedRowModel;e?t==null||t.setPinnedState(e):t==null||t.reset()}setRowGroupExpansionState(e,t,n){const o=this.beans.expansionSvc;if(!o)return;const s=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};o.setExpansionState(s,n)}updateColumnState(e){const t=this.getColumnState();let n=!1;const o=this.cachedState;for(const s of Object.keys(t)){const r=t[s];Ep(r,o[s])||(n=!0)}this.cachedState={...o,...t},n&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const n=this.cachedState[e];this.setCachedStateValue(e,t),Ep(t,n)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState={...this.cachedState,[e]:t}}refreshStaleState(){const e=this.staleStateKeys;for(const t of e)t==="rowSelection"&&this.setCachedStateValue(t,this.getRowSelectionState());e.clear()}dispatchStateUpdateEvent(e){if(!this.suppressEvents){for(const t of e)this.queuedUpdateSources.add(t);this.dispatchStateUpdateEventDebounced()}}dispatchQueuedStateUpdateEvents(){const e=this.queuedUpdateSources,t=Array.from(e);e.clear(),this.eventSvc.dispatchEvent({type:"stateUpdated",sources:t,state:this.cachedState})}startSuppressEvents(){var e;this.suppressEvents=!0,(e=this.beans.colAnimation)==null||e.setSuppressAnimation(!0)}stopSuppressEvents(e){setTimeout(()=>{var t;this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&((t=this.beans.colAnimation)==null||t.setSuppressAnimation(!1),this.dispatchStateUpdateEvent([e]))})}suppressEventsAndDispatchInitEvent(e){this.startSuppressEvents(),e(),this.stopSuppressEvents("gridInitializing")}},u_e={moduleName:"GridState",version:ut,beans:[c_e],apiFunctions:{getState:r_e,setState:i_e}};function d_e(e){return e.rowModel.isLastRowIndexKnown()}function h_e(e){var t;return((t=e.pagination)==null?void 0:t.getPageSize())??100}function f_e(e){var t;return((t=e.pagination)==null?void 0:t.getCurrentPage())??0}function p_e(e){var t;return((t=e.pagination)==null?void 0:t.getTotalPages())??1}function g_e(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function m_e(e){var t;(t=e.pagination)==null||t.goToNextPage()}function v_e(e){var t;(t=e.pagination)==null||t.goToPreviousPage()}function y_e(e){var t;(t=e.pagination)==null||t.goToFirstPage()}function w_e(e){var t;(t=e.pagination)==null||t.goToLastPage()}function C_e(e,t){var n;(n=e.pagination)==null||n.goToPage(t)}var b_e=class extends je{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeSvc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.centerRowsCtrl=e.center;const t=this.checkPageSize.bind(this);this.addManagedEventListeners({bodyHeightChanged:t,scrollVisibilityChanged:t}),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||this.centerRowsCtrl==null}onPaginationAutoSizeChanged(){this.notActive()?this.beans.pagination.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.viewportSizeFeature.getBodyHeight();if(e>0){const t=this.beans,n=()=>{const o=Math.max(zc(t),1),s=Math.floor(e/o);t.pagination.setPageSize(s,"autoCalculated")};this.isBodyRendered?qo(this,n,50)():(n(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},rg="paginationPageSizeSelector",S_e={tag:"span",cls:"ag-paging-page-size"},E_e=class extends Sn{constructor(){super(S_e),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.pagination.getPageSize()||(this.pagination.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}wireBeans(e){this.pagination=e.pagination}postConstruct(){this.addManagedPropertyListener(rg,()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedEventListeners({paginationChanged:e=>this.handlePaginationChanged(e)})}handlePaginationChanged(e){if(!this.selectPageSizeComp||!(e!=null&&e.newPageSize))return;const t=this.pagination.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&!e&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp)}reset(){Ko(this.getGui()),this.selectPageSizeComp&&(this.selectPageSizeComp=this.destroyBean(this.selectPageSizeComp))}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel")&&!this.gos.get("paginationAutoPageSize")&&this.gos.get(rg)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),n=!t||!e.includes(t);if(n){const s=this.gos.exists("paginationPageSize"),r=this.gos.get(rg)!==!0;Je(94,{pageSizeSet:s,pageSizesSet:r,pageSizeOptions:e,paginationPageSizeOption:t}),r||Je(95,{paginationPageSizeOption:t,paginationPageSizeSelector:rg}),e.unshift("")}const o=String(n?"":t);this.selectPageSizeComp?(Il(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(o,!0)):this.createPageSizeSelectorComp(e,o),this.hasEmptyOption=n}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const n=this.getLocaleTextFunc(),o=n("pageSizeSelectorLabel","Page Size:"),s=n("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new V_).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(s).setLabel(o).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(rg);return!Array.isArray(t)||!(t!=null&&t.length)?e:[...t].sort((n,o)=>n-o)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},__e={selector:"AG-PAGE-SIZE-SELECTOR",component:E_e},R_e=".ag-paging-panel{align-items:center;border-top:var(--ag-footer-row-border);display:flex;gap:calc(var(--ag-spacing)*4);height:var(--ag-pagination-panel-height);justify-content:flex-end;padding:0 var(--ag-cell-horizontal-padding)}:where(.ag-paging-page-size) .ag-wrapper{min-width:50px}.ag-paging-page-summary-panel{align-items:center;display:flex;gap:var(--ag-cell-widget-spacing);.ag-disabled &{pointer-events:none}}.ag-paging-button{cursor:pointer;position:relative;&.ag-disabled{cursor:default;opacity:.5}}.ag-paging-number,.ag-paging-row-summary-panel-number{font-weight:500}",T_e=class extends w${constructor(){super(),this.btFirst=dt,this.btPrevious=dt,this.btNext=dt,this.btLast=dt,this.lbRecordCount=dt,this.lbFirstRowOnPage=dt,this.lbLastRowOnPage=dt,this.lbCurrent=dt,this.lbTotal=dt,this.pageSizeComp=dt,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(R_e)}wireBeans(e){this.rowModel=e.rowModel,this.pagination=e.pagination,this.ariaAnnounce=e.ariaAnnounce}postConstruct(){const e=this.gos.get("enableRtl");this.setTemplate(this.getTemplate(),[__e]);const{btFirst:t,btPrevious:n,btNext:o,btLast:s}=this;this.activateTabIndex([t,n,o,s]),t.insertAdjacentElement("afterbegin",xr(e?"last":"first",this.beans)),n.insertAdjacentElement("afterbegin",xr(e?"next":"previous",this.beans)),o.insertAdjacentElement("afterbegin",xr(e?"previous":"next",this.beans)),s.insertAdjacentElement("afterbegin",xr(e?"first":"last",this.beans)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],()=>this.onPageSizeRelatedOptionsChange()),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:r=>this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(r):bpe(this.beans,r),forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}onPaginationChanged(){const t=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(t),t&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){if(!this.areListenersSetup){this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)});for(const e of[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}]){const{el:t,fn:n}=e;this.addManagedListeners(t,{click:n,keydown:o=>{(o.key===Le.ENTER||o.key===Le.SPACE)&&(o.preventDefault(),n())}})}Cpe(this.beans,this,this.getGui()),this.areListenersSetup=!0}}onBtFirst(){this.previousAndFirstButtonsDisabled||this.pagination.goToFirstPage()}formatNumber(e){const t=this.gos.getCallback("paginationNumberFormatter");return t?t({value:e}):abe(e,this.getLocaleTextFunc.bind(this))}getTemplate(){const e=this.getLocaleTextFunc(),t=`ag-${this.getCompId()}`;return{tag:"div",cls:"ag-paging-panel ag-unselectable",attrs:{id:`${t}`},children:[{tag:"ag-page-size-selector",ref:"pageSizeComp"},{tag:"span",cls:"ag-paging-row-summary-panel",children:[{tag:"span",ref:"lbFirstRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-first-row`}},{tag:"span",attrs:{id:`${t}-to`},children:e("to","to")},{tag:"span",ref:"lbLastRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-last-row`}},{tag:"span",attrs:{id:`${t}-of`},children:e("of","of")},{tag:"span",ref:"lbRecordCount",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-row-count`}}]},{tag:"span",cls:"ag-paging-page-summary-panel",role:"presentation",children:[{tag:"div",ref:"btFirst",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("firstPage","First Page")}},{tag:"div",ref:"btPrevious",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("previousPage","Previous Page")}},{tag:"span",cls:"ag-paging-description",children:[{tag:"span",attrs:{id:`${t}-start-page`},children:e("page","Page")},{tag:"span",ref:"lbCurrent",cls:"ag-paging-number",attrs:{id:`${t}-start-page-number`}},{tag:"span",attrs:{id:`${t}-of-page`},children:e("of","of")},{tag:"span",ref:"lbTotal",cls:"ag-paging-number",attrs:{id:`${t}-of-page-number`}}]},{tag:"div",ref:"btNext",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("nextPage","Next Page")}},{tag:"div",ref:"btLast",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("lastPage","Last Page")}}]}]}}onBtNext(){this.nextButtonDisabled||this.pagination.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.pagination.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.pagination.goToLastPage()}enableOrDisableButtons(){const e=this.pagination.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),n=this.pagination.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const o=this.isZeroPagesToDisplay(),s=e===n-1;this.nextButtonDisabled=s||o,this.lastButtonDisabled=!t||o||e===n-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){Nce(e,t),e.classList.toggle("ag-disabled",t)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages();return e&&t===0}updateLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages(),n=this.pagination.getMasterRowCount(),o=e?n:null,s=this.pagination.getCurrentPage(),r=this.pagination.getPageSize();let i,a;this.isZeroPagesToDisplay()?i=a=0:(i=r*s+1,a=i+r-1,e&&a>o&&(a=o));const l=i+r-1,c=!e&&n<l,u=this.formatNumber(i);this.lbFirstRowOnPage.textContent=u;let d;const h=this.getLocaleTextFunc();c?d=h("pageLastRowUnknown","?"):d=this.formatNumber(a),this.lbLastRowOnPage.textContent=d;const p=t>0?s+1:0,g=this.formatNumber(p);this.lbCurrent.textContent=g;let v,C;if(e)v=this.formatNumber(t),C=this.formatNumber(o);else{const S=h("more","more");v=S,C=S}this.lbTotal.textContent=v,this.lbRecordCount.textContent=C,this.announceAriaStatus(u,d,C,g,v)}announceAriaStatus(e,t,n,o,s){var d,h;const r=this.getLocaleTextFunc(),i=r("page","Page"),a=r("to","to"),l=r("of","of"),c=`${e} ${a} ${t} ${l} ${n}`,u=`${i} ${o} ${l} ${s}`;c!==this.ariaRowStatus&&(this.ariaRowStatus=c,(d=this.ariaAnnounce)==null||d.announceValue(c,"paginationRow")),u!==this.ariaPageStatus&&(this.ariaPageStatus=u,(h=this.ariaAnnounce)==null||h.announceValue(u,"paginationPage"))}},D_e={selector:"AG-PAGINATION",component:T_e},I_e=class extends je{constructor(){super(...arguments),this.beanName="pagination",this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.masterRowCount=0}postConstruct(){const e=this.gos;this.active=e.get("pagination"),this.pageSizeFromGridOptions=e.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this))}getPaginationSelector(){return D_e}isPaginateChildRows(){const e=this.gos;return e.get("groupHideParentOfSingleChild")||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")?!0:e.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){const t=this.currentPage;if(!this.active||t===e||typeof t!="number")return;const{editSvc:n}=this.beans;n!=null&&n.isEditing()&&(n.isBatchEditing()?n.cleanupEditors():n.stopEditing(void 0,{source:"api"})),this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0})}goToPageWithIndex(e){var n,o;if(!this.active)return;let t=e;this.paginateChildRows||(t=((o=(n=this.beans.rowModel).getTopLevelIndexFromDisplayedIndex)==null?void 0:o.call(n,e))??e),this.goToPage(Math.floor(t/this.pageSize))}isRowInPage(e){return this.active?e>=this.topDisplayedRowIndex&&e<=this.bottomDisplayedRowIndex:!0}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.beans.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return ht(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:ht(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:ht(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:ht(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.beans.pageBounds.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(this.pageSizeAutoCalculated===void 0)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const n=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,this.currentPage!==0&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,this.currentPage!==0&&this.goToFirstPage();break}n!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){const e=this.totalPages;this.currentPage>=e&&(this.currentPage=e-1);const t=this.currentPage;(!isFinite(t)||isNaN(t)||t<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){const e=this.beans.rowModel,t=e.getTopLevelRowCount();if(this.masterRowCount=t,t<=0){this.setZeroRows();return}const n=this.pageSize,o=t-1;this.totalPages=Math.floor(o/n)+1,this.adjustCurrentPageIfInvalid();const s=this.currentPage,r=n*s;let i=n*(s+1)-1;if(i>o&&(i=o),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(r),i===o)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=a-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){const e=this.beans.rowModel.getRowCount();if(this.masterRowCount=e,e===0){this.setZeroRows();return}const{pageSize:t,currentPage:n}=this,o=e-1;this.totalPages=Math.floor(o/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*n,this.bottomDisplayedRowIndex=t*(n+1)-1,this.bottomDisplayedRowIndex>o&&(this.bottomDisplayedRowIndex=o)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.beans.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:n=!1,newPageSize:o=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:n,newPageSize:o,keepRenderedRows:t})}},x_e={moduleName:"Pagination",version:ut,beans:[I_e,b_e],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:d_e,paginationGetPageSize:h_e,paginationGetCurrentPage:f_e,paginationGetTotalPages:p_e,paginationGetRowCount:g_e,paginationGoToNextPage:m_e,paginationGoToPreviousPage:v_e,paginationGoToFirstPage:y_e,paginationGoToLastPage:w_e,paginationGoToPage:C_e},dependsOn:[xw]};function P_e(e,t={}){const n=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(n))}function cG(e,t,n,o,s){t&&(o&&t.parent&&t.parent.level!==-1&&cG(e,t.parent,n,o,s),t.setExpanded(n,void 0,s))}function k_e(e,t){return e.rowModel.getRowNode(t)}function F_e(e,t,n,o){e.rowRenderer.addRenderedRowListener(t,n,o)}function A_e(e){return e.rowRenderer.getRenderedNodes()}function O_e(e,t,n){e.rowModel.forEachNode(t,n)}function M_e(e){return e.rowRenderer.firstRenderedRow}function N_e(e){return e.rowRenderer.lastRenderedRow}function L_e(e,t){return e.rowModel.getRow(t)}function V_e(e){return e.rowModel.getRowCount()}var B_e={moduleName:"RowApi",version:ut,apiFunctions:{redrawRows:P_e,setRowNodeExpanded:cG,getRowNode:k_e,addRenderedRowListener:F_e,getRenderedNodes:A_e,forEachNode:O_e,getFirstDisplayedRowIndex:M_e,getLastDisplayedRowIndex:N_e,getDisplayedRowAtIndex:L_e,getDisplayedRowCount:V_e}},$_e={moduleName:"ScrollApi",version:ut,apiFunctions:{getVerticalPixelRange:QSe,getHorizontalPixelRange:e0e,ensureColumnVisible:WH,ensureIndexVisible:zH,ensureNodeVisible:t0e}};function H_e(e,t,n){if(!t)return;const o=e.ctrlsSvc.getGridBodyCtrl().eGridBody,s=`aria-${t}`;n===null?o.removeAttribute(s):o.setAttribute(s,n)}function G_e(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function U_e(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function W_e(e){var t;return((t=e.animationFrameSvc)==null?void 0:t.isQueueEmpty())??!0}function z_e(e){var t;(t=e.animationFrameSvc)==null||t.flushAllFrames()}function j_e(e){return{rowHeight:zc(e),headerHeight:jp(e)}}function K_e(e,t={}){var r;const n=[];for(const i of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const a=i.getCellRenderer();a!=null&&n.push(Up(a))}if((r=t.columns)!=null&&r.length)return n;const o=[],s=MR(t.rowNodes);for(const i of e.rowRenderer.getAllRowCtrls()){if(s&&!NR(i.rowNode,s)||!i.isFullWidth())continue;const a=i.getFullWidthCellRenderers();for(let l=0;l<a.length;l++){const c=a[l];c!=null&&o.push(Up(c))}}return[...o,...n]}var q_e={moduleName:"RenderApi",version:ut,apiFunctions:{setGridAriaProperty:H_e,refreshCells:G_e,refreshHeader:U_e,isAnimationFrameQueueEmpty:W_e,flushAllAnimationFrames:z_e,getSizesForCurrentTheme:j_e,getCellRendererInstances:K_e}};function Y_e(e,t){var n,o;typeof t=="number"?(n=e.colAutosize)==null||n.sizeColumnsToFit(t,"api"):(o=e.colAutosize)==null||o.sizeColumnsToFitGridBody(t)}function uG({colAutosize:e,visibleCols:t},n,o){Array.isArray(n)?e==null||e.autoSizeCols({colKeys:n,skipHeader:o,source:"api"}):e==null||e.autoSizeCols({...n,colKeys:n.colIds??t.allCols,source:"api"})}function X_e(e,t){var n;t&&typeof t=="object"?uG(e,t):(n=e.colAutosize)==null||n.autoSizeAllColumns({source:"api",skipHeader:t})}var Z_e=class extends je{constructor(){super(...arguments),this.beanName="colAutosize",this.timesDelayed=0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}postConstruct(){var n;const{gos:e}=this,t=e.get("autoSizeStrategy");if(t){let o=!1;const s=t.type;if(s==="fitGridWidth"||s==="fitProvidedWidth")o=!0;else if(s==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const r=e.get("rowData");o=r!=null&&r.length>0&&lo(e)}o&&((n=this.beans.colDelayRenderSvc)==null||n.hideColumns(s))}}autoSizeCols(e){const{eventSvc:t,visibleCols:n}=this.beans;this.innerAutoSizeCols(e).then(o=>{var c;const s=u=>Gd(t,Array.from(u),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return s(o);const r=dG(this.beans),i=u=>n.leftCols.some(d=>$p(d,u)),a=u=>n.rightCols.some(d=>$p(d,u)),l=e.colKeys.filter(u=>!Ta(u)&&!Da(u)&&!i(u)&&!a(u));this.sizeColumnsToFit(r,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:(c=e.columnLimits)==null?void 0:c.map(u=>({...u,key:u.colId})),colKeys:l,onlyScaleUp:!0}),s(o)})}innerAutoSizeCols(e){return new Promise((t,n)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,n));const{colKeys:o,skipHeader:s,skipHeaderGroups:r,stopAtGroup:i,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:c=[],source:u="api"}=e,{animationFrameSvc:d,renderStatus:h,colModel:f,autoWidthCalc:p,visibleCols:g}=this.beans;if(d==null||d.flushAllFrames(),this.timesDelayed<5&&h&&(!h.areHeaderCellsRendered()||!h.areCellsRendered())){this.timesDelayed++,setTimeout(()=>{this.isAlive()&&this.innerAutoSizeCols(e).then(t,n)});return}this.timesDelayed=0;const v=new Set;let C=-1;const S=Object.fromEntries(c.map(({colId:_,...E})=>[_,E])),b=s??this.gos.get("skipHeaderOnAutoSize"),y=r??b;for(;C!==0;){C=0;const _=[];for(const E of o){if(!E||que(E))continue;const D=f.getCol(E);if(!D||v.has(D))continue;const T=p.getPreferredWidthForColumn(D,b);if(T>0){const P=S[D.colId]??{};P.minWidth??(P.minWidth=l),P.maxWidth??(P.maxWidth=a);const L=J_e(D,T,P);D.setActualWidth(L,u),v.add(D),C++}_.push(D)}_.length&&g.refresh(u)}y||this.autoSizeColumnGroupsByColumns(o,u,i),t(v)})}autoSizeColumn(e,t,n){this.autoSizeCols({colKeys:[e],skipHeader:n,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,n){const{colModel:o,ctrlsSvc:s}=this.beans,r=new Set,i=o.getColsForKeys(e);for(const l of i){let c=l.getParent();for(;c&&c!=n;)c.isPadding()||r.add(c),c=c.getParent()}let a;for(const l of r){for(const c of s.getHeaderRowContainerCtrls())if(a=c.getHeaderCtrlForColumn(l),a)break;a==null||a.resizeLeafColumnsToFit(t)}}autoSizeAllColumns(e){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.autoSizeAllColumns(e));return}this.autoSizeCols({colKeys:this.beans.visibleCols.allCols,...e})}addColumnAutosizeListeners(e,t){const n=this.gos.get("skipHeaderOnAutoSize"),o=()=>{this.autoSizeColumn(t,"uiColumnResized",n)};e.addEventListener("dblclick",o);const s=new tu(e);return s.addEventListener("doubleTap",o),()=>{e.removeEventListener("dblclick",o),s.destroy()}}addColumnGroupResize(e,t,n){const o=this.gos.get("skipHeaderOnAutoSize"),s=()=>{const r=[],i=t.getDisplayedLeafColumns();for(const a of i)a.getColDef().suppressAutoSize||r.push(a.getColId());r.length>0&&this.autoSizeCols({colKeys:r,skipHeader:o,stopAtGroup:t,source:"uiColumnResized"}),n()};return e.addEventListener("dblclick",s),()=>e.removeEventListener("dblclick",s)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const n=dG(this.beans);if(n>0){this.sizeColumnsToFit(n,"sizeColumnsToFit",!1,e);return}t===void 0?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,100)},0):t===100?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,500)},100):t===500?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,-1)},500):Je(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",n,o){var p,g;if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,n,o));return}const s={};for(const{key:v,...C}of(o==null?void 0:o.columnLimits)??[])s[typeof v=="string"?v:v.getColId()]=C;const r=this.beans.visibleCols.allCols;if(e<=0||!r.length)return;const i=Ra(r);if(o!=null&&o.onlyScaleUp&&i>e||e===i&&r.every(C=>{if(C.colDef.suppressSizeToFit)return!0;const S=s==null?void 0:s[C.getId()],b=(S==null?void 0:S.minWidth)??(o==null?void 0:o.defaultMinWidth),y=(S==null?void 0:S.maxWidth)??(o==null?void 0:o.defaultMaxWidth),_=C.getActualWidth();return(b==null||_>=b)&&(y==null||_<=y)}))return;const l=[],c=[];for(const v of r){const C=((p=o==null?void 0:o.colKeys)==null?void 0:p.some(S=>$p(v,S)))??!0;v.getColDef().suppressSizeToFit||!C?c.push(v):l.push(v)}const u=l.slice(0);let d=!1;const h=v=>{Qr(l,v),c.push(v)};for(const v of l){v.resetActualWidth(t);const C=s==null?void 0:s[v.getId()],S=(C==null?void 0:C.minWidth)??(o==null?void 0:o.defaultMinWidth),b=(C==null?void 0:C.maxWidth)??(o==null?void 0:o.defaultMaxWidth),y=v.getActualWidth();typeof S=="number"&&y<S?v.setActualWidth(S,t,!0):typeof b=="number"&&y>b&&v.setActualWidth(b,t,!0)}for(;!d;){d=!0;const v=e-Ra(c);if(v<=0)for(const C of l){const S=((g=s==null?void 0:s[C.getId()])==null?void 0:g.minWidth)??(o==null?void 0:o.defaultMinWidth)??C.minWidth;C.setActualWidth(S,t,!0)}else{const C=v/Ra(l);let S=v;for(let b=l.length-1;b>=0;b--){const y=l[b],_=s==null?void 0:s[y.getId()],E=(_==null?void 0:_.minWidth)??(o==null?void 0:o.defaultMinWidth),D=(_==null?void 0:_.maxWidth)??(o==null?void 0:o.defaultMaxWidth),T=y.getMinWidth(),P=y.getMaxWidth(),L=typeof E=="number"&&E>T?E:T,I=typeof D=="number"&&D<P?D:P;let x=Math.round(y.getActualWidth()*C);x<L?(x=L,h(y),d=!1):x>I?(x=I,h(y),d=!1):b===0&&(x=S),y.setActualWidth(x,t,!0),S-=x}}}for(const v of u)v.fireColumnWidthChangedEvent(t);const f=this.beans.visibleCols;f.setLeftValues(t),f.updateBodyWidths(),!n&&Gd(this.eventSvc,u,!0,t)}applyAutosizeStrategy(){const{gos:e,colDelayRenderSvc:t}=this.beans,n=e.get("autoSizeStrategy");(n==null?void 0:n.type)!=="fitGridWidth"&&(n==null?void 0:n.type)!=="fitProvidedWidth"||setTimeout(()=>{if(!this.isAlive())return;const o=n.type;if(o==="fitGridWidth"){const{columnLimits:s,defaultMinWidth:r,defaultMaxWidth:i}=n,a=s==null?void 0:s.map(({colId:l,minWidth:c,maxWidth:u})=>({key:l,minWidth:c,maxWidth:u}));this.sizeColumnsToFitGridBody({defaultMinWidth:r,defaultMaxWidth:i,columnLimits:a})}else o==="fitProvidedWidth"&&this.sizeColumnsToFit(n.width,"sizeColumnsToFit");t==null||t.revealColumns(o)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{var o;if(!this.isAlive())return;const n="autosizeColumns";e?this.autoSizeCols({...t,source:n,colKeys:e}):this.autoSizeAllColumns({...t,source:n}),(o=this.beans.colDelayRenderSvc)==null||o.revealColumns(t.type)})}processResizeOperations(){this.shouldQueueResizeOperations=!1;for(const e of this.resizeOperationQueue)e();this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}destroy(){this.resizeOperationQueue.length=0,super.destroy()}};function J_e(e,t,n={}){const o=n.minWidth??e.getMinWidth();t<o&&(t=o);const s=n.maxWidth??e.getMaxWidth();return t>s&&(t=s),t}function dG({ctrlsSvc:e,scrollVisibleSvc:t}){const n=e.getGridBodyCtrl(),s=n.isVerticalScrollShowing()?t.getScrollbarWidth():0;return Ip(n.eGridBody)-s}var Q_e={moduleName:"ColumnAutoSize",version:ut,beans:[Z_e],apiFunctions:{sizeColumnsToFit:Y_e,autoSizeColumns:uG,autoSizeAllColumns:X_e},dependsOn:[N$]},eRe=".ag-row-pinned-source{background-color:var(--ag-pinned-source-row-background-color);color:var(--ag-pinned-source-row-text-color);font-weight:var(--ag-pinned-source-row-font-weight)}.ag-row-pinned-manual{background-color:var(--ag-pinned-row-background-color);color:var(--ag-pinned-row-text-color);font-weight:var(--ag-pinned-row-font-weight)}";function tRe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedTopRowCount())??0}function nRe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedBottomRowCount())??0}function oRe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedTopRow(t)}function sRe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedBottomRow(t)}function rRe(e,t,n){var o;return(o=e.pinnedRowModel)==null?void 0:o.forEachPinnedRow(t,n)}var iRe={moduleName:"PinnedRow",version:ut,beans:[oge],css:[eRe],apiFunctions:{getPinnedTopRowCount:tRe,getPinnedBottomRowCount:nRe,getPinnedTopRow:oRe,getPinnedBottomRow:sRe,forEachPinnedRow:rRe},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},aRe=class{constructor(e,t){this.col=e,this.firstNode=t,this.cellSpan=!0,this.spannedNodes=new Set,this.addSpannedNode(t)}reset(){this.spannedNodes.clear(),this.addSpannedNode(this.firstNode)}addSpannedNode(e){this.spannedNodes.add(e),this.lastNode=e}getLastNode(){return this.lastNode}getCellHeight(){return this.lastNode.rowTop+this.lastNode.rowHeight-this.firstNode.rowTop-1}doesSpanContain(e){return e.column!==this.col||e.rowPinned!=this.firstNode.rowPinned?!1:this.firstNode.rowIndex<=e.rowIndex&&e.rowIndex<=this.lastNode.rowIndex}getLastNodeAutoHeight(){var n;const e=(n=this.firstNode.__autoHeights)==null?void 0:n[this.col.getColId()];if(e==null)return;let t=0;for(const o of this.spannedNodes)o!==this.lastNode&&(t+=o.rowHeight);return e-t}},lRe=class extends je{constructor(e){super(),this.column=e}buildCache(e){var b;const{column:t,beans:{gos:n,pinnedRowModel:o,rowModel:s,valueSvc:r,pagination:i}}=this,{colDef:a}=t,l=this.getNodeMap(e),c=new Map,u=n.getCallback("isFullWidthRow"),d=a.equals,h=a.spanRows,f=typeof h=="function";let p=null,g=null,v;const C=(y,_)=>{p=y,g=null,v=_},S=y=>{const _=!y.isExpandable()&&!y.group&&!y.detail&&(u?!u({rowNode:y}):!0);if(y.rowIndex==null||!_){C(null,null);return}if(p==null||y.level!==p.level||y.footer||g&&y.rowIndex-1!==(g==null?void 0:g.getLastNode().rowIndex)){C(y,r.getValue(t,y));return}const E=r.getValue(t,y);if(f){const D=Ot(n,{valueA:v,nodeA:p,valueB:E,nodeB:y,column:t,colDef:a});if(!h(D)){C(y,E);return}}else if(d?!d(v,E):v!==E){C(y,E);return}if(!g){const D=l==null?void 0:l.get(p);(D==null?void 0:D.firstNode)===p?(D.reset(),g=D):g=new aRe(t,p),c.set(p,g)}g.addSpannedNode(y),c.set(y,g)};switch(e){case"center":(b=s.forEachDisplayedNode)==null||b.call(s,y=>{(!i||i.isRowInPage(y.rowIndex))&&S(y)}),this.centerValueNodeMap=c;break;case"top":o==null||o.forEachPinnedRow("top",S),this.topValueNodeMap=c;break;case"bottom":o==null||o.forEachPinnedRow("bottom",S),this.bottomValueNodeMap=c;break}}isCellSpanning(e){return!!this.getCellSpan(e)}getCellSpan(e){return this.getNodeMap(e.rowPinned).get(e)}getNodeMap(e){switch(e){case"top":return this.topValueNodeMap;case"bottom":return this.bottomValueNodeMap;default:return this.centerValueNodeMap}}},cRe=class extends je{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=qo(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=qo(this,this.dispatchCellsUpdatedEvent.bind(this,!1),0),this.pinnedTimeout=null,this.modelTimeout=null}postConstruct(){const e=this.onRowDataUpdated.bind(this),t=this.buildPinnedCaches.bind(this);this.addManagedEventListeners({paginationChanged:this.buildModelCaches.bind(this),pinnedRowDataChanged:t,pinnedRowsChanged:t,rowNodeDataChanged:e,cellValueChanged:e})}register(e){const{gos:t}=this.beans;if(!t.get("enableCellSpan")||this.spanningColumns.has(e))return;const n=this.createManagedBean(new lRe(e));this.spanningColumns.set(e,n),n.buildCache("top"),n.buildCache("bottom"),n.buildCache("center"),this.debouncePinnedEvent(),this.debounceModelEvent()}dispatchCellsUpdatedEvent(e){this.dispatchLocalEvent({type:"spannedCellsUpdated",pinned:e})}deregister(e){this.spanningColumns.delete(e)}onRowDataUpdated({node:e}){const{spannedRowRenderer:t}=this.beans;if(e.rowPinned){if(this.pinnedTimeout!=null)return;this.pinnedTimeout=window.setTimeout(()=>{this.pinnedTimeout=null,this.buildPinnedCaches(),t==null||t.createCtrls("top"),t==null||t.createCtrls("bottom")},0);return}this.modelTimeout==null&&(this.modelTimeout=window.setTimeout(()=>{this.modelTimeout=null,this.buildModelCaches(),t==null||t.createCtrls("center")},0))}buildModelCaches(){this.modelTimeout!=null&&clearTimeout(this.modelTimeout),this.spanningColumns.forEach(e=>e.buildCache("center")),this.debounceModelEvent()}buildPinnedCaches(){this.pinnedTimeout!=null&&clearTimeout(this.pinnedTimeout),this.spanningColumns.forEach(e=>{e.buildCache("top"),e.buildCache("bottom")}),this.debouncePinnedEvent()}isCellSpanning(e,t){const n=this.spanningColumns.get(e);return n?n.isCellSpanning(t):!1}getCellSpanByPosition(e){const{pinnedRowModel:t,rowModel:n}=this.beans,o=e.column,s=e.rowIndex,r=this.spanningColumns.get(o);if(!r)return;let i;switch(e.rowPinned){case"top":i=t==null?void 0:t.getPinnedTopRow(s);break;case"bottom":i=t==null?void 0:t.getPinnedBottomRow(s);break;default:i=n.getRow(s)}if(i)return r.getCellSpan(i)}getCellStart(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.firstNode.rowIndex}:e}getCellEnd(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.getLastNode().rowIndex}:e}getCellSpan(e,t){const n=this.spanningColumns.get(e);if(n)return n.getCellSpan(t)}forEachSpannedColumn(e,t){for(const[n,o]of this.spanningColumns)if(o.isCellSpanning(e)){const s=o.getCellSpan(e);t(n,s)}}destroy(){super.destroy(),this.spanningColumns.clear()}},uRe=class extends eh{constructor(e,t,n){super(e.col,e.firstNode,n,t),this.cellSpan=e,this.SPANNED_CELL_CSS_CLASS="ag-spanned-cell"}setComp(e,t,n,o,s,r,i){this.eWrapper=n,super.setComp(e,t,n,o,s,r,i),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||ky(e,t.rowIndex)}setAriaRowSpan(){Hce(this.eGui,this.cellSpan.spannedNodes.size)}setFocusedCellPosition(e){this.focusedCellPosition=e}getFocusedCellPosition(){return this.focusedCellPosition??this.cellPosition}checkCellFocused(){const e=this.beans.focusSvc.getFocusedCell();return!!e&&this.cellSpan.doesSpanContain(e)}applyStaticCssClasses(){super.applyStaticCssClasses(),this.comp.toggleCss(this.SPANNED_CELL_CSS_CLASS,!0)}onCellFocused(e){const{beans:t}=this;if(vw(t)){this.focusedCellPosition=void 0;return}const n=this.isCellFocused();n||(this.focusedCellPosition=void 0),e&&n&&(this.focusedCellPosition={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column}),super.onCellFocused(e)}getRootElement(){return this.eWrapper}},dRe=class extends Dw{onRowIndexChanged(){super.onRowIndexChanged();for(const e of this.getAllCellCtrls())e.refreshAriaRowIndex()}getInitialRowClasses(e){return["ag-spanned-row"]}getNewCellCtrl(e){var o;const t=(o=this.beans.rowSpanSvc)==null?void 0:o.getCellSpan(e,this.rowNode);if(!(!t||t.firstNode!==this.rowNode))return new uRe(t,this,this.beans)}isCorrectCtrlForSpan(e){var o;const t=(o=this.beans.rowSpanSvc)==null?void 0:o.getCellSpan(e.column,this.rowNode);return!t||t.firstNode!==this.rowNode?!1:e.getCellSpan()===t}onRowHeightChanged(){}refreshFirstAndLastRowStyles(){}addHoverFunctionality(){}resetHoveredStatus(){}},hRe=class extends je{constructor(){super(...arguments),this.beanName="spannedRowRenderer",this.topCtrls=new Map,this.bottomCtrls=new Map,this.centerCtrls=new Map}postConstruct(){this.addManagedEventListeners({displayedRowsChanged:this.createAllCtrls.bind(this)})}createAllCtrls(){this.createCtrls("top"),this.createCtrls("bottom"),this.createCtrls("center")}createCtrls(e){const{rowSpanSvc:t}=this.beans,n=this.getCtrlsMap(e),o=n.size,s=this.getAllRelevantRowControls(e),r=new Map;let i=!1;for(const l of s)l.isAlive()&&(t==null||t.forEachSpannedColumn(l.rowNode,(c,u)=>{if(r.has(u.firstNode))return;const d=n.get(u.firstNode);if(d){r.set(u.firstNode,d),n.delete(u.firstNode);return}i=!0;const h=new dRe(u.firstNode,this.beans,!1,!1,!1);r.set(u.firstNode,h)}));this.setCtrlsMap(e,r);const a=r.size===o;if(!(!i&&a)){for(const l of n.values())l.destroyFirstPass(!0),l.destroySecondPass();this.dispatchLocalEvent({type:"spannedRowsUpdated",ctrlsKey:e})}}getAllRelevantRowControls(e){const{rowRenderer:t}=this.beans;switch(e){case"top":return t.topRowCtrls;case"bottom":return t.bottomRowCtrls;case"center":return t.allRowCtrls}}getCellByPosition(e){const{rowSpanSvc:t}=this.beans,n=t==null?void 0:t.getCellSpanByPosition(e);if(!n)return;const o=this.getCtrlsMap(e.rowPinned).get(n.firstNode);if(o)return o.getAllCellCtrls().find(s=>s.column===e.column)}getCtrls(e){return[...this.getCtrlsMap(e).values()]}destroyRowCtrls(e){for(const t of this.getCtrlsMap(e).values())t.destroyFirstPass(!0),t.destroySecondPass();this.setCtrlsMap(e,new Map)}getCtrlsMap(e){switch(e){case"top":return this.topCtrls;case"bottom":return this.bottomCtrls;default:return this.centerCtrls}}setCtrlsMap(e,t){switch(e){case"top":this.topCtrls=t;break;case"bottom":this.bottomCtrls=t;break;default:this.centerCtrls=t;break}}destroy(){super.destroy(),this.destroyRowCtrls("top"),this.destroyRowCtrls("bottom"),this.destroyRowCtrls("center")}},fRe={moduleName:"CellSpan",version:ut,beans:[cRe,hRe]},pRe=class extends je{constructor(e,t){super(),this.cellCtrl=e,this.staticClasses=[],this.beans=t,this.column=e.column}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const{column:e,cellComp:t}=this,n=e.colDef,o=n.cellClassRules,s=this.getCellClassParams(e,n);AR(this.beans.expressionSvc,o===this.cellClassRules?void 0:this.cellClassRules,o,s,r=>t.toggleCss(r,!0),r=>t.toggleCss(r,!1)),this.cellClassRules=o}applyUserStyles(){const e=this.column,t=e.colDef,n=t.cellStyle;if(!n)return;let o;if(typeof n=="function"){const s=this.getCellClassParams(e,t);o=n(s)}else o=n;o&&this.cellComp.setUserStyles(o)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,n=e.colDef,o=this.getCellClassParams(e,n);for(const r of this.staticClasses)t.toggleCss(r,!1);const s=this.beans.cellStyles.getStaticCellClasses(n,o);this.staticClasses=s;for(const r of s)t.toggleCss(r,!0)}getCellClassParams(e,t){const{value:n,rowNode:o}=this.cellCtrl;return Ot(this.beans.gos,{value:n,data:o.data,node:o,colDef:t,column:e,rowIndex:o.rowIndex})}},gRe=class extends je{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,n,o){AR(this.beans.expressionSvc,void 0,e.cellClassRules,t,n,o),this.processStaticCellClasses(e,t,n)}getStaticCellClasses(e,t){const{cellClass:n}=e;if(!n)return[];let o;return typeof n=="function"?o=n(t):o=n,typeof o=="string"&&(o=[o]),o||[]}createCellCustomStyleFeature(e,t){return new pRe(e,t)}processStaticCellClasses(e,t,n){this.getStaticCellClasses(e,t).forEach(s=>{n(s)})}},mRe={moduleName:"CellStyle",version:ut,beans:[gRe]},vRe={moduleName:"RowStyle",version:ut,beans:[oCe]};function yRe(e,t){var n;return!!((n=e.colHover)!=null&&n.isHovered(t))}var wRe=class extends je{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=n=>{const{beans:o,gos:s,element:r,columns:i}=this,a=o.colHover;if(n??!!s.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(r,{mouseover:a.setMouseOver.bind(a,i),mouseout:a.clearMouseOver.bind(a)});else{for(const c of this.destroyManagedListeners)c();this.destroyManagedListeners=[]}}}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{this.enableFeature(e)}),this.enableFeature()}destroy(){super.destroy(),this.destroyManagedListeners=null}},CRe="ag-column-hover",bRe=class extends je{constructor(){super(...arguments),this.beanName="colHover"}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{e||this.clearMouseOver()})}setMouseOver(e){this.updateState(e)}clearMouseOver(){this.updateState(null)}isHovered(e){if(!this.gos.get("columnHoverHighlight"))return!1;const t=this.selectedColumns;return!!t&&t.indexOf(e)>=0}addHeaderColumnHoverListener(e,t,n){const o=()=>{const s=this.isHovered(n);t.toggleCss("ag-column-hover",s)};e.addManagedEventListeners({columnHoverChanged:o}),o()}onCellColumnHover(e,t){if(!t)return;const n=this.isHovered(e);t.toggleCss(CRe,n)}addHeaderFilterColumnHoverListener(e,t,n,o){this.createHoverFeature(e,[n],o);const s=()=>{const r=this.isHovered(n);t.toggleCss("ag-column-hover",r)};e.addManagedEventListeners({columnHoverChanged:s}),s()}createHoverFeature(e,t,n){e.createManagedBean(new wRe(t,n))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},SRe={moduleName:"ColumnHover",version:ut,beans:[bRe],apiFunctions:{isColumnHovered:yRe}},ERe=class extends je{constructor(){super(...arguments),this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){var e,t;this.wrapSvc=(t=(e=this.beans.frameworkOverrides).createGlobalEventListenerWrapper)==null?void 0:t.call(e)}addListener(e,t){var r;const n=((r=this.wrapSvc)==null?void 0:r.wrap(e,t))??t,o=!_w.has(e),s=o?this.asyncListeners:this.syncListeners;s.has(e)||s.set(e,new Set),s.get(e).add(n),this.eventSvc.addListener(e,n,o)}removeListener(e,t){var r,i;const n=((r=this.wrapSvc)==null?void 0:r.unwrap(e,t))??t,o=this.asyncListeners.get(e),s=!!(o!=null&&o.delete(n));s||(i=this.syncListeners.get(e))==null||i.delete(n),this.eventSvc.removeListener(e,n,s)}addGlobalListener(e){var r;const t=((r=this.wrapSvc)==null?void 0:r.wrapGlobal(e))??e,n=(i,a)=>{_w.has(i)&&t(i,a)},o=(i,a)=>{_w.has(i)||t(i,a)};this.globalListenerPairs.set(e,{syncListener:n,asyncListener:o});const s=this.eventSvc;s.addGlobalListener(n,!1),s.addGlobalListener(o,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:n,globalListenerPairs:o}=this,s=(n==null?void 0:n.unwrapGlobal(e))??e;if(o.has(s)){const{syncListener:i,asyncListener:a}=o.get(s);t.removeGlobalListener(i,!1),t.removeGlobalListener(a,!0),o.delete(e)}else this.syncGlobalListeners.delete(s),t.removeGlobalListener(s,!1)}destroyEventListeners(e,t){e.forEach((n,o)=>{n.forEach(s=>this.eventSvc.removeListener(o,s,t)),n.clear()}),e.clear()}destroyGlobalListeners(e,t){for(const n of e)this.eventSvc.removeGlobalListener(n,t);e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncListeners,!1),this.destroyEventListeners(this.asyncListeners,!0),this.destroyGlobalListeners(this.syncGlobalListeners,!1);const{globalListenerPairs:e,eventSvc:t}=this;e.forEach(({syncListener:n,asyncListener:o})=>{t.removeGlobalListener(n,!1),t.removeGlobalListener(o,!0)}),e.clear()}};function _Re(e,t,n){var o;(o=e.apiEventSvc)==null||o.addListener(t,n)}function RRe(e,t,n){var o;(o=e.apiEventSvc)==null||o.removeListener(t,n)}function TRe(e,t){var n;(n=e.apiEventSvc)==null||n.addGlobalListener(t)}function DRe(e,t){var n;(n=e.apiEventSvc)==null||n.removeGlobalListener(t)}var IRe={moduleName:"EventApi",version:ut,apiFunctions:{addEventListener:_Re,addGlobalListener:TRe,removeEventListener:RRe,removeGlobalListener:DRe},beans:[ERe]},xRe={moduleName:"Locale",version:ut,beans:[sbe]},PRe=class extends je{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=qo(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){var a,l,c,u;const{visibleCols:e,rowModel:t,rowSpanSvc:n,pinnedRowModel:o}=this.beans,s=e.autoHeightCols;let r=!1;const i=d=>{var p;const h=d.__autoHeights;let f=Tl(this.beans,d).height;for(const g of s){let v=h==null?void 0:h[g.getColId()];const C=n==null?void 0:n.getCellSpan(g,d);if(C){if(C.getLastNode()!==d)continue;if(v=(p=n==null?void 0:n.getCellSpan(g,d))==null?void 0:p.getLastNodeAutoHeight(),!v)return}if(v==null){if(this.colSpanSkipCell(g,d))continue;return}f=Math.max(v,f)}f!==d.rowHeight&&(d.setRowHeight(f),r=!0)};(a=o==null?void 0:o.forEachPinnedRow)==null||a.call(o,"top",i),(l=o==null?void 0:o.forEachPinnedRow)==null||l.call(o,"bottom",i),(c=t.forEachDisplayedNode)==null||c.call(t,i),r&&((u=t.onRowHeightChanged)==null||u.call(t))}setRowAutoHeight(e,t,n){if(e.__autoHeights??(e.__autoHeights={}),t==null){delete e.__autoHeights[n.getId()];return}const o=e.__autoHeights[n.getId()];e.__autoHeights[n.getId()]=t,o!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:n,colViewport:o,visibleCols:s}=this.beans;if(!n.colSpanActive)return!1;let r=[];switch(e.getPinned()){case"left":r=s.getLeftColsForRow(t);break;case"right":r=s.getRightColsForRow(t);break;case null:r=o.getColsWithinViewport(t);break}return!r.includes(e)}setupCellAutoHeight(e,t,n){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const o=t.parentElement,{rowNode:s,column:r}=e,i=this.beans,a=u=>{var S;if((S=this.beans.editSvc)!=null&&S.isEditing(e)||!e.isAlive()||!n.isAlive())return;const{paddingTop:d,paddingBottom:h,borderBottomWidth:f,borderTopWidth:p}=Uc(o),g=d+h+f+p,C=t.offsetHeight+g;if(u<5){const b=Lo(i),y=!(b!=null&&b.contains(t)),_=C==0;if(y||_){window.setTimeout(()=>a(u+1),0);return}}this.setRowAutoHeight(s,C,r)},l=()=>a(0);l();const c=El(i,t,l);return n.addDestroyFunc(()=>{c(),this.setRowAutoHeight(s,void 0,r)}),!0}setAutoHeightActive(e){this.active=e.list.some(t=>t.isVisible()&&t.isAutoHeight())}areRowsMeasured(){if(!this.active)return!0;const e=this.beans.rowRenderer.getAllRowCtrls();let t=null;for(const{rowNode:n}of e)if((!t||this.beans.colModel.colSpanActive)&&(t=this.beans.colViewport.getColsWithinViewport(n).filter(s=>s.isAutoHeight())),t.length!==0){if(!n.__autoHeights)return!1;for(const o of t){const s=n.__autoHeights[o.getColId()];if(!s||n.rowHeight<s)return!1}}return!0}},kRe={moduleName:"RowAutoHeight",version:ut,beans:[PRe]},FRe={moduleName:"AllCommunity",version:ut,dependsOn:[iG,VEe,qEe,Sbe,F0e,A0e,O0e,M0e,N0e,L0e,V0e,k0e,_Se,RSe,TSe,ESe,ISe,xSe,u_e,cEe,x_e,$$,B_e,$_e,q_e,Q_e,vme,iRe,Q0e,BCe,mRe,SRe,vRe,IRe,GCe,s_e,HH,xRe,kRe,mme,kEe,fRe]};let hG=!1;hG||(_ue.registerModules([FRe,iG]),hG=!0);class ARe{constructor(t,n){Tn(this,"gridApi",null);Tn(this,"container");Tn(this,"config");Tn(this,"eventListeners",new Map);this.container=t,this.config=n}init(){if(this.gridApi)throw new Error("Grid already initialized");const{onGridReady:t,onCellClicked:n,onCellFocused:o,onRowSelected:s,...r}=this.config,i={...r,onGridReady:a=>{this.gridApi=a.api,t&&t(a)},onCellClicked:a=>{n&&n(a)},onCellFocused:a=>{o&&o(a)},onRowSelected:a=>{s&&s(a)}};return this.gridApi=ebe(this.container,i),this.gridApi}updateRowData(t){this.gridApi&&this.gridApi.setGridOption("rowData",t)}updateColumnDefs(t){this.gridApi&&this.gridApi.setGridOption("columnDefs",t)}setColumnWidth(t){var n;this.gridApi&&((n=this.gridApi)==null||n.applyColumnState({state:t,applyOrder:!1}))}updateDatasource(t){this.gridApi&&this.gridApi.setGridOption("datasource",t)}refreshInfiniteCache(){this.gridApi&&this.gridApi.refreshInfiniteCache()}sizeColumnsToFit(){this.gridApi}deselectAll(){this.gridApi&&this.gridApi.deselectAll()}getSelectedRows(){var t;return((t=this.gridApi)==null?void 0:t.getSelectedRows())||[]}setQuickFilterText(t){this.gridApi&&this.gridApi.setGridOption("quickFilterText",t)}getColumnState(){var t;return(t=this.gridApi)==null?void 0:t.getColumnState()}addEventListener(t,n){if(!this.gridApi)throw new Error("Grid not initialized");this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t).add(n),this.gridApi.addEventListener(t,n)}addRow(t,n="bottom"){if(this.gridApi){const o={add:[t],addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(o),n==="bottom"){const s=this.gridApi.getDisplayedRowCount();s>0&&this.gridApi.ensureIndexVisible(s-1,"bottom")}}}addRows(t,n="bottom"){if(this.gridApi&&t.length>0){const o={add:t,addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(o),n==="bottom"){const s=this.gridApi.getDisplayedRowCount();s>0&&this.gridApi.ensureIndexVisible(s-1,"bottom")}}}destroy(){this.gridApi&&(this.eventListeners.forEach((t,n)=>{t.forEach(o=>{var s;(s=this.gridApi)==null||s.removeEventListener(n,o)})}),this.eventListeners.clear(),this.gridApi.destroy(),this.gridApi=null)}getApi(){return this.gridApi}switchTheme(t){document.body.dataset.agThemeMode=t==="dark"?"dark":"light"}}const ORe=j$.withParams({accentColor:"var(--primary-color)",backgroundColor:"#ffffff",borderColor:"#e5e7eb",borderRadius:4,browserColorScheme:"light",chromeBackgroundColor:"#f9fafb",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#111827",headerBackgroundColor:"#fff",headerFontSize:14,headerFontWeight:600,headerTextColor:"#374151",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"light").withParams({accentColor:"var(--primary-color)",backgroundColor:"#1f2937",borderColor:"#374151",borderRadius:4,browserColorScheme:"dark",chromeBackgroundColor:"#111827",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#f9fafb",headerBackgroundColor:"#374151",headerFontSize:14,headerFontWeight:600,headerTextColor:"#f9fafb",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"dark"),MRe=tt({__name:"AgTable",props:{statusBar:{},sideBar:{type:[Object,String,Array,Boolean,null]},suppressContextMenu:{type:Boolean},preventDefaultOnContextMenu:{type:Boolean},allowContextMenuWithControlKey:{type:Boolean},columnMenu:{},suppressMenuHide:{type:Boolean},enableBrowserTooltips:{type:Boolean},tooltipTrigger:{},tooltipShowDelay:{},tooltipHideDelay:{},tooltipMouseTrack:{type:Boolean},tooltipShowMode:{},tooltipInteraction:{type:Boolean},popupParent:{},copyHeadersToClipboard:{type:Boolean},copyGroupHeadersToClipboard:{type:Boolean},clipboardDelimiter:{},suppressCopyRowsToClipboard:{type:Boolean},suppressCopySingleCellRanges:{type:Boolean},suppressLastEmptyLineOnPaste:{type:Boolean},suppressClipboardPaste:{type:Boolean},suppressClipboardApi:{type:Boolean},suppressCutToClipboard:{type:Boolean},columnDefs:{},defaultColDef:{},defaultColGroupDef:{},columnTypes:{},dataTypeDefinitions:{},maintainColumnOrder:{type:Boolean},enableStrictPivotColumnOrder:{type:Boolean},suppressFieldDotNotation:{type:Boolean},headerHeight:{},groupHeaderHeight:{},floatingFiltersHeight:{},pivotHeaderHeight:{},pivotGroupHeaderHeight:{},hidePaddedHeaderRows:{type:Boolean},allowDragFromColumnsToolPanel:{type:Boolean},suppressMovableColumns:{type:Boolean},suppressColumnMoveAnimation:{type:Boolean},suppressMoveWhenColumnDragging:{type:Boolean},suppressDragLeaveHidesColumns:{type:Boolean},suppressGroupChangesColumnVisibility:{type:[Boolean,String]},suppressMakeColumnVisibleAfterUnGroup:{type:Boolean},suppressRowGroupHidesColumns:{type:Boolean},colResizeDefault:{},suppressAutoSize:{type:Boolean},autoSizePadding:{},skipHeaderOnAutoSize:{type:Boolean},autoSizeStrategy:{},components:{},editType:{},suppressStartEditOnTab:{type:Boolean},getFullRowEditValidationErrors:{type:Function},invalidEditValueMode:{},singleClickEdit:{type:Boolean},suppressClickEdit:{type:Boolean},readOnlyEdit:{type:Boolean},stopEditingWhenCellsLoseFocus:{type:Boolean},enterNavigatesVertically:{type:Boolean},enterNavigatesVerticallyAfterEdit:{type:Boolean},enableCellEditingOnBackspace:{type:Boolean},undoRedoCellEditing:{type:Boolean},undoRedoCellEditingLimit:{},defaultCsvExportParams:{},suppressCsvExport:{type:Boolean},defaultExcelExportParams:{},suppressExcelExport:{type:Boolean},excelStyles:{},findSearchValue:{},findOptions:{},quickFilterText:{},cacheQuickFilter:{type:Boolean},includeHiddenColumnsInQuickFilter:{type:Boolean},quickFilterParser:{type:Function},quickFilterMatcher:{type:Function},applyQuickFilterBeforePivotOrAgg:{type:Boolean},excludeChildrenWhenTreeDataFiltering:{type:Boolean},enableAdvancedFilter:{type:Boolean},alwaysPassFilter:{type:Function},includeHiddenColumnsInAdvancedFilter:{type:Boolean},advancedFilterParent:{},advancedFilterBuilderParams:{},advancedFilterParams:{},suppressAdvancedFilterEval:{type:Boolean},suppressSetFilterByDefault:{type:Boolean},enableFilterHandlers:{type:Boolean},filterHandlers:{},enableCharts:{type:Boolean},chartThemes:{},customChartThemes:{},chartThemeOverrides:{},chartToolPanelsDef:{},chartMenuItems:{type:[Array,Function]},loadingCellRenderer:{},loadingCellRendererParams:{},loadingCellRendererSelector:{type:Function},localeText:{},masterDetail:{type:Boolean},keepDetailRows:{type:Boolean},keepDetailRowsCount:{},detailCellRenderer:{},detailCellRendererParams:{},detailRowHeight:{},detailRowAutoHeight:{type:Boolean},context:{},alignedGrids:{type:[Array,Function]},tabIndex:{},rowBuffer:{},valueCache:{type:Boolean},valueCacheNeverExpires:{type:Boolean},enableCellExpressions:{type:Boolean},suppressTouch:{type:Boolean},suppressFocusAfterRefresh:{type:Boolean},suppressBrowserResizeObserver:{type:Boolean},suppressPropertyNamesCheck:{type:Boolean},suppressChangeDetection:{type:Boolean},debug:{type:Boolean},loading:{type:Boolean},overlayLoadingTemplate:{},loadingOverlayComponent:{},loadingOverlayComponentParams:{},suppressLoadingOverlay:{type:Boolean},overlayNoRowsTemplate:{},noRowsOverlayComponent:{},noRowsOverlayComponentParams:{},suppressNoRowsOverlay:{type:Boolean},pagination:{type:Boolean},paginationPageSize:{},paginationPageSizeSelector:{type:[Array,Boolean]},paginationAutoPageSize:{type:Boolean},paginateChildRows:{type:Boolean},suppressPaginationPanel:{type:Boolean},pivotMode:{type:Boolean},pivotPanelShow:{},pivotMaxGeneratedColumns:{},pivotDefaultExpanded:{},pivotColumnGroupTotals:{},pivotRowTotals:{},pivotSuppressAutoColumn:{type:Boolean},suppressExpandablePivotGroups:{type:Boolean},functionsReadOnly:{type:Boolean},aggFuncs:{},suppressAggFuncInHeader:{type:Boolean},alwaysAggregateAtRootLevel:{type:Boolean},aggregateOnlyChangedColumns:{type:Boolean},suppressAggFilteredOnly:{type:Boolean},removePivotHeaderRowWhenSingleValueColumn:{type:Boolean},animateRows:{type:Boolean},cellFlashDuration:{},cellFadeDuration:{},allowShowChangeAfterFilter:{type:Boolean},domLayout:{},ensureDomOrder:{type:Boolean},enableCellSpan:{type:Boolean},enableRtl:{type:Boolean},suppressColumnVirtualisation:{type:Boolean},suppressMaxRenderedRowRestriction:{type:Boolean},suppressRowVirtualisation:{type:Boolean},rowDragManaged:{type:Boolean},rowDragInsertDelay:{},suppressRowDrag:{type:Boolean},suppressMoveWhenRowDragging:{type:Boolean},rowDragEntireRow:{type:Boolean},rowDragMultiRow:{type:Boolean},rowDragText:{type:Function},dragAndDropImageComponent:{},dragAndDropImageComponentParams:{},fullWidthCellRenderer:{},fullWidthCellRendererParams:{},embedFullWidthRows:{type:Boolean},groupDisplayType:{},groupDefaultExpanded:{},autoGroupColumnDef:{},groupMaintainOrder:{type:Boolean},groupSelectsChildren:{type:Boolean},groupLockGroupColumns:{},groupAggFiltering:{type:[Boolean,Function]},groupTotalRow:{type:[String,Function]},grandTotalRow:{},suppressStickyTotalRow:{type:[Boolean,String]},groupSuppressBlankHeader:{type:Boolean},groupSelectsFiltered:{type:Boolean},showOpenedGroup:{type:Boolean},groupHideParentOfSingleChild:{type:[Boolean,String]},groupRemoveSingleChildren:{type:Boolean},groupRemoveLowestSingleChildren:{type:Boolean},groupHideOpenParents:{type:Boolean},groupAllowUnbalanced:{type:Boolean},rowGroupPanelShow:{},groupRowRenderer:{},groupRowRendererParams:{},treeData:{type:Boolean},treeDataChildrenField:{},treeDataParentIdField:{},rowGroupPanelSuppressSort:{type:Boolean},suppressGroupRowsSticky:{type:Boolean},groupHierarchyConfig:{},pinnedTopRowData:{},pinnedBottomRowData:{},enableRowPinning:{type:[Boolean,String]},isRowPinnable:{type:Function},isRowPinned:{type:Function},rowModelType:{},rowData:{},asyncTransactionWaitMillis:{},suppressModelUpdateAfterUpdateTransaction:{type:Boolean},datasource:{},cacheOverflowSize:{},infiniteInitialRowCount:{},serverSideInitialRowCount:{},suppressServerSideFullWidthLoadingRow:{type:Boolean},cacheBlockSize:{},maxBlocksInCache:{},maxConcurrentDatasourceRequests:{},blockLoadDebounceMillis:{},purgeClosedRowNodes:{type:Boolean},serverSideDatasource:{},serverSideSortAllLevels:{type:Boolean},serverSideEnableClientSideSort:{type:Boolean},serverSideOnlyRefreshFilteredGroups:{type:Boolean},serverSidePivotResultFieldSeparator:{},viewportDatasource:{},viewportRowModelPageSize:{},viewportRowModelBufferSize:{},alwaysShowHorizontalScroll:{type:Boolean},alwaysShowVerticalScroll:{type:Boolean},debounceVerticalScrollbar:{type:Boolean},suppressHorizontalScroll:{type:Boolean},suppressScrollOnNewData:{type:Boolean},suppressScrollWhenPopupsAreOpen:{type:Boolean},suppressAnimationFrame:{type:Boolean},suppressMiddleClickScrolls:{type:Boolean},suppressPreventDefaultOnMouseWheel:{type:Boolean},scrollbarWidth:{},rowSelection:{},cellSelection:{type:[Boolean,Object]},rowMultiSelectWithClick:{type:Boolean},suppressRowDeselection:{type:Boolean},suppressRowClickSelection:{type:Boolean},suppressCellFocus:{type:Boolean},suppressHeaderFocus:{type:Boolean},selectionColumnDef:{},rowNumbers:{type:[Boolean,Object]},suppressMultiRangeSelection:{type:Boolean},enableCellTextSelection:{type:Boolean},enableRangeSelection:{type:Boolean},enableRangeHandle:{type:Boolean},enableFillHandle:{type:Boolean},fillHandleDirection:{},suppressClearOnFillReduction:{type:Boolean},sortingOrder:{},accentedSort:{type:Boolean},unSortIcon:{type:Boolean},suppressMultiSort:{type:Boolean},alwaysMultiSort:{type:Boolean},multiSortKey:{},suppressMaintainUnsortedOrder:{type:Boolean},icons:{},rowHeight:{},rowStyle:{},rowClass:{},rowClassRules:{},suppressRowHoverHighlight:{type:Boolean},suppressRowTransform:{type:Boolean},columnHoverHighlight:{type:Boolean},gridId:{},deltaSort:{type:Boolean},treeDataDisplayType:{},enableGroupEdit:{type:Boolean},initialState:{},reactiveCustomComponents:{type:Boolean},renderingMode:{},theme:{},loadThemeGoogleFonts:{type:Boolean},themeCssLayer:{},styleNonce:{},themeStyleContainer:{},getContextMenuItems:{type:Function},getMainMenuItems:{type:Function},postProcessPopup:{type:Function},processUnpinnedColumns:{type:Function},processCellForClipboard:{type:Function},processHeaderForClipboard:{type:Function},processGroupHeaderForClipboard:{type:Function},processCellFromClipboard:{type:Function},sendToClipboard:{type:Function},processDataFromClipboard:{type:Function},isExternalFilterPresent:{type:Function},doesExternalFilterPass:{type:Function},getChartToolbarItems:{type:Function},createChartContainer:{type:Function},focusGridInnerElement:{type:Function},navigateToNextHeader:{type:Function},tabToNextHeader:{type:Function},navigateToNextCell:{type:Function},tabToNextCell:{type:Function},getLocaleText:{type:Function},getDocument:{type:Function},paginationNumberFormatter:{type:Function},getGroupRowAgg:{type:Function},isGroupOpenByDefault:{type:Function},ssrmExpandAllAffectsAllRows:{type:Boolean},initialGroupOrderComparator:{type:Function},processPivotResultColDef:{type:Function},processPivotResultColGroupDef:{type:Function},getDataPath:{type:Function},getChildCount:{type:Function},getServerSideGroupLevelParams:{type:Function},isServerSideGroupOpenByDefault:{type:Function},isApplyServerSideTransaction:{type:Function},isServerSideGroup:{type:Function},getServerSideGroupKey:{type:Function},getBusinessKeyForNode:{type:Function},getRowId:{type:Function},resetRowDataOnUpdate:{type:Boolean},processRowPostCreate:{type:Function},isRowSelectable:{type:Function},isRowMaster:{type:Function},fillOperation:{type:Function},postSortRows:{type:Function},getRowStyle:{type:Function},getRowClass:{type:Function},getRowHeight:{type:Function},isFullWidthRow:{type:Function},onToolPanelVisibleChanged:{type:Function},onToolPanelSizeChanged:{type:Function},onColumnMenuVisibleChanged:{type:Function},onContextMenuVisibleChanged:{type:Function},onCutStart:{type:Function},onCutEnd:{type:Function},onPasteStart:{type:Function},onPasteEnd:{type:Function},onColumnVisible:{type:Function},onColumnPinned:{type:Function},onColumnResized:{type:Function},onColumnMoved:{type:Function},onColumnValueChanged:{type:Function},onColumnPivotModeChanged:{type:Function},onColumnPivotChanged:{type:Function},onColumnGroupOpened:{type:Function},onNewColumnsLoaded:{type:Function},onGridColumnsChanged:{type:Function},onDisplayedColumnsChanged:{type:Function},onVirtualColumnsChanged:{type:Function},onColumnEverythingChanged:{type:Function},onColumnsReset:{type:Function},onColumnHeaderMouseOver:{type:Function},onColumnHeaderMouseLeave:{type:Function},onColumnHeaderClicked:{type:Function},onColumnHeaderContextMenu:{type:Function},onComponentStateChanged:{type:Function},onCellValueChanged:{type:Function},onCellEditRequest:{type:Function},onRowValueChanged:{type:Function},onCellEditingStarted:{type:Function},onCellEditingStopped:{type:Function},onRowEditingStarted:{type:Function},onRowEditingStopped:{type:Function},onBulkEditingStarted:{type:Function},onBulkEditingStopped:{type:Function},onBatchEditingStarted:{type:Function},onBatchEditingStopped:{type:Function},onUndoStarted:{type:Function},onUndoEnded:{type:Function},onRedoStarted:{type:Function},onRedoEnded:{type:Function},onCellSelectionDeleteStart:{type:Function},onCellSelectionDeleteEnd:{type:Function},onRangeDeleteStart:{type:Function},onRangeDeleteEnd:{type:Function},onFillStart:{type:Function},onFillEnd:{type:Function},onFilterOpened:{type:Function},onFilterChanged:{type:Function},onFilterModified:{type:Function},onFilterUiChanged:{type:Function},onFloatingFilterUiChanged:{type:Function},onAdvancedFilterBuilderVisibleChanged:{type:Function},onFindChanged:{type:Function},onChartCreated:{type:Function},onChartRangeSelectionChanged:{type:Function},onChartOptionsChanged:{type:Function},onChartDestroyed:{type:Function},onCellKeyDown:{type:Function},onGridReady:{type:Function},onGridPreDestroyed:{type:Function},onFirstDataRendered:{type:Function},onGridSizeChanged:{type:Function},onModelUpdated:{type:Function},onVirtualRowRemoved:{type:Function},onViewportChanged:{type:Function},onBodyScroll:{type:Function},onBodyScrollEnd:{type:Function},onDragStarted:{type:Function},onDragStopped:{type:Function},onDragCancelled:{type:Function},onStateUpdated:{type:Function},onPaginationChanged:{type:Function},onRowDragEnter:{type:Function},onRowDragMove:{type:Function},onRowDragLeave:{type:Function},onRowDragEnd:{type:Function},onRowDragCancel:{type:Function},isRowValidDropPosition:{type:Function},onRowResizeStarted:{type:Function},onRowResizeEnded:{type:Function},onColumnRowGroupChanged:{type:Function},onRowGroupOpened:{type:Function},onExpandOrCollapseAll:{type:Function},onPivotMaxColumnsExceeded:{type:Function},onPinnedRowDataChanged:{type:Function},onPinnedRowsChanged:{type:Function},onRowDataUpdated:{type:Function},onAsyncTransactionsFlushed:{type:Function},onStoreRefreshed:{type:Function},onHeaderFocused:{type:Function},onCellClicked:{type:Function},onCellDoubleClicked:{type:Function},onCellFocused:{type:Function},onCellMouseOver:{type:Function},onCellMouseOut:{type:Function},onCellMouseDown:{type:Function},onRowClicked:{type:Function},onRowDoubleClicked:{type:Function},onRowSelected:{type:Function},onSelectionChanged:{type:Function},onCellContextMenu:{type:Function},onRangeSelectionChanged:{type:Function},onCellSelectionChanged:{type:Function},onTooltipShow:{type:Function},onTooltipHide:{type:Function},onSortChanged:{type:Function},height:{},isSorting:{type:Boolean}},emits:["onGridReady","row-clicked","cell-clicked","cell-focused","row-selected","on-scroll"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=H(null);c0(r,()=>{var v;const g=(v=i.value)==null?void 0:v.getApi();g==null||g.clearFocusedCell()});const i=H(null),a=Y(()=>({width:"100%",height:o.height||"500px"})),l=Y(()=>({...o,theme:ORe}));function c(){var v;if(!r.value){console.warn("Grid container element not found");return}const g={...l.value,height:o.height};i.value=new ARe(r.value,g),i.value.init(),(v=i.value.getApi())==null||v.addEventListener("bodyScroll",()=>{s("on-scroll",new Event("scroll"))}),u()}function u(){var v;const g=((v=i.value)==null?void 0:v.getApi())??null;s("onGridReady",g)}function d(g){var C,S;if(!g)return;(C=i.value)==null||C.updateColumnDefs(g);const v=g.map(b=>b.field&&b.width&&!b.hide?{colId:b.field,width:b.width,flex:null}:null).filter(b=>b!==null);(S=i.value)==null||S.setColumnWidth(v)}function h(){var g;(g=i.value)==null||g.destroy(),i.value=null}function f(){var g;return((g=i.value)==null?void 0:g.getApi())||void 0}function p(){return i.value||null}return Qe(()=>o.columnDefs,(g,v)=>{const C=g==null?void 0:g.filter(b=>!b.hide).map(b=>b.field).join(","),S=v==null?void 0:v.filter(b=>!b.hide).map(b=>b.field).join(",");C!==S&&d(g)},{deep:!0}),Jn(()=>{h()}),t({gridApi:f,gridManager:p,syncColumnDefs:d}),en(()=>{c()}),Jn(()=>{h()}),(g,v)=>(K(),ce("div",{ref_key:"gridContainerRef",ref:r,style:hn(a.value),class:se(["ag-theme-quartz",["ag-table-container",o.isSorting?"is-sorting":""]])},null,6))}});function rh(e){return WV(e)}const NRe=()=>[...[{headerName:"Name",field:"name",sortable:!1,filter:!1,pinned:"left",lockPinned:!0,headerComponent:rh(Mc),suppressMovable:!0},{headerName:"Notes",field:"description",sortable:!1,filter:!1,suppressMovable:!1},{headerName:"Assignee",field:"assignees",sortable:!1,filter:!1,headerComponent:rh(Mc)},{headerName:"Status",field:"status",sortable:!1,filter:!1,headerComponent:rh(Mc)},{headerName:"Date Range",field:"dateRange",sortable:!1,filter:!1,headerComponent:rh(Mc)},{headerName:"Last Updated",field:"lastUpdated",sortable:!1,filter:!1,headerComponent:rh(Mc),cellRendererParams:n=>{var o,s,r;return{...n,value:(o=n==null?void 0:n.data)==null?void 0:o.lastUpdated.value,tooltip:((r=(s=n==null?void 0:n.data)==null?void 0:s.lastUpdated)==null?void 0:r.tooltip)||void 0,readOnly:!0}}},{headerName:"Completed On",field:"completedOn",sortable:!1,filter:!1,headerComponent:rh(Mc),cellRendererParams:n=>{var o,s,r;return{...n,value:(o=n==null?void 0:n.data)==null?void 0:o.completedOn.value,tooltip:((r=(s=n==null?void 0:n.data)==null?void 0:s.completedOn)==null?void 0:r.tooltip)||void 0,readOnly:!0}}}].map(n=>Sp.fromType(n))],Mw={WIDTH:60,HEADER_CLASS:"ag-checkbox-header"},LRe=()=>({field:"__checkboxSelection",checkboxSelection:!0,headerCheckboxSelection:!0,pinned:"left",width:Mw.WIDTH,minWidth:Mw.WIDTH,maxWidth:Mw.WIDTH,cellClass:"ag-checkbox-cell",headerClass:Mw.HEADER_CLASS,headerComponent:Py(Ese),suppressMovable:!0}),fG="blank",VRe=[fG,"__checkboxSelection","options"],BRe=["uiColumnResized","uiColumnMoved","api"],$Re={headerName:"",field:"options",sortable:!1,filter:!1,editable:!0,pinned:"right",lockPosition:!0,suppressMovable:!0,resizable:!1},pG=(e,t)=>t!=null&&t.width?{...e,width:t.width,flex:void 0}:e,HRe=(e,t,n)=>{const{getCachedValue:o,setCachedValue:s}=cf({dbName:"item_table_column_configs",storeName:"column_configs"}),r=async()=>{const d=await o(t);if(!d||typeof d!="string")return null;try{const h=JSON.parse(d);return Array.isArray(h)?h:null}catch(h){return console.error("Failed to parse cached column config:",h),null}},i=H([]),a=LRe();let l=0;const c=async d=>{const h=++l,f=await r();if(h!==l)return;const p=[];f==null||f.forEach(F=>{const{field:z,hide:j,width:Q,pinned:re}=F;p.push([z,j])});const g=new Map(p),v=NRe(),C=Sp.fromType($Re),S=!!f,y=((d==null?void 0:d.map(F=>{var z;return{headerName:F.name,field:`metric_${F.id}`,editable:((z=F==null?void 0:F.auth_permission)==null?void 0:z.permission)==2,sortable:!0,filter:!1,flex:1,context:{...F},hide:S?!g.get(`metric_${F.id}`):!(F.is_primary||F.is_point_metric),cellClass:"ag-cell-optimized",headerComponent:Py(Mc),headerComponentParams:()=>({headerType:F.metric_type.code=="number"||F.metric_type.code=="formula"?"number":"default"})}}))||[]).map(F=>Sp.fromType(F)),_=[a,...v,...y,C],E=[],D=[],T=[];for(const F of _)F.pinned==="left"?E.push(F):F.pinned==="right"||F.field===fG?D.push(F):T.push(F);if(!f||f.length===0){i.value=_;return}const P=new Map(f.map(F=>[F.field,F])),L=new Map(T.map(F=>[F.field,F])),I=[];for(const F of f)if(F.field&&L.has(F.field)){const z=L.get(F.field);I.push({...pG(z,F),hide:F.hide}),L.delete(F.field)}const x=Array.from(L.values()),O=[...I,...x].map(F=>({...F,lockPinned:!0})),N=F=>pG(F,P.get(F.field));i.value=[...E.map(N),...O,...D.map(N)]};Qe(e,d=>c(d),{immediate:!0});const u=mr((d,h)=>{if((d==null?void 0:d.source)!==void 0&&!BRe.includes(d.source))return;const f=n.value,p=f==null?void 0:f.getColumnDefs(),g=new Map;if(f==null||f.getColumnState().forEach(C=>{C.width&&g.set(C.colId,Number(C.width))}),i.value=p||i.value,!h)return;const v=(p??[]).filter(C=>C.field&&!VRe.includes(C.field)).map(C=>({field:C.field,hide:C.hide,width:g.get(C.field)||C.width,pinned:C.pinned}));s(t,JSON.stringify(v))},Ci);return GT(()=>u.cancel()),{columnDefs:i,checkboxColumn:a,saveColumnConfig:u}},GRe=()=>{const e=fn.getInstance().getItem("API_BASE_URL");return e!=null&&e.includes("v1")?e.slice(0,e.lastIndexOf("/v1")):String(e)},URe=e=>{var x,O,N;const{showMessage:t,showErrorNetMessage:n}=Es(),o=ro(),s={domainApi:GRe(),wsCode:fn.getInstance().getItem("ws.code"),entityId:e.value.entityId},r=(N=(O=(x=o==null?void 0:o.appContext)==null?void 0:x.config)==null?void 0:O.globalProperties)==null?void 0:N.apiConfig;if(!r||s.domainApi===""||s.wsCode==="")throw new Error("API configuration is missing in useItems");const i=new JM(r,s);i.on("call-api",F=>{F.success?t(F.apiCode,"success"):n(F)});const a=Go({}),l=H([]),c=H(!1),u=H(null),d=H(null),h=H(1),f=H(20);let p=Promise.resolve();const{setCachedUsers:g}=MY(),v=F=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",include_permission:"{include_permission}",include_permission_names:!0,q:F}),C=50,S=async(F,z,j)=>{if(!F.length)return[];const Q=Yj(F,z);return(await Promise.all(Q.map(j))).flat()},b=async F=>{try{return(await i.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:F})).data.map(j=>[j==null?void 0:j.id,j.permission])}catch(z){return console.error("Failed to fetch item permissions chunk:",z),[]}},y=async(F,z)=>{try{const j=await i.getMetricValues({workspaceId:e.value.workspaceId,item_ids:F,per_page:F.length*z.length,metric_ids:z}),Q=j.data.map(q=>{const V=new Map(q.item_metrics.map(G=>[G.metric_id,{value:G.value,auth_permission:G==null?void 0:G.auth_permission}])),k=Object.fromEntries(z.map(G=>[G,V.get(G)??null]));return[q==null?void 0:q.id,k]}),re=new Set(j.data.map(q=>q==null?void 0:q.id));for(const q of F)if(!re.has(q)){const V=Object.fromEntries(z.map(k=>[k,{value:null,auth_permission:void 0}]));Q.push([q,V])}return Q}catch(j){return console.error("Failed to fetch a chunk of metric values:",j),F.map(re=>[re,Object.fromEntries(z.map(q=>[q,void 0]))])}},_=async F=>{try{const z=await i.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:F,per_page:F.length}),j=z.data.flatMap(Q=>Q.assignees);return g(j),z.data.map(Q=>[Q==null?void 0:Q.id,Q==null?void 0:Q.assignees])}catch(z){return console.error("Failed to fetch a chunk of assigned users:",z),[]}},E=async F=>{if(!F.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const z=await S(F,C,b);return Object.fromEntries(z)}catch(z){return console.error("Failed to fetch item permissions:",z),{}}},D=async(F,z)=>!F.length||!z.length?{}:(p=p.then(async()=>{try{const re=[];let q=0;for(let k=0;k<z.length;k+=5){q++;const G=z.slice(k,k+5),ee=[];for(let Fe=0;Fe<G.length;Fe++){const Ge=G[Fe],fe=await S(F,C,X=>y(X,[Ge]));ee.push(fe),await new Promise(X=>setTimeout(X,500))}re.push(...ee);const ge=k+5>=z.length}const V={};for(const k of re.flat()){const[G,ee]=k;V[G]||(V[G]={}),Object.assign(V[G],ee)}return V}catch(j){return console.error("Failed to fetch metric values:",j),{}}}),p),T=async F=>{if(!F.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const z=await S(F,C,_);return Object.fromEntries(z)}catch(z){return console.error("Failed to fetch assigned users:",z),{}}};return{items:l,loading:c,error:u,pagination:d,currentPage:h,pageSize:f,cusorMap:a,fetchItems:async F=>{const{cursor:z,offset:j,size:Q,searchQuery:re}=F;let q=[];c.value=!0,u.value=null;try{const V=await i.getAllItem_cursor({...F,cursor:z||void 0,offset:j||void 0,pageSize:Q||f.value,...v(re),sortBy:F.sort_by});return l.value=V.data,d.value=V.meta,h.value=V.meta.current_page||0,q=V.data.map(k=>k==null?void 0:k.id),V}catch(V){throw u.value=V,console.error("Failed to fetch items (cursor):",V),V}finally{const V=async()=>{try{const[k,G]=await Promise.all([T(q),E(q)]);e.value.updateItemData({assignees:k,permission:G},q);const ee=await D(q,e.value.metricIds);e.value.setMetricValues(ee,new Set(q),e.value.metricIds)}catch(k){console.error("Post-fetch processing failed:",k)}};c.value=!1,setTimeout(V)}},getAssignableStatus:async F=>{try{return await i.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:F})}catch(z){throw console.error("Failed to fetch assignable status:",z),z}},getMetricList:async F=>{try{return await i.getMetricList({workspaceId:e.value.workspaceId,entityId:F})}catch(z){throw console.error("Failed to fetch metric list:",z),z}},getMetricValues:D,getAssignedUsers:T}};function WRe(e){return{updateRowData:(o,s)=>{if(!e.value)return;const r=[],i=new Set,a=e.value.getColumnDefs();if(!a)return;const l=a.map(c=>{if(c.field&&c.field.startsWith("metric_")&&(c.hide===!1||c.hide===void 0))return c.field}).filter(Boolean);s.forEach(c=>{var d;const u=(d=e.value)==null?void 0:d.getRowNode(c);if(u){if(r.push(u),o.assignees){const h=SY((o.assignees[c]||[]).map(aF));u.data.assignees=h,i.add("assignees")}o.permission&&(u.data.permissions=o.permission[c]),l.forEach(h=>{u.data[h]=u.data[h]??null})}}),i.add("assignees"),i.add("status"),i.add("dateRange"),i.add("moreActions"),i.add("name"),i.add("description"),e.value.refreshCells({rowNodes:r,columns:Array.from(i),force:!0})},setMetricValues:(o,s,r)=>{const i=e.value;if(!i)return;const a=new Map(Array.from(s).map(c=>[c,new Map(r.map(u=>[u,{value:null,auth_permission:void 0}]))]));Object.entries(o).forEach(([c,u])=>{Object.entries(u).forEach(([d,h])=>{var f;(f=a.get(c))==null||f.set(d,{value:h==null?void 0:h.value,auth_permission:h==null?void 0:h.auth_permission})})});const l=Array.from(a.entries()).map(([c,u])=>{const d=i.getRowNode(c);return d!=null&&d.data?(u.forEach((h,f)=>{const p=`metric_${f}`;d.data[p]=(h==null?void 0:h.value)||null;const g=`metric_permission_${f}`;d.data[p]=(h==null?void 0:h.value)||null,d.data[g]=(h==null?void 0:h.auth_permission)||null}),d):null});l.length>0&&i.refreshCells({rowNodes:l,columns:Array.from(r).map(c=>`metric_${c}`),force:!0})}}}function zRe(e,t,n,o,s){let r=!0;return{async getRows(i){try{o(!0),r&&(s(!0),r=!1);const a=Math.floor(i.startRow/t)+1,{rows:l,total:c}=await e({page:a,pageSize:t,filterText:n(),sort_by:i.sortModel});let u=-1;Number.isFinite(c)?u=c:l.length<t&&(u=i.startRow+l.length),i.context={pageSize:t,text:n()},i.successCallback(l,u),o(!1),s(!1)}catch(a){console.error("Datasource fetch error:",a),i.failCallback(),o(!1),s(!1)}}}}function jRe(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:o,gridApi:s,fetcher:r}=e,i=H(!0),a=H(!0),l=H(!1),c=()=>{n.value=!n.value},u=v=>{if(i.value=!1,s.value=v,!v)return null;const{addEventListener:C,setGridOption:S}=v;if(!r)return console.error("Fetcher function is undefined"),null;const b=zRe(r,e.perPage,()=>o.value,y=>{i.value=y},y=>{a.value=y});return S==null||S("datasource",b),C==null||C("selectionChanged",()=>{t.value=v.getSelectedRows()}),v||null},d=v=>{var C,S;if((C=s.value)==null||C.hideOverlay(),v!==void 0&&(o.value=v),(S=s.value)==null||S.deselectAll(),t.value=[],i.value=!0,!s.value||!r){console.error("Grid API or fetcher is not available"),i.value=!1;return}l.value=!0,a.value=!0,s.value.purgeInfiniteCache(),s.value.ensureIndexVisible(0,"top"),setTimeout(()=>{i.value=!1,setTimeout(()=>{l.value=!1},100)},300)},h=()=>{var v;(v=s.value)==null||v.deselectAll(),t.value=[]},f=mr(v=>{d(v)},Ci);return{isLoading:i,toggleSidebar:c,onGridReady:u,onSearch:f,handleUnSelect:h,firstLoad:a,cacheCleared:l,handleSelectAll:()=>{s.value},isSelectAll:H(!1)}}const KRe={changelog:{"1.0.1":{date:"2024-06-20",changes:["Fixed styling issues for archived and deleted rows."]},"1.0.0":{date:"2024-06-15",changes:["Initial release of the Item Table package."]},"0.0.1-alpha.8":{date:"2024-06-10",changes:["Improved performance of row updates.","Added support for custom cell renderers.","Add row hover effect for better UX.","Add loading skeleton for filter","Beta release with core functionalities implemented."]},"0.0.1-alpha.9":{date:"2024-06-05",changes:["Add row selection feature.","Fix bug with column resizing.","Optimize rendering for large datasets.","Implement getLog function to retrieve changelog entries based on version.","Display app version and changelog in the Item Table component tooltip.","Clean up unused autocomplete and memoized config composables.","Update styles for better consistency and readability."]},"0.0.1-alpha.11":{date:"2024-06-18",changes:["Add bulk process status display: items now show an hourglass icon and tooltip when being processed.","Update data model: added isProcessing and bulk_process properties to track item status.","Improve row focus: focused rows now flash for better visibility.","Set 'Last Updated' and 'Completed On' columns as read-only.","Fix: resolve visual fetching issue in useRemoteFiles composable.","Fix: use correct upload icon in PopupCreateScenes component.","Enhance data conversion to include processing status in item rows."]},"0.0.1-alpha.12":{date:"2024-06-12",changes:["feat: enhance Snackbar component and notification handling","Refactor Snackbar.vue for improved readability and styling, including color adjustments for icons and text.","Add showMessage function in notifications store to display messages based on API keys, improving notification management.","Introduce notificationMessage constant to centralize notification messages for various API actions, enhancing maintainability.","Remove unnecessary console logs from useRemoteFiles and improve logging in notification store for better debugging."]},"0.0.1-alpha.16":{date:"2024-06-20",changes:["Add onboarding tour feature and enhance UI components with new dependencies","Refactor UI components for improved styling and functionality","Updated RatingComponent.vue to streamline class bindings and improve accessibility attributes.","Enhanced SearchBox.vue by adding a clear event handler and simplifying icon rendering.","Modified AssigneeGroupEditor.vue and AssigneeGroupRenderer.vue to remove unnecessary size attributes from icons.","Adjusted DateRangeRenderer.vue to remove size attributes from icons for consistency.","Updated HeaderCheckbox.vue to set dropdown placement to 'bottom-start'.","Refined HeaderSorting.vue to simplify sort option labels and improve sorting logic.","Enhanced HeaderWrapper.vue to utilize reactive properties for sorting state.","Improved HyperLinkEditor.vue and HyperLinkInlineEditor.vue by removing size attributes from icons.","Updated PopupLayout.vue to use a CSS variable for box-shadow styling.","Refined Snackbar.vue to standardize icon colors and improve styling consistency.","Adjusted useTippy.ts to set default placement and arrow visibility for tooltips.","Modified notificationMessage.ts to remove error messages for list fetching.","Cleaned up notifications.ts by removing console logs for a cleaner codebase.","Updated sortStore.ts to comment out unnecessary console logs for better performance.","Enhanced styles.scss by defining new icon size variables and standardizing box-shadow styles."]},"0.0.99":{date:"2024-06-24",changes:["Fix: resolve issue with incorrect version display in Item Table component.","Update changelog retrieval logic to ensure accurate version matching.","Enhance tooltip display for app version and changelog in Item Table component."]}}},qRe=e=>{var t;return(t=Object.entries(KRe.changelog).find(([n,o])=>n===e))==null?void 0:t[1].changes},YRe={class:"visual-btn-visual"},XRe={class:"visual-btn--label"},ZRe={key:0,class:"visual-btn--description"},JRe={key:1,class:"visual-btn--description"},QR=bt(tt({__name:"VisualButton",props:{label:{},description:{},disabled:{type:Boolean}},emits:["onClick"],setup(e,{emit:t}){const n=e,o=()=>{n.disabled||s("onClick")},s=t;return(r,i)=>(K(),ce("div",{class:se(["visual-btn",{"visual-btn--disabled":e.disabled}]),onClick:o},[Te("div",YRe,[xt(r.$slots,"visual",{},()=>[i[0]||(i[0]=mz('<svg width="42" height="36" viewBox="0 0 42 36" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-c2003bd7><g clip-path="url(#clip0_4824_13082)" data-v-c2003bd7><path d="M5.14286 18V10.2857H18V18H5.14286ZM5.14286 23.1 429H18V30.8571H5.14286V23.1429ZM23.1429 30.8571V23.1429H36V30.8571H23.1429ZM36 18H23.1429V10.2857H36V18ZM5.14286 0C2.30625 0 0 2.30625 0 5.14286V30.8571C0 33.6937 2.30625 36 5.14286 36H36C38.8366 36 41.1429 33.6937 41.1429 30.8571V5.14286C41.1429 2.30625 38.8366 0 36 0H5.14286Z" fill="#D7D7D7" data-v-c2003bd7></path><path d="M0 5.14286C0 2.30625 2.30625 0 5.14286 0H36C38.8366 0 41.1429 2.30625 41.1429 5.14286V10.318H0V5.14286Z" fill="#A6A6A6" data-v-c2003bd7></path></g><defs data-v-c2003bd7><clipPath id="clip0_4824_13082" data-v-c2003bd7><rect width="41.1429" height="36" fill="white" data-v-c2003bd7></rect></clipPath></defs></svg>',1))],!0)]),Te("div",XRe,it(n.label),1),n.disabled?(K(),ce("div",ZRe," Coming soon ")):(K(),ce("div",JRe,it(n.description),1))],2))}}),[["__scopeId","data-v-c2003bd7"]]),eT="xlsx_toolbox",QRe="TOOLBOX_EXPORT_DATA",eTe="https://app.arbocollab.com",tTe=1e3,gG=()=>sessionStorage.getItem("BASE_URL"),mG=(e,t="xlsx-mapping")=>{const n=In("switchInstance",void 0),o=`${t}:load`,s=`${t}:edit`,r=new Set;let i;const a=()=>{const h={showLoad:!1};n?n(eT,"",h):window.appManager.switchInstance(eT,"",h)},l=(h,f)=>{console.log("Posting to Toolbox:",{type:h,payload:f});const p=setTimeout(()=>{r.delete(p),window.postMessage({type:h,payload:f},`${gG()}`)},tTe);r.add(p)},c=h=>{const f=h==null?void 0:h.source,p=h==null?void 0:h.template;if(!p)throw new Error("template file is missing");a(),l(o,{source:f,template:p})},u=(h,f)=>{if(!h)throw new Error("Error file is missing");a(),l(s,{file:h})},d=h=>{if((h==null?void 0:h.type)!==QRe)return;const{file:f,fileName:p}=h.payload;e(new File([f],p,{type:f.type}),p),window.appManager.hide(eT)};return en(()=>{i=Bte({target:window,allowedOrigins:[gG()||eTe],onMessage:d,onInvalidMessage:(h,f,p)=>{console.warn("Rejected postMessage:",f,p.origin)}})}),Jn(()=>{i==null||i(),r.forEach(clearTimeout),r.clear()}),{openToolbox:c,sendBackErrorFile:u}},nTe={class:"header-name"},oTe={class:"modal-body"},sTe={class:"description"},rTe={key:0,class:"error-message"},iTe={class:"dynamic"},aTe={key:1,class:"choose-method-container"},lTe={key:2,class:"select-status-container"},cTe={key:3,class:"result-container"},uTe={key:4,class:"result-container"},dTe={key:2},vG="text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",hTe=20,fTe=bt(tt({__name:"PopupToolboxUploader",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const o=Kt,s=Y(()=>[1,2].includes(f.value)),r=Y(()=>DS()),i=Y(()=>({1:{title:`Create ${r.value} in bulk`,description:""},2:{title:"Select status",description:"Choose the starting status for the new work."},3:{title:"Import successful",description:"Work will be created in background. Refresh to see updates."},4:{title:"Import failed",description:"Some data doesn't meet the requirements. Review it and try again."},5:{title:"Waiting for Toolbox",description:"Waiting for Toolbox"}})),a={"--popup-pt":"20px","--popup-pb":"20px","--popup-pl":"24px","--popup-pr":"24px"},l=e,c=n,{apiServices:u}=io(!1,l),d=1,h=H(),f=H(d),p=H(null),g=H(null),v=H(null),C=H(void 0),S=H(null),b=Y(()=>i.value[f.value]),y=H(),_=()=>{var V;p.value=null,f.value=d,g.value=null,v.value=null,E.value=null,S.value=null,(V=y.value)==null||V.clear(),C.value=void 0};Qe([g,v],([V,k])=>{f.value===1&&V&&k&&(f.value=2)});const E=H(null),D=V=>Es().getErrorMessageFromResponse(V),T=V=>{if(console.error(V),typeof V=="string"){E.value=V;return}const k=V.response,G=k==null?void 0:k.data,ee=D(G);E.value=ee??V.message,console.log("Error message set to:",{errorMsg:ee,message:V})},P=async(V,k)=>{var ee;if(Q.value=!0,!u.value||!l.workspaceId||!l.entityId){console.error("API services not available");return}const G=new FormData;G.append("file",V),G.append("format",((ee=k??V.name)==null?void 0:ee.split(".").pop())??V.name.split(".").pop()??""),G.append("entity_id",l.entityId),G.append("template_flow_status_id",p.value??"");try{await u.value.addNewSceneViaImportFile(l.workspaceId,l.entityId,G),f.value=3,c("import-success")}catch(ge){console.error("Error uploading file:",ge),T(ge||"An unknown error occurred during file upload."),f.value=4}finally{Q.value=!1}},{openToolbox:L,sendBackErrorFile:I}=mG((V,k)=>{v.value=V,C.value=k??V.name,f.value=2}),x=async()=>{const V=await N();try{L({template:V})}catch(k){console.error("Error opening toolbox:",k),Es().showErrorNetMessage("Failed to open toolbox.")}},O=H(!1),N=async()=>{O.value=!0;const V=l.workspaceId,k=l.entityId;if(!V||!k||!u.value)return console.error("Workspace ID or Entity ID is missing"),Promise.reject(new Error("Workspace ID or Entity ID is missing"));try{const G=await u.value.downloadTemplate(V,k,!1);if(!G)throw new Error("No response from downloadTemplate API");return G}catch(G){return console.error("Error downloading template:",G),Promise.reject(G)}finally{O.value=!1}},F=V=>{const k=vG.includes(V.type);return k||(console.error("Invalid file type:",V.type),Es().addNotification({id:"invalid-file-type",message:"Invalid file type. Please upload a xlsx, xls, csv file.",type:"error"})),k},z=async()=>{const V=document.createElement("input");V.type="file",V.accept=vG,V.onchange=async()=>{var G;const k=(G=V.files)==null?void 0:G[0];if(k){if(!F(k)){_();return}g.value=Hm(k);try{const ee=await N();if(!ee){Es().addNotification({id:"failed-download-template",message:"Failed to download template file.",type:"error"});return}L({source:k,template:ee})}catch(ee){console.error("Error opening toolbox:",ee),Es().addNotification({id:"failed-open-toolbox",message:"Failed to open toolbox.",type:"error"})}}},V.click()},j=async V=>{var k;if(!((k=u.value)!=null&&k.getAssignableStatuses)){console.error("API services not available");return}return u.value.getAssignableStatuses(l.workspaceId,{entity_id:l.entityId,name_like:V.name_like,page:V.page,per_page:hTe})},Q=H(!1),re=()=>{p.value=null,v.value&&C.value&&I(v.value,C.value)},q=()=>{p.value&&v.value&&(Q.value=!0,P(v.value,C.value).finally(()=>{Q.value=!1}))};return t({open:()=>{var V;return(V=h.value)==null?void 0:V.show()},close:()=>{var V;return(V=h.value)==null?void 0:V.hide()}}),(V,k)=>(K(),ze(W(ON),jt({ref_key:"popupRef",ref:h,style:a,onHidden:_},{popupIndex:10,popupName:b.value.title,minWidth:"420px",showOverlay:!0,overlayOpacity:.5,closeOnOverlayClick:!1,closeOnEscape:!0,showCloseBtn:s.value}),Lh({header:be(()=>[Te("span",nTe,it(b.value.title),1)]),default:be(()=>[Te("div",oTe,[Te("div",sTe,it(b.value.description),1),E.value&&f.value===4?(K(),ce("div",rTe,[k[3]||(k[3]=nt(" Error code ",-1)),Te("span",iTe,it(E.value),1)])):Xe("",!0),f.value===1?(K(),ce("div",aTe,[ye(QR,{disabled:!1,label:"Start with a blank sheet",description:`Type or paste ${r.value} details
|
|
254
|
+
`,OEe=class extends cbe{constructor(e){super(e),this.config=e,this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:n}=e;this.suppressQuotes=t,this.columnSeparator=n}addCustomContent(e){e&&(typeof e=="string"?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,aG),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((n,o)=>{o!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(n.data.value||""),n.mergeAcross&&this.appendEmptyCells(n.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,n,o){n!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(o)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){t!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,n){t!=0&&(this.result+=this.columnSeparator);const o=this.extractRowCellValue(e,t,t,"csv",n);this.result+=this.putInQuotes(o.valueFormatted??o.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(e==null)return'""';let t;return typeof e=="string"?t=e:typeof e.toString=="function"?t=e.toString():(Je(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=aG),this.isFirstLine=!1}},MEe=class extends lbe{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.rowGroupColsSvc=e.rowGroupColsSvc,this.valueSvc=e.valueSvc}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){Je(51);return}const t=this.getMergedParams(e),n=this.getData(t),o=new Blob(["\uFEFF",n],{type:"text/plain"}),s=typeof t.fileName=="function"?t.fileName(Ot(this.gos,{})):t.fileName;ube(this.getFileName(s),o)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const n=t?Object.assign({},e):this.getMergedParams(e);return this.getData(n)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{colModel:t,colNames:n,rowGroupColsSvc:o,valueSvc:s,gos:r}=this,{processCellCallback:i,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:u,columnSeparator:d}=e;return new OEe({colModel:t,colNames:n,valueSvc:s,gos:r,processCellCallback:i||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:u||!1,columnSeparator:d||",",rowGroupColsSvc:o})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function NEe(e,t){var n;return(n=e.csvCreator)==null?void 0:n.getDataAsCsv(t)}function LEe(e,t){var n;(n=e.csvCreator)==null||n.exportDataAsCsv(t)}var VEe={moduleName:"CsvExport",version:ut,beans:[MEe],apiFunctions:{getDataAsCsv:NEe,exportDataAsCsv:LEe},dependsOn:[AEe]},BEe=class extends je{constructor(e,t,n){super(),this.id=e,this.parentCache=t,this.params=n,this.state="needsLoading",this.version=0,this.startRow=e*n.blockSize,this.endRow=this.startRow+n.blockSize}load(){this.state="loading",this.loadFromDatasource()}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed"),this.dispatchLocalEvent({type:"loadComplete"})}pageLoaded(e,t,n){this.successCommon(e,{rowData:t,rowCount:n})}isRequestMostRecentAndLive(e){const t=e===this.version,n=this.isAlive();return t&&n}successCommon(e,t){this.dispatchLocalEvent({type:"loadComplete"}),this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}postConstruct(){this.rowNodes=[];const{params:{blockSize:e,rowHeight:t},startRow:n,beans:o,rowNodes:s}=this;for(let r=0;r<e;r++){const i=n+r,a=new kl(o);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(i),a.setRowTop(t*i),s.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:n,state:o}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:n,pageStatus:o}}}setDataAndId(e,t,n){ht(t)?e.setDataAndId(t,n.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Gn(this.params.datasource.getRows)){Je(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:n,params:{sortModel:o,filterModel:s},gos:r}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,n),failCallback:this.pageLoadFailed.bind(this,n),sortModel:o,filterModel:s,context:Ot(r,{}).context}}forEachNode(e,t,n){this.rowNodes.forEach((o,s)=>{this.startRow+s<n&&e(o,t.value++)})}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.value++);const n=e-this.startRow;return this.rowNodes[n]}processServerResult(e){const{rowNodes:t,beans:n}=this;t.forEach((s,r)=>{const i=e.rowData?e.rowData[r]:void 0;!s.id&&s.alreadyRendered&&i&&(t[r]=new kl(n),t[r].setRowIndex(s.rowIndex),t[r].setRowTop(s.rowTop),t[r].setRowHeight(s.rowHeight),s.clearRowTopAndRowIndex()),this.setDataAndId(t[r],i,this.startRow+r)});const o=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,o)}destroy(){for(const e of this.rowNodes)e.clearRowTopAndRowIndex();super.destroy()}},$Ee=2,HEe=class extends je{constructor(e){super(),this.params=e,this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount}getRow(e,t=!1){const n=Math.floor(e/this.params.blockSize);let o=this.blocks[n];if(!o){if(t)return;o=this.createBlock(n)}return o.getRow(e)}createBlock(e){const t=this.params,n=this.createBean(new BEe(e,this,t));return this.blocks[n.id]=n,this.blockCount++,this.purgeBlocksIfNeeded(n),t.rowNodeBlockLoader.addBlock(n),n}refreshCache(){if(this.blockCount==0){this.purgeCache();return}for(const t of this.getBlocksInOrder())t.setStateWaitingToLoad();this.params.rowNodeBlockLoader.checkBlockToLoad()}destroy(){for(const e of this.getBlocksInOrder())this.destroyBlock(e);super.destroy()}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(Rl(this.gos,`InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(i=>i!=e),n=(i,a)=>a.lastAccessed-i.lastAccessed;t.sort(n);const o=this.params.maxBlocksInCache>0,s=o?this.params.maxBlocksInCache-1:null,r=$Ee-1;t.forEach((i,a)=>{const l=i.state==="needsLoading"&&a>=r,c=o?a>=s:!1;if(l||c){if(this.isBlockCurrentlyDisplayed(i)||this.isBlockFocused(i))return;this.removeBlockFromCache(i)}})}isBlockFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const{startRow:n,endRow:o}=e;return t.rowIndex>=n&&t.rowIndex<o}isBlockCurrentlyDisplayed(e){const{startRow:t,endRow:n}=e;return this.beans.rowRenderer.isRangeInRenderedViewport(t,n-1)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if(typeof t=="number"&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const{blockSize:n,overflowSize:o}=this.params,r=(e.id+1)*n+o;this.rowCount<r&&(this.rowCount=r)}}setRowCount(e,t){this.rowCount=e,ht(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t={value:0};for(const n of this.getBlocksInOrder())n.forEachNode(e,t,this.rowCount)}getBlocksInOrder(){const e=(n,o)=>n.id-o.id;return Object.values(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.id],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){this.isAlive()&&(this.destroyAllBlocksPastVirtualRowCount(),this.eventSvc.dispatchEvent({type:"storeUpdated"}))}destroyAllBlocksPastVirtualRowCount(){const e=[];for(const t of this.getBlocksInOrder())t.id*this.params.blockSize>=this.rowCount&&e.push(t);if(e.length>0)for(const t of e)this.destroyBlock(t)}purgeCache(){for(const e of this.getBlocksInOrder())this.removeBlockFromCache(e);this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const n=[];let o=-1,s=!1;const r={value:0};let i=!1;for(const l of this.getBlocksInOrder())if(!i){if(s&&o+1!==l.id){i=!0;continue}o=l.id,l.forEachNode(c=>{const u=c===e||c===t;(s||u)&&n.push(c),u&&(s=!s)},r,this.rowCount)}return i||s?[]:n}},GEe=class extends je{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(){return!1}postConstruct(){if(this.gos.get("rowModelType")!=="infinite")return;const e=this.beans,t=new kl(e);this.rootNode=t,t.level=-1,this.rowHeight=zc(e),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache())}start(){this.setDatasource(this.gos.get("datasource"))}destroy(){this.destroyDatasource(),super.destroy(),this.rootNode=null}destroyDatasource(){this.datasource&&(this.destroyBean(this.datasource),this.beans.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedEventListeners({filterChanged:this.reset.bind(this),sortChanged:this.reset.bind(this),newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.dispatchModelUpdatedEvent.bind(this)}),this.addManagedPropertyListener("datasource",()=>this.setDatasource(this.gos.get("datasource"))),this.addManagedPropertyListener("cacheBlockSize",()=>this.resetCache()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=zc(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){var t;let e;this.cacheParams?e=!Ep(this.cacheParams.sortModel,((t=this.beans.sortSvc)==null?void 0:t.getSortModel())??[]):e=!0,e&&this.reset()}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){var n;return((n=this.infiniteCache)==null?void 0:n.getRowNodesInRange(e,t))??[]}reset(){var n;if(!this.datasource)return;Bd(this.gos)!=null||(n=this.beans.selectionSvc)==null||n.reset("rowDataChanged"),this.resetCache()}dispatchModelUpdatedEvent(){this.eventSvc.dispatchEvent({type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1})}resetCache(){this.destroyCache();const e=this.beans,{filterManager:t,sortSvc:n,rowNodeBlockLoader:o,eventSvc:s,gos:r}=e;this.cacheParams={datasource:this.datasource,filterModel:(t==null?void 0:t.getFilterModel())??{},sortModel:(n==null?void 0:n.getSortModel())??[],rowNodeBlockLoader:o,initialRowCount:r.get("infiniteInitialRowCount"),maxBlocksInCache:r.get("maxBlocksInCache"),rowHeight:zc(e),overflowSize:r.get("cacheOverflowSize"),blockSize:r.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new HEe(this.cacheParams)),s.dispatchEventOnce({type:"rowCountReady"}),this.dispatchModelUpdatedEvent()}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)}),this.dispatchModelUpdatedEvent()}destroyCache(){this.infiniteCache=this.destroyBean(this.infiniteCache)}getRow(e){const t=this.infiniteCache;if(t&&!(e>=t.getRowCount()))return t.getRow(e)}getRowNode(e){let t;return this.forEachNode(n=>{n.id===e&&(t=n)}),t}forEachNode(e){var t;(t=this.infiniteCache)==null||t.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),n=this.getRowCount()-1;return t>n?n:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){var e;(e=this.infiniteCache)==null||e.refreshCache()}purgeCache(){var e;(e=this.infiniteCache)==null||e.purgeCache()}isLastRowIndexKnown(){var e;return((e=this.infiniteCache)==null?void 0:e.isLastRowIndexKnown())??!1}setRowCount(e,t){var n;(n=this.infiniteCache)==null||n.setRowCount(e,t)}resetRowHeights(){}onRowHeightChanged(){}};function UEe(e){var t;(t=Iw(e))==null||t.refreshCache()}function WEe(e){var t;(t=Iw(e))==null||t.purgeCache()}function zEe(e){var t;return(t=Iw(e))==null?void 0:t.getRowCount()}var jEe=class extends je{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=Mue(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=qo(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){Qr(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad()}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),this.maxConcurrentRequests!=null&&this.activeBlockLoadsCount>=this.maxConcurrentRequests){Rl(this.gos,"RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.maxConcurrentRequests!=null?this.maxConcurrentRequests-this.activeBlockLoadsCount:1,t=this.blocks.filter(n=>n.state==="needsLoading").slice(0,e);this.activeBlockLoadsCount+=t.length;for(const n of t)n.load();this.printCacheStatus()}getBlockState(){const e={};return this.blocks.forEach(t=>{const{id:n,state:o}=t.getBlockStateJson();e[n]=o}),e}printCacheStatus(){Rl(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},KEe={moduleName:"InfiniteRowModelCore",version:ut,rowModels:["infinite"],beans:[GEe,jEe]},qEe={moduleName:"InfiniteRowModel",version:ut,apiFunctions:{refreshInfiniteCache:UEe,purgeInfiniteCache:WEe,getInfiniteRowCount:zEe},dependsOn:[KEe,aEe]},YEe="↑",XEe="↓",ZEe={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},JEe=class extends Sn{constructor(){super(ZEe),this.eValue=dt,this.eDelta=dt,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const n=Math.abs(t),o=e.formatValue(n),s=ht(o)?o:n,r=t>=0,i=this.eDelta;r?i.textContent=YEe+s:i.textContent=XEe+s,i.classList.toggle("ag-value-change-delta-up",r),i.classList.toggle("ag-value-change-delta-down",!r)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),Ko(this.eDelta)}refresh(e,t=!1){var c;const{value:n,valueFormatted:o}=e,{eValue:s,lastValue:r,beans:i}=this;if(n===r||(ht(o)?s.textContent=o:ht(n)?s.textContent=n:Ko(s),(c=i.filterManager)!=null&&c.isSuppressFlashingCellsBecauseFiltering()))return!1;const a=n&&typeof n=="object"&&"toNumber"in n?n.toNumber():n,l=r&&typeof r=="object"&&"toNumber"in r?r.toNumber():r;if(a===l)return!1;if(typeof a=="number"&&typeof l=="number"){const u=a-l;this.showDelta(e,u)}return r&&s.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=n,!0}},QEe=".ag-value-slide-out{opacity:1}:where(.ag-ltr) .ag-value-slide-out{margin-right:5px;transition:opacity 3s,margin-right 3s}:where(.ag-rtl) .ag-value-slide-out{margin-left:5px;transition:opacity 3s,margin-left 3s}:where(.ag-ltr,.ag-rtl) .ag-value-slide-out{transition-timing-function:linear}.ag-value-slide-out-end{opacity:0}:where(.ag-ltr) .ag-value-slide-out-end{margin-right:10px}:where(.ag-rtl) .ag-value-slide-out-end{margin-left:10px}",e_e={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},t_e=class extends Sn{constructor(){super(e_e),this.eCurrent=dt,this.refreshCount=0,this.registerCSS(QEe)}init(e){this.refresh(e,!0)}addSlideAnimation(){var s;this.refreshCount++;const e=this.refreshCount;(s=this.ePrevious)==null||s.remove();const{beans:t,eCurrent:n}=this,o=uo({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=o,o.textContent=n.textContent,this.getGui().insertBefore(o,n),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{var r;e===this.refreshCount&&((r=this.ePrevious)==null||r.remove(),this.ePrevious=null)},3e3)})}refresh(e,t=!1){var s;let n=e.value;if(Gn(n)&&(n=""),n===this.lastValue||(s=this.beans.filterManager)!=null&&s.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=n;const o=this.eCurrent;return ht(e.valueFormatted)?o.textContent=e.valueFormatted:ht(e.value)?o.textContent=n:Ko(o),!0}},n_e=class extends je{constructor(){super(...arguments),this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(e,t,n=this.beans.gos.get("cellFlashDuration"),o=this.beans.gos.get("cellFadeDuration")){const s=this.animations[t];s.delete(e);const r=Date.now(),i=r+n,a=r+n+o,l={phase:"flash",flashEndTime:i,fadeEndTime:a};s.set(e,l);const c=`ag-cell-${t}`,u=`${c}-animation`,{comp:d,eGui:{style:h}}=e;d.toggleCss(c,!0),d.toggleCss(u,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&i+15<this.nextAnimationTime&&(clearTimeout(this.nextAnimationCycle),this.nextAnimationCycle=null,this.nextAnimationTime=null),this.nextAnimationCycle||(this.beans.frameworkOverrides.wrapIncoming(()=>{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),n)}),this.nextAnimationTime=i)}advanceAnimations(){const e=Date.now();let t=null;for(const n of Object.keys(this.animations)){const o=this.animations[n],s=`ag-cell-${n}`,r=`${s}-animation`;for(const[i,a]of o){if(!i.isAlive()||!i.comp){o.delete(i);continue}const{phase:l,flashEndTime:c,fadeEndTime:u}=a,d=l==="flash"?c:u;if(!(e+15>=d)){t=Math.min(d,t??1/0);continue}const{comp:f,eGui:{style:p}}=i;switch(l){case"flash":f.toggleCss(s,!1),f.toggleCss(r,!0),p.transition=`background-color ${u-c}ms`,p.transitionDelay=`${c-e}ms`,t=Math.min(u,t??1/0),a.phase="fade";break;case"fade":f.toggleCss(s,!1),f.toggleCss(r,!1),p.removeProperty("transition"),p.removeProperty("transition-delay"),o.delete(i);break}}}t==null?(this.nextAnimationTime=null,this.nextAnimationCycle=null):t&&(this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),t-e),this.nextAnimationTime=t)}onFlashCells(e,t){if(!e.comp)return;const n=tme(e.cellPosition);t.cells[n]&&this.animateCell(e,"highlight")}flashCell(e,t){this.animateCell(e,"data-changed",t==null?void 0:t.flashDuration,t==null?void 0:t.fadeDuration)}destroy(){for(const e of Object.keys(this.animations))this.animations[e].clear()}};function o_e(e,t={}){const{cellFlashSvc:n}=e;n&&e.frameworkOverrides.wrapIncoming(()=>{for(const o of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))n.flashCell(o,t)})}var s_e={moduleName:"HighlightChanges",version:ut,beans:[n_e],userComponents:{agAnimateShowChangeCellRenderer:JEe,agAnimateSlideCellRenderer:t_e},apiFunctions:{flashCells:o_e}};function r_e(e){var t;return((t=e.stateSvc)==null?void 0:t.getState())??{}}function i_e(e,t,n){var o;return(o=e.stateSvc)==null?void 0:o.setState(t,n)}function lG(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=a_e(e)),e.version=ut,e}function a_e(e){return e.cellSelection=l_e(e,"rangeSelection"),e}function l_e(e,t){if(e&&typeof e=="object")return e[t]}var c_e=class extends je{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=qo(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=qo(this,()=>{this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(this.updateCachedState("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowGroupExpansion",void 0)):(this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("ssrmRowGroupExpansion",void 0))},0),this.onRowSelectedDebounced=qo(this,()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}postConstruct(){const{gos:e,ctrlsSvc:t,colDelayRenderSvc:n}=this.beans;this.isClientSideRowModel=lo(e);const o=lG(e.get("initialState")??{}),s=o.partialColumnState;delete o.partialColumnState,this.cachedState=o;const r=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>r(()=>this.setupStateOnGridReady(o))),(o.columnOrder||o.columnVisibility||o.columnSizing||o.columnPinning||o.columnGroup)&&(n==null||n.hideColumns("columnState"));const[i,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:c})=>{c==="gridInitializing"&&(i(),r(()=>{this.setupStateOnColumnsInitialised(o,!!s),n==null||n.revealColumns("columnState")}))},rowCountReady:()=>{a==null||a(),r(()=>this.setupStateOnRowCountReady(o))},firstDataRendered:()=>{l==null||l(),r(()=>this.setupStateOnFirstDataRendered(o))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const n=lG(e);delete n.partialColumnState,this.cachedState=n,this.startSuppressEvents();const o="api",s=t?new Set(t):void 0;this.setGridReadyState(n,o,s),this.setColumnsInitialisedState(n,o,!!s,s),this.setRowCountState(n,o,s),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(n,o,s),this.stopSuppressEvents(o)})}setGridReadyState(e,t,n){var o,s;t==="api"&&!(n!=null&&n.has("sideBar"))&&((s=(o=this.beans.sideBar)==null?void 0:o.comp)==null||s.setState(e.sideBar)),this.updateCachedState("sideBar",this.getSideBarState())}setupStateOnGridReady(e){this.setGridReadyState(e,"gridInitializing");const t=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:t,sideBarUpdated:t})}updateColumnAndGroupState(){this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState())}setColumnsInitialisedState(e,t,n,o){this.setColumnState(e,t,n,o),this.setColumnGroupState(e,t,o),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const n=o=>()=>this.updateColumnState([o]);this.addManagedEventListeners({columnValueChanged:n("aggregation"),columnMoved:n("columnOrder"),columnPinned:n("columnPinning"),columnResized:n("columnSizing"),columnVisible:n("columnVisibility"),columnPivotChanged:n("pivot"),columnPivotModeChanged:n("pivot"),columnRowGroupChanged:n("rowGroup"),sortChanged:n("sort"),newColumnsLoaded:this.updateColumnAndGroupState.bind(this),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setRowCountState(e,t,n){const{filter:o,rowGroupExpansion:s,ssrmRowGroupExpansion:r,rowSelection:i,pagination:a}=e,l=(u,d)=>!(n!=null&&n.has(u))&&(d||t==="api");l("filter",o)&&this.setFilterState(o),l("rowGroupExpansion",s)&&this.setRowGroupExpansionState(r,s,t),l("rowSelection",i)&&this.setRowSelectionState(i,t),l("pagination",a)&&this.setPaginationState(a,t);const c=this.updateCachedState.bind(this);c("filter",this.getFilterState()),this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(c("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),c("rowGroupExpansion",void 0)):(c("rowGroupExpansion",this.getRowGroupExpansionState()),c("ssrmRowGroupExpansion",void 0)),c("rowSelection",this.getRowSelectionState()),c("pagination",this.getPaginationState())}setupStateOnRowCountReady(e){this.setRowCountState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>{this.updateRowGroupExpansionStateTimer=0,this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(t("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),t("rowGroupExpansion",void 0)):(t("rowGroupExpansion",this.getRowGroupExpansionState()),t("ssrmRowGroupExpansion",void 0))},o=()=>t("filter",this.getFilterState()),{gos:s,colFilter:r}=this.beans;this.addManagedEventListeners({filterChanged:o,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:n,columnRowGroupChanged:n,rowDataUpdated:()=>{(s.get("groupDefaultExpanded")!==0||s.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(n)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:i=>{(i.newPage||i.newPageSize)&&t("pagination",this.getPaginationState())}}),r&&this.addManagedListeners(r,{filterStateChanged:o})}setFirstDataRenderedState(e,t,n){const{scroll:o,cellSelection:s,focusedCell:r,columnOrder:i,rowPinning:a}=e,l=(d,h)=>!(n!=null&&n.has(d))&&(h||t==="api");l("focusedCell",r)&&this.setFocusedCellState(r),l("cellSelection",s)&&this.setCellSelectionState(s),l("scroll",o)&&this.setScrollState(o),l("rowPinning",a)&&this.setRowPinningState(a),this.setColumnPivotState(!!(i!=null&&i.orderedColIds),t);const c=this.updateCachedState.bind(this);c("sideBar",this.getSideBarState()),c("focusedCell",this.getFocusedCellState());const u=this.getRangeSelectionState();c("rangeSelection",u),c("cellSelection",u),c("scroll",this.getScrollState())}setupStateOnFirstDataRendered(e){this.setFirstDataRenderedState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>t("focusedCell",this.getFocusedCellState());this.addManagedEventListeners({cellFocused:n,cellFocusCleared:n,cellSelectionChanged:o=>{if(o.finished){const s=this.getRangeSelectionState();t("rangeSelection",s),t("cellSelection",s)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return rbe(Zy(e),e.colModel.isPivotMode())}setColumnState(e,t,n,o){const{sort:s,rowGroup:r,aggregation:i,pivot:a,columnPinning:l,columnVisibility:c,columnSizing:u,columnOrder:d}=e;let h=!1;const f=(I,x)=>{const O=!(o!=null&&o.has(I))&&!!(x||t==="api");return h||(h=O),O},p={},g=I=>{let x=p[I];return x||(x={colId:I},p[I]=x,x)},v={},C=f("sort",s);C&&(s==null||s.sortModel.forEach(({colId:I,sort:x},O)=>{const N=g(I);N.sort=x,N.sortIndex=O})),(C||!n)&&(v.sort=null,v.sortIndex=null);const S=f("rowGroup",r);S&&(r==null||r.groupColIds.forEach((I,x)=>{const O=g(I);O.rowGroup=!0,O.rowGroupIndex=x})),(S||!n)&&(v.rowGroup=null,v.rowGroupIndex=null);const b=f("aggregation",i);b&&(i==null||i.aggregationModel.forEach(({colId:I,aggFunc:x})=>{g(I).aggFunc=x})),(b||!n)&&(v.aggFunc=null);const y=f("pivot",a);y&&(a==null||a.pivotColIds.forEach((I,x)=>{const O=g(I);O.pivot=!0,O.pivotIndex=x}),this.gos.updateGridOptions({options:{pivotMode:!!(a!=null&&a.pivotMode)},source:t})),(y||!n)&&(v.pivot=null,v.pivotIndex=null);const _=f("columnPinning",l);if(_){for(const I of(l==null?void 0:l.leftColIds)??[])g(I).pinned="left";for(const I of(l==null?void 0:l.rightColIds)??[])g(I).pinned="right"}(_||!n)&&(v.pinned=null);const E=f("columnVisibility",c);if(E)for(const I of(c==null?void 0:c.hiddenColIds)??[])g(I).hide=!0;(E||!n)&&(v.hide=null);const D=f("columnSizing",u);if(D)for(const{colId:I,flex:x,width:O}of(u==null?void 0:u.columnSizingModel)??[]){const N=g(I);N.flex=x??null,N.width=O}(D||!n)&&(v.flex=null);const T=d==null?void 0:d.orderedColIds,P=!!(T!=null&&T.length)&&!(o!=null&&o.has("columnOrder")),L=P?T.map(I=>g(I)):Object.values(p);(L.length||h)&&(this.columnStates=L,ei(this.beans,{state:L,applyOrder:P,defaultState:v},t))}setColumnPivotState(e,t){const n=this.columnStates;this.columnStates=void 0;const o=this.columnGroupStates;this.columnGroupStates=void 0;const s=this.beans,{pivotResultCols:r,colGroupSvc:i}=s;if(r!=null&&r.isPivotResultColsPresent()){if(n){const a=[];for(const l of n)r.getPivotResultCol(l.colId)&&a.push(l);ei(s,{state:a,applyOrder:e},t)}o&&(i==null||i.setColumnGroupState(o,t))}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return ibe(t)}setColumnGroupState(e,t,n){var a;const o=this.beans.colGroupSvc;if(!o||n!=null&&n.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const s=new Set((a=e.columnGroup)==null?void 0:a.openColumnGroupIds),i=o.getColumnGroupState().map(({groupId:l})=>{const c=s.has(l);return c&&s.delete(l),{groupId:l,open:c}});for(const l of s)i.push({groupId:l,open:!0});i.length&&(this.columnGroupStates=i),o.setColumnGroupState(i,t)}getFilterState(){const e=this.beans.filterManager;let t=e==null?void 0:e.getFilterModel();t&&Object.keys(t).length===0&&(t=void 0);const n=e==null?void 0:e.getFilterState(),o=(e==null?void 0:e.getAdvFilterModel())??void 0;return t||o||n?{filterModel:t,columnFilterState:n,advancedFilterModel:o}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:n,columnFilterState:o,advancedFilterModel:s}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(n!==void 0||o!==void 0)&&(t==null||t.setFilterState(n??null,o??null,"columnFilter")),s!==void 0&&(t==null||t.setAdvFilterModel(s??null,"advancedFilter"))}getRangeSelectionState(){var t;const e=(t=this.beans.rangeSvc)==null?void 0:t.getCellRanges().map(n=>{const{id:o,type:s,startRow:r,endRow:i,columns:a,startColumn:l}=n;return{id:o,type:s,startRow:r,endRow:i,colIds:a.map(c=>c.getColId()),startColId:l.getColId()}});return e!=null&&e.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeSvc:n,colModel:o,visibleCols:s}=this.beans;if(!_a(t)||!n)return;const r=[];for(const i of(e==null?void 0:e.cellRanges)??[]){const a=[];for(const c of i.colIds){const u=o.getCol(c);u&&a.push(u)}if(!a.length)continue;let l=o.getCol(i.startColId);if(!l){const c=s.allCols,u=new Set(a);l=c.find(d=>u.has(d))}r.push({...i,columns:a,startColumn:l})}n.setCellRanges(r)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.beans.ctrlsSvc.getScrollFeature(),{left:t}=(e==null?void 0:e.getHScrollPosition())??{left:0},{top:n}=(e==null?void 0:e.getVScrollPosition())??{top:0};return n||t?{top:n,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:n}=e??{top:0,left:0},{frameworkOverrides:o,rowRenderer:s,animationFrameSvc:r,ctrlsSvc:i}=this.beans;o.wrapIncoming(()=>{var a;i.get("center").setCenterViewportScrollLeft(n),(a=i.getScrollFeature())==null||a.setVerticalScrollPosition(t),s.redraw({afterScroll:!0}),r==null||r.flushAllFrames()})}getSideBarState(){var e,t;return(t=(e=this.beans.sideBar)==null?void 0:e.comp)==null?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.beans.focusSvc.getFocusedCell();if(e){const{column:t,rowIndex:n,rowPinned:o}=e;return{colId:t.getColId(),rowIndex:n,rowPinned:o}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:n}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:o,rowIndex:s,rowPinned:r}=e;t.setFocusedCell({column:n.getCol(o),rowIndex:s,rowPinned:r,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const n=e.getCurrentPage(),o=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!n&&!o))return{page:n,pageSize:o}}setPaginationState(e,t){const{pagination:n,gos:o}=this.beans;if(!n)return;const{pageSize:s,page:r}=e??{page:0,pageSize:o.get("paginationPageSize")},i=t==="gridInitializing";s&&!o.get("paginationAutoPageSize")&&n.setPageSize(s,i?"initialState":"pageSizeSelector"),typeof r=="number"&&(i?n.setPage(r):n.goToPage(r))}getRowSelectionState(){var o;const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!((o=t==null?void 0:t.toggledNodes)!=null&&o.length)?void 0:t}setRowSelectionState(e,t){var n;(n=this.beans.selectionSvc)==null||n.setSelectionState(e,t,t==="api")}getRowGroupExpansionState(){const{expansionSvc:e}=this.beans;if(e)return e.getExpansionState()}getRowPinningState(){var e;return(e=this.beans.pinnedRowModel)==null?void 0:e.getPinnedState()}setRowPinningState(e){const t=this.beans.pinnedRowModel;e?t==null||t.setPinnedState(e):t==null||t.reset()}setRowGroupExpansionState(e,t,n){const o=this.beans.expansionSvc;if(!o)return;const s=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};o.setExpansionState(s,n)}updateColumnState(e){const t=this.getColumnState();let n=!1;const o=this.cachedState;for(const s of Object.keys(t)){const r=t[s];Ep(r,o[s])||(n=!0)}this.cachedState={...o,...t},n&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const n=this.cachedState[e];this.setCachedStateValue(e,t),Ep(t,n)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState={...this.cachedState,[e]:t}}refreshStaleState(){const e=this.staleStateKeys;for(const t of e)t==="rowSelection"&&this.setCachedStateValue(t,this.getRowSelectionState());e.clear()}dispatchStateUpdateEvent(e){if(!this.suppressEvents){for(const t of e)this.queuedUpdateSources.add(t);this.dispatchStateUpdateEventDebounced()}}dispatchQueuedStateUpdateEvents(){const e=this.queuedUpdateSources,t=Array.from(e);e.clear(),this.eventSvc.dispatchEvent({type:"stateUpdated",sources:t,state:this.cachedState})}startSuppressEvents(){var e;this.suppressEvents=!0,(e=this.beans.colAnimation)==null||e.setSuppressAnimation(!0)}stopSuppressEvents(e){setTimeout(()=>{var t;this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&((t=this.beans.colAnimation)==null||t.setSuppressAnimation(!1),this.dispatchStateUpdateEvent([e]))})}suppressEventsAndDispatchInitEvent(e){this.startSuppressEvents(),e(),this.stopSuppressEvents("gridInitializing")}},u_e={moduleName:"GridState",version:ut,beans:[c_e],apiFunctions:{getState:r_e,setState:i_e}};function d_e(e){return e.rowModel.isLastRowIndexKnown()}function h_e(e){var t;return((t=e.pagination)==null?void 0:t.getPageSize())??100}function f_e(e){var t;return((t=e.pagination)==null?void 0:t.getCurrentPage())??0}function p_e(e){var t;return((t=e.pagination)==null?void 0:t.getTotalPages())??1}function g_e(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function m_e(e){var t;(t=e.pagination)==null||t.goToNextPage()}function v_e(e){var t;(t=e.pagination)==null||t.goToPreviousPage()}function y_e(e){var t;(t=e.pagination)==null||t.goToFirstPage()}function w_e(e){var t;(t=e.pagination)==null||t.goToLastPage()}function C_e(e,t){var n;(n=e.pagination)==null||n.goToPage(t)}var b_e=class extends je{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeSvc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.centerRowsCtrl=e.center;const t=this.checkPageSize.bind(this);this.addManagedEventListeners({bodyHeightChanged:t,scrollVisibilityChanged:t}),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||this.centerRowsCtrl==null}onPaginationAutoSizeChanged(){this.notActive()?this.beans.pagination.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.viewportSizeFeature.getBodyHeight();if(e>0){const t=this.beans,n=()=>{const o=Math.max(zc(t),1),s=Math.floor(e/o);t.pagination.setPageSize(s,"autoCalculated")};this.isBodyRendered?qo(this,n,50)():(n(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},rg="paginationPageSizeSelector",S_e={tag:"span",cls:"ag-paging-page-size"},E_e=class extends Sn{constructor(){super(S_e),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.pagination.getPageSize()||(this.pagination.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}wireBeans(e){this.pagination=e.pagination}postConstruct(){this.addManagedPropertyListener(rg,()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedEventListeners({paginationChanged:e=>this.handlePaginationChanged(e)})}handlePaginationChanged(e){if(!this.selectPageSizeComp||!(e!=null&&e.newPageSize))return;const t=this.pagination.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&!e&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp)}reset(){Ko(this.getGui()),this.selectPageSizeComp&&(this.selectPageSizeComp=this.destroyBean(this.selectPageSizeComp))}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel")&&!this.gos.get("paginationAutoPageSize")&&this.gos.get(rg)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),n=!t||!e.includes(t);if(n){const s=this.gos.exists("paginationPageSize"),r=this.gos.get(rg)!==!0;Je(94,{pageSizeSet:s,pageSizesSet:r,pageSizeOptions:e,paginationPageSizeOption:t}),r||Je(95,{paginationPageSizeOption:t,paginationPageSizeSelector:rg}),e.unshift("")}const o=String(n?"":t);this.selectPageSizeComp?(Il(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(o,!0)):this.createPageSizeSelectorComp(e,o),this.hasEmptyOption=n}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const n=this.getLocaleTextFunc(),o=n("pageSizeSelectorLabel","Page Size:"),s=n("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new V_).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(s).setLabel(o).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(rg);return!Array.isArray(t)||!(t!=null&&t.length)?e:[...t].sort((n,o)=>n-o)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},__e={selector:"AG-PAGE-SIZE-SELECTOR",component:E_e},R_e=".ag-paging-panel{align-items:center;border-top:var(--ag-footer-row-border);display:flex;gap:calc(var(--ag-spacing)*4);height:var(--ag-pagination-panel-height);justify-content:flex-end;padding:0 var(--ag-cell-horizontal-padding)}:where(.ag-paging-page-size) .ag-wrapper{min-width:50px}.ag-paging-page-summary-panel{align-items:center;display:flex;gap:var(--ag-cell-widget-spacing);.ag-disabled &{pointer-events:none}}.ag-paging-button{cursor:pointer;position:relative;&.ag-disabled{cursor:default;opacity:.5}}.ag-paging-number,.ag-paging-row-summary-panel-number{font-weight:500}",T_e=class extends w${constructor(){super(),this.btFirst=dt,this.btPrevious=dt,this.btNext=dt,this.btLast=dt,this.lbRecordCount=dt,this.lbFirstRowOnPage=dt,this.lbLastRowOnPage=dt,this.lbCurrent=dt,this.lbTotal=dt,this.pageSizeComp=dt,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(R_e)}wireBeans(e){this.rowModel=e.rowModel,this.pagination=e.pagination,this.ariaAnnounce=e.ariaAnnounce}postConstruct(){const e=this.gos.get("enableRtl");this.setTemplate(this.getTemplate(),[__e]);const{btFirst:t,btPrevious:n,btNext:o,btLast:s}=this;this.activateTabIndex([t,n,o,s]),t.insertAdjacentElement("afterbegin",xr(e?"last":"first",this.beans)),n.insertAdjacentElement("afterbegin",xr(e?"next":"previous",this.beans)),o.insertAdjacentElement("afterbegin",xr(e?"previous":"next",this.beans)),s.insertAdjacentElement("afterbegin",xr(e?"first":"last",this.beans)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],()=>this.onPageSizeRelatedOptionsChange()),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:r=>this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(r):bpe(this.beans,r),forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}onPaginationChanged(){const t=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(t),t&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){if(!this.areListenersSetup){this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)});for(const e of[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}]){const{el:t,fn:n}=e;this.addManagedListeners(t,{click:n,keydown:o=>{(o.key===Le.ENTER||o.key===Le.SPACE)&&(o.preventDefault(),n())}})}Cpe(this.beans,this,this.getGui()),this.areListenersSetup=!0}}onBtFirst(){this.previousAndFirstButtonsDisabled||this.pagination.goToFirstPage()}formatNumber(e){const t=this.gos.getCallback("paginationNumberFormatter");return t?t({value:e}):abe(e,this.getLocaleTextFunc.bind(this))}getTemplate(){const e=this.getLocaleTextFunc(),t=`ag-${this.getCompId()}`;return{tag:"div",cls:"ag-paging-panel ag-unselectable",attrs:{id:`${t}`},children:[{tag:"ag-page-size-selector",ref:"pageSizeComp"},{tag:"span",cls:"ag-paging-row-summary-panel",children:[{tag:"span",ref:"lbFirstRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-first-row`}},{tag:"span",attrs:{id:`${t}-to`},children:e("to","to")},{tag:"span",ref:"lbLastRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-last-row`}},{tag:"span",attrs:{id:`${t}-of`},children:e("of","of")},{tag:"span",ref:"lbRecordCount",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-row-count`}}]},{tag:"span",cls:"ag-paging-page-summary-panel",role:"presentation",children:[{tag:"div",ref:"btFirst",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("firstPage","First Page")}},{tag:"div",ref:"btPrevious",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("previousPage","Previous Page")}},{tag:"span",cls:"ag-paging-description",children:[{tag:"span",attrs:{id:`${t}-start-page`},children:e("page","Page")},{tag:"span",ref:"lbCurrent",cls:"ag-paging-number",attrs:{id:`${t}-start-page-number`}},{tag:"span",attrs:{id:`${t}-of-page`},children:e("of","of")},{tag:"span",ref:"lbTotal",cls:"ag-paging-number",attrs:{id:`${t}-of-page-number`}}]},{tag:"div",ref:"btNext",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("nextPage","Next Page")}},{tag:"div",ref:"btLast",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("lastPage","Last Page")}}]}]}}onBtNext(){this.nextButtonDisabled||this.pagination.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.pagination.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.pagination.goToLastPage()}enableOrDisableButtons(){const e=this.pagination.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),n=this.pagination.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const o=this.isZeroPagesToDisplay(),s=e===n-1;this.nextButtonDisabled=s||o,this.lastButtonDisabled=!t||o||e===n-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){Nce(e,t),e.classList.toggle("ag-disabled",t)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages();return e&&t===0}updateLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages(),n=this.pagination.getMasterRowCount(),o=e?n:null,s=this.pagination.getCurrentPage(),r=this.pagination.getPageSize();let i,a;this.isZeroPagesToDisplay()?i=a=0:(i=r*s+1,a=i+r-1,e&&a>o&&(a=o));const l=i+r-1,c=!e&&n<l,u=this.formatNumber(i);this.lbFirstRowOnPage.textContent=u;let d;const h=this.getLocaleTextFunc();c?d=h("pageLastRowUnknown","?"):d=this.formatNumber(a),this.lbLastRowOnPage.textContent=d;const p=t>0?s+1:0,g=this.formatNumber(p);this.lbCurrent.textContent=g;let v,C;if(e)v=this.formatNumber(t),C=this.formatNumber(o);else{const S=h("more","more");v=S,C=S}this.lbTotal.textContent=v,this.lbRecordCount.textContent=C,this.announceAriaStatus(u,d,C,g,v)}announceAriaStatus(e,t,n,o,s){var d,h;const r=this.getLocaleTextFunc(),i=r("page","Page"),a=r("to","to"),l=r("of","of"),c=`${e} ${a} ${t} ${l} ${n}`,u=`${i} ${o} ${l} ${s}`;c!==this.ariaRowStatus&&(this.ariaRowStatus=c,(d=this.ariaAnnounce)==null||d.announceValue(c,"paginationRow")),u!==this.ariaPageStatus&&(this.ariaPageStatus=u,(h=this.ariaAnnounce)==null||h.announceValue(u,"paginationPage"))}},D_e={selector:"AG-PAGINATION",component:T_e},I_e=class extends je{constructor(){super(...arguments),this.beanName="pagination",this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.masterRowCount=0}postConstruct(){const e=this.gos;this.active=e.get("pagination"),this.pageSizeFromGridOptions=e.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this))}getPaginationSelector(){return D_e}isPaginateChildRows(){const e=this.gos;return e.get("groupHideParentOfSingleChild")||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")?!0:e.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){const t=this.currentPage;if(!this.active||t===e||typeof t!="number")return;const{editSvc:n}=this.beans;n!=null&&n.isEditing()&&(n.isBatchEditing()?n.cleanupEditors():n.stopEditing(void 0,{source:"api"})),this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0})}goToPageWithIndex(e){var n,o;if(!this.active)return;let t=e;this.paginateChildRows||(t=((o=(n=this.beans.rowModel).getTopLevelIndexFromDisplayedIndex)==null?void 0:o.call(n,e))??e),this.goToPage(Math.floor(t/this.pageSize))}isRowInPage(e){return this.active?e>=this.topDisplayedRowIndex&&e<=this.bottomDisplayedRowIndex:!0}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.beans.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return ht(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:ht(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:ht(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:ht(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.beans.pageBounds.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(this.pageSizeAutoCalculated===void 0)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const n=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,this.currentPage!==0&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,this.currentPage!==0&&this.goToFirstPage();break}n!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){const e=this.totalPages;this.currentPage>=e&&(this.currentPage=e-1);const t=this.currentPage;(!isFinite(t)||isNaN(t)||t<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){const e=this.beans.rowModel,t=e.getTopLevelRowCount();if(this.masterRowCount=t,t<=0){this.setZeroRows();return}const n=this.pageSize,o=t-1;this.totalPages=Math.floor(o/n)+1,this.adjustCurrentPageIfInvalid();const s=this.currentPage,r=n*s;let i=n*(s+1)-1;if(i>o&&(i=o),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(r),i===o)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=a-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){const e=this.beans.rowModel.getRowCount();if(this.masterRowCount=e,e===0){this.setZeroRows();return}const{pageSize:t,currentPage:n}=this,o=e-1;this.totalPages=Math.floor(o/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*n,this.bottomDisplayedRowIndex=t*(n+1)-1,this.bottomDisplayedRowIndex>o&&(this.bottomDisplayedRowIndex=o)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.beans.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:n=!1,newPageSize:o=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:n,newPageSize:o,keepRenderedRows:t})}},x_e={moduleName:"Pagination",version:ut,beans:[I_e,b_e],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:d_e,paginationGetPageSize:h_e,paginationGetCurrentPage:f_e,paginationGetTotalPages:p_e,paginationGetRowCount:g_e,paginationGoToNextPage:m_e,paginationGoToPreviousPage:v_e,paginationGoToFirstPage:y_e,paginationGoToLastPage:w_e,paginationGoToPage:C_e},dependsOn:[xw]};function P_e(e,t={}){const n=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(n))}function cG(e,t,n,o,s){t&&(o&&t.parent&&t.parent.level!==-1&&cG(e,t.parent,n,o,s),t.setExpanded(n,void 0,s))}function k_e(e,t){return e.rowModel.getRowNode(t)}function F_e(e,t,n,o){e.rowRenderer.addRenderedRowListener(t,n,o)}function A_e(e){return e.rowRenderer.getRenderedNodes()}function O_e(e,t,n){e.rowModel.forEachNode(t,n)}function M_e(e){return e.rowRenderer.firstRenderedRow}function N_e(e){return e.rowRenderer.lastRenderedRow}function L_e(e,t){return e.rowModel.getRow(t)}function V_e(e){return e.rowModel.getRowCount()}var B_e={moduleName:"RowApi",version:ut,apiFunctions:{redrawRows:P_e,setRowNodeExpanded:cG,getRowNode:k_e,addRenderedRowListener:F_e,getRenderedNodes:A_e,forEachNode:O_e,getFirstDisplayedRowIndex:M_e,getLastDisplayedRowIndex:N_e,getDisplayedRowAtIndex:L_e,getDisplayedRowCount:V_e}},$_e={moduleName:"ScrollApi",version:ut,apiFunctions:{getVerticalPixelRange:QSe,getHorizontalPixelRange:e0e,ensureColumnVisible:WH,ensureIndexVisible:zH,ensureNodeVisible:t0e}};function H_e(e,t,n){if(!t)return;const o=e.ctrlsSvc.getGridBodyCtrl().eGridBody,s=`aria-${t}`;n===null?o.removeAttribute(s):o.setAttribute(s,n)}function G_e(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function U_e(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function W_e(e){var t;return((t=e.animationFrameSvc)==null?void 0:t.isQueueEmpty())??!0}function z_e(e){var t;(t=e.animationFrameSvc)==null||t.flushAllFrames()}function j_e(e){return{rowHeight:zc(e),headerHeight:jp(e)}}function K_e(e,t={}){var r;const n=[];for(const i of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const a=i.getCellRenderer();a!=null&&n.push(Up(a))}if((r=t.columns)!=null&&r.length)return n;const o=[],s=MR(t.rowNodes);for(const i of e.rowRenderer.getAllRowCtrls()){if(s&&!NR(i.rowNode,s)||!i.isFullWidth())continue;const a=i.getFullWidthCellRenderers();for(let l=0;l<a.length;l++){const c=a[l];c!=null&&o.push(Up(c))}}return[...o,...n]}var q_e={moduleName:"RenderApi",version:ut,apiFunctions:{setGridAriaProperty:H_e,refreshCells:G_e,refreshHeader:U_e,isAnimationFrameQueueEmpty:W_e,flushAllAnimationFrames:z_e,getSizesForCurrentTheme:j_e,getCellRendererInstances:K_e}};function Y_e(e,t){var n,o;typeof t=="number"?(n=e.colAutosize)==null||n.sizeColumnsToFit(t,"api"):(o=e.colAutosize)==null||o.sizeColumnsToFitGridBody(t)}function uG({colAutosize:e,visibleCols:t},n,o){Array.isArray(n)?e==null||e.autoSizeCols({colKeys:n,skipHeader:o,source:"api"}):e==null||e.autoSizeCols({...n,colKeys:n.colIds??t.allCols,source:"api"})}function X_e(e,t){var n;t&&typeof t=="object"?uG(e,t):(n=e.colAutosize)==null||n.autoSizeAllColumns({source:"api",skipHeader:t})}var Z_e=class extends je{constructor(){super(...arguments),this.beanName="colAutosize",this.timesDelayed=0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}postConstruct(){var n;const{gos:e}=this,t=e.get("autoSizeStrategy");if(t){let o=!1;const s=t.type;if(s==="fitGridWidth"||s==="fitProvidedWidth")o=!0;else if(s==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const r=e.get("rowData");o=r!=null&&r.length>0&&lo(e)}o&&((n=this.beans.colDelayRenderSvc)==null||n.hideColumns(s))}}autoSizeCols(e){const{eventSvc:t,visibleCols:n}=this.beans;this.innerAutoSizeCols(e).then(o=>{var c;const s=u=>Gd(t,Array.from(u),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return s(o);const r=dG(this.beans),i=u=>n.leftCols.some(d=>$p(d,u)),a=u=>n.rightCols.some(d=>$p(d,u)),l=e.colKeys.filter(u=>!Ta(u)&&!Da(u)&&!i(u)&&!a(u));this.sizeColumnsToFit(r,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:(c=e.columnLimits)==null?void 0:c.map(u=>({...u,key:u.colId})),colKeys:l,onlyScaleUp:!0}),s(o)})}innerAutoSizeCols(e){return new Promise((t,n)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,n));const{colKeys:o,skipHeader:s,skipHeaderGroups:r,stopAtGroup:i,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:c=[],source:u="api"}=e,{animationFrameSvc:d,renderStatus:h,colModel:f,autoWidthCalc:p,visibleCols:g}=this.beans;if(d==null||d.flushAllFrames(),this.timesDelayed<5&&h&&(!h.areHeaderCellsRendered()||!h.areCellsRendered())){this.timesDelayed++,setTimeout(()=>{this.isAlive()&&this.innerAutoSizeCols(e).then(t,n)});return}this.timesDelayed=0;const v=new Set;let C=-1;const S=Object.fromEntries(c.map(({colId:_,...E})=>[_,E])),b=s??this.gos.get("skipHeaderOnAutoSize"),y=r??b;for(;C!==0;){C=0;const _=[];for(const E of o){if(!E||que(E))continue;const D=f.getCol(E);if(!D||v.has(D))continue;const T=p.getPreferredWidthForColumn(D,b);if(T>0){const P=S[D.colId]??{};P.minWidth??(P.minWidth=l),P.maxWidth??(P.maxWidth=a);const L=J_e(D,T,P);D.setActualWidth(L,u),v.add(D),C++}_.push(D)}_.length&&g.refresh(u)}y||this.autoSizeColumnGroupsByColumns(o,u,i),t(v)})}autoSizeColumn(e,t,n){this.autoSizeCols({colKeys:[e],skipHeader:n,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,n){const{colModel:o,ctrlsSvc:s}=this.beans,r=new Set,i=o.getColsForKeys(e);for(const l of i){let c=l.getParent();for(;c&&c!=n;)c.isPadding()||r.add(c),c=c.getParent()}let a;for(const l of r){for(const c of s.getHeaderRowContainerCtrls())if(a=c.getHeaderCtrlForColumn(l),a)break;a==null||a.resizeLeafColumnsToFit(t)}}autoSizeAllColumns(e){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.autoSizeAllColumns(e));return}this.autoSizeCols({colKeys:this.beans.visibleCols.allCols,...e})}addColumnAutosizeListeners(e,t){const n=this.gos.get("skipHeaderOnAutoSize"),o=()=>{this.autoSizeColumn(t,"uiColumnResized",n)};e.addEventListener("dblclick",o);const s=new tu(e);return s.addEventListener("doubleTap",o),()=>{e.removeEventListener("dblclick",o),s.destroy()}}addColumnGroupResize(e,t,n){const o=this.gos.get("skipHeaderOnAutoSize"),s=()=>{const r=[],i=t.getDisplayedLeafColumns();for(const a of i)a.getColDef().suppressAutoSize||r.push(a.getColId());r.length>0&&this.autoSizeCols({colKeys:r,skipHeader:o,stopAtGroup:t,source:"uiColumnResized"}),n()};return e.addEventListener("dblclick",s),()=>e.removeEventListener("dblclick",s)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const n=dG(this.beans);if(n>0){this.sizeColumnsToFit(n,"sizeColumnsToFit",!1,e);return}t===void 0?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,100)},0):t===100?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,500)},100):t===500?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,-1)},500):Je(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",n,o){var p,g;if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,n,o));return}const s={};for(const{key:v,...C}of(o==null?void 0:o.columnLimits)??[])s[typeof v=="string"?v:v.getColId()]=C;const r=this.beans.visibleCols.allCols;if(e<=0||!r.length)return;const i=Ra(r);if(o!=null&&o.onlyScaleUp&&i>e||e===i&&r.every(C=>{if(C.colDef.suppressSizeToFit)return!0;const S=s==null?void 0:s[C.getId()],b=(S==null?void 0:S.minWidth)??(o==null?void 0:o.defaultMinWidth),y=(S==null?void 0:S.maxWidth)??(o==null?void 0:o.defaultMaxWidth),_=C.getActualWidth();return(b==null||_>=b)&&(y==null||_<=y)}))return;const l=[],c=[];for(const v of r){const C=((p=o==null?void 0:o.colKeys)==null?void 0:p.some(S=>$p(v,S)))??!0;v.getColDef().suppressSizeToFit||!C?c.push(v):l.push(v)}const u=l.slice(0);let d=!1;const h=v=>{Qr(l,v),c.push(v)};for(const v of l){v.resetActualWidth(t);const C=s==null?void 0:s[v.getId()],S=(C==null?void 0:C.minWidth)??(o==null?void 0:o.defaultMinWidth),b=(C==null?void 0:C.maxWidth)??(o==null?void 0:o.defaultMaxWidth),y=v.getActualWidth();typeof S=="number"&&y<S?v.setActualWidth(S,t,!0):typeof b=="number"&&y>b&&v.setActualWidth(b,t,!0)}for(;!d;){d=!0;const v=e-Ra(c);if(v<=0)for(const C of l){const S=((g=s==null?void 0:s[C.getId()])==null?void 0:g.minWidth)??(o==null?void 0:o.defaultMinWidth)??C.minWidth;C.setActualWidth(S,t,!0)}else{const C=v/Ra(l);let S=v;for(let b=l.length-1;b>=0;b--){const y=l[b],_=s==null?void 0:s[y.getId()],E=(_==null?void 0:_.minWidth)??(o==null?void 0:o.defaultMinWidth),D=(_==null?void 0:_.maxWidth)??(o==null?void 0:o.defaultMaxWidth),T=y.getMinWidth(),P=y.getMaxWidth(),L=typeof E=="number"&&E>T?E:T,I=typeof D=="number"&&D<P?D:P;let x=Math.round(y.getActualWidth()*C);x<L?(x=L,h(y),d=!1):x>I?(x=I,h(y),d=!1):b===0&&(x=S),y.setActualWidth(x,t,!0),S-=x}}}for(const v of u)v.fireColumnWidthChangedEvent(t);const f=this.beans.visibleCols;f.setLeftValues(t),f.updateBodyWidths(),!n&&Gd(this.eventSvc,u,!0,t)}applyAutosizeStrategy(){const{gos:e,colDelayRenderSvc:t}=this.beans,n=e.get("autoSizeStrategy");(n==null?void 0:n.type)!=="fitGridWidth"&&(n==null?void 0:n.type)!=="fitProvidedWidth"||setTimeout(()=>{if(!this.isAlive())return;const o=n.type;if(o==="fitGridWidth"){const{columnLimits:s,defaultMinWidth:r,defaultMaxWidth:i}=n,a=s==null?void 0:s.map(({colId:l,minWidth:c,maxWidth:u})=>({key:l,minWidth:c,maxWidth:u}));this.sizeColumnsToFitGridBody({defaultMinWidth:r,defaultMaxWidth:i,columnLimits:a})}else o==="fitProvidedWidth"&&this.sizeColumnsToFit(n.width,"sizeColumnsToFit");t==null||t.revealColumns(o)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{var o;if(!this.isAlive())return;const n="autosizeColumns";e?this.autoSizeCols({...t,source:n,colKeys:e}):this.autoSizeAllColumns({...t,source:n}),(o=this.beans.colDelayRenderSvc)==null||o.revealColumns(t.type)})}processResizeOperations(){this.shouldQueueResizeOperations=!1;for(const e of this.resizeOperationQueue)e();this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}destroy(){this.resizeOperationQueue.length=0,super.destroy()}};function J_e(e,t,n={}){const o=n.minWidth??e.getMinWidth();t<o&&(t=o);const s=n.maxWidth??e.getMaxWidth();return t>s&&(t=s),t}function dG({ctrlsSvc:e,scrollVisibleSvc:t}){const n=e.getGridBodyCtrl(),s=n.isVerticalScrollShowing()?t.getScrollbarWidth():0;return Ip(n.eGridBody)-s}var Q_e={moduleName:"ColumnAutoSize",version:ut,beans:[Z_e],apiFunctions:{sizeColumnsToFit:Y_e,autoSizeColumns:uG,autoSizeAllColumns:X_e},dependsOn:[N$]},eRe=".ag-row-pinned-source{background-color:var(--ag-pinned-source-row-background-color);color:var(--ag-pinned-source-row-text-color);font-weight:var(--ag-pinned-source-row-font-weight)}.ag-row-pinned-manual{background-color:var(--ag-pinned-row-background-color);color:var(--ag-pinned-row-text-color);font-weight:var(--ag-pinned-row-font-weight)}";function tRe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedTopRowCount())??0}function nRe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedBottomRowCount())??0}function oRe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedTopRow(t)}function sRe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedBottomRow(t)}function rRe(e,t,n){var o;return(o=e.pinnedRowModel)==null?void 0:o.forEachPinnedRow(t,n)}var iRe={moduleName:"PinnedRow",version:ut,beans:[oge],css:[eRe],apiFunctions:{getPinnedTopRowCount:tRe,getPinnedBottomRowCount:nRe,getPinnedTopRow:oRe,getPinnedBottomRow:sRe,forEachPinnedRow:rRe},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},aRe=class{constructor(e,t){this.col=e,this.firstNode=t,this.cellSpan=!0,this.spannedNodes=new Set,this.addSpannedNode(t)}reset(){this.spannedNodes.clear(),this.addSpannedNode(this.firstNode)}addSpannedNode(e){this.spannedNodes.add(e),this.lastNode=e}getLastNode(){return this.lastNode}getCellHeight(){return this.lastNode.rowTop+this.lastNode.rowHeight-this.firstNode.rowTop-1}doesSpanContain(e){return e.column!==this.col||e.rowPinned!=this.firstNode.rowPinned?!1:this.firstNode.rowIndex<=e.rowIndex&&e.rowIndex<=this.lastNode.rowIndex}getLastNodeAutoHeight(){var n;const e=(n=this.firstNode.__autoHeights)==null?void 0:n[this.col.getColId()];if(e==null)return;let t=0;for(const o of this.spannedNodes)o!==this.lastNode&&(t+=o.rowHeight);return e-t}},lRe=class extends je{constructor(e){super(),this.column=e}buildCache(e){var b;const{column:t,beans:{gos:n,pinnedRowModel:o,rowModel:s,valueSvc:r,pagination:i}}=this,{colDef:a}=t,l=this.getNodeMap(e),c=new Map,u=n.getCallback("isFullWidthRow"),d=a.equals,h=a.spanRows,f=typeof h=="function";let p=null,g=null,v;const C=(y,_)=>{p=y,g=null,v=_},S=y=>{const _=!y.isExpandable()&&!y.group&&!y.detail&&(u?!u({rowNode:y}):!0);if(y.rowIndex==null||!_){C(null,null);return}if(p==null||y.level!==p.level||y.footer||g&&y.rowIndex-1!==(g==null?void 0:g.getLastNode().rowIndex)){C(y,r.getValue(t,y));return}const E=r.getValue(t,y);if(f){const D=Ot(n,{valueA:v,nodeA:p,valueB:E,nodeB:y,column:t,colDef:a});if(!h(D)){C(y,E);return}}else if(d?!d(v,E):v!==E){C(y,E);return}if(!g){const D=l==null?void 0:l.get(p);(D==null?void 0:D.firstNode)===p?(D.reset(),g=D):g=new aRe(t,p),c.set(p,g)}g.addSpannedNode(y),c.set(y,g)};switch(e){case"center":(b=s.forEachDisplayedNode)==null||b.call(s,y=>{(!i||i.isRowInPage(y.rowIndex))&&S(y)}),this.centerValueNodeMap=c;break;case"top":o==null||o.forEachPinnedRow("top",S),this.topValueNodeMap=c;break;case"bottom":o==null||o.forEachPinnedRow("bottom",S),this.bottomValueNodeMap=c;break}}isCellSpanning(e){return!!this.getCellSpan(e)}getCellSpan(e){return this.getNodeMap(e.rowPinned).get(e)}getNodeMap(e){switch(e){case"top":return this.topValueNodeMap;case"bottom":return this.bottomValueNodeMap;default:return this.centerValueNodeMap}}},cRe=class extends je{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=qo(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=qo(this,this.dispatchCellsUpdatedEvent.bind(this,!1),0),this.pinnedTimeout=null,this.modelTimeout=null}postConstruct(){const e=this.onRowDataUpdated.bind(this),t=this.buildPinnedCaches.bind(this);this.addManagedEventListeners({paginationChanged:this.buildModelCaches.bind(this),pinnedRowDataChanged:t,pinnedRowsChanged:t,rowNodeDataChanged:e,cellValueChanged:e})}register(e){const{gos:t}=this.beans;if(!t.get("enableCellSpan")||this.spanningColumns.has(e))return;const n=this.createManagedBean(new lRe(e));this.spanningColumns.set(e,n),n.buildCache("top"),n.buildCache("bottom"),n.buildCache("center"),this.debouncePinnedEvent(),this.debounceModelEvent()}dispatchCellsUpdatedEvent(e){this.dispatchLocalEvent({type:"spannedCellsUpdated",pinned:e})}deregister(e){this.spanningColumns.delete(e)}onRowDataUpdated({node:e}){const{spannedRowRenderer:t}=this.beans;if(e.rowPinned){if(this.pinnedTimeout!=null)return;this.pinnedTimeout=window.setTimeout(()=>{this.pinnedTimeout=null,this.buildPinnedCaches(),t==null||t.createCtrls("top"),t==null||t.createCtrls("bottom")},0);return}this.modelTimeout==null&&(this.modelTimeout=window.setTimeout(()=>{this.modelTimeout=null,this.buildModelCaches(),t==null||t.createCtrls("center")},0))}buildModelCaches(){this.modelTimeout!=null&&clearTimeout(this.modelTimeout),this.spanningColumns.forEach(e=>e.buildCache("center")),this.debounceModelEvent()}buildPinnedCaches(){this.pinnedTimeout!=null&&clearTimeout(this.pinnedTimeout),this.spanningColumns.forEach(e=>{e.buildCache("top"),e.buildCache("bottom")}),this.debouncePinnedEvent()}isCellSpanning(e,t){const n=this.spanningColumns.get(e);return n?n.isCellSpanning(t):!1}getCellSpanByPosition(e){const{pinnedRowModel:t,rowModel:n}=this.beans,o=e.column,s=e.rowIndex,r=this.spanningColumns.get(o);if(!r)return;let i;switch(e.rowPinned){case"top":i=t==null?void 0:t.getPinnedTopRow(s);break;case"bottom":i=t==null?void 0:t.getPinnedBottomRow(s);break;default:i=n.getRow(s)}if(i)return r.getCellSpan(i)}getCellStart(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.firstNode.rowIndex}:e}getCellEnd(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.getLastNode().rowIndex}:e}getCellSpan(e,t){const n=this.spanningColumns.get(e);if(n)return n.getCellSpan(t)}forEachSpannedColumn(e,t){for(const[n,o]of this.spanningColumns)if(o.isCellSpanning(e)){const s=o.getCellSpan(e);t(n,s)}}destroy(){super.destroy(),this.spanningColumns.clear()}},uRe=class extends eh{constructor(e,t,n){super(e.col,e.firstNode,n,t),this.cellSpan=e,this.SPANNED_CELL_CSS_CLASS="ag-spanned-cell"}setComp(e,t,n,o,s,r,i){this.eWrapper=n,super.setComp(e,t,n,o,s,r,i),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||ky(e,t.rowIndex)}setAriaRowSpan(){Hce(this.eGui,this.cellSpan.spannedNodes.size)}setFocusedCellPosition(e){this.focusedCellPosition=e}getFocusedCellPosition(){return this.focusedCellPosition??this.cellPosition}checkCellFocused(){const e=this.beans.focusSvc.getFocusedCell();return!!e&&this.cellSpan.doesSpanContain(e)}applyStaticCssClasses(){super.applyStaticCssClasses(),this.comp.toggleCss(this.SPANNED_CELL_CSS_CLASS,!0)}onCellFocused(e){const{beans:t}=this;if(vw(t)){this.focusedCellPosition=void 0;return}const n=this.isCellFocused();n||(this.focusedCellPosition=void 0),e&&n&&(this.focusedCellPosition={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column}),super.onCellFocused(e)}getRootElement(){return this.eWrapper}},dRe=class extends Dw{onRowIndexChanged(){super.onRowIndexChanged();for(const e of this.getAllCellCtrls())e.refreshAriaRowIndex()}getInitialRowClasses(e){return["ag-spanned-row"]}getNewCellCtrl(e){var o;const t=(o=this.beans.rowSpanSvc)==null?void 0:o.getCellSpan(e,this.rowNode);if(!(!t||t.firstNode!==this.rowNode))return new uRe(t,this,this.beans)}isCorrectCtrlForSpan(e){var o;const t=(o=this.beans.rowSpanSvc)==null?void 0:o.getCellSpan(e.column,this.rowNode);return!t||t.firstNode!==this.rowNode?!1:e.getCellSpan()===t}onRowHeightChanged(){}refreshFirstAndLastRowStyles(){}addHoverFunctionality(){}resetHoveredStatus(){}},hRe=class extends je{constructor(){super(...arguments),this.beanName="spannedRowRenderer",this.topCtrls=new Map,this.bottomCtrls=new Map,this.centerCtrls=new Map}postConstruct(){this.addManagedEventListeners({displayedRowsChanged:this.createAllCtrls.bind(this)})}createAllCtrls(){this.createCtrls("top"),this.createCtrls("bottom"),this.createCtrls("center")}createCtrls(e){const{rowSpanSvc:t}=this.beans,n=this.getCtrlsMap(e),o=n.size,s=this.getAllRelevantRowControls(e),r=new Map;let i=!1;for(const l of s)l.isAlive()&&(t==null||t.forEachSpannedColumn(l.rowNode,(c,u)=>{if(r.has(u.firstNode))return;const d=n.get(u.firstNode);if(d){r.set(u.firstNode,d),n.delete(u.firstNode);return}i=!0;const h=new dRe(u.firstNode,this.beans,!1,!1,!1);r.set(u.firstNode,h)}));this.setCtrlsMap(e,r);const a=r.size===o;if(!(!i&&a)){for(const l of n.values())l.destroyFirstPass(!0),l.destroySecondPass();this.dispatchLocalEvent({type:"spannedRowsUpdated",ctrlsKey:e})}}getAllRelevantRowControls(e){const{rowRenderer:t}=this.beans;switch(e){case"top":return t.topRowCtrls;case"bottom":return t.bottomRowCtrls;case"center":return t.allRowCtrls}}getCellByPosition(e){const{rowSpanSvc:t}=this.beans,n=t==null?void 0:t.getCellSpanByPosition(e);if(!n)return;const o=this.getCtrlsMap(e.rowPinned).get(n.firstNode);if(o)return o.getAllCellCtrls().find(s=>s.column===e.column)}getCtrls(e){return[...this.getCtrlsMap(e).values()]}destroyRowCtrls(e){for(const t of this.getCtrlsMap(e).values())t.destroyFirstPass(!0),t.destroySecondPass();this.setCtrlsMap(e,new Map)}getCtrlsMap(e){switch(e){case"top":return this.topCtrls;case"bottom":return this.bottomCtrls;default:return this.centerCtrls}}setCtrlsMap(e,t){switch(e){case"top":this.topCtrls=t;break;case"bottom":this.bottomCtrls=t;break;default:this.centerCtrls=t;break}}destroy(){super.destroy(),this.destroyRowCtrls("top"),this.destroyRowCtrls("bottom"),this.destroyRowCtrls("center")}},fRe={moduleName:"CellSpan",version:ut,beans:[cRe,hRe]},pRe=class extends je{constructor(e,t){super(),this.cellCtrl=e,this.staticClasses=[],this.beans=t,this.column=e.column}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const{column:e,cellComp:t}=this,n=e.colDef,o=n.cellClassRules,s=this.getCellClassParams(e,n);AR(this.beans.expressionSvc,o===this.cellClassRules?void 0:this.cellClassRules,o,s,r=>t.toggleCss(r,!0),r=>t.toggleCss(r,!1)),this.cellClassRules=o}applyUserStyles(){const e=this.column,t=e.colDef,n=t.cellStyle;if(!n)return;let o;if(typeof n=="function"){const s=this.getCellClassParams(e,t);o=n(s)}else o=n;o&&this.cellComp.setUserStyles(o)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,n=e.colDef,o=this.getCellClassParams(e,n);for(const r of this.staticClasses)t.toggleCss(r,!1);const s=this.beans.cellStyles.getStaticCellClasses(n,o);this.staticClasses=s;for(const r of s)t.toggleCss(r,!0)}getCellClassParams(e,t){const{value:n,rowNode:o}=this.cellCtrl;return Ot(this.beans.gos,{value:n,data:o.data,node:o,colDef:t,column:e,rowIndex:o.rowIndex})}},gRe=class extends je{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,n,o){AR(this.beans.expressionSvc,void 0,e.cellClassRules,t,n,o),this.processStaticCellClasses(e,t,n)}getStaticCellClasses(e,t){const{cellClass:n}=e;if(!n)return[];let o;return typeof n=="function"?o=n(t):o=n,typeof o=="string"&&(o=[o]),o||[]}createCellCustomStyleFeature(e,t){return new pRe(e,t)}processStaticCellClasses(e,t,n){this.getStaticCellClasses(e,t).forEach(s=>{n(s)})}},mRe={moduleName:"CellStyle",version:ut,beans:[gRe]},vRe={moduleName:"RowStyle",version:ut,beans:[oCe]};function yRe(e,t){var n;return!!((n=e.colHover)!=null&&n.isHovered(t))}var wRe=class extends je{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=n=>{const{beans:o,gos:s,element:r,columns:i}=this,a=o.colHover;if(n??!!s.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(r,{mouseover:a.setMouseOver.bind(a,i),mouseout:a.clearMouseOver.bind(a)});else{for(const c of this.destroyManagedListeners)c();this.destroyManagedListeners=[]}}}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{this.enableFeature(e)}),this.enableFeature()}destroy(){super.destroy(),this.destroyManagedListeners=null}},CRe="ag-column-hover",bRe=class extends je{constructor(){super(...arguments),this.beanName="colHover"}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{e||this.clearMouseOver()})}setMouseOver(e){this.updateState(e)}clearMouseOver(){this.updateState(null)}isHovered(e){if(!this.gos.get("columnHoverHighlight"))return!1;const t=this.selectedColumns;return!!t&&t.indexOf(e)>=0}addHeaderColumnHoverListener(e,t,n){const o=()=>{const s=this.isHovered(n);t.toggleCss("ag-column-hover",s)};e.addManagedEventListeners({columnHoverChanged:o}),o()}onCellColumnHover(e,t){if(!t)return;const n=this.isHovered(e);t.toggleCss(CRe,n)}addHeaderFilterColumnHoverListener(e,t,n,o){this.createHoverFeature(e,[n],o);const s=()=>{const r=this.isHovered(n);t.toggleCss("ag-column-hover",r)};e.addManagedEventListeners({columnHoverChanged:s}),s()}createHoverFeature(e,t,n){e.createManagedBean(new wRe(t,n))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},SRe={moduleName:"ColumnHover",version:ut,beans:[bRe],apiFunctions:{isColumnHovered:yRe}},ERe=class extends je{constructor(){super(...arguments),this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){var e,t;this.wrapSvc=(t=(e=this.beans.frameworkOverrides).createGlobalEventListenerWrapper)==null?void 0:t.call(e)}addListener(e,t){var r;const n=((r=this.wrapSvc)==null?void 0:r.wrap(e,t))??t,o=!_w.has(e),s=o?this.asyncListeners:this.syncListeners;s.has(e)||s.set(e,new Set),s.get(e).add(n),this.eventSvc.addListener(e,n,o)}removeListener(e,t){var r,i;const n=((r=this.wrapSvc)==null?void 0:r.unwrap(e,t))??t,o=this.asyncListeners.get(e),s=!!(o!=null&&o.delete(n));s||(i=this.syncListeners.get(e))==null||i.delete(n),this.eventSvc.removeListener(e,n,s)}addGlobalListener(e){var r;const t=((r=this.wrapSvc)==null?void 0:r.wrapGlobal(e))??e,n=(i,a)=>{_w.has(i)&&t(i,a)},o=(i,a)=>{_w.has(i)||t(i,a)};this.globalListenerPairs.set(e,{syncListener:n,asyncListener:o});const s=this.eventSvc;s.addGlobalListener(n,!1),s.addGlobalListener(o,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:n,globalListenerPairs:o}=this,s=(n==null?void 0:n.unwrapGlobal(e))??e;if(o.has(s)){const{syncListener:i,asyncListener:a}=o.get(s);t.removeGlobalListener(i,!1),t.removeGlobalListener(a,!0),o.delete(e)}else this.syncGlobalListeners.delete(s),t.removeGlobalListener(s,!1)}destroyEventListeners(e,t){e.forEach((n,o)=>{n.forEach(s=>this.eventSvc.removeListener(o,s,t)),n.clear()}),e.clear()}destroyGlobalListeners(e,t){for(const n of e)this.eventSvc.removeGlobalListener(n,t);e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncListeners,!1),this.destroyEventListeners(this.asyncListeners,!0),this.destroyGlobalListeners(this.syncGlobalListeners,!1);const{globalListenerPairs:e,eventSvc:t}=this;e.forEach(({syncListener:n,asyncListener:o})=>{t.removeGlobalListener(n,!1),t.removeGlobalListener(o,!0)}),e.clear()}};function _Re(e,t,n){var o;(o=e.apiEventSvc)==null||o.addListener(t,n)}function RRe(e,t,n){var o;(o=e.apiEventSvc)==null||o.removeListener(t,n)}function TRe(e,t){var n;(n=e.apiEventSvc)==null||n.addGlobalListener(t)}function DRe(e,t){var n;(n=e.apiEventSvc)==null||n.removeGlobalListener(t)}var IRe={moduleName:"EventApi",version:ut,apiFunctions:{addEventListener:_Re,addGlobalListener:TRe,removeEventListener:RRe,removeGlobalListener:DRe},beans:[ERe]},xRe={moduleName:"Locale",version:ut,beans:[sbe]},PRe=class extends je{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=qo(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){var a,l,c,u;const{visibleCols:e,rowModel:t,rowSpanSvc:n,pinnedRowModel:o}=this.beans,s=e.autoHeightCols;let r=!1;const i=d=>{var p;const h=d.__autoHeights;let f=Tl(this.beans,d).height;for(const g of s){let v=h==null?void 0:h[g.getColId()];const C=n==null?void 0:n.getCellSpan(g,d);if(C){if(C.getLastNode()!==d)continue;if(v=(p=n==null?void 0:n.getCellSpan(g,d))==null?void 0:p.getLastNodeAutoHeight(),!v)return}if(v==null){if(this.colSpanSkipCell(g,d))continue;return}f=Math.max(v,f)}f!==d.rowHeight&&(d.setRowHeight(f),r=!0)};(a=o==null?void 0:o.forEachPinnedRow)==null||a.call(o,"top",i),(l=o==null?void 0:o.forEachPinnedRow)==null||l.call(o,"bottom",i),(c=t.forEachDisplayedNode)==null||c.call(t,i),r&&((u=t.onRowHeightChanged)==null||u.call(t))}setRowAutoHeight(e,t,n){if(e.__autoHeights??(e.__autoHeights={}),t==null){delete e.__autoHeights[n.getId()];return}const o=e.__autoHeights[n.getId()];e.__autoHeights[n.getId()]=t,o!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:n,colViewport:o,visibleCols:s}=this.beans;if(!n.colSpanActive)return!1;let r=[];switch(e.getPinned()){case"left":r=s.getLeftColsForRow(t);break;case"right":r=s.getRightColsForRow(t);break;case null:r=o.getColsWithinViewport(t);break}return!r.includes(e)}setupCellAutoHeight(e,t,n){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const o=t.parentElement,{rowNode:s,column:r}=e,i=this.beans,a=u=>{var S;if((S=this.beans.editSvc)!=null&&S.isEditing(e)||!e.isAlive()||!n.isAlive())return;const{paddingTop:d,paddingBottom:h,borderBottomWidth:f,borderTopWidth:p}=Uc(o),g=d+h+f+p,C=t.offsetHeight+g;if(u<5){const b=Lo(i),y=!(b!=null&&b.contains(t)),_=C==0;if(y||_){window.setTimeout(()=>a(u+1),0);return}}this.setRowAutoHeight(s,C,r)},l=()=>a(0);l();const c=El(i,t,l);return n.addDestroyFunc(()=>{c(),this.setRowAutoHeight(s,void 0,r)}),!0}setAutoHeightActive(e){this.active=e.list.some(t=>t.isVisible()&&t.isAutoHeight())}areRowsMeasured(){if(!this.active)return!0;const e=this.beans.rowRenderer.getAllRowCtrls();let t=null;for(const{rowNode:n}of e)if((!t||this.beans.colModel.colSpanActive)&&(t=this.beans.colViewport.getColsWithinViewport(n).filter(s=>s.isAutoHeight())),t.length!==0){if(!n.__autoHeights)return!1;for(const o of t){const s=n.__autoHeights[o.getColId()];if(!s||n.rowHeight<s)return!1}}return!0}},kRe={moduleName:"RowAutoHeight",version:ut,beans:[PRe]},FRe={moduleName:"AllCommunity",version:ut,dependsOn:[iG,VEe,qEe,Sbe,F0e,A0e,O0e,M0e,N0e,L0e,V0e,k0e,_Se,RSe,TSe,ESe,ISe,xSe,u_e,cEe,x_e,$$,B_e,$_e,q_e,Q_e,vme,iRe,Q0e,BCe,mRe,SRe,vRe,IRe,GCe,s_e,HH,xRe,kRe,mme,kEe,fRe]};let hG=!1;hG||(_ue.registerModules([FRe,iG]),hG=!0);class ARe{constructor(t,n){Tn(this,"gridApi",null);Tn(this,"container");Tn(this,"config");Tn(this,"eventListeners",new Map);this.container=t,this.config=n}init(){if(this.gridApi)throw new Error("Grid already initialized");const{onGridReady:t,onCellClicked:n,onCellFocused:o,onRowSelected:s,...r}=this.config,i={...r,onGridReady:a=>{this.gridApi=a.api,t&&t(a)},onCellClicked:a=>{n&&n(a)},onCellFocused:a=>{o&&o(a)},onRowSelected:a=>{s&&s(a)}};return this.gridApi=ebe(this.container,i),this.gridApi}updateRowData(t){this.gridApi&&this.gridApi.setGridOption("rowData",t)}updateColumnDefs(t){this.gridApi&&this.gridApi.setGridOption("columnDefs",t)}setColumnWidth(t){var n;this.gridApi&&((n=this.gridApi)==null||n.applyColumnState({state:t,applyOrder:!1}))}updateDatasource(t){this.gridApi&&this.gridApi.setGridOption("datasource",t)}refreshInfiniteCache(){this.gridApi&&this.gridApi.refreshInfiniteCache()}sizeColumnsToFit(){this.gridApi}deselectAll(){this.gridApi&&this.gridApi.deselectAll()}getSelectedRows(){var t;return((t=this.gridApi)==null?void 0:t.getSelectedRows())||[]}setQuickFilterText(t){this.gridApi&&this.gridApi.setGridOption("quickFilterText",t)}getColumnState(){var t;return(t=this.gridApi)==null?void 0:t.getColumnState()}addEventListener(t,n){if(!this.gridApi)throw new Error("Grid not initialized");this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t).add(n),this.gridApi.addEventListener(t,n)}addRow(t,n="bottom"){if(this.gridApi){const o={add:[t],addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(o),n==="bottom"){const s=this.gridApi.getDisplayedRowCount();s>0&&this.gridApi.ensureIndexVisible(s-1,"bottom")}}}addRows(t,n="bottom"){if(this.gridApi&&t.length>0){const o={add:t,addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(o),n==="bottom"){const s=this.gridApi.getDisplayedRowCount();s>0&&this.gridApi.ensureIndexVisible(s-1,"bottom")}}}destroy(){this.gridApi&&(this.eventListeners.forEach((t,n)=>{t.forEach(o=>{var s;(s=this.gridApi)==null||s.removeEventListener(n,o)})}),this.eventListeners.clear(),this.gridApi.destroy(),this.gridApi=null)}getApi(){return this.gridApi}switchTheme(t){document.body.dataset.agThemeMode=t==="dark"?"dark":"light"}}const ORe=j$.withParams({accentColor:"var(--primary-color)",backgroundColor:"#ffffff",borderColor:"#e5e7eb",borderRadius:4,browserColorScheme:"light",chromeBackgroundColor:"#f9fafb",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#111827",headerBackgroundColor:"#fff",headerFontSize:14,headerFontWeight:600,headerTextColor:"#374151",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"light").withParams({accentColor:"var(--primary-color)",backgroundColor:"#1f2937",borderColor:"#374151",borderRadius:4,browserColorScheme:"dark",chromeBackgroundColor:"#111827",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#f9fafb",headerBackgroundColor:"#374151",headerFontSize:14,headerFontWeight:600,headerTextColor:"#f9fafb",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"dark"),MRe=tt({__name:"AgTable",props:{statusBar:{},sideBar:{type:[Object,String,Array,Boolean,null]},suppressContextMenu:{type:Boolean},preventDefaultOnContextMenu:{type:Boolean},allowContextMenuWithControlKey:{type:Boolean},columnMenu:{},suppressMenuHide:{type:Boolean},enableBrowserTooltips:{type:Boolean},tooltipTrigger:{},tooltipShowDelay:{},tooltipHideDelay:{},tooltipMouseTrack:{type:Boolean},tooltipShowMode:{},tooltipInteraction:{type:Boolean},popupParent:{},copyHeadersToClipboard:{type:Boolean},copyGroupHeadersToClipboard:{type:Boolean},clipboardDelimiter:{},suppressCopyRowsToClipboard:{type:Boolean},suppressCopySingleCellRanges:{type:Boolean},suppressLastEmptyLineOnPaste:{type:Boolean},suppressClipboardPaste:{type:Boolean},suppressClipboardApi:{type:Boolean},suppressCutToClipboard:{type:Boolean},columnDefs:{},defaultColDef:{},defaultColGroupDef:{},columnTypes:{},dataTypeDefinitions:{},maintainColumnOrder:{type:Boolean},enableStrictPivotColumnOrder:{type:Boolean},suppressFieldDotNotation:{type:Boolean},headerHeight:{},groupHeaderHeight:{},floatingFiltersHeight:{},pivotHeaderHeight:{},pivotGroupHeaderHeight:{},hidePaddedHeaderRows:{type:Boolean},allowDragFromColumnsToolPanel:{type:Boolean},suppressMovableColumns:{type:Boolean},suppressColumnMoveAnimation:{type:Boolean},suppressMoveWhenColumnDragging:{type:Boolean},suppressDragLeaveHidesColumns:{type:Boolean},suppressGroupChangesColumnVisibility:{type:[Boolean,String]},suppressMakeColumnVisibleAfterUnGroup:{type:Boolean},suppressRowGroupHidesColumns:{type:Boolean},colResizeDefault:{},suppressAutoSize:{type:Boolean},autoSizePadding:{},skipHeaderOnAutoSize:{type:Boolean},autoSizeStrategy:{},components:{},editType:{},suppressStartEditOnTab:{type:Boolean},getFullRowEditValidationErrors:{type:Function},invalidEditValueMode:{},singleClickEdit:{type:Boolean},suppressClickEdit:{type:Boolean},readOnlyEdit:{type:Boolean},stopEditingWhenCellsLoseFocus:{type:Boolean},enterNavigatesVertically:{type:Boolean},enterNavigatesVerticallyAfterEdit:{type:Boolean},enableCellEditingOnBackspace:{type:Boolean},undoRedoCellEditing:{type:Boolean},undoRedoCellEditingLimit:{},defaultCsvExportParams:{},suppressCsvExport:{type:Boolean},defaultExcelExportParams:{},suppressExcelExport:{type:Boolean},excelStyles:{},findSearchValue:{},findOptions:{},quickFilterText:{},cacheQuickFilter:{type:Boolean},includeHiddenColumnsInQuickFilter:{type:Boolean},quickFilterParser:{type:Function},quickFilterMatcher:{type:Function},applyQuickFilterBeforePivotOrAgg:{type:Boolean},excludeChildrenWhenTreeDataFiltering:{type:Boolean},enableAdvancedFilter:{type:Boolean},alwaysPassFilter:{type:Function},includeHiddenColumnsInAdvancedFilter:{type:Boolean},advancedFilterParent:{},advancedFilterBuilderParams:{},advancedFilterParams:{},suppressAdvancedFilterEval:{type:Boolean},suppressSetFilterByDefault:{type:Boolean},enableFilterHandlers:{type:Boolean},filterHandlers:{},enableCharts:{type:Boolean},chartThemes:{},customChartThemes:{},chartThemeOverrides:{},chartToolPanelsDef:{},chartMenuItems:{type:[Array,Function]},loadingCellRenderer:{},loadingCellRendererParams:{},loadingCellRendererSelector:{type:Function},localeText:{},masterDetail:{type:Boolean},keepDetailRows:{type:Boolean},keepDetailRowsCount:{},detailCellRenderer:{},detailCellRendererParams:{},detailRowHeight:{},detailRowAutoHeight:{type:Boolean},context:{},alignedGrids:{type:[Array,Function]},tabIndex:{},rowBuffer:{},valueCache:{type:Boolean},valueCacheNeverExpires:{type:Boolean},enableCellExpressions:{type:Boolean},suppressTouch:{type:Boolean},suppressFocusAfterRefresh:{type:Boolean},suppressBrowserResizeObserver:{type:Boolean},suppressPropertyNamesCheck:{type:Boolean},suppressChangeDetection:{type:Boolean},debug:{type:Boolean},loading:{type:Boolean},overlayLoadingTemplate:{},loadingOverlayComponent:{},loadingOverlayComponentParams:{},suppressLoadingOverlay:{type:Boolean},overlayNoRowsTemplate:{},noRowsOverlayComponent:{},noRowsOverlayComponentParams:{},suppressNoRowsOverlay:{type:Boolean},pagination:{type:Boolean},paginationPageSize:{},paginationPageSizeSelector:{type:[Array,Boolean]},paginationAutoPageSize:{type:Boolean},paginateChildRows:{type:Boolean},suppressPaginationPanel:{type:Boolean},pivotMode:{type:Boolean},pivotPanelShow:{},pivotMaxGeneratedColumns:{},pivotDefaultExpanded:{},pivotColumnGroupTotals:{},pivotRowTotals:{},pivotSuppressAutoColumn:{type:Boolean},suppressExpandablePivotGroups:{type:Boolean},functionsReadOnly:{type:Boolean},aggFuncs:{},suppressAggFuncInHeader:{type:Boolean},alwaysAggregateAtRootLevel:{type:Boolean},aggregateOnlyChangedColumns:{type:Boolean},suppressAggFilteredOnly:{type:Boolean},removePivotHeaderRowWhenSingleValueColumn:{type:Boolean},animateRows:{type:Boolean},cellFlashDuration:{},cellFadeDuration:{},allowShowChangeAfterFilter:{type:Boolean},domLayout:{},ensureDomOrder:{type:Boolean},enableCellSpan:{type:Boolean},enableRtl:{type:Boolean},suppressColumnVirtualisation:{type:Boolean},suppressMaxRenderedRowRestriction:{type:Boolean},suppressRowVirtualisation:{type:Boolean},rowDragManaged:{type:Boolean},rowDragInsertDelay:{},suppressRowDrag:{type:Boolean},suppressMoveWhenRowDragging:{type:Boolean},rowDragEntireRow:{type:Boolean},rowDragMultiRow:{type:Boolean},rowDragText:{type:Function},dragAndDropImageComponent:{},dragAndDropImageComponentParams:{},fullWidthCellRenderer:{},fullWidthCellRendererParams:{},embedFullWidthRows:{type:Boolean},groupDisplayType:{},groupDefaultExpanded:{},autoGroupColumnDef:{},groupMaintainOrder:{type:Boolean},groupSelectsChildren:{type:Boolean},groupLockGroupColumns:{},groupAggFiltering:{type:[Boolean,Function]},groupTotalRow:{type:[String,Function]},grandTotalRow:{},suppressStickyTotalRow:{type:[Boolean,String]},groupSuppressBlankHeader:{type:Boolean},groupSelectsFiltered:{type:Boolean},showOpenedGroup:{type:Boolean},groupHideParentOfSingleChild:{type:[Boolean,String]},groupRemoveSingleChildren:{type:Boolean},groupRemoveLowestSingleChildren:{type:Boolean},groupHideOpenParents:{type:Boolean},groupAllowUnbalanced:{type:Boolean},rowGroupPanelShow:{},groupRowRenderer:{},groupRowRendererParams:{},treeData:{type:Boolean},treeDataChildrenField:{},treeDataParentIdField:{},rowGroupPanelSuppressSort:{type:Boolean},suppressGroupRowsSticky:{type:Boolean},groupHierarchyConfig:{},pinnedTopRowData:{},pinnedBottomRowData:{},enableRowPinning:{type:[Boolean,String]},isRowPinnable:{type:Function},isRowPinned:{type:Function},rowModelType:{},rowData:{},asyncTransactionWaitMillis:{},suppressModelUpdateAfterUpdateTransaction:{type:Boolean},datasource:{},cacheOverflowSize:{},infiniteInitialRowCount:{},serverSideInitialRowCount:{},suppressServerSideFullWidthLoadingRow:{type:Boolean},cacheBlockSize:{},maxBlocksInCache:{},maxConcurrentDatasourceRequests:{},blockLoadDebounceMillis:{},purgeClosedRowNodes:{type:Boolean},serverSideDatasource:{},serverSideSortAllLevels:{type:Boolean},serverSideEnableClientSideSort:{type:Boolean},serverSideOnlyRefreshFilteredGroups:{type:Boolean},serverSidePivotResultFieldSeparator:{},viewportDatasource:{},viewportRowModelPageSize:{},viewportRowModelBufferSize:{},alwaysShowHorizontalScroll:{type:Boolean},alwaysShowVerticalScroll:{type:Boolean},debounceVerticalScrollbar:{type:Boolean},suppressHorizontalScroll:{type:Boolean},suppressScrollOnNewData:{type:Boolean},suppressScrollWhenPopupsAreOpen:{type:Boolean},suppressAnimationFrame:{type:Boolean},suppressMiddleClickScrolls:{type:Boolean},suppressPreventDefaultOnMouseWheel:{type:Boolean},scrollbarWidth:{},rowSelection:{},cellSelection:{type:[Boolean,Object]},rowMultiSelectWithClick:{type:Boolean},suppressRowDeselection:{type:Boolean},suppressRowClickSelection:{type:Boolean},suppressCellFocus:{type:Boolean},suppressHeaderFocus:{type:Boolean},selectionColumnDef:{},rowNumbers:{type:[Boolean,Object]},suppressMultiRangeSelection:{type:Boolean},enableCellTextSelection:{type:Boolean},enableRangeSelection:{type:Boolean},enableRangeHandle:{type:Boolean},enableFillHandle:{type:Boolean},fillHandleDirection:{},suppressClearOnFillReduction:{type:Boolean},sortingOrder:{},accentedSort:{type:Boolean},unSortIcon:{type:Boolean},suppressMultiSort:{type:Boolean},alwaysMultiSort:{type:Boolean},multiSortKey:{},suppressMaintainUnsortedOrder:{type:Boolean},icons:{},rowHeight:{},rowStyle:{},rowClass:{},rowClassRules:{},suppressRowHoverHighlight:{type:Boolean},suppressRowTransform:{type:Boolean},columnHoverHighlight:{type:Boolean},gridId:{},deltaSort:{type:Boolean},treeDataDisplayType:{},enableGroupEdit:{type:Boolean},initialState:{},reactiveCustomComponents:{type:Boolean},renderingMode:{},theme:{},loadThemeGoogleFonts:{type:Boolean},themeCssLayer:{},styleNonce:{},themeStyleContainer:{},getContextMenuItems:{type:Function},getMainMenuItems:{type:Function},postProcessPopup:{type:Function},processUnpinnedColumns:{type:Function},processCellForClipboard:{type:Function},processHeaderForClipboard:{type:Function},processGroupHeaderForClipboard:{type:Function},processCellFromClipboard:{type:Function},sendToClipboard:{type:Function},processDataFromClipboard:{type:Function},isExternalFilterPresent:{type:Function},doesExternalFilterPass:{type:Function},getChartToolbarItems:{type:Function},createChartContainer:{type:Function},focusGridInnerElement:{type:Function},navigateToNextHeader:{type:Function},tabToNextHeader:{type:Function},navigateToNextCell:{type:Function},tabToNextCell:{type:Function},getLocaleText:{type:Function},getDocument:{type:Function},paginationNumberFormatter:{type:Function},getGroupRowAgg:{type:Function},isGroupOpenByDefault:{type:Function},ssrmExpandAllAffectsAllRows:{type:Boolean},initialGroupOrderComparator:{type:Function},processPivotResultColDef:{type:Function},processPivotResultColGroupDef:{type:Function},getDataPath:{type:Function},getChildCount:{type:Function},getServerSideGroupLevelParams:{type:Function},isServerSideGroupOpenByDefault:{type:Function},isApplyServerSideTransaction:{type:Function},isServerSideGroup:{type:Function},getServerSideGroupKey:{type:Function},getBusinessKeyForNode:{type:Function},getRowId:{type:Function},resetRowDataOnUpdate:{type:Boolean},processRowPostCreate:{type:Function},isRowSelectable:{type:Function},isRowMaster:{type:Function},fillOperation:{type:Function},postSortRows:{type:Function},getRowStyle:{type:Function},getRowClass:{type:Function},getRowHeight:{type:Function},isFullWidthRow:{type:Function},onToolPanelVisibleChanged:{type:Function},onToolPanelSizeChanged:{type:Function},onColumnMenuVisibleChanged:{type:Function},onContextMenuVisibleChanged:{type:Function},onCutStart:{type:Function},onCutEnd:{type:Function},onPasteStart:{type:Function},onPasteEnd:{type:Function},onColumnVisible:{type:Function},onColumnPinned:{type:Function},onColumnResized:{type:Function},onColumnMoved:{type:Function},onColumnValueChanged:{type:Function},onColumnPivotModeChanged:{type:Function},onColumnPivotChanged:{type:Function},onColumnGroupOpened:{type:Function},onNewColumnsLoaded:{type:Function},onGridColumnsChanged:{type:Function},onDisplayedColumnsChanged:{type:Function},onVirtualColumnsChanged:{type:Function},onColumnEverythingChanged:{type:Function},onColumnsReset:{type:Function},onColumnHeaderMouseOver:{type:Function},onColumnHeaderMouseLeave:{type:Function},onColumnHeaderClicked:{type:Function},onColumnHeaderContextMenu:{type:Function},onComponentStateChanged:{type:Function},onCellValueChanged:{type:Function},onCellEditRequest:{type:Function},onRowValueChanged:{type:Function},onCellEditingStarted:{type:Function},onCellEditingStopped:{type:Function},onRowEditingStarted:{type:Function},onRowEditingStopped:{type:Function},onBulkEditingStarted:{type:Function},onBulkEditingStopped:{type:Function},onBatchEditingStarted:{type:Function},onBatchEditingStopped:{type:Function},onUndoStarted:{type:Function},onUndoEnded:{type:Function},onRedoStarted:{type:Function},onRedoEnded:{type:Function},onCellSelectionDeleteStart:{type:Function},onCellSelectionDeleteEnd:{type:Function},onRangeDeleteStart:{type:Function},onRangeDeleteEnd:{type:Function},onFillStart:{type:Function},onFillEnd:{type:Function},onFilterOpened:{type:Function},onFilterChanged:{type:Function},onFilterModified:{type:Function},onFilterUiChanged:{type:Function},onFloatingFilterUiChanged:{type:Function},onAdvancedFilterBuilderVisibleChanged:{type:Function},onFindChanged:{type:Function},onChartCreated:{type:Function},onChartRangeSelectionChanged:{type:Function},onChartOptionsChanged:{type:Function},onChartDestroyed:{type:Function},onCellKeyDown:{type:Function},onGridReady:{type:Function},onGridPreDestroyed:{type:Function},onFirstDataRendered:{type:Function},onGridSizeChanged:{type:Function},onModelUpdated:{type:Function},onVirtualRowRemoved:{type:Function},onViewportChanged:{type:Function},onBodyScroll:{type:Function},onBodyScrollEnd:{type:Function},onDragStarted:{type:Function},onDragStopped:{type:Function},onDragCancelled:{type:Function},onStateUpdated:{type:Function},onPaginationChanged:{type:Function},onRowDragEnter:{type:Function},onRowDragMove:{type:Function},onRowDragLeave:{type:Function},onRowDragEnd:{type:Function},onRowDragCancel:{type:Function},isRowValidDropPosition:{type:Function},onRowResizeStarted:{type:Function},onRowResizeEnded:{type:Function},onColumnRowGroupChanged:{type:Function},onRowGroupOpened:{type:Function},onExpandOrCollapseAll:{type:Function},onPivotMaxColumnsExceeded:{type:Function},onPinnedRowDataChanged:{type:Function},onPinnedRowsChanged:{type:Function},onRowDataUpdated:{type:Function},onAsyncTransactionsFlushed:{type:Function},onStoreRefreshed:{type:Function},onHeaderFocused:{type:Function},onCellClicked:{type:Function},onCellDoubleClicked:{type:Function},onCellFocused:{type:Function},onCellMouseOver:{type:Function},onCellMouseOut:{type:Function},onCellMouseDown:{type:Function},onRowClicked:{type:Function},onRowDoubleClicked:{type:Function},onRowSelected:{type:Function},onSelectionChanged:{type:Function},onCellContextMenu:{type:Function},onRangeSelectionChanged:{type:Function},onCellSelectionChanged:{type:Function},onTooltipShow:{type:Function},onTooltipHide:{type:Function},onSortChanged:{type:Function},height:{},isSorting:{type:Boolean}},emits:["onGridReady","row-clicked","cell-clicked","cell-focused","row-selected","on-scroll"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=H(null);c0(r,()=>{var v;const g=(v=i.value)==null?void 0:v.getApi();g==null||g.clearFocusedCell()});const i=H(null),a=Y(()=>({width:"100%",height:o.height||"500px"})),l=Y(()=>({...o,theme:ORe}));function c(){var v;if(!r.value){console.warn("Grid container element not found");return}const g={...l.value,height:o.height};i.value=new ARe(r.value,g),i.value.init(),(v=i.value.getApi())==null||v.addEventListener("bodyScroll",()=>{s("on-scroll",new Event("scroll"))}),u()}function u(){var v;const g=((v=i.value)==null?void 0:v.getApi())??null;s("onGridReady",g)}function d(g){var C,S;if(!g)return;(C=i.value)==null||C.updateColumnDefs(g);const v=g.map(b=>b.field&&b.width&&!b.hide?{colId:b.field,width:b.width,flex:null}:null).filter(b=>b!==null);(S=i.value)==null||S.setColumnWidth(v)}function h(){var g;(g=i.value)==null||g.destroy(),i.value=null}function f(){var g;return((g=i.value)==null?void 0:g.getApi())||void 0}function p(){return i.value||null}return Qe(()=>o.columnDefs,(g,v)=>{const C=g==null?void 0:g.filter(b=>!b.hide).map(b=>b.field).join(","),S=v==null?void 0:v.filter(b=>!b.hide).map(b=>b.field).join(",");C!==S&&d(g)},{deep:!0}),Jn(()=>{h()}),t({gridApi:f,gridManager:p,syncColumnDefs:d}),en(()=>{c()}),Jn(()=>{h()}),(g,v)=>(K(),ce("div",{ref_key:"gridContainerRef",ref:r,style:hn(a.value),class:se(["ag-theme-quartz",["ag-table-container",o.isSorting?"is-sorting":""]])},null,6))}});function rh(e){return WV(e)}const NRe=()=>[...[{headerName:"Name",field:"name",sortable:!1,filter:!1,pinned:"left",lockPinned:!0,headerComponent:rh(Mc),suppressMovable:!0},{headerName:"Notes",field:"description",sortable:!1,filter:!1,suppressMovable:!1},{headerName:"Assignee",field:"assignees",sortable:!1,filter:!1,headerComponent:rh(Mc)},{headerName:"Status",field:"status",sortable:!1,filter:!1,headerComponent:rh(Mc)},{headerName:"Date Range",field:"dateRange",sortable:!1,filter:!1,headerComponent:rh(Mc)},{headerName:"Last Updated",field:"lastUpdated",sortable:!1,filter:!1,headerComponent:rh(Mc),cellRendererParams:n=>{var o,s,r;return{...n,value:(o=n==null?void 0:n.data)==null?void 0:o.lastUpdated.value,tooltip:((r=(s=n==null?void 0:n.data)==null?void 0:s.lastUpdated)==null?void 0:r.tooltip)||void 0,readOnly:!0}}},{headerName:"Completed On",field:"completedOn",sortable:!1,filter:!1,headerComponent:rh(Mc),cellRendererParams:n=>{var o,s,r;return{...n,value:(o=n==null?void 0:n.data)==null?void 0:o.completedOn.value,tooltip:((r=(s=n==null?void 0:n.data)==null?void 0:s.completedOn)==null?void 0:r.tooltip)||void 0,readOnly:!0}}}].map(n=>Sp.fromType(n))],Mw={WIDTH:60,HEADER_CLASS:"ag-checkbox-header"},LRe=()=>({field:"__checkboxSelection",checkboxSelection:!0,headerCheckboxSelection:!0,pinned:"left",width:Mw.WIDTH,minWidth:Mw.WIDTH,maxWidth:Mw.WIDTH,cellClass:"ag-checkbox-cell",headerClass:Mw.HEADER_CLASS,headerComponent:Py(Ese),suppressMovable:!0}),fG="blank",VRe=[fG,"__checkboxSelection","options"],BRe=["uiColumnResized","uiColumnMoved","api"],$Re={headerName:"",field:"options",sortable:!1,filter:!1,editable:!0,pinned:"right",lockPosition:!0,suppressMovable:!0,resizable:!1},pG=(e,t)=>t!=null&&t.width?{...e,width:t.width,flex:void 0}:e,HRe=(e,t,n)=>{const{getCachedValue:o,setCachedValue:s}=cf({dbName:"item_table_column_configs",storeName:"column_configs"}),r=async()=>{const d=await o(t);if(!d||typeof d!="string")return null;try{const h=JSON.parse(d);return Array.isArray(h)?h:null}catch(h){return console.error("Failed to parse cached column config:",h),null}},i=H([]),a=LRe();let l=0;const c=async d=>{const h=++l,f=await r();if(h!==l)return;const p=[];f==null||f.forEach(F=>{const{field:z,hide:j,width:Q,pinned:re}=F;p.push([z,j])});const g=new Map(p),v=NRe(),C=Sp.fromType($Re),S=!!f,y=((d==null?void 0:d.map(F=>{var z;return{headerName:F.name,field:`metric_${F.id}`,editable:((z=F==null?void 0:F.auth_permission)==null?void 0:z.permission)==2,sortable:!0,filter:!1,flex:1,context:{...F},hide:S?!g.get(`metric_${F.id}`):!(F.is_primary||F.is_point_metric),cellClass:"ag-cell-optimized",headerComponent:Py(Mc),headerComponentParams:()=>({headerType:F.metric_type.code=="number"||F.metric_type.code=="formula"?"number":"default"})}}))||[]).map(F=>Sp.fromType(F)),_=[a,...v,...y,C],E=[],D=[],T=[];for(const F of _)F.pinned==="left"?E.push(F):F.pinned==="right"||F.field===fG?D.push(F):T.push(F);if(!f||f.length===0){i.value=_;return}const P=new Map(f.map(F=>[F.field,F])),L=new Map(T.map(F=>[F.field,F])),I=[];for(const F of f)if(F.field&&L.has(F.field)){const z=L.get(F.field);I.push({...pG(z,F),hide:F.hide}),L.delete(F.field)}const x=Array.from(L.values()),O=[...I,...x].map(F=>({...F,lockPinned:!0})),N=F=>pG(F,P.get(F.field));i.value=[...E.map(N),...O,...D.map(N)]};Qe(e,d=>c(d),{immediate:!0});const u=mr((d,h)=>{if((d==null?void 0:d.source)!==void 0&&!BRe.includes(d.source))return;const f=n.value,p=f==null?void 0:f.getColumnDefs(),g=new Map;if(f==null||f.getColumnState().forEach(C=>{C.width&&g.set(C.colId,Number(C.width))}),i.value=p||i.value,!h)return;const v=(p??[]).filter(C=>C.field&&!VRe.includes(C.field)).map(C=>({field:C.field,hide:C.hide,width:g.get(C.field)||C.width,pinned:C.pinned}));s(t,JSON.stringify(v))},Ci);return GT(()=>u.cancel()),{columnDefs:i,checkboxColumn:a,saveColumnConfig:u}},GRe=()=>{const e=fn.getInstance().getItem("API_BASE_URL");return e!=null&&e.includes("v1")?e.slice(0,e.lastIndexOf("/v1")):String(e)},URe=e=>{var x,O,N;const{showMessage:t,showErrorNetMessage:n}=Es(),o=ro(),s={domainApi:GRe(),wsCode:fn.getInstance().getItem("ws.code"),entityId:e.value.entityId},r=(N=(O=(x=o==null?void 0:o.appContext)==null?void 0:x.config)==null?void 0:O.globalProperties)==null?void 0:N.apiConfig;if(!r||s.domainApi===""||s.wsCode==="")throw new Error("API configuration is missing in useItems");const i=new JM(r,s);i.on("call-api",F=>{F.success?t(F.apiCode,"success"):n(F)});const a=Go({}),l=H([]),c=H(!1),u=H(null),d=H(null),h=H(1),f=H(20);let p=Promise.resolve();const{setCachedUsers:g}=MY(),v=F=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",include_permission:"{include_permission}",include_permission_names:!0,q:F}),C=50,S=async(F,z,j)=>{if(!F.length)return[];const Q=Yj(F,z);return(await Promise.all(Q.map(j))).flat()},b=async F=>{try{return(await i.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:F})).data.map(j=>[j==null?void 0:j.id,j.permission])}catch(z){return console.error("Failed to fetch item permissions chunk:",z),[]}},y=async(F,z)=>{try{const j=await i.getMetricValues({workspaceId:e.value.workspaceId,item_ids:F,per_page:F.length*z.length,metric_ids:z}),Q=j.data.map(q=>{const V=new Map(q.item_metrics.map(G=>[G.metric_id,{value:G.value,auth_permission:G==null?void 0:G.auth_permission}])),k=Object.fromEntries(z.map(G=>[G,V.get(G)??null]));return[q==null?void 0:q.id,k]}),re=new Set(j.data.map(q=>q==null?void 0:q.id));for(const q of F)if(!re.has(q)){const V=Object.fromEntries(z.map(k=>[k,{value:null,auth_permission:void 0}]));Q.push([q,V])}return Q}catch(j){return console.error("Failed to fetch a chunk of metric values:",j),F.map(re=>[re,Object.fromEntries(z.map(q=>[q,void 0]))])}},_=async F=>{try{const z=await i.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:F,per_page:F.length}),j=z.data.flatMap(Q=>Q.assignees);return g(j),z.data.map(Q=>[Q==null?void 0:Q.id,Q==null?void 0:Q.assignees])}catch(z){return console.error("Failed to fetch a chunk of assigned users:",z),[]}},E=async F=>{if(!F.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const z=await S(F,C,b);return Object.fromEntries(z)}catch(z){return console.error("Failed to fetch item permissions:",z),{}}},D=async(F,z)=>!F.length||!z.length?{}:(p=p.then(async()=>{try{const re=[];let q=0;for(let k=0;k<z.length;k+=5){q++;const G=z.slice(k,k+5),ee=[];for(let Fe=0;Fe<G.length;Fe++){const Ge=G[Fe],fe=await S(F,C,X=>y(X,[Ge]));ee.push(fe),await new Promise(X=>setTimeout(X,500))}re.push(...ee);const ge=k+5>=z.length}const V={};for(const k of re.flat()){const[G,ee]=k;V[G]||(V[G]={}),Object.assign(V[G],ee)}return V}catch(j){return console.error("Failed to fetch metric values:",j),{}}}),p),T=async F=>{if(!F.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const z=await S(F,C,_);return Object.fromEntries(z)}catch(z){return console.error("Failed to fetch assigned users:",z),{}}};return{items:l,loading:c,error:u,pagination:d,currentPage:h,pageSize:f,cusorMap:a,fetchItems:async F=>{const{cursor:z,offset:j,size:Q,searchQuery:re}=F;let q=[];c.value=!0,u.value=null;try{const V=await i.getAllItem_cursor({...F,cursor:z||void 0,offset:j||void 0,pageSize:Q||f.value,...v(re),sortBy:F.sort_by});return l.value=V.data,d.value=V.meta,h.value=V.meta.current_page||0,q=V.data.map(k=>k==null?void 0:k.id),V}catch(V){throw u.value=V,console.error("Failed to fetch items (cursor):",V),V}finally{const V=async()=>{try{const[k,G]=await Promise.all([T(q),E(q)]);e.value.updateItemData({assignees:k,permission:G},q);const ee=await D(q,e.value.metricIds);e.value.setMetricValues(ee,new Set(q),e.value.metricIds)}catch(k){console.error("Post-fetch processing failed:",k)}};c.value=!1,setTimeout(V)}},getAssignableStatus:async F=>{try{return await i.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:F})}catch(z){throw console.error("Failed to fetch assignable status:",z),z}},getMetricList:async F=>{try{return await i.getMetricList({workspaceId:e.value.workspaceId,entityId:F})}catch(z){throw console.error("Failed to fetch metric list:",z),z}},getMetricValues:D,getAssignedUsers:T}};function WRe(e){return{updateRowData:(o,s)=>{if(!e.value)return;const r=[],i=new Set,a=e.value.getColumnDefs();if(!a)return;const l=a.map(c=>{if(c.field&&c.field.startsWith("metric_")&&(c.hide===!1||c.hide===void 0))return c.field}).filter(Boolean);s.forEach(c=>{var d;const u=(d=e.value)==null?void 0:d.getRowNode(c);if(u){if(r.push(u),o.assignees){const h=SY((o.assignees[c]||[]).map(aF));u.data.assignees=h,i.add("assignees")}o.permission&&(u.data.permissions=o.permission[c]),l.forEach(h=>{u.data[h]=u.data[h]??null})}}),i.add("assignees"),i.add("status"),i.add("dateRange"),i.add("moreActions"),i.add("name"),i.add("description"),e.value.refreshCells({rowNodes:r,columns:Array.from(i),force:!0})},setMetricValues:(o,s,r)=>{const i=e.value;if(!i)return;const a=new Map(Array.from(s).map(c=>[c,new Map(r.map(u=>[u,{value:null,auth_permission:void 0}]))]));Object.entries(o).forEach(([c,u])=>{Object.entries(u).forEach(([d,h])=>{var f;(f=a.get(c))==null||f.set(d,{value:h==null?void 0:h.value,auth_permission:h==null?void 0:h.auth_permission})})});const l=Array.from(a.entries()).map(([c,u])=>{const d=i.getRowNode(c);return d!=null&&d.data?(u.forEach((h,f)=>{const p=`metric_${f}`;d.data[p]=(h==null?void 0:h.value)||null;const g=`metric_permission_${f}`;d.data[p]=(h==null?void 0:h.value)||null,d.data[g]=(h==null?void 0:h.auth_permission)||null}),d):null});l.length>0&&i.refreshCells({rowNodes:l,columns:Array.from(r).map(c=>`metric_${c}`),force:!0})}}}function zRe(e,t,n,o,s){let r=!0;return{async getRows(i){try{o(!0),r&&(s(!0),r=!1);const a=Math.floor(i.startRow/t)+1,{rows:l,total:c}=await e({page:a,pageSize:t,filterText:n(),sort_by:i.sortModel});let u=-1;Number.isFinite(c)?u=c:l.length<t&&(u=i.startRow+l.length),i.context={pageSize:t,text:n()},i.successCallback(l,u),o(!1),s(!1)}catch(a){console.error("Datasource fetch error:",a),i.failCallback(),o(!1),s(!1)}}}}function jRe(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:o,gridApi:s,fetcher:r}=e,i=H(!0),a=H(!0),l=H(!1),c=()=>{n.value=!n.value},u=v=>{if(i.value=!1,s.value=v,!v)return null;const{addEventListener:C,setGridOption:S}=v;if(!r)return console.error("Fetcher function is undefined"),null;const b=zRe(r,e.perPage,()=>o.value,y=>{i.value=y},y=>{a.value=y});return S==null||S("datasource",b),C==null||C("selectionChanged",()=>{t.value=v.getSelectedRows()}),v||null},d=v=>{var C,S;if((C=s.value)==null||C.hideOverlay(),v!==void 0&&(o.value=v),(S=s.value)==null||S.deselectAll(),t.value=[],i.value=!0,!s.value||!r){console.error("Grid API or fetcher is not available"),i.value=!1;return}l.value=!0,a.value=!0,s.value.purgeInfiniteCache(),s.value.ensureIndexVisible(0,"top"),setTimeout(()=>{i.value=!1,setTimeout(()=>{l.value=!1},100)},300)},h=()=>{var v;(v=s.value)==null||v.deselectAll(),t.value=[]},f=mr(v=>{d(v)},Ci);return{isLoading:i,toggleSidebar:c,onGridReady:u,onSearch:f,handleUnSelect:h,firstLoad:a,cacheCleared:l,handleSelectAll:()=>{s.value},isSelectAll:H(!1)}}const KRe={changelog:{"1.0.1":{date:"2024-06-20",changes:["Fixed styling issues for archived and deleted rows."]},"1.0.0":{date:"2024-06-15",changes:["Initial release of the Item Table package."]},"0.0.1-alpha.8":{date:"2024-06-10",changes:["Improved performance of row updates.","Added support for custom cell renderers.","Add row hover effect for better UX.","Add loading skeleton for filter","Beta release with core functionalities implemented."]},"0.0.1-alpha.9":{date:"2024-06-05",changes:["Add row selection feature.","Fix bug with column resizing.","Optimize rendering for large datasets.","Implement getLog function to retrieve changelog entries based on version.","Display app version and changelog in the Item Table component tooltip.","Clean up unused autocomplete and memoized config composables.","Update styles for better consistency and readability."]},"0.0.1-alpha.11":{date:"2024-06-18",changes:["Add bulk process status display: items now show an hourglass icon and tooltip when being processed.","Update data model: added isProcessing and bulk_process properties to track item status.","Improve row focus: focused rows now flash for better visibility.","Set 'Last Updated' and 'Completed On' columns as read-only.","Fix: resolve visual fetching issue in useRemoteFiles composable.","Fix: use correct upload icon in PopupCreateScenes component.","Enhance data conversion to include processing status in item rows."]},"0.0.1-alpha.12":{date:"2024-06-12",changes:["feat: enhance Snackbar component and notification handling","Refactor Snackbar.vue for improved readability and styling, including color adjustments for icons and text.","Add showMessage function in notifications store to display messages based on API keys, improving notification management.","Introduce notificationMessage constant to centralize notification messages for various API actions, enhancing maintainability.","Remove unnecessary console logs from useRemoteFiles and improve logging in notification store for better debugging."]},"0.0.1-alpha.16":{date:"2024-06-20",changes:["Add onboarding tour feature and enhance UI components with new dependencies","Refactor UI components for improved styling and functionality","Updated RatingComponent.vue to streamline class bindings and improve accessibility attributes.","Enhanced SearchBox.vue by adding a clear event handler and simplifying icon rendering.","Modified AssigneeGroupEditor.vue and AssigneeGroupRenderer.vue to remove unnecessary size attributes from icons.","Adjusted DateRangeRenderer.vue to remove size attributes from icons for consistency.","Updated HeaderCheckbox.vue to set dropdown placement to 'bottom-start'.","Refined HeaderSorting.vue to simplify sort option labels and improve sorting logic.","Enhanced HeaderWrapper.vue to utilize reactive properties for sorting state.","Improved HyperLinkEditor.vue and HyperLinkInlineEditor.vue by removing size attributes from icons.","Updated PopupLayout.vue to use a CSS variable for box-shadow styling.","Refined Snackbar.vue to standardize icon colors and improve styling consistency.","Adjusted useTippy.ts to set default placement and arrow visibility for tooltips.","Modified notificationMessage.ts to remove error messages for list fetching.","Cleaned up notifications.ts by removing console logs for a cleaner codebase.","Updated sortStore.ts to comment out unnecessary console logs for better performance.","Enhanced styles.scss by defining new icon size variables and standardizing box-shadow styles."]},"0.0.99":{date:"2024-06-24",changes:["Fix: resolve issue with incorrect version display in Item Table component.","Update changelog retrieval logic to ensure accurate version matching.","Enhance tooltip display for app version and changelog in Item Table component."]}}},qRe=e=>{var t;return(t=Object.entries(KRe.changelog).find(([n,o])=>n===e))==null?void 0:t[1].changes},YRe={class:"visual-btn-visual"},XRe={class:"visual-btn--label"},ZRe={key:0,class:"visual-btn--description"},JRe={key:1,class:"visual-btn--description"},QR=bt(tt({__name:"VisualButton",props:{label:{},description:{},disabled:{type:Boolean}},emits:["onClick"],setup(e,{emit:t}){const n=e,o=()=>{n.disabled||s("onClick")},s=t;return(r,i)=>(K(),ce("div",{class:se(["visual-btn",{"visual-btn--disabled":e.disabled}]),onClick:o},[Te("div",YRe,[xt(r.$slots,"visual",{},()=>[i[0]||(i[0]=mz('<svg width="42" height="36" viewBox="0 0 42 36" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-c2003bd7><g clip-path="url(#clip0_4824_13082)" data-v-c2003bd7><path d="M5.14286 18V10.2857H18V18H5.14286ZM5.14286 23.1 429H18V30.8571H5.14286V23.1429ZM23.1429 30.8571V23.1429H36V30.8571H23.1429ZM36 18H23.1429V10.2857H36V18ZM5.14286 0C2.30625 0 0 2.30625 0 5.14286V30.8571C0 33.6937 2.30625 36 5.14286 36H36C38.8366 36 41.1429 33.6937 41.1429 30.8571V5.14286C41.1429 2.30625 38.8366 0 36 0H5.14286Z" fill="#D7D7D7" data-v-c2003bd7></path><path d="M0 5.14286C0 2.30625 2.30625 0 5.14286 0H36C38.8366 0 41.1429 2.30625 41.1429 5.14286V10.318H0V5.14286Z" fill="#A6A6A6" data-v-c2003bd7></path></g><defs data-v-c2003bd7><clipPath id="clip0_4824_13082" data-v-c2003bd7><rect width="41.1429" height="36" fill="white" data-v-c2003bd7></rect></clipPath></defs></svg>',1))],!0)]),Te("div",XRe,it(n.label),1),n.disabled?(K(),ce("div",ZRe," Coming soon ")):(K(),ce("div",JRe,it(n.description),1))],2))}}),[["__scopeId","data-v-c2003bd7"]]),eT="xlsx_toolbox",QRe="TOOLBOX_EXPORT_DATA",eTe="https://app.arbocollab.com",tTe=1e3,gG=()=>sessionStorage.getItem("BASE_URL"),mG=(e,t="xlsx-mapping")=>{const n=In("switchInstance",void 0),o=`${t}:load`,s=`${t}:edit`,r=new Set;let i;const a=()=>{const h={showLoad:!1};n?n(eT,"",h):window.appManager.switchInstance(eT,"",h)},l=(h,f)=>{console.log("Posting to Toolbox:",{type:h,payload:f});const p=setTimeout(()=>{r.delete(p),window.postMessage({type:h,payload:f},`${gG()}`)},tTe);r.add(p)},c=h=>{if(!h)throw new Error("Payload is missing");a(),l(o,h)},u=(h,f)=>{if(!h)throw new Error("Error file is missing");a(),l(s,{file:h})},d=h=>{if((h==null?void 0:h.type)!==QRe)return;const{file:f,fileName:p}=h.payload;e(new File([f],p,{type:f.type}),p),window.appManager.hide(eT)};return en(()=>{i=Bte({target:window,allowedOrigins:[gG()||eTe],onMessage:d,onInvalidMessage:(h,f,p)=>{console.warn("Rejected postMessage:",f,p.origin)}})}),Jn(()=>{i==null||i(),r.forEach(clearTimeout),r.clear()}),{openToolbox:c,sendBackErrorFile:u}},nTe={class:"header-name"},oTe={class:"modal-body"},sTe={class:"description"},rTe={key:0,class:"error-message"},iTe={class:"dynamic"},aTe={key:1,class:"choose-method-container"},lTe={key:2,class:"select-status-container"},cTe={key:3,class:"result-container"},uTe={key:4,class:"result-container"},dTe={key:2},vG="text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",hTe=20,fTe=bt(tt({__name:"PopupToolboxUploader",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const o=Kt,s=Y(()=>[1,2].includes(f.value)),r=Y(()=>DS()),i=Y(()=>({1:{title:`Create ${r.value} in bulk`,description:""},2:{title:"Select status",description:"Choose the starting status for the new work."},3:{title:"Import successful",description:"Work will be created in background. Refresh to see updates."},4:{title:"Import failed",description:"Some data doesn't meet the requirements. Review it and try again."},5:{title:"Waiting for Toolbox",description:"Waiting for Toolbox"}})),a={"--popup-pt":"20px","--popup-pb":"20px","--popup-pl":"24px","--popup-pr":"24px"},l=e,c=n,{apiServices:u}=io(!1,l),d=1,h=H(),f=H(d),p=H(null),g=H(null),v=H(null),C=H(void 0),S=H(null),b=Y(()=>i.value[f.value]),y=H(),_=()=>{var V;p.value=null,f.value=d,g.value=null,v.value=null,E.value=null,S.value=null,(V=y.value)==null||V.clear(),C.value=void 0};Qe([g,v],([V,k])=>{f.value===1&&V&&k&&(f.value=2)});const E=H(null),D=V=>Es().getErrorMessageFromResponse(V),T=V=>{if(console.error(V),typeof V=="string"){E.value=V;return}const k=V.response,G=k==null?void 0:k.data,ee=D(G);E.value=ee??V.message,console.log("Error message set to:",{errorMsg:ee,message:V})},P=async(V,k)=>{var ee;if(Q.value=!0,!u.value||!l.workspaceId||!l.entityId){console.error("API services not available");return}const G=new FormData;G.append("file",V),G.append("format",((ee=k??V.name)==null?void 0:ee.split(".").pop())??V.name.split(".").pop()??""),G.append("entity_id",l.entityId),G.append("template_flow_status_id",p.value??"");try{await u.value.addNewSceneViaImportFile(l.workspaceId,l.entityId,G),f.value=3,c("import-success")}catch(ge){console.error("Error uploading file:",ge),T(ge||"An unknown error occurred during file upload."),f.value=4}finally{Q.value=!1}},{openToolbox:L,sendBackErrorFile:I}=mG((V,k)=>{v.value=V,C.value=k??V.name,f.value=2}),x=async()=>{const V=await N();try{L({template:V})}catch(k){console.error("Error opening toolbox:",k),Es().showErrorNetMessage("Failed to open toolbox.")}},O=H(!1),N=async()=>{O.value=!0;const V=l.workspaceId,k=l.entityId;if(!V||!k||!u.value)return console.error("Workspace ID or Entity ID is missing"),Promise.reject(new Error("Workspace ID or Entity ID is missing"));try{const G=await u.value.downloadTemplate(V,k,!1);if(!G)throw new Error("No response from downloadTemplate API");return G}catch(G){return console.error("Error downloading template:",G),Promise.reject(G)}finally{O.value=!1}},F=V=>{const k=vG.includes(V.type);return k||(console.error("Invalid file type:",V.type),Es().addNotification({id:"invalid-file-type",message:"Invalid file type. Please upload a xlsx, xls, csv file.",type:"error"})),k},z=async()=>{const V=document.createElement("input");V.type="file",V.accept=vG,V.onchange=async()=>{var G;const k=(G=V.files)==null?void 0:G[0];if(k){if(!F(k)){_();return}g.value=Hm(k);try{const ee=await N();if(!ee){Es().addNotification({id:"failed-download-template",message:"Failed to download template file.",type:"error"});return}L({source:k,template:ee})}catch(ee){console.error("Error opening toolbox:",ee),Es().addNotification({id:"failed-open-toolbox",message:"Failed to open toolbox.",type:"error"})}}},V.click()},j=async V=>{var k;if(!((k=u.value)!=null&&k.getAssignableStatuses)){console.error("API services not available");return}return u.value.getAssignableStatuses(l.workspaceId,{entity_id:l.entityId,name_like:V.name_like,page:V.page,per_page:hTe})},Q=H(!1),re=()=>{p.value=null,v.value&&C.value&&I(v.value,C.value)},q=()=>{p.value&&v.value&&(Q.value=!0,P(v.value,C.value).finally(()=>{Q.value=!1}))};return t({open:()=>{var V;return(V=h.value)==null?void 0:V.show()},close:()=>{var V;return(V=h.value)==null?void 0:V.hide()}}),(V,k)=>(K(),ze(W(ON),jt({ref_key:"popupRef",ref:h,style:a,onHidden:_},{popupIndex:10,popupName:b.value.title,minWidth:"420px",showOverlay:!0,overlayOpacity:.5,closeOnOverlayClick:!1,closeOnEscape:!0,showCloseBtn:s.value}),Lh({header:be(()=>[Te("span",nTe,it(b.value.title),1)]),default:be(()=>[Te("div",oTe,[Te("div",sTe,it(b.value.description),1),E.value&&f.value===4?(K(),ce("div",rTe,[k[3]||(k[3]=nt(" Error code ",-1)),Te("span",iTe,it(E.value),1)])):Xe("",!0),f.value===1?(K(),ce("div",aTe,[ye(QR,{disabled:!1,label:"Start with a blank sheet",description:`Type or paste ${r.value} details
|
|
255
255
|
into a table.`,onOnClick:x},{visual:be(()=>[ye(W(ll),{src:"BlankSheet",size:65})]),_:1},8,["description"]),ye(QR,{label:"Import from file",description:`Create ${r.value} from a CSV or
|
|
256
256
|
Excel file.`,onOnClick:z},{visual:be(()=>[ye(W(ll),{src:"UploadFile",size:65,"max-width":"65"})]),_:1},8,["description"])])):f.value===2?(K(),ce("div",lTe,[ye(W(Ore),{modelValue:p.value,"onUpdate:modelValue":k[0]||(k[0]=G=>p.value=G),"get-status-func":j,"workspace-id":l.workspaceId,id:l.entityId,style:{width:"100%"},"max-width":"372px",ref_key:"selectStatusRef",ref:y},null,8,["modelValue","workspace-id","id"])])):f.value===3?(K(),ce("div",cTe,[ye(W(ll),{src:"Success",width:240,height:180,ratio:"unset"})])):f.value===4?(K(),ce("div",uTe,[ye(W(ll),{src:"Failed",width:240,height:180,ratio:"unset"})])):Xe("",!0)])]),_:2},[f.value===2||f.value===4||f.value===3?{name:"footer",fn:be(()=>[f.value===4?(K(),ze(W(pt),{key:0,variant:"secondary",onClick:k[1]||(k[1]=()=>{var G;_(),(G=h.value)==null||G.hide()})},{default:be(()=>[...k[4]||(k[4]=[nt(" Close ",-1)])]),_:1})):f.value===3?(K(),ze(W(pt),{key:1,variant:"secondary",onClick:k[2]||(k[2]=()=>{var G;_(),(G=h.value)==null||G.hide()})},{default:be(()=>[...k[5]||(k[5]=[nt(" Got it ",-1)])]),_:1})):Xe("",!0),f.value===2?qe((K(),ce("div",dTe,[ye(W(pt),{loading:Q.value,disabled:Q.value||!p.value,onClick:q},{default:be(()=>[...k[6]||(k[6]=[nt(" Import ",-1)])]),_:1},8,["loading","disabled"])])),[[W(o),{content:Q.value||!p.value?"Select a status first":void 0,bypassOverflowCheck:!0}]]):Xe("",!0),f.value===4?(K(),ze(W(pt),{key:3,onClick:re},{default:be(()=>[...k[7]||(k[7]=[nt(" Try Again ",-1)])]),_:1})):Xe("",!0)]),key:"0"}:void 0]),1040))}}),[["__scopeId","data-v-aff6ff8a"]]),pTe={class:"header-name"},gTe={class:"modal-body"},mTe={class:"description"},vTe={key:0,class:"error-message"},yTe={class:"dynamic"},wTe={key:1,class:"choose-method-container"},CTe={key:2,class:"result-container"},bTe={key:3,class:"result-container"},STe={key:2},yG="text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",ETe=bt(tt({__name:"PopupBulkUpdate",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const o=Kt,s=Y(()=>[1,2].includes(f.value)),r=Y(()=>DS()),i=Y(()=>({1:{title:`Update ${r.value} in bulk`,description:""},2:{title:"Select status",description:"Choose the starting status for the new work."},3:{title:"Import successful",description:"Work will be created in background. Refresh to see updates."},4:{title:"Import failed",description:"Some data doesn't meet the requirements. Review it and try again."},5:{title:"Waiting for Toolbox",description:"Waiting for Toolbox"}})),a={"--popup-pt":"20px","--popup-pb":"20px","--popup-pl":"24px","--popup-pr":"24px"},l=e,c=n,{apiServices:u}=io(!1,l),d=1,h=H(),f=H(d),p=H(null),g=H(null),v=H(null),C=H(void 0),S=H(null),b=Y(()=>i.value[f.value]),y=H(),_=()=>{var re;p.value=null,f.value=d,g.value=null,v.value=null,E.value=null,S.value=null,(re=y.value)==null||re.clear(),C.value=void 0};Qe([g,v],([re,q])=>{f.value===1&&re&&q&&(f.value=2)});const E=H(null),D=re=>Es().getErrorMessageFromResponse(re),T=re=>{if(typeof re=="string"){E.value=re;return}const q=re.response,V=q==null?void 0:q.data,k=D(V);E.value=k??re.message,console.log("Error message set to:",{errorMsg:k,message:re})},P=async(re,q)=>{var G;z.value=!0;const V=new FormData,k=((G=re.name.split(".").pop())==null?void 0:G.toString())||"";if(V.append("file",re),V.append("format",k),V.append("entity_id",l.entityId||""),!u.value){console.error("API services not available");return}try{await u.value.overwriteScenesViaImportFile(l.workspaceId,l.entityId,V),f.value=3,c("import-success")}catch(ee){console.error("Error uploading file:",ee),T(ee),f.value=4}finally{z.value=!1}},{openToolbox:L,sendBackErrorFile:I}=mG((re,q)=>{v.value=re,C.value=q??re.name,P(re)},"feedback-merge"),x=H(!1),O=async()=>{x.value=!0;const re=l.workspaceId,q=l.entityId;if(!re||!q||!u.value)return console.error("Workspace ID or Entity ID is missing"),Promise.reject(new Error("Workspace ID or Entity ID is missing"));try{const V=await u.value.downloadExportedItemsFile(re,q,!1);if(!V)throw new Error("No response from downloadTemplate API");return V}catch(V){return console.error("Error downloading template:",V),Promise.reject(V)}finally{x.value=!1}},N=re=>{const q=yG.includes(re.type);return q||(console.error("Invalid file type:",re.type),Es().addNotification({id:"invalid-file-type",message:"Invalid file type. Please upload a xlsx, xls, csv file.",type:"error"})),q},F=async()=>{const re=document.createElement("input");re.type="file",re.accept=yG,re.onchange=async()=>{var V;const q=(V=re.files)==null?void 0:V[0];if(q){if(!N(q)){_();return}g.value=Hm(q);try{const k=await O();if(!k){Es().addNotification({id:"failed-download-template",message:"Failed to download file.",type:"error"});return}L({exportFile:k,feedbackFile:q})}catch(k){console.error("Error opening toolbox:",k),Es().addNotification({id:"failed-open-toolbox",message:"Failed to open toolbox.",type:"error"})}}},re.click()},z=H(!1),j=()=>{p.value=null,v.value&&C.value&&I(v.value,C.value)},Q=()=>{p.value&&v.value&&(z.value=!0,P(v.value,C.value).finally(()=>{z.value=!1}))};return t({open:()=>{var re;return(re=h.value)==null?void 0:re.show()},close:()=>{var re;return(re=h.value)==null?void 0:re.hide()}}),(re,q)=>(K(),ze(W(ON),jt({ref_key:"popupRef",ref:h,style:a,onHidden:_},{popupIndex:10,popupName:b.value.title,minWidth:"420px",showOverlay:!0,overlayOpacity:.5,closeOnOverlayClick:!1,closeOnEscape:!0,showCloseBtn:s.value}),Lh({header:be(()=>[Te("span",pTe,it(b.value.title),1)]),default:be(()=>[Te("div",gTe,[Te("div",mTe,it(b.value.description),1),E.value&&f.value===4?(K(),ce("div",vTe,[q[2]||(q[2]=nt(" Error code ",-1)),Te("span",yTe,it(E.value),1)])):Xe("",!0),f.value===1?(K(),ce("div",wTe,[ye(QR,{disabled:!1,label:"Import from file",description:`Update ${r.value} from a CSV or Excel file.`,onOnClick:F,style:{width:"100%"}},{visual:be(()=>[ye(W(ll),{src:"UploadFile",size:65})]),_:1},8,["description"])])):f.value===3?(K(),ce("div",CTe,[ye(W(ll),{src:"Success",width:240,height:180,ratio:"unset"})])):f.value===4?(K(),ce("div",bTe,[ye(W(ll),{src:"Failed",width:240,height:180,ratio:"unset"})])):Xe("",!0)])]),_:2},[f.value===2||f.value===4||f.value===3?{name:"footer",fn:be(()=>[f.value===4?(K(),ze(W(pt),{key:0,variant:"secondary",onClick:q[0]||(q[0]=()=>{var V;_(),(V=h.value)==null||V.hide()})},{default:be(()=>[...q[3]||(q[3]=[nt(" Close ",-1)])]),_:1})):f.value===3?(K(),ze(W(pt),{key:1,variant:"secondary",onClick:q[1]||(q[1]=()=>{var V;_(),(V=h.value)==null||V.hide()})},{default:be(()=>[...q[4]||(q[4]=[nt(" Got it ",-1)])]),_:1})):Xe("",!0),f.value===2?qe((K(),ce("div",STe,[ye(W(pt),{loading:z.value,disabled:z.value||!p.value,onClick:Q},{default:be(()=>[...q[5]||(q[5]=[nt(" Import ",-1)])]),_:1},8,["loading","disabled"])])),[[W(o),{content:z.value||!p.value?"Select a status first":void 0,bypassOverflowCheck:!0}]]):Xe("",!0),f.value===4?(K(),ze(W(pt),{key:3,onClick:j},{default:be(()=>[...q[6]||(q[6]=[nt(" Try Again ",-1)])]),_:1})):Xe("",!0)]),key:"0"}:void 0]),1040))}}),[["__scopeId","data-v-8e0ab60d"]]),_Te=bt(tt({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=Ns,o=r0(),{setUserPermissions:s,setEntityPermissions:r}=o,{entityPermissions:i}=us(o),a=Kt,l=Uo,c=H(null),u={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},d=H(""),h=Y(()=>{var Ke;const Ne=((Ke=i.value)==null?void 0:Ke.has_create_item_permission)==1||!1;return[{label:"Create in bulk",value:"import_scenes",type:"text",id:"import_scenes_option",hide:!Ne},{label:"Update in bulk",value:"bulk_update",type:"text",hide:!Ne,id:"bulk_update_option"}]}),f=e;Sp.initialize({wrapVueCellRenderer:Py,wrapVueCellEditor:WV});const p=Vf(),{switchInstanceFunc:g}=us(p);en(()=>{const Ne=ro();g.value=Ne==null?void 0:Ne.appContext.config.globalProperties.switchInstance;const Ke=new BroadcastChannel("focusable_channel");ft(()=>{setTimeout(()=>{Ke.postMessage("Focusable elements updated")},7e3)})});const v=H(null),C=H([]),S=qv(),{rowCount:b}=us(S),y=H(!1),_=H(""),E=H(),D=_O(),{metricList:T}=us(D),P=H(""),L=H(!1),I=H(new Set),x=H(new Map),{apiServices:O}=io(!1,f),{columnDefs:N,checkboxColumn:F,saveColumnConfig:z}=HRe(T,f.entityId,v),j=H();Qe(()=>N,()=>{var Ne;(Ne=j.value)==null||Ne.updateColumnDefs(N.value)},{deep:!0});const Q=(Ne,Ke)=>{z(Ne,Ke)},{updateRowData:re,setMetricValues:q}=WRe(v),V=Y(()=>({isSearching:_.value.length>0,isFiltering:!(Object.keys(xe.value||{}).length==1&&Object.keys(xe.value)[0]=="preflight_status")&&Object.keys(xe.value||{}).length>0})),k=Y(rv),G=Y(()=>N.value.filter(Ne=>{var Ke;return((Ke=Ne.field)==null?void 0:Ke.startsWith("metric_"))&&!Ne.hide}).map(Ne=>{var Ke;return((Ke=Ne.field)==null?void 0:Ke.replace("metric_",""))||""}));ui("timezone",k);const ee=Y(()=>({autoFetch:!1,workspaceId:f.workspaceId,entityId:f.entityId,metricIds:G.value,updateItemData:re,setMetricValues:q})),{fetchItems:ge,getMetricList:Fe,cusorMap:Ge,getMetricValues:fe}=URe(ee),X=Y(()=>{if(!v.value)return!1;const Ne=v.value.getSelectedRows().length;return Ne>0&&Ne>=b.value.total}),we=Y(()=>{var Ne;return((Ne=c.value)==null?void 0:Ne.name)||"Items"}),de=Ne=>{setTimeout(()=>{ft(()=>{var Ke,Wt;v.value&&(Ne?(Ke=v.value)==null||Ke.showNoRowsOverlay():(Wt=v.value)==null||Wt.hideOverlay())})},500)},B=(Ne,Ke)=>{var Wt;b.value.total=Ne.meta.total??0,(Wt=Ne.meta.next)!=null&&Wt.cursor&&(Ge[Ke+1]=Ne.meta.next.cursor),P.value=Ne.meta["X-Tsr-signature"]||"",Ne.meta.total===0?de(!0):de(!1)},te=iL(),{setDefaultSort:ne}=te,oe=H(null),{sortingAPIConfiguration:ae,isSortingRunning:ue}=us(te),xe=H({preflight_status:"1"}),le=Y(()=>({...xe.value,search:_.value}));ui("filterParams",le);const M=H([]),$=async({page:Ne,pageSize:Ke,filterText:Wt})=>{var nn,Bo,Po;(nn=v.value)==null||nn.hideOverlay();const gn=Ge[Ne],Js=!gn&&Ne>1?(Ne-1)*Ke:void 0,ks=ae.value;ks.length>0&&(ue.value=!0);try{const uh={cursor:gn,size:Ke,searchQuery:Wt,offset:Js,sort_by:ks,...xe.value},si=await ge(uh);if(!si)return{rows:[],total:0};const iu=(Po=(Bo=si.meta)==null?void 0:Bo.extra)==null?void 0:Po.default_sort;iu&&ne(iu);const ig=(Na=>{const ag=Na.data.map(La=>cF(La,k.value));return ag.forEach(La=>{I.value.add(String(La.id)),x.value.set(String(La.id),{})}),ag})(si);return B(si,Ne),{rows:ig,total:b.value.total}}catch(uh){return console.error("Failed to fetch items:",uh),{rows:[],total:0}}finally{ue.value=!1}},{isLoading:Ce,toggleSidebar:Ee,onGridReady:me,handleUnSelect:$e,handleSelectAll:Ye,onSearch:Se,firstLoad:Me}=jRe({selectRowData:H([]),isSidebarOpen:y,quickFilterText:_,gridApi:v,perPage:u.ROWS_PER_PAGE,fetcher:$}),Ct=H([]),Rt=mr(()=>{var ks;const Ne=((ks=v.value)==null?void 0:ks.getSelectedRows())||[],Ke=new Map(Ne.map(nn=>[nn.id,nn])),Js=Ne.map(nn=>nn.id).map(nn=>{var Bo,Po;return[nn,(Po=(Bo=v.value)==null?void 0:Bo.getRowNode(nn))==null?void 0:Po.rowIndex]}).sort((nn,Bo)=>(nn[1]??0)-(Bo[1]??0)).map(([nn])=>Ke.get(nn));console.log({newSelectedRows:Js}),Ct.value=Js.filter(nn=>nn!==void 0)}),Lt=Go({columnsDisplay:[],rowsDisplay:{fromIndex:0,toIndex:0}}),qt=Y(()=>({blockLoadDebounceMillis:1e3,columnDefs:N.value,rowModelType:"infinite",cacheBlockSize:u.ROWS_PER_PAGE,infiniteInitialRowCount:20,popupParent:document.getElementById("item-table-layout-id")||void 0,rowSelection:{mode:"multiRow",checkboxes:!1,enableClickSelection:!1,enableSelectionWithoutKeys:!1},pagination:!1,rowHeight:u.ROW_HEIGHT,suppressHorizontalScroll:!1,suppressColumnVirtualisation:!1,debounceVerticalScrollbar:!1,animateRows:!1,suppressAnimationFrame:!1,suppressScrollOnNewData:!0,suppressScrollWhenPopupsAreOpen:!1,rowBuffer:20,enableCellTextSelection:!1,suppressDragLeaveHidesColumns:!0,suppressMaxRenderedRowRestriction:!1,height:u.GRID_HEIGHT,stopEditingWhenCellsLoseFocus:!0,onModelUpdated:tn,noRowsOverlayComponent:Py(Lre),noRowsOverlayComponentParams:()=>V.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:Ne=>Ne.data.id,getRowClass:Ne=>{if(!Ne.data)return["row-empty"];const Ke=["row-highlight"];return Ne.data.id||Ke.push("row-inactive"),Ne.data.isDeleted&&Ke.push("row-deleted"),Ne.data.disabled&&Ke.push("row-deleted"),Ne.data.isArchived&&Ke.push("row-archived"),Ne.data.isLocked&&Ke.push("row-locked"),Ke},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:f.workspaceId,entityId:f.entityId,apiServices:O.value,sorting:ue.value},onCellKeyDown:Ne=>{var Ke,Wt,gn;if(Ne.data.isDeleted)return!1;if(((Ke=Ne==null?void 0:Ne.event)==null?void 0:Ke.key)==="Enter"){const{api:Js,node:ks,column:nn}=Ne,Bo=Js.getCellRendererInstances({rowNodes:[ks],columns:[nn]});if(Bo.length>0){const Po=Bo[0];Po&&typeof((Wt=Po.componsenExposed)==null?void 0:Wt.focus)=="function"&&((gn=Po.componsenExposed)==null||gn.focus())}}},isRowSelectable:Ne=>!Ne.group,suppressKeyboardEvent:Ne=>{var gn;if((gn=Ne.data)!=null&&gn.isDeleted)return!0;const Ke=Ne.event.key,Wt=Ne.editing;return Wt&&Ke==="Tab"?!0:Wt&&Ke==="Enter"?!1:Ke==="Enter"?(Ne.event.preventDefault(),Ne.event.stopPropagation(),!0):Ke==="ArrowUp"||Ke==="ArrowDown"||Ke==="ArrowLeft"||Ke==="ArrowRight"||Ke==="Tab"||Ke==="Enter"},navigateToNextCell:()=>null,onBodyScroll:Ne=>{const Ke=Ne.api.getFirstDisplayedRowIndex(),Wt=Ne.api.getLastDisplayedRowIndex();Lt.rowsDisplay.fromIndex=Ke,Lt.rowsDisplay.toIndex=Wt,Lt.columnsDisplay=Ne.api.getAllDisplayedVirtualColumns().map(gn=>gn.getColId())},onViewportChanged:Ne=>{Lt.columnsDisplay=Ne.api.getAllDisplayedVirtualColumns().map(Ke=>Ke.getColId())},suppressHeaderFocus:!0,onCellEditingStarted(Ne){if(Ne.data.isDeleted&&Ne.api.stopEditing(),Ne.colDef.field=="options"){const Ke=Ne.api.getCellRendererInstances({rowNodes:[Ne.node],columns:[Ne.column]});Ke.length>0&&Ke[0].focusUi()}},tabToNextCell:Ne=>{let Ke=Ne.nextCellPosition;if(Ke&&Ke.column.getColId()==="ag-Grid-SelectionColumn"){const Wt=Ne.api.getAllDisplayedColumns(),gn=Wt.indexOf(Ke.column),Js=Ne.backwards?-1:1,ks=Wt[gn+Js];if(ks)return{rowIndex:Ke.rowIndex,column:ks,rowPinned:Ke.rowPinned}}return Ke}}));function tn(){if(!v.value)return;let Ne=0;v.value.forEachNode(Ke=>{Ke.data&&Ne++}),b.value.loaded=Math.min(Ne,b.value.total)}Qe(()=>ae,()=>{v.value&&(P.value="",I.value.clear(),v.value.deselectAll(),Object.keys(Ge).forEach(Ne=>delete Ge[Number(Ne)]),v.value.purgeInfiniteCache(),v.value.ensureIndexVisible(0))},{deep:!0});const Be=H(),We=H(),Tt=()=>{var Ne;(Ne=We.value)==null||Ne.open()},Yt=H(),Xt=()=>{oi.showPopupBulkUpdate=!0,ft(()=>{var Ne;(Ne=Yt.value)==null||Ne.open()})},ot=()=>{oi.showPopupToolboxUploader=!0,ft(()=>{var Ne;(Ne=Be.value)==null||Ne.open()})},Zn=async()=>{Me.value=!0,v.value&&(P.value="",I.value.clear(),Object.keys(Ge).forEach(Ne=>delete Ge[Number(Ne)]),await v.value.deselectAll(),await v.value.ensureIndexVisible(0,"top"),await v.value.purgeInfiniteCache(),await v.value.refreshInfiniteCache())},ni=Y(()=>fn.getInstance().getItem("ITEM_TABLE_APP_VERSION")||""),Oa=H();Y(()=>{var Ne;return(Ne=qRe(ni.value))==null?void 0:Ne.map(Ke=>`<div>• ${Ke}</div>`).join(`
|
|
257
|
-
`)});function Ps(Ne){var Ke;Ne==="new_scene"?(Ke=Oa.value)==null||Ke.show():Ne==="import_scenes"?ot():Ne==="overwrite_scenes"?Tt():Ne==="bulk_update"&&Xt()}const Ma=Ne=>{C.value=Ne.api.getSelectedRows().map(Ke=>Ke.id)},Vl=Ne=>{const Ke=me(Ne);return Ke&&(Ke.addEventListener("modelUpdated",tn),Ke.addEventListener("bodyScroll",()=>Ke.stopEditing()),Ke.addEventListener("selectionChanged",Rt),Ke.addEventListener("columnMoved",gn=>Q(gn,!0)),Ke.addEventListener("columnResized",gn=>Q(gn,!0)),Ke.addEventListener("firstDataRendered",()=>{Me.value=!1}),!document.querySelector(".ag-body-viewport"))||Ne==null||Ne.setColumnsVisible(["ag-Grid-SelectionColumn"],!1),Ke},Fr=()=>{var Ne;d.value=(((Ne=document.getElementById("item-table-layout-id"))==null?void 0:Ne.clientHeight)??0)-78+"px"};en(()=>{ft(()=>{Fr()}),window.addEventListener("resize",Fr);function Ne(){requestAnimationFrame(Ne)}Ne()}),Jn(()=>{window.removeEventListener("resize",Fr)});const Gi=async({code:Ne,name:Ke})=>{await Se(Ne),setTimeout(()=>{var Wt;(Wt=E.value)==null||Wt.setValue(Ke)},300)},Ar=Ne=>{if(!v.value)return;const Ke=v.value.getRowNode(Ne);Ke?(v.value.ensureIndexVisible(Number(Ke.rowIndex),"middle"),v.value.flashCells({rowNodes:[Ke],flashDuration:3e3,fadeDuration:1e3})):v.value.ensureIndexVisible(b.value.total-1,"bottom")},Ui=Ne=>Ne.metric_type.code==="number"?"number":"default",ih=async()=>{if(f.entityId)try{const Ne=await Fe(f.entityId);T.value=Ne.data.map(Ke=>({...Ke,sortType:Ui(Ke)}))}catch(Ne){console.error("Failed to initialize metric list:",Ne),T.value=[]}},Vn=async()=>{if(O.value)try{const Ne=await O.value.getUserPermission(f.workspaceId);s(Ne)}catch(Ne){console.error("Failed to fetch user permissions:",Ne)}},Co=async()=>{if(O.value)try{const Ne=await O.value.getEntityDetail(f.workspaceId,f.entityId);r(Ne.permission),c.value=Ne}catch(Ne){console.error("Failed to fetch entity details:",Ne)}},Nw=yy(),{setUser:ah}=Nw,lh=async()=>{if(O.value)try{const Ne=await O.value.getMe();return ah(Ne),Ne}catch(Ne){console.error("Failed to fetch user details:",Ne)}},ch=async()=>{var Ne;if(O.value)try{const Ke=await O.value.getWorkspaces(f.workspaceId),Wt=(Ne=Ke.data[0])==null?void 0:Ne.ws_user_role_id;return Wt&&Nw.setUserRoleId(Wt),Ke}catch(Ke){console.error("Failed to fetch workspace details:",Ke)}};Qe(()=>[f.entityId,f.workspaceId],async([Ne,Ke])=>{!Ne||!Ke||(lh(),ch(),ih(),Vn(),Co())},{immediate:!0,deep:!0}),Qe(G,(Ne,Ke)=>{const Wt=Ne.filter(gn=>!(Ke!=null&&Ke.includes(gn)));Wt.length>0&&fe(Array.from(I.value),Wt).then(gn=>{q(gn,I.value,Wt)})},{immediate:!0,deep:!0}),Qe(P,(Ne,Ke)=>{L.value=!!(Ke&&Ne&&Ke!==Ne)}),t({refreshTable:Zn});const nT=Ne=>{xe.value=Ne,Zn()},Wi=Ne=>{M.value=Ne,Zn()},Bl=Ne=>{N.value=Ne||[],Q({},!0)},zi=Y(()=>{var gn;const Ne=fn.getInstance().getItem("ws.terminology"),Ke=Ne?JSON.parse(Ne):null;return`New ${((gn=Ke==null?void 0:Ke.find(Js=>Js.code==="scene"))==null?void 0:gn.name)||"Scene"}`}),oi=Go({showPopupBulkUpdate:!1,showPopupToolboxUploader:!1,showPopupSceneCreator:!1,showPopupItemDetails:!1,showPopupOverwriteScenes:!1});return(Ne,Ke)=>(K(),ze(W(mse),{"is-sidebar-open":y.value,onCloseSidebar:W(Ee),onSidebarClear:W(Ee),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:W(Ee)},{"header-left":be(()=>{var Wt;return[((Wt=W(i))==null?void 0:Wt.has_create_item_permission)==1?(K(),ze(W(J0),{key:0,variant:["primary"],options:h.value,onSelect:Ps,onHandleClick:Ke[1]||(Ke[1]=gn=>Ps("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:be(()=>[qe(ye(W(pt),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Ke[0]||(Ke[0]=gn=>Ps("new_scene")),label:zi.value},null,8,["label"]),[[W(l),1]])]),_:1},8,["options"])):Xe("",!0)]}),"header-actions":be(()=>[ye(W(Eie),{"onUpdate:assignees":Wi,onApplyFilter:nT,loading:W(Me),entityId:f.entityId},null,8,["loading","entityId"]),qe(ye(W(u0),{focusIndex:"4",modelValue:_.value,"onUpdate:modelValue":Ke[2]||(Ke[2]=Wt=>_.value=Wt),onSearch:W(Se),class:se(Ne.$style.itemSearchBox),onClear:Ke[3]||(Ke[3]=Wt=>W(Se)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:E},null,8,["modelValue","onSearch","class"]),[[W(n),{isLoading:W(Me),fullwidth:!0}]]),qe((K(),ze(W(yO),{status:W(Ce)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":L.value},{default:be(()=>[qe((K(),ze(W(pt),{variant:["secondary","icon"],disabled:W(Ce),onClick:Zn},{default:be(()=>[ye(W(ct),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[W(l),5],[W(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[W(n),{isLoading:W(Me),fullwidth:!0}]]),qe(ye(W(Cre),{"model-value":W(N),onChange:Ke[4]||(Ke[4]=Wt=>Bl(Wt)),id:"table_customization",gridApi:v.value,ref_key:"tableCustomizationRef",ref:j,"checkbox-column":W(F),tableHeight:d.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[W(n),{isLoading:W(Me),fullwidth:!0}]])]),grid:be(({availableHeight:Wt})=>[ye(W(MRe),jt({id:"item_table_main",ref_key:"agGrid",ref:oe},qt.value,{height:Wt+"px",isSorting:W(ue),onOnGridReady:Vl,onSelectionChanged:Ma,onOnScroll:Ne.handleScroll}),null,16,["height","isSorting","onOnScroll"])]),footer:be(()=>[Te("div",{class:se(Ne.$style.tableFooter),id:"table_footer"},[Te("span",null,[Ke[7]||(Ke[7]=nt(" Showing ",-1)),Te("b",null,it(W(b).loaded)+" of "+it(W(b).total),1)])],2)]),"new-row":be(()=>[ye(W(tie),{ref_key:"createNewSceneRef",ref:Oa,onSearchForCode:Gi,onFocusOnId:Ar},null,512)]),"bulk-update-actions":be(()=>[!y.value&&C.value.length>0?qe((K(),ze(W(lse),{key:0,selectRowData:Ct.value,"workspace-id":f.workspaceId,"entity-id":f.entityId,"grid-api":v.value,onUnselect:W($e),onSelectAll:W(Ye),"take-name":we.value,"selected-all":X.value,"total-rows":W(b).total,"visible-rows":W(b).loaded,onUpdated:W(Rt),loading:W(Ce),onRefreshSelectedRow:W(Rt)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","onUpdated","loading","onRefreshSelectedRow"])),[[lr,!y.value&&C.value.length>0]]):Xe("",!0)]),snackbar:be(()=>[ye(W(xse))]),popup:be(()=>[oi.showPopupToolboxUploader?(K(),ze(fTe,{key:0,ref_key:"popupToolboxUploaderRef",ref:Be,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:Zn,onHide:Ke[5]||(Ke[5]=Wt=>oi.showPopupToolboxUploader=!1)},null,8,["workspace-id","entity-id"])):Xe("",!0),oi.showPopupBulkUpdate?(K(),ze(ETe,{key:1,ref_key:"popupBulkUpdateRef",ref:Yt,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:Zn,onHide:Ke[6]||(Ke[6]=Wt=>oi.showPopupBulkUpdate=!1)},null,8,["workspace-id","entity-id"])):Xe("",!0)]),_:1},8,["is-sidebar-open","onCloseSidebar","onSidebarClear","onSidebarApply"]))}}),[["__cssModules",{$style:{tableTitle:"_tableTitle_1sow5_1",tableFooter:"_tableFooter_1sow5_7",footerStart:"_footerStart_1sow5_17",newRow:"_newRow_1sow5_25","warning-text":"_warning-text_1sow5_43","has-error":"_has-error_1sow5_48",itemSearchBox:"_itemSearchBox_1sow5_52","beta-tag":"_beta-tag_1sow5_56"}}]]),wG="0.1.
|
|
257
|
+
`)});function Ps(Ne){var Ke;Ne==="new_scene"?(Ke=Oa.value)==null||Ke.show():Ne==="import_scenes"?ot():Ne==="overwrite_scenes"?Tt():Ne==="bulk_update"&&Xt()}const Ma=Ne=>{C.value=Ne.api.getSelectedRows().map(Ke=>Ke.id)},Vl=Ne=>{const Ke=me(Ne);return Ke&&(Ke.addEventListener("modelUpdated",tn),Ke.addEventListener("bodyScroll",()=>Ke.stopEditing()),Ke.addEventListener("selectionChanged",Rt),Ke.addEventListener("columnMoved",gn=>Q(gn,!0)),Ke.addEventListener("columnResized",gn=>Q(gn,!0)),Ke.addEventListener("firstDataRendered",()=>{Me.value=!1}),!document.querySelector(".ag-body-viewport"))||Ne==null||Ne.setColumnsVisible(["ag-Grid-SelectionColumn"],!1),Ke},Fr=()=>{var Ne;d.value=(((Ne=document.getElementById("item-table-layout-id"))==null?void 0:Ne.clientHeight)??0)-78+"px"};en(()=>{ft(()=>{Fr()}),window.addEventListener("resize",Fr);function Ne(){requestAnimationFrame(Ne)}Ne()}),Jn(()=>{window.removeEventListener("resize",Fr)});const Gi=async({code:Ne,name:Ke})=>{await Se(Ne),setTimeout(()=>{var Wt;(Wt=E.value)==null||Wt.setValue(Ke)},300)},Ar=Ne=>{if(!v.value)return;const Ke=v.value.getRowNode(Ne);Ke?(v.value.ensureIndexVisible(Number(Ke.rowIndex),"middle"),v.value.flashCells({rowNodes:[Ke],flashDuration:3e3,fadeDuration:1e3})):v.value.ensureIndexVisible(b.value.total-1,"bottom")},Ui=Ne=>Ne.metric_type.code==="number"?"number":"default",ih=async()=>{if(f.entityId)try{const Ne=await Fe(f.entityId);T.value=Ne.data.map(Ke=>({...Ke,sortType:Ui(Ke)}))}catch(Ne){console.error("Failed to initialize metric list:",Ne),T.value=[]}},Vn=async()=>{if(O.value)try{const Ne=await O.value.getUserPermission(f.workspaceId);s(Ne)}catch(Ne){console.error("Failed to fetch user permissions:",Ne)}},Co=async()=>{if(O.value)try{const Ne=await O.value.getEntityDetail(f.workspaceId,f.entityId);r(Ne.permission),c.value=Ne}catch(Ne){console.error("Failed to fetch entity details:",Ne)}},Nw=yy(),{setUser:ah}=Nw,lh=async()=>{if(O.value)try{const Ne=await O.value.getMe();return ah(Ne),Ne}catch(Ne){console.error("Failed to fetch user details:",Ne)}},ch=async()=>{var Ne;if(O.value)try{const Ke=await O.value.getWorkspaces(f.workspaceId),Wt=(Ne=Ke.data[0])==null?void 0:Ne.ws_user_role_id;return Wt&&Nw.setUserRoleId(Wt),Ke}catch(Ke){console.error("Failed to fetch workspace details:",Ke)}};Qe(()=>[f.entityId,f.workspaceId],async([Ne,Ke])=>{!Ne||!Ke||(lh(),ch(),ih(),Vn(),Co())},{immediate:!0,deep:!0}),Qe(G,(Ne,Ke)=>{const Wt=Ne.filter(gn=>!(Ke!=null&&Ke.includes(gn)));Wt.length>0&&fe(Array.from(I.value),Wt).then(gn=>{q(gn,I.value,Wt)})},{immediate:!0,deep:!0}),Qe(P,(Ne,Ke)=>{L.value=!!(Ke&&Ne&&Ke!==Ne)}),t({refreshTable:Zn});const nT=Ne=>{xe.value=Ne,Zn()},Wi=Ne=>{M.value=Ne,Zn()},Bl=Ne=>{N.value=Ne||[],Q({},!0)},zi=Y(()=>{var gn;const Ne=fn.getInstance().getItem("ws.terminology"),Ke=Ne?JSON.parse(Ne):null;return`New ${((gn=Ke==null?void 0:Ke.find(Js=>Js.code==="scene"))==null?void 0:gn.name)||"Scene"}`}),oi=Go({showPopupBulkUpdate:!1,showPopupToolboxUploader:!1,showPopupSceneCreator:!1,showPopupItemDetails:!1,showPopupOverwriteScenes:!1});return(Ne,Ke)=>(K(),ze(W(mse),{"is-sidebar-open":y.value,onCloseSidebar:W(Ee),onSidebarClear:W(Ee),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:W(Ee)},{"header-left":be(()=>{var Wt;return[((Wt=W(i))==null?void 0:Wt.has_create_item_permission)==1?(K(),ze(W(J0),{key:0,variant:["primary"],options:h.value,onSelect:Ps,onHandleClick:Ke[1]||(Ke[1]=gn=>Ps("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:be(()=>[qe(ye(W(pt),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Ke[0]||(Ke[0]=gn=>Ps("new_scene")),label:zi.value},null,8,["label"]),[[W(l),1]])]),_:1},8,["options"])):Xe("",!0)]}),"header-actions":be(()=>[ye(W(Eie),{"onUpdate:assignees":Wi,onApplyFilter:nT,loading:W(Me),entityId:f.entityId},null,8,["loading","entityId"]),qe(ye(W(u0),{focusIndex:"4",modelValue:_.value,"onUpdate:modelValue":Ke[2]||(Ke[2]=Wt=>_.value=Wt),onSearch:W(Se),class:se(Ne.$style.itemSearchBox),onClear:Ke[3]||(Ke[3]=Wt=>W(Se)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:E},null,8,["modelValue","onSearch","class"]),[[W(n),{isLoading:W(Me),fullwidth:!0}]]),qe((K(),ze(W(yO),{status:W(Ce)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":L.value},{default:be(()=>[qe((K(),ze(W(pt),{variant:["secondary","icon"],disabled:W(Ce),onClick:Zn},{default:be(()=>[ye(W(ct),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[W(l),5],[W(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[W(n),{isLoading:W(Me),fullwidth:!0}]]),qe(ye(W(Cre),{"model-value":W(N),onChange:Ke[4]||(Ke[4]=Wt=>Bl(Wt)),id:"table_customization",gridApi:v.value,ref_key:"tableCustomizationRef",ref:j,"checkbox-column":W(F),tableHeight:d.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[W(n),{isLoading:W(Me),fullwidth:!0}]])]),grid:be(({availableHeight:Wt})=>[ye(W(MRe),jt({id:"item_table_main",ref_key:"agGrid",ref:oe},qt.value,{height:Wt+"px",isSorting:W(ue),onOnGridReady:Vl,onSelectionChanged:Ma,onOnScroll:Ne.handleScroll}),null,16,["height","isSorting","onOnScroll"])]),footer:be(()=>[Te("div",{class:se(Ne.$style.tableFooter),id:"table_footer"},[Te("span",null,[Ke[7]||(Ke[7]=nt(" Showing ",-1)),Te("b",null,it(W(b).loaded)+" of "+it(W(b).total),1)])],2)]),"new-row":be(()=>[ye(W(tie),{ref_key:"createNewSceneRef",ref:Oa,onSearchForCode:Gi,onFocusOnId:Ar},null,512)]),"bulk-update-actions":be(()=>[!y.value&&C.value.length>0?qe((K(),ze(W(lse),{key:0,selectRowData:Ct.value,"workspace-id":f.workspaceId,"entity-id":f.entityId,"grid-api":v.value,onUnselect:W($e),onSelectAll:W(Ye),"take-name":we.value,"selected-all":X.value,"total-rows":W(b).total,"visible-rows":W(b).loaded,onUpdated:W(Rt),loading:W(Ce),onRefreshSelectedRow:W(Rt)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","onUpdated","loading","onRefreshSelectedRow"])),[[lr,!y.value&&C.value.length>0]]):Xe("",!0)]),snackbar:be(()=>[ye(W(xse))]),popup:be(()=>[oi.showPopupToolboxUploader?(K(),ze(fTe,{key:0,ref_key:"popupToolboxUploaderRef",ref:Be,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:Zn,onHide:Ke[5]||(Ke[5]=Wt=>oi.showPopupToolboxUploader=!1)},null,8,["workspace-id","entity-id"])):Xe("",!0),oi.showPopupBulkUpdate?(K(),ze(ETe,{key:1,ref_key:"popupBulkUpdateRef",ref:Yt,"workspace-id":f.workspaceId,"entity-id":f.entityId,onImportSuccess:Zn,onHide:Ke[6]||(Ke[6]=Wt=>oi.showPopupBulkUpdate=!1)},null,8,["workspace-id","entity-id"])):Xe("",!0)]),_:1},8,["is-sidebar-open","onCloseSidebar","onSidebarClear","onSidebarApply"]))}}),[["__cssModules",{$style:{tableTitle:"_tableTitle_1sow5_1",tableFooter:"_tableFooter_1sow5_7",footerStart:"_footerStart_1sow5_17",newRow:"_newRow_1sow5_25","warning-text":"_warning-text_1sow5_43","has-error":"_has-error_1sow5_48",itemSearchBox:"_itemSearchBox_1sow5_52","beta-tag":"_beta-tag_1sow5_56"}}]]),wG="0.1.205",RTe={key:0},TTe=bt(tt({__name:"app",setup(e){const t=Y(()=>n.id.length===0||n.workspaceId.length===0),n=Go({id:"",workspaceId:"",apiConfig:{}}),o=Es(),{showMessage:s,showErrorNetMessage:r}=o,i=["basicInfor","importItems"],a=h=>{h.success?s(h.apiCode,"success"):i.includes(h.apiCode)||r(h)},l=H(null),c=()=>{const h=fn.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};Oh(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",wG);try{if(l.value=ro(),!l.value)throw new Error("Current instance is null");n.id=((h=l.value)==null?void 0:h.appContext.config.globalProperties.id)||"",n.workspaceId=((f=l.value)==null?void 0:f.appContext.config.globalProperties.workspaceId)||fn.getInstance().getItem("ws.code");const g={domainApi:c(),wsCode:fn.getInstance().getItem("ws.code"),entityId:n.id};if(n.apiConfig=(p=l.value)==null?void 0:p.appContext.config.globalProperties.apiConfig,!g.entityId||!g.wsCode||!g.domainApi)throw new Error("API configuration is missing in dashboardConfig");const v=new JM(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),Jn(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const u=Y(()=>n.id),d=Y(()=>n.workspaceId);return ui("workspaceId",d),ui("entityId",u),(h,f)=>(K(),ce("div",{class:se(h.$style.dashboardPluginWrapper)},[t.value?(K(),ce("span",RTe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):u.value?(K(),ze(W(_Te),{key:1,entityId:u.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Xe("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),tT=async(e={},t={})=>{const n=nI(TTe),o=iJ();n.use(o);const s=["apiConfig","workspaceId","id"],r={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,r[a]=l,s.includes(a)&&typeof l=="string"?sessionStorage.setItem(a,l):console.error(`[Config Error] Key "${a}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=r,Object.values(t).forEach(a=>{a&&typeof a.install=="function"&&n.use(a)}),n.config.errorHandler=(a,l,c)=>{console.error("[Vue Error]",a),c&&console.error("[Info]",c)},console.log(`%cArbo Dashboard Plugin v${wG}`,"color: #4CAF50; font-weight: bold;"),console.log(n.config.globalProperties),globalThis.window.$switchInstance=n.config.globalProperties.switchInstance,n.provide("switchInstance",n.config.globalProperties.switchInstance),n.directive("tooltip",Kt),n.directive("focusable",Uo);const i=await fce();return n.use(i),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=tT),Bn.default=tT,Bn.initDashboard=tT,Object.defineProperties(Bn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|