@arbocollab/arbo-plugin-item-table 0.1.248 → 0.1.249

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.
@@ -156,7 +156,7 @@ Caused by: `,FE=Symbol("causeStack");function Ite(e,t){const n=he.hasOwnProp(e,F
156
156
  `),l=a===-1?-1:i.indexOf(`
157
157
  `,a+1),u=l===-1?i:i.slice(l+1),c=String(o.stack),d=Ite(o,c),h=d===-1?c:c.slice(0,d),f=d===-1?"":c.slice(d);h.endsWith(u)||(o.stack=h+`
158
158
  `+i+f)}}catch{}throw o}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ku(this.defaults,n);const{transitional:o,paramsSerializer:s,headers:r}=n;o!==void 0&&Yv.assertOptions(o,{silentJSONParsing:Vo.transitional(Vo.boolean),forcedJSONParsing:Vo.transitional(Vo.boolean),clarifyTimeoutError:Vo.transitional(Vo.boolean),legacyInterceptorReqResOrdering:Vo.transitional(Vo.boolean),advertiseZstdAcceptEncoding:Vo.transitional(Vo.boolean),validateStatusUndefinedResolves:Vo.transitional(Vo.boolean),encodeBasicAuthUsername:Vo.transitional(Vo.boolean)},!1),s!=null&&(he.isFunction(s)?n.paramsSerializer={serialize:s}:Yv.assertOptions(s,{encode:Vo.function,serialize:Vo.function},!0)),n.allowAbsoluteUrls!==void 0||(he.hasOwnProp(this.defaults,"allowAbsoluteUrls")&&this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Yv.assertOptions(n,{baseUrl:Vo.spelling("baseURL"),withXsrfToken:Vo.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(YE(i)?i:void 0,YE(a)?a:void 0);r&&he.forEach(LM.concat("common"),v=>{YE(he.getSafeProp(r,v))&&delete r[v]}),n.headers=Po.concat(l,r);const u=[];let c=!0;this.interceptors.request.forEach(function(w){if(typeof w.runWhen=="function"&&w.runWhen(n)===!1)return;c=c&&w.synchronous;const S=n.transitional||LE;S&&S.legacyInterceptorReqResOrdering?u.unshift(w.fulfilled,w.rejected):u.push(w.fulfilled,w.rejected)});const d=[];this.interceptors.response.forEach(function(w){d.push(w.fulfilled,w.rejected)});let h,f=0,p;if(!c){const v=[qE.bind(this),void 0];for(v.unshift(...u),v.push(...d),p=v.length,h=Promise.resolve(n);f<p;)h=h.then(v[f++],v[f++]);return h}p=u.length;let g=n;for(;f<p;){const v=u[f++],w=u[f++];try{g=v?v(g):g}catch(S){if(!w){h=Promise.reject(S);break}try{const b=w.call(this,S);he.isThenable(b)&&(h=Promise.resolve(b).then(()=>qE.call(this,g)))}catch(b){h=Promise.reject(b)}break}}if(!h)try{h=qE.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=ku(this.defaults,t);const n=jM(t.baseURL,t.url,t.allowAbsoluteUrls,t);return IM(n,t.params,t.paramsSerializer)}};he.forEach(["delete","get","head","options"],function(t){Fu.prototype[t]=async function(n,o){return this.request(ku(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(ku(a||{},{method:t,headers:o?{"Content-Type":"multipart/form-data"}:{},url:r,data:i}))}}Fu.prototype[t]=n(),t!=="query"&&(Fu.prototype[t+"Form"]=n(!0))});let Dne=class fU{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 ep(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 fU(function(s){t=s}),cancel:t}}};function Ine(e){return function(n){return e.apply(null,n)}}function xne(e){return he.isObject(e)&&e.isAxiosError===!0}const Xv={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(Xv).forEach(([e,t])=>{Xv[t]===void 0&&(Xv[t]=e)});function hN(e){const t=new Fu(e),n=cM(Fu.prototype.request,t);return he.extend(n,Fu.prototype,t,{allOwnKeys:!0}),he.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return hN(ku(e,s))},n}const Qn=hN(Qf);Qn.Axios=Fu,Qn.CanceledError=ep,Qn.CancelToken=Dne,Qn.isCancel=VM,Qn.VERSION=zE,Qn.toFormData=Uv,Qn.AxiosError=at,Qn.Cancel=Qn.CanceledError,Qn.all=function(t){return Promise.all(t)},Qn.spread=Ine,Qn.isAxiosError=xne,Qn.mergeConfig=ku,Qn.AxiosHeaders=Po,Qn.formToJSON=e=>NM(he.isHTMLForm(e)?new FormData(e):e),Qn.getAdapter=uN.getAdapter,Qn.HttpStatusCode=Xv,Qn.default=Qn;const{Axios:YIe,AxiosError:XIe,CanceledError:ZIe,isCancel:JIe,CancelToken:QIe,VERSION:exe,all:txe,Cancel:nxe,isAxiosError:Ane,spread:oxe,toFormData:sxe,AxiosHeaders:rxe,HttpStatusCode:ixe,formToJSON:axe,getAdapter:lxe,mergeConfig:uxe,create:cxe}=Qn;class np 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,np.prototype)}}const Pne=e=>{var t,n;if(Ane(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===Er.UNAUTHORIZED||o===Er.FORBIDDEN?l="AUTH":o===Er.UNPROCESSABLE_ENTITY||o===Er.BAD_REQUEST?l="VALIDATION":o>=Er.BAD_REQUEST&&(l="CLIENT"),new np(r,o,i,a,l)}return e instanceof Error?new np(e.message,void 0,void 0,void 0,"UNKNOWN"):new np("An unknown error occurred",void 0,void 0,void 0,"UNKNOWN")};function fN(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 pN(e,t,n,o,s,r,i){try{var a=e[r](i),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(o,s)}function XE(e){return function(){var t=this,n=arguments;return new Promise(function(o,s){var r=e.apply(t,n);function i(l){pN(r,o,s,i,a,"next",l)}function a(l){pN(r,o,s,i,a,"throw",l)}i(void 0)})}}function ZE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kne(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,mN(o.key),o)}}function JE(e,t,n){return t&&kne(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fne(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Lne(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 vd(e,t,n){return(t=mN(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gN(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 yd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gN(Object(n),!0).forEach(function(o){vd(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gN(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function One(e,t){if(e==null)return{};var n,o,s=Mne(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 Mne(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 Ou(){/*! 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 w=p&&p.prototype instanceof a?p:a,S=Object.create(w.prototype);return zs(S,"_invoke",function(b,y,E){var _,I,T,F=0,V=E||[],x=!1,A={p:0,n:0,v:e,a:k,f:k.bind(e,4),d:function(M,N){return _=M,I=0,T=e,A.n=N,i}};function k(M,N){for(I=M,T=N,t=0;!x&&F&&!B&&t<V.length;t++){var B,z=V[t],oe=A.p,ie=z[2];M>3?(B=ie===N)&&(T=z[(I=z[4])?5:(I=3,3)],z[4]=z[5]=e):z[0]<=oe&&((B=M<2&&oe<z[1])?(I=0,A.v=N,A.n=z[1]):oe<ie&&(B=M<3||z[0]>N||N>ie)&&(z[4]=M,z[5]=N,A.n=ie,I=0))}if(B||M>1)return i;throw x=!0,N}return function(M,N,B){if(F>1)throw TypeError("Generator is already running");for(x&&N===1&&k(N,B),I=N,T=B;(t=I<2?e:T)||!x;){_||(I?I<3?(I>1&&(A.n=-1),k(I,T)):A.n=T:A.v=T);try{if(F=2,_){if(I||(M="next"),t=_[M]){if(!(t=t.call(_,T)))throw TypeError("iterator result is not an object");if(!t.done)return t;T=t.value,I<2&&(I=0)}else I===1&&(t=_.return)&&t.call(_),I<2&&(T=TypeError("The iterator does not provide a '"+M+"' method"),I=1);_=e}else if((t=(x=A.n<0)?T:b.call(y,A))!==i)break}catch(z){_=e,I=1,T=z}finally{F=1}}return{value:t,done:x}}}(f,g,v),!0),S}var i={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][o]?t(t([][o]())):(zs(t={},o,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function h(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,u):(f.__proto__=u,zs(f,s,"GeneratorFunction")),f.prototype=Object.create(d),f}return l.prototype=u,zs(d,"constructor",u),zs(u,"constructor",l),l.displayName="GeneratorFunction",zs(u,s,"GeneratorFunction"),zs(d),zs(d,s,"Generator"),zs(d,o,function(){return this}),zs(d,"toString",function(){return"[object Generator]"}),(Ou=function(){return{w:r,m:h}})()}function zs(e,t,n,o){var s=Object.defineProperty;try{s({},"",{})}catch{s=0}zs=function(r,i,a,l){function u(c,d){zs(r,c,function(h){return this._invoke(c,d,h)})}i?s?s(r,i,{value:a,enumerable:!l,configurable:!l,writable:!l}):r[i]=a:(u("next",0),u("throw",1),u("return",2))},zs(e,t,n,o)}function Nne(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 mN(e){var t=Nne(e,"string");return typeof t=="symbol"?t:t+""}function Zv(e){"@babel/helpers - typeof";return Zv=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},Zv(e)}function Lne(e,t){if(e){if(typeof e=="string")return fN(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)?fN(e,t):void 0}}var QE=function(e){return e.TOOLBOX_EXPORT_DATA="TOOLBOX_EXPORT_DATA",e.SW_APP_LOADER="SW_APP_LOADER",e}({});function vN(e){return Zv(e)==="object"&&e!==null&&!Array.isArray(e)}function yN(e,t){var n=Object.keys(e);return n.length===t.length&&t.every(function(o){return n.includes(o)})}function Vne(e){return typeof Blob<"u"&&e instanceof Blob}var Bne=function(t){return vN(t)&&yN(t,["file","fileName"])&&Vne(t.file)&&typeof t.fileName=="string"},$ne=function(t){return vN(t)&&yN(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"},Hne=Object.freeze(vd(vd({},QE.TOOLBOX_EXPORT_DATA,Bne),QE.SW_APP_LOADER,$ne));function Gne(e){return Zv(e)==="object"&&e!==null&&!Array.isArray(e)}function Une(e,t){var n=Object.keys(e);return n.length===t.length&&t.every(function(o){return n.includes(o)})}function Wne(e){if(!Gne(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(QE).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(!Une(e,t))return{valid:!1,reason:"Message contains missing or unexpected fields."};var n=e.type;return Hne[n](e.payload)?{valid:!0,message:e}:{valid:!1,reason:"Payload does not match the ".concat(n," schema.")}}function zne(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 u=Wne(l.data);if(u.valid===!1){s==null||s(l.data,u.reason,l);return}o(u.message,l)};return r.addEventListener("message",i),function(){return r.removeEventListener("message",i)}}class jne extends Error{}class vl extends jne{constructor(){super("Zone is an abstract class")}}class wN{get type(){throw new vl}get name(){throw new vl}get ianaName(){return this.name}get isUniversal(){throw new vl}offsetName(t,n){throw new vl}formatOffset(t,n){throw new vl}offset(t){throw new vl}equals(t){throw new vl}get isValid(){throw new vl}}const e0=new Map;function Kne(e){let t=e0.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"}),e0.set(e,t)),t}const qne={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Yne(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,u,c]=o;return[i,s,r,a,l,u,c]}function Xne(e,t){const n=e.formatToParts(t),o=[];for(let s=0;s<n.length;s++){const{type:r,value:i}=n[s],a=qne[r];r==="era"?o[a]=i:Qv(a)||(o[a]=parseInt(i,10))}return o}const t0=new Map;class Jv extends wN{static create(t){let n=t0.get(t);return n===void 0&&t0.set(t,n=new Jv(t)),n}static resetCache(){t0.clear(),e0.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=Jv.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:o}){return Qne(t,n,o,this.name)}formatOffset(t,n){return ty(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const o=Kne(this.name);let[s,r,i,a,l,u,c]=o.formatToParts?Xne(o,n):Yne(o,n);a==="BC"&&(s=-Math.abs(s)+1);const h=Jne({year:s,month:r,day:i,hour:l===24?0:l,minute:u,second:c,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 n0=null;class wd extends wN{static get utcInstance(){return n0===null&&(n0=new wd(0)),n0}static instance(t){return t===0?wd.utcInstance:new wd(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new wd(bN(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${ty(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${ty(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return ty(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 Qv(e){return typeof e>"u"}function ey(e,t=2){const n=e<0;let o;return n?o="-"+(""+-e).padStart(t,"0"):o=(""+e).padStart(t,"0"),o}function CN(e){if(!(Qv(e)||e===null||e===""))return parseInt(e,10)}function Zne(e){if(!(Qv(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function Jne(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 Qne(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 bN(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 ty(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}${ey(n,2)}:${ey(o,2)}`;case"narrow":return`${s}${n}${o>0?`:${o}`:""}`;case"techie":return`${s}${ey(n,2)}${ey(o,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}const SN=/[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 bd(...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 EN(...e){return(t,n)=>{const o={};let s;for(s=0;s<e.length;s++)o[e[s]]=CN(t[n+s]);return[o,null,n+s]}}const _N=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,eoe=`(?:${_N.source}?(?:\\[(${SN.source})\\])?)?`,RN=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,TN=RegExp(`${RN.source}${eoe}`),o0=RegExp(`(?:[Tt]${TN.source})?`),toe=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,noe=/(\d{4})-?W(\d\d)(?:-?(\d))?/,ooe=/(\d{4})-?(\d{3})/,soe=EN("weekYear","weekNumber","weekDay"),roe=EN("year","ordinal"),ioe=/(\d{4})-(\d\d)-(\d\d)/,DN=RegExp(`${RN.source} ?(?:${_N.source}|(${SN.source}))?`),aoe=RegExp(`(?: ${DN.source})?`);function Sd(e,t,n){const o=e[t];return Qv(o)?n:CN(o)}function loe(e,t){return[{year:Sd(e,t),month:Sd(e,t+1,1),day:Sd(e,t+2,1)},null,t+3]}function Ed(e,t){return[{hours:Sd(e,t,0),minutes:Sd(e,t+1,0),seconds:Sd(e,t+2,0),milliseconds:Zne(e[t+3])},null,t+4]}function op(e,t){const n=!e[t]&&!e[t+1],o=bN(e[t+1],e[t+2]),s=n?null:wd.instance(o);return[{},s,t+3]}function sp(e,t){const n=e[t]?Jv.create(e[t]):null;return[{},n,t+1]}Cd(toe,o0),Cd(noe,o0),Cd(ooe,o0),Cd(TN),bd(loe,Ed,op,sp),bd(soe,Ed,op,sp),bd(roe,Ed,op,sp),bd(Ed,op,sp),bd(Ed),Cd(ioe,aoe),Cd(DN),bd(Ed,op,sp);var uoe=["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 rp(){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 ny(){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 coe(){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 doe(){return{maxRetries:5,retryDelay:500,backoffFactor:1.5}}var IN=1e3,hoe=1e4;function xN(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){rp("Top window redirect blocked, redirecting current window instead:",n)}try{Dt("Redirecting current window to:",e),window.location.replace(e)}catch(n){rp("Failed to redirect:",n)}}}function oy(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 foe(e){return yd(yd({},e),{},{access_token:oy(e.access_token),token:oy(e.token),refresh_token:oy(e.refresh_token)})}function sy(e){if(!e)return!1;var t=e.trim();return!!t&&t!=="undefined"&&t!=="null"}function AN(e){return sy(e.getAccessToken())||sy(e.getRefreshToken())}function poe(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 goe(){typeof sessionStorage<"u"&&sessionStorage.clear()}function moe(e){return function(t){var n,o=(n=t.response)===null||n===void 0?void 0:n.status,s=AN(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,u=(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:",u,"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 c,d,h=(c=t.response)===null||c===void 0?void 0:c.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 voe=function(){function e(){var t,n,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ZE(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 JE(e,[{key:"getCookieValue",value:function(n){if(typeof document>"u")return null;var o=document.cookie.split(";"),s=Fne(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"){ny(" 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 u=this.getExpiresInRefreshToken();if(Dt("setTokens - refresh token data:",foe(n)),Dt("setTokens - refresh token expires_in value:",u),u){var c=new Date;c.setTime(c.getTime()+Number(u)*1e3),a=";expires=".concat(c.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:",oy(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()}}])}(),yoe=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";ZE(this,e),vd(this,"channel",null),this.channelName=t,this.storageKey=n,this.initChannel()}return JE(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)}}])}(),woe=function(){function e(t){var n=this;if(ZE(this,e),vd(this,"currentAttempt",0),vd(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=doe();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 yoe,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 JE(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 sy(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){rp("Failed to update localStorage:",a)}Dt("Clearing sessionStorage and cookies"),goe(),poe(s);var i="".concat(o,"/login?timeout=").concat(n);Dt("Redirecting to login in ".concat(IN,"ms:"),i),setTimeout(function(){return xN(i)},IN)}}},{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=XE(Ou().m(function o(){var s=this,r,i,a,l;return Ou().w(function(u){for(;;)switch(u.p=u.n){case 0:if(r=this.tokenStorage.getRefreshToken(),Dt(" handleTokenRefresh started, refreshToken available:",!!r),r){u.n=1;break}return Dt(" ERROR: No refresh token available - cannot refresh"),this.onTokenInvalid(),u.a(2,!1);case 1:return this.currentAttempt=0,u.p=2,u.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=u.v,!(!i||!i.access_token&&!i.token)){u.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),u.a(2,!0);case 5:return u.p=5,l=u.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"})),u.a(2,!1)}},o,this,[[2,5]])}));function n(){return t.apply(this,arguments)}return n}()},{key:"executeWithRetry",value:function(){var t=XE(Ou().m(function o(s){var r,i,a,l;return Ou().w(function(u){for(;;)switch(u.p=u.n){case 0:return u.p=0,u.n=1,s();case 1:return u.a(2,u.v);case 2:if(u.p=2,l=u.v,this.currentAttempt++,!(this.currentAttempt>=this.maxRetries)){u.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)),u.n=4,new Promise(function(c){return setTimeout(c,a)});case 4:return u.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 Coe(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?moe(t.tokenStorage):o.tokenExpiredDetection||function(u){var c;return((c=u.response)===null||c===void 0?void 0:c.status)===401},i=s?[401,425]:o.retryStatusCodes||[401,425],a=o.tokenHeaderFormatter||function(u){return"Bearer ".concat(u)};Dt("Interceptor config - retryStatusCodes:",i,"using standardized detection:",s);var l=null;e.interceptors.response.use(function(u){return u},function(){var u=XE(Ou().m(function c(d){var h,f,p,g,v,w,S,b,y,E,_,I,T,F,V,x,A,k,M,N,B;return Ou().w(function(z){for(;;)switch(z.p=z.n){case 0:if(g=d.config,v=function(ie){var te,se=s&&t.isLogoutInProgress;return ny(se?"HOLD ->":"REJECT ->",((g==null?void 0:g.method)||"").toUpperCase(),g==null?void 0:g.url,"| status:",(te=d.response)===null||te===void 0?void 0:te.status,"| reason:",ie,"| logoutInProgress:",t.isLogoutInProgress,"| at:",new Date().toISOString().slice(11,23)),se?new Promise(function(Z,P){setTimeout(function(){ny("Logout redirect did not happen in time - releasing held request:",g==null?void 0:g.url),P(d)},hoe)}):Promise.reject(d)},g){z.n=1;break}return z.a(2,v("no request config"));case 1:if(!g._retry){z.n=2;break}return z.a(2,v("retried request failed again"));case 2:if(w=(h=d.response)===null||h===void 0?void 0:h.status,Dt(" Response error handler triggered - status:",w,"url:",g.url),S=r(d),Dt(" tokenExpiredDetection returned:",S),b=!1,w===400)if(_=(y=d.response)===null||y===void 0?void 0:y.data,I=(_==null?void 0:_.error)==="invalid_token"||(_==null||(E=_.error)===null||E===void 0?void 0:E.key)==="invalid_token",I)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(oe){rp(" Failed to clear account.token:",oe)}typeof window<"u"&&(F=sessionStorage.getItem("BASE_URL")||"",V="".concat(F,"/sw?redirect=1"),Dt("Redirecting to re-auth page - URL:",V),xN(V))}else Dt(" 400 invalid_token (custom config) - user handles via callbacks");else b=!1,Dt(" 400 non-invalid_token - skip refresh");else s&&w===401&&!AN(t.tokenStorage)?(x=typeof window<"u"&&window.location.pathname.includes("/login"),A=/login|refresh-token|refreshToken/i.test(g.url||""),x||A?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(w),Dt(" Status",w,"- shouldRefresh:",S,"in retryStatusCodes:",i.includes(w),"canRetry:",b));if(b){z.n=3;break}return z.a(2,v("not eligible for refresh"));case 3:if(k=((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")),!k){z.n=4;break}return z.a(2,v("refresh endpoint itself failed"));case 4:return g._retry=!0,z.p=5,l?Dt(" Using existing refresh promise"):(Dt(" Starting new token refresh"),l=t.handleTokenRefresh()),z.n=6,l;case 6:if(M=z.v,l=null,M){z.n=7;break}return z.a(2,v("token refresh failed (waiting request)"));case 7:return N=t.tokenStorage.getAccessToken(),Dt(" Token refreshed successfully, new token available:",!!N),N?(Dt(" Injecting refreshed token into Authorization header for retry"),g.headers.Authorization=a(N)):ny(" WARNING: Token refresh succeeded but no token in storage!"),Dt(" Retrying original request with new token"),z.a(2,e(g));case 8:return z.p=8,B=z.v,rp(" Error during refresh:",B),l=null,z.a(2,v("error thrown during refresh"))}},c,null,[[5,8]])}));return function(c){return u.apply(this,arguments)}}()),e.interceptors.request.use(function(u){var c=u.headers.Authorization;if(c){var d=String(c).replace(/^Bearer\s*/i,"").trim();if(d&&d!=="undefined"&&d!=="null")return u;Dt("Removing invalid Authorization header:",c),delete u.headers.Authorization}var h=t.tokenStorage.getAccessToken(),f=t.tokenStorage.getRefreshToken();return Dt(" Request interceptor: token exists:",!!h,"refreshToken exists:",!!f,"url:",u.url),h&&sy(h)?(Dt(" Access token available - injecting into Authorization header"),u.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)"),u},function(u){return Promise.reject(u)})}function boe(e){var t=e.useStandardizedConfig===!0;Dt("createCookieRefreshHandler called - useStandardizedConfig:",t);var n;if(t){var o=coe();n=yd(yd({},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,u=e.sameSite,c=e.canSetTokens,d=e.cookieParser;n={accessTokenKey:s,refreshTokenKey:r,domain:i,path:a,secure:l,sameSite:u,canSetTokens:c,cookieParser:d},Dt(" Applied custom cookie config:",n)}var h=new voe(n);e.accessTokenKey,e.refreshTokenKey,e.domain,e.path,e.secure,e.sameSite,e.canSetTokens,e.cookieParser;var f=One(e,uoe);return new woe(yd(yd({},f),{},{storage:h,useStandardizedConfig:t}))}var Bo=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}(Bo||{});Bo.review,Bo.review_take,Bo.review_scene,Bo.review_rendition,Bo.review_frame,Bo.review_rendition_comment,Bo.review_comment,Bo.scene_hub,Bo.hub_rendition,Bo.hub_comment,Bo.people_insight,Bo.people_detail,Bo.project,Bo.woohoo,Bo.update,Bo.core,Bo.project_focusMode;const PN={accessToken:"account.token",refreshToken:"account.refresh_token"},Soe={baseUrl:"BASE_URL"},kN="/refresh-token",Eoe=3e5,_oe="*",FN={Accept:"application/json","Content-Type":"application/json"},Roe="undefined",Toe="No access token found",Mu={badRequest:400,unauthorized:401,tooEarly:425},Doe=[Mu.unauthorized,Mu.tooEarly,Mu.badRequest],Ioe="unauthenticated",xoe="invalid_token",Aoe="refresh_token_expired",Poe={type:"TOKEN_EXPIRED",message:"Authentication token has expired"},koe="Session refreshed successfully",Foe="Session expired. Please log in again.",Ooe=e=>{const{error:t}=e??{};return typeof t=="string"?t:t==null?void 0:t.key},Moe=e=>{var t,n;return((t=e==null?void 0:e.response)==null?void 0:t.status)!==Mu.badRequest?!1:Ooe((n=e.response)==null?void 0:n.data)===xoe},Noe=()=>{},Loe=e=>sessionStorage.getItem(e)||"",s0=()=>{const e=_v.get(PN.accessToken);return e&&e!==Roe?e:null},Voe=()=>!!_v.get(PN.refreshToken),Boe=()=>{const e=window.location.origin,t=Loe(Soe.baseUrl);if(!t)return e;try{return new URL(t,e).origin}catch{return e}};class r0{constructor(t,n=Noe,o){this.client=t,this.showMessage=n,this.onAuthExpired=o}attach(){const t=boe({refreshTokenFn:n=>this.refresh(n),onRefreshSuccess:n=>{this.showMessage(koe,"success"),this.client.defaults.headers.common.Authorization=`Bearer ${n.access_token}`},onRefreshFailure:()=>{this.showMessage(Foe,"error")},useStandardizedConfig:!0});this.handler=t,Coe(this.client,t,{retryStatusCodes:[...Doe],tokenExpiredDetection:r0.isTokenExpired})}refreshAccessToken(){return!this.handler||!Voe()?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===Mu.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===Mu.badRequest||n!==Mu.unauthorized||typeof o=="string"||r!==Ioe?!1:Object.keys(s).length===0||s.reason===Aoe}async refresh(t){const n=await this.client.post(kN,{refresh_token:t}),o="data"in n&&n.data?n.data:n;return{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(Poe,Boe())}}class $oe{constructor(t={}){this.options={unwrapResponse:!0,withRefreshToken:!0,requireToken:!0,...t},this.client=Qn.create({baseURL:typeof t.baseURL=="string"?t.baseURL:"",timeout:t.timeout??Eoe,headers:{...FN,...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===kN,i=r?s0():await this.resolveAccessToken();if(!i&&s&&!r)throw new Error(Toe);t.headers.set("Accept-Language",_oe),t.headers.has("Content-Type")||t.headers.set("Content-Type",FN["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=s0();return t||!this.tokenRefresher?t:(await this.tokenRefresher.refreshAccessToken(),s0())}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 r0(this.client,n,o),this.tokenRefresher.attach()),this.client.interceptors.response.use(void 0,r=>(Moe(r)&&(o==null||o("/sw?redirect=1")),Promise.reject(r))),s&&this.client.interceptors.response.use(void 0,s)}}const Hoe=5,Goe=1e3,Uoe=3,Woe="default",zoe=e=>new URL(e,"http://localhost").pathname;class joe{constructor(t={}){this.groups=new Map,this.defaultLimit=t.defaultLimit??Hoe,this.rules=t.rules??[],this.releaseDelayMs=t.releaseDelayMs??Goe}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=zoe(t),o=this.rules.find(i=>i.pattern.test(n)),s=o?o.pattern.source:Woe;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 Koe=(e,t)=>{const n=new joe(t),o=Qn.getAdapter(e.defaults.adapter);return e.defaults.adapter=s=>n.run(s.url??"",()=>o(s)),n},qoe=(e,{maxRetries:t=Uoe}={})=>{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(u=>setTimeout(u,i)),e.request(o)})},Yoe=6e4,Xoe="/start",Zoe=(e=Xoe)=>{const n=`${sessionStorage.getItem("BASE_URL")||""}${e}`;window.location.replace(n)};function Joe(e,t){const n=sessionStorage.getItem(e)||"";return(n==null?void 0:n.length)>0?n:t}class Qoe{constructor(t,n={}){const{concurrency:o,rateLimitRetry:s,...r}=n,i=()=>Joe("API_BASE_URL","");this.callbackFunc=t,this.api=new $oe({baseURL:i,timeout:Yoe,requireToken:!0,onAuthExpired:Zoe,...r,unwrapResponse:!1,showMessage:t}),this.axios=this.api.client,o!==!1&&Koe(this.axios,o),s!==!1&&qoe(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 Pne(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 ese=({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"},bulkCreate:{url:`${e}/v1/workspace/${t}/item/2/bulk-create`,method:"post",code:"bulkCreate"}}),tse=(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)},nse=15e3,ose=new Set(["bulkDelete","bulkArchive","bulkUnarchive","bulkDateUpdate","bulkAssignUpdate","bulkStatusUpdate","bulkMetricUpdate","bulkRename","removeAssignee","delete_thumbnail","delete_rendition"]);class ON extends Qoe{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=ese({domainApi:s,wsCode:r,entityId:i}),l={};Object.entries(a).forEach(([u,c])=>{const d=u;t[d]?l[d]=t[d]:(console.warn(`API config for ${d} is missing, using base config.`),l[d]=c)}),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,unwrapResponse:l=!0,timeout:u}){var h,f;const c=this.buildHeaders(s);let d;try{if(d=await this.axios.request({method:t,url:n,params:o,data:s,headers:c,responseType:i,timeout:u}),(((h=d.headers)==null?void 0:h["content-type"])||"").includes("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")){const g=((f=d.headers)==null?void 0:f["content-disposition"])||"",v=g.includes("filename=")?g.split("filename=")[1]:"exported_items.xlsx";a&&tse(d.data,v)}if(d.status>=400&&d.status<=500)throw new Error(`Client error (${d.status}): ${d.statusText}`);return this.emit("call-api",{apiCode:r,path:n,params:o,payload:s,res:d,success:!0}),l?d.data:d}catch(p){throw console.error("API Request Error:",p),p.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:p,success:!1,apiCode:r,res:p==null?void 0:p.response}),p}}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,unwrapResponse:o.unwrapResponse,timeout:ose.has(t)?nse:void 0})}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,unwrapResponse:!1})}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,unwrapResponse:!1})}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,unwrapResponse:!1})}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,unwrapResponse:!1})}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,unwrapResponse:!1})}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,unwrapResponse:!1})}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,unwrapResponse:!1})}async bulkCreate(t){return this.request("bulkCreate",{workspaceId:t.workspaceId,entityId:t.entityId},{payload:t.payload,params:t.filter,unwrapResponse:!1})}}const sse=(e,t,n,o,s,r,i)=>{const a=$(!1),{apiServices:l}=so(n,o),u=X(()=>!!(s!=null&&s.value&&(r!=null&&r.value))),c=Dn("filterParams",null);return{isUpdating:a,handleUpdate:async h=>{var p;const f=h.value;try{const g={itemIds:e.value.itemIds,metricId:h.id,workspaceId:String(e.value.workspaceId),filterParams:c!=null&&c.value?c.value:void 0};h.value==null?g.clear=1:g.value=f,u.value?(delete g.itemIds,g.entityId=String(o.entityId)):g.itemIds=e.value.itemIds,a.value=!0;const v=await((p=l.value)==null?void 0:p.bulkUpdateMetric(g));return console.log("Bulk update response:",v),t(h,v),v}catch(g){console.error("Error during bulk metric update:",g)}finally{a.value=!1}}}},rse=_t(nt({__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=iM(),o=$([]),s=e,r=t,i=$([]),a=$(null),l=z=>{var te,se,Z;const oe=o.value.findIndex(P=>P.id===z.id);a.value=oe;const ie=(te=i.value[oe])==null?void 0:te.$el;(se=E.value)==null||se.scrollTo(oe*30),ie&&ie.scrollIntoView({behavior:"smooth",block:"center"}),u(oe),(Z=i.value[oe])==null||Z.show()},u=z=>{a.value=z,i.value.forEach((oe,ie)=>{ie!==z&&oe&&oe.hide()})},c=$(""),d=()=>{c.value="",i.value.forEach(z=>{z==null||z.hide()}),a.value=null},h=X(()=>s.selectedIds||[]),f=X(()=>({itemIds:h.value,workspaceId:String(s.workspaceId)})),p=Dn("isSelectAll",$(!1)),g=Dn("bulkUpdate",$(!1)),v=$(null),{handleUpdate:w,isUpdating:S}=sse(f,(z,oe)=>{console.log("Update callback received:",z,oe),r("update",z)},!1,s,g,p),b=async z=>{var oe;r("update-start");try{const ie=await w(z);(ie==null?void 0:ie.status)!==Er.ACCEPTED&&(ie==null?void 0:ie.status)!==Er.OK?r("update-failed"):(r("update-completed",ie),setTimeout(()=>{var te;d(),(te=v.value)==null||te.hide()},500))}catch(ie){console.error("Failed to update metric:",ie),r("update-failed"),(oe=v.value)==null||oe.open()}},y=z=>{d(),ht(()=>{var oe;(oe=E.value)==null||oe.focus()})},E=$(null),_=(z,oe)=>{var ie;z?(ie=E.value)==null||ie.focus():d(),z&&oe!==z&&B("")},I=$(!0),T=$(!0),{apiServices:F}=so(!1,s),V=async(z,oe,ie)=>{var te;try{return ie?T.value=!0:I.value=!0,await((te=F.value)==null?void 0:te.getMetricList({workspaceId:s.workspaceId||"",entityId:s.entityId||"",page:z,query:oe,per_page:10}))}catch(se){throw console.error("Failed to fetch metric list:",se),se}finally{I.value=!1,T.value=!1}},x=$(0),A=$(!0),k=z=>({id:String(z.id),label:String(z.name),value:String(z.id),description:z.morpheme_value?`${String(z.morpheme_value)}`:"",type:n.checkEditType(z),metricConfig:z}),M=z=>z.filter(oe=>!oe.formula).filter(oe=>{var ie;return((ie=oe==null?void 0:oe.auth_permission)==null?void 0:ie.permission)==2}).map(k),N=async()=>{x.value+=1;const z=await V(x.value,c.value,!0);if(z&&z.data){const oe=M(z.data);o.value=[...o.value,...oe],A.value=z.meta.last_page!=z.meta.current_page}else A.value=!1},B=async z=>{c.value=z,x.value=1;try{const oe=await V(x.value,c.value);oe&&oe.data?(o.value=M(oe.data),A.value=oe.meta.last_page!=oe.meta.current_page):o.value=[]}catch{o.value=[]}};return(z,oe)=>(q(),Ke(jf,{ref_key:"wrapperRef",ref:v,isUpdating:L(S),disabled:s.disabled,onOnVisibleChange:_},{trigger:we(({hide:ie,disabled:te})=>[ye(St,{variant:s.variant,loading:L(S),disabled:te,onEscape:ie},{default:we(()=>[ye(pt,{src:"SquareRootVariable",class:"icon"}),oe[1]||(oe[1]=tt(" Metric ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:we(({isVisible:ie,popupRef:te,hide:se})=>[ze(ye(ya,{ref_key:"searchListRef",ref:E,style:{width:"320px"},options:o.value,loading:I.value,"loading-more":T.value,"selected-id":void 0,"has-more":A.value,onSearch:B,onSelect:l,onLoadMore:oe[0]||(oe[0]=()=>N()),onCancel:se},{item:we(({item:Z,index:P,selectedIndex:j})=>[ye(pee,{ref:ne=>i.value[P]=ne,label:Z.label,type:Z.type,morpheme:Z.description||"",onFocusOnSearch:y,onOpen:ne=>u(P),attachTo:te,config:Z.metricConfig,onHandleUpdate:b,class:le(["metric-update-item",{selected:a.value===P||j===P}])},null,8,["label","type","morpheme","onOpen","attachTo","config","class"])]),"extra-item":we(()=>[...oe[2]||(oe[2]=[Se("div",{style:{width:"250px"}},null,-1)])]),"empty-list":we(()=>[...oe[3]||(oe[3]=[tt("No options available.",-1)])]),_:2},1032,["options","loading","loading-more","has-more","onCancel"]),[[cr,ie]])]),default:we(()=>[oe[4]||(oe[4]=tt(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),[["__scopeId","data-v-989820f7"]]),ise={class:"status-label"},MN=_t(nt({__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 Bn(a).isLight()?"#f3f5f8":"#d7d7d7";return(a,l)=>(q(),de("div",{class:le(["status-option",{selected:o.selected,focused:o.focused,hovered:o.hovered}]),onClick:l[0]||(l[0]=u=>r(e.status.id))},[Se("div",{class:"status-color",style:hn({backgroundColor:e.status.color,borderColor:i(e.status.color)})},null,4),ze((q(),de("div",ise,[kt(a.$slots,"label",{},()=>[tt(it(e.status.name),1)],!0)])),[[L(n),{content:e.status.name,delay:[1e3,0]}]])],2))}}),[["__scopeId","data-v-aeaa75a4"]]),ase=["innerHTML"],NN=_t(nt({__name:"StatusEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{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=$([]),a=$(!1),l=$(!1),u=$(null),c=$(o.INITIAL_PAGE),d=$(!0),h=$(0),f=$(""),p=X(()=>{var k;return(k=s.value)==null?void 0:k.id});X(()=>!!(s.id||s.ids&&s.ids.length>0));const g=k=>({label:k.name,value:k.id,selected:p.value===k.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:k,id:k.id,color:k.color}),v=X(()=>{const k=new Set;return s.id&&k.add(String(s.id)),s.ids&&s.ids.forEach(M=>{M&&k.add(String(M))}),Array.from(k)}),w=Dn("bulkUpdate",!1),{apiServices:S}=so(!w,s),b=Gf(),{selectionStatus:y}=mo(b),E=Dn("filterParams",null),_=async(k=o.INITIAL_PAGE,M="",N=!1)=>{var B,z,oe,ie;N?l.value=!0:a.value=!0,u.value=null;try{const te={workspaceId:String(s.workspaceId),itemIds:v.value,page:k,perPage:o.PER_PAGE,name_like:M.trim(),...E||{},entityId:String(s.entityId)};if(((B=S.value)==null?void 0:B.getAssignableStatus)===void 0)throw new Error("API service getAssignableStatus is undefined");const se=await((z=S.value)==null?void 0:z.getAssignableStatus(te));if(!(se!=null&&se.data)){N||(i.value=[]),d.value=!1;return}const Z=se.data.map(g);i.value=N?[...i.value,...Z]:Z,h.value=((oe=se.meta)==null?void 0:oe.total)??se.data.length,d.value=!((ie=se.meta)!=null&&ie.on_last_page),c.value=k}catch(te){console.error("Error fetching statuses:",te),u.value="Failed to load statuses",N||(i.value=[]),d.value=!1,r("error",u.value)}finally{a.value=!1,l.value=!1}},I=wr(async k=>{f.value=k,c.value=o.INITIAL_PAGE,await _(o.INITIAL_PAGE,k,!1)},Si),T=async()=>{!d.value||l.value||await _(c.value+1,f.value,!0)},F=()=>{var k;r("cancel"),(k=s.params)==null||k.api.stopEditing()},V=async k=>{var M,N,B;try{const z={workspaceId:String(s.workspaceId),itemIds:v.value,statusId:String(k.value),entityId:String(s.entityId),filterParams:E!=null&&E.value?E==null?void 0:E.value:void 0};y.value==Ot.CHECKED&&w&&(z.itemIds=void 0,z.entityId=String(s.entityId)),r("start-update");const oe=await S.value.updateItemStatus(z);if(!oe)throw new Error("Status update failed: empty response");r("updated",{workspaceId:String(s.workspaceId),itemIds:v.value,isUpdateAll:y.value==Ot.CHECKED&&w,data:{id:k.id,name:k.label,color:k.color}}),s.params&&((N=s.params)==null||N.node.setData({...(M=s.params)==null?void 0:M.node.data,status:{id:k.id,name:k.label,color:k.color}}),(B=s.params)==null||B.api.stopEditing()),r("finish-update",oe)}catch(z){console.error("Error updating status:",z),u.value="Failed to update status",r("error",u.value)}},x=X(()=>i.value.map(k=>({...k})));Je([()=>s.id,()=>s.workspaceId,()=>s.ids],()=>{_()},{deep:!0,immediate:!0});const A=$(null);return Zt(()=>{ht(()=>{var k;(k=A.value)==null||k.focus()})}),t({refresh:()=>_(o.INITIAL_PAGE,f.value,!1),loadMore:T,focus:()=>{var k;return(k=A.value)==null?void 0:k.focus()}}),(k,M)=>{var N;return q(),Ke(ya,jt({ref_key:"popupRef",ref:A},s,{"selected-id":(N=s.value)==null?void 0:N.id,options:x.value,loading:a.value,"loading-more":l.value,"has-more":d.value,error:u.value,onSearch:L(I),onSelect:V,onLoadMore:T,onCancel:F,onClose:F}),{item:we(({item:B,selectedIndex:z,isSelected:oe,handleItemHover:ie,getHighlightedLabel:te,query:se,idx:Z})=>[(q(),Ke(MN,{key:B.value,status:B.data,selected:oe(B),onMouseover:P=>ie(Z),onSelect:P=>V(B),hovered:Z===z},{label:we(()=>[se?(q(),de("span",{key:0,class:le([k.$style["item-label"],k.$style.match]),style:{flex:"1"},innerHTML:te(B.label)},null,10,ase)):(q(),de("span",{key:1,class:le(k.$style["item-label"]),style:{flex:"1"}},it(B.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"}}]]),lse=nt({__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=X(()=>{const f=oo();return f==null?void 0:f.appContext.config.globalProperties.apiServices}),s=t,r=$(!1),i=$(null),a=f=>{try{r.value=!1,s("updated",f)}catch(p){console.error("Error handling status update:",p)}},l=X(()=>({apiServices:o.value,ids:n.ids,workspaceId:n.workspaceId,entityId:n.entityId,selectedAll:n.selectedAll}));ci("bulkUpdate",!0);const u=(f,p)=>{var g,v;r.value=!1,f?(s("update-completed",p),(g=i.value)==null||g.destroy()):(s("update-failed"),(v=i.value)==null||v.open())},c=$(null),d=(f,p)=>{var g;f&&((g=c.value)==null||g.focus())},h=()=>{r.value=!0,s("update-start")};return Je(()=>n.ids,()=>{}),(f,p)=>(q(),Ke(jf,{ref_key:"wrapperRef",ref:i,isUpdating:r.value,disabled:n.disabled||r.value,onOnVisibleChange:d},{trigger:we(({hide:g,disabled:v})=>[ye(St,{variant:n.variant,loading:r.value,disabled:v,onEscape:g},{default:we(()=>[ye(pt,{src:"Square",class:"icon"}),p[2]||(p[2]=tt(" Status ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:we(({hide:g})=>[ye(NN,jt({disabled:r.value,ref_key:"statusRef",ref:c},l.value,{onUpdated:a,onCancel:g,onStartUpdate:h,onFinishUpdate:p[0]||(p[0]=v=>u(!0,v)),onError:p[1]||(p[1]=v=>u(!1)),callback:()=>{}}),null,16,["disabled","onCancel"])]),default:we(()=>[p[3]||(p[3]=tt(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),qr=" ",i0=e=>e.replace(/[\r\n]+/g," "),ry=e=>e instanceof HTMLElement&&e.classList.contains("locked-tag"),js=e=>(e==null?void 0:e.nodeType)===Node.TEXT_NODE,a0=e=>{var t;return((t=e instanceof Element?e:e.parentElement)==null?void 0:t.closest(".locked-tag"))??null},ba=e=>{let t=0,n=e.length;return ry(e.previousSibling)&&e.data.startsWith(qr)&&(t=1),ry(e.nextSibling)&&n>t&&e.data.endsWith(qr)&&(n-=1),{start:t,end:n}},use=e=>{if(!js(e))return!1;const{start:t,end:n}=ba(e);return n<=t},LN=e=>{const t=a0(e.startContainer),n=a0(e.endContainer);return t&&e.setStartAfter(t),n&&e.setEndAfter(n),e},cse=(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 dse{constructor(t){Rn(this,"editor",null);Rn(this,"handleInput",()=>{this.editor&&(this.sanitize(),this.ensureTagPadding(),this.normalizeCaret(),this.options.onChange(this.parse()))});Rn(this,"handlePaste",t=>{var n;t.preventDefault(),this.insertPlainText(((n=t.clipboardData)==null?void 0:n.getData("text/plain"))??"")});Rn(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))});Rn(this,"handleBeforeInput",t=>{const n=t.inputType;(n.startsWith("format")||n==="insertParagraph"||n==="insertLineBreak"||n==="insertFromDrop"||n==="insertFromYank")&&t.preventDefault()});Rn(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});Rn(this,"handleKeydown",t=>{var s,r,i;const n=this.editor;if(!n)return;if(t.key==="Escape"){(r=(s=this.options).onEscape)==null||r.call(s,t);return}if(t.key==="Enter"){t.preventDefault();return}const o=t.ctrlKey||t.metaKey;if(o&&!t.altKey&&t.key.toLowerCase()==="a"){t.preventDefault(),(i=window.getSelection())==null||i.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 a=this.findAdjacentTag(t.key);a&&(t.preventDefault(),this.removeTag(a,t.key==="Backspace"?"after":"before"))}});Rn(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=a0(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(),js(i))n.collapse(i,ba(i).end);else if(js(a))n.collapse(a,ba(a).start);else if(js((i==null?void 0:i.nextSibling)??null)){const l=i.nextSibling;n.collapse(l,ba(l).start)}else if(js((a==null?void 0:a.previousSibling)??null)){const l=a.previousSibling;n.collapse(l,ba(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&&(cse(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(i0(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=>{js(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(qr),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 ry(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)?LN(n):null}insertPlainText(t,n){const o=this.editor;if(!o)return;const s=window.getSelection();let r=n?LN(n):this.getEditorRange();(!r||!o.contains(r.commonAncestorContainer))&&(r=document.createRange(),r.selectNodeContents(o),r.collapse(!1)),r.deleteContents();const i=document.createTextNode(i0(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(js(o)||this.isAllowedTagNode(o))return;n=!0;const s=ry(o)?"":i0(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;js(o)?o.data.endsWith(qr)||o.appendData(qr):n.before(document.createTextNode(qr)),js(s)?s.data.startsWith(qr)||s.insertData(0,qr):n.after(document.createTextNode(qr))})}async placeCaretAfterTag(t){var s;(s=this.editor)==null||s.focus(),await Promise.resolve();const n=document.createRange();n.setStart(t,ba(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(js(s)&&s.parentNode===n){const{start:l,end:u}=ba(s);if(i?Math.min(r,u)>l:Math.max(r,l)<u)return null;a=i?s.previousSibling:s.nextSibling}else return null;for(;use(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 js(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(!js(r))return!1;const i=ba(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(!js(o)||o.parentNode!==this.editor)return!1;const{start:r,end:i}=ba(o);let a,l=1,u=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),u=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,u),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(qr)&&s.data.startsWith(qr)&&(n==="after"?o.deleteData(o.length-1,1):s.deleteData(0,1)),(r=this.editor)==null||r.normalize(),this.handleInput()}focus(){var o;(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)}blur(){var t;(t=this.editor)==null||t.blur()}insertText(t){this.insertPlainText(t)}}const hse={class:"input-wrapper"},fse=["data-placeholder"],VN=_t(nt({__name:"DynamicInput",props:{modelValue:{type:Array,default:()=>[]},placeholder:{type:String,default:"Rename to"},allowedTags:{type:Array,default:void 0}},emits:["update:modelValue","escape"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=$(null),i=new dse({isTagAllowed:a=>!o.allowedTags||o.allowedTags.includes(a),onChange:a=>s("update:modelValue",a),onEscape:a=>s("escape",a)});return Zt(()=>{r.value&&i.mount(r.value,o.modelValue)}),Vn(()=>i.destroy()),Je(()=>o.modelValue,a=>{console.log("props.modelValue changed",a),i.sync(a)},{deep:!0}),t({insertTag:a=>i.insertTag(a),insertText:a=>i.insertText(a),updateTag:(a,l)=>i.updateTag(a,l),replaceTag:(a,l)=>i.replaceTag(a,l),deleteTag:a=>i.deleteTag(a),focus:()=>{i.focus()},triggerFocus:()=>{ht(()=>{var a;(a=r.value)==null||a.focus()})},blur:()=>{i.blur()}}),(a,l)=>(q(),de("div",hse,[Se("div",{ref_key:"editorRef",ref:r,class:"custom-input single-line",contenteditable:"true","data-placeholder":e.placeholder,onPaste:l[0]||(l[0]=(...u)=>L(i).handlePaste&&L(i).handlePaste(...u)),onDrop:l[1]||(l[1]=(...u)=>L(i).handleDrop&&L(i).handleDrop(...u)),onBeforeinput:l[2]||(l[2]=(...u)=>L(i).handleBeforeInput&&L(i).handleBeforeInput(...u)),onInput:l[3]||(l[3]=(...u)=>L(i).handleInput&&L(i).handleInput(...u)),onKeydown:l[4]||(l[4]=(...u)=>L(i).handleKeydown&&L(i).handleKeydown(...u)),onClick:l[5]||(l[5]=Ht((...u)=>L(i).handleClick&&L(i).handleClick(...u),["stop","prevent"]))},null,40,fse)]))}}),[["__scopeId","data-v-d654713d"]]),pse={key:0},gse={key:1},BN=8,$N=_t(nt({__name:"PreviewName",props:{text:{}},setup(e){const t=Kt,n=e,o=$(null),s=$(null),r=$(n.text),i=$(!1),a=d=>{const h=s.value;return h.textContent=d,h.offsetWidth},l=(d,h)=>{const f=d.slice(-BN),p=d.length-BN-1;if(p<1||a(d)<=h)return d;let g=0,v=p;for(;g<v;){const w=Math.ceil((g+v)/2);a(`${d.slice(0,w)}…${f}`)<=h?g=w:v=w-1}return`${d.slice(0,g)}…${f}`},u=()=>{!o.value||!s.value||(r.value=l(n.text,o.value.clientWidth),i.value=r.value!==n.text)};let c;return Zt(()=>{u(),c=new ResizeObserver(u),c.observe(o.value)}),Vn(()=>c==null?void 0:c.disconnect()),Je(()=>n.text,()=>ht(u)),(d,h)=>(q(),de("div",{ref_key:"rootRef",ref:o,class:"preview-name"},[i.value?ze((q(),de("span",pse,[tt(it(r.value),1)])),[[L(t),{content:e.text,delay:[1e3,0],bypassOverflowCheck:!0}]]):(q(),de("span",gse,it(e.text),1)),Se("span",{ref_key:"measureRef",ref:s,class:"measure","aria-hidden":"true"},null,512)],512))}}),[["__scopeId","data-v-f1310bab"]]),mse={class:"left-section"},vse={class:"modified-template-options"},yse=["onClick"],wse={class:"setting-count"},Cse={class:"field-label"},bse={class:"field-label"},Sse={class:"confirmation"},Ese={class:"preview-section"},_se={class:"preview-list"},Rse={key:0,class:"preview-more"},HN=8,l0=7,Tse=_t(nt({__name:"BulkRenamePopup",props:{item:{},selectAll:{type:Boolean},selectedItemsCount:{}},emits:["cancel","rename"],setup(e,{expose:t,emit:n}){const o=Kt,s=xo,r=$(null),i=["number","letter","name"],a={number_up:"1→9",number_down:"9→1",letter_up:"A→Z",letter_down:"Z→A",name:"Name"},l=$({}),u=$(null),c=e,d=$([]),h=X(()=>{const K=f.value;let Y=0;const re="9999.",R={input:`${re}0`,bulkRenameButton:`${re}13`,cancelButton:`${re}12`,firstField:`${re}10`,stepField:`${re}11`,name:`${re}1`,number_up:`${re}2`,number_down:`${re}3`,letter_up:`${re}4`,letter_down:`${re}5`};return["name","number_up","number_down","letter_up","letter_down"].forEach((J,ce)=>{Y++,R[J]=`${re}${Y}`}),K?(Y++,R.firstField=`${re}${Y}`,Y++,R.stepField=`${re}${Y}`):(delete R.firstField,delete R.stepField),Y++,R.cancelButton=`${re}${Y}`,P.value?delete R.bulkRenameButton:(Y++,R.bulkRenameButton=`${re}${Y}`),console.log(R),R}),f=X(()=>d.value.find(K=>typeof K!="string"&&(K.id==="number"||K.id==="letter"))),p=$("number"),g=$("up"),v=Oo({...Ei.number}),w=Oo({...Ei.number}),S=()=>{Object.assign(v,Ei[p.value]),Object.assign(w,Ei[p.value])};Je(f,K=>{if(!K)return;const Y=K.id;Y!==p.value&&(p.value=Y,S()),g.value=K.direction==="down"?"down":"up"},{immediate:!0,flush:"sync"});const b=X(()=>YO[g.value]),y=(K,Y)=>{const re=JO(p.value,K,Y);v[K]=re,Mv(K,re)&&(w[K]=re)},E=$(null),_=$(null),I=$(null),T=(K,Y)=>{var R,G,J,ce;if(Y.key==="Enter"||Y.key==="Escape")return;if(Y.key==="Tab"){Y.preventDefault(),Y.stopPropagation(),Y.stopImmediatePropagation();const Ee=Y.shiftKey;K=="first"&&(Ee?(R=l.value.letter_down)==null||R.focus():(G=E.value)==null||G.focus()),K=="step"&&(Ee?(J=_.value)==null||J.focus():(ce=I.value)==null||ce.focus());return}Y.key.length===1&&!Y.ctrlKey&&!Y.metaKey&&!Y.altKey&&!ZO(p.value,K,Y.key)&&Y.preventDefault()},F=(K,Y)=>{var ce;Y.preventDefault();const re=Y.target,R=((ce=Y.clipboardData)==null?void 0:ce.getData("text/plain"))??"",G=re.selectionStart??re.value.length,J=re.selectionEnd??re.value.length;re.value=re.value.slice(0,G)+R+re.value.slice(J),y(K,re.value),re.value=v[K]},V=K=>{if(Mv(K,v[K]))return;const Y=Ei[p.value][K];v[K]=Y,w[K]=Y},x=X(()=>f.value?CE({type:p.value,direction:g.value,first:w.first,step:w.step,count:c.item.length}):[]),A=X(()=>d.value.every(K=>typeof K=="string"&&!K)),k=X(()=>A.value||d.value.length==0&&d.value[0]===" "?c.item.map(K=>K.name):c.item.map((K,Y)=>d.value.map(re=>typeof re=="string"?re:re.id==="name"?K.name:x.value[Y]??"").join(""))),M=X(()=>c.selectAll?c.selectedItemsCount-l0:k.value.length>HN?k.value.length-l0:0),N=X(()=>k.value.length>HN?k.value.slice(0,l0):k.value),B=[{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"}}],z=K=>{ie.value=[K];const Y=K.id.split("_")[0],re=K.id.split("_")[1],R=a[K.id],G=r.value;if(!G)return;const J=Ee=>d.value.find(Ce=>typeof Ce!="string"&&Ee.includes(Ce.id));if(Y==="name"){J(["name"])?G.deleteTag("name"):G.insertTag({id:Y,text:R,direction:void 0});return}const ce=J(["number","letter"]);if(ce){const Ee=ce.id===Y,Ce=ce.direction===re;if(Ee&&Ce){G.deleteTag(ce.id);return}G.deleteTag(ce.id),G.insertTag({id:Y,text:R,direction:re})}else G.insertTag({id:Y,text:R,direction:re})},oe=K=>te(K.id)?K.description.active:!!f.value&&K.description.switch?K.description.switch:K.description.inactive,ie=$(null),te=K=>{const[Y,re]=K.split("_");return d.value.some(R=>typeof R!="string"&&R.id===Y&&R.direction===re)},se=n,Z=X(()=>d.value.length===1&&typeof d.value.at(0)!="string"&&d.value[0].id==="name"),P=X(()=>d.value.length===0||Z.value),j=()=>{ie.value=null,d.value=[],se("cancel")},ne=()=>{const K=d.value.map(Y=>typeof Y=="string"?{type:"text",value:Y}:Y.id==="name"?{type:"current_name"}:{type:"counter",value:v.first,direction:Y.direction=="up"?"asc":"desc",format:Y.id==="number"?"number":"letter",step:v.step});se("rename",K)};t({reset:()=>{ie.value=null,d.value=[]},focus:()=>{var K;(K=r.value)==null||K.focus()}}),Zt(()=>{console.log("Focusing template input"),setTimeout(()=>{var K;(K=r.value)==null||K.focus()},500)});const xe=K=>{var Y,re;console.log("Focusing popup"),K.preventDefault(),K.stopPropagation(),(Y=r.value)==null||Y.blur(),(re=u.value)==null||re.focus()},ue=K=>{var Y;(K.key==="Enter"||K.key==="Tab")&&((Y=r.value)==null||Y.focus()),K.key==="Escape"&&j()};return(K,Y)=>(q(),de("div",{class:"bulk-rename-popup",id:"bulk-rename-el",ref_key:"popupRef",ref:u,onKeydown:ue},[Se("div",mse,[ze(ye(VN,{modelValue:d.value,"onUpdate:modelValue":Y[0]||(Y[0]=re=>d.value=re),"allowed-tags":i,ref_key:"templateInputRef",ref:r,onEscape:xe},null,8,["modelValue"]),[[L(s),h.value.input]]),Se("div",vse,[(q(),de(Pt,null,xn(B,re=>ze((q(),de("button",{onClick:R=>z(re),ref_for:!0,ref:R=>l.value[re.id]=R,key:re.id,class:le([{active:te(re.id)},"template-option"])},[tt(it(re.name)+" ",1),re.icon?(q(),Ke(L(pt),{key:0,src:re.icon,style:{transform:"rotate(90deg)"}},null,8,["src"])):Ye("",!0)],10,yse)),[[L(o),{content:oe(re),bypassOverflowCheck:!0,delay:[300,0],interactive:!1,hideOnClick:!1,appendTo:"parent"}],[L(s),`${h.value[re.id]}`]])),64))]),Se("div",wse,[Se("span",Cse,it(b.value.first),1),ze((q(),Ke(L(hl),{ref_key:"firstFieldRef",ref:_,"model-value":v.first,disabled:!f.value,"max-length":L(yE),onInput:Y[1]||(Y[1]=re=>y("first",re)),onKeydown:Y[2]||(Y[2]=re=>T("first",re)),onPaste:Y[3]||(Y[3]=re=>F("first",re)),onBlur:Y[4]||(Y[4]=re=>V("first")),"show-clear":!1},{clear:we(()=>[...Y[10]||(Y[10]=[Se("div",null,null,-1)])]),_:1},8,["model-value","disabled","max-length"])),[[L(s),h.value.firstField]]),Se("span",bse,it(b.value.step),1),ze(ye(L(hl),{"model-value":v.step,disabled:!f.value,"max-length":L(wE),onInput:Y[5]||(Y[5]=re=>y("step",re)),onKeydown:Y[6]||(Y[6]=re=>T("step",re)),onPaste:Y[7]||(Y[7]=re=>F("step",re)),onBlur:Y[8]||(Y[8]=re=>V("step")),"show-clear":!1,ref_key:"fieldStepRef",ref:E},null,8,["model-value","disabled","max-length"]),[[L(s),h.value.stepField]])]),Se("div",Sse,[ze((q(),Ke(L(St),{variant:"secondary",onClick:j,ref_key:"cancelBtnRef",ref:I},{default:we(()=>[...Y[11]||(Y[11]=[tt(" Cancel ",-1)])]),_:1})),[[L(s),h.value.cancelButton]]),ze((q(),Ke(L(St),{onClick:ne,disabled:P.value,onKeydown:Y[9]||(Y[9]=go(re=>{re.stopPropagation(),re.preventDefault(),ne()},["enter"]))},{default:we(()=>[...Y[12]||(Y[12]=[tt(" Rename ",-1)])]),_:1},8,["disabled"])),[[L(s),h.value.bulkRenameButton]])])]),Se("div",Ese,[Y[13]||(Y[13]=Se("span",{class:"preview-title"},"Preview",-1)),Se("ul",_se,[(q(!0),de(Pt,null,xn(N.value,(re,R)=>(q(),de("li",{key:R},[ye($N,{text:re},null,8,["text"])]))),128)),M.value>0?(q(),de("li",Rse," … "+it(M.value)+" more items ",1)):Ye("",!0)])])],544))}}),[["__scopeId","data-v-9264bb9d"]]),Dse=nt({__name:"BulkRenameButton",props:{item:{},totalItem:{},selectAll:{}},emits:["cancel","rename"],setup(e,{expose:t,emit:n}){const{popupRef:o,show:s,hide:r,triggerRef:i}=yo({interactive:!0,trigger:"manually",placement:"top-end",showArrow:!1,offset:[-350,25],hideOnClick:!0,toggleOnClick:!0,onHide:()=>{h()},onShow:()=>{ht(()=>{var f;(f=d.value)==null||f.focus()})}}),a=e,l=()=>{r()},u=f=>{c("rename",f),r()},c=n,d=$(null),h=()=>{d.value&&d.value.reset()};return t({popupRef:o,hide:r,show:s,triggerRef:i}),(f,p)=>(q(),de(Pt,null,[Se("div",{class:"trigger-el",ref_key:"triggerRef",ref:i},null,512),Se("div",{class:"popup-el",ref_key:"popupRef",ref:o},[ye(Tse,{item:a.item,"select-all":a.selectAll==L(Ot).CHECKED,"selected-items-count":a.totalItem,ref_key:"bulkRenameRef",ref:d,onCancel:l,onRename:u},null,8,["item","select-all","selected-items-count"])],512)],64))}}),Ise={style:{"max-width":"225px","line-height":"14px"}},xse={style:{"max-width":"100px","line-height":"14px"}},Ase=_t(nt({__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=xo,s=e,r=t,{handelSelectAll:i}=Gf(),a=$(null),{selectionStatus:l,isSelectAll:u,selectedIds:c,isBulkUpdate:d,isUpdating:h,isLoading:f,handleUpdateStart:p,handleUpdatePostUpdate:g,handleUpdateFailed:v,handleUpdateBulkStatus:w,handleUpdateBulkDate:S,handleBulkUpdateMetric:b,handleUpdateNewAssignee:y,handleDelete:E,handleArchive:_,handleUnarchive:I,deleteThumbnail:T,deleteRendition:F,handleBulkUpdateName:V}=vQ(s,a,{onUpdated:()=>r("updated"),onRefreshSelectedRow:()=>r("refreshSelectedRow")});ci("bulkUpdate",d),ci("isSelectAll",u);const x=["primary"],A=[{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}],k=()=>{r("unselect")},M=cE(),{userPermissions:N}=mo(M),B=X(()=>N.value.includes(dE)),z=X(()=>{if(!B.value){console.error("User does not have permission to open review.");return}return l.value==Ot.CHECKED?es({type:"review_take",config:{reviewDomain:un.getInstance().getItem("BASE_REVIEW_URL"),ws_code:s.workspaceId,take_id:s.entityId}}).url:es({type:"review_multiple_scenes",config:{reviewDomain:un.getInstance().getItem("BASE_REVIEW_URL"),ws_code:s.workspaceId,scene_ids:c.value.join(",")}}).url}),oe=$(null),ie=async ne=>{var ge,xe,ue;try{switch(h.value=!0,f.value=!0,ne.id){case"unarchive":await I();break;case"delete":await E();break;case"archive":await _();break;case"delete-thumbnail":await T();break;case"delete-rendition":await F();break;case"bulk-rename":P(),(ge=a.value)==null||ge.hide();break;default:console.error("Unknown action:",ne.id),f.value=!1;break}}catch(K){console.error("Error performing action:",K),(xe=a.value)==null||xe.open()}finally{(ue=oe.value)==null||ue.focus(),ht(()=>{h.value=!1,f.value=!1})}},te=(ne,ge)=>{var xe;!ne&&ge&&((xe=oe.value)==null||xe.focus())},se=X(()=>({workspaceId:s.workspaceId,entityId:s.entityId,variant:x,disabled:h.value,ids:l.value==Ot.CHECKED?[]:c.value})),Z=$(null),P=()=>{var ne;(ne=Z.value)==null||ne.show()},j=X(()=>s.selectRowData.map((ne,ge)=>({name:ne.name,index:ge})));return(ne,ge)=>ze((q(),de("div",{class:le(ne.$style["bulk-update-action"])},[Se("div",{class:le(ne.$style["left-actions"])},[Se("div",{class:le(ne.$style["selection-track"])},[ye(St,{class:le(ne.$style["btn-close"]),variant:["tertiary","icon"],onClick:k,style:{background:"transparent"}},{prefix:we(()=>[ye(pt,{src:"XMarkSolid",source:"remote"})]),_:1},8,["class"]),L(l)==L(Ot).INDETERMINATE?(q(),de("span",{key:0,class:le(ne.$style["selected-count"])},it(e.selectRowData.length)+" selected ",3)):Ye("",!0),L(l)==L(Ot).CHECKED?(q(),de("span",{key:1,class:le(ne.$style["selected-count"]),style:{"line-height":"14px"}},[ge[0]||(ge[0]=tt(' All in  " ',-1)),ze((q(),de("span",Ise,[tt(it(e.takeName),1)])),[[L(n),{content:e.takeName}]]),ge[1]||(ge[1]=tt(' " ',-1))],2)):Ye("",!0),!e.loading&&L(l)==L(Ot).INDETERMINATE&&e.totalRows>e.selectRowData.length&&e.selectRowData.length==e.visibleRows?(q(),Ke(St,{key:2,variant:"secondary",onHandleClick:L(i)},{default:we(()=>[Se("span",{class:le(ne.$style["selected-count"]),style:{"line-height":"14px"}},[ge[2]||(ge[2]=tt(' Select all in  " ',-1)),ze((q(),de("span",xse,[tt(it(e.takeName),1)])),[[L(n),{content:e.takeName}]]),ge[3]||(ge[3]=tt(' " ',-1))],2)]),_:1},8,["onHandleClick"])):Ye("",!0),Se("span",{class:le(ne.$style.divider)},null,2)],2),ye(lse,jt(se.value,{onUpdated:L(w),onUpdateStart:L(p),onUpdateCompleted:L(g),onUpdateFailed:L(v),"selected-all":L(l)==L(Ot).CHECKED}),null,16,["onUpdated","onUpdateStart","onUpdateCompleted","onUpdateFailed","selected-all"]),ye(HQ,jt({onUpdate:L(y),onUpdateStart:L(p),onUpdateCompleted:L(g),onUpdateFailed:L(v),"selected-all":L(l)==L(Ot).CHECKED},se.value),null,16,["onUpdate","onUpdateStart","onUpdateCompleted","onUpdateFailed","selected-all"]),ye(eee,jt({"row-selected":e.selectRowData,"selected-all":L(l)==L(Ot).CHECKED},se.value,{onUpdated:L(S),onUpdateStart:L(p),onUpdateCompleted:L(g),onUpdateFailed:L(v)}),null,16,["row-selected","selected-all","onUpdated","onUpdateStart","onUpdateCompleted","onUpdateFailed"]),ye(rse,{disabled:L(h),onUpdate:L(b),onUpdateStart:L(p),onUpdateCompleted:L(g),onUpdateFailed:L(v),selectedIds:L(c),"workspace-id":e.workspaceId,variant:x,"entity-id":e.entityId,"selected-all":L(l)==L(Ot).CHECKED},null,8,["disabled","onUpdate","onUpdateStart","onUpdateCompleted","onUpdateFailed","selectedIds","workspace-id","entity-id","selected-all"]),Se("span",{class:le(ne.$style.divider)},null,2),ze((q(),de("div",null,[B.value?(q(),Ke(St,{key:0,class:le(ne.$style["action-button"]),variant:[...x,"icon"],href:z.value,disabled:L(h)||s.selectRowData.length>40&&L(l)!=L(Ot).CHECKED},{default:we(()=>[ye(pt,{src:"PenRuler",class:le(ne.$style["icon-btn"])},null,8,["class"])]),_:1},8,["class","variant","href","disabled"])):Ye("",!0)])),[[L(n),s.selectRowData.length<=40||L(l)==L(Ot).CHECKED?"Open in Review":"Select fewer than 40 items to open in Review"]]),Se("span",{class:le(ne.$style.divider)},null,2),ye(jf,{ref_key:"wrapperRef",ref:a,isUpdating:L(h),disabled:L(h),onOnVisibleChange:te},{trigger:we(({hide:xe,toggle:ue,isVisible:K,disabled:Y})=>[ze((q(),Ke(St,{onEscape:xe,actived:K,ref_key:"moreActionRef",ref:oe,class:le(ne.$style["action-button"]),variant:["secondary","icon"],loading:L(f),disabled:Y||L(h),onClick:Ht(ue,["stop"])},{default:we(()=>[ye(pt,{src:"EllipsisVertical",class:le(ne.$style.icon),source:"remote"},null,8,["class"])]),_:1},8,["onEscape","actived","class","loading","disabled","onClick"])),[[L(o),"99999"],[L(n),{content:"More actions"}]])]),popup:we(({isVisible:xe,hide:ue})=>[(q(),de(Pt,null,xn(A,(K,Y)=>ye(fl,jt({clickable:!0,key:K.id},{ref_for:!0},K,{show:xe,style:{borderLeft:0},"focus-index":"99999."+Y,onClick:()=>{ie(K)},onEscape:ue}),null,16,["show","focus-index","onClick","onEscape"])),64))]),_:1},8,["isUpdating","disabled"])],2),ye(Dse,{item:j.value,totalItem:L(u)?s.totalRows:j.value.length,"select-all":L(l),onRename:L(V),ref_key:"bulkRenameButtonRef",ref:Z},null,8,["item","totalItem","select-all","onRename"])],2)),[[cr,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"}}]]),yl=_t(nt({name:"LabelRenderer",__name:"LabelRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean}},setup(e){const t=Bs,n=Kt,o=e,s=X(()=>({disabled:o.disabled,error:!1,readOnly:o.readOnly,isEmpty:o.value===void 0||o.value===null||o.value==="",clickable:!0})),{argsMain:r}=Ao(s),i=X(()=>{var u,c,d;return!!((u=o.params)!=null&&u.api||(c=o.params)!=null&&c.node||(d=o.params)!=null&&d.context)}),a=X(()=>{if(o.tooltip){if(typeof o.tooltip=="string")return{content:o.tooltip};if(typeof o.tooltip=="object"&&"display_name"in o.tooltip){const u=o.tooltip,c=document.createElement("div");c.classList.add("tooltip-user-info"),c.style.display="flex",c.style.alignItems="center",c.style.gap="4px";const d=document.createElement("div"),h=ye(Ef,{id:u.id,name:u.display_name,profile_image:u.profile_image,size:20,initial:u.initial,color:u.color});rb(h,d);const f=document.createElement("span");f.innerText=u.display_name,f.classList.add("tooltip-user-name");const p=document.createElement("span");p.style.whiteSpace="nowrap",p.innerText="By",c.appendChild(p),c.appendChild(d),c.appendChild(f);const g=document.getElementById("item-table-layout-id");return{content:c,allowHtml:!0,appendTo:g||document.body,bypassOverflowCheck:!0}}}return{content:void 0}}),l=X(()=>o.value===void 0);return(u,c)=>ze((q(),Ke(Lo,jt(L(r),{ref:"displayWrapperRef"}),{default:we(()=>[Se("span",{class:le(u.$style["item-table-label-renderer"])},it(o.value||"-"),3)]),_:1},16)),[[L(t),{isLoading:l.value||!i.value}],[L(n),a.value]])}}),[["__cssModules",{$style:{"item-table-label-renderer":"_item-table-label-renderer_s1gdy_1"}}]]),Pse=["placeholder","maxlength"],kse={key:0,class:"wrapper-suffix"},Fse=_t(nt({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=Bs,s=Kt,r=e,i=n,a=$(r.value),l=$(null),u=$(null),c=$(r.value||""),d=$(!1),h=$(!1),f=X(()=>{var x;return{disabled:r.disabled,error:!1,readOnly:r.readOnly,isEmpty:((x=r.value)==null?void 0:x.length)===0,inputRef:l,wrapperRef:u,clickable:!0,focused:d.value||r.keyboardFocusing}}),{argsMain:p,isHover:g}=Ao(f),v=()=>c.value!==a.value,w=()=>{h.value=!0,d.value=!1,c.value=a.value,i("update:value",a.value),setTimeout(()=>{h.value=!1},100)},S=()=>{if(!d.value||!l.value)return;const x=l.value.value;if(!v()){d.value=!1;return}a.value=x,i("update:value",x),i("enter",x),d.value=!1},b=()=>{h.value||(r.saveOnBlur?S():w(),i("blur",c.value))},y=x=>{var A;if(x.key==="ArrowLeft"||x.key==="ArrowRight"){x.stopPropagation();return}x.ctrlKey&&(x.key=="a"||x.key=="A")?(x.stopPropagation(),(A=l.value)==null||A.select()):x.key==="Enter"?(x.preventDefault(),x.stopPropagation(),S()):x.key==="Escape"&&(x.preventDefault(),x.stopPropagation(),w())},E=()=>{a.value=r.value,c.value=r.value,d.value=!0,ht(()=>{var x,A;(x=l.value)==null||x.click(),(A=l.value)==null||A.focus()})},_=()=>{var x;d.value?w():(x=l.value)==null||x.blur(),i("blur",c.value)},I={focus:()=>{E()}};Zt(()=>{var A;const x=(A=u.value)==null?void 0:A.$el;x&&(x.__sceneNameEditor=I)}),Vn(()=>{const x=u.value;x&&delete x.__sceneNameEditor});const T=$(null),F=$(null);t({focus:E,blur:()=>{var x;return(x=l.value)==null?void 0:x.blur()},save:S,cancel:w,focusEditButton:()=>{ht(()=>{var x;(x=T.value)==null||x.focus()})},focusCancelButton:()=>{ht(()=>{var x;(x=F.value)==null||x.focus()})},startEdit:E});const V=X(()=>r.value===void 0);return _E(u,()=>{d.value&&b()}),(x,A)=>ze((q(),Ke(L(Lo),jt(L(p),{ref_key:"wrapperRef",ref:u,bordered:r.bordered,style:{paddingTop:"0px",paddingBottom:"0px"}}),Hh({default:we(()=>[d.value?Ye("",!0):kt(x.$slots,"default",{isEditting:d.value,isHover:L(g)},()=>[ze((q(),de("span",{class:le(x.$style["label-renderer"])},[tt(it(c.value),1)],2)),[[L(s),{content:c.value||void 0}]])],void 0,0),ze(Se("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":A[0]||(A[0]=k=>c.value=k),class:le(x.$style["label-editor"]),placeholder:e.placeholder,maxlength:e.maxLength,onKeydown:y,onBlur:b},null,42,Pse),[[cr,d.value],[hI,c.value]])]),_:2},[!e.disabled&&!e.readOnly?{name:"suffix",fn:we(({hovered:k,focused:M})=>[k?(q(),de("div",kse,[k&&!M?ze((q(),Ke(St,{key:0,variant:["icon","secondary"],size:24,onClick:Ht(E,["prevent","stop"]),tabindex:"0",ref_key:"editButtonRef",ref:T,onKeydown:[go(Ht(E,["prevent","stop"]),["enter"]),go(Ht(_,["prevent","stop"]),["escape"])]},{default:we(()=>[ye(L(pt),{src:"Pen",source:"remote"})]),_:1},8,["onKeydown"])),[[L(s),"Edit"]]):Ye("",!0)])):Ye("",!0)]),key:"0"}:void 0]),1040,["bordered"])),[[L(o),{isLoading:V.value}]])}}),[["__cssModules",{$style:{"label-renderer":"_label-renderer_cyzth_1","label-editor":"_label-editor_cyzth_10"}}]]),Ose=["tabindex"],GN=_t(nt({name:"SceneNameEditor",__name:"SceneNameEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean},placeholder:{default:"Enter name"}},emits:["update:value","enter","blur"],setup(e,{expose:t,emit:n}){const o=Kt,s=Bs,r=e,i=n,a=$(r.value),l=$(r.value),u=$(null),c=$(null),d=Dn("bulkUpdate",!1),{apiServices:h}=so(!d,r),f=X(()=>{var te;return{componentType:void 0,disabled:r.disabled,error:!1,readOnly:r.readOnly,isEmpty:((te=a==null?void 0:a.value)==null?void 0:te.length)===0,inputRef:u,wrapperRef:c,clickable:!0}}),{isFocus:p}=Ao(f),g=X(()=>{const te=un.getInstance().getItem("ws.code"),se=un.getInstance().getItem("BASE_URL"),Z=te||r.workspaceId;return es({type:"scene_hub",config:{baseDomain:se,ws_code:Z,scene_id:String(r.id)}}).url}),v=X(()=>{var te,se,Z;return((se=(te=r.data)==null?void 0:te.isProcessing)==null?void 0:se.state)==0||((Z=r.data)==null?void 0:Z.isDeleted)==!0}),w=X(()=>r.readOnly||_.value),S=X(()=>{var te,se,Z,P,j;return((te=r.data)==null?void 0:te.isDeleted)==!0||((Z=(se=r.data)==null?void 0:se.isProcessing)==null?void 0:Z.state)==0||((j=(P=r.data)==null?void 0:P.isProcessing)==null?void 0:j.state)==1}),b=X(()=>{var te,se;return(se=(te=r.data)==null?void 0:te.isProcessing)==null?void 0:se.message}),y=X(()=>{var te;return((te=r.data)==null?void 0:te.isArchived)==1}),E=X(()=>{var te;return((te=r.data)==null?void 0:te.isLocked)==1}),_=X(()=>r.value===void 0),I=X(()=>{var te,se;return((se=(te=r.data)==null?void 0:te.permissions)==null?void 0:se.has_edit_permission)==1}),T=async te=>{var se,Z,P,j,ne,ge,xe,ue,K,Y;a.value=te,p.value=!1;try{const re=await((Z=(se=h.value)==null?void 0:se.updateSceneName)==null?void 0:Z.call(se,{workspaceId:r.workspaceId,entityId:r.entityId,itemId:r.id,name:a.value})),R=_v.get(wO)||"UTC";if(re){const G=EO(re,R),J={...r.data,...G};(P=r.params)==null||P.api.clearFocusedCell();const ce=((ne=(j=r.params)==null?void 0:j.column)==null?void 0:ne.getColId())||"",Ee=((xe=(ge=r.params)==null?void 0:ge.node)==null?void 0:xe.rowIndex)||0;(ue=r.params)==null||ue.api.setFocusedCell(Ee,ce),(Y=(K=r.params)==null?void 0:K.node)==null||Y.setData(J),l.value=a.value,i("enter")}else a.value=l.value}catch(re){console.error("Failed to update scene name:",re),a.value=l.value}},F={focus:()=>{p.value=!0,ht(()=>{var te;return(te=c.value)==null?void 0:te.focus()})},startEdit:()=>{var te;(te=c.value)==null||te.startEdit()}},V=()=>c.value?"$el"in c.value?c.value.$el:c.value:null;Je(()=>r.value,te=>{a.value=te,l.value=te}),Zt(()=>{const te=V();te&&(te.__sceneNameEditor=F)}),Vn(()=>{const te=c.value,se=te&&"$el"in te?te.$el:te;se&&delete se.__sceneNameEditor});const x=fd(),{openSceneHub:A}=x,k=te=>{try{if(te.ctrlKey||te.metaKey){window.open(g.value,"_blank");return}A(String(r.id))}catch{window.open(g.value,"_blank")}finally{oe()}},M=()=>{setTimeout(()=>{ie.value=!0,N.value=0,ht(()=>{var te;(te=B.value)==null||te.focus()})},300)},N=$(-1),B=$(null);t({focus:M,trigerFocus:M,startEdit:()=>{var te;(te=c.value)==null||te.startEdit()}});const z=te=>{if(te.key==="Enter"){te.preventDefault(),k(te);return}if(te.key==="Escape"){te.preventDefault(),oe();return}te.key==="Tab"&&(te.preventDefault(),te.stopPropagation(),te.stopImmediatePropagation(),ht(()=>{var se;(se=c.value)==null||se.focusEditButton()}))},oe=()=>{var Z,P,j,ne,ge,xe;ie.value=!1,N.value=-1,(Z=r.params)==null||Z.api.clearFocusedCell();const te=((j=(P=r.params)==null?void 0:P.column)==null?void 0:j.getColId())||"",se=((ge=(ne=r.params)==null?void 0:ne.node)==null?void 0:ge.rowIndex)||0;(xe=r.params)==null||xe.api.setFocusedCell(se,te)},ie=$(!1);return(te,se)=>ze((q(),Ke(Fse,{"save-on-blur":!0,ref_key:"wrapperRef",ref:c,disabled:r.disabled,"read-only":w.value,placeholder:r.placeholder,value:a.value,"onUpdate:value":se[0]||(se[0]=Z=>a.value=Z),id:`scene-name-${r.id}`,onEnter:T,"max-length":255,bordered:!0,keyboardFocusing:ie.value,onBlur:oe},{default:we(({isHover:Z,isEditting:P})=>[ze(Se("div",{class:le(te.$style["scene-name-display"])},[ze((q(),de("a",{tabindex:N.value,ref_key:"nameRef",ref:B,onClick:Ht(k,["prevent"]),onKeydown:z,target:"_blank",class:le(te.$style["scene-name-text"]),style:{lineHeight:"28px"}},[tt(it(a.value),1)],42,Ose)),[[L(o),{content:a.value,delay:[1e3,0]}]]),w.value||!Z&&!P&&!w.value?(q(),de(Pt,{key:0},[E.value?ze((q(),de("div",{key:0,class:le([te.$style["icon-processing"],te.$style.isLocked])},[ye(pt,{src:"Lock",color:I.value?"#a6a6a6":"#232323"},null,8,["color"])],2)),[[L(o),{content:I.value?"Locked — You can still edit, or unlock by changing the status from completed":"Locked",delay:[1e3,0]}]]):Ye("",!0),y.value?ze((q(),de("div",{key:1,class:le([te.$style["icon-processing"],te.$style.archived])},[ye(pt,{src:"BoxArchive"})],2)),[[L(o),{content:"Archived",delay:[1e3,0]}]]):Ye("",!0),S.value?ze((q(),de("div",{key:2,class:le([te.$style["icon-processing"],te.$style.processing,v.value&&te.$style["icon-red"]])},[ye(pt,{src:"AnimatedHourglass",color:"inherit"})],2)),[[L(o),b.value]]):Ye("",!0)],64)):Ye("",!0)],2),[[cr,!L(p)]])]),_:1},8,["disabled","read-only","placeholder","value","id","keyboardFocusing"])),[[L(s),{isLoading:_.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"}}]]),u0=_t(nt({__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=xo,s=$([]),r=e,i=$(null),a=X(()=>typeof r.size=="number"?`${r.size}px`:{small:"24px",medium:"32px",large:"48px"}[r.size]??"32px"),l=X(()=>{let w=[];return typeof r.variant=="string"?w.push(r.variant):Array.isArray(r.variant)&&(w=[...r.variant]),[...w,"icon"]}),u=n,{hide:c,isVisible:d,show:h,triggerRef:f,popupRef:p,instance:g}=yo({toggleOnClick:!0,offset:[0,0],onShow:()=>u("open")});function v(w){u("select",w),c()}return $h(()=>{g.value&&g.value.setProps({placement:r.placement})}),t({show:h,hide:c,hideDropdown:()=>{c()},popupRef:p}),Je(d,w=>{var S;w&&((S=p.value)==null||S.focus())}),(w,S)=>(q(),de("div",{class:le(w.$style["button-dropdown-wrapper"]),style:hn({"--button-size":a.value})},[Se("div",{class:le(w.$style["button-group"])},[kt(w.$slots,"prefix"),Se("div",{ref_key:"triggerRef",ref:f,class:le(L(d)?w.$style.open:"")},[kt(w.$slots,"triggerDropdown",{open:L(d)},()=>[r.readOnly?Ye("",!0):ze((q(),Ke(St,{key:0,onEscape:L(c),ref_key:"mainButton",ref:i,actived:L(d),class:le(w.$style["button-dropdown-trigger"]),variant:l.value,size:e.size,disabled:r.disabled},{default:we(()=>[kt(w.$slots,"iconDropdown",{},()=>[ye(pt,{class:le(w.$style["icon-dropdown"]),src:"ChevronDown",source:"remote"},null,8,["class"])])]),_:3},8,["onEscape","actived","class","variant","size","disabled"])),[[L(o),e.tabIndex]])])],2)],2),Se("div",{ref_key:"popupRef",ref:p,tabindex:"0",class:le(w.$style["button-dropdown-list"]),style:{borderRadius:"var(--radius-lg)",overflow:"hidden"}},[(q(!0),de(Pt,null,xn(e.options,(b,y)=>ze((q(),Ke(fl,jt({ref_for:!0,ref:E=>s.value[y]=E,key:b.value},{ref_for:!0},{...b},{"icon-name":b.icon,onClick:Ht(E=>v(b.value||""),["stop","prevent"]),style:{borderLeft:0}}),{label:we(()=>[tt(it(b.label),1)]),_:2},1040,["icon-name","onClick"])),[[L(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"}}]]),ip=_t(nt({__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=X(()=>({content:o.tooltip,contentClass:"extra-padding",appendTo:()=>globalThis.document.body}));return(a,l)=>(q(),de("div",{class:le(a.$style["close-wrapper"])},[e.disableRemove?Ye("",!0):(q(),de("div",{key:0,class:le(a.$style["close-button"])},[ze((q(),Ke(St,{variant:["icon","tertiary"],style:{background:"white"},"aria-label":"remove",onClick:r,size:16,rounded:!0},{default:we(()=>[ye(pt,{src:"CircleXMark",size:"16",color:"var(--primary-color)"})]),_:1})),[[L(n),i.value]])],2)),kt(a.$slots,"default")],2))}}),[["__cssModules",{$style:{"close-wrapper":"_close-wrapper_15u1e_1","close-button":"_close-button_15u1e_5"}}]]),Mse=_t(nt({name:"AssigneeGroupRenderer",__name:"AssigneeGroupRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean},error:{type:Boolean},maxVisible:{default:4}},setup(e){const t=Kt,n=Bs,o=e,{isEditing:s}=ld(o),r=$(o.value),i=$(null),a=$(null),{apiServices:l}=so(!0,o),u=$(!0),c=()=>{u.value=o.value===void 0};Bh(()=>{c()}),Zt(()=>{c()}),Je(()=>o.value,T=>{c()});const d=X(()=>({disabled:o.disabled,readOnly:o.readOnly,error:o.error,inputRef:i,wrapperRef:a,clickable:!(o.readOnly||u.value),active:s})),{argsMain:h,isHover:f}=Ao(d),p=X(()=>{var T;return((T=r.value)==null?void 0:T.slice(0,o.maxVisible))||[]}),g=X(()=>{var T;return Math.max(0,(((T=r.value)==null?void 0:T.length)||0)-o.maxVisible)}),v=X(()=>{var T;return g.value<=0?"":((T=r.value)==null?void 0:T.slice(o.maxVisible).map(F=>F.name).join(", "))||""}),w=X(()=>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=X(()=>({color:f.value?"var(--primary-color)":"var(--grey-300)",display:"flex",alignItems:"center",marginLeft:"4px"}));Je(()=>o.value,T=>{r.value=T},{immediate:!0,deep:!0});const b=async T=>{var V,x,A;await I(T)&&(r.value=(V=r.value)==null?void 0:V.filter(k=>k.id!==T),(A=o.params)==null||A.node.setData({...(x=o.params)==null?void 0:x.node.data,assignees:r.value}))},y=T=>{var V;const F=un.getInstance().getItem("ws.code");return((V=l.value)==null?void 0:V.getUserInformation(F,T))||Promise.resolve(null)},{id:E}=Ng(o),_=T=>{var V,x;const F=(x=(V=o.params)==null?void 0:V.api)==null?void 0:x.getRowNode(String(E.value));F==null||F.setDataValue("assignees",nv(T.assignees))},{removeAssignee:I}=Iv({...o,entityId:o.entityId,updateRowData:_,value:o.value,errorCallback:()=>{}});return(T,F)=>ze((q(),Ke(Lo,jt(L(h),{ref_key:"wrapperRef",ref:a,bordered:!0}),{default:we(()=>{var V;return[Se("div",{class:le(T.$style.assigneeGroupRenderer)},[((V=r.value)==null?void 0:V.length)===0?(q(),Ke(pt,{key:0,src:"UserPlus",source:"remote",color:"#6B6B6B",style:hn(S.value)},null,8,["style"])):Ye("",!0),(q(!0),de(Pt,null,xn(w.value,x=>(q(),Ke(ip,{key:x.id,"disable-remove":o.readOnly||o.disabled,onClear:A=>b(x.id),style:{marginLeft:"0"}},{default:we(()=>[ye(Iu,{user:x.user,"show-profile":!0,apiUpdateFunction:y,class:le(T.$style["ib-assignee-avatar"])},null,8,["user","class"])]),_:2},1032,["disable-remove","onClear"]))),128)),g.value>0?ze((q(),de("div",{key:1,class:le(T.$style["extra-avatars"])},[tt(" +"+it(g.value),1)],2)),[[L(t),v.value]]):Ye("",!0)],2)]}),_:1},16)),[[L(n),{isLoading:u.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"}}]]),Nse=_t(nt({name:"DateRangeRenderer",__name:"DateRangeRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!1},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{}},setup(e){var _,I;const t=Kt,n=Bs,o=lE(),s=e,r=$(null),i=$(null),{isEditing:a}=ld(s),l=T=>{if(T){if(typeof T=="string")return T;if(T instanceof Date)return T.toISOString()}},u=X(()=>s.value===void 0),c=X(()=>{var T;return(T=s.data)==null?void 0:T.isStarted}),d=X(()=>{var T;return(T=s.data)==null?void 0:T.isCompleted}),h=X(()=>!!(s.value&&(s.value[0]||s.value[1]))),f=X(()=>h.value?s.disabled&&!s.readOnly?"var(--disabled-color)":"var(--primary-color)":"var(--grey-300)"),p=X(()=>({disabled:s.disabled,error:!1,readOnly:s.readOnly,inputRef:r,wrapperRef:i,clickable:!0,active:a})),{argsMain:g}=Ao(p),{startDate:v,endDate:w,startClasses:S,endClasses:b,fullStartDate:y,fullEndDate:E}=SJ({start:l((_=s.value)==null?void 0:_[0]),end:l((I=s.value)==null?void 0:I[1]),isStarted:c.value,isEnded:d.value,timezone:s.timezone||o});return(T,F)=>ze((q(),Ke(Lo,jt(L(g),{ref_key:"wrapperRef",ref:i,bordered:!0}),{default:we(()=>[u.value?Ye("",!0):(q(),de("div",{key:0,class:le(T.$style.dateRangeRenderer)},[h.value?Ye("",!0):(q(),Ke(pt,{key:0,src:"Calendar",class:le(T.$style.calendarIcon),color:f.value},null,8,["class","color"])),h.value?(q(),de(Pt,{key:1},[ze((q(),de("span",{class:le([T.$style.dateLabelDisplay,...L(S).map(V=>T.$style[V])])},[tt(it(L(v)),1)],2)),[[L(t),L(y)]]),F[0]||(F[0]=Se("span",null,"→",-1)),ze((q(),de("span",{class:le([T.$style.dateLabelDisplay,...L(b).map(V=>T.$style[V])])},[tt(it(L(w)),1)],2)),[[L(t),L(E)]])],64)):Ye("",!0)],2))]),_:1},16)),[[L(n),{isLoading:u.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"}}]]),Lse=nt({__name:"DateRangeEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{default:void 0},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{default:lE()}},emits:["closed"],setup(e,{expose:t,emit:n}){const o=$(null);Zt(()=>{ht(()=>{o.value&&o.value.focus()})});const s=e,r=n,i=()=>{var S;(S=s.params)==null||S.api.stopEditing(),r("closed")},a=S=>`${lt.fromJSDate(S,{zone:"utc"}).toFormat("yyyy-MM-dd'T'HH:mm:ss.SSS")}999Z`,l=async S=>{await w({startDate:S[0]?a(S[0]):null,dueDate:S[1]?a(S[1]):null})},u=async()=>{await w({startDate:null})},c=async()=>{await w({dueDate:null})},d=async S=>{await w({startDate:S?a(S):null})},h=async S=>{await w({dueDate:S?a(S):null})},f=async()=>{await w({startDate:null,dueDate:null})},p=Dn("bulkUpdate",!1),{apiServices:g}=so(!p,s),v=X(()=>{var S,b,y,E,_,I,T,F,V;return{parentName:((y=(b=(S=s.params)==null?void 0:S.node.data)==null?void 0:b.parentConfig)==null?void 0:y.parentName)||null,parentStartDate:((I=(_=(E=s.params)==null?void 0:E.node.data)==null?void 0:_.parentConfig)==null?void 0:I.parentStartDate)||null,parentDueDate:((V=(F=(T=s.params)==null?void 0:T.node.data)==null?void 0:F.parentConfig)==null?void 0:V.parentDueDate)||null}}),w=async S=>{var b,y,E,_,I;try{const T=(b=o.value)==null?void 0:b.getValues(),F=await((E=(y=g.value)==null?void 0:y.changeDate)==null?void 0:E.call(y,{workspaceId:s.workspaceId,itemIds:[s.id],startDate:S.startDate,dueDate:S.dueDate}));console.log("Update response:",F),(F==null?void 0:F.status)==Er.OK&&((I=s.params)==null||I.node.setData({...(_=s.params)==null?void 0:_.node.data,dateRange:T==null?void 0:T.dateRange}))}catch(T){console.error("Failed to update scene name:",T)}};return t({focus:()=>{ht(()=>{var S;(S=o.value)==null||S.focus()})}}),(S,b)=>(q(),Ke(Nv,jt({...s,parentConfig:v.value},{onUpdate:l,"onUpdate:end":h,"onUpdate:start":d,onClearAll:f,onClearDue:c,onClearStart:u,onClosed:i,ref_key:"calendarRef",ref:o}),null,16))}}),Vse=_t(nt({__name:"item-table-layout",props:{isSidebarOpen:{type:Boolean,default:!1}},emits:["close-sidebar","sidebar-clear","sidebar-apply"],setup(e,{emit:t}){const n=$(null),o=$(0);let s=null;Zt(()=>{n.value&&(s=new ResizeObserver(i=>{for(const a of i)o.value=a.contentRect.height}),s.observe(n.value))}),nu(()=>{s&&n.value&&s.unobserve(n.value)});const r=X(()=>{const i=o.value;return i>120?i-42-36:0});return(i,a)=>(q(),de("div",{class:le(i.$style["item-table-wrapper"]),ref_key:"itemTableWrapperRef",ref:n},[Se("div",{class:le(i.$style["item-header"])},[Se("div",{class:le(i.$style["item-header__left"])},[kt(i.$slots,"header-left",{},()=>[Se("h1",{class:le(i.$style["item-header__title"])},[kt(i.$slots,"title",{},()=>[a[0]||(a[0]=tt("Items",-1))])],2)])],2),Se("div",{class:le(i.$style["item-header__spacer"])},null,2),Se("div",{class:le(i.$style["item-header__actions"])},[kt(i.$slots,"header-actions")],2)],2),kt(i.$slots,"grid",{availableHeight:r.value}),Se("div",{class:le(i.$style.footer)},[kt(i.$slots,"footer")],2),kt(i.$slots,"new-row"),kt(i.$slots,"bulk-update-actions"),kt(i.$slots,"snackbar"),kt(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"}}]]),UN=_t(nt({name:"MoreOptionEditor",__name:"MoreOptionEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean},optionBlock:{},isSubmenu:{type:Boolean,default:!1},layer:{default:0},focusableIndex:{}},emits:["actionExecuted"],setup(e,{expose:t,emit:n}){const o=xo,s=e,r=X(()=>(s==null?void 0:s.workspaceId)||""),i=X(()=>(s==null?void 0:s.entityId)||""),a=()=>{var M,N,B;return(B=(M=s.params)==null?void 0:M.api)==null?void 0:B.getCellRendererInstances({columns:["options"],rowNodes:(N=s.params)!=null&&N.node?[s.params.node]:[]})[0]},l=()=>{var N,B,z,oe;const M=a();(B=(N=M==null?void 0:M.componsenExposed)==null?void 0:N.blur)==null||B.call(N),(oe=(z=M==null?void 0:M.container)==null?void 0:z.parentElement)==null||oe.classList.remove("ag-cell-focus")},u=()=>{var B,z,oe;(z=(B=s.params)==null?void 0:B.api)==null||z.stopEditing(),l();const M=`scene-name-${s.id}`,N=document.getElementById(M);(oe=N==null?void 0:N.__sceneNameEditor)==null||oe.startEdit()},{apiServices:c}=so(!0,s),d=X(()=>{var M;return{ws_code:r.value,entity_id:i.value,scene_id:s.id,axiosService:c,optionBlock:s.optionBlock,permissions:(M=s.data)==null?void 0:M.permissions}}),h=M=>{var B,z,oe,ie,te,se;let N=(z=(B=s.params)==null?void 0:B.api)==null?void 0:z.getRowNode(String(s.id));if(N){const Z={...N.data,isDeleted:M==="deleted",isArchived:M==="archived"?!0:N.data.isArchived,isLocked:M==="locked"?!0:N.data.isLocked,disabled:!1};M=="deleted"&&(Z.isLocked=!1,Z.disabled=!0),M=="unarchived"&&(Z.isArchived=!1),(ie=(oe=s.params)==null?void 0:oe.api)==null||ie.redrawRows({rowNodes:[N]}),N.setData(Z),(se=(te=s.params)==null?void 0:te.api)==null||se.redrawRows({rowNodes:[N]})}},f=fd(),{openSceneHub:p}=f,g=()=>{ht(()=>{var B,z,oe,ie,te,se;const M=((z=(B=s.params)==null?void 0:B.node)==null?void 0:z.rowIndex)||0,N=((ie=(oe=s.params)==null?void 0:oe.column)==null?void 0:ie.getColId())||"";(se=(te=s.params)==null?void 0:te.api)==null||se.setFocusedCell(M,N)})};X(()=>{var N,B;const M=(B=(N=s.params)==null?void 0:N.api)==null?void 0:B.getRowNode(String(s.id));return M==null?void 0:M.data});const{options:v}=PJ(d,h,u,p,g),w=n,S=()=>{var M,N,B,z,oe,ie;console.trace("Focusing current cell for row:",s.id),(ie=(M=s.params)==null?void 0:M.api)==null||ie.setFocusedCell(((B=(N=s.params)==null?void 0:N.node)==null?void 0:B.rowIndex)||0,((oe=(z=s.params)==null?void 0:z.column)==null?void 0:oe.getColId())||"")},b=X(()=>{var M;return(M=s.params)==null?void 0:M.api}),y=(M,N)=>{var B,z,oe,ie,te,se,Z,P;if(w("actionExecuted",M),M.id=="copy-link"){(te=b.value)==null||te.startEditingCell({rowIndex:(z=(B=s.params)==null?void 0:B.node)==null?void 0:z.rowIndex,colKey:(ie=(oe=s.params)==null?void 0:oe.column)==null?void 0:ie.getColId()});return}else{if(M.id!=="copy-link"&&((se=b.value)==null||se.stopEditing()),M.id==="rename")(Z=b.value)==null||Z.stopEditing(),(P=b.value)==null||P.clearFocusedCell(),l();else if(M.id==="copy-link"){const j=document.getElementById(N);setTimeout(()=>{var ne,ge,xe;(xe=(ge=(ne=j==null?void 0:j.__vueParentComponent)==null?void 0:ne.exposed)==null?void 0:ge.focus)==null||xe.call(ge)},300)}else if(["delete-rendition","delete-thumbnail"].includes(M.id)){setTimeout(()=>{S()},300);return}setTimeout(()=>{var j,ne;(ne=(j=s.params)==null?void 0:j.api)==null||ne.clearFocusedCell()},300)}},E=()=>{var M,N;(N=(M=s.params)==null?void 0:M.api)==null||N.stopEditing()},_=M=>{var N,B,z,oe;return M==="archive"?!((B=(N=s.params)==null?void 0:N.data)!=null&&B.isArchived):M==="unarchive"?(oe=(z=s.params)==null?void 0:z.data)==null?void 0:oe.isArchived:!0},I=X(()=>v.value.map(M=>({...M,options:M.options.filter(N=>!N.hide&&_(N.id))})).filter(M=>M.options.length>0)),T=$({}),F=$(null),V=X(()=>{var N,B;if(s.focusableIndex)return s.focusableIndex;const M=(B=(N=s.params)==null?void 0:N.api)==null?void 0:B.getRowNode(String(s.id));return`${((M==null?void 0:M.rowIndex)??0)+10}`}),x=(M,N)=>`${V.value}.${M*10+N}`,A=(M,N)=>{if(N&&"focus"in N){T.value[M]=N;return}delete T.value[M]},k=M=>{M.preventDefault(),M.stopPropagation(),M.stopImmediatePropagation()};return Zt(()=>{var M;(M=F.value)==null||M.focus()}),t({focus(){var B;const M=`${V.value}.0`,N=T.value[M];N&&N.focus?N.focus():(B=F.value)==null||B.focus()}}),(M,N)=>ze((q(),de("div",{onKeydown:k,class:le([M.$style["more-option-section"],{[M.$style.submenu]:e.isSubmenu}]),ref_key:"wrapperRef",ref:F,tabindex:"0",role:"menu"},[(q(!0),de(Pt,null,xn(I.value,(B,z)=>(q(),de("div",{key:B.id,style:hn({"--g-number":Math.min(B.options.length,4),"--g-size":B.type==="column"?"36px":"auto"}),class:le([M.$style["option-block"],M.$style[B.type]])},[(q(!0),de(Pt,null,xn(B.options,(oe,ie)=>(q(),de("div",{key:oe.id,class:le(M.$style["option-item"])},[ye($se,{layer:s.layer,"scene-id":String(s.id),option:oe,type:B.type,onActionExecuted:te=>y(te,`more-action-${te.id}-${s.id}`),focusableIndex:x(z,ie),ref_for:!0,ref:te=>A(x(z,ie),te),onHandleHide:E,id:`more-action-${oe.id}-${s.id}`,label:oe.label},null,8,["layer","scene-id","option","type","onActionExecuted","focusableIndex","id","label"])],2))),128))],6))),128))],34)),[[L(o),V.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"}}]]),Bse={key:0,style:{height:"20px",width:"20px",display:"flex","align-items":"center","justify-content":"center"}},$se=_t(nt({__name:"MoreOptionItem",props:{option:{},sceneId:{},type:{},layer:{},focusableIndex:{}},emits:["actionExecuted","handleHide"],setup(e,{expose:t,emit:n}){const o=xo,s=Kt,r=e,i=$(!1),a=$(!1),l=(T,F)=>{if(!F){p();return}const V=F.target;V.closest(".tippy-content")||V.closest(".tippy-box")||V.closest("[data-tippy-root]")||V.closest(".option-item")||p()},u=$(null),{triggerRef:c,popupRef:d,show:h,isVisible:f,hide:p}=yo({toggleOnClick:!0,interactive:!0,trigger:"click",placement:"left",showArrow:!1,offset:[0,4],hideOnClick:!1,allowHTML:!0,onClickOutside:l,appendTo:u.value||void 0}),g=n,v=async T=>{var F,V;if(!a.value){a.value=!0;try{await((V=(F=r.option).action)==null?void 0:V.call(F,T)),g("actionExecuted",r.option)}catch(x){console.error("Action execution failed:",x)}finally{a.value=!1,i.value=!1}}},w=async T=>{var F,V;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((V=(F=r.option).action)==null?void 0:V.call(F,T)),g("actionExecuted",r.option)}catch(x){console.error("Action execution failed:",x)}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",E=T=>{const F=r.option.isDanger?["danger","tertiary"]:[];return{row:["secondary","icon",...F],column:["menu-item",...F],block:["secondary",...F]}[T]||[]},_=()=>{i.value?i.value=!1:f.value?p():g("handleHide")};t({focus:()=>{ht(()=>{c.value instanceof HTMLElement?c.value.focus():c.value&&"$el"in c.value?c.value.$el.focus():console.warn("Trigger ref is not an HTMLElement:",c.value)})},escape:()=>{p()},select:()=>{w(new MouseEvent("click"))}});const I=T=>{var F;T.stopPropagation(),T.preventDefault(),i.value=!1,(F=c.value)==null||F.focus()};return(T,F)=>{var V;return ze((q(),de("div",{ref_key:"wrapperRef",ref:u,class:le(T.$style["option-item-wrapper"]),style:{width:"100%",overflow:"visible"},onClick:Ht(w,["stop","prevent"])},[ze((q(),Ke(St,{ref_key:"triggerRef",ref:c,class:le(T.$style["option-item"]),disabled:e.option.disabled||a.value,actived:L(f)||i.value,size:y(e.type),variant:E(e.type),onClick:Ht(w,["stop","prevent"]),onKeydown:b,onEscape:_,label:e.option.label},{prefix:we(()=>[e.option.icon?(q(),de("div",Bse,[ye(pt,{size:"14",src:e.option.icon,color:e.option.isDanger?void 0:"#a6a6a6",source:"remote"},null,8,["src","color"])])):Ye("",!0)]),suffix:we(()=>[e.option.subMenu?(q(),Ke(pt,{key:0,src:"Play",source:"remote"})):Ye("",!0),e.option.isDanger&&i.value?(q(),de("div",{key:1,class:le(T.$style["confirm-action"])},[ze((q(),Ke(St,{variant:["tertiary","icon","danger"],size:"small",onHandleClick:I},{default:we(()=>[ye(pt,{src:"XMarkSolid",source:"remote"})]),_:1})),[[L(o),`${r.focusableIndex}.0`],[L(s),{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),ze((q(),Ke(St,{variant:["danger","primary","icon"],size:"small",onClick:Ht(v,["stop","prevent"]),onEscape:F[0]||(F[0]=x=>i.value=!1)},{default:we(()=>[ye(pt,{src:"Check",source:"remote"})]),_:1})),[[L(o),`${r.focusableIndex}.1`],[L(s),{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Ye("",!0)]),_:1},8,["class","disabled","actived","size","variant","label"])),[[L(o),r.focusableIndex]]),e.option.subMenu?(q(),de("div",{key:0,ref_key:"popupRef",ref:d,class:le(T.$style["submenu-container"])},[ye(UN,{focusableIndex:r.focusableIndex,layer:r.layer+1,ref:"submenuRef","option-block":[((V=e.option)==null?void 0:V.subMenu)||[]],"is-submenu":!1,onActionExecuted:S},null,8,["focusableIndex","layer","option-block"])],2)):Ye("",!0)],2)),[[L(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"}}]]),WN=(e,t)=>{const n=$(Number(e.value.value)),o=X(()=>e.value.metricConfig),s=X(()=>{var g,v;const l=o.value,u=t.value,c=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"||c&&((g=l==null?void 0:l.metric_type)==null?void 0:g.code)==="formula",isEmpty:c,isError:d,hasPrefix:!c&&!d&&(l==null?void 0:l.morpheme_type)==="prefix",hasSuffix:!c&&!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:u&&!c&&!f}}),r=17,i=X(()=>{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 u;return(((u=o.value)==null?void 0:u.format_symbol)||"BoltSolid").split(/[\s-_]+/).map(c=>c.charAt(0).toUpperCase()+c.slice(1)).join("").replace(/Outline|Solid/g,"")},internalValue:n}},Hse=["aria-label"],zN=_t(nt({name:"MetricRenderer",__name:"MetricRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean},error:{type:Boolean},config:{}},emits:["update:value","clear","copy"],setup(e,{emit:t}){const n=Bs,o=Kt,s=e,r=xh(!1),i=$(null),a=$(null),{isEditing:l}=ld(s),u=X(()=>{var N,B;return{value:s.value,metricConfig:((B=(N=s.params)==null?void 0:N.colDef)==null?void 0:B.context)||s.config,error:s.error,hovered:r.value,readOnly:s.readOnly,disabled:s.disabled,active:l}}),{componentState:c,metricConfig:d,internalValue:h}=WN(u,r),f=X(()=>{var B,z;let N=!1;if(["number","formula"].includes(d.value.metric_type.code)){const oe=Number(s.value),ie=Number((B=d.value)==null?void 0:B.format_value);Number.isFinite(ie)&&ie>=0&&(N=(((z=oe.toString().split(".")[1])==null?void 0:z.length)||0)>ie)}return N}),p=X(()=>{var N;return!!((N=d.value)!=null&&N.morpheme_value)||c.value.isEmpty||f.value}),g=X(()=>{var z,oe,ie;if(c.value.isError)return"Something went wrong. Review formula, inputs and retry.";if(c.value.pendingCalculation)return"Can’t calculate yet. Complete required fields.";if(c.value.isEmpty)return;const N=F.value,B=(z=d.value)==null?void 0:z.morpheme_type;return B==="prefix"?`${((oe=d.value)==null?void 0:oe.morpheme_value)||""} ${N}`.trim():B==="suffix"?`${N} ${((ie=d.value)==null?void 0:ie.morpheme_value)||""}`.trim():N}),v=X(()=>{const{format_type:N,format_value:B}=d.value;if(N==="dropdown"&&typeof B=="string"&&B.startsWith("["))try{return JSON.parse(B)}catch{return[]}return[]}),w=X(()=>({disabled:s.disabled,error:c.value.isError,inputRef:i,wrapperRef:a,clickable:!T.value,readOnly:s.readOnly||T.value,isEmpty:c.value.isEmpty})),{argsMain:S,isHover:b}=Ao(w),y=(N,B,z="en-US")=>new Intl.NumberFormat(z,{minimumFractionDigits:B,maximumFractionDigits:B}).format(N),E=X(()=>{if(c.value.isEmpty)return"";if(c.value.pendingCalculation)return"pending";const N=s.value,{format_type:B,format_value:z,mapping:oe}=d.value;if(oe&&typeof oe=="object"&&!Array.isArray(oe)){const ie=oe[`!${N}`];if(ie)return ie}if(B==="dropdown"){const ie=v.value.find(te=>String(te.name)===String(N));if(ie)return ie.name}if(typeof N=="string"){const ie=Number(N);return Number.isNaN(ie)?N:N.replace(/[.-]/g,"").length>16?_(N,z):_(ie,z)}return typeof N=="number"?_(N,z):String(N)}),_=(N,B)=>{const z=Number.parseInt(String(B)||"2",10),oe=Number.isFinite(z)&&z>=0?z:2;try{if(typeof N=="string"){const ie=N.split("."),te=ie[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),se=ie[1]?ie[1].substring(0,oe).padEnd(oe,"0"):"0".repeat(oe);return oe>0?`${te}.${se}`:te}return y(N,oe)}catch(ie){return console.error("Error formatting metric value:",ie,{num:N,decimals:oe}),String(N)}},I=(N,B)=>{const z=Number.parseInt(String(B)||"2",10),oe=Number.isFinite(z)&&z>=0?z:2;try{if(typeof N=="string"){const ie=N.split("."),te=ie[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),se=ie[1]?ie[1].length:0,Z=Math.max(oe,se),P=ie[1]?ie[1].padEnd(Z,"0"):"0".repeat(Z);return Z>0?`${te}.${P}`:te}return new Intl.NumberFormat("en-US",{minimumFractionDigits:oe,maximumFractionDigits:20}).format(N)}catch(ie){return console.error("Error formatting exact metric value:",ie,{num:N,decimals:oe}),String(N)}},T=X(()=>{var N;return((N=d.value)==null?void 0:N.metric_type.code)==="formula"}),F=X(()=>{if(c.value.isEmpty)return"";if(c.value.pendingCalculation)return"pending";const N=s.value,{format_type:B,format_value:z,mapping:oe}=d.value;if(oe&&typeof oe=="object"&&!Array.isArray(oe)){const ie=oe[`!${N}`];if(ie)return ie}if(B==="dropdown"){const ie=v.value.find(te=>String(te.name)===String(N));if(ie)return ie.name}if(typeof N=="string"){const ie=Number(N);return Number.isNaN(ie)?N:N.replace(/[.-]/g,"").length>16?I(N,z):I(ie,z)}return typeof N=="number"?I(N,z):String(N)}),{tooltip:V}=IO(""),x=async N=>{N.stopPropagation(),N.preventDefault(),N.stopImmediatePropagation();try{await navigator.clipboard.writeText(F.value),V.value="Copied",setTimeout(()=>{V.value="Copy"},3e3)}catch(B){console.error("Failed to copy text:",B),V.value="Copy failed",setTimeout(()=>{V.value="Copy"},3e3)}};Je(()=>s.value,(N,B)=>{const z=Number(N);Number.isFinite(z)&&z!==h.value?h.value=z:N==null&&h.value!==0&&(h.value=0)},{immediate:!0,deep:!0});const k=()=>{r.value=!0},M=()=>{r.value=!1};return(N,B)=>ze((q(),Ke(Lo,jt(L(S),{onMouseenter:k,style:{"--icon-size":"24px"},onMouseleave:M,ref_key:"wrapperRef",ref:a,actived:L(l),bordered:!0}),{suffix:we(()=>[s.disabled?Ye("",!0):(q(),de("div",{key:0,class:le([N.$style.suffix,"wrapper-suffix"])},[r.value&&!L(c).isEmpty&&!L(c).isError?ze((q(),Ke(St,{key:0,variant:["icon","secondary"],size:24,onClick:Ht(x,["prevent","stop"])},{default:we(()=>[ye(pt,{src:"Copy",source:"remote",size:12})]),_:1})),[[L(o),{content:L(V),hideOnClick:!1,contentClass:"extra-padding"}]]):Ye("",!0)],2))]),default:we(()=>[Se("div",{class:le(N.$style["metric-wrapper"]),"aria-label":L(d).format_value||void 0},[Se("div",{class:le([N.$style["metric-content"],s.disabled?N.$style.disabled:""])},[!L(c).isError&&L(c).isEmpty?(q(),de(Pt,{key:0},[L(c).pendingCalculation?ze((q(),de("span",{key:0,class:le(N.$style["metric-empty"])},[...B[0]||(B[0]=[tt(" - ",-1)])],2)),[[L(o),"Can’t calculate yet. Complete required fields."]]):L(c).isEmpty?(q(),de("span",{key:1,class:le(N.$style["metric-empty"])}," - ",2)):Ye("",!0)],64)):Ye("",!0),L(c).isError?ze((q(),de("div",{key:1,class:le(N.$style["metric-error"])},[...B[1]||(B[1]=[tt(" Error ",-1)])],2)),[[L(o),"Something went wrong. Review formula, inputs and retry."]]):Ye("",!0),!L(c).isEmpty&&!L(c).isError?ze((q(),de("span",{key:2,class:le([N.$style["metric-value"],L(b)?N.$style.hovered:"",{[N.$style.disabled]:s.disabled}])},[tt(it(E.value),1)],2)),[[L(o),{content:g.value,bypassOverflowCheck:p.value}]]):Ye("",!0)],2)],10,Hse)]),_:1},16,["actived"])),[[L(n),{isLoading:L(c).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"}}]]),Gse={key:0,style:{color:"#6b6b6b"}},Use=_t(nt({__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,u={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"},c=X(()=>{var M,N;if(l.headerType)return l.headerType;if(((N=(M=l.params)==null?void 0:M.column)==null?void 0:N.getColId()).includes("metric"))return"default";const k=l.headerType??l.params.column.getColId();return u[k]||"default"}),d=$(),h=()=>{var k,M,N;const A=(M=(k=l.params)==null?void 0:k.column)==null?void 0:M.getColDef();if((N=A.colId)!=null&&N.includes("metric")){if(A.context.is_primary==1)return"primary";if(A.context.is_point_metric==1)return"secondary"}};$h(()=>{d.value=h()}),Zt(()=>{d.value=h()});const f=X(()=>{var A,k;return((k=(A=l.params)==null?void 0:A.column.getColDef().context)==null?void 0:k.morpheme_value)||void 0}),p=X(()=>{var A;return(A=l.params)==null?void 0:A.displayName}),g=X(()=>{let A=[];switch(c.value){case"dateRange":A=Object.values(s).map(k=>({...k,selected:w.value===k.value,type:"text",hover:T.value===k.value}));break;case"date":A=Object.values(r).map(k=>({...k,selected:w.value===k.value,type:"text",hover:T.value===k.value}));break;case"number":A=Object.values(i).map(k=>({...k,selected:w.value===k.value,type:"text",hover:T.value===k.value}));break;default:A=Object.values(a).map(k=>({...k,selected:w.value===k.value,type:"text",hover:T.value===k.value}));break}return w.value!=="none"&&A.push({id:"clear",label:"Clear",value:"none",selected:!1,type:"text",icon:"XMark",hover:T.value=="none"}),A}),v=X(()=>String(w.value).endsWith("asc")?"SortUp":String(w.value).endsWith("desc")?"SortDown":"Sort"),w=$(l.modelValue??"none"),S=A=>{if(x.value){x.value=!1;return}_("update:modelValue",A),_("sort-changed",A)},b=A=>{w.value=A},y=wr(()=>{if(c.value==="date"||c.value==="default"||c.value==="number"){let A;w.value==="none"?A="asc":w.value==="asc"?A="desc":A="none",w.value=A}else{const A=[s.START_ASC.value,s.START_DESC.value,s.DUE_ASC.value,s.DUE_DESC.value,"none"],M=(A.indexOf(w.value)+1)%A.length;w.value=A[M]}},Si),E=X(()=>{if(w.value==="none")return"No sorting applied";const A=g.value.find(k=>k.value===w.value);return(A==null?void 0:A.label)||""}),_=n,I=X(()=>{if(l.disabled&&!l.readOnly)return"var(--disabled-color)";if(w.value!=="none")return"var(--primary-color-hover)"});Je(()=>l.modelValue,A=>{A!=w.value&&(w.value=A)}),Je(w,A=>{A!==l.modelValue&&S(A)});const T=$(w.value);Je(()=>w.value,A=>{T.value=A});const F=A=>{var B,z;if(l.readOnly||l.disabled)return;let k=0;A.key==="ArrowDown"?k=1:A.key==="ArrowUp"&&(k=-1);const M=g.value.findIndex(oe=>oe.value===T.value),N=g.value.length;if(A.key==="Enter"||A.key===" ")A.preventDefault(),w.value=T.value,(B=V.value)==null||B.hide();else if(k!==0){A.preventDefault();let oe=(M+k+N)%N;T.value=g.value[oe].value}else A.key==="Escape"&&((z=V.value)==null||z.hide())},V=$(null);Zt(()=>{var A,k;(k=(A=V.value)==null?void 0:A.$el)==null||k.addEventListener("keydown",F)}),nu(()=>{var A,k;(k=(A=V.value)==null?void 0:A.$el)==null||k.removeEventListener("keydown",F)});const x=$(!1);return t({setDefaultSort:A=>{w.value=A?A.direction:"none",x.value=!0},clear:()=>{w.value="none"}}),(A,k)=>(q(),Ke(u0,{ref_key:"dropdownRef",ref:V,options:g.value,label:p.value,readOnly:l.readOnly,onOpen:k[0]||(k[0]=M=>A.$emit("open")),disabled:l.disabled,variant:["icon","tertiary"],size:"small",onHandleClick:L(y),onSelect:k[1]||(k[1]=M=>b(M))},{prefix:we(()=>[ye(St,{variant:["text"],onClick:L(y),size:"small"},{default:we(()=>[ze((q(),de("b",null,[tt(it(p.value),1)])),[[L(o),{content:p.value}]]),f.value?(q(),de("small",Gse," ("+it(f.value)+") ",1)):Ye("",!0),d.value=="primary"?ze((q(),de("div",{key:1,class:le(A.$style["icon-metric"])},[ye(pt,{src:"ChartPie",color:"#A6A6A6",size:"14"})],2)),[[L(o),"Woohoo metric"]]):Ye("",!0),d.value=="secondary"?ze((q(),de("div",{key:2,class:le(A.$style["icon-metric"])},[ye(pt,{src:"Bullseye",color:"#A6A6A6",size:"14"})],2)),[[L(o),"Point Metric"]]):Ye("",!0)]),_:1},8,["onClick"])]),iconDropdown:we(()=>[ze(ye(pt,{src:v.value,source:"remote",color:I.value},null,8,["src","color"]),[[L(o),E.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"}}]]),Wse=["disabled","readonly","checked","indeterminate"],jN=_t(nt({__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=xo,s=e,r=t,i=X(()=>{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=X(()=>s.allowIndeterminate?[Ot.UNCHECK,Ot.INDETERMINATE,Ot.CHECKED]:[Ot.UNCHECK,Ot.CHECKED]),l=X(()=>{if(typeof s.tooltipText=="string"||!s.tooltipText)return s.tooltipText||"";switch(c.value){case Ot.UNCHECK:return s.tooltipText.unchecked;case Ot.INDETERMINATE:return s.tooltipText.indeterminate;case Ot.CHECKED:return s.tooltipText.checked;default:return""}}),u=()=>{if(h.value)return;const p=(a.value.indexOf(c.value)+1)%a.value.length;c.value=a.value[p]},c=$(typeof s.modelValue=="boolean"?s.modelValue?Ot.CHECKED:Ot.UNCHECK:s.modelValue),d=X(()=>({checked:c.value===Ot.CHECKED,indeterminate:c.value===Ot.INDETERMINATE,none:c.value===Ot.UNCHECK})),h=X(()=>s.disabled||s.readOnly);return Je(()=>c.value,f=>{r("update:modelValue",f===Ot.CHECKED)}),(f,p)=>ze((q(),de("input",{disabled:s.disabled,key:c.value,readonly:s.readOnly,type:"checkbox",class:le([f.$style["input-checkbox"]]),checked:d.value.checked,indeterminate:d.value.indeterminate,onChange:u,"aria-label":"Select All Items",style:hn({"--input-size":i.value})},null,46,Wse)),[[L(n),{content:l.value,hideOnClick:!1,contentClass:"extra-padding"}],[L(o),s.focusIndex]])}}),[["__cssModules",{$style:{small:"_small_1kz1e_84",large:"_large_1kz1e_87",medium:"_medium_1kz1e_90"}}]]),zse=_t(nt({name:"HeaderCheckbox",__name:"HeaderCheckbox",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean}},setup(e){const t=e,n=Kt,o=Gf(),{setSelectionStatus:s}=o,{rowCount:r,selectionStatus:i}=mo(o),a=$(new Set);Je(i,y=>{s(y)},{immediate:!0});const l=X(()=>i.value!==Ot.UNCHECK),u=X(()=>({checked:i.value===Ot.CHECKED,indeterminate:i.value===Ot.INDETERMINATE,UNCHECK:i.value===Ot.UNCHECK})),c=X(()=>({[Ot.UNCHECK]:"Click to select all",[Ot.INDETERMINATE]:"Click to clear selection",[Ot.CHECKED]:"Click to clear selection"})[i.value]||"Select items"),d=X(()=>{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:E})=>{if(y)if(E===Ot.UNCHECK)y.deselectAll(),a.value.clear(),i.value=E;else if(E===Ot.CHECKED){const _=new Set;y.forEachNode(I=>{I.isSelected()&&_.add(I.id||"")}),a.value=_,y.forEachNode(I=>I.setSelected(!0)),i.value=E}else y.forEachNode(_=>_.setSelected(!0)),i.value=E},p=()=>{var _;const y=(_=t.params)==null?void 0:_.api;if(!y){console.error("[HeaderCheckbox] There is no API available");return}const E={[Ot.UNCHECK]:Ot.INDETERMINATE,[Ot.INDETERMINATE]:Ot.UNCHECK,[Ot.CHECKED]:Ot.UNCHECK};f({api:y,state:E[i.value]})},g=y=>{var I;const E=(I=t.params)==null?void 0:I.api;if(!E){console.error("no api");return}const _={INDETERMINATE:Ot.INDETERMINATE,GLOBAL:Ot.CHECKED,UNCHECK:Ot.UNCHECK};f({api:E,state:_[y]})},v=wr(y=>{const{selected:E,total:_}=h(y);if(_==0){i.value=Ot.UNCHECK;return}E===_?i.value=Ot.CHECKED:E===0?i.value=Ot.UNCHECK:i.value=Ot.INDETERMINATE},300);let w=[];const S=y=>{v(y)};Zt(()=>{var T;const y=(T=t.params)==null?void 0:T.api;if(!y)return;const E=F=>v(F.api),_=()=>S(y),I=()=>S(y);y.addEventListener("selectionChanged",E),y.addEventListener("rowDataUpdated",_),y.addEventListener("modelUpdated",_),w=[()=>y.removeEventListener("selectionChanged",E),()=>y.removeEventListener("rowDataUpdated",_),()=>y.removeEventListener("modelUpdated",I)]}),Vn(()=>{w.forEach(y=>y())});const b=`header-checkbox-${Math.random().toString(36).substr(2,9)}`;return(y,E)=>(q(),Ke(u0,{tabIndex:"9",options:d.value,size:24,disabled:t.disabled,readOnly:t.readOnly,variant:["icon","tertiary"],placement:"bottom-start",onSelect:g},{prefix:we(()=>[ze((q(),Ke(jN,{"tab-index":"8",id:b,disabled:t.disabled,key:L(i),readonly:t.readOnly,type:"checkbox",checked:u.value.checked,indeterminate:u.value.indeterminate,modelValue:L(i),"onUpdate:modelValue":E[0]||(E[0]=_=>mn(i)?i.value=_:null),onChange:p,"aria-label":L(i)===L(Ot).CHECKED?"All items selected":"Select visible items",class:le(y.$style["ag-checkbox-input"])},null,8,["disabled","readonly","checked","indeterminate","modelValue","aria-label","class"])),[[L(n),{content:c.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"}}]]),jse={style:{color:"#a6a6a6"}},KN=_t(nt({name:"StatusRenderer",__name:"StatusRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean},focusIndex:{},placeholder:{default:"No status"}},setup(e,{expose:t}){const n=Bs,o=Kt,s=e,{isEditing:r}=ld(s),i=$(null),a=$(null),l=X(()=>s.value),u=X(()=>l.value===void 0),c=X(()=>{var v,w;return((v=l.value)==null?void 0:v.name)||((w=l.value)==null?void 0:w.label)||"No status"}),d=X(()=>{var v;return{disabled:s.disabled,error:!1,readOnly:s.readOnly,isEmpty:uX((v=l.value)==null?void 0:v.label),inputRef:i,wrapperRef:a,clickable:!s.disabled&&!s.readOnly,active:r}}),{argsMain:h,isHover:f}=Ao(d),p=X(()=>{var v;return((v=l.value)==null?void 0:v.color)||"#fff"}),g=X(()=>new Bn(p.value).isLight()?"#000":"#fff");return t({focus:()=>{var v;(v=a.value)==null||v.focus()}}),(v,w)=>{const S=Sc("focusable");return ze((q(),Ke(L(Lo),jt(L(h),{ref_key:"wrapperRef",ref:a,bordered:!0,style:{background:`${p.value} !important`,color:g.value,"--border-color":!L(r)&&!L(f)||!l.value?"#f3f5f8":void 0}}),{default:we(()=>[u.value?Ye("",!0):(q(),de("div",{key:0,class:le({[v.$style["status-renderer"]]:!0,[v.$style["has-status"]]:l.value,[v.$style["has-suffix"]]:!!v.$slots.suffix})},[l.value?(q(),de(Pt,{key:0},[ze((q(),de("div",{class:le(v.$style["status-renderer__status-name"])},[tt(it(c.value),1)],2)),[[L(o),{content:c.value,delay:[1e3,0]}]]),kt(v.$slots,"suffix")],64)):(q(),de(Pt,{key:1},[Se("div",{class:le(v.$style["status-renderer__color-code"])},null,2),Se("span",jse,it(s.placeholder),1),kt(v.$slots,"suffix")],64))],2))]),_:3},16,["style"])),[[S,s.focusIndex],[L(n),{isLoading:u.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"}}]]),qN=_t(nt({__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=X(()=>Number(o.popupIndex)),{popupRef:r,show:i,hide:a,isVisible:l}=IJ({useTrigger:!1,arrow:!1,centered:!0,showOverlay:o.showOverlay,overlayOpacity:o.overlayOpacity,closeOnOverlayClick:o.closeOnOverlayClick,appendTo(d){return document.body},zIndex:s.value}),u=d=>{o.closeOnEscape&&d.key==="Escape"&&l.value&&a()};Zt(()=>{document.addEventListener("keydown",u)}),Vn(()=>{document.removeEventListener("keydown",u)}),t({show:i,hide:a,isVisible:l});const c=n;return Je(()=>l.value,d=>{c(d?"shown":"hidden")}),(d,h)=>{const f=Sc("tooltip");return q(),de("div",{ref_key:"popupRef",ref:r,class:le(d.$style.popupContainer)},[Se("div",{class:le(d.$style.popupWrapper)},[Se("div",{class:le(d.$style.header)},[kt(d.$slots,"header",{},()=>[Se("span",{class:le(d.$style["header-title"])},it(e.popupName),3)]),o.showCloseBtn?ze((q(),Ke(St,{key:0,variant:["icon","text"],onClick:L(a),"aria-label":"Close popup",size:"small"},{default:we(()=>[ye(pt,{src:"Xmark",size:8})]),_:1},8,["onClick"])),[[f,"Close"]]):Ye("",!0)],2),Se("div",{class:le(d.$style.body)},[kt(d.$slots,"default")],2),d.$slots.footer?(q(),de("div",{key:0,class:le(d.$style.footer)},[kt(d.$slots,"footer")],2)):Ye("",!0)],2)],2)}}}),[["__cssModules",{$style:{popupContainer:"_popupContainer_1qqwg_1",popupWrapper:"_popupWrapper_1qqwg_9",popupFadeIn:"_popupFadeIn_1qqwg_1",header:"_header_1qqwg_24","header-title":"_header-title_1qqwg_34",body:"_body_1qqwg_43",footer:"_footer_1qqwg_48"}}]]),Kse=["onMouseenter","onMouseleave"],qse=["innerHTML"],Yse=["innerHTML"],Xse=["data-tooltip"],Zse={key:2,style:{"min-width":"24px","min-height":"24px",position:"absolute",top:"0",right:"0",display:"flex","align-items":"center","justify-content":"center"}},Jse=_t(nt({__name:"Snackbar",setup(e){const t=Kt,n=l5,o=_s(),{removeNotification:s}=o,{notifications:r}=mo(o),i=f=>f.trim().startsWith("<svg"),a=$("Copy"),l=()=>{setTimeout(()=>{a.value="Copy"},3e3)},u=f=>{navigator.clipboard.writeText(f).then(()=>{a.value="Copied",l()},()=>{a.value="Copy failed",l()})},c=$(new Set),d=f=>{var p;c.value.add(f),(p=o.pauseAutoDismiss)==null||p.call(o,f)},h=f=>{var p;c.value.delete(f),(p=o.resumeAutoDismiss)==null||p.call(o,f)};return(f,p)=>(q(),Ke(v3,{name:"list",tag:"div",class:le(["notification-center",f.$style["notification-wrapper"]])},{default:we(()=>[(q(!0),de(Pt,null,xn(L(r),g=>{var v;return ze((q(),de("div",{key:g.id,class:le([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:w=>d(g.id),onMouseleave:w=>h(g.id)},[Se("p",{class:le(f.$style.snackbar__message)},[g.type!="white"?(q(),de("span",{key:0,class:le(f.$style.snackbar__icon)},[!g.icon&&g.type=="success"?(q(),Ke(pt,{key:0,src:"CircleCheck",source:"remote"})):Ye("",!0),!g.icon&&g.type=="interactive"?(q(),Ke(pt,{key:1,src:"CircleCheck",source:"remote"})):!g.icon&&g.type=="error"?(q(),Ke(pt,{key:2,src:"CircleXMark",source:"remote"})):g.icon&&i(g.icon)?(q(),de("i",{key:3,class:le(f.$style["icon-draw"]),innerHTML:g.icon},null,10,qse)):g.icon&&!i(g.icon)?(q(),Ke(pt,{key:4,src:g.icon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Ye("",!0)],2)):Ye("",!0),Se("span",{class:le(f.$style["error-message"])},[Se("span",{class:le(f.$style.message),innerHTML:g.message},null,10,Yse)],2)],2),g.actions?(q(),de("div",{key:0,class:le(f.$style["actions-notification"]),"data-notification":"true"},[(q(!0),de(Pt,null,xn(g.actions,w=>(q(),Ke(St,jt({key:w.label},{ref_for:!0},w,{onClick:Ht(w.action,["prevent","stop"]),variant:"secondary",size:"small"}),{prefix:we(()=>[w.btnIcon?(q(),Ke(pt,{key:0,src:w.btnIcon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Ye("",!0)]),_:2},1040,["onClick"]))),128))],2)):Ye("",!0),g.type!=="interactive"&&g.type!=="white"?ze((q(),de("div",{key:1,"data-tooltip":a.value,style:{"min-width":"24px"}},[ye(St,{variant:"secondary",onClick:w=>u(g.message),class:le(f.$style["copy-btn"])},{prefix:we(()=>[ye(pt,{src:"Copy",source:"remote",color:"var(--primary-color)",size:"11"})]),_:1},8,["onClick","class"])],8,Xse)),[[L(t),a.value]]):Ye("",!0),g.type=="interactive"?ze((q(),de("div",Zse,[ye(St,{variant:"tertiary",onClick:w=>L(s)(g.id),class:le(f.$style["close-btn"]),size:18},{default:we(()=>[ye(pt,{src:"XMarkSolid",size:"9"})]),_:1},8,["onClick","class"])])),[[L(t),"Close"]]):Ye("",!0)],42,Kse)),[[L(n)]])}),128))]),_:1},8,["class"]))}}),[["__cssModules",{$style:{"notification-wrapper":"_notification-wrapper_1gnza_1","notification-item":"_notification-item_1gnza_15","notification--success":"_notification--success_1gnza_30","notification--error":"_notification--error_1gnza_36","close-btn":"_close-btn_1gnza_42","notification--info":"_notification--info_1gnza_45","notification--warning":"_notification--warning_1gnza_52","notification--interactive":"_notification--interactive_1gnza_59","notification--white":"_notification--white_1gnza_67","snackbar-type":"_snackbar-type_1gnza_75",snackbar__message:"_snackbar__message_1gnza_84",message:"_message_1gnza_97","error-message":"_error-message_1gnza_105",snackbar__icon:"_snackbar__icon_1gnza_111","actions-notification":"_actions-notification_1gnza_120","icon-draw":"_icon-draw_1gnza_128","copy-btn":"_copy-btn_1gnza_136"}}]]);/*!
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 vd(e,t,n){return(t=mN(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gN(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 yd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gN(Object(n),!0).forEach(function(o){vd(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gN(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function One(e,t){if(e==null)return{};var n,o,s=Mne(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 Mne(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 Ou(){/*! 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 w=p&&p.prototype instanceof a?p:a,S=Object.create(w.prototype);return zs(S,"_invoke",function(b,y,E){var _,I,T,F=0,V=E||[],x=!1,A={p:0,n:0,v:e,a:k,f:k.bind(e,4),d:function(M,N){return _=M,I=0,T=e,A.n=N,i}};function k(M,N){for(I=M,T=N,t=0;!x&&F&&!B&&t<V.length;t++){var B,z=V[t],oe=A.p,ie=z[2];M>3?(B=ie===N)&&(T=z[(I=z[4])?5:(I=3,3)],z[4]=z[5]=e):z[0]<=oe&&((B=M<2&&oe<z[1])?(I=0,A.v=N,A.n=z[1]):oe<ie&&(B=M<3||z[0]>N||N>ie)&&(z[4]=M,z[5]=N,A.n=ie,I=0))}if(B||M>1)return i;throw x=!0,N}return function(M,N,B){if(F>1)throw TypeError("Generator is already running");for(x&&N===1&&k(N,B),I=N,T=B;(t=I<2?e:T)||!x;){_||(I?I<3?(I>1&&(A.n=-1),k(I,T)):A.n=T:A.v=T);try{if(F=2,_){if(I||(M="next"),t=_[M]){if(!(t=t.call(_,T)))throw TypeError("iterator result is not an object");if(!t.done)return t;T=t.value,I<2&&(I=0)}else I===1&&(t=_.return)&&t.call(_),I<2&&(T=TypeError("The iterator does not provide a '"+M+"' method"),I=1);_=e}else if((t=(x=A.n<0)?T:b.call(y,A))!==i)break}catch(z){_=e,I=1,T=z}finally{F=1}}return{value:t,done:x}}}(f,g,v),!0),S}var i={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][o]?t(t([][o]())):(zs(t={},o,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function h(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,u):(f.__proto__=u,zs(f,s,"GeneratorFunction")),f.prototype=Object.create(d),f}return l.prototype=u,zs(d,"constructor",u),zs(u,"constructor",l),l.displayName="GeneratorFunction",zs(u,s,"GeneratorFunction"),zs(d),zs(d,s,"Generator"),zs(d,o,function(){return this}),zs(d,"toString",function(){return"[object Generator]"}),(Ou=function(){return{w:r,m:h}})()}function zs(e,t,n,o){var s=Object.defineProperty;try{s({},"",{})}catch{s=0}zs=function(r,i,a,l){function u(c,d){zs(r,c,function(h){return this._invoke(c,d,h)})}i?s?s(r,i,{value:a,enumerable:!l,configurable:!l,writable:!l}):r[i]=a:(u("next",0),u("throw",1),u("return",2))},zs(e,t,n,o)}function Nne(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 mN(e){var t=Nne(e,"string");return typeof t=="symbol"?t:t+""}function Zv(e){"@babel/helpers - typeof";return Zv=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},Zv(e)}function Lne(e,t){if(e){if(typeof e=="string")return fN(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)?fN(e,t):void 0}}var QE=function(e){return e.TOOLBOX_EXPORT_DATA="TOOLBOX_EXPORT_DATA",e.SW_APP_LOADER="SW_APP_LOADER",e}({});function vN(e){return Zv(e)==="object"&&e!==null&&!Array.isArray(e)}function yN(e,t){var n=Object.keys(e);return n.length===t.length&&t.every(function(o){return n.includes(o)})}function Vne(e){return typeof Blob<"u"&&e instanceof Blob}var Bne=function(t){return vN(t)&&yN(t,["file","fileName"])&&Vne(t.file)&&typeof t.fileName=="string"},$ne=function(t){return vN(t)&&yN(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"},Hne=Object.freeze(vd(vd({},QE.TOOLBOX_EXPORT_DATA,Bne),QE.SW_APP_LOADER,$ne));function Gne(e){return Zv(e)==="object"&&e!==null&&!Array.isArray(e)}function Une(e,t){var n=Object.keys(e);return n.length===t.length&&t.every(function(o){return n.includes(o)})}function Wne(e){if(!Gne(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(QE).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(!Une(e,t))return{valid:!1,reason:"Message contains missing or unexpected fields."};var n=e.type;return Hne[n](e.payload)?{valid:!0,message:e}:{valid:!1,reason:"Payload does not match the ".concat(n," schema.")}}function zne(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 u=Wne(l.data);if(u.valid===!1){s==null||s(l.data,u.reason,l);return}o(u.message,l)};return r.addEventListener("message",i),function(){return r.removeEventListener("message",i)}}class jne extends Error{}class vl extends jne{constructor(){super("Zone is an abstract class")}}class wN{get type(){throw new vl}get name(){throw new vl}get ianaName(){return this.name}get isUniversal(){throw new vl}offsetName(t,n){throw new vl}formatOffset(t,n){throw new vl}offset(t){throw new vl}equals(t){throw new vl}get isValid(){throw new vl}}const e0=new Map;function Kne(e){let t=e0.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"}),e0.set(e,t)),t}const qne={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Yne(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,u,c]=o;return[i,s,r,a,l,u,c]}function Xne(e,t){const n=e.formatToParts(t),o=[];for(let s=0;s<n.length;s++){const{type:r,value:i}=n[s],a=qne[r];r==="era"?o[a]=i:Qv(a)||(o[a]=parseInt(i,10))}return o}const t0=new Map;class Jv extends wN{static create(t){let n=t0.get(t);return n===void 0&&t0.set(t,n=new Jv(t)),n}static resetCache(){t0.clear(),e0.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=Jv.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:o}){return Qne(t,n,o,this.name)}formatOffset(t,n){return ty(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const o=Kne(this.name);let[s,r,i,a,l,u,c]=o.formatToParts?Xne(o,n):Yne(o,n);a==="BC"&&(s=-Math.abs(s)+1);const h=Jne({year:s,month:r,day:i,hour:l===24?0:l,minute:u,second:c,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 n0=null;class wd extends wN{static get utcInstance(){return n0===null&&(n0=new wd(0)),n0}static instance(t){return t===0?wd.utcInstance:new wd(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new wd(bN(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${ty(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${ty(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return ty(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 Qv(e){return typeof e>"u"}function ey(e,t=2){const n=e<0;let o;return n?o="-"+(""+-e).padStart(t,"0"):o=(""+e).padStart(t,"0"),o}function CN(e){if(!(Qv(e)||e===null||e===""))return parseInt(e,10)}function Zne(e){if(!(Qv(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function Jne(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 Qne(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 bN(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 ty(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}${ey(n,2)}:${ey(o,2)}`;case"narrow":return`${s}${n}${o>0?`:${o}`:""}`;case"techie":return`${s}${ey(n,2)}${ey(o,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}const SN=/[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 bd(...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 EN(...e){return(t,n)=>{const o={};let s;for(s=0;s<e.length;s++)o[e[s]]=CN(t[n+s]);return[o,null,n+s]}}const _N=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,eoe=`(?:${_N.source}?(?:\\[(${SN.source})\\])?)?`,RN=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,TN=RegExp(`${RN.source}${eoe}`),o0=RegExp(`(?:[Tt]${TN.source})?`),toe=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,noe=/(\d{4})-?W(\d\d)(?:-?(\d))?/,ooe=/(\d{4})-?(\d{3})/,soe=EN("weekYear","weekNumber","weekDay"),roe=EN("year","ordinal"),ioe=/(\d{4})-(\d\d)-(\d\d)/,DN=RegExp(`${RN.source} ?(?:${_N.source}|(${SN.source}))?`),aoe=RegExp(`(?: ${DN.source})?`);function Sd(e,t,n){const o=e[t];return Qv(o)?n:CN(o)}function loe(e,t){return[{year:Sd(e,t),month:Sd(e,t+1,1),day:Sd(e,t+2,1)},null,t+3]}function Ed(e,t){return[{hours:Sd(e,t,0),minutes:Sd(e,t+1,0),seconds:Sd(e,t+2,0),milliseconds:Zne(e[t+3])},null,t+4]}function op(e,t){const n=!e[t]&&!e[t+1],o=bN(e[t+1],e[t+2]),s=n?null:wd.instance(o);return[{},s,t+3]}function sp(e,t){const n=e[t]?Jv.create(e[t]):null;return[{},n,t+1]}Cd(toe,o0),Cd(noe,o0),Cd(ooe,o0),Cd(TN),bd(loe,Ed,op,sp),bd(soe,Ed,op,sp),bd(roe,Ed,op,sp),bd(Ed,op,sp),bd(Ed),Cd(ioe,aoe),Cd(DN),bd(Ed,op,sp);var uoe=["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 rp(){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 ny(){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 coe(){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 doe(){return{maxRetries:5,retryDelay:500,backoffFactor:1.5}}var IN=1e3,hoe=1e4;function xN(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){rp("Top window redirect blocked, redirecting current window instead:",n)}try{Dt("Redirecting current window to:",e),window.location.replace(e)}catch(n){rp("Failed to redirect:",n)}}}function oy(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 foe(e){return yd(yd({},e),{},{access_token:oy(e.access_token),token:oy(e.token),refresh_token:oy(e.refresh_token)})}function sy(e){if(!e)return!1;var t=e.trim();return!!t&&t!=="undefined"&&t!=="null"}function AN(e){return sy(e.getAccessToken())||sy(e.getRefreshToken())}function poe(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 goe(){typeof sessionStorage<"u"&&sessionStorage.clear()}function moe(e){return function(t){var n,o=(n=t.response)===null||n===void 0?void 0:n.status,s=AN(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,u=(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:",u,"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 c,d,h=(c=t.response)===null||c===void 0?void 0:c.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 voe=function(){function e(){var t,n,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ZE(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 JE(e,[{key:"getCookieValue",value:function(n){if(typeof document>"u")return null;var o=document.cookie.split(";"),s=Fne(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"){ny(" 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 u=this.getExpiresInRefreshToken();if(Dt("setTokens - refresh token data:",foe(n)),Dt("setTokens - refresh token expires_in value:",u),u){var c=new Date;c.setTime(c.getTime()+Number(u)*1e3),a=";expires=".concat(c.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:",oy(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()}}])}(),yoe=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";ZE(this,e),vd(this,"channel",null),this.channelName=t,this.storageKey=n,this.initChannel()}return JE(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)}}])}(),woe=function(){function e(t){var n=this;if(ZE(this,e),vd(this,"currentAttempt",0),vd(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=doe();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 yoe,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 JE(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 sy(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){rp("Failed to update localStorage:",a)}Dt("Clearing sessionStorage and cookies"),goe(),poe(s);var i="".concat(o,"/login?timeout=").concat(n);Dt("Redirecting to login in ".concat(IN,"ms:"),i),setTimeout(function(){return xN(i)},IN)}}},{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=XE(Ou().m(function o(){var s=this,r,i,a,l;return Ou().w(function(u){for(;;)switch(u.p=u.n){case 0:if(r=this.tokenStorage.getRefreshToken(),Dt(" handleTokenRefresh started, refreshToken available:",!!r),r){u.n=1;break}return Dt(" ERROR: No refresh token available - cannot refresh"),this.onTokenInvalid(),u.a(2,!1);case 1:return this.currentAttempt=0,u.p=2,u.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=u.v,!(!i||!i.access_token&&!i.token)){u.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),u.a(2,!0);case 5:return u.p=5,l=u.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"})),u.a(2,!1)}},o,this,[[2,5]])}));function n(){return t.apply(this,arguments)}return n}()},{key:"executeWithRetry",value:function(){var t=XE(Ou().m(function o(s){var r,i,a,l;return Ou().w(function(u){for(;;)switch(u.p=u.n){case 0:return u.p=0,u.n=1,s();case 1:return u.a(2,u.v);case 2:if(u.p=2,l=u.v,this.currentAttempt++,!(this.currentAttempt>=this.maxRetries)){u.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)),u.n=4,new Promise(function(c){return setTimeout(c,a)});case 4:return u.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 Coe(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?moe(t.tokenStorage):o.tokenExpiredDetection||function(u){var c;return((c=u.response)===null||c===void 0?void 0:c.status)===401},i=s?[401,425]:o.retryStatusCodes||[401,425],a=o.tokenHeaderFormatter||function(u){return"Bearer ".concat(u)};Dt("Interceptor config - retryStatusCodes:",i,"using standardized detection:",s);var l=null;e.interceptors.response.use(function(u){return u},function(){var u=XE(Ou().m(function c(d){var h,f,p,g,v,w,S,b,y,E,_,I,T,F,V,x,A,k,M,N,B;return Ou().w(function(z){for(;;)switch(z.p=z.n){case 0:if(g=d.config,v=function(ie){var te,se=s&&t.isLogoutInProgress;return ny(se?"HOLD ->":"REJECT ->",((g==null?void 0:g.method)||"").toUpperCase(),g==null?void 0:g.url,"| status:",(te=d.response)===null||te===void 0?void 0:te.status,"| reason:",ie,"| logoutInProgress:",t.isLogoutInProgress,"| at:",new Date().toISOString().slice(11,23)),se?new Promise(function(Z,P){setTimeout(function(){ny("Logout redirect did not happen in time - releasing held request:",g==null?void 0:g.url),P(d)},hoe)}):Promise.reject(d)},g){z.n=1;break}return z.a(2,v("no request config"));case 1:if(!g._retry){z.n=2;break}return z.a(2,v("retried request failed again"));case 2:if(w=(h=d.response)===null||h===void 0?void 0:h.status,Dt(" Response error handler triggered - status:",w,"url:",g.url),S=r(d),Dt(" tokenExpiredDetection returned:",S),b=!1,w===400)if(_=(y=d.response)===null||y===void 0?void 0:y.data,I=(_==null?void 0:_.error)==="invalid_token"||(_==null||(E=_.error)===null||E===void 0?void 0:E.key)==="invalid_token",I)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(oe){rp(" Failed to clear account.token:",oe)}typeof window<"u"&&(F=sessionStorage.getItem("BASE_URL")||"",V="".concat(F,"/sw?redirect=1"),Dt("Redirecting to re-auth page - URL:",V),xN(V))}else Dt(" 400 invalid_token (custom config) - user handles via callbacks");else b=!1,Dt(" 400 non-invalid_token - skip refresh");else s&&w===401&&!AN(t.tokenStorage)?(x=typeof window<"u"&&window.location.pathname.includes("/login"),A=/login|refresh-token|refreshToken/i.test(g.url||""),x||A?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(w),Dt(" Status",w,"- shouldRefresh:",S,"in retryStatusCodes:",i.includes(w),"canRetry:",b));if(b){z.n=3;break}return z.a(2,v("not eligible for refresh"));case 3:if(k=((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")),!k){z.n=4;break}return z.a(2,v("refresh endpoint itself failed"));case 4:return g._retry=!0,z.p=5,l?Dt(" Using existing refresh promise"):(Dt(" Starting new token refresh"),l=t.handleTokenRefresh()),z.n=6,l;case 6:if(M=z.v,l=null,M){z.n=7;break}return z.a(2,v("token refresh failed (waiting request)"));case 7:return N=t.tokenStorage.getAccessToken(),Dt(" Token refreshed successfully, new token available:",!!N),N?(Dt(" Injecting refreshed token into Authorization header for retry"),g.headers.Authorization=a(N)):ny(" WARNING: Token refresh succeeded but no token in storage!"),Dt(" Retrying original request with new token"),z.a(2,e(g));case 8:return z.p=8,B=z.v,rp(" Error during refresh:",B),l=null,z.a(2,v("error thrown during refresh"))}},c,null,[[5,8]])}));return function(c){return u.apply(this,arguments)}}()),e.interceptors.request.use(function(u){var c=u.headers.Authorization;if(c){var d=String(c).replace(/^Bearer\s*/i,"").trim();if(d&&d!=="undefined"&&d!=="null")return u;Dt("Removing invalid Authorization header:",c),delete u.headers.Authorization}var h=t.tokenStorage.getAccessToken(),f=t.tokenStorage.getRefreshToken();return Dt(" Request interceptor: token exists:",!!h,"refreshToken exists:",!!f,"url:",u.url),h&&sy(h)?(Dt(" Access token available - injecting into Authorization header"),u.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)"),u},function(u){return Promise.reject(u)})}function boe(e){var t=e.useStandardizedConfig===!0;Dt("createCookieRefreshHandler called - useStandardizedConfig:",t);var n;if(t){var o=coe();n=yd(yd({},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,u=e.sameSite,c=e.canSetTokens,d=e.cookieParser;n={accessTokenKey:s,refreshTokenKey:r,domain:i,path:a,secure:l,sameSite:u,canSetTokens:c,cookieParser:d},Dt(" Applied custom cookie config:",n)}var h=new voe(n);e.accessTokenKey,e.refreshTokenKey,e.domain,e.path,e.secure,e.sameSite,e.canSetTokens,e.cookieParser;var f=One(e,uoe);return new woe(yd(yd({},f),{},{storage:h,useStandardizedConfig:t}))}var Bo=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}(Bo||{});Bo.review,Bo.review_take,Bo.review_scene,Bo.review_rendition,Bo.review_frame,Bo.review_rendition_comment,Bo.review_comment,Bo.scene_hub,Bo.hub_rendition,Bo.hub_comment,Bo.people_insight,Bo.people_detail,Bo.project,Bo.woohoo,Bo.update,Bo.core,Bo.project_focusMode;const PN={accessToken:"account.token",refreshToken:"account.refresh_token"},Soe={baseUrl:"BASE_URL"},kN="/refresh-token",Eoe=3e5,_oe="*",FN={Accept:"application/json","Content-Type":"application/json"},Roe="undefined",Toe="No access token found",Mu={badRequest:400,unauthorized:401,tooEarly:425},Doe=[Mu.unauthorized,Mu.tooEarly,Mu.badRequest],Ioe="unauthenticated",xoe="invalid_token",Aoe="refresh_token_expired",Poe={type:"TOKEN_EXPIRED",message:"Authentication token has expired"},koe="Session refreshed successfully",Foe="Session expired. Please log in again.",Ooe=e=>{const{error:t}=e??{};return typeof t=="string"?t:t==null?void 0:t.key},Moe=e=>{var t,n;return((t=e==null?void 0:e.response)==null?void 0:t.status)!==Mu.badRequest?!1:Ooe((n=e.response)==null?void 0:n.data)===xoe},Noe=()=>{},Loe=e=>sessionStorage.getItem(e)||"",s0=()=>{const e=_v.get(PN.accessToken);return e&&e!==Roe?e:null},Voe=()=>!!_v.get(PN.refreshToken),Boe=()=>{const e=window.location.origin,t=Loe(Soe.baseUrl);if(!t)return e;try{return new URL(t,e).origin}catch{return e}};class r0{constructor(t,n=Noe,o){this.client=t,this.showMessage=n,this.onAuthExpired=o}attach(){const t=boe({refreshTokenFn:n=>this.refresh(n),onRefreshSuccess:n=>{this.showMessage(koe,"success"),this.client.defaults.headers.common.Authorization=`Bearer ${n.access_token}`},onRefreshFailure:()=>{this.showMessage(Foe,"error")},useStandardizedConfig:!0});this.handler=t,Coe(this.client,t,{retryStatusCodes:[...Doe],tokenExpiredDetection:r0.isTokenExpired})}refreshAccessToken(){return!this.handler||!Voe()?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===Mu.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===Mu.badRequest||n!==Mu.unauthorized||typeof o=="string"||r!==Ioe?!1:Object.keys(s).length===0||s.reason===Aoe}async refresh(t){const n=await this.client.post(kN,{refresh_token:t}),o="data"in n&&n.data?n.data:n;return{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(Poe,Boe())}}class $oe{constructor(t={}){this.options={unwrapResponse:!0,withRefreshToken:!0,requireToken:!0,...t},this.client=Qn.create({baseURL:typeof t.baseURL=="string"?t.baseURL:"",timeout:t.timeout??Eoe,headers:{...FN,...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===kN,i=r?s0():await this.resolveAccessToken();if(!i&&s&&!r)throw new Error(Toe);t.headers.set("Accept-Language",_oe),t.headers.has("Content-Type")||t.headers.set("Content-Type",FN["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=s0();return t||!this.tokenRefresher?t:(await this.tokenRefresher.refreshAccessToken(),s0())}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 r0(this.client,n,o),this.tokenRefresher.attach()),this.client.interceptors.response.use(void 0,r=>(Moe(r)&&(o==null||o("/sw?redirect=1")),Promise.reject(r))),s&&this.client.interceptors.response.use(void 0,s)}}const Hoe=5,Goe=1e3,Uoe=3,Woe="default",zoe=e=>new URL(e,"http://localhost").pathname;class joe{constructor(t={}){this.groups=new Map,this.defaultLimit=t.defaultLimit??Hoe,this.rules=t.rules??[],this.releaseDelayMs=t.releaseDelayMs??Goe}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=zoe(t),o=this.rules.find(i=>i.pattern.test(n)),s=o?o.pattern.source:Woe;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 Koe=(e,t)=>{const n=new joe(t),o=Qn.getAdapter(e.defaults.adapter);return e.defaults.adapter=s=>n.run(s.url??"",()=>o(s)),n},qoe=(e,{maxRetries:t=Uoe}={})=>{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(u=>setTimeout(u,i)),e.request(o)})},Yoe=6e4,Xoe="/start",Zoe=(e=Xoe)=>{const n=`${sessionStorage.getItem("BASE_URL")||""}${e}`;window.location.replace(n)};function Joe(e,t){const n=sessionStorage.getItem(e)||"";return(n==null?void 0:n.length)>0?n:t}class Qoe{constructor(t,n={}){const{concurrency:o,rateLimitRetry:s,...r}=n,i=()=>Joe("API_BASE_URL","");this.callbackFunc=t,this.api=new $oe({baseURL:i,timeout:Yoe,requireToken:!0,onAuthExpired:Zoe,...r,unwrapResponse:!1,showMessage:t}),this.axios=this.api.client,o!==!1&&Koe(this.axios,o),s!==!1&&qoe(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 Pne(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 ese=({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"},bulkCreate:{url:`${e}/v1/workspace/${t}/item/2/bulk-create`,method:"post",code:"bulkCreate"}}),tse=(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)},nse=15e3,ose=new Set(["bulkDelete","bulkArchive","bulkUnarchive","bulkDateUpdate","bulkAssignUpdate","bulkStatusUpdate","bulkMetricUpdate","bulkRename","removeAssignee","delete_thumbnail","delete_rendition"]);class ON extends Qoe{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=ese({domainApi:s,wsCode:r,entityId:i}),l={};Object.entries(a).forEach(([u,c])=>{const d=u;t[d]?l[d]=t[d]:(console.warn(`API config for ${d} is missing, using base config.`),l[d]=c)}),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,unwrapResponse:l=!0,timeout:u}){var h,f;const c=this.buildHeaders(s);let d;try{if(d=await this.axios.request({method:t,url:n,params:o,data:s,headers:c,responseType:i,timeout:u}),(((h=d.headers)==null?void 0:h["content-type"])||"").includes("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")){const g=((f=d.headers)==null?void 0:f["content-disposition"])||"",v=g.includes("filename=")?g.split("filename=")[1]:"exported_items.xlsx";a&&tse(d.data,v)}if(d.status>=400&&d.status<=500)throw new Error(`Client error (${d.status}): ${d.statusText}`);return this.emit("call-api",{apiCode:r,path:n,params:o,payload:s,res:d,success:!0}),l?d.data:d}catch(p){throw console.error("API Request Error:",p),p.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:p,success:!1,apiCode:r,res:p==null?void 0:p.response}),p}}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,unwrapResponse:o.unwrapResponse,timeout:ose.has(t)?nse:void 0})}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,unwrapResponse:!1})}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,unwrapResponse:!1})}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,unwrapResponse:!1})}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,unwrapResponse:!1})}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,unwrapResponse:!1})}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,unwrapResponse:!1})}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,unwrapResponse:!1})}async bulkCreate(t){return this.request("bulkCreate",{workspaceId:t.workspaceId,entityId:t.entityId},{payload:t.payload,params:t.filter,unwrapResponse:!1})}}const sse=(e,t,n,o,s,r,i)=>{const a=$(!1),{apiServices:l}=so(n,o),u=X(()=>!!(s!=null&&s.value&&(r!=null&&r.value))),c=Dn("filterParams",null);return{isUpdating:a,handleUpdate:async h=>{var p;const f=h.value;try{const g={itemIds:e.value.itemIds,metricId:h.id,workspaceId:String(e.value.workspaceId),filterParams:c!=null&&c.value?c.value:void 0};h.value==null?g.clear=1:g.value=f,u.value?(delete g.itemIds,g.entityId=String(o.entityId)):g.itemIds=e.value.itemIds,a.value=!0;const v=await((p=l.value)==null?void 0:p.bulkUpdateMetric(g));return console.log("Bulk update response:",v),t(h,v),v}catch(g){console.error("Error during bulk metric update:",g)}finally{a.value=!1}}}},rse=_t(nt({__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=iM(),o=$([]),s=e,r=t,i=$([]),a=$(null),l=z=>{var te,se,Z;const oe=o.value.findIndex(P=>P.id===z.id);a.value=oe;const ie=(te=i.value[oe])==null?void 0:te.$el;(se=E.value)==null||se.scrollTo(oe*30),ie&&ie.scrollIntoView({behavior:"smooth",block:"center"}),u(oe),(Z=i.value[oe])==null||Z.show()},u=z=>{a.value=z,i.value.forEach((oe,ie)=>{ie!==z&&oe&&oe.hide()})},c=$(""),d=()=>{c.value="",i.value.forEach(z=>{z==null||z.hide()}),a.value=null},h=X(()=>s.selectedIds||[]),f=X(()=>({itemIds:h.value,workspaceId:String(s.workspaceId)})),p=Dn("isSelectAll",$(!1)),g=Dn("bulkUpdate",$(!1)),v=$(null),{handleUpdate:w,isUpdating:S}=sse(f,(z,oe)=>{console.log("Update callback received:",z,oe),r("update",z)},!1,s,g,p),b=async z=>{var oe;r("update-start");try{const ie=await w(z);(ie==null?void 0:ie.status)!==Er.ACCEPTED&&(ie==null?void 0:ie.status)!==Er.OK?r("update-failed"):(r("update-completed",ie),setTimeout(()=>{var te;d(),(te=v.value)==null||te.hide()},500))}catch(ie){console.error("Failed to update metric:",ie),r("update-failed"),(oe=v.value)==null||oe.open()}},y=z=>{d(),ht(()=>{var oe;(oe=E.value)==null||oe.focus()})},E=$(null),_=(z,oe)=>{var ie;z?(ie=E.value)==null||ie.focus():d(),z&&oe!==z&&B("")},I=$(!0),T=$(!0),{apiServices:F}=so(!1,s),V=async(z,oe,ie)=>{var te;try{return ie?T.value=!0:I.value=!0,await((te=F.value)==null?void 0:te.getMetricList({workspaceId:s.workspaceId||"",entityId:s.entityId||"",page:z,query:oe,per_page:10}))}catch(se){throw console.error("Failed to fetch metric list:",se),se}finally{I.value=!1,T.value=!1}},x=$(0),A=$(!0),k=z=>({id:String(z.id),label:String(z.name),value:String(z.id),description:z.morpheme_value?`${String(z.morpheme_value)}`:"",type:n.checkEditType(z),metricConfig:z}),M=z=>z.filter(oe=>!oe.formula).filter(oe=>{var ie;return((ie=oe==null?void 0:oe.auth_permission)==null?void 0:ie.permission)==2}).map(k),N=async()=>{x.value+=1;const z=await V(x.value,c.value,!0);if(z&&z.data){const oe=M(z.data);o.value=[...o.value,...oe],A.value=z.meta.last_page!=z.meta.current_page}else A.value=!1},B=async z=>{c.value=z,x.value=1;try{const oe=await V(x.value,c.value);oe&&oe.data?(o.value=M(oe.data),A.value=oe.meta.last_page!=oe.meta.current_page):o.value=[]}catch{o.value=[]}};return(z,oe)=>(q(),Ke(jf,{ref_key:"wrapperRef",ref:v,isUpdating:L(S),disabled:s.disabled,onOnVisibleChange:_},{trigger:we(({hide:ie,disabled:te})=>[ye(St,{variant:s.variant,loading:L(S),disabled:te,onEscape:ie},{default:we(()=>[ye(pt,{src:"SquareRootVariable",class:"icon"}),oe[1]||(oe[1]=tt(" Metric ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:we(({isVisible:ie,popupRef:te,hide:se})=>[ze(ye(ya,{ref_key:"searchListRef",ref:E,style:{width:"320px"},options:o.value,loading:I.value,"loading-more":T.value,"selected-id":void 0,"has-more":A.value,onSearch:B,onSelect:l,onLoadMore:oe[0]||(oe[0]=()=>N()),onCancel:se},{item:we(({item:Z,index:P,selectedIndex:j})=>[ye(pee,{ref:ne=>i.value[P]=ne,label:Z.label,type:Z.type,morpheme:Z.description||"",onFocusOnSearch:y,onOpen:ne=>u(P),attachTo:te,config:Z.metricConfig,onHandleUpdate:b,class:le(["metric-update-item",{selected:a.value===P||j===P}])},null,8,["label","type","morpheme","onOpen","attachTo","config","class"])]),"extra-item":we(()=>[...oe[2]||(oe[2]=[Se("div",{style:{width:"250px"}},null,-1)])]),"empty-list":we(()=>[...oe[3]||(oe[3]=[tt("No options available.",-1)])]),_:2},1032,["options","loading","loading-more","has-more","onCancel"]),[[cr,ie]])]),default:we(()=>[oe[4]||(oe[4]=tt(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),[["__scopeId","data-v-989820f7"]]),ise={class:"status-label"},MN=_t(nt({__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 Bn(a).isLight()?"#f3f5f8":"#d7d7d7";return(a,l)=>(q(),de("div",{class:le(["status-option",{selected:o.selected,focused:o.focused,hovered:o.hovered}]),onClick:l[0]||(l[0]=u=>r(e.status.id))},[Se("div",{class:"status-color",style:hn({backgroundColor:e.status.color,borderColor:i(e.status.color)})},null,4),ze((q(),de("div",ise,[kt(a.$slots,"label",{},()=>[tt(it(e.status.name),1)],!0)])),[[L(n),{content:e.status.name,delay:[1e3,0]}]])],2))}}),[["__scopeId","data-v-aeaa75a4"]]),ase=["innerHTML"],NN=_t(nt({__name:"StatusEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{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=$([]),a=$(!1),l=$(!1),u=$(null),c=$(o.INITIAL_PAGE),d=$(!0),h=$(0),f=$(""),p=X(()=>{var k;return(k=s.value)==null?void 0:k.id});X(()=>!!(s.id||s.ids&&s.ids.length>0));const g=k=>({label:k.name,value:k.id,selected:p.value===k.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:k,id:k.id,color:k.color}),v=X(()=>{const k=new Set;return s.id&&k.add(String(s.id)),s.ids&&s.ids.forEach(M=>{M&&k.add(String(M))}),Array.from(k)}),w=Dn("bulkUpdate",!1),{apiServices:S}=so(!w,s),b=Gf(),{selectionStatus:y}=mo(b),E=Dn("filterParams",null),_=async(k=o.INITIAL_PAGE,M="",N=!1)=>{var B,z,oe,ie;N?l.value=!0:a.value=!0,u.value=null;try{const te={workspaceId:String(s.workspaceId),itemIds:v.value,page:k,perPage:o.PER_PAGE,name_like:M.trim(),...E||{},entityId:String(s.entityId)};if(((B=S.value)==null?void 0:B.getAssignableStatus)===void 0)throw new Error("API service getAssignableStatus is undefined");const se=await((z=S.value)==null?void 0:z.getAssignableStatus(te));if(!(se!=null&&se.data)){N||(i.value=[]),d.value=!1;return}const Z=se.data.map(g);i.value=N?[...i.value,...Z]:Z,h.value=((oe=se.meta)==null?void 0:oe.total)??se.data.length,d.value=!((ie=se.meta)!=null&&ie.on_last_page),c.value=k}catch(te){console.error("Error fetching statuses:",te),u.value="Failed to load statuses",N||(i.value=[]),d.value=!1,r("error",u.value)}finally{a.value=!1,l.value=!1}},I=wr(async k=>{f.value=k,c.value=o.INITIAL_PAGE,await _(o.INITIAL_PAGE,k,!1)},Si),T=async()=>{!d.value||l.value||await _(c.value+1,f.value,!0)},F=()=>{var k;r("cancel"),(k=s.params)==null||k.api.stopEditing()},V=async k=>{var M,N,B;try{const z={workspaceId:String(s.workspaceId),itemIds:v.value,statusId:String(k.value),entityId:String(s.entityId),filterParams:E!=null&&E.value?E==null?void 0:E.value:void 0};y.value==Ot.CHECKED&&w&&(z.itemIds=void 0,z.entityId=String(s.entityId)),r("start-update");const oe=await S.value.updateItemStatus(z);if(!oe)throw new Error("Status update failed: empty response");r("updated",{workspaceId:String(s.workspaceId),itemIds:v.value,isUpdateAll:y.value==Ot.CHECKED&&w,data:{id:k.id,name:k.label,color:k.color}}),s.params&&((N=s.params)==null||N.node.setData({...(M=s.params)==null?void 0:M.node.data,status:{id:k.id,name:k.label,color:k.color}}),(B=s.params)==null||B.api.stopEditing()),r("finish-update",oe)}catch(z){console.error("Error updating status:",z),u.value="Failed to update status",r("error",u.value)}},x=X(()=>i.value.map(k=>({...k})));Je([()=>s.id,()=>s.workspaceId,()=>s.ids],()=>{_()},{deep:!0,immediate:!0});const A=$(null);return Zt(()=>{ht(()=>{var k;(k=A.value)==null||k.focus()})}),t({refresh:()=>_(o.INITIAL_PAGE,f.value,!1),loadMore:T,focus:()=>{var k;return(k=A.value)==null?void 0:k.focus()}}),(k,M)=>{var N;return q(),Ke(ya,jt({ref_key:"popupRef",ref:A},s,{"selected-id":(N=s.value)==null?void 0:N.id,options:x.value,loading:a.value,"loading-more":l.value,"has-more":d.value,error:u.value,onSearch:L(I),onSelect:V,onLoadMore:T,onCancel:F,onClose:F}),{item:we(({item:B,selectedIndex:z,isSelected:oe,handleItemHover:ie,getHighlightedLabel:te,query:se,idx:Z})=>[(q(),Ke(MN,{key:B.value,status:B.data,selected:oe(B),onMouseover:P=>ie(Z),onSelect:P=>V(B),hovered:Z===z},{label:we(()=>[se?(q(),de("span",{key:0,class:le([k.$style["item-label"],k.$style.match]),style:{flex:"1"},innerHTML:te(B.label)},null,10,ase)):(q(),de("span",{key:1,class:le(k.$style["item-label"]),style:{flex:"1"}},it(B.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"}}]]),lse=nt({__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=X(()=>{const f=oo();return f==null?void 0:f.appContext.config.globalProperties.apiServices}),s=t,r=$(!1),i=$(null),a=f=>{try{r.value=!1,s("updated",f)}catch(p){console.error("Error handling status update:",p)}},l=X(()=>({apiServices:o.value,ids:n.ids,workspaceId:n.workspaceId,entityId:n.entityId,selectedAll:n.selectedAll}));ci("bulkUpdate",!0);const u=(f,p)=>{var g,v;r.value=!1,f?(s("update-completed",p),(g=i.value)==null||g.destroy()):(s("update-failed"),(v=i.value)==null||v.open())},c=$(null),d=(f,p)=>{var g;f&&((g=c.value)==null||g.focus())},h=()=>{r.value=!0,s("update-start")};return Je(()=>n.ids,()=>{}),(f,p)=>(q(),Ke(jf,{ref_key:"wrapperRef",ref:i,isUpdating:r.value,disabled:n.disabled||r.value,onOnVisibleChange:d},{trigger:we(({hide:g,disabled:v})=>[ye(St,{variant:n.variant,loading:r.value,disabled:v,onEscape:g},{default:we(()=>[ye(pt,{src:"Square",class:"icon"}),p[2]||(p[2]=tt(" Status ",-1))]),_:1},8,["variant","loading","disabled","onEscape"])]),popup:we(({hide:g})=>[ye(NN,jt({disabled:r.value,ref_key:"statusRef",ref:c},l.value,{onUpdated:a,onCancel:g,onStartUpdate:h,onFinishUpdate:p[0]||(p[0]=v=>u(!0,v)),onError:p[1]||(p[1]=v=>u(!1)),callback:()=>{}}),null,16,["disabled","onCancel"])]),default:we(()=>[p[3]||(p[3]=tt(" > ",-1))]),_:1},8,["isUpdating","disabled"]))}}),qr=" ",i0=e=>e.replace(/[\r\n]+/g," "),ry=e=>e instanceof HTMLElement&&e.classList.contains("locked-tag"),js=e=>(e==null?void 0:e.nodeType)===Node.TEXT_NODE,a0=e=>{var t;return((t=e instanceof Element?e:e.parentElement)==null?void 0:t.closest(".locked-tag"))??null},ba=e=>{let t=0,n=e.length;return ry(e.previousSibling)&&e.data.startsWith(qr)&&(t=1),ry(e.nextSibling)&&n>t&&e.data.endsWith(qr)&&(n-=1),{start:t,end:n}},use=e=>{if(!js(e))return!1;const{start:t,end:n}=ba(e);return n<=t},LN=e=>{const t=a0(e.startContainer),n=a0(e.endContainer);return t&&e.setStartAfter(t),n&&e.setEndAfter(n),e},cse=(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 dse{constructor(t){Rn(this,"editor",null);Rn(this,"handleInput",()=>{this.editor&&(this.sanitize(),this.ensureTagPadding(),this.normalizeCaret(),this.options.onChange(this.parse()))});Rn(this,"handlePaste",t=>{var n;t.preventDefault(),this.insertPlainText(((n=t.clipboardData)==null?void 0:n.getData("text/plain"))??"")});Rn(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))});Rn(this,"handleBeforeInput",t=>{const n=t.inputType;(n.startsWith("format")||n==="insertParagraph"||n==="insertLineBreak"||n==="insertFromDrop"||n==="insertFromYank")&&t.preventDefault()});Rn(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});Rn(this,"handleKeydown",t=>{var s,r,i;const n=this.editor;if(!n)return;if(t.key==="Escape"){(r=(s=this.options).onEscape)==null||r.call(s,t);return}if(t.key==="Enter"){t.preventDefault();return}const o=t.ctrlKey||t.metaKey;if(o&&!t.altKey&&t.key.toLowerCase()==="a"){t.preventDefault(),(i=window.getSelection())==null||i.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 a=this.findAdjacentTag(t.key);a&&(t.preventDefault(),this.removeTag(a,t.key==="Backspace"?"after":"before"))}});Rn(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=a0(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(),js(i))n.collapse(i,ba(i).end);else if(js(a))n.collapse(a,ba(a).start);else if(js((i==null?void 0:i.nextSibling)??null)){const l=i.nextSibling;n.collapse(l,ba(l).start)}else if(js((a==null?void 0:a.previousSibling)??null)){const l=a.previousSibling;n.collapse(l,ba(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&&(cse(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(i0(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=>{js(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(qr),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 ry(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)?LN(n):null}insertPlainText(t,n){const o=this.editor;if(!o)return;const s=window.getSelection();let r=n?LN(n):this.getEditorRange();(!r||!o.contains(r.commonAncestorContainer))&&(r=document.createRange(),r.selectNodeContents(o),r.collapse(!1)),r.deleteContents();const i=document.createTextNode(i0(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(js(o)||this.isAllowedTagNode(o))return;n=!0;const s=ry(o)?"":i0(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;js(o)?o.data.endsWith(qr)||o.appendData(qr):n.before(document.createTextNode(qr)),js(s)?s.data.startsWith(qr)||s.insertData(0,qr):n.after(document.createTextNode(qr))})}async placeCaretAfterTag(t){var s;(s=this.editor)==null||s.focus(),await Promise.resolve();const n=document.createRange();n.setStart(t,ba(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(js(s)&&s.parentNode===n){const{start:l,end:u}=ba(s);if(i?Math.min(r,u)>l:Math.max(r,l)<u)return null;a=i?s.previousSibling:s.nextSibling}else return null;for(;use(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 js(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(!js(r))return!1;const i=ba(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(!js(o)||o.parentNode!==this.editor)return!1;const{start:r,end:i}=ba(o);let a,l=1,u=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),u=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,u),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(qr)&&s.data.startsWith(qr)&&(n==="after"?o.deleteData(o.length-1,1):s.deleteData(0,1)),(r=this.editor)==null||r.normalize(),this.handleInput()}focus(){var o;(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)}blur(){var t;(t=this.editor)==null||t.blur()}insertText(t){this.insertPlainText(t)}}const hse={class:"input-wrapper"},fse=["data-placeholder"],VN=_t(nt({__name:"DynamicInput",props:{modelValue:{type:Array,default:()=>[]},placeholder:{type:String,default:"Rename to"},allowedTags:{type:Array,default:void 0}},emits:["update:modelValue","escape"],setup(e,{expose:t,emit:n}){const o=e,s=n,r=$(null),i=new dse({isTagAllowed:a=>!o.allowedTags||o.allowedTags.includes(a),onChange:a=>s("update:modelValue",a),onEscape:a=>s("escape",a)});return Zt(()=>{r.value&&i.mount(r.value,o.modelValue)}),Vn(()=>i.destroy()),Je(()=>o.modelValue,a=>{console.log("props.modelValue changed",a),i.sync(a)},{deep:!0}),t({insertTag:a=>i.insertTag(a),insertText:a=>i.insertText(a),updateTag:(a,l)=>i.updateTag(a,l),replaceTag:(a,l)=>i.replaceTag(a,l),deleteTag:a=>i.deleteTag(a),focus:()=>{i.focus()},triggerFocus:()=>{ht(()=>{var a;(a=r.value)==null||a.focus()})},blur:()=>{i.blur()}}),(a,l)=>(q(),de("div",hse,[Se("div",{ref_key:"editorRef",ref:r,class:"custom-input single-line",contenteditable:"true","data-placeholder":e.placeholder,onPaste:l[0]||(l[0]=(...u)=>L(i).handlePaste&&L(i).handlePaste(...u)),onDrop:l[1]||(l[1]=(...u)=>L(i).handleDrop&&L(i).handleDrop(...u)),onBeforeinput:l[2]||(l[2]=(...u)=>L(i).handleBeforeInput&&L(i).handleBeforeInput(...u)),onInput:l[3]||(l[3]=(...u)=>L(i).handleInput&&L(i).handleInput(...u)),onKeydown:l[4]||(l[4]=(...u)=>L(i).handleKeydown&&L(i).handleKeydown(...u)),onClick:l[5]||(l[5]=Ht((...u)=>L(i).handleClick&&L(i).handleClick(...u),["stop","prevent"]))},null,40,fse)]))}}),[["__scopeId","data-v-d5e78967"]]),pse={key:0},gse={key:1},BN=8,$N=_t(nt({__name:"PreviewName",props:{text:{}},setup(e){const t=Kt,n=e,o=$(null),s=$(null),r=$(n.text),i=$(!1),a=d=>{const h=s.value;return h.textContent=d,h.offsetWidth},l=(d,h)=>{const f=d.slice(-BN),p=d.length-BN-1;if(p<1||a(d)<=h)return d;let g=0,v=p;for(;g<v;){const w=Math.ceil((g+v)/2);a(`${d.slice(0,w)}…${f}`)<=h?g=w:v=w-1}return`${d.slice(0,g)}…${f}`},u=()=>{!o.value||!s.value||(r.value=l(n.text,o.value.clientWidth),i.value=r.value!==n.text)};let c;return Zt(()=>{u(),c=new ResizeObserver(u),c.observe(o.value)}),Vn(()=>c==null?void 0:c.disconnect()),Je(()=>n.text,()=>ht(u)),(d,h)=>(q(),de("div",{ref_key:"rootRef",ref:o,class:"preview-name"},[i.value?ze((q(),de("span",pse,[tt(it(r.value),1)])),[[L(t),{content:e.text,delay:[1e3,0],bypassOverflowCheck:!0}]]):(q(),de("span",gse,it(e.text),1)),Se("span",{ref_key:"measureRef",ref:s,class:"measure","aria-hidden":"true"},null,512)],512))}}),[["__scopeId","data-v-f1310bab"]]),mse={class:"left-section"},vse={class:"modified-template-options"},yse=["onClick"],wse={class:"setting-count"},Cse={class:"field-label"},bse={class:"field-label"},Sse={class:"confirmation"},Ese={class:"preview-section"},_se={class:"preview-list"},Rse={key:0,class:"preview-more"},HN=8,l0=7,Tse=_t(nt({__name:"BulkRenamePopup",props:{item:{},selectAll:{type:Boolean},selectedItemsCount:{}},emits:["cancel","rename"],setup(e,{expose:t,emit:n}){const o=Kt,s=xo,r=$(null),i=["number","letter","name"],a={number_up:"1→9",number_down:"9→1",letter_up:"A→Z",letter_down:"Z→A",name:"Name"},l=$({}),u=$(null),c=e,d=$([]),h=X(()=>{const K=f.value;let Y=0;const re="9999.",R={input:`${re}0`,bulkRenameButton:`${re}13`,cancelButton:`${re}12`,firstField:`${re}10`,stepField:`${re}11`,name:`${re}1`,number_up:`${re}2`,number_down:`${re}3`,letter_up:`${re}4`,letter_down:`${re}5`};return["name","number_up","number_down","letter_up","letter_down"].forEach((J,ce)=>{Y++,R[J]=`${re}${Y}`}),K?(Y++,R.firstField=`${re}${Y}`,Y++,R.stepField=`${re}${Y}`):(delete R.firstField,delete R.stepField),Y++,R.cancelButton=`${re}${Y}`,P.value?delete R.bulkRenameButton:(Y++,R.bulkRenameButton=`${re}${Y}`),console.log(R),R}),f=X(()=>d.value.find(K=>typeof K!="string"&&(K.id==="number"||K.id==="letter"))),p=$("number"),g=$("up"),v=Oo({...Ei.number}),w=Oo({...Ei.number}),S=()=>{Object.assign(v,Ei[p.value]),Object.assign(w,Ei[p.value])};Je(f,K=>{if(!K)return;const Y=K.id;Y!==p.value&&(p.value=Y,S()),g.value=K.direction==="down"?"down":"up"},{immediate:!0,flush:"sync"});const b=X(()=>YO[g.value]),y=(K,Y)=>{const re=JO(p.value,K,Y);v[K]=re,Mv(K,re)&&(w[K]=re)},E=$(null),_=$(null),I=$(null),T=(K,Y)=>{var R,G,J,ce;if(Y.key==="Enter"||Y.key==="Escape")return;if(Y.key==="Tab"){Y.preventDefault(),Y.stopPropagation(),Y.stopImmediatePropagation();const Ee=Y.shiftKey;K=="first"&&(Ee?(R=l.value.letter_down)==null||R.focus():(G=E.value)==null||G.focus()),K=="step"&&(Ee?(J=_.value)==null||J.focus():(ce=I.value)==null||ce.focus());return}Y.key.length===1&&!Y.ctrlKey&&!Y.metaKey&&!Y.altKey&&!ZO(p.value,K,Y.key)&&Y.preventDefault()},F=(K,Y)=>{var ce;Y.preventDefault();const re=Y.target,R=((ce=Y.clipboardData)==null?void 0:ce.getData("text/plain"))??"",G=re.selectionStart??re.value.length,J=re.selectionEnd??re.value.length;re.value=re.value.slice(0,G)+R+re.value.slice(J),y(K,re.value),re.value=v[K]},V=K=>{if(Mv(K,v[K]))return;const Y=Ei[p.value][K];v[K]=Y,w[K]=Y},x=X(()=>f.value?CE({type:p.value,direction:g.value,first:w.first,step:w.step,count:c.item.length}):[]),A=X(()=>d.value.every(K=>typeof K=="string"&&!K)),k=X(()=>A.value||d.value.length==0&&d.value[0]===" "?c.item.map(K=>K.name):c.item.map((K,Y)=>d.value.map(re=>typeof re=="string"?re:re.id==="name"?K.name:x.value[Y]??"").join(""))),M=X(()=>c.selectAll?c.selectedItemsCount-l0:k.value.length>HN?k.value.length-l0:0),N=X(()=>k.value.length>HN?k.value.slice(0,l0):k.value),B=[{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"}}],z=K=>{ie.value=[K];const Y=K.id.split("_")[0],re=K.id.split("_")[1],R=a[K.id],G=r.value;if(!G)return;const J=Ee=>d.value.find(Ce=>typeof Ce!="string"&&Ee.includes(Ce.id));if(Y==="name"){J(["name"])?G.deleteTag("name"):G.insertTag({id:Y,text:R,direction:void 0});return}const ce=J(["number","letter"]);if(ce){const Ee=ce.id===Y,Ce=ce.direction===re;if(Ee&&Ce){G.deleteTag(ce.id);return}G.deleteTag(ce.id),G.insertTag({id:Y,text:R,direction:re})}else G.insertTag({id:Y,text:R,direction:re})},oe=K=>te(K.id)?K.description.active:!!f.value&&K.description.switch?K.description.switch:K.description.inactive,ie=$(null),te=K=>{const[Y,re]=K.split("_");return d.value.some(R=>typeof R!="string"&&R.id===Y&&R.direction===re)},se=n,Z=X(()=>d.value.length===1&&typeof d.value.at(0)!="string"&&d.value[0].id==="name"),P=X(()=>d.value.length===0||Z.value),j=()=>{ie.value=null,d.value=[],se("cancel")},ne=()=>{const K=d.value.map(Y=>typeof Y=="string"?{type:"text",value:Y}:Y.id==="name"?{type:"current_name"}:{type:"counter",value:v.first,direction:Y.direction=="up"?"asc":"desc",format:Y.id==="number"?"number":"letter",step:v.step});se("rename",K)};t({reset:()=>{ie.value=null,d.value=[]},focus:()=>{var K;(K=r.value)==null||K.focus()}}),Zt(()=>{console.log("Focusing template input"),setTimeout(()=>{var K;(K=r.value)==null||K.focus()},500)});const xe=K=>{var Y,re;console.log("Focusing popup"),K.preventDefault(),K.stopPropagation(),(Y=r.value)==null||Y.blur(),(re=u.value)==null||re.focus()},ue=K=>{var Y;(K.key==="Enter"||K.key==="Tab")&&((Y=r.value)==null||Y.focus()),K.key==="Escape"&&j()};return(K,Y)=>(q(),de("div",{class:"bulk-rename-popup",id:"bulk-rename-el",ref_key:"popupRef",ref:u,onKeydown:ue},[Se("div",mse,[ze(ye(VN,{modelValue:d.value,"onUpdate:modelValue":Y[0]||(Y[0]=re=>d.value=re),"allowed-tags":i,ref_key:"templateInputRef",ref:r,onEscape:xe},null,8,["modelValue"]),[[L(s),h.value.input]]),Se("div",vse,[(q(),de(Pt,null,xn(B,re=>ze((q(),de("button",{onClick:R=>z(re),ref_for:!0,ref:R=>l.value[re.id]=R,key:re.id,class:le([{active:te(re.id)},"template-option"])},[tt(it(re.name)+" ",1),re.icon?(q(),Ke(L(pt),{key:0,src:re.icon,style:{transform:"rotate(90deg)"}},null,8,["src"])):Ye("",!0)],10,yse)),[[L(o),{content:oe(re),bypassOverflowCheck:!0,delay:[300,0],interactive:!1,hideOnClick:!1,appendTo:"parent"}],[L(s),`${h.value[re.id]}`]])),64))]),Se("div",wse,[Se("span",Cse,it(b.value.first),1),ze((q(),Ke(L(hl),{ref_key:"firstFieldRef",ref:_,"model-value":v.first,disabled:!f.value,"max-length":L(yE),onInput:Y[1]||(Y[1]=re=>y("first",re)),onKeydown:Y[2]||(Y[2]=re=>T("first",re)),onPaste:Y[3]||(Y[3]=re=>F("first",re)),onBlur:Y[4]||(Y[4]=re=>V("first")),"show-clear":!1},{clear:we(()=>[...Y[10]||(Y[10]=[Se("div",null,null,-1)])]),_:1},8,["model-value","disabled","max-length"])),[[L(s),h.value.firstField]]),Se("span",bse,it(b.value.step),1),ze(ye(L(hl),{"model-value":v.step,disabled:!f.value,"max-length":L(wE),onInput:Y[5]||(Y[5]=re=>y("step",re)),onKeydown:Y[6]||(Y[6]=re=>T("step",re)),onPaste:Y[7]||(Y[7]=re=>F("step",re)),onBlur:Y[8]||(Y[8]=re=>V("step")),"show-clear":!1,ref_key:"fieldStepRef",ref:E},null,8,["model-value","disabled","max-length"]),[[L(s),h.value.stepField]])]),Se("div",Sse,[ze((q(),Ke(L(St),{variant:"secondary",onClick:j,ref_key:"cancelBtnRef",ref:I},{default:we(()=>[...Y[11]||(Y[11]=[tt(" Cancel ",-1)])]),_:1})),[[L(s),h.value.cancelButton]]),ze((q(),Ke(L(St),{onClick:ne,disabled:P.value,onKeydown:Y[9]||(Y[9]=go(re=>{re.stopPropagation(),re.preventDefault(),ne()},["enter"]))},{default:we(()=>[...Y[12]||(Y[12]=[tt(" Rename ",-1)])]),_:1},8,["disabled"])),[[L(s),h.value.bulkRenameButton]])])]),Se("div",Ese,[Y[13]||(Y[13]=Se("span",{class:"preview-title"},"Preview",-1)),Se("ul",_se,[(q(!0),de(Pt,null,xn(N.value,(re,R)=>(q(),de("li",{key:R},[ye($N,{text:re},null,8,["text"])]))),128)),M.value>0?(q(),de("li",Rse," … "+it(M.value)+" more items ",1)):Ye("",!0)])])],544))}}),[["__scopeId","data-v-9264bb9d"]]),Dse=nt({__name:"BulkRenameButton",props:{item:{},totalItem:{},selectAll:{}},emits:["cancel","rename"],setup(e,{expose:t,emit:n}){const{popupRef:o,show:s,hide:r,triggerRef:i}=yo({interactive:!0,trigger:"manually",placement:"top-end",showArrow:!1,offset:[-350,25],hideOnClick:!0,toggleOnClick:!0,onHide:()=>{h()},onShow:()=>{ht(()=>{var f;(f=d.value)==null||f.focus()})}}),a=e,l=()=>{r()},u=f=>{c("rename",f),r()},c=n,d=$(null),h=()=>{d.value&&d.value.reset()};return t({popupRef:o,hide:r,show:s,triggerRef:i}),(f,p)=>(q(),de(Pt,null,[Se("div",{class:"trigger-el",ref_key:"triggerRef",ref:i},null,512),Se("div",{class:"popup-el",ref_key:"popupRef",ref:o},[ye(Tse,{item:a.item,"select-all":a.selectAll==L(Ot).CHECKED,"selected-items-count":a.totalItem,ref_key:"bulkRenameRef",ref:d,onCancel:l,onRename:u},null,8,["item","select-all","selected-items-count"])],512)],64))}}),Ise={style:{"max-width":"225px","line-height":"14px"}},xse={style:{"max-width":"100px","line-height":"14px"}},Ase=_t(nt({__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=xo,s=e,r=t,{handelSelectAll:i}=Gf(),a=$(null),{selectionStatus:l,isSelectAll:u,selectedIds:c,isBulkUpdate:d,isUpdating:h,isLoading:f,handleUpdateStart:p,handleUpdatePostUpdate:g,handleUpdateFailed:v,handleUpdateBulkStatus:w,handleUpdateBulkDate:S,handleBulkUpdateMetric:b,handleUpdateNewAssignee:y,handleDelete:E,handleArchive:_,handleUnarchive:I,deleteThumbnail:T,deleteRendition:F,handleBulkUpdateName:V}=vQ(s,a,{onUpdated:()=>r("updated"),onRefreshSelectedRow:()=>r("refreshSelectedRow")});ci("bulkUpdate",d),ci("isSelectAll",u);const x=["primary"],A=[{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}],k=()=>{r("unselect")},M=cE(),{userPermissions:N}=mo(M),B=X(()=>N.value.includes(dE)),z=X(()=>{if(!B.value){console.error("User does not have permission to open review.");return}return l.value==Ot.CHECKED?es({type:"review_take",config:{reviewDomain:un.getInstance().getItem("BASE_REVIEW_URL"),ws_code:s.workspaceId,take_id:s.entityId}}).url:es({type:"review_multiple_scenes",config:{reviewDomain:un.getInstance().getItem("BASE_REVIEW_URL"),ws_code:s.workspaceId,scene_ids:c.value.join(",")}}).url}),oe=$(null),ie=async ne=>{var ge,xe,ue;try{switch(h.value=!0,f.value=!0,ne.id){case"unarchive":await I();break;case"delete":await E();break;case"archive":await _();break;case"delete-thumbnail":await T();break;case"delete-rendition":await F();break;case"bulk-rename":P(),(ge=a.value)==null||ge.hide();break;default:console.error("Unknown action:",ne.id),f.value=!1;break}}catch(K){console.error("Error performing action:",K),(xe=a.value)==null||xe.open()}finally{(ue=oe.value)==null||ue.focus(),ht(()=>{h.value=!1,f.value=!1})}},te=(ne,ge)=>{var xe;!ne&&ge&&((xe=oe.value)==null||xe.focus())},se=X(()=>({workspaceId:s.workspaceId,entityId:s.entityId,variant:x,disabled:h.value,ids:l.value==Ot.CHECKED?[]:c.value})),Z=$(null),P=()=>{var ne;(ne=Z.value)==null||ne.show()},j=X(()=>s.selectRowData.map((ne,ge)=>({name:ne.name,index:ge})));return(ne,ge)=>ze((q(),de("div",{class:le(ne.$style["bulk-update-action"])},[Se("div",{class:le(ne.$style["left-actions"])},[Se("div",{class:le(ne.$style["selection-track"])},[ye(St,{class:le(ne.$style["btn-close"]),variant:["tertiary","icon"],onClick:k,style:{background:"transparent"}},{prefix:we(()=>[ye(pt,{src:"XMarkSolid",source:"remote"})]),_:1},8,["class"]),L(l)==L(Ot).INDETERMINATE?(q(),de("span",{key:0,class:le(ne.$style["selected-count"])},it(e.selectRowData.length)+" selected ",3)):Ye("",!0),L(l)==L(Ot).CHECKED?(q(),de("span",{key:1,class:le(ne.$style["selected-count"]),style:{"line-height":"14px"}},[ge[0]||(ge[0]=tt(' All in  " ',-1)),ze((q(),de("span",Ise,[tt(it(e.takeName),1)])),[[L(n),{content:e.takeName}]]),ge[1]||(ge[1]=tt(' " ',-1))],2)):Ye("",!0),!e.loading&&L(l)==L(Ot).INDETERMINATE&&e.totalRows>e.selectRowData.length&&e.selectRowData.length==e.visibleRows?(q(),Ke(St,{key:2,variant:"secondary",onHandleClick:L(i)},{default:we(()=>[Se("span",{class:le(ne.$style["selected-count"]),style:{"line-height":"14px"}},[ge[2]||(ge[2]=tt(' Select all in  " ',-1)),ze((q(),de("span",xse,[tt(it(e.takeName),1)])),[[L(n),{content:e.takeName}]]),ge[3]||(ge[3]=tt(' " ',-1))],2)]),_:1},8,["onHandleClick"])):Ye("",!0),Se("span",{class:le(ne.$style.divider)},null,2)],2),ye(lse,jt(se.value,{onUpdated:L(w),onUpdateStart:L(p),onUpdateCompleted:L(g),onUpdateFailed:L(v),"selected-all":L(l)==L(Ot).CHECKED}),null,16,["onUpdated","onUpdateStart","onUpdateCompleted","onUpdateFailed","selected-all"]),ye(HQ,jt({onUpdate:L(y),onUpdateStart:L(p),onUpdateCompleted:L(g),onUpdateFailed:L(v),"selected-all":L(l)==L(Ot).CHECKED},se.value),null,16,["onUpdate","onUpdateStart","onUpdateCompleted","onUpdateFailed","selected-all"]),ye(eee,jt({"row-selected":e.selectRowData,"selected-all":L(l)==L(Ot).CHECKED},se.value,{onUpdated:L(S),onUpdateStart:L(p),onUpdateCompleted:L(g),onUpdateFailed:L(v)}),null,16,["row-selected","selected-all","onUpdated","onUpdateStart","onUpdateCompleted","onUpdateFailed"]),ye(rse,{disabled:L(h),onUpdate:L(b),onUpdateStart:L(p),onUpdateCompleted:L(g),onUpdateFailed:L(v),selectedIds:L(c),"workspace-id":e.workspaceId,variant:x,"entity-id":e.entityId,"selected-all":L(l)==L(Ot).CHECKED},null,8,["disabled","onUpdate","onUpdateStart","onUpdateCompleted","onUpdateFailed","selectedIds","workspace-id","entity-id","selected-all"]),Se("span",{class:le(ne.$style.divider)},null,2),ze((q(),de("div",null,[B.value?(q(),Ke(St,{key:0,class:le(ne.$style["action-button"]),variant:[...x,"icon"],href:z.value,disabled:L(h)||s.selectRowData.length>40&&L(l)!=L(Ot).CHECKED},{default:we(()=>[ye(pt,{src:"PenRuler",class:le(ne.$style["icon-btn"])},null,8,["class"])]),_:1},8,["class","variant","href","disabled"])):Ye("",!0)])),[[L(n),s.selectRowData.length<=40||L(l)==L(Ot).CHECKED?"Open in Review":"Select fewer than 40 items to open in Review"]]),Se("span",{class:le(ne.$style.divider)},null,2),ye(jf,{ref_key:"wrapperRef",ref:a,isUpdating:L(h),disabled:L(h),onOnVisibleChange:te},{trigger:we(({hide:xe,toggle:ue,isVisible:K,disabled:Y})=>[ze((q(),Ke(St,{onEscape:xe,actived:K,ref_key:"moreActionRef",ref:oe,class:le(ne.$style["action-button"]),variant:["secondary","icon"],loading:L(f),disabled:Y||L(h),onClick:Ht(ue,["stop"])},{default:we(()=>[ye(pt,{src:"EllipsisVertical",class:le(ne.$style.icon),source:"remote"},null,8,["class"])]),_:1},8,["onEscape","actived","class","loading","disabled","onClick"])),[[L(o),"99999"],[L(n),{content:"More actions"}]])]),popup:we(({isVisible:xe,hide:ue})=>[(q(),de(Pt,null,xn(A,(K,Y)=>ye(fl,jt({clickable:!0,key:K.id},{ref_for:!0},K,{show:xe,style:{borderLeft:0},"focus-index":"99999."+Y,onClick:()=>{ie(K)},onEscape:ue}),null,16,["show","focus-index","onClick","onEscape"])),64))]),_:1},8,["isUpdating","disabled"])],2),ye(Dse,{item:j.value,totalItem:L(u)?s.totalRows:j.value.length,"select-all":L(l),onRename:L(V),ref_key:"bulkRenameButtonRef",ref:Z},null,8,["item","totalItem","select-all","onRename"])],2)),[[cr,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"}}]]),yl=_t(nt({name:"LabelRenderer",__name:"LabelRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean}},setup(e){const t=Bs,n=Kt,o=e,s=X(()=>({disabled:o.disabled,error:!1,readOnly:o.readOnly,isEmpty:o.value===void 0||o.value===null||o.value==="",clickable:!0})),{argsMain:r}=Ao(s),i=X(()=>{var u,c,d;return!!((u=o.params)!=null&&u.api||(c=o.params)!=null&&c.node||(d=o.params)!=null&&d.context)}),a=X(()=>{if(o.tooltip){if(typeof o.tooltip=="string")return{content:o.tooltip};if(typeof o.tooltip=="object"&&"display_name"in o.tooltip){const u=o.tooltip,c=document.createElement("div");c.classList.add("tooltip-user-info"),c.style.display="flex",c.style.alignItems="center",c.style.gap="4px";const d=document.createElement("div"),h=ye(Ef,{id:u.id,name:u.display_name,profile_image:u.profile_image,size:20,initial:u.initial,color:u.color});rb(h,d);const f=document.createElement("span");f.innerText=u.display_name,f.classList.add("tooltip-user-name");const p=document.createElement("span");p.style.whiteSpace="nowrap",p.innerText="By",c.appendChild(p),c.appendChild(d),c.appendChild(f);const g=document.getElementById("item-table-layout-id");return{content:c,allowHtml:!0,appendTo:g||document.body,bypassOverflowCheck:!0}}}return{content:void 0}}),l=X(()=>o.value===void 0);return(u,c)=>ze((q(),Ke(Lo,jt(L(r),{ref:"displayWrapperRef"}),{default:we(()=>[Se("span",{class:le(u.$style["item-table-label-renderer"])},it(o.value||"-"),3)]),_:1},16)),[[L(t),{isLoading:l.value||!i.value}],[L(n),a.value]])}}),[["__cssModules",{$style:{"item-table-label-renderer":"_item-table-label-renderer_s1gdy_1"}}]]),Pse=["placeholder","maxlength"],kse={key:0,class:"wrapper-suffix"},Fse=_t(nt({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=Bs,s=Kt,r=e,i=n,a=$(r.value),l=$(null),u=$(null),c=$(r.value||""),d=$(!1),h=$(!1),f=X(()=>{var x;return{disabled:r.disabled,error:!1,readOnly:r.readOnly,isEmpty:((x=r.value)==null?void 0:x.length)===0,inputRef:l,wrapperRef:u,clickable:!0,focused:d.value||r.keyboardFocusing}}),{argsMain:p,isHover:g}=Ao(f),v=()=>c.value!==a.value,w=()=>{h.value=!0,d.value=!1,c.value=a.value,i("update:value",a.value),setTimeout(()=>{h.value=!1},100)},S=()=>{if(!d.value||!l.value)return;const x=l.value.value;if(!v()){d.value=!1;return}a.value=x,i("update:value",x),i("enter",x),d.value=!1},b=()=>{h.value||(r.saveOnBlur?S():w(),i("blur",c.value))},y=x=>{var A;if(x.key==="ArrowLeft"||x.key==="ArrowRight"){x.stopPropagation();return}x.ctrlKey&&(x.key=="a"||x.key=="A")?(x.stopPropagation(),(A=l.value)==null||A.select()):x.key==="Enter"?(x.preventDefault(),x.stopPropagation(),S()):x.key==="Escape"&&(x.preventDefault(),x.stopPropagation(),w())},E=()=>{a.value=r.value,c.value=r.value,d.value=!0,ht(()=>{var x,A;(x=l.value)==null||x.click(),(A=l.value)==null||A.focus()})},_=()=>{var x;d.value?w():(x=l.value)==null||x.blur(),i("blur",c.value)},I={focus:()=>{E()}};Zt(()=>{var A;const x=(A=u.value)==null?void 0:A.$el;x&&(x.__sceneNameEditor=I)}),Vn(()=>{const x=u.value;x&&delete x.__sceneNameEditor});const T=$(null),F=$(null);t({focus:E,blur:()=>{var x;return(x=l.value)==null?void 0:x.blur()},save:S,cancel:w,focusEditButton:()=>{ht(()=>{var x;(x=T.value)==null||x.focus()})},focusCancelButton:()=>{ht(()=>{var x;(x=F.value)==null||x.focus()})},startEdit:E});const V=X(()=>r.value===void 0);return _E(u,()=>{d.value&&b()}),(x,A)=>ze((q(),Ke(L(Lo),jt(L(p),{ref_key:"wrapperRef",ref:u,bordered:r.bordered,style:{paddingTop:"0px",paddingBottom:"0px"}}),Hh({default:we(()=>[d.value?Ye("",!0):kt(x.$slots,"default",{isEditting:d.value,isHover:L(g)},()=>[ze((q(),de("span",{class:le(x.$style["label-renderer"])},[tt(it(c.value),1)],2)),[[L(s),{content:c.value||void 0}]])],void 0,0),ze(Se("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":A[0]||(A[0]=k=>c.value=k),class:le(x.$style["label-editor"]),placeholder:e.placeholder,maxlength:e.maxLength,onKeydown:y,onBlur:b},null,42,Pse),[[cr,d.value],[hI,c.value]])]),_:2},[!e.disabled&&!e.readOnly?{name:"suffix",fn:we(({hovered:k,focused:M})=>[k?(q(),de("div",kse,[k&&!M?ze((q(),Ke(St,{key:0,variant:["icon","secondary"],size:24,onClick:Ht(E,["prevent","stop"]),tabindex:"0",ref_key:"editButtonRef",ref:T,onKeydown:[go(Ht(E,["prevent","stop"]),["enter"]),go(Ht(_,["prevent","stop"]),["escape"])]},{default:we(()=>[ye(L(pt),{src:"Pen",source:"remote"})]),_:1},8,["onKeydown"])),[[L(s),"Edit"]]):Ye("",!0)])):Ye("",!0)]),key:"0"}:void 0]),1040,["bordered"])),[[L(o),{isLoading:V.value}]])}}),[["__cssModules",{$style:{"label-renderer":"_label-renderer_cyzth_1","label-editor":"_label-editor_cyzth_10"}}]]),Ose=["tabindex"],GN=_t(nt({name:"SceneNameEditor",__name:"SceneNameEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean},placeholder:{default:"Enter name"}},emits:["update:value","enter","blur"],setup(e,{expose:t,emit:n}){const o=Kt,s=Bs,r=e,i=n,a=$(r.value),l=$(r.value),u=$(null),c=$(null),d=Dn("bulkUpdate",!1),{apiServices:h}=so(!d,r),f=X(()=>{var te;return{componentType:void 0,disabled:r.disabled,error:!1,readOnly:r.readOnly,isEmpty:((te=a==null?void 0:a.value)==null?void 0:te.length)===0,inputRef:u,wrapperRef:c,clickable:!0}}),{isFocus:p}=Ao(f),g=X(()=>{const te=un.getInstance().getItem("ws.code"),se=un.getInstance().getItem("BASE_URL"),Z=te||r.workspaceId;return es({type:"scene_hub",config:{baseDomain:se,ws_code:Z,scene_id:String(r.id)}}).url}),v=X(()=>{var te,se,Z;return((se=(te=r.data)==null?void 0:te.isProcessing)==null?void 0:se.state)==0||((Z=r.data)==null?void 0:Z.isDeleted)==!0}),w=X(()=>r.readOnly||_.value),S=X(()=>{var te,se,Z,P,j;return((te=r.data)==null?void 0:te.isDeleted)==!0||((Z=(se=r.data)==null?void 0:se.isProcessing)==null?void 0:Z.state)==0||((j=(P=r.data)==null?void 0:P.isProcessing)==null?void 0:j.state)==1}),b=X(()=>{var te,se;return(se=(te=r.data)==null?void 0:te.isProcessing)==null?void 0:se.message}),y=X(()=>{var te;return((te=r.data)==null?void 0:te.isArchived)==1}),E=X(()=>{var te;return((te=r.data)==null?void 0:te.isLocked)==1}),_=X(()=>r.value===void 0),I=X(()=>{var te,se;return((se=(te=r.data)==null?void 0:te.permissions)==null?void 0:se.has_edit_permission)==1}),T=async te=>{var se,Z,P,j,ne,ge,xe,ue,K,Y;a.value=te,p.value=!1;try{const re=await((Z=(se=h.value)==null?void 0:se.updateSceneName)==null?void 0:Z.call(se,{workspaceId:r.workspaceId,entityId:r.entityId,itemId:r.id,name:a.value})),R=_v.get(wO)||"UTC";if(re){const G=EO(re,R),J={...r.data,...G};(P=r.params)==null||P.api.clearFocusedCell();const ce=((ne=(j=r.params)==null?void 0:j.column)==null?void 0:ne.getColId())||"",Ee=((xe=(ge=r.params)==null?void 0:ge.node)==null?void 0:xe.rowIndex)||0;(ue=r.params)==null||ue.api.setFocusedCell(Ee,ce),(Y=(K=r.params)==null?void 0:K.node)==null||Y.setData(J),l.value=a.value,i("enter")}else a.value=l.value}catch(re){console.error("Failed to update scene name:",re),a.value=l.value}},F={focus:()=>{p.value=!0,ht(()=>{var te;return(te=c.value)==null?void 0:te.focus()})},startEdit:()=>{var te;(te=c.value)==null||te.startEdit()}},V=()=>c.value?"$el"in c.value?c.value.$el:c.value:null;Je(()=>r.value,te=>{a.value=te,l.value=te}),Zt(()=>{const te=V();te&&(te.__sceneNameEditor=F)}),Vn(()=>{const te=c.value,se=te&&"$el"in te?te.$el:te;se&&delete se.__sceneNameEditor});const x=fd(),{openSceneHub:A}=x,k=te=>{try{if(te.ctrlKey||te.metaKey){window.open(g.value,"_blank");return}A(String(r.id))}catch{window.open(g.value,"_blank")}finally{oe()}},M=()=>{setTimeout(()=>{ie.value=!0,N.value=0,ht(()=>{var te;(te=B.value)==null||te.focus()})},300)},N=$(-1),B=$(null);t({focus:M,trigerFocus:M,startEdit:()=>{var te;(te=c.value)==null||te.startEdit()}});const z=te=>{if(te.key==="Enter"){te.preventDefault(),k(te);return}if(te.key==="Escape"){te.preventDefault(),oe();return}te.key==="Tab"&&(te.preventDefault(),te.stopPropagation(),te.stopImmediatePropagation(),ht(()=>{var se;(se=c.value)==null||se.focusEditButton()}))},oe=()=>{var Z,P,j,ne,ge,xe;ie.value=!1,N.value=-1,(Z=r.params)==null||Z.api.clearFocusedCell();const te=((j=(P=r.params)==null?void 0:P.column)==null?void 0:j.getColId())||"",se=((ge=(ne=r.params)==null?void 0:ne.node)==null?void 0:ge.rowIndex)||0;(xe=r.params)==null||xe.api.setFocusedCell(se,te)},ie=$(!1);return(te,se)=>ze((q(),Ke(Fse,{"save-on-blur":!0,ref_key:"wrapperRef",ref:c,disabled:r.disabled,"read-only":w.value,placeholder:r.placeholder,value:a.value,"onUpdate:value":se[0]||(se[0]=Z=>a.value=Z),id:`scene-name-${r.id}`,onEnter:T,"max-length":255,bordered:!0,keyboardFocusing:ie.value,onBlur:oe},{default:we(({isHover:Z,isEditting:P})=>[ze(Se("div",{class:le(te.$style["scene-name-display"])},[ze((q(),de("a",{tabindex:N.value,ref_key:"nameRef",ref:B,onClick:Ht(k,["prevent"]),onKeydown:z,target:"_blank",class:le(te.$style["scene-name-text"]),style:{lineHeight:"28px"}},[tt(it(a.value),1)],42,Ose)),[[L(o),{content:a.value,delay:[1e3,0]}]]),w.value||!Z&&!P&&!w.value?(q(),de(Pt,{key:0},[E.value?ze((q(),de("div",{key:0,class:le([te.$style["icon-processing"],te.$style.isLocked])},[ye(pt,{src:"Lock",color:I.value?"#a6a6a6":"#232323"},null,8,["color"])],2)),[[L(o),{content:I.value?"Locked — You can still edit, or unlock by changing the status from completed":"Locked",delay:[1e3,0]}]]):Ye("",!0),y.value?ze((q(),de("div",{key:1,class:le([te.$style["icon-processing"],te.$style.archived])},[ye(pt,{src:"BoxArchive"})],2)),[[L(o),{content:"Archived",delay:[1e3,0]}]]):Ye("",!0),S.value?ze((q(),de("div",{key:2,class:le([te.$style["icon-processing"],te.$style.processing,v.value&&te.$style["icon-red"]])},[ye(pt,{src:"AnimatedHourglass",color:"inherit"})],2)),[[L(o),b.value]]):Ye("",!0)],64)):Ye("",!0)],2),[[cr,!L(p)]])]),_:1},8,["disabled","read-only","placeholder","value","id","keyboardFocusing"])),[[L(s),{isLoading:_.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"}}]]),u0=_t(nt({__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=xo,s=$([]),r=e,i=$(null),a=X(()=>typeof r.size=="number"?`${r.size}px`:{small:"24px",medium:"32px",large:"48px"}[r.size]??"32px"),l=X(()=>{let w=[];return typeof r.variant=="string"?w.push(r.variant):Array.isArray(r.variant)&&(w=[...r.variant]),[...w,"icon"]}),u=n,{hide:c,isVisible:d,show:h,triggerRef:f,popupRef:p,instance:g}=yo({toggleOnClick:!0,offset:[0,0],onShow:()=>u("open")});function v(w){u("select",w),c()}return $h(()=>{g.value&&g.value.setProps({placement:r.placement})}),t({show:h,hide:c,hideDropdown:()=>{c()},popupRef:p}),Je(d,w=>{var S;w&&((S=p.value)==null||S.focus())}),(w,S)=>(q(),de("div",{class:le(w.$style["button-dropdown-wrapper"]),style:hn({"--button-size":a.value})},[Se("div",{class:le(w.$style["button-group"])},[kt(w.$slots,"prefix"),Se("div",{ref_key:"triggerRef",ref:f,class:le(L(d)?w.$style.open:"")},[kt(w.$slots,"triggerDropdown",{open:L(d)},()=>[r.readOnly?Ye("",!0):ze((q(),Ke(St,{key:0,onEscape:L(c),ref_key:"mainButton",ref:i,actived:L(d),class:le(w.$style["button-dropdown-trigger"]),variant:l.value,size:e.size,disabled:r.disabled},{default:we(()=>[kt(w.$slots,"iconDropdown",{},()=>[ye(pt,{class:le(w.$style["icon-dropdown"]),src:"ChevronDown",source:"remote"},null,8,["class"])])]),_:3},8,["onEscape","actived","class","variant","size","disabled"])),[[L(o),e.tabIndex]])])],2)],2),Se("div",{ref_key:"popupRef",ref:p,tabindex:"0",class:le(w.$style["button-dropdown-list"]),style:{borderRadius:"var(--radius-lg)",overflow:"hidden"}},[(q(!0),de(Pt,null,xn(e.options,(b,y)=>ze((q(),Ke(fl,jt({ref_for:!0,ref:E=>s.value[y]=E,key:b.value},{ref_for:!0},{...b},{"icon-name":b.icon,onClick:Ht(E=>v(b.value||""),["stop","prevent"]),style:{borderLeft:0}}),{label:we(()=>[tt(it(b.label),1)]),_:2},1040,["icon-name","onClick"])),[[L(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"}}]]),ip=_t(nt({__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=X(()=>({content:o.tooltip,contentClass:"extra-padding",appendTo:()=>globalThis.document.body}));return(a,l)=>(q(),de("div",{class:le(a.$style["close-wrapper"])},[e.disableRemove?Ye("",!0):(q(),de("div",{key:0,class:le(a.$style["close-button"])},[ze((q(),Ke(St,{variant:["icon","tertiary"],style:{background:"white"},"aria-label":"remove",onClick:r,size:16,rounded:!0},{default:we(()=>[ye(pt,{src:"CircleXMark",size:"16",color:"var(--primary-color)"})]),_:1})),[[L(n),i.value]])],2)),kt(a.$slots,"default")],2))}}),[["__cssModules",{$style:{"close-wrapper":"_close-wrapper_15u1e_1","close-button":"_close-button_15u1e_5"}}]]),Mse=_t(nt({name:"AssigneeGroupRenderer",__name:"AssigneeGroupRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean},error:{type:Boolean},maxVisible:{default:4}},setup(e){const t=Kt,n=Bs,o=e,{isEditing:s}=ld(o),r=$(o.value),i=$(null),a=$(null),{apiServices:l}=so(!0,o),u=$(!0),c=()=>{u.value=o.value===void 0};Bh(()=>{c()}),Zt(()=>{c()}),Je(()=>o.value,T=>{c()});const d=X(()=>({disabled:o.disabled,readOnly:o.readOnly,error:o.error,inputRef:i,wrapperRef:a,clickable:!(o.readOnly||u.value),active:s})),{argsMain:h,isHover:f}=Ao(d),p=X(()=>{var T;return((T=r.value)==null?void 0:T.slice(0,o.maxVisible))||[]}),g=X(()=>{var T;return Math.max(0,(((T=r.value)==null?void 0:T.length)||0)-o.maxVisible)}),v=X(()=>{var T;return g.value<=0?"":((T=r.value)==null?void 0:T.slice(o.maxVisible).map(F=>F.name).join(", "))||""}),w=X(()=>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=X(()=>({color:f.value?"var(--primary-color)":"var(--grey-300)",display:"flex",alignItems:"center",marginLeft:"4px"}));Je(()=>o.value,T=>{r.value=T},{immediate:!0,deep:!0});const b=async T=>{var V,x,A;await I(T)&&(r.value=(V=r.value)==null?void 0:V.filter(k=>k.id!==T),(A=o.params)==null||A.node.setData({...(x=o.params)==null?void 0:x.node.data,assignees:r.value}))},y=T=>{var V;const F=un.getInstance().getItem("ws.code");return((V=l.value)==null?void 0:V.getUserInformation(F,T))||Promise.resolve(null)},{id:E}=Ng(o),_=T=>{var V,x;const F=(x=(V=o.params)==null?void 0:V.api)==null?void 0:x.getRowNode(String(E.value));F==null||F.setDataValue("assignees",nv(T.assignees))},{removeAssignee:I}=Iv({...o,entityId:o.entityId,updateRowData:_,value:o.value,errorCallback:()=>{}});return(T,F)=>ze((q(),Ke(Lo,jt(L(h),{ref_key:"wrapperRef",ref:a,bordered:!0}),{default:we(()=>{var V;return[Se("div",{class:le(T.$style.assigneeGroupRenderer)},[((V=r.value)==null?void 0:V.length)===0?(q(),Ke(pt,{key:0,src:"UserPlus",source:"remote",color:"#6B6B6B",style:hn(S.value)},null,8,["style"])):Ye("",!0),(q(!0),de(Pt,null,xn(w.value,x=>(q(),Ke(ip,{key:x.id,"disable-remove":o.readOnly||o.disabled,onClear:A=>b(x.id),style:{marginLeft:"0"}},{default:we(()=>[ye(Iu,{user:x.user,"show-profile":!0,apiUpdateFunction:y,class:le(T.$style["ib-assignee-avatar"])},null,8,["user","class"])]),_:2},1032,["disable-remove","onClear"]))),128)),g.value>0?ze((q(),de("div",{key:1,class:le(T.$style["extra-avatars"])},[tt(" +"+it(g.value),1)],2)),[[L(t),v.value]]):Ye("",!0)],2)]}),_:1},16)),[[L(n),{isLoading:u.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"}}]]),Nse=_t(nt({name:"DateRangeRenderer",__name:"DateRangeRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!1},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{}},setup(e){var _,I;const t=Kt,n=Bs,o=lE(),s=e,r=$(null),i=$(null),{isEditing:a}=ld(s),l=T=>{if(T){if(typeof T=="string")return T;if(T instanceof Date)return T.toISOString()}},u=X(()=>s.value===void 0),c=X(()=>{var T;return(T=s.data)==null?void 0:T.isStarted}),d=X(()=>{var T;return(T=s.data)==null?void 0:T.isCompleted}),h=X(()=>!!(s.value&&(s.value[0]||s.value[1]))),f=X(()=>h.value?s.disabled&&!s.readOnly?"var(--disabled-color)":"var(--primary-color)":"var(--grey-300)"),p=X(()=>({disabled:s.disabled,error:!1,readOnly:s.readOnly,inputRef:r,wrapperRef:i,clickable:!0,active:a})),{argsMain:g}=Ao(p),{startDate:v,endDate:w,startClasses:S,endClasses:b,fullStartDate:y,fullEndDate:E}=SJ({start:l((_=s.value)==null?void 0:_[0]),end:l((I=s.value)==null?void 0:I[1]),isStarted:c.value,isEnded:d.value,timezone:s.timezone||o});return(T,F)=>ze((q(),Ke(Lo,jt(L(g),{ref_key:"wrapperRef",ref:i,bordered:!0}),{default:we(()=>[u.value?Ye("",!0):(q(),de("div",{key:0,class:le(T.$style.dateRangeRenderer)},[h.value?Ye("",!0):(q(),Ke(pt,{key:0,src:"Calendar",class:le(T.$style.calendarIcon),color:f.value},null,8,["class","color"])),h.value?(q(),de(Pt,{key:1},[ze((q(),de("span",{class:le([T.$style.dateLabelDisplay,...L(S).map(V=>T.$style[V])])},[tt(it(L(v)),1)],2)),[[L(t),L(y)]]),F[0]||(F[0]=Se("span",null,"→",-1)),ze((q(),de("span",{class:le([T.$style.dateLabelDisplay,...L(b).map(V=>T.$style[V])])},[tt(it(L(w)),1)],2)),[[L(t),L(E)]])],64)):Ye("",!0)],2))]),_:1},16)),[[L(n),{isLoading:u.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"}}]]),Lse=nt({__name:"DateRangeEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{default:void 0},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean},isStarted:{type:Boolean},isCompleted:{type:Boolean},timezone:{default:lE()}},emits:["closed"],setup(e,{expose:t,emit:n}){const o=$(null);Zt(()=>{ht(()=>{o.value&&o.value.focus()})});const s=e,r=n,i=()=>{var S;(S=s.params)==null||S.api.stopEditing(),r("closed")},a=S=>`${lt.fromJSDate(S,{zone:"utc"}).toFormat("yyyy-MM-dd'T'HH:mm:ss.SSS")}999Z`,l=async S=>{await w({startDate:S[0]?a(S[0]):null,dueDate:S[1]?a(S[1]):null})},u=async()=>{await w({startDate:null})},c=async()=>{await w({dueDate:null})},d=async S=>{await w({startDate:S?a(S):null})},h=async S=>{await w({dueDate:S?a(S):null})},f=async()=>{await w({startDate:null,dueDate:null})},p=Dn("bulkUpdate",!1),{apiServices:g}=so(!p,s),v=X(()=>{var S,b,y,E,_,I,T,F,V;return{parentName:((y=(b=(S=s.params)==null?void 0:S.node.data)==null?void 0:b.parentConfig)==null?void 0:y.parentName)||null,parentStartDate:((I=(_=(E=s.params)==null?void 0:E.node.data)==null?void 0:_.parentConfig)==null?void 0:I.parentStartDate)||null,parentDueDate:((V=(F=(T=s.params)==null?void 0:T.node.data)==null?void 0:F.parentConfig)==null?void 0:V.parentDueDate)||null}}),w=async S=>{var b,y,E,_,I;try{const T=(b=o.value)==null?void 0:b.getValues(),F=await((E=(y=g.value)==null?void 0:y.changeDate)==null?void 0:E.call(y,{workspaceId:s.workspaceId,itemIds:[s.id],startDate:S.startDate,dueDate:S.dueDate}));console.log("Update response:",F),(F==null?void 0:F.status)==Er.OK&&((I=s.params)==null||I.node.setData({...(_=s.params)==null?void 0:_.node.data,dateRange:T==null?void 0:T.dateRange}))}catch(T){console.error("Failed to update scene name:",T)}};return t({focus:()=>{ht(()=>{var S;(S=o.value)==null||S.focus()})}}),(S,b)=>(q(),Ke(Nv,jt({...s,parentConfig:v.value},{onUpdate:l,"onUpdate:end":h,"onUpdate:start":d,onClearAll:f,onClearDue:c,onClearStart:u,onClosed:i,ref_key:"calendarRef",ref:o}),null,16))}}),Vse=_t(nt({__name:"item-table-layout",props:{isSidebarOpen:{type:Boolean,default:!1}},emits:["close-sidebar","sidebar-clear","sidebar-apply"],setup(e,{emit:t}){const n=$(null),o=$(0);let s=null;Zt(()=>{n.value&&(s=new ResizeObserver(i=>{for(const a of i)o.value=a.contentRect.height}),s.observe(n.value))}),nu(()=>{s&&n.value&&s.unobserve(n.value)});const r=X(()=>{const i=o.value;return i>120?i-42-36:0});return(i,a)=>(q(),de("div",{class:le(i.$style["item-table-wrapper"]),ref_key:"itemTableWrapperRef",ref:n},[Se("div",{class:le(i.$style["item-header"])},[Se("div",{class:le(i.$style["item-header__left"])},[kt(i.$slots,"header-left",{},()=>[Se("h1",{class:le(i.$style["item-header__title"])},[kt(i.$slots,"title",{},()=>[a[0]||(a[0]=tt("Items",-1))])],2)])],2),Se("div",{class:le(i.$style["item-header__spacer"])},null,2),Se("div",{class:le(i.$style["item-header__actions"])},[kt(i.$slots,"header-actions")],2)],2),kt(i.$slots,"grid",{availableHeight:r.value}),Se("div",{class:le(i.$style.footer)},[kt(i.$slots,"footer")],2),kt(i.$slots,"new-row"),kt(i.$slots,"bulk-update-actions"),kt(i.$slots,"snackbar"),kt(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"}}]]),UN=_t(nt({name:"MoreOptionEditor",__name:"MoreOptionEditor",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean},optionBlock:{},isSubmenu:{type:Boolean,default:!1},layer:{default:0},focusableIndex:{}},emits:["actionExecuted"],setup(e,{expose:t,emit:n}){const o=xo,s=e,r=X(()=>(s==null?void 0:s.workspaceId)||""),i=X(()=>(s==null?void 0:s.entityId)||""),a=()=>{var M,N,B;return(B=(M=s.params)==null?void 0:M.api)==null?void 0:B.getCellRendererInstances({columns:["options"],rowNodes:(N=s.params)!=null&&N.node?[s.params.node]:[]})[0]},l=()=>{var N,B,z,oe;const M=a();(B=(N=M==null?void 0:M.componsenExposed)==null?void 0:N.blur)==null||B.call(N),(oe=(z=M==null?void 0:M.container)==null?void 0:z.parentElement)==null||oe.classList.remove("ag-cell-focus")},u=()=>{var B,z,oe;(z=(B=s.params)==null?void 0:B.api)==null||z.stopEditing(),l();const M=`scene-name-${s.id}`,N=document.getElementById(M);(oe=N==null?void 0:N.__sceneNameEditor)==null||oe.startEdit()},{apiServices:c}=so(!0,s),d=X(()=>{var M;return{ws_code:r.value,entity_id:i.value,scene_id:s.id,axiosService:c,optionBlock:s.optionBlock,permissions:(M=s.data)==null?void 0:M.permissions}}),h=M=>{var B,z,oe,ie,te,se;let N=(z=(B=s.params)==null?void 0:B.api)==null?void 0:z.getRowNode(String(s.id));if(N){const Z={...N.data,isDeleted:M==="deleted",isArchived:M==="archived"?!0:N.data.isArchived,isLocked:M==="locked"?!0:N.data.isLocked,disabled:!1};M=="deleted"&&(Z.isLocked=!1,Z.disabled=!0),M=="unarchived"&&(Z.isArchived=!1),(ie=(oe=s.params)==null?void 0:oe.api)==null||ie.redrawRows({rowNodes:[N]}),N.setData(Z),(se=(te=s.params)==null?void 0:te.api)==null||se.redrawRows({rowNodes:[N]})}},f=fd(),{openSceneHub:p}=f,g=()=>{ht(()=>{var B,z,oe,ie,te,se;const M=((z=(B=s.params)==null?void 0:B.node)==null?void 0:z.rowIndex)||0,N=((ie=(oe=s.params)==null?void 0:oe.column)==null?void 0:ie.getColId())||"";(se=(te=s.params)==null?void 0:te.api)==null||se.setFocusedCell(M,N)})};X(()=>{var N,B;const M=(B=(N=s.params)==null?void 0:N.api)==null?void 0:B.getRowNode(String(s.id));return M==null?void 0:M.data});const{options:v}=PJ(d,h,u,p,g),w=n,S=()=>{var M,N,B,z,oe,ie;console.trace("Focusing current cell for row:",s.id),(ie=(M=s.params)==null?void 0:M.api)==null||ie.setFocusedCell(((B=(N=s.params)==null?void 0:N.node)==null?void 0:B.rowIndex)||0,((oe=(z=s.params)==null?void 0:z.column)==null?void 0:oe.getColId())||"")},b=X(()=>{var M;return(M=s.params)==null?void 0:M.api}),y=(M,N)=>{var B,z,oe,ie,te,se,Z,P;if(w("actionExecuted",M),M.id=="copy-link"){(te=b.value)==null||te.startEditingCell({rowIndex:(z=(B=s.params)==null?void 0:B.node)==null?void 0:z.rowIndex,colKey:(ie=(oe=s.params)==null?void 0:oe.column)==null?void 0:ie.getColId()});return}else{if(M.id!=="copy-link"&&((se=b.value)==null||se.stopEditing()),M.id==="rename")(Z=b.value)==null||Z.stopEditing(),(P=b.value)==null||P.clearFocusedCell(),l();else if(M.id==="copy-link"){const j=document.getElementById(N);setTimeout(()=>{var ne,ge,xe;(xe=(ge=(ne=j==null?void 0:j.__vueParentComponent)==null?void 0:ne.exposed)==null?void 0:ge.focus)==null||xe.call(ge)},300)}else if(["delete-rendition","delete-thumbnail"].includes(M.id)){setTimeout(()=>{S()},300);return}setTimeout(()=>{var j,ne;(ne=(j=s.params)==null?void 0:j.api)==null||ne.clearFocusedCell()},300)}},E=()=>{var M,N;(N=(M=s.params)==null?void 0:M.api)==null||N.stopEditing()},_=M=>{var N,B,z,oe;return M==="archive"?!((B=(N=s.params)==null?void 0:N.data)!=null&&B.isArchived):M==="unarchive"?(oe=(z=s.params)==null?void 0:z.data)==null?void 0:oe.isArchived:!0},I=X(()=>v.value.map(M=>({...M,options:M.options.filter(N=>!N.hide&&_(N.id))})).filter(M=>M.options.length>0)),T=$({}),F=$(null),V=X(()=>{var N,B;if(s.focusableIndex)return s.focusableIndex;const M=(B=(N=s.params)==null?void 0:N.api)==null?void 0:B.getRowNode(String(s.id));return`${((M==null?void 0:M.rowIndex)??0)+10}`}),x=(M,N)=>`${V.value}.${M*10+N}`,A=(M,N)=>{if(N&&"focus"in N){T.value[M]=N;return}delete T.value[M]},k=M=>{M.preventDefault(),M.stopPropagation(),M.stopImmediatePropagation()};return Zt(()=>{var M;(M=F.value)==null||M.focus()}),t({focus(){var B;const M=`${V.value}.0`,N=T.value[M];N&&N.focus?N.focus():(B=F.value)==null||B.focus()}}),(M,N)=>ze((q(),de("div",{onKeydown:k,class:le([M.$style["more-option-section"],{[M.$style.submenu]:e.isSubmenu}]),ref_key:"wrapperRef",ref:F,tabindex:"0",role:"menu"},[(q(!0),de(Pt,null,xn(I.value,(B,z)=>(q(),de("div",{key:B.id,style:hn({"--g-number":Math.min(B.options.length,4),"--g-size":B.type==="column"?"36px":"auto"}),class:le([M.$style["option-block"],M.$style[B.type]])},[(q(!0),de(Pt,null,xn(B.options,(oe,ie)=>(q(),de("div",{key:oe.id,class:le(M.$style["option-item"])},[ye($se,{layer:s.layer,"scene-id":String(s.id),option:oe,type:B.type,onActionExecuted:te=>y(te,`more-action-${te.id}-${s.id}`),focusableIndex:x(z,ie),ref_for:!0,ref:te=>A(x(z,ie),te),onHandleHide:E,id:`more-action-${oe.id}-${s.id}`,label:oe.label},null,8,["layer","scene-id","option","type","onActionExecuted","focusableIndex","id","label"])],2))),128))],6))),128))],34)),[[L(o),V.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"}}]]),Bse={key:0,style:{height:"20px",width:"20px",display:"flex","align-items":"center","justify-content":"center"}},$se=_t(nt({__name:"MoreOptionItem",props:{option:{},sceneId:{},type:{},layer:{},focusableIndex:{}},emits:["actionExecuted","handleHide"],setup(e,{expose:t,emit:n}){const o=xo,s=Kt,r=e,i=$(!1),a=$(!1),l=(T,F)=>{if(!F){p();return}const V=F.target;V.closest(".tippy-content")||V.closest(".tippy-box")||V.closest("[data-tippy-root]")||V.closest(".option-item")||p()},u=$(null),{triggerRef:c,popupRef:d,show:h,isVisible:f,hide:p}=yo({toggleOnClick:!0,interactive:!0,trigger:"click",placement:"left",showArrow:!1,offset:[0,4],hideOnClick:!1,allowHTML:!0,onClickOutside:l,appendTo:u.value||void 0}),g=n,v=async T=>{var F,V;if(!a.value){a.value=!0;try{await((V=(F=r.option).action)==null?void 0:V.call(F,T)),g("actionExecuted",r.option)}catch(x){console.error("Action execution failed:",x)}finally{a.value=!1,i.value=!1}}},w=async T=>{var F,V;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((V=(F=r.option).action)==null?void 0:V.call(F,T)),g("actionExecuted",r.option)}catch(x){console.error("Action execution failed:",x)}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",E=T=>{const F=r.option.isDanger?["danger","tertiary"]:[];return{row:["secondary","icon",...F],column:["menu-item",...F],block:["secondary",...F]}[T]||[]},_=()=>{i.value?i.value=!1:f.value?p():g("handleHide")};t({focus:()=>{ht(()=>{c.value instanceof HTMLElement?c.value.focus():c.value&&"$el"in c.value?c.value.$el.focus():console.warn("Trigger ref is not an HTMLElement:",c.value)})},escape:()=>{p()},select:()=>{w(new MouseEvent("click"))}});const I=T=>{var F;T.stopPropagation(),T.preventDefault(),i.value=!1,(F=c.value)==null||F.focus()};return(T,F)=>{var V;return ze((q(),de("div",{ref_key:"wrapperRef",ref:u,class:le(T.$style["option-item-wrapper"]),style:{width:"100%",overflow:"visible"},onClick:Ht(w,["stop","prevent"])},[ze((q(),Ke(St,{ref_key:"triggerRef",ref:c,class:le(T.$style["option-item"]),disabled:e.option.disabled||a.value,actived:L(f)||i.value,size:y(e.type),variant:E(e.type),onClick:Ht(w,["stop","prevent"]),onKeydown:b,onEscape:_,label:e.option.label},{prefix:we(()=>[e.option.icon?(q(),de("div",Bse,[ye(pt,{size:"14",src:e.option.icon,color:e.option.isDanger?void 0:"#a6a6a6",source:"remote"},null,8,["src","color"])])):Ye("",!0)]),suffix:we(()=>[e.option.subMenu?(q(),Ke(pt,{key:0,src:"Play",source:"remote"})):Ye("",!0),e.option.isDanger&&i.value?(q(),de("div",{key:1,class:le(T.$style["confirm-action"])},[ze((q(),Ke(St,{variant:["tertiary","icon","danger"],size:"small",onHandleClick:I},{default:we(()=>[ye(pt,{src:"XMarkSolid",source:"remote"})]),_:1})),[[L(o),`${r.focusableIndex}.0`],[L(s),{content:"Cancel ",delay:[300,0],contentClass:["extra-padding"]}]]),ze((q(),Ke(St,{variant:["danger","primary","icon"],size:"small",onClick:Ht(v,["stop","prevent"]),onEscape:F[0]||(F[0]=x=>i.value=!1)},{default:we(()=>[ye(pt,{src:"Check",source:"remote"})]),_:1})),[[L(o),`${r.focusableIndex}.1`],[L(s),{delay:[300,0],contentClass:["extra-padding"],content:"Confirm ",theme:"warning"}]])],2)):Ye("",!0)]),_:1},8,["class","disabled","actived","size","variant","label"])),[[L(o),r.focusableIndex]]),e.option.subMenu?(q(),de("div",{key:0,ref_key:"popupRef",ref:d,class:le(T.$style["submenu-container"])},[ye(UN,{focusableIndex:r.focusableIndex,layer:r.layer+1,ref:"submenuRef","option-block":[((V=e.option)==null?void 0:V.subMenu)||[]],"is-submenu":!1,onActionExecuted:S},null,8,["focusableIndex","layer","option-block"])],2)):Ye("",!0)],2)),[[L(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"}}]]),WN=(e,t)=>{const n=$(Number(e.value.value)),o=X(()=>e.value.metricConfig),s=X(()=>{var g,v;const l=o.value,u=t.value,c=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"||c&&((g=l==null?void 0:l.metric_type)==null?void 0:g.code)==="formula",isEmpty:c,isError:d,hasPrefix:!c&&!d&&(l==null?void 0:l.morpheme_type)==="prefix",hasSuffix:!c&&!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:u&&!c&&!f}}),r=17,i=X(()=>{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 u;return(((u=o.value)==null?void 0:u.format_symbol)||"BoltSolid").split(/[\s-_]+/).map(c=>c.charAt(0).toUpperCase()+c.slice(1)).join("").replace(/Outline|Solid/g,"")},internalValue:n}},Hse=["aria-label"],zN=_t(nt({name:"MetricRenderer",__name:"MetricRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean},error:{type:Boolean},config:{}},emits:["update:value","clear","copy"],setup(e,{emit:t}){const n=Bs,o=Kt,s=e,r=xh(!1),i=$(null),a=$(null),{isEditing:l}=ld(s),u=X(()=>{var N,B;return{value:s.value,metricConfig:((B=(N=s.params)==null?void 0:N.colDef)==null?void 0:B.context)||s.config,error:s.error,hovered:r.value,readOnly:s.readOnly,disabled:s.disabled,active:l}}),{componentState:c,metricConfig:d,internalValue:h}=WN(u,r),f=X(()=>{var B,z;let N=!1;if(["number","formula"].includes(d.value.metric_type.code)){const oe=Number(s.value),ie=Number((B=d.value)==null?void 0:B.format_value);Number.isFinite(ie)&&ie>=0&&(N=(((z=oe.toString().split(".")[1])==null?void 0:z.length)||0)>ie)}return N}),p=X(()=>{var N;return!!((N=d.value)!=null&&N.morpheme_value)||c.value.isEmpty||f.value}),g=X(()=>{var z,oe,ie;if(c.value.isError)return"Something went wrong. Review formula, inputs and retry.";if(c.value.pendingCalculation)return"Can’t calculate yet. Complete required fields.";if(c.value.isEmpty)return;const N=F.value,B=(z=d.value)==null?void 0:z.morpheme_type;return B==="prefix"?`${((oe=d.value)==null?void 0:oe.morpheme_value)||""} ${N}`.trim():B==="suffix"?`${N} ${((ie=d.value)==null?void 0:ie.morpheme_value)||""}`.trim():N}),v=X(()=>{const{format_type:N,format_value:B}=d.value;if(N==="dropdown"&&typeof B=="string"&&B.startsWith("["))try{return JSON.parse(B)}catch{return[]}return[]}),w=X(()=>({disabled:s.disabled,error:c.value.isError,inputRef:i,wrapperRef:a,clickable:!T.value,readOnly:s.readOnly||T.value,isEmpty:c.value.isEmpty})),{argsMain:S,isHover:b}=Ao(w),y=(N,B,z="en-US")=>new Intl.NumberFormat(z,{minimumFractionDigits:B,maximumFractionDigits:B}).format(N),E=X(()=>{if(c.value.isEmpty)return"";if(c.value.pendingCalculation)return"pending";const N=s.value,{format_type:B,format_value:z,mapping:oe}=d.value;if(oe&&typeof oe=="object"&&!Array.isArray(oe)){const ie=oe[`!${N}`];if(ie)return ie}if(B==="dropdown"){const ie=v.value.find(te=>String(te.name)===String(N));if(ie)return ie.name}if(typeof N=="string"){const ie=Number(N);return Number.isNaN(ie)?N:N.replace(/[.-]/g,"").length>16?_(N,z):_(ie,z)}return typeof N=="number"?_(N,z):String(N)}),_=(N,B)=>{const z=Number.parseInt(String(B)||"2",10),oe=Number.isFinite(z)&&z>=0?z:2;try{if(typeof N=="string"){const ie=N.split("."),te=ie[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),se=ie[1]?ie[1].substring(0,oe).padEnd(oe,"0"):"0".repeat(oe);return oe>0?`${te}.${se}`:te}return y(N,oe)}catch(ie){return console.error("Error formatting metric value:",ie,{num:N,decimals:oe}),String(N)}},I=(N,B)=>{const z=Number.parseInt(String(B)||"2",10),oe=Number.isFinite(z)&&z>=0?z:2;try{if(typeof N=="string"){const ie=N.split("."),te=ie[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),se=ie[1]?ie[1].length:0,Z=Math.max(oe,se),P=ie[1]?ie[1].padEnd(Z,"0"):"0".repeat(Z);return Z>0?`${te}.${P}`:te}return new Intl.NumberFormat("en-US",{minimumFractionDigits:oe,maximumFractionDigits:20}).format(N)}catch(ie){return console.error("Error formatting exact metric value:",ie,{num:N,decimals:oe}),String(N)}},T=X(()=>{var N;return((N=d.value)==null?void 0:N.metric_type.code)==="formula"}),F=X(()=>{if(c.value.isEmpty)return"";if(c.value.pendingCalculation)return"pending";const N=s.value,{format_type:B,format_value:z,mapping:oe}=d.value;if(oe&&typeof oe=="object"&&!Array.isArray(oe)){const ie=oe[`!${N}`];if(ie)return ie}if(B==="dropdown"){const ie=v.value.find(te=>String(te.name)===String(N));if(ie)return ie.name}if(typeof N=="string"){const ie=Number(N);return Number.isNaN(ie)?N:N.replace(/[.-]/g,"").length>16?I(N,z):I(ie,z)}return typeof N=="number"?I(N,z):String(N)}),{tooltip:V}=IO(""),x=async N=>{N.stopPropagation(),N.preventDefault(),N.stopImmediatePropagation();try{await navigator.clipboard.writeText(F.value),V.value="Copied",setTimeout(()=>{V.value="Copy"},3e3)}catch(B){console.error("Failed to copy text:",B),V.value="Copy failed",setTimeout(()=>{V.value="Copy"},3e3)}};Je(()=>s.value,(N,B)=>{const z=Number(N);Number.isFinite(z)&&z!==h.value?h.value=z:N==null&&h.value!==0&&(h.value=0)},{immediate:!0,deep:!0});const k=()=>{r.value=!0},M=()=>{r.value=!1};return(N,B)=>ze((q(),Ke(Lo,jt(L(S),{onMouseenter:k,style:{"--icon-size":"24px"},onMouseleave:M,ref_key:"wrapperRef",ref:a,actived:L(l),bordered:!0}),{suffix:we(()=>[s.disabled?Ye("",!0):(q(),de("div",{key:0,class:le([N.$style.suffix,"wrapper-suffix"])},[r.value&&!L(c).isEmpty&&!L(c).isError?ze((q(),Ke(St,{key:0,variant:["icon","secondary"],size:24,onClick:Ht(x,["prevent","stop"])},{default:we(()=>[ye(pt,{src:"Copy",source:"remote",size:12})]),_:1})),[[L(o),{content:L(V),hideOnClick:!1,contentClass:"extra-padding"}]]):Ye("",!0)],2))]),default:we(()=>[Se("div",{class:le(N.$style["metric-wrapper"]),"aria-label":L(d).format_value||void 0},[Se("div",{class:le([N.$style["metric-content"],s.disabled?N.$style.disabled:""])},[!L(c).isError&&L(c).isEmpty?(q(),de(Pt,{key:0},[L(c).pendingCalculation?ze((q(),de("span",{key:0,class:le(N.$style["metric-empty"])},[...B[0]||(B[0]=[tt(" - ",-1)])],2)),[[L(o),"Can’t calculate yet. Complete required fields."]]):L(c).isEmpty?(q(),de("span",{key:1,class:le(N.$style["metric-empty"])}," - ",2)):Ye("",!0)],64)):Ye("",!0),L(c).isError?ze((q(),de("div",{key:1,class:le(N.$style["metric-error"])},[...B[1]||(B[1]=[tt(" Error ",-1)])],2)),[[L(o),"Something went wrong. Review formula, inputs and retry."]]):Ye("",!0),!L(c).isEmpty&&!L(c).isError?ze((q(),de("span",{key:2,class:le([N.$style["metric-value"],L(b)?N.$style.hovered:"",{[N.$style.disabled]:s.disabled}])},[tt(it(E.value),1)],2)),[[L(o),{content:g.value,bypassOverflowCheck:p.value}]]):Ye("",!0)],2)],10,Hse)]),_:1},16,["actived"])),[[L(n),{isLoading:L(c).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"}}]]),Gse={key:0,style:{color:"#6b6b6b"}},Use=_t(nt({__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,u={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"},c=X(()=>{var M,N;if(l.headerType)return l.headerType;if(((N=(M=l.params)==null?void 0:M.column)==null?void 0:N.getColId()).includes("metric"))return"default";const k=l.headerType??l.params.column.getColId();return u[k]||"default"}),d=$(),h=()=>{var k,M,N;const A=(M=(k=l.params)==null?void 0:k.column)==null?void 0:M.getColDef();if((N=A.colId)!=null&&N.includes("metric")){if(A.context.is_primary==1)return"primary";if(A.context.is_point_metric==1)return"secondary"}};$h(()=>{d.value=h()}),Zt(()=>{d.value=h()});const f=X(()=>{var A,k;return((k=(A=l.params)==null?void 0:A.column.getColDef().context)==null?void 0:k.morpheme_value)||void 0}),p=X(()=>{var A;return(A=l.params)==null?void 0:A.displayName}),g=X(()=>{let A=[];switch(c.value){case"dateRange":A=Object.values(s).map(k=>({...k,selected:w.value===k.value,type:"text",hover:T.value===k.value}));break;case"date":A=Object.values(r).map(k=>({...k,selected:w.value===k.value,type:"text",hover:T.value===k.value}));break;case"number":A=Object.values(i).map(k=>({...k,selected:w.value===k.value,type:"text",hover:T.value===k.value}));break;default:A=Object.values(a).map(k=>({...k,selected:w.value===k.value,type:"text",hover:T.value===k.value}));break}return w.value!=="none"&&A.push({id:"clear",label:"Clear",value:"none",selected:!1,type:"text",icon:"XMark",hover:T.value=="none"}),A}),v=X(()=>String(w.value).endsWith("asc")?"SortUp":String(w.value).endsWith("desc")?"SortDown":"Sort"),w=$(l.modelValue??"none"),S=A=>{if(x.value){x.value=!1;return}_("update:modelValue",A),_("sort-changed",A)},b=A=>{w.value=A},y=wr(()=>{if(c.value==="date"||c.value==="default"||c.value==="number"){let A;w.value==="none"?A="asc":w.value==="asc"?A="desc":A="none",w.value=A}else{const A=[s.START_ASC.value,s.START_DESC.value,s.DUE_ASC.value,s.DUE_DESC.value,"none"],M=(A.indexOf(w.value)+1)%A.length;w.value=A[M]}},Si),E=X(()=>{if(w.value==="none")return"No sorting applied";const A=g.value.find(k=>k.value===w.value);return(A==null?void 0:A.label)||""}),_=n,I=X(()=>{if(l.disabled&&!l.readOnly)return"var(--disabled-color)";if(w.value!=="none")return"var(--primary-color-hover)"});Je(()=>l.modelValue,A=>{A!=w.value&&(w.value=A)}),Je(w,A=>{A!==l.modelValue&&S(A)});const T=$(w.value);Je(()=>w.value,A=>{T.value=A});const F=A=>{var B,z;if(l.readOnly||l.disabled)return;let k=0;A.key==="ArrowDown"?k=1:A.key==="ArrowUp"&&(k=-1);const M=g.value.findIndex(oe=>oe.value===T.value),N=g.value.length;if(A.key==="Enter"||A.key===" ")A.preventDefault(),w.value=T.value,(B=V.value)==null||B.hide();else if(k!==0){A.preventDefault();let oe=(M+k+N)%N;T.value=g.value[oe].value}else A.key==="Escape"&&((z=V.value)==null||z.hide())},V=$(null);Zt(()=>{var A,k;(k=(A=V.value)==null?void 0:A.$el)==null||k.addEventListener("keydown",F)}),nu(()=>{var A,k;(k=(A=V.value)==null?void 0:A.$el)==null||k.removeEventListener("keydown",F)});const x=$(!1);return t({setDefaultSort:A=>{w.value=A?A.direction:"none",x.value=!0},clear:()=>{w.value="none"}}),(A,k)=>(q(),Ke(u0,{ref_key:"dropdownRef",ref:V,options:g.value,label:p.value,readOnly:l.readOnly,onOpen:k[0]||(k[0]=M=>A.$emit("open")),disabled:l.disabled,variant:["icon","tertiary"],size:"small",onHandleClick:L(y),onSelect:k[1]||(k[1]=M=>b(M))},{prefix:we(()=>[ye(St,{variant:["text"],onClick:L(y),size:"small"},{default:we(()=>[ze((q(),de("b",null,[tt(it(p.value),1)])),[[L(o),{content:p.value}]]),f.value?(q(),de("small",Gse," ("+it(f.value)+") ",1)):Ye("",!0),d.value=="primary"?ze((q(),de("div",{key:1,class:le(A.$style["icon-metric"])},[ye(pt,{src:"ChartPie",color:"#A6A6A6",size:"14"})],2)),[[L(o),"Woohoo metric"]]):Ye("",!0),d.value=="secondary"?ze((q(),de("div",{key:2,class:le(A.$style["icon-metric"])},[ye(pt,{src:"Bullseye",color:"#A6A6A6",size:"14"})],2)),[[L(o),"Point Metric"]]):Ye("",!0)]),_:1},8,["onClick"])]),iconDropdown:we(()=>[ze(ye(pt,{src:v.value,source:"remote",color:I.value},null,8,["src","color"]),[[L(o),E.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"}}]]),Wse=["disabled","readonly","checked","indeterminate"],jN=_t(nt({__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=xo,s=e,r=t,i=X(()=>{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=X(()=>s.allowIndeterminate?[Ot.UNCHECK,Ot.INDETERMINATE,Ot.CHECKED]:[Ot.UNCHECK,Ot.CHECKED]),l=X(()=>{if(typeof s.tooltipText=="string"||!s.tooltipText)return s.tooltipText||"";switch(c.value){case Ot.UNCHECK:return s.tooltipText.unchecked;case Ot.INDETERMINATE:return s.tooltipText.indeterminate;case Ot.CHECKED:return s.tooltipText.checked;default:return""}}),u=()=>{if(h.value)return;const p=(a.value.indexOf(c.value)+1)%a.value.length;c.value=a.value[p]},c=$(typeof s.modelValue=="boolean"?s.modelValue?Ot.CHECKED:Ot.UNCHECK:s.modelValue),d=X(()=>({checked:c.value===Ot.CHECKED,indeterminate:c.value===Ot.INDETERMINATE,none:c.value===Ot.UNCHECK})),h=X(()=>s.disabled||s.readOnly);return Je(()=>c.value,f=>{r("update:modelValue",f===Ot.CHECKED)}),(f,p)=>ze((q(),de("input",{disabled:s.disabled,key:c.value,readonly:s.readOnly,type:"checkbox",class:le([f.$style["input-checkbox"]]),checked:d.value.checked,indeterminate:d.value.indeterminate,onChange:u,"aria-label":"Select All Items",style:hn({"--input-size":i.value})},null,46,Wse)),[[L(n),{content:l.value,hideOnClick:!1,contentClass:"extra-padding"}],[L(o),s.focusIndex]])}}),[["__cssModules",{$style:{small:"_small_1kz1e_84",large:"_large_1kz1e_87",medium:"_medium_1kz1e_90"}}]]),zse=_t(nt({name:"HeaderCheckbox",__name:"HeaderCheckbox",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean}},setup(e){const t=e,n=Kt,o=Gf(),{setSelectionStatus:s}=o,{rowCount:r,selectionStatus:i}=mo(o),a=$(new Set);Je(i,y=>{s(y)},{immediate:!0});const l=X(()=>i.value!==Ot.UNCHECK),u=X(()=>({checked:i.value===Ot.CHECKED,indeterminate:i.value===Ot.INDETERMINATE,UNCHECK:i.value===Ot.UNCHECK})),c=X(()=>({[Ot.UNCHECK]:"Click to select all",[Ot.INDETERMINATE]:"Click to clear selection",[Ot.CHECKED]:"Click to clear selection"})[i.value]||"Select items"),d=X(()=>{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:E})=>{if(y)if(E===Ot.UNCHECK)y.deselectAll(),a.value.clear(),i.value=E;else if(E===Ot.CHECKED){const _=new Set;y.forEachNode(I=>{I.isSelected()&&_.add(I.id||"")}),a.value=_,y.forEachNode(I=>I.setSelected(!0)),i.value=E}else y.forEachNode(_=>_.setSelected(!0)),i.value=E},p=()=>{var _;const y=(_=t.params)==null?void 0:_.api;if(!y){console.error("[HeaderCheckbox] There is no API available");return}const E={[Ot.UNCHECK]:Ot.INDETERMINATE,[Ot.INDETERMINATE]:Ot.UNCHECK,[Ot.CHECKED]:Ot.UNCHECK};f({api:y,state:E[i.value]})},g=y=>{var I;const E=(I=t.params)==null?void 0:I.api;if(!E){console.error("no api");return}const _={INDETERMINATE:Ot.INDETERMINATE,GLOBAL:Ot.CHECKED,UNCHECK:Ot.UNCHECK};f({api:E,state:_[y]})},v=wr(y=>{const{selected:E,total:_}=h(y);if(_==0){i.value=Ot.UNCHECK;return}E===_?i.value=Ot.CHECKED:E===0?i.value=Ot.UNCHECK:i.value=Ot.INDETERMINATE},300);let w=[];const S=y=>{v(y)};Zt(()=>{var T;const y=(T=t.params)==null?void 0:T.api;if(!y)return;const E=F=>v(F.api),_=()=>S(y),I=()=>S(y);y.addEventListener("selectionChanged",E),y.addEventListener("rowDataUpdated",_),y.addEventListener("modelUpdated",_),w=[()=>y.removeEventListener("selectionChanged",E),()=>y.removeEventListener("rowDataUpdated",_),()=>y.removeEventListener("modelUpdated",I)]}),Vn(()=>{w.forEach(y=>y())});const b=`header-checkbox-${Math.random().toString(36).substr(2,9)}`;return(y,E)=>(q(),Ke(u0,{tabIndex:"9",options:d.value,size:24,disabled:t.disabled,readOnly:t.readOnly,variant:["icon","tertiary"],placement:"bottom-start",onSelect:g},{prefix:we(()=>[ze((q(),Ke(jN,{"tab-index":"8",id:b,disabled:t.disabled,key:L(i),readonly:t.readOnly,type:"checkbox",checked:u.value.checked,indeterminate:u.value.indeterminate,modelValue:L(i),"onUpdate:modelValue":E[0]||(E[0]=_=>mn(i)?i.value=_:null),onChange:p,"aria-label":L(i)===L(Ot).CHECKED?"All items selected":"Select visible items",class:le(y.$style["ag-checkbox-input"])},null,8,["disabled","readonly","checked","indeterminate","modelValue","aria-label","class"])),[[L(n),{content:c.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"}}]]),jse={style:{color:"#a6a6a6"}},KN=_t(nt({name:"StatusRenderer",__name:"StatusRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean},focusIndex:{},placeholder:{default:"No status"}},setup(e,{expose:t}){const n=Bs,o=Kt,s=e,{isEditing:r}=ld(s),i=$(null),a=$(null),l=X(()=>s.value),u=X(()=>l.value===void 0),c=X(()=>{var v,w;return((v=l.value)==null?void 0:v.name)||((w=l.value)==null?void 0:w.label)||"No status"}),d=X(()=>{var v;return{disabled:s.disabled,error:!1,readOnly:s.readOnly,isEmpty:uX((v=l.value)==null?void 0:v.label),inputRef:i,wrapperRef:a,clickable:!s.disabled&&!s.readOnly,active:r}}),{argsMain:h,isHover:f}=Ao(d),p=X(()=>{var v;return((v=l.value)==null?void 0:v.color)||"#fff"}),g=X(()=>new Bn(p.value).isLight()?"#000":"#fff");return t({focus:()=>{var v;(v=a.value)==null||v.focus()}}),(v,w)=>{const S=Sc("focusable");return ze((q(),Ke(L(Lo),jt(L(h),{ref_key:"wrapperRef",ref:a,bordered:!0,style:{background:`${p.value} !important`,color:g.value,"--border-color":!L(r)&&!L(f)||!l.value?"#f3f5f8":void 0}}),{default:we(()=>[u.value?Ye("",!0):(q(),de("div",{key:0,class:le({[v.$style["status-renderer"]]:!0,[v.$style["has-status"]]:l.value,[v.$style["has-suffix"]]:!!v.$slots.suffix})},[l.value?(q(),de(Pt,{key:0},[ze((q(),de("div",{class:le(v.$style["status-renderer__status-name"])},[tt(it(c.value),1)],2)),[[L(o),{content:c.value,delay:[1e3,0]}]]),kt(v.$slots,"suffix")],64)):(q(),de(Pt,{key:1},[Se("div",{class:le(v.$style["status-renderer__color-code"])},null,2),Se("span",jse,it(s.placeholder),1),kt(v.$slots,"suffix")],64))],2))]),_:3},16,["style"])),[[S,s.focusIndex],[L(n),{isLoading:u.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"}}]]),qN=_t(nt({__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=X(()=>Number(o.popupIndex)),{popupRef:r,show:i,hide:a,isVisible:l}=IJ({useTrigger:!1,arrow:!1,centered:!0,showOverlay:o.showOverlay,overlayOpacity:o.overlayOpacity,closeOnOverlayClick:o.closeOnOverlayClick,appendTo(d){return document.body},zIndex:s.value}),u=d=>{o.closeOnEscape&&d.key==="Escape"&&l.value&&a()};Zt(()=>{document.addEventListener("keydown",u)}),Vn(()=>{document.removeEventListener("keydown",u)}),t({show:i,hide:a,isVisible:l});const c=n;return Je(()=>l.value,d=>{c(d?"shown":"hidden")}),(d,h)=>{const f=Sc("tooltip");return q(),de("div",{ref_key:"popupRef",ref:r,class:le(d.$style.popupContainer)},[Se("div",{class:le(d.$style.popupWrapper)},[Se("div",{class:le(d.$style.header)},[kt(d.$slots,"header",{},()=>[Se("span",{class:le(d.$style["header-title"])},it(e.popupName),3)]),o.showCloseBtn?ze((q(),Ke(St,{key:0,variant:["icon","text"],onClick:L(a),"aria-label":"Close popup",size:"small"},{default:we(()=>[ye(pt,{src:"Xmark",size:8})]),_:1},8,["onClick"])),[[f,"Close"]]):Ye("",!0)],2),Se("div",{class:le(d.$style.body)},[kt(d.$slots,"default")],2),d.$slots.footer?(q(),de("div",{key:0,class:le(d.$style.footer)},[kt(d.$slots,"footer")],2)):Ye("",!0)],2)],2)}}}),[["__cssModules",{$style:{popupContainer:"_popupContainer_1qqwg_1",popupWrapper:"_popupWrapper_1qqwg_9",popupFadeIn:"_popupFadeIn_1qqwg_1",header:"_header_1qqwg_24","header-title":"_header-title_1qqwg_34",body:"_body_1qqwg_43",footer:"_footer_1qqwg_48"}}]]),Kse=["onMouseenter","onMouseleave"],qse=["innerHTML"],Yse=["innerHTML"],Xse=["data-tooltip"],Zse={key:2,style:{"min-width":"24px","min-height":"24px",position:"absolute",top:"0",right:"0",display:"flex","align-items":"center","justify-content":"center"}},Jse=_t(nt({__name:"Snackbar",setup(e){const t=Kt,n=l5,o=_s(),{removeNotification:s}=o,{notifications:r}=mo(o),i=f=>f.trim().startsWith("<svg"),a=$("Copy"),l=()=>{setTimeout(()=>{a.value="Copy"},3e3)},u=f=>{navigator.clipboard.writeText(f).then(()=>{a.value="Copied",l()},()=>{a.value="Copy failed",l()})},c=$(new Set),d=f=>{var p;c.value.add(f),(p=o.pauseAutoDismiss)==null||p.call(o,f)},h=f=>{var p;c.value.delete(f),(p=o.resumeAutoDismiss)==null||p.call(o,f)};return(f,p)=>(q(),Ke(v3,{name:"list",tag:"div",class:le(["notification-center",f.$style["notification-wrapper"]])},{default:we(()=>[(q(!0),de(Pt,null,xn(L(r),g=>{var v;return ze((q(),de("div",{key:g.id,class:le([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:w=>d(g.id),onMouseleave:w=>h(g.id)},[Se("p",{class:le(f.$style.snackbar__message)},[g.type!="white"?(q(),de("span",{key:0,class:le(f.$style.snackbar__icon)},[!g.icon&&g.type=="success"?(q(),Ke(pt,{key:0,src:"CircleCheck",source:"remote"})):Ye("",!0),!g.icon&&g.type=="interactive"?(q(),Ke(pt,{key:1,src:"CircleCheck",source:"remote"})):!g.icon&&g.type=="error"?(q(),Ke(pt,{key:2,src:"CircleXMark",source:"remote"})):g.icon&&i(g.icon)?(q(),de("i",{key:3,class:le(f.$style["icon-draw"]),innerHTML:g.icon},null,10,qse)):g.icon&&!i(g.icon)?(q(),Ke(pt,{key:4,src:g.icon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Ye("",!0)],2)):Ye("",!0),Se("span",{class:le(f.$style["error-message"])},[Se("span",{class:le(f.$style.message),innerHTML:g.message},null,10,Yse)],2)],2),g.actions?(q(),de("div",{key:0,class:le(f.$style["actions-notification"]),"data-notification":"true"},[(q(!0),de(Pt,null,xn(g.actions,w=>(q(),Ke(St,jt({key:w.label},{ref_for:!0},w,{onClick:Ht(w.action,["prevent","stop"]),variant:"secondary",size:"small"}),{prefix:we(()=>[w.btnIcon?(q(),Ke(pt,{key:0,src:w.btnIcon,source:"remote",color:"var(--primary-color)"},null,8,["src"])):Ye("",!0)]),_:2},1040,["onClick"]))),128))],2)):Ye("",!0),g.type!=="interactive"&&g.type!=="white"?ze((q(),de("div",{key:1,"data-tooltip":a.value,style:{"min-width":"24px"}},[ye(St,{variant:"secondary",onClick:w=>u(g.message),class:le(f.$style["copy-btn"])},{prefix:we(()=>[ye(pt,{src:"Copy",source:"remote",color:"var(--primary-color)",size:"11"})]),_:1},8,["onClick","class"])],8,Xse)),[[L(t),a.value]]):Ye("",!0),g.type=="interactive"?ze((q(),de("div",Zse,[ye(St,{variant:"tertiary",onClick:w=>L(s)(g.id),class:le(f.$style["close-btn"]),size:18},{default:we(()=>[ye(pt,{src:"XMarkSolid",size:"9"})]),_:1},8,["onClick","class"])])),[[L(t),"Close"]]):Ye("",!0)],42,Kse)),[[L(n)]])}),128))]),_:1},8,["class"]))}}),[["__cssModules",{$style:{"notification-wrapper":"_notification-wrapper_1gnza_1","notification-item":"_notification-item_1gnza_15","notification--success":"_notification--success_1gnza_30","notification--error":"_notification--error_1gnza_36","close-btn":"_close-btn_1gnza_42","notification--info":"_notification--info_1gnza_45","notification--warning":"_notification--warning_1gnza_52","notification--interactive":"_notification--interactive_1gnza_59","notification--white":"_notification--white_1gnza_67","snackbar-type":"_snackbar-type_1gnza_75",snackbar__message:"_snackbar__message_1gnza_84",message:"_message_1gnza_97","error-message":"_error-message_1gnza_105",snackbar__icon:"_snackbar__icon_1gnza_111","actions-notification":"_actions-notification_1gnza_120","icon-draw":"_icon-draw_1gnza_128","copy-btn":"_copy-btn_1gnza_136"}}]]);/*!
160
160
  * vue-draggable-next v2.3.0
161
161
  * (c) 2025 Anish George
162
162
  * @license MIT
@@ -165,7 +165,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
165
165
  * @author RubaXa <trash@rubaxa.org>
166
166
  * @author owenm <owen23355@gmail.com>
167
167
  * @license MIT
168
- */function ZN(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 Ri(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZN(Object(n),!0).forEach(function(o){ore(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZN(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function iy(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?iy=function(t){return typeof t}:iy=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},iy(e)}function ore(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sa(){return Sa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Sa.apply(this,arguments)}function sre(e,t){if(e==null)return{};var n={},o=Object.keys(e),s,r;for(r=0;r<o.length;r++)s=o[r],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function rre(e,t){if(e==null)return{};var n=sre(e,t),o,s;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var ire="1.14.0";function Ea(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var _a=Ea(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),ap=Ea(/Edge/i),JN=Ea(/firefox/i),lp=Ea(/safari/i)&&!Ea(/chrome/i)&&!Ea(/android/i),QN=Ea(/iP(ad|od|hone)/i),are=Ea(/chrome/i)&&Ea(/android/i),eL={capture:!1,passive:!1};function wn(e,t,n){e.addEventListener(t,n,!_a&&eL)}function gn(e,t,n){e.removeEventListener(t,n,!_a&&eL)}function ay(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function lre(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function Ti(e,t,n,o){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&ay(e,t):ay(e,t))||o&&e===n)return e;if(e===n)break}while(e=lre(e))}return null}var tL=/\s+/g;function Ks(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var o=(" "+e.className+" ").replace(tL," ").replace(" "+t+" "," ");e.className=(o+(n?" "+t:"")).replace(tL," ")}}function Gt(e,t,n){var o=e&&e.style;if(o){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in o)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),o[t]=n+(typeof n=="string"?"":"px")}}function _d(e,t){var n="";if(typeof e=="string")n=e;else do{var o=Gt(e,"transform");o&&o!=="none"&&(n=o+" "+n)}while(!t&&(e=e.parentNode));var s=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return s&&new s(n)}function nL(e,t,n){if(e){var o=e.getElementsByTagName(t),s=0,r=o.length;if(n)for(;s<r;s++)n(o[s],s);return o}return[]}function Di(){var e=document.scrollingElement;return e||document.documentElement}function ko(e,t,n,o,s){if(!(!e.getBoundingClientRect&&e!==window)){var r,i,a,l,u,c,d;if(e!==window&&e.parentNode&&e!==Di()?(r=e.getBoundingClientRect(),i=r.top,a=r.left,l=r.bottom,u=r.right,c=r.height,d=r.width):(i=0,a=0,l=window.innerHeight,u=window.innerWidth,c=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(s=s||e.parentNode,!_a))do if(s&&s.getBoundingClientRect&&(Gt(s,"transform")!=="none"||n&&Gt(s,"position")!=="static")){var h=s.getBoundingClientRect();i-=h.top+parseInt(Gt(s,"border-top-width")),a-=h.left+parseInt(Gt(s,"border-left-width")),l=i+r.height,u=a+r.width;break}while(s=s.parentNode);if(o&&e!==window){var f=_d(s||e),p=f&&f.a,g=f&&f.d;f&&(i/=g,a/=p,d/=p,c/=g,l=i+c,u=a+d)}return{top:i,left:a,bottom:l,right:u,width:d,height:c}}}function oL(e,t,n){for(var o=wl(e,!0),s=ko(e)[t];o;){var r=ko(o)[n],i=void 0;if(i=s>=r,!i)return o;if(o===Di())break;o=wl(o,!1)}return!1}function Rd(e,t,n,o){for(var s=0,r=0,i=e.children;r<i.length;){if(i[r].style.display!=="none"&&i[r]!==Ut.ghost&&(o||i[r]!==Ut.dragged)&&Ti(i[r],n.draggable,e,!1)){if(s===t)return i[r];s++}r++}return null}function d0(e,t){for(var n=e.lastElementChild;n&&(n===Ut.ghost||Gt(n,"display")==="none"||t&&!ay(n,t));)n=n.previousElementSibling;return n||null}function Rr(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==Ut.clone&&(!t||ay(e,t))&&n++;return n}function sL(e){var t=0,n=0,o=Di();if(e)do{var s=_d(e),r=s.a,i=s.d;t+=e.scrollLeft*r,n+=e.scrollTop*i}while(e!==o&&(e=e.parentNode));return[t,n]}function ure(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var o in t)if(t.hasOwnProperty(o)&&t[o]===e[n][o])return Number(n)}return-1}function wl(e,t){if(!e||!e.getBoundingClientRect)return Di();var n=e,o=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var s=Gt(n);if(n.clientWidth<n.scrollWidth&&(s.overflowX=="auto"||s.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(s.overflowY=="auto"||s.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return Di();if(o||t)return n;o=!0}}while(n=n.parentNode);return Di()}function cre(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function h0(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var up;function rL(e,t){return function(){if(!up){var n=arguments,o=this;n.length===1?e.call(o,n[0]):e.apply(o,n),up=setTimeout(function(){up=void 0},t)}}}function dre(){clearTimeout(up),up=void 0}function iL(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function aL(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}var qs="Sortable"+new Date().getTime();function hre(){var e=[],t;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var o=[].slice.call(this.el.children);o.forEach(function(s){if(!(Gt(s,"display")==="none"||s===Ut.ghost)){e.push({target:s,rect:ko(s)});var r=Ri({},e[e.length-1].rect);if(s.thisAnimationDuration){var i=_d(s,!0);i&&(r.top-=i.f,r.left-=i.e)}s.fromRect=r}})}},addAnimationState:function(o){e.push(o)},removeAnimationState:function(o){e.splice(ure(e,{target:o}),1)},animateAll:function(o){var s=this;if(!this.options.animation){clearTimeout(t),typeof o=="function"&&o();return}var r=!1,i=0;e.forEach(function(a){var l=0,u=a.target,c=u.fromRect,d=ko(u),h=u.prevFromRect,f=u.prevToRect,p=a.rect,g=_d(u,!0);g&&(d.top-=g.f,d.left-=g.e),u.toRect=d,u.thisAnimationDuration&&h0(h,d)&&!h0(c,d)&&(p.top-d.top)/(p.left-d.left)===(c.top-d.top)/(c.left-d.left)&&(l=pre(p,h,f,s.options)),h0(d,c)||(u.prevFromRect=c,u.prevToRect=d,l||(l=s.options.animation),s.animate(u,p,d,l)),l&&(r=!0,i=Math.max(i,l),clearTimeout(u.animationResetTimer),u.animationResetTimer=setTimeout(function(){u.animationTime=0,u.prevFromRect=null,u.fromRect=null,u.prevToRect=null,u.thisAnimationDuration=null},l),u.thisAnimationDuration=l)}),clearTimeout(t),r?t=setTimeout(function(){typeof o=="function"&&o()},i):typeof o=="function"&&o(),e=[]},animate:function(o,s,r,i){if(i){Gt(o,"transition",""),Gt(o,"transform","");var a=_d(this.el),l=a&&a.a,u=a&&a.d,c=(s.left-r.left)/(l||1),d=(s.top-r.top)/(u||1);o.animatingX=!!c,o.animatingY=!!d,Gt(o,"transform","translate3d("+c+"px,"+d+"px,0)"),this.forRepaintDummy=fre(o),Gt(o,"transition","transform "+i+"ms"+(this.options.easing?" "+this.options.easing:"")),Gt(o,"transform","translate3d(0,0,0)"),typeof o.animated=="number"&&clearTimeout(o.animated),o.animated=setTimeout(function(){Gt(o,"transition",""),Gt(o,"transform",""),o.animated=!1,o.animatingX=!1,o.animatingY=!1},i)}}}}function fre(e){return e.offsetWidth}function pre(e,t,n,o){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*o.animation}var Td=[],f0={initializeByDefault:!0},cp={mount:function(t){for(var n in f0)f0.hasOwnProperty(n)&&!(n in t)&&(t[n]=f0[n]);Td.forEach(function(o){if(o.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),Td.push(t)},pluginEvent:function(t,n,o){var s=this;this.eventCanceled=!1,o.cancel=function(){s.eventCanceled=!0};var r=t+"Global";Td.forEach(function(i){n[i.pluginName]&&(n[i.pluginName][r]&&n[i.pluginName][r](Ri({sortable:n},o)),n.options[i.pluginName]&&n[i.pluginName][t]&&n[i.pluginName][t](Ri({sortable:n},o)))})},initializePlugins:function(t,n,o,s){Td.forEach(function(a){var l=a.pluginName;if(!(!t.options[l]&&!a.initializeByDefault)){var u=new a(t,n,t.options);u.sortable=t,u.options=t.options,t[l]=u,Sa(o,u.defaults)}});for(var r in t.options)if(t.options.hasOwnProperty(r)){var i=this.modifyOption(t,r,t.options[r]);typeof i<"u"&&(t.options[r]=i)}},getEventProperties:function(t,n){var o={};return Td.forEach(function(s){typeof s.eventProperties=="function"&&Sa(o,s.eventProperties.call(n[s.pluginName],t))}),o},modifyOption:function(t,n,o){var s;return Td.forEach(function(r){t[r.pluginName]&&r.optionListeners&&typeof r.optionListeners[n]=="function"&&(s=r.optionListeners[n].call(t[r.pluginName],o))}),s}};function gre(e){var t=e.sortable,n=e.rootEl,o=e.name,s=e.targetEl,r=e.cloneEl,i=e.toEl,a=e.fromEl,l=e.oldIndex,u=e.newIndex,c=e.oldDraggableIndex,d=e.newDraggableIndex,h=e.originalEvent,f=e.putSortable,p=e.extraEventProperties;if(t=t||n&&n[qs],!!t){var g,v=t.options,w="on"+o.charAt(0).toUpperCase()+o.substr(1);window.CustomEvent&&!_a&&!ap?g=new CustomEvent(o,{bubbles:!0,cancelable:!0}):(g=document.createEvent("Event"),g.initEvent(o,!0,!0)),g.to=i||n,g.from=a||n,g.item=s||n,g.clone=r,g.oldIndex=l,g.newIndex=u,g.oldDraggableIndex=c,g.newDraggableIndex=d,g.originalEvent=h,g.pullMode=f?f.lastPutMode:void 0;var S=Ri(Ri({},p),cp.getEventProperties(o,t));for(var b in S)g[b]=S[b];n&&n.dispatchEvent(g),v[w]&&v[w].call(t,g)}}var mre=["evt"],Ts=function(t,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=o.evt,r=rre(o,mre);cp.pluginEvent.bind(Ut)(t,n,Ri({dragEl:mt,parentEl:eo,ghostEl:Jt,rootEl:zn,nextEl:Nu,lastDownEl:ly,cloneEl:to,cloneHidden:Cl,dragStarted:hp,putSortable:jo,activeSortable:Ut.active,originalEvent:s,oldIndex:Dd,oldDraggableIndex:dp,newIndex:Ys,newDraggableIndex:bl,hideGhostForTarget:pL,unhideGhostForTarget:gL,cloneNowHidden:function(){Cl=!0},cloneNowShown:function(){Cl=!1},dispatchSortableEvent:function(a){hs({sortable:n,name:a,originalEvent:s})}},r))};function hs(e){gre(Ri({putSortable:jo,cloneEl:to,targetEl:mt,rootEl:zn,oldIndex:Dd,oldDraggableIndex:dp,newIndex:Ys,newDraggableIndex:bl},e))}var mt,eo,Jt,zn,Nu,ly,to,Cl,Dd,Ys,dp,bl,uy,jo,Id=!1,cy=!1,dy=[],Lu,Yr,p0,g0,lL,uL,hp,xd,fp,pp=!1,hy=!1,fy,os,m0=[],v0=!1,py=[],gy=typeof document<"u",my=QN,cL=ap||_a?"cssFloat":"float",vre=gy&&!are&&!QN&&"draggable"in document.createElement("div"),dL=function(){if(gy){if(_a)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),hL=function(t,n){var o=Gt(t),s=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),r=Rd(t,0,n),i=Rd(t,1,n),a=r&&Gt(r),l=i&&Gt(i),u=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+ko(r).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+ko(i).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&a.float&&a.float!=="none"){var d=a.float==="left"?"left":"right";return i&&(l.clear==="both"||l.clear===d)?"vertical":"horizontal"}return r&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||u>=s&&o[cL]==="none"||i&&o[cL]==="none"&&u+c>s)?"vertical":"horizontal"},yre=function(t,n,o){var s=o?t.left:t.top,r=o?t.right:t.bottom,i=o?t.width:t.height,a=o?n.left:n.top,l=o?n.right:n.bottom,u=o?n.width:n.height;return s===a||r===l||s+i/2===a+u/2},wre=function(t,n){var o;return dy.some(function(s){var r=s[qs].options.emptyInsertThreshold;if(!(!r||d0(s))){var i=ko(s),a=t>=i.left-r&&t<=i.right+r,l=n>=i.top-r&&n<=i.bottom+r;if(a&&l)return o=s}}),o},fL=function(t){function n(r,i){return function(a,l,u,c){var d=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(r==null&&(i||d))return!0;if(r==null||r===!1)return!1;if(i&&r==="clone")return r;if(typeof r=="function")return n(r(a,l,u,c),i)(a,l,u,c);var h=(i?a:l).options.group.name;return r===!0||typeof r=="string"&&r===h||r.join&&r.indexOf(h)>-1}}var o={},s=t.group;(!s||iy(s)!="object")&&(s={name:s}),o.name=s.name,o.checkPull=n(s.pull,!0),o.checkPut=n(s.put),o.revertClone=s.revertClone,t.group=o},pL=function(){!dL&&Jt&&Gt(Jt,"display","none")},gL=function(){!dL&&Jt&&Gt(Jt,"display","")};gy&&document.addEventListener("click",function(e){if(cy)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),cy=!1,!1},!0);var Vu=function(t){if(mt){t=t.touches?t.touches[0]:t;var n=wre(t.clientX,t.clientY);if(n){var o={};for(var s in t)t.hasOwnProperty(s)&&(o[s]=t[s]);o.target=o.rootEl=n,o.preventDefault=void 0,o.stopPropagation=void 0,n[qs]._onDragOver(o)}}},Cre=function(t){mt&&mt.parentNode[qs]._isOutsideThisEl(t.target)};function Ut(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=Sa({},t),e[qs]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return hL(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(i,a){i.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Ut.supportPointer!==!1&&"PointerEvent"in window&&!lp,emptyInsertThreshold:5};cp.initializePlugins(this,e,n);for(var o in n)!(o in t)&&(t[o]=n[o]);fL(t);for(var s in this)s.charAt(0)==="_"&&typeof this[s]=="function"&&(this[s]=this[s].bind(this));this.nativeDraggable=t.forceFallback?!1:vre,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?wn(e,"pointerdown",this._onTapStart):(wn(e,"mousedown",this._onTapStart),wn(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(wn(e,"dragover",this),wn(e,"dragenter",this)),dy.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Sa(this,hre())}Ut.prototype={constructor:Ut,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(xd=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,mt):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,o=this.el,s=this.options,r=s.preventOnFilter,i=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,u=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,c=s.filter;if(Ire(o),!mt&&!(/mousedown|pointerdown/.test(i)&&t.button!==0||s.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&lp&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=Ti(l,s.draggable,o,!1),!(l&&l.animated)&&ly!==l)){if(Dd=Rr(l),dp=Rr(l,s.draggable),typeof c=="function"){if(c.call(this,t,l,this)){hs({sortable:n,rootEl:u,name:"filter",targetEl:l,toEl:o,fromEl:o}),Ts("filter",n,{evt:t}),r&&t.cancelable&&t.preventDefault();return}}else if(c&&(c=c.split(",").some(function(d){if(d=Ti(u,d.trim(),o,!1),d)return hs({sortable:n,rootEl:d,name:"filter",targetEl:l,fromEl:o,toEl:o}),Ts("filter",n,{evt:t}),!0}),c)){r&&t.cancelable&&t.preventDefault();return}s.handle&&!Ti(u,s.handle,o,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,n,o){var s=this,r=s.el,i=s.options,a=r.ownerDocument,l;if(o&&!mt&&o.parentNode===r){var u=ko(o);if(zn=r,mt=o,eo=mt.parentNode,Nu=mt.nextSibling,ly=o,uy=i.group,Ut.dragged=mt,Lu={target:mt,clientX:(n||t).clientX,clientY:(n||t).clientY},lL=Lu.clientX-u.left,uL=Lu.clientY-u.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,mt.style["will-change"]="all",l=function(){if(Ts("delayEnded",s,{evt:t}),Ut.eventCanceled){s._onDrop();return}s._disableDelayedDragEvents(),!JN&&s.nativeDraggable&&(mt.draggable=!0),s._triggerDragStart(t,n),hs({sortable:s,name:"choose",originalEvent:t}),Ks(mt,i.chosenClass,!0)},i.ignore.split(",").forEach(function(c){nL(mt,c.trim(),y0)}),wn(a,"dragover",Vu),wn(a,"mousemove",Vu),wn(a,"touchmove",Vu),wn(a,"mouseup",s._onDrop),wn(a,"touchend",s._onDrop),wn(a,"touchcancel",s._onDrop),JN&&this.nativeDraggable&&(this.options.touchStartThreshold=4,mt.draggable=!0),Ts("delayStart",this,{evt:t}),i.delay&&(!i.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(ap||_a))){if(Ut.eventCanceled){this._onDrop();return}wn(a,"mouseup",s._disableDelayedDrag),wn(a,"touchend",s._disableDelayedDrag),wn(a,"touchcancel",s._disableDelayedDrag),wn(a,"mousemove",s._delayedDragTouchMoveHandler),wn(a,"touchmove",s._delayedDragTouchMoveHandler),i.supportPointer&&wn(a,"pointermove",s._delayedDragTouchMoveHandler),s._dragStartTimer=setTimeout(l,i.delay)}else l()}},_delayedDragTouchMoveHandler:function(t){var n=t.touches?t.touches[0]:t;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){mt&&y0(mt),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;gn(t,"mouseup",this._disableDelayedDrag),gn(t,"touchend",this._disableDelayedDrag),gn(t,"touchcancel",this._disableDelayedDrag),gn(t,"mousemove",this._delayedDragTouchMoveHandler),gn(t,"touchmove",this._delayedDragTouchMoveHandler),gn(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?wn(document,"pointermove",this._onTouchMove):n?wn(document,"touchmove",this._onTouchMove):wn(document,"mousemove",this._onTouchMove):(wn(mt,"dragend",this),wn(zn,"dragstart",this._onDragStart));try{document.selection?yy(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(Id=!1,zn&&mt){Ts("dragStarted",this,{evt:n}),this.nativeDraggable&&wn(document,"dragover",Cre);var o=this.options;!t&&Ks(mt,o.dragClass,!1),Ks(mt,o.ghostClass,!0),Ut.active=this,t&&this._appendGhost(),hs({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Yr){this._lastX=Yr.clientX,this._lastY=Yr.clientY,pL();for(var t=document.elementFromPoint(Yr.clientX,Yr.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Yr.clientX,Yr.clientY),t!==n);)n=t;if(mt.parentNode[qs]._isOutsideThisEl(t),n)do{if(n[qs]){var o=void 0;if(o=n[qs]._onDragOver({clientX:Yr.clientX,clientY:Yr.clientY,target:t,rootEl:n}),o&&!this.options.dragoverBubble)break}t=n}while(n=n.parentNode);gL()}},_onTouchMove:function(t){if(Lu){var n=this.options,o=n.fallbackTolerance,s=n.fallbackOffset,r=t.touches?t.touches[0]:t,i=Jt&&_d(Jt,!0),a=Jt&&i&&i.a,l=Jt&&i&&i.d,u=my&&os&&sL(os),c=(r.clientX-Lu.clientX+s.x)/(a||1)+(u?u[0]-m0[0]:0)/(a||1),d=(r.clientY-Lu.clientY+s.y)/(l||1)+(u?u[1]-m0[1]:0)/(l||1);if(!Ut.active&&!Id){if(o&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<o)return;this._onDragStart(t,!0)}if(Jt){i?(i.e+=c-(p0||0),i.f+=d-(g0||0)):i={a:1,b:0,c:0,d:1,e:c,f:d};var h="matrix(".concat(i.a,",").concat(i.b,",").concat(i.c,",").concat(i.d,",").concat(i.e,",").concat(i.f,")");Gt(Jt,"webkitTransform",h),Gt(Jt,"mozTransform",h),Gt(Jt,"msTransform",h),Gt(Jt,"transform",h),p0=c,g0=d,Yr=r}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Jt){var t=this.options.fallbackOnBody?document.body:zn,n=ko(mt,!0,my,!0,t),o=this.options;if(my){for(os=t;Gt(os,"position")==="static"&&Gt(os,"transform")==="none"&&os!==document;)os=os.parentNode;os!==document.body&&os!==document.documentElement?(os===document&&(os=Di()),n.top+=os.scrollTop,n.left+=os.scrollLeft):os=Di(),m0=sL(os)}Jt=mt.cloneNode(!0),Ks(Jt,o.ghostClass,!1),Ks(Jt,o.fallbackClass,!0),Ks(Jt,o.dragClass,!0),Gt(Jt,"transition",""),Gt(Jt,"transform",""),Gt(Jt,"box-sizing","border-box"),Gt(Jt,"margin",0),Gt(Jt,"top",n.top),Gt(Jt,"left",n.left),Gt(Jt,"width",n.width),Gt(Jt,"height",n.height),Gt(Jt,"opacity","0.8"),Gt(Jt,"position",my?"absolute":"fixed"),Gt(Jt,"zIndex","100000"),Gt(Jt,"pointerEvents","none"),Ut.ghost=Jt,t.appendChild(Jt),Gt(Jt,"transform-origin",lL/parseInt(Jt.style.width)*100+"% "+uL/parseInt(Jt.style.height)*100+"%")}},_onDragStart:function(t,n){var o=this,s=t.dataTransfer,r=o.options;if(Ts("dragStart",this,{evt:t}),Ut.eventCanceled){this._onDrop();return}Ts("setupClone",this),Ut.eventCanceled||(to=aL(mt),to.draggable=!1,to.style["will-change"]="",this._hideClone(),Ks(to,this.options.chosenClass,!1),Ut.clone=to),o.cloneId=yy(function(){Ts("clone",o),!Ut.eventCanceled&&(o.options.removeCloneOnHide||zn.insertBefore(to,mt),o._hideClone(),hs({sortable:o,name:"clone"}))}),!n&&Ks(mt,r.dragClass,!0),n?(cy=!0,o._loopId=setInterval(o._emulateDragOver,50)):(gn(document,"mouseup",o._onDrop),gn(document,"touchend",o._onDrop),gn(document,"touchcancel",o._onDrop),s&&(s.effectAllowed="move",r.setData&&r.setData.call(o,s,mt)),wn(document,"drop",o),Gt(mt,"transform","translateZ(0)")),Id=!0,o._dragStartId=yy(o._dragStarted.bind(o,n,t)),wn(document,"selectstart",o),hp=!0,lp&&Gt(document.body,"user-select","none")},_onDragOver:function(t){var n=this.el,o=t.target,s,r,i,a=this.options,l=a.group,u=Ut.active,c=uy===l,d=a.sort,h=jo||u,f,p=this,g=!1;if(v0)return;function v(oe,ie){Ts(oe,p,Ri({evt:t,isOwner:c,axis:f?"vertical":"horizontal",revert:i,dragRect:s,targetRect:r,canSort:d,fromSortable:h,target:o,completed:S,onMove:function(se,Z){return vy(zn,n,mt,s,se,ko(se),t,Z)},changed:b},ie))}function w(){v("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function S(oe){return v("dragOverCompleted",{insertion:oe}),oe&&(c?u._hideClone():u._showClone(p),p!==h&&(Ks(mt,jo?jo.options.ghostClass:u.options.ghostClass,!1),Ks(mt,a.ghostClass,!0)),jo!==p&&p!==Ut.active?jo=p:p===Ut.active&&jo&&(jo=null),h===p&&(p._ignoreWhileAnimating=o),p.animateAll(function(){v("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(o===mt&&!mt.animated||o===n&&!o.animated)&&(xd=null),!a.dragoverBubble&&!t.rootEl&&o!==document&&(mt.parentNode[qs]._isOutsideThisEl(t.target),!oe&&Vu(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function b(){Ys=Rr(mt),bl=Rr(mt,a.draggable),hs({sortable:p,name:"change",toEl:n,newIndex:Ys,newDraggableIndex:bl,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),o=Ti(o,a.draggable,n,!0),v("dragOver"),Ut.eventCanceled)return g;if(mt.contains(t.target)||o.animated&&o.animatingX&&o.animatingY||p._ignoreWhileAnimating===o)return S(!1);if(cy=!1,u&&!a.disabled&&(c?d||(i=eo!==zn):jo===this||(this.lastPutMode=uy.checkPull(this,u,mt,t))&&l.checkPut(this,u,mt,t))){if(f=this._getDirection(t,o)==="vertical",s=ko(mt),v("dragOverValid"),Ut.eventCanceled)return g;if(i)return eo=zn,w(),this._hideClone(),v("revert"),Ut.eventCanceled||(Nu?zn.insertBefore(mt,Nu):zn.appendChild(mt)),S(!0);var y=d0(n,a.draggable);if(!y||_re(t,f,this)&&!y.animated){if(y===mt)return S(!1);if(y&&n===t.target&&(o=y),o&&(r=ko(o)),vy(zn,n,mt,s,o,r,t,!!o)!==!1)return w(),n.appendChild(mt),eo=n,b(),S(!0)}else if(y&&Ere(t,f,this)){var E=Rd(n,0,a,!0);if(E===mt)return S(!1);if(o=E,r=ko(o),vy(zn,n,mt,s,o,r,t,!1)!==!1)return w(),n.insertBefore(mt,E),eo=n,b(),S(!0)}else if(o.parentNode===n){r=ko(o);var _=0,I,T=mt.parentNode!==n,F=!yre(mt.animated&&mt.toRect||s,o.animated&&o.toRect||r,f),V=f?"top":"left",x=oL(o,"top","top")||oL(mt,"top","top"),A=x?x.scrollTop:void 0;xd!==o&&(I=r[V],pp=!1,hy=!F&&a.invertSwap||T),_=Rre(t,o,r,f,F?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,hy,xd===o);var k;if(_!==0){var M=Rr(mt);do M-=_,k=eo.children[M];while(k&&(Gt(k,"display")==="none"||k===Jt))}if(_===0||k===o)return S(!1);xd=o,fp=_;var N=o.nextElementSibling,B=!1;B=_===1;var z=vy(zn,n,mt,s,o,r,t,B);if(z!==!1)return(z===1||z===-1)&&(B=z===1),v0=!0,setTimeout(Sre,30),w(),B&&!N?n.appendChild(mt):o.parentNode.insertBefore(mt,B?N:o),x&&iL(x,0,A-x.scrollTop),eo=mt.parentNode,I!==void 0&&!hy&&(fy=Math.abs(I-ko(o)[V])),b(),S(!0)}if(n.contains(mt))return S(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){gn(document,"mousemove",this._onTouchMove),gn(document,"touchmove",this._onTouchMove),gn(document,"pointermove",this._onTouchMove),gn(document,"dragover",Vu),gn(document,"mousemove",Vu),gn(document,"touchmove",Vu)},_offUpEvents:function(){var t=this.el.ownerDocument;gn(t,"mouseup",this._onDrop),gn(t,"touchend",this._onDrop),gn(t,"pointerup",this._onDrop),gn(t,"touchcancel",this._onDrop),gn(document,"selectstart",this)},_onDrop:function(t){var n=this.el,o=this.options;if(Ys=Rr(mt),bl=Rr(mt,o.draggable),Ts("drop",this,{evt:t}),eo=mt&&mt.parentNode,Ys=Rr(mt),bl=Rr(mt,o.draggable),Ut.eventCanceled){this._nulling();return}Id=!1,hy=!1,pp=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),w0(this.cloneId),w0(this._dragStartId),this.nativeDraggable&&(gn(document,"drop",this),gn(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),lp&&Gt(document.body,"user-select",""),Gt(mt,"transform",""),t&&(hp&&(t.cancelable&&t.preventDefault(),!o.dropBubble&&t.stopPropagation()),Jt&&Jt.parentNode&&Jt.parentNode.removeChild(Jt),(zn===eo||jo&&jo.lastPutMode!=="clone")&&to&&to.parentNode&&to.parentNode.removeChild(to),mt&&(this.nativeDraggable&&gn(mt,"dragend",this),y0(mt),mt.style["will-change"]="",hp&&!Id&&Ks(mt,jo?jo.options.ghostClass:this.options.ghostClass,!1),Ks(mt,this.options.chosenClass,!1),hs({sortable:this,name:"unchoose",toEl:eo,newIndex:null,newDraggableIndex:null,originalEvent:t}),zn!==eo?(Ys>=0&&(hs({rootEl:eo,name:"add",toEl:eo,fromEl:zn,originalEvent:t}),hs({sortable:this,name:"remove",toEl:eo,originalEvent:t}),hs({rootEl:eo,name:"sort",toEl:eo,fromEl:zn,originalEvent:t}),hs({sortable:this,name:"sort",toEl:eo,originalEvent:t})),jo&&jo.save()):Ys!==Dd&&Ys>=0&&(hs({sortable:this,name:"update",toEl:eo,originalEvent:t}),hs({sortable:this,name:"sort",toEl:eo,originalEvent:t})),Ut.active&&((Ys==null||Ys===-1)&&(Ys=Dd,bl=dp),hs({sortable:this,name:"end",toEl:eo,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){Ts("nulling",this),zn=mt=eo=Jt=Nu=to=ly=Cl=Lu=Yr=hp=Ys=bl=Dd=dp=xd=fp=jo=uy=Ut.dragged=Ut.ghost=Ut.clone=Ut.active=null,py.forEach(function(t){t.checked=!0}),py.length=p0=g0=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":mt&&(this._onDragOver(t),bre(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],n,o=this.el.children,s=0,r=o.length,i=this.options;s<r;s++)n=o[s],Ti(n,i.draggable,this.el,!1)&&t.push(n.getAttribute(i.dataIdAttr)||Dre(n));return t},sort:function(t,n){var o={},s=this.el;this.toArray().forEach(function(r,i){var a=s.children[i];Ti(a,this.options.draggable,s,!1)&&(o[r]=a)},this),n&&this.captureAnimationState(),t.forEach(function(r){o[r]&&(s.removeChild(o[r]),s.appendChild(o[r]))}),n&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,n){return Ti(t,n||this.options.draggable,this.el,!1)},option:function(t,n){var o=this.options;if(n===void 0)return o[t];var s=cp.modifyOption(this,t,n);typeof s<"u"?o[t]=s:o[t]=n,t==="group"&&fL(o)},destroy:function(){Ts("destroy",this);var t=this.el;t[qs]=null,gn(t,"mousedown",this._onTapStart),gn(t,"touchstart",this._onTapStart),gn(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(gn(t,"dragover",this),gn(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),dy.splice(dy.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!Cl){if(Ts("hideClone",this),Ut.eventCanceled)return;Gt(to,"display","none"),this.options.removeCloneOnHide&&to.parentNode&&to.parentNode.removeChild(to),Cl=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(Cl){if(Ts("showClone",this),Ut.eventCanceled)return;mt.parentNode==zn&&!this.options.group.revertClone?zn.insertBefore(to,mt):Nu?zn.insertBefore(to,Nu):zn.appendChild(to),this.options.group.revertClone&&this.animate(mt,to),Gt(to,"display",""),Cl=!1}}};function bre(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function vy(e,t,n,o,s,r,i,a){var l,u=e[qs],c=u.options.onMove,d;return window.CustomEvent&&!_a&&!ap?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=t,l.from=e,l.dragged=n,l.draggedRect=o,l.related=s||t,l.relatedRect=r||ko(t),l.willInsertAfter=a,l.originalEvent=i,e.dispatchEvent(l),c&&(d=c.call(u,l,i)),d}function y0(e){e.draggable=!1}function Sre(){v0=!1}function Ere(e,t,n){var o=ko(Rd(n.el,0,n.options,!0)),s=10;return t?e.clientX<o.left-s||e.clientY<o.top&&e.clientX<o.right:e.clientY<o.top-s||e.clientY<o.bottom&&e.clientX<o.left}function _re(e,t,n){var o=ko(d0(n.el,n.options.draggable)),s=10;return t?e.clientX>o.right+s||e.clientX<=o.right&&e.clientY>o.bottom&&e.clientX>=o.left:e.clientX>o.right&&e.clientY>o.top||e.clientX<=o.right&&e.clientY>o.bottom+s}function Rre(e,t,n,o,s,r,i,a){var l=o?e.clientY:e.clientX,u=o?n.height:n.width,c=o?n.top:n.left,d=o?n.bottom:n.right,h=!1;if(!i){if(a&&fy<u*s){if(!pp&&(fp===1?l>c+u*r/2:l<d-u*r/2)&&(pp=!0),pp)h=!0;else if(fp===1?l<c+fy:l>d-fy)return-fp}else if(l>c+u*(1-s)/2&&l<d-u*(1-s)/2)return Tre(t)}return h=h||i,h&&(l<c+u*r/2||l>d-u*r/2)?l>c+u/2?1:-1:0}function Tre(e){return Rr(mt)<Rr(e)?1:-1}function Dre(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,o=0;n--;)o+=t.charCodeAt(n);return o.toString(36)}function Ire(e){py.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var o=t[n];o.checked&&py.push(o)}}function yy(e){return setTimeout(e,0)}function w0(e){return clearTimeout(e)}gy&&wn(document,"touchmove",function(e){(Ut.active||Id)&&e.cancelable&&e.preventDefault()}),Ut.utils={on:wn,off:gn,css:Gt,find:nL,is:function(t,n){return!!Ti(t,n,t,!1)},extend:cre,throttle:rL,closest:Ti,toggleClass:Ks,clone:aL,index:Rr,nextTick:yy,cancelNextTick:w0,detectDirection:hL,getChild:Rd},Ut.get=function(e){return e[qs]},Ut.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(o){if(!o.prototype||!o.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));o.utils&&(Ut.utils=Ri(Ri({},Ut.utils),o.utils)),cp.mount(o)})},Ut.create=function(e,t){return new Ut(e,t)},Ut.version=ire;var Co=[],gp,C0,b0=!1,S0,E0,wy,mp;function xre(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return e.prototype={dragStarted:function(n){var o=n.originalEvent;this.sortable.nativeDraggable?wn(document,"dragover",this._handleAutoScroll):this.options.supportPointer?wn(document,"pointermove",this._handleFallbackAutoScroll):o.touches?wn(document,"touchmove",this._handleFallbackAutoScroll):wn(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var o=n.originalEvent;!this.options.dragOverBubble&&!o.rootEl&&this._handleAutoScroll(o)},drop:function(){this.sortable.nativeDraggable?gn(document,"dragover",this._handleAutoScroll):(gn(document,"pointermove",this._handleFallbackAutoScroll),gn(document,"touchmove",this._handleFallbackAutoScroll),gn(document,"mousemove",this._handleFallbackAutoScroll)),mL(),Cy(),dre()},nulling:function(){wy=C0=gp=b0=mp=S0=E0=null,Co.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,o){var s=this,r=(n.touches?n.touches[0]:n).clientX,i=(n.touches?n.touches[0]:n).clientY,a=document.elementFromPoint(r,i);if(wy=n,o||this.options.forceAutoScrollFallback||ap||_a||lp){_0(n,this.options,a,o);var l=wl(a,!0);b0&&(!mp||r!==S0||i!==E0)&&(mp&&mL(),mp=setInterval(function(){var u=wl(document.elementFromPoint(r,i),!0);u!==l&&(l=u,Cy()),_0(n,s.options,u,o)},10),S0=r,E0=i)}else{if(!this.options.bubbleScroll||wl(a,!0)===Di()){Cy();return}_0(n,this.options,wl(a,!1),!1)}}},Sa(e,{pluginName:"scroll",initializeByDefault:!0})}function Cy(){Co.forEach(function(e){clearInterval(e.pid)}),Co=[]}function mL(){clearInterval(mp)}var _0=rL(function(e,t,n,o){if(t.scroll){var s=(e.touches?e.touches[0]:e).clientX,r=(e.touches?e.touches[0]:e).clientY,i=t.scrollSensitivity,a=t.scrollSpeed,l=Di(),u=!1,c;C0!==n&&(C0=n,Cy(),gp=t.scroll,c=t.scrollFn,gp===!0&&(gp=wl(n,!0)));var d=0,h=gp;do{var f=h,p=ko(f),g=p.top,v=p.bottom,w=p.left,S=p.right,b=p.width,y=p.height,E=void 0,_=void 0,I=f.scrollWidth,T=f.scrollHeight,F=Gt(f),V=f.scrollLeft,x=f.scrollTop;f===l?(E=b<I&&(F.overflowX==="auto"||F.overflowX==="scroll"||F.overflowX==="visible"),_=y<T&&(F.overflowY==="auto"||F.overflowY==="scroll"||F.overflowY==="visible")):(E=b<I&&(F.overflowX==="auto"||F.overflowX==="scroll"),_=y<T&&(F.overflowY==="auto"||F.overflowY==="scroll"));var A=E&&(Math.abs(S-s)<=i&&V+b<I)-(Math.abs(w-s)<=i&&!!V),k=_&&(Math.abs(v-r)<=i&&x+y<T)-(Math.abs(g-r)<=i&&!!x);if(!Co[d])for(var M=0;M<=d;M++)Co[M]||(Co[M]={});(Co[d].vx!=A||Co[d].vy!=k||Co[d].el!==f)&&(Co[d].el=f,Co[d].vx=A,Co[d].vy=k,clearInterval(Co[d].pid),(A!=0||k!=0)&&(u=!0,Co[d].pid=setInterval((function(){o&&this.layer===0&&Ut.active._onTouchMove(wy);var N=Co[this.layer].vy?Co[this.layer].vy*a:0,B=Co[this.layer].vx?Co[this.layer].vx*a:0;typeof c=="function"&&c.call(Ut.dragged.parentNode[qs],B,N,e,wy,Co[this.layer].el)!=="continue"||iL(Co[this.layer].el,B,N)}).bind({layer:d}),24))),d++}while(t.bubbleScroll&&h!==l&&(h=wl(h,!1)));b0=u}},30),vL=function(t){var n=t.originalEvent,o=t.putSortable,s=t.dragEl,r=t.activeSortable,i=t.dispatchSortableEvent,a=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(n){var u=o||r;a();var c=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,d=document.elementFromPoint(c.clientX,c.clientY);l(),u&&!u.el.contains(d)&&(i("spill"),this.onSpill({dragEl:s,putSortable:o}))}};function R0(){}R0.prototype={startIndex:null,dragStart:function(t){var n=t.oldDraggableIndex;this.startIndex=n},onSpill:function(t){var n=t.dragEl,o=t.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var s=Rd(this.sortable.el,this.startIndex,this.options);s?this.sortable.el.insertBefore(n,s):this.sortable.el.appendChild(n),this.sortable.animateAll(),o&&o.animateAll()},drop:vL},Sa(R0,{pluginName:"revertOnSpill"});function T0(){}T0.prototype={onSpill:function(t){var n=t.dragEl,o=t.putSortable,s=o||this.sortable;s.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),s.animateAll()},drop:vL},Sa(T0,{pluginName:"removeOnSpill"}),Ut.mount(new xre),Ut.mount(T0,R0);function Are(e,t){return Object.values(e).indexOf(t)}function Pre(e,t,n,o){if(!e)return[];const s=Object.values(e),r=t.length-o;return[...t].map((a,l)=>l>=r?s.length:s.indexOf(a))}function kre(e){return["transition-group","TransitionGroup"].includes(e)}function yL(e){if(!e||e.length!==1)return!1;const[{type:t}]=e;return t?kre(t.name):!1}function Fre(e,t){return t?{...t.props,...t.attrs}:e}const D0=["Start","Add","Remove","Update","End"],I0=["Choose","Unchoose","Sort","Filter","Clone"],Ore=["Move",...D0,...I0].map(e=>"on"+e);let x0=null;const Mre=nt({name:"VueDraggableNext",inheritAttrs:!1,props:{options:Object,list:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:e=>e},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null},component:{type:String,default:null},modelValue:{type:Array,required:!1,default:null}},emits:["update:modelValue","move","change",...D0.map(e=>e.toLowerCase()),...I0.map(e=>e.toLowerCase())],setup(e,{emit:t,slots:n,attrs:o}){const s=$(!1),r=$(!1),i=$(0),a=$(0),l=$([]),u=$(null),c=$(null),d=X(()=>e.list?e.list:e.modelValue),h=oo();function f(){return e.component?jW(e.component):e.tag}function p(P){if(c.value)for(const j in P){const ne=YN(j);Ore.indexOf(ne)===-1&&c.value.option(ne,P[j])}}function g(){var P;return((P=h==null?void 0:h.proxy)==null?void 0:P.$el.children)||[]}async function v(){var P;await ht(),l.value=Pre(g(),((P=h==null?void 0:h.proxy)==null?void 0:P.$el.children)||[],s.value,a.value)}function w(P){const j=Are(g()||[],P);if(j===-1)return null;const ne=d.value?d.value[j]:null;return{index:j,element:ne}}function S(P){ht(()=>t("change",P))}function b(P){if(e.list){P(e.list);return}const j=[...e.modelValue||[]];P(j),t("update:modelValue",j)}function y(...P){b(ne=>ne.splice(...P))}function E(P,j){b(ge=>ge.splice(j,0,ge.splice(P,1)[0]))}function _(P){const j=l.value,ne=j.length;return P>ne-1?ne:j[P]}function I(){var j,ne;return n.default&&((ne=(j=n.default()[0])==null?void 0:j.component)==null?void 0:ne.proxy)||null}function T(P){if(!e.noTransitionOnDrag||!s.value)return;const j=g();j[P]&&(j[P].data=null);const ne=I();ne&&(ne.children=[],ne.kept=void 0)}function F(P){v(),u.value=w(P.item),u.value&&(P.item._underlying_vm_=e.clone(u.value.element),x0=P.item)}function V(P){const j=P.item._underlying_vm_;if(j===void 0)return;c0(P.item);const ne=_(P.newIndex);y(ne,0,j),v(),S({added:{element:j,newIndex:ne}})}function x(P){var ne;if(XN((ne=h==null?void 0:h.proxy)==null?void 0:ne.$el,P.item,P.oldIndex),P.pullMode==="clone"){c0(P.clone);return}if(!u.value)return;const j=u.value.index;y(j,1),T(j),S({removed:{element:u.value.element,oldIndex:j}})}function A(P){var ge,xe;c0(P.item),XN(P.from,P.item,P.oldIndex);const j=(ge=u.value)==null?void 0:ge.index,ne=_(P.newIndex);E(j,ne),S({moved:{element:(xe=u.value)==null?void 0:xe.element,oldIndex:j,newIndex:ne}})}function k(P,j){Object.prototype.hasOwnProperty.call(P,j)&&(P[j]+=i.value)}function M(P){return P.__draggable_component__}function N({to:P,related:j}){const ne=M(P);if(!ne)return{component:ne};const ge=ne.realList,xe={list:ge,component:ne};if(P!==j&&ge&&ne.getUnderlyingVm){const ue=ne.getUnderlyingVm(j);if(ue)return Object.assign(ue,xe)}return xe}function B(P,j){const ne=[...j.to.children].filter(K=>K.style.display!=="none");if(ne.length===0)return 0;const ge=ne.indexOf(j.related),xe=P.component.getVmIndex(ge);return ne.indexOf(x0)!==-1||!j.willInsertAfter?xe:xe+1}const z=()=>{var xe,ue;const P={};D0.forEach(K=>{P["on"+K]=ie(K)}),I0.forEach(K=>{P["on"+K]=oe.bind(null,K)});const j=Object.keys(o).reduce((K,Y)=>(K[YN(Y)]=o[Y],K),{}),ne=Object.assign({},j,P,{onMove:(K,Y)=>te(K,Y)});"draggable"in ne||(ne.draggable=">*");const ge=((xe=h==null?void 0:h.proxy)==null?void 0:xe.$el.nodeType)===1?h.proxy.$el:((ue=h==null?void 0:h.proxy)==null?void 0:ue.$el.parentElement)||null;ge&&(c.value=new Ut(ge,ne),ge.__draggable_component__=h==null?void 0:h.proxy,v())};function oe(P,j){ht(()=>t(P.toLowerCase(),j))}function ie(P){return j=>{if(d.value!==null){const ne="onDrag"+P,ge=Z[ne];ge&&ge(j)}oe(P,j)}}function te(P,j){const ne=e.move;if(!ne||!d.value)return!0;const ge=N(P),xe=u.value,ue=B(ge,P);xe&&Object.assign(xe,{futureIndex:ue});const K=Object.assign({},P,{relatedContext:ge,draggedContext:xe});return ne(K,j)}function se(){v(),x0=null}const Z={onDragStart:F,onDragAdd:V,onDragRemove:x,onDragUpdate:A,onDragMove:te,onDragEnd:se};return Zt(()=>{z()}),e.list!==null&&e.modelValue!==null&&ere.error("list props are mutually exclusive! Please set one."),{getTag:f,realList:d,visibleIndexes:l,noneFunctionalComponentMode:r,headerOffset:i,footerOffset:a,transitionMode:s,computeIndexes:v,updateOptions:p,getChildrenNodes:g,getUnderlyingVm:w,emitChanges:S,alterList:b,spliceList:y,updatePosition:E,getVmIndex:_,getComponent:I,resetTransitionData:T,onDragStart:F,onDragAdd:V,onDragRemove:x,onDragUpdate:A,updateProperty:k,onDragMove:te,onDragEnd:se,mounted:z,context:u,sortableInstance:c,getRelatedContextFromMoveEvent:N,getTargetedComponent:M,computeFutureIndex:B}},render(){const e=this.getTag(),t=Fre(this.$attrs,this.componentData);if(typeof e=="string"){const o=this.$slots.default&&typeof this.$slots.default=="function"?this.$slots.default():null;return o?(this.transitionMode=yL(o),Tc(e,t,o)):Tc(e,t,[])}const n=this.$slots.default?{default:this.$slots.default}:{};if(this.$slots.default){const o=typeof this.$slots.default=="function"?this.$slots.default():null;this.transitionMode=yL(o||[])}return Tc(e,t,n)}}),Nre=_t(nt({__name:"DragDropList",props:{modelValue:{},groupName:{},disabled:{type:Boolean},readOnly:{type:Boolean}},emits:["changed","update:modelValue"],setup(e,{emit:t}){const n=$([]),o=e,s=t,r=$({}),i=()=>{n.value=o.modelValue.map(u=>({id:u.field,name:u.headerName,...u}))||[],o.modelValue.forEach(u=>{r.value[u.field]={...u}})};Je(()=>o.modelValue,u=>{i()},{immediate:!0,deep:!0}),Je(n,u=>{if(u.length===o.modelValue.length&&!u.every((d,h)=>d.id===o.modelValue[h].field)){const d=u.map(h=>r.value[h.id]);s("changed",d),s("update:modelValue",d)}});const a=()=>!(o.readOnly||o.disabled),l=u=>!(o.readOnly||o.disabled);return(u,c)=>(q(),Ke(L(Mre),{modelValue:n.value,"onUpdate:modelValue":c[0]||(c[0]=d=>n.value=d),tag:"transition-group",disabled:o.disabled||o.readOnly,onMove:l,onStart:a,"item-key":"id","component-data":{tag:"div",type:"transition",name:"fade"},animation:300,easing:"cubic-bezier(0.4, 0, 0.2, 1)","ghost-class":"ghost","chosen-class":"chosen","drag-class":"drag"},{default:we(()=>[(q(!0),de(Pt,null,xn(n.value,(d,h)=>(q(),de("div",{key:d.id,class:"fade-item"},[kt(u.$slots,"item",{item:d,index:h},()=>[tt(it(d.name),1)],!0)]))),128))]),_:3},8,["modelValue","disabled"]))}}),[["__scopeId","data-v-2106e8ed"]]),Lre={key:0},Vre={key:1,style:{"font-style":"italic"}},Bre={key:2,style:{"font-style":"italic"}},$re={key:3},by=_t(nt({__name:"DragDropItem",props:{item:{},isDisableNewCheck:{type:Boolean,default:!1},disableDrag:{type:Boolean,default:!1},disableCheckbox:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},columnStates:{},disableDragTooltip:{default:""},focusIndex:{}},emits:["toggle-column"],setup(e,{emit:t}){const n=Kt,o=e,s=$(o.columnStates[String(o.item.field)]||!1),r=t,i=h=>{s.value=h},a=X(()=>{var h;return(h=o.item)==null?void 0:h.context}),l=X(()=>{var f,p,g;return(f=a.value)!=null&&f.formula?"formular":((g=(p=a.value)==null?void 0:p.metric_type)==null?void 0:g.code)||"number"}),u=X(()=>{var h,f;return(f=(h=o.item)==null?void 0:h.field)==null?void 0:f.includes("metric")}),c=X(()=>{var h;return u.value&&((h=a.value)==null?void 0:h.is_primary)==1}),d=X(()=>{var h;return u.value&&((h=a.value)==null?void 0:h.is_point_metric)==1});return Je(()=>s.value,()=>{r("toggle-column",o.item.field,o.item.required)}),(h,f)=>(q(),de("div",{key:e.item.field,class:le([h.$style["column-config__item"],{[h.$style.disabled]:o.readOnly,[h.$style["is-metric"]]:u.value,[h.$style["is-point-metric"]]:d.value,[h.$style["is-woohoo-metric"]]:c.value}])},[ye(jN,{focusIndex:o.focusIndex,id:`col-${e.item.field}`,"model-value":s.value==!0?L(Ot).CHECKED:L(Ot).UNCHECK,"onUpdate:modelValue":i,disabled:o.disableCheckbox||e.isDisableNewCheck&&!s.value,size:"16px"},null,8,["focusIndex","id","model-value","disabled"]),ze((q(),de("div",{class:"move-handler",style:hn({cursor:o.disableDrag?"not-allowed":"move"})},[ye(pt,{color:o.disableDrag?"#D7D7D7":"#6B6B6B",source:"remote",src:"GripVertical",class:le(h.$style.handler)},null,8,["color","class"])],4)),[[L(n),o.disableDrag==!0?o.disableDragTooltip:""]]),u.value?(q(),de("div",{key:0,class:le(h.$style["metric-type"])},[l.value=="rating"?(q(),de("span",Lre,"★")):l.value=="formular"?(q(),de("span",Vre," ƒx ")):l.value=="number"?(q(),de("span",Bre," # ")):(q(),de("span",$re,it(l.value),1))],2)):Ye("",!0),Se("span",{class:le(h.$style["column-config__item-label"])},[ze((q(),de("div",null,[tt(it(e.item.headerName),1)])),[[L(n),{content:e.item.headerName}]])],2),d.value?ze((q(),de("div",{key:1,class:le(h.$style["metric-icon"])},[ye(pt,{src:"Bullseye",color:"#A6A6A6"})],2)),[[L(n),"Point metric"]]):Ye("",!0),c.value?ze((q(),de("div",{key:2,class:le(h.$style["metric-icon"])},[ye(pt,{src:"ChartPie",color:"#A6A6A6"})],2)),[[L(n),"Woohoo metric"]]):Ye("",!0)],2))}}),[["__cssModules",{$style:{"column-config__item":"_column-config__item_1ppdl_1","is-metric":"_is-metric_1ppdl_8","is-woohoo-metric":"_is-woohoo-metric_1ppdl_12","is-point-metric":"_is-point-metric_1ppdl_15","column-config__item-label":"_column-config__item-label_1ppdl_18",disabled:"_disabled_1ppdl_34",readOnly:"_readOnly_1ppdl_38","column-config__item--pinned":"_column-config__item--pinned_1ppdl_41",handler:"_handler_1ppdl_48",badge:"_badge_1ppdl_52","metric-type":"_metric-type_1ppdl_78","metric-icon":"_metric-icon_1ppdl_106"}}]]),Hre=_t(nt({__name:"DropdownWrapper",props:{placement:{default:"bottom-start"},show:{type:Boolean,default:!1},maxWidth:{default:400}},emits:["open","close"],setup(e,{expose:t,emit:n}){const o=e,s=n,{hide:r,triggerRef:i,popupRef:a,isVisible:l,toggle:u}=yo({toggleOnClick:!0,placement:o.placement,trigger:"click",interactive:!0,arrow:!1,offset:[0,4],showOnInit:o.show,maxWidth:o.maxWidth}),c=X(()=>l.value);Je(l,f=>{s(f?"open":"close")});const d=()=>{r()};t({closeDropdown:d,isOpen:c});const h=f=>{f.key==="Escape"&&a.value&&r()};return Zt(()=>{var p;const f=i.value instanceof HTMLElement?i.value:(p=i.value)==null?void 0:p.$el;f&&f.addEventListener("keydown",h)}),Vn(()=>{var p;const f=i.value instanceof HTMLElement?i.value:(p=i.value)==null?void 0:p.$el;f&&f.removeEventListener("keydown",h)}),(f,p)=>(q(),de("div",{ref_key:"triggerRef",ref:i,class:le(f.$style["dropdown-wrapper"])},[kt(f.$slots,"trigger",{open:L(l),toggle:L(u),closeDropdown:d},()=>[Se("button",{class:le(f.$style["editable-dropdown__trigger"]),"aria-label":"Select or type"}," ▼ ",2)]),Se("div",{ref_key:"popupRef",ref:a,tabindex:"0",class:le(f.$style["dropdown-content"]),style:hn({display:L(l)?"block":"none",maxWidth:o.maxWidth?o.maxWidth+"px":"unset"})},[kt(f.$slots,"content",{closeDropdown:d,visible:L(l)},()=>[Se("div",{class:le(f.$style["dropdown-list"])},null,2)])],6)],2))}}),[["__cssModules",{$style:{"dropdown-wrapper":"_dropdown-wrapper_lghkw_1","dropdown-content":"_dropdown-content_lghkw_5","dropdown-list":"_dropdown-list_lghkw_11"}}]]),Gre={class:"reach-limit-icon"},Ure=_t(nt({__name:"TableCustomization",props:{modelValue:{},readOnly:{type:Boolean},disabled:{type:Boolean},checkboxColumn:{},gridApi:{},tableHeight:{}},emits:["update:modelValue","input","change"],setup(e,{expose:t,emit:n}){const o=Kt,s=e,r=xo,i=n,a=$(""),l=$(),u=X(()=>a.value.trim().length>0),c=$([]),d=$({}),{triggerRef:h,popupRef:f,isVisible:p,hide:g}=yo({toggleOnClick:!0,placement:"bottom-end",trigger:"click",offset:[0,0]});Je(p,M=>{var N;M&&((N=l.value)==null||N.focus())});const v=X(()=>s.disabled||a.value.length>0),w=X(()=>c.value.filter(M=>M.pinned==="left"&&M.field&&M.headerName)),S=X(()=>c.value.filter(M=>M.pinned==="right"&&M.field||M.field==="blank")),b=X({get:()=>c.value.filter(M=>!M.pinned&&M.field&&M.field!=="blank"),set:M=>{c.value=[...w.value,...M,...S.value]}}),y=X(()=>{if(!a.value)return{};const M=a.value.toLowerCase();return[...c.value,...b.value].reduce((N,B)=>{var z;return(z=B.headerName)!=null&&z.toLowerCase().includes(M)&&B.field&&(N[B.field]=!0),N},{})}),E=X(()=>s.modelValue),_=()=>{const M={};c.value.forEach(N=>{N.field&&(M[N.field]=!N.hide)}),d.value=M},I=X(()=>{if(!a.value)return c.value;const M=a.value.toLowerCase();return c.value.filter(N=>{var B;return(B=N.headerName)==null?void 0:B.toLowerCase().includes(M)})}),T=()=>{var B;const M=(B=s.gridApi)==null?void 0:B.getColumnState().reduce((z,oe)=>(z[oe.colId]=Number(oe.width),z),{}),N=c.value.map(z=>({...z,hide:z.field?!d.value[z.field]:!1,width:z.field?M==null?void 0:M[z.field]:z.width}));i("update:modelValue",N),i("change",N),i("input",N)},F=M=>{const N=[...w.value,...M,...S.value];s.checkboxColumn&&N.unshift(s.checkboxColumn),c.value=N,T()},V=M=>{M&&(d.value[M]=!d.value[M],T())};Je(E,M=>{M&&M.length>0&&(c.value=[...M],_())}),t({updateColumnDefs(M){c.value=[...M],_()}});const x=X(()=>k.value>=5),A=X(()=>s.disabled||a.value.length>0),k=X(()=>c.value.reduce((M,N)=>N.field&&N.field.includes("metric")&&d.value[N.field]===!0?M+1:M,0));return(M,N)=>(q(),de("div",{class:le(M.$style["table-customization"])},[Se("div",{ref_key:"triggerRef",ref:h},[kt(M.$slots,"trigger",{},()=>[ze((q(),Ke(St,{variant:["secondary"],disabled:s.disabled,actived:L(p),style:{width:"32px"},onEscape:L(g)},{prefix:we(()=>[ye(pt,{src:"TableColumns"})]),_:1},8,["disabled","actived","onEscape"])),[[L(r),"7"],[L(o),"Columns"]])])],512),Se("div",{ref_key:"popupRef",ref:f,class:le(M.$style["tippy-content-wrapper"])},[Se("div",{class:le([M.$style["column-config"],x.value?M.$style["has-warning"]:""]),style:hn({"--max-height":s.tableHeight?s.tableHeight:"max(500px, 60vh)"})},[ye(RE,{tabIndex:"7.0",modelValue:a.value,"onUpdate:modelValue":N[0]||(N[0]=B=>a.value=B),ref_key:"searchBoxRef",ref:l},null,8,["modelValue"]),Se("div",{class:le(M.$style["column-config__header"])},[...N[2]||(N[2]=[Se("span",null,"Manage columns",-1)])],2),x.value?(q(),de("div",{key:0,class:le(M.$style["reach-limit"])},[Se("div",Gre,[ye(pt,{src:"InfoCircle",color:"#F7941D",size:14})]),Se("div",{class:le(M.$style["warning-limit-text"])},[...N[3]||(N[3]=[tt(" You’ve reached the maximum number of metric columns. ",-1),Se("br",null,null,-1),tt(" Deselect one to show another. ",-1)])],2)],2)):Ye("",!0),u.value?(q(),de(Pt,{key:1},[I.value.length===0&&u.value?(q(),de("div",{key:0,class:le(M.$style["no-columns"])},[...N[4]||(N[4]=[tt(" No results. ",-1),Se("br",null,null,-1),tt(" Try another search. ",-1)])],2)):Ye("",!0),u.value&&I.value.length>0?(q(),de("div",{key:1,class:le(M.$style["column-config__pinned-section"])},[(q(!0),de(Pt,null,xn(I.value,B=>{var z;return q(),Ke(by,{key:B.colId,item:B,columnStates:d.value,disableDrag:A.value,disableDragTooltip:"Reordering is disabled while search is active.",readOnly:s.readOnly,isDisableNewCheck:x.value&&((z=B.colId)==null?void 0:z.includes("metric")),onToggleColumn:V},null,8,["item","columnStates","disableDrag","readOnly","isDisableNewCheck"])}),128))],2)):Ye("",!0)],64)):Ye("",!0),u.value?Ye("",!0):(q(),de("div",{key:2,class:le(M.$style["column-config__list"])},[(q(!0),de(Pt,null,xn(w.value,B=>ze((q(),Ke(by,{key:B.field,item:B,disabled:B.field!="thumbnail",readOnly:B.field!="thumbnail",disableDrag:!0,disableDragTooltip:" ","disable-checkbox":B.field!="thumbnail",columnStates:d.value,onToggleColumn:V},null,8,["item","disabled","readOnly","disable-checkbox","columnStates"])),[[cr,y.value[B.field]||!a.value]])),128)),ye(Nre,{modelValue:b.value,"onUpdate:modelValue":N[1]||(N[1]=B=>b.value=B),"group-name":"columns",onChanged:F,disabled:v.value,readOnly:s.readOnly},{item:we(({item:B,index:z})=>[ze((q(),Ke(by,{focusIndex:`7.${z+1}`,key:B.id,item:B,columnStates:d.value,disableDrag:A.value,disableDragTooltip:A.value?"Reordering is disabled while search is active.":void 0,readOnly:s.readOnly,isDisableNewCheck:x.value&&B.id.includes("metric"),onToggleColumn:V},null,8,["focusIndex","item","columnStates","disableDrag","disableDragTooltip","readOnly","isDisableNewCheck"])),[[cr,y.value[B.field]||!a.value]])]),_:1},8,["modelValue","disabled","readOnly"]),(q(!0),de(Pt,null,xn(S.value.filter(B=>{var z;return B.headerName&&((z=B.headerName)==null?void 0:z.length)>0}),B=>ze((q(),Ke(by,{key:B.field,item:B,disabled:s.disabled,readOnly:s.readOnly,columnStates:d.value},null,8,["item","disabled","readOnly","columnStates"])),[[cr,y.value[B.field]||!a.value]])),128))],2))],6)],2)],2))}}),[["__cssModules",{$style:{"reach-limit":"_reach-limit_1m3bt_1","reach-limit-icon":"_reach-limit-icon_1m3bt_11","warning-limit-text":"_warning-limit-text_1m3bt_18","table-customization":"_table-customization_1m3bt_24","table-customization__trigger":"_table-customization__trigger_1m3bt_30","column-config":"_column-config_1m3bt_46","has-warning":"_has-warning_1m3bt_61","column-config__header":"_column-config__header_1m3bt_64","icon-color":"_icon-color_1m3bt_73","column-config__list":"_column-config__list_1m3bt_76","column-config__section-label":"_column-config__section-label_1m3bt_80","column-config__footer":"_column-config__footer_1m3bt_89","column-config__add-button":"_column-config__add-button_1m3bt_92","cs-icon":"_cs-icon_1m3bt_110","no-columns":"_no-columns_1m3bt_114"}}]]),wL=_t(nt({__name:"StatusSelect",props:{modelValue:{},getStatusFunc:{},workspaceId:{},id:{},maxWidth:{default:"500px"},focusIndex:{},placeholder:{default:"No status"}},emits:["updated","error","cancel","update:modelValue"],setup(e,{expose:t,emit:n}){const o={PER_PAGE:20,INITIAL_PAGE:1},s=(A,k=0)=>A?`${parseInt(A,10)+k}px`:"auto",r=(A,k=0)=>A?parseInt(A,10)+k:0,i=e,a=$(i.modelValue),l=n,u=X(()=>p.value.find(A=>A.id===a.value)||null),c=A=>{a.value=A.id,l("update:modelValue",A.id)},d=$(null),h=$(null),f=()=>{var A,k;d.value||(A=h.value)==null||A.focus(),(k=d.value)==null||k.focus()},p=$([]),g=$(!1),v=$(!1),w=$(null),S=$(o.INITIAL_PAGE),b=$(!0),y=$(0),E=$(""),_=X(()=>!!(i.id&&i.workspaceId)),I=A=>{const k=p.value.find(M=>M.id===A.value);k&&c(k)},T=A=>({label:A.name,value:A.id,selected:a.value===A.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:A,id:A.id,color:A.color}),F=async(A=o.INITIAL_PAGE,k="",M=!1)=>{var N;if(!_.value){console.error("Missing required props",i);return}M?v.value=!0:g.value=!0,w.value=null;try{const B={workspaceId:String(i.workspaceId),itemIds:i.id,page:A,perPage:o.PER_PAGE,name_like:k.trim()};if(i.getStatusFunc===void 0)throw new Error("API service getAssignableStatus is undefined");const z=await i.getStatusFunc(B);if(!z){M||(p.value=[]),b.value=!1;return}const oe=z.data.map(T);p.value=M?[...p.value,...oe]:oe,y.value=((N=z.meta)==null?void 0:N.total)??z.data.length,b.value=p.value.length<y.value,S.value=A}catch(B){console.error("Error fetching statuses:",B),w.value="Failed to load statuses",M||(p.value=[]),b.value=!1,l("error",w.value)}finally{g.value=!1,v.value=!1}},V=async()=>{!b.value||v.value||await F(S.value+1,E.value,!0)};Je([()=>i.id,()=>i.workspaceId],()=>{F()},{deep:!0,immediate:!0});const x=async A=>{E.value=A,S.value=o.INITIAL_PAGE,await F(o.INITIAL_PAGE,A,!1)};return t({focus:f,clear:()=>{a.value=null,l("update:modelValue",null)},preselect:()=>{var A;(A=d.value)==null||A.selectIndex(0)}}),(A,k)=>(q(),Ke(Hre,{onOpen:f,placement:"bottom-start","max-width":r(i.maxWidth)},{trigger:we(({open:M})=>[ye(KN,{value:u.value,style:{width:"100%"},"read-only":!1,"is-editing":!0,placeholder:i.placeholder,"focus-index":i.focusIndex,isHover:!0,ref_key:"statusRendererRef",ref:h},{suffix:we(()=>[ye(pt,{src:"ChevronUp",source:"remote",class:le([[A.$style["dropdown-icon"]],{[A.$style["dropdown-icon-show"]]:!M}])},null,8,["class"])]),_:2},1032,["value","placeholder","focus-index"])]),content:we(({closeDropdown:M})=>{var N;return[ye(ya,{ref_key:"popupRef",ref:d,"selected-id":(N=u.value)==null?void 0:N.id,options:p.value,loading:g.value,itemWidth:s(i.maxWidth,-10),"loading-more":v.value,"has-more":b.value,error:w.value,onSearch:x,onSelect:B=>{I(B),M()},onLoadMore:V,onCancel:k[0]||(k[0]=B=>l("cancel")),style:hn({width:s(i.maxWidth,-10)})},null,8,["selected-id","options","loading","itemWidth","loading-more","has-more","error","onSelect","style"])]}),_:1},8,["max-width"]))}}),[["__cssModules",{$style:{"status-wrapper":"_status-wrapper_149oc_1",status:"_status_149oc_1","color-indicator":"_color-indicator_149oc_13","status-text":"_status-text_149oc_22",empty:"_empty_149oc_29","dropdown-icon":"_dropdown-icon_149oc_33","dropdown-icon-show":"_dropdown-icon-show_149oc_38",options:"_options_149oc_42"}}]]),CL=e=>({updateCellData:({rowId:n,field:o,value:s})=>{if(!e)return;const r=e.getRowNode(n);r&&r.setDataValue(o,s),e.refreshCells({rowNodes:r?[r]:[],columns:[o],force:!0})}}),Wre={key:2},zre=_t(nt({name:"MetricEditorWrapper",__name:"MetricEditorWrapper",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean},error:{type:Boolean}},emits:["update:value","clear","copy"],setup(e,{emit:t}){var S;const n=e,o=$(n.value),s=$(!0),r=$(""),i=()=>{var V,x,A;const b=(V=c.value)==null?void 0:V.restricted_type.trim(),y=((A=(x=c.value)==null?void 0:x.restricted_value)==null?void 0:A.split(",").map(Number))||[],[E,_]=y,T={range:`Enter a value between ${E} and ${_}`,not:`These values are not allowed: ${y.join(", ")}`,exact:"Value is not allowed"}[b];return s.value?"":T},a=b=>{if(c.value){if(b===null||b===""){s.value=!0;return}if(u.value!=="number"){s.value=!0;return}s.value=bv(c.value,Number(b)),r.value=i()}};X(()=>s.value?{content:"",showOnCreate:!1}:{content:r.value,bypassOverflowCheck:!0,showOnCreate:!0,theme:"error",alwaysShow:!0});const l=$(null),u=X(()=>TO(c.value)),c=X(()=>{var y,E;return((E=(y=n.params)==null?void 0:y.colDef)==null?void 0:E.context)||null}),{apiServices:d}=so(!0,n),{updateCellData:h}=CL((S=n.params)==null?void 0:S.api),f=$(!1),p=li(n,"id"),g=()=>{var b;(b=n.params)==null||b.api.stopEditing()},v=()=>{g()},w=async b=>{var E,_;if(g(),f.value=!0,o.value=b||null,b===n.value){f.value=!1;return}const y={itemIds:[String(p.value)],metricId:((E=c.value)==null?void 0:E.id)||"",workspaceId:String(n.workspaceId)};b==null?y.clear=1:y.value=b,h({rowId:String(p.value),field:`metric_${y.metricId}`,value:void 0});try{const I=await((_=d.value)==null?void 0:_.bulkUpdateMetric(y));console.log("Bulk update response:",I),(I==null?void 0:I.status)==Er.ACCEPTED?h({rowId:String(p.value),field:`metric_${y.metricId}`,value:b||null}):(h({rowId:String(p.value),field:`metric_${y.metricId}`,value:n.value}),console.error("Failed to update metric value:",I),o.value=n.value)}catch(I){console.error("Error during bulk metric update:",I),h({rowId:String(p.value),field:`metric_${y.metricId}`,value:n.value})}finally{f.value=!1}};return(b,y)=>(q(),de("div",{class:"metric-editor-wrapper",ref_key:"metricEditorWrapperRef",ref:l},[u.value=="dropdown"&&c.value?(q(),Ke(lM,{key:0,config:c.value,modelValue:o.value,"onUpdate:modelValue":y[0]||(y[0]=E=>o.value=E),onChange:w,onHandleCancel:v},null,8,["config","modelValue"])):u.value=="number"&&c.value?(q(),Ke(uM,{key:1,showInlineError:!1,autoEmit:!0,config:c.value,modelValue:o.value,"onUpdate:modelValue":y[1]||(y[1]=E=>o.value=E),style:{width:"100%"},onHandleChange:w,onCancel:v,onOnValidation:a},null,8,["config","modelValue"])):(q(),de("div",Wre,"Metric type:"+it(u.value),1))],512))}}),[["__scopeId","data-v-46676959"]]),jre=_t(nt({name:"EmptyData",__name:"EmptyData",props:{isSearching:{type:Boolean},isFiltering:{type:Boolean}},setup(e){const t=e,n={noData:"No data available.",noSearchResults:"No results. Try another search.",noFilterResults:"No results. Try another filter.",emptySearchFilter:"No results. Try another search or filter."};X(()=>t.isSearching||t.isFiltering?"NoDataSearchFilter":"ClickToCreate");const o=X(()=>t.isSearching&&!t.isFiltering?n.noSearchResults:t.isFiltering&&!t.isSearching?n.noFilterResults:t.isSearching&&t.isFiltering?n.emptySearchFilter:n.noData),s=$(!1);return Zt(()=>{s.value=!0}),(r,i)=>(q(),de("div",{class:le(r.$style["no-data-item-table"])},[Se("div",{class:le(r.$style.visual)},[s.value?(q(),Ke(va,{key:0,source:"remote",src:"NoDataGeneral",ratio:"4/3",maxWidth:500,maxHeight:350})):Ye("",!0)],2),Se("div",{class:le(r.$style.description)},it(o.value),3)],2))}}),[["__cssModules",{$style:{"no-data-item-table":"_no-data-item-table_oh0wi_1",visual:"_visual_oh0wi_12",description:"_description_oh0wi_19"}}]]),Kre=(e,t)=>{var r;const n=sessionStorage.getItem("ws.terminology"),o=n?JSON.parse(n):null;return` ${((r=o==null?void 0:o.find(i=>i.code==="scene"))==null?void 0:r.name)||"Scene"} `.trim()},qre={class:"paragraph"},Yre=["href"],Xre=["checked"],Sy="hideDefaultSortingNotification",Zre=_t(nt({name:"DefaultSortingNotification",__name:"DefaultSortingNotification",setup(e,{expose:t}){const n=f=>{f.preventDefault(),f.metaKey||f.ctrlKey?window.open(h.value,"_blank"):window.location.href=h.value,c()},o=()=>{s.value=!s.value},s=$(localStorage.getItem(Sy)==="true"),r=()=>{s.value=localStorage.getItem(Sy)==="true",localStorage.getItem(Sy)!=="true"&&l()},i=()=>{localStorage.setItem(Sy,String(s.value)),c()},{triggerRef:a,show:l,popupRef:u,hide:c}=yo({toggleOnClick:!1,trigger:"manual",appendTo:()=>document.getElementById("item-table-layout-id")||document.body,zIndex:8,offset:[0,8],showOnInit:!1,interactive:!0,showArrow:!0});t({show:r,hide:c});const d=X(()=>Kre()),h=X(()=>{const f=sessionStorage.getItem("BASE_URL")||"",p=sessionStorage.getItem("ws.code")||"";return`${f}/${p}/ac/prf`});return(f,p)=>(q(),de(Pt,null,[Se("div",{class:"main-trigger",ref_key:"triggerRef",ref:a},[kt(f.$slots,"default")],512),Se("div",{class:"popup",ref_key:"popupRef",ref:u},[Se("div",{class:le(f.$style["default-sorting-notification"])},[Se("div",qre,[tt(" This sort only applies to the current list. To change the default sorting for "+it(d.value)+" lists, go to ",1),Se("a",{href:h.value,onClick:n}," My Settings > Preferences ",8,Yre),p[0]||(p[0]=tt(" . ",-1))]),Se("div",{class:le(f.$style.footer)},[Se("label",{class:le(f.$style["checkbox-section"])},[Se("input",{type:"checkbox",checked:s.value,onChange:Ht(o,["stop"]),style:{"--input-size":"16px"}},null,40,Xre),p[1]||(p[1]=tt(" Don't show this tip again ",-1))],2),ye(St,{size:"small",variant:["primary","text"],style:{padding:"0 8px"},onClick:i},{default:we(()=>[...p[2]||(p[2]=[tt(" Got it ",-1)])]),_:1})],2)],2)],512)],64))}}),[["__cssModules",{$style:{"default-sorting-notification":"_default-sorting-notification_5uy9k_1",footer:"_footer_5uy9k_19","checkbox-section":"_checkbox-section_5uy9k_25"}}]]),Sl=nt({name:"HeaderSorting",__name:"HeaderWrapper",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean}},setup(e){const t=e,n=vE(),{sorts:o,defaultSortStorePreferences:s}=mo(n),r=X(()=>{var f,p;return((p=(f=t.params)==null?void 0:f.column)==null?void 0:p.getColId())||"template_col_id"}),i=$(null),a={name:"name",template_flow_status:"status"};Je(()=>s.value,f=>{var p;f!=null&&f.field&&a[f==null?void 0:f.field]==r.value&&((p=i.value)==null||p.setDefaultSort(f))});const l=f=>{var p;r.value&&n.setSort(r.value,f),(p=c.value)==null||p.show()},u=X(()=>t.params.headerType||void 0),c=$(null),d=$("none");Je(()=>o.value,wr(()=>{var f;if(r.value){const p=o.value[r.value];d.value=p?p.sort:"none",d.value=="none"&&((f=i.value)==null||f.clear())}},Si),{deep:!0,immediate:!0});const h=()=>{var f;(f=c.value)==null||f.hide()};return Zt(()=>{var p;const f=(p=t.params)==null?void 0:p.api;f==null||f.addEventListener("bodyScroll",h)}),nu(()=>{var p;const f=(p=t.params)==null?void 0:p.api;f==null||f.removeEventListener("bodyScroll",h)}),(f,p)=>(q(),Ke(Zre,{ref_key:"sortingNotificationRef",ref:c},{default:we(()=>[r.value?(q(),Ke(Use,jt({key:0,ref_key:"headerSortingRef",ref:i},t,{"header-type":u.value,modelValue:d.value,"onUpdate:modelValue":p[0]||(p[0]=g=>d.value=g),onSortChanged:l,onOpen:h}),null,16,["header-type","modelValue"])):Ye("",!0)]),_:1},512))}});function Jre(){const e=Oo({isCreating:!1,name:"",error:void 0,assignees:null,status:null,start_date:null,due_date:null}),t=()=>{const s=e.name.trim();e.status,s.length===0?e.error="Name cannot be empty":s.length>255?e.error="Name cannot exceed 255 characters":e.error=void 0},n=()=>{e.isCreating=!0,e.name="",e.error=void 0,e.assignees=null,e.status=null,e.start_date=null,e.due_date=null},o=()=>{e.isCreating=!1};return Je(()=>e,()=>{t()},{deep:!0}),{newItemData:e,validateNewItem:t,openNewItemForm:n,closeNewItemForm:o,resetNewItemForm:()=>{e.name="",e.assignees=null,e.start_date=null,e.due_date=null,e.error=void 0}}}const Ey=Ja("userStore",()=>{const e=$(null),t=$(null);return{user:e,setUser:s=>{e.value=s},setUserRoleId:s=>{t.value=s},workspaceUserRoleId:t}}),Qre=["innerHTML"],eie=20,tie=_t(nt({__name:"AddNewAssignee",props:{maxVisible:{default:3}},emits:["updated","cancel","start-update","tab","close","show","hide"],setup(e,{expose:t,emit:n}){const o=e,{triggerRef:s,popupRef:r,isVisible:i,show:a,hide:l}=yo({toggleOnClick:!0,appendTo:"parent",offset:[-15,8]}),u=()=>{a()},c=$(null),d=()=>{V.value=[],ne.value=!1},h=X(()=>i.value),f=X(()=>{var K;return{disabled:!1,error:!1,readOnly:!1,isEmpty:((K=V.value)==null?void 0:K.length)===0,wrapperRef:s,active:h,bordered:!0}}),{argsMain:p}=Ao(f),g=Kt,v=n,w=X(()=>{var K;return Math.max(0,(((K=V.value)==null?void 0:K.length)||0)-o.maxVisible)}),S=X(()=>{var K;return w.value<=0?"":((K=V.value)==null?void 0:K.slice(o.maxVisible).map(Y=>Y.name).join(", "))||""}),b=$(!1),y=$(!1),E=$(null),_=$(1),I=$(!0),T=$(0),F=$(""),V=$([]),x=X(()=>{var K;return((K=V.value)==null?void 0:K.map(Y=>Y.id))||[]}),{assigneeList:A,mergedOptions:k}=Iv({...o,value:[]}),{apiServices:M}=so(!1,o),N=Dn("entityId"),B=async(K=1,Y="",re=!1)=>{var G,J,ce,Ee,Ce;if(!M.value)throw console.error("API service or item identifiers are undefined"),new Error("API service or item identifiers are undefined");if(re?y.value=!0:b.value=!0,E.value=null,!((G=M.value)!=null&&G.getAssignableAssignees))throw new Error("API service getAssignableAssignees is undefined");const R=un.getInstance().getItem("ws.code");try{const Ne=await((J=M.value)==null?void 0:J.getAssignableAssignees(String(R),{entity_ids:(N==null?void 0:N.value)||"",page:K,per_page:eie,display_name_like:Y})),pe=((ce=ad(Ne.data))==null?void 0:ce.map(Dv))??[];A.value=re?Kc(A.value,pe,"id"):pe,T.value=Ne.meta.total,I.value=(((Ee=Ne==null?void 0:Ne.meta)==null?void 0:Ee.current_page)||0)<(((Ce=Ne==null?void 0:Ne.meta)==null?void 0:Ce.last_page)||0),_.value=K}catch(Ne){console.error("Error fetching assignable users:",Ne),E.value="Failed to load assignable users"}finally{b.value=!1,y.value=!1}},z=K=>{var Y,re,R;if((Y=V.value)!=null&&Y.some(G=>G.id===K.data.id)){V.value=(re=V.value)==null?void 0:re.filter(G=>G.id!==K.data.id);return}V.value=[...V.value||[],K.data],(R=c.value)==null||R.focus()},oe=()=>{V.value=[]},ie=()=>{!y.value&&I.value&&B(_.value+1,F.value,!0)},te=wr(async K=>{F.value=K,await B(1,K,!1)},Si);Je(()=>i.value,K=>{var Y;K?(B(1,F.value,!1),(Y=c.value)==null||Y.focus(),v("show")):v("hide")});const se=X(()=>{var K;return((K=V.value)==null?void 0:K.slice(0,3))||[]}),Z=X(()=>se.value.map(K=>({id:K.id,name:K.name,initial:K.initial,avatarId:K.id,profile_image:K.profile_image,color:K.color,size:24,user:K}))),P=Ey(),{user:j}=mo(P),ne=$(!1);t({getData:()=>V.value,clear:d,setData:K=>{V.value=K},focus:()=>{a(),ht(()=>{var K;(K=c.value)==null||K.focus()})},hide:()=>{l()}}),Je([V,ne],()=>{v("updated",V.value)},{deep:!0});const ge=K=>{var Y;V.value=(Y=V.value)==null?void 0:Y.filter(re=>re.id!==K)},xe=K=>{var re;const Y=un.getInstance().getItem("ws.code");return((re=M.value)==null?void 0:re.getUserInformation(Y,K))||Promise.resolve(null)},ue=$();return(K,Y)=>(q(),de("div",{class:"new-assignee-wrapper",ref_key:"wrapperRef",ref:ue},[ye(Lo,jt(L(p),{style:{"--icon-size":"18px"}}),{prefix:we(()=>[Z.value.length==0?(q(),de("div",{key:0,class:le([K.$style["icon-wrapper"],"wrapper-prefix"]),onClick:Ht(u,["stop","prevent"])},[ye(pt,{src:"UserPlus",color:"#A6A6A6"})],2)):Ye("",!0)]),default:we(()=>[Se("div",{class:le([K.$style["assignee-row"],K.$style["assignee-selector"]]),ref_key:"triggerRef",ref:s},[Se("div",{style:{flex:1},class:le([K.$style["assignee-row"]])},[(q(!0),de(Pt,null,xn(Z.value,re=>(q(),Ke(ip,{onClear:R=>ge(re.id),key:re.user.id,"disable-remove":!1},{default:we(()=>[ye(Iu,{user:re.user,apiUpdateFunction:xe,appendTo:ue.value},null,8,["user","appendTo"])]),_:2},1032,["onClear"]))),128)),w.value>0?ze((q(),de("div",{key:0,class:le(K.$style["extra-avatars"])},[tt(" +"+it(w.value),1)],2)),[[L(g),S.value]]):Ye("",!0)],2)],2)]),_:1},16),Se("div",{ref_key:"popupRef",ref:r},[ye(ya,jt({"selected-id":x.value},{...o},{options:L(k),loading:b.value,"loading-more":y.value,"has-more":I.value,ref_key:"searchListRef",ref:c,onTab:Y[0]||(Y[0]=re=>v("tab",re)),onSelect:Y[1]||(Y[1]=re=>{z(re),v("start-update")}),onSearch:L(te),onClose:Y[2]||(Y[2]=()=>v("close")),onLoadMore:ie}),{"extra-item":we(()=>[ye(TE,{onClick:oe,label:"Unassign",borderLeft:!0},{icon:we(()=>[ye(pt,{src:"UserXMark",source:"remote"})]),_:1})]),item:we(({item:re,selectedIndex:R,isSelected:G,handleSelect:J,handleItemHover:ce,getHighlightedLabel:Ee,query:Ce,idx:Ne})=>[ye(fl,jt(re,{hover:Ne===R,selected:G(re),type:re.type,onClick:Ht(pe=>J(re,pe),["stop","prevent"]),onMouseover:pe=>ce(Ne),class:K.$style["item-assignee"]}),{prefix:we(()=>[ye(Iu,{user:re.data,apiUpdateFunction:xe,appendTo:L(r)},null,8,["user","appendTo"])]),label:we(({})=>[Ce?ze((q(),de("span",{key:0,class:le([K.$style["item-label"],K.$style.match]),style:{flex:"1"},innerHTML:Ee(re.label)},null,10,Qre)),[[L(g),{content:re.label}]]):ze((q(),de("span",{key:1,class:le(K.$style["item-label"]),style:{flex:"1"}},[tt(it(re.label),1)],2)),[[L(g),{content:re.label}]])]),_:2},1040,["hover","selected","type","onClick","onMouseover","class"])]),_:1},16,["selected-id","options","loading","loading-more","has-more","onSearch"])],512)],512))}}),[["__cssModules",{$style:{"list-item":"_list-item_zw1ld_1",action:"_action_zw1ld_5","item-assignee":"_item-assignee_zw1ld_10","item-action":"_item-action_zw1ld_10","item-label":"_item-label_zw1ld_20","icon-wrapper":"_icon-wrapper_zw1ld_29","error-message":"_error-message_zw1ld_38","empty-state":"_empty-state_zw1ld_48","assignee-row":"_assignee-row_zw1ld_61","assignee-selector":"_assignee-selector_zw1ld_69",seperator:"_seperator_zw1ld_73","extra-avatars":"_extra-avatars_zw1ld_81",list:"_list_zw1ld_1"}}]]),nie={key:0},oie={key:1},sie={key:0},rie={key:1},iie={key:0,class:"wrapper-suffix"},aie={key:0,class:"wrapper-prefix",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"24px",height:"24px"}},lie=_t(nt({__name:"AddNewDate",emits:["updated","tab","show","hide"],setup(e,{expose:t,emit:n}){const o=Kt,{triggerRef:s,popupRef:r,isVisible:i,hide:a,show:l}=yo({toggleOnClick:!0,appendTo:"parent",offset:[0,0]}),u=()=>{c.value=[null,null]},c=$([null,null]),d=_=>{const I=Cv();return _?lt.fromJSDate(_,{zone:I}).toFormat("MMM dd"):""},h=X(()=>i.value),f=X(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:c.value[0]===null&&c.value[1]===null,wrapperRef:s,active:h,bordered:!0})),{argsMain:p}=Ao(f),g=$(!1),v=_=>{S("tab",_)},w=_=>{"start"in _&&_.start!==void 0&&(c.value[0]=_.start),"end"in _&&_.end!==void 0&&(c.value[1]=_.end)};t({getData:()=>c.value,clear:u,setData:_=>{c.value=_},focus:()=>{l(),ht(()=>{var _;(_=b.value)==null||_.focus()})},hide:()=>{a()}});const S=n;Je(()=>c.value,_=>{S("updated",_)},{deep:!0});const b=$(null);Je(()=>i.value,_=>{_?(ht(()=>{var I;(I=b.value)==null||I.focus()}),S("show")):S("hide")});const y=Lv(),{parentConfig:E}=mo(y);return(_,I)=>(q(),de(Pt,null,[ye(Lo,jt({ref_key:"triggerRef",ref:s},L(p),{style:{"--icon-size":"18px",cursor:"pointer"}}),{default:we(({focused:T})=>[Se("div",{class:le(_.$style["date-time"])},[Se("div",{class:le(_.$style.date)},[c.value[0]==null&&(T||L(i))?(q(),de("span",nie,"MMMDD")):(q(),de("span",oie,it(d(c.value[0])),1))],2),c.value[0]!==null||c.value[1]!==null||T||L(i)?(q(),de("div",{key:0,class:le(_.$style.separator)}," → ",2)):Ye("",!0),Se("div",{class:le(_.$style.date)},[c.value[1]==null&&(T||L(i))?(q(),de("span",sie,"MMMDD")):(q(),de("span",rie,it(d(c.value[1])),1))],2)],2)]),suffix:we(({hovered:T,focused:F})=>[(c.value[0]!==null||c.value[1]!==null)&&(T||F||L(i))?(q(),de("div",iie,[ze((q(),Ke(St,{onClick:Ht(u,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:we(()=>[ye(pt,{src:"XMarkSolid",size:"8"})]),_:1})),[[L(o),"Clear"]])])):Ye("",!0)]),prefix:we(()=>[c.value[0]===null&&c.value[1]===null?(q(),de("div",aie,[ye(pt,{src:"Calendar",color:"#A6A6A6"})])):Ye("",!0)]),_:1},16),Se("div",{ref_key:"popupRef",ref:r},[L(i)?(q(),Ke(Nv,{key:0,immediatelyUpdate:!1,value:c.value,onConfirmed:w,ref_key:"calendarRef",ref:b,onClosed:L(a),onStartUpdate:I[0]||(I[0]=T=>g.value=!0),onFinishUpdate:I[1]||(I[1]=T=>g.value=!1),onTab:v,"parent-config":L(E)},null,8,["value","onClosed","parent-config"])):Ye("",!0)],512)],64))}}),[["__cssModules",{$style:{"list-item":"_list-item_n9o5g_2","date-time":"_date-time_n9o5g_5",date:"_date_n9o5g_5",separator:"_separator_n9o5g_18"}}]]),uie=_t(nt({__name:"AddNewStatus",props:{entityId:{}},emits:["updated","error","cancel","update:modelValue","tab","close","show","hide"],setup(e,{expose:t,emit:n}){const o=e,s={PER_PAGE:20,INITIAL_PAGE:1},{triggerRef:r,popupRef:i,isVisible:a,show:l,hide:u}=yo({toggleOnClick:!0,appendTo:"parent"}),c=$(null),d=$([]),h=$(!1),f=$(!1),p=$(null),g=$(s.INITIAL_PAGE),v=$(!0),w=$(0),S=$(""),b=n,y=X(()=>a.value),E=X(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:!c.value,wrapperRef:r,active:y,bordered:!0})),_=$(null),{argsMain:I}=Ao(E),T=X(()=>c.value?d.value.filter(se=>se.id===c.value):[]),F=X(()=>!c.value||T.value.length===0?"":T.value[0].label),V=X(()=>c.value?[c.value]:[]),x=X(()=>{if(!c.value)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6",minWidth:"14px"};const se=T.value[0],Z=String((se==null?void 0:se.color)||"white");return{backgroundColor:Z,border:uS(Z,"white")?"1px solid #ccc":"1px solid #fff",minWidth:"14px"}}),A=se=>({label:se.name,value:se.id,selected:c.value===se.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:se,id:se.id,color:se.color}),{apiServices:k}=so(!1,o),M=async(se=s.INITIAL_PAGE,Z="",P=!1)=>{var j,ne;P?f.value=!0:h.value=!0,p.value=null;try{const ge=un.getInstance().getItem("ws.code"),xe=await((j=k.value)==null?void 0:j.getAssignableStatuses(ge,{entity_id:o.entityId||"",name_like:Z,page:se,per_page:s.PER_PAGE}));if(!xe){P||(d.value=[]),v.value=!1;return}const ue=xe.data.map(A);d.value=P?[...d.value,...ue]:ue,w.value=((ne=xe.meta)==null?void 0:ne.total)??xe.data.length,v.value=d.value.length<w.value,g.value=se}catch(ge){console.error("Error fetching statuses:",ge),p.value="Failed to load statuses",P||(d.value=[]),v.value=!1,b("error",p.value)}finally{h.value=!1,f.value=!1}},N=(se,Z)=>{var j;Z.stopImmediatePropagation(),Z.preventDefault(),Z.stopPropagation();const P=se.id;c.value=P,(j=_.value)==null||j.focus(),b("update:modelValue",c.value),u()},B=async()=>{!v.value||f.value||await M(g.value+1,S.value,!0)},z=async se=>{S.value=se,g.value=s.INITIAL_PAGE,await M(s.INITIAL_PAGE,se,!1)},oe=()=>{c.value=null,b("update:modelValue",null)},ie=()=>{l(),ht(()=>{var se;(se=_.value)==null||se.focus()})};return Je(()=>a.value,se=>{var Z;se?(M(1,S.value,!1),(Z=_.value)==null||Z.focus(),b("show")):b("hide")}),Je(()=>c.value,se=>{b("updated",se)}),t({focus:ie,clear:oe,getData:()=>c.value,setData:se=>{c.value=se},hide:u,autoFillDefault:async()=>{S.value="",await M(1,S.value,!1),d.value.length>0&&(c.value=d.value[0].id,b("update:modelValue",c.value))}}),(se,Z)=>{const P=Sc("tooltip");return q(),de(Pt,null,[ye(Lo,jt({ref_key:"triggerRef",ref:r},L(I),{style:{"--icon-size":"18px"}}),{default:we(()=>[Se("div",{class:le(se.$style.status)},[Se("div",{class:le(se.$style["color-indicator"]),style:hn(x.value)},null,6),ze((q(),de("span",{class:le({[se.$style.empty]:T.value.length===0,[se.$style["status-text"]]:!0})},[tt(it(F.value),1)],2)),[[P,{content:F.value}]])],2)]),_:1},16),Se("div",{ref_key:"popupRef",ref:i},[ye(ya,{style:{width:"200px"},ref_key:"searchListRef",ref:_,"selected-id":V.value,options:d.value,loading:h.value,"loading-more":f.value,"has-more":v.value,error:p.value,onSearch:z,onSelect:N,onLoadMore:B,onCancel:Z[0]||(Z[0]=j=>b("cancel")),onTab:Z[1]||(Z[1]=j=>b("tab",j)),onClose:Z[2]||(Z[2]=()=>b("close"))},null,8,["selected-id","options","loading","loading-more","has-more","error"])],512)],64)}}}),[["__cssModules",{$style:{"list-item":"_list-item_10pcy_2",status:"_status_10pcy_6","color-indicator":"_color-indicator_10pcy_13","count-badge":"_count-badge_10pcy_26","status-text":"_status-text_10pcy_34",empty:"_empty_10pcy_43"}}],["__scopeId","data-v-c2a73a7b"]]),cie=_t(nt({__name:"CreateNewScene",emits:["create-new-item","focus-on-id","search-for-code"],setup(e,{expose:t,emit:n}){const o=["name","assignees","status","date","cancel","create-keep","create"],s=Kt,r=NW("target"),i=Dn("workspaceId"),a=Dn("entityId"),l=n,u=e,{newItemData:c,validateNewItem:d,resetNewItemForm:h,closeNewItemForm:f}=Jre(),{apiServices:p}=so(!1,u),{openSceneHub:g}=fd(),v=$(!1),w=$(!1),S=$(null),b=$({assignees:!1,status:!1,date:!1}),y={name:$(null),assignees:$(null),status:$(null),date:$(null),cancel:$(null),"create-keep":$(null),create:$(null)},E=y.name,_=y.assignees,I=y.status,T=y.date,F=y.cancel,V=y["create-keep"],x=y.create,A=$(new Map),k=X(()=>!!c.error||!c.name.trim()||w.value),M=(pe,H)=>{pe&&A.value.set(H,pe.$el||pe)},N=(pe,H)=>{if(pe==="date"){const[W,be]=Array.isArray(H)?H:[void 0,void 0];c.start_date=W,c.due_date=be}else c[pe]=H},B=()=>{c.isCreating=!0,S.value="name"},z=()=>{c.isCreating=!1,h()},oe=Dn("switchInstance"),{addNotification:ie}=_s(),te=pe=>{l("focus-on-id",pe)},se=(pe,H,W)=>{const be=Sv(void 0,"created");ie({id:String(pe),message:`<div style="display:flex; flex-direction: column; align-items: flex-start;"><b>${be}</b>
168
+ */function ZN(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 Ri(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZN(Object(n),!0).forEach(function(o){ore(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZN(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function iy(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?iy=function(t){return typeof t}:iy=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},iy(e)}function ore(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sa(){return Sa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Sa.apply(this,arguments)}function sre(e,t){if(e==null)return{};var n={},o=Object.keys(e),s,r;for(r=0;r<o.length;r++)s=o[r],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function rre(e,t){if(e==null)return{};var n=sre(e,t),o,s;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var ire="1.14.0";function Ea(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var _a=Ea(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),ap=Ea(/Edge/i),JN=Ea(/firefox/i),lp=Ea(/safari/i)&&!Ea(/chrome/i)&&!Ea(/android/i),QN=Ea(/iP(ad|od|hone)/i),are=Ea(/chrome/i)&&Ea(/android/i),eL={capture:!1,passive:!1};function wn(e,t,n){e.addEventListener(t,n,!_a&&eL)}function gn(e,t,n){e.removeEventListener(t,n,!_a&&eL)}function ay(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function lre(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function Ti(e,t,n,o){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&ay(e,t):ay(e,t))||o&&e===n)return e;if(e===n)break}while(e=lre(e))}return null}var tL=/\s+/g;function Ks(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var o=(" "+e.className+" ").replace(tL," ").replace(" "+t+" "," ");e.className=(o+(n?" "+t:"")).replace(tL," ")}}function Gt(e,t,n){var o=e&&e.style;if(o){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in o)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),o[t]=n+(typeof n=="string"?"":"px")}}function _d(e,t){var n="";if(typeof e=="string")n=e;else do{var o=Gt(e,"transform");o&&o!=="none"&&(n=o+" "+n)}while(!t&&(e=e.parentNode));var s=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return s&&new s(n)}function nL(e,t,n){if(e){var o=e.getElementsByTagName(t),s=0,r=o.length;if(n)for(;s<r;s++)n(o[s],s);return o}return[]}function Di(){var e=document.scrollingElement;return e||document.documentElement}function ko(e,t,n,o,s){if(!(!e.getBoundingClientRect&&e!==window)){var r,i,a,l,u,c,d;if(e!==window&&e.parentNode&&e!==Di()?(r=e.getBoundingClientRect(),i=r.top,a=r.left,l=r.bottom,u=r.right,c=r.height,d=r.width):(i=0,a=0,l=window.innerHeight,u=window.innerWidth,c=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(s=s||e.parentNode,!_a))do if(s&&s.getBoundingClientRect&&(Gt(s,"transform")!=="none"||n&&Gt(s,"position")!=="static")){var h=s.getBoundingClientRect();i-=h.top+parseInt(Gt(s,"border-top-width")),a-=h.left+parseInt(Gt(s,"border-left-width")),l=i+r.height,u=a+r.width;break}while(s=s.parentNode);if(o&&e!==window){var f=_d(s||e),p=f&&f.a,g=f&&f.d;f&&(i/=g,a/=p,d/=p,c/=g,l=i+c,u=a+d)}return{top:i,left:a,bottom:l,right:u,width:d,height:c}}}function oL(e,t,n){for(var o=wl(e,!0),s=ko(e)[t];o;){var r=ko(o)[n],i=void 0;if(i=s>=r,!i)return o;if(o===Di())break;o=wl(o,!1)}return!1}function Rd(e,t,n,o){for(var s=0,r=0,i=e.children;r<i.length;){if(i[r].style.display!=="none"&&i[r]!==Ut.ghost&&(o||i[r]!==Ut.dragged)&&Ti(i[r],n.draggable,e,!1)){if(s===t)return i[r];s++}r++}return null}function d0(e,t){for(var n=e.lastElementChild;n&&(n===Ut.ghost||Gt(n,"display")==="none"||t&&!ay(n,t));)n=n.previousElementSibling;return n||null}function Rr(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==Ut.clone&&(!t||ay(e,t))&&n++;return n}function sL(e){var t=0,n=0,o=Di();if(e)do{var s=_d(e),r=s.a,i=s.d;t+=e.scrollLeft*r,n+=e.scrollTop*i}while(e!==o&&(e=e.parentNode));return[t,n]}function ure(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var o in t)if(t.hasOwnProperty(o)&&t[o]===e[n][o])return Number(n)}return-1}function wl(e,t){if(!e||!e.getBoundingClientRect)return Di();var n=e,o=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var s=Gt(n);if(n.clientWidth<n.scrollWidth&&(s.overflowX=="auto"||s.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(s.overflowY=="auto"||s.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return Di();if(o||t)return n;o=!0}}while(n=n.parentNode);return Di()}function cre(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function h0(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var up;function rL(e,t){return function(){if(!up){var n=arguments,o=this;n.length===1?e.call(o,n[0]):e.apply(o,n),up=setTimeout(function(){up=void 0},t)}}}function dre(){clearTimeout(up),up=void 0}function iL(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function aL(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}var qs="Sortable"+new Date().getTime();function hre(){var e=[],t;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var o=[].slice.call(this.el.children);o.forEach(function(s){if(!(Gt(s,"display")==="none"||s===Ut.ghost)){e.push({target:s,rect:ko(s)});var r=Ri({},e[e.length-1].rect);if(s.thisAnimationDuration){var i=_d(s,!0);i&&(r.top-=i.f,r.left-=i.e)}s.fromRect=r}})}},addAnimationState:function(o){e.push(o)},removeAnimationState:function(o){e.splice(ure(e,{target:o}),1)},animateAll:function(o){var s=this;if(!this.options.animation){clearTimeout(t),typeof o=="function"&&o();return}var r=!1,i=0;e.forEach(function(a){var l=0,u=a.target,c=u.fromRect,d=ko(u),h=u.prevFromRect,f=u.prevToRect,p=a.rect,g=_d(u,!0);g&&(d.top-=g.f,d.left-=g.e),u.toRect=d,u.thisAnimationDuration&&h0(h,d)&&!h0(c,d)&&(p.top-d.top)/(p.left-d.left)===(c.top-d.top)/(c.left-d.left)&&(l=pre(p,h,f,s.options)),h0(d,c)||(u.prevFromRect=c,u.prevToRect=d,l||(l=s.options.animation),s.animate(u,p,d,l)),l&&(r=!0,i=Math.max(i,l),clearTimeout(u.animationResetTimer),u.animationResetTimer=setTimeout(function(){u.animationTime=0,u.prevFromRect=null,u.fromRect=null,u.prevToRect=null,u.thisAnimationDuration=null},l),u.thisAnimationDuration=l)}),clearTimeout(t),r?t=setTimeout(function(){typeof o=="function"&&o()},i):typeof o=="function"&&o(),e=[]},animate:function(o,s,r,i){if(i){Gt(o,"transition",""),Gt(o,"transform","");var a=_d(this.el),l=a&&a.a,u=a&&a.d,c=(s.left-r.left)/(l||1),d=(s.top-r.top)/(u||1);o.animatingX=!!c,o.animatingY=!!d,Gt(o,"transform","translate3d("+c+"px,"+d+"px,0)"),this.forRepaintDummy=fre(o),Gt(o,"transition","transform "+i+"ms"+(this.options.easing?" "+this.options.easing:"")),Gt(o,"transform","translate3d(0,0,0)"),typeof o.animated=="number"&&clearTimeout(o.animated),o.animated=setTimeout(function(){Gt(o,"transition",""),Gt(o,"transform",""),o.animated=!1,o.animatingX=!1,o.animatingY=!1},i)}}}}function fre(e){return e.offsetWidth}function pre(e,t,n,o){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*o.animation}var Td=[],f0={initializeByDefault:!0},cp={mount:function(t){for(var n in f0)f0.hasOwnProperty(n)&&!(n in t)&&(t[n]=f0[n]);Td.forEach(function(o){if(o.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),Td.push(t)},pluginEvent:function(t,n,o){var s=this;this.eventCanceled=!1,o.cancel=function(){s.eventCanceled=!0};var r=t+"Global";Td.forEach(function(i){n[i.pluginName]&&(n[i.pluginName][r]&&n[i.pluginName][r](Ri({sortable:n},o)),n.options[i.pluginName]&&n[i.pluginName][t]&&n[i.pluginName][t](Ri({sortable:n},o)))})},initializePlugins:function(t,n,o,s){Td.forEach(function(a){var l=a.pluginName;if(!(!t.options[l]&&!a.initializeByDefault)){var u=new a(t,n,t.options);u.sortable=t,u.options=t.options,t[l]=u,Sa(o,u.defaults)}});for(var r in t.options)if(t.options.hasOwnProperty(r)){var i=this.modifyOption(t,r,t.options[r]);typeof i<"u"&&(t.options[r]=i)}},getEventProperties:function(t,n){var o={};return Td.forEach(function(s){typeof s.eventProperties=="function"&&Sa(o,s.eventProperties.call(n[s.pluginName],t))}),o},modifyOption:function(t,n,o){var s;return Td.forEach(function(r){t[r.pluginName]&&r.optionListeners&&typeof r.optionListeners[n]=="function"&&(s=r.optionListeners[n].call(t[r.pluginName],o))}),s}};function gre(e){var t=e.sortable,n=e.rootEl,o=e.name,s=e.targetEl,r=e.cloneEl,i=e.toEl,a=e.fromEl,l=e.oldIndex,u=e.newIndex,c=e.oldDraggableIndex,d=e.newDraggableIndex,h=e.originalEvent,f=e.putSortable,p=e.extraEventProperties;if(t=t||n&&n[qs],!!t){var g,v=t.options,w="on"+o.charAt(0).toUpperCase()+o.substr(1);window.CustomEvent&&!_a&&!ap?g=new CustomEvent(o,{bubbles:!0,cancelable:!0}):(g=document.createEvent("Event"),g.initEvent(o,!0,!0)),g.to=i||n,g.from=a||n,g.item=s||n,g.clone=r,g.oldIndex=l,g.newIndex=u,g.oldDraggableIndex=c,g.newDraggableIndex=d,g.originalEvent=h,g.pullMode=f?f.lastPutMode:void 0;var S=Ri(Ri({},p),cp.getEventProperties(o,t));for(var b in S)g[b]=S[b];n&&n.dispatchEvent(g),v[w]&&v[w].call(t,g)}}var mre=["evt"],Ts=function(t,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=o.evt,r=rre(o,mre);cp.pluginEvent.bind(Ut)(t,n,Ri({dragEl:mt,parentEl:eo,ghostEl:Jt,rootEl:zn,nextEl:Nu,lastDownEl:ly,cloneEl:to,cloneHidden:Cl,dragStarted:hp,putSortable:jo,activeSortable:Ut.active,originalEvent:s,oldIndex:Dd,oldDraggableIndex:dp,newIndex:Ys,newDraggableIndex:bl,hideGhostForTarget:pL,unhideGhostForTarget:gL,cloneNowHidden:function(){Cl=!0},cloneNowShown:function(){Cl=!1},dispatchSortableEvent:function(a){hs({sortable:n,name:a,originalEvent:s})}},r))};function hs(e){gre(Ri({putSortable:jo,cloneEl:to,targetEl:mt,rootEl:zn,oldIndex:Dd,oldDraggableIndex:dp,newIndex:Ys,newDraggableIndex:bl},e))}var mt,eo,Jt,zn,Nu,ly,to,Cl,Dd,Ys,dp,bl,uy,jo,Id=!1,cy=!1,dy=[],Lu,Yr,p0,g0,lL,uL,hp,xd,fp,pp=!1,hy=!1,fy,os,m0=[],v0=!1,py=[],gy=typeof document<"u",my=QN,cL=ap||_a?"cssFloat":"float",vre=gy&&!are&&!QN&&"draggable"in document.createElement("div"),dL=function(){if(gy){if(_a)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),hL=function(t,n){var o=Gt(t),s=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),r=Rd(t,0,n),i=Rd(t,1,n),a=r&&Gt(r),l=i&&Gt(i),u=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+ko(r).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+ko(i).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&a.float&&a.float!=="none"){var d=a.float==="left"?"left":"right";return i&&(l.clear==="both"||l.clear===d)?"vertical":"horizontal"}return r&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||u>=s&&o[cL]==="none"||i&&o[cL]==="none"&&u+c>s)?"vertical":"horizontal"},yre=function(t,n,o){var s=o?t.left:t.top,r=o?t.right:t.bottom,i=o?t.width:t.height,a=o?n.left:n.top,l=o?n.right:n.bottom,u=o?n.width:n.height;return s===a||r===l||s+i/2===a+u/2},wre=function(t,n){var o;return dy.some(function(s){var r=s[qs].options.emptyInsertThreshold;if(!(!r||d0(s))){var i=ko(s),a=t>=i.left-r&&t<=i.right+r,l=n>=i.top-r&&n<=i.bottom+r;if(a&&l)return o=s}}),o},fL=function(t){function n(r,i){return function(a,l,u,c){var d=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(r==null&&(i||d))return!0;if(r==null||r===!1)return!1;if(i&&r==="clone")return r;if(typeof r=="function")return n(r(a,l,u,c),i)(a,l,u,c);var h=(i?a:l).options.group.name;return r===!0||typeof r=="string"&&r===h||r.join&&r.indexOf(h)>-1}}var o={},s=t.group;(!s||iy(s)!="object")&&(s={name:s}),o.name=s.name,o.checkPull=n(s.pull,!0),o.checkPut=n(s.put),o.revertClone=s.revertClone,t.group=o},pL=function(){!dL&&Jt&&Gt(Jt,"display","none")},gL=function(){!dL&&Jt&&Gt(Jt,"display","")};gy&&document.addEventListener("click",function(e){if(cy)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),cy=!1,!1},!0);var Vu=function(t){if(mt){t=t.touches?t.touches[0]:t;var n=wre(t.clientX,t.clientY);if(n){var o={};for(var s in t)t.hasOwnProperty(s)&&(o[s]=t[s]);o.target=o.rootEl=n,o.preventDefault=void 0,o.stopPropagation=void 0,n[qs]._onDragOver(o)}}},Cre=function(t){mt&&mt.parentNode[qs]._isOutsideThisEl(t.target)};function Ut(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=Sa({},t),e[qs]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return hL(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(i,a){i.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Ut.supportPointer!==!1&&"PointerEvent"in window&&!lp,emptyInsertThreshold:5};cp.initializePlugins(this,e,n);for(var o in n)!(o in t)&&(t[o]=n[o]);fL(t);for(var s in this)s.charAt(0)==="_"&&typeof this[s]=="function"&&(this[s]=this[s].bind(this));this.nativeDraggable=t.forceFallback?!1:vre,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?wn(e,"pointerdown",this._onTapStart):(wn(e,"mousedown",this._onTapStart),wn(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(wn(e,"dragover",this),wn(e,"dragenter",this)),dy.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Sa(this,hre())}Ut.prototype={constructor:Ut,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(xd=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,mt):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,o=this.el,s=this.options,r=s.preventOnFilter,i=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,u=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,c=s.filter;if(Ire(o),!mt&&!(/mousedown|pointerdown/.test(i)&&t.button!==0||s.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&lp&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=Ti(l,s.draggable,o,!1),!(l&&l.animated)&&ly!==l)){if(Dd=Rr(l),dp=Rr(l,s.draggable),typeof c=="function"){if(c.call(this,t,l,this)){hs({sortable:n,rootEl:u,name:"filter",targetEl:l,toEl:o,fromEl:o}),Ts("filter",n,{evt:t}),r&&t.cancelable&&t.preventDefault();return}}else if(c&&(c=c.split(",").some(function(d){if(d=Ti(u,d.trim(),o,!1),d)return hs({sortable:n,rootEl:d,name:"filter",targetEl:l,fromEl:o,toEl:o}),Ts("filter",n,{evt:t}),!0}),c)){r&&t.cancelable&&t.preventDefault();return}s.handle&&!Ti(u,s.handle,o,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,n,o){var s=this,r=s.el,i=s.options,a=r.ownerDocument,l;if(o&&!mt&&o.parentNode===r){var u=ko(o);if(zn=r,mt=o,eo=mt.parentNode,Nu=mt.nextSibling,ly=o,uy=i.group,Ut.dragged=mt,Lu={target:mt,clientX:(n||t).clientX,clientY:(n||t).clientY},lL=Lu.clientX-u.left,uL=Lu.clientY-u.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,mt.style["will-change"]="all",l=function(){if(Ts("delayEnded",s,{evt:t}),Ut.eventCanceled){s._onDrop();return}s._disableDelayedDragEvents(),!JN&&s.nativeDraggable&&(mt.draggable=!0),s._triggerDragStart(t,n),hs({sortable:s,name:"choose",originalEvent:t}),Ks(mt,i.chosenClass,!0)},i.ignore.split(",").forEach(function(c){nL(mt,c.trim(),y0)}),wn(a,"dragover",Vu),wn(a,"mousemove",Vu),wn(a,"touchmove",Vu),wn(a,"mouseup",s._onDrop),wn(a,"touchend",s._onDrop),wn(a,"touchcancel",s._onDrop),JN&&this.nativeDraggable&&(this.options.touchStartThreshold=4,mt.draggable=!0),Ts("delayStart",this,{evt:t}),i.delay&&(!i.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(ap||_a))){if(Ut.eventCanceled){this._onDrop();return}wn(a,"mouseup",s._disableDelayedDrag),wn(a,"touchend",s._disableDelayedDrag),wn(a,"touchcancel",s._disableDelayedDrag),wn(a,"mousemove",s._delayedDragTouchMoveHandler),wn(a,"touchmove",s._delayedDragTouchMoveHandler),i.supportPointer&&wn(a,"pointermove",s._delayedDragTouchMoveHandler),s._dragStartTimer=setTimeout(l,i.delay)}else l()}},_delayedDragTouchMoveHandler:function(t){var n=t.touches?t.touches[0]:t;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){mt&&y0(mt),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;gn(t,"mouseup",this._disableDelayedDrag),gn(t,"touchend",this._disableDelayedDrag),gn(t,"touchcancel",this._disableDelayedDrag),gn(t,"mousemove",this._delayedDragTouchMoveHandler),gn(t,"touchmove",this._delayedDragTouchMoveHandler),gn(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?wn(document,"pointermove",this._onTouchMove):n?wn(document,"touchmove",this._onTouchMove):wn(document,"mousemove",this._onTouchMove):(wn(mt,"dragend",this),wn(zn,"dragstart",this._onDragStart));try{document.selection?yy(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(Id=!1,zn&&mt){Ts("dragStarted",this,{evt:n}),this.nativeDraggable&&wn(document,"dragover",Cre);var o=this.options;!t&&Ks(mt,o.dragClass,!1),Ks(mt,o.ghostClass,!0),Ut.active=this,t&&this._appendGhost(),hs({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Yr){this._lastX=Yr.clientX,this._lastY=Yr.clientY,pL();for(var t=document.elementFromPoint(Yr.clientX,Yr.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Yr.clientX,Yr.clientY),t!==n);)n=t;if(mt.parentNode[qs]._isOutsideThisEl(t),n)do{if(n[qs]){var o=void 0;if(o=n[qs]._onDragOver({clientX:Yr.clientX,clientY:Yr.clientY,target:t,rootEl:n}),o&&!this.options.dragoverBubble)break}t=n}while(n=n.parentNode);gL()}},_onTouchMove:function(t){if(Lu){var n=this.options,o=n.fallbackTolerance,s=n.fallbackOffset,r=t.touches?t.touches[0]:t,i=Jt&&_d(Jt,!0),a=Jt&&i&&i.a,l=Jt&&i&&i.d,u=my&&os&&sL(os),c=(r.clientX-Lu.clientX+s.x)/(a||1)+(u?u[0]-m0[0]:0)/(a||1),d=(r.clientY-Lu.clientY+s.y)/(l||1)+(u?u[1]-m0[1]:0)/(l||1);if(!Ut.active&&!Id){if(o&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<o)return;this._onDragStart(t,!0)}if(Jt){i?(i.e+=c-(p0||0),i.f+=d-(g0||0)):i={a:1,b:0,c:0,d:1,e:c,f:d};var h="matrix(".concat(i.a,",").concat(i.b,",").concat(i.c,",").concat(i.d,",").concat(i.e,",").concat(i.f,")");Gt(Jt,"webkitTransform",h),Gt(Jt,"mozTransform",h),Gt(Jt,"msTransform",h),Gt(Jt,"transform",h),p0=c,g0=d,Yr=r}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Jt){var t=this.options.fallbackOnBody?document.body:zn,n=ko(mt,!0,my,!0,t),o=this.options;if(my){for(os=t;Gt(os,"position")==="static"&&Gt(os,"transform")==="none"&&os!==document;)os=os.parentNode;os!==document.body&&os!==document.documentElement?(os===document&&(os=Di()),n.top+=os.scrollTop,n.left+=os.scrollLeft):os=Di(),m0=sL(os)}Jt=mt.cloneNode(!0),Ks(Jt,o.ghostClass,!1),Ks(Jt,o.fallbackClass,!0),Ks(Jt,o.dragClass,!0),Gt(Jt,"transition",""),Gt(Jt,"transform",""),Gt(Jt,"box-sizing","border-box"),Gt(Jt,"margin",0),Gt(Jt,"top",n.top),Gt(Jt,"left",n.left),Gt(Jt,"width",n.width),Gt(Jt,"height",n.height),Gt(Jt,"opacity","0.8"),Gt(Jt,"position",my?"absolute":"fixed"),Gt(Jt,"zIndex","100000"),Gt(Jt,"pointerEvents","none"),Ut.ghost=Jt,t.appendChild(Jt),Gt(Jt,"transform-origin",lL/parseInt(Jt.style.width)*100+"% "+uL/parseInt(Jt.style.height)*100+"%")}},_onDragStart:function(t,n){var o=this,s=t.dataTransfer,r=o.options;if(Ts("dragStart",this,{evt:t}),Ut.eventCanceled){this._onDrop();return}Ts("setupClone",this),Ut.eventCanceled||(to=aL(mt),to.draggable=!1,to.style["will-change"]="",this._hideClone(),Ks(to,this.options.chosenClass,!1),Ut.clone=to),o.cloneId=yy(function(){Ts("clone",o),!Ut.eventCanceled&&(o.options.removeCloneOnHide||zn.insertBefore(to,mt),o._hideClone(),hs({sortable:o,name:"clone"}))}),!n&&Ks(mt,r.dragClass,!0),n?(cy=!0,o._loopId=setInterval(o._emulateDragOver,50)):(gn(document,"mouseup",o._onDrop),gn(document,"touchend",o._onDrop),gn(document,"touchcancel",o._onDrop),s&&(s.effectAllowed="move",r.setData&&r.setData.call(o,s,mt)),wn(document,"drop",o),Gt(mt,"transform","translateZ(0)")),Id=!0,o._dragStartId=yy(o._dragStarted.bind(o,n,t)),wn(document,"selectstart",o),hp=!0,lp&&Gt(document.body,"user-select","none")},_onDragOver:function(t){var n=this.el,o=t.target,s,r,i,a=this.options,l=a.group,u=Ut.active,c=uy===l,d=a.sort,h=jo||u,f,p=this,g=!1;if(v0)return;function v(oe,ie){Ts(oe,p,Ri({evt:t,isOwner:c,axis:f?"vertical":"horizontal",revert:i,dragRect:s,targetRect:r,canSort:d,fromSortable:h,target:o,completed:S,onMove:function(se,Z){return vy(zn,n,mt,s,se,ko(se),t,Z)},changed:b},ie))}function w(){v("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function S(oe){return v("dragOverCompleted",{insertion:oe}),oe&&(c?u._hideClone():u._showClone(p),p!==h&&(Ks(mt,jo?jo.options.ghostClass:u.options.ghostClass,!1),Ks(mt,a.ghostClass,!0)),jo!==p&&p!==Ut.active?jo=p:p===Ut.active&&jo&&(jo=null),h===p&&(p._ignoreWhileAnimating=o),p.animateAll(function(){v("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(o===mt&&!mt.animated||o===n&&!o.animated)&&(xd=null),!a.dragoverBubble&&!t.rootEl&&o!==document&&(mt.parentNode[qs]._isOutsideThisEl(t.target),!oe&&Vu(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function b(){Ys=Rr(mt),bl=Rr(mt,a.draggable),hs({sortable:p,name:"change",toEl:n,newIndex:Ys,newDraggableIndex:bl,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),o=Ti(o,a.draggable,n,!0),v("dragOver"),Ut.eventCanceled)return g;if(mt.contains(t.target)||o.animated&&o.animatingX&&o.animatingY||p._ignoreWhileAnimating===o)return S(!1);if(cy=!1,u&&!a.disabled&&(c?d||(i=eo!==zn):jo===this||(this.lastPutMode=uy.checkPull(this,u,mt,t))&&l.checkPut(this,u,mt,t))){if(f=this._getDirection(t,o)==="vertical",s=ko(mt),v("dragOverValid"),Ut.eventCanceled)return g;if(i)return eo=zn,w(),this._hideClone(),v("revert"),Ut.eventCanceled||(Nu?zn.insertBefore(mt,Nu):zn.appendChild(mt)),S(!0);var y=d0(n,a.draggable);if(!y||_re(t,f,this)&&!y.animated){if(y===mt)return S(!1);if(y&&n===t.target&&(o=y),o&&(r=ko(o)),vy(zn,n,mt,s,o,r,t,!!o)!==!1)return w(),n.appendChild(mt),eo=n,b(),S(!0)}else if(y&&Ere(t,f,this)){var E=Rd(n,0,a,!0);if(E===mt)return S(!1);if(o=E,r=ko(o),vy(zn,n,mt,s,o,r,t,!1)!==!1)return w(),n.insertBefore(mt,E),eo=n,b(),S(!0)}else if(o.parentNode===n){r=ko(o);var _=0,I,T=mt.parentNode!==n,F=!yre(mt.animated&&mt.toRect||s,o.animated&&o.toRect||r,f),V=f?"top":"left",x=oL(o,"top","top")||oL(mt,"top","top"),A=x?x.scrollTop:void 0;xd!==o&&(I=r[V],pp=!1,hy=!F&&a.invertSwap||T),_=Rre(t,o,r,f,F?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,hy,xd===o);var k;if(_!==0){var M=Rr(mt);do M-=_,k=eo.children[M];while(k&&(Gt(k,"display")==="none"||k===Jt))}if(_===0||k===o)return S(!1);xd=o,fp=_;var N=o.nextElementSibling,B=!1;B=_===1;var z=vy(zn,n,mt,s,o,r,t,B);if(z!==!1)return(z===1||z===-1)&&(B=z===1),v0=!0,setTimeout(Sre,30),w(),B&&!N?n.appendChild(mt):o.parentNode.insertBefore(mt,B?N:o),x&&iL(x,0,A-x.scrollTop),eo=mt.parentNode,I!==void 0&&!hy&&(fy=Math.abs(I-ko(o)[V])),b(),S(!0)}if(n.contains(mt))return S(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){gn(document,"mousemove",this._onTouchMove),gn(document,"touchmove",this._onTouchMove),gn(document,"pointermove",this._onTouchMove),gn(document,"dragover",Vu),gn(document,"mousemove",Vu),gn(document,"touchmove",Vu)},_offUpEvents:function(){var t=this.el.ownerDocument;gn(t,"mouseup",this._onDrop),gn(t,"touchend",this._onDrop),gn(t,"pointerup",this._onDrop),gn(t,"touchcancel",this._onDrop),gn(document,"selectstart",this)},_onDrop:function(t){var n=this.el,o=this.options;if(Ys=Rr(mt),bl=Rr(mt,o.draggable),Ts("drop",this,{evt:t}),eo=mt&&mt.parentNode,Ys=Rr(mt),bl=Rr(mt,o.draggable),Ut.eventCanceled){this._nulling();return}Id=!1,hy=!1,pp=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),w0(this.cloneId),w0(this._dragStartId),this.nativeDraggable&&(gn(document,"drop",this),gn(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),lp&&Gt(document.body,"user-select",""),Gt(mt,"transform",""),t&&(hp&&(t.cancelable&&t.preventDefault(),!o.dropBubble&&t.stopPropagation()),Jt&&Jt.parentNode&&Jt.parentNode.removeChild(Jt),(zn===eo||jo&&jo.lastPutMode!=="clone")&&to&&to.parentNode&&to.parentNode.removeChild(to),mt&&(this.nativeDraggable&&gn(mt,"dragend",this),y0(mt),mt.style["will-change"]="",hp&&!Id&&Ks(mt,jo?jo.options.ghostClass:this.options.ghostClass,!1),Ks(mt,this.options.chosenClass,!1),hs({sortable:this,name:"unchoose",toEl:eo,newIndex:null,newDraggableIndex:null,originalEvent:t}),zn!==eo?(Ys>=0&&(hs({rootEl:eo,name:"add",toEl:eo,fromEl:zn,originalEvent:t}),hs({sortable:this,name:"remove",toEl:eo,originalEvent:t}),hs({rootEl:eo,name:"sort",toEl:eo,fromEl:zn,originalEvent:t}),hs({sortable:this,name:"sort",toEl:eo,originalEvent:t})),jo&&jo.save()):Ys!==Dd&&Ys>=0&&(hs({sortable:this,name:"update",toEl:eo,originalEvent:t}),hs({sortable:this,name:"sort",toEl:eo,originalEvent:t})),Ut.active&&((Ys==null||Ys===-1)&&(Ys=Dd,bl=dp),hs({sortable:this,name:"end",toEl:eo,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){Ts("nulling",this),zn=mt=eo=Jt=Nu=to=ly=Cl=Lu=Yr=hp=Ys=bl=Dd=dp=xd=fp=jo=uy=Ut.dragged=Ut.ghost=Ut.clone=Ut.active=null,py.forEach(function(t){t.checked=!0}),py.length=p0=g0=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":mt&&(this._onDragOver(t),bre(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],n,o=this.el.children,s=0,r=o.length,i=this.options;s<r;s++)n=o[s],Ti(n,i.draggable,this.el,!1)&&t.push(n.getAttribute(i.dataIdAttr)||Dre(n));return t},sort:function(t,n){var o={},s=this.el;this.toArray().forEach(function(r,i){var a=s.children[i];Ti(a,this.options.draggable,s,!1)&&(o[r]=a)},this),n&&this.captureAnimationState(),t.forEach(function(r){o[r]&&(s.removeChild(o[r]),s.appendChild(o[r]))}),n&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,n){return Ti(t,n||this.options.draggable,this.el,!1)},option:function(t,n){var o=this.options;if(n===void 0)return o[t];var s=cp.modifyOption(this,t,n);typeof s<"u"?o[t]=s:o[t]=n,t==="group"&&fL(o)},destroy:function(){Ts("destroy",this);var t=this.el;t[qs]=null,gn(t,"mousedown",this._onTapStart),gn(t,"touchstart",this._onTapStart),gn(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(gn(t,"dragover",this),gn(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),dy.splice(dy.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!Cl){if(Ts("hideClone",this),Ut.eventCanceled)return;Gt(to,"display","none"),this.options.removeCloneOnHide&&to.parentNode&&to.parentNode.removeChild(to),Cl=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(Cl){if(Ts("showClone",this),Ut.eventCanceled)return;mt.parentNode==zn&&!this.options.group.revertClone?zn.insertBefore(to,mt):Nu?zn.insertBefore(to,Nu):zn.appendChild(to),this.options.group.revertClone&&this.animate(mt,to),Gt(to,"display",""),Cl=!1}}};function bre(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function vy(e,t,n,o,s,r,i,a){var l,u=e[qs],c=u.options.onMove,d;return window.CustomEvent&&!_a&&!ap?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=t,l.from=e,l.dragged=n,l.draggedRect=o,l.related=s||t,l.relatedRect=r||ko(t),l.willInsertAfter=a,l.originalEvent=i,e.dispatchEvent(l),c&&(d=c.call(u,l,i)),d}function y0(e){e.draggable=!1}function Sre(){v0=!1}function Ere(e,t,n){var o=ko(Rd(n.el,0,n.options,!0)),s=10;return t?e.clientX<o.left-s||e.clientY<o.top&&e.clientX<o.right:e.clientY<o.top-s||e.clientY<o.bottom&&e.clientX<o.left}function _re(e,t,n){var o=ko(d0(n.el,n.options.draggable)),s=10;return t?e.clientX>o.right+s||e.clientX<=o.right&&e.clientY>o.bottom&&e.clientX>=o.left:e.clientX>o.right&&e.clientY>o.top||e.clientX<=o.right&&e.clientY>o.bottom+s}function Rre(e,t,n,o,s,r,i,a){var l=o?e.clientY:e.clientX,u=o?n.height:n.width,c=o?n.top:n.left,d=o?n.bottom:n.right,h=!1;if(!i){if(a&&fy<u*s){if(!pp&&(fp===1?l>c+u*r/2:l<d-u*r/2)&&(pp=!0),pp)h=!0;else if(fp===1?l<c+fy:l>d-fy)return-fp}else if(l>c+u*(1-s)/2&&l<d-u*(1-s)/2)return Tre(t)}return h=h||i,h&&(l<c+u*r/2||l>d-u*r/2)?l>c+u/2?1:-1:0}function Tre(e){return Rr(mt)<Rr(e)?1:-1}function Dre(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,o=0;n--;)o+=t.charCodeAt(n);return o.toString(36)}function Ire(e){py.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var o=t[n];o.checked&&py.push(o)}}function yy(e){return setTimeout(e,0)}function w0(e){return clearTimeout(e)}gy&&wn(document,"touchmove",function(e){(Ut.active||Id)&&e.cancelable&&e.preventDefault()}),Ut.utils={on:wn,off:gn,css:Gt,find:nL,is:function(t,n){return!!Ti(t,n,t,!1)},extend:cre,throttle:rL,closest:Ti,toggleClass:Ks,clone:aL,index:Rr,nextTick:yy,cancelNextTick:w0,detectDirection:hL,getChild:Rd},Ut.get=function(e){return e[qs]},Ut.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(o){if(!o.prototype||!o.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));o.utils&&(Ut.utils=Ri(Ri({},Ut.utils),o.utils)),cp.mount(o)})},Ut.create=function(e,t){return new Ut(e,t)},Ut.version=ire;var Co=[],gp,C0,b0=!1,S0,E0,wy,mp;function xre(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return e.prototype={dragStarted:function(n){var o=n.originalEvent;this.sortable.nativeDraggable?wn(document,"dragover",this._handleAutoScroll):this.options.supportPointer?wn(document,"pointermove",this._handleFallbackAutoScroll):o.touches?wn(document,"touchmove",this._handleFallbackAutoScroll):wn(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var o=n.originalEvent;!this.options.dragOverBubble&&!o.rootEl&&this._handleAutoScroll(o)},drop:function(){this.sortable.nativeDraggable?gn(document,"dragover",this._handleAutoScroll):(gn(document,"pointermove",this._handleFallbackAutoScroll),gn(document,"touchmove",this._handleFallbackAutoScroll),gn(document,"mousemove",this._handleFallbackAutoScroll)),mL(),Cy(),dre()},nulling:function(){wy=C0=gp=b0=mp=S0=E0=null,Co.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,o){var s=this,r=(n.touches?n.touches[0]:n).clientX,i=(n.touches?n.touches[0]:n).clientY,a=document.elementFromPoint(r,i);if(wy=n,o||this.options.forceAutoScrollFallback||ap||_a||lp){_0(n,this.options,a,o);var l=wl(a,!0);b0&&(!mp||r!==S0||i!==E0)&&(mp&&mL(),mp=setInterval(function(){var u=wl(document.elementFromPoint(r,i),!0);u!==l&&(l=u,Cy()),_0(n,s.options,u,o)},10),S0=r,E0=i)}else{if(!this.options.bubbleScroll||wl(a,!0)===Di()){Cy();return}_0(n,this.options,wl(a,!1),!1)}}},Sa(e,{pluginName:"scroll",initializeByDefault:!0})}function Cy(){Co.forEach(function(e){clearInterval(e.pid)}),Co=[]}function mL(){clearInterval(mp)}var _0=rL(function(e,t,n,o){if(t.scroll){var s=(e.touches?e.touches[0]:e).clientX,r=(e.touches?e.touches[0]:e).clientY,i=t.scrollSensitivity,a=t.scrollSpeed,l=Di(),u=!1,c;C0!==n&&(C0=n,Cy(),gp=t.scroll,c=t.scrollFn,gp===!0&&(gp=wl(n,!0)));var d=0,h=gp;do{var f=h,p=ko(f),g=p.top,v=p.bottom,w=p.left,S=p.right,b=p.width,y=p.height,E=void 0,_=void 0,I=f.scrollWidth,T=f.scrollHeight,F=Gt(f),V=f.scrollLeft,x=f.scrollTop;f===l?(E=b<I&&(F.overflowX==="auto"||F.overflowX==="scroll"||F.overflowX==="visible"),_=y<T&&(F.overflowY==="auto"||F.overflowY==="scroll"||F.overflowY==="visible")):(E=b<I&&(F.overflowX==="auto"||F.overflowX==="scroll"),_=y<T&&(F.overflowY==="auto"||F.overflowY==="scroll"));var A=E&&(Math.abs(S-s)<=i&&V+b<I)-(Math.abs(w-s)<=i&&!!V),k=_&&(Math.abs(v-r)<=i&&x+y<T)-(Math.abs(g-r)<=i&&!!x);if(!Co[d])for(var M=0;M<=d;M++)Co[M]||(Co[M]={});(Co[d].vx!=A||Co[d].vy!=k||Co[d].el!==f)&&(Co[d].el=f,Co[d].vx=A,Co[d].vy=k,clearInterval(Co[d].pid),(A!=0||k!=0)&&(u=!0,Co[d].pid=setInterval((function(){o&&this.layer===0&&Ut.active._onTouchMove(wy);var N=Co[this.layer].vy?Co[this.layer].vy*a:0,B=Co[this.layer].vx?Co[this.layer].vx*a:0;typeof c=="function"&&c.call(Ut.dragged.parentNode[qs],B,N,e,wy,Co[this.layer].el)!=="continue"||iL(Co[this.layer].el,B,N)}).bind({layer:d}),24))),d++}while(t.bubbleScroll&&h!==l&&(h=wl(h,!1)));b0=u}},30),vL=function(t){var n=t.originalEvent,o=t.putSortable,s=t.dragEl,r=t.activeSortable,i=t.dispatchSortableEvent,a=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(n){var u=o||r;a();var c=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,d=document.elementFromPoint(c.clientX,c.clientY);l(),u&&!u.el.contains(d)&&(i("spill"),this.onSpill({dragEl:s,putSortable:o}))}};function R0(){}R0.prototype={startIndex:null,dragStart:function(t){var n=t.oldDraggableIndex;this.startIndex=n},onSpill:function(t){var n=t.dragEl,o=t.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var s=Rd(this.sortable.el,this.startIndex,this.options);s?this.sortable.el.insertBefore(n,s):this.sortable.el.appendChild(n),this.sortable.animateAll(),o&&o.animateAll()},drop:vL},Sa(R0,{pluginName:"revertOnSpill"});function T0(){}T0.prototype={onSpill:function(t){var n=t.dragEl,o=t.putSortable,s=o||this.sortable;s.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),s.animateAll()},drop:vL},Sa(T0,{pluginName:"removeOnSpill"}),Ut.mount(new xre),Ut.mount(T0,R0);function Are(e,t){return Object.values(e).indexOf(t)}function Pre(e,t,n,o){if(!e)return[];const s=Object.values(e),r=t.length-o;return[...t].map((a,l)=>l>=r?s.length:s.indexOf(a))}function kre(e){return["transition-group","TransitionGroup"].includes(e)}function yL(e){if(!e||e.length!==1)return!1;const[{type:t}]=e;return t?kre(t.name):!1}function Fre(e,t){return t?{...t.props,...t.attrs}:e}const D0=["Start","Add","Remove","Update","End"],I0=["Choose","Unchoose","Sort","Filter","Clone"],Ore=["Move",...D0,...I0].map(e=>"on"+e);let x0=null;const Mre=nt({name:"VueDraggableNext",inheritAttrs:!1,props:{options:Object,list:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:e=>e},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null},component:{type:String,default:null},modelValue:{type:Array,required:!1,default:null}},emits:["update:modelValue","move","change",...D0.map(e=>e.toLowerCase()),...I0.map(e=>e.toLowerCase())],setup(e,{emit:t,slots:n,attrs:o}){const s=$(!1),r=$(!1),i=$(0),a=$(0),l=$([]),u=$(null),c=$(null),d=X(()=>e.list?e.list:e.modelValue),h=oo();function f(){return e.component?jW(e.component):e.tag}function p(P){if(c.value)for(const j in P){const ne=YN(j);Ore.indexOf(ne)===-1&&c.value.option(ne,P[j])}}function g(){var P;return((P=h==null?void 0:h.proxy)==null?void 0:P.$el.children)||[]}async function v(){var P;await ht(),l.value=Pre(g(),((P=h==null?void 0:h.proxy)==null?void 0:P.$el.children)||[],s.value,a.value)}function w(P){const j=Are(g()||[],P);if(j===-1)return null;const ne=d.value?d.value[j]:null;return{index:j,element:ne}}function S(P){ht(()=>t("change",P))}function b(P){if(e.list){P(e.list);return}const j=[...e.modelValue||[]];P(j),t("update:modelValue",j)}function y(...P){b(ne=>ne.splice(...P))}function E(P,j){b(ge=>ge.splice(j,0,ge.splice(P,1)[0]))}function _(P){const j=l.value,ne=j.length;return P>ne-1?ne:j[P]}function I(){var j,ne;return n.default&&((ne=(j=n.default()[0])==null?void 0:j.component)==null?void 0:ne.proxy)||null}function T(P){if(!e.noTransitionOnDrag||!s.value)return;const j=g();j[P]&&(j[P].data=null);const ne=I();ne&&(ne.children=[],ne.kept=void 0)}function F(P){v(),u.value=w(P.item),u.value&&(P.item._underlying_vm_=e.clone(u.value.element),x0=P.item)}function V(P){const j=P.item._underlying_vm_;if(j===void 0)return;c0(P.item);const ne=_(P.newIndex);y(ne,0,j),v(),S({added:{element:j,newIndex:ne}})}function x(P){var ne;if(XN((ne=h==null?void 0:h.proxy)==null?void 0:ne.$el,P.item,P.oldIndex),P.pullMode==="clone"){c0(P.clone);return}if(!u.value)return;const j=u.value.index;y(j,1),T(j),S({removed:{element:u.value.element,oldIndex:j}})}function A(P){var ge,xe;c0(P.item),XN(P.from,P.item,P.oldIndex);const j=(ge=u.value)==null?void 0:ge.index,ne=_(P.newIndex);E(j,ne),S({moved:{element:(xe=u.value)==null?void 0:xe.element,oldIndex:j,newIndex:ne}})}function k(P,j){Object.prototype.hasOwnProperty.call(P,j)&&(P[j]+=i.value)}function M(P){return P.__draggable_component__}function N({to:P,related:j}){const ne=M(P);if(!ne)return{component:ne};const ge=ne.realList,xe={list:ge,component:ne};if(P!==j&&ge&&ne.getUnderlyingVm){const ue=ne.getUnderlyingVm(j);if(ue)return Object.assign(ue,xe)}return xe}function B(P,j){const ne=[...j.to.children].filter(K=>K.style.display!=="none");if(ne.length===0)return 0;const ge=ne.indexOf(j.related),xe=P.component.getVmIndex(ge);return ne.indexOf(x0)!==-1||!j.willInsertAfter?xe:xe+1}const z=()=>{var xe,ue;const P={};D0.forEach(K=>{P["on"+K]=ie(K)}),I0.forEach(K=>{P["on"+K]=oe.bind(null,K)});const j=Object.keys(o).reduce((K,Y)=>(K[YN(Y)]=o[Y],K),{}),ne=Object.assign({},j,P,{onMove:(K,Y)=>te(K,Y)});"draggable"in ne||(ne.draggable=">*");const ge=((xe=h==null?void 0:h.proxy)==null?void 0:xe.$el.nodeType)===1?h.proxy.$el:((ue=h==null?void 0:h.proxy)==null?void 0:ue.$el.parentElement)||null;ge&&(c.value=new Ut(ge,ne),ge.__draggable_component__=h==null?void 0:h.proxy,v())};function oe(P,j){ht(()=>t(P.toLowerCase(),j))}function ie(P){return j=>{if(d.value!==null){const ne="onDrag"+P,ge=Z[ne];ge&&ge(j)}oe(P,j)}}function te(P,j){const ne=e.move;if(!ne||!d.value)return!0;const ge=N(P),xe=u.value,ue=B(ge,P);xe&&Object.assign(xe,{futureIndex:ue});const K=Object.assign({},P,{relatedContext:ge,draggedContext:xe});return ne(K,j)}function se(){v(),x0=null}const Z={onDragStart:F,onDragAdd:V,onDragRemove:x,onDragUpdate:A,onDragMove:te,onDragEnd:se};return Zt(()=>{z()}),e.list!==null&&e.modelValue!==null&&ere.error("list props are mutually exclusive! Please set one."),{getTag:f,realList:d,visibleIndexes:l,noneFunctionalComponentMode:r,headerOffset:i,footerOffset:a,transitionMode:s,computeIndexes:v,updateOptions:p,getChildrenNodes:g,getUnderlyingVm:w,emitChanges:S,alterList:b,spliceList:y,updatePosition:E,getVmIndex:_,getComponent:I,resetTransitionData:T,onDragStart:F,onDragAdd:V,onDragRemove:x,onDragUpdate:A,updateProperty:k,onDragMove:te,onDragEnd:se,mounted:z,context:u,sortableInstance:c,getRelatedContextFromMoveEvent:N,getTargetedComponent:M,computeFutureIndex:B}},render(){const e=this.getTag(),t=Fre(this.$attrs,this.componentData);if(typeof e=="string"){const o=this.$slots.default&&typeof this.$slots.default=="function"?this.$slots.default():null;return o?(this.transitionMode=yL(o),Tc(e,t,o)):Tc(e,t,[])}const n=this.$slots.default?{default:this.$slots.default}:{};if(this.$slots.default){const o=typeof this.$slots.default=="function"?this.$slots.default():null;this.transitionMode=yL(o||[])}return Tc(e,t,n)}}),Nre=_t(nt({__name:"DragDropList",props:{modelValue:{},groupName:{},disabled:{type:Boolean},readOnly:{type:Boolean}},emits:["changed","update:modelValue"],setup(e,{emit:t}){const n=$([]),o=e,s=t,r=$({}),i=()=>{n.value=o.modelValue.map(u=>({id:u.field,name:u.headerName,...u}))||[],o.modelValue.forEach(u=>{r.value[u.field]={...u}})};Je(()=>o.modelValue,u=>{i()},{immediate:!0,deep:!0}),Je(n,u=>{if(u.length===o.modelValue.length&&!u.every((d,h)=>d.id===o.modelValue[h].field)){const d=u.map(h=>r.value[h.id]);s("changed",d),s("update:modelValue",d)}});const a=()=>!(o.readOnly||o.disabled),l=u=>!(o.readOnly||o.disabled);return(u,c)=>(q(),Ke(L(Mre),{modelValue:n.value,"onUpdate:modelValue":c[0]||(c[0]=d=>n.value=d),tag:"transition-group",disabled:o.disabled||o.readOnly,onMove:l,onStart:a,"item-key":"id","component-data":{tag:"div",type:"transition",name:"fade"},animation:300,easing:"cubic-bezier(0.4, 0, 0.2, 1)","ghost-class":"ghost","chosen-class":"chosen","drag-class":"drag"},{default:we(()=>[(q(!0),de(Pt,null,xn(n.value,(d,h)=>(q(),de("div",{key:d.id,class:"fade-item"},[kt(u.$slots,"item",{item:d,index:h},()=>[tt(it(d.name),1)],!0)]))),128))]),_:3},8,["modelValue","disabled"]))}}),[["__scopeId","data-v-2106e8ed"]]),Lre={key:0},Vre={key:1,style:{"font-style":"italic"}},Bre={key:2,style:{"font-style":"italic"}},$re={key:3},by=_t(nt({__name:"DragDropItem",props:{item:{},isDisableNewCheck:{type:Boolean,default:!1},disableDrag:{type:Boolean,default:!1},disableCheckbox:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},columnStates:{},disableDragTooltip:{default:""},focusIndex:{}},emits:["toggle-column"],setup(e,{emit:t}){const n=Kt,o=e,s=$(o.columnStates[String(o.item.field)]||!1),r=t,i=h=>{s.value=h},a=X(()=>{var h;return(h=o.item)==null?void 0:h.context}),l=X(()=>{var f,p,g;return(f=a.value)!=null&&f.formula?"formular":((g=(p=a.value)==null?void 0:p.metric_type)==null?void 0:g.code)||"number"}),u=X(()=>{var h,f;return(f=(h=o.item)==null?void 0:h.field)==null?void 0:f.includes("metric")}),c=X(()=>{var h;return u.value&&((h=a.value)==null?void 0:h.is_primary)==1}),d=X(()=>{var h;return u.value&&((h=a.value)==null?void 0:h.is_point_metric)==1});return Je(()=>s.value,()=>{r("toggle-column",o.item.field,o.item.required)}),(h,f)=>(q(),de("div",{key:e.item.field,class:le([h.$style["column-config__item"],{[h.$style.disabled]:o.readOnly,[h.$style["is-metric"]]:u.value,[h.$style["is-point-metric"]]:d.value,[h.$style["is-woohoo-metric"]]:c.value}])},[ye(jN,{focusIndex:o.focusIndex,id:`col-${e.item.field}`,"model-value":s.value==!0?L(Ot).CHECKED:L(Ot).UNCHECK,"onUpdate:modelValue":i,disabled:o.disableCheckbox||e.isDisableNewCheck&&!s.value,size:"16px"},null,8,["focusIndex","id","model-value","disabled"]),ze((q(),de("div",{class:"move-handler",style:hn({cursor:o.disableDrag?"not-allowed":"move"})},[ye(pt,{color:o.disableDrag?"#D7D7D7":"#6B6B6B",source:"remote",src:"GripVertical",class:le(h.$style.handler)},null,8,["color","class"])],4)),[[L(n),o.disableDrag==!0?o.disableDragTooltip:""]]),u.value?(q(),de("div",{key:0,class:le(h.$style["metric-type"])},[l.value=="rating"?(q(),de("span",Lre,"★")):l.value=="formular"?(q(),de("span",Vre," ƒx ")):l.value=="number"?(q(),de("span",Bre," # ")):(q(),de("span",$re,it(l.value),1))],2)):Ye("",!0),Se("span",{class:le(h.$style["column-config__item-label"])},[ze((q(),de("div",null,[tt(it(e.item.headerName),1)])),[[L(n),{content:e.item.headerName}]])],2),d.value?ze((q(),de("div",{key:1,class:le(h.$style["metric-icon"])},[ye(pt,{src:"Bullseye",color:"#A6A6A6"})],2)),[[L(n),"Point metric"]]):Ye("",!0),c.value?ze((q(),de("div",{key:2,class:le(h.$style["metric-icon"])},[ye(pt,{src:"ChartPie",color:"#A6A6A6"})],2)),[[L(n),"Woohoo metric"]]):Ye("",!0)],2))}}),[["__cssModules",{$style:{"column-config__item":"_column-config__item_1ppdl_1","is-metric":"_is-metric_1ppdl_8","is-woohoo-metric":"_is-woohoo-metric_1ppdl_12","is-point-metric":"_is-point-metric_1ppdl_15","column-config__item-label":"_column-config__item-label_1ppdl_18",disabled:"_disabled_1ppdl_34",readOnly:"_readOnly_1ppdl_38","column-config__item--pinned":"_column-config__item--pinned_1ppdl_41",handler:"_handler_1ppdl_48",badge:"_badge_1ppdl_52","metric-type":"_metric-type_1ppdl_78","metric-icon":"_metric-icon_1ppdl_106"}}]]),Hre=_t(nt({__name:"DropdownWrapper",props:{placement:{default:"bottom-start"},show:{type:Boolean,default:!1},maxWidth:{default:400}},emits:["open","close"],setup(e,{expose:t,emit:n}){const o=e,s=n,{hide:r,triggerRef:i,popupRef:a,isVisible:l,toggle:u}=yo({toggleOnClick:!0,placement:o.placement,trigger:"click",interactive:!0,arrow:!1,offset:[0,4],showOnInit:o.show,maxWidth:o.maxWidth}),c=X(()=>l.value);Je(l,f=>{s(f?"open":"close")});const d=()=>{r()};t({closeDropdown:d,isOpen:c});const h=f=>{f.key==="Escape"&&a.value&&r()};return Zt(()=>{var p;const f=i.value instanceof HTMLElement?i.value:(p=i.value)==null?void 0:p.$el;f&&f.addEventListener("keydown",h)}),Vn(()=>{var p;const f=i.value instanceof HTMLElement?i.value:(p=i.value)==null?void 0:p.$el;f&&f.removeEventListener("keydown",h)}),(f,p)=>(q(),de("div",{ref_key:"triggerRef",ref:i,class:le(f.$style["dropdown-wrapper"])},[kt(f.$slots,"trigger",{open:L(l),toggle:L(u),closeDropdown:d},()=>[Se("button",{class:le(f.$style["editable-dropdown__trigger"]),"aria-label":"Select or type"}," ▼ ",2)]),Se("div",{ref_key:"popupRef",ref:a,tabindex:"0",class:le(f.$style["dropdown-content"]),style:hn({display:L(l)?"block":"none",maxWidth:o.maxWidth?o.maxWidth+"px":"unset"})},[kt(f.$slots,"content",{closeDropdown:d,visible:L(l)},()=>[Se("div",{class:le(f.$style["dropdown-list"])},null,2)])],6)],2))}}),[["__cssModules",{$style:{"dropdown-wrapper":"_dropdown-wrapper_lghkw_1","dropdown-content":"_dropdown-content_lghkw_5","dropdown-list":"_dropdown-list_lghkw_11"}}]]),Gre={class:"reach-limit-icon"},Ure=_t(nt({__name:"TableCustomization",props:{modelValue:{},readOnly:{type:Boolean},disabled:{type:Boolean},checkboxColumn:{},gridApi:{},tableHeight:{}},emits:["update:modelValue","input","change"],setup(e,{expose:t,emit:n}){const o=Kt,s=e,r=xo,i=n,a=$(""),l=$(),u=X(()=>a.value.trim().length>0),c=$([]),d=$({}),{triggerRef:h,popupRef:f,isVisible:p,hide:g}=yo({toggleOnClick:!0,placement:"bottom-end",trigger:"click",offset:[0,0]});Je(p,M=>{var N;M&&((N=l.value)==null||N.focus())});const v=X(()=>s.disabled||a.value.length>0),w=X(()=>c.value.filter(M=>M.pinned==="left"&&M.field&&M.headerName)),S=X(()=>c.value.filter(M=>M.pinned==="right"&&M.field||M.field==="blank")),b=X({get:()=>c.value.filter(M=>!M.pinned&&M.field&&M.field!=="blank"),set:M=>{c.value=[...w.value,...M,...S.value]}}),y=X(()=>{if(!a.value)return{};const M=a.value.toLowerCase();return[...c.value,...b.value].reduce((N,B)=>{var z;return(z=B.headerName)!=null&&z.toLowerCase().includes(M)&&B.field&&(N[B.field]=!0),N},{})}),E=X(()=>s.modelValue),_=()=>{const M={};c.value.forEach(N=>{N.field&&(M[N.field]=!N.hide)}),d.value=M},I=X(()=>{if(!a.value)return c.value;const M=a.value.toLowerCase();return c.value.filter(N=>{var B;return(B=N.headerName)==null?void 0:B.toLowerCase().includes(M)})}),T=()=>{var B;const M=(B=s.gridApi)==null?void 0:B.getColumnState().reduce((z,oe)=>(z[oe.colId]=Number(oe.width),z),{}),N=c.value.map(z=>({...z,hide:z.field?!d.value[z.field]:!1,width:z.field?M==null?void 0:M[z.field]:z.width}));i("update:modelValue",N),i("change",N),i("input",N)},F=M=>{const N=[...w.value,...M,...S.value];s.checkboxColumn&&N.unshift(s.checkboxColumn),c.value=N,T()},V=M=>{M&&(d.value[M]=!d.value[M],T())};Je(E,M=>{M&&M.length>0&&(c.value=[...M],_())}),t({updateColumnDefs(M){c.value=[...M],_()}});const x=X(()=>k.value>=5),A=X(()=>s.disabled||a.value.length>0),k=X(()=>c.value.reduce((M,N)=>N.field&&N.field.includes("metric")&&d.value[N.field]===!0?M+1:M,0));return(M,N)=>(q(),de("div",{class:le(M.$style["table-customization"])},[Se("div",{ref_key:"triggerRef",ref:h},[kt(M.$slots,"trigger",{},()=>[ze((q(),Ke(St,{variant:["secondary"],disabled:s.disabled,actived:L(p),style:{width:"32px"},onEscape:L(g)},{prefix:we(()=>[ye(pt,{src:"TableColumns"})]),_:1},8,["disabled","actived","onEscape"])),[[L(r),"7"],[L(o),"Columns"]])])],512),Se("div",{ref_key:"popupRef",ref:f,class:le(M.$style["tippy-content-wrapper"])},[Se("div",{class:le([M.$style["column-config"],x.value?M.$style["has-warning"]:""]),style:hn({"--max-height":s.tableHeight?s.tableHeight:"max(500px, 60vh)"})},[ye(RE,{tabIndex:"7.0",modelValue:a.value,"onUpdate:modelValue":N[0]||(N[0]=B=>a.value=B),ref_key:"searchBoxRef",ref:l},null,8,["modelValue"]),Se("div",{class:le(M.$style["column-config__header"])},[...N[2]||(N[2]=[Se("span",null,"Manage columns",-1)])],2),x.value?(q(),de("div",{key:0,class:le(M.$style["reach-limit"])},[Se("div",Gre,[ye(pt,{src:"InfoCircle",color:"#F7941D",size:14})]),Se("div",{class:le(M.$style["warning-limit-text"])},[...N[3]||(N[3]=[tt(" You’ve reached the maximum number of metric columns. ",-1),Se("br",null,null,-1),tt(" Deselect one to show another. ",-1)])],2)],2)):Ye("",!0),u.value?(q(),de(Pt,{key:1},[I.value.length===0&&u.value?(q(),de("div",{key:0,class:le(M.$style["no-columns"])},[...N[4]||(N[4]=[tt(" No results. ",-1),Se("br",null,null,-1),tt(" Try another search. ",-1)])],2)):Ye("",!0),u.value&&I.value.length>0?(q(),de("div",{key:1,class:le(M.$style["column-config__pinned-section"])},[(q(!0),de(Pt,null,xn(I.value,B=>{var z;return q(),Ke(by,{key:B.colId,item:B,columnStates:d.value,disableDrag:A.value,disableDragTooltip:"Reordering is disabled while search is active.",readOnly:s.readOnly,isDisableNewCheck:x.value&&((z=B.colId)==null?void 0:z.includes("metric")),onToggleColumn:V},null,8,["item","columnStates","disableDrag","readOnly","isDisableNewCheck"])}),128))],2)):Ye("",!0)],64)):Ye("",!0),u.value?Ye("",!0):(q(),de("div",{key:2,class:le(M.$style["column-config__list"])},[(q(!0),de(Pt,null,xn(w.value,B=>ze((q(),Ke(by,{key:B.field,item:B,disabled:B.field!="thumbnail",readOnly:B.field!="thumbnail",disableDrag:!0,disableDragTooltip:" ","disable-checkbox":B.field!="thumbnail",columnStates:d.value,onToggleColumn:V},null,8,["item","disabled","readOnly","disable-checkbox","columnStates"])),[[cr,y.value[B.field]||!a.value]])),128)),ye(Nre,{modelValue:b.value,"onUpdate:modelValue":N[1]||(N[1]=B=>b.value=B),"group-name":"columns",onChanged:F,disabled:v.value,readOnly:s.readOnly},{item:we(({item:B,index:z})=>[ze((q(),Ke(by,{focusIndex:`7.${z+1}`,key:B.id,item:B,columnStates:d.value,disableDrag:A.value,disableDragTooltip:A.value?"Reordering is disabled while search is active.":void 0,readOnly:s.readOnly,isDisableNewCheck:x.value&&B.id.includes("metric"),onToggleColumn:V},null,8,["focusIndex","item","columnStates","disableDrag","disableDragTooltip","readOnly","isDisableNewCheck"])),[[cr,y.value[B.field]||!a.value]])]),_:1},8,["modelValue","disabled","readOnly"]),(q(!0),de(Pt,null,xn(S.value.filter(B=>{var z;return B.headerName&&((z=B.headerName)==null?void 0:z.length)>0}),B=>ze((q(),Ke(by,{key:B.field,item:B,disabled:s.disabled,readOnly:s.readOnly,columnStates:d.value},null,8,["item","disabled","readOnly","columnStates"])),[[cr,y.value[B.field]||!a.value]])),128))],2))],6)],2)],2))}}),[["__cssModules",{$style:{"reach-limit":"_reach-limit_1m3bt_1","reach-limit-icon":"_reach-limit-icon_1m3bt_11","warning-limit-text":"_warning-limit-text_1m3bt_18","table-customization":"_table-customization_1m3bt_24","table-customization__trigger":"_table-customization__trigger_1m3bt_30","column-config":"_column-config_1m3bt_46","has-warning":"_has-warning_1m3bt_61","column-config__header":"_column-config__header_1m3bt_64","icon-color":"_icon-color_1m3bt_73","column-config__list":"_column-config__list_1m3bt_76","column-config__section-label":"_column-config__section-label_1m3bt_80","column-config__footer":"_column-config__footer_1m3bt_89","column-config__add-button":"_column-config__add-button_1m3bt_92","cs-icon":"_cs-icon_1m3bt_110","no-columns":"_no-columns_1m3bt_114"}}]]),wL=_t(nt({__name:"StatusSelect",props:{modelValue:{},getStatusFunc:{},workspaceId:{},id:{},maxWidth:{default:"500px"},focusIndex:{},placeholder:{default:"No status"}},emits:["updated","error","cancel","update:modelValue"],setup(e,{expose:t,emit:n}){const o={PER_PAGE:20,INITIAL_PAGE:1},s=(A,k=0)=>A?`${parseInt(A,10)+k}px`:"auto",r=(A,k=0)=>A?parseInt(A,10)+k:0,i=e,a=$(i.modelValue),l=n,u=X(()=>p.value.find(A=>A.id===a.value)||null),c=A=>{a.value=A.id,l("update:modelValue",A.id)},d=$(null),h=$(null),f=()=>{var A,k;d.value||(A=h.value)==null||A.focus(),(k=d.value)==null||k.focus()},p=$([]),g=$(!1),v=$(!1),w=$(null),S=$(o.INITIAL_PAGE),b=$(!0),y=$(0),E=$(""),_=X(()=>!!(i.id&&i.workspaceId)),I=A=>{const k=p.value.find(M=>M.id===A.value);k&&c(k)},T=A=>({label:A.name,value:A.id,selected:a.value===A.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:A,id:A.id,color:A.color}),F=async(A=o.INITIAL_PAGE,k="",M=!1)=>{var N;if(!_.value){console.error("Missing required props",i);return}M?v.value=!0:g.value=!0,w.value=null;try{const B={workspaceId:String(i.workspaceId),itemIds:i.id,page:A,perPage:o.PER_PAGE,name_like:k.trim()};if(i.getStatusFunc===void 0)throw new Error("API service getAssignableStatus is undefined");const z=await i.getStatusFunc(B);if(!z){M||(p.value=[]),b.value=!1;return}const oe=z.data.map(T);p.value=M?[...p.value,...oe]:oe,y.value=((N=z.meta)==null?void 0:N.total)??z.data.length,b.value=p.value.length<y.value,S.value=A}catch(B){console.error("Error fetching statuses:",B),w.value="Failed to load statuses",M||(p.value=[]),b.value=!1,l("error",w.value)}finally{g.value=!1,v.value=!1}},V=async()=>{!b.value||v.value||await F(S.value+1,E.value,!0)};Je([()=>i.id,()=>i.workspaceId],()=>{F()},{deep:!0,immediate:!0});const x=async A=>{E.value=A,S.value=o.INITIAL_PAGE,await F(o.INITIAL_PAGE,A,!1)};return t({focus:f,clear:()=>{a.value=null,l("update:modelValue",null)},preselect:()=>{var A;(A=d.value)==null||A.selectIndex(0)}}),(A,k)=>(q(),Ke(Hre,{onOpen:f,placement:"bottom-start","max-width":r(i.maxWidth)},{trigger:we(({open:M})=>[ye(KN,{value:u.value,style:{width:"100%"},"read-only":!1,"is-editing":!0,placeholder:i.placeholder,"focus-index":i.focusIndex,isHover:!0,ref_key:"statusRendererRef",ref:h},{suffix:we(()=>[ye(pt,{src:"ChevronUp",source:"remote",class:le([[A.$style["dropdown-icon"]],{[A.$style["dropdown-icon-show"]]:!M}])},null,8,["class"])]),_:2},1032,["value","placeholder","focus-index"])]),content:we(({closeDropdown:M})=>{var N;return[ye(ya,{ref_key:"popupRef",ref:d,"selected-id":(N=u.value)==null?void 0:N.id,options:p.value,loading:g.value,itemWidth:s(i.maxWidth,-10),"loading-more":v.value,"has-more":b.value,error:w.value,onSearch:x,onSelect:B=>{I(B),M()},onLoadMore:V,onCancel:k[0]||(k[0]=B=>l("cancel")),style:hn({width:s(i.maxWidth,-10)})},null,8,["selected-id","options","loading","itemWidth","loading-more","has-more","error","onSelect","style"])]}),_:1},8,["max-width"]))}}),[["__cssModules",{$style:{"status-wrapper":"_status-wrapper_149oc_1",status:"_status_149oc_1","color-indicator":"_color-indicator_149oc_13","status-text":"_status-text_149oc_22",empty:"_empty_149oc_29","dropdown-icon":"_dropdown-icon_149oc_33","dropdown-icon-show":"_dropdown-icon-show_149oc_38",options:"_options_149oc_42"}}]]),CL=e=>({updateCellData:({rowId:n,field:o,value:s})=>{if(!e)return;const r=e.getRowNode(n);r&&r.setDataValue(o,s),e.refreshCells({rowNodes:r?[r]:[],columns:[o],force:!0})}}),Wre={key:2},zre=_t(nt({name:"MetricEditorWrapper",__name:"MetricEditorWrapper",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean},error:{type:Boolean}},emits:["update:value","clear","copy"],setup(e,{emit:t}){var S;const n=e,o=$(n.value),s=$(!0),r=$(""),i=()=>{var V,x,A;const b=(V=c.value)==null?void 0:V.restricted_type.trim(),y=((A=(x=c.value)==null?void 0:x.restricted_value)==null?void 0:A.split(",").map(Number))||[],[E,_]=y,T={range:`Enter a value between ${E} and ${_}`,not:`These values are not allowed: ${y.join(", ")}`,exact:"Value is not allowed"}[b];return s.value?"":T},a=b=>{if(c.value){if(b===null||b===""){s.value=!0;return}if(u.value!=="number"){s.value=!0;return}s.value=bv(c.value,Number(b)),r.value=i()}};X(()=>s.value?{content:"",showOnCreate:!1}:{content:r.value,bypassOverflowCheck:!0,showOnCreate:!0,theme:"error",alwaysShow:!0});const l=$(null),u=X(()=>TO(c.value)),c=X(()=>{var y,E;return((E=(y=n.params)==null?void 0:y.colDef)==null?void 0:E.context)||null}),{apiServices:d}=so(!0,n),{updateCellData:h}=CL((S=n.params)==null?void 0:S.api),f=$(!1),p=li(n,"id"),g=()=>{var b;(b=n.params)==null||b.api.stopEditing()},v=()=>{g()},w=async b=>{var E,_;if(g(),f.value=!0,o.value=b||null,b===n.value){f.value=!1;return}const y={itemIds:[String(p.value)],metricId:((E=c.value)==null?void 0:E.id)||"",workspaceId:String(n.workspaceId)};b==null?y.clear=1:y.value=b,h({rowId:String(p.value),field:`metric_${y.metricId}`,value:void 0});try{const I=await((_=d.value)==null?void 0:_.bulkUpdateMetric(y));console.log("Bulk update response:",I),(I==null?void 0:I.status)==Er.ACCEPTED?h({rowId:String(p.value),field:`metric_${y.metricId}`,value:b||null}):(h({rowId:String(p.value),field:`metric_${y.metricId}`,value:n.value}),console.error("Failed to update metric value:",I),o.value=n.value)}catch(I){console.error("Error during bulk metric update:",I),h({rowId:String(p.value),field:`metric_${y.metricId}`,value:n.value})}finally{f.value=!1}};return(b,y)=>(q(),de("div",{class:"metric-editor-wrapper",ref_key:"metricEditorWrapperRef",ref:l},[u.value=="dropdown"&&c.value?(q(),Ke(lM,{key:0,config:c.value,modelValue:o.value,"onUpdate:modelValue":y[0]||(y[0]=E=>o.value=E),onChange:w,onHandleCancel:v},null,8,["config","modelValue"])):u.value=="number"&&c.value?(q(),Ke(uM,{key:1,showInlineError:!1,autoEmit:!0,config:c.value,modelValue:o.value,"onUpdate:modelValue":y[1]||(y[1]=E=>o.value=E),style:{width:"100%"},onHandleChange:w,onCancel:v,onOnValidation:a},null,8,["config","modelValue"])):(q(),de("div",Wre,"Metric type:"+it(u.value),1))],512))}}),[["__scopeId","data-v-52c9b3d6"]]),jre=_t(nt({name:"EmptyData",__name:"EmptyData",props:{isSearching:{type:Boolean},isFiltering:{type:Boolean}},setup(e){const t=e,n={noData:"No data available.",noSearchResults:"No results. Try another search.",noFilterResults:"No results. Try another filter.",emptySearchFilter:"No results. Try another search or filter."};X(()=>t.isSearching||t.isFiltering?"NoDataSearchFilter":"ClickToCreate");const o=X(()=>t.isSearching&&!t.isFiltering?n.noSearchResults:t.isFiltering&&!t.isSearching?n.noFilterResults:t.isSearching&&t.isFiltering?n.emptySearchFilter:n.noData),s=$(!1);return Zt(()=>{s.value=!0}),(r,i)=>(q(),de("div",{class:le(r.$style["no-data-item-table"])},[Se("div",{class:le(r.$style.visual)},[s.value?(q(),Ke(va,{key:0,source:"remote",src:"NoDataGeneral",ratio:"4/3",maxWidth:500,maxHeight:350})):Ye("",!0)],2),Se("div",{class:le(r.$style.description)},it(o.value),3)],2))}}),[["__cssModules",{$style:{"no-data-item-table":"_no-data-item-table_oh0wi_1",visual:"_visual_oh0wi_12",description:"_description_oh0wi_19"}}]]),Kre=(e,t)=>{var r;const n=sessionStorage.getItem("ws.terminology"),o=n?JSON.parse(n):null;return` ${((r=o==null?void 0:o.find(i=>i.code==="scene"))==null?void 0:r.name)||"Scene"} `.trim()},qre={class:"paragraph"},Yre=["href"],Xre=["checked"],Sy="hideDefaultSortingNotification",Zre=_t(nt({name:"DefaultSortingNotification",__name:"DefaultSortingNotification",setup(e,{expose:t}){const n=f=>{f.preventDefault(),f.metaKey||f.ctrlKey?window.open(h.value,"_blank"):window.location.href=h.value,c()},o=()=>{s.value=!s.value},s=$(localStorage.getItem(Sy)==="true"),r=()=>{s.value=localStorage.getItem(Sy)==="true",localStorage.getItem(Sy)!=="true"&&l()},i=()=>{localStorage.setItem(Sy,String(s.value)),c()},{triggerRef:a,show:l,popupRef:u,hide:c}=yo({toggleOnClick:!1,trigger:"manual",appendTo:()=>document.getElementById("item-table-layout-id")||document.body,zIndex:8,offset:[0,8],showOnInit:!1,interactive:!0,showArrow:!0});t({show:r,hide:c});const d=X(()=>Kre()),h=X(()=>{const f=sessionStorage.getItem("BASE_URL")||"",p=sessionStorage.getItem("ws.code")||"";return`${f}/${p}/ac/prf`});return(f,p)=>(q(),de(Pt,null,[Se("div",{class:"main-trigger",ref_key:"triggerRef",ref:a},[kt(f.$slots,"default")],512),Se("div",{class:"popup",ref_key:"popupRef",ref:u},[Se("div",{class:le(f.$style["default-sorting-notification"])},[Se("div",qre,[tt(" This sort only applies to the current list. To change the default sorting for "+it(d.value)+" lists, go to ",1),Se("a",{href:h.value,onClick:n}," My Settings > Preferences ",8,Yre),p[0]||(p[0]=tt(" . ",-1))]),Se("div",{class:le(f.$style.footer)},[Se("label",{class:le(f.$style["checkbox-section"])},[Se("input",{type:"checkbox",checked:s.value,onChange:Ht(o,["stop"]),style:{"--input-size":"16px"}},null,40,Xre),p[1]||(p[1]=tt(" Don't show this tip again ",-1))],2),ye(St,{size:"small",variant:["primary","text"],style:{padding:"0 8px"},onClick:i},{default:we(()=>[...p[2]||(p[2]=[tt(" Got it ",-1)])]),_:1})],2)],2)],512)],64))}}),[["__cssModules",{$style:{"default-sorting-notification":"_default-sorting-notification_5uy9k_1",footer:"_footer_5uy9k_19","checkbox-section":"_checkbox-section_5uy9k_25"}}]]),Sl=nt({name:"HeaderSorting",__name:"HeaderWrapper",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean}},setup(e){const t=e,n=vE(),{sorts:o,defaultSortStorePreferences:s}=mo(n),r=X(()=>{var f,p;return((p=(f=t.params)==null?void 0:f.column)==null?void 0:p.getColId())||"template_col_id"}),i=$(null),a={name:"name",template_flow_status:"status"};Je(()=>s.value,f=>{var p;f!=null&&f.field&&a[f==null?void 0:f.field]==r.value&&((p=i.value)==null||p.setDefaultSort(f))});const l=f=>{var p;r.value&&n.setSort(r.value,f),(p=c.value)==null||p.show()},u=X(()=>t.params.headerType||void 0),c=$(null),d=$("none");Je(()=>o.value,wr(()=>{var f;if(r.value){const p=o.value[r.value];d.value=p?p.sort:"none",d.value=="none"&&((f=i.value)==null||f.clear())}},Si),{deep:!0,immediate:!0});const h=()=>{var f;(f=c.value)==null||f.hide()};return Zt(()=>{var p;const f=(p=t.params)==null?void 0:p.api;f==null||f.addEventListener("bodyScroll",h)}),nu(()=>{var p;const f=(p=t.params)==null?void 0:p.api;f==null||f.removeEventListener("bodyScroll",h)}),(f,p)=>(q(),Ke(Zre,{ref_key:"sortingNotificationRef",ref:c},{default:we(()=>[r.value?(q(),Ke(Use,jt({key:0,ref_key:"headerSortingRef",ref:i},t,{"header-type":u.value,modelValue:d.value,"onUpdate:modelValue":p[0]||(p[0]=g=>d.value=g),onSortChanged:l,onOpen:h}),null,16,["header-type","modelValue"])):Ye("",!0)]),_:1},512))}});function Jre(){const e=Oo({isCreating:!1,name:"",error:void 0,assignees:null,status:null,start_date:null,due_date:null}),t=()=>{const s=e.name.trim();e.status,s.length===0?e.error="Name cannot be empty":s.length>255?e.error="Name cannot exceed 255 characters":e.error=void 0},n=()=>{e.isCreating=!0,e.name="",e.error=void 0,e.assignees=null,e.status=null,e.start_date=null,e.due_date=null},o=()=>{e.isCreating=!1};return Je(()=>e,()=>{t()},{deep:!0}),{newItemData:e,validateNewItem:t,openNewItemForm:n,closeNewItemForm:o,resetNewItemForm:()=>{e.name="",e.assignees=null,e.start_date=null,e.due_date=null,e.error=void 0}}}const Ey=Ja("userStore",()=>{const e=$(null),t=$(null);return{user:e,setUser:s=>{e.value=s},setUserRoleId:s=>{t.value=s},workspaceUserRoleId:t}}),Qre=["innerHTML"],eie=20,tie=_t(nt({__name:"AddNewAssignee",props:{maxVisible:{default:3}},emits:["updated","cancel","start-update","tab","close","show","hide"],setup(e,{expose:t,emit:n}){const o=e,{triggerRef:s,popupRef:r,isVisible:i,show:a,hide:l}=yo({toggleOnClick:!0,appendTo:"parent",offset:[-15,8]}),u=()=>{a()},c=$(null),d=()=>{V.value=[],ne.value=!1},h=X(()=>i.value),f=X(()=>{var K;return{disabled:!1,error:!1,readOnly:!1,isEmpty:((K=V.value)==null?void 0:K.length)===0,wrapperRef:s,active:h,bordered:!0}}),{argsMain:p}=Ao(f),g=Kt,v=n,w=X(()=>{var K;return Math.max(0,(((K=V.value)==null?void 0:K.length)||0)-o.maxVisible)}),S=X(()=>{var K;return w.value<=0?"":((K=V.value)==null?void 0:K.slice(o.maxVisible).map(Y=>Y.name).join(", "))||""}),b=$(!1),y=$(!1),E=$(null),_=$(1),I=$(!0),T=$(0),F=$(""),V=$([]),x=X(()=>{var K;return((K=V.value)==null?void 0:K.map(Y=>Y.id))||[]}),{assigneeList:A,mergedOptions:k}=Iv({...o,value:[]}),{apiServices:M}=so(!1,o),N=Dn("entityId"),B=async(K=1,Y="",re=!1)=>{var G,J,ce,Ee,Ce;if(!M.value)throw console.error("API service or item identifiers are undefined"),new Error("API service or item identifiers are undefined");if(re?y.value=!0:b.value=!0,E.value=null,!((G=M.value)!=null&&G.getAssignableAssignees))throw new Error("API service getAssignableAssignees is undefined");const R=un.getInstance().getItem("ws.code");try{const Ne=await((J=M.value)==null?void 0:J.getAssignableAssignees(String(R),{entity_ids:(N==null?void 0:N.value)||"",page:K,per_page:eie,display_name_like:Y})),pe=((ce=ad(Ne.data))==null?void 0:ce.map(Dv))??[];A.value=re?Kc(A.value,pe,"id"):pe,T.value=Ne.meta.total,I.value=(((Ee=Ne==null?void 0:Ne.meta)==null?void 0:Ee.current_page)||0)<(((Ce=Ne==null?void 0:Ne.meta)==null?void 0:Ce.last_page)||0),_.value=K}catch(Ne){console.error("Error fetching assignable users:",Ne),E.value="Failed to load assignable users"}finally{b.value=!1,y.value=!1}},z=K=>{var Y,re,R;if((Y=V.value)!=null&&Y.some(G=>G.id===K.data.id)){V.value=(re=V.value)==null?void 0:re.filter(G=>G.id!==K.data.id);return}V.value=[...V.value||[],K.data],(R=c.value)==null||R.focus()},oe=()=>{V.value=[]},ie=()=>{!y.value&&I.value&&B(_.value+1,F.value,!0)},te=wr(async K=>{F.value=K,await B(1,K,!1)},Si);Je(()=>i.value,K=>{var Y;K?(B(1,F.value,!1),(Y=c.value)==null||Y.focus(),v("show")):v("hide")});const se=X(()=>{var K;return((K=V.value)==null?void 0:K.slice(0,3))||[]}),Z=X(()=>se.value.map(K=>({id:K.id,name:K.name,initial:K.initial,avatarId:K.id,profile_image:K.profile_image,color:K.color,size:24,user:K}))),P=Ey(),{user:j}=mo(P),ne=$(!1);t({getData:()=>V.value,clear:d,setData:K=>{V.value=K},focus:()=>{a(),ht(()=>{var K;(K=c.value)==null||K.focus()})},hide:()=>{l()}}),Je([V,ne],()=>{v("updated",V.value)},{deep:!0});const ge=K=>{var Y;V.value=(Y=V.value)==null?void 0:Y.filter(re=>re.id!==K)},xe=K=>{var re;const Y=un.getInstance().getItem("ws.code");return((re=M.value)==null?void 0:re.getUserInformation(Y,K))||Promise.resolve(null)},ue=$();return(K,Y)=>(q(),de("div",{class:"new-assignee-wrapper",ref_key:"wrapperRef",ref:ue},[ye(Lo,jt(L(p),{style:{"--icon-size":"18px"}}),{prefix:we(()=>[Z.value.length==0?(q(),de("div",{key:0,class:le([K.$style["icon-wrapper"],"wrapper-prefix"]),onClick:Ht(u,["stop","prevent"])},[ye(pt,{src:"UserPlus",color:"#A6A6A6"})],2)):Ye("",!0)]),default:we(()=>[Se("div",{class:le([K.$style["assignee-row"],K.$style["assignee-selector"]]),ref_key:"triggerRef",ref:s},[Se("div",{style:{flex:1},class:le([K.$style["assignee-row"]])},[(q(!0),de(Pt,null,xn(Z.value,re=>(q(),Ke(ip,{onClear:R=>ge(re.id),key:re.user.id,"disable-remove":!1},{default:we(()=>[ye(Iu,{user:re.user,apiUpdateFunction:xe,appendTo:ue.value},null,8,["user","appendTo"])]),_:2},1032,["onClear"]))),128)),w.value>0?ze((q(),de("div",{key:0,class:le(K.$style["extra-avatars"])},[tt(" +"+it(w.value),1)],2)),[[L(g),S.value]]):Ye("",!0)],2)],2)]),_:1},16),Se("div",{ref_key:"popupRef",ref:r},[ye(ya,jt({"selected-id":x.value},{...o},{options:L(k),loading:b.value,"loading-more":y.value,"has-more":I.value,ref_key:"searchListRef",ref:c,onTab:Y[0]||(Y[0]=re=>v("tab",re)),onSelect:Y[1]||(Y[1]=re=>{z(re),v("start-update")}),onSearch:L(te),onClose:Y[2]||(Y[2]=()=>v("close")),onLoadMore:ie}),{"extra-item":we(()=>[ye(TE,{onClick:oe,label:"Unassign",borderLeft:!0},{icon:we(()=>[ye(pt,{src:"UserXMark",source:"remote"})]),_:1})]),item:we(({item:re,selectedIndex:R,isSelected:G,handleSelect:J,handleItemHover:ce,getHighlightedLabel:Ee,query:Ce,idx:Ne})=>[ye(fl,jt(re,{hover:Ne===R,selected:G(re),type:re.type,onClick:Ht(pe=>J(re,pe),["stop","prevent"]),onMouseover:pe=>ce(Ne),class:K.$style["item-assignee"]}),{prefix:we(()=>[ye(Iu,{user:re.data,apiUpdateFunction:xe,appendTo:L(r)},null,8,["user","appendTo"])]),label:we(({})=>[Ce?ze((q(),de("span",{key:0,class:le([K.$style["item-label"],K.$style.match]),style:{flex:"1"},innerHTML:Ee(re.label)},null,10,Qre)),[[L(g),{content:re.label}]]):ze((q(),de("span",{key:1,class:le(K.$style["item-label"]),style:{flex:"1"}},[tt(it(re.label),1)],2)),[[L(g),{content:re.label}]])]),_:2},1040,["hover","selected","type","onClick","onMouseover","class"])]),_:1},16,["selected-id","options","loading","loading-more","has-more","onSearch"])],512)],512))}}),[["__cssModules",{$style:{"list-item":"_list-item_zw1ld_1",action:"_action_zw1ld_5","item-assignee":"_item-assignee_zw1ld_10","item-action":"_item-action_zw1ld_10","item-label":"_item-label_zw1ld_20","icon-wrapper":"_icon-wrapper_zw1ld_29","error-message":"_error-message_zw1ld_38","empty-state":"_empty-state_zw1ld_48","assignee-row":"_assignee-row_zw1ld_61","assignee-selector":"_assignee-selector_zw1ld_69",seperator:"_seperator_zw1ld_73","extra-avatars":"_extra-avatars_zw1ld_81",list:"_list_zw1ld_1"}}]]),nie={key:0},oie={key:1},sie={key:0},rie={key:1},iie={key:0,class:"wrapper-suffix"},aie={key:0,class:"wrapper-prefix",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"24px",height:"24px"}},lie=_t(nt({__name:"AddNewDate",emits:["updated","tab","show","hide"],setup(e,{expose:t,emit:n}){const o=Kt,{triggerRef:s,popupRef:r,isVisible:i,hide:a,show:l}=yo({toggleOnClick:!0,appendTo:"parent",offset:[0,0]}),u=()=>{c.value=[null,null]},c=$([null,null]),d=_=>{const I=Cv();return _?lt.fromJSDate(_,{zone:I}).toFormat("MMM dd"):""},h=X(()=>i.value),f=X(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:c.value[0]===null&&c.value[1]===null,wrapperRef:s,active:h,bordered:!0})),{argsMain:p}=Ao(f),g=$(!1),v=_=>{S("tab",_)},w=_=>{"start"in _&&_.start!==void 0&&(c.value[0]=_.start),"end"in _&&_.end!==void 0&&(c.value[1]=_.end)};t({getData:()=>c.value,clear:u,setData:_=>{c.value=_},focus:()=>{l(),ht(()=>{var _;(_=b.value)==null||_.focus()})},hide:()=>{a()}});const S=n;Je(()=>c.value,_=>{S("updated",_)},{deep:!0});const b=$(null);Je(()=>i.value,_=>{_?(ht(()=>{var I;(I=b.value)==null||I.focus()}),S("show")):S("hide")});const y=Lv(),{parentConfig:E}=mo(y);return(_,I)=>(q(),de(Pt,null,[ye(Lo,jt({ref_key:"triggerRef",ref:s},L(p),{style:{"--icon-size":"18px",cursor:"pointer"}}),{default:we(({focused:T})=>[Se("div",{class:le(_.$style["date-time"])},[Se("div",{class:le(_.$style.date)},[c.value[0]==null&&(T||L(i))?(q(),de("span",nie,"MMMDD")):(q(),de("span",oie,it(d(c.value[0])),1))],2),c.value[0]!==null||c.value[1]!==null||T||L(i)?(q(),de("div",{key:0,class:le(_.$style.separator)}," → ",2)):Ye("",!0),Se("div",{class:le(_.$style.date)},[c.value[1]==null&&(T||L(i))?(q(),de("span",sie,"MMMDD")):(q(),de("span",rie,it(d(c.value[1])),1))],2)],2)]),suffix:we(({hovered:T,focused:F})=>[(c.value[0]!==null||c.value[1]!==null)&&(T||F||L(i))?(q(),de("div",iie,[ze((q(),Ke(St,{onClick:Ht(u,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:we(()=>[ye(pt,{src:"XMarkSolid",size:"8"})]),_:1})),[[L(o),"Clear"]])])):Ye("",!0)]),prefix:we(()=>[c.value[0]===null&&c.value[1]===null?(q(),de("div",aie,[ye(pt,{src:"Calendar",color:"#A6A6A6"})])):Ye("",!0)]),_:1},16),Se("div",{ref_key:"popupRef",ref:r},[L(i)?(q(),Ke(Nv,{key:0,immediatelyUpdate:!1,value:c.value,onConfirmed:w,ref_key:"calendarRef",ref:b,onClosed:L(a),onStartUpdate:I[0]||(I[0]=T=>g.value=!0),onFinishUpdate:I[1]||(I[1]=T=>g.value=!1),onTab:v,"parent-config":L(E)},null,8,["value","onClosed","parent-config"])):Ye("",!0)],512)],64))}}),[["__cssModules",{$style:{"list-item":"_list-item_n9o5g_2","date-time":"_date-time_n9o5g_5",date:"_date_n9o5g_5",separator:"_separator_n9o5g_18"}}]]),uie=_t(nt({__name:"AddNewStatus",props:{entityId:{}},emits:["updated","error","cancel","update:modelValue","tab","close","show","hide"],setup(e,{expose:t,emit:n}){const o=e,s={PER_PAGE:20,INITIAL_PAGE:1},{triggerRef:r,popupRef:i,isVisible:a,show:l,hide:u}=yo({toggleOnClick:!0,appendTo:"parent"}),c=$(null),d=$([]),h=$(!1),f=$(!1),p=$(null),g=$(s.INITIAL_PAGE),v=$(!0),w=$(0),S=$(""),b=n,y=X(()=>a.value),E=X(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:!c.value,wrapperRef:r,active:y,bordered:!0})),_=$(null),{argsMain:I}=Ao(E),T=X(()=>c.value?d.value.filter(se=>se.id===c.value):[]),F=X(()=>!c.value||T.value.length===0?"":T.value[0].label),V=X(()=>c.value?[c.value]:[]),x=X(()=>{if(!c.value)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6",minWidth:"14px"};const se=T.value[0],Z=String((se==null?void 0:se.color)||"white");return{backgroundColor:Z,border:uS(Z,"white")?"1px solid #ccc":"1px solid #fff",minWidth:"14px"}}),A=se=>({label:se.name,value:se.id,selected:c.value===se.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:se,id:se.id,color:se.color}),{apiServices:k}=so(!1,o),M=async(se=s.INITIAL_PAGE,Z="",P=!1)=>{var j,ne;P?f.value=!0:h.value=!0,p.value=null;try{const ge=un.getInstance().getItem("ws.code"),xe=await((j=k.value)==null?void 0:j.getAssignableStatuses(ge,{entity_id:o.entityId||"",name_like:Z,page:se,per_page:s.PER_PAGE}));if(!xe){P||(d.value=[]),v.value=!1;return}const ue=xe.data.map(A);d.value=P?[...d.value,...ue]:ue,w.value=((ne=xe.meta)==null?void 0:ne.total)??xe.data.length,v.value=d.value.length<w.value,g.value=se}catch(ge){console.error("Error fetching statuses:",ge),p.value="Failed to load statuses",P||(d.value=[]),v.value=!1,b("error",p.value)}finally{h.value=!1,f.value=!1}},N=(se,Z)=>{var j;Z.stopImmediatePropagation(),Z.preventDefault(),Z.stopPropagation();const P=se.id;c.value=P,(j=_.value)==null||j.focus(),b("update:modelValue",c.value),u()},B=async()=>{!v.value||f.value||await M(g.value+1,S.value,!0)},z=async se=>{S.value=se,g.value=s.INITIAL_PAGE,await M(s.INITIAL_PAGE,se,!1)},oe=()=>{c.value=null,b("update:modelValue",null)},ie=()=>{l(),ht(()=>{var se;(se=_.value)==null||se.focus()})};return Je(()=>a.value,se=>{var Z;se?(M(1,S.value,!1),(Z=_.value)==null||Z.focus(),b("show")):b("hide")}),Je(()=>c.value,se=>{b("updated",se)}),t({focus:ie,clear:oe,getData:()=>c.value,setData:se=>{c.value=se},hide:u,autoFillDefault:async()=>{S.value="",await M(1,S.value,!1),d.value.length>0&&(c.value=d.value[0].id,b("update:modelValue",c.value))}}),(se,Z)=>{const P=Sc("tooltip");return q(),de(Pt,null,[ye(Lo,jt({ref_key:"triggerRef",ref:r},L(I),{style:{"--icon-size":"18px"}}),{default:we(()=>[Se("div",{class:le(se.$style.status)},[Se("div",{class:le(se.$style["color-indicator"]),style:hn(x.value)},null,6),ze((q(),de("span",{class:le({[se.$style.empty]:T.value.length===0,[se.$style["status-text"]]:!0})},[tt(it(F.value),1)],2)),[[P,{content:F.value}]])],2)]),_:1},16),Se("div",{ref_key:"popupRef",ref:i},[ye(ya,{style:{width:"200px"},ref_key:"searchListRef",ref:_,"selected-id":V.value,options:d.value,loading:h.value,"loading-more":f.value,"has-more":v.value,error:p.value,onSearch:z,onSelect:N,onLoadMore:B,onCancel:Z[0]||(Z[0]=j=>b("cancel")),onTab:Z[1]||(Z[1]=j=>b("tab",j)),onClose:Z[2]||(Z[2]=()=>b("close"))},null,8,["selected-id","options","loading","loading-more","has-more","error"])],512)],64)}}}),[["__cssModules",{$style:{"list-item":"_list-item_10pcy_2",status:"_status_10pcy_6","color-indicator":"_color-indicator_10pcy_13","count-badge":"_count-badge_10pcy_26","status-text":"_status-text_10pcy_34",empty:"_empty_10pcy_43"}}],["__scopeId","data-v-c2a73a7b"]]),cie=_t(nt({__name:"CreateNewScene",emits:["create-new-item","focus-on-id","search-for-code"],setup(e,{expose:t,emit:n}){const o=["name","assignees","status","date","cancel","create-keep","create"],s=Kt,r=NW("target"),i=Dn("workspaceId"),a=Dn("entityId"),l=n,u=e,{newItemData:c,validateNewItem:d,resetNewItemForm:h,closeNewItemForm:f}=Jre(),{apiServices:p}=so(!1,u),{openSceneHub:g}=fd(),v=$(!1),w=$(!1),S=$(null),b=$({assignees:!1,status:!1,date:!1}),y={name:$(null),assignees:$(null),status:$(null),date:$(null),cancel:$(null),"create-keep":$(null),create:$(null)},E=y.name,_=y.assignees,I=y.status,T=y.date,F=y.cancel,V=y["create-keep"],x=y.create,A=$(new Map),k=X(()=>!!c.error||!c.name.trim()||w.value),M=(pe,H)=>{pe&&A.value.set(H,pe.$el||pe)},N=(pe,H)=>{if(pe==="date"){const[W,be]=Array.isArray(H)?H:[void 0,void 0];c.start_date=W,c.due_date=be}else c[pe]=H},B=()=>{c.isCreating=!0,S.value="name"},z=()=>{c.isCreating=!1,h()},oe=Dn("switchInstance"),{addNotification:ie}=_s(),te=pe=>{l("focus-on-id",pe)},se=(pe,H,W)=>{const be=Sv(void 0,"created");ie({id:String(pe),message:`<div style="display:flex; flex-direction: column; align-items: flex-start;"><b>${be}</b>
169
169
  <span>${H} </span></div>`,actions:[{label:"Find in table",variant:"secondary",btnIcon:"MagnifyingGlass",action:()=>{l("search-for-code",{code:W,name:H}),te(String(pe))}},{label:"Full view",btnIcon:"CustomSceneHub",variant:"primary",action:Ae=>{if(Ae.ctrlKey||Ae.metaKey){const He=es({type:"scene_hub",config:{ws_code:i,baseDomain:un.getInstance().getItem("BASE_URL")||"",scene_id:String(pe)}}).url;window.open(He,"_blank");return}else oe("scene_hub",{id:String(pe)},{showLoading:!1})}}],type:"interactive"})},Z=pe=>{pe&&ht(()=>{var W;const H=(W=y[pe])==null?void 0:W.value;H&&(typeof H.focus=="function"?H.focus():H.$el&&typeof H.$el.focus=="function"&&H.$el.focus())})},P=pe=>{var H;(H=r.value)==null||H.focus()},j=pe=>{const H=W=>{var be;return(be=W==null?void 0:W.hide)==null?void 0:be.call(W)};pe!=="assignees"&&H(_.value),pe!=="status"&&H(I.value),pe!=="date"&&H(T.value)},ne=(pe,H)=>{H instanceof KeyboardEvent&&H.key!=="Tab"&&H.preventDefault();const W=S.value?o.indexOf(S.value):-1;if(W===-1){Z("name");return}let Ae=(W+(pe==="next"?1:-1)+o.length)%o.length,He=o[Ae];(He==="create"||He==="create-keep")&&k.value&&(Ae=0,He=o[0]),j(He),Z(He)},ge=pe=>{b.value[pe]=!0,S.value=pe},xe=pe=>{b.value[pe]=!1,P()},ue=pe=>{b.value[pe]||(S.value=null)},K=pe=>{pe.target===r.value&&Z("name")},Y=pe=>{var H,W,be;if(pe.key==="Enter"){if(!S.value)return;switch(pe.preventDefault(),pe.stopPropagation(),S.value){case"create":k.value||ce("clear");break;case"create-keep":k.value||ce("keep");break;case"cancel":f();break;case"assignees":(H=_.value)==null||H.focus();break;case"status":(W=I.value)==null||W.focus();break;case"date":(be=T.value)==null||be.focus();break}return}if(pe.key==="Tab"){pe.preventDefault(),pe.stopImmediatePropagation(),pe.stopPropagation(),S.value!=="name"&&re(pe);return}if(pe.key==="Escape"){S.value=null,z();return}},re=pe=>{pe.preventDefault(),pe.stopImmediatePropagation(),pe.stopPropagation();const H=pe.shiftKey?"prev":"next";ne(H,pe)},R=()=>{var pe;return(pe=_.value)==null?void 0:pe.focus()},G=()=>{var pe;return(pe=I.value)==null?void 0:pe.focus()},J=()=>{var pe;return(pe=T.value)==null?void 0:pe.focus()},ce=async(pe="clear")=>{ht(async()=>{var W,be,Ae,He,Te,Xe,ve,Be,wt,Tt,tn;if(k.value||v.value||w.value)return;w.value=!0,v.value=!0;const H={name:c.name,template_flow_status_id:c.status??void 0,ws_user_role_ids:(W=c.assignees)==null?void 0:W.map(en=>en.id),start_date:c.start_date?Tv(c.start_date):void 0,due_date:c.due_date?Tv(c.due_date):void 0};if(!((be=p.value)!=null&&be.addNewItem)){console.warn("API service unavailable"),v.value=!1;return}try{const en=await p.value.addNewItem(i,a,H),bn=c.name;if(se(en.id,en.name,en.code),!en.id)throw new Error("Invalid response from server: missing scene ID");switch(w.value=!1,v.value=!1,pe){case"close":h(),(Ae=_.value)==null||Ae.setData([]),(He=I.value)==null||He.setData(null),(Te=T.value)==null||Te.setData([null,null]),f(),z();break;case"close-open":h(),(Xe=_.value)==null||Xe.setData([]),(ve=I.value)==null||ve.setData(null),(Be=T.value)==null||Be.setData([null,null]),f(),z(),g(en.id);break;case"clear":l("create-new-item",bn),h(),(wt=_.value)==null||wt.setData([]),(Tt=I.value)==null||Tt.setData(null),(tn=T.value)==null||tn.setData([null,null]),Z("name");break;case"keep":l("create-new-item",bn),c.name="",c.error="",Z("name");break}}catch(en){console.error("Error creating scene:",en),pe=="close"&&(f(),z())}finally{v.value=!1,w.value=!1}})},Ee=(pe,H)=>{k.value||(H.metaKey||H.ctrlKey?ce("close-open"):H.shiftKey?ce("keep"):ce("clear"))},Ce=(pe=!1)=>{c.isCreating&&(!k.value&&!c.error?ce(pe?"close":"clear"):z())},Ne=()=>{f(),c.name="",ht(()=>{var pe;(pe=E.value)==null||pe.setValue(c.name)})};return _E(r,pe=>{const H=pe.target.closest(".notification-center"),W=pe.target.closest("#people-insight-container");if(H||W)return!1;Ce(!0)}),Je(()=>c.isCreating,pe=>{pe&&Z("name")}),t({show:B,hide:z}),(pe,H)=>ze((q(),de("div",{class:le(pe.$style.newRow),ref_key:"target",ref:r,onKeydown:Y,onClick:K,tabindex:"-1"},[Se("div",{ref:W=>M(W,"name"),class:le({[pe.$style["field-wrapper"]]:!0,[pe.$style.active]:S.value==="name"})},[ye(hl,{ref_key:"nameInputRef",ref:E,disabled:v.value||w.value,modelValue:L(c).name,"onUpdate:modelValue":H[0]||(H[0]=W=>L(c).name=W),onChange:L(d),onEnter:Ee,onCancel:Ne,onTab:H[1]||(H[1]=(W,be)=>re(be)),onFocus:H[2]||(H[2]=W=>S.value="name"),placeholder:"Enter name",focused:!0,"max-length":255,type:"text","auto-emit":!0,style:{"--bg-input":"transparent","--border-color":"#f3f5f7"},bordered:!0,class:"border-f3f5f7"},null,8,["disabled","modelValue","onChange"])],2),Se("div",{ref:W=>M(W,"assignees"),onEnter:Ht(R,["prevent","stop"]),class:le({[pe.$style["field-wrapper"]]:!0,[pe.$style.active]:S.value==="assignees"})},[ye(tie,{ref_key:"assigneeRef",ref:_,onUpdated:H[3]||(H[3]=W=>N("assignees",W)),onTab:H[4]||(H[4]=W=>re(W)),onEnter:R,onFocus:H[5]||(H[5]=W=>S.value="assignees"),onBlur:H[6]||(H[6]=W=>ue("assignees")),onShow:H[7]||(H[7]=W=>ge("assignees")),onHide:H[8]||(H[8]=W=>xe("assignees"))},null,512)],34),Se("div",{ref:W=>M(W,"status"),class:le({[pe.$style["field-wrapper"]]:!0,[pe.$style.active]:S.value==="status"})},[ye(uie,{ref_key:"statusRef",ref:I,"entity-id":L(a),onUpdated:H[9]||(H[9]=W=>N("status",W)),onTab:H[10]||(H[10]=W=>re(W)),onEnter:G,onFocus:H[11]||(H[11]=W=>S.value="status"),onBlur:H[12]||(H[12]=W=>ue("status")),onShow:H[13]||(H[13]=W=>ge("status")),onHide:H[14]||(H[14]=W=>xe("status"))},null,8,["entity-id"])],2),Se("div",{ref:W=>M(W,"date"),class:le({[pe.$style["field-wrapper"]]:!0,[pe.$style.active]:S.value==="date"})},[ye(lie,{ref_key:"dateRef",ref:T,onUpdated:H[15]||(H[15]=W=>N("date",W)),onTab:H[16]||(H[16]=W=>re(W)),onEnter:J,onFocus:H[17]||(H[17]=W=>S.value="date"),onBlur:H[18]||(H[18]=W=>ue("date")),onShow:H[19]||(H[19]=W=>ge("date")),onHide:H[20]||(H[20]=W=>xe("date"))},null,512)],2),Se("div",{class:le(pe.$style["field-actions"])},[Se("div",{ref:W=>M(W,"cancel"),class:le({[pe.$style["field-wrapper"]]:!0,[pe.$style.active]:S.value==="cancel",[pe.$style["field-button"]]:!0})},[ye(St,{ref_key:"cancelRef",ref:F,variant:["secondary"],onClick:L(f),onKeydown:[go(L(f),["enter"]),H[22]||(H[22]=go(W=>re(W),["tab"]))],onFocus:H[21]||(H[21]=W=>S.value="cancel"),tabindex:"0"},{default:we(()=>[...H[31]||(H[31]=[tt(" Cancel ",-1)])]),_:1},8,["onClick","onKeydown"])],2),ze((q(),de("div",{ref:W=>M(W,"create-keep"),class:le({[pe.$style["field-wrapper"]]:!0,[pe.$style["field-button"]]:!0,[pe.$style.active]:S.value==="create-keep"})},[ye(St,{ref_key:"createKeepRef",ref:V,onClick:H[23]||(H[23]=()=>ce("keep")),onKeydown:[H[24]||(H[24]=go(W=>!k.value&&ce("keep"),["enter"])),H[26]||(H[26]=go(W=>re(W),["tab"]))],onFocus:H[25]||(H[25]=W=>S.value="create-keep"),disabled:k.value,variant:["primary"],loading:v.value,tabindex:"0",style:hn([{padding:"4px 8px",width:"100%"},{"letter-spacing":"-0.5px"}])},{default:we(()=>[...H[32]||(H[32]=[tt(" Create & Keep ",-1)])]),_:1},8,["disabled","loading"])],2)),[[L(s),k.value?"Enter a name and select a status to continue.":"Create and keep field values (⇧↵ Shift+Enter)"]]),ze((q(),de("div",{ref:W=>M(W,"create"),class:le({[pe.$style["field-wrapper"]]:!0,[pe.$style.active]:S.value==="create",[pe.$style["field-button"]]:!0})},[ye(St,{ref_key:"createRef",ref:x,onClick:H[27]||(H[27]=()=>ce("clear")),onKeydown:[H[28]||(H[28]=go(W=>!k.value&&ce("clear"),["enter"])),H[30]||(H[30]=go(W=>re(W),["tab"]))],onFocus:H[29]||(H[29]=W=>S.value="create"),disabled:k.value,variant:["primary"],loading:v.value,tabindex:"0"},{default:we(()=>[...H[33]||(H[33]=[tt(" Create ",-1)])]),_:1},8,["disabled","loading"])],2)),[[L(s),k.value?"Enter a name and select a status to continue.":"Create and clear the fields (↵ Enter)"]])],2)],34)),[[cr,L(c).isCreating]])}}),[["__cssModules",{$style:{newRow:"_newRow_nxn1y_1","field-actions":"_field-actions_nxn1y_14","field-wrapper":"_field-wrapper_nxn1y_43",active:"_active_nxn1y_49","field-button":"_field-button_nxn1y_52","warning-text":"_warning-text_nxn1y_55","has-error":"_has-error_nxn1y_60"}}]]),die={style:{"text-align":"left",width:"100%"}},hie={style:{display:"flex","align-items":"center",gap:"2px",flex:"1","min-width":"0"}},fie={key:0},pie=["innerHTML"],gie=20,mie=_t(nt({__name:"FilterAssignee",props:{maxVisible:{default:3},entityId:{},actived:{type:Boolean}},emits:["updated","cancel","start-update","escape"],setup(e,{expose:t,emit:n}){const o=xo,s=e,{triggerRef:r,popupRef:i}=yo({appendTo:()=>document.querySelector(".filter-assignee"),toggleOnClick:!0,offset:[0,0]}),{triggerRef:a,popupRef:l,isVisible:u,hide:c}=yo({toggleOnClick:!0,appendTo:()=>document.querySelector("#filter-assignee"),offset:[0,2]}),d=()=>{w()},h=Te=>{c()},{triggerRef:f,popupRef:p,isVisible:g,hide:v,show:w}=yo({toggleOnClick:!0,appendTo:()=>document.querySelector("#filter-assignee"),offset:[0,2]}),S=$(null),b=()=>{ie.value=[],Ne.value=!1,Ce.value=!1,Y.value="any"},y=X(()=>u.value||g.value||s.actived),E=X(()=>{var Te;return{disabled:!1,error:!1,readOnly:!1,isEmpty:((Te=ie.value)==null?void 0:Te.length)===0,wrapperRef:r,active:y,bordered:!0}}),{argsMain:_,isFocus:I}=Ao(E),T=Kt,F=n,V=X(()=>{var Te;return Math.max(0,(((Te=ie.value)==null?void 0:Te.length)||0)-s.maxVisible)}),x=X(()=>{var Te;return V.value<=0?"":((Te=ie.value)==null?void 0:Te.slice(s.maxVisible).map(Xe=>Xe.name).join(", "))||""}),A=$(!1),k=$(!1),M=$(null),N=$(1),B=$(!0),z=$(0),oe=$(""),ie=$([]),te=X(()=>{var Te;return((Te=ie.value)==null?void 0:Te.map(Xe=>Xe.id))||[]}),{assigneeList:se,mergedOptions:Z}=Iv({...s,value:[]}),{apiServices:P}=so(!1,s),j=async(Te=1,Xe="",ve=!1)=>{var wt,Tt,tn,en,bn;if(!P.value)throw console.error("API service or item identifiers are undefined"),new Error("API service or item identifiers are undefined");if(ve?k.value=!0:A.value=!0,M.value=null,!((wt=P.value)!=null&&wt.getEntityUserRoles))throw new Error("API service getEntityUserRoles is undefined");const Be=un.getInstance().getItem("ws.code");try{const Le=await((Tt=P.value)==null?void 0:Tt.getEntityUserRoles({workspaceId:String(Be),page:Te,per_page:gie,display_name_like:Xe,entity_ids:String(s.entityId)})),Ge=((tn=ad(Le.data))==null?void 0:tn.map(Dv))??[];se.value=ve?Kc(se.value,Ge,"id"):Ge,z.value=Le.meta.total,B.value=(((en=Le==null?void 0:Le.meta)==null?void 0:en.current_page)||0)<(((bn=Le==null?void 0:Le.meta)==null?void 0:bn.last_page)||0),N.value=Te}catch(Le){console.error("Error fetching assignable users:",Le),M.value="Failed to load assignable users"}finally{A.value=!1,k.value=!1}},ne=Te=>{var Xe,ve;if((Xe=ie.value)!=null&&Xe.some(Be=>Be.id===Te.data.id)){ie.value=(ve=ie.value)==null?void 0:ve.filter(Be=>Be.id!==Te.data.id);return}ie.value=[...ie.value||[],Te.data]},ge=()=>{!k.value&&B.value&&j(N.value+1,oe.value,!0)},xe=wr(async Te=>{oe.value=Te,await j(1,Te,!1)},Si);Je(()=>g.value,Te=>{var Xe;Te&&(j(1,oe.value,!1),(Xe=S.value)==null||Xe.focus())});const ue=X(()=>{var Te;return((Te=ie.value)==null?void 0:Te.slice(0,3))||[]}),K=X(()=>ue.value.map(Te=>({id:Te.id,name:Te.name,initial:Te.initial,avatarId:Te.id,profile_image:Te.profile_image,color:Te.color,size:24,user:Te}))),Y=$("any"),re=Te=>{Y.value=Te.id},R=X(()=>[{label:"Any",value:"any",id:"any",selected:Y.value==="any"},{label:"All",value:"all",id:"all",selected:Y.value==="all"}]),G=X(()=>Y.value==="any"?"Any":Y.value==="all"?"All":""),J=Ey(),{user:ce}=mo(J),Ee=X(()=>{if(!ce.value)return{id:"",name:"Unknown",initial:"U",profile_image:null,color:{bgColor:"#CCCCCC",textColor:"var(--background-color)"}};const Te=ce.value;return{id:Te.id,name:Te.first_name,initial:"Me",profile_image:Te.avatar,color:{bgColor:"#CCCCCC",textColor:"var(--background-color)"}}}),Ce=$(!1),Ne=$(!1);t({getData:()=>({assignees:ie.value,showNoAssignee:Ce.value,showMe:Ne.value,selectedTypeId:Y.value}),clear:b,setData:Te=>{ie.value=Te.assignees||[],Ce.value=Te.showNoAssignee||!1,Ne.value=Te.showMe||!1,Y.value=Te.selectedTypeId||"any"},focus:()=>{var Te;(Te=a.value)==null||Te.focus()},triggerFocus:()=>{var Te;(Te=a.value)==null||Te.focus()}}),Je([ie,Ce,Ne,Y],()=>{F("updated",{assignees:ie.value,showNoAssignee:Ce.value,showMe:Ne.value,selectedTypeId:Y.value})},{deep:!0});const pe=()=>{Ce.value=!1},H=()=>{var Te;Ne.value=!1,ie.value=(Te=ie.value)==null?void 0:Te.filter(Xe=>Xe.id!==Ee.value.id)},W=Te=>{var Xe;ie.value=(Xe=ie.value)==null?void 0:Xe.filter(ve=>ve.id!==Te)},be=Te=>{var ve;const Xe=un.getInstance().getItem("ws.code");return((ve=P.value)==null?void 0:ve.getUserInformation(Xe,Te))||Promise.resolve(null)},Ae=$(),He=()=>{F("escape")};return(Te,Xe)=>(q(),de(Pt,null,[Se("div",{id:"filter-assignee",ref_key:"wrapperRef",ref:Ae},[ye(Lo,jt(L(_),{ref_key:"triggerRef",ref:r,style:{"--box-padding":"0 0 0 0","--icon-size":"18px","--border-color":L(I)?"var(--primary-color)":null},onEscape:He}),{default:we(({hovered:ve,focused:Be})=>[Se("div",{class:le([Te.$style["assignee-row"],Te.$style["assignee-selector"]])},[ze((q(),de("div",null,[ze((q(),Ke(St,{variant:"text",ref_key:"triggerRef1",ref:a,size:30,disabled:Ce.value,style:hn({background:Ce.value?"#D7D7D7":"transparent",borderRadius:Ce.value?"4px 0 0 4px":"",border:"none",width:"calc(100% - 2px)",height:"30px"}),onEscape:h},{suffix:we(()=>[ye(pt,{class:le(["wrapper-suffix2",{"icon-up":L(u)}]),src:"ChevronDown",color:"#A6A6A6",size:"12"},null,8,["class"])]),default:we(()=>[Se("span",die,it(G.value),1)]),_:1},8,["disabled","style"])),[[L(o),"3.0"]])])),[[L(T),{content:Ce.value?"Only ‘Any’ is allowed with ‘No assignee’":""}]]),Se("span",{class:le([Te.$style.seperator])},null,2),ze((q(),Ke(St,{variant:"text",ref_key:"triggerRef2",ref:f,style:{flex:1,padding:0,width:"100%",justifyContent:"space-between",height:"30px",paddingRight:"2px","--button-size":"30px"},onEscape:L(v)},{default:we(()=>[Se("div",hie,[ye(ip,{onClear:pe,"disable-remove":!1},{default:we(()=>[Ce.value&&Y.value=="any"?(q(),de("div",fie,[Se("div",{class:le(Te.$style["unassign-icon"])},[...Xe[2]||(Xe[2]=[Se("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[Se("path",{d:"M2.17953 2.75285C1.98276 2.5977 1.69706 2.63365 1.54191 2.83042C1.38677 3.0272 1.42271 3.3129 1.61949 3.46805L12.8204 12.2471C13.0172 12.4023 13.3029 12.3663 13.458 12.1696C13.6132 11.9728 13.5772 11.6871 13.3805 11.532L8.13003 7.41675C9.16308 7.14051 9.9218 6.19827 9.9218 5.07818C9.9218 3.7405 8.83765 2.65636 7.49997 2.65636C6.17932 2.65636 5.10653 3.71212 5.07815 5.0252L2.17953 2.75285ZM6.4461 8.41386C4.67136 8.51035 3.26179 9.98237 3.26179 11.7817C3.26179 12.092 3.51343 12.3436 3.82372 12.3436H11.1762C11.25 12.3436 11.32 12.3304 11.3843 12.3039L6.4461 8.41386Z",fill:"white"})],-1)])],2)])):Ye("",!0)]),_:1}),ye(ip,{tooltip:"Remove",onClear:H,"disable-remove":!1},{default:we(()=>[Ne.value?(q(),Ke(Iu,{key:0,user:Ee.value,"show-profile":!1,"append-to":"parent"},null,8,["user"])):Ye("",!0)]),_:1}),(q(!0),de(Pt,null,xn(K.value,wt=>(q(),Ke(ip,{tooltip:"Remove",key:wt.user.id,onClear:Tt=>W(wt.user.id),"disable-remove":!1},{default:we(()=>[ye(Iu,{user:wt.user,apiUpdateFunction:be,appendTo:Ae.value},null,8,["user","appendTo"])]),_:2},1032,["onClear"]))),128)),V.value>0?ze((q(),de("div",{key:0,class:le(Te.$style["extra-avatars"])},[tt(" +"+it(V.value),1)],2)),[[L(T),x.value]]):Ye("",!0)])]),suffix:we(()=>{var wt;return[(ie.value&&((wt=ie.value)==null?void 0:wt.length)>0||Ce.value||Ne.value)&&(ve||Be||L(g))?(q(),de("div",{key:0,class:"wrapper-suffix",onClick:Ht(b,["stop","prevent"])},[ye(St,{variant:["icon","primary"],rounded:!0,size:18},{default:we(()=>[ye(pt,{src:"XMarkSolid",size:"8"})]),_:1})])):Ye("",!0),Se("div",{class:le(["wrapper-suffix",{"icon-up":L(g)}]),onClick:d,style:{width:"24px",height:"24px",display:"flex","align-items":"center","justify-content":"center"}},[ye(pt,{src:"ChevronDown",color:"#A6A6A6",size:"12"})],2)]}),_:2},1032,["onEscape"])),[[L(o),"3.1"]])],2)]),_:1},16,["style"])],512),Se("div",{ref_key:"popupRef1",ref:l,class:le([Te.$style.list])},[(q(!0),de(Pt,null,xn(R.value,(ve,Be)=>(q(),Ke(fl,jt({focusIndex:`3.0.${Be}`,class:Te.$style["list-item"],style:{width:"100px",minWidth:"100px"}},{ref_for:!0},ve,{key:ve.id,onClick:wt=>re(ve),onEscape:L(c)}),null,16,["focusIndex","class","onClick","onEscape"]))),128))],2),Se("div",{ref_key:"popupRef2",ref:p},[ye(ya,jt({"selected-id":te.value},{...s},{options:L(Z),loading:A.value,"loading-more":k.value,"has-more":B.value,ref_key:"searchListRef",ref:S,onSelect:Xe[1]||(Xe[1]=ve=>{ne(ve),F("start-update")}),onSearch:L(xe),onLoadMore:ge,onCancel:L(v)}),{"extra-item":we(({query:ve})=>[Y.value=="any"&&ve.trim()===""?(q(),Ke(TE,{key:0,onClick:Xe[0]||(Xe[0]=()=>{Ce.value=!Ce.value}),actived:Ce.value},null,8,["actived"])):Ye("",!0)]),item:we(({item:ve,selectedIndex:Be,isSelected:wt,handleSelect:Tt,handleItemHover:tn,getHighlightedLabel:en,query:bn,idx:Le,focus:Ge})=>[ye(fl,jt(ve,{hover:Le===Be,selected:wt(ve),type:ve.type,onClick:Ht(Rt=>Tt(ve,Rt),["stop","prevent"]),onMouseover:Rt=>tn(Le),class:Te.$style["item-assignee"],onEscape:Ge}),{prefix:we(()=>[ye(Iu,{user:ve.data,apiUpdateFunction:be,appendTo:L(i)},null,8,["user","appendTo"])]),label:we(({})=>[bn?ze((q(),de("span",{key:0,class:le([Te.$style["item-label"],Te.$style.match]),style:{flex:"1"},innerHTML:en(ve.label)},null,10,pie)),[[L(T),{content:ve.label}]]):ze((q(),de("span",{key:1,class:le(Te.$style["item-label"]),style:{flex:"1"}},[tt(it(ve.label),1)],2)),[[L(T),{content:ve.label}]])]),_:2},1040,["hover","selected","type","onClick","onMouseover","class","onEscape"])]),_:1},16,["selected-id","options","loading","loading-more","has-more","onSearch","onCancel"])],512)],64))}}),[["__cssModules",{$style:{"list-item":"_list-item_smgki_1",action:"_action_smgki_5","item-assignee":"_item-assignee_smgki_10","item-action":"_item-action_smgki_10","item-label":"_item-label_smgki_20","unassign-icon":"_unassign-icon_smgki_29","error-message":"_error-message_smgki_41","empty-state":"_empty-state_smgki_51","assignee-row":"_assignee-row_smgki_64","assignee-selector":"_assignee-selector_smgki_76",seperator:"_seperator_smgki_82","extra-avatars":"_extra-avatars_smgki_91",list:"_list_smgki_1"}}]]),vie={key:0,class:"wrapper-suffix"},yie=_t(nt({__name:"FilterArchiveStatus",props:{actived:{type:Boolean},focusIndex:{}},emits:["updated"],setup(e,{expose:t,emit:n}){const o=xo,{triggerRef:s,popupRef:r,isVisible:i,hide:a}=yo({toggleOnClick:!0,appendTo:"parent",offset:[0,0]}),l=$([]),u=X(()=>[{label:"Archived",value:"archived",id:"archived",selected:l.value.includes("archived")},{label:"Not archived (Active)",value:"active",id:"active",selected:l.value.includes("active")}]),c=$("");Je(l,y=>{y.length===0?c.value="":y.length===2?c.value="All":y.length===1&&(c.value=y[0]==="archived"?"Archived":"Not archived (Active)")},{immediate:!0,deep:!0});const d=y=>{l.value.includes(y.value)?l.value=l.value.filter(E=>E!==y.value):l.value.push(y.value)},h=()=>{l.value=[]},f=e,p=()=>{l.value=[]},g=X(()=>i.value||f.actived),v=X(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:l.value.length===0,wrapperRef:s,active:g,bordered:!0})),{argsMain:w}=Ao(v);t({getData:()=>l.value,clear:h,setData:y=>{l.value=y},reset:p,focus:()=>{var y;(y=b.value)==null||y.focus()},triggerFocus:()=>{var y;(y=b.value)==null||y.focus()}});const S=n;Je(()=>l.value,y=>{S("updated",y)},{deep:!0});const b=$(null);return(y,E)=>(q(),de(Pt,null,[ze((q(),Ke(Lo,jt({ref_key:"triggerRef",ref:s},L(w),{style:{"--icon-size":"18px"},class:"border-f3f5f8",onEscape:L(a)}),{suffix:we(({hovered:_,focused:I})=>[l.value.length>0&&(_||I||L(i))?(q(),de("div",vie,[ye(St,{onClick:Ht(h,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:we(()=>[ye(pt,{src:"XMarkSolid",size:"8"})]),_:1})])):Ye("",!0),Se("div",{class:le(["wrapper-suffix",{"icon-up":L(i)}])},[ye(pt,{src:"ChevronDown",size:"12",color:"#A6A6A6"})],2)]),default:we(()=>[(q(),de("span",{key:c.value,style:{cursor:"pointer"}},it(c.value),1))]),_:1},16,["onEscape"])),[[L(o),f.focusIndex]]),Se("div",{ref_key:"popupRef",ref:r,class:le(y.$style.list)},[(q(!0),de(Pt,null,xn(u.value,(_,I)=>(q(),Ke(fl,jt({class:y.$style["list-item"],focusIndex:`${f.focusIndex}.${I}`},{ref_for:!0},_,{key:_.id,onHandleClick:()=>d(_),onEscape:L(a)}),null,16,["class","focusIndex","onHandleClick","onEscape"]))),128))],2)],64))}}),[["__cssModules",{$style:{list:"_list_10jzh_2","list-item":"_list-item_10jzh_9"}}]]),wie={key:0,class:"wrapper-suffix"},Cie=["innerHTML"],bie=_t(nt({__name:"FilterStatus",props:{entityId:{},actived:{type:Boolean}},emits:["updated","error","cancel","update:modelValue"],setup(e,{expose:t,emit:n}){const o=xo,s=e,r={INITIAL_PAGE:1},{triggerRef:i,popupRef:a,isVisible:l,hide:u}=yo({toggleOnClick:!0,appendTo:"parent",offset:[0,0]}),c=$([]),d=$([]),h=$(!1),f=$(!1),p=$(null),g=$(r.INITIAL_PAGE),v=$(!0),w=$(0),S=$(""),b=n,y=X(()=>l.value||s.actived),E=X(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:c.value.length===0,wrapperRef:i,active:y,bordered:!0})),_=$(null),{argsMain:I}=Ao(E),T=X(()=>d.value.filter(te=>c.value.includes(te.id))),F=X(()=>{const te=T.value.length;return te===0?"":te===1?T.value[0].label:`${te} statuses `}),V=X(()=>c.value),x=X(()=>{if(c.value.length===0)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6"};const te=T.value[0],se=String((te==null?void 0:te.color)||"white");return{backgroundColor:se,border:uS(se,"white")?"1px solid #ccc":"1px solid #fff"}}),A=te=>({label:te.name,value:te.id,selected:c.value.includes(te.id),hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:te,id:te.id,color:te.color}),{apiServices:k}=so(!1,s),M=async(te=r.INITIAL_PAGE,se="",Z=!1)=>{var P,j;Z?f.value=!0:h.value=!0,p.value=null;try{const ne=un.getInstance().getItem("ws.code"),ge=await((P=k.value)==null?void 0:P.getFilterStatuses(ne,s.entityId||"",{name_like:se,page:te,entity_ids:s.entityId}));if(!ge){Z||(d.value=[]),v.value=!1;return}const xe=ge.data.map(A);d.value=Z?[...d.value,...xe]:xe,w.value=((j=ge.meta)==null?void 0:j.total)??ge.data.length,v.value=d.value.length<w.value,g.value=te}catch(ne){console.error("Error fetching statuses:",ne),p.value="Failed to load statuses",Z||(d.value=[]),v.value=!1,b("error",p.value)}finally{h.value=!1,f.value=!1}},N=te=>{const se=te.id;c.value.includes(se)?c.value=c.value.filter(P=>P!==se):c.value=[...c.value,se],b("update:modelValue",c.value)},B=async()=>{!v.value||f.value||await M(g.value+1,S.value,!0)},z=async te=>{S.value=te,g.value=r.INITIAL_PAGE,await M(r.INITIAL_PAGE,te,!1)},oe=()=>{c.value=[],b("update:modelValue",[])},ie=()=>{var te;(te=a.value)==null||te.focus()};return Je(()=>l.value,te=>{var se;te&&(M(1,S.value,!1),(se=_.value)==null||se.focus())}),Je(()=>c.value,te=>{b("updated",te)},{deep:!0}),t({focus:ie,clear:oe,getData:()=>c.value,setData:te=>{c.value=te},triggerFocus:()=>{ie()}}),(te,se)=>{const Z=Sc("tooltip");return q(),de(Pt,null,[ze((q(),Ke(Lo,jt({ref_key:"triggerRef",ref:i},L(I),{style:{"--icon-size":"18px"},class:"border-f3f5f8",actived:s.actived||L(l)}),{suffix:we(({hovered:P,focused:j})=>[T.value.length>0&&(P||j||L(l))?(q(),de("div",wie,[ye(St,{onClick:Ht(oe,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:we(()=>[ye(pt,{src:"XMarkSolid",size:"8"})]),_:1})])):Ye("",!0),Se("div",{class:le(["wrapper-suffix",{"icon-up":L(l)}])},[ye(pt,{src:"ChevronDown",size:"12",color:"#A6A6A6"})],2)]),default:we(()=>[Se("div",{class:le(te.$style.status)},[T.value.length==1?(q(),de("div",{key:0,class:le(te.$style["color-indicator"]),style:hn(x.value)},null,6)):Ye("",!0),ze((q(),de("span",{class:le({[te.$style.empty]:T.value.length===0,[te.$style["status-text"]]:!0})},[tt(it(F.value),1)],2)),[[Z,{content:F.value}]])],2)]),_:1},16,["actived"])),[[L(o),"3.2"]]),Se("div",{ref_key:"popupRef",ref:a},[ye(ya,{style:{width:"250px"},ref_key:"searchListRef",ref:_,"selected-id":V.value,options:d.value,loading:h.value,"loading-more":f.value,"has-more":v.value,error:p.value,onSearch:z,onSelect:N,onLoadMore:B,onCancel:L(u)},{item:we(({item:P,selectedIndex:j,isSelected:ne,handleItemHover:ge,getHighlightedLabel:xe,query:ue,idx:K})=>[(q(),Ke(MN,{key:P.value,status:P.data,selected:ne(P),onMouseover:Y=>ge(K),onSelect:Y=>N(P),hovered:K===j},{label:we(()=>[ue?ze((q(),de("span",{key:0,class:le([te.$style["item-label"],te.$style.match]),style:{flex:"1"},innerHTML:xe(P.label)},null,10,Cie)),[[Z,{content:P.label}]]):ze((q(),de("span",{key:1,class:le(te.$style["item-label"]),style:{flex:"1"}},[tt(it(P.label),1)],2)),[[Z,{content:P.label}]])]),_:2},1032,["status","selected","onMouseover","onSelect","hovered"]))]),_:1},8,["selected-id","options","loading","loading-more","has-more","error","onCancel"])],512)],64)}}}),[["__cssModules",{$style:{"list-item":"_list-item_pfzkz_2",status:"_status_pfzkz_6","color-indicator":"_color-indicator_pfzkz_12","count-badge":"_count-badge_pfzkz_26","status-text":"_status-text_pfzkz_33",empty:"_empty_pfzkz_42"}}],["__scopeId","data-v-7c13fe70"]]),Sie={key:0},Eie={key:1},_ie={key:0},Rie={key:1},Tie={key:0,class:"wrapper-suffix"},Die={key:1,class:"wrapper-suffix"},bL=_t(nt({__name:"FilterDateRange",props:{actived:{type:Boolean},focusIndex:{}},emits:["updated"],setup(e,{expose:t,emit:n}){const o=xo,{triggerRef:s,popupRef:r,isVisible:i,hide:a}=yo({toggleOnClick:!0,appendTo:"parent",offset:[0,0]}),l=e,u=()=>{c.value=[null,null]},c=$([null,null]),d=E=>{const _=Cv();return E?lt.fromJSDate(E,{zone:_}).toFormat("dd/MM/yyyy"):""},h=X(()=>i.value||l.actived),f=X(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:c.value[0]===null&&c.value[1]===null,wrapperRef:s,active:h,bordered:!0})),{argsMain:p}=Ao(f),g=$(!1),v=E=>{"start"in E&&E.start!==void 0&&(c.value[0]=E.start),"end"in E&&E.end!==void 0&&(c.value[1]=E.end)};t({getData:()=>c.value,clear:u,setData:E=>{c.value=E},focus:()=>{var E;(E=S.value)==null||E.focus()},triggerFocus:()=>{var E;(E=S.value)==null||E.focus()}});const w=n;Je(()=>c.value,E=>{w("updated",E)},{deep:!0});const S=$(null);Je(()=>i.value,E=>{E&&setTimeout(()=>{var _;(_=S.value)==null||_.focus()},0)});const b=Lv(),{parentConfig:y}=mo(b);return(E,_)=>(q(),de(Pt,null,[ze((q(),Ke(Lo,jt({ref_key:"triggerRef",ref:s},L(p),{actived:l.actived||L(i),style:{"--icon-size":"18px",cursor:"pointer"}}),{default:we(({focused:I})=>[Se("div",{class:le(E.$style["date-time"])},[Se("div",{class:le(E.$style.date)},[c.value[0]==null&&(I||L(i))?(q(),de("span",Sie,"DD/MM/YYYY")):(q(),de("span",Eie,it(d(c.value[0])),1))],2),c.value[0]!==null||c.value[1]!==null||I||L(i)?(q(),de("div",{key:0,class:le(E.$style.separator)}," → ",2)):Ye("",!0),Se("div",{class:le(E.$style.date)},[c.value[1]==null&&(I||L(i))?(q(),de("span",_ie,"DD/MM/YYYY")):(q(),de("span",Rie,it(d(c.value[1])),1))],2)],2)]),suffix:we(({hovered:I,focused:T})=>[(c.value[0]!==null||c.value[1]!==null)&&(I||T||L(i))?(q(),de("div",Tie,[ye(St,{onClick:Ht(u,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:we(()=>[ye(pt,{src:"XMarkSolid",size:"8"})]),_:1})])):(q(),de("div",Die,[ye(pt,{src:"Calendar",size:"12",color:"#A6A6A6"})]))]),_:1},16,["actived"])),[[L(o),l.focusIndex]]),Se("div",{ref_key:"popupRef",ref:r},[L(i)?(q(),Ke(Nv,{key:0,immediatelyUpdate:!1,value:c.value,onConfirmed:v,ref_key:"calendarRef",ref:S,onClosed:L(a),onStartUpdate:_[0]||(_[0]=I=>g.value=!0),onFinishUpdate:_[1]||(_[1]=I=>g.value=!1),"parent-config":L(y)},null,8,["value","onClosed","parent-config"])):Ye("",!0)],512)],64))}}),[["__cssModules",{$style:{"list-item":"_list-item_1695v_2","date-time":"_date-time_1695v_5",date:"_date_1695v_5",separator:"_separator_1695v_16"}}]]),Iie=_t(nt({__name:"Switch",props:{modelValue:{type:String,required:!0,validator:e=>["AND","OR"].includes(e)},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,o=t,s=c=>{n.disabled||n.modelValue===c||o("update:modelValue",c)},r=X(()=>n.modelValue==="AND"?"left":"right"),i=X(()=>n.modelValue==="AND"&&l.value?l.value.offsetWidth+"px":n.modelValue==="OR"&&u.value?u.value.offsetWidth+"px":"calc(50% - 2px)"),a=X(()=>n.modelValue==="AND"?"translateX(0)":n.modelValue==="OR"&&l.value?`translateX(${l.value.offsetWidth+2}px)`:"translateX(0)"),l=$(null),u=$(null);return(c,d)=>(q(),de("div",{class:le(["switch-container",{disabled:e.disabled}])},[Se("div",{class:le(["slider",r.value]),style:hn({width:i.value,transform:a.value})},null,6),Se("div",{class:le(["option",{active:e.modelValue==="AND"}]),onClick:d[0]||(d[0]=h=>s("AND")),ref_key:"andRef",ref:l}," AND ",2),Se("div",{class:le(["option",{active:e.modelValue==="OR"}]),onClick:d[1]||(d[1]=h=>s("OR")),ref_key:"orRef",ref:u}," OR ",2)],2))}}),[["__scopeId","data-v-964beee9"]]),vp=_t(nt({__name:"FilterRow",props:{logic:{},label:{},dataTabIndex:{},openDropdown:{type:Function}},setup(e,{expose:t}){const n=e;return t({triggerFocus:()=>{var o;(o=n.openDropdown)==null||o.call(n)}}),(o,s)=>(q(),de("div",{class:le(o.$style["filter-line"])},[Se("div",{class:le(o.$style["filter-logic"])},[Se("span",{class:le(o.$style["filter-tag"])},[kt(o.$slots,"logic",{},()=>[tt(it(e.logic),1)],!0)],2)],2),Se("span",null,it(e.label),1),Se("span",null,[kt(o.$slots,"is",{},()=>[s[0]||(s[0]=tt("is",-1))],!0)]),Se("div",{class:le(o.$style.selector)},[kt(o.$slots,"default",{},void 0,!0)],2)],2))}}),[["__cssModules",{$style:{"filter-line":"_filter-line_1jv6h_1","filter-tag":"_filter-tag_1jv6h_8",selector:"_selector_1jv6h_27"}}],["__scopeId","data-v-1fe9c01d"]]),xie={style:{height:"18px","min-width":"18px",width:"18px",display:"flex","align-items":"center","justify-content":"center"}},Aie=["fill"],Pie=["fill"],kie=_t(nt({__name:"FilterBox",props:{loading:{type:Boolean},entityId:{}},emits:["update:assignees","apply-filter"],setup(e,{expose:t,emit:n}){const o=Bs,s=Kt,r=xo,i=e,a={ACTIVE:"#000",DEFAULT:"#3C9BFA"},{hide:l,isVisible:u,triggerRef:c,popupRef:d}=yo({toggleOnClick:!0,offset:[0,0],maxWidth:650,zIndex:2}),h=Ey(),{workspaceUserRoleId:f}=mo(h),p=n,g=$(null),v=$(null),w=$(null),S=$(null),b=$(null),y=$(null),E=$(null),_=(ue,K)=>{y.value={...y.value,[ue]:K}},I=X(()=>f.value||""),T=$("AND"),F=X(()=>x.value?a.ACTIVE:a.DEFAULT),V=X(()=>({border:x.value?"1px solid var(--primary-color)":"",backgroundColor:x.value?"#F0F7FF":"",padding:x.value?"2px 8px 2px 8px":"2px 8px",gap:"0"})),x=X(()=>N(E.value)>0),A=X(()=>N(y.value)),k=X(()=>A.value===0),M=X(()=>A.value<=1),N=ue=>{var re,R,G;let K=0;return ue&&((((re=ue.assignees)==null?void 0:re.assignees)&&ue.assignees.assignees.length>0||((R=ue.assignees)==null?void 0:R.showMe)||((G=ue.assignees)==null?void 0:G.showNoAssignee))&&K++,ue.statuses&&ue.statuses.length>0&&K++,ue.archiveStatuses&&ue.archiveStatuses.length>0&&K++,ue.startDateRange&&(ue.startDateRange[0]||ue.startDateRange[1])&&K++,ue.dueDateRange&&(ue.dueDateRange[0]||ue.dueDateRange[1])&&K++),K},B=ue=>ue?ue.toISOString():null,z=ue=>{var ce;const K={};if(!ue)return K;const Y=((ce=ue.assignees)==null?void 0:ce.map(Ee=>Ee.id))||[],re=ue.showMe,R=ue.showNoAssignee,G=ue.selectedTypeId,J=re&&I.value?[...Y,I.value]:Y;if(J.length>0){const Ee=J.join(",");G==="any"?K.assignee_any_ina=Ee||"":G==="all"&&(K.assignee_all_ina=Ee)}return R&&G==="any"&&(K.with_not_assigned="1"),K},oe=(ue,K)=>{const Y={},[re,R]=ue;if(re&&R){const G=B(re),J=B(R);G&&J&&(Y[`${K}_btw`]=`${G},${J}`)}else if(re){const G=B(re);G&&(Y[`${K}_gte`]=G)}else if(R){const G=B(R);G&&(Y[`${K}_lte`]=G)}return Y},ie=ue=>{const K={};Object.assign(K,z(ue.assignees));const{statuses:Y,archiveStatuses:re,startDateRange:R,dueDateRange:G}=ue;return Y&&Y.length>0&&(K.status_ina=Y.join(",")),T.value=="AND"?K.condition_combine_type="and":K.condition_combine_type="or",R&&Object.assign(K,oe(R,"start_date")),G&&Object.assign(K,oe(G,"due_date")),!re||re.length===0?K.preflight_status="1":re&&re.length===1?K.status_eq=re[0]==="archived"?"0":"1":re&&re.length===2?K.status_eq="0,1":Object.keys(K).length===0&&(K.status_eq="1"),K},te=ue=>{if(ue===null||typeof ue!="object")return ue;if(ue instanceof Date)return new Date(ue.getTime());if(Array.isArray(ue))return ue.map(Y=>te(Y));const K={};for(const Y in ue)Object.prototype.hasOwnProperty.call(ue,Y)&&(K[Y]=te(ue[Y]));return K},se=()=>{var ue,K,Y,re,R;return{assignees:((ue=g.value)==null?void 0:ue.getData())||{},statuses:((K=v.value)==null?void 0:K.getData())||[],startDateRange:((Y=w.value)==null?void 0:Y.getData())||[null,null],dueDateRange:((re=S.value)==null?void 0:re.getData())||[null,null],archiveStatuses:((R=b.value)==null?void 0:R.getData())||[]}},Z=ue=>{var K,Y,re,R,G,J,ce,Ee,Ce,Ne,pe,H,W,be,Ae,He,Te,Xe,ve,Be;if(!ue){(Y=(K=g.value)==null?void 0:K.clear)==null||Y.call(K),(R=(re=v.value)==null?void 0:re.clear)==null||R.call(re),(J=(G=w.value)==null?void 0:G.clear)==null||J.call(G),(Ee=(ce=S.value)==null?void 0:ce.clear)==null||Ee.call(ce),(Ne=(Ce=b.value)==null?void 0:Ce.clear)==null||Ne.call(Ce);return}ue.assignees&&((H=(pe=g.value)==null?void 0:pe.setData)==null||H.call(pe,ue.assignees)),ue.statuses&&((be=(W=v.value)==null?void 0:W.setData)==null||be.call(W,ue.statuses)),ue.startDateRange&&((He=(Ae=w.value)==null?void 0:Ae.setData)==null||He.call(Ae,ue.startDateRange)),ue.dueDateRange&&((Xe=(Te=S.value)==null?void 0:Te.setData)==null||Xe.call(Te,ue.dueDateRange)),ue.archiveStatuses&&((Be=(ve=b.value)==null?void 0:ve.setData)==null||Be.call(ve,ue.archiveStatuses))},P=()=>{const ue=se(),K=ie(ue);E.value=te(ue),y.value=te(ue),p("apply-filter",K),l()},j=()=>{var ue,K,Y,re,R,G,J,ce,Ee,Ce;(K=(ue=g.value)==null?void 0:ue.clear)==null||K.call(ue),(re=(Y=v.value)==null?void 0:Y.clear)==null||re.call(Y),(G=(R=w.value)==null?void 0:R.clear)==null||G.call(R),(ce=(J=S.value)==null?void 0:J.clear)==null||ce.call(J),(Ce=(Ee=b.value)==null?void 0:Ee.clear)==null||Ce.call(Ee),T.value="AND",y.value=null},ne=()=>{j(),E.value=null,y.value=null,p("apply-filter",{preflight_status:"1"})};Je(A,ue=>{ue==0&&(T.value="AND")});const ge=()=>{E.value?(Z(te(E.value)),y.value=te(E.value)):(Z(null),y.value=null)};Je(u,(ue,K)=>{var Y;ue&&((Y=d.value)==null||Y.focus()),ue&&!K?E.value&&(Z(te(E.value)),y.value=te(E.value)):!ue&&K&&ge()}),t({getData:se,getParams:()=>ie(se()),clear:ne,revertToCache:ge});const xe=$(null);return Je(()=>u.value,(ue,K)=>{ue&&!K&&ht(()=>{setTimeout(()=>{var Y;(Y=xe.value)==null||Y.click()},1e3)})}),(ue,K)=>{var Y,re,R,G,J,ce,Ee;return q(),de(Pt,null,[Se("div",{ref_key:"triggerRef",ref:c},[ze((q(),Ke(St,{variant:["secondary"],actived:L(u)||x.value,style:hn({...V.value}),onEscape:L(l)},Hh({prefix:we(()=>[ze((q(),de("div",xie,[(q(),de("svg",{width:"14",height:"12",viewBox:"0 0 14 12",fill:F.value,xmlns:"http://www.w3.org/2000/svg"},[Se("path",{d:"M0.0998533 0.587105C0.269063 0.228176 0.627991 0 1.02538 0H12.1009C12.4983 0 12.8572 0.228176 13.0264 0.587105C13.1956 0.946034 13.1443 1.36906 12.8931 1.67671L8.20395 7.40675V10.6653C8.20395 10.9755 8.02961 11.2601 7.75016 11.3986C7.47071 11.537 7.13998 11.5088 6.8913 11.3216L5.25048 10.091C5.04281 9.9372 4.92232 9.69364 4.92232 9.4347V7.40675L0.230606 1.67415C-0.0180804 1.36906 -0.0719197 0.94347 0.0998533 0.587105Z",fill:F.value},null,8,Pie)],8,Aie))])),[[L(s),"Filter"]])]),_:2},[x.value?{name:"suffix",fn:we(()=>[ze((q(),de("div",{onClick:Ht(ne,["stop","prevent"]),style:{height:"20px",width:"20px",display:"flex","align-items":"center","justify-content":"center","margin-left":"4px"},class:"rotate-icon"},[ye(pt,{src:"XMarkSolid",size:9})])),[[L(s),"Clear filter"]])]),key:"0"}:void 0]),1032,["actived","style","onEscape"])),[[L(o),{isLoading:e.loading,fullwidth:!0}],[L(r),"3"]])],512),Se("div",{ref_key:"popupRef",ref:d,class:le(ue.$style["basic-filter"]),tabindex:"0"},[Se("div",{class:le(ue.$style.row)},[Se("span",{class:le(ue.$style["filter-header"])},[K[6]||(K[6]=tt(" Filters   ",-1)),ze(ye(Iie,{modelValue:T.value,"onUpdate:modelValue":K[0]||(K[0]=Ce=>T.value=Ce),disabled:M.value},null,8,["modelValue","disabled"]),[[L(s),{content:M.value?"Available only when more than one filter is selected.":"",bypassOverflowCheck:!0}]])],2),A.value>0||((re=(Y=y.value)==null?void 0:Y.assignees)==null?void 0:re.selectedTypeId)=="all"?(q(),de("div",{key:0,class:le(ue.$style.row)},[ze((q(),Ke(St,{size:"small",variant:"secondary",onClick:j,onEscape:L(l)},{default:we(()=>[...K[7]||(K[7]=[tt(" Clear all ",-1)])]),_:1},8,["onEscape"])),[[L(r),"3.7"]])],2)):Ye("",!0)],2),ye(vp,{logic:T.value,label:"Assignee",openDropdown:(R=g.value)==null?void 0:R.triggerFocus},{logic:we(()=>[...K[8]||(K[8]=[tt("Where",-1)])]),default:we(()=>[ye(mie,{entityId:i.entityId,ref_key:"FilterAssigneeRef",ref:g,onUpdated:K[1]||(K[1]=Ce=>_("assignees",Ce)),onEscape:L(l)},null,8,["entityId","onEscape"])]),_:1},8,["logic","openDropdown"]),ye(vp,{logic:T.value,label:"Status",openDropdown:(G=v.value)==null?void 0:G.triggerFocus},{default:we(()=>[ye(bie,{ref_key:"FilterStatusRef",ref:v,entityId:i.entityId,onUpdated:K[2]||(K[2]=Ce=>_("statuses",Ce))},null,8,["entityId"])]),_:1},8,["logic","openDropdown"]),ye(vp,{logic:T.value,openDropdown:(J=w.value)==null?void 0:J.triggerFocus,label:"Start Date"},{default:we(()=>[ye(bL,{focusIndex:"3.3",ref_key:"FilterStartDateRangeRef",ref:w,onUpdated:K[3]||(K[3]=Ce=>_("startDateRange",Ce))},null,512)]),_:1},8,["logic","openDropdown"]),ye(vp,{logic:T.value,label:"Due Date",openDropdown:(ce=S.value)==null?void 0:ce.triggerFocus},{default:we(()=>[ye(bL,{focusIndex:"3.4",ref_key:"FilterDueDateRangeRef",ref:S,onUpdated:K[4]||(K[4]=Ce=>_("dueDateRange",Ce))},null,512)]),_:1},8,["logic","openDropdown"]),ye(vp,{logic:T.value,label:"Archive Status",openDropdown:(Ee=b.value)==null?void 0:Ee.triggerFocus},{default:we(()=>[ye(yie,{focusIndex:"3.5",ref_key:"FilterArchiveStatusRef",ref:b,onUpdated:K[5]||(K[5]=Ce=>_("archiveStatuses",Ce))},null,512)]),_:1},8,["logic","openDropdown"]),Se("div",{class:le([ue.$style.row,ue.$style["justify-end"]])},[ze((q(),Ke(St,{size:"small",onClick:P,disabled:k.value,onEscape:L(l)},{default:we(()=>[...K[9]||(K[9]=[tt(" Apply filter ",-1)])]),_:1},8,["disabled","onEscape"])),[[L(r),"3.6"]])],2)],2)],64)}}}),[["__cssModules",{$style:{row:"_row_1mu3v_1","justify-end":"_justify-end_1mu3v_7","basic-filter":"_basic-filter_1mu3v_11","filter-grid":"_filter-grid_1mu3v_29","filter-line":"_filter-line_1mu3v_34","filter-tag":"_filter-tag_1mu3v_41",selector:"_selector_1mu3v_56","filter-header":"_filter-header_1mu3v_66"}}]]),Fie=nt({__name:"RatingRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean},error:{type:Boolean},config:{},sceneId:{}},setup(e,{expose:t}){var T;const n=Bs,o=e,{isEditing:s}=ld(o),{apiServices:r}=so(!0,o),i=X(()=>{var F,V;return{value:a.value,metricConfig:((V=(F=o.params)==null?void 0:F.colDef)==null?void 0:V.context)||o.config,error:o.error,hovered:!1,readOnly:o.disabled,disabled:o.readOnly,apiServices:r.value}}),a=$(Number(o.value)),l=$(!1),{componentState:u,metricConfig:c,ICON_SIZE:d,ratingParams:h,standardNameforIcon:f}=WN(i,l),{updateCellData:p}=CL((T=o.params)==null?void 0:T.api),g=F=>{a.value=F,S(F)},v=F=>{var V,x,A;p({rowId:String((x=(V=o.params)==null?void 0:V.data)==null?void 0:x.id),field:`metric_${((A=c.value)==null?void 0:A.id)||""}`,value:F})},w=X(()=>{var F,V;return(o==null?void 0:o.sceneId)||((V=(F=o.params)==null?void 0:F.data)==null?void 0:V.id)}),S=async F=>{var V,x;v(void 0);try{const A=await((x=r.value)==null?void 0:x.bulkUpdateMetric({workspaceId:o.workspaceId||"",itemIds:[w.value||""],value:F==0||F===null?null:F.toString(),metricId:((V=c.value)==null?void 0:V.id)||""}));if((A==null?void 0:A.message)=="Done")v(F),b.value=F;else throw console.error("Rating update: failed, reverting to cached value"),v(b.value),new Error("Update failed")}catch(A){console.error("Rating update: error updating value, reverting to cached value",A),v(b.value)}},b=$(a.value),y=async()=>{ht(()=>{setTimeout(async()=>{await S(a.value)},100)})},E=X(()=>({disabled:o.disabled,error:u.value.isError,clickable:!0,readOnly:o.readOnly,isEmpty:u.value.isEmpty})),{argsMain:_}=Ao(E),I=$(null);return t({focus:()=>{var F,V;(V=(F=I.value)==null?void 0:F.focus)==null||V.call(F)}}),(F,V)=>(q(),Ke(Lo,jt({style:{"--icon-size":"24px","--box-padding":"0 0 0 0"}},L(_),{ref:"wrapperRef",actived:L(s),size:32,tabindex:"0",bordered:!0}),{default:we(()=>[L(u).isRating&&L(h).maxRating?ze((q(),Ke(aM,{key:0,ref_key:"ratingComponentRef",ref:I,modelValue:a.value,"onUpdate:modelValue":V[0]||(V[0]=x=>a.value=x),params:L(h),readOnly:o.readOnly,disabled:o.disabled,onHandleEnter:g},{icon:we(()=>[ye(pt,{onClick:y,source:"rating",src:L(f)()||"Star",size:L(d)},null,8,["src","size"])]),_:1},8,["modelValue","params","readOnly","disabled"])),[[L(n),{isLoading:L(u).isLoading,fullwidth:!0}]]):Ye("",!0)]),_:1},16,["actived"]))}}),Oie=["innerHTML"],A0="Copy",SL="Copied to clipboard",Mie=5e3,Nie=_t(nt({__name:"NotePreviewer",props:{isOpen:{type:Boolean},canEdit:{type:Boolean},sceneId:{},disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean}},emits:["close","edit"],setup(e,{emit:t}){const n=Kt,o=e,s=$(null),r=$(A0);let i=null;const a=()=>{i&&(clearTimeout(i),i=null)},l=async()=>{const d=DO(String(o.value??""));try{try{typeof ClipboardItem<"u"?await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([o.value??""],{type:"text/html"}),"text/plain":new Blob([d],{type:"text/plain"})})]):await navigator.clipboard.writeText(d),r.value=SL}catch(h){console.error("[NotePreviewer] Failed to copy note to clipboard:",h);return}r.value=SL}catch(h){console.error("[NotePreviewer] Failed to copy note to clipboard:",h);return}a(),i=setTimeout(()=>{r.value=A0},Mie)};Je(()=>o.isOpen,d=>{d||(a(),r.value=A0)});const u=t,c=()=>{u("edit")};return(d,h)=>(q(),de("div",{class:le(d.$style["note-previewer"]),ref_key:"popupRef",ref:s},[Se("div",{class:le(d.$style["note-preview-header"])},[Se("div",{class:le(d.$style["note-preview-title"])},"Notes",2),Se("div",{class:le(d.$style["note-preview-actions"])},[ze((q(),Ke(L(St),{variant:["secondary","icon"],size:"small",onClick:l},{default:we(()=>[ye(pt,{src:"Copy"})]),_:1})),[[L(n),{content:r.value}]]),o.canEdit?ze((q(),Ke(L(St),{key:0,variant:["secondary","icon"],size:"small",onClick:c},{default:we(()=>[ye(pt,{src:"Pen"})]),_:1})),[[L(n),"Edit in Full View "]]):Ye("",!0)],2)],2),Se("div",{class:le(d.$style["note-preview-content"])},[Se("div",{class:le(d.$style["note-preview-text"]),innerHTML:o.value},null,10,Oie)],2)],2))}}),[["__cssModules",{$style:{"note-previewer":"_note-previewer_1tqlx_1","note-preview-header":"_note-preview-header_1tqlx_11","note-preview-content":"_note-preview-content_1tqlx_24","note-preview-title":"_note-preview-title_1tqlx_50","note-preview-actions":"_note-preview-actions_1tqlx_71"}}]]),Lie={key:0,class:"note-edit-btn"};let Ad=null;function Vie(e){Ad&&Ad!==e&&Ad(),Ad=e}function EL(e){Ad===e&&(Ad=null)}const Bie=_t(nt({__name:"NoteRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean}},setup(e){const t=Kt,n=e,o=$(null),s=1e3,r=1e3,i=50,a=X(()=>DO(String(n.value??""))),l=X(()=>a.value.length>0),u=X(()=>{var B,z;return((z=(B=n.data)==null?void 0:B.permissions)==null?void 0:z.has_edit_description_permission)==1}),c=X(()=>{var B;return!(((B=n.value)==null?void 0:B.length)>0)}),d=X(()=>{if(!l.value)return"-";const B=a.value.split(`
170
170
  `).length>1,z=a.value.split(`
171
171
  `)[0];return(z.length>i?`${z.slice(0,i)}…`:z)+(B?"…":"")});let h=null,f=null,p=!1,g=!1,v=!1;const w=()=>{h&&(clearTimeout(h),h=null)},S=()=>{f&&(clearTimeout(f),f=null)},{popupRef:b,triggerRef:y,show:E,hide:_,isVisible:I}=yo({trigger:"manual",appendTo:()=>document.getElementById("item-table-layout-id")||document.body,maxWidth:420,offset:[0,0],zIndex:1e3,onShow:()=>{Vie(_)},onHide:()=>{p=!1,w(),S(),EL(_)}}),T=()=>{p||(S(),f=setTimeout(()=>{!g&&!v&&_()},r))},F=()=>{g=!0,S(),!(!l.value||I.value)&&(w(),h=setTimeout(()=>{p=!1,E()},s))},V=()=>{g=!1,w()},x=()=>{v=!0,S()},A=()=>{v=!1},k=()=>{l.value&&(w(),S(),I.value?_():(p=!0,E()))},M=B=>{var oe;if(!I.value)return;const z=B.target;z&&((oe=b.value)!=null&&oe.contains(z))||_()};Je(y,(B,z,oe)=>{const ie=B;ie&&(ie.addEventListener("mouseenter",F),ie.addEventListener("mouseleave",V),ie.addEventListener("click",k),oe(()=>{ie.removeEventListener("mouseenter",F),ie.removeEventListener("mouseleave",V),ie.removeEventListener("click",k)}))}),Je(b,(B,z,oe)=>{B&&(B.addEventListener("mouseenter",x),B.addEventListener("mouseleave",A),oe(()=>{B.removeEventListener("mouseenter",x),B.removeEventListener("mouseleave",A)}))}),window.addEventListener("scroll",M,!0),Vn(()=>{w(),S(),EL(_),window.removeEventListener("scroll",M,!0)});const N=()=>{if(window.switchApploader)window.switchApploader("scene_hub",{tab:"home",id:n.id||"",editDescription:!0},{showLoading:!1});else{const B=un.getInstance().getItem("ws.code")||"",z=un.getInstance().getItem("BASE_URL"),oe=es({type:"scene_hub",config:{baseDomain:z,ws_code:B,scene_id:String(n.id)}}).url;window.open(oe,"_blank")}_()};return(B,z)=>(q(),de("div",{class:"note-wrapper",ref_key:"wrapperRef",ref:o},[Se("div",{class:le(["note-renderer",{"note-renderer--empty":!l.value,"note-renderer--can-edit":u.value}]),onMouseleave:T,ref_key:"triggerRef",ref:y},[Se("div",{class:le(["note-content",{"note-content--empty":!l.value}])},it(d.value),3),u.value&&c.value?(q(),de("div",Lie,[u.value?ze((q(),Ke(L(St),{key:0,variant:["secondary","icon"],onClick:Ht(N,["stop"]),size:"small"},{default:we(()=>[ye(pt,{src:"Pen"})]),_:1})),[[L(t),{content:"Edit in Full View "}]]):Ye("",!0)])):Ye("",!0)],34),l.value?(q(),de("div",{key:0,ref_key:"popupRef",ref:b,onMouseleave:T},[ye(Nie,{onClose:L(_),value:n.value,"read-only":!1,sceneId:n.id,"is-open":L(I),"can-edit":u.value,onEdit:N},null,8,["onClose","value","sceneId","is-open","can-edit"])],544)):Ye("",!0)],512))}}),[["__scopeId","data-v-f26bade3"]]);/*!
@@ -190,7 +190,7 @@ ${u}`:l)}else throw i},onCacheKey:i=>Hie(t,n,i)}}function Ele(e){if(Ct(e))return
190
190
  * vue-i18n v9.14.5
191
191
  * (c) 2025 kazuya kawaguchi
192
192
  * Released under the MIT License.
193
- */const Fle="9.14.5";function Ole(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Ra().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Ra().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(Ra().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Ra().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Ra().__INTLIFY_PROD_DEVTOOLS__=!1)}const AV=ps.__EXTEND_POINT__,Da=Ry(AV),jn={FALLBACK_TO_ROOT:AV,NOT_SUPPORTED_PRESERVE:Da(),NOT_SUPPORTED_FORMATTER:Da(),NOT_SUPPORTED_PRESERVE_DIRECTIVE:Da(),NOT_SUPPORTED_GET_CHOICE_INDEX:Da(),COMPONENT_NAME_LEGACY_COMPATIBLE:Da(),NOT_FOUND_PARENT_SCOPE:Da(),IGNORE_OBJ_FLATTEN:Da(),NOTICE_DROP_ALLOW_COMPOSITION:Da(),NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG:Da()},Mle={[jn.FALLBACK_TO_ROOT]:"Fall back to {type} '{key}' with root locale.",[jn.NOT_SUPPORTED_PRESERVE]:"Not supported 'preserve'.",[jn.NOT_SUPPORTED_FORMATTER]:"Not supported 'formatter'.",[jn.NOT_SUPPORTED_PRESERVE_DIRECTIVE]:"Not supported 'preserveDirectiveContent'.",[jn.NOT_SUPPORTED_GET_CHOICE_INDEX]:"Not supported 'getChoiceIndex'.",[jn.COMPONENT_NAME_LEGACY_COMPATIBLE]:"Component name legacy compatible: '{name}' -> 'i18n'",[jn.NOT_FOUND_PARENT_SCOPE]:"Not found parent scope. use the global scope.",[jn.IGNORE_OBJ_FLATTEN]:"Ignore object flatten: '{key}' key has an string value",[jn.NOTICE_DROP_ALLOW_COMPOSITION]:"'allowComposition' option will be dropped in the next major version. For more information, please see 👉 https://tinyurl.com/2p97mcze",[jn.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG]:"'translateExistCompatible' option will be dropped in the next major version."};function Ds(e,...t){return P0(Mle[e],...t)}const PV=$o.__EXTEND_POINT__,Is=Ry(PV),fn={UNEXPECTED_RETURN_TYPE:PV,INVALID_ARGUMENT:Is(),MUST_BE_CALL_SETUP_TOP:Is(),NOT_INSTALLED:Is(),NOT_AVAILABLE_IN_LEGACY_MODE:Is(),REQUIRED_VALUE:Is(),INVALID_VALUE:Is(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:Is(),NOT_INSTALLED_WITH_PROVIDE:Is(),UNEXPECTED_ERROR:Is(),NOT_COMPATIBLE_LEGACY_VUE_I18N:Is(),BRIDGE_SUPPORT_VUE_2_ONLY:Is(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:Is(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:Is(),__EXTEND_POINT__:Is()};function Fo(e,...t){return Pd(e,null,ee.env.NODE_ENV!=="production"?{messages:Nle,args:t}:void 0)}const Nle={[fn.UNEXPECTED_RETURN_TYPE]:"Unexpected return type in composer",[fn.INVALID_ARGUMENT]:"Invalid argument",[fn.MUST_BE_CALL_SETUP_TOP]:"Must be called at the top of a `setup` function",[fn.NOT_INSTALLED]:"Need to install with `app.use` function",[fn.UNEXPECTED_ERROR]:"Unexpected error",[fn.NOT_AVAILABLE_IN_LEGACY_MODE]:"Not available in legacy mode",[fn.REQUIRED_VALUE]:"Required in value: {0}",[fn.INVALID_VALUE]:"Invalid value",[fn.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]:"Cannot setup vue-devtools plugin",[fn.NOT_INSTALLED_WITH_PROVIDE]:"Need to install with `provide` function",[fn.NOT_COMPATIBLE_LEGACY_VUE_I18N]:"Not compatible legacy VueI18n.",[fn.BRIDGE_SUPPORT_VUE_2_ONLY]:"vue-i18n-bridge support Vue 2.x only",[fn.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION]:"Must define ‘i18n’ option or custom block in Composition API with using local scope in Legacy API mode",[fn.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]:"Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly"},z0=Ii("__translateVNode"),j0=Ii("__datetimeParts"),K0=Ii("__numberParts"),Uu=Ii("__enableEmitter"),bp=Ii("__disableEmitter"),kV=Ii("__setPluralRules"),FV=Ii("__injectWithOption"),q0=Ii("__dispose");function Sp(e){if(!dn(e)||Tr(e))return e;for(const t in e)if(Zr(e,t))if(!t.includes("."))dn(e[t])&&Sp(e[t]);else{const n=t.split("."),o=n.length-1;let s=e,r=!1;for(let i=0;i<o;i++){if(n[i]==="__proto__")throw new Error(`unsafe key: ${n[i]}`);if(n[i]in s||(s[n[i]]=An()),!dn(s[n[i]])){ee.env.NODE_ENV!=="production"&&bo(Ds(jn.IGNORE_OBJ_FLATTEN,{key:n[i]})),r=!0;break}s=s[n[i]]}if(r||(Tr(s)?KL.includes(n[o])||delete e[t]:(s[n[o]]=e[t],delete e[t])),!Tr(s)){const i=s[n[o]];dn(i)&&Sp(i)}}return e}function Oy(e,t){const{messages:n,__i18n:o,messageResolver:s,flatJson:r}=t,i=zt(n)?n:Mn(o)?An():{[e]:An()};if(Mn(o)&&o.forEach(a=>{if("locale"in a&&"resource"in a){const{locale:l,resource:u}=a;l?(i[l]=i[l]||An(),Dy(u,i[l])):Dy(u,i)}else Ct(a)&&Dy(JSON.parse(a),i)}),s==null&&r)for(const a in i)Zr(i,a)&&Sp(i[a]);return i}function OV(e){return e.type}function MV(e,t,n){let o=dn(t.messages)?t.messages:An();"__i18nGlobal"in n&&(o=Oy(e.locale.value,{messages:o,__i18n:n.__i18nGlobal}));const s=Object.keys(o);s.length&&s.forEach(r=>{e.mergeLocaleMessage(r,o[r])});{if(dn(t.datetimeFormats)){const r=Object.keys(t.datetimeFormats);r.length&&r.forEach(i=>{e.mergeDateTimeFormat(i,t.datetimeFormats[i])})}if(dn(t.numberFormats)){const r=Object.keys(t.numberFormats);r.length&&r.forEach(i=>{e.mergeNumberFormat(i,t.numberFormats[i])})}}}function NV(e){return ye(Ka,null,e,0)}const LV="__INTLIFY_META__",VV=()=>[],Lle=()=>!1;let BV=0;function $V(e){return(t,n,o,s)=>e(n,o,oo()||void 0,s)}const Vle=()=>{const e=oo();let t=null;return e&&(t=OV(e)[LV])?{[LV]:t}:null};function Y0(e={},t){const{__root:n,__injectWithOption:o}=e,s=n===void 0,r=e.flatJson,i=Xr?$:xh,a=!!e.translateExistCompatible;ee.env.NODE_ENV!=="production"&&a&&RL(Ds(jn.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG));let l=on(e.inheritLocale)?e.inheritLocale:!0;const u=i(n&&l?n.locale.value:Ct(e.locale)?e.locale:Od),c=i(n&&l?n.fallbackLocale.value:Ct(e.fallbackLocale)||Mn(e.fallbackLocale)||zt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:u.value),d=i(Oy(u.value,e)),h=i(zt(e.datetimeFormats)?e.datetimeFormats:{[u.value]:{}}),f=i(zt(e.numberFormats)?e.numberFormats:{[u.value]:{}});let p=n?n.missingWarn:on(e.missingWarn)||El(e.missingWarn)?e.missingWarn:!0,g=n?n.fallbackWarn:on(e.fallbackWarn)||El(e.fallbackWarn)?e.fallbackWarn:!0,v=n?n.fallbackRoot:on(e.fallbackRoot)?e.fallbackRoot:!0,w=!!e.fallbackFormat,S=Pn(e.missing)?e.missing:null,b=Pn(e.missing)?$V(e.missing):null,y=Pn(e.postTranslation)?e.postTranslation:null,E=n?n.warnHtmlMessage:on(e.warnHtmlMessage)?e.warnHtmlMessage:!0,_=!!e.escapeParameter;const I=n?n.modifiers:zt(e.modifiers)?e.modifiers:{};let T=e.pluralRules||n&&n.pluralRules,F;F=(()=>{s&&lV(null);const ve={version:Fle,locale:u.value,fallbackLocale:c.value,messages:d.value,modifiers:I,pluralRules:T,missing:b===null?void 0:b,missingWarn:p,fallbackWarn:g,fallbackFormat:w,unresolving:!0,postTranslation:y===null?void 0:y,warnHtmlMessage:E,escapeParameter:_,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};ve.datetimeFormats=h.value,ve.numberFormats=f.value,ve.__datetimeFormatters=zt(F)?F.__datetimeFormatters:void 0,ve.__numberFormatters=zt(F)?F.__numberFormatters:void 0,ee.env.NODE_ENV!=="production"&&(ve.__v_emitter=zt(F)?F.__v_emitter:void 0);const Be=ple(ve);return s&&lV(Be),Be})(),Cp(F,u.value,c.value);function x(){return[u.value,c.value,d.value,h.value,f.value]}const A=X({get:()=>u.value,set:ve=>{u.value=ve,F.locale=u.value}}),k=X({get:()=>c.value,set:ve=>{c.value=ve,F.fallbackLocale=c.value,Cp(F,u.value,ve)}}),M=X(()=>d.value),N=X(()=>h.value),B=X(()=>f.value);function z(){return Pn(y)?y:null}function oe(ve){y=ve,F.postTranslation=ve}function ie(){return S}function te(ve){ve!==null&&(b=$V(ve)),S=ve,F.missing=b}function se(ve,Be){return ve!=="translate"||!Be.resolvedMessage}const Z=(ve,Be,wt,Tt,tn,en)=>{x();let bn;try{ee.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,s||(F.fallbackContext=n?fle():void 0),bn=ve(F)}finally{ee.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,s||(F.fallbackContext=void 0)}if(wt!=="translate exists"&&ro(bn)&&bn===Py||wt==="translate exists"&&!bn){const[Le,Ge]=Be();if(ee.env.NODE_ENV!=="production"&&n&&Ct(Le)&&se(wt,Ge)&&(v&&(Fy(g,Le)||cV(p,Le))&&bo(Ds(jn.FALLBACK_TO_ROOT,{key:Le,type:wt})),ee.env.NODE_ENV!=="production")){const{__v_emitter:Rt}=F;Rt&&v&&Rt.emit("fallback",{type:wt,key:Le,to:"global",groupId:`${wt}:${Le}`})}return n&&v?Tt(n):tn(Le)}else{if(en(bn))return bn;throw Fo(fn.UNEXPECTED_RETURN_TYPE)}};function P(...ve){return Z(Be=>Reflect.apply(yV,null,[Be,...ve]),()=>H0(...ve),"translate",Be=>Reflect.apply(Be.t,Be,[...ve]),Be=>Be,Be=>Ct(Be))}function j(...ve){const[Be,wt,Tt]=ve;if(Tt&&!dn(Tt))throw Fo(fn.INVALID_ARGUMENT);return P(Be,wt,Ko({resolvedMessage:!0},Tt||{}))}function ne(...ve){return Z(Be=>Reflect.apply(EV,null,[Be,...ve]),()=>G0(...ve),"datetime format",Be=>Reflect.apply(Be.d,Be,[...ve]),()=>ky,Be=>Ct(Be))}function ge(...ve){return Z(Be=>Reflect.apply(TV,null,[Be,...ve]),()=>U0(...ve),"number format",Be=>Reflect.apply(Be.n,Be,[...ve]),()=>ky,Be=>Ct(Be))}function xe(ve){return ve.map(Be=>Ct(Be)||ro(Be)||on(Be)?NV(String(Be)):Be)}const K={normalize:xe,interpolate:ve=>ve,type:"vnode"};function Y(...ve){return Z(Be=>{let wt;const Tt=Be;try{Tt.processor=K,wt=Reflect.apply(yV,null,[Tt,...ve])}finally{Tt.processor=null}return wt},()=>H0(...ve),"translate",Be=>Be[z0](...ve),Be=>[NV(Be)],Be=>Mn(Be))}function re(...ve){return Z(Be=>Reflect.apply(TV,null,[Be,...ve]),()=>U0(...ve),"number format",Be=>Be[K0](...ve),VV,Be=>Ct(Be)||Mn(Be))}function R(...ve){return Z(Be=>Reflect.apply(EV,null,[Be,...ve]),()=>G0(...ve),"datetime format",Be=>Be[j0](...ve),VV,Be=>Ct(Be)||Mn(Be))}function G(ve){T=ve,F.pluralRules=T}function J(ve,Be){return Z(()=>{if(!ve)return!1;const wt=Ct(Be)?Be:u.value,Tt=Ce(wt),tn=F.messageResolver(Tt,ve);return a?tn!=null:Tr(tn)||Dr(tn)||Ct(tn)},()=>[ve],"translate exists",wt=>Reflect.apply(wt.te,wt,[ve,Be]),Lle,wt=>on(wt))}function ce(ve){let Be=null;const wt=QL(F,c.value,u.value);for(let Tt=0;Tt<wt.length;Tt++){const tn=d.value[wt[Tt]]||{},en=F.messageResolver(tn,ve);if(en!=null){Be=en;break}}return Be}function Ee(ve){const Be=ce(ve);return Be??(n?n.tm(ve)||{}:{})}function Ce(ve){return d.value[ve]||{}}function Ne(ve,Be){if(r){const wt={[ve]:Be};for(const Tt in wt)Zr(wt,Tt)&&Sp(wt[Tt]);Be=wt[ve]}d.value[ve]=Be,F.messages=d.value}function pe(ve,Be){d.value[ve]=d.value[ve]||{};const wt={[ve]:Be};if(r)for(const Tt in wt)Zr(wt,Tt)&&Sp(wt[Tt]);Be=wt[ve],Dy(Be,d.value[ve]),F.messages=d.value}function H(ve){return h.value[ve]||{}}function W(ve,Be){h.value[ve]=Be,F.datetimeFormats=h.value,RV(F,ve,Be)}function be(ve,Be){h.value[ve]=Ko(h.value[ve]||{},Be),F.datetimeFormats=h.value,RV(F,ve,Be)}function Ae(ve){return f.value[ve]||{}}function He(ve,Be){f.value[ve]=Be,F.numberFormats=f.value,IV(F,ve,Be)}function Te(ve,Be){f.value[ve]=Ko(f.value[ve]||{},Be),F.numberFormats=f.value,IV(F,ve,Be)}BV++,n&&Xr&&(Je(n.locale,ve=>{l&&(u.value=ve,F.locale=ve,Cp(F,u.value,c.value))}),Je(n.fallbackLocale,ve=>{l&&(c.value=ve,F.fallbackLocale=ve,Cp(F,u.value,c.value))}));const Xe={id:BV,locale:A,fallbackLocale:k,get inheritLocale(){return l},set inheritLocale(ve){l=ve,ve&&n&&(u.value=n.locale.value,c.value=n.fallbackLocale.value,Cp(F,u.value,c.value))},get availableLocales(){return Object.keys(d.value).sort()},messages:M,get modifiers(){return I},get pluralRules(){return T||{}},get isGlobal(){return s},get missingWarn(){return p},set missingWarn(ve){p=ve,F.missingWarn=p},get fallbackWarn(){return g},set fallbackWarn(ve){g=ve,F.fallbackWarn=g},get fallbackRoot(){return v},set fallbackRoot(ve){v=ve},get fallbackFormat(){return w},set fallbackFormat(ve){w=ve,F.fallbackFormat=w},get warnHtmlMessage(){return E},set warnHtmlMessage(ve){E=ve,F.warnHtmlMessage=ve},get escapeParameter(){return _},set escapeParameter(ve){_=ve,F.escapeParameter=ve},t:P,getLocaleMessage:Ce,setLocaleMessage:Ne,mergeLocaleMessage:pe,getPostTranslationHandler:z,setPostTranslationHandler:oe,getMissingHandler:ie,setMissingHandler:te,[kV]:G};return Xe.datetimeFormats=N,Xe.numberFormats=B,Xe.rt=j,Xe.te=J,Xe.tm=Ee,Xe.d=ne,Xe.n=ge,Xe.getDateTimeFormat=H,Xe.setDateTimeFormat=W,Xe.mergeDateTimeFormat=be,Xe.getNumberFormat=Ae,Xe.setNumberFormat=He,Xe.mergeNumberFormat=Te,Xe[FV]=o,Xe[z0]=Y,Xe[j0]=R,Xe[K0]=re,ee.env.NODE_ENV!=="production"&&(Xe[Uu]=ve=>{F.__v_emitter=ve},Xe[bp]=()=>{F.__v_emitter=void 0}),Xe}function Ble(e){const t=Ct(e.locale)?e.locale:Od,n=Ct(e.fallbackLocale)||Mn(e.fallbackLocale)||zt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,o=Pn(e.missing)?e.missing:void 0,s=on(e.silentTranslationWarn)||El(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,r=on(e.silentFallbackWarn)||El(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,i=on(e.fallbackRoot)?e.fallbackRoot:!0,a=!!e.formatFallbackMessages,l=zt(e.modifiers)?e.modifiers:{},u=e.pluralizationRules,c=Pn(e.postTranslation)?e.postTranslation:void 0,d=Ct(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,h=!!e.escapeParameterHtml,f=on(e.sync)?e.sync:!0;ee.env.NODE_ENV!=="production"&&e.formatter&&bo(Ds(jn.NOT_SUPPORTED_FORMATTER)),ee.env.NODE_ENV!=="production"&&e.preserveDirectiveContent&&bo(Ds(jn.NOT_SUPPORTED_PRESERVE_DIRECTIVE));let p=e.messages;if(zt(e.sharedMessages)){const _=e.sharedMessages;p=Object.keys(_).reduce((T,F)=>{const V=T[F]||(T[F]={});return Ko(V,_[F]),T},p||{})}const{__i18n:g,__root:v,__injectWithOption:w}=e,S=e.datetimeFormats,b=e.numberFormats,y=e.flatJson,E=e.translateExistCompatible;return{locale:t,fallbackLocale:n,messages:p,flatJson:y,datetimeFormats:S,numberFormats:b,missing:o,missingWarn:s,fallbackWarn:r,fallbackRoot:i,fallbackFormat:a,modifiers:l,pluralRules:u,postTranslation:c,warnHtmlMessage:d,escapeParameter:h,messageResolver:e.messageResolver,inheritLocale:f,translateExistCompatible:E,__i18n:g,__root:v,__injectWithOption:w}}function X0(e={},t){{const n=Y0(Ble(e)),{__extender:o}=e,s={id:n.id,get locale(){return n.locale.value},set locale(r){n.locale.value=r},get fallbackLocale(){return n.fallbackLocale.value},set fallbackLocale(r){n.fallbackLocale.value=r},get messages(){return n.messages.value},get datetimeFormats(){return n.datetimeFormats.value},get numberFormats(){return n.numberFormats.value},get availableLocales(){return n.availableLocales},get formatter(){return ee.env.NODE_ENV!=="production"&&bo(Ds(jn.NOT_SUPPORTED_FORMATTER)),{interpolate(){return[]}}},set formatter(r){ee.env.NODE_ENV!=="production"&&bo(Ds(jn.NOT_SUPPORTED_FORMATTER))},get missing(){return n.getMissingHandler()},set missing(r){n.setMissingHandler(r)},get silentTranslationWarn(){return on(n.missingWarn)?!n.missingWarn:n.missingWarn},set silentTranslationWarn(r){n.missingWarn=on(r)?!r:r},get silentFallbackWarn(){return on(n.fallbackWarn)?!n.fallbackWarn:n.fallbackWarn},set silentFallbackWarn(r){n.fallbackWarn=on(r)?!r:r},get modifiers(){return n.modifiers},get formatFallbackMessages(){return n.fallbackFormat},set formatFallbackMessages(r){n.fallbackFormat=r},get postTranslation(){return n.getPostTranslationHandler()},set postTranslation(r){n.setPostTranslationHandler(r)},get sync(){return n.inheritLocale},set sync(r){n.inheritLocale=r},get warnHtmlInMessage(){return n.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(r){n.warnHtmlMessage=r!=="off"},get escapeParameterHtml(){return n.escapeParameter},set escapeParameterHtml(r){n.escapeParameter=r},get preserveDirectiveContent(){return ee.env.NODE_ENV!=="production"&&bo(Ds(jn.NOT_SUPPORTED_PRESERVE_DIRECTIVE)),!0},set preserveDirectiveContent(r){ee.env.NODE_ENV!=="production"&&bo(Ds(jn.NOT_SUPPORTED_PRESERVE_DIRECTIVE))},get pluralizationRules(){return n.pluralRules||{}},__composer:n,t(...r){const[i,a,l]=r,u={};let c=null,d=null;if(!Ct(i))throw Fo(fn.INVALID_ARGUMENT);const h=i;return Ct(a)?u.locale=a:Mn(a)?c=a:zt(a)&&(d=a),Mn(l)?c=l:zt(l)&&(d=l),Reflect.apply(n.t,n,[h,c||d||{},u])},rt(...r){return Reflect.apply(n.rt,n,[...r])},tc(...r){const[i,a,l]=r,u={plural:1};let c=null,d=null;if(!Ct(i))throw Fo(fn.INVALID_ARGUMENT);const h=i;return Ct(a)?u.locale=a:ro(a)?u.plural=a:Mn(a)?c=a:zt(a)&&(d=a),Ct(l)?u.locale=l:Mn(l)?c=l:zt(l)&&(d=l),Reflect.apply(n.t,n,[h,c||d||{},u])},te(r,i){return n.te(r,i)},tm(r){return n.tm(r)},getLocaleMessage(r){return n.getLocaleMessage(r)},setLocaleMessage(r,i){n.setLocaleMessage(r,i)},mergeLocaleMessage(r,i){n.mergeLocaleMessage(r,i)},d(...r){return Reflect.apply(n.d,n,[...r])},getDateTimeFormat(r){return n.getDateTimeFormat(r)},setDateTimeFormat(r,i){n.setDateTimeFormat(r,i)},mergeDateTimeFormat(r,i){n.mergeDateTimeFormat(r,i)},n(...r){return Reflect.apply(n.n,n,[...r])},getNumberFormat(r){return n.getNumberFormat(r)},setNumberFormat(r,i){n.setNumberFormat(r,i)},mergeNumberFormat(r,i){n.mergeNumberFormat(r,i)},getChoiceIndex(r,i){return ee.env.NODE_ENV!=="production"&&bo(Ds(jn.NOT_SUPPORTED_GET_CHOICE_INDEX)),-1}};return s.__extender=o,ee.env.NODE_ENV!=="production"&&(s.__enableEmitter=r=>{const i=n;i[Uu]&&i[Uu](r)},s.__disableEmitter=()=>{const r=n;r[bp]&&r[bp]()}),s}}const Z0={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function $le({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((o,s)=>[...o,...s.type===Pt?s.children:[s]],[]):t.reduce((n,o)=>{const s=e[o];return s&&(n[o]=s()),n},An())}function HV(e){return Pt}const J0=nt({name:"i18n-t",props:Ko({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>ro(e)||!isNaN(e)}},Z0),setup(e,t){const{slots:n,attrs:o}=t,s=e.i18n||n_({useScope:e.scope,__useComponent:!0});return()=>{const r=Object.keys(n).filter(d=>d!=="_"),i=An();e.locale&&(i.locale=e.locale),e.plural!==void 0&&(i.plural=Ct(e.plural)?+e.plural:e.plural);const a=$le(t,r),l=s[z0](e.keypath,a,i),u=Ko(An(),o),c=Ct(e.tag)||dn(e.tag)?e.tag:HV();return Tc(c,u,l)}}});function Hle(e){return Mn(e)&&!Ct(e[0])}function GV(e,t,n,o){const{slots:s,attrs:r}=t;return()=>{const i={part:!0};let a=An();e.locale&&(i.locale=e.locale),Ct(e.format)?i.key=e.format:dn(e.format)&&(Ct(e.format.key)&&(i.key=e.format.key),a=Object.keys(e.format).reduce((h,f)=>n.includes(f)?Ko(An(),h,{[f]:e.format[f]}):h,An()));const l=o(e.value,i,a);let u=[i.key];Mn(l)?u=l.map((h,f)=>{const p=s[h.type],g=p?p({[h.type]:h.value,index:f,parts:l}):[h.value];return Hle(g)&&(g[0].key=`${h.type}-${f}`),g}):Ct(l)&&(u=[l]);const c=Ko(An(),r),d=Ct(e.tag)||dn(e.tag)?e.tag:HV();return Tc(d,c,u)}}const UV=nt({name:"i18n-n",props:Ko({value:{type:Number,required:!0},format:{type:[String,Object]}},Z0),setup(e,t){const n=e.i18n||n_({useScope:e.scope,__useComponent:!0});return GV(e,t,DV,(...o)=>n[K0](...o))}}),WV=nt({name:"i18n-d",props:Ko({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Z0),setup(e,t){const n=e.i18n||n_({useScope:e.scope,__useComponent:!0});return GV(e,t,_V,(...o)=>n[j0](...o))}});function Gle(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const o=n.__getInstance(t);return o!=null?o.__composer:e.global.__composer}}function Ule(e){const t=i=>{const{instance:a,modifiers:l,value:u}=i;if(!a||!a.$)throw Fo(fn.UNEXPECTED_ERROR);const c=Gle(e,a.$);ee.env.NODE_ENV!=="production"&&l.preserve&&bo(Ds(jn.NOT_SUPPORTED_PRESERVE));const d=zV(u);return[Reflect.apply(c.t,c,[...jV(d)]),c]};return{created:(i,a)=>{const[l,u]=t(a);Xr&&e.global===u&&(i.__i18nWatcher=Je(u.locale,()=>{a.instance&&a.instance.$forceUpdate()})),i.__composer=u,i.textContent=l},unmounted:i=>{Xr&&i.__i18nWatcher&&(i.__i18nWatcher(),i.__i18nWatcher=void 0,delete i.__i18nWatcher),i.__composer&&(i.__composer=void 0,delete i.__composer)},beforeUpdate:(i,{value:a})=>{if(i.__composer){const l=i.__composer,u=zV(a);i.textContent=Reflect.apply(l.t,l,[...jV(u)])}},getSSRProps:i=>{const[a]=t(i);return{textContent:a}}}}function zV(e){if(Ct(e))return{path:e};if(zt(e)){if(!("path"in e))throw Fo(fn.REQUIRED_VALUE,"path");return e}else throw Fo(fn.INVALID_VALUE)}function jV(e){const{path:t,locale:n,args:o,choice:s,plural:r}=e,i={},a=o||{};return Ct(n)&&(i.locale=n),ro(s)&&(i.plural=s),ro(r)&&(i.plural=r),[t,a,i]}function Wle(e,t,...n){const o=zt(n[0])?n[0]:{},s=!!o.useI18nComponentName,r=on(o.globalInstall)?o.globalInstall:!0;ee.env.NODE_ENV!=="production"&&r&&s&&bo(Ds(jn.COMPONENT_NAME_LEGACY_COMPATIBLE,{name:J0.name})),r&&([s?"i18n":J0.name,"I18nT"].forEach(i=>e.component(i,J0)),[UV.name,"I18nN"].forEach(i=>e.component(i,UV)),[WV.name,"I18nD"].forEach(i=>e.component(i,WV))),e.directive("t",Ule(t))}const Q0={"vue-devtools-plugin-vue-i18n":"Vue I18n devtools","vue-i18n-resource-inspector":"I18n Resources","vue-i18n-timeline":"Vue I18n"},zle={"vue-i18n-resource-inspector":"Search for scopes ..."},jle={"vue-i18n-timeline":16764185},KV="vue-i18n: composer properties";let e_;async function Kle(e,t){return new Promise((n,o)=>{try{kle({id:"vue-devtools-plugin-vue-i18n",label:Q0["vue-devtools-plugin-vue-i18n"],packageName:"vue-i18n",homepage:"https://vue-i18n.intlify.dev",logo:"https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png",componentStateTypes:[KV],app:e},s=>{e_=s,s.on.visitComponentTree(({componentInstance:i,treeNode:a})=>{qle(i,a,t)}),s.on.inspectComponent(({componentInstance:i,instanceData:a})=>{i.vnode.el&&i.vnode.el.__VUE_I18N__&&a&&(t.mode==="legacy"?i.vnode.el.__VUE_I18N__!==t.global.__composer&&YV(a,i.vnode.el.__VUE_I18N__):YV(a,i.vnode.el.__VUE_I18N__))}),s.addInspector({id:"vue-i18n-resource-inspector",label:Q0["vue-i18n-resource-inspector"],icon:"language",treeFilterPlaceholder:zle["vue-i18n-resource-inspector"]}),s.on.getInspectorTree(i=>{i.app===e&&i.inspectorId==="vue-i18n-resource-inspector"&&Qle(i,t)});const r=new Map;s.on.getInspectorState(async i=>{if(i.app===e&&i.inspectorId==="vue-i18n-resource-inspector")if(s.unhighlightElement(),tue(i,t),i.nodeId==="global"){if(!r.has(i.app)){const[a]=await s.getComponentInstances(i.app);r.set(i.app,a)}s.highlightElement(r.get(i.app))}else{const a=eue(i.nodeId,t);a&&s.highlightElement(a)}}),s.on.editInspectorState(i=>{i.app===e&&i.inspectorId==="vue-i18n-resource-inspector"&&oue(i,t)}),s.addTimelineLayer({id:"vue-i18n-timeline",label:Q0["vue-i18n-timeline"],color:jle["vue-i18n-timeline"]}),n(!0)})}catch(s){console.error(s),o(!1)}})}function qV(e){return e.type.name||e.type.displayName||e.type.__file||"Anonymous"}function qle(e,t,n){const o=n.mode==="composition"?n.global:n.global.__composer;if(e&&e.vnode.el&&e.vnode.el.__VUE_I18N__&&e.vnode.el.__VUE_I18N__!==o){const s={label:`i18n (${qV(e)} Scope)`,textColor:0,backgroundColor:16764185};t.tags.push(s)}}function YV(e,t){const n=KV;e.state.push({type:n,key:"locale",editable:!0,value:t.locale.value}),e.state.push({type:n,key:"availableLocales",editable:!1,value:t.availableLocales}),e.state.push({type:n,key:"fallbackLocale",editable:!0,value:t.fallbackLocale.value}),e.state.push({type:n,key:"inheritLocale",editable:!0,value:t.inheritLocale}),e.state.push({type:n,key:"messages",editable:!1,value:t_(t.messages.value)}),e.state.push({type:n,key:"datetimeFormats",editable:!1,value:t.datetimeFormats.value}),e.state.push({type:n,key:"numberFormats",editable:!1,value:t.numberFormats.value})}function t_(e){const t={};return Object.keys(e).forEach(n=>{const o=e[n];Pn(o)&&"source"in o?t[n]=Jle(o):Tr(o)&&o.loc&&o.loc.source?t[n]=o.loc.source:dn(o)?t[n]=t_(o):t[n]=o}),t}const Yle={"<":"&lt;",">":"&gt;",'"':"&quot;","&":"&amp;"};function Xle(e){return e.replace(/[<>"&]/g,Zle)}function Zle(e){return Yle[e]||e}function Jle(e){return{_custom:{type:"function",display:`<span>ƒ</span> ${e.source?`("${Xle(e.source)}")`:"(?)"}`}}}function Qle(e,t){e.rootNodes.push({id:"global",label:"Global Scope"});const n=t.mode==="composition"?t.global:t.global.__composer;for(const[o,s]of t.__instances){const r=t.mode==="composition"?s:s.__composer;n!==r&&e.rootNodes.push({id:r.id.toString(),label:`${qV(o)} Scope`})}}function eue(e,t){let n=null;if(e!=="global"){for(const[o,s]of t.__instances.entries())if(s.id.toString()===e){n=o;break}}return n}function XV(e,t){if(e==="global")return t.mode==="composition"?t.global:t.global.__composer;{const n=Array.from(t.__instances.values()).find(o=>o.id.toString()===e);return n?t.mode==="composition"?n:n.__composer:null}}function tue(e,t){const n=XV(e.nodeId,t);return n&&(e.state=nue(n)),null}function nue(e){const t={},n="Locale related info",o=[{type:n,key:"locale",editable:!0,value:e.locale.value},{type:n,key:"fallbackLocale",editable:!0,value:e.fallbackLocale.value},{type:n,key:"availableLocales",editable:!1,value:e.availableLocales},{type:n,key:"inheritLocale",editable:!0,value:e.inheritLocale}];t[n]=o;const s="Locale messages info",r=[{type:s,key:"messages",editable:!1,value:t_(e.messages.value)}];t[s]=r;{const i="Datetime formats info",a=[{type:i,key:"datetimeFormats",editable:!1,value:e.datetimeFormats.value}];t[i]=a;const l="Datetime formats info",u=[{type:l,key:"numberFormats",editable:!1,value:e.numberFormats.value}];t[l]=u}return t}function Ep(e,t){if(e_){let n;t&&"groupId"in t&&(n=t.groupId,delete t.groupId),e_.addTimelineEvent({layerId:"vue-i18n-timeline",event:{title:e,groupId:n,time:Date.now(),meta:{},data:t||{},logType:e==="compile-error"?"error":e==="fallback"||e==="missing"?"warning":"default"}})}}function oue(e,t){const n=XV(e.nodeId,t);if(n){const[o]=e.path;o==="locale"&&Ct(e.state.value)?n.locale.value=e.state.value:o==="fallbackLocale"&&(Ct(e.state.value)||Mn(e.state.value)||dn(e.state.value))?n.fallbackLocale.value=e.state.value:o==="inheritLocale"&&on(e.state.value)&&(n.inheritLocale=e.state.value)}}function sue(e,t,n){return{beforeCreate(){const o=oo();if(!o)throw Fo(fn.UNEXPECTED_ERROR);const s=this.$options;if(s.i18n){const r=s.i18n;if(s.__i18n&&(r.__i18n=s.__i18n),r.__root=t,this===this.$root)this.$i18n=ZV(e,r);else{r.__injectWithOption=!0,r.__extender=n.__vueI18nExtend,this.$i18n=X0(r);const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}}else if(s.__i18n)if(this===this.$root)this.$i18n=ZV(e,s);else{this.$i18n=X0({__i18n:s.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}else this.$i18n=e;s.__i18nGlobal&&MV(t,s,s),this.$t=(...r)=>this.$i18n.t(...r),this.$rt=(...r)=>this.$i18n.rt(...r),this.$tc=(...r)=>this.$i18n.tc(...r),this.$te=(r,i)=>this.$i18n.te(r,i),this.$d=(...r)=>this.$i18n.d(...r),this.$n=(...r)=>this.$i18n.n(...r),this.$tm=r=>this.$i18n.tm(r),n.__setInstance(o,this.$i18n)},mounted(){if(ee.env.NODE_ENV!=="production"&&this.$el&&this.$i18n){const o=this.$i18n;this.$el.__VUE_I18N__=o.__composer;const s=this.__v_emitter=k0();o.__enableEmitter&&o.__enableEmitter(s),s.on("*",Ep)}},unmounted(){const o=oo();if(!o)throw Fo(fn.UNEXPECTED_ERROR);const s=this.$i18n;ee.env.NODE_ENV!=="production"&&this.$el&&this.$el.__VUE_I18N__&&(this.__v_emitter&&(this.__v_emitter.off("*",Ep),delete this.__v_emitter),this.$i18n&&(s.__disableEmitter&&s.__disableEmitter(),delete this.$el.__VUE_I18N__)),delete this.$t,delete this.$rt,delete this.$tc,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,s.__disposer&&(s.__disposer(),delete s.__disposer,delete s.__extender),n.__deleteInstance(o),delete this.$i18n}}}function ZV(e,t){e.locale=t.locale||e.locale,e.fallbackLocale=t.fallbackLocale||e.fallbackLocale,e.missing=t.missing||e.missing,e.silentTranslationWarn=t.silentTranslationWarn||e.silentFallbackWarn,e.silentFallbackWarn=t.silentFallbackWarn||e.silentFallbackWarn,e.formatFallbackMessages=t.formatFallbackMessages||e.formatFallbackMessages,e.postTranslation=t.postTranslation||e.postTranslation,e.warnHtmlInMessage=t.warnHtmlInMessage||e.warnHtmlInMessage,e.escapeParameterHtml=t.escapeParameterHtml||e.escapeParameterHtml,e.sync=t.sync||e.sync,e.__composer[kV](t.pluralizationRules||e.pluralizationRules);const n=Oy(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(o=>e.mergeLocaleMessage(o,n[o])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(o=>e.mergeDateTimeFormat(o,t.datetimeFormats[o])),t.numberFormats&&Object.keys(t.numberFormats).forEach(o=>e.mergeNumberFormat(o,t.numberFormats[o])),e}const rue=Ii("global-vue-i18n");function iue(e={},t){const n=__VUE_I18N_LEGACY_API__&&on(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,o=on(e.globalInjection)?e.globalInjection:!0,s=__VUE_I18N_LEGACY_API__&&n?!!e.allowComposition:!0,r=new Map,[i,a]=aue(e,n),l=Ii(ee.env.NODE_ENV!=="production"?"vue-i18n":"");ee.env.NODE_ENV!=="production"&&n&&s&&bo(Ds(jn.NOTICE_DROP_ALLOW_COMPOSITION));function u(h){return r.get(h)||null}function c(h,f){r.set(h,f)}function d(h){r.delete(h)}{const h={get mode(){return __VUE_I18N_LEGACY_API__&&n?"legacy":"composition"},get allowComposition(){return s},async install(f,...p){if(ee.env.NODE_ENV!=="production"&&(f.__VUE_I18N__=h),f.__VUE_I18N_SYMBOL__=l,f.provide(f.__VUE_I18N_SYMBOL__,h),zt(p[0])){const w=p[0];h.__composerExtend=w.__composerExtend,h.__vueI18nExtend=w.__vueI18nExtend}let g=null;!n&&o&&(g=mue(f,h.global)),__VUE_I18N_FULL_INSTALL__&&Wle(f,h,...p),__VUE_I18N_LEGACY_API__&&n&&f.mixin(sue(a,a.__composer,h));const v=f.unmount;if(f.unmount=()=>{g&&g(),h.dispose(),v()},ee.env.NODE_ENV!=="production"){if(!await Kle(f,h))throw Fo(fn.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN);const S=k0();if(n){const b=a;b.__enableEmitter&&b.__enableEmitter(S)}else{const b=a;b[Uu]&&b[Uu](S)}S.on("*",Ep)}},get global(){return a},dispose(){i.stop()},__instances:r,__getInstance:u,__setInstance:c,__deleteInstance:d};return h}}function n_(e={}){const t=oo();if(t==null)throw Fo(fn.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Fo(fn.NOT_INSTALLED);const n=lue(t),o=cue(n),s=OV(t),r=uue(e,s);if(__VUE_I18N_LEGACY_API__&&n.mode==="legacy"&&!e.__useComponent){if(!n.allowComposition)throw Fo(fn.NOT_AVAILABLE_IN_LEGACY_MODE);return pue(t,r,o,e)}if(r==="global")return MV(o,e,s),o;if(r==="parent"){let l=due(n,t,e.__useComponent);return l==null&&(ee.env.NODE_ENV!=="production"&&bo(Ds(jn.NOT_FOUND_PARENT_SCOPE)),l=o),l}const i=n;let a=i.__getInstance(t);if(a==null){const l=Ko({},e);"__i18n"in s&&(l.__i18n=s.__i18n),o&&(l.__root=o),a=Y0(l),i.__composerExtend&&(a[q0]=i.__composerExtend(a)),fue(i,t,a),i.__setInstance(t,a)}return a}function aue(e,t,n){const o=cC();{const s=__VUE_I18N_LEGACY_API__&&t?o.run(()=>X0(e)):o.run(()=>Y0(e));if(s==null)throw Fo(fn.UNEXPECTED_ERROR);return[o,s]}}function lue(e){{const t=Dn(e.isCE?rue:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Fo(e.isCE?fn.NOT_INSTALLED_WITH_PROVIDE:fn.UNEXPECTED_ERROR);return t}}function uue(e,t){return _y(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function cue(e){return e.mode==="composition"?e.global:e.global.__composer}function due(e,t,n=!1){let o=null;const s=t.root;let r=hue(t,n);for(;r!=null;){const i=e;if(e.mode==="composition")o=i.__getInstance(r);else if(__VUE_I18N_LEGACY_API__){const a=i.__getInstance(r);a!=null&&(o=a.__composer,n&&o&&!o[FV]&&(o=null))}if(o!=null||s===r)break;r=r.parent}return o}function hue(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function fue(e,t,n){let o=null;Zt(()=>{if(ee.env.NODE_ENV!=="production"&&t.vnode.el){t.vnode.el.__VUE_I18N__=n,o=k0();const s=n;s[Uu]&&s[Uu](o),o.on("*",Ep)}},t),nu(()=>{const s=n;ee.env.NODE_ENV!=="production"&&t.vnode.el&&t.vnode.el.__VUE_I18N__&&(o&&o.off("*",Ep),s[bp]&&s[bp](),delete t.vnode.el.__VUE_I18N__),e.__deleteInstance(t);const r=s[q0];r&&(r(),delete s[q0])},t)}function pue(e,t,n,o={}){const s=t==="local",r=xh(null);if(s&&e.proxy&&!(e.proxy.$options.i18n||e.proxy.$options.__i18n))throw Fo(fn.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);const i=on(o.inheritLocale)?o.inheritLocale:!Ct(o.locale),a=$(!s||i?n.locale.value:Ct(o.locale)?o.locale:Od),l=$(!s||i?n.fallbackLocale.value:Ct(o.fallbackLocale)||Mn(o.fallbackLocale)||zt(o.fallbackLocale)||o.fallbackLocale===!1?o.fallbackLocale:a.value),u=$(Oy(a.value,o)),c=$(zt(o.datetimeFormats)?o.datetimeFormats:{[a.value]:{}}),d=$(zt(o.numberFormats)?o.numberFormats:{[a.value]:{}}),h=s?n.missingWarn:on(o.missingWarn)||El(o.missingWarn)?o.missingWarn:!0,f=s?n.fallbackWarn:on(o.fallbackWarn)||El(o.fallbackWarn)?o.fallbackWarn:!0,p=s?n.fallbackRoot:on(o.fallbackRoot)?o.fallbackRoot:!0,g=!!o.fallbackFormat,v=Pn(o.missing)?o.missing:null,w=Pn(o.postTranslation)?o.postTranslation:null,S=s?n.warnHtmlMessage:on(o.warnHtmlMessage)?o.warnHtmlMessage:!0,b=!!o.escapeParameter,y=s?n.modifiers:zt(o.modifiers)?o.modifiers:{},E=o.pluralRules||s&&n.pluralRules;function _(){return[a.value,l.value,u.value,c.value,d.value]}const I=X({get:()=>r.value?r.value.locale.value:a.value,set:J=>{r.value&&(r.value.locale.value=J),a.value=J}}),T=X({get:()=>r.value?r.value.fallbackLocale.value:l.value,set:J=>{r.value&&(r.value.fallbackLocale.value=J),l.value=J}}),F=X(()=>r.value?r.value.messages.value:u.value),V=X(()=>c.value),x=X(()=>d.value);function A(){return r.value?r.value.getPostTranslationHandler():w}function k(J){r.value&&r.value.setPostTranslationHandler(J)}function M(){return r.value?r.value.getMissingHandler():v}function N(J){r.value&&r.value.setMissingHandler(J)}function B(J){return _(),J()}function z(...J){return r.value?B(()=>Reflect.apply(r.value.t,null,[...J])):B(()=>"")}function oe(...J){return r.value?Reflect.apply(r.value.rt,null,[...J]):""}function ie(...J){return r.value?B(()=>Reflect.apply(r.value.d,null,[...J])):B(()=>"")}function te(...J){return r.value?B(()=>Reflect.apply(r.value.n,null,[...J])):B(()=>"")}function se(J){return r.value?r.value.tm(J):{}}function Z(J,ce){return r.value?r.value.te(J,ce):!1}function P(J){return r.value?r.value.getLocaleMessage(J):{}}function j(J,ce){r.value&&(r.value.setLocaleMessage(J,ce),u.value[J]=ce)}function ne(J,ce){r.value&&r.value.mergeLocaleMessage(J,ce)}function ge(J){return r.value?r.value.getDateTimeFormat(J):{}}function xe(J,ce){r.value&&(r.value.setDateTimeFormat(J,ce),c.value[J]=ce)}function ue(J,ce){r.value&&r.value.mergeDateTimeFormat(J,ce)}function K(J){return r.value?r.value.getNumberFormat(J):{}}function Y(J,ce){r.value&&(r.value.setNumberFormat(J,ce),d.value[J]=ce)}function re(J,ce){r.value&&r.value.mergeNumberFormat(J,ce)}const R={get id(){return r.value?r.value.id:-1},locale:I,fallbackLocale:T,messages:F,datetimeFormats:V,numberFormats:x,get inheritLocale(){return r.value?r.value.inheritLocale:i},set inheritLocale(J){r.value&&(r.value.inheritLocale=J)},get availableLocales(){return r.value?r.value.availableLocales:Object.keys(u.value)},get modifiers(){return r.value?r.value.modifiers:y},get pluralRules(){return r.value?r.value.pluralRules:E},get isGlobal(){return r.value?r.value.isGlobal:!1},get missingWarn(){return r.value?r.value.missingWarn:h},set missingWarn(J){r.value&&(r.value.missingWarn=J)},get fallbackWarn(){return r.value?r.value.fallbackWarn:f},set fallbackWarn(J){r.value&&(r.value.missingWarn=J)},get fallbackRoot(){return r.value?r.value.fallbackRoot:p},set fallbackRoot(J){r.value&&(r.value.fallbackRoot=J)},get fallbackFormat(){return r.value?r.value.fallbackFormat:g},set fallbackFormat(J){r.value&&(r.value.fallbackFormat=J)},get warnHtmlMessage(){return r.value?r.value.warnHtmlMessage:S},set warnHtmlMessage(J){r.value&&(r.value.warnHtmlMessage=J)},get escapeParameter(){return r.value?r.value.escapeParameter:b},set escapeParameter(J){r.value&&(r.value.escapeParameter=J)},t:z,getPostTranslationHandler:A,setPostTranslationHandler:k,getMissingHandler:M,setMissingHandler:N,rt:oe,d:ie,n:te,tm:se,te:Z,getLocaleMessage:P,setLocaleMessage:j,mergeLocaleMessage:ne,getDateTimeFormat:ge,setDateTimeFormat:xe,mergeDateTimeFormat:ue,getNumberFormat:K,setNumberFormat:Y,mergeNumberFormat:re};function G(J){J.locale.value=a.value,J.fallbackLocale.value=l.value,Object.keys(u.value).forEach(ce=>{J.mergeLocaleMessage(ce,u.value[ce])}),Object.keys(c.value).forEach(ce=>{J.mergeDateTimeFormat(ce,c.value[ce])}),Object.keys(d.value).forEach(ce=>{J.mergeNumberFormat(ce,d.value[ce])}),J.escapeParameter=b,J.fallbackFormat=g,J.fallbackRoot=p,J.fallbackWarn=f,J.missingWarn=h,J.warnHtmlMessage=S}return Bh(()=>{if(e.proxy==null||e.proxy.$i18n==null)throw Fo(fn.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const J=r.value=e.proxy.$i18n.__composer;t==="global"?(a.value=J.locale.value,l.value=J.fallbackLocale.value,u.value=J.messages.value,c.value=J.datetimeFormats.value,d.value=J.numberFormats.value):s&&G(J)}),R}const gue=["locale","fallbackLocale","availableLocales"],JV=["t","rt","d","n","tm","te"];function mue(e,t){const n=Object.create(null);return gue.forEach(s=>{const r=Object.getOwnPropertyDescriptor(t,s);if(!r)throw Fo(fn.UNEXPECTED_ERROR);const i=mn(r.value)?{get(){return r.value.value},set(a){r.value.value=a}}:{get(){return r.get&&r.get()}};Object.defineProperty(n,s,i)}),e.config.globalProperties.$i18n=n,JV.forEach(s=>{const r=Object.getOwnPropertyDescriptor(t,s);if(!r||!r.value)throw Fo(fn.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${s}`,r)}),()=>{delete e.config.globalProperties.$i18n,JV.forEach(s=>{delete e.config.globalProperties[`$${s}`]})}}if(Ole(),__INTLIFY_JIT_COMPILATION__?oV(wle):oV(yle),ule(Uae),cle(QL),ee.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const e=Ra();e.__INTLIFY__=!0,Jae(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}ee.env.NODE_ENV;const QV={en:{}};function vue(e){const t=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([.$?*|{}()[\]\\/+^])/g,"\\$1")+"=([^;]*)"));return t?decodeURIComponent(t[1]):null}async function yue(e,t=10,n=300){for(let o=0;o<t;o++){const s=vue(e);if(s)return s;await new Promise(r=>setTimeout(r,n))}return null}async function wue(){const e=await yue("account.tessr_i18n_file_version_url");if(!e)return{};const t=await fetch(e);if(!t.ok)throw new Error("Failed to load en-error.json");return await t.json()}async function Cue(){const e=await wue();return{...QV,en:{...QV.en,errorMessages:e}}}async function bue(){return iue({legacy:!1,locale:"en",fallbackLocale:"en",messages:await Cue(),formatFallbackMessages:!0})}const Sue=async()=>{const e=await bue();return oQ(e.global),e},eB=32,Eue=Math.round(eB*16/9),_ue="arbo-thumbnails",_p="thumbnails";let Rp=null;const o_=new Map,s_=new Map;function tB(){return Rp||(Rp=new Promise((e,t)=>{const n=indexedDB.open(_ue,1);n.onupgradeneeded=()=>n.result.createObjectStore(_p),n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)}),Rp.catch(()=>Rp=null)),Rp}async function Rue(e,t){try{const n=await tB();return await new Promise((o,s)=>{const r=n.transaction(_p,"readonly").objectStore(_p).get(e);r.onsuccess=()=>{const i=r.result;o((i==null?void 0:i.url)===t&&i.blob instanceof Blob?i.blob:null)},r.onerror=()=>s(r.error)})}catch{return null}}async function Tue(e,t,n){try{const o=await tB();if(s_.get(e)!==t)return;await new Promise((s,r)=>{const i=o.transaction(_p,"readwrite");i.objectStore(_p).put({url:t,blob:n},e),i.oncomplete=()=>s(),i.onerror=()=>r(i.error)})}catch{}}function Due(e){return new Promise(t=>{new xP(e,{width:Eue,height:eB,resize:"cover",quality:.8,success:t,error:()=>t(e)})})}function Iue(e,t){s_.set(e,t);let n=o_.get(e);n||(n=new Map,o_.set(e,n));const o=n.get(t);if(o)return o;const s=(async()=>{const r=await Rue(e,t);if(r)return r;const i=await fetch(t);if(!i.ok)throw new Error(`Thumbnail request failed: ${i.status}`);const a=await Due(await i.blob());return await Tue(e,t,a),a})().finally(()=>{n.delete(t),n.size===0&&(o_.delete(e),s_.delete(e))});return n.set(t,s),s}const xue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+gAAAPoAgMAAAAwzTx3AAAACVBMVEXz9fjX19fo6etc+oS8AAAINUlEQVR42uzBgQAAAACAoP2pF6kCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGD24EAAAAAAAMj/tRFUVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVXYOWPjuGEgii45w4DKWQIDu4orAcEtB3Z0iWdUBpuAY4W2qnRACTgLiwVS/MUbJ7YV6AnEx1+Sp8FgMBgMBoPBYNDGy3sB+kD+3zfqnu9c4E4XM8v8oc554RKOLiYu0Pu6By7xoIuFCxzUNSsXOeliV344PRO4SP1L7tQxM9e9uMxJ/bJwEZ9STknCfglc5PGUBoBBN3OZW0w5yCt+bbDamBkw4/eGa5k1PPVKYG6osYibPWrpNRZxsyctvcaqYdgnK7fVWMCTfeeWGguZc1tzjYWr8aGpxiJG/MxNNVaHuqSxxiKebhOXeYoDxNNtba2xeC1eHdbTnkA82HdNKF0YiAf7Xt/BC6j6xhc/fv3++ufrsH5kXxO67jRbvZWEcpiFntVDPaOV0/tbz3UuVEvJpHS2uWf1ehVdtQ3ds3qofu+7FuOh4xJfP502rbds0OpqUd+R1ecY8ObUpzjMmFNf+OIOqu7qAe9A1X1DjbWnHlPOnHqqsaDqjkrMdlc9NRp76pvdmIvTC6i6oyIreKVpKLJsT53sji+pzmGqO2oo8ZjqnhpGN3vqcWC3p56qLKS6o8RfPk65ykKq+/8fqBzyLVlw9evyfhWrLLj65XJIVfaAVHdf/s4PqcpCqnttWEk5B62+8wdilYVWD3GFpSqLqO6yl6WcVGUR1X32stRdqrLI6jtHxCoLrL5x5BRy7gao7qJj5CZVWUB1H69sNec8rvrECS9VWRvqUsQzoLp7Wl21yuKp+/xF4EOssrDqOz8hjuz21GOVxVN3wodcTinn8NS9pC5WWVT1wE/cxJyzpx6rLJy6E9WlKgunLq+6VGXtqcecs6eeqiyaurjX5Rep0NSlVT9JrLKg6lu+6tmzCQvqp/wiFZq6q6pT/GcwdWVyy6osvvpR+swXpvqiqMeRHUxduTeXVVkwdeVmdD6yQ6pnjyDEKgupTpx4UCnnsNSVZ255lcVSVx4y5zmHqb5kZ5tQZTHVpyzgpYiHUo/RlVLO2qrTli1tPraCqi9pqxtLeJozv/wWFZa6E35PjbE297mjf1I54DHHl7jsb0Rka3L7XN1X5YNPHkzdUWJ+v9bc1l2ahJJy5tRn8DuyESXlQO/D/yPnjG0ch4EoahlQ4AJcgvpQCRNohLlMyfXBJpRfcslWuYGBAaRPcybl548WhpMHmp+PErmNzORvXxp5k79za+Qkf9N6zVDv179nYj9Vcc1QZ2m+Z2E/QXXNUOfmEi1Hh14d9aHOyMYtR3sy+pKxzsPHLceHbpHGDov+VPq7L981lrfmJGq5YRe3RYdVmrcqrcha+CXa7YuEBT/opvWlqoM+qphVlfYBlcUtx/pYUmKNHfJh9KflhnwF8dFY1gsgFrcc6+tGSWgs9wWQZsuRnqqwhMaSXgC5ov/8q7Uc6QkqueGUisZyXwDxj6zWcpynJe02yntNYzkvgMAol0rLcZ6MlvsoHxWN5b4A4p9YpeA5b0HYfbOyocZ6Vlb01+1XvQC6UKELbFYKaKxno0I3WMtW/wJkZ0U/r7+DSTGFFF1j9JUJXWAt27zwMcKEbt+PjpwKMU705T6h3wrZOdGddEWl8TChC25WxGcAZiVCN9ysWKPnDkb0CSe0YowRfVbPo9FzROjiKDihF8UQoVtlFT9aPUeIrp6myh586NV/EK8Y40GHRTxQ2Y0H3WrqVho9x4fuC1mksoUO/dRsz9GgC0hrtGWnQTcY30BlNzb0WT3Bll3Z0D8gKZUtLOgCwxtt2Q8WdKtOamtUvHChP1XzPceFDj/shsruLOgCBR+qbCFBt/oidjRUdqVCP9UTq6xQoasnobJGgi4wtuGWfSdBNyj4WGULEfqikLXVc0ToPrQ5lRUOdPE/8yprHOgGNR6r7M6DDiMbvH1SHnSosmjLvlKgC9LFKntQoBtoS6bnaNAVEqjsxoIO4xpu2ZUCXcBaMiq7MqAbFFmq50jQYVhjlTUS9FOrsVbPMaALoqHKYhjQDQo+pbKFAh1qLKOyBwU6kGUOUgkButQLPlLZjQDdoMVSB6l2BnQo+JzKFgJ0mMk5lT36Rxco+JzKSv/oBkOaU9mNAP1USEZldwJ0haRWN/3fPfofhaScRv92j+4JTBZDje77l+HQd//mcOhe8OOh47KO2R895sy23Ew36o4eKvxwo+5UJx06DGbmzRN+qce8ky038aGDo8VbVow9esyS1Vg+9DlAT9WhPHrMK1nwwazoMVNOY6dgVvSYZ1JjA+3pMlmNpfNY769QY+lkLgt18hmNL9iRxvIt6z6LA40lXNt+2bNjHARCIAqgExMLucfeyVh5qe0tzZ5SVxMaI2zomLxX0xDg8wl1Vp0am/BuezuSckvGgG8nWB2TMeAjlgPRnTLlmkXtmjrlmhfXPXON3a39x3rOox5x7v855Xusf52665l1v9dFHauxt5jZpVdjc+b7x9qpsUlDblfGa+wjJldGa+wzple2X3Va219TpzsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8GIPDgQAAAAAgPxfG0FVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVdqDQwIAAAAAQf9f+8IEAAAAAAAAwCmRg3Unf/8l+AAAAABJRU5ErkJggg==",Aue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+gAAAPoAgMAAAAwzTx3AAAACVBMVEXz9fjX19fk5OUH9i6SAAAGd0lEQVR42uzBgQAAAACAoP2pF6kCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGD24EAAAAAAAMj/tRFUVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVXYuXvcCGEgDMODJQrScwSK3GKP4GI/ZKWiSZRjcAn326TZU0YRsOwPkcCuPN88Nxi9wRjwxhhjjDHGGLOPuyYZpXhvSHSRwjkkK737D5L1UrQGGQYpWYsMZymYwy4ar/YaWbyUK2IvbQudw27a/uIb7Kdsje+QKUipIsB6sSObFKpCtpOUqcFBeta5DgfpWedaHKVmGx9xlJolHodpWeIdEujYylZIoeLu1iCFirtbjRQqHtmJR++QQsWepsWk/0rwWfSeps3alUQFow+SpCl5OxezNiVOweiSqOTRMy/WtuBNfObdqbPRS0Q/updENe/o5VcPVt2qW3WK6sQrvN3XrbpVt+pWXWt14vu67easulXnqO5l9Y6Pkah6uJ8c6CmrO/wZGKtPGXvG6pgMNNX989GaQFM9rKPM+KpHzE5s1R0Wnq16g8WZpbpfI856lurh9YT4SFY94uZEVh2rgat6hZUnqb4x+pmkeng9IX7mql5j1XNV73CHq/rD6CTV/cZv3kaO6mFrdKvOUT3izomq+uPoHNU9b/Vg1a06e3W7r2uvbrs5xie3QP/kVmPVk1SfR29439IQv5ursApc1R3ve3jiry/S8n5z63Bj39dpqldYBLbqgsXAUt3L8zo3slQPTxXR852bc5h4vtOSt/9Tw1d9foIJjCejp+wj43l4cRH4pvwVhIi7XmTDdVRf/d+8H/qrb3IABpXV/Z7lLKis/sveHdtGDgNRGJYEbKACVIKSq4IlzAF8xIRKrg8mVwL7PSwM35jiCiC5kR73y+hs/Nvy2AZErXnDWBizOp7iiNVnPB0jVl/xJIzVpWpz8YzVteo9imHE6vgSx6u+4Isbr/qKL0JYXepeJ+4Jq2vlO7XHq45vcbTqC7650aqv+CZ81aXy0gTlq66VdyGF0aon/DdY9QXGjVV9hjnoqkvt1TBKV11rb3zzY1VPgBmq+oKf3EjVZ/x0sFWX6guwlK26Vl+A5UeqnpAZqTpycZzqM3IHWXWpv9xRyKpr/TV/nrr6r1iusYa5+gMh2glnkbh6dp5xdnBVl9MjPRRPOSNc1fUcMtrpzPNW3wDgsNNZ4K2efy5QiqzVFzx5OxUcVXU5b2/BTgWhqq5Fx2inM2Wtvmdf1RtKgbV6yhYXvMJaPfuqXvCKY6peLq7ennIFYaqu5eJqkxWUs/qeLS4bXgmc1bfsF7SElzirJ8A+tOA1R1Rdyv8yqT3zCgdRdS3/MhGsaUEZq9uwsKYFz1h9z76hEy4wVk/ZNzSuOJ7q8v9odJpx5eCpbpefGD89cEX5qufv39pxxfNVzzrHhEt81TfAOFyLNNXFHvDmN64dNNXtzWOVhK36jFqerfqKWoGt+o5qkaW6vT24lmOprnaoJFzVF9TzXNVX1Atc1R9oEEmqiyWs5Uiqq62xtYSqOlooU/UZLQJT9RVNSKqLjVHNcVRXW2OrCVH1hCbKU31Bm8BTfUYjjupiU9RzFNXVpqh30FRPaKQ01dHKs1Rf0Iyiutga2yAyVNfnEM0OkuobmglJ9YRmnqP6gg4M1WWa0SESVNdpRYeDovqODkJRfUMHT1EdPQJBdVnQJd6/uq7o4giqP9BFCKrv6OIJqid0CQTV0env7Uf/jU5/bj96v8/od/QZ/TN6pzDdUfqM/hm9j5/uaPuMPuDoO/A+ne7oAbxPpjsaePQVeN8x3dEMvM9Nd7QA74vTLaEHw28vfescxR7bt9NQbDR9Ow3FRtP3043iZ9s/9uvYCkAQCKKgj9D+TKzO2Cp9lsAasc60AHzuot+t429LEt8S+CDxLYEPOtdSufnO1VQuGGVLxtjgsbcMNMnKXrGsz974tvs+McZ39X2q8V19/xq6c1vb+OlLf+1H6NqWN+7I8mcOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADzswYEAAAAAAJD/ayOoqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkp7cEgAAAAAIOj/a1+YAAAAAAAAALgEoKO2OvzgJtMAAAAASUVORK5CYII=",Pue=["src"],kue=["src"],Fue=["src"],Oue=_t(nt({__name:"ThumbnailRender",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean}},setup(e){const t=e,n=X(()=>t.value),o=X(()=>t.id),s=X(()=>t.disabled),r=X(()=>t.readOnly),i=$("");let a=null;const l=$(!1),u=X(()=>n.value==null||n.value===""),c=X(()=>!u.value&&l.value),d=()=>{l.value=!0},h=()=>{a&&URL.revokeObjectURL(a),a=null},f=()=>{i.value="",h()},p=fd(),{openSceneHub:g}=p,v=X(()=>{const b=un.getInstance().getItem("ws.code"),y=un.getInstance().getItem("BASE_URL"),E=b||t.workspaceId;return es({type:"scene_hub",config:{baseDomain:y,ws_code:E,scene_id:String(t.id)}}).url}),w=b=>{try{if(b.ctrlKey||b.metaKey){window.open(v.value,"_blank");return}g(String(t.id))}catch{window.open(v.value,"_blank")}finally{S()}},S=()=>{var E,_,I,T,F,V;(E=t.params)==null||E.api.clearFocusedCell();const b=((I=(_=t.params)==null?void 0:_.column)==null?void 0:I.getColId())||"",y=((F=(T=t.params)==null?void 0:T.node)==null?void 0:F.rowIndex)||0;(V=t.params)==null||V.api.setFocusedCell(y,b)};return Je(()=>[o.value,n.value],async([b,y],E,_)=>{let I=!0;if(_(()=>{I=!1,h()}),l.value=!1,i.value="",!(b==null||b===""||!y))try{const T=await Iue(String(b),y);if(!I||b!==o.value||y!==n.value)return;a=URL.createObjectURL(T),i.value=a}catch(T){I&&b===o.value&&y===n.value&&(console.warn("Failed to load cached thumbnail; using the original URL.",T),i.value=y)}},{immediate:!0}),Vn(f),(b,y)=>(q(),de("div",{class:le(["thumbnail-wrapper",{disabled:s.value,"read-only":r.value}]),onClick:w},[u.value?(q(),de("img",{key:0,src:L(Aue),alt:"No thumbnail"},null,8,Pue)):c.value?(q(),de("img",{key:1,src:L(xue),alt:"Broken thumbnail"},null,8,kue)):i.value?(q(),de("img",{key:2,src:i.value,alt:"Thumbnail",onError:d},null,40,Fue)):Ye("",!0)],2))}}),[["__scopeId","data-v-1fd3dd73"]]),Mue={class:"left-section"},Nue={class:"create-count"},Lue={class:"modified-template-options"},Vue=["onClick"],Bue={class:"setting-count"},$ue={class:"field-label"},Hue={class:"field-label"},Gue={class:"status-selection"},Uue={class:"preview-section"},Wue={key:0,class:"preview-list"},zue={key:0,class:"preview-more"},jue={key:1,style:{color:"var(--tessr-text-secondary, #6b6b6b)","align-items":"center",width:"100%","text-align":"center",display:"flex",flex:"1 1 0%"}},nB=1e3,oB=8,sB=7,Kue=_t(nt({__name:"BulkCreateCount",props:{item:{},takeName:{},options:{default:()=>[{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"}}]},getStatusFunc:{},workspaceId:{},entityId:{}},emits:["cancel","changed"],setup(e,{expose:t,emit:n}){const o=Kt,s=xo,r=$(null),i=$(null),a=["number","letter","name"],l={number_up:"1→9",number_down:"9→1",letter_up:"A→Z",letter_down:"Z→A",name:"Name"},u=$(null),c=$({}),d=(Y,re)=>{c.value[Y]=re instanceof HTMLElement?re:null},h=$(null),f=$("1"),p=e,g=$([]),v=X(()=>{const Y=w.value;let re=1;const R="9999.",G={createCount:`${R}0`,input:`${R}1`,firstField:`${R}5`,stepField:`${R}6`,number_up:`${R}1`,number_down:`${R}2`,letter_up:`${R}3`,letter_down:`${R}4`,statusSelect:`${R}7`};return["number_up","number_down","letter_up","letter_down"].forEach((ce,Ee)=>{re++,G[ce]=`${R}${re}`}),Y?(re++,G.statusSelect=`${R}${re}`,re++,G.firstField=`${R}${re}`,re++,G.stepField=`${R}${re}`):(delete G.firstField,delete G.stepField),G}),w=X(()=>g.value.find(Y=>typeof Y!="string"&&(Y.id==="number"||Y.id==="letter"))),S=$("number"),b=$("up"),y=Oo({...Ei.number}),E=Oo({...Ei.number}),_=()=>{Object.assign(y,Ei[S.value]),Object.assign(E,Ei[S.value])};Je(w,Y=>{if(!Y)return;const re=Y.id;re!==S.value&&(S.value=re,_()),b.value=Y.direction==="down"?"down":"up"},{immediate:!0,flush:"sync"});const I=X(()=>YO[b.value]),T=X(()=>{const Y=Number(f.value);return Number.isFinite(Y)?Math.min(nB,Math.max(0,Math.floor(Y))):0}),F=(Y,re)=>{const R=JO(S.value,Y,re);y[Y]=R,Mv(Y,R)&&(E[Y]=R)},V=$(null),x=$(null),A=$(null),k=(Y,re)=>{var G,J,ce,Ee;if(re.key==="Enter"||re.key==="Escape")return;if(re.key==="Tab"){re.preventDefault(),re.stopPropagation(),re.stopImmediatePropagation();const Ce=re.shiftKey;Y=="first"&&(Ce?(G=c.value.letter_down)==null||G.focus():(J=V.value)==null||J.focus()),Y=="step"&&(Ce?(ce=V.value)==null||ce.focus():(Ee=i.value)==null||Ee.focus());return}re.key.length===1&&!re.ctrlKey&&!re.metaKey&&!re.altKey&&!ZO(S.value,Y,re.key)&&re.preventDefault()},M=(Y,re)=>{var Ee;re.preventDefault();const R=re.target,G=((Ee=re.clipboardData)==null?void 0:Ee.getData("text/plain"))??"",J=R.selectionStart??R.value.length,ce=R.selectionEnd??R.value.length;R.value=R.value.slice(0,J)+G+R.value.slice(ce),F(Y,R.value),R.value=y[Y]},N=Y=>{if(Mv(Y,y[Y]))return;const re=Ei[S.value][Y];y[Y]=re,E[Y]=re},B=X(()=>w.value?CE({type:S.value,direction:b.value,first:E.first,step:E.step,count:T.value}):[]),z=X(()=>g.value.every(Y=>typeof Y=="string"&&!Y)),oe=X(()=>T.value===0||z.value?[]:Array.from({length:T.value}).map((Y,re)=>g.value.map(R=>typeof R=="string"?R:B.value[re]??"").join(""))),ie=X(()=>oe.value.length>oB?oe.value.length-sB:0),te=X(()=>oe.value.length>oB?oe.value.slice(0,sB):oe.value),se=Y=>{P.value=[Y];const re=Y.id.split("_")[0],R=Y.id.split("_")[1],G=l[Y.id],J=r.value;if(!J)return;const ce=Ce=>g.value.find(Ne=>typeof Ne!="string"&&Ce.includes(Ne.id));if(re==="name"){ce(["name"])?J.deleteTag("name"):J.insertTag({id:re,text:G,direction:void 0});return}const Ee=ce(["number","letter"]);if(Ee){const Ce=Ee.id===re,Ne=Ee.direction===R;if(Ce&&Ne){J.deleteTag(Ee.id);return}J.deleteTag(Ee.id),J.insertTag({id:re,text:G,direction:R})}else J.insertTag({id:re,text:G,direction:R})},Z=Y=>j(Y.id)?Y.description.active:!!w.value&&Y.description.switch?Y.description.switch:Y.description.inactive,P=$(null),j=Y=>{const[re,R]=Y.split("_");return g.value.some(G=>typeof G!="string"&&G.id===re&&G.direction===R)},ne=n,ge=X(()=>{const[Y]=g.value;return g.value.length===1&&typeof Y!="string"&&Y.id==="name"});X(()=>g.value.length===0||ge.value);const xe=()=>{const Y=g.value.map(re=>typeof re=="string"?{type:"text",value:re}:re.id==="name"?{type:"current_name"}:{type:"counter",value:y.first,direction:re.direction=="up"?"asc":"desc",format:re.id==="number"?"number":"letter",step:y.step});ne("changed",{data:Y,count:T.value,template_flow_status_id:u.value||void 0})};Je([g,f,y,u],()=>{xe()},{deep:!0,immediate:!0}),Je(g,()=>{console.log("inputContent changed",g.value)}),t({reset:()=>{P.value=null,g.value=[]},focus:()=>{var Y;(Y=i.value)==null||Y.focus()}}),Zt(()=>{var Y,re;(Y=r.value)==null||Y.insertText(p.takeName),(re=r.value)==null||re.insertTag({id:"number",text:"1→9",direction:"up"}),ht(()=>{var R;(R=i.value)==null||R.focus()})});const K=Y=>{var re,R;Y.preventDefault(),Y.stopPropagation(),(re=i.value)==null||re.blur(),(R=h.value)==null||R.focus()};return(Y,re)=>(q(),de("div",{class:"bulk-rename-core",ref_key:"popupRef",ref:h,tabindex:"-1"},[Se("div",Mue,[Se("div",Nue,[re[11]||(re[11]=Se("span",null,"How many to create?",-1)),ze(ye(L(hl),{modelValue:f.value,"onUpdate:modelValue":re[0]||(re[0]=R=>f.value=R),type:"number","max-value":nB,"max-decimal-char":0,"show-clear":!1,ref_key:"counterRef",ref:i,placeholder:"Enter count"},null,8,["modelValue"]),[[L(s),v.value.createCount]])]),ze(ye(VN,{modelValue:g.value,"onUpdate:modelValue":re[1]||(re[1]=R=>g.value=R),"allowed-tags":a,ref_key:"templateInputRef",ref:r,placeholder:"Enter name",onEscape:K},null,8,["modelValue"]),[[L(s),v.value.input]]),Se("div",Lue,[(q(!0),de(Pt,null,xn(e.options,R=>ze((q(),de("button",{onClick:G=>se(R),ref_for:!0,ref:G=>d(R.id,G),key:R.id,class:le([{active:j(R.id)},"template-option"])},[tt(it(R.name)+" ",1),R.icon?(q(),Ke(L(pt),{key:0,src:R.icon,style:{transform:"rotate(90deg)"}},null,8,["src"])):Ye("",!0)],10,Vue)),[[L(o),{content:Z(R),bypassOverflowCheck:!0,delay:[300,0],interactive:!1,hideOnClick:!1,appendTo:"parent"}],[L(s),`${v.value[R.id]}`]])),128))]),Se("div",Bue,[Se("span",$ue,it(I.value.first),1),ze((q(),Ke(L(hl),{ref_key:"firstFieldRef",ref:x,"model-value":y.first,disabled:!w.value,"max-length":L(yE),onInput:re[2]||(re[2]=R=>F("first",R)),onKeydown:re[3]||(re[3]=R=>k("first",R)),onPaste:re[4]||(re[4]=R=>M("first",R)),onBlur:re[5]||(re[5]=R=>N("first")),"show-clear":!1},{clear:we(()=>[...re[12]||(re[12]=[Se("div",null,null,-1)])]),_:1},8,["model-value","disabled","max-length"])),[[L(s),v.value.firstField]]),Se("span",Hue,it(I.value.step),1),ze(ye(L(hl),{"model-value":y.step,disabled:!w.value,"max-length":L(wE),onInput:re[6]||(re[6]=R=>F("step",R)),onKeydown:re[7]||(re[7]=R=>k("step",R)),onPaste:re[8]||(re[8]=R=>M("step",R)),onBlur:re[9]||(re[9]=R=>N("step")),"show-clear":!1,ref_key:"fieldStepRef",ref:V},null,8,["model-value","disabled","max-length"]),[[L(s),v.value.stepField]])]),Se("div",Gue,[re[13]||(re[13]=Se("span",null,"Status",-1)),ye(L(wL),{modelValue:u.value,"onUpdate:modelValue":re[10]||(re[10]=R=>u.value=R),"get-status-func":p.getStatusFunc,"workspace-id":p.workspaceId,id:p.entityId,style:{width:"100%"},"max-width":"372px",ref_key:"selectStatusRef",ref:A,"focus-index":v.value.statusSelect,placeholder:"Select status"},null,8,["modelValue","get-status-func","workspace-id","id","focus-index"])])]),Se("div",Uue,[re[14]||(re[14]=Se("span",{class:"preview-title"},"Preview",-1)),te.value.length>0?(q(),de("ul",Wue,[(q(!0),de(Pt,null,xn(te.value,(R,G)=>(q(),de("li",{key:G},[ye($N,{text:R},null,8,["text"])]))),128)),ie.value>0?(q(),de("li",zue," … "+it(ie.value)+" more ",1)):Ye("",!0)])):(q(),de("div",jue," Add a name or a counter to see a preview. "))])],512))}}),[["__scopeId","data-v-59e2a87f"]]),rB={text:yl,id:void 0,assignees:Mse,status:KN,dateRange:Nse,isStarted:yl,isCompleted:yl,lastUpdated:yl,completedOn:yl,isDeleted:yl,isArchived:yl,isProcessing:yl,name:GN,options:CQ,metric:zN,__checkboxSelection:void 0,description:Bie,thumbnail:Oue},que={text:!1,id:!1,assignees:!0,status:!0,dateRange:!0,isStarted:!1,isCompleted:!1,lastUpdated:!1,completedOn:!1,isDeleted:!1,isArchived:!1,isProcessing:!1,name:!1,options:!0,metric:!1,__checkboxSelection:!1,description:!1,thumbnail:!1},Yue={text:null,id:void 0,assignees:oM,status:NN,dateRange:Lse,isStarted:void 0,isCompleted:void 0,lastUpdated:void 0,completedOn:void 0,isDeleted:void 0,isArchived:void 0,isProcessing:void 0,name:GN,options:UN,metric:void 0,__checkboxSelection:void 0,description:void 0,thumbnail:void 0},Xue={id:[100,100],assignees:[200,200],status:[200,200],dateRange:[255,255],isStarted:[150,150],isCompleted:[150,150],lastUpdated:[180,180],completedOn:[180,180],isDeleted:[void 0,void 0],isArchived:[void 0,void 0],isProcessing:[void 0,void 0],name:[350,500],options:[50,50],metric:[200,300],__checkboxSelection:[50,50],text:[200,300],description:[200,300],thumbnail:[82,82]},Zue={dateRange:{cellEditorPopupPosition:"under",cellEditorPopup:!1},name:{cellEditorPopupPosition:"over",cellEditor:!1,cellEditorPopup:!1},metric:{suppressKeyboardEvent:void 0,suppressNavigable:!1,suppressMovable:!1,cellClass:"ag-cell-optimized",editable:!0}},Jue=e=>{var t,n,o;if(e){if(Number((t=e.metric_type)==null?void 0:t.id)==1)return["none","not","range"].includes(e.restricted_type)?"number":"dropdown";if(Number((n=e.metric_type)==null?void 0:n.id)==2)return e.format_type=="icon"?"rating":"dropdown";if(Number((o=e.metric_type)==null?void 0:o.id)==3)return}},Ld=e=>{if(e)return Jue(e)};function iB(e,t){var s,r,i,a;const n=(s=t==null?void 0:t.data)==null?void 0:s.permissions;let o={disabled:!1,readOnly:!1,type:void 0};if(!t||!e)o={disabled:!1,readOnly:!0,type:void 0};else if(e==="options")o={disabled:!1,readOnly:!1,type:void 0};else if(e!=null&&e.includes("metric")){const l=`metric_permission_${e==null?void 0:e.replace("metric_","")}`;o={disabled:!1,readOnly:!((t==null?void 0:t.data)&&t.data[l]&&((r=t.data[l])==null?void 0:r.permission)==2&&!((i=t.colDef)!=null&&i.context.formula)&&!t.data.isLocked&&!t.data.isDeleted),type:Ld((a=t.colDef)==null?void 0:a.context)}}else{const u={assignees:(n==null?void 0:n.has_update_assignee_permission)??0,completedOn:0,name:(n==null?void 0:n.has_edit_permission)??0,permissions:0,status:(n==null?void 0:n.has_edit_template_flow_status_permission)??0,dateRange:(n==null?void 0:n.has_edit_date_permission)??0,isStarted:0,isDeleted:0,isArchived:0,isLocked:0,isProcessing:0,lastUpdated:0,id:0,isCompleted:0,options:1,disabled:0,description:(n==null?void 0:n.has_edit_permission)??0,thumbnail:1}[e]??0;o={disabled:u===-1,readOnly:u!==1,type:void 0}}return o}class r_{constructor(){Rn(this,"eGui");Rn(this,"params")}init(t){this.params=t}getGui(){var n,o,s,r,i;const t=document.createElement("div");return(n=this.params)!=null&&n.height&&t.style.setProperty("--height",(o=this.params)==null?void 0:o.height),(s=this.params)!=null&&s.width?t.style.setProperty("--width",(r=this.params)==null?void 0:r.width):(i=this.params)!=null&&i.fullwidth?t.style.setProperty("--width","100%"):t.style.setProperty("--width",`${Math.floor(Math.random()*50)+50}%`),t.className="ag-cell-skeleton",t.addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),a.stopImmediatePropagation()}),this.eGui=t,t}refresh(t){return!1}getValue(){var t;return(t=this.params)==null?void 0:t.value}isPopup(t){return!1}getPopupPosition(){}destroy(){}}const aB=new Map;class Tp{static initialize(t){this.wrappers=t}static getWrappers(){if(!this.wrappers)throw new Error("CellRendererFactory: Not initialized. Please call CellRendererFactory.initialize() first.");return this.wrappers}static buildCommonCellParams(t,n){var u,c,d;const o=t.data||((u=t.node)==null?void 0:u.data),s=(c=t.colDef)==null?void 0:c.field,r=s&&o?o[s]:void 0,i=iB((d=t.colDef)==null?void 0:d.field,t),a=typeof n=="function"?n(t):n??{};return{...t,value:r,disabled:i==null?void 0:i.disabled,readOnly:i==null?void 0:i.readOnly,type:Ld(t.context),...a}}static resolveRendererComponent(t,n){let o;return t.includes("metric")&&rB.metric?Ld(n)==="rating"?o=Fie:o=zN:o=rB[t]??void 0,o}static resolveEditorComponent(t,n){const o=t.includes("metric");let s;const r=Ld(n);return o&&["number","dropdown"].includes(r)?s=zre:s=Yue[t],s}static canEditField(t,n){var r;if(n.data===void 0)return!1;const o=iB((r=n.colDef)==null?void 0:r.field,n),s=que[t]??!0;return!(o!=null&&o.disabled)&&!(o!=null&&o.readOnly)&&s&&(o==null?void 0:o.type)!=="rating"}static resolveSize(t){const[n=250,o=300]=Xue[t]??[];return{minWidth:n,maxWidth:o}}static buildHeaderComponentParams(t){return n=>typeof t=="function"?t(n):t??{}}static fromType(t){const{wrapVueCellEditor:n}=this.getWrappers(),o=String(t.field??""),s=this.resolveSize(o),r=Zue[o]??{},i=Ld(t.context),a=i==="number"||i==="rating",l=i=="rating"?t.context.range*24+20:s.minWidth;return{...t,headerName:t.headerName,...s,...t,cellEditorSelector:c=>{const d=this.resolveEditorComponent(o,t.context);return{component:n(d),params:this.buildCommonCellParams(c,t.cellRendererParams),popup:!a}},singleClickEdit:!0,cellEditorPopup:!a,cellEditorPopupPosition:a?void 0:"under",editable:c=>{let d;return c.data===void 0||c.data.isDeleted||c.node.data===void 0?d=!1:d=this.canEditField(o,c),d},minWidth:l,cellRendererSelector:c=>Que(c,{component:n(this.resolveRendererComponent(o,t.context)),params:this.buildCommonCellParams(c,t.cellRendererParams)}),headerComponentParams:this.buildHeaderComponentParams(t.headerComponentParams),...r,cellClass:c=>`${i}--${c.colDef.field}`}}}Rn(Tp,"wrappers",null);const Que=(e,t)=>{var s;const n=(s=e.colDef)==null?void 0:s.field,o=`${n}-${e.node.rowIndex}`;return aB.set(o,(aB.get(o)??0)+1),n!=null&&n.includes("metric")?e.value===void 0?{component:r_,params:{fullwidth:!1}}:t:e.data&&(n!=null&&n.includes("thumbnail"))||e.data&&e.value!==void 0?t:!n||n==="options"||n==="__checkboxSelection"?e.data?t:{component:r_,params:{fullwidth:!0,width:"24px",height:"24px"}}:!e.data||e.value===void 0?{component:r_,params:{fullwidth:!1}}:t},ece=_t(nt({__name:"Vue3Wrapper",props:{component:{},params:{},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},tooltip:{},isNoData:{type:Boolean,default:!1},workspaceId:{},entityId:{},axiosService:{},isSearching:{type:Boolean,default:!1},isFiltering:{type:Boolean,default:!1},sortType:{default:"default"},maxRating:{default:5},config:{}},setup(e,{expose:t}){const n=e,o=$(null),s=X(()=>{var a;return((a=n.component)==null?void 0:a.name)||"UnknownComponent"}),r=X(()=>{var a;return((a=n.component)==null?void 0:a.default)||n.component}),i=X(()=>({params:n.params,disabled:n.disabled,readOnly:n.readOnly,value:n.value,maxRating:n.maxRating,data:n.data,id:n.id,workspaceId:n.workspaceId,entityId:n.entityId,axiosService:n.axiosService,tooltip:n.tooltip,isSearching:n.isSearching,isFiltering:n.isFiltering,isNoData:n.isNoData,config:n.config}));return t({focus:()=>{var a;return(a=o.value)!=null&&a.focus?o.value.focus():console.warn(`Component ${s.value} does not have a focus method.`),!0},blur:()=>{var a,l;return(l=(a=o.value)==null?void 0:a.blur)==null||l.call(a),!0},trigger:(a,l)=>{var u;return(u=o.value)==null||u.$emit(a,l),!0}}),(a,l)=>(q(),Ke(OC(r.value),jt(i.value,{ref_key:"componentRef",ref:o}),null,16))}}),[["__cssModules",{$style:{skeleton:"_skeleton_7xde7_1",shimmer:"_shimmer_7xde7_16","skeleton-loading":"_skeleton-loading_7xde7_1"}}]]);function tce(e){return"stopEditing"in e}const nce=8,oce=e=>{if(!e)return;const t=e.__vueParentComponent,n=t==null?void 0:t.exposed;n&&typeof n.triggerFocus=="function"?n.triggerFocus():e.focus()};function lB(e){return class{constructor(){Rn(this,"container");Rn(this,"vNode",null);Rn(this,"componentInstance",null);Rn(this,"componsenExposed",null);Rn(this,"params");Rn(this,"isEditor",!1);Rn(this,"_destroyed",!1)}init(n){var l,u,c,d;if(!n){console.error("[Vue3CellWrapper] Missing params");return}const o=performance.now();this.params=n,this.isEditor=tce(n),this.container=document.createElement("div"),this.container.classList.add("ag-vue3-cell-wrapper"),this.container.style.width="100%",this.container.style.height="100%";const s=n.context.apiClass,r=n,i={component:e,params:Object.freeze(n),disabled:!1,readOnly:r.readOnly??!1,value:n.value,maxRating:r.maxRating??void 0,data:n.data,id:(l=n==null?void 0:n.data)==null?void 0:l.id,workspaceId:n.context.workspaceId,entityId:n.context.entityId,axiosService:s,tooltip:r.tooltip??void 0,isSearching:r.isSearching??!1,isFiltering:r.isFiltering??!1,isNoData:r.isNoData??!1,config:r.config,sceneId:(r==null?void 0:r.sceneId)||void 0};this.vNode=ye(ece,i),rb(this.vNode,this.container);const a=performance.now()-o;a>nce&&console.warn(`[Vue3CellWrapper] Slow render (${a.toFixed(1)}ms) for "${(u=n.colDef)==null?void 0:u.field}"`),this.componentInstance=(c=this.vNode.component)==null?void 0:c.proxy,this.componsenExposed=(d=this.vNode.component)==null?void 0:d.exposed}getGui(){return this.container}refresh(n){return!1}focusUi(){var n;(n=this.componsenExposed)!=null&&n.focus?this.componsenExposed.focus():oce(this.container)}getValue(){var n,o,s;return this.params._editorValue!==void 0?this.params._editorValue:this.componentInstance?((s=(o=this.componentInstance).getValue)==null?void 0:s.call(o))??this.componentInstance.value:(console.warn("[Vue3CellWrapper] getValue() called but component instance not available"),(n=this.params)==null?void 0:n.value)}isPopup(n){var i,a,l,u,c;const o=(l=(a=(i=this.params)==null?void 0:i.colDef)==null?void 0:a.field)==null?void 0:l.includes("metric"),s=((u=this.params)==null?void 0:u.context)&&Ld(this.params.context);return o||(s==="number"||s==="rating")||!this.isEditor?!1:(c=this.componentInstance)!=null&&c.isPopup?this.componentInstance.isPopup():!0}getPopupPosition(){var o,s,r;return this.isEditor?(o=this.componentInstance)!=null&&o.getPopupPosition?this.componentInstance.getPopupPosition():((r=(s=this.params)==null?void 0:s.colDef)==null?void 0:r.cellEditorPopupPosition)??"under":void 0}afterGuiAttached(){!this.isEditor||this.componentInstance}destroy(){if(!this._destroyed&&(this._destroyed=!0,!!this.container))try{const n=this.componentInstance;if(n){try{typeof n.$destroy=="function"&&n.$destroy()}catch(s){console.warn("[Vue3CellWrapper] Error during $destroy:",s)}try{typeof n.destroy=="function"&&n.destroy()}catch(s){console.warn("[Vue3CellWrapper] Error during destroy():",s)}}(typeof queueMicrotask=="function"?queueMicrotask:s=>Promise.resolve().then(s))(()=>{try{rb(null,this.container)}catch(s){console.warn("[Vue3CellWrapper] Error during unmount:",s)}finally{this.container.textContent=""}})}catch(n){console.error("[Vue3CellWrapper] Error during cleanup:",n)}finally{this.vNode=null,this.componentInstance=null}}}}function My(e){return lB(e)}function uB(e){return lB(e)}var Wu=class{constructor(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,n){const o=t?this.allAsyncListeners:this.allSyncListeners;let s=o.get(e);return!s&&n&&(s=new Set,o.set(e,s)),s}noRegisteredListenersExist(){return this.allSyncListeners.size===0&&this.allAsyncListeners.size===0&&this.globalSyncListeners.size===0&&this.globalAsyncListeners.size===0}addEventListener(e,t,n=!1){this.getListeners(e,n,!0).add(t)}removeEventListener(e,t,n=!1){const o=this.getListeners(e,n,!1);o&&(o.delete(t),o.size===0&&(n?this.allAsyncListeners:this.allSyncListeners).delete(e))}addGlobalListener(e,t=!1){this.getGlobalListeners(t).add(e)}removeGlobalListener(e,t=!1){this.getGlobalListeners(t).delete(e)}dispatchEvent(e){this.dispatchToListeners(e,!0),this.dispatchToListeners(e,!1),this.firedEvents[e.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){const n=e.type;if(t&&"event"in e){const a=e.event;a instanceof Event&&(e.eventPath=a.composedPath())}const{frameworkOverrides:o}=this,s=a=>{const l=o?()=>o.wrapIncoming(a):a;t?this.dispatchAsync(l):l()},r=this.getListeners(n,t,!1);if(((r==null?void 0:r.size)??0)>0){const a=new Set(r);for(const l of a)r!=null&&r.has(l)&&s(()=>l(e))}const i=this.getGlobalListeners(t);if(i.size>0){const a=new Set(i);for(const l of a)s(()=>l(n,e))}}getGlobalListeners(e){return e?this.globalAsyncListeners:this.globalSyncListeners}dispatchAsync(e){if(this.asyncFunctionsQueue.push(e),!this.scheduled){const t=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)};this.frameworkOverrides?this.frameworkOverrides.wrapIncoming(t):t(),this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[];for(const t of e)t()}};function Ia(e){return e==null||e===""?null:e}function ft(e){return e!=null&&e!==""}function Gn(e){return!ft(e)}function i_(e){return e!=null&&typeof e.toString=="function"?e.toString():null}function Dp(e,t){const n=e?JSON.stringify(e):null,o=t?JSON.stringify(t):null;return n===o}function sce(e,t,n=!1){const o=e==null,s=t==null;if(e!=null&&e.toNumber&&(e=e.toNumber()),t!=null&&t.toNumber&&(t=t.toNumber()),o&&s)return 0;if(o)return-1;if(s)return 1;function r(i,a){return i>a?1:i<a?-1:0}if(typeof e!="string"||!n)return r(e,t);try{return e.localeCompare(t)}catch{return r(e,t)}}var rce=/[&<>"']/g,ice={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Vd(e){return(e==null?void 0:e.toString().toString())??null}function Ip(e){var t;return((t=Vd(e))==null?void 0:t.replace(rce,n=>ice[n]))??null}function Ai(e){return e.eRootDiv.getRootNode()}function Kn(e){return Ai(e).activeElement}function Ho(e){const{gos:t,eRootDiv:n}=e;let o=null;const s=t.get("getDocument");return s&&ft(s)?o=s():n&&(o=n.ownerDocument),o&&ft(o)?o:document}function cB(e){const t=Kn(e);return t===null||t===Ho(e).body}function dB(e){return Ho(e).defaultView||window}function a_(e){let t=null,n=null;try{t=Ho(e).fullscreenElement}catch{}finally{t||(t=Ai(e));const o=t.querySelector("body");o?n=o:t instanceof ShadowRoot?n=t:t instanceof Document?n=t==null?void 0:t.documentElement:n=t}return n}function ace(e){const t=a_(e);return(t==null?void 0:t.clientWidth)??(window.innerWidth||-1)}function lce(e){const t=a_(e);return(t==null?void 0:t.clientHeight)??(window.innerHeight||-1)}function Qr(e,t,n){n==null||typeof n=="string"&&n==""?hB(e,t):Ir(e,t,n)}function Ir(e,t,n){e.setAttribute(fB(t),n.toString())}function hB(e,t){e.removeAttribute(fB(t))}function fB(e){return`aria-${e}`}function Dl(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function uce(e){let t;return e==="asc"?t="ascending":e==="desc"?t="descending":e==="mixed"?t="other":t="none",t}function cce(e){return e.getAttribute("aria-label")}function Bd(e,t){Qr(e,"label",t)}function xp(e,t){Qr(e,"labelledby",t)}function pB(e,t){Qr(e,"live",t)}function dce(e,t){Qr(e,"atomic",t)}function hce(e,t){Qr(e,"relevant",t)}function fce(e,t){Qr(e,"invalid",t)}function pce(e,t){Qr(e,"disabled",t)}function gB(e,t){Qr(e,"hidden",t)}function l_(e,t){Ir(e,"expanded",t)}function gce(e,t){Ir(e,"setsize",t)}function mce(e,t){Ir(e,"posinset",t)}function vce(e,t){Ir(e,"multiselectable",t)}function yce(e,t){Ir(e,"rowcount",t)}function Ny(e,t){Ir(e,"rowindex",t)}function wce(e,t){Ir(e,"rowspan",t)}function Cce(e,t){Ir(e,"colcount",t)}function mB(e,t){Ir(e,"colindex",t)}function bce(e,t){Ir(e,"colspan",t)}function Sce(e,t){Ir(e,"sort",t)}function Ece(e){hB(e,"sort")}function vB(e,t){Qr(e,"selected",t)}function _ce(e,t){Qr(e,"controls",t)}function Rce(e,t){_ce(e,t.id),xp(t,e.id)}function yB(e,t){Qr(e,"owns",t)}function Ly(e,t){return t===void 0?e("ariaIndeterminate","indeterminate"):t===!0?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}var Tce="[tabindex], input, select, button, textarea, [href]",wB="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function Ap(e){return!e||!e.matches("input, select, button, textarea")||!e.matches(wB)?!1:Pi(e)}function Un(e,t,n={}){const{skipAriaHidden:o}=n;e.classList.toggle("ag-hidden",!t),o||gB(e,!t)}function Dce(e,t,n={}){const{skipAriaHidden:o}=n;e.classList.toggle("ag-invisible",!t),o||gB(e,!t)}function Pp(e,t){const n="disabled",o=t?r=>r.setAttribute(n,""):r=>r.removeAttribute(n);o(e);const s=e.querySelectorAll("input")??[];for(const r of s)o(r)}function zu(e,t,n){let o=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,typeof n=="number"){if(++o>n)break}else if(e===n)break}return!1}function ju(e){const{height:t,width:n,borderTopWidth:o,borderRightWidth:s,borderBottomWidth:r,borderLeftWidth:i,paddingTop:a,paddingRight:l,paddingBottom:u,paddingLeft:c,marginTop:d,marginRight:h,marginBottom:f,marginLeft:p,boxSizing:g}=window.getComputedStyle(e),v=Number.parseFloat;return{height:v(t||"0"),width:v(n||"0"),borderTopWidth:v(o||"0"),borderRightWidth:v(s||"0"),borderBottomWidth:v(r||"0"),borderLeftWidth:v(i||"0"),paddingTop:v(a||"0"),paddingRight:v(l||"0"),paddingBottom:v(u||"0"),paddingLeft:v(c||"0"),marginTop:v(d||"0"),marginRight:v(h||"0"),marginBottom:v(f||"0"),marginLeft:v(p||"0"),boxSizing:g}}function u_(e){const t=ju(e);return t.boxSizing==="border-box"?t.height-t.paddingTop-t.paddingBottom-t.borderTopWidth-t.borderBottomWidth:t.height}function kp(e){const t=ju(e);return t.boxSizing==="border-box"?t.width-t.paddingLeft-t.paddingRight-t.borderLeftWidth-t.borderRightWidth:t.width}function CB(e){const{height:t,marginBottom:n,marginTop:o}=ju(e);return Math.floor(t+n+o)}function Vy(e){const{width:t,marginLeft:n,marginRight:o}=ju(e);return Math.floor(t+n+o)}function bB(e){const t=e.getBoundingClientRect(),{borderTopWidth:n,borderLeftWidth:o,borderRightWidth:s,borderBottomWidth:r}=ju(e);return{top:t.top+(n||0),left:t.left+(o||0),right:t.right+(s||0),bottom:t.bottom+(r||0)}}function By(e,t){let n=e.scrollLeft;return t&&(n=Math.abs(n)),n}function $y(e,t,n){n&&(t*=-1),e.scrollLeft=t}function qo(e){for(;e!=null&&e.firstChild;)e.firstChild.remove()}function ei(e){e!=null&&e.parentNode&&e.remove()}function SB(e){return!!e.offsetParent}function Pi(e){return e.checkVisibility?e.checkVisibility({checkVisibilityCSS:!0}):!(!SB(e)||window.getComputedStyle(e).visibility!=="visible")}function c_(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function EB(e,t,n){n&&n.nextSibling===t||(e.firstChild?n?n.nextSibling?e.insertBefore(t,n.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.insertAdjacentElement("afterbegin",t):e.appendChild(t))}function _B(e,t){for(let n=0;n<t.length;n++){const o=t[n],s=e.children[n];s!==o&&e.insertBefore(o,s)}}function Ice(e){return e.replace(/[A-Z]/g,t=>`-${t.toLocaleLowerCase()}`)}function Fp(e,t){if(t)for(const n of Object.keys(t)){const o=t[n];if(!(n!=null&&n.length)||o==null)continue;const s=Ice(n),r=o.toString(),i=r.replace(/\s*!important/g,""),a=i.length!=r.length?"important":void 0;e.style.setProperty(s,i,a)}}function Hy(e){return()=>{const t=e();return t?d_(t)||RB(t):!0}}function d_(e){return e.clientWidth<e.scrollWidth}function RB(e){return e.clientHeight<e.scrollHeight}function Gy(e,t){t==="flex"?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):ki(e,t)}function ki(e,t){t=h_(t),e.style.width=t,e.style.maxWidth=t,e.style.minWidth=t}function Op(e,t){t=h_(t),e.style.height=t,e.style.maxHeight=t,e.style.minHeight=t}function h_(e){return typeof e=="number"?`${e}px`:e}function f_(e){return e instanceof Node||e instanceof HTMLElement}function Zs(e,t,n){n==null||n===""?e.removeAttribute(t):e.setAttribute(t,n.toString())}function Il(e,t,n){const s=dB(e).ResizeObserver,r=s?new s(n):null;return r==null||r.observe(t),()=>r==null?void 0:r.disconnect()}function xa(e,t){const n=dB(e);n.requestAnimationFrame?n.requestAnimationFrame(t):n.webkitRequestAnimationFrame?n.webkitRequestAnimationFrame(t):n.setTimeout(t,0)}var TB="data-ref",p_;function DB(){return p_??(p_=document.createTextNode(" ")),p_.cloneNode()}function Mp(e){const{attrs:t,children:n,cls:o,ref:s,role:r,tag:i}=e,a=document.createElement(i);if(o&&(a.className=o),s&&a.setAttribute(TB,s),r&&a.setAttribute("role",r),t)for(const l of Object.keys(t))a.setAttribute(l,t[l]);if(n)if(typeof n=="string")a.textContent=n;else{let l=!0;for(const u of n)u&&(typeof u=="string"?(a.appendChild(document.createTextNode(u)),l=!1):typeof u=="function"?a.appendChild(u()):(l&&(a.appendChild(DB()),l=!1),a.append(Mp(u)),a.appendChild(DB())))}return a}var xce=["touchstart","touchend","touchmove","touchcancel","scroll"],Ace=["wheel"],g_={},IB=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return n=>{if(typeof g_[n]=="boolean")return g_[n];const o=document.createElement(e[n]||"div");return n="on"+n,g_[n]=n in o}})();function Pce(e,t){return!t||!e?!1:Fce(t).indexOf(e)>=0}function kce(e){const t=[];let n=e.target;for(;n;)t.push(n),n=n.parentElement;return t}function Fce(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():kce(t)}function Oce(e,t,n){const o=Mce(t);let s;o!=null&&(s={passive:o}),e.addEventListener(t,n,s)}var Mce=e=>{const t=xce.includes(e),n=Ace.includes(e);if(t)return!0;if(n)return!1};function xB(e,t,n){if(n===0)return!1;const o=Math.abs(e.clientX-t.clientX),s=Math.abs(e.clientY-t.clientY);return Math.max(o,s)<=n}var Np=(e,t)=>{const n=e.identifier;for(let o=0,s=t.length;o<s;++o){const r=t[o];if(r.identifier===n)return r}return null};function Lp(e,t){return e.gos.isElementInThisInstance(t.target)}function Nce(e,t,n){const s=e.getBoundingClientRect().height,r=ace(n)-2,i=lce(n)-2;if(!e.offsetParent)return;const l=bB(e.offsetParent),{clientY:u,clientX:c}=t;let d=u-l.top-s/2,h=c-l.left-10;const f=Ho(n),p=f.defaultView||window,g=p.pageYOffset||f.documentElement.scrollTop,v=p.pageXOffset||f.documentElement.scrollLeft;r>0&&h+e.clientWidth>r+v&&(h=r+v-e.clientWidth),h<0&&(h=0),i>0&&d+e.clientHeight>i+g&&(d=i+g-e.clientHeight),d<0&&(d=0),e.style.left=`${h}px`,e.style.top=`${d}px`}var Uy=(e,...t)=>{for(const n of t){const[o,s,r,i]=n;o.addEventListener(s,r,i),e.push(n)}},m_=e=>{if(e){for(const[t,n,o,s]of e)t.removeEventListener(n,o,s);e.length=0}},xl=e=>{e.cancelable&&e.preventDefault()};function Lce(e,t){return t}function AB(e){return(e==null?void 0:e.getLocaleTextFunc())??Lce}function Vce(e,t,n,o){const s=t[n];return e.getLocaleTextFunc()(n,typeof s=="function"?s(o):s,o)}function Bce(e){return(t,n,o)=>e({key:t,defaultValue:n,variableValues:o})}function $ce(e){return(t,n,o)=>{let s=e==null?void 0:e[t];if(s&&(o!=null&&o.length)){let r=0;for(;!(r>=o.length||s.indexOf("${variable}")===-1);)s=s.replace("${variable}",o[r++])}return s??n}}var Fi=class{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.propertyListenerId=0,this.lastChangeSetIdLookup={},this.isAlive=()=>!this.destroyed}preWireBeans(e){this.beans=e,this.stubContext=e.context,this.eventSvc=e.eventSvc,this.gos=e.gos}destroy(){const{destroyFunctions:e}=this;for(let t=0;t<e.length;t++)e[t]();e.length=0,this.destroyed=!0,this.dispatchLocalEvent({type:"destroyed"})}addEventListener(e,t,n){this.localEventService||(this.localEventService=new Wu),this.localEventService.addEventListener(e,t,n)}removeEventListener(e,t,n){var o;(o=this.localEventService)==null||o.removeEventListener(e,t,n)}dispatchLocalEvent(e){var t;(t=this.localEventService)==null||t.dispatchEvent(e)}addManagedElementListeners(e,t){return this._setupListeners(e,t)}addManagedEventListeners(e){return this._setupListeners(this.eventSvc,e)}addManagedListeners(e,t){return this._setupListeners(e,t)}_setupListeners(e,t){const n=[];for(const o of Object.keys(t)){const s=t[o];s&&n.push(this._setupListener(e,o,s))}return n}_setupListener(e,t,n){if(this.destroyed)return()=>null;let o;if(Hce(e))e.__addEventListener(t,n),o=()=>(e.__removeEventListener(t,n),null);else{const s=Gce(e);e instanceof HTMLElement?Oce(e,t,n):s?e.addListener(t,n):e.addEventListener(t,n),o=s?()=>(e.removeListener(t,n),null):()=>(e.removeEventListener(t,n),null)}return this.destroyFunctions.push(o),()=>(o(),this.destroyFunctions=this.destroyFunctions.filter(s=>s!==o),null)}setupPropertyListener(e,t){const{gos:n}=this;n.addPropertyEventListener(e,t);const o=()=>(n.removePropertyEventListener(e,t),null);return this.destroyFunctions.push(o),()=>(o(),this.destroyFunctions=this.destroyFunctions.filter(s=>s!==o),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupPropertyListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const n=e.join("-")+this.propertyListenerId++,o=s=>{if(s.changeSet){if(s.changeSet&&s.changeSet.id===this.lastChangeSetIdLookup[n])return;this.lastChangeSetIdLookup[n]=s.changeSet.id}const r={type:"propertyChanged",changeSet:s.changeSet,source:s.source};t(r)};for(const s of e)this.setupPropertyListener(s,o)}getLocaleTextFunc(){return AB(this.beans.localeSvc)}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createOptionalManagedBean(e,t){return e?this.createManagedBean(e,t):void 0}createManagedBean(e,t){const n=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),n}createBean(e,t,n){return(t||this.stubContext).createBean(e,n)}destroyBean(e,t){return(t||this.stubContext).destroyBean(e)}destroyBeans(e,t){return(t||this.stubContext).destroyBeans(e)}};function Hce(e){return e.__addEventListener!==void 0}function Gce(e){return e.eventServiceType==="global"}var qe=class extends Fi{},PB={};function v_(e,t){PB[t]||(e(),PB[t]=!0)}var Uce={pending:!1,funcs:[]},Wce={pending:!1,funcs:[]};function y_(e,t="setTimeout",n){const o=t==="raf"?Wce:Uce;if(o.funcs.push(e),o.pending)return;o.pending=!0;const s=()=>{const r=o.funcs.slice();o.funcs.length=0,o.pending=!1;for(const i of r)i()};t==="raf"?xa(n,s):window.setTimeout(s,0)}function Yo(e,t,n){let o;return function(...s){const r=this;window.clearTimeout(o),o=window.setTimeout(function(){e.isAlive()&&t.apply(r,s)},n)}}function kB(e,t){let n=0;return function(...o){const s=this,r=Date.now();r-n<t||(n=r,e.apply(s,o))}}function zce(e,t,n,o=100){const s=Date.now();let r=null,i=!1;const a=()=>{r!=null&&(window.clearInterval(r),r=null)};e.addDestroyFunc(a);const l=()=>{const u=Date.now()-s>o;(t()||u)&&(n(),i=!0,a())};l(),i||(r=window.setInterval(l,10))}var FB=new Set(["__proto__","constructor","prototype"]);function jce(e,t){if(e!=null){if(Array.isArray(e)){for(let n=0;n<e.length;n++)t(n.toString(),e[n]);return}for(const n of Object.keys(e).filter(o=>!FB.has(o)))t(n,e[n])}}function gs(e,t,n=!0,o=!1){ft(t)&&jce(t,(s,r)=>{let i=e[s];i!==r&&(o&&i==null&&r!=null&&typeof r=="object"&&r.constructor===Object&&(i={},e[s]=i),OB(r)&&OB(i)&&!Array.isArray(i)?gs(i,r,n,o):(n||r!==void 0)&&(e[s]=r))})}function OB(e){return typeof e=="object"&&e!==null}var w_=class Ga{static applyGlobalGridOptions(t){if(!Ga.gridOptions)return{...t};let n={};return gs(n,Ga.gridOptions,!0,!0),Ga.mergeStrategy==="deep"?gs(n,t,!0,!0):n={...n,...t},Ga.gridOptions.context&&(n.context=Ga.gridOptions.context),t.context&&(Ga.mergeStrategy==="deep"&&n.context&&gs(t.context,n.context,!0,!0),n.context=t.context),n}static applyGlobalGridOption(t,n){if(Ga.mergeStrategy==="deep"){const o=Kce(t);if(o&&typeof o=="object"&&typeof n=="object")return Ga.applyGlobalGridOptions({[t]:n})[t]}return n}};w_.gridOptions=void 0,w_.mergeStrategy="shallow";var C_=w_;function Kce(e){var t;return(t=C_.gridOptions)==null?void 0:t[e]}var qce={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:" ",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,enableStrictPivotColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressMoveWhenColumnDragging:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,cellFlashDuration:500,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,rowDragInsertDelay:500,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1,columnMenu:"new",reactiveCustomComponents:!0,suppressSetFilterByDefault:!1,rowNumbers:!1,enableFilterHandlers:!1},MB="https://www.ag-grid.com";function Al(e,t,...n){e.get("debug")&&console.log("AG Grid: "+t,...n)}function Vp(e,...t){v_(()=>console.warn("AG Grid: "+e,...t),e+(t==null?void 0:t.join("")))}function $d(e,...t){v_(()=>console.error("AG Grid: "+e,...t),e+(t==null?void 0:t.join("")))}var NB=new Set,Wy={},Hd={},zy,LB=!1,VB=!1,Yce=!1;function Xce(e){const[t,n]=e.version.split(".")||[],[o,s]=zy.split(".")||[];return t===o&&n===s}function Zce(e){var o;zy||(zy=e.version);const t=s=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${s} Please update all modules to the same version.`;e.version?Xce(e)||$d(t(`'${e.moduleName}' is version ${e.version} but the other modules are version ${zy}.`)):$d(t(`'${e.moduleName}' is incompatible.`));const n=(o=e.validate)==null?void 0:o.call(e);n&&!n.isValid&&$d(`${n.message}`)}function Bp(e,t,n=!1){n||(LB=!0),Zce(e);const o=e.rowModels??["all"];NB.add(e);let s;t!==void 0?(VB=!0,Hd[t]===void 0&&(Hd[t]={}),s=Hd[t]):s=Wy;for(const r of o)s[r]===void 0&&(s[r]={}),s[r][e.moduleName]=e;if(e.dependsOn)for(const r of e.dependsOn)Bp(r,t,n)}function Jce(e){delete Hd[e]}function b_(e,t,n){const o=s=>{var r,i,a;return!!((r=Wy[s])!=null&&r[e])||!!((a=(i=Hd[t])==null?void 0:i[s])!=null&&a[e])};return o(n)||o("all")}function S_(){return VB}function Qce(e,t){const n=Hd[e]??{};return[...Object.values(Wy.all??{}),...Object.values(n.all??{}),...Object.values(Wy[t]??{}),...Object.values(n[t]??{})]}function ede(){return new Set(NB)}function tde(){return LB}function BB(){return Yce}var nde=class{static register(e){Bp(e,void 0)}static registerModules(e){for(const t of e)Bp(t,void 0)}},ct="34.3.1",$B=2e3,HB=100,GB="_version_",jy=null,Gd=`${MB}/javascript-data-grid`;function ode(e){jy=e}function sde(e){Gd=e}function UB(e,t,n){return(jy==null?void 0:jy(e,t))??[lde(e,t,n)]}function E_(e,t,n,o,s){e(`${o?"warning":"error"} #${t}`,...UB(t,n,s))}function rde(e){if(!e)return String(e);const t={};for(const n of Object.keys(e))typeof e[n]!="object"&&typeof e[n]!="function"&&(t[n]=e[n]);return JSON.stringify(t)}function ide(e){let t=e;return e instanceof Error?t=e.toString():typeof e=="object"&&(t=rde(e)),t}function Ky(e){return e===void 0?"undefined":e===null?"null":e}function __(e,t){return`${e}?${t.toString()}`}function ade(e,t,n){const o=Array.from(t.entries()).sort((r,i)=>i[1].length-r[1].length);let s=__(e,t);for(const[r,i]of o){if(r===GB)continue;const a=s.length-n;if(a<=0)break;const l="...",u=a+l.length,c=i.length-u>HB?i.slice(0,i.length-u)+l:i.slice(0,HB)+l;t.set(r,c),s=__(e,t)}return s}function WB(e,t){const n=new URLSearchParams;if(n.append(GB,ct),t)for(const r of Object.keys(t))n.append(r,ide(t[r]));const o=`${Gd}/errors/${e}`,s=__(o,n);return s.length<=$B?s:ade(o,n,$B)}var lde=(e,t,n)=>{const o=WB(e,t),s=`${n?n+`
193
+ */const Fle="9.14.5";function Ole(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Ra().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Ra().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(Ra().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Ra().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Ra().__INTLIFY_PROD_DEVTOOLS__=!1)}const AV=ps.__EXTEND_POINT__,Da=Ry(AV),jn={FALLBACK_TO_ROOT:AV,NOT_SUPPORTED_PRESERVE:Da(),NOT_SUPPORTED_FORMATTER:Da(),NOT_SUPPORTED_PRESERVE_DIRECTIVE:Da(),NOT_SUPPORTED_GET_CHOICE_INDEX:Da(),COMPONENT_NAME_LEGACY_COMPATIBLE:Da(),NOT_FOUND_PARENT_SCOPE:Da(),IGNORE_OBJ_FLATTEN:Da(),NOTICE_DROP_ALLOW_COMPOSITION:Da(),NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG:Da()},Mle={[jn.FALLBACK_TO_ROOT]:"Fall back to {type} '{key}' with root locale.",[jn.NOT_SUPPORTED_PRESERVE]:"Not supported 'preserve'.",[jn.NOT_SUPPORTED_FORMATTER]:"Not supported 'formatter'.",[jn.NOT_SUPPORTED_PRESERVE_DIRECTIVE]:"Not supported 'preserveDirectiveContent'.",[jn.NOT_SUPPORTED_GET_CHOICE_INDEX]:"Not supported 'getChoiceIndex'.",[jn.COMPONENT_NAME_LEGACY_COMPATIBLE]:"Component name legacy compatible: '{name}' -> 'i18n'",[jn.NOT_FOUND_PARENT_SCOPE]:"Not found parent scope. use the global scope.",[jn.IGNORE_OBJ_FLATTEN]:"Ignore object flatten: '{key}' key has an string value",[jn.NOTICE_DROP_ALLOW_COMPOSITION]:"'allowComposition' option will be dropped in the next major version. For more information, please see 👉 https://tinyurl.com/2p97mcze",[jn.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG]:"'translateExistCompatible' option will be dropped in the next major version."};function Ds(e,...t){return P0(Mle[e],...t)}const PV=$o.__EXTEND_POINT__,Is=Ry(PV),fn={UNEXPECTED_RETURN_TYPE:PV,INVALID_ARGUMENT:Is(),MUST_BE_CALL_SETUP_TOP:Is(),NOT_INSTALLED:Is(),NOT_AVAILABLE_IN_LEGACY_MODE:Is(),REQUIRED_VALUE:Is(),INVALID_VALUE:Is(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:Is(),NOT_INSTALLED_WITH_PROVIDE:Is(),UNEXPECTED_ERROR:Is(),NOT_COMPATIBLE_LEGACY_VUE_I18N:Is(),BRIDGE_SUPPORT_VUE_2_ONLY:Is(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:Is(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:Is(),__EXTEND_POINT__:Is()};function Fo(e,...t){return Pd(e,null,ee.env.NODE_ENV!=="production"?{messages:Nle,args:t}:void 0)}const Nle={[fn.UNEXPECTED_RETURN_TYPE]:"Unexpected return type in composer",[fn.INVALID_ARGUMENT]:"Invalid argument",[fn.MUST_BE_CALL_SETUP_TOP]:"Must be called at the top of a `setup` function",[fn.NOT_INSTALLED]:"Need to install with `app.use` function",[fn.UNEXPECTED_ERROR]:"Unexpected error",[fn.NOT_AVAILABLE_IN_LEGACY_MODE]:"Not available in legacy mode",[fn.REQUIRED_VALUE]:"Required in value: {0}",[fn.INVALID_VALUE]:"Invalid value",[fn.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]:"Cannot setup vue-devtools plugin",[fn.NOT_INSTALLED_WITH_PROVIDE]:"Need to install with `provide` function",[fn.NOT_COMPATIBLE_LEGACY_VUE_I18N]:"Not compatible legacy VueI18n.",[fn.BRIDGE_SUPPORT_VUE_2_ONLY]:"vue-i18n-bridge support Vue 2.x only",[fn.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION]:"Must define ‘i18n’ option or custom block in Composition API with using local scope in Legacy API mode",[fn.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]:"Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly"},z0=Ii("__translateVNode"),j0=Ii("__datetimeParts"),K0=Ii("__numberParts"),Uu=Ii("__enableEmitter"),bp=Ii("__disableEmitter"),kV=Ii("__setPluralRules"),FV=Ii("__injectWithOption"),q0=Ii("__dispose");function Sp(e){if(!dn(e)||Tr(e))return e;for(const t in e)if(Zr(e,t))if(!t.includes("."))dn(e[t])&&Sp(e[t]);else{const n=t.split("."),o=n.length-1;let s=e,r=!1;for(let i=0;i<o;i++){if(n[i]==="__proto__")throw new Error(`unsafe key: ${n[i]}`);if(n[i]in s||(s[n[i]]=An()),!dn(s[n[i]])){ee.env.NODE_ENV!=="production"&&bo(Ds(jn.IGNORE_OBJ_FLATTEN,{key:n[i]})),r=!0;break}s=s[n[i]]}if(r||(Tr(s)?KL.includes(n[o])||delete e[t]:(s[n[o]]=e[t],delete e[t])),!Tr(s)){const i=s[n[o]];dn(i)&&Sp(i)}}return e}function Oy(e,t){const{messages:n,__i18n:o,messageResolver:s,flatJson:r}=t,i=zt(n)?n:Mn(o)?An():{[e]:An()};if(Mn(o)&&o.forEach(a=>{if("locale"in a&&"resource"in a){const{locale:l,resource:u}=a;l?(i[l]=i[l]||An(),Dy(u,i[l])):Dy(u,i)}else Ct(a)&&Dy(JSON.parse(a),i)}),s==null&&r)for(const a in i)Zr(i,a)&&Sp(i[a]);return i}function OV(e){return e.type}function MV(e,t,n){let o=dn(t.messages)?t.messages:An();"__i18nGlobal"in n&&(o=Oy(e.locale.value,{messages:o,__i18n:n.__i18nGlobal}));const s=Object.keys(o);s.length&&s.forEach(r=>{e.mergeLocaleMessage(r,o[r])});{if(dn(t.datetimeFormats)){const r=Object.keys(t.datetimeFormats);r.length&&r.forEach(i=>{e.mergeDateTimeFormat(i,t.datetimeFormats[i])})}if(dn(t.numberFormats)){const r=Object.keys(t.numberFormats);r.length&&r.forEach(i=>{e.mergeNumberFormat(i,t.numberFormats[i])})}}}function NV(e){return ye(Ka,null,e,0)}const LV="__INTLIFY_META__",VV=()=>[],Lle=()=>!1;let BV=0;function $V(e){return(t,n,o,s)=>e(n,o,oo()||void 0,s)}const Vle=()=>{const e=oo();let t=null;return e&&(t=OV(e)[LV])?{[LV]:t}:null};function Y0(e={},t){const{__root:n,__injectWithOption:o}=e,s=n===void 0,r=e.flatJson,i=Xr?$:xh,a=!!e.translateExistCompatible;ee.env.NODE_ENV!=="production"&&a&&RL(Ds(jn.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG));let l=on(e.inheritLocale)?e.inheritLocale:!0;const u=i(n&&l?n.locale.value:Ct(e.locale)?e.locale:Od),c=i(n&&l?n.fallbackLocale.value:Ct(e.fallbackLocale)||Mn(e.fallbackLocale)||zt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:u.value),d=i(Oy(u.value,e)),h=i(zt(e.datetimeFormats)?e.datetimeFormats:{[u.value]:{}}),f=i(zt(e.numberFormats)?e.numberFormats:{[u.value]:{}});let p=n?n.missingWarn:on(e.missingWarn)||El(e.missingWarn)?e.missingWarn:!0,g=n?n.fallbackWarn:on(e.fallbackWarn)||El(e.fallbackWarn)?e.fallbackWarn:!0,v=n?n.fallbackRoot:on(e.fallbackRoot)?e.fallbackRoot:!0,w=!!e.fallbackFormat,S=Pn(e.missing)?e.missing:null,b=Pn(e.missing)?$V(e.missing):null,y=Pn(e.postTranslation)?e.postTranslation:null,E=n?n.warnHtmlMessage:on(e.warnHtmlMessage)?e.warnHtmlMessage:!0,_=!!e.escapeParameter;const I=n?n.modifiers:zt(e.modifiers)?e.modifiers:{};let T=e.pluralRules||n&&n.pluralRules,F;F=(()=>{s&&lV(null);const ve={version:Fle,locale:u.value,fallbackLocale:c.value,messages:d.value,modifiers:I,pluralRules:T,missing:b===null?void 0:b,missingWarn:p,fallbackWarn:g,fallbackFormat:w,unresolving:!0,postTranslation:y===null?void 0:y,warnHtmlMessage:E,escapeParameter:_,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};ve.datetimeFormats=h.value,ve.numberFormats=f.value,ve.__datetimeFormatters=zt(F)?F.__datetimeFormatters:void 0,ve.__numberFormatters=zt(F)?F.__numberFormatters:void 0,ee.env.NODE_ENV!=="production"&&(ve.__v_emitter=zt(F)?F.__v_emitter:void 0);const Be=ple(ve);return s&&lV(Be),Be})(),Cp(F,u.value,c.value);function x(){return[u.value,c.value,d.value,h.value,f.value]}const A=X({get:()=>u.value,set:ve=>{u.value=ve,F.locale=u.value}}),k=X({get:()=>c.value,set:ve=>{c.value=ve,F.fallbackLocale=c.value,Cp(F,u.value,ve)}}),M=X(()=>d.value),N=X(()=>h.value),B=X(()=>f.value);function z(){return Pn(y)?y:null}function oe(ve){y=ve,F.postTranslation=ve}function ie(){return S}function te(ve){ve!==null&&(b=$V(ve)),S=ve,F.missing=b}function se(ve,Be){return ve!=="translate"||!Be.resolvedMessage}const Z=(ve,Be,wt,Tt,tn,en)=>{x();let bn;try{ee.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,s||(F.fallbackContext=n?fle():void 0),bn=ve(F)}finally{ee.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,s||(F.fallbackContext=void 0)}if(wt!=="translate exists"&&ro(bn)&&bn===Py||wt==="translate exists"&&!bn){const[Le,Ge]=Be();if(ee.env.NODE_ENV!=="production"&&n&&Ct(Le)&&se(wt,Ge)&&(v&&(Fy(g,Le)||cV(p,Le))&&bo(Ds(jn.FALLBACK_TO_ROOT,{key:Le,type:wt})),ee.env.NODE_ENV!=="production")){const{__v_emitter:Rt}=F;Rt&&v&&Rt.emit("fallback",{type:wt,key:Le,to:"global",groupId:`${wt}:${Le}`})}return n&&v?Tt(n):tn(Le)}else{if(en(bn))return bn;throw Fo(fn.UNEXPECTED_RETURN_TYPE)}};function P(...ve){return Z(Be=>Reflect.apply(yV,null,[Be,...ve]),()=>H0(...ve),"translate",Be=>Reflect.apply(Be.t,Be,[...ve]),Be=>Be,Be=>Ct(Be))}function j(...ve){const[Be,wt,Tt]=ve;if(Tt&&!dn(Tt))throw Fo(fn.INVALID_ARGUMENT);return P(Be,wt,Ko({resolvedMessage:!0},Tt||{}))}function ne(...ve){return Z(Be=>Reflect.apply(EV,null,[Be,...ve]),()=>G0(...ve),"datetime format",Be=>Reflect.apply(Be.d,Be,[...ve]),()=>ky,Be=>Ct(Be))}function ge(...ve){return Z(Be=>Reflect.apply(TV,null,[Be,...ve]),()=>U0(...ve),"number format",Be=>Reflect.apply(Be.n,Be,[...ve]),()=>ky,Be=>Ct(Be))}function xe(ve){return ve.map(Be=>Ct(Be)||ro(Be)||on(Be)?NV(String(Be)):Be)}const K={normalize:xe,interpolate:ve=>ve,type:"vnode"};function Y(...ve){return Z(Be=>{let wt;const Tt=Be;try{Tt.processor=K,wt=Reflect.apply(yV,null,[Tt,...ve])}finally{Tt.processor=null}return wt},()=>H0(...ve),"translate",Be=>Be[z0](...ve),Be=>[NV(Be)],Be=>Mn(Be))}function re(...ve){return Z(Be=>Reflect.apply(TV,null,[Be,...ve]),()=>U0(...ve),"number format",Be=>Be[K0](...ve),VV,Be=>Ct(Be)||Mn(Be))}function R(...ve){return Z(Be=>Reflect.apply(EV,null,[Be,...ve]),()=>G0(...ve),"datetime format",Be=>Be[j0](...ve),VV,Be=>Ct(Be)||Mn(Be))}function G(ve){T=ve,F.pluralRules=T}function J(ve,Be){return Z(()=>{if(!ve)return!1;const wt=Ct(Be)?Be:u.value,Tt=Ce(wt),tn=F.messageResolver(Tt,ve);return a?tn!=null:Tr(tn)||Dr(tn)||Ct(tn)},()=>[ve],"translate exists",wt=>Reflect.apply(wt.te,wt,[ve,Be]),Lle,wt=>on(wt))}function ce(ve){let Be=null;const wt=QL(F,c.value,u.value);for(let Tt=0;Tt<wt.length;Tt++){const tn=d.value[wt[Tt]]||{},en=F.messageResolver(tn,ve);if(en!=null){Be=en;break}}return Be}function Ee(ve){const Be=ce(ve);return Be??(n?n.tm(ve)||{}:{})}function Ce(ve){return d.value[ve]||{}}function Ne(ve,Be){if(r){const wt={[ve]:Be};for(const Tt in wt)Zr(wt,Tt)&&Sp(wt[Tt]);Be=wt[ve]}d.value[ve]=Be,F.messages=d.value}function pe(ve,Be){d.value[ve]=d.value[ve]||{};const wt={[ve]:Be};if(r)for(const Tt in wt)Zr(wt,Tt)&&Sp(wt[Tt]);Be=wt[ve],Dy(Be,d.value[ve]),F.messages=d.value}function H(ve){return h.value[ve]||{}}function W(ve,Be){h.value[ve]=Be,F.datetimeFormats=h.value,RV(F,ve,Be)}function be(ve,Be){h.value[ve]=Ko(h.value[ve]||{},Be),F.datetimeFormats=h.value,RV(F,ve,Be)}function Ae(ve){return f.value[ve]||{}}function He(ve,Be){f.value[ve]=Be,F.numberFormats=f.value,IV(F,ve,Be)}function Te(ve,Be){f.value[ve]=Ko(f.value[ve]||{},Be),F.numberFormats=f.value,IV(F,ve,Be)}BV++,n&&Xr&&(Je(n.locale,ve=>{l&&(u.value=ve,F.locale=ve,Cp(F,u.value,c.value))}),Je(n.fallbackLocale,ve=>{l&&(c.value=ve,F.fallbackLocale=ve,Cp(F,u.value,c.value))}));const Xe={id:BV,locale:A,fallbackLocale:k,get inheritLocale(){return l},set inheritLocale(ve){l=ve,ve&&n&&(u.value=n.locale.value,c.value=n.fallbackLocale.value,Cp(F,u.value,c.value))},get availableLocales(){return Object.keys(d.value).sort()},messages:M,get modifiers(){return I},get pluralRules(){return T||{}},get isGlobal(){return s},get missingWarn(){return p},set missingWarn(ve){p=ve,F.missingWarn=p},get fallbackWarn(){return g},set fallbackWarn(ve){g=ve,F.fallbackWarn=g},get fallbackRoot(){return v},set fallbackRoot(ve){v=ve},get fallbackFormat(){return w},set fallbackFormat(ve){w=ve,F.fallbackFormat=w},get warnHtmlMessage(){return E},set warnHtmlMessage(ve){E=ve,F.warnHtmlMessage=ve},get escapeParameter(){return _},set escapeParameter(ve){_=ve,F.escapeParameter=ve},t:P,getLocaleMessage:Ce,setLocaleMessage:Ne,mergeLocaleMessage:pe,getPostTranslationHandler:z,setPostTranslationHandler:oe,getMissingHandler:ie,setMissingHandler:te,[kV]:G};return Xe.datetimeFormats=N,Xe.numberFormats=B,Xe.rt=j,Xe.te=J,Xe.tm=Ee,Xe.d=ne,Xe.n=ge,Xe.getDateTimeFormat=H,Xe.setDateTimeFormat=W,Xe.mergeDateTimeFormat=be,Xe.getNumberFormat=Ae,Xe.setNumberFormat=He,Xe.mergeNumberFormat=Te,Xe[FV]=o,Xe[z0]=Y,Xe[j0]=R,Xe[K0]=re,ee.env.NODE_ENV!=="production"&&(Xe[Uu]=ve=>{F.__v_emitter=ve},Xe[bp]=()=>{F.__v_emitter=void 0}),Xe}function Ble(e){const t=Ct(e.locale)?e.locale:Od,n=Ct(e.fallbackLocale)||Mn(e.fallbackLocale)||zt(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,o=Pn(e.missing)?e.missing:void 0,s=on(e.silentTranslationWarn)||El(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,r=on(e.silentFallbackWarn)||El(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,i=on(e.fallbackRoot)?e.fallbackRoot:!0,a=!!e.formatFallbackMessages,l=zt(e.modifiers)?e.modifiers:{},u=e.pluralizationRules,c=Pn(e.postTranslation)?e.postTranslation:void 0,d=Ct(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,h=!!e.escapeParameterHtml,f=on(e.sync)?e.sync:!0;ee.env.NODE_ENV!=="production"&&e.formatter&&bo(Ds(jn.NOT_SUPPORTED_FORMATTER)),ee.env.NODE_ENV!=="production"&&e.preserveDirectiveContent&&bo(Ds(jn.NOT_SUPPORTED_PRESERVE_DIRECTIVE));let p=e.messages;if(zt(e.sharedMessages)){const _=e.sharedMessages;p=Object.keys(_).reduce((T,F)=>{const V=T[F]||(T[F]={});return Ko(V,_[F]),T},p||{})}const{__i18n:g,__root:v,__injectWithOption:w}=e,S=e.datetimeFormats,b=e.numberFormats,y=e.flatJson,E=e.translateExistCompatible;return{locale:t,fallbackLocale:n,messages:p,flatJson:y,datetimeFormats:S,numberFormats:b,missing:o,missingWarn:s,fallbackWarn:r,fallbackRoot:i,fallbackFormat:a,modifiers:l,pluralRules:u,postTranslation:c,warnHtmlMessage:d,escapeParameter:h,messageResolver:e.messageResolver,inheritLocale:f,translateExistCompatible:E,__i18n:g,__root:v,__injectWithOption:w}}function X0(e={},t){{const n=Y0(Ble(e)),{__extender:o}=e,s={id:n.id,get locale(){return n.locale.value},set locale(r){n.locale.value=r},get fallbackLocale(){return n.fallbackLocale.value},set fallbackLocale(r){n.fallbackLocale.value=r},get messages(){return n.messages.value},get datetimeFormats(){return n.datetimeFormats.value},get numberFormats(){return n.numberFormats.value},get availableLocales(){return n.availableLocales},get formatter(){return ee.env.NODE_ENV!=="production"&&bo(Ds(jn.NOT_SUPPORTED_FORMATTER)),{interpolate(){return[]}}},set formatter(r){ee.env.NODE_ENV!=="production"&&bo(Ds(jn.NOT_SUPPORTED_FORMATTER))},get missing(){return n.getMissingHandler()},set missing(r){n.setMissingHandler(r)},get silentTranslationWarn(){return on(n.missingWarn)?!n.missingWarn:n.missingWarn},set silentTranslationWarn(r){n.missingWarn=on(r)?!r:r},get silentFallbackWarn(){return on(n.fallbackWarn)?!n.fallbackWarn:n.fallbackWarn},set silentFallbackWarn(r){n.fallbackWarn=on(r)?!r:r},get modifiers(){return n.modifiers},get formatFallbackMessages(){return n.fallbackFormat},set formatFallbackMessages(r){n.fallbackFormat=r},get postTranslation(){return n.getPostTranslationHandler()},set postTranslation(r){n.setPostTranslationHandler(r)},get sync(){return n.inheritLocale},set sync(r){n.inheritLocale=r},get warnHtmlInMessage(){return n.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(r){n.warnHtmlMessage=r!=="off"},get escapeParameterHtml(){return n.escapeParameter},set escapeParameterHtml(r){n.escapeParameter=r},get preserveDirectiveContent(){return ee.env.NODE_ENV!=="production"&&bo(Ds(jn.NOT_SUPPORTED_PRESERVE_DIRECTIVE)),!0},set preserveDirectiveContent(r){ee.env.NODE_ENV!=="production"&&bo(Ds(jn.NOT_SUPPORTED_PRESERVE_DIRECTIVE))},get pluralizationRules(){return n.pluralRules||{}},__composer:n,t(...r){const[i,a,l]=r,u={};let c=null,d=null;if(!Ct(i))throw Fo(fn.INVALID_ARGUMENT);const h=i;return Ct(a)?u.locale=a:Mn(a)?c=a:zt(a)&&(d=a),Mn(l)?c=l:zt(l)&&(d=l),Reflect.apply(n.t,n,[h,c||d||{},u])},rt(...r){return Reflect.apply(n.rt,n,[...r])},tc(...r){const[i,a,l]=r,u={plural:1};let c=null,d=null;if(!Ct(i))throw Fo(fn.INVALID_ARGUMENT);const h=i;return Ct(a)?u.locale=a:ro(a)?u.plural=a:Mn(a)?c=a:zt(a)&&(d=a),Ct(l)?u.locale=l:Mn(l)?c=l:zt(l)&&(d=l),Reflect.apply(n.t,n,[h,c||d||{},u])},te(r,i){return n.te(r,i)},tm(r){return n.tm(r)},getLocaleMessage(r){return n.getLocaleMessage(r)},setLocaleMessage(r,i){n.setLocaleMessage(r,i)},mergeLocaleMessage(r,i){n.mergeLocaleMessage(r,i)},d(...r){return Reflect.apply(n.d,n,[...r])},getDateTimeFormat(r){return n.getDateTimeFormat(r)},setDateTimeFormat(r,i){n.setDateTimeFormat(r,i)},mergeDateTimeFormat(r,i){n.mergeDateTimeFormat(r,i)},n(...r){return Reflect.apply(n.n,n,[...r])},getNumberFormat(r){return n.getNumberFormat(r)},setNumberFormat(r,i){n.setNumberFormat(r,i)},mergeNumberFormat(r,i){n.mergeNumberFormat(r,i)},getChoiceIndex(r,i){return ee.env.NODE_ENV!=="production"&&bo(Ds(jn.NOT_SUPPORTED_GET_CHOICE_INDEX)),-1}};return s.__extender=o,ee.env.NODE_ENV!=="production"&&(s.__enableEmitter=r=>{const i=n;i[Uu]&&i[Uu](r)},s.__disableEmitter=()=>{const r=n;r[bp]&&r[bp]()}),s}}const Z0={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function $le({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((o,s)=>[...o,...s.type===Pt?s.children:[s]],[]):t.reduce((n,o)=>{const s=e[o];return s&&(n[o]=s()),n},An())}function HV(e){return Pt}const J0=nt({name:"i18n-t",props:Ko({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>ro(e)||!isNaN(e)}},Z0),setup(e,t){const{slots:n,attrs:o}=t,s=e.i18n||n_({useScope:e.scope,__useComponent:!0});return()=>{const r=Object.keys(n).filter(d=>d!=="_"),i=An();e.locale&&(i.locale=e.locale),e.plural!==void 0&&(i.plural=Ct(e.plural)?+e.plural:e.plural);const a=$le(t,r),l=s[z0](e.keypath,a,i),u=Ko(An(),o),c=Ct(e.tag)||dn(e.tag)?e.tag:HV();return Tc(c,u,l)}}});function Hle(e){return Mn(e)&&!Ct(e[0])}function GV(e,t,n,o){const{slots:s,attrs:r}=t;return()=>{const i={part:!0};let a=An();e.locale&&(i.locale=e.locale),Ct(e.format)?i.key=e.format:dn(e.format)&&(Ct(e.format.key)&&(i.key=e.format.key),a=Object.keys(e.format).reduce((h,f)=>n.includes(f)?Ko(An(),h,{[f]:e.format[f]}):h,An()));const l=o(e.value,i,a);let u=[i.key];Mn(l)?u=l.map((h,f)=>{const p=s[h.type],g=p?p({[h.type]:h.value,index:f,parts:l}):[h.value];return Hle(g)&&(g[0].key=`${h.type}-${f}`),g}):Ct(l)&&(u=[l]);const c=Ko(An(),r),d=Ct(e.tag)||dn(e.tag)?e.tag:HV();return Tc(d,c,u)}}const UV=nt({name:"i18n-n",props:Ko({value:{type:Number,required:!0},format:{type:[String,Object]}},Z0),setup(e,t){const n=e.i18n||n_({useScope:e.scope,__useComponent:!0});return GV(e,t,DV,(...o)=>n[K0](...o))}}),WV=nt({name:"i18n-d",props:Ko({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Z0),setup(e,t){const n=e.i18n||n_({useScope:e.scope,__useComponent:!0});return GV(e,t,_V,(...o)=>n[j0](...o))}});function Gle(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const o=n.__getInstance(t);return o!=null?o.__composer:e.global.__composer}}function Ule(e){const t=i=>{const{instance:a,modifiers:l,value:u}=i;if(!a||!a.$)throw Fo(fn.UNEXPECTED_ERROR);const c=Gle(e,a.$);ee.env.NODE_ENV!=="production"&&l.preserve&&bo(Ds(jn.NOT_SUPPORTED_PRESERVE));const d=zV(u);return[Reflect.apply(c.t,c,[...jV(d)]),c]};return{created:(i,a)=>{const[l,u]=t(a);Xr&&e.global===u&&(i.__i18nWatcher=Je(u.locale,()=>{a.instance&&a.instance.$forceUpdate()})),i.__composer=u,i.textContent=l},unmounted:i=>{Xr&&i.__i18nWatcher&&(i.__i18nWatcher(),i.__i18nWatcher=void 0,delete i.__i18nWatcher),i.__composer&&(i.__composer=void 0,delete i.__composer)},beforeUpdate:(i,{value:a})=>{if(i.__composer){const l=i.__composer,u=zV(a);i.textContent=Reflect.apply(l.t,l,[...jV(u)])}},getSSRProps:i=>{const[a]=t(i);return{textContent:a}}}}function zV(e){if(Ct(e))return{path:e};if(zt(e)){if(!("path"in e))throw Fo(fn.REQUIRED_VALUE,"path");return e}else throw Fo(fn.INVALID_VALUE)}function jV(e){const{path:t,locale:n,args:o,choice:s,plural:r}=e,i={},a=o||{};return Ct(n)&&(i.locale=n),ro(s)&&(i.plural=s),ro(r)&&(i.plural=r),[t,a,i]}function Wle(e,t,...n){const o=zt(n[0])?n[0]:{},s=!!o.useI18nComponentName,r=on(o.globalInstall)?o.globalInstall:!0;ee.env.NODE_ENV!=="production"&&r&&s&&bo(Ds(jn.COMPONENT_NAME_LEGACY_COMPATIBLE,{name:J0.name})),r&&([s?"i18n":J0.name,"I18nT"].forEach(i=>e.component(i,J0)),[UV.name,"I18nN"].forEach(i=>e.component(i,UV)),[WV.name,"I18nD"].forEach(i=>e.component(i,WV))),e.directive("t",Ule(t))}const Q0={"vue-devtools-plugin-vue-i18n":"Vue I18n devtools","vue-i18n-resource-inspector":"I18n Resources","vue-i18n-timeline":"Vue I18n"},zle={"vue-i18n-resource-inspector":"Search for scopes ..."},jle={"vue-i18n-timeline":16764185},KV="vue-i18n: composer properties";let e_;async function Kle(e,t){return new Promise((n,o)=>{try{kle({id:"vue-devtools-plugin-vue-i18n",label:Q0["vue-devtools-plugin-vue-i18n"],packageName:"vue-i18n",homepage:"https://vue-i18n.intlify.dev",logo:"https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png",componentStateTypes:[KV],app:e},s=>{e_=s,s.on.visitComponentTree(({componentInstance:i,treeNode:a})=>{qle(i,a,t)}),s.on.inspectComponent(({componentInstance:i,instanceData:a})=>{i.vnode.el&&i.vnode.el.__VUE_I18N__&&a&&(t.mode==="legacy"?i.vnode.el.__VUE_I18N__!==t.global.__composer&&YV(a,i.vnode.el.__VUE_I18N__):YV(a,i.vnode.el.__VUE_I18N__))}),s.addInspector({id:"vue-i18n-resource-inspector",label:Q0["vue-i18n-resource-inspector"],icon:"language",treeFilterPlaceholder:zle["vue-i18n-resource-inspector"]}),s.on.getInspectorTree(i=>{i.app===e&&i.inspectorId==="vue-i18n-resource-inspector"&&Qle(i,t)});const r=new Map;s.on.getInspectorState(async i=>{if(i.app===e&&i.inspectorId==="vue-i18n-resource-inspector")if(s.unhighlightElement(),tue(i,t),i.nodeId==="global"){if(!r.has(i.app)){const[a]=await s.getComponentInstances(i.app);r.set(i.app,a)}s.highlightElement(r.get(i.app))}else{const a=eue(i.nodeId,t);a&&s.highlightElement(a)}}),s.on.editInspectorState(i=>{i.app===e&&i.inspectorId==="vue-i18n-resource-inspector"&&oue(i,t)}),s.addTimelineLayer({id:"vue-i18n-timeline",label:Q0["vue-i18n-timeline"],color:jle["vue-i18n-timeline"]}),n(!0)})}catch(s){console.error(s),o(!1)}})}function qV(e){return e.type.name||e.type.displayName||e.type.__file||"Anonymous"}function qle(e,t,n){const o=n.mode==="composition"?n.global:n.global.__composer;if(e&&e.vnode.el&&e.vnode.el.__VUE_I18N__&&e.vnode.el.__VUE_I18N__!==o){const s={label:`i18n (${qV(e)} Scope)`,textColor:0,backgroundColor:16764185};t.tags.push(s)}}function YV(e,t){const n=KV;e.state.push({type:n,key:"locale",editable:!0,value:t.locale.value}),e.state.push({type:n,key:"availableLocales",editable:!1,value:t.availableLocales}),e.state.push({type:n,key:"fallbackLocale",editable:!0,value:t.fallbackLocale.value}),e.state.push({type:n,key:"inheritLocale",editable:!0,value:t.inheritLocale}),e.state.push({type:n,key:"messages",editable:!1,value:t_(t.messages.value)}),e.state.push({type:n,key:"datetimeFormats",editable:!1,value:t.datetimeFormats.value}),e.state.push({type:n,key:"numberFormats",editable:!1,value:t.numberFormats.value})}function t_(e){const t={};return Object.keys(e).forEach(n=>{const o=e[n];Pn(o)&&"source"in o?t[n]=Jle(o):Tr(o)&&o.loc&&o.loc.source?t[n]=o.loc.source:dn(o)?t[n]=t_(o):t[n]=o}),t}const Yle={"<":"&lt;",">":"&gt;",'"':"&quot;","&":"&amp;"};function Xle(e){return e.replace(/[<>"&]/g,Zle)}function Zle(e){return Yle[e]||e}function Jle(e){return{_custom:{type:"function",display:`<span>ƒ</span> ${e.source?`("${Xle(e.source)}")`:"(?)"}`}}}function Qle(e,t){e.rootNodes.push({id:"global",label:"Global Scope"});const n=t.mode==="composition"?t.global:t.global.__composer;for(const[o,s]of t.__instances){const r=t.mode==="composition"?s:s.__composer;n!==r&&e.rootNodes.push({id:r.id.toString(),label:`${qV(o)} Scope`})}}function eue(e,t){let n=null;if(e!=="global"){for(const[o,s]of t.__instances.entries())if(s.id.toString()===e){n=o;break}}return n}function XV(e,t){if(e==="global")return t.mode==="composition"?t.global:t.global.__composer;{const n=Array.from(t.__instances.values()).find(o=>o.id.toString()===e);return n?t.mode==="composition"?n:n.__composer:null}}function tue(e,t){const n=XV(e.nodeId,t);return n&&(e.state=nue(n)),null}function nue(e){const t={},n="Locale related info",o=[{type:n,key:"locale",editable:!0,value:e.locale.value},{type:n,key:"fallbackLocale",editable:!0,value:e.fallbackLocale.value},{type:n,key:"availableLocales",editable:!1,value:e.availableLocales},{type:n,key:"inheritLocale",editable:!0,value:e.inheritLocale}];t[n]=o;const s="Locale messages info",r=[{type:s,key:"messages",editable:!1,value:t_(e.messages.value)}];t[s]=r;{const i="Datetime formats info",a=[{type:i,key:"datetimeFormats",editable:!1,value:e.datetimeFormats.value}];t[i]=a;const l="Datetime formats info",u=[{type:l,key:"numberFormats",editable:!1,value:e.numberFormats.value}];t[l]=u}return t}function Ep(e,t){if(e_){let n;t&&"groupId"in t&&(n=t.groupId,delete t.groupId),e_.addTimelineEvent({layerId:"vue-i18n-timeline",event:{title:e,groupId:n,time:Date.now(),meta:{},data:t||{},logType:e==="compile-error"?"error":e==="fallback"||e==="missing"?"warning":"default"}})}}function oue(e,t){const n=XV(e.nodeId,t);if(n){const[o]=e.path;o==="locale"&&Ct(e.state.value)?n.locale.value=e.state.value:o==="fallbackLocale"&&(Ct(e.state.value)||Mn(e.state.value)||dn(e.state.value))?n.fallbackLocale.value=e.state.value:o==="inheritLocale"&&on(e.state.value)&&(n.inheritLocale=e.state.value)}}function sue(e,t,n){return{beforeCreate(){const o=oo();if(!o)throw Fo(fn.UNEXPECTED_ERROR);const s=this.$options;if(s.i18n){const r=s.i18n;if(s.__i18n&&(r.__i18n=s.__i18n),r.__root=t,this===this.$root)this.$i18n=ZV(e,r);else{r.__injectWithOption=!0,r.__extender=n.__vueI18nExtend,this.$i18n=X0(r);const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}}else if(s.__i18n)if(this===this.$root)this.$i18n=ZV(e,s);else{this.$i18n=X0({__i18n:s.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}else this.$i18n=e;s.__i18nGlobal&&MV(t,s,s),this.$t=(...r)=>this.$i18n.t(...r),this.$rt=(...r)=>this.$i18n.rt(...r),this.$tc=(...r)=>this.$i18n.tc(...r),this.$te=(r,i)=>this.$i18n.te(r,i),this.$d=(...r)=>this.$i18n.d(...r),this.$n=(...r)=>this.$i18n.n(...r),this.$tm=r=>this.$i18n.tm(r),n.__setInstance(o,this.$i18n)},mounted(){if(ee.env.NODE_ENV!=="production"&&this.$el&&this.$i18n){const o=this.$i18n;this.$el.__VUE_I18N__=o.__composer;const s=this.__v_emitter=k0();o.__enableEmitter&&o.__enableEmitter(s),s.on("*",Ep)}},unmounted(){const o=oo();if(!o)throw Fo(fn.UNEXPECTED_ERROR);const s=this.$i18n;ee.env.NODE_ENV!=="production"&&this.$el&&this.$el.__VUE_I18N__&&(this.__v_emitter&&(this.__v_emitter.off("*",Ep),delete this.__v_emitter),this.$i18n&&(s.__disableEmitter&&s.__disableEmitter(),delete this.$el.__VUE_I18N__)),delete this.$t,delete this.$rt,delete this.$tc,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,s.__disposer&&(s.__disposer(),delete s.__disposer,delete s.__extender),n.__deleteInstance(o),delete this.$i18n}}}function ZV(e,t){e.locale=t.locale||e.locale,e.fallbackLocale=t.fallbackLocale||e.fallbackLocale,e.missing=t.missing||e.missing,e.silentTranslationWarn=t.silentTranslationWarn||e.silentFallbackWarn,e.silentFallbackWarn=t.silentFallbackWarn||e.silentFallbackWarn,e.formatFallbackMessages=t.formatFallbackMessages||e.formatFallbackMessages,e.postTranslation=t.postTranslation||e.postTranslation,e.warnHtmlInMessage=t.warnHtmlInMessage||e.warnHtmlInMessage,e.escapeParameterHtml=t.escapeParameterHtml||e.escapeParameterHtml,e.sync=t.sync||e.sync,e.__composer[kV](t.pluralizationRules||e.pluralizationRules);const n=Oy(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(o=>e.mergeLocaleMessage(o,n[o])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(o=>e.mergeDateTimeFormat(o,t.datetimeFormats[o])),t.numberFormats&&Object.keys(t.numberFormats).forEach(o=>e.mergeNumberFormat(o,t.numberFormats[o])),e}const rue=Ii("global-vue-i18n");function iue(e={},t){const n=__VUE_I18N_LEGACY_API__&&on(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,o=on(e.globalInjection)?e.globalInjection:!0,s=__VUE_I18N_LEGACY_API__&&n?!!e.allowComposition:!0,r=new Map,[i,a]=aue(e,n),l=Ii(ee.env.NODE_ENV!=="production"?"vue-i18n":"");ee.env.NODE_ENV!=="production"&&n&&s&&bo(Ds(jn.NOTICE_DROP_ALLOW_COMPOSITION));function u(h){return r.get(h)||null}function c(h,f){r.set(h,f)}function d(h){r.delete(h)}{const h={get mode(){return __VUE_I18N_LEGACY_API__&&n?"legacy":"composition"},get allowComposition(){return s},async install(f,...p){if(ee.env.NODE_ENV!=="production"&&(f.__VUE_I18N__=h),f.__VUE_I18N_SYMBOL__=l,f.provide(f.__VUE_I18N_SYMBOL__,h),zt(p[0])){const w=p[0];h.__composerExtend=w.__composerExtend,h.__vueI18nExtend=w.__vueI18nExtend}let g=null;!n&&o&&(g=mue(f,h.global)),__VUE_I18N_FULL_INSTALL__&&Wle(f,h,...p),__VUE_I18N_LEGACY_API__&&n&&f.mixin(sue(a,a.__composer,h));const v=f.unmount;if(f.unmount=()=>{g&&g(),h.dispose(),v()},ee.env.NODE_ENV!=="production"){if(!await Kle(f,h))throw Fo(fn.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN);const S=k0();if(n){const b=a;b.__enableEmitter&&b.__enableEmitter(S)}else{const b=a;b[Uu]&&b[Uu](S)}S.on("*",Ep)}},get global(){return a},dispose(){i.stop()},__instances:r,__getInstance:u,__setInstance:c,__deleteInstance:d};return h}}function n_(e={}){const t=oo();if(t==null)throw Fo(fn.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Fo(fn.NOT_INSTALLED);const n=lue(t),o=cue(n),s=OV(t),r=uue(e,s);if(__VUE_I18N_LEGACY_API__&&n.mode==="legacy"&&!e.__useComponent){if(!n.allowComposition)throw Fo(fn.NOT_AVAILABLE_IN_LEGACY_MODE);return pue(t,r,o,e)}if(r==="global")return MV(o,e,s),o;if(r==="parent"){let l=due(n,t,e.__useComponent);return l==null&&(ee.env.NODE_ENV!=="production"&&bo(Ds(jn.NOT_FOUND_PARENT_SCOPE)),l=o),l}const i=n;let a=i.__getInstance(t);if(a==null){const l=Ko({},e);"__i18n"in s&&(l.__i18n=s.__i18n),o&&(l.__root=o),a=Y0(l),i.__composerExtend&&(a[q0]=i.__composerExtend(a)),fue(i,t,a),i.__setInstance(t,a)}return a}function aue(e,t,n){const o=cC();{const s=__VUE_I18N_LEGACY_API__&&t?o.run(()=>X0(e)):o.run(()=>Y0(e));if(s==null)throw Fo(fn.UNEXPECTED_ERROR);return[o,s]}}function lue(e){{const t=Dn(e.isCE?rue:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Fo(e.isCE?fn.NOT_INSTALLED_WITH_PROVIDE:fn.UNEXPECTED_ERROR);return t}}function uue(e,t){return _y(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function cue(e){return e.mode==="composition"?e.global:e.global.__composer}function due(e,t,n=!1){let o=null;const s=t.root;let r=hue(t,n);for(;r!=null;){const i=e;if(e.mode==="composition")o=i.__getInstance(r);else if(__VUE_I18N_LEGACY_API__){const a=i.__getInstance(r);a!=null&&(o=a.__composer,n&&o&&!o[FV]&&(o=null))}if(o!=null||s===r)break;r=r.parent}return o}function hue(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function fue(e,t,n){let o=null;Zt(()=>{if(ee.env.NODE_ENV!=="production"&&t.vnode.el){t.vnode.el.__VUE_I18N__=n,o=k0();const s=n;s[Uu]&&s[Uu](o),o.on("*",Ep)}},t),nu(()=>{const s=n;ee.env.NODE_ENV!=="production"&&t.vnode.el&&t.vnode.el.__VUE_I18N__&&(o&&o.off("*",Ep),s[bp]&&s[bp](),delete t.vnode.el.__VUE_I18N__),e.__deleteInstance(t);const r=s[q0];r&&(r(),delete s[q0])},t)}function pue(e,t,n,o={}){const s=t==="local",r=xh(null);if(s&&e.proxy&&!(e.proxy.$options.i18n||e.proxy.$options.__i18n))throw Fo(fn.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);const i=on(o.inheritLocale)?o.inheritLocale:!Ct(o.locale),a=$(!s||i?n.locale.value:Ct(o.locale)?o.locale:Od),l=$(!s||i?n.fallbackLocale.value:Ct(o.fallbackLocale)||Mn(o.fallbackLocale)||zt(o.fallbackLocale)||o.fallbackLocale===!1?o.fallbackLocale:a.value),u=$(Oy(a.value,o)),c=$(zt(o.datetimeFormats)?o.datetimeFormats:{[a.value]:{}}),d=$(zt(o.numberFormats)?o.numberFormats:{[a.value]:{}}),h=s?n.missingWarn:on(o.missingWarn)||El(o.missingWarn)?o.missingWarn:!0,f=s?n.fallbackWarn:on(o.fallbackWarn)||El(o.fallbackWarn)?o.fallbackWarn:!0,p=s?n.fallbackRoot:on(o.fallbackRoot)?o.fallbackRoot:!0,g=!!o.fallbackFormat,v=Pn(o.missing)?o.missing:null,w=Pn(o.postTranslation)?o.postTranslation:null,S=s?n.warnHtmlMessage:on(o.warnHtmlMessage)?o.warnHtmlMessage:!0,b=!!o.escapeParameter,y=s?n.modifiers:zt(o.modifiers)?o.modifiers:{},E=o.pluralRules||s&&n.pluralRules;function _(){return[a.value,l.value,u.value,c.value,d.value]}const I=X({get:()=>r.value?r.value.locale.value:a.value,set:J=>{r.value&&(r.value.locale.value=J),a.value=J}}),T=X({get:()=>r.value?r.value.fallbackLocale.value:l.value,set:J=>{r.value&&(r.value.fallbackLocale.value=J),l.value=J}}),F=X(()=>r.value?r.value.messages.value:u.value),V=X(()=>c.value),x=X(()=>d.value);function A(){return r.value?r.value.getPostTranslationHandler():w}function k(J){r.value&&r.value.setPostTranslationHandler(J)}function M(){return r.value?r.value.getMissingHandler():v}function N(J){r.value&&r.value.setMissingHandler(J)}function B(J){return _(),J()}function z(...J){return r.value?B(()=>Reflect.apply(r.value.t,null,[...J])):B(()=>"")}function oe(...J){return r.value?Reflect.apply(r.value.rt,null,[...J]):""}function ie(...J){return r.value?B(()=>Reflect.apply(r.value.d,null,[...J])):B(()=>"")}function te(...J){return r.value?B(()=>Reflect.apply(r.value.n,null,[...J])):B(()=>"")}function se(J){return r.value?r.value.tm(J):{}}function Z(J,ce){return r.value?r.value.te(J,ce):!1}function P(J){return r.value?r.value.getLocaleMessage(J):{}}function j(J,ce){r.value&&(r.value.setLocaleMessage(J,ce),u.value[J]=ce)}function ne(J,ce){r.value&&r.value.mergeLocaleMessage(J,ce)}function ge(J){return r.value?r.value.getDateTimeFormat(J):{}}function xe(J,ce){r.value&&(r.value.setDateTimeFormat(J,ce),c.value[J]=ce)}function ue(J,ce){r.value&&r.value.mergeDateTimeFormat(J,ce)}function K(J){return r.value?r.value.getNumberFormat(J):{}}function Y(J,ce){r.value&&(r.value.setNumberFormat(J,ce),d.value[J]=ce)}function re(J,ce){r.value&&r.value.mergeNumberFormat(J,ce)}const R={get id(){return r.value?r.value.id:-1},locale:I,fallbackLocale:T,messages:F,datetimeFormats:V,numberFormats:x,get inheritLocale(){return r.value?r.value.inheritLocale:i},set inheritLocale(J){r.value&&(r.value.inheritLocale=J)},get availableLocales(){return r.value?r.value.availableLocales:Object.keys(u.value)},get modifiers(){return r.value?r.value.modifiers:y},get pluralRules(){return r.value?r.value.pluralRules:E},get isGlobal(){return r.value?r.value.isGlobal:!1},get missingWarn(){return r.value?r.value.missingWarn:h},set missingWarn(J){r.value&&(r.value.missingWarn=J)},get fallbackWarn(){return r.value?r.value.fallbackWarn:f},set fallbackWarn(J){r.value&&(r.value.missingWarn=J)},get fallbackRoot(){return r.value?r.value.fallbackRoot:p},set fallbackRoot(J){r.value&&(r.value.fallbackRoot=J)},get fallbackFormat(){return r.value?r.value.fallbackFormat:g},set fallbackFormat(J){r.value&&(r.value.fallbackFormat=J)},get warnHtmlMessage(){return r.value?r.value.warnHtmlMessage:S},set warnHtmlMessage(J){r.value&&(r.value.warnHtmlMessage=J)},get escapeParameter(){return r.value?r.value.escapeParameter:b},set escapeParameter(J){r.value&&(r.value.escapeParameter=J)},t:z,getPostTranslationHandler:A,setPostTranslationHandler:k,getMissingHandler:M,setMissingHandler:N,rt:oe,d:ie,n:te,tm:se,te:Z,getLocaleMessage:P,setLocaleMessage:j,mergeLocaleMessage:ne,getDateTimeFormat:ge,setDateTimeFormat:xe,mergeDateTimeFormat:ue,getNumberFormat:K,setNumberFormat:Y,mergeNumberFormat:re};function G(J){J.locale.value=a.value,J.fallbackLocale.value=l.value,Object.keys(u.value).forEach(ce=>{J.mergeLocaleMessage(ce,u.value[ce])}),Object.keys(c.value).forEach(ce=>{J.mergeDateTimeFormat(ce,c.value[ce])}),Object.keys(d.value).forEach(ce=>{J.mergeNumberFormat(ce,d.value[ce])}),J.escapeParameter=b,J.fallbackFormat=g,J.fallbackRoot=p,J.fallbackWarn=f,J.missingWarn=h,J.warnHtmlMessage=S}return Bh(()=>{if(e.proxy==null||e.proxy.$i18n==null)throw Fo(fn.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const J=r.value=e.proxy.$i18n.__composer;t==="global"?(a.value=J.locale.value,l.value=J.fallbackLocale.value,u.value=J.messages.value,c.value=J.datetimeFormats.value,d.value=J.numberFormats.value):s&&G(J)}),R}const gue=["locale","fallbackLocale","availableLocales"],JV=["t","rt","d","n","tm","te"];function mue(e,t){const n=Object.create(null);return gue.forEach(s=>{const r=Object.getOwnPropertyDescriptor(t,s);if(!r)throw Fo(fn.UNEXPECTED_ERROR);const i=mn(r.value)?{get(){return r.value.value},set(a){r.value.value=a}}:{get(){return r.get&&r.get()}};Object.defineProperty(n,s,i)}),e.config.globalProperties.$i18n=n,JV.forEach(s=>{const r=Object.getOwnPropertyDescriptor(t,s);if(!r||!r.value)throw Fo(fn.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${s}`,r)}),()=>{delete e.config.globalProperties.$i18n,JV.forEach(s=>{delete e.config.globalProperties[`$${s}`]})}}if(Ole(),__INTLIFY_JIT_COMPILATION__?oV(wle):oV(yle),ule(Uae),cle(QL),ee.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const e=Ra();e.__INTLIFY__=!0,Jae(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}ee.env.NODE_ENV;const QV={en:{}};function vue(e){const t=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([.$?*|{}()[\]\\/+^])/g,"\\$1")+"=([^;]*)"));return t?decodeURIComponent(t[1]):null}async function yue(e,t=10,n=300){for(let o=0;o<t;o++){const s=vue(e);if(s)return s;await new Promise(r=>setTimeout(r,n))}return null}async function wue(){const e=await yue("account.tessr_i18n_file_version_url");if(!e)return{};const t=await fetch(e);if(!t.ok)throw new Error("Failed to load en-error.json");return await t.json()}async function Cue(){const e=await wue();return{...QV,en:{...QV.en,errorMessages:e}}}async function bue(){return iue({legacy:!1,locale:"en",fallbackLocale:"en",messages:await Cue(),formatFallbackMessages:!0})}const Sue=async()=>{const e=await bue();return oQ(e.global),e},eB=32,Eue=Math.round(eB*16/9),_ue="arbo-thumbnails",_p="thumbnails";let Rp=null;const o_=new Map,s_=new Map;function tB(){return Rp||(Rp=new Promise((e,t)=>{const n=indexedDB.open(_ue,1);n.onupgradeneeded=()=>n.result.createObjectStore(_p),n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)}),Rp.catch(()=>Rp=null)),Rp}async function Rue(e,t){try{const n=await tB();return await new Promise((o,s)=>{const r=n.transaction(_p,"readonly").objectStore(_p).get(e);r.onsuccess=()=>{const i=r.result;o((i==null?void 0:i.url)===t&&i.blob instanceof Blob?i.blob:null)},r.onerror=()=>s(r.error)})}catch{return null}}async function Tue(e,t,n){try{const o=await tB();if(s_.get(e)!==t)return;await new Promise((s,r)=>{const i=o.transaction(_p,"readwrite");i.objectStore(_p).put({url:t,blob:n},e),i.oncomplete=()=>s(),i.onerror=()=>r(i.error)})}catch{}}function Due(e){return new Promise(t=>{new xP(e,{width:Eue,height:eB,resize:"cover",quality:.8,success:t,error:()=>t(e)})})}function Iue(e,t){s_.set(e,t);let n=o_.get(e);n||(n=new Map,o_.set(e,n));const o=n.get(t);if(o)return o;const s=(async()=>{const r=await Rue(e,t);if(r)return r;const i=await fetch(t);if(!i.ok)throw new Error(`Thumbnail request failed: ${i.status}`);const a=await Due(await i.blob());return await Tue(e,t,a),a})().finally(()=>{n.delete(t),n.size===0&&(o_.delete(e),s_.delete(e))});return n.set(t,s),s}const xue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+gAAAPoAgMAAAAwzTx3AAAACVBMVEXz9fjX19fo6etc+oS8AAAINUlEQVR42uzBgQAAAACAoP2pF6kCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGD24EAAAAAAAMj/tRFUVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVXYOWPjuGEgii45w4DKWQIDu4orAcEtB3Z0iWdUBpuAY4W2qnRACTgLiwVS/MUbJ7YV6AnEx1+Sp8FgMBgMBoPBYNDGy3sB+kD+3zfqnu9c4E4XM8v8oc554RKOLiYu0Pu6By7xoIuFCxzUNSsXOeliV344PRO4SP1L7tQxM9e9uMxJ/bJwEZ9STknCfglc5PGUBoBBN3OZW0w5yCt+bbDamBkw4/eGa5k1PPVKYG6osYibPWrpNRZxsyctvcaqYdgnK7fVWMCTfeeWGguZc1tzjYWr8aGpxiJG/MxNNVaHuqSxxiKebhOXeYoDxNNtba2xeC1eHdbTnkA82HdNKF0YiAf7Xt/BC6j6xhc/fv3++ufrsH5kXxO67jRbvZWEcpiFntVDPaOV0/tbz3UuVEvJpHS2uWf1ehVdtQ3ds3qofu+7FuOh4xJfP502rbds0OpqUd+R1ecY8ObUpzjMmFNf+OIOqu7qAe9A1X1DjbWnHlPOnHqqsaDqjkrMdlc9NRp76pvdmIvTC6i6oyIreKVpKLJsT53sji+pzmGqO2oo8ZjqnhpGN3vqcWC3p56qLKS6o8RfPk65ykKq+/8fqBzyLVlw9evyfhWrLLj65XJIVfaAVHdf/s4PqcpCqnttWEk5B62+8wdilYVWD3GFpSqLqO6yl6WcVGUR1X32stRdqrLI6jtHxCoLrL5x5BRy7gao7qJj5CZVWUB1H69sNec8rvrECS9VWRvqUsQzoLp7Wl21yuKp+/xF4EOssrDqOz8hjuz21GOVxVN3wodcTinn8NS9pC5WWVT1wE/cxJyzpx6rLJy6E9WlKgunLq+6VGXtqcecs6eeqiyaurjX5Rep0NSlVT9JrLKg6lu+6tmzCQvqp/wiFZq6q6pT/GcwdWVyy6osvvpR+swXpvqiqMeRHUxduTeXVVkwdeVmdD6yQ6pnjyDEKgupTpx4UCnnsNSVZ255lcVSVx4y5zmHqb5kZ5tQZTHVpyzgpYiHUo/RlVLO2qrTli1tPraCqi9pqxtLeJozv/wWFZa6E35PjbE297mjf1I54DHHl7jsb0Rka3L7XN1X5YNPHkzdUWJ+v9bc1l2ahJJy5tRn8DuyESXlQO/D/yPnjG0ch4EoahlQ4AJcgvpQCRNohLlMyfXBJpRfcslWuYGBAaRPcybl548WhpMHmp+PErmNzORvXxp5k79za+Qkf9N6zVDv179nYj9Vcc1QZ2m+Z2E/QXXNUOfmEi1Hh14d9aHOyMYtR3sy+pKxzsPHLceHbpHGDov+VPq7L981lrfmJGq5YRe3RYdVmrcqrcha+CXa7YuEBT/opvWlqoM+qphVlfYBlcUtx/pYUmKNHfJh9KflhnwF8dFY1gsgFrcc6+tGSWgs9wWQZsuRnqqwhMaSXgC5ov/8q7Uc6QkqueGUisZyXwDxj6zWcpynJe02yntNYzkvgMAol0rLcZ6MlvsoHxWN5b4A4p9YpeA5b0HYfbOyocZ6Vlb01+1XvQC6UKELbFYKaKxno0I3WMtW/wJkZ0U/r7+DSTGFFF1j9JUJXWAt27zwMcKEbt+PjpwKMU705T6h3wrZOdGddEWl8TChC25WxGcAZiVCN9ysWKPnDkb0CSe0YowRfVbPo9FzROjiKDihF8UQoVtlFT9aPUeIrp6myh586NV/EK8Y40GHRTxQ2Y0H3WrqVho9x4fuC1mksoUO/dRsz9GgC0hrtGWnQTcY30BlNzb0WT3Bll3Z0D8gKZUtLOgCwxtt2Q8WdKtOamtUvHChP1XzPceFDj/shsruLOgCBR+qbCFBt/oidjRUdqVCP9UTq6xQoasnobJGgi4wtuGWfSdBNyj4WGULEfqikLXVc0ToPrQ5lRUOdPE/8yprHOgGNR6r7M6DDiMbvH1SHnSosmjLvlKgC9LFKntQoBtoS6bnaNAVEqjsxoIO4xpu2ZUCXcBaMiq7MqAbFFmq50jQYVhjlTUS9FOrsVbPMaALoqHKYhjQDQo+pbKFAh1qLKOyBwU6kGUOUgkButQLPlLZjQDdoMVSB6l2BnQo+JzKFgJ0mMk5lT36Rxco+JzKSv/oBkOaU9mNAP1USEZldwJ0haRWN/3fPfofhaScRv92j+4JTBZDje77l+HQd//mcOhe8OOh47KO2R895sy23Ew36o4eKvxwo+5UJx06DGbmzRN+qce8ky038aGDo8VbVow9esyS1Vg+9DlAT9WhPHrMK1nwwazoMVNOY6dgVvSYZ1JjA+3pMlmNpfNY769QY+lkLgt18hmNL9iRxvIt6z6LA40lXNt+2bNjHARCIAqgExMLucfeyVh5qe0tzZ5SVxMaI2zomLxX0xDg8wl1Vp0am/BuezuSckvGgG8nWB2TMeAjlgPRnTLlmkXtmjrlmhfXPXON3a39x3rOox5x7v855Xusf52665l1v9dFHauxt5jZpVdjc+b7x9qpsUlDblfGa+wjJldGa+wzple2X3Va219TpzsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8GIPDgQAAAAAgPxfG0FVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVdqDQwIAAAAAQf9f+8IEAAAAAAAAwCmRg3Unf/8l+AAAAABJRU5ErkJggg==",Aue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+gAAAPoAgMAAAAwzTx3AAAACVBMVEXz9fjX19fk5OUH9i6SAAAGd0lEQVR42uzBgQAAAACAoP2pF6kCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGD24EAAAAAAAMj/tRFUVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVXYuXvcCGEgDMODJQrScwSK3GKP4GI/ZKWiSZRjcAn326TZU0YRsOwPkcCuPN88Nxi9wRjwxhhjjDHGGLOPuyYZpXhvSHSRwjkkK737D5L1UrQGGQYpWYsMZymYwy4ar/YaWbyUK2IvbQudw27a/uIb7Kdsje+QKUipIsB6sSObFKpCtpOUqcFBeta5DgfpWedaHKVmGx9xlJolHodpWeIdEujYylZIoeLu1iCFirtbjRQqHtmJR++QQsWepsWk/0rwWfSeps3alUQFow+SpCl5OxezNiVOweiSqOTRMy/WtuBNfObdqbPRS0Q/updENe/o5VcPVt2qW3WK6sQrvN3XrbpVt+pWXWt14vu67easulXnqO5l9Y6Pkah6uJ8c6CmrO/wZGKtPGXvG6pgMNNX989GaQFM9rKPM+KpHzE5s1R0Wnq16g8WZpbpfI856lurh9YT4SFY94uZEVh2rgat6hZUnqb4x+pmkeng9IX7mql5j1XNV73CHq/rD6CTV/cZv3kaO6mFrdKvOUT3izomq+uPoHNU9b/Vg1a06e3W7r2uvbrs5xie3QP/kVmPVk1SfR29439IQv5ursApc1R3ve3jiry/S8n5z63Bj39dpqldYBLbqgsXAUt3L8zo3slQPTxXR852bc5h4vtOSt/9Tw1d9foIJjCejp+wj43l4cRH4pvwVhIi7XmTDdVRf/d+8H/qrb3IABpXV/Z7lLKis/sveHdtGDgNRGJYEbKACVIKSq4IlzAF8xIRKrg8mVwL7PSwM35jiCiC5kR73y+hs/Nvy2AZErXnDWBizOp7iiNVnPB0jVl/xJIzVpWpz8YzVteo9imHE6vgSx6u+4Isbr/qKL0JYXepeJ+4Jq2vlO7XHq45vcbTqC7650aqv+CZ81aXy0gTlq66VdyGF0aon/DdY9QXGjVV9hjnoqkvt1TBKV11rb3zzY1VPgBmq+oKf3EjVZ/x0sFWX6guwlK26Vl+A5UeqnpAZqTpycZzqM3IHWXWpv9xRyKpr/TV/nrr6r1iusYa5+gMh2glnkbh6dp5xdnBVl9MjPRRPOSNc1fUcMtrpzPNW3wDgsNNZ4K2efy5QiqzVFzx5OxUcVXU5b2/BTgWhqq5Fx2inM2Wtvmdf1RtKgbV6yhYXvMJaPfuqXvCKY6peLq7ennIFYaqu5eJqkxWUs/qeLS4bXgmc1bfsF7SElzirJ8A+tOA1R1Rdyv8yqT3zCgdRdS3/MhGsaUEZq9uwsKYFz1h9z76hEy4wVk/ZNzSuOJ7q8v9odJpx5eCpbpefGD89cEX5qufv39pxxfNVzzrHhEt81TfAOFyLNNXFHvDmN64dNNXtzWOVhK36jFqerfqKWoGt+o5qkaW6vT24lmOprnaoJFzVF9TzXNVX1Atc1R9oEEmqiyWs5Uiqq62xtYSqOlooU/UZLQJT9RVNSKqLjVHNcVRXW2OrCVH1hCbKU31Bm8BTfUYjjupiU9RzFNXVpqh30FRPaKQ01dHKs1Rf0Iyiutga2yAyVNfnEM0OkuobmglJ9YRmnqP6gg4M1WWa0SESVNdpRYeDovqODkJRfUMHT1EdPQJBdVnQJd6/uq7o4giqP9BFCKrv6OIJqid0CQTV0env7Uf/jU5/bj96v8/od/QZ/TN6pzDdUfqM/hm9j5/uaPuMPuDoO/A+ne7oAbxPpjsaePQVeN8x3dEMvM9Nd7QA74vTLaEHw28vfescxR7bt9NQbDR9Ow3FRtP3043iZ9s/9uvYCkAQCKKgj9D+TKzO2Cp9lsAasc60AHzuot+t429LEt8S+CDxLYEPOtdSufnO1VQuGGVLxtjgsbcMNMnKXrGsz974tvs+McZ39X2q8V19/xq6c1vb+OlLf+1H6NqWN+7I8mcOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADzswYEAAAAAAJD/ayOoqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkp7cEgAAAAAIOj/a1+YAAAAAAAAALgEoKO2OvzgJtMAAAAASUVORK5CYII=",Pue=["src"],kue=["src"],Fue=["src"],Oue=_t(nt({__name:"ThumbnailRender",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},isEditing:{type:Boolean}},setup(e){const t=e,n=X(()=>t.value),o=X(()=>t.id),s=X(()=>t.disabled),r=X(()=>t.readOnly),i=$("");let a=null;const l=$(!1),u=X(()=>n.value==null||n.value===""),c=X(()=>!u.value&&l.value),d=()=>{l.value=!0},h=()=>{a&&URL.revokeObjectURL(a),a=null},f=()=>{i.value="",h()},p=fd(),{openSceneHub:g}=p,v=X(()=>{const b=un.getInstance().getItem("ws.code"),y=un.getInstance().getItem("BASE_URL"),E=b||t.workspaceId;return es({type:"scene_hub",config:{baseDomain:y,ws_code:E,scene_id:String(t.id)}}).url}),w=b=>{try{if(b.ctrlKey||b.metaKey){window.open(v.value,"_blank");return}g(String(t.id))}catch{window.open(v.value,"_blank")}finally{S()}},S=()=>{var E,_,I,T,F,V;(E=t.params)==null||E.api.clearFocusedCell();const b=((I=(_=t.params)==null?void 0:_.column)==null?void 0:I.getColId())||"",y=((F=(T=t.params)==null?void 0:T.node)==null?void 0:F.rowIndex)||0;(V=t.params)==null||V.api.setFocusedCell(y,b)};return Je(()=>[o.value,n.value],async([b,y],E,_)=>{let I=!0;if(_(()=>{I=!1,h()}),l.value=!1,i.value="",!(b==null||b===""||!y))try{const T=await Iue(String(b),y);if(!I||b!==o.value||y!==n.value)return;a=URL.createObjectURL(T),i.value=a}catch(T){I&&b===o.value&&y===n.value&&(console.warn("Failed to load cached thumbnail; using the original URL.",T),i.value=y)}},{immediate:!0}),Vn(f),(b,y)=>(q(),de("div",{class:le(["thumbnail-wrapper",{disabled:s.value,"read-only":r.value}]),onClick:w},[u.value?(q(),de("img",{key:0,src:L(Aue),alt:"No thumbnail"},null,8,Pue)):c.value?(q(),de("img",{key:1,src:L(xue),alt:"Broken thumbnail"},null,8,kue)):i.value?(q(),de("img",{key:2,src:i.value,alt:"Thumbnail",onError:d},null,40,Fue)):Ye("",!0)],2))}}),[["__scopeId","data-v-1fd3dd73"]]),Mue={class:"left-section"},Nue={class:"create-count"},Lue={class:"modified-template-options"},Vue=["onClick"],Bue={class:"setting-count"},$ue={class:"field-label"},Hue={class:"field-label"},Gue={class:"status-selection"},Uue={class:"preview-section"},Wue={key:0,class:"preview-list"},zue={key:0,class:"preview-more"},jue={key:1,style:{color:"var(--tessr-text-secondary, #6b6b6b)","align-items":"center",width:"100%","text-align":"center",display:"flex",flex:"1 1 0%"}},nB=1e3,oB=8,sB=7,Kue=_t(nt({__name:"BulkCreateCount",props:{item:{},takeName:{},options:{default:()=>[{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"}}]},getStatusFunc:{},workspaceId:{},entityId:{}},emits:["cancel","changed"],setup(e,{expose:t,emit:n}){const o=Kt,s=xo,r=$(null),i=$(null),a=["number","letter","name"],l={number_up:"1→9",number_down:"9→1",letter_up:"A→Z",letter_down:"Z→A",name:"Name"},u=$(null),c=$({}),d=(Y,re)=>{c.value[Y]=re instanceof HTMLElement?re:null},h=$(null),f=$("1"),p=e,g=$([]),v=X(()=>{const Y=w.value;let re=1;const R="9999.",G={createCount:`${R}0`,input:`${R}1`,firstField:`${R}5`,stepField:`${R}6`,number_up:`${R}1`,number_down:`${R}2`,letter_up:`${R}3`,letter_down:`${R}4`,statusSelect:`${R}7`};return["number_up","number_down","letter_up","letter_down"].forEach((ce,Ee)=>{re++,G[ce]=`${R}${re}`}),Y?(re++,G.statusSelect=`${R}${re}`,re++,G.firstField=`${R}${re}`,re++,G.stepField=`${R}${re}`):(delete G.firstField,delete G.stepField),G}),w=X(()=>g.value.find(Y=>typeof Y!="string"&&(Y.id==="number"||Y.id==="letter"))),S=$("number"),b=$("up"),y=Oo({...Ei.number}),E=Oo({...Ei.number}),_=()=>{Object.assign(y,Ei[S.value]),Object.assign(E,Ei[S.value])};Je(w,Y=>{if(!Y)return;const re=Y.id;re!==S.value&&(S.value=re,_()),b.value=Y.direction==="down"?"down":"up"},{immediate:!0,flush:"sync"});const I=X(()=>YO[b.value]),T=X(()=>{const Y=Number(f.value);return Number.isFinite(Y)?Math.min(nB,Math.max(0,Math.floor(Y))):0}),F=(Y,re)=>{const R=JO(S.value,Y,re);y[Y]=R,Mv(Y,R)&&(E[Y]=R)},V=$(null),x=$(null),A=$(null),k=(Y,re)=>{var G,J,ce,Ee;if(re.key==="Enter"||re.key==="Escape")return;if(re.key==="Tab"){re.preventDefault(),re.stopPropagation(),re.stopImmediatePropagation();const Ce=re.shiftKey;Y=="first"&&(Ce?(G=c.value.letter_down)==null||G.focus():(J=V.value)==null||J.focus()),Y=="step"&&(Ce?(ce=V.value)==null||ce.focus():(Ee=i.value)==null||Ee.focus());return}re.key.length===1&&!re.ctrlKey&&!re.metaKey&&!re.altKey&&!ZO(S.value,Y,re.key)&&re.preventDefault()},M=(Y,re)=>{var Ee;re.preventDefault();const R=re.target,G=((Ee=re.clipboardData)==null?void 0:Ee.getData("text/plain"))??"",J=R.selectionStart??R.value.length,ce=R.selectionEnd??R.value.length;R.value=R.value.slice(0,J)+G+R.value.slice(ce),F(Y,R.value),R.value=y[Y]},N=Y=>{if(Mv(Y,y[Y]))return;const re=Ei[S.value][Y];y[Y]=re,E[Y]=re},B=X(()=>w.value?CE({type:S.value,direction:b.value,first:E.first,step:E.step,count:T.value}):[]),z=X(()=>g.value.every(Y=>typeof Y=="string"&&!Y)),oe=X(()=>T.value===0||z.value?[]:Array.from({length:T.value}).map((Y,re)=>g.value.map(R=>typeof R=="string"?R:B.value[re]??"").join(""))),ie=X(()=>oe.value.length>oB?oe.value.length-sB:0),te=X(()=>oe.value.length>oB?oe.value.slice(0,sB):oe.value),se=Y=>{P.value=[Y];const re=Y.id.split("_")[0],R=Y.id.split("_")[1],G=l[Y.id],J=r.value;if(!J)return;const ce=Ce=>g.value.find(Ne=>typeof Ne!="string"&&Ce.includes(Ne.id));if(re==="name"){ce(["name"])?J.deleteTag("name"):J.insertTag({id:re,text:G,direction:void 0});return}const Ee=ce(["number","letter"]);if(Ee){const Ce=Ee.id===re,Ne=Ee.direction===R;if(Ce&&Ne){J.deleteTag(Ee.id);return}J.deleteTag(Ee.id),J.insertTag({id:re,text:G,direction:R})}else J.insertTag({id:re,text:G,direction:R})},Z=Y=>j(Y.id)?Y.description.active:!!w.value&&Y.description.switch?Y.description.switch:Y.description.inactive,P=$(null),j=Y=>{const[re,R]=Y.split("_");return g.value.some(G=>typeof G!="string"&&G.id===re&&G.direction===R)},ne=n,ge=X(()=>{const[Y]=g.value;return g.value.length===1&&typeof Y!="string"&&Y.id==="name"});X(()=>g.value.length===0||ge.value);const xe=()=>{const Y=g.value.map(re=>typeof re=="string"?{type:"text",value:re}:re.id==="name"?{type:"current_name"}:{type:"counter",value:y.first,direction:re.direction=="up"?"asc":"desc",format:re.id==="number"?"number":"letter",step:y.step});ne("changed",{data:Y,count:T.value,template_flow_status_id:u.value||void 0})};Je([g,f,y,u],()=>{xe()},{deep:!0,immediate:!0}),Je(g,()=>{console.log("inputContent changed",g.value)}),t({reset:()=>{P.value=null,g.value=[]},focus:()=>{var Y;(Y=i.value)==null||Y.focus()}}),Zt(()=>{var Y,re;(Y=r.value)==null||Y.insertText(p.takeName),(re=r.value)==null||re.insertTag({id:"number",text:"1→9",direction:"up"}),ht(()=>{var R;(R=i.value)==null||R.focus()})});const K=Y=>{var re,R;Y.preventDefault(),Y.stopPropagation(),(re=i.value)==null||re.blur(),(R=h.value)==null||R.focus()};return(Y,re)=>(q(),de("div",{class:"bulk-rename-core",ref_key:"popupRef",ref:h,tabindex:"-1"},[Se("div",Mue,[Se("div",Nue,[re[11]||(re[11]=Se("span",null,"How many to create?",-1)),ze(ye(L(hl),{modelValue:f.value,"onUpdate:modelValue":re[0]||(re[0]=R=>f.value=R),type:"number","max-value":nB,"max-decimal-char":0,"show-clear":!1,ref_key:"counterRef",ref:i,placeholder:"Enter count"},null,8,["modelValue"]),[[L(s),v.value.createCount]])]),ze(ye(VN,{modelValue:g.value,"onUpdate:modelValue":re[1]||(re[1]=R=>g.value=R),"allowed-tags":a,ref_key:"templateInputRef",ref:r,placeholder:"Enter name",onEscape:K},null,8,["modelValue"]),[[L(s),v.value.input]]),Se("div",Lue,[(q(!0),de(Pt,null,xn(e.options,R=>ze((q(),de("button",{onClick:G=>se(R),ref_for:!0,ref:G=>d(R.id,G),key:R.id,class:le([{active:j(R.id)},"template-option"])},[tt(it(R.name)+" ",1),R.icon?(q(),Ke(L(pt),{key:0,src:R.icon,style:{transform:"rotate(90deg)"}},null,8,["src"])):Ye("",!0)],10,Vue)),[[L(o),{content:Z(R),bypassOverflowCheck:!0,delay:[300,0],interactive:!1,hideOnClick:!1,appendTo:"parent"}],[L(s),`${v.value[R.id]}`]])),128))]),Se("div",Bue,[Se("span",$ue,it(I.value.first),1),ze((q(),Ke(L(hl),{ref_key:"firstFieldRef",ref:x,"model-value":y.first,disabled:!w.value,"max-length":L(yE),onInput:re[2]||(re[2]=R=>F("first",R)),onKeydown:re[3]||(re[3]=R=>k("first",R)),onPaste:re[4]||(re[4]=R=>M("first",R)),onBlur:re[5]||(re[5]=R=>N("first")),"show-clear":!1},{clear:we(()=>[...re[12]||(re[12]=[Se("div",null,null,-1)])]),_:1},8,["model-value","disabled","max-length"])),[[L(s),v.value.firstField]]),Se("span",Hue,it(I.value.step),1),ze(ye(L(hl),{"model-value":y.step,disabled:!w.value,"max-length":L(wE),onInput:re[6]||(re[6]=R=>F("step",R)),onKeydown:re[7]||(re[7]=R=>k("step",R)),onPaste:re[8]||(re[8]=R=>M("step",R)),onBlur:re[9]||(re[9]=R=>N("step")),"show-clear":!1,ref_key:"fieldStepRef",ref:V},null,8,["model-value","disabled","max-length"]),[[L(s),v.value.stepField]])]),Se("div",Gue,[re[13]||(re[13]=Se("span",null,"Status",-1)),ye(L(wL),{modelValue:u.value,"onUpdate:modelValue":re[10]||(re[10]=R=>u.value=R),"get-status-func":p.getStatusFunc,"workspace-id":p.workspaceId,id:p.entityId,style:{width:"100%"},"max-width":"372px",ref_key:"selectStatusRef",ref:A,"focus-index":v.value.statusSelect,placeholder:"Select status"},null,8,["modelValue","get-status-func","workspace-id","id","focus-index"])])]),Se("div",Uue,[re[14]||(re[14]=Se("span",{class:"preview-title"},"Preview",-1)),te.value.length>0?(q(),de("ul",Wue,[(q(!0),de(Pt,null,xn(te.value,(R,G)=>(q(),de("li",{key:G},[ye($N,{text:R},null,8,["text"])]))),128)),ie.value>0?(q(),de("li",zue," … "+it(ie.value)+" more ",1)):Ye("",!0)])):(q(),de("div",jue," Add a name or a counter to see a preview. "))])],512))}}),[["__scopeId","data-v-aaaf6342"]]),rB={text:yl,id:void 0,assignees:Mse,status:KN,dateRange:Nse,isStarted:yl,isCompleted:yl,lastUpdated:yl,completedOn:yl,isDeleted:yl,isArchived:yl,isProcessing:yl,name:GN,options:CQ,metric:zN,__checkboxSelection:void 0,description:Bie,thumbnail:Oue},que={text:!1,id:!1,assignees:!0,status:!0,dateRange:!0,isStarted:!1,isCompleted:!1,lastUpdated:!1,completedOn:!1,isDeleted:!1,isArchived:!1,isProcessing:!1,name:!1,options:!0,metric:!1,__checkboxSelection:!1,description:!1,thumbnail:!1},Yue={text:null,id:void 0,assignees:oM,status:NN,dateRange:Lse,isStarted:void 0,isCompleted:void 0,lastUpdated:void 0,completedOn:void 0,isDeleted:void 0,isArchived:void 0,isProcessing:void 0,name:GN,options:UN,metric:void 0,__checkboxSelection:void 0,description:void 0,thumbnail:void 0},Xue={id:[100,100],assignees:[200,200],status:[200,200],dateRange:[255,255],isStarted:[150,150],isCompleted:[150,150],lastUpdated:[180,180],completedOn:[180,180],isDeleted:[void 0,void 0],isArchived:[void 0,void 0],isProcessing:[void 0,void 0],name:[350,500],options:[50,50],metric:[200,300],__checkboxSelection:[50,50],text:[200,300],description:[200,300],thumbnail:[82,82]},Zue={dateRange:{cellEditorPopupPosition:"under",cellEditorPopup:!1},name:{cellEditorPopupPosition:"over",cellEditor:!1,cellEditorPopup:!1},metric:{suppressKeyboardEvent:void 0,suppressNavigable:!1,suppressMovable:!1,cellClass:"ag-cell-optimized",editable:!0}},Jue=e=>{var t,n,o;if(e){if(Number((t=e.metric_type)==null?void 0:t.id)==1)return["none","not","range"].includes(e.restricted_type)?"number":"dropdown";if(Number((n=e.metric_type)==null?void 0:n.id)==2)return e.format_type=="icon"?"rating":"dropdown";if(Number((o=e.metric_type)==null?void 0:o.id)==3)return}},Ld=e=>{if(e)return Jue(e)};function iB(e,t){var s,r,i,a;const n=(s=t==null?void 0:t.data)==null?void 0:s.permissions;let o={disabled:!1,readOnly:!1,type:void 0};if(!t||!e)o={disabled:!1,readOnly:!0,type:void 0};else if(e==="options")o={disabled:!1,readOnly:!1,type:void 0};else if(e!=null&&e.includes("metric")){const l=`metric_permission_${e==null?void 0:e.replace("metric_","")}`;o={disabled:!1,readOnly:!((t==null?void 0:t.data)&&t.data[l]&&((r=t.data[l])==null?void 0:r.permission)==2&&!((i=t.colDef)!=null&&i.context.formula)&&!t.data.isLocked&&!t.data.isDeleted),type:Ld((a=t.colDef)==null?void 0:a.context)}}else{const u={assignees:(n==null?void 0:n.has_update_assignee_permission)??0,completedOn:0,name:(n==null?void 0:n.has_edit_permission)??0,permissions:0,status:(n==null?void 0:n.has_edit_template_flow_status_permission)??0,dateRange:(n==null?void 0:n.has_edit_date_permission)??0,isStarted:0,isDeleted:0,isArchived:0,isLocked:0,isProcessing:0,lastUpdated:0,id:0,isCompleted:0,options:1,disabled:0,description:(n==null?void 0:n.has_edit_permission)??0,thumbnail:1}[e]??0;o={disabled:u===-1,readOnly:u!==1,type:void 0}}return o}class r_{constructor(){Rn(this,"eGui");Rn(this,"params")}init(t){this.params=t}getGui(){var n,o,s,r,i;const t=document.createElement("div");return(n=this.params)!=null&&n.height&&t.style.setProperty("--height",(o=this.params)==null?void 0:o.height),(s=this.params)!=null&&s.width?t.style.setProperty("--width",(r=this.params)==null?void 0:r.width):(i=this.params)!=null&&i.fullwidth?t.style.setProperty("--width","100%"):t.style.setProperty("--width",`${Math.floor(Math.random()*50)+50}%`),t.className="ag-cell-skeleton",t.addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),a.stopImmediatePropagation()}),this.eGui=t,t}refresh(t){return!1}getValue(){var t;return(t=this.params)==null?void 0:t.value}isPopup(t){return!1}getPopupPosition(){}destroy(){}}const aB=new Map;class Tp{static initialize(t){this.wrappers=t}static getWrappers(){if(!this.wrappers)throw new Error("CellRendererFactory: Not initialized. Please call CellRendererFactory.initialize() first.");return this.wrappers}static buildCommonCellParams(t,n){var u,c,d;const o=t.data||((u=t.node)==null?void 0:u.data),s=(c=t.colDef)==null?void 0:c.field,r=s&&o?o[s]:void 0,i=iB((d=t.colDef)==null?void 0:d.field,t),a=typeof n=="function"?n(t):n??{};return{...t,value:r,disabled:i==null?void 0:i.disabled,readOnly:i==null?void 0:i.readOnly,type:Ld(t.context),...a}}static resolveRendererComponent(t,n){let o;return t.includes("metric")&&rB.metric?Ld(n)==="rating"?o=Fie:o=zN:o=rB[t]??void 0,o}static resolveEditorComponent(t,n){const o=t.includes("metric");let s;const r=Ld(n);return o&&["number","dropdown"].includes(r)?s=zre:s=Yue[t],s}static canEditField(t,n){var r;if(n.data===void 0)return!1;const o=iB((r=n.colDef)==null?void 0:r.field,n),s=que[t]??!0;return!(o!=null&&o.disabled)&&!(o!=null&&o.readOnly)&&s&&(o==null?void 0:o.type)!=="rating"}static resolveSize(t){const[n=250,o=300]=Xue[t]??[];return{minWidth:n,maxWidth:o}}static buildHeaderComponentParams(t){return n=>typeof t=="function"?t(n):t??{}}static fromType(t){const{wrapVueCellEditor:n}=this.getWrappers(),o=String(t.field??""),s=this.resolveSize(o),r=Zue[o]??{},i=Ld(t.context),a=i==="number"||i==="rating",l=i=="rating"?t.context.range*24+20:s.minWidth;return{...t,headerName:t.headerName,...s,...t,cellEditorSelector:c=>{const d=this.resolveEditorComponent(o,t.context);return{component:n(d),params:this.buildCommonCellParams(c,t.cellRendererParams),popup:!a}},singleClickEdit:!0,cellEditorPopup:!a,cellEditorPopupPosition:a?void 0:"under",editable:c=>{let d;return c.data===void 0||c.data.isDeleted||c.node.data===void 0?d=!1:d=this.canEditField(o,c),d},minWidth:l,cellRendererSelector:c=>Que(c,{component:n(this.resolveRendererComponent(o,t.context)),params:this.buildCommonCellParams(c,t.cellRendererParams)}),headerComponentParams:this.buildHeaderComponentParams(t.headerComponentParams),...r,cellClass:c=>`${i}--${c.colDef.field}`}}}Rn(Tp,"wrappers",null);const Que=(e,t)=>{var s;const n=(s=e.colDef)==null?void 0:s.field,o=`${n}-${e.node.rowIndex}`;return aB.set(o,(aB.get(o)??0)+1),n!=null&&n.includes("metric")?e.value===void 0?{component:r_,params:{fullwidth:!1}}:t:e.data&&(n!=null&&n.includes("thumbnail"))||e.data&&e.value!==void 0?t:!n||n==="options"||n==="__checkboxSelection"?e.data?t:{component:r_,params:{fullwidth:!0,width:"24px",height:"24px"}}:!e.data||e.value===void 0?{component:r_,params:{fullwidth:!1}}:t},ece=_t(nt({__name:"Vue3Wrapper",props:{component:{},params:{},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},tooltip:{},isNoData:{type:Boolean,default:!1},workspaceId:{},entityId:{},axiosService:{},isSearching:{type:Boolean,default:!1},isFiltering:{type:Boolean,default:!1},sortType:{default:"default"},maxRating:{default:5},config:{}},setup(e,{expose:t}){const n=e,o=$(null),s=X(()=>{var a;return((a=n.component)==null?void 0:a.name)||"UnknownComponent"}),r=X(()=>{var a;return((a=n.component)==null?void 0:a.default)||n.component}),i=X(()=>({params:n.params,disabled:n.disabled,readOnly:n.readOnly,value:n.value,maxRating:n.maxRating,data:n.data,id:n.id,workspaceId:n.workspaceId,entityId:n.entityId,axiosService:n.axiosService,tooltip:n.tooltip,isSearching:n.isSearching,isFiltering:n.isFiltering,isNoData:n.isNoData,config:n.config}));return t({focus:()=>{var a;return(a=o.value)!=null&&a.focus?o.value.focus():console.warn(`Component ${s.value} does not have a focus method.`),!0},blur:()=>{var a,l;return(l=(a=o.value)==null?void 0:a.blur)==null||l.call(a),!0},trigger:(a,l)=>{var u;return(u=o.value)==null||u.$emit(a,l),!0}}),(a,l)=>(q(),Ke(OC(r.value),jt(i.value,{ref_key:"componentRef",ref:o}),null,16))}}),[["__cssModules",{$style:{skeleton:"_skeleton_7xde7_1",shimmer:"_shimmer_7xde7_16","skeleton-loading":"_skeleton-loading_7xde7_1"}}]]);function tce(e){return"stopEditing"in e}const nce=8,oce=e=>{if(!e)return;const t=e.__vueParentComponent,n=t==null?void 0:t.exposed;n&&typeof n.triggerFocus=="function"?n.triggerFocus():e.focus()};function lB(e){return class{constructor(){Rn(this,"container");Rn(this,"vNode",null);Rn(this,"componentInstance",null);Rn(this,"componsenExposed",null);Rn(this,"params");Rn(this,"isEditor",!1);Rn(this,"_destroyed",!1)}init(n){var l,u,c,d;if(!n){console.error("[Vue3CellWrapper] Missing params");return}const o=performance.now();this.params=n,this.isEditor=tce(n),this.container=document.createElement("div"),this.container.classList.add("ag-vue3-cell-wrapper"),this.container.style.width="100%",this.container.style.height="100%";const s=n.context.apiClass,r=n,i={component:e,params:Object.freeze(n),disabled:!1,readOnly:r.readOnly??!1,value:n.value,maxRating:r.maxRating??void 0,data:n.data,id:(l=n==null?void 0:n.data)==null?void 0:l.id,workspaceId:n.context.workspaceId,entityId:n.context.entityId,axiosService:s,tooltip:r.tooltip??void 0,isSearching:r.isSearching??!1,isFiltering:r.isFiltering??!1,isNoData:r.isNoData??!1,config:r.config,sceneId:(r==null?void 0:r.sceneId)||void 0};this.vNode=ye(ece,i),rb(this.vNode,this.container);const a=performance.now()-o;a>nce&&console.warn(`[Vue3CellWrapper] Slow render (${a.toFixed(1)}ms) for "${(u=n.colDef)==null?void 0:u.field}"`),this.componentInstance=(c=this.vNode.component)==null?void 0:c.proxy,this.componsenExposed=(d=this.vNode.component)==null?void 0:d.exposed}getGui(){return this.container}refresh(n){return!1}focusUi(){var n;(n=this.componsenExposed)!=null&&n.focus?this.componsenExposed.focus():oce(this.container)}getValue(){var n,o,s;return this.params._editorValue!==void 0?this.params._editorValue:this.componentInstance?((s=(o=this.componentInstance).getValue)==null?void 0:s.call(o))??this.componentInstance.value:(console.warn("[Vue3CellWrapper] getValue() called but component instance not available"),(n=this.params)==null?void 0:n.value)}isPopup(n){var i,a,l,u,c;const o=(l=(a=(i=this.params)==null?void 0:i.colDef)==null?void 0:a.field)==null?void 0:l.includes("metric"),s=((u=this.params)==null?void 0:u.context)&&Ld(this.params.context);return o||(s==="number"||s==="rating")||!this.isEditor?!1:(c=this.componentInstance)!=null&&c.isPopup?this.componentInstance.isPopup():!0}getPopupPosition(){var o,s,r;return this.isEditor?(o=this.componentInstance)!=null&&o.getPopupPosition?this.componentInstance.getPopupPosition():((r=(s=this.params)==null?void 0:s.colDef)==null?void 0:r.cellEditorPopupPosition)??"under":void 0}afterGuiAttached(){!this.isEditor||this.componentInstance}destroy(){if(!this._destroyed&&(this._destroyed=!0,!!this.container))try{const n=this.componentInstance;if(n){try{typeof n.$destroy=="function"&&n.$destroy()}catch(s){console.warn("[Vue3CellWrapper] Error during $destroy:",s)}try{typeof n.destroy=="function"&&n.destroy()}catch(s){console.warn("[Vue3CellWrapper] Error during destroy():",s)}}(typeof queueMicrotask=="function"?queueMicrotask:s=>Promise.resolve().then(s))(()=>{try{rb(null,this.container)}catch(s){console.warn("[Vue3CellWrapper] Error during unmount:",s)}finally{this.container.textContent=""}})}catch(n){console.error("[Vue3CellWrapper] Error during cleanup:",n)}finally{this.vNode=null,this.componentInstance=null}}}}function My(e){return lB(e)}function uB(e){return lB(e)}var Wu=class{constructor(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,n){const o=t?this.allAsyncListeners:this.allSyncListeners;let s=o.get(e);return!s&&n&&(s=new Set,o.set(e,s)),s}noRegisteredListenersExist(){return this.allSyncListeners.size===0&&this.allAsyncListeners.size===0&&this.globalSyncListeners.size===0&&this.globalAsyncListeners.size===0}addEventListener(e,t,n=!1){this.getListeners(e,n,!0).add(t)}removeEventListener(e,t,n=!1){const o=this.getListeners(e,n,!1);o&&(o.delete(t),o.size===0&&(n?this.allAsyncListeners:this.allSyncListeners).delete(e))}addGlobalListener(e,t=!1){this.getGlobalListeners(t).add(e)}removeGlobalListener(e,t=!1){this.getGlobalListeners(t).delete(e)}dispatchEvent(e){this.dispatchToListeners(e,!0),this.dispatchToListeners(e,!1),this.firedEvents[e.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){const n=e.type;if(t&&"event"in e){const a=e.event;a instanceof Event&&(e.eventPath=a.composedPath())}const{frameworkOverrides:o}=this,s=a=>{const l=o?()=>o.wrapIncoming(a):a;t?this.dispatchAsync(l):l()},r=this.getListeners(n,t,!1);if(((r==null?void 0:r.size)??0)>0){const a=new Set(r);for(const l of a)r!=null&&r.has(l)&&s(()=>l(e))}const i=this.getGlobalListeners(t);if(i.size>0){const a=new Set(i);for(const l of a)s(()=>l(n,e))}}getGlobalListeners(e){return e?this.globalAsyncListeners:this.globalSyncListeners}dispatchAsync(e){if(this.asyncFunctionsQueue.push(e),!this.scheduled){const t=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)};this.frameworkOverrides?this.frameworkOverrides.wrapIncoming(t):t(),this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[];for(const t of e)t()}};function Ia(e){return e==null||e===""?null:e}function ft(e){return e!=null&&e!==""}function Gn(e){return!ft(e)}function i_(e){return e!=null&&typeof e.toString=="function"?e.toString():null}function Dp(e,t){const n=e?JSON.stringify(e):null,o=t?JSON.stringify(t):null;return n===o}function sce(e,t,n=!1){const o=e==null,s=t==null;if(e!=null&&e.toNumber&&(e=e.toNumber()),t!=null&&t.toNumber&&(t=t.toNumber()),o&&s)return 0;if(o)return-1;if(s)return 1;function r(i,a){return i>a?1:i<a?-1:0}if(typeof e!="string"||!n)return r(e,t);try{return e.localeCompare(t)}catch{return r(e,t)}}var rce=/[&<>"']/g,ice={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Vd(e){return(e==null?void 0:e.toString().toString())??null}function Ip(e){var t;return((t=Vd(e))==null?void 0:t.replace(rce,n=>ice[n]))??null}function Ai(e){return e.eRootDiv.getRootNode()}function Kn(e){return Ai(e).activeElement}function Ho(e){const{gos:t,eRootDiv:n}=e;let o=null;const s=t.get("getDocument");return s&&ft(s)?o=s():n&&(o=n.ownerDocument),o&&ft(o)?o:document}function cB(e){const t=Kn(e);return t===null||t===Ho(e).body}function dB(e){return Ho(e).defaultView||window}function a_(e){let t=null,n=null;try{t=Ho(e).fullscreenElement}catch{}finally{t||(t=Ai(e));const o=t.querySelector("body");o?n=o:t instanceof ShadowRoot?n=t:t instanceof Document?n=t==null?void 0:t.documentElement:n=t}return n}function ace(e){const t=a_(e);return(t==null?void 0:t.clientWidth)??(window.innerWidth||-1)}function lce(e){const t=a_(e);return(t==null?void 0:t.clientHeight)??(window.innerHeight||-1)}function Qr(e,t,n){n==null||typeof n=="string"&&n==""?hB(e,t):Ir(e,t,n)}function Ir(e,t,n){e.setAttribute(fB(t),n.toString())}function hB(e,t){e.removeAttribute(fB(t))}function fB(e){return`aria-${e}`}function Dl(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function uce(e){let t;return e==="asc"?t="ascending":e==="desc"?t="descending":e==="mixed"?t="other":t="none",t}function cce(e){return e.getAttribute("aria-label")}function Bd(e,t){Qr(e,"label",t)}function xp(e,t){Qr(e,"labelledby",t)}function pB(e,t){Qr(e,"live",t)}function dce(e,t){Qr(e,"atomic",t)}function hce(e,t){Qr(e,"relevant",t)}function fce(e,t){Qr(e,"invalid",t)}function pce(e,t){Qr(e,"disabled",t)}function gB(e,t){Qr(e,"hidden",t)}function l_(e,t){Ir(e,"expanded",t)}function gce(e,t){Ir(e,"setsize",t)}function mce(e,t){Ir(e,"posinset",t)}function vce(e,t){Ir(e,"multiselectable",t)}function yce(e,t){Ir(e,"rowcount",t)}function Ny(e,t){Ir(e,"rowindex",t)}function wce(e,t){Ir(e,"rowspan",t)}function Cce(e,t){Ir(e,"colcount",t)}function mB(e,t){Ir(e,"colindex",t)}function bce(e,t){Ir(e,"colspan",t)}function Sce(e,t){Ir(e,"sort",t)}function Ece(e){hB(e,"sort")}function vB(e,t){Qr(e,"selected",t)}function _ce(e,t){Qr(e,"controls",t)}function Rce(e,t){_ce(e,t.id),xp(t,e.id)}function yB(e,t){Qr(e,"owns",t)}function Ly(e,t){return t===void 0?e("ariaIndeterminate","indeterminate"):t===!0?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}var Tce="[tabindex], input, select, button, textarea, [href]",wB="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function Ap(e){return!e||!e.matches("input, select, button, textarea")||!e.matches(wB)?!1:Pi(e)}function Un(e,t,n={}){const{skipAriaHidden:o}=n;e.classList.toggle("ag-hidden",!t),o||gB(e,!t)}function Dce(e,t,n={}){const{skipAriaHidden:o}=n;e.classList.toggle("ag-invisible",!t),o||gB(e,!t)}function Pp(e,t){const n="disabled",o=t?r=>r.setAttribute(n,""):r=>r.removeAttribute(n);o(e);const s=e.querySelectorAll("input")??[];for(const r of s)o(r)}function zu(e,t,n){let o=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,typeof n=="number"){if(++o>n)break}else if(e===n)break}return!1}function ju(e){const{height:t,width:n,borderTopWidth:o,borderRightWidth:s,borderBottomWidth:r,borderLeftWidth:i,paddingTop:a,paddingRight:l,paddingBottom:u,paddingLeft:c,marginTop:d,marginRight:h,marginBottom:f,marginLeft:p,boxSizing:g}=window.getComputedStyle(e),v=Number.parseFloat;return{height:v(t||"0"),width:v(n||"0"),borderTopWidth:v(o||"0"),borderRightWidth:v(s||"0"),borderBottomWidth:v(r||"0"),borderLeftWidth:v(i||"0"),paddingTop:v(a||"0"),paddingRight:v(l||"0"),paddingBottom:v(u||"0"),paddingLeft:v(c||"0"),marginTop:v(d||"0"),marginRight:v(h||"0"),marginBottom:v(f||"0"),marginLeft:v(p||"0"),boxSizing:g}}function u_(e){const t=ju(e);return t.boxSizing==="border-box"?t.height-t.paddingTop-t.paddingBottom-t.borderTopWidth-t.borderBottomWidth:t.height}function kp(e){const t=ju(e);return t.boxSizing==="border-box"?t.width-t.paddingLeft-t.paddingRight-t.borderLeftWidth-t.borderRightWidth:t.width}function CB(e){const{height:t,marginBottom:n,marginTop:o}=ju(e);return Math.floor(t+n+o)}function Vy(e){const{width:t,marginLeft:n,marginRight:o}=ju(e);return Math.floor(t+n+o)}function bB(e){const t=e.getBoundingClientRect(),{borderTopWidth:n,borderLeftWidth:o,borderRightWidth:s,borderBottomWidth:r}=ju(e);return{top:t.top+(n||0),left:t.left+(o||0),right:t.right+(s||0),bottom:t.bottom+(r||0)}}function By(e,t){let n=e.scrollLeft;return t&&(n=Math.abs(n)),n}function $y(e,t,n){n&&(t*=-1),e.scrollLeft=t}function qo(e){for(;e!=null&&e.firstChild;)e.firstChild.remove()}function ei(e){e!=null&&e.parentNode&&e.remove()}function SB(e){return!!e.offsetParent}function Pi(e){return e.checkVisibility?e.checkVisibility({checkVisibilityCSS:!0}):!(!SB(e)||window.getComputedStyle(e).visibility!=="visible")}function c_(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function EB(e,t,n){n&&n.nextSibling===t||(e.firstChild?n?n.nextSibling?e.insertBefore(t,n.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.insertAdjacentElement("afterbegin",t):e.appendChild(t))}function _B(e,t){for(let n=0;n<t.length;n++){const o=t[n],s=e.children[n];s!==o&&e.insertBefore(o,s)}}function Ice(e){return e.replace(/[A-Z]/g,t=>`-${t.toLocaleLowerCase()}`)}function Fp(e,t){if(t)for(const n of Object.keys(t)){const o=t[n];if(!(n!=null&&n.length)||o==null)continue;const s=Ice(n),r=o.toString(),i=r.replace(/\s*!important/g,""),a=i.length!=r.length?"important":void 0;e.style.setProperty(s,i,a)}}function Hy(e){return()=>{const t=e();return t?d_(t)||RB(t):!0}}function d_(e){return e.clientWidth<e.scrollWidth}function RB(e){return e.clientHeight<e.scrollHeight}function Gy(e,t){t==="flex"?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):ki(e,t)}function ki(e,t){t=h_(t),e.style.width=t,e.style.maxWidth=t,e.style.minWidth=t}function Op(e,t){t=h_(t),e.style.height=t,e.style.maxHeight=t,e.style.minHeight=t}function h_(e){return typeof e=="number"?`${e}px`:e}function f_(e){return e instanceof Node||e instanceof HTMLElement}function Zs(e,t,n){n==null||n===""?e.removeAttribute(t):e.setAttribute(t,n.toString())}function Il(e,t,n){const s=dB(e).ResizeObserver,r=s?new s(n):null;return r==null||r.observe(t),()=>r==null?void 0:r.disconnect()}function xa(e,t){const n=dB(e);n.requestAnimationFrame?n.requestAnimationFrame(t):n.webkitRequestAnimationFrame?n.webkitRequestAnimationFrame(t):n.setTimeout(t,0)}var TB="data-ref",p_;function DB(){return p_??(p_=document.createTextNode(" ")),p_.cloneNode()}function Mp(e){const{attrs:t,children:n,cls:o,ref:s,role:r,tag:i}=e,a=document.createElement(i);if(o&&(a.className=o),s&&a.setAttribute(TB,s),r&&a.setAttribute("role",r),t)for(const l of Object.keys(t))a.setAttribute(l,t[l]);if(n)if(typeof n=="string")a.textContent=n;else{let l=!0;for(const u of n)u&&(typeof u=="string"?(a.appendChild(document.createTextNode(u)),l=!1):typeof u=="function"?a.appendChild(u()):(l&&(a.appendChild(DB()),l=!1),a.append(Mp(u)),a.appendChild(DB())))}return a}var xce=["touchstart","touchend","touchmove","touchcancel","scroll"],Ace=["wheel"],g_={},IB=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return n=>{if(typeof g_[n]=="boolean")return g_[n];const o=document.createElement(e[n]||"div");return n="on"+n,g_[n]=n in o}})();function Pce(e,t){return!t||!e?!1:Fce(t).indexOf(e)>=0}function kce(e){const t=[];let n=e.target;for(;n;)t.push(n),n=n.parentElement;return t}function Fce(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():kce(t)}function Oce(e,t,n){const o=Mce(t);let s;o!=null&&(s={passive:o}),e.addEventListener(t,n,s)}var Mce=e=>{const t=xce.includes(e),n=Ace.includes(e);if(t)return!0;if(n)return!1};function xB(e,t,n){if(n===0)return!1;const o=Math.abs(e.clientX-t.clientX),s=Math.abs(e.clientY-t.clientY);return Math.max(o,s)<=n}var Np=(e,t)=>{const n=e.identifier;for(let o=0,s=t.length;o<s;++o){const r=t[o];if(r.identifier===n)return r}return null};function Lp(e,t){return e.gos.isElementInThisInstance(t.target)}function Nce(e,t,n){const s=e.getBoundingClientRect().height,r=ace(n)-2,i=lce(n)-2;if(!e.offsetParent)return;const l=bB(e.offsetParent),{clientY:u,clientX:c}=t;let d=u-l.top-s/2,h=c-l.left-10;const f=Ho(n),p=f.defaultView||window,g=p.pageYOffset||f.documentElement.scrollTop,v=p.pageXOffset||f.documentElement.scrollLeft;r>0&&h+e.clientWidth>r+v&&(h=r+v-e.clientWidth),h<0&&(h=0),i>0&&d+e.clientHeight>i+g&&(d=i+g-e.clientHeight),d<0&&(d=0),e.style.left=`${h}px`,e.style.top=`${d}px`}var Uy=(e,...t)=>{for(const n of t){const[o,s,r,i]=n;o.addEventListener(s,r,i),e.push(n)}},m_=e=>{if(e){for(const[t,n,o,s]of e)t.removeEventListener(n,o,s);e.length=0}},xl=e=>{e.cancelable&&e.preventDefault()};function Lce(e,t){return t}function AB(e){return(e==null?void 0:e.getLocaleTextFunc())??Lce}function Vce(e,t,n,o){const s=t[n];return e.getLocaleTextFunc()(n,typeof s=="function"?s(o):s,o)}function Bce(e){return(t,n,o)=>e({key:t,defaultValue:n,variableValues:o})}function $ce(e){return(t,n,o)=>{let s=e==null?void 0:e[t];if(s&&(o!=null&&o.length)){let r=0;for(;!(r>=o.length||s.indexOf("${variable}")===-1);)s=s.replace("${variable}",o[r++])}return s??n}}var Fi=class{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.propertyListenerId=0,this.lastChangeSetIdLookup={},this.isAlive=()=>!this.destroyed}preWireBeans(e){this.beans=e,this.stubContext=e.context,this.eventSvc=e.eventSvc,this.gos=e.gos}destroy(){const{destroyFunctions:e}=this;for(let t=0;t<e.length;t++)e[t]();e.length=0,this.destroyed=!0,this.dispatchLocalEvent({type:"destroyed"})}addEventListener(e,t,n){this.localEventService||(this.localEventService=new Wu),this.localEventService.addEventListener(e,t,n)}removeEventListener(e,t,n){var o;(o=this.localEventService)==null||o.removeEventListener(e,t,n)}dispatchLocalEvent(e){var t;(t=this.localEventService)==null||t.dispatchEvent(e)}addManagedElementListeners(e,t){return this._setupListeners(e,t)}addManagedEventListeners(e){return this._setupListeners(this.eventSvc,e)}addManagedListeners(e,t){return this._setupListeners(e,t)}_setupListeners(e,t){const n=[];for(const o of Object.keys(t)){const s=t[o];s&&n.push(this._setupListener(e,o,s))}return n}_setupListener(e,t,n){if(this.destroyed)return()=>null;let o;if(Hce(e))e.__addEventListener(t,n),o=()=>(e.__removeEventListener(t,n),null);else{const s=Gce(e);e instanceof HTMLElement?Oce(e,t,n):s?e.addListener(t,n):e.addEventListener(t,n),o=s?()=>(e.removeListener(t,n),null):()=>(e.removeEventListener(t,n),null)}return this.destroyFunctions.push(o),()=>(o(),this.destroyFunctions=this.destroyFunctions.filter(s=>s!==o),null)}setupPropertyListener(e,t){const{gos:n}=this;n.addPropertyEventListener(e,t);const o=()=>(n.removePropertyEventListener(e,t),null);return this.destroyFunctions.push(o),()=>(o(),this.destroyFunctions=this.destroyFunctions.filter(s=>s!==o),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupPropertyListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const n=e.join("-")+this.propertyListenerId++,o=s=>{if(s.changeSet){if(s.changeSet&&s.changeSet.id===this.lastChangeSetIdLookup[n])return;this.lastChangeSetIdLookup[n]=s.changeSet.id}const r={type:"propertyChanged",changeSet:s.changeSet,source:s.source};t(r)};for(const s of e)this.setupPropertyListener(s,o)}getLocaleTextFunc(){return AB(this.beans.localeSvc)}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createOptionalManagedBean(e,t){return e?this.createManagedBean(e,t):void 0}createManagedBean(e,t){const n=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),n}createBean(e,t,n){return(t||this.stubContext).createBean(e,n)}destroyBean(e,t){return(t||this.stubContext).destroyBean(e)}destroyBeans(e,t){return(t||this.stubContext).destroyBeans(e)}};function Hce(e){return e.__addEventListener!==void 0}function Gce(e){return e.eventServiceType==="global"}var qe=class extends Fi{},PB={};function v_(e,t){PB[t]||(e(),PB[t]=!0)}var Uce={pending:!1,funcs:[]},Wce={pending:!1,funcs:[]};function y_(e,t="setTimeout",n){const o=t==="raf"?Wce:Uce;if(o.funcs.push(e),o.pending)return;o.pending=!0;const s=()=>{const r=o.funcs.slice();o.funcs.length=0,o.pending=!1;for(const i of r)i()};t==="raf"?xa(n,s):window.setTimeout(s,0)}function Yo(e,t,n){let o;return function(...s){const r=this;window.clearTimeout(o),o=window.setTimeout(function(){e.isAlive()&&t.apply(r,s)},n)}}function kB(e,t){let n=0;return function(...o){const s=this,r=Date.now();r-n<t||(n=r,e.apply(s,o))}}function zce(e,t,n,o=100){const s=Date.now();let r=null,i=!1;const a=()=>{r!=null&&(window.clearInterval(r),r=null)};e.addDestroyFunc(a);const l=()=>{const u=Date.now()-s>o;(t()||u)&&(n(),i=!0,a())};l(),i||(r=window.setInterval(l,10))}var FB=new Set(["__proto__","constructor","prototype"]);function jce(e,t){if(e!=null){if(Array.isArray(e)){for(let n=0;n<e.length;n++)t(n.toString(),e[n]);return}for(const n of Object.keys(e).filter(o=>!FB.has(o)))t(n,e[n])}}function gs(e,t,n=!0,o=!1){ft(t)&&jce(t,(s,r)=>{let i=e[s];i!==r&&(o&&i==null&&r!=null&&typeof r=="object"&&r.constructor===Object&&(i={},e[s]=i),OB(r)&&OB(i)&&!Array.isArray(i)?gs(i,r,n,o):(n||r!==void 0)&&(e[s]=r))})}function OB(e){return typeof e=="object"&&e!==null}var w_=class Ga{static applyGlobalGridOptions(t){if(!Ga.gridOptions)return{...t};let n={};return gs(n,Ga.gridOptions,!0,!0),Ga.mergeStrategy==="deep"?gs(n,t,!0,!0):n={...n,...t},Ga.gridOptions.context&&(n.context=Ga.gridOptions.context),t.context&&(Ga.mergeStrategy==="deep"&&n.context&&gs(t.context,n.context,!0,!0),n.context=t.context),n}static applyGlobalGridOption(t,n){if(Ga.mergeStrategy==="deep"){const o=Kce(t);if(o&&typeof o=="object"&&typeof n=="object")return Ga.applyGlobalGridOptions({[t]:n})[t]}return n}};w_.gridOptions=void 0,w_.mergeStrategy="shallow";var C_=w_;function Kce(e){var t;return(t=C_.gridOptions)==null?void 0:t[e]}var qce={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:" ",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,enableStrictPivotColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressMoveWhenColumnDragging:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,cellFlashDuration:500,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,rowDragInsertDelay:500,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1,columnMenu:"new",reactiveCustomComponents:!0,suppressSetFilterByDefault:!1,rowNumbers:!1,enableFilterHandlers:!1},MB="https://www.ag-grid.com";function Al(e,t,...n){e.get("debug")&&console.log("AG Grid: "+t,...n)}function Vp(e,...t){v_(()=>console.warn("AG Grid: "+e,...t),e+(t==null?void 0:t.join("")))}function $d(e,...t){v_(()=>console.error("AG Grid: "+e,...t),e+(t==null?void 0:t.join("")))}var NB=new Set,Wy={},Hd={},zy,LB=!1,VB=!1,Yce=!1;function Xce(e){const[t,n]=e.version.split(".")||[],[o,s]=zy.split(".")||[];return t===o&&n===s}function Zce(e){var o;zy||(zy=e.version);const t=s=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${s} Please update all modules to the same version.`;e.version?Xce(e)||$d(t(`'${e.moduleName}' is version ${e.version} but the other modules are version ${zy}.`)):$d(t(`'${e.moduleName}' is incompatible.`));const n=(o=e.validate)==null?void 0:o.call(e);n&&!n.isValid&&$d(`${n.message}`)}function Bp(e,t,n=!1){n||(LB=!0),Zce(e);const o=e.rowModels??["all"];NB.add(e);let s;t!==void 0?(VB=!0,Hd[t]===void 0&&(Hd[t]={}),s=Hd[t]):s=Wy;for(const r of o)s[r]===void 0&&(s[r]={}),s[r][e.moduleName]=e;if(e.dependsOn)for(const r of e.dependsOn)Bp(r,t,n)}function Jce(e){delete Hd[e]}function b_(e,t,n){const o=s=>{var r,i,a;return!!((r=Wy[s])!=null&&r[e])||!!((a=(i=Hd[t])==null?void 0:i[s])!=null&&a[e])};return o(n)||o("all")}function S_(){return VB}function Qce(e,t){const n=Hd[e]??{};return[...Object.values(Wy.all??{}),...Object.values(n.all??{}),...Object.values(Wy[t]??{}),...Object.values(n[t]??{})]}function ede(){return new Set(NB)}function tde(){return LB}function BB(){return Yce}var nde=class{static register(e){Bp(e,void 0)}static registerModules(e){for(const t of e)Bp(t,void 0)}},ct="34.3.1",$B=2e3,HB=100,GB="_version_",jy=null,Gd=`${MB}/javascript-data-grid`;function ode(e){jy=e}function sde(e){Gd=e}function UB(e,t,n){return(jy==null?void 0:jy(e,t))??[lde(e,t,n)]}function E_(e,t,n,o,s){e(`${o?"warning":"error"} #${t}`,...UB(t,n,s))}function rde(e){if(!e)return String(e);const t={};for(const n of Object.keys(e))typeof e[n]!="object"&&typeof e[n]!="function"&&(t[n]=e[n]);return JSON.stringify(t)}function ide(e){let t=e;return e instanceof Error?t=e.toString():typeof e=="object"&&(t=rde(e)),t}function Ky(e){return e===void 0?"undefined":e===null?"null":e}function __(e,t){return`${e}?${t.toString()}`}function ade(e,t,n){const o=Array.from(t.entries()).sort((r,i)=>i[1].length-r[1].length);let s=__(e,t);for(const[r,i]of o){if(r===GB)continue;const a=s.length-n;if(a<=0)break;const l="...",u=a+l.length,c=i.length-u>HB?i.slice(0,i.length-u)+l:i.slice(0,HB)+l;t.set(r,c),s=__(e,t)}return s}function WB(e,t){const n=new URLSearchParams;if(n.append(GB,ct),t)for(const r of Object.keys(t))n.append(r,ide(t[r]));const o=`${Gd}/errors/${e}`,s=__(o,n);return s.length<=$B?s:ade(o,n,$B)}var lde=(e,t,n)=>{const o=WB(e,t),s=`${n?n+`
194
194
  `:""}Visit ${o}`;return BB()?s:`${s}${n?"":`
195
195
  Alternatively register the ValidationModule to see the full message in the console.`}`};function Qe(...e){E_(Vp,e[0],e[1],!0)}function _n(...e){E_($d,e[0],e[1],!1)}function $p(e,t,n){E_($d,e,t,!1,n)}function ude(e,t){const n=t[0];return`error #${n} `+UB(n,t[1],e).join(" ")}function Oi(...e){return ude(void 0,e)}function zB(e,t){return e.get("rowModelType")===t}function io(e,t){return zB(e,"clientSide")}function Ud(e,t){return zB(e,"serverSide")}function Xo(e,t){return e.get("domLayout")===t}function Ku(e){return Xy(e)!==void 0}function jB(e){return typeof e.get("getRowHeight")=="function"}function cde(e,t){return t?!e.get("enableStrictPivotColumnOrder"):e.get("maintainColumnOrder")}function Pl(e,t,n=!1,o){const{gos:s,environment:r}=e;if(o==null&&(o=r.getDefaultRowHeight()),jB(s)){if(n)return{height:o,estimated:!0};const l={node:t,data:t.data},u=s.getCallback("getRowHeight")(l);if(R_(u))return u===0&&Qe(23),{height:Math.max(1,u),estimated:!1}}if(t.detail&&s.get("masterDetail"))return dde(s);const i=s.get("rowHeight");return{height:i&&R_(i)?i:o,estimated:!1}}function dde(e){if(e.get("detailRowAutoHeight"))return{height:1,estimated:!1};const t=e.get("detailRowHeight");return R_(t)?{height:t,estimated:!1}:{height:300,estimated:!1}}function qu(e){const{environment:t,gos:n}=e,o=n.get("rowHeight");if(!o||Gn(o))return t.getDefaultRowHeight();const s=t.refreshRowHeightVariable();return s!==-1?s:(Qe(24),t.getDefaultRowHeight())}function R_(e){return!isNaN(e)&&typeof e=="number"&&isFinite(e)}function KB(e,t,n){const o=t[e.getDomDataKey()];return o?o[n]:void 0}function Yu(e,t,n,o){const s=e.getDomDataKey();let r=t[s];Gn(r)&&(r={},t[s]=r),r[n]=o}function Wd(e){return e.get("ensureDomOrder")?!1:e.get("animateRows")}function qB(e){return!(e.get("paginateChildRows")||e.get("groupHideOpenParents")||Xo(e,"print"))}function Mi(e){const t=e.get("autoGroupColumnDef");return!(t!=null&&t.comparator)&&!e.get("treeData")}function T_(e){const t=e.get("groupAggFiltering");if(typeof t=="function")return e.getCallback("groupAggFiltering");if(t===!0)return()=>!0}function YB(e){return e.get("grandTotalRow")}function XB(e,t){return t?!1:e.get("groupDisplayType")==="groupRows"}function ZB(e,t,n){return!!t.group&&!t.footer&&XB(e,n)}function zd(e){const t=e.getCallback("getRowId");return t===void 0?t:n=>{let o=t(n);return typeof o!="string"&&(v_(()=>Qe(25,{id:o}),"getRowIdString"),o=String(o)),o}}function hde(e,t){const n=e.get("groupHideParentOfSingleChild");return!!(n===!0||n==="leafGroupsOnly"&&t.leafGroup||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")&&t.leafGroup)}function fde(e){const t=e.get("maxConcurrentDatasourceRequests");return t>0?t:void 0}function jd(e){return(e==null?void 0:e.checkboxes)??!0}function qy(e){return(e==null?void 0:e.mode)==="multiRow"&&(e.headerCheckbox??!0)}function Yy(e){if(typeof e=="object")return e.checkboxLocation??"selectionColumn"}function D_(e){return(e==null?void 0:e.hideDisabledCheckboxes)??!1}function pde(e){return typeof e.get("rowSelection")!="string"}function Aa(e){const t=e.get("cellSelection");return t!==void 0?!!t:e.get("enableRangeSelection")}function JB(e){const t=e.get("rowSelection")??"single";if(typeof t=="string"){const n=e.get("suppressRowClickSelection"),o=e.get("suppressRowDeselection");return n&&o?!1:n?"enableDeselection":o?"enableSelection":!0}return t.mode==="singleRow"||t.mode==="multiRow"?t.enableClickSelection??!1:!1}function gde(e){const t=JB(e);return t===!0||t==="enableSelection"}function mde(e){const t=JB(e);return t===!0||t==="enableDeselection"}function I_(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("isRowSelectable"):t==null?void 0:t.isRowSelectable}function Xy(e){const t="beanName"in e&&e.beanName==="gos"?e.get("rowSelection"):e.rowSelection;if(typeof t=="string")switch(t){case"multiple":return"multiRow";case"single":return"singleRow";default:return}switch(t==null?void 0:t.mode){case"multiRow":case"singleRow":return t.mode;default:return}}function Hp(e){return Xy(e)==="multiRow"}function vde(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("rowMultiSelectWithClick"):(t==null?void 0:t.enableSelectionWithoutKeys)??!1}function Zy(e){const t=e.get("rowSelection");if(typeof t=="string"){const n=e.get("groupSelectsChildren"),o=e.get("groupSelectsFiltered");return n&&o?"filteredDescendants":n?"descendants":"self"}return(t==null?void 0:t.mode)==="multiRow"?t.groupSelects:void 0}function QB(e,t=!0){const n=e.get("rowSelection");return typeof n!="object"?t?"all":void 0:n.mode==="multiRow"?n.selectAll:"all"}function yde(e){const t=e.get("rowSelection");return typeof t=="string"?!1:(t==null?void 0:t.mode)==="multiRow"?t.ctrlASelectsRows??!1:!1}function Gp(e){const t=Zy(e);return t==="descendants"||t==="filteredDescendants"}function e2(e){const t=e.get("rowSelection");return typeof t=="object"&&t.masterSelects||"self"}function wde(e){return e.isModuleRegistered("SetFilter")&&!e.get("suppressSetFilterByDefault")}function Js(e){return e.get("columnMenu")==="legacy"}function Cde(e){return!Js(e)}function bde(e){return!e||e.length<2?e:"on"+e[0].toUpperCase()+e.substring(1)}function Nt(e,t){return e.addCommon(t)}function t2({gos:e},t){return t.button===2||t.ctrlKey&&e.get("allowContextMenuWithControlKey")}var Sde={resizable:!0,sortable:!0},Ede=0;function n2(){return Ede++}function kl(e){return e instanceof Xu}var Xu=class extends qe{constructor(e,t,n,o){super(),this.colDef=e,this.userProvidedColDef=t,this.colId=n,this.primary=o,this.isColumn=!0,this.instanceId=n2(),this.autoHeaderHeight=null,this.moving=!1,this.resizing=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.colEventSvc=new Wu,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.flex=null,this.colIdSanitised=Ip(n)}destroy(){var e;super.destroy(),(e=this.beans.rowSpanSvc)==null||e.deregister(this)}getInstanceId(){return this.instanceId}setState(){const{colDef:e,beans:{sortSvc:t,pinnedCols:n,colFlex:o}}=this;t==null||t.initCol(this);const s=e.hide;s!==void 0?this.visible=!s:this.visible=!e.initialHide,n==null||n.initCol(this),o==null||o.initCol(this)}setColDef(e,t,n){var s;const o=e.spanRows!==this.colDef.spanRows;this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),o&&((s=this.beans.rowSpanSvc)==null||s.deregister(this),this.initRowSpan()),this.dispatchColEvent("colDefChanged",n)}getUserProvidedColDef(){return this.userProvidedColDef}getParent(){return this.parent}getOriginalParent(){return this.originalParent}postConstruct(){this.setState(),this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip(),this.initRowSpan(),this.addPivotListener()}initDotNotation(){const{gos:e,colDef:{field:t,tooltipField:n}}=this,o=e.get("suppressFieldDotNotation");this.fieldContainsDots=ft(t)&&t.includes(".")&&!o,this.tooltipFieldContainsDots=ft(n)&&n.includes(".")&&!o}initMinAndMaxWidths(){const e=this.colDef;this.minWidth=e.minWidth??this.beans.environment.getDefaultColumnMinWidth(),this.maxWidth=e.maxWidth??Number.MAX_SAFE_INTEGER}initTooltip(){var e;(e=this.beans.tooltipSvc)==null||e.initCol(this)}initRowSpan(){var e;this.colDef.spanRows&&((e=this.beans.rowSpanSvc)==null||e.register(this))}addPivotListener(){const e=this.beans.pivotColDefSvc,t=this.colDef.pivotValueColumn;!e||!t||this.addManagedListeners(t,{colDefChanged:n=>{const o=e.recreateColDef(this.colDef);this.setColDef(o,o,n.source)}})}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){let t;const n=e.width,o=e.initialWidth;return n!=null?t=n:o!=null?t=o:t=200,Math.max(Math.min(t,this.maxWidth),this.minWidth)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){var t;return((t=this.beans.showRowGroupCols)==null?void 0:t.isRowGroupDisplayed(this,e))??!1}isPrimary(){return this.primary}isFilterAllowed(){return!!this.colDef.filter}isFieldContainsDots(){return this.fieldContainsDots}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}getHighlighted(){return this.highlighted}__addEventListener(e,t){this.colEventSvc.addEventListener(e,t)}__removeEventListener(e,t){this.colEventSvc.removeEventListener(e,t)}addEventListener(e,t){var o,s,r;this.frameworkEventListenerService=(s=(o=this.beans.frameworkOverrides).createLocalEventListenerWrapper)==null?void 0:s.call(o,this.frameworkEventListenerService,this.colEventSvc);const n=((r=this.frameworkEventListenerService)==null?void 0:r.wrap(e,t))??t;this.colEventSvc.addEventListener(e,n)}removeEventListener(e,t){var o;const n=((o=this.frameworkEventListenerService)==null?void 0:o.unwrap(e,t))??t;this.colEventSvc.removeEventListener(e,n)}createColumnFunctionCallbackParams(e){return Nt(this.gos,{node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){var t;return((t=this.beans.cellNavigation)==null?void 0:t.isSuppressNavigable(this,e))??!1}isCellEditable(e){var t;return((t=this.beans.editSvc)==null?void 0:t.isCellEditable({rowNode:e,column:this}))??!1}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(e){return this.isColumnFunc(e,this.colDef.rowDrag)}isDndSource(e){return this.isColumnFunc(e,this.colDef.dndSource)}isCellCheckboxSelection(e){var t;return((t=this.beans.selectionSvc)==null?void 0:t.isCellCheckboxSelection(this,e))??!1}isSuppressPaste(e){var t;return this.isColumnFunc(e,((t=this.colDef)==null?void 0:t.suppressPaste)??null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(e){return this.colDef[e]??Sde[e]}isColumnFunc(e,t){if(typeof t=="boolean")return t;if(typeof t=="function"){const n=this.createColumnFunctionCallbackParams(e);return t(n)}return!1}createColumnEvent(e,t){return Nt(this.gos,{type:e,column:this,columns:[this],source:t})}isMoving(){return this.moving}getSort(){return this.sort}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return this.sort==="asc"}isSortDescending(){return this.sort==="desc"}isSortNone(){return Gn(this.sort)}isSorting(){return ft(this.sort)}getSortIndex(){return this.sortIndex}isMenuVisible(){return this.menuVisible}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(e,t){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.dispatchColEvent("leftChanged",t))}isFilterActive(){return this.filterActive}isHovered(){var e;return Qe(261),!!((e=this.beans.colHover)!=null&&e.isHovered(this))}setFirstRightPinned(e,t){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.dispatchColEvent("firstRightPinnedChanged",t))}setLastLeftPinned(e,t){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.dispatchColEvent("lastLeftPinnedChanged",t))}isFirstRightPinned(){return this.firstRightPinned}isLastLeftPinned(){return this.lastLeftPinned}isPinned(){return this.pinned==="left"||this.pinned==="right"}isPinnedLeft(){return this.pinned==="left"}isPinnedRight(){return this.pinned==="right"}getPinned(){return this.pinned}setVisible(e,t){const n=e===!0;this.visible!==n&&(this.visible=n,this.dispatchColEvent("visibleChanged",t)),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){return!this.getColDef().suppressSpanHeaderHeight}getFirstRealParent(){let e=this.getOriginalParent();for(;e!=null&&e.isPadding();)e=e.getOriginalParent();return e}getColumnGroupPaddingInfo(){let e=this.getParent();if(!(e!=null&&e.isPadding()))return{numberOfParents:0,isSpanningTotal:!1};const t=e.getPaddingLevel()+1;let n=!0;for(;e;){if(!e.isPadding()){n=!1;break}e=e.getParent()}return{numberOfParents:t,isSpanningTotal:n}}getColDef(){return this.colDef}getDefinition(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}createBaseColDefParams(e){return Nt(this.gos,{node:e,data:e.data,colDef:this.colDef,column:this})}getColSpan(e){if(Gn(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),n=this.colDef.colSpan(t);return Math.max(n,1)}getRowSpan(e){if(Gn(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),n=this.colDef.rowSpan(t);return Math.max(n,1)}setActualWidth(e,t,n=!1){e=Math.max(e,this.minWidth),e=Math.min(e,this.maxWidth),this.actualWidth!==e&&(this.actualWidth=e,this.flex!=null&&t!=="flex"&&t!=="gridInitializing"&&(this.flex=null),n||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.dispatchColEvent("widthChanged",e)}isGreaterThanMax(e){return e>this.maxWidth}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex}isRowGroupActive(){return this.rowGroupActive}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}isValueActive(){return this.aggregationActive}isAllowPivot(){return this.colDef.enablePivot===!0}isAllowValue(){return this.colDef.enableValue===!0}isAllowRowGroup(){return this.colDef.enableRowGroup===!0}dispatchColEvent(e,t,n){const o=this.createColumnEvent(e,t);n&&gs(o,n),this.colEventSvc.dispatchEvent(o)}dispatchStateUpdatedEvent(e){this.colEventSvc.dispatchEvent({type:"columnStateUpdated",key:e})}};function ss(e){return e instanceof Jy}var Jy=class extends qe{constructor(e,t,n,o){super(),this.colGroupDef=e,this.groupId=t,this.padding=n,this.level=o,this.isColumn=!1,this.expandable=!1,this.instanceId=n2(),this.expandableListenerRemoveCallback=null,this.expanded=!!(e!=null&&e.openByDefault)}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0),super.destroy()}reset(e,t){this.colGroupDef=e,this.level=t,this.originalParent=null,this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback(),this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){return this.children?this.children.some(e=>e.isVisible()):!1}isPadding(){return this.padding}setExpanded(e){this.expanded=e===void 0?!1:e,this.dispatchLocalEvent({type:"expandedChanged"})}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(e){this.children=e}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}forEachLeafColumn(e){if(this.children)for(const t of this.children)kl(t)?e(t):ss(t)&&t.forEachLeafColumn(e)}addLeafColumns(e){if(this.children)for(const t of this.children)kl(t)?e.push(t):ss(t)&&t.addLeafColumns(e)}getColumnGroupShow(){const e=this.colGroupDef;if(e)return e.columnGroupShow}setupExpandable(){this.setExpandable(),this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback();const e=this.onColumnVisibilityChanged.bind(this);for(const t of this.getLeafColumns())t.__addEventListener("visibleChanged",e);this.expandableListenerRemoveCallback=()=>{for(const t of this.getLeafColumns())t.__removeEventListener("visibleChanged",e);this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let e=!1,t=!1,n=!1;const o=this.findChildrenRemovingPadding();for(let r=0,i=o.length;r<i;r++){const a=o[r];if(!a.isVisible())continue;const l=a.getColumnGroupShow();l==="open"?(e=!0,n=!0):l==="closed"?(t=!0,n=!0):(e=!0,t=!0)}const s=e&&t&&n;this.expandable!==s&&(this.expandable=s,this.dispatchLocalEvent({type:"expandableChanged"}))}findChildrenRemovingPadding(){const e=[],t=n=>{for(const o of n)ss(o)&&o.isPadding()?t(o.children):e.push(o)};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}},_de={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}};function o2(e,t,n){const o={},s=e.gos;return Object.assign(o,s.get("defaultColGroupDef")),Object.assign(o,t),s.validateColDef(o,n),o}var Rde=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=i_(e);let n=0;for(;;){let o=e??t;if(o?n!==0&&(o+="_"+n):o=n,!this.existingKeys[o]){const s=String(o);return e&&n>0&&Qe(273,{providedId:e,usedId:s}),this.existingKeys[s]=!0,s}n++}}};function kn(e){if(e!=null&&e.length)return e[e.length-1]}function Fl(e,t,n){if(e===t)return!0;if(!e||!t)return e==null&&t==null;const o=e.length;if(o!==t.length)return!1;for(let s=0;s<o;s++)if(e[s]!==t[s]&&!(n!=null&&n(e[s],t[s])))return!1;return!0}function Up(e,t){if(e)for(const n of e)t(n)}function ti(e,t){const n=e.indexOf(t);n>=0&&e.splice(n,1)}function s2(e,t,n){for(let o=0;o<t.length;o++)ti(e,t[o]);for(let o=t.length-1;o>=0;o--)e.splice(n,0,t[o])}var Qy="ag-Grid-AutoColumn",r2="ag-Grid-SelectionColumn",i2="ag-Grid-RowNumbersColumn";function a2(e){const t=[],n=o=>{for(let s=0;s<o.length;s++){const r=o[s];kl(r)?t.push(r):ss(r)&&n(r.getChildren())}};return n(e),t}function Pa(e){return e.reduce((t,n)=>t+n.getActualWidth(),0)}function ew(e,t,n){const o={};if(!t)return;Oa(null,t,r=>{o[r.getInstanceId()]=r}),n&&Oa(null,n,r=>{o[r.getInstanceId()]=null});const s=Object.values(o).filter(r=>r!=null);e.context.destroyBeans(s)}function x_(e){return e.getId().startsWith(Qy)}function ka(e){const t=typeof e=="string"?e:"getColId"in e?e.getColId():e.colId;return(t==null?void 0:t.startsWith(r2))??!1}function Fa(e){const t=typeof e=="string"?e:"getColId"in e?e.getColId():e.colId;return(t==null?void 0:t.startsWith(i2))??!1}function Tde(e){return ka(e)||Fa(e)}function tw(e){let t=[];return e instanceof Array?t=e:typeof e=="string"&&(t=e.split(",")),t}function Dde(e,t){return Fl(e,t,(n,o)=>n.getColId()===o.getColId())}function Ide(e){e.map={};for(const t of e.list)e.map[t.getId()]=t}function Kd(e){return e==="optionsUpdated"?"gridOptionsChanged":e}function Wp(e,t){const n=e===t,o=e.getColDef()===t,s=e.getColId()==t;return n||o||s}var xde=(e,t)=>(n,o)=>{const s={value1:void 0,value2:void 0};let r=!1;return e&&(e[n]!==void 0&&(s.value1=e[n],r=!0),ft(o)&&e[o]!==void 0&&(s.value2=e[o],r=!0)),!r&&t&&(t[n]!==void 0&&(s.value1=t[n]),ft(o)&&t[o]!==void 0&&(s.value2=t[o])),s},Ade=(e,t)=>{ss(e)&&e.setupExpandable(),e.originalParent=t};function Pde(e,t=null,n,o,s){const r=new Rde,{existingCols:i,existingGroups:a,existingColKeys:l}=kde(o);r.addExistingKeys(l);const u=l2(e,t,0,n,i,r,a,s),{colGroupSvc:c}=e,d=(c==null?void 0:c.findMaxDepth(u,0))??0,h=c?c.balanceColumnTree(u,0,d,r):u;return Oa(null,h,Ade),{columnTree:h,treeDepth:d}}function kde(e){const t=[],n=[],o=[];return e&&Oa(null,e,s=>{if(ss(s)){const r=s;n.push(r)}else{const r=s;o.push(r.getId()),t.push(r)}}),{existingCols:t,existingGroups:n,existingColKeys:o}}function l2(e,t,n,o,s,r,i,a){if(!t)return[];const{colGroupSvc:l}=e,u=new Array(t.length);for(let c=0;c<u.length;c++){const d=t[c];l&&Vde(d)?u[c]=l.createProvidedColumnGroup(o,d,n,s,r,i,a):u[c]=Fde(e,o,d,s,r,a)}return u}function Fde(e,t,n,o,s,r){var l;const i=Mde(n,o);i&&(o==null||o.splice(i.idx,1));let a=i==null?void 0:i.column;if(a){const u=A_(e,n,a.getColId());a.setColDef(u,n,r),Ode(e,a,u,r)}else{const u=s.getUniqueKey(n.colId,n.field),c=A_(e,n,u);a=new Xu(c,n,u,t),e.context.createBean(a)}return(l=e.dataTypeSvc)==null||l.addColumnListeners(a),a}function u2(e,t,n,o,s,r,i,a){const{sortSvc:l,pinnedCols:u,colFlex:c}=e;n!==void 0&&t.setVisible(!n,a),l&&(l.updateColSort(t,o,a),s!==void 0&&l.setColSortIndex(t,s)),r!==void 0&&(u==null||u.setColPinned(t,r)),i!==void 0&&(c==null||c.setColFlex(t,i))}function Ode(e,t,n,o){u2(e,t,n.hide,n.sort,n.sortIndex,n.pinned,n.flex,o);const s=t.getFlex();if(!(s!=null&&s>0))if(n.width!=null)t.setActualWidth(n.width,o);else{const r=t.getActualWidth();t.setActualWidth(r,o)}}function Mde(e,t){if(t)for(let n=0;n<t.length;n++){const o=t[n].getUserProvidedColDef();if(!o)continue;if(e.colId!=null){if(t[n].getId()===e.colId)return{idx:n,column:t[n]};continue}if(e.field!=null){if(o.field===e.field)return{idx:n,column:t[n]};continue}if(o===e)return{idx:n,column:t[n]}}}function A_(e,t,n,o){const{gos:s,dataTypeSvc:r}=e,i={},a=s.get("defaultColDef");gs(i,a,!1,!0);const l=Nde(e,i,t,n);l&&Lde(e,l,i);const u=i.cellDataType;gs(i,t,!1,!0),u!==void 0&&(i.cellDataType=u);const c=s.get("autoGroupColumnDef"),d=Mi(s);return t.rowGroup&&c&&d&&gs(i,{sort:c.sort,initialSort:c.initialSort},!1,!0),r&&(r.postProcess(i),r.validateColDef(i)),s.validateColDef(i,n,o),i}function Nde(e,t,n,o){var i;const s=(i=e.dataTypeSvc)==null?void 0:i.updateColDefAndGetColumnType(t,n,o),r=n.type??s??t.type;return t.type=r,r?tw(r):void 0}function Lde(e,t,n){if(!t.length)return;const o=Object.assign({},_de),s=e.gos.get("columnTypes")||{};for(const r of Object.keys(s)){const i=s[r];r in o?Qe(34,{key:r}):(i.type&&Qe(35),o[r]=i)}for(const r of t){const i=o[r.trim()];i?gs(n,i,!1,!0):Qe(36,{t:r})}}function Vde(e){return e.children!==void 0}function Oa(e,t,n){if(t)for(let o=0;o<t.length;o++){const s=t[o];ss(s)&&Oa(s,s.getChildren(),n),n(s,e)}}function c2(e,t){const n=[],o=[],s=[];return e.forEach(i=>{const a=i.getColDef().lockPosition;a==="right"?s.push(i):a==="left"||a===!0?n.push(i):o.push(i)}),t.get("enableRtl")?[...s,...o,...n]:[...n,...o,...s]}function d2(e,t){let n=!0;return Oa(null,t,o=>{if(!ss(o))return;const s=o,r=s.getColGroupDef();if(!(r==null?void 0:r.marryChildren))return;const a=[];for(const h of s.getLeafColumns()){const f=e.indexOf(h);a.push(f)}const l=Math.max.apply(Math,a),u=Math.min.apply(Math,a),c=l-u,d=s.getLeafColumns().length-1;c>d&&(n=!1)}),n}function h2(e,t){if(!e||e.length==0)return;const n=t(e[0]);for(let o=1;o<e.length;o++)if(n!==t(e[o]))return;return n}function f2(e,t,n){if(!t.length)return;const o=t.length===1?t[0]:null,s=h2(t,r=>r.getPinned());e.dispatchEvent({type:"columnPinned",pinned:s??null,columns:t,column:o,source:n})}function Bde(e,t,n){if(!t.length)return;const o=t.length===1?t[0]:null,s=h2(t,r=>r.isVisible());e.dispatchEvent({type:"columnVisible",visible:s,columns:t,column:o,source:n})}function $de(e,t,n,o){e.dispatchEvent({type:t,columns:n,column:n&&n.length==1?n[0]:null,source:o})}function qd(e,t,n,o,s=null){t!=null&&t.length&&e.dispatchEvent({type:"columnResized",columns:t,column:t.length===1?t[0]:null,flexColumns:s,finished:n,source:o})}function ni(e,t,n){var E;const{colModel:o,rowGroupColsSvc:s,pivotColsSvc:r,autoColSvc:i,selectionColSvc:a,colAnimation:l,visibleCols:u,pivotResultCols:c,environment:d,valueColsSvc:h,eventSvc:f,gos:p}=e,g=o.getColDefCols()??[],v=a==null?void 0:a.getColumns();if(!g.length&&!(v!=null&&v.length))return!1;if(t!=null&&t.state&&!t.state.forEach)return Qe(32),!1;const w=(_,I,T,F,V)=>{if(!_)return;const x=xde(I,t.defaultState),A=x("flex").value1;if(u2(e,_,x("hide").value1,x("sort").value1,x("sortIndex").value1,x("pinned").value1,A,n),A==null){const k=x("width").value1;if(k!=null){const M=_.getColDef().minWidth??d.getDefaultColumnMinWidth();M!=null&&k>=M&&_.setActualWidth(k,n)}}V||!_.isPrimary()||(h==null||h.syncColumnWithState(_,n,x),s==null||s.syncColumnWithState(_,n,x,T),r==null||r.syncColumnWithState(_,n,x,F))},S=(_,I,T)=>{var se,Z;const F=p2(e,n),V=I.slice(),x={},A={},k=[],M=[],N=[];let B=0;const z=(s==null?void 0:s.columns.slice())??[],oe=(r==null?void 0:r.columns.slice())??[];for(const P of _){const j=P.colId;if(j.startsWith(Qy)){k.push(P),N.push(P);continue}if(ka(j)){M.push(P),N.push(P);continue}const ge=T(j);ge?(w(ge,P,x,A,!1),ti(V,ge)):(N.push(P),B+=1)}const ie=P=>w(P,null,x,A,!1);V.forEach(ie),s==null||s.sortColumns(m2.bind(s,x,z)),r==null||r.sortColumns(m2.bind(r,A,oe)),o.refreshCols(!1,n);const te=(P,j,ne=[])=>{for(const ge of j){const xe=P(ge.colId);ti(ne,xe),w(xe,ge,null,null,!0)}ne.forEach(ie)};return te(P=>(i==null?void 0:i.getColumn(P))??null,k,(se=i==null?void 0:i.getColumns())==null?void 0:se.slice()),te(P=>(a==null?void 0:a.getColumn(P))??null,M,(Z=a==null?void 0:a.getColumns())==null?void 0:Z.slice()),Gde(t,o,p),u.refresh(n),f.dispatchEvent({type:"columnEverythingChanged",source:n}),F(),{unmatchedAndAutoStates:N,unmatchedCount:B}};l==null||l.start();let{unmatchedAndAutoStates:b,unmatchedCount:y}=S(t.state||[],g,_=>o.getColDefCol(_));if(b.length>0||ft(t.defaultState)){const _=((E=c==null?void 0:c.getPivotResultCols())==null?void 0:E.list)??[];y=S(b,_,I=>(c==null?void 0:c.getPivotResultCol(I))??null).unmatchedCount}return l==null||l.finish(),y===0}function Hde(e,t){var S,b;const{colModel:n,autoColSvc:o,selectionColSvc:s,eventSvc:r,gos:i}=e,a=n.getColDefCols();if(!(a!=null&&a.length))return;const l=n.getColDefColTree(),u=a2(l),c=[];let d=1e3,h=1e3;const f=y=>{const E=g2(y);Gn(E.rowGroupIndex)&&E.rowGroup&&(E.rowGroupIndex=d++),Gn(E.pivotIndex)&&E.pivot&&(E.pivotIndex=h++),c.push(E)};(S=o==null?void 0:o.getColumns())==null||S.forEach(f),(b=s==null?void 0:s.getColumns())==null||b.forEach(f),u==null||u.forEach(f),ni(e,{state:c},t);const p=(o==null?void 0:o.getColumns())??[],w=[...(s==null?void 0:s.getColumns())??[],...p,...a].map(y=>({colId:y.colId}));ni(e,{state:w,applyOrder:!0},t),r.dispatchEvent(Nt(i,{type:"columnsReset",source:t}))}function p2(e,t){const{rowGroupColsSvc:n,pivotColsSvc:o,valueColsSvc:s,colModel:r,sortSvc:i,eventSvc:a}=e,l={rowGroupColumns:(n==null?void 0:n.columns.slice())??[],pivotColumns:(o==null?void 0:o.columns.slice())??[],valueColumns:(s==null?void 0:s.columns.slice())??[]},u=nw(e),c={};for(const d of u)c[d.colId]=d;return()=>{const d=(_,I,T,F)=>{const V=I.map(F),x=T.map(F);if(Fl(V,x))return;const k=new Set(I);for(const N of T)k.delete(N)||k.add(N);const M=[...k];a.dispatchEvent({type:_,columns:M,column:M.length===1?M[0]:null,source:t})},h=_=>{const I=[];return r.forAllCols(T=>{const F=c[T.getColId()];F&&_(F,T)&&I.push(T)}),I},f=_=>_.getColId();d("columnRowGroupChanged",l.rowGroupColumns,(n==null?void 0:n.columns)??[],f),d("columnPivotChanged",l.pivotColumns,(o==null?void 0:o.columns)??[],f);const g=h((_,I)=>{const T=_.aggFunc!=null,F=T!=I.isValueActive(),V=T&&_.aggFunc!=I.getAggFunc();return F||V});g.length>0&&$de(a,"columnValueChanged",g,t),qd(a,h((_,I)=>_.width!=I.getActualWidth()),!0,t),f2(a,h((_,I)=>_.pinned!=I.getPinned()),t),Bde(a,h((_,I)=>_.hide==I.isVisible()),t);const y=h((_,I)=>_.sort!=I.getSort()||_.sortIndex!=I.getSortIndex());y.length>0&&(i==null||i.dispatchSortChangedEvents(t,y));const E=nw(e);Wde(u,E,t,r,a)}}function nw(e){const{colModel:t,rowGroupColsSvc:n,pivotColsSvc:o}=e,s=t.getColDefCols();if(Gn(s)||!t.isAlive())return[];const r=n==null?void 0:n.columns,i=o==null?void 0:o.columns,a=[],l=c=>{const d=c.isRowGroupActive()&&r?r.indexOf(c):null,h=c.isPivotActive()&&i?i.indexOf(c):null,f=c.isValueActive()?c.getAggFunc():null,p=c.getSort()!=null?c.getSort():null,g=c.getSortIndex()!=null?c.getSortIndex():null;a.push({colId:c.getColId(),width:c.getActualWidth(),hide:!c.isVisible(),pinned:c.getPinned(),sort:p,sortIndex:g,aggFunc:f,rowGroup:c.isRowGroupActive(),rowGroupIndex:d,pivot:c.isPivotActive(),pivotIndex:h,flex:c.getFlex()??null})};t.forAllCols(c=>l(c));const u=new Map(t.getCols().map((c,d)=>[c.getColId(),d]));return a.sort((c,d)=>{const h=u.has(c.colId)?u.get(c.colId):-1,f=u.has(d.colId)?u.get(d.colId):-1;return h-f}),a}function g2(e){const t=(p,g)=>p??g??null,n=e.getColDef(),o=t(n.sort,n.initialSort),s=t(n.sortIndex,n.initialSortIndex),r=t(n.hide,n.initialHide),i=t(n.pinned,n.initialPinned),a=t(n.width,n.initialWidth),l=t(n.flex,n.initialFlex);let u=t(n.rowGroupIndex,n.initialRowGroupIndex),c=t(n.rowGroup,n.initialRowGroup);u==null&&!c&&(u=null,c=null);let d=t(n.pivotIndex,n.initialPivotIndex),h=t(n.pivot,n.initialPivot);d==null&&!h&&(d=null,h=null);const f=t(n.aggFunc,n.initialAggFunc);return{colId:e.getColId(),sort:o,sortIndex:s,hide:r,pinned:i,width:a,flex:l,rowGroup:c,rowGroupIndex:u,pivot:h,pivotIndex:d,aggFunc:f}}function Gde(e,t,n){if(!e.applyOrder||!e.state)return;const o=[];for(const s of e.state)s.colId!=null&&o.push(s.colId);Ude(t.cols,o,t,n)}function Ude(e,t,n,o){if(e==null)return;let s=[];const r={};for(const a of t){if(r[a])continue;const l=e.map[a];l&&(s.push(l),r[a]=!0)}let i=0;for(const a of e.list){const l=a.getColId();if(r[l]!=null)continue;l.startsWith(Qy)?s.splice(i++,0,a):s.push(a)}if(s=c2(s,o),!d2(s,n.getColTree())){Qe(39);return}e.list=s}function Wde(e,t,n,o,s){const r={};for(const c of t)r[c.colId]=c;const i={};for(const c of e)r[c.colId]&&(i[c.colId]=!0);const a=e.filter(c=>i[c.colId]),l=t.filter(c=>i[c.colId]),u=[];l.forEach((c,d)=>{const h=a==null?void 0:a[d];if(h&&h.colId!==c.colId){const f=o.getCol(h.colId);f&&u.push(f)}}),u.length&&s.dispatchEvent({type:"columnMoved",columns:u,column:u.length===1?u[0]:null,finished:!0,source:n})}var m2=(e,t,n,o)=>{const s=e[n.getId()],r=e[o.getId()],i=s!=null,a=r!=null;if(i&&a)return s-r;if(i)return-1;if(a)return 1;const l=t.indexOf(n),u=t.indexOf(o),c=l>=0,d=u>=0;return c&&d?l-u:c?-1:1},zde=class extends qe{constructor(){super(...arguments),this.beanName="colModel",this.pivotMode=!1,this.ready=!1,this.changeEventsDispatching=!1}postConstruct(){this.pivotMode=this.gos.get("pivotMode"),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents","rowNumbers","hidePaddedHeaderRows"],e=>this.refreshAll(Kd(e.source))),this.addManagedPropertyListeners(["defaultColDef","defaultColGroupDef","columnTypes","suppressFieldDotNotation"],this.recreateColumnDefs.bind(this)),this.addManagedPropertyListener("pivotMode",e=>this.setPivotMode(this.gos.get("pivotMode"),Kd(e.source)))}createColsFromColDefs(e){var S,b,y;const{beans:t}=this,{valueCache:n,colAutosize:o,rowGroupColsSvc:s,pivotColsSvc:r,valueColsSvc:i,visibleCols:a,eventSvc:l,groupHierarchyColSvc:u}=t,c=this.colDefs?p2(t,e):void 0;n==null||n.expire();const d=(S=this.colDefCols)==null?void 0:S.list,h=(b=this.colDefCols)==null?void 0:b.tree,f=Pde(t,this.colDefs,!0,h,e);ew(t,(y=this.colDefCols)==null?void 0:y.tree,f.columnTree);const p=f.columnTree,g=f.treeDepth,v=a2(p),w={};for(const E of v)w[E.getId()]=E;this.colDefCols={tree:p,treeDepth:g,list:v,map:w},this.createColumnsForService([u],this.colDefCols,e),s==null||s.extractCols(e,d),r==null||r.extractCols(e,d),i==null||i.extractCols(e,d),this.ready=!0,this.refreshCols(!0,e),a.refresh(e),l.dispatchEvent({type:"columnEverythingChanged",source:e}),c&&(this.changeEventsDispatching=!0,c(),this.changeEventsDispatching=!1),l.dispatchEvent({type:"newColumnsLoaded",source:e}),e==="gridInitializing"&&(o==null||o.applyAutosizeStrategy())}refreshCols(e,t){var v;if(!this.colDefCols)return;const n=(v=this.cols)==null?void 0:v.tree;this.saveColOrder();const{autoColSvc:o,selectionColSvc:s,rowNumbersSvc:r,quickFilter:i,pivotResultCols:a,showRowGroupCols:l,rowAutoHeight:u,visibleCols:c,colViewport:d,eventSvc:h}=this.beans,f=this.selectCols(a,this.colDefCols);this.createColumnsForService([o,s,r],f,t);const p=cde(this.gos,this.showingPivotResult);(!e||p)&&this.restoreColOrder(f),this.positionLockedCols(f),l==null||l.refresh(),i==null||i.refreshCols(),this.setColSpanActive(),u==null||u.setAutoHeightActive(f),c.clear(),d.clear(),!Fl(n,this.cols.tree)&&h.dispatchEvent({type:"gridColumnsChanged"})}createColumnsForService(e,t,n){for(const o of e)o&&(o.createColumns(t,s=>{this.lastOrder=s(this.lastOrder),this.lastPivotOrder=s(this.lastPivotOrder)},n),o.addColumns(t))}selectCols(e,t){const n=(e==null?void 0:e.getPivotResultCols())??null;this.showingPivotResult=n!=null;const{map:o,list:s,tree:r,treeDepth:i}=n??t;return this.cols={list:s.slice(),map:{...o},tree:r.slice(),treeDepth:i},n&&(n.list.some(l=>{var u;return((u=this.cols)==null?void 0:u.map[l.getColId()])!==void 0})||(this.lastPivotOrder=null)),this.cols}getColsToShow(){if(!this.cols)return[];const{valueColsSvc:e,selectionColSvc:t,gos:n}=this.beans,o=this.isPivotMode()&&!this.showingPivotResult,s=t==null?void 0:t.isSelectionColumnEnabled(),r=n.get("rowNumbers"),i=e==null?void 0:e.columns;return this.cols.list.filter(l=>{const u=x_(l);if(o){const c=i==null?void 0:i.includes(l);return u||c||s&&ka(l)||r&&Fa(l)}else return u||l.isVisible()})}refreshAll(e){this.ready&&(this.refreshCols(!1,e),this.beans.visibleCols.refresh(e))}setColsVisible(e,t=!1,n){ni(this.beans,{state:e.map(o=>({colId:typeof o=="string"?o:o.getColId(),hide:!t}))},n)}restoreColOrder(e){const t=this.showingPivotResult?this.lastPivotOrder:this.lastOrder;if(!t)return;const n=t.filter(d=>e.map[d.getId()]!=null);if(n.length===0)return;if(n.length===e.list.length){e.list=n;return}const o=d=>{const h=d.getOriginalParent();return h?h.getChildren().length>1?!0:o(h):!1};if(!n.some(d=>o(d))){const d=new Set(n);for(const h of e.list)d.has(h)||n.push(h);e.list=n;return}const s=new Map;for(let d=0;d<n.length;d++){const h=n[d];s.set(h,d)}const r=e.list.filter(d=>!s.has(d));if(r.length===0){e.list=n;return}const i=(d,h)=>{const f=h?h.getOriginalParent():d.getOriginalParent();if(!f)return null;let p=null,g=null;for(const v of f.getChildren())if(!(v===h||v===d)){if(v instanceof Xu){const w=s.get(v);if(w==null)continue;(p==null||p<w)&&(p=w,g=v);continue}v.forEachLeafColumn(w=>{const S=s.get(w);S!=null&&(p==null||p<S)&&(p=S,g=w)})}return g??i(d,f)},a=[],l=new Map;for(const d of r){const h=i(d,null);if(h==null){a.push(d);continue}const f=l.get(h);f===void 0?l.set(h,d):Array.isArray(f)?f.push(d):l.set(h,[f,d])}const u=new Array(e.list.length);let c=u.length-1;for(let d=a.length-1;d>=0;d--)u[c--]=a[d];for(let d=n.length-1;d>=0;d--){const h=n[d],f=l.get(h);if(f)if(Array.isArray(f))for(let p=f.length-1;p>=0;p--){const g=f[p];u[c--]=g}else u[c--]=f;u[c--]=h}e.list=u}positionLockedCols(e){e.list=c2(e.list,this.gos)}saveColOrder(){var e,t;this.showingPivotResult?this.lastPivotOrder=((e=this.cols)==null?void 0:e.list)??null:this.lastOrder=((t=this.cols)==null?void 0:t.list)??null}getColumnDefs(e){var t,n;return this.colDefCols&&((n=this.beans.colDefFactory)==null?void 0:n.getColumnDefs(this.colDefCols.list,this.showingPivotResult,this.lastOrder,((t=this.cols)==null?void 0:t.list)??[],e))}setColSpanActive(){var e;this.colSpanActive=!!((e=this.cols)!=null&&e.list.some(t=>t.getColDef().colSpan!=null))}isPivotMode(){return this.pivotMode}setPivotMode(e,t){if(e===this.pivotMode||(this.pivotMode=e,!this.ready))return;this.refreshCols(!1,t);const{visibleCols:n,eventSvc:o}=this.beans;n.refresh(t),o.dispatchEvent({type:"columnPivotModeChanged"})}isPivotActive(){var t;const e=(t=this.beans.pivotColsSvc)==null?void 0:t.columns;return this.pivotMode&&!!(e!=null&&e.length)}recreateColumnDefs(e){var n;if(!this.cols)return;(n=this.beans.autoColSvc)==null||n.updateColumns(e);const t=Kd(e.source);this.createColsFromColDefs(t)}setColumnDefs(e,t){this.colDefs=e,this.createColsFromColDefs(t)}destroy(){var e;ew(this.beans,(e=this.colDefCols)==null?void 0:e.tree),super.destroy()}getColTree(){var e;return((e=this.cols)==null?void 0:e.tree)??[]}getColDefColTree(){var e;return((e=this.colDefCols)==null?void 0:e.tree)??[]}getColDefCols(){var e;return((e=this.colDefCols)==null?void 0:e.list)??null}getCols(){var e;return((e=this.cols)==null?void 0:e.list)??[]}forAllCols(e){var r,i,a,l,u;const{pivotResultCols:t,autoColSvc:n,selectionColSvc:o,groupHierarchyColSvc:s}=this.beans;Up((r=this.colDefCols)==null?void 0:r.list,e),Up((i=n==null?void 0:n.columns)==null?void 0:i.list,e),Up((a=o==null?void 0:o.columns)==null?void 0:a.list,e),Up((l=s==null?void 0:s.columns)==null?void 0:l.list,e),Up((u=t==null?void 0:t.getPivotResultCols())==null?void 0:u.list,e)}getColsForKeys(e){return e?e.map(t=>this.getCol(t)).filter(t=>t!=null):[]}getColDefCol(e){var t;return(t=this.colDefCols)!=null&&t.list?this.getColFromCollection(e,this.colDefCols):null}getCol(e){return e==null?null:this.getColFromCollection(e,this.cols)}getColById(e){var t;return((t=this.cols)==null?void 0:t.map[e])??null}getColFromCollection(e,t){if(t==null)return null;const{map:n,list:o}=t;if(typeof e=="string"&&n[e])return n[e];for(let a=0;a<o.length;a++)if(Wp(o[a],e))return o[a];const{autoColSvc:s,selectionColSvc:r,groupHierarchyColSvc:i}=this.beans;return(s==null?void 0:s.getColumn(e))??(r==null?void 0:r.getColumn(e))??(i==null?void 0:i.getColumn(e))??null}},v2=class{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let n;return typeof t!="number"?n=0:n=t+1,this.existingIds[e]=n,n}};function zp(e,t,n){return n&&e.addDestroyFunc(()=>t.destroyBean(n)),n??e}var dt=null;function y2(e){return typeof(e==null?void 0:e.getGui)=="function"}var w2=class{constructor(e){this.cssClassStates={},this.getGui=e}toggleCss(e,t){var o;if(!e)return;if(e.indexOf(" ")>=0){const s=(e||"").split(" ");if(s.length>1){for(const r of s)this.toggleCss(r,t);return}}this.cssClassStates[e]!==t&&e.length&&((o=this.getGui())==null||o.classList.toggle(e,t),this.cssClassStates[e]=t)}},jde=0,jp=class extends Fi{constructor(e,t){super(),this.suppressDataRefValidation=!1,this.displayed=!0,this.visible=!0,this.compId=jde++,this.cssManager=new w2(()=>this.eGui),this.componentSelectors=new Map((t??[]).map(n=>[n.selector,n])),e&&this.setTemplate(e)}preConstruct(){var t,n;this.wireTemplate(this.getGui());const e="component-"+((n=(t=Object.getPrototypeOf(this))==null?void 0:t.constructor)==null?void 0:n.name);for(const o of this.css??[])this.beans.environment.addGlobalCSS(o,e)}wireTemplate(e,t){e&&this.gos&&(this.applyElementsToComponent(e),this.createChildComponentsFromTags(e,t))}getCompId(){return this.compId}getDataRefAttribute(e){return e.getAttribute?e.getAttribute(TB):null}applyElementsToComponent(e,t,n,o=null){if(t===void 0&&(t=this.getDataRefAttribute(e)),t){const s=this[t];if(s===dt)this[t]=o??e;else{const r=n==null?void 0:n[t];if(!this.suppressDataRefValidation&&!r)throw new Error(`data-ref: ${t} on ${this.constructor.name} with ${s}`)}}}createChildComponentsFromTags(e,t){const n=[];for(const o of e.childNodes??[])n.push(o);for(const o of n){if(!(o instanceof HTMLElement))continue;const s=this.createComponentFromElement(o,r=>{const i=r.getGui();if(i)for(const a of o.attributes??[])i.setAttribute(a.name,a.value)},t);if(s){if(s.addItems&&o.children.length){this.createChildComponentsFromTags(o,t);const r=Array.prototype.slice.call(o.children);s.addItems(r)}this.swapComponentForNode(s,e,o)}else o.childNodes&&this.createChildComponentsFromTags(o,t)}}createComponentFromElement(e,t,n){const o=e.nodeName,s=this.getDataRefAttribute(e),r=o.indexOf("AG-")===0,i=r?this.componentSelectors.get(o):null;let a=null;if(i){const l=n&&s?n[s]:void 0;a=new i.component(l),a.setParentComponent(this),this.createBean(a,null,t)}else if(r)throw new Error(`selector: ${o}`);return this.applyElementsToComponent(e,s,n,a),a}swapComponentForNode(e,t,n){const o=e.getGui();t.replaceChild(o,n),t.insertBefore(document.createComment(n.nodeName),o),this.addDestroyFunc(this.destroyBean.bind(this,e))}activateTabIndex(e){const t=this.gos.get("tabIndex");e||(e=[]),e.length||e.push(this.getGui());for(const n of e)n.setAttribute("tabindex",t.toString())}setTemplate(e,t,n){let o;typeof e=="string"||e==null?o=c_(e):o=Mp(e),this.setTemplateFromElement(o,t,n)}setTemplateFromElement(e,t,n,o=!1){if(this.eGui=e,this.suppressDataRefValidation=o,t)for(let s=0;s<t.length;s++){const r=t[s];this.componentSelectors.set(r.selector,r)}this.wireTemplate(e,n)}getGui(){return this.eGui}getFocusableElement(){return this.eGui}getAriaElement(){return this.getFocusableElement()}setParentComponent(e){this.parentComponent=e}getParentComponent(){return this.parentComponent}setGui(e){this.eGui=e}queryForHtmlElement(e){return this.eGui.querySelector(e)}getContainerAndElement(e,t){let n=t;return e==null?null:(n||(n=this.eGui),f_(e)?{element:e,parent:n}:{element:e.getGui(),parent:n})}prependChild(e,t){const{element:n,parent:o}=this.getContainerAndElement(e,t)||{};!n||!o||o.insertAdjacentElement("afterbegin",n)}appendChild(e,t){const{element:n,parent:o}=this.getContainerAndElement(e,t)||{};!n||!o||o.appendChild(n)}isDisplayed(){return this.displayed}setVisible(e,t={}){if(e!==this.visible){this.visible=e;const{skipAriaHidden:n}=t;Dce(this.eGui,e,{skipAriaHidden:n})}}setDisplayed(e,t={}){if(e!==this.displayed){this.displayed=e;const{skipAriaHidden:n}=t;Un(this.eGui,e,{skipAriaHidden:n});const o={type:"displayChanged",visible:this.displayed};this.dispatchLocalEvent(o)}}destroy(){this.parentComponent&&(this.parentComponent=void 0),super.destroy()}addGuiEventListener(e,t,n){this.eGui.addEventListener(e,t,n),this.addDestroyFunc(()=>this.eGui.removeEventListener(e,t))}addCss(e){this.cssManager.toggleCss(e,!0)}removeCss(e){this.cssManager.toggleCss(e,!1)}toggleCss(e,t){this.cssManager.toggleCss(e,t)}registerCSS(e){this.css||(this.css=[]),this.css.push(e)}},Cn=class extends jp{};function C2(e){return typeof e=="object"&&!!e.component}function Kde(e,t){return new Yn(n=>{n(window.setInterval(e,t))})}var Yn=class Sg{constructor(t){this.status=0,this.resolution=null,this.waiters=[],t(n=>this.onDone(n),n=>this.onReject(n))}static all(t){return t.length?new Sg(n=>{let o=t.length;const s=new Array(o);t.forEach((r,i)=>{r.then(a=>{s[i]=a,o--,o===0&&n(s)})})}):Sg.resolve()}static resolve(t=null){return new Sg(n=>n(t))}then(t){return new Sg(n=>{this.status===1?n(t(this.resolution)):this.waiters.push(o=>n(t(o)))})}onDone(t){this.status=1,this.resolution=t;for(const n of this.waiters)n(t)}onReject(t){}};function qde(e){return e?e.prototype&&"getGui"in e.prototype:!1}function b2(e,t,n,o){const{name:s}=n;let r,i,a,l,u,c;if(t){const d=t,h=d[s+"Selector"],f=h?h(o):null,p=g=>{typeof g=="string"?r=g:g!=null&&g!==!0&&(e.isFrameworkComponent(g)?a=g:i=g)};f?(p(f.component),l=f.params,u=f.popup,c=f.popupPosition):p(d[s])}return{compName:r,jsComp:i,fwComp:a,paramsFromSelector:l,popupFromSelector:u,popupPositionFromSelector:c}}var Yde=class extends qe{constructor(){super(...arguments),this.beanName="userCompFactory"}wireBeans(e){this.agCompUtils=e.agCompUtils,this.registry=e.registry,this.frameworkCompWrapper=e.frameworkCompWrapper,this.gridOptions=e.gridOptions}getCompDetailsFromGridOptions(e,t,n,o=!1){return this.getCompDetails(this.gridOptions,e,t,n,o)}getCompDetails(e,t,n,o,s=!1){var b;const{name:r,cellRenderer:i}=t;let{compName:a,jsComp:l,fwComp:u,paramsFromSelector:c,popupFromSelector:d,popupPositionFromSelector:h}=b2(this.beans.frameworkOverrides,e,t,o),f,p;const g=y=>{const E=this.registry.getUserComponent(r,y);E&&(l=E.componentFromFramework?void 0:E.component,u=E.componentFromFramework?E.component:void 0,f=E.params,p=E.processParams)};if(a!=null&&g(a),l==null&&u==null&&n!=null&&g(n),l&&i&&!qde(l)&&(l=(b=this.agCompUtils)==null?void 0:b.adaptFunction(t,l)),!l&&!u){const{validation:y}=this.beans;s&&(a!==n||!n)?a?y!=null&&y.isProvidedUserComp(a)||_n(50,{compName:a}):n?y||_n(260,{...this.gos.getModuleErrorParams(),propName:r,compName:n}):_n(216,{name:r}):n&&!y&&_n(146,{comp:n});return}const v=this.mergeParams(e,t,o,c,f,p),w=l==null,S=l??u;return{componentFromFramework:w,componentClass:S,params:v,type:t,popupFromSelector:d,popupPositionFromSelector:h,newAgStackInstance:()=>this.newAgStackInstance(S,w,v,t)}}newAgStackInstance(e,t,n,o){var a;const s=!t;let r;s?r=new e:r=this.frameworkCompWrapper.wrap(e,o.mandatoryMethods,o.optionalMethods,o),this.createBean(r);const i=(a=r.init)==null?void 0:a.call(r,n);return i==null?Yn.resolve(r):i.then(()=>r)}mergeParams(e,t,n,o=null,s,r){const i={...n,...s},a=e,l=a==null?void 0:a[t.name+"Params"];if(typeof l=="function"){const u=l(n);gs(i,u)}else typeof l=="object"&&gs(i,l);return gs(i,o),r?r(i):i}},Xde={name:"dateComponent",mandatoryMethods:["getDate","setDate"],optionalMethods:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","refresh"]},Zde={name:"dragAndDropImageComponent",mandatoryMethods:["setIcon","setLabel"]},Jde={name:"headerComponent",optionalMethods:["refresh"]},Qde={name:"innerHeaderComponent"},ehe={name:"innerHeaderGroupComponent"},the={name:"headerGroupComponent"},nhe={name:"cellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},ohe={name:"loadingCellRenderer",cellRenderer:!0},she={name:"cellEditor",mandatoryMethods:["getValue"],optionalMethods:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},rhe={name:"loadingOverlayComponent",optionalMethods:["refresh"]},ihe={name:"noRowsOverlayComponent",optionalMethods:["refresh"]},ahe={name:"tooltipComponent"},P_={name:"filter",mandatoryMethods:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethods:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},lhe={name:"floatingFilterComponent",mandatoryMethods:["onParentModelChanged"],optionalMethods:["afterGuiAttached","refresh"]},uhe={name:"fullWidthCellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},che={name:"loadingCellRenderer",cellRenderer:!0},dhe={name:"groupRowRenderer",optionalMethods:["afterGuiAttached"],cellRenderer:!0},hhe={name:"detailCellRenderer",optionalMethods:["refresh"],cellRenderer:!0};function fhe(e,t){return e.getCompDetailsFromGridOptions(Zde,"agDragAndDropImage",t,!0)}function phe(e,t,n){return e.getCompDetails(t,Jde,"agColumnHeader",n)}function ghe(e,t,n){return e.getCompDetails(t,Qde,void 0,n)}function mhe(e,t){const n=t.columnGroup.getColGroupDef();return e.getCompDetails(n,the,"agColumnGroupHeader",t)}function vhe(e,t,n){return e.getCompDetails(t,ehe,void 0,n)}function yhe(e,t){return e.getCompDetailsFromGridOptions(uhe,void 0,t,!0)}function whe(e,t){return e.getCompDetailsFromGridOptions(che,"agLoadingCellRenderer",t,!0)}function Che(e,t){return e.getCompDetailsFromGridOptions(dhe,"agGroupRowRenderer",t,!0)}function bhe(e,t){return e.getCompDetailsFromGridOptions(hhe,"agDetailCellRenderer",t,!0)}function S2(e,t,n){return e.getCompDetails(t,nhe,void 0,n)}function E2(e,t,n){return e.getCompDetails(t,ohe,"agSkeletonCellRenderer",n,!0)}function _2(e,t,n){return e.getCompDetails(t,she,"agCellEditor",n,!0)}function She(e,t,n,o){const s=t.filter;return C2(s)&&(t={filter:s.component,filterParams:t.filterParams}),e.getCompDetails(t,P_,o,n,!0)}function Ehe(e,t,n){return e.getCompDetails(t,Xde,"agDateInput",n,!0)}function _he(e,t){return e.getCompDetailsFromGridOptions(rhe,"agLoadingOverlay",t,!0)}function Rhe(e,t){return e.getCompDetailsFromGridOptions(ihe,"agNoRowsOverlay",t,!0)}function The(e,t){return e.getCompDetails(t.colDef,ahe,"agTooltipComponent",t,!0)}function Dhe(e,t,n,o){return e.getCompDetails(t,lhe,o,n)}function R2(e,t){return b2(e,t,P_)}function k_(e,t,n){return e.mergeParams(t,P_,n)}function Kp(e){const t=e;return(t==null?void 0:t.getFrameworkComponentInstance)!=null?t.getFrameworkComponentInstance():e}function Ihe(e){return typeof e=="object"&&!!e.getComp}var Ve={BACKSPACE:"Backspace",TAB:"Tab",ENTER:"Enter",ESCAPE:"Escape",SPACE:" ",LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown",DELETE:"Delete",F2:"F2",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",PAGE_HOME:"Home",PAGE_END:"End",A:"KeyA",C:"KeyC",D:"KeyD",V:"KeyV",X:"KeyX",Y:"KeyY",Z:"KeyZ"},F_=class extends jp{isPopup(){return!0}setParentComponent(e){e.addCss("ag-has-popup"),super.setParentComponent(e)}destroy(){const e=this.parentComponent;(e==null?void 0:e.isAlive())&&e.getGui().classList.remove("ag-has-popup"),super.destroy()}},O_,M_,N_,L_,V_,B_,$_;function Ol(){return O_===void 0&&(O_=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),O_}function T2(){return M_===void 0&&(M_=/(firefox)/i.test(navigator.userAgent)),M_}function D2(){return N_===void 0&&(N_=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),N_}function Zu(){return L_===void 0&&(L_=/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1),L_}function H_(e){if(!e)return null;const t=e.tabIndex,n=e.getAttribute("tabIndex");return t===-1&&(n===null||n===""&&!T2())?null:t.toString()}function xhe(){if($_!==void 0)return $_;if(!document.body)return-1;let e=1e6;const t=T2()?6e6:1e9,n=document.createElement("div");for(document.body.appendChild(n);;){const o=e*2;if(n.style.height=o+"px",o>t||n.clientHeight!==o)break;e=o}return n.remove(),$_=e,e}function Ahe(){return B_==null&&I2(),B_}function I2(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let n=t.offsetWidth-t.clientWidth;n===0&&t.clientWidth===0&&(n=null),t.parentNode&&t.remove(),n!=null&&(B_=n,V_=n===0)}function x2(){return V_==null&&I2(),V_}var G_="T",Phe=new RegExp(`[${G_} ]`),khe=new RegExp(`^\\d{4}-\\d{2}-\\d{2}(${G_}\\d{2}:\\d{2}:\\d{2}\\D?)?`);function Ni(e,t){return e.toString().padStart(t,"0")}function Qs(e,t=!0,n=G_){if(!e)return null;let o=[e.getFullYear(),e.getMonth()+1,e.getDate()].map(s=>Ni(s,2)).join("-");return t&&(o+=n+[e.getHours(),e.getMinutes(),e.getSeconds()].map(s=>Ni(s,2)).join(":")),o}function ow(e,t=!0){return e?t?[String(e.getFullYear()),String(e.getMonth()+1),Ni(e.getDate(),2),Ni(e.getHours(),2),`:${Ni(e.getMinutes(),2)}`,`:${Ni(e.getSeconds(),2)}`]:[e.getFullYear(),e.getMonth()+1,Ni(e.getDate(),2)].map(String):null}var U_=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"},A2=["January","February","March","April","May","June","July","August","September","October","November","December"],W_=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function z_(e,t){if(t==null)return Qs(e,!1);const n=Ni(e.getFullYear(),4),o={YYYY:()=>n.slice(n.length-4,n.length),YY:()=>n.slice(n.length-2,n.length),Y:()=>`${e.getFullYear()}`,MMMM:()=>A2[e.getMonth()],MMM:()=>A2[e.getMonth()].slice(0,3),MM:()=>Ni(e.getMonth()+1,2),Mo:()=>`${e.getMonth()+1}${U_(e.getMonth()+1)}`,M:()=>`${e.getMonth()+1}`,Do:()=>`${e.getDate()}${U_(e.getDate())}`,DD:()=>Ni(e.getDate(),2),D:()=>`${e.getDate()}`,dddd:()=>W_[e.getDay()],ddd:()=>W_[e.getDay()].slice(0,3),dd:()=>W_[e.getDay()].slice(0,2),do:()=>`${e.getDay()}${U_(e.getDay())}`,d:()=>`${e.getDay()}`},s=new RegExp(Object.keys(o).join("|"),"g");return t.replace(s,r=>r in o?o[r]():r)}function sw(e,t=!1){return!!xs(e,t)}function Fhe(e){return sw(e,!0)}function xs(e,t=!1,n){if(!e||!n&&!khe.test(e))return null;const[o,s]=e.split(Phe);if(!o)return null;const r=o.split("-").map(f=>Number.parseInt(f,10));if(r.filter(f=>!isNaN(f)).length!==3)return null;const[i,a,l]=r,u=new Date(i,a-1,l);if(u.getFullYear()!==i||u.getMonth()!==a-1||u.getDate()!==l||!s&&t)return null;if(!s||s==="00:00:00")return u;const[c,d,h]=s.split(":").map(f=>Number.parseInt(f,10));if(c>=0&&c<24)u.setHours(c);else if(t)return null;if(d>=0&&d<60)u.setMinutes(d);else if(t)return null;if(h>=0&&h<60)u.setSeconds(h);else if(t)return null;return u}function j_(e){const{inputValue:t,allSuggestions:n,hideIrrelevant:o,filterByPercentageOfBestMatch:s}=e;let r=(n??[]).map((l,u)=>({value:l,relevance:Ohe(t,l),idx:u}));if(r.sort((l,u)=>l.relevance-u.relevance),o&&(r=r.filter(l=>l.relevance<Math.max(l.value.length,t.length))),r.length>0&&s&&s>0){const u=r[0].relevance*s;r=r.filter(c=>u-c.relevance<0)}const i=[],a=[];for(const l of r)i.push(l.value),a.push(l.idx);return{values:i,indices:a}}function Ohe(e,t){e.length<t.length&&([e,t]=[t,e]);let n=[],o=[];const s=e.length,r=t.length;for(let a=0;a<=r;a++)n[a]=a;let i=0;for(let a=1;a<=s;a++){o[0]=a;for(let l=1;l<=r;l++){const u=e[a-1],c=t[l-1];if(u.toLocaleLowerCase()===c.toLocaleLowerCase())++i,u===c&&++i,a>1&&l>1&&e[a-2].toLocaleLowerCase()===t[l-2].toLocaleLowerCase()&&(++i,e[a-2]===t[l-2]&&++i),a<s/2-10&&++i,o[l]=n[l-1];else{const d=o[l-1],h=n[l],f=n[l-1];o[l]=1+Math.min(d,h,f)}}[n,o]=[o,n]}return n[r]/(i+1)}function P2(e){var n;return e.altKey||e.ctrlKey||e.metaKey?!1:((n=e.key)==null?void 0:n.length)===1}var K_=!1,rw=0;function Mhe(e){rw>0||(e.addEventListener("keydown",iw),e.addEventListener("mousedown",iw))}function Nhe(e){rw>0||(e.removeEventListener("keydown",iw),e.removeEventListener("mousedown",iw))}function iw(e){const t=K_,n=e.type==="keydown";n&&(e.ctrlKey||e.metaKey||e.altKey)||t!==n&&(K_=n)}function Lhe(e){const t=Ho(e);return Mhe(t),rw++,()=>{rw--,Nhe(t)}}function Vhe(){return K_}function Yd(e,t,n=!1){const o=Tce;let s=wB;t&&(s+=", "+t),n&&(s+=', [tabindex="-1"]');const r=Array.prototype.slice.apply(e.querySelectorAll(o)).filter(l=>Pi(l)),i=Array.prototype.slice.apply(e.querySelectorAll(s));return i.length?((l,u)=>l.filter(c=>u.indexOf(c)===-1))(r,i):r}function Ju(e,t=!1,n=!1,o=!1){const s=Yd(e,o?".ag-tab-guard":null,n),r=t?kn(s):s[0];return r?(r.focus({preventScroll:!0}),!0):!1}function Qu(e,t,n,o){const s=Yd(t,n?':not([tabindex="-1"])':null),r=Kn(e);let i;n?i=s.findIndex(l=>l.contains(r)):i=s.indexOf(r);const a=i+(o?-1:1);return a<0||a>=s.length?null:s[a]}function k2(e,t=5){let n=0;for(;e&&H_(e)===null&&++n<=t;)e=e.parentElement;return H_(e)===null?null:e}var Bhe=".ag-label{white-space:nowrap}:where(.ag-ltr) .ag-label{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-label-align-right) .ag-label{order:1}:where(.ag-ltr) :where(.ag-label-align-right) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-rtl) :where(.ag-label-align-right) .ag-label{margin-right:var(--ag-spacing)}.ag-label-align-right>*{flex:none}.ag-label-align-top{align-items:flex-start;flex-direction:column;>*{align-self:stretch}}.ag-label-ellipsis{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(.ag-label-align-top) .ag-label{margin-bottom:calc(var(--ag-spacing)*.5)}",$he=class extends jp{constructor(e,t,n){super(t,n),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{},this.registerCSS(Bhe)}postConstruct(){this.addCss("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:n,labelAlignment:o,disabled:s}=this.config;s!=null&&this.setDisabled(s),e!=null&&this.setLabelSeparator(e),t!=null&&this.setLabel(t),n!=null&&this.setLabelWidth(n),this.setLabelAlignment(o||this.labelAlignment),this.refreshLabel()}refreshLabel(){const{label:e,eLabel:t}=this;qo(t),typeof e=="string"?t.innerText=e+this.labelSeparator:e&&t.appendChild(e),e===""?(Un(t,!1),Dl(t,"presentation")):(Un(t,!0),Dl(t,null))}setLabelSeparator(e){return this.labelSeparator===e?this:(this.labelSeparator=e,this.label!=null&&this.refreshLabel(),this)}getLabelId(){const e=this.eLabel;return e.id=e.id||`ag-${this.getCompId()}-label`,e.id}getLabel(){return this.label}setLabel(e){return this.label===e?this:(this.label=e,this.refreshLabel(),this)}setLabelAlignment(e){const n=this.getGui().classList;return n.toggle("ag-label-align-left",e==="left"),n.toggle("ag-label-align-right",e==="right"),n.toggle("ag-label-align-top",e==="top"),this}setLabelEllipsis(e){return this.eLabel.classList.toggle("ag-label-ellipsis",e),this}setLabelWidth(e){return this.label==null?this:(Gy(this.eLabel,e),this)}setDisabled(e){e=!!e;const t=this.getGui();return Pp(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}},F2=class extends $he{constructor(e,t,n,o){super(e,t,n),this.className=o}postConstruct(){super.postConstruct();const{width:e,value:t,onValueChange:n}=this.config;e!=null&&this.setWidth(e),t!=null&&this.setValue(t),n!=null&&this.onValueChange(n),this.className&&this.addCss(this.className),this.refreshAriaLabelledBy()}setLabel(e){return super.setLabel(e),this.refreshAriaLabelledBy(),this}refreshAriaLabelledBy(){const e=this.getAriaElement(),t=this.getLabelId(),n=this.getLabel();n==null||n==""||cce(e)!==null?xp(e,""):xp(e,t??"")}setAriaLabel(e){return Bd(this.getAriaElement(),e),this.refreshAriaLabelledBy(),this}onValueChange(e){return this.addManagedListeners(this,{fieldValueChanged:()=>e(this.getValue())}),this}getWidth(){return this.getGui().clientWidth}setWidth(e){return ki(this.getGui(),e),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(e,t){return this.value===e?this:(this.previousValue=this.value,this.value=e,t||this.dispatchLocalEvent({type:"fieldValueChanged"}),this)}};function Hhe(e){return{tag:"div",role:"presentation",children:[{tag:"div",ref:"eLabel",cls:"ag-input-field-label"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-input-wrapper",role:"presentation",children:[{tag:e,ref:"eInput",cls:"ag-input-field-input"}]}]}}var ec=class extends F2{constructor(e,t,n="text",o="input"){super(e,(e==null?void 0:e.template)??Hhe(o),[],t),this.inputType=n,this.displayFieldTag=o,this.eLabel=dt,this.eWrapper=dt,this.eInput=dt}postConstruct(){super.postConstruct(),this.setInputType(this.inputType);const{eLabel:e,eWrapper:t,eInput:n,className:o}=this;e.classList.add(`${o}-label`),t.classList.add(`${o}-input-wrapper`),n.classList.add(`${o}-input`),this.addCss("ag-input-field"),n.id=n.id||`ag-${this.getCompId()}-input`;const{inputName:s,inputWidth:r}=this.config;s!=null&&this.setInputName(s),r!=null&&this.setInputWidth(r),this.addInputListeners(),this.activateTabIndex([n])}addInputListeners(){this.addManagedElementListeners(this.eInput,{input:e=>this.setValue(e.target.value)})}setInputType(e){this.displayFieldTag==="input"&&(this.inputType=e,Zs(this.eInput,"type",e))}getInputElement(){return this.eInput}setInputWidth(e){return Gy(this.eWrapper,e),this}setInputName(e){return this.getInputElement().setAttribute("name",e),this}getFocusableElement(){return this.eInput}setMaxLength(e){const t=this.eInput;return t.maxLength=e,this}setInputPlaceholder(e){return Zs(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return Bd(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return Pp(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){if(e===!0)Zs(this.eInput,"autocomplete",null);else{const t=typeof e=="string"?e:"off";Zs(this.eInput,"autocomplete",t)}return this}},q_=class extends ec{constructor(e,t="ag-checkbox",n="checkbox"){super(e,t,n),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();const{readOnly:e,passive:t}=this.config;typeof e=="boolean"&&this.setReadOnly(e),typeof t=="boolean"&&this.setPassive(t)}addInputListeners(){this.addManagedElementListeners(this.eInput,{click:this.onCheckboxClick.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.toggle.bind(this)})}getNextValue(){return this.selected===void 0?!0:!this.selected}setPassive(e){this.passive=e}isReadOnly(){return this.readOnly}setReadOnly(e){this.eWrapper.classList.toggle("ag-disabled",e),this.eInput.disabled=e,this.readOnly=e}setDisabled(e){return this.eWrapper.classList.toggle("ag-disabled",e),super.setDisabled(e)}toggle(){if(this.eInput.disabled)return;const e=this.isSelected(),t=this.getNextValue();this.passive?this.dispatchChange(t,e):this.setValue(t)}getValue(){return this.isSelected()}setValue(e,t){return this.refreshSelectedClass(e),this.setSelected(e,t),this}setName(e){const t=this.getInputElement();return t.name=e,this}isSelected(){return this.selected}setSelected(e,t){if(this.isSelected()===e)return;this.previousValue=this.isSelected(),e=this.selected=typeof e=="boolean"?e:void 0;const n=this.eInput;n.checked=e,n.indeterminate=e===void 0,t||this.dispatchChange(this.selected,this.previousValue)}dispatchChange(e,t,n){this.dispatchLocalEvent({type:"fieldValueChanged",selected:e,previousValue:t,event:n});const o=this.getInputElement();this.eventSvc.dispatchEvent({type:"checkboxChanged",id:o.id,name:o.name,selected:e,previousValue:t})}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;const t=this.isSelected(),n=this.selected=e.target.checked;this.refreshSelectedClass(n),this.dispatchChange(n,t,e)}refreshSelectedClass(e){const t=this.eWrapper.classList;t.toggle("ag-checked",e===!0),t.toggle("ag-indeterminate",e==null)}},Y_={selector:"AG-CHECKBOX",component:q_},Ghe=class extends q_{constructor(e){super(e,"ag-radio-button","radio")}isSelected(){return this.eInput.checked}toggle(){this.eInput.disabled||this.isSelected()||this.setValue(!0)}addInputListeners(){super.addInputListeners(),this.addManagedEventListeners({checkboxChanged:this.onChange.bind(this)})}onChange(e){const t=this.eInput;e.selected&&e.name&&t.name&&t.name===e.name&&e.id&&t.id!==e.id&&this.setValue(!1,!0)}},tc=class extends ec{constructor(e,t="ag-text-field",n="text"){super(e,t,n)}postConstruct(){super.postConstruct(),this.config.allowedCharPattern&&this.preventDisallowedCharacters()}setValue(e,t){const n=this.eInput;return n.value!==e&&(n.value=ft(e)?e:""),super.setValue(e,t)}setStartValue(e){this.setValue(e,!0)}preventDisallowedCharacters(){const e=new RegExp(`[${this.config.allowedCharPattern}]`),t=n=>{P2(n)&&n.key&&!e.test(n.key)&&n.preventDefault()};this.addManagedListeners(this.eInput,{keydown:t,paste:n=>{var s;const o=(s=n.clipboardData)==null?void 0:s.getData("text");o!=null&&o.split("").some(r=>!e.test(r))&&n.preventDefault()}})}},aw={selector:"AG-INPUT-TEXT-FIELD",component:tc},Uhe=class extends ec{constructor(e){super(e,"ag-text-area",null,"textarea")}setValue(e,t){const n=super.setValue(e,t);return this.eInput.value=e,n}setCols(e){return this.eInput.cols=e,this}setRows(e){return this.eInput.rows=e,this}},Whe={selector:"AG-INPUT-TEXT-AREA",component:Uhe},X_=class extends tc{constructor(e){super(e,"ag-number-field","number")}postConstruct(){super.postConstruct();const e=this.eInput;this.addManagedListeners(e,{blur:()=>{const r=Number.parseFloat(e.value),i=isNaN(r)?"":this.normalizeValue(r.toString());this.value!==i&&this.setValue(i)},wheel:this.onWheel.bind(this)}),e.step="any";const{precision:t,min:n,max:o,step:s}=this.config;typeof t=="number"&&this.setPrecision(t),typeof n=="number"&&this.setMin(n),typeof o=="number"&&this.setMax(o),typeof s=="number"&&this.setStep(s)}onWheel(e){Kn(this.beans)===this.eInput&&e.preventDefault()}normalizeValue(e){return e===""?"":(this.precision!=null&&(e=this.adjustPrecision(e)),e)}adjustPrecision(e,t){const n=this.precision;if(n==null)return e;if(t){const s=Number.parseFloat(e).toFixed(n);return Number.parseFloat(s).toString()}const o=String(e).split(".");if(o.length>1){if(o[1].length<=n)return e;if(n>0)return`${o[0]}.${o[1].slice(0,n)}`}return o[0]}setMin(e){return this.min===e?this:(this.min=e,Zs(this.eInput,"min",e),this)}setMax(e){return this.max===e?this:(this.max=e,Zs(this.eInput,"max",e),this)}setPrecision(e){return this.precision=e,this}setStep(e){return this.step===e?this:(this.step=e,Zs(this.eInput,"step",e),this)}setValue(e,t){return this.setValueOrInputValue(n=>super.setValue(n,t),()=>this,e)}setStartValue(e){return this.setValueOrInputValue(t=>super.setValue(t,!0),t=>{this.eInput.value=t},e)}setValueOrInputValue(e,t,n){if(ft(n)){let o=this.isScientificNotation(n);if(o&&this.eInput.validity.valid)return e(n);if(!o){n=this.adjustPrecision(n);const s=this.normalizeValue(n);o=n!=s}if(o)return t(n)}return e(n)}getValue(){const e=this.eInput;if(!e.validity.valid)return;const t=e.value;return this.isScientificNotation(t)?this.adjustPrecision(t,!0):super.getValue()}isScientificNotation(e){return typeof e=="string"&&e.includes("e")}},zhe={selector:"AG-INPUT-NUMBER-FIELD",component:X_},jhe=class extends tc{constructor(e){super(e,"ag-date-field","date")}postConstruct(){super.postConstruct();const e=Ol();this.addManagedListeners(this.eInput,{wheel:this.onWheel.bind(this),mousedown:()=>{this.isDisabled()||e||this.eInput.focus()}}),this.eInput.step="any"}onWheel(e){Kn(this.beans)===this.eInput&&e.preventDefault()}setMin(e){const t=e instanceof Date?Qs(e??null,!!this.includeTime)??void 0:e;return this.min===t?this:(this.min=t,Zs(this.eInput,"min",t),this)}setMax(e){const t=e instanceof Date?Qs(e??null,!!this.includeTime)??void 0:e;return this.max===t?this:(this.max=t,Zs(this.eInput,"max",t),this)}setStep(e){return this.step===e?this:(this.step=e,Zs(this.eInput,"step",e),this)}setIncludeTime(e){return this.includeTime===e?this:(this.includeTime=e,super.setInputType(e?"datetime-local":"date"),e&&this.setStep(1),this)}getDate(){if(this.eInput.validity.valid)return xs(this.getValue())??void 0}setDate(e,t){this.setValue(Qs(e??null,this.includeTime),t)}},O2={selector:"AG-INPUT-DATE-FIELD",component:jhe},Khe=".ag-list-item{align-items:center;display:flex;height:var(--ag-list-item-height);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;&.ag-active-item{background-color:var(--ag-row-hover-color)}}",qhe="ag-active-item",Yhe=(e,t)=>({tag:"div",cls:`ag-list-item ag-${e}-list-item`,attrs:{role:"option"},children:[{tag:"span",ref:"eText",children:t}]}),Xhe=class extends jp{constructor(e,t,n){super(Yhe(e,t)),this.label=t,this.value=n,this.eText=dt}postConstruct(){this.createTooltip(),this.addEventListeners()}setHighlighted(e){const t=this.getGui();t.classList.toggle(qhe,e),vB(t,e),this.dispatchLocalEvent({type:"itemHighlighted",highlighted:e})}getHeight(){return this.getGui().clientHeight}setIndex(e,t){const n=this.getGui();mce(n,e),gce(n,t)}createTooltip(){const e={getTooltipValue:()=>this.label,getGui:()=>this.getGui(),getLocation:()=>"UNKNOWN",shouldDisplayTooltip:()=>d_(this.eText)},t=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("highlightTooltipFeature",!1,e,this));t&&(this.tooltipFeature=t)}addEventListeners(){const e=this.getParentComponent();e&&(this.addGuiEventListener("mouseover",()=>{e.highlightItem(this)}),this.addGuiEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation(),e.setValue(this.value)}))}},Zhe=class extends jp{constructor(e="default"){super({tag:"div",cls:`ag-list ag-${e}-list`}),this.cssIdentifier=e,this.options=[],this.listItems=[],this.highlightedItem=null,this.registerCSS(Khe)}postConstruct(){const e=this.getGui();this.addManagedElementListeners(e,{mouseleave:()=>this.clearHighlighted()})}handleKeyDown(e){const t=e.key;switch(t){case Ve.ENTER:if(!this.highlightedItem)this.setValue(this.getValue());else{const n=this.listItems.indexOf(this.highlightedItem);this.setValueByIndex(n)}break;case Ve.DOWN:case Ve.UP:e.preventDefault(),this.navigate(t);break;case Ve.PAGE_DOWN:case Ve.PAGE_UP:case Ve.PAGE_HOME:case Ve.PAGE_END:e.preventDefault(),this.navigateToPage(t);break}}addOptions(e){for(const t of e)this.addOption(t);return this}addOption(e){const{value:t,text:n}=e,o=n??t;return this.options.push({value:t,text:o}),this.renderOption(t,o),this.updateIndices(),this}clearOptions(){this.options=[],this.reset(!0);for(const e of this.listItems)e.destroy();qo(this.getGui()),this.listItems=[],this.refreshAriaRole()}setValue(e,t){if(this.value===e)return this.fireItemSelected(),this;if(e==null)return this.reset(t),this;const n=this.options.findIndex(o=>o.value===e);if(n!==-1){const o=this.options[n];this.value=o.value,this.displayValue=o.text,this.highlightItem(this.listItems[n]),t||this.fireChangeEvent()}return this}setValueByIndex(e){return this.setValue(this.options[e].value)}getValue(){return this.value}getDisplayValue(){return this.displayValue}refreshHighlighted(){this.clearHighlighted();const e=this.options.findIndex(t=>t.value===this.value);e!==-1&&this.highlightItem(this.listItems[e])}highlightItem(e){const t=e.getGui();if(!Pi(t))return;this.clearHighlighted(),e.setHighlighted(!0),this.highlightedItem=e;const n=this.getGui(),{scrollTop:o,clientHeight:s}=n,{offsetTop:r,offsetHeight:i}=t;(r+i>o+s||r<o)&&t.scrollIntoView({block:"nearest"})}hideItemTooltip(){var e,t;(t=(e=this.highlightedItem)==null?void 0:e.tooltipFeature)==null||t.attemptToHideTooltip()}destroy(){this.hideItemTooltip(),super.destroy()}reset(e){this.value=null,this.displayValue=null,this.clearHighlighted(),e||this.fireChangeEvent()}clearHighlighted(){var e;(e=this.highlightedItem)==null||e.setHighlighted(!1),this.highlightedItem=null}renderOption(e,t){const n=new Xhe(this.cssIdentifier,t,e);n.setParentComponent(this);const o=this.createManagedBean(n);this.listItems.push(o),this.getGui().appendChild(o.getGui())}navigate(e){const t=e===Ve.DOWN;let n;const{listItems:o,highlightedItem:s}=this;if(!s)n=t?o[0]:kn(o);else{let i=o.indexOf(s)+(t?1:-1);i=Math.min(Math.max(i,0),o.length-1),n=o[i]}this.highlightItem(n)}navigateToPage(e){const{listItems:t,highlightedItem:n}=this;if(!n||t.length===0)return;const o=t.indexOf(n),s=this.options.length-1,r=t[0].getHeight(),i=Math.floor(this.getGui().clientHeight/r);let a=-1;e===Ve.PAGE_HOME?a=0:e===Ve.PAGE_END?a=s:e===Ve.PAGE_DOWN?a=Math.min(o+i,s):e===Ve.PAGE_UP&&(a=Math.max(o-i,0)),a!==-1&&this.highlightItem(t[a])}refreshAriaRole(){Dl(this.getGui(),this.options.length===0?"presentation":"listbox")}updateIndices(){this.refreshAriaRole();const e=this.listItems,t=e.length;e.forEach((n,o)=>{n.setIndex(o+1,t)})}fireChangeEvent(){this.dispatchLocalEvent({type:"fieldValueChanged"}),this.fireItemSelected()}fireItemSelected(){this.dispatchLocalEvent({type:"selectedItem"})}},Jhe=".ag-picker-field-display{flex:1 1 auto}.ag-picker-field{align-items:center;display:flex}.ag-picker-field-icon{border:0;cursor:pointer;display:flex;margin:0;padding:0}.ag-picker-field-wrapper{background-color:var(--ag-picker-button-background-color);border:var(--ag-picker-button-border);border-radius:5px;min-height:max(var(--ag-list-item-height),calc(var(--ag-spacing)*4));overflow:hidden;&:where(.ag-picker-has-focus),&:where(:focus-within){background-color:var(--ag-picker-button-focus-background-color);border:var(--ag-picker-button-focus-border);box-shadow:var(--ag-focus-shadow);&:where(.invalid){box-shadow:var(--ag-focus-error-shadow)}}&:where(.invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}&:disabled{opacity:.5}}",Qhe={tag:"div",cls:"ag-picker-field",role:"presentation",children:[{tag:"div",ref:"eLabel"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-picker-field-wrapper ag-picker-collapsed",children:[{tag:"div",ref:"eDisplayField",cls:"ag-picker-field-display"},{tag:"div",ref:"eIcon",cls:"ag-picker-field-icon",attrs:{"aria-hidden":"true"}}]}]},efe=class extends F2{constructor(e){if(super(e,(e==null?void 0:e.template)||Qhe,(e==null?void 0:e.agComponents)||[],e==null?void 0:e.className),this.isPickerDisplayed=!1,this.skipClick=!1,this.pickerGap=4,this.hideCurrentPicker=null,this.eLabel=dt,this.eWrapper=dt,this.eDisplayField=dt,this.eIcon=dt,this.registerCSS(Jhe),this.ariaRole=e==null?void 0:e.ariaRole,this.onPickerFocusIn=this.onPickerFocusIn.bind(this),this.onPickerFocusOut=this.onPickerFocusOut.bind(this),!e)return;const{pickerGap:t,maxPickerHeight:n,variableWidth:o,minPickerWidth:s,maxPickerWidth:r}=e;t!=null&&(this.pickerGap=t),this.variableWidth=!!o,n!=null&&this.setPickerMaxHeight(n),s!=null&&this.setPickerMinWidth(s),r!=null&&this.setPickerMaxWidth(r)}postConstruct(){super.postConstruct(),this.setupAria();const e=`ag-${this.getCompId()}-display`;this.eDisplayField.setAttribute("id",e);const t=this.getAriaElement();this.addManagedElementListeners(t,{keydown:this.onKeyDown.bind(this)}),this.addManagedElementListeners(this.eLabel,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)}),this.addManagedElementListeners(this.eWrapper,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)});const{pickerIcon:n,inputWidth:o}=this.config;if(n){const s=this.beans.iconSvc.createIconNoSpan(n);s&&this.eIcon.appendChild(s)}o!=null&&this.setInputWidth(o)}setupAria(){const e=this.getAriaElement();e.setAttribute("tabindex",this.gos.get("tabIndex").toString()),l_(e,!1),this.ariaRole&&Dl(e,this.ariaRole)}onLabelOrWrapperMouseDown(e){if(e){const t=this.getFocusableElement();if(t!==this.eWrapper&&(e==null?void 0:e.target)===t)return;e.preventDefault(),this.getFocusableElement().focus()}if(this.skipClick){this.skipClick=!1;return}this.isDisabled()||(this.isPickerDisplayed?this.hidePicker():this.showPicker())}onKeyDown(e){switch(e.key){case Ve.UP:case Ve.DOWN:case Ve.ENTER:case Ve.SPACE:e.preventDefault(),this.onLabelOrWrapperMouseDown();break;case Ve.ESCAPE:this.isPickerDisplayed&&(e.preventDefault(),e.stopPropagation(),this.hideCurrentPicker&&this.hideCurrentPicker());break}}showPicker(){this.isPickerDisplayed=!0,this.pickerComponent||(this.pickerComponent=this.createPickerComponent());const e=this.pickerComponent.getGui();e.addEventListener("focusin",this.onPickerFocusIn),e.addEventListener("focusout",this.onPickerFocusOut),this.hideCurrentPicker=this.renderAndPositionPicker(),this.toggleExpandedStyles(!0)}renderAndPositionPicker(){const e=this.pickerComponent.getGui();this.gos.get("suppressScrollWhenPopupsAreOpen")||([this.destroyMouseWheelFunc]=this.addManagedEventListeners({bodyScroll:()=>{this.hidePicker()}}));const t=this.getLocaleTextFunc(),{config:{pickerAriaLabelKey:n,pickerAriaLabelValue:o,modalPicker:s=!0},maxPickerHeight:r,minPickerWidth:i,maxPickerWidth:a,variableWidth:l,beans:u,eWrapper:c}=this,d={modal:s,eChild:e,closeOnEsc:!0,closedCallback:()=>{const g=cB(u);this.beforeHidePicker(),g&&this.isAlive()&&this.getFocusableElement().focus()},ariaLabel:t(n,o),anchorToElement:c};e.style.position="absolute";const h=u.popupSvc,f=h.addPopup(d);l?(i&&(e.style.minWidth=i),e.style.width=h_(Vy(c)),a&&(e.style.maxWidth=a)):Gy(e,a??Vy(c));const p=r??`${u_(h.getPopupParent())}px`;return e.style.setProperty("max-height",p),this.alignPickerToComponent(),f.hideFunc}alignPickerToComponent(){if(!this.pickerComponent)return;const{pickerGap:e,config:{pickerType:t},beans:{popupSvc:n,gos:o},eWrapper:s,pickerComponent:r}=this,i=o.get("enableRtl")?"right":"left";n.positionPopupByComponent({type:t,eventSource:s,ePopup:r.getGui(),position:"under",alignSide:i,keepWithinBounds:!0,nudgeY:e})}beforeHidePicker(){this.destroyMouseWheelFunc&&(this.destroyMouseWheelFunc(),this.destroyMouseWheelFunc=void 0),this.toggleExpandedStyles(!1);const e=this.pickerComponent.getGui();e.removeEventListener("focusin",this.onPickerFocusIn),e.removeEventListener("focusout",this.onPickerFocusOut),this.isPickerDisplayed=!1,this.pickerComponent=void 0,this.hideCurrentPicker=null}toggleExpandedStyles(e){if(!this.isAlive())return;const t=this.getAriaElement();l_(t,e);const n=this.eWrapper.classList;n.toggle("ag-picker-expanded",e),n.toggle("ag-picker-collapsed",!e)}onPickerFocusIn(){this.togglePickerHasFocus(!0)}onPickerFocusOut(e){var t;(t=this.pickerComponent)!=null&&t.getGui().contains(e.relatedTarget)||this.togglePickerHasFocus(!1)}togglePickerHasFocus(e){this.pickerComponent&&this.eWrapper.classList.toggle("ag-picker-has-focus",e)}hidePicker(){this.hideCurrentPicker&&(this.hideCurrentPicker(),this.dispatchLocalEvent({type:"pickerHidden"}))}setInputWidth(e){return Gy(this.eWrapper,e),this}getFocusableElement(){return this.eWrapper}setPickerGap(e){return this.pickerGap=e,this}setPickerMinWidth(e){return typeof e=="number"&&(e=`${e}px`),this.minPickerWidth=e??void 0,this}setPickerMaxWidth(e){return typeof e=="number"&&(e=`${e}px`),this.maxPickerWidth=e??void 0,this}setPickerMaxHeight(e){return typeof e=="number"&&(e=`${e}px`),this.maxPickerHeight=e??void 0,this}destroy(){this.hidePicker(),super.destroy()}},tfe=".ag-select{align-items:center;display:flex;&.ag-disabled{opacity:.5}}:where(.ag-select){.ag-picker-field-wrapper{cursor:default}&.ag-disabled .ag-picker-field-wrapper:focus{box-shadow:none}&:not(.ag-cell-editor,.ag-label-align-top){min-height:var(--ag-list-item-height)}.ag-picker-field-display{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-picker-field-icon{align-items:center;display:flex}}:where(.ag-ltr) :where(.ag-select){.ag-picker-field-wrapper{padding-left:calc(var(--ag-cell-horizontal-padding)/2);padding-right:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-select){.ag-picker-field-wrapper{padding-left:var(--ag-spacing);padding-right:calc(var(--ag-cell-horizontal-padding)/2)}}.ag-select-list{background-color:var(--ag-picker-list-background-color);border:var(--ag-picker-list-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);overflow:hidden auto}.ag-select-list-item{cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;:where(span){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}:where(.ag-ltr) .ag-select-list-item{padding-left:calc(var(--ag-cell-horizontal-padding)/2)}:where(.ag-rtl) .ag-select-list-item{padding-right:calc(var(--ag-cell-horizontal-padding)/2)}",Z_=class extends efe{constructor(e){super({pickerAriaLabelKey:"ariaLabelSelectField",pickerAriaLabelValue:"Select Field",pickerType:"ag-list",className:"ag-select",pickerIcon:"selectOpen",ariaRole:"combobox",...e}),this.registerCSS(tfe)}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("tooltipFeature",!1,{shouldDisplayTooltip:Hy(()=>this.eDisplayField),getGui:()=>this.getGui()})),super.postConstruct(),this.createListComponent(),this.eWrapper.tabIndex=this.gos.get("tabIndex");const{options:e,value:t,placeholder:n}=this.config;e!=null&&this.addOptions(e),t!=null&&this.setValue(t,!0),n&&t==null&&(this.eDisplayField.textContent=n),this.addManagedElementListeners(this.eWrapper,{focusout:this.onWrapperFocusOut.bind(this)})}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}createListComponent(){const e=this.createBean(new Zhe("select"));this.listComponent=e,e.setParentComponent(this);const t=e.getAriaElement(),n=`ag-select-list-${e.getCompId()}`;t.setAttribute("id",n),Rce(this.getAriaElement(),t),e.addManagedElementListeners(e.getGui(),{mousedown:o=>{o==null||o.preventDefault()}}),e.addManagedListeners(e,{selectedItem:()=>{this.hidePicker(),this.dispatchLocalEvent({type:"selectedItem"})},fieldValueChanged:()=>{this.listComponent&&(this.setValue(this.listComponent.getValue(),!1,!0),this.hidePicker())}})}createPickerComponent(){return this.listComponent}beforeHidePicker(){var e;(e=this.listComponent)==null||e.hideItemTooltip(),super.beforeHidePicker()}onKeyDown(e){var n;const{key:t}=e;switch(t===Ve.TAB&&this.hidePicker(),t){case Ve.ENTER:case Ve.UP:case Ve.DOWN:case Ve.PAGE_UP:case Ve.PAGE_DOWN:case Ve.PAGE_HOME:case Ve.PAGE_END:e.preventDefault(),this.isPickerDisplayed?(n=this.listComponent)==null||n.handleKeyDown(e):super.onKeyDown(e);break;case Ve.ESCAPE:super.onKeyDown(e);break;case Ve.SPACE:this.isPickerDisplayed?e.preventDefault():super.onKeyDown(e);break}}showPicker(){const e=this.listComponent;e&&(super.showPicker(),e.refreshHighlighted())}addOptions(e){for(const t of e)this.addOption(t);return this}addOption(e){return this.listComponent.addOption(e),this}clearOptions(){var e;return(e=this.listComponent)==null||e.clearOptions(),this.setValue(void 0,!0),this}setValue(e,t,n){const{listComponent:o,config:{placeholder:s},eDisplayField:r,tooltipFeature:i}=this;if(this.value===e||!o)return this;if(n||o.setValue(e,!0),o.getValue()===this.getValue())return this;let l=o.getDisplayValue();return l==null&&s&&(l=s),r.textContent=l,i==null||i.setTooltipAndRefresh(l??null),super.setValue(e,t)}destroy(){this.listComponent=this.destroyBean(this.listComponent),super.destroy()}},nfe={selector:"AG-SELECT",component:Z_},ofe=':where(.ag-root-wrapper,.ag-external,.ag-popup,.ag-dnd-ghost,.ag-chart),:where(.ag-root-wrapper,.ag-external,.ag-popup,.ag-dnd-ghost,.ag-chart) :where([class^=ag-]){box-sizing:border-box;&:after,&:before{box-sizing:border-box}&:where(div,span,label):focus-visible{box-shadow:inset var(--ag-focus-shadow);outline:none;&:where(.invalid){box-shadow:inset var(--ag-focus-error-shadow)}}&:where(button){color:inherit}}:where(.ag-root-wrapper,ag-external,.ag-popup,.ag-dnd-ghost,.ag-chart) :where([class^=ag-]) ::-ms-clear{display:none}.ag-hidden{display:none!important}.ag-invisible{visibility:hidden!important}.ag-popup-child{top:0;z-index:5;&:where(:not(.ag-tooltip-custom)){box-shadow:var(--ag-popup-shadow)}}.ag-input-wrapper,.ag-picker-field-wrapper{align-items:center;display:flex;flex:1 1 auto;line-height:normal;position:relative}.ag-input-field{align-items:center;display:flex;flex-direction:row}.ag-input-field-input:where(:not([type=checkbox],[type=radio])){flex:1 1 auto;min-width:0;width:100%}.ag-chart,.ag-dnd-ghost,.ag-external,.ag-popup,.ag-root-wrapper{cursor:default;line-height:normal;white-space:normal;-webkit-font-smoothing:antialiased;background-color:var(--ag-background-color);color:var(--ag-text-color);color-scheme:var(--ag-browser-color-scheme);font-family:var(--ag-font-family);font-size:var(--ag-font-size);--ag-indentation-level:0}:where(.ag-icon):before{align-items:center;background-color:currentcolor;color:inherit;content:"";display:flex;font-family:inherit;font-size:var(--ag-icon-size);font-style:normal;font-variant:normal;height:var(--ag-icon-size);justify-content:center;line-height:var(--ag-icon-size);-webkit-mask-size:contain;mask-size:contain;text-transform:none;width:var(--ag-icon-size)}.ag-icon{background-position:50%;background-repeat:no-repeat;background-size:contain;color:var(--ag-icon-color);display:block;height:var(--ag-icon-size);position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--ag-icon-size)}.ag-disabled,[disabled]{.ag-icon{opacity:.5}&.ag-icon-grip{opacity:.35}}.ag-resizer{pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:1}:where(.ag-resizer){&.ag-resizer-topLeft{cursor:nwse-resize;height:5px;left:0;top:0;width:5px}&.ag-resizer-top{cursor:ns-resize;height:5px;left:5px;right:5px;top:0}&.ag-resizer-topRight{cursor:nesw-resize;height:5px;right:0;top:0;width:5px}&.ag-resizer-right{bottom:5px;cursor:ew-resize;right:0;top:5px;width:5px}&.ag-resizer-bottomRight{bottom:0;cursor:nwse-resize;height:5px;right:0;width:5px}&.ag-resizer-bottom{bottom:0;cursor:ns-resize;height:5px;left:5px;right:5px}&.ag-resizer-bottomLeft{bottom:0;cursor:nesw-resize;height:5px;left:0;width:5px}&.ag-resizer-left{bottom:5px;cursor:ew-resize;left:0;top:5px;width:5px}}',J_=typeof window!="object"||!((GG=(HG=window==null?void 0:window.document)==null?void 0:HG.fonts)!=null&&GG.forEach),Xd=(e,t,n,o,s,r)=>{if(J_)return;o&&(e=`@layer ${CSS.escape(o)} { ${e} }`);let i=Zd.map.get(t);if(i||(i=[],Zd.map.set(t,i)),i.some(c=>c.css===e))return;const a=document.createElement("style");r&&a.setAttribute("nonce",r),a.dataset.agGlobalCss=n,a.textContent=e;const l={css:e,el:a,priority:s};let u;for(const c of i){if(c.priority>s)break;u=c}if(u){u.el.insertAdjacentElement("afterend",a);const c=i.indexOf(u);i.splice(c+1,0,l)}else t.insertBefore(a,t.querySelector(":not(title, meta)")),i.push(l)},M2=(e,t,n,o)=>{Xd(ofe,e,"shared",t,0,n),o==null||o.forEach((s,r)=>s.forEach(i=>Xd(i,e,r,t,0,n)))},sfe=e=>{Zd.grids.add(e)},rfe=e=>{if(Zd.grids.delete(e),Zd.grids.size===0){Zd.map=new WeakMap;for(const t of document.head.querySelectorAll("style[data-ag-global-css]"))t.remove()}},N2,Zd=(N2=typeof window=="object"?window:{}).agStyleInjectionState??(N2.agStyleInjectionState={map:new WeakMap,grids:new Set}),Li=e=>new L2(e),Ml="$default",ife=0,L2=class{constructor({feature:e,params:t,modeParams:n={},css:o,cssImports:s}){this.feature=e,this.css=o,this.cssImports=s,this.modeParams={[Ml]:{...n[Ml]??{},...t??{}},...n}}use(e,t,n){let o=this._inject;if(o==null){let{css:s}=this;if(s){const r=`ag-theme-${this.feature??"part"}-${++ife}`;typeof s=="function"&&(s=s()),s=`:where(.${r}) {
196
196
  ${s}
@@ -252,5 +252,5 @@ If you are trying to annotate ${o} with application data, use the '${o}.context'
252
252
  `)}},eEe={moduleName:"ClientSideRowModelFilter",version:ct,rowModels:["clientSide"],beans:[tSe]},lT={moduleName:"FilterCore",version:ct,beans:[ESe],apiFunctions:{isAnyFilterPresent:bSe,onFilterChanged:SSe},css:[aSe],dependsOn:[eEe]},rG={moduleName:"FilterValue",version:ct,beans:[RSe]},Nw={moduleName:"ColumnFilter",version:ct,beans:[CSe,_Se],dynamicBeans:{headerFilterCellCtrl:nSe},icons:{filter:"filter",filterActive:"filter"},apiFunctions:{isColumnFilterPresent:lSe,getColumnFilterInstance:uSe,destroyFilter:cSe,setFilterModel:dSe,getFilterModel:hSe,getColumnFilterModel:fSe,setColumnFilterModel:pSe,showColumnFilter:gSe,hideColumnFilter:mSe,getColumnFilterHandler:vSe,doFilterAction:ySe},dependsOn:[lT,Ow,rG,rSe]},tEe={moduleName:"CustomFilter",version:ct,userComponents:{agReadOnlyFloatingFilter:DSe},dependsOn:[Nw]},nEe={moduleName:"TextFilter",version:ct,dependsOn:[Nw],userComponents:{agTextColumnFilter:{classImp:WSe,params:{useForm:!0}},agTextColumnFloatingFilter:YSe},dynamicBeans:{agTextColumnFilterHandler:qSe}},oEe={moduleName:"NumberFilter",version:ct,dependsOn:[Nw],userComponents:{agNumberColumnFilter:{classImp:BSe,params:{useForm:!0}},agNumberColumnFloatingFilter:USe},dynamicBeans:{agNumberColumnFilterHandler:$Se}},sEe={moduleName:"DateFilter",version:ct,dependsOn:[Nw],userComponents:{agDateColumnFilter:{classImp:PSe,params:{useForm:!0}},agDateInput:VSe,agDateColumnFloatingFilter:NSe},dynamicBeans:{agDateColumnFilterHandler:OSe}},rEe={moduleName:"QuickFilterCore",version:ct,rowModels:["clientSide"],beans:[QSe],dependsOn:[lT,rG]},iEe={moduleName:"QuickFilter",version:ct,apiFunctions:{isQuickFilterPresent:XSe,getQuickFilter:ZSe,resetQuickFilter:JSe},dependsOn:[rEe]},aEe={moduleName:"ExternalFilter",version:ct,dependsOn:[lT]},lEe=".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}}",uT=(e,t,n)=>{var a,l,u;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=(u=o==null?void 0:o.getRowValidationModel().getRowValidation(t))==null?void 0:u.errorMessages,i=s||r;return i!=null&&i.length?i.join(n("tooltipValidationErrorSeparator",". ")):void 0},uEe=class extends qe{constructor(){super(...arguments),this.beanName="tooltipSvc"}setupHeaderTooltip(e,t,n,o){e&&t.destroyBean(e);const s=this.gos,r=JR(s),{column:i,eGui:a}=t,l=i.getColDef();!o&&r&&!l.headerComponent&&(o=Hy(()=>a.querySelector(".ag-header-cell-text")));const u="header",d=this.beans.colNames.getDisplayNameForColumn(i,"header",!0),h=n??d,f={getGui:()=>a,getLocation:()=>u,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,Nt(s,{location:u,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=JR(s),{column:i,eGui:a}=t,l=i.getColGroupDef();!o&&r&&!(l!=null&&l.headerGroupComponent)&&(o=Hy(()=>a.querySelector(".ag-header-group-text")));const u="headerGroup",d=this.beans.colNames.getDisplayNameForColumnGroup(i,"header"),h=n??d,f={getGui:()=>a,getLocation:()=>u,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,Nt(s,{location:u,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 u=()=>{const f=!!!(r!=null&&r.isEditing(e))&&uT(o,e,this.getLocaleTextFunc());if(f)return l="cellEditor",f;l="cell";const p=i.getColDef(),g=a.data;if(p.tooltipField&&ft(g))return ng(g,p.tooltipField,i.isTooltipFieldContainsDots());const v=p.tooltipValueGetter;return v?v(Nt(s,{location:"cell",colDef:i.getColDef(),column:i,rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,value:e.value,valueFormatted:e.valueFormatted})):null},c=JR(s);n||(c&&!e.isCellRenderer()?n=()=>{const h=!!(r!=null&&r.isEditing(e));if(!h&&uT(o,e,this.getLocaleTextFunc()))return!0;if(!i.isTooltipEnabled())return!1;const g=Hy(()=>{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:u,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:()=>uT(n,e,this.getLocaleTextFunc()),getLocation:()=>"cellEditor",shouldDisplayTooltip:()=>{var p,g;const{editModelSvc:u}=n,c=(p=u==null?void 0:u.getRowValidationModel())==null?void 0:p.getRowValidationMap(),d=(g=u==null?void 0:u.getCellValidationModel())==null?void 0:g.getCellValidationMap(),h=!!c&&c.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=ft(t.tooltipField)||ft(t.tooltipValueGetter)||ft(t.tooltipComponent)}createTooltipFeature(e,t){return this.beans.registry.createDynamicBean("tooltipFeature",!1,e,t)}},cEe=class extends Ofe{createTooltipComp(e,t){const n=The(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}},iG={moduleName:"Tooltip",version:ct,beans:[uEe],dynamicBeans:{tooltipFeature:j2,highlightTooltipFeature:Mfe,tooltipStateManager:cEe},userComponents:{agTooltipComponent:Vfe},dependsOn:[Ow],css:[lEe]},lh=class{constructor(e){this.cellValueChanges=e}},cT=class extends lh{constructor(e,t,n,o){super(e),this.initialRange=t,this.finalRange=n,this.ranges=o}},dEe=10,aG=class{constructor(e){this.actionStack=[],this.maxStackSize=e||dEe,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}},hEe=class extends qe{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&&U$(this.activeCellEdit,t),o=this.activeRowEdit!==null&&Mme(this.activeRowEdit,t);if(!(n||o||this.isPasting||this.isRangeInAction))return;const{rowPinned:r,rowIndex:i,column:a,oldValue:l,value:u}=e,c={rowPinned:r,rowIndex:i,columnId:a.getColId(),newValue:u,oldValue:l};this.cellValueChanges.push(c)},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 aG(n),this.redoStack=new aG(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 cT?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=Va(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=Va(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 u={rowIndex:t,column:a,rowPinned:o};r.setFocusedCell({...u,forceBrowserFocus:!0}),i==null||i.setRangeToCell(u)}addListeners(){this.addManagedEventListeners({rowEditingStarted:e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}},rowEditingStopped:()=>{const e=new lh(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 lh(this.cellValueChanges);this.pushActionsToUndoStack(n)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new lh(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new cT(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&&Aa(n)?e=new cT(this.cellValueChanges,void 0,void 0,[...t.getCellRanges()]):e=new lh(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 lh(t??[]);this.pushActionsToUndoStack(n),this.cellValueChanges=[]}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}},fEe=".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}",pEe={tag:"div",cls:"ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit",children:[{tag:"ag-checkbox",ref:"eEditor",role:"presentation"}]},gEe=class extends Ew{constructor(){super(pEe,[Y_]),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=Ly(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}},Lw=class extends Ew{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===Ve.BACKSPACE||s===Ve.DELETE?i="":s&&s.length===1?r?a=!1:i=s:(i=t.getStartValue(),s!==Ve.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,i=t.getStartValue()),a&&i!=null&&n.setStartValue(i),this.addGuiEventListener("keydown",l=>{const{key:u}=l;(u===Ve.PAGE_UP||u===Ve.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;Ol()||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()}},mEe={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},vEe=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return mEe}getAgComponents(){return[O2]}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 u=l.toLocaleDateString();i.push(a("minDateValidation",`Date must be after ${u}`,[u]))}}if(s){const l=s instanceof Date?s:new Date(s);if(t>l){const u=l.toLocaleDateString();i.push(a("maxDateValidation",`Date must be before ${u}`,[u]))}}}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!ft(n)&&!ft(t.value)?t.value:n??null}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return Qs(e,this.includeTime??!1)}},yEe=class extends Lw{constructor(){super(new vEe(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},wEe={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},CEe=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return wEe}getAgComponents(){return[O2]}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),u=this.getLocaleTextFunc();if(s){const c=new Date(s);if(l<c){const d=c.toLocaleDateString();a.push(u("minDateValidation",`Date must be after ${d}`,[d]))}}if(r){const c=new Date(r);if(l>c){const d=c.toLocaleDateString();a.push(u("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!ft(n)&&!ft(e.value)?e.value:e.parseValue(n??"")}getStartValue(){return Qs(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):xs(e)??void 0}formatDate(e){const t=this.getDataTypeService();return t?t.getDateFormatterFunction(this.params.column)(e):Qs(e??null,this.includeTime??!1)??void 0}},bEe=class extends Lw{constructor(){super(new CEe(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},SEe={tag:"div",cls:"ag-large-text",children:[{tag:"ag-input-text-area",ref:"eEditor",cls:"ag-large-text-input"}]},EEe=class extends Ew{constructor(){super(SEe,[Whe]),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===Ve.BACKSPACE||o===Ve.DELETE?a="":o&&o.length===1?a=o:(a=this.getStartValue(e),o!==Ve.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===Ve.LEFT||t===Ve.UP||t===Ve.RIGHT||t===Ve.DOWN||e.shiftKey&&t===Ve.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!ft(o)&&!ft(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}},_Ee={tag:"ag-input-number-field",ref:"eEditor",cls:"ag-cell-editor"},REe=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return _Ee}getAgComponents(){return[zhe]}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===Ve.UP||e.key===Ve.DOWN)&&e.preventDefault()}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();if(!ft(n)&&!ft(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(){Ol()&&this.eEditor.getInputElement().focus({preventScroll:!0})}},TEe=class extends Lw{constructor(){super(new REe(()=>this.getLocaleTextFunc()))}},DEe={tag:"div",cls:"ag-cell-edit-wrapper",children:[{tag:"ag-select",ref:"eEditor",cls:"ag-cell-editor"}]},IEe=class extends Ew{constructor(){super(DEe,[nfe]),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)){Qe(58);return}this.startedByEnter=i!=null?i===Ve.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:u,valueListMaxHeight:c}=e;l!=null&&t.setPickerGap(l),c!=null&&t.setPickerMaxHeight(c),u!=null&&t.setPickerMaxWidth(u),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}},xEe={tag:"ag-input-text-field",ref:"eEditor",cls:"ag-cell-editor"},AEe=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return xEe}getAgComponents(){return[aw]}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!ft(n)&&!ft(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(){Ol()&&this.eEditor.getInputElement().focus({preventScroll:!0});const e=this.eEditor,t=e.getValue(),n=ft(t)&&t.length||0;n&&e.getInputElement().setSelectionRange(n,n)}},lG=class extends Lw{constructor(){super(new AEe(()=>this.getLocaleTextFunc()))}};function PEe(e){return e.ctrlsSvc.getScrollFeature().getVScrollPosition()}function kEe(e){return e.ctrlsSvc.getScrollFeature().getHScrollPosition()}function uG(e,t,n="auto"){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureColumnVisible(t,n),"ensureVisible")}function cG(e,t,n){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureIndexVisible(t,n),"ensureVisible")}function FEe(e,t,n=null){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureNodeVisible(t,n),"ensureVisible")}function OEe(e){var t;(t=e.undoRedo)==null||t.undo("api")}function MEe(e){var t;(t=e.undoRedo)==null||t.redo("api")}function NEe(e,t){var n;return(n=e.editModelSvc)==null?void 0:n.getEditRowDataValue(t,{checkSiblings:!0})}function LEe(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,u)=>{const{editorValue:c,pendingValue:d,sourceValue:h,state:f}=l,p=Ba(l);let g=c??d;g===Or&&(g=void 0);const v={newValue:g,oldValue:h,state:f,column:u,colId:u.getColId(),colKey:u.getColId(),rowIndex:i,rowPinned:a};(f==="editing"||f==="changed"&&p)&&n.push(v)})}),n}function VEe(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 ic(e,{persist:!0});rh(e,void 0,{cancel:t})}else n==null||n.stopEditing(void 0,{cancel:t,source:"edit",forceStop:!t,forceCancel:t})}function BEe(e,t){var o;const n=qn(e,t);return((o=e.editSvc)==null?void 0:o.isEditing(n))??!1}function $Ee(e,t){const{key:n,colKey:o,rowIndex:s,rowPinned:r}=t,{editSvc:i,colModel:a}=e,l=a.getCol(o);if(!l){Qe(12,{colKey:o});return}const c=Va(e,{rowIndex:s,rowPinned:r||null});if(!c){Qe(290,{rowIndex:s,rowPinned:r});return}if(!l.isCellEditable(c))return;r==null&&cG(e,s),uG(e,o),i==null||i.startEditing({rowNode:c,column:l},{event:n?new KeyboardEvent("keydown",{key:n}):void 0,source:"api"})}function HEe(e){var t;return((t=e.editSvc)==null?void 0:t.validateEdit())||null}function GEe(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentUndoStackSize())??0}function UEe(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentRedoStackSize())??0}var WEe={tag:"div",cls:"ag-popup-editor",attrs:{tabindex:"-1"}},zEe=class extends F_{constructor(e){super(WEe),this.params=e}postConstruct(){Yu(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params,n=o=>{pR(this.gos,o,t.node,t.column,!0)||t.onKeyDown(o)};this.addManagedElementListeners(e,{keydown:n})}};function jEe(e,{column:t},n,o,s="ui"){var u;if(n instanceof KeyboardEvent&&(n.key===Ve.TAB||n.key===Ve.ENTER||n.key===Ve.F2||n.key===Ve.BACKSPACE&&o))return!0;if((n==null?void 0:n.shiftKey)&&((u=e.rangeSvc)==null?void 0:u.getCellRanges().length)!=0)return!1;const i=t==null?void 0:t.getColDef(),a=KEe(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 KEe(e,t){return e.get("suppressClickEdit")===!0?0:e.get("singleClickEdit")===!0||t!=null&&t.singleClickEdit?1:2}function dT(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 qEe(e,t,n="ui"){const o=dT(e,t,n);return o===!0||n==="ui"?o:e.colModel.getCols().some(r=>dT(e,{rowNode:t.rowNode,column:r},n))}var Vw=(e,t=!1)=>{if(e!==void 0)return Ba(e)||t&&e.state==="editing"};function dG(e,t,n=!1){var o;return Vw((o=e.editModelSvc)==null?void 0:o.getEdit(t),n)}var hG=(e,t,n)=>{if(e)for(let o=0,s=e.length;o<s;++o){const r=e[o];if(r.data&&(Vw(t==null?void 0:t.getEdit({rowNode:r,column:n}))||Vw(t==null?void 0:t.getEdit({rowNode:r.pinnedSibling,column:n})))||hG(r.childrenAfterGroup,t,n))return!0}};function fG(e,t){const{column:n,rowNode:o}=t;return e.gos.get("groupTotalRow")&&!(o!=null&&o.footer)?!1:hG(o==null?void 0:o.childrenAfterGroup,e.editModelSvc,n)}function pG(e,{rowNode:t,column:n}){var o;if(t=t.pinnedSibling,!!t)return Vw((o=e.editModelSvc)==null?void 0:o.getEdit({rowNode:t,column:n}))}var YEe=class extends qe{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=dG(n,e)||fG(n,e)||pG(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)}},XEe=class extends qe{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 u={rowNode:o,column:l};return dG(n,u,!0)||fG(n,u)||pG(n,u)});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)})}},ZEe=({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},JEe=({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}))},QEe=e=>()=>{const t=new Set(e.colModel.getCols()),n=e.editModelSvc.getEditMap(!0),o=new Set(n.keys());JEe(e,ZEe(e,o),t)},e0e=new Set(["undo","redo","paste","bulk","rangeSvc"]),t0e=new Set(["ui","api"]),gG={paste:"api",rangeSvc:"api",fillHandle:"api",cellClear:"api",bulk:"api"},n0e=new Set(Object.keys(gG)),o0e=new Set(["paste","rangeSvc","renderer","cellClear","redo","undo"]),Bw={cancel:!0,source:"api"},s0e={cancel:!1,source:"api"},uh={checkSiblings:!0},lg={force:!0,suppressFlash:!0},r0e=class extends qe{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,Bw),this.createStrategy(o)});const t=QEe(e),n=()=>{const o=this.model.getCellValidationModel().getCellValidationMap().size>0,s=this.model.getRowValidationModel().getRowValidationMap().size>0;return o||s?this.stopEditing(void 0,Bw):this.isEditing()&&(this.isBatchEditing()?rh(e,this.model.getEditPositions()):this.stopEditing(void 0,s0e)),!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,Bw)):(this.stopEditing(void 0,Bw),this.batch=!1)}createStrategy(e){const{beans:t,gos:n,strategy:o}=this,s=mG(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=jEe(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 CCe(this.beans)}isEditing(e,t){return this.model.hasEdits(e,t??uh)}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,w,S;const{event:n,cancel:o,source:s="ui",forceCancel:r,forceStop:i}=t||{},{beans:a,model:l}=this;if(n0e.has(s)&&this.isBatchEditing())return this.bulkRefresh(e),!1;const u=this.committing?gG[s]:s;if(!(this.committing||this.isEditing(e)||this.isBatchEditing()&&l.hasEdits(e,uh))||!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,u)||this.committing&&!this.batch)||(i??!1),g=o&&!!this.shouldCancelEditing(e,n,u)||(r??!1);if(p||g){ic(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 E of y)l.clearEditValue(E);this.bulkRefresh(void 0,h);for(const E of l.getEditPositions(b)){const _=qn(a,E),I=Ba(E);_==null||_.refreshCell({force:!0,suppressFlash:!I})}h=b,f||(f=p)}else if(n instanceof KeyboardEvent&&this.batch&&((w=this.strategy)!=null&&w.midBatchInputsAllowed(e))&&this.isEditing(e,{withOpenEditor:!0})){const{key:b}=n,y=b===Ve.ENTER,E=b===Ve.ESCAPE,_=b===Ve.TAB;(y||_||E)&&(y||_?ic(a,{persist:!0}):E&&this.revertSingleCellEdit(d),this.isBatchEditing()?(S=this.strategy)==null||S.cleanupEditors():rh(a,l.getEditPositions(),{event:n,cancel:E}),n.preventDefault(),this.bulkRefresh(e,h,{suppressFlash:!0}),h=l.getEditMap())}else ic(a,{persist:!0}),h=l.getEditMap();return f&&e&&this.model.removeEdits(e),this.navigateAfterEdit(t,d==null?void 0:d.cellPosition),WR(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 u;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!==Ve.ENTER||!a)return;const l=i?Ve.UP:Ve.DOWN;(u=this.beans.navigation)==null||u.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 u=a.get(l),c={rowNode:i,column:l},d=Ba(u);!t&&d&&!s&&(this.setNodeDataValue(i,l,u.pendingValue,void 0,n)||r.push(c))}}return r}setNodeDataValue(e,t,n,o,s="edit"){const{beans:r}=this,i=qn(r,{rowNode:e,column:t}),a=t0e.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(lg)),l}setEditMap(e,t){var o;this.strategy??(this.strategy=this.createStrategy()),(o=this.strategy)==null||o.setEditMap(e,t),this.bulkRefresh();let n=lg;t!=null&&t.forceRefreshOfEditCellsOnly&&(n={...i0e(e),...lg}),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;io(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,u)=>{for(const c of l.keys())this.refCell({rowNode:u,column:c},l.get(c),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 u=e.sibling;u&&a.add(u);let c=e.parent;for(;c;)(d=c.sibling)!=null&&d.footer&&r.get("groupTotalRow")||!c.parent&&c.sibling&&r.get("grandTotalRow")?a.add(c.sibling):a.add(c),c=c.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=mG(o)==="fullRow"?qEe(s,e,t):dT(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()&&(rh(this.beans,[e],{silent:!0}),this.model.clearEditValue(e),sh(this.beans,e,{silent:!0}),ac(this.beans),n==null||n.refreshCell(lg),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;ac(this.beans);const t=qn(this.beans,e);t&&(t.refreshCell(lg),(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 ih&&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===Or||!o?(o==null?void 0:o.sourceValue)??this.valueSvc.getValue(t,e,!1,"api"):r}addStopEditingWhenGridLosesFocus(e){pCe(this,this.beans,e)}createPopupEditorWrapper(e){return new zEe(e)}commitNextEdit(){this.committing=!0}setDataValue(e,t,n){var o;try{if((!this.isEditing()||this.committing)&&!o0e.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||e0e.has(n))return Aw(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 Aw(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 Aw(s,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:r,suppressNavigateAfterEdit:!0}),!0}finally{this.committing=!1}}handleColDefChanged(e){vCe(this.beans,e)}destroy(){this.model.clear(),this.destroyStrategy(),super.destroy()}prepDetailsDuringBatch(e,t){if(!this.batch||!this.model.hasRowEdits(e.rowNode,uh))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,uh),{compDetails:r}}const a=this.model.getEditRow(e.rowNode,uh);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 Nt(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 u,c;if(!n||n.length===0)return;const{beans:o,rangeSvc:s,valueSvc:r}=this;ic(o,{persist:!0});const i=this.model.getEditMap(!0),a=(c=(u=i.get(e))==null?void 0:u.get(t))==null?void 0:c.pendingValue;this.batch||this.eventSvc.dispatchEvent({type:"bulkEditingStarted"}),n.forEach(d=>{if(s==null||s.forEachRowInRange(d,h=>{const f=Va(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 w=r.parseValue(g,f??null,a,v);Number.isNaN(w)&&(w=null),p.set(g,{editorValue:void 0,pendingValue:w,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(),WR(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 YEe(e,t)}createRowStyleFeature(e,t){return new XEe(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:u,rowPinned:c,newValue:d,state:h}of e){const f=i?o.getCol(i):l?o.getCol(l):a;if(!f)continue;const p=Va(n,{rowIndex:u,rowPinned:c});if(!p)continue;const g=s.getValue(f,p,!0,"api");if(!(t!=null&&t.forceRefreshOfEditCellsOnly)&&!Ba({pendingValue:d,sourceValue:g})&&h!=="editing")continue;let v=r.get(p);v||(v=new Map,r.set(p,v)),d===void 0&&(d=Or),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,uh))return;const n=this.model.getEdit(t);if(!n||!Ba(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 mG(e,t){return t??e.get("editType")??"singleCell"}var vG=class extends qe{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:u,rowIndex:c,rowPinned:d}=e,h={column:u,rowNode:Va(s,{rowIndex:c,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)Pw(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)Pw(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){ic(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);rh(this.beans,o),WR(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;mCe(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=GR(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===Ve.ENTER:null}shouldCancel(e,t,n="ui"){const o=this.editSvc.isBatchEditing();return!!(t instanceof KeyboardEvent&&!o&&t.key===Ve.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===Or?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()}},a0e=class extends vG{constructor(){super(...arguments),this.beanName="fullRow",this.startedRows=[]}shouldStop(e,t,n="ui"){const{rowNode:o}=e||{};if(!GR(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=[],u=[];for(const c of a)c.isCellEditable(i)&&u.push(c);if(u.length!=0){this.dispatchRowEvent({rowNode:i},"rowEditingStarted",n),this.startedRows.push(i);for(const c of u){const d={rowNode:i,column:c};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(Ba(a)){o.push(i);break}}}),ac(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(),u=i.isCellEditable(),c=a&&r.rowIndex===a.rowIndex&&r.rowPinned===a.rowPinned;l&&this.setFocusOutOnEditor(e),this.restoreEditors();const d=this.gos.get("suppressStartEditOnTab");return u&&!s?d?i.focusCell(!0,n):((f=i.comp)!=null&&f.getCellEditor()||sh(this.beans,i,{event:n,cellStartedEdit:!0}),this.setFocusInOnEditor(i),i.focusCell(!1,n)):(u&&s&&this.setFocusInOnEditor(i),i.focusCell(!0,n)),!c&&!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())&&sh(this.beans,s,{silent:!0})}))}destroy(){super.destroy(),this.rowNode=void 0,this.startedRows.length=0}},l0e=class extends vG{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=Va(this.beans,{rowIndex:o,rowPinned:r}),a=UR(s),l=t.getCol(a),u=e.previousParams;if(u){const c=UR(u.column);if((u==null?void 0:u.rowIndex)===o&&c===a&&(u==null?void 0:u.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,w,S,b;const r=this.beans.focusSvc.getFocusedCell();r&&(e=nh(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 u=a.cellPosition,c=e.isCellEditable(),d=a.isCellEditable(),h=u&&i.rowIndex===u.rowIndex&&i.rowPinned===u.rowPinned;c&&!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(!((w=a.comp)!=null&&w.getCellEditor())){const y=(S=this.editSvc)==null?void 0:S.isEditing(a,{withOpenEditor:!0});sh(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}},Gl={moduleName:"EditCore",version:ct,beans:[fCe,r0e],apiFunctions:{getEditingCells:LEe,getEditRowValues:NEe,getCellEditorInstances:gCe,startEditingCell:$Ee,stopEditing:VEe,isEditing:BEe,validateEdit:HEe},dynamicBeans:{singleCell:l0e,fullRow:a0e},dependsOn:[Ow,iG],css:[fEe]},u0e={moduleName:"UndoRedoEdit",version:ct,beans:[hEe],apiFunctions:{undoCellEditing:OEe,redoCellEditing:MEe,getCurrentUndoSize:GEe,getCurrentRedoSize:UEe},dependsOn:[Gl]},c0e={moduleName:"TextEditor",version:ct,userComponents:{agCellEditor:lG,agTextCellEditor:lG},dependsOn:[Gl]},d0e={moduleName:"NumberEditor",version:ct,userComponents:{agNumberCellEditor:{classImp:TEe}},dependsOn:[Gl]},h0e={moduleName:"DateEditor",version:ct,userComponents:{agDateCellEditor:yEe,agDateStringCellEditor:bEe},dependsOn:[Gl]},f0e={moduleName:"CheckboxEditor",version:ct,userComponents:{agCheckboxCellEditor:gEe},dependsOn:[Gl]},p0e={moduleName:"SelectEditor",version:ct,userComponents:{agSelectCellEditor:IEe},dependsOn:[Gl]},g0e={moduleName:"LargeTextEditor",version:ct,userComponents:{agLargeTextCellEditor:EEe},dependsOn:[Gl]},m0e={moduleName:"CustomEditor",version:ct,dependsOn:[Gl]},v0e=class extends qe{constructor(){super(...arguments),this.beanName="selectionColSvc"}postConstruct(){this.addManagedPropertyListener("rowSelection",e=>{this.onSelectionOptionsChanged(e.currentValue,e.previousValue,Kd(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),Ide(e))}createColumns(e,t){var h,f;const n=()=>{var p;ew(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(Dde(i,((f=this.columns)==null?void 0:f.list)??[])&&r)return;n();const{colGroupSvc:l}=this.beans,u=(l==null?void 0:l.findDepth(e.tree))??0,c=(l==null?void 0:l.balanceTreeForAutoCols(i,u))??[];this.columns={list:i,tree:c,treeDepth:u,map:{}},t(p=>{if(!p)return null;const g=p.filter(v=>!ka(v));return[...i,...g]})}updateColumns(e){var n;const t=Kd(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),ni(this.beans,{state:[{...s,colId:o.getColId()}]},t)}}getColumn(e){var t;return((t=this.columns)==null?void 0:t.list.find(n=>Wp(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"||!Ku(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=!!jd(n),r=qy(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,u,c){const d=u.isSelected(),h=c.isSelected();return d===h?0:d?1:-1},editable:!1,suppressFillHandle:!0,pinned:null,...i,colId:r2,chartDataType:"excluded"}}generateSelectionCols(){if(!this.isSelectionColumnEnabled())return[];const e=this.createSelectionColDef(),t=e.colId;this.gos.validateColDef(e,t,!0);const n=new Xu(e,null,t,!1);return this.createBean(n),[n]}onSelectionOptionsChanged(e,t,n){const o=t&&typeof t!="string"?jd(t):void 0,s=e&&typeof e!="string"?jd(e):void 0,r=o!==s,i=t&&typeof t!="string"?qy(t):void 0,a=e&&typeof e!="string"?qy(e):void 0,l=i!==a,u=Yy(e),c=Yy(t);(r||l||u!==c)&&this.beans.colModel.refreshAll(n)}destroy(){var e;ew(this.beans,(e=this.columns)==null?void 0:e.tree),super.destroy()}refreshVisibility(e,t,n){var l,u;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 c;switch(s.pinned){case"left":case!0:c=e;break;case"right":c=n;break;default:c=t}c&&ti(c,s)};(((u=this.beans.rowNumbersSvc)==null?void 0:u.getColumn(i2))?2:1)===o&&r()}};function y0e(e,t){var i;if(!t.nodes.every(a=>a.rowPinned&&!Qp(a)?(Qe(59),!1):a.id===void 0?(Qe(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 w0e(e,t,n="apiSelectAll"){var o;(o=e.selectionSvc)==null||o.selectAllRowNodes({source:n,selectAll:t})}function C0e(e,t,n="apiSelectAll"){var o;(o=e.selectionSvc)==null||o.deselectAllRowNodes({source:n,selectAll:t})}function b0e(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"filtered"})}function S0e(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"filtered"})}function E0e(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"currentPage"})}function _0e(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"currentPage"})}function R0e(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedNodes())??[]}function T0e(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedRows())??[]}var D0e=class extends $ge{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=Xy(e),this.groupSelectsDescendants=Gp(e),this.groupSelectsFiltered=Zy(e)==="filteredDescendants",this.masterSelectsDetail=e2(e)==="detail",this.addManagedPropertyListeners(["groupSelectsChildren","groupSelectsFiltered","rowSelection"],()=>{const t=Gp(e),n=Xy(e),o=Zy(e)==="filteredDescendants";this.masterSelectsDetail=e2(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?wG(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 u;if(o.length===0)return 0;const{gos:a}=this;if(!Ku(a)&&e)return Qe(132),0;if(o.length>1&&!this.isMultiSelect())return Qe(130),0;let l=0;for(let c=0;c<o.length;c++){const d=o[c],h=ch(d);if(h.rowPinned&&!Qp(h)){Qe(59);continue}if(h.id===void 0){Qe(60);continue}this.groupSelectsFiltered&&h.group&&!a.get("treeData")||this.selectRowNode(h,e,s,r)&&(this.detailSelection.delete(h.id),l++),this.groupSelectsDescendants&&((u=h.childrenAfterGroup)!=null&&u.length)&&(l+=this.selectChildren(h,e,r))}return n||(o.length===1&&r==="api"&&this.selectionCtx.setRoot(ch(o[0])),e&&(t||!this.isMultiSelect())&&(l+=this.clearOtherNodes(ch(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=ch(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(!io(n))return!1;const s=o.rootNode;if(!s)return!1;t||(t=new tg(!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?!x0e(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 Nl(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(!io(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=io(this.gos);let o=!1;const s=r=>{const i=this.selectRowNode(ch(r),!1,void 0,e);o||(o=i)};if(t==="currentPage"||t==="filtered"){if(!n){_n(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 yG(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(!Ku(t)){Qe(132);return}if(pde(t)&&!Hp(t)){Qe(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(ch(i),!0,void 0,o);r||(r=a)}),n.selectAll=!0,io(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)){_n(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 io(this.beans.gos)}updateSelectable(e){var l;const{gos:t,rowModel:n}=this.beans;if(!Ku(t))return;const o="selectableChanged",s=e!==void 0,r=io(t)&&this.groupSelectsDescendants,i=[],a=u=>{var d;if(s&&!u.group)return;if(r&&u.group){const h=((d=u.childrenAfterGroup)==null?void 0:d.some(f=>f.selectable))??!1;this.setRowSelectable(u,h,!0);return}!this.updateRowSelectable(u,!0)&&u.isSelected()&&i.push(u)};if(r){if(e===void 0){const u=n.rootNode;e=u?new tg(!1,u):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=I0e(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(!Hp(t)){Qe(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 ch(e){return Qp(e)?e.pinnedSibling:e.footer?e.sibling:e}function I0e(e){let t=0,n=0;return e.forEachNode(o=>{o.isSelected()?t++:o.selectable&&n++}),yG(t,n)}function yG(e,t){if(e===0&&t===0)return!1;if(!(e>0&&t>0))return e>0}function x0e(e,t){let n=t.parent;for(;n;){if(n===e)return!0;n=n.parent}return!1}function wG(e){var o;const t=e.isSelected()===!1,n=((o=e.childrenAfterFilter)==null?void 0:o.some(wG))??!1;return t||n}var A0e={moduleName:"SharedRowSelection",version:ct,beans:[v0e],apiFunctions:{setNodesSelected:y0e,selectAll:w0e,deselectAll:C0e,selectAllFiltered:b0e,deselectAllFiltered:S0e,selectAllOnCurrentPage:E0e,deselectAllOnCurrentPage:_0e,getSelectedNodes:R0e,getSelectedRows:T0e}},P0e={moduleName:"RowSelection",version:ct,rowModels:["clientSide","infinite","viewport"],beans:[D0e],dependsOn:[A0e]};function k0e(e){var t;(t=e.expansionSvc)==null||t.expandAll(!0)}function F0e(e){var t;(t=e.expansionSvc)==null||t.expandAll(!1)}function CG(e){var t;(t=e.rowModel)==null||t.onRowHeightChanged()}function bG(e){var t,n;if((t=e.rowAutoHeight)!=null&&t.active){Qe(3);return}(n=e.rowModel)==null||n.resetRowHeights()}function O0e(e,t,n){var s,r;const o=Mbe(e);if(o){if(((s=e.rowGroupColsSvc)==null?void 0:s.columns.length)===0){if(t<0){_n(238);return}o.setRowCount(t,n);return}_n(28);return}(r=Fw(e))==null||r.setRowCount(t,n)}function M0e(e){var t;return Ud(e.gos)?e.rowModel.getBlockStates():((t=e.rowNodeBlockLoader)==null?void 0:t.getBlockState())??{}}function N0e(e){return e.rowModel.isLastRowIndexKnown()}var L0e={moduleName:"CsrmSsrmSharedApi",version:ct,apiFunctions:{expandAll:k0e,collapseAll:F0e}},V0e={moduleName:"RowModelSharedApi",version:ct,apiFunctions:{onRowHeightChanged:CG,resetRowHeights:bG}},B0e={moduleName:"SsrmInfiniteSharedApi",version:ct,apiFunctions:{setRowCount:O0e,getCacheBlockState:M0e,isLastRowIndexKnown:N0e}},$0e=class extends qe{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){_n(18),t||_n(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||_n(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":Qe(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}));ni(o,{state:d,applyOrder:!0},"alignedGridChanged")}break;case"columnVisible":{const d=e.api.getColumnState().map(h=>({colId:h.colId,hide:h.hide}));ni(o,{state:d},"alignedGridChanged")}break;case"columnPinned":{const d=e.api.getColumnState().map(h=>({colId:h.colId,pinned:h.pinned}));ni(o,{state:d},"alignedGridChanged")}break;case"columnResized":{const c=e,d={};for(const h of a)d[h.getId()]={key:h.getColId(),newWidth:h.getActualWidth()};for(const h of c.flexColumns??[])d[h.getId()]&&delete d[h.getId()];s==null||s.setColumnWidths(Object.values(d),!1,c.finished,"alignedGridChanged");break}}const u=r.getGridBodyCtrl().isVerticalScrollShowing();for(const c of this.getAlignedGridApis())c.setGridOption("alwaysShowVerticalScroll",u)}},H0e={moduleName:"AlignedGrids",version:ct,beans:[$0e],dependsOn:[rH]},G0e=class extends qe{constructor(e){super(),this.rootNode=e,this.nextId=0,this.allNodesMap={},SG(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=SG(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,u=(c,d)=>{const h=c.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=c;const w=a(g);w&&u(v,w)}}};u(s,e),r.length=i}setImmutableRowData(e,t){var w;const{rootNode:n,gos:o}=this;this.dispatchRowDataUpdateStarted(t);const s=zd(o),r=e.changedRowNodes,{adds:i,updates:a}=r,l=new Set,u=[],c=(w=this.beans.groupStage)==null?void 0:w.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()&&u.push(S))},g=(S,b,y)=>{for(let E=0,_=b.length;E<_;++E){const I=b[E];if(!I)continue;let T=this.getRowNode(s({data:I,level:y}));if(T?(p(T,I),f||(f=!!c&&T.treeParent!==S)):(T=this.createRowNode(I,y),i.add(T)),!c||l.has(T)){l.add(T);continue}l.add(T),T.treeParent=S;const F=c(I);F&&g(T,F,y+1)}};g(n,t,0);const v=this.deleteUnusedNodes(l,r,u)||d||i.size>0;if(v){const S=n._leafs??(n._leafs=[]);d===void 0?K0e(S,l,r):j0e(S,l)&&(r.reordered=!0)}(v||f||a.size)&&(e.rowDataUpdated=!0,this.deselect(u))}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 Qe(268),{remove:[],update:[],add:[]};const n=[],o=zd(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 u=0,c=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<c&&(c=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[u++]=g}return f.length=u,u&&z0e(i,c,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 u=t[l],c=this.lookupNode(e,u);c&&(c.updateData(u),!c.selectable&&c.isSelected()&&s.push(c),i[a++]=c,n.has(c)||o.add(c))}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 u=new Array(i),c=t.adds;for(let d=0;d<i;d++){const h=this.createRowNode(r[d],0);c.add(h),h.sourceRowIndex=l,o[l]=h,u[d]=h,l++}return u}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 Nl(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]&&Qe(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 W0e(this.rootNode._leafs,t);const n=e({data:t,level:0}),o=this.allNodesMap[n];return o||(_n(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=U0e(e,t)),t}},U0e=(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},SG=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},W0e=(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 _n(5,{data:t}),null},z0e=(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},j0e=(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},K0e=(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},EG=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"))}},q0e=class extends qe{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:u}=this.beans,c=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 w=S=>{var _,I;const b=f&&S.leafGroup;let y=c&&d&&!S.leafGroup;y&&(v??(v=this.shouldSortContainsGroupCols(e)),y&&(y=!v));let E=null;if(y){let T=!1;if(h){const F=S.level+1;F<h.length&&(T=h[F].getSort()===null)}T||(E=Z0e(S))}else!e.length||b||(t&&n?E=Y0e(a,S,n,o,e):E=a.doFullSort(S.childrenAfterAggFilter,e));if(E||(E=((_=S.childrenAfterAggFilter)==null?void 0:_.slice(0))??[]),g||(g=((I=S.childrenAfterSort)==null?void 0:I[0])!==E[0]),S.childrenAfterSort=E,EG(S),p){const T={nodes:S.childrenAfterSort};p(T)}};if(o==null||o.forEachChangedNodeDepthFirst(w),g&&s.get("groupHideOpenParents")){const S=u==null?void 0:u.getShowRowGroupCols();S!=null&&S.length&&l.refreshCells({columns:S,force:!0})}}shouldSortContainsGroupCols(e){const t=e.length;if(!t)return!1;if(Mi(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}},Y0e=(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:u,adds:c}=n;for(let h=0,f=r.length;h<f;++h){const p=r[h];u.has(p)||c.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)),X0e(e,s,l,d)},X0e=(e,t,n,o)=>{let s=0,r=0;const i=n.length,a=o.length,l=new Array(i+a);let u=0;for(;s<i&&r<a;){const c=n[s],d=o[r];e.compareRowNodes(t,c,d)<0?(l[u++]=c.rowNode,++s):(l[u++]=d.rowNode,++r)}for(;s<i;)l[u++]=n[s++].rowNode;for(;r<a;)l[u++]=o[r++].rowNode;return l},Z0e=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 u=t[l];i.delete(u)&&(r[a++]=u)}if(i.size===0&&a===o)return t;for(const l of i)r[a++]=l;return r.length=a,r},J0e=class extends qe{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=Yo(this,this.onRowHeightChanged.bind(this),100)}postConstruct(){const e=this.beans,t=new Nl(e);this.rootNode=t,this.nodeManager=this.createBean(new G0e(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),u=Math.min(a,o);for(let c=l;c<=u;c++){const d=this.getRow(c);if(d.rowHeightEstimated){const h=Pl(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,Qe(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 Rw,t.setImmutableRowData(l,a)):(l.rowDataUpdated=!0,l.newData=!0,t.setNewRowData(a),this.rowNodesCountReady=!0));const u=l.rowDataUpdated?"group":this.getRefreshedStage(e);u&&(l.step=u,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=Xo(this.gos,"normal");for(let i=0,a=n.length;i<a;++i){const l=n[i],u=l.id;if(u!=null&&(e==null||e.add(u)),l.rowHeight==null){const c=Pl(t,l,r,o);l.setRowHeight(c.height,c.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 c=0,d=a.length;c<d;++c)s(a[c])},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 u=r[l];if(this.gos.get("groupHideOpenParents"))for(;u.expanded&&u.childrenAfterSort&&u.childrenAfterSort.length>0;)u=u.childrenAfterSort[0];return u.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:Wd(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:Wd(this.gos)})}}onSortChanged(){this.refreshModel({step:"sort",keepRenderedRows:!0,animate:Wd(this.gos)})}getType(){return"clientSide"}onValueChanged(){this.refreshModel({step:this.beans.colModel.isPivotActive()?"pivot":"aggregate"})}createChangePath(e){const t=new tg(!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 u,c;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,(u=n.masterDetailSvc)==null||u.refreshModel(e),i&&e.step!=="group"&&((c=n.colFilter)==null||c.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=Gp(this.gos);return this.forEachNodeAfterFilterAndSort(i=>{if(o)return;if(n&&(i===t||i===e)&&(o=!0,r&&i.group)){_G(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),u=t[l];if(this.isRowInPixel(u,e)||(u.rowTop<e?o=l+1:u.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 u of a)r=this.depthFirstSearchRowNodes(e,t,n,u,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),EG(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,UH(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(oR)===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 Rw;for(const{rowDataTransaction:l,callback:u}of o??[]){this.rowNodesCountReady=!0;const c=e.updateRowData(l,i);s.push(c),u&&r.push(u.bind(null,c))}this.commitTransactions(i),r.length>0&&setTimeout(()=>{for(let l=0,u=r.length;l<u;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 Rw,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()}},_G=(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&&_G(e,r)}};function Q0e(e){var t;(t=e.expansionSvc)==null||t.onGroupExpandedOrCollapsed()}function e_e(e,t){const n=Hl(e);n&&((!t||t==="everything")&&(t="group"),n.refreshModel({step:t,keepRenderedRows:!0,animate:!e.gos.get("suppressAnimationFrame")}))}function t_e(e){var t;return((t=Hl(e))==null?void 0:t.isEmpty())??!0}function n_e(e,t){var n;(n=Hl(e))==null||n.forEachLeafNode(t)}function o_e(e,t){var n;(n=Hl(e))==null||n.forEachNodeAfterFilter(t)}function s_e(e,t){var n;(n=Hl(e))==null||n.forEachNodeAfterFilterAndSort(t)}function r_e(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=Hl(e))==null?void 0:n.updateRowData(t)})}function i_e(e,t,n){e.frameworkOverrides.wrapIncoming(()=>{var o;return(o=Hl(e))==null?void 0:o.batchUpdateRowData(t,n)})}function a_e(e){e.frameworkOverrides.wrapIncoming(()=>{var t;return(t=Hl(e))==null?void 0:t.flushAsyncTransactions()})}function l_e(e){var t;return(t=e.selectionSvc)==null?void 0:t.getBestCostNodeSelection()}var RG={moduleName:"ClientSideRowModel",version:ct,rowModels:["clientSide"],beans:[J0e,q0e],dependsOn:[OH]},u_e={moduleName:"ClientSideRowModelApi",version:ct,apiFunctions:{onGroupExpandedOrCollapsed:Q0e,refreshClientSideRowModel:e_e,isRowDataEmpty:t_e,forEachLeafNode:n_e,forEachNodeAfterFilter:o_e,forEachNodeAfterFilterAndSort:s_e,applyTransaction:r_e,applyTransactionAsync:i_e,flushAsyncTransactions:a_e,getBestCostNodeSelection:l_e,resetRowHeights:bG,onRowHeightChanged:CG},dependsOn:[L0e,V0e]},c_e=class extends qe{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,u=!!o.footer,c=o.allChildrenCount===1&&((p=o.childrenAfterGroup)==null?void 0:p.length)===1&&hde(this.gos,o);if(!l&&!u&&(t.skipRowGroups||c||a)||t.onlySelected&&!o.isSelected()||t.skipPinnedTop&&o.rowPinned==="top"||t.skipPinnedBottom&&o.rowPinned==="bottom"||o.stub||o.level===-1&&!l&&!u||s(Nt(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(Nt(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 v2,{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 u;const o=this.rowModel,s=io(this.gos),r=Ud(this.gos),i=!s&&e.onlySelected,a=this.processRow.bind(this,n,e,t),{exportedRows:l="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(c=>c.rowPinned==null).sort((c,d)=>c.rowIndex-d.rowIndex).map(c=>o.getRow(c.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 c=((u=this.beans.selectionSvc)==null?void 0:u.getSelectedNodes())??[];this.replicateSortedOrder(c),c.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(),u=h=>ka(h)?!1:!Fa(h)||o;if(s!=null&&s.length)return r.getColsForKeys(s).filter(u);const c=i.get("treeData");let d=[];return t&&!l?d=r.getCols():d=a.allCols,d=d.filter(h=>u(h)&&(n&&!c?!x_(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&&ao(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(Nt(this.gos,{columnGroup:i})):a=this.beans.colNames.getDisplayNameForColumnGroup(i,"header");const u=(i.isExpandable()?i.getLeafColumns():[]).reduce((c,d,h,f)=>{let p=kn(c);return d.getColumnGroupShow()==="open"?(!p||p[1]!=null)&&(p=[h],c.push(p)):p&&p[1]==null&&(p[1]=h-1),h===f.length-1&&p&&p[1]==null&&(p[1]=h),c},[]);o.onColumn(i,a||"",s++,i.getLeafColumns().length-1,u)}}},d_e={moduleName:"SharedExport",version:ct,beans:[c_e]},TG=`\r
253
253
  `,h_e=class extends Hbe{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,TG),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():(Qe(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=TG),this.isFirstLine=!1}},f_e=class extends $be{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()){Qe(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(Nt(this.gos,{})):t.fileName;Gbe(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:u,suppressQuotes:c,columnSeparator:d}=e;return new h_e({colModel:t,colNames:n,valueSvc:s,gos:r,processCellCallback:i||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:u||void 0,suppressQuotes:c||!1,columnSeparator:d||",",rowGroupColsSvc:o})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function p_e(e,t){var n;return(n=e.csvCreator)==null?void 0:n.getDataAsCsv(t)}function g_e(e,t){var n;(n=e.csvCreator)==null||n.exportDataAsCsv(t)}var m_e={moduleName:"CsvExport",version:ct,beans:[f_e],apiFunctions:{getDataAsCsv:p_e,exportDataAsCsv:g_e},dependsOn:[d_e]},v_e=class extends qe{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 Nl(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){ft(t)?e.setDataAndId(t,n.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Gn(this.params.datasource.getRows)){Qe(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:Nt(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 Nl(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()}},y_e=2,w_e=class extends qe{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 v_e(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()&&(Al(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=y_e-1;t.forEach((i,a)=>{const l=i.state==="needsLoading"&&a>=r,u=o?a>=s:!1;if(l||u){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,ft(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(u=>{const c=u===e||u===t;(s||c)&&n.push(u),c&&(s=!s)},r,this.rowCount)}return i||s?[]:n}},C_e=class extends qe{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 Nl(e);this.rootNode=t,t.level=-1,this.rowHeight=qu(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=qu(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){var t;let e;this.cacheParams?e=!Dp(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;zd(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:qu(e),overflowSize:r.get("cacheOverflowSize"),blockSize:r.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new w_e(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 b_e(e){var t;(t=Fw(e))==null||t.refreshCache()}function S_e(e){var t;(t=Fw(e))==null||t.purgeCache()}function E_e(e){var t;return(t=Fw(e))==null?void 0:t.getRowCount()}var __e=class extends qe{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=fde(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=Yo(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){ti(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){Al(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(){Al(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},R_e={moduleName:"InfiniteRowModelCore",version:ct,rowModels:["infinite"],beans:[C_e,__e]},T_e={moduleName:"InfiniteRowModel",version:ct,apiFunctions:{refreshInfiniteCache:b_e,purgeInfiniteCache:S_e,getInfiniteRowCount:E_e},dependsOn:[R_e,B0e]},D_e="↑",I_e="↓",x_e={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},A_e=class extends Cn{constructor(){super(x_e),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=ft(o)?o:n,r=t>=0,i=this.eDelta;r?i.textContent=D_e+s:i.textContent=I_e+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"),qo(this.eDelta)}refresh(e,t=!1){var u;const{value:n,valueFormatted:o}=e,{eValue:s,lastValue:r,beans:i}=this;if(n===r||(ft(o)?s.textContent=o:ft(n)?s.textContent=n:qo(s),(u=i.filterManager)!=null&&u.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 c=a-l;this.showDelta(e,c)}return r&&s.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=n,!0}},P_e=".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}",k_e={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},F_e=class extends Cn{constructor(){super(k_e),this.eCurrent=dt,this.refreshCount=0,this.registerCSS(P_e)}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=lo({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 ft(e.valueFormatted)?o.textContent=e.valueFormatted:ft(e.value)?o.textContent=n:qo(o),!0}},O_e=class extends qe{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 u=`ag-cell-${t}`,c=`${u}-animation`,{comp:d,eGui:{style:h}}=e;d.toggleCss(u,!0),d.toggleCss(c,!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:u,fadeEndTime:c}=a,d=l==="flash"?u:c;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 ${c-u}ms`,p.transitionDelay=`${u-e}ms`,t=Math.min(c,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=Fme(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 M_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 N_e={moduleName:"HighlightChanges",version:ct,beans:[O_e],userComponents:{agAnimateShowChangeCellRenderer:A_e,agAnimateSlideCellRenderer:F_e},apiFunctions:{flashCells:M_e}};function L_e(e){var t;return((t=e.stateSvc)==null?void 0:t.getState())??{}}function V_e(e,t,n){var o;return(o=e.stateSvc)==null?void 0:o.setState(t,n)}function DG(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=B_e(e)),e.version=ct,e}function B_e(e){return e.cellSelection=$_e(e,"rangeSelection"),e}function $_e(e,t){if(e&&typeof e=="object")return e[t]}var H_e=class extends qe{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Yo(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=Yo(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=Yo(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=io(e);const o=DG(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:u})=>{u==="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=DG(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=(c,d)=>!(n!=null&&n.has(c))&&(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 u=this.updateCachedState.bind(this);u("filter",this.getFilterState()),this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(u("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),u("rowGroupExpansion",void 0)):(u("rowGroupExpansion",this.getRowGroupExpansionState()),u("ssrmRowGroupExpansion",void 0)),u("rowSelection",this.getRowSelectionState()),u("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 u=this.updateCachedState.bind(this);u("sideBar",this.getSideBarState()),u("focusedCell",this.getFocusedCellState());const c=this.getRangeSelectionState();u("rangeSelection",c),u("cellSelection",c),u("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 Lbe(nw(e),e.colModel.isPivotMode())}setColumnState(e,t,n,o){const{sort:s,rowGroup:r,aggregation:i,pivot:a,columnPinning:l,columnVisibility:u,columnSizing:c,columnOrder:d}=e;let h=!1;const f=(x,A)=>{const k=!(o!=null&&o.has(x))&&!!(A||t==="api");return h||(h=k),k},p={},g=x=>{let A=p[x];return A||(A={colId:x},p[x]=A,A)},v={},w=f("sort",s);w&&(s==null||s.sortModel.forEach(({colId:x,sort:A},k)=>{const M=g(x);M.sort=A,M.sortIndex=k})),(w||!n)&&(v.sort=null,v.sortIndex=null);const S=f("rowGroup",r);S&&(r==null||r.groupColIds.forEach((x,A)=>{const k=g(x);k.rowGroup=!0,k.rowGroupIndex=A})),(S||!n)&&(v.rowGroup=null,v.rowGroupIndex=null);const b=f("aggregation",i);b&&(i==null||i.aggregationModel.forEach(({colId:x,aggFunc:A})=>{g(x).aggFunc=A})),(b||!n)&&(v.aggFunc=null);const y=f("pivot",a);y&&(a==null||a.pivotColIds.forEach((x,A)=>{const k=g(x);k.pivot=!0,k.pivotIndex=A}),this.gos.updateGridOptions({options:{pivotMode:!!(a!=null&&a.pivotMode)},source:t})),(y||!n)&&(v.pivot=null,v.pivotIndex=null);const E=f("columnPinning",l);if(E){for(const x of(l==null?void 0:l.leftColIds)??[])g(x).pinned="left";for(const x of(l==null?void 0:l.rightColIds)??[])g(x).pinned="right"}(E||!n)&&(v.pinned=null);const _=f("columnVisibility",u);if(_)for(const x of(u==null?void 0:u.hiddenColIds)??[])g(x).hide=!0;(_||!n)&&(v.hide=null);const I=f("columnSizing",c);if(I)for(const{colId:x,flex:A,width:k}of(c==null?void 0:c.columnSizingModel)??[]){const M=g(x);M.flex=A??null,M.width=k}(I||!n)&&(v.flex=null);const T=d==null?void 0:d.orderedColIds,F=!!(T!=null&&T.length)&&!(o!=null&&o.has("columnOrder")),V=F?T.map(x=>g(x)):Object.values(p);(V.length||h)&&(this.columnStates=V,ni(this.beans,{state:V,applyOrder:F,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);ni(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 Vbe(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 u=s.has(l);return u&&s.delete(l),{groupId:l,open:u}});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(u=>u.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(!Aa(t)||!n)return;const r=[];for(const i of(e==null?void 0:e.cellRanges)??[]){const a=[];for(const u of i.colIds){const c=o.getCol(u);c&&a.push(c)}if(!a.length)continue;let l=o.getCol(i.startColId);if(!l){const u=s.allCols,c=new Set(a);l=u.find(d=>c.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];Dp(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),Dp(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")}},G_e={moduleName:"GridState",version:ct,beans:[H_e],apiFunctions:{getState:L_e,setState:V_e}};function U_e(e){return e.rowModel.isLastRowIndexKnown()}function W_e(e){var t;return((t=e.pagination)==null?void 0:t.getPageSize())??100}function z_e(e){var t;return((t=e.pagination)==null?void 0:t.getCurrentPage())??0}function j_e(e){var t;return((t=e.pagination)==null?void 0:t.getTotalPages())??1}function K_e(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function q_e(e){var t;(t=e.pagination)==null||t.goToNextPage()}function Y_e(e){var t;(t=e.pagination)==null||t.goToPreviousPage()}function X_e(e){var t;(t=e.pagination)==null||t.goToFirstPage()}function Z_e(e){var t;(t=e.pagination)==null||t.goToLastPage()}function J_e(e,t){var n;(n=e.pagination)==null||n.goToPage(t)}var Q_e=class extends qe{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(qu(t),1),s=Math.floor(e/o);t.pagination.setPageSize(s,"autoCalculated")};this.isBodyRendered?Yo(this,n,50)():(n(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},ug="paginationPageSizeSelector",eRe={tag:"span",cls:"ag-paging-page-size"},tRe=class extends Cn{constructor(){super(eRe),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(ug,()=>{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(){qo(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(ug)!==!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(ug)!==!0;Qe(94,{pageSizeSet:s,pageSizesSet:r,pageSizeOptions:e,paginationPageSizeOption:t}),r||Qe(95,{paginationPageSizeOption:t,paginationPageSizeSelector:ug}),e.unshift("")}const o=String(n?"":t);this.selectPageSizeComp?(Fl(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 Z_).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(ug);return!Array.isArray(t)||!(t!=null&&t.length)?e:[...t].sort((n,o)=>n-o)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},nRe={selector:"AG-PAGE-SIZE-SELECTOR",component:tRe},oRe=".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}",sRe=class extends V${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(oRe)}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(),[nRe]);const{btFirst:t,btPrevious:n,btNext:o,btLast:s}=this;this.activateTabIndex([t,n,o,s]),t.insertAdjacentElement("afterbegin",kr(e?"last":"first",this.beans)),n.insertAdjacentElement("afterbegin",kr(e?"next":"previous",this.beans)),o.insertAdjacentElement("afterbegin",kr(e?"previous":"next",this.beans)),s.insertAdjacentElement("afterbegin",kr(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):Qpe(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===Ve.ENTER||o.key===Ve.SPACE)&&(o.preventDefault(),n())}})}Jpe(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}):Bbe(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){pce(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,u=!e&&n<l,c=this.formatNumber(i);this.lbFirstRowOnPage.textContent=c;let d;const h=this.getLocaleTextFunc();u?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,w;if(e)v=this.formatNumber(t),w=this.formatNumber(o);else{const S=h("more","more");v=S,w=S}this.lbTotal.textContent=v,this.lbRecordCount.textContent=w,this.announceAriaStatus(c,d,w,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"),u=`${e} ${a} ${t} ${l} ${n}`,c=`${i} ${o} ${l} ${s}`;u!==this.ariaRowStatus&&(this.ariaRowStatus=u,(d=this.ariaAnnounce)==null||d.announceValue(u,"paginationRow")),c!==this.ariaPageStatus&&(this.ariaPageStatus=c,(h=this.ariaAnnounce)==null||h.announceValue(c,"paginationPage"))}},rRe={selector:"AG-PAGINATION",component:sRe},iRe=class extends qe{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 rRe}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 ft(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:ft(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:ft(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:ft(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})}},aRe={moduleName:"Pagination",version:ct,beans:[iRe,Q_e],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:U_e,paginationGetPageSize:W_e,paginationGetCurrentPage:z_e,paginationGetTotalPages:j_e,paginationGetRowCount:K_e,paginationGoToNextPage:q_e,paginationGoToPreviousPage:Y_e,paginationGoToFirstPage:X_e,paginationGoToLastPage:Z_e,paginationGoToPage:J_e},dependsOn:[Ow]};function lRe(e,t={}){const n=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(n))}function IG(e,t,n,o,s){t&&(o&&t.parent&&t.parent.level!==-1&&IG(e,t.parent,n,o,s),t.setExpanded(n,void 0,s))}function uRe(e,t){return e.rowModel.getRowNode(t)}function cRe(e,t,n,o){e.rowRenderer.addRenderedRowListener(t,n,o)}function dRe(e){return e.rowRenderer.getRenderedNodes()}function hRe(e,t,n){e.rowModel.forEachNode(t,n)}function fRe(e){return e.rowRenderer.firstRenderedRow}function pRe(e){return e.rowRenderer.lastRenderedRow}function gRe(e,t){return e.rowModel.getRow(t)}function mRe(e){return e.rowModel.getRowCount()}var vRe={moduleName:"RowApi",version:ct,apiFunctions:{redrawRows:lRe,setRowNodeExpanded:IG,getRowNode:uRe,addRenderedRowListener:cRe,getRenderedNodes:dRe,forEachNode:hRe,getFirstDisplayedRowIndex:fRe,getLastDisplayedRowIndex:pRe,getDisplayedRowAtIndex:gRe,getDisplayedRowCount:mRe}},yRe={moduleName:"ScrollApi",version:ct,apiFunctions:{getVerticalPixelRange:PEe,getHorizontalPixelRange:kEe,ensureColumnVisible:uG,ensureIndexVisible:cG,ensureNodeVisible:FEe}};function wRe(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 CRe(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function bRe(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function SRe(e){var t;return((t=e.animationFrameSvc)==null?void 0:t.isQueueEmpty())??!0}function ERe(e){var t;(t=e.animationFrameSvc)==null||t.flushAllFrames()}function _Re(e){return{rowHeight:qu(e),headerHeight:Xp(e)}}function RRe(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(Kp(a))}if((r=t.columns)!=null&&r.length)return n;const o=[],s=qR(t.rowNodes);for(const i of e.rowRenderer.getAllRowCtrls()){if(s&&!YR(i.rowNode,s)||!i.isFullWidth())continue;const a=i.getFullWidthCellRenderers();for(let l=0;l<a.length;l++){const u=a[l];u!=null&&o.push(Kp(u))}}return[...o,...n]}var TRe={moduleName:"RenderApi",version:ct,apiFunctions:{setGridAriaProperty:wRe,refreshCells:CRe,refreshHeader:bRe,isAnimationFrameQueueEmpty:SRe,flushAllAnimationFrames:ERe,getSizesForCurrentTheme:_Re,getCellRendererInstances:RRe}};function DRe(e,t){var n,o;typeof t=="number"?(n=e.colAutosize)==null||n.sizeColumnsToFit(t,"api"):(o=e.colAutosize)==null||o.sizeColumnsToFitGridBody(t)}function xG({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 IRe(e,t){var n;t&&typeof t=="object"?xG(e,t):(n=e.colAutosize)==null||n.autoSizeAllColumns({source:"api",skipHeader:t})}var xRe=class extends qe{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&&io(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 u;const s=c=>qd(t,Array.from(c),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return s(o);const r=AG(this.beans),i=c=>n.leftCols.some(d=>Wp(d,c)),a=c=>n.rightCols.some(d=>Wp(d,c)),l=e.colKeys.filter(c=>!ka(c)&&!Fa(c)&&!i(c)&&!a(c));this.sizeColumnsToFit(r,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:(u=e.columnLimits)==null?void 0:u.map(c=>({...c,key:c.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:u=[],source:c="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 w=-1;const S=Object.fromEntries(u.map(({colId:E,..._})=>[E,_])),b=s??this.gos.get("skipHeaderOnAutoSize"),y=r??b;for(;w!==0;){w=0;const E=[];for(const _ of o){if(!_||Tde(_))continue;const I=f.getCol(_);if(!I||v.has(I))continue;const T=p.getPreferredWidthForColumn(I,b);if(T>0){const F=S[I.colId]??{};F.minWidth??(F.minWidth=l),F.maxWidth??(F.maxWidth=a);const V=ARe(I,T,F);I.setActualWidth(V,c),v.add(I),w++}E.push(I)}E.length&&g.refresh(c)}y||this.autoSizeColumnGroupsByColumns(o,c,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 u=l.getParent();for(;u&&u!=n;)u.isPadding()||r.add(u),u=u.getParent()}let a;for(const l of r){for(const u of s.getHeaderRowContainerCtrls())if(a=u.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 sc(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=AG(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):Qe(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,...w}of(o==null?void 0:o.columnLimits)??[])s[typeof v=="string"?v:v.getColId()]=w;const r=this.beans.visibleCols.allCols;if(e<=0||!r.length)return;const i=Pa(r);if(o!=null&&o.onlyScaleUp&&i>e||e===i&&r.every(w=>{if(w.colDef.suppressSizeToFit)return!0;const S=s==null?void 0:s[w.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),E=w.getActualWidth();return(b==null||E>=b)&&(y==null||E<=y)}))return;const l=[],u=[];for(const v of r){const w=((p=o==null?void 0:o.colKeys)==null?void 0:p.some(S=>Wp(v,S)))??!0;v.getColDef().suppressSizeToFit||!w?u.push(v):l.push(v)}const c=l.slice(0);let d=!1;const h=v=>{ti(l,v),u.push(v)};for(const v of l){v.resetActualWidth(t);const w=s==null?void 0:s[v.getId()],S=(w==null?void 0:w.minWidth)??(o==null?void 0:o.defaultMinWidth),b=(w==null?void 0:w.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-Pa(u);if(v<=0)for(const w of l){const S=((g=s==null?void 0:s[w.getId()])==null?void 0:g.minWidth)??(o==null?void 0:o.defaultMinWidth)??w.minWidth;w.setActualWidth(S,t,!0)}else{const w=v/Pa(l);let S=v;for(let b=l.length-1;b>=0;b--){const y=l[b],E=s==null?void 0:s[y.getId()],_=(E==null?void 0:E.minWidth)??(o==null?void 0:o.defaultMinWidth),I=(E==null?void 0:E.maxWidth)??(o==null?void 0:o.defaultMaxWidth),T=y.getMinWidth(),F=y.getMaxWidth(),V=typeof _=="number"&&_>T?_:T,x=typeof I=="number"&&I<F?I:F;let A=Math.round(y.getActualWidth()*w);A<V?(A=V,h(y),d=!1):A>x?(A=x,h(y),d=!1):b===0&&(A=S),y.setActualWidth(A,t,!0),S-=A}}}for(const v of c)v.fireColumnWidthChangedEvent(t);const f=this.beans.visibleCols;f.setLeftValues(t),f.updateBodyWidths(),!n&&qd(this.eventSvc,c,!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:u,maxWidth:c})=>({key:l,minWidth:u,maxWidth:c}));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 ARe(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 AG({ctrlsSvc:e,scrollVisibleSvc:t}){const n=e.getGridBodyCtrl(),s=n.isVerticalScrollShowing()?t.getScrollbarWidth():0;return kp(n.eGridBody)-s}var PRe={moduleName:"ColumnAutoSize",version:ct,beans:[xRe],apiFunctions:{sizeColumnsToFit:DRe,autoSizeColumns:xG,autoSizeAllColumns:IRe},dependsOn:[tH]},kRe=".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 FRe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedTopRowCount())??0}function ORe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedBottomRowCount())??0}function MRe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedTopRow(t)}function NRe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedBottomRow(t)}function LRe(e,t,n){var o;return(o=e.pinnedRowModel)==null?void 0:o.forEachPinnedRow(t,n)}var VRe={moduleName:"PinnedRow",version:ct,beans:[Mge],css:[kRe],apiFunctions:{getPinnedTopRowCount:FRe,getPinnedBottomRowCount:ORe,getPinnedTopRow:MRe,getPinnedBottomRow:NRe,forEachPinnedRow:LRe},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},BRe=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}},$Re=class extends qe{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),u=new Map,c=n.getCallback("isFullWidthRow"),d=a.equals,h=a.spanRows,f=typeof h=="function";let p=null,g=null,v;const w=(y,E)=>{p=y,g=null,v=E},S=y=>{const E=!y.isExpandable()&&!y.group&&!y.detail&&(c?!c({rowNode:y}):!0);if(y.rowIndex==null||!E){w(null,null);return}if(p==null||y.level!==p.level||y.footer||g&&y.rowIndex-1!==(g==null?void 0:g.getLastNode().rowIndex)){w(y,r.getValue(t,y));return}const _=r.getValue(t,y);if(f){const I=Nt(n,{valueA:v,nodeA:p,valueB:_,nodeB:y,column:t,colDef:a});if(!h(I)){w(y,_);return}}else if(d?!d(v,_):v!==_){w(y,_);return}if(!g){const I=l==null?void 0:l.get(p);(I==null?void 0:I.firstNode)===p?(I.reset(),g=I):g=new BRe(t,p),u.set(p,g)}g.addSpannedNode(y),u.set(y,g)};switch(e){case"center":(b=s.forEachDisplayedNode)==null||b.call(s,y=>{(!i||i.isRowInPage(y.rowIndex))&&S(y)}),this.centerValueNodeMap=u;break;case"top":o==null||o.forEachPinnedRow("top",S),this.topValueNodeMap=u;break;case"bottom":o==null||o.forEachPinnedRow("bottom",S),this.bottomValueNodeMap=u;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}}},HRe=class extends qe{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=Yo(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=Yo(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 $Re(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()}},GRe=class extends ih{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||Ny(e,t.rowIndex)}setAriaRowSpan(){wce(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(Sw(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}},URe=class extends kw{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 GRe(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(){}},WRe=class extends qe{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,(u,c)=>{if(r.has(c.firstNode))return;const d=n.get(c.firstNode);if(d){r.set(c.firstNode,d),n.delete(c.firstNode);return}i=!0;const h=new URe(c.firstNode,this.beans,!1,!1,!1);r.set(c.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")}},zRe={moduleName:"CellSpan",version:ct,beans:[HRe,WRe]},jRe=class extends qe{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);jR(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 Nt(this.beans.gos,{value:n,data:o.data,node:o,colDef:t,column:e,rowIndex:o.rowIndex})}},KRe=class extends qe{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,n,o){jR(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 jRe(e,t)}processStaticCellClasses(e,t,n){this.getStaticCellClasses(e,t).forEach(s=>{n(s)})}},qRe={moduleName:"CellStyle",version:ct,beans:[KRe]},YRe={moduleName:"RowStyle",version:ct,beans:[MCe]};function XRe(e,t){var n;return!!((n=e.colHover)!=null&&n.isHovered(t))}var ZRe=class extends qe{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 u of this.destroyManagedListeners)u();this.destroyManagedListeners=[]}}}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{this.enableFeature(e)}),this.enableFeature()}destroy(){super.destroy(),this.destroyManagedListeners=null}},JRe="ag-column-hover",QRe=class extends qe{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(JRe,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 ZRe(t,n))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},eTe={moduleName:"ColumnHover",version:ct,beans:[QRe],apiFunctions:{isColumnHovered:XRe}},tTe=class extends qe{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=!xw.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)=>{xw.has(i)&&t(i,a)},o=(i,a)=>{xw.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 nTe(e,t,n){var o;(o=e.apiEventSvc)==null||o.addListener(t,n)}function oTe(e,t,n){var o;(o=e.apiEventSvc)==null||o.removeListener(t,n)}function sTe(e,t){var n;(n=e.apiEventSvc)==null||n.addGlobalListener(t)}function rTe(e,t){var n;(n=e.apiEventSvc)==null||n.removeGlobalListener(t)}var iTe={moduleName:"EventApi",version:ct,apiFunctions:{addEventListener:nTe,addGlobalListener:sTe,removeEventListener:oTe,removeGlobalListener:rTe},beans:[tTe]},aTe={moduleName:"Locale",version:ct,beans:[Nbe]},lTe=class extends qe{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=Yo(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){var a,l,u,c;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=Pl(this.beans,d).height;for(const g of s){let v=h==null?void 0:h[g.getColId()];const w=n==null?void 0:n.getCellSpan(g,d);if(w){if(w.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),(u=t.forEachDisplayedNode)==null||u.call(t,i),r&&((c=t.onRowHeightChanged)==null||c.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=c=>{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}=ju(o),g=d+h+f+p,w=t.offsetHeight+g;if(c<5){const b=Ho(i),y=!(b!=null&&b.contains(t)),E=w==0;if(y||E){window.setTimeout(()=>a(c+1),0);return}}this.setRowAutoHeight(s,w,r)},l=()=>a(0);l();const u=Il(i,t,l);return n.addDestroyFunc(()=>{u(),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}},uTe={moduleName:"RowAutoHeight",version:ct,beans:[lTe]},cTe={moduleName:"AllCommunity",version:ct,dependsOn:[RG,m_e,T_e,eSe,c0e,d0e,h0e,f0e,p0e,g0e,m0e,u0e,nEe,oEe,sEe,tEe,iEe,aEe,G_e,H0e,aRe,rH,vRe,yRe,TRe,PRe,Yme,VRe,P0e,vbe,qRe,eTe,YRe,iTe,Cbe,N_e,iG,aTe,uTe,qme,u_e,zRe]};let PG=!1;PG||(nde.registerModules([cTe,RG]),PG=!0);class dTe{constructor(t,n){Rn(this,"gridApi",null);Rn(this,"container");Rn(this,"config");Rn(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=kbe(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 hTe=dH.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"),fTe=nt({__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=$(null);_E(r,()=>{var v;const g=(v=i.value)==null?void 0:v.getApi();g==null||g.clearFocusedCell()});const i=$(null),a=X(()=>({width:"100%",height:o.height||"500px"})),l=X(()=>({...o,theme:hTe}));function u(){var v;if(!r.value){console.warn("Grid container element not found");return}const g={...l.value,height:o.height};i.value=new dTe(r.value,g),i.value.init(),(v=i.value.getApi())==null||v.addEventListener("bodyScroll",()=>{s("on-scroll",new Event("scroll"))}),c()}function c(){var v;const g=((v=i.value)==null?void 0:v.getApi())??null;s("onGridReady",g)}function d(g){var w,S;if(!g)return;(w=i.value)==null||w.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 Je(()=>o.columnDefs,(g,v)=>{const w=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(",");w!==S&&d(g)},{deep:!0}),Vn(()=>{h()}),t({gridApi:f,gridManager:p,syncColumnDefs:d}),Zt(()=>{u()}),Vn(()=>{h()}),(g,v)=>(q(),de("div",{ref_key:"gridContainerRef",ref:r,style:hn(a.value),class:le(["ag-theme-quartz",["ag-table-container",o.isSorting?"is-sorting":""]])},null,6))}});function lc(e){return uB(e)}const pTe=()=>[...[{headerName:"Thumbnail",field:"thumbnail",sortable:!1,filter:!1,pinned:"left",lockPinned:!0,suppressMovable:!0,headerComponent:lc(Sl),width:86,resizable:!1},{headerName:"Name",field:"name",sortable:!1,filter:!1,pinned:"left",lockPinned:!0,headerComponent:lc(Sl),suppressMovable:!0},{headerName:"Notes",field:"description",sortable:!1,filter:!1,suppressMovable:!1},{headerName:"Assignee",field:"assignees",sortable:!1,filter:!1,headerComponent:lc(Sl)},{headerName:"Status",field:"status",sortable:!1,filter:!1,headerComponent:lc(Sl)},{headerName:"Date Range",field:"dateRange",sortable:!1,filter:!1,headerComponent:lc(Sl)},{headerName:"Last Updated",field:"lastUpdated",sortable:!1,filter:!1,headerComponent:lc(Sl),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:lc(Sl),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=>Tp.fromType(n))],$w={WIDTH:60,HEADER_CLASS:"ag-checkbox-header"},gTe=()=>({field:"__checkboxSelection",checkboxSelection:!0,headerCheckboxSelection:!0,pinned:"left",width:$w.WIDTH,minWidth:$w.WIDTH,maxWidth:$w.WIDTH,cellClass:"ag-checkbox-cell",headerClass:$w.HEADER_CLASS,headerComponent:My(zse),suppressMovable:!0}),kG="blank",mTe=[kG,"__checkboxSelection","options"],vTe=["uiColumnResized","uiColumnMoved","api"],yTe={headerName:"",field:"options",sortable:!1,filter:!1,editable:!0,pinned:"right",lockPosition:!0,suppressMovable:!0,resizable:!1},FG=(e,t)=>t!=null&&t.width?{...e,width:t.width,flex:void 0}:e,wTe=(e,t,n)=>{const{getCachedValue:o,setCachedValue:s}=bf({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=$([]),a=gTe();let l=0;const u=async d=>{const h=++l,f=await r();if(h!==l)return;const p=new Map(f==null?void 0:f.map(k=>[k.field,k])),g=pTe(),v=Tp.fromType(yTe),w=!!f,b=((d==null?void 0:d.map(k=>{var M;return{headerName:k.name,field:`metric_${k.id}`,editable:((M=k==null?void 0:k.auth_permission)==null?void 0:M.permission)==2,sortable:!0,filter:!1,flex:1,context:{...k},hide:w?!p.has(`metric_${k.id}`):!(k.is_primary||k.is_point_metric),cellClass:"ag-cell-optimized",headerComponent:My(Sl),headerComponentParams:()=>({headerType:k.metric_type.code=="number"||k.metric_type.code=="formula"?"number":"default"})}}))||[]).map(k=>Tp.fromType(k)),y=[a,...g,...b,v],E=[],_=[],I=[];for(const k of y)k.pinned==="left"?E.push(k):k.pinned==="right"||k.field===kG?_.push(k):I.push(k);if(!f||f.length===0){i.value=y;return}const T=new Map(I.map(k=>[k.field,k])),F=[];for(const k of f)if(k.field&&T.has(k.field)){const M=T.get(k.field);F.push({...FG(M,k),hide:k.hide}),T.delete(k.field)}const V=Array.from(T.values()),x=[...F,...V].map(k=>({...k,lockPinned:!0})),A=k=>{const M=p.get(k.field),N=FG(k,M);return M&&M.hide!==void 0?{...N,hide:M.hide}:N};i.value=[...E.map(A),...x,..._.map(A)]};Je(e,d=>u(d),{immediate:!0});const c=wr((d,h)=>{if((d==null?void 0:d.source)!==void 0&&!vTe.includes(d.source))return;const f=n.value,p=f==null?void 0:f.getColumnDefs(),g=new Map;if(f==null||f.getColumnState().forEach(w=>{w.width&&g.set(w.colId,Number(w.width))}),i.value=p||i.value,!h)return;const v=(p??[]).filter(w=>w.field&&!mTe.includes(w.field)).map(w=>({field:w.field,hide:w.hide,width:g.get(w.field)||w.width,pinned:w.pinned}));s(t,JSON.stringify(v))},Si);return nD(()=>c.cancel()),{columnDefs:i,checkboxColumn:a,saveColumnConfig:c}},CTe=()=>{const e=un.getInstance().getItem("API_BASE_URL");return e!=null&&e.includes("v1")?e.slice(0,e.lastIndexOf("/v1")):String(e)},bTe=e=>{var A,k,M;const{showMessage:t,showErrorNetMessage:n}=_s(),o=oo(),s={domainApi:CTe(),wsCode:un.getInstance().getItem("ws.code"),entityId:e.value.entityId},r=(M=(k=(A=o==null?void 0:o.appContext)==null?void 0:A.config)==null?void 0:k.globalProperties)==null?void 0:M.apiConfig;if(!r||s.domainApi===""||s.wsCode==="")throw new Error("API configuration is missing in useItems");const i=new ON(r,s);i.on("call-api",N=>{N.success?t(N.apiCode,"success"):n(N)});const a=Oo({}),l=$([]),u=$(!1),c=$(null),d=$(null),h=$(1),f=$(20);let p=Promise.resolve();const{setCachedUsers:g}=RJ(),v=N=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",include_permission:"{include_permission}",include_permission_names:!0,q:N}),w=50,S=async(N,B,z)=>{if(!N.length)return[];const oe=B9(N,B);return(await Promise.all(oe.map(z))).flat()},b=async N=>{try{return(await i.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:N})).data.map(z=>[z==null?void 0:z.id,z.permission])}catch(B){return console.error("Failed to fetch item permissions chunk:",B),[]}},y=async(N,B)=>{try{const z=await i.getMetricValues({workspaceId:e.value.workspaceId,item_ids:N,per_page:N.length*B.length,metric_ids:B}),oe=z.data.map(te=>{const se=new Map(te.item_metrics.map(P=>[P.metric_id,{value:P.value,auth_permission:P==null?void 0:P.auth_permission}])),Z=Object.fromEntries(B.map(P=>[P,se.get(P)??null]));return[te==null?void 0:te.id,Z]}),ie=new Set(z.data.map(te=>te==null?void 0:te.id));for(const te of N)if(!ie.has(te)){const se=Object.fromEntries(B.map(Z=>[Z,{value:null,auth_permission:void 0}]));oe.push([te,se])}return oe}catch(z){return console.error("Failed to fetch a chunk of metric values:",z),N.map(ie=>[ie,Object.fromEntries(B.map(te=>[te,void 0]))])}},E=async N=>{try{const B=await i.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:N,per_page:N.length}),z=B.data.flatMap(oe=>oe.assignees);return g(z),B.data.map(oe=>[oe==null?void 0:oe.id,oe==null?void 0:oe.assignees])}catch(B){return console.error("Failed to fetch a chunk of assigned users:",B),[]}},_=async N=>{if(!N.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const B=await S(N,w,b);return Object.fromEntries(B)}catch(B){return console.error("Failed to fetch item permissions:",B),{}}},I=async(N,B)=>!N.length||!B.length?{}:(p=p.then(async()=>{try{const ie=[];let te=0;for(let Z=0;Z<B.length;Z+=5){te++;const P=B.slice(Z,Z+5),j=[];for(let ge=0;ge<P.length;ge++){const xe=P[ge],ue=await S(N,w,K=>y(K,[xe]));j.push(ue),await new Promise(K=>setTimeout(K,500))}ie.push(...j);const ne=Z+5>=B.length}const se={};for(const Z of ie.flat()){const[P,j]=Z;se[P]||(se[P]={}),Object.assign(se[P],j)}return se}catch(z){return console.error("Failed to fetch metric values:",z),{}}}),p),T=async N=>{if(!N.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const B=await S(N,w,E);return Object.fromEntries(B)}catch(B){return console.error("Failed to fetch assigned users:",B),{}}};return{items:l,loading:u,error:c,pagination:d,currentPage:h,pageSize:f,cusorMap:a,fetchItems:async N=>{const{cursor:B,offset:z,size:oe,searchQuery:ie}=N;let te=[];u.value=!0,c.value=null;try{const se=await i.getAllItem_cursor({...N,cursor:B||void 0,offset:z||void 0,pageSize:oe||f.value,...v(ie),sortBy:N.sort_by});return l.value=se.data,d.value=se.meta,h.value=se.meta.current_page||0,te=se.data.map(Z=>Z==null?void 0:Z.id),se}catch(se){throw c.value=se,console.error("Failed to fetch items (cursor):",se),se}finally{const se=async()=>{try{const[Z,P]=await Promise.all([T(te),_(te)]);e.value.updateItemData({assignees:Z,permission:P},te);const j=await I(te,e.value.metricIds);e.value.setMetricValues(j,new Set(te),e.value.metricIds)}catch(Z){console.error("Post-fetch processing failed:",Z)}};u.value=!1,setTimeout(se)}},getAssignableStatus:async N=>{try{return await i.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:N})}catch(B){throw console.error("Failed to fetch assignable status:",B),B}},getMetricList:async N=>{try{return await i.getMetricList({workspaceId:e.value.workspaceId,entityId:N})}catch(B){throw console.error("Failed to fetch metric list:",B),B}},getMetricValues:I,getAssignedUsers:T}};function STe(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(u=>{if(u.field&&u.field.startsWith("metric_")&&(u.hide===!1||u.hide===void 0))return u.field}).filter(Boolean);s.forEach(u=>{var d;const c=(d=e.value)==null?void 0:d.getRowNode(u);if(c){if(r.push(c),o.assignees){const h=hJ((o.assignees[u]||[]).map(bO));c.data.assignees=h,i.add("assignees")}o.permission&&(c.data.permissions=o.permission[u]),l.forEach(h=>{c.data[h]=c.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(u=>[u,new Map(r.map(c=>[c,{value:null,auth_permission:void 0}]))]));Object.entries(o).forEach(([u,c])=>{Object.entries(c).forEach(([d,h])=>{var f;(f=a.get(u))==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(([u,c])=>{const d=i.getRowNode(u);return d!=null&&d.data?(c.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(u=>`metric_${u}`),force:!0})}}}function ETe(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:u}=await e({page:a,pageSize:t,filterText:n(),sort_by:i.sortModel});let c=-1;Number.isFinite(u)?c=u:l.length<t&&(c=i.startRow+l.length),i.context={pageSize:t,text:n()},i.successCallback(l,c),o(!1),s(!1)}catch(a){console.error("Datasource fetch error:",a),i.failCallback(),o(!1),s(!1)}}}}function _Te(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:o,gridApi:s,fetcher:r}=e,i=$(!0),a=$(!0),l=$(!1),u=()=>{n.value=!n.value},c=v=>{if(i.value=!1,s.value=v,!v)return null;const{addEventListener:w,setGridOption:S}=v;if(!r)return console.error("Fetcher function is undefined"),null;const b=ETe(r,e.perPage,()=>o.value,y=>{i.value=y},y=>{a.value=y});return S==null||S("datasource",b),w==null||w("selectionChanged",()=>{t.value=v.getSelectedRows()}),v||null},d=v=>{var w,S;if((w=s.value)==null||w.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=wr(v=>{d(v)},Si);return{isLoading:i,toggleSidebar:u,onGridReady:c,onSearch:f,handleUnSelect:h,firstLoad:a,cacheCleared:l,handleSelectAll:()=>{s.value},isSelectAll:$(!1)}}const RTe={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."]}}},TTe=e=>{var t;return(t=Object.entries(RTe.changelog).find(([n,o])=>n===e))==null?void 0:t[1].changes},DTe={class:"visual-btn-visual"},ITe={class:"visual-btn--label"},xTe={key:0,class:"visual-btn--description"},ATe={key:1,class:"visual-btn--description"},Hw=_t(nt({__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)=>(q(),de("div",{class:le(["visual-btn",{"visual-btn--disabled":e.disabled}]),onClick:o},[Se("div",DTe,[kt(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)]),Se("div",ITe,it(n.label),1),n.disabled?(q(),de("div",xTe," Coming soon ")):(q(),de("div",ATe,it(n.description),1))],2))}}),[["__scopeId","data-v-c2003bd7"]]),OG="xlsx_toolbox",MG="feedback_lockup_toolbox",PTe="TOOLBOX_EXPORT_DATA",kTe="https://app.arbocollab.com",FTe=1e3,NG=()=>sessionStorage.getItem("BASE_URL"),LG=(e,t="xlsx-mapping")=>{const n=Dn("switchInstance",void 0),o=`${t}:load`,s=`${t}:edit`,r=new Set;let i;const a=()=>{const h=t==="xlsx-mapping"?OG:MG,f={showLoad:!1};n?n(h,"",f):window.appManager.switchInstance(h,"",f)},l=(h,f)=>{const p=setTimeout(()=>{r.delete(p),window.postMessage({type:h,payload:f},`${NG()}`)},FTe);r.add(p)},u=h=>{if(!h)throw new Error("Payload is missing");a(),l(o,h)},c=(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)!==PTe)return;const{file:f,fileName:p}=h.payload;e({channel:t,file:new File([f],p,{type:f.type}),fileName:p});const g=t==="xlsx-mapping"?OG:MG;g=="xlsx_toolbox"&&window.appManager.hide(g)};return Zt(()=>{i=zne({target:window,allowedOrigins:[NG()||kTe],onMessage:d,onInvalidMessage:(h,f,p)=>{console.warn("Rejected postMessage:",f,p.origin)}})}),Vn(()=>{i==null||i(),r.forEach(clearTimeout),r.clear()}),{openToolbox:u,sendBackErrorFile:c}},OTe={class:"header-name"},MTe={class:"description"},NTe={key:0,class:"error-message"},LTe={class:"dynamic"},VTe={key:1,class:"choose-method-container"},BTe={key:3,class:"select-status-container"},$Te={key:4,class:"result-container"},HTe={key:5,class:"result-container"},GTe={key:0},UTe={key:3},VG="text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",WTe=20,zTe=_t(nt({__name:"PopupToolboxUploader",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const o=Kt,s=X(()=>[1,2,6].includes(b.value)),r=X(()=>Sv()),i=X(()=>({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."},6:{title:`Create ${r.value} by count`,description:""},7:{title:"Creation in progress",description:"Work will be created in the background. Refresh to see updates."},8:{title:"Creation failed",description:""}})),a=["csv","xlsx","xls"],l=$({segments:[],count:0}),u=({data:R,count:G,template_flow_status_id:J})=>{console.log("handleChangeCreateWithCount called with data:",R,"count:",G,"template_flow_status_id:",J),l.value={segments:R,count:G,template_flow_status_id:J}},c=$(!1),d=async()=>{var R;if(!((R=v.value)!=null&&R.bulkCreate)){console.error("API services not available");return}c.value=!0;try{(await v.value.bulkCreate({workspaceId:f.workspaceId,entityId:f.entityId,payload:{...l.value,entity_id:f.entityId},filter:{}})).status===Er.ACCEPTED&&(b.value=7,g("import-success"))}catch(G){B(G),b.value=8}finally{c.value=!1}},h={"--popup-pt":"20px","--popup-pb":"20px","--popup-pl":"24px","--popup-pr":"24px"},f=e,p=X(()=>Sv()),g=n,{apiServices:v}=so(!1,f),w=1,S=$(),b=$(w),y=$(null),E=$(null),_=$(null),I=$(void 0),T=$(null),F=X(()=>i.value[b.value]),V=$(),x=()=>{var R;y.value=null,b.value=w,E.value=null,_.value=null,M.value=null,T.value=null,(R=V.value)==null||R.clear(),I.value=void 0,l.value={segments:[],count:0}},A=()=>{b.value=6},k=()=>{var R;x(),(R=S.value)==null||R.hide()};Je([E,_],([R,G])=>{b.value===1&&R&&G&&(b.value=2)});const M=$(null),N=R=>_s().getErrorMessageFromResponse(R),B=R=>{if(console.error(R),typeof R=="string"){M.value=R;return}const G=R.response,J=G==null?void 0:G.data,ce=N(J);M.value=ce??R.message},z=async(R,G)=>{var ce;if(!v.value||!f.workspaceId||!f.entityId){console.error("API services not available");return}K.value=!0;const J=new FormData;J.append("file",R),J.append("format",((ce=G??R.name)==null?void 0:ce.split(".").pop())??R.name.split(".").pop()??""),J.append("entity_id",f.entityId),J.append("template_flow_status_id",y.value??"");try{await v.value.addNewSceneViaImportFile(f.workspaceId,f.entityId,J),b.value=3,g("import-success")}catch(Ee){console.error("Error uploading file:",Ee),B(Ee||"An unknown error occurred during file upload."),b.value=4}finally{K.value=!1}},{openToolbox:oe,sendBackErrorFile:ie}=LG(({file:R,fileName:G,channel:J})=>{J==="xlsx-mapping"&&(_.value=R,I.value=G??R.name,b.value=2)}),te=$(null),se=async()=>{var R,G;b.value=6,await ht(),(G=(R=te.value)==null?void 0:R.focus)==null||G.call(R)},Z=async()=>{try{const R=await j();oe({template:R})}catch(R){console.error("Error opening toolbox:",R),_s().showErrorNetMessage("Failed to open toolbox.")}},P=$(!1),j=async()=>{P.value=!0;const R=f.workspaceId,G=f.entityId;if(!R||!G||!v.value)return P.value=!1,Promise.reject(new Error("Workspace ID or Entity ID is missing"));try{const J=await v.value.downloadTemplate(R,G,!1);if(!J)throw new Error("No response from downloadTemplate API");return J}catch(J){return console.error("Error downloading template:",J),Promise.reject(J)}finally{P.value=!1}},ne=R=>{var ce;const G=((ce=R.name.split(".").pop())==null?void 0:ce.toLowerCase())??"",J=VG.split(",").map(Ee=>Ee.trim()).includes(R.type)||a.includes(G);return J||(console.error("Invalid file type:",R.type),_s().addNotification({id:"invalid-file-type",message:"Invalid file type. Please upload a xlsx, xls, csv file.",type:"error"})),J},ge=async()=>{const R=document.createElement("input");R.type="file",R.accept=`${VG}, ${a.map(G=>`.${G}`).join(", ")}`,R.onchange=async()=>{var J;const G=(J=R.files)==null?void 0:J[0];if(G){if(!ne(G)){x();return}E.value=nv(G);try{const ce=await j();if(!ce){_s().addNotification({id:"failed-download-template",message:"Failed to download template file.",type:"error"});return}oe({source:G,template:ce})}catch(ce){console.error("Error opening toolbox:",ce),_s().addNotification({id:"failed-open-toolbox",message:"Failed to open toolbox.",type:"error"})}}},R.click()},xe=async R=>{var G;if(!((G=v.value)!=null&&G.getAssignableStatuses)){console.error("API services not available");return}return v.value.getAssignableStatuses(f.workspaceId,{entity_id:f.entityId,name_like:R.name_like,page:R.page,per_page:WTe})},ue=X(()=>{var R;return l.value.count==0||!((R=l.value.segments)!=null&&R.length)}),K=$(!1),Y=()=>{y.value=null,_.value&&I.value&&ie(_.value,I.value)},re=()=>{y.value&&_.value&&z(_.value,I.value)};return t({open:()=>{var R;return(R=S.value)==null?void 0:R.show()},close:()=>{var R;return(R=S.value)==null?void 0:R.hide()},hideFirstStep:()=>{var R;b.value===1&&((R=S.value)==null||R.hide())}}),(R,G)=>(q(),Ke(L(qN),jt({ref_key:"popupRef",ref:S,style:h,onHidden:x},{popupIndex:10,popupName:F.value.title,minWidth:"420px",showOverlay:!0,overlayOpacity:.5,closeOnOverlayClick:!1,closeOnEscape:!0,showCloseBtn:s.value}),Hh({header:we(()=>[Se("span",OTe,it(F.value.title),1)]),default:we(()=>[Se("div",{class:le(["modal-body",{"bulk-count":b.value===6,"choose-method":b.value===1}])},[Se("div",MTe,it(F.value.description),1),M.value&&b.value===4?(q(),de("div",NTe,[G[1]||(G[1]=tt(" Error code ",-1)),Se("span",LTe,it(M.value),1)])):Ye("",!0),b.value===1?(q(),de("div",VTe,[ye(Hw,{disabled:!1,label:"Create by count",description:"Enter how many to create.",onOnClick:se},{visual:we(()=>[ye(L(va),{src:"CreateByCount",size:65})]),_:1}),ye(Hw,{disabled:!1,label:"Start with a blank sheet",description:`Type or paste ${r.value} details
254
254
  into a table.`,onOnClick:Z},{visual:we(()=>[ye(L(va),{src:"BlankSheet",size:65})]),_:1},8,["description"]),ye(Hw,{label:"Import from file",description:`Create ${r.value} from a CSV or
255
- Excel file.`,onOnClick:ge},{visual:we(()=>[ye(L(va),{src:"UploadFile",size:65,"max-width":"65"})]),_:1},8,["description"])])):Ye("",!0),b.value===6?(q(),Ke(L(Kue),{key:2,ref_key:"bulkCreateCountRef",ref:te,"get-status-func":xe,"workspace-id":f.workspaceId,"take-name":p.value,onChanged:u,"entity-id":f.entityId},null,8,["workspace-id","take-name","entity-id"])):b.value===2?(q(),de("div",BTe,[ye(L(wL),{modelValue:y.value,"onUpdate:modelValue":G[0]||(G[0]=J=>y.value=J),"get-status-func":xe,"workspace-id":f.workspaceId,id:f.entityId,style:{width:"100%"},"max-width":"372px",ref_key:"selectStatusRef",ref:V},null,8,["modelValue","workspace-id","id"])])):b.value===3||b.value===7?(q(),de("div",$Te,[ye(L(va),{src:"Success",width:240,height:180,ratio:"unset"})])):b.value===4||b.value===8?(q(),de("div",HTe,[ye(L(va),{src:"Failed",width:240,height:180,ratio:"unset"})])):Ye("",!0)],2)]),_:2},[b.value===2||b.value===4||b.value===3||b.value===6||b.value===7||b.value===8?{name:"footer",fn:we(()=>[b.value==6?ze((q(),de("div",GTe,[ye(L(St),{variant:"primary",loading:c.value,disabled:ue.value||c.value,onClick:d},{default:we(()=>[...G[2]||(G[2]=[tt(" Create ",-1)])]),_:1},8,["loading","disabled"])])),[[L(o),{content:ue.value?"Add a name or a counter first.":void 0,bypassOverflowCheck:!0}]]):Ye("",!0),b.value===4||b.value===8?(q(),Ke(L(St),{key:1,variant:"secondary",onClick:k},{default:we(()=>[...G[3]||(G[3]=[tt(" Close ",-1)])]),_:1})):b.value===3?(q(),Ke(L(St),{key:2,variant:"secondary",onClick:k},{default:we(()=>[...G[4]||(G[4]=[tt(" Got it ",-1)])]),_:1})):Ye("",!0),b.value===2?ze((q(),de("div",UTe,[ye(L(St),{loading:K.value,disabled:K.value||!y.value,onClick:re},{default:we(()=>[...G[5]||(G[5]=[tt(" Import ",-1)])]),_:1},8,["loading","disabled"])])),[[L(o),{content:K.value||!y.value?"Select a status first":void 0,bypassOverflowCheck:!0}]]):Ye("",!0),b.value===4?(q(),Ke(L(St),{key:4,onClick:Y},{default:we(()=>[...G[6]||(G[6]=[tt(" Try Again ",-1)])]),_:1})):Ye("",!0),b.value===8?(q(),Ke(L(St),{key:5,onClick:A},{default:we(()=>[...G[7]||(G[7]=[tt("Try Again",-1)])]),_:1})):Ye("",!0),b.value===7?(q(),Ke(L(St),{key:6,onClick:k,variant:"secondary"},{default:we(()=>[...G[8]||(G[8]=[tt(" Got it ",-1)])]),_:1})):Ye("",!0)]),key:"0"}:void 0]),1040))}}),[["__scopeId","data-v-b033d42c"]]),jTe={class:"header-name"},KTe={class:"modal-body"},qTe={class:"description"},YTe={key:0,class:"error-message"},XTe={class:"dynamic"},ZTe={key:1,class:"choose-method-container"},JTe={key:2,class:"result-container"},QTe={key:3,class:"result-container"},eDe={key:2},BG="text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",tDe=_t(nt({__name:"PopupBulkUpdate",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const o=Kt,s=X(()=>[1,2].includes(f.value)),r=X(()=>Sv()),i=X(()=>({1:{title:`Update ${r.value} in bulk`,description:""},2:{title:`Update ${r.value} in bulk`,description:""},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,u=n,{apiServices:c}=so(!1,l),d=1,h=$(),f=$(d),p=$(null),g=$(null),v=$(null),w=$(void 0),S=$(null),b=X(()=>i.value[f.value]),y=$(),E=()=>{var ie;p.value=null,f.value=d,g.value=null,v.value=null,_.value=null,S.value=null,(ie=y.value)==null||ie.clear(),w.value=void 0};Je([g,v],([ie,te])=>{f.value===1&&ie&&te&&(f.value=2)});const _=$(null),I=ie=>_s().getErrorMessageFromResponse(ie),T=ie=>{if(typeof ie=="string"){_.value=ie;return}const te=ie.response,se=te==null?void 0:te.data,Z=I(se);_.value=Z??ie.message,console.log("Error message set to:",{errorMsg:Z,message:ie})},F=async(ie,te)=>{var P;B.value=!0;const se=new FormData,Z=((P=ie.name.split(".").pop())==null?void 0:P.toString())||"";if(se.append("file",ie),se.append("format",Z),se.append("entity_id",l.entityId||""),!c.value){console.error("API services not available");return}try{await c.value.overwriteScenesViaImportFile(l.workspaceId,l.entityId,se),f.value=3,u("import-success")}catch(j){console.error("Error uploading file:",j),T(j),f.value=4}finally{B.value=!1,window.appManager.hide("feedback_lockup_toolbox")}},{openToolbox:V,sendBackErrorFile:x}=LG(({file:ie,fileName:te,channel:se})=>{se==="feedback-merge"&&(v.value=ie,w.value=te??ie.name,F(ie))},"feedback-merge"),A=$(!1),k=async()=>{A.value=!0;const ie=l.workspaceId,te=l.entityId;if(!ie||!te||!c.value)return console.error("Workspace ID or Entity ID is missing"),Promise.reject(new Error("Workspace ID or Entity ID is missing"));try{const se=await c.value.downloadExportedItemsFile(ie,te,!1);if(!se)throw new Error("No response from downloadTemplate API");return se}catch(se){return console.error("Error downloading template:",se),Promise.reject(se)}finally{A.value=!1}},M=ie=>{const te=BG.includes(ie.type);return te||(console.error("Invalid file type:",ie.type),_s().addNotification({id:"invalid-file-type",message:"Invalid file type. Please upload a xlsx, xls, csv file.",type:"error"})),te},N=async()=>{const ie=document.createElement("input");ie.type="file",ie.accept=BG,ie.onchange=async()=>{var se;const te=(se=ie.files)==null?void 0:se[0];if(te){if(!M(te)){E();return}g.value=nv(te);try{const Z=await k();if(!Z){_s().addNotification({id:"failed-download-template",message:"Failed to download file.",type:"error"});return}V({exportFile:Z,feedbackFile:te})}catch(Z){console.error("Error opening toolbox:",Z),_s().addNotification({id:"failed-open-toolbox",message:"Failed to open toolbox.",type:"error"})}}},ie.click()},B=$(!1),z=()=>{p.value=null,v.value&&w.value&&x(v.value,w.value)},oe=()=>{p.value&&v.value&&(B.value=!0,F(v.value,w.value).finally(()=>{B.value=!1}))};return t({open:()=>{var ie;return(ie=h.value)==null?void 0:ie.show()},close:()=>{var ie;return(ie=h.value)==null?void 0:ie.hide()},hideFirstStep:()=>{var ie;f.value===1&&((ie=h.value)==null||ie.hide())}}),(ie,te)=>(q(),Ke(L(qN),jt({ref_key:"popupRef",ref:h,style:a,onHidden:E},{popupIndex:10,popupName:b.value.title,minWidth:"420px",showOverlay:!0,overlayOpacity:.5,closeOnOverlayClick:!1,closeOnEscape:!0,showCloseBtn:s.value}),Hh({header:we(()=>[Se("span",jTe,it(b.value.title),1)]),default:we(()=>[Se("div",KTe,[Se("div",qTe,it(b.value.description),1),_.value&&f.value===4?(q(),de("div",YTe,[te[2]||(te[2]=tt(" Error code ",-1)),Se("span",XTe,it(_.value),1)])):Ye("",!0),f.value===1?(q(),de("div",ZTe,[ye(Hw,{disabled:!1,label:"Import from file",description:`Update ${r.value} from a CSV or Excel file.`,onOnClick:N,style:{width:"100%"}},{visual:we(()=>[ye(L(va),{src:"UploadFile",size:65})]),_:1},8,["description"])])):f.value===3?(q(),de("div",JTe,[ye(L(va),{src:"Success",width:240,height:180,ratio:"unset"})])):f.value===4?(q(),de("div",QTe,[ye(L(va),{src:"Failed",width:240,height:180,ratio:"unset"})])):Ye("",!0)])]),_:2},[f.value===4||f.value===3?{name:"footer",fn:we(()=>[f.value===4?(q(),Ke(L(St),{key:0,variant:"secondary",onClick:te[0]||(te[0]=()=>{var se;E(),(se=h.value)==null||se.hide()})},{default:we(()=>[...te[3]||(te[3]=[tt(" Close ",-1)])]),_:1})):f.value===3?(q(),Ke(L(St),{key:1,variant:"secondary",onClick:te[1]||(te[1]=()=>{var se;E(),(se=h.value)==null||se.hide()})},{default:we(()=>[...te[4]||(te[4]=[tt(" Got it ",-1)])]),_:1})):Ye("",!0),f.value===2?ze((q(),de("div",eDe,[ye(L(St),{loading:B.value,disabled:B.value||!p.value,onClick:oe},{default:we(()=>[...te[5]||(te[5]=[tt(" Import ",-1)])]),_:1},8,["loading","disabled"])])),[[L(o),{content:B.value||!p.value?"Select a status first":void 0,bypassOverflowCheck:!0}]]):Ye("",!0),f.value===4?(q(),Ke(L(St),{key:3,onClick:z},{default:we(()=>[...te[6]||(te[6]=[tt(" Try Again ",-1)])]),_:1})):Ye("",!0)]),key:"0"}:void 0]),1040))}}),[["__scopeId","data-v-b5b8f28d"]]),nDe=_t(nt({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=Bs,o=cE(),{setUserPermissions:s,setEntityPermissions:r}=o,{entityPermissions:i}=mo(o),a=Kt,l=xo,u=Lv(),{entityData:c}=mo(u),d={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},h=$(""),f=X(()=>{var je;const Pe=((je=i.value)==null?void 0:je.has_create_item_permission)==1||!1;return[{label:"Create in bulk",value:"import_scenes",type:"text",id:"import_scenes_option",hide:!Pe},{label:"Update in bulk",value:"bulk_update",type:"text",hide:!Pe,id:"bulk_update_option"}]}),p=e;Tp.initialize({wrapVueCellRenderer:My,wrapVueCellEditor:uB});const g=fd(),{switchInstanceFunc:v}=mo(g);Zt(()=>{const Pe=oo();v.value=Pe==null?void 0:Pe.appContext.config.globalProperties.switchInstance;const je=new BroadcastChannel("focusable_channel");ht(()=>{setTimeout(()=>{je.postMessage("Focusable elements updated")},7e3)})});const w=$(null),S=$([]),b=Gf(),{rowCount:y}=mo(b),E=$(!1),_=$(""),I=$(),T=iM(),{metricList:F}=mo(T),V=$(""),x=$(!1),A=$(new Set),k=$(new Map),{apiServices:M}=so(!1,p),{columnDefs:N,checkboxColumn:B,saveColumnConfig:z}=wTe(F,p.entityId,w),oe=$();Je(()=>N,()=>{var Pe;(Pe=oe.value)==null||Pe.updateColumnDefs(N.value)},{deep:!0});const ie=(Pe,je)=>{z(Pe,je)},{updateRowData:te,setMetricValues:se}=STe(w),Z=X(()=>({isSearching:_.value.length>0,isFiltering:!(Object.keys(pe.value||{}).length==1&&Object.keys(pe.value)[0]=="preflight_status")&&Object.keys(pe.value||{}).length>0})),P=X(Cv),j=X(()=>N.value.filter(Pe=>{var je;return((je=Pe.field)==null?void 0:je.startsWith("metric_"))&&!Pe.hide}).map(Pe=>{var je;return((je=Pe.field)==null?void 0:je.replace("metric_",""))||""}));ci("timezone",P);const ne=X(()=>({autoFetch:!1,workspaceId:p.workspaceId,entityId:p.entityId,metricIds:j.value,updateItemData:te,setMetricValues:se})),{fetchItems:ge,getMetricList:xe,cusorMap:ue,getMetricValues:K}=bTe(ne),Y=X(()=>{if(!w.value)return!1;const Pe=w.value.getSelectedRows().length;return Pe>0&&Pe>=y.value.total}),re=X(()=>{var Pe;return((Pe=c.value)==null?void 0:Pe.name)||"Items"}),R=Pe=>{setTimeout(()=>{ht(()=>{var je,Ft;w.value&&(Pe?(je=w.value)==null||je.showNoRowsOverlay():(Ft=w.value)==null||Ft.hideOverlay())})},500)},G=(Pe,je)=>{var Ft;y.value.total=Pe.meta.total??0,(Ft=Pe.meta.next)!=null&&Ft.cursor&&(ue[je+1]=Pe.meta.next.cursor),V.value=Pe.meta["X-Tsr-signature"]||"",Pe.meta.total===0?R(!0):R(!1)},J=vE(),{setDefaultSort:ce}=J,Ee=$(null),{sortingAPIConfiguration:Ce,isSortingRunning:Ne}=mo(J),pe=$({preflight_status:"1"}),H=X(()=>({...pe.value,search:_.value}));ci("filterParams",H);const W=$([]),be=X(()=>{var Pe;return((Pe=c.value)==null?void 0:Pe.name)||"Items"}),Ae=async({page:Pe,pageSize:je,filterText:Ft})=>{var co,Zo,Fs;(co=w.value)==null||co.hideOverlay();const Mt=ue[Pe],Eo=!Mt&&Pe>1?(Pe-1)*je:void 0,Xn=Ce.value;Xn.length>0&&(Ne.value=!0);try{const dc={cursor:Mt,size:je,searchQuery:Ft,offset:Eo,sort_by:Xn,...pe.value},Wl=await ge(dc);if(!Wl)return{rows:[],total:0};const Xi=(Fs=(Zo=Wl.meta)==null?void 0:Zo.extra)==null?void 0:Fs.default_sort;Xi&&ce(Xi);const gh=(Gw=>{const sn=Gw.data.map(hc=>EO(hc,P.value,be.value));return sn.forEach(hc=>{A.value.add(String(hc.id)),k.value.set(String(hc.id),{})}),sn})(Wl);return G(Wl,Pe),{rows:gh,total:y.value.total}}catch(dc){return console.error("Failed to fetch items:",dc),{rows:[],total:0}}finally{Ne.value=!1}},{isLoading:He,toggleSidebar:Te,onGridReady:Xe,handleUnSelect:ve,handleSelectAll:Be,onSearch:wt,firstLoad:Tt}=_Te({selectRowData:$([]),isSidebarOpen:E,quickFilterText:_,gridApi:w,perPage:d.ROWS_PER_PAGE,fetcher:Ae}),tn=$([]),en=wr(()=>{var Xn;const Pe=((Xn=w.value)==null?void 0:Xn.getSelectedRows())||[],je=new Map(Pe.map(co=>[co.id,co])),Eo=Pe.map(co=>co.id).map(co=>{var Zo,Fs;return[co,(Fs=(Zo=w.value)==null?void 0:Zo.getRowNode(co))==null?void 0:Fs.rowIndex]}).sort((co,Zo)=>(co[1]??0)-(Zo[1]??0)).map(([co])=>je.get(co));tn.value=Eo.filter(co=>co!==void 0)}),bn=Oo({columnsDisplay:[],rowsDisplay:{fromIndex:0,toIndex:0}}),Le=X(()=>({blockLoadDebounceMillis:1e3,columnDefs:N.value,rowModelType:"infinite",cacheBlockSize:d.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:d.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:d.GRID_HEIGHT,stopEditingWhenCellsLoseFocus:!0,onModelUpdated:Ge,noRowsOverlayComponent:My(jre),noRowsOverlayComponentParams:()=>Z.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:Pe=>Pe.data.id,rowClassRules:{"row-deleted":Pe=>{var je;return(je=Pe.data)==null?void 0:je.isDeleted},"row-locked":Pe=>{var je;return(je=Pe.data)==null?void 0:je.isLocked},"row-archived":Pe=>{var je;return(je=Pe.data)==null?void 0:je.isArchived},"row-process-locked":Pe=>{var je,Ft;return((Ft=(je=Pe.data)==null?void 0:je.isProcessing)==null?void 0:Ft.state)==0},"row-inactive":Pe=>{var je;return!((je=Pe.data)!=null&&je.id)},"row-empty":Pe=>!Pe.data},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:p.workspaceId,entityId:p.entityId,apiServices:M.value,sorting:Ne.value},onCellKeyDown:Pe=>{var je,Ft,Mt;if(Pe.data.isDeleted)return!1;if(((je=Pe==null?void 0:Pe.event)==null?void 0:je.key)==="Enter"){const{api:Eo,node:Xn,column:co}=Pe,Zo=Eo.getCellRendererInstances({rowNodes:[Xn],columns:[co]});if(Zo.length>0){const Fs=Zo[0];Fs&&typeof((Ft=Fs.componsenExposed)==null?void 0:Ft.focus)=="function"&&((Mt=Fs.componsenExposed)==null||Mt.focus())}}},isRowSelectable:Pe=>{var je,Ft;return!Pe.group&&((Ft=(je=Pe.data)==null?void 0:je.isProcessing)==null?void 0:Ft.state)!=0},suppressKeyboardEvent:Pe=>{var Mt;if((Mt=Pe.data)!=null&&Mt.isDeleted)return!0;const je=Pe.event.key,Ft=Pe.editing;return Ft&&je==="Tab"?!0:Ft&&je==="Enter"?!1:je==="Enter"?(Pe.event.preventDefault(),Pe.event.stopPropagation(),!0):je==="ArrowUp"||je==="ArrowDown"||je==="ArrowLeft"||je==="ArrowRight"||je==="Tab"||je==="Enter"},navigateToNextCell:()=>null,onBodyScroll:Pe=>{const je=Pe.api.getFirstDisplayedRowIndex(),Ft=Pe.api.getLastDisplayedRowIndex();bn.rowsDisplay.fromIndex=je,bn.rowsDisplay.toIndex=Ft,bn.columnsDisplay=Pe.api.getAllDisplayedVirtualColumns().map(Mt=>Mt.getColId())},onViewportChanged:Pe=>{bn.columnsDisplay=Pe.api.getAllDisplayedVirtualColumns().map(je=>je.getColId())},suppressHeaderFocus:!0,onCellEditingStarted(Pe){if(Pe.data.isDeleted&&Pe.api.stopEditing(),Pe.colDef.field=="options"){const je=Pe.api.getCellRendererInstances({rowNodes:[Pe.node],columns:[Pe.column]});je.length>0&&je[0].focusUi()}},tabToNextCell:Pe=>{let je=Pe.nextCellPosition;if(je&&je.column.getColId()==="ag-Grid-SelectionColumn"){const Ft=Pe.api.getAllDisplayedColumns(),Mt=Ft.indexOf(je.column),Eo=Pe.backwards?-1:1,Xn=Ft[Mt+Eo];if(Xn)return{rowIndex:je.rowIndex,column:Xn,rowPinned:je.rowPinned}}return je}}));function Ge(){if(!w.value)return;let Pe=0;w.value.forEachNode(je=>{je.data&&Pe++}),y.value.loaded=Math.min(Pe,y.value.total)}Je(()=>Ce,()=>{w.value&&(V.value="",A.value.clear(),w.value.deselectAll(),Object.keys(ue).forEach(Pe=>delete ue[Number(Pe)]),w.value.purgeInfiniteCache(),w.value.ensureIndexVisible(0))},{deep:!0});const Rt=$(),qt=$(),Yt=()=>{ms.showPopupBulkUpdate=!0,ht(()=>{var Pe;(Pe=qt.value)==null||Pe.open()})},ot=()=>{ms.showPopupToolboxUploader=!0,ht(()=>{var Pe;(Pe=Rt.value)==null||Pe.open()})},uo=$(!1),si=async()=>{if(M.value)try{uo.value=!0;const Pe=await M.value.downloadExportedItemsFile(p.workspaceId,p.entityId),je=new Blob([Pe],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),Ft=URL.createObjectURL(je),Mt=document.createElement("a");Mt.href=Ft,Mt.download=`exported_items_${new Date().toISOString()}.xlsx`,document.body.appendChild(Mt),Mt.click(),document.body.removeChild(Mt),URL.revokeObjectURL(Ft)}catch(Pe){console.error("Failed to download exported items file:",Pe)}finally{uo.value=!1}},er=async()=>{Tt.value=!0,w.value&&(V.value="",A.value.clear(),Object.keys(ue).forEach(Pe=>delete ue[Number(Pe)]),await w.value.deselectAll(),await w.value.ensureIndexVisible(0,"top"),await w.value.purgeInfiniteCache(),await w.value.refreshInfiniteCache())},Mr=X(()=>un.getInstance().getItem("ITEM_TABLE_APP_VERSION")||""),Ui=$();X(()=>{var Pe;return(Pe=TTe(Mr.value))==null?void 0:Pe.map(je=>`<div>• ${je}</div>`).join(`
256
- `)});function Wi(Pe){var je;Pe==="new_scene"?(je=Ui.value)==null||je.show():Pe==="import_scenes"?ot():Pe==="overwrite_scenes"?openPopupOverwriteScenes():Pe==="bulk_update"&&Yt()}const zi=Pe=>{S.value=Pe.api.getSelectedRows().map(je=>je.id)},ji=Pe=>{const je=Xe(Pe);return je&&(je.addEventListener("modelUpdated",Ge),je.addEventListener("bodyScroll",()=>je.stopEditing()),je.addEventListener("selectionChanged",en),je.addEventListener("columnMoved",Mt=>ie(Mt,!0)),je.addEventListener("columnResized",Mt=>ie(Mt,!0)),je.addEventListener("firstDataRendered",()=>{Tt.value=!1}),!document.querySelector(".ag-body-viewport"))||Pe==null||Pe.setColumnsVisible(["ag-Grid-SelectionColumn"],!1),je},ks=()=>{var Pe;h.value=(((Pe=document.getElementById("item-table-layout-id"))==null?void 0:Pe.clientHeight)??0)-78+"px"};Zt(()=>{ht(()=>{ks()}),window.addEventListener("resize",ks);function Pe(){requestAnimationFrame(Pe)}Pe()}),Vn(()=>{window.removeEventListener("resize",ks)});const Ki=async({code:Pe,name:je})=>{await wt(Pe),setTimeout(()=>{var Ft;(Ft=I.value)==null||Ft.setValue(je)},300)},dh=Pe=>{if(!w.value)return;const je=w.value.getRowNode(Pe);je?(w.value.ensureIndexVisible(Number(je.rowIndex),"middle"),w.value.flashCells({rowNodes:[je],flashDuration:3e3,fadeDuration:1e3})):w.value.ensureIndexVisible(y.value.total-1,"bottom")},Nn=Pe=>Pe.metric_type.code==="number"?"number":"default",So=async()=>{if(p.entityId)try{const Pe=await xe(p.entityId);F.value=Pe.data.map(je=>({...je,sortType:Nn(je)}))}catch(Pe){console.error("Failed to initialize metric list:",Pe),F.value=[]}},fT=async()=>{if(M.value)try{const Pe=await M.value.getUserPermission(p.workspaceId);s(Pe)}catch(Pe){console.error("Failed to fetch user permissions:",Pe)}},hh=async()=>{if(M.value)try{const Pe=await M.value.getEntityDetail(p.workspaceId,p.entityId);r(Pe.permission),c.value=Pe}catch(Pe){console.error("Failed to fetch entity details:",Pe)}},cc=Ey(),{setUser:fh}=cc,pT=async()=>{if(M.value)try{const Pe=await M.value.getMe();return fh(Pe),Pe}catch(Pe){console.error("Failed to fetch user details:",Pe)}},qi=async()=>{var Pe;if(M.value)try{const je=await M.value.getWorkspaces(p.workspaceId),Ft=(Pe=je.data[0])==null?void 0:Pe.ws_user_role_id;return Ft&&cc.setUserRoleId(Ft),je}catch(je){console.error("Failed to fetch workspace details:",je)}};Je(()=>[p.entityId,p.workspaceId],async([Pe,je])=>{!Pe||!je||(pT(),qi(),So(),fT(),hh())},{immediate:!0,deep:!0}),Je(j,(Pe,je)=>{const Ft=Pe.filter(Mt=>!(je!=null&&je.includes(Mt)));Ft.length>0&&K(Array.from(A.value),Ft).then(Mt=>{se(Mt,A.value,Ft)})},{immediate:!0,deep:!0}),Je(V,(Pe,je)=>{x.value=!!(je&&Pe&&je!==Pe)}),t({refreshTable:er});const Ul=Pe=>{pe.value=Pe,er()},Yi=Pe=>{W.value=Pe,er()},ph=Pe=>{N.value=Pe||[],ie({},!0)},gT=X(()=>{var Mt;const Pe=un.getInstance().getItem("ws.terminology"),je=Pe?JSON.parse(Pe):null;return`New ${((Mt=je==null?void 0:je.find(Eo=>Eo.code==="scene"))==null?void 0:Mt.name)||"Scene"}`}),ms=Oo({showPopupBulkUpdate:!1,showPopupToolboxUploader:!1,showPopupSceneCreator:!1,showPopupItemDetails:!1,showPopupOverwriteScenes:!1}),cg=Pe=>{var Eo,Xn;const je=Pe.data,{action:Ft,type:Mt}=je;console.log("App loader close event received:",je),Ft=="APP_LOADER:HIDE"&&(Mt==="xlsx_toolbox"||Mt==="feedback_lockup_toolbox")&&((Eo=Rt.value)==null||Eo.hideFirstStep(),(Xn=qt.value)==null||Xn.hideFirstStep())};return Zt(()=>{window.addEventListener("message",cg)}),Vn(()=>{window.removeEventListener("message",cg)}),(Pe,je)=>(q(),Ke(L(Vse),{"is-sidebar-open":E.value,onCloseSidebar:L(Te),onSidebarClear:L(Te),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:L(Te)},{"header-left":we(()=>{var Ft;return[((Ft=L(i))==null?void 0:Ft.has_create_item_permission)==1?(q(),Ke(L(u0),{key:0,variant:["primary"],options:f.value,onSelect:Wi,onHandleClick:je[1]||(je[1]=Mt=>Wi("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:we(()=>[ze(ye(L(St),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:je[0]||(je[0]=Mt=>Wi("new_scene")),label:gT.value},null,8,["label"]),[[L(l),1]])]),_:1},8,["options"])):Ye("",!0)]}),"header-actions":we(()=>[ye(L(kie),{"onUpdate:assignees":Yi,onApplyFilter:Ul,loading:L(Tt),entityId:p.entityId},null,8,["loading","entityId"]),ze(ye(L(RE),{focusIndex:"4",modelValue:_.value,"onUpdate:modelValue":je[2]||(je[2]=Ft=>_.value=Ft),onSearch:L(wt),class:le(Pe.$style.itemSearchBox),onClear:je[3]||(je[3]=Ft=>L(wt)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:I},null,8,["modelValue","onSearch","class"]),[[L(n),{isLoading:L(Tt),fullwidth:!0}]]),ze((q(),Ke(L(eM),{status:L(He)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":x.value},{default:we(()=>[ze((q(),Ke(L(St),{variant:["secondary","icon"],disabled:L(He),onClick:er},{default:we(()=>[ye(L(pt),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[L(l),5],[L(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[L(n),{isLoading:L(Tt),fullwidth:!0}]]),ze((q(),Ke(L(St),{variant:"secondary",onClick:si,disabled:uo.value,loading:uo.value},{default:we(()=>[ye(L(pt),{src:"Download"})]),_:1},8,["disabled","loading"])),[[L(n),{isLoading:L(Tt),fullwidth:!0}]]),ze(ye(L(Ure),{"model-value":L(N),onChange:je[4]||(je[4]=Ft=>ph(Ft)),id:"table_customization",gridApi:w.value,ref_key:"tableCustomizationRef",ref:oe,"checkbox-column":L(B),tableHeight:h.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[L(n),{isLoading:L(Tt),fullwidth:!0}]])]),grid:we(({availableHeight:Ft})=>[ye(L(fTe),jt({id:"item_table_main",ref_key:"agGrid",ref:Ee},Le.value,{height:Ft+"px",isSorting:L(Ne),onOnGridReady:ji,onSelectionChanged:zi}),null,16,["height","isSorting"])]),footer:we(()=>[Se("div",{class:le(Pe.$style.tableFooter),id:"table_footer"},[Se("span",null,[je[7]||(je[7]=tt(" Showing ",-1)),Se("b",null,it(L(y).loaded)+" of "+it(L(y).total),1)])],2)]),"new-row":we(()=>[ye(L(cie),{ref_key:"createNewSceneRef",ref:Ui,onSearchForCode:Ki,onFocusOnId:dh},null,512)]),"bulk-update-actions":we(()=>[!E.value&&S.value.length>0?ze((q(),Ke(L(Ase),{key:0,selectRowData:tn.value,"workspace-id":p.workspaceId,"entity-id":p.entityId,"grid-api":w.value,onUnselect:L(ve),onSelectAll:L(Be),"take-name":re.value,"selected-all":Y.value,"total-rows":L(y).total,"visible-rows":L(y).loaded,onUpdated:L(en),loading:L(He),onRefreshSelectedRow:L(en)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","onUpdated","loading","onRefreshSelectedRow"])),[[cr,!E.value&&S.value.length>0]]):Ye("",!0)]),snackbar:we(()=>[ye(L(Jse))]),popup:we(()=>[ms.showPopupToolboxUploader?(q(),Ke(zTe,{key:0,ref_key:"popupToolboxUploaderRef",ref:Rt,"workspace-id":p.workspaceId,"entity-id":p.entityId,onImportSuccess:er,onHide:je[5]||(je[5]=Ft=>ms.showPopupToolboxUploader=!1)},null,8,["workspace-id","entity-id"])):Ye("",!0),ms.showPopupBulkUpdate?(q(),Ke(tDe,{key:1,ref_key:"popupBulkUpdateRef",ref:qt,"workspace-id":p.workspaceId,"entity-id":p.entityId,onImportSuccess:er,onHide:je[6]||(je[6]=Ft=>ms.showPopupBulkUpdate=!1)},null,8,["workspace-id","entity-id"])):Ye("",!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"}}]]),$G="0.1.248",oDe={key:0},sDe=_t(nt({__name:"app",setup(e){const t=X(()=>n.id.length===0||n.workspaceId.length===0),n=Oo({id:"",workspaceId:"",apiConfig:{}}),o=_s(),{showMessage:s,showErrorNetMessage:r}=o,i=["basicInfor","importItems"],a=h=>{h.success?s(h.apiCode,"success"):i.includes(h.apiCode)||r(h)},l=$(null),u=()=>{const h=un.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};Bh(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",$G);try{if(l.value=oo(),!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)||un.getInstance().getItem("ws.code");const g={domainApi:u(),wsCode:un.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 ON(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),Vn(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const c=X(()=>n.id),d=X(()=>n.workspaceId);return ci("workspaceId",d),ci("entityId",c),(h,f)=>(q(),de("div",{class:le(h.$style.dashboardPluginWrapper)},[t.value?(q(),de("span",oDe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):c.value?(q(),Ke(L(nDe),{key:1,entityId:c.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Ye("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),hT=async(e={},t={})=>{const n=gI(sDe),o=n5();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,u)=>{console.error("[Vue Error]",a),u&&console.error("[Info]",u)},console.log(`%cArbo Dashboard Plugin v${$G}`,"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",xo);const i=await Sue();return n.use(i),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=hT),Ln.default=hT,Ln.initDashboard=hT,Object.defineProperties(Ln,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
255
+ Excel file.`,onOnClick:ge},{visual:we(()=>[ye(L(va),{src:"UploadFile",size:65,"max-width":"65"})]),_:1},8,["description"])])):Ye("",!0),b.value===6?(q(),Ke(L(Kue),{key:2,ref_key:"bulkCreateCountRef",ref:te,"get-status-func":xe,"workspace-id":f.workspaceId,"take-name":p.value,onChanged:u,"entity-id":f.entityId},null,8,["workspace-id","take-name","entity-id"])):b.value===2?(q(),de("div",BTe,[ye(L(wL),{modelValue:y.value,"onUpdate:modelValue":G[0]||(G[0]=J=>y.value=J),"get-status-func":xe,"workspace-id":f.workspaceId,id:f.entityId,style:{width:"100%"},"max-width":"372px",ref_key:"selectStatusRef",ref:V},null,8,["modelValue","workspace-id","id"])])):b.value===3||b.value===7?(q(),de("div",$Te,[ye(L(va),{src:"Success",width:240,height:180,ratio:"unset"})])):b.value===4||b.value===8?(q(),de("div",HTe,[ye(L(va),{src:"Failed",width:240,height:180,ratio:"unset"})])):Ye("",!0)],2)]),_:2},[b.value===2||b.value===4||b.value===3||b.value===6||b.value===7||b.value===8?{name:"footer",fn:we(()=>[b.value==6?ze((q(),de("div",GTe,[ye(L(St),{variant:"primary",loading:c.value,disabled:ue.value||c.value,onClick:d},{default:we(()=>[...G[2]||(G[2]=[tt(" Create ",-1)])]),_:1},8,["loading","disabled"])])),[[L(o),{content:ue.value?"Add a name or a counter first.":void 0,bypassOverflowCheck:!0}]]):Ye("",!0),b.value===4||b.value===8?(q(),Ke(L(St),{key:1,variant:"secondary",onClick:k},{default:we(()=>[...G[3]||(G[3]=[tt(" Close ",-1)])]),_:1})):b.value===3?(q(),Ke(L(St),{key:2,variant:"secondary",onClick:k},{default:we(()=>[...G[4]||(G[4]=[tt(" Got it ",-1)])]),_:1})):Ye("",!0),b.value===2?ze((q(),de("div",UTe,[ye(L(St),{loading:K.value,disabled:K.value||!y.value,onClick:re},{default:we(()=>[...G[5]||(G[5]=[tt(" Import ",-1)])]),_:1},8,["loading","disabled"])])),[[L(o),{content:K.value||!y.value?"Select a status first":void 0,bypassOverflowCheck:!0}]]):Ye("",!0),b.value===4?(q(),Ke(L(St),{key:4,onClick:Y},{default:we(()=>[...G[6]||(G[6]=[tt(" Try Again ",-1)])]),_:1})):Ye("",!0),b.value===8?(q(),Ke(L(St),{key:5,onClick:A},{default:we(()=>[...G[7]||(G[7]=[tt("Try Again",-1)])]),_:1})):Ye("",!0),b.value===7?(q(),Ke(L(St),{key:6,onClick:k,variant:"secondary"},{default:we(()=>[...G[8]||(G[8]=[tt(" Got it ",-1)])]),_:1})):Ye("",!0)]),key:"0"}:void 0]),1040))}}),[["__scopeId","data-v-d3b93ab0"]]),jTe={class:"header-name"},KTe={class:"modal-body"},qTe={class:"description"},YTe={key:0,class:"error-message"},XTe={class:"dynamic"},ZTe={key:1,class:"choose-method-container"},JTe={key:2,class:"result-container"},QTe={key:3,class:"result-container"},eDe={key:2},BG="text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",tDe=_t(nt({__name:"PopupBulkUpdate",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const o=Kt,s=X(()=>[1,2].includes(f.value)),r=X(()=>Sv()),i=X(()=>({1:{title:`Update ${r.value} in bulk`,description:""},2:{title:`Update ${r.value} in bulk`,description:""},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,u=n,{apiServices:c}=so(!1,l),d=1,h=$(),f=$(d),p=$(null),g=$(null),v=$(null),w=$(void 0),S=$(null),b=X(()=>i.value[f.value]),y=$(),E=()=>{var ie;p.value=null,f.value=d,g.value=null,v.value=null,_.value=null,S.value=null,(ie=y.value)==null||ie.clear(),w.value=void 0};Je([g,v],([ie,te])=>{f.value===1&&ie&&te&&(f.value=2)});const _=$(null),I=ie=>_s().getErrorMessageFromResponse(ie),T=ie=>{if(typeof ie=="string"){_.value=ie;return}const te=ie.response,se=te==null?void 0:te.data,Z=I(se);_.value=Z??ie.message,console.log("Error message set to:",{errorMsg:Z,message:ie})},F=async(ie,te)=>{var P;B.value=!0;const se=new FormData,Z=((P=ie.name.split(".").pop())==null?void 0:P.toString())||"";if(se.append("file",ie),se.append("format",Z),se.append("entity_id",l.entityId||""),!c.value){console.error("API services not available");return}try{await c.value.overwriteScenesViaImportFile(l.workspaceId,l.entityId,se),f.value=3,u("import-success")}catch(j){console.error("Error uploading file:",j),T(j),f.value=4}finally{B.value=!1,window.appManager.hide("feedback_lockup_toolbox")}},{openToolbox:V,sendBackErrorFile:x}=LG(({file:ie,fileName:te,channel:se})=>{se==="feedback-merge"&&(v.value=ie,w.value=te??ie.name,F(ie))},"feedback-merge"),A=$(!1),k=async()=>{A.value=!0;const ie=l.workspaceId,te=l.entityId;if(!ie||!te||!c.value)return console.error("Workspace ID or Entity ID is missing"),Promise.reject(new Error("Workspace ID or Entity ID is missing"));try{const se=await c.value.downloadExportedItemsFile(ie,te,!1);if(!se)throw new Error("No response from downloadTemplate API");return se}catch(se){return console.error("Error downloading template:",se),Promise.reject(se)}finally{A.value=!1}},M=ie=>{const te=BG.includes(ie.type);return te||(console.error("Invalid file type:",ie.type),_s().addNotification({id:"invalid-file-type",message:"Invalid file type. Please upload a xlsx, xls, csv file.",type:"error"})),te},N=async()=>{const ie=document.createElement("input");ie.type="file",ie.accept=BG,ie.onchange=async()=>{var se;const te=(se=ie.files)==null?void 0:se[0];if(te){if(!M(te)){E();return}g.value=nv(te);try{const Z=await k();if(!Z){_s().addNotification({id:"failed-download-template",message:"Failed to download file.",type:"error"});return}V({exportFile:Z,feedbackFile:te})}catch(Z){console.error("Error opening toolbox:",Z),_s().addNotification({id:"failed-open-toolbox",message:"Failed to open toolbox.",type:"error"})}}},ie.click()},B=$(!1),z=()=>{p.value=null,v.value&&w.value&&x(v.value,w.value)},oe=()=>{p.value&&v.value&&(B.value=!0,F(v.value,w.value).finally(()=>{B.value=!1}))};return t({open:()=>{var ie;return(ie=h.value)==null?void 0:ie.show()},close:()=>{var ie;return(ie=h.value)==null?void 0:ie.hide()},hideFirstStep:()=>{var ie;f.value===1&&((ie=h.value)==null||ie.hide())}}),(ie,te)=>(q(),Ke(L(qN),jt({ref_key:"popupRef",ref:h,style:a,onHidden:E},{popupIndex:10,popupName:b.value.title,minWidth:"420px",showOverlay:!0,overlayOpacity:.5,closeOnOverlayClick:!1,closeOnEscape:!0,showCloseBtn:s.value}),Hh({header:we(()=>[Se("span",jTe,it(b.value.title),1)]),default:we(()=>[Se("div",KTe,[Se("div",qTe,it(b.value.description),1),_.value&&f.value===4?(q(),de("div",YTe,[te[2]||(te[2]=tt(" Error code ",-1)),Se("span",XTe,it(_.value),1)])):Ye("",!0),f.value===1?(q(),de("div",ZTe,[ye(Hw,{disabled:!1,label:"Import from file",description:`Update ${r.value} from a CSV or Excel file.`,onOnClick:N,style:{width:"100%"}},{visual:we(()=>[ye(L(va),{src:"UploadFile",size:65})]),_:1},8,["description"])])):f.value===3?(q(),de("div",JTe,[ye(L(va),{src:"Success",width:240,height:180,ratio:"unset"})])):f.value===4?(q(),de("div",QTe,[ye(L(va),{src:"Failed",width:240,height:180,ratio:"unset"})])):Ye("",!0)])]),_:2},[f.value===4||f.value===3?{name:"footer",fn:we(()=>[f.value===4?(q(),Ke(L(St),{key:0,variant:"secondary",onClick:te[0]||(te[0]=()=>{var se;E(),(se=h.value)==null||se.hide()})},{default:we(()=>[...te[3]||(te[3]=[tt(" Close ",-1)])]),_:1})):f.value===3?(q(),Ke(L(St),{key:1,variant:"secondary",onClick:te[1]||(te[1]=()=>{var se;E(),(se=h.value)==null||se.hide()})},{default:we(()=>[...te[4]||(te[4]=[tt(" Got it ",-1)])]),_:1})):Ye("",!0),f.value===2?ze((q(),de("div",eDe,[ye(L(St),{loading:B.value,disabled:B.value||!p.value,onClick:oe},{default:we(()=>[...te[5]||(te[5]=[tt(" Import ",-1)])]),_:1},8,["loading","disabled"])])),[[L(o),{content:B.value||!p.value?"Select a status first":void 0,bypassOverflowCheck:!0}]]):Ye("",!0),f.value===4?(q(),Ke(L(St),{key:3,onClick:z},{default:we(()=>[...te[6]||(te[6]=[tt(" Try Again ",-1)])]),_:1})):Ye("",!0)]),key:"0"}:void 0]),1040))}}),[["__scopeId","data-v-f3131e7b"]]),nDe=_t(nt({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=Bs,o=cE(),{setUserPermissions:s,setEntityPermissions:r}=o,{entityPermissions:i}=mo(o),a=Kt,l=xo,u=Lv(),{entityData:c}=mo(u),d={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},h=$(""),f=X(()=>{var je;const Pe=((je=i.value)==null?void 0:je.has_create_item_permission)==1||!1;return[{label:"Create in bulk",value:"import_scenes",type:"text",id:"import_scenes_option",hide:!Pe},{label:"Update in bulk",value:"bulk_update",type:"text",hide:!Pe,id:"bulk_update_option"}]}),p=e;Tp.initialize({wrapVueCellRenderer:My,wrapVueCellEditor:uB});const g=fd(),{switchInstanceFunc:v}=mo(g);Zt(()=>{const Pe=oo();v.value=Pe==null?void 0:Pe.appContext.config.globalProperties.switchInstance;const je=new BroadcastChannel("focusable_channel");ht(()=>{setTimeout(()=>{je.postMessage("Focusable elements updated")},7e3)})});const w=$(null),S=$([]),b=Gf(),{rowCount:y}=mo(b),E=$(!1),_=$(""),I=$(),T=iM(),{metricList:F}=mo(T),V=$(""),x=$(!1),A=$(new Set),k=$(new Map),{apiServices:M}=so(!1,p),{columnDefs:N,checkboxColumn:B,saveColumnConfig:z}=wTe(F,p.entityId,w),oe=$();Je(()=>N,()=>{var Pe;(Pe=oe.value)==null||Pe.updateColumnDefs(N.value)},{deep:!0});const ie=(Pe,je)=>{z(Pe,je)},{updateRowData:te,setMetricValues:se}=STe(w),Z=X(()=>({isSearching:_.value.length>0,isFiltering:!(Object.keys(pe.value||{}).length==1&&Object.keys(pe.value)[0]=="preflight_status")&&Object.keys(pe.value||{}).length>0})),P=X(Cv),j=X(()=>N.value.filter(Pe=>{var je;return((je=Pe.field)==null?void 0:je.startsWith("metric_"))&&!Pe.hide}).map(Pe=>{var je;return((je=Pe.field)==null?void 0:je.replace("metric_",""))||""}));ci("timezone",P);const ne=X(()=>({autoFetch:!1,workspaceId:p.workspaceId,entityId:p.entityId,metricIds:j.value,updateItemData:te,setMetricValues:se})),{fetchItems:ge,getMetricList:xe,cusorMap:ue,getMetricValues:K}=bTe(ne),Y=X(()=>{if(!w.value)return!1;const Pe=w.value.getSelectedRows().length;return Pe>0&&Pe>=y.value.total}),re=X(()=>{var Pe;return((Pe=c.value)==null?void 0:Pe.name)||"Items"}),R=Pe=>{setTimeout(()=>{ht(()=>{var je,Ft;w.value&&(Pe?(je=w.value)==null||je.showNoRowsOverlay():(Ft=w.value)==null||Ft.hideOverlay())})},500)},G=(Pe,je)=>{var Ft;y.value.total=Pe.meta.total??0,(Ft=Pe.meta.next)!=null&&Ft.cursor&&(ue[je+1]=Pe.meta.next.cursor),V.value=Pe.meta["X-Tsr-signature"]||"",Pe.meta.total===0?R(!0):R(!1)},J=vE(),{setDefaultSort:ce}=J,Ee=$(null),{sortingAPIConfiguration:Ce,isSortingRunning:Ne}=mo(J),pe=$({preflight_status:"1"}),H=X(()=>({...pe.value,search:_.value}));ci("filterParams",H);const W=$([]),be=X(()=>{var Pe;return((Pe=c.value)==null?void 0:Pe.name)||"Items"}),Ae=async({page:Pe,pageSize:je,filterText:Ft})=>{var co,Zo,Fs;(co=w.value)==null||co.hideOverlay();const Mt=ue[Pe],Eo=!Mt&&Pe>1?(Pe-1)*je:void 0,Xn=Ce.value;Xn.length>0&&(Ne.value=!0);try{const dc={cursor:Mt,size:je,searchQuery:Ft,offset:Eo,sort_by:Xn,...pe.value},Wl=await ge(dc);if(!Wl)return{rows:[],total:0};const Xi=(Fs=(Zo=Wl.meta)==null?void 0:Zo.extra)==null?void 0:Fs.default_sort;Xi&&ce(Xi);const gh=(Gw=>{const sn=Gw.data.map(hc=>EO(hc,P.value,be.value));return sn.forEach(hc=>{A.value.add(String(hc.id)),k.value.set(String(hc.id),{})}),sn})(Wl);return G(Wl,Pe),{rows:gh,total:y.value.total}}catch(dc){return console.error("Failed to fetch items:",dc),{rows:[],total:0}}finally{Ne.value=!1}},{isLoading:He,toggleSidebar:Te,onGridReady:Xe,handleUnSelect:ve,handleSelectAll:Be,onSearch:wt,firstLoad:Tt}=_Te({selectRowData:$([]),isSidebarOpen:E,quickFilterText:_,gridApi:w,perPage:d.ROWS_PER_PAGE,fetcher:Ae}),tn=$([]),en=wr(()=>{var Xn;const Pe=((Xn=w.value)==null?void 0:Xn.getSelectedRows())||[],je=new Map(Pe.map(co=>[co.id,co])),Eo=Pe.map(co=>co.id).map(co=>{var Zo,Fs;return[co,(Fs=(Zo=w.value)==null?void 0:Zo.getRowNode(co))==null?void 0:Fs.rowIndex]}).sort((co,Zo)=>(co[1]??0)-(Zo[1]??0)).map(([co])=>je.get(co));tn.value=Eo.filter(co=>co!==void 0)}),bn=Oo({columnsDisplay:[],rowsDisplay:{fromIndex:0,toIndex:0}}),Le=X(()=>({blockLoadDebounceMillis:1e3,columnDefs:N.value,rowModelType:"infinite",cacheBlockSize:d.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:d.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:d.GRID_HEIGHT,stopEditingWhenCellsLoseFocus:!0,onModelUpdated:Ge,noRowsOverlayComponent:My(jre),noRowsOverlayComponentParams:()=>Z.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:Pe=>Pe.data.id,rowClassRules:{"row-deleted":Pe=>{var je;return(je=Pe.data)==null?void 0:je.isDeleted},"row-locked":Pe=>{var je;return(je=Pe.data)==null?void 0:je.isLocked},"row-archived":Pe=>{var je;return(je=Pe.data)==null?void 0:je.isArchived},"row-process-locked":Pe=>{var je,Ft;return((Ft=(je=Pe.data)==null?void 0:je.isProcessing)==null?void 0:Ft.state)==0},"row-inactive":Pe=>{var je;return!((je=Pe.data)!=null&&je.id)},"row-empty":Pe=>!Pe.data},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:p.workspaceId,entityId:p.entityId,apiServices:M.value,sorting:Ne.value},onCellKeyDown:Pe=>{var je,Ft,Mt;if(Pe.data.isDeleted)return!1;if(((je=Pe==null?void 0:Pe.event)==null?void 0:je.key)==="Enter"){const{api:Eo,node:Xn,column:co}=Pe,Zo=Eo.getCellRendererInstances({rowNodes:[Xn],columns:[co]});if(Zo.length>0){const Fs=Zo[0];Fs&&typeof((Ft=Fs.componsenExposed)==null?void 0:Ft.focus)=="function"&&((Mt=Fs.componsenExposed)==null||Mt.focus())}}},isRowSelectable:Pe=>{var je,Ft;return!Pe.group&&((Ft=(je=Pe.data)==null?void 0:je.isProcessing)==null?void 0:Ft.state)!=0},suppressKeyboardEvent:Pe=>{var Mt;if((Mt=Pe.data)!=null&&Mt.isDeleted)return!0;const je=Pe.event.key,Ft=Pe.editing;return Ft&&je==="Tab"?!0:Ft&&je==="Enter"?!1:je==="Enter"?(Pe.event.preventDefault(),Pe.event.stopPropagation(),!0):je==="ArrowUp"||je==="ArrowDown"||je==="ArrowLeft"||je==="ArrowRight"||je==="Tab"||je==="Enter"},navigateToNextCell:()=>null,onBodyScroll:Pe=>{const je=Pe.api.getFirstDisplayedRowIndex(),Ft=Pe.api.getLastDisplayedRowIndex();bn.rowsDisplay.fromIndex=je,bn.rowsDisplay.toIndex=Ft,bn.columnsDisplay=Pe.api.getAllDisplayedVirtualColumns().map(Mt=>Mt.getColId())},onViewportChanged:Pe=>{bn.columnsDisplay=Pe.api.getAllDisplayedVirtualColumns().map(je=>je.getColId())},suppressHeaderFocus:!0,onCellEditingStarted(Pe){if(Pe.data.isDeleted&&Pe.api.stopEditing(),Pe.colDef.field=="options"){const je=Pe.api.getCellRendererInstances({rowNodes:[Pe.node],columns:[Pe.column]});je.length>0&&je[0].focusUi()}},tabToNextCell:Pe=>{let je=Pe.nextCellPosition;if(je&&je.column.getColId()==="ag-Grid-SelectionColumn"){const Ft=Pe.api.getAllDisplayedColumns(),Mt=Ft.indexOf(je.column),Eo=Pe.backwards?-1:1,Xn=Ft[Mt+Eo];if(Xn)return{rowIndex:je.rowIndex,column:Xn,rowPinned:je.rowPinned}}return je}}));function Ge(){if(!w.value)return;let Pe=0;w.value.forEachNode(je=>{je.data&&Pe++}),y.value.loaded=Math.min(Pe,y.value.total)}Je(()=>Ce,()=>{w.value&&(V.value="",A.value.clear(),w.value.deselectAll(),Object.keys(ue).forEach(Pe=>delete ue[Number(Pe)]),w.value.purgeInfiniteCache(),w.value.ensureIndexVisible(0))},{deep:!0});const Rt=$(),qt=$(),Yt=()=>{ms.showPopupBulkUpdate=!0,ht(()=>{var Pe;(Pe=qt.value)==null||Pe.open()})},ot=()=>{ms.showPopupToolboxUploader=!0,ht(()=>{var Pe;(Pe=Rt.value)==null||Pe.open()})},uo=$(!1),si=async()=>{if(M.value)try{uo.value=!0;const Pe=await M.value.downloadExportedItemsFile(p.workspaceId,p.entityId),je=new Blob([Pe],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),Ft=URL.createObjectURL(je),Mt=document.createElement("a");Mt.href=Ft,Mt.download=`exported_items_${new Date().toISOString()}.xlsx`,document.body.appendChild(Mt),Mt.click(),document.body.removeChild(Mt),URL.revokeObjectURL(Ft)}catch(Pe){console.error("Failed to download exported items file:",Pe)}finally{uo.value=!1}},er=async()=>{Tt.value=!0,w.value&&(V.value="",A.value.clear(),Object.keys(ue).forEach(Pe=>delete ue[Number(Pe)]),await w.value.deselectAll(),await w.value.ensureIndexVisible(0,"top"),await w.value.purgeInfiniteCache(),await w.value.refreshInfiniteCache())},Mr=X(()=>un.getInstance().getItem("ITEM_TABLE_APP_VERSION")||""),Ui=$();X(()=>{var Pe;return(Pe=TTe(Mr.value))==null?void 0:Pe.map(je=>`<div>• ${je}</div>`).join(`
256
+ `)});function Wi(Pe){var je;Pe==="new_scene"?(je=Ui.value)==null||je.show():Pe==="import_scenes"?ot():Pe==="overwrite_scenes"?openPopupOverwriteScenes():Pe==="bulk_update"&&Yt()}const zi=Pe=>{S.value=Pe.api.getSelectedRows().map(je=>je.id)},ji=Pe=>{const je=Xe(Pe);return je&&(je.addEventListener("modelUpdated",Ge),je.addEventListener("bodyScroll",()=>je.stopEditing()),je.addEventListener("selectionChanged",en),je.addEventListener("columnMoved",Mt=>ie(Mt,!0)),je.addEventListener("columnResized",Mt=>ie(Mt,!0)),je.addEventListener("firstDataRendered",()=>{Tt.value=!1}),!document.querySelector(".ag-body-viewport"))||Pe==null||Pe.setColumnsVisible(["ag-Grid-SelectionColumn"],!1),je},ks=()=>{var Pe;h.value=(((Pe=document.getElementById("item-table-layout-id"))==null?void 0:Pe.clientHeight)??0)-78+"px"};Zt(()=>{ht(()=>{ks()}),window.addEventListener("resize",ks);function Pe(){requestAnimationFrame(Pe)}Pe()}),Vn(()=>{window.removeEventListener("resize",ks)});const Ki=async({code:Pe,name:je})=>{await wt(Pe),setTimeout(()=>{var Ft;(Ft=I.value)==null||Ft.setValue(je)},300)},dh=Pe=>{if(!w.value)return;const je=w.value.getRowNode(Pe);je?(w.value.ensureIndexVisible(Number(je.rowIndex),"middle"),w.value.flashCells({rowNodes:[je],flashDuration:3e3,fadeDuration:1e3})):w.value.ensureIndexVisible(y.value.total-1,"bottom")},Nn=Pe=>Pe.metric_type.code==="number"?"number":"default",So=async()=>{if(p.entityId)try{const Pe=await xe(p.entityId);F.value=Pe.data.map(je=>({...je,sortType:Nn(je)}))}catch(Pe){console.error("Failed to initialize metric list:",Pe),F.value=[]}},fT=async()=>{if(M.value)try{const Pe=await M.value.getUserPermission(p.workspaceId);s(Pe)}catch(Pe){console.error("Failed to fetch user permissions:",Pe)}},hh=async()=>{if(M.value)try{const Pe=await M.value.getEntityDetail(p.workspaceId,p.entityId);r(Pe.permission),c.value=Pe}catch(Pe){console.error("Failed to fetch entity details:",Pe)}},cc=Ey(),{setUser:fh}=cc,pT=async()=>{if(M.value)try{const Pe=await M.value.getMe();return fh(Pe),Pe}catch(Pe){console.error("Failed to fetch user details:",Pe)}},qi=async()=>{var Pe;if(M.value)try{const je=await M.value.getWorkspaces(p.workspaceId),Ft=(Pe=je.data[0])==null?void 0:Pe.ws_user_role_id;return Ft&&cc.setUserRoleId(Ft),je}catch(je){console.error("Failed to fetch workspace details:",je)}};Je(()=>[p.entityId,p.workspaceId],async([Pe,je])=>{!Pe||!je||(pT(),qi(),So(),fT(),hh())},{immediate:!0,deep:!0}),Je(j,(Pe,je)=>{const Ft=Pe.filter(Mt=>!(je!=null&&je.includes(Mt)));Ft.length>0&&K(Array.from(A.value),Ft).then(Mt=>{se(Mt,A.value,Ft)})},{immediate:!0,deep:!0}),Je(V,(Pe,je)=>{x.value=!!(je&&Pe&&je!==Pe)}),t({refreshTable:er});const Ul=Pe=>{pe.value=Pe,er()},Yi=Pe=>{W.value=Pe,er()},ph=Pe=>{N.value=Pe||[],ie({},!0)},gT=X(()=>{var Mt;const Pe=un.getInstance().getItem("ws.terminology"),je=Pe?JSON.parse(Pe):null;return`New ${((Mt=je==null?void 0:je.find(Eo=>Eo.code==="scene"))==null?void 0:Mt.name)||"Scene"}`}),ms=Oo({showPopupBulkUpdate:!1,showPopupToolboxUploader:!1,showPopupSceneCreator:!1,showPopupItemDetails:!1,showPopupOverwriteScenes:!1}),cg=Pe=>{var Eo,Xn;const je=Pe.data,{action:Ft,type:Mt}=je;console.log("App loader close event received:",je),Ft=="APP_LOADER:HIDE"&&(Mt==="xlsx_toolbox"||Mt==="feedback_lockup_toolbox")&&((Eo=Rt.value)==null||Eo.hideFirstStep(),(Xn=qt.value)==null||Xn.hideFirstStep())};return Zt(()=>{window.addEventListener("message",cg)}),Vn(()=>{window.removeEventListener("message",cg)}),(Pe,je)=>(q(),Ke(L(Vse),{"is-sidebar-open":E.value,onCloseSidebar:L(Te),onSidebarClear:L(Te),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:L(Te)},{"header-left":we(()=>{var Ft;return[((Ft=L(i))==null?void 0:Ft.has_create_item_permission)==1?(q(),Ke(L(u0),{key:0,variant:["primary"],options:f.value,onSelect:Wi,onHandleClick:je[1]||(je[1]=Mt=>Wi("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:we(()=>[ze(ye(L(St),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:je[0]||(je[0]=Mt=>Wi("new_scene")),label:gT.value},null,8,["label"]),[[L(l),1]])]),_:1},8,["options"])):Ye("",!0)]}),"header-actions":we(()=>[ye(L(kie),{"onUpdate:assignees":Yi,onApplyFilter:Ul,loading:L(Tt),entityId:p.entityId},null,8,["loading","entityId"]),ze(ye(L(RE),{focusIndex:"4",modelValue:_.value,"onUpdate:modelValue":je[2]||(je[2]=Ft=>_.value=Ft),onSearch:L(wt),class:le(Pe.$style.itemSearchBox),onClear:je[3]||(je[3]=Ft=>L(wt)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:I},null,8,["modelValue","onSearch","class"]),[[L(n),{isLoading:L(Tt),fullwidth:!0}]]),ze((q(),Ke(L(eM),{status:L(He)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":x.value},{default:we(()=>[ze((q(),Ke(L(St),{variant:["secondary","icon"],disabled:L(He),onClick:er},{default:we(()=>[ye(L(pt),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[L(l),5],[L(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[L(n),{isLoading:L(Tt),fullwidth:!0}]]),ze((q(),Ke(L(St),{variant:["secondary","icon"],onClick:si,disabled:uo.value,loading:uo.value},{default:we(()=>[ye(L(pt),{src:"Download"})]),_:1},8,["disabled","loading"])),[[L(a),"Download"],[L(n),{isLoading:L(Tt),fullwidth:!0}]]),ze(ye(L(Ure),{"model-value":L(N),onChange:je[4]||(je[4]=Ft=>ph(Ft)),id:"table_customization",gridApi:w.value,ref_key:"tableCustomizationRef",ref:oe,"checkbox-column":L(B),tableHeight:h.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[L(n),{isLoading:L(Tt),fullwidth:!0}]])]),grid:we(({availableHeight:Ft})=>[ye(L(fTe),jt({id:"item_table_main",ref_key:"agGrid",ref:Ee},Le.value,{height:Ft+"px",isSorting:L(Ne),onOnGridReady:ji,onSelectionChanged:zi}),null,16,["height","isSorting"])]),footer:we(()=>[Se("div",{class:le(Pe.$style.tableFooter),id:"table_footer"},[Se("span",null,[je[7]||(je[7]=tt(" Showing ",-1)),Se("b",null,it(L(y).loaded)+" of "+it(L(y).total),1)])],2)]),"new-row":we(()=>[ye(L(cie),{ref_key:"createNewSceneRef",ref:Ui,onSearchForCode:Ki,onFocusOnId:dh},null,512)]),"bulk-update-actions":we(()=>[!E.value&&S.value.length>0?ze((q(),Ke(L(Ase),{key:0,selectRowData:tn.value,"workspace-id":p.workspaceId,"entity-id":p.entityId,"grid-api":w.value,onUnselect:L(ve),onSelectAll:L(Be),"take-name":re.value,"selected-all":Y.value,"total-rows":L(y).total,"visible-rows":L(y).loaded,onUpdated:L(en),loading:L(He),onRefreshSelectedRow:L(en)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","onUpdated","loading","onRefreshSelectedRow"])),[[cr,!E.value&&S.value.length>0]]):Ye("",!0)]),snackbar:we(()=>[ye(L(Jse))]),popup:we(()=>[ms.showPopupToolboxUploader?(q(),Ke(zTe,{key:0,ref_key:"popupToolboxUploaderRef",ref:Rt,"workspace-id":p.workspaceId,"entity-id":p.entityId,onImportSuccess:er,onHide:je[5]||(je[5]=Ft=>ms.showPopupToolboxUploader=!1)},null,8,["workspace-id","entity-id"])):Ye("",!0),ms.showPopupBulkUpdate?(q(),Ke(tDe,{key:1,ref_key:"popupBulkUpdateRef",ref:qt,"workspace-id":p.workspaceId,"entity-id":p.entityId,onImportSuccess:er,onHide:je[6]||(je[6]=Ft=>ms.showPopupBulkUpdate=!1)},null,8,["workspace-id","entity-id"])):Ye("",!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"}}]]),$G="0.1.249",oDe={key:0},sDe=_t(nt({__name:"app",setup(e){const t=X(()=>n.id.length===0||n.workspaceId.length===0),n=Oo({id:"",workspaceId:"",apiConfig:{}}),o=_s(),{showMessage:s,showErrorNetMessage:r}=o,i=["basicInfor","importItems"],a=h=>{h.success?s(h.apiCode,"success"):i.includes(h.apiCode)||r(h)},l=$(null),u=()=>{const h=un.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};Bh(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",$G);try{if(l.value=oo(),!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)||un.getInstance().getItem("ws.code");const g={domainApi:u(),wsCode:un.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 ON(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),Vn(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const c=X(()=>n.id),d=X(()=>n.workspaceId);return ci("workspaceId",d),ci("entityId",c),(h,f)=>(q(),de("div",{class:le(h.$style.dashboardPluginWrapper)},[t.value?(q(),de("span",oDe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):c.value?(q(),Ke(L(nDe),{key:1,entityId:c.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Ye("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),hT=async(e={},t={})=>{const n=gI(sDe),o=n5();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,u)=>{console.error("[Vue Error]",a),u&&console.error("[Info]",u)},console.log(`%cArbo Dashboard Plugin v${$G}`,"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",xo);const i=await Sue();return n.use(i),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=hT),Ln.default=hT,Ln.initDashboard=hT,Object.defineProperties(Ln,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});